From: support Date: Wed, 2 Nov 2022 06:13:53 +0000 (+0000) Subject: Built motion from commit 8f498182.|2.6.21 X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css//%22%7B%7Blicense.mail?a=commitdiff_plain;h=b627843ac855946c7ff45214ae2e31de12400c2a;p=motion2.git Built motion from commit 8f498182.|2.6.21 --- diff --git a/apidoc/api_project.js b/apidoc/api_project.js index bc2b834..4709cdc 100644 --- a/apidoc/api_project.js +++ b/apidoc/api_project.js @@ -1,6 +1,6 @@ define({ "name": "xCALLY Motion API", - "version": "2.6.19", + "version": "2.6.21", "description": "Thank you for choosing xCALLY MOTION, one of the first Omni Channel solution integrated with AsteriskTM and the most innovative real time solutions available on the market.", "title": "xCALLY MOTION API", "header": { @@ -17,7 +17,7 @@ define({ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-10-28T05:14:06.369Z", + "time": "2022-11-02T06:05:17.961Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index a6387a0..f5125fe 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -1,6 +1,6 @@ { "name": "xCALLY Motion API", - "version": "2.6.19", + "version": "2.6.21", "description": "Thank you for choosing xCALLY MOTION, one of the first Omni Channel solution integrated with AsteriskTM and the most innovative real time solutions available on the market.", "title": "xCALLY MOTION API", "header": { @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-10-28T05:14:06.369Z", + "time": "2022-11-02T06:05:17.961Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 0549b25..efe6876 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "motion", - "version": "2.6.19", + "version": "2.6.21", "dependencies": { "@babel/code-frame": { "version": "7.18.6", diff --git a/package.json b/package.json index f66562f..69f22db 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "motion", - "version": "2.6.19", + "version": "2.6.21", "description": "xCALLY Motion is the new Realtime asynchronous solution for your multichannel contact center over Asterisk.", "main": "server/app.js", "engines": { diff --git a/public/app/main/apps/staff/i18n/it.json b/public/app/main/apps/staff/i18n/it.json index 5d106f4..9515685 100644 --- a/public/app/main/apps/staff/i18n/it.json +++ b/public/app/main/apps/staff/i18n/it.json @@ -412,17 +412,17 @@ "AD_SSO_ENABLED": "SSO di Active Directory", "AUTHENTICATION": "Autenticazione", "AUTO_ANSWER": "Risposta automatica", - "CHAT_AUTOANSWER": "Risposta automatica via Chat", - "CHAT_AUTOANSWERDELAY": "Ritardo risposta automatica via Chat [s]", - "EMAIL_AUTOANSWER": "Risposta automatica via Email", - "EMAIL_AUTOANSWERDELAY": "Ritardo risposta automatica via Email [i]", - "FAX_AUTOANSWER": "Risposta automatica via Fax", - "FAX_AUTOANSWERDELAY": "Ritardo risposta automatica Fax [s]", - "OPENCHANNEL_AUTOANSWER": "Risposta automatica via Openchannel", - "OPENCHANNEL_AUTOANSWERDELAY": "Ritardo risposta automatica via Openchannel [s]", - "SMS_AUTOANSWER": "Risposta automatica via Sms", - "SMS_AUTOANSWERDELAY": "Ritardo risposta automatica via Sms [s]", - "WHATSAPP_AUTOANSWER": "Risposta automatica via Whatsapp", - "WHATSAPP_AUTOANSWERDELAY": "Ritardo risposta automatica via Whatsapp [s]" + "CHAT_AUTOANSWER": "Risposta automatica della chat", + "CHAT_AUTOANSWERDELAY": "Ritardo risposta automatica chat [s]", + "EMAIL_AUTOANSWER": "Risposta automatica via e-mail", + "EMAIL_AUTOANSWERDELAY": "Ritardo risposta automatica e-mail [i]", + "FAX_AUTOANSWER": "Risposta automatica via fax", + "FAX_AUTOANSWERDELAY": "Ritardo risposta automatica fax [s]", + "OPENCHANNEL_AUTOANSWER": "Risposta automatica a canale aperto", + "OPENCHANNEL_AUTOANSWERDELAY": "Ritardo risposta automatica canale aperto [s]", + "SMS_AUTOANSWER": "Sms risposta automatica", + "SMS_AUTOANSWERDELAY": "Ritardo risposta automatica SMS [s]", + "WHATSAPP_AUTOANSWER": "Whatsapp risposta automatica", + "WHATSAPP_AUTOANSWERDELAY": "Ritardo risposta automatica Whatsapp [s]" } } diff --git a/public/app/toolbar/i18n/it.json b/public/app/toolbar/i18n/it.json index 4796dd7..0d9949a 100644 --- a/public/app/toolbar/i18n/it.json +++ b/public/app/toolbar/i18n/it.json @@ -117,14 +117,14 @@ "AUTOANSWER_NOTIFICATIONS": "Notifiche di risposta automatica", "CHANNEL": "Canale", "CHANNELS": "Canali", - "CHAT": "Chat", + "CHAT": "Chiacchierata", "DELAY": "Ritardo risposta automatica [sec]", "EMAIL": "E-mail", "FAX": "Fax", "NOTIFICATIONS": "Risposta automatica abilitata", "NUM_NOTIFICATIONS": "Notifiche", - "OPENCHANNEL": "Openchannel", - "SMS": "Sms", + "OPENCHANNEL": "Canale aperto", + "SMS": "sms", "WHATSAPP": "WhatsApp", "NO_AUTOANSWER_CONFIGURED": "Nessuna risposta automatica configurata per i canali", "BOSNIAN": "bosniaco", diff --git a/server/api/action/action.attributes.js b/server/api/action/action.attributes.js index ee363b8..8568387 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 _0x4b57=['sequelize','exports','VIRTUAL','action','STRING','contactManager','integration','motionbar','urlForward','browser','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[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT'];(function(_0xabb865,_0x1a4197){var _0x1519e8=function(_0x5c8b0d){while(--_0x5c8b0d){_0xabb865['push'](_0xabb865['shift']());}};_0x1519e8(++_0x1a4197);}(_0x4b57,0xaa));var _0x74b5=function(_0xbf8ec1,_0x9169c8){_0xbf8ec1=_0xbf8ec1-0x0;var _0xc84567=_0x4b57[_0xbf8ec1];return _0xc84567;};'use strict';var Sequelize=require(_0x74b5('0x0'));module[_0x74b5('0x1')]={'name':{'type':Sequelize[_0x74b5('0x2')],'get':function(_0x12582c){return this['getDataValue'](_0x74b5('0x3'));}},'action':{'type':Sequelize[_0x74b5('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x74b5('0x5'),_0x74b5('0x6'),_0x74b5('0x7'),'jscripty',_0x74b5('0x8'),_0x74b5('0x9'),'bot','script']],'msg':_0x74b5('0xa')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0x74b5('0x4')](0x1000),'comment':_0x74b5('0xb')},'data2':{'type':Sequelize[_0x74b5('0x4')](0x1000),'comment':_0x74b5('0xc')},'data3':{'type':Sequelize['STRING'](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[_0x74b5('0x4')](0x1000),'comments':_0x74b5('0xd')},'data5':{'type':Sequelize[_0x74b5('0x4')](0x1000),'comments':_0x74b5('0xe')},'data6':{'type':Sequelize[_0x74b5('0x4')],'comments':_0x74b5('0xf')},'data7':{'type':Sequelize[_0x74b5('0x10')],'comments':'urlForward[body]'}}; \ No newline at end of file +var _0xdb60=['urlForward[body]','sequelize','VIRTUAL','getDataValue','contactManager','integration','jscripty','urlForward','browser','bot','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','TEXT'];(function(_0x56b2c9,_0x38d9e6){var _0x1624bb=function(_0x4d1872){while(--_0x4d1872){_0x56b2c9['push'](_0x56b2c9['shift']());}};_0x1624bb(++_0x38d9e6);}(_0xdb60,0xd3));var _0x0db6=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xdb60[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0x0db6('0x0'));module['exports']={'name':{'type':Sequelize[_0x0db6('0x1')],'get':function(_0x423982){return this[_0x0db6('0x2')]('action');}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0x0db6('0x3'),_0x0db6('0x4'),'motionbar',_0x0db6('0x5'),_0x0db6('0x6'),_0x0db6('0x7'),_0x0db6('0x8'),'script']],'msg':_0x0db6('0x9')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0x0db6('0xa')](0x1000),'comment':'jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]'},'data2':{'type':Sequelize[_0x0db6('0xa')](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize[_0x0db6('0xa')](0x1000),'comment':_0x0db6('0xb')},'data4':{'type':Sequelize['STRING'](0x1000),'comments':_0x0db6('0xc')},'data5':{'type':Sequelize['STRING'](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize['STRING'],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize[_0x0db6('0xd')],'comments':_0x0db6('0xe')}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index d703a2b..561f7fa 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 _0x51fc=['moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','offset','undefined','limit','count','Content-Range','apply','save','update','then','end','error','name','send','body','Action','find','params','catch','destroy','rimraf','zip-dir'];(function(_0x32f8a2,_0x49c502){var _0x258cca=function(_0x1040e4){while(--_0x1040e4){_0x32f8a2['push'](_0x32f8a2['shift']());}};_0x258cca(++_0x49c502);}(_0x51fc,0x1c0));var _0xc51f=function(_0x293055,_0x10e0b1){_0x293055=_0x293055-0x0;var _0x19c83a=_0x51fc[_0x293055];return _0x19c83a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc51f('0x0'));var zipdir=require(_0xc51f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xc51f('0x2'));var BPromise=require(_0xc51f('0x3'));var Mustache=require(_0xc51f('0x4'));var util=require(_0xc51f('0x5'));var path=require('path');var sox=require(_0xc51f('0x6'));var csv=require(_0xc51f('0x7'));var ejs=require(_0xc51f('0x8'));var fs=require('fs');var fs_extra=require(_0xc51f('0x9'));var _=require(_0xc51f('0xa'));var squel=require(_0xc51f('0xb'));var crypto=require(_0xc51f('0xc'));var jsforce=require(_0xc51f('0xd'));var deskjs=require(_0xc51f('0xe'));var toCsv=require(_0xc51f('0x7'));var querystring=require(_0xc51f('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xc51f('0x10'));var qs=require(_0xc51f('0x11'));var as=require(_0xc51f('0x12'));var hardwareService=require(_0xc51f('0x13'));var logger=require('../../config/logger')(_0xc51f('0x14'));var utils=require(_0xc51f('0x15'));var config=require(_0xc51f('0x16'));var licenseUtil=require(_0xc51f('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x15692e,_0x47b162){_0x47b162=_0x47b162||0xcc;return function(_0x49de0d){if(_0x49de0d){return _0x15692e[_0xc51f('0x18')](_0x47b162);}return _0x15692e[_0xc51f('0x19')](_0x47b162)['end']();};}function respondWithResult(_0x27c8bf,_0x21245d){_0x21245d=_0x21245d||0xc8;return function(_0x4c9572){if(_0x4c9572){return _0x27c8bf[_0xc51f('0x19')](_0x21245d)['json'](_0x4c9572);}};}function respondWithFilteredResult(_0x776feb,_0x54987d){return function(_0x23bce4){if(_0x23bce4){var _0x5137af=typeof _0x54987d[_0xc51f('0x1a')]===_0xc51f('0x1b')&&typeof _0x54987d[_0xc51f('0x1c')]===_0xc51f('0x1b');var _0x471bd5=_0x23bce4[_0xc51f('0x1d')];var _0x312728=_0x5137af?0x0:_0x54987d[_0xc51f('0x1a')];var _0x9330c3=_0x5137af?_0x23bce4['count']:_0x54987d['offset']+_0x54987d[_0xc51f('0x1c')];var _0xec821c;if(_0x9330c3>=_0x471bd5){_0x9330c3=_0x471bd5;_0xec821c=0xc8;}else{_0xec821c=0xce;}_0x776feb['status'](_0xec821c);return _0x776feb['set'](_0xc51f('0x1e'),_0x312728+'-'+_0x9330c3+'/'+_0x471bd5)['json'](_0x23bce4);}return null;};}function patchUpdates(_0x296cc6){return function(_0x4e7c2b){try{jsonpatch[_0xc51f('0x1f')](_0x4e7c2b,_0x296cc6,!![]);}catch(_0x267636){return BPromise['reject'](_0x267636);}return _0x4e7c2b[_0xc51f('0x20')]();};}function saveUpdates(_0x3d0693,_0x3ea232){return function(_0x5eb2c6){if(_0x5eb2c6){return _0x5eb2c6[_0xc51f('0x21')](_0x3d0693)[_0xc51f('0x22')](function(_0x42b6c6){return _0x42b6c6;});}return null;};}function removeEntity(_0x441566,_0x412f81){return function(_0x1634ed){if(_0x1634ed){return _0x1634ed['destroy']()[_0xc51f('0x22')](function(){_0x441566[_0xc51f('0x19')](0xcc)[_0xc51f('0x23')]();});}};}function handleEntityNotFound(_0x2df61e,_0x5b22ba){return function(_0x5136b9){if(!_0x5136b9){_0x2df61e[_0xc51f('0x18')](0x194);}return _0x5136b9;};}function handleError(_0x19c448,_0x5c7ee1){_0x5c7ee1=_0x5c7ee1||0x1f4;return function(_0x1ddca9){logger[_0xc51f('0x24')](_0x1ddca9['stack']);if(_0x1ddca9[_0xc51f('0x25')]){delete _0x1ddca9[_0xc51f('0x25')];}_0x19c448[_0xc51f('0x19')](_0x5c7ee1)[_0xc51f('0x26')](_0x1ddca9);};}exports[_0xc51f('0x21')]=function(_0x122f01,_0x3e156d){if(_0x122f01[_0xc51f('0x27')]['id']){delete _0x122f01['body']['id'];}return db[_0xc51f('0x28')][_0xc51f('0x29')]({'where':{'id':_0x122f01[_0xc51f('0x2a')]['id']}})[_0xc51f('0x22')](handleEntityNotFound(_0x3e156d,null))[_0xc51f('0x22')](saveUpdates(_0x122f01[_0xc51f('0x27')],null))[_0xc51f('0x22')](respondWithResult(_0x3e156d,null))[_0xc51f('0x2b')](handleError(_0x3e156d,null));};exports[_0xc51f('0x2c')]=function(_0x31f561,_0x2cc0f4){return db[_0xc51f('0x28')][_0xc51f('0x29')]({'where':{'id':_0x31f561[_0xc51f('0x2a')]['id']}})['then'](handleEntityNotFound(_0x2cc0f4,null))[_0xc51f('0x22')](removeEntity(_0x2cc0f4,null))[_0xc51f('0x2b')](handleError(_0x2cc0f4,null));}; \ No newline at end of file +var _0x2a85=['desk.js','querystring','papaparse','../../components/auth/service','../../config/logger','../../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','Action','find','params','catch','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce'];(function(_0xca8554,_0x5255c5){var _0x4a4185=function(_0x33e052){while(--_0x33e052){_0xca8554['push'](_0xca8554['shift']());}};_0x4a4185(++_0x5255c5);}(_0x2a85,0x171));var _0x52a8=function(_0x676c61,_0x5f5b08){_0x676c61=_0x676c61-0x0;var _0x1c000d=_0x2a85[_0x676c61];return _0x1c000d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x52a8('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x52a8('0x1'));var rp=require(_0x52a8('0x2'));var moment=require(_0x52a8('0x3'));var BPromise=require(_0x52a8('0x4'));var Mustache=require(_0x52a8('0x5'));var util=require(_0x52a8('0x6'));var path=require(_0x52a8('0x7'));var sox=require(_0x52a8('0x8'));var csv=require(_0x52a8('0x9'));var ejs=require(_0x52a8('0xa'));var fs=require('fs');var fs_extra=require(_0x52a8('0xb'));var _=require(_0x52a8('0xc'));var squel=require(_0x52a8('0xd'));var crypto=require('crypto');var jsforce=require(_0x52a8('0xe'));var deskjs=require(_0x52a8('0xf'));var toCsv=require('to-csv');var querystring=require(_0x52a8('0x10'));var Papa=require(_0x52a8('0x11'));var Redis=require('ioredis');var authService=require(_0x52a8('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x52a8('0x13'))('api');var utils=require(_0x52a8('0x14'));var config=require(_0x52a8('0x15'));var licenseUtil=require(_0x52a8('0x16'));var db=require(_0x52a8('0x17'))['db'];function respondWithStatusCode(_0x25c7be,_0x5d7eb2){_0x5d7eb2=_0x5d7eb2||0xcc;return function(_0x212a08){if(_0x212a08){return _0x25c7be[_0x52a8('0x18')](_0x5d7eb2);}return _0x25c7be[_0x52a8('0x19')](_0x5d7eb2)[_0x52a8('0x1a')]();};}function respondWithResult(_0x255eaa,_0x4200c2){_0x4200c2=_0x4200c2||0xc8;return function(_0x2e5f86){if(_0x2e5f86){return _0x255eaa[_0x52a8('0x19')](_0x4200c2)[_0x52a8('0x1b')](_0x2e5f86);}};}function respondWithFilteredResult(_0x3305d2,_0x10a7f3){return function(_0xcf4c84){if(_0xcf4c84){var _0x37d4c4=typeof _0x10a7f3[_0x52a8('0x1c')]===_0x52a8('0x1d')&&typeof _0x10a7f3['limit']==='undefined';var _0x340548=_0xcf4c84[_0x52a8('0x1e')];var _0x44f660=_0x37d4c4?0x0:_0x10a7f3[_0x52a8('0x1c')];var _0x1bc9df=_0x37d4c4?_0xcf4c84['count']:_0x10a7f3[_0x52a8('0x1c')]+_0x10a7f3[_0x52a8('0x1f')];var _0x20ddc0;if(_0x1bc9df>=_0x340548){_0x1bc9df=_0x340548;_0x20ddc0=0xc8;}else{_0x20ddc0=0xce;}_0x3305d2[_0x52a8('0x19')](_0x20ddc0);return _0x3305d2[_0x52a8('0x20')](_0x52a8('0x21'),_0x44f660+'-'+_0x1bc9df+'/'+_0x340548)[_0x52a8('0x1b')](_0xcf4c84);}return null;};}function patchUpdates(_0x750b11){return function(_0x3d71a5){try{jsonpatch['apply'](_0x3d71a5,_0x750b11,!![]);}catch(_0x117c91){return BPromise[_0x52a8('0x22')](_0x117c91);}return _0x3d71a5[_0x52a8('0x23')]();};}function saveUpdates(_0x3bff08,_0x29306d){return function(_0x5814f9){if(_0x5814f9){return _0x5814f9[_0x52a8('0x24')](_0x3bff08)[_0x52a8('0x25')](function(_0x10e1d1){return _0x10e1d1;});}return null;};}function removeEntity(_0x3a1b68,_0x14cefe){return function(_0x5b59f2){if(_0x5b59f2){return _0x5b59f2[_0x52a8('0x26')]()[_0x52a8('0x25')](function(){_0x3a1b68['status'](0xcc)[_0x52a8('0x1a')]();});}};}function handleEntityNotFound(_0x4264a8,_0x36e5d7){return function(_0x46c859){if(!_0x46c859){_0x4264a8[_0x52a8('0x18')](0x194);}return _0x46c859;};}function handleError(_0x3962b4,_0x2c2c21){_0x2c2c21=_0x2c2c21||0x1f4;return function(_0x428291){logger[_0x52a8('0x27')](_0x428291[_0x52a8('0x28')]);if(_0x428291[_0x52a8('0x29')]){delete _0x428291['name'];}_0x3962b4[_0x52a8('0x19')](_0x2c2c21)[_0x52a8('0x2a')](_0x428291);};}exports[_0x52a8('0x24')]=function(_0x249b12,_0x550f32){if(_0x249b12[_0x52a8('0x2b')]['id']){delete _0x249b12[_0x52a8('0x2b')]['id'];}return db['Action']['find']({'where':{'id':_0x249b12['params']['id']}})[_0x52a8('0x25')](handleEntityNotFound(_0x550f32,null))[_0x52a8('0x25')](saveUpdates(_0x249b12['body'],null))['then'](respondWithResult(_0x550f32,null))['catch'](handleError(_0x550f32,null));};exports[_0x52a8('0x26')]=function(_0x3f6d70,_0x326d8a){return db[_0x52a8('0x2c')][_0x52a8('0x2d')]({'where':{'id':_0x3f6d70[_0x52a8('0x2e')]['id']}})[_0x52a8('0x25')](handleEntityNotFound(_0x326d8a,null))[_0x52a8('0x25')](removeEntity(_0x326d8a,null))[_0x52a8('0x2f')](handleError(_0x326d8a,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index c36fa28..38c2029 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 _0xb789=['path','rimraf','../../config/environment','./action.attributes','define','tools_actions','lodash','../../config/logger','api','request-promise'];(function(_0x2d3f1d,_0x2a0715){var _0x19b6fc=function(_0x58bec8){while(--_0x58bec8){_0x2d3f1d['push'](_0x2d3f1d['shift']());}};_0x19b6fc(++_0x2a0715);}(_0xb789,0x1c8));var _0x9b78=function(_0xd3978b,_0x5cf5de){_0xd3978b=_0xd3978b-0x0;var _0x4c7145=_0xb789[_0xd3978b];return _0x4c7145;};'use strict';var _=require(_0x9b78('0x0'));var util=require('util');var logger=require(_0x9b78('0x1'))(_0x9b78('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9b78('0x3'));var fs=require('fs');var path=require(_0x9b78('0x4'));var rimraf=require(_0x9b78('0x5'));var config=require(_0x9b78('0x6'));var attributes=require(_0x9b78('0x7'));module['exports']=function(_0x3ecd87,_0x4231f6){return _0x3ecd87[_0x9b78('0x8')]('Action',attributes,{'tableName':_0x9b78('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0d5a=['exports','Action','util','api','moment','bluebird','request-promise','path','../../config/environment','./action.attributes'];(function(_0x92651e,_0x2c5afe){var _0x45cf22=function(_0x91bcc3){while(--_0x91bcc3){_0x92651e['push'](_0x92651e['shift']());}};_0x45cf22(++_0x2c5afe);}(_0x0d5a,0xe8));var _0xa0d5=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x0d5a[_0x6c993a];return _0x27f547;};'use strict';var _=require('lodash');var util=require(_0xa0d5('0x0'));var logger=require('../../config/logger')(_0xa0d5('0x1'));var moment=require(_0xa0d5('0x2'));var BPromise=require(_0xa0d5('0x3'));var rp=require(_0xa0d5('0x4'));var fs=require('fs');var path=require(_0xa0d5('0x5'));var rimraf=require('rimraf');var config=require(_0xa0d5('0x6'));var attributes=require(_0xa0d5('0x7'));module[_0xa0d5('0x8')]=function(_0x39184c,_0x4015b4){return _0x39184c['define'](_0xa0d5('0x9'),attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js index 2c904b9..731894c 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(_0x2da8a2,_0x2f7bf1){var _0x1d7a1b=function(_0x45d295){while(--_0x45d295){_0x2da8a2['push'](_0x2da8a2['shift']());}};_0x1d7a1b(++_0x2f7bf1);}(_0x1261,0x144));var _0x1126=function(_0x352d28,_0x444033){_0x352d28=_0x352d28-0x0;var _0x387d7e=_0x1261[_0x352d28];return _0x387d7e;};'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 _0x7fbe=['request','then','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x1691e0,_0x290625){var _0x52b537=function(_0x40026a){while(--_0x40026a){_0x1691e0['push'](_0x1691e0['shift']());}};_0x52b537(++_0x290625);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x381f7f,_0x1321a9){_0x381f7f=_0x381f7f-0x0;var _0xd2ae6d=_0x7fbe[_0x381f7f];return _0xd2ae6d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe7fb('0x0'));var BPromise=require(_0xe7fb('0x1'));var rs=require(_0xe7fb('0x2'));var fs=require('fs');var Redis=require(_0xe7fb('0x3'));var db=require(_0xe7fb('0x4'))['db'];var utils=require(_0xe7fb('0x5'));var logger=require(_0xe7fb('0x6'))(_0xe7fb('0x7'));var config=require(_0xe7fb('0x8'));var jayson=require(_0xe7fb('0x9'));var client=jayson[_0xe7fb('0xa')][_0xe7fb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x24cd67,_0x1f943f,_0x5ad75b){return new BPromise(function(_0x213ebc,_0x228f6b){return client[_0xe7fb('0xc')](_0x24cd67,_0x5ad75b)[_0xe7fb('0xd')](function(_0x4ba197){logger['info'](_0xe7fb('0xe'),_0x1f943f,_0xe7fb('0xf'));logger[_0xe7fb('0x10')](_0xe7fb('0x11'),_0x1f943f,_0xe7fb('0xf'),JSON[_0xe7fb('0x12')](_0x4ba197));if(_0x4ba197[_0xe7fb('0x13')]){if(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x14')]===0x1f4){logger[_0xe7fb('0x13')](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);return _0x228f6b(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')]['message']);return _0x213ebc(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}else{logger['info'](_0xe7fb('0xe'),_0x1f943f,'request\x20sent');_0x213ebc(_0x4ba197[_0xe7fb('0x16')][_0xe7fb('0x15')]);}})[_0xe7fb('0x17')](function(_0x17e8a8){logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x17e8a8);_0x228f6b(_0x17e8a8);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index 5c48453..f04a07f 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 _0x9c0f=['Router','../../components/interaction/service','../../config/environment','./action.controller','put','/:id','isAuthenticated','delete','destroy','connect-timeout'];(function(_0x2e6ab8,_0x4ea85c){var _0x16cba0=function(_0x4b3776){while(--_0x4b3776){_0x2e6ab8['push'](_0x2e6ab8['shift']());}};_0x16cba0(++_0x4ea85c);}(_0x9c0f,0x199));var _0xf9c0=function(_0x121886,_0x8cd8e5){_0x121886=_0x121886-0x0;var _0x20ca01=_0x9c0f[_0x121886];return _0x20ca01;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xf9c0('0x0'));var express=require('express');var router=express[_0xf9c0('0x1')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xf9c0('0x2'));var config=require(_0xf9c0('0x3'));var controller=require(_0xf9c0('0x4'));router[_0xf9c0('0x5')](_0xf9c0('0x6'),auth[_0xf9c0('0x7')](),controller['update']);router[_0xf9c0('0x8')](_0xf9c0('0x6'),auth[_0xf9c0('0x7')](),controller[_0xf9c0('0x9')]);module['exports']=router; \ No newline at end of file +var _0x7b99=['./action.controller','put','/:id','update','delete','destroy','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x6596e,_0xa89aa3){var _0x5596ce=function(_0x5acf59){while(--_0x5acf59){_0x6596e['push'](_0x6596e['shift']());}};_0x5596ce(++_0xa89aa3);}(_0x7b99,0xa2));var _0x97b9=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x7b99[_0x122ef9];return _0x42fba0;};'use strict';var multer=require('multer');var util=require(_0x97b9('0x0'));var path=require(_0x97b9('0x1'));var timeout=require(_0x97b9('0x2'));var express=require('express');var router=express[_0x97b9('0x3')]();var fs_extra=require(_0x97b9('0x4'));var auth=require(_0x97b9('0x5'));var interaction=require(_0x97b9('0x6'));var config=require('../../config/environment');var controller=require(_0x97b9('0x7'));router[_0x97b9('0x8')](_0x97b9('0x9'),auth['isAuthenticated'](),controller[_0x97b9('0xa')]);router[_0x97b9('0xb')](_0x97b9('0x9'),auth['isAuthenticated'](),controller[_0x97b9('0xc')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index d8eb1df..ec0b0fc 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 _0xeec6=['STRING','TEXT','sequelize','exports'];(function(_0xa0139d,_0x3f1109){var _0x5b6d49=function(_0x5cddfc){while(--_0x5cddfc){_0xa0139d['push'](_0xa0139d['shift']());}};_0x5b6d49(++_0x3f1109);}(_0xeec6,0x1c2));var _0x6eec=function(_0x180bc5,_0x17fd8d){_0x180bc5=_0x180bc5-0x0;var _0x310566=_0xeec6[_0x180bc5];return _0x310566;};'use strict';var Sequelize=require(_0x6eec('0x0'));module[_0x6eec('0x1')]={'name':{'type':Sequelize[_0x6eec('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x6eec('0x2')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0x6eec('0x2')]},'conditions':{'type':Sequelize[_0x6eec('0x3')]},'joins':{'type':Sequelize[_0x6eec('0x3')]}}; \ No newline at end of file +var _0xfdbd=['sequelize','exports','STRING','TEXT'];(function(_0x2718c7,_0x5a1636){var _0x59d89c=function(_0x4d4f49){while(--_0x4d4f49){_0x2718c7['push'](_0x2718c7['shift']());}};_0x59d89c(++_0x5a1636);}(_0xfdbd,0xf0));var _0xdfdb=function(_0x2e5f9c,_0x134a52){_0x2e5f9c=_0x2e5f9c-0x0;var _0x538b44=_0xfdbd[_0x2e5f9c];return _0x538b44;};'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 diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index 378a2d2..a1506c7 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 _0x832e=['groupBy','orderBy','order','DESC','alias','joins','parse','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','parentKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','left_join','COUNT(DISTINCT\x20%s)','HOUR(%s)','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','condition','getFields','ValidationErrorItem','output','web','%s-%s.%s','randomstring','generate','csv','custom','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','child_process','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','runReport','COUNT(%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','ROUND(%s)','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','update','then','destroy','get','stack','name','send','index','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','fields','attributes','length','nolimit','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','AnalyticCustomReport','findAll','show','options','find','catch','create','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','CustomReports','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','join','right_join','cross_join','SUM(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','rules','operator','group','field','value','params','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format'];(function(_0x47271b,_0x2fd7d7){var _0x24aa67=function(_0x5a7376){while(--_0x5a7376){_0x47271b['push'](_0x47271b['shift']());}};_0x24aa67(++_0x2fd7d7);}(_0x832e,0x17b));var _0xe832=function(_0x1c5572,_0x2b93aa){_0x1c5572=_0x1c5572-0x0;var _0x341a36=_0x832e[_0x1c5572];return _0x341a36;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe832('0x0'));var jsonpatch=require(_0xe832('0x1'));var rp=require(_0xe832('0x2'));var moment=require(_0xe832('0x3'));var BPromise=require(_0xe832('0x4'));var Mustache=require(_0xe832('0x5'));var util=require(_0xe832('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xe832('0x7'));var ejs=require(_0xe832('0x8'));var fs=require('fs');var fs_extra=require(_0xe832('0x9'));var _=require(_0xe832('0xa'));var squel=require(_0xe832('0xb'));var crypto=require(_0xe832('0xc'));var jsforce=require(_0xe832('0xd'));var deskjs=require(_0xe832('0xe'));var toCsv=require(_0xe832('0x7'));var querystring=require('querystring');var Papa=require(_0xe832('0xf'));var Redis=require('ioredis');var authService=require(_0xe832('0x10'));var qs=require(_0xe832('0x11'));var as=require(_0xe832('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe832('0x13'))(_0xe832('0x14'));var utils=require(_0xe832('0x15'));var config=require(_0xe832('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xe832('0x17'))['db'];var dbH=require(_0xe832('0x17'))['dbH'];function respondWithStatusCode(_0x4669b4,_0x3c46d3){_0x3c46d3=_0x3c46d3||0xcc;return function(_0x4c857b){if(_0x4c857b){return _0x4669b4[_0xe832('0x18')](_0x3c46d3);}return _0x4669b4[_0xe832('0x19')](_0x3c46d3)[_0xe832('0x1a')]();};}function respondWithResult(_0x124d4c,_0x312999){_0x312999=_0x312999||0xc8;return function(_0x3d8782){if(_0x3d8782){return _0x124d4c[_0xe832('0x19')](_0x312999)[_0xe832('0x1b')](_0x3d8782);}};}function respondWithFilteredResult(_0x4e3995,_0x3d8382){return function(_0xd70f2e){if(_0xd70f2e){var _0x918070=typeof _0x3d8382['offset']===_0xe832('0x1c')&&typeof _0x3d8382[_0xe832('0x1d')]===_0xe832('0x1c');var _0x382e95=_0xd70f2e['count'];var _0x346cbb=_0x918070?0x0:_0x3d8382[_0xe832('0x1e')];var _0x4d1603=_0x918070?_0xd70f2e[_0xe832('0x1f')]:_0x3d8382['offset']+_0x3d8382[_0xe832('0x1d')];var _0x45e24a;if(_0x4d1603>=_0x382e95){_0x4d1603=_0x382e95;_0x45e24a=0xc8;}else{_0x45e24a=0xce;}_0x4e3995[_0xe832('0x19')](_0x45e24a);return _0x4e3995[_0xe832('0x20')](_0xe832('0x21'),_0x346cbb+'-'+_0x4d1603+'/'+_0x382e95)['json'](_0xd70f2e);}return null;};}function patchUpdates(_0x3646b2){return function(_0x4753e3){try{jsonpatch[_0xe832('0x22')](_0x4753e3,_0x3646b2,!![]);}catch(_0x2e668c){return BPromise['reject'](_0x2e668c);}return _0x4753e3['save']();};}function saveUpdates(_0x57446a,_0xc4c62f){return function(_0x349553){if(_0x349553){return _0x349553[_0xe832('0x23')](_0x57446a)[_0xe832('0x24')](function(_0x596d30){return _0x596d30;});}return null;};}function removeEntity(_0x55c81f,_0x281a96){return function(_0x53984c){if(_0x53984c){return _0x53984c[_0xe832('0x25')]()[_0xe832('0x24')](function(){var _0x329ffd=_0x53984c[_0xe832('0x26')]({'plain':!![]});var _0x13420a='CustomReports';return db['UserProfileResource'][_0xe832('0x25')]({'where':{'type':_0x13420a,'resourceId':_0x329ffd['id']}})[_0xe832('0x24')](function(){return _0x53984c;});})[_0xe832('0x24')](function(){_0x55c81f[_0xe832('0x19')](0xcc)[_0xe832('0x1a')]();});}};}function handleEntityNotFound(_0x53d622,_0x5b3cab){return function(_0x55c508){if(!_0x55c508){_0x53d622[_0xe832('0x18')](0x194);}return _0x55c508;};}function handleError(_0x2c2737,_0x54497e){_0x54497e=_0x54497e||0x1f4;return function(_0x54a243){logger['error'](_0x54a243[_0xe832('0x27')]);if(_0x54a243['name']){delete _0x54a243[_0xe832('0x28')];}_0x2c2737['status'](_0x54497e)[_0xe832('0x29')](_0x54a243);};}exports[_0xe832('0x2a')]=function(_0x5391fc,_0x35d0d3){var _0x334433={},_0x583158={},_0x335d44={'count':0x0,'rows':[]};var _0x1c4c5e=_['map'](db['AnalyticCustomReport'][_0xe832('0x2b')],function(_0x4c162c){return{'name':_0x4c162c[_0xe832('0x2c')],'type':_0x4c162c[_0xe832('0x2d')][_0xe832('0x2e')]};});_0x583158['model']=_[_0xe832('0x2f')](_0x1c4c5e,_0xe832('0x28'));_0x583158[_0xe832('0x30')]=_[_0xe832('0x31')](_0x5391fc[_0xe832('0x30')]);_0x583158[_0xe832('0x32')]=_[_0xe832('0x33')](_0x583158[_0xe832('0x34')],_0x583158[_0xe832('0x30')]);_0x334433['attributes']=_[_0xe832('0x33')](_0x583158['model'],qs['fields'](_0x5391fc[_0xe832('0x30')][_0xe832('0x35')]));_0x334433[_0xe832('0x36')]=_0x334433[_0xe832('0x36')][_0xe832('0x37')]?_0x334433[_0xe832('0x36')]:_0x583158[_0xe832('0x34')];if(!_0x5391fc[_0xe832('0x30')]['hasOwnProperty'](_0xe832('0x38'))){_0x334433['limit']=qs['limit'](_0x5391fc['query'][_0xe832('0x1d')]);_0x334433[_0xe832('0x1e')]=qs['offset'](_0x5391fc[_0xe832('0x30')][_0xe832('0x1e')]);}_0x334433['order']=qs[_0xe832('0x39')](_0x5391fc[_0xe832('0x30')]['sort']);_0x334433[_0xe832('0x3a')]=qs['filters'](_[_0xe832('0x3b')](_0x5391fc[_0xe832('0x30')],_0x583158[_0xe832('0x32')]),_0x1c4c5e);if(_0x5391fc[_0xe832('0x30')]['filter']){_0x334433[_0xe832('0x3a')]=_[_0xe832('0x3c')](_0x334433[_0xe832('0x3a')],{'$or':_[_0xe832('0x2f')](_0x1c4c5e,function(_0x1dbaf8){if(_0x1dbaf8[_0xe832('0x2d')]!==_0xe832('0x3d')){var _0x4d8d03={};_0x4d8d03[_0x1dbaf8['name']]={'$like':'%'+_0x5391fc[_0xe832('0x30')][_0xe832('0x3e')]+'%'};return _0x4d8d03;}})});}_0x334433=_[_0xe832('0x3c')]({},_0x334433,_0x5391fc['options']);var _0x24f385={'where':_0x334433[_0xe832('0x3a')]};return db['AnalyticCustomReport'][_0xe832('0x1f')](_0x24f385)[_0xe832('0x24')](function(_0x233258){_0x335d44[_0xe832('0x1f')]=_0x233258;if(_0x5391fc[_0xe832('0x30')][_0xe832('0x3f')]){_0x334433[_0xe832('0x40')]=[{'all':!![]}];}return db[_0xe832('0x41')][_0xe832('0x42')](_0x334433);})[_0xe832('0x24')](function(_0x3a3671){_0x335d44['rows']=_0x3a3671;return _0x335d44;})['then'](respondWithFilteredResult(_0x35d0d3,_0x334433))['catch'](handleError(_0x35d0d3,null));};exports[_0xe832('0x43')]=function(_0x198afa,_0x580895){var _0x2f60da={'raw':![],'where':{'id':_0x198afa['params']['id']}},_0x33f68f={};_0x33f68f['model']=_['keys'](db[_0xe832('0x41')][_0xe832('0x2b')]);_0x33f68f[_0xe832('0x30')]=_[_0xe832('0x31')](_0x198afa[_0xe832('0x30')]);_0x33f68f[_0xe832('0x32')]=_[_0xe832('0x33')](_0x33f68f[_0xe832('0x34')],_0x33f68f[_0xe832('0x30')]);_0x2f60da[_0xe832('0x36')]=_[_0xe832('0x33')](_0x33f68f[_0xe832('0x34')],qs[_0xe832('0x35')](_0x198afa[_0xe832('0x30')]['fields']));_0x2f60da[_0xe832('0x36')]=_0x2f60da[_0xe832('0x36')][_0xe832('0x37')]?_0x2f60da['attributes']:_0x33f68f[_0xe832('0x34')];if(_0x198afa['query'][_0xe832('0x3f')]){_0x2f60da[_0xe832('0x40')]=[{'all':!![]}];}_0x2f60da=_[_0xe832('0x3c')]({},_0x2f60da,_0x198afa[_0xe832('0x44')]);return db[_0xe832('0x41')][_0xe832('0x45')](_0x2f60da)[_0xe832('0x24')](handleEntityNotFound(_0x580895,null))[_0xe832('0x24')](respondWithResult(_0x580895,null))[_0xe832('0x46')](handleError(_0x580895,null));};exports['create']=function(_0xfdcdbe,_0x18a560){return db[_0xe832('0x41')][_0xe832('0x47')](_0xfdcdbe['body'],{})[_0xe832('0x24')](function(_0x4110c4){var _0x2a62b4=_0xfdcdbe['user']['get']({'plain':!![]});if(!_0x2a62b4)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2a62b4['role']===_0xe832('0x48')){var _0x518de1=_0x4110c4[_0xe832('0x26')]({'plain':!![]});var _0xd67ff9='Reports';return db[_0xe832('0x49')][_0xe832('0x45')]({'where':{'name':_0xd67ff9,'userProfileId':_0x2a62b4[_0xe832('0x4a')]},'raw':!![]})['then'](function(_0x208622){if(_0x208622&&_0x208622[_0xe832('0x4b')]===0x0){return db[_0xe832('0x4c')][_0xe832('0x47')]({'name':_0x518de1[_0xe832('0x28')],'resourceId':_0x518de1['id'],'type':_0xe832('0x4d'),'sectionId':_0x208622['id']},{})['then'](function(){return _0x4110c4;});}else{return _0x4110c4;}})['catch'](function(_0x5ad382){logger[_0xe832('0x4e')](_0xe832('0x4f'),_0x5ad382);throw _0x5ad382;});}return _0x4110c4;})[_0xe832('0x24')](respondWithResult(_0x18a560,0xc9))[_0xe832('0x46')](handleError(_0x18a560,null));};exports[_0xe832('0x23')]=function(_0x37ae6e,_0x4b35b9){if(_0x37ae6e[_0xe832('0x50')]['id']){delete _0x37ae6e[_0xe832('0x50')]['id'];}return db[_0xe832('0x41')][_0xe832('0x45')]({'where':{'id':_0x37ae6e['params']['id']}})[_0xe832('0x24')](handleEntityNotFound(_0x4b35b9,null))[_0xe832('0x24')](saveUpdates(_0x37ae6e[_0xe832('0x50')],null))[_0xe832('0x24')](respondWithResult(_0x4b35b9,null))['catch'](handleError(_0x4b35b9,null));};exports[_0xe832('0x25')]=function(_0x394efe,_0xfd9c8e){return db[_0xe832('0x41')][_0xe832('0x45')]({'where':{'id':_0x394efe['params']['id']}})[_0xe832('0x24')](handleEntityNotFound(_0xfd9c8e,null))[_0xe832('0x24')](removeEntity(_0xfd9c8e,null))['catch'](handleError(_0xfd9c8e,null));};exports['preview']=function(_0x4b9aa8,_0x312ba1){var _0x3bbef8=0xa;var _0x42ce59=[_0xe832('0x51'),'left_join',_0xe832('0x52'),_0xe832('0x53')];var _0x107413={'SUM':_0xe832('0x54'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0xe832('0x55'),'GROUP_CONCAT':_0xe832('0x56'),'GROUP_CONCAT ASC':_0xe832('0x57'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x419508={'SEC_TO_TIME':_0xe832('0x58'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xe832('0x59')};var _0x50731c=function(_0x41e1c1){return!_[_0xe832('0x5a')]([_0xe832('0x5b'),'IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x41e1c1);};var _0x161e32=function(_0x162073){if(!_0x162073||!_0x162073[_0xe832('0x5c')]['length']){return'';}for(var _0x280c84='(',_0x544384=0x0;_0x544384<_0x162073[_0xe832('0x5c')][_0xe832('0x37')];_0x544384+=0x1){_0x544384>0x0&&(_0x280c84+='\x20'+_0x162073[_0xe832('0x5d')]+'\x20');_0x280c84+=_0x162073['rules'][_0x544384]['group']?_0x161e32(_0x162073[_0xe832('0x5c')][_0x544384][_0xe832('0x5e')]):_0x162073[_0xe832('0x5c')][_0x544384][_0xe832('0x5f')]+'\x20'+_0x162073[_0xe832('0x5c')][_0x544384]['condition']+(_0x50731c(_0x162073[_0xe832('0x5c')][_0x544384]['condition'])?'\x20'+_0x162073['rules'][_0x544384][_0xe832('0x60')]:'');}return _0x280c84+')';};var _0x4a01b5={'where':{'id':_0x4b9aa8[_0xe832('0x61')]['id']}},_0x38286e,_0x1be49d,_0x3c583e,_0x3cef74,_0x2d575e;_0x4a01b5=_['merge']({},_0x4a01b5,_0x4b9aa8[_0xe832('0x44')]);return db[_0xe832('0x41')][_0xe832('0x45')](_0x4a01b5)[_0xe832('0x24')](function(_0x59910e){if(_0x59910e){_0x38286e=_0x59910e;return _0x59910e['getFields']();}return null;})[_0xe832('0x24')](function(_0xa8c198){if(_0xa8c198){if(!_0xa8c198[_0xe832('0x37')]){throw new db[(_0xe832('0x62'))]['ValidationErrorItem'](_0xe832('0x63'),0x193);}_0x1be49d=_0xa8c198;return db[_0xe832('0x64')][_0xe832('0x42')]({'raw':!![]});}return null;})[_0xe832('0x24')](function(_0x304884){if(_0x304884){_0x3c583e=_[_0xe832('0x65')](_0x304884,'id');var _0x4f58b9;var _0x2778d7=squel[_0xe832('0x66')]();_0x2778d7[_0xe832('0x67')](_0x38286e[_0xe832('0x68')]);for(var _0x2ba799=0x0;_0x2ba799<_0x1be49d[_0xe832('0x37')];_0x2ba799+=0x1){_0x4f58b9=_0x1be49d[_0x2ba799][_0xe832('0x69')]?_0x3c583e[_0x1be49d[_0x2ba799][_0xe832('0x69')]][_0xe832('0x6a')]:_0x1be49d[_0x2ba799][_0xe832('0x5f')];_0x4f58b9=_0x1be49d[_0x2ba799][_0xe832('0x6b')]?_[_0xe832('0x6c')](_0x107413[_0x1be49d[_0x2ba799][_0xe832('0x6b')]],'%s',_0x4f58b9):_0x4f58b9;_0x4f58b9=_0x1be49d[_0x2ba799][_0xe832('0x6d')]?_[_0xe832('0x6c')](_0x419508[_0x1be49d[_0x2ba799][_0xe832('0x6d')]],'%s',_0x4f58b9):_0x4f58b9;if(_0x1be49d[_0x2ba799][_0xe832('0x6e')]){_0x2778d7[_0xe832('0x5e')](_0x4f58b9);}_0x1be49d[_0x2ba799][_0xe832('0x6f')]&&_0x2778d7[_0xe832('0x70')](_0x4f58b9,_0x1be49d[_0x2ba799][_0xe832('0x6f')]===_0xe832('0x71')?![]:!![]);_0x2778d7[_0xe832('0x5f')](_0x4f58b9,_0x1be49d[_0x2ba799][_0xe832('0x72')]||_0x4f58b9);}if(_0x38286e[_0xe832('0x73')]){_0x38286e['joins']=JSON[_0xe832('0x74')](_0x38286e['joins']);for(var _0x41e5f8=0x0;_0x41e5f8<_0x38286e[_0xe832('0x73')][_0xe832('0x37')];_0x41e5f8+=0x1){if(_0x38286e[_0xe832('0x73')][_0x41e5f8]['type']&&_[_0xe832('0x5a')](_0x42ce59,_0x38286e[_0xe832('0x73')][_0x41e5f8][_0xe832('0x2d')])&&_0x38286e[_0xe832('0x73')][_0x41e5f8]['parentKey']&&_0x38286e[_0xe832('0x73')][_0x41e5f8][_0xe832('0x75')]&&_0x38286e[_0xe832('0x73')][_0x41e5f8][_0xe832('0x76')]){_0x2778d7[_0x38286e[_0xe832('0x73')][_0x41e5f8][_0xe832('0x2d')]](_0x38286e[_0xe832('0x73')][_0x41e5f8]['foreignTable'],null,util['format'](_0xe832('0x77'),_0x38286e[_0xe832('0x68')],_0x38286e['joins'][_0x41e5f8][_0xe832('0x78')],_0x38286e[_0xe832('0x73')][_0x41e5f8]['foreignTable'],_0x38286e[_0xe832('0x73')][_0x41e5f8][_0xe832('0x76')]));}}}if(_0x38286e[_0xe832('0x79')]){_0x38286e[_0xe832('0x79')]=JSON[_0xe832('0x74')](_0x38286e['conditions']);_0x2778d7[_0xe832('0x3a')](_0x161e32(_0x38286e[_0xe832('0x79')][_0xe832('0x5e')]));}_0x2d575e=_0x2778d7[_0xe832('0x7a')]();_0x2778d7[_0xe832('0x1d')](_0x3bbef8);_0x2778d7['offset'](0x0);logger[_0xe832('0x7b')](_0xe832('0x7c'),_0x2778d7[_0xe832('0x7d')]());return dbH['sequelize'][_0xe832('0x30')](_0x2778d7['toString'](),{'type':dbH[_0xe832('0x7e')][_0xe832('0x7f')][_0xe832('0x80')]});}})[_0xe832('0x24')](respondWithResult(_0x312ba1,null))[_0xe832('0x46')](handleError(_0x312ba1,null));};function runReport(_0x29c6f8,_0x23d367,_0x455fe){var _0x5ca54f=_0x23d367[_0xe832('0x28')];var _0x2cd87f=0xa;var _0x199db9=['join',_0xe832('0x81'),_0xe832('0x52'),'cross_join'];var _0x329303={'SUM':_0xe832('0x54'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xe832('0x82'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0xe832('0x55'),'GROUP_CONCAT':_0xe832('0x56'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x4273d2={'SEC_TO_TIME':_0xe832('0x58'),'DATE':'DATE(%s)','HOUR':_0xe832('0x83'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xe832('0x59')};var _0x1a0807=function(_0xb4168c){return!_['includes']([_0xe832('0x5b'),_0xe832('0x84'),_0xe832('0x85'),_0xe832('0x86')],_0xb4168c);};var _0x496cd3=function(_0x8775ca){if(!_0x8775ca||!_0x8775ca[_0xe832('0x5c')][_0xe832('0x37')]){return'';}for(var _0x10f9a1='(',_0x5bff87=0x0;_0x5bff87<_0x8775ca[_0xe832('0x5c')][_0xe832('0x37')];_0x5bff87+=0x1){_0x5bff87>0x0&&(_0x10f9a1+='\x20'+_0x8775ca[_0xe832('0x5d')]+'\x20');_0x10f9a1+=_0x8775ca[_0xe832('0x5c')][_0x5bff87][_0xe832('0x5e')]?_0x496cd3(_0x8775ca[_0xe832('0x5c')][_0x5bff87][_0xe832('0x5e')]):_0x8775ca[_0xe832('0x5c')][_0x5bff87][_0xe832('0x5f')]+'\x20'+_0x8775ca[_0xe832('0x5c')][_0x5bff87][_0xe832('0x87')]+(_0x1a0807(_0x8775ca[_0xe832('0x5c')][_0x5bff87][_0xe832('0x87')])?'\x20'+_0x8775ca[_0xe832('0x5c')][_0x5bff87][_0xe832('0x60')]:'');}return _0x10f9a1+')';};var _0x39e271={'where':{'id':_0x29c6f8['id']}},_0x1b46a2,_0xe23634,_0xa802a1,_0x4659be,_0x514c83;_0x39e271=_[_0xe832('0x3c')]({},_0x39e271,_0x455fe);return db[_0xe832('0x41')][_0xe832('0x45')](_0x39e271)[_0xe832('0x24')](function(_0x1b92e8){if(_0x1b92e8){_0x1b46a2=_0x1b92e8;return _0x1b92e8[_0xe832('0x88')]();}return null;})['then'](function(_0x2e1914){if(_0x2e1914){if(!_0x2e1914['length']){throw new db[(_0xe832('0x62'))][(_0xe832('0x89'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0xe23634=_0x2e1914;return db[_0xe832('0x64')][_0xe832('0x42')]({'raw':!![]});}return null;})[_0xe832('0x24')](function(_0x2c8723){if(_0x2c8723){_0xa802a1=_[_0xe832('0x65')](_0x2c8723,'id');var _0x5a421d;var _0x5918d9=squel['select']();_0x5918d9[_0xe832('0x67')](_0x1b46a2[_0xe832('0x68')]);for(var _0x5dd1fd=0x0;_0x5dd1fd<_0xe23634['length'];_0x5dd1fd+=0x1){_0x5a421d=_0xe23634[_0x5dd1fd][_0xe832('0x69')]?_0xa802a1[_0xe23634[_0x5dd1fd][_0xe832('0x69')]][_0xe832('0x6a')]:_0xe23634[_0x5dd1fd][_0xe832('0x5f')];_0x5a421d=_0xe23634[_0x5dd1fd][_0xe832('0x6b')]?_[_0xe832('0x6c')](_0x329303[_0xe23634[_0x5dd1fd]['function']],'%s',_0x5a421d):_0x5a421d;_0x5a421d=_0xe23634[_0x5dd1fd][_0xe832('0x6d')]?_['replace'](_0x4273d2[_0xe23634[_0x5dd1fd][_0xe832('0x6d')]],'%s',_0x5a421d):_0x5a421d;if(_0xe23634[_0x5dd1fd][_0xe832('0x6e')]){_0x5918d9[_0xe832('0x5e')](_0x5a421d);}_0xe23634[_0x5dd1fd][_0xe832('0x6f')]&&_0x5918d9[_0xe832('0x70')](_0x5a421d,_0xe23634[_0x5dd1fd][_0xe832('0x6f')]==='DESC'?![]:!![]);_0x5918d9[_0xe832('0x5f')](_0x5a421d,_0xe23634[_0x5dd1fd]['alias']||_0x5a421d);}if(_0x1b46a2[_0xe832('0x73')]){_0x1b46a2['joins']=JSON[_0xe832('0x74')](_0x1b46a2[_0xe832('0x73')]);for(var _0x174e9c=0x0;_0x174e9c<_0x1b46a2['joins'][_0xe832('0x37')];_0x174e9c+=0x1){if(_0x1b46a2[_0xe832('0x73')][_0x174e9c][_0xe832('0x2d')]&&_[_0xe832('0x5a')](_0x199db9,_0x1b46a2[_0xe832('0x73')][_0x174e9c][_0xe832('0x2d')])&&_0x1b46a2[_0xe832('0x73')][_0x174e9c][_0xe832('0x78')]&&_0x1b46a2[_0xe832('0x73')][_0x174e9c][_0xe832('0x75')]&&_0x1b46a2[_0xe832('0x73')][_0x174e9c][_0xe832('0x76')]){_0x5918d9[_0x1b46a2[_0xe832('0x73')][_0x174e9c][_0xe832('0x2d')]](_0x1b46a2['joins'][_0x174e9c][_0xe832('0x75')],null,util[_0xe832('0x6d')](_0xe832('0x77'),_0x1b46a2['table'],_0x1b46a2['joins'][_0x174e9c][_0xe832('0x78')],_0x1b46a2[_0xe832('0x73')][_0x174e9c][_0xe832('0x75')],_0x1b46a2[_0xe832('0x73')][_0x174e9c][_0xe832('0x76')]));}}}if(_0x1b46a2[_0xe832('0x79')]){_0x1b46a2[_0xe832('0x79')]=JSON['parse'](_0x1b46a2[_0xe832('0x79')]);_0x5918d9[_0xe832('0x3a')](_0x496cd3(_0x1b46a2['conditions'][_0xe832('0x5e')]));}_0x514c83=_0x5918d9[_0xe832('0x7a')]();_0x5918d9[_0xe832('0x1d')](_0x2cd87f);_0x5918d9[_0xe832('0x1e')](0x0);return;}})[_0xe832('0x24')](function(){if(_0x23d367[_0xe832('0x8a')]===_0xe832('0x8b')){return null;}var _0x1fa98a=_[_0xe832('0x3c')](_0x23d367,{'name':_0x23d367['fullPath']||_0x23d367[_0xe832('0x28')]||_0x1b46a2['name'],'basename':_0x5ca54f,'savename':util[_0xe832('0x6d')](_0xe832('0x8c'),_0x23d367[_0xe832('0x28')]||_0x1b46a2[_0xe832('0x28')],require(_0xe832('0x8d'))[_0xe832('0x8e')](0x4),_0x23d367[_0xe832('0x8a')]||_0xe832('0x8f')),'reportId':_0x1b46a2['id'],'reportType':_0xe832('0x90')});return db[_0xe832('0x91')][_0xe832('0x47')](_0x1fa98a,{'raw':!![]});})[_0xe832('0x24')](function(_0x2c0e43){if(_0x1b46a2['table']==='cdr'){_0x514c83[_0xe832('0x3a')](_0x1b46a2[_0xe832('0x68')]+_0xe832('0x92'),_0x23d367[_0xe832('0x93')],_0x23d367[_0xe832('0x94')]);}else{_0x514c83[_0xe832('0x3a')](_0x1b46a2['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x23d367[_0xe832('0x93')],_0x23d367['endDate']);}if(_0x2c0e43){logger[_0xe832('0x95')]('Run\x20Query:',_0x514c83[_0xe832('0x7d')]());require(_0xe832('0x96'))['fork'](path[_0xe832('0x51')](__dirname,_0xe832('0x97'),_0x2c0e43[_0xe832('0x8a')]),[_0x2c0e43['id'],_0x514c83[_0xe832('0x7d')](),path['join'](__dirname,_0xe832('0x98'),_0x2c0e43[_0xe832('0x99')]),_0x5ca54f]);return _0x2c0e43;}else{var _0x1632e5=squel[_0xe832('0x66')]();_0x1632e5[_0xe832('0x67')]('('+_0x514c83[_0xe832('0x7d')]()+')',_0xe832('0x9a'));_0x1632e5[_0xe832('0x5f')](_0xe832('0x9b'),_0xe832('0x1f'));_0x514c83[_0xe832('0x1d')](_0x23d367[_0xe832('0x1d')]||_0x2cd87f);_0x514c83[_0xe832('0x1e')](_0x23d367[_0xe832('0x1e')]||0x0);return dbH[_0xe832('0x7e')][_0xe832('0x30')](_0x1632e5[_0xe832('0x7d')](),{'type':dbH[_0xe832('0x7e')][_0xe832('0x7f')][_0xe832('0x80')]})[_0xe832('0x24')](function(_0x161cce){if(!_0x161cce[_0xe832('0x37')]){_0x4659be=0x0;}else{_0x4659be=_0x161cce[0x0][_0xe832('0x1f')]||0x0;}return dbH[_0xe832('0x7e')]['query'](_0x514c83[_0xe832('0x7d')](),{'type':dbH[_0xe832('0x7e')][_0xe832('0x7f')][_0xe832('0x80')]});})[_0xe832('0x24')](function(_0x47dbc4){return{'rows':_0x47dbc4||[],'count':_0x4659be};});}});}exports['run']=function(_0xdab5b1,_0x2338b2){return runReport(_0xdab5b1[_0xe832('0x61')],_0xdab5b1[_0xe832('0x30')],_0xdab5b1['options'])[_0xe832('0x24')](respondWithResult(_0x2338b2,null))['catch'](handleError(_0x2338b2,null));};exports[_0xe832('0x9c')]=runReport;exports[_0xe832('0x30')]=function(_0x4e0433,_0xc6271e){var _0x22269c=0xa;var _0x4e2a31=[_0xe832('0x51'),'left_join',_0xe832('0x52'),_0xe832('0x53')];var _0x401bcb={'SUM':_0xe832('0x54'),'COUNT':_0xe832('0x9d'),'COUNT DISTINCT':_0xe832('0x82'),'MAX':_0xe832('0x9e'),'MIN':_0xe832('0x9f'),'AVG':_0xe832('0x55'),'GROUP_CONCAT':_0xe832('0x56'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xe832('0xa0')};var _0x400f07={'SEC_TO_TIME':_0xe832('0x58'),'DATE':_0xe832('0xa1'),'HOUR':_0xe832('0x83'),'ROUND':_0xe832('0xa2'),'UNIX_TIMESTAMP':_0xe832('0x59')};var _0x1e915e=function(_0x340de8){return!_[_0xe832('0x5a')](['IS\x20NULL','IS\x20NOT\x20NULL',_0xe832('0x85'),_0xe832('0x86')],_0x340de8);};var _0x5644fd=function(_0x4c4504){if(!_0x4c4504||!_0x4c4504[_0xe832('0x5c')]['length']){return'';}for(var _0x2cf794='(',_0x59e67b=0x0;_0x59e67b<_0x4c4504[_0xe832('0x5c')][_0xe832('0x37')];_0x59e67b+=0x1){_0x59e67b>0x0&&(_0x2cf794+='\x20'+_0x4c4504[_0xe832('0x5d')]+'\x20');_0x2cf794+=_0x4c4504[_0xe832('0x5c')][_0x59e67b]['group']?_0x5644fd(_0x4c4504[_0xe832('0x5c')][_0x59e67b][_0xe832('0x5e')]):_0x4c4504['rules'][_0x59e67b][_0xe832('0x5f')]+'\x20'+_0x4c4504[_0xe832('0x5c')][_0x59e67b][_0xe832('0x87')]+(_0x1e915e(_0x4c4504[_0xe832('0x5c')][_0x59e67b]['condition'])?'\x20'+_0x4c4504[_0xe832('0x5c')][_0x59e67b][_0xe832('0x60')]:'');}return _0x2cf794+')';};var _0x438dd8={'where':{'id':_0x4e0433['params']['id']}},_0x5b6347,_0x41875e,_0x14df33,_0x51287a,_0x56b39b;_0x438dd8=_[_0xe832('0x3c')]({},_0x438dd8,_0x4e0433['options']);return db[_0xe832('0x41')]['find'](_0x438dd8)['then'](function(_0xa73ac1){if(_0xa73ac1){_0x5b6347=_0xa73ac1;return _0xa73ac1['getFields']();}return null;})['then'](function(_0x1cfcd5){if(_0x1cfcd5){if(!_0x1cfcd5[_0xe832('0x37')]){throw new db['Sequelize']['ValidationErrorItem'](_0xe832('0x63'),0x193);}_0x41875e=_0x1cfcd5;return db['AnalyticMetric'][_0xe832('0x42')]({'raw':!![]});}return null;})[_0xe832('0x24')](function(_0x213ba7){if(_0x213ba7){_0x14df33=_[_0xe832('0x65')](_0x213ba7,'id');var _0x1384c4;var _0xed10e6=squel[_0xe832('0x66')]();_0xed10e6['from'](_0x5b6347[_0xe832('0x68')]);for(var _0xe2b2df=0x0;_0xe2b2df<_0x41875e[_0xe832('0x37')];_0xe2b2df+=0x1){_0x1384c4=_0x41875e[_0xe2b2df][_0xe832('0x69')]?_0x14df33[_0x41875e[_0xe2b2df][_0xe832('0x69')]][_0xe832('0x6a')]:_0x41875e[_0xe2b2df][_0xe832('0x5f')];_0x1384c4=_0x41875e[_0xe2b2df][_0xe832('0x6b')]?_['replace'](_0x401bcb[_0x41875e[_0xe2b2df][_0xe832('0x6b')]],'%s',_0x1384c4):_0x1384c4;_0x1384c4=_0x41875e[_0xe2b2df][_0xe832('0x6d')]?_[_0xe832('0x6c')](_0x400f07[_0x41875e[_0xe2b2df]['format']],'%s',_0x1384c4):_0x1384c4;if(_0x41875e[_0xe2b2df][_0xe832('0x6e')]){_0xed10e6['group'](_0x1384c4);}_0x41875e[_0xe2b2df][_0xe832('0x6f')]&&_0xed10e6[_0xe832('0x70')](_0x1384c4,_0x41875e[_0xe2b2df][_0xe832('0x6f')]===_0xe832('0x71')?![]:!![]);_0xed10e6['field'](_0x1384c4,_0x41875e[_0xe2b2df]['alias']||_0x1384c4);}if(_0x5b6347[_0xe832('0x73')]){_0x5b6347['joins']=JSON[_0xe832('0x74')](_0x5b6347['joins']);for(var _0x34190a=0x0;_0x34190a<_0x5b6347[_0xe832('0x73')]['length'];_0x34190a+=0x1){if(_0x5b6347[_0xe832('0x73')][_0x34190a][_0xe832('0x2d')]&&_['includes'](_0x4e2a31,_0x5b6347[_0xe832('0x73')][_0x34190a]['type'])&&_0x5b6347[_0xe832('0x73')][_0x34190a][_0xe832('0x78')]&&_0x5b6347[_0xe832('0x73')][_0x34190a]['foreignTable']&&_0x5b6347['joins'][_0x34190a][_0xe832('0x76')]){_0xed10e6[_0x5b6347[_0xe832('0x73')][_0x34190a]['type']](_0x5b6347['joins'][_0x34190a][_0xe832('0x75')],null,util[_0xe832('0x6d')]('%s.%s\x20=\x20%s.%s',_0x5b6347[_0xe832('0x68')],_0x5b6347[_0xe832('0x73')][_0x34190a]['parentKey'],_0x5b6347['joins'][_0x34190a][_0xe832('0x75')],_0x5b6347[_0xe832('0x73')][_0x34190a]['foreignKey']));}}}if(_0x5b6347['conditions']){_0x5b6347[_0xe832('0x79')]=JSON[_0xe832('0x74')](_0x5b6347['conditions']);_0xed10e6['where'](_0x5644fd(_0x5b6347[_0xe832('0x79')][_0xe832('0x5e')]));}_0x56b39b=_0xed10e6[_0xe832('0x7a')]();_0xed10e6[_0xe832('0x1d')](_0x22269c);_0xed10e6[_0xe832('0x1e')](0x0);logger[_0xe832('0x7b')](_0xe832('0x7c'),_0xed10e6[_0xe832('0x7d')]());return dbH['sequelize'][_0xe832('0x30')](_0xed10e6[_0xe832('0x7d')](),{'type':dbH[_0xe832('0x7e')][_0xe832('0x7f')][_0xe832('0x80')]});}})[_0xe832('0x24')](function(){return{'sql':_0x56b39b[_0xe832('0x7d')]()};})['then'](respondWithResult(_0xc6271e,null))[_0xe832('0x46')](handleError(_0xc6271e,null));}; \ No newline at end of file +var _0x9d7b=['COUNT(DISTINCT\x20%s)','MAX(%s)','AnalyticMetric','select','MetricId','alias','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','child_process','../../components/export/','../../files/reports','savename','COUNT(*)','SELECT','run','SUM(%s)','AVG(%s)','%s.%s\x20=\x20%s.%s','debug','rimraf','fast-json-patch','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','dbH','status','end','offset','limit','undefined','count','json','apply','reject','save','then','destroy','get','CustomReports','UserProfileResource','sendStatus','error','stack','name','send','index','map','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','VIRTUAL','filter','options','AnalyticCustomReport','includeAll','include','findAll','catch','show','params','keys','rawAttributes','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','join','left_join','right_join','cross_join','COUNT(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','merge','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','from','metric','function','replace','format','groupBy','orderBy','DESC','joins','parse','parentKey','foreignTable','foreignKey','table','conditions','clone','Limited\x20Query:','sequelize','toString','QueryTypes'];(function(_0x2df2c4,_0x3b183b){var _0x3244d3=function(_0x26e5b2){while(--_0x26e5b2){_0x2df2c4['push'](_0x2df2c4['shift']());}};_0x3244d3(++_0x3b183b);}(_0x9d7b,0xc5));var _0xb9d7=function(_0x105b1a,_0x52d2de){_0x105b1a=_0x105b1a-0x0;var _0x5c95a0=_0x9d7b[_0x105b1a];return _0x5c95a0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb9d7('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb9d7('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb9d7('0x2'));var Mustache=require(_0xb9d7('0x3'));var util=require(_0xb9d7('0x4'));var path=require(_0xb9d7('0x5'));var sox=require('sox');var csv=require(_0xb9d7('0x6'));var ejs=require(_0xb9d7('0x7'));var fs=require('fs');var fs_extra=require(_0xb9d7('0x8'));var _=require(_0xb9d7('0x9'));var squel=require(_0xb9d7('0xa'));var crypto=require(_0xb9d7('0xb'));var jsforce=require(_0xb9d7('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xb9d7('0x6'));var querystring=require(_0xb9d7('0xd'));var Papa=require(_0xb9d7('0xe'));var Redis=require(_0xb9d7('0xf'));var authService=require(_0xb9d7('0x10'));var qs=require(_0xb9d7('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xb9d7('0x12'))(_0xb9d7('0x13'));var utils=require(_0xb9d7('0x14'));var config=require(_0xb9d7('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xb9d7('0x16'))['db'];var dbH=require(_0xb9d7('0x16'))[_0xb9d7('0x17')];function respondWithStatusCode(_0x307e8c,_0x44dd52){_0x44dd52=_0x44dd52||0xcc;return function(_0x52d010){if(_0x52d010){return _0x307e8c['sendStatus'](_0x44dd52);}return _0x307e8c[_0xb9d7('0x18')](_0x44dd52)[_0xb9d7('0x19')]();};}function respondWithResult(_0xb0cd94,_0x5707ae){_0x5707ae=_0x5707ae||0xc8;return function(_0x4b9975){if(_0x4b9975){return _0xb0cd94[_0xb9d7('0x18')](_0x5707ae)['json'](_0x4b9975);}};}function respondWithFilteredResult(_0x4e7ec1,_0x24576a){return function(_0x30caf8){if(_0x30caf8){var _0xc9c27b=typeof _0x24576a[_0xb9d7('0x1a')]==='undefined'&&typeof _0x24576a[_0xb9d7('0x1b')]===_0xb9d7('0x1c');var _0x5f027b=_0x30caf8[_0xb9d7('0x1d')];var _0x1c78ba=_0xc9c27b?0x0:_0x24576a[_0xb9d7('0x1a')];var _0x3de446=_0xc9c27b?_0x30caf8[_0xb9d7('0x1d')]:_0x24576a[_0xb9d7('0x1a')]+_0x24576a['limit'];var _0x5c69d0;if(_0x3de446>=_0x5f027b){_0x3de446=_0x5f027b;_0x5c69d0=0xc8;}else{_0x5c69d0=0xce;}_0x4e7ec1['status'](_0x5c69d0);return _0x4e7ec1['set']('Content-Range',_0x1c78ba+'-'+_0x3de446+'/'+_0x5f027b)[_0xb9d7('0x1e')](_0x30caf8);}return null;};}function patchUpdates(_0x41e36c){return function(_0x481ce6){try{jsonpatch[_0xb9d7('0x1f')](_0x481ce6,_0x41e36c,!![]);}catch(_0xb10fed){return BPromise[_0xb9d7('0x20')](_0xb10fed);}return _0x481ce6[_0xb9d7('0x21')]();};}function saveUpdates(_0xca16fc,_0x2002ef){return function(_0x1fce49){if(_0x1fce49){return _0x1fce49['update'](_0xca16fc)[_0xb9d7('0x22')](function(_0xfd747f){return _0xfd747f;});}return null;};}function removeEntity(_0x5e4e66,_0x5d7a5f){return function(_0x5f1fdf){if(_0x5f1fdf){return _0x5f1fdf[_0xb9d7('0x23')]()[_0xb9d7('0x22')](function(){var _0x178087=_0x5f1fdf[_0xb9d7('0x24')]({'plain':!![]});var _0x983ae7=_0xb9d7('0x25');return db[_0xb9d7('0x26')][_0xb9d7('0x23')]({'where':{'type':_0x983ae7,'resourceId':_0x178087['id']}})[_0xb9d7('0x22')](function(){return _0x5f1fdf;});})[_0xb9d7('0x22')](function(){_0x5e4e66[_0xb9d7('0x18')](0xcc)[_0xb9d7('0x19')]();});}};}function handleEntityNotFound(_0x19faea,_0x4b80ab){return function(_0x2ee9e6){if(!_0x2ee9e6){_0x19faea[_0xb9d7('0x27')](0x194);}return _0x2ee9e6;};}function handleError(_0x41b1c0,_0x15b540){_0x15b540=_0x15b540||0x1f4;return function(_0x4e030e){logger[_0xb9d7('0x28')](_0x4e030e[_0xb9d7('0x29')]);if(_0x4e030e[_0xb9d7('0x2a')]){delete _0x4e030e[_0xb9d7('0x2a')];}_0x41b1c0[_0xb9d7('0x18')](_0x15b540)[_0xb9d7('0x2b')](_0x4e030e);};}exports[_0xb9d7('0x2c')]=function(_0x17a259,_0x3944d5){var _0x4a94f3={},_0x1e039b={},_0x4cd2c6={'count':0x0,'rows':[]};var _0x19fb12=_[_0xb9d7('0x2d')](db['AnalyticCustomReport']['rawAttributes'],function(_0x3e369f){return{'name':_0x3e369f['fieldName'],'type':_0x3e369f[_0xb9d7('0x2e')][_0xb9d7('0x2f')]};});_0x1e039b['model']=_[_0xb9d7('0x2d')](_0x19fb12,'name');_0x1e039b[_0xb9d7('0x30')]=_['keys'](_0x17a259[_0xb9d7('0x30')]);_0x1e039b[_0xb9d7('0x31')]=_[_0xb9d7('0x32')](_0x1e039b[_0xb9d7('0x33')],_0x1e039b[_0xb9d7('0x30')]);_0x4a94f3[_0xb9d7('0x34')]=_[_0xb9d7('0x32')](_0x1e039b['model'],qs['fields'](_0x17a259[_0xb9d7('0x30')][_0xb9d7('0x35')]));_0x4a94f3[_0xb9d7('0x34')]=_0x4a94f3[_0xb9d7('0x34')][_0xb9d7('0x36')]?_0x4a94f3[_0xb9d7('0x34')]:_0x1e039b[_0xb9d7('0x33')];if(!_0x17a259[_0xb9d7('0x30')][_0xb9d7('0x37')](_0xb9d7('0x38'))){_0x4a94f3[_0xb9d7('0x1b')]=qs[_0xb9d7('0x1b')](_0x17a259[_0xb9d7('0x30')]['limit']);_0x4a94f3[_0xb9d7('0x1a')]=qs['offset'](_0x17a259[_0xb9d7('0x30')][_0xb9d7('0x1a')]);}_0x4a94f3[_0xb9d7('0x39')]=qs['sort'](_0x17a259[_0xb9d7('0x30')][_0xb9d7('0x3a')]);_0x4a94f3['where']=qs[_0xb9d7('0x31')](_[_0xb9d7('0x3b')](_0x17a259[_0xb9d7('0x30')],_0x1e039b['filters']),_0x19fb12);if(_0x17a259[_0xb9d7('0x30')]['filter']){_0x4a94f3['where']=_['merge'](_0x4a94f3[_0xb9d7('0x3c')],{'$or':_[_0xb9d7('0x2d')](_0x19fb12,function(_0x294463){if(_0x294463[_0xb9d7('0x2e')]!==_0xb9d7('0x3d')){var _0x4893f8={};_0x4893f8[_0x294463[_0xb9d7('0x2a')]]={'$like':'%'+_0x17a259[_0xb9d7('0x30')][_0xb9d7('0x3e')]+'%'};return _0x4893f8;}})});}_0x4a94f3=_['merge']({},_0x4a94f3,_0x17a259[_0xb9d7('0x3f')]);var _0xd0f581={'where':_0x4a94f3[_0xb9d7('0x3c')]};return db[_0xb9d7('0x40')][_0xb9d7('0x1d')](_0xd0f581)[_0xb9d7('0x22')](function(_0x412772){_0x4cd2c6[_0xb9d7('0x1d')]=_0x412772;if(_0x17a259[_0xb9d7('0x30')][_0xb9d7('0x41')]){_0x4a94f3[_0xb9d7('0x42')]=[{'all':!![]}];}return db[_0xb9d7('0x40')][_0xb9d7('0x43')](_0x4a94f3);})['then'](function(_0x20ceeb){_0x4cd2c6['rows']=_0x20ceeb;return _0x4cd2c6;})['then'](respondWithFilteredResult(_0x3944d5,_0x4a94f3))[_0xb9d7('0x44')](handleError(_0x3944d5,null));};exports[_0xb9d7('0x45')]=function(_0x5d0f5d,_0x1f6b4a){var _0x6c9e4a={'raw':![],'where':{'id':_0x5d0f5d[_0xb9d7('0x46')]['id']}},_0x5e1830={};_0x5e1830[_0xb9d7('0x33')]=_[_0xb9d7('0x47')](db[_0xb9d7('0x40')][_0xb9d7('0x48')]);_0x5e1830[_0xb9d7('0x30')]=_[_0xb9d7('0x47')](_0x5d0f5d['query']);_0x5e1830['filters']=_[_0xb9d7('0x32')](_0x5e1830[_0xb9d7('0x33')],_0x5e1830[_0xb9d7('0x30')]);_0x6c9e4a['attributes']=_[_0xb9d7('0x32')](_0x5e1830[_0xb9d7('0x33')],qs[_0xb9d7('0x35')](_0x5d0f5d[_0xb9d7('0x30')][_0xb9d7('0x35')]));_0x6c9e4a[_0xb9d7('0x34')]=_0x6c9e4a[_0xb9d7('0x34')][_0xb9d7('0x36')]?_0x6c9e4a[_0xb9d7('0x34')]:_0x5e1830[_0xb9d7('0x33')];if(_0x5d0f5d[_0xb9d7('0x30')][_0xb9d7('0x41')]){_0x6c9e4a[_0xb9d7('0x42')]=[{'all':!![]}];}_0x6c9e4a=_['merge']({},_0x6c9e4a,_0x5d0f5d[_0xb9d7('0x3f')]);return db[_0xb9d7('0x40')]['find'](_0x6c9e4a)[_0xb9d7('0x22')](handleEntityNotFound(_0x1f6b4a,null))['then'](respondWithResult(_0x1f6b4a,null))['catch'](handleError(_0x1f6b4a,null));};exports[_0xb9d7('0x49')]=function(_0x163f6b,_0x5e31b7){return db['AnalyticCustomReport'][_0xb9d7('0x49')](_0x163f6b[_0xb9d7('0x4a')],{})[_0xb9d7('0x22')](function(_0x40b626){var _0x4e06c2=_0x163f6b[_0xb9d7('0x4b')]['get']({'plain':!![]});if(!_0x4e06c2)throw new Error(_0xb9d7('0x4c'));if(_0x4e06c2[_0xb9d7('0x4d')]===_0xb9d7('0x4b')){var _0x6d9f7=_0x40b626[_0xb9d7('0x24')]({'plain':!![]});var _0x595c45=_0xb9d7('0x4e');return db[_0xb9d7('0x4f')][_0xb9d7('0x50')]({'where':{'name':_0x595c45,'userProfileId':_0x4e06c2[_0xb9d7('0x51')]},'raw':!![]})[_0xb9d7('0x22')](function(_0x2fb391){if(_0x2fb391&&_0x2fb391[_0xb9d7('0x52')]===0x0){return db[_0xb9d7('0x26')][_0xb9d7('0x49')]({'name':_0x6d9f7[_0xb9d7('0x2a')],'resourceId':_0x6d9f7['id'],'type':'CustomReports','sectionId':_0x2fb391['id']},{})[_0xb9d7('0x22')](function(){return _0x40b626;});}else{return _0x40b626;}})[_0xb9d7('0x44')](function(_0x1cf33f){logger[_0xb9d7('0x28')](_0xb9d7('0x53'),_0x1cf33f);throw _0x1cf33f;});}return _0x40b626;})['then'](respondWithResult(_0x5e31b7,0xc9))[_0xb9d7('0x44')](handleError(_0x5e31b7,null));};exports[_0xb9d7('0x54')]=function(_0xdad3bd,_0x372315){if(_0xdad3bd[_0xb9d7('0x4a')]['id']){delete _0xdad3bd[_0xb9d7('0x4a')]['id'];}return db[_0xb9d7('0x40')][_0xb9d7('0x50')]({'where':{'id':_0xdad3bd[_0xb9d7('0x46')]['id']}})[_0xb9d7('0x22')](handleEntityNotFound(_0x372315,null))[_0xb9d7('0x22')](saveUpdates(_0xdad3bd[_0xb9d7('0x4a')],null))[_0xb9d7('0x22')](respondWithResult(_0x372315,null))[_0xb9d7('0x44')](handleError(_0x372315,null));};exports['destroy']=function(_0x185a9c,_0x3fa5fa){return db[_0xb9d7('0x40')]['find']({'where':{'id':_0x185a9c['params']['id']}})[_0xb9d7('0x22')](handleEntityNotFound(_0x3fa5fa,null))['then'](removeEntity(_0x3fa5fa,null))[_0xb9d7('0x44')](handleError(_0x3fa5fa,null));};exports[_0xb9d7('0x55')]=function(_0x3cccb7,_0x4390a1){var _0x12be2a=0xa;var _0x3b6396=[_0xb9d7('0x56'),_0xb9d7('0x57'),_0xb9d7('0x58'),_0xb9d7('0x59')];var _0x4370c8={'SUM':'SUM(%s)','COUNT':_0xb9d7('0x5a'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xb9d7('0x5b'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xb9d7('0x5c'),'GROUP_CONCAT ASC':_0xb9d7('0x5d'),'GROUP_CONCAT DESC':_0xb9d7('0x5e')};var _0x5a24c3={'SEC_TO_TIME':_0xb9d7('0x5f'),'DATE':_0xb9d7('0x60'),'HOUR':_0xb9d7('0x61'),'ROUND':_0xb9d7('0x62'),'UNIX_TIMESTAMP':_0xb9d7('0x63')};var _0x3ca0bd=function(_0x5e54cc){return!_[_0xb9d7('0x64')](['IS\x20NULL',_0xb9d7('0x65'),_0xb9d7('0x66'),_0xb9d7('0x67')],_0x5e54cc);};var _0x3055ec=function(_0x13c61b){if(!_0x13c61b||!_0x13c61b[_0xb9d7('0x68')][_0xb9d7('0x36')]){return'';}for(var _0x183b5a='(',_0x1137be=0x0;_0x1137be<_0x13c61b['rules'][_0xb9d7('0x36')];_0x1137be+=0x1){_0x1137be>0x0&&(_0x183b5a+='\x20'+_0x13c61b[_0xb9d7('0x69')]+'\x20');_0x183b5a+=_0x13c61b[_0xb9d7('0x68')][_0x1137be][_0xb9d7('0x6a')]?_0x3055ec(_0x13c61b[_0xb9d7('0x68')][_0x1137be][_0xb9d7('0x6a')]):_0x13c61b[_0xb9d7('0x68')][_0x1137be][_0xb9d7('0x6b')]+'\x20'+_0x13c61b['rules'][_0x1137be][_0xb9d7('0x6c')]+(_0x3ca0bd(_0x13c61b[_0xb9d7('0x68')][_0x1137be][_0xb9d7('0x6c')])?'\x20'+_0x13c61b['rules'][_0x1137be][_0xb9d7('0x6d')]:'');}return _0x183b5a+')';};var _0x272d16={'where':{'id':_0x3cccb7[_0xb9d7('0x46')]['id']}},_0xd6fedf,_0x12155d,_0xa22ddf,_0x24f0bd,_0x13acd2;_0x272d16=_[_0xb9d7('0x6e')]({},_0x272d16,_0x3cccb7['options']);return db[_0xb9d7('0x40')][_0xb9d7('0x50')](_0x272d16)[_0xb9d7('0x22')](function(_0x4283fb){if(_0x4283fb){_0xd6fedf=_0x4283fb;return _0x4283fb[_0xb9d7('0x6f')]();}return null;})[_0xb9d7('0x22')](function(_0x314788){if(_0x314788){if(!_0x314788[_0xb9d7('0x36')]){throw new db[(_0xb9d7('0x70'))][(_0xb9d7('0x71'))](_0xb9d7('0x72'),0x193);}_0x12155d=_0x314788;return db['AnalyticMetric'][_0xb9d7('0x43')]({'raw':!![]});}return null;})[_0xb9d7('0x22')](function(_0x19ddc0){if(_0x19ddc0){_0xa22ddf=_['keyBy'](_0x19ddc0,'id');var _0x206cda;var _0x557b95=squel['select']();_0x557b95[_0xb9d7('0x73')](_0xd6fedf['table']);for(var _0x1bf43b=0x0;_0x1bf43b<_0x12155d[_0xb9d7('0x36')];_0x1bf43b+=0x1){_0x206cda=_0x12155d[_0x1bf43b]['MetricId']?_0xa22ddf[_0x12155d[_0x1bf43b]['MetricId']][_0xb9d7('0x74')]:_0x12155d[_0x1bf43b]['field'];_0x206cda=_0x12155d[_0x1bf43b][_0xb9d7('0x75')]?_[_0xb9d7('0x76')](_0x4370c8[_0x12155d[_0x1bf43b]['function']],'%s',_0x206cda):_0x206cda;_0x206cda=_0x12155d[_0x1bf43b][_0xb9d7('0x77')]?_[_0xb9d7('0x76')](_0x5a24c3[_0x12155d[_0x1bf43b][_0xb9d7('0x77')]],'%s',_0x206cda):_0x206cda;if(_0x12155d[_0x1bf43b][_0xb9d7('0x78')]){_0x557b95[_0xb9d7('0x6a')](_0x206cda);}_0x12155d[_0x1bf43b][_0xb9d7('0x79')]&&_0x557b95[_0xb9d7('0x39')](_0x206cda,_0x12155d[_0x1bf43b][_0xb9d7('0x79')]===_0xb9d7('0x7a')?![]:!![]);_0x557b95[_0xb9d7('0x6b')](_0x206cda,_0x12155d[_0x1bf43b]['alias']||_0x206cda);}if(_0xd6fedf[_0xb9d7('0x7b')]){_0xd6fedf['joins']=JSON[_0xb9d7('0x7c')](_0xd6fedf['joins']);for(var _0x302e71=0x0;_0x302e71<_0xd6fedf['joins'][_0xb9d7('0x36')];_0x302e71+=0x1){if(_0xd6fedf[_0xb9d7('0x7b')][_0x302e71][_0xb9d7('0x2e')]&&_[_0xb9d7('0x64')](_0x3b6396,_0xd6fedf[_0xb9d7('0x7b')][_0x302e71][_0xb9d7('0x2e')])&&_0xd6fedf[_0xb9d7('0x7b')][_0x302e71][_0xb9d7('0x7d')]&&_0xd6fedf['joins'][_0x302e71][_0xb9d7('0x7e')]&&_0xd6fedf['joins'][_0x302e71][_0xb9d7('0x7f')]){_0x557b95[_0xd6fedf[_0xb9d7('0x7b')][_0x302e71][_0xb9d7('0x2e')]](_0xd6fedf[_0xb9d7('0x7b')][_0x302e71]['foreignTable'],null,util[_0xb9d7('0x77')]('%s.%s\x20=\x20%s.%s',_0xd6fedf[_0xb9d7('0x80')],_0xd6fedf[_0xb9d7('0x7b')][_0x302e71][_0xb9d7('0x7d')],_0xd6fedf['joins'][_0x302e71][_0xb9d7('0x7e')],_0xd6fedf[_0xb9d7('0x7b')][_0x302e71]['foreignKey']));}}}if(_0xd6fedf[_0xb9d7('0x81')]){_0xd6fedf[_0xb9d7('0x81')]=JSON[_0xb9d7('0x7c')](_0xd6fedf['conditions']);_0x557b95[_0xb9d7('0x3c')](_0x3055ec(_0xd6fedf['conditions'][_0xb9d7('0x6a')]));}_0x13acd2=_0x557b95[_0xb9d7('0x82')]();_0x557b95['limit'](_0x12be2a);_0x557b95[_0xb9d7('0x1a')](0x0);logger['debug'](_0xb9d7('0x83'),_0x557b95['toString']());return dbH[_0xb9d7('0x84')][_0xb9d7('0x30')](_0x557b95[_0xb9d7('0x85')](),{'type':dbH[_0xb9d7('0x84')][_0xb9d7('0x86')]['SELECT']});}})[_0xb9d7('0x22')](respondWithResult(_0x4390a1,null))[_0xb9d7('0x44')](handleError(_0x4390a1,null));};function runReport(_0x4e65dc,_0x4a3333,_0x39c1e8){var _0x20c0ea=_0x4a3333[_0xb9d7('0x2a')];var _0x45841c=0xa;var _0x164c12=['join',_0xb9d7('0x57'),_0xb9d7('0x58'),_0xb9d7('0x59')];var _0x3798ec={'SUM':'SUM(%s)','COUNT':_0xb9d7('0x5a'),'COUNT DISTINCT':_0xb9d7('0x87'),'MAX':_0xb9d7('0x88'),'MIN':_0xb9d7('0x5b'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xb9d7('0x5d'),'GROUP_CONCAT DESC':_0xb9d7('0x5e')};var _0xc594aa={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xb9d7('0x60'),'HOUR':_0xb9d7('0x61'),'ROUND':_0xb9d7('0x62'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x2d66cc=function(_0x2df12c){return!_['includes'](['IS\x20NULL',_0xb9d7('0x65'),_0xb9d7('0x66'),_0xb9d7('0x67')],_0x2df12c);};var _0x560ee9=function(_0x5abfb3){if(!_0x5abfb3||!_0x5abfb3[_0xb9d7('0x68')]['length']){return'';}for(var _0x43c359='(',_0x1e4659=0x0;_0x1e4659<_0x5abfb3['rules'][_0xb9d7('0x36')];_0x1e4659+=0x1){_0x1e4659>0x0&&(_0x43c359+='\x20'+_0x5abfb3[_0xb9d7('0x69')]+'\x20');_0x43c359+=_0x5abfb3[_0xb9d7('0x68')][_0x1e4659][_0xb9d7('0x6a')]?_0x560ee9(_0x5abfb3[_0xb9d7('0x68')][_0x1e4659][_0xb9d7('0x6a')]):_0x5abfb3[_0xb9d7('0x68')][_0x1e4659][_0xb9d7('0x6b')]+'\x20'+_0x5abfb3['rules'][_0x1e4659][_0xb9d7('0x6c')]+(_0x2d66cc(_0x5abfb3[_0xb9d7('0x68')][_0x1e4659][_0xb9d7('0x6c')])?'\x20'+_0x5abfb3[_0xb9d7('0x68')][_0x1e4659][_0xb9d7('0x6d')]:'');}return _0x43c359+')';};var _0x49c036={'where':{'id':_0x4e65dc['id']}},_0xddcc93,_0x1194ed,_0x101a6d,_0x3013f5,_0x3ec83a;_0x49c036=_[_0xb9d7('0x6e')]({},_0x49c036,_0x39c1e8);return db[_0xb9d7('0x40')]['find'](_0x49c036)[_0xb9d7('0x22')](function(_0x4719dc){if(_0x4719dc){_0xddcc93=_0x4719dc;return _0x4719dc['getFields']();}return null;})[_0xb9d7('0x22')](function(_0x49df1e){if(_0x49df1e){if(!_0x49df1e['length']){throw new db[(_0xb9d7('0x70'))][(_0xb9d7('0x71'))](_0xb9d7('0x72'),0x193);}_0x1194ed=_0x49df1e;return db[_0xb9d7('0x89')][_0xb9d7('0x43')]({'raw':!![]});}return null;})[_0xb9d7('0x22')](function(_0x297a18){if(_0x297a18){_0x101a6d=_['keyBy'](_0x297a18,'id');var _0x4256da;var _0x491313=squel[_0xb9d7('0x8a')]();_0x491313['from'](_0xddcc93[_0xb9d7('0x80')]);for(var _0x576d61=0x0;_0x576d61<_0x1194ed[_0xb9d7('0x36')];_0x576d61+=0x1){_0x4256da=_0x1194ed[_0x576d61]['MetricId']?_0x101a6d[_0x1194ed[_0x576d61][_0xb9d7('0x8b')]][_0xb9d7('0x74')]:_0x1194ed[_0x576d61][_0xb9d7('0x6b')];_0x4256da=_0x1194ed[_0x576d61][_0xb9d7('0x75')]?_['replace'](_0x3798ec[_0x1194ed[_0x576d61][_0xb9d7('0x75')]],'%s',_0x4256da):_0x4256da;_0x4256da=_0x1194ed[_0x576d61]['format']?_[_0xb9d7('0x76')](_0xc594aa[_0x1194ed[_0x576d61][_0xb9d7('0x77')]],'%s',_0x4256da):_0x4256da;if(_0x1194ed[_0x576d61]['groupBy']){_0x491313[_0xb9d7('0x6a')](_0x4256da);}_0x1194ed[_0x576d61][_0xb9d7('0x79')]&&_0x491313[_0xb9d7('0x39')](_0x4256da,_0x1194ed[_0x576d61][_0xb9d7('0x79')]===_0xb9d7('0x7a')?![]:!![]);_0x491313[_0xb9d7('0x6b')](_0x4256da,_0x1194ed[_0x576d61][_0xb9d7('0x8c')]||_0x4256da);}if(_0xddcc93['joins']){_0xddcc93[_0xb9d7('0x7b')]=JSON[_0xb9d7('0x7c')](_0xddcc93[_0xb9d7('0x7b')]);for(var _0x2d52bc=0x0;_0x2d52bc<_0xddcc93[_0xb9d7('0x7b')][_0xb9d7('0x36')];_0x2d52bc+=0x1){if(_0xddcc93[_0xb9d7('0x7b')][_0x2d52bc][_0xb9d7('0x2e')]&&_[_0xb9d7('0x64')](_0x164c12,_0xddcc93['joins'][_0x2d52bc]['type'])&&_0xddcc93[_0xb9d7('0x7b')][_0x2d52bc]['parentKey']&&_0xddcc93[_0xb9d7('0x7b')][_0x2d52bc][_0xb9d7('0x7e')]&&_0xddcc93[_0xb9d7('0x7b')][_0x2d52bc][_0xb9d7('0x7f')]){_0x491313[_0xddcc93[_0xb9d7('0x7b')][_0x2d52bc][_0xb9d7('0x2e')]](_0xddcc93[_0xb9d7('0x7b')][_0x2d52bc][_0xb9d7('0x7e')],null,util[_0xb9d7('0x77')]('%s.%s\x20=\x20%s.%s',_0xddcc93[_0xb9d7('0x80')],_0xddcc93['joins'][_0x2d52bc][_0xb9d7('0x7d')],_0xddcc93[_0xb9d7('0x7b')][_0x2d52bc][_0xb9d7('0x7e')],_0xddcc93[_0xb9d7('0x7b')][_0x2d52bc]['foreignKey']));}}}if(_0xddcc93[_0xb9d7('0x81')]){_0xddcc93[_0xb9d7('0x81')]=JSON[_0xb9d7('0x7c')](_0xddcc93[_0xb9d7('0x81')]);_0x491313['where'](_0x560ee9(_0xddcc93[_0xb9d7('0x81')][_0xb9d7('0x6a')]));}_0x3ec83a=_0x491313[_0xb9d7('0x82')]();_0x491313[_0xb9d7('0x1b')](_0x45841c);_0x491313[_0xb9d7('0x1a')](0x0);return;}})[_0xb9d7('0x22')](function(){if(_0x4a3333[_0xb9d7('0x8d')]===_0xb9d7('0x8e')){return null;}var _0x25939c=_[_0xb9d7('0x6e')](_0x4a3333,{'name':_0x4a3333[_0xb9d7('0x8f')]||_0x4a3333[_0xb9d7('0x2a')]||_0xddcc93['name'],'basename':_0x20c0ea,'savename':util[_0xb9d7('0x77')](_0xb9d7('0x90'),_0x4a3333[_0xb9d7('0x2a')]||_0xddcc93[_0xb9d7('0x2a')],require(_0xb9d7('0x91'))[_0xb9d7('0x92')](0x4),_0x4a3333[_0xb9d7('0x8d')]||_0xb9d7('0x93')),'reportId':_0xddcc93['id'],'reportType':_0xb9d7('0x94')});return db[_0xb9d7('0x95')][_0xb9d7('0x49')](_0x25939c,{'raw':!![]});})['then'](function(_0x48a975){if(_0xddcc93[_0xb9d7('0x80')]===_0xb9d7('0x96')){_0x3ec83a[_0xb9d7('0x3c')](_0xddcc93['table']+_0xb9d7('0x97'),_0x4a3333[_0xb9d7('0x98')],_0x4a3333[_0xb9d7('0x99')]);}else{_0x3ec83a[_0xb9d7('0x3c')](_0xddcc93[_0xb9d7('0x80')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x4a3333[_0xb9d7('0x98')],_0x4a3333[_0xb9d7('0x99')]);}if(_0x48a975){logger[_0xb9d7('0x9a')]('Run\x20Query:',_0x3ec83a[_0xb9d7('0x85')]());require(_0xb9d7('0x9b'))['fork'](path[_0xb9d7('0x56')](__dirname,_0xb9d7('0x9c'),_0x48a975[_0xb9d7('0x8d')]),[_0x48a975['id'],_0x3ec83a[_0xb9d7('0x85')](),path[_0xb9d7('0x56')](__dirname,_0xb9d7('0x9d'),_0x48a975[_0xb9d7('0x9e')]),_0x20c0ea]);return _0x48a975;}else{var _0x39317a=squel[_0xb9d7('0x8a')]();_0x39317a['from']('('+_0x3ec83a[_0xb9d7('0x85')]()+')','countTable');_0x39317a[_0xb9d7('0x6b')](_0xb9d7('0x9f'),_0xb9d7('0x1d'));_0x3ec83a['limit'](_0x4a3333[_0xb9d7('0x1b')]||_0x45841c);_0x3ec83a[_0xb9d7('0x1a')](_0x4a3333[_0xb9d7('0x1a')]||0x0);return dbH[_0xb9d7('0x84')][_0xb9d7('0x30')](_0x39317a['toString'](),{'type':dbH[_0xb9d7('0x84')][_0xb9d7('0x86')][_0xb9d7('0xa0')]})[_0xb9d7('0x22')](function(_0x12ca40){if(!_0x12ca40[_0xb9d7('0x36')]){_0x3013f5=0x0;}else{_0x3013f5=_0x12ca40[0x0][_0xb9d7('0x1d')]||0x0;}return dbH[_0xb9d7('0x84')]['query'](_0x3ec83a[_0xb9d7('0x85')](),{'type':dbH[_0xb9d7('0x84')][_0xb9d7('0x86')][_0xb9d7('0xa0')]});})['then'](function(_0xb11b15){return{'rows':_0xb11b15||[],'count':_0x3013f5};});}});}exports[_0xb9d7('0xa1')]=function(_0x31962b,_0x3ac274){return runReport(_0x31962b['params'],_0x31962b[_0xb9d7('0x30')],_0x31962b[_0xb9d7('0x3f')])[_0xb9d7('0x22')](respondWithResult(_0x3ac274,null))['catch'](handleError(_0x3ac274,null));};exports['runReport']=runReport;exports[_0xb9d7('0x30')]=function(_0x384b8f,_0xab44ac){var _0x1e56aa=0xa;var _0x292c87=[_0xb9d7('0x56'),_0xb9d7('0x57'),_0xb9d7('0x58'),'cross_join'];var _0x2dca97={'SUM':_0xb9d7('0xa2'),'COUNT':_0xb9d7('0x5a'),'COUNT DISTINCT':_0xb9d7('0x87'),'MAX':_0xb9d7('0x88'),'MIN':_0xb9d7('0x5b'),'AVG':_0xb9d7('0xa3'),'GROUP_CONCAT':_0xb9d7('0x5c'),'GROUP_CONCAT ASC':_0xb9d7('0x5d'),'GROUP_CONCAT DESC':_0xb9d7('0x5e')};var _0x184621={'SEC_TO_TIME':_0xb9d7('0x5f'),'DATE':_0xb9d7('0x60'),'HOUR':_0xb9d7('0x61'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xb9d7('0x63')};var _0x71afaa=function(_0x4ba1b6){return!_[_0xb9d7('0x64')](['IS\x20NULL',_0xb9d7('0x65'),_0xb9d7('0x66'),_0xb9d7('0x67')],_0x4ba1b6);};var _0x2c1c1b=function(_0x5ecb7f){if(!_0x5ecb7f||!_0x5ecb7f[_0xb9d7('0x68')][_0xb9d7('0x36')]){return'';}for(var _0x4c829d='(',_0x4873a5=0x0;_0x4873a5<_0x5ecb7f[_0xb9d7('0x68')][_0xb9d7('0x36')];_0x4873a5+=0x1){_0x4873a5>0x0&&(_0x4c829d+='\x20'+_0x5ecb7f[_0xb9d7('0x69')]+'\x20');_0x4c829d+=_0x5ecb7f['rules'][_0x4873a5][_0xb9d7('0x6a')]?_0x2c1c1b(_0x5ecb7f['rules'][_0x4873a5][_0xb9d7('0x6a')]):_0x5ecb7f['rules'][_0x4873a5][_0xb9d7('0x6b')]+'\x20'+_0x5ecb7f['rules'][_0x4873a5][_0xb9d7('0x6c')]+(_0x71afaa(_0x5ecb7f[_0xb9d7('0x68')][_0x4873a5][_0xb9d7('0x6c')])?'\x20'+_0x5ecb7f[_0xb9d7('0x68')][_0x4873a5][_0xb9d7('0x6d')]:'');}return _0x4c829d+')';};var _0xcf1c76={'where':{'id':_0x384b8f[_0xb9d7('0x46')]['id']}},_0x11d091,_0x27989c,_0x443a31,_0x40e26b,_0x218bd5;_0xcf1c76=_['merge']({},_0xcf1c76,_0x384b8f[_0xb9d7('0x3f')]);return db['AnalyticCustomReport']['find'](_0xcf1c76)[_0xb9d7('0x22')](function(_0x9b2aae){if(_0x9b2aae){_0x11d091=_0x9b2aae;return _0x9b2aae[_0xb9d7('0x6f')]();}return null;})[_0xb9d7('0x22')](function(_0x5efa02){if(_0x5efa02){if(!_0x5efa02['length']){throw new db[(_0xb9d7('0x70'))][(_0xb9d7('0x71'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x27989c=_0x5efa02;return db[_0xb9d7('0x89')][_0xb9d7('0x43')]({'raw':!![]});}return null;})['then'](function(_0x598b59){if(_0x598b59){_0x443a31=_['keyBy'](_0x598b59,'id');var _0x19cc3e;var _0x519d40=squel[_0xb9d7('0x8a')]();_0x519d40[_0xb9d7('0x73')](_0x11d091[_0xb9d7('0x80')]);for(var _0x5f00c3=0x0;_0x5f00c3<_0x27989c[_0xb9d7('0x36')];_0x5f00c3+=0x1){_0x19cc3e=_0x27989c[_0x5f00c3][_0xb9d7('0x8b')]?_0x443a31[_0x27989c[_0x5f00c3][_0xb9d7('0x8b')]][_0xb9d7('0x74')]:_0x27989c[_0x5f00c3][_0xb9d7('0x6b')];_0x19cc3e=_0x27989c[_0x5f00c3][_0xb9d7('0x75')]?_[_0xb9d7('0x76')](_0x2dca97[_0x27989c[_0x5f00c3][_0xb9d7('0x75')]],'%s',_0x19cc3e):_0x19cc3e;_0x19cc3e=_0x27989c[_0x5f00c3][_0xb9d7('0x77')]?_['replace'](_0x184621[_0x27989c[_0x5f00c3][_0xb9d7('0x77')]],'%s',_0x19cc3e):_0x19cc3e;if(_0x27989c[_0x5f00c3][_0xb9d7('0x78')]){_0x519d40[_0xb9d7('0x6a')](_0x19cc3e);}_0x27989c[_0x5f00c3][_0xb9d7('0x79')]&&_0x519d40['order'](_0x19cc3e,_0x27989c[_0x5f00c3][_0xb9d7('0x79')]==='DESC'?![]:!![]);_0x519d40[_0xb9d7('0x6b')](_0x19cc3e,_0x27989c[_0x5f00c3][_0xb9d7('0x8c')]||_0x19cc3e);}if(_0x11d091['joins']){_0x11d091[_0xb9d7('0x7b')]=JSON[_0xb9d7('0x7c')](_0x11d091[_0xb9d7('0x7b')]);for(var _0x2cfc67=0x0;_0x2cfc67<_0x11d091[_0xb9d7('0x7b')]['length'];_0x2cfc67+=0x1){if(_0x11d091[_0xb9d7('0x7b')][_0x2cfc67]['type']&&_['includes'](_0x292c87,_0x11d091[_0xb9d7('0x7b')][_0x2cfc67][_0xb9d7('0x2e')])&&_0x11d091[_0xb9d7('0x7b')][_0x2cfc67][_0xb9d7('0x7d')]&&_0x11d091['joins'][_0x2cfc67][_0xb9d7('0x7e')]&&_0x11d091[_0xb9d7('0x7b')][_0x2cfc67][_0xb9d7('0x7f')]){_0x519d40[_0x11d091[_0xb9d7('0x7b')][_0x2cfc67][_0xb9d7('0x2e')]](_0x11d091[_0xb9d7('0x7b')][_0x2cfc67]['foreignTable'],null,util[_0xb9d7('0x77')](_0xb9d7('0xa4'),_0x11d091[_0xb9d7('0x80')],_0x11d091['joins'][_0x2cfc67][_0xb9d7('0x7d')],_0x11d091['joins'][_0x2cfc67][_0xb9d7('0x7e')],_0x11d091[_0xb9d7('0x7b')][_0x2cfc67][_0xb9d7('0x7f')]));}}}if(_0x11d091[_0xb9d7('0x81')]){_0x11d091[_0xb9d7('0x81')]=JSON[_0xb9d7('0x7c')](_0x11d091[_0xb9d7('0x81')]);_0x519d40[_0xb9d7('0x3c')](_0x2c1c1b(_0x11d091[_0xb9d7('0x81')][_0xb9d7('0x6a')]));}_0x218bd5=_0x519d40[_0xb9d7('0x82')]();_0x519d40['limit'](_0x1e56aa);_0x519d40[_0xb9d7('0x1a')](0x0);logger[_0xb9d7('0xa5')](_0xb9d7('0x83'),_0x519d40[_0xb9d7('0x85')]());return dbH[_0xb9d7('0x84')][_0xb9d7('0x30')](_0x519d40[_0xb9d7('0x85')](),{'type':dbH['sequelize'][_0xb9d7('0x86')][_0xb9d7('0xa0')]});}})[_0xb9d7('0x22')](function(){return{'sql':_0x218bd5[_0xb9d7('0x85')]()};})[_0xb9d7('0x22')](respondWithResult(_0xab44ac,null))[_0xb9d7('0x44')](handleError(_0xab44ac,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index 46a94fd..6473817 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 _0x0821=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','AnalyticCustomReport','analytics_custom_reports','lodash','util','../../config/logger'];(function(_0x170a52,_0x2e27d6){var _0x2c03ed=function(_0x32e213){while(--_0x32e213){_0x170a52['push'](_0x170a52['shift']());}};_0x2c03ed(++_0x2e27d6);}(_0x0821,0xa5));var _0x1082=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0x0821[_0x481bf7];return _0x461787;};'use strict';var _=require(_0x1082('0x0'));var util=require(_0x1082('0x1'));var logger=require(_0x1082('0x2'))('api');var moment=require(_0x1082('0x3'));var BPromise=require(_0x1082('0x4'));var rp=require(_0x1082('0x5'));var fs=require('fs');var path=require(_0x1082('0x6'));var rimraf=require(_0x1082('0x7'));var config=require(_0x1082('0x8'));var attributes=require('./analyticCustomReport.attributes');module[_0x1082('0x9')]=function(_0x1c0d4b,_0xf0839a){return _0x1c0d4b['define'](_0x1082('0xa'),attributes,{'tableName':_0x1082('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1a0b=['bluebird','path','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','lodash','../../config/logger','api','moment'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0x1a0b,0xd4));var _0xb1a0=function(_0xade054,_0x3cddfa){_0xade054=_0xade054-0x0;var _0x37a229=_0x1a0b[_0xade054];return _0x37a229;};'use strict';var _=require(_0xb1a0('0x0'));var util=require('util');var logger=require(_0xb1a0('0x1'))(_0xb1a0('0x2'));var moment=require(_0xb1a0('0x3'));var BPromise=require(_0xb1a0('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb1a0('0x5'));var rimraf=require(_0xb1a0('0x6'));var config=require(_0xb1a0('0x7'));var attributes=require(_0xb1a0('0x8'));module[_0xb1a0('0x9')]=function(_0x184343,_0x57cbc3){return _0x184343[_0xb1a0('0xa')](_0xb1a0('0xb'),attributes,{'tableName':'analytics_custom_reports','paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js index 87b9312..e75ef2c 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 _0xdc2a=['../../mysqldb','../../config/utils','../../config/logger','jayson/promise','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x940ce4,_0x1b0503){var _0x4b9212=function(_0x561348){while(--_0x561348){_0x940ce4['push'](_0x940ce4['shift']());}};_0x4b9212(++_0x1b0503);}(_0xdc2a,0x9d));var _0xadc2=function(_0x4fd163,_0x154781){_0x4fd163=_0x4fd163-0x0;var _0x178f7b=_0xdc2a[_0x4fd163];return _0x178f7b;};'use strict';var _=require(_0xadc2('0x0'));var util=require('util');var moment=require(_0xadc2('0x1'));var BPromise=require(_0xadc2('0x2'));var rs=require(_0xadc2('0x3'));var fs=require('fs');var Redis=require(_0xadc2('0x4'));var db=require(_0xadc2('0x5'))['db'];var utils=require(_0xadc2('0x6'));var logger=require(_0xadc2('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xadc2('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x39f9ac,_0x20d73f,_0x5d1030){return new BPromise(function(_0x42f7ce,_0x45a615){return client['request'](_0x39f9ac,_0x5d1030)['then'](function(_0x25f8f2){logger[_0xadc2('0x9')](_0xadc2('0xa'),_0x20d73f,_0xadc2('0xb'));logger['debug'](_0xadc2('0xc'),_0x20d73f,_0xadc2('0xb'),JSON['stringify'](_0x25f8f2));if(_0x25f8f2[_0xadc2('0xd')]){if(_0x25f8f2[_0xadc2('0xd')][_0xadc2('0xe')]===0x1f4){logger[_0xadc2('0xd')](_0xadc2('0xa'),_0x20d73f,_0x25f8f2['error']['message']);return _0x45a615(_0x25f8f2[_0xadc2('0xd')][_0xadc2('0xf')]);}logger[_0xadc2('0xd')](_0xadc2('0xa'),_0x20d73f,_0x25f8f2[_0xadc2('0xd')][_0xadc2('0xf')]);return _0x42f7ce(_0x25f8f2[_0xadc2('0xd')][_0xadc2('0xf')]);}else{logger[_0xadc2('0x9')](_0xadc2('0xa'),_0x20d73f,_0xadc2('0xb'));_0x42f7ce(_0x25f8f2[_0xadc2('0x10')][_0xadc2('0xf')]);}})[_0xadc2('0x11')](function(_0x450f94){logger[_0xadc2('0xd')](_0xadc2('0xa'),_0x20d73f,_0x450f94);_0x45a615(_0x450f94);});});} \ No newline at end of file +var _0xdeee=['../../config/logger','../../config/environment','jayson/promise','http','request','then','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdeee,0x179));var _0xedee=function(_0x2971bf,_0x47b60b){_0x2971bf=_0x2971bf-0x0;var _0x1191f0=_0xdeee[_0x2971bf];return _0x1191f0;};'use strict';var _=require(_0xedee('0x0'));var util=require(_0xedee('0x1'));var moment=require(_0xedee('0x2'));var BPromise=require(_0xedee('0x3'));var rs=require(_0xedee('0x4'));var fs=require('fs');var Redis=require(_0xedee('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xedee('0x6'));var logger=require(_0xedee('0x7'))('rpc');var config=require(_0xedee('0x8'));var jayson=require(_0xedee('0x9'));var client=jayson['client'][_0xedee('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5c5774,_0x99b75d,_0x326383){return new BPromise(function(_0x255302,_0x4df791){return client[_0xedee('0xb')](_0x5c5774,_0x326383)[_0xedee('0xc')](function(_0x557929){logger['info'](_0xedee('0xd'),_0x99b75d,_0xedee('0xe'));logger[_0xedee('0xf')](_0xedee('0x10'),_0x99b75d,'request\x20sent',JSON[_0xedee('0x11')](_0x557929));if(_0x557929['error']){if(_0x557929[_0xedee('0x12')][_0xedee('0x13')]===0x1f4){logger['error'](_0xedee('0xd'),_0x99b75d,_0x557929[_0xedee('0x12')]['message']);return _0x4df791(_0x557929[_0xedee('0x12')][_0xedee('0x14')]);}logger[_0xedee('0x12')]('AnalyticCustomReport,\x20%s,\x20%s',_0x99b75d,_0x557929[_0xedee('0x12')][_0xedee('0x14')]);return _0x255302(_0x557929[_0xedee('0x12')]['message']);}else{logger[_0xedee('0x15')]('AnalyticCustomReport,\x20%s,\x20%s',_0x99b75d,'request\x20sent');_0x255302(_0x557929[_0xedee('0x16')][_0xedee('0x14')]);}})[_0xedee('0x17')](function(_0x105131){logger[_0xedee('0x12')](_0xedee('0xd'),_0x99b75d,_0x105131);_0x4df791(_0x105131);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index 78505c6..0135db1 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 _0x4af1=['create','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticCustomReport.controller','index','get','/:id','isAuthenticated','show','/:id/preview','preview','/:id/run','/:id/query','query','post'];(function(_0x4a563b,_0x36f42d){var _0x2935ef=function(_0x32593f){while(--_0x32593f){_0x4a563b['push'](_0x4a563b['shift']());}};_0x2935ef(++_0x36f42d);}(_0x4af1,0x94));var _0x14af=function(_0x1c00e3,_0x3c24a0){_0x1c00e3=_0x1c00e3-0x0;var _0x27181b=_0x4af1[_0x1c00e3];return _0x27181b;};'use strict';var multer=require(_0x14af('0x0'));var util=require(_0x14af('0x1'));var path=require(_0x14af('0x2'));var timeout=require(_0x14af('0x3'));var express=require(_0x14af('0x4'));var router=express['Router']();var fs_extra=require(_0x14af('0x5'));var auth=require(_0x14af('0x6'));var interaction=require(_0x14af('0x7'));var config=require('../../config/environment');var controller=require(_0x14af('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x14af('0x9')]);router[_0x14af('0xa')](_0x14af('0xb'),auth[_0x14af('0xc')](),controller[_0x14af('0xd')]);router['get'](_0x14af('0xe'),auth[_0x14af('0xc')](),controller[_0x14af('0xf')]);router[_0x14af('0xa')](_0x14af('0x10'),auth[_0x14af('0xc')](),controller['run']);router[_0x14af('0xa')](_0x14af('0x11'),auth[_0x14af('0xc')](),controller[_0x14af('0x12')]);router[_0x14af('0x13')]('/',auth[_0x14af('0xc')](),controller[_0x14af('0x14')]);router['put'](_0x14af('0xb'),auth[_0x14af('0xc')](),controller['update']);router[_0x14af('0x15')](_0x14af('0xb'),auth[_0x14af('0xc')](),controller[_0x14af('0x16')]);module[_0x14af('0x17')]=router; \ No newline at end of file +var _0x9afb=['create','put','update','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','isAuthenticated','index','get','/:id','preview','/:id/run','post'];(function(_0x2cde0a,_0x1f9695){var _0x260610=function(_0x179089){while(--_0x179089){_0x2cde0a['push'](_0x2cde0a['shift']());}};_0x260610(++_0x1f9695);}(_0x9afb,0x10e));var _0xb9af=function(_0x1d3a4d,_0x7a4edb){_0x1d3a4d=_0x1d3a4d-0x0;var _0x122e3d=_0x9afb[_0x1d3a4d];return _0x122e3d;};'use strict';var multer=require(_0xb9af('0x0'));var util=require(_0xb9af('0x1'));var path=require(_0xb9af('0x2'));var timeout=require(_0xb9af('0x3'));var express=require(_0xb9af('0x4'));var router=express[_0xb9af('0x5')]();var fs_extra=require(_0xb9af('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xb9af('0x7'));var config=require('../../config/environment');var controller=require('./analyticCustomReport.controller');router['get']('/',auth[_0xb9af('0x8')](),controller[_0xb9af('0x9')]);router[_0xb9af('0xa')](_0xb9af('0xb'),auth[_0xb9af('0x8')](),controller['show']);router[_0xb9af('0xa')]('/:id/preview',auth[_0xb9af('0x8')](),controller[_0xb9af('0xc')]);router['get'](_0xb9af('0xd'),auth[_0xb9af('0x8')](),controller['run']);router[_0xb9af('0xa')]('/:id/query',auth[_0xb9af('0x8')](),controller['query']);router[_0xb9af('0xe')]('/',auth[_0xb9af('0x8')](),controller[_0xb9af('0xf')]);router[_0xb9af('0x10')]('/:id',auth[_0xb9af('0x8')](),controller[_0xb9af('0x11')]);router['delete']('/:id',auth[_0xb9af('0x8')](),controller[_0xb9af('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index 79feb99..2f2db5c 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 _0xeda8=['sequelize','exports','STRING','TEXT'];(function(_0x194d2f,_0x58d4af){var _0x3e5eca=function(_0x4bd8df){while(--_0x4bd8df){_0x194d2f['push'](_0x194d2f['shift']());}};_0x3e5eca(++_0x58d4af);}(_0xeda8,0x104));var _0x8eda=function(_0x2e5d8a,_0x2f97c0){_0x2e5d8a=_0x2e5d8a-0x0;var _0x4969ae=_0xeda8[_0x2e5d8a];return _0x4969ae;};'use strict';var Sequelize=require(_0x8eda('0x0'));module[_0x8eda('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x8eda('0x2')]},'parent':{'type':Sequelize[_0x8eda('0x2')]},'table':{'type':Sequelize[_0x8eda('0x2')]},'conditions':{'type':Sequelize[_0x8eda('0x3')]},'joins':{'type':Sequelize[_0x8eda('0x3')]}}; \ No newline at end of file +var _0x5075=['exports','STRING','TEXT','sequelize'];(function(_0x507597,_0x412525){var _0x110a0f=function(_0x57935a){while(--_0x57935a){_0x507597['push'](_0x507597['shift']());}};_0x110a0f(++_0x412525);}(_0x5075,0x73));var _0x5507=function(_0x41c49e,_0x4e9e2c){_0x41c49e=_0x41c49e-0x0;var _0x648a67=_0x5075[_0x41c49e];return _0x648a67;};'use strict';var Sequelize=require(_0x5507('0x0'));module[_0x5507('0x1')]={'name':{'type':Sequelize[_0x5507('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x5507('0x2')]},'parent':{'type':Sequelize[_0x5507('0x2')]},'table':{'type':Sequelize[_0x5507('0x2')]},'conditions':{'type':Sequelize[_0x5507('0x3')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index 1bae3f7..352fb04 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 _0xda19=['ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','field','function','replace','groupBy','orderBy','order','alias','joins','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','left_join','HOUR(%s)','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20EMPTY','operator','Sequelize','metric','format','DESC','parse','parentKey','web','output','csv','default','AnalyticExtractedReport','cdr','startDate','endDate','info','Run\x20Query:','child_process','fork','../../files/reports','savename','countTable','run','runReport','rimraf','zip-dir','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','dbH','status','json','offset','undefined','limit','count','set','apply','update','then','DefaultReports','destroy','end','error','stack','name','send','map','AnalyticDefaultReport','rawAttributes','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','type','VIRTUAL','merge','includeAll','include','findAll','show','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','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\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','group','condition','value','options','find','getFields'];(function(_0x3f80e8,_0xd88ecf){var _0x17cf31=function(_0x5c849e){while(--_0x5c849e){_0x3f80e8['push'](_0x3f80e8['shift']());}};_0x17cf31(++_0xd88ecf);}(_0xda19,0xd5));var _0x9da1=function(_0x55c498,_0x14021c){_0x55c498=_0x55c498-0x0;var _0x3323f2=_0xda19[_0x55c498];return _0x3323f2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9da1('0x0'));var zipdir=require(_0x9da1('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9da1('0x2'));var moment=require('moment');var BPromise=require(_0x9da1('0x3'));var Mustache=require('mustache');var util=require(_0x9da1('0x4'));var path=require(_0x9da1('0x5'));var sox=require(_0x9da1('0x6'));var csv=require(_0x9da1('0x7'));var ejs=require(_0x9da1('0x8'));var fs=require('fs');var fs_extra=require(_0x9da1('0x9'));var _=require(_0x9da1('0xa'));var squel=require(_0x9da1('0xb'));var crypto=require(_0x9da1('0xc'));var jsforce=require(_0x9da1('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9da1('0xe'));var Redis=require('ioredis');var authService=require(_0x9da1('0xf'));var qs=require(_0x9da1('0x10'));var as=require(_0x9da1('0x11'));var hardwareService=require(_0x9da1('0x12'));var logger=require(_0x9da1('0x13'))(_0x9da1('0x14'));var utils=require(_0x9da1('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x9da1('0x16'))['db'];var dbH=require('../../mysqldb')[_0x9da1('0x17')];function respondWithStatusCode(_0x1d93f8,_0xd2d225){_0xd2d225=_0xd2d225||0xcc;return function(_0x1ffa2a){if(_0x1ffa2a){return _0x1d93f8['sendStatus'](_0xd2d225);}return _0x1d93f8[_0x9da1('0x18')](_0xd2d225)['end']();};}function respondWithResult(_0x4d17e1,_0x40ba9d){_0x40ba9d=_0x40ba9d||0xc8;return function(_0x479ccd){if(_0x479ccd){return _0x4d17e1[_0x9da1('0x18')](_0x40ba9d)[_0x9da1('0x19')](_0x479ccd);}};}function respondWithFilteredResult(_0x37653d,_0x1a1a6b){return function(_0x7f1a64){if(_0x7f1a64){var _0x514d8e=typeof _0x1a1a6b[_0x9da1('0x1a')]===_0x9da1('0x1b')&&typeof _0x1a1a6b[_0x9da1('0x1c')]===_0x9da1('0x1b');var _0xfb278d=_0x7f1a64[_0x9da1('0x1d')];var _0x497676=_0x514d8e?0x0:_0x1a1a6b['offset'];var _0x17205d=_0x514d8e?_0x7f1a64[_0x9da1('0x1d')]:_0x1a1a6b[_0x9da1('0x1a')]+_0x1a1a6b[_0x9da1('0x1c')];var _0x40a967;if(_0x17205d>=_0xfb278d){_0x17205d=_0xfb278d;_0x40a967=0xc8;}else{_0x40a967=0xce;}_0x37653d[_0x9da1('0x18')](_0x40a967);return _0x37653d[_0x9da1('0x1e')]('Content-Range',_0x497676+'-'+_0x17205d+'/'+_0xfb278d)[_0x9da1('0x19')](_0x7f1a64);}return null;};}function patchUpdates(_0x554845){return function(_0x9c3b37){try{jsonpatch[_0x9da1('0x1f')](_0x9c3b37,_0x554845,!![]);}catch(_0x1fc065){return BPromise['reject'](_0x1fc065);}return _0x9c3b37['save']();};}function saveUpdates(_0x14793b,_0x3e6f85){return function(_0x16ee0c){if(_0x16ee0c){return _0x16ee0c[_0x9da1('0x20')](_0x14793b)[_0x9da1('0x21')](function(_0x165b73){return _0x165b73;});}return null;};}function removeEntity(_0x4c60aa,_0x2413fe){return function(_0x3bfa40){if(_0x3bfa40){return _0x3bfa40['destroy']()[_0x9da1('0x21')](function(){var _0x3f5680=_0x3bfa40['get']({'plain':!![]});var _0x2fd49c=_0x9da1('0x22');return db['UserProfileResource'][_0x9da1('0x23')]({'where':{'type':_0x2fd49c,'resourceId':_0x3f5680['id']}})[_0x9da1('0x21')](function(){return _0x3bfa40;});})['then'](function(){_0x4c60aa['status'](0xcc)[_0x9da1('0x24')]();});}};}function handleEntityNotFound(_0x47055e,_0x5eca5b){return function(_0x27c6e2){if(!_0x27c6e2){_0x47055e['sendStatus'](0x194);}return _0x27c6e2;};}function handleError(_0x5a6f2d,_0x5a59c2){_0x5a59c2=_0x5a59c2||0x1f4;return function(_0x31b826){logger[_0x9da1('0x25')](_0x31b826[_0x9da1('0x26')]);if(_0x31b826[_0x9da1('0x27')]){delete _0x31b826[_0x9da1('0x27')];}_0x5a6f2d['status'](_0x5a59c2)[_0x9da1('0x28')](_0x31b826);};}exports['index']=function(_0x1feae0,_0x235ced){var _0x5b38b3={},_0xc29ba8={},_0x2eb48f={'count':0x0,'rows':[]};var _0x4f318b=_[_0x9da1('0x29')](db[_0x9da1('0x2a')][_0x9da1('0x2b')],function(_0x2b2b48){return{'name':_0x2b2b48['fieldName'],'type':_0x2b2b48['type'][_0x9da1('0x2c')]};});_0xc29ba8[_0x9da1('0x2d')]=_[_0x9da1('0x29')](_0x4f318b,_0x9da1('0x27'));_0xc29ba8[_0x9da1('0x2e')]=_['keys'](_0x1feae0[_0x9da1('0x2e')]);_0xc29ba8[_0x9da1('0x2f')]=_[_0x9da1('0x30')](_0xc29ba8[_0x9da1('0x2d')],_0xc29ba8[_0x9da1('0x2e')]);_0x5b38b3[_0x9da1('0x31')]=_['intersection'](_0xc29ba8[_0x9da1('0x2d')],qs['fields'](_0x1feae0['query'][_0x9da1('0x32')]));_0x5b38b3['attributes']=_0x5b38b3[_0x9da1('0x31')][_0x9da1('0x33')]?_0x5b38b3[_0x9da1('0x31')]:_0xc29ba8[_0x9da1('0x2d')];if(!_0x1feae0[_0x9da1('0x2e')][_0x9da1('0x34')](_0x9da1('0x35'))){_0x5b38b3[_0x9da1('0x1c')]=qs['limit'](_0x1feae0[_0x9da1('0x2e')]['limit']);_0x5b38b3[_0x9da1('0x1a')]=qs['offset'](_0x1feae0['query'][_0x9da1('0x1a')]);}_0x5b38b3['order']=qs[_0x9da1('0x36')](_0x1feae0[_0x9da1('0x2e')]['sort']);_0x5b38b3[_0x9da1('0x37')]=qs[_0x9da1('0x2f')](_[_0x9da1('0x38')](_0x1feae0[_0x9da1('0x2e')],_0xc29ba8['filters']),_0x4f318b);if(_0x1feae0[_0x9da1('0x2e')]['filter']){_0x5b38b3[_0x9da1('0x37')]=_['merge'](_0x5b38b3[_0x9da1('0x37')],{'$or':_[_0x9da1('0x29')](_0x4f318b,function(_0x58e165){if(_0x58e165[_0x9da1('0x39')]!==_0x9da1('0x3a')){var _0x394acf={};_0x394acf[_0x58e165['name']]={'$like':'%'+_0x1feae0['query']['filter']+'%'};return _0x394acf;}})});}_0x5b38b3=_[_0x9da1('0x3b')]({},_0x5b38b3,_0x1feae0['options']);var _0x5b215c={'where':_0x5b38b3[_0x9da1('0x37')]};return db[_0x9da1('0x2a')][_0x9da1('0x1d')](_0x5b215c)['then'](function(_0x42dbd8){_0x2eb48f[_0x9da1('0x1d')]=_0x42dbd8;if(_0x1feae0[_0x9da1('0x2e')][_0x9da1('0x3c')]){_0x5b38b3[_0x9da1('0x3d')]=[{'all':!![]}];}return db[_0x9da1('0x2a')][_0x9da1('0x3e')](_0x5b38b3);})['then'](function(_0x467350){_0x2eb48f['rows']=_0x467350;return _0x2eb48f;})[_0x9da1('0x21')](respondWithFilteredResult(_0x235ced,_0x5b38b3))['catch'](handleError(_0x235ced,null));};exports[_0x9da1('0x3f')]=function(_0x40d848,_0x599211){var _0x265366={'raw':!![],'where':{'id':_0x40d848['params']['id']}},_0xfeec5f={};_0xfeec5f[_0x9da1('0x2d')]=_['keys'](db[_0x9da1('0x2a')][_0x9da1('0x2b')]);_0xfeec5f['query']=_['keys'](_0x40d848[_0x9da1('0x2e')]);_0xfeec5f[_0x9da1('0x2f')]=_[_0x9da1('0x30')](_0xfeec5f[_0x9da1('0x2d')],_0xfeec5f[_0x9da1('0x2e')]);_0x265366[_0x9da1('0x31')]=_[_0x9da1('0x30')](_0xfeec5f[_0x9da1('0x2d')],qs['fields'](_0x40d848[_0x9da1('0x2e')][_0x9da1('0x32')]));_0x265366[_0x9da1('0x31')]=_0x265366['attributes'][_0x9da1('0x33')]?_0x265366[_0x9da1('0x31')]:_0xfeec5f[_0x9da1('0x2d')];if(_0x40d848['query'][_0x9da1('0x3c')]){_0x265366[_0x9da1('0x3d')]=[{'all':!![]}];}_0x265366=_[_0x9da1('0x3b')]({},_0x265366,_0x40d848['options']);return db[_0x9da1('0x2a')]['find'](_0x265366)['then'](handleEntityNotFound(_0x599211,null))[_0x9da1('0x21')](respondWithResult(_0x599211,null))[_0x9da1('0x40')](handleError(_0x599211,null));};exports['create']=function(_0x712d10,_0x2066d2){return db['AnalyticDefaultReport'][_0x9da1('0x41')](_0x712d10[_0x9da1('0x42')],{})[_0x9da1('0x21')](function(_0x3a529d){var _0x4780ca=_0x712d10[_0x9da1('0x43')][_0x9da1('0x44')]({'plain':!![]});if(!_0x4780ca)throw new Error(_0x9da1('0x45'));if(_0x4780ca[_0x9da1('0x46')]==='user'){var _0x147c65=_0x3a529d[_0x9da1('0x44')]({'plain':!![]});var _0x34a203=_0x9da1('0x47');return db['UserProfileSection']['find']({'where':{'name':_0x34a203,'userProfileId':_0x4780ca[_0x9da1('0x48')]},'raw':!![]})[_0x9da1('0x21')](function(_0x3870dd){if(_0x3870dd&&_0x3870dd[_0x9da1('0x49')]===0x0){return db[_0x9da1('0x4a')][_0x9da1('0x41')]({'name':_0x147c65[_0x9da1('0x27')],'resourceId':_0x147c65['id'],'type':_0x9da1('0x22'),'sectionId':_0x3870dd['id']},{})[_0x9da1('0x21')](function(){return _0x3a529d;});}else{return _0x3a529d;}})[_0x9da1('0x40')](function(_0x868167){logger[_0x9da1('0x25')](_0x9da1('0x4b'),_0x868167);throw _0x868167;});}return _0x3a529d;})[_0x9da1('0x21')](respondWithResult(_0x2066d2,0xc9))['catch'](handleError(_0x2066d2,null));};exports[_0x9da1('0x20')]=function(_0x1fbb5d,_0x4d241a){if(_0x1fbb5d[_0x9da1('0x42')]['id']){delete _0x1fbb5d['body']['id'];}return db[_0x9da1('0x2a')]['find']({'where':{'id':_0x1fbb5d[_0x9da1('0x4c')]['id']}})[_0x9da1('0x21')](handleEntityNotFound(_0x4d241a,null))[_0x9da1('0x21')](saveUpdates(_0x1fbb5d[_0x9da1('0x42')],null))[_0x9da1('0x21')](respondWithResult(_0x4d241a,null))[_0x9da1('0x40')](handleError(_0x4d241a,null));};exports[_0x9da1('0x23')]=function(_0x343b05,_0x170351){return db[_0x9da1('0x2a')]['find']({'where':{'id':_0x343b05[_0x9da1('0x4c')]['id']}})[_0x9da1('0x21')](handleEntityNotFound(_0x170351,null))[_0x9da1('0x21')](removeEntity(_0x170351,null))[_0x9da1('0x40')](handleError(_0x170351,null));};exports[_0x9da1('0x4d')]=function(_0x4607a9,_0x2020d0){var _0x3c01c3=0xa;var _0xfa8d3f=[_0x9da1('0x4e'),'left_join',_0x9da1('0x4f'),_0x9da1('0x50')];var _0x5bda2a={'SUM':_0x9da1('0x51'),'COUNT':_0x9da1('0x52'),'COUNT DISTINCT':_0x9da1('0x53'),'MAX':_0x9da1('0x54'),'MIN':_0x9da1('0x55'),'AVG':_0x9da1('0x56'),'GROUP_CONCAT':_0x9da1('0x57'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x9da1('0x58')};var _0xc27b00={'SEC_TO_TIME':_0x9da1('0x59'),'DATE':_0x9da1('0x5a'),'HOUR':'HOUR(%s)','ROUND':_0x9da1('0x5b'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x27ac84=function(_0x10ebc9){return!_[_0x9da1('0x5c')]([_0x9da1('0x5d'),_0x9da1('0x5e'),_0x9da1('0x5f'),'IS\x20NOT\x20EMPTY'],_0x10ebc9);};var _0x5f5dc2=function(_0x454a68){if(!_0x454a68||!_0x454a68['rules']['length']){return'';}for(var _0x5b4a05='(',_0x6f86c3=0x0;_0x6f86c3<_0x454a68['rules'][_0x9da1('0x33')];_0x6f86c3+=0x1){_0x6f86c3>0x0&&(_0x5b4a05+='\x20'+_0x454a68['operator']+'\x20');_0x5b4a05+=_0x454a68[_0x9da1('0x60')][_0x6f86c3][_0x9da1('0x61')]?_0x5f5dc2(_0x454a68['rules'][_0x6f86c3][_0x9da1('0x61')]):_0x454a68[_0x9da1('0x60')][_0x6f86c3]['field']+'\x20'+_0x454a68[_0x9da1('0x60')][_0x6f86c3][_0x9da1('0x62')]+(_0x27ac84(_0x454a68['rules'][_0x6f86c3]['condition'])?'\x20'+_0x454a68[_0x9da1('0x60')][_0x6f86c3][_0x9da1('0x63')]:'');}return _0x5b4a05+')';};var _0x21d00c={'where':{'id':_0x4607a9['params']['id']}},_0x3ca531,_0x236b01,_0x44d7fe,_0x5cb102,_0x3d2c25;_0x21d00c=_['merge']({},_0x21d00c,_0x4607a9[_0x9da1('0x64')]);return db[_0x9da1('0x2a')][_0x9da1('0x65')](_0x21d00c)[_0x9da1('0x21')](function(_0x3382b1){if(_0x3382b1){_0x3ca531=_0x3382b1;return _0x3382b1[_0x9da1('0x66')]();}return null;})[_0x9da1('0x21')](function(_0x1f2a4b){if(_0x1f2a4b){if(!_0x1f2a4b[_0x9da1('0x33')]){throw new db['Sequelize'][(_0x9da1('0x67'))](_0x9da1('0x68'),0x193);}_0x236b01=_0x1f2a4b;return db[_0x9da1('0x69')][_0x9da1('0x3e')]({'raw':!![]});}return null;})[_0x9da1('0x21')](function(_0x491fcb){if(_0x491fcb){_0x44d7fe=_[_0x9da1('0x6a')](_0x491fcb,'id');var _0x13fadd;var _0x419f78=squel[_0x9da1('0x6b')]();_0x419f78[_0x9da1('0x6c')](_0x3ca531[_0x9da1('0x6d')]);for(var _0x55a6d2=0x0;_0x55a6d2<_0x236b01[_0x9da1('0x33')];_0x55a6d2+=0x1){_0x13fadd=_0x236b01[_0x55a6d2]['MetricId']?_0x44d7fe[_0x236b01[_0x55a6d2][_0x9da1('0x6e')]]['metric']:_0x236b01[_0x55a6d2][_0x9da1('0x6f')];_0x13fadd=_0x236b01[_0x55a6d2][_0x9da1('0x70')]?_[_0x9da1('0x71')](_0x5bda2a[_0x236b01[_0x55a6d2][_0x9da1('0x70')]],'%s',_0x13fadd):_0x13fadd;_0x13fadd=_0x236b01[_0x55a6d2]['format']?_['replace'](_0xc27b00[_0x236b01[_0x55a6d2]['format']],'%s',_0x13fadd):_0x13fadd;if(_0x236b01[_0x55a6d2][_0x9da1('0x72')]){_0x419f78[_0x9da1('0x61')](_0x13fadd);}_0x236b01[_0x55a6d2][_0x9da1('0x73')]&&_0x419f78[_0x9da1('0x74')](_0x13fadd,_0x236b01[_0x55a6d2]['orderBy']==='DESC'?![]:!![]);_0x419f78[_0x9da1('0x6f')](_0x13fadd,_0x236b01[_0x55a6d2][_0x9da1('0x75')]||_0x13fadd);}if(_0x3ca531[_0x9da1('0x76')]){_0x3ca531['joins']=JSON['parse'](_0x3ca531[_0x9da1('0x76')]);for(var _0x1deb93=0x0;_0x1deb93<_0x3ca531[_0x9da1('0x76')]['length'];_0x1deb93+=0x1){if(_0x3ca531['joins'][_0x1deb93][_0x9da1('0x39')]&&_[_0x9da1('0x5c')](_0xfa8d3f,_0x3ca531[_0x9da1('0x76')][_0x1deb93][_0x9da1('0x39')])&&_0x3ca531[_0x9da1('0x76')][_0x1deb93]['parentKey']&&_0x3ca531[_0x9da1('0x76')][_0x1deb93][_0x9da1('0x77')]&&_0x3ca531[_0x9da1('0x76')][_0x1deb93][_0x9da1('0x78')]){_0x419f78[_0x3ca531['joins'][_0x1deb93][_0x9da1('0x39')]](_0x3ca531[_0x9da1('0x76')][_0x1deb93][_0x9da1('0x77')],null,util['format'](_0x9da1('0x79'),_0x3ca531[_0x9da1('0x6d')],_0x3ca531[_0x9da1('0x76')][_0x1deb93]['parentKey'],_0x3ca531[_0x9da1('0x76')][_0x1deb93][_0x9da1('0x77')],_0x3ca531['joins'][_0x1deb93][_0x9da1('0x78')]));}}}if(_0x3ca531['conditions']){_0x3ca531[_0x9da1('0x7a')]=JSON['parse'](_0x3ca531[_0x9da1('0x7a')]);_0x419f78[_0x9da1('0x37')](_0x5f5dc2(_0x3ca531[_0x9da1('0x7a')][_0x9da1('0x61')]));}_0x3d2c25=_0x419f78[_0x9da1('0x7b')]();_0x419f78[_0x9da1('0x1c')](_0x3c01c3);_0x419f78[_0x9da1('0x1a')](0x0);logger[_0x9da1('0x7c')](_0x9da1('0x7d'),_0x419f78[_0x9da1('0x7e')]());return dbH[_0x9da1('0x7f')][_0x9da1('0x2e')](_0x419f78[_0x9da1('0x7e')](),{'type':dbH['sequelize'][_0x9da1('0x80')][_0x9da1('0x81')]});}})[_0x9da1('0x21')](respondWithResult(_0x2020d0,null))[_0x9da1('0x40')](handleError(_0x2020d0,null));};function runReport(_0x162597,_0x4f39bc,_0x1ca102){var _0x2eb5e6=_0x4f39bc['name'];var _0x4a4cda=0xa;var _0x84f8d8=[_0x9da1('0x4e'),_0x9da1('0x82'),_0x9da1('0x4f'),_0x9da1('0x50')];var _0x4701b3={'SUM':_0x9da1('0x51'),'COUNT':_0x9da1('0x52'),'COUNT DISTINCT':_0x9da1('0x53'),'MAX':_0x9da1('0x54'),'MIN':_0x9da1('0x55'),'AVG':_0x9da1('0x56'),'GROUP_CONCAT':_0x9da1('0x57'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x9da1('0x58')};var _0x3a0a84={'SEC_TO_TIME':_0x9da1('0x59'),'DATE':_0x9da1('0x5a'),'HOUR':_0x9da1('0x83'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x9da1('0x84')};var _0x354c5a=function(_0x53ab6a){return!_[_0x9da1('0x5c')](['IS\x20NULL',_0x9da1('0x5e'),'IS\x20EMPTY',_0x9da1('0x85')],_0x53ab6a);};var _0x106bd9=function(_0x347cb8){if(!_0x347cb8||!_0x347cb8[_0x9da1('0x60')][_0x9da1('0x33')]){return'';}for(var _0x3e331a='(',_0x1f785c=0x0;_0x1f785c<_0x347cb8[_0x9da1('0x60')][_0x9da1('0x33')];_0x1f785c+=0x1){_0x1f785c>0x0&&(_0x3e331a+='\x20'+_0x347cb8[_0x9da1('0x86')]+'\x20');_0x3e331a+=_0x347cb8[_0x9da1('0x60')][_0x1f785c][_0x9da1('0x61')]?_0x106bd9(_0x347cb8['rules'][_0x1f785c][_0x9da1('0x61')]):_0x347cb8[_0x9da1('0x60')][_0x1f785c][_0x9da1('0x6f')]+'\x20'+_0x347cb8[_0x9da1('0x60')][_0x1f785c][_0x9da1('0x62')]+(_0x354c5a(_0x347cb8[_0x9da1('0x60')][_0x1f785c]['condition'])?'\x20'+_0x347cb8['rules'][_0x1f785c][_0x9da1('0x63')]:'');}return _0x3e331a+')';};var _0xdecc82={'where':{'id':_0x162597['id']}},_0xe12dd7,_0x4cd85f,_0x4bf74c,_0x28335d,_0x175b4b;_0xdecc82=_[_0x9da1('0x3b')]({},_0xdecc82,_0x1ca102);return db[_0x9da1('0x2a')][_0x9da1('0x65')](_0xdecc82)[_0x9da1('0x21')](function(_0x5561f0){if(_0x5561f0){_0xe12dd7=_0x5561f0;return _0x5561f0[_0x9da1('0x66')]();}return null;})[_0x9da1('0x21')](function(_0x5a64fd){if(_0x5a64fd){if(!_0x5a64fd['length']){throw new db[(_0x9da1('0x87'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x4cd85f=_0x5a64fd;return db[_0x9da1('0x69')][_0x9da1('0x3e')]({'raw':!![]});}return null;})[_0x9da1('0x21')](function(_0x18ae08){if(_0x18ae08){_0x4bf74c=_[_0x9da1('0x6a')](_0x18ae08,'id');var _0x30065d;var _0x40a2ef=squel[_0x9da1('0x6b')]();_0x40a2ef['from'](_0xe12dd7['table']);for(var _0xd10ba4=0x0;_0xd10ba4<_0x4cd85f[_0x9da1('0x33')];_0xd10ba4+=0x1){_0x30065d=_0x4cd85f[_0xd10ba4][_0x9da1('0x6e')]?_0x4bf74c[_0x4cd85f[_0xd10ba4][_0x9da1('0x6e')]][_0x9da1('0x88')]:_0x4cd85f[_0xd10ba4][_0x9da1('0x6f')];_0x30065d=_0x4cd85f[_0xd10ba4][_0x9da1('0x70')]?_[_0x9da1('0x71')](_0x4701b3[_0x4cd85f[_0xd10ba4]['function']],'%s',_0x30065d):_0x30065d;_0x30065d=_0x4cd85f[_0xd10ba4][_0x9da1('0x89')]?_['replace'](_0x3a0a84[_0x4cd85f[_0xd10ba4][_0x9da1('0x89')]],'%s',_0x30065d):_0x30065d;if(_0x4cd85f[_0xd10ba4][_0x9da1('0x72')]){_0x40a2ef[_0x9da1('0x61')](_0x30065d);}_0x4cd85f[_0xd10ba4][_0x9da1('0x73')]&&_0x40a2ef[_0x9da1('0x74')](_0x30065d,_0x4cd85f[_0xd10ba4][_0x9da1('0x73')]===_0x9da1('0x8a')?![]:!![]);_0x40a2ef['field'](_0x30065d,_0x4cd85f[_0xd10ba4][_0x9da1('0x75')]||_0x30065d);}if(_0xe12dd7['joins']){_0xe12dd7[_0x9da1('0x76')]=JSON[_0x9da1('0x8b')](_0xe12dd7[_0x9da1('0x76')]);for(var _0x22b679=0x0;_0x22b679<_0xe12dd7['joins'][_0x9da1('0x33')];_0x22b679+=0x1){if(_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x39')]&&_[_0x9da1('0x5c')](_0x84f8d8,_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x39')])&&_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x8c')]&&_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x77')]&&_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x78')]){_0x40a2ef[_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x39')]](_0xe12dd7['joins'][_0x22b679][_0x9da1('0x77')],null,util['format'](_0x9da1('0x79'),_0xe12dd7['table'],_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x8c')],_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x77')],_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x78')]));}}}if(_0xe12dd7[_0x9da1('0x7a')]){_0xe12dd7[_0x9da1('0x7a')]=JSON['parse'](_0xe12dd7[_0x9da1('0x7a')]);_0x40a2ef[_0x9da1('0x37')](_0x106bd9(_0xe12dd7['conditions'][_0x9da1('0x61')]));}_0x175b4b=_0x40a2ef[_0x9da1('0x7b')]();_0x40a2ef[_0x9da1('0x1c')](_0x4a4cda);_0x40a2ef['offset'](0x0);return;}})['then'](function(){if(_0x4f39bc['output']===_0x9da1('0x8d')){return null;}var _0x3b17aa=_[_0x9da1('0x3b')](_0x4f39bc,{'name':_0x4f39bc['fullPath']||_0x4f39bc['name']||_0xe12dd7[_0x9da1('0x27')],'basename':_0x2eb5e6,'savename':util[_0x9da1('0x89')]('%s-%s.%s',_0x4f39bc[_0x9da1('0x27')]||_0xe12dd7['name'],require('randomstring')['generate'](0x4),_0x4f39bc[_0x9da1('0x8e')]||_0x9da1('0x8f')),'reportId':_0xe12dd7['id'],'reportType':_0x9da1('0x90')});return db[_0x9da1('0x91')][_0x9da1('0x41')](_0x3b17aa,{'raw':!![]});})[_0x9da1('0x21')](function(_0x2aac99){if(_0xe12dd7[_0x9da1('0x6d')]===_0x9da1('0x92')){_0x175b4b[_0x9da1('0x37')](_0xe12dd7[_0x9da1('0x6d')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x4f39bc['startDate'],_0x4f39bc['endDate']);}else{_0x175b4b[_0x9da1('0x37')](_0xe12dd7[_0x9da1('0x6d')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x4f39bc[_0x9da1('0x93')],_0x4f39bc[_0x9da1('0x94')]);}if(_0x2aac99){logger[_0x9da1('0x95')](_0x9da1('0x96'),_0x175b4b[_0x9da1('0x7e')]());require(_0x9da1('0x97'))[_0x9da1('0x98')](path[_0x9da1('0x4e')](__dirname,'../../components/export/',_0x2aac99[_0x9da1('0x8e')]),[_0x2aac99['id'],_0x175b4b[_0x9da1('0x7e')](),path[_0x9da1('0x4e')](__dirname,_0x9da1('0x99'),_0x2aac99[_0x9da1('0x9a')]),_0x2eb5e6]);return _0x2aac99;}else{var _0x5ad3f8=squel[_0x9da1('0x6b')]();_0x5ad3f8['from']('('+_0x175b4b[_0x9da1('0x7e')]()+')',_0x9da1('0x9b'));_0x5ad3f8[_0x9da1('0x6f')]('COUNT(*)','count');_0x175b4b[_0x9da1('0x1c')](_0x4f39bc[_0x9da1('0x1c')]||_0x4a4cda);_0x175b4b[_0x9da1('0x1a')](_0x4f39bc['offset']||0x0);return dbH[_0x9da1('0x7f')][_0x9da1('0x2e')](_0x5ad3f8['toString'](),{'type':dbH[_0x9da1('0x7f')][_0x9da1('0x80')]['SELECT']})['then'](function(_0x489b3f){if(!_0x489b3f[_0x9da1('0x33')]){_0x28335d=0x0;}else{_0x28335d=_0x489b3f[0x0]['count']||0x0;}return dbH[_0x9da1('0x7f')][_0x9da1('0x2e')](_0x175b4b[_0x9da1('0x7e')](),{'type':dbH[_0x9da1('0x7f')][_0x9da1('0x80')][_0x9da1('0x81')]});})['then'](function(_0x355a71){return{'rows':_0x355a71||[],'count':_0x28335d};});}});}exports[_0x9da1('0x9c')]=function(_0x492e1a,_0x449a17){return runReport(_0x492e1a[_0x9da1('0x4c')],_0x492e1a[_0x9da1('0x2e')],_0x492e1a[_0x9da1('0x64')])['then'](respondWithResult(_0x449a17,null))[_0x9da1('0x40')](handleError(_0x449a17,null));};exports[_0x9da1('0x9d')]=runReport;exports[_0x9da1('0x2e')]=function(_0x8280a9,_0x374754){var _0x1e466a=0xa;var _0x3f9133=[_0x9da1('0x4e'),'left_join',_0x9da1('0x4f'),'cross_join'];var _0x3dd3e0={'SUM':_0x9da1('0x51'),'COUNT':_0x9da1('0x52'),'COUNT DISTINCT':_0x9da1('0x53'),'MAX':_0x9da1('0x54'),'MIN':_0x9da1('0x55'),'AVG':_0x9da1('0x56'),'GROUP_CONCAT':_0x9da1('0x57'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x9da1('0x58')};var _0x52e4a6={'SEC_TO_TIME':_0x9da1('0x59'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0x9da1('0x5b'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x4aa903=function(_0x55d7f2){return!_['includes'](['IS\x20NULL',_0x9da1('0x5e'),_0x9da1('0x5f'),_0x9da1('0x85')],_0x55d7f2);};var _0x3212ad=function(_0x5ac65b){if(!_0x5ac65b||!_0x5ac65b[_0x9da1('0x60')][_0x9da1('0x33')]){return'';}for(var _0x21a99d='(',_0xd19a7c=0x0;_0xd19a7c<_0x5ac65b[_0x9da1('0x60')][_0x9da1('0x33')];_0xd19a7c+=0x1){_0xd19a7c>0x0&&(_0x21a99d+='\x20'+_0x5ac65b[_0x9da1('0x86')]+'\x20');_0x21a99d+=_0x5ac65b[_0x9da1('0x60')][_0xd19a7c][_0x9da1('0x61')]?_0x3212ad(_0x5ac65b[_0x9da1('0x60')][_0xd19a7c][_0x9da1('0x61')]):_0x5ac65b['rules'][_0xd19a7c][_0x9da1('0x6f')]+'\x20'+_0x5ac65b[_0x9da1('0x60')][_0xd19a7c]['condition']+(_0x4aa903(_0x5ac65b['rules'][_0xd19a7c][_0x9da1('0x62')])?'\x20'+_0x5ac65b[_0x9da1('0x60')][_0xd19a7c][_0x9da1('0x63')]:'');}return _0x21a99d+')';};var _0xb14af1={'where':{'id':_0x8280a9[_0x9da1('0x4c')]['id']}},_0x245566,_0x5b2591,_0x3c51e3,_0x54b83d,_0x23bf86;_0xb14af1=_['merge']({},_0xb14af1,_0x8280a9[_0x9da1('0x64')]);return db[_0x9da1('0x2a')][_0x9da1('0x65')](_0xb14af1)[_0x9da1('0x21')](function(_0x4bb140){if(_0x4bb140){_0x245566=_0x4bb140;return _0x4bb140[_0x9da1('0x66')]();}return null;})['then'](function(_0x47cbdd){if(_0x47cbdd){if(!_0x47cbdd['length']){throw new db[(_0x9da1('0x87'))][(_0x9da1('0x67'))](_0x9da1('0x68'),0x193);}_0x5b2591=_0x47cbdd;return db['AnalyticMetric'][_0x9da1('0x3e')]({'raw':!![]});}return null;})[_0x9da1('0x21')](function(_0x5e1e24){if(_0x5e1e24){_0x3c51e3=_[_0x9da1('0x6a')](_0x5e1e24,'id');var _0x49ddec;var _0x407218=squel['select']();_0x407218['from'](_0x245566['table']);for(var _0x316fee=0x0;_0x316fee<_0x5b2591['length'];_0x316fee+=0x1){_0x49ddec=_0x5b2591[_0x316fee][_0x9da1('0x6e')]?_0x3c51e3[_0x5b2591[_0x316fee][_0x9da1('0x6e')]]['metric']:_0x5b2591[_0x316fee]['field'];_0x49ddec=_0x5b2591[_0x316fee][_0x9da1('0x70')]?_['replace'](_0x3dd3e0[_0x5b2591[_0x316fee][_0x9da1('0x70')]],'%s',_0x49ddec):_0x49ddec;_0x49ddec=_0x5b2591[_0x316fee][_0x9da1('0x89')]?_['replace'](_0x52e4a6[_0x5b2591[_0x316fee]['format']],'%s',_0x49ddec):_0x49ddec;if(_0x5b2591[_0x316fee][_0x9da1('0x72')]){_0x407218[_0x9da1('0x61')](_0x49ddec);}_0x5b2591[_0x316fee][_0x9da1('0x73')]&&_0x407218[_0x9da1('0x74')](_0x49ddec,_0x5b2591[_0x316fee]['orderBy']==='DESC'?![]:!![]);_0x407218[_0x9da1('0x6f')](_0x49ddec,_0x5b2591[_0x316fee][_0x9da1('0x75')]||_0x49ddec);}if(_0x245566[_0x9da1('0x76')]){_0x245566[_0x9da1('0x76')]=JSON[_0x9da1('0x8b')](_0x245566['joins']);for(var _0x56ec7d=0x0;_0x56ec7d<_0x245566[_0x9da1('0x76')][_0x9da1('0x33')];_0x56ec7d+=0x1){if(_0x245566['joins'][_0x56ec7d][_0x9da1('0x39')]&&_['includes'](_0x3f9133,_0x245566[_0x9da1('0x76')][_0x56ec7d][_0x9da1('0x39')])&&_0x245566[_0x9da1('0x76')][_0x56ec7d][_0x9da1('0x8c')]&&_0x245566[_0x9da1('0x76')][_0x56ec7d][_0x9da1('0x77')]&&_0x245566['joins'][_0x56ec7d][_0x9da1('0x78')]){_0x407218[_0x245566[_0x9da1('0x76')][_0x56ec7d][_0x9da1('0x39')]](_0x245566[_0x9da1('0x76')][_0x56ec7d]['foreignTable'],null,util[_0x9da1('0x89')](_0x9da1('0x79'),_0x245566[_0x9da1('0x6d')],_0x245566['joins'][_0x56ec7d]['parentKey'],_0x245566[_0x9da1('0x76')][_0x56ec7d][_0x9da1('0x77')],_0x245566['joins'][_0x56ec7d]['foreignKey']));}}}if(_0x245566[_0x9da1('0x7a')]){_0x245566[_0x9da1('0x7a')]=JSON[_0x9da1('0x8b')](_0x245566[_0x9da1('0x7a')]);_0x407218[_0x9da1('0x37')](_0x3212ad(_0x245566['conditions'][_0x9da1('0x61')]));}_0x23bf86=_0x407218['clone']();_0x407218[_0x9da1('0x1c')](_0x1e466a);_0x407218[_0x9da1('0x1a')](0x0);logger[_0x9da1('0x7c')](_0x9da1('0x7d'),_0x407218['toString']());return dbH['sequelize'][_0x9da1('0x2e')](_0x407218[_0x9da1('0x7e')](),{'type':dbH[_0x9da1('0x7f')][_0x9da1('0x80')][_0x9da1('0x81')]});}})[_0x9da1('0x21')](function(){return{'sql':_0x23bf86['toString']()};})[_0x9da1('0x21')](respondWithResult(_0x374754,null))[_0x9da1('0x40')](handleError(_0x374754,null));}; \ No newline at end of file +var _0x4975=['set','Content-Range','save','update','then','destroy','get','DefaultReports','UserProfileResource','error','stack','name','index','AnalyticDefaultReport','rawAttributes','type','key','map','query','filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','keys','find','body','role','user','Reports','UserProfileSection','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','SUM(%s)','COUNT(%s)','MAX(%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)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','value','Sequelize','ValidationErrorItem','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','format','groupBy','orderBy','DESC','joins','includes','parentKey','foreignKey','foreignTable','conditions','parse','debug','Limited\x20Query:','sequelize','QueryTypes','SELECT','left_join','COUNT(DISTINCT\x20%s)','MIN(%s)','AVG(%s)','HOUR(%s)','operator','Please\x20insert\x20at\x20least\x20one\x20field','alias','%s.%s\x20=\x20%s.%s','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','toString','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','run','runReport','cross_join','getFields','replace','clone','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','count','limit'];(function(_0x313d54,_0x42f9e8){var _0x1cd633=function(_0x820bde){while(--_0x820bde){_0x313d54['push'](_0x313d54['shift']());}};_0x1cd633(++_0x42f9e8);}(_0x4975,0x86));var _0x5497=function(_0x38c9b5,_0x46dfee){_0x38c9b5=_0x38c9b5-0x0;var _0x54aed1=_0x4975[_0x38c9b5];return _0x54aed1;};'use strict';var emlformat=require(_0x5497('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5497('0x1'));var jsonpatch=require(_0x5497('0x2'));var rp=require(_0x5497('0x3'));var moment=require(_0x5497('0x4'));var BPromise=require(_0x5497('0x5'));var Mustache=require(_0x5497('0x6'));var util=require(_0x5497('0x7'));var path=require(_0x5497('0x8'));var sox=require(_0x5497('0x9'));var csv=require(_0x5497('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5497('0xb'));var _=require('lodash');var squel=require(_0x5497('0xc'));var crypto=require(_0x5497('0xd'));var jsforce=require(_0x5497('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5497('0xa'));var querystring=require('querystring');var Papa=require(_0x5497('0xf'));var Redis=require(_0x5497('0x10'));var authService=require(_0x5497('0x11'));var qs=require(_0x5497('0x12'));var as=require(_0x5497('0x13'));var hardwareService=require(_0x5497('0x14'));var logger=require(_0x5497('0x15'))(_0x5497('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x5497('0x17'))['db'];var dbH=require(_0x5497('0x17'))[_0x5497('0x18')];function respondWithStatusCode(_0x984990,_0x747dc7){_0x747dc7=_0x747dc7||0xcc;return function(_0x365144){if(_0x365144){return _0x984990[_0x5497('0x19')](_0x747dc7);}return _0x984990[_0x5497('0x1a')](_0x747dc7)[_0x5497('0x1b')]();};}function respondWithResult(_0x1a4c74,_0x55f590){_0x55f590=_0x55f590||0xc8;return function(_0x11b0a9){if(_0x11b0a9){return _0x1a4c74['status'](_0x55f590)[_0x5497('0x1c')](_0x11b0a9);}};}function respondWithFilteredResult(_0x2bfd8a,_0x19e5f3){return function(_0x3ce50b){if(_0x3ce50b){var _0x37c18e=typeof _0x19e5f3[_0x5497('0x1d')]===_0x5497('0x1e')&&typeof _0x19e5f3['limit']==='undefined';var _0x3f4d20=_0x3ce50b[_0x5497('0x1f')];var _0x3a47fd=_0x37c18e?0x0:_0x19e5f3['offset'];var _0xbf1ba7=_0x37c18e?_0x3ce50b[_0x5497('0x1f')]:_0x19e5f3[_0x5497('0x1d')]+_0x19e5f3[_0x5497('0x20')];var _0x1b1b43;if(_0xbf1ba7>=_0x3f4d20){_0xbf1ba7=_0x3f4d20;_0x1b1b43=0xc8;}else{_0x1b1b43=0xce;}_0x2bfd8a[_0x5497('0x1a')](_0x1b1b43);return _0x2bfd8a[_0x5497('0x21')](_0x5497('0x22'),_0x3a47fd+'-'+_0xbf1ba7+'/'+_0x3f4d20)[_0x5497('0x1c')](_0x3ce50b);}return null;};}function patchUpdates(_0x3f54ef){return function(_0x186065){try{jsonpatch['apply'](_0x186065,_0x3f54ef,!![]);}catch(_0x720767){return BPromise['reject'](_0x720767);}return _0x186065[_0x5497('0x23')]();};}function saveUpdates(_0xd0868d,_0x44265c){return function(_0x2f587d){if(_0x2f587d){return _0x2f587d[_0x5497('0x24')](_0xd0868d)[_0x5497('0x25')](function(_0x5018fa){return _0x5018fa;});}return null;};}function removeEntity(_0x54043a,_0x1eefce){return function(_0x34b97f){if(_0x34b97f){return _0x34b97f[_0x5497('0x26')]()[_0x5497('0x25')](function(){var _0x5223b5=_0x34b97f[_0x5497('0x27')]({'plain':!![]});var _0x57268c=_0x5497('0x28');return db[_0x5497('0x29')][_0x5497('0x26')]({'where':{'type':_0x57268c,'resourceId':_0x5223b5['id']}})[_0x5497('0x25')](function(){return _0x34b97f;});})[_0x5497('0x25')](function(){_0x54043a[_0x5497('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4af5f4,_0x5406e2){return function(_0x583d06){if(!_0x583d06){_0x4af5f4['sendStatus'](0x194);}return _0x583d06;};}function handleError(_0x39a2b7,_0x48d146){_0x48d146=_0x48d146||0x1f4;return function(_0x5e9356){logger[_0x5497('0x2a')](_0x5e9356[_0x5497('0x2b')]);if(_0x5e9356[_0x5497('0x2c')]){delete _0x5e9356['name'];}_0x39a2b7['status'](_0x48d146)['send'](_0x5e9356);};}exports[_0x5497('0x2d')]=function(_0x471e0b,_0xf4c117){var _0x5b8f79={},_0x489f71={},_0x594866={'count':0x0,'rows':[]};var _0xa28dd8=_['map'](db[_0x5497('0x2e')][_0x5497('0x2f')],function(_0x77c575){return{'name':_0x77c575['fieldName'],'type':_0x77c575[_0x5497('0x30')][_0x5497('0x31')]};});_0x489f71['model']=_[_0x5497('0x32')](_0xa28dd8,_0x5497('0x2c'));_0x489f71[_0x5497('0x33')]=_['keys'](_0x471e0b[_0x5497('0x33')]);_0x489f71[_0x5497('0x34')]=_[_0x5497('0x35')](_0x489f71[_0x5497('0x36')],_0x489f71[_0x5497('0x33')]);_0x5b8f79['attributes']=_[_0x5497('0x35')](_0x489f71[_0x5497('0x36')],qs['fields'](_0x471e0b[_0x5497('0x33')][_0x5497('0x37')]));_0x5b8f79[_0x5497('0x38')]=_0x5b8f79[_0x5497('0x38')][_0x5497('0x39')]?_0x5b8f79[_0x5497('0x38')]:_0x489f71['model'];if(!_0x471e0b[_0x5497('0x33')]['hasOwnProperty'](_0x5497('0x3a'))){_0x5b8f79[_0x5497('0x20')]=qs[_0x5497('0x20')](_0x471e0b['query']['limit']);_0x5b8f79[_0x5497('0x1d')]=qs[_0x5497('0x1d')](_0x471e0b[_0x5497('0x33')][_0x5497('0x1d')]);}_0x5b8f79[_0x5497('0x3b')]=qs[_0x5497('0x3c')](_0x471e0b['query'][_0x5497('0x3c')]);_0x5b8f79[_0x5497('0x3d')]=qs[_0x5497('0x34')](_[_0x5497('0x3e')](_0x471e0b[_0x5497('0x33')],_0x489f71[_0x5497('0x34')]),_0xa28dd8);if(_0x471e0b[_0x5497('0x33')][_0x5497('0x3f')]){_0x5b8f79[_0x5497('0x3d')]=_['merge'](_0x5b8f79[_0x5497('0x3d')],{'$or':_[_0x5497('0x32')](_0xa28dd8,function(_0x1e9616){if(_0x1e9616[_0x5497('0x30')]!==_0x5497('0x40')){var _0xa5ebe6={};_0xa5ebe6[_0x1e9616[_0x5497('0x2c')]]={'$like':'%'+_0x471e0b['query'][_0x5497('0x3f')]+'%'};return _0xa5ebe6;}})});}_0x5b8f79=_[_0x5497('0x41')]({},_0x5b8f79,_0x471e0b[_0x5497('0x42')]);var _0x35993c={'where':_0x5b8f79[_0x5497('0x3d')]};return db[_0x5497('0x2e')][_0x5497('0x1f')](_0x35993c)['then'](function(_0x2137bd){_0x594866[_0x5497('0x1f')]=_0x2137bd;if(_0x471e0b[_0x5497('0x33')][_0x5497('0x43')]){_0x5b8f79[_0x5497('0x44')]=[{'all':!![]}];}return db[_0x5497('0x2e')][_0x5497('0x45')](_0x5b8f79);})[_0x5497('0x25')](function(_0x2021ae){_0x594866[_0x5497('0x46')]=_0x2021ae;return _0x594866;})['then'](respondWithFilteredResult(_0xf4c117,_0x5b8f79))[_0x5497('0x47')](handleError(_0xf4c117,null));};exports['show']=function(_0x40822a,_0x9fc24){var _0x26ef01={'raw':!![],'where':{'id':_0x40822a[_0x5497('0x48')]['id']}},_0x3602ec={};_0x3602ec['model']=_[_0x5497('0x49')](db[_0x5497('0x2e')]['rawAttributes']);_0x3602ec[_0x5497('0x33')]=_['keys'](_0x40822a[_0x5497('0x33')]);_0x3602ec['filters']=_[_0x5497('0x35')](_0x3602ec[_0x5497('0x36')],_0x3602ec[_0x5497('0x33')]);_0x26ef01[_0x5497('0x38')]=_[_0x5497('0x35')](_0x3602ec['model'],qs['fields'](_0x40822a['query']['fields']));_0x26ef01[_0x5497('0x38')]=_0x26ef01[_0x5497('0x38')][_0x5497('0x39')]?_0x26ef01[_0x5497('0x38')]:_0x3602ec[_0x5497('0x36')];if(_0x40822a[_0x5497('0x33')][_0x5497('0x43')]){_0x26ef01[_0x5497('0x44')]=[{'all':!![]}];}_0x26ef01=_[_0x5497('0x41')]({},_0x26ef01,_0x40822a['options']);return db[_0x5497('0x2e')][_0x5497('0x4a')](_0x26ef01)[_0x5497('0x25')](handleEntityNotFound(_0x9fc24,null))['then'](respondWithResult(_0x9fc24,null))[_0x5497('0x47')](handleError(_0x9fc24,null));};exports['create']=function(_0x12ffbc,_0x31f1ba){return db[_0x5497('0x2e')]['create'](_0x12ffbc[_0x5497('0x4b')],{})[_0x5497('0x25')](function(_0x515c3e){var _0x3abc92=_0x12ffbc['user'][_0x5497('0x27')]({'plain':!![]});if(!_0x3abc92)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3abc92[_0x5497('0x4c')]===_0x5497('0x4d')){var _0x26fd9f=_0x515c3e[_0x5497('0x27')]({'plain':!![]});var _0x25e80c=_0x5497('0x4e');return db[_0x5497('0x4f')][_0x5497('0x4a')]({'where':{'name':_0x25e80c,'userProfileId':_0x3abc92['userProfileId']},'raw':!![]})[_0x5497('0x25')](function(_0x5b2c22){if(_0x5b2c22&&_0x5b2c22['autoAssociation']===0x0){return db[_0x5497('0x29')][_0x5497('0x50')]({'name':_0x26fd9f['name'],'resourceId':_0x26fd9f['id'],'type':_0x5497('0x28'),'sectionId':_0x5b2c22['id']},{})[_0x5497('0x25')](function(){return _0x515c3e;});}else{return _0x515c3e;}})[_0x5497('0x47')](function(_0x3094c7){logger['error'](_0x5497('0x51'),_0x3094c7);throw _0x3094c7;});}return _0x515c3e;})['then'](respondWithResult(_0x31f1ba,0xc9))['catch'](handleError(_0x31f1ba,null));};exports[_0x5497('0x24')]=function(_0x33dd07,_0x2f7ec8){if(_0x33dd07['body']['id']){delete _0x33dd07['body']['id'];}return db[_0x5497('0x2e')]['find']({'where':{'id':_0x33dd07[_0x5497('0x48')]['id']}})['then'](handleEntityNotFound(_0x2f7ec8,null))[_0x5497('0x25')](saveUpdates(_0x33dd07['body'],null))[_0x5497('0x25')](respondWithResult(_0x2f7ec8,null))[_0x5497('0x47')](handleError(_0x2f7ec8,null));};exports['destroy']=function(_0x418f17,_0x5dccfb){return db['AnalyticDefaultReport'][_0x5497('0x4a')]({'where':{'id':_0x418f17[_0x5497('0x48')]['id']}})['then'](handleEntityNotFound(_0x5dccfb,null))[_0x5497('0x25')](removeEntity(_0x5dccfb,null))[_0x5497('0x47')](handleError(_0x5dccfb,null));};exports[_0x5497('0x52')]=function(_0x28b2a3,_0x3fca40){var _0x25c75e=0xa;var _0x590be7=[_0x5497('0x53'),'left_join','right_join','cross_join'];var _0x1f3965={'SUM':_0x5497('0x54'),'COUNT':_0x5497('0x55'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x5497('0x56'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x5497('0x57'),'GROUP_CONCAT ASC':_0x5497('0x58'),'GROUP_CONCAT DESC':_0x5497('0x59')};var _0x25f349={'SEC_TO_TIME':_0x5497('0x5a'),'DATE':_0x5497('0x5b'),'HOUR':'HOUR(%s)','ROUND':_0x5497('0x5c'),'UNIX_TIMESTAMP':_0x5497('0x5d')};var _0x425995=function(_0xc783ce){return!_['includes']([_0x5497('0x5e'),_0x5497('0x5f'),_0x5497('0x60'),_0x5497('0x61')],_0xc783ce);};var _0x5823f6=function(_0x31271c){if(!_0x31271c||!_0x31271c[_0x5497('0x62')][_0x5497('0x39')]){return'';}for(var _0x542bcf='(',_0x1ab48f=0x0;_0x1ab48f<_0x31271c['rules']['length'];_0x1ab48f+=0x1){_0x1ab48f>0x0&&(_0x542bcf+='\x20'+_0x31271c['operator']+'\x20');_0x542bcf+=_0x31271c[_0x5497('0x62')][_0x1ab48f][_0x5497('0x63')]?_0x5823f6(_0x31271c[_0x5497('0x62')][_0x1ab48f]['group']):_0x31271c[_0x5497('0x62')][_0x1ab48f][_0x5497('0x64')]+'\x20'+_0x31271c[_0x5497('0x62')][_0x1ab48f][_0x5497('0x65')]+(_0x425995(_0x31271c['rules'][_0x1ab48f][_0x5497('0x65')])?'\x20'+_0x31271c[_0x5497('0x62')][_0x1ab48f][_0x5497('0x66')]:'');}return _0x542bcf+')';};var _0x49617c={'where':{'id':_0x28b2a3[_0x5497('0x48')]['id']}},_0x164de1,_0x465bed,_0xb3eec2,_0x4368e3,_0x1467c4;_0x49617c=_[_0x5497('0x41')]({},_0x49617c,_0x28b2a3['options']);return db[_0x5497('0x2e')][_0x5497('0x4a')](_0x49617c)[_0x5497('0x25')](function(_0x20efea){if(_0x20efea){_0x164de1=_0x20efea;return _0x20efea['getFields']();}return null;})['then'](function(_0x4a7360){if(_0x4a7360){if(!_0x4a7360[_0x5497('0x39')]){throw new db[(_0x5497('0x67'))][(_0x5497('0x68'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x465bed=_0x4a7360;return db[_0x5497('0x69')][_0x5497('0x45')]({'raw':!![]});}return null;})[_0x5497('0x25')](function(_0x464df3){if(_0x464df3){_0xb3eec2=_[_0x5497('0x6a')](_0x464df3,'id');var _0x4338d4;var _0x3f38bf=squel[_0x5497('0x6b')]();_0x3f38bf[_0x5497('0x6c')](_0x164de1[_0x5497('0x6d')]);for(var _0x1fc6ad=0x0;_0x1fc6ad<_0x465bed['length'];_0x1fc6ad+=0x1){_0x4338d4=_0x465bed[_0x1fc6ad][_0x5497('0x6e')]?_0xb3eec2[_0x465bed[_0x1fc6ad][_0x5497('0x6e')]][_0x5497('0x6f')]:_0x465bed[_0x1fc6ad]['field'];_0x4338d4=_0x465bed[_0x1fc6ad][_0x5497('0x70')]?_['replace'](_0x1f3965[_0x465bed[_0x1fc6ad][_0x5497('0x70')]],'%s',_0x4338d4):_0x4338d4;_0x4338d4=_0x465bed[_0x1fc6ad][_0x5497('0x71')]?_['replace'](_0x25f349[_0x465bed[_0x1fc6ad][_0x5497('0x71')]],'%s',_0x4338d4):_0x4338d4;if(_0x465bed[_0x1fc6ad][_0x5497('0x72')]){_0x3f38bf[_0x5497('0x63')](_0x4338d4);}_0x465bed[_0x1fc6ad][_0x5497('0x73')]&&_0x3f38bf['order'](_0x4338d4,_0x465bed[_0x1fc6ad][_0x5497('0x73')]===_0x5497('0x74')?![]:!![]);_0x3f38bf[_0x5497('0x64')](_0x4338d4,_0x465bed[_0x1fc6ad]['alias']||_0x4338d4);}if(_0x164de1[_0x5497('0x75')]){_0x164de1[_0x5497('0x75')]=JSON['parse'](_0x164de1[_0x5497('0x75')]);for(var _0xebe694=0x0;_0xebe694<_0x164de1[_0x5497('0x75')]['length'];_0xebe694+=0x1){if(_0x164de1['joins'][_0xebe694][_0x5497('0x30')]&&_[_0x5497('0x76')](_0x590be7,_0x164de1[_0x5497('0x75')][_0xebe694][_0x5497('0x30')])&&_0x164de1[_0x5497('0x75')][_0xebe694][_0x5497('0x77')]&&_0x164de1[_0x5497('0x75')][_0xebe694]['foreignTable']&&_0x164de1['joins'][_0xebe694][_0x5497('0x78')]){_0x3f38bf[_0x164de1[_0x5497('0x75')][_0xebe694]['type']](_0x164de1[_0x5497('0x75')][_0xebe694][_0x5497('0x79')],null,util[_0x5497('0x71')]('%s.%s\x20=\x20%s.%s',_0x164de1[_0x5497('0x6d')],_0x164de1[_0x5497('0x75')][_0xebe694]['parentKey'],_0x164de1[_0x5497('0x75')][_0xebe694][_0x5497('0x79')],_0x164de1[_0x5497('0x75')][_0xebe694][_0x5497('0x78')]));}}}if(_0x164de1[_0x5497('0x7a')]){_0x164de1['conditions']=JSON[_0x5497('0x7b')](_0x164de1[_0x5497('0x7a')]);_0x3f38bf[_0x5497('0x3d')](_0x5823f6(_0x164de1[_0x5497('0x7a')][_0x5497('0x63')]));}_0x1467c4=_0x3f38bf['clone']();_0x3f38bf[_0x5497('0x20')](_0x25c75e);_0x3f38bf[_0x5497('0x1d')](0x0);logger[_0x5497('0x7c')](_0x5497('0x7d'),_0x3f38bf['toString']());return dbH[_0x5497('0x7e')][_0x5497('0x33')](_0x3f38bf['toString'](),{'type':dbH[_0x5497('0x7e')][_0x5497('0x7f')][_0x5497('0x80')]});}})[_0x5497('0x25')](respondWithResult(_0x3fca40,null))['catch'](handleError(_0x3fca40,null));};function runReport(_0x547de7,_0x4ff64f,_0x5343d5){var _0x594761=_0x4ff64f[_0x5497('0x2c')];var _0x2375cc=0xa;var _0x15d0da=[_0x5497('0x53'),_0x5497('0x81'),'right_join','cross_join'];var _0x392987={'SUM':_0x5497('0x54'),'COUNT':_0x5497('0x55'),'COUNT DISTINCT':_0x5497('0x82'),'MAX':_0x5497('0x56'),'MIN':_0x5497('0x83'),'AVG':_0x5497('0x84'),'GROUP_CONCAT':_0x5497('0x57'),'GROUP_CONCAT ASC':_0x5497('0x58'),'GROUP_CONCAT DESC':_0x5497('0x59')};var _0x4c41c4={'SEC_TO_TIME':_0x5497('0x5a'),'DATE':_0x5497('0x5b'),'HOUR':_0x5497('0x85'),'ROUND':_0x5497('0x5c'),'UNIX_TIMESTAMP':_0x5497('0x5d')};var _0x22b019=function(_0x4aa4ba){return!_[_0x5497('0x76')](['IS\x20NULL',_0x5497('0x5f'),_0x5497('0x60'),_0x5497('0x61')],_0x4aa4ba);};var _0x5b0f9d=function(_0x59960b){if(!_0x59960b||!_0x59960b[_0x5497('0x62')][_0x5497('0x39')]){return'';}for(var _0x953b31='(',_0xeb52c9=0x0;_0xeb52c9<_0x59960b[_0x5497('0x62')][_0x5497('0x39')];_0xeb52c9+=0x1){_0xeb52c9>0x0&&(_0x953b31+='\x20'+_0x59960b[_0x5497('0x86')]+'\x20');_0x953b31+=_0x59960b[_0x5497('0x62')][_0xeb52c9]['group']?_0x5b0f9d(_0x59960b['rules'][_0xeb52c9]['group']):_0x59960b[_0x5497('0x62')][_0xeb52c9][_0x5497('0x64')]+'\x20'+_0x59960b[_0x5497('0x62')][_0xeb52c9][_0x5497('0x65')]+(_0x22b019(_0x59960b['rules'][_0xeb52c9]['condition'])?'\x20'+_0x59960b[_0x5497('0x62')][_0xeb52c9][_0x5497('0x66')]:'');}return _0x953b31+')';};var _0x5dd9bc={'where':{'id':_0x547de7['id']}},_0x83b240,_0x2fc11a,_0x3ce2ee,_0x36c09f,_0x51e9fb;_0x5dd9bc=_['merge']({},_0x5dd9bc,_0x5343d5);return db['AnalyticDefaultReport']['find'](_0x5dd9bc)['then'](function(_0x497295){if(_0x497295){_0x83b240=_0x497295;return _0x497295['getFields']();}return null;})[_0x5497('0x25')](function(_0x5aa5e1){if(_0x5aa5e1){if(!_0x5aa5e1[_0x5497('0x39')]){throw new db[(_0x5497('0x67'))][(_0x5497('0x68'))](_0x5497('0x87'),0x193);}_0x2fc11a=_0x5aa5e1;return db[_0x5497('0x69')][_0x5497('0x45')]({'raw':!![]});}return null;})['then'](function(_0x77d52c){if(_0x77d52c){_0x3ce2ee=_['keyBy'](_0x77d52c,'id');var _0x15a67d;var _0x2721b2=squel[_0x5497('0x6b')]();_0x2721b2[_0x5497('0x6c')](_0x83b240[_0x5497('0x6d')]);for(var _0x38fa59=0x0;_0x38fa59<_0x2fc11a[_0x5497('0x39')];_0x38fa59+=0x1){_0x15a67d=_0x2fc11a[_0x38fa59][_0x5497('0x6e')]?_0x3ce2ee[_0x2fc11a[_0x38fa59][_0x5497('0x6e')]][_0x5497('0x6f')]:_0x2fc11a[_0x38fa59]['field'];_0x15a67d=_0x2fc11a[_0x38fa59][_0x5497('0x70')]?_['replace'](_0x392987[_0x2fc11a[_0x38fa59][_0x5497('0x70')]],'%s',_0x15a67d):_0x15a67d;_0x15a67d=_0x2fc11a[_0x38fa59][_0x5497('0x71')]?_['replace'](_0x4c41c4[_0x2fc11a[_0x38fa59][_0x5497('0x71')]],'%s',_0x15a67d):_0x15a67d;if(_0x2fc11a[_0x38fa59][_0x5497('0x72')]){_0x2721b2[_0x5497('0x63')](_0x15a67d);}_0x2fc11a[_0x38fa59][_0x5497('0x73')]&&_0x2721b2[_0x5497('0x3b')](_0x15a67d,_0x2fc11a[_0x38fa59][_0x5497('0x73')]===_0x5497('0x74')?![]:!![]);_0x2721b2[_0x5497('0x64')](_0x15a67d,_0x2fc11a[_0x38fa59][_0x5497('0x88')]||_0x15a67d);}if(_0x83b240[_0x5497('0x75')]){_0x83b240[_0x5497('0x75')]=JSON[_0x5497('0x7b')](_0x83b240[_0x5497('0x75')]);for(var _0x22426e=0x0;_0x22426e<_0x83b240['joins'][_0x5497('0x39')];_0x22426e+=0x1){if(_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x30')]&&_[_0x5497('0x76')](_0x15d0da,_0x83b240[_0x5497('0x75')][_0x22426e]['type'])&&_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x77')]&&_0x83b240['joins'][_0x22426e]['foreignTable']&&_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x78')]){_0x2721b2[_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x30')]](_0x83b240[_0x5497('0x75')][_0x22426e]['foreignTable'],null,util['format'](_0x5497('0x89'),_0x83b240['table'],_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x77')],_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x79')],_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x78')]));}}}if(_0x83b240['conditions']){_0x83b240['conditions']=JSON[_0x5497('0x7b')](_0x83b240[_0x5497('0x7a')]);_0x2721b2[_0x5497('0x3d')](_0x5b0f9d(_0x83b240['conditions'][_0x5497('0x63')]));}_0x51e9fb=_0x2721b2['clone']();_0x2721b2[_0x5497('0x20')](_0x2375cc);_0x2721b2['offset'](0x0);return;}})['then'](function(){if(_0x4ff64f[_0x5497('0x8a')]===_0x5497('0x8b')){return null;}var _0x4ce768=_[_0x5497('0x41')](_0x4ff64f,{'name':_0x4ff64f[_0x5497('0x8c')]||_0x4ff64f[_0x5497('0x2c')]||_0x83b240[_0x5497('0x2c')],'basename':_0x594761,'savename':util['format'](_0x5497('0x8d'),_0x4ff64f[_0x5497('0x2c')]||_0x83b240[_0x5497('0x2c')],require(_0x5497('0x8e'))[_0x5497('0x8f')](0x4),_0x4ff64f['output']||_0x5497('0x90')),'reportId':_0x83b240['id'],'reportType':'default'});return db[_0x5497('0x91')][_0x5497('0x50')](_0x4ce768,{'raw':!![]});})[_0x5497('0x25')](function(_0x314db4){if(_0x83b240[_0x5497('0x6d')]===_0x5497('0x92')){_0x51e9fb[_0x5497('0x3d')](_0x83b240[_0x5497('0x6d')]+_0x5497('0x93'),_0x4ff64f[_0x5497('0x94')],_0x4ff64f[_0x5497('0x95')]);}else{_0x51e9fb['where'](_0x83b240[_0x5497('0x6d')]+_0x5497('0x96'),_0x4ff64f[_0x5497('0x94')],_0x4ff64f[_0x5497('0x95')]);}if(_0x314db4){logger[_0x5497('0x97')](_0x5497('0x98'),_0x51e9fb[_0x5497('0x99')]());require(_0x5497('0x9a'))[_0x5497('0x9b')](path[_0x5497('0x53')](__dirname,_0x5497('0x9c'),_0x314db4['output']),[_0x314db4['id'],_0x51e9fb[_0x5497('0x99')](),path[_0x5497('0x53')](__dirname,_0x5497('0x9d'),_0x314db4[_0x5497('0x9e')]),_0x594761]);return _0x314db4;}else{var _0x46be08=squel[_0x5497('0x6b')]();_0x46be08[_0x5497('0x6c')]('('+_0x51e9fb[_0x5497('0x99')]()+')',_0x5497('0x9f'));_0x46be08[_0x5497('0x64')](_0x5497('0xa0'),_0x5497('0x1f'));_0x51e9fb[_0x5497('0x20')](_0x4ff64f[_0x5497('0x20')]||_0x2375cc);_0x51e9fb['offset'](_0x4ff64f['offset']||0x0);return dbH[_0x5497('0x7e')][_0x5497('0x33')](_0x46be08[_0x5497('0x99')](),{'type':dbH['sequelize'][_0x5497('0x7f')][_0x5497('0x80')]})[_0x5497('0x25')](function(_0x2bd48c){if(!_0x2bd48c[_0x5497('0x39')]){_0x36c09f=0x0;}else{_0x36c09f=_0x2bd48c[0x0][_0x5497('0x1f')]||0x0;}return dbH[_0x5497('0x7e')][_0x5497('0x33')](_0x51e9fb['toString'](),{'type':dbH['sequelize']['QueryTypes'][_0x5497('0x80')]});})[_0x5497('0x25')](function(_0x4dab6a){return{'rows':_0x4dab6a||[],'count':_0x36c09f};});}});}exports[_0x5497('0xa1')]=function(_0x27f42b,_0x1bef85){return runReport(_0x27f42b['params'],_0x27f42b[_0x5497('0x33')],_0x27f42b['options'])[_0x5497('0x25')](respondWithResult(_0x1bef85,null))[_0x5497('0x47')](handleError(_0x1bef85,null));};exports[_0x5497('0xa2')]=runReport;exports['query']=function(_0x1c3dad,_0xfba062){var _0x494cc3=0xa;var _0x401f04=[_0x5497('0x53'),_0x5497('0x81'),'right_join',_0x5497('0xa3')];var _0x1a5c32={'SUM':_0x5497('0x54'),'COUNT':_0x5497('0x55'),'COUNT DISTINCT':_0x5497('0x82'),'MAX':_0x5497('0x56'),'MIN':_0x5497('0x83'),'AVG':_0x5497('0x84'),'GROUP_CONCAT':_0x5497('0x57'),'GROUP_CONCAT ASC':_0x5497('0x58'),'GROUP_CONCAT DESC':_0x5497('0x59')};var _0x1dfb76={'SEC_TO_TIME':_0x5497('0x5a'),'DATE':_0x5497('0x5b'),'HOUR':_0x5497('0x85'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x5497('0x5d')};var _0x5c2517=function(_0x367929){return!_[_0x5497('0x76')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x5497('0x60'),_0x5497('0x61')],_0x367929);};var _0x2fd2e3=function(_0x2fe770){if(!_0x2fe770||!_0x2fe770['rules'][_0x5497('0x39')]){return'';}for(var _0x1299cd='(',_0x4c2b14=0x0;_0x4c2b14<_0x2fe770['rules'][_0x5497('0x39')];_0x4c2b14+=0x1){_0x4c2b14>0x0&&(_0x1299cd+='\x20'+_0x2fe770[_0x5497('0x86')]+'\x20');_0x1299cd+=_0x2fe770[_0x5497('0x62')][_0x4c2b14][_0x5497('0x63')]?_0x2fd2e3(_0x2fe770[_0x5497('0x62')][_0x4c2b14]['group']):_0x2fe770['rules'][_0x4c2b14][_0x5497('0x64')]+'\x20'+_0x2fe770[_0x5497('0x62')][_0x4c2b14]['condition']+(_0x5c2517(_0x2fe770[_0x5497('0x62')][_0x4c2b14][_0x5497('0x65')])?'\x20'+_0x2fe770[_0x5497('0x62')][_0x4c2b14][_0x5497('0x66')]:'');}return _0x1299cd+')';};var _0x358ec5={'where':{'id':_0x1c3dad['params']['id']}},_0x5cddbc,_0x188d21,_0xf92129,_0x2d5cc1,_0x4f9228;_0x358ec5=_[_0x5497('0x41')]({},_0x358ec5,_0x1c3dad[_0x5497('0x42')]);return db[_0x5497('0x2e')]['find'](_0x358ec5)[_0x5497('0x25')](function(_0x30a248){if(_0x30a248){_0x5cddbc=_0x30a248;return _0x30a248[_0x5497('0xa4')]();}return null;})['then'](function(_0x1d4c76){if(_0x1d4c76){if(!_0x1d4c76[_0x5497('0x39')]){throw new db['Sequelize']['ValidationErrorItem'](_0x5497('0x87'),0x193);}_0x188d21=_0x1d4c76;return db[_0x5497('0x69')]['findAll']({'raw':!![]});}return null;})[_0x5497('0x25')](function(_0x5001d5){if(_0x5001d5){_0xf92129=_[_0x5497('0x6a')](_0x5001d5,'id');var _0x2c58e6;var _0x300f3e=squel[_0x5497('0x6b')]();_0x300f3e[_0x5497('0x6c')](_0x5cddbc[_0x5497('0x6d')]);for(var _0x23732d=0x0;_0x23732d<_0x188d21['length'];_0x23732d+=0x1){_0x2c58e6=_0x188d21[_0x23732d]['MetricId']?_0xf92129[_0x188d21[_0x23732d][_0x5497('0x6e')]][_0x5497('0x6f')]:_0x188d21[_0x23732d]['field'];_0x2c58e6=_0x188d21[_0x23732d]['function']?_[_0x5497('0xa5')](_0x1a5c32[_0x188d21[_0x23732d][_0x5497('0x70')]],'%s',_0x2c58e6):_0x2c58e6;_0x2c58e6=_0x188d21[_0x23732d][_0x5497('0x71')]?_[_0x5497('0xa5')](_0x1dfb76[_0x188d21[_0x23732d][_0x5497('0x71')]],'%s',_0x2c58e6):_0x2c58e6;if(_0x188d21[_0x23732d][_0x5497('0x72')]){_0x300f3e['group'](_0x2c58e6);}_0x188d21[_0x23732d][_0x5497('0x73')]&&_0x300f3e[_0x5497('0x3b')](_0x2c58e6,_0x188d21[_0x23732d][_0x5497('0x73')]===_0x5497('0x74')?![]:!![]);_0x300f3e[_0x5497('0x64')](_0x2c58e6,_0x188d21[_0x23732d][_0x5497('0x88')]||_0x2c58e6);}if(_0x5cddbc['joins']){_0x5cddbc[_0x5497('0x75')]=JSON['parse'](_0x5cddbc[_0x5497('0x75')]);for(var _0x261804=0x0;_0x261804<_0x5cddbc[_0x5497('0x75')]['length'];_0x261804+=0x1){if(_0x5cddbc[_0x5497('0x75')][_0x261804]['type']&&_['includes'](_0x401f04,_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x30')])&&_0x5cddbc['joins'][_0x261804][_0x5497('0x77')]&&_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x79')]&&_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x78')]){_0x300f3e[_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x30')]](_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x79')],null,util['format'](_0x5497('0x89'),_0x5cddbc[_0x5497('0x6d')],_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x77')],_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x79')],_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x78')]));}}}if(_0x5cddbc[_0x5497('0x7a')]){_0x5cddbc[_0x5497('0x7a')]=JSON[_0x5497('0x7b')](_0x5cddbc[_0x5497('0x7a')]);_0x300f3e[_0x5497('0x3d')](_0x2fd2e3(_0x5cddbc[_0x5497('0x7a')][_0x5497('0x63')]));}_0x4f9228=_0x300f3e[_0x5497('0xa6')]();_0x300f3e[_0x5497('0x20')](_0x494cc3);_0x300f3e[_0x5497('0x1d')](0x0);logger[_0x5497('0x7c')]('Limited\x20Query:',_0x300f3e[_0x5497('0x99')]());return dbH[_0x5497('0x7e')]['query'](_0x300f3e['toString'](),{'type':dbH[_0x5497('0x7e')]['QueryTypes'][_0x5497('0x80')]});}})[_0x5497('0x25')](function(){return{'sql':_0x4f9228[_0x5497('0x99')]()};})[_0x5497('0x25')](respondWithResult(_0xfba062,null))[_0x5497('0x47')](handleError(_0xfba062,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index 6832c46..268d4d2 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 _0xdb5a=['path','rimraf','./analyticDefaultReport.attributes','exports','define','util','api','bluebird','request-promise'];(function(_0x3f00ee,_0x1d1673){var _0x18a07e=function(_0x4dad57){while(--_0x4dad57){_0x3f00ee['push'](_0x3f00ee['shift']());}};_0x18a07e(++_0x1d1673);}(_0xdb5a,0x1d0));var _0xadb5=function(_0x1ca804,_0x2a0925){_0x1ca804=_0x1ca804-0x0;var _0x2fc5bf=_0xdb5a[_0x1ca804];return _0x2fc5bf;};'use strict';var _=require('lodash');var util=require(_0xadb5('0x0'));var logger=require('../../config/logger')(_0xadb5('0x1'));var moment=require('moment');var BPromise=require(_0xadb5('0x2'));var rp=require(_0xadb5('0x3'));var fs=require('fs');var path=require(_0xadb5('0x4'));var rimraf=require(_0xadb5('0x5'));var config=require('../../config/environment');var attributes=require(_0xadb5('0x6'));module[_0xadb5('0x7')]=function(_0x3f0728,_0x594c43){return _0x3f0728[_0xadb5('0x8')]('AnalyticDefaultReport',attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc8a1=['request-promise','path','../../config/environment','./analyticDefaultReport.attributes','exports','lodash','../../config/logger','api','moment'];(function(_0x4dab14,_0x164ea0){var _0xf41aa=function(_0x305d50){while(--_0x305d50){_0x4dab14['push'](_0x4dab14['shift']());}};_0xf41aa(++_0x164ea0);}(_0xc8a1,0x8c));var _0x1c8a=function(_0x32ec2e,_0x3d423f){_0x32ec2e=_0x32ec2e-0x0;var _0x28e955=_0xc8a1[_0x32ec2e];return _0x28e955;};'use strict';var _=require(_0x1c8a('0x0'));var util=require('util');var logger=require(_0x1c8a('0x1'))(_0x1c8a('0x2'));var moment=require(_0x1c8a('0x3'));var BPromise=require('bluebird');var rp=require(_0x1c8a('0x4'));var fs=require('fs');var path=require(_0x1c8a('0x5'));var rimraf=require('rimraf');var config=require(_0x1c8a('0x6'));var attributes=require(_0x1c8a('0x7'));module[_0x1c8a('0x8')]=function(_0x405b73,_0x161ed4){return _0x405b73['define']('AnalyticDefaultReport',attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js index 14c2aae..95e4179 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 _0x92a0=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0x5506cd,_0x1f1fc1){var _0x3be516=function(_0x492c42){while(--_0x492c42){_0x5506cd['push'](_0x5506cd['shift']());}};_0x3be516(++_0x1f1fc1);}(_0x92a0,0x1c6));var _0x092a=function(_0xa0be1c,_0x152d5d){_0xa0be1c=_0xa0be1c-0x0;var _0x546eec=_0x92a0[_0xa0be1c];return _0x546eec;};'use strict';var _=require(_0x092a('0x0'));var util=require(_0x092a('0x1'));var moment=require(_0x092a('0x2'));var BPromise=require('bluebird');var rs=require(_0x092a('0x3'));var fs=require('fs');var Redis=require(_0x092a('0x4'));var db=require(_0x092a('0x5'))['db'];var utils=require(_0x092a('0x6'));var logger=require('../../config/logger')(_0x092a('0x7'));var config=require(_0x092a('0x8'));var jayson=require(_0x092a('0x9'));var client=jayson[_0x092a('0xa')][_0x092a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x272931,_0x57dbef,_0x330d04){return new BPromise(function(_0x50a109,_0x4f149f){return client[_0x092a('0xc')](_0x272931,_0x330d04)['then'](function(_0x5607d6){logger['info'](_0x092a('0xd'),_0x57dbef,_0x092a('0xe'));logger[_0x092a('0xf')](_0x092a('0x10'),_0x57dbef,_0x092a('0xe'),JSON[_0x092a('0x11')](_0x5607d6));if(_0x5607d6[_0x092a('0x12')]){if(_0x5607d6[_0x092a('0x12')][_0x092a('0x13')]===0x1f4){logger[_0x092a('0x12')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x57dbef,_0x5607d6[_0x092a('0x12')][_0x092a('0x14')]);return _0x4f149f(_0x5607d6['error'][_0x092a('0x14')]);}logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x57dbef,_0x5607d6[_0x092a('0x12')][_0x092a('0x14')]);return _0x50a109(_0x5607d6[_0x092a('0x12')][_0x092a('0x14')]);}else{logger[_0x092a('0x15')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x57dbef,'request\x20sent');_0x50a109(_0x5607d6[_0x092a('0x16')][_0x092a('0x14')]);}})['catch'](function(_0xd921f9){logger[_0x092a('0x12')](_0x092a('0xd'),_0x57dbef,_0xd921f9);_0x4f149f(_0xd921f9);});});} \ No newline at end of file +var _0xbd53=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','http','request','then','info','request\x20sent','debug','stringify','error','code','AnalyticDefaultReport,\x20%s,\x20%s','message','catch'];(function(_0x122cc1,_0x5c956e){var _0x1e33af=function(_0x949b75){while(--_0x949b75){_0x122cc1['push'](_0x122cc1['shift']());}};_0x1e33af(++_0x5c956e);}(_0xbd53,0x93));var _0x3bd5=function(_0x19c6d7,_0x243cf6){_0x19c6d7=_0x19c6d7-0x0;var _0x5d3fac=_0xbd53[_0x19c6d7];return _0x5d3fac;};'use strict';var _=require(_0x3bd5('0x0'));var util=require(_0x3bd5('0x1'));var moment=require(_0x3bd5('0x2'));var BPromise=require(_0x3bd5('0x3'));var rs=require(_0x3bd5('0x4'));var fs=require('fs');var Redis=require(_0x3bd5('0x5'));var db=require(_0x3bd5('0x6'))['db'];var utils=require(_0x3bd5('0x7'));var logger=require('../../config/logger')(_0x3bd5('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x3bd5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xc11c08,_0x282cb7,_0x1d4cf5){return new BPromise(function(_0x45ce90,_0x59c4e7){return client[_0x3bd5('0xa')](_0xc11c08,_0x1d4cf5)[_0x3bd5('0xb')](function(_0x2ebe4a){logger[_0x3bd5('0xc')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x282cb7,_0x3bd5('0xd'));logger[_0x3bd5('0xe')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x282cb7,_0x3bd5('0xd'),JSON[_0x3bd5('0xf')](_0x2ebe4a));if(_0x2ebe4a[_0x3bd5('0x10')]){if(_0x2ebe4a[_0x3bd5('0x10')][_0x3bd5('0x11')]===0x1f4){logger[_0x3bd5('0x10')](_0x3bd5('0x12'),_0x282cb7,_0x2ebe4a[_0x3bd5('0x10')][_0x3bd5('0x13')]);return _0x59c4e7(_0x2ebe4a['error'][_0x3bd5('0x13')]);}logger[_0x3bd5('0x10')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x282cb7,_0x2ebe4a[_0x3bd5('0x10')][_0x3bd5('0x13')]);return _0x45ce90(_0x2ebe4a['error']['message']);}else{logger['info'](_0x3bd5('0x12'),_0x282cb7,'request\x20sent');_0x45ce90(_0x2ebe4a['result'][_0x3bd5('0x13')]);}})[_0x3bd5('0x14')](function(_0x25f18f){logger[_0x3bd5('0x10')](_0x3bd5('0x12'),_0x282cb7,_0x25f18f);_0x59c4e7(_0x25f18f);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index 71756d5..92ec258 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 _0x19f4=['../../components/auth/service','./analyticDefaultReport.controller','isAuthenticated','get','/:id','show','/:id/preview','/:id/run','run','/:id/query','query','post','create','put','update','destroy','multer','util','path','connect-timeout','Router'];(function(_0x18032f,_0x4f4e45){var _0xb0b2b8=function(_0x563262){while(--_0x563262){_0x18032f['push'](_0x18032f['shift']());}};_0xb0b2b8(++_0x4f4e45);}(_0x19f4,0x10c));var _0x419f=function(_0x2d3154,_0xf911c9){_0x2d3154=_0x2d3154-0x0;var _0x30196e=_0x19f4[_0x2d3154];return _0x30196e;};'use strict';var multer=require(_0x419f('0x0'));var util=require(_0x419f('0x1'));var path=require(_0x419f('0x2'));var timeout=require(_0x419f('0x3'));var express=require('express');var router=express[_0x419f('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x419f('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x419f('0x6'));router['get']('/',auth[_0x419f('0x7')](),controller['index']);router[_0x419f('0x8')](_0x419f('0x9'),auth[_0x419f('0x7')](),controller[_0x419f('0xa')]);router['get'](_0x419f('0xb'),auth['isAuthenticated'](),controller['preview']);router[_0x419f('0x8')](_0x419f('0xc'),auth[_0x419f('0x7')](),controller[_0x419f('0xd')]);router[_0x419f('0x8')](_0x419f('0xe'),auth['isAuthenticated'](),controller[_0x419f('0xf')]);router[_0x419f('0x10')]('/',auth[_0x419f('0x7')](),controller[_0x419f('0x11')]);router[_0x419f('0x12')](_0x419f('0x9'),auth[_0x419f('0x7')](),controller[_0x419f('0x13')]);router['delete'](_0x419f('0x9'),auth[_0x419f('0x7')](),controller[_0x419f('0x14')]);module['exports']=router; \ No newline at end of file +var _0x33a7=['/:id/run','run','/:id/query','post','create','put','update','destroy','exports','multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','isAuthenticated','index','/:id','show','get','/:id/preview'];(function(_0x41be9f,_0x123958){var _0x459a7b=function(_0x49170f){while(--_0x49170f){_0x41be9f['push'](_0x41be9f['shift']());}};_0x459a7b(++_0x123958);}(_0x33a7,0x77));var _0x733a=function(_0x1df473,_0x1a6931){_0x1df473=_0x1df473-0x0;var _0x1bdd49=_0x33a7[_0x1df473];return _0x1bdd49;};'use strict';var multer=require(_0x733a('0x0'));var util=require(_0x733a('0x1'));var path=require('path');var timeout=require(_0x733a('0x2'));var express=require(_0x733a('0x3'));var router=express[_0x733a('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x733a('0x5'));var config=require(_0x733a('0x6'));var controller=require('./analyticDefaultReport.controller');router['get']('/',auth[_0x733a('0x7')](),controller[_0x733a('0x8')]);router['get'](_0x733a('0x9'),auth[_0x733a('0x7')](),controller[_0x733a('0xa')]);router[_0x733a('0xb')](_0x733a('0xc'),auth[_0x733a('0x7')](),controller['preview']);router[_0x733a('0xb')](_0x733a('0xd'),auth['isAuthenticated'](),controller[_0x733a('0xe')]);router['get'](_0x733a('0xf'),auth[_0x733a('0x7')](),controller['query']);router[_0x733a('0x10')]('/',auth[_0x733a('0x7')](),controller[_0x733a('0x11')]);router[_0x733a('0x12')](_0x733a('0x9'),auth[_0x733a('0x7')](),controller[_0x733a('0x13')]);router['delete'](_0x733a('0x9'),auth[_0x733a('0x7')](),controller[_0x733a('0x14')]);module[_0x733a('0x15')]=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index eaa54cc..f7846ae 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 _0x4722=['manual','scheduled','INTEGER','UNSIGNED','sequelize','moment','exports','STRING','ENUM','csv','pdf','xlsx','Loading'];(function(_0x322e53,_0x12446f){var _0x3e19ab=function(_0x2bb848){while(--_0x2bb848){_0x322e53['push'](_0x322e53['shift']());}};_0x3e19ab(++_0x12446f);}(_0x4722,0x18a));var _0x2472=function(_0x4cdb9b,_0x9800cf){_0x4cdb9b=_0x4cdb9b-0x0;var _0x46cfa4=_0x4722[_0x4cdb9b];return _0x46cfa4;};'use strict';var Sequelize=require(_0x2472('0x0'));var moment=require(_0x2472('0x1'));module[_0x2472('0x2')]={'name':{'type':Sequelize[_0x2472('0x3')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0x2472('0x4')](_0x2472('0x5'),_0x2472('0x6'),_0x2472('0x7')),'allowNull':![],'defaultValue':_0x2472('0x5')},'savename':{'type':Sequelize[_0x2472('0x3')],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize[_0x2472('0x3')],'defaultValue':_0x2472('0x8')},'type':{'type':Sequelize[_0x2472('0x4')](_0x2472('0x9'),_0x2472('0xa')),'allowNull':![],'defaultValue':_0x2472('0x9')},'reportId':{'type':Sequelize[_0x2472('0xb')](0xb)[_0x2472('0xc')]},'reportType':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x5cdc=['sequelize','moment','STRING','ENUM','csv','xlsx','DATE','Loading','manual','INTEGER','UNSIGNED'];(function(_0x48c583,_0x30a7b8){var _0x357851=function(_0x4e573d){while(--_0x4e573d){_0x48c583['push'](_0x48c583['shift']());}};_0x357851(++_0x30a7b8);}(_0x5cdc,0x1d9));var _0xc5cd=function(_0x197065,_0x2e79d0){_0x197065=_0x197065-0x0;var _0x3d9404=_0x5cdc[_0x197065];return _0x3d9404;};'use strict';var Sequelize=require(_0xc5cd('0x0'));var moment=require(_0xc5cd('0x1'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0xc5cd('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0xc5cd('0x3')](_0xc5cd('0x4'),'pdf',_0xc5cd('0x5')),'allowNull':![],'defaultValue':_0xc5cd('0x4')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0xc5cd('0x6')]},'endDate':{'type':Sequelize[_0xc5cd('0x6')]},'status':{'type':Sequelize[_0xc5cd('0x2')],'defaultValue':_0xc5cd('0x7')},'type':{'type':Sequelize[_0xc5cd('0x3')](_0xc5cd('0x8'),'scheduled'),'allowNull':![],'defaultValue':_0xc5cd('0x8')},'reportId':{'type':Sequelize[_0xc5cd('0x9')](0xb)[_0xc5cd('0xa')]},'reportType':{'type':Sequelize[_0xc5cd('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index f33b071..8c3012d 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 _0x5d89=['path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','end','sendStatus','error','stack','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ExtractedReports','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','basename','savename','output','existsSync','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','join','format','%s.%s','eml-format','rimraf','request-promise','moment','mustache','util'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x5d89,0x1e9));var _0x95d8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5d89[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x95d8('0x0'));var rimraf=require(_0x95d8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x95d8('0x2'));var moment=require(_0x95d8('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x95d8('0x4'));var util=require(_0x95d8('0x5'));var path=require(_0x95d8('0x6'));var sox=require(_0x95d8('0x7'));var csv=require(_0x95d8('0x8'));var ejs=require(_0x95d8('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x95d8('0xa'));var squel=require(_0x95d8('0xb'));var crypto=require(_0x95d8('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x95d8('0x8'));var querystring=require(_0x95d8('0xd'));var Papa=require(_0x95d8('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x95d8('0xf'));var as=require(_0x95d8('0x10'));var hardwareService=require(_0x95d8('0x11'));var logger=require(_0x95d8('0x12'))('api');var utils=require(_0x95d8('0x13'));var config=require(_0x95d8('0x14'));var licenseUtil=require(_0x95d8('0x15'));var db=require(_0x95d8('0x16'))['db'];function respondWithStatusCode(_0x4e9972,_0x5cf2fe){_0x5cf2fe=_0x5cf2fe||0xcc;return function(_0x255382){if(_0x255382){return _0x4e9972['sendStatus'](_0x5cf2fe);}return _0x4e9972['status'](_0x5cf2fe)['end']();};}function respondWithResult(_0x23ede8,_0x4adc31){_0x4adc31=_0x4adc31||0xc8;return function(_0x2326bb){if(_0x2326bb){return _0x23ede8[_0x95d8('0x17')](_0x4adc31)[_0x95d8('0x18')](_0x2326bb);}};}function respondWithFilteredResult(_0x52a119,_0x1b3f26){return function(_0x275a83){if(_0x275a83){var _0x4850c2=typeof _0x1b3f26[_0x95d8('0x19')]===_0x95d8('0x1a')&&typeof _0x1b3f26['limit']===_0x95d8('0x1a');var _0x17f69d=_0x275a83['count'];var _0x14f9ff=_0x4850c2?0x0:_0x1b3f26[_0x95d8('0x19')];var _0x4ab61e=_0x4850c2?_0x275a83[_0x95d8('0x1b')]:_0x1b3f26[_0x95d8('0x19')]+_0x1b3f26[_0x95d8('0x1c')];var _0x286e57;if(_0x4ab61e>=_0x17f69d){_0x4ab61e=_0x17f69d;_0x286e57=0xc8;}else{_0x286e57=0xce;}_0x52a119[_0x95d8('0x17')](_0x286e57);return _0x52a119[_0x95d8('0x1d')](_0x95d8('0x1e'),_0x14f9ff+'-'+_0x4ab61e+'/'+_0x17f69d)[_0x95d8('0x18')](_0x275a83);}return null;};}function patchUpdates(_0x45a763){return function(_0x49d9da){try{jsonpatch[_0x95d8('0x1f')](_0x49d9da,_0x45a763,!![]);}catch(_0x10b11f){return BPromise[_0x95d8('0x20')](_0x10b11f);}return _0x49d9da[_0x95d8('0x21')]();};}function saveUpdates(_0x1b9735,_0x7e0444){return function(_0x502c58){if(_0x502c58){return _0x502c58[_0x95d8('0x22')](_0x1b9735)[_0x95d8('0x23')](function(_0x276e18){return _0x276e18;});}return null;};}function removeEntity(_0x3ed960,_0x6ea91b){return function(_0x900539){if(_0x900539){return _0x900539[_0x95d8('0x24')]()['then'](function(){var _0x78ad19=_0x900539[_0x95d8('0x25')]({'plain':!![]});var _0x1996ca='ExtractedReports';return db['UserProfileResource'][_0x95d8('0x24')]({'where':{'type':_0x1996ca,'resourceId':_0x78ad19['id']}})[_0x95d8('0x23')](function(){return _0x900539;});})[_0x95d8('0x23')](function(){_0x3ed960['status'](0xcc)[_0x95d8('0x26')]();});}};}function handleEntityNotFound(_0x54fa64,_0x2ba6d9){return function(_0x1a1dbc){if(!_0x1a1dbc){_0x54fa64[_0x95d8('0x27')](0x194);}return _0x1a1dbc;};}function handleError(_0x5b28da,_0x194e54){_0x194e54=_0x194e54||0x1f4;return function(_0x7cfc74){logger[_0x95d8('0x28')](_0x7cfc74[_0x95d8('0x29')]);if(_0x7cfc74[_0x95d8('0x2a')]){delete _0x7cfc74[_0x95d8('0x2a')];}_0x5b28da[_0x95d8('0x17')](_0x194e54)[_0x95d8('0x2b')](_0x7cfc74);};}exports[_0x95d8('0x2c')]=function(_0xe9b10e,_0x4c981e){var _0x20fe0b={},_0x228d65={},_0x36977e={'count':0x0,'rows':[]};var _0xfcfd00=_[_0x95d8('0x2d')](db[_0x95d8('0x2e')][_0x95d8('0x2f')],function(_0x1fe92f){return{'name':_0x1fe92f[_0x95d8('0x30')],'type':_0x1fe92f[_0x95d8('0x31')][_0x95d8('0x32')]};});_0x228d65[_0x95d8('0x33')]=_[_0x95d8('0x2d')](_0xfcfd00,'name');_0x228d65[_0x95d8('0x34')]=_[_0x95d8('0x35')](_0xe9b10e[_0x95d8('0x34')]);_0x228d65['filters']=_[_0x95d8('0x36')](_0x228d65[_0x95d8('0x33')],_0x228d65[_0x95d8('0x34')]);_0x20fe0b['attributes']=_[_0x95d8('0x36')](_0x228d65[_0x95d8('0x33')],qs[_0x95d8('0x37')](_0xe9b10e[_0x95d8('0x34')]['fields']));_0x20fe0b[_0x95d8('0x38')]=_0x20fe0b[_0x95d8('0x38')][_0x95d8('0x39')]?_0x20fe0b[_0x95d8('0x38')]:_0x228d65[_0x95d8('0x33')];if(!_0xe9b10e['query']['hasOwnProperty'](_0x95d8('0x3a'))){_0x20fe0b[_0x95d8('0x1c')]=qs[_0x95d8('0x1c')](_0xe9b10e[_0x95d8('0x34')]['limit']);_0x20fe0b[_0x95d8('0x19')]=qs[_0x95d8('0x19')](_0xe9b10e['query']['offset']);}_0x20fe0b[_0x95d8('0x3b')]=qs[_0x95d8('0x3c')](_0xe9b10e[_0x95d8('0x34')][_0x95d8('0x3c')]);_0x20fe0b[_0x95d8('0x3d')]=qs[_0x95d8('0x3e')](_['pick'](_0xe9b10e[_0x95d8('0x34')],_0x228d65['filters']),_0xfcfd00);if(_0xe9b10e[_0x95d8('0x34')][_0x95d8('0x3f')]){_0x20fe0b[_0x95d8('0x3d')]=_[_0x95d8('0x40')](_0x20fe0b[_0x95d8('0x3d')],{'$or':_['map'](_0xfcfd00,function(_0x6653d0){if(_0x6653d0[_0x95d8('0x31')]!==_0x95d8('0x41')){var _0x1c38e9={};_0x1c38e9[_0x6653d0['name']]={'$like':'%'+_0xe9b10e[_0x95d8('0x34')][_0x95d8('0x3f')]+'%'};return _0x1c38e9;}})});}_0x20fe0b=_[_0x95d8('0x40')]({},_0x20fe0b,_0xe9b10e[_0x95d8('0x42')]);var _0x501fde={'where':_0x20fe0b['where']};return db[_0x95d8('0x2e')][_0x95d8('0x1b')](_0x501fde)[_0x95d8('0x23')](function(_0x3effbf){_0x36977e[_0x95d8('0x1b')]=_0x3effbf;if(_0xe9b10e[_0x95d8('0x34')]['includeAll']){_0x20fe0b[_0x95d8('0x43')]=[{'all':!![]}];}return db[_0x95d8('0x2e')][_0x95d8('0x44')](_0x20fe0b);})[_0x95d8('0x23')](function(_0x4fc463){_0x36977e[_0x95d8('0x45')]=_0x4fc463;return _0x36977e;})[_0x95d8('0x23')](respondWithFilteredResult(_0x4c981e,_0x20fe0b))[_0x95d8('0x46')](handleError(_0x4c981e,null));};exports[_0x95d8('0x47')]=function(_0x2612be,_0x1d5f1a){var _0x5dcc49={'raw':!![],'where':{'id':_0x2612be[_0x95d8('0x48')]['id']}},_0x222d11={};_0x222d11[_0x95d8('0x33')]=_['keys'](db[_0x95d8('0x2e')]['rawAttributes']);_0x222d11[_0x95d8('0x34')]=_[_0x95d8('0x35')](_0x2612be[_0x95d8('0x34')]);_0x222d11['filters']=_[_0x95d8('0x36')](_0x222d11[_0x95d8('0x33')],_0x222d11[_0x95d8('0x34')]);_0x5dcc49['attributes']=_[_0x95d8('0x36')](_0x222d11[_0x95d8('0x33')],qs['fields'](_0x2612be['query']['fields']));_0x5dcc49['attributes']=_0x5dcc49[_0x95d8('0x38')]['length']?_0x5dcc49[_0x95d8('0x38')]:_0x222d11[_0x95d8('0x33')];if(_0x2612be[_0x95d8('0x34')][_0x95d8('0x49')]){_0x5dcc49['include']=[{'all':!![]}];}_0x5dcc49=_[_0x95d8('0x40')]({},_0x5dcc49,_0x2612be[_0x95d8('0x42')]);return db[_0x95d8('0x2e')][_0x95d8('0x4a')](_0x5dcc49)[_0x95d8('0x23')](handleEntityNotFound(_0x1d5f1a,null))[_0x95d8('0x23')](respondWithResult(_0x1d5f1a,null))[_0x95d8('0x46')](handleError(_0x1d5f1a,null));};exports[_0x95d8('0x4b')]=function(_0x51b159,_0x29f6a5){return db['AnalyticExtractedReport'][_0x95d8('0x4b')](_0x51b159[_0x95d8('0x4c')],{})[_0x95d8('0x23')](function(_0x3e340e){var _0x47e252=_0x51b159[_0x95d8('0x4d')][_0x95d8('0x25')]({'plain':!![]});if(!_0x47e252)throw new Error(_0x95d8('0x4e'));if(_0x47e252[_0x95d8('0x4f')]===_0x95d8('0x4d')){var _0x4b4de7=_0x3e340e['get']({'plain':!![]});var _0x1a2a20=_0x95d8('0x50');return db['UserProfileSection'][_0x95d8('0x4a')]({'where':{'name':_0x1a2a20,'userProfileId':_0x47e252[_0x95d8('0x51')]},'raw':!![]})['then'](function(_0x17b185){if(_0x17b185&&_0x17b185[_0x95d8('0x52')]===0x0){return db[_0x95d8('0x53')][_0x95d8('0x4b')]({'name':_0x4b4de7[_0x95d8('0x2a')],'resourceId':_0x4b4de7['id'],'type':_0x17b185[_0x95d8('0x2a')],'sectionId':_0x17b185['id']},{})[_0x95d8('0x23')](function(){return _0x3e340e;});}else{return _0x3e340e;}})[_0x95d8('0x46')](function(_0x5ba290){logger[_0x95d8('0x28')](_0x95d8('0x54'),_0x5ba290);throw _0x5ba290;});}return _0x3e340e;})['then'](respondWithResult(_0x29f6a5,0xc9))[_0x95d8('0x46')](handleError(_0x29f6a5,null));};exports[_0x95d8('0x22')]=function(_0x43309c,_0x397f07){if(_0x43309c[_0x95d8('0x4c')]['id']){delete _0x43309c[_0x95d8('0x4c')]['id'];}return db[_0x95d8('0x2e')][_0x95d8('0x4a')]({'where':{'id':_0x43309c[_0x95d8('0x48')]['id']}})[_0x95d8('0x23')](handleEntityNotFound(_0x397f07,null))[_0x95d8('0x23')](saveUpdates(_0x43309c[_0x95d8('0x4c')],null))['then'](respondWithResult(_0x397f07,null))[_0x95d8('0x46')](handleError(_0x397f07,null));};exports[_0x95d8('0x24')]=function(_0x4caf8b,_0x433ba6){return db[_0x95d8('0x2e')][_0x95d8('0x4a')]({'where':{'id':_0x4caf8b['params']['id']}})[_0x95d8('0x23')](handleEntityNotFound(_0x433ba6,null))['then'](removeEntity(_0x433ba6,null))[_0x95d8('0x46')](handleError(_0x433ba6,null));};exports[_0x95d8('0x55')]=function(_0x155073,_0x67f929,_0xbfeeb5){return db['AnalyticExtractedReport']['find']({'where':{'id':_0x155073[_0x95d8('0x48')]['id']},'attributes':[_0x95d8('0x2a'),_0x95d8('0x56'),_0x95d8('0x57'),_0x95d8('0x58')],'raw':!![]})[_0x95d8('0x23')](handleEntityNotFound(_0x67f929,null))[_0x95d8('0x23')](function(_0x101e74){if(_0x101e74){if(!fs[_0x95d8('0x59')](path['join'](config[_0x95d8('0x5a')],_0x95d8('0x5b'),_0x101e74[_0x95d8('0x57')]))){throw new db[(_0x95d8('0x5c'))][(_0x95d8('0x5d'))](_0x95d8('0x5e'));}if(_0x155073[_0x95d8('0x34')][_0x95d8('0x5f')]){return _0x67f929[_0x95d8('0x27')](0xc8);}return _0x67f929['download'](path[_0x95d8('0x60')](config[_0x95d8('0x5a')],'server/files/reports',_0x101e74[_0x95d8('0x57')]),util[_0x95d8('0x61')](_0x95d8('0x62'),_0x101e74['basename']||_0x101e74[_0x95d8('0x2a')],_0x101e74[_0x95d8('0x58')]['toLowerCase']()));}})[_0x95d8('0x46')](handleError(_0x67f929,null));}; \ No newline at end of file +var _0xb0f0=['json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','get','ExtractedReports','destroy','stack','name','index','AnalyticExtractedReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','includeAll','include','findAll','rows','catch','show','params','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','basename','output','existsSync','join','root','server/files/reports','savename','ValidationError','Report\x20not\x20found\x20or\x20empty','format','toLowerCase','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end'];(function(_0x162722,_0x37e4e3){var _0x35e975=function(_0x5e3114){while(--_0x5e3114){_0x162722['push'](_0x162722['shift']());}};_0x35e975(++_0x37e4e3);}(_0xb0f0,0xa1));var _0x0b0f=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xb0f0[_0x1facfa];return _0x9ec701;};'use strict';var emlformat=require(_0x0b0f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0b0f('0x1'));var jsonpatch=require(_0x0b0f('0x2'));var rp=require(_0x0b0f('0x3'));var moment=require(_0x0b0f('0x4'));var BPromise=require(_0x0b0f('0x5'));var Mustache=require(_0x0b0f('0x6'));var util=require(_0x0b0f('0x7'));var path=require('path');var sox=require(_0x0b0f('0x8'));var csv=require(_0x0b0f('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0b0f('0xa'));var squel=require(_0x0b0f('0xb'));var crypto=require(_0x0b0f('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x0b0f('0xd'));var toCsv=require('to-csv');var querystring=require(_0x0b0f('0xe'));var Papa=require(_0x0b0f('0xf'));var Redis=require(_0x0b0f('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x0b0f('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0b0f('0x12'));var logger=require(_0x0b0f('0x13'))(_0x0b0f('0x14'));var utils=require('../../config/utils');var config=require(_0x0b0f('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2596c4,_0x5df073){_0x5df073=_0x5df073||0xcc;return function(_0x5a06bc){if(_0x5a06bc){return _0x2596c4[_0x0b0f('0x16')](_0x5df073);}return _0x2596c4[_0x0b0f('0x17')](_0x5df073)[_0x0b0f('0x18')]();};}function respondWithResult(_0x4a7b6c,_0x59c1cb){_0x59c1cb=_0x59c1cb||0xc8;return function(_0x3b2b5b){if(_0x3b2b5b){return _0x4a7b6c[_0x0b0f('0x17')](_0x59c1cb)[_0x0b0f('0x19')](_0x3b2b5b);}};}function respondWithFilteredResult(_0x3dc31d,_0x27e4a4){return function(_0x399e15){if(_0x399e15){var _0x5c7f82=typeof _0x27e4a4[_0x0b0f('0x1a')]==='undefined'&&typeof _0x27e4a4['limit']===_0x0b0f('0x1b');var _0x4bf3db=_0x399e15[_0x0b0f('0x1c')];var _0x3325aa=_0x5c7f82?0x0:_0x27e4a4['offset'];var _0x528c7f=_0x5c7f82?_0x399e15[_0x0b0f('0x1c')]:_0x27e4a4[_0x0b0f('0x1a')]+_0x27e4a4[_0x0b0f('0x1d')];var _0x543178;if(_0x528c7f>=_0x4bf3db){_0x528c7f=_0x4bf3db;_0x543178=0xc8;}else{_0x543178=0xce;}_0x3dc31d[_0x0b0f('0x17')](_0x543178);return _0x3dc31d[_0x0b0f('0x1e')](_0x0b0f('0x1f'),_0x3325aa+'-'+_0x528c7f+'/'+_0x4bf3db)['json'](_0x399e15);}return null;};}function patchUpdates(_0x5cfddd){return function(_0x42b16a){try{jsonpatch[_0x0b0f('0x20')](_0x42b16a,_0x5cfddd,!![]);}catch(_0x24c8c1){return BPromise['reject'](_0x24c8c1);}return _0x42b16a[_0x0b0f('0x21')]();};}function saveUpdates(_0x3b6e3d,_0x2e4bf4){return function(_0x28a41e){if(_0x28a41e){return _0x28a41e[_0x0b0f('0x22')](_0x3b6e3d)[_0x0b0f('0x23')](function(_0x412b2a){return _0x412b2a;});}return null;};}function removeEntity(_0x38bf11,_0xbb0b1b){return function(_0x5cd30c){if(_0x5cd30c){return _0x5cd30c['destroy']()[_0x0b0f('0x23')](function(){var _0x80ed25=_0x5cd30c[_0x0b0f('0x24')]({'plain':!![]});var _0x2d9ad5=_0x0b0f('0x25');return db['UserProfileResource'][_0x0b0f('0x26')]({'where':{'type':_0x2d9ad5,'resourceId':_0x80ed25['id']}})['then'](function(){return _0x5cd30c;});})['then'](function(){_0x38bf11[_0x0b0f('0x17')](0xcc)[_0x0b0f('0x18')]();});}};}function handleEntityNotFound(_0x54d1fe,_0x3214b4){return function(_0x2982b8){if(!_0x2982b8){_0x54d1fe[_0x0b0f('0x16')](0x194);}return _0x2982b8;};}function handleError(_0x499a02,_0x10ffb7){_0x10ffb7=_0x10ffb7||0x1f4;return function(_0x1e4158){logger['error'](_0x1e4158[_0x0b0f('0x27')]);if(_0x1e4158[_0x0b0f('0x28')]){delete _0x1e4158[_0x0b0f('0x28')];}_0x499a02[_0x0b0f('0x17')](_0x10ffb7)['send'](_0x1e4158);};}exports[_0x0b0f('0x29')]=function(_0x59b674,_0x377987){var _0x3aa65f={},_0x3e689f={},_0x801624={'count':0x0,'rows':[]};var _0x47b60d=_['map'](db[_0x0b0f('0x2a')][_0x0b0f('0x2b')],function(_0x685894){return{'name':_0x685894[_0x0b0f('0x2c')],'type':_0x685894[_0x0b0f('0x2d')][_0x0b0f('0x2e')]};});_0x3e689f[_0x0b0f('0x2f')]=_[_0x0b0f('0x30')](_0x47b60d,_0x0b0f('0x28'));_0x3e689f[_0x0b0f('0x31')]=_[_0x0b0f('0x32')](_0x59b674[_0x0b0f('0x31')]);_0x3e689f[_0x0b0f('0x33')]=_[_0x0b0f('0x34')](_0x3e689f[_0x0b0f('0x2f')],_0x3e689f['query']);_0x3aa65f[_0x0b0f('0x35')]=_[_0x0b0f('0x34')](_0x3e689f[_0x0b0f('0x2f')],qs['fields'](_0x59b674[_0x0b0f('0x31')][_0x0b0f('0x36')]));_0x3aa65f[_0x0b0f('0x35')]=_0x3aa65f['attributes'][_0x0b0f('0x37')]?_0x3aa65f[_0x0b0f('0x35')]:_0x3e689f[_0x0b0f('0x2f')];if(!_0x59b674[_0x0b0f('0x31')][_0x0b0f('0x38')](_0x0b0f('0x39'))){_0x3aa65f[_0x0b0f('0x1d')]=qs['limit'](_0x59b674['query'][_0x0b0f('0x1d')]);_0x3aa65f[_0x0b0f('0x1a')]=qs[_0x0b0f('0x1a')](_0x59b674[_0x0b0f('0x31')]['offset']);}_0x3aa65f[_0x0b0f('0x3a')]=qs['sort'](_0x59b674['query'][_0x0b0f('0x3b')]);_0x3aa65f[_0x0b0f('0x3c')]=qs[_0x0b0f('0x33')](_['pick'](_0x59b674['query'],_0x3e689f[_0x0b0f('0x33')]),_0x47b60d);if(_0x59b674[_0x0b0f('0x31')][_0x0b0f('0x3d')]){_0x3aa65f[_0x0b0f('0x3c')]=_['merge'](_0x3aa65f[_0x0b0f('0x3c')],{'$or':_['map'](_0x47b60d,function(_0xcf122f){if(_0xcf122f[_0x0b0f('0x2d')]!=='VIRTUAL'){var _0x5d7624={};_0x5d7624[_0xcf122f[_0x0b0f('0x28')]]={'$like':'%'+_0x59b674[_0x0b0f('0x31')]['filter']+'%'};return _0x5d7624;}})});}_0x3aa65f=_[_0x0b0f('0x3e')]({},_0x3aa65f,_0x59b674['options']);var _0x32e74f={'where':_0x3aa65f[_0x0b0f('0x3c')]};return db['AnalyticExtractedReport']['count'](_0x32e74f)[_0x0b0f('0x23')](function(_0x4f3f42){_0x801624[_0x0b0f('0x1c')]=_0x4f3f42;if(_0x59b674[_0x0b0f('0x31')][_0x0b0f('0x3f')]){_0x3aa65f[_0x0b0f('0x40')]=[{'all':!![]}];}return db[_0x0b0f('0x2a')][_0x0b0f('0x41')](_0x3aa65f);})['then'](function(_0x53fb8e){_0x801624[_0x0b0f('0x42')]=_0x53fb8e;return _0x801624;})[_0x0b0f('0x23')](respondWithFilteredResult(_0x377987,_0x3aa65f))[_0x0b0f('0x43')](handleError(_0x377987,null));};exports[_0x0b0f('0x44')]=function(_0x8e69d0,_0x471dfd){var _0x4756af={'raw':!![],'where':{'id':_0x8e69d0[_0x0b0f('0x45')]['id']}},_0x2d7320={};_0x2d7320['model']=_[_0x0b0f('0x32')](db['AnalyticExtractedReport'][_0x0b0f('0x2b')]);_0x2d7320[_0x0b0f('0x31')]=_[_0x0b0f('0x32')](_0x8e69d0['query']);_0x2d7320[_0x0b0f('0x33')]=_[_0x0b0f('0x34')](_0x2d7320[_0x0b0f('0x2f')],_0x2d7320[_0x0b0f('0x31')]);_0x4756af['attributes']=_['intersection'](_0x2d7320[_0x0b0f('0x2f')],qs[_0x0b0f('0x36')](_0x8e69d0['query'][_0x0b0f('0x36')]));_0x4756af[_0x0b0f('0x35')]=_0x4756af['attributes']['length']?_0x4756af[_0x0b0f('0x35')]:_0x2d7320['model'];if(_0x8e69d0[_0x0b0f('0x31')]['includeAll']){_0x4756af[_0x0b0f('0x40')]=[{'all':!![]}];}_0x4756af=_[_0x0b0f('0x3e')]({},_0x4756af,_0x8e69d0[_0x0b0f('0x46')]);return db['AnalyticExtractedReport']['find'](_0x4756af)[_0x0b0f('0x23')](handleEntityNotFound(_0x471dfd,null))['then'](respondWithResult(_0x471dfd,null))['catch'](handleError(_0x471dfd,null));};exports[_0x0b0f('0x47')]=function(_0x4efd9f,_0x41e31a){return db[_0x0b0f('0x2a')][_0x0b0f('0x47')](_0x4efd9f[_0x0b0f('0x48')],{})[_0x0b0f('0x23')](function(_0x1d8012){var _0x304573=_0x4efd9f[_0x0b0f('0x49')]['get']({'plain':!![]});if(!_0x304573)throw new Error(_0x0b0f('0x4a'));if(_0x304573[_0x0b0f('0x4b')]===_0x0b0f('0x49')){var _0x4a7a6d=_0x1d8012['get']({'plain':!![]});var _0x20b85b=_0x0b0f('0x25');return db[_0x0b0f('0x4c')][_0x0b0f('0x4d')]({'where':{'name':_0x20b85b,'userProfileId':_0x304573[_0x0b0f('0x4e')]},'raw':!![]})['then'](function(_0x473600){if(_0x473600&&_0x473600['autoAssociation']===0x0){return db[_0x0b0f('0x4f')][_0x0b0f('0x47')]({'name':_0x4a7a6d[_0x0b0f('0x28')],'resourceId':_0x4a7a6d['id'],'type':_0x473600[_0x0b0f('0x28')],'sectionId':_0x473600['id']},{})[_0x0b0f('0x23')](function(){return _0x1d8012;});}else{return _0x1d8012;}})[_0x0b0f('0x43')](function(_0x21a187){logger['error'](_0x0b0f('0x50'),_0x21a187);throw _0x21a187;});}return _0x1d8012;})[_0x0b0f('0x23')](respondWithResult(_0x41e31a,0xc9))[_0x0b0f('0x43')](handleError(_0x41e31a,null));};exports['update']=function(_0x3f2e1c,_0x328c67){if(_0x3f2e1c[_0x0b0f('0x48')]['id']){delete _0x3f2e1c['body']['id'];}return db[_0x0b0f('0x2a')][_0x0b0f('0x4d')]({'where':{'id':_0x3f2e1c[_0x0b0f('0x45')]['id']}})[_0x0b0f('0x23')](handleEntityNotFound(_0x328c67,null))[_0x0b0f('0x23')](saveUpdates(_0x3f2e1c['body'],null))[_0x0b0f('0x23')](respondWithResult(_0x328c67,null))['catch'](handleError(_0x328c67,null));};exports[_0x0b0f('0x26')]=function(_0xe208e,_0x4de368){return db[_0x0b0f('0x2a')][_0x0b0f('0x4d')]({'where':{'id':_0xe208e['params']['id']}})[_0x0b0f('0x23')](handleEntityNotFound(_0x4de368,null))['then'](removeEntity(_0x4de368,null))[_0x0b0f('0x43')](handleError(_0x4de368,null));};exports[_0x0b0f('0x51')]=function(_0x22c273,_0x20dee4,_0x4c101b){return db[_0x0b0f('0x2a')][_0x0b0f('0x4d')]({'where':{'id':_0x22c273[_0x0b0f('0x45')]['id']},'attributes':[_0x0b0f('0x28'),_0x0b0f('0x52'),'savename',_0x0b0f('0x53')],'raw':!![]})[_0x0b0f('0x23')](handleEntityNotFound(_0x20dee4,null))[_0x0b0f('0x23')](function(_0x427d1b){if(_0x427d1b){if(!fs[_0x0b0f('0x54')](path[_0x0b0f('0x55')](config[_0x0b0f('0x56')],_0x0b0f('0x57'),_0x427d1b[_0x0b0f('0x58')]))){throw new db['Sequelize'][(_0x0b0f('0x59'))](_0x0b0f('0x5a'));}if(_0x22c273[_0x0b0f('0x31')]['exists']){return _0x20dee4['sendStatus'](0xc8);}return _0x20dee4[_0x0b0f('0x51')](path[_0x0b0f('0x55')](config[_0x0b0f('0x56')],_0x0b0f('0x57'),_0x427d1b[_0x0b0f('0x58')]),util[_0x0b0f('0x5b')]('%s.%s',_0x427d1b['basename']||_0x427d1b[_0x0b0f('0x28')],_0x427d1b['output'][_0x0b0f('0x5c')]()));}})['catch'](handleError(_0x20dee4,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index ecabe0b..b1f5dcf 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 _0x1790=['lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','analytics_extracted_reports'];(function(_0x4bd9bd,_0x2fd047){var _0x1ebbd5=function(_0x1b8304){while(--_0x1b8304){_0x4bd9bd['push'](_0x4bd9bd['shift']());}};_0x1ebbd5(++_0x2fd047);}(_0x1790,0xd0));var _0x0179=function(_0x544d9a,_0x1dd46e){_0x544d9a=_0x544d9a-0x0;var _0x31cb96=_0x1790[_0x544d9a];return _0x31cb96;};'use strict';var _=require(_0x0179('0x0'));var util=require('util');var logger=require(_0x0179('0x1'))(_0x0179('0x2'));var moment=require('moment');var BPromise=require(_0x0179('0x3'));var rp=require(_0x0179('0x4'));var fs=require('fs');var path=require(_0x0179('0x5'));var rimraf=require(_0x0179('0x6'));var config=require(_0x0179('0x7'));var attributes=require(_0x0179('0x8'));module[_0x0179('0x9')]=function(_0x48b7c7,_0x4c4e36){return _0x48b7c7[_0x0179('0xa')](_0x0179('0xb'),attributes,{'tableName':_0x0179('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8d95=['bluebird','request-promise','rimraf','../../config/environment','./analyticExtractedReport.attributes','AnalyticExtractedReport','analytics_extracted_reports','lodash','util','api','moment'];(function(_0x53cdd0,_0x295197){var _0x1c9e2a=function(_0x3c01c8){while(--_0x3c01c8){_0x53cdd0['push'](_0x53cdd0['shift']());}};_0x1c9e2a(++_0x295197);}(_0x8d95,0x125));var _0x58d9=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x8d95[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x58d9('0x0'));var util=require(_0x58d9('0x1'));var logger=require('../../config/logger')(_0x58d9('0x2'));var moment=require(_0x58d9('0x3'));var BPromise=require(_0x58d9('0x4'));var rp=require(_0x58d9('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x58d9('0x6'));var config=require(_0x58d9('0x7'));var attributes=require(_0x58d9('0x8'));module['exports']=function(_0x5ed8e3,_0x2f03ad){return _0x5ed8e3['define'](_0x58d9('0x9'),attributes,{'tableName':_0x58d9('0xa'),'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 f25a6e6..60b5b21 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 _0x9280=['../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','AnalyticExtractedReport,\x20%s,\x20%s','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','lodash','util','moment','ioredis','../../mysqldb'];(function(_0x2e180b,_0x1b08c7){var _0x59e9bb=function(_0x341602){while(--_0x341602){_0x2e180b['push'](_0x2e180b['shift']());}};_0x59e9bb(++_0x1b08c7);}(_0x9280,0x113));var _0x0928=function(_0x178e27,_0x2dcbde){_0x178e27=_0x178e27-0x0;var _0x582375=_0x9280[_0x178e27];return _0x582375;};'use strict';var _=require(_0x0928('0x0'));var util=require(_0x0928('0x1'));var moment=require(_0x0928('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0928('0x3'));var db=require(_0x0928('0x4'))['db'];var utils=require(_0x0928('0x5'));var logger=require(_0x0928('0x6'))(_0x0928('0x7'));var config=require(_0x0928('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0928('0x9')][_0x0928('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x51404f,_0x1c26c4,_0x47a28c){return new BPromise(function(_0x1f60a5,_0x47597d){return client['request'](_0x51404f,_0x47a28c)[_0x0928('0xb')](function(_0x15861b){logger['info'](_0x0928('0xc'),_0x1c26c4,'request\x20sent');logger[_0x0928('0xd')](_0x0928('0xe'),_0x1c26c4,_0x0928('0xf'),JSON[_0x0928('0x10')](_0x15861b));if(_0x15861b[_0x0928('0x11')]){if(_0x15861b[_0x0928('0x11')][_0x0928('0x12')]===0x1f4){logger[_0x0928('0x11')](_0x0928('0xc'),_0x1c26c4,_0x15861b[_0x0928('0x11')][_0x0928('0x13')]);return _0x47597d(_0x15861b[_0x0928('0x11')][_0x0928('0x13')]);}logger['error'](_0x0928('0xc'),_0x1c26c4,_0x15861b[_0x0928('0x11')][_0x0928('0x13')]);return _0x1f60a5(_0x15861b[_0x0928('0x11')][_0x0928('0x13')]);}else{logger['info'](_0x0928('0xc'),_0x1c26c4,_0x0928('0xf'));_0x1f60a5(_0x15861b['result'][_0x0928('0x13')]);}})['catch'](function(_0x3700d6){logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x1c26c4,_0x3700d6);_0x47597d(_0x3700d6);});});} \ No newline at end of file +var _0x1aab=['AnalyticExtractedReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','info','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x49d41c,_0x2bdc35){var _0xb64c5f=function(_0x28f535){while(--_0x28f535){_0x49d41c['push'](_0x49d41c['shift']());}};_0xb64c5f(++_0x2bdc35);}(_0x1aab,0x122));var _0xb1aa=function(_0x353144,_0x2d83ed){_0x353144=_0x353144-0x0;var _0x44e823=_0x1aab[_0x353144];return _0x44e823;};'use strict';var _=require(_0xb1aa('0x0'));var util=require(_0xb1aa('0x1'));var moment=require(_0xb1aa('0x2'));var BPromise=require('bluebird');var rs=require(_0xb1aa('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb1aa('0x4'))['db'];var utils=require(_0xb1aa('0x5'));var logger=require(_0xb1aa('0x6'))(_0xb1aa('0x7'));var config=require(_0xb1aa('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xb1aa('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x277448,_0x13a350,_0x283ad6){return new BPromise(function(_0x3415f7,_0x405387){return client[_0xb1aa('0xa')](_0x277448,_0x283ad6)['then'](function(_0x12067d){logger[_0xb1aa('0xb')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x13a350,_0xb1aa('0xc'));logger[_0xb1aa('0xd')](_0xb1aa('0xe'),_0x13a350,_0xb1aa('0xc'),JSON[_0xb1aa('0xf')](_0x12067d));if(_0x12067d[_0xb1aa('0x10')]){if(_0x12067d[_0xb1aa('0x10')][_0xb1aa('0x11')]===0x1f4){logger[_0xb1aa('0x10')](_0xb1aa('0x12'),_0x13a350,_0x12067d[_0xb1aa('0x10')][_0xb1aa('0x13')]);return _0x405387(_0x12067d[_0xb1aa('0x10')][_0xb1aa('0x13')]);}logger[_0xb1aa('0x10')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x13a350,_0x12067d['error'][_0xb1aa('0x13')]);return _0x3415f7(_0x12067d['error'][_0xb1aa('0x13')]);}else{logger['info'](_0xb1aa('0x12'),_0x13a350,'request\x20sent');_0x3415f7(_0x12067d[_0xb1aa('0x14')]['message']);}})[_0xb1aa('0x15')](function(_0x408bf8){logger['error'](_0xb1aa('0x12'),_0x13a350,_0x408bf8);_0x405387(_0x408bf8);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index 2c69491..a6ce12e 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 _0xf4e7=['Router','fs-extra','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','show','/:id/download','download','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x5b7b22,_0x5bc479){var _0x53dc9d=function(_0x5108c0){while(--_0x5108c0){_0x5b7b22['push'](_0x5b7b22['shift']());}};_0x53dc9d(++_0x5bc479);}(_0xf4e7,0x154));var _0x7f4e=function(_0x5f30b9,_0x196dad){_0x5f30b9=_0x5f30b9-0x0;var _0x3e8ee9=_0xf4e7[_0x5f30b9];return _0x3e8ee9;};'use strict';var multer=require(_0x7f4e('0x0'));var util=require(_0x7f4e('0x1'));var path=require(_0x7f4e('0x2'));var timeout=require(_0x7f4e('0x3'));var express=require(_0x7f4e('0x4'));var router=express[_0x7f4e('0x5')]();var fs_extra=require(_0x7f4e('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7f4e('0x7'));var controller=require(_0x7f4e('0x8'));router[_0x7f4e('0x9')]('/',auth[_0x7f4e('0xa')](),controller[_0x7f4e('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x7f4e('0xc')]);router[_0x7f4e('0x9')](_0x7f4e('0xd'),auth[_0x7f4e('0xa')](),controller[_0x7f4e('0xe')]);router[_0x7f4e('0xf')]('/',auth[_0x7f4e('0xa')](),controller[_0x7f4e('0x10')]);router[_0x7f4e('0x11')](_0x7f4e('0x12'),auth[_0x7f4e('0xa')](),controller[_0x7f4e('0x13')]);router[_0x7f4e('0x14')](_0x7f4e('0x12'),auth[_0x7f4e('0xa')](),controller[_0x7f4e('0x15')]);module[_0x7f4e('0x16')]=router; \ No newline at end of file +var _0x152d=['exports','multer','util','connect-timeout','express','Router','fs-extra','./analyticExtractedReport.controller','get','isAuthenticated','index','show','download','put','/:id','delete','destroy'];(function(_0x5018e1,_0xa4a296){var _0x33f310=function(_0x4f1d8a){while(--_0x4f1d8a){_0x5018e1['push'](_0x5018e1['shift']());}};_0x33f310(++_0xa4a296);}(_0x152d,0xde));var _0xd152=function(_0x47a246,_0xd07a63){_0x47a246=_0x47a246-0x0;var _0xc87538=_0x152d[_0x47a246];return _0xc87538;};'use strict';var multer=require(_0xd152('0x0'));var util=require(_0xd152('0x1'));var path=require('path');var timeout=require(_0xd152('0x2'));var express=require(_0xd152('0x3'));var router=express[_0xd152('0x4')]();var fs_extra=require(_0xd152('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xd152('0x6'));router[_0xd152('0x7')]('/',auth[_0xd152('0x8')](),controller[_0xd152('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xd152('0xa')]);router[_0xd152('0x7')]('/:id/download',auth['isAuthenticated'](),controller[_0xd152('0xb')]);router['post']('/',auth[_0xd152('0x8')](),controller['create']);router[_0xd152('0xc')](_0xd152('0xd'),auth[_0xd152('0x8')](),controller['update']);router[_0xd152('0xe')]('/:id',auth[_0xd152('0x8')](),controller[_0xd152('0xf')]);module[_0xd152('0x10')]=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index 21f9e6f..65389d8 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 _0x59ad=['BOOLEAN','exports','TEXT','STRING'];(function(_0xe650fa,_0x28e061){var _0x21f96b=function(_0x167c65){while(--_0x167c65){_0xe650fa['push'](_0xe650fa['shift']());}};_0x21f96b(++_0x28e061);}(_0x59ad,0x1bd));var _0xd59a=function(_0x6830be,_0x5817ec){_0x6830be=_0x6830be-0x0;var _0x2127af=_0x59ad[_0x6830be];return _0x2127af;};'use strict';var Sequelize=require('sequelize');module[_0xd59a('0x0')]={'field':{'type':Sequelize[_0xd59a('0x1')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0xd59a('0x2')]},'groupBy':{'type':Sequelize[_0xd59a('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize[_0xd59a('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x4c3d=['exports','STRING','BOOLEAN','sequelize'];(function(_0x4470c0,_0x5b9cd1){var _0x2c079a=function(_0x1a91c5){while(--_0x1a91c5){_0x4470c0['push'](_0x4470c0['shift']());}};_0x2c079a(++_0x5b9cd1);}(_0x4c3d,0x9f));var _0xd4c3=function(_0x1a2868,_0x2e0567){_0x1a2868=_0x1a2868-0x0;var _0x1778d4=_0x4c3d[_0x1a2868];return _0x1778d4;};'use strict';var Sequelize=require(_0xd4c3('0x0'));module[_0xd4c3('0x1')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize[_0xd4c3('0x2')]},'function':{'type':Sequelize[_0xd4c3('0x2')]},'format':{'type':Sequelize[_0xd4c3('0x2')]},'groupBy':{'type':Sequelize[_0xd4c3('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize[_0xd4c3('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index 990e9a6..eb086e4 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 _0x1d3c=['error','name','index','AnalyticFieldReport','rawAttributes','fieldName','type','key','model','map','query','intersection','attributes','fields','hasOwnProperty','sort','where','filters','pick','filter','merge','VIRTUAL','options','count','includeAll','include','rows','show','params','keys','length','find','create','body','catch','bulkCreate','destroy','bulkDestroy','ids','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','findAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','offset','limit','set','Content-Range','apply','reject','update','then','sendStatus'];(function(_0x1140c3,_0x562621){var _0x2d0b43=function(_0x20bc1e){while(--_0x20bc1e){_0x1140c3['push'](_0x1140c3['shift']());}};_0x2d0b43(++_0x562621);}(_0x1d3c,0x1c7));var _0xc1d3=function(_0x4667b2,_0x135b67){_0x4667b2=_0x4667b2-0x0;var _0x1070f2=_0x1d3c[_0x4667b2];return _0x1070f2;};'use strict';var emlformat=require(_0xc1d3('0x0'));var rimraf=require(_0xc1d3('0x1'));var zipdir=require(_0xc1d3('0x2'));var jsonpatch=require(_0xc1d3('0x3'));var rp=require(_0xc1d3('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xc1d3('0x5'));var path=require(_0xc1d3('0x6'));var sox=require(_0xc1d3('0x7'));var csv=require(_0xc1d3('0x8'));var ejs=require(_0xc1d3('0x9'));var fs=require('fs');var fs_extra=require(_0xc1d3('0xa'));var _=require('lodash');var squel=require(_0xc1d3('0xb'));var crypto=require(_0xc1d3('0xc'));var jsforce=require(_0xc1d3('0xd'));var deskjs=require(_0xc1d3('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xc1d3('0xf'));var authService=require(_0xc1d3('0x10'));var qs=require(_0xc1d3('0x11'));var as=require(_0xc1d3('0x12'));var hardwareService=require(_0xc1d3('0x13'));var logger=require(_0xc1d3('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xc1d3('0x15'));var licenseUtil=require(_0xc1d3('0x16'));var db=require(_0xc1d3('0x17'))['db'];function respondWithStatusCode(_0xa6ef78,_0x58c5a8){_0x58c5a8=_0x58c5a8||0xcc;return function(_0x319e86){if(_0x319e86){return _0xa6ef78['sendStatus'](_0x58c5a8);}return _0xa6ef78[_0xc1d3('0x18')](_0x58c5a8)[_0xc1d3('0x19')]();};}function respondWithResult(_0x2866fa,_0x5a206e){_0x5a206e=_0x5a206e||0xc8;return function(_0x3a2408){if(_0x3a2408){return _0x2866fa[_0xc1d3('0x18')](_0x5a206e)[_0xc1d3('0x1a')](_0x3a2408);}};}function respondWithFilteredResult(_0x405d43,_0x393bc0){return function(_0x24ffdd){if(_0x24ffdd){var _0x795219=typeof _0x393bc0['offset']===_0xc1d3('0x1b')&&typeof _0x393bc0['limit']===_0xc1d3('0x1b');var _0x4b36be=_0x24ffdd['count'];var _0x4b14f5=_0x795219?0x0:_0x393bc0[_0xc1d3('0x1c')];var _0x431f0e=_0x795219?_0x24ffdd['count']:_0x393bc0[_0xc1d3('0x1c')]+_0x393bc0[_0xc1d3('0x1d')];var _0x4a708f;if(_0x431f0e>=_0x4b36be){_0x431f0e=_0x4b36be;_0x4a708f=0xc8;}else{_0x4a708f=0xce;}_0x405d43['status'](_0x4a708f);return _0x405d43[_0xc1d3('0x1e')](_0xc1d3('0x1f'),_0x4b14f5+'-'+_0x431f0e+'/'+_0x4b36be)[_0xc1d3('0x1a')](_0x24ffdd);}return null;};}function patchUpdates(_0x20c688){return function(_0x255145){try{jsonpatch[_0xc1d3('0x20')](_0x255145,_0x20c688,!![]);}catch(_0x3ad214){return BPromise[_0xc1d3('0x21')](_0x3ad214);}return _0x255145['save']();};}function saveUpdates(_0x1ae1f9,_0xad94f7){return function(_0x2b3e27){if(_0x2b3e27){return _0x2b3e27[_0xc1d3('0x22')](_0x1ae1f9)[_0xc1d3('0x23')](function(_0x2b9d3d){return _0x2b9d3d;});}return null;};}function removeEntity(_0xea51aa,_0x4917f2){return function(_0x1d6d1b){if(_0x1d6d1b){return _0x1d6d1b['destroy']()[_0xc1d3('0x23')](function(){_0xea51aa['status'](0xcc)[_0xc1d3('0x19')]();});}};}function handleEntityNotFound(_0x4ecf49,_0x6e7559){return function(_0x1eaadd){if(!_0x1eaadd){_0x4ecf49[_0xc1d3('0x24')](0x194);}return _0x1eaadd;};}function handleError(_0x1fb545,_0x466949){_0x466949=_0x466949||0x1f4;return function(_0x4a1422){logger[_0xc1d3('0x25')](_0x4a1422['stack']);if(_0x4a1422[_0xc1d3('0x26')]){delete _0x4a1422['name'];}_0x1fb545[_0xc1d3('0x18')](_0x466949)['send'](_0x4a1422);};}exports[_0xc1d3('0x27')]=function(_0x849553,_0x5da72e){var _0x3f288b={},_0x363358={},_0x29706a={'count':0x0,'rows':[]};var _0x3f4b92=_['map'](db[_0xc1d3('0x28')][_0xc1d3('0x29')],function(_0x406cd4){return{'name':_0x406cd4[_0xc1d3('0x2a')],'type':_0x406cd4[_0xc1d3('0x2b')][_0xc1d3('0x2c')]};});_0x363358[_0xc1d3('0x2d')]=_[_0xc1d3('0x2e')](_0x3f4b92,_0xc1d3('0x26'));_0x363358[_0xc1d3('0x2f')]=_['keys'](_0x849553[_0xc1d3('0x2f')]);_0x363358['filters']=_[_0xc1d3('0x30')](_0x363358[_0xc1d3('0x2d')],_0x363358[_0xc1d3('0x2f')]);_0x3f288b[_0xc1d3('0x31')]=_[_0xc1d3('0x30')](_0x363358[_0xc1d3('0x2d')],qs[_0xc1d3('0x32')](_0x849553['query'][_0xc1d3('0x32')]));_0x3f288b[_0xc1d3('0x31')]=_0x3f288b[_0xc1d3('0x31')]['length']?_0x3f288b[_0xc1d3('0x31')]:_0x363358[_0xc1d3('0x2d')];if(!_0x849553['query'][_0xc1d3('0x33')]('nolimit')){_0x3f288b['limit']=qs[_0xc1d3('0x1d')](_0x849553[_0xc1d3('0x2f')][_0xc1d3('0x1d')]);_0x3f288b[_0xc1d3('0x1c')]=qs[_0xc1d3('0x1c')](_0x849553[_0xc1d3('0x2f')][_0xc1d3('0x1c')]);}_0x3f288b['order']=qs[_0xc1d3('0x34')](_0x849553[_0xc1d3('0x2f')][_0xc1d3('0x34')]);_0x3f288b[_0xc1d3('0x35')]=qs[_0xc1d3('0x36')](_[_0xc1d3('0x37')](_0x849553['query'],_0x363358[_0xc1d3('0x36')]),_0x3f4b92);if(_0x849553['query'][_0xc1d3('0x38')]){_0x3f288b['where']=_[_0xc1d3('0x39')](_0x3f288b['where'],{'$or':_['map'](_0x3f4b92,function(_0x26bc91){if(_0x26bc91[_0xc1d3('0x2b')]!==_0xc1d3('0x3a')){var _0x41da28={};_0x41da28[_0x26bc91[_0xc1d3('0x26')]]={'$like':'%'+_0x849553[_0xc1d3('0x2f')][_0xc1d3('0x38')]+'%'};return _0x41da28;}})});}_0x3f288b=_[_0xc1d3('0x39')]({},_0x3f288b,_0x849553[_0xc1d3('0x3b')]);var _0x4748e3={'where':_0x3f288b['where']};return db['AnalyticFieldReport'][_0xc1d3('0x3c')](_0x4748e3)[_0xc1d3('0x23')](function(_0x6043f4){_0x29706a[_0xc1d3('0x3c')]=_0x6043f4;if(_0x849553[_0xc1d3('0x2f')][_0xc1d3('0x3d')]){_0x3f288b[_0xc1d3('0x3e')]=[{'all':!![]}];}return db[_0xc1d3('0x28')]['findAll'](_0x3f288b);})[_0xc1d3('0x23')](function(_0x212cf6){_0x29706a[_0xc1d3('0x3f')]=_0x212cf6;return _0x29706a;})['then'](respondWithFilteredResult(_0x5da72e,_0x3f288b))['catch'](handleError(_0x5da72e,null));};exports[_0xc1d3('0x40')]=function(_0x39f322,_0x221bed){var _0x468f5a={'raw':![],'where':{'id':_0x39f322[_0xc1d3('0x41')]['id']}},_0x5997f1={};_0x5997f1[_0xc1d3('0x2d')]=_[_0xc1d3('0x42')](db[_0xc1d3('0x28')][_0xc1d3('0x29')]);_0x5997f1['query']=_['keys'](_0x39f322[_0xc1d3('0x2f')]);_0x5997f1[_0xc1d3('0x36')]=_[_0xc1d3('0x30')](_0x5997f1[_0xc1d3('0x2d')],_0x5997f1[_0xc1d3('0x2f')]);_0x468f5a[_0xc1d3('0x31')]=_[_0xc1d3('0x30')](_0x5997f1[_0xc1d3('0x2d')],qs[_0xc1d3('0x32')](_0x39f322[_0xc1d3('0x2f')][_0xc1d3('0x32')]));_0x468f5a['attributes']=_0x468f5a['attributes'][_0xc1d3('0x43')]?_0x468f5a['attributes']:_0x5997f1[_0xc1d3('0x2d')];if(_0x39f322[_0xc1d3('0x2f')][_0xc1d3('0x3d')]){_0x468f5a['include']=[{'all':!![]}];}_0x468f5a=_[_0xc1d3('0x39')]({},_0x468f5a,_0x39f322[_0xc1d3('0x3b')]);return db[_0xc1d3('0x28')][_0xc1d3('0x44')](_0x468f5a)[_0xc1d3('0x23')](handleEntityNotFound(_0x221bed,null))[_0xc1d3('0x23')](respondWithResult(_0x221bed,null))['catch'](handleError(_0x221bed,null));};exports[_0xc1d3('0x45')]=function(_0x447e9d,_0x172cd6){return db['AnalyticFieldReport'][_0xc1d3('0x45')](_0x447e9d[_0xc1d3('0x46')],{})[_0xc1d3('0x23')](respondWithResult(_0x172cd6,0xc9))[_0xc1d3('0x47')](handleError(_0x172cd6,null));};exports[_0xc1d3('0x48')]=function(_0x5a2455,_0xcf2c24){return db[_0xc1d3('0x28')][_0xc1d3('0x48')](_0x5a2455['body'],{'raw':![],'individualHooks':!![]})[_0xc1d3('0x23')](respondWithResult(_0xcf2c24,0xc9))[_0xc1d3('0x47')](handleError(_0xcf2c24,null));};exports[_0xc1d3('0x22')]=function(_0x4a21c6,_0x20796d){if(_0x4a21c6[_0xc1d3('0x46')]['id']){delete _0x4a21c6[_0xc1d3('0x46')]['id'];}return db['AnalyticFieldReport'][_0xc1d3('0x44')]({'where':{'id':_0x4a21c6[_0xc1d3('0x41')]['id']}})['then'](handleEntityNotFound(_0x20796d,null))[_0xc1d3('0x23')](saveUpdates(_0x4a21c6[_0xc1d3('0x46')],null))['then'](respondWithResult(_0x20796d,null))[_0xc1d3('0x47')](handleError(_0x20796d,null));};exports[_0xc1d3('0x49')]=function(_0x56d1cb,_0x2d5b91){return db[_0xc1d3('0x28')][_0xc1d3('0x44')]({'where':{'id':_0x56d1cb[_0xc1d3('0x41')]['id']}})['then'](handleEntityNotFound(_0x2d5b91,null))[_0xc1d3('0x23')](removeEntity(_0x2d5b91,null))[_0xc1d3('0x47')](handleError(_0x2d5b91,null));};exports[_0xc1d3('0x4a')]=function(_0x2e416c,_0x195b9b){return db[_0xc1d3('0x28')][_0xc1d3('0x49')]({'where':{'id':_0x2e416c[_0xc1d3('0x2f')][_0xc1d3('0x4b')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x195b9b,0xcc))[_0xc1d3('0x47')](handleError(_0x195b9b,null));};exports['addFields']=function(_0x366b1c,_0x286544,_0x173f1e){return db[_0xc1d3('0x4c')][_0xc1d3('0x4d')]({'where':{'id':_0x366b1c['params']['id']}})['then'](handleEntityNotFound(_0x286544,null))[_0xc1d3('0x23')](function(_0xbfbf4f){if(_0xbfbf4f){return db[_0xc1d3('0x4e')][_0xc1d3('0x4f')](function(_0x2a782a){return db[_0xc1d3('0x28')][_0xc1d3('0x49')]({'where':{'CustomReportId':_0x366b1c[_0xc1d3('0x41')]['id']},'transaction':_0x2a782a})[_0xc1d3('0x23')](function(_0x45b268){var _0x349ba4=_[_0xc1d3('0x2e')](_0x366b1c[_0xc1d3('0x46')],function(_0xd81085){delete _0xd81085['id'];_0xd81085[_0xc1d3('0x50')]=_0x366b1c[_0xc1d3('0x41')]['id'];return _0xd81085;});return db['AnalyticFieldReport']['bulkCreate'](_0x349ba4,{'transaction':_0x2a782a});});})[_0xc1d3('0x23')](function(){return db['AnalyticFieldReport'][_0xc1d3('0x51')]({'where':{'CustomReportId':_0x366b1c[_0xc1d3('0x41')]['id']}});});}})[_0xc1d3('0x23')](respondWithResult(_0x286544,null))['catch'](handleError(_0x286544,null));}; \ No newline at end of file +var _0x65dc=['map','AnalyticFieldReport','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','keys','rawAttributes','include','find','create','body','params','bulkDestroy','addFields','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','bulkCreate','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','json','offset','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index'];(function(_0x39551a,_0x116007){var _0x4b0b62=function(_0x3d8a12){while(--_0x3d8a12){_0x39551a['push'](_0x39551a['shift']());}};_0x4b0b62(++_0x116007);}(_0x65dc,0x7b));var _0xc65d=function(_0x3c0713,_0x118272){_0x3c0713=_0x3c0713-0x0;var _0xda81d3=_0x65dc[_0x3c0713];return _0xda81d3;};'use strict';var emlformat=require(_0xc65d('0x0'));var rimraf=require(_0xc65d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc65d('0x2'));var rp=require(_0xc65d('0x3'));var moment=require(_0xc65d('0x4'));var BPromise=require(_0xc65d('0x5'));var Mustache=require(_0xc65d('0x6'));var util=require(_0xc65d('0x7'));var path=require(_0xc65d('0x8'));var sox=require(_0xc65d('0x9'));var csv=require(_0xc65d('0xa'));var ejs=require(_0xc65d('0xb'));var fs=require('fs');var fs_extra=require(_0xc65d('0xc'));var _=require(_0xc65d('0xd'));var squel=require(_0xc65d('0xe'));var crypto=require('crypto');var jsforce=require(_0xc65d('0xf'));var deskjs=require(_0xc65d('0x10'));var toCsv=require('to-csv');var querystring=require(_0xc65d('0x11'));var Papa=require('papaparse');var Redis=require(_0xc65d('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xc65d('0x13'));var as=require(_0xc65d('0x14'));var hardwareService=require(_0xc65d('0x15'));var logger=require(_0xc65d('0x16'))(_0xc65d('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xc65d('0x18'))['db'];function respondWithStatusCode(_0x45cb88,_0x1e69c4){_0x1e69c4=_0x1e69c4||0xcc;return function(_0x42ff3c){if(_0x42ff3c){return _0x45cb88[_0xc65d('0x19')](_0x1e69c4);}return _0x45cb88[_0xc65d('0x1a')](_0x1e69c4)['end']();};}function respondWithResult(_0x56eb71,_0x2538e2){_0x2538e2=_0x2538e2||0xc8;return function(_0x3797cb){if(_0x3797cb){return _0x56eb71[_0xc65d('0x1a')](_0x2538e2)[_0xc65d('0x1b')](_0x3797cb);}};}function respondWithFilteredResult(_0x269513,_0x490203){return function(_0x29c950){if(_0x29c950){var _0x27e221=typeof _0x490203[_0xc65d('0x1c')]==='undefined'&&typeof _0x490203[_0xc65d('0x1d')]==='undefined';var _0x3eafd8=_0x29c950[_0xc65d('0x1e')];var _0x21cc66=_0x27e221?0x0:_0x490203['offset'];var _0x2cdc7f=_0x27e221?_0x29c950[_0xc65d('0x1e')]:_0x490203[_0xc65d('0x1c')]+_0x490203[_0xc65d('0x1d')];var _0x4545a8;if(_0x2cdc7f>=_0x3eafd8){_0x2cdc7f=_0x3eafd8;_0x4545a8=0xc8;}else{_0x4545a8=0xce;}_0x269513[_0xc65d('0x1a')](_0x4545a8);return _0x269513[_0xc65d('0x1f')](_0xc65d('0x20'),_0x21cc66+'-'+_0x2cdc7f+'/'+_0x3eafd8)['json'](_0x29c950);}return null;};}function patchUpdates(_0x3e3d88){return function(_0x4c7cb9){try{jsonpatch[_0xc65d('0x21')](_0x4c7cb9,_0x3e3d88,!![]);}catch(_0x21b3e9){return BPromise[_0xc65d('0x22')](_0x21b3e9);}return _0x4c7cb9[_0xc65d('0x23')]();};}function saveUpdates(_0x1953e5,_0x250895){return function(_0x17c33d){if(_0x17c33d){return _0x17c33d[_0xc65d('0x24')](_0x1953e5)[_0xc65d('0x25')](function(_0x1b6fb2){return _0x1b6fb2;});}return null;};}function removeEntity(_0x34d43e,_0x26a7e9){return function(_0x559d9a){if(_0x559d9a){return _0x559d9a[_0xc65d('0x26')]()[_0xc65d('0x25')](function(){_0x34d43e[_0xc65d('0x1a')](0xcc)[_0xc65d('0x27')]();});}};}function handleEntityNotFound(_0x22617e,_0x139d1f){return function(_0x520c9e){if(!_0x520c9e){_0x22617e[_0xc65d('0x19')](0x194);}return _0x520c9e;};}function handleError(_0x28f51c,_0x964a93){_0x964a93=_0x964a93||0x1f4;return function(_0x3cd14f){logger[_0xc65d('0x28')](_0x3cd14f[_0xc65d('0x29')]);if(_0x3cd14f[_0xc65d('0x2a')]){delete _0x3cd14f[_0xc65d('0x2a')];}_0x28f51c[_0xc65d('0x1a')](_0x964a93)[_0xc65d('0x2b')](_0x3cd14f);};}exports[_0xc65d('0x2c')]=function(_0x58c26a,_0x22ed18){var _0x2d3c61={},_0x26e6b2={},_0x5e95d5={'count':0x0,'rows':[]};var _0x158c31=_[_0xc65d('0x2d')](db[_0xc65d('0x2e')]['rawAttributes'],function(_0x10f6b5){return{'name':_0x10f6b5['fieldName'],'type':_0x10f6b5[_0xc65d('0x2f')][_0xc65d('0x30')]};});_0x26e6b2[_0xc65d('0x31')]=_[_0xc65d('0x2d')](_0x158c31,_0xc65d('0x2a'));_0x26e6b2[_0xc65d('0x32')]=_['keys'](_0x58c26a['query']);_0x26e6b2[_0xc65d('0x33')]=_['intersection'](_0x26e6b2[_0xc65d('0x31')],_0x26e6b2['query']);_0x2d3c61[_0xc65d('0x34')]=_[_0xc65d('0x35')](_0x26e6b2[_0xc65d('0x31')],qs[_0xc65d('0x36')](_0x58c26a[_0xc65d('0x32')]['fields']));_0x2d3c61[_0xc65d('0x34')]=_0x2d3c61[_0xc65d('0x34')][_0xc65d('0x37')]?_0x2d3c61[_0xc65d('0x34')]:_0x26e6b2[_0xc65d('0x31')];if(!_0x58c26a[_0xc65d('0x32')][_0xc65d('0x38')](_0xc65d('0x39'))){_0x2d3c61[_0xc65d('0x1d')]=qs[_0xc65d('0x1d')](_0x58c26a[_0xc65d('0x32')][_0xc65d('0x1d')]);_0x2d3c61['offset']=qs[_0xc65d('0x1c')](_0x58c26a[_0xc65d('0x32')][_0xc65d('0x1c')]);}_0x2d3c61['order']=qs[_0xc65d('0x3a')](_0x58c26a[_0xc65d('0x32')][_0xc65d('0x3a')]);_0x2d3c61[_0xc65d('0x3b')]=qs[_0xc65d('0x33')](_['pick'](_0x58c26a[_0xc65d('0x32')],_0x26e6b2[_0xc65d('0x33')]),_0x158c31);if(_0x58c26a['query'][_0xc65d('0x3c')]){_0x2d3c61['where']=_[_0xc65d('0x3d')](_0x2d3c61['where'],{'$or':_[_0xc65d('0x2d')](_0x158c31,function(_0x2157d0){if(_0x2157d0[_0xc65d('0x2f')]!==_0xc65d('0x3e')){var _0x141693={};_0x141693[_0x2157d0[_0xc65d('0x2a')]]={'$like':'%'+_0x58c26a[_0xc65d('0x32')][_0xc65d('0x3c')]+'%'};return _0x141693;}})});}_0x2d3c61=_[_0xc65d('0x3d')]({},_0x2d3c61,_0x58c26a[_0xc65d('0x3f')]);var _0x1c8ba9={'where':_0x2d3c61[_0xc65d('0x3b')]};return db[_0xc65d('0x2e')][_0xc65d('0x1e')](_0x1c8ba9)[_0xc65d('0x25')](function(_0x2fa22a){_0x5e95d5['count']=_0x2fa22a;if(_0x58c26a[_0xc65d('0x32')][_0xc65d('0x40')]){_0x2d3c61['include']=[{'all':!![]}];}return db[_0xc65d('0x2e')][_0xc65d('0x41')](_0x2d3c61);})[_0xc65d('0x25')](function(_0x951134){_0x5e95d5[_0xc65d('0x42')]=_0x951134;return _0x5e95d5;})[_0xc65d('0x25')](respondWithFilteredResult(_0x22ed18,_0x2d3c61))[_0xc65d('0x43')](handleError(_0x22ed18,null));};exports[_0xc65d('0x44')]=function(_0x464453,_0x3fd539){var _0x4af250={'raw':![],'where':{'id':_0x464453['params']['id']}},_0x343bf2={};_0x343bf2['model']=_[_0xc65d('0x45')](db[_0xc65d('0x2e')][_0xc65d('0x46')]);_0x343bf2['query']=_['keys'](_0x464453[_0xc65d('0x32')]);_0x343bf2[_0xc65d('0x33')]=_[_0xc65d('0x35')](_0x343bf2['model'],_0x343bf2[_0xc65d('0x32')]);_0x4af250[_0xc65d('0x34')]=_[_0xc65d('0x35')](_0x343bf2[_0xc65d('0x31')],qs[_0xc65d('0x36')](_0x464453['query'][_0xc65d('0x36')]));_0x4af250['attributes']=_0x4af250[_0xc65d('0x34')][_0xc65d('0x37')]?_0x4af250[_0xc65d('0x34')]:_0x343bf2[_0xc65d('0x31')];if(_0x464453[_0xc65d('0x32')][_0xc65d('0x40')]){_0x4af250[_0xc65d('0x47')]=[{'all':!![]}];}_0x4af250=_[_0xc65d('0x3d')]({},_0x4af250,_0x464453[_0xc65d('0x3f')]);return db[_0xc65d('0x2e')][_0xc65d('0x48')](_0x4af250)[_0xc65d('0x25')](handleEntityNotFound(_0x3fd539,null))[_0xc65d('0x25')](respondWithResult(_0x3fd539,null))['catch'](handleError(_0x3fd539,null));};exports[_0xc65d('0x49')]=function(_0x112991,_0x8b6243){return db['AnalyticFieldReport'][_0xc65d('0x49')](_0x112991[_0xc65d('0x4a')],{})['then'](respondWithResult(_0x8b6243,0xc9))['catch'](handleError(_0x8b6243,null));};exports['bulkCreate']=function(_0x5a2e14,_0x361514){return db['AnalyticFieldReport']['bulkCreate'](_0x5a2e14['body'],{'raw':![],'individualHooks':!![]})[_0xc65d('0x25')](respondWithResult(_0x361514,0xc9))[_0xc65d('0x43')](handleError(_0x361514,null));};exports[_0xc65d('0x24')]=function(_0x2f23a5,_0x4aea8c){if(_0x2f23a5[_0xc65d('0x4a')]['id']){delete _0x2f23a5[_0xc65d('0x4a')]['id'];}return db['AnalyticFieldReport']['find']({'where':{'id':_0x2f23a5[_0xc65d('0x4b')]['id']}})[_0xc65d('0x25')](handleEntityNotFound(_0x4aea8c,null))['then'](saveUpdates(_0x2f23a5[_0xc65d('0x4a')],null))[_0xc65d('0x25')](respondWithResult(_0x4aea8c,null))[_0xc65d('0x43')](handleError(_0x4aea8c,null));};exports[_0xc65d('0x26')]=function(_0x4c0b92,_0x599516){return db[_0xc65d('0x2e')]['find']({'where':{'id':_0x4c0b92[_0xc65d('0x4b')]['id']}})[_0xc65d('0x25')](handleEntityNotFound(_0x599516,null))[_0xc65d('0x25')](removeEntity(_0x599516,null))['catch'](handleError(_0x599516,null));};exports[_0xc65d('0x4c')]=function(_0x10c363,_0x43226f){return db[_0xc65d('0x2e')][_0xc65d('0x26')]({'where':{'id':_0x10c363[_0xc65d('0x32')]['ids']||[]},'raw':![],'individualHooks':!![]})[_0xc65d('0x25')](respondWithResult(_0x43226f,0xcc))[_0xc65d('0x43')](handleError(_0x43226f,null));};exports[_0xc65d('0x4d')]=function(_0x4fbded,_0x1ce544,_0x35e9ad){return db[_0xc65d('0x4e')][_0xc65d('0x4f')]({'where':{'id':_0x4fbded[_0xc65d('0x4b')]['id']}})[_0xc65d('0x25')](handleEntityNotFound(_0x1ce544,null))['then'](function(_0x451eb6){if(_0x451eb6){return db[_0xc65d('0x50')][_0xc65d('0x51')](function(_0x417725){return db[_0xc65d('0x2e')]['destroy']({'where':{'CustomReportId':_0x4fbded[_0xc65d('0x4b')]['id']},'transaction':_0x417725})['then'](function(_0x522426){var _0x28ff68=_['map'](_0x4fbded[_0xc65d('0x4a')],function(_0x732f99){delete _0x732f99['id'];_0x732f99[_0xc65d('0x52')]=_0x4fbded[_0xc65d('0x4b')]['id'];return _0x732f99;});return db[_0xc65d('0x2e')][_0xc65d('0x53')](_0x28ff68,{'transaction':_0x417725});});})[_0xc65d('0x25')](function(){return db[_0xc65d('0x2e')][_0xc65d('0x41')]({'where':{'CustomReportId':_0x4fbded['params']['id']}});});}})[_0xc65d('0x25')](respondWithResult(_0x1ce544,null))[_0xc65d('0x43')](handleError(_0x1ce544,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index 9335f1a..31b9371 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 _0x44a0=['path','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','lodash','../../config/logger','moment','request-promise'];(function(_0x1cc32e,_0x1f278f){var _0x1dac9a=function(_0x1fb7a0){while(--_0x1fb7a0){_0x1cc32e['push'](_0x1cc32e['shift']());}};_0x1dac9a(++_0x1f278f);}(_0x44a0,0x193));var _0x044a=function(_0x4891a7,_0x566170){_0x4891a7=_0x4891a7-0x0;var _0x20a6aa=_0x44a0[_0x4891a7];return _0x20a6aa;};'use strict';var _=require(_0x044a('0x0'));var util=require('util');var logger=require(_0x044a('0x1'))('api');var moment=require(_0x044a('0x2'));var BPromise=require('bluebird');var rp=require(_0x044a('0x3'));var fs=require('fs');var path=require(_0x044a('0x4'));var rimraf=require(_0x044a('0x5'));var config=require(_0x044a('0x6'));var attributes=require(_0x044a('0x7'));module[_0x044a('0x8')]=function(_0x35e5ce,_0x476d49){return _0x35e5ce[_0x044a('0x9')](_0x044a('0xa'),attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x512c=['./analyticFieldReport.attributes','define','analytics_report_fields','../../config/logger','api','moment','bluebird','path'];(function(_0x4a5ba6,_0x103eb9){var _0x23831=function(_0x19dffc){while(--_0x19dffc){_0x4a5ba6['push'](_0x4a5ba6['shift']());}};_0x23831(++_0x103eb9);}(_0x512c,0x13b));var _0xc512=function(_0x176c29,_0x31b30a){_0x176c29=_0x176c29-0x0;var _0x553834=_0x512c[_0x176c29];return _0x553834;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xc512('0x0'))(_0xc512('0x1'));var moment=require(_0xc512('0x2'));var BPromise=require(_0xc512('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc512('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xc512('0x5'));module['exports']=function(_0xb4f59d,_0x46c5b6){return _0xb4f59d[_0xc512('0x6')]('AnalyticFieldReport',attributes,{'tableName':_0xc512('0x7'),'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 e0fb259..c35ac59 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 _0x0826=['request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','AnalyticFieldReport,\x20%s,\x20%s'];(function(_0x42f6ca,_0x268900){var _0x509ea9=function(_0x45b0a2){while(--_0x45b0a2){_0x42f6ca['push'](_0x42f6ca['shift']());}};_0x509ea9(++_0x268900);}(_0x0826,0x104));var _0x6082=function(_0x15b065,_0x3b77a7){_0x15b065=_0x15b065-0x0;var _0x4cb0ae=_0x0826[_0x15b065];return _0x4cb0ae;};'use strict';var _=require(_0x6082('0x0'));var util=require(_0x6082('0x1'));var moment=require(_0x6082('0x2'));var BPromise=require(_0x6082('0x3'));var rs=require(_0x6082('0x4'));var fs=require('fs');var Redis=require(_0x6082('0x5'));var db=require(_0x6082('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x6082('0x7'))(_0x6082('0x8'));var config=require(_0x6082('0x9'));var jayson=require(_0x6082('0xa'));var client=jayson[_0x6082('0xb')][_0x6082('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x85e0c1,_0x3210d1,_0x4387de){return new BPromise(function(_0x355aec,_0x23f9af){return client['request'](_0x85e0c1,_0x4387de)[_0x6082('0xd')](function(_0x4c0212){logger[_0x6082('0xe')](_0x6082('0xf'),_0x3210d1,_0x6082('0x10'));logger[_0x6082('0x11')](_0x6082('0x12'),_0x3210d1,_0x6082('0x10'),JSON['stringify'](_0x4c0212));if(_0x4c0212[_0x6082('0x13')]){if(_0x4c0212[_0x6082('0x13')][_0x6082('0x14')]===0x1f4){logger[_0x6082('0x13')](_0x6082('0xf'),_0x3210d1,_0x4c0212[_0x6082('0x13')][_0x6082('0x15')]);return _0x23f9af(_0x4c0212[_0x6082('0x13')][_0x6082('0x15')]);}logger[_0x6082('0x13')](_0x6082('0xf'),_0x3210d1,_0x4c0212[_0x6082('0x13')][_0x6082('0x15')]);return _0x355aec(_0x4c0212[_0x6082('0x13')]['message']);}else{logger[_0x6082('0xe')](_0x6082('0xf'),_0x3210d1,'request\x20sent');_0x355aec(_0x4c0212['result'][_0x6082('0x15')]);}})[_0x6082('0x16')](function(_0x276ed5){logger[_0x6082('0x13')]('AnalyticFieldReport,\x20%s,\x20%s',_0x3210d1,_0x276ed5);_0x23f9af(_0x276ed5);});});} \ No newline at end of file +var _0xfdc5=['code','message','info','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','then','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x23db04,_0x16800f){var _0x80db9d=function(_0x11562d){while(--_0x11562d){_0x23db04['push'](_0x23db04['shift']());}};_0x80db9d(++_0x16800f);}(_0xfdc5,0xb5));var _0x5fdc=function(_0x3a7a9c,_0x24f7d6){_0x3a7a9c=_0x3a7a9c-0x0;var _0x59156e=_0xfdc5[_0x3a7a9c];return _0x59156e;};'use strict';var _=require(_0x5fdc('0x0'));var util=require(_0x5fdc('0x1'));var moment=require('moment');var BPromise=require(_0x5fdc('0x2'));var rs=require(_0x5fdc('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5fdc('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x5fdc('0x5'))(_0x5fdc('0x6'));var config=require('../../config/environment');var jayson=require(_0x5fdc('0x7'));var client=jayson[_0x5fdc('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3e395e,_0xd11245,_0x233c92){return new BPromise(function(_0xb20af8,_0x3b4aa1){return client[_0x5fdc('0x9')](_0x3e395e,_0x233c92)[_0x5fdc('0xa')](function(_0x4b868d){logger['info'](_0x5fdc('0xb'),_0xd11245,_0x5fdc('0xc'));logger[_0x5fdc('0xd')](_0x5fdc('0xe'),_0xd11245,_0x5fdc('0xc'),JSON[_0x5fdc('0xf')](_0x4b868d));if(_0x4b868d[_0x5fdc('0x10')]){if(_0x4b868d[_0x5fdc('0x10')][_0x5fdc('0x11')]===0x1f4){logger['error'](_0x5fdc('0xb'),_0xd11245,_0x4b868d[_0x5fdc('0x10')][_0x5fdc('0x12')]);return _0x3b4aa1(_0x4b868d[_0x5fdc('0x10')]['message']);}logger[_0x5fdc('0x10')](_0x5fdc('0xb'),_0xd11245,_0x4b868d['error']['message']);return _0xb20af8(_0x4b868d['error'][_0x5fdc('0x12')]);}else{logger[_0x5fdc('0x13')](_0x5fdc('0xb'),_0xd11245,'request\x20sent');_0xb20af8(_0x4b868d[_0x5fdc('0x14')][_0x5fdc('0x12')]);}})[_0x5fdc('0x15')](function(_0xccede4){logger[_0x5fdc('0x10')]('AnalyticFieldReport,\x20%s,\x20%s',_0xd11245,_0xccede4);_0x3b4aa1(_0xccede4);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index aa0b4fc..f7b5a39 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(_0x58ef58,_0x2ea5b7){var _0x10117a=function(_0x4d282){while(--_0x4d282){_0x58ef58['push'](_0x58ef58['shift']());}};_0x10117a(++_0x2ea5b7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0xa9e0[_0x9aada2];return _0x196dff;};'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(_0x32f20e,_0x5b7a1e){var _0x457e79=function(_0x34f608){while(--_0x34f608){_0x32f20e['push'](_0x32f20e['shift']());}};_0x457e79(++_0x5b7a1e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0xa9e0[_0x5e3b04];return _0x1fc44d;};'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 88b7811..21b8e3e 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 _0x38a5=['sequelize','exports','STRING','name','TEXT'];(function(_0x589172,_0x2839fa){var _0x105c51=function(_0x5eb9a5){while(--_0x5eb9a5){_0x589172['push'](_0x589172['shift']());}};_0x105c51(++_0x2839fa);}(_0x38a5,0x69));var _0x538a=function(_0x32c272,_0x1b6d58){_0x32c272=_0x32c272-0x0;var _0x534033=_0x38a5[_0x32c272];return _0x534033;};'use strict';var Sequelize=require(_0x538a('0x0'));module[_0x538a('0x1')]={'name':{'type':Sequelize[_0x538a('0x2')],'allowNull':![],'unique':_0x538a('0x3')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0x538a('0x4')]},'description':{'type':Sequelize[_0x538a('0x2')]}}; \ No newline at end of file +var _0x0caf=['name','STRING','TEXT'];(function(_0x44ba8a,_0x19c5ea){var _0x2ac7fb=function(_0x225dd4){while(--_0x225dd4){_0x44ba8a['push'](_0x44ba8a['shift']());}};_0x2ac7fb(++_0x19c5ea);}(_0x0caf,0x9f));var _0xf0ca=function(_0x5e9f37,_0xfcd535){_0x5e9f37=_0x5e9f37-0x0;var _0xe1304f=_0x0caf[_0x5e9f37];return _0xe1304f;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xf0ca('0x0')},'table':{'type':Sequelize[_0xf0ca('0x1')]},'metric':{'type':Sequelize[_0xf0ca('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index 64f3bc5..a0bcf5a 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 _0x98a8=['../../mysqldb','end','status','json','undefined','count','offset','apply','reject','save','update','then','destroy','get','UserProfileResource','sendStatus','name','send','index','map','AnalyticMetric','fieldName','type','key','model','query','keys','intersection','attributes','fields','nolimit','limit','order','sort','where','filters','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','length','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Metrics','UserProfileSection','autoAssociation','error','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','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment'];(function(_0x1a929b,_0x5dee96){var _0x39b6f9=function(_0x42afe8){while(--_0x42afe8){_0x1a929b['push'](_0x1a929b['shift']());}};_0x39b6f9(++_0x5dee96);}(_0x98a8,0x12c));var _0x898a=function(_0x338255,_0x457edc){_0x338255=_0x338255-0x0;var _0x3dc9c7=_0x98a8[_0x338255];return _0x3dc9c7;};'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(){var _0x32eca5=_0x274cdf[_0x898a('0x25')]({'plain':!![]});var _0x1426e3='Metrics';return db[_0x898a('0x26')]['destroy']({'where':{'type':_0x1426e3,'resourceId':_0x32eca5['id']}})['then'](function(){return _0x274cdf;});})['then'](function(){_0x310bfa[_0x898a('0x1a')](0xcc)[_0x898a('0x19')]();});}};}function handleEntityNotFound(_0x420b25,_0x40b3db){return function(_0x28ae6a){if(!_0x28ae6a){_0x420b25[_0x898a('0x27')](0x194);}return _0x28ae6a;};}function handleError(_0x398e98,_0xac1fc4){_0xac1fc4=_0xac1fc4||0x1f4;return function(_0xd31922){logger['error'](_0xd31922['stack']);if(_0xd31922['name']){delete _0xd31922[_0x898a('0x28')];}_0x398e98[_0x898a('0x1a')](_0xac1fc4)[_0x898a('0x29')](_0xd31922);};}exports[_0x898a('0x2a')]=function(_0x34f447,_0x560000){var _0xe3c983={},_0xf74645={},_0x18773a={'count':0x0,'rows':[]};var _0x4287da=_[_0x898a('0x2b')](db[_0x898a('0x2c')]['rawAttributes'],function(_0x7a1eb5){return{'name':_0x7a1eb5[_0x898a('0x2d')],'type':_0x7a1eb5[_0x898a('0x2e')][_0x898a('0x2f')]};});_0xf74645[_0x898a('0x30')]=_['map'](_0x4287da,'name');_0xf74645[_0x898a('0x31')]=_[_0x898a('0x32')](_0x34f447[_0x898a('0x31')]);_0xf74645['filters']=_[_0x898a('0x33')](_0xf74645[_0x898a('0x30')],_0xf74645[_0x898a('0x31')]);_0xe3c983[_0x898a('0x34')]=_[_0x898a('0x33')](_0xf74645[_0x898a('0x30')],qs[_0x898a('0x35')](_0x34f447[_0x898a('0x31')]['fields']));_0xe3c983[_0x898a('0x34')]=_0xe3c983['attributes']['length']?_0xe3c983[_0x898a('0x34')]:_0xf74645['model'];if(!_0x34f447[_0x898a('0x31')]['hasOwnProperty'](_0x898a('0x36'))){_0xe3c983['limit']=qs[_0x898a('0x37')](_0x34f447[_0x898a('0x31')][_0x898a('0x37')]);_0xe3c983['offset']=qs['offset'](_0x34f447['query'][_0x898a('0x1e')]);}_0xe3c983[_0x898a('0x38')]=qs['sort'](_0x34f447[_0x898a('0x31')][_0x898a('0x39')]);_0xe3c983[_0x898a('0x3a')]=qs[_0x898a('0x3b')](_['pick'](_0x34f447['query'],_0xf74645[_0x898a('0x3b')]),_0x4287da);if(_0x34f447[_0x898a('0x31')]['filter']){_0xe3c983['where']=_[_0x898a('0x3c')](_0xe3c983[_0x898a('0x3a')],{'$or':_[_0x898a('0x2b')](_0x4287da,function(_0xa45405){if(_0xa45405['type']!==_0x898a('0x3d')){var _0x369c02={};_0x369c02[_0xa45405['name']]={'$like':'%'+_0x34f447['query']['filter']+'%'};return _0x369c02;}})});}_0xe3c983=_[_0x898a('0x3c')]({},_0xe3c983,_0x34f447[_0x898a('0x3e')]);var _0x35d767={'where':_0xe3c983[_0x898a('0x3a')]};return db[_0x898a('0x2c')][_0x898a('0x1d')](_0x35d767)[_0x898a('0x23')](function(_0x1432ec){_0x18773a[_0x898a('0x1d')]=_0x1432ec;if(_0x34f447[_0x898a('0x31')][_0x898a('0x3f')]){_0xe3c983[_0x898a('0x40')]=[{'all':!![]}];}return db[_0x898a('0x2c')][_0x898a('0x41')](_0xe3c983);})[_0x898a('0x23')](function(_0x4c8628){_0x18773a[_0x898a('0x42')]=_0x4c8628;return _0x18773a;})[_0x898a('0x23')](respondWithFilteredResult(_0x560000,_0xe3c983))[_0x898a('0x43')](handleError(_0x560000,null));};exports['show']=function(_0x34029e,_0x2e5451){var _0x3a8663={'raw':!![],'where':{'id':_0x34029e[_0x898a('0x44')]['id']}},_0x6ab441={};_0x6ab441[_0x898a('0x30')]=_[_0x898a('0x32')](db[_0x898a('0x2c')]['rawAttributes']);_0x6ab441[_0x898a('0x31')]=_[_0x898a('0x32')](_0x34029e[_0x898a('0x31')]);_0x6ab441[_0x898a('0x3b')]=_['intersection'](_0x6ab441[_0x898a('0x30')],_0x6ab441[_0x898a('0x31')]);_0x3a8663['attributes']=_[_0x898a('0x33')](_0x6ab441['model'],qs[_0x898a('0x35')](_0x34029e['query']['fields']));_0x3a8663[_0x898a('0x34')]=_0x3a8663['attributes'][_0x898a('0x45')]?_0x3a8663[_0x898a('0x34')]:_0x6ab441['model'];if(_0x34029e[_0x898a('0x31')][_0x898a('0x3f')]){_0x3a8663['include']=[{'all':!![]}];}_0x3a8663=_[_0x898a('0x3c')]({},_0x3a8663,_0x34029e[_0x898a('0x3e')]);return db[_0x898a('0x2c')][_0x898a('0x46')](_0x3a8663)['then'](handleEntityNotFound(_0x2e5451,null))[_0x898a('0x23')](respondWithResult(_0x2e5451,null))[_0x898a('0x43')](handleError(_0x2e5451,null));};exports['create']=function(_0x25adcc,_0x1d8c16){return db['AnalyticMetric'][_0x898a('0x47')](_0x25adcc['body'],{})[_0x898a('0x23')](function(_0x41f291){var _0x32ccb9=_0x25adcc['user'][_0x898a('0x25')]({'plain':!![]});if(!_0x32ccb9)throw new Error(_0x898a('0x48'));if(_0x32ccb9[_0x898a('0x49')]===_0x898a('0x4a')){var _0x5a8a2c=_0x41f291[_0x898a('0x25')]({'plain':!![]});var _0x529d7c=_0x898a('0x4b');return db[_0x898a('0x4c')][_0x898a('0x46')]({'where':{'name':_0x529d7c,'userProfileId':_0x32ccb9['userProfileId']},'raw':!![]})[_0x898a('0x23')](function(_0x3c4db0){if(_0x3c4db0&&_0x3c4db0[_0x898a('0x4d')]===0x0){return db['UserProfileResource']['create']({'name':_0x5a8a2c[_0x898a('0x28')],'resourceId':_0x5a8a2c['id'],'type':_0x3c4db0[_0x898a('0x28')],'sectionId':_0x3c4db0['id']},{})[_0x898a('0x23')](function(){return _0x41f291;});}else{return _0x41f291;}})[_0x898a('0x43')](function(_0x28b8c9){logger[_0x898a('0x4e')](_0x898a('0x4f'),_0x28b8c9);throw _0x28b8c9;});}return _0x41f291;})[_0x898a('0x23')](respondWithResult(_0x1d8c16,0xc9))[_0x898a('0x43')](handleError(_0x1d8c16,null));};exports[_0x898a('0x22')]=function(_0x2382a9,_0x5e9329){if(_0x2382a9[_0x898a('0x50')]['id']){delete _0x2382a9[_0x898a('0x50')]['id'];}return db['AnalyticMetric'][_0x898a('0x46')]({'where':{'id':_0x2382a9['params']['id']}})['then'](handleEntityNotFound(_0x5e9329,null))[_0x898a('0x23')](saveUpdates(_0x2382a9[_0x898a('0x50')],null))[_0x898a('0x23')](respondWithResult(_0x5e9329,null))['catch'](handleError(_0x5e9329,null));};exports['destroy']=function(_0x11a07a,_0x1f5e4b){return db['AnalyticMetric'][_0x898a('0x46')]({'where':{'id':_0x11a07a[_0x898a('0x44')]['id']}})['then'](handleEntityNotFound(_0x1f5e4b,null))[_0x898a('0x23')](removeEntity(_0x1f5e4b,null))[_0x898a('0x43')](handleError(_0x1f5e4b,null));}; \ No newline at end of file +var _0x9a19=['AnalyticMetric','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','options','find','body','user','UserProfileSection','autoAssociation','create','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','save','then','destroy','get','Metrics','stack','name','send','index','map'];(function(_0x2b8aa1,_0x29699b){var _0x170363=function(_0x471bd2){while(--_0x471bd2){_0x2b8aa1['push'](_0x2b8aa1['shift']());}};_0x170363(++_0x29699b);}(_0x9a19,0x114));var _0x99a1=function(_0x1f7413,_0x3388c3){_0x1f7413=_0x1f7413-0x0;var _0x2d2775=_0x9a19[_0x1f7413];return _0x2d2775;};'use strict';var emlformat=require(_0x99a1('0x0'));var rimraf=require(_0x99a1('0x1'));var zipdir=require(_0x99a1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x99a1('0x3'));var moment=require(_0x99a1('0x4'));var BPromise=require(_0x99a1('0x5'));var Mustache=require(_0x99a1('0x6'));var util=require(_0x99a1('0x7'));var path=require(_0x99a1('0x8'));var sox=require(_0x99a1('0x9'));var csv=require(_0x99a1('0xa'));var ejs=require(_0x99a1('0xb'));var fs=require('fs');var fs_extra=require(_0x99a1('0xc'));var _=require(_0x99a1('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x99a1('0xe'));var toCsv=require(_0x99a1('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x99a1('0xf'));var authService=require(_0x99a1('0x10'));var qs=require(_0x99a1('0x11'));var as=require(_0x99a1('0x12'));var hardwareService=require(_0x99a1('0x13'));var logger=require('../../config/logger')(_0x99a1('0x14'));var utils=require(_0x99a1('0x15'));var config=require(_0x99a1('0x16'));var licenseUtil=require(_0x99a1('0x17'));var db=require(_0x99a1('0x18'))['db'];function respondWithStatusCode(_0x1bc7aa,_0x2ff655){_0x2ff655=_0x2ff655||0xcc;return function(_0x532f56){if(_0x532f56){return _0x1bc7aa[_0x99a1('0x19')](_0x2ff655);}return _0x1bc7aa[_0x99a1('0x1a')](_0x2ff655)[_0x99a1('0x1b')]();};}function respondWithResult(_0x47815e,_0xe1a1f){_0xe1a1f=_0xe1a1f||0xc8;return function(_0x3c9ef4){if(_0x3c9ef4){return _0x47815e[_0x99a1('0x1a')](_0xe1a1f)['json'](_0x3c9ef4);}};}function respondWithFilteredResult(_0x2d81ed,_0x3e45d4){return function(_0x1bb464){if(_0x1bb464){var _0x3d40cc=typeof _0x3e45d4[_0x99a1('0x1c')]===_0x99a1('0x1d')&&typeof _0x3e45d4[_0x99a1('0x1e')]==='undefined';var _0x4f049c=_0x1bb464[_0x99a1('0x1f')];var _0xbf62f1=_0x3d40cc?0x0:_0x3e45d4[_0x99a1('0x1c')];var _0x1fcd00=_0x3d40cc?_0x1bb464[_0x99a1('0x1f')]:_0x3e45d4[_0x99a1('0x1c')]+_0x3e45d4[_0x99a1('0x1e')];var _0x3cd62c;if(_0x1fcd00>=_0x4f049c){_0x1fcd00=_0x4f049c;_0x3cd62c=0xc8;}else{_0x3cd62c=0xce;}_0x2d81ed[_0x99a1('0x1a')](_0x3cd62c);return _0x2d81ed[_0x99a1('0x20')](_0x99a1('0x21'),_0xbf62f1+'-'+_0x1fcd00+'/'+_0x4f049c)['json'](_0x1bb464);}return null;};}function patchUpdates(_0x3023a1){return function(_0x20007e){try{jsonpatch['apply'](_0x20007e,_0x3023a1,!![]);}catch(_0x38435b){return BPromise['reject'](_0x38435b);}return _0x20007e[_0x99a1('0x22')]();};}function saveUpdates(_0x2927b0,_0x2d6f20){return function(_0x2d3b82){if(_0x2d3b82){return _0x2d3b82['update'](_0x2927b0)[_0x99a1('0x23')](function(_0x1268a7){return _0x1268a7;});}return null;};}function removeEntity(_0x483c17,_0x44df2d){return function(_0x5b5dfa){if(_0x5b5dfa){return _0x5b5dfa[_0x99a1('0x24')]()[_0x99a1('0x23')](function(){var _0x179597=_0x5b5dfa[_0x99a1('0x25')]({'plain':!![]});var _0x3c813=_0x99a1('0x26');return db['UserProfileResource'][_0x99a1('0x24')]({'where':{'type':_0x3c813,'resourceId':_0x179597['id']}})['then'](function(){return _0x5b5dfa;});})['then'](function(){_0x483c17[_0x99a1('0x1a')](0xcc)[_0x99a1('0x1b')]();});}};}function handleEntityNotFound(_0xa6799b,_0x15a0b6){return function(_0x25d560){if(!_0x25d560){_0xa6799b[_0x99a1('0x19')](0x194);}return _0x25d560;};}function handleError(_0x183037,_0x549645){_0x549645=_0x549645||0x1f4;return function(_0xf41b0d){logger['error'](_0xf41b0d[_0x99a1('0x27')]);if(_0xf41b0d[_0x99a1('0x28')]){delete _0xf41b0d[_0x99a1('0x28')];}_0x183037['status'](_0x549645)[_0x99a1('0x29')](_0xf41b0d);};}exports[_0x99a1('0x2a')]=function(_0x5718b9,_0x37514e){var _0x1434a0={},_0x36aa34={},_0x303d1e={'count':0x0,'rows':[]};var _0x2a5b8c=_[_0x99a1('0x2b')](db[_0x99a1('0x2c')][_0x99a1('0x2d')],function(_0x52da8d){return{'name':_0x52da8d['fieldName'],'type':_0x52da8d[_0x99a1('0x2e')]['key']};});_0x36aa34[_0x99a1('0x2f')]=_[_0x99a1('0x2b')](_0x2a5b8c,'name');_0x36aa34[_0x99a1('0x30')]=_[_0x99a1('0x31')](_0x5718b9[_0x99a1('0x30')]);_0x36aa34[_0x99a1('0x32')]=_[_0x99a1('0x33')](_0x36aa34[_0x99a1('0x2f')],_0x36aa34[_0x99a1('0x30')]);_0x1434a0[_0x99a1('0x34')]=_[_0x99a1('0x33')](_0x36aa34[_0x99a1('0x2f')],qs[_0x99a1('0x35')](_0x5718b9[_0x99a1('0x30')][_0x99a1('0x35')]));_0x1434a0[_0x99a1('0x34')]=_0x1434a0['attributes']['length']?_0x1434a0[_0x99a1('0x34')]:_0x36aa34[_0x99a1('0x2f')];if(!_0x5718b9[_0x99a1('0x30')][_0x99a1('0x36')](_0x99a1('0x37'))){_0x1434a0[_0x99a1('0x1e')]=qs[_0x99a1('0x1e')](_0x5718b9['query'][_0x99a1('0x1e')]);_0x1434a0[_0x99a1('0x1c')]=qs['offset'](_0x5718b9[_0x99a1('0x30')][_0x99a1('0x1c')]);}_0x1434a0[_0x99a1('0x38')]=qs[_0x99a1('0x39')](_0x5718b9[_0x99a1('0x30')][_0x99a1('0x39')]);_0x1434a0[_0x99a1('0x3a')]=qs[_0x99a1('0x32')](_[_0x99a1('0x3b')](_0x5718b9[_0x99a1('0x30')],_0x36aa34[_0x99a1('0x32')]),_0x2a5b8c);if(_0x5718b9[_0x99a1('0x30')][_0x99a1('0x3c')]){_0x1434a0['where']=_['merge'](_0x1434a0['where'],{'$or':_[_0x99a1('0x2b')](_0x2a5b8c,function(_0x169df7){if(_0x169df7[_0x99a1('0x2e')]!==_0x99a1('0x3d')){var _0x40613a={};_0x40613a[_0x169df7['name']]={'$like':'%'+_0x5718b9[_0x99a1('0x30')][_0x99a1('0x3c')]+'%'};return _0x40613a;}})});}_0x1434a0=_[_0x99a1('0x3e')]({},_0x1434a0,_0x5718b9['options']);var _0x49be37={'where':_0x1434a0[_0x99a1('0x3a')]};return db[_0x99a1('0x2c')][_0x99a1('0x1f')](_0x49be37)['then'](function(_0x6c4cb){_0x303d1e[_0x99a1('0x1f')]=_0x6c4cb;if(_0x5718b9[_0x99a1('0x30')][_0x99a1('0x3f')]){_0x1434a0[_0x99a1('0x40')]=[{'all':!![]}];}return db[_0x99a1('0x2c')][_0x99a1('0x41')](_0x1434a0);})[_0x99a1('0x23')](function(_0x1c4ce4){_0x303d1e[_0x99a1('0x42')]=_0x1c4ce4;return _0x303d1e;})['then'](respondWithFilteredResult(_0x37514e,_0x1434a0))[_0x99a1('0x43')](handleError(_0x37514e,null));};exports[_0x99a1('0x44')]=function(_0x3d5373,_0x50d38b){var _0x1beed2={'raw':!![],'where':{'id':_0x3d5373[_0x99a1('0x45')]['id']}},_0x51536d={};_0x51536d[_0x99a1('0x2f')]=_[_0x99a1('0x31')](db[_0x99a1('0x2c')][_0x99a1('0x2d')]);_0x51536d[_0x99a1('0x30')]=_['keys'](_0x3d5373[_0x99a1('0x30')]);_0x51536d['filters']=_[_0x99a1('0x33')](_0x51536d[_0x99a1('0x2f')],_0x51536d[_0x99a1('0x30')]);_0x1beed2[_0x99a1('0x34')]=_[_0x99a1('0x33')](_0x51536d[_0x99a1('0x2f')],qs[_0x99a1('0x35')](_0x3d5373[_0x99a1('0x30')][_0x99a1('0x35')]));_0x1beed2[_0x99a1('0x34')]=_0x1beed2[_0x99a1('0x34')]['length']?_0x1beed2[_0x99a1('0x34')]:_0x51536d[_0x99a1('0x2f')];if(_0x3d5373['query'][_0x99a1('0x3f')]){_0x1beed2[_0x99a1('0x40')]=[{'all':!![]}];}_0x1beed2=_[_0x99a1('0x3e')]({},_0x1beed2,_0x3d5373[_0x99a1('0x46')]);return db[_0x99a1('0x2c')][_0x99a1('0x47')](_0x1beed2)[_0x99a1('0x23')](handleEntityNotFound(_0x50d38b,null))['then'](respondWithResult(_0x50d38b,null))[_0x99a1('0x43')](handleError(_0x50d38b,null));};exports['create']=function(_0x1d4d3f,_0x269798){return db['AnalyticMetric']['create'](_0x1d4d3f[_0x99a1('0x48')],{})[_0x99a1('0x23')](function(_0x462c15){var _0x4519fb=_0x1d4d3f[_0x99a1('0x49')]['get']({'plain':!![]});if(!_0x4519fb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4519fb['role']===_0x99a1('0x49')){var _0x4ae90e=_0x462c15[_0x99a1('0x25')]({'plain':!![]});var _0x30fdfb=_0x99a1('0x26');return db[_0x99a1('0x4a')][_0x99a1('0x47')]({'where':{'name':_0x30fdfb,'userProfileId':_0x4519fb['userProfileId']},'raw':!![]})[_0x99a1('0x23')](function(_0x22bfd8){if(_0x22bfd8&&_0x22bfd8[_0x99a1('0x4b')]===0x0){return db['UserProfileResource'][_0x99a1('0x4c')]({'name':_0x4ae90e['name'],'resourceId':_0x4ae90e['id'],'type':_0x22bfd8['name'],'sectionId':_0x22bfd8['id']},{})[_0x99a1('0x23')](function(){return _0x462c15;});}else{return _0x462c15;}})[_0x99a1('0x43')](function(_0x1dd17b){logger[_0x99a1('0x4d')](_0x99a1('0x4e'),_0x1dd17b);throw _0x1dd17b;});}return _0x462c15;})[_0x99a1('0x23')](respondWithResult(_0x269798,0xc9))[_0x99a1('0x43')](handleError(_0x269798,null));};exports[_0x99a1('0x4f')]=function(_0x16641e,_0x53e9eb){if(_0x16641e[_0x99a1('0x48')]['id']){delete _0x16641e['body']['id'];}return db[_0x99a1('0x2c')][_0x99a1('0x47')]({'where':{'id':_0x16641e['params']['id']}})[_0x99a1('0x23')](handleEntityNotFound(_0x53e9eb,null))[_0x99a1('0x23')](saveUpdates(_0x16641e[_0x99a1('0x48')],null))[_0x99a1('0x23')](respondWithResult(_0x53e9eb,null))[_0x99a1('0x43')](handleError(_0x53e9eb,null));};exports[_0x99a1('0x24')]=function(_0x157c49,_0x1a5658){return db[_0x99a1('0x2c')][_0x99a1('0x47')]({'where':{'id':_0x157c49[_0x99a1('0x45')]['id']}})[_0x99a1('0x23')](handleEntityNotFound(_0x1a5658,null))['then'](removeEntity(_0x1a5658,null))['catch'](handleError(_0x1a5658,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index 5156e2d..ccf12a7 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 _0x0689=['define','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticMetric.attributes','exports'];(function(_0xe66cf2,_0x32ba5f){var _0x2d84e7=function(_0x58a7d8){while(--_0x58a7d8){_0xe66cf2['push'](_0xe66cf2['shift']());}};_0x2d84e7(++_0x32ba5f);}(_0x0689,0x161));var _0x9068=function(_0x1abfc4,_0x1e1298){_0x1abfc4=_0x1abfc4-0x0;var _0x1e6a3e=_0x0689[_0x1abfc4];return _0x1e6a3e;};'use strict';var _=require('lodash');var util=require(_0x9068('0x0'));var logger=require('../../config/logger')(_0x9068('0x1'));var moment=require(_0x9068('0x2'));var BPromise=require(_0x9068('0x3'));var rp=require(_0x9068('0x4'));var fs=require('fs');var path=require(_0x9068('0x5'));var rimraf=require(_0x9068('0x6'));var config=require(_0x9068('0x7'));var attributes=require(_0x9068('0x8'));module[_0x9068('0x9')]=function(_0x287846,_0x5ce5a7){return _0x287846[_0x9068('0xa')]('AnalyticMetric',attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0d91=['analytics_metrics','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./analyticMetric.attributes','exports','define','AnalyticMetric'];(function(_0x6caff4,_0x480025){var _0x358739=function(_0x2839ef){while(--_0x2839ef){_0x6caff4['push'](_0x6caff4['shift']());}};_0x358739(++_0x480025);}(_0x0d91,0x76));var _0x10d9=function(_0x57746e,_0x45093f){_0x57746e=_0x57746e-0x0;var _0x5caeaa=_0x0d91[_0x57746e];return _0x5caeaa;};'use strict';var _=require(_0x10d9('0x0'));var util=require(_0x10d9('0x1'));var logger=require(_0x10d9('0x2'))(_0x10d9('0x3'));var moment=require('moment');var BPromise=require(_0x10d9('0x4'));var rp=require(_0x10d9('0x5'));var fs=require('fs');var path=require(_0x10d9('0x6'));var rimraf=require('rimraf');var config=require(_0x10d9('0x7'));var attributes=require(_0x10d9('0x8'));module[_0x10d9('0x9')]=function(_0x4d89f0,_0x3cc578){return _0x4d89f0[_0x10d9('0xa')](_0x10d9('0xb'),attributes,{'tableName':_0x10d9('0xc'),'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 ebc3a40..b7b87a4 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 _0x9f66=['info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x547030,_0x5ac365){var _0x20dd29=function(_0x138efd){while(--_0x138efd){_0x547030['push'](_0x547030['shift']());}};_0x20dd29(++_0x5ac365);}(_0x9f66,0x1be));var _0x69f6=function(_0x28150d,_0x276ffa){_0x28150d=_0x28150d-0x0;var _0x52fd33=_0x9f66[_0x28150d];return _0x52fd33;};'use strict';var _=require(_0x69f6('0x0'));var util=require(_0x69f6('0x1'));var moment=require(_0x69f6('0x2'));var BPromise=require(_0x69f6('0x3'));var rs=require(_0x69f6('0x4'));var fs=require('fs');var Redis=require(_0x69f6('0x5'));var db=require(_0x69f6('0x6'))['db'];var utils=require(_0x69f6('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x69f6('0x8'));var jayson=require(_0x69f6('0x9'));var client=jayson[_0x69f6('0xa')][_0x69f6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x9bc56e,_0x3b8a76,_0x43fb93){return new BPromise(function(_0x39757e,_0x2b62e5){return client[_0x69f6('0xc')](_0x9bc56e,_0x43fb93)[_0x69f6('0xd')](function(_0x38b147){logger[_0x69f6('0xe')](_0x69f6('0xf'),_0x3b8a76,_0x69f6('0x10'));logger['debug'](_0x69f6('0x11'),_0x3b8a76,_0x69f6('0x10'),JSON[_0x69f6('0x12')](_0x38b147));if(_0x38b147[_0x69f6('0x13')]){if(_0x38b147[_0x69f6('0x13')]['code']===0x1f4){logger[_0x69f6('0x13')](_0x69f6('0xf'),_0x3b8a76,_0x38b147['error']['message']);return _0x2b62e5(_0x38b147['error'][_0x69f6('0x14')]);}logger[_0x69f6('0x13')](_0x69f6('0xf'),_0x3b8a76,_0x38b147[_0x69f6('0x13')][_0x69f6('0x14')]);return _0x39757e(_0x38b147['error'][_0x69f6('0x14')]);}else{logger[_0x69f6('0xe')](_0x69f6('0xf'),_0x3b8a76,'request\x20sent');_0x39757e(_0x38b147[_0x69f6('0x15')]['message']);}})[_0x69f6('0x16')](function(_0x54a435){logger['error'](_0x69f6('0xf'),_0x3b8a76,_0x54a435);_0x2b62e5(_0x54a435);});});} \ No newline at end of file +var _0x9486=['result','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9486,0xd2));var _0x6948=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9486[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x6948('0x0'));var util=require(_0x6948('0x1'));var moment=require(_0x6948('0x2'));var BPromise=require(_0x6948('0x3'));var rs=require(_0x6948('0x4'));var fs=require('fs');var Redis=require(_0x6948('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x6948('0x6'));var logger=require('../../config/logger')(_0x6948('0x7'));var config=require(_0x6948('0x8'));var jayson=require(_0x6948('0x9'));var client=jayson[_0x6948('0xa')][_0x6948('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x803c27,_0x16b95c,_0x322192){return new BPromise(function(_0x54c0bf,_0xc3fce6){return client['request'](_0x803c27,_0x322192)[_0x6948('0xc')](function(_0x38d599){logger[_0x6948('0xd')](_0x6948('0xe'),_0x16b95c,_0x6948('0xf'));logger[_0x6948('0x10')](_0x6948('0x11'),_0x16b95c,_0x6948('0xf'),JSON['stringify'](_0x38d599));if(_0x38d599[_0x6948('0x12')]){if(_0x38d599['error'][_0x6948('0x13')]===0x1f4){logger['error'](_0x6948('0xe'),_0x16b95c,_0x38d599[_0x6948('0x12')]['message']);return _0xc3fce6(_0x38d599[_0x6948('0x12')]['message']);}logger[_0x6948('0x12')](_0x6948('0xe'),_0x16b95c,_0x38d599[_0x6948('0x12')]['message']);return _0x54c0bf(_0x38d599['error']['message']);}else{logger[_0x6948('0xd')](_0x6948('0xe'),_0x16b95c,_0x6948('0xf'));_0x54c0bf(_0x38d599[_0x6948('0x14')][_0x6948('0x15')]);}})[_0x6948('0x16')](function(_0x14f224){logger['error'](_0x6948('0xe'),_0x16b95c,_0x14f224);_0xc3fce6(_0x14f224);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index 84aee45..f8f05bf 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 _0xa23f=['fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','post','create','put','/:id','delete','exports','multer','util','express','Router'];(function(_0x150d4a,_0x2ee3d8){var _0x1d31ec=function(_0x4a794a){while(--_0x4a794a){_0x150d4a['push'](_0x150d4a['shift']());}};_0x1d31ec(++_0x2ee3d8);}(_0xa23f,0x7c));var _0xfa23=function(_0x59e068,_0x8ce760){_0x59e068=_0x59e068-0x0;var _0x1a7f9e=_0xa23f[_0x59e068];return _0x1a7f9e;};'use strict';var multer=require(_0xfa23('0x0'));var util=require(_0xfa23('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xfa23('0x2'));var router=express[_0xfa23('0x3')]();var fs_extra=require(_0xfa23('0x4'));var auth=require(_0xfa23('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xfa23('0x6'));var controller=require('./analyticMetric.controller');router[_0xfa23('0x7')]('/',auth[_0xfa23('0x8')](),controller[_0xfa23('0x9')]);router[_0xfa23('0x7')]('/:id',auth[_0xfa23('0x8')](),controller['show']);router[_0xfa23('0xa')]('/',auth[_0xfa23('0x8')](),controller[_0xfa23('0xb')]);router[_0xfa23('0xc')](_0xfa23('0xd'),auth['isAuthenticated'](),controller['update']);router[_0xfa23('0xe')]('/:id',auth[_0xfa23('0x8')](),controller['destroy']);module[_0xfa23('0xf')]=router; \ No newline at end of file +var _0xd7c3=['./analyticMetric.controller','get','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0xa5da3f,_0x5b2b0a){var _0x3b4916=function(_0x86ba90){while(--_0x86ba90){_0xa5da3f['push'](_0xa5da3f['shift']());}};_0x3b4916(++_0x5b2b0a);}(_0xd7c3,0x1c5));var _0x3d7c=function(_0x4dcf88,_0x220d82){_0x4dcf88=_0x4dcf88-0x0;var _0x64f0dc=_0xd7c3[_0x4dcf88];return _0x64f0dc;};'use strict';var multer=require(_0x3d7c('0x0'));var util=require(_0x3d7c('0x1'));var path=require(_0x3d7c('0x2'));var timeout=require(_0x3d7c('0x3'));var express=require(_0x3d7c('0x4'));var router=express[_0x3d7c('0x5')]();var fs_extra=require(_0x3d7c('0x6'));var auth=require(_0x3d7c('0x7'));var interaction=require(_0x3d7c('0x8'));var config=require('../../config/environment');var controller=require(_0x3d7c('0x9'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x3d7c('0xa')](_0x3d7c('0xb'),auth[_0x3d7c('0xc')](),controller[_0x3d7c('0xd')]);router[_0x3d7c('0xe')]('/',auth[_0x3d7c('0xc')](),controller[_0x3d7c('0xf')]);router[_0x3d7c('0x10')](_0x3d7c('0xb'),auth[_0x3d7c('0xc')](),controller[_0x3d7c('0x11')]);router[_0x3d7c('0x12')](_0x3d7c('0xb'),auth[_0x3d7c('0xc')](),controller[_0x3d7c('0x13')]);module[_0x3d7c('0x14')]=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index f61c294..c38e50f 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 _0x3bca=['sequelize','exports','TEXT'];(function(_0x42245d,_0x51758f){var _0x4b211a=function(_0x2634e){while(--_0x2634e){_0x42245d['push'](_0x42245d['shift']());}};_0x4b211a(++_0x51758f);}(_0x3bca,0x132));var _0xa3bc=function(_0x58927c,_0x47c5f0){_0x58927c=_0x58927c-0x0;var _0x1100c2=_0x3bca[_0x58927c];return _0x1100c2;};'use strict';var Sequelize=require(_0xa3bc('0x0'));module[_0xa3bc('0x1')]={'tree':{'type':Sequelize[_0xa3bc('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x6f28=['TEXT','sequelize','exports'];(function(_0xd059e9,_0x30db2a){var _0x8ec878=function(_0x2feb66){while(--_0x2feb66){_0xd059e9['push'](_0xd059e9['shift']());}};_0x8ec878(++_0x30db2a);}(_0x6f28,0x130));var _0x86f2=function(_0x152678,_0x11e0ac){_0x152678=_0x152678-0x0;var _0x311a9=_0x6f28[_0x152678];return _0x311a9;};'use strict';var Sequelize=require(_0x86f2('0x0'));module[_0x86f2('0x1')]={'tree':{'type':Sequelize[_0x86f2('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 ddd9165..66b6c0f 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 _0xb96b=['end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','stack','name','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','keys','filters','intersection','query','fields','attributes','length','model','hasOwnProperty','order','sort','where','pick','filter','merge','includeAll','include','findAll','rows','params','options','find','catch','create','body','eml-format','rimraf','zip-dir','bluebird','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/environment','../../mysqldb','sendStatus','status'];(function(_0x1b515f,_0x52aa6b){var _0x66ff73=function(_0x2cc081){while(--_0x2cc081){_0x1b515f['push'](_0x1b515f['shift']());}};_0x66ff73(++_0x52aa6b);}(_0xb96b,0xfd));var _0xbb96=function(_0x2d991c,_0x1583d4){_0x2d991c=_0x2d991c-0x0;var _0x3d5af5=_0xb96b[_0x2d991c];return _0x3d5af5;};'use strict';var emlformat=require(_0xbb96('0x0'));var rimraf=require(_0xbb96('0x1'));var zipdir=require(_0xbb96('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xbb96('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0xbb96('0x4'));var sox=require(_0xbb96('0x5'));var csv=require('to-csv');var ejs=require(_0xbb96('0x6'));var fs=require('fs');var fs_extra=require(_0xbb96('0x7'));var _=require(_0xbb96('0x8'));var squel=require(_0xbb96('0x9'));var crypto=require(_0xbb96('0xa'));var jsforce=require(_0xbb96('0xb'));var deskjs=require(_0xbb96('0xc'));var toCsv=require('to-csv');var querystring=require(_0xbb96('0xd'));var Papa=require(_0xbb96('0xe'));var Redis=require(_0xbb96('0xf'));var authService=require(_0xbb96('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xbb96('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xbb96('0x12'));var utils=require('../../config/utils');var config=require(_0xbb96('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xbb96('0x14'))['db'];function respondWithStatusCode(_0x50f376,_0x1369a1){_0x1369a1=_0x1369a1||0xcc;return function(_0x10462a){if(_0x10462a){return _0x50f376[_0xbb96('0x15')](_0x1369a1);}return _0x50f376[_0xbb96('0x16')](_0x1369a1)[_0xbb96('0x17')]();};}function respondWithResult(_0x154b6f,_0x7e0bf9){_0x7e0bf9=_0x7e0bf9||0xc8;return function(_0x238b7c){if(_0x238b7c){return _0x154b6f[_0xbb96('0x16')](_0x7e0bf9)[_0xbb96('0x18')](_0x238b7c);}};}function respondWithFilteredResult(_0x410ca0,_0x43b182){return function(_0x19855e){if(_0x19855e){var _0x8079c0=typeof _0x43b182[_0xbb96('0x19')]===_0xbb96('0x1a')&&typeof _0x43b182[_0xbb96('0x1b')]===_0xbb96('0x1a');var _0xf17f90=_0x19855e[_0xbb96('0x1c')];var _0x1703bb=_0x8079c0?0x0:_0x43b182[_0xbb96('0x19')];var _0x77d361=_0x8079c0?_0x19855e[_0xbb96('0x1c')]:_0x43b182[_0xbb96('0x19')]+_0x43b182[_0xbb96('0x1b')];var _0x273013;if(_0x77d361>=_0xf17f90){_0x77d361=_0xf17f90;_0x273013=0xc8;}else{_0x273013=0xce;}_0x410ca0[_0xbb96('0x16')](_0x273013);return _0x410ca0['set'](_0xbb96('0x1d'),_0x1703bb+'-'+_0x77d361+'/'+_0xf17f90)[_0xbb96('0x18')](_0x19855e);}return null;};}function patchUpdates(_0x2a5e9b){return function(_0x1ea65c){try{jsonpatch[_0xbb96('0x1e')](_0x1ea65c,_0x2a5e9b,!![]);}catch(_0x8da8d5){return BPromise[_0xbb96('0x1f')](_0x8da8d5);}return _0x1ea65c[_0xbb96('0x20')]();};}function saveUpdates(_0x574a7e,_0x49b16e){return function(_0x1adc62){if(_0x1adc62){return _0x1adc62[_0xbb96('0x21')](_0x574a7e)['then'](function(_0xeed2fa){return _0xeed2fa;});}return null;};}function removeEntity(_0x3748ec,_0x28ec20){return function(_0x4bd3f6){if(_0x4bd3f6){return _0x4bd3f6['destroy']()[_0xbb96('0x22')](function(){_0x3748ec[_0xbb96('0x16')](0xcc)[_0xbb96('0x17')]();});}};}function handleEntityNotFound(_0x32c5c7,_0xd78b3c){return function(_0x5a82e5){if(!_0x5a82e5){_0x32c5c7[_0xbb96('0x15')](0x194);}return _0x5a82e5;};}function handleError(_0x52280b,_0x31b124){_0x31b124=_0x31b124||0x1f4;return function(_0x4a9ca6){logger['error'](_0x4a9ca6[_0xbb96('0x23')]);if(_0x4a9ca6[_0xbb96('0x24')]){delete _0x4a9ca6['name'];}_0x52280b[_0xbb96('0x16')](_0x31b124)['send'](_0x4a9ca6);};}exports[_0xbb96('0x25')]=function(_0x4b8162,_0x4bb140){var _0xe18b22={},_0x55d7c9={},_0x102119={'count':0x0,'rows':[]};var _0x5d9e8f=_[_0xbb96('0x26')](db[_0xbb96('0x27')][_0xbb96('0x28')],function(_0x49fdae){return{'name':_0x49fdae[_0xbb96('0x29')],'type':_0x49fdae[_0xbb96('0x2a')][_0xbb96('0x2b')]};});_0x55d7c9['model']=_[_0xbb96('0x26')](_0x5d9e8f,_0xbb96('0x24'));_0x55d7c9['query']=_[_0xbb96('0x2c')](_0x4b8162['query']);_0x55d7c9[_0xbb96('0x2d')]=_[_0xbb96('0x2e')](_0x55d7c9['model'],_0x55d7c9[_0xbb96('0x2f')]);_0xe18b22['attributes']=_[_0xbb96('0x2e')](_0x55d7c9['model'],qs[_0xbb96('0x30')](_0x4b8162['query'][_0xbb96('0x30')]));_0xe18b22[_0xbb96('0x31')]=_0xe18b22[_0xbb96('0x31')][_0xbb96('0x32')]?_0xe18b22['attributes']:_0x55d7c9[_0xbb96('0x33')];if(!_0x4b8162[_0xbb96('0x2f')][_0xbb96('0x34')]('nolimit')){_0xe18b22['limit']=qs['limit'](_0x4b8162[_0xbb96('0x2f')][_0xbb96('0x1b')]);_0xe18b22[_0xbb96('0x19')]=qs[_0xbb96('0x19')](_0x4b8162[_0xbb96('0x2f')][_0xbb96('0x19')]);}_0xe18b22[_0xbb96('0x35')]=qs[_0xbb96('0x36')](_0x4b8162[_0xbb96('0x2f')]['sort']);_0xe18b22[_0xbb96('0x37')]=qs['filters'](_[_0xbb96('0x38')](_0x4b8162['query'],_0x55d7c9[_0xbb96('0x2d')]),_0x5d9e8f);if(_0x4b8162[_0xbb96('0x2f')][_0xbb96('0x39')]){_0xe18b22[_0xbb96('0x37')]=_[_0xbb96('0x3a')](_0xe18b22[_0xbb96('0x37')],{'$or':_[_0xbb96('0x26')](_0x5d9e8f,function(_0xb8d1d){if(_0xb8d1d['type']!=='VIRTUAL'){var _0x148f8c={};_0x148f8c[_0xb8d1d[_0xbb96('0x24')]]={'$like':'%'+_0x4b8162[_0xbb96('0x2f')][_0xbb96('0x39')]+'%'};return _0x148f8c;}})});}_0xe18b22=_['merge']({},_0xe18b22,_0x4b8162['options']);var _0x16aa03={'where':_0xe18b22[_0xbb96('0x37')]};return db[_0xbb96('0x27')][_0xbb96('0x1c')](_0x16aa03)[_0xbb96('0x22')](function(_0x49cea0){_0x102119[_0xbb96('0x1c')]=_0x49cea0;if(_0x4b8162[_0xbb96('0x2f')][_0xbb96('0x3b')]){_0xe18b22[_0xbb96('0x3c')]=[{'all':!![]}];}return db[_0xbb96('0x27')][_0xbb96('0x3d')](_0xe18b22);})[_0xbb96('0x22')](function(_0x5bcaf6){_0x102119[_0xbb96('0x3e')]=_0x5bcaf6;return _0x102119;})[_0xbb96('0x22')](respondWithFilteredResult(_0x4bb140,_0xe18b22))['catch'](handleError(_0x4bb140,null));};exports['show']=function(_0xdaa1e1,_0x1a6dc1){var _0x147414={'raw':!![],'where':{'id':_0xdaa1e1[_0xbb96('0x3f')]['id']}},_0x3fe0d5={};_0x3fe0d5['model']=_[_0xbb96('0x2c')](db[_0xbb96('0x27')][_0xbb96('0x28')]);_0x3fe0d5['query']=_[_0xbb96('0x2c')](_0xdaa1e1[_0xbb96('0x2f')]);_0x3fe0d5['filters']=_['intersection'](_0x3fe0d5[_0xbb96('0x33')],_0x3fe0d5[_0xbb96('0x2f')]);_0x147414[_0xbb96('0x31')]=_[_0xbb96('0x2e')](_0x3fe0d5[_0xbb96('0x33')],qs[_0xbb96('0x30')](_0xdaa1e1[_0xbb96('0x2f')]['fields']));_0x147414[_0xbb96('0x31')]=_0x147414[_0xbb96('0x31')][_0xbb96('0x32')]?_0x147414[_0xbb96('0x31')]:_0x3fe0d5[_0xbb96('0x33')];if(_0xdaa1e1[_0xbb96('0x2f')]['includeAll']){_0x147414[_0xbb96('0x3c')]=[{'all':!![]}];}_0x147414=_['merge']({},_0x147414,_0xdaa1e1[_0xbb96('0x40')]);return db['AnalyticTreeReport'][_0xbb96('0x41')](_0x147414)[_0xbb96('0x22')](handleEntityNotFound(_0x1a6dc1,null))[_0xbb96('0x22')](respondWithResult(_0x1a6dc1,null))[_0xbb96('0x42')](handleError(_0x1a6dc1,null));};exports['create']=function(_0x1d7c35,_0x4dd29f){return db['AnalyticTreeReport'][_0xbb96('0x43')](_0x1d7c35[_0xbb96('0x44')],{})[_0xbb96('0x22')](respondWithResult(_0x4dd29f,0xc9))[_0xbb96('0x42')](handleError(_0x4dd29f,null));};exports[_0xbb96('0x21')]=function(_0x2f52a4,_0x2fb24e){if(_0x2f52a4['body']['id']){delete _0x2f52a4[_0xbb96('0x44')]['id'];}return db[_0xbb96('0x27')][_0xbb96('0x41')]({'where':{'id':_0x2f52a4['params']['id']}})[_0xbb96('0x22')](handleEntityNotFound(_0x2fb24e,null))['then'](saveUpdates(_0x2f52a4[_0xbb96('0x44')],null))[_0xbb96('0x22')](respondWithResult(_0x2fb24e,null))[_0xbb96('0x42')](handleError(_0x2fb24e,null));};exports['destroy']=function(_0x298a54,_0x2afb01){return db[_0xbb96('0x27')][_0xbb96('0x41')]({'where':{'id':_0x298a54['params']['id']}})['then'](handleEntityNotFound(_0x2afb01,null))['then'](removeEntity(_0x2afb01,null))[_0xbb96('0x42')](handleError(_0x2afb01,null));}; \ No newline at end of file +var _0xeaf7=['json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','end','error','name','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','include','findAll','rows','show','params','keys','includeAll','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x28600d,_0x1cce36){var _0x439f97=function(_0x32d000){while(--_0x32d000){_0x28600d['push'](_0x28600d['shift']());}};_0x439f97(++_0x1cce36);}(_0xeaf7,0x173));var _0x7eaf=function(_0x23f8d8,_0x3da4c7){_0x23f8d8=_0x23f8d8-0x0;var _0x43e485=_0xeaf7[_0x23f8d8];return _0x43e485;};'use strict';var emlformat=require(_0x7eaf('0x0'));var rimraf=require(_0x7eaf('0x1'));var zipdir=require(_0x7eaf('0x2'));var jsonpatch=require(_0x7eaf('0x3'));var rp=require(_0x7eaf('0x4'));var moment=require(_0x7eaf('0x5'));var BPromise=require(_0x7eaf('0x6'));var Mustache=require(_0x7eaf('0x7'));var util=require(_0x7eaf('0x8'));var path=require(_0x7eaf('0x9'));var sox=require(_0x7eaf('0xa'));var csv=require(_0x7eaf('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7eaf('0xc'));var _=require('lodash');var squel=require(_0x7eaf('0xd'));var crypto=require(_0x7eaf('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x7eaf('0xf'));var toCsv=require(_0x7eaf('0xb'));var querystring=require(_0x7eaf('0x10'));var Papa=require(_0x7eaf('0x11'));var Redis=require(_0x7eaf('0x12'));var authService=require(_0x7eaf('0x13'));var qs=require(_0x7eaf('0x14'));var as=require(_0x7eaf('0x15'));var hardwareService=require(_0x7eaf('0x16'));var logger=require(_0x7eaf('0x17'))('api');var utils=require(_0x7eaf('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7eaf('0x19'));var db=require(_0x7eaf('0x1a'))['db'];function respondWithStatusCode(_0x583cd7,_0x152851){_0x152851=_0x152851||0xcc;return function(_0x134049){if(_0x134049){return _0x583cd7[_0x7eaf('0x1b')](_0x152851);}return _0x583cd7[_0x7eaf('0x1c')](_0x152851)['end']();};}function respondWithResult(_0x422acc,_0x383022){_0x383022=_0x383022||0xc8;return function(_0x197260){if(_0x197260){return _0x422acc[_0x7eaf('0x1c')](_0x383022)[_0x7eaf('0x1d')](_0x197260);}};}function respondWithFilteredResult(_0xa5f8da,_0x50b226){return function(_0x1a6efe){if(_0x1a6efe){var _0x37d9b8=typeof _0x50b226[_0x7eaf('0x1e')]===_0x7eaf('0x1f')&&typeof _0x50b226[_0x7eaf('0x20')]===_0x7eaf('0x1f');var _0xc1c1ca=_0x1a6efe[_0x7eaf('0x21')];var _0x4b77d5=_0x37d9b8?0x0:_0x50b226['offset'];var _0x3239e2=_0x37d9b8?_0x1a6efe[_0x7eaf('0x21')]:_0x50b226['offset']+_0x50b226['limit'];var _0x151f9d;if(_0x3239e2>=_0xc1c1ca){_0x3239e2=_0xc1c1ca;_0x151f9d=0xc8;}else{_0x151f9d=0xce;}_0xa5f8da['status'](_0x151f9d);return _0xa5f8da[_0x7eaf('0x22')](_0x7eaf('0x23'),_0x4b77d5+'-'+_0x3239e2+'/'+_0xc1c1ca)[_0x7eaf('0x1d')](_0x1a6efe);}return null;};}function patchUpdates(_0x57890b){return function(_0x51fcbf){try{jsonpatch['apply'](_0x51fcbf,_0x57890b,!![]);}catch(_0x15fbad){return BPromise[_0x7eaf('0x24')](_0x15fbad);}return _0x51fcbf[_0x7eaf('0x25')]();};}function saveUpdates(_0x4fd9cf,_0x42b3c8){return function(_0xa677aa){if(_0xa677aa){return _0xa677aa[_0x7eaf('0x26')](_0x4fd9cf)[_0x7eaf('0x27')](function(_0x2e8f5e){return _0x2e8f5e;});}return null;};}function removeEntity(_0x185e67,_0x38cfcc){return function(_0xf7071f){if(_0xf7071f){return _0xf7071f[_0x7eaf('0x28')]()[_0x7eaf('0x27')](function(){_0x185e67[_0x7eaf('0x1c')](0xcc)[_0x7eaf('0x29')]();});}};}function handleEntityNotFound(_0x41b45b,_0x146b0b){return function(_0x26ee8a){if(!_0x26ee8a){_0x41b45b[_0x7eaf('0x1b')](0x194);}return _0x26ee8a;};}function handleError(_0x4f9fbf,_0x3b0480){_0x3b0480=_0x3b0480||0x1f4;return function(_0x5eafa9){logger[_0x7eaf('0x2a')](_0x5eafa9['stack']);if(_0x5eafa9[_0x7eaf('0x2b')]){delete _0x5eafa9[_0x7eaf('0x2b')];}_0x4f9fbf[_0x7eaf('0x1c')](_0x3b0480)[_0x7eaf('0x2c')](_0x5eafa9);};}exports[_0x7eaf('0x2d')]=function(_0x548792,_0x2623d0){var _0x5ba9ff={},_0x28ae02={},_0x29446c={'count':0x0,'rows':[]};var _0x3fec26=_[_0x7eaf('0x2e')](db[_0x7eaf('0x2f')][_0x7eaf('0x30')],function(_0x32a95d){return{'name':_0x32a95d[_0x7eaf('0x31')],'type':_0x32a95d['type'][_0x7eaf('0x32')]};});_0x28ae02[_0x7eaf('0x33')]=_[_0x7eaf('0x2e')](_0x3fec26,_0x7eaf('0x2b'));_0x28ae02[_0x7eaf('0x34')]=_['keys'](_0x548792[_0x7eaf('0x34')]);_0x28ae02[_0x7eaf('0x35')]=_[_0x7eaf('0x36')](_0x28ae02[_0x7eaf('0x33')],_0x28ae02[_0x7eaf('0x34')]);_0x5ba9ff[_0x7eaf('0x37')]=_['intersection'](_0x28ae02[_0x7eaf('0x33')],qs[_0x7eaf('0x38')](_0x548792[_0x7eaf('0x34')]['fields']));_0x5ba9ff['attributes']=_0x5ba9ff['attributes'][_0x7eaf('0x39')]?_0x5ba9ff[_0x7eaf('0x37')]:_0x28ae02[_0x7eaf('0x33')];if(!_0x548792[_0x7eaf('0x34')][_0x7eaf('0x3a')](_0x7eaf('0x3b'))){_0x5ba9ff[_0x7eaf('0x20')]=qs['limit'](_0x548792[_0x7eaf('0x34')][_0x7eaf('0x20')]);_0x5ba9ff[_0x7eaf('0x1e')]=qs[_0x7eaf('0x1e')](_0x548792[_0x7eaf('0x34')][_0x7eaf('0x1e')]);}_0x5ba9ff[_0x7eaf('0x3c')]=qs[_0x7eaf('0x3d')](_0x548792[_0x7eaf('0x34')][_0x7eaf('0x3d')]);_0x5ba9ff[_0x7eaf('0x3e')]=qs[_0x7eaf('0x35')](_[_0x7eaf('0x3f')](_0x548792[_0x7eaf('0x34')],_0x28ae02[_0x7eaf('0x35')]),_0x3fec26);if(_0x548792['query'][_0x7eaf('0x40')]){_0x5ba9ff['where']=_[_0x7eaf('0x41')](_0x5ba9ff['where'],{'$or':_['map'](_0x3fec26,function(_0x5dd6f5){if(_0x5dd6f5[_0x7eaf('0x42')]!==_0x7eaf('0x43')){var _0x20578c={};_0x20578c[_0x5dd6f5[_0x7eaf('0x2b')]]={'$like':'%'+_0x548792['query'][_0x7eaf('0x40')]+'%'};return _0x20578c;}})});}_0x5ba9ff=_[_0x7eaf('0x41')]({},_0x5ba9ff,_0x548792[_0x7eaf('0x44')]);var _0x3d63ab={'where':_0x5ba9ff[_0x7eaf('0x3e')]};return db[_0x7eaf('0x2f')][_0x7eaf('0x21')](_0x3d63ab)[_0x7eaf('0x27')](function(_0x1b29cc){_0x29446c[_0x7eaf('0x21')]=_0x1b29cc;if(_0x548792[_0x7eaf('0x34')]['includeAll']){_0x5ba9ff[_0x7eaf('0x45')]=[{'all':!![]}];}return db[_0x7eaf('0x2f')][_0x7eaf('0x46')](_0x5ba9ff);})[_0x7eaf('0x27')](function(_0x158b94){_0x29446c[_0x7eaf('0x47')]=_0x158b94;return _0x29446c;})[_0x7eaf('0x27')](respondWithFilteredResult(_0x2623d0,_0x5ba9ff))['catch'](handleError(_0x2623d0,null));};exports[_0x7eaf('0x48')]=function(_0x53ae2f,_0x355205){var _0x3063bf={'raw':!![],'where':{'id':_0x53ae2f[_0x7eaf('0x49')]['id']}},_0x5b3843={};_0x5b3843[_0x7eaf('0x33')]=_[_0x7eaf('0x4a')](db['AnalyticTreeReport'][_0x7eaf('0x30')]);_0x5b3843[_0x7eaf('0x34')]=_['keys'](_0x53ae2f[_0x7eaf('0x34')]);_0x5b3843[_0x7eaf('0x35')]=_[_0x7eaf('0x36')](_0x5b3843[_0x7eaf('0x33')],_0x5b3843[_0x7eaf('0x34')]);_0x3063bf['attributes']=_[_0x7eaf('0x36')](_0x5b3843[_0x7eaf('0x33')],qs[_0x7eaf('0x38')](_0x53ae2f[_0x7eaf('0x34')][_0x7eaf('0x38')]));_0x3063bf['attributes']=_0x3063bf[_0x7eaf('0x37')][_0x7eaf('0x39')]?_0x3063bf[_0x7eaf('0x37')]:_0x5b3843[_0x7eaf('0x33')];if(_0x53ae2f[_0x7eaf('0x34')][_0x7eaf('0x4b')]){_0x3063bf[_0x7eaf('0x45')]=[{'all':!![]}];}_0x3063bf=_[_0x7eaf('0x41')]({},_0x3063bf,_0x53ae2f[_0x7eaf('0x44')]);return db[_0x7eaf('0x2f')][_0x7eaf('0x4c')](_0x3063bf)[_0x7eaf('0x27')](handleEntityNotFound(_0x355205,null))[_0x7eaf('0x27')](respondWithResult(_0x355205,null))[_0x7eaf('0x4d')](handleError(_0x355205,null));};exports[_0x7eaf('0x4e')]=function(_0x179576,_0x3d8288){return db[_0x7eaf('0x2f')][_0x7eaf('0x4e')](_0x179576[_0x7eaf('0x4f')],{})[_0x7eaf('0x27')](respondWithResult(_0x3d8288,0xc9))['catch'](handleError(_0x3d8288,null));};exports[_0x7eaf('0x26')]=function(_0x5969b6,_0x10d63b){if(_0x5969b6[_0x7eaf('0x4f')]['id']){delete _0x5969b6[_0x7eaf('0x4f')]['id'];}return db[_0x7eaf('0x2f')][_0x7eaf('0x4c')]({'where':{'id':_0x5969b6[_0x7eaf('0x49')]['id']}})[_0x7eaf('0x27')](handleEntityNotFound(_0x10d63b,null))['then'](saveUpdates(_0x5969b6['body'],null))[_0x7eaf('0x27')](respondWithResult(_0x10d63b,null))[_0x7eaf('0x4d')](handleError(_0x10d63b,null));};exports[_0x7eaf('0x28')]=function(_0x2e86b1,_0x121bab){return db[_0x7eaf('0x2f')][_0x7eaf('0x4c')]({'where':{'id':_0x2e86b1[_0x7eaf('0x49')]['id']}})[_0x7eaf('0x27')](handleEntityNotFound(_0x121bab,null))['then'](removeEntity(_0x121bab,null))[_0x7eaf('0x4d')](handleError(_0x121bab,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index 3b60112..79ed49f 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 _0xe3bd=['request-promise','path','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','AnalyticTreeReport','analytics_report_trees','util','../../config/logger','moment'];(function(_0x360cf1,_0x3c9321){var _0x1d1c80=function(_0x295473){while(--_0x295473){_0x360cf1['push'](_0x360cf1['shift']());}};_0x1d1c80(++_0x3c9321);}(_0xe3bd,0x19f));var _0xde3b=function(_0x4551f6,_0x48151b){_0x4551f6=_0x4551f6-0x0;var _0x581dc2=_0xe3bd[_0x4551f6];return _0x581dc2;};'use strict';var _=require('lodash');var util=require(_0xde3b('0x0'));var logger=require(_0xde3b('0x1'))('api');var moment=require(_0xde3b('0x2'));var BPromise=require('bluebird');var rp=require(_0xde3b('0x3'));var fs=require('fs');var path=require(_0xde3b('0x4'));var rimraf=require(_0xde3b('0x5'));var config=require(_0xde3b('0x6'));var attributes=require(_0xde3b('0x7'));module[_0xde3b('0x8')]=function(_0x5569ff,_0x29a1dc){return _0x5569ff['define'](_0xde3b('0x9'),attributes,{'tableName':_0xde3b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd0e7=['bluebird','request-promise','rimraf','../../config/environment','exports','define','AnalyticTreeReport','analytics_report_trees','lodash','util','../../config/logger'];(function(_0x512f86,_0x10d5cf){var _0xf8c104=function(_0x57e005){while(--_0x57e005){_0x512f86['push'](_0x512f86['shift']());}};_0xf8c104(++_0x10d5cf);}(_0xd0e7,0xef));var _0x7d0e=function(_0x3c22e0,_0x1dc6ea){_0x3c22e0=_0x3c22e0-0x0;var _0x215811=_0xd0e7[_0x3c22e0];return _0x215811;};'use strict';var _=require(_0x7d0e('0x0'));var util=require(_0x7d0e('0x1'));var logger=require(_0x7d0e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x7d0e('0x3'));var rp=require(_0x7d0e('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7d0e('0x5'));var config=require(_0x7d0e('0x6'));var attributes=require('./analyticTreeReport.attributes');module[_0x7d0e('0x7')]=function(_0x54dcaa,_0x1d3a79){return _0x54dcaa[_0x7d0e('0x8')](_0x7d0e('0x9'),attributes,{'tableName':_0x7d0e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js index ee66dcd..efd8758 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 _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x272282,_0x2e94a0){var _0xedf511=function(_0x5d1ab6){while(--_0x5d1ab6){_0x272282['push'](_0x272282['shift']());}};_0xedf511(++_0x2e94a0);}(_0xadb5,0xad));var _0x5adb=function(_0x420868,_0x3719af){_0x420868=_0x420868-0x0;var _0x3a06a3=_0xadb5[_0x420868];return _0x3a06a3;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});} \ No newline at end of file +var _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x40cbba,_0x4208e5){var _0x4dc247=function(_0x27f763){while(--_0x27f763){_0x40cbba['push'](_0x40cbba['shift']());}};_0x4dc247(++_0x4208e5);}(_0xdb28,0x106));var _0x8db2=function(_0x1d6d89,_0x256025){_0x1d6d89=_0x1d6d89-0x0;var _0x9f9416=_0xdb28[_0x1d6d89];return _0x9f9416;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index fc17b5b..0486d28 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 _0xe308=['./analyticTreeReport.controller','get','index','show','post','isAuthenticated','create','put','/:id','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment'];(function(_0x13ae4a,_0x4b8c49){var _0x514426=function(_0x2a3a3b){while(--_0x2a3a3b){_0x13ae4a['push'](_0x13ae4a['shift']());}};_0x514426(++_0x4b8c49);}(_0xe308,0x175));var _0x8e30=function(_0x2d5fb2,_0x1706f1){_0x2d5fb2=_0x2d5fb2-0x0;var _0x58439d=_0xe308[_0x2d5fb2];return _0x58439d;};'use strict';var multer=require(_0x8e30('0x0'));var util=require(_0x8e30('0x1'));var path=require(_0x8e30('0x2'));var timeout=require(_0x8e30('0x3'));var express=require('express');var router=express[_0x8e30('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x8e30('0x5'));var config=require(_0x8e30('0x6'));var controller=require(_0x8e30('0x7'));router[_0x8e30('0x8')]('/',auth['isAuthenticated'](),controller[_0x8e30('0x9')]);router[_0x8e30('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x8e30('0xa')]);router[_0x8e30('0xb')]('/',auth[_0x8e30('0xc')](),controller[_0x8e30('0xd')]);router[_0x8e30('0xe')](_0x8e30('0xf'),auth[_0x8e30('0xc')](),controller['update']);router[_0x8e30('0x10')](_0x8e30('0xf'),auth[_0x8e30('0xc')](),controller[_0x8e30('0x11')]);module[_0x8e30('0x12')]=router; \ No newline at end of file +var _0x0ecc=['show','post','update','destroy','util','Router','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated'];(function(_0x461bd4,_0x1e283b){var _0x23cae7=function(_0x4ed63d){while(--_0x4ed63d){_0x461bd4['push'](_0x461bd4['shift']());}};_0x23cae7(++_0x1e283b);}(_0x0ecc,0x100));var _0xc0ec=function(_0x5d3da8,_0x2f264f){_0x5d3da8=_0x5d3da8-0x0;var _0x54c5b6=_0x0ecc[_0x5d3da8];return _0x54c5b6;};'use strict';var multer=require('multer');var util=require(_0xc0ec('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xc0ec('0x1')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xc0ec('0x2'));var config=require(_0xc0ec('0x3'));var controller=require('./analyticTreeReport.controller');router[_0xc0ec('0x4')]('/',auth['isAuthenticated'](),controller[_0xc0ec('0x5')]);router[_0xc0ec('0x4')](_0xc0ec('0x6'),auth[_0xc0ec('0x7')](),controller[_0xc0ec('0x8')]);router[_0xc0ec('0x9')]('/',auth[_0xc0ec('0x7')](),controller['create']);router['put'](_0xc0ec('0x6'),auth[_0xc0ec('0x7')](),controller[_0xc0ec('0xa')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xc0ec('0xb')]);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 f1bbd0b..6438b59 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 _0xe13e=['STRING'];(function(_0x403b7c,_0x4ff6bc){var _0x4a4272=function(_0x1ce280){while(--_0x1ce280){_0x403b7c['push'](_0x403b7c['shift']());}};_0x4a4272(++_0x4ff6bc);}(_0xe13e,0xde));var _0xee13=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe13e[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xee13('0x0')]},'basename':{'type':Sequelize[_0xee13('0x0')]},'type':{'type':Sequelize[_0xee13('0x0')]}}; \ No newline at end of file +var _0x6183=['STRING','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x6183,0x19b));var _0x3618=function(_0x28611e,_0x586726){_0x28611e=_0x28611e-0x0;var _0x530f69=_0x6183[_0x28611e];return _0x530f69;};'use strict';var Sequelize=require('sequelize');module[_0x3618('0x0')]={'name':{'type':Sequelize[_0x3618('0x1')]},'basename':{'type':Sequelize[_0x3618('0x1')]},'type':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index 778a887..a0a2856 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 _0x38ff=['filters','pick','filter','where','merge','options','includeAll','include','rows','catch','show','params','clone','get','omit','body','createdAt','updatedAt','create','update','find','file','originalname','basename','filename','mimetype','download','findOne','ChatOfflineMessageId','root','server/files/attachments/','join','offline-chat/','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','apply','reject','destroy','then','error','stack','name','send','index','map','Attachment','rawAttributes','fieldName','type','key','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort'];(function(_0x409ea0,_0x24d255){var _0x983244=function(_0x17a19){while(--_0x17a19){_0x409ea0['push'](_0x409ea0['shift']());}};_0x983244(++_0x24d255);}(_0x38ff,0x7e));var _0xf38f=function(_0xadc7d9,_0x203608){_0xadc7d9=_0xadc7d9-0x0;var _0x915ca1=_0x38ff[_0xadc7d9];return _0x915ca1;};'use strict';var emlformat=require(_0xf38f('0x0'));var rimraf=require(_0xf38f('0x1'));var zipdir=require(_0xf38f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf38f('0x3'));var moment=require(_0xf38f('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf38f('0x5'));var util=require(_0xf38f('0x6'));var path=require('path');var sox=require(_0xf38f('0x7'));var csv=require(_0xf38f('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf38f('0x9'));var _=require(_0xf38f('0xa'));var squel=require(_0xf38f('0xb'));var crypto=require(_0xf38f('0xc'));var jsforce=require(_0xf38f('0xd'));var deskjs=require(_0xf38f('0xe'));var toCsv=require(_0xf38f('0x8'));var querystring=require(_0xf38f('0xf'));var Papa=require(_0xf38f('0x10'));var Redis=require('ioredis');var authService=require(_0xf38f('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xf38f('0x12'));var hardwareService=require(_0xf38f('0x13'));var logger=require(_0xf38f('0x14'))(_0xf38f('0x15'));var utils=require(_0xf38f('0x16'));var config=require(_0xf38f('0x17'));var licenseUtil=require(_0xf38f('0x18'));var db=require(_0xf38f('0x19'))['db'];function respondWithStatusCode(_0x45748b,_0x258385){_0x258385=_0x258385||0xcc;return function(_0x2fe1f8){if(_0x2fe1f8){return _0x45748b[_0xf38f('0x1a')](_0x258385);}return _0x45748b['status'](_0x258385)[_0xf38f('0x1b')]();};}function respondWithResult(_0x3d4e22,_0x3b2af0){_0x3b2af0=_0x3b2af0||0xc8;return function(_0x46093a){if(_0x46093a){return _0x3d4e22[_0xf38f('0x1c')](_0x3b2af0)[_0xf38f('0x1d')](_0x46093a);}};}function respondWithFilteredResult(_0x358a99,_0x50cdfa){return function(_0x59465d){if(_0x59465d){var _0x1d40c2=typeof _0x50cdfa[_0xf38f('0x1e')]==='undefined'&&typeof _0x50cdfa[_0xf38f('0x1f')]===_0xf38f('0x20');var _0x3d686a=_0x59465d[_0xf38f('0x21')];var _0x454845=_0x1d40c2?0x0:_0x50cdfa['offset'];var _0xf6ff42=_0x1d40c2?_0x59465d['count']:_0x50cdfa[_0xf38f('0x1e')]+_0x50cdfa[_0xf38f('0x1f')];var _0x46a66f;if(_0xf6ff42>=_0x3d686a){_0xf6ff42=_0x3d686a;_0x46a66f=0xc8;}else{_0x46a66f=0xce;}_0x358a99[_0xf38f('0x1c')](_0x46a66f);return _0x358a99['set']('Content-Range',_0x454845+'-'+_0xf6ff42+'/'+_0x3d686a)[_0xf38f('0x1d')](_0x59465d);}return null;};}function patchUpdates(_0x2f4ac9){return function(_0x283f01){try{jsonpatch[_0xf38f('0x22')](_0x283f01,_0x2f4ac9,!![]);}catch(_0x41f84c){return BPromise[_0xf38f('0x23')](_0x41f84c);}return _0x283f01['save']();};}function saveUpdates(_0x326ee5,_0x4e3e03){return function(_0x146992){if(_0x146992){return _0x146992['update'](_0x326ee5)['then'](function(_0x4098a7){return _0x4098a7;});}return null;};}function removeEntity(_0x30c4f0,_0x1b00f3){return function(_0x293dc2){if(_0x293dc2){return _0x293dc2[_0xf38f('0x24')]()[_0xf38f('0x25')](function(){_0x30c4f0[_0xf38f('0x1c')](0xcc)[_0xf38f('0x1b')]();});}};}function handleEntityNotFound(_0x3a6020,_0x51621e){return function(_0x3f7bbc){if(!_0x3f7bbc){_0x3a6020[_0xf38f('0x1a')](0x194);}return _0x3f7bbc;};}function handleError(_0x5956ca,_0x48f86e){_0x48f86e=_0x48f86e||0x1f4;return function(_0x5dcbd6){logger[_0xf38f('0x26')](_0x5dcbd6[_0xf38f('0x27')]);if(_0x5dcbd6[_0xf38f('0x28')]){delete _0x5dcbd6[_0xf38f('0x28')];}_0x5956ca[_0xf38f('0x1c')](_0x48f86e)[_0xf38f('0x29')](_0x5dcbd6);};}exports[_0xf38f('0x2a')]=function(_0x28f247,_0x52696f){var _0x5b81ce={},_0x1d895b={},_0xf41424={'count':0x0,'rows':[]};var _0x4aecdd=_[_0xf38f('0x2b')](db[_0xf38f('0x2c')][_0xf38f('0x2d')],function(_0x57e937){return{'name':_0x57e937[_0xf38f('0x2e')],'type':_0x57e937[_0xf38f('0x2f')][_0xf38f('0x30')]};});_0x1d895b['model']=_[_0xf38f('0x2b')](_0x4aecdd,_0xf38f('0x28'));_0x1d895b[_0xf38f('0x31')]=_[_0xf38f('0x32')](_0x28f247['query']);_0x1d895b['filters']=_[_0xf38f('0x33')](_0x1d895b['model'],_0x1d895b[_0xf38f('0x31')]);_0x5b81ce['attributes']=_[_0xf38f('0x33')](_0x1d895b[_0xf38f('0x34')],qs['fields'](_0x28f247[_0xf38f('0x31')][_0xf38f('0x35')]));_0x5b81ce[_0xf38f('0x36')]=_0x5b81ce[_0xf38f('0x36')][_0xf38f('0x37')]?_0x5b81ce[_0xf38f('0x36')]:_0x1d895b['model'];if(!_0x28f247[_0xf38f('0x31')][_0xf38f('0x38')](_0xf38f('0x39'))){_0x5b81ce[_0xf38f('0x1f')]=qs[_0xf38f('0x1f')](_0x28f247[_0xf38f('0x31')][_0xf38f('0x1f')]);_0x5b81ce['offset']=qs[_0xf38f('0x1e')](_0x28f247['query'][_0xf38f('0x1e')]);}_0x5b81ce[_0xf38f('0x3a')]=qs[_0xf38f('0x3b')](_0x28f247[_0xf38f('0x31')][_0xf38f('0x3b')]);_0x5b81ce['where']=qs[_0xf38f('0x3c')](_[_0xf38f('0x3d')](_0x28f247[_0xf38f('0x31')],_0x1d895b[_0xf38f('0x3c')]),_0x4aecdd);if(_0x28f247[_0xf38f('0x31')][_0xf38f('0x3e')]){_0x5b81ce[_0xf38f('0x3f')]=_[_0xf38f('0x40')](_0x5b81ce[_0xf38f('0x3f')],{'$or':_[_0xf38f('0x2b')](_0x4aecdd,function(_0x28419d){if(_0x28419d[_0xf38f('0x2f')]!=='VIRTUAL'){var _0x4be876={};_0x4be876[_0x28419d[_0xf38f('0x28')]]={'$like':'%'+_0x28f247[_0xf38f('0x31')]['filter']+'%'};return _0x4be876;}})});}_0x5b81ce=_[_0xf38f('0x40')]({},_0x5b81ce,_0x28f247[_0xf38f('0x41')]);var _0x12f0d6={'where':_0x5b81ce[_0xf38f('0x3f')]};return db[_0xf38f('0x2c')][_0xf38f('0x21')](_0x12f0d6)['then'](function(_0x11d8b5){_0xf41424[_0xf38f('0x21')]=_0x11d8b5;if(_0x28f247['query'][_0xf38f('0x42')]){_0x5b81ce[_0xf38f('0x43')]=[{'all':!![]}];}return db[_0xf38f('0x2c')]['findAll'](_0x5b81ce);})[_0xf38f('0x25')](function(_0x3a1509){_0xf41424[_0xf38f('0x44')]=_0x3a1509;return _0xf41424;})['then'](respondWithFilteredResult(_0x52696f,_0x5b81ce))[_0xf38f('0x45')](handleError(_0x52696f,null));};exports[_0xf38f('0x46')]=function(_0x2c0309,_0x2a4e14){var _0x2ca5b4={'raw':!![],'where':{'id':_0x2c0309[_0xf38f('0x47')]['id']}},_0x5980ad={};_0x5980ad[_0xf38f('0x34')]=_['keys'](db[_0xf38f('0x2c')]['rawAttributes']);_0x5980ad[_0xf38f('0x31')]=_['keys'](_0x2c0309['query']);_0x5980ad[_0xf38f('0x3c')]=_['intersection'](_0x5980ad[_0xf38f('0x34')],_0x5980ad[_0xf38f('0x31')]);_0x2ca5b4[_0xf38f('0x36')]=_[_0xf38f('0x33')](_0x5980ad[_0xf38f('0x34')],qs[_0xf38f('0x35')](_0x2c0309[_0xf38f('0x31')][_0xf38f('0x35')]));_0x2ca5b4['attributes']=_0x2ca5b4['attributes'][_0xf38f('0x37')]?_0x2ca5b4['attributes']:_0x5980ad[_0xf38f('0x34')];if(_0x2c0309[_0xf38f('0x31')][_0xf38f('0x42')]){_0x2ca5b4[_0xf38f('0x43')]=[{'all':!![]}];}_0x2ca5b4=_[_0xf38f('0x40')]({},_0x2ca5b4,_0x2c0309[_0xf38f('0x41')]);return db[_0xf38f('0x2c')]['find'](_0x2ca5b4)[_0xf38f('0x25')](handleEntityNotFound(_0x2a4e14,null))[_0xf38f('0x25')](respondWithResult(_0x2a4e14,null))[_0xf38f('0x45')](handleError(_0x2a4e14,null));};exports[_0xf38f('0x48')]=function(_0xb1af4f,_0x26f3a0){var _0xe616c6={'where':{'id':_0xb1af4f[_0xf38f('0x47')]['id']}},_0x373f66={};_0x373f66[_0xf38f('0x34')]=_[_0xf38f('0x32')](db[_0xf38f('0x2c')][_0xf38f('0x2d')]);_0xe616c6[_0xf38f('0x36')]=_[_0xf38f('0x33')](_0x373f66[_0xf38f('0x34')],qs['fields'](_0xb1af4f[_0xf38f('0x31')][_0xf38f('0x35')]));_0xe616c6[_0xf38f('0x36')]=_0xe616c6[_0xf38f('0x36')][_0xf38f('0x37')]?_0xe616c6[_0xf38f('0x36')]:_0x373f66[_0xf38f('0x34')];if(_0xb1af4f[_0xf38f('0x31')][_0xf38f('0x42')]){_0xe616c6[_0xf38f('0x43')]=[{'all':!![]}];}_0xe616c6=_['merge']({},_0xe616c6,_0xb1af4f[_0xf38f('0x41')]);return db[_0xf38f('0x2c')]['find'](_0xe616c6)['then'](handleEntityNotFound(_0x26f3a0,null))[_0xf38f('0x25')](function(_0x140f19){if(_0x140f19){var _0x457679=_0x140f19[_0xf38f('0x49')]({'plain':!![]});_0x457679=qs[_0xf38f('0x4a')](_0x457679,['id','createdAt','updatedAt']);_0xb1af4f[_0xf38f('0x4b')]=_[_0xf38f('0x4a')](_0xb1af4f[_0xf38f('0x4b')],['id',_0xf38f('0x4c'),_0xf38f('0x4d')]);return db[_0xf38f('0x2c')][_0xf38f('0x4e')](_['merge'](_0x457679,_0xb1af4f[_0xf38f('0x4b')]),{'include':_0xb1af4f[_0xf38f('0x31')][_0xf38f('0x42')]?[{'all':!![]}]:undefined});}})[_0xf38f('0x25')](respondWithResult(_0x26f3a0,0xc9))[_0xf38f('0x45')](handleError(_0x26f3a0,null));};exports[_0xf38f('0x4f')]=function(_0x41ce38,_0x1c888d){if(_0x41ce38[_0xf38f('0x4b')]['id']){delete _0x41ce38[_0xf38f('0x4b')]['id'];}return db['Attachment'][_0xf38f('0x50')]({'where':{'id':_0x41ce38['params']['id']}})[_0xf38f('0x25')](handleEntityNotFound(_0x1c888d,null))['then'](saveUpdates(_0x41ce38['body'],null))['then'](respondWithResult(_0x1c888d,null))['catch'](handleError(_0x1c888d,null));};exports[_0xf38f('0x24')]=function(_0x140c05,_0x3cbfa7){return db[_0xf38f('0x2c')][_0xf38f('0x50')]({'where':{'id':_0x140c05['params']['id']}})[_0xf38f('0x25')](handleEntityNotFound(_0x3cbfa7,null))[_0xf38f('0x25')](removeEntity(_0x3cbfa7,null))[_0xf38f('0x45')](handleError(_0x3cbfa7,null));};exports[_0xf38f('0x4e')]=function(_0x5e2a82,_0x13d57c,_0x17cc62){_0x5e2a82[_0xf38f('0x4b')][_0xf38f('0x28')]=_0x5e2a82[_0xf38f('0x51')][_0xf38f('0x52')];_0x5e2a82[_0xf38f('0x4b')][_0xf38f('0x53')]=_0x5e2a82['file'][_0xf38f('0x54')];_0x5e2a82[_0xf38f('0x4b')][_0xf38f('0x2f')]=_0x5e2a82['file'][_0xf38f('0x55')];return db[_0xf38f('0x2c')][_0xf38f('0x4e')](_0x5e2a82[_0xf38f('0x4b')])[_0xf38f('0x25')](respondWithResult(_0x13d57c,0xc9))['catch'](handleError(_0x13d57c,null));};exports[_0xf38f('0x56')]=function(_0x3e0d03,_0x1a6578,_0x386cc9){return db['Attachment'][_0xf38f('0x57')]({'where':{'id':_0x3e0d03[_0xf38f('0x47')]['id']},'raw':!![]})[_0xf38f('0x25')](handleEntityNotFound(_0x1a6578,null))[_0xf38f('0x25')](function(_0x3d18cd){if(_0x3d18cd){var _0x4d9232=_0x3d18cd[_0xf38f('0x58')]!==null;var _0x58ae99=path['join'](config[_0xf38f('0x59')],_0xf38f('0x5a'));if(_0x4d9232){_0x58ae99=path[_0xf38f('0x5b')](_0x58ae99,_0xf38f('0x5c'));}var _0x5b0b1b=path[_0xf38f('0x5b')](_0x58ae99,_0x3d18cd[_0xf38f('0x53')]);return _0x1a6578[_0xf38f('0x56')](_0x5b0b1b);}})[_0xf38f('0x45')](handleError(_0x1a6578,null));}; \ No newline at end of file +var _0xb19a=['clone','includeAll','get','omit','createdAt','updatedAt','body','create','originalname','basename','file','mimetype','download','ChatOfflineMessageId','root','server/files/attachments/','join','offline-chat/','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','ejs','lodash','squel','crypto','jsforce','querystring','../../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','limit','undefined','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','Attachment','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','findAll','catch','show','params','rawAttributes','include','options','find'];(function(_0x35007a,_0x58a0d4){var _0x574f68=function(_0xd1c129){while(--_0xd1c129){_0x35007a['push'](_0x35007a['shift']());}};_0x574f68(++_0x58a0d4);}(_0xb19a,0xc4));var _0xab19=function(_0x1dee09,_0x396388){_0x1dee09=_0x1dee09-0x0;var _0x67231e=_0xb19a[_0x1dee09];return _0x67231e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xab19('0x0'));var zipdir=require(_0xab19('0x1'));var jsonpatch=require(_0xab19('0x2'));var rp=require(_0xab19('0x3'));var moment=require('moment');var BPromise=require(_0xab19('0x4'));var Mustache=require(_0xab19('0x5'));var util=require(_0xab19('0x6'));var path=require('path');var sox=require(_0xab19('0x7'));var csv=require('to-csv');var ejs=require(_0xab19('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xab19('0x9'));var squel=require(_0xab19('0xa'));var crypto=require(_0xab19('0xb'));var jsforce=require(_0xab19('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xab19('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xab19('0xe'));var qs=require(_0xab19('0xf'));var as=require(_0xab19('0x10'));var hardwareService=require(_0xab19('0x11'));var logger=require(_0xab19('0x12'))('api');var utils=require(_0xab19('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xab19('0x14'));var db=require(_0xab19('0x15'))['db'];function respondWithStatusCode(_0x3090cb,_0x5d83a5){_0x5d83a5=_0x5d83a5||0xcc;return function(_0x1bf557){if(_0x1bf557){return _0x3090cb[_0xab19('0x16')](_0x5d83a5);}return _0x3090cb[_0xab19('0x17')](_0x5d83a5)[_0xab19('0x18')]();};}function respondWithResult(_0x2cd579,_0x194396){_0x194396=_0x194396||0xc8;return function(_0x2ae465){if(_0x2ae465){return _0x2cd579[_0xab19('0x17')](_0x194396)[_0xab19('0x19')](_0x2ae465);}};}function respondWithFilteredResult(_0x4217bb,_0x50d517){return function(_0x51bd5b){if(_0x51bd5b){var _0x48af00=typeof _0x50d517[_0xab19('0x1a')]==='undefined'&&typeof _0x50d517[_0xab19('0x1b')]===_0xab19('0x1c');var _0x58944c=_0x51bd5b['count'];var _0x291105=_0x48af00?0x0:_0x50d517[_0xab19('0x1a')];var _0x30cb92=_0x48af00?_0x51bd5b[_0xab19('0x1d')]:_0x50d517['offset']+_0x50d517['limit'];var _0x45f6b5;if(_0x30cb92>=_0x58944c){_0x30cb92=_0x58944c;_0x45f6b5=0xc8;}else{_0x45f6b5=0xce;}_0x4217bb[_0xab19('0x17')](_0x45f6b5);return _0x4217bb[_0xab19('0x1e')](_0xab19('0x1f'),_0x291105+'-'+_0x30cb92+'/'+_0x58944c)[_0xab19('0x19')](_0x51bd5b);}return null;};}function patchUpdates(_0x20034f){return function(_0x2e4595){try{jsonpatch[_0xab19('0x20')](_0x2e4595,_0x20034f,!![]);}catch(_0x378024){return BPromise[_0xab19('0x21')](_0x378024);}return _0x2e4595['save']();};}function saveUpdates(_0x6807e0,_0x96ab80){return function(_0x2dd24a){if(_0x2dd24a){return _0x2dd24a[_0xab19('0x22')](_0x6807e0)[_0xab19('0x23')](function(_0x38e0a9){return _0x38e0a9;});}return null;};}function removeEntity(_0x32203d,_0x40060e){return function(_0x12dc24){if(_0x12dc24){return _0x12dc24[_0xab19('0x24')]()[_0xab19('0x23')](function(){_0x32203d[_0xab19('0x17')](0xcc)[_0xab19('0x18')]();});}};}function handleEntityNotFound(_0x21ab58,_0x1dd803){return function(_0x62923){if(!_0x62923){_0x21ab58[_0xab19('0x16')](0x194);}return _0x62923;};}function handleError(_0x3e04c9,_0x3677c1){_0x3677c1=_0x3677c1||0x1f4;return function(_0x47dc06){logger[_0xab19('0x25')](_0x47dc06[_0xab19('0x26')]);if(_0x47dc06[_0xab19('0x27')]){delete _0x47dc06[_0xab19('0x27')];}_0x3e04c9['status'](_0x3677c1)[_0xab19('0x28')](_0x47dc06);};}exports[_0xab19('0x29')]=function(_0x3cc92d,_0x2491df){var _0x35832c={},_0x21b78c={},_0x2443ce={'count':0x0,'rows':[]};var _0x1656ea=_['map'](db[_0xab19('0x2a')]['rawAttributes'],function(_0x3a095c){return{'name':_0x3a095c[_0xab19('0x2b')],'type':_0x3a095c[_0xab19('0x2c')][_0xab19('0x2d')]};});_0x21b78c[_0xab19('0x2e')]=_[_0xab19('0x2f')](_0x1656ea,_0xab19('0x27'));_0x21b78c['query']=_[_0xab19('0x30')](_0x3cc92d['query']);_0x21b78c[_0xab19('0x31')]=_[_0xab19('0x32')](_0x21b78c[_0xab19('0x2e')],_0x21b78c[_0xab19('0x33')]);_0x35832c[_0xab19('0x34')]=_[_0xab19('0x32')](_0x21b78c[_0xab19('0x2e')],qs[_0xab19('0x35')](_0x3cc92d[_0xab19('0x33')]['fields']));_0x35832c[_0xab19('0x34')]=_0x35832c[_0xab19('0x34')][_0xab19('0x36')]?_0x35832c[_0xab19('0x34')]:_0x21b78c['model'];if(!_0x3cc92d[_0xab19('0x33')][_0xab19('0x37')]('nolimit')){_0x35832c[_0xab19('0x1b')]=qs[_0xab19('0x1b')](_0x3cc92d[_0xab19('0x33')][_0xab19('0x1b')]);_0x35832c[_0xab19('0x1a')]=qs[_0xab19('0x1a')](_0x3cc92d[_0xab19('0x33')]['offset']);}_0x35832c[_0xab19('0x38')]=qs['sort'](_0x3cc92d[_0xab19('0x33')][_0xab19('0x39')]);_0x35832c[_0xab19('0x3a')]=qs[_0xab19('0x31')](_[_0xab19('0x3b')](_0x3cc92d[_0xab19('0x33')],_0x21b78c[_0xab19('0x31')]),_0x1656ea);if(_0x3cc92d['query'][_0xab19('0x3c')]){_0x35832c['where']=_[_0xab19('0x3d')](_0x35832c[_0xab19('0x3a')],{'$or':_[_0xab19('0x2f')](_0x1656ea,function(_0xea1121){if(_0xea1121[_0xab19('0x2c')]!==_0xab19('0x3e')){var _0x5ebe61={};_0x5ebe61[_0xea1121[_0xab19('0x27')]]={'$like':'%'+_0x3cc92d[_0xab19('0x33')][_0xab19('0x3c')]+'%'};return _0x5ebe61;}})});}_0x35832c=_[_0xab19('0x3d')]({},_0x35832c,_0x3cc92d['options']);var _0x10db71={'where':_0x35832c[_0xab19('0x3a')]};return db['Attachment']['count'](_0x10db71)['then'](function(_0x10842a){_0x2443ce[_0xab19('0x1d')]=_0x10842a;if(_0x3cc92d[_0xab19('0x33')]['includeAll']){_0x35832c['include']=[{'all':!![]}];}return db['Attachment'][_0xab19('0x3f')](_0x35832c);})['then'](function(_0x3d2e8b){_0x2443ce['rows']=_0x3d2e8b;return _0x2443ce;})[_0xab19('0x23')](respondWithFilteredResult(_0x2491df,_0x35832c))[_0xab19('0x40')](handleError(_0x2491df,null));};exports[_0xab19('0x41')]=function(_0x1966da,_0x1b3e19){var _0x341ad4={'raw':!![],'where':{'id':_0x1966da[_0xab19('0x42')]['id']}},_0x57e40d={};_0x57e40d['model']=_[_0xab19('0x30')](db[_0xab19('0x2a')][_0xab19('0x43')]);_0x57e40d[_0xab19('0x33')]=_[_0xab19('0x30')](_0x1966da[_0xab19('0x33')]);_0x57e40d[_0xab19('0x31')]=_['intersection'](_0x57e40d[_0xab19('0x2e')],_0x57e40d[_0xab19('0x33')]);_0x341ad4[_0xab19('0x34')]=_[_0xab19('0x32')](_0x57e40d[_0xab19('0x2e')],qs[_0xab19('0x35')](_0x1966da[_0xab19('0x33')][_0xab19('0x35')]));_0x341ad4[_0xab19('0x34')]=_0x341ad4[_0xab19('0x34')][_0xab19('0x36')]?_0x341ad4['attributes']:_0x57e40d[_0xab19('0x2e')];if(_0x1966da['query']['includeAll']){_0x341ad4[_0xab19('0x44')]=[{'all':!![]}];}_0x341ad4=_[_0xab19('0x3d')]({},_0x341ad4,_0x1966da[_0xab19('0x45')]);return db[_0xab19('0x2a')][_0xab19('0x46')](_0x341ad4)[_0xab19('0x23')](handleEntityNotFound(_0x1b3e19,null))[_0xab19('0x23')](respondWithResult(_0x1b3e19,null))[_0xab19('0x40')](handleError(_0x1b3e19,null));};exports[_0xab19('0x47')]=function(_0xbbf984,_0x4a3ffb){var _0x5bfec4={'where':{'id':_0xbbf984['params']['id']}},_0x13f549={};_0x13f549[_0xab19('0x2e')]=_[_0xab19('0x30')](db[_0xab19('0x2a')][_0xab19('0x43')]);_0x5bfec4[_0xab19('0x34')]=_[_0xab19('0x32')](_0x13f549['model'],qs['fields'](_0xbbf984[_0xab19('0x33')][_0xab19('0x35')]));_0x5bfec4['attributes']=_0x5bfec4[_0xab19('0x34')][_0xab19('0x36')]?_0x5bfec4[_0xab19('0x34')]:_0x13f549[_0xab19('0x2e')];if(_0xbbf984['query'][_0xab19('0x48')]){_0x5bfec4[_0xab19('0x44')]=[{'all':!![]}];}_0x5bfec4=_['merge']({},_0x5bfec4,_0xbbf984['options']);return db[_0xab19('0x2a')][_0xab19('0x46')](_0x5bfec4)['then'](handleEntityNotFound(_0x4a3ffb,null))[_0xab19('0x23')](function(_0x1cc8fe){if(_0x1cc8fe){var _0x182d71=_0x1cc8fe[_0xab19('0x49')]({'plain':!![]});_0x182d71=qs[_0xab19('0x4a')](_0x182d71,['id',_0xab19('0x4b'),_0xab19('0x4c')]);_0xbbf984[_0xab19('0x4d')]=_[_0xab19('0x4a')](_0xbbf984[_0xab19('0x4d')],['id',_0xab19('0x4b'),'updatedAt']);return db[_0xab19('0x2a')][_0xab19('0x4e')](_[_0xab19('0x3d')](_0x182d71,_0xbbf984['body']),{'include':_0xbbf984[_0xab19('0x33')][_0xab19('0x48')]?[{'all':!![]}]:undefined});}})[_0xab19('0x23')](respondWithResult(_0x4a3ffb,0xc9))[_0xab19('0x40')](handleError(_0x4a3ffb,null));};exports[_0xab19('0x22')]=function(_0xc3d2a3,_0x306266){if(_0xc3d2a3[_0xab19('0x4d')]['id']){delete _0xc3d2a3[_0xab19('0x4d')]['id'];}return db[_0xab19('0x2a')][_0xab19('0x46')]({'where':{'id':_0xc3d2a3[_0xab19('0x42')]['id']}})[_0xab19('0x23')](handleEntityNotFound(_0x306266,null))['then'](saveUpdates(_0xc3d2a3['body'],null))[_0xab19('0x23')](respondWithResult(_0x306266,null))[_0xab19('0x40')](handleError(_0x306266,null));};exports[_0xab19('0x24')]=function(_0x2d77ae,_0x294c78){return db['Attachment'][_0xab19('0x46')]({'where':{'id':_0x2d77ae[_0xab19('0x42')]['id']}})[_0xab19('0x23')](handleEntityNotFound(_0x294c78,null))[_0xab19('0x23')](removeEntity(_0x294c78,null))['catch'](handleError(_0x294c78,null));};exports[_0xab19('0x4e')]=function(_0x122314,_0x16925e,_0x3c501a){_0x122314[_0xab19('0x4d')][_0xab19('0x27')]=_0x122314['file'][_0xab19('0x4f')];_0x122314[_0xab19('0x4d')][_0xab19('0x50')]=_0x122314[_0xab19('0x51')]['filename'];_0x122314[_0xab19('0x4d')][_0xab19('0x2c')]=_0x122314['file'][_0xab19('0x52')];return db[_0xab19('0x2a')]['create'](_0x122314[_0xab19('0x4d')])[_0xab19('0x23')](respondWithResult(_0x16925e,0xc9))['catch'](handleError(_0x16925e,null));};exports[_0xab19('0x53')]=function(_0x4b8178,_0x13b5c4,_0x4573db){return db[_0xab19('0x2a')]['findOne']({'where':{'id':_0x4b8178['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0x13b5c4,null))[_0xab19('0x23')](function(_0x973243){if(_0x973243){var _0x4f063a=_0x973243[_0xab19('0x54')]!==null;var _0x25b844=path['join'](config[_0xab19('0x55')],_0xab19('0x56'));if(_0x4f063a){_0x25b844=path[_0xab19('0x57')](_0x25b844,_0xab19('0x58'));}var _0x35e7bf=path[_0xab19('0x57')](_0x25b844,_0x973243[_0xab19('0x50')]);return _0x13b5c4[_0xab19('0x53')](_0x35e7bf);}})['catch'](handleError(_0x13b5c4,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index a0d415a..7f2ffc4 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 _0xd0ee=['exports','define','util','moment','bluebird','request-promise','../../config/environment','./attachment.attributes'];(function(_0x485df0,_0x55eb9f){var _0xfd4f3b=function(_0x1d43e9){while(--_0x1d43e9){_0x485df0['push'](_0x485df0['shift']());}};_0xfd4f3b(++_0x55eb9f);}(_0xd0ee,0x152));var _0xed0e=function(_0x14dbda,_0x2767ff){_0x14dbda=_0x14dbda-0x0;var _0x32cbc9=_0xd0ee[_0x14dbda];return _0x32cbc9;};'use strict';var _=require('lodash');var util=require(_0xed0e('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xed0e('0x1'));var BPromise=require(_0xed0e('0x2'));var rp=require(_0xed0e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xed0e('0x4'));var attributes=require(_0xed0e('0x5'));module[_0xed0e('0x6')]=function(_0xf70193,_0x49c33b){return _0xf70193[_0xed0e('0x7')]('Attachment',attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xffea=['rimraf','../../config/environment','./attachment.attributes','exports','define','Attachment','attachments','lodash','api','moment','bluebird','request-promise','path'];(function(_0x4e6ae6,_0x49dba6){var _0x23c108=function(_0x1bc103){while(--_0x1bc103){_0x4e6ae6['push'](_0x4e6ae6['shift']());}};_0x23c108(++_0x49dba6);}(_0xffea,0x13f));var _0xaffe=function(_0x831608,_0x20a30e){_0x831608=_0x831608-0x0;var _0x1e8ea0=_0xffea[_0x831608];return _0x1e8ea0;};'use strict';var _=require(_0xaffe('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xaffe('0x1'));var moment=require(_0xaffe('0x2'));var BPromise=require(_0xaffe('0x3'));var rp=require(_0xaffe('0x4'));var fs=require('fs');var path=require(_0xaffe('0x5'));var rimraf=require(_0xaffe('0x6'));var config=require(_0xaffe('0x7'));var attributes=require(_0xaffe('0x8'));module[_0xaffe('0x9')]=function(_0x165094,_0xd63dbb){return _0x165094[_0xaffe('0xa')](_0xaffe('0xb'),attributes,{'tableName':_0xaffe('0xc'),'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 38069b7..1d23720 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 _0xd4b6=['jayson/promise','client','request','then','info','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','Attachment,\x20%s,\x20%s','message','result','catch','CreateAttachment','Attachment','create','body','options','lodash','util','bluebird','randomstring','../../mysqldb','../../config/environment'];(function(_0x4e7667,_0x47c33b){var _0x2dcbad=function(_0x4ec54b){while(--_0x4ec54b){_0x4e7667['push'](_0x4e7667['shift']());}};_0x2dcbad(++_0x47c33b);}(_0xd4b6,0x13f));var _0x6d4b=function(_0x3b6148,_0x2e26e5){_0x3b6148=_0x3b6148-0x0;var _0x2d750a=_0xd4b6[_0x3b6148];return _0x2d750a;};'use strict';var _=require(_0x6d4b('0x0'));var util=require(_0x6d4b('0x1'));var moment=require('moment');var BPromise=require(_0x6d4b('0x2'));var rs=require(_0x6d4b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6d4b('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x6d4b('0x5'));var jayson=require(_0x6d4b('0x6'));var client=jayson[_0x6d4b('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x20f52a,_0x42a52a,_0x424690){return new BPromise(function(_0x262eed,_0x4dcf3d){return client[_0x6d4b('0x8')](_0x20f52a,_0x424690)[_0x6d4b('0x9')](function(_0xb2567b){logger[_0x6d4b('0xa')]('Attachment,\x20%s,\x20%s',_0x42a52a,_0x6d4b('0xb'));logger[_0x6d4b('0xc')](_0x6d4b('0xd'),_0x42a52a,_0x6d4b('0xb'),JSON[_0x6d4b('0xe')](_0xb2567b));if(_0xb2567b[_0x6d4b('0xf')]){if(_0xb2567b[_0x6d4b('0xf')]['code']===0x1f4){logger[_0x6d4b('0xf')](_0x6d4b('0x10'),_0x42a52a,_0xb2567b[_0x6d4b('0xf')]['message']);return _0x4dcf3d(_0xb2567b[_0x6d4b('0xf')][_0x6d4b('0x11')]);}logger[_0x6d4b('0xf')](_0x6d4b('0x10'),_0x42a52a,_0xb2567b[_0x6d4b('0xf')][_0x6d4b('0x11')]);return _0x262eed(_0xb2567b[_0x6d4b('0xf')][_0x6d4b('0x11')]);}else{logger[_0x6d4b('0xa')](_0x6d4b('0x10'),_0x42a52a,'request\x20sent');_0x262eed(_0xb2567b[_0x6d4b('0x12')]['message']);}})[_0x6d4b('0x13')](function(_0x428b75){logger['error']('Attachment,\x20%s,\x20%s',_0x42a52a,_0x428b75);_0x4dcf3d(_0x428b75);});});}exports[_0x6d4b('0x14')]=function(_0x3a30b2){var _0x318b0f=this;return new Promise(function(_0x2694ba,_0xa2f130){return db[_0x6d4b('0x15')][_0x6d4b('0x16')](_0x3a30b2[_0x6d4b('0x17')],{'raw':_0x3a30b2[_0x6d4b('0x18')]?_0x3a30b2[_0x6d4b('0x18')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x25a1fa){logger[_0x6d4b('0xa')](_0x6d4b('0x14'),_0x3a30b2);logger['debug'](_0x6d4b('0x14'),_0x3a30b2,JSON[_0x6d4b('0xe')](_0x25a1fa));_0x2694ba(_0x25a1fa);})[_0x6d4b('0x13')](function(_0x26b72d){logger['error'](_0x6d4b('0x14'),_0x26b72d[_0x6d4b('0x11')],_0x3a30b2);_0xa2f130(_0x318b0f[_0x6d4b('0xf')](0x1f4,_0x26b72d[_0x6d4b('0x11')]));});});}; \ No newline at end of file +var _0x31c2=['CreateAttachment','stringify','lodash','bluebird','randomstring','../../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','code','error','message','result','catch','Attachment','create','body','options','raw'];(function(_0x5224ba,_0x3fb4e1){var _0x459bd2=function(_0x61be43){while(--_0x61be43){_0x5224ba['push'](_0x5224ba['shift']());}};_0x459bd2(++_0x3fb4e1);}(_0x31c2,0x98));var _0x231c=function(_0x42c1a4,_0x4669f1){_0x42c1a4=_0x42c1a4-0x0;var _0x1ab6db=_0x31c2[_0x42c1a4];return _0x1ab6db;};'use strict';var _=require(_0x231c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x231c('0x1'));var rs=require(_0x231c('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x231c('0x3'))['db'];var utils=require(_0x231c('0x4'));var logger=require(_0x231c('0x5'))(_0x231c('0x6'));var config=require(_0x231c('0x7'));var jayson=require(_0x231c('0x8'));var client=jayson[_0x231c('0x9')][_0x231c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5afc76,_0x1e3997,_0x4fd8b8){return new BPromise(function(_0x3dfccb,_0x396da8){return client[_0x231c('0xb')](_0x5afc76,_0x4fd8b8)[_0x231c('0xc')](function(_0x4cd3b8){logger[_0x231c('0xd')](_0x231c('0xe'),_0x1e3997,_0x231c('0xf'));logger[_0x231c('0x10')](_0x231c('0x11'),_0x1e3997,_0x231c('0xf'),JSON['stringify'](_0x4cd3b8));if(_0x4cd3b8['error']){if(_0x4cd3b8['error'][_0x231c('0x12')]===0x1f4){logger[_0x231c('0x13')](_0x231c('0xe'),_0x1e3997,_0x4cd3b8[_0x231c('0x13')][_0x231c('0x14')]);return _0x396da8(_0x4cd3b8[_0x231c('0x13')][_0x231c('0x14')]);}logger[_0x231c('0x13')](_0x231c('0xe'),_0x1e3997,_0x4cd3b8[_0x231c('0x13')][_0x231c('0x14')]);return _0x3dfccb(_0x4cd3b8[_0x231c('0x13')][_0x231c('0x14')]);}else{logger[_0x231c('0xd')]('Attachment,\x20%s,\x20%s',_0x1e3997,_0x231c('0xf'));_0x3dfccb(_0x4cd3b8[_0x231c('0x15')][_0x231c('0x14')]);}})[_0x231c('0x16')](function(_0x40f4f6){logger['error'](_0x231c('0xe'),_0x1e3997,_0x40f4f6);_0x396da8(_0x40f4f6);});});}exports['CreateAttachment']=function(_0x1d48e3){var _0x59282c=this;return new Promise(function(_0x286148,_0x34f391){return db[_0x231c('0x17')][_0x231c('0x18')](_0x1d48e3[_0x231c('0x19')],{'raw':_0x1d48e3[_0x231c('0x1a')]?_0x1d48e3[_0x231c('0x1a')][_0x231c('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x29a94){logger[_0x231c('0xd')](_0x231c('0x1c'),_0x1d48e3);logger['debug']('CreateAttachment',_0x1d48e3,JSON[_0x231c('0x1d')](_0x29a94));_0x286148(_0x29a94);})[_0x231c('0x16')](function(_0x3bd9ed){logger['error'](_0x231c('0x1c'),_0x3bd9ed['message'],_0x1d48e3);_0x34f391(_0x59282c[_0x231c('0x13')](0x1f4,_0x3bd9ed[_0x231c('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index 20b037a..7dfea74 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 _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(_0x39d544,_0x35c14f){var _0x5a5ff2=function(_0x2271fb){while(--_0x2271fb){_0x39d544['push'](_0x39d544['shift']());}};_0x5a5ff2(++_0x35c14f);}(_0x0b0e,0x187));var _0xe0b0=function(_0x44b3bd,_0x44c97d){_0x44b3bd=_0x44b3bd-0x0;var _0x1efc4a=_0x0b0e[_0x44b3bd];return _0x1efc4a;};'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 +var _0x5f2f=['show','/:id/download','download','post','/:id/clone','clone','root','server/files/attachments/','format','now','originalname','replace','single','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./attachment.controller','get','isAuthenticated','index','/:id'];(function(_0x49f856,_0x287a28){var _0x43a6fb=function(_0x25ab53){while(--_0x25ab53){_0x49f856['push'](_0x49f856['shift']());}};_0x43a6fb(++_0x287a28);}(_0x5f2f,0x73));var _0xf5f2=function(_0x3b07ce,_0x1efc2f){_0x3b07ce=_0x3b07ce-0x0;var _0x8e9a57=_0x5f2f[_0x3b07ce];return _0x8e9a57;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var fs_extra=require(_0xf5f2('0x6'));var auth=require(_0xf5f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5f2('0x8'));router[_0xf5f2('0x9')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0xb')]);router[_0xf5f2('0x9')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0xd')]);router[_0xf5f2('0x9')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x10')](_0xf5f2('0x11'),auth['isAuthenticated'](),controller[_0xf5f2('0x12')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x53fb33,_0xa7e1a6,_0x151aba){_0x151aba(null,path['join'](config[_0xf5f2('0x13')],_0xf5f2('0x14')));},'filename':function(_0x331482,_0x3f2997,_0x59bb6c){_0x59bb6c(null,util[_0xf5f2('0x15')]('%s-%s',Date[_0xf5f2('0x16')](),_0x3f2997[_0xf5f2('0x17')][_0xf5f2('0x18')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xf5f2('0x10')]('/',upload[_0xf5f2('0x19')]('file'),controller[_0xf5f2('0x1a')]);router[_0xf5f2('0x1b')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1c')]);router[_0xf5f2('0x1d')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1e')]);module[_0xf5f2('0x1f')]=router; \ No newline at end of file diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js index 2827568..8d55f02 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 _0x6889=['activedirectory2','util','../../config/utils','../../config/environment','../../config/logger','activedirectory','url','error','Error\x20authenticate\x20%s:\x20%s','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','Setting','findOne','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','role','blockedAt','online','user','domain','blocked','minutes','clearBlockUser','getLicense','status','send','message','authenticate','json','use','User','passport','passport-local','Strategy','moment'];(function(_0x5d5f7e,_0x17b602){var _0x4df13f=function(_0x5cf293){while(--_0x5cf293){_0x5d5f7e['push'](_0x5d5f7e['shift']());}};_0x4df13f(++_0x17b602);}(_0x6889,0x114));var _0x9688=function(_0x13f5ac,_0x303066){_0x13f5ac=_0x13f5ac-0x0;var _0x163d97=_0x6889[_0x13f5ac];return _0x163d97;};'use strict';var passport=require(_0x9688('0x0'));var LocalStrategy=require(_0x9688('0x1'))[_0x9688('0x2')];var moment=require(_0x9688('0x3'));var ActiveDirectory=require(_0x9688('0x4'));var BPromise=require('bluebird');var util=require(_0x9688('0x5'));var db=require('../../mysqldb')['db'];var authService=require('../../components/auth/service');var utils=require(_0x9688('0x6'));var config=require(_0x9688('0x7'));var logger=require(_0x9688('0x8'))('api');function isActiveDirectoryConfigured(_0x795938){var _0x2b8881=![];if(typeof _0x795938[_0x9688('0x9')]!=='undefined'){_0x2b8881=_0x795938[_0x9688('0x9')]['baseDN']&&_0x795938['activedirectory'][_0x9688('0xa')]&&_0x795938['activedirectory']['domain'];}return _0x2b8881;}function adAuthenticate(_0x5322b0,_0x3171ed,_0x396ab2){return new BPromise(function(_0x284c71,_0x4d1ef0){try{var _0x123c50=new ActiveDirectory(_0x5322b0);_0x123c50['authenticate'](_0x3171ed,_0x396ab2,function(_0x53ba22,_0x59dec3){if(_0x53ba22){logger[_0x9688('0xb')](_0x9688('0xc'),_0x3171ed,util['inspect'](_0x53ba22,{'showHidden':![],'depth':null}));_0x4d1ef0('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(!_0x59dec3){logger[_0x9688('0xb')](_0x9688('0xd'),_0x3171ed);_0x4d1ef0(_0x9688('0xe'));}else{_0x284c71(_0x59dec3);}});}catch(_0x17a9ae){_0x4d1ef0(_0x17a9ae);}});}function ActiveDirectoryAuthenticate(_0x466211,_0x5f3055,_0x17b5f6,_0xd9dfc){var _0x2daabc,_0x1b3646;if(!isActiveDirectoryConfigured(config)){logger[_0x9688('0xb')](_0x9688('0xf'),_0x5f3055);return _0xd9dfc(null,![],{'message':_0x9688('0xe')});}return db[_0x9688('0x10')][_0x9688('0x11')]({'where':{'id':0x1},'attributes':[_0x9688('0x12'),_0x9688('0x13')],'raw':!![]})[_0x9688('0x14')](function(_0x51fe0e){_0x2daabc=_0x51fe0e;if(!_0x2daabc[_0x9688('0x12')]){logger[_0x9688('0xb')](_0x9688('0x15'),_0x5f3055);throw new Error(_0x9688('0xe'));}return _0x466211['findOne']({'attributes':['id',_0x9688('0x16'),_0x9688('0x17'),'salt',_0x9688('0x18'),'disabled','blocked',_0x9688('0x19'),_0x9688('0x1a')],'where':{'name':_0x5f3055,'role':{'$or':['admin',_0x9688('0x1b'),'agent']},'adSsoEnabled':!![]}});})[_0x9688('0x14')](function(_0x477a58){if(!_0x477a58||_0x477a58&&_0x477a58['name']!==_0x5f3055){throw new Error(_0x9688('0xe'));}_0x1b3646=_0x477a58;var _0x1faf51=_0x1b3646[_0x9688('0x16')]+'@'+config[_0x9688('0x9')][_0x9688('0x1c')];return adAuthenticate(config[_0x9688('0x9')],_0x1faf51,_0x17b5f6);})[_0x9688('0x14')](function(_0x2d196a){if(_0x1b3646['disabled']){throw new Error(_0x9688('0xe'));}if(_0x2daabc[_0x9688('0x13')]>0x0){if(_0x1b3646[_0x9688('0x1d')]){if(moment(_0x1b3646[_0x9688('0x19')])['add'](_0x2daabc['blockDuration'],_0x9688('0x1e'))>moment()){throw new Error(_0x9688('0xe'));}return utils[_0x9688('0x1f')](_0x1b3646,0x0,![],null)[_0x9688('0x14')](function(){return utils[_0x9688('0x20')](_0x1b3646);})[_0x9688('0x14')](function(){return _0xd9dfc(null,_0x1b3646);});}else{return utils[_0x9688('0x20')](_0x1b3646)[_0x9688('0x14')](function(){return _0xd9dfc(null,_0x1b3646);});}}else{return utils[_0x9688('0x20')](_0x1b3646)[_0x9688('0x14')](function(){return _0xd9dfc(null,_0x1b3646);});}})['catch'](function(_0x338caa){return _0xd9dfc(null,![],_0x338caa);});}function handleError(_0x204d7c,_0x698e50,_0xc2906){return _0x204d7c[_0x9688('0x21')](_0x698e50||0x1f4)[_0x9688('0x22')]({'message':_0xc2906?_0xc2906[_0x9688('0x23')]||_0xc2906:''});}exports['login']=function(_0x4a8168,_0x567312,_0x1d6e33){passport[_0x9688('0x24')]('ad-login',function(_0x299c31,_0x142071,_0x2d9408){var _0x1af471=_0x299c31||_0x2d9408;if(_0x1af471){return handleError(_0x567312,0x191,_0x1af471);}if(!_0x142071){return handleError(_0x567312,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x3bcb44={'payload':{'id':_0x142071['id'],'role':_0x142071[_0x9688('0x18')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x3bcb44)[_0x9688('0x14')](function(_0x22adaa){_0x567312[_0x9688('0x25')]({'id':_0x142071['id'],'token':_0x22adaa,'statusCall':'','isAlreadyLogged':_0x142071[_0x9688('0x1a')]});});}})(_0x4a8168,_0x567312,_0x1d6e33);};passport[_0x9688('0x26')]('ad-login',new LocalStrategy({'usernameField':'name','passwordField':_0x9688('0x17')},function(_0x5ba757,_0x4f8f07,_0x25f53e){return ActiveDirectoryAuthenticate(db[_0x9688('0x27')],_0x5ba757,_0x4f8f07,_0x25f53e);})); \ No newline at end of file +var _0xa55f=['getLicense','catch','status','send','message','login','ad-login','signToken','use','User','passport','passport-local','Strategy','activedirectory2','util','../../components/auth/service','../../config/utils','../../config/logger','api','activedirectory','undefined','domain','authenticate','error','Error\x20authenticate\x20%s:\x20%s','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','then','adSsoEnabled','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','password','role','disabled','blocked','blockedAt','online','admin','user','agent','name','blockDuration','minutes','clearBlockUser'];(function(_0x48f8ba,_0x3adddd){var _0x2867da=function(_0x39abd1){while(--_0x39abd1){_0x48f8ba['push'](_0x48f8ba['shift']());}};_0x2867da(++_0x3adddd);}(_0xa55f,0x172));var _0xfa55=function(_0x350c87,_0x2b44ef){_0x350c87=_0x350c87-0x0;var _0x163800=_0xa55f[_0x350c87];return _0x163800;};'use strict';var passport=require(_0xfa55('0x0'));var LocalStrategy=require(_0xfa55('0x1'))[_0xfa55('0x2')];var moment=require('moment');var ActiveDirectory=require(_0xfa55('0x3'));var BPromise=require('bluebird');var util=require(_0xfa55('0x4'));var db=require('../../mysqldb')['db'];var authService=require(_0xfa55('0x5'));var utils=require(_0xfa55('0x6'));var config=require('../../config/environment');var logger=require(_0xfa55('0x7'))(_0xfa55('0x8'));function isActiveDirectoryConfigured(_0x329eba){var _0x50307a=![];if(typeof _0x329eba[_0xfa55('0x9')]!==_0xfa55('0xa')){_0x50307a=_0x329eba['activedirectory']['baseDN']&&_0x329eba[_0xfa55('0x9')]['url']&&_0x329eba['activedirectory'][_0xfa55('0xb')];}return _0x50307a;}function adAuthenticate(_0x4ad3ce,_0x2a6d02,_0x28b94e){return new BPromise(function(_0x4c61a6,_0x430f89){try{var _0x476faa=new ActiveDirectory(_0x4ad3ce);_0x476faa[_0xfa55('0xc')](_0x2a6d02,_0x28b94e,function(_0x34b3ec,_0x2f8fcb){if(_0x34b3ec){logger[_0xfa55('0xd')](_0xfa55('0xe'),_0x2a6d02,util['inspect'](_0x34b3ec,{'showHidden':![],'depth':null}));_0x430f89(_0xfa55('0xf'));}else if(!_0x2f8fcb){logger[_0xfa55('0xd')]('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x2a6d02);_0x430f89(_0xfa55('0xf'));}else{_0x4c61a6(_0x2f8fcb);}});}catch(_0x24b614){_0x430f89(_0x24b614);}});}function ActiveDirectoryAuthenticate(_0x5811eb,_0x4e58ac,_0x567090,_0x7a2bbd){var _0x209d0c,_0x1a39ca;if(!isActiveDirectoryConfigured(config)){logger[_0xfa55('0xd')](_0xfa55('0x10'),_0x4e58ac);return _0x7a2bbd(null,![],{'message':_0xfa55('0xf')});}return db[_0xfa55('0x11')][_0xfa55('0x12')]({'where':{'id':0x1},'attributes':['adSsoEnabled','blockDuration'],'raw':!![]})[_0xfa55('0x13')](function(_0x27d661){_0x209d0c=_0x27d661;if(!_0x209d0c[_0xfa55('0x14')]){logger[_0xfa55('0xd')](_0xfa55('0x15'),_0x4e58ac);throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return _0x5811eb[_0xfa55('0x12')]({'attributes':['id','name',_0xfa55('0x16'),'salt',_0xfa55('0x17'),_0xfa55('0x18'),_0xfa55('0x19'),_0xfa55('0x1a'),_0xfa55('0x1b')],'where':{'name':_0x4e58ac,'role':{'$or':[_0xfa55('0x1c'),_0xfa55('0x1d'),_0xfa55('0x1e')]},'adSsoEnabled':!![]}});})[_0xfa55('0x13')](function(_0x24c36d){if(!_0x24c36d||_0x24c36d&&_0x24c36d[_0xfa55('0x1f')]!==_0x4e58ac){throw new Error(_0xfa55('0xf'));}_0x1a39ca=_0x24c36d;var _0x88a6a7=_0x1a39ca[_0xfa55('0x1f')]+'@'+config[_0xfa55('0x9')][_0xfa55('0xb')];return adAuthenticate(config[_0xfa55('0x9')],_0x88a6a7,_0x567090);})[_0xfa55('0x13')](function(_0x4dec3b){if(_0x1a39ca[_0xfa55('0x18')]){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}if(_0x209d0c[_0xfa55('0x20')]>0x0){if(_0x1a39ca[_0xfa55('0x19')]){if(moment(_0x1a39ca[_0xfa55('0x1a')])['add'](_0x209d0c['blockDuration'],_0xfa55('0x21'))>moment()){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return utils[_0xfa55('0x22')](_0x1a39ca,0x0,![],null)['then'](function(){return utils[_0xfa55('0x23')](_0x1a39ca);})[_0xfa55('0x13')](function(){return _0x7a2bbd(null,_0x1a39ca);});}else{return utils[_0xfa55('0x23')](_0x1a39ca)[_0xfa55('0x13')](function(){return _0x7a2bbd(null,_0x1a39ca);});}}else{return utils[_0xfa55('0x23')](_0x1a39ca)[_0xfa55('0x13')](function(){return _0x7a2bbd(null,_0x1a39ca);});}})[_0xfa55('0x24')](function(_0x5ae914){return _0x7a2bbd(null,![],_0x5ae914);});}function handleError(_0x29f76e,_0x5af8f6,_0x2c14d6){return _0x29f76e[_0xfa55('0x25')](_0x5af8f6||0x1f4)[_0xfa55('0x26')]({'message':_0x2c14d6?_0x2c14d6[_0xfa55('0x27')]||_0x2c14d6:''});}exports[_0xfa55('0x28')]=function(_0x1a7b3a,_0x18459a,_0x17b68a){passport[_0xfa55('0xc')](_0xfa55('0x29'),function(_0x18cebe,_0x4c61ae,_0x50e615){var _0xa2c581=_0x18cebe||_0x50e615;if(_0xa2c581){return handleError(_0x18459a,0x191,_0xa2c581);}if(!_0x4c61ae){return handleError(_0x18459a,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x509eba={'payload':{'id':_0x4c61ae['id'],'role':_0x4c61ae[_0xfa55('0x17')]},'options':{'expiresIn':0x15180}};return authService[_0xfa55('0x2a')](_0x509eba)[_0xfa55('0x13')](function(_0x588c25){_0x18459a['json']({'id':_0x4c61ae['id'],'token':_0x588c25,'statusCall':'','isAlreadyLogged':_0x4c61ae[_0xfa55('0x1b')]});});}})(_0x1a7b3a,_0x18459a,_0x17b68a);};passport[_0xfa55('0x2b')](_0xfa55('0x29'),new LocalStrategy({'usernameField':_0xfa55('0x1f'),'passwordField':_0xfa55('0x16')},function(_0xa932ee,_0x380625,_0x178fc8){return ActiveDirectoryAuthenticate(db[_0xfa55('0x2c')],_0xa932ee,_0x380625,_0x178fc8);})); \ No newline at end of file diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js index 50372c0..f0291b1 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 _0x2e55=['Router','./authActiveDirectory.controller','exports','express'];(function(_0x173f10,_0x35db61){var _0x53142d=function(_0x37bbef){while(--_0x37bbef){_0x173f10['push'](_0x173f10['shift']());}};_0x53142d(++_0x35db61);}(_0x2e55,0xeb));var _0x52e5=function(_0xf26d40,_0x2f4f46){_0xf26d40=_0xf26d40-0x0;var _0x50b68c=_0x2e55[_0xf26d40];return _0x50b68c;};'use strict';var express=require(_0x52e5('0x0'));var router=express[_0x52e5('0x1')]();var controller=require(_0x52e5('0x2'));router['post']('/',controller['login']);module[_0x52e5('0x3')]=router; \ No newline at end of file +var _0x9bb0=['login','Router','./authActiveDirectory.controller'];(function(_0x39d0e4,_0x13ae06){var _0x36ead2=function(_0x351268){while(--_0x351268){_0x39d0e4['push'](_0x39d0e4['shift']());}};_0x36ead2(++_0x13ae06);}(_0x9bb0,0x64));var _0x09bb=function(_0x11e001,_0xb3367b){_0x11e001=_0x11e001-0x0;var _0x417419=_0x9bb0[_0x11e001];return _0x417419;};'use strict';var express=require('express');var router=express[_0x09bb('0x0')]();var controller=require(_0x09bb('0x1'));router['post']('/',controller[_0x09bb('0x2')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index b895166..459c9cb 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(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x7a54,0x106));var _0x47a5=function(_0x28dc65,_0x47963e){_0x28dc65=_0x28dc65-0x0;var _0x74222b=_0x7a54[_0x28dc65];return _0x74222b;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});})); \ No newline at end of file +var _0x9957=['../../config/environment','../../config/utils','login','google','/login','profile','email','callback','authenticate','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','User','find','map','emails','value','admin','user','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb'];(function(_0x29d95d,_0x4396e7){var _0x5860c3=function(_0x3ffd61){while(--_0x3ffd61){_0x29d95d['push'](_0x29d95d['shift']());}};_0x5860c3(++_0x4396e7);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index 204d0ff..9700905 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 _0x5e58=['callback','isMiddleware','login','express','get','/callback'];(function(_0x364a17,_0x1c3288){var _0x1a78ce=function(_0x5940a3){while(--_0x5940a3){_0x364a17['push'](_0x364a17['shift']());}};_0x1a78ce(++_0x1c3288);}(_0x5e58,0x14d));var _0x85e5=function(_0x201b94,_0x5cada6){_0x201b94=_0x201b94-0x0;var _0x49da82=_0x5e58[_0x201b94];return _0x49da82;};'use strict';var express=require(_0x85e5('0x0'));var passport=require('passport');var router=express['Router']();var controller=require('./authGoogle.controller');var userController=require('../user/user.controller.js');var authService=require('../../components/auth/service');router[_0x85e5('0x1')]('/',controller['login']);router['get'](_0x85e5('0x2'),controller[_0x85e5('0x3')],authService[_0x85e5('0x4')],userController[_0x85e5('0x5')],authService['setTokenCookie']);module['exports']=router; \ No newline at end of file +var _0x5a26=['../user/user.controller.js','../../components/auth/service','get','/callback','callback','isMiddleware','express','passport','./authGoogle.controller'];(function(_0x1ccb48,_0x561988){var _0x4f5396=function(_0x3f5bc2){while(--_0x3f5bc2){_0x1ccb48['push'](_0x1ccb48['shift']());}};_0x4f5396(++_0x561988);}(_0x5a26,0x165));var _0x65a2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5a26[_0x3dd15e];return _0x231fd0;};'use strict';var express=require(_0x65a2('0x0'));var passport=require(_0x65a2('0x1'));var router=express['Router']();var controller=require(_0x65a2('0x2'));var userController=require(_0x65a2('0x3'));var authService=require(_0x65a2('0x4'));router['get']('/',controller['login']);router[_0x65a2('0x5')](_0x65a2('0x6'),controller[_0x65a2('0x7')],authService[_0x65a2('0x8')],userController['login'],authService['setTokenCookie']);module['exports']=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index 683724b..1db3500 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 _0x40ff=['findOne','allowedLoginAttempts','then','name','password','salt','role','disabled','blocked','admin','user','loginAttempts','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','minutes','clearBlockUser','blockedAt','add','getLicense','catch','find','email','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','\x22%s\x22\x20<%s>','request','SendMail','format','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','error','message','stringify','status','send','login','authenticate','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','forgot','body','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','now','save','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','passwordHistoryLimit','validatePasswordPattern','previousPasswords','validatePasswordHistory','resetPasswordExpires','Password\x20reset!','use','util','passport','passport-local','lodash','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting'];(function(_0x175cd1,_0x5dd9f8){var _0x3ff513=function(_0x2835c4){while(--_0x2835c4){_0x175cd1['push'](_0x175cd1['shift']());}};_0x3ff513(++_0x5dd9f8);}(_0x40ff,0xe8));var _0xf40f=function(_0x5e41f0,_0x1799cc){_0x5e41f0=_0x5e41f0-0x0;var _0x5c85c4=_0x40ff[_0x5e41f0];return _0x5c85c4;};'use strict';var util=require(_0xf40f('0x0'));var passport=require(_0xf40f('0x1'));var LocalStrategy=require(_0xf40f('0x2'))['Strategy'];var jayson=require('jayson/promise');var _=require(_0xf40f('0x3'));var rs=require('randomstring');var moment=require(_0xf40f('0x4'));var db=require(_0xf40f('0x5'))['db'];var authService=require(_0xf40f('0x6'));var utils=require(_0xf40f('0x7'));var client=jayson[_0xf40f('0x8')][_0xf40f('0x9')]({'port':0x232b});function localAuthenticate(_0x4323cf,_0x55d113,_0x4318c6,_0x2f9923){var _0xc6cdaf,_0x134784;return db[_0xf40f('0xa')][_0xf40f('0xb')]({'where':{'id':0x1},'attributes':[_0xf40f('0xc'),'blockDuration'],'raw':!![]})[_0xf40f('0xd')](function(_0x5bf174){_0xc6cdaf=_0x5bf174;return _0x4323cf['findOne']({'attributes':['id',_0xf40f('0xe'),_0xf40f('0xf'),_0xf40f('0x10'),_0xf40f('0x11'),_0xf40f('0x12'),_0xf40f('0x13'),'blockedAt','loginAttempts'],'where':{'name':_0x55d113,'role':{'$or':[_0xf40f('0x14'),_0xf40f('0x15'),'agent']}}});})['then'](function(_0x53948f){if(!_0x53948f||_0x53948f&&_0x53948f['name']!==_0x55d113){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x134784=_0x53948f;return _0x134784;}})[_0xf40f('0xd')](function(){_0x134784['authenticate'](_0x4318c6,function(_0x407c19,_0x14699d){var _0x54e684=_0x134784[_0xf40f('0x16')]+0x1;if(_0x407c19){return _0x2f9923(_0x407c19);}else if(!_0x14699d){if(_0x134784['disabled']){return _0x2f9923(null,![],{'message':_0xf40f('0x17')});}else if(_0xc6cdaf[_0xf40f('0xc')]>0x0){if(_0x134784['blocked']){if(_0xc6cdaf[_0xf40f('0x18')]>0x0){if(moment(_0x134784['blockedAt'])['add'](_0xc6cdaf[_0xf40f('0x18')],_0xf40f('0x19'))>moment()){return _0x2f9923(null,![],{'message':_0xf40f('0x17')});}else{return utils[_0xf40f('0x1a')](_0x134784,_0x54e684,![],null)[_0xf40f('0xd')](function(){return _0x2f9923(null,![],{'message':_0xf40f('0x17')});});}}else{return _0x2f9923(null,![],{'message':_0xf40f('0x17')});}}else{if(_0x54e684>=_0xc6cdaf[_0xf40f('0xc')]){return utils[_0xf40f('0x1a')](_0x134784,0x0,!![],moment())[_0xf40f('0xd')](function(){return _0x2f9923(null,![],{'message':_0xf40f('0x17')});});}else{return utils['clearBlockUser'](_0x134784,_0x54e684,![],null)[_0xf40f('0xd')](function(){return _0x2f9923(null,![],{'message':_0xf40f('0x17')});});}}}else{return _0x2f9923(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x134784[_0xf40f('0x12')]){return _0x2f9923(null,![],{'message':_0xf40f('0x17')});}else if(_0xc6cdaf[_0xf40f('0xc')]>0x0){if(_0x134784['blocked']){if(_0xc6cdaf['blockDuration']>0x0){if(moment(_0x134784[_0xf40f('0x1b')])[_0xf40f('0x1c')](_0xc6cdaf[_0xf40f('0x18')],_0xf40f('0x19'))>moment()){return _0x2f9923(null,![],{'message':_0xf40f('0x17')});}else{return utils['clearBlockUser'](_0x134784,0x0,![],null)[_0xf40f('0xd')](function(){return utils['getLicense'](_0x134784);})[_0xf40f('0xd')](function(){return _0x2f9923(null,_0x134784);});}}else{return _0x2f9923(null,![],{'message':_0xf40f('0x17')});}}else{return utils[_0xf40f('0x1a')](_0x134784,0x0,![],null)['then'](function(){return utils[_0xf40f('0x1d')](_0x134784);})[_0xf40f('0xd')](function(){return _0x2f9923(null,_0x134784);})[_0xf40f('0x1e')](function(_0x4d8e15){return _0x2f9923(null,![],_0x4d8e15);});}}else{if(_0x134784[_0xf40f('0x13')]){return _0x2f9923(null,![],{'message':_0xf40f('0x17')});}else{return utils['getLicense'](_0x134784)[_0xf40f('0xd')](function(){return _0x2f9923(null,_0x134784);});}}}});})[_0xf40f('0x1e')](function(_0x3b987d){return _0x2f9923(null,![],_0x3b987d);});}function sendServiceMail(_0x1e57a9){return db['MailAccount'][_0xf40f('0x1f')]({'where':{'service':!![]},'attributes':['id',_0xf40f('0xe'),_0xf40f('0x20')],'include':[{'model':db[_0xf40f('0x21')],'as':_0xf40f('0x22'),'include':[{'model':db[_0xf40f('0x23')],'as':_0xf40f('0x23')}]}]})['then'](function(_0x1333b7){if(!_0x1333b7){throw new Error(_0xf40f('0x24'));}var _0x1b642e=_0x1333b7[_0xf40f('0x25')]();var _0x371dc9={'account':_0x1b642e,'message':_['merge']({'from':util['format'](_0xf40f('0x26'),_0x1333b7[_0xf40f('0xe')],_0x1333b7['email']||_0x1333b7['Smtp'][_0xf40f('0x15')])},_0x1e57a9)};return client[_0xf40f('0x27')](_0xf40f('0x28'),_0x371dc9);})[_0xf40f('0xd')](function(_0x532240){if(_0x532240['error']){throw new Error(util[_0xf40f('0x29')](_0xf40f('0x2a'),_0x532240[_0xf40f('0x2b')][_0xf40f('0x2c')]||JSON[_0xf40f('0x2d')](_0x532240[_0xf40f('0x2b')])));}return!![];});}function handleError(_0x4aa496,_0x1ee844,_0x441bc1){return _0x4aa496[_0xf40f('0x2e')](_0x1ee844||0x1f4)[_0xf40f('0x2f')]({'message':_0x441bc1?_0x441bc1[_0xf40f('0x2c')]||_0x441bc1:''});}exports[_0xf40f('0x30')]=function(_0x2f9170,_0x3ddddc,_0x50d96d){passport[_0xf40f('0x31')](_0xf40f('0x32'),function(_0x2f95b8,_0x556c8e,_0x5dd8f6){var _0x2eafb4=_0x2f95b8||_0x5dd8f6;if(_0x2eafb4){return handleError(_0x3ddddc,0x191,_0x2eafb4);}if(!_0x556c8e){return handleError(_0x3ddddc,0x194,{'message':_0xf40f('0x33')});}else{var _0x45d57c={'payload':{'id':_0x556c8e['id'],'role':_0x556c8e[_0xf40f('0x11')]},'options':{'expiresIn':0x15180}};return authService[_0xf40f('0x34')](_0x45d57c)['then'](function(_0x3bc02d){_0x3ddddc[_0xf40f('0x35')]({'id':_0x556c8e['id'],'token':_0x3bc02d,'statusCall':'','isAlreadyLogged':_0x556c8e['online']});});}})(_0x2f9170,_0x3ddddc,_0x50d96d);};exports[_0xf40f('0x36')]=function(_0x115e58,_0x4c22d6){if(!_0x115e58[_0xf40f('0x37')][_0xf40f('0x20')]){return handleError(_0x4c22d6,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0xcc2eb3=rs['generate']();_0x115e58[_0xf40f('0x37')][_0xf40f('0x20')]=_0x115e58[_0xf40f('0x37')]['email'][_0xf40f('0x38')]()[_0xf40f('0x39')]();var _0x4b4879;return db[_0xf40f('0xa')]['findOne']({'where':{'id':0x1},'attributes':[_0xf40f('0xc'),_0xf40f('0x18')],'raw':!![]})[_0xf40f('0xd')](function(_0x4609f0){_0x4b4879=_0x4609f0;return db[_0xf40f('0x3a')][_0xf40f('0x1f')]({'where':{'email':_0x115e58[_0xf40f('0x37')]['email']}});})[_0xf40f('0xd')](function(_0x19ddc3){if(!_0x19ddc3){throw new Error(_0xf40f('0x3b'));}if(_0x19ddc3['disabled']){throw new Error(_0xf40f('0x3c'));}if(_0x19ddc3[_0xf40f('0x13')]){if(moment(_0x19ddc3['blockedAt'])[_0xf40f('0x1c')](_0x4b4879[_0xf40f('0x18')],_0xf40f('0x19'))>moment()){throw new Error(_0xf40f('0x3d'));}else{_0x19ddc3[_0xf40f('0x13')]=![];_0x19ddc3['blockedAt']=null;}}_0x19ddc3['resetPasswordToken']=_0xcc2eb3;_0x19ddc3['resetPasswordExpires']=Date[_0xf40f('0x3e')]()+0x36ee80;return _0x19ddc3[_0xf40f('0x3f')]();})['then'](function(){return sendServiceMail({'to':_0x115e58['body'][_0xf40f('0x20')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0xf40f('0x40')+_0xf40f('0x41')+_0xf40f('0x42')+_0x115e58[_0xf40f('0x43')]['host']+'/reset/'+_0xcc2eb3+'\x0a\x0a'+_0xf40f('0x44')});})['then'](function(){_0x4c22d6[_0xf40f('0x2e')](0xc8)[_0xf40f('0x2f')]({'message':_0xf40f('0x45')});})[_0xf40f('0x1e')](function(_0x360340){return handleError(_0x4c22d6,0x1f4,_0x360340);});};exports[_0xf40f('0x46')]=function(_0x47ce81,_0x3d3087){return db[_0xf40f('0x3a')][_0xf40f('0x1f')]({'where':{'resetPasswordToken':_0x47ce81['params'][_0xf40f('0x47')],'resetPasswordExpires':{'$gt':Date[_0xf40f('0x3e')]()}}})[_0xf40f('0xd')](function(_0x577374){if(!_0x577374){throw new Error(_0xf40f('0x48'));}return db['Setting'][_0xf40f('0xb')]({'attributes':['id',_0xf40f('0x49'),'enforcePasswordHistory',_0xf40f('0x4a')]})[_0xf40f('0xd')](function(_0x17e0d4){if(_0x17e0d4[_0xf40f('0x49')])authService[_0xf40f('0x4b')](_0x47ce81[_0xf40f('0x37')][_0xf40f('0xf')]);if(!_0x17e0d4['enforcePasswordHistory']||!_0x577374[_0xf40f('0x4c')])return _0x577374;authService[_0xf40f('0x4d')](_0x47ce81['body'][_0xf40f('0xf')],_0x577374[_0xf40f('0x4c')],_0x17e0d4['passwordHistoryLimit']);return _0x577374;})[_0xf40f('0xd')](function(){_0x577374['password']=_0x47ce81[_0xf40f('0x37')]['password'];_0x577374['resetPasswordToken']=null;_0x577374[_0xf40f('0x4e')]=null;return _0x577374['save']();});})['then'](function(){_0x3d3087[_0xf40f('0x2e')](0xc8)[_0xf40f('0x2f')]({'message':_0xf40f('0x4f')});})[_0xf40f('0x1e')](function(_0xd15605){return handleError(_0x3d3087,0x1f4,_0xd15605);});};passport[_0xf40f('0x50')](_0xf40f('0x32'),new LocalStrategy({'usernameField':_0xf40f('0xe'),'passwordField':_0xf40f('0xf')},function(_0x4e5bc8,_0x38e62d,_0x41ebbc){return localAuthenticate(db[_0xf40f('0x3a')],_0x4e5bc8,_0x38e62d,_0x41ebbc);})); \ No newline at end of file +var _0x5d3b=['The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','now','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','host','/reset/','send','Reset\x20Email\x20sent!','reset','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','previousPasswords','validatePasswordHistory','password','resetPasswordExpires','save','Password\x20reset!','util','passport-local','Strategy','jayson/promise','randomstring','moment','../../components/auth/service','http','findOne','allowedLoginAttempts','blockDuration','then','name','role','disabled','blockedAt','admin','user','agent','authenticate','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','add','clearBlockUser','minutes','getLicense','catch','MailAccount','find','MailServerOut','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','merge','format','\x22%s\x22\x20<%s>','email','request','error','message','stringify','status','login','local-login','online','forgot','body','generate','Setting','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.'];(function(_0x484945,_0x44c47d){var _0x5de501=function(_0xc3ac8e){while(--_0xc3ac8e){_0x484945['push'](_0x484945['shift']());}};_0x5de501(++_0x44c47d);}(_0x5d3b,0x1d3));var _0xb5d3=function(_0x3b18ec,_0x17bc5a){_0x3b18ec=_0x3b18ec-0x0;var _0x34b5c1=_0x5d3b[_0x3b18ec];return _0x34b5c1;};'use strict';var util=require(_0xb5d3('0x0'));var passport=require('passport');var LocalStrategy=require(_0xb5d3('0x1'))[_0xb5d3('0x2')];var jayson=require(_0xb5d3('0x3'));var _=require('lodash');var rs=require(_0xb5d3('0x4'));var moment=require(_0xb5d3('0x5'));var db=require('../../mysqldb')['db'];var authService=require(_0xb5d3('0x6'));var utils=require('../../config/utils');var client=jayson['client'][_0xb5d3('0x7')]({'port':0x232b});function localAuthenticate(_0x55dd1a,_0x2e825a,_0x5bf12a,_0x4b5076){var _0x3378d0,_0x107bb9;return db['Setting'][_0xb5d3('0x8')]({'where':{'id':0x1},'attributes':[_0xb5d3('0x9'),_0xb5d3('0xa')],'raw':!![]})[_0xb5d3('0xb')](function(_0x517047){_0x3378d0=_0x517047;return _0x55dd1a['findOne']({'attributes':['id',_0xb5d3('0xc'),'password','salt',_0xb5d3('0xd'),_0xb5d3('0xe'),'blocked',_0xb5d3('0xf'),'loginAttempts'],'where':{'name':_0x2e825a,'role':{'$or':[_0xb5d3('0x10'),_0xb5d3('0x11'),_0xb5d3('0x12')]}}});})[_0xb5d3('0xb')](function(_0x110507){if(!_0x110507||_0x110507&&_0x110507[_0xb5d3('0xc')]!==_0x2e825a){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x107bb9=_0x110507;return _0x107bb9;}})[_0xb5d3('0xb')](function(){_0x107bb9[_0xb5d3('0x13')](_0x5bf12a,function(_0x203066,_0xb4fc2){var _0x51b0f6=_0x107bb9['loginAttempts']+0x1;if(_0x203066){return _0x4b5076(_0x203066);}else if(!_0xb4fc2){if(_0x107bb9[_0xb5d3('0xe')]){return _0x4b5076(null,![],{'message':_0xb5d3('0x14')});}else if(_0x3378d0[_0xb5d3('0x9')]>0x0){if(_0x107bb9[_0xb5d3('0x15')]){if(_0x3378d0['blockDuration']>0x0){if(moment(_0x107bb9[_0xb5d3('0xf')])[_0xb5d3('0x16')](_0x3378d0[_0xb5d3('0xa')],'minutes')>moment()){return _0x4b5076(null,![],{'message':_0xb5d3('0x14')});}else{return utils[_0xb5d3('0x17')](_0x107bb9,_0x51b0f6,![],null)[_0xb5d3('0xb')](function(){return _0x4b5076(null,![],{'message':_0xb5d3('0x14')});});}}else{return _0x4b5076(null,![],{'message':_0xb5d3('0x14')});}}else{if(_0x51b0f6>=_0x3378d0[_0xb5d3('0x9')]){return utils[_0xb5d3('0x17')](_0x107bb9,0x0,!![],moment())[_0xb5d3('0xb')](function(){return _0x4b5076(null,![],{'message':_0xb5d3('0x14')});});}else{return utils[_0xb5d3('0x17')](_0x107bb9,_0x51b0f6,![],null)[_0xb5d3('0xb')](function(){return _0x4b5076(null,![],{'message':_0xb5d3('0x14')});});}}}else{return _0x4b5076(null,![],{'message':_0xb5d3('0x14')});}}else{if(_0x107bb9[_0xb5d3('0xe')]){return _0x4b5076(null,![],{'message':_0xb5d3('0x14')});}else if(_0x3378d0[_0xb5d3('0x9')]>0x0){if(_0x107bb9['blocked']){if(_0x3378d0[_0xb5d3('0xa')]>0x0){if(moment(_0x107bb9[_0xb5d3('0xf')])[_0xb5d3('0x16')](_0x3378d0['blockDuration'],_0xb5d3('0x18'))>moment()){return _0x4b5076(null,![],{'message':_0xb5d3('0x14')});}else{return utils[_0xb5d3('0x17')](_0x107bb9,0x0,![],null)[_0xb5d3('0xb')](function(){return utils[_0xb5d3('0x19')](_0x107bb9);})[_0xb5d3('0xb')](function(){return _0x4b5076(null,_0x107bb9);});}}else{return _0x4b5076(null,![],{'message':_0xb5d3('0x14')});}}else{return utils['clearBlockUser'](_0x107bb9,0x0,![],null)[_0xb5d3('0xb')](function(){return utils['getLicense'](_0x107bb9);})[_0xb5d3('0xb')](function(){return _0x4b5076(null,_0x107bb9);})[_0xb5d3('0x1a')](function(_0x1d8d9d){return _0x4b5076(null,![],_0x1d8d9d);});}}else{if(_0x107bb9[_0xb5d3('0x15')]){return _0x4b5076(null,![],{'message':_0xb5d3('0x14')});}else{return utils[_0xb5d3('0x19')](_0x107bb9)[_0xb5d3('0xb')](function(){return _0x4b5076(null,_0x107bb9);});}}}});})[_0xb5d3('0x1a')](function(_0x18ecf0){return _0x4b5076(null,![],_0x18ecf0);});}function sendServiceMail(_0x344a84){return db[_0xb5d3('0x1b')][_0xb5d3('0x1c')]({'where':{'service':!![]},'attributes':['id',_0xb5d3('0xc'),'email'],'include':[{'model':db[_0xb5d3('0x1d')],'as':'Smtp','include':[{'model':db[_0xb5d3('0x1e')],'as':_0xb5d3('0x1e')}]}]})[_0xb5d3('0xb')](function(_0x1ca3f4){if(!_0x1ca3f4){throw new Error(_0xb5d3('0x1f'));}var _0x1fc95a=_0x1ca3f4['getSmtpOptions']();var _0x2190d3={'account':_0x1fc95a,'message':_[_0xb5d3('0x20')]({'from':util[_0xb5d3('0x21')](_0xb5d3('0x22'),_0x1ca3f4[_0xb5d3('0xc')],_0x1ca3f4[_0xb5d3('0x23')]||_0x1ca3f4['Smtp'][_0xb5d3('0x11')])},_0x344a84)};return client[_0xb5d3('0x24')]('SendMail',_0x2190d3);})[_0xb5d3('0xb')](function(_0x4cd2de){if(_0x4cd2de[_0xb5d3('0x25')]){throw new Error(util[_0xb5d3('0x21')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x4cd2de[_0xb5d3('0x25')][_0xb5d3('0x26')]||JSON[_0xb5d3('0x27')](_0x4cd2de[_0xb5d3('0x25')])));}return!![];});}function handleError(_0x443920,_0x2edd5f,_0x1c85a2){return _0x443920[_0xb5d3('0x28')](_0x2edd5f||0x1f4)['send']({'message':_0x1c85a2?_0x1c85a2[_0xb5d3('0x26')]||_0x1c85a2:''});}exports[_0xb5d3('0x29')]=function(_0x4dcc26,_0x18e0ae,_0x3fe347){passport[_0xb5d3('0x13')](_0xb5d3('0x2a'),function(_0x256c95,_0x26dea0,_0x320536){var _0x2a02b3=_0x256c95||_0x320536;if(_0x2a02b3){return handleError(_0x18e0ae,0x191,_0x2a02b3);}if(!_0x26dea0){return handleError(_0x18e0ae,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x31edba={'payload':{'id':_0x26dea0['id'],'role':_0x26dea0['role']},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x31edba)[_0xb5d3('0xb')](function(_0x34b0d1){_0x18e0ae['json']({'id':_0x26dea0['id'],'token':_0x34b0d1,'statusCall':'','isAlreadyLogged':_0x26dea0[_0xb5d3('0x2b')]});});}})(_0x4dcc26,_0x18e0ae,_0x3fe347);};exports[_0xb5d3('0x2c')]=function(_0x32d5a5,_0x4299bf){if(!_0x32d5a5[_0xb5d3('0x2d')][_0xb5d3('0x23')]){return handleError(_0x4299bf,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x171619=rs[_0xb5d3('0x2e')]();_0x32d5a5[_0xb5d3('0x2d')][_0xb5d3('0x23')]=_0x32d5a5[_0xb5d3('0x2d')]['email']['trim']()['toLowerCase']();var _0xa00dd7;return db[_0xb5d3('0x2f')]['findOne']({'where':{'id':0x1},'attributes':[_0xb5d3('0x9'),_0xb5d3('0xa')],'raw':!![]})[_0xb5d3('0xb')](function(_0x270cd8){_0xa00dd7=_0x270cd8;return db[_0xb5d3('0x30')]['find']({'where':{'email':_0x32d5a5[_0xb5d3('0x2d')][_0xb5d3('0x23')]}});})[_0xb5d3('0xb')](function(_0x288821){if(!_0x288821){throw new Error(_0xb5d3('0x31'));}if(_0x288821['disabled']){throw new Error(_0xb5d3('0x32'));}if(_0x288821[_0xb5d3('0x15')]){if(moment(_0x288821[_0xb5d3('0xf')])[_0xb5d3('0x16')](_0xa00dd7[_0xb5d3('0xa')],'minutes')>moment()){throw new Error(_0xb5d3('0x33'));}else{_0x288821['blocked']=![];_0x288821[_0xb5d3('0xf')]=null;}}_0x288821[_0xb5d3('0x34')]=_0x171619;_0x288821['resetPasswordExpires']=Date[_0xb5d3('0x35')]()+0x36ee80;return _0x288821['save']();})[_0xb5d3('0xb')](function(){return sendServiceMail({'to':_0x32d5a5[_0xb5d3('0x2d')][_0xb5d3('0x23')],'subject':_0xb5d3('0x36'),'text':_0xb5d3('0x37')+_0xb5d3('0x38')+_0xb5d3('0x39')+_0x32d5a5[_0xb5d3('0x3a')][_0xb5d3('0x3b')]+_0xb5d3('0x3c')+_0x171619+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})['then'](function(){_0x4299bf[_0xb5d3('0x28')](0xc8)[_0xb5d3('0x3d')]({'message':_0xb5d3('0x3e')});})[_0xb5d3('0x1a')](function(_0x1dc65d){return handleError(_0x4299bf,0x1f4,_0x1dc65d);});};exports[_0xb5d3('0x3f')]=function(_0x5aa16c,_0x2b32b3){return db[_0xb5d3('0x30')]['find']({'where':{'resetPasswordToken':_0x5aa16c['params']['token'],'resetPasswordExpires':{'$gt':Date['now']()}}})['then'](function(_0x4323bd){if(!_0x4323bd){throw new Error(_0xb5d3('0x40'));}return db[_0xb5d3('0x2f')]['findOne']({'attributes':['id',_0xb5d3('0x41'),_0xb5d3('0x42'),_0xb5d3('0x43')]})[_0xb5d3('0xb')](function(_0x54899c){if(_0x54899c[_0xb5d3('0x41')])authService['validatePasswordPattern'](_0x5aa16c[_0xb5d3('0x2d')]['password']);if(!_0x54899c[_0xb5d3('0x42')]||!_0x4323bd[_0xb5d3('0x44')])return _0x4323bd;authService[_0xb5d3('0x45')](_0x5aa16c[_0xb5d3('0x2d')][_0xb5d3('0x46')],_0x4323bd['previousPasswords'],_0x54899c[_0xb5d3('0x43')]);return _0x4323bd;})['then'](function(){_0x4323bd['password']=_0x5aa16c[_0xb5d3('0x2d')][_0xb5d3('0x46')];_0x4323bd['resetPasswordToken']=null;_0x4323bd[_0xb5d3('0x47')]=null;return _0x4323bd[_0xb5d3('0x48')]();});})[_0xb5d3('0xb')](function(){_0x2b32b3[_0xb5d3('0x28')](0xc8)['send']({'message':_0xb5d3('0x49')});})['catch'](function(_0x226967){return handleError(_0x2b32b3,0x1f4,_0x226967);});};passport['use'](_0xb5d3('0x2a'),new LocalStrategy({'usernameField':_0xb5d3('0xc'),'passwordField':'password'},function(_0xa8a1a2,_0x1071de,_0x5e942a){return localAuthenticate(db[_0xb5d3('0x30')],_0xa8a1a2,_0x1071de,_0x5e942a);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index cce9aed..2af4a80 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 _0x3ef3=['post','login','forgot','/reset/:token','express','Router'];(function(_0x587bdb,_0xffed85){var _0x3e292c=function(_0xc1bb6b){while(--_0xc1bb6b){_0x587bdb['push'](_0x587bdb['shift']());}};_0x3e292c(++_0xffed85);}(_0x3ef3,0xdc));var _0x33ef=function(_0x3ffa4a,_0xbfbae4){_0x3ffa4a=_0x3ffa4a-0x0;var _0x4e9062=_0x3ef3[_0x3ffa4a];return _0x4e9062;};'use strict';var express=require(_0x33ef('0x0'));var router=express[_0x33ef('0x1')]();var controller=require('./authLocal.controller');router[_0x33ef('0x2')]('/',controller[_0x33ef('0x3')]);router[_0x33ef('0x2')]('/forgot',controller[_0x33ef('0x4')]);router['post'](_0x33ef('0x5'),controller['reset']);module['exports']=router; \ No newline at end of file +var _0x3b01=['forgot','post','/reset/:token','reset','express','./authLocal.controller','login','/forgot'];(function(_0x102ff9,_0x907658){var _0x24fa97=function(_0x3622ff){while(--_0x3622ff){_0x102ff9['push'](_0x102ff9['shift']());}};_0x24fa97(++_0x907658);}(_0x3b01,0x94));var _0x13b0=function(_0x5e4e37,_0x57e4ad){_0x5e4e37=_0x5e4e37-0x0;var _0xea325=_0x3b01[_0x5e4e37];return _0xea325;};'use strict';var express=require(_0x13b0('0x0'));var router=express['Router']();var controller=require(_0x13b0('0x1'));router['post']('/',controller[_0x13b0('0x2')]);router['post'](_0x13b0('0x3'),controller[_0x13b0('0x4')]);router[_0x13b0('0x5')](_0x13b0('0x6'),controller[_0x13b0('0x7')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index a775fcb..791ca97 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 _0x8a04=['sequelize','STRING','INTEGER'];(function(_0x4ad0f7,_0x1920b0){var _0x30f5c8=function(_0x2aa6b6){while(--_0x2aa6b6){_0x4ad0f7['push'](_0x4ad0f7['shift']());}};_0x30f5c8(++_0x1920b0);}(_0x8a04,0x1d7));var _0x48a0=function(_0x3cba10,_0x365836){_0x3cba10=_0x3cba10-0x0;var _0x27fc93=_0x8a04[_0x3cba10];return _0x27fc93;};'use strict';var Sequelize=require(_0x48a0('0x0'));module['exports']={'name':{'type':Sequelize[_0x48a0('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0x48a0('0x1')]},'description':{'type':Sequelize[_0x48a0('0x1')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0x48a0('0x2')],'defaultValue':0xa}}; \ No newline at end of file +var _0x04be=['BOOLEAN','INTEGER','exports','STRING'];(function(_0x3067f3,_0x55914e){var _0xcecdf4=function(_0x2a5929){while(--_0x2a5929){_0x3067f3['push'](_0x3067f3['shift']());}};_0xcecdf4(++_0x55914e);}(_0x04be,0x162));var _0xe04b=function(_0x3169a3,_0x48f18b){_0x3169a3=_0x3169a3-0x0;var _0x4f34de=_0x04be[_0x3169a3];return _0x4f34de;};'use strict';var Sequelize=require('sequelize');module[_0xe04b('0x0')]={'name':{'type':Sequelize[_0xe04b('0x1')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0xe04b('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xe04b('0x3')],'defaultValue':0xa}}; \ No newline at end of file diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js index cbef0c3..bf2e6b8 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 _0xcee9=['Content-Range','apply','reject','update','then','destroy','end','sendStatus','error','stack','name','send','index','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','Automation','includeAll','include','findAll','rows','show','params','find','catch','create','body','addConditions','Condition','ids','omit','order','getConditions','addActions','Action','getActions','findOne','nolimit','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set'];(function(_0x48f848,_0x887c01){var _0x783f00=function(_0x58902a){while(--_0x58902a){_0x48f848['push'](_0x48f848['shift']());}};_0x783f00(++_0x887c01);}(_0xcee9,0xe8));var _0x9cee=function(_0x3017f3,_0x138709){_0x3017f3=_0x3017f3-0x0;var _0x1a7b94=_0xcee9[_0x3017f3];return _0x1a7b94;};'use strict';var emlformat=require(_0x9cee('0x0'));var rimraf=require(_0x9cee('0x1'));var zipdir=require(_0x9cee('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9cee('0x3'));var moment=require(_0x9cee('0x4'));var BPromise=require(_0x9cee('0x5'));var Mustache=require(_0x9cee('0x6'));var util=require(_0x9cee('0x7'));var path=require(_0x9cee('0x8'));var sox=require(_0x9cee('0x9'));var csv=require(_0x9cee('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9cee('0xb'));var _=require(_0x9cee('0xc'));var squel=require('squel');var crypto=require(_0x9cee('0xd'));var jsforce=require(_0x9cee('0xe'));var deskjs=require(_0x9cee('0xf'));var toCsv=require(_0x9cee('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x9cee('0x10'));var authService=require(_0x9cee('0x11'));var qs=require(_0x9cee('0x12'));var as=require(_0x9cee('0x13'));var hardwareService=require(_0x9cee('0x14'));var logger=require('../../config/logger')(_0x9cee('0x15'));var utils=require('../../config/utils');var config=require(_0x9cee('0x16'));var licenseUtil=require(_0x9cee('0x17'));var db=require(_0x9cee('0x18'))['db'];function respondWithStatusCode(_0x1b2854,_0x5e6b9b){_0x5e6b9b=_0x5e6b9b||0xcc;return function(_0x149a7f){if(_0x149a7f){return _0x1b2854['sendStatus'](_0x5e6b9b);}return _0x1b2854['status'](_0x5e6b9b)['end']();};}function respondWithResult(_0x110be6,_0x5a0064){_0x5a0064=_0x5a0064||0xc8;return function(_0x429ed7){if(_0x429ed7){return _0x110be6[_0x9cee('0x19')](_0x5a0064)[_0x9cee('0x1a')](_0x429ed7);}};}function respondWithFilteredResult(_0x340065,_0x4569f4){return function(_0x384ee1){if(_0x384ee1){var _0x2a075=typeof _0x4569f4[_0x9cee('0x1b')]===_0x9cee('0x1c')&&typeof _0x4569f4[_0x9cee('0x1d')]===_0x9cee('0x1c');var _0x1d0a5c=_0x384ee1['count'];var _0xed57bc=_0x2a075?0x0:_0x4569f4[_0x9cee('0x1b')];var _0x17c180=_0x2a075?_0x384ee1[_0x9cee('0x1e')]:_0x4569f4[_0x9cee('0x1b')]+_0x4569f4[_0x9cee('0x1d')];var _0x7f4bed;if(_0x17c180>=_0x1d0a5c){_0x17c180=_0x1d0a5c;_0x7f4bed=0xc8;}else{_0x7f4bed=0xce;}_0x340065[_0x9cee('0x19')](_0x7f4bed);return _0x340065[_0x9cee('0x1f')](_0x9cee('0x20'),_0xed57bc+'-'+_0x17c180+'/'+_0x1d0a5c)['json'](_0x384ee1);}return null;};}function patchUpdates(_0x475c8b){return function(_0x259984){try{jsonpatch[_0x9cee('0x21')](_0x259984,_0x475c8b,!![]);}catch(_0x4fb879){return BPromise[_0x9cee('0x22')](_0x4fb879);}return _0x259984['save']();};}function saveUpdates(_0x5a713a,_0x184da2){return function(_0x17aee2){if(_0x17aee2){return _0x17aee2[_0x9cee('0x23')](_0x5a713a)[_0x9cee('0x24')](function(_0x5754a9){return _0x5754a9;});}return null;};}function removeEntity(_0x2a6fdc,_0x11e205){return function(_0x483c96){if(_0x483c96){return _0x483c96[_0x9cee('0x25')]()[_0x9cee('0x24')](function(){_0x2a6fdc[_0x9cee('0x19')](0xcc)[_0x9cee('0x26')]();});}};}function handleEntityNotFound(_0x5e445b,_0x19f746){return function(_0x276a78){if(!_0x276a78){_0x5e445b[_0x9cee('0x27')](0x194);}return _0x276a78;};}function handleError(_0x39d310,_0x5de48a){_0x5de48a=_0x5de48a||0x1f4;return function(_0x51bcc9){logger[_0x9cee('0x28')](_0x51bcc9[_0x9cee('0x29')]);if(_0x51bcc9[_0x9cee('0x2a')]){delete _0x51bcc9['name'];}_0x39d310[_0x9cee('0x19')](_0x5de48a)[_0x9cee('0x2b')](_0x51bcc9);};}exports[_0x9cee('0x2c')]=function(_0x2c6252,_0x5ee160){var _0x2f891a={},_0x4c90c1={},_0x598e70={'count':0x0,'rows':[]};var _0x3af562=_['map'](db['Automation'][_0x9cee('0x2d')],function(_0xdeab53){return{'name':_0xdeab53[_0x9cee('0x2e')],'type':_0xdeab53[_0x9cee('0x2f')][_0x9cee('0x30')]};});_0x4c90c1['model']=_[_0x9cee('0x31')](_0x3af562,_0x9cee('0x2a'));_0x4c90c1[_0x9cee('0x32')]=_[_0x9cee('0x33')](_0x2c6252[_0x9cee('0x32')]);_0x4c90c1[_0x9cee('0x34')]=_[_0x9cee('0x35')](_0x4c90c1[_0x9cee('0x36')],_0x4c90c1[_0x9cee('0x32')]);_0x2f891a[_0x9cee('0x37')]=_['intersection'](_0x4c90c1[_0x9cee('0x36')],qs['fields'](_0x2c6252['query'][_0x9cee('0x38')]));_0x2f891a['attributes']=_0x2f891a[_0x9cee('0x37')][_0x9cee('0x39')]?_0x2f891a[_0x9cee('0x37')]:_0x4c90c1[_0x9cee('0x36')];if(!_0x2c6252['query'][_0x9cee('0x3a')]('nolimit')){_0x2f891a['limit']=qs[_0x9cee('0x1d')](_0x2c6252[_0x9cee('0x32')]['limit']);_0x2f891a[_0x9cee('0x1b')]=qs[_0x9cee('0x1b')](_0x2c6252[_0x9cee('0x32')][_0x9cee('0x1b')]);}_0x2f891a['order']=qs[_0x9cee('0x3b')](_0x2c6252[_0x9cee('0x32')][_0x9cee('0x3b')]);_0x2f891a[_0x9cee('0x3c')]=qs[_0x9cee('0x34')](_[_0x9cee('0x3d')](_0x2c6252['query'],_0x4c90c1[_0x9cee('0x34')]),_0x3af562);if(_0x2c6252[_0x9cee('0x32')][_0x9cee('0x3e')]){_0x2f891a['where']=_[_0x9cee('0x3f')](_0x2f891a['where'],{'$or':_[_0x9cee('0x31')](_0x3af562,function(_0x5eb118){if(_0x5eb118[_0x9cee('0x2f')]!==_0x9cee('0x40')){var _0x345614={};_0x345614[_0x5eb118['name']]={'$like':'%'+_0x2c6252['query'][_0x9cee('0x3e')]+'%'};return _0x345614;}})});}_0x2f891a=_[_0x9cee('0x3f')]({},_0x2f891a,_0x2c6252[_0x9cee('0x41')]);var _0x415b8b={'where':_0x2f891a[_0x9cee('0x3c')]};return db[_0x9cee('0x42')]['count'](_0x415b8b)[_0x9cee('0x24')](function(_0x2d87fc){_0x598e70[_0x9cee('0x1e')]=_0x2d87fc;if(_0x2c6252[_0x9cee('0x32')][_0x9cee('0x43')]){_0x2f891a[_0x9cee('0x44')]=[{'all':!![]}];}return db[_0x9cee('0x42')][_0x9cee('0x45')](_0x2f891a);})['then'](function(_0x390a6a){_0x598e70[_0x9cee('0x46')]=_0x390a6a;return _0x598e70;})['then'](respondWithFilteredResult(_0x5ee160,_0x2f891a))['catch'](handleError(_0x5ee160,null));};exports[_0x9cee('0x47')]=function(_0x33cacc,_0x43ed0c){var _0x4823b2={'raw':![],'where':{'id':_0x33cacc[_0x9cee('0x48')]['id']}},_0x404fa6={};_0x404fa6[_0x9cee('0x36')]=_[_0x9cee('0x33')](db[_0x9cee('0x42')]['rawAttributes']);_0x404fa6[_0x9cee('0x32')]=_[_0x9cee('0x33')](_0x33cacc[_0x9cee('0x32')]);_0x404fa6[_0x9cee('0x34')]=_[_0x9cee('0x35')](_0x404fa6[_0x9cee('0x36')],_0x404fa6[_0x9cee('0x32')]);_0x4823b2[_0x9cee('0x37')]=_[_0x9cee('0x35')](_0x404fa6['model'],qs[_0x9cee('0x38')](_0x33cacc['query'][_0x9cee('0x38')]));_0x4823b2['attributes']=_0x4823b2[_0x9cee('0x37')][_0x9cee('0x39')]?_0x4823b2['attributes']:_0x404fa6[_0x9cee('0x36')];if(_0x33cacc[_0x9cee('0x32')][_0x9cee('0x43')]){_0x4823b2['include']=[{'all':!![]}];}_0x4823b2=_[_0x9cee('0x3f')]({},_0x4823b2,_0x33cacc[_0x9cee('0x41')]);return db[_0x9cee('0x42')][_0x9cee('0x49')](_0x4823b2)[_0x9cee('0x24')](handleEntityNotFound(_0x43ed0c,null))[_0x9cee('0x24')](respondWithResult(_0x43ed0c,null))[_0x9cee('0x4a')](handleError(_0x43ed0c,null));};exports[_0x9cee('0x4b')]=function(_0x2de9ed,_0xbcef18){return db[_0x9cee('0x42')][_0x9cee('0x4b')](_0x2de9ed[_0x9cee('0x4c')],{})[_0x9cee('0x24')](respondWithResult(_0xbcef18,0xc9))[_0x9cee('0x4a')](handleError(_0xbcef18,null));};exports['update']=function(_0x51d0ee,_0x5827bd){if(_0x51d0ee[_0x9cee('0x4c')]['id']){delete _0x51d0ee['body']['id'];}return db[_0x9cee('0x42')][_0x9cee('0x49')]({'where':{'id':_0x51d0ee[_0x9cee('0x48')]['id']}})[_0x9cee('0x24')](handleEntityNotFound(_0x5827bd,null))[_0x9cee('0x24')](saveUpdates(_0x51d0ee['body'],null))['then'](respondWithResult(_0x5827bd,null))[_0x9cee('0x4a')](handleError(_0x5827bd,null));};exports['destroy']=function(_0x446bcd,_0x4c675b){return db[_0x9cee('0x42')][_0x9cee('0x49')]({'where':{'id':_0x446bcd['params']['id']}})[_0x9cee('0x24')](handleEntityNotFound(_0x4c675b,null))[_0x9cee('0x24')](removeEntity(_0x4c675b,null))[_0x9cee('0x4a')](handleError(_0x4c675b,null));};exports[_0x9cee('0x4d')]=function(_0x4b02e7,_0x5d342a,_0x41b5be){return db[_0x9cee('0x4e')]['find']({'where':{'id':_0x4b02e7[_0x9cee('0x48')]['id']}})['then'](handleEntityNotFound(_0x5d342a,null))[_0x9cee('0x24')](function(_0x34fd79){if(_0x34fd79){return _0x34fd79[_0x9cee('0x4d')](_0x4b02e7[_0x9cee('0x4c')][_0x9cee('0x4f')],_[_0x9cee('0x50')](_0x4b02e7[_0x9cee('0x4c')],['ids','id'])||{});}})[_0x9cee('0x24')](respondWithResult(_0x5d342a,null))[_0x9cee('0x4a')](handleError(_0x5d342a,null));};exports['getConditions']=function(_0x3768ed,_0x2b7fac,_0x176bda){var _0x402aa9={};var _0x5a0da5={};var _0x4d82c6;var _0x308dd6;return db['Automation']['findOne']({'where':{'id':_0x3768ed[_0x9cee('0x48')]['id']}})['then'](handleEntityNotFound(_0x2b7fac,null))[_0x9cee('0x24')](function(_0x53d137){if(_0x53d137){_0x4d82c6=_0x53d137;_0x5a0da5['model']=_[_0x9cee('0x33')](db[_0x9cee('0x4e')][_0x9cee('0x2d')]);_0x5a0da5['query']=_[_0x9cee('0x33')](_0x3768ed[_0x9cee('0x32')]);_0x5a0da5['filters']=_[_0x9cee('0x35')](_0x5a0da5['model'],_0x5a0da5[_0x9cee('0x32')]);_0x402aa9['attributes']=_[_0x9cee('0x35')](_0x5a0da5['model'],qs[_0x9cee('0x38')](_0x3768ed[_0x9cee('0x32')][_0x9cee('0x38')]));_0x402aa9['attributes']=_0x402aa9[_0x9cee('0x37')][_0x9cee('0x39')]?_0x402aa9['attributes']:_0x5a0da5['model'];_0x402aa9[_0x9cee('0x51')]=qs[_0x9cee('0x3b')](_0x3768ed['query']['sort']);_0x402aa9[_0x9cee('0x3c')]=qs['filters'](_[_0x9cee('0x3d')](_0x3768ed[_0x9cee('0x32')],_0x5a0da5[_0x9cee('0x34')]));if(_0x3768ed[_0x9cee('0x32')][_0x9cee('0x3e')]){_0x402aa9['where']=_[_0x9cee('0x3f')](_0x402aa9[_0x9cee('0x3c')],{'$or':_[_0x9cee('0x31')](_0x402aa9['attributes'],function(_0x3c95c8){var _0xcdff11={};_0xcdff11[_0x3c95c8]={'$like':'%'+_0x3768ed[_0x9cee('0x32')][_0x9cee('0x3e')]+'%'};return _0xcdff11;})});}_0x402aa9=_[_0x9cee('0x3f')]({},_0x402aa9,_0x3768ed[_0x9cee('0x41')]);return _0x4d82c6[_0x9cee('0x52')](_0x402aa9);}})['then'](function(_0x5551b3){if(_0x5551b3){_0x308dd6=_0x5551b3[_0x9cee('0x39')];if(!_0x3768ed['query'][_0x9cee('0x3a')]('nolimit')){_0x402aa9[_0x9cee('0x1d')]=qs[_0x9cee('0x1d')](_0x3768ed[_0x9cee('0x32')][_0x9cee('0x1d')]);_0x402aa9[_0x9cee('0x1b')]=qs[_0x9cee('0x1b')](_0x3768ed['query'][_0x9cee('0x1b')]);}return _0x4d82c6[_0x9cee('0x52')](_0x402aa9);}})[_0x9cee('0x24')](function(_0x53cb3c){if(_0x53cb3c){return _0x53cb3c?{'count':_0x308dd6,'rows':_0x53cb3c}:null;}})['then'](respondWithResult(_0x2b7fac,null))[_0x9cee('0x4a')](handleError(_0x2b7fac,null));};exports[_0x9cee('0x53')]=function(_0x940e34,_0x3d887c,_0x8fb6f4){return db[_0x9cee('0x54')][_0x9cee('0x49')]({'where':{'id':_0x940e34[_0x9cee('0x48')]['id']}})[_0x9cee('0x24')](handleEntityNotFound(_0x3d887c,null))['then'](function(_0x415c06){if(_0x415c06){return _0x415c06[_0x9cee('0x53')](_0x940e34[_0x9cee('0x4c')][_0x9cee('0x4f')],_[_0x9cee('0x50')](_0x940e34[_0x9cee('0x4c')],[_0x9cee('0x4f'),'id'])||{});}})[_0x9cee('0x24')](respondWithResult(_0x3d887c,null))[_0x9cee('0x4a')](handleError(_0x3d887c,null));};exports[_0x9cee('0x55')]=function(_0x23016c,_0x2ffe51,_0x388daf){var _0x971a={};var _0x1aaec4={};var _0x7a0f01;var _0x2481f8;return db['Automation'][_0x9cee('0x56')]({'where':{'id':_0x23016c['params']['id']}})[_0x9cee('0x24')](handleEntityNotFound(_0x2ffe51,null))[_0x9cee('0x24')](function(_0x4a04d0){if(_0x4a04d0){_0x7a0f01=_0x4a04d0;_0x1aaec4[_0x9cee('0x36')]=_[_0x9cee('0x33')](db[_0x9cee('0x54')]['rawAttributes']);_0x1aaec4[_0x9cee('0x32')]=_[_0x9cee('0x33')](_0x23016c[_0x9cee('0x32')]);_0x1aaec4[_0x9cee('0x34')]=_[_0x9cee('0x35')](_0x1aaec4[_0x9cee('0x36')],_0x1aaec4[_0x9cee('0x32')]);_0x971a[_0x9cee('0x37')]=_['intersection'](_0x1aaec4[_0x9cee('0x36')],qs[_0x9cee('0x38')](_0x23016c[_0x9cee('0x32')][_0x9cee('0x38')]));_0x971a[_0x9cee('0x37')]=_0x971a[_0x9cee('0x37')][_0x9cee('0x39')]?_0x971a[_0x9cee('0x37')]:_0x1aaec4[_0x9cee('0x36')];_0x971a['order']=qs[_0x9cee('0x3b')](_0x23016c[_0x9cee('0x32')]['sort']);_0x971a[_0x9cee('0x3c')]=qs['filters'](_[_0x9cee('0x3d')](_0x23016c[_0x9cee('0x32')],_0x1aaec4[_0x9cee('0x34')]));if(_0x23016c[_0x9cee('0x32')][_0x9cee('0x3e')]){_0x971a['where']=_[_0x9cee('0x3f')](_0x971a['where'],{'$or':_[_0x9cee('0x31')](_0x971a[_0x9cee('0x37')],function(_0xc9f4c2){var _0x9f2237={};_0x9f2237[_0xc9f4c2]={'$like':'%'+_0x23016c[_0x9cee('0x32')][_0x9cee('0x3e')]+'%'};return _0x9f2237;})});}_0x971a=_['merge']({},_0x971a,_0x23016c[_0x9cee('0x41')]);return _0x7a0f01[_0x9cee('0x55')](_0x971a);}})[_0x9cee('0x24')](function(_0x37dd91){if(_0x37dd91){_0x2481f8=_0x37dd91[_0x9cee('0x39')];if(!_0x23016c['query'][_0x9cee('0x3a')](_0x9cee('0x57'))){_0x971a['limit']=qs[_0x9cee('0x1d')](_0x23016c[_0x9cee('0x32')]['limit']);_0x971a[_0x9cee('0x1b')]=qs[_0x9cee('0x1b')](_0x23016c[_0x9cee('0x32')][_0x9cee('0x1b')]);}return _0x7a0f01[_0x9cee('0x55')](_0x971a);}})[_0x9cee('0x24')](function(_0x9c7f92){if(_0x9c7f92){return _0x9c7f92?{'count':_0x2481f8,'rows':_0x9c7f92}:null;}})[_0x9cee('0x24')](respondWithResult(_0x2ffe51,null))[_0x9cee('0x4a')](handleError(_0x2ffe51,null));}; \ No newline at end of file +var _0x78b3=['where','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','find','create','body','destroy','Condition','addConditions','ids','getConditions','findOne','sort','pick','addActions','Action','omit','getActions','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','end','status','offset','undefined','count','limit','Content-Range','apply','reject','update','then','sendStatus','error','stack','name','send','map','Automation','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order'];(function(_0x41eb8b,_0x8e630f){var _0x57f6be=function(_0x552d87){while(--_0x552d87){_0x41eb8b['push'](_0x41eb8b['shift']());}};_0x57f6be(++_0x8e630f);}(_0x78b3,0x6d));var _0x378b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x78b3[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x378b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x378b('0x1'));var jsonpatch=require(_0x378b('0x2'));var rp=require(_0x378b('0x3'));var moment=require(_0x378b('0x4'));var BPromise=require(_0x378b('0x5'));var Mustache=require(_0x378b('0x6'));var util=require(_0x378b('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x378b('0x8'));var ejs=require(_0x378b('0x9'));var fs=require('fs');var fs_extra=require(_0x378b('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x378b('0xb'));var toCsv=require(_0x378b('0x8'));var querystring=require(_0x378b('0xc'));var Papa=require(_0x378b('0xd'));var Redis=require(_0x378b('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x378b('0xf'));var as=require(_0x378b('0x10'));var hardwareService=require(_0x378b('0x11'));var logger=require(_0x378b('0x12'))(_0x378b('0x13'));var utils=require('../../config/utils');var config=require(_0x378b('0x14'));var licenseUtil=require(_0x378b('0x15'));var db=require(_0x378b('0x16'))['db'];function respondWithStatusCode(_0x521e73,_0x39d4c4){_0x39d4c4=_0x39d4c4||0xcc;return function(_0x35f0c5){if(_0x35f0c5){return _0x521e73['sendStatus'](_0x39d4c4);}return _0x521e73['status'](_0x39d4c4)[_0x378b('0x17')]();};}function respondWithResult(_0x3d7099,_0x38ba6e){_0x38ba6e=_0x38ba6e||0xc8;return function(_0x23cb4b){if(_0x23cb4b){return _0x3d7099[_0x378b('0x18')](_0x38ba6e)['json'](_0x23cb4b);}};}function respondWithFilteredResult(_0x91ae63,_0xf12f97){return function(_0x59ad27){if(_0x59ad27){var _0x4931e2=typeof _0xf12f97[_0x378b('0x19')]===_0x378b('0x1a')&&typeof _0xf12f97['limit']===_0x378b('0x1a');var _0xf754fa=_0x59ad27[_0x378b('0x1b')];var _0x1c0666=_0x4931e2?0x0:_0xf12f97[_0x378b('0x19')];var _0x470ab4=_0x4931e2?_0x59ad27[_0x378b('0x1b')]:_0xf12f97[_0x378b('0x19')]+_0xf12f97[_0x378b('0x1c')];var _0x4f4ea0;if(_0x470ab4>=_0xf754fa){_0x470ab4=_0xf754fa;_0x4f4ea0=0xc8;}else{_0x4f4ea0=0xce;}_0x91ae63[_0x378b('0x18')](_0x4f4ea0);return _0x91ae63['set'](_0x378b('0x1d'),_0x1c0666+'-'+_0x470ab4+'/'+_0xf754fa)['json'](_0x59ad27);}return null;};}function patchUpdates(_0x24398b){return function(_0x3497e8){try{jsonpatch[_0x378b('0x1e')](_0x3497e8,_0x24398b,!![]);}catch(_0x23e196){return BPromise[_0x378b('0x1f')](_0x23e196);}return _0x3497e8['save']();};}function saveUpdates(_0x4d9e07,_0x4f1ac8){return function(_0x5a3830){if(_0x5a3830){return _0x5a3830[_0x378b('0x20')](_0x4d9e07)[_0x378b('0x21')](function(_0x246286){return _0x246286;});}return null;};}function removeEntity(_0x58920d,_0x56c357){return function(_0x1dc970){if(_0x1dc970){return _0x1dc970['destroy']()['then'](function(){_0x58920d[_0x378b('0x18')](0xcc)[_0x378b('0x17')]();});}};}function handleEntityNotFound(_0x55719e,_0x3845a1){return function(_0x43c525){if(!_0x43c525){_0x55719e[_0x378b('0x22')](0x194);}return _0x43c525;};}function handleError(_0x29667d,_0x22afef){_0x22afef=_0x22afef||0x1f4;return function(_0x5b76d1){logger[_0x378b('0x23')](_0x5b76d1[_0x378b('0x24')]);if(_0x5b76d1[_0x378b('0x25')]){delete _0x5b76d1[_0x378b('0x25')];}_0x29667d[_0x378b('0x18')](_0x22afef)[_0x378b('0x26')](_0x5b76d1);};}exports['index']=function(_0x15801b,_0x248700){var _0x3c301b={},_0x4efddc={},_0x2691da={'count':0x0,'rows':[]};var _0x45b8cd=_[_0x378b('0x27')](db[_0x378b('0x28')]['rawAttributes'],function(_0x24af94){return{'name':_0x24af94[_0x378b('0x29')],'type':_0x24af94[_0x378b('0x2a')]['key']};});_0x4efddc[_0x378b('0x2b')]=_[_0x378b('0x27')](_0x45b8cd,_0x378b('0x25'));_0x4efddc[_0x378b('0x2c')]=_['keys'](_0x15801b['query']);_0x4efddc[_0x378b('0x2d')]=_[_0x378b('0x2e')](_0x4efddc[_0x378b('0x2b')],_0x4efddc['query']);_0x3c301b[_0x378b('0x2f')]=_['intersection'](_0x4efddc[_0x378b('0x2b')],qs[_0x378b('0x30')](_0x15801b[_0x378b('0x2c')][_0x378b('0x30')]));_0x3c301b[_0x378b('0x2f')]=_0x3c301b[_0x378b('0x2f')][_0x378b('0x31')]?_0x3c301b[_0x378b('0x2f')]:_0x4efddc[_0x378b('0x2b')];if(!_0x15801b[_0x378b('0x2c')][_0x378b('0x32')](_0x378b('0x33'))){_0x3c301b[_0x378b('0x1c')]=qs[_0x378b('0x1c')](_0x15801b[_0x378b('0x2c')]['limit']);_0x3c301b[_0x378b('0x19')]=qs['offset'](_0x15801b['query'][_0x378b('0x19')]);}_0x3c301b[_0x378b('0x34')]=qs['sort'](_0x15801b[_0x378b('0x2c')]['sort']);_0x3c301b[_0x378b('0x35')]=qs['filters'](_['pick'](_0x15801b[_0x378b('0x2c')],_0x4efddc[_0x378b('0x2d')]),_0x45b8cd);if(_0x15801b[_0x378b('0x2c')]['filter']){_0x3c301b[_0x378b('0x35')]=_['merge'](_0x3c301b['where'],{'$or':_[_0x378b('0x27')](_0x45b8cd,function(_0x2a7bd3){if(_0x2a7bd3[_0x378b('0x2a')]!=='VIRTUAL'){var _0x40a777={};_0x40a777[_0x2a7bd3[_0x378b('0x25')]]={'$like':'%'+_0x15801b[_0x378b('0x2c')][_0x378b('0x36')]+'%'};return _0x40a777;}})});}_0x3c301b=_[_0x378b('0x37')]({},_0x3c301b,_0x15801b[_0x378b('0x38')]);var _0x5ba8b8={'where':_0x3c301b[_0x378b('0x35')]};return db[_0x378b('0x28')][_0x378b('0x1b')](_0x5ba8b8)[_0x378b('0x21')](function(_0x38bd7d){_0x2691da[_0x378b('0x1b')]=_0x38bd7d;if(_0x15801b[_0x378b('0x2c')][_0x378b('0x39')]){_0x3c301b[_0x378b('0x3a')]=[{'all':!![]}];}return db[_0x378b('0x28')][_0x378b('0x3b')](_0x3c301b);})[_0x378b('0x21')](function(_0x7db198){_0x2691da[_0x378b('0x3c')]=_0x7db198;return _0x2691da;})[_0x378b('0x21')](respondWithFilteredResult(_0x248700,_0x3c301b))[_0x378b('0x3d')](handleError(_0x248700,null));};exports[_0x378b('0x3e')]=function(_0x2dd0eb,_0x19134d){var _0x117051={'raw':![],'where':{'id':_0x2dd0eb[_0x378b('0x3f')]['id']}},_0x4ba266={};_0x4ba266[_0x378b('0x2b')]=_[_0x378b('0x40')](db[_0x378b('0x28')][_0x378b('0x41')]);_0x4ba266[_0x378b('0x2c')]=_[_0x378b('0x40')](_0x2dd0eb['query']);_0x4ba266[_0x378b('0x2d')]=_[_0x378b('0x2e')](_0x4ba266[_0x378b('0x2b')],_0x4ba266[_0x378b('0x2c')]);_0x117051[_0x378b('0x2f')]=_[_0x378b('0x2e')](_0x4ba266[_0x378b('0x2b')],qs[_0x378b('0x30')](_0x2dd0eb[_0x378b('0x2c')][_0x378b('0x30')]));_0x117051[_0x378b('0x2f')]=_0x117051[_0x378b('0x2f')]['length']?_0x117051['attributes']:_0x4ba266[_0x378b('0x2b')];if(_0x2dd0eb['query'][_0x378b('0x39')]){_0x117051[_0x378b('0x3a')]=[{'all':!![]}];}_0x117051=_[_0x378b('0x37')]({},_0x117051,_0x2dd0eb['options']);return db[_0x378b('0x28')][_0x378b('0x42')](_0x117051)[_0x378b('0x21')](handleEntityNotFound(_0x19134d,null))[_0x378b('0x21')](respondWithResult(_0x19134d,null))[_0x378b('0x3d')](handleError(_0x19134d,null));};exports[_0x378b('0x43')]=function(_0x359acc,_0x17c1d2){return db[_0x378b('0x28')][_0x378b('0x43')](_0x359acc[_0x378b('0x44')],{})[_0x378b('0x21')](respondWithResult(_0x17c1d2,0xc9))['catch'](handleError(_0x17c1d2,null));};exports[_0x378b('0x20')]=function(_0x100fb9,_0x2ebaec){if(_0x100fb9[_0x378b('0x44')]['id']){delete _0x100fb9[_0x378b('0x44')]['id'];}return db[_0x378b('0x28')][_0x378b('0x42')]({'where':{'id':_0x100fb9['params']['id']}})['then'](handleEntityNotFound(_0x2ebaec,null))[_0x378b('0x21')](saveUpdates(_0x100fb9['body'],null))[_0x378b('0x21')](respondWithResult(_0x2ebaec,null))[_0x378b('0x3d')](handleError(_0x2ebaec,null));};exports[_0x378b('0x45')]=function(_0x33b281,_0x2f2bcb){return db['Automation']['find']({'where':{'id':_0x33b281['params']['id']}})[_0x378b('0x21')](handleEntityNotFound(_0x2f2bcb,null))[_0x378b('0x21')](removeEntity(_0x2f2bcb,null))[_0x378b('0x3d')](handleError(_0x2f2bcb,null));};exports['addConditions']=function(_0x4c55b8,_0x59c859,_0x286380){return db[_0x378b('0x46')][_0x378b('0x42')]({'where':{'id':_0x4c55b8['params']['id']}})['then'](handleEntityNotFound(_0x59c859,null))[_0x378b('0x21')](function(_0x2381d4){if(_0x2381d4){return _0x2381d4[_0x378b('0x47')](_0x4c55b8['body'][_0x378b('0x48')],_['omit'](_0x4c55b8['body'],['ids','id'])||{});}})[_0x378b('0x21')](respondWithResult(_0x59c859,null))[_0x378b('0x3d')](handleError(_0x59c859,null));};exports[_0x378b('0x49')]=function(_0xd46175,_0x4e09f3,_0x5af232){var _0x5d79a2={};var _0x16181b={};var _0xdcc7c5;var _0x8279f6;return db['Automation'][_0x378b('0x4a')]({'where':{'id':_0xd46175[_0x378b('0x3f')]['id']}})[_0x378b('0x21')](handleEntityNotFound(_0x4e09f3,null))[_0x378b('0x21')](function(_0x516d10){if(_0x516d10){_0xdcc7c5=_0x516d10;_0x16181b[_0x378b('0x2b')]=_[_0x378b('0x40')](db[_0x378b('0x46')]['rawAttributes']);_0x16181b[_0x378b('0x2c')]=_[_0x378b('0x40')](_0xd46175[_0x378b('0x2c')]);_0x16181b[_0x378b('0x2d')]=_[_0x378b('0x2e')](_0x16181b[_0x378b('0x2b')],_0x16181b['query']);_0x5d79a2[_0x378b('0x2f')]=_['intersection'](_0x16181b[_0x378b('0x2b')],qs['fields'](_0xd46175[_0x378b('0x2c')][_0x378b('0x30')]));_0x5d79a2[_0x378b('0x2f')]=_0x5d79a2[_0x378b('0x2f')]['length']?_0x5d79a2[_0x378b('0x2f')]:_0x16181b[_0x378b('0x2b')];_0x5d79a2[_0x378b('0x34')]=qs['sort'](_0xd46175['query'][_0x378b('0x4b')]);_0x5d79a2[_0x378b('0x35')]=qs[_0x378b('0x2d')](_[_0x378b('0x4c')](_0xd46175['query'],_0x16181b[_0x378b('0x2d')]));if(_0xd46175[_0x378b('0x2c')][_0x378b('0x36')]){_0x5d79a2[_0x378b('0x35')]=_['merge'](_0x5d79a2[_0x378b('0x35')],{'$or':_[_0x378b('0x27')](_0x5d79a2[_0x378b('0x2f')],function(_0x4e69c5){var _0x363e99={};_0x363e99[_0x4e69c5]={'$like':'%'+_0xd46175[_0x378b('0x2c')][_0x378b('0x36')]+'%'};return _0x363e99;})});}_0x5d79a2=_[_0x378b('0x37')]({},_0x5d79a2,_0xd46175[_0x378b('0x38')]);return _0xdcc7c5[_0x378b('0x49')](_0x5d79a2);}})[_0x378b('0x21')](function(_0x2950f9){if(_0x2950f9){_0x8279f6=_0x2950f9[_0x378b('0x31')];if(!_0xd46175[_0x378b('0x2c')][_0x378b('0x32')]('nolimit')){_0x5d79a2[_0x378b('0x1c')]=qs[_0x378b('0x1c')](_0xd46175[_0x378b('0x2c')]['limit']);_0x5d79a2[_0x378b('0x19')]=qs['offset'](_0xd46175[_0x378b('0x2c')][_0x378b('0x19')]);}return _0xdcc7c5[_0x378b('0x49')](_0x5d79a2);}})['then'](function(_0xa4972){if(_0xa4972){return _0xa4972?{'count':_0x8279f6,'rows':_0xa4972}:null;}})['then'](respondWithResult(_0x4e09f3,null))['catch'](handleError(_0x4e09f3,null));};exports[_0x378b('0x4d')]=function(_0x2319cb,_0x47b6d1,_0x510ce7){return db[_0x378b('0x4e')]['find']({'where':{'id':_0x2319cb['params']['id']}})[_0x378b('0x21')](handleEntityNotFound(_0x47b6d1,null))['then'](function(_0x5bcb62){if(_0x5bcb62){return _0x5bcb62[_0x378b('0x4d')](_0x2319cb[_0x378b('0x44')][_0x378b('0x48')],_[_0x378b('0x4f')](_0x2319cb[_0x378b('0x44')],[_0x378b('0x48'),'id'])||{});}})[_0x378b('0x21')](respondWithResult(_0x47b6d1,null))[_0x378b('0x3d')](handleError(_0x47b6d1,null));};exports[_0x378b('0x50')]=function(_0x2bb98f,_0x1de7e2,_0x39d782){var _0xe6445={};var _0x4306f7={};var _0x40468f;var _0x506b35;return db['Automation'][_0x378b('0x4a')]({'where':{'id':_0x2bb98f[_0x378b('0x3f')]['id']}})[_0x378b('0x21')](handleEntityNotFound(_0x1de7e2,null))['then'](function(_0x431fa2){if(_0x431fa2){_0x40468f=_0x431fa2;_0x4306f7[_0x378b('0x2b')]=_[_0x378b('0x40')](db[_0x378b('0x4e')][_0x378b('0x41')]);_0x4306f7[_0x378b('0x2c')]=_['keys'](_0x2bb98f[_0x378b('0x2c')]);_0x4306f7[_0x378b('0x2d')]=_[_0x378b('0x2e')](_0x4306f7[_0x378b('0x2b')],_0x4306f7[_0x378b('0x2c')]);_0xe6445[_0x378b('0x2f')]=_[_0x378b('0x2e')](_0x4306f7['model'],qs[_0x378b('0x30')](_0x2bb98f[_0x378b('0x2c')][_0x378b('0x30')]));_0xe6445['attributes']=_0xe6445[_0x378b('0x2f')][_0x378b('0x31')]?_0xe6445[_0x378b('0x2f')]:_0x4306f7[_0x378b('0x2b')];_0xe6445[_0x378b('0x34')]=qs[_0x378b('0x4b')](_0x2bb98f[_0x378b('0x2c')][_0x378b('0x4b')]);_0xe6445[_0x378b('0x35')]=qs['filters'](_['pick'](_0x2bb98f[_0x378b('0x2c')],_0x4306f7['filters']));if(_0x2bb98f[_0x378b('0x2c')][_0x378b('0x36')]){_0xe6445[_0x378b('0x35')]=_[_0x378b('0x37')](_0xe6445[_0x378b('0x35')],{'$or':_['map'](_0xe6445[_0x378b('0x2f')],function(_0xd1cc7a){var _0x5c6547={};_0x5c6547[_0xd1cc7a]={'$like':'%'+_0x2bb98f[_0x378b('0x2c')][_0x378b('0x36')]+'%'};return _0x5c6547;})});}_0xe6445=_[_0x378b('0x37')]({},_0xe6445,_0x2bb98f[_0x378b('0x38')]);return _0x40468f[_0x378b('0x50')](_0xe6445);}})[_0x378b('0x21')](function(_0x208883){if(_0x208883){_0x506b35=_0x208883['length'];if(!_0x2bb98f[_0x378b('0x2c')][_0x378b('0x32')]('nolimit')){_0xe6445[_0x378b('0x1c')]=qs[_0x378b('0x1c')](_0x2bb98f[_0x378b('0x2c')]['limit']);_0xe6445[_0x378b('0x19')]=qs[_0x378b('0x19')](_0x2bb98f['query'][_0x378b('0x19')]);}return _0x40468f[_0x378b('0x50')](_0xe6445);}})['then'](function(_0x1003ad){if(_0x1003ad){return _0x1003ad?{'count':_0x506b35,'rows':_0x1003ad}:null;}})[_0x378b('0x21')](respondWithResult(_0x1de7e2,null))[_0x378b('0x3d')](handleError(_0x1de7e2,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index 94c97ba..73b54ee 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 _0xfc3d=['rimraf','./automation.attributes','exports','Automation','tools_automations','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x22e6f0,_0x9d6f84){var _0x31aeaf=function(_0x203316){while(--_0x203316){_0x22e6f0['push'](_0x22e6f0['shift']());}};_0x31aeaf(++_0x9d6f84);}(_0xfc3d,0x19d));var _0xdfc3=function(_0x208cda,_0x46fb61){_0x208cda=_0x208cda-0x0;var _0x3cc9a8=_0xfc3d[_0x208cda];return _0x3cc9a8;};'use strict';var _=require(_0xdfc3('0x0'));var util=require(_0xdfc3('0x1'));var logger=require('../../config/logger')(_0xdfc3('0x2'));var moment=require(_0xdfc3('0x3'));var BPromise=require(_0xdfc3('0x4'));var rp=require(_0xdfc3('0x5'));var fs=require('fs');var path=require(_0xdfc3('0x6'));var rimraf=require(_0xdfc3('0x7'));var config=require('../../config/environment');var attributes=require(_0xdfc3('0x8'));module[_0xdfc3('0x9')]=function(_0x401d1a,_0xf38aa4){return _0x401d1a['define'](_0xdfc3('0xa'),attributes,{'tableName':_0xdfc3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf38b=['request-promise','path','../../config/environment','./automation.attributes','Automation','tools_automations','lodash','util','moment','bluebird'];(function(_0x47a41f,_0x48d92b){var _0x2411f5=function(_0x3f5b72){while(--_0x3f5b72){_0x47a41f['push'](_0x47a41f['shift']());}};_0x2411f5(++_0x48d92b);}(_0xf38b,0x10a));var _0xbf38=function(_0x2417f5,_0x15553f){_0x2417f5=_0x2417f5-0x0;var _0x181eec=_0xf38b[_0x2417f5];return _0x181eec;};'use strict';var _=require(_0xbf38('0x0'));var util=require(_0xbf38('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbf38('0x2'));var BPromise=require(_0xbf38('0x3'));var rp=require(_0xbf38('0x4'));var fs=require('fs');var path=require(_0xbf38('0x5'));var rimraf=require('rimraf');var config=require(_0xbf38('0x6'));var attributes=require(_0xbf38('0x7'));module['exports']=function(_0x1450a4,_0x15da51){return _0x1450a4['define'](_0xbf38('0x8'),attributes,{'tableName':_0xbf38('0x9'),'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 265151a..4cdd8c4 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 _0xc6d7=['rpc','../../config/environment','jayson/promise','client','http','request','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x3a64dc,_0x1f46be){var _0x58d3a2=function(_0x1031cd){while(--_0x1031cd){_0x3a64dc['push'](_0x3a64dc['shift']());}};_0x58d3a2(++_0x1f46be);}(_0xc6d7,0x71));var _0x7c6d=function(_0x3c9d4b,_0x57223d){_0x3c9d4b=_0x3c9d4b-0x0;var _0x234a8a=_0xc6d7[_0x3c9d4b];return _0x234a8a;};'use strict';var _=require(_0x7c6d('0x0'));var util=require(_0x7c6d('0x1'));var moment=require(_0x7c6d('0x2'));var BPromise=require(_0x7c6d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7c6d('0x4'))['db'];var utils=require(_0x7c6d('0x5'));var logger=require(_0x7c6d('0x6'))(_0x7c6d('0x7'));var config=require(_0x7c6d('0x8'));var jayson=require(_0x7c6d('0x9'));var client=jayson[_0x7c6d('0xa')][_0x7c6d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x446b68,_0x45713e,_0x338f94){return new BPromise(function(_0x1ad7e2,_0x22755d){return client[_0x7c6d('0xc')](_0x446b68,_0x338f94)['then'](function(_0x477a41){logger['info'](_0x7c6d('0xd'),_0x45713e,_0x7c6d('0xe'));logger[_0x7c6d('0xf')](_0x7c6d('0x10'),_0x45713e,'request\x20sent',JSON[_0x7c6d('0x11')](_0x477a41));if(_0x477a41[_0x7c6d('0x12')]){if(_0x477a41[_0x7c6d('0x12')][_0x7c6d('0x13')]===0x1f4){logger[_0x7c6d('0x12')](_0x7c6d('0xd'),_0x45713e,_0x477a41[_0x7c6d('0x12')]['message']);return _0x22755d(_0x477a41[_0x7c6d('0x12')][_0x7c6d('0x14')]);}logger[_0x7c6d('0x12')](_0x7c6d('0xd'),_0x45713e,_0x477a41[_0x7c6d('0x12')][_0x7c6d('0x14')]);return _0x1ad7e2(_0x477a41[_0x7c6d('0x12')][_0x7c6d('0x14')]);}else{logger[_0x7c6d('0x15')]('Automation,\x20%s,\x20%s',_0x45713e,_0x7c6d('0xe'));_0x1ad7e2(_0x477a41[_0x7c6d('0x16')]['message']);}})[_0x7c6d('0x17')](function(_0x220bae){logger[_0x7c6d('0x12')](_0x7c6d('0xd'),_0x45713e,_0x220bae);_0x22755d(_0x220bae);});});} \ No newline at end of file +var _0x1410=['jayson/promise','client','http','request','then','info','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x1410,0x130));var _0x0141=function(_0xd6bcdb,_0x44853c){_0xd6bcdb=_0xd6bcdb-0x0;var _0x199a86=_0x1410[_0xd6bcdb];return _0x199a86;};'use strict';var _=require(_0x0141('0x0'));var util=require(_0x0141('0x1'));var moment=require(_0x0141('0x2'));var BPromise=require(_0x0141('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0141('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0141('0x5'));var logger=require('../../config/logger')(_0x0141('0x6'));var config=require(_0x0141('0x7'));var jayson=require(_0x0141('0x8'));var client=jayson[_0x0141('0x9')][_0x0141('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x24f701,_0x22b566,_0x25511f){return new BPromise(function(_0x2d8f15,_0x57cfbb){return client[_0x0141('0xb')](_0x24f701,_0x25511f)[_0x0141('0xc')](function(_0x2b4f13){logger[_0x0141('0xd')](_0x0141('0xe'),_0x22b566,_0x0141('0xf'));logger[_0x0141('0x10')](_0x0141('0x11'),_0x22b566,'request\x20sent',JSON[_0x0141('0x12')](_0x2b4f13));if(_0x2b4f13[_0x0141('0x13')]){if(_0x2b4f13[_0x0141('0x13')][_0x0141('0x14')]===0x1f4){logger['error']('Automation,\x20%s,\x20%s',_0x22b566,_0x2b4f13[_0x0141('0x13')][_0x0141('0x15')]);return _0x57cfbb(_0x2b4f13['error'][_0x0141('0x15')]);}logger[_0x0141('0x13')](_0x0141('0xe'),_0x22b566,_0x2b4f13[_0x0141('0x13')][_0x0141('0x15')]);return _0x2d8f15(_0x2b4f13['error'][_0x0141('0x15')]);}else{logger['info'](_0x0141('0xe'),_0x22b566,_0x0141('0xf'));_0x2d8f15(_0x2b4f13[_0x0141('0x16')][_0x0141('0x15')]);}})[_0x0141('0x17')](function(_0x3c91e8){logger['error']('Automation,\x20%s,\x20%s',_0x22b566,_0x3c91e8);_0x57cfbb(_0x3c91e8);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index fd09122..178ce76 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 _0xac52=['/:id','show','/:id/conditions','getConditions','/:id/actions','post','create','addActions','put','delete','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./automation.controller','get','isAuthenticated'];(function(_0x205496,_0x11ab53){var _0x449187=function(_0xf07d19){while(--_0xf07d19){_0x205496['push'](_0x205496['shift']());}};_0x449187(++_0x11ab53);}(_0xac52,0x122));var _0x2ac5=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0xac52[_0x580576];return _0x3f55a0;};'use strict';var multer=require('multer');var util=require(_0x2ac5('0x0'));var path=require(_0x2ac5('0x1'));var timeout=require(_0x2ac5('0x2'));var express=require(_0x2ac5('0x3'));var router=express[_0x2ac5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2ac5('0x5'));var interaction=require(_0x2ac5('0x6'));var config=require('../../config/environment');var controller=require(_0x2ac5('0x7'));router[_0x2ac5('0x8')]('/',auth[_0x2ac5('0x9')](),controller['index']);router['get'](_0x2ac5('0xa'),auth[_0x2ac5('0x9')](),controller[_0x2ac5('0xb')]);router[_0x2ac5('0x8')](_0x2ac5('0xc'),auth[_0x2ac5('0x9')](),controller[_0x2ac5('0xd')]);router[_0x2ac5('0x8')](_0x2ac5('0xe'),auth[_0x2ac5('0x9')](),controller['getActions']);router[_0x2ac5('0xf')]('/',auth[_0x2ac5('0x9')](),controller[_0x2ac5('0x10')]);router[_0x2ac5('0xf')]('/:id/conditions',auth['isAuthenticated'](),controller['addConditions']);router[_0x2ac5('0xf')](_0x2ac5('0xe'),auth[_0x2ac5('0x9')](),controller[_0x2ac5('0x11')]);router[_0x2ac5('0x12')]('/:id',auth[_0x2ac5('0x9')](),controller['update']);router[_0x2ac5('0x13')](_0x2ac5('0xa'),auth[_0x2ac5('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xcd3a=['show','/:id/conditions','getConditions','post','create','addConditions','addActions','put','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./automation.controller','get','isAuthenticated','/:id'];(function(_0xa5f5ab,_0x251aa3){var _0xc25c1b=function(_0x10af38){while(--_0x10af38){_0xa5f5ab['push'](_0xa5f5ab['shift']());}};_0xc25c1b(++_0x251aa3);}(_0xcd3a,0xcf));var _0xacd3=function(_0x3e27a5,_0x1b0bb0){_0x3e27a5=_0x3e27a5-0x0;var _0x2b666e=_0xcd3a[_0x3e27a5];return _0x2b666e;};'use strict';var multer=require(_0xacd3('0x0'));var util=require(_0xacd3('0x1'));var path=require(_0xacd3('0x2'));var timeout=require(_0xacd3('0x3'));var express=require(_0xacd3('0x4'));var router=express[_0xacd3('0x5')]();var fs_extra=require(_0xacd3('0x6'));var auth=require(_0xacd3('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xacd3('0x8'));var controller=require(_0xacd3('0x9'));router[_0xacd3('0xa')]('/',auth[_0xacd3('0xb')](),controller['index']);router['get'](_0xacd3('0xc'),auth[_0xacd3('0xb')](),controller[_0xacd3('0xd')]);router['get'](_0xacd3('0xe'),auth[_0xacd3('0xb')](),controller[_0xacd3('0xf')]);router[_0xacd3('0xa')]('/:id/actions',auth[_0xacd3('0xb')](),controller['getActions']);router[_0xacd3('0x10')]('/',auth[_0xacd3('0xb')](),controller[_0xacd3('0x11')]);router[_0xacd3('0x10')]('/:id/conditions',auth[_0xacd3('0xb')](),controller[_0xacd3('0x12')]);router[_0xacd3('0x10')]('/:id/actions',auth['isAuthenticated'](),controller[_0xacd3('0x13')]);router[_0xacd3('0x14')]('/:id',auth[_0xacd3('0xb')](),controller['update']);router['delete'](_0xacd3('0xc'),auth[_0xacd3('0xb')](),controller['destroy']);module[_0xacd3('0x15')]=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index e5e6351..0892552 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 _0x028a=['ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','never','onlyIfOpen','always','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','ENUM','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','exports','STRING','name'];(function(_0x54854b,_0x5e2ab3){var _0x2ed79b=function(_0x3fc3af){while(--_0x3fc3af){_0x54854b['push'](_0x54854b['shift']());}};_0x2ed79b(++_0x5e2ab3);}(_0x028a,0x1b5));var _0xa028=function(_0x28b709,_0x4d7a52){_0x28b709=_0x28b709-0x0;var _0x1ebf2f=_0x028a[_0x28b709];return _0x1ebf2f;};'use strict';var Sequelize=require('sequelize');module[_0xa028('0x0')]={'name':{'type':Sequelize[_0xa028('0x1')],'unique':_0xa028('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0xa028('0x3')),'allowNull':![],'defaultValue':_0xa028('0x3')},'description':{'type':Sequelize[_0xa028('0x1')]},'active':{'type':Sequelize[_0xa028('0x4')],'defaultValue':0x0,'comment':_0xa028('0x5')},'limitCalls':{'type':Sequelize[_0xa028('0x6')](0x4)[_0xa028('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xa028('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0xa028('0x6')](0x3)[_0xa028('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa028('0x8')},'dialCongestionMaxRetry':{'type':Sequelize[_0xa028('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa028('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xa028('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa028('0xa')},'dialBusyMaxRetry':{'type':Sequelize[_0xa028('0x6')](0x3)[_0xa028('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa028('0xb')},'dialBusyRetryFrequency':{'type':Sequelize[_0xa028('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa028('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xa028('0x6')](0x3)[_0xa028('0x7')],'defaultValue':0x3,'comment':_0xa028('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xa028('0x6')](0x5)[_0xa028('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa028('0xe')},'dialGlobalMaxRetry':{'type':Sequelize[_0xa028('0x6')](0x3)[_0xa028('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xa028('0xf')},'dialTimezone':{'type':Sequelize[_0xa028('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xa028('0x1')],'defaultValue':_0xa028('0x10')},'dialCheckDuplicateType':{'type':Sequelize['ENUM']('always',_0xa028('0x11'),_0xa028('0x12')),'defaultValue':_0xa028('0x13')},'dialAMDActive':{'type':Sequelize[_0xa028('0x4')],'defaultValue':0x0,'comment':_0xa028('0x14')},'dialAMDInitialSilence':{'type':Sequelize[_0xa028('0x6')](0x9)[_0xa028('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xa028('0x15')},'dialAMDGreeting':{'type':Sequelize[_0xa028('0x6')](0x9)[_0xa028('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xa028('0x16')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xa028('0x6')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xa028('0x17')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0xa028('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xa028('0x18')},'dialAMDMinWordLength':{'type':Sequelize[_0xa028('0x6')](0x9)[_0xa028('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xa028('0x19')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xa028('0x6')](0x9)[_0xa028('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xa028('0x1a')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0xa028('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0xa028('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xa028('0x1b')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xa028('0x6')](0x9)[_0xa028('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0xa028('0x1c')](_0xa028('0x1d'),_0xa028('0x1e')),'defaultValue':_0xa028('0x1d')},'dialPrefix':{'type':Sequelize[_0xa028('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xa028('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xa028('0x1f')},'dialCutDigit':{'type':Sequelize[_0xa028('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xa028('0x20')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xa028('0x6')](0x3)[_0xa028('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xa028('0x6')](0x5)[_0xa028('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa028('0x21')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa028('0x22')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xa028('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa028('0x23')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xa028('0x6')](0x5)[_0xa028('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa028('0x24')},'dialMachineMaxRetry':{'type':Sequelize[_0xa028('0x6')](0x3)[_0xa028('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0xa028('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa028('0x25')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xa028('0x6')](0x3)[_0xa028('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa028('0x26')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xa028('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa028('0x27')}}; \ No newline at end of file +var _0x7a1a=['always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','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\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','exports','STRING','name','ENUM','ivr','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'];(function(_0x3d1825,_0x319490){var _0x4098f2=function(_0x2a6901){while(--_0x2a6901){_0x3d1825['push'](_0x3d1825['shift']());}};_0x4098f2(++_0x319490);}(_0x7a1a,0x187));var _0xa7a1=function(_0x5015cc,_0x57a4f0){_0x5015cc=_0x5015cc-0x0;var _0x4946be=_0x7a1a[_0x5015cc];return _0x4946be;};'use strict';var Sequelize=require('sequelize');module[_0xa7a1('0x0')]={'name':{'type':Sequelize[_0xa7a1('0x1')],'unique':_0xa7a1('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xa7a1('0x3')](_0xa7a1('0x4')),'allowNull':![],'defaultValue':_0xa7a1('0x4')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xa7a1('0x5')},'limitCalls':{'type':Sequelize[_0xa7a1('0x6')](0x4)[_0xa7a1('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xa7a1('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0xa7a1('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xa7a1('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0xa7a1('0x6')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa7a1('0x9')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xa7a1('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa7a1('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xa7a1('0x6')](0x5)[_0xa7a1('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa7a1('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0xa7a1('0x6')](0x3)[_0xa7a1('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0xa7a1('0x6')](0x5)[_0xa7a1('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa7a1('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xa7a1('0x6')](0x3)[_0xa7a1('0x7')],'defaultValue':0x3,'comment':_0xa7a1('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xa7a1('0x6')](0x5)[_0xa7a1('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa7a1('0xe')},'dialGlobalMaxRetry':{'type':Sequelize[_0xa7a1('0x6')](0x3)[_0xa7a1('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xa7a1('0xf')},'dialTimezone':{'type':Sequelize[_0xa7a1('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xa7a1('0x1')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0xa7a1('0x3')](_0xa7a1('0x10'),_0xa7a1('0x11'),_0xa7a1('0x12')),'defaultValue':_0xa7a1('0x10')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xa7a1('0x13')},'dialAMDInitialSilence':{'type':Sequelize[_0xa7a1('0x6')](0x9)[_0xa7a1('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xa7a1('0x14')},'dialAMDGreeting':{'type':Sequelize[_0xa7a1('0x6')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xa7a1('0x15')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0xa7a1('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xa7a1('0x16')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xa7a1('0x17')},'dialAMDMinWordLength':{'type':Sequelize[_0xa7a1('0x6')](0x9)[_0xa7a1('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xa7a1('0x18')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xa7a1('0x6')](0x9)[_0xa7a1('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0xa7a1('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0xa7a1('0x6')](0x5)[_0xa7a1('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xa7a1('0x19')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0xa7a1('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xa7a1('0x1a')},'dialOrderByScheduledAt':{'type':Sequelize[_0xa7a1('0x3')](_0xa7a1('0x1b'),_0xa7a1('0x1c')),'defaultValue':_0xa7a1('0x1b')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xa7a1('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xa7a1('0x1d')},'dialCutDigit':{'type':Sequelize[_0xa7a1('0x6')](0x3)[_0xa7a1('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xa7a1('0x1e')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xa7a1('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xa7a1('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa7a1('0x1f')},'dialDropMaxRetry':{'type':Sequelize[_0xa7a1('0x6')](0x3)[_0xa7a1('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa7a1('0x20')},'dialDropRetryFrequency':{'type':Sequelize[_0xa7a1('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa7a1('0x21')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xa7a1('0x6')](0x3)[_0xa7a1('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xa7a1('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa7a1('0x22')},'dialMachineMaxRetry':{'type':Sequelize[_0xa7a1('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0xa7a1('0x6')](0x5)[_0xa7a1('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xa7a1('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa7a1('0x23')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xa7a1('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa7a1('0x24')}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index 4e871a0..3837a58 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 _0x336d=['ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','into','ListId','from','OrderBy','h.id','ci.item','cm_contact_has_items','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','sequelize','push','all','removeLists','getBlackLists','addBlackLists','YYYY-MM-DD\x20HH:mm:ss','cm_hopper_black','removeBlackLists','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','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/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','get','UserProfileResource','error','name','index','map','Campaign','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','includeAll','include','findAll','catch','show','params','length','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','updatedAt','omit','role','IvrCampaigns','UserProfileSection','getHoppers','findOne','CmHopper','rows','getHopperHistories','CmHopperHistory','CampaignId','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','format','ids','spread','dialCheckDuplicateType','always','insert','cm_hopper','fromQuery','phone','scheduledAt','ContactId','select','field','NOW()','CmListId','toString','cm_contacts','deletedAt\x20IS\x20NULL'];(function(_0x15b916,_0x39ccf5){var _0x4f6426=function(_0x1ba9ca){while(--_0x1ba9ca){_0x15b916['push'](_0x15b916['shift']());}};_0x4f6426(++_0x39ccf5);}(_0x336d,0xae));var _0xd336=function(_0x5cda54,_0x9b37fc){_0x5cda54=_0x5cda54-0x0;var _0x33d718=_0x336d[_0x5cda54];return _0x33d718;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd336('0x0'));var zipdir=require(_0xd336('0x1'));var jsonpatch=require(_0xd336('0x2'));var rp=require(_0xd336('0x3'));var moment=require(_0xd336('0x4'));var BPromise=require(_0xd336('0x5'));var Mustache=require(_0xd336('0x6'));var util=require(_0xd336('0x7'));var path=require(_0xd336('0x8'));var sox=require(_0xd336('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd336('0xa'));var _=require(_0xd336('0xb'));var squel=require(_0xd336('0xc'));var crypto=require('crypto');var jsforce=require(_0xd336('0xd'));var deskjs=require(_0xd336('0xe'));var toCsv=require(_0xd336('0xf'));var querystring=require(_0xd336('0x10'));var Papa=require(_0xd336('0x11'));var Redis=require(_0xd336('0x12'));var authService=require(_0xd336('0x13'));var qs=require(_0xd336('0x14'));var as=require(_0xd336('0x15'));var hardwareService=require(_0xd336('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0xd336('0x17'));var config=require(_0xd336('0x18'));var licenseUtil=require(_0xd336('0x19'));var db=require(_0xd336('0x1a'))['db'];function respondWithStatusCode(_0x29aa4a,_0x276abb){_0x276abb=_0x276abb||0xcc;return function(_0x327229){if(_0x327229){return _0x29aa4a[_0xd336('0x1b')](_0x276abb);}return _0x29aa4a[_0xd336('0x1c')](_0x276abb)[_0xd336('0x1d')]();};}function respondWithResult(_0x4d4fca,_0x3a8a98){_0x3a8a98=_0x3a8a98||0xc8;return function(_0x4fc32e){if(_0x4fc32e){return _0x4d4fca[_0xd336('0x1c')](_0x3a8a98)[_0xd336('0x1e')](_0x4fc32e);}};}function respondWithFilteredResult(_0x1b3cd8,_0x1c8fd7){return function(_0x1e4716){if(_0x1e4716){var _0x96cab8=typeof _0x1c8fd7[_0xd336('0x1f')]===_0xd336('0x20')&&typeof _0x1c8fd7[_0xd336('0x21')]===_0xd336('0x20');var _0x2171a2=_0x1e4716[_0xd336('0x22')];var _0x3dfc7b=_0x96cab8?0x0:_0x1c8fd7[_0xd336('0x1f')];var _0x1eabe0=_0x96cab8?_0x1e4716[_0xd336('0x22')]:_0x1c8fd7[_0xd336('0x1f')]+_0x1c8fd7['limit'];var _0x3fd3d1;if(_0x1eabe0>=_0x2171a2){_0x1eabe0=_0x2171a2;_0x3fd3d1=0xc8;}else{_0x3fd3d1=0xce;}_0x1b3cd8[_0xd336('0x1c')](_0x3fd3d1);return _0x1b3cd8[_0xd336('0x23')]('Content-Range',_0x3dfc7b+'-'+_0x1eabe0+'/'+_0x2171a2)[_0xd336('0x1e')](_0x1e4716);}return null;};}function patchUpdates(_0x2a5349){return function(_0x4d7351){try{jsonpatch[_0xd336('0x24')](_0x4d7351,_0x2a5349,!![]);}catch(_0x190123){return BPromise['reject'](_0x190123);}return _0x4d7351[_0xd336('0x25')]();};}function saveUpdates(_0x4d76b2,_0x2dad56){return function(_0x3bf076){if(_0x3bf076){return _0x3bf076[_0xd336('0x26')](_0x4d76b2)[_0xd336('0x27')](function(_0x38736e){return _0x38736e;});}return null;};}function removeEntity(_0x4d7fa6,_0x4d6f4d){return function(_0xc1f71f){if(_0xc1f71f){return _0xc1f71f[_0xd336('0x28')]()[_0xd336('0x27')](function(){var _0xfa45e8=_0xc1f71f[_0xd336('0x29')]({'plain':!![]});var _0x2f16dd='IvrCampaigns';return db[_0xd336('0x2a')][_0xd336('0x28')]({'where':{'type':_0x2f16dd,'resourceId':_0xfa45e8['id']}})['then'](function(){return _0xc1f71f;});})['then'](function(){_0x4d7fa6[_0xd336('0x1c')](0xcc)[_0xd336('0x1d')]();});}};}function handleEntityNotFound(_0x4240bc,_0x2e0678){return function(_0xa99518){if(!_0xa99518){_0x4240bc[_0xd336('0x1b')](0x194);}return _0xa99518;};}function handleError(_0x2c11d6,_0x21f288){_0x21f288=_0x21f288||0x1f4;return function(_0x289051){logger[_0xd336('0x2b')](_0x289051['stack']);if(_0x289051['name']){delete _0x289051[_0xd336('0x2c')];}_0x2c11d6[_0xd336('0x1c')](_0x21f288)['send'](_0x289051);};}exports[_0xd336('0x2d')]=function(_0x337a90,_0x489dee){var _0x45aaa8={},_0x3c2439={},_0x389ed6={'count':0x0,'rows':[]};var _0x21c898=_[_0xd336('0x2e')](db[_0xd336('0x2f')][_0xd336('0x30')],function(_0x4cab5e){return{'name':_0x4cab5e[_0xd336('0x31')],'type':_0x4cab5e['type'][_0xd336('0x32')]};});_0x3c2439[_0xd336('0x33')]=_[_0xd336('0x2e')](_0x21c898,_0xd336('0x2c'));_0x3c2439[_0xd336('0x34')]=_[_0xd336('0x35')](_0x337a90[_0xd336('0x34')]);_0x3c2439[_0xd336('0x36')]=_[_0xd336('0x37')](_0x3c2439['model'],_0x3c2439[_0xd336('0x34')]);_0x45aaa8[_0xd336('0x38')]=_[_0xd336('0x37')](_0x3c2439[_0xd336('0x33')],qs[_0xd336('0x39')](_0x337a90[_0xd336('0x34')]['fields']));_0x45aaa8[_0xd336('0x38')]=_0x45aaa8[_0xd336('0x38')]['length']?_0x45aaa8[_0xd336('0x38')]:_0x3c2439['model'];if(!_0x337a90[_0xd336('0x34')][_0xd336('0x3a')](_0xd336('0x3b'))){_0x45aaa8[_0xd336('0x21')]=qs[_0xd336('0x21')](_0x337a90[_0xd336('0x34')][_0xd336('0x21')]);_0x45aaa8[_0xd336('0x1f')]=qs[_0xd336('0x1f')](_0x337a90[_0xd336('0x34')][_0xd336('0x1f')]);}_0x45aaa8[_0xd336('0x3c')]=qs['sort'](_0x337a90[_0xd336('0x34')][_0xd336('0x3d')]);_0x45aaa8[_0xd336('0x3e')]=qs[_0xd336('0x36')](_[_0xd336('0x3f')](_0x337a90['query'],_0x3c2439[_0xd336('0x36')]),_0x21c898);if(_0x337a90[_0xd336('0x34')][_0xd336('0x40')]){_0x45aaa8[_0xd336('0x3e')]=_[_0xd336('0x41')](_0x45aaa8['where'],{'$or':_[_0xd336('0x2e')](_0x21c898,function(_0x3c126c){if(_0x3c126c[_0xd336('0x42')]!=='VIRTUAL'){var _0x877fe1={};_0x877fe1[_0x3c126c['name']]={'$like':'%'+_0x337a90['query']['filter']+'%'};return _0x877fe1;}})});}_0x45aaa8=_[_0xd336('0x41')]({},_0x45aaa8,_0x337a90['options']);var _0x418b28={'where':_0x45aaa8[_0xd336('0x3e')]};return db['Campaign'][_0xd336('0x22')](_0x418b28)[_0xd336('0x27')](function(_0x456c35){_0x389ed6[_0xd336('0x22')]=_0x456c35;if(_0x337a90[_0xd336('0x34')][_0xd336('0x43')]){_0x45aaa8[_0xd336('0x44')]=[{'all':!![]}];}return db[_0xd336('0x2f')][_0xd336('0x45')](_0x45aaa8);})[_0xd336('0x27')](function(_0x24c734){_0x389ed6['rows']=_0x24c734;return _0x389ed6;})['then'](respondWithFilteredResult(_0x489dee,_0x45aaa8))[_0xd336('0x46')](handleError(_0x489dee,null));};exports[_0xd336('0x47')]=function(_0x24d222,_0x5ec77b){var _0x112e84={'raw':![],'where':{'id':_0x24d222[_0xd336('0x48')]['id']}},_0x33fef7={};_0x33fef7['model']=_[_0xd336('0x35')](db[_0xd336('0x2f')][_0xd336('0x30')]);_0x33fef7['query']=_['keys'](_0x24d222['query']);_0x33fef7[_0xd336('0x36')]=_[_0xd336('0x37')](_0x33fef7['model'],_0x33fef7[_0xd336('0x34')]);_0x112e84[_0xd336('0x38')]=_[_0xd336('0x37')](_0x33fef7['model'],qs['fields'](_0x24d222[_0xd336('0x34')][_0xd336('0x39')]));_0x112e84[_0xd336('0x38')]=_0x112e84[_0xd336('0x38')][_0xd336('0x49')]?_0x112e84[_0xd336('0x38')]:_0x33fef7[_0xd336('0x33')];if(_0x24d222['query'][_0xd336('0x43')]){_0x112e84[_0xd336('0x44')]=[{'all':!![]}];}_0x112e84=_['merge']({},_0x112e84,_0x24d222[_0xd336('0x4a')]);return db[_0xd336('0x2f')][_0xd336('0x4b')](_0x112e84)[_0xd336('0x27')](handleEntityNotFound(_0x5ec77b,null))[_0xd336('0x27')](respondWithResult(_0x5ec77b,null))['catch'](handleError(_0x5ec77b,null));};exports[_0xd336('0x4c')]=function(_0x163c36,_0x34530e){return db['Campaign'][_0xd336('0x4c')](_0x163c36[_0xd336('0x4d')],{})['then'](function(_0x3a4ef9){var _0x2388b7=_0x163c36[_0xd336('0x4e')][_0xd336('0x29')]({'plain':!![]});if(!_0x2388b7)throw new Error(_0xd336('0x4f'));if(_0x2388b7['role']===_0xd336('0x4e')){var _0x3df648=_0x3a4ef9['get']({'plain':!![]});var _0x4040ca='IvrCampaigns';return db['UserProfileSection'][_0xd336('0x4b')]({'where':{'name':_0x4040ca,'userProfileId':_0x2388b7[_0xd336('0x50')]},'raw':!![]})[_0xd336('0x27')](function(_0x12f414){if(_0x12f414&&_0x12f414[_0xd336('0x51')]===0x0){return db['UserProfileResource'][_0xd336('0x4c')]({'name':_0x3df648[_0xd336('0x2c')],'resourceId':_0x3df648['id'],'type':_0x12f414[_0xd336('0x2c')],'sectionId':_0x12f414['id']},{})[_0xd336('0x27')](function(){return _0x3a4ef9;});}else{return _0x3a4ef9;}})[_0xd336('0x46')](function(_0x4bf412){logger[_0xd336('0x2b')](_0xd336('0x52'),_0x4bf412);throw _0x4bf412;});}return _0x3a4ef9;})['then'](respondWithResult(_0x34530e,0xc9))[_0xd336('0x46')](handleError(_0x34530e,null));};exports[_0xd336('0x53')]=function(_0x34761b,_0x2e72c0){var _0x865cc7={'where':{'id':_0x34761b[_0xd336('0x48')]['id']}},_0x179533={};_0x179533['model']=_[_0xd336('0x35')](db['Campaign'][_0xd336('0x30')]);_0x865cc7['attributes']=_[_0xd336('0x37')](_0x179533[_0xd336('0x33')],qs[_0xd336('0x39')](_0x34761b[_0xd336('0x34')][_0xd336('0x39')]));_0x865cc7['attributes']=_0x865cc7[_0xd336('0x38')]['length']?_0x865cc7[_0xd336('0x38')]:_0x179533[_0xd336('0x33')];if(_0x34761b['query'][_0xd336('0x43')]){_0x865cc7[_0xd336('0x44')]=[{'all':!![]}];}_0x865cc7=_[_0xd336('0x41')]({},_0x865cc7,_0x34761b[_0xd336('0x4a')]);return db['Campaign'][_0xd336('0x4b')](_0x865cc7)[_0xd336('0x27')](handleEntityNotFound(_0x2e72c0,null))['then'](function(_0x310cbd){if(_0x310cbd){var _0x1b436=_0x310cbd[_0xd336('0x29')]({'plain':!![]});_0x1b436=qs['omit'](_0x1b436,['id',_0xd336('0x54'),_0xd336('0x55')]);_0x34761b[_0xd336('0x4d')]=_[_0xd336('0x56')](_0x34761b[_0xd336('0x4d')],['id','createdAt',_0xd336('0x55')]);return db['Campaign'][_0xd336('0x4c')](_['merge'](_0x1b436,_0x34761b[_0xd336('0x4d')]),{'include':_0x34761b[_0xd336('0x34')][_0xd336('0x43')]?[{'all':!![]}]:undefined})['then'](function(_0xde88fc){var _0x2e3bc5=_0x34761b[_0xd336('0x4e')][_0xd336('0x29')]({'plain':!![]});if(!_0x2e3bc5)throw new Error(_0xd336('0x4f'));if(_0x2e3bc5[_0xd336('0x57')]===_0xd336('0x4e')){var _0x3229c0=_0xde88fc['get']({'plain':!![]});var _0x1709cb=_0xd336('0x58');return db[_0xd336('0x59')][_0xd336('0x4b')]({'where':{'name':_0x1709cb,'userProfileId':_0x2e3bc5[_0xd336('0x50')]},'raw':!![]})[_0xd336('0x27')](function(_0x2693f3){if(_0x2693f3&&_0x2693f3['autoAssociation']===0x0){return db[_0xd336('0x2a')][_0xd336('0x4c')]({'name':_0x3229c0['name'],'resourceId':_0x3229c0['id'],'type':_0x2693f3[_0xd336('0x2c')],'sectionId':_0x2693f3['id']},{})[_0xd336('0x27')](function(){return _0xde88fc;});}else{return _0xde88fc;}})[_0xd336('0x46')](function(_0x50f288){logger[_0xd336('0x2b')](_0xd336('0x52'),_0x50f288);throw _0x50f288;});}return _0xde88fc;});}})[_0xd336('0x27')](respondWithResult(_0x2e72c0,0xc9))[_0xd336('0x46')](handleError(_0x2e72c0,null));};exports[_0xd336('0x26')]=function(_0x49d74e,_0x3e3911){if(_0x49d74e[_0xd336('0x4d')]['id']){delete _0x49d74e[_0xd336('0x4d')]['id'];}return db[_0xd336('0x2f')][_0xd336('0x4b')]({'where':{'id':_0x49d74e[_0xd336('0x48')]['id']}})[_0xd336('0x27')](handleEntityNotFound(_0x3e3911,null))[_0xd336('0x27')](saveUpdates(_0x49d74e[_0xd336('0x4d')],null))[_0xd336('0x27')](respondWithResult(_0x3e3911,null))['catch'](handleError(_0x3e3911,null));};exports[_0xd336('0x28')]=function(_0x54e68e,_0x29f840){return db[_0xd336('0x2f')][_0xd336('0x4b')]({'where':{'id':_0x54e68e['params']['id']}})[_0xd336('0x27')](handleEntityNotFound(_0x29f840,null))[_0xd336('0x27')](removeEntity(_0x29f840,null))[_0xd336('0x46')](handleError(_0x29f840,null));};exports[_0xd336('0x5a')]=function(_0x434a29,_0x1c5563,_0x1fe9e4){var _0x4222e2={'raw':!![],'where':{}};var _0x46713c={};var _0x5022ba={'count':0x0,'rows':[]};return db[_0xd336('0x2f')][_0xd336('0x5b')]({'where':{'id':_0x434a29[_0xd336('0x48')]['id']}})['then'](handleEntityNotFound(_0x1c5563,null))[_0xd336('0x27')](function(_0x35f41d){if(_0x35f41d){_0x46713c[_0xd336('0x33')]=_[_0xd336('0x35')](db[_0xd336('0x5c')][_0xd336('0x30')]);_0x46713c[_0xd336('0x34')]=_[_0xd336('0x35')](_0x434a29[_0xd336('0x34')]);_0x46713c[_0xd336('0x36')]=_[_0xd336('0x37')](_0x46713c[_0xd336('0x33')],_0x46713c[_0xd336('0x34')]);_0x4222e2['attributes']=_[_0xd336('0x37')](_0x46713c[_0xd336('0x33')],qs[_0xd336('0x39')](_0x434a29[_0xd336('0x34')][_0xd336('0x39')]));_0x4222e2[_0xd336('0x38')]=_0x4222e2[_0xd336('0x38')][_0xd336('0x49')]?_0x4222e2[_0xd336('0x38')]:_0x46713c[_0xd336('0x33')];if(!_0x434a29['query']['hasOwnProperty'](_0xd336('0x3b'))){_0x4222e2[_0xd336('0x21')]=qs[_0xd336('0x21')](_0x434a29[_0xd336('0x34')]['limit']);_0x4222e2[_0xd336('0x1f')]=qs['offset'](_0x434a29[_0xd336('0x34')][_0xd336('0x1f')]);}_0x4222e2[_0xd336('0x3c')]=qs['sort'](_0x434a29[_0xd336('0x34')][_0xd336('0x3d')]);_0x4222e2[_0xd336('0x3e')]=qs[_0xd336('0x36')](_[_0xd336('0x3f')](_0x434a29[_0xd336('0x34')],_0x46713c[_0xd336('0x36')]));_0x4222e2[_0xd336('0x3e')]['CampaignId']=_0x35f41d['id'];if(_0x434a29[_0xd336('0x34')]['filter']){_0x4222e2['where']=_[_0xd336('0x41')](_0x4222e2[_0xd336('0x3e')],{'$or':_['map'](_0x4222e2[_0xd336('0x38')],function(_0x2ff83c){var _0x1f999a={};_0x1f999a[_0x2ff83c]={'$like':'%'+_0x434a29[_0xd336('0x34')][_0xd336('0x40')]+'%'};return _0x1f999a;})});}_0x4222e2=_['merge']({},_0x4222e2,_0x434a29['options']);return db[_0xd336('0x5c')][_0xd336('0x22')]({'where':_0x4222e2[_0xd336('0x3e')]})[_0xd336('0x27')](function(_0x2cb6eb){_0x5022ba[_0xd336('0x22')]=_0x2cb6eb;if(_0x434a29['query'][_0xd336('0x43')]){_0x4222e2[_0xd336('0x44')]=[{'all':!![]}];}return db[_0xd336('0x5c')][_0xd336('0x45')](_0x4222e2);})['then'](function(_0xc9c6b3){_0x5022ba[_0xd336('0x5d')]=_0xc9c6b3;return _0x5022ba;});}})[_0xd336('0x27')](respondWithFilteredResult(_0x1c5563,_0x4222e2))[_0xd336('0x46')](handleError(_0x1c5563,null));};exports[_0xd336('0x5e')]=function(_0xca6ec4,_0x239358,_0x6fc3ad){var _0x30908a={'raw':!![],'where':{}};var _0x43c0f7={};var _0x3e0663={'count':0x0,'rows':[]};return db[_0xd336('0x2f')][_0xd336('0x5b')]({'where':{'id':_0xca6ec4[_0xd336('0x48')]['id']}})[_0xd336('0x27')](handleEntityNotFound(_0x239358,null))[_0xd336('0x27')](function(_0x149acc){if(_0x149acc){_0x43c0f7[_0xd336('0x33')]=_[_0xd336('0x35')](db[_0xd336('0x5f')][_0xd336('0x30')]);_0x43c0f7[_0xd336('0x34')]=_[_0xd336('0x35')](_0xca6ec4[_0xd336('0x34')]);_0x43c0f7[_0xd336('0x36')]=_[_0xd336('0x37')](_0x43c0f7[_0xd336('0x33')],_0x43c0f7[_0xd336('0x34')]);_0x30908a[_0xd336('0x38')]=_['intersection'](_0x43c0f7[_0xd336('0x33')],qs[_0xd336('0x39')](_0xca6ec4[_0xd336('0x34')][_0xd336('0x39')]));_0x30908a['attributes']=_0x30908a[_0xd336('0x38')]['length']?_0x30908a['attributes']:_0x43c0f7['model'];if(!_0xca6ec4[_0xd336('0x34')][_0xd336('0x3a')](_0xd336('0x3b'))){_0x30908a[_0xd336('0x21')]=qs[_0xd336('0x21')](_0xca6ec4[_0xd336('0x34')]['limit']);_0x30908a[_0xd336('0x1f')]=qs[_0xd336('0x1f')](_0xca6ec4[_0xd336('0x34')]['offset']);}_0x30908a[_0xd336('0x3c')]=qs[_0xd336('0x3d')](_0xca6ec4[_0xd336('0x34')][_0xd336('0x3d')]);_0x30908a[_0xd336('0x3e')]=qs[_0xd336('0x36')](_['pick'](_0xca6ec4[_0xd336('0x34')],_0x43c0f7['filters']));_0x30908a[_0xd336('0x3e')][_0xd336('0x60')]=_0x149acc['id'];if(_0xca6ec4[_0xd336('0x34')][_0xd336('0x40')]){_0x30908a[_0xd336('0x3e')]=_[_0xd336('0x41')](_0x30908a[_0xd336('0x3e')],{'$or':_[_0xd336('0x2e')](_0x30908a[_0xd336('0x38')],function(_0x24b2fd){var _0x3ce687={};_0x3ce687[_0x24b2fd]={'$like':'%'+_0xca6ec4[_0xd336('0x34')][_0xd336('0x40')]+'%'};return _0x3ce687;})});}_0x30908a=_[_0xd336('0x41')]({},_0x30908a,_0xca6ec4[_0xd336('0x4a')]);return db['CmHopperHistory'][_0xd336('0x22')]({'where':_0x30908a['where']})[_0xd336('0x27')](function(_0x2ae4dc){_0x3e0663[_0xd336('0x22')]=_0x2ae4dc;if(_0xca6ec4[_0xd336('0x34')][_0xd336('0x43')]){_0x30908a['include']=[{'all':!![]}];}return db[_0xd336('0x5f')][_0xd336('0x45')](_0x30908a);})[_0xd336('0x27')](function(_0x1c761c){_0x3e0663[_0xd336('0x5d')]=_0x1c761c;return _0x3e0663;});}})[_0xd336('0x27')](respondWithFilteredResult(_0x239358,_0x30908a))['catch'](handleError(_0x239358,null));};exports[_0xd336('0x61')]=function(_0x35d124,_0x12bb68,_0x5290d1){var _0x13e5f0={'raw':!![],'where':{}};var _0x1d5699={};var _0x28e29={'count':0x0,'rows':[]};return db[_0xd336('0x2f')][_0xd336('0x5b')]({'where':{'id':_0x35d124[_0xd336('0x48')]['id']}})[_0xd336('0x27')](handleEntityNotFound(_0x12bb68,null))[_0xd336('0x27')](function(_0x5e038e){if(_0x5e038e){_0x1d5699[_0xd336('0x33')]=_[_0xd336('0x35')](db[_0xd336('0x62')][_0xd336('0x30')]);_0x1d5699['query']=_['keys'](_0x35d124['query']);_0x1d5699[_0xd336('0x36')]=_[_0xd336('0x37')](_0x1d5699[_0xd336('0x33')],_0x1d5699[_0xd336('0x34')]);_0x13e5f0['attributes']=_[_0xd336('0x37')](_0x1d5699[_0xd336('0x33')],qs['fields'](_0x35d124[_0xd336('0x34')][_0xd336('0x39')]));_0x13e5f0[_0xd336('0x38')]=_0x13e5f0[_0xd336('0x38')]['length']?_0x13e5f0[_0xd336('0x38')]:_0x1d5699[_0xd336('0x33')];if(!_0x35d124[_0xd336('0x34')][_0xd336('0x3a')]('nolimit')){_0x13e5f0['limit']=qs[_0xd336('0x21')](_0x35d124[_0xd336('0x34')][_0xd336('0x21')]);_0x13e5f0['offset']=qs[_0xd336('0x1f')](_0x35d124[_0xd336('0x34')][_0xd336('0x1f')]);}_0x13e5f0[_0xd336('0x3c')]=qs[_0xd336('0x3d')](_0x35d124[_0xd336('0x34')][_0xd336('0x3d')]);_0x13e5f0[_0xd336('0x3e')]=qs[_0xd336('0x36')](_[_0xd336('0x3f')](_0x35d124[_0xd336('0x34')],_0x1d5699[_0xd336('0x36')]));_0x13e5f0[_0xd336('0x3e')][_0xd336('0x60')]=_0x5e038e['id'];if(_0x35d124[_0xd336('0x34')]['filter']){_0x13e5f0[_0xd336('0x3e')]=_[_0xd336('0x41')](_0x13e5f0[_0xd336('0x3e')],{'$or':_[_0xd336('0x2e')](_0x13e5f0['attributes'],function(_0x5129b1){var _0x287a5f={};_0x287a5f[_0x5129b1]={'$like':'%'+_0x35d124[_0xd336('0x34')][_0xd336('0x40')]+'%'};return _0x287a5f;})});}_0x13e5f0=_['merge']({},_0x13e5f0,_0x35d124[_0xd336('0x4a')]);return db[_0xd336('0x62')]['count']({'where':_0x13e5f0[_0xd336('0x3e')]})['then'](function(_0x46bb99){_0x28e29['count']=_0x46bb99;if(_0x35d124[_0xd336('0x34')][_0xd336('0x43')]){_0x13e5f0['include']=[{'all':!![]}];}return db[_0xd336('0x62')][_0xd336('0x45')](_0x13e5f0);})[_0xd336('0x27')](function(_0xed5080){_0x28e29[_0xd336('0x5d')]=_0xed5080;return _0x28e29;});}})[_0xd336('0x27')](respondWithFilteredResult(_0x12bb68,_0x13e5f0))[_0xd336('0x46')](handleError(_0x12bb68,null));};exports[_0xd336('0x63')]=function(_0x5f50ef,_0x218026,_0x5540f0){var _0x593429={'raw':!![],'where':{}};var _0x513cfe={};var _0x56125b={'count':0x0,'rows':[]};return db[_0xd336('0x2f')]['findOne']({'where':{'id':_0x5f50ef['params']['id']}})['then'](handleEntityNotFound(_0x218026,null))[_0xd336('0x27')](function(_0x2042d6){if(_0x2042d6){_0x513cfe['model']=_['keys'](db[_0xd336('0x64')][_0xd336('0x30')]);_0x513cfe[_0xd336('0x34')]=_[_0xd336('0x35')](_0x5f50ef[_0xd336('0x34')]);_0x513cfe['filters']=_[_0xd336('0x37')](_0x513cfe['model'],_0x513cfe[_0xd336('0x34')]);_0x593429[_0xd336('0x38')]=_[_0xd336('0x37')](_0x513cfe[_0xd336('0x33')],qs[_0xd336('0x39')](_0x5f50ef[_0xd336('0x34')][_0xd336('0x39')]));_0x593429['attributes']=_0x593429[_0xd336('0x38')]['length']?_0x593429[_0xd336('0x38')]:_0x513cfe[_0xd336('0x33')];if(!_0x5f50ef[_0xd336('0x34')][_0xd336('0x3a')](_0xd336('0x3b'))){_0x593429['limit']=qs[_0xd336('0x21')](_0x5f50ef[_0xd336('0x34')][_0xd336('0x21')]);_0x593429['offset']=qs[_0xd336('0x1f')](_0x5f50ef[_0xd336('0x34')][_0xd336('0x1f')]);}_0x593429['order']=qs[_0xd336('0x3d')](_0x5f50ef[_0xd336('0x34')][_0xd336('0x3d')]);_0x593429['where']=qs[_0xd336('0x36')](_[_0xd336('0x3f')](_0x5f50ef[_0xd336('0x34')],_0x513cfe['filters']));_0x593429[_0xd336('0x3e')][_0xd336('0x60')]=_0x2042d6['id'];if(_0x5f50ef[_0xd336('0x34')][_0xd336('0x40')]){_0x593429['where']=_['merge'](_0x593429['where'],{'$or':_[_0xd336('0x2e')](_0x593429[_0xd336('0x38')],function(_0x299aa9){var _0x357708={};_0x357708[_0x299aa9]={'$like':'%'+_0x5f50ef[_0xd336('0x34')]['filter']+'%'};return _0x357708;})});}_0x593429=_[_0xd336('0x41')]({},_0x593429,_0x5f50ef['options']);return db[_0xd336('0x64')][_0xd336('0x22')]({'where':_0x593429[_0xd336('0x3e')]})[_0xd336('0x27')](function(_0x508025){_0x56125b[_0xd336('0x22')]=_0x508025;if(_0x5f50ef[_0xd336('0x34')][_0xd336('0x43')]){_0x593429['include']=[{'all':!![]}];}return db[_0xd336('0x64')][_0xd336('0x45')](_0x593429);})[_0xd336('0x27')](function(_0x7f7454){_0x56125b[_0xd336('0x5d')]=_0x7f7454;return _0x56125b;});}})['then'](respondWithFilteredResult(_0x218026,_0x593429))[_0xd336('0x46')](handleError(_0x218026,null));};exports[_0xd336('0x65')]=function(_0x4a6e87,_0x55bba7,_0x20e939){var _0x3ead6e={};var _0x27ccf5={};var _0x31da91;var _0x50e3b1;return db[_0xd336('0x2f')]['findOne']({'where':{'id':_0x4a6e87[_0xd336('0x48')]['id']}})['then'](handleEntityNotFound(_0x55bba7,null))[_0xd336('0x27')](function(_0x21b247){if(_0x21b247){_0x31da91=_0x21b247;_0x27ccf5[_0xd336('0x33')]=_['keys'](db[_0xd336('0x66')][_0xd336('0x30')]);_0x27ccf5[_0xd336('0x34')]=_['keys'](_0x4a6e87[_0xd336('0x34')]);_0x27ccf5[_0xd336('0x36')]=_['intersection'](_0x27ccf5[_0xd336('0x33')],_0x27ccf5[_0xd336('0x34')]);_0x3ead6e[_0xd336('0x38')]=_[_0xd336('0x37')](_0x27ccf5[_0xd336('0x33')],qs['fields'](_0x4a6e87[_0xd336('0x34')][_0xd336('0x39')]));_0x3ead6e[_0xd336('0x38')]=_0x3ead6e[_0xd336('0x38')][_0xd336('0x49')]?_0x3ead6e[_0xd336('0x38')]:_0x27ccf5['model'];_0x3ead6e['order']=qs['sort'](_0x4a6e87[_0xd336('0x34')][_0xd336('0x3d')]);_0x3ead6e['where']=qs[_0xd336('0x36')](_['pick'](_0x4a6e87[_0xd336('0x34')],_0x27ccf5[_0xd336('0x36')]));if(_0x4a6e87['query']['filter']){_0x3ead6e[_0xd336('0x3e')]=_[_0xd336('0x41')](_0x3ead6e[_0xd336('0x3e')],{'$or':_[_0xd336('0x2e')](_0x3ead6e[_0xd336('0x38')],function(_0x177761){var _0x28ccee={};_0x28ccee[_0x177761]={'$like':'%'+_0x4a6e87['query'][_0xd336('0x40')]+'%'};return _0x28ccee;})});}_0x3ead6e=_[_0xd336('0x41')]({},_0x3ead6e,_0x4a6e87[_0xd336('0x4a')]);return _0x31da91['getLists'](_0x3ead6e);}})[_0xd336('0x27')](function(_0x41d4ab){if(_0x41d4ab){_0x50e3b1=_0x41d4ab[_0xd336('0x49')];if(!_0x4a6e87[_0xd336('0x34')][_0xd336('0x3a')](_0xd336('0x3b'))){_0x3ead6e[_0xd336('0x21')]=qs['limit'](_0x4a6e87['query'][_0xd336('0x21')]);_0x3ead6e['offset']=qs[_0xd336('0x1f')](_0x4a6e87['query'][_0xd336('0x1f')]);}return _0x31da91[_0xd336('0x65')](_0x3ead6e);}})[_0xd336('0x27')](function(_0x21dd89){if(_0x21dd89){return _0x21dd89?{'count':_0x50e3b1,'rows':_0x21dd89}:null;}})[_0xd336('0x27')](respondWithResult(_0x55bba7,null))['catch'](handleError(_0x55bba7,null));};exports[_0xd336('0x67')]=function(_0xdfda16,_0x4a500e,_0x99bd7f){var _0x4e202d,_0x51540b;var _0x57a266=[];var _0x5a2b37=moment()[_0xd336('0x68')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0xd336('0x2f')]['find']({'where':{'id':_0xdfda16[_0xd336('0x48')]['id']}})['then'](handleEntityNotFound(_0x4a500e,null))[_0xd336('0x27')](function(_0xbf861c){if(_0xbf861c){_0x51540b=_0xbf861c;return _0xbf861c[_0xd336('0x67')](_0xdfda16[_0xd336('0x4d')][_0xd336('0x69')],_[_0xd336('0x56')](_0xdfda16['body'],[_0xd336('0x69'),'id'])||{});}return null;})[_0xd336('0x6a')](function(_0x28e0f0){var _0x2ad7ae;var _0x1ee500;_0x4e202d=_0x28e0f0||[];var _0x507b91=[];if(_0x28e0f0){for(var _0x4a89e8=0x0;_0x4a89e8<_0x28e0f0[_0xd336('0x49')];_0x4a89e8+=0x1){var _0x5afac5=_0x28e0f0[_0x4a89e8][_0xd336('0x29')]({'plain':!![]});_0x51540b[_0xd336('0x6b')]=_0xdfda16[_0xd336('0x4d')][_0xd336('0x6b')]?_0xdfda16['body'][_0xd336('0x6b')]:_0x51540b[_0xd336('0x6b')];switch(_0x51540b['dialCheckDuplicateType']){case _0xd336('0x6c'):_0x2ad7ae=squel[_0xd336('0x6d')]()['into'](_0xd336('0x6e'))[_0xd336('0x6f')]([_0xd336('0x70'),_0xd336('0x71'),_0xd336('0x72'),'ListId',_0xd336('0x60'),'createdAt',_0xd336('0x55')],squel[_0xd336('0x73')]()[_0xd336('0x74')](_0xd336('0x70'),_0xd336('0x70'))[_0xd336('0x74')](_0xd336('0x75'),_0xd336('0x71'))[_0xd336('0x74')]('id','ContactId')[_0xd336('0x74')](_0x5afac5[_0xd336('0x76')]['toString'](),'ListId')[_0xd336('0x74')](_0xdfda16['params']['id'][_0xd336('0x77')](),_0xd336('0x60'))['field']('\x27'+_0x5a2b37+'\x27','createdAt')[_0xd336('0x74')]('\x27'+_0x5a2b37+'\x27',_0xd336('0x55'))['from'](_0xd336('0x78'))[_0xd336('0x3e')](_0xd336('0x79'))['where'](_0xd336('0x7a'),_0x5afac5[_0xd336('0x76')][_0xd336('0x77')]())[_0xd336('0x3e')](_0xd336('0x7b'))[_0xd336('0x3e')](_0xd336('0x7c'),squel[_0xd336('0x73')]()[_0xd336('0x74')]('COALESCE(calleridnum,\x27\x27)')['from'](_0xd336('0x7d'))[_0xd336('0x3e')](_0xd336('0x7e'),_0xdfda16[_0xd336('0x48')]['id'][_0xd336('0x77')]()))[_0xd336('0x3e')](_0xd336('0x7c'),squel[_0xd336('0x73')]()[_0xd336('0x74')](_0xd336('0x7f'))['from'](_0xd336('0x6e'))[_0xd336('0x3e')](_0xd336('0x7e'),_0xdfda16[_0xd336('0x48')]['id'][_0xd336('0x77')]())))[_0xd336('0x77')]();break;case'onlyIfOpen':_0x2ad7ae=squel[_0xd336('0x6d')]()[_0xd336('0x80')](_0xd336('0x6e'))[_0xd336('0x6f')](['phone',_0xd336('0x71'),_0xd336('0x72'),_0xd336('0x81'),_0xd336('0x60'),'createdAt',_0xd336('0x55')],squel[_0xd336('0x73')]()[_0xd336('0x74')](_0xd336('0x70'),_0xd336('0x70'))[_0xd336('0x74')](_0xd336('0x75'),_0xd336('0x71'))[_0xd336('0x74')]('id',_0xd336('0x72'))[_0xd336('0x74')](_0x5afac5['CmListId'][_0xd336('0x77')](),_0xd336('0x81'))[_0xd336('0x74')](_0xdfda16[_0xd336('0x48')]['id'][_0xd336('0x77')](),_0xd336('0x60'))['field']('\x27'+_0x5a2b37+'\x27','createdAt')['field']('\x27'+_0x5a2b37+'\x27',_0xd336('0x55'))['from'](_0xd336('0x78'))[_0xd336('0x3e')]('deletedAt\x20IS\x20NULL')[_0xd336('0x3e')](_0xd336('0x7a'),_0x5afac5[_0xd336('0x76')][_0xd336('0x77')]())[_0xd336('0x3e')](_0xd336('0x7b'))[_0xd336('0x3e')](_0xd336('0x7c'),squel[_0xd336('0x73')]()[_0xd336('0x74')](_0xd336('0x7f'))['from'](_0xd336('0x6e'))[_0xd336('0x3e')]('CampaignId\x20=\x20?',_0xdfda16[_0xd336('0x48')]['id'][_0xd336('0x77')]())))['toString']();break;default:_0x2ad7ae=squel[_0xd336('0x6d')]()['into'](_0xd336('0x6e'))[_0xd336('0x6f')]([_0xd336('0x70'),_0xd336('0x71'),_0xd336('0x72'),'ListId','CampaignId',_0xd336('0x54'),_0xd336('0x55')],squel['select']()['field']('phone',_0xd336('0x70'))[_0xd336('0x74')]('NOW()','scheduledAt')['field']('id',_0xd336('0x72'))[_0xd336('0x74')](_0x5afac5[_0xd336('0x76')]['toString'](),_0xd336('0x81'))[_0xd336('0x74')](_0xdfda16[_0xd336('0x48')]['id'][_0xd336('0x77')](),_0xd336('0x60'))['field']('\x27'+_0x5a2b37+'\x27',_0xd336('0x54'))[_0xd336('0x74')]('\x27'+_0x5a2b37+'\x27',_0xd336('0x55'))[_0xd336('0x82')](_0xd336('0x78'))[_0xd336('0x3e')](_0xd336('0x79'))[_0xd336('0x3e')](_0xd336('0x7a'),_0x5afac5[_0xd336('0x76')][_0xd336('0x77')]())[_0xd336('0x3e')](_0xd336('0x7b')))[_0xd336('0x77')]();}_0x1ee500=squel[_0xd336('0x6d')]()[_0xd336('0x80')]('cm_hopper_additional_phones')[_0xd336('0x6f')](['cmHopperId',_0xd336('0x71'),_0xd336('0x70'),_0xd336('0x83'),_0xd336('0x54'),_0xd336('0x55')],squel[_0xd336('0x73')]()[_0xd336('0x74')](_0xd336('0x84'),'id')[_0xd336('0x74')](_0xd336('0x75'),_0xd336('0x71'))['field'](_0xd336('0x85'),_0xd336('0x70'))[_0xd336('0x74')]('ci.OrderBY','OrderBy')['field']('\x27'+_0x5a2b37+'\x27',_0xd336('0x54'))['field']('\x27'+_0x5a2b37+'\x27',_0xd336('0x55'))[_0xd336('0x82')](_0xd336('0x86'),'ci')['join'](_0xd336('0x6e'),'h',_0xd336('0x87'))[_0xd336('0x3e')](_0xd336('0x88'),_0x5afac5['CmListId'][_0xd336('0x77')]())[_0xd336('0x3e')](_0xd336('0x89'),_0xdfda16['params']['id'][_0xd336('0x77')]())['where'](_0xd336('0x8a'),_0x5a2b37))['toString']();_0x507b91['push'](db[_0xd336('0x8b')][_0xd336('0x34')](_0x2ad7ae));_0x57a266[_0xd336('0x8c')](db[_0xd336('0x8b')]['query'](_0x1ee500));}return BPromise[_0xd336('0x8d')](_0x507b91);}})[_0xd336('0x27')](function(){return BPromise['all'](_0x57a266);})[_0xd336('0x27')](function(){return _0x4e202d;})[_0xd336('0x27')](respondWithResult(_0x4a500e,null))['catch'](handleError(_0x4a500e,null));};exports[_0xd336('0x8e')]=function(_0x20eed7,_0x327d45,_0x63ab7d){return db[_0xd336('0x2f')][_0xd336('0x4b')]({'where':{'id':_0x20eed7['params']['id']}})['then'](handleEntityNotFound(_0x327d45,null))[_0xd336('0x27')](function(_0x1ff1c9){if(_0x1ff1c9){return _0x1ff1c9[_0xd336('0x8e')](_0x20eed7[_0xd336('0x34')]['ids']);}})[_0xd336('0x27')](function(_0x2c84a3){if(_0x2c84a3){return db[_0xd336('0x5c')][_0xd336('0x28')]({'where':{'ListId':_0x20eed7['query'][_0xd336('0x69')],'CampaignId':_0x20eed7[_0xd336('0x48')]['id']}})[_0xd336('0x27')](function(){return _0x2c84a3;});}})[_0xd336('0x27')](respondWithStatusCode(_0x327d45,null))[_0xd336('0x46')](handleError(_0x327d45,null));};exports[_0xd336('0x8f')]=function(_0x490b6e,_0x205e59,_0x43ee1c){var _0x1be820={};var _0x29b59d={};var _0x57c9d3;var _0x49c9ad;return db[_0xd336('0x2f')][_0xd336('0x5b')]({'where':{'id':_0x490b6e['params']['id']}})[_0xd336('0x27')](handleEntityNotFound(_0x205e59,null))['then'](function(_0x4e0b2c){if(_0x4e0b2c){_0x57c9d3=_0x4e0b2c;_0x29b59d[_0xd336('0x33')]=_[_0xd336('0x35')](db[_0xd336('0x66')][_0xd336('0x30')]);_0x29b59d[_0xd336('0x34')]=_['keys'](_0x490b6e[_0xd336('0x34')]);_0x29b59d[_0xd336('0x36')]=_[_0xd336('0x37')](_0x29b59d[_0xd336('0x33')],_0x29b59d['query']);_0x1be820[_0xd336('0x38')]=_[_0xd336('0x37')](_0x29b59d[_0xd336('0x33')],qs[_0xd336('0x39')](_0x490b6e[_0xd336('0x34')]['fields']));_0x1be820[_0xd336('0x38')]=_0x1be820[_0xd336('0x38')][_0xd336('0x49')]?_0x1be820[_0xd336('0x38')]:_0x29b59d[_0xd336('0x33')];_0x1be820['order']=qs[_0xd336('0x3d')](_0x490b6e[_0xd336('0x34')][_0xd336('0x3d')]);_0x1be820['where']=qs[_0xd336('0x36')](_[_0xd336('0x3f')](_0x490b6e['query'],_0x29b59d[_0xd336('0x36')]));if(_0x490b6e[_0xd336('0x34')][_0xd336('0x40')]){_0x1be820[_0xd336('0x3e')]=_['merge'](_0x1be820['where'],{'$or':_[_0xd336('0x2e')](_0x1be820['attributes'],function(_0x483d41){var _0xbec22d={};_0xbec22d[_0x483d41]={'$like':'%'+_0x490b6e[_0xd336('0x34')]['filter']+'%'};return _0xbec22d;})});}_0x1be820=_[_0xd336('0x41')]({},_0x1be820,_0x490b6e['options']);return _0x57c9d3['getBlackLists'](_0x1be820);}})[_0xd336('0x27')](function(_0x15d57c){if(_0x15d57c){_0x49c9ad=_0x15d57c[_0xd336('0x49')];if(!_0x490b6e[_0xd336('0x34')][_0xd336('0x3a')](_0xd336('0x3b'))){_0x1be820[_0xd336('0x21')]=qs[_0xd336('0x21')](_0x490b6e[_0xd336('0x34')][_0xd336('0x21')]);_0x1be820['offset']=qs['offset'](_0x490b6e['query']['offset']);}return _0x57c9d3[_0xd336('0x8f')](_0x1be820);}})[_0xd336('0x27')](function(_0x556f57){if(_0x556f57){return _0x556f57?{'count':_0x49c9ad,'rows':_0x556f57}:null;}})[_0xd336('0x27')](respondWithResult(_0x205e59,null))['catch'](handleError(_0x205e59,null));};exports[_0xd336('0x90')]=function(_0xf65e60,_0x16cfe6,_0x44e2fa){var _0x35b35d,_0x4c2437;var _0x32d6ab=[];var _0x21ed7b=moment()['format'](_0xd336('0x91'));return db[_0xd336('0x2f')][_0xd336('0x4b')]({'where':{'id':_0xf65e60['params']['id']}})[_0xd336('0x27')](handleEntityNotFound(_0x16cfe6,null))[_0xd336('0x27')](function(_0x5381b2){if(_0x5381b2){_0x4c2437=_0x5381b2;return _0x5381b2['addBlackLists'](_0xf65e60[_0xd336('0x4d')][_0xd336('0x69')],_[_0xd336('0x56')](_0xf65e60[_0xd336('0x4d')],['ids','id'])||{});}return null;})[_0xd336('0x6a')](function(_0x2e38bb){var _0xc17866;var _0x1def26;_0x35b35d=_0x2e38bb||[];var _0x10de6e=[];if(_0x2e38bb){for(var _0x599649=0x0;_0x599649<_0x2e38bb[_0xd336('0x49')];_0x599649+=0x1){var _0x5d2769=_0x2e38bb[_0x599649][_0xd336('0x29')]({'plain':!![]});_0xc17866=squel[_0xd336('0x6d')]()[_0xd336('0x80')](_0xd336('0x92'))[_0xd336('0x6f')]([_0xd336('0x70'),_0xd336('0x72'),_0xd336('0x81'),'CampaignId',_0xd336('0x54'),_0xd336('0x55')],squel['select']()['field'](_0xd336('0x70'),'phone')[_0xd336('0x74')]('id',_0xd336('0x72'))[_0xd336('0x74')](_0x5d2769[_0xd336('0x76')]['toString'](),_0xd336('0x81'))[_0xd336('0x74')](_0xf65e60[_0xd336('0x48')]['id']['toString'](),_0xd336('0x60'))[_0xd336('0x74')]('NOW()',_0xd336('0x54'))['field'](_0xd336('0x75'),_0xd336('0x55'))['from']('cm_contacts')['where'](_0xd336('0x79'))['where']('ListId\x20=\x20?',_0x5d2769['CmListId'][_0xd336('0x77')]())[_0xd336('0x3e')](_0xd336('0x7b')))[_0xd336('0x77')]();_0x10de6e[_0xd336('0x8c')](db['sequelize'][_0xd336('0x34')](_0xc17866));}return BPromise[_0xd336('0x8d')](_0x10de6e);}})[_0xd336('0x27')](function(){return _0x35b35d;})[_0xd336('0x27')](respondWithResult(_0x16cfe6,null))[_0xd336('0x46')](handleError(_0x16cfe6,null));};exports[_0xd336('0x93')]=function(_0x175d57,_0x2664b8,_0x38ea0b){return db[_0xd336('0x2f')][_0xd336('0x4b')]({'where':{'id':_0x175d57['params']['id']}})[_0xd336('0x27')](handleEntityNotFound(_0x2664b8,null))['then'](function(_0x1c8b86){if(_0x1c8b86){return _0x1c8b86[_0xd336('0x93')](_0x175d57['query'][_0xd336('0x69')]);}})[_0xd336('0x27')](function(_0x8b9ae6){if(_0x8b9ae6){return db[_0xd336('0x64')]['destroy']({'where':{'ListId':_0x175d57[_0xd336('0x34')][_0xd336('0x69')],'CampaignId':_0x175d57[_0xd336('0x48')]['id']}})[_0xd336('0x27')](function(){return _0x8b9ae6;});}})[_0xd336('0x27')](respondWithStatusCode(_0x2664b8,null))[_0xd336('0x46')](handleError(_0x2664b8,null));}; \ No newline at end of file +var _0xdb51=['deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','cm_hopper','COALESCE(phone,\x27\x27)','cm_contacts','ListId\x20=\x20?','cmHopperId','OrderBy','h.id','ci.item','cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','YYYY-MM-DD\x20HH:mm:ss','cm_hopper_black','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','Content-Range','apply','reject','destroy','get','UserProfileResource','then','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','VIRTUAL','options','Campaign','count','findAll','rows','catch','show','params','length','includeAll','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','IvrCampaigns','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','createdAt','updatedAt','omit','update','findOne','order','CampaignId','CmHopper','getHopperHistories','CmHopperHistory','CmHopperFinal','getHopperBlacks','CmHopperBlack','CmList','getLists','addLists','format','ids','spread','dialCheckDuplicateType','always','insert','into','fromQuery','phone','ContactId','ListId','select','field','NOW()','scheduledAt','CmListId','toString','from'];(function(_0x826e62,_0x119ae8){var _0x490887=function(_0x581842){while(--_0x581842){_0x826e62['push'](_0x826e62['shift']());}};_0x490887(++_0x119ae8);}(_0xdb51,0x145));var _0x1db5=function(_0x59f96a,_0xce2fad){_0x59f96a=_0x59f96a-0x0;var _0x32b231=_0xdb51[_0x59f96a];return _0x32b231;};'use strict';var emlformat=require(_0x1db5('0x0'));var rimraf=require(_0x1db5('0x1'));var zipdir=require(_0x1db5('0x2'));var jsonpatch=require(_0x1db5('0x3'));var rp=require(_0x1db5('0x4'));var moment=require(_0x1db5('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x1db5('0x6'));var util=require(_0x1db5('0x7'));var path=require(_0x1db5('0x8'));var sox=require(_0x1db5('0x9'));var csv=require(_0x1db5('0xa'));var ejs=require(_0x1db5('0xb'));var fs=require('fs');var fs_extra=require(_0x1db5('0xc'));var _=require(_0x1db5('0xd'));var squel=require(_0x1db5('0xe'));var crypto=require(_0x1db5('0xf'));var jsforce=require(_0x1db5('0x10'));var deskjs=require(_0x1db5('0x11'));var toCsv=require(_0x1db5('0xa'));var querystring=require(_0x1db5('0x12'));var Papa=require('papaparse');var Redis=require(_0x1db5('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x1db5('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1db5('0x15'));var logger=require(_0x1db5('0x16'))(_0x1db5('0x17'));var utils=require(_0x1db5('0x18'));var config=require(_0x1db5('0x19'));var licenseUtil=require(_0x1db5('0x1a'));var db=require(_0x1db5('0x1b'))['db'];function respondWithStatusCode(_0x3a81d6,_0x114a49){_0x114a49=_0x114a49||0xcc;return function(_0x2d2f8c){if(_0x2d2f8c){return _0x3a81d6[_0x1db5('0x1c')](_0x114a49);}return _0x3a81d6[_0x1db5('0x1d')](_0x114a49)[_0x1db5('0x1e')]();};}function respondWithResult(_0x36e3ef,_0x1b4f83){_0x1b4f83=_0x1b4f83||0xc8;return function(_0x49fbbf){if(_0x49fbbf){return _0x36e3ef[_0x1db5('0x1d')](_0x1b4f83)['json'](_0x49fbbf);}};}function respondWithFilteredResult(_0x1a7a17,_0x142880){return function(_0x2a0752){if(_0x2a0752){var _0x279c4f=typeof _0x142880[_0x1db5('0x1f')]===_0x1db5('0x20')&&typeof _0x142880['limit']===_0x1db5('0x20');var _0x23f356=_0x2a0752['count'];var _0x23cff4=_0x279c4f?0x0:_0x142880[_0x1db5('0x1f')];var _0x4045f0=_0x279c4f?_0x2a0752['count']:_0x142880['offset']+_0x142880['limit'];var _0x5c887b;if(_0x4045f0>=_0x23f356){_0x4045f0=_0x23f356;_0x5c887b=0xc8;}else{_0x5c887b=0xce;}_0x1a7a17['status'](_0x5c887b);return _0x1a7a17['set'](_0x1db5('0x21'),_0x23cff4+'-'+_0x4045f0+'/'+_0x23f356)['json'](_0x2a0752);}return null;};}function patchUpdates(_0x29356c){return function(_0x199473){try{jsonpatch[_0x1db5('0x22')](_0x199473,_0x29356c,!![]);}catch(_0x166e96){return BPromise[_0x1db5('0x23')](_0x166e96);}return _0x199473['save']();};}function saveUpdates(_0x2bacfb,_0x37beac){return function(_0x7cb1e4){if(_0x7cb1e4){return _0x7cb1e4['update'](_0x2bacfb)['then'](function(_0x3fae8f){return _0x3fae8f;});}return null;};}function removeEntity(_0x508e93,_0x551990){return function(_0x1339d5){if(_0x1339d5){return _0x1339d5[_0x1db5('0x24')]()['then'](function(){var _0x15c61d=_0x1339d5[_0x1db5('0x25')]({'plain':!![]});var _0x5bed5a='IvrCampaigns';return db[_0x1db5('0x26')][_0x1db5('0x24')]({'where':{'type':_0x5bed5a,'resourceId':_0x15c61d['id']}})[_0x1db5('0x27')](function(){return _0x1339d5;});})[_0x1db5('0x27')](function(){_0x508e93[_0x1db5('0x1d')](0xcc)[_0x1db5('0x1e')]();});}};}function handleEntityNotFound(_0x5ca360,_0x5c7e01){return function(_0x1ddc31){if(!_0x1ddc31){_0x5ca360['sendStatus'](0x194);}return _0x1ddc31;};}function handleError(_0x252f4f,_0xd01ba9){_0xd01ba9=_0xd01ba9||0x1f4;return function(_0x4b5ec4){logger['error'](_0x4b5ec4[_0x1db5('0x28')]);if(_0x4b5ec4['name']){delete _0x4b5ec4[_0x1db5('0x29')];}_0x252f4f[_0x1db5('0x1d')](_0xd01ba9)[_0x1db5('0x2a')](_0x4b5ec4);};}exports[_0x1db5('0x2b')]=function(_0x7b44f7,_0x35e7f9){var _0x41acf5={},_0x233619={},_0x30616c={'count':0x0,'rows':[]};var _0xbd1097=_[_0x1db5('0x2c')](db['Campaign'][_0x1db5('0x2d')],function(_0x4a834e){return{'name':_0x4a834e[_0x1db5('0x2e')],'type':_0x4a834e[_0x1db5('0x2f')][_0x1db5('0x30')]};});_0x233619[_0x1db5('0x31')]=_[_0x1db5('0x2c')](_0xbd1097,_0x1db5('0x29'));_0x233619[_0x1db5('0x32')]=_[_0x1db5('0x33')](_0x7b44f7[_0x1db5('0x32')]);_0x233619[_0x1db5('0x34')]=_['intersection'](_0x233619['model'],_0x233619['query']);_0x41acf5['attributes']=_[_0x1db5('0x35')](_0x233619['model'],qs[_0x1db5('0x36')](_0x7b44f7['query']['fields']));_0x41acf5[_0x1db5('0x37')]=_0x41acf5[_0x1db5('0x37')]['length']?_0x41acf5['attributes']:_0x233619['model'];if(!_0x7b44f7[_0x1db5('0x32')][_0x1db5('0x38')](_0x1db5('0x39'))){_0x41acf5[_0x1db5('0x3a')]=qs[_0x1db5('0x3a')](_0x7b44f7[_0x1db5('0x32')]['limit']);_0x41acf5[_0x1db5('0x1f')]=qs[_0x1db5('0x1f')](_0x7b44f7[_0x1db5('0x32')][_0x1db5('0x1f')]);}_0x41acf5['order']=qs['sort'](_0x7b44f7[_0x1db5('0x32')][_0x1db5('0x3b')]);_0x41acf5[_0x1db5('0x3c')]=qs[_0x1db5('0x34')](_[_0x1db5('0x3d')](_0x7b44f7[_0x1db5('0x32')],_0x233619['filters']),_0xbd1097);if(_0x7b44f7[_0x1db5('0x32')][_0x1db5('0x3e')]){_0x41acf5[_0x1db5('0x3c')]=_[_0x1db5('0x3f')](_0x41acf5['where'],{'$or':_['map'](_0xbd1097,function(_0x15e0dc){if(_0x15e0dc[_0x1db5('0x2f')]!==_0x1db5('0x40')){var _0xb81e91={};_0xb81e91[_0x15e0dc[_0x1db5('0x29')]]={'$like':'%'+_0x7b44f7['query'][_0x1db5('0x3e')]+'%'};return _0xb81e91;}})});}_0x41acf5=_[_0x1db5('0x3f')]({},_0x41acf5,_0x7b44f7[_0x1db5('0x41')]);var _0x2b7148={'where':_0x41acf5[_0x1db5('0x3c')]};return db[_0x1db5('0x42')][_0x1db5('0x43')](_0x2b7148)[_0x1db5('0x27')](function(_0x8a7465){_0x30616c[_0x1db5('0x43')]=_0x8a7465;if(_0x7b44f7[_0x1db5('0x32')]['includeAll']){_0x41acf5['include']=[{'all':!![]}];}return db['Campaign'][_0x1db5('0x44')](_0x41acf5);})['then'](function(_0x43b7e0){_0x30616c[_0x1db5('0x45')]=_0x43b7e0;return _0x30616c;})[_0x1db5('0x27')](respondWithFilteredResult(_0x35e7f9,_0x41acf5))[_0x1db5('0x46')](handleError(_0x35e7f9,null));};exports[_0x1db5('0x47')]=function(_0x59f754,_0xcd94aa){var _0x3536d5={'raw':![],'where':{'id':_0x59f754[_0x1db5('0x48')]['id']}},_0x72f9a8={};_0x72f9a8[_0x1db5('0x31')]=_[_0x1db5('0x33')](db[_0x1db5('0x42')][_0x1db5('0x2d')]);_0x72f9a8[_0x1db5('0x32')]=_[_0x1db5('0x33')](_0x59f754[_0x1db5('0x32')]);_0x72f9a8[_0x1db5('0x34')]=_[_0x1db5('0x35')](_0x72f9a8['model'],_0x72f9a8[_0x1db5('0x32')]);_0x3536d5[_0x1db5('0x37')]=_['intersection'](_0x72f9a8[_0x1db5('0x31')],qs['fields'](_0x59f754[_0x1db5('0x32')][_0x1db5('0x36')]));_0x3536d5[_0x1db5('0x37')]=_0x3536d5['attributes'][_0x1db5('0x49')]?_0x3536d5['attributes']:_0x72f9a8[_0x1db5('0x31')];if(_0x59f754[_0x1db5('0x32')][_0x1db5('0x4a')]){_0x3536d5[_0x1db5('0x4b')]=[{'all':!![]}];}_0x3536d5=_[_0x1db5('0x3f')]({},_0x3536d5,_0x59f754[_0x1db5('0x41')]);return db['Campaign'][_0x1db5('0x4c')](_0x3536d5)[_0x1db5('0x27')](handleEntityNotFound(_0xcd94aa,null))['then'](respondWithResult(_0xcd94aa,null))[_0x1db5('0x46')](handleError(_0xcd94aa,null));};exports[_0x1db5('0x4d')]=function(_0x5d9486,_0x594602){return db[_0x1db5('0x42')]['create'](_0x5d9486[_0x1db5('0x4e')],{})[_0x1db5('0x27')](function(_0x9b5765){var _0x2cb008=_0x5d9486['user']['get']({'plain':!![]});if(!_0x2cb008)throw new Error(_0x1db5('0x4f'));if(_0x2cb008[_0x1db5('0x50')]===_0x1db5('0x51')){var _0xc710cf=_0x9b5765[_0x1db5('0x25')]({'plain':!![]});var _0x2008d7=_0x1db5('0x52');return db[_0x1db5('0x53')]['find']({'where':{'name':_0x2008d7,'userProfileId':_0x2cb008[_0x1db5('0x54')]},'raw':!![]})[_0x1db5('0x27')](function(_0x262941){if(_0x262941&&_0x262941[_0x1db5('0x55')]===0x0){return db[_0x1db5('0x26')][_0x1db5('0x4d')]({'name':_0xc710cf[_0x1db5('0x29')],'resourceId':_0xc710cf['id'],'type':_0x262941['name'],'sectionId':_0x262941['id']},{})[_0x1db5('0x27')](function(){return _0x9b5765;});}else{return _0x9b5765;}})['catch'](function(_0x5658d3){logger[_0x1db5('0x56')](_0x1db5('0x57'),_0x5658d3);throw _0x5658d3;});}return _0x9b5765;})[_0x1db5('0x27')](respondWithResult(_0x594602,0xc9))[_0x1db5('0x46')](handleError(_0x594602,null));};exports['clone']=function(_0x54eb54,_0x11616a){var _0x2b7fc3={'where':{'id':_0x54eb54[_0x1db5('0x48')]['id']}},_0x2ece4b={};_0x2ece4b[_0x1db5('0x31')]=_[_0x1db5('0x33')](db['Campaign']['rawAttributes']);_0x2b7fc3[_0x1db5('0x37')]=_['intersection'](_0x2ece4b[_0x1db5('0x31')],qs[_0x1db5('0x36')](_0x54eb54[_0x1db5('0x32')][_0x1db5('0x36')]));_0x2b7fc3[_0x1db5('0x37')]=_0x2b7fc3[_0x1db5('0x37')][_0x1db5('0x49')]?_0x2b7fc3['attributes']:_0x2ece4b[_0x1db5('0x31')];if(_0x54eb54['query'][_0x1db5('0x4a')]){_0x2b7fc3[_0x1db5('0x4b')]=[{'all':!![]}];}_0x2b7fc3=_['merge']({},_0x2b7fc3,_0x54eb54[_0x1db5('0x41')]);return db[_0x1db5('0x42')]['find'](_0x2b7fc3)[_0x1db5('0x27')](handleEntityNotFound(_0x11616a,null))[_0x1db5('0x27')](function(_0x10242b){if(_0x10242b){var _0x553a84=_0x10242b[_0x1db5('0x25')]({'plain':!![]});_0x553a84=qs['omit'](_0x553a84,['id',_0x1db5('0x58'),_0x1db5('0x59')]);_0x54eb54[_0x1db5('0x4e')]=_[_0x1db5('0x5a')](_0x54eb54[_0x1db5('0x4e')],['id',_0x1db5('0x58'),_0x1db5('0x59')]);return db[_0x1db5('0x42')][_0x1db5('0x4d')](_[_0x1db5('0x3f')](_0x553a84,_0x54eb54[_0x1db5('0x4e')]),{'include':_0x54eb54['query'][_0x1db5('0x4a')]?[{'all':!![]}]:undefined})[_0x1db5('0x27')](function(_0x2af311){var _0x1396ba=_0x54eb54[_0x1db5('0x51')][_0x1db5('0x25')]({'plain':!![]});if(!_0x1396ba)throw new Error(_0x1db5('0x4f'));if(_0x1396ba[_0x1db5('0x50')]==='user'){var _0x121b37=_0x2af311[_0x1db5('0x25')]({'plain':!![]});var _0x52732b='IvrCampaigns';return db[_0x1db5('0x53')][_0x1db5('0x4c')]({'where':{'name':_0x52732b,'userProfileId':_0x1396ba[_0x1db5('0x54')]},'raw':!![]})[_0x1db5('0x27')](function(_0x2e1c63){if(_0x2e1c63&&_0x2e1c63['autoAssociation']===0x0){return db['UserProfileResource'][_0x1db5('0x4d')]({'name':_0x121b37[_0x1db5('0x29')],'resourceId':_0x121b37['id'],'type':_0x2e1c63['name'],'sectionId':_0x2e1c63['id']},{})[_0x1db5('0x27')](function(){return _0x2af311;});}else{return _0x2af311;}})[_0x1db5('0x46')](function(_0x16eafb){logger[_0x1db5('0x56')](_0x1db5('0x57'),_0x16eafb);throw _0x16eafb;});}return _0x2af311;});}})[_0x1db5('0x27')](respondWithResult(_0x11616a,0xc9))[_0x1db5('0x46')](handleError(_0x11616a,null));};exports[_0x1db5('0x5b')]=function(_0x57b3d6,_0xc8d7e){if(_0x57b3d6['body']['id']){delete _0x57b3d6[_0x1db5('0x4e')]['id'];}return db['Campaign'][_0x1db5('0x4c')]({'where':{'id':_0x57b3d6[_0x1db5('0x48')]['id']}})[_0x1db5('0x27')](handleEntityNotFound(_0xc8d7e,null))[_0x1db5('0x27')](saveUpdates(_0x57b3d6[_0x1db5('0x4e')],null))['then'](respondWithResult(_0xc8d7e,null))[_0x1db5('0x46')](handleError(_0xc8d7e,null));};exports[_0x1db5('0x24')]=function(_0x1d5e14,_0xd57508){return db[_0x1db5('0x42')][_0x1db5('0x4c')]({'where':{'id':_0x1d5e14[_0x1db5('0x48')]['id']}})[_0x1db5('0x27')](handleEntityNotFound(_0xd57508,null))[_0x1db5('0x27')](removeEntity(_0xd57508,null))[_0x1db5('0x46')](handleError(_0xd57508,null));};exports['getHoppers']=function(_0x463208,_0x2c392f,_0x2995f8){var _0x392111={'raw':!![],'where':{}};var _0x5111e4={};var _0x4751a1={'count':0x0,'rows':[]};return db[_0x1db5('0x42')][_0x1db5('0x5c')]({'where':{'id':_0x463208[_0x1db5('0x48')]['id']}})[_0x1db5('0x27')](handleEntityNotFound(_0x2c392f,null))[_0x1db5('0x27')](function(_0x36489a){if(_0x36489a){_0x5111e4['model']=_['keys'](db['CmHopper'][_0x1db5('0x2d')]);_0x5111e4['query']=_[_0x1db5('0x33')](_0x463208[_0x1db5('0x32')]);_0x5111e4[_0x1db5('0x34')]=_[_0x1db5('0x35')](_0x5111e4['model'],_0x5111e4[_0x1db5('0x32')]);_0x392111[_0x1db5('0x37')]=_['intersection'](_0x5111e4[_0x1db5('0x31')],qs[_0x1db5('0x36')](_0x463208[_0x1db5('0x32')][_0x1db5('0x36')]));_0x392111[_0x1db5('0x37')]=_0x392111[_0x1db5('0x37')][_0x1db5('0x49')]?_0x392111[_0x1db5('0x37')]:_0x5111e4[_0x1db5('0x31')];if(!_0x463208[_0x1db5('0x32')]['hasOwnProperty'](_0x1db5('0x39'))){_0x392111['limit']=qs[_0x1db5('0x3a')](_0x463208[_0x1db5('0x32')][_0x1db5('0x3a')]);_0x392111[_0x1db5('0x1f')]=qs[_0x1db5('0x1f')](_0x463208[_0x1db5('0x32')][_0x1db5('0x1f')]);}_0x392111[_0x1db5('0x5d')]=qs[_0x1db5('0x3b')](_0x463208[_0x1db5('0x32')][_0x1db5('0x3b')]);_0x392111[_0x1db5('0x3c')]=qs[_0x1db5('0x34')](_['pick'](_0x463208[_0x1db5('0x32')],_0x5111e4['filters']));_0x392111[_0x1db5('0x3c')][_0x1db5('0x5e')]=_0x36489a['id'];if(_0x463208['query'][_0x1db5('0x3e')]){_0x392111['where']=_[_0x1db5('0x3f')](_0x392111[_0x1db5('0x3c')],{'$or':_[_0x1db5('0x2c')](_0x392111['attributes'],function(_0x11ceea){var _0x1b1fb7={};_0x1b1fb7[_0x11ceea]={'$like':'%'+_0x463208[_0x1db5('0x32')][_0x1db5('0x3e')]+'%'};return _0x1b1fb7;})});}_0x392111=_[_0x1db5('0x3f')]({},_0x392111,_0x463208[_0x1db5('0x41')]);return db['CmHopper'][_0x1db5('0x43')]({'where':_0x392111[_0x1db5('0x3c')]})[_0x1db5('0x27')](function(_0x4c84cf){_0x4751a1[_0x1db5('0x43')]=_0x4c84cf;if(_0x463208[_0x1db5('0x32')][_0x1db5('0x4a')]){_0x392111[_0x1db5('0x4b')]=[{'all':!![]}];}return db[_0x1db5('0x5f')][_0x1db5('0x44')](_0x392111);})[_0x1db5('0x27')](function(_0x4836a3){_0x4751a1[_0x1db5('0x45')]=_0x4836a3;return _0x4751a1;});}})[_0x1db5('0x27')](respondWithFilteredResult(_0x2c392f,_0x392111))['catch'](handleError(_0x2c392f,null));};exports[_0x1db5('0x60')]=function(_0x19b637,_0x4bd51a,_0x1cf41d){var _0x436155={'raw':!![],'where':{}};var _0x1c3a57={};var _0x487354={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x19b637[_0x1db5('0x48')]['id']}})[_0x1db5('0x27')](handleEntityNotFound(_0x4bd51a,null))[_0x1db5('0x27')](function(_0x30e524){if(_0x30e524){_0x1c3a57[_0x1db5('0x31')]=_[_0x1db5('0x33')](db['CmHopperHistory'][_0x1db5('0x2d')]);_0x1c3a57[_0x1db5('0x32')]=_['keys'](_0x19b637[_0x1db5('0x32')]);_0x1c3a57[_0x1db5('0x34')]=_[_0x1db5('0x35')](_0x1c3a57[_0x1db5('0x31')],_0x1c3a57[_0x1db5('0x32')]);_0x436155[_0x1db5('0x37')]=_['intersection'](_0x1c3a57[_0x1db5('0x31')],qs[_0x1db5('0x36')](_0x19b637[_0x1db5('0x32')][_0x1db5('0x36')]));_0x436155[_0x1db5('0x37')]=_0x436155['attributes'][_0x1db5('0x49')]?_0x436155['attributes']:_0x1c3a57[_0x1db5('0x31')];if(!_0x19b637[_0x1db5('0x32')][_0x1db5('0x38')]('nolimit')){_0x436155[_0x1db5('0x3a')]=qs['limit'](_0x19b637[_0x1db5('0x32')][_0x1db5('0x3a')]);_0x436155[_0x1db5('0x1f')]=qs['offset'](_0x19b637[_0x1db5('0x32')][_0x1db5('0x1f')]);}_0x436155[_0x1db5('0x5d')]=qs['sort'](_0x19b637[_0x1db5('0x32')][_0x1db5('0x3b')]);_0x436155[_0x1db5('0x3c')]=qs[_0x1db5('0x34')](_[_0x1db5('0x3d')](_0x19b637[_0x1db5('0x32')],_0x1c3a57['filters']));_0x436155['where'][_0x1db5('0x5e')]=_0x30e524['id'];if(_0x19b637['query'][_0x1db5('0x3e')]){_0x436155[_0x1db5('0x3c')]=_['merge'](_0x436155['where'],{'$or':_[_0x1db5('0x2c')](_0x436155[_0x1db5('0x37')],function(_0x32973a){var _0x49b2b5={};_0x49b2b5[_0x32973a]={'$like':'%'+_0x19b637[_0x1db5('0x32')][_0x1db5('0x3e')]+'%'};return _0x49b2b5;})});}_0x436155=_[_0x1db5('0x3f')]({},_0x436155,_0x19b637[_0x1db5('0x41')]);return db[_0x1db5('0x61')]['count']({'where':_0x436155[_0x1db5('0x3c')]})[_0x1db5('0x27')](function(_0x33bbff){_0x487354[_0x1db5('0x43')]=_0x33bbff;if(_0x19b637[_0x1db5('0x32')][_0x1db5('0x4a')]){_0x436155['include']=[{'all':!![]}];}return db[_0x1db5('0x61')][_0x1db5('0x44')](_0x436155);})[_0x1db5('0x27')](function(_0x41435f){_0x487354['rows']=_0x41435f;return _0x487354;});}})[_0x1db5('0x27')](respondWithFilteredResult(_0x4bd51a,_0x436155))[_0x1db5('0x46')](handleError(_0x4bd51a,null));};exports['getHopperFinals']=function(_0x291fdb,_0x58afcc,_0x1566d5){var _0x551a0d={'raw':!![],'where':{}};var _0x34a918={};var _0x24fc15={'count':0x0,'rows':[]};return db[_0x1db5('0x42')][_0x1db5('0x5c')]({'where':{'id':_0x291fdb[_0x1db5('0x48')]['id']}})[_0x1db5('0x27')](handleEntityNotFound(_0x58afcc,null))['then'](function(_0x195608){if(_0x195608){_0x34a918[_0x1db5('0x31')]=_[_0x1db5('0x33')](db[_0x1db5('0x62')][_0x1db5('0x2d')]);_0x34a918[_0x1db5('0x32')]=_[_0x1db5('0x33')](_0x291fdb[_0x1db5('0x32')]);_0x34a918[_0x1db5('0x34')]=_['intersection'](_0x34a918['model'],_0x34a918['query']);_0x551a0d[_0x1db5('0x37')]=_['intersection'](_0x34a918[_0x1db5('0x31')],qs[_0x1db5('0x36')](_0x291fdb[_0x1db5('0x32')]['fields']));_0x551a0d[_0x1db5('0x37')]=_0x551a0d[_0x1db5('0x37')][_0x1db5('0x49')]?_0x551a0d[_0x1db5('0x37')]:_0x34a918[_0x1db5('0x31')];if(!_0x291fdb[_0x1db5('0x32')]['hasOwnProperty'](_0x1db5('0x39'))){_0x551a0d['limit']=qs['limit'](_0x291fdb[_0x1db5('0x32')][_0x1db5('0x3a')]);_0x551a0d[_0x1db5('0x1f')]=qs[_0x1db5('0x1f')](_0x291fdb[_0x1db5('0x32')]['offset']);}_0x551a0d[_0x1db5('0x5d')]=qs['sort'](_0x291fdb[_0x1db5('0x32')][_0x1db5('0x3b')]);_0x551a0d[_0x1db5('0x3c')]=qs['filters'](_['pick'](_0x291fdb[_0x1db5('0x32')],_0x34a918[_0x1db5('0x34')]));_0x551a0d[_0x1db5('0x3c')][_0x1db5('0x5e')]=_0x195608['id'];if(_0x291fdb[_0x1db5('0x32')][_0x1db5('0x3e')]){_0x551a0d[_0x1db5('0x3c')]=_[_0x1db5('0x3f')](_0x551a0d['where'],{'$or':_[_0x1db5('0x2c')](_0x551a0d[_0x1db5('0x37')],function(_0x4b745b){var _0x458095={};_0x458095[_0x4b745b]={'$like':'%'+_0x291fdb[_0x1db5('0x32')][_0x1db5('0x3e')]+'%'};return _0x458095;})});}_0x551a0d=_[_0x1db5('0x3f')]({},_0x551a0d,_0x291fdb[_0x1db5('0x41')]);return db[_0x1db5('0x62')]['count']({'where':_0x551a0d[_0x1db5('0x3c')]})[_0x1db5('0x27')](function(_0x4d9fee){_0x24fc15[_0x1db5('0x43')]=_0x4d9fee;if(_0x291fdb[_0x1db5('0x32')][_0x1db5('0x4a')]){_0x551a0d[_0x1db5('0x4b')]=[{'all':!![]}];}return db[_0x1db5('0x62')][_0x1db5('0x44')](_0x551a0d);})[_0x1db5('0x27')](function(_0x2200a8){_0x24fc15['rows']=_0x2200a8;return _0x24fc15;});}})['then'](respondWithFilteredResult(_0x58afcc,_0x551a0d))[_0x1db5('0x46')](handleError(_0x58afcc,null));};exports[_0x1db5('0x63')]=function(_0x173491,_0x1e5acf,_0x23fcfa){var _0x1de069={'raw':!![],'where':{}};var _0x106cb3={};var _0x1a38b4={'count':0x0,'rows':[]};return db[_0x1db5('0x42')]['findOne']({'where':{'id':_0x173491[_0x1db5('0x48')]['id']}})['then'](handleEntityNotFound(_0x1e5acf,null))[_0x1db5('0x27')](function(_0x5302e5){if(_0x5302e5){_0x106cb3['model']=_[_0x1db5('0x33')](db[_0x1db5('0x64')][_0x1db5('0x2d')]);_0x106cb3[_0x1db5('0x32')]=_[_0x1db5('0x33')](_0x173491['query']);_0x106cb3['filters']=_['intersection'](_0x106cb3[_0x1db5('0x31')],_0x106cb3[_0x1db5('0x32')]);_0x1de069[_0x1db5('0x37')]=_[_0x1db5('0x35')](_0x106cb3[_0x1db5('0x31')],qs[_0x1db5('0x36')](_0x173491[_0x1db5('0x32')][_0x1db5('0x36')]));_0x1de069['attributes']=_0x1de069[_0x1db5('0x37')]['length']?_0x1de069[_0x1db5('0x37')]:_0x106cb3[_0x1db5('0x31')];if(!_0x173491[_0x1db5('0x32')][_0x1db5('0x38')]('nolimit')){_0x1de069[_0x1db5('0x3a')]=qs[_0x1db5('0x3a')](_0x173491[_0x1db5('0x32')]['limit']);_0x1de069[_0x1db5('0x1f')]=qs[_0x1db5('0x1f')](_0x173491['query'][_0x1db5('0x1f')]);}_0x1de069[_0x1db5('0x5d')]=qs['sort'](_0x173491[_0x1db5('0x32')][_0x1db5('0x3b')]);_0x1de069[_0x1db5('0x3c')]=qs['filters'](_['pick'](_0x173491['query'],_0x106cb3[_0x1db5('0x34')]));_0x1de069[_0x1db5('0x3c')]['CampaignId']=_0x5302e5['id'];if(_0x173491[_0x1db5('0x32')][_0x1db5('0x3e')]){_0x1de069['where']=_[_0x1db5('0x3f')](_0x1de069[_0x1db5('0x3c')],{'$or':_['map'](_0x1de069[_0x1db5('0x37')],function(_0x3ce271){var _0x36d4bb={};_0x36d4bb[_0x3ce271]={'$like':'%'+_0x173491[_0x1db5('0x32')][_0x1db5('0x3e')]+'%'};return _0x36d4bb;})});}_0x1de069=_[_0x1db5('0x3f')]({},_0x1de069,_0x173491['options']);return db[_0x1db5('0x64')][_0x1db5('0x43')]({'where':_0x1de069['where']})[_0x1db5('0x27')](function(_0x5ddbe3){_0x1a38b4[_0x1db5('0x43')]=_0x5ddbe3;if(_0x173491[_0x1db5('0x32')][_0x1db5('0x4a')]){_0x1de069[_0x1db5('0x4b')]=[{'all':!![]}];}return db[_0x1db5('0x64')]['findAll'](_0x1de069);})[_0x1db5('0x27')](function(_0x44cd75){_0x1a38b4[_0x1db5('0x45')]=_0x44cd75;return _0x1a38b4;});}})[_0x1db5('0x27')](respondWithFilteredResult(_0x1e5acf,_0x1de069))[_0x1db5('0x46')](handleError(_0x1e5acf,null));};exports['getLists']=function(_0x3fd4ea,_0x8f4714,_0x1f99f5){var _0x4868f3={};var _0x123202={};var _0xe1c95d;var _0x22b0f6;return db[_0x1db5('0x42')]['findOne']({'where':{'id':_0x3fd4ea[_0x1db5('0x48')]['id']}})[_0x1db5('0x27')](handleEntityNotFound(_0x8f4714,null))['then'](function(_0xea8259){if(_0xea8259){_0xe1c95d=_0xea8259;_0x123202[_0x1db5('0x31')]=_['keys'](db[_0x1db5('0x65')][_0x1db5('0x2d')]);_0x123202['query']=_['keys'](_0x3fd4ea[_0x1db5('0x32')]);_0x123202['filters']=_[_0x1db5('0x35')](_0x123202[_0x1db5('0x31')],_0x123202[_0x1db5('0x32')]);_0x4868f3[_0x1db5('0x37')]=_[_0x1db5('0x35')](_0x123202[_0x1db5('0x31')],qs[_0x1db5('0x36')](_0x3fd4ea['query'][_0x1db5('0x36')]));_0x4868f3[_0x1db5('0x37')]=_0x4868f3[_0x1db5('0x37')][_0x1db5('0x49')]?_0x4868f3[_0x1db5('0x37')]:_0x123202[_0x1db5('0x31')];_0x4868f3['order']=qs['sort'](_0x3fd4ea[_0x1db5('0x32')][_0x1db5('0x3b')]);_0x4868f3[_0x1db5('0x3c')]=qs[_0x1db5('0x34')](_[_0x1db5('0x3d')](_0x3fd4ea[_0x1db5('0x32')],_0x123202[_0x1db5('0x34')]));if(_0x3fd4ea[_0x1db5('0x32')]['filter']){_0x4868f3[_0x1db5('0x3c')]=_[_0x1db5('0x3f')](_0x4868f3[_0x1db5('0x3c')],{'$or':_['map'](_0x4868f3[_0x1db5('0x37')],function(_0x22e4e2){var _0x586f28={};_0x586f28[_0x22e4e2]={'$like':'%'+_0x3fd4ea[_0x1db5('0x32')]['filter']+'%'};return _0x586f28;})});}_0x4868f3=_[_0x1db5('0x3f')]({},_0x4868f3,_0x3fd4ea[_0x1db5('0x41')]);return _0xe1c95d['getLists'](_0x4868f3);}})['then'](function(_0x5678e3){if(_0x5678e3){_0x22b0f6=_0x5678e3[_0x1db5('0x49')];if(!_0x3fd4ea['query'][_0x1db5('0x38')](_0x1db5('0x39'))){_0x4868f3['limit']=qs[_0x1db5('0x3a')](_0x3fd4ea[_0x1db5('0x32')][_0x1db5('0x3a')]);_0x4868f3[_0x1db5('0x1f')]=qs['offset'](_0x3fd4ea[_0x1db5('0x32')][_0x1db5('0x1f')]);}return _0xe1c95d[_0x1db5('0x66')](_0x4868f3);}})[_0x1db5('0x27')](function(_0x5d693e){if(_0x5d693e){return _0x5d693e?{'count':_0x22b0f6,'rows':_0x5d693e}:null;}})[_0x1db5('0x27')](respondWithResult(_0x8f4714,null))['catch'](handleError(_0x8f4714,null));};exports[_0x1db5('0x67')]=function(_0x37bdb0,_0x233db3,_0x55bccd){var _0x1b030b,_0x87a925;var _0x3bc9d2=[];var _0x5e224d=moment()[_0x1db5('0x68')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0x1db5('0x42')][_0x1db5('0x4c')]({'where':{'id':_0x37bdb0[_0x1db5('0x48')]['id']}})[_0x1db5('0x27')](handleEntityNotFound(_0x233db3,null))[_0x1db5('0x27')](function(_0x53e29){if(_0x53e29){_0x87a925=_0x53e29;return _0x53e29[_0x1db5('0x67')](_0x37bdb0[_0x1db5('0x4e')][_0x1db5('0x69')],_[_0x1db5('0x5a')](_0x37bdb0[_0x1db5('0x4e')],[_0x1db5('0x69'),'id'])||{});}return null;})[_0x1db5('0x6a')](function(_0x190286){var _0x3ca097;var _0x27c6bd;_0x1b030b=_0x190286||[];var _0x2d78a4=[];if(_0x190286){for(var _0x560532=0x0;_0x560532<_0x190286[_0x1db5('0x49')];_0x560532+=0x1){var _0x19e138=_0x190286[_0x560532]['get']({'plain':!![]});_0x87a925[_0x1db5('0x6b')]=_0x37bdb0[_0x1db5('0x4e')][_0x1db5('0x6b')]?_0x37bdb0['body'][_0x1db5('0x6b')]:_0x87a925[_0x1db5('0x6b')];switch(_0x87a925[_0x1db5('0x6b')]){case _0x1db5('0x6c'):_0x3ca097=squel[_0x1db5('0x6d')]()[_0x1db5('0x6e')]('cm_hopper')[_0x1db5('0x6f')]([_0x1db5('0x70'),'scheduledAt',_0x1db5('0x71'),_0x1db5('0x72'),_0x1db5('0x5e'),_0x1db5('0x58'),_0x1db5('0x59')],squel[_0x1db5('0x73')]()[_0x1db5('0x74')](_0x1db5('0x70'),_0x1db5('0x70'))[_0x1db5('0x74')](_0x1db5('0x75'),_0x1db5('0x76'))[_0x1db5('0x74')]('id',_0x1db5('0x71'))[_0x1db5('0x74')](_0x19e138[_0x1db5('0x77')][_0x1db5('0x78')](),_0x1db5('0x72'))[_0x1db5('0x74')](_0x37bdb0[_0x1db5('0x48')]['id'][_0x1db5('0x78')](),'CampaignId')[_0x1db5('0x74')]('\x27'+_0x5e224d+'\x27',_0x1db5('0x58'))['field']('\x27'+_0x5e224d+'\x27',_0x1db5('0x59'))[_0x1db5('0x79')]('cm_contacts')[_0x1db5('0x3c')](_0x1db5('0x7a'))[_0x1db5('0x3c')]('ListId\x20=\x20?',_0x19e138['CmListId'][_0x1db5('0x78')]())[_0x1db5('0x3c')](_0x1db5('0x7b'))['where'](_0x1db5('0x7c'),squel[_0x1db5('0x73')]()[_0x1db5('0x74')](_0x1db5('0x7d'))[_0x1db5('0x79')](_0x1db5('0x7e'))[_0x1db5('0x3c')](_0x1db5('0x7f'),_0x37bdb0[_0x1db5('0x48')]['id'][_0x1db5('0x78')]()))['where'](_0x1db5('0x7c'),squel[_0x1db5('0x73')]()[_0x1db5('0x74')]('COALESCE(phone,\x27\x27)')['from'](_0x1db5('0x80'))[_0x1db5('0x3c')](_0x1db5('0x7f'),_0x37bdb0[_0x1db5('0x48')]['id'][_0x1db5('0x78')]())))[_0x1db5('0x78')]();break;case'onlyIfOpen':_0x3ca097=squel[_0x1db5('0x6d')]()[_0x1db5('0x6e')](_0x1db5('0x80'))[_0x1db5('0x6f')]([_0x1db5('0x70'),'scheduledAt',_0x1db5('0x71'),_0x1db5('0x72'),_0x1db5('0x5e'),_0x1db5('0x58'),'updatedAt'],squel[_0x1db5('0x73')]()[_0x1db5('0x74')]('phone',_0x1db5('0x70'))[_0x1db5('0x74')](_0x1db5('0x75'),_0x1db5('0x76'))[_0x1db5('0x74')]('id',_0x1db5('0x71'))[_0x1db5('0x74')](_0x19e138[_0x1db5('0x77')][_0x1db5('0x78')](),_0x1db5('0x72'))[_0x1db5('0x74')](_0x37bdb0[_0x1db5('0x48')]['id'][_0x1db5('0x78')](),'CampaignId')['field']('\x27'+_0x5e224d+'\x27',_0x1db5('0x58'))[_0x1db5('0x74')]('\x27'+_0x5e224d+'\x27',_0x1db5('0x59'))[_0x1db5('0x79')]('cm_contacts')[_0x1db5('0x3c')](_0x1db5('0x7a'))[_0x1db5('0x3c')]('ListId\x20=\x20?',_0x19e138[_0x1db5('0x77')][_0x1db5('0x78')]())[_0x1db5('0x3c')]('phone\x20IS\x20NOT\x20NULL')[_0x1db5('0x3c')](_0x1db5('0x7c'),squel[_0x1db5('0x73')]()[_0x1db5('0x74')](_0x1db5('0x81'))[_0x1db5('0x79')]('cm_hopper')[_0x1db5('0x3c')](_0x1db5('0x7f'),_0x37bdb0[_0x1db5('0x48')]['id'][_0x1db5('0x78')]())))[_0x1db5('0x78')]();break;default:_0x3ca097=squel['insert']()[_0x1db5('0x6e')](_0x1db5('0x80'))[_0x1db5('0x6f')]([_0x1db5('0x70'),_0x1db5('0x76'),_0x1db5('0x71'),'ListId',_0x1db5('0x5e'),'createdAt',_0x1db5('0x59')],squel[_0x1db5('0x73')]()[_0x1db5('0x74')]('phone',_0x1db5('0x70'))[_0x1db5('0x74')]('NOW()',_0x1db5('0x76'))[_0x1db5('0x74')]('id',_0x1db5('0x71'))[_0x1db5('0x74')](_0x19e138[_0x1db5('0x77')]['toString'](),'ListId')[_0x1db5('0x74')](_0x37bdb0['params']['id'][_0x1db5('0x78')](),_0x1db5('0x5e'))[_0x1db5('0x74')]('\x27'+_0x5e224d+'\x27','createdAt')[_0x1db5('0x74')]('\x27'+_0x5e224d+'\x27',_0x1db5('0x59'))[_0x1db5('0x79')](_0x1db5('0x82'))[_0x1db5('0x3c')](_0x1db5('0x7a'))[_0x1db5('0x3c')](_0x1db5('0x83'),_0x19e138[_0x1db5('0x77')][_0x1db5('0x78')]())['where']('phone\x20IS\x20NOT\x20NULL'))[_0x1db5('0x78')]();}_0x27c6bd=squel[_0x1db5('0x6d')]()[_0x1db5('0x6e')]('cm_hopper_additional_phones')[_0x1db5('0x6f')]([_0x1db5('0x84'),_0x1db5('0x76'),'phone',_0x1db5('0x85'),_0x1db5('0x58'),_0x1db5('0x59')],squel[_0x1db5('0x73')]()[_0x1db5('0x74')](_0x1db5('0x86'),'id')['field'](_0x1db5('0x75'),'scheduledAt')[_0x1db5('0x74')](_0x1db5('0x87'),_0x1db5('0x70'))[_0x1db5('0x74')]('ci.OrderBY',_0x1db5('0x85'))[_0x1db5('0x74')]('\x27'+_0x5e224d+'\x27',_0x1db5('0x58'))[_0x1db5('0x74')]('\x27'+_0x5e224d+'\x27',_0x1db5('0x59'))[_0x1db5('0x79')](_0x1db5('0x88'),'ci')[_0x1db5('0x89')](_0x1db5('0x80'),'h',_0x1db5('0x8a'))[_0x1db5('0x3c')](_0x1db5('0x8b'),_0x19e138[_0x1db5('0x77')][_0x1db5('0x78')]())['where'](_0x1db5('0x8c'),_0x37bdb0[_0x1db5('0x48')]['id'][_0x1db5('0x78')]())[_0x1db5('0x3c')]('h.createdAt\x20=\x20?',_0x5e224d))[_0x1db5('0x78')]();_0x2d78a4[_0x1db5('0x8d')](db[_0x1db5('0x8e')][_0x1db5('0x32')](_0x3ca097));_0x3bc9d2[_0x1db5('0x8d')](db['sequelize'][_0x1db5('0x32')](_0x27c6bd));}return BPromise[_0x1db5('0x8f')](_0x2d78a4);}})[_0x1db5('0x27')](function(){return BPromise[_0x1db5('0x8f')](_0x3bc9d2);})[_0x1db5('0x27')](function(){return _0x1b030b;})[_0x1db5('0x27')](respondWithResult(_0x233db3,null))[_0x1db5('0x46')](handleError(_0x233db3,null));};exports[_0x1db5('0x90')]=function(_0x2521b0,_0x2fc645,_0x4e96b8){return db[_0x1db5('0x42')][_0x1db5('0x4c')]({'where':{'id':_0x2521b0[_0x1db5('0x48')]['id']}})[_0x1db5('0x27')](handleEntityNotFound(_0x2fc645,null))['then'](function(_0x4afe7a){if(_0x4afe7a){return _0x4afe7a[_0x1db5('0x90')](_0x2521b0[_0x1db5('0x32')][_0x1db5('0x69')]);}})['then'](function(_0x407ec6){if(_0x407ec6){return db[_0x1db5('0x5f')][_0x1db5('0x24')]({'where':{'ListId':_0x2521b0[_0x1db5('0x32')][_0x1db5('0x69')],'CampaignId':_0x2521b0[_0x1db5('0x48')]['id']}})[_0x1db5('0x27')](function(){return _0x407ec6;});}})['then'](respondWithStatusCode(_0x2fc645,null))[_0x1db5('0x46')](handleError(_0x2fc645,null));};exports[_0x1db5('0x91')]=function(_0x5136d4,_0x518fdc,_0x5d134e){var _0x132ed1={};var _0x104256={};var _0x3845a6;var _0x297abc;return db[_0x1db5('0x42')][_0x1db5('0x5c')]({'where':{'id':_0x5136d4[_0x1db5('0x48')]['id']}})['then'](handleEntityNotFound(_0x518fdc,null))[_0x1db5('0x27')](function(_0x3d9f61){if(_0x3d9f61){_0x3845a6=_0x3d9f61;_0x104256['model']=_[_0x1db5('0x33')](db[_0x1db5('0x65')][_0x1db5('0x2d')]);_0x104256[_0x1db5('0x32')]=_[_0x1db5('0x33')](_0x5136d4['query']);_0x104256[_0x1db5('0x34')]=_[_0x1db5('0x35')](_0x104256['model'],_0x104256[_0x1db5('0x32')]);_0x132ed1['attributes']=_['intersection'](_0x104256[_0x1db5('0x31')],qs[_0x1db5('0x36')](_0x5136d4['query']['fields']));_0x132ed1[_0x1db5('0x37')]=_0x132ed1[_0x1db5('0x37')]['length']?_0x132ed1[_0x1db5('0x37')]:_0x104256[_0x1db5('0x31')];_0x132ed1[_0x1db5('0x5d')]=qs['sort'](_0x5136d4['query'][_0x1db5('0x3b')]);_0x132ed1[_0x1db5('0x3c')]=qs[_0x1db5('0x34')](_[_0x1db5('0x3d')](_0x5136d4[_0x1db5('0x32')],_0x104256['filters']));if(_0x5136d4[_0x1db5('0x32')][_0x1db5('0x3e')]){_0x132ed1[_0x1db5('0x3c')]=_[_0x1db5('0x3f')](_0x132ed1[_0x1db5('0x3c')],{'$or':_[_0x1db5('0x2c')](_0x132ed1[_0x1db5('0x37')],function(_0x39a629){var _0x280af9={};_0x280af9[_0x39a629]={'$like':'%'+_0x5136d4[_0x1db5('0x32')]['filter']+'%'};return _0x280af9;})});}_0x132ed1=_[_0x1db5('0x3f')]({},_0x132ed1,_0x5136d4[_0x1db5('0x41')]);return _0x3845a6[_0x1db5('0x91')](_0x132ed1);}})[_0x1db5('0x27')](function(_0x2fd5b8){if(_0x2fd5b8){_0x297abc=_0x2fd5b8[_0x1db5('0x49')];if(!_0x5136d4[_0x1db5('0x32')][_0x1db5('0x38')](_0x1db5('0x39'))){_0x132ed1[_0x1db5('0x3a')]=qs['limit'](_0x5136d4[_0x1db5('0x32')][_0x1db5('0x3a')]);_0x132ed1[_0x1db5('0x1f')]=qs[_0x1db5('0x1f')](_0x5136d4['query'][_0x1db5('0x1f')]);}return _0x3845a6[_0x1db5('0x91')](_0x132ed1);}})[_0x1db5('0x27')](function(_0x1e9a39){if(_0x1e9a39){return _0x1e9a39?{'count':_0x297abc,'rows':_0x1e9a39}:null;}})[_0x1db5('0x27')](respondWithResult(_0x518fdc,null))[_0x1db5('0x46')](handleError(_0x518fdc,null));};exports[_0x1db5('0x92')]=function(_0x209096,_0x3f4833,_0x252c17){var _0x5b45fa,_0x3c9cb1;var _0x260a59=[];var _0x29b3f5=moment()[_0x1db5('0x68')](_0x1db5('0x93'));return db[_0x1db5('0x42')][_0x1db5('0x4c')]({'where':{'id':_0x209096[_0x1db5('0x48')]['id']}})[_0x1db5('0x27')](handleEntityNotFound(_0x3f4833,null))[_0x1db5('0x27')](function(_0x46e35a){if(_0x46e35a){_0x3c9cb1=_0x46e35a;return _0x46e35a['addBlackLists'](_0x209096[_0x1db5('0x4e')][_0x1db5('0x69')],_['omit'](_0x209096[_0x1db5('0x4e')],[_0x1db5('0x69'),'id'])||{});}return null;})[_0x1db5('0x6a')](function(_0x246206){var _0x5e17a0;var _0x58dde2;_0x5b45fa=_0x246206||[];var _0x54634d=[];if(_0x246206){for(var _0x3a15f1=0x0;_0x3a15f1<_0x246206[_0x1db5('0x49')];_0x3a15f1+=0x1){var _0x19cce9=_0x246206[_0x3a15f1][_0x1db5('0x25')]({'plain':!![]});_0x5e17a0=squel[_0x1db5('0x6d')]()[_0x1db5('0x6e')](_0x1db5('0x94'))[_0x1db5('0x6f')]([_0x1db5('0x70'),'ContactId',_0x1db5('0x72'),_0x1db5('0x5e'),_0x1db5('0x58'),_0x1db5('0x59')],squel[_0x1db5('0x73')]()['field'](_0x1db5('0x70'),_0x1db5('0x70'))[_0x1db5('0x74')]('id','ContactId')[_0x1db5('0x74')](_0x19cce9[_0x1db5('0x77')][_0x1db5('0x78')](),_0x1db5('0x72'))[_0x1db5('0x74')](_0x209096['params']['id']['toString'](),_0x1db5('0x5e'))[_0x1db5('0x74')](_0x1db5('0x75'),_0x1db5('0x58'))[_0x1db5('0x74')](_0x1db5('0x75'),_0x1db5('0x59'))[_0x1db5('0x79')]('cm_contacts')[_0x1db5('0x3c')]('deletedAt\x20IS\x20NULL')[_0x1db5('0x3c')](_0x1db5('0x83'),_0x19cce9[_0x1db5('0x77')][_0x1db5('0x78')]())[_0x1db5('0x3c')](_0x1db5('0x7b')))[_0x1db5('0x78')]();_0x54634d['push'](db['sequelize']['query'](_0x5e17a0));}return BPromise[_0x1db5('0x8f')](_0x54634d);}})['then'](function(){return _0x5b45fa;})['then'](respondWithResult(_0x3f4833,null))[_0x1db5('0x46')](handleError(_0x3f4833,null));};exports['removeBlackLists']=function(_0x5d8a52,_0x1d49ae,_0x2c6e1c){return db['Campaign'][_0x1db5('0x4c')]({'where':{'id':_0x5d8a52[_0x1db5('0x48')]['id']}})[_0x1db5('0x27')](handleEntityNotFound(_0x1d49ae,null))[_0x1db5('0x27')](function(_0x5d8977){if(_0x5d8977){return _0x5d8977['removeBlackLists'](_0x5d8a52[_0x1db5('0x32')][_0x1db5('0x69')]);}})[_0x1db5('0x27')](function(_0x4264e7){if(_0x4264e7){return db[_0x1db5('0x64')]['destroy']({'where':{'ListId':_0x5d8a52[_0x1db5('0x32')][_0x1db5('0x69')],'CampaignId':_0x5d8a52['params']['id']}})['then'](function(){return _0x4264e7;});}})['then'](respondWithStatusCode(_0x1d49ae,null))[_0x1db5('0x46')](handleError(_0x1d49ae,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 9a6774d..d808de3 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(_0x1589dd,_0x2b9d22){var _0x1bddd1=function(_0x3687f8){while(--_0x3687f8){_0x1589dd['push'](_0x1589dd['shift']());}};_0x1bddd1(++_0x2b9d22);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var 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(_0x332e43,_0x252844){var _0x13bee3=function(_0x28c39a){while(--_0x28c39a){_0x332e43['push'](_0x332e43['shift']());}};_0x13bee3(++_0x252844);}(_0x7a54,0x106));var _0x47a5=function(_0x533a99,_0x6c29c4){_0x533a99=_0x533a99-0x0;var _0x29eb5c=_0x7a54[_0x533a99];return _0x29eb5c;};'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 77a407f..c6691ec 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 _0x1789=['debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetCampaign','Campaign','options','where','attributes','limit','include','model','map','then','info','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','Campaign,\x20%s,\x20%s','request\x20sent'];(function(_0x5ed1c5,_0x266bf1){var _0x2ea2fc=function(_0x3e7976){while(--_0x3e7976){_0x5ed1c5['push'](_0x5ed1c5['shift']());}};_0x2ea2fc(++_0x266bf1);}(_0x1789,0x92));var _0x9178=function(_0x334ad2,_0xcd1829){_0x334ad2=_0x334ad2-0x0;var _0x1560eb=_0x1789[_0x334ad2];return _0x1560eb;};'use strict';var _=require(_0x9178('0x0'));var util=require(_0x9178('0x1'));var moment=require(_0x9178('0x2'));var BPromise=require('bluebird');var rs=require(_0x9178('0x3'));var fs=require('fs');var Redis=require(_0x9178('0x4'));var db=require(_0x9178('0x5'))['db'];var utils=require(_0x9178('0x6'));var logger=require(_0x9178('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x9178('0x8'));var client=jayson[_0x9178('0x9')][_0x9178('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1f00a8,_0x502d21,_0x1001b0){return new BPromise(function(_0x333b8b,_0x3bcc1b){return client[_0x9178('0xb')](_0x1f00a8,_0x1001b0)['then'](function(_0x4bd20e){logger['info'](_0x9178('0xc'),_0x502d21,_0x9178('0xd'));logger[_0x9178('0xe')](_0x9178('0xf'),_0x502d21,'request\x20sent',JSON[_0x9178('0x10')](_0x4bd20e));if(_0x4bd20e[_0x9178('0x11')]){if(_0x4bd20e['error']['code']===0x1f4){logger['error'](_0x9178('0xc'),_0x502d21,_0x4bd20e[_0x9178('0x11')]['message']);return _0x3bcc1b(_0x4bd20e[_0x9178('0x11')][_0x9178('0x12')]);}logger[_0x9178('0x11')]('Campaign,\x20%s,\x20%s',_0x502d21,_0x4bd20e[_0x9178('0x11')][_0x9178('0x12')]);return _0x333b8b(_0x4bd20e['error'][_0x9178('0x12')]);}else{logger['info'](_0x9178('0xc'),_0x502d21,_0x9178('0xd'));_0x333b8b(_0x4bd20e[_0x9178('0x13')][_0x9178('0x12')]);}})[_0x9178('0x14')](function(_0x31baa2){logger[_0x9178('0x11')](_0x9178('0xc'),_0x502d21,_0x31baa2);_0x3bcc1b(_0x31baa2);});});}exports[_0x9178('0x15')]=function(_0x3f3dd4){var _0x2184a0=this;return new Promise(function(_0x4393f3,_0x42c31b){return db[_0x9178('0x16')]['findAll']({'raw':_0x3f3dd4[_0x9178('0x17')]?_0x3f3dd4[_0x9178('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x3f3dd4[_0x9178('0x17')]?_0x3f3dd4['options'][_0x9178('0x18')]||null:null,'attributes':_0x3f3dd4[_0x9178('0x17')]?_0x3f3dd4[_0x9178('0x17')][_0x9178('0x19')]||null:null,'limit':_0x3f3dd4[_0x9178('0x17')]?_0x3f3dd4[_0x9178('0x17')][_0x9178('0x1a')]||null:null,'include':_0x3f3dd4[_0x9178('0x17')]?_0x3f3dd4['options'][_0x9178('0x1b')]?_['map'](_0x3f3dd4['options'][_0x9178('0x1b')],function(_0x19aafe){return{'model':db[_0x19aafe[_0x9178('0x1c')]],'as':_0x19aafe['as'],'attributes':_0x19aafe[_0x9178('0x19')],'include':_0x19aafe[_0x9178('0x1b')]?_[_0x9178('0x1d')](_0x19aafe[_0x9178('0x1b')],function(_0x23c04a){return{'model':db[_0x23c04a[_0x9178('0x1c')]],'as':_0x23c04a['as'],'attributes':_0x23c04a[_0x9178('0x19')],'include':_0x23c04a[_0x9178('0x1b')]?_[_0x9178('0x1d')](_0x23c04a[_0x9178('0x1b')],function(_0x3af74d){return{'model':db[_0x3af74d['model']],'as':_0x3af74d['as'],'attributes':_0x3af74d[_0x9178('0x19')]};}):[]};}):[]};}):[]:[]})[_0x9178('0x1e')](function(_0x5c39ed){logger[_0x9178('0x1f')](_0x9178('0x15'),_0x3f3dd4);logger[_0x9178('0xe')](_0x9178('0x15'),_0x3f3dd4,JSON[_0x9178('0x10')](_0x5c39ed));_0x4393f3(_0x5c39ed);})[_0x9178('0x14')](function(_0x5d9747){logger[_0x9178('0x11')](_0x9178('0x15'),_0x5d9747['message'],_0x3f3dd4);_0x42c31b(_0x2184a0[_0x9178('0x11')](0x1f4,_0x5d9747[_0x9178('0x12')]));});});}; \ No newline at end of file +var _0x4a3d=['jayson/promise','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','Campaign','findAll','options','raw','attributes','include','map','model','GetCampaign','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x315d14,_0x38a4a0){var _0x4952c4=function(_0x9f2719){while(--_0x9f2719){_0x315d14['push'](_0x315d14['shift']());}};_0x4952c4(++_0x38a4a0);}(_0x4a3d,0x79));var _0xd4a3=function(_0x1fde90,_0x1a79d0){_0x1fde90=_0x1fde90-0x0;var _0x449f15=_0x4a3d[_0x1fde90];return _0x449f15;};'use strict';var _=require(_0xd4a3('0x0'));var util=require(_0xd4a3('0x1'));var moment=require(_0xd4a3('0x2'));var BPromise=require(_0xd4a3('0x3'));var rs=require(_0xd4a3('0x4'));var fs=require('fs');var Redis=require(_0xd4a3('0x5'));var db=require(_0xd4a3('0x6'))['db'];var utils=require(_0xd4a3('0x7'));var logger=require(_0xd4a3('0x8'))(_0xd4a3('0x9'));var config=require(_0xd4a3('0xa'));var jayson=require(_0xd4a3('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2449da,_0x45baf1,_0x5910aa){return new BPromise(function(_0x490bc1,_0x33c34b){return client[_0xd4a3('0xc')](_0x2449da,_0x5910aa)[_0xd4a3('0xd')](function(_0x128d6c){logger[_0xd4a3('0xe')](_0xd4a3('0xf'),_0x45baf1,_0xd4a3('0x10'));logger[_0xd4a3('0x11')]('Campaign,\x20%s,\x20%s,\x20%s',_0x45baf1,_0xd4a3('0x10'),JSON[_0xd4a3('0x12')](_0x128d6c));if(_0x128d6c[_0xd4a3('0x13')]){if(_0x128d6c[_0xd4a3('0x13')][_0xd4a3('0x14')]===0x1f4){logger[_0xd4a3('0x13')](_0xd4a3('0xf'),_0x45baf1,_0x128d6c['error'][_0xd4a3('0x15')]);return _0x33c34b(_0x128d6c[_0xd4a3('0x13')][_0xd4a3('0x15')]);}logger[_0xd4a3('0x13')](_0xd4a3('0xf'),_0x45baf1,_0x128d6c[_0xd4a3('0x13')][_0xd4a3('0x15')]);return _0x490bc1(_0x128d6c[_0xd4a3('0x13')]['message']);}else{logger['info'](_0xd4a3('0xf'),_0x45baf1,_0xd4a3('0x10'));_0x490bc1(_0x128d6c[_0xd4a3('0x16')][_0xd4a3('0x15')]);}})[_0xd4a3('0x17')](function(_0x454361){logger['error'](_0xd4a3('0xf'),_0x45baf1,_0x454361);_0x33c34b(_0x454361);});});}exports['GetCampaign']=function(_0xf9fc3c){var _0x592077=this;return new Promise(function(_0x21fa36,_0x4b8850){return db[_0xd4a3('0x18')][_0xd4a3('0x19')]({'raw':_0xf9fc3c['options']?_0xf9fc3c[_0xd4a3('0x1a')][_0xd4a3('0x1b')]===undefined?!![]:![]:!![],'where':_0xf9fc3c[_0xd4a3('0x1a')]?_0xf9fc3c['options']['where']||null:null,'attributes':_0xf9fc3c[_0xd4a3('0x1a')]?_0xf9fc3c['options'][_0xd4a3('0x1c')]||null:null,'limit':_0xf9fc3c[_0xd4a3('0x1a')]?_0xf9fc3c['options']['limit']||null:null,'include':_0xf9fc3c['options']?_0xf9fc3c[_0xd4a3('0x1a')][_0xd4a3('0x1d')]?_[_0xd4a3('0x1e')](_0xf9fc3c['options'][_0xd4a3('0x1d')],function(_0x137bba){return{'model':db[_0x137bba[_0xd4a3('0x1f')]],'as':_0x137bba['as'],'attributes':_0x137bba[_0xd4a3('0x1c')],'include':_0x137bba[_0xd4a3('0x1d')]?_[_0xd4a3('0x1e')](_0x137bba['include'],function(_0x35a871){return{'model':db[_0x35a871[_0xd4a3('0x1f')]],'as':_0x35a871['as'],'attributes':_0x35a871['attributes'],'include':_0x35a871[_0xd4a3('0x1d')]?_[_0xd4a3('0x1e')](_0x35a871[_0xd4a3('0x1d')],function(_0x4ce98a){return{'model':db[_0x4ce98a[_0xd4a3('0x1f')]],'as':_0x4ce98a['as'],'attributes':_0x4ce98a[_0xd4a3('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xd4a3('0xd')](function(_0x586cd8){logger[_0xd4a3('0xe')]('GetCampaign',_0xf9fc3c);logger[_0xd4a3('0x11')]('GetCampaign',_0xf9fc3c,JSON[_0xd4a3('0x12')](_0x586cd8));_0x21fa36(_0x586cd8);})['catch'](function(_0x2769b7){logger['error'](_0xd4a3('0x20'),_0x2769b7['message'],_0xf9fc3c);_0x4b8850(_0x592077[_0xd4a3('0x13')](0x1f4,_0x2769b7[_0xd4a3('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index c742e30..f1d3718 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 _0x05fd=['util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','/:id/hoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','addLists','put','/:id','delete','destroy','removeLists','removeBlackLists','exports','multer'];(function(_0x5cc2a3,_0x2d38a6){var _0x9d6e07=function(_0xa7d53f){while(--_0xa7d53f){_0x5cc2a3['push'](_0x5cc2a3['shift']());}};_0x9d6e07(++_0x2d38a6);}(_0x05fd,0x173));var _0xd05f=function(_0x466552,_0x3d4e47){_0x466552=_0x466552-0x0;var _0x3721c2=_0x05fd[_0x466552];return _0x3721c2;};'use strict';var multer=require(_0xd05f('0x0'));var util=require(_0xd05f('0x1'));var path=require('path');var timeout=require(_0xd05f('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xd05f('0x3'));var auth=require(_0xd05f('0x4'));var interaction=require(_0xd05f('0x5'));var config=require(_0xd05f('0x6'));var controller=require(_0xd05f('0x7'));router[_0xd05f('0x8')]('/',auth[_0xd05f('0x9')](),controller[_0xd05f('0xa')]);router[_0xd05f('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xd05f('0x8')](_0xd05f('0xb'),auth[_0xd05f('0x9')](),controller['getHoppers']);router[_0xd05f('0x8')](_0xd05f('0xc'),auth['isAuthenticated'](),controller[_0xd05f('0xd')]);router['get'](_0xd05f('0xe'),auth[_0xd05f('0x9')](),controller['getHopperFinals']);router[_0xd05f('0x8')]('/:id/hopper_black',auth['isAuthenticated'](),controller['getHopperBlacks']);router['get'](_0xd05f('0xf'),auth[_0xd05f('0x9')](),controller[_0xd05f('0x10')]);router[_0xd05f('0x8')](_0xd05f('0x11'),auth[_0xd05f('0x9')](),controller[_0xd05f('0x12')]);router[_0xd05f('0x13')]('/',auth[_0xd05f('0x9')](),controller[_0xd05f('0x14')]);router[_0xd05f('0x13')](_0xd05f('0x15'),auth[_0xd05f('0x9')](),controller[_0xd05f('0x16')]);router[_0xd05f('0x13')](_0xd05f('0xf'),auth[_0xd05f('0x9')](),controller[_0xd05f('0x17')]);router[_0xd05f('0x13')]('/:id/blacklists',auth[_0xd05f('0x9')](),controller['addBlackLists']);router[_0xd05f('0x18')](_0xd05f('0x19'),auth[_0xd05f('0x9')](),controller['update']);router[_0xd05f('0x1a')]('/:id',auth[_0xd05f('0x9')](),controller[_0xd05f('0x1b')]);router[_0xd05f('0x1a')]('/:id/lists',auth[_0xd05f('0x9')](),controller[_0xd05f('0x1c')]);router[_0xd05f('0x1a')](_0xd05f('0x11'),auth[_0xd05f('0x9')](),controller[_0xd05f('0x1d')]);module[_0xd05f('0x1e')]=router; \ No newline at end of file +var _0xef60=['index','/:id','isAuthenticated','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','getHopperFinals','getHopperBlacks','/:id/lists','getLists','getBlackLists','create','post','/:id/clone','clone','addLists','/:id/blacklists','put','delete','destroy','removeBlackLists','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./campaign.controller','get'];(function(_0x47b58b,_0x41a189){var _0x46bebe=function(_0x22bbfa){while(--_0x22bbfa){_0x47b58b['push'](_0x47b58b['shift']());}};_0x46bebe(++_0x41a189);}(_0xef60,0xa0));var _0x0ef6=function(_0x2286a8,_0x5d1dbb){_0x2286a8=_0x2286a8-0x0;var _0x82a3ba=_0xef60[_0x2286a8];return _0x82a3ba;};'use strict';var multer=require(_0x0ef6('0x0'));var util=require(_0x0ef6('0x1'));var path=require(_0x0ef6('0x2'));var timeout=require(_0x0ef6('0x3'));var express=require(_0x0ef6('0x4'));var router=express[_0x0ef6('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x0ef6('0x6'));var interaction=require(_0x0ef6('0x7'));var config=require('../../config/environment');var controller=require(_0x0ef6('0x8'));router[_0x0ef6('0x9')]('/',auth['isAuthenticated'](),controller[_0x0ef6('0xa')]);router[_0x0ef6('0x9')](_0x0ef6('0xb'),auth[_0x0ef6('0xc')](),controller[_0x0ef6('0xd')]);router[_0x0ef6('0x9')](_0x0ef6('0xe'),auth['isAuthenticated'](),controller[_0x0ef6('0xf')]);router[_0x0ef6('0x9')](_0x0ef6('0x10'),auth[_0x0ef6('0xc')](),controller[_0x0ef6('0x11')]);router[_0x0ef6('0x9')]('/:id/hopper_finals',auth[_0x0ef6('0xc')](),controller[_0x0ef6('0x12')]);router[_0x0ef6('0x9')]('/:id/hopper_black',auth[_0x0ef6('0xc')](),controller[_0x0ef6('0x13')]);router[_0x0ef6('0x9')](_0x0ef6('0x14'),auth[_0x0ef6('0xc')](),controller[_0x0ef6('0x15')]);router[_0x0ef6('0x9')]('/:id/blacklists',auth[_0x0ef6('0xc')](),controller[_0x0ef6('0x16')]);router['post']('/',auth[_0x0ef6('0xc')](),controller[_0x0ef6('0x17')]);router[_0x0ef6('0x18')](_0x0ef6('0x19'),auth[_0x0ef6('0xc')](),controller[_0x0ef6('0x1a')]);router[_0x0ef6('0x18')](_0x0ef6('0x14'),auth[_0x0ef6('0xc')](),controller[_0x0ef6('0x1b')]);router[_0x0ef6('0x18')](_0x0ef6('0x1c'),auth[_0x0ef6('0xc')](),controller['addBlackLists']);router[_0x0ef6('0x1d')](_0x0ef6('0xb'),auth[_0x0ef6('0xc')](),controller['update']);router[_0x0ef6('0x1e')](_0x0ef6('0xb'),auth['isAuthenticated'](),controller[_0x0ef6('0x1f')]);router[_0x0ef6('0x1e')](_0x0ef6('0x14'),auth[_0x0ef6('0xc')](),controller['removeLists']);router[_0x0ef6('0x1e')](_0x0ef6('0x1c'),auth[_0x0ef6('0xc')](),controller[_0x0ef6('0x20')]);module[_0x0ef6('0x21')]=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index 4fd84ca..6b9f246 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 _0x7dc0=['medium','STRING','VIRTUAL','getDataValue','key','sequelize','exports','TEXT'];(function(_0x5d78f0,_0x3784f9){var _0x4d1012=function(_0x23d0ba){while(--_0x23d0ba){_0x5d78f0['push'](_0x5d78f0['shift']());}};_0x4d1012(++_0x3784f9);}(_0x7dc0,0x9d));var _0x07dc=function(_0x2cef86,_0xbae0a6){_0x2cef86=_0x2cef86-0x0;var _0x46dfd6=_0x7dc0[_0x2cef86];return _0x46dfd6;};'use strict';var Sequelize=require(_0x07dc('0x0'));module[_0x07dc('0x1')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x07dc('0x2')],'length':_0x07dc('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x07dc('0x4')]},'name':{'type':Sequelize[_0x07dc('0x5')],'get':function(){return this[_0x07dc('0x6')](_0x07dc('0x7'));}}}; \ No newline at end of file +var _0x9c50=['getDataValue','sequelize','STRING','VIRTUAL'];(function(_0x2f8fa6,_0x259848){var _0x4a4cf8=function(_0x4ed910){while(--_0x4ed910){_0x2f8fa6['push'](_0x2f8fa6['shift']());}};_0x4a4cf8(++_0x259848);}(_0x9c50,0xf5));var _0x09c5=function(_0xb27b00,_0x3c854b){_0xb27b00=_0xb27b00-0x0;var _0xd139f0=_0x9c50[_0xb27b00];return _0xd139f0;};'use strict';var Sequelize=require(_0x09c5('0x0'));module['exports']={'key':{'type':Sequelize[_0x09c5('0x1')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'length':'medium','allowNull':![]},'description':{'type':Sequelize[_0x09c5('0x1')]},'name':{'type':Sequelize[_0x09c5('0x2')],'get':function(){return this[_0x09c5('0x3')]('key');}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index 79d03da..5d9eb6f 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 _0x9cd5=['map','CannedAnswer','type','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','pick','filter','merge','where','includeAll','include','findAll','catch','show','params','options','body','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','find','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','save','update','then','destroy','get','CannedAnswers','error','name','send','index'];(function(_0x3808b5,_0x5907a0){var _0x352c3d=function(_0x334e63){while(--_0x334e63){_0x3808b5['push'](_0x3808b5['shift']());}};_0x352c3d(++_0x5907a0);}(_0x9cd5,0x1f1));var _0x59cd=function(_0x53fdd5,_0x1f3f58){_0x53fdd5=_0x53fdd5-0x0;var _0x1cc7bf=_0x9cd5[_0x53fdd5];return _0x1cc7bf;};'use strict';var emlformat=require(_0x59cd('0x0'));var rimraf=require(_0x59cd('0x1'));var zipdir=require(_0x59cd('0x2'));var jsonpatch=require(_0x59cd('0x3'));var rp=require(_0x59cd('0x4'));var moment=require('moment');var BPromise=require(_0x59cd('0x5'));var Mustache=require(_0x59cd('0x6'));var util=require(_0x59cd('0x7'));var path=require(_0x59cd('0x8'));var sox=require('sox');var csv=require(_0x59cd('0x9'));var ejs=require(_0x59cd('0xa'));var fs=require('fs');var fs_extra=require(_0x59cd('0xb'));var _=require(_0x59cd('0xc'));var squel=require(_0x59cd('0xd'));var crypto=require(_0x59cd('0xe'));var jsforce=require(_0x59cd('0xf'));var deskjs=require(_0x59cd('0x10'));var toCsv=require(_0x59cd('0x9'));var querystring=require(_0x59cd('0x11'));var Papa=require(_0x59cd('0x12'));var Redis=require(_0x59cd('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x59cd('0x14'));var as=require(_0x59cd('0x15'));var hardwareService=require(_0x59cd('0x16'));var logger=require(_0x59cd('0x17'))(_0x59cd('0x18'));var utils=require(_0x59cd('0x19'));var config=require(_0x59cd('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x59cd('0x1b'))['db'];function respondWithStatusCode(_0x184d4b,_0x13e657){_0x13e657=_0x13e657||0xcc;return function(_0x513a5f){if(_0x513a5f){return _0x184d4b[_0x59cd('0x1c')](_0x13e657);}return _0x184d4b[_0x59cd('0x1d')](_0x13e657)[_0x59cd('0x1e')]();};}function respondWithResult(_0x195a8c,_0x264e4d){_0x264e4d=_0x264e4d||0xc8;return function(_0x3aa051){if(_0x3aa051){return _0x195a8c[_0x59cd('0x1d')](_0x264e4d)[_0x59cd('0x1f')](_0x3aa051);}};}function respondWithFilteredResult(_0x561fb5,_0x266d41){return function(_0x29aa0b){if(_0x29aa0b){var _0x3bab89=typeof _0x266d41[_0x59cd('0x20')]===_0x59cd('0x21')&&typeof _0x266d41['limit']===_0x59cd('0x21');var _0x21b9db=_0x29aa0b[_0x59cd('0x22')];var _0x5237e6=_0x3bab89?0x0:_0x266d41[_0x59cd('0x20')];var _0x5ecb02=_0x3bab89?_0x29aa0b['count']:_0x266d41[_0x59cd('0x20')]+_0x266d41[_0x59cd('0x23')];var _0x567691;if(_0x5ecb02>=_0x21b9db){_0x5ecb02=_0x21b9db;_0x567691=0xc8;}else{_0x567691=0xce;}_0x561fb5['status'](_0x567691);return _0x561fb5[_0x59cd('0x24')]('Content-Range',_0x5237e6+'-'+_0x5ecb02+'/'+_0x21b9db)[_0x59cd('0x1f')](_0x29aa0b);}return null;};}function patchUpdates(_0x304219){return function(_0x43c4c5){try{jsonpatch[_0x59cd('0x25')](_0x43c4c5,_0x304219,!![]);}catch(_0x5a49ab){return BPromise[_0x59cd('0x26')](_0x5a49ab);}return _0x43c4c5[_0x59cd('0x27')]();};}function saveUpdates(_0x2d0feb,_0x2d7157){return function(_0x5e5b20){if(_0x5e5b20){return _0x5e5b20[_0x59cd('0x28')](_0x2d0feb)[_0x59cd('0x29')](function(_0x3522d4){return _0x3522d4;});}return null;};}function removeEntity(_0xad36dc,_0xb1291){return function(_0x342bce){if(_0x342bce){return _0x342bce[_0x59cd('0x2a')]()[_0x59cd('0x29')](function(){var _0x490052=_0x342bce[_0x59cd('0x2b')]({'plain':!![]});var _0x3d2379=_0x59cd('0x2c');return db['UserProfileResource'][_0x59cd('0x2a')]({'where':{'type':_0x3d2379,'resourceId':_0x490052['id']}})[_0x59cd('0x29')](function(){return _0x342bce;});})[_0x59cd('0x29')](function(){_0xad36dc[_0x59cd('0x1d')](0xcc)[_0x59cd('0x1e')]();});}};}function handleEntityNotFound(_0x391d01,_0x1e47a6){return function(_0x6fb06b){if(!_0x6fb06b){_0x391d01[_0x59cd('0x1c')](0x194);}return _0x6fb06b;};}function handleError(_0x1d525d,_0x4cd1bd){_0x4cd1bd=_0x4cd1bd||0x1f4;return function(_0x46e532){logger[_0x59cd('0x2d')](_0x46e532['stack']);if(_0x46e532['name']){delete _0x46e532[_0x59cd('0x2e')];}_0x1d525d[_0x59cd('0x1d')](_0x4cd1bd)[_0x59cd('0x2f')](_0x46e532);};}exports[_0x59cd('0x30')]=function(_0x5dc6,_0x1a7e05){var _0x41b0b3={},_0x1f1af2={},_0x522f79={'count':0x0,'rows':[]};var _0x132b58=_[_0x59cd('0x31')](db[_0x59cd('0x32')]['rawAttributes'],function(_0x86cde2){return{'name':_0x86cde2['fieldName'],'type':_0x86cde2[_0x59cd('0x33')][_0x59cd('0x34')]};});_0x1f1af2[_0x59cd('0x35')]=_[_0x59cd('0x31')](_0x132b58,_0x59cd('0x2e'));_0x1f1af2[_0x59cd('0x36')]=_[_0x59cd('0x37')](_0x5dc6[_0x59cd('0x36')]);_0x1f1af2[_0x59cd('0x38')]=_[_0x59cd('0x39')](_0x1f1af2[_0x59cd('0x35')],_0x1f1af2[_0x59cd('0x36')]);_0x41b0b3[_0x59cd('0x3a')]=_[_0x59cd('0x39')](_0x1f1af2[_0x59cd('0x35')],qs[_0x59cd('0x3b')](_0x5dc6[_0x59cd('0x36')][_0x59cd('0x3b')]));_0x41b0b3[_0x59cd('0x3a')]=_0x41b0b3[_0x59cd('0x3a')][_0x59cd('0x3c')]?_0x41b0b3[_0x59cd('0x3a')]:_0x1f1af2[_0x59cd('0x35')];if(!_0x5dc6[_0x59cd('0x36')]['hasOwnProperty']('nolimit')){_0x41b0b3[_0x59cd('0x23')]=qs[_0x59cd('0x23')](_0x5dc6[_0x59cd('0x36')]['limit']);_0x41b0b3[_0x59cd('0x20')]=qs[_0x59cd('0x20')](_0x5dc6[_0x59cd('0x36')][_0x59cd('0x20')]);}_0x41b0b3[_0x59cd('0x3d')]=qs[_0x59cd('0x3e')](_0x5dc6[_0x59cd('0x36')][_0x59cd('0x3e')]);_0x41b0b3['where']=qs[_0x59cd('0x38')](_[_0x59cd('0x3f')](_0x5dc6[_0x59cd('0x36')],_0x1f1af2['filters']),_0x132b58);if(_0x5dc6[_0x59cd('0x36')][_0x59cd('0x40')]){_0x41b0b3['where']=_[_0x59cd('0x41')](_0x41b0b3[_0x59cd('0x42')],{'$or':[{'key':{'$like':'%'+_0x5dc6[_0x59cd('0x36')][_0x59cd('0x40')]+'%'}},{'value':{'$like':'%'+_0x5dc6[_0x59cd('0x36')][_0x59cd('0x40')]+'%'}}]});}_0x41b0b3=_[_0x59cd('0x41')]({},_0x41b0b3,_0x5dc6['options']);var _0x442e0c={'where':_0x41b0b3[_0x59cd('0x42')]};return db[_0x59cd('0x32')][_0x59cd('0x22')](_0x442e0c)[_0x59cd('0x29')](function(_0x1e550e){_0x522f79[_0x59cd('0x22')]=_0x1e550e;if(_0x5dc6['query'][_0x59cd('0x43')]){_0x41b0b3[_0x59cd('0x44')]=[{'all':!![]}];}return db[_0x59cd('0x32')][_0x59cd('0x45')](_0x41b0b3);})['then'](function(_0x2a5eff){_0x522f79['rows']=_0x2a5eff;return _0x522f79;})[_0x59cd('0x29')](respondWithFilteredResult(_0x1a7e05,_0x41b0b3))[_0x59cd('0x46')](handleError(_0x1a7e05,null));};exports[_0x59cd('0x47')]=function(_0x313796,_0x148e57){var _0x313b54={'raw':!![],'where':{'id':_0x313796[_0x59cd('0x48')]['id']}},_0x198dd1={};_0x198dd1[_0x59cd('0x35')]=_[_0x59cd('0x37')](db['CannedAnswer']['rawAttributes']);_0x198dd1[_0x59cd('0x36')]=_['keys'](_0x313796['query']);_0x198dd1['filters']=_['intersection'](_0x198dd1['model'],_0x198dd1[_0x59cd('0x36')]);_0x313b54[_0x59cd('0x3a')]=_['intersection'](_0x198dd1[_0x59cd('0x35')],qs[_0x59cd('0x3b')](_0x313796[_0x59cd('0x36')][_0x59cd('0x3b')]));_0x313b54[_0x59cd('0x3a')]=_0x313b54[_0x59cd('0x3a')][_0x59cd('0x3c')]?_0x313b54[_0x59cd('0x3a')]:_0x198dd1[_0x59cd('0x35')];if(_0x313796[_0x59cd('0x36')][_0x59cd('0x43')]){_0x313b54['include']=[{'all':!![]}];}_0x313b54=_[_0x59cd('0x41')]({},_0x313b54,_0x313796[_0x59cd('0x49')]);return db[_0x59cd('0x32')]['find'](_0x313b54)[_0x59cd('0x29')](handleEntityNotFound(_0x148e57,null))['then'](respondWithResult(_0x148e57,null))[_0x59cd('0x46')](handleError(_0x148e57,null));};exports[_0x59cd('0x28')]=function(_0x5bac72,_0x4f706c){if(_0x5bac72[_0x59cd('0x4a')]['id']){delete _0x5bac72[_0x59cd('0x4a')]['id'];}return db[_0x59cd('0x32')]['find']({'where':{'id':_0x5bac72[_0x59cd('0x48')]['id']}})['then'](handleEntityNotFound(_0x4f706c,null))[_0x59cd('0x29')](saveUpdates(_0x5bac72[_0x59cd('0x4a')],null))[_0x59cd('0x29')](respondWithResult(_0x4f706c,null))[_0x59cd('0x46')](handleError(_0x4f706c,null));};exports[_0x59cd('0x2a')]=function(_0x22d2f6,_0xdf9712){return db[_0x59cd('0x32')]['find']({'where':{'id':_0x22d2f6['params']['id']}})[_0x59cd('0x29')](handleEntityNotFound(_0xdf9712,null))['then'](removeEntity(_0xdf9712,null))[_0x59cd('0x46')](handleError(_0xdf9712,null));};exports['create']=function(_0x149a06,_0x3aa8dc){var _0x230cd4={'key':_0x149a06[_0x59cd('0x4a')][_0x59cd('0x34')]};if(_0x149a06[_0x59cd('0x4a')]['MailAccountId']){_0x230cd4[_0x59cd('0x4b')]=_0x149a06[_0x59cd('0x4a')][_0x59cd('0x4b')];}else if(_0x149a06['body']['SmsAccountId']){_0x230cd4[_0x59cd('0x4c')]=_0x149a06[_0x59cd('0x4a')][_0x59cd('0x4c')];}else if(_0x149a06[_0x59cd('0x4a')][_0x59cd('0x4d')]){_0x230cd4[_0x59cd('0x4d')]=_0x149a06[_0x59cd('0x4a')]['OpenchannelAccountId'];}else if(_0x149a06['body'][_0x59cd('0x4e')]){_0x230cd4[_0x59cd('0x4e')]=_0x149a06[_0x59cd('0x4a')][_0x59cd('0x4e')];}return db[_0x59cd('0x32')][_0x59cd('0x4f')]({'where':_0x230cd4})[_0x59cd('0x29')](function(_0x1acf54){if(_0x1acf54){throw new db[(_0x59cd('0x50'))][(_0x59cd('0x51'))](_0x59cd('0x52'));}return db['CannedAnswer']['create'](_0x149a06[_0x59cd('0x4a')]);})['then'](function(_0xa47d22){var _0x1ff85c=_0x149a06[_0x59cd('0x53')]['get']({'plain':!![]});if(!_0x1ff85c)throw new Error(_0x59cd('0x54'));if(_0x1ff85c[_0x59cd('0x55')]===_0x59cd('0x53')){var _0x820f91=_0xa47d22[_0x59cd('0x2b')]({'plain':!![]});return db[_0x59cd('0x56')][_0x59cd('0x4f')]({'where':{'name':_0x59cd('0x2c'),'userProfileId':_0x1ff85c[_0x59cd('0x57')]},'raw':!![]})[_0x59cd('0x29')](function(_0x51c1ce){if(_0x51c1ce&&_0x51c1ce[_0x59cd('0x58')]===0x0){return db['UserProfileResource'][_0x59cd('0x59')]({'name':_0x820f91[_0x59cd('0x2e')],'resourceId':_0x820f91['id'],'type':_0x51c1ce['name'],'sectionId':_0x51c1ce['id']},{})[_0x59cd('0x29')](function(){return _0xa47d22;});}else{return _0xa47d22;}})['catch'](function(_0x1b71de){logger[_0x59cd('0x2d')](_0x59cd('0x5a'),_0x1b71de);throw _0x1b71de;});}return _0xa47d22;})[_0x59cd('0x29')](respondWithResult(_0x3aa8dc,0xc9))[_0x59cd('0x46')](handleError(_0x3aa8dc,null));}; \ No newline at end of file +var _0xf3fc=['fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','include','findAll','show','params','includeAll','find','catch','update','body','create','key','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','UserProfileResource','error','stack','name','send','index','map','CannedAnswer','rawAttributes','model','query','keys','intersection','attributes'];(function(_0x75cc31,_0x21bdbe){var _0x3eefa7=function(_0x125e39){while(--_0x125e39){_0x75cc31['push'](_0x75cc31['shift']());}};_0x3eefa7(++_0x21bdbe);}(_0xf3fc,0x128));var _0xcf3f=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xf3fc[_0xa464c9];return _0x3d73c4;};'use strict';var emlformat=require(_0xcf3f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcf3f('0x1'));var jsonpatch=require(_0xcf3f('0x2'));var rp=require(_0xcf3f('0x3'));var moment=require(_0xcf3f('0x4'));var BPromise=require(_0xcf3f('0x5'));var Mustache=require(_0xcf3f('0x6'));var util=require(_0xcf3f('0x7'));var path=require('path');var sox=require(_0xcf3f('0x8'));var csv=require(_0xcf3f('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcf3f('0xa'));var _=require(_0xcf3f('0xb'));var squel=require('squel');var crypto=require(_0xcf3f('0xc'));var jsforce=require(_0xcf3f('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xcf3f('0xe'));var Redis=require(_0xcf3f('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xcf3f('0x10'));var as=require(_0xcf3f('0x11'));var hardwareService=require(_0xcf3f('0x12'));var logger=require(_0xcf3f('0x13'))(_0xcf3f('0x14'));var utils=require('../../config/utils');var config=require(_0xcf3f('0x15'));var licenseUtil=require(_0xcf3f('0x16'));var db=require(_0xcf3f('0x17'))['db'];function respondWithStatusCode(_0x4baf2c,_0x3c0dc8){_0x3c0dc8=_0x3c0dc8||0xcc;return function(_0x1b4bb0){if(_0x1b4bb0){return _0x4baf2c[_0xcf3f('0x18')](_0x3c0dc8);}return _0x4baf2c[_0xcf3f('0x19')](_0x3c0dc8)[_0xcf3f('0x1a')]();};}function respondWithResult(_0x9f69a0,_0xde5fbf){_0xde5fbf=_0xde5fbf||0xc8;return function(_0x16216c){if(_0x16216c){return _0x9f69a0[_0xcf3f('0x19')](_0xde5fbf)[_0xcf3f('0x1b')](_0x16216c);}};}function respondWithFilteredResult(_0x59a0e1,_0x320275){return function(_0x5a8f36){if(_0x5a8f36){var _0x213fd8=typeof _0x320275[_0xcf3f('0x1c')]===_0xcf3f('0x1d')&&typeof _0x320275[_0xcf3f('0x1e')]===_0xcf3f('0x1d');var _0x4d5ed4=_0x5a8f36['count'];var _0x59c2d6=_0x213fd8?0x0:_0x320275[_0xcf3f('0x1c')];var _0x48733a=_0x213fd8?_0x5a8f36[_0xcf3f('0x1f')]:_0x320275[_0xcf3f('0x1c')]+_0x320275[_0xcf3f('0x1e')];var _0x430c18;if(_0x48733a>=_0x4d5ed4){_0x48733a=_0x4d5ed4;_0x430c18=0xc8;}else{_0x430c18=0xce;}_0x59a0e1[_0xcf3f('0x19')](_0x430c18);return _0x59a0e1[_0xcf3f('0x20')](_0xcf3f('0x21'),_0x59c2d6+'-'+_0x48733a+'/'+_0x4d5ed4)[_0xcf3f('0x1b')](_0x5a8f36);}return null;};}function patchUpdates(_0xab4fb1){return function(_0x36b117){try{jsonpatch[_0xcf3f('0x22')](_0x36b117,_0xab4fb1,!![]);}catch(_0xa8bb41){return BPromise[_0xcf3f('0x23')](_0xa8bb41);}return _0x36b117['save']();};}function saveUpdates(_0x453ff2,_0x474daf){return function(_0xf52d2e){if(_0xf52d2e){return _0xf52d2e['update'](_0x453ff2)[_0xcf3f('0x24')](function(_0x498c9b){return _0x498c9b;});}return null;};}function removeEntity(_0x2787f1,_0x58c567){return function(_0x12fbd2){if(_0x12fbd2){return _0x12fbd2[_0xcf3f('0x25')]()['then'](function(){var _0xb4fa94=_0x12fbd2['get']({'plain':!![]});var _0x1306d8='CannedAnswers';return db[_0xcf3f('0x26')][_0xcf3f('0x25')]({'where':{'type':_0x1306d8,'resourceId':_0xb4fa94['id']}})[_0xcf3f('0x24')](function(){return _0x12fbd2;});})[_0xcf3f('0x24')](function(){_0x2787f1[_0xcf3f('0x19')](0xcc)[_0xcf3f('0x1a')]();});}};}function handleEntityNotFound(_0x42adeb,_0x2e51e7){return function(_0x3d5f27){if(!_0x3d5f27){_0x42adeb[_0xcf3f('0x18')](0x194);}return _0x3d5f27;};}function handleError(_0x2807b9,_0x338ea6){_0x338ea6=_0x338ea6||0x1f4;return function(_0x1f26ff){logger[_0xcf3f('0x27')](_0x1f26ff[_0xcf3f('0x28')]);if(_0x1f26ff[_0xcf3f('0x29')]){delete _0x1f26ff[_0xcf3f('0x29')];}_0x2807b9[_0xcf3f('0x19')](_0x338ea6)[_0xcf3f('0x2a')](_0x1f26ff);};}exports[_0xcf3f('0x2b')]=function(_0x49c043,_0x4e3bae){var _0x359baa={},_0x46b26f={},_0x5b2ec6={'count':0x0,'rows':[]};var _0xa2a9b=_[_0xcf3f('0x2c')](db[_0xcf3f('0x2d')][_0xcf3f('0x2e')],function(_0x322cea){return{'name':_0x322cea['fieldName'],'type':_0x322cea['type']['key']};});_0x46b26f[_0xcf3f('0x2f')]=_['map'](_0xa2a9b,'name');_0x46b26f[_0xcf3f('0x30')]=_[_0xcf3f('0x31')](_0x49c043[_0xcf3f('0x30')]);_0x46b26f['filters']=_[_0xcf3f('0x32')](_0x46b26f['model'],_0x46b26f[_0xcf3f('0x30')]);_0x359baa[_0xcf3f('0x33')]=_[_0xcf3f('0x32')](_0x46b26f[_0xcf3f('0x2f')],qs[_0xcf3f('0x34')](_0x49c043['query'][_0xcf3f('0x34')]));_0x359baa[_0xcf3f('0x33')]=_0x359baa[_0xcf3f('0x33')]['length']?_0x359baa[_0xcf3f('0x33')]:_0x46b26f[_0xcf3f('0x2f')];if(!_0x49c043['query'][_0xcf3f('0x35')](_0xcf3f('0x36'))){_0x359baa[_0xcf3f('0x1e')]=qs[_0xcf3f('0x1e')](_0x49c043[_0xcf3f('0x30')][_0xcf3f('0x1e')]);_0x359baa[_0xcf3f('0x1c')]=qs[_0xcf3f('0x1c')](_0x49c043[_0xcf3f('0x30')][_0xcf3f('0x1c')]);}_0x359baa[_0xcf3f('0x37')]=qs[_0xcf3f('0x38')](_0x49c043[_0xcf3f('0x30')][_0xcf3f('0x38')]);_0x359baa[_0xcf3f('0x39')]=qs[_0xcf3f('0x3a')](_[_0xcf3f('0x3b')](_0x49c043[_0xcf3f('0x30')],_0x46b26f[_0xcf3f('0x3a')]),_0xa2a9b);if(_0x49c043[_0xcf3f('0x30')][_0xcf3f('0x3c')]){_0x359baa[_0xcf3f('0x39')]=_[_0xcf3f('0x3d')](_0x359baa['where'],{'$or':[{'key':{'$like':'%'+_0x49c043['query'][_0xcf3f('0x3c')]+'%'}},{'value':{'$like':'%'+_0x49c043[_0xcf3f('0x30')][_0xcf3f('0x3c')]+'%'}}]});}_0x359baa=_[_0xcf3f('0x3d')]({},_0x359baa,_0x49c043[_0xcf3f('0x3e')]);var _0x1d57aa={'where':_0x359baa[_0xcf3f('0x39')]};return db[_0xcf3f('0x2d')][_0xcf3f('0x1f')](_0x1d57aa)['then'](function(_0x5b44b7){_0x5b2ec6[_0xcf3f('0x1f')]=_0x5b44b7;if(_0x49c043[_0xcf3f('0x30')]['includeAll']){_0x359baa[_0xcf3f('0x3f')]=[{'all':!![]}];}return db[_0xcf3f('0x2d')][_0xcf3f('0x40')](_0x359baa);})[_0xcf3f('0x24')](function(_0x2a5ce8){_0x5b2ec6['rows']=_0x2a5ce8;return _0x5b2ec6;})[_0xcf3f('0x24')](respondWithFilteredResult(_0x4e3bae,_0x359baa))['catch'](handleError(_0x4e3bae,null));};exports[_0xcf3f('0x41')]=function(_0x522015,_0x479dad){var _0x202bd8={'raw':!![],'where':{'id':_0x522015[_0xcf3f('0x42')]['id']}},_0x2e3ce8={};_0x2e3ce8[_0xcf3f('0x2f')]=_['keys'](db[_0xcf3f('0x2d')]['rawAttributes']);_0x2e3ce8['query']=_[_0xcf3f('0x31')](_0x522015['query']);_0x2e3ce8[_0xcf3f('0x3a')]=_[_0xcf3f('0x32')](_0x2e3ce8[_0xcf3f('0x2f')],_0x2e3ce8['query']);_0x202bd8[_0xcf3f('0x33')]=_[_0xcf3f('0x32')](_0x2e3ce8[_0xcf3f('0x2f')],qs[_0xcf3f('0x34')](_0x522015[_0xcf3f('0x30')][_0xcf3f('0x34')]));_0x202bd8[_0xcf3f('0x33')]=_0x202bd8['attributes']['length']?_0x202bd8['attributes']:_0x2e3ce8[_0xcf3f('0x2f')];if(_0x522015[_0xcf3f('0x30')][_0xcf3f('0x43')]){_0x202bd8['include']=[{'all':!![]}];}_0x202bd8=_['merge']({},_0x202bd8,_0x522015[_0xcf3f('0x3e')]);return db[_0xcf3f('0x2d')][_0xcf3f('0x44')](_0x202bd8)[_0xcf3f('0x24')](handleEntityNotFound(_0x479dad,null))[_0xcf3f('0x24')](respondWithResult(_0x479dad,null))[_0xcf3f('0x45')](handleError(_0x479dad,null));};exports[_0xcf3f('0x46')]=function(_0x12901d,_0x1dc922){if(_0x12901d[_0xcf3f('0x47')]['id']){delete _0x12901d[_0xcf3f('0x47')]['id'];}return db['CannedAnswer'][_0xcf3f('0x44')]({'where':{'id':_0x12901d[_0xcf3f('0x42')]['id']}})[_0xcf3f('0x24')](handleEntityNotFound(_0x1dc922,null))[_0xcf3f('0x24')](saveUpdates(_0x12901d[_0xcf3f('0x47')],null))['then'](respondWithResult(_0x1dc922,null))['catch'](handleError(_0x1dc922,null));};exports[_0xcf3f('0x25')]=function(_0x12fbdb,_0x3effd5){return db[_0xcf3f('0x2d')]['find']({'where':{'id':_0x12fbdb['params']['id']}})['then'](handleEntityNotFound(_0x3effd5,null))['then'](removeEntity(_0x3effd5,null))[_0xcf3f('0x45')](handleError(_0x3effd5,null));};exports[_0xcf3f('0x48')]=function(_0x50c420,_0x27dc3c){var _0x4bd04d={'key':_0x50c420[_0xcf3f('0x47')][_0xcf3f('0x49')]};if(_0x50c420[_0xcf3f('0x47')]['MailAccountId']){_0x4bd04d[_0xcf3f('0x4a')]=_0x50c420['body'][_0xcf3f('0x4a')];}else if(_0x50c420[_0xcf3f('0x47')]['SmsAccountId']){_0x4bd04d[_0xcf3f('0x4b')]=_0x50c420[_0xcf3f('0x47')][_0xcf3f('0x4b')];}else if(_0x50c420[_0xcf3f('0x47')][_0xcf3f('0x4c')]){_0x4bd04d[_0xcf3f('0x4c')]=_0x50c420[_0xcf3f('0x47')][_0xcf3f('0x4c')];}else if(_0x50c420['body']['ChatWebsiteId']){_0x4bd04d[_0xcf3f('0x4d')]=_0x50c420['body'][_0xcf3f('0x4d')];}return db[_0xcf3f('0x2d')]['find']({'where':_0x4bd04d})['then'](function(_0x1566cc){if(_0x1566cc){throw new db['Sequelize'][(_0xcf3f('0x4e'))](_0xcf3f('0x4f'));}return db[_0xcf3f('0x2d')][_0xcf3f('0x48')](_0x50c420['body']);})[_0xcf3f('0x24')](function(_0x526032){var _0x501932=_0x50c420[_0xcf3f('0x50')][_0xcf3f('0x51')]({'plain':!![]});if(!_0x501932)throw new Error(_0xcf3f('0x52'));if(_0x501932[_0xcf3f('0x53')]==='user'){var _0x101e4c=_0x526032['get']({'plain':!![]});return db[_0xcf3f('0x54')]['find']({'where':{'name':'CannedAnswers','userProfileId':_0x501932[_0xcf3f('0x55')]},'raw':!![]})[_0xcf3f('0x24')](function(_0x22f850){if(_0x22f850&&_0x22f850[_0xcf3f('0x56')]===0x0){return db[_0xcf3f('0x26')]['create']({'name':_0x101e4c[_0xcf3f('0x29')],'resourceId':_0x101e4c['id'],'type':_0x22f850[_0xcf3f('0x29')],'sectionId':_0x22f850['id']},{})[_0xcf3f('0x24')](function(){return _0x526032;});}else{return _0x526032;}})[_0xcf3f('0x45')](function(_0x8f2dc2){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x8f2dc2);throw _0x8f2dc2;});}return _0x526032;})[_0xcf3f('0x24')](respondWithResult(_0x27dc3c,0xc9))[_0xcf3f('0x45')](handleError(_0x27dc3c,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index 34c3137..9f014f8 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 _0xd592=['utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','CannedAnswer','tools_canned_answers'];(function(_0x119f3c,_0x4bee97){var _0x335bfc=function(_0x2102cd){while(--_0x2102cd){_0x119f3c['push'](_0x119f3c['shift']());}};_0x335bfc(++_0x4bee97);}(_0xd592,0x97));var _0x2d59=function(_0x26c264,_0xd8bc65){_0x26c264=_0x26c264-0x0;var _0x2a40a4=_0xd592[_0x26c264];return _0x2a40a4;};'use strict';var _=require(_0x2d59('0x0'));var util=require(_0x2d59('0x1'));var logger=require(_0x2d59('0x2'))(_0x2d59('0x3'));var moment=require(_0x2d59('0x4'));var BPromise=require(_0x2d59('0x5'));var rp=require(_0x2d59('0x6'));var fs=require('fs');var path=require(_0x2d59('0x7'));var rimraf=require(_0x2d59('0x8'));var config=require(_0x2d59('0x9'));var attributes=require('./cannedAnswer.attributes');module[_0x2d59('0xa')]=function(_0x5f059b,_0x44f619){return _0x5f059b[_0x2d59('0xb')](_0x2d59('0xc'),attributes,{'tableName':_0x2d59('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x2d59('0xe')});}; \ No newline at end of file +var _0x4e16=['CannedAnswer','utf8mb4','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','exports','define'];(function(_0x28e919,_0x145939){var _0x692b7e=function(_0x1514ae){while(--_0x1514ae){_0x28e919['push'](_0x28e919['shift']());}};_0x692b7e(++_0x145939);}(_0x4e16,0x1ee));var _0x64e1=function(_0x1af572,_0x1d11c5){_0x1af572=_0x1af572-0x0;var _0x2cf6bf=_0x4e16[_0x1af572];return _0x2cf6bf;};'use strict';var _=require(_0x64e1('0x0'));var util=require(_0x64e1('0x1'));var logger=require(_0x64e1('0x2'))(_0x64e1('0x3'));var moment=require(_0x64e1('0x4'));var BPromise=require('bluebird');var rp=require(_0x64e1('0x5'));var fs=require('fs');var path=require(_0x64e1('0x6'));var rimraf=require(_0x64e1('0x7'));var config=require('../../config/environment');var attributes=require('./cannedAnswer.attributes');module[_0x64e1('0x8')]=function(_0x58dad6,_0x4f05ae){return _0x58dad6[_0x64e1('0x9')](_0x64e1('0xa'),attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x64e1('0xb'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index 9787022..725cc74 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(_0x30d199,_0x287cb0){var _0x5c465d=function(_0x4bc356){while(--_0x4bc356){_0x30d199['push'](_0x30d199['shift']());}};_0x5c465d(++_0x287cb0);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xa9e0[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ 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(_0x2fe6a5,_0x259962){var _0x3af016=function(_0x63b950){while(--_0x63b950){_0x2fe6a5['push'](_0x2fe6a5['shift']());}};_0x3af016(++_0x259962);}(_0xa9e0,0x123));var _0x0a9e=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0xa9e0[_0x36dfbd];return _0x4ecad9;};'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 ba0e9b4..76726e3 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 _0x8c26=['exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','index','/:id','isAuthenticated','show','create','put','delete','destroy'];(function(_0x52ef9a,_0x312e31){var _0x424c2b=function(_0x231947){while(--_0x231947){_0x52ef9a['push'](_0x52ef9a['shift']());}};_0x424c2b(++_0x312e31);}(_0x8c26,0x1e1));var _0x68c2=function(_0x5e31d6,_0x238cb5){_0x5e31d6=_0x5e31d6-0x0;var _0x2e206a=_0x8c26[_0x5e31d6];return _0x2e206a;};'use strict';var multer=require(_0x68c2('0x0'));var util=require(_0x68c2('0x1'));var path=require(_0x68c2('0x2'));var timeout=require(_0x68c2('0x3'));var express=require('express');var router=express[_0x68c2('0x4')]();var fs_extra=require(_0x68c2('0x5'));var auth=require(_0x68c2('0x6'));var interaction=require(_0x68c2('0x7'));var config=require(_0x68c2('0x8'));var controller=require(_0x68c2('0x9'));router[_0x68c2('0xa')]('/',auth['isAuthenticated'](),controller[_0x68c2('0xb')]);router['get'](_0x68c2('0xc'),auth[_0x68c2('0xd')](),controller[_0x68c2('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x68c2('0xf')]);router[_0x68c2('0x10')]('/:id',auth[_0x68c2('0xd')](),controller['update']);router[_0x68c2('0x11')](_0x68c2('0xc'),auth[_0x68c2('0xd')](),controller[_0x68c2('0x12')]);module[_0x68c2('0x13')]=router; \ No newline at end of file +var _0x3e26=['show','post','create','isAuthenticated','update','delete','/:id','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get'];(function(_0x1e48d9,_0x5df5d8){var _0x20255c=function(_0x4d20a2){while(--_0x4d20a2){_0x1e48d9['push'](_0x1e48d9['shift']());}};_0x20255c(++_0x5df5d8);}(_0x3e26,0x13a));var _0x63e2=function(_0xc0737c,_0xee6126){_0xc0737c=_0xc0737c-0x0;var _0x541d26=_0x3e26[_0xc0737c];return _0x541d26;};'use strict';var multer=require(_0x63e2('0x0'));var util=require('util');var path=require(_0x63e2('0x1'));var timeout=require(_0x63e2('0x2'));var express=require(_0x63e2('0x3'));var router=express[_0x63e2('0x4')]();var fs_extra=require(_0x63e2('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x63e2('0x6'));var config=require(_0x63e2('0x7'));var controller=require(_0x63e2('0x8'));router[_0x63e2('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x63e2('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x63e2('0xa')]);router[_0x63e2('0xb')]('/',auth['isAuthenticated'](),controller[_0x63e2('0xc')]);router['put']('/:id',auth[_0x63e2('0xd')](),controller[_0x63e2('0xe')]);router[_0x63e2('0xf')](_0x63e2('0x10'),auth['isAuthenticated'](),controller[_0x63e2('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index f8a5ac7..7b7feb0 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 _0x6449=['1970-01-01\x2000:00:01','STRING','INTEGER','exports','DATE'];(function(_0x504b50,_0x3ee98c){var _0x4f627c=function(_0x3120cf){while(--_0x3120cf){_0x504b50['push'](_0x504b50['shift']());}};_0x4f627c(++_0x3ee98c);}(_0x6449,0xee));var _0x9644=function(_0x88cd7b,_0x4c884c){_0x88cd7b=_0x88cd7b-0x0;var _0x56fcc8=_0x6449[_0x88cd7b];return _0x56fcc8;};'use strict';var Sequelize=require('sequelize');module[_0x9644('0x0')]={'calldate':{'type':Sequelize[_0x9644('0x1')],'allowNull':![],'defaultValue':_0x9644('0x2')},'clid':{'type':Sequelize[_0x9644('0x3')]},'src':{'type':Sequelize[_0x9644('0x3')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0x9644('0x3')]},'channel':{'type':Sequelize[_0x9644('0x3')]},'dstchannel':{'type':Sequelize[_0x9644('0x3')]},'lastapp':{'type':Sequelize[_0x9644('0x3')]},'lastdata':{'type':Sequelize[_0x9644('0x3')]},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x9644('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x9644('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x9644('0x3')]},'userfield':{'type':Sequelize[_0x9644('0x3')]},'uniqueid':{'type':Sequelize[_0x9644('0x3')]},'linkedid':{'type':Sequelize[_0x9644('0x3')]},'sequence':{'type':Sequelize[_0x9644('0x3')]},'peeraccount':{'type':Sequelize[_0x9644('0x3')]},'type':{'type':Sequelize[_0x9644('0x3')]},'tag':{'type':Sequelize[_0x9644('0x3')]}}; \ No newline at end of file +var _0x0194=['INTEGER','DATE','1970-01-01\x2000:00:01','STRING'];(function(_0x2634a7,_0x118508){var _0xa52e2c=function(_0x400f75){while(--_0x400f75){_0x2634a7['push'](_0x2634a7['shift']());}};_0xa52e2c(++_0x118508);}(_0x0194,0xf1));var _0x4019=function(_0x26a8e9,_0x2013a1){_0x26a8e9=_0x26a8e9-0x0;var _0x17333a=_0x0194[_0x26a8e9];return _0x17333a;};'use strict';var Sequelize=require('sequelize');module['exports']={'calldate':{'type':Sequelize[_0x4019('0x0')],'allowNull':![],'defaultValue':_0x4019('0x1')},'clid':{'type':Sequelize[_0x4019('0x2')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0x4019('0x2')]},'dcontext':{'type':Sequelize[_0x4019('0x2')]},'channel':{'type':Sequelize[_0x4019('0x2')]},'dstchannel':{'type':Sequelize[_0x4019('0x2')]},'lastapp':{'type':Sequelize[_0x4019('0x2')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0x4019('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x4019('0x3')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x4019('0x2')]},'amaflags':{'type':Sequelize[_0x4019('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x4019('0x2')]},'uniqueid':{'type':Sequelize[_0x4019('0x2')]},'linkedid':{'type':Sequelize[_0x4019('0x2')]},'sequence':{'type':Sequelize[_0x4019('0x2')]},'peeraccount':{'type':Sequelize[_0x4019('0x2')]},'type':{'type':Sequelize[_0x4019('0x2')]},'tag':{'type':Sequelize[_0x4019('0x2')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index 66690b5..996626d 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 _0x7a59=['describe','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','undefined','offset','count','limit','Content-Range','apply','reject','then','destroy','end','error','stack','name','send','map','rawAttributes','fieldName','type','query','filters','model','intersection','fields','attributes','length','nolimit','order','sort','pick','merge','where','VIRTUAL','filter','options','Cdr','findAll','show','params','keys','include','find','create','body','catch','update'];(function(_0x272700,_0x525483){var _0x3927a4=function(_0x5a98e0){while(--_0x5a98e0){_0x272700['push'](_0x272700['shift']());}};_0x3927a4(++_0x525483);}(_0x7a59,0x16e));var _0x97a5=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x7a59[_0x2be8c2];return _0x97f531;};'use strict';var emlformat=require(_0x97a5('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x97a5('0x1'));var rp=require(_0x97a5('0x2'));var moment=require(_0x97a5('0x3'));var BPromise=require(_0x97a5('0x4'));var Mustache=require(_0x97a5('0x5'));var util=require('util');var path=require(_0x97a5('0x6'));var sox=require(_0x97a5('0x7'));var csv=require(_0x97a5('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x97a5('0x9'));var _=require(_0x97a5('0xa'));var squel=require(_0x97a5('0xb'));var crypto=require(_0x97a5('0xc'));var jsforce=require(_0x97a5('0xd'));var deskjs=require(_0x97a5('0xe'));var toCsv=require(_0x97a5('0x8'));var querystring=require('querystring');var Papa=require(_0x97a5('0xf'));var Redis=require(_0x97a5('0x10'));var authService=require(_0x97a5('0x11'));var qs=require(_0x97a5('0x12'));var as=require(_0x97a5('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x97a5('0x14'));var utils=require(_0x97a5('0x15'));var config=require(_0x97a5('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x97a5('0x17'))['db'];function respondWithStatusCode(_0x350720,_0x55305a){_0x55305a=_0x55305a||0xcc;return function(_0x4f85a0){if(_0x4f85a0){return _0x350720[_0x97a5('0x18')](_0x55305a);}return _0x350720[_0x97a5('0x19')](_0x55305a)['end']();};}function respondWithResult(_0x595437,_0x51d5e2){_0x51d5e2=_0x51d5e2||0xc8;return function(_0x5a4471){if(_0x5a4471){return _0x595437[_0x97a5('0x19')](_0x51d5e2)[_0x97a5('0x1a')](_0x5a4471);}};}function respondWithFilteredResult(_0x3603e4,_0x4d8ba7){return function(_0x1a7a62){if(_0x1a7a62){var _0x3fa986=typeof _0x4d8ba7['offset']===_0x97a5('0x1b')&&typeof _0x4d8ba7['limit']===_0x97a5('0x1b');var _0x55071b=_0x1a7a62['count'];var _0x52ce92=_0x3fa986?0x0:_0x4d8ba7[_0x97a5('0x1c')];var _0x5c5740=_0x3fa986?_0x1a7a62[_0x97a5('0x1d')]:_0x4d8ba7[_0x97a5('0x1c')]+_0x4d8ba7[_0x97a5('0x1e')];var _0x1efe8c;if(_0x5c5740>=_0x55071b){_0x5c5740=_0x55071b;_0x1efe8c=0xc8;}else{_0x1efe8c=0xce;}_0x3603e4['status'](_0x1efe8c);return _0x3603e4['set'](_0x97a5('0x1f'),_0x52ce92+'-'+_0x5c5740+'/'+_0x55071b)[_0x97a5('0x1a')](_0x1a7a62);}return null;};}function patchUpdates(_0x4e3386){return function(_0x51858b){try{jsonpatch[_0x97a5('0x20')](_0x51858b,_0x4e3386,!![]);}catch(_0x3d7dba){return BPromise[_0x97a5('0x21')](_0x3d7dba);}return _0x51858b['save']();};}function saveUpdates(_0x34fb55,_0x3a5849){return function(_0x23f4f8){if(_0x23f4f8){return _0x23f4f8['update'](_0x34fb55)[_0x97a5('0x22')](function(_0x33d6da){return _0x33d6da;});}return null;};}function removeEntity(_0x4e2074,_0x5e731e){return function(_0x469592){if(_0x469592){return _0x469592[_0x97a5('0x23')]()[_0x97a5('0x22')](function(){_0x4e2074[_0x97a5('0x19')](0xcc)[_0x97a5('0x24')]();});}};}function handleEntityNotFound(_0x302d78,_0xf7ad1e){return function(_0x4743e0){if(!_0x4743e0){_0x302d78['sendStatus'](0x194);}return _0x4743e0;};}function handleError(_0x2038dd,_0x46ee45){_0x46ee45=_0x46ee45||0x1f4;return function(_0x2ca97c){logger[_0x97a5('0x25')](_0x2ca97c[_0x97a5('0x26')]);if(_0x2ca97c[_0x97a5('0x27')]){delete _0x2ca97c['name'];}_0x2038dd[_0x97a5('0x19')](_0x46ee45)[_0x97a5('0x28')](_0x2ca97c);};}exports['index']=function(_0x274ccb,_0x52248f){var _0x48f1c1={},_0x1bdb74={},_0x2eaae4={'count':0x0,'rows':[]};var _0x5c1c67=_[_0x97a5('0x29')](db['Cdr'][_0x97a5('0x2a')],function(_0x3c5d02){return{'name':_0x3c5d02[_0x97a5('0x2b')],'type':_0x3c5d02[_0x97a5('0x2c')]['key']};});_0x1bdb74['model']=_[_0x97a5('0x29')](_0x5c1c67,_0x97a5('0x27'));_0x1bdb74[_0x97a5('0x2d')]=_['keys'](_0x274ccb[_0x97a5('0x2d')]);_0x1bdb74[_0x97a5('0x2e')]=_['intersection'](_0x1bdb74[_0x97a5('0x2f')],_0x1bdb74[_0x97a5('0x2d')]);_0x48f1c1['attributes']=_[_0x97a5('0x30')](_0x1bdb74[_0x97a5('0x2f')],qs[_0x97a5('0x31')](_0x274ccb['query'][_0x97a5('0x31')]));_0x48f1c1[_0x97a5('0x32')]=_0x48f1c1[_0x97a5('0x32')][_0x97a5('0x33')]?_0x48f1c1[_0x97a5('0x32')]:_0x1bdb74[_0x97a5('0x2f')];if(!_0x274ccb[_0x97a5('0x2d')]['hasOwnProperty'](_0x97a5('0x34'))){_0x48f1c1[_0x97a5('0x1e')]=qs[_0x97a5('0x1e')](_0x274ccb[_0x97a5('0x2d')][_0x97a5('0x1e')]);_0x48f1c1[_0x97a5('0x1c')]=qs[_0x97a5('0x1c')](_0x274ccb[_0x97a5('0x2d')][_0x97a5('0x1c')]);}_0x48f1c1[_0x97a5('0x35')]=qs[_0x97a5('0x36')](_0x274ccb[_0x97a5('0x2d')][_0x97a5('0x36')]);_0x48f1c1['where']=qs[_0x97a5('0x2e')](_[_0x97a5('0x37')](_0x274ccb[_0x97a5('0x2d')],_0x1bdb74[_0x97a5('0x2e')]),_0x5c1c67);if(_0x274ccb[_0x97a5('0x2d')]['filter']){_0x48f1c1['where']=_[_0x97a5('0x38')](_0x48f1c1[_0x97a5('0x39')],{'$or':_[_0x97a5('0x29')](_0x5c1c67,function(_0x45a548){if(_0x45a548[_0x97a5('0x2c')]!==_0x97a5('0x3a')){var _0x57333b={};_0x57333b[_0x45a548[_0x97a5('0x27')]]={'$like':'%'+_0x274ccb['query'][_0x97a5('0x3b')]+'%'};return _0x57333b;}})});}_0x48f1c1=_[_0x97a5('0x38')]({},_0x48f1c1,_0x274ccb[_0x97a5('0x3c')]);var _0x798318={'where':_0x48f1c1[_0x97a5('0x39')]};return db['Cdr'][_0x97a5('0x1d')](_0x798318)[_0x97a5('0x22')](function(_0x64505){_0x2eaae4[_0x97a5('0x1d')]=_0x64505;if(_0x274ccb[_0x97a5('0x2d')]['includeAll']){_0x48f1c1['include']=[{'all':!![]}];}return db[_0x97a5('0x3d')][_0x97a5('0x3e')](_0x48f1c1);})[_0x97a5('0x22')](function(_0x20dbc6){_0x2eaae4['rows']=_0x20dbc6;return _0x2eaae4;})[_0x97a5('0x22')](respondWithFilteredResult(_0x52248f,_0x48f1c1))['catch'](handleError(_0x52248f,null));};exports[_0x97a5('0x3f')]=function(_0x331108,_0x111e72){var _0x5baf77={'raw':!![],'where':{'id':_0x331108[_0x97a5('0x40')]['id']}},_0xefb019={};_0xefb019['model']=_[_0x97a5('0x41')](db[_0x97a5('0x3d')][_0x97a5('0x2a')]);_0xefb019[_0x97a5('0x2d')]=_[_0x97a5('0x41')](_0x331108[_0x97a5('0x2d')]);_0xefb019[_0x97a5('0x2e')]=_[_0x97a5('0x30')](_0xefb019[_0x97a5('0x2f')],_0xefb019[_0x97a5('0x2d')]);_0x5baf77[_0x97a5('0x32')]=_[_0x97a5('0x30')](_0xefb019['model'],qs[_0x97a5('0x31')](_0x331108[_0x97a5('0x2d')][_0x97a5('0x31')]));_0x5baf77['attributes']=_0x5baf77[_0x97a5('0x32')][_0x97a5('0x33')]?_0x5baf77[_0x97a5('0x32')]:_0xefb019[_0x97a5('0x2f')];if(_0x331108[_0x97a5('0x2d')]['includeAll']){_0x5baf77[_0x97a5('0x42')]=[{'all':!![]}];}_0x5baf77=_[_0x97a5('0x38')]({},_0x5baf77,_0x331108[_0x97a5('0x3c')]);return db[_0x97a5('0x3d')][_0x97a5('0x43')](_0x5baf77)['then'](handleEntityNotFound(_0x111e72,null))[_0x97a5('0x22')](respondWithResult(_0x111e72,null))['catch'](handleError(_0x111e72,null));};exports[_0x97a5('0x44')]=function(_0x235f9d,_0x330f6a){return db['Cdr'][_0x97a5('0x44')](_0x235f9d[_0x97a5('0x45')],{})[_0x97a5('0x22')](respondWithResult(_0x330f6a,0xc9))[_0x97a5('0x46')](handleError(_0x330f6a,null));};exports[_0x97a5('0x47')]=function(_0x42ced6,_0x49b215){if(_0x42ced6[_0x97a5('0x45')]['id']){delete _0x42ced6[_0x97a5('0x45')]['id'];}return db[_0x97a5('0x3d')][_0x97a5('0x43')]({'where':{'id':_0x42ced6['params']['id']}})[_0x97a5('0x22')](handleEntityNotFound(_0x49b215,null))[_0x97a5('0x22')](saveUpdates(_0x42ced6['body'],null))[_0x97a5('0x22')](respondWithResult(_0x49b215,null))[_0x97a5('0x46')](handleError(_0x49b215,null));};exports[_0x97a5('0x23')]=function(_0x56890f,_0x2a6fa0){return db[_0x97a5('0x3d')]['find']({'where':{'id':_0x56890f[_0x97a5('0x40')]['id']}})[_0x97a5('0x22')](handleEntityNotFound(_0x2a6fa0,null))[_0x97a5('0x22')](removeEntity(_0x2a6fa0,null))['catch'](handleError(_0x2a6fa0,null));};exports[_0x97a5('0x48')]=function(_0xc3c9e5,_0x7adad){return db['Cdr']['describe']()[_0x97a5('0x22')](respondWithResult(_0x7adad,null))[_0x97a5('0x46')](handleError(_0x7adad,null));}; \ No newline at end of file +var _0xc492=['findAll','rows','catch','params','includeAll','find','body','describe','eml-format','rimraf','zip-dir','moment','util','path','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','index','map','Cdr','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','include'];(function(_0x5da9e1,_0xc580f8){var _0x21a139=function(_0x35b0cd){while(--_0x35b0cd){_0x5da9e1['push'](_0x5da9e1['shift']());}};_0x21a139(++_0xc580f8);}(_0xc492,0xd7));var _0x2c49=function(_0x38d465,_0x5ba8f2){_0x38d465=_0x38d465-0x0;var _0x3056d1=_0xc492[_0x38d465];return _0x3056d1;};'use strict';var emlformat=require(_0x2c49('0x0'));var rimraf=require(_0x2c49('0x1'));var zipdir=require(_0x2c49('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x2c49('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x2c49('0x4'));var path=require(_0x2c49('0x5'));var sox=require('sox');var csv=require(_0x2c49('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2c49('0x7'));var _=require(_0x2c49('0x8'));var squel=require('squel');var crypto=require(_0x2c49('0x9'));var jsforce=require(_0x2c49('0xa'));var deskjs=require(_0x2c49('0xb'));var toCsv=require(_0x2c49('0x6'));var querystring=require(_0x2c49('0xc'));var Papa=require('papaparse');var Redis=require(_0x2c49('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x2c49('0xe'))('api');var utils=require(_0x2c49('0xf'));var config=require(_0x2c49('0x10'));var licenseUtil=require('../../config/license/util');var db=require(_0x2c49('0x11'))['db'];function respondWithStatusCode(_0x1cc78b,_0x19f7d9){_0x19f7d9=_0x19f7d9||0xcc;return function(_0x1e2210){if(_0x1e2210){return _0x1cc78b[_0x2c49('0x12')](_0x19f7d9);}return _0x1cc78b[_0x2c49('0x13')](_0x19f7d9)['end']();};}function respondWithResult(_0x2006cf,_0x5af5e7){_0x5af5e7=_0x5af5e7||0xc8;return function(_0x2eeb10){if(_0x2eeb10){return _0x2006cf[_0x2c49('0x13')](_0x5af5e7)[_0x2c49('0x14')](_0x2eeb10);}};}function respondWithFilteredResult(_0x561d83,_0x19f59b){return function(_0x385724){if(_0x385724){var _0x30da01=typeof _0x19f59b[_0x2c49('0x15')]===_0x2c49('0x16')&&typeof _0x19f59b[_0x2c49('0x17')]===_0x2c49('0x16');var _0x2e2e07=_0x385724[_0x2c49('0x18')];var _0x89bcb=_0x30da01?0x0:_0x19f59b['offset'];var _0x3001af=_0x30da01?_0x385724[_0x2c49('0x18')]:_0x19f59b[_0x2c49('0x15')]+_0x19f59b[_0x2c49('0x17')];var _0x4793d5;if(_0x3001af>=_0x2e2e07){_0x3001af=_0x2e2e07;_0x4793d5=0xc8;}else{_0x4793d5=0xce;}_0x561d83[_0x2c49('0x13')](_0x4793d5);return _0x561d83['set'](_0x2c49('0x19'),_0x89bcb+'-'+_0x3001af+'/'+_0x2e2e07)[_0x2c49('0x14')](_0x385724);}return null;};}function patchUpdates(_0x573157){return function(_0x4b8f61){try{jsonpatch[_0x2c49('0x1a')](_0x4b8f61,_0x573157,!![]);}catch(_0x3bda90){return BPromise[_0x2c49('0x1b')](_0x3bda90);}return _0x4b8f61[_0x2c49('0x1c')]();};}function saveUpdates(_0x202205,_0x294c70){return function(_0x33c09f){if(_0x33c09f){return _0x33c09f[_0x2c49('0x1d')](_0x202205)[_0x2c49('0x1e')](function(_0x54fe21){return _0x54fe21;});}return null;};}function removeEntity(_0x14ca06,_0x20f3bf){return function(_0x4037b0){if(_0x4037b0){return _0x4037b0[_0x2c49('0x1f')]()['then'](function(){_0x14ca06[_0x2c49('0x13')](0xcc)[_0x2c49('0x20')]();});}};}function handleEntityNotFound(_0x3a35b4,_0x2a9109){return function(_0x59c061){if(!_0x59c061){_0x3a35b4[_0x2c49('0x12')](0x194);}return _0x59c061;};}function handleError(_0x18a41e,_0x25bf3d){_0x25bf3d=_0x25bf3d||0x1f4;return function(_0x50da06){logger[_0x2c49('0x21')](_0x50da06[_0x2c49('0x22')]);if(_0x50da06['name']){delete _0x50da06[_0x2c49('0x23')];}_0x18a41e['status'](_0x25bf3d)['send'](_0x50da06);};}exports[_0x2c49('0x24')]=function(_0x4d2564,_0x5c4fb1){var _0x4d9334={},_0x433503={},_0x7b8d75={'count':0x0,'rows':[]};var _0x2b2dd5=_[_0x2c49('0x25')](db[_0x2c49('0x26')][_0x2c49('0x27')],function(_0x131c06){return{'name':_0x131c06[_0x2c49('0x28')],'type':_0x131c06[_0x2c49('0x29')][_0x2c49('0x2a')]};});_0x433503['model']=_[_0x2c49('0x25')](_0x2b2dd5,'name');_0x433503[_0x2c49('0x2b')]=_[_0x2c49('0x2c')](_0x4d2564[_0x2c49('0x2b')]);_0x433503[_0x2c49('0x2d')]=_[_0x2c49('0x2e')](_0x433503[_0x2c49('0x2f')],_0x433503[_0x2c49('0x2b')]);_0x4d9334[_0x2c49('0x30')]=_[_0x2c49('0x2e')](_0x433503[_0x2c49('0x2f')],qs[_0x2c49('0x31')](_0x4d2564[_0x2c49('0x2b')][_0x2c49('0x31')]));_0x4d9334[_0x2c49('0x30')]=_0x4d9334['attributes']['length']?_0x4d9334[_0x2c49('0x30')]:_0x433503[_0x2c49('0x2f')];if(!_0x4d2564['query'][_0x2c49('0x32')](_0x2c49('0x33'))){_0x4d9334[_0x2c49('0x17')]=qs[_0x2c49('0x17')](_0x4d2564[_0x2c49('0x2b')][_0x2c49('0x17')]);_0x4d9334[_0x2c49('0x15')]=qs[_0x2c49('0x15')](_0x4d2564['query'][_0x2c49('0x15')]);}_0x4d9334[_0x2c49('0x34')]=qs['sort'](_0x4d2564[_0x2c49('0x2b')][_0x2c49('0x35')]);_0x4d9334[_0x2c49('0x36')]=qs['filters'](_[_0x2c49('0x37')](_0x4d2564[_0x2c49('0x2b')],_0x433503[_0x2c49('0x2d')]),_0x2b2dd5);if(_0x4d2564[_0x2c49('0x2b')][_0x2c49('0x38')]){_0x4d9334[_0x2c49('0x36')]=_['merge'](_0x4d9334[_0x2c49('0x36')],{'$or':_[_0x2c49('0x25')](_0x2b2dd5,function(_0x4cbfe4){if(_0x4cbfe4[_0x2c49('0x29')]!==_0x2c49('0x39')){var _0x52f123={};_0x52f123[_0x4cbfe4[_0x2c49('0x23')]]={'$like':'%'+_0x4d2564['query'][_0x2c49('0x38')]+'%'};return _0x52f123;}})});}_0x4d9334=_[_0x2c49('0x3a')]({},_0x4d9334,_0x4d2564[_0x2c49('0x3b')]);var _0x5a6822={'where':_0x4d9334[_0x2c49('0x36')]};return db['Cdr'][_0x2c49('0x18')](_0x5a6822)[_0x2c49('0x1e')](function(_0x24e53a){_0x7b8d75[_0x2c49('0x18')]=_0x24e53a;if(_0x4d2564[_0x2c49('0x2b')]['includeAll']){_0x4d9334[_0x2c49('0x3c')]=[{'all':!![]}];}return db[_0x2c49('0x26')][_0x2c49('0x3d')](_0x4d9334);})[_0x2c49('0x1e')](function(_0x251c8d){_0x7b8d75[_0x2c49('0x3e')]=_0x251c8d;return _0x7b8d75;})[_0x2c49('0x1e')](respondWithFilteredResult(_0x5c4fb1,_0x4d9334))[_0x2c49('0x3f')](handleError(_0x5c4fb1,null));};exports['show']=function(_0xa912b8,_0x30e892){var _0x5b1ee0={'raw':!![],'where':{'id':_0xa912b8[_0x2c49('0x40')]['id']}},_0x2a21b9={};_0x2a21b9['model']=_[_0x2c49('0x2c')](db['Cdr']['rawAttributes']);_0x2a21b9['query']=_['keys'](_0xa912b8[_0x2c49('0x2b')]);_0x2a21b9[_0x2c49('0x2d')]=_[_0x2c49('0x2e')](_0x2a21b9[_0x2c49('0x2f')],_0x2a21b9[_0x2c49('0x2b')]);_0x5b1ee0['attributes']=_['intersection'](_0x2a21b9['model'],qs['fields'](_0xa912b8[_0x2c49('0x2b')]['fields']));_0x5b1ee0[_0x2c49('0x30')]=_0x5b1ee0['attributes']['length']?_0x5b1ee0['attributes']:_0x2a21b9[_0x2c49('0x2f')];if(_0xa912b8['query'][_0x2c49('0x41')]){_0x5b1ee0[_0x2c49('0x3c')]=[{'all':!![]}];}_0x5b1ee0=_['merge']({},_0x5b1ee0,_0xa912b8['options']);return db[_0x2c49('0x26')][_0x2c49('0x42')](_0x5b1ee0)[_0x2c49('0x1e')](handleEntityNotFound(_0x30e892,null))[_0x2c49('0x1e')](respondWithResult(_0x30e892,null))[_0x2c49('0x3f')](handleError(_0x30e892,null));};exports['create']=function(_0x50dce4,_0x426c8a){return db[_0x2c49('0x26')]['create'](_0x50dce4['body'],{})['then'](respondWithResult(_0x426c8a,0xc9))[_0x2c49('0x3f')](handleError(_0x426c8a,null));};exports[_0x2c49('0x1d')]=function(_0x98fc90,_0x55e4cd){if(_0x98fc90[_0x2c49('0x43')]['id']){delete _0x98fc90[_0x2c49('0x43')]['id'];}return db[_0x2c49('0x26')][_0x2c49('0x42')]({'where':{'id':_0x98fc90[_0x2c49('0x40')]['id']}})[_0x2c49('0x1e')](handleEntityNotFound(_0x55e4cd,null))[_0x2c49('0x1e')](saveUpdates(_0x98fc90['body'],null))['then'](respondWithResult(_0x55e4cd,null))['catch'](handleError(_0x55e4cd,null));};exports[_0x2c49('0x1f')]=function(_0x1aa034,_0x5385e5){return db[_0x2c49('0x26')][_0x2c49('0x42')]({'where':{'id':_0x1aa034[_0x2c49('0x40')]['id']}})[_0x2c49('0x1e')](handleEntityNotFound(_0x5385e5,null))[_0x2c49('0x1e')](removeEntity(_0x5385e5,null))[_0x2c49('0x3f')](handleError(_0x5385e5,null));};exports[_0x2c49('0x44')]=function(_0x11878d,_0x331519){return db[_0x2c49('0x26')]['describe']()[_0x2c49('0x1e')](respondWithResult(_0x331519,null))[_0x2c49('0x3f')](handleError(_0x331519,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index 526a101..0bc5f16 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(_0x3bbce0,_0x1a8d2c){var _0x40a716=function(_0x28c470){while(--_0x28c470){_0x3bbce0['push'](_0x3bbce0['shift']());}};_0x40a716(++_0x1a8d2c);}(_0x7a54,0x106));var _0x47a5=function(_0x26ac6e,_0xb38c5e){_0x26ac6e=_0x26ac6e-0x0;var _0x275731=_0x7a54[_0x26ac6e];return _0x275731;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});}; \ No newline at end of file +var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x9fbc99,_0x4a758f){var _0x15b10e=function(_0x2a1203){while(--_0x2a1203){_0x9fbc99['push'](_0x9fbc99['shift']());}};_0x15b10e(++_0x4a758f);}(_0x7a54,0x106));var _0x47a5=function(_0x462f99,_0xf86909){_0x462f99=_0x462f99-0x0;var _0x40977e=_0x7a54[_0x462f99];return _0x40977e;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js index 88064a0..c1b4a01 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 _0x3e55=['code','Cdr,\x20%s,\x20%s','message','result','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0xd4fcd0,_0x10ed9c){var _0x841d2=function(_0x5e6054){while(--_0x5e6054){_0xd4fcd0['push'](_0xd4fcd0['shift']());}};_0x841d2(++_0x10ed9c);}(_0x3e55,0x9e));var _0x53e5=function(_0x333690,_0x33b5cb){_0x333690=_0x333690-0x0;var _0x33b681=_0x3e55[_0x333690];return _0x33b681;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x53e5('0x0'));var BPromise=require(_0x53e5('0x1'));var rs=require(_0x53e5('0x2'));var fs=require('fs');var Redis=require(_0x53e5('0x3'));var db=require(_0x53e5('0x4'))['db'];var utils=require(_0x53e5('0x5'));var logger=require('../../config/logger')(_0x53e5('0x6'));var config=require('../../config/environment');var jayson=require(_0x53e5('0x7'));var client=jayson[_0x53e5('0x8')][_0x53e5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1a1158,_0x44b561,_0x4479cd){return new BPromise(function(_0x5f33ad,_0x11fa2c){return client[_0x53e5('0xa')](_0x1a1158,_0x4479cd)[_0x53e5('0xb')](function(_0x195d2f){logger[_0x53e5('0xc')]('Cdr,\x20%s,\x20%s',_0x44b561,_0x53e5('0xd'));logger[_0x53e5('0xe')](_0x53e5('0xf'),_0x44b561,'request\x20sent',JSON[_0x53e5('0x10')](_0x195d2f));if(_0x195d2f[_0x53e5('0x11')]){if(_0x195d2f[_0x53e5('0x11')][_0x53e5('0x12')]===0x1f4){logger['error'](_0x53e5('0x13'),_0x44b561,_0x195d2f[_0x53e5('0x11')][_0x53e5('0x14')]);return _0x11fa2c(_0x195d2f['error'][_0x53e5('0x14')]);}logger[_0x53e5('0x11')](_0x53e5('0x13'),_0x44b561,_0x195d2f[_0x53e5('0x11')]['message']);return _0x5f33ad(_0x195d2f[_0x53e5('0x11')]['message']);}else{logger['info']('Cdr,\x20%s,\x20%s',_0x44b561,_0x53e5('0xd'));_0x5f33ad(_0x195d2f[_0x53e5('0x15')][_0x53e5('0x14')]);}})['catch'](function(_0x20393e){logger[_0x53e5('0x11')](_0x53e5('0x13'),_0x44b561,_0x20393e);_0x11fa2c(_0x20393e);});});} \ No newline at end of file +var _0x24ed=['rpc','client','http','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util','randomstring','ioredis','../../config/logger'];(function(_0x445819,_0x11b666){var _0x160c43=function(_0x22e9fa){while(--_0x22e9fa){_0x445819['push'](_0x445819['shift']());}};_0x160c43(++_0x11b666);}(_0x24ed,0x19d));var _0xd24e=function(_0x2127c7,_0x1d65c1){_0x2127c7=_0x2127c7-0x0;var _0x57f014=_0x24ed[_0x2127c7];return _0x57f014;};'use strict';var _=require(_0xd24e('0x0'));var util=require(_0xd24e('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xd24e('0x2'));var fs=require('fs');var Redis=require(_0xd24e('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xd24e('0x4'))(_0xd24e('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xd24e('0x6')][_0xd24e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x350315,_0x2b77da,_0x35a09f){return new BPromise(function(_0x14b35b,_0x333eca){return client[_0xd24e('0x8')](_0x350315,_0x35a09f)[_0xd24e('0x9')](function(_0x1f8a7a){logger[_0xd24e('0xa')](_0xd24e('0xb'),_0x2b77da,_0xd24e('0xc'));logger[_0xd24e('0xd')]('Cdr,\x20%s,\x20%s,\x20%s',_0x2b77da,_0xd24e('0xc'),JSON[_0xd24e('0xe')](_0x1f8a7a));if(_0x1f8a7a[_0xd24e('0xf')]){if(_0x1f8a7a[_0xd24e('0xf')][_0xd24e('0x10')]===0x1f4){logger[_0xd24e('0xf')](_0xd24e('0xb'),_0x2b77da,_0x1f8a7a[_0xd24e('0xf')][_0xd24e('0x11')]);return _0x333eca(_0x1f8a7a[_0xd24e('0xf')][_0xd24e('0x11')]);}logger['error'](_0xd24e('0xb'),_0x2b77da,_0x1f8a7a[_0xd24e('0xf')]['message']);return _0x14b35b(_0x1f8a7a[_0xd24e('0xf')][_0xd24e('0x11')]);}else{logger['info'](_0xd24e('0xb'),_0x2b77da,_0xd24e('0xc'));_0x14b35b(_0x1f8a7a[_0xd24e('0x12')][_0xd24e('0x11')]);}})['catch'](function(_0x38d987){logger[_0xd24e('0xf')]('Cdr,\x20%s,\x20%s',_0x2b77da,_0x38d987);_0x333eca(_0x38d987);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index 0e8b163..53e8b8b 100644 --- a/server/api/cdr/index.js +++ b/server/api/cdr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x39eaf1,_0x56f6b9){var _0x116705=function(_0x242c21){while(--_0x242c21){_0x39eaf1['push'](_0x39eaf1['shift']());}};_0x116705(++_0x56f6b9);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file +var _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(_0x14bf66,_0x3e1066){var _0xaf4bf7=function(_0x3d9c3f){while(--_0x3d9c3f){_0x14bf66['push'](_0x14bf66['shift']());}};_0xaf4bf7(++_0x3e1066);}(_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 e844475..47ac788 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 _0xdb9c=['TEXT','exports','STRING'];(function(_0x534027,_0x381ca3){var _0x2c8b53=function(_0x3f8343){while(--_0x3f8343){_0x534027['push'](_0x534027['shift']());}};_0x2c8b53(++_0x381ca3);}(_0xdb9c,0x1cf));var _0xcdb9=function(_0x21a897,_0xfde1f8){_0x21a897=_0x21a897-0x0;var _0x1d841c=_0xdb9c[_0x21a897];return _0x1d841c;};'use strict';var Sequelize=require('sequelize');module[_0xcdb9('0x0')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xcdb9('0x1')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xcdb9('0x2')]()},'description':{'type':Sequelize[_0xcdb9('0x1')]},'interval':{'type':Sequelize[_0xcdb9('0x1')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0xfe16=['exports','STRING','noop','TEXT','sequelize'];(function(_0x1efb7e,_0x50cfa0){var _0x27aa56=function(_0x53fb85){while(--_0x53fb85){_0x1efb7e['push'](_0x1efb7e['shift']());}};_0x27aa56(++_0x50cfa0);}(_0xfe16,0x1bc));var _0x6fe1=function(_0x272786,_0x1e2aec){_0x272786=_0x272786-0x0;var _0x42bb92=_0xfe16[_0x272786];return _0x42bb92;};'use strict';var Sequelize=require(_0x6fe1('0x0'));module[_0x6fe1('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x6fe1('0x2')],'allowNull':![],'defaultValue':_0x6fe1('0x3')},'appdata':{'type':Sequelize[_0x6fe1('0x4')]()},'description':{'type':Sequelize[_0x6fe1('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index e3cf006..ec9704a 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 _0x847d=['sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save','update','then','destroy','error','name','send','show','keys','ChatApplication','rawAttributes','query','filters','intersection','model','attributes','fields','length','includeAll','merge','find','catch','body','params','rimraf','zip-dir','fast-json-patch','moment','mustache','util'];(function(_0x210d00,_0x2a89a3){var _0x53db70=function(_0x5655d1){while(--_0x5655d1){_0x210d00['push'](_0x210d00['shift']());}};_0x53db70(++_0x2a89a3);}(_0x847d,0x14a));var _0xd847=function(_0x466af7,_0x2f7551){_0x466af7=_0x466af7-0x0;var _0x348c96=_0x847d[_0x466af7];return _0x348c96;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd847('0x0'));var zipdir=require(_0xd847('0x1'));var jsonpatch=require(_0xd847('0x2'));var rp=require('request-promise');var moment=require(_0xd847('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xd847('0x4'));var util=require(_0xd847('0x5'));var path=require('path');var sox=require(_0xd847('0x6'));var csv=require(_0xd847('0x7'));var ejs=require(_0xd847('0x8'));var fs=require('fs');var fs_extra=require(_0xd847('0x9'));var _=require('lodash');var squel=require(_0xd847('0xa'));var crypto=require(_0xd847('0xb'));var jsforce=require(_0xd847('0xc'));var deskjs=require(_0xd847('0xd'));var toCsv=require(_0xd847('0x7'));var querystring=require(_0xd847('0xe'));var Papa=require(_0xd847('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd847('0x10'));var logger=require(_0xd847('0x11'))(_0xd847('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xd847('0x13'));var db=require(_0xd847('0x14'))['db'];function respondWithStatusCode(_0x344d39,_0x2ea8e7){_0x2ea8e7=_0x2ea8e7||0xcc;return function(_0x1e4e26){if(_0x1e4e26){return _0x344d39[_0xd847('0x15')](_0x2ea8e7);}return _0x344d39[_0xd847('0x16')](_0x2ea8e7)[_0xd847('0x17')]();};}function respondWithResult(_0x1c827a,_0x2faa39){_0x2faa39=_0x2faa39||0xc8;return function(_0x3c4805){if(_0x3c4805){return _0x1c827a['status'](_0x2faa39)[_0xd847('0x18')](_0x3c4805);}};}function respondWithFilteredResult(_0x165fbe,_0xd69fc9){return function(_0x404bdb){if(_0x404bdb){var _0x16c79a=typeof _0xd69fc9['offset']===_0xd847('0x19')&&typeof _0xd69fc9[_0xd847('0x1a')]===_0xd847('0x19');var _0x1a01ad=_0x404bdb['count'];var _0x1ef765=_0x16c79a?0x0:_0xd69fc9['offset'];var _0x4b6264=_0x16c79a?_0x404bdb[_0xd847('0x1b')]:_0xd69fc9[_0xd847('0x1c')]+_0xd69fc9[_0xd847('0x1a')];var _0x3905b8;if(_0x4b6264>=_0x1a01ad){_0x4b6264=_0x1a01ad;_0x3905b8=0xc8;}else{_0x3905b8=0xce;}_0x165fbe['status'](_0x3905b8);return _0x165fbe[_0xd847('0x1d')]('Content-Range',_0x1ef765+'-'+_0x4b6264+'/'+_0x1a01ad)['json'](_0x404bdb);}return null;};}function patchUpdates(_0x25e139){return function(_0x2c1091){try{jsonpatch[_0xd847('0x1e')](_0x2c1091,_0x25e139,!![]);}catch(_0x2a57df){return BPromise[_0xd847('0x1f')](_0x2a57df);}return _0x2c1091[_0xd847('0x20')]();};}function saveUpdates(_0x1490a1,_0x39c465){return function(_0x1eaf08){if(_0x1eaf08){return _0x1eaf08[_0xd847('0x21')](_0x1490a1)[_0xd847('0x22')](function(_0x3795fc){return _0x3795fc;});}return null;};}function removeEntity(_0x4a1691,_0x560563){return function(_0x26a787){if(_0x26a787){return _0x26a787[_0xd847('0x23')]()[_0xd847('0x22')](function(){_0x4a1691['status'](0xcc)[_0xd847('0x17')]();});}};}function handleEntityNotFound(_0x246920,_0x74bf0e){return function(_0x64b701){if(!_0x64b701){_0x246920[_0xd847('0x15')](0x194);}return _0x64b701;};}function handleError(_0x5b8e2a,_0x24793c){_0x24793c=_0x24793c||0x1f4;return function(_0x460eba){logger[_0xd847('0x24')](_0x460eba['stack']);if(_0x460eba[_0xd847('0x25')]){delete _0x460eba[_0xd847('0x25')];}_0x5b8e2a[_0xd847('0x16')](_0x24793c)[_0xd847('0x26')](_0x460eba);};}exports[_0xd847('0x27')]=function(_0x3301cd,_0x5c0099){var _0x1e6119={'raw':!![],'where':{'id':_0x3301cd['params']['id']}},_0x5375fe={};_0x5375fe['model']=_[_0xd847('0x28')](db[_0xd847('0x29')][_0xd847('0x2a')]);_0x5375fe[_0xd847('0x2b')]=_[_0xd847('0x28')](_0x3301cd[_0xd847('0x2b')]);_0x5375fe[_0xd847('0x2c')]=_[_0xd847('0x2d')](_0x5375fe[_0xd847('0x2e')],_0x5375fe[_0xd847('0x2b')]);_0x1e6119[_0xd847('0x2f')]=_[_0xd847('0x2d')](_0x5375fe['model'],qs['fields'](_0x3301cd[_0xd847('0x2b')][_0xd847('0x30')]));_0x1e6119[_0xd847('0x2f')]=_0x1e6119[_0xd847('0x2f')][_0xd847('0x31')]?_0x1e6119['attributes']:_0x5375fe[_0xd847('0x2e')];if(_0x3301cd['query'][_0xd847('0x32')]){_0x1e6119['include']=[{'all':!![]}];}_0x1e6119=_[_0xd847('0x33')]({},_0x1e6119,_0x3301cd['options']);return db[_0xd847('0x29')][_0xd847('0x34')](_0x1e6119)['then'](handleEntityNotFound(_0x5c0099,null))['then'](respondWithResult(_0x5c0099,null))[_0xd847('0x35')](handleError(_0x5c0099,null));};exports[_0xd847('0x21')]=function(_0x429bb5,_0x2d2c94){if(_0x429bb5[_0xd847('0x36')]['id']){delete _0x429bb5[_0xd847('0x36')]['id'];}return db['ChatApplication']['find']({'where':{'id':_0x429bb5[_0xd847('0x37')]['id']}})[_0xd847('0x22')](handleEntityNotFound(_0x2d2c94,null))[_0xd847('0x22')](saveUpdates(_0x429bb5['body'],null))[_0xd847('0x22')](respondWithResult(_0x2d2c94,null))[_0xd847('0x35')](handleError(_0x2d2c94,null));};exports['destroy']=function(_0x547794,_0x3e5590){return db['ChatApplication'][_0xd847('0x34')]({'where':{'id':_0x547794[_0xd847('0x37')]['id']}})[_0xd847('0x22')](handleEntityNotFound(_0x3e5590,null))['then'](removeEntity(_0x3e5590,null))['catch'](handleError(_0x3e5590,null));}; \ No newline at end of file +var _0x30fe=['jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','offset','limit','count','status','Content-Range','json','apply','reject','update','then','destroy','error','stack','name','send','model','keys','ChatApplication','rawAttributes','query','filters','attributes','intersection','fields','includeAll','merge','options','find','catch','body','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x30fe,0x149));var _0xe30f=function(_0x86e191,_0x585a70){_0x86e191=_0x86e191-0x0;var _0x286b0b=_0x30fe[_0x86e191];return _0x286b0b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe30f('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe30f('0x1'));var rp=require('request-promise');var moment=require(_0xe30f('0x2'));var BPromise=require(_0xe30f('0x3'));var Mustache=require(_0xe30f('0x4'));var util=require(_0xe30f('0x5'));var path=require(_0xe30f('0x6'));var sox=require('sox');var csv=require(_0xe30f('0x7'));var ejs=require(_0xe30f('0x8'));var fs=require('fs');var fs_extra=require(_0xe30f('0x9'));var _=require(_0xe30f('0xa'));var squel=require(_0xe30f('0xb'));var crypto=require(_0xe30f('0xc'));var jsforce=require(_0xe30f('0xd'));var deskjs=require(_0xe30f('0xe'));var toCsv=require(_0xe30f('0x7'));var querystring=require(_0xe30f('0xf'));var Papa=require('papaparse');var Redis=require(_0xe30f('0x10'));var authService=require(_0xe30f('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe30f('0x12'));var hardwareService=require(_0xe30f('0x13'));var logger=require(_0xe30f('0x14'))(_0xe30f('0x15'));var utils=require('../../config/utils');var config=require(_0xe30f('0x16'));var licenseUtil=require(_0xe30f('0x17'));var db=require(_0xe30f('0x18'))['db'];function respondWithStatusCode(_0x583eb9,_0x3859df){_0x3859df=_0x3859df||0xcc;return function(_0x19970e){if(_0x19970e){return _0x583eb9[_0xe30f('0x19')](_0x3859df);}return _0x583eb9['status'](_0x3859df)[_0xe30f('0x1a')]();};}function respondWithResult(_0x460e07,_0x122e2a){_0x122e2a=_0x122e2a||0xc8;return function(_0x7d684c){if(_0x7d684c){return _0x460e07['status'](_0x122e2a)['json'](_0x7d684c);}};}function respondWithFilteredResult(_0x5ac4b2,_0x3c9680){return function(_0x494ad3){if(_0x494ad3){var _0x2b6a9b=typeof _0x3c9680[_0xe30f('0x1b')]==='undefined'&&typeof _0x3c9680[_0xe30f('0x1c')]==='undefined';var _0x2dbb2b=_0x494ad3[_0xe30f('0x1d')];var _0x406c98=_0x2b6a9b?0x0:_0x3c9680[_0xe30f('0x1b')];var _0x17024a=_0x2b6a9b?_0x494ad3['count']:_0x3c9680['offset']+_0x3c9680[_0xe30f('0x1c')];var _0x535873;if(_0x17024a>=_0x2dbb2b){_0x17024a=_0x2dbb2b;_0x535873=0xc8;}else{_0x535873=0xce;}_0x5ac4b2[_0xe30f('0x1e')](_0x535873);return _0x5ac4b2['set'](_0xe30f('0x1f'),_0x406c98+'-'+_0x17024a+'/'+_0x2dbb2b)[_0xe30f('0x20')](_0x494ad3);}return null;};}function patchUpdates(_0x2c4d1f){return function(_0x2a0432){try{jsonpatch[_0xe30f('0x21')](_0x2a0432,_0x2c4d1f,!![]);}catch(_0x5b33fa){return BPromise[_0xe30f('0x22')](_0x5b33fa);}return _0x2a0432['save']();};}function saveUpdates(_0xf66c5a,_0x5af7b5){return function(_0x322ee0){if(_0x322ee0){return _0x322ee0[_0xe30f('0x23')](_0xf66c5a)[_0xe30f('0x24')](function(_0x42833a){return _0x42833a;});}return null;};}function removeEntity(_0x7f7b1f,_0x378d6f){return function(_0x50bca4){if(_0x50bca4){return _0x50bca4[_0xe30f('0x25')]()['then'](function(){_0x7f7b1f[_0xe30f('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4d4fbe,_0x4fc220){return function(_0x11a539){if(!_0x11a539){_0x4d4fbe['sendStatus'](0x194);}return _0x11a539;};}function handleError(_0x412015,_0x25e3cf){_0x25e3cf=_0x25e3cf||0x1f4;return function(_0x37c716){logger[_0xe30f('0x26')](_0x37c716[_0xe30f('0x27')]);if(_0x37c716[_0xe30f('0x28')]){delete _0x37c716['name'];}_0x412015[_0xe30f('0x1e')](_0x25e3cf)[_0xe30f('0x29')](_0x37c716);};}exports['show']=function(_0x15a217,_0x2d67d4){var _0x5a6cc3={'raw':!![],'where':{'id':_0x15a217['params']['id']}},_0x500626={};_0x500626[_0xe30f('0x2a')]=_[_0xe30f('0x2b')](db[_0xe30f('0x2c')][_0xe30f('0x2d')]);_0x500626[_0xe30f('0x2e')]=_[_0xe30f('0x2b')](_0x15a217['query']);_0x500626[_0xe30f('0x2f')]=_['intersection'](_0x500626[_0xe30f('0x2a')],_0x500626[_0xe30f('0x2e')]);_0x5a6cc3[_0xe30f('0x30')]=_[_0xe30f('0x31')](_0x500626['model'],qs[_0xe30f('0x32')](_0x15a217[_0xe30f('0x2e')][_0xe30f('0x32')]));_0x5a6cc3['attributes']=_0x5a6cc3[_0xe30f('0x30')]['length']?_0x5a6cc3[_0xe30f('0x30')]:_0x500626[_0xe30f('0x2a')];if(_0x15a217[_0xe30f('0x2e')][_0xe30f('0x33')]){_0x5a6cc3['include']=[{'all':!![]}];}_0x5a6cc3=_[_0xe30f('0x34')]({},_0x5a6cc3,_0x15a217[_0xe30f('0x35')]);return db[_0xe30f('0x2c')][_0xe30f('0x36')](_0x5a6cc3)[_0xe30f('0x24')](handleEntityNotFound(_0x2d67d4,null))[_0xe30f('0x24')](respondWithResult(_0x2d67d4,null))[_0xe30f('0x37')](handleError(_0x2d67d4,null));};exports['update']=function(_0x139915,_0xcc659c){if(_0x139915[_0xe30f('0x38')]['id']){delete _0x139915['body']['id'];}return db[_0xe30f('0x2c')][_0xe30f('0x36')]({'where':{'id':_0x139915['params']['id']}})[_0xe30f('0x24')](handleEntityNotFound(_0xcc659c,null))['then'](saveUpdates(_0x139915[_0xe30f('0x38')],null))['then'](respondWithResult(_0xcc659c,null))['catch'](handleError(_0xcc659c,null));};exports['destroy']=function(_0xf09327,_0x86fbbc){return db['ChatApplication'][_0xe30f('0x36')]({'where':{'id':_0xf09327['params']['id']}})[_0xe30f('0x24')](handleEntityNotFound(_0x86fbbc,null))[_0xe30f('0x24')](removeEntity(_0x86fbbc,null))[_0xe30f('0x37')](handleError(_0x86fbbc,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index 39a8224..36003f2 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 _0x3423=['exports','define','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x431640,_0x1bd49a){var _0xd9dd62=function(_0x418069){while(--_0x418069){_0x431640['push'](_0x431640['shift']());}};_0xd9dd62(++_0x1bd49a);}(_0x3423,0x1f0));var _0x3342=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3423[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3342('0x0'));var util=require(_0x3342('0x1'));var logger=require('../../config/logger')(_0x3342('0x2'));var moment=require(_0x3342('0x3'));var BPromise=require(_0x3342('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3342('0x5'));var rimraf=require(_0x3342('0x6'));var config=require(_0x3342('0x7'));var attributes=require('./chatApplication.attributes');module[_0x3342('0x8')]=function(_0x43d55b,_0x3a56ff){return _0x43d55b[_0x3342('0x9')](_0x3342('0xa'),attributes,{'tableName':_0x3342('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3342('0xc'),'collate':_0x3342('0xd')});}; \ No newline at end of file +var _0x8e18=['ChatApplication','utf8mb4','util','api','moment','bluebird','rimraf','../../config/environment','./chatApplication.attributes','exports','define'];(function(_0x5f0e72,_0x25c3c4){var _0x239cd6=function(_0x40b044){while(--_0x40b044){_0x5f0e72['push'](_0x5f0e72['shift']());}};_0x239cd6(++_0x25c3c4);}(_0x8e18,0x1ba));var _0x88e1=function(_0x1350d2,_0x3d09c){_0x1350d2=_0x1350d2-0x0;var _0x1c8f51=_0x8e18[_0x1350d2];return _0x1c8f51;};'use strict';var _=require('lodash');var util=require(_0x88e1('0x0'));var logger=require('../../config/logger')(_0x88e1('0x1'));var moment=require(_0x88e1('0x2'));var BPromise=require(_0x88e1('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x88e1('0x4'));var config=require(_0x88e1('0x5'));var attributes=require(_0x88e1('0x6'));module[_0x88e1('0x7')]=function(_0xf4e5e6,_0x146671){return _0xf4e5e6[_0x88e1('0x8')](_0x88e1('0x9'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x88e1('0xa'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index 03a140b..9cf7651 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 _0x21e5=['http','request','then','info','debug','ChatApplication,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','ChatApplication,\x20%s,\x20%s','message','result','catch','randomstring','ioredis','rpc','client'];(function(_0x251e8c,_0x277c33){var _0x1e0c1d=function(_0x20b89c){while(--_0x20b89c){_0x251e8c['push'](_0x251e8c['shift']());}};_0x1e0c1d(++_0x277c33);}(_0x21e5,0x172));var _0x521e=function(_0x11155f,_0x57b687){_0x11155f=_0x11155f-0x0;var _0xd07e48=_0x21e5[_0x11155f];return _0xd07e48;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x521e('0x0'));var fs=require('fs');var Redis=require(_0x521e('0x1'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x521e('0x2'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x521e('0x3')][_0x521e('0x4')]({'port':0x232a});function respondWithRpcPromise(_0x469924,_0x79be67,_0x5da1a7){return new BPromise(function(_0x465446,_0x47e015){return client[_0x521e('0x5')](_0x469924,_0x5da1a7)[_0x521e('0x6')](function(_0x3d8726){logger[_0x521e('0x7')]('ChatApplication,\x20%s,\x20%s',_0x79be67,'request\x20sent');logger[_0x521e('0x8')](_0x521e('0x9'),_0x79be67,_0x521e('0xa'),JSON['stringify'](_0x3d8726));if(_0x3d8726[_0x521e('0xb')]){if(_0x3d8726[_0x521e('0xb')][_0x521e('0xc')]===0x1f4){logger[_0x521e('0xb')](_0x521e('0xd'),_0x79be67,_0x3d8726['error'][_0x521e('0xe')]);return _0x47e015(_0x3d8726['error'][_0x521e('0xe')]);}logger[_0x521e('0xb')](_0x521e('0xd'),_0x79be67,_0x3d8726[_0x521e('0xb')][_0x521e('0xe')]);return _0x465446(_0x3d8726[_0x521e('0xb')][_0x521e('0xe')]);}else{logger['info'](_0x521e('0xd'),_0x79be67,_0x521e('0xa'));_0x465446(_0x3d8726[_0x521e('0xf')][_0x521e('0xe')]);}})[_0x521e('0x10')](function(_0x4fb816){logger['error'](_0x521e('0xd'),_0x79be67,_0x4fb816);_0x47e015(_0x4fb816);});});} \ No newline at end of file +var _0xf8bc=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result'];(function(_0x2f6c38,_0x4b067a){var _0x66279f=function(_0x13c4b5){while(--_0x13c4b5){_0x2f6c38['push'](_0x2f6c38['shift']());}};_0x66279f(++_0x4b067a);}(_0xf8bc,0x165));var _0xcf8b=function(_0x4b12ae,_0xf2b3b){_0x4b12ae=_0x4b12ae-0x0;var _0x16957b=_0xf8bc[_0x4b12ae];return _0x16957b;};'use strict';var _=require(_0xcf8b('0x0'));var util=require(_0xcf8b('0x1'));var moment=require(_0xcf8b('0x2'));var BPromise=require(_0xcf8b('0x3'));var rs=require(_0xcf8b('0x4'));var fs=require('fs');var Redis=require(_0xcf8b('0x5'));var db=require(_0xcf8b('0x6'))['db'];var utils=require(_0xcf8b('0x7'));var logger=require('../../config/logger')(_0xcf8b('0x8'));var config=require(_0xcf8b('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xcf8b('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x183078,_0x23d532,_0x454cf6){return new BPromise(function(_0x2cbe74,_0x667e2f){return client[_0xcf8b('0xb')](_0x183078,_0x454cf6)['then'](function(_0x19063e){logger[_0xcf8b('0xc')](_0xcf8b('0xd'),_0x23d532,_0xcf8b('0xe'));logger[_0xcf8b('0xf')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0x23d532,_0xcf8b('0xe'),JSON[_0xcf8b('0x10')](_0x19063e));if(_0x19063e[_0xcf8b('0x11')]){if(_0x19063e['error'][_0xcf8b('0x12')]===0x1f4){logger['error'](_0xcf8b('0xd'),_0x23d532,_0x19063e[_0xcf8b('0x11')][_0xcf8b('0x13')]);return _0x667e2f(_0x19063e[_0xcf8b('0x11')][_0xcf8b('0x13')]);}logger[_0xcf8b('0x11')](_0xcf8b('0xd'),_0x23d532,_0x19063e[_0xcf8b('0x11')][_0xcf8b('0x13')]);return _0x2cbe74(_0x19063e['error'][_0xcf8b('0x13')]);}else{logger[_0xcf8b('0xc')](_0xcf8b('0xd'),_0x23d532,'request\x20sent');_0x2cbe74(_0x19063e[_0xcf8b('0x14')][_0xcf8b('0x13')]);}})['catch'](function(_0x1f6a31){logger[_0xcf8b('0x11')](_0xcf8b('0xd'),_0x23d532,_0x1f6a31);_0x667e2f(_0x1f6a31);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index baa34ba..f9f1e0c 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 _0x568d=['../../components/auth/service','../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated','show','put','delete','destroy','exports','multer','util','path','express','Router','fs-extra'];(function(_0x246419,_0x554ea8){var _0x5c54c6=function(_0xc723fc){while(--_0xc723fc){_0x246419['push'](_0x246419['shift']());}};_0x5c54c6(++_0x554ea8);}(_0x568d,0xf9));var _0xd568=function(_0x7a35b1,_0x925417){_0x7a35b1=_0x7a35b1-0x0;var _0x3c4535=_0x568d[_0x7a35b1];return _0x3c4535;};'use strict';var multer=require(_0xd568('0x0'));var util=require(_0xd568('0x1'));var path=require(_0xd568('0x2'));var timeout=require('connect-timeout');var express=require(_0xd568('0x3'));var router=express[_0xd568('0x4')]();var fs_extra=require(_0xd568('0x5'));var auth=require(_0xd568('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd568('0x7'));var controller=require(_0xd568('0x8'));router[_0xd568('0x9')](_0xd568('0xa'),auth[_0xd568('0xb')](),controller[_0xd568('0xc')]);router[_0xd568('0xd')](_0xd568('0xa'),auth[_0xd568('0xb')](),controller['update']);router[_0xd568('0xe')](_0xd568('0xa'),auth[_0xd568('0xb')](),controller[_0xd568('0xf')]);module[_0xd568('0x10')]=router; \ No newline at end of file +var _0x7631=['multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./chatApplication.controller','isAuthenticated','put','delete','/:id','destroy'];(function(_0x535596,_0x15c174){var _0x5751dd=function(_0x2b3a50){while(--_0x2b3a50){_0x535596['push'](_0x535596['shift']());}};_0x5751dd(++_0x15c174);}(_0x7631,0x108));var _0x1763=function(_0x43730d,_0x20829c){_0x43730d=_0x43730d-0x0;var _0x53353d=_0x7631[_0x43730d];return _0x53353d;};'use strict';var multer=require(_0x1763('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x1763('0x1'));var express=require('express');var router=express[_0x1763('0x2')]();var fs_extra=require(_0x1763('0x3'));var auth=require(_0x1763('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x1763('0x5'));var controller=require(_0x1763('0x6'));router['get']('/:id',auth[_0x1763('0x7')](),controller['show']);router[_0x1763('0x8')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x1763('0x9')](_0x1763('0xa'),auth[_0x1763('0x7')](),controller[_0x1763('0xb')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index 7a2eed1..e1ace08 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 _0x4df9=['exports','BOOLEAN'];(function(_0x470f24,_0x2436a9){var _0x2c6fc8=function(_0x3ef190){while(--_0x3ef190){_0x470f24['push'](_0x470f24['shift']());}};_0x2c6fc8(++_0x2436a9);}(_0x4df9,0x19a));var _0x94df=function(_0x1654ec,_0x584374){_0x1654ec=_0x1654ec-0x0;var _0x329fbf=_0x4df9[_0x1654ec];return _0x329fbf;};'use strict';var Sequelize=require('sequelize');module[_0x94df('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0x94df('0x1')],'defaultValue':!![]}}; \ No newline at end of file +var _0x2fb7=['exports','STRING','BOOLEAN'];(function(_0xd43aed,_0x556f54){var _0x4aa694=function(_0x56817d){while(--_0x56817d){_0xd43aed['push'](_0xd43aed['shift']());}};_0x4aa694(++_0x556f54);}(_0x2fb7,0x90));var _0x72fb=function(_0x2ca538,_0x123635){_0x2ca538=_0x2ca538-0x0;var _0x13fd09=_0x2fb7[_0x2ca538];return _0x13fd09;};'use strict';var Sequelize=require('sequelize');module[_0x72fb('0x0')]={'name':{'type':Sequelize[_0x72fb('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x72fb('0x1')]},'write':{'type':Sequelize[_0x72fb('0x2')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js index de02b90..69b21c3 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 _0xed08=['find','create','body','update','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','omit','getMembers','findOne','User','order','removeMembers','getMessages','pick','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','ejs','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','reject','save','then','destroy','error','name','send','index','map','ChatGroup','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','hasOwnProperty','nolimit','sort','where','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','params','length','include'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xed08,0x7a));var _0x8ed0=function(_0x54e29a,_0x1c9650){_0x54e29a=_0x54e29a-0x0;var _0x49bda7=_0xed08[_0x54e29a];return _0x49bda7;};'use strict';var emlformat=require(_0x8ed0('0x0'));var rimraf=require(_0x8ed0('0x1'));var zipdir=require(_0x8ed0('0x2'));var jsonpatch=require(_0x8ed0('0x3'));var rp=require('request-promise');var moment=require(_0x8ed0('0x4'));var BPromise=require(_0x8ed0('0x5'));var Mustache=require('mustache');var util=require(_0x8ed0('0x6'));var path=require('path');var sox=require(_0x8ed0('0x7'));var csv=require(_0x8ed0('0x8'));var ejs=require(_0x8ed0('0x9'));var fs=require('fs');var fs_extra=require(_0x8ed0('0xa'));var _=require('lodash');var squel=require(_0x8ed0('0xb'));var crypto=require('crypto');var jsforce=require(_0x8ed0('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x8ed0('0xd'));var Papa=require(_0x8ed0('0xe'));var Redis=require(_0x8ed0('0xf'));var authService=require(_0x8ed0('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x8ed0('0x11'));var hardwareService=require(_0x8ed0('0x12'));var logger=require(_0x8ed0('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x8ed0('0x14'));var licenseUtil=require(_0x8ed0('0x15'));var db=require(_0x8ed0('0x16'))['db'];config[_0x8ed0('0x17')]=_[_0x8ed0('0x18')](config['redis'],{'host':_0x8ed0('0x19'),'port':0x18eb});var socket=require(_0x8ed0('0x1a'))(new Redis(config[_0x8ed0('0x17')]));require(_0x8ed0('0x1b'))['register'](socket);function respondWithStatusCode(_0x1aa3ac,_0x51e341){_0x51e341=_0x51e341||0xcc;return function(_0x5ead40){if(_0x5ead40){return _0x1aa3ac[_0x8ed0('0x1c')](_0x51e341);}return _0x1aa3ac[_0x8ed0('0x1d')](_0x51e341)[_0x8ed0('0x1e')]();};}function respondWithResult(_0x4644c4,_0x4dfb4b){_0x4dfb4b=_0x4dfb4b||0xc8;return function(_0x734a42){if(_0x734a42){return _0x4644c4['status'](_0x4dfb4b)['json'](_0x734a42);}};}function respondWithFilteredResult(_0x39c61c,_0x261b58){return function(_0x340a4a){if(_0x340a4a){var _0x2da6ce=typeof _0x261b58[_0x8ed0('0x1f')]===_0x8ed0('0x20')&&typeof _0x261b58['limit']==='undefined';var _0x1c6163=_0x340a4a['count'];var _0x524d7d=_0x2da6ce?0x0:_0x261b58[_0x8ed0('0x1f')];var _0x4768a3=_0x2da6ce?_0x340a4a[_0x8ed0('0x21')]:_0x261b58[_0x8ed0('0x1f')]+_0x261b58[_0x8ed0('0x22')];var _0x489ca0;if(_0x4768a3>=_0x1c6163){_0x4768a3=_0x1c6163;_0x489ca0=0xc8;}else{_0x489ca0=0xce;}_0x39c61c[_0x8ed0('0x1d')](_0x489ca0);return _0x39c61c[_0x8ed0('0x23')](_0x8ed0('0x24'),_0x524d7d+'-'+_0x4768a3+'/'+_0x1c6163)[_0x8ed0('0x25')](_0x340a4a);}return null;};}function patchUpdates(_0x587536){return function(_0x4d0111){try{jsonpatch['apply'](_0x4d0111,_0x587536,!![]);}catch(_0x434107){return BPromise[_0x8ed0('0x26')](_0x434107);}return _0x4d0111[_0x8ed0('0x27')]();};}function saveUpdates(_0x367fbf,_0x1ad4d5){return function(_0x41e011){if(_0x41e011){return _0x41e011['update'](_0x367fbf)[_0x8ed0('0x28')](function(_0x1297ec){return _0x1297ec;});}return null;};}function removeEntity(_0x3f015f,_0x41a340){return function(_0x4d7f62){if(_0x4d7f62){return _0x4d7f62[_0x8ed0('0x29')]()[_0x8ed0('0x28')](function(){_0x3f015f[_0x8ed0('0x1d')](0xcc)[_0x8ed0('0x1e')]();});}};}function handleEntityNotFound(_0x1045cb,_0x360ca5){return function(_0x55ce28){if(!_0x55ce28){_0x1045cb[_0x8ed0('0x1c')](0x194);}return _0x55ce28;};}function handleError(_0x389ac9,_0x33310f){_0x33310f=_0x33310f||0x1f4;return function(_0x329a17){logger[_0x8ed0('0x2a')](_0x329a17['stack']);if(_0x329a17[_0x8ed0('0x2b')]){delete _0x329a17[_0x8ed0('0x2b')];}_0x389ac9[_0x8ed0('0x1d')](_0x33310f)[_0x8ed0('0x2c')](_0x329a17);};}exports[_0x8ed0('0x2d')]=function(_0x47db4a,_0x2983db){var _0x5e93bc={},_0x1813d7={},_0x16b23a={'count':0x0,'rows':[]};var _0x4a2ebe=_[_0x8ed0('0x2e')](db[_0x8ed0('0x2f')][_0x8ed0('0x30')],function(_0x38d4a9){return{'name':_0x38d4a9[_0x8ed0('0x31')],'type':_0x38d4a9[_0x8ed0('0x32')][_0x8ed0('0x33')]};});_0x1813d7[_0x8ed0('0x34')]=_['map'](_0x4a2ebe,_0x8ed0('0x2b'));_0x1813d7['query']=_[_0x8ed0('0x35')](_0x47db4a['query']);_0x1813d7[_0x8ed0('0x36')]=_[_0x8ed0('0x37')](_0x1813d7[_0x8ed0('0x34')],_0x1813d7[_0x8ed0('0x38')]);_0x5e93bc[_0x8ed0('0x39')]=_[_0x8ed0('0x37')](_0x1813d7['model'],qs['fields'](_0x47db4a[_0x8ed0('0x38')][_0x8ed0('0x3a')]));_0x5e93bc[_0x8ed0('0x39')]=_0x5e93bc[_0x8ed0('0x39')]['length']?_0x5e93bc['attributes']:_0x1813d7[_0x8ed0('0x34')];if(!_0x47db4a['query'][_0x8ed0('0x3b')](_0x8ed0('0x3c'))){_0x5e93bc[_0x8ed0('0x22')]=qs[_0x8ed0('0x22')](_0x47db4a[_0x8ed0('0x38')][_0x8ed0('0x22')]);_0x5e93bc['offset']=qs[_0x8ed0('0x1f')](_0x47db4a['query']['offset']);}_0x5e93bc['order']=qs[_0x8ed0('0x3d')](_0x47db4a['query'][_0x8ed0('0x3d')]);_0x5e93bc[_0x8ed0('0x3e')]=qs[_0x8ed0('0x36')](_['pick'](_0x47db4a[_0x8ed0('0x38')],_0x1813d7[_0x8ed0('0x36')]),_0x4a2ebe);if(_0x47db4a[_0x8ed0('0x38')]['filter']){_0x5e93bc[_0x8ed0('0x3e')]=_['merge'](_0x5e93bc[_0x8ed0('0x3e')],{'$or':_[_0x8ed0('0x2e')](_0x4a2ebe,function(_0x1854d2){if(_0x1854d2['type']!==_0x8ed0('0x3f')){var _0xe6863b={};_0xe6863b[_0x1854d2[_0x8ed0('0x2b')]]={'$like':'%'+_0x47db4a[_0x8ed0('0x38')]['filter']+'%'};return _0xe6863b;}})});}_0x5e93bc=_[_0x8ed0('0x40')]({},_0x5e93bc,_0x47db4a[_0x8ed0('0x41')]);var _0x14e687={'where':_0x5e93bc[_0x8ed0('0x3e')]};return db[_0x8ed0('0x2f')][_0x8ed0('0x21')](_0x14e687)[_0x8ed0('0x28')](function(_0x580a30){_0x16b23a[_0x8ed0('0x21')]=_0x580a30;if(_0x47db4a[_0x8ed0('0x38')][_0x8ed0('0x42')]){_0x5e93bc['include']=[{'all':!![]}];}return db[_0x8ed0('0x2f')][_0x8ed0('0x43')](_0x5e93bc);})[_0x8ed0('0x28')](function(_0x1857f9){_0x16b23a[_0x8ed0('0x44')]=_0x1857f9;return _0x16b23a;})[_0x8ed0('0x28')](respondWithFilteredResult(_0x2983db,_0x5e93bc))[_0x8ed0('0x45')](handleError(_0x2983db,null));};exports[_0x8ed0('0x46')]=function(_0x1e5d58,_0x1a6bd8){var _0x10c2a6={'raw':!![],'where':{'id':_0x1e5d58[_0x8ed0('0x47')]['id']}},_0x202811={};_0x202811[_0x8ed0('0x34')]=_[_0x8ed0('0x35')](db[_0x8ed0('0x2f')][_0x8ed0('0x30')]);_0x202811['query']=_[_0x8ed0('0x35')](_0x1e5d58[_0x8ed0('0x38')]);_0x202811[_0x8ed0('0x36')]=_['intersection'](_0x202811[_0x8ed0('0x34')],_0x202811['query']);_0x10c2a6[_0x8ed0('0x39')]=_[_0x8ed0('0x37')](_0x202811[_0x8ed0('0x34')],qs['fields'](_0x1e5d58['query'][_0x8ed0('0x3a')]));_0x10c2a6[_0x8ed0('0x39')]=_0x10c2a6[_0x8ed0('0x39')][_0x8ed0('0x48')]?_0x10c2a6[_0x8ed0('0x39')]:_0x202811[_0x8ed0('0x34')];if(_0x1e5d58[_0x8ed0('0x38')]['includeAll']){_0x10c2a6[_0x8ed0('0x49')]=[{'all':!![]}];}_0x10c2a6=_['merge']({},_0x10c2a6,_0x1e5d58[_0x8ed0('0x41')]);return db['ChatGroup'][_0x8ed0('0x4a')](_0x10c2a6)[_0x8ed0('0x28')](handleEntityNotFound(_0x1a6bd8,null))[_0x8ed0('0x28')](respondWithResult(_0x1a6bd8,null))[_0x8ed0('0x45')](handleError(_0x1a6bd8,null));};exports[_0x8ed0('0x4b')]=function(_0x1d7851,_0x5c37af){return db['ChatGroup'][_0x8ed0('0x4b')](_0x1d7851[_0x8ed0('0x4c')],{})[_0x8ed0('0x28')](respondWithResult(_0x5c37af,0xc9))[_0x8ed0('0x45')](handleError(_0x5c37af,null));};exports[_0x8ed0('0x4d')]=function(_0x255f7f,_0x4cb4ca){if(_0x255f7f['body']['id']){delete _0x255f7f[_0x8ed0('0x4c')]['id'];}return db[_0x8ed0('0x2f')]['find']({'where':{'id':_0x255f7f['params']['id']}})[_0x8ed0('0x28')](handleEntityNotFound(_0x4cb4ca,null))[_0x8ed0('0x28')](saveUpdates(_0x255f7f['body'],null))['then'](respondWithResult(_0x4cb4ca,null))['catch'](handleError(_0x4cb4ca,null));};exports['destroy']=function(_0x193abb,_0x1b7d9e){return db[_0x8ed0('0x2f')][_0x8ed0('0x4a')]({'where':{'id':_0x193abb[_0x8ed0('0x47')]['id']}})['then'](handleEntityNotFound(_0x1b7d9e,null))['then'](removeEntity(_0x1b7d9e,null))['catch'](handleError(_0x1b7d9e,null));};exports[_0x8ed0('0x4e')]=function(_0x119fae,_0x5c1f1c){return db[_0x8ed0('0x2f')][_0x8ed0('0x4e')]()['then'](respondWithResult(_0x5c1f1c,null))['catch'](handleError(_0x5c1f1c,null));};exports[_0x8ed0('0x4f')]=function(_0x3a42ad,_0x380ac8,_0x32f3b1){return db[_0x8ed0('0x50')][_0x8ed0('0x21')]({'where':{'ChatGroupId':_0x3a42ad['params']['id'],'ToId':_0x3a42ad[_0x8ed0('0x51')]['id'],'read':![]}})[_0x8ed0('0x28')](function(_0x45e51a){return{'id':_[_0x8ed0('0x52')](_0x3a42ad[_0x8ed0('0x47')]['id']),'count':_0x45e51a};})['then'](respondWithResult(_0x380ac8,null))[_0x8ed0('0x45')](handleError(_0x380ac8,null));};exports[_0x8ed0('0x53')]=function(_0x3067e4,_0x271a6c,_0x4aaf1a){return db[_0x8ed0('0x2f')]['find']({'where':{'id':_0x3067e4['params']['id']}})[_0x8ed0('0x28')](handleEntityNotFound(_0x271a6c,null))[_0x8ed0('0x28')](function(_0x57f82a){if(_0x57f82a){return _0x57f82a['addMembers'](_0x3067e4[_0x8ed0('0x4c')][_0x8ed0('0x54')],_[_0x8ed0('0x55')](_0x3067e4['body'],[_0x8ed0('0x54'),'id'])||{});}})[_0x8ed0('0x28')](respondWithResult(_0x271a6c,null))['catch'](handleError(_0x271a6c,null));};exports[_0x8ed0('0x56')]=function(_0x15bdaa,_0x21f9e1,_0x137ef2){var _0x56c4a7={};var _0x57e080={};var _0x24fe7c;var _0x4c0ed5;return db['ChatGroup'][_0x8ed0('0x57')]({'where':{'id':_0x15bdaa['params']['id']}})[_0x8ed0('0x28')](handleEntityNotFound(_0x21f9e1,null))[_0x8ed0('0x28')](function(_0x349dd7){if(_0x349dd7){_0x24fe7c=_0x349dd7;_0x57e080['model']=_[_0x8ed0('0x35')](db[_0x8ed0('0x58')][_0x8ed0('0x30')]);_0x57e080[_0x8ed0('0x38')]=_[_0x8ed0('0x35')](_0x15bdaa[_0x8ed0('0x38')]);_0x57e080[_0x8ed0('0x36')]=_[_0x8ed0('0x37')](_0x57e080[_0x8ed0('0x34')],_0x57e080[_0x8ed0('0x38')]);_0x56c4a7[_0x8ed0('0x39')]=_[_0x8ed0('0x37')](_0x57e080[_0x8ed0('0x34')],qs[_0x8ed0('0x3a')](_0x15bdaa[_0x8ed0('0x38')][_0x8ed0('0x3a')]));_0x56c4a7[_0x8ed0('0x39')]=_0x56c4a7[_0x8ed0('0x39')][_0x8ed0('0x48')]?_0x56c4a7['attributes']:_0x57e080[_0x8ed0('0x34')];_0x56c4a7[_0x8ed0('0x59')]=qs['sort'](_0x15bdaa[_0x8ed0('0x38')]['sort']);_0x56c4a7[_0x8ed0('0x3e')]=qs[_0x8ed0('0x36')](_['pick'](_0x15bdaa[_0x8ed0('0x38')],_0x57e080[_0x8ed0('0x36')]));if(_0x15bdaa['query']['filter']){_0x56c4a7['where']=_[_0x8ed0('0x40')](_0x56c4a7['where'],{'$or':_[_0x8ed0('0x2e')](_0x56c4a7[_0x8ed0('0x39')],function(_0x3d1d47){var _0x21d3f7={};_0x21d3f7[_0x3d1d47]={'$like':'%'+_0x15bdaa[_0x8ed0('0x38')]['filter']+'%'};return _0x21d3f7;})});}_0x56c4a7=_[_0x8ed0('0x40')]({},_0x56c4a7,_0x15bdaa[_0x8ed0('0x41')]);return _0x24fe7c[_0x8ed0('0x56')](_0x56c4a7);}})[_0x8ed0('0x28')](function(_0x2d89e7){if(_0x2d89e7){_0x4c0ed5=_0x2d89e7[_0x8ed0('0x48')];if(!_0x15bdaa['query'][_0x8ed0('0x3b')](_0x8ed0('0x3c'))){_0x56c4a7[_0x8ed0('0x22')]=qs[_0x8ed0('0x22')](_0x15bdaa[_0x8ed0('0x38')]['limit']);_0x56c4a7[_0x8ed0('0x1f')]=qs['offset'](_0x15bdaa[_0x8ed0('0x38')][_0x8ed0('0x1f')]);}return _0x24fe7c[_0x8ed0('0x56')](_0x56c4a7);}})['then'](function(_0x27a577){if(_0x27a577){return _0x27a577?{'count':_0x4c0ed5,'rows':_0x27a577}:null;}})[_0x8ed0('0x28')](respondWithResult(_0x21f9e1,null))['catch'](handleError(_0x21f9e1,null));};exports[_0x8ed0('0x5a')]=function(_0x3dd1ac,_0xca2045,_0xd6da19){return db[_0x8ed0('0x2f')][_0x8ed0('0x4a')]({'where':{'id':_0x3dd1ac[_0x8ed0('0x47')]['id']}})[_0x8ed0('0x28')](handleEntityNotFound(_0xca2045,null))[_0x8ed0('0x28')](function(_0x172bbb){if(_0x172bbb){return _0x172bbb[_0x8ed0('0x5a')](_0x3dd1ac['query'][_0x8ed0('0x54')]);}})[_0x8ed0('0x28')](respondWithStatusCode(_0xca2045,null))[_0x8ed0('0x45')](handleError(_0xca2045,null));};exports['addMessage']=function(_0x16b0f9,_0x7a5396,_0x3719d6){if(_0x16b0f9[_0x8ed0('0x4c')]['id']){delete _0x16b0f9[_0x8ed0('0x4c')]['id'];}return db[_0x8ed0('0x2f')][_0x8ed0('0x4a')]({'where':{'id':_0x16b0f9['params']['id']}})[_0x8ed0('0x28')](handleEntityNotFound(_0x7a5396,null))[_0x8ed0('0x28')](function(_0x3a6b92){if(_0x3a6b92){_0x16b0f9['body']['ChatGroupId']=_0x3a6b92['id'];return db[_0x8ed0('0x50')]['create'](_0x16b0f9['body']);}})['then'](respondWithResult(_0x7a5396,null))[_0x8ed0('0x45')](handleError(_0x7a5396,null));};exports[_0x8ed0('0x5b')]=function(_0x9ba15,_0x54511a,_0x99334f){var _0x59a495={};var _0x3f8115={};var _0xfff855;var _0x287f34;return db['ChatGroup']['findOne']({'where':{'id':_0x9ba15[_0x8ed0('0x47')]['id']}})['then'](handleEntityNotFound(_0x54511a,null))['then'](function(_0x377d19){if(_0x377d19){_0xfff855=_0x377d19;_0x3f8115['model']=_[_0x8ed0('0x35')](db['ChatInternalMessage'][_0x8ed0('0x30')]);_0x3f8115[_0x8ed0('0x38')]=_[_0x8ed0('0x35')](_0x9ba15['query']);_0x3f8115['filters']=_[_0x8ed0('0x37')](_0x3f8115[_0x8ed0('0x34')],_0x3f8115['query']);_0x59a495['attributes']=_[_0x8ed0('0x37')](_0x3f8115[_0x8ed0('0x34')],qs['fields'](_0x9ba15[_0x8ed0('0x38')][_0x8ed0('0x3a')]));_0x59a495['attributes']=_0x59a495['attributes'][_0x8ed0('0x48')]?_0x59a495[_0x8ed0('0x39')]:_0x3f8115['model'];_0x59a495[_0x8ed0('0x59')]=qs[_0x8ed0('0x3d')](_0x9ba15['query'][_0x8ed0('0x3d')]);_0x59a495[_0x8ed0('0x3e')]=qs['filters'](_[_0x8ed0('0x5c')](_0x9ba15[_0x8ed0('0x38')],_0x3f8115['filters']));if(_0x9ba15['query'][_0x8ed0('0x5d')]){_0x59a495[_0x8ed0('0x3e')]=_['merge'](_0x59a495[_0x8ed0('0x3e')],{'$or':_['map'](_0x59a495[_0x8ed0('0x39')],function(_0x387d70){var _0x297e15={};_0x297e15[_0x387d70]={'$like':'%'+_0x9ba15['query']['filter']+'%'};return _0x297e15;})});}if(_0x9ba15['query'][_0x8ed0('0x5e')]){var _0x1b04ee=_0x9ba15[_0x8ed0('0x38')][_0x8ed0('0x5e')][_0x8ed0('0x5f')](',');var _0x4ab876={};_0x4ab876[_0x1b04ee[0x0]]={'$gte':moment(_0x1b04ee[0x1])[_0x8ed0('0x60')](_0x8ed0('0x61'))};_0x59a495[_0x8ed0('0x3e')]=_[_0x8ed0('0x40')](_0x59a495[_0x8ed0('0x3e')],_0x4ab876);}_0x59a495=_[_0x8ed0('0x40')]({},_0x59a495,_0x9ba15[_0x8ed0('0x41')]);return _0xfff855[_0x8ed0('0x5b')](_0x59a495);}})['then'](function(_0x381d8e){if(_0x381d8e){_0x287f34=_0x381d8e[_0x8ed0('0x48')];if(!_0x9ba15[_0x8ed0('0x38')][_0x8ed0('0x3b')](_0x8ed0('0x3c'))){_0x59a495[_0x8ed0('0x22')]=qs[_0x8ed0('0x22')](_0x9ba15[_0x8ed0('0x38')][_0x8ed0('0x22')]);_0x59a495['offset']=qs[_0x8ed0('0x1f')](_0x9ba15['query']['offset']);}return _0xfff855[_0x8ed0('0x5b')](_0x59a495);}})[_0x8ed0('0x28')](function(_0xa6e989){if(_0xa6e989){return _0xa6e989?{'count':_0x287f34,'rows':_0xa6e989}:null;}})[_0x8ed0('0x28')](respondWithResult(_0x54511a,null))['catch'](handleError(_0x54511a,null));}; \ No newline at end of file +var _0x114c=['json','apply','reject','update','then','destroy','sendStatus','error','stack','name','send','index','ChatGroup','rawAttributes','fieldName','type','key','query','keys','intersection','model','fields','attributes','limit','order','filters','filter','where','merge','map','options','includeAll','include','rows','catch','show','params','length','create','body','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','find','ids','getMembers','findOne','User','sort','pick','nolimit','removeMembers','ChatGroupId','getMessages','split','format','YYYY-MM-DD\x20HH:mm:ss','hasOwnProperty','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./chatGroup.socket','register','status','end','undefined','count','offset','Content-Range'];(function(_0x154f66,_0x116f85){var _0x3f947a=function(_0x1f671e){while(--_0x1f671e){_0x154f66['push'](_0x154f66['shift']());}};_0x3f947a(++_0x116f85);}(_0x114c,0x1bd));var _0xc114=function(_0x17cfbb,_0x1e6943){_0x17cfbb=_0x17cfbb-0x0;var _0xd149a6=_0x114c[_0x17cfbb];return _0xd149a6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc114('0x0'));var zipdir=require(_0xc114('0x1'));var jsonpatch=require(_0xc114('0x2'));var rp=require('request-promise');var moment=require(_0xc114('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xc114('0x4'));var util=require(_0xc114('0x5'));var path=require(_0xc114('0x6'));var sox=require(_0xc114('0x7'));var csv=require(_0xc114('0x8'));var ejs=require(_0xc114('0x9'));var fs=require('fs');var fs_extra=require(_0xc114('0xa'));var _=require(_0xc114('0xb'));var squel=require(_0xc114('0xc'));var crypto=require(_0xc114('0xd'));var jsforce=require(_0xc114('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xc114('0x8'));var querystring=require(_0xc114('0xf'));var Papa=require(_0xc114('0x10'));var Redis=require(_0xc114('0x11'));var authService=require(_0xc114('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc114('0x13'));var utils=require(_0xc114('0x14'));var config=require(_0xc114('0x15'));var licenseUtil=require(_0xc114('0x16'));var db=require(_0xc114('0x17'))['db'];config[_0xc114('0x18')]=_[_0xc114('0x19')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xc114('0x1a'))(new Redis(config[_0xc114('0x18')]));require(_0xc114('0x1b'))[_0xc114('0x1c')](socket);function respondWithStatusCode(_0x4c91cd,_0x13ece9){_0x13ece9=_0x13ece9||0xcc;return function(_0x2a7973){if(_0x2a7973){return _0x4c91cd['sendStatus'](_0x13ece9);}return _0x4c91cd[_0xc114('0x1d')](_0x13ece9)[_0xc114('0x1e')]();};}function respondWithResult(_0x48f1b2,_0x1d5240){_0x1d5240=_0x1d5240||0xc8;return function(_0x49a963){if(_0x49a963){return _0x48f1b2[_0xc114('0x1d')](_0x1d5240)['json'](_0x49a963);}};}function respondWithFilteredResult(_0x117411,_0x56535c){return function(_0x3302f4){if(_0x3302f4){var _0x5b1a5e=typeof _0x56535c['offset']===_0xc114('0x1f')&&typeof _0x56535c['limit']===_0xc114('0x1f');var _0x3cb540=_0x3302f4['count'];var _0xd632d3=_0x5b1a5e?0x0:_0x56535c['offset'];var _0x553412=_0x5b1a5e?_0x3302f4[_0xc114('0x20')]:_0x56535c[_0xc114('0x21')]+_0x56535c['limit'];var _0x45d7a1;if(_0x553412>=_0x3cb540){_0x553412=_0x3cb540;_0x45d7a1=0xc8;}else{_0x45d7a1=0xce;}_0x117411[_0xc114('0x1d')](_0x45d7a1);return _0x117411['set'](_0xc114('0x22'),_0xd632d3+'-'+_0x553412+'/'+_0x3cb540)[_0xc114('0x23')](_0x3302f4);}return null;};}function patchUpdates(_0x2a8eba){return function(_0x34e724){try{jsonpatch[_0xc114('0x24')](_0x34e724,_0x2a8eba,!![]);}catch(_0x12f1e4){return BPromise[_0xc114('0x25')](_0x12f1e4);}return _0x34e724['save']();};}function saveUpdates(_0x33a890,_0x27ed6f){return function(_0x41d4c7){if(_0x41d4c7){return _0x41d4c7[_0xc114('0x26')](_0x33a890)[_0xc114('0x27')](function(_0x4f2bea){return _0x4f2bea;});}return null;};}function removeEntity(_0x3a472a,_0x57b2ba){return function(_0x3fb031){if(_0x3fb031){return _0x3fb031[_0xc114('0x28')]()[_0xc114('0x27')](function(){_0x3a472a['status'](0xcc)[_0xc114('0x1e')]();});}};}function handleEntityNotFound(_0x560b86,_0x2d52c6){return function(_0x594dd4){if(!_0x594dd4){_0x560b86[_0xc114('0x29')](0x194);}return _0x594dd4;};}function handleError(_0x12ab5d,_0x42c6fd){_0x42c6fd=_0x42c6fd||0x1f4;return function(_0x27d3b4){logger[_0xc114('0x2a')](_0x27d3b4[_0xc114('0x2b')]);if(_0x27d3b4['name']){delete _0x27d3b4[_0xc114('0x2c')];}_0x12ab5d[_0xc114('0x1d')](_0x42c6fd)[_0xc114('0x2d')](_0x27d3b4);};}exports[_0xc114('0x2e')]=function(_0x56bff9,_0x20ae0e){var _0x5cdf90={},_0x37b065={},_0x3c0aa9={'count':0x0,'rows':[]};var _0x5f4283=_['map'](db[_0xc114('0x2f')][_0xc114('0x30')],function(_0x3f7d61){return{'name':_0x3f7d61[_0xc114('0x31')],'type':_0x3f7d61[_0xc114('0x32')][_0xc114('0x33')]};});_0x37b065['model']=_['map'](_0x5f4283,_0xc114('0x2c'));_0x37b065[_0xc114('0x34')]=_[_0xc114('0x35')](_0x56bff9[_0xc114('0x34')]);_0x37b065['filters']=_[_0xc114('0x36')](_0x37b065['model'],_0x37b065['query']);_0x5cdf90['attributes']=_[_0xc114('0x36')](_0x37b065[_0xc114('0x37')],qs[_0xc114('0x38')](_0x56bff9[_0xc114('0x34')][_0xc114('0x38')]));_0x5cdf90[_0xc114('0x39')]=_0x5cdf90['attributes']['length']?_0x5cdf90['attributes']:_0x37b065['model'];if(!_0x56bff9['query']['hasOwnProperty']('nolimit')){_0x5cdf90[_0xc114('0x3a')]=qs[_0xc114('0x3a')](_0x56bff9[_0xc114('0x34')]['limit']);_0x5cdf90[_0xc114('0x21')]=qs[_0xc114('0x21')](_0x56bff9[_0xc114('0x34')][_0xc114('0x21')]);}_0x5cdf90[_0xc114('0x3b')]=qs['sort'](_0x56bff9['query']['sort']);_0x5cdf90['where']=qs['filters'](_['pick'](_0x56bff9[_0xc114('0x34')],_0x37b065[_0xc114('0x3c')]),_0x5f4283);if(_0x56bff9[_0xc114('0x34')][_0xc114('0x3d')]){_0x5cdf90[_0xc114('0x3e')]=_[_0xc114('0x3f')](_0x5cdf90[_0xc114('0x3e')],{'$or':_[_0xc114('0x40')](_0x5f4283,function(_0x435be2){if(_0x435be2[_0xc114('0x32')]!=='VIRTUAL'){var _0x24536d={};_0x24536d[_0x435be2[_0xc114('0x2c')]]={'$like':'%'+_0x56bff9[_0xc114('0x34')]['filter']+'%'};return _0x24536d;}})});}_0x5cdf90=_[_0xc114('0x3f')]({},_0x5cdf90,_0x56bff9[_0xc114('0x41')]);var _0xacd3e8={'where':_0x5cdf90[_0xc114('0x3e')]};return db[_0xc114('0x2f')][_0xc114('0x20')](_0xacd3e8)[_0xc114('0x27')](function(_0x5617a6){_0x3c0aa9[_0xc114('0x20')]=_0x5617a6;if(_0x56bff9[_0xc114('0x34')][_0xc114('0x42')]){_0x5cdf90[_0xc114('0x43')]=[{'all':!![]}];}return db[_0xc114('0x2f')]['findAll'](_0x5cdf90);})[_0xc114('0x27')](function(_0x18ffd0){_0x3c0aa9[_0xc114('0x44')]=_0x18ffd0;return _0x3c0aa9;})[_0xc114('0x27')](respondWithFilteredResult(_0x20ae0e,_0x5cdf90))[_0xc114('0x45')](handleError(_0x20ae0e,null));};exports[_0xc114('0x46')]=function(_0x5bdb6a,_0x2c4da2){var _0x52438e={'raw':!![],'where':{'id':_0x5bdb6a[_0xc114('0x47')]['id']}},_0x284e9c={};_0x284e9c[_0xc114('0x37')]=_[_0xc114('0x35')](db[_0xc114('0x2f')]['rawAttributes']);_0x284e9c['query']=_[_0xc114('0x35')](_0x5bdb6a[_0xc114('0x34')]);_0x284e9c[_0xc114('0x3c')]=_[_0xc114('0x36')](_0x284e9c['model'],_0x284e9c[_0xc114('0x34')]);_0x52438e[_0xc114('0x39')]=_[_0xc114('0x36')](_0x284e9c[_0xc114('0x37')],qs[_0xc114('0x38')](_0x5bdb6a[_0xc114('0x34')][_0xc114('0x38')]));_0x52438e['attributes']=_0x52438e[_0xc114('0x39')][_0xc114('0x48')]?_0x52438e[_0xc114('0x39')]:_0x284e9c['model'];if(_0x5bdb6a[_0xc114('0x34')]['includeAll']){_0x52438e[_0xc114('0x43')]=[{'all':!![]}];}_0x52438e=_['merge']({},_0x52438e,_0x5bdb6a[_0xc114('0x41')]);return db[_0xc114('0x2f')]['find'](_0x52438e)['then'](handleEntityNotFound(_0x2c4da2,null))['then'](respondWithResult(_0x2c4da2,null))['catch'](handleError(_0x2c4da2,null));};exports[_0xc114('0x49')]=function(_0xca0d4b,_0x1d9d1d){return db[_0xc114('0x2f')][_0xc114('0x49')](_0xca0d4b['body'],{})[_0xc114('0x27')](respondWithResult(_0x1d9d1d,0xc9))[_0xc114('0x45')](handleError(_0x1d9d1d,null));};exports[_0xc114('0x26')]=function(_0xee4437,_0xc24b0c){if(_0xee4437[_0xc114('0x4a')]['id']){delete _0xee4437[_0xc114('0x4a')]['id'];}return db['ChatGroup']['find']({'where':{'id':_0xee4437[_0xc114('0x47')]['id']}})['then'](handleEntityNotFound(_0xc24b0c,null))[_0xc114('0x27')](saveUpdates(_0xee4437[_0xc114('0x4a')],null))[_0xc114('0x27')](respondWithResult(_0xc24b0c,null))[_0xc114('0x45')](handleError(_0xc24b0c,null));};exports[_0xc114('0x28')]=function(_0x17f2da,_0x495cec){return db[_0xc114('0x2f')]['find']({'where':{'id':_0x17f2da[_0xc114('0x47')]['id']}})[_0xc114('0x27')](handleEntityNotFound(_0x495cec,null))[_0xc114('0x27')](removeEntity(_0x495cec,null))[_0xc114('0x45')](handleError(_0x495cec,null));};exports[_0xc114('0x4b')]=function(_0x1d5b55,_0x1fb325){return db[_0xc114('0x2f')][_0xc114('0x4b')]()[_0xc114('0x27')](respondWithResult(_0x1fb325,null))[_0xc114('0x45')](handleError(_0x1fb325,null));};exports[_0xc114('0x4c')]=function(_0x2ed926,_0x3e9fd9,_0x5b5999){return db[_0xc114('0x4d')]['count']({'where':{'ChatGroupId':_0x2ed926[_0xc114('0x47')]['id'],'ToId':_0x2ed926[_0xc114('0x4e')]['id'],'read':![]}})['then'](function(_0x5ce09a){return{'id':_[_0xc114('0x4f')](_0x2ed926['params']['id']),'count':_0x5ce09a};})[_0xc114('0x27')](respondWithResult(_0x3e9fd9,null))[_0xc114('0x45')](handleError(_0x3e9fd9,null));};exports[_0xc114('0x50')]=function(_0x5b54ac,_0x15ed68,_0x5676f7){return db[_0xc114('0x2f')][_0xc114('0x51')]({'where':{'id':_0x5b54ac[_0xc114('0x47')]['id']}})[_0xc114('0x27')](handleEntityNotFound(_0x15ed68,null))['then'](function(_0x365084){if(_0x365084){return _0x365084['addMembers'](_0x5b54ac[_0xc114('0x4a')][_0xc114('0x52')],_['omit'](_0x5b54ac[_0xc114('0x4a')],['ids','id'])||{});}})[_0xc114('0x27')](respondWithResult(_0x15ed68,null))[_0xc114('0x45')](handleError(_0x15ed68,null));};exports[_0xc114('0x53')]=function(_0x2ccdfc,_0x4f4814,_0x243517){var _0x147fed={};var _0x585506={};var _0x4b8d98;var _0x135a9c;return db[_0xc114('0x2f')][_0xc114('0x54')]({'where':{'id':_0x2ccdfc[_0xc114('0x47')]['id']}})[_0xc114('0x27')](handleEntityNotFound(_0x4f4814,null))['then'](function(_0x2d8d6c){if(_0x2d8d6c){_0x4b8d98=_0x2d8d6c;_0x585506[_0xc114('0x37')]=_['keys'](db[_0xc114('0x55')][_0xc114('0x30')]);_0x585506[_0xc114('0x34')]=_[_0xc114('0x35')](_0x2ccdfc['query']);_0x585506[_0xc114('0x3c')]=_[_0xc114('0x36')](_0x585506[_0xc114('0x37')],_0x585506[_0xc114('0x34')]);_0x147fed[_0xc114('0x39')]=_[_0xc114('0x36')](_0x585506[_0xc114('0x37')],qs[_0xc114('0x38')](_0x2ccdfc['query'][_0xc114('0x38')]));_0x147fed[_0xc114('0x39')]=_0x147fed[_0xc114('0x39')][_0xc114('0x48')]?_0x147fed['attributes']:_0x585506[_0xc114('0x37')];_0x147fed['order']=qs[_0xc114('0x56')](_0x2ccdfc[_0xc114('0x34')][_0xc114('0x56')]);_0x147fed[_0xc114('0x3e')]=qs[_0xc114('0x3c')](_[_0xc114('0x57')](_0x2ccdfc['query'],_0x585506[_0xc114('0x3c')]));if(_0x2ccdfc[_0xc114('0x34')][_0xc114('0x3d')]){_0x147fed['where']=_[_0xc114('0x3f')](_0x147fed[_0xc114('0x3e')],{'$or':_['map'](_0x147fed[_0xc114('0x39')],function(_0x6cd687){var _0x46db73={};_0x46db73[_0x6cd687]={'$like':'%'+_0x2ccdfc[_0xc114('0x34')][_0xc114('0x3d')]+'%'};return _0x46db73;})});}_0x147fed=_['merge']({},_0x147fed,_0x2ccdfc[_0xc114('0x41')]);return _0x4b8d98[_0xc114('0x53')](_0x147fed);}})[_0xc114('0x27')](function(_0x49c0c7){if(_0x49c0c7){_0x135a9c=_0x49c0c7[_0xc114('0x48')];if(!_0x2ccdfc[_0xc114('0x34')]['hasOwnProperty'](_0xc114('0x58'))){_0x147fed[_0xc114('0x3a')]=qs['limit'](_0x2ccdfc[_0xc114('0x34')][_0xc114('0x3a')]);_0x147fed[_0xc114('0x21')]=qs[_0xc114('0x21')](_0x2ccdfc['query'][_0xc114('0x21')]);}return _0x4b8d98[_0xc114('0x53')](_0x147fed);}})['then'](function(_0x30d401){if(_0x30d401){return _0x30d401?{'count':_0x135a9c,'rows':_0x30d401}:null;}})['then'](respondWithResult(_0x4f4814,null))[_0xc114('0x45')](handleError(_0x4f4814,null));};exports[_0xc114('0x59')]=function(_0x2692dd,_0x43638e,_0x1c8742){return db[_0xc114('0x2f')]['find']({'where':{'id':_0x2692dd['params']['id']}})['then'](handleEntityNotFound(_0x43638e,null))['then'](function(_0xdff876){if(_0xdff876){return _0xdff876[_0xc114('0x59')](_0x2692dd[_0xc114('0x34')][_0xc114('0x52')]);}})[_0xc114('0x27')](respondWithStatusCode(_0x43638e,null))[_0xc114('0x45')](handleError(_0x43638e,null));};exports['addMessage']=function(_0x64b466,_0x1016bf,_0x31376e){if(_0x64b466[_0xc114('0x4a')]['id']){delete _0x64b466['body']['id'];}return db[_0xc114('0x2f')][_0xc114('0x51')]({'where':{'id':_0x64b466[_0xc114('0x47')]['id']}})['then'](handleEntityNotFound(_0x1016bf,null))[_0xc114('0x27')](function(_0x4430c6){if(_0x4430c6){_0x64b466['body'][_0xc114('0x5a')]=_0x4430c6['id'];return db[_0xc114('0x4d')][_0xc114('0x49')](_0x64b466['body']);}})['then'](respondWithResult(_0x1016bf,null))['catch'](handleError(_0x1016bf,null));};exports[_0xc114('0x5b')]=function(_0x51234f,_0xa31a04,_0xce5758){var _0x1aa9e7={};var _0x383b1d={};var _0x138bd1;var _0x87ff4;return db[_0xc114('0x2f')][_0xc114('0x54')]({'where':{'id':_0x51234f['params']['id']}})[_0xc114('0x27')](handleEntityNotFound(_0xa31a04,null))[_0xc114('0x27')](function(_0x215170){if(_0x215170){_0x138bd1=_0x215170;_0x383b1d[_0xc114('0x37')]=_['keys'](db[_0xc114('0x4d')][_0xc114('0x30')]);_0x383b1d['query']=_['keys'](_0x51234f[_0xc114('0x34')]);_0x383b1d[_0xc114('0x3c')]=_[_0xc114('0x36')](_0x383b1d[_0xc114('0x37')],_0x383b1d[_0xc114('0x34')]);_0x1aa9e7[_0xc114('0x39')]=_[_0xc114('0x36')](_0x383b1d['model'],qs[_0xc114('0x38')](_0x51234f[_0xc114('0x34')]['fields']));_0x1aa9e7[_0xc114('0x39')]=_0x1aa9e7[_0xc114('0x39')][_0xc114('0x48')]?_0x1aa9e7[_0xc114('0x39')]:_0x383b1d[_0xc114('0x37')];_0x1aa9e7['order']=qs[_0xc114('0x56')](_0x51234f[_0xc114('0x34')][_0xc114('0x56')]);_0x1aa9e7['where']=qs[_0xc114('0x3c')](_[_0xc114('0x57')](_0x51234f[_0xc114('0x34')],_0x383b1d['filters']));if(_0x51234f[_0xc114('0x34')]['filter']){_0x1aa9e7[_0xc114('0x3e')]=_['merge'](_0x1aa9e7[_0xc114('0x3e')],{'$or':_[_0xc114('0x40')](_0x1aa9e7['attributes'],function(_0xe12985){var _0x5cbc71={};_0x5cbc71[_0xe12985]={'$like':'%'+_0x51234f['query']['filter']+'%'};return _0x5cbc71;})});}if(_0x51234f[_0xc114('0x34')]['$gte']){var _0x45cdbe=_0x51234f[_0xc114('0x34')]['$gte'][_0xc114('0x5c')](',');var _0x504d5e={};_0x504d5e[_0x45cdbe[0x0]]={'$gte':moment(_0x45cdbe[0x1])[_0xc114('0x5d')](_0xc114('0x5e'))};_0x1aa9e7[_0xc114('0x3e')]=_[_0xc114('0x3f')](_0x1aa9e7[_0xc114('0x3e')],_0x504d5e);}_0x1aa9e7=_['merge']({},_0x1aa9e7,_0x51234f['options']);return _0x138bd1['getMessages'](_0x1aa9e7);}})['then'](function(_0x5a445d){if(_0x5a445d){_0x87ff4=_0x5a445d[_0xc114('0x48')];if(!_0x51234f['query'][_0xc114('0x5f')](_0xc114('0x58'))){_0x1aa9e7[_0xc114('0x3a')]=qs[_0xc114('0x3a')](_0x51234f[_0xc114('0x34')]['limit']);_0x1aa9e7['offset']=qs[_0xc114('0x21')](_0x51234f[_0xc114('0x34')][_0xc114('0x21')]);}return _0x138bd1['getMessages'](_0x1aa9e7);}})[_0xc114('0x27')](function(_0x5b5b4b){if(_0x5b5b4b){return _0x5b5b4b?{'count':_0x87ff4,'rows':_0x5b5b4b}:null;}})[_0xc114('0x27')](respondWithResult(_0xa31a04,null))['catch'](handleError(_0xa31a04,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index 6650d2e..6f4f43e 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 _0xdb21=['../../mysqldb','ChatGroup','setMaxListeners','save','update','remove','hasOwnProperty','hook','exports','events'];(function(_0x295a55,_0x56e0dc){var _0x3890cf=function(_0x284d42){while(--_0x284d42){_0x295a55['push'](_0x295a55['shift']());}};_0x3890cf(++_0x56e0dc);}(_0xdb21,0x135));var _0x1db2=function(_0x4f3949,_0x1b28b5){_0x4f3949=_0x4f3949-0x0;var _0x2bbb60=_0xdb21[_0x4f3949];return _0x2bbb60;};'use strict';var EventEmitter=require(_0x1db2('0x0'));var ChatGroup=require(_0x1db2('0x1'))['db'][_0x1db2('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x1db2('0x3')](0x0);var events={'afterCreate':_0x1db2('0x4'),'afterUpdate':_0x1db2('0x5'),'afterDestroy':_0x1db2('0x6')};function emitEvent(_0xdc2c0c){return function(_0x4102c4,_0x54a04e,_0x3b16c7){ChatGroupEvents['emit'](_0xdc2c0c+':'+_0x4102c4['id'],_0x4102c4);ChatGroupEvents['emit'](_0xdc2c0c,_0x4102c4);_0x3b16c7(null);};}for(var e in events){if(events[_0x1db2('0x7')](e)){var event=events[e];ChatGroup[_0x1db2('0x8')](e,emitEvent(event));}}module[_0x1db2('0x9')]=ChatGroupEvents; \ No newline at end of file +var _0x7c71=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatGroup','setMaxListeners','update'];(function(_0x295b80,_0x3bf87d){var _0xfc29b6=function(_0x4d0e5f){while(--_0x4d0e5f){_0x295b80['push'](_0x295b80['shift']());}};_0xfc29b6(++_0x3bf87d);}(_0x7c71,0x177));var _0x17c7=function(_0x2f1762,_0xab43df){_0x2f1762=_0x2f1762-0x0;var _0x8ab21=_0x7c71[_0x2f1762];return _0x8ab21;};'use strict';var EventEmitter=require(_0x17c7('0x0'));var ChatGroup=require(_0x17c7('0x1'))['db'][_0x17c7('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x17c7('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x17c7('0x4'),'afterDestroy':_0x17c7('0x5')};function emitEvent(_0x3f9105){return function(_0x5a4923,_0x4fed29,_0xa4e319){ChatGroupEvents[_0x17c7('0x6')](_0x3f9105+':'+_0x5a4923['id'],_0x5a4923);ChatGroupEvents[_0x17c7('0x6')](_0x3f9105,_0x5a4923);_0xa4e319(null);};}for(var e in events){if(events[_0x17c7('0x7')](e)){var event=events[e];ChatGroup[_0x17c7('0x8')](e,emitEvent(event));}}module[_0x17c7('0x9')]=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index 0457e5e..3ab90d2 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 _0x2275=['request-promise','path','../../config/environment','./chatGroup.attributes','exports','ChatGroup','lodash','util','../../config/logger','moment'];(function(_0x2b8077,_0x453634){var _0x308091=function(_0x426df7){while(--_0x426df7){_0x2b8077['push'](_0x2b8077['shift']());}};_0x308091(++_0x453634);}(_0x2275,0x132));var _0x5227=function(_0x387ce6,_0x3a45c4){_0x387ce6=_0x387ce6-0x0;var _0x8d2923=_0x2275[_0x387ce6];return _0x8d2923;};'use strict';var _=require(_0x5227('0x0'));var util=require(_0x5227('0x1'));var logger=require(_0x5227('0x2'))('api');var moment=require(_0x5227('0x3'));var BPromise=require('bluebird');var rp=require(_0x5227('0x4'));var fs=require('fs');var path=require(_0x5227('0x5'));var rimraf=require('rimraf');var config=require(_0x5227('0x6'));var attributes=require(_0x5227('0x7'));module[_0x5227('0x8')]=function(_0x4c0469,_0xd3d705){return _0x4c0469['define'](_0x5227('0x9'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9e45=['path','rimraf','./chatGroup.attributes','exports','define','ChatGroup','chat_groups','lodash','util','api','moment','bluebird','request-promise'];(function(_0x5b119c,_0x49403e){var _0x1af35b=function(_0x563175){while(--_0x563175){_0x5b119c['push'](_0x5b119c['shift']());}};_0x1af35b(++_0x49403e);}(_0x9e45,0x1e8));var _0x59e4=function(_0xccd4d3,_0xec2028){_0xccd4d3=_0xccd4d3-0x0;var _0xca752=_0x9e45[_0xccd4d3];return _0xca752;};'use strict';var _=require(_0x59e4('0x0'));var util=require(_0x59e4('0x1'));var logger=require('../../config/logger')(_0x59e4('0x2'));var moment=require(_0x59e4('0x3'));var BPromise=require(_0x59e4('0x4'));var rp=require(_0x59e4('0x5'));var fs=require('fs');var path=require(_0x59e4('0x6'));var rimraf=require(_0x59e4('0x7'));var config=require('../../config/environment');var attributes=require(_0x59e4('0x8'));module[_0x59e4('0x9')]=function(_0x1ca339,_0x4235a9){return _0x1ca339[_0x59e4('0xa')](_0x59e4('0xb'),attributes,{'tableName':_0x59e4('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js index 637cba7..c42e804 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 _0x95f4=['catch','lodash','util','moment','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','request','then','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','error','code','message','result'];(function(_0x3e16c4,_0x1f1954){var _0x5945d1=function(_0x404a8f){while(--_0x404a8f){_0x3e16c4['push'](_0x3e16c4['shift']());}};_0x5945d1(++_0x1f1954);}(_0x95f4,0xf1));var _0x495f=function(_0x3206cb,_0x3d3f65){_0x3206cb=_0x3206cb-0x0;var _0x4be1ea=_0x95f4[_0x3206cb];return _0x4be1ea;};'use strict';var _=require(_0x495f('0x0'));var util=require(_0x495f('0x1'));var moment=require(_0x495f('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x495f('0x3'));var db=require(_0x495f('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x495f('0x5'));var config=require(_0x495f('0x6'));var jayson=require(_0x495f('0x7'));var client=jayson['client'][_0x495f('0x8')]({'port':0x232a});config[_0x495f('0x9')]=_[_0x495f('0xa')](config['redis'],{'host':_0x495f('0xb'),'port':0x18eb});var socket=require(_0x495f('0xc'))(new Redis(config[_0x495f('0x9')]));require('./chatGroup.socket')['register'](socket);function respondWithRpcPromise(_0x3f5880,_0x48c225,_0x415017){return new BPromise(function(_0x508c3d,_0x2b6d9d){return client[_0x495f('0xd')](_0x3f5880,_0x415017)[_0x495f('0xe')](function(_0x2a90c0){logger['info'](_0x495f('0xf'),_0x48c225,_0x495f('0x10'));logger[_0x495f('0x11')](_0x495f('0x12'),_0x48c225,_0x495f('0x10'),JSON['stringify'](_0x2a90c0));if(_0x2a90c0[_0x495f('0x13')]){if(_0x2a90c0[_0x495f('0x13')][_0x495f('0x14')]===0x1f4){logger[_0x495f('0x13')](_0x495f('0xf'),_0x48c225,_0x2a90c0[_0x495f('0x13')][_0x495f('0x15')]);return _0x2b6d9d(_0x2a90c0['error'][_0x495f('0x15')]);}logger[_0x495f('0x13')](_0x495f('0xf'),_0x48c225,_0x2a90c0[_0x495f('0x13')]['message']);return _0x508c3d(_0x2a90c0[_0x495f('0x13')][_0x495f('0x15')]);}else{logger['info'](_0x495f('0xf'),_0x48c225,_0x495f('0x10'));_0x508c3d(_0x2a90c0[_0x495f('0x16')]['message']);}})[_0x495f('0x17')](function(_0x3dc481){logger[_0x495f('0x13')](_0x495f('0xf'),_0x48c225,_0x3dc481);_0x2b6d9d(_0x3dc481);});});} \ No newline at end of file +var _0xba2d=['ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./chatGroup.socket','register','info'];(function(_0x283e62,_0x327cbb){var _0x409c32=function(_0x42c1cf){while(--_0x42c1cf){_0x283e62['push'](_0x283e62['shift']());}};_0x409c32(++_0x327cbb);}(_0xba2d,0xa3));var _0xdba2=function(_0x54f8a7,_0x59b843){_0x54f8a7=_0x54f8a7-0x0;var _0x1275d2=_0xba2d[_0x54f8a7];return _0x1275d2;};'use strict';var _=require('lodash');var util=require(_0xdba2('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xdba2('0x1'));var logger=require(_0xdba2('0x2'))(_0xdba2('0x3'));var config=require(_0xdba2('0x4'));var jayson=require(_0xdba2('0x5'));var client=jayson[_0xdba2('0x6')][_0xdba2('0x7')]({'port':0x232a});config[_0xdba2('0x8')]=_['defaults'](config[_0xdba2('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0xdba2('0x9'))(new Redis(config[_0xdba2('0x8')]));require(_0xdba2('0xa'))[_0xdba2('0xb')](socket);function respondWithRpcPromise(_0x28324a,_0x3aea25,_0x4ee95c){return new BPromise(function(_0x2f50a9,_0x49ab14){return client['request'](_0x28324a,_0x4ee95c)['then'](function(_0x16aa87){logger[_0xdba2('0xc')](_0xdba2('0xd'),_0x3aea25,_0xdba2('0xe'));logger[_0xdba2('0xf')](_0xdba2('0x10'),_0x3aea25,_0xdba2('0xe'),JSON[_0xdba2('0x11')](_0x16aa87));if(_0x16aa87[_0xdba2('0x12')]){if(_0x16aa87[_0xdba2('0x12')][_0xdba2('0x13')]===0x1f4){logger[_0xdba2('0x12')](_0xdba2('0xd'),_0x3aea25,_0x16aa87[_0xdba2('0x12')][_0xdba2('0x14')]);return _0x49ab14(_0x16aa87[_0xdba2('0x12')]['message']);}logger['error'](_0xdba2('0xd'),_0x3aea25,_0x16aa87['error'][_0xdba2('0x14')]);return _0x2f50a9(_0x16aa87[_0xdba2('0x12')]['message']);}else{logger[_0xdba2('0xc')]('ChatGroup,\x20%s,\x20%s',_0x3aea25,_0xdba2('0xe'));_0x2f50a9(_0x16aa87['result'][_0xdba2('0x14')]);}})[_0xdba2('0x15')](function(_0x1b67ec){logger[_0xdba2('0x12')](_0xdba2('0xd'),_0x3aea25,_0x1b67ec);_0x49ab14(_0x1b67ec);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index 7478a85..0cb1c6d 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 _0x2b98=['update','register','length','chatGroup:','./chatGroup.events','remove'];(function(_0x335c97,_0x485355){var _0x36ac8e=function(_0x582562){while(--_0x582562){_0x335c97['push'](_0x335c97['shift']());}};_0x36ac8e(++_0x485355);}(_0x2b98,0x1f0));var _0x82b9=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0x2b98[_0x9df060];return _0x338dfe;};'use strict';var ChatGroupEvents=require(_0x82b9('0x0'));var events=['save',_0x82b9('0x1'),_0x82b9('0x2')];function createListener(_0x3eb099,_0x5ca328){return function(_0x285393){_0x5ca328['emit'](_0x3eb099,_0x285393);};}function removeListener(_0x53bda9,_0x36aec0){return function(){ChatGroupEvents['removeListener'](_0x53bda9,_0x36aec0);};}exports[_0x82b9('0x3')]=function(_0x439941){for(var _0x5b2727=0x0,_0x2af581=events[_0x82b9('0x4')];_0x5b2727<_0x2af581;_0x5b2727++){var _0x55c248=events[_0x5b2727];var _0x360b47=createListener(_0x82b9('0x5')+_0x55c248,_0x439941);ChatGroupEvents['on'](_0x55c248,_0x360b47);}}; \ No newline at end of file +var _0xa39a=['chatGroup:','./chatGroup.events','save','remove','update','removeListener','register','length'];(function(_0xdcbbb,_0x39b964){var _0x19bb4e=function(_0x4952b7){while(--_0x4952b7){_0xdcbbb['push'](_0xdcbbb['shift']());}};_0x19bb4e(++_0x39b964);}(_0xa39a,0x121));var _0xaa39=function(_0x5aa68d,_0x3515b5){_0x5aa68d=_0x5aa68d-0x0;var _0x55e204=_0xa39a[_0x5aa68d];return _0x55e204;};'use strict';var ChatGroupEvents=require(_0xaa39('0x0'));var events=[_0xaa39('0x1'),_0xaa39('0x2'),_0xaa39('0x3')];function createListener(_0xf6f2df,_0x33d207){return function(_0x1f5db1){_0x33d207['emit'](_0xf6f2df,_0x1f5db1);};}function removeListener(_0x4a67c0,_0x4d67ea){return function(){ChatGroupEvents[_0xaa39('0x4')](_0x4a67c0,_0x4d67ea);};}exports[_0xaa39('0x5')]=function(_0x5d0bfb){for(var _0x505d48=0x0,_0x5dd364=events[_0xaa39('0x6')];_0x505d48<_0x5dd364;_0x505d48++){var _0x4bc2de=events[_0x505d48];var _0x4cfcf3=createListener(_0xaa39('0x7')+_0x4bc2de,_0x5d0bfb);ChatGroupEvents['on'](_0x4bc2de,_0x4cfcf3);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index c8c04da..82e4e5e 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 _0x3734=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatGroup.controller','isAuthenticated','/describe','get','show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','create','addMembers','addMessage','/:id','update','delete','destroy','removeMembers'];(function(_0xcb5530,_0x1de24a){var _0x3bb3e7=function(_0x461fa8){while(--_0x461fa8){_0xcb5530['push'](_0xcb5530['shift']());}};_0x3bb3e7(++_0x1de24a);}(_0x3734,0x179));var _0x4373=function(_0x290be4,_0x2df3bd){_0x290be4=_0x290be4-0x0;var _0x2cbe14=_0x3734[_0x290be4];return _0x2cbe14;};'use strict';var multer=require(_0x4373('0x0'));var util=require(_0x4373('0x1'));var path=require(_0x4373('0x2'));var timeout=require(_0x4373('0x3'));var express=require(_0x4373('0x4'));var router=express[_0x4373('0x5')]();var fs_extra=require(_0x4373('0x6'));var auth=require(_0x4373('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x4373('0x8'));var controller=require(_0x4373('0x9'));router['get']('/',auth[_0x4373('0xa')](),controller['index']);router['get'](_0x4373('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x4373('0xc')]('/:id',auth['isAuthenticated'](),controller[_0x4373('0xd')]);router['get'](_0x4373('0xe'),auth['isAuthenticated'](),controller[_0x4373('0xf')]);router[_0x4373('0xc')](_0x4373('0x10'),auth[_0x4373('0xa')](),controller[_0x4373('0x11')]);router[_0x4373('0xc')](_0x4373('0x12'),auth[_0x4373('0xa')](),controller[_0x4373('0x13')]);router[_0x4373('0x14')]('/',auth['isAuthenticated'](),controller[_0x4373('0x15')]);router[_0x4373('0x14')]('/:id/members',auth[_0x4373('0xa')](),controller[_0x4373('0x16')]);router[_0x4373('0x14')](_0x4373('0x12'),auth['isAuthenticated'](),controller[_0x4373('0x17')]);router['put'](_0x4373('0x18'),auth[_0x4373('0xa')](),controller[_0x4373('0x19')]);router[_0x4373('0x1a')](_0x4373('0x18'),auth[_0x4373('0xa')](),controller[_0x4373('0x1b')]);router[_0x4373('0x1a')]('/:id/members',auth[_0x4373('0xa')](),controller[_0x4373('0x1c')]);module['exports']=router; \ No newline at end of file +var _0xff6f=['multer','connect-timeout','Router','../../components/interaction/service','./chatGroup.controller','get','isAuthenticated','index','/describe','/:id','show','getUnread','getMembers','/:id/messages','getMessages','post','create','put','update','destroy','delete','/:id/members','removeMembers','exports'];(function(_0x556927,_0x34b53f){var _0x5f1235=function(_0x4f4e44){while(--_0x4f4e44){_0x556927['push'](_0x556927['shift']());}};_0x5f1235(++_0x34b53f);}(_0xff6f,0x108));var _0xfff6=function(_0x3adc9f,_0x5d49d5){_0x3adc9f=_0x3adc9f-0x0;var _0x432a40=_0xff6f[_0x3adc9f];return _0x432a40;};'use strict';var multer=require(_0xfff6('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xfff6('0x1'));var express=require('express');var router=express[_0xfff6('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xfff6('0x3'));var config=require('../../config/environment');var controller=require(_0xfff6('0x4'));router[_0xfff6('0x5')]('/',auth[_0xfff6('0x6')](),controller[_0xfff6('0x7')]);router[_0xfff6('0x5')](_0xfff6('0x8'),auth[_0xfff6('0x6')](),controller['describe']);router[_0xfff6('0x5')](_0xfff6('0x9'),auth[_0xfff6('0x6')](),controller[_0xfff6('0xa')]);router[_0xfff6('0x5')]('/:id/unread',auth[_0xfff6('0x6')](),controller[_0xfff6('0xb')]);router[_0xfff6('0x5')]('/:id/members',auth[_0xfff6('0x6')](),controller[_0xfff6('0xc')]);router[_0xfff6('0x5')](_0xfff6('0xd'),auth['isAuthenticated'](),controller[_0xfff6('0xe')]);router[_0xfff6('0xf')]('/',auth['isAuthenticated'](),controller[_0xfff6('0x10')]);router[_0xfff6('0xf')]('/:id/members',auth['isAuthenticated'](),controller['addMembers']);router['post'](_0xfff6('0xd'),auth[_0xfff6('0x6')](),controller['addMessage']);router[_0xfff6('0x11')](_0xfff6('0x9'),auth[_0xfff6('0x6')](),controller[_0xfff6('0x12')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xfff6('0x13')]);router[_0xfff6('0x14')](_0xfff6('0x15'),auth[_0xfff6('0x6')](),controller[_0xfff6('0x16')]);module[_0xfff6('0x17')]=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index 3483e33..f1ca5b8 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 _0x0b89=['ENUM','thumb','star','TEXT','STRING','DATE','long','INTEGER','sequelize','BOOLEAN'];(function(_0x415210,_0x33aff1){var _0x2cb0fa=function(_0x2ad5a1){while(--_0x2ad5a1){_0x415210['push'](_0x415210['shift']());}};_0x2cb0fa(++_0x33aff1);}(_0x0b89,0xc6));var _0x90b8=function(_0x38ddfc,_0x572362){_0x38ddfc=_0x38ddfc-0x0;var _0x1a8e60=_0x0b89[_0x38ddfc];return _0x1a8e60;};'use strict';var Sequelize=require(_0x90b8('0x0'));module['exports']={'closed':{'type':Sequelize[_0x90b8('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0x90b8('0x2')]('star',_0x90b8('0x3')),'defaultValue':_0x90b8('0x4')},'ratingMessage':{'type':Sequelize[_0x90b8('0x5')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0x90b8('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x90b8('0x7')]},'disposition':{'type':Sequelize[_0x90b8('0x6')]},'secondDisposition':{'type':Sequelize[_0x90b8('0x6')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x90b8('0x6')]},'browserName':{'type':Sequelize[_0x90b8('0x6')]},'browserVersion':{'type':Sequelize[_0x90b8('0x6')]},'osName':{'type':Sequelize[_0x90b8('0x6')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0x90b8('0x6')]},'deviceVendor':{'type':Sequelize[_0x90b8('0x6')]},'deviceType':{'type':Sequelize[_0x90b8('0x6')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0x90b8('0x6')]},'formData':{'type':Sequelize['TEXT'](_0x90b8('0x8'))},'read1stAt':{'type':Sequelize[_0x90b8('0x7')]},'lastMsgAt':{'type':Sequelize[_0x90b8('0x7')]},'lastMsgDirection':{'type':Sequelize[_0x90b8('0x2')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0x90b8('0x6')]},'vidaooSessionId':{'type':Sequelize[_0x90b8('0x5')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueId':{'type':Sequelize[_0x90b8('0x9')]}}; \ No newline at end of file +var _0x1614=['sequelize','exports','ENUM','star','thumb','TEXT','STRING','DATE','long','out','BOOLEAN','INTEGER'];(function(_0x2aa30f,_0x3d58d0){var _0x2b8376=function(_0x4c0548){while(--_0x4c0548){_0x2aa30f['push'](_0x2aa30f['shift']());}};_0x2b8376(++_0x3d58d0);}(_0x1614,0xa8));var _0x4161=function(_0xb833b1,_0x1c3d3f){_0xb833b1=_0xb833b1-0x0;var _0x1ab87a=_0x1614[_0xb833b1];return _0x1ab87a;};'use strict';var Sequelize=require(_0x4161('0x0'));module[_0x4161('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0x4161('0x2')](_0x4161('0x3'),_0x4161('0x4')),'defaultValue':_0x4161('0x3')},'ratingMessage':{'type':Sequelize[_0x4161('0x5')]},'pathTranscript':{'type':Sequelize[_0x4161('0x5')]},'mailTranscript':{'type':Sequelize[_0x4161('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x4161('0x7')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x4161('0x6')]},'thirdDisposition':{'type':Sequelize[_0x4161('0x6')]},'note':{'type':Sequelize[_0x4161('0x6')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0x4161('0x6')]},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize[_0x4161('0x6')]},'deviceModel':{'type':Sequelize[_0x4161('0x6')]},'deviceVendor':{'type':Sequelize[_0x4161('0x6')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0x4161('0x5')]},'customerIp':{'type':Sequelize[_0x4161('0x6')]},'formData':{'type':Sequelize['TEXT'](_0x4161('0x8'))},'read1stAt':{'type':Sequelize[_0x4161('0x7')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x4161('0x2')]('in',_0x4161('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x4161('0x6')]},'customerPort':{'type':Sequelize[_0x4161('0x6')]},'vidaooSessionId':{'type':Sequelize[_0x4161('0x5')]},'autoreplyExecuted':{'type':Sequelize[_0x4161('0xa')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x4161('0xb')]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index 1f0a28a..5477d0f 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 _0x2faf=['secret','appendFileSync','MailAccount','MailServerOut','Smtp','CloudProvider','getSmtpOptions','SendMail','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','omit','ids','getMessages','nolimit','order','sort','where','pick','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','options','include','findAll','rows','hasOwnProperty','ChatInteractionId','includeAgent','push','setTags','spread','Tag','emit','chatInteractionTags:save','removeTags','unix','toString','server','files','tmp','attachments','transcript-%d-%s.zip','Contact','firstName','lastName','createdAt','Account','get','Chat','Owner','N.A.','closedAt','browserName','osName','referer','customerIp','tail','existsSync','pipe','createWriteStream','read','value','renderFile','views','downloadInteraction.ejs','transcript-','createPdfFromHTML','unlinkSync','rimraf','zip-dir','moment','bluebird','mustache','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','../../mysqldb','redis','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','request','then','info','ChatInteraction,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','catch','sendStatus','end','offset','undefined','limit','count','set','Content-Range','json','update','destroy','status','stack','name','send','render','merge','interaction','account','map','type','getOptions','chat','query','user','params','model','ChatInteraction','rawAttributes','keys','filters','intersection','attributes','fields','length','includeAll','create','body','find','describe','findOne','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','fullname','email','contact','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','metadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','join_url','out','ChatMessage','updateAttributes','customUpdate','CmContact','abandon','entity\x20not\x20found','UserId','closed','disposition','AbandonInteraction','attachmentUpload','originalname','basename','filename','Attachment','attachmentDownload','Unauthorized','attachId','ChatOfflineMessageId','join','server/files/attachments/','offline-chat/','download','close','mailTranscript','root','server/files/chat/upload/','format','now','pathTranscript','User','ChatWebsite','ContactId','Messages','%s%d','agentAlias','System','customer','Visitor','website_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction'];(function(_0x4b649b,_0x544487){var _0x1a92a8=function(_0xa0f8b6){while(--_0xa0f8b6){_0x4b649b['push'](_0x4b649b['shift']());}};_0x1a92a8(++_0x544487);}(_0x2faf,0x114));var _0xf2fa=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x2faf[_0xa464c9];return _0x3d73c4;};'use strict';var rimraf=require(_0xf2fa('0x0'));var zipdir=require(_0xf2fa('0x1'));var rp=require('request-promise');var moment=require(_0xf2fa('0x2'));var BPromise=require(_0xf2fa('0x3'));var Mustache=require(_0xf2fa('0x4'));var util=require(_0xf2fa('0x5'));var path=require(_0xf2fa('0x6'));var ejs=require(_0xf2fa('0x7'));var fs=require('fs');var _=require(_0xf2fa('0x8'));var Redis=require(_0xf2fa('0x9'));var interaction=require(_0xf2fa('0xa'));var qs=require(_0xf2fa('0xb'));var pdf=require('../../components/export/pdf');var logger=require(_0xf2fa('0xc'))('api');var config=require('../../config/environment');var db=require(_0xf2fa('0xd'))['db'];config['redis']=_['defaults'](config[_0xf2fa('0xe')],{'host':'localhost','port':0x18eb});var socket=require(_0xf2fa('0xf'))(new Redis(config['redis']));require(_0xf2fa('0x10'))[_0xf2fa('0x11')](socket);var jayson=require(_0xf2fa('0x12'));var client=jayson[_0xf2fa('0x13')]['http']({'port':0x232b});var client9004=jayson[_0xf2fa('0x13')]['http']({'port':0x232c});function respondWithRpcPromise(_0x153a45,_0xe024e6,_0x375f1d,_0x339a55){return new BPromise(function(_0x1e133e,_0x26c9cf){var _0xa131ad=_0x339a55||client;return _0xa131ad[_0xf2fa('0x14')](_0x153a45,_0x375f1d)[_0xf2fa('0x15')](function(_0x5e24fb){logger[_0xf2fa('0x16')](_0xf2fa('0x17'),_0xe024e6,'request\x20sent');logger[_0xf2fa('0x18')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0xe024e6,'request\x20sent',JSON[_0xf2fa('0x19')](_0x5e24fb));if(_0x5e24fb[_0xf2fa('0x1a')]){if(_0x5e24fb[_0xf2fa('0x1a')][_0xf2fa('0x1b')]===0x1f4){logger[_0xf2fa('0x1a')](_0xf2fa('0x17'),_0xe024e6,_0x5e24fb[_0xf2fa('0x1a')][_0xf2fa('0x1c')]);return _0x26c9cf(_0x5e24fb[_0xf2fa('0x1a')][_0xf2fa('0x1c')]);}logger['error'](_0xf2fa('0x17'),_0xe024e6,_0x5e24fb[_0xf2fa('0x1a')][_0xf2fa('0x1c')]);return _0x1e133e(_0x5e24fb[_0xf2fa('0x1a')][_0xf2fa('0x1c')]);}else{logger['info'](_0xf2fa('0x17'),_0xe024e6,_0xf2fa('0x1d'));_0x1e133e(_0x5e24fb['result'][_0xf2fa('0x1c')]);}})[_0xf2fa('0x1e')](function(_0x4c47a9){logger[_0xf2fa('0x1a')](_0xf2fa('0x17'),_0xe024e6,_0x4c47a9);_0x26c9cf(_0x4c47a9);});});}function respondWithStatusCode(_0x1b99c7,_0x40dc30){_0x40dc30=_0x40dc30||0xcc;return function(_0x178e8a){if(_0x178e8a){return _0x1b99c7[_0xf2fa('0x1f')](_0x40dc30);}return _0x1b99c7['status'](_0x40dc30)[_0xf2fa('0x20')]();};}function respondWithResult(_0x9a8a7d,_0xb69e9e){_0xb69e9e=_0xb69e9e||0xc8;return function(_0x4722ca){if(_0x4722ca){return _0x9a8a7d['status'](_0xb69e9e)['json'](_0x4722ca);}};}function respondWithFilteredResult(_0x2c9429,_0x589b2d){return function(_0x52bedf){if(_0x52bedf){var _0x216862=typeof _0x589b2d[_0xf2fa('0x21')]===_0xf2fa('0x22')&&typeof _0x589b2d[_0xf2fa('0x23')]==='undefined';var _0x29e753=_0x52bedf[_0xf2fa('0x24')];var _0x5d70fb=_0x216862?0x0:_0x589b2d['offset'];var _0x26c676=_0x216862?_0x52bedf['count']:_0x589b2d[_0xf2fa('0x21')]+_0x589b2d[_0xf2fa('0x23')];var _0x35bbea;if(_0x26c676>=_0x29e753){_0x26c676=_0x29e753;_0x35bbea=0xc8;}else{_0x35bbea=0xce;}_0x2c9429['status'](_0x35bbea);return _0x2c9429[_0xf2fa('0x25')](_0xf2fa('0x26'),_0x5d70fb+'-'+_0x26c676+'/'+_0x29e753)[_0xf2fa('0x27')](_0x52bedf);}return null;};}function saveUpdates(_0xf3f270){return function(_0x3e75d6){if(_0x3e75d6){return _0x3e75d6[_0xf2fa('0x28')](_0xf3f270)[_0xf2fa('0x15')](function(_0x5c61dc){return _0x5c61dc;});}return null;};}function removeEntity(_0xe31ce6){return function(_0x4eb599){if(_0x4eb599){return _0x4eb599[_0xf2fa('0x29')]()[_0xf2fa('0x15')](function(){_0xe31ce6[_0xf2fa('0x2a')](0xcc)[_0xf2fa('0x20')]();});}};}function handleEntityNotFound(_0x4545b2){return function(_0x3605a7){if(!_0x3605a7){_0x4545b2['sendStatus'](0x194);}return _0x3605a7;};}function handleError(_0x57148c,_0x124179){_0x124179=_0x124179||0x1f4;return function(_0x285f27){logger['error'](_0x285f27[_0xf2fa('0x2b')]);if(_0x285f27[_0xf2fa('0x2c')]){delete _0x285f27['name'];}_0x57148c[_0xf2fa('0x2a')](_0x124179)[_0xf2fa('0x2d')](_0x285f27);};}function getMustacheRender(_0x46768f,_0xd3df82){return Mustache[_0xf2fa('0x2e')](_0x46768f,_[_0xf2fa('0x2f')](_0xd3df82['body'],{'contact':_0xd3df82['contact'],'message':_0xd3df82[_0xf2fa('0x1c')],'agent':_0xd3df82['agent'],'interaction':_0xd3df82[_0xf2fa('0x30')],'account':_0xd3df82[_0xf2fa('0x31')]}))||'';}exports['index']=function(_0x4c3def,_0x5017dd){var _0x1a07da={};var _0x294467=_[_0xf2fa('0x32')](db['ChatInteraction']['rawAttributes'],function(_0x421a9f){return{'name':_0x421a9f['fieldName'],'type':_0x421a9f[_0xf2fa('0x33')]['key']};});_0x1a07da=qs[_0xf2fa('0x34')](_0x294467,_0x4c3def);return interaction['findAll'](_0xf2fa('0x35'),_0x4c3def[_0xf2fa('0x36')],_0x4c3def[_0xf2fa('0x37')],_0x1a07da,_0x294467)['then'](respondWithFilteredResult(_0x5017dd,_0x1a07da))[_0xf2fa('0x1e')](handleError(_0x5017dd,null));};exports['show']=function(_0x112ee1,_0x438e12){var _0x426885={'raw':![],'where':{'id':_0x112ee1[_0xf2fa('0x38')]['id']}},_0x381c8e={};_0x381c8e[_0xf2fa('0x39')]=_['keys'](db[_0xf2fa('0x3a')][_0xf2fa('0x3b')]);_0x381c8e['query']=_[_0xf2fa('0x3c')](_0x112ee1[_0xf2fa('0x36')]);_0x381c8e[_0xf2fa('0x3d')]=_[_0xf2fa('0x3e')](_0x381c8e['model'],_0x381c8e[_0xf2fa('0x36')]);_0x426885[_0xf2fa('0x3f')]=_['intersection'](_0x381c8e['model'],qs[_0xf2fa('0x40')](_0x112ee1[_0xf2fa('0x36')][_0xf2fa('0x40')]));_0x426885[_0xf2fa('0x3f')]=_0x426885[_0xf2fa('0x3f')][_0xf2fa('0x41')]?_0x426885[_0xf2fa('0x3f')]:_0x381c8e[_0xf2fa('0x39')];if(_0x112ee1['query'][_0xf2fa('0x42')]){_0x426885['include']=[{'all':!![]}];}_0x426885=_[_0xf2fa('0x2f')]({},_0x426885,_0x112ee1['options']);return db[_0xf2fa('0x3a')]['find'](_0x426885)['then'](handleEntityNotFound(_0x438e12,null))['then'](respondWithResult(_0x438e12,null))[_0xf2fa('0x1e')](handleError(_0x438e12,null));};exports[_0xf2fa('0x43')]=function(_0x1fe147,_0x34419f){return db['ChatInteraction'][_0xf2fa('0x43')](_0x1fe147['body'],{})[_0xf2fa('0x15')](respondWithResult(_0x34419f,0xc9))[_0xf2fa('0x1e')](handleError(_0x34419f,null));};exports[_0xf2fa('0x28')]=function(_0x3b187f,_0xdf38ae){if(_0x3b187f['body']['id']){delete _0x3b187f[_0xf2fa('0x44')]['id'];}return db[_0xf2fa('0x3a')][_0xf2fa('0x45')]({'where':{'id':_0x3b187f[_0xf2fa('0x38')]['id']}})[_0xf2fa('0x15')](handleEntityNotFound(_0xdf38ae,null))[_0xf2fa('0x15')](saveUpdates(_0x3b187f[_0xf2fa('0x44')],null))['then'](respondWithResult(_0xdf38ae,null))[_0xf2fa('0x1e')](handleError(_0xdf38ae,null));};exports[_0xf2fa('0x29')]=function(_0x496cc8,_0x2a092f){return db['ChatInteraction'][_0xf2fa('0x45')]({'where':{'id':_0x496cc8[_0xf2fa('0x38')]['id']}})['then'](handleEntityNotFound(_0x2a092f,null))['then'](removeEntity(_0x2a092f,null))[_0xf2fa('0x1e')](handleError(_0x2a092f,null));};exports[_0xf2fa('0x46')]=function(_0x34f35e,_0x31a9c3){return db[_0xf2fa('0x3a')]['describe']()[_0xf2fa('0x15')](respondWithResult(_0x31a9c3,null))[_0xf2fa('0x1e')](handleError(_0x31a9c3,null));};exports['createVidaooSession']=function(_0x5ae15c,_0x2b7012){var _0x47cd30=_0x5ae15c[_0xf2fa('0x38')]['id'];var _0x32e7c4;var _0x347523;var _0x59c6f8;return db[_0xf2fa('0x3a')][_0xf2fa('0x47')]({'where':{'id':_0x47cd30}})[_0xf2fa('0x15')](function(_0x33369a){_0x32e7c4=_0x33369a;return db['ChatWebsite']['findOne']({'where':{'id':_0x33369a[_0xf2fa('0x48')]},'attributes':['id',_0xf2fa('0x49'),_0xf2fa('0x4a'),_0xf2fa('0x4b'),_0xf2fa('0x4c'),_0xf2fa('0x4d')],'raw':!![]});})[_0xf2fa('0x15')](function(_0x2d9f72){if(_0x2d9f72&&_0x2d9f72[_0xf2fa('0x49')]&&_0x2d9f72[_0xf2fa('0x4a')]){_0x347523=_0x2d9f72;var _0x48d55c={'interaction':{'id':_0x47cd30},'agent':{'id':_0x5ae15c['user']['id'],'name':_0x5ae15c['user'][_0xf2fa('0x2c')],'fullname':_0x5ae15c['user'][_0xf2fa('0x4e')],'email':_0x5ae15c[_0xf2fa('0x37')][_0xf2fa('0x4f')]},'contact':_0x5ae15c[_0xf2fa('0x44')][_0xf2fa('0x50')],'account':_0x5ae15c[_0xf2fa('0x44')]['account']};var _0x1e5e67={'rejectUnauthorized':![],'method':_0xf2fa('0x51'),'url':_0xf2fa('0x52'),'headers':{'X-APIKEY':_0x2d9f72[_0xf2fa('0x49')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x5ae15c[_0xf2fa('0x37')]['email']],'buttons':null,'topic':_0x347523['vidaooTopic'],'note':_[_0xf2fa('0x53')](_0x347523[_0xf2fa('0x4c')])?null:getMustacheRender(_0x347523['vidaooNote'],_0x48d55c),'metadata':null},'redirect':_0xf2fa('0x54'),'json':!![]};try{if(!_[_0xf2fa('0x53')](_0x347523[_0xf2fa('0x4d')])){var _0xb0f779=getMustacheRender(_0x347523[_0xf2fa('0x4d')],_0x48d55c);var _0x230b66=JSON['parse'](_0xb0f779);_0x1e5e67[_0xf2fa('0x44')][_0xf2fa('0x55')]=_0x230b66;}}catch(_0x235cb4){throw new db[(_0xf2fa('0x56'))][(_0xf2fa('0x57'))](_0xf2fa('0x58'));}return rp(_0x1e5e67);}else{throw new db['Sequelize'][(_0xf2fa('0x57'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0xf2fa('0x15')](function(_0x1b8cc6){_0x59c6f8=_0x1b8cc6;if(_0x59c6f8['id']){var _0x4d1715={'body':_0x59c6f8[_0xf2fa('0x59')],'ChatWebsiteId':_0x347523['id'],'ChatInteractionId':_0x32e7c4['id'],'direction':_0xf2fa('0x5a'),'UserId':_0x5ae15c[_0xf2fa('0x37')]['id']};return db[_0xf2fa('0x5b')][_0xf2fa('0x43')](_0x4d1715,{});}else{throw new db[(_0xf2fa('0x56'))]['ValidationError']('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0xf2fa('0x15')](function(){return _0x32e7c4[_0xf2fa('0x5c')]({'vidaooSessionId':_0x59c6f8['id']});})[_0xf2fa('0x15')](respondWithResult(_0x2b7012,null))[_0xf2fa('0x1e')](handleError(_0x2b7012,null));};exports[_0xf2fa('0x5d')]=function(_0x5bb579,_0x237a6f){if(_0x5bb579[_0xf2fa('0x44')]['id']){delete _0x5bb579[_0xf2fa('0x44')]['id'];}return db[_0xf2fa('0x3a')]['find']({'where':{'id':_0x5bb579[_0xf2fa('0x38')]['id']},'include':[{'model':db[_0xf2fa('0x5e')],'as':'Contact'}]})[_0xf2fa('0x15')](handleEntityNotFound(_0x237a6f,null))[_0xf2fa('0x15')](saveUpdates(_0x5bb579[_0xf2fa('0x44')],null))[_0xf2fa('0x15')](respondWithResult(_0x237a6f,null))[_0xf2fa('0x1e')](handleError(_0x237a6f,null));};exports[_0xf2fa('0x5f')]=function(_0x203349,_0x122470){if(_0x203349['body']['id']){delete _0x203349[_0xf2fa('0x44')]['id'];}return db[_0xf2fa('0x3a')][_0xf2fa('0x45')]({'where':{'id':_0x203349['params']['id']}})[_0xf2fa('0x15')](function(_0x40493d){if(!_0x40493d){logger['error']('abandonInteraction,\x20%s,\x20%s,\x20%s','abandon',0x194,_0xf2fa('0x60'));_0x122470['sendStatus'](0x194);}else{if(_0x40493d[_0xf2fa('0x61')]){throw new db[(_0xf2fa('0x56'))]['ValidationError']('Interaction\x20already\x20assigned');}}return _0x40493d;})[_0xf2fa('0x15')](function(_0x3b16ff){if(_0x3b16ff){return _0x3b16ff[_0xf2fa('0x28')]({'closed':_0x203349[_0xf2fa('0x44')][_0xf2fa('0x62')],'disposition':_0x203349['body'][_0xf2fa('0x63')]})[_0xf2fa('0x15')](function(_0x2c83f7){return _0x2c83f7;});}})['then'](function(){return respondWithRpcPromise(_0xf2fa('0x64'),_0xf2fa('0x5f'),_0x203349[_0xf2fa('0x44')],client9004);})[_0xf2fa('0x15')](respondWithResult(_0x122470,null))['catch'](handleError(_0x122470,null));};exports[_0xf2fa('0x65')]=function(_0x215845,_0x5a4a96){_0x215845[_0xf2fa('0x44')][_0xf2fa('0x2c')]=_0x215845['file'][_0xf2fa('0x66')];_0x215845['body'][_0xf2fa('0x67')]=_0x215845['file'][_0xf2fa('0x68')];_0x215845['body'][_0xf2fa('0x33')]=_0x215845['file']['mimetype'];return db[_0xf2fa('0x69')][_0xf2fa('0x43')](_0x215845[_0xf2fa('0x44')])['then'](respondWithResult(_0x5a4a96,0xc9))[_0xf2fa('0x1e')](handleError(_0x5a4a96,null));};exports[_0xf2fa('0x6a')]=function(_0x22db86,_0x4e4d1d){return db['ChatInteraction'][_0xf2fa('0x47')]({'where':{'id':_0x22db86['params']['id']},'raw':!![]})[_0xf2fa('0x15')](handleEntityNotFound(_0x4e4d1d,null))[_0xf2fa('0x15')](function(_0x52386d){if(_0x52386d){if(_0x52386d[_0xf2fa('0x62')]){return _0x4e4d1d[_0xf2fa('0x2a')](0x193)[_0xf2fa('0x27')]({'status':0x193,'message':_0xf2fa('0x6b')});}return db['Attachment']['findOne']({'where':{'id':_0x22db86[_0xf2fa('0x36')][_0xf2fa('0x6c')]},'raw':!![]})[_0xf2fa('0x15')](handleEntityNotFound(_0x4e4d1d,null));}})[_0xf2fa('0x15')](function(_0x126f28){if(_0x126f28){var _0xa068a2=_0x126f28[_0xf2fa('0x6d')]!==null;var _0x2ef7ec=path[_0xf2fa('0x6e')](config['root'],_0xf2fa('0x6f'));if(_0xa068a2){_0x2ef7ec=path['join'](_0x2ef7ec,_0xf2fa('0x70'));}var _0x4ccf37=path[_0xf2fa('0x6e')](_0x2ef7ec,_0x126f28[_0xf2fa('0x67')]);return _0x4e4d1d[_0xf2fa('0x71')](_0x4ccf37);}})[_0xf2fa('0x1e')](handleError(_0x4e4d1d,null));};exports[_0xf2fa('0x72')]=function(_0x46a15a,_0x40b0c2){var _0x411d64=null;var _0x4bb0f4=null;var _0x524fc6=null;if(_0x46a15a['body']['id']){delete _0x46a15a[_0xf2fa('0x44')]['id'];}if(_0x46a15a['body'][_0xf2fa('0x73')]){_0x524fc6=path['join'](config[_0xf2fa('0x74')],_0xf2fa('0x75'),util[_0xf2fa('0x76')]('transcript-%s.txt',Date[_0xf2fa('0x77')]()));_0x46a15a['body'][_0xf2fa('0x78')]=_0x524fc6;}return db[_0xf2fa('0x3a')][_0xf2fa('0x45')]({'where':{'id':_0x46a15a['params']['id']},'include':[{'model':db[_0xf2fa('0x5b')],'as':'Messages','include':[{'model':db[_0xf2fa('0x79')],'as':'User'}]}]})[_0xf2fa('0x15')](handleEntityNotFound(_0x40b0c2,null))[_0xf2fa('0x15')](saveUpdates(_0x46a15a[_0xf2fa('0x44')],null))[_0xf2fa('0x15')](function(_0x188bae){if(_0x188bae){_0x411d64=_0x188bae;return db[_0xf2fa('0x7a')][_0xf2fa('0x45')]({'where':{'id':_0x411d64[_0xf2fa('0x48')]}});}})['then'](function(_0x32a7e8){if(_0x32a7e8){_0x4bb0f4=_0x32a7e8;return db[_0xf2fa('0x5e')]['find']({'where':{'id':_0x411d64[_0xf2fa('0x7b')]}});}})[_0xf2fa('0x15')](function(_0x5012e2){if(_0x5012e2){if(_0x524fc6){var _0xb2a141=null;for(var _0x4f67a9=0x1;_0x4f67a9<_0x411d64[_0xf2fa('0x7c')][_0xf2fa('0x41')];++_0x4f67a9){_0xb2a141=_0x411d64['Messages'][_0x4f67a9];var _0x45b8ba=_0xb2a141[_0xf2fa('0x61')]?util[_0xf2fa('0x76')](_0xf2fa('0x7d'),_0x4bb0f4[_0xf2fa('0x7e')],_0xb2a141[_0xf2fa('0x61')]):_0xf2fa('0x7f');var _0x14eabf=_0x46a15a[_0xf2fa('0x44')][_0xf2fa('0x80')]||util[_0xf2fa('0x76')](_0xf2fa('0x7d'),_0xf2fa('0x81'),_0xb2a141[_0xf2fa('0x7b')]);switch(_0x4bb0f4['agentIdentifier']){case _0xf2fa('0x82'):_0x45b8ba=_0xb2a141[_0xf2fa('0x61')]?util['format'](_0xf2fa('0x7d'),_0x4bb0f4[_0xf2fa('0x7e')],_0xb2a141[_0xf2fa('0x61')]):_0xf2fa('0x7f');break;case'agent_alias':_0x45b8ba=_0xb2a141[_0xf2fa('0x61')]?_0xb2a141[_0xf2fa('0x79')][_0xf2fa('0x83')]||_0xb2a141[_0xf2fa('0x79')][_0xf2fa('0x4e')]:'System';break;case _0xf2fa('0x84'):_0x45b8ba=_0xb2a141[_0xf2fa('0x61')]?_0xb2a141[_0xf2fa('0x79')][_0xf2fa('0x4e')]:_0xf2fa('0x7f');break;default:_0x45b8ba=_0xb2a141['UserId']?util[_0xf2fa('0x76')](_0xf2fa('0x7d'),_0x4bb0f4[_0xf2fa('0x7e')],_0xb2a141[_0xf2fa('0x61')]):_0xf2fa('0x7f');}var _0x10fae9=util[_0xf2fa('0x76')](_0xf2fa('0x85'),moment(_0xb2a141['createdAt'])[_0xf2fa('0x76')](_0xf2fa('0x86')),_0xb2a141[_0xf2fa('0x87')]==='in'?_0x14eabf:_0x45b8ba,_0xb2a141[_0xf2fa('0x44')]);if(!_0xb2a141[_0xf2fa('0x88')]){fs[_0xf2fa('0x89')](_0x524fc6,_0x10fae9);}}return db[_0xf2fa('0x8a')][_0xf2fa('0x47')]({'where':{'service':!![]},'include':[{'model':db[_0xf2fa('0x8b')],'as':_0xf2fa('0x8c'),'raw':!![],'include':[{'model':db[_0xf2fa('0x8d')],'as':_0xf2fa('0x8d'),'raw':!![]}]}]});}}})[_0xf2fa('0x15')](function(_0x4526cb){if(!_0x4526cb||!_0x4526cb[_0xf2fa('0x8c')]||!_0x46a15a[_0xf2fa('0x44')])return _0x411d64;var _0x30dd7c=_0x4526cb[_0xf2fa('0x8e')]();return respondWithRpcPromise(_0xf2fa('0x8f'),'sendMail',{'account':_0x30dd7c,'message':{'from':util[_0xf2fa('0x76')]('\x22%s\x22\x20<%s>',_0x4526cb[_0xf2fa('0x2c')],_0x4526cb[_0xf2fa('0x4f')]||_0x4526cb[_0xf2fa('0x8c')][_0xf2fa('0x37')]),'to':_0x46a15a[_0xf2fa('0x44')][_0xf2fa('0x73')],'subject':_0xf2fa('0x90'),'text':util[_0xf2fa('0x76')](_0xf2fa('0x91'),_0x46a15a[_0xf2fa('0x44')][_0xf2fa('0x73')]),'attachments':[{'path':_0x524fc6}]}})[_0xf2fa('0x15')](function(){return _0x411d64;})[_0xf2fa('0x1e')](function(_0x4f2d36){logger['error'](_0x4f2d36);});})['then'](respondWithStatusCode(_0x40b0c2,0xc8))[_0xf2fa('0x1e')](handleError(_0x40b0c2,null));};exports[_0xf2fa('0x92')]=function(_0x2a4c02,_0x2cc662){return db['ChatMessage'][_0xf2fa('0x45')]({'where':{'id':_0x2a4c02[_0xf2fa('0x38')]['id']}})['then'](handleEntityNotFound(_0x2cc662,null))[_0xf2fa('0x15')](function(_0x4d3776){if(_0x4d3776){return _0x4d3776['addMessage'](_0x2a4c02[_0xf2fa('0x44')]['ids'],_[_0xf2fa('0x93')](_0x2a4c02[_0xf2fa('0x44')],[_0xf2fa('0x94'),'id'])||{});}})[_0xf2fa('0x15')](respondWithResult(_0x2cc662,null))[_0xf2fa('0x1e')](handleError(_0x2cc662,null));};exports[_0xf2fa('0x95')]=function(_0x5d097e,_0x4bb3c2){var _0x512d89={'raw':![],'where':{}};var _0x5b17ae={};var _0x409764={'count':0x0,'rows':[]};return db[_0xf2fa('0x3a')][_0xf2fa('0x47')]({'where':{'id':_0x5d097e[_0xf2fa('0x38')]['id']}})['then'](handleEntityNotFound(_0x4bb3c2,null))[_0xf2fa('0x15')](function(_0x524c48){if(_0x524c48){_0x5b17ae[_0xf2fa('0x39')]=_['keys'](db[_0xf2fa('0x5b')][_0xf2fa('0x3b')]);_0x5b17ae['query']=_['keys'](_0x5d097e[_0xf2fa('0x36')]);_0x5b17ae['filters']=_[_0xf2fa('0x3e')](_0x5b17ae['model'],_0x5b17ae[_0xf2fa('0x36')]);_0x512d89[_0xf2fa('0x3f')]=_[_0xf2fa('0x3e')](_0x5b17ae['model'],qs['fields'](_0x5d097e[_0xf2fa('0x36')]['fields']));_0x512d89[_0xf2fa('0x3f')]=_0x512d89[_0xf2fa('0x3f')][_0xf2fa('0x41')]?_0x512d89[_0xf2fa('0x3f')]:_0x5b17ae['model'];if(!_0x5d097e[_0xf2fa('0x36')]['hasOwnProperty'](_0xf2fa('0x96'))){_0x512d89[_0xf2fa('0x23')]=qs['limit'](_0x5d097e[_0xf2fa('0x36')][_0xf2fa('0x23')]);_0x512d89['offset']=qs[_0xf2fa('0x21')](_0x5d097e['query']['offset']);}_0x512d89[_0xf2fa('0x97')]=qs[_0xf2fa('0x98')](_0x5d097e[_0xf2fa('0x36')][_0xf2fa('0x98')]);_0x512d89[_0xf2fa('0x99')]=qs[_0xf2fa('0x3d')](_[_0xf2fa('0x9a')](_0x5d097e[_0xf2fa('0x36')],_0x5b17ae['filters']));_0x512d89[_0xf2fa('0x99')]['ChatInteractionId']=_0x524c48['id'];if(_0x5d097e[_0xf2fa('0x36')][_0xf2fa('0x9b')]){_0x512d89[_0xf2fa('0x99')]=_[_0xf2fa('0x2f')](_0x512d89[_0xf2fa('0x99')],{'$or':_[_0xf2fa('0x32')](_0x512d89['attributes'],function(_0x10136a){var _0x44f34a={};_0x44f34a[_0x10136a]={'$like':'%'+_0x5d097e[_0xf2fa('0x36')][_0xf2fa('0x9b')]+'%'};return _0x44f34a;})});}if(_0x5d097e[_0xf2fa('0x36')]['$gte']){var _0x2b5a04=_0x5d097e[_0xf2fa('0x36')][_0xf2fa('0x9c')][_0xf2fa('0x9d')](',');var _0x9ddd6={};_0x9ddd6[_0x2b5a04[0x0]]={'$gte':moment(_0x2b5a04[0x1])['format'](_0xf2fa('0x9e'))};_0x512d89[_0xf2fa('0x99')]=_[_0xf2fa('0x2f')](_0x512d89[_0xf2fa('0x99')],_0x9ddd6);}_0x512d89=_[_0xf2fa('0x2f')]({},_0x512d89,_0x5d097e[_0xf2fa('0x9f')]);return db[_0xf2fa('0x5b')][_0xf2fa('0x24')]({'where':_0x512d89[_0xf2fa('0x99')]})['then'](function(_0x52f48f){_0x409764[_0xf2fa('0x24')]=_0x52f48f;if(_0x5d097e[_0xf2fa('0x36')][_0xf2fa('0x42')]){_0x512d89[_0xf2fa('0xa0')]=[{'all':!![]}];}return db[_0xf2fa('0x5b')][_0xf2fa('0xa1')](_0x512d89);})[_0xf2fa('0x15')](function(_0x4e7161){_0x409764[_0xf2fa('0xa2')]=_0x4e7161;return _0x409764;});}})[_0xf2fa('0x15')](respondWithFilteredResult(_0x4bb3c2,_0x512d89))[_0xf2fa('0x1e')](handleError(_0x4bb3c2,null));};exports['getMyMessages']=function(_0x4dd93c,_0x2ac43c){var _0x59b864={'where':{}},_0x53221c={},_0x1ae891={'count':0x0,'rows':[]};return db[_0xf2fa('0x3a')]['findOne']({'where':{'id':_0x4dd93c[_0xf2fa('0x38')]['id']}})[_0xf2fa('0x15')](handleEntityNotFound(_0x2ac43c,null))[_0xf2fa('0x15')](function(_0x4ae4df){if(_0x4ae4df){_0x53221c['model']=_[_0xf2fa('0x3c')](db['ChatMessage'][_0xf2fa('0x3b')]);_0x53221c[_0xf2fa('0x36')]=_[_0xf2fa('0x3c')](_0x4dd93c['query']);_0x53221c[_0xf2fa('0x3d')]=_[_0xf2fa('0x3e')](_0x53221c[_0xf2fa('0x39')],_0x53221c[_0xf2fa('0x36')]);_0x59b864[_0xf2fa('0x3f')]=_[_0xf2fa('0x3e')](_0x53221c[_0xf2fa('0x39')],qs['fields'](_0x4dd93c[_0xf2fa('0x36')]['fields']));_0x59b864[_0xf2fa('0x3f')]=_0x59b864[_0xf2fa('0x3f')]['length']?_0x59b864['attributes']:_0x53221c[_0xf2fa('0x39')];if(!_0x4dd93c[_0xf2fa('0x36')][_0xf2fa('0xa3')]('nolimit')){_0x59b864['limit']=qs[_0xf2fa('0x23')](_0x4dd93c['query'][_0xf2fa('0x23')]);_0x59b864[_0xf2fa('0x21')]=qs[_0xf2fa('0x21')](_0x4dd93c['query'][_0xf2fa('0x21')]);}_0x59b864[_0xf2fa('0x97')]=qs[_0xf2fa('0x98')](_0x4dd93c[_0xf2fa('0x36')][_0xf2fa('0x98')]);_0x59b864[_0xf2fa('0x99')]=qs['filters'](_[_0xf2fa('0x9a')](_0x4dd93c[_0xf2fa('0x36')],_0x53221c[_0xf2fa('0x3d')]));_0x59b864[_0xf2fa('0x99')][_0xf2fa('0xa4')]=_0x4ae4df['id'];if(_0x4dd93c['query'][_0xf2fa('0x9b')]){_0x59b864[_0xf2fa('0x99')]=_[_0xf2fa('0x2f')](_0x59b864[_0xf2fa('0x99')],{'$or':_[_0xf2fa('0x32')](_0x59b864[_0xf2fa('0x3f')],function(_0x3bde55){var _0x20357f={};_0x20357f[_0x3bde55]={'$like':'%'+_0x4dd93c['query'][_0xf2fa('0x9b')]+'%'};return _0x20357f;})});}_0x59b864[_0xf2fa('0x99')][_0xf2fa('0x88')]=![];if(_0x4dd93c['query']['id']){_0x59b864[_0xf2fa('0x99')]['id']={'$gt':_0x4dd93c[_0xf2fa('0x36')]['id']};}_0x59b864=_[_0xf2fa('0x2f')]({},_0x59b864,_0x4dd93c[_0xf2fa('0x9f')]);return db['ChatMessage']['count']({'where':_0x59b864[_0xf2fa('0x99')]})[_0xf2fa('0x15')](function(_0x5776d7){_0x1ae891['count']=_0x5776d7;_0x59b864[_0xf2fa('0xa0')]=[];if(_0x4dd93c[_0xf2fa('0x36')][_0xf2fa('0xa5')]){_0x59b864[_0xf2fa('0xa0')][_0xf2fa('0xa6')]({'model':db['User'],'as':'User','attributes':['id',_0xf2fa('0x4e'),_0xf2fa('0x83')]});}if(_0x4dd93c[_0xf2fa('0x36')][_0xf2fa('0x42')]){_0x59b864[_0xf2fa('0xa0')]=[{'all':!![]}];}return db[_0xf2fa('0x5b')][_0xf2fa('0xa1')](_0x59b864);})[_0xf2fa('0x15')](function(_0x430fdb){_0x1ae891['rows']=_0x430fdb;return _0x1ae891;});}})['then'](respondWithFilteredResult(_0x2ac43c,_0x59b864))['catch'](handleError(_0x2ac43c,null));};exports['addTags']=function(_0x2dd141,_0x16f79d){return db[_0xf2fa('0x3a')][_0xf2fa('0x45')]({'where':{'id':_0x2dd141['params']['id']}})[_0xf2fa('0x15')](handleEntityNotFound(_0x16f79d,null))[_0xf2fa('0x15')](function(_0x424dc4){if(_0x424dc4){return _0x424dc4[_0xf2fa('0xa7')](_0x2dd141[_0xf2fa('0x44')][_0xf2fa('0x94')],_[_0xf2fa('0x93')](_0x2dd141[_0xf2fa('0x44')],[_0xf2fa('0x94'),'id'])||{})[_0xf2fa('0xa8')](function(){return db[_0xf2fa('0xa9')][_0xf2fa('0xa1')]({'attributes':['id',_0xf2fa('0x2c'),'color'],'where':{'id':_0x2dd141[_0xf2fa('0x44')][_0xf2fa('0x94')]}});})[_0xf2fa('0x15')](function(_0x20a488){socket[_0xf2fa('0xaa')](_0xf2fa('0xab'),{'id':Number(_0x2dd141[_0xf2fa('0x38')]['id']),'tags':_0x20a488||[]});return{'id':Number(_0x2dd141['params']['id']),'tags':_0x20a488||[]};});}})[_0xf2fa('0x15')](respondWithResult(_0x16f79d,null))[_0xf2fa('0x1e')](handleError(_0x16f79d,null));};exports[_0xf2fa('0xac')]=function(_0x3b645a,_0xfb9985){return db[_0xf2fa('0x3a')][_0xf2fa('0x45')]({'where':{'id':_0x3b645a[_0xf2fa('0x38')]['id']}})['then'](handleEntityNotFound(_0xfb9985,null))[_0xf2fa('0x15')](function(_0x567bc8){if(_0x567bc8){return _0x567bc8[_0xf2fa('0xac')](_0x3b645a[_0xf2fa('0x36')][_0xf2fa('0x94')]);}})[_0xf2fa('0x15')](respondWithStatusCode(_0xfb9985,null))[_0xf2fa('0x1e')](handleError(_0xfb9985,null));};exports[_0xf2fa('0x71')]=function(_0x38b6e4,_0x278409){var _0x40433f=moment()[_0xf2fa('0xad')]()[_0xf2fa('0xae')]();var _0x428d86=path['join'](config[_0xf2fa('0x74')],_0xf2fa('0xaf'),_0xf2fa('0xb0'),_0xf2fa('0xb1'));var _0x3a23a6=path['join'](config[_0xf2fa('0x74')],_0xf2fa('0xaf'),'files',_0xf2fa('0xb2'));var _0x121fc8=path['join'](_0x428d86,_0x40433f);var _0x553b27=util[_0xf2fa('0x76')](_0xf2fa('0xb3'),_0x38b6e4['params']['id'],_0x40433f);var _0x59201f=path[_0xf2fa('0x6e')](_0x428d86,_0x553b27);var _0x3f0502=[];_0x3f0502['push']({'model':db[_0xf2fa('0x79')],'as':_0xf2fa('0x79'),'attributes':['id',_0xf2fa('0x4e')],'raw':!![]});_0x3f0502[_0xf2fa('0xa6')]({'model':db['CmContact'],'as':_0xf2fa('0xb4'),'attributes':['id',_0xf2fa('0xb5'),_0xf2fa('0xb6')],'raw':!![]});if(_0x38b6e4[_0xf2fa('0x36')][_0xf2fa('0xb2')]){_0x3f0502[_0xf2fa('0xa6')]({'model':db[_0xf2fa('0x69')],'as':_0xf2fa('0x69'),'raw':!![]});}var _0x32e3d9=[{'model':db['ChatMessage'],'as':_0xf2fa('0x7c'),'attributes':['id','body',_0xf2fa('0xb7'),'direction',_0xf2fa('0x88'),'read'],'include':_0x3f0502}];_0x32e3d9['push']({'model':db[_0xf2fa('0x7a')],'as':_0xf2fa('0xb8'),'attributes':['id',_0xf2fa('0x2c')]});_0x32e3d9[_0xf2fa('0xa6')]({'model':db[_0xf2fa('0x79')],'as':'Owner','attributes':['id',_0xf2fa('0x4e')]});return db[_0xf2fa('0x3a')]['find']({'where':{'id':_0x38b6e4[_0xf2fa('0x38')]['id']},'include':_0x32e3d9})[_0xf2fa('0x15')](handleEntityNotFound(_0x278409,null))[_0xf2fa('0x15')](function(_0x4e5c7f){if(_0x4e5c7f){var _0x2eab29=_0x4e5c7f[_0xf2fa('0xb9')]({'plain':!![]});fs['mkdirSync'](_0x121fc8);var _0x10663f={'channel':_0xf2fa('0xba'),'account':_0x2eab29[_0xf2fa('0xb8')][_0xf2fa('0x2c')],'agent':_0x2eab29[_0xf2fa('0xbb')]?_0x2eab29['Owner'][_0xf2fa('0x4e')]:_0xf2fa('0xbc'),'createdAt':moment(_0x2eab29[_0xf2fa('0xb7')])[_0xf2fa('0x76')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'closedAt':_0x2eab29[_0xf2fa('0x62')]?moment(_0x2eab29[_0xf2fa('0xbd')])[_0xf2fa('0x76')](_0xf2fa('0x9e'))[_0xf2fa('0xae')]():'','disposition':_0x2eab29[_0xf2fa('0x63')],'chatInfo':{'browser':_0x2eab29[_0xf2fa('0xbe')],'os':_0x2eab29[_0xf2fa('0xbf')],'referer':_0x2eab29[_0xf2fa('0xc0')],'customerIp':_0x2eab29[_0xf2fa('0xc1')],'customerPort':_0x2eab29['customerPort']?_0x2eab29['customerPort']:_0xf2fa('0xbc')},'messages':_(_0x2eab29[_0xf2fa('0x7c')])[_0xf2fa('0xc2')]()[_0xf2fa('0x9b')]({'secret':![]})[_0xf2fa('0x32')](function(_0x5aea6e){if(_0x5aea6e[_0xf2fa('0x69')]){var _0x269b60=path[_0xf2fa('0x6e')](_0x3a23a6,_0x5aea6e[_0xf2fa('0x69')][_0xf2fa('0x67')]);if(fs[_0xf2fa('0xc3')](_0x269b60)){fs['createReadStream'](_0x269b60)[_0xf2fa('0xc4')](fs[_0xf2fa('0xc5')](path[_0xf2fa('0x6e')](_0x121fc8,_0x5aea6e[_0xf2fa('0x69')]['basename'])));}}return{'date':moment(_0x5aea6e[_0xf2fa('0xb7')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xf2fa('0xae')](),'sender':_0x5aea6e[_0xf2fa('0x87')]===_0xf2fa('0x5a')?_0x5aea6e[_0xf2fa('0x79')]?_0x5aea6e[_0xf2fa('0x79')][_0xf2fa('0x4e')]:_0xf2fa('0x7f'):_0x5aea6e[_0xf2fa('0xb4')][_0xf2fa('0xb5')]+(_0x5aea6e[_0xf2fa('0xb4')][_0xf2fa('0xb6')]?'\x20'+_0x5aea6e[_0xf2fa('0xb4')]['lastName']:''),'body':_0x5aea6e['Attachment']?_0x5aea6e['Attachment']['basename']:_0x5aea6e[_0xf2fa('0x44')],'direction':_0x5aea6e[_0xf2fa('0x87')]===_0xf2fa('0x5a')?'A':'C','secret':_0x5aea6e[_0xf2fa('0x88')],'read':_0x5aea6e[_0xf2fa('0xc6')],'attachment':_0x5aea6e[_0xf2fa('0x69')]};})[_0xf2fa('0xc7')]()};return ejs[_0xf2fa('0xc8')](path[_0xf2fa('0x6e')](config[_0xf2fa('0x74')],_0xf2fa('0xaf'),_0xf2fa('0xc9'),_0xf2fa('0xca')),{'interaction':_0x10663f})['then'](function(_0x580e53){var _0x426fcf=path[_0xf2fa('0x6e')](_0x121fc8,_0xf2fa('0xcb')+_0x2eab29['id']+'-'+_0x40433f+'.pdf');var _0x4c8b88={'path':_0x426fcf,'channel':_0xf2fa('0xba'),'interactionId':_0x2eab29['id']};return pdf[_0xf2fa('0xcc')](_0x580e53,_0x4c8b88);})[_0xf2fa('0x15')](function(){return new Promise(function(_0x1b336e,_0x343241){zipdir(_0x121fc8,{'saveTo':_0x59201f},function(_0x5848ea,_0x3d49f9){if(_0x5848ea)return _0x343241(_0x5848ea);return _0x1b336e(_0x3d49f9);});})[_0xf2fa('0x15')](function(){return new BPromise(function(_0x59eaf4,_0x438f3d){rimraf(_0x121fc8,function(_0x40b2b9){if(_0x40b2b9)_0x438f3d(_0x40b2b9);return _0x59eaf4();});});})['then'](function(){return _0x278409[_0xf2fa('0x71')](_0x59201f,_0x553b27,function(_0x5a482c){if(_0x5a482c){logger[_0xf2fa('0x1a')]('err',_0x5a482c);}else{fs[_0xf2fa('0xcd')](_0x59201f);}});});});}else{return _0x278409['sendStatus'](0xc8);}})['catch'](handleError(_0x278409,null));}; \ No newline at end of file +var _0x22c9=['Messages','User','ChatWebsiteId','ContactId','length','%s%d','agentAlias','customer','Visitor','System','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','MailServerOut','Smtp','CloudProvider','getSmtpOptions','SendMail','\x22%s\x22\x20<%s>','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','hasOwnProperty','nolimit','order','sort','where','pick','filter','split','rows','getMyMessages','ChatInteractionId','push','addTags','setTags','spread','Tag','color','chatInteractionTags:save','removeTags','server','files','tmp','attachments','transcript-%d-%s.zip','firstName','lastName','Account','get','mkdirSync','Chat','Owner','N.A.','closedAt','YYYY-MM-DD\x20HH:mm:ss','toString','osName','customerIp','customerPort','tail','value','renderFile','views','downloadInteraction.ejs','createPdfFromHTML','rimraf','zip-dir','request-promise','moment','mustache','lodash','../../components/interaction/service','../../components/parsers/qs','../../config/logger','../../config/environment','redis','defaults','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','request','info','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','ChatInteraction,\x20%s,\x20%s','message','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','update','then','destroy','stack','name','send','render','merge','body','contact','agent','interaction','account','map','ChatInteraction','rawAttributes','type','key','getOptions','findAll','chat','query','user','show','params','model','keys','filters','intersection','attributes','fields','includeAll','include','options','create','find','describe','createVidaooSession','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','fullname','email','POST','isNull','parse','metadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','updateAttributes','customUpdate','CmContact','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','file','basename','filename','mimetype','Attachment','Unauthorized','attachId','join','root','server/files/attachments/','offline-chat/','download','close','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','now'];(function(_0x120f6d,_0x543071){var _0x1498dd=function(_0x350147){while(--_0x350147){_0x120f6d['push'](_0x120f6d['shift']());}};_0x1498dd(++_0x543071);}(_0x22c9,0x1cf));var _0x922c=function(_0x524bb0,_0x326327){_0x524bb0=_0x524bb0-0x0;var _0x2fb947=_0x22c9[_0x524bb0];return _0x2fb947;};'use strict';var rimraf=require(_0x922c('0x0'));var zipdir=require(_0x922c('0x1'));var rp=require(_0x922c('0x2'));var moment=require(_0x922c('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x922c('0x4'));var util=require('util');var path=require('path');var ejs=require('ejs');var fs=require('fs');var _=require(_0x922c('0x5'));var Redis=require('ioredis');var interaction=require(_0x922c('0x6'));var qs=require(_0x922c('0x7'));var pdf=require('../../components/export/pdf');var logger=require(_0x922c('0x8'))('api');var config=require(_0x922c('0x9'));var db=require('../../mysqldb')['db'];config[_0x922c('0xa')]=_[_0x922c('0xb')](config[_0x922c('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x922c('0xc'))(new Redis(config[_0x922c('0xa')]));require(_0x922c('0xd'))[_0x922c('0xe')](socket);var jayson=require(_0x922c('0xf'));var client=jayson['client']['http']({'port':0x232b});var client9004=jayson[_0x922c('0x10')]['http']({'port':0x232c});function respondWithRpcPromise(_0x42088a,_0x4d9075,_0x4b4b6b,_0xa5676c){return new BPromise(function(_0x29005e,_0x4092a5){var _0x160522=_0xa5676c||client;return _0x160522[_0x922c('0x11')](_0x42088a,_0x4b4b6b)['then'](function(_0x10a1ae){logger[_0x922c('0x12')]('ChatInteraction,\x20%s,\x20%s',_0x4d9075,_0x922c('0x13'));logger[_0x922c('0x14')](_0x922c('0x15'),_0x4d9075,_0x922c('0x13'),JSON[_0x922c('0x16')](_0x10a1ae));if(_0x10a1ae[_0x922c('0x17')]){if(_0x10a1ae[_0x922c('0x17')]['code']===0x1f4){logger['error'](_0x922c('0x18'),_0x4d9075,_0x10a1ae['error'][_0x922c('0x19')]);return _0x4092a5(_0x10a1ae['error'][_0x922c('0x19')]);}logger[_0x922c('0x17')](_0x922c('0x18'),_0x4d9075,_0x10a1ae[_0x922c('0x17')][_0x922c('0x19')]);return _0x29005e(_0x10a1ae[_0x922c('0x17')][_0x922c('0x19')]);}else{logger[_0x922c('0x12')](_0x922c('0x18'),_0x4d9075,_0x922c('0x13'));_0x29005e(_0x10a1ae['result']['message']);}})[_0x922c('0x1a')](function(_0x3ec5e6){logger[_0x922c('0x17')]('ChatInteraction,\x20%s,\x20%s',_0x4d9075,_0x3ec5e6);_0x4092a5(_0x3ec5e6);});});}function respondWithStatusCode(_0x5618e9,_0x5a4f5b){_0x5a4f5b=_0x5a4f5b||0xcc;return function(_0x2343e3){if(_0x2343e3){return _0x5618e9[_0x922c('0x1b')](_0x5a4f5b);}return _0x5618e9[_0x922c('0x1c')](_0x5a4f5b)[_0x922c('0x1d')]();};}function respondWithResult(_0x154b65,_0x52596c){_0x52596c=_0x52596c||0xc8;return function(_0x34a5f7){if(_0x34a5f7){return _0x154b65[_0x922c('0x1c')](_0x52596c)[_0x922c('0x1e')](_0x34a5f7);}};}function respondWithFilteredResult(_0x64aa91,_0x40220c){return function(_0x2e5f95){if(_0x2e5f95){var _0x2c4a5a=typeof _0x40220c[_0x922c('0x1f')]===_0x922c('0x20')&&typeof _0x40220c['limit']===_0x922c('0x20');var _0x5273f1=_0x2e5f95[_0x922c('0x21')];var _0x54f8b9=_0x2c4a5a?0x0:_0x40220c[_0x922c('0x1f')];var _0x26cc1a=_0x2c4a5a?_0x2e5f95[_0x922c('0x21')]:_0x40220c[_0x922c('0x1f')]+_0x40220c[_0x922c('0x22')];var _0x32b499;if(_0x26cc1a>=_0x5273f1){_0x26cc1a=_0x5273f1;_0x32b499=0xc8;}else{_0x32b499=0xce;}_0x64aa91['status'](_0x32b499);return _0x64aa91[_0x922c('0x23')](_0x922c('0x24'),_0x54f8b9+'-'+_0x26cc1a+'/'+_0x5273f1)[_0x922c('0x1e')](_0x2e5f95);}return null;};}function saveUpdates(_0x1e79ce){return function(_0x5b5ee6){if(_0x5b5ee6){return _0x5b5ee6[_0x922c('0x25')](_0x1e79ce)[_0x922c('0x26')](function(_0x1914b9){return _0x1914b9;});}return null;};}function removeEntity(_0x8fcf59){return function(_0x210113){if(_0x210113){return _0x210113[_0x922c('0x27')]()[_0x922c('0x26')](function(){_0x8fcf59['status'](0xcc)[_0x922c('0x1d')]();});}};}function handleEntityNotFound(_0x44dddd){return function(_0x1f6af2){if(!_0x1f6af2){_0x44dddd[_0x922c('0x1b')](0x194);}return _0x1f6af2;};}function handleError(_0x5103a4,_0x13221e){_0x13221e=_0x13221e||0x1f4;return function(_0x1fc26c){logger[_0x922c('0x17')](_0x1fc26c[_0x922c('0x28')]);if(_0x1fc26c['name']){delete _0x1fc26c[_0x922c('0x29')];}_0x5103a4[_0x922c('0x1c')](_0x13221e)[_0x922c('0x2a')](_0x1fc26c);};}function getMustacheRender(_0x560d65,_0x3c0d55){return Mustache[_0x922c('0x2b')](_0x560d65,_[_0x922c('0x2c')](_0x3c0d55[_0x922c('0x2d')],{'contact':_0x3c0d55[_0x922c('0x2e')],'message':_0x3c0d55[_0x922c('0x19')],'agent':_0x3c0d55[_0x922c('0x2f')],'interaction':_0x3c0d55[_0x922c('0x30')],'account':_0x3c0d55[_0x922c('0x31')]}))||'';}exports['index']=function(_0x36ecd9,_0x26fec6){var _0x111a5a={};var _0x53a0b0=_[_0x922c('0x32')](db[_0x922c('0x33')][_0x922c('0x34')],function(_0x4bc671){return{'name':_0x4bc671['fieldName'],'type':_0x4bc671[_0x922c('0x35')][_0x922c('0x36')]};});_0x111a5a=qs[_0x922c('0x37')](_0x53a0b0,_0x36ecd9);return interaction[_0x922c('0x38')](_0x922c('0x39'),_0x36ecd9[_0x922c('0x3a')],_0x36ecd9[_0x922c('0x3b')],_0x111a5a,_0x53a0b0)['then'](respondWithFilteredResult(_0x26fec6,_0x111a5a))['catch'](handleError(_0x26fec6,null));};exports[_0x922c('0x3c')]=function(_0x42418d,_0x40e142){var _0x25a71d={'raw':![],'where':{'id':_0x42418d[_0x922c('0x3d')]['id']}},_0x4beff6={};_0x4beff6[_0x922c('0x3e')]=_[_0x922c('0x3f')](db[_0x922c('0x33')][_0x922c('0x34')]);_0x4beff6['query']=_[_0x922c('0x3f')](_0x42418d[_0x922c('0x3a')]);_0x4beff6[_0x922c('0x40')]=_[_0x922c('0x41')](_0x4beff6[_0x922c('0x3e')],_0x4beff6['query']);_0x25a71d[_0x922c('0x42')]=_['intersection'](_0x4beff6[_0x922c('0x3e')],qs[_0x922c('0x43')](_0x42418d['query'][_0x922c('0x43')]));_0x25a71d[_0x922c('0x42')]=_0x25a71d[_0x922c('0x42')]['length']?_0x25a71d[_0x922c('0x42')]:_0x4beff6['model'];if(_0x42418d[_0x922c('0x3a')][_0x922c('0x44')]){_0x25a71d[_0x922c('0x45')]=[{'all':!![]}];}_0x25a71d=_[_0x922c('0x2c')]({},_0x25a71d,_0x42418d[_0x922c('0x46')]);return db['ChatInteraction']['find'](_0x25a71d)['then'](handleEntityNotFound(_0x40e142,null))[_0x922c('0x26')](respondWithResult(_0x40e142,null))[_0x922c('0x1a')](handleError(_0x40e142,null));};exports[_0x922c('0x47')]=function(_0x46195e,_0x43ce1f){return db[_0x922c('0x33')][_0x922c('0x47')](_0x46195e[_0x922c('0x2d')],{})[_0x922c('0x26')](respondWithResult(_0x43ce1f,0xc9))[_0x922c('0x1a')](handleError(_0x43ce1f,null));};exports[_0x922c('0x25')]=function(_0x3ca96d,_0x48d3bf){if(_0x3ca96d[_0x922c('0x2d')]['id']){delete _0x3ca96d[_0x922c('0x2d')]['id'];}return db['ChatInteraction']['find']({'where':{'id':_0x3ca96d[_0x922c('0x3d')]['id']}})[_0x922c('0x26')](handleEntityNotFound(_0x48d3bf,null))[_0x922c('0x26')](saveUpdates(_0x3ca96d['body'],null))[_0x922c('0x26')](respondWithResult(_0x48d3bf,null))['catch'](handleError(_0x48d3bf,null));};exports['destroy']=function(_0x1c9022,_0x11eddb){return db[_0x922c('0x33')][_0x922c('0x48')]({'where':{'id':_0x1c9022[_0x922c('0x3d')]['id']}})[_0x922c('0x26')](handleEntityNotFound(_0x11eddb,null))[_0x922c('0x26')](removeEntity(_0x11eddb,null))[_0x922c('0x1a')](handleError(_0x11eddb,null));};exports[_0x922c('0x49')]=function(_0x295d00,_0x26e89c){return db['ChatInteraction'][_0x922c('0x49')]()[_0x922c('0x26')](respondWithResult(_0x26e89c,null))[_0x922c('0x1a')](handleError(_0x26e89c,null));};exports[_0x922c('0x4a')]=function(_0x4a6a1b,_0xd8a884){var _0x143b02=_0x4a6a1b['params']['id'];var _0x1cea44;var _0x11d0d1;var _0x5736a0;return db[_0x922c('0x33')][_0x922c('0x4b')]({'where':{'id':_0x143b02}})['then'](function(_0x3be5b2){_0x1cea44=_0x3be5b2;return db[_0x922c('0x4c')][_0x922c('0x4b')]({'where':{'id':_0x3be5b2['ChatWebsiteId']},'attributes':['id',_0x922c('0x4d'),_0x922c('0x4e'),_0x922c('0x4f'),_0x922c('0x50'),_0x922c('0x51')],'raw':!![]});})['then'](function(_0x4d804a){if(_0x4d804a&&_0x4d804a['vidaooApiKey']&&_0x4d804a[_0x922c('0x4e')]){_0x11d0d1=_0x4d804a;var _0x2ad2f3={'interaction':{'id':_0x143b02},'agent':{'id':_0x4a6a1b[_0x922c('0x3b')]['id'],'name':_0x4a6a1b['user']['name'],'fullname':_0x4a6a1b[_0x922c('0x3b')][_0x922c('0x52')],'email':_0x4a6a1b[_0x922c('0x3b')][_0x922c('0x53')]},'contact':_0x4a6a1b[_0x922c('0x2d')]['contact'],'account':_0x4a6a1b[_0x922c('0x2d')][_0x922c('0x31')]};var _0x217719={'rejectUnauthorized':![],'method':_0x922c('0x54'),'url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0x4d804a[_0x922c('0x4d')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x4a6a1b[_0x922c('0x3b')][_0x922c('0x53')]],'buttons':null,'topic':_0x11d0d1['vidaooTopic'],'note':_[_0x922c('0x55')](_0x11d0d1[_0x922c('0x50')])?null:getMustacheRender(_0x11d0d1[_0x922c('0x50')],_0x2ad2f3),'metadata':null},'redirect':'follow','json':!![]};try{if(!_['isNull'](_0x11d0d1[_0x922c('0x51')])){var _0x8a2794=getMustacheRender(_0x11d0d1['vidaooMetadata'],_0x2ad2f3);var _0x22cc44=JSON[_0x922c('0x56')](_0x8a2794);_0x217719[_0x922c('0x2d')][_0x922c('0x57')]=_0x22cc44;}}catch(_0x3e18cf){throw new db[(_0x922c('0x58'))][(_0x922c('0x59'))](_0x922c('0x5a'));}return rp(_0x217719);}else{throw new db['Sequelize'][(_0x922c('0x59'))](_0x922c('0x5b'));}})['then'](function(_0x4d98de){_0x5736a0=_0x4d98de;if(_0x5736a0['id']){var _0x13e74b={'body':_0x5736a0[_0x922c('0x5c')],'ChatWebsiteId':_0x11d0d1['id'],'ChatInteractionId':_0x1cea44['id'],'direction':_0x922c('0x5d'),'UserId':_0x4a6a1b[_0x922c('0x3b')]['id']};return db[_0x922c('0x5e')][_0x922c('0x47')](_0x13e74b,{});}else{throw new db[(_0x922c('0x58'))][(_0x922c('0x59'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0x922c('0x26')](function(){return _0x1cea44[_0x922c('0x5f')]({'vidaooSessionId':_0x5736a0['id']});})[_0x922c('0x26')](respondWithResult(_0xd8a884,null))[_0x922c('0x1a')](handleError(_0xd8a884,null));};exports[_0x922c('0x60')]=function(_0x4bc9e1,_0x587129){if(_0x4bc9e1[_0x922c('0x2d')]['id']){delete _0x4bc9e1['body']['id'];}return db[_0x922c('0x33')]['find']({'where':{'id':_0x4bc9e1[_0x922c('0x3d')]['id']},'include':[{'model':db[_0x922c('0x61')],'as':_0x922c('0x62')}]})[_0x922c('0x26')](handleEntityNotFound(_0x587129,null))[_0x922c('0x26')](saveUpdates(_0x4bc9e1[_0x922c('0x2d')],null))[_0x922c('0x26')](respondWithResult(_0x587129,null))[_0x922c('0x1a')](handleError(_0x587129,null));};exports[_0x922c('0x63')]=function(_0x517de8,_0x57a2d4){if(_0x517de8[_0x922c('0x2d')]['id']){delete _0x517de8[_0x922c('0x2d')]['id'];}return db[_0x922c('0x33')][_0x922c('0x48')]({'where':{'id':_0x517de8[_0x922c('0x3d')]['id']}})[_0x922c('0x26')](function(_0x40924c){if(!_0x40924c){logger[_0x922c('0x17')](_0x922c('0x64'),_0x922c('0x63'),0x194,_0x922c('0x65'));_0x57a2d4['sendStatus'](0x194);}else{if(_0x40924c[_0x922c('0x66')]){throw new db[(_0x922c('0x58'))][(_0x922c('0x59'))](_0x922c('0x67'));}}return _0x40924c;})[_0x922c('0x26')](function(_0x363e52){if(_0x363e52){return _0x363e52['update']({'closed':_0x517de8[_0x922c('0x2d')][_0x922c('0x68')],'disposition':_0x517de8[_0x922c('0x2d')][_0x922c('0x69')]})['then'](function(_0x105aff){return _0x105aff;});}})[_0x922c('0x26')](function(){return respondWithRpcPromise(_0x922c('0x6a'),_0x922c('0x63'),_0x517de8['body'],client9004);})[_0x922c('0x26')](respondWithResult(_0x57a2d4,null))[_0x922c('0x1a')](handleError(_0x57a2d4,null));};exports['attachmentUpload']=function(_0x2710de,_0x34f6a4){_0x2710de['body'][_0x922c('0x29')]=_0x2710de[_0x922c('0x6b')]['originalname'];_0x2710de[_0x922c('0x2d')][_0x922c('0x6c')]=_0x2710de[_0x922c('0x6b')][_0x922c('0x6d')];_0x2710de[_0x922c('0x2d')][_0x922c('0x35')]=_0x2710de[_0x922c('0x6b')][_0x922c('0x6e')];return db[_0x922c('0x6f')][_0x922c('0x47')](_0x2710de[_0x922c('0x2d')])[_0x922c('0x26')](respondWithResult(_0x34f6a4,0xc9))[_0x922c('0x1a')](handleError(_0x34f6a4,null));};exports['attachmentDownload']=function(_0x59f65b,_0x571443){return db[_0x922c('0x33')][_0x922c('0x4b')]({'where':{'id':_0x59f65b[_0x922c('0x3d')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x571443,null))['then'](function(_0x6bf263){if(_0x6bf263){if(_0x6bf263[_0x922c('0x68')]){return _0x571443[_0x922c('0x1c')](0x193)[_0x922c('0x1e')]({'status':0x193,'message':_0x922c('0x70')});}return db[_0x922c('0x6f')]['findOne']({'where':{'id':_0x59f65b[_0x922c('0x3a')][_0x922c('0x71')]},'raw':!![]})[_0x922c('0x26')](handleEntityNotFound(_0x571443,null));}})[_0x922c('0x26')](function(_0x5cb8a0){if(_0x5cb8a0){var _0x5d6f66=_0x5cb8a0['ChatOfflineMessageId']!==null;var _0x537d63=path[_0x922c('0x72')](config[_0x922c('0x73')],_0x922c('0x74'));if(_0x5d6f66){_0x537d63=path['join'](_0x537d63,_0x922c('0x75'));}var _0x12f2f4=path[_0x922c('0x72')](_0x537d63,_0x5cb8a0['basename']);return _0x571443[_0x922c('0x76')](_0x12f2f4);}})[_0x922c('0x1a')](handleError(_0x571443,null));};exports[_0x922c('0x77')]=function(_0x1657f8,_0x33ad10){var _0x2d7719=null;var _0x3bfba7=null;var _0x196f69=null;if(_0x1657f8[_0x922c('0x2d')]['id']){delete _0x1657f8[_0x922c('0x2d')]['id'];}if(_0x1657f8[_0x922c('0x2d')][_0x922c('0x78')]){_0x196f69=path[_0x922c('0x72')](config[_0x922c('0x73')],_0x922c('0x79'),util[_0x922c('0x7a')](_0x922c('0x7b'),Date[_0x922c('0x7c')]()));_0x1657f8['body']['pathTranscript']=_0x196f69;}return db[_0x922c('0x33')]['find']({'where':{'id':_0x1657f8['params']['id']},'include':[{'model':db[_0x922c('0x5e')],'as':_0x922c('0x7d'),'include':[{'model':db['User'],'as':_0x922c('0x7e')}]}]})['then'](handleEntityNotFound(_0x33ad10,null))[_0x922c('0x26')](saveUpdates(_0x1657f8[_0x922c('0x2d')],null))['then'](function(_0x50b5cb){if(_0x50b5cb){_0x2d7719=_0x50b5cb;return db['ChatWebsite'][_0x922c('0x48')]({'where':{'id':_0x2d7719[_0x922c('0x7f')]}});}})['then'](function(_0x5cddbb){if(_0x5cddbb){_0x3bfba7=_0x5cddbb;return db[_0x922c('0x61')][_0x922c('0x48')]({'where':{'id':_0x2d7719[_0x922c('0x80')]}});}})['then'](function(_0x348655){if(_0x348655){if(_0x196f69){var _0x561aca=null;for(var _0x2737a2=0x1;_0x2737a2<_0x2d7719[_0x922c('0x7d')][_0x922c('0x81')];++_0x2737a2){_0x561aca=_0x2d7719[_0x922c('0x7d')][_0x2737a2];var _0x3eb06d=_0x561aca[_0x922c('0x66')]?util[_0x922c('0x7a')](_0x922c('0x82'),_0x3bfba7[_0x922c('0x83')],_0x561aca[_0x922c('0x66')]):'System';var _0xd27d02=_0x1657f8['body'][_0x922c('0x84')]||util['format'](_0x922c('0x82'),_0x922c('0x85'),_0x561aca['ContactId']);switch(_0x3bfba7['agentIdentifier']){case'website_alias':_0x3eb06d=_0x561aca[_0x922c('0x66')]?util['format'](_0x922c('0x82'),_0x3bfba7['agentAlias'],_0x561aca['UserId']):_0x922c('0x86');break;case'agent_alias':_0x3eb06d=_0x561aca[_0x922c('0x66')]?_0x561aca[_0x922c('0x7e')][_0x922c('0x87')]||_0x561aca[_0x922c('0x7e')][_0x922c('0x52')]:_0x922c('0x86');break;case _0x922c('0x88'):_0x3eb06d=_0x561aca[_0x922c('0x66')]?_0x561aca[_0x922c('0x7e')]['fullname']:_0x922c('0x86');break;default:_0x3eb06d=_0x561aca[_0x922c('0x66')]?util[_0x922c('0x7a')](_0x922c('0x82'),_0x3bfba7[_0x922c('0x83')],_0x561aca[_0x922c('0x66')]):'System';}var _0x725a1=util['format'](_0x922c('0x89'),moment(_0x561aca[_0x922c('0x8a')])['format'](_0x922c('0x8b')),_0x561aca[_0x922c('0x8c')]==='in'?_0xd27d02:_0x3eb06d,_0x561aca[_0x922c('0x2d')]);if(!_0x561aca[_0x922c('0x8d')]){fs['appendFileSync'](_0x196f69,_0x725a1);}}return db['MailAccount'][_0x922c('0x4b')]({'where':{'service':!![]},'include':[{'model':db[_0x922c('0x8e')],'as':_0x922c('0x8f'),'raw':!![],'include':[{'model':db[_0x922c('0x90')],'as':_0x922c('0x90'),'raw':!![]}]}]});}}})[_0x922c('0x26')](function(_0x5b7cbe){if(!_0x5b7cbe||!_0x5b7cbe[_0x922c('0x8f')]||!_0x1657f8[_0x922c('0x2d')])return _0x2d7719;var _0x180d60=_0x5b7cbe[_0x922c('0x91')]();return respondWithRpcPromise(_0x922c('0x92'),'sendMail',{'account':_0x180d60,'message':{'from':util[_0x922c('0x7a')](_0x922c('0x93'),_0x5b7cbe[_0x922c('0x29')],_0x5b7cbe[_0x922c('0x53')]||_0x5b7cbe[_0x922c('0x8f')][_0x922c('0x3b')]),'to':_0x1657f8[_0x922c('0x2d')][_0x922c('0x78')],'subject':'Mail\x20Transcript','text':util['format'](_0x922c('0x94'),_0x1657f8['body'][_0x922c('0x78')]),'attachments':[{'path':_0x196f69}]}})[_0x922c('0x26')](function(){return _0x2d7719;})[_0x922c('0x1a')](function(_0x305f7f){logger[_0x922c('0x17')](_0x305f7f);});})[_0x922c('0x26')](respondWithStatusCode(_0x33ad10,0xc8))[_0x922c('0x1a')](handleError(_0x33ad10,null));};exports[_0x922c('0x95')]=function(_0x5e4417,_0x5c044f){return db[_0x922c('0x5e')]['find']({'where':{'id':_0x5e4417[_0x922c('0x3d')]['id']}})[_0x922c('0x26')](handleEntityNotFound(_0x5c044f,null))[_0x922c('0x26')](function(_0x1d583b){if(_0x1d583b){return _0x1d583b[_0x922c('0x95')](_0x5e4417[_0x922c('0x2d')][_0x922c('0x96')],_[_0x922c('0x97')](_0x5e4417[_0x922c('0x2d')],[_0x922c('0x96'),'id'])||{});}})[_0x922c('0x26')](respondWithResult(_0x5c044f,null))[_0x922c('0x1a')](handleError(_0x5c044f,null));};exports['getMessages']=function(_0x34a96d,_0x68257a){var _0x3beb16={'raw':![],'where':{}};var _0x55abc8={};var _0x29eb3b={'count':0x0,'rows':[]};return db[_0x922c('0x33')][_0x922c('0x4b')]({'where':{'id':_0x34a96d[_0x922c('0x3d')]['id']}})[_0x922c('0x26')](handleEntityNotFound(_0x68257a,null))[_0x922c('0x26')](function(_0xb1de28){if(_0xb1de28){_0x55abc8[_0x922c('0x3e')]=_[_0x922c('0x3f')](db[_0x922c('0x5e')]['rawAttributes']);_0x55abc8[_0x922c('0x3a')]=_['keys'](_0x34a96d[_0x922c('0x3a')]);_0x55abc8[_0x922c('0x40')]=_['intersection'](_0x55abc8[_0x922c('0x3e')],_0x55abc8['query']);_0x3beb16[_0x922c('0x42')]=_[_0x922c('0x41')](_0x55abc8[_0x922c('0x3e')],qs[_0x922c('0x43')](_0x34a96d['query'][_0x922c('0x43')]));_0x3beb16[_0x922c('0x42')]=_0x3beb16[_0x922c('0x42')][_0x922c('0x81')]?_0x3beb16[_0x922c('0x42')]:_0x55abc8[_0x922c('0x3e')];if(!_0x34a96d['query'][_0x922c('0x98')](_0x922c('0x99'))){_0x3beb16[_0x922c('0x22')]=qs['limit'](_0x34a96d[_0x922c('0x3a')]['limit']);_0x3beb16[_0x922c('0x1f')]=qs[_0x922c('0x1f')](_0x34a96d['query'][_0x922c('0x1f')]);}_0x3beb16[_0x922c('0x9a')]=qs[_0x922c('0x9b')](_0x34a96d['query'][_0x922c('0x9b')]);_0x3beb16[_0x922c('0x9c')]=qs['filters'](_[_0x922c('0x9d')](_0x34a96d[_0x922c('0x3a')],_0x55abc8['filters']));_0x3beb16['where']['ChatInteractionId']=_0xb1de28['id'];if(_0x34a96d[_0x922c('0x3a')][_0x922c('0x9e')]){_0x3beb16['where']=_[_0x922c('0x2c')](_0x3beb16[_0x922c('0x9c')],{'$or':_[_0x922c('0x32')](_0x3beb16['attributes'],function(_0x48ef62){var _0x3e4113={};_0x3e4113[_0x48ef62]={'$like':'%'+_0x34a96d[_0x922c('0x3a')][_0x922c('0x9e')]+'%'};return _0x3e4113;})});}if(_0x34a96d[_0x922c('0x3a')]['$gte']){var _0xc11ab7=_0x34a96d[_0x922c('0x3a')]['$gte'][_0x922c('0x9f')](',');var _0x44797e={};_0x44797e[_0xc11ab7[0x0]]={'$gte':moment(_0xc11ab7[0x1])[_0x922c('0x7a')]('YYYY-MM-DD\x20HH:mm:ss')};_0x3beb16[_0x922c('0x9c')]=_[_0x922c('0x2c')](_0x3beb16[_0x922c('0x9c')],_0x44797e);}_0x3beb16=_['merge']({},_0x3beb16,_0x34a96d[_0x922c('0x46')]);return db[_0x922c('0x5e')]['count']({'where':_0x3beb16[_0x922c('0x9c')]})[_0x922c('0x26')](function(_0x1b60b5){_0x29eb3b[_0x922c('0x21')]=_0x1b60b5;if(_0x34a96d[_0x922c('0x3a')][_0x922c('0x44')]){_0x3beb16['include']=[{'all':!![]}];}return db[_0x922c('0x5e')][_0x922c('0x38')](_0x3beb16);})[_0x922c('0x26')](function(_0x4f3f1a){_0x29eb3b[_0x922c('0xa0')]=_0x4f3f1a;return _0x29eb3b;});}})[_0x922c('0x26')](respondWithFilteredResult(_0x68257a,_0x3beb16))[_0x922c('0x1a')](handleError(_0x68257a,null));};exports[_0x922c('0xa1')]=function(_0x54e5ea,_0x40d71c){var _0x24e4db={'where':{}},_0xe2576f={},_0x107659={'count':0x0,'rows':[]};return db[_0x922c('0x33')][_0x922c('0x4b')]({'where':{'id':_0x54e5ea[_0x922c('0x3d')]['id']}})[_0x922c('0x26')](handleEntityNotFound(_0x40d71c,null))['then'](function(_0x5b0062){if(_0x5b0062){_0xe2576f['model']=_[_0x922c('0x3f')](db[_0x922c('0x5e')][_0x922c('0x34')]);_0xe2576f[_0x922c('0x3a')]=_[_0x922c('0x3f')](_0x54e5ea[_0x922c('0x3a')]);_0xe2576f[_0x922c('0x40')]=_[_0x922c('0x41')](_0xe2576f['model'],_0xe2576f[_0x922c('0x3a')]);_0x24e4db[_0x922c('0x42')]=_[_0x922c('0x41')](_0xe2576f['model'],qs[_0x922c('0x43')](_0x54e5ea[_0x922c('0x3a')][_0x922c('0x43')]));_0x24e4db['attributes']=_0x24e4db['attributes'][_0x922c('0x81')]?_0x24e4db[_0x922c('0x42')]:_0xe2576f[_0x922c('0x3e')];if(!_0x54e5ea['query'][_0x922c('0x98')](_0x922c('0x99'))){_0x24e4db[_0x922c('0x22')]=qs[_0x922c('0x22')](_0x54e5ea[_0x922c('0x3a')][_0x922c('0x22')]);_0x24e4db['offset']=qs[_0x922c('0x1f')](_0x54e5ea['query'][_0x922c('0x1f')]);}_0x24e4db['order']=qs[_0x922c('0x9b')](_0x54e5ea[_0x922c('0x3a')][_0x922c('0x9b')]);_0x24e4db[_0x922c('0x9c')]=qs[_0x922c('0x40')](_[_0x922c('0x9d')](_0x54e5ea['query'],_0xe2576f[_0x922c('0x40')]));_0x24e4db[_0x922c('0x9c')][_0x922c('0xa2')]=_0x5b0062['id'];if(_0x54e5ea[_0x922c('0x3a')][_0x922c('0x9e')]){_0x24e4db[_0x922c('0x9c')]=_[_0x922c('0x2c')](_0x24e4db[_0x922c('0x9c')],{'$or':_[_0x922c('0x32')](_0x24e4db[_0x922c('0x42')],function(_0x43ea50){var _0x5d895e={};_0x5d895e[_0x43ea50]={'$like':'%'+_0x54e5ea[_0x922c('0x3a')][_0x922c('0x9e')]+'%'};return _0x5d895e;})});}_0x24e4db['where'][_0x922c('0x8d')]=![];if(_0x54e5ea['query']['id']){_0x24e4db[_0x922c('0x9c')]['id']={'$gt':_0x54e5ea[_0x922c('0x3a')]['id']};}_0x24e4db=_[_0x922c('0x2c')]({},_0x24e4db,_0x54e5ea[_0x922c('0x46')]);return db[_0x922c('0x5e')][_0x922c('0x21')]({'where':_0x24e4db['where']})['then'](function(_0x3b55a0){_0x107659[_0x922c('0x21')]=_0x3b55a0;_0x24e4db[_0x922c('0x45')]=[];if(_0x54e5ea[_0x922c('0x3a')]['includeAgent']){_0x24e4db['include'][_0x922c('0xa3')]({'model':db['User'],'as':'User','attributes':['id',_0x922c('0x52'),'alias']});}if(_0x54e5ea[_0x922c('0x3a')][_0x922c('0x44')]){_0x24e4db[_0x922c('0x45')]=[{'all':!![]}];}return db[_0x922c('0x5e')][_0x922c('0x38')](_0x24e4db);})[_0x922c('0x26')](function(_0x3061ca){_0x107659[_0x922c('0xa0')]=_0x3061ca;return _0x107659;});}})[_0x922c('0x26')](respondWithFilteredResult(_0x40d71c,_0x24e4db))[_0x922c('0x1a')](handleError(_0x40d71c,null));};exports[_0x922c('0xa4')]=function(_0x47f9c4,_0x5768e1){return db[_0x922c('0x33')][_0x922c('0x48')]({'where':{'id':_0x47f9c4[_0x922c('0x3d')]['id']}})[_0x922c('0x26')](handleEntityNotFound(_0x5768e1,null))[_0x922c('0x26')](function(_0x3f7f97){if(_0x3f7f97){return _0x3f7f97[_0x922c('0xa5')](_0x47f9c4[_0x922c('0x2d')][_0x922c('0x96')],_[_0x922c('0x97')](_0x47f9c4[_0x922c('0x2d')],[_0x922c('0x96'),'id'])||{})[_0x922c('0xa6')](function(){return db[_0x922c('0xa7')][_0x922c('0x38')]({'attributes':['id',_0x922c('0x29'),_0x922c('0xa8')],'where':{'id':_0x47f9c4['body']['ids']}});})[_0x922c('0x26')](function(_0x48d45e){socket['emit'](_0x922c('0xa9'),{'id':Number(_0x47f9c4[_0x922c('0x3d')]['id']),'tags':_0x48d45e||[]});return{'id':Number(_0x47f9c4[_0x922c('0x3d')]['id']),'tags':_0x48d45e||[]};});}})[_0x922c('0x26')](respondWithResult(_0x5768e1,null))[_0x922c('0x1a')](handleError(_0x5768e1,null));};exports[_0x922c('0xaa')]=function(_0x4a080a,_0x54da9b){return db[_0x922c('0x33')]['find']({'where':{'id':_0x4a080a[_0x922c('0x3d')]['id']}})[_0x922c('0x26')](handleEntityNotFound(_0x54da9b,null))['then'](function(_0xd23953){if(_0xd23953){return _0xd23953[_0x922c('0xaa')](_0x4a080a['query'][_0x922c('0x96')]);}})[_0x922c('0x26')](respondWithStatusCode(_0x54da9b,null))['catch'](handleError(_0x54da9b,null));};exports[_0x922c('0x76')]=function(_0x31037,_0x2d9529){var _0x3413df=moment()['unix']()['toString']();var _0x471566=path[_0x922c('0x72')](config['root'],_0x922c('0xab'),_0x922c('0xac'),_0x922c('0xad'));var _0x2066e5=path[_0x922c('0x72')](config['root'],_0x922c('0xab'),_0x922c('0xac'),_0x922c('0xae'));var _0x8a770=path[_0x922c('0x72')](_0x471566,_0x3413df);var _0x57b32d=util[_0x922c('0x7a')](_0x922c('0xaf'),_0x31037[_0x922c('0x3d')]['id'],_0x3413df);var _0xb04275=path['join'](_0x471566,_0x57b32d);var _0x497595=[];_0x497595[_0x922c('0xa3')]({'model':db[_0x922c('0x7e')],'as':'User','attributes':['id',_0x922c('0x52')],'raw':!![]});_0x497595[_0x922c('0xa3')]({'model':db['CmContact'],'as':_0x922c('0x62'),'attributes':['id',_0x922c('0xb0'),_0x922c('0xb1')],'raw':!![]});if(_0x31037['query'][_0x922c('0xae')]){_0x497595[_0x922c('0xa3')]({'model':db[_0x922c('0x6f')],'as':_0x922c('0x6f'),'raw':!![]});}var _0x26cb92=[{'model':db[_0x922c('0x5e')],'as':_0x922c('0x7d'),'attributes':['id',_0x922c('0x2d'),_0x922c('0x8a'),_0x922c('0x8c'),_0x922c('0x8d'),'read'],'include':_0x497595}];_0x26cb92[_0x922c('0xa3')]({'model':db[_0x922c('0x4c')],'as':_0x922c('0xb2'),'attributes':['id',_0x922c('0x29')]});_0x26cb92[_0x922c('0xa3')]({'model':db[_0x922c('0x7e')],'as':'Owner','attributes':['id',_0x922c('0x52')]});return db[_0x922c('0x33')][_0x922c('0x48')]({'where':{'id':_0x31037['params']['id']},'include':_0x26cb92})[_0x922c('0x26')](handleEntityNotFound(_0x2d9529,null))[_0x922c('0x26')](function(_0x27deb7){if(_0x27deb7){var _0x343f88=_0x27deb7[_0x922c('0xb3')]({'plain':!![]});fs[_0x922c('0xb4')](_0x8a770);var _0x396a03={'channel':_0x922c('0xb5'),'account':_0x343f88['Account'][_0x922c('0x29')],'agent':_0x343f88[_0x922c('0xb6')]?_0x343f88['Owner'][_0x922c('0x52')]:_0x922c('0xb7'),'createdAt':moment(_0x343f88['createdAt'])[_0x922c('0x7a')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'closedAt':_0x343f88[_0x922c('0x68')]?moment(_0x343f88[_0x922c('0xb8')])['format'](_0x922c('0xb9'))[_0x922c('0xba')]():'','disposition':_0x343f88[_0x922c('0x69')],'chatInfo':{'browser':_0x343f88['browserName'],'os':_0x343f88[_0x922c('0xbb')],'referer':_0x343f88['referer'],'customerIp':_0x343f88[_0x922c('0xbc')],'customerPort':_0x343f88[_0x922c('0xbd')]?_0x343f88[_0x922c('0xbd')]:'N.A.'},'messages':_(_0x343f88[_0x922c('0x7d')])[_0x922c('0xbe')]()[_0x922c('0x9e')]({'secret':![]})[_0x922c('0x32')](function(_0x4ee643){if(_0x4ee643['Attachment']){var _0x11d914=path['join'](_0x2066e5,_0x4ee643[_0x922c('0x6f')][_0x922c('0x6c')]);if(fs['existsSync'](_0x11d914)){fs['createReadStream'](_0x11d914)['pipe'](fs['createWriteStream'](path[_0x922c('0x72')](_0x8a770,_0x4ee643[_0x922c('0x6f')]['basename'])));}}return{'date':moment(_0x4ee643['createdAt'])['format'](_0x922c('0xb9'))[_0x922c('0xba')](),'sender':_0x4ee643[_0x922c('0x8c')]===_0x922c('0x5d')?_0x4ee643[_0x922c('0x7e')]?_0x4ee643[_0x922c('0x7e')]['fullname']:'System':_0x4ee643[_0x922c('0x62')][_0x922c('0xb0')]+(_0x4ee643[_0x922c('0x62')][_0x922c('0xb1')]?'\x20'+_0x4ee643['Contact']['lastName']:''),'body':_0x4ee643[_0x922c('0x6f')]?_0x4ee643['Attachment']['basename']:_0x4ee643[_0x922c('0x2d')],'direction':_0x4ee643[_0x922c('0x8c')]===_0x922c('0x5d')?'A':'C','secret':_0x4ee643[_0x922c('0x8d')],'read':_0x4ee643['read'],'attachment':_0x4ee643[_0x922c('0x6f')]};})[_0x922c('0xbf')]()};return ejs[_0x922c('0xc0')](path[_0x922c('0x72')](config[_0x922c('0x73')],_0x922c('0xab'),_0x922c('0xc1'),_0x922c('0xc2')),{'interaction':_0x396a03})[_0x922c('0x26')](function(_0x9e417){var _0x3b8d7c=path[_0x922c('0x72')](_0x8a770,'transcript-'+_0x343f88['id']+'-'+_0x3413df+'.pdf');var _0x462156={'path':_0x3b8d7c,'channel':_0x922c('0xb5'),'interactionId':_0x343f88['id']};return pdf[_0x922c('0xc3')](_0x9e417,_0x462156);})[_0x922c('0x26')](function(){return new Promise(function(_0xf3ff5f,_0x5aaf2a){zipdir(_0x8a770,{'saveTo':_0xb04275},function(_0x35881f,_0x5a648a){if(_0x35881f)return _0x5aaf2a(_0x35881f);return _0xf3ff5f(_0x5a648a);});})[_0x922c('0x26')](function(){return new BPromise(function(_0x1f7f45,_0x4623ff){rimraf(_0x8a770,function(_0x139250){if(_0x139250)_0x4623ff(_0x139250);return _0x1f7f45();});});})[_0x922c('0x26')](function(){return _0x2d9529[_0x922c('0x76')](_0xb04275,_0x57b32d,function(_0x3ddb88){if(_0x3ddb88){logger[_0x922c('0x17')]('err',_0x3ddb88);}else{fs['unlinkSync'](_0xb04275);}});});});}else{return _0x2d9529[_0x922c('0x1b')](0xc8);}})[_0x922c('0x1a')](handleError(_0x2d9529,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index da7bc7c..4391334 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 _0x7ed4=['then','setDataValue','findAll','unreadMessages','length','emit','hasOwnProperty','hook','exports','../../mysqldb','save','update','remove'];(function(_0x34b821,_0x504e55){var _0x5e00a0=function(_0x242892){while(--_0x242892){_0x34b821['push'](_0x34b821['shift']());}};_0x5e00a0(++_0x504e55);}(_0x7ed4,0x182));var _0x47ed=function(_0x4cc280,_0x3b77f3){_0x4cc280=_0x4cc280-0x0;var _0x16ed24=_0x7ed4[_0x4cc280];return _0x16ed24;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0x47ed('0x0'))['db']['ChatInteraction'];var ChatMessage=require(_0x47ed('0x0'))['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x47ed('0x1'),'afterUpdate':_0x47ed('0x2'),'afterDestroy':_0x47ed('0x3')};function emitEvent(_0x2b8bf2){return function(_0x2a7ebd,_0x53d383,_0x497689){_0x2a7ebd['getUsers']({'attributes':['id'],'raw':!![]})[_0x47ed('0x4')](function(_0x26bd9a){_0x2a7ebd[_0x47ed('0x5')]('Users',_0x26bd9a['map'](function(_0x374ed6){return{'id':_0x374ed6['id']};}));return ChatMessage[_0x47ed('0x6')]({'where':{'ChatInteractionId':_0x2a7ebd['id'],'direction':'in','read':![]},'raw':!![]});})[_0x47ed('0x4')](function(_0x20d1b0){_0x2a7ebd[_0x47ed('0x5')](_0x47ed('0x7'),_0x20d1b0[_0x47ed('0x8')]);ChatInteractionEvents[_0x47ed('0x9')](_0x2b8bf2+':'+_0x2a7ebd['id'],_0x2a7ebd);ChatInteractionEvents['emit'](_0x2b8bf2,_0x2a7ebd);_0x497689(null);})['catch'](_0x497689(null));};}for(var e in events){if(events[_0x47ed('0xa')](e)){var event=events[e];ChatInteraction[_0x47ed('0xb')](e,emitEvent(event));}}module[_0x47ed('0xc')]=ChatInteractionEvents; \ No newline at end of file +var _0xb9fe=['hook','exports','events','../../mysqldb','ChatInteraction','save','update','then','setDataValue','findAll','unreadMessages','length','emit','catch','hasOwnProperty'];(function(_0x4ccf86,_0x4f71e5){var _0x2e1688=function(_0x17c013){while(--_0x17c013){_0x4ccf86['push'](_0x4ccf86['shift']());}};_0x2e1688(++_0x4f71e5);}(_0xb9fe,0x7a));var _0xeb9f=function(_0x17b169,_0x5e3f15){_0x17b169=_0x17b169-0x0;var _0x2b4ad4=_0xb9fe[_0x17b169];return _0x2b4ad4;};'use strict';var EventEmitter=require(_0xeb9f('0x0'));var ChatInteraction=require(_0xeb9f('0x1'))['db'][_0xeb9f('0x2')];var ChatMessage=require('../../mysqldb')['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xeb9f('0x3'),'afterUpdate':_0xeb9f('0x4'),'afterDestroy':'remove'};function emitEvent(_0x82cffa){return function(_0x170eb0,_0x50dbb7,_0x4ff700){_0x170eb0['getUsers']({'attributes':['id'],'raw':!![]})[_0xeb9f('0x5')](function(_0x28087e){_0x170eb0[_0xeb9f('0x6')]('Users',_0x28087e['map'](function(_0x2b6b3f){return{'id':_0x2b6b3f['id']};}));return ChatMessage[_0xeb9f('0x7')]({'where':{'ChatInteractionId':_0x170eb0['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x2e89d2){_0x170eb0[_0xeb9f('0x6')](_0xeb9f('0x8'),_0x2e89d2[_0xeb9f('0x9')]);ChatInteractionEvents[_0xeb9f('0xa')](_0x82cffa+':'+_0x170eb0['id'],_0x170eb0);ChatInteractionEvents[_0xeb9f('0xa')](_0x82cffa,_0x170eb0);_0x4ff700(null);})[_0xeb9f('0xb')](_0x4ff700(null));};}for(var e in events){if(events[_0xeb9f('0xc')](e)){var event=events[e];ChatInteraction[_0xeb9f('0xd')](e,emitEvent(event));}}module[_0xeb9f('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 0bd14c9..62069e7 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 _0xd1cc=['format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','define','ChatInteraction','changed','closed','closedAt'];(function(_0x3f0c4d,_0x36c466){var _0x4789fd=function(_0x3e2c36){while(--_0x3e2c36){_0x3f0c4d['push'](_0x3f0c4d['shift']());}};_0x4789fd(++_0x36c466);}(_0xd1cc,0x76));var _0xcd1c=function(_0x6d7d6d,_0x401215){_0x6d7d6d=_0x6d7d6d-0x0;var _0x34dc6d=_0xd1cc[_0x6d7d6d];return _0x34dc6d;};'use strict';var _=require(_0xcd1c('0x0'));var util=require('util');var logger=require(_0xcd1c('0x1'))(_0xcd1c('0x2'));var moment=require(_0xcd1c('0x3'));var BPromise=require(_0xcd1c('0x4'));var rp=require(_0xcd1c('0x5'));var fs=require('fs');var path=require(_0xcd1c('0x6'));var rimraf=require(_0xcd1c('0x7'));var config=require(_0xcd1c('0x8'));var attributes=require(_0xcd1c('0x9'));module['exports']=function(_0x18aed3,_0x2c0bae){return _0x18aed3[_0xcd1c('0xa')](_0xcd1c('0xb'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4bfc3d,_0x2b153,_0x3b3f54){if(_0x4bfc3d[_0xcd1c('0xc')](_0xcd1c('0xd'))){_0x4bfc3d[_0xcd1c('0xe')]=moment()[_0xcd1c('0xf')](_0xcd1c('0x10'));}_0x3b3f54(null,_0x4bfc3d);}},'charset':_0xcd1c('0x11'),'collate':_0xcd1c('0x12')});}; \ No newline at end of file +var _0x8155=['define','ChatInteraction','chat_interactions','changed','closed','closedAt','format','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','path','../../config/environment','exports'];(function(_0x3504a0,_0x3f770f){var _0x3dfca3=function(_0x5adf34){while(--_0x5adf34){_0x3504a0['push'](_0x3504a0['shift']());}};_0x3dfca3(++_0x3f770f);}(_0x8155,0x198));var _0x5815=function(_0x4ebffa,_0x1ab8db){_0x4ebffa=_0x4ebffa-0x0;var _0x4aec5f=_0x8155[_0x4ebffa];return _0x4aec5f;};'use strict';var _=require(_0x5815('0x0'));var util=require(_0x5815('0x1'));var logger=require(_0x5815('0x2'))(_0x5815('0x3'));var moment=require(_0x5815('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x5815('0x5'));var rimraf=require('rimraf');var config=require(_0x5815('0x6'));var attributes=require('./chatInteraction.attributes');module[_0x5815('0x7')]=function(_0x3ba965,_0x1b484e){return _0x3ba965[_0x5815('0x8')](_0x5815('0x9'),attributes,{'tableName':_0x5815('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1df755,_0x2256c5,_0x4fc851){if(_0x1df755[_0x5815('0xb')](_0x5815('0xc'))){_0x1df755[_0x5815('0xd')]=moment()[_0x5815('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}_0x4fc851(null,_0x1df755);}},'charset':'utf8mb4','collate':_0x5815('0xf')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index e8bbf46..ec6121d 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 _0xf7f4=['find','addTags','ids','omit','spread','AddTags','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','then','info','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','UpdateChatInteraction','update','body','options','where','attributes','limit','AddTagsToChatInteraction','ChatInteraction'];(function(_0xe33dfe,_0x326077){var _0x4eaed0=function(_0x5c448a){while(--_0x5c448a){_0xe33dfe['push'](_0xe33dfe['shift']());}};_0x4eaed0(++_0x326077);}(_0xf7f4,0xd8));var _0x4f7f=function(_0x30b734,_0x17baf6){_0x30b734=_0x30b734-0x0;var _0x2c4c07=_0xf7f4[_0x30b734];return _0x2c4c07;};'use strict';var _=require(_0x4f7f('0x0'));var util=require('util');var moment=require(_0x4f7f('0x1'));var BPromise=require(_0x4f7f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4f7f('0x3'));var db=require(_0x4f7f('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4f7f('0x5'))(_0x4f7f('0x6'));var config=require(_0x4f7f('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x4f7f('0x8')][_0x4f7f('0x9')]({'port':0x232a});config[_0x4f7f('0xa')]=_['defaults'](config['redis'],{'host':_0x4f7f('0xb'),'port':0x18eb});var socket=require(_0x4f7f('0xc'))(new Redis(config[_0x4f7f('0xa')]));require(_0x4f7f('0xd'))[_0x4f7f('0xe')](socket);function respondWithRpcPromise(_0x13b0b9,_0x2f1c06,_0xf556a0){return new BPromise(function(_0x5cf9a6,_0x3ad9b4){return client['request'](_0x13b0b9,_0xf556a0)[_0x4f7f('0xf')](function(_0x5bc629){logger[_0x4f7f('0x10')](_0x4f7f('0x11'),_0x2f1c06,'request\x20sent');logger[_0x4f7f('0x12')](_0x4f7f('0x13'),_0x2f1c06,'request\x20sent',JSON[_0x4f7f('0x14')](_0x5bc629));if(_0x5bc629[_0x4f7f('0x15')]){if(_0x5bc629[_0x4f7f('0x15')][_0x4f7f('0x16')]===0x1f4){logger[_0x4f7f('0x15')](_0x4f7f('0x11'),_0x2f1c06,_0x5bc629[_0x4f7f('0x15')][_0x4f7f('0x17')]);return _0x3ad9b4(_0x5bc629[_0x4f7f('0x15')][_0x4f7f('0x17')]);}logger[_0x4f7f('0x15')](_0x4f7f('0x11'),_0x2f1c06,_0x5bc629[_0x4f7f('0x15')][_0x4f7f('0x17')]);return _0x5cf9a6(_0x5bc629[_0x4f7f('0x15')][_0x4f7f('0x17')]);}else{logger[_0x4f7f('0x10')]('ChatInteraction,\x20%s,\x20%s',_0x2f1c06,_0x4f7f('0x18'));_0x5cf9a6(_0x5bc629[_0x4f7f('0x19')][_0x4f7f('0x17')]);}})[_0x4f7f('0x1a')](function(_0x292683){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x2f1c06,_0x292683);_0x3ad9b4(_0x292683);});});}exports[_0x4f7f('0x1b')]=function(_0x52300d){var _0x362b3c=this;return new Promise(function(_0x4e023f,_0x1dbbca){return db['ChatInteraction'][_0x4f7f('0x1c')](_0x52300d[_0x4f7f('0x1d')],{'raw':_0x52300d[_0x4f7f('0x1e')]?_0x52300d['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x52300d[_0x4f7f('0x1e')]?_0x52300d['options'][_0x4f7f('0x1f')]||null:null,'attributes':_0x52300d[_0x4f7f('0x1e')]?_0x52300d[_0x4f7f('0x1e')][_0x4f7f('0x20')]||null:null,'limit':_0x52300d[_0x4f7f('0x1e')]?_0x52300d[_0x4f7f('0x1e')][_0x4f7f('0x21')]||null:null})[_0x4f7f('0xf')](function(_0x5c9366){logger[_0x4f7f('0x10')]('UpdateChatInteraction',_0x52300d);logger['debug']('UpdateChatInteraction',_0x52300d,JSON[_0x4f7f('0x14')](_0x5c9366));_0x4e023f(_0x5c9366);})[_0x4f7f('0x1a')](function(_0x15286a){logger[_0x4f7f('0x15')](_0x4f7f('0x1b'),_0x15286a[_0x4f7f('0x17')],_0x52300d);_0x1dbbca(_0x362b3c[_0x4f7f('0x15')](0x1f4,_0x15286a[_0x4f7f('0x17')]));});});};exports[_0x4f7f('0x22')]=function(_0x50719f){return new Promise(function(_0x555a15,_0x340fc3){return db[_0x4f7f('0x23')][_0x4f7f('0x24')]({'where':_0x50719f[_0x4f7f('0x1e')]?_0x50719f[_0x4f7f('0x1e')][_0x4f7f('0x1f')]||null:null})[_0x4f7f('0xf')](function(_0x15513b){if(_0x15513b){return _0x15513b[_0x4f7f('0x25')](_0x50719f[_0x4f7f('0x1d')][_0x4f7f('0x26')],_[_0x4f7f('0x27')](_0x50719f[_0x4f7f('0x1d')],[_0x4f7f('0x26'),'id'])||{});}})[_0x4f7f('0x28')](function(_0x392a61){logger[_0x4f7f('0x10')](_0x4f7f('0x29'),_0x50719f);logger[_0x4f7f('0x12')](_0x4f7f('0x29'),_0x50719f,JSON[_0x4f7f('0x14')](_0x392a61));_0x555a15(_0x392a61);})[_0x4f7f('0x1a')](function(_0x550052){logger[_0x4f7f('0x15')](_0x4f7f('0x29'),_0x550052[_0x4f7f('0x17')],_0x50719f);_0x340fc3(_this[_0x4f7f('0x15')](0x1f4,_0x550052[_0x4f7f('0x17')]));});});}; \ No newline at end of file +var _0xf0f0=['AddTags','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','./chatInteraction.socket','request','then','info','ChatInteraction,\x20%s,\x20%s','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','UpdateChatInteraction','ChatInteraction','update','body','options','attributes','debug','AddTagsToChatInteraction','find','where','ids','omit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf0f0,0x1c4));var _0x0f0f=function(_0x3bc9a9,_0x4daccb){_0x3bc9a9=_0x3bc9a9-0x0;var _0x29923b=_0xf0f0[_0x3bc9a9];return _0x29923b;};'use strict';var _=require(_0x0f0f('0x0'));var util=require(_0x0f0f('0x1'));var moment=require(_0x0f0f('0x2'));var BPromise=require(_0x0f0f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0f0f('0x4'));var db=require(_0x0f0f('0x5'))['db'];var utils=require(_0x0f0f('0x6'));var logger=require(_0x0f0f('0x7'))(_0x0f0f('0x8'));var config=require(_0x0f0f('0x9'));var jayson=require(_0x0f0f('0xa'));var client=jayson[_0x0f0f('0xb')][_0x0f0f('0xc')]({'port':0x232a});config[_0x0f0f('0xd')]=_[_0x0f0f('0xe')](config[_0x0f0f('0xd')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0f0f('0xd')]));require(_0x0f0f('0xf'))['register'](socket);function respondWithRpcPromise(_0x30b8e6,_0xed9ed5,_0x2f0301){return new BPromise(function(_0x5e6878,_0x371465){return client[_0x0f0f('0x10')](_0x30b8e6,_0x2f0301)[_0x0f0f('0x11')](function(_0x44b2be){logger[_0x0f0f('0x12')](_0x0f0f('0x13'),_0xed9ed5,'request\x20sent');logger['debug'](_0x0f0f('0x14'),_0xed9ed5,_0x0f0f('0x15'),JSON[_0x0f0f('0x16')](_0x44b2be));if(_0x44b2be[_0x0f0f('0x17')]){if(_0x44b2be['error'][_0x0f0f('0x18')]===0x1f4){logger[_0x0f0f('0x17')](_0x0f0f('0x13'),_0xed9ed5,_0x44b2be[_0x0f0f('0x17')][_0x0f0f('0x19')]);return _0x371465(_0x44b2be[_0x0f0f('0x17')][_0x0f0f('0x19')]);}logger[_0x0f0f('0x17')](_0x0f0f('0x13'),_0xed9ed5,_0x44b2be[_0x0f0f('0x17')][_0x0f0f('0x19')]);return _0x5e6878(_0x44b2be[_0x0f0f('0x17')][_0x0f0f('0x19')]);}else{logger[_0x0f0f('0x12')](_0x0f0f('0x13'),_0xed9ed5,_0x0f0f('0x15'));_0x5e6878(_0x44b2be[_0x0f0f('0x1a')][_0x0f0f('0x19')]);}})[_0x0f0f('0x1b')](function(_0x84fb6d){logger[_0x0f0f('0x17')](_0x0f0f('0x13'),_0xed9ed5,_0x84fb6d);_0x371465(_0x84fb6d);});});}exports[_0x0f0f('0x1c')]=function(_0x3604ad){var _0x21ef0a=this;return new Promise(function(_0xcb35a8,_0x506f23){return db[_0x0f0f('0x1d')][_0x0f0f('0x1e')](_0x3604ad[_0x0f0f('0x1f')],{'raw':_0x3604ad['options']?_0x3604ad['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3604ad[_0x0f0f('0x20')]?_0x3604ad[_0x0f0f('0x20')]['where']||null:null,'attributes':_0x3604ad['options']?_0x3604ad['options'][_0x0f0f('0x21')]||null:null,'limit':_0x3604ad[_0x0f0f('0x20')]?_0x3604ad[_0x0f0f('0x20')]['limit']||null:null})[_0x0f0f('0x11')](function(_0x53c545){logger[_0x0f0f('0x12')]('UpdateChatInteraction',_0x3604ad);logger[_0x0f0f('0x22')](_0x0f0f('0x1c'),_0x3604ad,JSON[_0x0f0f('0x16')](_0x53c545));_0xcb35a8(_0x53c545);})['catch'](function(_0x5e37c2){logger[_0x0f0f('0x17')](_0x0f0f('0x1c'),_0x5e37c2['message'],_0x3604ad);_0x506f23(_0x21ef0a[_0x0f0f('0x17')](0x1f4,_0x5e37c2[_0x0f0f('0x19')]));});});};exports[_0x0f0f('0x23')]=function(_0x2bef08){return new Promise(function(_0x10b2d8,_0x26a378){return db['ChatInteraction'][_0x0f0f('0x24')]({'where':_0x2bef08[_0x0f0f('0x20')]?_0x2bef08[_0x0f0f('0x20')][_0x0f0f('0x25')]||null:null})[_0x0f0f('0x11')](function(_0x460549){if(_0x460549){return _0x460549['addTags'](_0x2bef08[_0x0f0f('0x1f')][_0x0f0f('0x26')],_[_0x0f0f('0x27')](_0x2bef08[_0x0f0f('0x1f')],[_0x0f0f('0x26'),'id'])||{});}})['spread'](function(_0x4f2df0){logger[_0x0f0f('0x12')](_0x0f0f('0x28'),_0x2bef08);logger[_0x0f0f('0x22')](_0x0f0f('0x28'),_0x2bef08,JSON[_0x0f0f('0x16')](_0x4f2df0));_0x10b2d8(_0x4f2df0);})[_0x0f0f('0x1b')](function(_0x42ea63){logger[_0x0f0f('0x17')](_0x0f0f('0x28'),_0x42ea63[_0x0f0f('0x19')],_0x2bef08);_0x26a378(_this[_0x0f0f('0x17')](0x1f4,_0x42ea63[_0x0f0f('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index 0ef2291..0a61383 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 _0x58e4=['emit','register','length','chatInteraction:','./chatInteraction.events','remove','update'];(function(_0x2b7b29,_0x59b527){var _0x179776=function(_0x414f34){while(--_0x414f34){_0x2b7b29['push'](_0x2b7b29['shift']());}};_0x179776(++_0x59b527);}(_0x58e4,0x1c4));var _0x458e=function(_0x2e9b61,_0x2120cf){_0x2e9b61=_0x2e9b61-0x0;var _0x597ccd=_0x58e4[_0x2e9b61];return _0x597ccd;};'use strict';var ChatInteractionEvents=require(_0x458e('0x0'));var events=['save',_0x458e('0x1'),_0x458e('0x2')];function createListener(_0x1cfd14,_0x34c66f){return function(_0x22d432){_0x34c66f[_0x458e('0x3')](_0x1cfd14,_0x22d432);};}function removeListener(_0x17f459,_0x304b9c){return function(){ChatInteractionEvents['removeListener'](_0x17f459,_0x304b9c);};}exports[_0x458e('0x4')]=function(_0x2c628a){for(var _0x4eb896=0x0,_0x4a54c0=events[_0x458e('0x5')];_0x4eb896<_0x4a54c0;_0x4eb896++){var _0x3025b9=events[_0x4eb896];var _0x2d4560=createListener(_0x458e('0x6')+_0x3025b9,_0x2c628a);ChatInteractionEvents['on'](_0x3025b9,_0x2d4560);}}; \ No newline at end of file +var _0x5489=['removeListener','register','./chatInteraction.events','save','remove','update'];(function(_0x1d6e3d,_0x51b0c5){var _0x27d1e4=function(_0x37d6c4){while(--_0x37d6c4){_0x1d6e3d['push'](_0x1d6e3d['shift']());}};_0x27d1e4(++_0x51b0c5);}(_0x5489,0x10a));var _0x9548=function(_0xeda869,_0x101e27){_0xeda869=_0xeda869-0x0;var _0x4a6e8f=_0x5489[_0xeda869];return _0x4a6e8f;};'use strict';var ChatInteractionEvents=require(_0x9548('0x0'));var events=[_0x9548('0x1'),_0x9548('0x2'),_0x9548('0x3')];function createListener(_0x164d0d,_0x36fdc9){return function(_0x155746){_0x36fdc9['emit'](_0x164d0d,_0x155746);};}function removeListener(_0xb06c04,_0x1969dc){return function(){ChatInteractionEvents[_0x9548('0x4')](_0xb06c04,_0x1969dc);};}exports[_0x9548('0x5')]=function(_0x2e8c5c){for(var _0x138c5a=0x0,_0x115571=events['length'];_0x138c5a<_0x115571;_0x138c5a++){var _0x497fd0=events[_0x138c5a];var _0x278a5e=createListener('chatInteraction:'+_0x497fd0,_0x2e8c5c);ChatInteractionEvents['on'](_0x497fd0,_0x278a5e);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index 386323d..ff18ffb 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 _0xc1e2=['attachmentUpload','/:id/messages','addMessage','tracked','chat','chatinteraction:addtags','addTags','put','/:id/custom_update','customUpdate','/:id/abandon','abandon','close','delete','chatinteraction:destroy','destroy','/:id/tags','exports','multer','path','express','Router','fs-extra','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/attachment_download','isChatInteractionAuthorized','attachmentDownload','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','create','post','diskStorage','join','root','server/files/attachments/','%s-%s','originalname','single'];(function(_0x2d486b,_0x5f213c){var _0x4291d1=function(_0x2cebcb){while(--_0x2cebcb){_0x2d486b['push'](_0x2d486b['shift']());}};_0x4291d1(++_0x5f213c);}(_0xc1e2,0xa5));var _0x2c1e=function(_0x2708c3,_0x2149c4){_0x2708c3=_0x2708c3-0x0;var _0x803a64=_0xc1e2[_0x2708c3];return _0x803a64;};'use strict';var multer=require(_0x2c1e('0x0'));var util=require('util');var path=require(_0x2c1e('0x1'));var timeout=require('connect-timeout');var express=require(_0x2c1e('0x2'));var router=express[_0x2c1e('0x3')]();var fs_extra=require(_0x2c1e('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x2c1e('0x5'));var controller=require(_0x2c1e('0x6'));router[_0x2c1e('0x7')]('/',auth[_0x2c1e('0x8')](),controller[_0x2c1e('0x9')]);router[_0x2c1e('0x7')](_0x2c1e('0xa'),auth[_0x2c1e('0x8')](),controller[_0x2c1e('0xb')]);router['get'](_0x2c1e('0xc'),auth['isChatInteractionAuthorized'](),controller[_0x2c1e('0xd')]);router['get'](_0x2c1e('0xe'),auth[_0x2c1e('0xf')](),controller[_0x2c1e('0x10')]);router['get']('/:id/messages',auth[_0x2c1e('0x8')](),controller[_0x2c1e('0x11')]);router['get'](_0x2c1e('0x12'),auth[_0x2c1e('0xf')](),controller[_0x2c1e('0x13')]);router[_0x2c1e('0x7')](_0x2c1e('0x14'),auth['isAuthenticated'](),controller[_0x2c1e('0x15')]);router['post']('/',auth[_0x2c1e('0x8')](),controller[_0x2c1e('0x16')]);router[_0x2c1e('0x17')]('/:id/vidaoo',auth[_0x2c1e('0x8')](),controller['createVidaooSession']);var upload=multer({'storage':multer[_0x2c1e('0x18')]({'destination':function(_0x5c7e5c,_0x13f03d,_0xb473db){_0xb473db(null,path[_0x2c1e('0x19')](config[_0x2c1e('0x1a')],_0x2c1e('0x1b')));},'filename':function(_0x407590,_0x2ed754,_0x5715c6){_0x5715c6(null,util['format'](_0x2c1e('0x1c'),Date['now'](),_0x2ed754[_0x2c1e('0x1d')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x2c1e('0x17')]('/:id/attachment_upload',upload[_0x2c1e('0x1e')]('file'),controller[_0x2c1e('0x1f')]);router['post'](_0x2c1e('0x20'),auth[_0x2c1e('0xf')](),controller[_0x2c1e('0x21')]);router[_0x2c1e('0x17')]('/:id/tags',auth[_0x2c1e('0x8')](),interaction[_0x2c1e('0x22')](_0x2c1e('0x23'),_0x2c1e('0x24')),controller[_0x2c1e('0x25')]);router[_0x2c1e('0x26')](_0x2c1e('0xc'),auth['isAuthenticated'](),interaction[_0x2c1e('0x22')](_0x2c1e('0x23'),'chatinteraction:update'),controller['update']);router['put'](_0x2c1e('0x27'),controller[_0x2c1e('0x28')]);router['put'](_0x2c1e('0x29'),auth[_0x2c1e('0xf')](),controller[_0x2c1e('0x2a')]);router['put']('/:id/close',controller[_0x2c1e('0x2b')]);router[_0x2c1e('0x2c')](_0x2c1e('0xc'),auth[_0x2c1e('0x8')](),interaction[_0x2c1e('0x22')](_0x2c1e('0x23'),_0x2c1e('0x2d')),controller[_0x2c1e('0x2e')]);router[_0x2c1e('0x2c')](_0x2c1e('0x2f'),auth[_0x2c1e('0x8')](),controller['removeTags']);module[_0x2c1e('0x30')]=router; \ No newline at end of file +var _0xb954=['format','%s-%s','now','/:id/attachment_upload','single','file','attachmentUpload','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','put','/:id','update','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','removeTags','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/describe','isChatInteractionAuthorized','show','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','create','post','/:id/vidaoo','createVidaooSession','diskStorage','root','server/files/attachments/'];(function(_0x1bab70,_0x399ccf){var _0x44a639=function(_0x36c682){while(--_0x36c682){_0x1bab70['push'](_0x1bab70['shift']());}};_0x44a639(++_0x399ccf);}(_0xb954,0x151));var _0x4b95=function(_0x3c6f79,_0x3ed502){_0x3c6f79=_0x3c6f79-0x0;var _0x311855=_0xb954[_0x3c6f79];return _0x311855;};'use strict';var multer=require(_0x4b95('0x0'));var util=require('util');var path=require(_0x4b95('0x1'));var timeout=require(_0x4b95('0x2'));var express=require(_0x4b95('0x3'));var router=express[_0x4b95('0x4')]();var fs_extra=require(_0x4b95('0x5'));var auth=require(_0x4b95('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x4b95('0x7'));var controller=require('./chatInteraction.controller');router[_0x4b95('0x8')]('/',auth[_0x4b95('0x9')](),controller['index']);router[_0x4b95('0x8')](_0x4b95('0xa'),auth[_0x4b95('0x9')](),controller['describe']);router[_0x4b95('0x8')]('/:id',auth[_0x4b95('0xb')](),controller[_0x4b95('0xc')]);router[_0x4b95('0x8')]('/:id/attachment_download',auth[_0x4b95('0xb')](),controller[_0x4b95('0xd')]);router['get'](_0x4b95('0xe'),auth[_0x4b95('0x9')](),controller[_0x4b95('0xf')]);router[_0x4b95('0x8')](_0x4b95('0x10'),auth[_0x4b95('0xb')](),controller[_0x4b95('0x11')]);router[_0x4b95('0x8')](_0x4b95('0x12'),auth[_0x4b95('0x9')](),controller[_0x4b95('0x13')]);router['post']('/',auth[_0x4b95('0x9')](),controller[_0x4b95('0x14')]);router[_0x4b95('0x15')](_0x4b95('0x16'),auth[_0x4b95('0x9')](),controller[_0x4b95('0x17')]);var upload=multer({'storage':multer[_0x4b95('0x18')]({'destination':function(_0x3c51ef,_0x267e12,_0x4f27ca){_0x4f27ca(null,path['join'](config[_0x4b95('0x19')],_0x4b95('0x1a')));},'filename':function(_0x3aaa73,_0x412ad5,_0x4acd7f){_0x4acd7f(null,util[_0x4b95('0x1b')](_0x4b95('0x1c'),Date[_0x4b95('0x1d')](),_0x412ad5['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x4b95('0x15')](_0x4b95('0x1e'),upload[_0x4b95('0x1f')](_0x4b95('0x20')),controller[_0x4b95('0x21')]);router[_0x4b95('0x15')](_0x4b95('0xe'),auth['isChatInteractionAuthorized'](),controller['addMessage']);router['post'](_0x4b95('0x22'),auth[_0x4b95('0x9')](),interaction[_0x4b95('0x23')](_0x4b95('0x24'),_0x4b95('0x25')),controller[_0x4b95('0x26')]);router[_0x4b95('0x27')](_0x4b95('0x28'),auth[_0x4b95('0x9')](),interaction[_0x4b95('0x23')](_0x4b95('0x24'),'chatinteraction:update'),controller[_0x4b95('0x29')]);router[_0x4b95('0x27')](_0x4b95('0x2a'),controller[_0x4b95('0x2b')]);router[_0x4b95('0x27')](_0x4b95('0x2c'),auth[_0x4b95('0xb')](),controller[_0x4b95('0x2d')]);router['put'](_0x4b95('0x2e'),controller[_0x4b95('0x2f')]);router[_0x4b95('0x30')](_0x4b95('0x28'),auth['isAuthenticated'](),interaction['tracked']('chat',_0x4b95('0x31')),controller[_0x4b95('0x32')]);router['delete'](_0x4b95('0x22'),auth['isAuthenticated'](),controller[_0x4b95('0x33')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index 9a07860..631a415 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 _0xb0de=['medium','INTEGER','sequelize','TEXT'];(function(_0xc7006a,_0x26fe34){var _0x4b49d9=function(_0x4ee238){while(--_0x4ee238){_0xc7006a['push'](_0xc7006a['shift']());}};_0x4b49d9(++_0x26fe34);}(_0xb0de,0xc2));var _0xeb0d=function(_0x17369c,_0x57e58f){_0x17369c=_0x17369c-0x0;var _0x5d558e=_0xb0de[_0x17369c];return _0x5d558e;};'use strict';var Sequelize=require(_0xeb0d('0x0'));module['exports']={'body':{'type':Sequelize[_0xeb0d('0x1')](_0xeb0d('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xeb0d('0x3')]}}; \ No newline at end of file +var _0x46ea=['sequelize','TEXT','medium','BOOLEAN'];(function(_0x20b18d,_0x9aed5){var _0x5391d0=function(_0x38b157){while(--_0x38b157){_0x20b18d['push'](_0x20b18d['shift']());}};_0x5391d0(++_0x9aed5);}(_0x46ea,0x148));var _0xa46e=function(_0x34e1e1,_0x43a5b5){_0x34e1e1=_0x34e1e1-0x0;var _0x4a1f4d=_0x46ea[_0x34e1e1];return _0x4a1f4d;};'use strict';var Sequelize=require(_0xa46e('0x0'));module['exports']={'body':{'type':Sequelize[_0xa46e('0x1')](_0xa46e('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xa46e('0x3')],'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 d55dd93..8f63726 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 _0xbd7d=['../../config/utils','../../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','apply','reject','save','then','destroy','stack','name','index','map','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','ChatInternalMessage','includeAll','include','rows','catch','params','find','body','update','describe','get','messages','createdAt','lastMessage','lastMessageAt','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','findAll','agent','admin','user','fullname','userpic','online','allowmessenger','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','resourceId','push','FromId','ToId','read','-createdAt','all','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0xf0b5aa,_0x2bf688){var _0x116c02=function(_0x3d6d94){while(--_0x3d6d94){_0xf0b5aa['push'](_0xf0b5aa['shift']());}};_0x116c02(++_0x2bf688);}(_0xbd7d,0x1a6));var _0xdbd7=function(_0x5d23c2,_0x314419){_0x5d23c2=_0x5d23c2-0x0;var _0x50b8f0=_0xbd7d[_0x5d23c2];return _0x50b8f0;};'use strict';var emlformat=require(_0xdbd7('0x0'));var rimraf=require(_0xdbd7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdbd7('0x2'));var rp=require(_0xdbd7('0x3'));var moment=require(_0xdbd7('0x4'));var BPromise=require(_0xdbd7('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xdbd7('0x6'));var csv=require(_0xdbd7('0x7'));var ejs=require(_0xdbd7('0x8'));var fs=require('fs');var fs_extra=require(_0xdbd7('0x9'));var _=require(_0xdbd7('0xa'));var squel=require(_0xdbd7('0xb'));var crypto=require(_0xdbd7('0xc'));var jsforce=require(_0xdbd7('0xd'));var deskjs=require(_0xdbd7('0xe'));var toCsv=require('to-csv');var querystring=require(_0xdbd7('0xf'));var Papa=require(_0xdbd7('0x10'));var Redis=require(_0xdbd7('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xdbd7('0x12'));var hardwareService=require(_0xdbd7('0x13'));var logger=require(_0xdbd7('0x14'))(_0xdbd7('0x15'));var utils=require(_0xdbd7('0x16'));var config=require(_0xdbd7('0x17'));var licenseUtil=require(_0xdbd7('0x18'));var db=require(_0xdbd7('0x19'))['db'];config[_0xdbd7('0x1a')]=_[_0xdbd7('0x1b')](config[_0xdbd7('0x1a')],{'host':_0xdbd7('0x1c'),'port':0x18eb});var socket=require(_0xdbd7('0x1d'))(new Redis(config[_0xdbd7('0x1a')]));require(_0xdbd7('0x1e'))[_0xdbd7('0x1f')](socket);function respondWithStatusCode(_0x1347ed,_0x3286ab){_0x3286ab=_0x3286ab||0xcc;return function(_0xd13b4a){if(_0xd13b4a){return _0x1347ed[_0xdbd7('0x20')](_0x3286ab);}return _0x1347ed[_0xdbd7('0x21')](_0x3286ab)[_0xdbd7('0x22')]();};}function respondWithResult(_0x4ae3f3,_0x22a553){_0x22a553=_0x22a553||0xc8;return function(_0x230499){if(_0x230499){return _0x4ae3f3[_0xdbd7('0x21')](_0x22a553)[_0xdbd7('0x23')](_0x230499);}};}function respondWithFilteredResult(_0x34a468,_0x1718b0){return function(_0x44d192){if(_0x44d192){var _0x439677=typeof _0x1718b0[_0xdbd7('0x24')]===_0xdbd7('0x25')&&typeof _0x1718b0[_0xdbd7('0x26')]===_0xdbd7('0x25');var _0x375f13=_0x44d192[_0xdbd7('0x27')];var _0x1f25ae=_0x439677?0x0:_0x1718b0[_0xdbd7('0x24')];var _0x509c99=_0x439677?_0x44d192[_0xdbd7('0x27')]:_0x1718b0[_0xdbd7('0x24')]+_0x1718b0['limit'];var _0x3e703f;if(_0x509c99>=_0x375f13){_0x509c99=_0x375f13;_0x3e703f=0xc8;}else{_0x3e703f=0xce;}_0x34a468['status'](_0x3e703f);return _0x34a468[_0xdbd7('0x28')](_0xdbd7('0x29'),_0x1f25ae+'-'+_0x509c99+'/'+_0x375f13)[_0xdbd7('0x23')](_0x44d192);}return null;};}function patchUpdates(_0x55ce67){return function(_0x4a106e){try{jsonpatch[_0xdbd7('0x2a')](_0x4a106e,_0x55ce67,!![]);}catch(_0x36d0c2){return BPromise[_0xdbd7('0x2b')](_0x36d0c2);}return _0x4a106e[_0xdbd7('0x2c')]();};}function saveUpdates(_0x4a339f,_0xad2939){return function(_0x5e2c99){if(_0x5e2c99){return _0x5e2c99['update'](_0x4a339f)[_0xdbd7('0x2d')](function(_0x294889){return _0x294889;});}return null;};}function removeEntity(_0x5a510e,_0x525d7b){return function(_0x3845fe){if(_0x3845fe){return _0x3845fe[_0xdbd7('0x2e')]()[_0xdbd7('0x2d')](function(){_0x5a510e[_0xdbd7('0x21')](0xcc)[_0xdbd7('0x22')]();});}};}function handleEntityNotFound(_0x5b7a54,_0x1d835e){return function(_0xb05d91){if(!_0xb05d91){_0x5b7a54['sendStatus'](0x194);}return _0xb05d91;};}function handleError(_0x15347f,_0x159630){_0x159630=_0x159630||0x1f4;return function(_0x5a926f){logger['error'](_0x5a926f[_0xdbd7('0x2f')]);if(_0x5a926f['name']){delete _0x5a926f[_0xdbd7('0x30')];}_0x15347f[_0xdbd7('0x21')](_0x159630)['send'](_0x5a926f);};}exports[_0xdbd7('0x31')]=function(_0x74e3f5,_0x2f9118){var _0x174316={},_0x286c41={},_0x495eef={'count':0x0,'rows':[]};var _0x51faaa=_[_0xdbd7('0x32')](db['ChatInternalMessage']['rawAttributes'],function(_0x574d7c){return{'name':_0x574d7c[_0xdbd7('0x33')],'type':_0x574d7c[_0xdbd7('0x34')]['key']};});_0x286c41[_0xdbd7('0x35')]=_[_0xdbd7('0x32')](_0x51faaa,_0xdbd7('0x30'));_0x286c41[_0xdbd7('0x36')]=_[_0xdbd7('0x37')](_0x74e3f5[_0xdbd7('0x36')]);_0x286c41[_0xdbd7('0x38')]=_[_0xdbd7('0x39')](_0x286c41['model'],_0x286c41[_0xdbd7('0x36')]);_0x174316[_0xdbd7('0x3a')]=_[_0xdbd7('0x39')](_0x286c41['model'],qs[_0xdbd7('0x3b')](_0x74e3f5[_0xdbd7('0x36')][_0xdbd7('0x3b')]));_0x174316[_0xdbd7('0x3a')]=_0x174316[_0xdbd7('0x3a')][_0xdbd7('0x3c')]?_0x174316[_0xdbd7('0x3a')]:_0x286c41[_0xdbd7('0x35')];if(!_0x74e3f5[_0xdbd7('0x36')][_0xdbd7('0x3d')]('nolimit')){_0x174316[_0xdbd7('0x26')]=qs[_0xdbd7('0x26')](_0x74e3f5[_0xdbd7('0x36')]['limit']);_0x174316[_0xdbd7('0x24')]=qs[_0xdbd7('0x24')](_0x74e3f5[_0xdbd7('0x36')][_0xdbd7('0x24')]);}_0x174316['order']=qs[_0xdbd7('0x3e')](_0x74e3f5[_0xdbd7('0x36')][_0xdbd7('0x3e')]);_0x174316[_0xdbd7('0x3f')]=qs[_0xdbd7('0x38')](_[_0xdbd7('0x40')](_0x74e3f5[_0xdbd7('0x36')],_0x286c41[_0xdbd7('0x38')]),_0x51faaa);if(_0x74e3f5[_0xdbd7('0x36')][_0xdbd7('0x41')]){_0x174316['where']=_[_0xdbd7('0x42')](_0x174316[_0xdbd7('0x3f')],{'$or':_[_0xdbd7('0x32')](_0x51faaa,function(_0x41e1d5){if(_0x41e1d5[_0xdbd7('0x34')]!==_0xdbd7('0x43')){var _0x4bbf8b={};_0x4bbf8b[_0x41e1d5['name']]={'$like':'%'+_0x74e3f5[_0xdbd7('0x36')]['filter']+'%'};return _0x4bbf8b;}})});}_0x174316=_[_0xdbd7('0x42')]({},_0x174316,_0x74e3f5[_0xdbd7('0x44')]);var _0x5e3e5a={'where':_0x174316[_0xdbd7('0x3f')]};return db[_0xdbd7('0x45')][_0xdbd7('0x27')](_0x5e3e5a)['then'](function(_0x273b29){_0x495eef['count']=_0x273b29;if(_0x74e3f5[_0xdbd7('0x36')][_0xdbd7('0x46')]){_0x174316[_0xdbd7('0x47')]=[{'all':!![]}];}return db[_0xdbd7('0x45')]['findAll'](_0x174316);})[_0xdbd7('0x2d')](function(_0x20b343){_0x495eef[_0xdbd7('0x48')]=_0x20b343;return _0x495eef;})[_0xdbd7('0x2d')](respondWithFilteredResult(_0x2f9118,_0x174316))[_0xdbd7('0x49')](handleError(_0x2f9118,null));};exports['show']=function(_0x1feca8,_0x4eca72){var _0xe2b428={'raw':!![],'where':{'id':_0x1feca8[_0xdbd7('0x4a')]['id']}},_0x45bc2e={};_0x45bc2e[_0xdbd7('0x35')]=_[_0xdbd7('0x37')](db['ChatInternalMessage']['rawAttributes']);_0x45bc2e[_0xdbd7('0x36')]=_[_0xdbd7('0x37')](_0x1feca8[_0xdbd7('0x36')]);_0x45bc2e[_0xdbd7('0x38')]=_[_0xdbd7('0x39')](_0x45bc2e[_0xdbd7('0x35')],_0x45bc2e['query']);_0xe2b428[_0xdbd7('0x3a')]=_[_0xdbd7('0x39')](_0x45bc2e[_0xdbd7('0x35')],qs[_0xdbd7('0x3b')](_0x1feca8['query'][_0xdbd7('0x3b')]));_0xe2b428['attributes']=_0xe2b428['attributes'][_0xdbd7('0x3c')]?_0xe2b428[_0xdbd7('0x3a')]:_0x45bc2e[_0xdbd7('0x35')];if(_0x1feca8[_0xdbd7('0x36')][_0xdbd7('0x46')]){_0xe2b428[_0xdbd7('0x47')]=[{'all':!![]}];}_0xe2b428=_[_0xdbd7('0x42')]({},_0xe2b428,_0x1feca8['options']);return db[_0xdbd7('0x45')][_0xdbd7('0x4b')](_0xe2b428)[_0xdbd7('0x2d')](handleEntityNotFound(_0x4eca72,null))[_0xdbd7('0x2d')](respondWithResult(_0x4eca72,null))['catch'](handleError(_0x4eca72,null));};exports['create']=function(_0x146ceb,_0x54be24){return db['ChatInternalMessage']['create'](_0x146ceb[_0xdbd7('0x4c')],{})[_0xdbd7('0x2d')](respondWithResult(_0x54be24,0xc9))[_0xdbd7('0x49')](handleError(_0x54be24,null));};exports[_0xdbd7('0x4d')]=function(_0x33fcd1,_0x576a41){if(_0x33fcd1[_0xdbd7('0x4c')]['id']){delete _0x33fcd1[_0xdbd7('0x4c')]['id'];}return db[_0xdbd7('0x45')][_0xdbd7('0x4b')]({'where':{'id':_0x33fcd1[_0xdbd7('0x4a')]['id']}})[_0xdbd7('0x2d')](handleEntityNotFound(_0x576a41,null))[_0xdbd7('0x2d')](saveUpdates(_0x33fcd1[_0xdbd7('0x4c')],null))[_0xdbd7('0x2d')](respondWithResult(_0x576a41,null))[_0xdbd7('0x49')](handleError(_0x576a41,null));};exports[_0xdbd7('0x2e')]=function(_0x13836c,_0x58c5ea){return db[_0xdbd7('0x45')]['find']({'where':{'id':_0x13836c[_0xdbd7('0x4a')]['id']}})[_0xdbd7('0x2d')](handleEntityNotFound(_0x58c5ea,null))[_0xdbd7('0x2d')](removeEntity(_0x58c5ea,null))['catch'](handleError(_0x58c5ea,null));};exports['describe']=function(_0x436124,_0x380bae){return db[_0xdbd7('0x45')][_0xdbd7('0x4e')]()[_0xdbd7('0x2d')](respondWithResult(_0x380bae,null))[_0xdbd7('0x49')](handleError(_0x380bae,null));};function wrapUser(_0xb0bd93){return function(_0x50f22d){var _0x11e457=_0xb0bd93[_0xdbd7('0x4f')]({'plain':!![]});_0x11e457[_0xdbd7('0x50')]=[];if(_0x50f22d){_0x11e457['lastMessageAt']=_0x50f22d[_0xdbd7('0x51')];_0x11e457[_0xdbd7('0x52')]=_0x50f22d;}else{_0x11e457[_0xdbd7('0x53')]=moment(0x0)[_0xdbd7('0x54')](_0xdbd7('0x55'));_0x11e457['lastMessage']={};}return _0x11e457;};}exports[_0xdbd7('0x56')]=function(_0x5eaf0b,_0x55345a,_0x443716){var _0x4209b9=[];return db['User'][_0xdbd7('0x57')]({'where':{'role':[_0xdbd7('0x58'),_0xdbd7('0x59'),_0xdbd7('0x5a')]},'attributes':['id',_0xdbd7('0x5b'),_0xdbd7('0x30'),'role',_0xdbd7('0x5c'),'internal',_0xdbd7('0x5d'),'lastLoginAt',_0xdbd7('0x5e'),'showWebBar'],'order':qs[_0xdbd7('0x3e')](_0xdbd7('0x5f')),'include':[{'model':db[_0xdbd7('0x60')],'as':_0xdbd7('0x61'),'attributes':['id',_0xdbd7('0x30'),_0xdbd7('0x34')],'through':{'attributes':[]}}]})[_0xdbd7('0x2d')](function(_0x42a35b){if(_0x42a35b){var _0x4c735d=_0x5eaf0b[_0xdbd7('0x5a')][_0xdbd7('0x4f')]({'plain':!![]});if(!_0x4c735d)throw new Error(_0xdbd7('0x62'));if(_0x4c735d[_0xdbd7('0x63')]==='user'){return db[_0xdbd7('0x64')][_0xdbd7('0x4b')]({'where':{'name':'Agents','userProfileId':_0x4c735d[_0xdbd7('0x65')]},'raw':!![]})['then'](function(_0x533311){if(_0x533311){if(_0x533311[_0xdbd7('0x66')]===0x0){return db[_0xdbd7('0x67')][_0xdbd7('0x57')]({'where':{'sectionId':_0x533311['id']},'raw':!![]})[_0xdbd7('0x2d')](function(_0x4ef8fd){var _0x42eb39=[];if(_['isEmpty'](_0x4ef8fd)){_0x42eb39=_['filter'](_0x42a35b,function(_0x4925d5){if(_0x4925d5['role']!==_0xdbd7('0x58')){return _0x4925d5;}});return _0x42eb39;}else{for(var _0x529ce6=0x0;_0x529ce6<_0x42a35b[_0xdbd7('0x3c')];_0x529ce6++){var _0x59cb03=_0x42a35b[_0x529ce6];if(_0x59cb03[_0xdbd7('0x63')]===_0xdbd7('0x58')){var _0x5f0ab4=_['find'](_0x4ef8fd,function(_0x3588fd){return _0x3588fd[_0xdbd7('0x68')]===_0x59cb03['id'];});if(_0x5f0ab4)_0x42eb39[_0xdbd7('0x69')](_0x59cb03);}else{_0x42eb39['push'](_0x59cb03);}}return _0x42eb39;}});}else{return _0x42a35b;}}else{var _0x12b688=_[_0xdbd7('0x41')](_0x42a35b,function(_0x4bd285){if(_0x4bd285[_0xdbd7('0x63')]!==_0xdbd7('0x58')){return _0x4bd285;}});return _0x12b688;}});}else{return _0x42a35b;}}})[_0xdbd7('0x2d')](function(_0x5c6c0d){var _0x47b70b=[];if(_0x5c6c0d){_0x4209b9=_0x5c6c0d;for(var _0x43403a=0x0;_0x43403a<_0x5c6c0d[_0xdbd7('0x3c')];_0x43403a+=0x1){_0x4209b9[_0x43403a][_0xdbd7('0x50')]=[];_0x47b70b[_0xdbd7('0x69')](db[_0xdbd7('0x45')][_0xdbd7('0x4b')]({'where':{'FromId':[_0x5eaf0b[_0xdbd7('0x5a')]['id'],_0x5c6c0d[_0x43403a]['id']],'ToId':[_0x5eaf0b[_0xdbd7('0x5a')]['id'],_0x5c6c0d[_0x43403a]['id']],'ChatGroupId':null},'attributes':['id',_0xdbd7('0x51'),_0xdbd7('0x6a'),_0xdbd7('0x6b'),_0xdbd7('0x6c'),_0xdbd7('0x4c')],'order':qs[_0xdbd7('0x3e')](_0xdbd7('0x6d')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xdbd7('0x2d')](wrapUser(_0x5c6c0d[_0x43403a])));}return BPromise[_0xdbd7('0x6e')](_0x47b70b);}return[];})['then'](function(_0x233045){return{'rows':_0x233045,'count':_0x233045['length']};})[_0xdbd7('0x2d')](respondWithResult(_0x55345a,null))['catch'](handleError(_0x55345a,null));}; \ No newline at end of file +var _0x0052=['redis','defaults','localhost','socket.io-emitter','register','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','end','name','send','index','map','ChatInternalMessage','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','options','include','findAll','params','keys','find','catch','create','body','destroy','describe','get','messages','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','admin','user','fullname','role','userpic','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','resourceId','push','read','-createdAt','all','eml-format','rimraf','zip-dir','moment','bluebird','util','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x14dcc5,_0x163ab7){var _0x35d6cc=function(_0x2de1ae){while(--_0x2de1ae){_0x14dcc5['push'](_0x14dcc5['shift']());}};_0x35d6cc(++_0x163ab7);}(_0x0052,0x128));var _0x2005=function(_0x365c0a,_0x26dcb7){_0x365c0a=_0x365c0a-0x0;var _0x19e3e7=_0x0052[_0x365c0a];return _0x19e3e7;};'use strict';var emlformat=require(_0x2005('0x0'));var rimraf=require(_0x2005('0x1'));var zipdir=require(_0x2005('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x2005('0x3'));var BPromise=require(_0x2005('0x4'));var Mustache=require('mustache');var util=require(_0x2005('0x5'));var path=require(_0x2005('0x6'));var sox=require(_0x2005('0x7'));var csv=require('to-csv');var ejs=require(_0x2005('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2005('0x9'));var squel=require(_0x2005('0xa'));var crypto=require('crypto');var jsforce=require(_0x2005('0xb'));var deskjs=require(_0x2005('0xc'));var toCsv=require(_0x2005('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x2005('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x2005('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2005('0x10'))(_0x2005('0x11'));var utils=require(_0x2005('0x12'));var config=require(_0x2005('0x13'));var licenseUtil=require(_0x2005('0x14'));var db=require(_0x2005('0x15'))['db'];config[_0x2005('0x16')]=_[_0x2005('0x17')](config['redis'],{'host':_0x2005('0x18'),'port':0x18eb});var socket=require(_0x2005('0x19'))(new Redis(config[_0x2005('0x16')]));require('./chatInternalMessage.socket')[_0x2005('0x1a')](socket);function respondWithStatusCode(_0x30e178,_0x13f934){_0x13f934=_0x13f934||0xcc;return function(_0x202cec){if(_0x202cec){return _0x30e178['sendStatus'](_0x13f934);}return _0x30e178[_0x2005('0x1b')](_0x13f934)['end']();};}function respondWithResult(_0x3ee93f,_0x1d07d2){_0x1d07d2=_0x1d07d2||0xc8;return function(_0x4dbcaa){if(_0x4dbcaa){return _0x3ee93f[_0x2005('0x1b')](_0x1d07d2)['json'](_0x4dbcaa);}};}function respondWithFilteredResult(_0x543bc1,_0x484a87){return function(_0x1a0810){if(_0x1a0810){var _0x1647e8=typeof _0x484a87[_0x2005('0x1c')]===_0x2005('0x1d')&&typeof _0x484a87[_0x2005('0x1e')]==='undefined';var _0x16e2ff=_0x1a0810['count'];var _0x1427c3=_0x1647e8?0x0:_0x484a87['offset'];var _0x22c725=_0x1647e8?_0x1a0810[_0x2005('0x1f')]:_0x484a87[_0x2005('0x1c')]+_0x484a87[_0x2005('0x1e')];var _0x1ac740;if(_0x22c725>=_0x16e2ff){_0x22c725=_0x16e2ff;_0x1ac740=0xc8;}else{_0x1ac740=0xce;}_0x543bc1[_0x2005('0x1b')](_0x1ac740);return _0x543bc1[_0x2005('0x20')](_0x2005('0x21'),_0x1427c3+'-'+_0x22c725+'/'+_0x16e2ff)[_0x2005('0x22')](_0x1a0810);}return null;};}function patchUpdates(_0x15d9cd){return function(_0x5c8e78){try{jsonpatch[_0x2005('0x23')](_0x5c8e78,_0x15d9cd,!![]);}catch(_0x451f75){return BPromise[_0x2005('0x24')](_0x451f75);}return _0x5c8e78['save']();};}function saveUpdates(_0x3d7d22,_0x598392){return function(_0x1fd1c3){if(_0x1fd1c3){return _0x1fd1c3[_0x2005('0x25')](_0x3d7d22)['then'](function(_0xe805a3){return _0xe805a3;});}return null;};}function removeEntity(_0x3501a8,_0x3d3649){return function(_0x3ec891){if(_0x3ec891){return _0x3ec891['destroy']()[_0x2005('0x26')](function(){_0x3501a8[_0x2005('0x1b')](0xcc)[_0x2005('0x27')]();});}};}function handleEntityNotFound(_0x3d4a22,_0x512448){return function(_0x4e3b58){if(!_0x4e3b58){_0x3d4a22['sendStatus'](0x194);}return _0x4e3b58;};}function handleError(_0x514168,_0x2d12e7){_0x2d12e7=_0x2d12e7||0x1f4;return function(_0x424435){logger['error'](_0x424435['stack']);if(_0x424435[_0x2005('0x28')]){delete _0x424435['name'];}_0x514168[_0x2005('0x1b')](_0x2d12e7)[_0x2005('0x29')](_0x424435);};}exports[_0x2005('0x2a')]=function(_0x27924f,_0x264257){var _0x1fafea={},_0x21af35={},_0x3a7e29={'count':0x0,'rows':[]};var _0x4408d1=_[_0x2005('0x2b')](db[_0x2005('0x2c')][_0x2005('0x2d')],function(_0xcec449){return{'name':_0xcec449[_0x2005('0x2e')],'type':_0xcec449[_0x2005('0x2f')]['key']};});_0x21af35[_0x2005('0x30')]=_[_0x2005('0x2b')](_0x4408d1,_0x2005('0x28'));_0x21af35['query']=_['keys'](_0x27924f[_0x2005('0x31')]);_0x21af35[_0x2005('0x32')]=_[_0x2005('0x33')](_0x21af35[_0x2005('0x30')],_0x21af35['query']);_0x1fafea[_0x2005('0x34')]=_['intersection'](_0x21af35[_0x2005('0x30')],qs[_0x2005('0x35')](_0x27924f[_0x2005('0x31')]['fields']));_0x1fafea[_0x2005('0x34')]=_0x1fafea[_0x2005('0x34')][_0x2005('0x36')]?_0x1fafea[_0x2005('0x34')]:_0x21af35[_0x2005('0x30')];if(!_0x27924f[_0x2005('0x31')]['hasOwnProperty'](_0x2005('0x37'))){_0x1fafea['limit']=qs['limit'](_0x27924f[_0x2005('0x31')][_0x2005('0x1e')]);_0x1fafea['offset']=qs[_0x2005('0x1c')](_0x27924f[_0x2005('0x31')][_0x2005('0x1c')]);}_0x1fafea[_0x2005('0x38')]=qs[_0x2005('0x39')](_0x27924f[_0x2005('0x31')][_0x2005('0x39')]);_0x1fafea[_0x2005('0x3a')]=qs[_0x2005('0x32')](_['pick'](_0x27924f[_0x2005('0x31')],_0x21af35[_0x2005('0x32')]),_0x4408d1);if(_0x27924f[_0x2005('0x31')][_0x2005('0x3b')]){_0x1fafea[_0x2005('0x3a')]=_[_0x2005('0x3c')](_0x1fafea[_0x2005('0x3a')],{'$or':_[_0x2005('0x2b')](_0x4408d1,function(_0xd51378){if(_0xd51378['type']!==_0x2005('0x3d')){var _0x3a0334={};_0x3a0334[_0xd51378[_0x2005('0x28')]]={'$like':'%'+_0x27924f[_0x2005('0x31')][_0x2005('0x3b')]+'%'};return _0x3a0334;}})});}_0x1fafea=_[_0x2005('0x3c')]({},_0x1fafea,_0x27924f[_0x2005('0x3e')]);var _0x5e1855={'where':_0x1fafea['where']};return db[_0x2005('0x2c')]['count'](_0x5e1855)[_0x2005('0x26')](function(_0x3b3eac){_0x3a7e29[_0x2005('0x1f')]=_0x3b3eac;if(_0x27924f['query']['includeAll']){_0x1fafea[_0x2005('0x3f')]=[{'all':!![]}];}return db['ChatInternalMessage'][_0x2005('0x40')](_0x1fafea);})[_0x2005('0x26')](function(_0x19bfc7){_0x3a7e29['rows']=_0x19bfc7;return _0x3a7e29;})[_0x2005('0x26')](respondWithFilteredResult(_0x264257,_0x1fafea))['catch'](handleError(_0x264257,null));};exports['show']=function(_0x232278,_0x1d009e){var _0x266b65={'raw':!![],'where':{'id':_0x232278[_0x2005('0x41')]['id']}},_0x206798={};_0x206798[_0x2005('0x30')]=_[_0x2005('0x42')](db[_0x2005('0x2c')][_0x2005('0x2d')]);_0x206798[_0x2005('0x31')]=_[_0x2005('0x42')](_0x232278['query']);_0x206798[_0x2005('0x32')]=_[_0x2005('0x33')](_0x206798[_0x2005('0x30')],_0x206798[_0x2005('0x31')]);_0x266b65['attributes']=_['intersection'](_0x206798['model'],qs[_0x2005('0x35')](_0x232278[_0x2005('0x31')][_0x2005('0x35')]));_0x266b65['attributes']=_0x266b65[_0x2005('0x34')][_0x2005('0x36')]?_0x266b65['attributes']:_0x206798[_0x2005('0x30')];if(_0x232278[_0x2005('0x31')]['includeAll']){_0x266b65[_0x2005('0x3f')]=[{'all':!![]}];}_0x266b65=_['merge']({},_0x266b65,_0x232278[_0x2005('0x3e')]);return db[_0x2005('0x2c')][_0x2005('0x43')](_0x266b65)['then'](handleEntityNotFound(_0x1d009e,null))[_0x2005('0x26')](respondWithResult(_0x1d009e,null))[_0x2005('0x44')](handleError(_0x1d009e,null));};exports[_0x2005('0x45')]=function(_0xc96105,_0x1b556f){return db[_0x2005('0x2c')][_0x2005('0x45')](_0xc96105[_0x2005('0x46')],{})['then'](respondWithResult(_0x1b556f,0xc9))[_0x2005('0x44')](handleError(_0x1b556f,null));};exports[_0x2005('0x25')]=function(_0x423e0a,_0x3e926c){if(_0x423e0a[_0x2005('0x46')]['id']){delete _0x423e0a[_0x2005('0x46')]['id'];}return db['ChatInternalMessage'][_0x2005('0x43')]({'where':{'id':_0x423e0a[_0x2005('0x41')]['id']}})[_0x2005('0x26')](handleEntityNotFound(_0x3e926c,null))[_0x2005('0x26')](saveUpdates(_0x423e0a[_0x2005('0x46')],null))[_0x2005('0x26')](respondWithResult(_0x3e926c,null))[_0x2005('0x44')](handleError(_0x3e926c,null));};exports[_0x2005('0x47')]=function(_0x54eff2,_0x2b34c3){return db[_0x2005('0x2c')][_0x2005('0x43')]({'where':{'id':_0x54eff2[_0x2005('0x41')]['id']}})[_0x2005('0x26')](handleEntityNotFound(_0x2b34c3,null))[_0x2005('0x26')](removeEntity(_0x2b34c3,null))[_0x2005('0x44')](handleError(_0x2b34c3,null));};exports[_0x2005('0x48')]=function(_0x833b58,_0x59fdfb){return db['ChatInternalMessage'][_0x2005('0x48')]()[_0x2005('0x26')](respondWithResult(_0x59fdfb,null))[_0x2005('0x44')](handleError(_0x59fdfb,null));};function wrapUser(_0x10a470){return function(_0x51577b){var _0x17dcbf=_0x10a470[_0x2005('0x49')]({'plain':!![]});_0x17dcbf[_0x2005('0x4a')]=[];if(_0x51577b){_0x17dcbf[_0x2005('0x4b')]=_0x51577b[_0x2005('0x4c')];_0x17dcbf[_0x2005('0x4d')]=_0x51577b;}else{_0x17dcbf['lastMessageAt']=moment(0x0)[_0x2005('0x4e')](_0x2005('0x4f'));_0x17dcbf[_0x2005('0x4d')]={};}return _0x17dcbf;};}exports[_0x2005('0x50')]=function(_0x3e7d4e,_0x48f070,_0x14e768){var _0x26116e=[];return db[_0x2005('0x51')][_0x2005('0x40')]({'where':{'role':[_0x2005('0x52'),_0x2005('0x53'),_0x2005('0x54')]},'attributes':['id',_0x2005('0x55'),'name',_0x2005('0x56'),_0x2005('0x57'),'internal','online',_0x2005('0x58'),_0x2005('0x59'),_0x2005('0x5a')],'order':qs[_0x2005('0x39')](_0x2005('0x5b')),'include':[{'model':db[_0x2005('0x5c')],'as':_0x2005('0x5d'),'attributes':['id',_0x2005('0x28'),_0x2005('0x2f')],'through':{'attributes':[]}}]})[_0x2005('0x26')](function(_0x1e365e){if(_0x1e365e){var _0x43d983=_0x3e7d4e[_0x2005('0x54')]['get']({'plain':!![]});if(!_0x43d983)throw new Error(_0x2005('0x5e'));if(_0x43d983['role']===_0x2005('0x54')){return db[_0x2005('0x5f')][_0x2005('0x43')]({'where':{'name':_0x2005('0x60'),'userProfileId':_0x43d983[_0x2005('0x61')]},'raw':!![]})['then'](function(_0x3c41ae){if(_0x3c41ae){if(_0x3c41ae[_0x2005('0x62')]===0x0){return db[_0x2005('0x63')][_0x2005('0x40')]({'where':{'sectionId':_0x3c41ae['id']},'raw':!![]})['then'](function(_0x2f507e){var _0x43f8ac=[];if(_[_0x2005('0x64')](_0x2f507e)){_0x43f8ac=_['filter'](_0x1e365e,function(_0x30991a){if(_0x30991a[_0x2005('0x56')]!=='agent'){return _0x30991a;}});return _0x43f8ac;}else{for(var _0x4e4d37=0x0;_0x4e4d37<_0x1e365e[_0x2005('0x36')];_0x4e4d37++){var _0x12b7d2=_0x1e365e[_0x4e4d37];if(_0x12b7d2[_0x2005('0x56')]===_0x2005('0x52')){var _0x34aa89=_['find'](_0x2f507e,function(_0x1f52d4){return _0x1f52d4[_0x2005('0x65')]===_0x12b7d2['id'];});if(_0x34aa89)_0x43f8ac[_0x2005('0x66')](_0x12b7d2);}else{_0x43f8ac[_0x2005('0x66')](_0x12b7d2);}}return _0x43f8ac;}});}else{return _0x1e365e;}}else{var _0x5627b3=_[_0x2005('0x3b')](_0x1e365e,function(_0x4b2453){if(_0x4b2453[_0x2005('0x56')]!==_0x2005('0x52')){return _0x4b2453;}});return _0x5627b3;}});}else{return _0x1e365e;}}})[_0x2005('0x26')](function(_0x4c9b5f){var _0x4ea91a=[];if(_0x4c9b5f){_0x26116e=_0x4c9b5f;for(var _0x449548=0x0;_0x449548<_0x4c9b5f[_0x2005('0x36')];_0x449548+=0x1){_0x26116e[_0x449548]['messages']=[];_0x4ea91a[_0x2005('0x66')](db['ChatInternalMessage']['find']({'where':{'FromId':[_0x3e7d4e['user']['id'],_0x4c9b5f[_0x449548]['id']],'ToId':[_0x3e7d4e[_0x2005('0x54')]['id'],_0x4c9b5f[_0x449548]['id']],'ChatGroupId':null},'attributes':['id',_0x2005('0x4c'),'FromId','ToId',_0x2005('0x67'),_0x2005('0x46')],'order':qs[_0x2005('0x39')](_0x2005('0x68')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x2005('0x26')](wrapUser(_0x4c9b5f[_0x449548])));}return BPromise[_0x2005('0x69')](_0x4ea91a);}return[];})[_0x2005('0x26')](function(_0x472059){return{'rows':_0x472059,'count':_0x472059[_0x2005('0x36')]};})['then'](respondWithResult(_0x48f070,null))[_0x2005('0x44')](handleError(_0x48f070,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index 5d14210..9206086 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 _0xf628=['exports','events','../../mysqldb','ChatInternalMessage','setMaxListeners','emit','hasOwnProperty'];(function(_0x398a4b,_0x3474fb){var _0x493eda=function(_0x388dbb){while(--_0x388dbb){_0x398a4b['push'](_0x398a4b['shift']());}};_0x493eda(++_0x3474fb);}(_0xf628,0x7f));var _0x8f62=function(_0x46ce86,_0x2e07e0){_0x46ce86=_0x46ce86-0x0;var _0x29e3b6=_0xf628[_0x46ce86];return _0x29e3b6;};'use strict';var EventEmitter=require(_0x8f62('0x0'));var ChatInternalMessage=require(_0x8f62('0x1'))['db'][_0x8f62('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x8f62('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x393c04){return function(_0x18593f,_0x1706d2,_0x2377a5){ChatInternalMessageEvents[_0x8f62('0x4')](_0x393c04+':'+_0x18593f['id'],_0x18593f);ChatInternalMessageEvents['emit'](_0x393c04,_0x18593f);_0x2377a5(null);};}for(var e in events){if(events[_0x8f62('0x5')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0x8f62('0x6')]=ChatInternalMessageEvents; \ No newline at end of file +var _0x6370=['events','../../mysqldb','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports'];(function(_0x4fff8b,_0x413fd4){var _0x8fd07e=function(_0x367f03){while(--_0x367f03){_0x4fff8b['push'](_0x4fff8b['shift']());}};_0x8fd07e(++_0x413fd4);}(_0x6370,0x99));var _0x0637=function(_0x58c513,_0x15deec){_0x58c513=_0x58c513-0x0;var _0x4da4c4=_0x6370[_0x58c513];return _0x4da4c4;};'use strict';var EventEmitter=require(_0x0637('0x0'));var ChatInternalMessage=require(_0x0637('0x1'))['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x0637('0x2')](0x0);var events={'afterCreate':_0x0637('0x3'),'afterUpdate':_0x0637('0x4'),'afterDestroy':'remove'};function emitEvent(_0x11b4ea){return function(_0x1e54b7,_0x3c9c73,_0x1a0239){ChatInternalMessageEvents[_0x0637('0x5')](_0x11b4ea+':'+_0x1e54b7['id'],_0x1e54b7);ChatInternalMessageEvents[_0x0637('0x5')](_0x11b4ea,_0x1e54b7);_0x1a0239(null);};}for(var e in events){if(events[_0x0637('0x6')](e)){var event=events[e];ChatInternalMessage[_0x0637('0x7')](e,emitEvent(event));}}module[_0x0637('0x8')]=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index 07bc515..94e90be 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 _0xc7b4=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','define','chat_internal_messages','utf8mb4','lodash'];(function(_0x3e6ac0,_0x34b200){var _0xe1dee5=function(_0x8864a8){while(--_0x8864a8){_0x3e6ac0['push'](_0x3e6ac0['shift']());}};_0xe1dee5(++_0x34b200);}(_0xc7b4,0x8b));var _0x4c7b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc7b4[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4c7b('0x0'));var util=require(_0x4c7b('0x1'));var logger=require('../../config/logger')(_0x4c7b('0x2'));var moment=require(_0x4c7b('0x3'));var BPromise=require(_0x4c7b('0x4'));var rp=require(_0x4c7b('0x5'));var fs=require('fs');var path=require(_0x4c7b('0x6'));var rimraf=require(_0x4c7b('0x7'));var config=require(_0x4c7b('0x8'));var attributes=require(_0x4c7b('0x9'));module[_0x4c7b('0xa')]=function(_0xa2f065,_0x20234b){return _0xa2f065[_0x4c7b('0xb')]('ChatInternalMessage',attributes,{'tableName':_0x4c7b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4c7b('0xd'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xa7ac=['lodash','util','../../config/logger','request-promise','path','rimraf','../../config/environment','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci'];(function(_0x2007e9,_0x29df16){var _0x435c09=function(_0x2cf569){while(--_0x2cf569){_0x2007e9['push'](_0x2007e9['shift']());}};_0x435c09(++_0x29df16);}(_0xa7ac,0xb6));var _0xca7a=function(_0x2cbfe5,_0x1fb99b){_0x2cbfe5=_0x2cbfe5-0x0;var _0x3f69ad=_0xa7ac[_0x2cbfe5];return _0x3f69ad;};'use strict';var _=require(_0xca7a('0x0'));var util=require(_0xca7a('0x1'));var logger=require(_0xca7a('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xca7a('0x3'));var fs=require('fs');var path=require(_0xca7a('0x4'));var rimraf=require(_0xca7a('0x5'));var config=require(_0xca7a('0x6'));var attributes=require('./chatInternalMessage.attributes');module[_0xca7a('0x7')]=function(_0x47dc7b,_0x4ca145){return _0x47dc7b[_0xca7a('0x8')](_0xca7a('0x9'),attributes,{'tableName':_0xca7a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xca7a('0xb'),'collate':_0xca7a('0xc')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index ffe6b11..17deb3f 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 _0xde84=['../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','defaults','localhost','register','info','ChatInternalMessage,\x20%s,\x20%s','debug','stringify','error','code','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x2f6322,_0xaf6305){var _0x77bcf6=function(_0x358932){while(--_0x358932){_0x2f6322['push'](_0x2f6322['shift']());}};_0x77bcf6(++_0xaf6305);}(_0xde84,0x84));var _0x4de8=function(_0x287e0f,_0x5638e7){_0x287e0f=_0x287e0f-0x0;var _0x4dd42a=_0xde84[_0x287e0f];return _0x4dd42a;};'use strict';var _=require(_0x4de8('0x0'));var util=require(_0x4de8('0x1'));var moment=require(_0x4de8('0x2'));var BPromise=require(_0x4de8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4de8('0x4'));var db=require(_0x4de8('0x5'))['db'];var utils=require(_0x4de8('0x6'));var logger=require(_0x4de8('0x7'))(_0x4de8('0x8'));var config=require(_0x4de8('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x4de8('0xa')]({'port':0x232a});config[_0x4de8('0xb')]=_[_0x4de8('0xc')](config[_0x4de8('0xb')],{'host':_0x4de8('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4de8('0xb')]));require('./chatInternalMessage.socket')[_0x4de8('0xe')](socket);function respondWithRpcPromise(_0x170a2b,_0x387a29,_0x185136){return new BPromise(function(_0x531f82,_0x65e52d){return client['request'](_0x170a2b,_0x185136)['then'](function(_0x718a0e){logger[_0x4de8('0xf')](_0x4de8('0x10'),_0x387a29,'request\x20sent');logger[_0x4de8('0x11')]('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x387a29,'request\x20sent',JSON[_0x4de8('0x12')](_0x718a0e));if(_0x718a0e['error']){if(_0x718a0e[_0x4de8('0x13')][_0x4de8('0x14')]===0x1f4){logger[_0x4de8('0x13')](_0x4de8('0x10'),_0x387a29,_0x718a0e[_0x4de8('0x13')][_0x4de8('0x15')]);return _0x65e52d(_0x718a0e[_0x4de8('0x13')]['message']);}logger[_0x4de8('0x13')](_0x4de8('0x10'),_0x387a29,_0x718a0e['error'][_0x4de8('0x15')]);return _0x531f82(_0x718a0e[_0x4de8('0x13')][_0x4de8('0x15')]);}else{logger['info'](_0x4de8('0x10'),_0x387a29,'request\x20sent');_0x531f82(_0x718a0e[_0x4de8('0x16')][_0x4de8('0x15')]);}})['catch'](function(_0x2edd23){logger['error']('ChatInternalMessage,\x20%s,\x20%s',_0x387a29,_0x2edd23);_0x65e52d(_0x2edd23);});});} \ No newline at end of file +var _0x1a6b=['register','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','ChatInternalMessage,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','redis','localhost','./chatInternalMessage.socket'];(function(_0x126797,_0x586e0a){var _0xe2afa7=function(_0x1e4a21){while(--_0x1e4a21){_0x126797['push'](_0x126797['shift']());}};_0xe2afa7(++_0x586e0a);}(_0x1a6b,0x94));var _0xb1a6=function(_0x1d15a9,_0x223eab){_0x1d15a9=_0x1d15a9-0x0;var _0x53ae6d=_0x1a6b[_0x1d15a9];return _0x53ae6d;};'use strict';var _=require(_0xb1a6('0x0'));var util=require(_0xb1a6('0x1'));var moment=require(_0xb1a6('0x2'));var BPromise=require('bluebird');var rs=require(_0xb1a6('0x3'));var fs=require('fs');var Redis=require(_0xb1a6('0x4'));var db=require(_0xb1a6('0x5'))['db'];var utils=require(_0xb1a6('0x6'));var logger=require('../../config/logger')(_0xb1a6('0x7'));var config=require('../../config/environment');var jayson=require(_0xb1a6('0x8'));var client=jayson[_0xb1a6('0x9')]['http']({'port':0x232a});config[_0xb1a6('0xa')]=_['defaults'](config[_0xb1a6('0xa')],{'host':_0xb1a6('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb1a6('0xa')]));require(_0xb1a6('0xc'))[_0xb1a6('0xd')](socket);function respondWithRpcPromise(_0x2dc37d,_0x4e585e,_0x41cde3){return new BPromise(function(_0x211cdd,_0x19fd96){return client['request'](_0x2dc37d,_0x41cde3)['then'](function(_0x4bffda){logger['info'](_0xb1a6('0xe'),_0x4e585e,_0xb1a6('0xf'));logger['debug'](_0xb1a6('0x10'),_0x4e585e,'request\x20sent',JSON['stringify'](_0x4bffda));if(_0x4bffda[_0xb1a6('0x11')]){if(_0x4bffda['error'][_0xb1a6('0x12')]===0x1f4){logger['error'](_0xb1a6('0xe'),_0x4e585e,_0x4bffda[_0xb1a6('0x11')][_0xb1a6('0x13')]);return _0x19fd96(_0x4bffda['error'][_0xb1a6('0x13')]);}logger['error'](_0xb1a6('0xe'),_0x4e585e,_0x4bffda['error'][_0xb1a6('0x13')]);return _0x211cdd(_0x4bffda['error'][_0xb1a6('0x13')]);}else{logger[_0xb1a6('0x14')](_0xb1a6('0xe'),_0x4e585e,_0xb1a6('0xf'));_0x211cdd(_0x4bffda[_0xb1a6('0x15')][_0xb1a6('0x13')]);}})[_0xb1a6('0x16')](function(_0x5e42ca){logger[_0xb1a6('0x11')]('ChatInternalMessage,\x20%s,\x20%s',_0x4e585e,_0x5e42ca);_0x19fd96(_0x5e42ca);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index d7bb81a..dbfdb48 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 _0xe2e5=['emit','removeListener','register','length','chatInternalMessage:','./chatInternalMessage.events','save','update'];(function(_0x566e36,_0x25a2f9){var _0x18fc87=function(_0x102b83){while(--_0x102b83){_0x566e36['push'](_0x566e36['shift']());}};_0x18fc87(++_0x25a2f9);}(_0xe2e5,0x135));var _0x5e2e=function(_0x365e6d,_0x2b0157){_0x365e6d=_0x365e6d-0x0;var _0x76b60=_0xe2e5[_0x365e6d];return _0x76b60;};'use strict';var ChatInternalMessageEvents=require(_0x5e2e('0x0'));var events=[_0x5e2e('0x1'),'remove',_0x5e2e('0x2')];function createListener(_0x542ae8,_0x33a6b8){return function(_0x2c375a){_0x33a6b8[_0x5e2e('0x3')](_0x542ae8,_0x2c375a);};}function removeListener(_0x5ecd21,_0x5bad8a){return function(){ChatInternalMessageEvents[_0x5e2e('0x4')](_0x5ecd21,_0x5bad8a);};}exports[_0x5e2e('0x5')]=function(_0x58518e){for(var _0x5f5bc7=0x0,_0x9166fc=events[_0x5e2e('0x6')];_0x5f5bc7<_0x9166fc;_0x5f5bc7++){var _0x2c08ee=events[_0x5f5bc7];var _0x58fce3=createListener(_0x5e2e('0x7')+_0x2c08ee,_0x58518e);ChatInternalMessageEvents['on'](_0x2c08ee,_0x58fce3);}}; \ No newline at end of file +var _0xc0f5=['length','chatInternalMessage:','./chatInternalMessage.events','save','remove','update','emit','register'];(function(_0x381379,_0x3f3b86){var _0x3e1063=function(_0x4c282d){while(--_0x4c282d){_0x381379['push'](_0x381379['shift']());}};_0x3e1063(++_0x3f3b86);}(_0xc0f5,0x11a));var _0x5c0f=function(_0x508c7e,_0x9ac41e){_0x508c7e=_0x508c7e-0x0;var _0x4476e3=_0xc0f5[_0x508c7e];return _0x4476e3;};'use strict';var ChatInternalMessageEvents=require(_0x5c0f('0x0'));var events=[_0x5c0f('0x1'),_0x5c0f('0x2'),_0x5c0f('0x3')];function createListener(_0x3e6abb,_0x3d0c9f){return function(_0x12c8a3){_0x3d0c9f[_0x5c0f('0x4')](_0x3e6abb,_0x12c8a3);};}function removeListener(_0x1048d9,_0x105281){return function(){ChatInternalMessageEvents['removeListener'](_0x1048d9,_0x105281);};}exports[_0x5c0f('0x5')]=function(_0x34c0e9){for(var _0xd437c6=0x0,_0x116db2=events[_0x5c0f('0x6')];_0xd437c6<_0x116db2;_0xd437c6++){var _0x44a9d3=events[_0xd437c6];var _0x2e96c3=createListener(_0x5c0f('0x7')+_0x44a9d3,_0x34c0e9);ChatInternalMessageEvents['on'](_0x44a9d3,_0x2e96c3);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index fd99667..22377de 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 _0x969d=['post','create','put','update','destroy','multer','util','connect-timeout','express','Router','fs-extra','./chatInternalMessage.controller','get','isAuthenticated','index','/describe','describe','/users','getUsers','/:id','show'];(function(_0x311879,_0x25d1e1){var _0x4e7cd4=function(_0x4f4e88){while(--_0x4f4e88){_0x311879['push'](_0x311879['shift']());}};_0x4e7cd4(++_0x25d1e1);}(_0x969d,0x155));var _0xd969=function(_0x5c6831,_0x3fe733){_0x5c6831=_0x5c6831-0x0;var _0x4d96af=_0x969d[_0x5c6831];return _0x4d96af;};'use strict';var multer=require(_0xd969('0x0'));var util=require(_0xd969('0x1'));var path=require('path');var timeout=require(_0xd969('0x2'));var express=require(_0xd969('0x3'));var router=express[_0xd969('0x4')]();var fs_extra=require(_0xd969('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xd969('0x6'));router[_0xd969('0x7')]('/',auth[_0xd969('0x8')](),controller[_0xd969('0x9')]);router[_0xd969('0x7')](_0xd969('0xa'),auth[_0xd969('0x8')](),controller[_0xd969('0xb')]);router[_0xd969('0x7')](_0xd969('0xc'),auth['isAuthenticated'](),controller[_0xd969('0xd')]);router[_0xd969('0x7')](_0xd969('0xe'),auth['isAuthenticated'](),controller[_0xd969('0xf')]);router[_0xd969('0x10')]('/',auth[_0xd969('0x8')](),controller[_0xd969('0x11')]);router[_0xd969('0x12')](_0xd969('0xe'),controller[_0xd969('0x13')]);router['delete']('/:id',auth[_0xd969('0x8')](),controller[_0xd969('0x14')]);module['exports']=router; \ No newline at end of file +var _0x5c04=['connect-timeout','fs-extra','../../components/auth/service','get','/describe','isAuthenticated','/users','getUsers','show','create','/:id','update','exports','multer','util'];(function(_0x5b360e,_0x494136){var _0x1bf752=function(_0x6df32e){while(--_0x6df32e){_0x5b360e['push'](_0x5b360e['shift']());}};_0x1bf752(++_0x494136);}(_0x5c04,0x139));var _0x45c0=function(_0x43695d,_0x34bc11){_0x43695d=_0x43695d-0x0;var _0x2c004d=_0x5c04[_0x43695d];return _0x2c004d;};'use strict';var multer=require(_0x45c0('0x0'));var util=require(_0x45c0('0x1'));var path=require('path');var timeout=require(_0x45c0('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x45c0('0x3'));var auth=require(_0x45c0('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./chatInternalMessage.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x45c0('0x5')](_0x45c0('0x6'),auth[_0x45c0('0x7')](),controller['describe']);router[_0x45c0('0x5')](_0x45c0('0x8'),auth[_0x45c0('0x7')](),controller[_0x45c0('0x9')]);router['get']('/:id',auth[_0x45c0('0x7')](),controller[_0x45c0('0xa')]);router['post']('/',auth[_0x45c0('0x7')](),controller[_0x45c0('0xb')]);router['put'](_0x45c0('0xc'),controller[_0x45c0('0xd')]);router['delete'](_0x45c0('0xc'),auth[_0x45c0('0x7')](),controller['destroy']);module[_0x45c0('0xe')]=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index ddce367..ab2ea94 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 _0x1123=['TEXT','BOOLEAN','ENUM','DATE','STRING'];(function(_0x54aef6,_0x4155fc){var _0x1a2d10=function(_0x4cefb6){while(--_0x4cefb6){_0x54aef6['push'](_0x54aef6['shift']());}};_0x1a2d10(++_0x4155fc);}(_0x1123,0x118));var _0x3112=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x1123[_0x2be8c2];return _0x97f531;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0x3112('0x0')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x3112('0x1')],'defaultValue':![]},'secret':{'type':Sequelize[_0x3112('0x1')],'defaultValue':![]},'direction':{'type':Sequelize[_0x3112('0x2')]('in','out'),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x3112('0x3')]},'providerName':{'type':Sequelize[_0x3112('0x4')]},'providerResponse':{'type':Sequelize[_0x3112('0x0')]}}; \ No newline at end of file +var _0x117c=['ENUM','out','DATE','STRING','TEXT','medium'];(function(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0x117c,0x71));var _0xc117=function(_0xb72cc8,_0x3b7aa3){_0xb72cc8=_0xb72cc8-0x0;var _0x75cfb3=_0x117c[_0xb72cc8];return _0x75cfb3;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize['TEXT'](_0xc117('0x0')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xc117('0x1')]('in',_0xc117('0x2')),'defaultValue':_0xc117('0x2'),'allowNull':![]},'readAt':{'type':Sequelize[_0xc117('0x3')]},'providerName':{'type':Sequelize[_0xc117('0x4')]},'providerResponse':{'type':Sequelize[_0xc117('0x5')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index 4608446..e8b5d11 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 _0x05cd=['set','Content-Range','reject','save','destroy','sendStatus','name','send','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','type','options','ChatMessage','includeAll','include','findAll','rows','find','create','body','update','params','describe','../../config/logger','chat-interactions','accept','chat','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','ChatInteractionId','read1stAt','interaction','get','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','contact','User','agent','fullname','email','internal','SIP/%s','channel','motionChannel','EventManager','acceptmessage','parse','formData','ChatInteraction','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','null','rejectMessage','QueryTypes','SELECT','interface','rejectmessage','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./chatMessage.socket','jayson/promise','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','ChatMessage,\x20%s,\x20%s,\x20%s','error','code','message','catch','end','status','json','offset','limit','count'];(function(_0x555573,_0x462f66){var _0x2c48e4=function(_0x1c00ac){while(--_0x1c00ac){_0x555573['push'](_0x555573['shift']());}};_0x2c48e4(++_0x462f66);}(_0x05cd,0xd4));var _0xd05c=function(_0x3b58b5,_0x5799ad){_0x3b58b5=_0x3b58b5-0x0;var _0x5d48e6=_0x05cd[_0x3b58b5];return _0x5d48e6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd05c('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd05c('0x1'));var rp=require(_0xd05c('0x2'));var moment=require(_0xd05c('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xd05c('0x4'));var util=require(_0xd05c('0x5'));var path=require(_0xd05c('0x6'));var sox=require(_0xd05c('0x7'));var csv=require(_0xd05c('0x8'));var ejs=require(_0xd05c('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd05c('0xa'));var squel=require(_0xd05c('0xb'));var crypto=require(_0xd05c('0xc'));var jsforce=require(_0xd05c('0xd'));var deskjs=require(_0xd05c('0xe'));var toCsv=require(_0xd05c('0x8'));var querystring=require(_0xd05c('0xf'));var Papa=require('papaparse');var Redis=require(_0xd05c('0x10'));var authService=require(_0xd05c('0x11'));var qs=require(_0xd05c('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd05c('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xd05c('0x14'));var config=require(_0xd05c('0x15'));var licenseUtil=require(_0xd05c('0x16'));var db=require(_0xd05c('0x17'))['db'];config[_0xd05c('0x18')]=_[_0xd05c('0x19')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xd05c('0x1a'))(new Redis(config[_0xd05c('0x18')]));require(_0xd05c('0x1b'))['register'](socket);var jayson=require(_0xd05c('0x1c'));var client=jayson[_0xd05c('0x1d')][_0xd05c('0x1e')]({'port':0x232c});var client9002=jayson[_0xd05c('0x1d')]['http']({'port':0x232a});function respondWithRpcPromise(_0x504db0,_0x455804,_0x2645d3,_0x29a6e7){return new BPromise(function(_0x1d6838,_0x57fa3f){var _0x431611=_0x29a6e7||client;return _0x431611[_0xd05c('0x1f')](_0x504db0,_0x2645d3)[_0xd05c('0x20')](function(_0xb3a471){logger[_0xd05c('0x21')](_0xd05c('0x22'),_0x455804,'request\x20sent');logger['debug'](_0xd05c('0x23'),_0x455804,'request\x20sent',JSON['stringify'](_0xb3a471));if(_0xb3a471[_0xd05c('0x24')]){if(_0xb3a471[_0xd05c('0x24')][_0xd05c('0x25')]===0x1f4){logger['error'](_0xd05c('0x22'),_0x455804,_0xb3a471[_0xd05c('0x24')][_0xd05c('0x26')]);return _0x57fa3f(_0xb3a471[_0xd05c('0x24')][_0xd05c('0x26')]);}logger['error'](_0xd05c('0x22'),_0x455804,_0xb3a471[_0xd05c('0x24')]['message']);return _0x1d6838(_0xb3a471[_0xd05c('0x24')][_0xd05c('0x26')]);}else{logger['info'](_0xd05c('0x22'),_0x455804,'request\x20sent');_0x1d6838(_0xb3a471['result'][_0xd05c('0x26')]);}})[_0xd05c('0x27')](function(_0x6d4d9e){logger[_0xd05c('0x24')](_0xd05c('0x22'),_0x455804,_0x6d4d9e);_0x57fa3f(_0x6d4d9e);});});}function respondWithStatusCode(_0x4937f2,_0x27876d){_0x27876d=_0x27876d||0xcc;return function(_0x58011b){if(_0x58011b){return _0x4937f2['sendStatus'](_0x27876d);}return _0x4937f2['status'](_0x27876d)[_0xd05c('0x28')]();};}function respondWithResult(_0x3a38a0,_0x254034){_0x254034=_0x254034||0xc8;return function(_0x49d14a){if(_0x49d14a){return _0x3a38a0[_0xd05c('0x29')](_0x254034)[_0xd05c('0x2a')](_0x49d14a);}};}function respondWithFilteredResult(_0x546107,_0x2b9a43){return function(_0x26e195){if(_0x26e195){var _0x4d5513=typeof _0x2b9a43[_0xd05c('0x2b')]==='undefined'&&typeof _0x2b9a43[_0xd05c('0x2c')]==='undefined';var _0x573bfb=_0x26e195[_0xd05c('0x2d')];var _0x530949=_0x4d5513?0x0:_0x2b9a43[_0xd05c('0x2b')];var _0x52c85c=_0x4d5513?_0x26e195['count']:_0x2b9a43['offset']+_0x2b9a43[_0xd05c('0x2c')];var _0xfd08e2;if(_0x52c85c>=_0x573bfb){_0x52c85c=_0x573bfb;_0xfd08e2=0xc8;}else{_0xfd08e2=0xce;}_0x546107[_0xd05c('0x29')](_0xfd08e2);return _0x546107[_0xd05c('0x2e')](_0xd05c('0x2f'),_0x530949+'-'+_0x52c85c+'/'+_0x573bfb)['json'](_0x26e195);}return null;};}function patchUpdates(_0x178333){return function(_0x4b580c){try{jsonpatch['apply'](_0x4b580c,_0x178333,!![]);}catch(_0x497e59){return BPromise[_0xd05c('0x30')](_0x497e59);}return _0x4b580c[_0xd05c('0x31')]();};}function saveUpdates(_0x44b905,_0x5c2430){return function(_0x922ccb){if(_0x922ccb){return _0x922ccb['update'](_0x44b905)['then'](function(_0x4621df){return _0x4621df;});}return null;};}function removeEntity(_0x53bef1,_0xc25105){return function(_0xaffdce){if(_0xaffdce){return _0xaffdce[_0xd05c('0x32')]()[_0xd05c('0x20')](function(){_0x53bef1[_0xd05c('0x29')](0xcc)[_0xd05c('0x28')]();});}};}function handleEntityNotFound(_0x136d97,_0x515f02){return function(_0x3372f7){if(!_0x3372f7){_0x136d97[_0xd05c('0x33')](0x194);}return _0x3372f7;};}function handleError(_0x215fd8,_0x8a4931){_0x8a4931=_0x8a4931||0x1f4;return function(_0x1febbd){logger[_0xd05c('0x24')](_0x1febbd['stack']);if(_0x1febbd[_0xd05c('0x34')]){delete _0x1febbd[_0xd05c('0x34')];}_0x215fd8['status'](_0x8a4931)[_0xd05c('0x35')](_0x1febbd);};}exports['index']=function(_0x5afaaa,_0x1c4b85){var _0x56f26f={},_0x4f7307={},_0x569432={'count':0x0,'rows':[]};var _0x5b50ce=_[_0xd05c('0x36')](db['ChatMessage'][_0xd05c('0x37')],function(_0x32cd33){return{'name':_0x32cd33[_0xd05c('0x38')],'type':_0x32cd33['type'][_0xd05c('0x39')]};});_0x4f7307[_0xd05c('0x3a')]=_[_0xd05c('0x36')](_0x5b50ce,'name');_0x4f7307[_0xd05c('0x3b')]=_[_0xd05c('0x3c')](_0x5afaaa[_0xd05c('0x3b')]);_0x4f7307[_0xd05c('0x3d')]=_[_0xd05c('0x3e')](_0x4f7307[_0xd05c('0x3a')],_0x4f7307[_0xd05c('0x3b')]);_0x56f26f[_0xd05c('0x3f')]=_[_0xd05c('0x3e')](_0x4f7307[_0xd05c('0x3a')],qs[_0xd05c('0x40')](_0x5afaaa[_0xd05c('0x3b')][_0xd05c('0x40')]));_0x56f26f['attributes']=_0x56f26f['attributes'][_0xd05c('0x41')]?_0x56f26f[_0xd05c('0x3f')]:_0x4f7307[_0xd05c('0x3a')];if(!_0x5afaaa[_0xd05c('0x3b')]['hasOwnProperty'](_0xd05c('0x42'))){_0x56f26f[_0xd05c('0x2c')]=qs[_0xd05c('0x2c')](_0x5afaaa[_0xd05c('0x3b')][_0xd05c('0x2c')]);_0x56f26f[_0xd05c('0x2b')]=qs[_0xd05c('0x2b')](_0x5afaaa[_0xd05c('0x3b')][_0xd05c('0x2b')]);}_0x56f26f[_0xd05c('0x43')]=qs[_0xd05c('0x44')](_0x5afaaa[_0xd05c('0x3b')][_0xd05c('0x44')]);_0x56f26f['where']=qs[_0xd05c('0x3d')](_[_0xd05c('0x45')](_0x5afaaa[_0xd05c('0x3b')],_0x4f7307['filters']),_0x5b50ce);if(_0x5afaaa[_0xd05c('0x3b')][_0xd05c('0x46')]){_0x56f26f[_0xd05c('0x47')]=_[_0xd05c('0x48')](_0x56f26f[_0xd05c('0x47')],{'$or':_[_0xd05c('0x36')](_0x5b50ce,function(_0x2a28f2){if(_0x2a28f2[_0xd05c('0x49')]!=='VIRTUAL'){var _0x352c2a={};_0x352c2a[_0x2a28f2['name']]={'$like':'%'+_0x5afaaa[_0xd05c('0x3b')][_0xd05c('0x46')]+'%'};return _0x352c2a;}})});}_0x56f26f=_['merge']({},_0x56f26f,_0x5afaaa[_0xd05c('0x4a')]);var _0x48ae35={'where':_0x56f26f[_0xd05c('0x47')]};return db[_0xd05c('0x4b')][_0xd05c('0x2d')](_0x48ae35)[_0xd05c('0x20')](function(_0x402c3a){_0x569432[_0xd05c('0x2d')]=_0x402c3a;if(_0x5afaaa['query'][_0xd05c('0x4c')]){_0x56f26f[_0xd05c('0x4d')]=[{'all':!![]}];}return db['ChatMessage'][_0xd05c('0x4e')](_0x56f26f);})['then'](function(_0x5c523e){_0x569432[_0xd05c('0x4f')]=_0x5c523e;return _0x569432;})[_0xd05c('0x20')](respondWithFilteredResult(_0x1c4b85,_0x56f26f))[_0xd05c('0x27')](handleError(_0x1c4b85,null));};exports['show']=function(_0x162b20,_0x2bb870){var _0x27add4={'raw':!![],'where':{'id':_0x162b20['params']['id']}},_0x5c8cb2={};_0x5c8cb2[_0xd05c('0x3a')]=_['keys'](db[_0xd05c('0x4b')][_0xd05c('0x37')]);_0x5c8cb2[_0xd05c('0x3b')]=_[_0xd05c('0x3c')](_0x162b20[_0xd05c('0x3b')]);_0x5c8cb2['filters']=_[_0xd05c('0x3e')](_0x5c8cb2[_0xd05c('0x3a')],_0x5c8cb2[_0xd05c('0x3b')]);_0x27add4[_0xd05c('0x3f')]=_[_0xd05c('0x3e')](_0x5c8cb2[_0xd05c('0x3a')],qs[_0xd05c('0x40')](_0x162b20['query'][_0xd05c('0x40')]));_0x27add4[_0xd05c('0x3f')]=_0x27add4[_0xd05c('0x3f')][_0xd05c('0x41')]?_0x27add4[_0xd05c('0x3f')]:_0x5c8cb2['model'];if(_0x162b20[_0xd05c('0x3b')][_0xd05c('0x4c')]){_0x27add4[_0xd05c('0x4d')]=[{'all':!![]}];}_0x27add4=_[_0xd05c('0x48')]({},_0x27add4,_0x162b20[_0xd05c('0x4a')]);return db[_0xd05c('0x4b')][_0xd05c('0x50')](_0x27add4)['then'](handleEntityNotFound(_0x2bb870,null))[_0xd05c('0x20')](respondWithResult(_0x2bb870,null))['catch'](handleError(_0x2bb870,null));};exports[_0xd05c('0x51')]=function(_0x4a2702,_0x399956){return db[_0xd05c('0x4b')][_0xd05c('0x51')](_0x4a2702[_0xd05c('0x52')],{})[_0xd05c('0x20')](respondWithResult(_0x399956,0xc9))[_0xd05c('0x27')](handleError(_0x399956,null));};exports[_0xd05c('0x53')]=function(_0x45b50c,_0x77916d){if(_0x45b50c[_0xd05c('0x52')]['id']){delete _0x45b50c['body']['id'];}return db['ChatMessage'][_0xd05c('0x50')]({'where':{'id':_0x45b50c['params']['id']}})['then'](handleEntityNotFound(_0x77916d,null))[_0xd05c('0x20')](saveUpdates(_0x45b50c[_0xd05c('0x52')],null))[_0xd05c('0x20')](respondWithResult(_0x77916d,null))[_0xd05c('0x27')](handleError(_0x77916d,null));};exports['destroy']=function(_0x325983,_0x419da7){return db[_0xd05c('0x4b')][_0xd05c('0x50')]({'where':{'id':_0x325983[_0xd05c('0x54')]['id']}})[_0xd05c('0x20')](handleEntityNotFound(_0x419da7,null))[_0xd05c('0x20')](removeEntity(_0x419da7,null))[_0xd05c('0x27')](handleError(_0x419da7,null));};exports[_0xd05c('0x55')]=function(_0x28b175,_0x537339){return db['ChatMessage'][_0xd05c('0x55')]()['then'](respondWithResult(_0x537339,null))['catch'](handleError(_0x537339,null));};var interaction_log=require(_0xd05c('0x56'))(_0xd05c('0x57'));exports[_0xd05c('0x58')]=function(_0x542ed4,_0x5cd5e0,_0x37bcc7){var _0x24e7c3={'agent':{},'channel':_0xd05c('0x59')};if(_0x542ed4['body']['id']){delete _0x542ed4[_0xd05c('0x52')]['id'];}_0x542ed4[_0xd05c('0x52')]['read']=!![];_0x542ed4[_0xd05c('0x52')][_0xd05c('0x5a')]=moment()[_0xd05c('0x5b')](_0xd05c('0x5c'));_0x542ed4['body'][_0xd05c('0x5d')]=_0x542ed4[_0xd05c('0x52')][_0xd05c('0x5d')]||_0x542ed4['user']['id'];_0x24e7c3['agent']['id']=_0x542ed4['body']['UserId'];return db[_0xd05c('0x4b')][_0xd05c('0x50')]({'where':{'id':_0x542ed4['params']['id'],'UserId':null}})[_0xd05c('0x20')](handleEntityNotFound(_0x5cd5e0,null))['then'](saveUpdates(_0x542ed4[_0xd05c('0x52')],null))[_0xd05c('0x20')](function(_0x1a50e5){if(_0x1a50e5){_0x24e7c3[_0xd05c('0x26')]=_0x1a50e5['get']({'plain':!![]});return db['ChatInteraction'][_0xd05c('0x50')]({'where':{'id':_0x1a50e5[_0xd05c('0x5e')]}});}return null;})[_0xd05c('0x20')](handleEntityNotFound(_0x5cd5e0,null))['then'](function(_0x59c217){if(_0x59c217){return _0x59c217[_0xd05c('0x53')]({'UserId':_0x542ed4['body'][_0xd05c('0x5d')],'read1stAt':_['isNil'](_0x59c217[_0xd05c('0x5f')])?moment()[_0xd05c('0x5b')](_0xd05c('0x5c')):undefined});}return null;})[_0xd05c('0x20')](function(_0x11f0ac){if(_0x11f0ac){_0x24e7c3[_0xd05c('0x60')]=_0x11f0ac[_0xd05c('0x61')]({'plain':!![]});interaction_log[_0xd05c('0x21')](_0xd05c('0x62'),_0x542ed4[_0xd05c('0x63')]['id'],_0x542ed4[_0xd05c('0x63')]['name'],_0x542ed4[_0xd05c('0x63')][_0xd05c('0x64')],_0x24e7c3[_0xd05c('0x60')]['id'],_0x542ed4['body']?JSON['stringify'](_0x542ed4['body']):'null');return respondWithRpcPromise(_0xd05c('0x65'),_0xd05c('0x66'),_0x24e7c3);}return null;})[_0xd05c('0x20')](function(_0x50bdc1){var _0x2d9e54=_0xd05c('0x67')+_0x50bdc1['message'][_0xd05c('0x68')];return db[_0xd05c('0x69')][_0xd05c('0x3b')](_0x2d9e54,{'type':db[_0xd05c('0x6a')]['QueryTypes']['SELECT'],'raw':!![]})[_0xd05c('0x20')](function(_0x22cd55){return _0x22cd55;});})[_0xd05c('0x20')](function(_0x34655c){if(_0x34655c){_0x24e7c3[_0xd05c('0x26')][_0xd05c('0x6b')]=_0x34655c[0x0];if(!_0x542ed4['body'][_0xd05c('0x5d')])return;return db[_0xd05c('0x6c')][_0xd05c('0x50')]({'where':{'id':_0x542ed4[_0xd05c('0x52')]['UserId'],'role':_0xd05c('0x6d')},'attributes':['id',_0xd05c('0x34'),_0xd05c('0x6e'),_0xd05c('0x6f'),_0xd05c('0x70')],'raw':!![]});}return null;})['then'](function(_0xca753a){if(!_0xca753a)return null;_0x24e7c3['message'][_0xd05c('0x6d')]=_0xca753a;return _0x24e7c3;})['then'](function(_0x1e23e5){if(_0x1e23e5){if(_0x542ed4[_0xd05c('0x52')]['manual']){_0x24e7c3[_0xd05c('0x26')]['interface']=util[_0xd05c('0x5b')](_0xd05c('0x71'),_0x542ed4['user'][_0xd05c('0x34')]);_0x24e7c3['message'][_0xd05c('0x72')]=_0x24e7c3['channel'];_0x24e7c3[_0xd05c('0x26')][_0xd05c('0x73')]=_0x24e7c3[_0xd05c('0x72')];_0x24e7c3[_0xd05c('0x26')]['event']=_0xd05c('0x58');return respondWithRpcPromise('EventManager',_0xd05c('0x74'),{'event':_0xd05c('0x75'),'message':_[_0xd05c('0x48')](_0x24e7c3[_0xd05c('0x26')],JSON[_0xd05c('0x76')](_0x24e7c3['interaction'][_0xd05c('0x77')]))},client9002)[_0xd05c('0x20')](function(){return _0x24e7c3;});}return _0x24e7c3;}return null;})[_0xd05c('0x20')](respondWithResult(_0x5cd5e0,null))[_0xd05c('0x27')](handleError(_0x5cd5e0,null));};var interaction_log=require(_0xd05c('0x56'))(_0xd05c('0x57'));exports['reject']=function(_0x3e2815,_0x56d64b,_0x56f12c){var _0x2d6041={'agent':{},'channel':_0xd05c('0x59')};if(_0x3e2815['body']['id']){delete _0x3e2815['body']['id'];}_0x3e2815[_0xd05c('0x52')][_0xd05c('0x5d')]=_0x3e2815[_0xd05c('0x52')][_0xd05c('0x5d')]||_0x3e2815[_0xd05c('0x63')]['id'];_0x2d6041[_0xd05c('0x6d')]['id']=_0x3e2815[_0xd05c('0x52')][_0xd05c('0x5d')];return db[_0xd05c('0x4b')][_0xd05c('0x50')]({'where':{'id':_0x3e2815['params']['id'],'UserId':null}})[_0xd05c('0x20')](handleEntityNotFound(_0x56d64b,null))['then'](function(_0x3661de){if(_0x3661de){_0x2d6041['message']=_0x3661de[_0xd05c('0x61')]({'plain':!![]});return db[_0xd05c('0x78')][_0xd05c('0x50')]({'where':{'id':_0x3661de[_0xd05c('0x5e')]}});}return null;})['then'](handleEntityNotFound(_0x56d64b,null))[_0xd05c('0x20')](function(_0x1c7791){if(_0x1c7791){_0x2d6041[_0xd05c('0x60')]=_0x1c7791[_0xd05c('0x61')]({'plain':!![]});interaction_log[_0xd05c('0x21')](_0xd05c('0x79'),_0x3e2815[_0xd05c('0x63')]['id'],_0x3e2815[_0xd05c('0x63')][_0xd05c('0x34')],_0x3e2815['user'][_0xd05c('0x64')],_0x2d6041[_0xd05c('0x60')]['id'],_0x3e2815[_0xd05c('0x52')]?JSON[_0xd05c('0x7a')](_0x3e2815[_0xd05c('0x52')]):_0xd05c('0x7b'));return respondWithRpcPromise('RejectMessage',_0xd05c('0x7c'),_0x2d6041);}return null;})[_0xd05c('0x20')](function(_0x15a87a){var _0x530775=_0xd05c('0x67')+_0x15a87a[_0xd05c('0x26')][_0xd05c('0x68')];return db[_0xd05c('0x69')]['query'](_0x530775,{'type':db[_0xd05c('0x6a')][_0xd05c('0x7d')][_0xd05c('0x7e')],'raw':!![]})[_0xd05c('0x20')](function(_0x18387e){return _0x18387e;});})[_0xd05c('0x20')](function(_0x34b001){if(_0x34b001){_0x2d6041[_0xd05c('0x26')][_0xd05c('0x6b')]=_0x34b001[0x0];if(!_0x3e2815['body'][_0xd05c('0x5d')])return;return db['User'][_0xd05c('0x50')]({'where':{'id':_0x3e2815[_0xd05c('0x52')][_0xd05c('0x5d')],'role':_0xd05c('0x6d')},'attributes':['id','name',_0xd05c('0x6e'),'email',_0xd05c('0x70')],'raw':!![]});}return null;})[_0xd05c('0x20')](function(_0x2dbbba){if(!_0x2dbbba)return null;_0x2d6041[_0xd05c('0x26')]['agent']=_0x2dbbba;return _0x2d6041;})['then'](function(_0x250598){if(_0x250598){_0x250598[_0xd05c('0x26')][_0xd05c('0x7f')]=util[_0xd05c('0x5b')](_0xd05c('0x71'),_0x3e2815[_0xd05c('0x63')][_0xd05c('0x34')]);_0x250598[_0xd05c('0x26')][_0xd05c('0x72')]=_0x2d6041[_0xd05c('0x72')];_0x250598[_0xd05c('0x26')]['motionChannel']=_0x2d6041['channel'];_0x250598[_0xd05c('0x26')]['event']=_0xd05c('0x30');respondWithRpcPromise(_0xd05c('0x74'),_0xd05c('0x74'),{'event':_0xd05c('0x80'),'message':_[_0xd05c('0x48')](_0x2d6041['message'],JSON[_0xd05c('0x76')](_0x2d6041['interaction'][_0xd05c('0x77')]))},client9002);return _0x2d6041;}return null;})[_0xd05c('0x20')](respondWithResult(_0x56d64b,null))[_0xd05c('0x27')](handleError(_0x56d64b,null));}; \ No newline at end of file +var _0xfdb4=['include','findAll','rows','show','params','keys','includeAll','catch','create','body','find','destroy','describe','accept','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','interaction','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','EventManager','acceptmessage','chat-interactions','role','null','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','event','rejectmessage','parse','formData','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','ChatMessage,\x20%s,\x20%s','sendStatus','end','json','offset','undefined','count','limit','status','set','Content-Range','apply','reject','save','update','stack','name','send','index','map','ChatMessage','rawAttributes','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options'];(function(_0x8a969d,_0x339d9f){var _0x1d8dc7=function(_0x283ec0){while(--_0x283ec0){_0x8a969d['push'](_0x8a969d['shift']());}};_0x1d8dc7(++_0x339d9f);}(_0xfdb4,0x14f));var _0x4fdb=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0xfdb4[_0x4fde08];return _0x12e725;};'use strict';var emlformat=require(_0x4fdb('0x0'));var rimraf=require(_0x4fdb('0x1'));var zipdir=require(_0x4fdb('0x2'));var jsonpatch=require(_0x4fdb('0x3'));var rp=require('request-promise');var moment=require(_0x4fdb('0x4'));var BPromise=require(_0x4fdb('0x5'));var Mustache=require(_0x4fdb('0x6'));var util=require('util');var path=require(_0x4fdb('0x7'));var sox=require(_0x4fdb('0x8'));var csv=require('to-csv');var ejs=require(_0x4fdb('0x9'));var fs=require('fs');var fs_extra=require(_0x4fdb('0xa'));var _=require(_0x4fdb('0xb'));var squel=require(_0x4fdb('0xc'));var crypto=require(_0x4fdb('0xd'));var jsforce=require(_0x4fdb('0xe'));var deskjs=require(_0x4fdb('0xf'));var toCsv=require(_0x4fdb('0x10'));var querystring=require(_0x4fdb('0x11'));var Papa=require(_0x4fdb('0x12'));var Redis=require(_0x4fdb('0x13'));var authService=require(_0x4fdb('0x14'));var qs=require(_0x4fdb('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4fdb('0x16'));var logger=require(_0x4fdb('0x17'))('api');var utils=require(_0x4fdb('0x18'));var config=require(_0x4fdb('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x4fdb('0x1a'))['db'];config[_0x4fdb('0x1b')]=_[_0x4fdb('0x1c')](config[_0x4fdb('0x1b')],{'host':_0x4fdb('0x1d'),'port':0x18eb});var socket=require(_0x4fdb('0x1e'))(new Redis(config[_0x4fdb('0x1b')]));require(_0x4fdb('0x1f'))[_0x4fdb('0x20')](socket);var jayson=require(_0x4fdb('0x21'));var client=jayson[_0x4fdb('0x22')][_0x4fdb('0x23')]({'port':0x232c});var client9002=jayson['client'][_0x4fdb('0x23')]({'port':0x232a});function respondWithRpcPromise(_0x3094da,_0x3df724,_0x2c35cb,_0x879d8d){return new BPromise(function(_0x5061d9,_0x22a95f){var _0x576991=_0x879d8d||client;return _0x576991[_0x4fdb('0x24')](_0x3094da,_0x2c35cb)[_0x4fdb('0x25')](function(_0x1fcd0c){logger[_0x4fdb('0x26')]('ChatMessage,\x20%s,\x20%s',_0x3df724,_0x4fdb('0x27'));logger[_0x4fdb('0x28')](_0x4fdb('0x29'),_0x3df724,_0x4fdb('0x27'),JSON[_0x4fdb('0x2a')](_0x1fcd0c));if(_0x1fcd0c[_0x4fdb('0x2b')]){if(_0x1fcd0c[_0x4fdb('0x2b')]['code']===0x1f4){logger[_0x4fdb('0x2b')]('ChatMessage,\x20%s,\x20%s',_0x3df724,_0x1fcd0c['error'][_0x4fdb('0x2c')]);return _0x22a95f(_0x1fcd0c['error']['message']);}logger[_0x4fdb('0x2b')]('ChatMessage,\x20%s,\x20%s',_0x3df724,_0x1fcd0c[_0x4fdb('0x2b')]['message']);return _0x5061d9(_0x1fcd0c[_0x4fdb('0x2b')][_0x4fdb('0x2c')]);}else{logger['info']('ChatMessage,\x20%s,\x20%s',_0x3df724,_0x4fdb('0x27'));_0x5061d9(_0x1fcd0c['result'][_0x4fdb('0x2c')]);}})['catch'](function(_0xaf8252){logger[_0x4fdb('0x2b')](_0x4fdb('0x2d'),_0x3df724,_0xaf8252);_0x22a95f(_0xaf8252);});});}function respondWithStatusCode(_0x129201,_0x344a17){_0x344a17=_0x344a17||0xcc;return function(_0x37f881){if(_0x37f881){return _0x129201[_0x4fdb('0x2e')](_0x344a17);}return _0x129201['status'](_0x344a17)[_0x4fdb('0x2f')]();};}function respondWithResult(_0x1f00b8,_0x1dac64){_0x1dac64=_0x1dac64||0xc8;return function(_0x1f31dc){if(_0x1f31dc){return _0x1f00b8['status'](_0x1dac64)[_0x4fdb('0x30')](_0x1f31dc);}};}function respondWithFilteredResult(_0x1943d2,_0x4f106e){return function(_0x471ed2){if(_0x471ed2){var _0x50a285=typeof _0x4f106e[_0x4fdb('0x31')]===_0x4fdb('0x32')&&typeof _0x4f106e['limit']==='undefined';var _0x44fc09=_0x471ed2[_0x4fdb('0x33')];var _0x43f0b6=_0x50a285?0x0:_0x4f106e['offset'];var _0xf192e9=_0x50a285?_0x471ed2[_0x4fdb('0x33')]:_0x4f106e[_0x4fdb('0x31')]+_0x4f106e[_0x4fdb('0x34')];var _0xc035e4;if(_0xf192e9>=_0x44fc09){_0xf192e9=_0x44fc09;_0xc035e4=0xc8;}else{_0xc035e4=0xce;}_0x1943d2[_0x4fdb('0x35')](_0xc035e4);return _0x1943d2[_0x4fdb('0x36')](_0x4fdb('0x37'),_0x43f0b6+'-'+_0xf192e9+'/'+_0x44fc09)[_0x4fdb('0x30')](_0x471ed2);}return null;};}function patchUpdates(_0x4becd7){return function(_0x5d4ba4){try{jsonpatch[_0x4fdb('0x38')](_0x5d4ba4,_0x4becd7,!![]);}catch(_0x557408){return BPromise[_0x4fdb('0x39')](_0x557408);}return _0x5d4ba4[_0x4fdb('0x3a')]();};}function saveUpdates(_0x47f9a1,_0x6095a2){return function(_0x3940e2){if(_0x3940e2){return _0x3940e2[_0x4fdb('0x3b')](_0x47f9a1)[_0x4fdb('0x25')](function(_0x1852ba){return _0x1852ba;});}return null;};}function removeEntity(_0x550924,_0x351da2){return function(_0x187478){if(_0x187478){return _0x187478['destroy']()[_0x4fdb('0x25')](function(){_0x550924[_0x4fdb('0x35')](0xcc)[_0x4fdb('0x2f')]();});}};}function handleEntityNotFound(_0x347846,_0x16d5b0){return function(_0xc59042){if(!_0xc59042){_0x347846[_0x4fdb('0x2e')](0x194);}return _0xc59042;};}function handleError(_0x1d1aee,_0x8d1dd8){_0x8d1dd8=_0x8d1dd8||0x1f4;return function(_0x606e7a){logger[_0x4fdb('0x2b')](_0x606e7a[_0x4fdb('0x3c')]);if(_0x606e7a[_0x4fdb('0x3d')]){delete _0x606e7a['name'];}_0x1d1aee['status'](_0x8d1dd8)[_0x4fdb('0x3e')](_0x606e7a);};}exports[_0x4fdb('0x3f')]=function(_0x45a13d,_0x1db2e9){var _0x392a9c={},_0x117632={},_0x405567={'count':0x0,'rows':[]};var _0x3695dc=_[_0x4fdb('0x40')](db[_0x4fdb('0x41')][_0x4fdb('0x42')],function(_0x46e610){return{'name':_0x46e610['fieldName'],'type':_0x46e610[_0x4fdb('0x43')]['key']};});_0x117632[_0x4fdb('0x44')]=_[_0x4fdb('0x40')](_0x3695dc,_0x4fdb('0x3d'));_0x117632['query']=_['keys'](_0x45a13d[_0x4fdb('0x45')]);_0x117632[_0x4fdb('0x46')]=_[_0x4fdb('0x47')](_0x117632[_0x4fdb('0x44')],_0x117632[_0x4fdb('0x45')]);_0x392a9c[_0x4fdb('0x48')]=_['intersection'](_0x117632[_0x4fdb('0x44')],qs[_0x4fdb('0x49')](_0x45a13d['query'][_0x4fdb('0x49')]));_0x392a9c[_0x4fdb('0x48')]=_0x392a9c[_0x4fdb('0x48')][_0x4fdb('0x4a')]?_0x392a9c[_0x4fdb('0x48')]:_0x117632[_0x4fdb('0x44')];if(!_0x45a13d[_0x4fdb('0x45')][_0x4fdb('0x4b')](_0x4fdb('0x4c'))){_0x392a9c[_0x4fdb('0x34')]=qs[_0x4fdb('0x34')](_0x45a13d[_0x4fdb('0x45')][_0x4fdb('0x34')]);_0x392a9c[_0x4fdb('0x31')]=qs[_0x4fdb('0x31')](_0x45a13d[_0x4fdb('0x45')][_0x4fdb('0x31')]);}_0x392a9c[_0x4fdb('0x4d')]=qs[_0x4fdb('0x4e')](_0x45a13d['query'][_0x4fdb('0x4e')]);_0x392a9c[_0x4fdb('0x4f')]=qs[_0x4fdb('0x46')](_[_0x4fdb('0x50')](_0x45a13d[_0x4fdb('0x45')],_0x117632[_0x4fdb('0x46')]),_0x3695dc);if(_0x45a13d[_0x4fdb('0x45')][_0x4fdb('0x51')]){_0x392a9c[_0x4fdb('0x4f')]=_[_0x4fdb('0x52')](_0x392a9c[_0x4fdb('0x4f')],{'$or':_[_0x4fdb('0x40')](_0x3695dc,function(_0x2e4731){if(_0x2e4731['type']!==_0x4fdb('0x53')){var _0x4630f9={};_0x4630f9[_0x2e4731['name']]={'$like':'%'+_0x45a13d[_0x4fdb('0x45')][_0x4fdb('0x51')]+'%'};return _0x4630f9;}})});}_0x392a9c=_[_0x4fdb('0x52')]({},_0x392a9c,_0x45a13d[_0x4fdb('0x54')]);var _0x5cc9ad={'where':_0x392a9c[_0x4fdb('0x4f')]};return db['ChatMessage'][_0x4fdb('0x33')](_0x5cc9ad)[_0x4fdb('0x25')](function(_0xdae31a){_0x405567['count']=_0xdae31a;if(_0x45a13d[_0x4fdb('0x45')]['includeAll']){_0x392a9c[_0x4fdb('0x55')]=[{'all':!![]}];}return db[_0x4fdb('0x41')][_0x4fdb('0x56')](_0x392a9c);})[_0x4fdb('0x25')](function(_0x3f21eb){_0x405567[_0x4fdb('0x57')]=_0x3f21eb;return _0x405567;})['then'](respondWithFilteredResult(_0x1db2e9,_0x392a9c))['catch'](handleError(_0x1db2e9,null));};exports[_0x4fdb('0x58')]=function(_0x49cf3d,_0x2f0061){var _0xc3f155={'raw':!![],'where':{'id':_0x49cf3d[_0x4fdb('0x59')]['id']}},_0x1be582={};_0x1be582[_0x4fdb('0x44')]=_[_0x4fdb('0x5a')](db[_0x4fdb('0x41')][_0x4fdb('0x42')]);_0x1be582[_0x4fdb('0x45')]=_[_0x4fdb('0x5a')](_0x49cf3d[_0x4fdb('0x45')]);_0x1be582[_0x4fdb('0x46')]=_[_0x4fdb('0x47')](_0x1be582[_0x4fdb('0x44')],_0x1be582[_0x4fdb('0x45')]);_0xc3f155['attributes']=_[_0x4fdb('0x47')](_0x1be582['model'],qs[_0x4fdb('0x49')](_0x49cf3d[_0x4fdb('0x45')][_0x4fdb('0x49')]));_0xc3f155[_0x4fdb('0x48')]=_0xc3f155['attributes']['length']?_0xc3f155[_0x4fdb('0x48')]:_0x1be582[_0x4fdb('0x44')];if(_0x49cf3d[_0x4fdb('0x45')][_0x4fdb('0x5b')]){_0xc3f155['include']=[{'all':!![]}];}_0xc3f155=_[_0x4fdb('0x52')]({},_0xc3f155,_0x49cf3d[_0x4fdb('0x54')]);return db[_0x4fdb('0x41')]['find'](_0xc3f155)['then'](handleEntityNotFound(_0x2f0061,null))[_0x4fdb('0x25')](respondWithResult(_0x2f0061,null))[_0x4fdb('0x5c')](handleError(_0x2f0061,null));};exports[_0x4fdb('0x5d')]=function(_0x5b783f,_0x21088e){return db[_0x4fdb('0x41')][_0x4fdb('0x5d')](_0x5b783f[_0x4fdb('0x5e')],{})[_0x4fdb('0x25')](respondWithResult(_0x21088e,0xc9))['catch'](handleError(_0x21088e,null));};exports[_0x4fdb('0x3b')]=function(_0x5ee5cc,_0x1d0dce){if(_0x5ee5cc[_0x4fdb('0x5e')]['id']){delete _0x5ee5cc[_0x4fdb('0x5e')]['id'];}return db[_0x4fdb('0x41')][_0x4fdb('0x5f')]({'where':{'id':_0x5ee5cc['params']['id']}})[_0x4fdb('0x25')](handleEntityNotFound(_0x1d0dce,null))[_0x4fdb('0x25')](saveUpdates(_0x5ee5cc[_0x4fdb('0x5e')],null))[_0x4fdb('0x25')](respondWithResult(_0x1d0dce,null))['catch'](handleError(_0x1d0dce,null));};exports[_0x4fdb('0x60')]=function(_0x4b8a31,_0x51ab16){return db[_0x4fdb('0x41')][_0x4fdb('0x5f')]({'where':{'id':_0x4b8a31['params']['id']}})[_0x4fdb('0x25')](handleEntityNotFound(_0x51ab16,null))['then'](removeEntity(_0x51ab16,null))[_0x4fdb('0x5c')](handleError(_0x51ab16,null));};exports[_0x4fdb('0x61')]=function(_0xf5e66,_0x1d21ba){return db[_0x4fdb('0x41')][_0x4fdb('0x61')]()[_0x4fdb('0x25')](respondWithResult(_0x1d21ba,null))[_0x4fdb('0x5c')](handleError(_0x1d21ba,null));};var interaction_log=require(_0x4fdb('0x17'))('chat-interactions');exports[_0x4fdb('0x62')]=function(_0x2b95cf,_0xa89b8c,_0x11be65){var _0x5bb2e6={'agent':{},'channel':'chat'};if(_0x2b95cf[_0x4fdb('0x5e')]['id']){delete _0x2b95cf[_0x4fdb('0x5e')]['id'];}_0x2b95cf[_0x4fdb('0x5e')][_0x4fdb('0x63')]=!![];_0x2b95cf[_0x4fdb('0x5e')][_0x4fdb('0x64')]=moment()[_0x4fdb('0x65')](_0x4fdb('0x66'));_0x2b95cf['body'][_0x4fdb('0x67')]=_0x2b95cf[_0x4fdb('0x5e')]['UserId']||_0x2b95cf[_0x4fdb('0x68')]['id'];_0x5bb2e6[_0x4fdb('0x69')]['id']=_0x2b95cf[_0x4fdb('0x5e')][_0x4fdb('0x67')];return db[_0x4fdb('0x41')][_0x4fdb('0x5f')]({'where':{'id':_0x2b95cf[_0x4fdb('0x59')]['id'],'UserId':null}})[_0x4fdb('0x25')](handleEntityNotFound(_0xa89b8c,null))['then'](saveUpdates(_0x2b95cf['body'],null))[_0x4fdb('0x25')](function(_0x352923){if(_0x352923){_0x5bb2e6['message']=_0x352923[_0x4fdb('0x6a')]({'plain':!![]});return db[_0x4fdb('0x6b')]['find']({'where':{'id':_0x352923[_0x4fdb('0x6c')]}});}return null;})[_0x4fdb('0x25')](handleEntityNotFound(_0xa89b8c,null))[_0x4fdb('0x25')](function(_0x65be3){if(_0x65be3){return _0x65be3[_0x4fdb('0x3b')]({'UserId':_0x2b95cf[_0x4fdb('0x5e')][_0x4fdb('0x67')],'read1stAt':_[_0x4fdb('0x6d')](_0x65be3[_0x4fdb('0x6e')])?moment()[_0x4fdb('0x65')](_0x4fdb('0x66')):undefined});}return null;})[_0x4fdb('0x25')](function(_0x46f2f2){if(_0x46f2f2){_0x5bb2e6[_0x4fdb('0x6f')]=_0x46f2f2['get']({'plain':!![]});interaction_log[_0x4fdb('0x26')]('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2b95cf['user']['id'],_0x2b95cf['user'][_0x4fdb('0x3d')],_0x2b95cf[_0x4fdb('0x68')]['role'],_0x5bb2e6[_0x4fdb('0x6f')]['id'],_0x2b95cf[_0x4fdb('0x5e')]?JSON[_0x4fdb('0x2a')](_0x2b95cf['body']):'null');return respondWithRpcPromise(_0x4fdb('0x70'),_0x4fdb('0x71'),_0x5bb2e6);}return null;})['then'](function(_0x4b6c2c){var _0x52506c='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4b6c2c[_0x4fdb('0x2c')][_0x4fdb('0x72')];return db[_0x4fdb('0x73')][_0x4fdb('0x45')](_0x52506c,{'type':db[_0x4fdb('0x74')][_0x4fdb('0x75')][_0x4fdb('0x76')],'raw':!![]})[_0x4fdb('0x25')](function(_0x510a9b){return _0x510a9b;});})[_0x4fdb('0x25')](function(_0x7ed6e4){if(_0x7ed6e4){_0x5bb2e6['message'][_0x4fdb('0x77')]=_0x7ed6e4[0x0];if(!_0x2b95cf['body'][_0x4fdb('0x67')])return;return db[_0x4fdb('0x78')]['find']({'where':{'id':_0x2b95cf['body'][_0x4fdb('0x67')],'role':_0x4fdb('0x69')},'attributes':['id',_0x4fdb('0x3d'),_0x4fdb('0x79'),_0x4fdb('0x7a'),_0x4fdb('0x7b')],'raw':!![]});}return null;})[_0x4fdb('0x25')](function(_0x547fa){if(!_0x547fa)return null;_0x5bb2e6[_0x4fdb('0x2c')][_0x4fdb('0x69')]=_0x547fa;return _0x5bb2e6;})[_0x4fdb('0x25')](function(_0x3b83c6){if(_0x3b83c6){if(_0x2b95cf[_0x4fdb('0x5e')][_0x4fdb('0x7c')]){_0x5bb2e6[_0x4fdb('0x2c')][_0x4fdb('0x7d')]=util[_0x4fdb('0x65')](_0x4fdb('0x7e'),_0x2b95cf[_0x4fdb('0x68')][_0x4fdb('0x3d')]);_0x5bb2e6[_0x4fdb('0x2c')][_0x4fdb('0x7f')]=_0x5bb2e6['channel'];_0x5bb2e6[_0x4fdb('0x2c')][_0x4fdb('0x80')]=_0x5bb2e6[_0x4fdb('0x7f')];_0x5bb2e6[_0x4fdb('0x2c')]['event']=_0x4fdb('0x62');return respondWithRpcPromise(_0x4fdb('0x81'),_0x4fdb('0x81'),{'event':_0x4fdb('0x82'),'message':_[_0x4fdb('0x52')](_0x5bb2e6['message'],JSON['parse'](_0x5bb2e6[_0x4fdb('0x6f')]['formData']))},client9002)[_0x4fdb('0x25')](function(){return _0x5bb2e6;});}return _0x5bb2e6;}return null;})[_0x4fdb('0x25')](respondWithResult(_0xa89b8c,null))[_0x4fdb('0x5c')](handleError(_0xa89b8c,null));};var interaction_log=require(_0x4fdb('0x17'))(_0x4fdb('0x83'));exports[_0x4fdb('0x39')]=function(_0x14884b,_0x1ebaf0,_0x2935a7){var _0x50a62a={'agent':{},'channel':'chat'};if(_0x14884b[_0x4fdb('0x5e')]['id']){delete _0x14884b[_0x4fdb('0x5e')]['id'];}_0x14884b[_0x4fdb('0x5e')]['UserId']=_0x14884b[_0x4fdb('0x5e')][_0x4fdb('0x67')]||_0x14884b['user']['id'];_0x50a62a[_0x4fdb('0x69')]['id']=_0x14884b[_0x4fdb('0x5e')][_0x4fdb('0x67')];return db['ChatMessage'][_0x4fdb('0x5f')]({'where':{'id':_0x14884b[_0x4fdb('0x59')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x1ebaf0,null))[_0x4fdb('0x25')](function(_0x576afe){if(_0x576afe){_0x50a62a['message']=_0x576afe[_0x4fdb('0x6a')]({'plain':!![]});return db[_0x4fdb('0x6b')][_0x4fdb('0x5f')]({'where':{'id':_0x576afe[_0x4fdb('0x6c')]}});}return null;})[_0x4fdb('0x25')](handleEntityNotFound(_0x1ebaf0,null))['then'](function(_0x5e021d){if(_0x5e021d){_0x50a62a[_0x4fdb('0x6f')]=_0x5e021d[_0x4fdb('0x6a')]({'plain':!![]});interaction_log[_0x4fdb('0x26')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x14884b[_0x4fdb('0x68')]['id'],_0x14884b[_0x4fdb('0x68')][_0x4fdb('0x3d')],_0x14884b[_0x4fdb('0x68')][_0x4fdb('0x84')],_0x50a62a['interaction']['id'],_0x14884b[_0x4fdb('0x5e')]?JSON['stringify'](_0x14884b[_0x4fdb('0x5e')]):_0x4fdb('0x85'));return respondWithRpcPromise('RejectMessage',_0x4fdb('0x86'),_0x50a62a);}return null;})[_0x4fdb('0x25')](function(_0x58856d){var _0x4e3946=_0x4fdb('0x87')+_0x58856d[_0x4fdb('0x2c')][_0x4fdb('0x72')];return db[_0x4fdb('0x73')]['query'](_0x4e3946,{'type':db[_0x4fdb('0x74')][_0x4fdb('0x75')][_0x4fdb('0x76')],'raw':!![]})[_0x4fdb('0x25')](function(_0x1f43d5){return _0x1f43d5;});})[_0x4fdb('0x25')](function(_0x53ece0){if(_0x53ece0){_0x50a62a['message'][_0x4fdb('0x77')]=_0x53ece0[0x0];if(!_0x14884b[_0x4fdb('0x5e')][_0x4fdb('0x67')])return;return db[_0x4fdb('0x78')][_0x4fdb('0x5f')]({'where':{'id':_0x14884b[_0x4fdb('0x5e')]['UserId'],'role':'agent'},'attributes':['id',_0x4fdb('0x3d'),_0x4fdb('0x79'),'email',_0x4fdb('0x7b')],'raw':!![]});}return null;})[_0x4fdb('0x25')](function(_0x458a59){if(!_0x458a59)return null;_0x50a62a[_0x4fdb('0x2c')]['agent']=_0x458a59;return _0x50a62a;})[_0x4fdb('0x25')](function(_0x38cf0d){if(_0x38cf0d){_0x38cf0d['message'][_0x4fdb('0x7d')]=util[_0x4fdb('0x65')](_0x4fdb('0x7e'),_0x14884b[_0x4fdb('0x68')][_0x4fdb('0x3d')]);_0x38cf0d['message'][_0x4fdb('0x7f')]=_0x50a62a[_0x4fdb('0x7f')];_0x38cf0d[_0x4fdb('0x2c')][_0x4fdb('0x80')]=_0x50a62a[_0x4fdb('0x7f')];_0x38cf0d['message'][_0x4fdb('0x88')]='reject';respondWithRpcPromise(_0x4fdb('0x81'),_0x4fdb('0x81'),{'event':_0x4fdb('0x89'),'message':_[_0x4fdb('0x52')](_0x50a62a[_0x4fdb('0x2c')],JSON[_0x4fdb('0x8a')](_0x50a62a['interaction'][_0x4fdb('0x8b')]))},client9002);return _0x50a62a;}return null;})[_0x4fdb('0x25')](respondWithResult(_0x1ebaf0,null))[_0x4fdb('0x5c')](handleError(_0x1ebaf0,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index 0997b4e..56ccb51 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 _0x780b=['hasOwnProperty','hook','exports','events','../../mysqldb','ChatMessage','setMaxListeners','save','update','emit'];(function(_0xd5307f,_0x4d1fe9){var _0x39d3d4=function(_0x40c4e1){while(--_0x40c4e1){_0xd5307f['push'](_0xd5307f['shift']());}};_0x39d3d4(++_0x4d1fe9);}(_0x780b,0xa3));var _0xb780=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0x780b[_0x297fd3];return _0x2af381;};'use strict';var EventEmitter=require(_0xb780('0x0'));var ChatMessage=require(_0xb780('0x1'))['db'][_0xb780('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xb780('0x3')](0x0);var events={'afterCreate':_0xb780('0x4'),'afterUpdate':_0xb780('0x5'),'afterDestroy':'remove'};function emitEvent(_0x25a884){return function(_0x15e882,_0x412b4d,_0x418bc1){ChatMessageEvents[_0xb780('0x6')](_0x25a884+':'+_0x15e882['id'],_0x15e882);ChatMessageEvents[_0xb780('0x6')](_0x25a884,_0x15e882);_0x418bc1(null);};}for(var e in events){if(events[_0xb780('0x7')](e)){var event=events[e];ChatMessage[_0xb780('0x8')](e,emitEvent(event));}}module[_0xb780('0x9')]=ChatMessageEvents; \ No newline at end of file +var _0x5382=['ChatMessage','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x26ee9a,_0x1917d7){var _0x1e8a0f=function(_0x472cbf){while(--_0x472cbf){_0x26ee9a['push'](_0x26ee9a['shift']());}};_0x1e8a0f(++_0x1917d7);}(_0x5382,0x76));var _0x2538=function(_0x5adf7a,_0x3cc807){_0x5adf7a=_0x5adf7a-0x0;var _0x32b5be=_0x5382[_0x5adf7a];return _0x32b5be;};'use strict';var EventEmitter=require(_0x2538('0x0'));var ChatMessage=require(_0x2538('0x1'))['db'][_0x2538('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x2538('0x3')](0x0);var events={'afterCreate':_0x2538('0x4'),'afterUpdate':_0x2538('0x5'),'afterDestroy':'remove'};function emitEvent(_0x549e80){return function(_0x42bbb0,_0x124140,_0x57745b){ChatMessageEvents[_0x2538('0x6')](_0x549e80+':'+_0x42bbb0['id'],_0x42bbb0);ChatMessageEvents[_0x2538('0x6')](_0x549e80,_0x42bbb0);_0x57745b(null);};}for(var e in events){if(events[_0x2538('0x7')](e)){var event=events[e];ChatMessage[_0x2538('0x8')](e,emitEvent(event));}}module[_0x2538('0x9')]=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index 42da59c..6831076 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 _0x8f1d=['define','ChatMessage','chat_messages','fti_chat_messages','body','models','get','direction','out','secret','UserId','ChatInteraction','findOne','ChatInteractionId','then','update','createdAt','toLowerCase','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./chatMessage.attributes','exports'];(function(_0x876194,_0x2d77c2){var _0x5dd914=function(_0x681caa){while(--_0x681caa){_0x876194['push'](_0x876194['shift']());}};_0x5dd914(++_0x2d77c2);}(_0x8f1d,0x72));var _0xd8f1=function(_0x477491,_0x5ca700){_0x477491=_0x477491-0x0;var _0xac6aec=_0x8f1d[_0x477491];return _0xac6aec;};'use strict';var _=require(_0xd8f1('0x0'));var util=require(_0xd8f1('0x1'));var logger=require('../../config/logger')(_0xd8f1('0x2'));var moment=require(_0xd8f1('0x3'));var BPromise=require(_0xd8f1('0x4'));var rp=require(_0xd8f1('0x5'));var fs=require('fs');var path=require(_0xd8f1('0x6'));var rimraf=require('rimraf');var config=require(_0xd8f1('0x7'));var attributes=require(_0xd8f1('0x8'));module[_0xd8f1('0x9')]=function(_0x103610,_0x5ef96f){return _0x103610[_0xd8f1('0xa')](_0xd8f1('0xb'),attributes,{'tableName':_0xd8f1('0xc'),'paranoid':![],'indexes':[{'name':_0xd8f1('0xd'),'fields':[_0xd8f1('0xe')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x29db48,_0x2e88e9,_0x2c423e){var _0xfa16f5=_0x103610[_0xd8f1('0xf')];var _0x53c6b6=_0x29db48[_0xd8f1('0x10')]({'plain':!![]});if(_0x53c6b6[_0xd8f1('0x11')]['toLowerCase']()==='in'||_0x53c6b6[_0xd8f1('0x11')]['toLowerCase']()===_0xd8f1('0x12')&&!_0x53c6b6[_0xd8f1('0x13')]&&!_['isNil'](_0x53c6b6[_0xd8f1('0x14')])){_0xfa16f5[_0xd8f1('0x15')][_0xd8f1('0x16')]({'where':{'id':_0x53c6b6[_0xd8f1('0x17')]}})[_0xd8f1('0x18')](function(_0x269e57){if(_0x269e57){_0x269e57[_0xd8f1('0x19')]({'lastMsgAt':_0x53c6b6[_0xd8f1('0x1a')],'lastMsgDirection':_0x53c6b6['direction'][_0xd8f1('0x1b')]()});}})[_0xd8f1('0x1c')](function(_0xc6828c){console['error'](_0xc6828c);});}_0x2c423e();}},'charset':_0xd8f1('0x1d'),'collate':_0xd8f1('0x1e')});}; \ No newline at end of file +var _0x765e=['secret','isNil','UserId','ChatInteraction','findOne','ChatInteractionId','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','chat_messages','fti_chat_messages','body','FULLTEXT','direction','toLowerCase','out'];(function(_0x152341,_0x8f0c56){var _0x440e1b=function(_0x33918f){while(--_0x33918f){_0x152341['push'](_0x152341['shift']());}};_0x440e1b(++_0x8f0c56);}(_0x765e,0x1bf));var _0xe765=function(_0x3ef029,_0x302589){_0x3ef029=_0x3ef029-0x0;var _0x1147b8=_0x765e[_0x3ef029];return _0x1147b8;};'use strict';var _=require(_0xe765('0x0'));var util=require(_0xe765('0x1'));var logger=require(_0xe765('0x2'))(_0xe765('0x3'));var moment=require(_0xe765('0x4'));var BPromise=require(_0xe765('0x5'));var rp=require(_0xe765('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe765('0x7'));var config=require(_0xe765('0x8'));var attributes=require('./chatMessage.attributes');module[_0xe765('0x9')]=function(_0x1ae7a2,_0x3ff2f5){return _0x1ae7a2[_0xe765('0xa')]('ChatMessage',attributes,{'tableName':_0xe765('0xb'),'paranoid':![],'indexes':[{'name':_0xe765('0xc'),'fields':[_0xe765('0xd')],'type':_0xe765('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4459ab,_0x224b0f,_0x540379){var _0x59f097=_0x1ae7a2['models'];var _0x11fb96=_0x4459ab['get']({'plain':!![]});if(_0x11fb96[_0xe765('0xf')][_0xe765('0x10')]()==='in'||_0x11fb96[_0xe765('0xf')][_0xe765('0x10')]()===_0xe765('0x11')&&!_0x11fb96[_0xe765('0x12')]&&!_[_0xe765('0x13')](_0x11fb96[_0xe765('0x14')])){_0x59f097[_0xe765('0x15')][_0xe765('0x16')]({'where':{'id':_0x11fb96[_0xe765('0x17')]}})[_0xe765('0x18')](function(_0x235270){if(_0x235270){_0x235270[_0xe765('0x19')]({'lastMsgAt':_0x11fb96[_0xe765('0x1a')],'lastMsgDirection':_0x11fb96['direction'][_0xe765('0x10')]()});}})[_0xe765('0x1b')](function(_0x1cd5dc){console[_0xe765('0x1c')](_0x1cd5dc);});}_0x540379();}},'charset':_0xe765('0x1d'),'collate':_0xe765('0x1e')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index 6dc1aec..a3cf292 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 _0x9834=['ChatMessage,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateChatMessage','create','body','options','debug','lodash','util','moment','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client','http','redis','socket.io-emitter','register','request','then'];(function(_0xe72e2a,_0x3d600f){var _0x1ee37e=function(_0x27c473){while(--_0x27c473){_0xe72e2a['push'](_0xe72e2a['shift']());}};_0x1ee37e(++_0x3d600f);}(_0x9834,0xd1));var _0x4983=function(_0xe057df,_0x49c828){_0xe057df=_0xe057df-0x0;var _0x518ae4=_0x9834[_0xe057df];return _0x518ae4;};'use strict';var _=require(_0x4983('0x0'));var util=require(_0x4983('0x1'));var moment=require(_0x4983('0x2'));var BPromise=require('bluebird');var rs=require(_0x4983('0x3'));var fs=require('fs');var Redis=require(_0x4983('0x4'));var db=require(_0x4983('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x4983('0x6'));var config=require('../../config/environment');var jayson=require(_0x4983('0x7'));var client=jayson[_0x4983('0x8')][_0x4983('0x9')]({'port':0x232a});config['redis']=_['defaults'](config[_0x4983('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x4983('0xb'))(new Redis(config['redis']));require('./chatMessage.socket')[_0x4983('0xc')](socket);function respondWithRpcPromise(_0x1f1adf,_0x215037,_0x2b379a){return new BPromise(function(_0xbcb969,_0x2ad925){return client[_0x4983('0xd')](_0x1f1adf,_0x2b379a)[_0x4983('0xe')](function(_0x507ea2){logger['info'](_0x4983('0xf'),_0x215037,'request\x20sent');logger['debug']('ChatMessage,\x20%s,\x20%s,\x20%s',_0x215037,'request\x20sent',JSON[_0x4983('0x10')](_0x507ea2));if(_0x507ea2[_0x4983('0x11')]){if(_0x507ea2[_0x4983('0x11')][_0x4983('0x12')]===0x1f4){logger[_0x4983('0x11')]('ChatMessage,\x20%s,\x20%s',_0x215037,_0x507ea2['error'][_0x4983('0x13')]);return _0x2ad925(_0x507ea2[_0x4983('0x11')][_0x4983('0x13')]);}logger[_0x4983('0x11')](_0x4983('0xf'),_0x215037,_0x507ea2[_0x4983('0x11')][_0x4983('0x13')]);return _0xbcb969(_0x507ea2[_0x4983('0x11')][_0x4983('0x13')]);}else{logger[_0x4983('0x14')](_0x4983('0xf'),_0x215037,'request\x20sent');_0xbcb969(_0x507ea2[_0x4983('0x15')]['message']);}})[_0x4983('0x16')](function(_0x498d7c){logger['error']('ChatMessage,\x20%s,\x20%s',_0x215037,_0x498d7c);_0x2ad925(_0x498d7c);});});}exports[_0x4983('0x17')]=function(_0x5e6f12){var _0x55aff3=this;return new Promise(function(_0x4f3195,_0x129edc){return db['ChatMessage'][_0x4983('0x18')](_0x5e6f12[_0x4983('0x19')],{'raw':_0x5e6f12[_0x4983('0x1a')]?_0x5e6f12[_0x4983('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x4983('0xe')](function(_0xd27719){logger[_0x4983('0x14')](_0x4983('0x17'),_0x5e6f12);logger[_0x4983('0x1b')](_0x4983('0x17'),_0x5e6f12,JSON[_0x4983('0x10')](_0xd27719));_0x4f3195(_0xd27719);})['catch'](function(_0x3e8ba7){logger[_0x4983('0x11')]('CreateChatMessage',_0x3e8ba7[_0x4983('0x13')],_0x5e6f12);_0x129edc(_0x55aff3['error'](0x1f4,_0x3e8ba7[_0x4983('0x13')]));});});}; \ No newline at end of file +var _0x442e=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./chatMessage.socket','request','then','info','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','CreateChatMessage','create','body','options','raw','util','bluebird','randomstring'];(function(_0x605d3,_0x3dcd80){var _0xbf0f70=function(_0x305c63){while(--_0x305c63){_0x605d3['push'](_0x605d3['shift']());}};_0xbf0f70(++_0x3dcd80);}(_0x442e,0x133));var _0xe442=function(_0x568f9f,_0x209067){_0x568f9f=_0x568f9f-0x0;var _0x46d6f9=_0x442e[_0x568f9f];return _0x46d6f9;};'use strict';var _=require('lodash');var util=require(_0xe442('0x0'));var moment=require('moment');var BPromise=require(_0xe442('0x1'));var rs=require(_0xe442('0x2'));var fs=require('fs');var Redis=require(_0xe442('0x3'));var db=require(_0xe442('0x4'))['db'];var utils=require(_0xe442('0x5'));var logger=require(_0xe442('0x6'))('rpc');var config=require(_0xe442('0x7'));var jayson=require(_0xe442('0x8'));var client=jayson[_0xe442('0x9')][_0xe442('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0xe442('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xe442('0xc'))(new Redis(config['redis']));require(_0xe442('0xd'))['register'](socket);function respondWithRpcPromise(_0x1ac8a8,_0x2f9b2a,_0x34839e){return new BPromise(function(_0x48dd4e,_0x4a221e){return client[_0xe442('0xe')](_0x1ac8a8,_0x34839e)[_0xe442('0xf')](function(_0x9b83aa){logger[_0xe442('0x10')](_0xe442('0x11'),_0x2f9b2a,'request\x20sent');logger[_0xe442('0x12')](_0xe442('0x13'),_0x2f9b2a,_0xe442('0x14'),JSON[_0xe442('0x15')](_0x9b83aa));if(_0x9b83aa[_0xe442('0x16')]){if(_0x9b83aa[_0xe442('0x16')]['code']===0x1f4){logger[_0xe442('0x16')](_0xe442('0x11'),_0x2f9b2a,_0x9b83aa[_0xe442('0x16')][_0xe442('0x17')]);return _0x4a221e(_0x9b83aa[_0xe442('0x16')]['message']);}logger['error'](_0xe442('0x11'),_0x2f9b2a,_0x9b83aa['error'][_0xe442('0x17')]);return _0x48dd4e(_0x9b83aa[_0xe442('0x16')][_0xe442('0x17')]);}else{logger['info'](_0xe442('0x11'),_0x2f9b2a,_0xe442('0x14'));_0x48dd4e(_0x9b83aa[_0xe442('0x18')][_0xe442('0x17')]);}})[_0xe442('0x19')](function(_0x5c0112){logger[_0xe442('0x16')](_0xe442('0x11'),_0x2f9b2a,_0x5c0112);_0x4a221e(_0x5c0112);});});}exports[_0xe442('0x1a')]=function(_0x48b03c){var _0x3ec087=this;return new Promise(function(_0x7e1037,_0x21557f){return db['ChatMessage'][_0xe442('0x1b')](_0x48b03c[_0xe442('0x1c')],{'raw':_0x48b03c['options']?_0x48b03c[_0xe442('0x1d')][_0xe442('0x1e')]===undefined?!![]:![]:!![]})[_0xe442('0xf')](function(_0x1adcc5){logger[_0xe442('0x10')](_0xe442('0x1a'),_0x48b03c);logger[_0xe442('0x12')](_0xe442('0x1a'),_0x48b03c,JSON[_0xe442('0x15')](_0x1adcc5));_0x7e1037(_0x1adcc5);})[_0xe442('0x19')](function(_0x44aa65){logger[_0xe442('0x16')]('CreateChatMessage',_0x44aa65[_0xe442('0x17')],_0x48b03c);_0x21557f(_0x3ec087[_0xe442('0x16')](0x1f4,_0x44aa65['message']));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index 4b2aa78..6ac7c46 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 _0x6c32=['remove','update','emit','removeListener','register','chatMessage:','./chatMessage.events','save'];(function(_0x257642,_0x270a80){var _0x3d813b=function(_0x2a1c8a){while(--_0x2a1c8a){_0x257642['push'](_0x257642['shift']());}};_0x3d813b(++_0x270a80);}(_0x6c32,0x6e));var _0x26c3=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6c32[_0x20a584];return _0x4b41a8;};'use strict';var ChatMessageEvents=require(_0x26c3('0x0'));var events=[_0x26c3('0x1'),_0x26c3('0x2'),_0x26c3('0x3')];function createListener(_0x2bbfc4,_0x44fc8c){return function(_0x40cb8e){_0x44fc8c[_0x26c3('0x4')](_0x2bbfc4,_0x40cb8e);};}function removeListener(_0x36528a,_0x49d4a1){return function(){ChatMessageEvents[_0x26c3('0x5')](_0x36528a,_0x49d4a1);};}exports[_0x26c3('0x6')]=function(_0x15ac36){for(var _0x57d915=0x0,_0x187b81=events['length'];_0x57d915<_0x187b81;_0x57d915++){var _0x3dde22=events[_0x57d915];var _0x3ff8e7=createListener(_0x26c3('0x7')+_0x3dde22,_0x15ac36);ChatMessageEvents['on'](_0x3dde22,_0x3ff8e7);}}; \ No newline at end of file +var _0xf0ba=['update','emit','register','length','chatMessage:','./chatMessage.events','save','remove'];(function(_0x555fef,_0x538c8e){var _0x352754=function(_0xbcd509){while(--_0xbcd509){_0x555fef['push'](_0x555fef['shift']());}};_0x352754(++_0x538c8e);}(_0xf0ba,0x1ed));var _0xaf0b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf0ba[_0x14add3];return _0x4a174f;};'use strict';var ChatMessageEvents=require(_0xaf0b('0x0'));var events=[_0xaf0b('0x1'),_0xaf0b('0x2'),_0xaf0b('0x3')];function createListener(_0xea88b2,_0x555620){return function(_0x277920){_0x555620[_0xaf0b('0x4')](_0xea88b2,_0x277920);};}function removeListener(_0x4cffa5,_0xcd565f){return function(){ChatMessageEvents['removeListener'](_0x4cffa5,_0xcd565f);};}exports[_0xaf0b('0x5')]=function(_0x4b3b85){for(var _0x4d1479=0x0,_0x53b32d=events[_0xaf0b('0x6')];_0x4d1479<_0x53b32d;_0x4d1479++){var _0x17b6d5=events[_0x4d1479];var _0x3439d5=createListener(_0xaf0b('0x7')+_0x17b6d5,_0x4b3b85);ChatMessageEvents['on'](_0x17b6d5,_0x3439d5);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index 29f35ab..d27e4bf 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 _0x835e=['../../config/environment','./chatMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','tracked','chat','chatmessage:create','create','put','/:id/accept','reject','destroy','multer','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x2adb42,_0xed8b12){var _0x101363=function(_0x1a9d3d){while(--_0x1a9d3d){_0x2adb42['push'](_0x2adb42['shift']());}};_0x101363(++_0xed8b12);}(_0x835e,0xb3));var _0xe835=function(_0x143a9e,_0x561a1a){_0x143a9e=_0x143a9e-0x0;var _0x46b750=_0x835e[_0x143a9e];return _0x46b750;};'use strict';var multer=require(_0xe835('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xe835('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xe835('0x2'));var auth=require(_0xe835('0x3'));var interaction=require(_0xe835('0x4'));var config=require(_0xe835('0x5'));var controller=require(_0xe835('0x6'));router[_0xe835('0x7')]('/',auth[_0xe835('0x8')](),controller[_0xe835('0x9')]);router[_0xe835('0x7')](_0xe835('0xa'),auth[_0xe835('0x8')](),controller[_0xe835('0xb')]);router['get'](_0xe835('0xc'),auth['isAuthenticated'](),controller[_0xe835('0xd')]);router[_0xe835('0xe')]('/',auth[_0xe835('0x8')](),interaction[_0xe835('0xf')](_0xe835('0x10'),_0xe835('0x11')),controller[_0xe835('0x12')]);router[_0xe835('0x13')](_0xe835('0xc'),controller['update']);router['put'](_0xe835('0x14'),auth[_0xe835('0x8')](),controller['accept']);router[_0xe835('0x13')]('/:id/reject',auth[_0xe835('0x8')](),controller[_0xe835('0x15')]);router['delete']('/:id',auth[_0xe835('0x8')](),controller[_0xe835('0x16')]);module['exports']=router; \ No newline at end of file +var _0x3aec=['reject','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','/describe','describe','show','tracked','chat','chatmessage:create','update','put','/:id/accept','accept','/:id/reject'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3aec,0x1b3));var _0xc3ae=function(_0x2e3107,_0x25f970){_0x2e3107=_0x2e3107-0x0;var _0x833d69=_0x3aec[_0x2e3107];return _0x833d69;};'use strict';var multer=require(_0xc3ae('0x0'));var util=require(_0xc3ae('0x1'));var path=require(_0xc3ae('0x2'));var timeout=require(_0xc3ae('0x3'));var express=require(_0xc3ae('0x4'));var router=express[_0xc3ae('0x5')]();var fs_extra=require(_0xc3ae('0x6'));var auth=require(_0xc3ae('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xc3ae('0x8'));var controller=require(_0xc3ae('0x9'));router[_0xc3ae('0xa')]('/',auth[_0xc3ae('0xb')](),controller[_0xc3ae('0xc')]);router['get'](_0xc3ae('0xd'),auth[_0xc3ae('0xb')](),controller[_0xc3ae('0xe')]);router[_0xc3ae('0xa')]('/:id',auth[_0xc3ae('0xb')](),controller[_0xc3ae('0xf')]);router['post']('/',auth[_0xc3ae('0xb')](),interaction[_0xc3ae('0x10')](_0xc3ae('0x11'),_0xc3ae('0x12')),controller['create']);router['put']('/:id',controller[_0xc3ae('0x13')]);router[_0xc3ae('0x14')](_0xc3ae('0x15'),auth[_0xc3ae('0xb')](),controller[_0xc3ae('0x16')]);router[_0xc3ae('0x14')](_0xc3ae('0x17'),auth[_0xc3ae('0xb')](),controller[_0xc3ae('0x18')]);router['delete']('/:id',auth[_0xc3ae('0xb')](),controller[_0xc3ae('0x19')]);module[_0xc3ae('0x1a')]=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index a43820e..16f5a84 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 _0xadb5=['medium','TEXT','exports'];(function(_0x5a90cd,_0x140d12){var _0x50d5ad=function(_0x10d94f){while(--_0x10d94f){_0x5a90cd['push'](_0x5a90cd['shift']());}};_0x50d5ad(++_0x140d12);}(_0xadb5,0xad));var _0x5adb=function(_0x31ff15,_0x59c221){_0x31ff15=_0x31ff15-0x0;var _0x49927a=_0xadb5[_0x31ff15];return _0x49927a;};'use strict';var Sequelize=require('sequelize');module[_0x5adb('0x0')]={'body':{'type':Sequelize['TEXT'](_0x5adb('0x1')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x5adb('0x2')](_0x5adb('0x1')),'allowNull':![]}}; \ No newline at end of file +var _0x757a=['exports','TEXT'];(function(_0x13b02f,_0x462a53){var _0x12e9a6=function(_0x187d57){while(--_0x187d57){_0x13b02f['push'](_0x13b02f['shift']());}};_0x12e9a6(++_0x462a53);}(_0x757a,0xde));var _0xa757=function(_0x51b98b,_0x3b9b68){_0x51b98b=_0x51b98b-0x0;var _0x569c22=_0x757a[_0x51b98b];return _0x569c22;};'use strict';var Sequelize=require('sequelize');module[_0xa757('0x0')]={'body':{'type':Sequelize[_0xa757('0x1')]('medium'),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT']('medium'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index 329a36d..ecbfe54 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x6dc537,_0x4fb967){var _0x5ede93=function(_0x24ecf9){while(--_0x24ecf9){_0x6dc537['push'](_0x6dc537['shift']());}};_0x5ede93(++_0x4fb967);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));}; \ No newline at end of file +var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x92c450,_0x41f1e3){var _0x2a9599=function(_0x4f27df){while(--_0x4f27df){_0x92c450['push'](_0x92c450['shift']());}};_0x2a9599(++_0x41f1e3);}(_0x7a54,0x106));var _0x47a5=function(_0x595835,_0x243d02){_0x595835=_0x595835-0x0;var _0x38a203=_0x7a54[_0x595835];return _0x38a203;};'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 ff2ad44..a5f1f6c 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 _0xa0f4=['hasOwnProperty','../../mysqldb','update','remove','emit'];(function(_0x349a3d,_0x12c2a3){var _0x211a04=function(_0x1edaea){while(--_0x1edaea){_0x349a3d['push'](_0x349a3d['shift']());}};_0x211a04(++_0x12c2a3);}(_0xa0f4,0x1b4));var _0x4a0f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa0f4[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var ChatOfflineMessage=require(_0x4a0f('0x0'))['db']['ChatOfflineMessage'];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x4a0f('0x1'),'afterDestroy':_0x4a0f('0x2')};function emitEvent(_0x317118){return function(_0x4fe4a3,_0x50ab71,_0x552648){ChatOfflineMessageEvents[_0x4a0f('0x3')](_0x317118+':'+_0x4fe4a3['id'],_0x4fe4a3);ChatOfflineMessageEvents['emit'](_0x317118,_0x4fe4a3);_0x552648(null);};}for(var e in events){if(events[_0x4a0f('0x4')](e)){var event=events[e];ChatOfflineMessage['hook'](e,emitEvent(event));}}module['exports']=ChatOfflineMessageEvents; \ No newline at end of file +var _0x8d0a=['exports','events','ChatOfflineMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x54861c,_0x8756fc){var _0x4786d6=function(_0x2c151b){while(--_0x2c151b){_0x54861c['push'](_0x54861c['shift']());}};_0x4786d6(++_0x8756fc);}(_0x8d0a,0x65));var _0xa8d0=function(_0x156797,_0xc2f92f){_0x156797=_0x156797-0x0;var _0x576f6d=_0x8d0a[_0x156797];return _0x576f6d;};'use strict';var EventEmitter=require(_0xa8d0('0x0'));var ChatOfflineMessage=require('../../mysqldb')['db'][_0xa8d0('0x1')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0xa8d0('0x2')](0x0);var events={'afterCreate':_0xa8d0('0x3'),'afterUpdate':_0xa8d0('0x4'),'afterDestroy':_0xa8d0('0x5')};function emitEvent(_0x477190){return function(_0x528287,_0x202833,_0x34f130){ChatOfflineMessageEvents['emit'](_0x477190+':'+_0x528287['id'],_0x528287);ChatOfflineMessageEvents[_0xa8d0('0x6')](_0x477190,_0x528287);_0x34f130(null);};}for(var e in events){if(events[_0xa8d0('0x7')](e)){var event=events[e];ChatOfflineMessage[_0xa8d0('0x8')](e,emitEvent(event));}}module[_0xa8d0('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 b3dfcd6..509f799 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 _0x6526=['chat_offline_messages','utf8mb4_unicode_ci','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0x6526,0x1ca));var _0x6652=function(_0x21205e,_0x7eb8e7){_0x21205e=_0x21205e-0x0;var _0x136ebb=_0x6526[_0x21205e];return _0x136ebb;};'use strict';var attributes=require(_0x6652('0x0'));module[_0x6652('0x1')]=function(_0x2bd8ee){return _0x2bd8ee[_0x6652('0x2')](_0x6652('0x3'),attributes,{'tableName':_0x6652('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x6652('0x5')});}; \ No newline at end of file +var _0x62c5=['utf8mb4','utf8mb4_unicode_ci','./chatOfflineMessage.attributes','exports'];(function(_0x4451e6,_0x4cfaab){var _0x4dbf17=function(_0x54e6ee){while(--_0x54e6ee){_0x4451e6['push'](_0x4451e6['shift']());}};_0x4dbf17(++_0x4cfaab);}(_0x62c5,0x112));var _0x562c=function(_0x91ed5c,_0xdb6b34){_0x91ed5c=_0x91ed5c-0x0;var _0x2387d8=_0x62c5[_0x91ed5c];return _0x2387d8;};'use strict';var attributes=require(_0x562c('0x0'));module[_0x562c('0x1')]=function(_0x183b1e){return _0x183b1e['define']('ChatOfflineMessage',attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x562c('0x2'),'collate':_0x562c('0x3')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index 1d1a5c9..3cd677d 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 _0xaa7d=['code','message','result','catch','lodash','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x33ca83,_0x54f25c){var _0x175082=function(_0x1c44a9){while(--_0x1c44a9){_0x33ca83['push'](_0x33ca83['shift']());}};_0x175082(++_0x54f25c);}(_0xaa7d,0x1ea));var _0xdaa7=function(_0x5e9a69,_0x40c0ec){_0x5e9a69=_0x5e9a69-0x0;var _0x5979c8=_0xaa7d[_0x5e9a69];return _0x5979c8;};'use strict';var _=require(_0xdaa7('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xdaa7('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdaa7('0x2'))['db'];var utils=require(_0xdaa7('0x3'));var logger=require(_0xdaa7('0x4'))(_0xdaa7('0x5'));var config=require(_0xdaa7('0x6'));var jayson=require(_0xdaa7('0x7'));var client=jayson['client'][_0xdaa7('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x995170,_0x478a70,_0x45f435){return new BPromise(function(_0x324e0b,_0x2eb2e2){return client['request'](_0x995170,_0x45f435)['then'](function(_0x5f3364){logger['info'](_0xdaa7('0x9'),_0x478a70,_0xdaa7('0xa'));logger['debug'](_0xdaa7('0xb'),_0x478a70,'request\x20sent',JSON[_0xdaa7('0xc')](_0x5f3364));if(_0x5f3364[_0xdaa7('0xd')]){if(_0x5f3364[_0xdaa7('0xd')][_0xdaa7('0xe')]===0x1f4){logger[_0xdaa7('0xd')](_0xdaa7('0x9'),_0x478a70,_0x5f3364[_0xdaa7('0xd')]['message']);return _0x2eb2e2(_0x5f3364[_0xdaa7('0xd')][_0xdaa7('0xf')]);}logger[_0xdaa7('0xd')](_0xdaa7('0x9'),_0x478a70,_0x5f3364[_0xdaa7('0xd')]['message']);return _0x324e0b(_0x5f3364[_0xdaa7('0xd')][_0xdaa7('0xf')]);}else{logger['info'](_0xdaa7('0x9'),_0x478a70,_0xdaa7('0xa'));_0x324e0b(_0x5f3364[_0xdaa7('0x10')][_0xdaa7('0xf')]);}})[_0xdaa7('0x11')](function(_0x5ddfb6){logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x478a70,_0x5ddfb6);_0x2eb2e2(_0x5ddfb6);});});} \ No newline at end of file +var _0x4e3d=['info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','error','message','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','then'];(function(_0x522ae8,_0x3b637e){var _0x3189b9=function(_0x3115d4){while(--_0x3115d4){_0x522ae8['push'](_0x522ae8['shift']());}};_0x3189b9(++_0x3b637e);}(_0x4e3d,0x14b));var _0xd4e3=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x4e3d[_0x17d9e3];return _0x14192d;};'use strict';var _=require('lodash');var util=require(_0xd4e3('0x0'));var moment=require('moment');var BPromise=require(_0xd4e3('0x1'));var rs=require(_0xd4e3('0x2'));var fs=require('fs');var Redis=require(_0xd4e3('0x3'));var db=require(_0xd4e3('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xd4e3('0x5'));var jayson=require(_0xd4e3('0x6'));var client=jayson[_0xd4e3('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1d2095,_0x172965,_0x38c887){return new BPromise(function(_0x17ed8d,_0x24fbb5){return client['request'](_0x1d2095,_0x38c887)[_0xd4e3('0x8')](function(_0x49f22b){logger[_0xd4e3('0x9')](_0xd4e3('0xa'),_0x172965,_0xd4e3('0xb'));logger[_0xd4e3('0xc')](_0xd4e3('0xd'),_0x172965,'request\x20sent',JSON['stringify'](_0x49f22b));if(_0x49f22b[_0xd4e3('0xe')]){if(_0x49f22b[_0xd4e3('0xe')]['code']===0x1f4){logger['error'](_0xd4e3('0xa'),_0x172965,_0x49f22b[_0xd4e3('0xe')][_0xd4e3('0xf')]);return _0x24fbb5(_0x49f22b['error'][_0xd4e3('0xf')]);}logger[_0xd4e3('0xe')](_0xd4e3('0xa'),_0x172965,_0x49f22b[_0xd4e3('0xe')]['message']);return _0x17ed8d(_0x49f22b[_0xd4e3('0xe')][_0xd4e3('0xf')]);}else{logger['info'](_0xd4e3('0xa'),_0x172965,_0xd4e3('0xb'));_0x17ed8d(_0x49f22b['result']['message']);}})[_0xd4e3('0x10')](function(_0xc4d165){logger['error'](_0xd4e3('0xa'),_0x172965,_0xc4d165);_0x24fbb5(_0xc4d165);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index cb3fe91..e4b2b18 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 _0x5510=['describe','/:id','show','post','create','put','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe'];(function(_0x2e1051,_0x58b01d){var _0x5aa734=function(_0x15a99d){while(--_0x15a99d){_0x2e1051['push'](_0x2e1051['shift']());}};_0x5aa734(++_0x58b01d);}(_0x5510,0x149));var _0x0551=function(_0x3ad9b3,_0x5c76e9){_0x3ad9b3=_0x3ad9b3-0x0;var _0x4ef8d1=_0x5510[_0x3ad9b3];return _0x4ef8d1;};'use strict';var multer=require(_0x0551('0x0'));var util=require('util');var path=require(_0x0551('0x1'));var timeout=require(_0x0551('0x2'));var express=require(_0x0551('0x3'));var router=express[_0x0551('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x0551('0x5'));var interaction=require(_0x0551('0x6'));var config=require(_0x0551('0x7'));var controller=require('./chatOfflineMessage.controller');router[_0x0551('0x8')]('/',auth[_0x0551('0x9')](),controller['index']);router[_0x0551('0x8')](_0x0551('0xa'),auth[_0x0551('0x9')](),controller[_0x0551('0xb')]);router['get'](_0x0551('0xc'),auth[_0x0551('0x9')](),controller[_0x0551('0xd')]);router[_0x0551('0xe')]('/',auth[_0x0551('0x9')](),controller[_0x0551('0xf')]);router[_0x0551('0x10')]('/:id',auth[_0x0551('0x9')](),controller['update']);router[_0x0551('0x11')](_0x0551('0xc'),auth[_0x0551('0x9')](),controller[_0x0551('0x12')]);module[_0x0551('0x13')]=router; \ No newline at end of file +var _0xea32=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','create','put','update','delete','destroy','exports','util','path','connect-timeout'];(function(_0x5e709f,_0x49c4a1){var _0x45445f=function(_0x3d116f){while(--_0x3d116f){_0x5e709f['push'](_0x5e709f['shift']());}};_0x45445f(++_0x49c4a1);}(_0xea32,0x131));var _0x2ea3=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xea32[_0x14add3];return _0x4a174f;};'use strict';var multer=require('multer');var util=require(_0x2ea3('0x0'));var path=require(_0x2ea3('0x1'));var timeout=require(_0x2ea3('0x2'));var express=require(_0x2ea3('0x3'));var router=express[_0x2ea3('0x4')]();var fs_extra=require(_0x2ea3('0x5'));var auth=require(_0x2ea3('0x6'));var interaction=require(_0x2ea3('0x7'));var config=require(_0x2ea3('0x8'));var controller=require(_0x2ea3('0x9'));router[_0x2ea3('0xa')]('/',auth[_0x2ea3('0xb')](),controller[_0x2ea3('0xc')]);router[_0x2ea3('0xa')](_0x2ea3('0xd'),auth[_0x2ea3('0xb')](),controller[_0x2ea3('0xe')]);router[_0x2ea3('0xa')](_0x2ea3('0xf'),auth[_0x2ea3('0xb')](),controller['show']);router['post']('/',auth[_0x2ea3('0xb')](),controller[_0x2ea3('0x10')]);router[_0x2ea3('0x11')](_0x2ea3('0xf'),auth[_0x2ea3('0xb')](),controller[_0x2ea3('0x12')]);router[_0x2ea3('0x13')](_0x2ea3('0xf'),auth[_0x2ea3('0xb')](),controller[_0x2ea3('0x14')]);module[_0x2ea3('0x15')]=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index 57bb7e7..50d8c79 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 _0x67b5=['sequelize','exports','STRING','mouseOver','timeout'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x67b5,0x11d));var _0x567b=function(_0x2a2091,_0x5d6a29){_0x2a2091=_0x2a2091-0x0;var _0x284077=_0x67b5[_0x2a2091];return _0x284077;};'use strict';var Sequelize=require(_0x567b('0x0'));module[_0x567b('0x1')]={'name':{'type':Sequelize[_0x567b('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x567b('0x3'),_0x567b('0x4')),'defaultValue':_0x567b('0x3')},'selector':{'type':Sequelize[_0x567b('0x2')]},'timeout':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x89ea=['sequelize','STRING','ENUM','mouseOver','INTEGER'];(function(_0x2d364e,_0x301c5e){var _0x1b9312=function(_0x1b05bb){while(--_0x1b05bb){_0x2d364e['push'](_0x2d364e['shift']());}};_0x1b9312(++_0x301c5e);}(_0x89ea,0xdc));var _0xa89e=function(_0x3744c4,_0x4bdca9){_0x3744c4=_0x3744c4-0x0;var _0x167b7f=_0x89ea[_0x3744c4];return _0x167b7f;};'use strict';var Sequelize=require(_0xa89e('0x0'));module['exports']={'name':{'type':Sequelize[_0xa89e('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xa89e('0x2')](_0xa89e('0x3'),'timeout'),'defaultValue':_0xa89e('0x3')},'selector':{'type':Sequelize[_0xa89e('0x1')]},'timeout':{'type':Sequelize[_0xa89e('0x4')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index be7e5c7..fb636f3 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 _0x5a52=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','offset','limit','count','status','set','Content-Range','apply','save','then','destroy','error','stack','name','send','show','params','model','ChatProactiveAction','query','keys','intersection','attributes','fields','length','includeAll','include','options','find','catch','create','body','update','eml-format','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service'];(function(_0x2e561f,_0x1b1660){var _0x4160ea=function(_0x1fa2ca){while(--_0x1fa2ca){_0x2e561f['push'](_0x2e561f['shift']());}};_0x4160ea(++_0x1b1660);}(_0x5a52,0x18d));var _0x25a5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5a52[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x25a5('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x25a5('0x1'));var moment=require(_0x25a5('0x2'));var BPromise=require(_0x25a5('0x3'));var Mustache=require(_0x25a5('0x4'));var util=require(_0x25a5('0x5'));var path=require(_0x25a5('0x6'));var sox=require(_0x25a5('0x7'));var csv=require(_0x25a5('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x25a5('0x9'));var _=require('lodash');var squel=require(_0x25a5('0xa'));var crypto=require(_0x25a5('0xb'));var jsforce=require(_0x25a5('0xc'));var deskjs=require(_0x25a5('0xd'));var toCsv=require(_0x25a5('0x8'));var querystring=require(_0x25a5('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x25a5('0xf'));var qs=require(_0x25a5('0x10'));var as=require(_0x25a5('0x11'));var hardwareService=require(_0x25a5('0x12'));var logger=require(_0x25a5('0x13'))(_0x25a5('0x14'));var utils=require(_0x25a5('0x15'));var config=require(_0x25a5('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x25a5('0x17'))['db'];function respondWithStatusCode(_0x20df69,_0x425f2e){_0x425f2e=_0x425f2e||0xcc;return function(_0x5deb28){if(_0x5deb28){return _0x20df69[_0x25a5('0x18')](_0x425f2e);}return _0x20df69['status'](_0x425f2e)[_0x25a5('0x19')]();};}function respondWithResult(_0x25b7bb,_0x1edef3){_0x1edef3=_0x1edef3||0xc8;return function(_0x47d1d1){if(_0x47d1d1){return _0x25b7bb['status'](_0x1edef3)[_0x25a5('0x1a')](_0x47d1d1);}};}function respondWithFilteredResult(_0x5e1590,_0x7e183e){return function(_0x1c0ad6){if(_0x1c0ad6){var _0x39313e=typeof _0x7e183e[_0x25a5('0x1b')]==='undefined'&&typeof _0x7e183e[_0x25a5('0x1c')]==='undefined';var _0x5f257b=_0x1c0ad6[_0x25a5('0x1d')];var _0x17901b=_0x39313e?0x0:_0x7e183e[_0x25a5('0x1b')];var _0x95dfbc=_0x39313e?_0x1c0ad6[_0x25a5('0x1d')]:_0x7e183e['offset']+_0x7e183e['limit'];var _0x1390fb;if(_0x95dfbc>=_0x5f257b){_0x95dfbc=_0x5f257b;_0x1390fb=0xc8;}else{_0x1390fb=0xce;}_0x5e1590[_0x25a5('0x1e')](_0x1390fb);return _0x5e1590[_0x25a5('0x1f')](_0x25a5('0x20'),_0x17901b+'-'+_0x95dfbc+'/'+_0x5f257b)[_0x25a5('0x1a')](_0x1c0ad6);}return null;};}function patchUpdates(_0x44f1ed){return function(_0x514c59){try{jsonpatch[_0x25a5('0x21')](_0x514c59,_0x44f1ed,!![]);}catch(_0x4dba9d){return BPromise['reject'](_0x4dba9d);}return _0x514c59[_0x25a5('0x22')]();};}function saveUpdates(_0x54cc71,_0x34a92f){return function(_0x3177ea){if(_0x3177ea){return _0x3177ea['update'](_0x54cc71)[_0x25a5('0x23')](function(_0x174c3f){return _0x174c3f;});}return null;};}function removeEntity(_0x4be312,_0x37f7fe){return function(_0xaea9aa){if(_0xaea9aa){return _0xaea9aa[_0x25a5('0x24')]()['then'](function(){_0x4be312[_0x25a5('0x1e')](0xcc)[_0x25a5('0x19')]();});}};}function handleEntityNotFound(_0x5e8db0,_0x23b304){return function(_0x48db7e){if(!_0x48db7e){_0x5e8db0[_0x25a5('0x18')](0x194);}return _0x48db7e;};}function handleError(_0x42f14a,_0x400800){_0x400800=_0x400800||0x1f4;return function(_0x5caf87){logger[_0x25a5('0x25')](_0x5caf87[_0x25a5('0x26')]);if(_0x5caf87[_0x25a5('0x27')]){delete _0x5caf87[_0x25a5('0x27')];}_0x42f14a[_0x25a5('0x1e')](_0x400800)[_0x25a5('0x28')](_0x5caf87);};}exports[_0x25a5('0x29')]=function(_0x387774,_0x12e1be){var _0x112a08={'raw':!![],'where':{'id':_0x387774[_0x25a5('0x2a')]['id']}},_0x412f42={};_0x412f42[_0x25a5('0x2b')]=_['keys'](db[_0x25a5('0x2c')]['rawAttributes']);_0x412f42[_0x25a5('0x2d')]=_[_0x25a5('0x2e')](_0x387774['query']);_0x412f42['filters']=_[_0x25a5('0x2f')](_0x412f42[_0x25a5('0x2b')],_0x412f42[_0x25a5('0x2d')]);_0x112a08[_0x25a5('0x30')]=_['intersection'](_0x412f42[_0x25a5('0x2b')],qs[_0x25a5('0x31')](_0x387774[_0x25a5('0x2d')][_0x25a5('0x31')]));_0x112a08[_0x25a5('0x30')]=_0x112a08[_0x25a5('0x30')][_0x25a5('0x32')]?_0x112a08['attributes']:_0x412f42['model'];if(_0x387774[_0x25a5('0x2d')][_0x25a5('0x33')]){_0x112a08[_0x25a5('0x34')]=[{'all':!![]}];}_0x112a08=_['merge']({},_0x112a08,_0x387774[_0x25a5('0x35')]);return db[_0x25a5('0x2c')][_0x25a5('0x36')](_0x112a08)[_0x25a5('0x23')](handleEntityNotFound(_0x12e1be,null))[_0x25a5('0x23')](respondWithResult(_0x12e1be,null))[_0x25a5('0x37')](handleError(_0x12e1be,null));};exports[_0x25a5('0x38')]=function(_0x19ab5f,_0xaedce7){return db[_0x25a5('0x2c')][_0x25a5('0x38')](_0x19ab5f[_0x25a5('0x39')],{})['then'](respondWithResult(_0xaedce7,0xc9))['catch'](handleError(_0xaedce7,null));};exports[_0x25a5('0x3a')]=function(_0x5b872c,_0x27eefb){if(_0x5b872c['body']['id']){delete _0x5b872c[_0x25a5('0x39')]['id'];}return db[_0x25a5('0x2c')][_0x25a5('0x36')]({'where':{'id':_0x5b872c[_0x25a5('0x2a')]['id']}})[_0x25a5('0x23')](handleEntityNotFound(_0x27eefb,null))['then'](saveUpdates(_0x5b872c[_0x25a5('0x39')],null))['then'](respondWithResult(_0x27eefb,null))[_0x25a5('0x37')](handleError(_0x27eefb,null));};exports['destroy']=function(_0x5ad0b6,_0x3c3c64){return db[_0x25a5('0x2c')][_0x25a5('0x36')]({'where':{'id':_0x5ad0b6[_0x25a5('0x2a')]['id']}})[_0x25a5('0x23')](handleEntityNotFound(_0x3c3c64,null))[_0x25a5('0x23')](removeEntity(_0x3c3c64,null))[_0x25a5('0x37')](handleError(_0x3c3c64,null));}; \ No newline at end of file +var _0xf9d5=['catch','create','body','update','find','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','then','sendStatus','error','stack','name','show','params','model','keys','ChatProactiveAction','query','intersection','fields','attributes','includeAll','merge','options'];(function(_0x5192de,_0x4e91cd){var _0x4e287e=function(_0x3639bc){while(--_0x3639bc){_0x5192de['push'](_0x5192de['shift']());}};_0x4e287e(++_0x4e91cd);}(_0xf9d5,0x122));var _0x5f9d=function(_0x19093e,_0x2b5387){_0x19093e=_0x19093e-0x0;var _0x2e3e83=_0xf9d5[_0x19093e];return _0x2e3e83;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5f9d('0x0'));var zipdir=require(_0x5f9d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5f9d('0x2'));var moment=require(_0x5f9d('0x3'));var BPromise=require(_0x5f9d('0x4'));var Mustache=require(_0x5f9d('0x5'));var util=require(_0x5f9d('0x6'));var path=require(_0x5f9d('0x7'));var sox=require(_0x5f9d('0x8'));var csv=require('to-csv');var ejs=require(_0x5f9d('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5f9d('0xa'));var squel=require(_0x5f9d('0xb'));var crypto=require('crypto');var jsforce=require(_0x5f9d('0xc'));var deskjs=require(_0x5f9d('0xd'));var toCsv=require(_0x5f9d('0xe'));var querystring=require(_0x5f9d('0xf'));var Papa=require(_0x5f9d('0x10'));var Redis=require(_0x5f9d('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x5f9d('0x12'));var as=require(_0x5f9d('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5f9d('0x14'));var utils=require(_0x5f9d('0x15'));var config=require(_0x5f9d('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x5f9d('0x17'))['db'];function respondWithStatusCode(_0x10f5b1,_0x257910){_0x257910=_0x257910||0xcc;return function(_0x23a39f){if(_0x23a39f){return _0x10f5b1['sendStatus'](_0x257910);}return _0x10f5b1[_0x5f9d('0x18')](_0x257910)[_0x5f9d('0x19')]();};}function respondWithResult(_0x234902,_0x5aacdc){_0x5aacdc=_0x5aacdc||0xc8;return function(_0x8e2381){if(_0x8e2381){return _0x234902[_0x5f9d('0x18')](_0x5aacdc)['json'](_0x8e2381);}};}function respondWithFilteredResult(_0x4fd1cb,_0x2f0154){return function(_0x334cea){if(_0x334cea){var _0x3d4a1c=typeof _0x2f0154[_0x5f9d('0x1a')]===_0x5f9d('0x1b')&&typeof _0x2f0154['limit']==='undefined';var _0x54bd00=_0x334cea[_0x5f9d('0x1c')];var _0x4fb9a5=_0x3d4a1c?0x0:_0x2f0154[_0x5f9d('0x1a')];var _0x48448e=_0x3d4a1c?_0x334cea[_0x5f9d('0x1c')]:_0x2f0154[_0x5f9d('0x1a')]+_0x2f0154[_0x5f9d('0x1d')];var _0x55a31c;if(_0x48448e>=_0x54bd00){_0x48448e=_0x54bd00;_0x55a31c=0xc8;}else{_0x55a31c=0xce;}_0x4fd1cb[_0x5f9d('0x18')](_0x55a31c);return _0x4fd1cb[_0x5f9d('0x1e')](_0x5f9d('0x1f'),_0x4fb9a5+'-'+_0x48448e+'/'+_0x54bd00)[_0x5f9d('0x20')](_0x334cea);}return null;};}function patchUpdates(_0x320182){return function(_0xa62826){try{jsonpatch[_0x5f9d('0x21')](_0xa62826,_0x320182,!![]);}catch(_0x2563d5){return BPromise[_0x5f9d('0x22')](_0x2563d5);}return _0xa62826['save']();};}function saveUpdates(_0x4a2eeb,_0x5465b1){return function(_0x1bc76b){if(_0x1bc76b){return _0x1bc76b['update'](_0x4a2eeb)[_0x5f9d('0x23')](function(_0x5a3472){return _0x5a3472;});}return null;};}function removeEntity(_0x9d86ce,_0x564886){return function(_0x4875c5){if(_0x4875c5){return _0x4875c5['destroy']()[_0x5f9d('0x23')](function(){_0x9d86ce[_0x5f9d('0x18')](0xcc)[_0x5f9d('0x19')]();});}};}function handleEntityNotFound(_0x234511,_0x542bbc){return function(_0x379d2d){if(!_0x379d2d){_0x234511[_0x5f9d('0x24')](0x194);}return _0x379d2d;};}function handleError(_0x190402,_0x74f212){_0x74f212=_0x74f212||0x1f4;return function(_0x2d097f){logger[_0x5f9d('0x25')](_0x2d097f[_0x5f9d('0x26')]);if(_0x2d097f[_0x5f9d('0x27')]){delete _0x2d097f[_0x5f9d('0x27')];}_0x190402[_0x5f9d('0x18')](_0x74f212)['send'](_0x2d097f);};}exports[_0x5f9d('0x28')]=function(_0x1b9054,_0x1496c0){var _0x13cc7c={'raw':!![],'where':{'id':_0x1b9054[_0x5f9d('0x29')]['id']}},_0x10e542={};_0x10e542[_0x5f9d('0x2a')]=_[_0x5f9d('0x2b')](db[_0x5f9d('0x2c')]['rawAttributes']);_0x10e542['query']=_['keys'](_0x1b9054[_0x5f9d('0x2d')]);_0x10e542['filters']=_[_0x5f9d('0x2e')](_0x10e542['model'],_0x10e542[_0x5f9d('0x2d')]);_0x13cc7c['attributes']=_[_0x5f9d('0x2e')](_0x10e542[_0x5f9d('0x2a')],qs[_0x5f9d('0x2f')](_0x1b9054[_0x5f9d('0x2d')][_0x5f9d('0x2f')]));_0x13cc7c['attributes']=_0x13cc7c[_0x5f9d('0x30')]['length']?_0x13cc7c[_0x5f9d('0x30')]:_0x10e542['model'];if(_0x1b9054[_0x5f9d('0x2d')][_0x5f9d('0x31')]){_0x13cc7c['include']=[{'all':!![]}];}_0x13cc7c=_[_0x5f9d('0x32')]({},_0x13cc7c,_0x1b9054[_0x5f9d('0x33')]);return db[_0x5f9d('0x2c')]['find'](_0x13cc7c)[_0x5f9d('0x23')](handleEntityNotFound(_0x1496c0,null))[_0x5f9d('0x23')](respondWithResult(_0x1496c0,null))[_0x5f9d('0x34')](handleError(_0x1496c0,null));};exports[_0x5f9d('0x35')]=function(_0x3377af,_0x506869){return db[_0x5f9d('0x2c')][_0x5f9d('0x35')](_0x3377af[_0x5f9d('0x36')],{})[_0x5f9d('0x23')](respondWithResult(_0x506869,0xc9))[_0x5f9d('0x34')](handleError(_0x506869,null));};exports[_0x5f9d('0x37')]=function(_0x48a8e8,_0x1692c0){if(_0x48a8e8[_0x5f9d('0x36')]['id']){delete _0x48a8e8[_0x5f9d('0x36')]['id'];}return db['ChatProactiveAction']['find']({'where':{'id':_0x48a8e8[_0x5f9d('0x29')]['id']}})[_0x5f9d('0x23')](handleEntityNotFound(_0x1692c0,null))[_0x5f9d('0x23')](saveUpdates(_0x48a8e8[_0x5f9d('0x36')],null))[_0x5f9d('0x23')](respondWithResult(_0x1692c0,null))['catch'](handleError(_0x1692c0,null));};exports['destroy']=function(_0x43b7b9,_0x3c5737){return db['ChatProactiveAction'][_0x5f9d('0x38')]({'where':{'id':_0x43b7b9['params']['id']}})[_0x5f9d('0x23')](handleEntityNotFound(_0x3c5737,null))[_0x5f9d('0x23')](removeEntity(_0x3c5737,null))['catch'](handleError(_0x3c5737,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index 932a05f..7c96efd 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 _0x77d7=['ChatProactiveAction','lodash','../../config/logger','bluebird','path','./chatProactiveAction.attributes'];(function(_0x154192,_0x2d360f){var _0x3c2792=function(_0x2e257b){while(--_0x2e257b){_0x154192['push'](_0x154192['shift']());}};_0x3c2792(++_0x2d360f);}(_0x77d7,0x12d));var _0x777d=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x77d7[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x777d('0x0'));var util=require('util');var logger=require(_0x777d('0x1'))('api');var moment=require('moment');var BPromise=require(_0x777d('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x777d('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x777d('0x4'));module['exports']=function(_0xa4ac17,_0x4791fc){return _0xa4ac17['define'](_0x777d('0x5'),attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb1b6=['request-promise','path','rimraf','../../config/environment','exports','define','ChatProactiveAction','lodash','../../config/logger','api','moment','bluebird'];(function(_0x128c2,_0x24f64d){var _0xec6cad=function(_0x592865){while(--_0x592865){_0x128c2['push'](_0x128c2['shift']());}};_0xec6cad(++_0x24f64d);}(_0xb1b6,0x1f3));var _0x6b1b=function(_0x53cbcc,_0x252b41){_0x53cbcc=_0x53cbcc-0x0;var _0x26c68c=_0xb1b6[_0x53cbcc];return _0x26c68c;};'use strict';var _=require(_0x6b1b('0x0'));var util=require('util');var logger=require(_0x6b1b('0x1'))(_0x6b1b('0x2'));var moment=require(_0x6b1b('0x3'));var BPromise=require(_0x6b1b('0x4'));var rp=require(_0x6b1b('0x5'));var fs=require('fs');var path=require(_0x6b1b('0x6'));var rimraf=require(_0x6b1b('0x7'));var config=require(_0x6b1b('0x8'));var attributes=require('./chatProactiveAction.attributes');module[_0x6b1b('0x9')]=function(_0x24c12b,_0x3ed5d4){return _0x24c12b[_0x6b1b('0xa')](_0x6b1b('0xb'),attributes,{'tableName':'chat_proactive_actions','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 435e2d7..ce1de0a 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 _0x5707=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','stringify','error','message','ChatProactiveAction,\x20%s,\x20%s','lodash','util','moment','bluebird'];(function(_0x38157b,_0x28834d){var _0x3e8df2=function(_0x21ff1){while(--_0x21ff1){_0x38157b['push'](_0x38157b['shift']());}};_0x3e8df2(++_0x28834d);}(_0x5707,0x122));var _0x7570=function(_0x180c9b,_0x13d173){_0x180c9b=_0x180c9b-0x0;var _0x3ff116=_0x5707[_0x180c9b];return _0x3ff116;};'use strict';var _=require(_0x7570('0x0'));var util=require(_0x7570('0x1'));var moment=require(_0x7570('0x2'));var BPromise=require(_0x7570('0x3'));var rs=require(_0x7570('0x4'));var fs=require('fs');var Redis=require(_0x7570('0x5'));var db=require(_0x7570('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x7570('0x7'))(_0x7570('0x8'));var config=require(_0x7570('0x9'));var jayson=require(_0x7570('0xa'));var client=jayson[_0x7570('0xb')][_0x7570('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x56626b,_0xb8da42,_0x94d5cf){return new BPromise(function(_0x8ffb97,_0x429d0c){return client[_0x7570('0xd')](_0x56626b,_0x94d5cf)[_0x7570('0xe')](function(_0x37121f){logger['info']('ChatProactiveAction,\x20%s,\x20%s',_0xb8da42,_0x7570('0xf'));logger[_0x7570('0x10')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0xb8da42,'request\x20sent',JSON[_0x7570('0x11')](_0x37121f));if(_0x37121f[_0x7570('0x12')]){if(_0x37121f[_0x7570('0x12')]['code']===0x1f4){logger[_0x7570('0x12')]('ChatProactiveAction,\x20%s,\x20%s',_0xb8da42,_0x37121f[_0x7570('0x12')]['message']);return _0x429d0c(_0x37121f[_0x7570('0x12')][_0x7570('0x13')]);}logger[_0x7570('0x12')](_0x7570('0x14'),_0xb8da42,_0x37121f[_0x7570('0x12')][_0x7570('0x13')]);return _0x8ffb97(_0x37121f[_0x7570('0x12')][_0x7570('0x13')]);}else{logger['info'](_0x7570('0x14'),_0xb8da42,_0x7570('0xf'));_0x8ffb97(_0x37121f['result'][_0x7570('0x13')]);}})['catch'](function(_0xf6c705){logger[_0x7570('0x12')](_0x7570('0x14'),_0xb8da42,_0xf6c705);_0x429d0c(_0xf6c705);});});} \ No newline at end of file +var _0x6688=['info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then'];(function(_0x49a84b,_0x17c1be){var _0x171650=function(_0x1cc9cf){while(--_0x1cc9cf){_0x49a84b['push'](_0x49a84b['shift']());}};_0x171650(++_0x17c1be);}(_0x6688,0x13d));var _0x8668=function(_0x5d4b7d,_0x2a54f8){_0x5d4b7d=_0x5d4b7d-0x0;var _0x5d1eaf=_0x6688[_0x5d4b7d];return _0x5d1eaf;};'use strict';var _=require('lodash');var util=require(_0x8668('0x0'));var moment=require(_0x8668('0x1'));var BPromise=require(_0x8668('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8668('0x3'));var db=require(_0x8668('0x4'))['db'];var utils=require(_0x8668('0x5'));var logger=require(_0x8668('0x6'))(_0x8668('0x7'));var config=require(_0x8668('0x8'));var jayson=require(_0x8668('0x9'));var client=jayson[_0x8668('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x389de5,_0x493efe,_0x2964bf){return new BPromise(function(_0x51b317,_0x5cf43a){return client[_0x8668('0xb')](_0x389de5,_0x2964bf)[_0x8668('0xc')](function(_0x800ab7){logger[_0x8668('0xd')](_0x8668('0xe'),_0x493efe,_0x8668('0xf'));logger['debug'](_0x8668('0x10'),_0x493efe,_0x8668('0xf'),JSON[_0x8668('0x11')](_0x800ab7));if(_0x800ab7[_0x8668('0x12')]){if(_0x800ab7[_0x8668('0x12')][_0x8668('0x13')]===0x1f4){logger[_0x8668('0x12')]('ChatProactiveAction,\x20%s,\x20%s',_0x493efe,_0x800ab7['error'][_0x8668('0x14')]);return _0x5cf43a(_0x800ab7[_0x8668('0x12')]['message']);}logger['error'](_0x8668('0xe'),_0x493efe,_0x800ab7[_0x8668('0x12')][_0x8668('0x14')]);return _0x51b317(_0x800ab7[_0x8668('0x12')][_0x8668('0x14')]);}else{logger['info']('ChatProactiveAction,\x20%s,\x20%s',_0x493efe,_0x8668('0xf'));_0x51b317(_0x800ab7['result'][_0x8668('0x14')]);}})[_0x8668('0x15')](function(_0x3316a3){logger[_0x8668('0x12')](_0x8668('0xe'),_0x493efe,_0x3316a3);_0x5cf43a(_0x3316a3);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index 3cf2d9a..ca244c4 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 _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(_0x1d9aa0,_0x272488){var _0x226868=function(_0x17127c){while(--_0x17127c){_0x1d9aa0['push'](_0x1d9aa0['shift']());}};_0x226868(++_0x272488);}(_0xeff8,0x186));var _0x8eff=function(_0x39096d,_0x51f8a0){_0x39096d=_0x39096d-0x0;var _0x13da4f=_0xeff8[_0x39096d];return _0x13da4f;};'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 +var _0xf494=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','create','put','update','delete','exports','multer','util'];(function(_0x46b98,_0x202301){var _0x550fed=function(_0x5b2634){while(--_0x5b2634){_0x46b98['push'](_0x46b98['shift']());}};_0x550fed(++_0x202301);}(_0xf494,0x1c6));var _0x4f49=function(_0x109864,_0x2339ec){_0x109864=_0x109864-0x0;var _0x1523a1=_0xf494[_0x109864];return _0x1523a1;};'use strict';var multer=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var path=require(_0x4f49('0x2'));var timeout=require('connect-timeout');var express=require(_0x4f49('0x3'));var router=express[_0x4f49('0x4')]();var fs_extra=require(_0x4f49('0x5'));var auth=require(_0x4f49('0x6'));var interaction=require(_0x4f49('0x7'));var config=require(_0x4f49('0x8'));var controller=require(_0x4f49('0x9'));router[_0x4f49('0xa')](_0x4f49('0xb'),auth[_0x4f49('0xc')](),controller[_0x4f49('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x4f49('0xe')]);router[_0x4f49('0xf')](_0x4f49('0xb'),auth[_0x4f49('0xc')](),controller[_0x4f49('0x10')]);router[_0x4f49('0x11')](_0x4f49('0xb'),auth[_0x4f49('0xc')](),controller['destroy']);module[_0x4f49('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index 0652ac9..96d5bba 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 _0x5529=['sequelize','exports','STRING','name','ENUM','rrmemory','beepall','roundrobin'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x5529,0x180));var _0x9552=function(_0x1c09f4,_0x46a2e5){_0x1c09f4=_0x1c09f4-0x0;var _0x122707=_0x5529[_0x1c09f4];return _0x122707;};'use strict';var Sequelize=require(_0x9552('0x0'));module[_0x9552('0x1')]={'name':{'type':Sequelize[_0x9552('0x2')],'unique':_0x9552('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x9552('0x4')](_0x9552('0x5'),_0x9552('0x6'),_0x9552('0x7'))}}; \ No newline at end of file +var _0x1659=['roundrobin','sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory'];(function(_0x2035b1,_0x240790){var _0x2a3f32=function(_0x3f65e9){while(--_0x3f65e9){_0x2035b1['push'](_0x2035b1['shift']());}};_0x2a3f32(++_0x240790);}(_0x1659,0x1a1));var _0x9165=function(_0x7af1ed,_0x150d56){_0x7af1ed=_0x7af1ed-0x0;var _0x7dcac9=_0x1659[_0x7af1ed];return _0x7dcac9;};'use strict';var Sequelize=require(_0x9165('0x0'));module[_0x9165('0x1')]={'name':{'type':Sequelize[_0x9165('0x2')],'unique':_0x9165('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x9165('0x2')]},'timeout':{'type':Sequelize[_0x9165('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x9165('0x5')](_0x9165('0x6'),'beepall',_0x9165('0x7'))}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index 4f268a4..944167d 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 _0xdc2b=['compact','value','removeAgents','userChatQueue:remove','addAgents','omit','userChatQueue:save','isArray','getAgents','bluebird','util','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','redis','defaults','socket.io-emitter','register','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','update','then','get','ChatQueues','UserProfileResource','destroy','error','name','send','index','map','ChatQueue','rawAttributes','fieldName','type','key','getOptions','include','findAll','catch','show','params','model','keys','query','intersection','attributes','fields','includeAll','merge','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','describe','getMembers','findOne','UserChatQueue','filters','hasOwnProperty','nolimit','sort','where','User','UserId','chatPause','updatedAt','rows','format','%s/%s','createdAt','Team','order','pick','filter','getTeams','length','ids','online','voicePause','interface','flatMap','transaction','addTeams','each','findOrCreate','forEach','emit','removeTeams','select','field','tq.TeamId','from','team_has_chat_queues','join','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','Agents','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','TeamId','includes','all','union'];(function(_0x1a2f18,_0x400424){var _0x1a6a7f=function(_0x2022a2){while(--_0x2022a2){_0x1a2f18['push'](_0x1a2f18['shift']());}};_0x1a6a7f(++_0x400424);}(_0xdc2b,0x174));var _0xbdc2=function(_0xa6cc5c,_0x239c99){_0xa6cc5c=_0xa6cc5c-0x0;var _0x44803d=_0xdc2b[_0xa6cc5c];return _0x44803d;};'use strict';var BPromise=require(_0xbdc2('0x0'));var util=require(_0xbdc2('0x1'));var _=require('lodash');var squel=require('squel');var Redis=require(_0xbdc2('0x2'));var qs=require(_0xbdc2('0x3'));var logger=require(_0xbdc2('0x4'))(_0xbdc2('0x5'));var config=require(_0xbdc2('0x6'));var db=require('../../mysqldb')['db'];config[_0xbdc2('0x7')]=_[_0xbdc2('0x8')](config[_0xbdc2('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0xbdc2('0x9'))(new Redis(config['redis']));require('./chatQueue.socket')[_0xbdc2('0xa')](socket);function respondWithStatusCode(_0x565313,_0x15317d){_0x15317d=_0x15317d||0xcc;return function(_0x1ef8f6){if(_0x1ef8f6){return _0x565313[_0xbdc2('0xb')](_0x15317d);}return _0x565313[_0xbdc2('0xc')](_0x15317d)[_0xbdc2('0xd')]();};}function respondWithResult(_0x25b9bb,_0x511256){_0x511256=_0x511256||0xc8;return function(_0x45b01a){if(_0x45b01a){return _0x25b9bb[_0xbdc2('0xc')](_0x511256)['json'](_0x45b01a);}};}function respondWithFilteredResult(_0x6c5ce2,_0x4b2c81){return function(_0x5d4622){if(_0x5d4622){var _0x2e0521=typeof _0x4b2c81[_0xbdc2('0xe')]==='undefined'&&typeof _0x4b2c81[_0xbdc2('0xf')]===_0xbdc2('0x10');var _0x171014=_0x5d4622[_0xbdc2('0x11')];var _0xc0a6d7=_0x2e0521?0x0:_0x4b2c81[_0xbdc2('0xe')];var _0x4c8ae6=_0x2e0521?_0x5d4622[_0xbdc2('0x11')]:_0x4b2c81[_0xbdc2('0xe')]+_0x4b2c81['limit'];var _0x16837b;if(_0x4c8ae6>=_0x171014){_0x4c8ae6=_0x171014;_0x16837b=0xc8;}else{_0x16837b=0xce;}_0x6c5ce2[_0xbdc2('0xc')](_0x16837b);return _0x6c5ce2[_0xbdc2('0x12')](_0xbdc2('0x13'),_0xc0a6d7+'-'+_0x4c8ae6+'/'+_0x171014)[_0xbdc2('0x14')](_0x5d4622);}return null;};}function saveUpdates(_0xeba671){return function(_0x33f7ea){if(_0x33f7ea){return _0x33f7ea[_0xbdc2('0x15')](_0xeba671)[_0xbdc2('0x16')](function(_0x4222df){return _0x4222df;});}return null;};}function removeEntity(_0x2de6d1){return function(_0x10bcaa){if(_0x10bcaa){return _0x10bcaa['destroy']()[_0xbdc2('0x16')](function(){var _0x2782c1=_0x10bcaa[_0xbdc2('0x17')]({'plain':!![]});var _0x35ab99=_0xbdc2('0x18');return db[_0xbdc2('0x19')][_0xbdc2('0x1a')]({'where':{'type':_0x35ab99,'resourceId':_0x2782c1['id']}})['then'](function(){return _0x10bcaa;});})[_0xbdc2('0x16')](function(){_0x2de6d1[_0xbdc2('0xc')](0xcc)[_0xbdc2('0xd')]();});}};}function handleEntityNotFound(_0x3a5fda){return function(_0x59281f){if(!_0x59281f){_0x3a5fda['sendStatus'](0x194);}return _0x59281f;};}function handleError(_0x2cb1ba,_0x19cb96){_0x19cb96=_0x19cb96||0x1f4;return function(_0x4365a9){logger[_0xbdc2('0x1b')](_0x4365a9['stack']);if(_0x4365a9[_0xbdc2('0x1c')]){delete _0x4365a9[_0xbdc2('0x1c')];}_0x2cb1ba[_0xbdc2('0xc')](_0x19cb96)[_0xbdc2('0x1d')](_0x4365a9);};}exports[_0xbdc2('0x1e')]=function(_0x150981,_0x241a3b){var _0x265935={};var _0x1ab11d={'count':0x0,'rows':[]};var _0x646363=_[_0xbdc2('0x1f')](db[_0xbdc2('0x20')][_0xbdc2('0x21')],function(_0x347f06){return{'name':_0x347f06[_0xbdc2('0x22')],'type':_0x347f06[_0xbdc2('0x23')][_0xbdc2('0x24')]};});_0x265935=qs[_0xbdc2('0x25')](_0x646363,_0x150981);var _0x48798d={'where':_0x265935['where']};return db['ChatQueue']['count'](_0x48798d)['then'](function(_0xb13846){_0x1ab11d['count']=_0xb13846;_0x265935[_0xbdc2('0x26')]=qs[_0xbdc2('0x26')](_0x150981['query']);return db['ChatQueue'][_0xbdc2('0x27')](_0x265935);})['then'](function(_0x41133a){_0x1ab11d['rows']=_0x41133a;return _0x1ab11d;})[_0xbdc2('0x16')](respondWithFilteredResult(_0x241a3b,_0x265935))[_0xbdc2('0x28')](handleError(_0x241a3b,null));};exports[_0xbdc2('0x29')]=function(_0xdcade9,_0x941804){var _0x51cc40={'raw':!![],'where':{'id':_0xdcade9[_0xbdc2('0x2a')]['id']}},_0x39acd2={};_0x39acd2[_0xbdc2('0x2b')]=_[_0xbdc2('0x2c')](db['ChatQueue']['rawAttributes']);_0x39acd2['query']=_[_0xbdc2('0x2c')](_0xdcade9[_0xbdc2('0x2d')]);_0x39acd2['filters']=_[_0xbdc2('0x2e')](_0x39acd2['model'],_0x39acd2['query']);_0x51cc40[_0xbdc2('0x2f')]=_[_0xbdc2('0x2e')](_0x39acd2['model'],qs[_0xbdc2('0x30')](_0xdcade9[_0xbdc2('0x2d')]['fields']));_0x51cc40[_0xbdc2('0x2f')]=_0x51cc40[_0xbdc2('0x2f')]['length']?_0x51cc40[_0xbdc2('0x2f')]:_0x39acd2[_0xbdc2('0x2b')];if(_0xdcade9['query'][_0xbdc2('0x31')]){_0x51cc40[_0xbdc2('0x26')]=[{'all':!![]}];}_0x51cc40=_[_0xbdc2('0x32')]({},_0x51cc40,_0xdcade9[_0xbdc2('0x33')]);return db[_0xbdc2('0x20')][_0xbdc2('0x34')](_0x51cc40)[_0xbdc2('0x16')](handleEntityNotFound(_0x941804,null))['then'](respondWithResult(_0x941804,null))[_0xbdc2('0x28')](handleError(_0x941804,null));};exports[_0xbdc2('0x35')]=function(_0x4ef443,_0x37f176){return db['ChatQueue'][_0xbdc2('0x35')](_0x4ef443[_0xbdc2('0x36')],{})[_0xbdc2('0x16')](function(_0x29bddd){var _0x4b6aa3=_0x4ef443[_0xbdc2('0x37')][_0xbdc2('0x17')]({'plain':!![]});if(!_0x4b6aa3)throw new Error(_0xbdc2('0x38'));if(_0x4b6aa3['role']===_0xbdc2('0x37')){var _0x374382=_0x29bddd[_0xbdc2('0x17')]({'plain':!![]});var _0x373bea=_0xbdc2('0x18');return db['UserProfileSection'][_0xbdc2('0x34')]({'where':{'name':_0x373bea,'userProfileId':_0x4b6aa3['userProfileId']},'raw':!![]})[_0xbdc2('0x16')](function(_0x208fd0){if(_0x208fd0&&_0x208fd0[_0xbdc2('0x39')]===0x0){return db['UserProfileResource'][_0xbdc2('0x35')]({'name':_0x374382['name'],'resourceId':_0x374382['id'],'type':_0x208fd0[_0xbdc2('0x1c')],'sectionId':_0x208fd0['id']},{})[_0xbdc2('0x16')](function(){return _0x29bddd;});}else{return _0x29bddd;}})['catch'](function(_0x39fc26){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x39fc26);throw _0x39fc26;});}return _0x29bddd;})['then'](respondWithResult(_0x37f176,0xc9))[_0xbdc2('0x28')](handleError(_0x37f176,null));};exports[_0xbdc2('0x15')]=function(_0x2c67c3,_0x53687b){if(_0x2c67c3[_0xbdc2('0x36')]['id']){delete _0x2c67c3[_0xbdc2('0x36')]['id'];}return db[_0xbdc2('0x20')][_0xbdc2('0x34')]({'where':{'id':_0x2c67c3[_0xbdc2('0x2a')]['id']}})[_0xbdc2('0x16')](handleEntityNotFound(_0x53687b,null))[_0xbdc2('0x16')](saveUpdates(_0x2c67c3['body'],null))[_0xbdc2('0x16')](respondWithResult(_0x53687b,null))['catch'](handleError(_0x53687b,null));};exports[_0xbdc2('0x1a')]=function(_0xb20a1,_0x280b24){return db[_0xbdc2('0x20')][_0xbdc2('0x34')]({'where':{'id':_0xb20a1['params']['id']}})[_0xbdc2('0x16')](handleEntityNotFound(_0x280b24,null))[_0xbdc2('0x16')](removeEntity(_0x280b24,null))[_0xbdc2('0x28')](handleError(_0x280b24,null));};exports[_0xbdc2('0x3a')]=function(_0x4b6d1e,_0x5a6d47){return db['ChatQueue'][_0xbdc2('0x3a')]()[_0xbdc2('0x16')](respondWithResult(_0x5a6d47,null))[_0xbdc2('0x28')](handleError(_0x5a6d47,null));};exports[_0xbdc2('0x3b')]=function(_0x33bc0f,_0x3733d4){var _0x266c61={'raw':!![],'where':{}},_0x5aa5e1={},_0xc6be87;return db[_0xbdc2('0x20')][_0xbdc2('0x3c')]({'where':{'id':_0x33bc0f['params']['id']}})[_0xbdc2('0x16')](handleEntityNotFound(_0x3733d4,null))[_0xbdc2('0x16')](function(_0x152f3e){if(_0x152f3e){_0xc6be87=_0x152f3e[_0xbdc2('0x17')]({'plain':!![]});_0x5aa5e1[_0xbdc2('0x2b')]=_[_0xbdc2('0x2c')](db[_0xbdc2('0x3d')][_0xbdc2('0x21')]);_0x5aa5e1[_0xbdc2('0x2d')]=_[_0xbdc2('0x2c')](_0x33bc0f[_0xbdc2('0x2d')]);_0x5aa5e1[_0xbdc2('0x3e')]=_['intersection'](_0x5aa5e1[_0xbdc2('0x2b')],_0x5aa5e1[_0xbdc2('0x2d')]);_0x266c61['attributes']=_[_0xbdc2('0x2e')](_0x5aa5e1[_0xbdc2('0x2b')],qs['fields'](_0x33bc0f[_0xbdc2('0x2d')][_0xbdc2('0x30')]));_0x266c61[_0xbdc2('0x2f')]=_0x266c61['attributes']['length']?_0x266c61[_0xbdc2('0x2f')]:_0x5aa5e1['model'];if(!_0x33bc0f[_0xbdc2('0x2d')][_0xbdc2('0x3f')](_0xbdc2('0x40'))){_0x266c61[_0xbdc2('0xf')]=qs[_0xbdc2('0xf')](_0x33bc0f[_0xbdc2('0x2d')][_0xbdc2('0xf')]);_0x266c61['offset']=qs[_0xbdc2('0xe')](_0x33bc0f['query'][_0xbdc2('0xe')]);}_0x266c61['order']=qs[_0xbdc2('0x41')](_0x33bc0f[_0xbdc2('0x2d')][_0xbdc2('0x41')]);_0x266c61[_0xbdc2('0x42')]=qs[_0xbdc2('0x3e')](_['pick'](_0x33bc0f[_0xbdc2('0x2d')],_0x5aa5e1[_0xbdc2('0x3e')]));_0x266c61[_0xbdc2('0x42')]['ChatQueueId']=_0x152f3e['id'];if(_0x33bc0f[_0xbdc2('0x2d')]['filter']){_0x266c61[_0xbdc2('0x42')]=_[_0xbdc2('0x32')](_0x266c61[_0xbdc2('0x42')],{'$or':_[_0xbdc2('0x1f')](_0x266c61[_0xbdc2('0x2f')],function(_0x3da852){var _0x3c64a0={};_0x3c64a0[_0x3da852]={'$like':'%'+_0x33bc0f['query']['filter']+'%'};return _0x3c64a0;})});}_0x266c61=_[_0xbdc2('0x32')]({},_0x266c61,_0x33bc0f[_0xbdc2('0x33')]);return db[_0xbdc2('0x3d')]['findAll'](_0x266c61);}})[_0xbdc2('0x16')](function(_0x887ca4){if(_0x887ca4){return db[_0xbdc2('0x43')]['findAndCountAll']({'where':{'id':_[_0xbdc2('0x1f')](_0x887ca4,_0xbdc2('0x44')),'role':'agent'},'attributes':['id',_0xbdc2('0x1c'),_0xbdc2('0x45'),_0xbdc2('0x46'),'createdAt']});}})[_0xbdc2('0x16')](function(_0x58242a){if(_0x58242a){return{'count':_0x58242a['count'],'rows':_[_0xbdc2('0x1f')](_0x58242a[_0xbdc2('0x47')],function(_0x43eff1){return{'membername':_0x43eff1['name'],'UserId':_0x43eff1['id'],'queue_name':_0xc6be87[_0xbdc2('0x1c')],'ChatQueueId':_0xc6be87['id'],'interface':util[_0xbdc2('0x48')](_0xbdc2('0x49'),'SIP',_0x43eff1[_0xbdc2('0x1c')]),'penalty':0x0,'paused':_0x43eff1['chatPause'],'createdAt':_0x43eff1[_0xbdc2('0x4a')],'updatedAt':_0x43eff1[_0xbdc2('0x46')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xbdc2('0x16')](respondWithFilteredResult(_0x3733d4,_0x266c61))[_0xbdc2('0x28')](handleError(_0x3733d4,null));};exports['getTeams']=function(_0x362f58,_0x2a6ba3){var _0xb19c24={};var _0x5681a9={};var _0x5be75c;var _0x1289d1;return db[_0xbdc2('0x20')][_0xbdc2('0x3c')]({'where':{'id':_0x362f58['params']['id']}})['then'](handleEntityNotFound(_0x2a6ba3,null))[_0xbdc2('0x16')](function(_0x56780){if(_0x56780){_0x5be75c=_0x56780;_0x5681a9['model']=_[_0xbdc2('0x2c')](db[_0xbdc2('0x4b')][_0xbdc2('0x21')]);_0x5681a9[_0xbdc2('0x2d')]=_['keys'](_0x362f58['query']);_0x5681a9[_0xbdc2('0x3e')]=_['intersection'](_0x5681a9[_0xbdc2('0x2b')],_0x5681a9[_0xbdc2('0x2d')]);_0xb19c24[_0xbdc2('0x2f')]=_['intersection'](_0x5681a9[_0xbdc2('0x2b')],qs[_0xbdc2('0x30')](_0x362f58['query'][_0xbdc2('0x30')]));_0xb19c24[_0xbdc2('0x2f')]=_0xb19c24[_0xbdc2('0x2f')]['length']?_0xb19c24[_0xbdc2('0x2f')]:_0x5681a9[_0xbdc2('0x2b')];_0xb19c24[_0xbdc2('0x4c')]=qs[_0xbdc2('0x41')](_0x362f58[_0xbdc2('0x2d')][_0xbdc2('0x41')]);_0xb19c24[_0xbdc2('0x42')]=qs[_0xbdc2('0x3e')](_[_0xbdc2('0x4d')](_0x362f58[_0xbdc2('0x2d')],_0x5681a9[_0xbdc2('0x3e')]));if(_0x362f58['query'][_0xbdc2('0x4e')]){_0xb19c24['where']=_[_0xbdc2('0x32')](_0xb19c24[_0xbdc2('0x42')],{'$or':_['map'](_0xb19c24[_0xbdc2('0x2f')],function(_0x2aa285){var _0x357539={};_0x357539[_0x2aa285]={'$like':'%'+_0x362f58['query'][_0xbdc2('0x4e')]+'%'};return _0x357539;})});}_0xb19c24=_[_0xbdc2('0x32')]({},_0xb19c24,_0x362f58[_0xbdc2('0x33')]);return _0x5be75c[_0xbdc2('0x4f')](_0xb19c24);}})[_0xbdc2('0x16')](function(_0x21faf8){if(_0x21faf8){_0x1289d1=_0x21faf8[_0xbdc2('0x50')];if(!_0x362f58[_0xbdc2('0x2d')][_0xbdc2('0x3f')](_0xbdc2('0x40'))){_0xb19c24[_0xbdc2('0xf')]=qs[_0xbdc2('0xf')](_0x362f58['query']['limit']);_0xb19c24[_0xbdc2('0xe')]=qs[_0xbdc2('0xe')](_0x362f58[_0xbdc2('0x2d')][_0xbdc2('0xe')]);}return _0x5be75c['getTeams'](_0xb19c24);}})[_0xbdc2('0x16')](function(_0x4962b8){if(_0x4962b8){return _0x4962b8?{'count':_0x1289d1,'rows':_0x4962b8}:null;}})['then'](respondWithResult(_0x2a6ba3,null))[_0xbdc2('0x28')](handleError(_0x2a6ba3,null));};exports['addTeams']=function(_0x34a0f8,_0x4e2c2d){var _0x24fbfa=_0x34a0f8['body'][_0xbdc2('0x51')];return db[_0xbdc2('0x4b')]['findAll']({'where':{'id':_0x24fbfa},'attributes':['id'],'include':[{'model':db[_0xbdc2('0x43')],'as':'Agents','attributes':['id',_0xbdc2('0x1c'),_0xbdc2('0x52'),_0xbdc2('0x53'),_0xbdc2('0x54')],'raw':!![]}]})[_0xbdc2('0x16')](function(_0x33b504){if(_0x33b504){var _0xc48eb6=_[_0xbdc2('0x55')](_0x33b504,function(_0x3ca6a1){var _0x44d04e=_0x3ca6a1[_0xbdc2('0x17')]({'plain':!![]});return _0x44d04e['Agents'];});return db[_0xbdc2('0x20')][_0xbdc2('0x34')]({'where':{'id':_0x34a0f8[_0xbdc2('0x2a')]['id']}})[_0xbdc2('0x16')](function(_0x458979){return db['sequelize'][_0xbdc2('0x56')](function(_0x5b63df){return _0x458979[_0xbdc2('0x57')](_0x24fbfa,{'transaction':_0x5b63df})[_0xbdc2('0x16')](function(){return BPromise[_0xbdc2('0x58')](_0xc48eb6,function(_0x1d5ed2){return db[_0xbdc2('0x3d')][_0xbdc2('0x59')]({'where':{'UserId':_0x1d5ed2['id'],'ChatQueueId':_0x34a0f8[_0xbdc2('0x2a')]['id']},'transaction':_0x5b63df});});})[_0xbdc2('0x16')](function(){_0xc48eb6[_0xbdc2('0x5a')](function(_0x3fb7f1){socket[_0xbdc2('0x5b')]('userChatQueue:save',{'UserId':_0x3fb7f1['id'],'ChatQueueId':_0x458979['id']});});});});});}})[_0xbdc2('0x16')](respondWithStatusCode(_0x4e2c2d,null))['catch'](handleError(_0x4e2c2d,null));};exports[_0xbdc2('0x5c')]=function(_0x30700f,_0x182cae){return db[_0xbdc2('0x4b')]['findAll']({'where':{'id':_0x30700f[_0xbdc2('0x2d')][_0xbdc2('0x51')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x182cae,null))['then'](function(_0x292e79){var _0xecf9d7=_[_0xbdc2('0x1f')](_0x292e79,'id');var _0x32b137=[];var _0x17303c=[];var _0x448ad6=squel[_0xbdc2('0x5d')]();_0x448ad6[_0xbdc2('0x5e')](_0xbdc2('0x5f'))[_0xbdc2('0x60')](_0xbdc2('0x61'),'tq')[_0xbdc2('0x62')]('user_has_teams','ut',_0xbdc2('0x63'))['where'](_0xbdc2('0x64'),_0x30700f[_0xbdc2('0x2a')]['id']);for(var _0x3cf7d9=0x0;_0x3cf7d9<_0x292e79[_0xbdc2('0x50')];_0x3cf7d9+=0x1){let _0x2cfcbf=_0x292e79[_0x3cf7d9];for(var _0x73afe1=0x0;_0x73afe1<_0x2cfcbf[_0xbdc2('0x65')][_0xbdc2('0x50')];_0x73afe1+=0x1){let _0x21d9e0=_0x2cfcbf[_0xbdc2('0x65')][_0x73afe1];var _0x2a2aa4=_0x448ad6['clone']();_0x2a2aa4['where'](_0xbdc2('0x66'),_0x21d9e0['id']);_0x17303c[_0xbdc2('0x67')](db[_0xbdc2('0x68')][_0xbdc2('0x2d')](_0x2a2aa4[_0xbdc2('0x69')](),{'type':db[_0xbdc2('0x68')][_0xbdc2('0x6a')][_0xbdc2('0x6b')]})[_0xbdc2('0x16')](function(_0x1e8cab){if(_0x1e8cab[_0xbdc2('0x50')]===0x1){return _0x21d9e0['id'];}else{var _0x3b48e5=_['every'](_['map'](_0x1e8cab,_0xbdc2('0x6c')),function(_0x46fc79){return _[_0xbdc2('0x6d')](_0xecf9d7,_0x46fc79);});if(_0x3b48e5){return _0x21d9e0['id'];}}}));}}return BPromise[_0xbdc2('0x6e')](_0x17303c)[_0xbdc2('0x16')](function(_0x21dd49){_0x32b137=_(_0x32b137)[_0xbdc2('0x6f')](_0x21dd49)[_0xbdc2('0x70')]()[_0xbdc2('0x71')]();return db[_0xbdc2('0x20')][_0xbdc2('0x34')]({'where':{'id':_0x30700f['params']['id']}})[_0xbdc2('0x16')](function(_0x4df595){return db['sequelize']['transaction'](function(_0x39d64f){return _0x4df595[_0xbdc2('0x5c')](_0x30700f[_0xbdc2('0x2d')]['ids'],{'transaction':_0x39d64f})[_0xbdc2('0x16')](function(){if(!_['isEmpty'](_0x32b137)){return _0x4df595[_0xbdc2('0x72')](_0x32b137,{'transaction':_0x39d64f});}})[_0xbdc2('0x16')](function(){_0x32b137[_0xbdc2('0x5a')](function(_0x4a941a){socket[_0xbdc2('0x5b')](_0xbdc2('0x73'),{'UserId':_0x4a941a,'ChatQueueId':_0x4df595['id']});});});});});});})[_0xbdc2('0x16')](respondWithStatusCode(_0x182cae,null))[_0xbdc2('0x28')](handleError(_0x182cae,null));};exports[_0xbdc2('0x74')]=function(_0x22b82,_0x1cd65c){return db[_0xbdc2('0x20')][_0xbdc2('0x34')]({'where':{'id':_0x22b82[_0xbdc2('0x2a')]['id']}})[_0xbdc2('0x16')](handleEntityNotFound(_0x1cd65c,null))[_0xbdc2('0x16')](function(_0x58937a){if(_0x58937a){return _0x58937a['addAgents'](_0x22b82[_0xbdc2('0x36')]['ids'],_[_0xbdc2('0x75')](_0x22b82[_0xbdc2('0x36')],[_0xbdc2('0x51'),'id'])||{})['spread'](function(_0xd0e7ac){for(var _0x1b41c5=0x0;_0x1b41c5<_0x22b82[_0xbdc2('0x36')][_0xbdc2('0x51')][_0xbdc2('0x50')];_0x1b41c5+=0x1){socket['emit'](_0xbdc2('0x76'),{'UserId':Number(_0x22b82[_0xbdc2('0x36')]['ids'][_0x1b41c5]),'ChatQueueId':Number(_0x22b82[_0xbdc2('0x2a')]['id'])});}return _0xd0e7ac;});}})['then'](respondWithResult(_0x1cd65c,null))[_0xbdc2('0x28')](handleError(_0x1cd65c,null));};exports[_0xbdc2('0x72')]=function(_0x22bc7b,_0x3c4822){return db[_0xbdc2('0x20')][_0xbdc2('0x34')]({'where':{'id':_0x22bc7b[_0xbdc2('0x2a')]['id']}})[_0xbdc2('0x16')](handleEntityNotFound(_0x3c4822,null))[_0xbdc2('0x16')](function(_0x309ddc){if(_0x309ddc){return _0x309ddc[_0xbdc2('0x72')](_0x22bc7b[_0xbdc2('0x2d')][_0xbdc2('0x51')])[_0xbdc2('0x16')](function(){if(_[_0xbdc2('0x77')](_0x22bc7b['query'][_0xbdc2('0x51')])){for(var _0x322c57=0x0;_0x322c57<_0x22bc7b[_0xbdc2('0x2d')][_0xbdc2('0x51')][_0xbdc2('0x50')];_0x322c57+=0x1){socket[_0xbdc2('0x5b')](_0xbdc2('0x73'),{'UserId':Number(_0x22bc7b['query'][_0xbdc2('0x51')][_0x322c57]),'ChatQueueId':Number(_0x22bc7b['params']['id'])});}}else{socket[_0xbdc2('0x5b')](_0xbdc2('0x73'),{'UserId':Number(_0x22bc7b[_0xbdc2('0x2d')][_0xbdc2('0x51')]),'ChatQueueId':Number(_0x22bc7b[_0xbdc2('0x2a')]['id'])});}});}})[_0xbdc2('0x16')](respondWithStatusCode(_0x3c4822,null))[_0xbdc2('0x28')](handleError(_0x3c4822,null));};exports['getAgents']=function(_0x18d501,_0x1eda3a){var _0x3948aa={};var _0x22b9c8={};var _0x178d7;var _0x49940b;return db[_0xbdc2('0x20')][_0xbdc2('0x3c')]({'where':{'id':_0x18d501['params']['id']}})[_0xbdc2('0x16')](handleEntityNotFound(_0x1eda3a,null))['then'](function(_0x2e09dc){if(_0x2e09dc){_0x178d7=_0x2e09dc;_0x22b9c8[_0xbdc2('0x2b')]=_[_0xbdc2('0x2c')](db[_0xbdc2('0x43')][_0xbdc2('0x21')]);_0x22b9c8[_0xbdc2('0x2d')]=_['keys'](_0x18d501[_0xbdc2('0x2d')]);_0x22b9c8[_0xbdc2('0x3e')]=_[_0xbdc2('0x2e')](_0x22b9c8['model'],_0x22b9c8['query']);_0x3948aa['attributes']=_[_0xbdc2('0x2e')](_0x22b9c8[_0xbdc2('0x2b')],qs[_0xbdc2('0x30')](_0x18d501[_0xbdc2('0x2d')][_0xbdc2('0x30')]));_0x3948aa[_0xbdc2('0x2f')]=_0x3948aa[_0xbdc2('0x2f')]['length']?_0x3948aa[_0xbdc2('0x2f')]:_0x22b9c8[_0xbdc2('0x2b')];_0x3948aa[_0xbdc2('0x4c')]=qs[_0xbdc2('0x41')](_0x18d501[_0xbdc2('0x2d')][_0xbdc2('0x41')]);_0x3948aa[_0xbdc2('0x42')]=qs['filters'](_[_0xbdc2('0x4d')](_0x18d501['query'],_0x22b9c8[_0xbdc2('0x3e')]));if(_0x18d501['query'][_0xbdc2('0x4e')]){_0x3948aa[_0xbdc2('0x42')]=_[_0xbdc2('0x32')](_0x3948aa[_0xbdc2('0x42')],{'$or':_['map'](_0x3948aa['attributes'],function(_0x4157c6){var _0xbe3097={};_0xbe3097[_0x4157c6]={'$like':'%'+_0x18d501[_0xbdc2('0x2d')]['filter']+'%'};return _0xbe3097;})});}_0x3948aa=_[_0xbdc2('0x32')]({},_0x3948aa,_0x18d501['options']);return _0x178d7['getAgents'](_0x3948aa);}})[_0xbdc2('0x16')](function(_0x5f2672){if(_0x5f2672){_0x49940b=_0x5f2672[_0xbdc2('0x50')];if(!_0x18d501[_0xbdc2('0x2d')][_0xbdc2('0x3f')](_0xbdc2('0x40'))){_0x3948aa['limit']=qs[_0xbdc2('0xf')](_0x18d501[_0xbdc2('0x2d')]['limit']);_0x3948aa[_0xbdc2('0xe')]=qs[_0xbdc2('0xe')](_0x18d501['query'][_0xbdc2('0xe')]);}return _0x178d7[_0xbdc2('0x78')](_0x3948aa);}})[_0xbdc2('0x16')](function(_0x315cba){if(_0x315cba){return _0x315cba?{'count':_0x49940b,'rows':_0x315cba}:null;}})[_0xbdc2('0x16')](respondWithResult(_0x1eda3a,null))[_0xbdc2('0x28')](handleError(_0x1eda3a,null));}; \ No newline at end of file +var _0xdf87=['index','map','ChatQueue','rawAttributes','fieldName','type','key','where','include','query','findAll','params','model','keys','filters','intersection','fields','attributes','length','includeAll','merge','options','find','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserChatQueue','nolimit','order','sort','pick','ChatQueueId','filter','User','findAndCountAll','UserId','agent','chatPause','updatedAt','createdAt','rows','format','%s/%s','SIP','getTeams','Team','addTeams','ids','online','voicePause','Agents','transaction','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_chat_queues','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','QueryTypes','SELECT','TeamId','includes','union','compact','value','isEmpty','userChatQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','hasOwnProperty','bluebird','util','squel','../../config/logger','../../config/environment','redis','defaults','socket.io-emitter','./chatQueue.socket','register','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','ChatQueues','UserProfileResource','error','stack','name'];(function(_0x2794e4,_0x11bcf6){var _0xf860d4=function(_0x1ef56e){while(--_0x1ef56e){_0x2794e4['push'](_0x2794e4['shift']());}};_0xf860d4(++_0x11bcf6);}(_0xdf87,0x14a));var _0x7df8=function(_0x15c0dd,_0x5dcc24){_0x15c0dd=_0x15c0dd-0x0;var _0x4a0d6d=_0xdf87[_0x15c0dd];return _0x4a0d6d;};'use strict';var BPromise=require(_0x7df8('0x0'));var util=require(_0x7df8('0x1'));var _=require('lodash');var squel=require(_0x7df8('0x2'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0x7df8('0x3'))('api');var config=require(_0x7df8('0x4'));var db=require('../../mysqldb')['db'];config[_0x7df8('0x5')]=_[_0x7df8('0x6')](config[_0x7df8('0x5')],{'host':'localhost','port':0x18eb});var socket=require(_0x7df8('0x7'))(new Redis(config[_0x7df8('0x5')]));require(_0x7df8('0x8'))[_0x7df8('0x9')](socket);function respondWithStatusCode(_0x41c3d9,_0x4bcad8){_0x4bcad8=_0x4bcad8||0xcc;return function(_0x14a38c){if(_0x14a38c){return _0x41c3d9['sendStatus'](_0x4bcad8);}return _0x41c3d9[_0x7df8('0xa')](_0x4bcad8)[_0x7df8('0xb')]();};}function respondWithResult(_0x136119,_0x3f2154){_0x3f2154=_0x3f2154||0xc8;return function(_0x41eeec){if(_0x41eeec){return _0x136119[_0x7df8('0xa')](_0x3f2154)[_0x7df8('0xc')](_0x41eeec);}};}function respondWithFilteredResult(_0x814a7,_0x2494db){return function(_0x116cb9){if(_0x116cb9){var _0x57cd20=typeof _0x2494db[_0x7df8('0xd')]===_0x7df8('0xe')&&typeof _0x2494db[_0x7df8('0xf')]===_0x7df8('0xe');var _0x43d424=_0x116cb9[_0x7df8('0x10')];var _0xfaac8b=_0x57cd20?0x0:_0x2494db['offset'];var _0x3b7b80=_0x57cd20?_0x116cb9['count']:_0x2494db[_0x7df8('0xd')]+_0x2494db[_0x7df8('0xf')];var _0x3b76bb;if(_0x3b7b80>=_0x43d424){_0x3b7b80=_0x43d424;_0x3b76bb=0xc8;}else{_0x3b76bb=0xce;}_0x814a7[_0x7df8('0xa')](_0x3b76bb);return _0x814a7[_0x7df8('0x11')](_0x7df8('0x12'),_0xfaac8b+'-'+_0x3b7b80+'/'+_0x43d424)['json'](_0x116cb9);}return null;};}function saveUpdates(_0x26ff58){return function(_0x1cf5ec){if(_0x1cf5ec){return _0x1cf5ec[_0x7df8('0x13')](_0x26ff58)[_0x7df8('0x14')](function(_0x25235e){return _0x25235e;});}return null;};}function removeEntity(_0x20a61c){return function(_0x13503f){if(_0x13503f){return _0x13503f[_0x7df8('0x15')]()[_0x7df8('0x14')](function(){var _0x23a45b=_0x13503f['get']({'plain':!![]});var _0x215042=_0x7df8('0x16');return db[_0x7df8('0x17')][_0x7df8('0x15')]({'where':{'type':_0x215042,'resourceId':_0x23a45b['id']}})[_0x7df8('0x14')](function(){return _0x13503f;});})['then'](function(){_0x20a61c['status'](0xcc)[_0x7df8('0xb')]();});}};}function handleEntityNotFound(_0x3c2da9){return function(_0xb6d3f0){if(!_0xb6d3f0){_0x3c2da9['sendStatus'](0x194);}return _0xb6d3f0;};}function handleError(_0x11ed17,_0x351135){_0x351135=_0x351135||0x1f4;return function(_0x59d95b){logger[_0x7df8('0x18')](_0x59d95b[_0x7df8('0x19')]);if(_0x59d95b[_0x7df8('0x1a')]){delete _0x59d95b['name'];}_0x11ed17['status'](_0x351135)['send'](_0x59d95b);};}exports[_0x7df8('0x1b')]=function(_0x4fb9f5,_0x309f34){var _0x46adbd={};var _0x5c2600={'count':0x0,'rows':[]};var _0x4af6d3=_[_0x7df8('0x1c')](db[_0x7df8('0x1d')][_0x7df8('0x1e')],function(_0x583739){return{'name':_0x583739[_0x7df8('0x1f')],'type':_0x583739[_0x7df8('0x20')][_0x7df8('0x21')]};});_0x46adbd=qs['getOptions'](_0x4af6d3,_0x4fb9f5);var _0x1b6f90={'where':_0x46adbd[_0x7df8('0x22')]};return db[_0x7df8('0x1d')][_0x7df8('0x10')](_0x1b6f90)[_0x7df8('0x14')](function(_0x15a6b0){_0x5c2600[_0x7df8('0x10')]=_0x15a6b0;_0x46adbd[_0x7df8('0x23')]=qs[_0x7df8('0x23')](_0x4fb9f5[_0x7df8('0x24')]);return db[_0x7df8('0x1d')][_0x7df8('0x25')](_0x46adbd);})[_0x7df8('0x14')](function(_0x2653db){_0x5c2600['rows']=_0x2653db;return _0x5c2600;})[_0x7df8('0x14')](respondWithFilteredResult(_0x309f34,_0x46adbd))['catch'](handleError(_0x309f34,null));};exports['show']=function(_0x2cf751,_0x5d6a2e){var _0x22f9d1={'raw':!![],'where':{'id':_0x2cf751[_0x7df8('0x26')]['id']}},_0xa6e745={};_0xa6e745[_0x7df8('0x27')]=_[_0x7df8('0x28')](db['ChatQueue'][_0x7df8('0x1e')]);_0xa6e745[_0x7df8('0x24')]=_[_0x7df8('0x28')](_0x2cf751[_0x7df8('0x24')]);_0xa6e745[_0x7df8('0x29')]=_[_0x7df8('0x2a')](_0xa6e745['model'],_0xa6e745[_0x7df8('0x24')]);_0x22f9d1['attributes']=_[_0x7df8('0x2a')](_0xa6e745['model'],qs[_0x7df8('0x2b')](_0x2cf751[_0x7df8('0x24')][_0x7df8('0x2b')]));_0x22f9d1['attributes']=_0x22f9d1[_0x7df8('0x2c')][_0x7df8('0x2d')]?_0x22f9d1[_0x7df8('0x2c')]:_0xa6e745['model'];if(_0x2cf751['query'][_0x7df8('0x2e')]){_0x22f9d1[_0x7df8('0x23')]=[{'all':!![]}];}_0x22f9d1=_[_0x7df8('0x2f')]({},_0x22f9d1,_0x2cf751[_0x7df8('0x30')]);return db[_0x7df8('0x1d')][_0x7df8('0x31')](_0x22f9d1)[_0x7df8('0x14')](handleEntityNotFound(_0x5d6a2e,null))[_0x7df8('0x14')](respondWithResult(_0x5d6a2e,null))[_0x7df8('0x32')](handleError(_0x5d6a2e,null));};exports[_0x7df8('0x33')]=function(_0x2e0fc9,_0x591239){return db[_0x7df8('0x1d')]['create'](_0x2e0fc9[_0x7df8('0x34')],{})[_0x7df8('0x14')](function(_0x31f646){var _0x187a06=_0x2e0fc9[_0x7df8('0x35')][_0x7df8('0x36')]({'plain':!![]});if(!_0x187a06)throw new Error(_0x7df8('0x37'));if(_0x187a06['role']===_0x7df8('0x35')){var _0x3a64c4=_0x31f646[_0x7df8('0x36')]({'plain':!![]});var _0x5219f6=_0x7df8('0x16');return db['UserProfileSection']['find']({'where':{'name':_0x5219f6,'userProfileId':_0x187a06[_0x7df8('0x38')]},'raw':!![]})['then'](function(_0x3ebef1){if(_0x3ebef1&&_0x3ebef1[_0x7df8('0x39')]===0x0){return db[_0x7df8('0x17')][_0x7df8('0x33')]({'name':_0x3a64c4['name'],'resourceId':_0x3a64c4['id'],'type':_0x3ebef1[_0x7df8('0x1a')],'sectionId':_0x3ebef1['id']},{})[_0x7df8('0x14')](function(){return _0x31f646;});}else{return _0x31f646;}})[_0x7df8('0x32')](function(_0x112b61){logger[_0x7df8('0x18')](_0x7df8('0x3a'),_0x112b61);throw _0x112b61;});}return _0x31f646;})[_0x7df8('0x14')](respondWithResult(_0x591239,0xc9))[_0x7df8('0x32')](handleError(_0x591239,null));};exports[_0x7df8('0x13')]=function(_0xda559f,_0x2c33e7){if(_0xda559f['body']['id']){delete _0xda559f[_0x7df8('0x34')]['id'];}return db['ChatQueue'][_0x7df8('0x31')]({'where':{'id':_0xda559f['params']['id']}})['then'](handleEntityNotFound(_0x2c33e7,null))[_0x7df8('0x14')](saveUpdates(_0xda559f['body'],null))['then'](respondWithResult(_0x2c33e7,null))[_0x7df8('0x32')](handleError(_0x2c33e7,null));};exports['destroy']=function(_0x210191,_0x416555){return db['ChatQueue'][_0x7df8('0x31')]({'where':{'id':_0x210191[_0x7df8('0x26')]['id']}})[_0x7df8('0x14')](handleEntityNotFound(_0x416555,null))['then'](removeEntity(_0x416555,null))[_0x7df8('0x32')](handleError(_0x416555,null));};exports[_0x7df8('0x3b')]=function(_0x1ac2e0,_0x78f40f){return db[_0x7df8('0x1d')][_0x7df8('0x3b')]()[_0x7df8('0x14')](respondWithResult(_0x78f40f,null))['catch'](handleError(_0x78f40f,null));};exports[_0x7df8('0x3c')]=function(_0x4a474f,_0x31f8e7){var _0x4ff4b4={'raw':!![],'where':{}},_0x1f3552={},_0x46bb4e;return db[_0x7df8('0x1d')][_0x7df8('0x3d')]({'where':{'id':_0x4a474f[_0x7df8('0x26')]['id']}})['then'](handleEntityNotFound(_0x31f8e7,null))[_0x7df8('0x14')](function(_0x1b9537){if(_0x1b9537){_0x46bb4e=_0x1b9537['get']({'plain':!![]});_0x1f3552['model']=_[_0x7df8('0x28')](db[_0x7df8('0x3e')][_0x7df8('0x1e')]);_0x1f3552[_0x7df8('0x24')]=_['keys'](_0x4a474f[_0x7df8('0x24')]);_0x1f3552[_0x7df8('0x29')]=_[_0x7df8('0x2a')](_0x1f3552[_0x7df8('0x27')],_0x1f3552[_0x7df8('0x24')]);_0x4ff4b4[_0x7df8('0x2c')]=_[_0x7df8('0x2a')](_0x1f3552[_0x7df8('0x27')],qs['fields'](_0x4a474f['query']['fields']));_0x4ff4b4['attributes']=_0x4ff4b4[_0x7df8('0x2c')][_0x7df8('0x2d')]?_0x4ff4b4[_0x7df8('0x2c')]:_0x1f3552['model'];if(!_0x4a474f[_0x7df8('0x24')]['hasOwnProperty'](_0x7df8('0x3f'))){_0x4ff4b4[_0x7df8('0xf')]=qs[_0x7df8('0xf')](_0x4a474f[_0x7df8('0x24')][_0x7df8('0xf')]);_0x4ff4b4['offset']=qs[_0x7df8('0xd')](_0x4a474f[_0x7df8('0x24')][_0x7df8('0xd')]);}_0x4ff4b4[_0x7df8('0x40')]=qs[_0x7df8('0x41')](_0x4a474f[_0x7df8('0x24')][_0x7df8('0x41')]);_0x4ff4b4[_0x7df8('0x22')]=qs['filters'](_[_0x7df8('0x42')](_0x4a474f[_0x7df8('0x24')],_0x1f3552['filters']));_0x4ff4b4[_0x7df8('0x22')][_0x7df8('0x43')]=_0x1b9537['id'];if(_0x4a474f[_0x7df8('0x24')]['filter']){_0x4ff4b4['where']=_['merge'](_0x4ff4b4[_0x7df8('0x22')],{'$or':_[_0x7df8('0x1c')](_0x4ff4b4[_0x7df8('0x2c')],function(_0x34e9df){var _0x57548f={};_0x57548f[_0x34e9df]={'$like':'%'+_0x4a474f[_0x7df8('0x24')][_0x7df8('0x44')]+'%'};return _0x57548f;})});}_0x4ff4b4=_[_0x7df8('0x2f')]({},_0x4ff4b4,_0x4a474f['options']);return db['UserChatQueue']['findAll'](_0x4ff4b4);}})[_0x7df8('0x14')](function(_0x920684){if(_0x920684){return db[_0x7df8('0x45')][_0x7df8('0x46')]({'where':{'id':_[_0x7df8('0x1c')](_0x920684,_0x7df8('0x47')),'role':_0x7df8('0x48')},'attributes':['id','name',_0x7df8('0x49'),_0x7df8('0x4a'),_0x7df8('0x4b')]});}})['then'](function(_0x1ed50e){if(_0x1ed50e){return{'count':_0x1ed50e['count'],'rows':_[_0x7df8('0x1c')](_0x1ed50e[_0x7df8('0x4c')],function(_0x11817f){return{'membername':_0x11817f['name'],'UserId':_0x11817f['id'],'queue_name':_0x46bb4e[_0x7df8('0x1a')],'ChatQueueId':_0x46bb4e['id'],'interface':util[_0x7df8('0x4d')](_0x7df8('0x4e'),_0x7df8('0x4f'),_0x11817f['name']),'penalty':0x0,'paused':_0x11817f[_0x7df8('0x49')],'createdAt':_0x11817f[_0x7df8('0x4b')],'updatedAt':_0x11817f[_0x7df8('0x4a')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x31f8e7,_0x4ff4b4))[_0x7df8('0x32')](handleError(_0x31f8e7,null));};exports[_0x7df8('0x50')]=function(_0x43c0a2,_0x59ea15){var _0x14b7c4={};var _0x5c7cde={};var _0x27d30a;var _0x1b0167;return db[_0x7df8('0x1d')]['findOne']({'where':{'id':_0x43c0a2['params']['id']}})[_0x7df8('0x14')](handleEntityNotFound(_0x59ea15,null))['then'](function(_0x1af887){if(_0x1af887){_0x27d30a=_0x1af887;_0x5c7cde[_0x7df8('0x27')]=_[_0x7df8('0x28')](db[_0x7df8('0x51')][_0x7df8('0x1e')]);_0x5c7cde[_0x7df8('0x24')]=_[_0x7df8('0x28')](_0x43c0a2[_0x7df8('0x24')]);_0x5c7cde[_0x7df8('0x29')]=_[_0x7df8('0x2a')](_0x5c7cde[_0x7df8('0x27')],_0x5c7cde['query']);_0x14b7c4['attributes']=_[_0x7df8('0x2a')](_0x5c7cde[_0x7df8('0x27')],qs[_0x7df8('0x2b')](_0x43c0a2[_0x7df8('0x24')][_0x7df8('0x2b')]));_0x14b7c4['attributes']=_0x14b7c4[_0x7df8('0x2c')][_0x7df8('0x2d')]?_0x14b7c4[_0x7df8('0x2c')]:_0x5c7cde['model'];_0x14b7c4[_0x7df8('0x40')]=qs[_0x7df8('0x41')](_0x43c0a2[_0x7df8('0x24')][_0x7df8('0x41')]);_0x14b7c4[_0x7df8('0x22')]=qs[_0x7df8('0x29')](_[_0x7df8('0x42')](_0x43c0a2[_0x7df8('0x24')],_0x5c7cde[_0x7df8('0x29')]));if(_0x43c0a2[_0x7df8('0x24')][_0x7df8('0x44')]){_0x14b7c4[_0x7df8('0x22')]=_[_0x7df8('0x2f')](_0x14b7c4[_0x7df8('0x22')],{'$or':_[_0x7df8('0x1c')](_0x14b7c4[_0x7df8('0x2c')],function(_0x5a2b39){var _0x263229={};_0x263229[_0x5a2b39]={'$like':'%'+_0x43c0a2['query'][_0x7df8('0x44')]+'%'};return _0x263229;})});}_0x14b7c4=_[_0x7df8('0x2f')]({},_0x14b7c4,_0x43c0a2[_0x7df8('0x30')]);return _0x27d30a[_0x7df8('0x50')](_0x14b7c4);}})[_0x7df8('0x14')](function(_0x4d9cbb){if(_0x4d9cbb){_0x1b0167=_0x4d9cbb[_0x7df8('0x2d')];if(!_0x43c0a2['query']['hasOwnProperty'](_0x7df8('0x3f'))){_0x14b7c4[_0x7df8('0xf')]=qs['limit'](_0x43c0a2['query']['limit']);_0x14b7c4[_0x7df8('0xd')]=qs[_0x7df8('0xd')](_0x43c0a2['query']['offset']);}return _0x27d30a[_0x7df8('0x50')](_0x14b7c4);}})[_0x7df8('0x14')](function(_0x1cda61){if(_0x1cda61){return _0x1cda61?{'count':_0x1b0167,'rows':_0x1cda61}:null;}})['then'](respondWithResult(_0x59ea15,null))[_0x7df8('0x32')](handleError(_0x59ea15,null));};exports[_0x7df8('0x52')]=function(_0x55925d,_0x1258cd){var _0x4eb59f=_0x55925d[_0x7df8('0x34')][_0x7df8('0x53')];return db[_0x7df8('0x51')][_0x7df8('0x25')]({'where':{'id':_0x4eb59f},'attributes':['id'],'include':[{'model':db[_0x7df8('0x45')],'as':'Agents','attributes':['id',_0x7df8('0x1a'),_0x7df8('0x54'),_0x7df8('0x55'),'interface'],'raw':!![]}]})[_0x7df8('0x14')](function(_0x42ce0b){if(_0x42ce0b){var _0xa2c350=_['flatMap'](_0x42ce0b,function(_0x1bfa3c){var _0x321538=_0x1bfa3c[_0x7df8('0x36')]({'plain':!![]});return _0x321538[_0x7df8('0x56')];});return db['ChatQueue']['find']({'where':{'id':_0x55925d['params']['id']}})[_0x7df8('0x14')](function(_0x430293){return db['sequelize'][_0x7df8('0x57')](function(_0x38a856){return _0x430293[_0x7df8('0x52')](_0x4eb59f,{'transaction':_0x38a856})['then'](function(){return BPromise['each'](_0xa2c350,function(_0xe528d){return db[_0x7df8('0x3e')][_0x7df8('0x58')]({'where':{'UserId':_0xe528d['id'],'ChatQueueId':_0x55925d[_0x7df8('0x26')]['id']},'transaction':_0x38a856});});})[_0x7df8('0x14')](function(){_0xa2c350[_0x7df8('0x59')](function(_0x3627f2){socket[_0x7df8('0x5a')](_0x7df8('0x5b'),{'UserId':_0x3627f2['id'],'ChatQueueId':_0x430293['id']});});});});});}})[_0x7df8('0x14')](respondWithStatusCode(_0x1258cd,null))[_0x7df8('0x32')](handleError(_0x1258cd,null));};exports[_0x7df8('0x5c')]=function(_0x357cc2,_0x34a8d3){return db[_0x7df8('0x51')][_0x7df8('0x25')]({'where':{'id':_0x357cc2[_0x7df8('0x24')][_0x7df8('0x53')]},'attributes':['id'],'include':[{'model':db[_0x7df8('0x45')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x7df8('0x14')](handleEntityNotFound(_0x34a8d3,null))[_0x7df8('0x14')](function(_0xd65835){var _0x3fc871=_['map'](_0xd65835,'id');var _0x3742ed=[];var _0x47bfdb=[];var _0x4accc5=squel[_0x7df8('0x5d')]();_0x4accc5[_0x7df8('0x5e')](_0x7df8('0x5f'))[_0x7df8('0x60')](_0x7df8('0x61'),'tq')['join']('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0x7df8('0x22')](_0x7df8('0x62'),_0x357cc2[_0x7df8('0x26')]['id']);for(var _0x11f13f=0x0;_0x11f13f<_0xd65835[_0x7df8('0x2d')];_0x11f13f+=0x1){let _0x5270a8=_0xd65835[_0x11f13f];for(var _0x1667d9=0x0;_0x1667d9<_0x5270a8[_0x7df8('0x56')][_0x7df8('0x2d')];_0x1667d9+=0x1){let _0xd6dc75=_0x5270a8[_0x7df8('0x56')][_0x1667d9];var _0x55bca0=_0x4accc5[_0x7df8('0x63')]();_0x55bca0[_0x7df8('0x22')](_0x7df8('0x64'),_0xd6dc75['id']);_0x47bfdb[_0x7df8('0x65')](db[_0x7df8('0x66')][_0x7df8('0x24')](_0x55bca0['toString'](),{'type':db[_0x7df8('0x66')][_0x7df8('0x67')][_0x7df8('0x68')]})[_0x7df8('0x14')](function(_0x518a6c){if(_0x518a6c['length']===0x1){return _0xd6dc75['id'];}else{var _0x2a8a51=_['every'](_[_0x7df8('0x1c')](_0x518a6c,_0x7df8('0x69')),function(_0x8cddbb){return _[_0x7df8('0x6a')](_0x3fc871,_0x8cddbb);});if(_0x2a8a51){return _0xd6dc75['id'];}}}));}}return BPromise['all'](_0x47bfdb)[_0x7df8('0x14')](function(_0x1480db){_0x3742ed=_(_0x3742ed)[_0x7df8('0x6b')](_0x1480db)[_0x7df8('0x6c')]()[_0x7df8('0x6d')]();return db[_0x7df8('0x1d')][_0x7df8('0x31')]({'where':{'id':_0x357cc2[_0x7df8('0x26')]['id']}})['then'](function(_0x29d406){return db[_0x7df8('0x66')]['transaction'](function(_0x15d3c7){return _0x29d406['removeTeams'](_0x357cc2[_0x7df8('0x24')][_0x7df8('0x53')],{'transaction':_0x15d3c7})[_0x7df8('0x14')](function(){if(!_[_0x7df8('0x6e')](_0x3742ed)){return _0x29d406['removeAgents'](_0x3742ed,{'transaction':_0x15d3c7});}})[_0x7df8('0x14')](function(){_0x3742ed[_0x7df8('0x59')](function(_0x2f5e29){socket[_0x7df8('0x5a')](_0x7df8('0x6f'),{'UserId':_0x2f5e29,'ChatQueueId':_0x29d406['id']});});});});});});})[_0x7df8('0x14')](respondWithStatusCode(_0x34a8d3,null))['catch'](handleError(_0x34a8d3,null));};exports[_0x7df8('0x70')]=function(_0x2fe050,_0x3c422){return db[_0x7df8('0x1d')][_0x7df8('0x31')]({'where':{'id':_0x2fe050[_0x7df8('0x26')]['id']}})[_0x7df8('0x14')](handleEntityNotFound(_0x3c422,null))['then'](function(_0x26da58){if(_0x26da58){return _0x26da58[_0x7df8('0x70')](_0x2fe050['body']['ids'],_[_0x7df8('0x71')](_0x2fe050[_0x7df8('0x34')],[_0x7df8('0x53'),'id'])||{})[_0x7df8('0x72')](function(_0x1420ec){for(var _0x28d831=0x0;_0x28d831<_0x2fe050['body']['ids']['length'];_0x28d831+=0x1){socket[_0x7df8('0x5a')]('userChatQueue:save',{'UserId':Number(_0x2fe050[_0x7df8('0x34')][_0x7df8('0x53')][_0x28d831]),'ChatQueueId':Number(_0x2fe050[_0x7df8('0x26')]['id'])});}return _0x1420ec;});}})[_0x7df8('0x14')](respondWithResult(_0x3c422,null))[_0x7df8('0x32')](handleError(_0x3c422,null));};exports[_0x7df8('0x73')]=function(_0x293998,_0x1e2375){return db[_0x7df8('0x1d')]['find']({'where':{'id':_0x293998[_0x7df8('0x26')]['id']}})[_0x7df8('0x14')](handleEntityNotFound(_0x1e2375,null))[_0x7df8('0x14')](function(_0x423dc4){if(_0x423dc4){return _0x423dc4[_0x7df8('0x73')](_0x293998[_0x7df8('0x24')][_0x7df8('0x53')])[_0x7df8('0x14')](function(){if(_[_0x7df8('0x74')](_0x293998[_0x7df8('0x24')][_0x7df8('0x53')])){for(var _0x1127ae=0x0;_0x1127ae<_0x293998[_0x7df8('0x24')][_0x7df8('0x53')][_0x7df8('0x2d')];_0x1127ae+=0x1){socket[_0x7df8('0x5a')]('userChatQueue:remove',{'UserId':Number(_0x293998[_0x7df8('0x24')][_0x7df8('0x53')][_0x1127ae]),'ChatQueueId':Number(_0x293998[_0x7df8('0x26')]['id'])});}}else{socket[_0x7df8('0x5a')](_0x7df8('0x6f'),{'UserId':Number(_0x293998[_0x7df8('0x24')][_0x7df8('0x53')]),'ChatQueueId':Number(_0x293998['params']['id'])});}});}})[_0x7df8('0x14')](respondWithStatusCode(_0x1e2375,null))['catch'](handleError(_0x1e2375,null));};exports[_0x7df8('0x75')]=function(_0xd3a60f,_0xd826de){var _0x3292ba={};var _0xba95={};var _0x505904;var _0x13e8a6;return db[_0x7df8('0x1d')][_0x7df8('0x3d')]({'where':{'id':_0xd3a60f[_0x7df8('0x26')]['id']}})[_0x7df8('0x14')](handleEntityNotFound(_0xd826de,null))[_0x7df8('0x14')](function(_0x247615){if(_0x247615){_0x505904=_0x247615;_0xba95[_0x7df8('0x27')]=_[_0x7df8('0x28')](db[_0x7df8('0x45')][_0x7df8('0x1e')]);_0xba95[_0x7df8('0x24')]=_[_0x7df8('0x28')](_0xd3a60f['query']);_0xba95['filters']=_[_0x7df8('0x2a')](_0xba95[_0x7df8('0x27')],_0xba95[_0x7df8('0x24')]);_0x3292ba[_0x7df8('0x2c')]=_[_0x7df8('0x2a')](_0xba95[_0x7df8('0x27')],qs[_0x7df8('0x2b')](_0xd3a60f[_0x7df8('0x24')][_0x7df8('0x2b')]));_0x3292ba[_0x7df8('0x2c')]=_0x3292ba[_0x7df8('0x2c')][_0x7df8('0x2d')]?_0x3292ba[_0x7df8('0x2c')]:_0xba95['model'];_0x3292ba['order']=qs['sort'](_0xd3a60f[_0x7df8('0x24')][_0x7df8('0x41')]);_0x3292ba[_0x7df8('0x22')]=qs[_0x7df8('0x29')](_[_0x7df8('0x42')](_0xd3a60f[_0x7df8('0x24')],_0xba95['filters']));if(_0xd3a60f[_0x7df8('0x24')][_0x7df8('0x44')]){_0x3292ba[_0x7df8('0x22')]=_['merge'](_0x3292ba[_0x7df8('0x22')],{'$or':_[_0x7df8('0x1c')](_0x3292ba[_0x7df8('0x2c')],function(_0x51efbe){var _0x4be41a={};_0x4be41a[_0x51efbe]={'$like':'%'+_0xd3a60f[_0x7df8('0x24')][_0x7df8('0x44')]+'%'};return _0x4be41a;})});}_0x3292ba=_[_0x7df8('0x2f')]({},_0x3292ba,_0xd3a60f[_0x7df8('0x30')]);return _0x505904[_0x7df8('0x75')](_0x3292ba);}})['then'](function(_0x363357){if(_0x363357){_0x13e8a6=_0x363357[_0x7df8('0x2d')];if(!_0xd3a60f['query'][_0x7df8('0x76')](_0x7df8('0x3f'))){_0x3292ba['limit']=qs[_0x7df8('0xf')](_0xd3a60f['query'][_0x7df8('0xf')]);_0x3292ba[_0x7df8('0xd')]=qs[_0x7df8('0xd')](_0xd3a60f[_0x7df8('0x24')][_0x7df8('0xd')]);}return _0x505904[_0x7df8('0x75')](_0x3292ba);}})[_0x7df8('0x14')](function(_0x1144e3){if(_0x1144e3){return _0x1144e3?{'count':_0x13e8a6,'rows':_0x1144e3}:null;}})['then'](respondWithResult(_0xd826de,null))['catch'](handleError(_0xd826de,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index 4727016..afe1065 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 _0x0141=['../../mysqldb','ChatQueue','save','update','remove','emit','hook','exports','events'];(function(_0x277541,_0x5e4f04){var _0x531d89=function(_0x151a5b){while(--_0x151a5b){_0x277541['push'](_0x277541['shift']());}};_0x531d89(++_0x5e4f04);}(_0x0141,0x104));var _0x1014=function(_0x4a7501,_0x135d07){_0x4a7501=_0x4a7501-0x0;var _0x5b1a76=_0x0141[_0x4a7501];return _0x5b1a76;};'use strict';var EventEmitter=require(_0x1014('0x0'));var ChatQueue=require(_0x1014('0x1'))['db'][_0x1014('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x1014('0x3'),'afterUpdate':_0x1014('0x4'),'afterDestroy':_0x1014('0x5')};function emitEvent(_0x5ef913){return function(_0x4748e7,_0x127683,_0x3d66ae){ChatQueueEvents[_0x1014('0x6')](_0x5ef913+':'+_0x4748e7['id'],_0x4748e7);ChatQueueEvents[_0x1014('0x6')](_0x5ef913,_0x4748e7);_0x3d66ae(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0x1014('0x7')](e,emitEvent(event));}}module[_0x1014('0x8')]=ChatQueueEvents; \ No newline at end of file +var _0xde84=['setMaxListeners','update','remove','hasOwnProperty','hook','exports','events','../../mysqldb','ChatQueue'];(function(_0x4427c9,_0xb06e1c){var _0x1efc85=function(_0x462fd0){while(--_0x462fd0){_0x4427c9['push'](_0x4427c9['shift']());}};_0x1efc85(++_0xb06e1c);}(_0xde84,0x84));var _0x4de8=function(_0x7162ba,_0x44d30f){_0x7162ba=_0x7162ba-0x0;var _0x6526a0=_0xde84[_0x7162ba];return _0x6526a0;};'use strict';var EventEmitter=require(_0x4de8('0x0'));var ChatQueue=require(_0x4de8('0x1'))['db'][_0x4de8('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x4de8('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x4de8('0x4'),'afterDestroy':_0x4de8('0x5')};function emitEvent(_0x39edc0){return function(_0x1fb457,_0x400e18,_0x1de6cf){ChatQueueEvents['emit'](_0x39edc0+':'+_0x1fb457['id'],_0x1fb457);ChatQueueEvents['emit'](_0x39edc0,_0x1fb457);_0x1de6cf(null);};}for(var e in events){if(events[_0x4de8('0x6')](e)){var event=events[e];ChatQueue[_0x4de8('0x7')](e,emitEvent(event));}}module[_0x4de8('0x8')]=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index 547ea44..99b48cc 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 _0xc753=['request-promise','rimraf','./chatQueue.attributes','exports','define','ChatQueue','chat_queues','util','../../config/logger','api','moment','bluebird'];(function(_0x38c5bb,_0x153bdb){var _0x5cbd09=function(_0xe17565){while(--_0xe17565){_0x38c5bb['push'](_0x38c5bb['shift']());}};_0x5cbd09(++_0x153bdb);}(_0xc753,0x193));var _0x3c75=function(_0x4cca37,_0x4319e6){_0x4cca37=_0x4cca37-0x0;var _0x365981=_0xc753[_0x4cca37];return _0x365981;};'use strict';var _=require('lodash');var util=require(_0x3c75('0x0'));var logger=require(_0x3c75('0x1'))(_0x3c75('0x2'));var moment=require(_0x3c75('0x3'));var BPromise=require(_0x3c75('0x4'));var rp=require(_0x3c75('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3c75('0x6'));var config=require('../../config/environment');var attributes=require(_0x3c75('0x7'));module[_0x3c75('0x8')]=function(_0xb84f8e,_0x1c0134){return _0xb84f8e[_0x3c75('0x9')](_0x3c75('0xa'),attributes,{'tableName':_0x3c75('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe98a=['exports','define','ChatQueue','chat_queues','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./chatQueue.attributes'];(function(_0x75f869,_0x3690d6){var _0x10af8b=function(_0x22d3ff){while(--_0x22d3ff){_0x75f869['push'](_0x75f869['shift']());}};_0x10af8b(++_0x3690d6);}(_0xe98a,0xb8));var _0xae98=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0xe98a[_0x1035c1];return _0x308d67;};'use strict';var _=require('lodash');var util=require(_0xae98('0x0'));var logger=require(_0xae98('0x1'))(_0xae98('0x2'));var moment=require('moment');var BPromise=require(_0xae98('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xae98('0x4'));var rimraf=require(_0xae98('0x5'));var config=require(_0xae98('0x6'));var attributes=require(_0xae98('0x7'));module[_0xae98('0x8')]=function(_0x54cd18,_0x2f2a07){return _0x54cd18[_0xae98('0x9')](_0xae98('0xa'),attributes,{'tableName':_0xae98('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js index 9de173c..4abb097 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 _0x531a=['jayson/promise','http','redis','defaults','localhost','./chatQueue.socket','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','error','message','result','GetChatQueue','findAll','options','raw','where','attributes','limit','map','include','model','catch','ShowChatQueue','find','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0xf16af5,_0x358d22){var _0x41d3f1=function(_0x168618){while(--_0x168618){_0xf16af5['push'](_0xf16af5['shift']());}};_0x41d3f1(++_0x358d22);}(_0x531a,0x100));var _0xa531=function(_0x35563c,_0x1393e9){_0x35563c=_0x35563c-0x0;var _0x2a763c=_0x531a[_0x35563c];return _0x2a763c;};'use strict';var _=require(_0xa531('0x0'));var util=require(_0xa531('0x1'));var moment=require(_0xa531('0x2'));var BPromise=require(_0xa531('0x3'));var rs=require(_0xa531('0x4'));var fs=require('fs');var Redis=require(_0xa531('0x5'));var db=require(_0xa531('0x6'))['db'];var utils=require(_0xa531('0x7'));var logger=require(_0xa531('0x8'))(_0xa531('0x9'));var config=require('../../config/environment');var jayson=require(_0xa531('0xa'));var client=jayson['client'][_0xa531('0xb')]({'port':0x232a});config[_0xa531('0xc')]=_[_0xa531('0xd')](config[_0xa531('0xc')],{'host':_0xa531('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa531('0xc')]));require(_0xa531('0xf'))['register'](socket);function respondWithRpcPromise(_0x190db4,_0x3eebc8,_0x10f6e0){return new BPromise(function(_0x3eb94f,_0x3e25a8){return client['request'](_0x190db4,_0x10f6e0)[_0xa531('0x10')](function(_0x4df80e){logger[_0xa531('0x11')](_0xa531('0x12'),_0x3eebc8,_0xa531('0x13'));logger['debug'](_0xa531('0x14'),_0x3eebc8,_0xa531('0x13'),JSON['stringify'](_0x4df80e));if(_0x4df80e[_0xa531('0x15')]){if(_0x4df80e[_0xa531('0x15')]['code']===0x1f4){logger[_0xa531('0x15')](_0xa531('0x12'),_0x3eebc8,_0x4df80e[_0xa531('0x15')]['message']);return _0x3e25a8(_0x4df80e['error']['message']);}logger[_0xa531('0x15')](_0xa531('0x12'),_0x3eebc8,_0x4df80e[_0xa531('0x15')][_0xa531('0x16')]);return _0x3eb94f(_0x4df80e[_0xa531('0x15')][_0xa531('0x16')]);}else{logger['info'](_0xa531('0x12'),_0x3eebc8,'request\x20sent');_0x3eb94f(_0x4df80e[_0xa531('0x17')][_0xa531('0x16')]);}})['catch'](function(_0x4eb512){logger[_0xa531('0x15')](_0xa531('0x12'),_0x3eebc8,_0x4eb512);_0x3e25a8(_0x4eb512);});});}exports[_0xa531('0x18')]=function(_0x55a731){var _0x42b629=this;return new Promise(function(_0x468b75,_0x4096f0){return db['ChatQueue'][_0xa531('0x19')]({'raw':_0x55a731[_0xa531('0x1a')]?_0x55a731['options'][_0xa531('0x1b')]===undefined?!![]:![]:!![],'where':_0x55a731[_0xa531('0x1a')]?_0x55a731[_0xa531('0x1a')][_0xa531('0x1c')]||null:null,'attributes':_0x55a731[_0xa531('0x1a')]?_0x55a731[_0xa531('0x1a')][_0xa531('0x1d')]||null:null,'limit':_0x55a731[_0xa531('0x1a')]?_0x55a731[_0xa531('0x1a')][_0xa531('0x1e')]||null:null,'include':_0x55a731[_0xa531('0x1a')]?_0x55a731[_0xa531('0x1a')]['include']?_[_0xa531('0x1f')](_0x55a731[_0xa531('0x1a')][_0xa531('0x20')],function(_0x487a8c){return{'model':db[_0x487a8c[_0xa531('0x21')]],'as':_0x487a8c['as'],'attributes':_0x487a8c[_0xa531('0x1d')],'include':_0x487a8c['include']?_['map'](_0x487a8c[_0xa531('0x20')],function(_0x56b96d){return{'model':db[_0x56b96d[_0xa531('0x21')]],'as':_0x56b96d['as'],'attributes':_0x56b96d[_0xa531('0x1d')],'include':_0x56b96d['include']?_[_0xa531('0x1f')](_0x56b96d['include'],function(_0x36a8e6){return{'model':db[_0x36a8e6['model']],'as':_0x36a8e6['as'],'attributes':_0x36a8e6['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x27bd5c){logger[_0xa531('0x11')]('GetChatQueue',_0x55a731);logger['debug'](_0xa531('0x18'),_0x55a731,JSON['stringify'](_0x27bd5c));_0x468b75(_0x27bd5c);})[_0xa531('0x22')](function(_0x133431){logger['error'](_0xa531('0x18'),_0x133431[_0xa531('0x16')],_0x55a731);_0x4096f0(_0x42b629[_0xa531('0x15')](0x1f4,_0x133431['message']));});});};exports[_0xa531('0x23')]=function(_0x3c3376){var _0x4b8104=this;return new Promise(function(_0x2fc577,_0x13c270){return db['ChatQueue'][_0xa531('0x24')]({'raw':_0x3c3376[_0xa531('0x1a')]?_0x3c3376[_0xa531('0x1a')][_0xa531('0x1b')]===undefined?!![]:![]:!![],'where':_0x3c3376[_0xa531('0x1a')]?_0x3c3376[_0xa531('0x1a')][_0xa531('0x1c')]||null:null,'attributes':_0x3c3376['options']?_0x3c3376['options'][_0xa531('0x1d')]||null:null,'include':_0x3c3376[_0xa531('0x1a')]?_0x3c3376[_0xa531('0x1a')][_0xa531('0x20')]?_[_0xa531('0x1f')](_0x3c3376['options'][_0xa531('0x20')],function(_0x3b1ba7){return{'model':db[_0x3b1ba7[_0xa531('0x21')]],'as':_0x3b1ba7['as'],'attributes':_0x3b1ba7[_0xa531('0x1d')],'include':_0x3b1ba7[_0xa531('0x20')]?_[_0xa531('0x1f')](_0x3b1ba7[_0xa531('0x20')],function(_0x24efee){return{'model':db[_0x24efee[_0xa531('0x21')]],'as':_0x24efee['as'],'attributes':_0x24efee[_0xa531('0x1d')],'include':_0x24efee[_0xa531('0x20')]?_['map'](_0x24efee[_0xa531('0x20')],function(_0x311aee){return{'model':db[_0x311aee[_0xa531('0x21')]],'as':_0x311aee['as'],'attributes':_0x311aee[_0xa531('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xa531('0x10')](function(_0x4eae17){logger[_0xa531('0x11')](_0xa531('0x23'),_0x3c3376);logger[_0xa531('0x25')](_0xa531('0x23'),_0x3c3376,JSON['stringify'](_0x4eae17));_0x2fc577(_0x4eae17);})[_0xa531('0x22')](function(_0x297c78){logger[_0xa531('0x15')]('ShowChatQueue',_0x297c78['message'],_0x3c3376);_0x13c270(_0x4b8104[_0xa531('0x15')](0x1f4,_0x297c78['message']));});});}; \ No newline at end of file +var _0x21f8=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./chatQueue.socket','register','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','GetChatQueue','findAll','options','where','attributes','model','include','map','ChatQueue','find','ShowChatQueue','lodash'];(function(_0x139485,_0x2d0aac){var _0x221cb9=function(_0x38b8de){while(--_0x38b8de){_0x139485['push'](_0x139485['shift']());}};_0x221cb9(++_0x2d0aac);}(_0x21f8,0x71));var _0x821f=function(_0x401d67,_0xeb1592){_0x401d67=_0x401d67-0x0;var _0x25076b=_0x21f8[_0x401d67];return _0x25076b;};'use strict';var _=require(_0x821f('0x0'));var util=require(_0x821f('0x1'));var moment=require(_0x821f('0x2'));var BPromise=require(_0x821f('0x3'));var rs=require(_0x821f('0x4'));var fs=require('fs');var Redis=require(_0x821f('0x5'));var db=require(_0x821f('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x821f('0x7'));var jayson=require(_0x821f('0x8'));var client=jayson[_0x821f('0x9')][_0x821f('0xa')]({'port':0x232a});config[_0x821f('0xb')]=_[_0x821f('0xc')](config[_0x821f('0xb')],{'host':_0x821f('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x821f('0xe'))[_0x821f('0xf')](socket);function respondWithRpcPromise(_0x81e2f4,_0x53ce42,_0x387056){return new BPromise(function(_0x44e3f3,_0x101ae7){return client[_0x821f('0x10')](_0x81e2f4,_0x387056)[_0x821f('0x11')](function(_0x4590da){logger[_0x821f('0x12')](_0x821f('0x13'),_0x53ce42,_0x821f('0x14'));logger[_0x821f('0x15')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x53ce42,'request\x20sent',JSON[_0x821f('0x16')](_0x4590da));if(_0x4590da[_0x821f('0x17')]){if(_0x4590da[_0x821f('0x17')][_0x821f('0x18')]===0x1f4){logger[_0x821f('0x17')](_0x821f('0x13'),_0x53ce42,_0x4590da[_0x821f('0x17')][_0x821f('0x19')]);return _0x101ae7(_0x4590da[_0x821f('0x17')][_0x821f('0x19')]);}logger['error'](_0x821f('0x13'),_0x53ce42,_0x4590da['error'][_0x821f('0x19')]);return _0x44e3f3(_0x4590da['error'][_0x821f('0x19')]);}else{logger[_0x821f('0x12')](_0x821f('0x13'),_0x53ce42,_0x821f('0x14'));_0x44e3f3(_0x4590da['result'][_0x821f('0x19')]);}})[_0x821f('0x1a')](function(_0x499483){logger[_0x821f('0x17')]('ChatQueue,\x20%s,\x20%s',_0x53ce42,_0x499483);_0x101ae7(_0x499483);});});}exports[_0x821f('0x1b')]=function(_0x5cdfc7){var _0x3104e4=this;return new Promise(function(_0x2e7b8a,_0x4fbcf2){return db['ChatQueue'][_0x821f('0x1c')]({'raw':_0x5cdfc7[_0x821f('0x1d')]?_0x5cdfc7[_0x821f('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x5cdfc7[_0x821f('0x1d')]?_0x5cdfc7[_0x821f('0x1d')][_0x821f('0x1e')]||null:null,'attributes':_0x5cdfc7['options']?_0x5cdfc7[_0x821f('0x1d')][_0x821f('0x1f')]||null:null,'limit':_0x5cdfc7['options']?_0x5cdfc7['options']['limit']||null:null,'include':_0x5cdfc7['options']?_0x5cdfc7[_0x821f('0x1d')]['include']?_['map'](_0x5cdfc7[_0x821f('0x1d')]['include'],function(_0x57f5a2){return{'model':db[_0x57f5a2[_0x821f('0x20')]],'as':_0x57f5a2['as'],'attributes':_0x57f5a2[_0x821f('0x1f')],'include':_0x57f5a2[_0x821f('0x21')]?_[_0x821f('0x22')](_0x57f5a2['include'],function(_0xf6d94a){return{'model':db[_0xf6d94a[_0x821f('0x20')]],'as':_0xf6d94a['as'],'attributes':_0xf6d94a[_0x821f('0x1f')],'include':_0xf6d94a[_0x821f('0x21')]?_['map'](_0xf6d94a[_0x821f('0x21')],function(_0xac9ab1){return{'model':db[_0xac9ab1[_0x821f('0x20')]],'as':_0xac9ab1['as'],'attributes':_0xac9ab1[_0x821f('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xceb073){logger['info']('GetChatQueue',_0x5cdfc7);logger[_0x821f('0x15')](_0x821f('0x1b'),_0x5cdfc7,JSON[_0x821f('0x16')](_0xceb073));_0x2e7b8a(_0xceb073);})[_0x821f('0x1a')](function(_0x122e56){logger['error'](_0x821f('0x1b'),_0x122e56[_0x821f('0x19')],_0x5cdfc7);_0x4fbcf2(_0x3104e4[_0x821f('0x17')](0x1f4,_0x122e56[_0x821f('0x19')]));});});};exports['ShowChatQueue']=function(_0x1eae9c){var _0x386faf=this;return new Promise(function(_0x163ed3,_0x15891b){return db[_0x821f('0x23')][_0x821f('0x24')]({'raw':_0x1eae9c['options']?_0x1eae9c[_0x821f('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x1eae9c[_0x821f('0x1d')]?_0x1eae9c[_0x821f('0x1d')]['where']||null:null,'attributes':_0x1eae9c['options']?_0x1eae9c[_0x821f('0x1d')][_0x821f('0x1f')]||null:null,'include':_0x1eae9c[_0x821f('0x1d')]?_0x1eae9c[_0x821f('0x1d')][_0x821f('0x21')]?_['map'](_0x1eae9c['options'][_0x821f('0x21')],function(_0x34f607){return{'model':db[_0x34f607[_0x821f('0x20')]],'as':_0x34f607['as'],'attributes':_0x34f607['attributes'],'include':_0x34f607[_0x821f('0x21')]?_[_0x821f('0x22')](_0x34f607[_0x821f('0x21')],function(_0x34bd2c){return{'model':db[_0x34bd2c[_0x821f('0x20')]],'as':_0x34bd2c['as'],'attributes':_0x34bd2c[_0x821f('0x1f')],'include':_0x34bd2c[_0x821f('0x21')]?_['map'](_0x34bd2c['include'],function(_0x432952){return{'model':db[_0x432952[_0x821f('0x20')]],'as':_0x432952['as'],'attributes':_0x432952[_0x821f('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x821f('0x11')](function(_0x355d38){logger['info']('ShowChatQueue',_0x1eae9c);logger[_0x821f('0x15')](_0x821f('0x25'),_0x1eae9c,JSON[_0x821f('0x16')](_0x355d38));_0x163ed3(_0x355d38);})['catch'](function(_0x46bc50){logger[_0x821f('0x17')](_0x821f('0x25'),_0x46bc50['message'],_0x1eae9c);_0x15891b(_0x386faf[_0x821f('0x17')](0x1f4,_0x46bc50[_0x821f('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index 962ccc1..83f21b8 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 _0x9a19=['removeListener','register','chatQueue:','./chatQueue.events','save','remove','emit'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x9a19,0x114));var _0x99a1=function(_0x45bf86,_0x75586e){_0x45bf86=_0x45bf86-0x0;var _0x1f02b7=_0x9a19[_0x45bf86];return _0x1f02b7;};'use strict';var ChatQueueEvents=require(_0x99a1('0x0'));var events=[_0x99a1('0x1'),_0x99a1('0x2'),'update'];function createListener(_0x16fd8b,_0x2ba463){return function(_0x112bcc){_0x2ba463[_0x99a1('0x3')](_0x16fd8b,_0x112bcc);};}function removeListener(_0x214082,_0x3d73c5){return function(){ChatQueueEvents[_0x99a1('0x4')](_0x214082,_0x3d73c5);};}exports[_0x99a1('0x5')]=function(_0x3eff4a){for(var _0xff0240=0x0,_0x65045d=events['length'];_0xff0240<_0x65045d;_0xff0240++){var _0x4d2a5c=events[_0xff0240];var _0x5aa6c2=createListener(_0x99a1('0x6')+_0x4d2a5c,_0x3eff4a);ChatQueueEvents['on'](_0x4d2a5c,_0x5aa6c2);}}; \ No newline at end of file +var _0xb66c=['chatQueue:','./chatQueue.events','remove','removeListener','register','length'];(function(_0x3817a9,_0x29e215){var _0x443f30=function(_0x13940b){while(--_0x13940b){_0x3817a9['push'](_0x3817a9['shift']());}};_0x443f30(++_0x29e215);}(_0xb66c,0x175));var _0xcb66=function(_0x2d198d,_0x4790ed){_0x2d198d=_0x2d198d-0x0;var _0x3674d4=_0xb66c[_0x2d198d];return _0x3674d4;};'use strict';var ChatQueueEvents=require(_0xcb66('0x0'));var events=['save',_0xcb66('0x1'),'update'];function createListener(_0x2afcb8,_0x24ea13){return function(_0xf7ccc5){_0x24ea13['emit'](_0x2afcb8,_0xf7ccc5);};}function removeListener(_0x35d439,_0x386241){return function(){ChatQueueEvents[_0xcb66('0x2')](_0x35d439,_0x386241);};}exports[_0xcb66('0x3')]=function(_0x5d766d){for(var _0x518163=0x0,_0x19adf5=events[_0xcb66('0x4')];_0x518163<_0x19adf5;_0x518163++){var _0xa3993=events[_0x518163];var _0x439f3d=createListener(_0xcb66('0x5')+_0xa3993,_0x5d766d);ChatQueueEvents['on'](_0xa3993,_0x439f3d);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index ea289ef..2c1e11e 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(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x3e74,0x175));var _0x43e7=function(_0x4e16f2,_0x24ba3b){_0x4e16f2=_0x4e16f2-0x0;var _0x77bca4=_0x3e74[_0x4e16f2];return _0x77bca4;};'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 _0x814b=['/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','delete','removeTeams','removeAgents','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','/describe','describe','/:id','show'];(function(_0x21733f,_0x38b1f8){var _0x2e2952=function(_0x7c62a1){while(--_0x7c62a1){_0x21733f['push'](_0x21733f['shift']());}};_0x2e2952(++_0x38b1f8);}(_0x814b,0x1a2));var _0xb814=function(_0x35c5a8,_0x8ecb48){_0x35c5a8=_0x35c5a8-0x0;var _0x34782c=_0x814b[_0x35c5a8];return _0x34782c;};'use strict';var multer=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var path=require(_0xb814('0x2'));var timeout=require(_0xb814('0x3'));var express=require(_0xb814('0x4'));var router=express[_0xb814('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb814('0x6'));var interaction=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var controller=require(_0xb814('0x9'));router[_0xb814('0xa')]('/',auth[_0xb814('0xb')](),controller['index']);router[_0xb814('0xa')](_0xb814('0xc'),auth['isAuthenticated'](),controller[_0xb814('0xd')]);router[_0xb814('0xa')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0xf')]);router[_0xb814('0xa')](_0xb814('0x10'),auth[_0xb814('0xb')](),controller[_0xb814('0x11')]);router[_0xb814('0xa')](_0xb814('0x12'),auth['isAuthenticated'](),controller[_0xb814('0x13')]);router['get'](_0xb814('0x14'),auth[_0xb814('0xb')](),controller[_0xb814('0x15')]);router[_0xb814('0x16')]('/',auth[_0xb814('0xb')](),controller[_0xb814('0x17')]);router[_0xb814('0x16')](_0xb814('0x12'),auth[_0xb814('0xb')](),controller[_0xb814('0x18')]);router[_0xb814('0x16')](_0xb814('0x14'),auth[_0xb814('0xb')](),controller[_0xb814('0x19')]);router[_0xb814('0x1a')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0x1b')]);router[_0xb814('0x1c')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller['destroy']);router[_0xb814('0x1c')]('/:id/teams',auth[_0xb814('0xb')](),controller[_0xb814('0x1d')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0xb814('0x1e')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index 2e0b0ce..3ec0e66 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 _0x38db=['sequelize','exports','STRING','DATE','moment'];(function(_0x46e4da,_0x448bf3){var _0x4db797=function(_0x4f2eaa){while(--_0x4f2eaa){_0x46e4da['push'](_0x46e4da['shift']());}};_0x4db797(++_0x448bf3);}(_0x38db,0x18a));var _0xb38d=function(_0x3fc9af,_0x9bb776){_0x3fc9af=_0x3fc9af-0x0;var _0x3574c0=_0x38db[_0x3fc9af];return _0x3574c0;};'use strict';var moment=require(_0xb38d('0x0'));var Sequelize=require(_0xb38d('0x1'));module[_0xb38d('0x2')]={'uniqueid':{'type':Sequelize[_0xb38d('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xb38d('0x3')]},'joinAt':{'type':Sequelize[_0xb38d('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xb38d('0x4')]},'exitAt':{'type':Sequelize[_0xb38d('0x4')]},'reason':{'type':Sequelize[_0xb38d('0x3')]}}; \ No newline at end of file +var _0x059d=['DATE','moment','sequelize','exports','STRING'];(function(_0x270817,_0x48a86a){var _0x58135e=function(_0x3df2c1){while(--_0x3df2c1){_0x270817['push'](_0x270817['shift']());}};_0x58135e(++_0x48a86a);}(_0x059d,0x1b9));var _0xd059=function(_0x5e1b94,_0x4764f9){_0x5e1b94=_0x5e1b94-0x0;var _0x42aa36=_0x059d[_0x5e1b94];return _0x42aa36;};'use strict';var moment=require(_0xd059('0x0'));var Sequelize=require(_0xd059('0x1'));module[_0xd059('0x2')]={'uniqueid':{'type':Sequelize[_0xd059('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xd059('0x3')]},'joinAt':{'type':Sequelize[_0xd059('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xd059('0x4')]},'exitAt':{'type':Sequelize[_0xd059('0x4')]},'reason':{'type':Sequelize[_0xd059('0x3')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index e6d204e..e37a1fc 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 _0x9303=['order','sort','where','pick','filter','merge','options','includeAll','findAll','catch','show','params','include','create','body','find','describe','eml-format','fast-json-patch','moment','util','path','sox','to-csv','fs-extra','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','limit','count','apply','save','update','then','destroy','end','error','name','send','index','map','ChatQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit'];(function(_0x2e2681,_0x4089c1){var _0x368a64=function(_0x267262){while(--_0x267262){_0x2e2681['push'](_0x2e2681['shift']());}};_0x368a64(++_0x4089c1);}(_0x9303,0xd7));var _0x3930=function(_0x37810c,_0x480382){_0x37810c=_0x37810c-0x0;var _0x44c4ef=_0x9303[_0x37810c];return _0x44c4ef;};'use strict';var emlformat=require(_0x3930('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x3930('0x1'));var rp=require('request-promise');var moment=require(_0x3930('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x3930('0x3'));var path=require(_0x3930('0x4'));var sox=require(_0x3930('0x5'));var csv=require(_0x3930('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3930('0x7'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x3930('0x8'));var jsforce=require(_0x3930('0x9'));var deskjs=require(_0x3930('0xa'));var toCsv=require(_0x3930('0x6'));var querystring=require(_0x3930('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x3930('0xc'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x3930('0xd'))(_0x3930('0xe'));var utils=require(_0x3930('0xf'));var config=require(_0x3930('0x10'));var licenseUtil=require(_0x3930('0x11'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x13b928,_0x55130d){_0x55130d=_0x55130d||0xcc;return function(_0x185659){if(_0x185659){return _0x13b928[_0x3930('0x12')](_0x55130d);}return _0x13b928[_0x3930('0x13')](_0x55130d)['end']();};}function respondWithResult(_0x11b256,_0x15f039){_0x15f039=_0x15f039||0xc8;return function(_0x4ef6c4){if(_0x4ef6c4){return _0x11b256[_0x3930('0x13')](_0x15f039)[_0x3930('0x14')](_0x4ef6c4);}};}function respondWithFilteredResult(_0x3bc35e,_0x135498){return function(_0x5db060){if(_0x5db060){var _0x55ec9b=typeof _0x135498[_0x3930('0x15')]==='undefined'&&typeof _0x135498[_0x3930('0x16')]==='undefined';var _0x4113c4=_0x5db060[_0x3930('0x17')];var _0x5a1c39=_0x55ec9b?0x0:_0x135498['offset'];var _0x4b02b6=_0x55ec9b?_0x5db060[_0x3930('0x17')]:_0x135498[_0x3930('0x15')]+_0x135498[_0x3930('0x16')];var _0x5b5f55;if(_0x4b02b6>=_0x4113c4){_0x4b02b6=_0x4113c4;_0x5b5f55=0xc8;}else{_0x5b5f55=0xce;}_0x3bc35e['status'](_0x5b5f55);return _0x3bc35e['set']('Content-Range',_0x5a1c39+'-'+_0x4b02b6+'/'+_0x4113c4)[_0x3930('0x14')](_0x5db060);}return null;};}function patchUpdates(_0x2ba9ba){return function(_0x2e650d){try{jsonpatch[_0x3930('0x18')](_0x2e650d,_0x2ba9ba,!![]);}catch(_0x3d2a2f){return BPromise['reject'](_0x3d2a2f);}return _0x2e650d[_0x3930('0x19')]();};}function saveUpdates(_0x315f73,_0x1c5f4a){return function(_0x4a4307){if(_0x4a4307){return _0x4a4307[_0x3930('0x1a')](_0x315f73)[_0x3930('0x1b')](function(_0x12eeb7){return _0x12eeb7;});}return null;};}function removeEntity(_0x3a0e16,_0x2bcc3b){return function(_0x186e2e){if(_0x186e2e){return _0x186e2e[_0x3930('0x1c')]()[_0x3930('0x1b')](function(){_0x3a0e16['status'](0xcc)[_0x3930('0x1d')]();});}};}function handleEntityNotFound(_0x1dcdcd,_0x187453){return function(_0x11358e){if(!_0x11358e){_0x1dcdcd[_0x3930('0x12')](0x194);}return _0x11358e;};}function handleError(_0x5b4c56,_0x276940){_0x276940=_0x276940||0x1f4;return function(_0x7b6825){logger[_0x3930('0x1e')](_0x7b6825['stack']);if(_0x7b6825[_0x3930('0x1f')]){delete _0x7b6825[_0x3930('0x1f')];}_0x5b4c56[_0x3930('0x13')](_0x276940)[_0x3930('0x20')](_0x7b6825);};}exports[_0x3930('0x21')]=function(_0x575e76,_0x447d71){var _0x121cce={},_0xca904a={},_0x51ceb9={'count':0x0,'rows':[]};var _0x3b9168=_[_0x3930('0x22')](db[_0x3930('0x23')][_0x3930('0x24')],function(_0x11290d){return{'name':_0x11290d[_0x3930('0x25')],'type':_0x11290d[_0x3930('0x26')][_0x3930('0x27')]};});_0xca904a[_0x3930('0x28')]=_[_0x3930('0x22')](_0x3b9168,_0x3930('0x1f'));_0xca904a[_0x3930('0x29')]=_[_0x3930('0x2a')](_0x575e76[_0x3930('0x29')]);_0xca904a[_0x3930('0x2b')]=_[_0x3930('0x2c')](_0xca904a[_0x3930('0x28')],_0xca904a[_0x3930('0x29')]);_0x121cce[_0x3930('0x2d')]=_[_0x3930('0x2c')](_0xca904a['model'],qs['fields'](_0x575e76['query'][_0x3930('0x2e')]));_0x121cce[_0x3930('0x2d')]=_0x121cce['attributes'][_0x3930('0x2f')]?_0x121cce[_0x3930('0x2d')]:_0xca904a['model'];if(!_0x575e76[_0x3930('0x29')]['hasOwnProperty'](_0x3930('0x30'))){_0x121cce[_0x3930('0x16')]=qs[_0x3930('0x16')](_0x575e76[_0x3930('0x29')][_0x3930('0x16')]);_0x121cce[_0x3930('0x15')]=qs[_0x3930('0x15')](_0x575e76[_0x3930('0x29')][_0x3930('0x15')]);}_0x121cce[_0x3930('0x31')]=qs[_0x3930('0x32')](_0x575e76[_0x3930('0x29')][_0x3930('0x32')]);_0x121cce[_0x3930('0x33')]=qs[_0x3930('0x2b')](_[_0x3930('0x34')](_0x575e76['query'],_0xca904a[_0x3930('0x2b')]),_0x3b9168);if(_0x575e76['query'][_0x3930('0x35')]){_0x121cce['where']=_[_0x3930('0x36')](_0x121cce['where'],{'$or':_['map'](_0x3b9168,function(_0x37cb76){if(_0x37cb76[_0x3930('0x26')]!=='VIRTUAL'){var _0x4f1717={};_0x4f1717[_0x37cb76[_0x3930('0x1f')]]={'$like':'%'+_0x575e76['query'][_0x3930('0x35')]+'%'};return _0x4f1717;}})});}_0x121cce=_[_0x3930('0x36')]({},_0x121cce,_0x575e76[_0x3930('0x37')]);var _0x3a8c7e={'where':_0x121cce[_0x3930('0x33')]};return db[_0x3930('0x23')][_0x3930('0x17')](_0x3a8c7e)[_0x3930('0x1b')](function(_0x4d6a5b){_0x51ceb9['count']=_0x4d6a5b;if(_0x575e76[_0x3930('0x29')][_0x3930('0x38')]){_0x121cce['include']=[{'all':!![]}];}return db['ChatQueueReport'][_0x3930('0x39')](_0x121cce);})[_0x3930('0x1b')](function(_0x5cab01){_0x51ceb9['rows']=_0x5cab01;return _0x51ceb9;})['then'](respondWithFilteredResult(_0x447d71,_0x121cce))[_0x3930('0x3a')](handleError(_0x447d71,null));};exports[_0x3930('0x3b')]=function(_0x3ddc79,_0x1f9076){var _0x5cc6d8={'raw':!![],'where':{'id':_0x3ddc79[_0x3930('0x3c')]['id']}},_0x5e7718={};_0x5e7718['model']=_[_0x3930('0x2a')](db[_0x3930('0x23')]['rawAttributes']);_0x5e7718[_0x3930('0x29')]=_['keys'](_0x3ddc79[_0x3930('0x29')]);_0x5e7718[_0x3930('0x2b')]=_[_0x3930('0x2c')](_0x5e7718[_0x3930('0x28')],_0x5e7718[_0x3930('0x29')]);_0x5cc6d8[_0x3930('0x2d')]=_[_0x3930('0x2c')](_0x5e7718[_0x3930('0x28')],qs[_0x3930('0x2e')](_0x3ddc79[_0x3930('0x29')][_0x3930('0x2e')]));_0x5cc6d8[_0x3930('0x2d')]=_0x5cc6d8[_0x3930('0x2d')][_0x3930('0x2f')]?_0x5cc6d8[_0x3930('0x2d')]:_0x5e7718['model'];if(_0x3ddc79[_0x3930('0x29')][_0x3930('0x38')]){_0x5cc6d8[_0x3930('0x3d')]=[{'all':!![]}];}_0x5cc6d8=_[_0x3930('0x36')]({},_0x5cc6d8,_0x3ddc79[_0x3930('0x37')]);return db[_0x3930('0x23')]['find'](_0x5cc6d8)[_0x3930('0x1b')](handleEntityNotFound(_0x1f9076,null))[_0x3930('0x1b')](respondWithResult(_0x1f9076,null))[_0x3930('0x3a')](handleError(_0x1f9076,null));};exports[_0x3930('0x3e')]=function(_0x576beb,_0xc5d137){return db['ChatQueueReport'][_0x3930('0x3e')](_0x576beb['body'],{})['then'](respondWithResult(_0xc5d137,0xc9))[_0x3930('0x3a')](handleError(_0xc5d137,null));};exports[_0x3930('0x1a')]=function(_0x5cbb07,_0x2bdb26){if(_0x5cbb07[_0x3930('0x3f')]['id']){delete _0x5cbb07[_0x3930('0x3f')]['id'];}return db[_0x3930('0x23')]['find']({'where':{'id':_0x5cbb07[_0x3930('0x3c')]['id']}})[_0x3930('0x1b')](handleEntityNotFound(_0x2bdb26,null))[_0x3930('0x1b')](saveUpdates(_0x5cbb07[_0x3930('0x3f')],null))['then'](respondWithResult(_0x2bdb26,null))[_0x3930('0x3a')](handleError(_0x2bdb26,null));};exports[_0x3930('0x1c')]=function(_0x435735,_0x2efbb4){return db[_0x3930('0x23')][_0x3930('0x40')]({'where':{'id':_0x435735['params']['id']}})[_0x3930('0x1b')](handleEntityNotFound(_0x2efbb4,null))[_0x3930('0x1b')](removeEntity(_0x2efbb4,null))['catch'](handleError(_0x2efbb4,null));};exports[_0x3930('0x41')]=function(_0x5b2707,_0x28d074){return db[_0x3930('0x23')][_0x3930('0x41')]()[_0x3930('0x1b')](respondWithResult(_0x28d074,null))['catch'](handleError(_0x28d074,null));}; \ No newline at end of file +var _0xf811=['error','stack','name','index','map','ChatQueueReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','pick','filter','where','merge','includeAll','include','findAll','catch','show','length','options','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','save','then','destroy'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xf811,0x6f));var _0x1f81=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0xf811[_0x55e08b];return _0xd1a7ff;};'use strict';var emlformat=require(_0x1f81('0x0'));var rimraf=require(_0x1f81('0x1'));var zipdir=require(_0x1f81('0x2'));var jsonpatch=require(_0x1f81('0x3'));var rp=require(_0x1f81('0x4'));var moment=require(_0x1f81('0x5'));var BPromise=require(_0x1f81('0x6'));var Mustache=require(_0x1f81('0x7'));var util=require(_0x1f81('0x8'));var path=require(_0x1f81('0x9'));var sox=require(_0x1f81('0xa'));var csv=require(_0x1f81('0xb'));var ejs=require(_0x1f81('0xc'));var fs=require('fs');var fs_extra=require(_0x1f81('0xd'));var _=require('lodash');var squel=require(_0x1f81('0xe'));var crypto=require(_0x1f81('0xf'));var jsforce=require(_0x1f81('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x1f81('0xb'));var querystring=require(_0x1f81('0x11'));var Papa=require('papaparse');var Redis=require(_0x1f81('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x1f81('0x13'));var as=require(_0x1f81('0x14'));var hardwareService=require(_0x1f81('0x15'));var logger=require(_0x1f81('0x16'))(_0x1f81('0x17'));var utils=require(_0x1f81('0x18'));var config=require(_0x1f81('0x19'));var licenseUtil=require(_0x1f81('0x1a'));var db=require(_0x1f81('0x1b'))['db'];function respondWithStatusCode(_0x111c85,_0x14851a){_0x14851a=_0x14851a||0xcc;return function(_0x1d9ef5){if(_0x1d9ef5){return _0x111c85[_0x1f81('0x1c')](_0x14851a);}return _0x111c85[_0x1f81('0x1d')](_0x14851a)[_0x1f81('0x1e')]();};}function respondWithResult(_0x247b10,_0x5a4992){_0x5a4992=_0x5a4992||0xc8;return function(_0x29941f){if(_0x29941f){return _0x247b10[_0x1f81('0x1d')](_0x5a4992)['json'](_0x29941f);}};}function respondWithFilteredResult(_0x5e1036,_0x20cea6){return function(_0x1a781d){if(_0x1a781d){var _0x5da9d1=typeof _0x20cea6[_0x1f81('0x1f')]===_0x1f81('0x20')&&typeof _0x20cea6[_0x1f81('0x21')]===_0x1f81('0x20');var _0x4bdba8=_0x1a781d['count'];var _0x13bf61=_0x5da9d1?0x0:_0x20cea6[_0x1f81('0x1f')];var _0x579638=_0x5da9d1?_0x1a781d[_0x1f81('0x22')]:_0x20cea6['offset']+_0x20cea6[_0x1f81('0x21')];var _0x1f9813;if(_0x579638>=_0x4bdba8){_0x579638=_0x4bdba8;_0x1f9813=0xc8;}else{_0x1f9813=0xce;}_0x5e1036[_0x1f81('0x1d')](_0x1f9813);return _0x5e1036['set'](_0x1f81('0x23'),_0x13bf61+'-'+_0x579638+'/'+_0x4bdba8)[_0x1f81('0x24')](_0x1a781d);}return null;};}function patchUpdates(_0x2d9b8d){return function(_0x3d35bd){try{jsonpatch[_0x1f81('0x25')](_0x3d35bd,_0x2d9b8d,!![]);}catch(_0x20e351){return BPromise['reject'](_0x20e351);}return _0x3d35bd[_0x1f81('0x26')]();};}function saveUpdates(_0x37b6ff,_0x3751d4){return function(_0x4ecfa9){if(_0x4ecfa9){return _0x4ecfa9['update'](_0x37b6ff)[_0x1f81('0x27')](function(_0x4aaf6e){return _0x4aaf6e;});}return null;};}function removeEntity(_0x13e8c5,_0x4f714a){return function(_0x59c93a){if(_0x59c93a){return _0x59c93a[_0x1f81('0x28')]()['then'](function(){_0x13e8c5[_0x1f81('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x21caa5,_0xe95e9c){return function(_0x147695){if(!_0x147695){_0x21caa5[_0x1f81('0x1c')](0x194);}return _0x147695;};}function handleError(_0x19dab0,_0x3d9e7a){_0x3d9e7a=_0x3d9e7a||0x1f4;return function(_0x2ff623){logger[_0x1f81('0x29')](_0x2ff623[_0x1f81('0x2a')]);if(_0x2ff623[_0x1f81('0x2b')]){delete _0x2ff623['name'];}_0x19dab0[_0x1f81('0x1d')](_0x3d9e7a)['send'](_0x2ff623);};}exports[_0x1f81('0x2c')]=function(_0x197da5,_0x537166){var _0x3d547b={},_0x186e42={},_0x218040={'count':0x0,'rows':[]};var _0x232750=_[_0x1f81('0x2d')](db[_0x1f81('0x2e')][_0x1f81('0x2f')],function(_0x381b5c){return{'name':_0x381b5c['fieldName'],'type':_0x381b5c[_0x1f81('0x30')][_0x1f81('0x31')]};});_0x186e42[_0x1f81('0x32')]=_[_0x1f81('0x2d')](_0x232750,_0x1f81('0x2b'));_0x186e42[_0x1f81('0x33')]=_[_0x1f81('0x34')](_0x197da5[_0x1f81('0x33')]);_0x186e42[_0x1f81('0x35')]=_[_0x1f81('0x36')](_0x186e42[_0x1f81('0x32')],_0x186e42['query']);_0x3d547b[_0x1f81('0x37')]=_[_0x1f81('0x36')](_0x186e42[_0x1f81('0x32')],qs[_0x1f81('0x38')](_0x197da5['query'][_0x1f81('0x38')]));_0x3d547b[_0x1f81('0x37')]=_0x3d547b[_0x1f81('0x37')]['length']?_0x3d547b['attributes']:_0x186e42[_0x1f81('0x32')];if(!_0x197da5['query'][_0x1f81('0x39')]('nolimit')){_0x3d547b[_0x1f81('0x21')]=qs[_0x1f81('0x21')](_0x197da5[_0x1f81('0x33')][_0x1f81('0x21')]);_0x3d547b[_0x1f81('0x1f')]=qs[_0x1f81('0x1f')](_0x197da5[_0x1f81('0x33')]['offset']);}_0x3d547b[_0x1f81('0x3a')]=qs['sort'](_0x197da5[_0x1f81('0x33')][_0x1f81('0x3b')]);_0x3d547b['where']=qs[_0x1f81('0x35')](_[_0x1f81('0x3c')](_0x197da5[_0x1f81('0x33')],_0x186e42['filters']),_0x232750);if(_0x197da5[_0x1f81('0x33')][_0x1f81('0x3d')]){_0x3d547b[_0x1f81('0x3e')]=_[_0x1f81('0x3f')](_0x3d547b[_0x1f81('0x3e')],{'$or':_['map'](_0x232750,function(_0x1823ee){if(_0x1823ee[_0x1f81('0x30')]!=='VIRTUAL'){var _0x5a57d1={};_0x5a57d1[_0x1823ee['name']]={'$like':'%'+_0x197da5[_0x1f81('0x33')][_0x1f81('0x3d')]+'%'};return _0x5a57d1;}})});}_0x3d547b=_['merge']({},_0x3d547b,_0x197da5['options']);var _0x4ec05c={'where':_0x3d547b[_0x1f81('0x3e')]};return db[_0x1f81('0x2e')]['count'](_0x4ec05c)[_0x1f81('0x27')](function(_0x29b54f){_0x218040[_0x1f81('0x22')]=_0x29b54f;if(_0x197da5['query'][_0x1f81('0x40')]){_0x3d547b[_0x1f81('0x41')]=[{'all':!![]}];}return db[_0x1f81('0x2e')][_0x1f81('0x42')](_0x3d547b);})[_0x1f81('0x27')](function(_0xb0d536){_0x218040['rows']=_0xb0d536;return _0x218040;})[_0x1f81('0x27')](respondWithFilteredResult(_0x537166,_0x3d547b))[_0x1f81('0x43')](handleError(_0x537166,null));};exports[_0x1f81('0x44')]=function(_0x176884,_0x5a22a4){var _0x2c9c48={'raw':!![],'where':{'id':_0x176884['params']['id']}},_0x15c1b9={};_0x15c1b9[_0x1f81('0x32')]=_['keys'](db[_0x1f81('0x2e')]['rawAttributes']);_0x15c1b9[_0x1f81('0x33')]=_['keys'](_0x176884[_0x1f81('0x33')]);_0x15c1b9[_0x1f81('0x35')]=_[_0x1f81('0x36')](_0x15c1b9['model'],_0x15c1b9[_0x1f81('0x33')]);_0x2c9c48[_0x1f81('0x37')]=_['intersection'](_0x15c1b9[_0x1f81('0x32')],qs[_0x1f81('0x38')](_0x176884[_0x1f81('0x33')][_0x1f81('0x38')]));_0x2c9c48[_0x1f81('0x37')]=_0x2c9c48[_0x1f81('0x37')][_0x1f81('0x45')]?_0x2c9c48['attributes']:_0x15c1b9[_0x1f81('0x32')];if(_0x176884[_0x1f81('0x33')]['includeAll']){_0x2c9c48[_0x1f81('0x41')]=[{'all':!![]}];}_0x2c9c48=_[_0x1f81('0x3f')]({},_0x2c9c48,_0x176884[_0x1f81('0x46')]);return db['ChatQueueReport'][_0x1f81('0x47')](_0x2c9c48)[_0x1f81('0x27')](handleEntityNotFound(_0x5a22a4,null))['then'](respondWithResult(_0x5a22a4,null))[_0x1f81('0x43')](handleError(_0x5a22a4,null));};exports['create']=function(_0x51bd8d,_0x19f10d){return db[_0x1f81('0x2e')][_0x1f81('0x48')](_0x51bd8d['body'],{})['then'](respondWithResult(_0x19f10d,0xc9))[_0x1f81('0x43')](handleError(_0x19f10d,null));};exports['update']=function(_0x9a7ddb,_0x388936){if(_0x9a7ddb[_0x1f81('0x49')]['id']){delete _0x9a7ddb[_0x1f81('0x49')]['id'];}return db[_0x1f81('0x2e')]['find']({'where':{'id':_0x9a7ddb[_0x1f81('0x4a')]['id']}})[_0x1f81('0x27')](handleEntityNotFound(_0x388936,null))[_0x1f81('0x27')](saveUpdates(_0x9a7ddb[_0x1f81('0x49')],null))['then'](respondWithResult(_0x388936,null))['catch'](handleError(_0x388936,null));};exports[_0x1f81('0x28')]=function(_0x271570,_0x56beff){return db[_0x1f81('0x2e')]['find']({'where':{'id':_0x271570[_0x1f81('0x4a')]['id']}})['then'](handleEntityNotFound(_0x56beff,null))[_0x1f81('0x27')](removeEntity(_0x56beff,null))['catch'](handleError(_0x56beff,null));};exports[_0x1f81('0x4b')]=function(_0x53a454,_0x45729c){return db[_0x1f81('0x2e')][_0x1f81('0x4b')]()['then'](respondWithResult(_0x45729c,null))[_0x1f81('0x43')](handleError(_0x45729c,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index 5686701..2b1e392 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 _0x757a=['report_chat_queue','uniqueid','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define'];(function(_0x12c944,_0x3a3a06){var _0xebfda5=function(_0x668806){while(--_0x668806){_0x12c944['push'](_0x12c944['shift']());}};_0xebfda5(++_0x3a3a06);}(_0x757a,0xde));var _0xa757=function(_0xb80757,_0x53340a){_0xb80757=_0xb80757-0x0;var _0x2daefe=_0x757a[_0xb80757];return _0x2daefe;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x2'));var fs=require('fs');var path=require(_0xa757('0x3'));var rimraf=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var attributes=require(_0xa757('0x6'));module[_0xa757('0x7')]=function(_0x5edca8,_0xae0e7c){return _0x5edca8[_0xa757('0x8')]('ChatQueueReport',attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[{'name':_0xa757('0xa'),'fields':[_0xa757('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xbaf0=['define','ChatQueueReport','report_chat_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports'];(function(_0x4e00e4,_0x58fd04){var _0x421c55=function(_0xcd71c5){while(--_0xcd71c5){_0x4e00e4['push'](_0x4e00e4['shift']());}};_0x421c55(++_0x58fd04);}(_0xbaf0,0x12a));var _0x0baf=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xbaf0[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));module[_0x0baf('0x9')]=function(_0xe4c3c4,_0x335e24){return _0xe4c3c4[_0x0baf('0xa')](_0x0baf('0xb'),attributes,{'tableName':_0x0baf('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0baf('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index 7dd3764..b753082 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 _0x081c=['catch','ChatQueueReport','body','options','raw','CreateChatQueueReport','debug','UpdateChatQueueReport','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','code','error','ChatQueueReport,\x20%s,\x20%s','message'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x081c,0xd7));var _0xc081=function(_0x416a3c,_0x481c83){_0x416a3c=_0x416a3c-0x0;var _0x2a055d=_0x081c[_0x416a3c];return _0x2a055d;};'use strict';var _=require(_0xc081('0x0'));var util=require(_0xc081('0x1'));var moment=require(_0xc081('0x2'));var BPromise=require(_0xc081('0x3'));var rs=require(_0xc081('0x4'));var fs=require('fs');var Redis=require(_0xc081('0x5'));var db=require(_0xc081('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xc081('0x7'))(_0xc081('0x8'));var config=require(_0xc081('0x9'));var jayson=require(_0xc081('0xa'));var client=jayson[_0xc081('0xb')][_0xc081('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x85f165,_0x29539d,_0x16089f){return new BPromise(function(_0x43d6f3,_0x1cfbe2){return client[_0xc081('0xd')](_0x85f165,_0x16089f)[_0xc081('0xe')](function(_0x50e75a){logger[_0xc081('0xf')]('ChatQueueReport,\x20%s,\x20%s',_0x29539d,_0xc081('0x10'));logger['debug'](_0xc081('0x11'),_0x29539d,_0xc081('0x10'),JSON[_0xc081('0x12')](_0x50e75a));if(_0x50e75a['error']){if(_0x50e75a['error'][_0xc081('0x13')]===0x1f4){logger[_0xc081('0x14')](_0xc081('0x15'),_0x29539d,_0x50e75a['error'][_0xc081('0x16')]);return _0x1cfbe2(_0x50e75a[_0xc081('0x14')][_0xc081('0x16')]);}logger[_0xc081('0x14')](_0xc081('0x15'),_0x29539d,_0x50e75a[_0xc081('0x14')][_0xc081('0x16')]);return _0x43d6f3(_0x50e75a['error'][_0xc081('0x16')]);}else{logger[_0xc081('0xf')](_0xc081('0x15'),_0x29539d,'request\x20sent');_0x43d6f3(_0x50e75a['result'][_0xc081('0x16')]);}})[_0xc081('0x17')](function(_0x56e454){logger['error'](_0xc081('0x15'),_0x29539d,_0x56e454);_0x1cfbe2(_0x56e454);});});}exports['CreateChatQueueReport']=function(_0x529e49){var _0x3b0e22=this;return new Promise(function(_0x5c837a,_0x43ab94){return db[_0xc081('0x18')]['create'](_0x529e49[_0xc081('0x19')],{'raw':_0x529e49['options']?_0x529e49[_0xc081('0x1a')][_0xc081('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0xb14a50){logger[_0xc081('0xf')](_0xc081('0x1c'),_0x529e49);logger[_0xc081('0x1d')](_0xc081('0x1c'),_0x529e49,JSON['stringify'](_0xb14a50));_0x5c837a(_0xb14a50);})[_0xc081('0x17')](function(_0x2ef1b3){logger['error'](_0xc081('0x1c'),_0x2ef1b3[_0xc081('0x16')],_0x529e49);_0x43ab94(_0x3b0e22['error'](0x1f4,_0x2ef1b3[_0xc081('0x16')]));});});};exports[_0xc081('0x1e')]=function(_0x29c0fa){var _0x5f5410=this;return new Promise(function(_0x33d506,_0x5aa45c){return db[_0xc081('0x18')]['update'](_0x29c0fa[_0xc081('0x19')],{'raw':_0x29c0fa[_0xc081('0x1a')]?_0x29c0fa['options'][_0xc081('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x29c0fa['options']?_0x29c0fa['options'][_0xc081('0x1f')]||null:null,'attributes':_0x29c0fa[_0xc081('0x1a')]?_0x29c0fa[_0xc081('0x1a')][_0xc081('0x20')]||null:null,'limit':_0x29c0fa[_0xc081('0x1a')]?_0x29c0fa[_0xc081('0x1a')][_0xc081('0x21')]||null:null})[_0xc081('0xe')](function(_0x55d712){logger[_0xc081('0xf')](_0xc081('0x1e'),_0x29c0fa);logger[_0xc081('0x1d')](_0xc081('0x1e'),_0x29c0fa,JSON[_0xc081('0x12')](_0x55d712));_0x33d506(_0x55d712);})[_0xc081('0x17')](function(_0x1ad3ef){logger['error']('UpdateChatQueueReport',_0x1ad3ef[_0xc081('0x16')],_0x29c0fa);_0x5aa45c(_0x5f5410[_0xc081('0x14')](0x1f4,_0x1ad3ef['message']));});});}; \ No newline at end of file +var _0x6685=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','catch','CreateChatQueueReport','body','raw','options','where','attributes','limit','UpdateChatQueueReport','util','moment','bluebird'];(function(_0x484783,_0x5adb3b){var _0x583af8=function(_0x46d5f2){while(--_0x46d5f2){_0x484783['push'](_0x484783['shift']());}};_0x583af8(++_0x5adb3b);}(_0x6685,0xfd));var _0x5668=function(_0x10826b,_0x4449df){_0x10826b=_0x10826b-0x0;var _0x9e8258=_0x6685[_0x10826b];return _0x9e8258;};'use strict';var _=require('lodash');var util=require(_0x5668('0x0'));var moment=require(_0x5668('0x1'));var BPromise=require(_0x5668('0x2'));var rs=require(_0x5668('0x3'));var fs=require('fs');var Redis=require(_0x5668('0x4'));var db=require(_0x5668('0x5'))['db'];var utils=require(_0x5668('0x6'));var logger=require('../../config/logger')(_0x5668('0x7'));var config=require(_0x5668('0x8'));var jayson=require(_0x5668('0x9'));var client=jayson[_0x5668('0xa')][_0x5668('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x9a4434,_0x472ae2,_0x47792f){return new BPromise(function(_0x1e50f1,_0x1840ac){return client[_0x5668('0xc')](_0x9a4434,_0x47792f)[_0x5668('0xd')](function(_0x1c5306){logger[_0x5668('0xe')](_0x5668('0xf'),_0x472ae2,'request\x20sent');logger[_0x5668('0x10')](_0x5668('0x11'),_0x472ae2,_0x5668('0x12'),JSON[_0x5668('0x13')](_0x1c5306));if(_0x1c5306['error']){if(_0x1c5306['error'][_0x5668('0x14')]===0x1f4){logger[_0x5668('0x15')]('ChatQueueReport,\x20%s,\x20%s',_0x472ae2,_0x1c5306[_0x5668('0x15')][_0x5668('0x16')]);return _0x1840ac(_0x1c5306[_0x5668('0x15')][_0x5668('0x16')]);}logger[_0x5668('0x15')](_0x5668('0xf'),_0x472ae2,_0x1c5306[_0x5668('0x15')][_0x5668('0x16')]);return _0x1e50f1(_0x1c5306[_0x5668('0x15')]['message']);}else{logger['info']('ChatQueueReport,\x20%s,\x20%s',_0x472ae2,_0x5668('0x12'));_0x1e50f1(_0x1c5306['result']['message']);}})[_0x5668('0x17')](function(_0x2dfa0d){logger['error'](_0x5668('0xf'),_0x472ae2,_0x2dfa0d);_0x1840ac(_0x2dfa0d);});});}exports[_0x5668('0x18')]=function(_0x2df44e){var _0x3bd764=this;return new Promise(function(_0x1572d8,_0xe72742){return db['ChatQueueReport']['create'](_0x2df44e[_0x5668('0x19')],{'raw':_0x2df44e['options']?_0x2df44e['options'][_0x5668('0x1a')]===undefined?!![]:![]:!![]})[_0x5668('0xd')](function(_0x4876fe){logger[_0x5668('0xe')](_0x5668('0x18'),_0x2df44e);logger['debug'](_0x5668('0x18'),_0x2df44e,JSON[_0x5668('0x13')](_0x4876fe));_0x1572d8(_0x4876fe);})['catch'](function(_0x411d38){logger[_0x5668('0x15')]('CreateChatQueueReport',_0x411d38['message'],_0x2df44e);_0xe72742(_0x3bd764[_0x5668('0x15')](0x1f4,_0x411d38[_0x5668('0x16')]));});});};exports['UpdateChatQueueReport']=function(_0x374d80){var _0x1a8d3d=this;return new Promise(function(_0x51e398,_0x383268){return db['ChatQueueReport']['update'](_0x374d80[_0x5668('0x19')],{'raw':_0x374d80[_0x5668('0x1b')]?_0x374d80[_0x5668('0x1b')][_0x5668('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x374d80[_0x5668('0x1b')]?_0x374d80[_0x5668('0x1b')][_0x5668('0x1c')]||null:null,'attributes':_0x374d80['options']?_0x374d80[_0x5668('0x1b')][_0x5668('0x1d')]||null:null,'limit':_0x374d80['options']?_0x374d80[_0x5668('0x1b')][_0x5668('0x1e')]||null:null})[_0x5668('0xd')](function(_0x127874){logger[_0x5668('0xe')](_0x5668('0x1f'),_0x374d80);logger[_0x5668('0x10')](_0x5668('0x1f'),_0x374d80,JSON[_0x5668('0x13')](_0x127874));_0x51e398(_0x127874);})[_0x5668('0x17')](function(_0x5e7e98){logger[_0x5668('0x15')](_0x5668('0x1f'),_0x5e7e98[_0x5668('0x16')],_0x374d80);_0x383268(_0x1a8d3d[_0x5668('0x15')](0x1f4,_0x5e7e98['message']));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index 60e1c02..6047c69 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 _0xa319=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatQueueReport.controller','isAuthenticated','get','/describe','describe','/:id','show','post','create','update','delete','exports','multer','util'];(function(_0x5317b5,_0x4dfd6e){var _0x3b7ce2=function(_0xc146d6){while(--_0xc146d6){_0x5317b5['push'](_0x5317b5['shift']());}};_0x3b7ce2(++_0x4dfd6e);}(_0xa319,0x178));var _0x9a31=function(_0x1caf21,_0x48a169){_0x1caf21=_0x1caf21-0x0;var _0x55e77f=_0xa319[_0x1caf21];return _0x55e77f;};'use strict';var multer=require(_0x9a31('0x0'));var util=require(_0x9a31('0x1'));var path=require(_0x9a31('0x2'));var timeout=require(_0x9a31('0x3'));var express=require(_0x9a31('0x4'));var router=express[_0x9a31('0x5')]();var fs_extra=require(_0x9a31('0x6'));var auth=require(_0x9a31('0x7'));var interaction=require(_0x9a31('0x8'));var config=require('../../config/environment');var controller=require(_0x9a31('0x9'));router['get']('/',auth[_0x9a31('0xa')](),controller['index']);router[_0x9a31('0xb')](_0x9a31('0xc'),auth[_0x9a31('0xa')](),controller[_0x9a31('0xd')]);router[_0x9a31('0xb')](_0x9a31('0xe'),auth['isAuthenticated'](),controller[_0x9a31('0xf')]);router[_0x9a31('0x10')]('/',auth[_0x9a31('0xa')](),controller[_0x9a31('0x11')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x9a31('0x12')]);router[_0x9a31('0x13')](_0x9a31('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x9a31('0x14')]=router; \ No newline at end of file +var _0xd76d=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','isAuthenticated','index','get','/describe','describe','/:id','create','put','destroy','exports'];(function(_0x1469f6,_0x1811c5){var _0x1a43cf=function(_0x2e810e){while(--_0x2e810e){_0x1469f6['push'](_0x1469f6['shift']());}};_0x1a43cf(++_0x1811c5);}(_0xd76d,0xe4));var _0xdd76=function(_0xf845cc,_0x7bce78){_0xf845cc=_0xf845cc-0x0;var _0x24da94=_0xd76d[_0xf845cc];return _0x24da94;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xdd76('0x0'));var timeout=require(_0xdd76('0x1'));var express=require(_0xdd76('0x2'));var router=express[_0xdd76('0x3')]();var fs_extra=require(_0xdd76('0x4'));var auth=require(_0xdd76('0x5'));var interaction=require(_0xdd76('0x6'));var config=require(_0xdd76('0x7'));var controller=require(_0xdd76('0x8'));router['get']('/',auth[_0xdd76('0x9')](),controller[_0xdd76('0xa')]);router[_0xdd76('0xb')](_0xdd76('0xc'),auth[_0xdd76('0x9')](),controller[_0xdd76('0xd')]);router[_0xdd76('0xb')](_0xdd76('0xe'),auth[_0xdd76('0x9')](),controller['show']);router['post']('/',auth[_0xdd76('0x9')](),controller[_0xdd76('0xf')]);router[_0xdd76('0x10')]('/:id',auth[_0xdd76('0x9')](),controller['update']);router['delete'](_0xdd76('0xe'),auth[_0xdd76('0x9')](),controller[_0xdd76('0x11')]);module[_0xdd76('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index 7055265..dc740e0 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 _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0x10f100,_0x20f3d3){var _0x51546e=function(_0x488217){while(--_0x488217){_0x10f100['push'](_0x10f100['shift']());}};_0x51546e(++_0x20f3d3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xa9e0[_0x6131cd];return _0x47e916;};'use strict';var moment=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x3'),'agent',_0x0a9e('0x4')),'allowNull':![],'defaultValue':_0x0a9e('0x4')},'transferredAt':{'type':Sequelize[_0x0a9e('0x5')],'allowNull':![],'defaultValue':Sequelize[_0x0a9e('0x6')]}}; \ No newline at end of file +var _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x524862,_0x51a6ff){var _0x5e225d=function(_0x3aedbd){while(--_0x3aedbd){_0x524862['push'](_0x524862['shift']());}};_0x5e225d(++_0x51a6ff);}(_0xedd9,0xfc));var _0x9edd=function(_0x2aa2e9,_0x4b05c7){_0x2aa2e9=_0x2aa2e9-0x0;var _0x2dbc4d=_0xedd9[_0x2aa2e9];return _0x2dbc4d;};'use strict';var moment=require('moment');var Sequelize=require(_0x9edd('0x0'));module[_0x9edd('0x1')]={'uniqueid':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9edd('0x3')](_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6')),'allowNull':![],'defaultValue':_0x9edd('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x9edd('0x7')]}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index 2462d6f..854dd27 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 _0xc1e0=['update','params','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','crypto','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','limit','Content-Range','apply','reject','save','then','destroy','error','name','send','index','ChatTransferReport','rawAttributes','fieldName','type','key','map','query','keys','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','offset','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','body'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0xc1e0,0xe7));var _0x0c1e=function(_0x29059d,_0x332387){_0x29059d=_0x29059d-0x0;var _0x4d5f08=_0xc1e0[_0x29059d];return _0x4d5f08;};'use strict';var emlformat=require(_0x0c1e('0x0'));var rimraf=require(_0x0c1e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0c1e('0x2'));var rp=require(_0x0c1e('0x3'));var moment=require(_0x0c1e('0x4'));var BPromise=require(_0x0c1e('0x5'));var Mustache=require('mustache');var util=require(_0x0c1e('0x6'));var path=require(_0x0c1e('0x7'));var sox=require(_0x0c1e('0x8'));var csv=require(_0x0c1e('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0c1e('0xa'));var _=require(_0x0c1e('0xb'));var squel=require('squel');var crypto=require(_0x0c1e('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0c1e('0xd'));var Redis=require(_0x0c1e('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x0c1e('0xf'));var as=require(_0x0c1e('0x10'));var hardwareService=require(_0x0c1e('0x11'));var logger=require('../../config/logger')(_0x0c1e('0x12'));var utils=require(_0x0c1e('0x13'));var config=require(_0x0c1e('0x14'));var licenseUtil=require(_0x0c1e('0x15'));var db=require(_0x0c1e('0x16'))['db'];function respondWithStatusCode(_0x7639cf,_0x129851){_0x129851=_0x129851||0xcc;return function(_0x789fc0){if(_0x789fc0){return _0x7639cf[_0x0c1e('0x17')](_0x129851);}return _0x7639cf[_0x0c1e('0x18')](_0x129851)[_0x0c1e('0x19')]();};}function respondWithResult(_0x54b1ec,_0x4017cd){_0x4017cd=_0x4017cd||0xc8;return function(_0x2fd6e4){if(_0x2fd6e4){return _0x54b1ec['status'](_0x4017cd)[_0x0c1e('0x1a')](_0x2fd6e4);}};}function respondWithFilteredResult(_0x53f9a3,_0x4db2de){return function(_0x1425da){if(_0x1425da){var _0x44e94c=typeof _0x4db2de['offset']===_0x0c1e('0x1b')&&typeof _0x4db2de['limit']===_0x0c1e('0x1b');var _0x5dcdc2=_0x1425da['count'];var _0x4ba793=_0x44e94c?0x0:_0x4db2de['offset'];var _0x2a1ff3=_0x44e94c?_0x1425da[_0x0c1e('0x1c')]:_0x4db2de['offset']+_0x4db2de[_0x0c1e('0x1d')];var _0x3ce25e;if(_0x2a1ff3>=_0x5dcdc2){_0x2a1ff3=_0x5dcdc2;_0x3ce25e=0xc8;}else{_0x3ce25e=0xce;}_0x53f9a3[_0x0c1e('0x18')](_0x3ce25e);return _0x53f9a3['set'](_0x0c1e('0x1e'),_0x4ba793+'-'+_0x2a1ff3+'/'+_0x5dcdc2)[_0x0c1e('0x1a')](_0x1425da);}return null;};}function patchUpdates(_0x213562){return function(_0x1fdc9b){try{jsonpatch[_0x0c1e('0x1f')](_0x1fdc9b,_0x213562,!![]);}catch(_0x42b13d){return BPromise[_0x0c1e('0x20')](_0x42b13d);}return _0x1fdc9b[_0x0c1e('0x21')]();};}function saveUpdates(_0x18e1c2,_0x4a67ad){return function(_0x3753fe){if(_0x3753fe){return _0x3753fe['update'](_0x18e1c2)[_0x0c1e('0x22')](function(_0x484eee){return _0x484eee;});}return null;};}function removeEntity(_0xa127db,_0xc4ef8e){return function(_0x174119){if(_0x174119){return _0x174119[_0x0c1e('0x23')]()[_0x0c1e('0x22')](function(){_0xa127db['status'](0xcc)[_0x0c1e('0x19')]();});}};}function handleEntityNotFound(_0xeb7dde,_0x557c59){return function(_0x5b8619){if(!_0x5b8619){_0xeb7dde[_0x0c1e('0x17')](0x194);}return _0x5b8619;};}function handleError(_0x472130,_0x20f02b){_0x20f02b=_0x20f02b||0x1f4;return function(_0xcbf211){logger[_0x0c1e('0x24')](_0xcbf211['stack']);if(_0xcbf211[_0x0c1e('0x25')]){delete _0xcbf211[_0x0c1e('0x25')];}_0x472130[_0x0c1e('0x18')](_0x20f02b)[_0x0c1e('0x26')](_0xcbf211);};}exports[_0x0c1e('0x27')]=function(_0x312a34,_0xd1d45e){var _0x473da9={},_0x36e5b8={},_0x2fcade={'count':0x0,'rows':[]};var _0x414bfe=_['map'](db[_0x0c1e('0x28')][_0x0c1e('0x29')],function(_0x52dbc6){return{'name':_0x52dbc6[_0x0c1e('0x2a')],'type':_0x52dbc6[_0x0c1e('0x2b')][_0x0c1e('0x2c')]};});_0x36e5b8['model']=_[_0x0c1e('0x2d')](_0x414bfe,'name');_0x36e5b8[_0x0c1e('0x2e')]=_[_0x0c1e('0x2f')](_0x312a34[_0x0c1e('0x2e')]);_0x36e5b8['filters']=_[_0x0c1e('0x30')](_0x36e5b8['model'],_0x36e5b8[_0x0c1e('0x2e')]);_0x473da9[_0x0c1e('0x31')]=_[_0x0c1e('0x30')](_0x36e5b8['model'],qs[_0x0c1e('0x32')](_0x312a34[_0x0c1e('0x2e')]['fields']));_0x473da9[_0x0c1e('0x31')]=_0x473da9[_0x0c1e('0x31')][_0x0c1e('0x33')]?_0x473da9[_0x0c1e('0x31')]:_0x36e5b8[_0x0c1e('0x34')];if(!_0x312a34[_0x0c1e('0x2e')][_0x0c1e('0x35')](_0x0c1e('0x36'))){_0x473da9[_0x0c1e('0x1d')]=qs['limit'](_0x312a34[_0x0c1e('0x2e')]['limit']);_0x473da9[_0x0c1e('0x37')]=qs['offset'](_0x312a34['query'][_0x0c1e('0x37')]);}_0x473da9[_0x0c1e('0x38')]=qs['sort'](_0x312a34[_0x0c1e('0x2e')][_0x0c1e('0x39')]);_0x473da9[_0x0c1e('0x3a')]=qs[_0x0c1e('0x3b')](_[_0x0c1e('0x3c')](_0x312a34[_0x0c1e('0x2e')],_0x36e5b8[_0x0c1e('0x3b')]),_0x414bfe);if(_0x312a34[_0x0c1e('0x2e')][_0x0c1e('0x3d')]){_0x473da9[_0x0c1e('0x3a')]=_[_0x0c1e('0x3e')](_0x473da9['where'],{'$or':_[_0x0c1e('0x2d')](_0x414bfe,function(_0xce21fd){if(_0xce21fd[_0x0c1e('0x2b')]!==_0x0c1e('0x3f')){var _0xf712ac={};_0xf712ac[_0xce21fd[_0x0c1e('0x25')]]={'$like':'%'+_0x312a34['query'][_0x0c1e('0x3d')]+'%'};return _0xf712ac;}})});}_0x473da9=_[_0x0c1e('0x3e')]({},_0x473da9,_0x312a34[_0x0c1e('0x40')]);var _0x11a4ba={'where':_0x473da9[_0x0c1e('0x3a')]};return db[_0x0c1e('0x28')][_0x0c1e('0x1c')](_0x11a4ba)['then'](function(_0x443cdb){_0x2fcade[_0x0c1e('0x1c')]=_0x443cdb;if(_0x312a34[_0x0c1e('0x2e')][_0x0c1e('0x41')]){_0x473da9[_0x0c1e('0x42')]=[{'all':!![]}];}return db[_0x0c1e('0x28')][_0x0c1e('0x43')](_0x473da9);})[_0x0c1e('0x22')](function(_0x2c5b6d){_0x2fcade[_0x0c1e('0x44')]=_0x2c5b6d;return _0x2fcade;})[_0x0c1e('0x22')](respondWithFilteredResult(_0xd1d45e,_0x473da9))[_0x0c1e('0x45')](handleError(_0xd1d45e,null));};exports[_0x0c1e('0x46')]=function(_0x276062,_0x1aa175){var _0x11038d={'raw':!![],'where':{'id':_0x276062['params']['id']}},_0x5738d0={};_0x5738d0[_0x0c1e('0x34')]=_['keys'](db[_0x0c1e('0x28')][_0x0c1e('0x29')]);_0x5738d0['query']=_[_0x0c1e('0x2f')](_0x276062[_0x0c1e('0x2e')]);_0x5738d0[_0x0c1e('0x3b')]=_[_0x0c1e('0x30')](_0x5738d0[_0x0c1e('0x34')],_0x5738d0[_0x0c1e('0x2e')]);_0x11038d['attributes']=_[_0x0c1e('0x30')](_0x5738d0[_0x0c1e('0x34')],qs[_0x0c1e('0x32')](_0x276062['query']['fields']));_0x11038d['attributes']=_0x11038d['attributes'][_0x0c1e('0x33')]?_0x11038d[_0x0c1e('0x31')]:_0x5738d0[_0x0c1e('0x34')];if(_0x276062[_0x0c1e('0x2e')][_0x0c1e('0x41')]){_0x11038d['include']=[{'all':!![]}];}_0x11038d=_[_0x0c1e('0x3e')]({},_0x11038d,_0x276062[_0x0c1e('0x40')]);return db[_0x0c1e('0x28')][_0x0c1e('0x47')](_0x11038d)[_0x0c1e('0x22')](handleEntityNotFound(_0x1aa175,null))[_0x0c1e('0x22')](respondWithResult(_0x1aa175,null))[_0x0c1e('0x45')](handleError(_0x1aa175,null));};exports['create']=function(_0x1393d7,_0x540176){return db['ChatTransferReport']['create'](_0x1393d7[_0x0c1e('0x48')],{})[_0x0c1e('0x22')](respondWithResult(_0x540176,0xc9))['catch'](handleError(_0x540176,null));};exports[_0x0c1e('0x49')]=function(_0x5d960b,_0x53dbb0){if(_0x5d960b[_0x0c1e('0x48')]['id']){delete _0x5d960b['body']['id'];}return db['ChatTransferReport'][_0x0c1e('0x47')]({'where':{'id':_0x5d960b[_0x0c1e('0x4a')]['id']}})[_0x0c1e('0x22')](handleEntityNotFound(_0x53dbb0,null))[_0x0c1e('0x22')](saveUpdates(_0x5d960b[_0x0c1e('0x48')],null))[_0x0c1e('0x22')](respondWithResult(_0x53dbb0,null))[_0x0c1e('0x45')](handleError(_0x53dbb0,null));};exports['destroy']=function(_0x6a2a71,_0x1c7ebf){return db[_0x0c1e('0x28')][_0x0c1e('0x47')]({'where':{'id':_0x6a2a71[_0x0c1e('0x4a')]['id']}})[_0x0c1e('0x22')](handleEntityNotFound(_0x1c7ebf,null))[_0x0c1e('0x22')](removeEntity(_0x1c7ebf,null))['catch'](handleError(_0x1c7ebf,null));};exports[_0x0c1e('0x4b')]=function(_0x28f79d,_0x39a969){return db[_0x0c1e('0x28')][_0x0c1e('0x4b')]()[_0x0c1e('0x22')](respondWithResult(_0x39a969,null))[_0x0c1e('0x45')](handleError(_0x39a969,null));}; \ No newline at end of file +var _0xf0a8=['zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','ChatTransferReport','rawAttributes','fieldName','key','filters','intersection','model','query','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','describe','rimraf'];(function(_0x4f6703,_0x35ef58){var _0x311437=function(_0x585600){while(--_0x585600){_0x4f6703['push'](_0x4f6703['shift']());}};_0x311437(++_0x35ef58);}(_0xf0a8,0x12f));var _0x8f0a=function(_0x45606e,_0x22c5b0){_0x45606e=_0x45606e-0x0;var _0x788a25=_0xf0a8[_0x45606e];return _0x788a25;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8f0a('0x0'));var zipdir=require(_0x8f0a('0x1'));var jsonpatch=require(_0x8f0a('0x2'));var rp=require(_0x8f0a('0x3'));var moment=require(_0x8f0a('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x8f0a('0x5'));var util=require(_0x8f0a('0x6'));var path=require(_0x8f0a('0x7'));var sox=require(_0x8f0a('0x8'));var csv=require(_0x8f0a('0x9'));var ejs=require(_0x8f0a('0xa'));var fs=require('fs');var fs_extra=require(_0x8f0a('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x8f0a('0xc'));var jsforce=require(_0x8f0a('0xd'));var deskjs=require(_0x8f0a('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x8f0a('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8f0a('0x10'));var logger=require(_0x8f0a('0x11'))(_0x8f0a('0x12'));var utils=require(_0x8f0a('0x13'));var config=require(_0x8f0a('0x14'));var licenseUtil=require(_0x8f0a('0x15'));var db=require(_0x8f0a('0x16'))['db'];function respondWithStatusCode(_0x4d9980,_0x481d15){_0x481d15=_0x481d15||0xcc;return function(_0x221184){if(_0x221184){return _0x4d9980[_0x8f0a('0x17')](_0x481d15);}return _0x4d9980[_0x8f0a('0x18')](_0x481d15)[_0x8f0a('0x19')]();};}function respondWithResult(_0x11b49a,_0x4fb84){_0x4fb84=_0x4fb84||0xc8;return function(_0x44a730){if(_0x44a730){return _0x11b49a[_0x8f0a('0x18')](_0x4fb84)[_0x8f0a('0x1a')](_0x44a730);}};}function respondWithFilteredResult(_0x3ed2a0,_0x59d439){return function(_0x3223d8){if(_0x3223d8){var _0x1c4d48=typeof _0x59d439[_0x8f0a('0x1b')]===_0x8f0a('0x1c')&&typeof _0x59d439[_0x8f0a('0x1d')]===_0x8f0a('0x1c');var _0x22315b=_0x3223d8['count'];var _0x13d1a3=_0x1c4d48?0x0:_0x59d439[_0x8f0a('0x1b')];var _0x1ae136=_0x1c4d48?_0x3223d8[_0x8f0a('0x1e')]:_0x59d439[_0x8f0a('0x1b')]+_0x59d439['limit'];var _0xa3c6e3;if(_0x1ae136>=_0x22315b){_0x1ae136=_0x22315b;_0xa3c6e3=0xc8;}else{_0xa3c6e3=0xce;}_0x3ed2a0[_0x8f0a('0x18')](_0xa3c6e3);return _0x3ed2a0[_0x8f0a('0x1f')](_0x8f0a('0x20'),_0x13d1a3+'-'+_0x1ae136+'/'+_0x22315b)[_0x8f0a('0x1a')](_0x3223d8);}return null;};}function patchUpdates(_0x4c20b5){return function(_0x5a787c){try{jsonpatch[_0x8f0a('0x21')](_0x5a787c,_0x4c20b5,!![]);}catch(_0x37a8d1){return BPromise['reject'](_0x37a8d1);}return _0x5a787c[_0x8f0a('0x22')]();};}function saveUpdates(_0x578a21,_0x80d487){return function(_0x583f79){if(_0x583f79){return _0x583f79[_0x8f0a('0x23')](_0x578a21)[_0x8f0a('0x24')](function(_0x2bf852){return _0x2bf852;});}return null;};}function removeEntity(_0x2a3282,_0x41a21b){return function(_0x326407){if(_0x326407){return _0x326407[_0x8f0a('0x25')]()['then'](function(){_0x2a3282[_0x8f0a('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x35897f,_0x4baa5d){return function(_0x1f00cc){if(!_0x1f00cc){_0x35897f[_0x8f0a('0x17')](0x194);}return _0x1f00cc;};}function handleError(_0x24d8cd,_0x376ded){_0x376ded=_0x376ded||0x1f4;return function(_0x573721){logger[_0x8f0a('0x26')](_0x573721[_0x8f0a('0x27')]);if(_0x573721['name']){delete _0x573721[_0x8f0a('0x28')];}_0x24d8cd[_0x8f0a('0x18')](_0x376ded)[_0x8f0a('0x29')](_0x573721);};}exports[_0x8f0a('0x2a')]=function(_0x2f92e3,_0x2204a8){var _0x360acd={},_0x3ef5e3={},_0x317db5={'count':0x0,'rows':[]};var _0x4fa061=_[_0x8f0a('0x2b')](db[_0x8f0a('0x2c')][_0x8f0a('0x2d')],function(_0x38ebb6){return{'name':_0x38ebb6[_0x8f0a('0x2e')],'type':_0x38ebb6['type'][_0x8f0a('0x2f')]};});_0x3ef5e3['model']=_[_0x8f0a('0x2b')](_0x4fa061,'name');_0x3ef5e3['query']=_['keys'](_0x2f92e3['query']);_0x3ef5e3[_0x8f0a('0x30')]=_[_0x8f0a('0x31')](_0x3ef5e3[_0x8f0a('0x32')],_0x3ef5e3[_0x8f0a('0x33')]);_0x360acd[_0x8f0a('0x34')]=_[_0x8f0a('0x31')](_0x3ef5e3['model'],qs[_0x8f0a('0x35')](_0x2f92e3['query'][_0x8f0a('0x35')]));_0x360acd['attributes']=_0x360acd['attributes'][_0x8f0a('0x36')]?_0x360acd[_0x8f0a('0x34')]:_0x3ef5e3[_0x8f0a('0x32')];if(!_0x2f92e3[_0x8f0a('0x33')][_0x8f0a('0x37')]('nolimit')){_0x360acd[_0x8f0a('0x1d')]=qs['limit'](_0x2f92e3[_0x8f0a('0x33')][_0x8f0a('0x1d')]);_0x360acd[_0x8f0a('0x1b')]=qs[_0x8f0a('0x1b')](_0x2f92e3[_0x8f0a('0x33')][_0x8f0a('0x1b')]);}_0x360acd[_0x8f0a('0x38')]=qs[_0x8f0a('0x39')](_0x2f92e3[_0x8f0a('0x33')][_0x8f0a('0x39')]);_0x360acd[_0x8f0a('0x3a')]=qs[_0x8f0a('0x30')](_[_0x8f0a('0x3b')](_0x2f92e3['query'],_0x3ef5e3[_0x8f0a('0x30')]),_0x4fa061);if(_0x2f92e3[_0x8f0a('0x33')][_0x8f0a('0x3c')]){_0x360acd['where']=_[_0x8f0a('0x3d')](_0x360acd[_0x8f0a('0x3a')],{'$or':_[_0x8f0a('0x2b')](_0x4fa061,function(_0x589db5){if(_0x589db5[_0x8f0a('0x3e')]!==_0x8f0a('0x3f')){var _0x52c2c6={};_0x52c2c6[_0x589db5[_0x8f0a('0x28')]]={'$like':'%'+_0x2f92e3[_0x8f0a('0x33')]['filter']+'%'};return _0x52c2c6;}})});}_0x360acd=_[_0x8f0a('0x3d')]({},_0x360acd,_0x2f92e3['options']);var _0x8f1fcb={'where':_0x360acd[_0x8f0a('0x3a')]};return db[_0x8f0a('0x2c')][_0x8f0a('0x1e')](_0x8f1fcb)[_0x8f0a('0x24')](function(_0x381510){_0x317db5['count']=_0x381510;if(_0x2f92e3[_0x8f0a('0x33')][_0x8f0a('0x40')]){_0x360acd[_0x8f0a('0x41')]=[{'all':!![]}];}return db[_0x8f0a('0x2c')][_0x8f0a('0x42')](_0x360acd);})[_0x8f0a('0x24')](function(_0x55224f){_0x317db5[_0x8f0a('0x43')]=_0x55224f;return _0x317db5;})[_0x8f0a('0x24')](respondWithFilteredResult(_0x2204a8,_0x360acd))[_0x8f0a('0x44')](handleError(_0x2204a8,null));};exports[_0x8f0a('0x45')]=function(_0x16949f,_0x29d16f){var _0x4188cd={'raw':!![],'where':{'id':_0x16949f[_0x8f0a('0x46')]['id']}},_0x458210={};_0x458210['model']=_[_0x8f0a('0x47')](db[_0x8f0a('0x2c')][_0x8f0a('0x2d')]);_0x458210[_0x8f0a('0x33')]=_[_0x8f0a('0x47')](_0x16949f[_0x8f0a('0x33')]);_0x458210[_0x8f0a('0x30')]=_['intersection'](_0x458210[_0x8f0a('0x32')],_0x458210[_0x8f0a('0x33')]);_0x4188cd[_0x8f0a('0x34')]=_[_0x8f0a('0x31')](_0x458210[_0x8f0a('0x32')],qs[_0x8f0a('0x35')](_0x16949f[_0x8f0a('0x33')][_0x8f0a('0x35')]));_0x4188cd[_0x8f0a('0x34')]=_0x4188cd[_0x8f0a('0x34')][_0x8f0a('0x36')]?_0x4188cd[_0x8f0a('0x34')]:_0x458210['model'];if(_0x16949f[_0x8f0a('0x33')][_0x8f0a('0x40')]){_0x4188cd['include']=[{'all':!![]}];}_0x4188cd=_['merge']({},_0x4188cd,_0x16949f['options']);return db[_0x8f0a('0x2c')][_0x8f0a('0x48')](_0x4188cd)[_0x8f0a('0x24')](handleEntityNotFound(_0x29d16f,null))[_0x8f0a('0x24')](respondWithResult(_0x29d16f,null))[_0x8f0a('0x44')](handleError(_0x29d16f,null));};exports[_0x8f0a('0x49')]=function(_0xfb5b47,_0x8335c){return db[_0x8f0a('0x2c')][_0x8f0a('0x49')](_0xfb5b47['body'],{})[_0x8f0a('0x24')](respondWithResult(_0x8335c,0xc9))['catch'](handleError(_0x8335c,null));};exports[_0x8f0a('0x23')]=function(_0x40334d,_0x5a1b7d){if(_0x40334d[_0x8f0a('0x4a')]['id']){delete _0x40334d[_0x8f0a('0x4a')]['id'];}return db[_0x8f0a('0x2c')][_0x8f0a('0x48')]({'where':{'id':_0x40334d['params']['id']}})[_0x8f0a('0x24')](handleEntityNotFound(_0x5a1b7d,null))[_0x8f0a('0x24')](saveUpdates(_0x40334d[_0x8f0a('0x4a')],null))[_0x8f0a('0x24')](respondWithResult(_0x5a1b7d,null))[_0x8f0a('0x44')](handleError(_0x5a1b7d,null));};exports[_0x8f0a('0x25')]=function(_0x19e4be,_0x523da3){return db[_0x8f0a('0x2c')][_0x8f0a('0x48')]({'where':{'id':_0x19e4be[_0x8f0a('0x46')]['id']}})[_0x8f0a('0x24')](handleEntityNotFound(_0x523da3,null))[_0x8f0a('0x24')](removeEntity(_0x523da3,null))['catch'](handleError(_0x523da3,null));};exports[_0x8f0a('0x4b')]=function(_0x2175f0,_0x11f4c0){return db['ChatTransferReport'][_0x8f0a('0x4b')]()[_0x8f0a('0x24')](respondWithResult(_0x11f4c0,null))[_0x8f0a('0x44')](handleError(_0x11f4c0,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index d8ec4cc..8fe0b16 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 _0xebe3=['./chatTransferReport.attributes','define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','api','moment','../../config/environment'];(function(_0x3165c0,_0x429078){var _0x5d7e16=function(_0x184539){while(--_0x184539){_0x3165c0['push'](_0x3165c0['shift']());}};_0x5d7e16(++_0x429078);}(_0xebe3,0x73));var _0x3ebe=function(_0x4211f6,_0x4934e6){_0x4211f6=_0x4211f6-0x0;var _0x1253f2=_0xebe3[_0x4211f6];return _0x1253f2;};'use strict';var _=require(_0x3ebe('0x0'));var util=require(_0x3ebe('0x1'));var logger=require('../../config/logger')(_0x3ebe('0x2'));var moment=require(_0x3ebe('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(_0x3ebe('0x4'));var attributes=require(_0x3ebe('0x5'));module['exports']=function(_0x57ea6f,_0x39b3e3){return _0x57ea6f[_0x3ebe('0x6')](_0x3ebe('0x7'),attributes,{'tableName':_0x3ebe('0x8'),'paranoid':![],'indexes':[{'name':_0x3ebe('0x9'),'fields':[_0x3ebe('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1dbc=['request-promise','path','../../config/environment','./chatTransferReport.attributes','exports','define','ChatTransferReport','uniqueid','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x2940a6,_0x3a84ac){var _0x1461cc=function(_0x19598f){while(--_0x19598f){_0x2940a6['push'](_0x2940a6['shift']());}};_0x1461cc(++_0x3a84ac);}(_0x1dbc,0xe8));var _0xc1db=function(_0x590b63,_0x14debb){_0x590b63=_0x590b63-0x0;var _0x3c9380=_0x1dbc[_0x590b63];return _0x3c9380;};'use strict';var _=require(_0xc1db('0x0'));var util=require(_0xc1db('0x1'));var logger=require(_0xc1db('0x2'))(_0xc1db('0x3'));var moment=require(_0xc1db('0x4'));var BPromise=require(_0xc1db('0x5'));var rp=require(_0xc1db('0x6'));var fs=require('fs');var path=require(_0xc1db('0x7'));var rimraf=require('rimraf');var config=require(_0xc1db('0x8'));var attributes=require(_0xc1db('0x9'));module[_0xc1db('0xa')]=function(_0x2e068c,_0x2f56f6){return _0x2e068c[_0xc1db('0xb')](_0xc1db('0xc'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0xc1db('0xd'),'fields':[_0xc1db('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index c9a73d3..5bf3c48 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 _0x0aae=['ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','then','info'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x0aae,0xb9));var _0xe0aa=function(_0x513c0c,_0x3fc365){_0x513c0c=_0x513c0c-0x0;var _0x5ee35b=_0x0aae[_0x513c0c];return _0x5ee35b;};'use strict';var _=require('lodash');var util=require(_0xe0aa('0x0'));var moment=require(_0xe0aa('0x1'));var BPromise=require(_0xe0aa('0x2'));var rs=require(_0xe0aa('0x3'));var fs=require('fs');var Redis=require(_0xe0aa('0x4'));var db=require(_0xe0aa('0x5'))['db'];var utils=require(_0xe0aa('0x6'));var logger=require('../../config/logger')(_0xe0aa('0x7'));var config=require(_0xe0aa('0x8'));var jayson=require(_0xe0aa('0x9'));var client=jayson[_0xe0aa('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x320a2d,_0x186392,_0x5afb10){return new BPromise(function(_0x1919ab,_0x2b2920){return client['request'](_0x320a2d,_0x5afb10)[_0xe0aa('0xb')](function(_0x3d1118){logger[_0xe0aa('0xc')](_0xe0aa('0xd'),_0x186392,_0xe0aa('0xe'));logger[_0xe0aa('0xf')](_0xe0aa('0x10'),_0x186392,_0xe0aa('0xe'),JSON[_0xe0aa('0x11')](_0x3d1118));if(_0x3d1118[_0xe0aa('0x12')]){if(_0x3d1118[_0xe0aa('0x12')]['code']===0x1f4){logger[_0xe0aa('0x12')]('ChatTransferReport,\x20%s,\x20%s',_0x186392,_0x3d1118[_0xe0aa('0x12')]['message']);return _0x2b2920(_0x3d1118[_0xe0aa('0x12')][_0xe0aa('0x13')]);}logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x186392,_0x3d1118[_0xe0aa('0x12')][_0xe0aa('0x13')]);return _0x1919ab(_0x3d1118[_0xe0aa('0x12')][_0xe0aa('0x13')]);}else{logger['info'](_0xe0aa('0xd'),_0x186392,'request\x20sent');_0x1919ab(_0x3d1118[_0xe0aa('0x14')][_0xe0aa('0x13')]);}})[_0xe0aa('0x15')](function(_0xaa4fa5){logger[_0xe0aa('0x12')](_0xe0aa('0xd'),_0x186392,_0xaa4fa5);_0x2b2920(_0xaa4fa5);});});} \ No newline at end of file +var _0xa7cf=['result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatTransferReport,\x20%s,\x20%s','message','request\x20sent'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xa7cf,0xf1));var _0xfa7c=function(_0x1bfe2b,_0x34856e){_0x1bfe2b=_0x1bfe2b-0x0;var _0x1477d4=_0xa7cf[_0x1bfe2b];return _0x1477d4;};'use strict';var _=require(_0xfa7c('0x0'));var util=require(_0xfa7c('0x1'));var moment=require(_0xfa7c('0x2'));var BPromise=require(_0xfa7c('0x3'));var rs=require(_0xfa7c('0x4'));var fs=require('fs');var Redis=require(_0xfa7c('0x5'));var db=require(_0xfa7c('0x6'))['db'];var utils=require(_0xfa7c('0x7'));var logger=require(_0xfa7c('0x8'))(_0xfa7c('0x9'));var config=require(_0xfa7c('0xa'));var jayson=require(_0xfa7c('0xb'));var client=jayson[_0xfa7c('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1fcc11,_0x213497,_0x107826){return new BPromise(function(_0x3250b5,_0x4483fd){return client['request'](_0x1fcc11,_0x107826)[_0xfa7c('0xd')](function(_0x5d5bb1){logger[_0xfa7c('0xe')]('ChatTransferReport,\x20%s,\x20%s',_0x213497,'request\x20sent');logger[_0xfa7c('0xf')](_0xfa7c('0x10'),_0x213497,'request\x20sent',JSON[_0xfa7c('0x11')](_0x5d5bb1));if(_0x5d5bb1[_0xfa7c('0x12')]){if(_0x5d5bb1['error'][_0xfa7c('0x13')]===0x1f4){logger['error'](_0xfa7c('0x14'),_0x213497,_0x5d5bb1[_0xfa7c('0x12')][_0xfa7c('0x15')]);return _0x4483fd(_0x5d5bb1[_0xfa7c('0x12')][_0xfa7c('0x15')]);}logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x213497,_0x5d5bb1[_0xfa7c('0x12')][_0xfa7c('0x15')]);return _0x3250b5(_0x5d5bb1[_0xfa7c('0x12')][_0xfa7c('0x15')]);}else{logger[_0xfa7c('0xe')](_0xfa7c('0x14'),_0x213497,_0xfa7c('0x16'));_0x3250b5(_0x5d5bb1[_0xfa7c('0x17')][_0xfa7c('0x15')]);}})['catch'](function(_0x19ec52){logger[_0xfa7c('0x12')](_0xfa7c('0x14'),_0x213497,_0x19ec52);_0x4483fd(_0x19ec52);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index 6c4b556..2da1433 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 _0x16c1=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatTransferReport.controller','get','isAuthenticated','/describe','describe','/:id','create','update','delete','destroy','multer','path'];(function(_0x138f59,_0x1b53fb){var _0x3d114d=function(_0x1f9461){while(--_0x1f9461){_0x138f59['push'](_0x138f59['shift']());}};_0x3d114d(++_0x1b53fb);}(_0x16c1,0xe8));var _0x116c=function(_0x2bdc70,_0x4464f9){_0x2bdc70=_0x2bdc70-0x0;var _0x5494ac=_0x16c1[_0x2bdc70];return _0x5494ac;};'use strict';var multer=require(_0x116c('0x0'));var util=require('util');var path=require(_0x116c('0x1'));var timeout=require(_0x116c('0x2'));var express=require(_0x116c('0x3'));var router=express[_0x116c('0x4')]();var fs_extra=require(_0x116c('0x5'));var auth=require(_0x116c('0x6'));var interaction=require(_0x116c('0x7'));var config=require('../../config/environment');var controller=require(_0x116c('0x8'));router[_0x116c('0x9')]('/',auth[_0x116c('0xa')](),controller['index']);router[_0x116c('0x9')](_0x116c('0xb'),auth[_0x116c('0xa')](),controller[_0x116c('0xc')]);router[_0x116c('0x9')](_0x116c('0xd'),auth[_0x116c('0xa')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x116c('0xe')]);router['put'](_0x116c('0xd'),auth[_0x116c('0xa')](),controller[_0x116c('0xf')]);router[_0x116c('0x10')](_0x116c('0xd'),auth['isAuthenticated'](),controller[_0x116c('0x11')]);module['exports']=router; \ No newline at end of file +var _0x9cfb=['connect-timeout','fs-extra','../../config/environment','./chatTransferReport.controller','get','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','exports','multer','util'];(function(_0x3fcc20,_0x57c31b){var _0x15d3ce=function(_0x575619){while(--_0x575619){_0x3fcc20['push'](_0x3fcc20['shift']());}};_0x15d3ce(++_0x57c31b);}(_0x9cfb,0xa8));var _0xb9cf=function(_0xf2ad49,_0xfc0721){_0xf2ad49=_0xf2ad49-0x0;var _0x388626=_0x9cfb[_0xf2ad49];return _0x388626;};'use strict';var multer=require(_0xb9cf('0x0'));var util=require(_0xb9cf('0x1'));var path=require('path');var timeout=require(_0xb9cf('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xb9cf('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xb9cf('0x4'));var controller=require(_0xb9cf('0x5'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xb9cf('0x6')](_0xb9cf('0x7'),auth[_0xb9cf('0x8')](),controller[_0xb9cf('0x9')]);router[_0xb9cf('0x6')](_0xb9cf('0xa'),auth['isAuthenticated'](),controller[_0xb9cf('0xb')]);router[_0xb9cf('0xc')]('/',auth[_0xb9cf('0x8')](),controller[_0xb9cf('0xd')]);router[_0xb9cf('0xe')](_0xb9cf('0xa'),auth[_0xb9cf('0x8')](),controller[_0xb9cf('0xf')]);router['delete']('/:id',auth[_0xb9cf('0x8')](),controller['destroy']);module[_0xb9cf('0x10')]=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index a61fd32..96b8e21 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 _0x18c0=['Thanks\x20you\x20for\x20your\x20time!','Feedback','star','thumb','stringify','input','name','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','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Skip','bottom_right','CHAT','alternate','#fafafa','System','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','sequelize','randomstring','exports','STRING','email','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message'];(function(_0x36befb,_0x12559c){var _0x479e63=function(_0x3a1f39){while(--_0x3a1f39){_0x36befb['push'](_0x36befb['shift']());}};_0x479e63(++_0x12559c);}(_0x18c0,0x174));var _0x018c=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x18c0[_0x138adb];return _0x1b27f2;};'use strict';var Sequelize=require(_0x018c('0x0'));var rs=require(_0x018c('0x1'));module[_0x018c('0x2')]={'name':{'type':Sequelize[_0x018c('0x3')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':'address'},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize['STRING'],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize[_0x018c('0x3')],'defaultValue':_0x018c('0x4')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x018c('0x3')],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0x018c('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x018c('0x3')],'allowNull':![],'defaultValue':_0x018c('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x018c('0x3')],'allowNull':![],'defaultValue':_0x018c('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x018c('0x3')],'allowNull':![],'defaultValue':_0x018c('0x6'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x018c('0x3')],'allowNull':![],'defaultValue':_0x018c('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x018c('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x018c('0x3')]},'animation':{'type':Sequelize[_0x018c('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x018c('0x9')](_0x018c('0xa'),'squared'),'defaultValue':'rounded'},'header_online':{'type':Sequelize['STRING'],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x018c('0xb')},'offline_chat_button':{'type':Sequelize[_0x018c('0x3')],'defaultValue':_0x018c('0xc')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0x018c('0xd')},'download_transcript':{'type':Sequelize[_0x018c('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x018c('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x018c('0x3')],'defaultValue':_0x018c('0xe')},'defaultWhiteLabel':{'type':Sequelize[_0x018c('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x018c('0xf')]},'closingQuestion':{'type':Sequelize[_0x018c('0x3')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0x018c('0x10')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0x018c('0x11')},'noteTitle':{'type':Sequelize[_0x018c('0x3')],'defaultValue':_0x018c('0x12')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0x018c('0x13')},'closingMessage':{'type':Sequelize[_0x018c('0x3')],'defaultValue':_0x018c('0x14')},'closingMessageButton':{'type':Sequelize[_0x018c('0x3')],'defaultValue':_0x018c('0xc')},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x018c('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x018c('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':_0x018c('0x15')},'ratingType':{'type':Sequelize[_0x018c('0x9')](_0x018c('0x16'),_0x018c('0x17')),'defaultValue':_0x018c('0x16')},'ratingStarsNumber':{'type':Sequelize[_0x018c('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x018c('0x18')]({'items':[{'type':_0x018c('0x19'),'variable':null,'config':{'placeholder':_0x018c('0x1a'),'type':'text','required':!![]},'props':{'title':_0x018c('0x1a'),'helpText':''}},{'type':_0x018c('0x19'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x018c('0x4'),'type':_0x018c('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x018c('0x1b')](_0x018c('0x1c'))?JSON[_0x018c('0x1d')](this[_0x018c('0x1b')]('onlineForm')):{};},'set':function(_0xa88043){return this[_0x018c('0x1e')]('onlineForm',JSON['stringify'](_0xa88043));}},'offlineForm':{'type':Sequelize[_0x018c('0xf')],'defaultValue':function(){return JSON[_0x018c('0x18')]({'items':[{'type':'input','props':{'title':_0x018c('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x018c('0x4'),'type':_0x018c('0x4')},'variable':null},{'type':_0x018c('0x1f'),'config':{'placeholder':_0x018c('0x20')},'props':{'title':'Comments','helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0x018c('0x1b')](_0x018c('0x21'))?JSON['parse'](this['getDataValue'](_0x018c('0x21'))):{};},'set':function(_0x578da3){return this[_0x018c('0x1e')](_0x018c('0x21'),JSON[_0x018c('0x18')](_0x578da3));}},'token':{'type':Sequelize[_0x018c('0x3')],'defaultValue':function(){return rs[_0x018c('0x22')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x018c('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x018c('0x3')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0x018c('0x23')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0x018c('0x3')],'defaultValue':_0x018c('0x24')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0x018c('0x25')},'enableUnmanagedNote':{'type':Sequelize[_0x018c('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0x018c('0x26')},'skipUnmanaged':{'type':Sequelize[_0x018c('0x3')],'defaultValue':_0x018c('0x27')},'sendUnmanaged':{'type':Sequelize[_0x018c('0x3')],'defaultValue':_0x018c('0xc')},'enableCustomerAttachment':{'type':Sequelize[_0x018c('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x018c('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x018c('0xf')],'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[_0x018c('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x018c('0x8')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0x018c('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x018c('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x018c('0x3')],'defaultValue':_0x018c('0x28')},'verticalAlignment':{'type':Sequelize[_0x018c('0x7')],'defaultValue':0x1e},'labelText':{'type':Sequelize['STRING'],'defaultValue':_0x018c('0x29')},'messagesAlignment':{'type':Sequelize[_0x018c('0x3')],'defaultValue':_0x018c('0x2a')},'defaultTitle':{'type':Sequelize[_0x018c('0x3')]},'customerAvatar':{'type':Sequelize[_0x018c('0xf')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x018c('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x018c('0x3')],'allowNull':![],'defaultValue':_0x018c('0x2b'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x018c('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x018c('0x3')],'defaultValue':_0x018c('0x2c')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x018c('0x7')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x018c('0x8')],'defaultValue':![],'comment':_0x018c('0x2d'),'set':function(_0x5a6d80){if(!_0x5a6d80)this[_0x018c('0x1e')](_0x018c('0x2e'),null);this[_0x018c('0x1e')](_0x018c('0x2f'),_0x5a6d80);}},'vidaooEscalation':{'type':Sequelize[_0x018c('0x8')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x018c('0x3')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x018c('0x30')},'vidaooNote':{'type':Sequelize[_0x018c('0x3')],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize[_0x018c('0xf')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x018c('0xf')]}}; \ No newline at end of file +var _0xb628=['exports','STRING','email','#011F6A','#ffffff','INTEGER','ENUM','rounded','We\x20are\x20here!','Send','Contact\x20us','BOOLEAN','TEXT','Form\x20properly\x20submitted','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','thumb','stringify','input','name','text','getDataValue','onlineForm','parse','Comments','Leave\x20your\x20comments','offlineForm','setDataValue','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','CHAT','alternate','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring'];(function(_0x595fea,_0x1f7e6f){var _0x20ce9b=function(_0xc167d1){while(--_0xc167d1){_0x595fea['push'](_0x595fea['shift']());}};_0x20ce9b(++_0x1f7e6f);}(_0xb628,0xf3));var _0x8b62=function(_0x1e42f2,_0x1fece5){_0x1e42f2=_0x1e42f2-0x0;var _0x262489=_0xb628[_0x1e42f2];return _0x262489;};'use strict';var Sequelize=require(_0x8b62('0x0'));var rs=require(_0x8b62('0x1'));module[_0x8b62('0x2')]={'name':{'type':Sequelize[_0x8b62('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0x8b62('0x3')],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0x8b62('0x3')]},'mapKey':{'type':Sequelize[_0x8b62('0x3')],'defaultValue':_0x8b62('0x4')},'mapKeyOffline':{'type':Sequelize[_0x8b62('0x3')],'defaultValue':_0x8b62('0x4')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x8b62('0x3')],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0x8b62('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x8b62('0x3')],'allowNull':![],'defaultValue':_0x8b62('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x8b62('0x3')],'allowNull':![],'defaultValue':_0x8b62('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x8b62('0x3')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x8b62('0x3')],'allowNull':![],'defaultValue':_0x8b62('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x8b62('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x8b62('0x3')]},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x8b62('0x8')](_0x8b62('0x9'),'squared'),'defaultValue':_0x8b62('0x9')},'header_online':{'type':Sequelize[_0x8b62('0x3')],'defaultValue':_0x8b62('0xa')},'start_chat_button':{'type':Sequelize[_0x8b62('0x3')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize[_0x8b62('0x3')],'defaultValue':_0x8b62('0xb')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0x8b62('0xc')},'download_transcript':{'type':Sequelize[_0x8b62('0xd')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x8b62('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x8b62('0x3')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0x8b62('0xd')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x8b62('0xe')]},'closingQuestion':{'type':Sequelize[_0x8b62('0x3')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0x8b62('0x3')],'defaultValue':_0x8b62('0xf')},'formSubmitFailureMessage':{'type':Sequelize[_0x8b62('0x3')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0x8b62('0x3')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0x8b62('0x3')],'defaultValue':_0x8b62('0x10')},'closingMessage':{'type':Sequelize[_0x8b62('0x3')],'defaultValue':_0x8b62('0x11')},'closingMessageButton':{'type':Sequelize[_0x8b62('0x3')],'defaultValue':_0x8b62('0xb')},'skipMessageButton':{'type':Sequelize[_0x8b62('0x3')],'defaultValue':_0x8b62('0x12')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x8b62('0xd')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x8b62('0xd')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x8b62('0x3')],'defaultValue':_0x8b62('0x13')},'ratingType':{'type':Sequelize[_0x8b62('0x8')](_0x8b62('0x14'),_0x8b62('0x15')),'defaultValue':_0x8b62('0x14')},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x8b62('0xe')],'defaultValue':function(){return JSON[_0x8b62('0x16')]({'items':[{'type':_0x8b62('0x17'),'variable':null,'config':{'placeholder':_0x8b62('0x18'),'type':_0x8b62('0x19'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':'input','props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':'email','type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x8b62('0x1a')](_0x8b62('0x1b'))?JSON[_0x8b62('0x1c')](this[_0x8b62('0x1a')](_0x8b62('0x1b'))):{};},'set':function(_0x31afe8){return this['setDataValue'](_0x8b62('0x1b'),JSON[_0x8b62('0x16')](_0x31afe8));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x8b62('0x16')]({'items':[{'type':_0x8b62('0x17'),'props':{'title':_0x8b62('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x8b62('0x4'),'type':_0x8b62('0x4')},'variable':null},{'type':'textarea','config':{'placeholder':'Comments'},'props':{'title':_0x8b62('0x1d'),'helpText':_0x8b62('0x1e')}}],'fromKey':0x0});},'get':function(){return this[_0x8b62('0x1a')]('offlineForm')?JSON['parse'](this[_0x8b62('0x1a')](_0x8b62('0x1f'))):{};},'set':function(_0x158e24){return this[_0x8b62('0x20')](_0x8b62('0x1f'),JSON[_0x8b62('0x16')](_0x158e24));}},'token':{'type':Sequelize[_0x8b62('0x3')],'defaultValue':function(){return rs[_0x8b62('0x21')]();}},'autoclose':{'type':Sequelize[_0x8b62('0xd')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x8b62('0xd')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x8b62('0x3')]},'forwardOffline':{'type':Sequelize[_0x8b62('0xd')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0x8b62('0x3')],'defaultValue':_0x8b62('0x22')},'waitingMessage':{'type':Sequelize[_0x8b62('0x3')],'defaultValue':_0x8b62('0x23')},'offlineMessageSubject':{'type':Sequelize[_0x8b62('0x3')],'defaultValue':_0x8b62('0x24')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0x8b62('0x25')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x8b62('0x3')],'defaultValue':_0x8b62('0x26')},'skipUnmanaged':{'type':Sequelize[_0x8b62('0x3')],'defaultValue':_0x8b62('0x12')},'sendUnmanaged':{'type':Sequelize[_0x8b62('0x3')],'defaultValue':_0x8b62('0xb')},'enableCustomerAttachment':{'type':Sequelize[_0x8b62('0xd')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x8b62('0xe')]},'showAgentAvatar':{'type':Sequelize[_0x8b62('0xd')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x8b62('0x3')]},'notificationTemplate':{'type':Sequelize[_0x8b62('0xe')],'defaultValue':function(){return _0x8b62('0x27');}},'notificationSound':{'type':Sequelize[_0x8b62('0xd')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x8b62('0xd')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x8b62('0x3')],'defaultValue':_0x8b62('0x28')},'waitForTheAssignedAgent':{'type':Sequelize[_0x8b62('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x8b62('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x8b62('0x3')],'defaultValue':_0x8b62('0x29')},'verticalAlignment':{'type':Sequelize[_0x8b62('0x7')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x8b62('0x3')],'defaultValue':_0x8b62('0x2a')},'messagesAlignment':{'type':Sequelize[_0x8b62('0x3')],'defaultValue':_0x8b62('0x2b')},'defaultTitle':{'type':Sequelize[_0x8b62('0x3')]},'customerAvatar':{'type':Sequelize[_0x8b62('0xe')]},'showCustomerAvatar':{'type':Sequelize[_0x8b62('0xd')],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x8b62('0x3')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x8b62('0x3')],'defaultValue':_0x8b62('0x2c')},'systemAvatar':{'type':Sequelize[_0x8b62('0xe')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x8b62('0x7')],'comment':_0x8b62('0x2d')},'mandatoryDisposition':{'type':Sequelize[_0x8b62('0xd')],'defaultValue':![],'comment':_0x8b62('0x2e'),'set':function(_0x35b2e3){if(!_0x35b2e3)this[_0x8b62('0x20')]('mandatoryDispositionPauseId',null);this['setDataValue']('mandatoryDisposition',_0x35b2e3);}},'vidaooEscalation':{'type':Sequelize[_0x8b62('0xd')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize[_0x8b62('0x3')],'allowNull':![],'defaultValue':_0x8b62('0x2f')},'vidaooNote':{'type':Sequelize[_0x8b62('0x3')],'defaultValue':function(){return _0x8b62('0x30');}},'vidaooMetadata':{'type':Sequelize[_0x8b62('0xe')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x8b62('0xd')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x8b62('0xe')]}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index f0c7605..3ad1ea9 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 _0x70e0=['getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','toPairsIn','mapValues','Chat','NotifyMailAccount','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','hasOwnProperty','Owner','fullname','Tag','Tags','color','tag','Command','timezone','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','OFFLINE','No\x20timezone','inspect','getSnippet','Interval','Intervals','../../config/license/util','License','increment','chatLicenseExceeded','all','some','URL','origin','remote','x-real-ip','connection','remoteAddress','virtual','render','alignment','verticalAlignment','labelText','textColor','textButtonColor','color_button','backgroundColor','hideWhenOffline','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','finally','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getProactiveActions','getFields','online','false','onlineForm','items','fromKey','Contact','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','bluebird','mustache','util','fs-extra','lodash','querystring','ioredis','../../config/logger','../../config/environment','defaults','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','client','http','info','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','ChatWebsite,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','update','then','destroy','stack','name','index','Pause','mandatoryDispositionPause','map','ChatWebsite','type','key','model','keys','query','filters','attributes','fields','length','nolimit','order','sort','filter','where','VIRTUAL','merge','options','includeAll','include','rows','show','params','rawAttributes','intersection','create','user','get','role','ChatWebsites','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','describe','addDisposition','ChatWebsiteId','pick','Disposition','findAll','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','removeAnswers','addLogo','sitepic','file','filename','addAvatar','agentAvatar','customerAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','getLicense','custom','isNil','existsSync','download','getAvatar','server/files/images/avatars/','getCustomerAvatar','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','headers','user-agent','getResult','chat','CmContact','no\x20available\x20attributes','difference','updatedAt','createdAt','ListId','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','Sequelize','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','DESC','ChatApplication','Applications','List','applications','orderBy','priority','account','Contacts','contact','cf-connecting-ip','x-forwarded-for','first','firstName','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','interaction','spread','messageId','created','autoclose','push','unmanaged','*,*,*,*','ChatMessage','UserId','User','unshift','agent','forcedOwnership','queueId','ChatQueue','queue','waitForTheAssignedQueue','startRouting','EventManager','offline','files','CompanyId','send','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','CmList','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','offlineMessageBody','ChatOfflineMessage','fromString','originalname','mimetype','server','offline-chat','basename','openNewInteraction','sequelize','transaction','Attachment','MailServerOut','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress'];(function(_0x4fe35d,_0x21fee1){var _0x5bb28e=function(_0x214051){while(--_0x214051){_0x4fe35d['push'](_0x4fe35d['shift']());}};_0x5bb28e(++_0x21fee1);}(_0x70e0,0x17b));var _0x070e=function(_0x37f1d9,_0x95a04f){_0x37f1d9=_0x37f1d9-0x0;var _0x47413d=_0x70e0[_0x37f1d9];return _0x47413d;};'use strict';var BPromise=require(_0x070e('0x0'));var Mustache=require(_0x070e('0x1'));var util=require(_0x070e('0x2'));var path=require('path');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x070e('0x3'));var _=require(_0x070e('0x4'));var querystring=require(_0x070e('0x5'));var Redis=require(_0x070e('0x6'));var qs=require('../../components/parsers/qs');var logger=require(_0x070e('0x7'))('api');var config=require(_0x070e('0x8'));var url=require('url');var db=require('../../mysqldb')['db'];config['redis']=_[_0x070e('0x9')](config[_0x070e('0xa')],{'host':_0x070e('0xb'),'port':0x18eb});var socket=require(_0x070e('0xc'))(new Redis(config[_0x070e('0xa')]));require(_0x070e('0xd'))[_0x070e('0xe')](socket);var htmlToText=require('html-to-text');var jayson=require('jayson/promise');var client=jayson[_0x070e('0xf')][_0x070e('0x10')]({'port':0x232c});var client9002=jayson[_0x070e('0xf')][_0x070e('0x10')]({'port':0x232a});var client9003=jayson[_0x070e('0xf')][_0x070e('0x10')]({'port':0x232b});var client9001=jayson[_0x070e('0xf')][_0x070e('0x10')]({'port':0x2329});function respondWithRpcPromise(_0x39d2b9,_0x5bf079,_0x2930b8,_0x52da3b){return new BPromise(function(_0x5dca0f,_0x24baba){var _0x56c7ba=_0x52da3b||client;return _0x56c7ba['request'](_0x39d2b9,_0x2930b8)['then'](function(_0x11d2ce){logger[_0x070e('0x11')]('ChatWebsite,\x20%s,\x20%s',_0x5bf079,'request\x20sent');logger[_0x070e('0x12')](_0x070e('0x13'),_0x5bf079,_0x070e('0x14'),JSON[_0x070e('0x15')](_0x11d2ce));if(_0x11d2ce['error']){if(_0x11d2ce['error'][_0x070e('0x16')]===0x1f4){logger[_0x070e('0x17')](_0x070e('0x18'),_0x5bf079,_0x11d2ce[_0x070e('0x17')][_0x070e('0x19')]);return _0x24baba(_0x11d2ce['error'][_0x070e('0x19')]);}logger[_0x070e('0x17')](_0x070e('0x18'),_0x5bf079,_0x11d2ce[_0x070e('0x17')][_0x070e('0x19')]);return _0x5dca0f(_0x11d2ce['error']['message']);}else{logger['info'](_0x070e('0x18'),_0x5bf079,_0x070e('0x14'));_0x5dca0f(_0x11d2ce[_0x070e('0x1a')]['message']);}})[_0x070e('0x1b')](function(_0x5dc5d2){logger[_0x070e('0x17')](_0x070e('0x18'),_0x5bf079,_0x5dc5d2);_0x24baba(_0x5dc5d2);});});}function respondWithStatusCode(_0x27a01e,_0x33e8c6){_0x33e8c6=_0x33e8c6||0xcc;return function(_0x28a1c3){if(_0x28a1c3){return _0x27a01e[_0x070e('0x1c')](_0x33e8c6);}return _0x27a01e[_0x070e('0x1d')](_0x33e8c6)[_0x070e('0x1e')]();};}function respondWithResult(_0x595c7e,_0x2f8055){_0x2f8055=_0x2f8055||0xc8;return function(_0x270061){if(_0x270061){return _0x595c7e[_0x070e('0x1d')](_0x2f8055)['json'](_0x270061);}};}function respondWithFilteredResult(_0xf17c56,_0x5f3e9d){return function(_0x4a2dbd){if(_0x4a2dbd){var _0x2ccbd7=typeof _0x5f3e9d[_0x070e('0x1f')]===_0x070e('0x20')&&typeof _0x5f3e9d[_0x070e('0x21')]===_0x070e('0x20');var _0x497f58=_0x4a2dbd[_0x070e('0x22')];var _0x219e48=_0x2ccbd7?0x0:_0x5f3e9d[_0x070e('0x1f')];var _0x1d2a34=_0x2ccbd7?_0x4a2dbd[_0x070e('0x22')]:_0x5f3e9d[_0x070e('0x1f')]+_0x5f3e9d[_0x070e('0x21')];var _0x26373b;if(_0x1d2a34>=_0x497f58){_0x1d2a34=_0x497f58;_0x26373b=0xc8;}else{_0x26373b=0xce;}_0xf17c56['status'](_0x26373b);return _0xf17c56[_0x070e('0x23')](_0x070e('0x24'),_0x219e48+'-'+_0x1d2a34+'/'+_0x497f58)[_0x070e('0x25')](_0x4a2dbd);}return null;};}function saveUpdates(_0x56fc12){return function(_0x5c5f0d){if(_0x5c5f0d){return _0x5c5f0d[_0x070e('0x26')](_0x56fc12)[_0x070e('0x27')](function(_0xa6c0ab){return _0xa6c0ab;});}return null;};}function removeEntity(_0x51402c){return function(_0x3fa994){if(_0x3fa994){return _0x3fa994[_0x070e('0x28')]()[_0x070e('0x27')](function(){var _0x5f2bee=_0x3fa994['get']({'plain':!![]});var _0x5bf522='ChatWebsites';return db['UserProfileResource'][_0x070e('0x28')]({'where':{'type':_0x5bf522,'resourceId':_0x5f2bee['id']}})['then'](function(){return _0x3fa994;});})[_0x070e('0x27')](function(){_0x51402c[_0x070e('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x47a739){return function(_0x699739){if(!_0x699739){_0x47a739[_0x070e('0x1c')](0x194);}return _0x699739;};}function handleError(_0x55288a,_0x546a16){_0x546a16=_0x546a16||0x1f4;return function(_0x41ade4){logger[_0x070e('0x17')](_0x41ade4[_0x070e('0x29')]);if(_0x41ade4[_0x070e('0x2a')]){delete _0x41ade4[_0x070e('0x2a')];}_0x55288a['status'](_0x546a16)['send'](_0x41ade4);};}exports[_0x070e('0x2b')]=function(_0x3011c4,_0x4bb439){var _0xf57ed={'include':[{'model':db[_0x070e('0x2c')],'as':_0x070e('0x2d')}]},_0xf11439={},_0x4deaf8={'count':0x0,'rows':[]};var _0x534150=_[_0x070e('0x2e')](db[_0x070e('0x2f')]['rawAttributes'],function(_0x4d4ee8){return{'name':_0x4d4ee8['fieldName'],'type':_0x4d4ee8[_0x070e('0x30')][_0x070e('0x31')]};});_0xf11439[_0x070e('0x32')]=_[_0x070e('0x2e')](_0x534150,_0x070e('0x2a'));_0xf11439['query']=_[_0x070e('0x33')](_0x3011c4[_0x070e('0x34')]);_0xf11439[_0x070e('0x35')]=_['intersection'](_0xf11439[_0x070e('0x32')],_0xf11439[_0x070e('0x34')]);_0xf57ed[_0x070e('0x36')]=_['intersection'](_0xf11439[_0x070e('0x32')],qs[_0x070e('0x37')](_0x3011c4['query'][_0x070e('0x37')]));_0xf57ed['attributes']=_0xf57ed[_0x070e('0x36')][_0x070e('0x38')]?_0xf57ed[_0x070e('0x36')]:_0xf11439[_0x070e('0x32')];if(!_0x3011c4[_0x070e('0x34')]['hasOwnProperty'](_0x070e('0x39'))){_0xf57ed['limit']=qs['limit'](_0x3011c4[_0x070e('0x34')][_0x070e('0x21')]);_0xf57ed[_0x070e('0x1f')]=qs['offset'](_0x3011c4[_0x070e('0x34')][_0x070e('0x1f')]);}_0xf57ed[_0x070e('0x3a')]=qs[_0x070e('0x3b')](_0x3011c4['query'][_0x070e('0x3b')]);_0xf57ed['where']=qs['filters'](_['pick'](_0x3011c4[_0x070e('0x34')],_0xf11439[_0x070e('0x35')]),_0x534150);if(_0x3011c4[_0x070e('0x34')][_0x070e('0x3c')]){_0xf57ed[_0x070e('0x3d')]=_['merge'](_0xf57ed[_0x070e('0x3d')],{'$or':_['map'](_0x534150,function(_0x23dac5){if(_0x23dac5[_0x070e('0x30')]!==_0x070e('0x3e')){var _0x52fcea={};_0x52fcea[_0x23dac5['name']]={'$like':'%'+_0x3011c4[_0x070e('0x34')]['filter']+'%'};return _0x52fcea;}})});}_0xf57ed=_[_0x070e('0x3f')]({},_0xf57ed,_0x3011c4[_0x070e('0x40')]);var _0x139820={'where':_0xf57ed['where']};return db[_0x070e('0x2f')][_0x070e('0x22')](_0x139820)['then'](function(_0x589b97){_0x4deaf8[_0x070e('0x22')]=_0x589b97;if(_0x3011c4[_0x070e('0x34')][_0x070e('0x41')]){_0xf57ed[_0x070e('0x42')]=[{'all':!![]}];}return db[_0x070e('0x2f')]['findAll'](_0xf57ed);})[_0x070e('0x27')](function(_0x3f6c64){_0x4deaf8[_0x070e('0x43')]=_0x3f6c64;return _0x4deaf8;})[_0x070e('0x27')](respondWithFilteredResult(_0x4bb439,_0xf57ed))[_0x070e('0x1b')](handleError(_0x4bb439,null));};exports[_0x070e('0x44')]=function(_0x1f54d5,_0x1b5374){var _0xd67987={'raw':![],'where':{'id':_0x1f54d5[_0x070e('0x45')]['id']},'include':[{'model':db[_0x070e('0x2c')],'as':_0x070e('0x2d')}]},_0x66a3f3={};_0x66a3f3[_0x070e('0x32')]=_[_0x070e('0x33')](db['ChatWebsite'][_0x070e('0x46')]);_0x66a3f3[_0x070e('0x34')]=_[_0x070e('0x33')](_0x1f54d5[_0x070e('0x34')]);_0x66a3f3[_0x070e('0x35')]=_[_0x070e('0x47')](_0x66a3f3[_0x070e('0x32')],_0x66a3f3[_0x070e('0x34')]);_0xd67987[_0x070e('0x36')]=_['intersection'](_0x66a3f3[_0x070e('0x32')],qs['fields'](_0x1f54d5[_0x070e('0x34')][_0x070e('0x37')]));_0xd67987['attributes']=_0xd67987[_0x070e('0x36')][_0x070e('0x38')]?_0xd67987[_0x070e('0x36')]:_0x66a3f3[_0x070e('0x32')];if(_0x1f54d5[_0x070e('0x34')][_0x070e('0x41')]){_0xd67987[_0x070e('0x42')]=[{'all':!![]}];}_0xd67987=_['merge']({},_0xd67987,_0x1f54d5[_0x070e('0x40')]);return db['ChatWebsite']['find'](_0xd67987)[_0x070e('0x27')](handleEntityNotFound(_0x1b5374,null))[_0x070e('0x27')](respondWithResult(_0x1b5374,null))[_0x070e('0x1b')](handleError(_0x1b5374,null));};exports[_0x070e('0x48')]=function(_0x202015,_0x7948ed){return db[_0x070e('0x2f')][_0x070e('0x48')](_0x202015['body'],{})[_0x070e('0x27')](function(_0x51d27d){var _0x564d82=_0x202015[_0x070e('0x49')][_0x070e('0x4a')]({'plain':!![]});if(!_0x564d82)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x564d82[_0x070e('0x4b')]===_0x070e('0x49')){var _0x210f4a=_0x51d27d[_0x070e('0x4a')]({'plain':!![]});var _0x1aacfc=_0x070e('0x4c');return db[_0x070e('0x4d')]['find']({'where':{'name':_0x1aacfc,'userProfileId':_0x564d82['userProfileId']},'raw':!![]})['then'](function(_0x3087e5){if(_0x3087e5&&_0x3087e5[_0x070e('0x4e')]===0x0){return db[_0x070e('0x4f')][_0x070e('0x48')]({'name':_0x210f4a['name'],'resourceId':_0x210f4a['id'],'type':_0x3087e5[_0x070e('0x2a')],'sectionId':_0x3087e5['id']},{})['then'](function(){return _0x51d27d;});}else{return _0x51d27d;}})[_0x070e('0x1b')](function(_0x1cbb7e){logger[_0x070e('0x17')](_0x070e('0x50'),_0x1cbb7e);throw _0x1cbb7e;});}return _0x51d27d;})[_0x070e('0x27')](respondWithResult(_0x7948ed,0xc9))[_0x070e('0x1b')](handleError(_0x7948ed,null));};exports['update']=function(_0x20ff87,_0x18e8d0){if(_0x20ff87[_0x070e('0x51')]['id']){delete _0x20ff87['body']['id'];}return db[_0x070e('0x2f')][_0x070e('0x52')]({'where':{'id':_0x20ff87['params']['id']},'include':[{'model':db[_0x070e('0x2c')],'as':'mandatoryDispositionPause'}]})[_0x070e('0x27')](handleEntityNotFound(_0x18e8d0,null))['then'](saveUpdates(_0x20ff87['body'],null))['then'](respondWithResult(_0x18e8d0,null))[_0x070e('0x1b')](handleError(_0x18e8d0,null));};exports[_0x070e('0x28')]=function(_0x1100d8,_0x122198){return db[_0x070e('0x2f')][_0x070e('0x52')]({'where':{'id':_0x1100d8['params']['id']}})[_0x070e('0x27')](handleEntityNotFound(_0x122198,null))['then'](removeEntity(_0x122198,null))[_0x070e('0x1b')](handleError(_0x122198,null));};exports['describe']=function(_0x2e10f7,_0x34f410){return db['ChatWebsite'][_0x070e('0x53')]()['then'](respondWithResult(_0x34f410,null))[_0x070e('0x1b')](handleError(_0x34f410,null));};exports[_0x070e('0x54')]=function(_0x2f1604,_0x2b172a){if(_0x2f1604[_0x070e('0x51')]['id']){delete _0x2f1604[_0x070e('0x51')]['id'];}return db[_0x070e('0x2f')][_0x070e('0x52')]({'where':{'id':_0x2f1604[_0x070e('0x45')]['id']}})[_0x070e('0x27')](handleEntityNotFound(_0x2b172a,null))[_0x070e('0x27')](function(_0x16887c){if(_0x16887c){_0x2f1604[_0x070e('0x51')][_0x070e('0x55')]=_0x16887c['id'];return db['Disposition'][_0x070e('0x48')](_0x2f1604[_0x070e('0x51')]);}})[_0x070e('0x27')](respondWithResult(_0x2b172a,null))[_0x070e('0x1b')](handleError(_0x2b172a,null));};exports['getDispositions']=function(_0x2ccd8d,_0x4e8e58){var _0x398f54={'raw':![],'where':{}};var _0x5625a9={};var _0x2a7b5d={'count':0x0,'rows':[]};return db[_0x070e('0x2f')]['findOne']({'where':{'id':_0x2ccd8d[_0x070e('0x45')]['id']}})[_0x070e('0x27')](handleEntityNotFound(_0x4e8e58,null))[_0x070e('0x27')](function(_0x2fe202){if(_0x2fe202){_0x5625a9['model']=_[_0x070e('0x33')](db['Disposition'][_0x070e('0x46')]);_0x5625a9[_0x070e('0x34')]=_[_0x070e('0x33')](_0x2ccd8d[_0x070e('0x34')]);_0x5625a9[_0x070e('0x35')]=_['intersection'](_0x5625a9[_0x070e('0x32')],_0x5625a9[_0x070e('0x34')]);_0x398f54[_0x070e('0x36')]=_[_0x070e('0x47')](_0x5625a9['model'],qs[_0x070e('0x37')](_0x2ccd8d['query'][_0x070e('0x37')]));_0x398f54[_0x070e('0x36')]=_0x398f54[_0x070e('0x36')]['length']?_0x398f54[_0x070e('0x36')]:_0x5625a9['model'];if(!_0x2ccd8d[_0x070e('0x34')]['hasOwnProperty'](_0x070e('0x39'))){_0x398f54[_0x070e('0x21')]=qs['limit'](_0x2ccd8d[_0x070e('0x34')]['limit']);_0x398f54[_0x070e('0x1f')]=qs[_0x070e('0x1f')](_0x2ccd8d['query']['offset']);}_0x398f54[_0x070e('0x3a')]=qs[_0x070e('0x3b')](_0x2ccd8d[_0x070e('0x34')][_0x070e('0x3b')]);_0x398f54[_0x070e('0x3d')]=qs[_0x070e('0x35')](_[_0x070e('0x56')](_0x2ccd8d[_0x070e('0x34')],_0x5625a9[_0x070e('0x35')]));_0x398f54[_0x070e('0x3d')][_0x070e('0x55')]=_0x2fe202['id'];if(_0x2ccd8d[_0x070e('0x34')][_0x070e('0x3c')]){_0x398f54['where']=_[_0x070e('0x3f')](_0x398f54[_0x070e('0x3d')],{'$or':_['map'](_0x398f54['attributes'],function(_0x1916f4){var _0x2a4de5={};_0x2a4de5[_0x1916f4]={'$like':'%'+_0x2ccd8d[_0x070e('0x34')][_0x070e('0x3c')]+'%'};return _0x2a4de5;})});}_0x398f54=_[_0x070e('0x3f')]({},_0x398f54,_0x2ccd8d[_0x070e('0x40')]);return db[_0x070e('0x57')][_0x070e('0x22')]({'where':_0x398f54[_0x070e('0x3d')]})[_0x070e('0x27')](function(_0x62800d){_0x2a7b5d[_0x070e('0x22')]=_0x62800d;if(_0x2ccd8d[_0x070e('0x34')]['includeAll']){_0x398f54['include']=[{'all':!![]}];}return db['Disposition'][_0x070e('0x58')](_0x398f54);})[_0x070e('0x27')](function(_0x2c4e67){_0x2a7b5d[_0x070e('0x43')]=_0x2c4e67;return _0x2a7b5d;});}})['then'](respondWithFilteredResult(_0x4e8e58,_0x398f54))[_0x070e('0x1b')](handleError(_0x4e8e58,null));};exports[_0x070e('0x59')]=function(_0x416dde,_0xd74f9c){return db[_0x070e('0x2f')][_0x070e('0x52')]({'where':{'id':_0x416dde['params']['id']}})[_0x070e('0x27')](handleEntityNotFound(_0xd74f9c,null))['then'](function(_0x2e5bca){if(_0x2e5bca){return _0x2e5bca[_0x070e('0x59')](_0x416dde[_0x070e('0x34')][_0x070e('0x5a')]);}})[_0x070e('0x27')](respondWithStatusCode(_0xd74f9c,null))['catch'](handleError(_0xd74f9c,null));};exports[_0x070e('0x5b')]=function(_0x15450f,_0x5d3bd8){if(_0x15450f[_0x070e('0x51')]['id']){delete _0x15450f[_0x070e('0x51')]['id'];}return db['ChatWebsite'][_0x070e('0x52')]({'where':{'id':_0x15450f[_0x070e('0x45')]['id']}})[_0x070e('0x27')](handleEntityNotFound(_0x5d3bd8,null))['then'](function(_0x40d7e6){if(_0x40d7e6){_0x15450f[_0x070e('0x51')][_0x070e('0x55')]=_0x40d7e6['id'];return db[_0x070e('0x5c')][_0x070e('0x48')](_0x15450f[_0x070e('0x51')]);}})[_0x070e('0x27')](respondWithResult(_0x5d3bd8,null))[_0x070e('0x1b')](handleError(_0x5d3bd8,null));};exports[_0x070e('0x5d')]=function(_0x31ab81,_0x1b1a0c){var _0x46d2b7={'raw':![],'where':{}};var _0x18c27a={};var _0x4b058d={'count':0x0,'rows':[]};return db[_0x070e('0x2f')][_0x070e('0x5e')]({'where':{'id':_0x31ab81[_0x070e('0x45')]['id']}})[_0x070e('0x27')](handleEntityNotFound(_0x1b1a0c,null))[_0x070e('0x27')](function(_0x1d1aa2){if(_0x1d1aa2){_0x18c27a['model']=_['keys'](db['CannedAnswer'][_0x070e('0x46')]);_0x18c27a[_0x070e('0x34')]=_[_0x070e('0x33')](_0x31ab81[_0x070e('0x34')]);_0x18c27a['filters']=_[_0x070e('0x47')](_0x18c27a[_0x070e('0x32')],_0x18c27a[_0x070e('0x34')]);_0x46d2b7['attributes']=_[_0x070e('0x47')](_0x18c27a['model'],qs[_0x070e('0x37')](_0x31ab81[_0x070e('0x34')]['fields']));_0x46d2b7['attributes']=_0x46d2b7[_0x070e('0x36')][_0x070e('0x38')]?_0x46d2b7['attributes']:_0x18c27a[_0x070e('0x32')];if(!_0x31ab81['query']['hasOwnProperty']('nolimit')){_0x46d2b7[_0x070e('0x21')]=qs[_0x070e('0x21')](_0x31ab81[_0x070e('0x34')][_0x070e('0x21')]);_0x46d2b7[_0x070e('0x1f')]=qs[_0x070e('0x1f')](_0x31ab81[_0x070e('0x34')][_0x070e('0x1f')]);}_0x46d2b7[_0x070e('0x3a')]=qs[_0x070e('0x3b')](_0x31ab81[_0x070e('0x34')][_0x070e('0x3b')]);_0x46d2b7[_0x070e('0x3d')]=qs[_0x070e('0x35')](_[_0x070e('0x56')](_0x31ab81[_0x070e('0x34')],_0x18c27a[_0x070e('0x35')]));_0x46d2b7[_0x070e('0x3d')][_0x070e('0x55')]=_0x1d1aa2['id'];if(_0x31ab81[_0x070e('0x34')][_0x070e('0x3c')]){_0x46d2b7[_0x070e('0x3d')]=_['merge'](_0x46d2b7[_0x070e('0x3d')],{'$or':_[_0x070e('0x2e')](_0x46d2b7[_0x070e('0x36')],function(_0xe50b1b){var _0x495403={};_0x495403[_0xe50b1b]={'$like':'%'+_0x31ab81[_0x070e('0x34')][_0x070e('0x3c')]+'%'};return _0x495403;})});}_0x46d2b7=_[_0x070e('0x3f')]({},_0x46d2b7,_0x31ab81[_0x070e('0x40')]);return db[_0x070e('0x5c')][_0x070e('0x22')]({'where':_0x46d2b7['where']})['then'](function(_0x524a81){_0x4b058d[_0x070e('0x22')]=_0x524a81;if(_0x31ab81['query'][_0x070e('0x41')]){_0x46d2b7[_0x070e('0x42')]=[{'all':!![]}];}return db['CannedAnswer'][_0x070e('0x58')](_0x46d2b7);})[_0x070e('0x27')](function(_0x4f9a95){_0x4b058d['rows']=_0x4f9a95;return _0x4b058d;});}})[_0x070e('0x27')](respondWithFilteredResult(_0x1b1a0c,_0x46d2b7))[_0x070e('0x1b')](handleError(_0x1b1a0c,null));};exports[_0x070e('0x5f')]=function(_0x38f600,_0x6149cc){return db['ChatWebsite'][_0x070e('0x52')]({'where':{'id':_0x38f600['params']['id']}})[_0x070e('0x27')](handleEntityNotFound(_0x6149cc,null))[_0x070e('0x27')](function(_0x490641){if(_0x490641){return _0x490641[_0x070e('0x5f')](_0x38f600[_0x070e('0x34')][_0x070e('0x5a')]);}})[_0x070e('0x27')](respondWithStatusCode(_0x6149cc,null))[_0x070e('0x1b')](handleError(_0x6149cc,null));};exports[_0x070e('0x60')]=function(_0x4bc490,_0x41a3cc){_0x4bc490[_0x070e('0x51')][_0x070e('0x61')]=_0x4bc490[_0x070e('0x62')][_0x070e('0x63')];return db['ChatWebsite'][_0x070e('0x52')]({'where':{'id':_0x4bc490[_0x070e('0x45')]['id']}})[_0x070e('0x27')](handleEntityNotFound(_0x41a3cc,null))[_0x070e('0x27')](saveUpdates(_0x4bc490[_0x070e('0x51')],null))[_0x070e('0x27')](respondWithResult(_0x41a3cc,null))[_0x070e('0x1b')](handleError(_0x41a3cc,null));};exports[_0x070e('0x64')]=function(_0x1fb1e6,_0xfe61be){_0x1fb1e6[_0x070e('0x51')][_0x070e('0x65')]=_0x1fb1e6[_0x070e('0x62')][_0x070e('0x63')];return db[_0x070e('0x2f')][_0x070e('0x52')]({'where':{'id':_0x1fb1e6['params']['id']}})['then'](handleEntityNotFound(_0xfe61be,null))[_0x070e('0x27')](saveUpdates(_0x1fb1e6[_0x070e('0x51')],null))['then'](respondWithResult(_0xfe61be,null))['catch'](handleError(_0xfe61be,null));};exports['addCustomerAvatar']=function(_0x4cb7b2,_0x1a430d){_0x4cb7b2[_0x070e('0x51')][_0x070e('0x66')]=_0x4cb7b2[_0x070e('0x62')][_0x070e('0x63')];return db[_0x070e('0x2f')][_0x070e('0x52')]({'where':{'id':_0x4cb7b2[_0x070e('0x45')]['id']}})[_0x070e('0x27')](handleEntityNotFound(_0x1a430d,null))[_0x070e('0x27')](saveUpdates(_0x4cb7b2['body'],null))[_0x070e('0x27')](respondWithResult(_0x1a430d,null))[_0x070e('0x1b')](handleError(_0x1a430d,null));};exports['addSystemAvatar']=function(_0x30db4a,_0x2890ba){_0x30db4a[_0x070e('0x51')][_0x070e('0x67')]=_0x30db4a['file'][_0x070e('0x63')];return db[_0x070e('0x2f')][_0x070e('0x52')]({'where':{'id':_0x30db4a[_0x070e('0x45')]['id']}})['then'](handleEntityNotFound(_0x2890ba,null))[_0x070e('0x27')](saveUpdates(_0x30db4a[_0x070e('0x51')],null))[_0x070e('0x27')](respondWithResult(_0x2890ba,null))[_0x070e('0x1b')](handleError(_0x2890ba,null));};exports[_0x070e('0x68')]=function(_0x27b51c,_0x1a4ed1){var _0xb2cca5=path[_0x070e('0x69')](config[_0x070e('0x6a')],_0x070e('0x6b'));var _0x479888={'where':{'id':_0x27b51c[_0x070e('0x45')]['id']},'attributes':['id',_0x070e('0x61')],'raw':!![]};var _0x5e3263=![];return require('../../config/license/util')[_0x070e('0x6c')]()['then'](function(_0x2c759a){if(_0x2c759a){_0x5e3263=_0x2c759a[_0x070e('0x6d')];}})[_0x070e('0x27')](function(){return db[_0x070e('0x2f')][_0x070e('0x52')](_0x479888);})[_0x070e('0x27')](handleEntityNotFound(_0x1a4ed1,null))[_0x070e('0x27')](function(_0x5186d8){if(_0x5186d8){if(!_[_0x070e('0x6e')](_0x5186d8[_0x070e('0x61')])){if(fs[_0x070e('0x6f')](path[_0x070e('0x69')](config['root'],'server/files/images/logos/',_0x5186d8[_0x070e('0x61')]))&&_0x5e3263){_0xb2cca5=path[_0x070e('0x69')](config[_0x070e('0x6a')],'server/files/images/logos/',_0x5186d8[_0x070e('0x61')]);}}return _0x1a4ed1[_0x070e('0x70')](_0xb2cca5);}})['catch'](handleError(_0x1a4ed1,null));};exports[_0x070e('0x71')]=function(_0x344289,_0x7af3cd){var _0x33009c=path[_0x070e('0x69')](config[_0x070e('0x6a')],'server/files/images/avatars/default_avatar.png');var _0x58c3d7={'where':{'id':_0x344289[_0x070e('0x45')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0x070e('0x2f')][_0x070e('0x52')](_0x58c3d7)['then'](handleEntityNotFound(_0x7af3cd,null))[_0x070e('0x27')](function(_0x4b80b9){if(_0x4b80b9){if(!_[_0x070e('0x6e')](_0x4b80b9[_0x070e('0x65')])){if(fs[_0x070e('0x6f')](path[_0x070e('0x69')](config[_0x070e('0x6a')],_0x070e('0x72'),_0x4b80b9['agentAvatar']))){_0x33009c=path[_0x070e('0x69')](config[_0x070e('0x6a')],'server/files/images/avatars/',_0x4b80b9['agentAvatar']);}}return _0x7af3cd[_0x070e('0x70')](_0x33009c);}})[_0x070e('0x1b')](handleError(_0x7af3cd,null));};exports[_0x070e('0x73')]=function(_0x13ffd9,_0x3893a5){var _0x3e2c30=path[_0x070e('0x69')](config[_0x070e('0x6a')],'server/files/images/avatars/customer_avatar.png');var _0x1deb2a={'where':{'id':_0x13ffd9[_0x070e('0x45')]['id']},'attributes':['id',_0x070e('0x66'),_0x070e('0x74')],'raw':!![]};return db[_0x070e('0x2f')][_0x070e('0x52')](_0x1deb2a)[_0x070e('0x27')](handleEntityNotFound(_0x3893a5,null))[_0x070e('0x27')](function(_0x522513){if(_0x522513){if(!_[_0x070e('0x6e')](_0x522513[_0x070e('0x66')])){if(fs[_0x070e('0x6f')](path[_0x070e('0x69')](config[_0x070e('0x6a')],_0x070e('0x72'),_0x522513[_0x070e('0x66')]))&&_0x522513[_0x070e('0x74')]){_0x3e2c30=path[_0x070e('0x69')](config[_0x070e('0x6a')],'server/files/images/avatars/',_0x522513['customerAvatar']);}}return _0x3893a5[_0x070e('0x70')](_0x3e2c30);}})[_0x070e('0x1b')](handleError(_0x3893a5,null));};exports[_0x070e('0x75')]=function(_0x567202,_0xefd35a){var _0x36dfb5=path['join'](config[_0x070e('0x6a')],_0x070e('0x76'));var _0x2f34b9={'where':{'id':_0x567202[_0x070e('0x45')]['id']},'attributes':['id',_0x070e('0x67')],'raw':!![]};return db[_0x070e('0x2f')]['find'](_0x2f34b9)['then'](handleEntityNotFound(_0xefd35a,null))[_0x070e('0x27')](function(_0x3f3d7e){if(_0x3f3d7e){if(!_['isNil'](_0x3f3d7e[_0x070e('0x67')])){if(fs[_0x070e('0x6f')](path[_0x070e('0x69')](config[_0x070e('0x6a')],_0x070e('0x72'),_0x3f3d7e[_0x070e('0x67')]))){_0x36dfb5=path['join'](config[_0x070e('0x6a')],_0x070e('0x72'),_0x3f3d7e['systemAvatar']);}}return _0xefd35a[_0x070e('0x70')](_0x36dfb5);}})[_0x070e('0x1b')](handleError(_0xefd35a,null));};exports[_0x070e('0x77')]=function(_0x1fe46c,_0x4b6569){var _0x4c621a=require(_0x070e('0x78'));var _0x210e92=new _0x4c621a();var _0x2ad143=_0x210e92[_0x070e('0x79')](_0x1fe46c[_0x070e('0x7a')][_0x070e('0x7b')])[_0x070e('0x7c')]();var _0x2e1753={'body':_0x1fe46c[_0x070e('0x51')],'channel':_0x070e('0x7d')};var _0x4aab66=[];var _0x3759a6=[];var _0x13e414={};var _0x1de175=![];return db[_0x070e('0x7e')]['describe']()[_0x070e('0x27')](function(_0x35ddab){if(!_0x35ddab){throw new db['Sequelize']['ValidationError'](_0x070e('0x7f'));}_0x4aab66=_[_0x070e('0x80')](_[_0x070e('0x33')](_0x35ddab),['createdAt',_0x070e('0x81')]);_0x3759a6=_[_0x070e('0x80')](_[_0x070e('0x33')](_0x35ddab),[_0x070e('0x82'),_0x070e('0x81'),'CompanyId',_0x070e('0x83')]);if(_0x1fe46c[_0x070e('0x51')]['id']){delete _0x1fe46c['body']['id'];}if(_[_0x070e('0x6e')](_0x1fe46c['body']['from'])){throw new db['Sequelize'][(_0x070e('0x84'))](_0x070e('0x85'));}if(_[_0x070e('0x6e')](_0x1fe46c[_0x070e('0x51')]['body'])||_0x1fe46c[_0x070e('0x51')][_0x070e('0x51')]===''){throw new db['Sequelize'][(_0x070e('0x84'))](_0x070e('0x86'));}if(_[_0x070e('0x6e')](_0x1fe46c[_0x070e('0x51')][_0x070e('0x87')])){throw new db[(_0x070e('0x88'))]['ValidationError'](_0x070e('0x89')+_0x3759a6);}if(!_['includes'](_0x3759a6,_0x1fe46c[_0x070e('0x51')][_0x070e('0x87')])){throw new db[(_0x070e('0x88'))]['ValidationError'](_0x070e('0x8a')+_0x3759a6);}_0x13e414[_0x1fe46c[_0x070e('0x51')][_0x070e('0x87')]]=_0x1fe46c['body'][_0x070e('0x8b')];})[_0x070e('0x27')](function(){return db['ChatWebsite'][_0x070e('0x52')]({'where':{'id':_0x1fe46c[_0x070e('0x45')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db['CmContact'],'as':'Contacts','where':_0x13e414,'limit':0x1,'order':[[_0x070e('0x81'),_0x070e('0x8c')]]}]},{'model':db[_0x070e('0x8d')],'as':_0x070e('0x8e')}]});})[_0x070e('0x27')](handleEntityNotFound(_0x4b6569,null))[_0x070e('0x27')](function(_0x3ce644){if(_0x3ce644&&_0x3ce644[_0x070e('0x8f')]){_0x2e1753['account']=_0x3ce644;_0x2e1753['applications']=_0x3ce644['Applications'];_0x2e1753['list']=_0x3ce644[_0x070e('0x8f')];_0x2e1753[_0x070e('0x90')]=_[_0x070e('0x91')](_0x2e1753[_0x070e('0x90')],[_0x070e('0x92')],['asc']);if(_0x2e1753['account'][_0x070e('0x8e')]){delete _0x2e1753[_0x070e('0x93')]['Applications'];}if(_0x2e1753[_0x070e('0x93')][_0x070e('0x8f')]&&_0x2e1753[_0x070e('0x93')][_0x070e('0x8f')][_0x070e('0x94')][_0x070e('0x38')]){return _0x2e1753['account'][_0x070e('0x8f')][_0x070e('0x94')][0x0];}var _0xb56b8e=_['defaults'](_0x1fe46c[_0x070e('0x51')],{'firstName':_0x1fe46c[_0x070e('0x51')][_0x070e('0x8b')],'ListId':_0x3ce644[_0x070e('0x83')]});_0xb56b8e[_0x1fe46c['body'][_0x070e('0x87')]]=_0x1fe46c[_0x070e('0x51')]['from'];return db[_0x070e('0x7e')][_0x070e('0x48')](_0xb56b8e,{'fields':_0x4aab66,'raw':!![]});}})['then'](handleEntityNotFound(_0x4b6569,null))[_0x070e('0x27')](function(_0x4ff695){_0x2e1753[_0x070e('0x95')]=_0x4ff695;var _0x54f8d3=_0x1fe46c[_0x070e('0x51')]['customerIp'];if(_0x1fe46c['headers'][_0x070e('0x96')]){_0x54f8d3=_0x1fe46c['headers']['cf-connecting-ip'];}else if(_0x1fe46c[_0x070e('0x7a')][_0x070e('0x97')]){_0x54f8d3=_[_0x070e('0x98')](_0x1fe46c[_0x070e('0x7a')][_0x070e('0x97')]['split'](','));}if(_0x4ff695){var _0x29e1f8={'ContactId':_0x4ff695['id'],'ChatWebsiteId':_0x1fe46c[_0x070e('0x45')]['id'],'from':(_0x4ff695[_0x070e('0x99')]||'')+'\x20'+(_0x4ff695[_0x070e('0x9a')]||''),'customerIp':_0x54f8d3,'customerPort':_0x1fe46c[_0x070e('0x7a')][_0x070e('0x9b')]?_0x1fe46c['headers'][_0x070e('0x9b')]:null,'referer':_0x1fe46c[_0x070e('0x51')][_0x070e('0x9c')],'browserName':_0x2ad143[_0x070e('0x9d')]['name']&&_0x2ad143['browser'][_0x070e('0x9e')]?util[_0x070e('0x9f')](_0x070e('0xa0'),_0x2ad143[_0x070e('0x9d')][_0x070e('0x2a')],_0x2ad143[_0x070e('0x9d')]['version']):_0x070e('0xa1'),'browserVersion':_0x2ad143[_0x070e('0x9d')][_0x070e('0x9e')]||_0x070e('0xa1'),'osName':util[_0x070e('0x9f')](_0x070e('0xa0'),_0x2ad143['os']['name'],_0x2ad143['os']['version']),'osVersion':_0x2ad143['os'][_0x070e('0x9e')],'deviceModel':_0x2ad143[_0x070e('0xa2')][_0x070e('0x32')]&&_0x2ad143[_0x070e('0xa2')][_0x070e('0xa3')]?util[_0x070e('0x9f')](_0x070e('0xa4'),_0x2ad143['device'][_0x070e('0x32')],_0x2ad143['device'][_0x070e('0xa3')],_0x2ad143['device']['type']):null,'deviceVendor':_0x2ad143['device'][_0x070e('0xa3')],'deviceType':_0x2ad143[_0x070e('0xa2')][_0x070e('0x30')],'formData':JSON[_0x070e('0x15')](_0x1fe46c[_0x070e('0x51')])};var _0x2016e8={'ChatWebsiteId':_0x1fe46c[_0x070e('0x45')]['id'],'closed':![]};if(_0x1fe46c[_0x070e('0x51')][_0x070e('0xa5')]){_0x2016e8['threadId']=_0x1fe46c[_0x070e('0x51')][_0x070e('0xa5')];return db[_0x070e('0xa6')][_0x070e('0x52')]({'where':_0x2016e8})[_0x070e('0x27')](function(_0x3d3375){if(_0x3d3375){return[_0x3d3375,![]];}_0x29e1f8[_0x070e('0xa5')]=_0x1fe46c[_0x070e('0x51')][_0x070e('0xa5')];_0x29e1f8['externalUrl']=_0x1fe46c['body'][_0x070e('0xa7')];return db[_0x070e('0xa6')]['create'](_0x29e1f8)[_0x070e('0x27')](function(_0x58985b){return[_0x58985b,!![]];});});}_0x2016e8['ContactId']=_0x4ff695['id'];if(_0x1fe46c[_0x070e('0x51')][_0x070e('0xa8')]&&_0x1fe46c['body'][_0x070e('0xa8')]['id']){_0x2016e8['id']=_0x1fe46c[_0x070e('0x51')][_0x070e('0xa8')]['id'];return db['ChatInteraction']['find']({'where':_0x2016e8})[_0x070e('0x27')](function(_0x33bd72){if(_0x33bd72){return[_0x33bd72,![]];}return db[_0x070e('0xa6')]['create'](_0x29e1f8)[_0x070e('0x27')](function(_0x36a2cf){return[_0x36a2cf,!![]];});});}return db['ChatInteraction'][_0x070e('0x48')](_0x29e1f8)[_0x070e('0x27')](function(_0x2f5f19){return[_0x2f5f19,!![]];});}})[_0x070e('0xa9')](function(_0x3f7b2c,_0x92db3c){if(_0x3f7b2c){_0x1de175=_0x92db3c;if(!_0x92db3c){var _0x921cc0={'from':(_0x2e1753[_0x070e('0x95')][_0x070e('0x99')]||'')+'\x20'+(_0x2e1753[_0x070e('0x95')][_0x070e('0x9a')]||'')};if(_0x1fe46c[_0x070e('0x51')][_0x070e('0xa5')]&&_0x1fe46c[_0x070e('0x51')][_0x070e('0xaa')]&&_0x1fe46c[_0x070e('0x51')][_0x070e('0xa5')]!=_0x1fe46c['body']['messageId']){_0x921cc0['threadId']=_0x1fe46c['body'][_0x070e('0xaa')];}return _0x3f7b2c[_0x070e('0x26')](_0x921cc0);}else{return _0x3f7b2c;}}})[_0x070e('0x27')](function(_0x4f89d2){_0x2e1753[_0x070e('0xa8')]=_0x4f89d2[_0x070e('0x4a')]({'plain':!![]});_0x2e1753[_0x070e('0xa8')]['created']=_0x1de175;if(_0x2e1753[_0x070e('0xa8')][_0x070e('0xab')]){if(_0x2e1753[_0x070e('0x93')][_0x070e('0xac')]){_0x2e1753['applications'][_0x070e('0xad')]({'id':0x0,'priority':_0x2e1753[_0x070e('0x90')][_0x070e('0x38')]+0x1,'app':'close','appdata':_0x070e('0xae'),'interval':_0x070e('0xaf')});}}return db[_0x070e('0xb0')][_0x070e('0x48')]({'body':_0x1fe46c[_0x070e('0x51')][_0x070e('0x51')],'ChatWebsiteId':_0x1fe46c[_0x070e('0x45')]['id'],'ChatInteractionId':_0x4f89d2['id'],'direction':'in','ContactId':_0x2e1753[_0x070e('0x95')]['id'],'AttachmentId':_0x1fe46c[_0x070e('0x51')]['AttachmentId']});})['then'](function(_0x276c34){_0x2e1753['message']=_0x276c34;if(!_0x2e1753['interaction'][_0x070e('0xb1')]){return;}return db[_0x070e('0xb2')][_0x070e('0x52')]({'attributes':['id',_0x070e('0x2a')],'where':{'id':_0x2e1753[_0x070e('0xa8')][_0x070e('0xb1')]}});})['then'](function(_0x2b9209){if(_0x2b9209){_0x2e1753[_0x070e('0x90')][_0x070e('0xb3')]({'id':0x0,'priority':0x0,'app':_0x070e('0xb4'),'appdata':_0x2b9209['name']+','+(_0x2e1753[_0x070e('0x93')]['waitForTheAssignedAgent']||0xa),'interval':_0x070e('0xaf')});_0x2e1753[_0x070e('0xb5')]=!![];}if(!_0x2e1753[_0x070e('0xa8')][_0x070e('0xb6')]){return;}return db[_0x070e('0xb7')][_0x070e('0x52')]({'attributes':['id',_0x070e('0x2a')],'where':{'id':_0x2e1753[_0x070e('0xa8')][_0x070e('0xb6')]}});})['then'](function(_0xc35037){if(_0xc35037){_0x2e1753[_0x070e('0x90')][_0x070e('0xb3')]({'id':0x0,'priority':0x1,'app':_0x070e('0xb8'),'appdata':_0xc35037[_0x070e('0x2a')]+','+(_0x2e1753[_0x070e('0x93')][_0x070e('0xb9')]||0x12c),'interval':_0x070e('0xaf')});}return respondWithRpcPromise('Start',_0x070e('0xba'),_0x2e1753);})[_0x070e('0x27')](function(_0x5356d0){respondWithRpcPromise('EventManager',_0x070e('0xbb'),{'event':_0x070e('0x77'),'message':_0x5356d0},client9002);return _0x5356d0;})[_0x070e('0x27')](respondWithResult(_0x4b6569,null))[_0x070e('0x1b')](handleError(_0x4b6569,null));};exports[_0x070e('0xbc')]=function(_0x45ee9e,_0x545fb5){var _0x5c44b4,_0x236ccb,_0x37fb87;var _0x5079d9=[];var _0x31d3fa={};var _0x5aebee=_0x45ee9e[_0x070e('0xbd')]||[];var _0xa2c957=[];var _0x535518;return db[_0x070e('0x7e')][_0x070e('0x53')]()['then'](function(_0x5549ad){if(!_0x5549ad){throw new db[(_0x070e('0x88'))]['ValidationError'](_0x070e('0x7f'));}_0x5079d9=_[_0x070e('0x80')](_[_0x070e('0x33')](_0x5549ad),['createdAt',_0x070e('0x81'),_0x070e('0xbe'),'ListId']);if(_0x45ee9e[_0x070e('0x51')]['id']){delete _0x45ee9e[_0x070e('0x51')]['id'];}if(_[_0x070e('0x6e')](_0x45ee9e[_0x070e('0x51')][_0x070e('0x8b')])){throw _0x545fb5[_0x070e('0x1d')](0x1f4)[_0x070e('0xbf')](new db[(_0x070e('0x88'))][(_0x070e('0x84'))](_0x070e('0x85')));}if(_['isNil'](_0x45ee9e[_0x070e('0x51')][_0x070e('0x51')])||_0x45ee9e[_0x070e('0x51')]['body']===''){throw _0x545fb5['status'](0x1f4)[_0x070e('0xbf')](new db[(_0x070e('0x88'))][(_0x070e('0x84'))](_0x070e('0x86')));}if(_['isNil'](_0x45ee9e[_0x070e('0x51')]['mapKeyOffline'])){throw _0x545fb5['status'](0x1f4)[_0x070e('0xbf')](new db['Sequelize'][(_0x070e('0x84'))](_0x070e('0xc0')+_0x5079d9));}if(!_[_0x070e('0xc1')](_0x5079d9,_0x45ee9e[_0x070e('0x51')]['mapKeyOffline'])){throw _0x545fb5[_0x070e('0x1d')](0x1f4)['send'](new db[(_0x070e('0x88'))][(_0x070e('0x84'))](_0x070e('0xc2')+_0x5079d9));}_0x31d3fa[_0x45ee9e[_0x070e('0x51')][_0x070e('0xc3')]]=_0x45ee9e[_0x070e('0x51')][_0x070e('0x8b')];})[_0x070e('0x27')](function(){return db[_0x070e('0x2f')][_0x070e('0x52')]({'where':{'id':_0x45ee9e[_0x070e('0x45')]['id']},'include':[{'model':db[_0x070e('0xc4')],'as':_0x070e('0x8f')},{'model':db[_0x070e('0xc5')],'as':_0x070e('0xc5')}]});})[_0x070e('0x27')](handleEntityNotFound(_0x545fb5,null))['then'](function(_0x48ea98){if(_0x48ea98&&_0x48ea98[_0x070e('0x8f')]){_0x236ccb=_0x48ea98;var _0x2b2b57=_['defaults'](_0x45ee9e[_0x070e('0x51')],{'firstName':_0x45ee9e[_0x070e('0x51')]['from'],'phone':_0x45ee9e[_0x070e('0x51')][_0x070e('0x8b')],'ListId':_0x48ea98['ListId']});_0x2b2b57[_0x45ee9e[_0x070e('0x51')][_0x070e('0xc3')]]=_0x45ee9e[_0x070e('0x51')][_0x070e('0x8b')];return db[_0x070e('0x7e')][_0x070e('0xc6')]({'where':_0x31d3fa,'defaults':_0x2b2b57});}})['spread'](function(_0x3a01db){if(_0x3a01db){_0x37fb87=_0x3a01db;var _0x283199=fs[_0x070e('0xc7')](path['join'](config[_0x070e('0x6a')],_0x070e('0xc8')),_0x070e('0xc9'));var _0x1a6a01=ejs['render'](_0x283199,{'body':_['toPairs'](_0x45ee9e[_0x070e('0x51')][_0x070e('0x51')]),'bodyTitle':_0x236ccb[_0x070e('0xca')]});return db[_0x070e('0xcb')][_0x070e('0x48')]({'body':_0x1a6a01,'plainBody':htmlToText[_0x070e('0xcc')](_0x1a6a01),'ContactId':_0x3a01db['id'],'ChatWebsiteId':_0x236ccb['id']});}})[_0x070e('0x27')](function(_0x48882f){_0x535518=_0x48882f;if(_0x5aebee[_0x070e('0x38')]){var _0x181cce=_0x5aebee[_0x070e('0x2e')](function(_0x172aa1){return{'name':_0x172aa1[_0x070e('0xcd')],'basename':_0x172aa1[_0x070e('0x63')],'type':_0x172aa1[_0x070e('0xce')],'ChatOfflineMessageId':_0x48882f['id']};});_0xa2c957=_0x181cce[_0x070e('0x2e')](_0x408ba0=>{var _0x5734ba={'filename':_0x408ba0[_0x070e('0x2a')],'path':path[_0x070e('0x69')](config[_0x070e('0x6a')],_0x070e('0xcf'),_0x070e('0xbd'),'attachments',_0x070e('0xd0'),_0x408ba0[_0x070e('0xd1')])};return _0x5734ba;});if(!_0x236ccb[_0x070e('0xd2')]){return db[_0x070e('0xd3')][_0x070e('0xd4')](function(_0x3c5019){return db[_0x070e('0xd5')]['bulkCreate'](_0x181cce,{'transaction':_0x3c5019});});}}})[_0x070e('0x27')](function(){if(_0x535518){_0x5c44b4=_0x535518;return db[_0x070e('0xc5')][_0x070e('0x5e')]({'where':{'service':!![]},'include':[{'model':db[_0x070e('0xd6')],'as':_0x070e('0xd7'),'raw':!![],'include':[{'model':db[_0x070e('0xd8')],'as':_0x070e('0xd8'),'raw':!![]}]}]});}})[_0x070e('0x27')](function(_0x45735c){if(_0x45735c&&_0x45735c['Smtp']&&_0x236ccb[_0x070e('0xd9')]&&_0x236ccb[_0x070e('0xda')]){var _0xf94878=_0x45735c[_0x070e('0xdb')]();return respondWithRpcPromise(_0x070e('0xdc'),_0x070e('0xdd'),{'account':_0xf94878,'message':{'from':util[_0x070e('0x9f')](_0x070e('0xde'),_0x45735c[_0x070e('0x2a')],_0x45735c[_0x070e('0xdf')]||_0x45735c[_0x070e('0xd7')][_0x070e('0x49')]),'to':_0x236ccb[_0x070e('0xda')],'subject':_0x236ccb[_0x070e('0xe0')],'html':_0x5c44b4[_0x070e('0x51')],'attachments':_0xa2c957}},client9003)[_0x070e('0x27')](function(){return _0x5c44b4;})[_0x070e('0x1b')](function(_0x5608f9){logger[_0x070e('0x17')](_0x5608f9);});}})[_0x070e('0x27')](function(){if(_0x236ccb&&_0x236ccb[_0x070e('0xd2')]&&_0x236ccb[_0x070e('0xe1')]){var _0x5608d0=[];if(_0x5aebee[_0x070e('0x38')]){_0x5608d0=_0x5aebee[_0x070e('0x2e')](function(_0x1fd493){return{'name':_0x1fd493[_0x070e('0xcd')],'basename':_0x1fd493['filename'],'type':_0x1fd493[_0x070e('0xce')],'ChatOfflineMessageId':_0x535518['id']};});}var _0x4c9619;if(!_[_0x070e('0x6e')](_0x236ccb['subjectOffline'])){var _0x59383a=_[_0x070e('0x2e')](_0x45ee9e[_0x070e('0x51')],function(_0x906cb7){return _0x906cb7;});var _0x5880bb=_[_0x070e('0xe2')](_0x59383a)[0x0];var _0x5ab854=_[_0x070e('0xe3')](_0x5880bb,function(_0x1e0e55){return _0x1e0e55;});_0x4c9619=_0x5ab854[0x1][_0x236ccb['subjectOffline']];}var _0x17a593={'from':_0x37fb87['email'],'firstName':_0x37fb87[_0x070e('0x99')],'lastName':_0x37fb87[_0x070e('0x9a')],'mapKey':_0x070e('0xdf'),'message':{'from':_0x37fb87['email'],'to':_0x236ccb['MailAccount'][_0x070e('0xdf')],'cc':'','subject':_['isNil'](_0x4c9619)?_0x236ccb[_0x070e('0xe0')]:_0x4c9619,'messageId':'','sentAt':new Date(),'attach':_0x5608d0[_0x070e('0x38')],'attachments':_0x5608d0,'originChannel':_0x070e('0xe4'),'ChatWebsiteId':_0x236ccb['id'],'ChatOfflineMessageId':_0x5c44b4['id'],'originTo':_0x236ccb[_0x070e('0xc5')][_0x070e('0xdf')]},'body':_0x5c44b4[_0x070e('0x51')]};var _0x4aaf0f={'account':{'id':_0x236ccb['MailAccountId']},'body':_0x17a593,'log':_0x070e('0xe5')};return respondWithRpcPromise('NotifyMailAccount','notifyMail',_0x4aaf0f,client9001)[_0x070e('0x27')](function(){return _0x5c44b4;})[_0x070e('0x1b')](function(_0x3c8b7d){logger['error'](_0x3c8b7d);});}return;})[_0x070e('0x27')](function(){if(_0x5c44b4){return _0x5c44b4;}})[_0x070e('0x27')](respondWithResult(_0x545fb5,null))[_0x070e('0x1b')](function(_0x4dfac3){logger['error'](_0x070e('0x1b'),_0x4dfac3);for(var _0x421d8e of _0x5aebee){var _0x306654=path['join'](config[_0x070e('0x6a')],'server',_0x070e('0xbd'),'attachments',_0x070e('0xd0'),_0x421d8e[_0x070e('0x63')]);fs_extra['remove'](_0x306654)[_0x070e('0x1b')](function(_0x30fa55){logger[_0x070e('0x17')](_0x070e('0xe6'),_0x306654,_0x30fa55);});}});};exports[_0x070e('0xe7')]=function(_0xd6529a,_0x24ded2){return db[_0x070e('0xa6')][_0x070e('0x52')]({'where':{'id':_0xd6529a[_0x070e('0x45')]['id']}})[_0x070e('0x27')](handleEntityNotFound(_0x24ded2,null))[_0x070e('0x27')](function(_0x3301b8){if(_0x3301b8){return _0x3301b8['addInteraction'](_0xd6529a[_0x070e('0x51')][_0x070e('0x5a')],_[_0x070e('0xe8')](_0xd6529a['body'],['ids','id'])||{});}})[_0x070e('0x27')](respondWithResult(_0x24ded2,null))[_0x070e('0x1b')](handleError(_0x24ded2,null));};exports['getInteractions']=function(_0x134ca4,_0x800c97){var _0x216d58={'raw':![],'where':{}};var _0x483c30={};var _0x9f2102={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x070e('0x5e')]({'where':{'id':_0x134ca4[_0x070e('0x45')]['id']}})['then'](handleEntityNotFound(_0x800c97,null))[_0x070e('0x27')](function(_0x2268ea){if(_0x2268ea){_0x483c30[_0x070e('0x32')]=_[_0x070e('0x33')](db[_0x070e('0xa6')][_0x070e('0x46')]);_0x483c30[_0x070e('0x34')]=_[_0x070e('0x33')](_0x134ca4[_0x070e('0x34')]);_0x483c30['filters']=_[_0x070e('0x47')](_0x483c30[_0x070e('0x32')],_0x483c30[_0x070e('0x34')]);_0x216d58[_0x070e('0x36')]=_['intersection'](_0x483c30['model'],qs['fields'](_0x134ca4[_0x070e('0x34')]['fields']));_0x216d58[_0x070e('0x36')]=_0x216d58[_0x070e('0x36')]['length']?_0x216d58[_0x070e('0x36')]:_0x483c30['model'];if(!_0x134ca4['query'][_0x070e('0xe9')](_0x070e('0x39'))){_0x216d58[_0x070e('0x21')]=qs[_0x070e('0x21')](_0x134ca4[_0x070e('0x34')][_0x070e('0x21')]);_0x216d58[_0x070e('0x1f')]=qs[_0x070e('0x1f')](_0x134ca4[_0x070e('0x34')][_0x070e('0x1f')]);}_0x216d58[_0x070e('0x3a')]=qs[_0x070e('0x3b')](_0x134ca4['query'][_0x070e('0x3b')]);_0x216d58[_0x070e('0x3d')]=qs[_0x070e('0x35')](_[_0x070e('0x56')](_0x134ca4[_0x070e('0x34')],_0x483c30[_0x070e('0x35')]));_0x216d58['where']['ChatWebsiteId']=_0x2268ea['id'];if(_0x134ca4['query'][_0x070e('0x3c')]){_0x216d58[_0x070e('0x3d')]=_[_0x070e('0x3f')](_0x216d58['where'],{'$or':_[_0x070e('0x2e')](_0x216d58[_0x070e('0x36')],function(_0x48437d){var _0x495926={};_0x495926[_0x48437d]={'$like':'%'+_0x134ca4[_0x070e('0x34')]['filter']+'%'};return _0x495926;})});}_0x216d58=_[_0x070e('0x3f')]({},_0x216d58,_0x134ca4[_0x070e('0x40')]);return db[_0x070e('0xa6')][_0x070e('0x22')]({'where':_0x216d58[_0x070e('0x3d')]})[_0x070e('0x27')](function(_0x4e1e0e){_0x9f2102[_0x070e('0x22')]=_0x4e1e0e;if(_0x134ca4[_0x070e('0x34')][_0x070e('0x41')]){_0x216d58['include']=[{'model':db[_0x070e('0x7e')],'as':'Contact','required':![]},{'model':db['User'],'as':_0x070e('0xea'),'attributes':['name',_0x070e('0xeb'),'internal'],'required':![]},{'model':db[_0x070e('0xec')],'as':_0x070e('0xed'),'attributes':['id','name',_0x070e('0xee')],'where':_0x134ca4[_0x070e('0x34')][_0x070e('0xef')]?{'id':_0x134ca4[_0x070e('0x34')][_0x070e('0xef')]}:undefined,'required':_0x134ca4[_0x070e('0x34')][_0x070e('0xef')]?!![]:![]}];}return db[_0x070e('0xa6')][_0x070e('0x58')](_0x216d58);})[_0x070e('0x27')](function(_0x52acf3){_0x9f2102[_0x070e('0x43')]=_0x52acf3;return _0x9f2102;});}})['then'](respondWithFilteredResult(_0x800c97,_0x216d58))[_0x070e('0x1b')](handleError(_0x800c97,null));};function iftimePromise(_0x8d52b9,_0x58052b){return respondWithRpcPromise(_0x070e('0xf0'),'getSnippet',{'command':_0x58052b[_0x070e('0xf1')]?util['format'](_0x070e('0xf2'),_0x8d52b9[_0x070e('0xf3')],_0x58052b['timezone']):util[_0x070e('0x9f')](_0x070e('0xf4'),_0x8d52b9[_0x070e('0xf3')])},client9002)[_0x070e('0x27')](function(_0x12e363){var _0x5cbcf6=_0x12e363&&_0x12e363[_0x070e('0xf5')]('true')>=0x0?!![]:![];logger['info'](_0x070e('0xf6'),_0x58052b['id'],_0x8d52b9['id'],_0x8d52b9['interval'],_0x5cbcf6?'ONLINE':_0x070e('0xf7'),_0x58052b['timezone']?_0x58052b[_0x070e('0xf1')]:_0x070e('0xf8'));return _0x5cbcf6;})[_0x070e('0x1b')](function(_0x56f60d){logger[_0x070e('0x17')](_0x070e('0xf6'),_0x58052b['id'],_0x8d52b9['id'],_0x8d52b9[_0x070e('0xf3')],util[_0x070e('0xf9')](_0x56f60d,{'showHidden':![],'depth':null}),_0x58052b[_0x070e('0xf1')]?_0x58052b['timezone']:_0x070e('0xf8'));return![];});}exports[_0x070e('0xfa')]=function(_0x2bc10f,_0x486249){var _0x20cae7=0x0;var _0x952836=0x0;var _0x399add=![];var _0x4e4996;var _0x1dbff0;return db[_0x070e('0x2f')][_0x070e('0x52')]({'where':{'id':_0x2bc10f[_0x070e('0x45')]['id']},'include':[{'model':db['Interval'],'as':_0x070e('0xfb'),'include':[{'model':db[_0x070e('0xfb')],'as':_0x070e('0xfc'),'attributes':['id','interval'],'raw':!![]}]}]})[_0x070e('0x27')](handleEntityNotFound(_0x486249,null))[_0x070e('0x27')](function(_0x73e3f4){if(_0x73e3f4){_0x4e4996=_0x73e3f4;return _0x73e3f4['getProactiveActions']({'raw':!![]});}})[_0x070e('0x27')](function(_0x581b04){if(_0x4e4996){if(_0x581b04){_0x1dbff0=_0x581b04;}}return require(_0x070e('0xfd'))[_0x070e('0x6c')]();})[_0x070e('0x27')](function(_0x46bc31){if(_0x46bc31){_0x952836=_0x46bc31['virtual'];_0x399add=_0x46bc31[_0x070e('0x6d')];}})[_0x070e('0x27')](function(){return db['ChatInteraction']['count']({'where':{'closed':![]}});})[_0x070e('0x27')](function(_0x4542a8){_0x20cae7=_0x4542a8;if(_0x952836&&_0x4542a8>_0x952836){return db[_0x070e('0xfe')][_0x070e('0x5e')]({'where':{'id':0x1}})['then'](function(_0x43b79d){if(_0x43b79d){_0x43b79d[_0x070e('0xff')](_0x070e('0x100'));}});}})['then'](function(){if(_0x4e4996[_0x070e('0xfb')]&&_0x4e4996[_0x070e('0xfb')][_0x070e('0xfc')]){var _0x26a26b=[];for(var _0x4d5e29=0x0;_0x4d5e29<_0x4e4996['Interval'][_0x070e('0xfc')][_0x070e('0x38')];_0x4d5e29++){var _0x58c7e1=_0x4e4996[_0x070e('0xfb')][_0x070e('0xfc')][_0x4d5e29]['get']({'plain':!![]});_0x26a26b['push'](iftimePromise(_0x58c7e1,_0x4e4996));}return BPromise[_0x070e('0x101')](_0x26a26b)[_0x070e('0x27')](function(_0x3094d4){return _[_0x070e('0x102')](_0x3094d4);});}else{return!![];}})['then'](function(_0x59d668){var _0x2d597c=fs[_0x070e('0xc7')](path['join'](config[_0x070e('0x6a')],'server/files/chat/iframe.ejs'),_0x070e('0xc9'));var _0x3420d0=new url[(_0x070e('0x103'))](_0x4e4996['address'])[_0x070e('0x104')];var _0x589b76='3.5.0';var _0x47e50f=![];var _0x36ad23={'chatVersion':_0x589b76,'chatWebsiteAddressOrigin':_0x3420d0,'remote':_0x4e4996[_0x070e('0x105')],'query':querystring[_0x070e('0x15')](_[_0x070e('0x3f')](_0x4e4996[_0x070e('0x4a')]({'plain':!![]}),{'customerIp':_0x2bc10f[_0x070e('0x7a')][_0x070e('0x97')]||_0x2bc10f[_0x070e('0x7a')][_0x070e('0x106')]||_0x2bc10f[_0x070e('0x107')][_0x070e('0x108')]||_0x2bc10f['ip'],'referer':_0x2bc10f['headers'][_0x070e('0x9c')],'openedInteractions':_0x20cae7,'maxInteractions':_0x952836,'virtual':_0x399add[_0x070e('0x109')],'online':_0x59d668,'custom':_0x399add}))['replace'](/'/g,'\x5c\x27')};_0x486249['send'](ejs[_0x070e('0x10a')](Mustache[_0x070e('0x10a')](_0x2d597c,_0x36ad23),{'proactiveActions':_0x1dbff0,'alignment':_0x4e4996[_0x070e('0x10b')],'verticalAlignment':_0x4e4996[_0x070e('0x10c')],'div_color':_0x4e4996['color'],'labelText':_0x4e4996[_0x070e('0x10d')],'text_color':_0x4e4996[_0x070e('0x10e')],'text_button_color':_0x4e4996[_0x070e('0x10f')],'button_color':_0x4e4996[_0x070e('0x110')],'background_color':_0x4e4996[_0x070e('0x111')],'hideWhenOffline':_0x4e4996[_0x070e('0x112')],'intervalId':_0x4e4996['IntervalId'],'isDevelopment':_0x47e50f,'chatVersion':_0x589b76}));})[_0x070e('0x1b')](handleError(_0x486249,null));};exports['addApplications']=function(_0x260eb9,_0x835606){var _0x20612b=_0x260eb9[_0x070e('0x45')]['id'];var _0x2290e8=_0x260eb9[_0x070e('0x51')];var _0x22cca8=0xc8;var _0x560176=null;return db[_0x070e('0xd3')][_0x070e('0xd4')]({'isolationLevel':db[_0x070e('0xd3')][_0x070e('0x113')][_0x070e('0x114')][_0x070e('0x115')]},function(_0x405d9f){return db[_0x070e('0x2f')][_0x070e('0x5e')]({'where':{'id':_0x20612b},'transaction':_0x405d9f})[_0x070e('0x27')](function(_0x14c924){if(_0x14c924){return db[_0x070e('0x8d')][_0x070e('0x28')]({'where':{'ChatWebsiteId':_0x20612b},'transaction':_0x405d9f})[_0x070e('0x27')](function(){var _0x4c9226=_[_0x070e('0x2e')](_0x2290e8,function(_0x234fe6){_0x234fe6['ChatWebsiteId']=_0x20612b;return _0x234fe6;});return db[_0x070e('0x8d')][_0x070e('0x116')](_0x4c9226,{'transaction':_0x405d9f});});}else{_0x22cca8=0x194;_0x560176=[];}});})[_0x070e('0x27')](function(){if(_0x22cca8!==0x194){return db[_0x070e('0x8d')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x20612b},'order':_0x070e('0x92')})[_0x070e('0x27')](function(_0x4c9334){_0x560176=_0x4c9334;});}})[_0x070e('0x1b')](function(_0x606970){_0x22cca8=0x1f4;logger[_0x070e('0x17')](_0x606970[_0x070e('0x29')]);if(_0x606970[_0x070e('0x2a')]){delete _0x606970['name'];}_0x560176=_0x606970;})[_0x070e('0x117')](function(){if(_0x560176===null){_0x835606[_0x070e('0x1c')](_0x22cca8);}else{if(_0x22cca8===0x1f4){_0x835606[_0x070e('0x1d')](_0x22cca8)[_0x070e('0xbf')](_0x560176);}else{_0x835606['status'](_0x22cca8)[_0x070e('0x25')](_0x560176);}}});};exports[_0x070e('0x118')]=function(_0x3d0462,_0x50267c){var _0x2855c9={};var _0x4292f0={};var _0x5448ef;var _0x3a684d;return db[_0x070e('0x2f')][_0x070e('0x5e')]({'where':{'id':_0x3d0462[_0x070e('0x45')]['id']}})['then'](handleEntityNotFound(_0x50267c,null))[_0x070e('0x27')](function(_0x5e1a7a){if(_0x5e1a7a){_0x5448ef=_0x5e1a7a;_0x4292f0[_0x070e('0x32')]=_[_0x070e('0x33')](db[_0x070e('0x8d')]['rawAttributes']);_0x4292f0['query']=_['keys'](_0x3d0462[_0x070e('0x34')]);_0x4292f0[_0x070e('0x35')]=_['intersection'](_0x4292f0[_0x070e('0x32')],_0x4292f0[_0x070e('0x34')]);_0x2855c9[_0x070e('0x36')]=_[_0x070e('0x47')](_0x4292f0[_0x070e('0x32')],qs[_0x070e('0x37')](_0x3d0462[_0x070e('0x34')]['fields']));_0x2855c9[_0x070e('0x36')]=_0x2855c9['attributes'][_0x070e('0x38')]?_0x2855c9[_0x070e('0x36')]:_0x4292f0[_0x070e('0x32')];_0x2855c9[_0x070e('0x3a')]=qs['sort'](_0x3d0462[_0x070e('0x34')][_0x070e('0x3b')]);_0x2855c9[_0x070e('0x3d')]=qs['filters'](_[_0x070e('0x56')](_0x3d0462['query'],_0x4292f0[_0x070e('0x35')]));if(_0x3d0462[_0x070e('0x34')][_0x070e('0x3c')]){_0x2855c9['where']=_[_0x070e('0x3f')](_0x2855c9[_0x070e('0x3d')],{'$or':_[_0x070e('0x2e')](_0x2855c9[_0x070e('0x36')],function(_0x45fa15){var _0x155c3d={};_0x155c3d[_0x45fa15]={'$like':'%'+_0x3d0462[_0x070e('0x34')][_0x070e('0x3c')]+'%'};return _0x155c3d;})});}_0x2855c9=_[_0x070e('0x3f')]({},_0x2855c9,_0x3d0462[_0x070e('0x40')]);return _0x5448ef[_0x070e('0x118')](_0x2855c9);}})['then'](function(_0x15fc52){if(_0x15fc52){_0x3a684d=_0x15fc52[_0x070e('0x38')];if(!_0x3d0462['query'][_0x070e('0xe9')](_0x070e('0x39'))){_0x2855c9[_0x070e('0x21')]=qs[_0x070e('0x21')](_0x3d0462[_0x070e('0x34')][_0x070e('0x21')]);_0x2855c9[_0x070e('0x1f')]=qs[_0x070e('0x1f')](_0x3d0462[_0x070e('0x34')]['offset']);}return _0x5448ef[_0x070e('0x118')](_0x2855c9);}})[_0x070e('0x27')](function(_0x3f459b){if(_0x3f459b){return _0x3f459b?{'count':_0x3a684d,'rows':_0x3f459b}:null;}})['then'](respondWithResult(_0x50267c,null))[_0x070e('0x1b')](handleError(_0x50267c,null));};exports[_0x070e('0x119')]=function(_0x2f5572,_0x42c8b3){return db[_0x070e('0x11a')][_0x070e('0x52')]({'where':{'id':_0x2f5572[_0x070e('0x45')]['id']}})['then'](handleEntityNotFound(_0x42c8b3,null))[_0x070e('0x27')](function(_0x673c7e){if(_0x673c7e){return _0x673c7e[_0x070e('0x119')](_0x2f5572[_0x070e('0x51')][_0x070e('0x5a')],_['omit'](_0x2f5572[_0x070e('0x51')],[_0x070e('0x5a'),'id'])||{});}})['then'](respondWithResult(_0x42c8b3,null))['catch'](handleError(_0x42c8b3,null));};exports['getProactiveActions']=function(_0x395bf7,_0x41b760){var _0x5906f5={};var _0x550c04={};var _0x205559;var _0x4878d8;return db[_0x070e('0x2f')][_0x070e('0x5e')]({'where':{'id':_0x395bf7[_0x070e('0x45')]['id']}})[_0x070e('0x27')](handleEntityNotFound(_0x41b760,null))[_0x070e('0x27')](function(_0x1d5c86){if(_0x1d5c86){_0x205559=_0x1d5c86;_0x550c04[_0x070e('0x32')]=_['keys'](db[_0x070e('0x11b')][_0x070e('0x46')]);_0x550c04[_0x070e('0x34')]=_[_0x070e('0x33')](_0x395bf7['query']);_0x550c04['filters']=_[_0x070e('0x47')](_0x550c04[_0x070e('0x32')],_0x550c04[_0x070e('0x34')]);_0x5906f5['attributes']=_[_0x070e('0x47')](_0x550c04[_0x070e('0x32')],qs[_0x070e('0x37')](_0x395bf7[_0x070e('0x34')]['fields']));_0x5906f5['attributes']=_0x5906f5[_0x070e('0x36')][_0x070e('0x38')]?_0x5906f5[_0x070e('0x36')]:_0x550c04[_0x070e('0x32')];_0x5906f5[_0x070e('0x3a')]=qs['sort'](_0x395bf7['query']['sort']);_0x5906f5[_0x070e('0x3d')]=qs[_0x070e('0x35')](_[_0x070e('0x56')](_0x395bf7[_0x070e('0x34')],_0x550c04['filters']));if(_0x395bf7[_0x070e('0x34')]['filter']){_0x5906f5['where']=_[_0x070e('0x3f')](_0x5906f5[_0x070e('0x3d')],{'$or':_['map'](_0x5906f5[_0x070e('0x36')],function(_0x1b6728){var _0x158670={};_0x158670[_0x1b6728]={'$like':'%'+_0x395bf7[_0x070e('0x34')][_0x070e('0x3c')]+'%'};return _0x158670;})});}_0x5906f5=_[_0x070e('0x3f')]({},_0x5906f5,_0x395bf7['options']);return _0x205559[_0x070e('0x11c')](_0x5906f5);}})[_0x070e('0x27')](function(_0x408b87){if(_0x408b87){_0x4878d8=_0x408b87['length'];if(!_0x395bf7[_0x070e('0x34')][_0x070e('0xe9')](_0x070e('0x39'))){_0x5906f5['limit']=qs[_0x070e('0x21')](_0x395bf7[_0x070e('0x34')][_0x070e('0x21')]);_0x5906f5[_0x070e('0x1f')]=qs[_0x070e('0x1f')](_0x395bf7[_0x070e('0x34')][_0x070e('0x1f')]);}return _0x205559[_0x070e('0x11c')](_0x5906f5);}})[_0x070e('0x27')](function(_0x39497c){if(_0x39497c){return _0x39497c?{'count':_0x4878d8,'rows':_0x39497c}:null;}})[_0x070e('0x27')](respondWithResult(_0x41b760,null))['catch'](handleError(_0x41b760,null));};exports[_0x070e('0x11d')]=function(_0x1e0b95,_0x460933){var _0x9fa764=_0x1e0b95['query'][_0x070e('0x11e')]===_0x070e('0x11f')?'offlineForm':_0x070e('0x120');return db[_0x070e('0x2f')]['find']({'attributes':['id',_0x9fa764],'where':{'id':_0x1e0b95[_0x070e('0x45')]['id']}})['then'](handleEntityNotFound(_0x460933,null))[_0x070e('0x27')](function(_0x5a7692){if(_0x5a7692){var _0x5b85be=_0x5a7692[_0x9fa764];var _0x3877b3=_0x5b85be&&_0x5b85be['items']?_0x5b85be[_0x070e('0x121')]:[];_0x460933[_0x070e('0xbf')]({'fromKey':_[_0x070e('0x6e')](_0x5b85be[_0x070e('0x122')])?undefined:_0x5b85be[_0x070e('0x122')],'count':_0x3877b3[_0x070e('0x38')],'rows':_0x3877b3});}})['catch'](handleError(_0x460933,null));};exports['getOfflineMessages']=function(_0x50f8c4,_0x4b1e3a){var _0x349339={'raw':![],'where':{}};var _0x54ffda={};var _0x295e24={'count':0x0,'rows':[]};return db[_0x070e('0x2f')][_0x070e('0x5e')]({'where':{'id':_0x50f8c4[_0x070e('0x45')]['id']}})[_0x070e('0x27')](handleEntityNotFound(_0x4b1e3a,null))[_0x070e('0x27')](function(_0x5d7cbf){if(_0x5d7cbf){_0x54ffda[_0x070e('0x32')]=_[_0x070e('0x33')](db[_0x070e('0xcb')][_0x070e('0x46')]);_0x54ffda[_0x070e('0x34')]=_[_0x070e('0x33')](_0x50f8c4['query']);_0x54ffda[_0x070e('0x35')]=_[_0x070e('0x47')](_0x54ffda[_0x070e('0x32')],_0x54ffda['query']);_0x349339[_0x070e('0x36')]=_[_0x070e('0x47')](_0x54ffda[_0x070e('0x32')],qs[_0x070e('0x37')](_0x50f8c4[_0x070e('0x34')][_0x070e('0x37')]));_0x349339[_0x070e('0x36')]=_0x349339[_0x070e('0x36')][_0x070e('0x38')]?_0x349339[_0x070e('0x36')]:_0x54ffda[_0x070e('0x32')];if(!_0x50f8c4[_0x070e('0x34')][_0x070e('0xe9')](_0x070e('0x39'))){_0x349339[_0x070e('0x21')]=qs[_0x070e('0x21')](_0x50f8c4[_0x070e('0x34')][_0x070e('0x21')]);_0x349339[_0x070e('0x1f')]=qs[_0x070e('0x1f')](_0x50f8c4['query'][_0x070e('0x1f')]);}_0x349339['order']=qs['sort'](_0x50f8c4[_0x070e('0x34')]['sort']);_0x349339[_0x070e('0x3d')]=qs[_0x070e('0x35')](_[_0x070e('0x56')](_0x50f8c4[_0x070e('0x34')],_0x54ffda[_0x070e('0x35')]));_0x349339[_0x070e('0x3d')][_0x070e('0x55')]=_0x5d7cbf['id'];if(_0x50f8c4[_0x070e('0x34')][_0x070e('0x3c')]){_0x349339[_0x070e('0x3d')]=_['merge'](_0x349339[_0x070e('0x3d')],{'$or':_[_0x070e('0x2e')](_0x349339[_0x070e('0x36')],function(_0x24cc9e){var _0x340df0={};_0x340df0[_0x24cc9e]={'$like':'%'+_0x50f8c4['query'][_0x070e('0x3c')]+'%'};return _0x340df0;})});}_0x349339=_[_0x070e('0x3f')]({},_0x349339,_0x50f8c4[_0x070e('0x40')]);return db[_0x070e('0xcb')]['count']({'where':_0x349339[_0x070e('0x3d')]})[_0x070e('0x27')](function(_0x5c0fa5){_0x295e24[_0x070e('0x22')]=_0x5c0fa5;if(_0x50f8c4[_0x070e('0x34')][_0x070e('0x41')]){_0x349339[_0x070e('0x42')]=[{'all':!![]}];}else{_0x349339['include']=[{'model':db[_0x070e('0x7e')],'as':_0x070e('0x123'),'required':![]},{'model':db[_0x070e('0xd5')],'as':'Attachments','required':![]}];}return db[_0x070e('0xcb')]['findAll'](_0x349339);})[_0x070e('0x27')](function(_0xc4a364){_0x295e24['rows']=_0xc4a364;return _0x295e24;});}})[_0x070e('0x27')](respondWithFilteredResult(_0x4b1e3a,_0x349339))[_0x070e('0x1b')](handleError(_0x4b1e3a,null));};exports[_0x070e('0x124')]=function(_0x553cf8,_0x353041){return db[_0x070e('0x2f')][_0x070e('0x52')]({'where':{'id':_0x553cf8['params']['id']}})['then'](handleEntityNotFound(_0x353041,null))[_0x070e('0x27')](function(_0x22932b){if(_0x22932b){return _0x22932b[_0x070e('0x124')](_0x553cf8['body']['ids'],_[_0x070e('0xe8')](_0x553cf8['body'],['ids','id'])||{})[_0x070e('0xa9')](function(_0xeb1314){for(var _0x42414c=0x0;_0x42414c<_0x553cf8[_0x070e('0x51')]['ids']['length'];_0x42414c+=0x1){socket[_0x070e('0x125')](_0x070e('0x126'),{'UserId':Number(_0x553cf8[_0x070e('0x51')][_0x070e('0x5a')][_0x42414c]),'ChatWebsiteId':Number(_0x553cf8[_0x070e('0x45')]['id'])});}return _0xeb1314;});}})['then'](respondWithResult(_0x353041,null))[_0x070e('0x1b')](handleError(_0x353041,null));};exports[_0x070e('0x127')]=function(_0x1a2d80,_0x50c3a9){return db[_0x070e('0x2f')]['find']({'where':{'id':_0x1a2d80[_0x070e('0x45')]['id']}})[_0x070e('0x27')](handleEntityNotFound(_0x50c3a9,null))[_0x070e('0x27')](function(_0x5274f){if(_0x5274f){return _0x5274f[_0x070e('0x127')](_0x1a2d80['query']['ids'])[_0x070e('0x27')](function(){if(_[_0x070e('0x128')](_0x1a2d80[_0x070e('0x34')]['ids'])){for(var _0x5c5fcb=0x0;_0x5c5fcb<_0x1a2d80[_0x070e('0x34')][_0x070e('0x5a')][_0x070e('0x38')];_0x5c5fcb+=0x1){socket[_0x070e('0x125')](_0x070e('0x129'),{'UserId':Number(_0x1a2d80[_0x070e('0x34')][_0x070e('0x5a')][_0x5c5fcb]),'ChatWebsiteId':Number(_0x1a2d80[_0x070e('0x45')]['id'])});}}else{socket[_0x070e('0x125')](_0x070e('0x129'),{'UserId':Number(_0x1a2d80[_0x070e('0x34')][_0x070e('0x5a')]),'ChatWebsiteId':Number(_0x1a2d80[_0x070e('0x45')]['id'])});}});}})[_0x070e('0x27')](respondWithStatusCode(_0x50c3a9,null))[_0x070e('0x1b')](handleError(_0x50c3a9,null));};exports['getAgents']=function(_0x15277b,_0x31db5c){var _0x2f20d9={};var _0x5268e9={};var _0x51836a;var _0x4dd9cb;return db['ChatWebsite'][_0x070e('0x5e')]({'where':{'id':_0x15277b[_0x070e('0x45')]['id']}})[_0x070e('0x27')](handleEntityNotFound(_0x31db5c,null))[_0x070e('0x27')](function(_0xd10a6e){if(_0xd10a6e){_0x51836a=_0xd10a6e;_0x5268e9[_0x070e('0x32')]=_[_0x070e('0x33')](db[_0x070e('0xb2')][_0x070e('0x46')]);_0x5268e9['query']=_['keys'](_0x15277b['query']);_0x5268e9['filters']=_[_0x070e('0x47')](_0x5268e9['model'],_0x5268e9[_0x070e('0x34')]);_0x2f20d9[_0x070e('0x36')]=_[_0x070e('0x47')](_0x5268e9[_0x070e('0x32')],qs[_0x070e('0x37')](_0x15277b[_0x070e('0x34')][_0x070e('0x37')]));_0x2f20d9[_0x070e('0x36')]=_0x2f20d9['attributes'][_0x070e('0x38')]?_0x2f20d9[_0x070e('0x36')]:_0x5268e9[_0x070e('0x32')];_0x2f20d9[_0x070e('0x3a')]=qs[_0x070e('0x3b')](_0x15277b[_0x070e('0x34')][_0x070e('0x3b')]);_0x2f20d9[_0x070e('0x3d')]=qs[_0x070e('0x35')](_[_0x070e('0x56')](_0x15277b[_0x070e('0x34')],_0x5268e9['filters']));if(_0x15277b[_0x070e('0x34')][_0x070e('0x3c')]){_0x2f20d9['where']=_[_0x070e('0x3f')](_0x2f20d9['where'],{'$or':_['map'](_0x2f20d9[_0x070e('0x36')],function(_0x4c9db4){var _0x28456b={};_0x28456b[_0x4c9db4]={'$like':'%'+_0x15277b[_0x070e('0x34')][_0x070e('0x3c')]+'%'};return _0x28456b;})});}_0x2f20d9=_['merge']({},_0x2f20d9,_0x15277b[_0x070e('0x40')]);return _0x51836a['getAgents'](_0x2f20d9);}})[_0x070e('0x27')](function(_0x5c04b8){if(_0x5c04b8){_0x4dd9cb=_0x5c04b8[_0x070e('0x38')];if(!_0x15277b[_0x070e('0x34')][_0x070e('0xe9')]('nolimit')){_0x2f20d9['limit']=qs[_0x070e('0x21')](_0x15277b[_0x070e('0x34')][_0x070e('0x21')]);_0x2f20d9[_0x070e('0x1f')]=qs['offset'](_0x15277b[_0x070e('0x34')][_0x070e('0x1f')]);}return _0x51836a[_0x070e('0x12a')](_0x2f20d9);}})[_0x070e('0x27')](function(_0x326961){if(_0x326961){return _0x326961?{'count':_0x4dd9cb,'rows':_0x326961}:null;}})[_0x070e('0x27')](respondWithResult(_0x31db5c,null))['catch'](handleError(_0x31db5c,null));}; \ No newline at end of file +var _0x5cc1=['server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','chat','CmContact','Sequelize','ValidationError','difference','updatedAt','createdAt','CompanyId','ListId','from','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','List','Contacts','ChatApplication','Applications','spread','list','priority','asc','account','contact','headers','threadId','ChatInteraction','externalUrl','ContactId','interaction','messageId','created','autoclose','applications','push','close','unmanaged','AttachmentId','UserId','unshift','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','queueId','ChatQueue','queue','waitForTheAssignedQueue','EventManager','no\x20available\x20attributes','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','MailAccount','findOrCreate','readFileSync','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','mimetype','files','attachments','offline-chat','basename','openNewInteraction','sequelize','transaction','bulkCreate','MailServerOut','Smtp','CloudProvider','forwardOfflineAddress','getSmtpOptions','sendMail','email','MailAccountId','originalname','toPairsIn','mapValues','lastName','offlineMessageSubject','NotifyMailAccount','notifyMail','server','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','hasOwnProperty','Contact','User','Owner','fullname','Tag','Tags','tag','getProactiveActions','License','increment','chatLicenseExceeded','server/files/chat/iframe.ejs','utf8','URL','address','origin','3.5.0','remote','x-real-ip','connection','remoteAddress','referer','replace','render','alignment','color','labelText','textColor','textButtonColor','color_button','IntervalId','addApplications','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','getApplications','addProactiveActions','getFields','online','offlineForm','onlineForm','items','Attachment','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','path','fs-extra','lodash','querystring','ioredis','jayson/promise','../../config/logger','api','../../config/environment','../../errors/api','APIOutOfIntervalError','APINotFoundError','../../mysqldb','defaults','redis','localhost','./chatWebsite.socket','register','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','debug','request\x20sent','stringify','code','error','message','result','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','update','destroy','ChatWebsites','UserProfileResource','stack','name','send','getSnippet','format','iftime\x20%s,%s','interval','timezone','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','map','Interval','Intervals','get','all','some','user-agent-parser','setUA','user-agent','getResult','customerIp','x-forwarded-for','first','split','firstName','x-real-port','browser','version','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','model','index','mandatoryDispositionPause','ChatWebsite','fieldName','type','key','query','keys','filters','intersection','fields','attributes','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','Pause','rawAttributes','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','params','body','describe','addDisposition','ChatWebsiteId','getDispositions','findOne','order','Disposition','removeDispositions','ids','getAnswers','CannedAnswer','sitepic','addAvatar','agentAvatar','file','customerAvatar','filename','addSystemAvatar','systemAvatar','getLogo','root','../../config/license/util','getLicense','custom','isNil','existsSync','server/files/images/logos/','join','download','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0x5cc1,0x1c1));var _0x15cc=function(_0x5f026e,_0x224df5){_0x5f026e=_0x5f026e-0x0;var _0x2f74a1=_0x5cc1[_0x5f026e];return _0x2f74a1;};'use strict';var Mustache=require('mustache');var util=require('util');var path=require(_0x15cc('0x0'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x15cc('0x1'));var _=require(_0x15cc('0x2'));var querystring=require(_0x15cc('0x3'));var htmlToText=require('html-to-text');var Redis=require(_0x15cc('0x4'));var jayson=require(_0x15cc('0x5'));var url=require('url');var qs=require('../../components/parsers/qs');var logger=require(_0x15cc('0x6'))(_0x15cc('0x7'));var config=require(_0x15cc('0x8'));var APIOutOfIntervalError=require(_0x15cc('0x9'))[_0x15cc('0xa')];var APINotFoundError=require(_0x15cc('0x9'))[_0x15cc('0xb')];var APIHandleError=require(_0x15cc('0x9'))['handleError'];var db=require(_0x15cc('0xc'))['db'];config['redis']=_[_0x15cc('0xd')](config[_0x15cc('0xe')],{'host':_0x15cc('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x15cc('0x10'))[_0x15cc('0x11')](socket);var client=jayson[_0x15cc('0x12')]['http']({'port':0x232c});var client9002=jayson[_0x15cc('0x12')][_0x15cc('0x13')]({'port':0x232a});var client9003=jayson[_0x15cc('0x12')]['http']({'port':0x232b});var client9001=jayson['client'][_0x15cc('0x13')]({'port':0x2329});function respondWithRpcPromise(_0x155800,_0x59f052,_0x236f46,_0x1f6704){return new Promise(function(_0x5e0767,_0x18687d){var _0x293f23=_0x1f6704||client;return _0x293f23[_0x15cc('0x14')](_0x155800,_0x236f46)[_0x15cc('0x15')](function(_0x1e1c79){logger[_0x15cc('0x16')](_0x15cc('0x17'),_0x59f052,'request\x20sent');logger[_0x15cc('0x18')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x59f052,_0x15cc('0x19'),JSON[_0x15cc('0x1a')](_0x1e1c79));if(_0x1e1c79['error']){if(_0x1e1c79['error'][_0x15cc('0x1b')]===0x1f4){logger[_0x15cc('0x1c')](_0x15cc('0x17'),_0x59f052,_0x1e1c79[_0x15cc('0x1c')][_0x15cc('0x1d')]);return _0x18687d(_0x1e1c79[_0x15cc('0x1c')][_0x15cc('0x1d')]);}logger[_0x15cc('0x1c')]('ChatWebsite,\x20%s,\x20%s',_0x59f052,_0x1e1c79[_0x15cc('0x1c')][_0x15cc('0x1d')]);return _0x5e0767(_0x1e1c79['error'][_0x15cc('0x1d')]);}else{logger['info'](_0x15cc('0x17'),_0x59f052,_0x15cc('0x19'));_0x5e0767(_0x1e1c79[_0x15cc('0x1e')][_0x15cc('0x1d')]);}})['catch'](function(_0xbf12c3){logger['error'](_0x15cc('0x17'),_0x59f052,_0xbf12c3);_0x18687d(_0xbf12c3);});});}function respondWithStatusCode(_0x593c5f,_0x1b24e4){_0x1b24e4=_0x1b24e4||0xcc;return function(_0x2b6b18){if(_0x2b6b18){return _0x593c5f[_0x15cc('0x1f')](_0x1b24e4);}return _0x593c5f[_0x15cc('0x20')](_0x1b24e4)[_0x15cc('0x21')]();};}function respondWithResult(_0x56eb5b,_0x19a27e){_0x19a27e=_0x19a27e||0xc8;return function(_0x1d12af){if(_0x1d12af){return _0x56eb5b['status'](_0x19a27e)[_0x15cc('0x22')](_0x1d12af);}};}function respondWithFilteredResult(_0x4d66b0,_0x46b6e6){return function(_0x42b00e){if(_0x42b00e){var _0x131bc2=typeof _0x46b6e6[_0x15cc('0x23')]==='undefined'&&typeof _0x46b6e6[_0x15cc('0x24')]===_0x15cc('0x25');var _0x31f8b1=_0x42b00e[_0x15cc('0x26')];var _0xc41dc0=_0x131bc2?0x0:_0x46b6e6[_0x15cc('0x23')];var _0x730b6a=_0x131bc2?_0x42b00e['count']:_0x46b6e6[_0x15cc('0x23')]+_0x46b6e6[_0x15cc('0x24')];var _0x2502bf;if(_0x730b6a>=_0x31f8b1){_0x730b6a=_0x31f8b1;_0x2502bf=0xc8;}else{_0x2502bf=0xce;}_0x4d66b0[_0x15cc('0x20')](_0x2502bf);return _0x4d66b0[_0x15cc('0x27')](_0x15cc('0x28'),_0xc41dc0+'-'+_0x730b6a+'/'+_0x31f8b1)[_0x15cc('0x22')](_0x42b00e);}return null;};}function saveUpdates(_0x5a6bec){return function(_0x4e70d7){if(_0x4e70d7){return _0x4e70d7[_0x15cc('0x29')](_0x5a6bec)[_0x15cc('0x15')](function(_0x3af015){return _0x3af015;});}return null;};}function removeEntity(_0x3d6c22){return function(_0x17f002){if(_0x17f002){return _0x17f002[_0x15cc('0x2a')]()['then'](function(){var _0x32ac02=_0x17f002['get']({'plain':!![]});var _0x2f9511=_0x15cc('0x2b');return db[_0x15cc('0x2c')][_0x15cc('0x2a')]({'where':{'type':_0x2f9511,'resourceId':_0x32ac02['id']}})[_0x15cc('0x15')](function(){return _0x17f002;});})[_0x15cc('0x15')](function(){_0x3d6c22['status'](0xcc)[_0x15cc('0x21')]();});}};}function handleEntityNotFound(_0x1dcb1f){return function(_0x2815e3){if(!_0x2815e3){_0x1dcb1f[_0x15cc('0x1f')](0x194);}return _0x2815e3;};}function handleError(_0x31994a,_0x3d94b0){_0x3d94b0=_0x3d94b0||0x1f4;return function(_0x1c865e){logger[_0x15cc('0x1c')](_0x1c865e[_0x15cc('0x2d')]);if(_0x1c865e[_0x15cc('0x2e')]){delete _0x1c865e[_0x15cc('0x2e')];}_0x31994a[_0x15cc('0x20')](_0x3d94b0)[_0x15cc('0x2f')](_0x1c865e);};}function iftimePromise(_0x43e528,_0x4a4400){return respondWithRpcPromise('Command',_0x15cc('0x30'),{'command':_0x4a4400['timezone']?util[_0x15cc('0x31')](_0x15cc('0x32'),_0x43e528[_0x15cc('0x33')],_0x4a4400[_0x15cc('0x34')]):util[_0x15cc('0x31')]('iftime\x20%s',_0x43e528[_0x15cc('0x33')])},client9002)['then'](function(_0xb9ac88){var _0x481e68=_0xb9ac88&&_0xb9ac88[_0x15cc('0x35')](_0x15cc('0x36'))>=0x0?!![]:![];logger[_0x15cc('0x16')](_0x15cc('0x37'),_0x4a4400['id'],_0x43e528['id'],_0x43e528[_0x15cc('0x33')],_0x481e68?_0x15cc('0x38'):_0x15cc('0x39'),_0x4a4400[_0x15cc('0x34')]?_0x4a4400[_0x15cc('0x34')]:_0x15cc('0x3a'));return _0x481e68;})['catch'](function(_0x188bbf){logger[_0x15cc('0x1c')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x4a4400['id'],_0x43e528['id'],_0x43e528[_0x15cc('0x33')],util[_0x15cc('0x3b')](_0x188bbf,{'showHidden':![],'depth':null}),_0x4a4400[_0x15cc('0x34')]?_0x4a4400[_0x15cc('0x34')]:_0x15cc('0x3a'));return![];});}function checkWebsiteIntervals(_0x405dcf){var _0x18374d=_[_0x15cc('0x3c')](_0x405dcf[_0x15cc('0x3d')][_0x15cc('0x3e')],function(_0x45510d){var _0x1ca62b=_0x45510d[_0x15cc('0x3f')]({'plain':!![]});return iftimePromise(_0x1ca62b,_0x405dcf);});return Promise[_0x15cc('0x40')](_0x18374d)[_0x15cc('0x15')](function(_0x312acb){return _[_0x15cc('0x41')](_0x312acb);});}function createInteractionObject(_0x420bdc,_0xa6fb49,_0x5310dd,_0x33e79b){var _0x28ab58=require(_0x15cc('0x42'));var _0x110acb=new _0x28ab58();var _0x1aae42=_0x110acb[_0x15cc('0x43')](_0x5310dd[_0x15cc('0x44')])[_0x15cc('0x45')]();var _0x13bbef=_0xa6fb49[_0x15cc('0x46')];if(_0x5310dd['cf-connecting-ip']){_0x13bbef=_0x5310dd['cf-connecting-ip'];}else if(_0x5310dd[_0x15cc('0x47')]){_0x13bbef=_[_0x15cc('0x48')](_0x5310dd[_0x15cc('0x47')][_0x15cc('0x49')](','));}return{'ContactId':_0x33e79b['id'],'ChatWebsiteId':_0x420bdc,'from':(_0x33e79b[_0x15cc('0x4a')]||'')+'\x20'+(_0x33e79b['lastName']||''),'customerIp':_0x13bbef,'customerPort':_0x5310dd[_0x15cc('0x4b')]?_0x5310dd['x-real-port']:null,'referer':_0xa6fb49['referer'],'browserName':_0x1aae42[_0x15cc('0x4c')][_0x15cc('0x2e')]&&_0x1aae42[_0x15cc('0x4c')][_0x15cc('0x4d')]?util[_0x15cc('0x31')](_0x15cc('0x4e'),_0x1aae42[_0x15cc('0x4c')][_0x15cc('0x2e')],_0x1aae42[_0x15cc('0x4c')][_0x15cc('0x4d')]):_0x15cc('0x4f'),'browserVersion':_0x1aae42[_0x15cc('0x4c')]['version']||_0x15cc('0x4f'),'osName':util[_0x15cc('0x31')](_0x15cc('0x4e'),_0x1aae42['os'][_0x15cc('0x2e')],_0x1aae42['os'][_0x15cc('0x4d')]),'osVersion':_0x1aae42['os'][_0x15cc('0x4d')],'deviceModel':_0x1aae42[_0x15cc('0x50')]['model']&&_0x1aae42[_0x15cc('0x50')][_0x15cc('0x51')]?util[_0x15cc('0x31')](_0x15cc('0x52'),_0x1aae42[_0x15cc('0x50')][_0x15cc('0x53')],_0x1aae42['device'][_0x15cc('0x51')],_0x1aae42[_0x15cc('0x50')]['type']):null,'deviceVendor':_0x1aae42['device']['vendor'],'deviceType':_0x1aae42[_0x15cc('0x50')]['type'],'formData':JSON[_0x15cc('0x1a')](_0xa6fb49)};}exports[_0x15cc('0x54')]=function(_0x1da8aa,_0x3f262b){var _0x139909={'include':[{'model':db['Pause'],'as':_0x15cc('0x55')}]},_0x4b7ed7={},_0x1088d7={'count':0x0,'rows':[]};var _0x264cd2=_[_0x15cc('0x3c')](db[_0x15cc('0x56')]['rawAttributes'],function(_0x36541b){return{'name':_0x36541b[_0x15cc('0x57')],'type':_0x36541b[_0x15cc('0x58')][_0x15cc('0x59')]};});_0x4b7ed7[_0x15cc('0x53')]=_[_0x15cc('0x3c')](_0x264cd2,_0x15cc('0x2e'));_0x4b7ed7[_0x15cc('0x5a')]=_[_0x15cc('0x5b')](_0x1da8aa[_0x15cc('0x5a')]);_0x4b7ed7[_0x15cc('0x5c')]=_[_0x15cc('0x5d')](_0x4b7ed7['model'],_0x4b7ed7['query']);_0x139909['attributes']=_[_0x15cc('0x5d')](_0x4b7ed7['model'],qs['fields'](_0x1da8aa['query'][_0x15cc('0x5e')]));_0x139909[_0x15cc('0x5f')]=_0x139909[_0x15cc('0x5f')][_0x15cc('0x60')]?_0x139909['attributes']:_0x4b7ed7['model'];if(!_0x1da8aa[_0x15cc('0x5a')]['hasOwnProperty'](_0x15cc('0x61'))){_0x139909[_0x15cc('0x24')]=qs['limit'](_0x1da8aa['query']['limit']);_0x139909[_0x15cc('0x23')]=qs['offset'](_0x1da8aa[_0x15cc('0x5a')][_0x15cc('0x23')]);}_0x139909['order']=qs[_0x15cc('0x62')](_0x1da8aa[_0x15cc('0x5a')][_0x15cc('0x62')]);_0x139909[_0x15cc('0x63')]=qs['filters'](_[_0x15cc('0x64')](_0x1da8aa[_0x15cc('0x5a')],_0x4b7ed7['filters']),_0x264cd2);if(_0x1da8aa[_0x15cc('0x5a')][_0x15cc('0x65')]){_0x139909[_0x15cc('0x63')]=_[_0x15cc('0x66')](_0x139909['where'],{'$or':_['map'](_0x264cd2,function(_0x440396){if(_0x440396[_0x15cc('0x58')]!==_0x15cc('0x67')){var _0x578a2e={};_0x578a2e[_0x440396['name']]={'$like':'%'+_0x1da8aa['query'][_0x15cc('0x65')]+'%'};return _0x578a2e;}})});}_0x139909=_[_0x15cc('0x66')]({},_0x139909,_0x1da8aa[_0x15cc('0x68')]);var _0x17814d={'where':_0x139909[_0x15cc('0x63')]};return db[_0x15cc('0x56')][_0x15cc('0x26')](_0x17814d)[_0x15cc('0x15')](function(_0x413e9f){_0x1088d7[_0x15cc('0x26')]=_0x413e9f;if(_0x1da8aa[_0x15cc('0x5a')][_0x15cc('0x69')]){_0x139909[_0x15cc('0x6a')]=[{'all':!![]}];}return db[_0x15cc('0x56')][_0x15cc('0x6b')](_0x139909);})[_0x15cc('0x15')](function(_0x41aed7){_0x1088d7[_0x15cc('0x6c')]=_0x41aed7;return _0x1088d7;})[_0x15cc('0x15')](respondWithFilteredResult(_0x3f262b,_0x139909))[_0x15cc('0x6d')](handleError(_0x3f262b,null));};exports[_0x15cc('0x6e')]=function(_0x54690c,_0x353eff){var _0x55ca97={'raw':![],'where':{'id':_0x54690c['params']['id']},'include':[{'model':db[_0x15cc('0x6f')],'as':'mandatoryDispositionPause'}]},_0x568579={};_0x568579[_0x15cc('0x53')]=_['keys'](db[_0x15cc('0x56')][_0x15cc('0x70')]);_0x568579[_0x15cc('0x5a')]=_[_0x15cc('0x5b')](_0x54690c[_0x15cc('0x5a')]);_0x568579[_0x15cc('0x5c')]=_[_0x15cc('0x5d')](_0x568579[_0x15cc('0x53')],_0x568579[_0x15cc('0x5a')]);_0x55ca97['attributes']=_[_0x15cc('0x5d')](_0x568579[_0x15cc('0x53')],qs[_0x15cc('0x5e')](_0x54690c[_0x15cc('0x5a')][_0x15cc('0x5e')]));_0x55ca97['attributes']=_0x55ca97[_0x15cc('0x5f')]['length']?_0x55ca97[_0x15cc('0x5f')]:_0x568579['model'];if(_0x54690c[_0x15cc('0x5a')][_0x15cc('0x69')]){_0x55ca97[_0x15cc('0x6a')]=[{'all':!![]}];}_0x55ca97=_['merge']({},_0x55ca97,_0x54690c['options']);return db[_0x15cc('0x56')]['find'](_0x55ca97)['then'](handleEntityNotFound(_0x353eff,null))['then'](respondWithResult(_0x353eff,null))[_0x15cc('0x6d')](handleError(_0x353eff,null));};exports[_0x15cc('0x71')]=function(_0x4212b4,_0x1b1ef5){return db[_0x15cc('0x56')][_0x15cc('0x71')](_0x4212b4['body'],{})[_0x15cc('0x15')](function(_0xa91862){var _0x52f52f=_0x4212b4[_0x15cc('0x72')][_0x15cc('0x3f')]({'plain':!![]});if(!_0x52f52f)throw new Error(_0x15cc('0x73'));if(_0x52f52f[_0x15cc('0x74')]==='user'){var _0x4b5005=_0xa91862[_0x15cc('0x3f')]({'plain':!![]});var _0x5ca81b='ChatWebsites';return db[_0x15cc('0x75')][_0x15cc('0x76')]({'where':{'name':_0x5ca81b,'userProfileId':_0x52f52f[_0x15cc('0x77')]},'raw':!![]})[_0x15cc('0x15')](function(_0x17bbb5){if(_0x17bbb5&&_0x17bbb5[_0x15cc('0x78')]===0x0){return db[_0x15cc('0x2c')][_0x15cc('0x71')]({'name':_0x4b5005[_0x15cc('0x2e')],'resourceId':_0x4b5005['id'],'type':_0x17bbb5['name'],'sectionId':_0x17bbb5['id']},{})['then'](function(){return _0xa91862;});}else{return _0xa91862;}})[_0x15cc('0x6d')](function(_0x3ed324){logger[_0x15cc('0x1c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3ed324);throw _0x3ed324;});}return _0xa91862;})['then'](respondWithResult(_0x1b1ef5,0xc9))[_0x15cc('0x6d')](handleError(_0x1b1ef5,null));};exports[_0x15cc('0x29')]=function(_0x1ec51a,_0x205c5c){if(_0x1ec51a['body']['id']){delete _0x1ec51a['body']['id'];}return db['ChatWebsite'][_0x15cc('0x76')]({'where':{'id':_0x1ec51a[_0x15cc('0x79')]['id']},'include':[{'model':db[_0x15cc('0x6f')],'as':_0x15cc('0x55')}]})[_0x15cc('0x15')](handleEntityNotFound(_0x205c5c,null))[_0x15cc('0x15')](saveUpdates(_0x1ec51a[_0x15cc('0x7a')],null))[_0x15cc('0x15')](respondWithResult(_0x205c5c,null))[_0x15cc('0x6d')](handleError(_0x205c5c,null));};exports[_0x15cc('0x2a')]=function(_0x9f61c,_0x11d21a){return db[_0x15cc('0x56')]['find']({'where':{'id':_0x9f61c['params']['id']}})[_0x15cc('0x15')](handleEntityNotFound(_0x11d21a,null))[_0x15cc('0x15')](removeEntity(_0x11d21a,null))[_0x15cc('0x6d')](handleError(_0x11d21a,null));};exports[_0x15cc('0x7b')]=function(_0xb337e4,_0x2ec7d2){return db[_0x15cc('0x56')][_0x15cc('0x7b')]()[_0x15cc('0x15')](respondWithResult(_0x2ec7d2,null))[_0x15cc('0x6d')](handleError(_0x2ec7d2,null));};exports[_0x15cc('0x7c')]=function(_0xd536ce,_0x590f53){if(_0xd536ce[_0x15cc('0x7a')]['id']){delete _0xd536ce[_0x15cc('0x7a')]['id'];}return db['ChatWebsite'][_0x15cc('0x76')]({'where':{'id':_0xd536ce[_0x15cc('0x79')]['id']}})[_0x15cc('0x15')](handleEntityNotFound(_0x590f53,null))[_0x15cc('0x15')](function(_0x19ab9c){if(_0x19ab9c){_0xd536ce[_0x15cc('0x7a')][_0x15cc('0x7d')]=_0x19ab9c['id'];return db['Disposition'][_0x15cc('0x71')](_0xd536ce[_0x15cc('0x7a')]);}})['then'](respondWithResult(_0x590f53,null))[_0x15cc('0x6d')](handleError(_0x590f53,null));};exports[_0x15cc('0x7e')]=function(_0x524cb6,_0x6c51bb){var _0x29407d={'raw':![],'where':{}};var _0x2dcd1c={};var _0x58f802={'count':0x0,'rows':[]};return db[_0x15cc('0x56')][_0x15cc('0x7f')]({'where':{'id':_0x524cb6[_0x15cc('0x79')]['id']}})[_0x15cc('0x15')](handleEntityNotFound(_0x6c51bb,null))[_0x15cc('0x15')](function(_0x17a3ee){if(_0x17a3ee){_0x2dcd1c['model']=_[_0x15cc('0x5b')](db['Disposition'][_0x15cc('0x70')]);_0x2dcd1c[_0x15cc('0x5a')]=_[_0x15cc('0x5b')](_0x524cb6['query']);_0x2dcd1c[_0x15cc('0x5c')]=_[_0x15cc('0x5d')](_0x2dcd1c[_0x15cc('0x53')],_0x2dcd1c[_0x15cc('0x5a')]);_0x29407d[_0x15cc('0x5f')]=_['intersection'](_0x2dcd1c[_0x15cc('0x53')],qs[_0x15cc('0x5e')](_0x524cb6[_0x15cc('0x5a')][_0x15cc('0x5e')]));_0x29407d['attributes']=_0x29407d[_0x15cc('0x5f')][_0x15cc('0x60')]?_0x29407d[_0x15cc('0x5f')]:_0x2dcd1c[_0x15cc('0x53')];if(!_0x524cb6['query']['hasOwnProperty']('nolimit')){_0x29407d[_0x15cc('0x24')]=qs['limit'](_0x524cb6['query'][_0x15cc('0x24')]);_0x29407d[_0x15cc('0x23')]=qs[_0x15cc('0x23')](_0x524cb6[_0x15cc('0x5a')]['offset']);}_0x29407d[_0x15cc('0x80')]=qs[_0x15cc('0x62')](_0x524cb6[_0x15cc('0x5a')][_0x15cc('0x62')]);_0x29407d[_0x15cc('0x63')]=qs[_0x15cc('0x5c')](_[_0x15cc('0x64')](_0x524cb6[_0x15cc('0x5a')],_0x2dcd1c[_0x15cc('0x5c')]));_0x29407d[_0x15cc('0x63')][_0x15cc('0x7d')]=_0x17a3ee['id'];if(_0x524cb6[_0x15cc('0x5a')]['filter']){_0x29407d[_0x15cc('0x63')]=_[_0x15cc('0x66')](_0x29407d['where'],{'$or':_['map'](_0x29407d[_0x15cc('0x5f')],function(_0x568ceb){var _0x92d298={};_0x92d298[_0x568ceb]={'$like':'%'+_0x524cb6['query']['filter']+'%'};return _0x92d298;})});}_0x29407d=_[_0x15cc('0x66')]({},_0x29407d,_0x524cb6[_0x15cc('0x68')]);return db[_0x15cc('0x81')][_0x15cc('0x26')]({'where':_0x29407d[_0x15cc('0x63')]})[_0x15cc('0x15')](function(_0x24f521){_0x58f802[_0x15cc('0x26')]=_0x24f521;if(_0x524cb6[_0x15cc('0x5a')][_0x15cc('0x69')]){_0x29407d[_0x15cc('0x6a')]=[{'all':!![]}];}return db[_0x15cc('0x81')]['findAll'](_0x29407d);})[_0x15cc('0x15')](function(_0x47ffe4){_0x58f802[_0x15cc('0x6c')]=_0x47ffe4;return _0x58f802;});}})[_0x15cc('0x15')](respondWithFilteredResult(_0x6c51bb,_0x29407d))[_0x15cc('0x6d')](handleError(_0x6c51bb,null));};exports['removeDispositions']=function(_0x1e6651,_0x2f2861){return db['ChatWebsite']['find']({'where':{'id':_0x1e6651[_0x15cc('0x79')]['id']}})['then'](handleEntityNotFound(_0x2f2861,null))[_0x15cc('0x15')](function(_0x3241e3){if(_0x3241e3){return _0x3241e3[_0x15cc('0x82')](_0x1e6651['query'][_0x15cc('0x83')]);}})[_0x15cc('0x15')](respondWithStatusCode(_0x2f2861,null))[_0x15cc('0x6d')](handleError(_0x2f2861,null));};exports['addAnswer']=function(_0x4957b2,_0x57b566){if(_0x4957b2[_0x15cc('0x7a')]['id']){delete _0x4957b2[_0x15cc('0x7a')]['id'];}return db[_0x15cc('0x56')][_0x15cc('0x76')]({'where':{'id':_0x4957b2[_0x15cc('0x79')]['id']}})['then'](handleEntityNotFound(_0x57b566,null))[_0x15cc('0x15')](function(_0x451861){if(_0x451861){_0x4957b2[_0x15cc('0x7a')][_0x15cc('0x7d')]=_0x451861['id'];return db['CannedAnswer'][_0x15cc('0x71')](_0x4957b2[_0x15cc('0x7a')]);}})[_0x15cc('0x15')](respondWithResult(_0x57b566,null))[_0x15cc('0x6d')](handleError(_0x57b566,null));};exports[_0x15cc('0x84')]=function(_0x1ca630,_0x26b8ca){var _0x56a307={'raw':![],'where':{}};var _0x2f9b2a={};var _0x2b1e51={'count':0x0,'rows':[]};return db[_0x15cc('0x56')]['findOne']({'where':{'id':_0x1ca630[_0x15cc('0x79')]['id']}})[_0x15cc('0x15')](handleEntityNotFound(_0x26b8ca,null))[_0x15cc('0x15')](function(_0x49619f){if(_0x49619f){_0x2f9b2a[_0x15cc('0x53')]=_[_0x15cc('0x5b')](db[_0x15cc('0x85')][_0x15cc('0x70')]);_0x2f9b2a[_0x15cc('0x5a')]=_[_0x15cc('0x5b')](_0x1ca630[_0x15cc('0x5a')]);_0x2f9b2a[_0x15cc('0x5c')]=_[_0x15cc('0x5d')](_0x2f9b2a[_0x15cc('0x53')],_0x2f9b2a['query']);_0x56a307[_0x15cc('0x5f')]=_['intersection'](_0x2f9b2a[_0x15cc('0x53')],qs[_0x15cc('0x5e')](_0x1ca630[_0x15cc('0x5a')][_0x15cc('0x5e')]));_0x56a307[_0x15cc('0x5f')]=_0x56a307[_0x15cc('0x5f')][_0x15cc('0x60')]?_0x56a307[_0x15cc('0x5f')]:_0x2f9b2a[_0x15cc('0x53')];if(!_0x1ca630[_0x15cc('0x5a')]['hasOwnProperty'](_0x15cc('0x61'))){_0x56a307['limit']=qs[_0x15cc('0x24')](_0x1ca630[_0x15cc('0x5a')][_0x15cc('0x24')]);_0x56a307[_0x15cc('0x23')]=qs[_0x15cc('0x23')](_0x1ca630[_0x15cc('0x5a')][_0x15cc('0x23')]);}_0x56a307[_0x15cc('0x80')]=qs[_0x15cc('0x62')](_0x1ca630[_0x15cc('0x5a')][_0x15cc('0x62')]);_0x56a307[_0x15cc('0x63')]=qs['filters'](_[_0x15cc('0x64')](_0x1ca630['query'],_0x2f9b2a[_0x15cc('0x5c')]));_0x56a307['where'][_0x15cc('0x7d')]=_0x49619f['id'];if(_0x1ca630[_0x15cc('0x5a')]['filter']){_0x56a307['where']=_['merge'](_0x56a307['where'],{'$or':_['map'](_0x56a307[_0x15cc('0x5f')],function(_0x5c7e9e){var _0xf382a6={};_0xf382a6[_0x5c7e9e]={'$like':'%'+_0x1ca630[_0x15cc('0x5a')][_0x15cc('0x65')]+'%'};return _0xf382a6;})});}_0x56a307=_[_0x15cc('0x66')]({},_0x56a307,_0x1ca630[_0x15cc('0x68')]);return db[_0x15cc('0x85')]['count']({'where':_0x56a307['where']})[_0x15cc('0x15')](function(_0x3506e5){_0x2b1e51['count']=_0x3506e5;if(_0x1ca630['query'][_0x15cc('0x69')]){_0x56a307[_0x15cc('0x6a')]=[{'all':!![]}];}return db[_0x15cc('0x85')][_0x15cc('0x6b')](_0x56a307);})[_0x15cc('0x15')](function(_0x5298b8){_0x2b1e51['rows']=_0x5298b8;return _0x2b1e51;});}})['then'](respondWithFilteredResult(_0x26b8ca,_0x56a307))[_0x15cc('0x6d')](handleError(_0x26b8ca,null));};exports['removeAnswers']=function(_0x293d08,_0x2b97a7){return db[_0x15cc('0x56')][_0x15cc('0x76')]({'where':{'id':_0x293d08[_0x15cc('0x79')]['id']}})[_0x15cc('0x15')](handleEntityNotFound(_0x2b97a7,null))[_0x15cc('0x15')](function(_0x5b3c99){if(_0x5b3c99){return _0x5b3c99['removeAnswers'](_0x293d08[_0x15cc('0x5a')][_0x15cc('0x83')]);}})['then'](respondWithStatusCode(_0x2b97a7,null))[_0x15cc('0x6d')](handleError(_0x2b97a7,null));};exports['addLogo']=function(_0x5103fe,_0x197aae){_0x5103fe[_0x15cc('0x7a')][_0x15cc('0x86')]=_0x5103fe['file']['filename'];return db[_0x15cc('0x56')][_0x15cc('0x76')]({'where':{'id':_0x5103fe[_0x15cc('0x79')]['id']}})['then'](handleEntityNotFound(_0x197aae,null))[_0x15cc('0x15')](saveUpdates(_0x5103fe['body'],null))[_0x15cc('0x15')](respondWithResult(_0x197aae,null))[_0x15cc('0x6d')](handleError(_0x197aae,null));};exports[_0x15cc('0x87')]=function(_0x103aaf,_0x1f9429){_0x103aaf[_0x15cc('0x7a')][_0x15cc('0x88')]=_0x103aaf[_0x15cc('0x89')]['filename'];return db[_0x15cc('0x56')][_0x15cc('0x76')]({'where':{'id':_0x103aaf['params']['id']}})[_0x15cc('0x15')](handleEntityNotFound(_0x1f9429,null))[_0x15cc('0x15')](saveUpdates(_0x103aaf['body'],null))[_0x15cc('0x15')](respondWithResult(_0x1f9429,null))[_0x15cc('0x6d')](handleError(_0x1f9429,null));};exports['addCustomerAvatar']=function(_0x16781e,_0x1179a3){_0x16781e[_0x15cc('0x7a')][_0x15cc('0x8a')]=_0x16781e[_0x15cc('0x89')][_0x15cc('0x8b')];return db[_0x15cc('0x56')][_0x15cc('0x76')]({'where':{'id':_0x16781e[_0x15cc('0x79')]['id']}})[_0x15cc('0x15')](handleEntityNotFound(_0x1179a3,null))[_0x15cc('0x15')](saveUpdates(_0x16781e[_0x15cc('0x7a')],null))[_0x15cc('0x15')](respondWithResult(_0x1179a3,null))['catch'](handleError(_0x1179a3,null));};exports[_0x15cc('0x8c')]=function(_0x432ae5,_0x33c97d){_0x432ae5[_0x15cc('0x7a')][_0x15cc('0x8d')]=_0x432ae5[_0x15cc('0x89')][_0x15cc('0x8b')];return db[_0x15cc('0x56')][_0x15cc('0x76')]({'where':{'id':_0x432ae5[_0x15cc('0x79')]['id']}})[_0x15cc('0x15')](handleEntityNotFound(_0x33c97d,null))[_0x15cc('0x15')](saveUpdates(_0x432ae5[_0x15cc('0x7a')],null))[_0x15cc('0x15')](respondWithResult(_0x33c97d,null))['catch'](handleError(_0x33c97d,null));};exports[_0x15cc('0x8e')]=function(_0x2b4f6e,_0x532062){var _0x14e291=path['join'](config[_0x15cc('0x8f')],'server/files/images/logos/default_logo.svg');var _0x52b07f={'where':{'id':_0x2b4f6e[_0x15cc('0x79')]['id']},'attributes':['id',_0x15cc('0x86')],'raw':!![]};var _0x491fba=![];return require(_0x15cc('0x90'))[_0x15cc('0x91')]()['then'](function(_0x48d767){if(_0x48d767){_0x491fba=_0x48d767[_0x15cc('0x92')];}})['then'](function(){return db['ChatWebsite'][_0x15cc('0x76')](_0x52b07f);})[_0x15cc('0x15')](handleEntityNotFound(_0x532062,null))[_0x15cc('0x15')](function(_0x1bf191){if(_0x1bf191){if(!_[_0x15cc('0x93')](_0x1bf191[_0x15cc('0x86')])){if(fs[_0x15cc('0x94')](path['join'](config['root'],_0x15cc('0x95'),_0x1bf191[_0x15cc('0x86')]))&&_0x491fba){_0x14e291=path[_0x15cc('0x96')](config['root'],_0x15cc('0x95'),_0x1bf191[_0x15cc('0x86')]);}}return _0x532062[_0x15cc('0x97')](_0x14e291);}})[_0x15cc('0x6d')](handleError(_0x532062,null));};exports['getAvatar']=function(_0x35f904,_0x1dd4a8){var _0x415f0a=path[_0x15cc('0x96')](config[_0x15cc('0x8f')],_0x15cc('0x98'));var _0x210235={'where':{'id':_0x35f904['params']['id']},'attributes':['id',_0x15cc('0x88')],'raw':!![]};return db[_0x15cc('0x56')][_0x15cc('0x76')](_0x210235)['then'](handleEntityNotFound(_0x1dd4a8,null))[_0x15cc('0x15')](function(_0x5ec8e8){if(_0x5ec8e8){if(!_[_0x15cc('0x93')](_0x5ec8e8[_0x15cc('0x88')])){if(fs[_0x15cc('0x94')](path[_0x15cc('0x96')](config[_0x15cc('0x8f')],_0x15cc('0x99'),_0x5ec8e8[_0x15cc('0x88')]))){_0x415f0a=path['join'](config[_0x15cc('0x8f')],'server/files/images/avatars/',_0x5ec8e8['agentAvatar']);}}return _0x1dd4a8[_0x15cc('0x97')](_0x415f0a);}})['catch'](handleError(_0x1dd4a8,null));};exports[_0x15cc('0x9a')]=function(_0x22190b,_0x546224){var _0x4da79f=path[_0x15cc('0x96')](config[_0x15cc('0x8f')],_0x15cc('0x9b'));var _0x46ba58={'where':{'id':_0x22190b['params']['id']},'attributes':['id',_0x15cc('0x8a'),_0x15cc('0x9c')],'raw':!![]};return db['ChatWebsite'][_0x15cc('0x76')](_0x46ba58)[_0x15cc('0x15')](handleEntityNotFound(_0x546224,null))[_0x15cc('0x15')](function(_0x237f02){if(_0x237f02){if(!_[_0x15cc('0x93')](_0x237f02[_0x15cc('0x8a')])){if(fs['existsSync'](path[_0x15cc('0x96')](config[_0x15cc('0x8f')],_0x15cc('0x99'),_0x237f02[_0x15cc('0x8a')]))&&_0x237f02[_0x15cc('0x9c')]){_0x4da79f=path['join'](config[_0x15cc('0x8f')],'server/files/images/avatars/',_0x237f02[_0x15cc('0x8a')]);}}return _0x546224['download'](_0x4da79f);}})[_0x15cc('0x6d')](handleError(_0x546224,null));};exports[_0x15cc('0x9d')]=function(_0xc77efd,_0xbb74c5){var _0xc2fab3=path['join'](config[_0x15cc('0x8f')],_0x15cc('0x9e'));var _0x22eb9f={'where':{'id':_0xc77efd[_0x15cc('0x79')]['id']},'attributes':['id',_0x15cc('0x8d')],'raw':!![]};return db[_0x15cc('0x56')][_0x15cc('0x76')](_0x22eb9f)[_0x15cc('0x15')](handleEntityNotFound(_0xbb74c5,null))[_0x15cc('0x15')](function(_0x22c884){if(_0x22c884){if(!_[_0x15cc('0x93')](_0x22c884[_0x15cc('0x8d')])){if(fs[_0x15cc('0x94')](path[_0x15cc('0x96')](config[_0x15cc('0x8f')],'server/files/images/avatars/',_0x22c884[_0x15cc('0x8d')]))){_0xc2fab3=path['join'](config[_0x15cc('0x8f')],_0x15cc('0x99'),_0x22c884['systemAvatar']);}}return _0xbb74c5[_0x15cc('0x97')](_0xc2fab3);}})[_0x15cc('0x6d')](handleError(_0xbb74c5,null));};exports['notify']=function(_0x13826b,_0x245031){var _0x3235d3={'body':_0x13826b[_0x15cc('0x7a')],'channel':_0x15cc('0x9f')};var _0x11c6d5=[];var _0x5f249d=[];var _0x4db08c={};var _0x312ed0=![];return db[_0x15cc('0xa0')][_0x15cc('0x7b')]()['then'](function(_0x3ea2ae){if(!_0x3ea2ae){throw new db[(_0x15cc('0xa1'))][(_0x15cc('0xa2'))]('no\x20available\x20attributes');}_0x11c6d5=_[_0x15cc('0xa3')](_[_0x15cc('0x5b')](_0x3ea2ae),['createdAt',_0x15cc('0xa4')]);_0x5f249d=_[_0x15cc('0xa3')](_['keys'](_0x3ea2ae),[_0x15cc('0xa5'),_0x15cc('0xa4'),_0x15cc('0xa6'),_0x15cc('0xa7')]);if(_0x13826b[_0x15cc('0x7a')]['id']){delete _0x13826b[_0x15cc('0x7a')]['id'];}if(_['isNil'](_0x13826b[_0x15cc('0x7a')][_0x15cc('0xa8')])){throw new db['Sequelize']['ValidationError'](_0x15cc('0xa9'));}if(_[_0x15cc('0x93')](_0x13826b[_0x15cc('0x7a')][_0x15cc('0x7a')])||_0x13826b[_0x15cc('0x7a')][_0x15cc('0x7a')]===''){throw new db[(_0x15cc('0xa1'))][(_0x15cc('0xa2'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x13826b['body'][_0x15cc('0xaa')])){throw new db[(_0x15cc('0xa1'))][(_0x15cc('0xa2'))](_0x15cc('0xab')+_0x5f249d);}if(!_[_0x15cc('0xac')](_0x5f249d,_0x13826b[_0x15cc('0x7a')][_0x15cc('0xaa')])){throw new db[(_0x15cc('0xa1'))][(_0x15cc('0xa2'))](_0x15cc('0xad')+_0x5f249d);}_0x4db08c[_0x13826b[_0x15cc('0x7a')][_0x15cc('0xaa')]]=_0x13826b['body'][_0x15cc('0xa8')];})[_0x15cc('0x15')](function(){return db[_0x15cc('0x56')][_0x15cc('0x76')]({'where':{'id':_0x13826b[_0x15cc('0x79')]['id']},'include':[{'model':db['CmList'],'as':_0x15cc('0xae'),'include':[{'model':db[_0x15cc('0xa0')],'as':_0x15cc('0xaf'),'where':_0x4db08c,'limit':0x1,'order':[[_0x15cc('0xa4'),'DESC']]}]},{'model':db[_0x15cc('0xb0')],'as':_0x15cc('0xb1')},{'model':db[_0x15cc('0x3d')],'as':_0x15cc('0x3d'),'include':[{'model':db['Interval'],'as':_0x15cc('0x3e'),'attributes':['id',_0x15cc('0x33')],'raw':!![]}]}]});})['then'](function(_0x16f4cf){if(!_0x16f4cf)throw new APINotFoundError(util[_0x15cc('0x31')]('Chat\x20Website\x20with\x20id\x20%s\x20not\x20found',_0x13826b[_0x15cc('0x79')]['id']));if(!_0x16f4cf[_0x15cc('0x3d')]||!_0x16f4cf[_0x15cc('0x3d')][_0x15cc('0x3e')])return[_0x16f4cf,!![]];return[_0x16f4cf,checkWebsiteIntervals(_0x16f4cf)];})[_0x15cc('0xb2')](function(_0x87455f,_0xd79fa1){if(!_0xd79fa1)throw new APIOutOfIntervalError();if(!_0x87455f[_0x15cc('0xae')])return;_0x3235d3['account']=_0x87455f;_0x3235d3[_0x15cc('0xb3')]=_0x87455f[_0x15cc('0xae')];_0x3235d3['applications']=_['orderBy'](_0x87455f['Applications'],[_0x15cc('0xb4')],[_0x15cc('0xb5')]);if(_0x3235d3[_0x15cc('0xb6')][_0x15cc('0xb1')]){delete _0x3235d3[_0x15cc('0xb6')]['Applications'];}if(_0x3235d3[_0x15cc('0xb6')][_0x15cc('0xae')]&&_0x3235d3['account'][_0x15cc('0xae')]['Contacts'][_0x15cc('0x60')]){return _0x3235d3[_0x15cc('0xb6')][_0x15cc('0xae')]['Contacts'][0x0];}var _0x16493f=_[_0x15cc('0xd')](_0x13826b[_0x15cc('0x7a')],{'firstName':_0x13826b[_0x15cc('0x7a')][_0x15cc('0xa8')],'ListId':_0x87455f[_0x15cc('0xa7')]});_0x16493f[_0x13826b[_0x15cc('0x7a')][_0x15cc('0xaa')]]=_0x13826b[_0x15cc('0x7a')][_0x15cc('0xa8')];return db[_0x15cc('0xa0')][_0x15cc('0x71')](_0x16493f,{'fields':_0x11c6d5,'raw':!![]});})['then'](function(_0x593fd0){_0x3235d3[_0x15cc('0xb7')]=_0x593fd0;var _0x3e4e99=createInteractionObject(_0x13826b[_0x15cc('0x79')]['id'],_0x13826b[_0x15cc('0x7a')],_0x13826b[_0x15cc('0xb8')],_0x593fd0);var _0x365c93={'ChatWebsiteId':_0x13826b['params']['id'],'closed':![]};if(_0x13826b['body'][_0x15cc('0xb9')]){_0x365c93[_0x15cc('0xb9')]=_0x13826b['body']['threadId'];return db[_0x15cc('0xba')][_0x15cc('0x76')]({'where':_0x365c93})[_0x15cc('0x15')](function(_0x3f7128){if(_0x3f7128){_0x312ed0=!![];return _0x3f7128;}_0x3e4e99['threadId']=_0x13826b[_0x15cc('0x7a')]['threadId'];_0x3e4e99[_0x15cc('0xbb')]=_0x13826b[_0x15cc('0x7a')][_0x15cc('0xbb')];return db[_0x15cc('0xba')]['create'](_0x3e4e99);});}_0x365c93[_0x15cc('0xbc')]=_0x593fd0['id'];if(_0x13826b['body'][_0x15cc('0xbd')]&&_0x13826b[_0x15cc('0x7a')][_0x15cc('0xbd')]['id']){_0x365c93['id']=_0x13826b[_0x15cc('0x7a')][_0x15cc('0xbd')]['id'];return db['ChatInteraction'][_0x15cc('0x76')]({'where':_0x365c93})[_0x15cc('0x15')](function(_0x404504){if(_0x404504){_0x312ed0=!![];return _0x404504;}return db['ChatInteraction']['create'](_0x3e4e99);});}return db[_0x15cc('0xba')][_0x15cc('0x71')](_0x3e4e99);})['then'](function(_0x56f7e7){if(!_0x312ed0)return _0x56f7e7;var _0xa3911d={'from':(_0x3235d3[_0x15cc('0xb7')][_0x15cc('0x4a')]||'')+'\x20'+(_0x3235d3[_0x15cc('0xb7')]['lastName']||'')};if(_0x13826b[_0x15cc('0x7a')][_0x15cc('0xb9')]&&_0x13826b[_0x15cc('0x7a')][_0x15cc('0xbe')]&&_0x13826b['body'][_0x15cc('0xb9')]!=_0x13826b[_0x15cc('0x7a')]['messageId']){_0xa3911d[_0x15cc('0xb9')]=_0x13826b[_0x15cc('0x7a')][_0x15cc('0xbe')];}return _0x56f7e7[_0x15cc('0x29')](_0xa3911d);})[_0x15cc('0x15')](function(_0x1c87c5){_0x3235d3['interaction']=_0x1c87c5[_0x15cc('0x3f')]({'plain':!![]});_0x3235d3[_0x15cc('0xbd')][_0x15cc('0xbf')]=!_0x312ed0;if(_0x3235d3[_0x15cc('0xbd')][_0x15cc('0xbf')]){if(_0x3235d3['account'][_0x15cc('0xc0')]){_0x3235d3[_0x15cc('0xc1')][_0x15cc('0xc2')]({'id':0x0,'priority':_0x3235d3[_0x15cc('0xc1')][_0x15cc('0x60')]+0x1,'app':_0x15cc('0xc3'),'appdata':_0x15cc('0xc4'),'interval':'*,*,*,*'});}}return db['ChatMessage'][_0x15cc('0x71')]({'body':_0x13826b['body'][_0x15cc('0x7a')],'ChatWebsiteId':_0x13826b[_0x15cc('0x79')]['id'],'ChatInteractionId':_0x1c87c5['id'],'direction':'in','ContactId':_0x3235d3[_0x15cc('0xb7')]['id'],'AttachmentId':_0x13826b['body'][_0x15cc('0xc5')]});})['then'](function(_0x786939){_0x3235d3[_0x15cc('0x1d')]=_0x786939;if(!_0x3235d3['interaction'][_0x15cc('0xc6')]){return;}return db['User'][_0x15cc('0x76')]({'attributes':['id',_0x15cc('0x2e')],'where':{'id':_0x3235d3[_0x15cc('0xbd')][_0x15cc('0xc6')]}});})[_0x15cc('0x15')](function(_0x5ad585){if(_0x5ad585){_0x3235d3[_0x15cc('0xc1')][_0x15cc('0xc7')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x5ad585[_0x15cc('0x2e')]+','+(_0x3235d3[_0x15cc('0xb6')][_0x15cc('0xc8')]||0xa),'interval':_0x15cc('0xc9')});_0x3235d3[_0x15cc('0xca')]=!![];}if(!_0x3235d3[_0x15cc('0xbd')][_0x15cc('0xcb')]){return;}return db[_0x15cc('0xcc')][_0x15cc('0x76')]({'attributes':['id',_0x15cc('0x2e')],'where':{'id':_0x3235d3[_0x15cc('0xbd')][_0x15cc('0xcb')]}});})[_0x15cc('0x15')](function(_0x2712bb){if(_0x2712bb){_0x3235d3[_0x15cc('0xc1')][_0x15cc('0xc7')]({'id':0x0,'priority':0x1,'app':_0x15cc('0xcd'),'appdata':_0x2712bb[_0x15cc('0x2e')]+','+(_0x3235d3[_0x15cc('0xb6')][_0x15cc('0xce')]||0x12c),'interval':_0x15cc('0xc9')});}return respondWithRpcPromise('Start','startRouting',_0x3235d3);})[_0x15cc('0x15')](function(_0x2ccb3d){respondWithRpcPromise('EventManager',_0x15cc('0xcf'),{'event':'notify','message':_0x2ccb3d},client9002);return _0x2ccb3d;})[_0x15cc('0x15')](respondWithResult(_0x245031,null))[_0x15cc('0x6d')](APIHandleError(_0x245031));};exports['offline']=function(_0x35fe34,_0x50e46e){var _0x3b1069,_0x5859da,_0x468fa7;var _0x4b2be5=[];var _0x119936={};var _0x59790a=_0x35fe34['files']||[];var _0x44cb8a=[];var _0x45c16c;return db[_0x15cc('0xa0')]['describe']()[_0x15cc('0x15')](function(_0x4ba358){if(!_0x4ba358){throw new db['Sequelize'][(_0x15cc('0xa2'))](_0x15cc('0xd0'));}_0x4b2be5=_[_0x15cc('0xa3')](_[_0x15cc('0x5b')](_0x4ba358),['createdAt',_0x15cc('0xa4'),_0x15cc('0xa6'),_0x15cc('0xa7')]);if(_0x35fe34[_0x15cc('0x7a')]['id']){delete _0x35fe34[_0x15cc('0x7a')]['id'];}if(_['isNil'](_0x35fe34[_0x15cc('0x7a')][_0x15cc('0xa8')])){throw _0x50e46e['status'](0x1f4)[_0x15cc('0x2f')](new db[(_0x15cc('0xa1'))][(_0x15cc('0xa2'))]('from\x20is\x20mandatory'));}if(_[_0x15cc('0x93')](_0x35fe34['body']['body'])||_0x35fe34[_0x15cc('0x7a')][_0x15cc('0x7a')]===''){throw _0x50e46e[_0x15cc('0x20')](0x1f4)[_0x15cc('0x2f')](new db[(_0x15cc('0xa1'))][(_0x15cc('0xa2'))](_0x15cc('0xd1')));}if(_[_0x15cc('0x93')](_0x35fe34[_0x15cc('0x7a')]['mapKeyOffline'])){throw _0x50e46e['status'](0x1f4)['send'](new db['Sequelize'][(_0x15cc('0xa2'))](_0x15cc('0xd2')+_0x4b2be5));}if(!_[_0x15cc('0xac')](_0x4b2be5,_0x35fe34[_0x15cc('0x7a')][_0x15cc('0xd3')])){throw _0x50e46e[_0x15cc('0x20')](0x1f4)[_0x15cc('0x2f')](new db[(_0x15cc('0xa1'))]['ValidationError'](_0x15cc('0xd4')+_0x4b2be5));}_0x119936[_0x35fe34[_0x15cc('0x7a')][_0x15cc('0xd3')]]=_0x35fe34['body'][_0x15cc('0xa8')];})[_0x15cc('0x15')](function(){return db[_0x15cc('0x56')]['find']({'where':{'id':_0x35fe34[_0x15cc('0x79')]['id']},'include':[{'model':db[_0x15cc('0xd5')],'as':_0x15cc('0xae')},{'model':db[_0x15cc('0xd6')],'as':'MailAccount'}]});})[_0x15cc('0x15')](handleEntityNotFound(_0x50e46e,null))[_0x15cc('0x15')](function(_0x375d47){if(_0x375d47&&_0x375d47[_0x15cc('0xae')]){_0x5859da=_0x375d47;var _0x32af71=_[_0x15cc('0xd')](_0x35fe34[_0x15cc('0x7a')],{'firstName':_0x35fe34[_0x15cc('0x7a')][_0x15cc('0xa8')],'phone':_0x35fe34[_0x15cc('0x7a')][_0x15cc('0xa8')],'ListId':_0x375d47['ListId']});_0x32af71[_0x35fe34[_0x15cc('0x7a')][_0x15cc('0xd3')]]=_0x35fe34['body'][_0x15cc('0xa8')];return db[_0x15cc('0xa0')][_0x15cc('0xd7')]({'where':_0x119936,'defaults':_0x32af71});}})[_0x15cc('0xb2')](function(_0x43bdce){if(_0x43bdce){_0x468fa7=_0x43bdce;var _0x16383b=fs[_0x15cc('0xd8')](path[_0x15cc('0x96')](config[_0x15cc('0x8f')],'server/files/templates/chatOfflineMessage.ejs'),'utf8');var _0x2e8967=ejs['render'](_0x16383b,{'body':_[_0x15cc('0xd9')](_0x35fe34[_0x15cc('0x7a')]['body']),'bodyTitle':_0x5859da[_0x15cc('0xda')]});return db[_0x15cc('0xdb')][_0x15cc('0x71')]({'body':_0x2e8967,'plainBody':htmlToText[_0x15cc('0xdc')](_0x2e8967),'ContactId':_0x43bdce['id'],'ChatWebsiteId':_0x5859da['id']});}})[_0x15cc('0x15')](function(_0xa85b4e){_0x45c16c=_0xa85b4e;if(_0x59790a[_0x15cc('0x60')]){var _0x139ca1=_0x59790a[_0x15cc('0x3c')](function(_0x287b7a){return{'name':_0x287b7a['originalname'],'basename':_0x287b7a[_0x15cc('0x8b')],'type':_0x287b7a[_0x15cc('0xdd')],'ChatOfflineMessageId':_0xa85b4e['id']};});_0x44cb8a=_0x139ca1['map'](_0x392251=>{var _0x2e4b9d={'filename':_0x392251['name'],'path':path[_0x15cc('0x96')](config[_0x15cc('0x8f')],'server',_0x15cc('0xde'),_0x15cc('0xdf'),_0x15cc('0xe0'),_0x392251[_0x15cc('0xe1')])};return _0x2e4b9d;});if(!_0x5859da[_0x15cc('0xe2')]){return db[_0x15cc('0xe3')][_0x15cc('0xe4')](function(_0x3509b6){return db['Attachment'][_0x15cc('0xe5')](_0x139ca1,{'transaction':_0x3509b6});});}}})[_0x15cc('0x15')](function(){if(_0x45c16c){_0x3b1069=_0x45c16c;return db[_0x15cc('0xd6')][_0x15cc('0x7f')]({'where':{'service':!![]},'include':[{'model':db[_0x15cc('0xe6')],'as':_0x15cc('0xe7'),'raw':!![],'include':[{'model':db[_0x15cc('0xe8')],'as':'CloudProvider','raw':!![]}]}]});}})[_0x15cc('0x15')](function(_0x43b79b){if(_0x43b79b&&_0x43b79b[_0x15cc('0xe7')]&&_0x5859da['forwardOffline']&&_0x5859da[_0x15cc('0xe9')]){var _0x245dfa=_0x43b79b[_0x15cc('0xea')]();return respondWithRpcPromise('SendMail',_0x15cc('0xeb'),{'account':_0x245dfa,'message':{'from':util[_0x15cc('0x31')]('\x22%s\x22\x20<%s>',_0x43b79b[_0x15cc('0x2e')],_0x43b79b[_0x15cc('0xec')]||_0x43b79b['Smtp'][_0x15cc('0x72')]),'to':_0x5859da[_0x15cc('0xe9')],'subject':_0x5859da['offlineMessageSubject'],'html':_0x3b1069[_0x15cc('0x7a')],'attachments':_0x44cb8a}},client9003)[_0x15cc('0x15')](function(){return _0x3b1069;})['catch'](function(_0x3d6629){logger[_0x15cc('0x1c')](_0x3d6629);});}})['then'](function(){if(_0x5859da&&_0x5859da['openNewInteraction']&&_0x5859da[_0x15cc('0xed')]){var _0x3260d6=[];if(_0x59790a[_0x15cc('0x60')]){_0x3260d6=_0x59790a['map'](function(_0x5ea1c5){return{'name':_0x5ea1c5[_0x15cc('0xee')],'basename':_0x5ea1c5[_0x15cc('0x8b')],'type':_0x5ea1c5[_0x15cc('0xdd')],'ChatOfflineMessageId':_0x45c16c['id']};});}var _0x548025;if(!_[_0x15cc('0x93')](_0x5859da['subjectOffline'])){var _0x442634=_['map'](_0x35fe34[_0x15cc('0x7a')],function(_0x2c29ca){return _0x2c29ca;});var _0x5a4e14=_[_0x15cc('0xef')](_0x442634)[0x0];var _0x301754=_[_0x15cc('0xf0')](_0x5a4e14,function(_0x7dd60b){return _0x7dd60b;});_0x548025=_0x301754[0x1][_0x5859da['subjectOffline']];}var _0x1723fb={'from':_0x468fa7[_0x15cc('0xec')],'firstName':_0x468fa7['firstName'],'lastName':_0x468fa7[_0x15cc('0xf1')],'mapKey':_0x15cc('0xec'),'message':{'from':_0x468fa7[_0x15cc('0xec')],'to':_0x5859da[_0x15cc('0xd6')][_0x15cc('0xec')],'cc':'','subject':_['isNil'](_0x548025)?_0x5859da[_0x15cc('0xf2')]:_0x548025,'messageId':'','sentAt':new Date(),'attach':_0x3260d6['length'],'attachments':_0x3260d6,'originChannel':'Chat','ChatWebsiteId':_0x5859da['id'],'ChatOfflineMessageId':_0x3b1069['id'],'originTo':_0x5859da[_0x15cc('0xd6')][_0x15cc('0xec')]},'body':_0x3b1069[_0x15cc('0x7a')]};var _0x517b76={'account':{'id':_0x5859da[_0x15cc('0xed')]},'body':_0x1723fb,'log':_0x15cc('0xf3')};return respondWithRpcPromise('NotifyMailAccount',_0x15cc('0xf4'),_0x517b76,client9001)['then'](function(){return _0x3b1069;})[_0x15cc('0x6d')](function(_0x2513a3){logger['error'](_0x2513a3);});}return;})['then'](function(){if(_0x3b1069){return _0x3b1069;}})[_0x15cc('0x15')](respondWithResult(_0x50e46e,null))[_0x15cc('0x6d')](function(){for(var _0x45b8ec of _0x59790a){var _0x5b9ab1=path['join'](config['root'],_0x15cc('0xf5'),_0x15cc('0xde'),'attachments',_0x15cc('0xe0'),_0x45b8ec['filename']);fs_extra[_0x15cc('0xf6')](_0x5b9ab1)[_0x15cc('0x6d')](function(_0xaee966){logger[_0x15cc('0x1c')](_0x15cc('0xf7'),_0x5b9ab1,_0xaee966);});}});};exports[_0x15cc('0xf8')]=function(_0x51562e,_0x540a00){return db[_0x15cc('0xba')][_0x15cc('0x76')]({'where':{'id':_0x51562e[_0x15cc('0x79')]['id']}})['then'](handleEntityNotFound(_0x540a00,null))['then'](function(_0x15706a){if(_0x15706a){return _0x15706a['addInteraction'](_0x51562e[_0x15cc('0x7a')][_0x15cc('0x83')],_[_0x15cc('0xf9')](_0x51562e['body'],[_0x15cc('0x83'),'id'])||{});}})[_0x15cc('0x15')](respondWithResult(_0x540a00,null))[_0x15cc('0x6d')](handleError(_0x540a00,null));};exports['getInteractions']=function(_0x16e37c,_0xb12c60){var _0x22d925={'raw':![],'where':{}};var _0x1529ae={};var _0xacdcea={'count':0x0,'rows':[]};return db[_0x15cc('0x56')][_0x15cc('0x7f')]({'where':{'id':_0x16e37c[_0x15cc('0x79')]['id']}})['then'](handleEntityNotFound(_0xb12c60,null))[_0x15cc('0x15')](function(_0x58b2c3){if(_0x58b2c3){_0x1529ae[_0x15cc('0x53')]=_[_0x15cc('0x5b')](db[_0x15cc('0xba')][_0x15cc('0x70')]);_0x1529ae['query']=_[_0x15cc('0x5b')](_0x16e37c[_0x15cc('0x5a')]);_0x1529ae[_0x15cc('0x5c')]=_['intersection'](_0x1529ae['model'],_0x1529ae[_0x15cc('0x5a')]);_0x22d925[_0x15cc('0x5f')]=_['intersection'](_0x1529ae[_0x15cc('0x53')],qs[_0x15cc('0x5e')](_0x16e37c['query'][_0x15cc('0x5e')]));_0x22d925['attributes']=_0x22d925[_0x15cc('0x5f')]['length']?_0x22d925[_0x15cc('0x5f')]:_0x1529ae[_0x15cc('0x53')];if(!_0x16e37c['query'][_0x15cc('0xfa')]('nolimit')){_0x22d925[_0x15cc('0x24')]=qs[_0x15cc('0x24')](_0x16e37c[_0x15cc('0x5a')][_0x15cc('0x24')]);_0x22d925['offset']=qs[_0x15cc('0x23')](_0x16e37c[_0x15cc('0x5a')][_0x15cc('0x23')]);}_0x22d925[_0x15cc('0x80')]=qs[_0x15cc('0x62')](_0x16e37c[_0x15cc('0x5a')]['sort']);_0x22d925[_0x15cc('0x63')]=qs[_0x15cc('0x5c')](_['pick'](_0x16e37c[_0x15cc('0x5a')],_0x1529ae['filters']));_0x22d925[_0x15cc('0x63')][_0x15cc('0x7d')]=_0x58b2c3['id'];if(_0x16e37c[_0x15cc('0x5a')][_0x15cc('0x65')]){_0x22d925[_0x15cc('0x63')]=_[_0x15cc('0x66')](_0x22d925['where'],{'$or':_[_0x15cc('0x3c')](_0x22d925[_0x15cc('0x5f')],function(_0x26f4a5){var _0x78c042={};_0x78c042[_0x26f4a5]={'$like':'%'+_0x16e37c['query'][_0x15cc('0x65')]+'%'};return _0x78c042;})});}_0x22d925=_[_0x15cc('0x66')]({},_0x22d925,_0x16e37c[_0x15cc('0x68')]);return db[_0x15cc('0xba')][_0x15cc('0x26')]({'where':_0x22d925[_0x15cc('0x63')]})[_0x15cc('0x15')](function(_0x44b259){_0xacdcea[_0x15cc('0x26')]=_0x44b259;if(_0x16e37c[_0x15cc('0x5a')]['includeAll']){_0x22d925[_0x15cc('0x6a')]=[{'model':db[_0x15cc('0xa0')],'as':_0x15cc('0xfb'),'required':![]},{'model':db[_0x15cc('0xfc')],'as':_0x15cc('0xfd'),'attributes':[_0x15cc('0x2e'),_0x15cc('0xfe'),'internal'],'required':![]},{'model':db[_0x15cc('0xff')],'as':_0x15cc('0x100'),'attributes':['id',_0x15cc('0x2e'),'color'],'where':_0x16e37c[_0x15cc('0x5a')][_0x15cc('0x101')]?{'id':_0x16e37c[_0x15cc('0x5a')]['tag']}:undefined,'required':_0x16e37c['query'][_0x15cc('0x101')]?!![]:![]}];}return db[_0x15cc('0xba')][_0x15cc('0x6b')](_0x22d925);})[_0x15cc('0x15')](function(_0x73fd4c){_0xacdcea[_0x15cc('0x6c')]=_0x73fd4c;return _0xacdcea;});}})[_0x15cc('0x15')](respondWithFilteredResult(_0xb12c60,_0x22d925))['catch'](handleError(_0xb12c60,null));};exports[_0x15cc('0x30')]=function(_0x442e64,_0x1b34e8){var _0xc5fc1f=0x0;var _0x3f54fd=0x0;var _0x128a3d=![];var _0x559c02;var _0xdc5ed5;return db[_0x15cc('0x56')]['find']({'where':{'id':_0x442e64[_0x15cc('0x79')]['id']},'include':[{'model':db[_0x15cc('0x3d')],'as':_0x15cc('0x3d'),'include':[{'model':db[_0x15cc('0x3d')],'as':'Intervals','attributes':['id',_0x15cc('0x33')]}]}]})[_0x15cc('0x15')](handleEntityNotFound(_0x1b34e8,null))[_0x15cc('0x15')](function(_0x29cb61){if(_0x29cb61){_0x559c02=_0x29cb61;return _0x29cb61[_0x15cc('0x102')]({'raw':!![]});}})[_0x15cc('0x15')](function(_0x3b9639){if(_0x559c02){if(_0x3b9639){_0xdc5ed5=_0x3b9639;}}return require(_0x15cc('0x90'))[_0x15cc('0x91')]();})[_0x15cc('0x15')](function(_0x5a6e1e){if(_0x5a6e1e){_0x3f54fd=_0x5a6e1e['virtual'];_0x128a3d=_0x5a6e1e[_0x15cc('0x92')];}})['then'](function(){return db[_0x15cc('0xba')][_0x15cc('0x26')]({'where':{'closed':![]}});})[_0x15cc('0x15')](function(_0x5b988b){_0xc5fc1f=_0x5b988b;if(_0x3f54fd&&_0x5b988b>_0x3f54fd){return db[_0x15cc('0x103')]['findOne']({'where':{'id':0x1}})[_0x15cc('0x15')](function(_0x1a6216){if(_0x1a6216){_0x1a6216[_0x15cc('0x104')](_0x15cc('0x105'));}});}})[_0x15cc('0x15')](function(){if(!_0x559c02[_0x15cc('0x3d')]||!_0x559c02[_0x15cc('0x3d')][_0x15cc('0x3e')])return!![];return checkWebsiteIntervals(_0x559c02);})[_0x15cc('0x15')](function(_0x31df6f){var _0x3d7719=fs['readFileSync'](path['join'](config[_0x15cc('0x8f')],_0x15cc('0x106')),_0x15cc('0x107'));var _0x1751a8=new url[(_0x15cc('0x108'))](_0x559c02[_0x15cc('0x109')])[_0x15cc('0x10a')];var _0x3e5b63=_0x15cc('0x10b');var _0x4e0496=![];var _0x213fd0={'chatVersion':_0x3e5b63,'chatWebsiteAddressOrigin':_0x1751a8,'remote':_0x559c02[_0x15cc('0x10c')],'query':querystring[_0x15cc('0x1a')](_['merge'](_0x559c02[_0x15cc('0x3f')]({'plain':!![]}),{'customerIp':_0x442e64[_0x15cc('0xb8')][_0x15cc('0x47')]||_0x442e64['headers'][_0x15cc('0x10d')]||_0x442e64[_0x15cc('0x10e')][_0x15cc('0x10f')]||_0x442e64['ip'],'referer':_0x442e64['headers'][_0x15cc('0x110')],'openedInteractions':_0xc5fc1f,'maxInteractions':_0x3f54fd,'virtual':_0x128a3d['virtual'],'online':_0x31df6f,'custom':_0x128a3d}))[_0x15cc('0x111')](/'/g,'\x5c\x27')};_0x1b34e8[_0x15cc('0x2f')](ejs['render'](Mustache[_0x15cc('0x112')](_0x3d7719,_0x213fd0),{'proactiveActions':_0xdc5ed5,'alignment':_0x559c02[_0x15cc('0x113')],'verticalAlignment':_0x559c02['verticalAlignment'],'div_color':_0x559c02[_0x15cc('0x114')],'labelText':_0x559c02[_0x15cc('0x115')],'text_color':_0x559c02[_0x15cc('0x116')],'text_button_color':_0x559c02[_0x15cc('0x117')],'button_color':_0x559c02[_0x15cc('0x118')],'background_color':_0x559c02['backgroundColor'],'hideWhenOffline':_0x559c02['hideWhenOffline'],'intervalId':_0x559c02[_0x15cc('0x119')],'isDevelopment':_0x4e0496,'chatVersion':_0x3e5b63}));})['catch'](handleError(_0x1b34e8,null));};exports[_0x15cc('0x11a')]=function(_0x3bb432,_0x4253e4){var _0x584462=_0x3bb432['params']['id'];var _0x2c830b=_0x3bb432['body'];var _0x70239d=0xc8;var _0x16b5a7=null;return db[_0x15cc('0xe3')][_0x15cc('0xe4')]({'isolationLevel':db['sequelize'][_0x15cc('0x11b')][_0x15cc('0x11c')][_0x15cc('0x11d')]},function(_0x5d3af6){return db['ChatWebsite'][_0x15cc('0x7f')]({'where':{'id':_0x584462},'transaction':_0x5d3af6})[_0x15cc('0x15')](function(_0x46b439){if(_0x46b439){return db[_0x15cc('0xb0')][_0x15cc('0x2a')]({'where':{'ChatWebsiteId':_0x584462},'transaction':_0x5d3af6})[_0x15cc('0x15')](function(){var _0x391653=_['map'](_0x2c830b,function(_0x46aae1){_0x46aae1['ChatWebsiteId']=_0x584462;return _0x46aae1;});return db['ChatApplication'][_0x15cc('0xe5')](_0x391653,{'transaction':_0x5d3af6});});}else{_0x70239d=0x194;_0x16b5a7=[];}});})[_0x15cc('0x15')](function(){if(_0x70239d!==0x194){return db[_0x15cc('0xb0')][_0x15cc('0x11e')]({'where':{'ChatWebsiteId':_0x584462},'order':_0x15cc('0xb4')})[_0x15cc('0x15')](function(_0xab7a4e){_0x16b5a7=_0xab7a4e;});}})[_0x15cc('0x6d')](function(_0x2057c2){_0x70239d=0x1f4;logger['error'](_0x2057c2[_0x15cc('0x2d')]);if(_0x2057c2[_0x15cc('0x2e')]){delete _0x2057c2[_0x15cc('0x2e')];}_0x16b5a7=_0x2057c2;})['finally'](function(){if(_0x16b5a7===null){_0x4253e4[_0x15cc('0x1f')](_0x70239d);}else{if(_0x70239d===0x1f4){_0x4253e4['status'](_0x70239d)[_0x15cc('0x2f')](_0x16b5a7);}else{_0x4253e4[_0x15cc('0x20')](_0x70239d)[_0x15cc('0x22')](_0x16b5a7);}}});};exports[_0x15cc('0x11f')]=function(_0x25b7ca,_0x304c3f){var _0x25a9f8={};var _0xb001ad={};var _0x126dc1;var _0x502abf;return db[_0x15cc('0x56')][_0x15cc('0x7f')]({'where':{'id':_0x25b7ca[_0x15cc('0x79')]['id']}})[_0x15cc('0x15')](handleEntityNotFound(_0x304c3f,null))[_0x15cc('0x15')](function(_0x17594a){if(_0x17594a){_0x126dc1=_0x17594a;_0xb001ad['model']=_[_0x15cc('0x5b')](db['ChatApplication'][_0x15cc('0x70')]);_0xb001ad[_0x15cc('0x5a')]=_[_0x15cc('0x5b')](_0x25b7ca[_0x15cc('0x5a')]);_0xb001ad['filters']=_[_0x15cc('0x5d')](_0xb001ad[_0x15cc('0x53')],_0xb001ad[_0x15cc('0x5a')]);_0x25a9f8[_0x15cc('0x5f')]=_[_0x15cc('0x5d')](_0xb001ad[_0x15cc('0x53')],qs[_0x15cc('0x5e')](_0x25b7ca[_0x15cc('0x5a')][_0x15cc('0x5e')]));_0x25a9f8['attributes']=_0x25a9f8[_0x15cc('0x5f')][_0x15cc('0x60')]?_0x25a9f8[_0x15cc('0x5f')]:_0xb001ad[_0x15cc('0x53')];_0x25a9f8[_0x15cc('0x80')]=qs['sort'](_0x25b7ca[_0x15cc('0x5a')]['sort']);_0x25a9f8[_0x15cc('0x63')]=qs[_0x15cc('0x5c')](_['pick'](_0x25b7ca[_0x15cc('0x5a')],_0xb001ad['filters']));if(_0x25b7ca['query'][_0x15cc('0x65')]){_0x25a9f8['where']=_[_0x15cc('0x66')](_0x25a9f8[_0x15cc('0x63')],{'$or':_[_0x15cc('0x3c')](_0x25a9f8[_0x15cc('0x5f')],function(_0x5cc59c){var _0x36023d={};_0x36023d[_0x5cc59c]={'$like':'%'+_0x25b7ca[_0x15cc('0x5a')][_0x15cc('0x65')]+'%'};return _0x36023d;})});}_0x25a9f8=_[_0x15cc('0x66')]({},_0x25a9f8,_0x25b7ca[_0x15cc('0x68')]);return _0x126dc1[_0x15cc('0x11f')](_0x25a9f8);}})[_0x15cc('0x15')](function(_0x4e40ab){if(_0x4e40ab){_0x502abf=_0x4e40ab['length'];if(!_0x25b7ca[_0x15cc('0x5a')][_0x15cc('0xfa')](_0x15cc('0x61'))){_0x25a9f8[_0x15cc('0x24')]=qs['limit'](_0x25b7ca['query'][_0x15cc('0x24')]);_0x25a9f8[_0x15cc('0x23')]=qs[_0x15cc('0x23')](_0x25b7ca[_0x15cc('0x5a')]['offset']);}return _0x126dc1[_0x15cc('0x11f')](_0x25a9f8);}})[_0x15cc('0x15')](function(_0x5b027c){if(_0x5b027c){return _0x5b027c?{'count':_0x502abf,'rows':_0x5b027c}:null;}})['then'](respondWithResult(_0x304c3f,null))[_0x15cc('0x6d')](handleError(_0x304c3f,null));};exports[_0x15cc('0x120')]=function(_0xa33009,_0xc0df40){return db['chatProactiveAction'][_0x15cc('0x76')]({'where':{'id':_0xa33009[_0x15cc('0x79')]['id']}})['then'](handleEntityNotFound(_0xc0df40,null))['then'](function(_0x1a2b12){if(_0x1a2b12){return _0x1a2b12['addProactiveActions'](_0xa33009[_0x15cc('0x7a')]['ids'],_[_0x15cc('0xf9')](_0xa33009[_0x15cc('0x7a')],[_0x15cc('0x83'),'id'])||{});}})[_0x15cc('0x15')](respondWithResult(_0xc0df40,null))[_0x15cc('0x6d')](handleError(_0xc0df40,null));};exports[_0x15cc('0x102')]=function(_0x23a20e,_0x273873){var _0x1075ef={};var _0x869b2a={};var _0x1cd0ea;var _0x2b96ff;return db[_0x15cc('0x56')][_0x15cc('0x7f')]({'where':{'id':_0x23a20e['params']['id']}})[_0x15cc('0x15')](handleEntityNotFound(_0x273873,null))[_0x15cc('0x15')](function(_0x19a5b6){if(_0x19a5b6){_0x1cd0ea=_0x19a5b6;_0x869b2a[_0x15cc('0x53')]=_['keys'](db['ChatProactiveAction'][_0x15cc('0x70')]);_0x869b2a[_0x15cc('0x5a')]=_[_0x15cc('0x5b')](_0x23a20e[_0x15cc('0x5a')]);_0x869b2a['filters']=_[_0x15cc('0x5d')](_0x869b2a[_0x15cc('0x53')],_0x869b2a[_0x15cc('0x5a')]);_0x1075ef[_0x15cc('0x5f')]=_[_0x15cc('0x5d')](_0x869b2a[_0x15cc('0x53')],qs[_0x15cc('0x5e')](_0x23a20e['query'][_0x15cc('0x5e')]));_0x1075ef[_0x15cc('0x5f')]=_0x1075ef[_0x15cc('0x5f')][_0x15cc('0x60')]?_0x1075ef[_0x15cc('0x5f')]:_0x869b2a[_0x15cc('0x53')];_0x1075ef['order']=qs['sort'](_0x23a20e[_0x15cc('0x5a')]['sort']);_0x1075ef['where']=qs[_0x15cc('0x5c')](_[_0x15cc('0x64')](_0x23a20e[_0x15cc('0x5a')],_0x869b2a[_0x15cc('0x5c')]));if(_0x23a20e['query'][_0x15cc('0x65')]){_0x1075ef['where']=_['merge'](_0x1075ef['where'],{'$or':_[_0x15cc('0x3c')](_0x1075ef['attributes'],function(_0x19e65f){var _0x1314a2={};_0x1314a2[_0x19e65f]={'$like':'%'+_0x23a20e[_0x15cc('0x5a')][_0x15cc('0x65')]+'%'};return _0x1314a2;})});}_0x1075ef=_['merge']({},_0x1075ef,_0x23a20e[_0x15cc('0x68')]);return _0x1cd0ea['getProactiveActions'](_0x1075ef);}})['then'](function(_0x1b0a68){if(_0x1b0a68){_0x2b96ff=_0x1b0a68[_0x15cc('0x60')];if(!_0x23a20e['query'][_0x15cc('0xfa')]('nolimit')){_0x1075ef['limit']=qs['limit'](_0x23a20e[_0x15cc('0x5a')][_0x15cc('0x24')]);_0x1075ef[_0x15cc('0x23')]=qs[_0x15cc('0x23')](_0x23a20e['query']['offset']);}return _0x1cd0ea[_0x15cc('0x102')](_0x1075ef);}})[_0x15cc('0x15')](function(_0x4da513){if(_0x4da513){return _0x4da513?{'count':_0x2b96ff,'rows':_0x4da513}:null;}})['then'](respondWithResult(_0x273873,null))[_0x15cc('0x6d')](handleError(_0x273873,null));};exports[_0x15cc('0x121')]=function(_0x58fe15,_0x3b075e){var _0x5ce6bb=_0x58fe15[_0x15cc('0x5a')][_0x15cc('0x122')]==='false'?_0x15cc('0x123'):_0x15cc('0x124');return db['ChatWebsite']['find']({'attributes':['id',_0x5ce6bb],'where':{'id':_0x58fe15[_0x15cc('0x79')]['id']}})[_0x15cc('0x15')](handleEntityNotFound(_0x3b075e,null))[_0x15cc('0x15')](function(_0x59dbe7){if(_0x59dbe7){var _0x5d90ac=_0x59dbe7[_0x5ce6bb];var _0x2fbf97=_0x5d90ac&&_0x5d90ac[_0x15cc('0x125')]?_0x5d90ac['items']:[];_0x3b075e['send']({'fromKey':_['isNil'](_0x5d90ac['fromKey'])?undefined:_0x5d90ac['fromKey'],'count':_0x2fbf97[_0x15cc('0x60')],'rows':_0x2fbf97});}})[_0x15cc('0x6d')](handleError(_0x3b075e,null));};exports['getOfflineMessages']=function(_0x31dad7,_0x502234){var _0x2debb7={'raw':![],'where':{}};var _0x280102={};var _0x468fdc={'count':0x0,'rows':[]};return db[_0x15cc('0x56')][_0x15cc('0x7f')]({'where':{'id':_0x31dad7['params']['id']}})[_0x15cc('0x15')](handleEntityNotFound(_0x502234,null))[_0x15cc('0x15')](function(_0x5d9fd2){if(_0x5d9fd2){_0x280102[_0x15cc('0x53')]=_[_0x15cc('0x5b')](db['ChatOfflineMessage'][_0x15cc('0x70')]);_0x280102[_0x15cc('0x5a')]=_[_0x15cc('0x5b')](_0x31dad7[_0x15cc('0x5a')]);_0x280102[_0x15cc('0x5c')]=_['intersection'](_0x280102[_0x15cc('0x53')],_0x280102['query']);_0x2debb7[_0x15cc('0x5f')]=_[_0x15cc('0x5d')](_0x280102[_0x15cc('0x53')],qs[_0x15cc('0x5e')](_0x31dad7[_0x15cc('0x5a')][_0x15cc('0x5e')]));_0x2debb7[_0x15cc('0x5f')]=_0x2debb7['attributes'][_0x15cc('0x60')]?_0x2debb7['attributes']:_0x280102[_0x15cc('0x53')];if(!_0x31dad7['query'][_0x15cc('0xfa')](_0x15cc('0x61'))){_0x2debb7['limit']=qs[_0x15cc('0x24')](_0x31dad7[_0x15cc('0x5a')][_0x15cc('0x24')]);_0x2debb7[_0x15cc('0x23')]=qs['offset'](_0x31dad7[_0x15cc('0x5a')]['offset']);}_0x2debb7[_0x15cc('0x80')]=qs['sort'](_0x31dad7[_0x15cc('0x5a')]['sort']);_0x2debb7['where']=qs['filters'](_[_0x15cc('0x64')](_0x31dad7[_0x15cc('0x5a')],_0x280102['filters']));_0x2debb7['where'][_0x15cc('0x7d')]=_0x5d9fd2['id'];if(_0x31dad7['query'][_0x15cc('0x65')]){_0x2debb7[_0x15cc('0x63')]=_['merge'](_0x2debb7[_0x15cc('0x63')],{'$or':_[_0x15cc('0x3c')](_0x2debb7[_0x15cc('0x5f')],function(_0x57caa9){var _0x442a47={};_0x442a47[_0x57caa9]={'$like':'%'+_0x31dad7[_0x15cc('0x5a')][_0x15cc('0x65')]+'%'};return _0x442a47;})});}_0x2debb7=_[_0x15cc('0x66')]({},_0x2debb7,_0x31dad7[_0x15cc('0x68')]);return db[_0x15cc('0xdb')][_0x15cc('0x26')]({'where':_0x2debb7[_0x15cc('0x63')]})[_0x15cc('0x15')](function(_0x4471a6){_0x468fdc[_0x15cc('0x26')]=_0x4471a6;if(_0x31dad7[_0x15cc('0x5a')]['includeAll']){_0x2debb7[_0x15cc('0x6a')]=[{'all':!![]}];}else{_0x2debb7[_0x15cc('0x6a')]=[{'model':db['CmContact'],'as':_0x15cc('0xfb'),'required':![]},{'model':db[_0x15cc('0x126')],'as':'Attachments','required':![]}];}return db[_0x15cc('0xdb')][_0x15cc('0x6b')](_0x2debb7);})[_0x15cc('0x15')](function(_0x19a4dd){_0x468fdc['rows']=_0x19a4dd;return _0x468fdc;});}})['then'](respondWithFilteredResult(_0x502234,_0x2debb7))[_0x15cc('0x6d')](handleError(_0x502234,null));};exports[_0x15cc('0x127')]=function(_0x328886,_0x407c6f){return db['ChatWebsite']['find']({'where':{'id':_0x328886['params']['id']}})[_0x15cc('0x15')](handleEntityNotFound(_0x407c6f,null))[_0x15cc('0x15')](function(_0x204365){if(_0x204365){return _0x204365[_0x15cc('0x127')](_0x328886['body'][_0x15cc('0x83')],_[_0x15cc('0xf9')](_0x328886['body'],[_0x15cc('0x83'),'id'])||{})[_0x15cc('0xb2')](function(_0x150ccb){for(var _0x3682cb=0x0;_0x3682cb<_0x328886['body'][_0x15cc('0x83')][_0x15cc('0x60')];_0x3682cb+=0x1){socket[_0x15cc('0x128')](_0x15cc('0x129'),{'UserId':Number(_0x328886[_0x15cc('0x7a')]['ids'][_0x3682cb]),'ChatWebsiteId':Number(_0x328886[_0x15cc('0x79')]['id'])});}return _0x150ccb;});}})[_0x15cc('0x15')](respondWithResult(_0x407c6f,null))[_0x15cc('0x6d')](handleError(_0x407c6f,null));};exports[_0x15cc('0x12a')]=function(_0x1313ae,_0x1d4959){return db[_0x15cc('0x56')][_0x15cc('0x76')]({'where':{'id':_0x1313ae[_0x15cc('0x79')]['id']}})[_0x15cc('0x15')](handleEntityNotFound(_0x1d4959,null))['then'](function(_0x382a7e){if(_0x382a7e){return _0x382a7e['removeAgents'](_0x1313ae['query'][_0x15cc('0x83')])['then'](function(){if(_[_0x15cc('0x12b')](_0x1313ae[_0x15cc('0x5a')][_0x15cc('0x83')])){for(var _0x689cc4=0x0;_0x689cc4<_0x1313ae[_0x15cc('0x5a')]['ids']['length'];_0x689cc4+=0x1){socket[_0x15cc('0x128')](_0x15cc('0x12c'),{'UserId':Number(_0x1313ae['query'][_0x15cc('0x83')][_0x689cc4]),'ChatWebsiteId':Number(_0x1313ae['params']['id'])});}}else{socket[_0x15cc('0x128')](_0x15cc('0x12c'),{'UserId':Number(_0x1313ae[_0x15cc('0x5a')][_0x15cc('0x83')]),'ChatWebsiteId':Number(_0x1313ae[_0x15cc('0x79')]['id'])});}});}})[_0x15cc('0x15')](respondWithStatusCode(_0x1d4959,null))[_0x15cc('0x6d')](handleError(_0x1d4959,null));};exports['getAgents']=function(_0x1acaba,_0x33edf6){var _0x19a150={};var _0x3ff2b7={};var _0x17f733;var _0x32024f;return db[_0x15cc('0x56')][_0x15cc('0x7f')]({'where':{'id':_0x1acaba[_0x15cc('0x79')]['id']}})[_0x15cc('0x15')](handleEntityNotFound(_0x33edf6,null))[_0x15cc('0x15')](function(_0x3bf826){if(_0x3bf826){_0x17f733=_0x3bf826;_0x3ff2b7[_0x15cc('0x53')]=_['keys'](db[_0x15cc('0xfc')][_0x15cc('0x70')]);_0x3ff2b7['query']=_['keys'](_0x1acaba[_0x15cc('0x5a')]);_0x3ff2b7['filters']=_[_0x15cc('0x5d')](_0x3ff2b7[_0x15cc('0x53')],_0x3ff2b7['query']);_0x19a150['attributes']=_['intersection'](_0x3ff2b7['model'],qs['fields'](_0x1acaba[_0x15cc('0x5a')]['fields']));_0x19a150[_0x15cc('0x5f')]=_0x19a150[_0x15cc('0x5f')][_0x15cc('0x60')]?_0x19a150[_0x15cc('0x5f')]:_0x3ff2b7[_0x15cc('0x53')];_0x19a150[_0x15cc('0x80')]=qs[_0x15cc('0x62')](_0x1acaba[_0x15cc('0x5a')][_0x15cc('0x62')]);_0x19a150[_0x15cc('0x63')]=qs[_0x15cc('0x5c')](_[_0x15cc('0x64')](_0x1acaba[_0x15cc('0x5a')],_0x3ff2b7[_0x15cc('0x5c')]));if(_0x1acaba[_0x15cc('0x5a')][_0x15cc('0x65')]){_0x19a150['where']=_[_0x15cc('0x66')](_0x19a150[_0x15cc('0x63')],{'$or':_[_0x15cc('0x3c')](_0x19a150[_0x15cc('0x5f')],function(_0x30a727){var _0x136dec={};_0x136dec[_0x30a727]={'$like':'%'+_0x1acaba[_0x15cc('0x5a')][_0x15cc('0x65')]+'%'};return _0x136dec;})});}_0x19a150=_[_0x15cc('0x66')]({},_0x19a150,_0x1acaba['options']);return _0x17f733['getAgents'](_0x19a150);}})[_0x15cc('0x15')](function(_0x428c5d){if(_0x428c5d){_0x32024f=_0x428c5d['length'];if(!_0x1acaba[_0x15cc('0x5a')][_0x15cc('0xfa')](_0x15cc('0x61'))){_0x19a150[_0x15cc('0x24')]=qs[_0x15cc('0x24')](_0x1acaba[_0x15cc('0x5a')][_0x15cc('0x24')]);_0x19a150[_0x15cc('0x23')]=qs['offset'](_0x1acaba['query'][_0x15cc('0x23')]);}return _0x17f733[_0x15cc('0x12d')](_0x19a150);}})[_0x15cc('0x15')](function(_0x1e75a5){if(_0x1e75a5){return _0x1e75a5?{'count':_0x32024f,'rows':_0x1e75a5}:null;}})[_0x15cc('0x15')](respondWithResult(_0x33edf6,null))['catch'](handleError(_0x33edf6,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index 55123e9..768ee95 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 _0xbf4e=['events','../../mysqldb','ChatWebsite','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports'];(function(_0x1ad89c,_0x49dfe0){var _0x1dd3b1=function(_0xb4094c){while(--_0xb4094c){_0x1ad89c['push'](_0x1ad89c['shift']());}};_0x1dd3b1(++_0x49dfe0);}(_0xbf4e,0x172));var _0xebf4=function(_0x5be829,_0x48378c){_0x5be829=_0x5be829-0x0;var _0x343686=_0xbf4e[_0x5be829];return _0x343686;};'use strict';var EventEmitter=require(_0xebf4('0x0'));var ChatWebsite=require(_0xebf4('0x1'))['db'][_0xebf4('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xebf4('0x3')](0x0);var events={'afterCreate':_0xebf4('0x4'),'afterUpdate':_0xebf4('0x5'),'afterDestroy':'remove'};function emitEvent(_0x41cb2c){return function(_0x5d2ad5,_0x59cc54,_0x15328a){ChatWebsiteEvents[_0xebf4('0x6')](_0x41cb2c+':'+_0x5d2ad5['id'],_0x5d2ad5);ChatWebsiteEvents['emit'](_0x41cb2c,_0x5d2ad5);_0x15328a(null);};}for(var e in events){if(events[_0xebf4('0x7')](e)){var event=events[e];ChatWebsite[_0xebf4('0x8')](e,emitEvent(event));}}module[_0xebf4('0x9')]=ChatWebsiteEvents; \ No newline at end of file +var _0x1280=['save','update','remove','emit','hook','exports','events','../../mysqldb','ChatWebsite','setMaxListeners'];(function(_0x14bcaa,_0x1f775d){var _0x211587=function(_0x55e7a2){while(--_0x55e7a2){_0x14bcaa['push'](_0x14bcaa['shift']());}};_0x211587(++_0x1f775d);}(_0x1280,0xba));var _0x0128=function(_0x3889ae,_0x4770c3){_0x3889ae=_0x3889ae-0x0;var _0x6533dd=_0x1280[_0x3889ae];return _0x6533dd;};'use strict';var EventEmitter=require(_0x0128('0x0'));var ChatWebsite=require(_0x0128('0x1'))['db'][_0x0128('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x0128('0x3')](0x0);var events={'afterCreate':_0x0128('0x4'),'afterUpdate':_0x0128('0x5'),'afterDestroy':_0x0128('0x6')};function emitEvent(_0x3a3112){return function(_0x403dd9,_0x551461,_0x2c8eee){ChatWebsiteEvents[_0x0128('0x7')](_0x3a3112+':'+_0x403dd9['id'],_0x403dd9);ChatWebsiteEvents['emit'](_0x3a3112,_0x403dd9);_0x2c8eee(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0x0128('0x8')](e,emitEvent(event));}}module[_0x0128('0x9')]=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index 28c0dbb..15aa3c8 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 _0x0c2f=['api','moment','bluebird','path','rimraf','../../config/environment','./chatWebsite.attributes','define','chat_websites','util','../../config/logger'];(function(_0x44583b,_0x4f23f7){var _0x12fd08=function(_0x5b8815){while(--_0x5b8815){_0x44583b['push'](_0x44583b['shift']());}};_0x12fd08(++_0x4f23f7);}(_0x0c2f,0x111));var _0xf0c2=function(_0x5c0b22,_0x56d46a){_0x5c0b22=_0x5c0b22-0x0;var _0x16a8a6=_0x0c2f[_0x5c0b22];return _0x16a8a6;};'use strict';var _=require('lodash');var util=require(_0xf0c2('0x0'));var logger=require(_0xf0c2('0x1'))(_0xf0c2('0x2'));var moment=require(_0xf0c2('0x3'));var BPromise=require(_0xf0c2('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf0c2('0x5'));var rimraf=require(_0xf0c2('0x6'));var config=require(_0xf0c2('0x7'));var attributes=require(_0xf0c2('0x8'));module['exports']=function(_0x33989e,_0x245e79){return _0x33989e[_0xf0c2('0x9')]('ChatWebsite',attributes,{'tableName':_0xf0c2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf84f=['api','moment','bluebird','../../config/environment','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','lodash','util','../../config/logger'];(function(_0x2688f2,_0x513c10){var _0x465009=function(_0x702ede){while(--_0x702ede){_0x2688f2['push'](_0x2688f2['shift']());}};_0x465009(++_0x513c10);}(_0xf84f,0x11d));var _0xff84=function(_0xc7ae13,_0x1b887b){_0xc7ae13=_0xc7ae13-0x0;var _0x327671=_0xf84f[_0xc7ae13];return _0x327671;};'use strict';var _=require(_0xff84('0x0'));var util=require(_0xff84('0x1'));var logger=require(_0xff84('0x2'))(_0xff84('0x3'));var moment=require(_0xff84('0x4'));var BPromise=require(_0xff84('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xff84('0x6'));var attributes=require(_0xff84('0x7'));module[_0xff84('0x8')]=function(_0x30c1e6,_0x1584ee){return _0x30c1e6[_0xff84('0x9')](_0xff84('0xa'),attributes,{'tableName':_0xff84('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js index 3161af9..dab2af0 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 _0xe0b0=['redis','localhost','socket.io-emitter','register','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults'];(function(_0x5a59b9,_0x438b5a){var _0x41d2a4=function(_0x296606){while(--_0x296606){_0x5a59b9['push'](_0x5a59b9['shift']());}};_0x41d2a4(++_0x438b5a);}(_0xe0b0,0x7c));var _0x0e0b=function(_0x16505c,_0x573d70){_0x16505c=_0x16505c-0x0;var _0x2893a0=_0xe0b0[_0x16505c];return _0x2893a0;};'use strict';var _=require(_0x0e0b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x0e0b('0x1'));var rs=require(_0x0e0b('0x2'));var fs=require('fs');var Redis=require(_0x0e0b('0x3'));var db=require(_0x0e0b('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x0e0b('0x5'))(_0x0e0b('0x6'));var config=require(_0x0e0b('0x7'));var jayson=require(_0x0e0b('0x8'));var client=jayson[_0x0e0b('0x9')]['http']({'port':0x232a});config['redis']=_[_0x0e0b('0xa')](config[_0x0e0b('0xb')],{'host':_0x0e0b('0xc'),'port':0x18eb});var socket=require(_0x0e0b('0xd'))(new Redis(config['redis']));require('./chatWebsite.socket')[_0x0e0b('0xe')](socket);function respondWithRpcPromise(_0x163492,_0x5e1af1,_0x57b2a2){return new BPromise(function(_0x36381b,_0x1d0fac){return client[_0x0e0b('0xf')](_0x163492,_0x57b2a2)[_0x0e0b('0x10')](function(_0x46527c){logger[_0x0e0b('0x11')](_0x0e0b('0x12'),_0x5e1af1,_0x0e0b('0x13'));logger[_0x0e0b('0x14')](_0x0e0b('0x15'),_0x5e1af1,'request\x20sent',JSON[_0x0e0b('0x16')](_0x46527c));if(_0x46527c['error']){if(_0x46527c[_0x0e0b('0x17')]['code']===0x1f4){logger[_0x0e0b('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x5e1af1,_0x46527c[_0x0e0b('0x17')][_0x0e0b('0x18')]);return _0x1d0fac(_0x46527c[_0x0e0b('0x17')][_0x0e0b('0x18')]);}logger[_0x0e0b('0x17')](_0x0e0b('0x12'),_0x5e1af1,_0x46527c[_0x0e0b('0x17')]['message']);return _0x36381b(_0x46527c[_0x0e0b('0x17')][_0x0e0b('0x18')]);}else{logger[_0x0e0b('0x11')](_0x0e0b('0x12'),_0x5e1af1,_0x0e0b('0x13'));_0x36381b(_0x46527c[_0x0e0b('0x19')][_0x0e0b('0x18')]);}})[_0x0e0b('0x1a')](function(_0x1318b7){logger[_0x0e0b('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x5e1af1,_0x1318b7);_0x1d0fac(_0x1318b7);});});} \ No newline at end of file +var _0x1f8a=['../../config/environment','jayson/promise','client','http','defaults','redis','socket.io-emitter','./chatWebsite.socket','request','then','info','ChatWebsite,\x20%s,\x20%s','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x3b5d45,_0x1e3534){var _0x2c9fc5=function(_0x44f309){while(--_0x44f309){_0x3b5d45['push'](_0x3b5d45['shift']());}};_0x2c9fc5(++_0x1e3534);}(_0x1f8a,0xaf));var _0xa1f8=function(_0x47ba52,_0x409f2c){_0x47ba52=_0x47ba52-0x0;var _0x21d870=_0x1f8a[_0x47ba52];return _0x21d870;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xa1f8('0x0'));var BPromise=require(_0xa1f8('0x1'));var rs=require(_0xa1f8('0x2'));var fs=require('fs');var Redis=require(_0xa1f8('0x3'));var db=require(_0xa1f8('0x4'))['db'];var utils=require(_0xa1f8('0x5'));var logger=require(_0xa1f8('0x6'))('rpc');var config=require(_0xa1f8('0x7'));var jayson=require(_0xa1f8('0x8'));var client=jayson[_0xa1f8('0x9')][_0xa1f8('0xa')]({'port':0x232a});config['redis']=_[_0xa1f8('0xb')](config[_0xa1f8('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xa1f8('0xd'))(new Redis(config['redis']));require(_0xa1f8('0xe'))['register'](socket);function respondWithRpcPromise(_0x44d34f,_0x37934f,_0x207ab2){return new BPromise(function(_0xbfec6c,_0x3057bb){return client[_0xa1f8('0xf')](_0x44d34f,_0x207ab2)[_0xa1f8('0x10')](function(_0x5ba78d){logger[_0xa1f8('0x11')](_0xa1f8('0x12'),_0x37934f,'request\x20sent');logger['debug'](_0xa1f8('0x13'),_0x37934f,_0xa1f8('0x14'),JSON[_0xa1f8('0x15')](_0x5ba78d));if(_0x5ba78d[_0xa1f8('0x16')]){if(_0x5ba78d[_0xa1f8('0x16')]['code']===0x1f4){logger['error'](_0xa1f8('0x12'),_0x37934f,_0x5ba78d[_0xa1f8('0x16')][_0xa1f8('0x17')]);return _0x3057bb(_0x5ba78d['error'][_0xa1f8('0x17')]);}logger[_0xa1f8('0x16')](_0xa1f8('0x12'),_0x37934f,_0x5ba78d[_0xa1f8('0x16')][_0xa1f8('0x17')]);return _0xbfec6c(_0x5ba78d['error'][_0xa1f8('0x17')]);}else{logger[_0xa1f8('0x11')](_0xa1f8('0x12'),_0x37934f,'request\x20sent');_0xbfec6c(_0x5ba78d[_0xa1f8('0x18')]['message']);}})[_0xa1f8('0x19')](function(_0x349768){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x37934f,_0x349768);_0x3057bb(_0x349768);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index 2a8c9cb..fb57dbf 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 _0x6816=['update','emit','removeListener','register','length','chatWebsite:','./chatWebsite.events','save','remove'];(function(_0x231e97,_0x478239){var _0x4565b2=function(_0xce29c9){while(--_0xce29c9){_0x231e97['push'](_0x231e97['shift']());}};_0x4565b2(++_0x478239);}(_0x6816,0x126));var _0x6681=function(_0x1c8c26,_0xa43196){_0x1c8c26=_0x1c8c26-0x0;var _0xd021dd=_0x6816[_0x1c8c26];return _0xd021dd;};'use strict';var ChatWebsiteEvents=require(_0x6681('0x0'));var events=[_0x6681('0x1'),_0x6681('0x2'),_0x6681('0x3')];function createListener(_0x283205,_0x1d205e){return function(_0x11117f){_0x1d205e[_0x6681('0x4')](_0x283205,_0x11117f);};}function removeListener(_0x3c2261,_0x3c37c8){return function(){ChatWebsiteEvents[_0x6681('0x5')](_0x3c2261,_0x3c37c8);};}exports[_0x6681('0x6')]=function(_0xe50b7){for(var _0x88b1e5=0x0,_0x535138=events[_0x6681('0x7')];_0x88b1e5<_0x535138;_0x88b1e5++){var _0xc2b5bd=events[_0x88b1e5];var _0x365251=createListener(_0x6681('0x8')+_0xc2b5bd,_0xe50b7);ChatWebsiteEvents['on'](_0xc2b5bd,_0x365251);}}; \ No newline at end of file +var _0xd57d=['length','chatWebsite:','save','update','emit','register'];(function(_0x2fe35b,_0x22af28){var _0x198bf0=function(_0x543319){while(--_0x543319){_0x2fe35b['push'](_0x2fe35b['shift']());}};_0x198bf0(++_0x22af28);}(_0xd57d,0x1ee));var _0xdd57=function(_0x39097c,_0x23d4a9){_0x39097c=_0x39097c-0x0;var _0x2762cf=_0xd57d[_0x39097c];return _0x2762cf;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=[_0xdd57('0x0'),'remove',_0xdd57('0x1')];function createListener(_0x1cc8a3,_0x370cd9){return function(_0x59078a){_0x370cd9[_0xdd57('0x2')](_0x1cc8a3,_0x59078a);};}function removeListener(_0x1b9c2d,_0x22fb92){return function(){ChatWebsiteEvents['removeListener'](_0x1b9c2d,_0x22fb92);};}exports[_0xdd57('0x3')]=function(_0x413aaf){for(var _0x6814cc=0x0,_0xc5a076=events[_0xdd57('0x4')];_0x6814cc<_0xc5a076;_0x6814cc++){var _0x2e1e2e=events[_0x6814cc];var _0xb8236a=createListener(_0xdd57('0x5')+_0x2e1e2e,_0x413aaf);ChatWebsiteEvents['on'](_0x2e1e2e,_0xb8236a);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index 86a6bfa..a08924d 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 _0x004b=['/:id/offline','any','offline','addApplications','addProactiveActions','addAgents','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatWebsite.controller','get','index','isAuthenticated','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','/:id/users','getAgents','post','addDisposition','addAnswer','diskStorage','join','format','now','originalname','file','root','server/files/images/avatars/','single','%s-%s','/:id/notify','notify','server/files','attachments','offline-chat','ensureDir','replace'];(function(_0x4b3280,_0x2b3d50){var _0x4005c2=function(_0x16d705){while(--_0x16d705){_0x4b3280['push'](_0x4b3280['shift']());}};_0x4005c2(++_0x2b3d50);}(_0x004b,0x171));var _0xb004=function(_0x21b580,_0x5b7172){_0x21b580=_0x21b580-0x0;var _0x16a50e=_0x004b[_0x21b580];return _0x16a50e;};'use strict';var multer=require(_0xb004('0x0'));var util=require(_0xb004('0x1'));var path=require('path');var timeout=require(_0xb004('0x2'));var express=require(_0xb004('0x3'));var router=express[_0xb004('0x4')]();var fs_extra=require(_0xb004('0x5'));var auth=require(_0xb004('0x6'));var interaction=require(_0xb004('0x7'));var config=require('../../config/environment');var controller=require(_0xb004('0x8'));router[_0xb004('0x9')]('/',auth['isAuthenticated'](),controller[_0xb004('0xa')]);router[_0xb004('0x9')]('/describe',auth[_0xb004('0xb')](),controller[_0xb004('0xc')]);router[_0xb004('0x9')](_0xb004('0xd'),auth[_0xb004('0xb')](),controller[_0xb004('0xe')]);router[_0xb004('0x9')](_0xb004('0xf'),auth[_0xb004('0xb')](),controller[_0xb004('0x10')]);router[_0xb004('0x9')](_0xb004('0x11'),auth['isAuthenticated'](),controller[_0xb004('0x12')]);router[_0xb004('0x9')](_0xb004('0x13'),controller[_0xb004('0x14')]);router['get'](_0xb004('0x15'),controller['getAvatar']);router[_0xb004('0x9')](_0xb004('0x16'),controller[_0xb004('0x17')]);router[_0xb004('0x9')](_0xb004('0x18'),controller['getSystemAvatar']);router[_0xb004('0x9')](_0xb004('0x19'),auth[_0xb004('0xb')](),controller[_0xb004('0x1a')]);router[_0xb004('0x9')](_0xb004('0x1b'),controller[_0xb004('0x1c')]);router[_0xb004('0x9')](_0xb004('0x1d'),auth[_0xb004('0xb')](),controller['getApplications']);router[_0xb004('0x9')](_0xb004('0x1e'),auth['isAuthenticated'](),controller[_0xb004('0x1f')]);router[_0xb004('0x9')](_0xb004('0x20'),controller[_0xb004('0x21')]);router['get'](_0xb004('0x22'),auth[_0xb004('0xb')](),controller['getOfflineMessages']);router[_0xb004('0x9')](_0xb004('0x23'),auth[_0xb004('0xb')](),controller[_0xb004('0x24')]);router[_0xb004('0x25')]('/',auth[_0xb004('0xb')](),controller['create']);router[_0xb004('0x25')](_0xb004('0xf'),auth[_0xb004('0xb')](),controller[_0xb004('0x26')]);router[_0xb004('0x25')](_0xb004('0x11'),auth[_0xb004('0xb')](),controller[_0xb004('0x27')]);var upload=multer({'storage':multer[_0xb004('0x28')]({'destination':function(_0x51c11a,_0x277d06,_0xf8125e){_0xf8125e(null,path[_0xb004('0x29')](config['root'],'server/files/images/logos/'));},'filename':function(_0xcdaf85,_0x3f104b,_0x3aa826){_0x3aa826(null,util[_0xb004('0x2a')]('%s-%s',Date[_0xb004('0x2b')](),_0x3f104b[_0xb004('0x2c')]));}})});router[_0xb004('0x25')](_0xb004('0x13'),upload['single'](_0xb004('0x2d')),controller['addLogo']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x552e9c,_0x2d5fec,_0x18fb87){_0x18fb87(null,path['join'](config[_0xb004('0x2e')],_0xb004('0x2f')));},'filename':function(_0x5e08bb,_0x14a614,_0x32d0a5){_0x32d0a5(null,util['format']('%s-%s',Date['now'](),_0x14a614[_0xb004('0x2c')]));}})});router['post'](_0xb004('0x15'),upload[_0xb004('0x30')](_0xb004('0x2d')),controller['addAvatar']);var upload=multer({'storage':multer[_0xb004('0x28')]({'destination':function(_0x1fe02a,_0xdab94a,_0x3f1a5d){_0x3f1a5d(null,path[_0xb004('0x29')](config['root'],_0xb004('0x2f')));},'filename':function(_0x223094,_0x363f7a,_0x3afeba){_0x3afeba(null,util[_0xb004('0x2a')](_0xb004('0x31'),Date[_0xb004('0x2b')](),_0x363f7a[_0xb004('0x2c')]));}})});router[_0xb004('0x25')](_0xb004('0x16'),upload[_0xb004('0x30')](_0xb004('0x2d')),controller['addCustomerAvatar']);var upload=multer({'storage':multer[_0xb004('0x28')]({'destination':function(_0x4cc0fe,_0x5f07a6,_0x4a7f66){_0x4a7f66(null,path[_0xb004('0x29')](config[_0xb004('0x2e')],_0xb004('0x2f')));},'filename':function(_0x5e8747,_0x4b443d,_0x2261f5){_0x2261f5(null,util[_0xb004('0x2a')](_0xb004('0x31'),Date[_0xb004('0x2b')](),_0x4b443d[_0xb004('0x2c')]));}})});router[_0xb004('0x25')]('/:id/system_avatar',upload[_0xb004('0x30')](_0xb004('0x2d')),controller['addSystemAvatar']);router['post'](_0xb004('0x32'),controller[_0xb004('0x33')]);const offlineUploadMulter=multer({'storage':multer[_0xb004('0x28')]({'destination':function(_0x19b13e,_0x5c0038,_0x2d8dc2){const _0x3c0bf2=path[_0xb004('0x29')](config[_0xb004('0x2e')],_0xb004('0x34'),_0xb004('0x35'),_0xb004('0x36'));fs_extra[_0xb004('0x37')](_0x3c0bf2,function(){_0x2d8dc2(null,_0x3c0bf2);});},'filename':function(_0x588b32,_0x4b6989,_0x403e8a){const _0xd02bf8=_0x4b6989[_0xb004('0x2c')][_0xb004('0x38')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0xc5ac08=path['extname'](_0xd02bf8);const _0x4e27ef=Date[_0xb004('0x2b')]()+'-'+_0xd02bf8[_0xb004('0x38')](_0xc5ac08,'')+_0xc5ac08;_0x403e8a(null,_0x4e27ef);}})});router['post'](_0xb004('0x39'),offlineUploadMulter[_0xb004('0x3a')](),controller[_0xb004('0x3b')]);router['post'](_0xb004('0x19'),auth[_0xb004('0xb')](),controller['addInteraction']);router[_0xb004('0x25')]('/:id/applications',auth[_0xb004('0xb')](),controller[_0xb004('0x3c')]);router[_0xb004('0x25')]('/:id/proactive_actions',auth['isAuthenticated'](),controller[_0xb004('0x3d')]);router[_0xb004('0x25')](_0xb004('0x23'),auth[_0xb004('0xb')](),controller[_0xb004('0x3e')]);router[_0xb004('0x3f')](_0xb004('0xd'),auth[_0xb004('0xb')](),controller[_0xb004('0x40')]);router[_0xb004('0x41')](_0xb004('0xd'),auth[_0xb004('0xb')](),controller[_0xb004('0x42')]);router[_0xb004('0x41')](_0xb004('0xf'),auth['isAuthenticated'](),controller[_0xb004('0x43')]);router[_0xb004('0x41')](_0xb004('0x11'),auth[_0xb004('0xb')](),controller[_0xb004('0x44')]);router[_0xb004('0x41')](_0xb004('0x23'),auth[_0xb004('0xb')](),controller[_0xb004('0x45')]);module[_0xb004('0x46')]=router; \ No newline at end of file +var _0x8766=['./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','/:id/dispositions','getDispositions','/:id/canned_answers','getLogo','/:id/avatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','getSnippet','getApplications','/:id/proactive_actions','getProactiveActions','getFields','getAgents','post','create','addAnswer','diskStorage','join','root','server/files/images/logos/','format','%s-%s','now','single','file','addLogo','addAvatar','server/files/images/avatars/','originalname','addSystemAvatar','/:id/notify','notify','attachments','offline-chat','ensureDir','replace','extname','/:id/offline','any','offline','addApplications','addProactiveActions','/:id/users','addAgents','put','/:id','update','delete','removeDispositions','removeAnswers','removeAgents','exports','util','express','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x5b8dec,_0xad257e){var _0x126230=function(_0x3bde7c){while(--_0x3bde7c){_0x5b8dec['push'](_0x5b8dec['shift']());}};_0x126230(++_0xad257e);}(_0x8766,0x18d));var _0x6876=function(_0x388066,_0x29a913){_0x388066=_0x388066-0x0;var _0x3a0f16=_0x8766[_0x388066];return _0x3a0f16;};'use strict';var multer=require('multer');var util=require(_0x6876('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x6876('0x1'));var router=express['Router']();var fs_extra=require(_0x6876('0x2'));var auth=require(_0x6876('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x6876('0x4'));var controller=require(_0x6876('0x5'));router[_0x6876('0x6')]('/',auth[_0x6876('0x7')](),controller[_0x6876('0x8')]);router[_0x6876('0x6')](_0x6876('0x9'),auth['isAuthenticated'](),controller[_0x6876('0xa')]);router[_0x6876('0x6')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x6876('0x6')](_0x6876('0xb'),auth[_0x6876('0x7')](),controller[_0x6876('0xc')]);router[_0x6876('0x6')](_0x6876('0xd'),auth['isAuthenticated'](),controller['getAnswers']);router['get']('/:id/logo',controller[_0x6876('0xe')]);router[_0x6876('0x6')](_0x6876('0xf'),controller['getAvatar']);router['get'](_0x6876('0x10'),controller[_0x6876('0x11')]);router[_0x6876('0x6')](_0x6876('0x12'),controller[_0x6876('0x13')]);router[_0x6876('0x6')](_0x6876('0x14'),auth[_0x6876('0x7')](),controller[_0x6876('0x15')]);router[_0x6876('0x6')]('/:id/snippet',controller[_0x6876('0x16')]);router[_0x6876('0x6')]('/:id/applications',auth[_0x6876('0x7')](),controller[_0x6876('0x17')]);router[_0x6876('0x6')](_0x6876('0x18'),auth[_0x6876('0x7')](),controller[_0x6876('0x19')]);router[_0x6876('0x6')]('/:id/fields',controller[_0x6876('0x1a')]);router[_0x6876('0x6')]('/:id/offline_messages',auth[_0x6876('0x7')](),controller['getOfflineMessages']);router[_0x6876('0x6')]('/:id/users',auth['isAuthenticated'](),controller[_0x6876('0x1b')]);router[_0x6876('0x1c')]('/',auth['isAuthenticated'](),controller[_0x6876('0x1d')]);router[_0x6876('0x1c')](_0x6876('0xb'),auth[_0x6876('0x7')](),controller['addDisposition']);router['post'](_0x6876('0xd'),auth['isAuthenticated'](),controller[_0x6876('0x1e')]);var upload=multer({'storage':multer[_0x6876('0x1f')]({'destination':function(_0x467af6,_0x47a358,_0x148619){_0x148619(null,path[_0x6876('0x20')](config[_0x6876('0x21')],_0x6876('0x22')));},'filename':function(_0x5070d5,_0x186e2c,_0x5616f7){_0x5616f7(null,util[_0x6876('0x23')](_0x6876('0x24'),Date[_0x6876('0x25')](),_0x186e2c['originalname']));}})});router[_0x6876('0x1c')]('/:id/logo',upload[_0x6876('0x26')](_0x6876('0x27')),controller[_0x6876('0x28')]);var upload=multer({'storage':multer[_0x6876('0x1f')]({'destination':function(_0x54a57f,_0x55ad4c,_0x34ed48){_0x34ed48(null,path[_0x6876('0x20')](config[_0x6876('0x21')],'server/files/images/avatars/'));},'filename':function(_0x2deaa5,_0x33ada0,_0x4f2f3c){_0x4f2f3c(null,util[_0x6876('0x23')](_0x6876('0x24'),Date[_0x6876('0x25')](),_0x33ada0['originalname']));}})});router[_0x6876('0x1c')](_0x6876('0xf'),upload[_0x6876('0x26')](_0x6876('0x27')),controller[_0x6876('0x29')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xeec09a,_0x59ca08,_0x5de722){_0x5de722(null,path[_0x6876('0x20')](config[_0x6876('0x21')],_0x6876('0x2a')));},'filename':function(_0x4820e5,_0x262f8e,_0x385251){_0x385251(null,util[_0x6876('0x23')](_0x6876('0x24'),Date['now'](),_0x262f8e[_0x6876('0x2b')]));}})});router[_0x6876('0x1c')](_0x6876('0x10'),upload[_0x6876('0x26')](_0x6876('0x27')),controller['addCustomerAvatar']);var upload=multer({'storage':multer[_0x6876('0x1f')]({'destination':function(_0x2869a9,_0x69eeec,_0x206a6c){_0x206a6c(null,path[_0x6876('0x20')](config[_0x6876('0x21')],_0x6876('0x2a')));},'filename':function(_0x12182a,_0x278920,_0x12510c){_0x12510c(null,util[_0x6876('0x23')](_0x6876('0x24'),Date[_0x6876('0x25')](),_0x278920['originalname']));}})});router[_0x6876('0x1c')](_0x6876('0x12'),upload[_0x6876('0x26')](_0x6876('0x27')),controller[_0x6876('0x2c')]);router['post'](_0x6876('0x2d'),controller[_0x6876('0x2e')]);const offlineUploadMulter=multer({'storage':multer[_0x6876('0x1f')]({'destination':function(_0x4f7ed3,_0x2679b5,_0x2a7c61){const _0x6bfdf9=path[_0x6876('0x20')](config[_0x6876('0x21')],'server/files',_0x6876('0x2f'),_0x6876('0x30'));fs_extra[_0x6876('0x31')](_0x6bfdf9,function(){_0x2a7c61(null,_0x6bfdf9);});},'filename':function(_0x12af02,_0x4cbe58,_0x6ba979){const _0x18f34f=_0x4cbe58[_0x6876('0x2b')][_0x6876('0x32')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x15d175=path[_0x6876('0x33')](_0x18f34f);const _0x8fb588=Date[_0x6876('0x25')]()+'-'+_0x18f34f[_0x6876('0x32')](_0x15d175,'')+_0x15d175;_0x6ba979(null,_0x8fb588);}})});router['post'](_0x6876('0x34'),offlineUploadMulter[_0x6876('0x35')](),controller[_0x6876('0x36')]);router['post'](_0x6876('0x14'),auth[_0x6876('0x7')](),controller['addInteraction']);router[_0x6876('0x1c')]('/:id/applications',auth[_0x6876('0x7')](),controller[_0x6876('0x37')]);router[_0x6876('0x1c')](_0x6876('0x18'),auth[_0x6876('0x7')](),controller[_0x6876('0x38')]);router['post'](_0x6876('0x39'),auth[_0x6876('0x7')](),controller[_0x6876('0x3a')]);router[_0x6876('0x3b')](_0x6876('0x3c'),auth[_0x6876('0x7')](),controller[_0x6876('0x3d')]);router[_0x6876('0x3e')](_0x6876('0x3c'),auth['isAuthenticated'](),controller['destroy']);router[_0x6876('0x3e')](_0x6876('0xb'),auth[_0x6876('0x7')](),controller[_0x6876('0x3f')]);router[_0x6876('0x3e')]('/:id/canned_answers',auth[_0x6876('0x7')](),controller[_0x6876('0x40')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0x6876('0x41')]);module[_0x6876('0x42')]=router; \ No newline at end of file diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js index aa6ae81..c14d633 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 _0x4ea5=['use','isAuthenticated','exports','beaver-logger/server','../config/environment','Router','env','app','get','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs'];(function(_0x2ae2ad,_0xac5b0c){var _0x26dbd7=function(_0x5e685b){while(--_0x5e685b){_0x2ae2ad['push'](_0x2ae2ad['shift']());}};_0x26dbd7(++_0xac5b0c);}(_0x4ea5,0xd3));var _0x54ea=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0x4ea5[_0x550d12];return _0x12103d;};var beaverLogger=require(_0x54ea('0x0'));var express=require('express');var auth=require('../components/auth/service');var config=require(_0x54ea('0x1'));var router=express[_0x54ea('0x2')]();var isProduction=config[_0x54ea('0x3')]==='production'||![];function clientSideLogs(_0x47b7f5,_0x4dc268,_0xa6a5ed){var _0x1dc925=_0x47b7f5[_0x54ea('0x4')][_0x54ea('0x5')](_0x54ea('0x6'));if(!_0x1dc925){throw new Error(_0x54ea('0x7'));}return beaverLogger[_0x54ea('0x8')]({'uri':_0x54ea('0x9'),'logger':_0x1dc925,'enableCors':!isProduction})(_0x47b7f5,_0x4dc268,_0xa6a5ed);}router[_0x54ea('0xa')](auth[_0x54ea('0xb')](),clientSideLogs);module[_0x54ea('0xc')]=router; \ No newline at end of file +var _0x1894=['production','app','get','client-side-logger','Client-Side\x20logger\x20not\x20found!','/client-logs','use','exports','beaver-logger/server','../config/environment','Router'];(function(_0x39b30e,_0x59c69d){var _0x5bd14d=function(_0x358281){while(--_0x358281){_0x39b30e['push'](_0x39b30e['shift']());}};_0x5bd14d(++_0x59c69d);}(_0x1894,0x126));var _0x4189=function(_0x3cae69,_0x233c38){_0x3cae69=_0x3cae69-0x0;var _0x3128eb=_0x1894[_0x3cae69];return _0x3128eb;};var beaverLogger=require(_0x4189('0x0'));var express=require('express');var auth=require('../components/auth/service');var config=require(_0x4189('0x1'));var router=express[_0x4189('0x2')]();var isProduction=config['env']===_0x4189('0x3')||![];function clientSideLogs(_0x28542a,_0x5306f6,_0x593352){var _0x49334e=_0x28542a[_0x4189('0x4')][_0x4189('0x5')](_0x4189('0x6'));if(!_0x49334e){throw new Error(_0x4189('0x7'));}return beaverLogger['expressEndpoint']({'uri':_0x4189('0x8'),'logger':_0x49334e,'enableCors':!isProduction})(_0x28542a,_0x5306f6,_0x593352);}router[_0x4189('0x9')](auth['isAuthenticated'](),clientSideLogs);module[_0x4189('0xa')]=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index 2f71b6e..f9e5eeb 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 _0xdcce=['ENUM','AmazonAWS','Google','MicrosoftAzure','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING'];(function(_0x19f094,_0x53af25){var _0x122ad5=function(_0x29dd24){while(--_0x29dd24){_0x19f094['push'](_0x19f094['shift']());}};_0x122ad5(++_0x53af25);}(_0xdcce,0xad));var _0xedcc=function(_0x2d1e90,_0x359a52){_0x2d1e90=_0x2d1e90-0x0;var _0x3c168b=_0xdcce[_0x2d1e90];return _0x3c168b;};'use strict';var Sequelize=require(_0xedcc('0x0'));module[_0xedcc('0x1')]={'name':{'type':Sequelize[_0xedcc('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xedcc('0x3')](_0xedcc('0x4'),_0xedcc('0x5'),_0xedcc('0x6')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xedcc('0x3')](_0xedcc('0x7'),_0xedcc('0x8'))},'data1':{'type':Sequelize[_0xedcc('0x2')],'comment':_0xedcc('0x9')},'data2':{'type':Sequelize[_0xedcc('0x2')],'comment':_0xedcc('0xa')},'data3':{'type':Sequelize['STRING'],'comment':_0xedcc('0xb')},'data4':{'type':Sequelize[_0xedcc('0x2')],'comment':_0xedcc('0xc')},'data5':{'type':Sequelize[_0xedcc('0xd')],'comment':_0xedcc('0xe')},'data6':{'type':Sequelize[_0xedcc('0xd')],'comment':'MicrosoftAzure\x20=>\x20refresh_token'},'data7':{'type':Sequelize[_0xedcc('0xd')],'comment':_0xedcc('0xf')}}; \ No newline at end of file +var _0x4804=['MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','ENUM','AmazonAWS','Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20access_token','TEXT'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x4804,0x92));var _0x4480=function(_0x8679fc,_0x37834a){_0x8679fc=_0x8679fc-0x0;var _0x4c3a4e=_0x4804[_0x8679fc];return _0x4c3a4e;};'use strict';var Sequelize=require(_0x4480('0x0'));module[_0x4480('0x1')]={'name':{'type':Sequelize[_0x4480('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x4480('0x3')](_0x4480('0x4'),'Google','MicrosoftAzure'),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x4480('0x3')]('Outlook365',_0x4480('0x5'))},'data1':{'type':Sequelize['STRING'],'comment':_0x4480('0x6')},'data2':{'type':Sequelize[_0x4480('0x2')],'comment':'MicrosoftAzure\x20=>\x20tenant'},'data3':{'type':Sequelize['STRING'],'comment':_0x4480('0x7')},'data4':{'type':Sequelize[_0x4480('0x2')],'comment':'MicrosoftAzure\x20=>\x20redirect_uri'},'data5':{'type':Sequelize['TEXT'],'comment':_0x4480('0x8')},'data6':{'type':Sequelize[_0x4480('0x9')],'comment':_0x4480('0xa')},'data7':{'type':Sequelize['TEXT'],'comment':_0x4480('0xb')}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index 9cbcaab..0516a0a 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 _0xdef4=['filters','attributes','fields','length','hasOwnProperty','order','sort','where','pick','VIRTUAL','filter','merge','include','findAll','decryptString','data3','params','rawAttributes','intersection','includeAll','options','find','MicrosoftAzure','catch','body','Name\x20parameter\x20not\x20specified','service','Service\x20parameter\x20not\x20specified','values','join','encryptString','oauth2MicrosoftAuthorize','findOne','user','oauth2MicrosoftCallback','get','state','parse','from','base64','toString','ascii','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','data5','data6','startRefreshInterval','emit','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','lodash','ioredis','../../components/encryptor','../../config/environment','api','../../mysqldb','./cloudProvider.oauth','redis','defaults','localhost','socket.io-emitter','status','end','json','undefined','limit','count','offset','update','then','destroy','sendStatus','error','stack','name','send','padEnd','slice','index','map','CloudProvider','type','key','model','query','keys'];(function(_0x52740f,_0x343961){var _0x1cbe11=function(_0x376976){while(--_0x376976){_0x52740f['push'](_0x52740f['shift']());}};_0x1cbe11(++_0x343961);}(_0xdef4,0x94));var _0x4def=function(_0x24eab8,_0x2f471c){_0x24eab8=_0x24eab8-0x0;var _0x41d883=_0xdef4[_0x24eab8];return _0x41d883;};'use strict';var _=require(_0x4def('0x0'));var Redis=require(_0x4def('0x1'));var qs=require('../../components/parsers/qs');var encryptor=require(_0x4def('0x2'));var config=require(_0x4def('0x3'));var logger=require('../../config/logger')(_0x4def('0x4'));var db=require(_0x4def('0x5'))['db'];var oauth=require(_0x4def('0x6'));config[_0x4def('0x7')]=_[_0x4def('0x8')](config['redis'],{'host':_0x4def('0x9'),'port':0x18eb});var socket=require(_0x4def('0xa'))(new Redis(config['redis']));var redis=new Redis(config[_0x4def('0x7')]);function respondWithStatusCode(_0x2697b7,_0x4db75e){_0x4db75e=_0x4db75e||0xcc;return function(_0x18cb56){if(_0x18cb56){return _0x2697b7['sendStatus'](_0x4db75e);}return _0x2697b7[_0x4def('0xb')](_0x4db75e)[_0x4def('0xc')]();};}function respondWithResult(_0x2f479d,_0x140490){_0x140490=_0x140490||0xc8;return function(_0x3128c7){if(_0x3128c7){return _0x2f479d[_0x4def('0xb')](_0x140490)[_0x4def('0xd')](_0x3128c7);}};}function respondWithFilteredResult(_0x4ab486,_0x3e222c){return function(_0x3c50c6){if(_0x3c50c6){var _0x178869=typeof _0x3e222c['offset']===_0x4def('0xe')&&typeof _0x3e222c[_0x4def('0xf')]===_0x4def('0xe');var _0x3556e2=_0x3c50c6[_0x4def('0x10')];var _0x3b623b=_0x178869?0x0:_0x3e222c[_0x4def('0x11')];var _0x467b18=_0x178869?_0x3c50c6['count']:_0x3e222c[_0x4def('0x11')]+_0x3e222c[_0x4def('0xf')];var _0x4b0d08;if(_0x467b18>=_0x3556e2){_0x467b18=_0x3556e2;_0x4b0d08=0xc8;}else{_0x4b0d08=0xce;}_0x4ab486[_0x4def('0xb')](_0x4b0d08);return _0x4ab486['set']('Content-Range',_0x3b623b+'-'+_0x467b18+'/'+_0x3556e2)[_0x4def('0xd')](_0x3c50c6);}return null;};}function saveUpdates(_0x22ba32){return function(_0x1b88f2){if(_0x1b88f2){return _0x1b88f2[_0x4def('0x12')](_0x22ba32)[_0x4def('0x13')](function(_0x7712b1){return _0x7712b1;});}return null;};}function removeEntity(_0x2ed17f){return function(_0x5733d0){if(_0x5733d0){return _0x5733d0[_0x4def('0x14')]()[_0x4def('0x13')](function(){_0x2ed17f['status'](0xcc)[_0x4def('0xc')]();});}};}function handleEntityNotFound(_0x59e14a){return function(_0x188fd2){if(!_0x188fd2){_0x59e14a[_0x4def('0x15')](0x194);}return _0x188fd2;};}function handleError(_0x37e188,_0x255779){_0x255779=_0x255779||0x1f4;return function(_0x5337a7){logger[_0x4def('0x16')](_0x5337a7[_0x4def('0x17')]);if(_0x5337a7[_0x4def('0x18')]){delete _0x5337a7['name'];}_0x37e188[_0x4def('0xb')](_0x255779)[_0x4def('0x19')](_0x5337a7);};}function maskClientSecret(_0x4ba3f9){return _[_0x4def('0x1a')](_0x4ba3f9[_0x4def('0x1b')](0x0,0x3),0x14,'*');}exports[_0x4def('0x1c')]=function(_0x508eab,_0x33bbde){var _0x2c1232={},_0x1cc6dd={},_0x336314={'count':0x0,'rows':[]};var _0x39663d=_[_0x4def('0x1d')](db[_0x4def('0x1e')]['rawAttributes'],function(_0x37eac4){return{'name':_0x37eac4['fieldName'],'type':_0x37eac4[_0x4def('0x1f')][_0x4def('0x20')]};});_0x1cc6dd[_0x4def('0x21')]=_[_0x4def('0x1d')](_0x39663d,_0x4def('0x18'));_0x1cc6dd[_0x4def('0x22')]=_[_0x4def('0x23')](_0x508eab[_0x4def('0x22')]);_0x1cc6dd[_0x4def('0x24')]=_['intersection'](_0x1cc6dd['model'],_0x1cc6dd[_0x4def('0x22')]);_0x2c1232[_0x4def('0x25')]=_['intersection'](_0x1cc6dd['model'],qs[_0x4def('0x26')](_0x508eab[_0x4def('0x22')]['fields']));_0x2c1232['attributes']=_0x2c1232[_0x4def('0x25')][_0x4def('0x27')]?_0x2c1232[_0x4def('0x25')]:_0x1cc6dd['model'];if(!_0x508eab['query'][_0x4def('0x28')]('nolimit')){_0x2c1232[_0x4def('0xf')]=qs[_0x4def('0xf')](_0x508eab['query'][_0x4def('0xf')]);_0x2c1232[_0x4def('0x11')]=qs[_0x4def('0x11')](_0x508eab[_0x4def('0x22')][_0x4def('0x11')]);}_0x2c1232[_0x4def('0x29')]=qs[_0x4def('0x2a')](_0x508eab['query'][_0x4def('0x2a')]);_0x2c1232[_0x4def('0x2b')]=qs[_0x4def('0x24')](_[_0x4def('0x2c')](_0x508eab[_0x4def('0x22')],_0x1cc6dd[_0x4def('0x24')]),_0x39663d);if(_0x508eab[_0x4def('0x22')]['filter']){_0x2c1232[_0x4def('0x2b')]=_['merge'](_0x2c1232[_0x4def('0x2b')],{'$or':_['map'](_0x39663d,function(_0x59fa5){if(_0x59fa5[_0x4def('0x1f')]!==_0x4def('0x2d')){var _0x345e32={};_0x345e32[_0x59fa5['name']]={'$like':'%'+_0x508eab[_0x4def('0x22')][_0x4def('0x2e')]+'%'};return _0x345e32;}})});}_0x2c1232=_[_0x4def('0x2f')]({},_0x2c1232,_0x508eab['options']);var _0x323840={'where':_0x2c1232[_0x4def('0x2b')]};return db[_0x4def('0x1e')][_0x4def('0x10')](_0x323840)[_0x4def('0x13')](function(_0x537178){_0x336314[_0x4def('0x10')]=_0x537178;if(_0x508eab[_0x4def('0x22')]['includeAll']){_0x2c1232[_0x4def('0x30')]=[{'all':!![]}];}return db[_0x4def('0x1e')][_0x4def('0x31')](_0x2c1232);})[_0x4def('0x13')](function(_0x3d46c6){_0x336314['rows']=_[_0x4def('0x1d')](_0x3d46c6,function(_0x26879a){if(_0x26879a['service']==='MicrosoftAzure'){var _0x6b8329=encryptor[_0x4def('0x32')](_0x26879a[_0x4def('0x33')]);_0x26879a[_0x4def('0x33')]=maskClientSecret(_0x6b8329);}return _0x26879a;});return _0x336314;})['then'](respondWithFilteredResult(_0x33bbde,_0x2c1232))['catch'](handleError(_0x33bbde,null));};exports['show']=function(_0x5285b6,_0x2e741b){var _0x58b952={'raw':!![],'where':{'id':_0x5285b6[_0x4def('0x34')]['id']}},_0x5adf12={};_0x5adf12[_0x4def('0x21')]=_['keys'](db[_0x4def('0x1e')][_0x4def('0x35')]);_0x5adf12['query']=_['keys'](_0x5285b6[_0x4def('0x22')]);_0x5adf12[_0x4def('0x24')]=_[_0x4def('0x36')](_0x5adf12[_0x4def('0x21')],_0x5adf12[_0x4def('0x22')]);_0x58b952[_0x4def('0x25')]=_[_0x4def('0x36')](_0x5adf12['model'],qs[_0x4def('0x26')](_0x5285b6['query']['fields']));_0x58b952[_0x4def('0x25')]=_0x58b952[_0x4def('0x25')][_0x4def('0x27')]?_0x58b952[_0x4def('0x25')]:_0x5adf12['model'];if(_0x5285b6['query'][_0x4def('0x37')]){_0x58b952[_0x4def('0x30')]=[{'all':!![]}];}_0x58b952=_[_0x4def('0x2f')]({},_0x58b952,_0x5285b6[_0x4def('0x38')]);return db[_0x4def('0x1e')][_0x4def('0x39')](_0x58b952)[_0x4def('0x13')](handleEntityNotFound(_0x2e741b,null))[_0x4def('0x13')](function(_0x37f18d){if(_0x37f18d['service']===_0x4def('0x3a')){var _0x2cd938=encryptor[_0x4def('0x32')](_0x37f18d[_0x4def('0x33')]);_0x37f18d[_0x4def('0x33')]=maskClientSecret(_0x2cd938);}return _0x37f18d;})[_0x4def('0x13')](respondWithResult(_0x2e741b,null))[_0x4def('0x3b')](handleError(_0x2e741b,null));};exports['create']=function(_0x4e538f,_0xa38611){if(!_0x4e538f[_0x4def('0x3c')][_0x4def('0x18')])throw new Error(_0x4def('0x3d'));if(!_0x4e538f[_0x4def('0x3c')][_0x4def('0x3e')])throw new Error(_0x4def('0x3f'));var _0x263791=db['CloudProvider'][_0x4def('0x35')]['service'][_0x4def('0x40')];if(!_0x263791['includes'](_0x4e538f[_0x4def('0x3c')]['service']))throw new Error('Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20'+_0x263791[_0x4def('0x41')](',\x20'));if(_0x4e538f[_0x4def('0x3c')][_0x4def('0x3e')]===_0x4def('0x3a')&&_0x4e538f[_0x4def('0x3c')][_0x4def('0x33')]){_0x4e538f[_0x4def('0x3c')][_0x4def('0x33')]=encryptor[_0x4def('0x42')](_0x4e538f[_0x4def('0x3c')]['data3']);}return db[_0x4def('0x1e')]['create'](_0x4e538f[_0x4def('0x3c')],{})[_0x4def('0x13')](respondWithResult(_0xa38611,0xc9))[_0x4def('0x3b')](handleError(_0xa38611,null));};exports[_0x4def('0x12')]=function(_0xb0d201,_0x1b2af0){if(_0xb0d201[_0x4def('0x3c')]['id']){delete _0xb0d201[_0x4def('0x3c')]['id'];}return db['CloudProvider']['find']({'where':{'id':_0xb0d201[_0x4def('0x34')]['id']}})['then'](handleEntityNotFound(_0x1b2af0,null))[_0x4def('0x13')](function(_0x142f11){if(_0x142f11['service']===_0x4def('0x3a')&&_0xb0d201['body']['data3']){_0xb0d201[_0x4def('0x3c')][_0x4def('0x33')]=encryptor[_0x4def('0x42')](_0xb0d201[_0x4def('0x3c')][_0x4def('0x33')]);}return _0x142f11;})[_0x4def('0x13')](saveUpdates(_0xb0d201[_0x4def('0x3c')],null))[_0x4def('0x13')](respondWithResult(_0x1b2af0,null))[_0x4def('0x3b')](handleError(_0x1b2af0,null));};exports[_0x4def('0x14')]=function(_0x4cc7b7,_0x202d4f){return db[_0x4def('0x1e')]['find']({'where':{'id':_0x4cc7b7[_0x4def('0x34')]['id']}})[_0x4def('0x13')](handleEntityNotFound(_0x202d4f,null))['then'](removeEntity(_0x202d4f,null))[_0x4def('0x3b')](handleError(_0x202d4f,null));};exports[_0x4def('0x43')]=function(_0x44cbb2,_0x2c403c){return db[_0x4def('0x1e')][_0x4def('0x44')]({'where':{'id':_0x44cbb2['params']['id']},'raw':!![]})['then'](function(_0xdc8b04){if(!_0xdc8b04)return _0x2c403c[_0x4def('0x15')](0x194);return{'url':oauth['generateMicrosoftAuthorizationUrl'](_0xdc8b04,_0x44cbb2[_0x4def('0x45')]['id'])};})[_0x4def('0x13')](respondWithResult(_0x2c403c,null))['catch'](handleError(_0x2c403c,null));};exports[_0x4def('0x46')]=function(_0x51b32a,_0x1d8d01){var _0x4a258c=_0x51b32a[_0x4def('0x3c')];var _0x577c03;var _0xe99e98;if(_0x4a258c[_0x4def('0x16')])throw _0x4a258c;redis[_0x4def('0x47')](_0x4a258c[_0x4def('0x48')])['then'](function(_0x20f774){if(!_0x20f774)throw new Error('Invalid\x20state\x20parameter');_0x577c03=JSON[_0x4def('0x49')](_0x20f774);var _0x5d06f8=Buffer[_0x4def('0x4a')](_0x4a258c[_0x4def('0x48')],_0x4def('0x4b'))[_0x4def('0x4c')](_0x4def('0x4d'));_0xe99e98=JSON[_0x4def('0x49')](_0x5d06f8);if(!oauth[_0x4def('0x4e')](_0x4a258c[_0x4def('0x4f')],_0x577c03[_0x4def('0x50')]))throw new Error(_0x4def('0x51'));redis[_0x4def('0x52')](_0x4a258c[_0x4def('0x48')]);return oauth[_0x4def('0x53')](_0x4a258c['code'],_0x577c03);})[_0x4def('0x13')](function(_0x239421){_0x577c03[_0x4def('0x54')]=_0x239421['access_token'];_0x577c03['data6']=_0x239421['refresh_token'];return db[_0x4def('0x1e')][_0x4def('0x12')]({'data5':_0x577c03[_0x4def('0x54')],'data6':_0x577c03[_0x4def('0x55')]},{'where':{'id':_0x577c03['id']}});})[_0x4def('0x13')](function(){oauth[_0x4def('0x56')](_0x577c03);socket[_0x4def('0x57')]('microsoftAuthorization:success',{'id':_0xe99e98['id']});return;})[_0x4def('0x13')](respondWithStatusCode(_0x1d8d01,null))[_0x4def('0x3b')](function(_0x429bcc){if(_0xe99e98){socket[_0x4def('0x57')](_0x4def('0x58'),{'id':_0xe99e98['id']});}if(!_0x577c03){logger[_0x4def('0x16')](_0x4def('0x59'),_0x429bcc);return _0x1d8d01['status'](0x1f4)[_0x4def('0x19')](_0x429bcc[_0x4def('0x5a')]);}logger['error'](_0x4def('0x5b'),_0x577c03['id'],JSON['stringify'](_0x429bcc));});}; \ No newline at end of file +var _0x07fb=['send','padEnd','slice','index','map','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','CloudProvider','includeAll','include','findAll','service','MicrosoftAzure','decryptString','data3','catch','find','body','Name\x20parameter\x20not\x20specified','includes','join','create','update','params','encryptString','oauth2MicrosoftAuthorize','sendStatus','generateMicrosoftAuthorizationUrl','oauth2MicrosoftCallback','state','parse','from','base64','ascii','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','code','data5','access_token','data6','startRefreshInterval','emit','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','../../config/environment','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','redis','localhost','socket.io-emitter','status','json','offset','undefined','count','limit','Content-Range','then','destroy','error','stack','name'];(function(_0x57d13b,_0x52d8cb){var _0x467696=function(_0x153000){while(--_0x153000){_0x57d13b['push'](_0x57d13b['shift']());}};_0x467696(++_0x52d8cb);}(_0x07fb,0x14b));var _0xb07f=function(_0x1f69a2,_0x5ebeb8){_0x1f69a2=_0x1f69a2-0x0;var _0x899ef4=_0x07fb[_0x1f69a2];return _0x899ef4;};'use strict';var _=require(_0xb07f('0x0'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var encryptor=require('../../components/encryptor');var config=require(_0xb07f('0x1'));var logger=require(_0xb07f('0x2'))(_0xb07f('0x3'));var db=require(_0xb07f('0x4'))['db'];var oauth=require(_0xb07f('0x5'));config['redis']=_['defaults'](config[_0xb07f('0x6')],{'host':_0xb07f('0x7'),'port':0x18eb});var socket=require(_0xb07f('0x8'))(new Redis(config[_0xb07f('0x6')]));var redis=new Redis(config['redis']);function respondWithStatusCode(_0x2d8fed,_0x307156){_0x307156=_0x307156||0xcc;return function(_0x2bc193){if(_0x2bc193){return _0x2d8fed['sendStatus'](_0x307156);}return _0x2d8fed[_0xb07f('0x9')](_0x307156)['end']();};}function respondWithResult(_0x437fd4,_0x1fe4ce){_0x1fe4ce=_0x1fe4ce||0xc8;return function(_0x223671){if(_0x223671){return _0x437fd4[_0xb07f('0x9')](_0x1fe4ce)[_0xb07f('0xa')](_0x223671);}};}function respondWithFilteredResult(_0x2f0b63,_0x2e6b94){return function(_0x48dc1b){if(_0x48dc1b){var _0x1a8cbf=typeof _0x2e6b94[_0xb07f('0xb')]==='undefined'&&typeof _0x2e6b94['limit']===_0xb07f('0xc');var _0x161527=_0x48dc1b[_0xb07f('0xd')];var _0x3d08ca=_0x1a8cbf?0x0:_0x2e6b94[_0xb07f('0xb')];var _0x16c631=_0x1a8cbf?_0x48dc1b[_0xb07f('0xd')]:_0x2e6b94[_0xb07f('0xb')]+_0x2e6b94[_0xb07f('0xe')];var _0x4a0c80;if(_0x16c631>=_0x161527){_0x16c631=_0x161527;_0x4a0c80=0xc8;}else{_0x4a0c80=0xce;}_0x2f0b63[_0xb07f('0x9')](_0x4a0c80);return _0x2f0b63['set'](_0xb07f('0xf'),_0x3d08ca+'-'+_0x16c631+'/'+_0x161527)['json'](_0x48dc1b);}return null;};}function saveUpdates(_0x101173){return function(_0x4be27d){if(_0x4be27d){return _0x4be27d['update'](_0x101173)[_0xb07f('0x10')](function(_0x13ff66){return _0x13ff66;});}return null;};}function removeEntity(_0x3340c3){return function(_0x691d9f){if(_0x691d9f){return _0x691d9f[_0xb07f('0x11')]()['then'](function(){_0x3340c3['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x7fc5b8){return function(_0x23e403){if(!_0x23e403){_0x7fc5b8['sendStatus'](0x194);}return _0x23e403;};}function handleError(_0x2731ae,_0x2a0e5c){_0x2a0e5c=_0x2a0e5c||0x1f4;return function(_0x41ff50){logger[_0xb07f('0x12')](_0x41ff50[_0xb07f('0x13')]);if(_0x41ff50[_0xb07f('0x14')]){delete _0x41ff50[_0xb07f('0x14')];}_0x2731ae[_0xb07f('0x9')](_0x2a0e5c)[_0xb07f('0x15')](_0x41ff50);};}function maskClientSecret(_0x4c8b57){return _[_0xb07f('0x16')](_0x4c8b57[_0xb07f('0x17')](0x0,0x3),0x14,'*');}exports[_0xb07f('0x18')]=function(_0x38578d,_0x151ef2){var _0x368372={},_0x4f0a87={},_0x2a4ec0={'count':0x0,'rows':[]};var _0x7e4382=_[_0xb07f('0x19')](db['CloudProvider'][_0xb07f('0x1a')],function(_0x4778d8){return{'name':_0x4778d8['fieldName'],'type':_0x4778d8['type']['key']};});_0x4f0a87[_0xb07f('0x1b')]=_[_0xb07f('0x19')](_0x7e4382,_0xb07f('0x14'));_0x4f0a87['query']=_[_0xb07f('0x1c')](_0x38578d[_0xb07f('0x1d')]);_0x4f0a87[_0xb07f('0x1e')]=_[_0xb07f('0x1f')](_0x4f0a87[_0xb07f('0x1b')],_0x4f0a87[_0xb07f('0x1d')]);_0x368372[_0xb07f('0x20')]=_[_0xb07f('0x1f')](_0x4f0a87[_0xb07f('0x1b')],qs['fields'](_0x38578d[_0xb07f('0x1d')][_0xb07f('0x21')]));_0x368372[_0xb07f('0x20')]=_0x368372[_0xb07f('0x20')][_0xb07f('0x22')]?_0x368372[_0xb07f('0x20')]:_0x4f0a87['model'];if(!_0x38578d[_0xb07f('0x1d')][_0xb07f('0x23')]('nolimit')){_0x368372[_0xb07f('0xe')]=qs[_0xb07f('0xe')](_0x38578d[_0xb07f('0x1d')][_0xb07f('0xe')]);_0x368372[_0xb07f('0xb')]=qs[_0xb07f('0xb')](_0x38578d[_0xb07f('0x1d')][_0xb07f('0xb')]);}_0x368372[_0xb07f('0x24')]=qs[_0xb07f('0x25')](_0x38578d[_0xb07f('0x1d')][_0xb07f('0x25')]);_0x368372[_0xb07f('0x26')]=qs[_0xb07f('0x1e')](_[_0xb07f('0x27')](_0x38578d[_0xb07f('0x1d')],_0x4f0a87[_0xb07f('0x1e')]),_0x7e4382);if(_0x38578d[_0xb07f('0x1d')][_0xb07f('0x28')]){_0x368372[_0xb07f('0x26')]=_[_0xb07f('0x29')](_0x368372[_0xb07f('0x26')],{'$or':_[_0xb07f('0x19')](_0x7e4382,function(_0x2bff83){if(_0x2bff83[_0xb07f('0x2a')]!==_0xb07f('0x2b')){var _0x504e69={};_0x504e69[_0x2bff83[_0xb07f('0x14')]]={'$like':'%'+_0x38578d[_0xb07f('0x1d')][_0xb07f('0x28')]+'%'};return _0x504e69;}})});}_0x368372=_[_0xb07f('0x29')]({},_0x368372,_0x38578d[_0xb07f('0x2c')]);var _0x300afc={'where':_0x368372['where']};return db[_0xb07f('0x2d')]['count'](_0x300afc)[_0xb07f('0x10')](function(_0x48ebb5){_0x2a4ec0[_0xb07f('0xd')]=_0x48ebb5;if(_0x38578d[_0xb07f('0x1d')][_0xb07f('0x2e')]){_0x368372[_0xb07f('0x2f')]=[{'all':!![]}];}return db['CloudProvider'][_0xb07f('0x30')](_0x368372);})[_0xb07f('0x10')](function(_0x5a0ff8){_0x2a4ec0['rows']=_[_0xb07f('0x19')](_0x5a0ff8,function(_0x225c68){if(_0x225c68[_0xb07f('0x31')]===_0xb07f('0x32')){var _0x23cde4=encryptor[_0xb07f('0x33')](_0x225c68[_0xb07f('0x34')]);_0x225c68[_0xb07f('0x34')]=maskClientSecret(_0x23cde4);}return _0x225c68;});return _0x2a4ec0;})[_0xb07f('0x10')](respondWithFilteredResult(_0x151ef2,_0x368372))[_0xb07f('0x35')](handleError(_0x151ef2,null));};exports['show']=function(_0x29ec82,_0x5a6f40){var _0x4384f1={'raw':!![],'where':{'id':_0x29ec82['params']['id']}},_0x51487d={};_0x51487d['model']=_[_0xb07f('0x1c')](db[_0xb07f('0x2d')][_0xb07f('0x1a')]);_0x51487d['query']=_[_0xb07f('0x1c')](_0x29ec82['query']);_0x51487d['filters']=_[_0xb07f('0x1f')](_0x51487d[_0xb07f('0x1b')],_0x51487d[_0xb07f('0x1d')]);_0x4384f1['attributes']=_['intersection'](_0x51487d[_0xb07f('0x1b')],qs[_0xb07f('0x21')](_0x29ec82[_0xb07f('0x1d')][_0xb07f('0x21')]));_0x4384f1[_0xb07f('0x20')]=_0x4384f1[_0xb07f('0x20')][_0xb07f('0x22')]?_0x4384f1['attributes']:_0x51487d[_0xb07f('0x1b')];if(_0x29ec82[_0xb07f('0x1d')]['includeAll']){_0x4384f1[_0xb07f('0x2f')]=[{'all':!![]}];}_0x4384f1=_[_0xb07f('0x29')]({},_0x4384f1,_0x29ec82[_0xb07f('0x2c')]);return db[_0xb07f('0x2d')][_0xb07f('0x36')](_0x4384f1)['then'](handleEntityNotFound(_0x5a6f40,null))[_0xb07f('0x10')](function(_0x5b0383){if(_0x5b0383[_0xb07f('0x31')]===_0xb07f('0x32')){var _0xb6cf09=encryptor['decryptString'](_0x5b0383[_0xb07f('0x34')]);_0x5b0383[_0xb07f('0x34')]=maskClientSecret(_0xb6cf09);}return _0x5b0383;})['then'](respondWithResult(_0x5a6f40,null))[_0xb07f('0x35')](handleError(_0x5a6f40,null));};exports['create']=function(_0x12c437,_0x4a1490){if(!_0x12c437[_0xb07f('0x37')][_0xb07f('0x14')])throw new Error(_0xb07f('0x38'));if(!_0x12c437[_0xb07f('0x37')][_0xb07f('0x31')])throw new Error('Service\x20parameter\x20not\x20specified');var _0x5baa15=db[_0xb07f('0x2d')][_0xb07f('0x1a')]['service']['values'];if(!_0x5baa15[_0xb07f('0x39')](_0x12c437['body'][_0xb07f('0x31')]))throw new Error('Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20'+_0x5baa15[_0xb07f('0x3a')](',\x20'));if(_0x12c437[_0xb07f('0x37')][_0xb07f('0x31')]===_0xb07f('0x32')&&_0x12c437[_0xb07f('0x37')][_0xb07f('0x34')]){_0x12c437[_0xb07f('0x37')]['data3']=encryptor['encryptString'](_0x12c437[_0xb07f('0x37')][_0xb07f('0x34')]);}return db[_0xb07f('0x2d')][_0xb07f('0x3b')](_0x12c437[_0xb07f('0x37')],{})[_0xb07f('0x10')](respondWithResult(_0x4a1490,0xc9))[_0xb07f('0x35')](handleError(_0x4a1490,null));};exports[_0xb07f('0x3c')]=function(_0xc79e9b,_0x22504d){if(_0xc79e9b['body']['id']){delete _0xc79e9b[_0xb07f('0x37')]['id'];}return db[_0xb07f('0x2d')]['find']({'where':{'id':_0xc79e9b[_0xb07f('0x3d')]['id']}})[_0xb07f('0x10')](handleEntityNotFound(_0x22504d,null))['then'](function(_0xfc6548){if(_0xfc6548[_0xb07f('0x31')]===_0xb07f('0x32')&&_0xc79e9b[_0xb07f('0x37')]['data3']){_0xc79e9b['body'][_0xb07f('0x34')]=encryptor[_0xb07f('0x3e')](_0xc79e9b['body'][_0xb07f('0x34')]);}return _0xfc6548;})[_0xb07f('0x10')](saveUpdates(_0xc79e9b[_0xb07f('0x37')],null))[_0xb07f('0x10')](respondWithResult(_0x22504d,null))[_0xb07f('0x35')](handleError(_0x22504d,null));};exports[_0xb07f('0x11')]=function(_0x29f14e,_0xbbc551){return db[_0xb07f('0x2d')][_0xb07f('0x36')]({'where':{'id':_0x29f14e[_0xb07f('0x3d')]['id']}})[_0xb07f('0x10')](handleEntityNotFound(_0xbbc551,null))[_0xb07f('0x10')](removeEntity(_0xbbc551,null))['catch'](handleError(_0xbbc551,null));};exports[_0xb07f('0x3f')]=function(_0x48a78e,_0x2ffcbd){return db[_0xb07f('0x2d')]['findOne']({'where':{'id':_0x48a78e[_0xb07f('0x3d')]['id']},'raw':!![]})[_0xb07f('0x10')](function(_0x4be573){if(!_0x4be573)return _0x2ffcbd[_0xb07f('0x40')](0x194);return{'url':oauth[_0xb07f('0x41')](_0x4be573,_0x48a78e['user']['id'])};})[_0xb07f('0x10')](respondWithResult(_0x2ffcbd,null))['catch'](handleError(_0x2ffcbd,null));};exports[_0xb07f('0x42')]=function(_0x3f2186,_0x3c800a){var _0x14a2cb=_0x3f2186['body'];var _0x1f2ae6;var _0x50532f;if(_0x14a2cb[_0xb07f('0x12')])throw _0x14a2cb;redis['get'](_0x14a2cb[_0xb07f('0x43')])[_0xb07f('0x10')](function(_0x5d2065){if(!_0x5d2065)throw new Error('Invalid\x20state\x20parameter');_0x1f2ae6=JSON[_0xb07f('0x44')](_0x5d2065);var _0x24e76f=Buffer[_0xb07f('0x45')](_0x14a2cb[_0xb07f('0x43')],_0xb07f('0x46'))['toString'](_0xb07f('0x47'));_0x50532f=JSON['parse'](_0x24e76f);if(!oauth[_0xb07f('0x48')](_0x14a2cb[_0xb07f('0x49')],_0x1f2ae6[_0xb07f('0x4a')]))throw new Error(_0xb07f('0x4b'));redis[_0xb07f('0x4c')](_0x14a2cb[_0xb07f('0x43')]);return oauth['getOauth2MicrosoftAccessToken'](_0x14a2cb[_0xb07f('0x4d')],_0x1f2ae6);})[_0xb07f('0x10')](function(_0x1a9def){_0x1f2ae6[_0xb07f('0x4e')]=_0x1a9def[_0xb07f('0x4f')];_0x1f2ae6[_0xb07f('0x50')]=_0x1a9def['refresh_token'];return db[_0xb07f('0x2d')][_0xb07f('0x3c')]({'data5':_0x1f2ae6[_0xb07f('0x4e')],'data6':_0x1f2ae6['data6']},{'where':{'id':_0x1f2ae6['id']}});})['then'](function(){oauth[_0xb07f('0x51')](_0x1f2ae6);socket[_0xb07f('0x52')]('microsoftAuthorization:success',{'id':_0x50532f['id']});return;})[_0xb07f('0x10')](respondWithStatusCode(_0x3c800a,null))[_0xb07f('0x35')](function(_0x15df1a){if(_0x50532f){socket[_0xb07f('0x52')](_0xb07f('0x53'),{'id':_0x50532f['id']});}if(!_0x1f2ae6){logger['error'](_0xb07f('0x54'),_0x15df1a);return _0x3c800a[_0xb07f('0x9')](0x1f4)[_0xb07f('0x15')](_0x15df1a[_0xb07f('0x55')]);}logger['error'](_0xb07f('0x56'),_0x1f2ae6['id'],JSON[_0xb07f('0x57')](_0x15df1a));});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index 79f8b74..3aee912 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 _0x9bce=['path','rimraf','../../config/environment','./cloudProvider.attributes','define','cloud_providers','lodash','util','../../config/logger','moment','bluebird'];(function(_0x241424,_0x25eb5d){var _0x3da798=function(_0x415153){while(--_0x415153){_0x241424['push'](_0x241424['shift']());}};_0x3da798(++_0x25eb5d);}(_0x9bce,0x192));var _0xe9bc=function(_0x2288c3,_0x470419){_0x2288c3=_0x2288c3-0x0;var _0x1ccf3e=_0x9bce[_0x2288c3];return _0x1ccf3e;};'use strict';var _=require(_0xe9bc('0x0'));var util=require(_0xe9bc('0x1'));var logger=require(_0xe9bc('0x2'))('api');var moment=require(_0xe9bc('0x3'));var BPromise=require(_0xe9bc('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe9bc('0x5'));var rimraf=require(_0xe9bc('0x6'));var config=require(_0xe9bc('0x7'));var attributes=require(_0xe9bc('0x8'));module['exports']=function(_0x4fc601,_0x5a3fe6){return _0x4fc601[_0xe9bc('0x9')]('CloudProvider',attributes,{'tableName':_0xe9bc('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1825=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','CloudProvider','lodash','util','../../config/logger','api'];(function(_0x25cd10,_0x193910){var _0x99a9f9=function(_0x555314){while(--_0x555314){_0x25cd10['push'](_0x25cd10['shift']());}};_0x99a9f9(++_0x193910);}(_0x1825,0x7e));var _0x5182=function(_0x37ced0,_0x29518c){_0x37ced0=_0x37ced0-0x0;var _0x59ecfb=_0x1825[_0x37ced0];return _0x59ecfb;};'use strict';var _=require(_0x5182('0x0'));var util=require(_0x5182('0x1'));var logger=require(_0x5182('0x2'))(_0x5182('0x3'));var moment=require(_0x5182('0x4'));var BPromise=require(_0x5182('0x5'));var rp=require(_0x5182('0x6'));var fs=require('fs');var path=require(_0x5182('0x7'));var rimraf=require(_0x5182('0x8'));var config=require(_0x5182('0x9'));var attributes=require('./cloudProvider.attributes');module[_0x5182('0xa')]=function(_0x203711,_0x49434b){return _0x203711[_0x5182('0xb')](_0x5182('0xc'),attributes,{'tableName':'cloud_providers','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 f484161..ca7d610 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 _0x258f=['update','data5','then','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','findAll','inspect','exports','lodash','moment','ioredis','request-promise','util','../../config/environment','api','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','type','Dynamics365','push','data7','/.default','Outlook365','replace','{TENANT_ID}','data2','id_token','from','stringify','randomBytes','toString','response_type','redirect_uri','data4','response_mode','scope','nonce','prompt','login','map','key','oauth2Claims','oauth2/','data1','decode','payload','iss','audience','isAfter','exp','resolve','data3','refresh_token','data6','decryptString','POST','access_token','CloudProvider'];(function(_0x260e07,_0x2dd0e4){var _0x28ba4e=function(_0x237146){while(--_0x237146){_0x260e07['push'](_0x260e07['shift']());}};_0x28ba4e(++_0x2dd0e4);}(_0x258f,0x11c));var _0xf258=function(_0xee2791,_0x3fb463){_0xee2791=_0xee2791-0x0;var _0x4c0cfb=_0x258f[_0xee2791];return _0x4c0cfb;};'use strict';var _=require(_0xf258('0x0'));var crypto=require('crypto');var jwt=require('jsonwebtoken');var moment=require(_0xf258('0x1'));var Redis=require(_0xf258('0x2'));var rp=require(_0xf258('0x3'));var util=require(_0xf258('0x4'));var encryptor=require('../../components/encryptor');var config=require(_0xf258('0x5'));var logger=require('../../config/logger')(_0xf258('0x6'));var schedule=require(_0xf258('0x7'));var db=require(_0xf258('0x8'))['db'];config[_0xf258('0x9')]=_[_0xf258('0xa')](config[_0xf258('0x9')],{'host':_0xf258('0xb'),'port':0x18eb});var redis=new Redis(config[_0xf258('0x9')]);var MICROSOFT_AUTH_URL=_0xf258('0xc');var AZURE_AUTH_SCOPES={'Outlook365':[_0xf258('0xd'),_0xf258('0xe'),_0xf258('0xf'),_0xf258('0x10'),_0xf258('0x11'),'https://outlook.office.com/POP.AccessAsUser.All',_0xf258('0x12')],'Dynamics365':[_0xf258('0xd'),_0xf258('0x10')]};var MICROSOFT_AUTH_ENDPOINT=_0xf258('0x13');var MICROSOFT_TOKEN_ENDPOINT='/token';var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x28b962){var _0x726940=_['map'](AZURE_AUTH_SCOPES[_0x28b962[_0xf258('0x14')]]);if(_0x28b962['type']===_0xf258('0x15'))_0x726940[_0xf258('0x16')](_0x28b962[_0xf258('0x17')]+_0xf258('0x18'));return _0x726940['join']('\x20');}function getAccessTokenScope(_0x390a53){if(_0x390a53[_0xf258('0x14')]===_0xf258('0x19'))return _0xf258('0x11');if(_0x390a53[_0xf258('0x14')]===_0xf258('0x15'))return _0x390a53[_0xf258('0x17')]+_0xf258('0x18');}function generateMicrosoftAuthorizationUrl(_0x3f79f0,_0x102403){var _0x202626=MICROSOFT_AUTH_URL[_0xf258('0x1a')](_0xf258('0x1b'),_0x3f79f0[_0xf258('0x1c')]);var _0x106c04=['code',_0xf258('0x1d')];var _0x6f8ff7=Buffer[_0xf258('0x1e')](JSON[_0xf258('0x1f')]({'id':_0x102403}))['toString']('base64');var _0x2eee29=crypto[_0xf258('0x20')](0x10)[_0xf258('0x21')]('hex');var _0x20af4d=getAuthorizationScopes(_0x3f79f0);var _0x48076a=[{'key':'client_id','value':_0x3f79f0['data1']},{'key':_0xf258('0x22'),'value':encodeURIComponent(_0x106c04['join']('\x20'))},{'key':_0xf258('0x23'),'value':_0x3f79f0[_0xf258('0x24')]},{'key':_0xf258('0x25'),'value':'form_post'},{'key':_0xf258('0x26'),'value':encodeURIComponent(_0x20af4d)},{'key':'state','value':_0x6f8ff7},{'key':_0xf258('0x27'),'value':_0x2eee29},{'key':_0xf258('0x28'),'value':_0xf258('0x29')}];var _0x618115=_0x202626+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xf258('0x2a')](_0x48076a,function(_0x30b09c){return _0x30b09c[_0xf258('0x2b')]+'='+_0x30b09c['value'];})['join']('&');_0x3f79f0[_0xf258('0x2c')]={'issuer':_0x202626[_0xf258('0x1a')](_0xf258('0x2d'),''),'audience':_0x3f79f0[_0xf258('0x2e')],'state':_0x6f8ff7,'nonce':_0x2eee29};redis['set'](_0x6f8ff7,JSON[_0xf258('0x1f')](_0x3f79f0));return _0x618115;}function isValidIdToken(_0x330ec7,_0x1c2140){try{var _0x1cf52e=jwt[_0xf258('0x2f')](_0x330ec7,{'complete':!![]});var _0x37cea0=_0x1cf52e[_0xf258('0x30')];if(_0x37cea0[_0xf258('0x31')]!==_0x1c2140['issuer'])return![];if(_0x37cea0['aud']!==_0x1c2140[_0xf258('0x32')])return![];if(_0x37cea0[_0xf258('0x27')]!==_0x1c2140[_0xf258('0x27')])return![];if(moment()[_0xf258('0x33')](moment['unix'](_0x37cea0[_0xf258('0x34')])))return![];return!![];}catch(_0x25c3ee){throw _0x25c3ee;}}function refreshOauth2MicrosoftAccessToken(_0x118813){return Promise[_0xf258('0x35')]()['then'](function(){if(_0x118813[_0xf258('0x36')])return _0x118813;return db['CloudProvider']['findOne']({'where':{'id':_0x118813['id']},'raw':!![]});})['then'](function(_0xc7928){var _0x557116={'grant_type':_0xf258('0x37'),'refresh_token':_0xc7928[_0xf258('0x38')],'scope':getAccessTokenScope(_0xc7928),'redirect_uri':_0xc7928[_0xf258('0x24')],'client_id':_0xc7928[_0xf258('0x2e')],'client_secret':encryptor[_0xf258('0x39')](_0xc7928[_0xf258('0x36')])};var _0x1ea6da={'method':_0xf258('0x3a'),'uri':MICROSOFT_AUTH_URL[_0xf258('0x1a')]('{TENANT_ID}',_0xc7928[_0xf258('0x1c')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x557116,'json':!![]};return rp(_0x1ea6da);})['then'](function(_0x3bd07b){_0x118813['data5']=_0x3bd07b[_0xf258('0x3b')];_0x118813[_0xf258('0x38')]=_0x3bd07b[_0xf258('0x37')];return db[_0xf258('0x3c')][_0xf258('0x3d')]({'data5':_0x118813[_0xf258('0x3e')],'data6':_0x118813['data6']},{'where':{'id':_0x118813['id']}});})[_0xf258('0x3f')](function(){return _0x118813;})['catch'](function(_0x5a8b2d){logger[_0xf258('0x40')](_0xf258('0x41'),_0x118813['id'],_0x5a8b2d);});}function getOauth2MicrosoftAccessToken(_0x317d25,_0x2087c0){var _0x3460e9={'grant_type':'authorization_code','code':_0x317d25,'scope':getAccessTokenScope(_0x2087c0),'redirect_uri':_0x2087c0[_0xf258('0x24')],'client_id':_0x2087c0[_0xf258('0x2e')],'client_secret':encryptor[_0xf258('0x39')](_0x2087c0[_0xf258('0x36')])};var _0x2c7545={'method':_0xf258('0x3a'),'uri':MICROSOFT_AUTH_URL[_0xf258('0x1a')]('{TENANT_ID}',_0x2087c0[_0xf258('0x1c')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x3460e9,'json':!![]};return rp(_0x2c7545);}function startRefreshInterval(_0x3a2daa){var _0x230889=schedule['intervals'];if(_0x230889[_0x3a2daa['id']])clearInterval(_0x230889[_0x3a2daa['id']]);_0x230889[_0x3a2daa['id']]=setInterval(refreshOauth2MicrosoftAccessToken['bind'](this,{'id':_0x3a2daa['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0x230889;}function startAllRefreshIntervals(){return db[_0xf258('0x3c')][_0xf258('0x42')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0xf258('0x3f')](function(_0x1438eb){var _0x183ee0=_0x1438eb[_0xf258('0x2a')](function(_0x426a3e){return refreshOauth2MicrosoftAccessToken(_0x426a3e)[_0xf258('0x3f')](function(_0x4ba0b3){startRefreshInterval(_0x4ba0b3);});});return Promise['all'](_0x183ee0);})['catch'](function(_0x1fcf42){var _0x3b6261=_0x1fcf42?util[_0xf258('0x43')](_0x1fcf42,{'showHidden':![],'depth':null}):'';logger[_0xf258('0x40')]('[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s',_0x3b6261);});}module[_0xf258('0x44')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file +var _0xa6fc=['key','value','oauth2Claims','replace','oauth2/','set','decode','payload','iss','audience','isAfter','exp','resolve','then','CloudProvider','refresh_token','data6','data4','decryptString','data3','access_token','update','catch','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','POST','intervals','bind','findAll','all','error','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','crypto','jsonwebtoken','moment','ioredis','request-promise','util','../../components/encryptor','../../config/logger','api','../../config/schedule/cloud-provider','defaults','redis','localhost','profile','offline_access','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','openid','/authorize','/token','map','type','Dynamics365','push','data7','/.default','join','Outlook365','https://outlook.office365.com/IMAP.AccessAsUser.All','{TENANT_ID}','data2','code','id_token','from','stringify','toString','hex','client_id','data1','response_mode','form_post','state','nonce','prompt','login'];(function(_0x30a36b,_0xa9e29b){var _0x4ea420=function(_0x442a14){while(--_0x442a14){_0x30a36b['push'](_0x30a36b['shift']());}};_0x4ea420(++_0xa9e29b);}(_0xa6fc,0x70));var _0xca6f=function(_0x5e332f,_0x5b706f){_0x5e332f=_0x5e332f-0x0;var _0x6df24f=_0xa6fc[_0x5e332f];return _0x6df24f;};'use strict';var _=require(_0xca6f('0x0'));var crypto=require(_0xca6f('0x1'));var jwt=require(_0xca6f('0x2'));var moment=require(_0xca6f('0x3'));var Redis=require(_0xca6f('0x4'));var rp=require(_0xca6f('0x5'));var util=require(_0xca6f('0x6'));var encryptor=require(_0xca6f('0x7'));var config=require('../../config/environment');var logger=require(_0xca6f('0x8'))(_0xca6f('0x9'));var schedule=require(_0xca6f('0xa'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xca6f('0xb')](config[_0xca6f('0xc')],{'host':_0xca6f('0xd'),'port':0x18eb});var redis=new Redis(config['redis']);var MICROSOFT_AUTH_URL='https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0';var AZURE_AUTH_SCOPES={'Outlook365':['openid',_0xca6f('0xe'),'email',_0xca6f('0xf'),'https://outlook.office365.com/IMAP.AccessAsUser.All',_0xca6f('0x10'),_0xca6f('0x11')],'Dynamics365':[_0xca6f('0x12'),_0xca6f('0xf')]};var MICROSOFT_AUTH_ENDPOINT=_0xca6f('0x13');var MICROSOFT_TOKEN_ENDPOINT=_0xca6f('0x14');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x301e3d){var _0x298220=_[_0xca6f('0x15')](AZURE_AUTH_SCOPES[_0x301e3d['type']]);if(_0x301e3d[_0xca6f('0x16')]===_0xca6f('0x17'))_0x298220[_0xca6f('0x18')](_0x301e3d[_0xca6f('0x19')]+_0xca6f('0x1a'));return _0x298220[_0xca6f('0x1b')]('\x20');}function getAccessTokenScope(_0x1f58bf){if(_0x1f58bf[_0xca6f('0x16')]===_0xca6f('0x1c'))return _0xca6f('0x1d');if(_0x1f58bf[_0xca6f('0x16')]===_0xca6f('0x17'))return _0x1f58bf[_0xca6f('0x19')]+'/.default';}function generateMicrosoftAuthorizationUrl(_0x2613b5,_0x38672a){var _0x510ce0=MICROSOFT_AUTH_URL['replace'](_0xca6f('0x1e'),_0x2613b5[_0xca6f('0x1f')]);var _0x53fd74=[_0xca6f('0x20'),_0xca6f('0x21')];var _0xd83320=Buffer[_0xca6f('0x22')](JSON[_0xca6f('0x23')]({'id':_0x38672a}))[_0xca6f('0x24')]('base64');var _0x237cdb=crypto['randomBytes'](0x10)[_0xca6f('0x24')](_0xca6f('0x25'));var _0x18c03e=getAuthorizationScopes(_0x2613b5);var _0x2941e4=[{'key':_0xca6f('0x26'),'value':_0x2613b5[_0xca6f('0x27')]},{'key':'response_type','value':encodeURIComponent(_0x53fd74[_0xca6f('0x1b')]('\x20'))},{'key':'redirect_uri','value':_0x2613b5['data4']},{'key':_0xca6f('0x28'),'value':_0xca6f('0x29')},{'key':'scope','value':encodeURIComponent(_0x18c03e)},{'key':_0xca6f('0x2a'),'value':_0xd83320},{'key':_0xca6f('0x2b'),'value':_0x237cdb},{'key':_0xca6f('0x2c'),'value':_0xca6f('0x2d')}];var _0x141f21=_0x510ce0+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xca6f('0x15')](_0x2941e4,function(_0x4e05df){return _0x4e05df[_0xca6f('0x2e')]+'='+_0x4e05df[_0xca6f('0x2f')];})[_0xca6f('0x1b')]('&');_0x2613b5[_0xca6f('0x30')]={'issuer':_0x510ce0[_0xca6f('0x31')](_0xca6f('0x32'),''),'audience':_0x2613b5[_0xca6f('0x27')],'state':_0xd83320,'nonce':_0x237cdb};redis[_0xca6f('0x33')](_0xd83320,JSON['stringify'](_0x2613b5));return _0x141f21;}function isValidIdToken(_0x392eaa,_0x415751){try{var _0x308ce9=jwt[_0xca6f('0x34')](_0x392eaa,{'complete':!![]});var _0x2bfcca=_0x308ce9[_0xca6f('0x35')];if(_0x2bfcca[_0xca6f('0x36')]!==_0x415751['issuer'])return![];if(_0x2bfcca['aud']!==_0x415751[_0xca6f('0x37')])return![];if(_0x2bfcca['nonce']!==_0x415751['nonce'])return![];if(moment()[_0xca6f('0x38')](moment['unix'](_0x2bfcca[_0xca6f('0x39')])))return![];return!![];}catch(_0x3c59e9){throw _0x3c59e9;}}function refreshOauth2MicrosoftAccessToken(_0x5091fe){return Promise[_0xca6f('0x3a')]()[_0xca6f('0x3b')](function(){if(_0x5091fe['data3'])return _0x5091fe;return db[_0xca6f('0x3c')]['findOne']({'where':{'id':_0x5091fe['id']},'raw':!![]});})[_0xca6f('0x3b')](function(_0x1e6281){var _0x4208a2={'grant_type':_0xca6f('0x3d'),'refresh_token':_0x1e6281[_0xca6f('0x3e')],'scope':getAccessTokenScope(_0x1e6281),'redirect_uri':_0x1e6281[_0xca6f('0x3f')],'client_id':_0x1e6281[_0xca6f('0x27')],'client_secret':encryptor[_0xca6f('0x40')](_0x1e6281[_0xca6f('0x41')])};var _0x2e8f6b={'method':'POST','uri':MICROSOFT_AUTH_URL[_0xca6f('0x31')](_0xca6f('0x1e'),_0x1e6281['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x4208a2,'json':!![]};return rp(_0x2e8f6b);})[_0xca6f('0x3b')](function(_0x1bd65a){_0x5091fe['data5']=_0x1bd65a[_0xca6f('0x42')];_0x5091fe[_0xca6f('0x3e')]=_0x1bd65a[_0xca6f('0x3d')];return db[_0xca6f('0x3c')][_0xca6f('0x43')]({'data5':_0x5091fe['data5'],'data6':_0x5091fe[_0xca6f('0x3e')]},{'where':{'id':_0x5091fe['id']}});})[_0xca6f('0x3b')](function(){return _0x5091fe;})[_0xca6f('0x44')](function(_0x447ddc){logger['error'](_0xca6f('0x45'),_0x5091fe['id'],_0x447ddc);});}function getOauth2MicrosoftAccessToken(_0x5b6b85,_0x39029b){var _0x288dd1={'grant_type':_0xca6f('0x46'),'code':_0x5b6b85,'scope':getAccessTokenScope(_0x39029b),'redirect_uri':_0x39029b[_0xca6f('0x3f')],'client_id':_0x39029b[_0xca6f('0x27')],'client_secret':encryptor['decryptString'](_0x39029b['data3'])};var _0x244994={'method':_0xca6f('0x47'),'uri':MICROSOFT_AUTH_URL[_0xca6f('0x31')](_0xca6f('0x1e'),_0x39029b['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x288dd1,'json':!![]};return rp(_0x244994);}function startRefreshInterval(_0x478173){var _0x29faed=schedule[_0xca6f('0x48')];if(_0x29faed[_0x478173['id']])clearInterval(_0x29faed[_0x478173['id']]);_0x29faed[_0x478173['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xca6f('0x49')](this,{'id':_0x478173['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0xca6f('0x48')]=_0x29faed;}function startAllRefreshIntervals(){return db[_0xca6f('0x3c')][_0xca6f('0x4a')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0xca6f('0x3b')](function(_0x36815b){var _0x51417a=_0x36815b['map'](function(_0x2539c0){return refreshOauth2MicrosoftAccessToken(_0x2539c0)[_0xca6f('0x3b')](function(_0x3e933d){startRefreshInterval(_0x3e933d);});});return Promise[_0xca6f('0x4b')](_0x51417a);})['catch'](function(_0x166a75){var _0x5dcee1=_0x166a75?util['inspect'](_0x166a75,{'showHidden':![],'depth':null}):'';logger[_0xca6f('0x4c')](_0xca6f('0x4d'),_0x5dcee1);});}module[_0xca6f('0x4e')]={'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 db02546..f139e68 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 _0xed03=['info','CloudProvider,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','lodash','util','bluebird','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x57afc0,_0x24ff04){var _0x44b769=function(_0x238847){while(--_0x238847){_0x57afc0['push'](_0x57afc0['shift']());}};_0x44b769(++_0x24ff04);}(_0xed03,0xdc));var _0x3ed0=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0xed03[_0x1035c1];return _0x308d67;};'use strict';var _=require(_0x3ed0('0x0'));var util=require(_0x3ed0('0x1'));var moment=require('moment');var BPromise=require(_0x3ed0('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3ed0('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x3ed0('0x4'))('rpc');var config=require(_0x3ed0('0x5'));var jayson=require(_0x3ed0('0x6'));var client=jayson[_0x3ed0('0x7')][_0x3ed0('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x8470b7,_0x3f1277,_0xd729a0){return new BPromise(function(_0x4500aa,_0xddc4c5){return client[_0x3ed0('0x9')](_0x8470b7,_0xd729a0)[_0x3ed0('0xa')](function(_0x34950c){logger[_0x3ed0('0xb')](_0x3ed0('0xc'),_0x3f1277,'request\x20sent');logger[_0x3ed0('0xd')]('CloudProvider,\x20%s,\x20%s,\x20%s',_0x3f1277,_0x3ed0('0xe'),JSON[_0x3ed0('0xf')](_0x34950c));if(_0x34950c[_0x3ed0('0x10')]){if(_0x34950c['error'][_0x3ed0('0x11')]===0x1f4){logger[_0x3ed0('0x10')](_0x3ed0('0xc'),_0x3f1277,_0x34950c[_0x3ed0('0x10')][_0x3ed0('0x12')]);return _0xddc4c5(_0x34950c['error'][_0x3ed0('0x12')]);}logger[_0x3ed0('0x10')](_0x3ed0('0xc'),_0x3f1277,_0x34950c[_0x3ed0('0x10')][_0x3ed0('0x12')]);return _0x4500aa(_0x34950c['error'][_0x3ed0('0x12')]);}else{logger[_0x3ed0('0xb')]('CloudProvider,\x20%s,\x20%s',_0x3f1277,_0x3ed0('0xe'));_0x4500aa(_0x34950c[_0x3ed0('0x13')][_0x3ed0('0x12')]);}})[_0x3ed0('0x14')](function(_0xaa73cd){logger[_0x3ed0('0x10')]('CloudProvider,\x20%s,\x20%s',_0x3f1277,_0xaa73cd);_0xddc4c5(_0xaa73cd);});});} \ No newline at end of file +var _0x3d2f=['message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','error'];(function(_0x55677b,_0x3e5655){var _0x104b88=function(_0x78d34f){while(--_0x78d34f){_0x55677b['push'](_0x55677b['shift']());}};_0x104b88(++_0x3e5655);}(_0x3d2f,0x18f));var _0xf3d2=function(_0x2d1da8,_0x5606b9){_0x2d1da8=_0x2d1da8-0x0;var _0x53ae73=_0x3d2f[_0x2d1da8];return _0x53ae73;};'use strict';var _=require(_0xf3d2('0x0'));var util=require(_0xf3d2('0x1'));var moment=require('moment');var BPromise=require(_0xf3d2('0x2'));var rs=require(_0xf3d2('0x3'));var fs=require('fs');var Redis=require(_0xf3d2('0x4'));var db=require(_0xf3d2('0x5'))['db'];var utils=require(_0xf3d2('0x6'));var logger=require(_0xf3d2('0x7'))(_0xf3d2('0x8'));var config=require('../../config/environment');var jayson=require(_0xf3d2('0x9'));var client=jayson[_0xf3d2('0xa')][_0xf3d2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xf9a0c9,_0x23edba,_0x57f94b){return new BPromise(function(_0x26f330,_0x3f86f6){return client['request'](_0xf9a0c9,_0x57f94b)[_0xf3d2('0xc')](function(_0x4ef134){logger[_0xf3d2('0xd')](_0xf3d2('0xe'),_0x23edba,_0xf3d2('0xf'));logger[_0xf3d2('0x10')](_0xf3d2('0x11'),_0x23edba,_0xf3d2('0xf'),JSON['stringify'](_0x4ef134));if(_0x4ef134[_0xf3d2('0x12')]){if(_0x4ef134[_0xf3d2('0x12')]['code']===0x1f4){logger[_0xf3d2('0x12')]('CloudProvider,\x20%s,\x20%s',_0x23edba,_0x4ef134[_0xf3d2('0x12')][_0xf3d2('0x13')]);return _0x3f86f6(_0x4ef134[_0xf3d2('0x12')]['message']);}logger[_0xf3d2('0x12')](_0xf3d2('0xe'),_0x23edba,_0x4ef134[_0xf3d2('0x12')][_0xf3d2('0x13')]);return _0x26f330(_0x4ef134[_0xf3d2('0x12')][_0xf3d2('0x13')]);}else{logger['info'](_0xf3d2('0xe'),_0x23edba,_0xf3d2('0xf'));_0x26f330(_0x4ef134[_0xf3d2('0x14')][_0xf3d2('0x13')]);}})[_0xf3d2('0x15')](function(_0x3daaaf){logger[_0xf3d2('0x12')](_0xf3d2('0xe'),_0x23edba,_0x3daaaf);_0x3f86f6(_0x3daaaf);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index 4ec3099..dc2c671 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 _0x2ef3=['Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','/:id','show','post','put','update','delete','destroy','/:id/oauth2/microsoft/authorize/','/oauth2/microsoft/callback','oauth2MicrosoftCallback','exports','express'];(function(_0x5c82e9,_0x1a13d5){var _0x57fc44=function(_0x196831){while(--_0x196831){_0x5c82e9['push'](_0x5c82e9['shift']());}};_0x57fc44(++_0x1a13d5);}(_0x2ef3,0xba));var _0x32ef=function(_0x421c29,_0x4074f6){_0x421c29=_0x421c29-0x0;var _0xd2c93b=_0x2ef3[_0x421c29];return _0xd2c93b;};'use strict';var express=require(_0x32ef('0x0'));var router=express[_0x32ef('0x1')]();var auth=require(_0x32ef('0x2'));var controller=require(_0x32ef('0x3'));router[_0x32ef('0x4')]('/',auth[_0x32ef('0x5')](),controller['index']);router[_0x32ef('0x4')](_0x32ef('0x6'),auth['isAuthenticated'](),controller[_0x32ef('0x7')]);router[_0x32ef('0x8')]('/',auth['isAuthenticated'](),controller['create']);router[_0x32ef('0x9')](_0x32ef('0x6'),auth[_0x32ef('0x5')](),controller[_0x32ef('0xa')]);router[_0x32ef('0xb')](_0x32ef('0x6'),auth[_0x32ef('0x5')](),controller[_0x32ef('0xc')]);router[_0x32ef('0x4')](_0x32ef('0xd'),auth['isAuthenticated'](),controller['oauth2MicrosoftAuthorize']);router[_0x32ef('0x8')](_0x32ef('0xe'),controller[_0x32ef('0xf')]);module[_0x32ef('0x10')]=router; \ No newline at end of file +var _0xdb28=['delete','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','/oauth2/microsoft/callback','oauth2MicrosoftCallback','express','Router','../../components/auth/service','./cloudProvider.controller','isAuthenticated','index','get','/:id','post','update'];(function(_0x1ba00d,_0x28ec4b){var _0x199e87=function(_0x22daa7){while(--_0x22daa7){_0x1ba00d['push'](_0x1ba00d['shift']());}};_0x199e87(++_0x28ec4b);}(_0xdb28,0x106));var _0x8db2=function(_0x473ffe,_0x3844f8){_0x473ffe=_0x473ffe-0x0;var _0x10423f=_0xdb28[_0x473ffe];return _0x10423f;};'use strict';var express=require(_0x8db2('0x0'));var router=express[_0x8db2('0x1')]();var auth=require(_0x8db2('0x2'));var controller=require(_0x8db2('0x3'));router['get']('/',auth[_0x8db2('0x4')](),controller[_0x8db2('0x5')]);router[_0x8db2('0x6')](_0x8db2('0x7'),auth[_0x8db2('0x4')](),controller['show']);router[_0x8db2('0x8')]('/',auth[_0x8db2('0x4')](),controller['create']);router['put'](_0x8db2('0x7'),auth[_0x8db2('0x4')](),controller[_0x8db2('0x9')]);router[_0x8db2('0xa')](_0x8db2('0x7'),auth[_0x8db2('0x4')](),controller[_0x8db2('0xb')]);router['get'](_0x8db2('0xc'),auth[_0x8db2('0x4')](),controller[_0x8db2('0xd')]);router['post'](_0x8db2('0xe'),controller[_0x8db2('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index a8133a1..54e67af 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 _0x9a45=['name','STRING'];(function(_0x119961,_0x38c0a1){var _0x147fe2=function(_0xd2e914){while(--_0xd2e914){_0x119961['push'](_0x119961['shift']());}};_0x147fe2(++_0x38c0a1);}(_0x9a45,0x11d));var _0x59a4=function(_0x21f729,_0x20de13){_0x21f729=_0x21f729-0x0;var _0x41c0ab=_0x9a45[_0x21f729];return _0x41c0ab;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x59a4('0x0')],'unique':_0x59a4('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x59a4('0x0')]},'companyId':{'type':Sequelize[_0x59a4('0x0')]},'website':{'type':Sequelize[_0x59a4('0x0')]},'phone':{'type':Sequelize[_0x59a4('0x0')]},'fax':{'type':Sequelize[_0x59a4('0x0')]},'type':{'type':Sequelize[_0x59a4('0x0')]},'street':{'type':Sequelize[_0x59a4('0x0')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x59a4('0x0')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0x59a4('0x0')]},'sPostalCode':{'type':Sequelize[_0x59a4('0x0')]},'sCity':{'type':Sequelize[_0x59a4('0x0')]},'sCountry':{'type':Sequelize[_0x59a4('0x0')]},'description':{'type':Sequelize[_0x59a4('0x0')]}}; \ No newline at end of file +var _0x217a=['name','sequelize','STRING'];(function(_0x4cf0b7,_0x560029){var _0x545f10=function(_0x993533){while(--_0x993533){_0x4cf0b7['push'](_0x4cf0b7['shift']());}};_0x545f10(++_0x560029);}(_0x217a,0x130));var _0xa217=function(_0x4a9f03,_0xda7a8a){_0x4a9f03=_0x4a9f03-0x0;var _0x5db5a3=_0x217a[_0x4a9f03];return _0x5db5a3;};'use strict';var Sequelize=require(_0xa217('0x0'));module['exports']={'name':{'type':Sequelize[_0xa217('0x1')],'unique':_0xa217('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xa217('0x1')]},'companyId':{'type':Sequelize[_0xa217('0x1')]},'website':{'type':Sequelize[_0xa217('0x1')]},'phone':{'type':Sequelize[_0xa217('0x1')]},'fax':{'type':Sequelize[_0xa217('0x1')]},'type':{'type':Sequelize[_0xa217('0x1')]},'street':{'type':Sequelize[_0xa217('0x1')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xa217('0x1')]},'country':{'type':Sequelize[_0xa217('0x1')]},'email':{'type':Sequelize[_0xa217('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xa217('0x1')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0xa217('0x1')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xa217('0x1')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index 1284121..54a3bdc 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 _0x3e89=['describe','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','map','options','includeAll','findAll','rows','catch','params','rawAttributes','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','CmContact','ids','omit','getContacts','findOne','pick','rimraf','fast-json-patch','bluebird','mustache','util','path','sox','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','then','get','Companies','UserProfileResource','error','stack','name','send','index','CmCompany'];(function(_0x3ee39d,_0x2e04a5){var _0x1ada4f=function(_0x145d54){while(--_0x145d54){_0x3ee39d['push'](_0x3ee39d['shift']());}};_0x1ada4f(++_0x2e04a5);}(_0x3e89,0x17d));var _0x93e8=function(_0x1cdaaa,_0x493dda){_0x1cdaaa=_0x1cdaaa-0x0;var _0x1c761d=_0x3e89[_0x1cdaaa];return _0x1c761d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x93e8('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x93e8('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x93e8('0x2'));var Mustache=require(_0x93e8('0x3'));var util=require(_0x93e8('0x4'));var path=require(_0x93e8('0x5'));var sox=require(_0x93e8('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x93e8('0x7'));var jsforce=require(_0x93e8('0x8'));var deskjs=require(_0x93e8('0x9'));var toCsv=require(_0x93e8('0xa'));var querystring=require(_0x93e8('0xb'));var Papa=require(_0x93e8('0xc'));var Redis=require(_0x93e8('0xd'));var authService=require(_0x93e8('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x93e8('0xf'));var hardwareService=require(_0x93e8('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0x93e8('0x11'));var config=require(_0x93e8('0x12'));var licenseUtil=require(_0x93e8('0x13'));var db=require(_0x93e8('0x14'))['db'];function respondWithStatusCode(_0x1c71ba,_0x240045){_0x240045=_0x240045||0xcc;return function(_0x298d63){if(_0x298d63){return _0x1c71ba['sendStatus'](_0x240045);}return _0x1c71ba[_0x93e8('0x15')](_0x240045)[_0x93e8('0x16')]();};}function respondWithResult(_0x59c05d,_0x540013){_0x540013=_0x540013||0xc8;return function(_0x11690e){if(_0x11690e){return _0x59c05d[_0x93e8('0x15')](_0x540013)[_0x93e8('0x17')](_0x11690e);}};}function respondWithFilteredResult(_0x5db59f,_0x198ee6){return function(_0x273add){if(_0x273add){var _0x597357=typeof _0x198ee6[_0x93e8('0x18')]===_0x93e8('0x19')&&typeof _0x198ee6[_0x93e8('0x1a')]==='undefined';var _0x52dc66=_0x273add[_0x93e8('0x1b')];var _0x4f8fe9=_0x597357?0x0:_0x198ee6[_0x93e8('0x18')];var _0x42ffe3=_0x597357?_0x273add[_0x93e8('0x1b')]:_0x198ee6['offset']+_0x198ee6[_0x93e8('0x1a')];var _0x2f0902;if(_0x42ffe3>=_0x52dc66){_0x42ffe3=_0x52dc66;_0x2f0902=0xc8;}else{_0x2f0902=0xce;}_0x5db59f[_0x93e8('0x15')](_0x2f0902);return _0x5db59f['set'](_0x93e8('0x1c'),_0x4f8fe9+'-'+_0x42ffe3+'/'+_0x52dc66)['json'](_0x273add);}return null;};}function patchUpdates(_0x242a84){return function(_0x1024ea){try{jsonpatch[_0x93e8('0x1d')](_0x1024ea,_0x242a84,!![]);}catch(_0x36951e){return BPromise[_0x93e8('0x1e')](_0x36951e);}return _0x1024ea[_0x93e8('0x1f')]();};}function saveUpdates(_0x2c891e,_0x43734b){return function(_0x3749f0){if(_0x3749f0){return _0x3749f0[_0x93e8('0x20')](_0x2c891e)['then'](function(_0x429cc6){return _0x429cc6;});}return null;};}function removeEntity(_0x4b0a7f,_0x4fee7d){return function(_0x46b5ed){if(_0x46b5ed){return _0x46b5ed[_0x93e8('0x21')]()[_0x93e8('0x22')](function(){var _0x2fe8c4=_0x46b5ed[_0x93e8('0x23')]({'plain':!![]});var _0x28797e=_0x93e8('0x24');return db[_0x93e8('0x25')][_0x93e8('0x21')]({'where':{'type':_0x28797e,'resourceId':_0x2fe8c4['id']}})[_0x93e8('0x22')](function(){return _0x46b5ed;});})['then'](function(){_0x4b0a7f[_0x93e8('0x15')](0xcc)[_0x93e8('0x16')]();});}};}function handleEntityNotFound(_0x4117c5,_0x2b79f8){return function(_0x21a58f){if(!_0x21a58f){_0x4117c5['sendStatus'](0x194);}return _0x21a58f;};}function handleError(_0x2ea8f7,_0x1bbb89){_0x1bbb89=_0x1bbb89||0x1f4;return function(_0x37e2c1){logger[_0x93e8('0x26')](_0x37e2c1[_0x93e8('0x27')]);if(_0x37e2c1['name']){delete _0x37e2c1[_0x93e8('0x28')];}_0x2ea8f7[_0x93e8('0x15')](_0x1bbb89)[_0x93e8('0x29')](_0x37e2c1);};}exports[_0x93e8('0x2a')]=function(_0x114ebe,_0x9695c9){var _0x3e22c5={},_0x26a1ab={},_0x501ed4={'count':0x0,'rows':[]};return db[_0x93e8('0x2b')][_0x93e8('0x2c')]()['then'](function(_0x5e7e78){_0x26a1ab[_0x93e8('0x2d')]=_[_0x93e8('0x2e')](_0x5e7e78);_0x26a1ab[_0x93e8('0x2f')]=_[_0x93e8('0x2e')](_0x114ebe['query']);_0x26a1ab['filters']=_[_0x93e8('0x30')](_0x26a1ab['model'],_0x26a1ab[_0x93e8('0x2f')]);_0x3e22c5[_0x93e8('0x31')]=_[_0x93e8('0x30')](_0x26a1ab[_0x93e8('0x2d')],qs['fields'](_0x114ebe[_0x93e8('0x2f')][_0x93e8('0x32')]));_0x3e22c5[_0x93e8('0x31')]=_0x3e22c5[_0x93e8('0x31')][_0x93e8('0x33')]?_0x3e22c5[_0x93e8('0x31')]:_0x26a1ab[_0x93e8('0x2d')];if(!_0x114ebe['query'][_0x93e8('0x34')](_0x93e8('0x35'))){_0x3e22c5[_0x93e8('0x1a')]=qs[_0x93e8('0x1a')](_0x114ebe[_0x93e8('0x2f')][_0x93e8('0x1a')]);_0x3e22c5['offset']=qs[_0x93e8('0x18')](_0x114ebe['query'][_0x93e8('0x18')]);}_0x3e22c5[_0x93e8('0x36')]=qs[_0x93e8('0x37')](_0x114ebe[_0x93e8('0x2f')][_0x93e8('0x37')]);_0x3e22c5[_0x93e8('0x38')]=qs[_0x93e8('0x39')](_['pick'](_0x114ebe[_0x93e8('0x2f')],_0x26a1ab[_0x93e8('0x39')]),_0x5e7e78);if(_0x114ebe[_0x93e8('0x2f')][_0x93e8('0x3a')]){_0x3e22c5[_0x93e8('0x38')]=_[_0x93e8('0x3b')](_0x3e22c5[_0x93e8('0x38')],{'$or':_[_0x93e8('0x3c')](_0x3e22c5[_0x93e8('0x31')],function(_0x1b32bb){var _0x16a044={};_0x16a044[_0x1b32bb]={'$like':'%'+_0x114ebe['query'][_0x93e8('0x3a')]+'%'};return _0x16a044;})});}_0x3e22c5=_[_0x93e8('0x3b')]({},_0x3e22c5,_0x114ebe[_0x93e8('0x3d')]);var _0x5134b8={'where':_0x3e22c5[_0x93e8('0x38')]};return db[_0x93e8('0x2b')][_0x93e8('0x1b')](_0x5134b8)['then'](function(_0x30ced0){_0x501ed4[_0x93e8('0x1b')]=_0x30ced0;if(_0x114ebe[_0x93e8('0x2f')][_0x93e8('0x3e')]){_0x3e22c5['include']=[{'all':!![]}];}return db['CmCompany'][_0x93e8('0x3f')](_0x3e22c5);})[_0x93e8('0x22')](function(_0x5431b1){_0x501ed4[_0x93e8('0x40')]=_0x5431b1;return _0x501ed4;})[_0x93e8('0x22')](respondWithFilteredResult(_0x9695c9,_0x3e22c5))[_0x93e8('0x41')](handleError(_0x9695c9,null));})[_0x93e8('0x41')](handleError(_0x9695c9,null));};exports['show']=function(_0x199eda,_0x36ab0f){var _0x161f96={'raw':![],'where':{'id':_0x199eda[_0x93e8('0x42')]['id']}},_0x1dcc4d={};_0x1dcc4d[_0x93e8('0x2d')]=_[_0x93e8('0x2e')](db[_0x93e8('0x2b')][_0x93e8('0x43')]);_0x1dcc4d[_0x93e8('0x2f')]=_['keys'](_0x199eda[_0x93e8('0x2f')]);_0x1dcc4d['filters']=_[_0x93e8('0x30')](_0x1dcc4d[_0x93e8('0x2d')],_0x1dcc4d[_0x93e8('0x2f')]);_0x161f96[_0x93e8('0x31')]=_['intersection'](_0x1dcc4d[_0x93e8('0x2d')],qs[_0x93e8('0x32')](_0x199eda['query'][_0x93e8('0x32')]));_0x161f96['attributes']=_0x161f96[_0x93e8('0x31')][_0x93e8('0x33')]?_0x161f96[_0x93e8('0x31')]:_0x1dcc4d[_0x93e8('0x2d')];if(_0x199eda[_0x93e8('0x2f')][_0x93e8('0x3e')]){_0x161f96[_0x93e8('0x44')]=[{'all':!![]}];}_0x161f96=_[_0x93e8('0x3b')]({},_0x161f96,_0x199eda[_0x93e8('0x3d')]);return db[_0x93e8('0x2b')][_0x93e8('0x45')](_0x161f96)[_0x93e8('0x22')](handleEntityNotFound(_0x36ab0f,null))[_0x93e8('0x22')](respondWithResult(_0x36ab0f,null))['catch'](handleError(_0x36ab0f,null));};exports[_0x93e8('0x46')]=function(_0x56eb63,_0x4fe99a){return db[_0x93e8('0x2b')][_0x93e8('0x46')](_0x56eb63[_0x93e8('0x47')],{})[_0x93e8('0x22')](function(_0x1fd6de){var _0x78d35b=_0x56eb63[_0x93e8('0x48')]['get']({'plain':!![]});if(!_0x78d35b)throw new Error(_0x93e8('0x49'));if(_0x78d35b[_0x93e8('0x4a')]===_0x93e8('0x48')){var _0x1837ed=_0x1fd6de[_0x93e8('0x23')]({'plain':!![]});var _0x114ea4=_0x93e8('0x24');return db[_0x93e8('0x4b')][_0x93e8('0x45')]({'where':{'name':_0x114ea4,'userProfileId':_0x78d35b[_0x93e8('0x4c')]},'raw':!![]})[_0x93e8('0x22')](function(_0x26cb80){if(_0x26cb80&&_0x26cb80['autoAssociation']===0x0){return db['UserProfileResource'][_0x93e8('0x46')]({'name':_0x1837ed[_0x93e8('0x28')],'resourceId':_0x1837ed['id'],'type':_0x26cb80['name'],'sectionId':_0x26cb80['id']},{})['then'](function(){return _0x1fd6de;});}else{return _0x1fd6de;}})['catch'](function(_0x389df4){logger[_0x93e8('0x26')](_0x93e8('0x4d'),_0x389df4);throw _0x389df4;});}return _0x1fd6de;})[_0x93e8('0x22')](respondWithResult(_0x4fe99a,0xc9))[_0x93e8('0x41')](handleError(_0x4fe99a,null));};exports[_0x93e8('0x20')]=function(_0x2d2b7f,_0x51b5a1){if(_0x2d2b7f[_0x93e8('0x47')]['id']){delete _0x2d2b7f[_0x93e8('0x47')]['id'];}return db[_0x93e8('0x2b')]['find']({'where':{'id':_0x2d2b7f[_0x93e8('0x42')]['id']}})[_0x93e8('0x22')](handleEntityNotFound(_0x51b5a1,null))[_0x93e8('0x22')](saveUpdates(_0x2d2b7f['body'],null))['then'](respondWithResult(_0x51b5a1,null))[_0x93e8('0x41')](handleError(_0x51b5a1,null));};exports['destroy']=function(_0xc60f0a,_0xccb513){return db[_0x93e8('0x2b')][_0x93e8('0x45')]({'where':{'id':_0xc60f0a[_0x93e8('0x42')]['id']}})['then'](handleEntityNotFound(_0xccb513,null))[_0x93e8('0x22')](removeEntity(_0xccb513,null))[_0x93e8('0x41')](handleError(_0xccb513,null));};exports['describe']=function(_0x3dfd4b,_0x28cc8b){return db[_0x93e8('0x2b')]['describe']()[_0x93e8('0x22')](respondWithResult(_0x28cc8b,null))['catch'](handleError(_0x28cc8b,null));};exports[_0x93e8('0x4e')]=function(_0xa0d379,_0x332f41,_0xb98850){return db[_0x93e8('0x4f')][_0x93e8('0x45')]({'where':{'id':_0xa0d379[_0x93e8('0x42')]['id']}})['then'](handleEntityNotFound(_0x332f41,null))[_0x93e8('0x22')](function(_0x2c67ec){if(_0x2c67ec){return _0x2c67ec[_0x93e8('0x4e')](_0xa0d379[_0x93e8('0x47')][_0x93e8('0x50')],_[_0x93e8('0x51')](_0xa0d379['body'],[_0x93e8('0x50'),'id'])||{});}})[_0x93e8('0x22')](respondWithResult(_0x332f41,null))['catch'](handleError(_0x332f41,null));};exports[_0x93e8('0x52')]=function(_0x3df805,_0x5b395b,_0x30e631){var _0x18feff={};var _0x425605={};var _0x3862a6;var _0x373d0a;return db[_0x93e8('0x2b')][_0x93e8('0x53')]({'where':{'id':_0x3df805[_0x93e8('0x42')]['id']}})['then'](handleEntityNotFound(_0x5b395b,null))[_0x93e8('0x22')](function(_0x15a008){if(_0x15a008){_0x3862a6=_0x15a008;_0x425605[_0x93e8('0x2d')]=_[_0x93e8('0x2e')](db[_0x93e8('0x4f')]['rawAttributes']);_0x425605[_0x93e8('0x2f')]=_[_0x93e8('0x2e')](_0x3df805[_0x93e8('0x2f')]);_0x425605[_0x93e8('0x39')]=_[_0x93e8('0x30')](_0x425605[_0x93e8('0x2d')],_0x425605[_0x93e8('0x2f')]);_0x18feff[_0x93e8('0x31')]=_[_0x93e8('0x30')](_0x425605['model'],qs[_0x93e8('0x32')](_0x3df805[_0x93e8('0x2f')][_0x93e8('0x32')]));_0x18feff[_0x93e8('0x31')]=_0x18feff[_0x93e8('0x31')][_0x93e8('0x33')]?_0x18feff['attributes']:_0x425605[_0x93e8('0x2d')];_0x18feff['order']=qs[_0x93e8('0x37')](_0x3df805[_0x93e8('0x2f')][_0x93e8('0x37')]);_0x18feff[_0x93e8('0x38')]=qs[_0x93e8('0x39')](_[_0x93e8('0x54')](_0x3df805[_0x93e8('0x2f')],_0x425605[_0x93e8('0x39')]));if(_0x3df805[_0x93e8('0x2f')][_0x93e8('0x3a')]){_0x18feff['where']=_[_0x93e8('0x3b')](_0x18feff[_0x93e8('0x38')],{'$or':_[_0x93e8('0x3c')](_0x18feff['attributes'],function(_0x157c25){var _0x377d9b={};_0x377d9b[_0x157c25]={'$like':'%'+_0x3df805[_0x93e8('0x2f')][_0x93e8('0x3a')]+'%'};return _0x377d9b;})});}_0x18feff=_[_0x93e8('0x3b')]({},_0x18feff,_0x3df805['options']);return _0x3862a6[_0x93e8('0x52')](_0x18feff);}})[_0x93e8('0x22')](function(_0x1244ce){if(_0x1244ce){_0x373d0a=_0x1244ce[_0x93e8('0x33')];if(!_0x3df805[_0x93e8('0x2f')]['hasOwnProperty'](_0x93e8('0x35'))){_0x18feff['limit']=qs[_0x93e8('0x1a')](_0x3df805[_0x93e8('0x2f')][_0x93e8('0x1a')]);_0x18feff[_0x93e8('0x18')]=qs[_0x93e8('0x18')](_0x3df805['query'][_0x93e8('0x18')]);}return _0x3862a6[_0x93e8('0x52')](_0x18feff);}})['then'](function(_0x5f5a18){if(_0x5f5a18){return _0x5f5a18?{'count':_0x373d0a,'rows':_0x5f5a18}:null;}})['then'](respondWithResult(_0x5b395b,null))[_0x93e8('0x41')](handleError(_0x5b395b,null));}; \ No newline at end of file +var _0x27e4=['attributes','length','hasOwnProperty','order','sort','where','pick','filters','merge','map','filter','includeAll','include','findAll','rows','show','rawAttributes','options','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','CmContact','params','ids','omit','findOne','getContacts','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','offset','count','set','Content-Range','json','apply','reject','save','update','destroy','then','UserProfileResource','error','stack','name','index','CmCompany','describe','model','query','keys','intersection','fields'];(function(_0x34063f,_0x55bb48){var _0x509b9e=function(_0x32f598){while(--_0x32f598){_0x34063f['push'](_0x34063f['shift']());}};_0x509b9e(++_0x55bb48);}(_0x27e4,0x18c));var _0x427e=function(_0x566a23,_0x5f3e1d){_0x566a23=_0x566a23-0x0;var _0x3d033a=_0x27e4[_0x566a23];return _0x3d033a;};'use strict';var emlformat=require(_0x427e('0x0'));var rimraf=require(_0x427e('0x1'));var zipdir=require(_0x427e('0x2'));var jsonpatch=require(_0x427e('0x3'));var rp=require(_0x427e('0x4'));var moment=require(_0x427e('0x5'));var BPromise=require(_0x427e('0x6'));var Mustache=require(_0x427e('0x7'));var util=require(_0x427e('0x8'));var path=require('path');var sox=require(_0x427e('0x9'));var csv=require(_0x427e('0xa'));var ejs=require(_0x427e('0xb'));var fs=require('fs');var fs_extra=require(_0x427e('0xc'));var _=require('lodash');var squel=require(_0x427e('0xd'));var crypto=require('crypto');var jsforce=require(_0x427e('0xe'));var deskjs=require(_0x427e('0xf'));var toCsv=require('to-csv');var querystring=require(_0x427e('0x10'));var Papa=require('papaparse');var Redis=require(_0x427e('0x11'));var authService=require(_0x427e('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x427e('0x13'));var hardwareService=require(_0x427e('0x14'));var logger=require(_0x427e('0x15'))(_0x427e('0x16'));var utils=require(_0x427e('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x427e('0x18'));var db=require(_0x427e('0x19'))['db'];function respondWithStatusCode(_0x5764b7,_0x183228){_0x183228=_0x183228||0xcc;return function(_0x6522b7){if(_0x6522b7){return _0x5764b7[_0x427e('0x1a')](_0x183228);}return _0x5764b7[_0x427e('0x1b')](_0x183228)[_0x427e('0x1c')]();};}function respondWithResult(_0x1127a1,_0x4e2446){_0x4e2446=_0x4e2446||0xc8;return function(_0xfc052d){if(_0xfc052d){return _0x1127a1['status'](_0x4e2446)['json'](_0xfc052d);}};}function respondWithFilteredResult(_0x290868,_0x5062de){return function(_0x1c7379){if(_0x1c7379){var _0x23a35a=typeof _0x5062de['offset']===_0x427e('0x1d')&&typeof _0x5062de[_0x427e('0x1e')]===_0x427e('0x1d');var _0x3fd9c3=_0x1c7379['count'];var _0x57ea9d=_0x23a35a?0x0:_0x5062de[_0x427e('0x1f')];var _0x512a38=_0x23a35a?_0x1c7379[_0x427e('0x20')]:_0x5062de[_0x427e('0x1f')]+_0x5062de[_0x427e('0x1e')];var _0x44722d;if(_0x512a38>=_0x3fd9c3){_0x512a38=_0x3fd9c3;_0x44722d=0xc8;}else{_0x44722d=0xce;}_0x290868['status'](_0x44722d);return _0x290868[_0x427e('0x21')](_0x427e('0x22'),_0x57ea9d+'-'+_0x512a38+'/'+_0x3fd9c3)[_0x427e('0x23')](_0x1c7379);}return null;};}function patchUpdates(_0xb2b594){return function(_0x1a3c14){try{jsonpatch[_0x427e('0x24')](_0x1a3c14,_0xb2b594,!![]);}catch(_0x6616bb){return BPromise[_0x427e('0x25')](_0x6616bb);}return _0x1a3c14[_0x427e('0x26')]();};}function saveUpdates(_0x2343cd,_0x83ac2e){return function(_0x34ff00){if(_0x34ff00){return _0x34ff00[_0x427e('0x27')](_0x2343cd)['then'](function(_0x52848a){return _0x52848a;});}return null;};}function removeEntity(_0x1e15d6,_0x3f3d19){return function(_0x33306e){if(_0x33306e){return _0x33306e[_0x427e('0x28')]()[_0x427e('0x29')](function(){var _0x2a1ef2=_0x33306e['get']({'plain':!![]});var _0x38dae2='Companies';return db[_0x427e('0x2a')]['destroy']({'where':{'type':_0x38dae2,'resourceId':_0x2a1ef2['id']}})['then'](function(){return _0x33306e;});})[_0x427e('0x29')](function(){_0x1e15d6[_0x427e('0x1b')](0xcc)[_0x427e('0x1c')]();});}};}function handleEntityNotFound(_0x414617,_0x2df916){return function(_0x3be449){if(!_0x3be449){_0x414617['sendStatus'](0x194);}return _0x3be449;};}function handleError(_0x506004,_0x38f082){_0x38f082=_0x38f082||0x1f4;return function(_0x229eda){logger[_0x427e('0x2b')](_0x229eda[_0x427e('0x2c')]);if(_0x229eda[_0x427e('0x2d')]){delete _0x229eda[_0x427e('0x2d')];}_0x506004['status'](_0x38f082)['send'](_0x229eda);};}exports[_0x427e('0x2e')]=function(_0x472359,_0x1835b4){var _0x2da28c={},_0x314c53={},_0x26b477={'count':0x0,'rows':[]};return db[_0x427e('0x2f')][_0x427e('0x30')]()[_0x427e('0x29')](function(_0x1c14e1){_0x314c53[_0x427e('0x31')]=_['keys'](_0x1c14e1);_0x314c53[_0x427e('0x32')]=_[_0x427e('0x33')](_0x472359[_0x427e('0x32')]);_0x314c53['filters']=_[_0x427e('0x34')](_0x314c53['model'],_0x314c53[_0x427e('0x32')]);_0x2da28c['attributes']=_[_0x427e('0x34')](_0x314c53[_0x427e('0x31')],qs[_0x427e('0x35')](_0x472359[_0x427e('0x32')][_0x427e('0x35')]));_0x2da28c[_0x427e('0x36')]=_0x2da28c[_0x427e('0x36')][_0x427e('0x37')]?_0x2da28c[_0x427e('0x36')]:_0x314c53[_0x427e('0x31')];if(!_0x472359['query'][_0x427e('0x38')]('nolimit')){_0x2da28c[_0x427e('0x1e')]=qs['limit'](_0x472359[_0x427e('0x32')][_0x427e('0x1e')]);_0x2da28c[_0x427e('0x1f')]=qs[_0x427e('0x1f')](_0x472359[_0x427e('0x32')][_0x427e('0x1f')]);}_0x2da28c[_0x427e('0x39')]=qs[_0x427e('0x3a')](_0x472359[_0x427e('0x32')][_0x427e('0x3a')]);_0x2da28c[_0x427e('0x3b')]=qs['filters'](_[_0x427e('0x3c')](_0x472359[_0x427e('0x32')],_0x314c53[_0x427e('0x3d')]),_0x1c14e1);if(_0x472359['query']['filter']){_0x2da28c[_0x427e('0x3b')]=_[_0x427e('0x3e')](_0x2da28c[_0x427e('0x3b')],{'$or':_[_0x427e('0x3f')](_0x2da28c[_0x427e('0x36')],function(_0x5f44cf){var _0x247621={};_0x247621[_0x5f44cf]={'$like':'%'+_0x472359[_0x427e('0x32')][_0x427e('0x40')]+'%'};return _0x247621;})});}_0x2da28c=_[_0x427e('0x3e')]({},_0x2da28c,_0x472359['options']);var _0x165728={'where':_0x2da28c[_0x427e('0x3b')]};return db[_0x427e('0x2f')][_0x427e('0x20')](_0x165728)['then'](function(_0xb96c19){_0x26b477['count']=_0xb96c19;if(_0x472359[_0x427e('0x32')][_0x427e('0x41')]){_0x2da28c[_0x427e('0x42')]=[{'all':!![]}];}return db['CmCompany'][_0x427e('0x43')](_0x2da28c);})['then'](function(_0x4058e7){_0x26b477[_0x427e('0x44')]=_0x4058e7;return _0x26b477;})['then'](respondWithFilteredResult(_0x1835b4,_0x2da28c))['catch'](handleError(_0x1835b4,null));})['catch'](handleError(_0x1835b4,null));};exports[_0x427e('0x45')]=function(_0x51c388,_0x3818e6){var _0x3ac8ea={'raw':![],'where':{'id':_0x51c388['params']['id']}},_0x315d05={};_0x315d05[_0x427e('0x31')]=_[_0x427e('0x33')](db['CmCompany'][_0x427e('0x46')]);_0x315d05[_0x427e('0x32')]=_['keys'](_0x51c388[_0x427e('0x32')]);_0x315d05['filters']=_[_0x427e('0x34')](_0x315d05[_0x427e('0x31')],_0x315d05[_0x427e('0x32')]);_0x3ac8ea[_0x427e('0x36')]=_['intersection'](_0x315d05[_0x427e('0x31')],qs['fields'](_0x51c388[_0x427e('0x32')]['fields']));_0x3ac8ea[_0x427e('0x36')]=_0x3ac8ea[_0x427e('0x36')][_0x427e('0x37')]?_0x3ac8ea[_0x427e('0x36')]:_0x315d05[_0x427e('0x31')];if(_0x51c388['query']['includeAll']){_0x3ac8ea[_0x427e('0x42')]=[{'all':!![]}];}_0x3ac8ea=_[_0x427e('0x3e')]({},_0x3ac8ea,_0x51c388[_0x427e('0x47')]);return db[_0x427e('0x2f')]['find'](_0x3ac8ea)['then'](handleEntityNotFound(_0x3818e6,null))['then'](respondWithResult(_0x3818e6,null))[_0x427e('0x48')](handleError(_0x3818e6,null));};exports[_0x427e('0x49')]=function(_0x5b6795,_0x52d2d8){return db['CmCompany']['create'](_0x5b6795[_0x427e('0x4a')],{})[_0x427e('0x29')](function(_0x3f0be9){var _0x1b0a3a=_0x5b6795[_0x427e('0x4b')][_0x427e('0x4c')]({'plain':!![]});if(!_0x1b0a3a)throw new Error(_0x427e('0x4d'));if(_0x1b0a3a[_0x427e('0x4e')]===_0x427e('0x4b')){var _0x2cf7f9=_0x3f0be9[_0x427e('0x4c')]({'plain':!![]});var _0xbeb2b5='Companies';return db['UserProfileSection'][_0x427e('0x4f')]({'where':{'name':_0xbeb2b5,'userProfileId':_0x1b0a3a[_0x427e('0x50')]},'raw':!![]})[_0x427e('0x29')](function(_0x1cb591){if(_0x1cb591&&_0x1cb591[_0x427e('0x51')]===0x0){return db[_0x427e('0x2a')][_0x427e('0x49')]({'name':_0x2cf7f9[_0x427e('0x2d')],'resourceId':_0x2cf7f9['id'],'type':_0x1cb591[_0x427e('0x2d')],'sectionId':_0x1cb591['id']},{})[_0x427e('0x29')](function(){return _0x3f0be9;});}else{return _0x3f0be9;}})[_0x427e('0x48')](function(_0x183e71){logger[_0x427e('0x2b')](_0x427e('0x52'),_0x183e71);throw _0x183e71;});}return _0x3f0be9;})[_0x427e('0x29')](respondWithResult(_0x52d2d8,0xc9))[_0x427e('0x48')](handleError(_0x52d2d8,null));};exports[_0x427e('0x27')]=function(_0x20558d,_0x2b1dba){if(_0x20558d[_0x427e('0x4a')]['id']){delete _0x20558d[_0x427e('0x4a')]['id'];}return db[_0x427e('0x2f')][_0x427e('0x4f')]({'where':{'id':_0x20558d['params']['id']}})[_0x427e('0x29')](handleEntityNotFound(_0x2b1dba,null))[_0x427e('0x29')](saveUpdates(_0x20558d['body'],null))[_0x427e('0x29')](respondWithResult(_0x2b1dba,null))[_0x427e('0x48')](handleError(_0x2b1dba,null));};exports[_0x427e('0x28')]=function(_0x42e4f4,_0x2cc59d){return db[_0x427e('0x2f')][_0x427e('0x4f')]({'where':{'id':_0x42e4f4['params']['id']}})[_0x427e('0x29')](handleEntityNotFound(_0x2cc59d,null))[_0x427e('0x29')](removeEntity(_0x2cc59d,null))[_0x427e('0x48')](handleError(_0x2cc59d,null));};exports['describe']=function(_0x9c17e0,_0x3148a3){return db[_0x427e('0x2f')][_0x427e('0x30')]()[_0x427e('0x29')](respondWithResult(_0x3148a3,null))['catch'](handleError(_0x3148a3,null));};exports[_0x427e('0x53')]=function(_0xe1e07d,_0x57a92f,_0x36f8de){return db[_0x427e('0x54')][_0x427e('0x4f')]({'where':{'id':_0xe1e07d[_0x427e('0x55')]['id']}})[_0x427e('0x29')](handleEntityNotFound(_0x57a92f,null))[_0x427e('0x29')](function(_0x4bc0de){if(_0x4bc0de){return _0x4bc0de['addContacts'](_0xe1e07d[_0x427e('0x4a')][_0x427e('0x56')],_[_0x427e('0x57')](_0xe1e07d[_0x427e('0x4a')],[_0x427e('0x56'),'id'])||{});}})[_0x427e('0x29')](respondWithResult(_0x57a92f,null))[_0x427e('0x48')](handleError(_0x57a92f,null));};exports['getContacts']=function(_0x41a7eb,_0x55df5e,_0x12abfd){var _0x321c45={};var _0x4332df={};var _0x2ef444;var _0x43fb76;return db[_0x427e('0x2f')][_0x427e('0x58')]({'where':{'id':_0x41a7eb[_0x427e('0x55')]['id']}})[_0x427e('0x29')](handleEntityNotFound(_0x55df5e,null))[_0x427e('0x29')](function(_0x374305){if(_0x374305){_0x2ef444=_0x374305;_0x4332df[_0x427e('0x31')]=_[_0x427e('0x33')](db['CmContact'][_0x427e('0x46')]);_0x4332df[_0x427e('0x32')]=_[_0x427e('0x33')](_0x41a7eb[_0x427e('0x32')]);_0x4332df['filters']=_[_0x427e('0x34')](_0x4332df[_0x427e('0x31')],_0x4332df[_0x427e('0x32')]);_0x321c45[_0x427e('0x36')]=_['intersection'](_0x4332df['model'],qs['fields'](_0x41a7eb[_0x427e('0x32')][_0x427e('0x35')]));_0x321c45['attributes']=_0x321c45['attributes'][_0x427e('0x37')]?_0x321c45[_0x427e('0x36')]:_0x4332df['model'];_0x321c45[_0x427e('0x39')]=qs[_0x427e('0x3a')](_0x41a7eb[_0x427e('0x32')][_0x427e('0x3a')]);_0x321c45[_0x427e('0x3b')]=qs[_0x427e('0x3d')](_['pick'](_0x41a7eb[_0x427e('0x32')],_0x4332df[_0x427e('0x3d')]));if(_0x41a7eb['query']['filter']){_0x321c45[_0x427e('0x3b')]=_[_0x427e('0x3e')](_0x321c45[_0x427e('0x3b')],{'$or':_['map'](_0x321c45['attributes'],function(_0x308d00){var _0x3a697e={};_0x3a697e[_0x308d00]={'$like':'%'+_0x41a7eb[_0x427e('0x32')]['filter']+'%'};return _0x3a697e;})});}_0x321c45=_[_0x427e('0x3e')]({},_0x321c45,_0x41a7eb[_0x427e('0x47')]);return _0x2ef444[_0x427e('0x59')](_0x321c45);}})[_0x427e('0x29')](function(_0x76d48e){if(_0x76d48e){_0x43fb76=_0x76d48e[_0x427e('0x37')];if(!_0x41a7eb[_0x427e('0x32')][_0x427e('0x38')]('nolimit')){_0x321c45[_0x427e('0x1e')]=qs['limit'](_0x41a7eb['query']['limit']);_0x321c45[_0x427e('0x1f')]=qs['offset'](_0x41a7eb[_0x427e('0x32')][_0x427e('0x1f')]);}return _0x2ef444['getContacts'](_0x321c45);}})[_0x427e('0x29')](function(_0x46ce85){if(_0x46ce85){return _0x46ce85?{'count':_0x43fb76,'rows':_0x46ce85}:null;}})[_0x427e('0x29')](respondWithResult(_0x55df5e,null))[_0x427e('0x48')](handleError(_0x55df5e,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index 040e890..6e13cd7 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 _0x0ed7=['api','moment','bluebird','request-promise','path','../../config/environment','./cmCompany.attributes','exports','define','CmCompany','cm_companies','lodash','util','../../config/logger'];(function(_0x598ac5,_0x11aa0e){var _0x317e7f=function(_0x487a5a){while(--_0x487a5a){_0x598ac5['push'](_0x598ac5['shift']());}};_0x317e7f(++_0x11aa0e);}(_0x0ed7,0x1d9));var _0x70ed=function(_0x5317b5,_0x4dfd6e){_0x5317b5=_0x5317b5-0x0;var _0x3b7ce2=_0x0ed7[_0x5317b5];return _0x3b7ce2;};'use strict';var _=require(_0x70ed('0x0'));var util=require(_0x70ed('0x1'));var logger=require(_0x70ed('0x2'))(_0x70ed('0x3'));var moment=require(_0x70ed('0x4'));var BPromise=require(_0x70ed('0x5'));var rp=require(_0x70ed('0x6'));var fs=require('fs');var path=require(_0x70ed('0x7'));var rimraf=require('rimraf');var config=require(_0x70ed('0x8'));var attributes=require(_0x70ed('0x9'));module[_0x70ed('0xa')]=function(_0x285d70,_0x2159c6){return _0x285d70[_0x70ed('0xb')](_0x70ed('0xc'),attributes,{'tableName':_0x70ed('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x623f=['./cmCompany.attributes','exports','define','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x8bf685,_0x1cb3c7){var _0xd13234=function(_0x343121){while(--_0x343121){_0x8bf685['push'](_0x8bf685['shift']());}};_0xd13234(++_0x1cb3c7);}(_0x623f,0x19a));var _0xf623=function(_0x4cc053,_0x2a65b0){_0x4cc053=_0x4cc053-0x0;var _0x10ddf6=_0x623f[_0x4cc053];return _0x10ddf6;};'use strict';var _=require(_0xf623('0x0'));var util=require(_0xf623('0x1'));var logger=require(_0xf623('0x2'))('api');var moment=require(_0xf623('0x3'));var BPromise=require(_0xf623('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf623('0x5'));var rimraf=require(_0xf623('0x6'));var config=require(_0xf623('0x7'));var attributes=require(_0xf623('0x8'));module[_0xf623('0x9')]=function(_0x2b9260,_0x374b0d){return _0x2b9260[_0xf623('0xa')]('CmCompany',attributes,{'tableName':'cm_companies','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.rpc.js b/server/api/cmCompany/cmCompany.rpc.js index 1da5d89..49e6c9a 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 _0xc3b1=['result','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','CmCompany,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info'];(function(_0x916117,_0x3101da){var _0x5ddef9=function(_0x43136a){while(--_0x43136a){_0x916117['push'](_0x916117['shift']());}};_0x5ddef9(++_0x3101da);}(_0xc3b1,0x10f));var _0x1c3b=function(_0x2ecf13,_0x213a49){_0x2ecf13=_0x2ecf13-0x0;var _0x423a67=_0xc3b1[_0x2ecf13];return _0x423a67;};'use strict';var _=require(_0x1c3b('0x0'));var util=require('util');var moment=require(_0x1c3b('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1c3b('0x2'));var db=require(_0x1c3b('0x3'))['db'];var utils=require(_0x1c3b('0x4'));var logger=require(_0x1c3b('0x5'))('rpc');var config=require(_0x1c3b('0x6'));var jayson=require(_0x1c3b('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xa3b870,_0x1c53a9,_0x32ac49){return new BPromise(function(_0x261f47,_0x30a82d){return client[_0x1c3b('0x8')](_0xa3b870,_0x32ac49)[_0x1c3b('0x9')](function(_0x1ac37c){logger['info'](_0x1c3b('0xa'),_0x1c53a9,_0x1c3b('0xb'));logger['debug']('CmCompany,\x20%s,\x20%s,\x20%s',_0x1c53a9,'request\x20sent',JSON[_0x1c3b('0xc')](_0x1ac37c));if(_0x1ac37c[_0x1c3b('0xd')]){if(_0x1ac37c['error'][_0x1c3b('0xe')]===0x1f4){logger[_0x1c3b('0xd')](_0x1c3b('0xa'),_0x1c53a9,_0x1ac37c[_0x1c3b('0xd')][_0x1c3b('0xf')]);return _0x30a82d(_0x1ac37c['error'][_0x1c3b('0xf')]);}logger[_0x1c3b('0xd')](_0x1c3b('0xa'),_0x1c53a9,_0x1ac37c[_0x1c3b('0xd')]['message']);return _0x261f47(_0x1ac37c[_0x1c3b('0xd')][_0x1c3b('0xf')]);}else{logger[_0x1c3b('0x10')](_0x1c3b('0xa'),_0x1c53a9,'request\x20sent');_0x261f47(_0x1ac37c[_0x1c3b('0x11')][_0x1c3b('0xf')]);}})['catch'](function(_0x6aafba){logger[_0x1c3b('0xd')](_0x1c3b('0xa'),_0x1c53a9,_0x6aafba);_0x30a82d(_0x6aafba);});});} \ No newline at end of file +var _0x44c4=['info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then'];(function(_0x5a612c,_0x33e310){var _0x4a8e51=function(_0x21f180){while(--_0x21f180){_0x5a612c['push'](_0x5a612c['shift']());}};_0x4a8e51(++_0x33e310);}(_0x44c4,0x13d));var _0x444c=function(_0x176e46,_0x298091){_0x176e46=_0x176e46-0x0;var _0x546a76=_0x44c4[_0x176e46];return _0x546a76;};'use strict';var _=require('lodash');var util=require(_0x444c('0x0'));var moment=require(_0x444c('0x1'));var BPromise=require(_0x444c('0x2'));var rs=require(_0x444c('0x3'));var fs=require('fs');var Redis=require(_0x444c('0x4'));var db=require(_0x444c('0x5'))['db'];var utils=require(_0x444c('0x6'));var logger=require('../../config/logger')(_0x444c('0x7'));var config=require(_0x444c('0x8'));var jayson=require(_0x444c('0x9'));var client=jayson[_0x444c('0xa')][_0x444c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4445ec,_0x4c83b2,_0xc679d0){return new BPromise(function(_0x5c8fc4,_0x5d0f99){return client['request'](_0x4445ec,_0xc679d0)[_0x444c('0xc')](function(_0x2fc491){logger[_0x444c('0xd')](_0x444c('0xe'),_0x4c83b2,_0x444c('0xf'));logger[_0x444c('0x10')](_0x444c('0x11'),_0x4c83b2,_0x444c('0xf'),JSON['stringify'](_0x2fc491));if(_0x2fc491[_0x444c('0x12')]){if(_0x2fc491[_0x444c('0x12')][_0x444c('0x13')]===0x1f4){logger[_0x444c('0x12')](_0x444c('0xe'),_0x4c83b2,_0x2fc491[_0x444c('0x12')][_0x444c('0x14')]);return _0x5d0f99(_0x2fc491['error'][_0x444c('0x14')]);}logger[_0x444c('0x12')](_0x444c('0xe'),_0x4c83b2,_0x2fc491[_0x444c('0x12')][_0x444c('0x14')]);return _0x5c8fc4(_0x2fc491[_0x444c('0x12')][_0x444c('0x14')]);}else{logger['info'](_0x444c('0xe'),_0x4c83b2,_0x444c('0xf'));_0x5c8fc4(_0x2fc491['result'][_0x444c('0x14')]);}})[_0x444c('0x15')](function(_0x5422f5){logger['error'](_0x444c('0xe'),_0x4c83b2,_0x5422f5);_0x5d0f99(_0x5422f5);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index e377ed0..da99dbd 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 _0xe2da=['../../config/environment','./cmCompany.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/contacts','getContacts','post','create','addContacts','put','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x53f152,_0x7e09db){var _0x54e658=function(_0x597bf0){while(--_0x597bf0){_0x53f152['push'](_0x53f152['shift']());}};_0x54e658(++_0x7e09db);}(_0xe2da,0xc8));var _0xae2d=function(_0x195e0b,_0x3c536b){_0x195e0b=_0x195e0b-0x0;var _0x3df39e=_0xe2da[_0x195e0b];return _0x3df39e;};'use strict';var multer=require(_0xae2d('0x0'));var util=require(_0xae2d('0x1'));var path=require(_0xae2d('0x2'));var timeout=require(_0xae2d('0x3'));var express=require(_0xae2d('0x4'));var router=express['Router']();var fs_extra=require(_0xae2d('0x5'));var auth=require(_0xae2d('0x6'));var interaction=require(_0xae2d('0x7'));var config=require(_0xae2d('0x8'));var controller=require(_0xae2d('0x9'));router[_0xae2d('0xa')]('/',auth['isAuthenticated'](),controller[_0xae2d('0xb')]);router['get'](_0xae2d('0xc'),auth[_0xae2d('0xd')](),controller[_0xae2d('0xe')]);router['get'](_0xae2d('0xf'),auth[_0xae2d('0xd')](),controller[_0xae2d('0x10')]);router[_0xae2d('0xa')](_0xae2d('0x11'),auth[_0xae2d('0xd')](),controller[_0xae2d('0x12')]);router[_0xae2d('0x13')]('/',auth[_0xae2d('0xd')](),controller[_0xae2d('0x14')]);router['post']('/:id/contacts',auth['isAuthenticated'](),controller[_0xae2d('0x15')]);router[_0xae2d('0x16')](_0xae2d('0xf'),auth[_0xae2d('0xd')](),controller['update']);router[_0xae2d('0x17')](_0xae2d('0xf'),auth[_0xae2d('0xd')](),controller[_0xae2d('0x18')]);module[_0xae2d('0x19')]=router; \ No newline at end of file +var _0xe485=['index','show','/:id/contacts','getContacts','post','create','addContacts','/:id','update','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./cmCompany.controller','get','isAuthenticated'];(function(_0x1a7cd1,_0x22824d){var _0x5553f6=function(_0x4537a6){while(--_0x4537a6){_0x1a7cd1['push'](_0x1a7cd1['shift']());}};_0x5553f6(++_0x22824d);}(_0xe485,0x114));var _0x5e48=function(_0x2e8651,_0x3da688){_0x2e8651=_0x2e8651-0x0;var _0x58949f=_0xe485[_0x2e8651];return _0x58949f;};'use strict';var multer=require(_0x5e48('0x0'));var util=require('util');var path=require(_0x5e48('0x1'));var timeout=require(_0x5e48('0x2'));var express=require(_0x5e48('0x3'));var router=express['Router']();var fs_extra=require(_0x5e48('0x4'));var auth=require(_0x5e48('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x5e48('0x6'));var controller=require(_0x5e48('0x7'));router[_0x5e48('0x8')]('/',auth[_0x5e48('0x9')](),controller[_0x5e48('0xa')]);router['get']('/describe',auth[_0x5e48('0x9')](),controller['describe']);router[_0x5e48('0x8')]('/:id',auth[_0x5e48('0x9')](),controller[_0x5e48('0xb')]);router['get'](_0x5e48('0xc'),auth[_0x5e48('0x9')](),controller[_0x5e48('0xd')]);router[_0x5e48('0xe')]('/',auth[_0x5e48('0x9')](),controller[_0x5e48('0xf')]);router[_0x5e48('0xe')](_0x5e48('0xc'),auth[_0x5e48('0x9')](),controller[_0x5e48('0x10')]);router['put'](_0x5e48('0x11'),auth['isAuthenticated'](),controller[_0x5e48('0x12')]);router[_0x5e48('0x13')](_0x5e48('0x11'),auth[_0x5e48('0x9')](),controller[_0x5e48('0x14')]);module[_0x5e48('0x15')]=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index 151d68c..cfa4a50 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 _0x1436=['NOW','sequelize','exports','STRING','TEXT','INTEGER','DATE'];(function(_0x47a385,_0x5d8781){var _0x31abb9=function(_0x210f7a){while(--_0x210f7a){_0x47a385['push'](_0x47a385['shift']());}};_0x31abb9(++_0x5d8781);}(_0x1436,0x1eb));var _0x6143=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x1436[_0x19950b];return _0x3c6b41;};'use strict';var _=require('lodash');var Sequelize=require(_0x6143('0x0'));module[_0x6143('0x1')]={'firstName':{'type':Sequelize[_0x6143('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x6143('0x2')]},'street':{'type':Sequelize[_0x6143('0x2')]},'postalCode':{'type':Sequelize[_0x6143('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0x6143('0x2')]},'description':{'type':Sequelize[_0x6143('0x3')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x6143('0x2')]},'fax':{'type':Sequelize[_0x6143('0x2')]},'email':{'type':Sequelize[_0x6143('0x2')]},'url':{'type':Sequelize[_0x6143('0x2')]},'facebook':{'type':Sequelize[_0x6143('0x2')]},'fb_data':{'type':Sequelize[_0x6143('0x2')]},'twitter':{'type':Sequelize[_0x6143('0x2')]},'skype':{'type':Sequelize[_0x6143('0x2')]},'teams':{'type':Sequelize[_0x6143('0x2')]},'viber':{'type':Sequelize[_0x6143('0x2')]},'line':{'type':Sequelize[_0x6143('0x2')]},'wechat':{'type':Sequelize[_0x6143('0x2')]},'telegram':{'type':Sequelize[_0x6143('0x2')]},'UserId':{'type':Sequelize['INTEGER']},'AdditionalPhones':{'type':Sequelize[_0x6143('0x2')]},'priority':{'type':Sequelize[_0x6143('0x4')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x6143('0x5')],'defaultValue':Sequelize[_0x6143('0x6')]},'dialTimezone':{'type':Sequelize[_0x6143('0x2')]},'utcOffset':{'type':Sequelize[_0x6143('0x4')]}}; \ No newline at end of file +var _0xf4c5=['NOW','lodash','sequelize','exports','STRING','INTEGER','UNSIGNED','DATE'];(function(_0x18bc72,_0x1b2062){var _0x3db2c0=function(_0x2c6256){while(--_0x2c6256){_0x18bc72['push'](_0x18bc72['shift']());}};_0x3db2c0(++_0x1b2062);}(_0xf4c5,0x1a9));var _0x5f4c=function(_0x1e393b,_0x355f6b){_0x1e393b=_0x1e393b-0x0;var _0x3d0bfe=_0xf4c5[_0x1e393b];return _0x3d0bfe;};'use strict';var _=require(_0x5f4c('0x0'));var Sequelize=require(_0x5f4c('0x1'));module[_0x5f4c('0x2')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0x5f4c('0x3')]},'street':{'type':Sequelize[_0x5f4c('0x3')]},'postalCode':{'type':Sequelize[_0x5f4c('0x3')]},'city':{'type':Sequelize[_0x5f4c('0x3')]},'country':{'type':Sequelize[_0x5f4c('0x3')]},'dateOfBirth':{'type':Sequelize[_0x5f4c('0x3')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x5f4c('0x3')]},'fax':{'type':Sequelize[_0x5f4c('0x3')]},'email':{'type':Sequelize[_0x5f4c('0x3')]},'url':{'type':Sequelize[_0x5f4c('0x3')]},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize[_0x5f4c('0x3')]},'twitter':{'type':Sequelize[_0x5f4c('0x3')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0x5f4c('0x3')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0x5f4c('0x3')]},'telegram':{'type':Sequelize[_0x5f4c('0x3')]},'UserId':{'type':Sequelize[_0x5f4c('0x4')]},'AdditionalPhones':{'type':Sequelize[_0x5f4c('0x3')]},'priority':{'type':Sequelize[_0x5f4c('0x4')](0x2)[_0x5f4c('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x5f4c('0x6')],'defaultValue':Sequelize[_0x5f4c('0x7')]},'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 9afd072..2ebf5f7 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 _0x658c=['range','parse','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','uniqueid','type','destination','callerid','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','startCase','Website','closed','closedAt','secondDisposition','key','Owner','DESC','customerIp','customerPort','deviceModel','ratingMessage','ratingType','ratingValue','referer','subject','threadId','findAndCountAll','flatten','sortBy','reverse','moment','bluebird','util','path','lodash','squel','papaparse','ioredis','../../components/contacts','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/environment/shared','../../mysqldb','redis','defaults','localhost','register','status','offset','limit','undefined','count','set','then','destroy','end','sendStatus','error','name','send','describe','getOptions','query','catch','CmContact','find','keys','startsWith','cf_','displayName','CmCustomField','findAll','length','columnName','alias','values','info','Custom\x20field\x20%s\x20not\x20found\x20on\x20cm_contacts\x20table','forEach','hasOwnProperty','merge','body','from','get','mergeWith','isArray','tags','join','[CmContact][merge]\x20to\x20%s\x20from\x20%s','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','create','ChatInteraction','update','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal','CmHopperHistory','ReportAgentPreview','VoiceCallReport','ChatQueueReport','FaxQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','isNil','dialTimezone','timezones','utcOffset','additionalPhones','bulkCreate','each','duplicates','where','$or','push','ListId','findOrCreate','spread','contact','all','show','Tag','Tags','tag','Phones','params','ContactItemType','ItemType','sequelize','literal','$and','omit','map','format','cf_%d','pickBy','isEmpty','cm_contacts','setFields','id\x20=\x20?','toParam','text','phone','CmHopper','findOne','model','filters','intersection','attributes','fields','order','sort','pick','filter','getTags','setTags','ids','setAdditionalPhones','item_types','items','ItemTypeId','description','OrderBy','contact\x20phone\x20exists','PHONE','CmHopperAdditionalPhone','item','`ItemType`.OrderBy','CmHopperId','ItemType.OrderBy','getAdditionalPhones','duplicateAdditionalPhones','fromContactId','CmContactId','toContactId','rescheduleAdditionalPhones','hopperId','rawAttributes','nolimit','ContactId','options','include','rows','getHopperHistories','getHopperFinals','includeAll','getJscriptySessions','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','split','Incorrect\x20binding\x20parameters\x20passed!','zipObject','firstName','root','server/files/tmp','filename','chmodSync','0777','child_process','CompanyId','json','File\x20uploaded\x20correctly!','upload','createReadStream','file','import','User','agent','binding','No\x20firstName\x20column\x20specified','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','fork','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','pid','exit','error\x20child\x20process','importUpdates','No\x20phone\x20column\x20specified','getJourney','chat','sms','openchannel','fax','whatsapp','voice','-createdAt','resolve','includes','channel','toLowerCase'];(function(_0x46cf00,_0x457a43){var _0x3974dc=function(_0x4b5d0a){while(--_0x4b5d0a){_0x46cf00['push'](_0x46cf00['shift']());}};_0x3974dc(++_0x457a43);}(_0x658c,0x129));var _0xc658=function(_0x450210,_0x4cbf0f){_0x450210=_0x450210-0x0;var _0x541e23=_0x658c[_0x450210];return _0x541e23;};'use strict';var moment=require(_0xc658('0x0'));var BPromise=require(_0xc658('0x1'));var util=require(_0xc658('0x2'));var path=require(_0xc658('0x3'));var fs=require('fs');var _=require(_0xc658('0x4'));var squel=require(_0xc658('0x5'));var Papa=require(_0xc658('0x6'));var Redis=require(_0xc658('0x7'));var contacts=require(_0xc658('0x8'));var qs=require(_0xc658('0x9'));var logger=require(_0xc658('0xa'))(_0xc658('0xb'));var config=require(_0xc658('0xc'));var shared=require(_0xc658('0xd'));var db=require(_0xc658('0xe'))['db'];config[_0xc658('0xf')]=_[_0xc658('0x10')](config[_0xc658('0xf')],{'host':_0xc658('0x11'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc658('0xf')]));require('./cmContact.socket')[_0xc658('0x12')](socket);function respondWithResult(_0x184e10,_0x3b96fd){_0x3b96fd=_0x3b96fd||0xc8;return function(_0x4063ce){if(_0x4063ce){return _0x184e10[_0xc658('0x13')](_0x3b96fd)['json'](_0x4063ce);}};}function respondWithFilteredResult(_0x51087c,_0x1473f0){return function(_0x54b749){if(_0x54b749){var _0x1eb565=typeof _0x1473f0[_0xc658('0x14')]==='undefined'&&typeof _0x1473f0[_0xc658('0x15')]===_0xc658('0x16');var _0x44e447=_0x54b749[_0xc658('0x17')];var _0x5924fb=_0x1eb565?0x0:_0x1473f0[_0xc658('0x14')];var _0x5b90db=_0x1eb565?_0x54b749[_0xc658('0x17')]:_0x1473f0[_0xc658('0x14')]+_0x1473f0['limit'];var _0xb6f390;if(_0x5b90db>=_0x44e447){_0x5b90db=_0x44e447;_0xb6f390=0xc8;}else{_0xb6f390=0xce;}_0x51087c[_0xc658('0x13')](_0xb6f390);return _0x51087c[_0xc658('0x18')]('Content-Range',_0x5924fb+'-'+_0x5b90db+'/'+_0x44e447)['json'](_0x54b749);}return null;};}function saveUpdates(_0xa0ad5){return function(_0x4a8d06){if(_0x4a8d06){return _0x4a8d06['update'](_0xa0ad5)[_0xc658('0x19')](function(_0x1c3d2f){return _0x1c3d2f;});}return null;};}function removeEntity(_0x3f6159){return function(_0x58ccfd){if(_0x58ccfd){return _0x58ccfd[_0xc658('0x1a')]()[_0xc658('0x19')](function(){_0x3f6159['status'](0xcc)[_0xc658('0x1b')]();});}};}function handleEntityNotFound(_0x1d40d5){return function(_0x1f76d6){if(!_0x1f76d6){_0x1d40d5[_0xc658('0x1c')](0x194);}return _0x1f76d6;};}function handleError(_0x5a476c,_0x4cd9b8){_0x4cd9b8=_0x4cd9b8||0x1f4;return function(_0x31d8f9){logger[_0xc658('0x1d')](_0x31d8f9['stack']);if(_0x31d8f9[_0xc658('0x1e')]){delete _0x31d8f9[_0xc658('0x1e')];}_0x5a476c[_0xc658('0x13')](_0x4cd9b8)[_0xc658('0x1f')](_0x31d8f9);};}exports['index']=function(_0x59e8d0,_0x342c1f){var _0x4b550b={};return contacts[_0xc658('0x20')]()[_0xc658('0x19')](function(_0x10e920){_0x4b550b=qs[_0xc658('0x21')](_0x10e920,_0x59e8d0);return contacts['findAll'](_0x59e8d0[_0xc658('0x22')],_0x59e8d0['user'],_0x4b550b,_0x10e920);})[_0xc658('0x19')](respondWithFilteredResult(_0x342c1f,_0x4b550b))[_0xc658('0x23')](handleError(_0x342c1f,null));};exports['destroy']=function(_0x58acfd,_0x1c9388){return db[_0xc658('0x24')][_0xc658('0x25')]({'where':{'id':_0x58acfd['params']['id']}})[_0xc658('0x19')](handleEntityNotFound(_0x1c9388,null))['then'](removeEntity(_0x1c9388,null))[_0xc658('0x23')](handleError(_0x1c9388,null));};exports['describe']=function(_0x4705d4,_0x3e3e6b){return db[_0xc658('0x24')][_0xc658('0x20')]()[_0xc658('0x19')](function(_0x3338ae){delete _0x3338ae['tags'];for(var _0x4336e8=0x0;_0x4336e80x0){return new Promise(function(_0x2ff357){var _0x4437b6=[];for(var _0x462431=0x0;_0x462431<_0x864d1b[_0xc658('0x2c')];_0x462431++){_0x4437b6['push'](insertAdditionalPhones(_0x864d1b[_0x462431][_0xc658('0x63')],_0x864d1b[_0x462431][_0xc658('0x59')]));}Promise[_0xc658('0x64')](_0x4437b6)[_0xc658('0x19')](function(){_0x2ff357(0x1);});})[_0xc658('0x19')](function(){return{'success':_0x1620e9,'failure':_0x113e85,'duplicates':_0x67005c};});}else{return{'success':_0x1620e9,'failure':_0x113e85,'duplicates':_0x67005c};}}})[_0xc658('0x19')](respondWithResult(_0x2ce4d8,0xc9))['catch'](handleError(_0x2ce4d8,null));};exports[_0xc658('0x65')]=function(_0xb6515b,_0x5ea209){var _0x4d3d1b;return db[_0xc658('0x24')][_0xc658('0x20')]()[_0xc658('0x19')](function(_0x16df90){return db[_0xc658('0x24')][_0xc658('0x25')]({'where':{'id':_0xb6515b['params']['id']},'include':[{'model':db[_0xc658('0x66')],'as':_0xc658('0x67'),'attributes':['id',_0xc658('0x1e'),'color'],'required':_0xb6515b[_0xc658('0x22')][_0xc658('0x68')]?!![]:![]},{'model':db['CmContactHasItem'],'as':_0xc658('0x69'),'where':{'CmContactId':_0xb6515b[_0xc658('0x6a')]['id']},'required':![],'include':[{'model':db[_0xc658('0x6b')],'as':_0xc658('0x6c')}]}],'order':[db[_0xc658('0x6d')][_0xc658('0x6e')]('Phones.OrderBy')],'attributes':_[_0xc658('0x26')](_0x16df90)});})[_0xc658('0x19')](function(_0x3bb306){if(!_[_0xc658('0x55')](_0x3bb306)){_0x4d3d1b=_0x3bb306['get']({'plain':!![]});var _0xa206ab={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x3bb306&&_0x3bb306[_0xc658('0x60')]){if(_0x3bb306[_0xc658('0x60')]){_0xa206ab[_0xc658('0x5d')][_0xc658('0x6f')][_0xc658('0x5f')]({'ListId':{'$ne':_0x3bb306[_0xc658('0x60')]}});}}return db[_0xc658('0x2a')][_0xc658('0x2b')](_0xa206ab);}})['then'](function(_0x201887){if(!_['isNil'](_0x201887)){return _[_0xc658('0x70')](_0x4d3d1b,_[_0xc658('0x71')](_0x201887,function(_0x4ef2b0){return util[_0xc658('0x72')](_0xc658('0x73'),_0x4ef2b0['id']);}));}})[_0xc658('0x19')](handleEntityNotFound(_0x5ea209,null))[_0xc658('0x19')](respondWithResult(_0x5ea209,null))[_0xc658('0x23')](handleError(_0x5ea209,null));};exports[_0xc658('0x41')]=function(_0x2b512e,_0x25e69d){var _0x3bcee9;if(_0x2b512e['body']['id']){delete _0x2b512e['body']['id'];}if(!_[_0xc658('0x55')](_0x2b512e[_0xc658('0x35')]['dialTimezone'])){var _0x17ccc8=_0x2b512e[_0xc658('0x35')][_0xc658('0x56')];if(!_[_0xc658('0x55')](shared[_0xc658('0x57')][_0x17ccc8]))_0x2b512e[_0xc658('0x35')]['utcOffset']=shared[_0xc658('0x57')][_0x17ccc8]['utcOffset'];}return db[_0xc658('0x24')][_0xc658('0x25')]({'where':{'id':_0x2b512e['params']['id']}})[_0xc658('0x19')](handleEntityNotFound(_0x25e69d,null))[_0xc658('0x19')](saveUpdates(_0x2b512e[_0xc658('0x35')],null))[_0xc658('0x19')](function(_0x38c193){_0x3bcee9=_0x38c193;var _0x2456d2={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x38c193&&_0x38c193[_0xc658('0x60')]){if(_0x38c193[_0xc658('0x60')]){_0x2456d2[_0xc658('0x5d')][_0xc658('0x6f')][_0xc658('0x5f')]({'ListId':{'$ne':_0x38c193['ListId']}});}}return db['CmCustomField'][_0xc658('0x2b')](_0x2456d2);})[_0xc658('0x19')](function(_0x985631){if(_0x985631){return _[_0xc658('0x70')](_[_0xc658('0x74')](_0x2b512e[_0xc658('0x35')],function(_0x317cf5,_0x1fe96e){return _['startsWith'](_0x1fe96e,_0xc658('0x28'));}),_[_0xc658('0x71')](_0x985631,function(_0x5e46c8){return util['format'](_0xc658('0x73'),_0x5e46c8['id']);}));}})[_0xc658('0x19')](function(_0x40fdca){if(_0x40fdca&&!_[_0xc658('0x75')](_0x40fdca)){var _0x55823a=squel[_0xc658('0x41')]()['table'](_0xc658('0x76'))[_0xc658('0x77')](_0x40fdca)['where'](_0xc658('0x78'),_0x2b512e[_0xc658('0x6a')]['id'])[_0xc658('0x79')]();return db[_0xc658('0x6d')][_0xc658('0x22')](_0x55823a[_0xc658('0x7a')],{'replacements':_0x55823a[_0xc658('0x2f')]});}})['then'](function(){if(_0x2b512e[_0xc658('0x35')][_0xc658('0x7b')]&&_0x3bcee9){return db[_0xc658('0x7c')][_0xc658('0x41')]({'phone':_0x2b512e[_0xc658('0x35')]['phone'],'OrderBy':0x0},{'where':{'ContactId':_0x3bcee9['id']}});}})[_0xc658('0x19')](function(){return _0x3bcee9;})[_0xc658('0x19')](respondWithResult(_0x25e69d,null))[_0xc658('0x23')](handleError(_0x25e69d,null));};exports['getTags']=function(_0x54600e,_0x2bf52a){var _0x22ec15={};var _0xc33d5b={};var _0x18ed22;var _0x3972ed;return db[_0xc658('0x24')][_0xc658('0x7d')]({'where':{'id':_0x54600e[_0xc658('0x6a')]['id']}})['then'](handleEntityNotFound(_0x2bf52a,null))[_0xc658('0x19')](function(_0x47ec95){if(_0x47ec95){_0x18ed22=_0x47ec95;_0xc33d5b[_0xc658('0x7e')]=_[_0xc658('0x26')](db[_0xc658('0x66')]['rawAttributes']);_0xc33d5b[_0xc658('0x22')]=_[_0xc658('0x26')](_0x54600e[_0xc658('0x22')]);_0xc33d5b[_0xc658('0x7f')]=_[_0xc658('0x80')](_0xc33d5b[_0xc658('0x7e')],_0xc33d5b[_0xc658('0x22')]);_0x22ec15[_0xc658('0x81')]=_['intersection'](_0xc33d5b['model'],qs['fields'](_0x54600e[_0xc658('0x22')][_0xc658('0x82')]));_0x22ec15[_0xc658('0x81')]=_0x22ec15[_0xc658('0x81')]['length']?_0x22ec15[_0xc658('0x81')]:_0xc33d5b[_0xc658('0x7e')];_0x22ec15[_0xc658('0x83')]=qs[_0xc658('0x84')](_0x54600e[_0xc658('0x22')][_0xc658('0x84')]);_0x22ec15['where']=qs[_0xc658('0x7f')](_[_0xc658('0x85')](_0x54600e[_0xc658('0x22')],_0xc33d5b['filters']));if(_0x54600e[_0xc658('0x22')][_0xc658('0x86')]){_0x22ec15[_0xc658('0x5d')]=_['merge'](_0x22ec15['where'],{'$or':_['map'](_0x22ec15[_0xc658('0x81')],function(_0x526f85){var _0x233e4c={};_0x233e4c[_0x526f85]={'$like':'%'+_0x54600e['query'][_0xc658('0x86')]+'%'};return _0x233e4c;})});}_0x22ec15=_['merge']({},_0x22ec15,_0x54600e['options']);return _0x18ed22[_0xc658('0x87')](_0x22ec15);}})[_0xc658('0x19')](function(_0x4abe28){if(_0x4abe28){_0x3972ed=_0x4abe28[_0xc658('0x2c')];if(!_0x54600e[_0xc658('0x22')][_0xc658('0x33')]('nolimit')){_0x22ec15['limit']=qs[_0xc658('0x15')](_0x54600e[_0xc658('0x22')]['limit']);_0x22ec15['offset']=qs[_0xc658('0x14')](_0x54600e[_0xc658('0x22')][_0xc658('0x14')]);}return _0x18ed22[_0xc658('0x87')](_0x22ec15);}})[_0xc658('0x19')](function(_0x2114d1){if(_0x2114d1){return _0x2114d1?{'count':_0x3972ed,'rows':_0x2114d1}:null;}})[_0xc658('0x19')](respondWithResult(_0x2bf52a,null))[_0xc658('0x23')](handleError(_0x2bf52a,null));};exports[_0xc658('0x88')]=function(_0x1e777c,_0x13d7b0){if(_0x1e777c['body']['id']){delete _0x1e777c[_0xc658('0x35')]['id'];}return db[_0xc658('0x24')]['findOne']({'where':{'id':_0x1e777c['params']['id']}})[_0xc658('0x19')](handleEntityNotFound(_0x13d7b0,null))[_0xc658('0x19')](function(_0x2eef1a){if(_0x2eef1a){return _0x2eef1a[_0xc658('0x88')](_0x1e777c[_0xc658('0x35')][_0xc658('0x89')]||[]);}return null;})[_0xc658('0x19')](respondWithResult(_0x13d7b0,null))[_0xc658('0x23')](handleError(_0x13d7b0,null));};exports[_0xc658('0x8a')]=function(_0x27419d,_0x5a11ed){var _0x4a2b36=[];_0x4a2b36[_0xc658('0x5f')](addAdditionalPhones(_0x27419d[_0xc658('0x35')]));Promise[_0xc658('0x64')](_0x4a2b36)[_0xc658('0x19')](function(){_0x4a2b36=[];_0x4a2b36[_0xc658('0x5f')](deleteCmHopperPhones(_0x27419d[_0xc658('0x35')]['id']));_0x4a2b36[_0xc658('0x5f')](addCmHopperPhones(_0x27419d['body']['id']));Promise[_0xc658('0x64')](_0x4a2b36)[_0xc658('0x19')](function(){return[0x1];})[_0xc658('0x19')](respondWithResult(_0x5a11ed,null));});};function addAdditionalPhones(_0x4dd25c){var _0x409bb1;return new Promise(function(_0x213720){return db[_0xc658('0x4a')][_0xc658('0x1a')]({'where':{'CmContactId':_0x4dd25c['id']}})['then'](function(){db['ContactItemType'][_0xc658('0x2b')]({'raw':!![],'attributes':['id','OrderBy']})['then'](function(_0x20d53b){var _0x3b4fb6=[];for(var _0x40463d=0x0;_0x40463d<_0x4dd25c['items'][_0xc658('0x2c')];_0x40463d++){var _0x248c5e=_0x4dd25c[_0xc658('0x8b')]?_[_0xc658('0x55')](_0x4dd25c[_0xc658('0x8b')][_0x40463d])?'':_0x4dd25c[_0xc658('0x8b')][_0x40463d]:_0x4dd25c[_0xc658('0x8c')][_0x40463d][_0xc658('0x8d')]?_0x4dd25c[_0xc658('0x8c')][_0x40463d][_0xc658('0x8d')]:'';var _0x3cf8f0=_[_0xc658('0x55')](_0x4dd25c[_0xc658('0x8c')][_0x40463d][_0xc658('0x8e')])?'':_0x4dd25c[_0xc658('0x8c')][_0x40463d]['description'];var _0xe1e67=_0x248c5e+':'+_0x4dd25c['items'][_0x40463d]['phone']+'§'+_0x3cf8f0;if(_[_0xc658('0x55')](_0x409bb1))_0x409bb1=_0xe1e67;else _0x409bb1+=';'+_0xe1e67;var _0x48d563=null;var _0xa28cc=null;if(_0x4dd25c[_0xc658('0x8b')]){if(!_[_0xc658('0x55')](_0x4dd25c['item_types'][_0x40463d])){_0xa28cc=_[_0xc658('0x25')](_0x20d53b,function(_0x35092a){return _0x35092a['id']===_0x4dd25c[_0xc658('0x8b')][_0x40463d];});if(!_['isNil'](_0xa28cc)){_0x48d563=_0xa28cc[_0xc658('0x8f')];}}}else{if(!_['isNil'](_0x4dd25c[_0xc658('0x8c')][_0x40463d])){_0xa28cc=_['find'](_0x20d53b,function(_0x162030){return _0x162030['id']===_0x4dd25c['items'][_0x40463d][_0xc658('0x8d')];});if(!_['isNil'](_0xa28cc)){_0x48d563=_0x40463d;}}}if(_[_0xc658('0x55')](_0x48d563)){_0x48d563=0x64;}_0x3b4fb6['push'](addAdditionalPhone(_0x4dd25c['id'],_0x4dd25c[_0xc658('0x8c')][_0x40463d][_0xc658('0x7b')],_0x4dd25c['item_types']?_[_0xc658('0x55')](_0x4dd25c['item_types'][_0x40463d])?null:_0x4dd25c['item_types'][_0x40463d]:_0x4dd25c[_0xc658('0x8c')][_0x40463d][_0xc658('0x8d')]?_0x4dd25c[_0xc658('0x8c')][_0x40463d]['ItemTypeId']:null,_0x48d563,_0x3cf8f0));}Promise['all'](_0x3b4fb6)[_0xc658('0x19')](function(){db[_0xc658('0x24')][_0xc658('0x41')]({'AdditionalPhones':_0x409bb1},{'where':{'id':_0x4dd25c['id']}})['then'](function(){_0x213720(0x1);});});});});});}function addAdditionalPhone(_0x1189d1,_0x580b27,_0x3b91fd,_0x2b86ff,_0x1cf880){return db[_0xc658('0x4a')][_0xc658('0x25')]({'where':{'CmContactId':_0x1189d1,'item':_0x580b27}})[_0xc658('0x19')](function(_0x430ab7){if(_0x430ab7)logger['info'](_0xc658('0x90'),_0x430ab7);else{db[_0xc658('0x4a')][_0xc658('0x3f')]({'CmContactId':_0x1189d1,'item':_0x580b27,'ItemTypeId':_0x3b91fd,'OrderBy':_0x2b86ff,'ItemClass':_0xc658('0x91'),'description':_0x1cf880});}});}function deleteCmHopperPhones(_0x1c3323){return new Promise(function(_0x557c28){return db['CmHopper'][_0xc658('0x2b')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x1c3323}})[_0xc658('0x19')](function(_0x3a39c1){db[_0xc658('0x92')][_0xc658('0x1a')]({'where':{'CmHopperId':{'$in':_['map'](_0x3a39c1,'id')}}});})[_0xc658('0x19')](function(){_0x557c28(0x1);});});}function addCmHopperPhones(_0x528d43){return new Promise(function(_0x52ccac){return db[_0xc658('0x7c')][_0xc658('0x2b')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x528d43}})[_0xc658('0x19')](function(_0x49b761){var _0x473ae6=[];_[_0xc658('0x71')](_0x49b761,function(_0x1d5619){_0x473ae6['push'](createCmHopperPhone(_0x528d43,_0x1d5619['id']));});Promise[_0xc658('0x64')](_0x473ae6)[_0xc658('0x19')](function(){_0x52ccac(0x1);});});});}function createCmHopperPhone(_0x5e0469,_0xe567dc){return new Promise(function(_0x22f96d){db[_0xc658('0x4a')][_0xc658('0x2b')]({'raw':!![],'attributes':[_0xc658('0x93'),_0xc658('0x8f')],'where':{'CmContactId':_0x5e0469,'ItemClass':_0xc658('0x91')},'include':[{'model':db['ContactItemType'],'attributes':[_0xc658('0x8f')],'as':_0xc658('0x6c')}],'order':[_0xc658('0x8f'),db['sequelize'][_0xc658('0x6e')](_0xc658('0x94'))]})[_0xc658('0x19')](function(_0x13bc68){var _0x5b15c0=0x1;var _0x33bb5f=_[_0xc658('0x71')](_0x13bc68,function(_0x36d7e7){_0x36d7e7[_0xc658('0x95')]=_0xe567dc;_0x36d7e7[_0xc658('0x7b')]=_0x36d7e7[_0xc658('0x93')];_0x36d7e7['OrderBy']=_0x5b15c0;delete _0x36d7e7[_0xc658('0x96')];_0x5b15c0=_0x5b15c0+0x1;return _0x36d7e7;});return db['CmHopperAdditionalPhone'][_0xc658('0x5a')](_0x33bb5f,{});})[_0xc658('0x19')](function(){_0x22f96d(0x1);});});}function insertAdditionalPhones(_0x2d77e6,_0x976d29){return new Promise(function(_0x1dc2dd){var _0x3ba293=[];for(var _0x11c065=0x0;_0x11c065<_0x976d29['length'];_0x11c065++){var _0x2578da=_0x976d29[_0x11c065];_0x3ba293[_0xc658('0x5f')](parseContactItemType(_0x2578da));}Promise[_0xc658('0x64')](_0x3ba293)[_0xc658('0x19')](function(){var _0x7e4eb={'id':_0x2d77e6['id'],'items':_0x976d29};return addAdditionalPhones(_0x7e4eb)[_0xc658('0x19')](function(){return addCmHopperPhones(_0x2d77e6['id']);});})[_0xc658('0x19')](function(){_0x1dc2dd(_0x2d77e6);});});}function parseContactItemType(_0x266e24){return new Promise(function(_0xf76ffe){if(_0x266e24['hasOwnProperty'](_0xc658('0x8d'))){_0xf76ffe(_0x266e24);}else{return db['ContactItemType'][_0xc658('0x25')]({'where':{'name':_0x266e24[_0xc658('0x6c')]}})[_0xc658('0x19')](function(_0x29a231){if(_['isNil'](_0x29a231))_0x266e24[_0xc658('0x8d')]=null;else _0x266e24[_0xc658('0x8d')]=_0x29a231['id'];_0xf76ffe(_0x266e24);});}});}exports[_0xc658('0x97')]=function(_0x4c1607,_0xb7289f){return db[_0xc658('0x4a')][_0xc658('0x2b')]({'raw':!![],'where':{'CmContactId':_0x4c1607['params']['id'],'ItemClass':_0xc658('0x91')},'include':[{'model':db[_0xc658('0x6b')],'as':'ItemType'}],'order':[[_0xc658('0x8f')],[db[_0xc658('0x6d')][_0xc658('0x6e')](_0xc658('0x94'))]]})[_0xc658('0x19')](function(_0x8431ed){return _0x8431ed;})[_0xc658('0x19')](respondWithResult(_0xb7289f,null))['catch'](handleError(_0xb7289f,null));};exports[_0xc658('0x98')]=function(_0x1c2e0d,_0x3ed4c3){return db[_0xc658('0x4a')][_0xc658('0x2b')]({'raw':!![],'where':{'CmContactId':_0x1c2e0d['body'][_0xc658('0x99')]}})['then'](function(_0x3750f9){var _0x31bc3d=_[_0xc658('0x71')](_0x3750f9,function(_0x472133){_0x472133[_0xc658('0x9a')]=_0x1c2e0d[_0xc658('0x35')][_0xc658('0x9b')];return _0x472133;});return db[_0xc658('0x4a')][_0xc658('0x5a')](_0x31bc3d,{});})[_0xc658('0x19')](function(){return addCmHopperPhones(_0x1c2e0d[_0xc658('0x35')][_0xc658('0x9b')]);})[_0xc658('0x19')](function(){return['ok'];})[_0xc658('0x19')](respondWithResult(_0x3ed4c3,null))[_0xc658('0x23')](handleError(_0x3ed4c3,null));};exports[_0xc658('0x9c')]=function(_0x2c82a0,_0x50eef1){var _0x4a42fb=[];_0x4a42fb[_0xc658('0x5f')](createCmHopperPhone(_0x2c82a0['body']['id'],_0x2c82a0[_0xc658('0x35')][_0xc658('0x9d')]));Promise[_0xc658('0x64')](_0x4a42fb)['then'](function(){return[0x1];})['then'](respondWithResult(_0x50eef1,null));};exports['getHoppers']=function(_0x52b824,_0x4e1636){var _0x6d609d={'raw':![],'where':{}};var _0x5335c7={};var _0x2d2dc4={'count':0x0,'rows':[]};return db[_0xc658('0x24')][_0xc658('0x7d')]({'where':{'id':_0x52b824['params']['id']}})[_0xc658('0x19')](handleEntityNotFound(_0x4e1636,null))[_0xc658('0x19')](function(_0x956c45){if(_0x956c45){_0x5335c7[_0xc658('0x7e')]=_[_0xc658('0x26')](db[_0xc658('0x7c')][_0xc658('0x9e')]);_0x5335c7[_0xc658('0x22')]=_['keys'](_0x52b824['query']);_0x5335c7[_0xc658('0x7f')]=_[_0xc658('0x80')](_0x5335c7[_0xc658('0x7e')],_0x5335c7[_0xc658('0x22')]);_0x6d609d['attributes']=_[_0xc658('0x80')](_0x5335c7[_0xc658('0x7e')],qs[_0xc658('0x82')](_0x52b824[_0xc658('0x22')][_0xc658('0x82')]));_0x6d609d[_0xc658('0x81')]=_0x6d609d[_0xc658('0x81')][_0xc658('0x2c')]?_0x6d609d['attributes']:_0x5335c7[_0xc658('0x7e')];if(!_0x52b824[_0xc658('0x22')][_0xc658('0x33')](_0xc658('0x9f'))){_0x6d609d['limit']=qs[_0xc658('0x15')](_0x52b824[_0xc658('0x22')][_0xc658('0x15')]);_0x6d609d[_0xc658('0x14')]=qs[_0xc658('0x14')](_0x52b824[_0xc658('0x22')][_0xc658('0x14')]);}_0x6d609d['order']=qs['sort'](_0x52b824[_0xc658('0x22')][_0xc658('0x84')]);_0x6d609d[_0xc658('0x5d')]=qs[_0xc658('0x7f')](_[_0xc658('0x85')](_0x52b824['query'],_0x5335c7[_0xc658('0x7f')]));_0x6d609d[_0xc658('0x5d')][_0xc658('0xa0')]=_0x956c45['id'];if(_0x52b824[_0xc658('0x22')][_0xc658('0x86')]){_0x6d609d['where']=_[_0xc658('0x34')](_0x6d609d[_0xc658('0x5d')],{'$or':_[_0xc658('0x71')](_0x6d609d['attributes'],function(_0x30c893){var _0xc00194={};_0xc00194[_0x30c893]={'$like':'%'+_0x52b824[_0xc658('0x22')][_0xc658('0x86')]+'%'};return _0xc00194;})});}_0x6d609d=_[_0xc658('0x34')]({},_0x6d609d,_0x52b824[_0xc658('0xa1')]);return db[_0xc658('0x7c')][_0xc658('0x17')]({'where':_0x6d609d['where']})['then'](function(_0x2e5074){_0x2d2dc4[_0xc658('0x17')]=_0x2e5074;if(_0x52b824['query']['includeAll']){_0x6d609d[_0xc658('0xa2')]=[{'all':!![]}];}return db[_0xc658('0x7c')][_0xc658('0x2b')](_0x6d609d);})['then'](function(_0x165d03){_0x2d2dc4[_0xc658('0xa3')]=_0x165d03;return _0x2d2dc4;});}})[_0xc658('0x19')](respondWithFilteredResult(_0x4e1636,_0x6d609d))[_0xc658('0x23')](handleError(_0x4e1636,null));};exports[_0xc658('0xa4')]=function(_0x18917c,_0x3e4e9f){var _0x1988b7={'raw':!![],'where':{}};var _0x3a4c08={};var _0x178737={'count':0x0,'rows':[]};return db['CmContact'][_0xc658('0x7d')]({'where':{'id':_0x18917c[_0xc658('0x6a')]['id']}})[_0xc658('0x19')](handleEntityNotFound(_0x3e4e9f,null))[_0xc658('0x19')](function(_0x276d40){if(_0x276d40){_0x3a4c08[_0xc658('0x7e')]=_[_0xc658('0x26')](db[_0xc658('0x4c')]['rawAttributes']);_0x3a4c08[_0xc658('0x22')]=_[_0xc658('0x26')](_0x18917c[_0xc658('0x22')]);_0x3a4c08[_0xc658('0x7f')]=_[_0xc658('0x80')](_0x3a4c08[_0xc658('0x7e')],_0x3a4c08[_0xc658('0x22')]);_0x1988b7['attributes']=_[_0xc658('0x80')](_0x3a4c08['model'],qs['fields'](_0x18917c[_0xc658('0x22')][_0xc658('0x82')]));_0x1988b7[_0xc658('0x81')]=_0x1988b7['attributes'][_0xc658('0x2c')]?_0x1988b7[_0xc658('0x81')]:_0x3a4c08[_0xc658('0x7e')];if(!_0x18917c[_0xc658('0x22')][_0xc658('0x33')]('nolimit')){_0x1988b7['limit']=qs[_0xc658('0x15')](_0x18917c[_0xc658('0x22')][_0xc658('0x15')]);_0x1988b7[_0xc658('0x14')]=qs[_0xc658('0x14')](_0x18917c[_0xc658('0x22')][_0xc658('0x14')]);}_0x1988b7[_0xc658('0x83')]=qs[_0xc658('0x84')](_0x18917c['query'][_0xc658('0x84')]);_0x1988b7[_0xc658('0x5d')]=qs['filters'](_[_0xc658('0x85')](_0x18917c[_0xc658('0x22')],_0x3a4c08['filters']));_0x1988b7[_0xc658('0x5d')]['ContactId']=_0x276d40['id'];if(_0x18917c[_0xc658('0x22')][_0xc658('0x86')]){_0x1988b7[_0xc658('0x5d')]=_[_0xc658('0x34')](_0x1988b7[_0xc658('0x5d')],{'$or':_['map'](_0x1988b7['attributes'],function(_0x5946b1){var _0x20d2fa={};_0x20d2fa[_0x5946b1]={'$like':'%'+_0x18917c[_0xc658('0x22')][_0xc658('0x86')]+'%'};return _0x20d2fa;})});}_0x1988b7=_[_0xc658('0x34')]({},_0x1988b7,_0x18917c['options']);return db[_0xc658('0x4c')]['count']({'where':_0x1988b7[_0xc658('0x5d')]})[_0xc658('0x19')](function(_0x3f9e7b){_0x178737['count']=_0x3f9e7b;if(_0x18917c[_0xc658('0x22')]['includeAll']){_0x1988b7[_0xc658('0xa2')]=[{'all':!![]}];}return db[_0xc658('0x4c')][_0xc658('0x2b')](_0x1988b7);})['then'](function(_0x27b98c){_0x178737[_0xc658('0xa3')]=_0x27b98c;return _0x178737;});}})[_0xc658('0x19')](respondWithFilteredResult(_0x3e4e9f,_0x1988b7))[_0xc658('0x23')](handleError(_0x3e4e9f,null));};exports[_0xc658('0xa5')]=function(_0x287c6d,_0x5142ec){var _0x2c1ed6={'raw':!![],'where':{}};var _0x409f07={};var _0x48e82b={'count':0x0,'rows':[]};return db[_0xc658('0x24')][_0xc658('0x7d')]({'where':{'id':_0x287c6d[_0xc658('0x6a')]['id']}})['then'](handleEntityNotFound(_0x5142ec,null))[_0xc658('0x19')](function(_0x491351){if(_0x491351){_0x409f07[_0xc658('0x7e')]=_['keys'](db['CmHopperFinal']['rawAttributes']);_0x409f07[_0xc658('0x22')]=_[_0xc658('0x26')](_0x287c6d[_0xc658('0x22')]);_0x409f07[_0xc658('0x7f')]=_[_0xc658('0x80')](_0x409f07['model'],_0x409f07[_0xc658('0x22')]);_0x2c1ed6[_0xc658('0x81')]=_[_0xc658('0x80')](_0x409f07[_0xc658('0x7e')],qs[_0xc658('0x82')](_0x287c6d['query'][_0xc658('0x82')]));_0x2c1ed6['attributes']=_0x2c1ed6['attributes']['length']?_0x2c1ed6['attributes']:_0x409f07['model'];if(!_0x287c6d['query']['hasOwnProperty'](_0xc658('0x9f'))){_0x2c1ed6['limit']=qs[_0xc658('0x15')](_0x287c6d[_0xc658('0x22')][_0xc658('0x15')]);_0x2c1ed6['offset']=qs[_0xc658('0x14')](_0x287c6d[_0xc658('0x22')][_0xc658('0x14')]);}_0x2c1ed6['order']=qs[_0xc658('0x84')](_0x287c6d[_0xc658('0x22')]['sort']);_0x2c1ed6[_0xc658('0x5d')]=qs[_0xc658('0x7f')](_[_0xc658('0x85')](_0x287c6d[_0xc658('0x22')],_0x409f07[_0xc658('0x7f')]));_0x2c1ed6[_0xc658('0x5d')][_0xc658('0xa0')]=_0x491351['id'];if(_0x287c6d[_0xc658('0x22')][_0xc658('0x86')]){_0x2c1ed6[_0xc658('0x5d')]=_[_0xc658('0x34')](_0x2c1ed6[_0xc658('0x5d')],{'$or':_[_0xc658('0x71')](_0x2c1ed6['attributes'],function(_0x35969a){var _0x26f8b9={};_0x26f8b9[_0x35969a]={'$like':'%'+_0x287c6d[_0xc658('0x22')][_0xc658('0x86')]+'%'};return _0x26f8b9;})});}_0x2c1ed6=_[_0xc658('0x34')]({},_0x2c1ed6,_0x287c6d['options']);return db[_0xc658('0x4b')]['count']({'where':_0x2c1ed6['where']})[_0xc658('0x19')](function(_0x33c5f6){_0x48e82b[_0xc658('0x17')]=_0x33c5f6;if(_0x287c6d[_0xc658('0x22')][_0xc658('0xa6')]){_0x2c1ed6[_0xc658('0xa2')]=[{'all':!![]}];}return db['CmHopperFinal'][_0xc658('0x2b')](_0x2c1ed6);})['then'](function(_0xbc74a4){_0x48e82b[_0xc658('0xa3')]=_0xbc74a4;return _0x48e82b;});}})['then'](respondWithFilteredResult(_0x5142ec,_0x2c1ed6))[_0xc658('0x23')](handleError(_0x5142ec,null));};exports[_0xc658('0xa7')]=function(_0x15ed95,_0x527065){var _0x1a7abb={'raw':!![],'where':{}};var _0x9b3fa6={};var _0x42072b={'count':0x0,'rows':[]};return db['CmContact'][_0xc658('0x7d')]({'where':{'id':_0x15ed95['params']['id']}})[_0xc658('0x19')](handleEntityNotFound(_0x527065,null))[_0xc658('0x19')](function(_0x1a942c){if(_0x1a942c){_0x9b3fa6[_0xc658('0x7e')]=_[_0xc658('0x26')](db['JscriptySessionReport'][_0xc658('0x9e')]);_0x9b3fa6[_0xc658('0x22')]=_['keys'](_0x15ed95['query']);_0x9b3fa6[_0xc658('0x7f')]=_[_0xc658('0x80')](_0x9b3fa6['model'],_0x9b3fa6['query']);_0x1a7abb[_0xc658('0x81')]=_['intersection'](_0x9b3fa6['model'],qs[_0xc658('0x82')](_0x15ed95['query'][_0xc658('0x82')]));_0x1a7abb[_0xc658('0x81')]=_0x1a7abb['attributes'][_0xc658('0x2c')]?_0x1a7abb[_0xc658('0x81')]:_0x9b3fa6[_0xc658('0x7e')];if(!_0x15ed95[_0xc658('0x22')]['hasOwnProperty'](_0xc658('0x9f'))){_0x1a7abb[_0xc658('0x15')]=qs['limit'](_0x15ed95[_0xc658('0x22')]['limit']);_0x1a7abb[_0xc658('0x14')]=qs['offset'](_0x15ed95[_0xc658('0x22')]['offset']);}_0x1a7abb['order']=qs[_0xc658('0x84')](_0x15ed95[_0xc658('0x22')][_0xc658('0x84')]);_0x1a7abb[_0xc658('0x5d')]=qs[_0xc658('0x7f')](_['pick'](_0x15ed95[_0xc658('0x22')],_0x9b3fa6[_0xc658('0x7f')]));_0x1a7abb[_0xc658('0x5d')]['ContactId']=_0x1a942c['id'];if(_0x15ed95[_0xc658('0x22')][_0xc658('0x86')]){_0x1a7abb[_0xc658('0x5d')]=_[_0xc658('0x34')](_0x1a7abb['where'],{'$or':_[_0xc658('0x71')](_0x1a7abb['attributes'],function(_0x468f5d){var _0x524113={};_0x524113[_0x468f5d]={'$like':'%'+_0x15ed95[_0xc658('0x22')][_0xc658('0x86')]+'%'};return _0x524113;})});}_0x1a7abb=_['merge']({},_0x1a7abb,_0x15ed95[_0xc658('0xa1')]);return db[_0xc658('0x51')][_0xc658('0x17')]({'where':_0x1a7abb[_0xc658('0x5d')]})[_0xc658('0x19')](function(_0x5604af){_0x42072b[_0xc658('0x17')]=_0x5604af;if(_0x15ed95['query'][_0xc658('0xa6')]){_0x1a7abb[_0xc658('0xa2')]=[{'all':!![]}];}return db[_0xc658('0x51')][_0xc658('0x2b')](_0x1a7abb);})[_0xc658('0x19')](function(_0x10cc24){_0x42072b[_0xc658('0xa3')]=_0x10cc24;return _0x42072b;});}})[_0xc658('0x19')](respondWithFilteredResult(_0x527065,_0x1a7abb))[_0xc658('0x23')](handleError(_0x527065,null));};exports[_0xc658('0xa8')]=function(_0x19ec9c,_0x3e9bbe){try{if(!_0x19ec9c[_0xc658('0x35')][_0xc658('0x60')]){throw new Error(_0xc658('0xa9'));}if(!_0x19ec9c['body'][_0xc658('0xaa')]){throw new Error(_0xc658('0xab'));}if(!_0x19ec9c[_0xc658('0x35')][_0xc658('0xac')]){throw new Error(_0xc658('0xad'));}if(!_0x19ec9c[_0xc658('0x35')][_0xc658('0xae')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x3576a6=_0x19ec9c[_0xc658('0x35')][_0xc658('0xaa')]['split'](',');var _0x35c557=_0x19ec9c['body'][_0xc658('0xac')][_0xc658('0xaf')](',');if(!_0x3576a6['length']||!_0x35c557['length']||_0x3576a6['length']!==_0x35c557['length']){throw new Error(_0xc658('0xb0'));}_0x19ec9c[_0xc658('0x35')][_0xc658('0x82')]=_[_0xc658('0xb1')](_0x3576a6,_0x35c557);if(!_0x19ec9c['body'][_0xc658('0x82')]['phone']){throw new Error('No\x20phone\x20column\x20specified');}if(!_0x19ec9c[_0xc658('0x35')][_0xc658('0x82')][_0xc658('0xb2')]){throw new Error('No\x20firstName\x20column\x20specified');}var _0x21abad=path['join'](config[_0xc658('0xb3')],_0xc658('0xb4'),_0x19ec9c['file'][_0xc658('0xb5')]);fs[_0xc658('0xb6')](_0x21abad,parseInt(_0xc658('0xb7'),0x8));var _0x567011=require(_0xc658('0xb8'))['fork'](path[_0xc658('0x3b')](__dirname,'../../components/import/cm/csv'),[_0x21abad,_0x19ec9c[_0xc658('0x35')][_0xc658('0xaa')],_0x19ec9c['body'][_0xc658('0xac')],_0x19ec9c[_0xc658('0x35')][_0xc658('0x60')],_0x19ec9c[_0xc658('0x35')][_0xc658('0xb9')],_0x19ec9c[_0xc658('0x35')][_0xc658('0x5c')],_0x19ec9c[_0xc658('0x35')]['socket_timestamp']]);return _0x3e9bbe['status'](0xc8)[_0xc658('0xba')]({'message':_0xc658('0xbb'),'pid':_0x567011['pid']});}catch(_0x11e1a9){return _0x3e9bbe[_0xc658('0x13')](0x1f4)[_0xc658('0x1f')](_0x11e1a9);}};exports[_0xc658('0xbc')]=function(_0x473f0a,_0x306abb){var _0x41b1b1=fs[_0xc658('0xbd')](_0x473f0a[_0xc658('0xbe')][_0xc658('0x3')]);Papa['parse'](_0x41b1b1,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x449974){return _0x306abb[_0xc658('0x13')](0xc8)['json']({'file':_0x473f0a[_0xc658('0xbe')],'fields':_0x449974['meta'][_0xc658('0x82')]});}});};exports[_0xc658('0xbf')]=function(_0x4cca2b,_0x509957){return db[_0xc658('0xc0')][_0xc658('0x2b')]({'raw':!![],'attributes':['id'],'where':{'role':_0xc658('0xc1')}})['then'](function(_0x1baa54){var _0x3e23e5=![];if(!_0x4cca2b[_0xc658('0x35')]['ListId']){throw new Error(_0xc658('0xa9'));}if(!_0x4cca2b[_0xc658('0x35')]['binding']['phone']){throw new Error('No\x20phone\x20column\x20specified');}if(!_0x4cca2b['body'][_0xc658('0xc2')][_0xc658('0xb2')]){throw new Error(_0xc658('0xc3'));}if(!_0x4cca2b['body'][_0xc658('0xae')]){throw new Error(_0xc658('0xc4'));}var _0x1b4d1e=require(_0xc658('0xb8'))[_0xc658('0xc5')](path[_0xc658('0x3b')](__dirname,_0xc658('0xc6')),[_0x4cca2b[_0xc658('0x6a')]['id'],JSON['stringify'](_0x4cca2b[_0xc658('0x35')]),JSON[_0xc658('0xc7')](_0x1baa54)]);_0x1b4d1e['on'](_0xc658('0xc8'),function(){_0x3e23e5=!![];return _0x509957[_0xc658('0x13')](0xc8)['json']({'message':_0xc658('0xc9'),'pid':_0x1b4d1e[_0xc658('0xca')]});});_0x1b4d1e['on'](_0xc658('0xcb'),function(_0x317614){if(_0x317614&&!_0x3e23e5){return _0x509957['status'](0x1f4)[_0xc658('0xba')]({'message':_0xc658('0xcc'),'pid':_0x1b4d1e['pid']});}});})[_0xc658('0x23')](handleError(_0x509957,null));};exports[_0xc658('0xcd')]=function(_0x320855,_0x112503){return db['User'][_0xc658('0x2b')]({'raw':!![],'attributes':['id'],'where':{'role':_0xc658('0xc1')}})[_0xc658('0x19')](function(_0x32ba7e){var _0x48958e=![];if(!_0x320855[_0xc658('0x35')][_0xc658('0x60')]){throw new Error(_0xc658('0xa9'));}if(!_0x320855[_0xc658('0x35')][_0xc658('0xc2')][_0xc658('0x7b')]){throw new Error(_0xc658('0xce'));}if(!_0x320855[_0xc658('0x35')]['binding'][_0xc658('0xb2')]){throw new Error('No\x20firstName\x20column\x20specified');}if(!_0x320855[_0xc658('0x35')][_0xc658('0xae')]){throw new Error(_0xc658('0xc4'));}var _0x15f95c=require(_0xc658('0xb8'))[_0xc658('0xc5')](path[_0xc658('0x3b')](__dirname,'../../components/import/cm/csvUpdates'),[_0x320855[_0xc658('0x6a')]['id'],JSON[_0xc658('0xc7')](_0x320855['body']),JSON[_0xc658('0xc7')](_0x32ba7e)]);_0x15f95c['on']('message',function(){_0x48958e=!![];return _0x112503['status'](0xc8)[_0xc658('0xba')]({'message':_0xc658('0xc9'),'pid':_0x15f95c[_0xc658('0xca')]});});_0x15f95c['on'](_0xc658('0xcb'),function(_0x55329c){if(_0x55329c&&!_0x48958e){return _0x112503[_0xc658('0x13')](0x1f4)[_0xc658('0xba')]({'message':_0xc658('0xcc'),'pid':_0x15f95c[_0xc658('0xca')]});}});})['catch'](handleError(_0x112503,null));};exports[_0xc658('0xcf')]=function(_0x14947c,_0x29298f){var _0x27d8ed=['mail',_0xc658('0xd0'),_0xc658('0xd1'),_0xc658('0xd2'),_0xc658('0xd3'),_0xc658('0xd4'),_0xc658('0xd5')];var _0x38ce84={'offset':0x0,'order':qs[_0xc658('0x84')](_0xc658('0xd6'))},_0x1561be={'count':0x0,'rows':[]};Promise[_0xc658('0xd7')]()[_0xc658('0x19')](function(){if(_0x14947c[_0xc658('0x22')]['channel']){if(!_[_0xc658('0xd8')](_0x27d8ed,_0x14947c[_0xc658('0x22')][_0xc658('0xd9')][_0xc658('0xda')]())){throw new Error('Invalid\x20channel');}_0x27d8ed=[_0x14947c[_0xc658('0x22')][_0xc658('0xd9')]['toLowerCase']()];}if(_0x14947c[_0xc658('0x22')][_0xc658('0xdb')]){try{var _0x5dd7a2=JSON[_0xc658('0xdc')](_0x14947c[_0xc658('0x22')]['range']);if(!moment(_0x5dd7a2[_0xc658('0x36')])[_0xc658('0xdd')]()){throw new Error(_0xc658('0xde'));}if(!moment(_0x5dd7a2['to'])[_0xc658('0xdd')]()){throw new Error(_0xc658('0xdf'));}}catch(_0x3fd61f){throw new Error(_0xc658('0xe0'));}}if(!_0x14947c[_0xc658('0x22')][_0xc658('0x33')](_0xc658('0x9f'))){_0x38ce84['limit']=qs[_0xc658('0x15')](_0x14947c[_0xc658('0x22')][_0xc658('0x15')]||0xa);_0x38ce84[_0xc658('0x14')]=qs['offset'](_0x14947c['query'][_0xc658('0x14')]);}var _0x4da095=_0x27d8ed[_0xc658('0x71')](function(_0x4fd047){if(_0x4fd047===_0xc658('0xd5')){var _0x2d5081={'attributes':['id',_0xc658('0xe1'),_0xc658('0xe2'),'source',_0xc658('0xe3'),_0xc658('0xe4'),'starttime','endtime',_0xc658('0xe5'),_0xc658('0xe6'),_0xc658('0xe7'),_0xc658('0xe8'),_0xc658('0xe9'),_0xc658('0xea'),_0xc658('0xeb')],'where':{'ContactId':_0x14947c[_0xc658('0x6a')]['id']},'include':[{'model':db['User'],'as':_0xc658('0xc0'),'attributes':['id',_0xc658('0x1e'),_0xc658('0xec'),_0xc658('0x2e')]}],'order':[[_0xc658('0xe7'),'DESC']]};if(_0x14947c['query'][_0xc658('0xdb')]){_0x2d5081[_0xc658('0x5d')][_0xc658('0xe7')]={'$gte':_0x5dd7a2[_0xc658('0x36')],'$lte':_0x5dd7a2['to']};}return db[_0xc658('0x4e')]['findAndCountAll'](_0x2d5081)[_0xc658('0x19')](function(_0x1bb21d){_0x1561be[_0xc658('0x17')]+=_0x1bb21d[_0xc658('0x17')];return _[_0xc658('0x71')](_0x1bb21d[_0xc658('0xa3')],function(_0x34a990){var _0x110dc4=_0x34a990[_0xc658('0x37')]({'plain':!![]});_0x110dc4[_0xc658('0xd9')]=_0x4fd047;if(_0x110dc4[_0xc658('0xc0')]){_0x110dc4['User']={'id':_0x110dc4[_0xc658('0xc0')]['id'],'name':_0x110dc4['User'][_0xc658('0x1e')],'fullname':_0x110dc4[_0xc658('0xc0')][_0xc658('0xec')],'alias':_0x110dc4['User'][_0xc658('0x2e')]};}return _0x110dc4;});});}else{var _0x123263=_[_0xc658('0xed')](_0x4fd047)+(_0x4fd047===_0xc658('0xd0')?_0xc658('0xee'):'Account');var _0x4feb57={'attributes':['id',_0xc658('0xef'),_0xc658('0xf0'),_0xc658('0xe7'),_0xc658('0xe6'),'disposition',_0xc658('0xf1'),'thirdDisposition',_0xc658('0xeb'),_0x123263+'Id'],'where':{'ContactId':_0x14947c[_0xc658('0x6a')]['id']},'include':[{'model':db[_0x123263],'as':'Account','attributes':['id',_0xc658('0x1e'),_0xc658('0xf2')]},{'model':db['User'],'as':_0xc658('0xf3'),'attributes':['id','name',_0xc658('0xec')]},{'model':db[_0xc658('0x66')],'as':_0xc658('0x67'),'attributes':['id','name','color'],'through':{'attributes':[]}}],'order':[[_0xc658('0xe7'),_0xc658('0xf4')]]};if(_0x14947c[_0xc658('0x22')][_0xc658('0xdb')]){_0x4feb57[_0xc658('0x5d')][_0xc658('0xe7')]={'$gte':_0x5dd7a2['from'],'$lte':_0x5dd7a2['to']};}switch(_0x4fd047){case'chat':_0x4feb57[_0xc658('0x81')]['push']('browserName',_0xc658('0xf5'),_0xc658('0xf6'),_0xc658('0xf7'),'osName',_0xc658('0xf8'),_0xc658('0xf9'),_0xc658('0xfa'),_0xc658('0xfb'));break;case'mail':_0x4feb57['attributes'][_0xc658('0x5f')](_0xc658('0xfc'),'substatus');break;case'openchannel':_0x4feb57[_0xc658('0x81')][_0xc658('0x5f')]('externalUrl',_0xc658('0xfd'));break;}return db[_[_0xc658('0xed')](_0x4fd047)+'Interaction'][_0xc658('0xfe')](_0x4feb57)[_0xc658('0x19')](function(_0x4b7395){_0x1561be[_0xc658('0x17')]+=_0x4b7395['count'];return _[_0xc658('0x71')](_0x4b7395[_0xc658('0xa3')],function(_0x41e2b1){var _0x449d54=_0x41e2b1[_0xc658('0x37')]({'plain':!![]});_0x449d54[_0xc658('0xd9')]=_0x4fd047;if(_0x449d54[_0xc658('0xf3')]){_0x449d54['Owner']={'id':_0x449d54[_0xc658('0xf3')]['id'],'name':_0x449d54[_0xc658('0xf3')][_0xc658('0x1e')],'fullname':_0x449d54[_0xc658('0xf3')]['fullname']};}return _0x449d54;});});}});return Promise[_0xc658('0x64')](_0x4da095);})['then'](function(_0x3fb638){return _(_0x3fb638)[_0xc658('0xff')]()[_0xc658('0x100')](_0xc658('0xe7'))[_0xc658('0x101')]()['value']();})[_0xc658('0x19')](function(_0x50da8b){_0x1561be[_0xc658('0xa3')]=_0x38ce84[_0xc658('0x15')]?_0x50da8b['slice'](_0x38ce84[_0xc658('0x14')],_0x38ce84[_0xc658('0x14')]+_0x38ce84[_0xc658('0x15')]):_0x50da8b;return _0x1561be;})[_0xc658('0x19')](respondWithFilteredResult(_0x29298f,_0x38ce84))[_0xc658('0x23')](handleError(_0x29298f,null));}; \ No newline at end of file +var _0x3584=['error\x20child\x20process','binding','../../components/import/cm/csvUpdates','chat','openchannel','fax','whatsapp','voice','-createdAt','resolve','channel','includes','toLowerCase','Invalid\x20channel','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','uniqueid','type','source','destination','callerid','starttime','endtime','duration','userSecondDisposition','userThirdDisposition','UserId','createdAt','DESC','findAndCountAll','fullname','Website','closedAt','note','disposition','secondDisposition','thirdDisposition','Account','Owner','color','customerIp','customerPort','deviceModel','osName','ratingType','subject','substatus','externalUrl','threadId','startCase','Interaction','flatten','sortBy','reverse','moment','bluebird','squel','ioredis','../../components/contacts','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/environment/shared','../../mysqldb','redis','localhost','socket.io-emitter','./cmContact.socket','register','json','offset','limit','undefined','count','set','update','then','destroy','status','sendStatus','error','stack','name','send','index','findAll','query','catch','CmContact','find','params','describe','tags','keys','length','startsWith','cf_','columnName','displayName','analytics','alias','values','Custom\x20field\x20%s\x20not\x20found\x20on\x20cm_contacts\x20table','forEach','merge','body','from','get','mergeWith','isArray','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxMessage','OpenchannelMessage','CmContactHasItem','CmHopperFinal','CmHopperHistory','ReportAgentPreview','VoiceCallReport','ChatQueueReport','FaxQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','isNil','dialTimezone','timezones','utcOffset','additionalPhones','bulkCreate','each','duplicates','where','$or','push','ListId','spread','hasOwnProperty','contact','all','show','Tag','Tags','tag','Phones','ContactItemType','ItemType','sequelize','literal','$and','CmCustomField','omit','map','format','cf_%d','pickBy','table','cm_contacts','setFields','id\x20=\x20?','toParam','text','phone','model','rawAttributes','filters','intersection','attributes','fields','order','sort','filter','options','getTags','nolimit','setTags','findOne','ids','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','PHONE','CmHopperAdditionalPhone','item','ItemType.OrderBy','getAdditionalPhones','duplicateAdditionalPhones','fromContactId','CmContactId','toContactId','rescheduleAdditionalPhones','pick','ContactId','include','rows','getHopperHistories','includeAll','getJscriptySessions','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','file','filename','chmodSync','child_process','File\x20uploaded\x20correctly!','pid','upload','parse','import','User','agent','fork','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','exit'];(function(_0x5bd1b8,_0x120c0a){var _0x1e0a4a=function(_0x28340a){while(--_0x28340a){_0x5bd1b8['push'](_0x5bd1b8['shift']());}};_0x1e0a4a(++_0x120c0a);}(_0x3584,0x132));var _0x4358=function(_0x34e750,_0x2a812a){_0x34e750=_0x34e750-0x0;var _0x5cd8cd=_0x3584[_0x34e750];return _0x5cd8cd;};'use strict';var moment=require(_0x4358('0x0'));var BPromise=require(_0x4358('0x1'));var util=require('util');var path=require('path');var fs=require('fs');var _=require('lodash');var squel=require(_0x4358('0x2'));var Papa=require('papaparse');var Redis=require(_0x4358('0x3'));var contacts=require(_0x4358('0x4'));var qs=require(_0x4358('0x5'));var logger=require(_0x4358('0x6'))(_0x4358('0x7'));var config=require(_0x4358('0x8'));var shared=require(_0x4358('0x9'));var db=require(_0x4358('0xa'))['db'];config[_0x4358('0xb')]=_['defaults'](config[_0x4358('0xb')],{'host':_0x4358('0xc'),'port':0x18eb});var socket=require(_0x4358('0xd'))(new Redis(config['redis']));require(_0x4358('0xe'))[_0x4358('0xf')](socket);function respondWithResult(_0x78528f,_0x5f0a5f){_0x5f0a5f=_0x5f0a5f||0xc8;return function(_0x56f4a2){if(_0x56f4a2){return _0x78528f['status'](_0x5f0a5f)[_0x4358('0x10')](_0x56f4a2);}};}function respondWithFilteredResult(_0x3bc64e,_0x17d730){return function(_0x824892){if(_0x824892){var _0x110e40=typeof _0x17d730[_0x4358('0x11')]==='undefined'&&typeof _0x17d730[_0x4358('0x12')]===_0x4358('0x13');var _0x584d61=_0x824892[_0x4358('0x14')];var _0xe3e3c=_0x110e40?0x0:_0x17d730[_0x4358('0x11')];var _0x1e846f=_0x110e40?_0x824892['count']:_0x17d730[_0x4358('0x11')]+_0x17d730[_0x4358('0x12')];var _0x332069;if(_0x1e846f>=_0x584d61){_0x1e846f=_0x584d61;_0x332069=0xc8;}else{_0x332069=0xce;}_0x3bc64e['status'](_0x332069);return _0x3bc64e[_0x4358('0x15')]('Content-Range',_0xe3e3c+'-'+_0x1e846f+'/'+_0x584d61)[_0x4358('0x10')](_0x824892);}return null;};}function saveUpdates(_0x48c77c){return function(_0x374275){if(_0x374275){return _0x374275[_0x4358('0x16')](_0x48c77c)[_0x4358('0x17')](function(_0x129813){return _0x129813;});}return null;};}function removeEntity(_0x426e62){return function(_0x2c316e){if(_0x2c316e){return _0x2c316e[_0x4358('0x18')]()['then'](function(){_0x426e62[_0x4358('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1a7e5d){return function(_0x12a011){if(!_0x12a011){_0x1a7e5d[_0x4358('0x1a')](0x194);}return _0x12a011;};}function handleError(_0x8ec77b,_0x4fc848){_0x4fc848=_0x4fc848||0x1f4;return function(_0x23fbee){logger[_0x4358('0x1b')](_0x23fbee[_0x4358('0x1c')]);if(_0x23fbee[_0x4358('0x1d')]){delete _0x23fbee[_0x4358('0x1d')];}_0x8ec77b[_0x4358('0x19')](_0x4fc848)[_0x4358('0x1e')](_0x23fbee);};}exports[_0x4358('0x1f')]=function(_0x2d54d7,_0x30ca65){var _0x5831c5={};return contacts['describe']()['then'](function(_0xf6dc7d){_0x5831c5=qs['getOptions'](_0xf6dc7d,_0x2d54d7);return contacts[_0x4358('0x20')](_0x2d54d7[_0x4358('0x21')],_0x2d54d7['user'],_0x5831c5,_0xf6dc7d);})[_0x4358('0x17')](respondWithFilteredResult(_0x30ca65,_0x5831c5))[_0x4358('0x22')](handleError(_0x30ca65,null));};exports['destroy']=function(_0x480067,_0xa201ff){return db[_0x4358('0x23')][_0x4358('0x24')]({'where':{'id':_0x480067[_0x4358('0x25')]['id']}})['then'](handleEntityNotFound(_0xa201ff,null))['then'](removeEntity(_0xa201ff,null))[_0x4358('0x22')](handleError(_0xa201ff,null));};exports[_0x4358('0x26')]=function(_0x22ceb5,_0x46a6b7){return db[_0x4358('0x23')][_0x4358('0x26')]()[_0x4358('0x17')](function(_0xf9109b){delete _0xf9109b[_0x4358('0x27')];for(var _0xf52f98=0x0;_0xf52f980x0){return new Promise(function(_0x2ddb69){var _0x450d88=[];for(var _0xf8550f=0x0;_0xf8550f<_0x382c11['length'];_0xf8550f++){_0x450d88[_0x4358('0x5e')](insertAdditionalPhones(_0x382c11[_0xf8550f][_0x4358('0x62')],_0x382c11[_0xf8550f][_0x4358('0x58')]));}Promise[_0x4358('0x63')](_0x450d88)[_0x4358('0x17')](function(){_0x2ddb69(0x1);});})[_0x4358('0x17')](function(){return{'success':_0x2becd8,'failure':_0x120f74,'duplicates':_0xdde551};});}else{return{'success':_0x2becd8,'failure':_0x120f74,'duplicates':_0xdde551};}}})[_0x4358('0x17')](respondWithResult(_0x1eb661,0xc9))[_0x4358('0x22')](handleError(_0x1eb661,null));};exports[_0x4358('0x64')]=function(_0x27e2f9,_0x3e0478){var _0x17efe6;return db[_0x4358('0x23')][_0x4358('0x26')]()['then'](function(_0x1346bb){return db[_0x4358('0x23')][_0x4358('0x24')]({'where':{'id':_0x27e2f9['params']['id']},'include':[{'model':db[_0x4358('0x65')],'as':_0x4358('0x66'),'attributes':['id','name','color'],'required':_0x27e2f9[_0x4358('0x21')][_0x4358('0x67')]?!![]:![]},{'model':db[_0x4358('0x47')],'as':_0x4358('0x68'),'where':{'CmContactId':_0x27e2f9[_0x4358('0x25')]['id']},'required':![],'include':[{'model':db[_0x4358('0x69')],'as':_0x4358('0x6a')}]}],'order':[db[_0x4358('0x6b')][_0x4358('0x6c')]('Phones.OrderBy')],'attributes':_[_0x4358('0x28')](_0x1346bb)});})['then'](function(_0x2fe463){if(!_['isNil'](_0x2fe463)){_0x17efe6=_0x2fe463[_0x4358('0x36')]({'plain':!![]});var _0x3d269a={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x2fe463&&_0x2fe463[_0x4358('0x5f')]){if(_0x2fe463[_0x4358('0x5f')]){_0x3d269a['where'][_0x4358('0x6d')][_0x4358('0x5e')]({'ListId':{'$ne':_0x2fe463['ListId']}});}}return db[_0x4358('0x6e')][_0x4358('0x20')](_0x3d269a);}})[_0x4358('0x17')](function(_0x3442c9){if(!_[_0x4358('0x54')](_0x3442c9)){return _[_0x4358('0x6f')](_0x17efe6,_[_0x4358('0x70')](_0x3442c9,function(_0x29492d){return util[_0x4358('0x71')](_0x4358('0x72'),_0x29492d['id']);}));}})[_0x4358('0x17')](handleEntityNotFound(_0x3e0478,null))['then'](respondWithResult(_0x3e0478,null))[_0x4358('0x22')](handleError(_0x3e0478,null));};exports[_0x4358('0x16')]=function(_0x186be6,_0x54bd1c){var _0x16d0ef;if(_0x186be6[_0x4358('0x34')]['id']){delete _0x186be6[_0x4358('0x34')]['id'];}if(!_[_0x4358('0x54')](_0x186be6[_0x4358('0x34')]['dialTimezone'])){var _0x439f9a=_0x186be6[_0x4358('0x34')][_0x4358('0x55')];if(!_[_0x4358('0x54')](shared[_0x4358('0x56')][_0x439f9a]))_0x186be6[_0x4358('0x34')][_0x4358('0x57')]=shared['timezones'][_0x439f9a]['utcOffset'];}return db[_0x4358('0x23')][_0x4358('0x24')]({'where':{'id':_0x186be6[_0x4358('0x25')]['id']}})[_0x4358('0x17')](handleEntityNotFound(_0x54bd1c,null))[_0x4358('0x17')](saveUpdates(_0x186be6['body'],null))[_0x4358('0x17')](function(_0x49e454){_0x16d0ef=_0x49e454;var _0xfa3016={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x49e454&&_0x49e454['ListId']){if(_0x49e454[_0x4358('0x5f')]){_0xfa3016[_0x4358('0x5c')]['$and'][_0x4358('0x5e')]({'ListId':{'$ne':_0x49e454[_0x4358('0x5f')]}});}}return db[_0x4358('0x6e')][_0x4358('0x20')](_0xfa3016);})[_0x4358('0x17')](function(_0x3d4b87){if(_0x3d4b87){return _['omit'](_[_0x4358('0x73')](_0x186be6[_0x4358('0x34')],function(_0x39e2b1,_0x9c173f){return _[_0x4358('0x2a')](_0x9c173f,'cf_');}),_[_0x4358('0x70')](_0x3d4b87,function(_0x2e802f){return util[_0x4358('0x71')](_0x4358('0x72'),_0x2e802f['id']);}));}})['then'](function(_0x5e2f6){if(_0x5e2f6&&!_['isEmpty'](_0x5e2f6)){var _0x57ec1f=squel[_0x4358('0x16')]()[_0x4358('0x74')](_0x4358('0x75'))[_0x4358('0x76')](_0x5e2f6)['where'](_0x4358('0x77'),_0x186be6[_0x4358('0x25')]['id'])[_0x4358('0x78')]();return db['sequelize'][_0x4358('0x21')](_0x57ec1f[_0x4358('0x79')],{'replacements':_0x57ec1f[_0x4358('0x30')]});}})[_0x4358('0x17')](function(){if(_0x186be6[_0x4358('0x34')]['phone']&&_0x16d0ef){return db[_0x4358('0x3c')][_0x4358('0x16')]({'phone':_0x186be6['body'][_0x4358('0x7a')],'OrderBy':0x0},{'where':{'ContactId':_0x16d0ef['id']}});}})[_0x4358('0x17')](function(){return _0x16d0ef;})['then'](respondWithResult(_0x54bd1c,null))[_0x4358('0x22')](handleError(_0x54bd1c,null));};exports['getTags']=function(_0x34e2b2,_0x23427c){var _0x4a5225={};var _0xcdf81a={};var _0x396a0f;var _0x3e8a8a;return db[_0x4358('0x23')]['findOne']({'where':{'id':_0x34e2b2['params']['id']}})[_0x4358('0x17')](handleEntityNotFound(_0x23427c,null))[_0x4358('0x17')](function(_0x299ae2){if(_0x299ae2){_0x396a0f=_0x299ae2;_0xcdf81a[_0x4358('0x7b')]=_[_0x4358('0x28')](db[_0x4358('0x65')][_0x4358('0x7c')]);_0xcdf81a[_0x4358('0x21')]=_['keys'](_0x34e2b2[_0x4358('0x21')]);_0xcdf81a[_0x4358('0x7d')]=_[_0x4358('0x7e')](_0xcdf81a[_0x4358('0x7b')],_0xcdf81a[_0x4358('0x21')]);_0x4a5225[_0x4358('0x7f')]=_['intersection'](_0xcdf81a[_0x4358('0x7b')],qs['fields'](_0x34e2b2['query'][_0x4358('0x80')]));_0x4a5225[_0x4358('0x7f')]=_0x4a5225[_0x4358('0x7f')][_0x4358('0x29')]?_0x4a5225['attributes']:_0xcdf81a[_0x4358('0x7b')];_0x4a5225[_0x4358('0x81')]=qs[_0x4358('0x82')](_0x34e2b2['query'][_0x4358('0x82')]);_0x4a5225['where']=qs[_0x4358('0x7d')](_['pick'](_0x34e2b2['query'],_0xcdf81a[_0x4358('0x7d')]));if(_0x34e2b2[_0x4358('0x21')][_0x4358('0x83')]){_0x4a5225['where']=_[_0x4358('0x33')](_0x4a5225[_0x4358('0x5c')],{'$or':_[_0x4358('0x70')](_0x4a5225[_0x4358('0x7f')],function(_0x29f1df){var _0xa9ed3d={};_0xa9ed3d[_0x29f1df]={'$like':'%'+_0x34e2b2['query']['filter']+'%'};return _0xa9ed3d;})});}_0x4a5225=_['merge']({},_0x4a5225,_0x34e2b2[_0x4358('0x84')]);return _0x396a0f[_0x4358('0x85')](_0x4a5225);}})[_0x4358('0x17')](function(_0x2ba9db){if(_0x2ba9db){_0x3e8a8a=_0x2ba9db[_0x4358('0x29')];if(!_0x34e2b2[_0x4358('0x21')][_0x4358('0x61')](_0x4358('0x86'))){_0x4a5225['limit']=qs['limit'](_0x34e2b2[_0x4358('0x21')][_0x4358('0x12')]);_0x4a5225[_0x4358('0x11')]=qs[_0x4358('0x11')](_0x34e2b2[_0x4358('0x21')][_0x4358('0x11')]);}return _0x396a0f[_0x4358('0x85')](_0x4a5225);}})[_0x4358('0x17')](function(_0x1259a4){if(_0x1259a4){return _0x1259a4?{'count':_0x3e8a8a,'rows':_0x1259a4}:null;}})[_0x4358('0x17')](respondWithResult(_0x23427c,null))[_0x4358('0x22')](handleError(_0x23427c,null));};exports[_0x4358('0x87')]=function(_0x3410cb,_0x1df056){if(_0x3410cb[_0x4358('0x34')]['id']){delete _0x3410cb[_0x4358('0x34')]['id'];}return db[_0x4358('0x23')][_0x4358('0x88')]({'where':{'id':_0x3410cb['params']['id']}})['then'](handleEntityNotFound(_0x1df056,null))[_0x4358('0x17')](function(_0x3aeec0){if(_0x3aeec0){return _0x3aeec0['setTags'](_0x3410cb[_0x4358('0x34')][_0x4358('0x89')]||[]);}return null;})[_0x4358('0x17')](respondWithResult(_0x1df056,null))[_0x4358('0x22')](handleError(_0x1df056,null));};exports['setAdditionalPhones']=function(_0x4194f6,_0x4e6a7b){var _0x3bc719=[];_0x3bc719[_0x4358('0x5e')](addAdditionalPhones(_0x4194f6[_0x4358('0x34')]));Promise['all'](_0x3bc719)[_0x4358('0x17')](function(){_0x3bc719=[];_0x3bc719[_0x4358('0x5e')](deleteCmHopperPhones(_0x4194f6['body']['id']));_0x3bc719['push'](addCmHopperPhones(_0x4194f6[_0x4358('0x34')]['id']));Promise[_0x4358('0x63')](_0x3bc719)['then'](function(){return[0x1];})[_0x4358('0x17')](respondWithResult(_0x4e6a7b,null));});};function addAdditionalPhones(_0x2f8f49){var _0x36ac04;return new Promise(function(_0x7eea50){return db[_0x4358('0x47')]['destroy']({'where':{'CmContactId':_0x2f8f49['id']}})['then'](function(){db[_0x4358('0x69')][_0x4358('0x20')]({'raw':!![],'attributes':['id',_0x4358('0x8a')]})[_0x4358('0x17')](function(_0xfcdc34){var _0x251e42=[];for(var _0x113174=0x0;_0x113174<_0x2f8f49[_0x4358('0x8b')][_0x4358('0x29')];_0x113174++){var _0x1cedc0=_0x2f8f49[_0x4358('0x8c')]?_[_0x4358('0x54')](_0x2f8f49[_0x4358('0x8c')][_0x113174])?'':_0x2f8f49[_0x4358('0x8c')][_0x113174]:_0x2f8f49[_0x4358('0x8b')][_0x113174][_0x4358('0x8d')]?_0x2f8f49[_0x4358('0x8b')][_0x113174][_0x4358('0x8d')]:'';var _0x107f53=_[_0x4358('0x54')](_0x2f8f49['items'][_0x113174][_0x4358('0x8e')])?'':_0x2f8f49[_0x4358('0x8b')][_0x113174]['description'];var _0x279735=_0x1cedc0+':'+_0x2f8f49[_0x4358('0x8b')][_0x113174][_0x4358('0x7a')]+'§'+_0x107f53;if(_[_0x4358('0x54')](_0x36ac04))_0x36ac04=_0x279735;else _0x36ac04+=';'+_0x279735;var _0x2220d2=null;var _0x427b6e=null;if(_0x2f8f49[_0x4358('0x8c')]){if(!_[_0x4358('0x54')](_0x2f8f49[_0x4358('0x8c')][_0x113174])){_0x427b6e=_['find'](_0xfcdc34,function(_0x538318){return _0x538318['id']===_0x2f8f49[_0x4358('0x8c')][_0x113174];});if(!_[_0x4358('0x54')](_0x427b6e)){_0x2220d2=_0x427b6e[_0x4358('0x8a')];}}}else{if(!_[_0x4358('0x54')](_0x2f8f49[_0x4358('0x8b')][_0x113174])){_0x427b6e=_['find'](_0xfcdc34,function(_0x3b0bab){return _0x3b0bab['id']===_0x2f8f49[_0x4358('0x8b')][_0x113174][_0x4358('0x8d')];});if(!_[_0x4358('0x54')](_0x427b6e)){_0x2220d2=_0x113174;}}}if(_[_0x4358('0x54')](_0x2220d2)){_0x2220d2=0x64;}_0x251e42[_0x4358('0x5e')](addAdditionalPhone(_0x2f8f49['id'],_0x2f8f49[_0x4358('0x8b')][_0x113174]['phone'],_0x2f8f49[_0x4358('0x8c')]?_[_0x4358('0x54')](_0x2f8f49['item_types'][_0x113174])?null:_0x2f8f49[_0x4358('0x8c')][_0x113174]:_0x2f8f49[_0x4358('0x8b')][_0x113174][_0x4358('0x8d')]?_0x2f8f49[_0x4358('0x8b')][_0x113174][_0x4358('0x8d')]:null,_0x2220d2,_0x107f53));}Promise[_0x4358('0x63')](_0x251e42)[_0x4358('0x17')](function(){db[_0x4358('0x23')][_0x4358('0x16')]({'AdditionalPhones':_0x36ac04},{'where':{'id':_0x2f8f49['id']}})[_0x4358('0x17')](function(){_0x7eea50(0x1);});});});});});}function addAdditionalPhone(_0x519c69,_0x572b5a,_0x6651bd,_0x148816,_0xb8ca02){return db['CmContactHasItem'][_0x4358('0x24')]({'where':{'CmContactId':_0x519c69,'item':_0x572b5a}})[_0x4358('0x17')](function(_0x43d8ad){if(_0x43d8ad)logger['info'](_0x4358('0x8f'),_0x43d8ad);else{db[_0x4358('0x47')]['create']({'CmContactId':_0x519c69,'item':_0x572b5a,'ItemTypeId':_0x6651bd,'OrderBy':_0x148816,'ItemClass':_0x4358('0x90'),'description':_0xb8ca02});}});}function deleteCmHopperPhones(_0x2de197){return new Promise(function(_0x26eb79){return db[_0x4358('0x3c')][_0x4358('0x20')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x2de197}})[_0x4358('0x17')](function(_0x19b337){db[_0x4358('0x91')][_0x4358('0x18')]({'where':{'CmHopperId':{'$in':_['map'](_0x19b337,'id')}}});})['then'](function(){_0x26eb79(0x1);});});}function addCmHopperPhones(_0x56c813){return new Promise(function(_0x4fb05a){return db['CmHopper']['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x56c813}})[_0x4358('0x17')](function(_0x36a57c){var _0x36b80d=[];_[_0x4358('0x70')](_0x36a57c,function(_0xaefd06){_0x36b80d[_0x4358('0x5e')](createCmHopperPhone(_0x56c813,_0xaefd06['id']));});Promise[_0x4358('0x63')](_0x36b80d)[_0x4358('0x17')](function(){_0x4fb05a(0x1);});});});}function createCmHopperPhone(_0x3ec725,_0x380817){return new Promise(function(_0x5017e9){db[_0x4358('0x47')][_0x4358('0x20')]({'raw':!![],'attributes':[_0x4358('0x92'),'OrderBy'],'where':{'CmContactId':_0x3ec725,'ItemClass':_0x4358('0x90')},'include':[{'model':db[_0x4358('0x69')],'attributes':[_0x4358('0x8a')],'as':'ItemType'}],'order':[_0x4358('0x8a'),db[_0x4358('0x6b')][_0x4358('0x6c')]('`ItemType`.OrderBy')]})['then'](function(_0x3c0535){var _0x25971e=0x1;var _0x454164=_[_0x4358('0x70')](_0x3c0535,function(_0x5040db){_0x5040db['CmHopperId']=_0x380817;_0x5040db[_0x4358('0x7a')]=_0x5040db[_0x4358('0x92')];_0x5040db[_0x4358('0x8a')]=_0x25971e;delete _0x5040db[_0x4358('0x93')];_0x25971e=_0x25971e+0x1;return _0x5040db;});return db[_0x4358('0x91')][_0x4358('0x59')](_0x454164,{});})['then'](function(){_0x5017e9(0x1);});});}function insertAdditionalPhones(_0x4511c4,_0x10d942){return new Promise(function(_0x1229ac){var _0x428528=[];for(var _0xdd3937=0x0;_0xdd3937<_0x10d942[_0x4358('0x29')];_0xdd3937++){var _0x5a4681=_0x10d942[_0xdd3937];_0x428528[_0x4358('0x5e')](parseContactItemType(_0x5a4681));}Promise[_0x4358('0x63')](_0x428528)[_0x4358('0x17')](function(){var _0x4c24ca={'id':_0x4511c4['id'],'items':_0x10d942};return addAdditionalPhones(_0x4c24ca)[_0x4358('0x17')](function(){return addCmHopperPhones(_0x4511c4['id']);});})['then'](function(){_0x1229ac(_0x4511c4);});});}function parseContactItemType(_0x527227){return new Promise(function(_0x2fbb98){if(_0x527227['hasOwnProperty']('ItemTypeId')){_0x2fbb98(_0x527227);}else{return db[_0x4358('0x69')][_0x4358('0x24')]({'where':{'name':_0x527227['ItemType']}})[_0x4358('0x17')](function(_0x42afcf){if(_[_0x4358('0x54')](_0x42afcf))_0x527227['ItemTypeId']=null;else _0x527227[_0x4358('0x8d')]=_0x42afcf['id'];_0x2fbb98(_0x527227);});}});}exports[_0x4358('0x94')]=function(_0x591f5e,_0x5b854c){return db['CmContactHasItem'][_0x4358('0x20')]({'raw':!![],'where':{'CmContactId':_0x591f5e['params']['id'],'ItemClass':_0x4358('0x90')},'include':[{'model':db[_0x4358('0x69')],'as':_0x4358('0x6a')}],'order':[[_0x4358('0x8a')],[db['sequelize']['literal']('`ItemType`.OrderBy')]]})['then'](function(_0x720b7d){return _0x720b7d;})[_0x4358('0x17')](respondWithResult(_0x5b854c,null))[_0x4358('0x22')](handleError(_0x5b854c,null));};exports[_0x4358('0x95')]=function(_0x561182,_0x124222){return db[_0x4358('0x47')]['findAll']({'raw':!![],'where':{'CmContactId':_0x561182[_0x4358('0x34')][_0x4358('0x96')]}})['then'](function(_0x3d0134){var _0x3dac52=_[_0x4358('0x70')](_0x3d0134,function(_0x3cf786){_0x3cf786[_0x4358('0x97')]=_0x561182[_0x4358('0x34')][_0x4358('0x98')];return _0x3cf786;});return db[_0x4358('0x47')][_0x4358('0x59')](_0x3dac52,{});})[_0x4358('0x17')](function(){return addCmHopperPhones(_0x561182[_0x4358('0x34')]['toContactId']);})[_0x4358('0x17')](function(){return['ok'];})['then'](respondWithResult(_0x124222,null))[_0x4358('0x22')](handleError(_0x124222,null));};exports[_0x4358('0x99')]=function(_0x593abf,_0x2d6317){var _0x177f1a=[];_0x177f1a['push'](createCmHopperPhone(_0x593abf[_0x4358('0x34')]['id'],_0x593abf['body']['hopperId']));Promise[_0x4358('0x63')](_0x177f1a)[_0x4358('0x17')](function(){return[0x1];})[_0x4358('0x17')](respondWithResult(_0x2d6317,null));};exports['getHoppers']=function(_0xa13a21,_0xdeb380){var _0x38c581={'raw':![],'where':{}};var _0x57a8ec={};var _0x415158={'count':0x0,'rows':[]};return db[_0x4358('0x23')][_0x4358('0x88')]({'where':{'id':_0xa13a21[_0x4358('0x25')]['id']}})[_0x4358('0x17')](handleEntityNotFound(_0xdeb380,null))[_0x4358('0x17')](function(_0x27f612){if(_0x27f612){_0x57a8ec[_0x4358('0x7b')]=_[_0x4358('0x28')](db[_0x4358('0x3c')]['rawAttributes']);_0x57a8ec[_0x4358('0x21')]=_[_0x4358('0x28')](_0xa13a21[_0x4358('0x21')]);_0x57a8ec[_0x4358('0x7d')]=_[_0x4358('0x7e')](_0x57a8ec['model'],_0x57a8ec[_0x4358('0x21')]);_0x38c581['attributes']=_['intersection'](_0x57a8ec['model'],qs[_0x4358('0x80')](_0xa13a21[_0x4358('0x21')]['fields']));_0x38c581[_0x4358('0x7f')]=_0x38c581[_0x4358('0x7f')]['length']?_0x38c581[_0x4358('0x7f')]:_0x57a8ec['model'];if(!_0xa13a21[_0x4358('0x21')][_0x4358('0x61')](_0x4358('0x86'))){_0x38c581[_0x4358('0x12')]=qs[_0x4358('0x12')](_0xa13a21['query'][_0x4358('0x12')]);_0x38c581[_0x4358('0x11')]=qs[_0x4358('0x11')](_0xa13a21['query'][_0x4358('0x11')]);}_0x38c581[_0x4358('0x81')]=qs['sort'](_0xa13a21[_0x4358('0x21')]['sort']);_0x38c581['where']=qs[_0x4358('0x7d')](_[_0x4358('0x9a')](_0xa13a21[_0x4358('0x21')],_0x57a8ec[_0x4358('0x7d')]));_0x38c581[_0x4358('0x5c')][_0x4358('0x9b')]=_0x27f612['id'];if(_0xa13a21['query'][_0x4358('0x83')]){_0x38c581['where']=_[_0x4358('0x33')](_0x38c581['where'],{'$or':_[_0x4358('0x70')](_0x38c581[_0x4358('0x7f')],function(_0x7874b5){var _0x3b2702={};_0x3b2702[_0x7874b5]={'$like':'%'+_0xa13a21[_0x4358('0x21')][_0x4358('0x83')]+'%'};return _0x3b2702;})});}_0x38c581=_[_0x4358('0x33')]({},_0x38c581,_0xa13a21[_0x4358('0x84')]);return db[_0x4358('0x3c')]['count']({'where':_0x38c581['where']})['then'](function(_0x57d278){_0x415158['count']=_0x57d278;if(_0xa13a21['query']['includeAll']){_0x38c581[_0x4358('0x9c')]=[{'all':!![]}];}return db[_0x4358('0x3c')]['findAll'](_0x38c581);})[_0x4358('0x17')](function(_0x452ab3){_0x415158[_0x4358('0x9d')]=_0x452ab3;return _0x415158;});}})[_0x4358('0x17')](respondWithFilteredResult(_0xdeb380,_0x38c581))['catch'](handleError(_0xdeb380,null));};exports[_0x4358('0x9e')]=function(_0x1dd795,_0xb1a618){var _0x330b09={'raw':!![],'where':{}};var _0x2c127b={};var _0x38e9d8={'count':0x0,'rows':[]};return db[_0x4358('0x23')]['findOne']({'where':{'id':_0x1dd795['params']['id']}})[_0x4358('0x17')](handleEntityNotFound(_0xb1a618,null))[_0x4358('0x17')](function(_0x4d40a9){if(_0x4d40a9){_0x2c127b[_0x4358('0x7b')]=_['keys'](db[_0x4358('0x49')]['rawAttributes']);_0x2c127b[_0x4358('0x21')]=_[_0x4358('0x28')](_0x1dd795[_0x4358('0x21')]);_0x2c127b[_0x4358('0x7d')]=_[_0x4358('0x7e')](_0x2c127b['model'],_0x2c127b[_0x4358('0x21')]);_0x330b09[_0x4358('0x7f')]=_[_0x4358('0x7e')](_0x2c127b['model'],qs['fields'](_0x1dd795[_0x4358('0x21')][_0x4358('0x80')]));_0x330b09[_0x4358('0x7f')]=_0x330b09[_0x4358('0x7f')]['length']?_0x330b09['attributes']:_0x2c127b['model'];if(!_0x1dd795[_0x4358('0x21')]['hasOwnProperty']('nolimit')){_0x330b09['limit']=qs[_0x4358('0x12')](_0x1dd795[_0x4358('0x21')][_0x4358('0x12')]);_0x330b09['offset']=qs[_0x4358('0x11')](_0x1dd795[_0x4358('0x21')][_0x4358('0x11')]);}_0x330b09[_0x4358('0x81')]=qs[_0x4358('0x82')](_0x1dd795['query'][_0x4358('0x82')]);_0x330b09[_0x4358('0x5c')]=qs[_0x4358('0x7d')](_[_0x4358('0x9a')](_0x1dd795[_0x4358('0x21')],_0x2c127b[_0x4358('0x7d')]));_0x330b09[_0x4358('0x5c')][_0x4358('0x9b')]=_0x4d40a9['id'];if(_0x1dd795[_0x4358('0x21')][_0x4358('0x83')]){_0x330b09['where']=_['merge'](_0x330b09[_0x4358('0x5c')],{'$or':_[_0x4358('0x70')](_0x330b09[_0x4358('0x7f')],function(_0x290562){var _0x2bb73a={};_0x2bb73a[_0x290562]={'$like':'%'+_0x1dd795[_0x4358('0x21')][_0x4358('0x83')]+'%'};return _0x2bb73a;})});}_0x330b09=_[_0x4358('0x33')]({},_0x330b09,_0x1dd795[_0x4358('0x84')]);return db['CmHopperHistory'][_0x4358('0x14')]({'where':_0x330b09['where']})[_0x4358('0x17')](function(_0xf982eb){_0x38e9d8['count']=_0xf982eb;if(_0x1dd795[_0x4358('0x21')][_0x4358('0x9f')]){_0x330b09[_0x4358('0x9c')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x4358('0x20')](_0x330b09);})[_0x4358('0x17')](function(_0x3aaff1){_0x38e9d8[_0x4358('0x9d')]=_0x3aaff1;return _0x38e9d8;});}})['then'](respondWithFilteredResult(_0xb1a618,_0x330b09))[_0x4358('0x22')](handleError(_0xb1a618,null));};exports['getHopperFinals']=function(_0x52c309,_0x58629c){var _0x26074c={'raw':!![],'where':{}};var _0x513da2={};var _0xa16b2d={'count':0x0,'rows':[]};return db[_0x4358('0x23')][_0x4358('0x88')]({'where':{'id':_0x52c309[_0x4358('0x25')]['id']}})[_0x4358('0x17')](handleEntityNotFound(_0x58629c,null))[_0x4358('0x17')](function(_0x43dc2b){if(_0x43dc2b){_0x513da2[_0x4358('0x7b')]=_[_0x4358('0x28')](db[_0x4358('0x48')]['rawAttributes']);_0x513da2[_0x4358('0x21')]=_[_0x4358('0x28')](_0x52c309['query']);_0x513da2['filters']=_[_0x4358('0x7e')](_0x513da2['model'],_0x513da2[_0x4358('0x21')]);_0x26074c['attributes']=_['intersection'](_0x513da2['model'],qs[_0x4358('0x80')](_0x52c309['query'][_0x4358('0x80')]));_0x26074c[_0x4358('0x7f')]=_0x26074c[_0x4358('0x7f')][_0x4358('0x29')]?_0x26074c[_0x4358('0x7f')]:_0x513da2[_0x4358('0x7b')];if(!_0x52c309[_0x4358('0x21')][_0x4358('0x61')](_0x4358('0x86'))){_0x26074c[_0x4358('0x12')]=qs[_0x4358('0x12')](_0x52c309[_0x4358('0x21')][_0x4358('0x12')]);_0x26074c['offset']=qs['offset'](_0x52c309['query']['offset']);}_0x26074c[_0x4358('0x81')]=qs[_0x4358('0x82')](_0x52c309[_0x4358('0x21')]['sort']);_0x26074c[_0x4358('0x5c')]=qs['filters'](_[_0x4358('0x9a')](_0x52c309[_0x4358('0x21')],_0x513da2['filters']));_0x26074c[_0x4358('0x5c')][_0x4358('0x9b')]=_0x43dc2b['id'];if(_0x52c309[_0x4358('0x21')][_0x4358('0x83')]){_0x26074c['where']=_[_0x4358('0x33')](_0x26074c[_0x4358('0x5c')],{'$or':_['map'](_0x26074c[_0x4358('0x7f')],function(_0x5bc1b3){var _0x3443ab={};_0x3443ab[_0x5bc1b3]={'$like':'%'+_0x52c309['query']['filter']+'%'};return _0x3443ab;})});}_0x26074c=_[_0x4358('0x33')]({},_0x26074c,_0x52c309[_0x4358('0x84')]);return db[_0x4358('0x48')][_0x4358('0x14')]({'where':_0x26074c[_0x4358('0x5c')]})[_0x4358('0x17')](function(_0x5e3466){_0xa16b2d[_0x4358('0x14')]=_0x5e3466;if(_0x52c309['query'][_0x4358('0x9f')]){_0x26074c[_0x4358('0x9c')]=[{'all':!![]}];}return db[_0x4358('0x48')]['findAll'](_0x26074c);})[_0x4358('0x17')](function(_0x13ecf7){_0xa16b2d[_0x4358('0x9d')]=_0x13ecf7;return _0xa16b2d;});}})[_0x4358('0x17')](respondWithFilteredResult(_0x58629c,_0x26074c))[_0x4358('0x22')](handleError(_0x58629c,null));};exports[_0x4358('0xa0')]=function(_0x3bee47,_0x1641a3){var _0x445017={'raw':!![],'where':{}};var _0x56079e={};var _0x5ece34={'count':0x0,'rows':[]};return db[_0x4358('0x23')][_0x4358('0x88')]({'where':{'id':_0x3bee47[_0x4358('0x25')]['id']}})[_0x4358('0x17')](handleEntityNotFound(_0x1641a3,null))[_0x4358('0x17')](function(_0x5d857e){if(_0x5d857e){_0x56079e['model']=_[_0x4358('0x28')](db[_0x4358('0x50')][_0x4358('0x7c')]);_0x56079e['query']=_[_0x4358('0x28')](_0x3bee47['query']);_0x56079e[_0x4358('0x7d')]=_[_0x4358('0x7e')](_0x56079e[_0x4358('0x7b')],_0x56079e['query']);_0x445017[_0x4358('0x7f')]=_[_0x4358('0x7e')](_0x56079e['model'],qs[_0x4358('0x80')](_0x3bee47['query']['fields']));_0x445017[_0x4358('0x7f')]=_0x445017['attributes'][_0x4358('0x29')]?_0x445017[_0x4358('0x7f')]:_0x56079e['model'];if(!_0x3bee47['query']['hasOwnProperty'](_0x4358('0x86'))){_0x445017[_0x4358('0x12')]=qs[_0x4358('0x12')](_0x3bee47[_0x4358('0x21')]['limit']);_0x445017[_0x4358('0x11')]=qs[_0x4358('0x11')](_0x3bee47[_0x4358('0x21')][_0x4358('0x11')]);}_0x445017['order']=qs[_0x4358('0x82')](_0x3bee47[_0x4358('0x21')][_0x4358('0x82')]);_0x445017['where']=qs[_0x4358('0x7d')](_[_0x4358('0x9a')](_0x3bee47[_0x4358('0x21')],_0x56079e['filters']));_0x445017[_0x4358('0x5c')][_0x4358('0x9b')]=_0x5d857e['id'];if(_0x3bee47['query']['filter']){_0x445017['where']=_[_0x4358('0x33')](_0x445017[_0x4358('0x5c')],{'$or':_[_0x4358('0x70')](_0x445017['attributes'],function(_0x4b56d0){var _0x188c4a={};_0x188c4a[_0x4b56d0]={'$like':'%'+_0x3bee47[_0x4358('0x21')][_0x4358('0x83')]+'%'};return _0x188c4a;})});}_0x445017=_['merge']({},_0x445017,_0x3bee47[_0x4358('0x84')]);return db[_0x4358('0x50')][_0x4358('0x14')]({'where':_0x445017['where']})[_0x4358('0x17')](function(_0x12392b){_0x5ece34[_0x4358('0x14')]=_0x12392b;if(_0x3bee47['query'][_0x4358('0x9f')]){_0x445017[_0x4358('0x9c')]=[{'all':!![]}];}return db[_0x4358('0x50')]['findAll'](_0x445017);})['then'](function(_0x14de5e){_0x5ece34[_0x4358('0x9d')]=_0x14de5e;return _0x5ece34;});}})[_0x4358('0x17')](respondWithFilteredResult(_0x1641a3,_0x445017))[_0x4358('0x22')](handleError(_0x1641a3,null));};exports['uploadCsv']=function(_0x5474e6,_0x444e61){try{if(!_0x5474e6[_0x4358('0x34')]['ListId']){throw new Error(_0x4358('0xa1'));}if(!_0x5474e6['body'][_0x4358('0xa2')]){throw new Error(_0x4358('0xa3'));}if(!_0x5474e6['body'][_0x4358('0xa4')]){throw new Error(_0x4358('0xa5'));}if(!_0x5474e6['body'][_0x4358('0xa6')]){throw new Error(_0x4358('0xa7'));}var _0x31b0ca=_0x5474e6['body'][_0x4358('0xa2')][_0x4358('0xa8')](',');var _0x3f358c=_0x5474e6[_0x4358('0x34')]['binding_values'][_0x4358('0xa8')](',');if(!_0x31b0ca[_0x4358('0x29')]||!_0x3f358c[_0x4358('0x29')]||_0x31b0ca[_0x4358('0x29')]!==_0x3f358c[_0x4358('0x29')]){throw new Error(_0x4358('0xa9'));}_0x5474e6[_0x4358('0x34')][_0x4358('0x80')]=_[_0x4358('0xaa')](_0x31b0ca,_0x3f358c);if(!_0x5474e6[_0x4358('0x34')][_0x4358('0x80')][_0x4358('0x7a')]){throw new Error(_0x4358('0xab'));}if(!_0x5474e6['body'][_0x4358('0x80')][_0x4358('0xac')]){throw new Error(_0x4358('0xad'));}var _0x4b3742=path[_0x4358('0x39')](config[_0x4358('0xae')],'server/files/tmp',_0x5474e6[_0x4358('0xaf')][_0x4358('0xb0')]);fs[_0x4358('0xb1')](_0x4b3742,parseInt('0777',0x8));var _0x1c73ec=require(_0x4358('0xb2'))['fork'](path['join'](__dirname,'../../components/import/cm/csv'),[_0x4b3742,_0x5474e6[_0x4358('0x34')]['binding_keys'],_0x5474e6[_0x4358('0x34')]['binding_values'],_0x5474e6['body'][_0x4358('0x5f')],_0x5474e6['body']['CompanyId'],_0x5474e6[_0x4358('0x34')][_0x4358('0x5b')],_0x5474e6['body']['socket_timestamp']]);return _0x444e61['status'](0xc8)[_0x4358('0x10')]({'message':_0x4358('0xb3'),'pid':_0x1c73ec[_0x4358('0xb4')]});}catch(_0x1cea87){return _0x444e61[_0x4358('0x19')](0x1f4)[_0x4358('0x1e')](_0x1cea87);}};exports[_0x4358('0xb5')]=function(_0x58afb3,_0xa43f13){var _0x70120d=fs['createReadStream'](_0x58afb3['file']['path']);Papa[_0x4358('0xb6')](_0x70120d,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0xff8b7){return _0xa43f13[_0x4358('0x19')](0xc8)[_0x4358('0x10')]({'file':_0x58afb3[_0x4358('0xaf')],'fields':_0xff8b7['meta'][_0x4358('0x80')]});}});};exports[_0x4358('0xb7')]=function(_0x57655f,_0x4c2da){return db[_0x4358('0xb8')][_0x4358('0x20')]({'raw':!![],'attributes':['id'],'where':{'role':_0x4358('0xb9')}})[_0x4358('0x17')](function(_0x56ba90){var _0x48f3b5=![];if(!_0x57655f['body']['ListId']){throw new Error(_0x4358('0xa1'));}if(!_0x57655f[_0x4358('0x34')]['binding'][_0x4358('0x7a')]){throw new Error(_0x4358('0xab'));}if(!_0x57655f[_0x4358('0x34')]['binding'][_0x4358('0xac')]){throw new Error(_0x4358('0xad'));}if(!_0x57655f[_0x4358('0x34')][_0x4358('0xa6')]){throw new Error(_0x4358('0xa7'));}var _0x87db5=require(_0x4358('0xb2'))[_0x4358('0xba')](path[_0x4358('0x39')](__dirname,_0x4358('0xbb')),[_0x57655f[_0x4358('0x25')]['id'],JSON[_0x4358('0xbc')](_0x57655f[_0x4358('0x34')]),JSON['stringify'](_0x56ba90)]);_0x87db5['on'](_0x4358('0xbd'),function(){_0x48f3b5=!![];return _0x4c2da[_0x4358('0x19')](0xc8)['json']({'message':_0x4358('0xbe'),'pid':_0x87db5[_0x4358('0xb4')]});});_0x87db5['on'](_0x4358('0xbf'),function(_0x168836){if(_0x168836&&!_0x48f3b5){return _0x4c2da['status'](0x1f4)['json']({'message':_0x4358('0xc0'),'pid':_0x87db5['pid']});}});})[_0x4358('0x22')](handleError(_0x4c2da,null));};exports['importUpdates']=function(_0x3c3289,_0x35935c){return db['User']['findAll']({'raw':!![],'attributes':['id'],'where':{'role':'agent'}})[_0x4358('0x17')](function(_0x411e5a){var _0x4e6f54=![];if(!_0x3c3289[_0x4358('0x34')][_0x4358('0x5f')]){throw new Error(_0x4358('0xa1'));}if(!_0x3c3289[_0x4358('0x34')][_0x4358('0xc1')][_0x4358('0x7a')]){throw new Error(_0x4358('0xab'));}if(!_0x3c3289[_0x4358('0x34')][_0x4358('0xc1')][_0x4358('0xac')]){throw new Error('No\x20firstName\x20column\x20specified');}if(!_0x3c3289[_0x4358('0x34')][_0x4358('0xa6')]){throw new Error(_0x4358('0xa7'));}var _0x1221fa=require(_0x4358('0xb2'))[_0x4358('0xba')](path[_0x4358('0x39')](__dirname,_0x4358('0xc2')),[_0x3c3289[_0x4358('0x25')]['id'],JSON[_0x4358('0xbc')](_0x3c3289['body']),JSON[_0x4358('0xbc')](_0x411e5a)]);_0x1221fa['on'](_0x4358('0xbd'),function(){_0x4e6f54=!![];return _0x35935c[_0x4358('0x19')](0xc8)[_0x4358('0x10')]({'message':'start\x20child\x20process\x20correctly!','pid':_0x1221fa[_0x4358('0xb4')]});});_0x1221fa['on'](_0x4358('0xbf'),function(_0x3f2807){if(_0x3f2807&&!_0x4e6f54){return _0x35935c[_0x4358('0x19')](0x1f4)['json']({'message':_0x4358('0xc0'),'pid':_0x1221fa['pid']});}});})[_0x4358('0x22')](handleError(_0x35935c,null));};exports['getJourney']=function(_0x3b8699,_0x268111){var _0x156f4f=['mail',_0x4358('0xc3'),'sms',_0x4358('0xc4'),_0x4358('0xc5'),_0x4358('0xc6'),_0x4358('0xc7')];var _0x42925d={'offset':0x0,'order':qs[_0x4358('0x82')](_0x4358('0xc8'))},_0x3a5c10={'count':0x0,'rows':[]};Promise[_0x4358('0xc9')]()[_0x4358('0x17')](function(){if(_0x3b8699[_0x4358('0x21')][_0x4358('0xca')]){if(!_[_0x4358('0xcb')](_0x156f4f,_0x3b8699[_0x4358('0x21')][_0x4358('0xca')][_0x4358('0xcc')]())){throw new Error(_0x4358('0xcd'));}_0x156f4f=[_0x3b8699[_0x4358('0x21')][_0x4358('0xca')][_0x4358('0xcc')]()];}if(_0x3b8699[_0x4358('0x21')][_0x4358('0xce')]){try{var _0x2b8f50=JSON[_0x4358('0xb6')](_0x3b8699[_0x4358('0x21')][_0x4358('0xce')]);if(!moment(_0x2b8f50[_0x4358('0x35')])[_0x4358('0xcf')]()){throw new Error(_0x4358('0xd0'));}if(!moment(_0x2b8f50['to'])['isValid']()){throw new Error(_0x4358('0xd1'));}}catch(_0x522f55){throw new Error(_0x4358('0xd2'));}}if(!_0x3b8699[_0x4358('0x21')][_0x4358('0x61')]('nolimit')){_0x42925d[_0x4358('0x12')]=qs[_0x4358('0x12')](_0x3b8699[_0x4358('0x21')][_0x4358('0x12')]||0xa);_0x42925d['offset']=qs[_0x4358('0x11')](_0x3b8699['query'][_0x4358('0x11')]);}var _0x2f72e4=_0x156f4f[_0x4358('0x70')](function(_0x3b6751){if(_0x3b6751===_0x4358('0xc7')){var _0x16e740={'attributes':['id',_0x4358('0xd3'),_0x4358('0xd4'),_0x4358('0xd5'),_0x4358('0xd6'),_0x4358('0xd7'),_0x4358('0xd8'),_0x4358('0xd9'),_0x4358('0xda'),'note','createdAt','userDisposition',_0x4358('0xdb'),_0x4358('0xdc'),_0x4358('0xdd')],'where':{'ContactId':_0x3b8699[_0x4358('0x25')]['id']},'include':[{'model':db[_0x4358('0xb8')],'as':_0x4358('0xb8'),'attributes':['id',_0x4358('0x1d'),'fullname','alias']}],'order':[[_0x4358('0xde'),_0x4358('0xdf')]]};if(_0x3b8699[_0x4358('0x21')]['range']){_0x16e740[_0x4358('0x5c')]['createdAt']={'$gte':_0x2b8f50[_0x4358('0x35')],'$lte':_0x2b8f50['to']};}return db['VoiceCallReport'][_0x4358('0xe0')](_0x16e740)['then'](function(_0x106b7f){_0x3a5c10[_0x4358('0x14')]+=_0x106b7f[_0x4358('0x14')];return _[_0x4358('0x70')](_0x106b7f[_0x4358('0x9d')],function(_0x2f70f3){var _0x508f79=_0x2f70f3[_0x4358('0x36')]({'plain':!![]});_0x508f79[_0x4358('0xca')]=_0x3b6751;if(_0x508f79[_0x4358('0xb8')]){_0x508f79[_0x4358('0xb8')]={'id':_0x508f79['User']['id'],'name':_0x508f79[_0x4358('0xb8')]['name'],'fullname':_0x508f79[_0x4358('0xb8')][_0x4358('0xe1')],'alias':_0x508f79[_0x4358('0xb8')]['alias']};}return _0x508f79;});});}else{var _0x33edca=_['startCase'](_0x3b6751)+(_0x3b6751===_0x4358('0xc3')?_0x4358('0xe2'):'Account');var _0x401147={'attributes':['id','closed',_0x4358('0xe3'),_0x4358('0xde'),_0x4358('0xe4'),_0x4358('0xe5'),_0x4358('0xe6'),_0x4358('0xe7'),_0x4358('0xdd'),_0x33edca+'Id'],'where':{'ContactId':_0x3b8699[_0x4358('0x25')]['id']},'include':[{'model':db[_0x33edca],'as':_0x4358('0xe8'),'attributes':['id','name','key']},{'model':db['User'],'as':_0x4358('0xe9'),'attributes':['id','name',_0x4358('0xe1')]},{'model':db[_0x4358('0x65')],'as':_0x4358('0x66'),'attributes':['id',_0x4358('0x1d'),_0x4358('0xea')],'through':{'attributes':[]}}],'order':[[_0x4358('0xde'),_0x4358('0xdf')]]};if(_0x3b8699[_0x4358('0x21')][_0x4358('0xce')]){_0x401147['where'][_0x4358('0xde')]={'$gte':_0x2b8f50[_0x4358('0x35')],'$lte':_0x2b8f50['to']};}switch(_0x3b6751){case _0x4358('0xc3'):_0x401147[_0x4358('0x7f')]['push']('browserName',_0x4358('0xeb'),_0x4358('0xec'),_0x4358('0xed'),_0x4358('0xee'),'ratingMessage',_0x4358('0xef'),'ratingValue','referer');break;case'mail':_0x401147[_0x4358('0x7f')]['push'](_0x4358('0xf0'),_0x4358('0xf1'));break;case _0x4358('0xc4'):_0x401147[_0x4358('0x7f')][_0x4358('0x5e')](_0x4358('0xf2'),_0x4358('0xf3'));break;}return db[_[_0x4358('0xf4')](_0x3b6751)+_0x4358('0xf5')][_0x4358('0xe0')](_0x401147)[_0x4358('0x17')](function(_0x44a4b1){_0x3a5c10[_0x4358('0x14')]+=_0x44a4b1['count'];return _[_0x4358('0x70')](_0x44a4b1['rows'],function(_0x55ef4f){var _0x48993f=_0x55ef4f[_0x4358('0x36')]({'plain':!![]});_0x48993f[_0x4358('0xca')]=_0x3b6751;if(_0x48993f[_0x4358('0xe9')]){_0x48993f[_0x4358('0xe9')]={'id':_0x48993f[_0x4358('0xe9')]['id'],'name':_0x48993f[_0x4358('0xe9')]['name'],'fullname':_0x48993f['Owner'][_0x4358('0xe1')]};}return _0x48993f;});});}});return Promise[_0x4358('0x63')](_0x2f72e4);})[_0x4358('0x17')](function(_0x5409cb){return _(_0x5409cb)[_0x4358('0xf6')]()[_0x4358('0xf7')](_0x4358('0xde'))[_0x4358('0xf8')]()['value']();})['then'](function(_0x2ed6a0){_0x3a5c10[_0x4358('0x9d')]=_0x42925d[_0x4358('0x12')]?_0x2ed6a0['slice'](_0x42925d[_0x4358('0x11')],_0x42925d[_0x4358('0x11')]+_0x42925d[_0x4358('0x12')]):_0x2ed6a0;return _0x3a5c10;})['then'](respondWithFilteredResult(_0x268111,_0x42925d))[_0x4358('0x22')](handleError(_0x268111,null));}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.events.js b/server/api/cmContact/cmContact.events.js index 9892b9c..2262ccb 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 _0xd6c6=['hasOwnProperty','hook','exports','events','../../mysqldb','CmContact','setMaxListeners','update','emit'];(function(_0xe94a6c,_0x4b00da){var _0x21ea62=function(_0x265776){while(--_0x265776){_0xe94a6c['push'](_0xe94a6c['shift']());}};_0x21ea62(++_0x4b00da);}(_0xd6c6,0x1b3));var _0x6d6c=function(_0x476b08,_0x183f91){_0x476b08=_0x476b08-0x0;var _0x3b3c1a=_0xd6c6[_0x476b08];return _0x3b3c1a;};'use strict';var EventEmitter=require(_0x6d6c('0x0'));var CmContact=require(_0x6d6c('0x1'))['db'][_0x6d6c('0x2')];var CmContactEvents=new EventEmitter();CmContactEvents[_0x6d6c('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x6d6c('0x4'),'afterDestroy':'remove'};function emitEvent(_0x1ca6dd){return function(_0x4f5b97,_0x14a282,_0x2c6d5f){CmContactEvents[_0x6d6c('0x5')](_0x1ca6dd+':'+_0x4f5b97['id'],_0x4f5b97);CmContactEvents[_0x6d6c('0x5')](_0x1ca6dd,_0x4f5b97);_0x2c6d5f(null);};}for(var e in events){if(events[_0x6d6c('0x6')](e)){var event=events[e];CmContact[_0x6d6c('0x7')](e,emitEvent(event));}}module[_0x6d6c('0x8')]=CmContactEvents; \ No newline at end of file +var _0x1ccb=['exports','events','../../mysqldb','CmContact','setMaxListeners','save','update','remove','emit'];(function(_0x2aecb2,_0x343312){var _0x3ebb80=function(_0x19fab3){while(--_0x19fab3){_0x2aecb2['push'](_0x2aecb2['shift']());}};_0x3ebb80(++_0x343312);}(_0x1ccb,0x172));var _0xb1cc=function(_0x477e83,_0x4c0ad9){_0x477e83=_0x477e83-0x0;var _0x5d9557=_0x1ccb[_0x477e83];return _0x5d9557;};'use strict';var EventEmitter=require(_0xb1cc('0x0'));var CmContact=require(_0xb1cc('0x1'))['db'][_0xb1cc('0x2')];var CmContactEvents=new EventEmitter();CmContactEvents[_0xb1cc('0x3')](0x0);var events={'afterCreate':_0xb1cc('0x4'),'afterUpdate':_0xb1cc('0x5'),'afterDestroy':_0xb1cc('0x6')};function emitEvent(_0x16c17f){return function(_0x10f35b,_0x144abb,_0x7e3658){CmContactEvents[_0xb1cc('0x7')](_0x16c17f+':'+_0x10f35b['id'],_0x10f35b);CmContactEvents[_0xb1cc('0x7')](_0x16c17f,_0x10f35b);_0x7e3658(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmContact['hook'](e,emitEvent(event));}}module[_0xb1cc('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 7f44211..1340abc 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 _0x170f=['priority','callbackUniqueid','catch','ret','\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','error','afterCreate','Campaign','utcOffset','minutes','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','findAll','outbound','dialCheckDuplicateType','Lists','get','always','CmList','BlackLists','length','CmHopperBlack','cmContact,\x20%s,\x20%s','List\x20not\x20found','isEmpty','destroy','ContactId','CampaignId','all','info','[CmContact][afterDestroy][Succesfull]','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmContact.attributes','exports','define','CmContact','cm_contacts','phone','fti_cm_contacts','lastName','mobile','fax','email','utf8mb4_unicode_ci','cmContact','inspect','scheduledat','format','YYYY-MM-DD\x20HH:mm:ss','VoiceQueue','isNil','timezones','dialTimezone','add','CmHopper','findOne','then','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','create','ListId'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x170f,0xb2));var _0xf170=function(_0xf31767,_0x381746){_0xf31767=_0xf31767-0x0;var _0x24bd0c=_0x170f[_0xf31767];return _0x24bd0c;};'use strict';var _=require('lodash');var util=require(_0xf170('0x0'));var logger=require(_0xf170('0x1'))(_0xf170('0x2'));var moment=require(_0xf170('0x3'));var BPromise=require(_0xf170('0x4'));var rp=require(_0xf170('0x5'));var fs=require('fs');var path=require(_0xf170('0x6'));var rimraf=require(_0xf170('0x7'));var config=require(_0xf170('0x8'));var shared=require('../../config/environment/shared');var attributes=require(_0xf170('0x9'));module[_0xf170('0xa')]=function(_0x3892f4,_0x1dacbd){return _0x3892f4[_0xf170('0xb')](_0xf170('0xc'),attributes,{'tableName':_0xf170('0xd'),'paranoid':!![],'indexes':[{'name':_0xf170('0xe'),'fields':[_0xf170('0xe')]},{'name':_0xf170('0xf'),'fields':['firstName',_0xf170('0x10'),_0xf170('0xe'),_0xf170('0x11'),_0xf170('0x12'),_0xf170('0x13')],'type':'FULLTEXT'}],'timestamps':!![],'charset':'utf8mb4','collate':_0xf170('0x14'),'hooks':{'afterCreate':function(_0xe8ee5c,_0x9957a0,_0x437c71){var _0x3acf6=_0x3892f4['models'];var _0x5da77c=_0xe8ee5c['get']({'plain':!![]});function _0x1dc950(){return function(_0x173916){logger['error'](_0xf170('0x15'),'afterCreate',util[_0xf170('0x16')](_0x173916,{'showHidden':![],'depth':null}));};}function _0x449249(_0x1a220f,_0x371dfb){var _0x357cf3=_0x371dfb[_0xf170('0x17')]?_0x371dfb[_0xf170('0x17')]:moment()[_0xf170('0x18')](_0xf170('0x19'));return new BPromise(function(_0x279c0d,_0x252340){if(_['isNil'](_0x371dfb['dialTimezone'])){_0x279c0d({'ret':_0x357cf3});}else{_0x3acf6[_0xf170('0x1a')]['findOne']({'where':{'id':_0x1a220f['id']}})['then'](function(_0x57c0b1){if(!_[_0xf170('0x1b')](_0x57c0b1)){var _0x1802e2=_0x57c0b1['dialTimezone'];if(!_['isNil'](_0x1802e2)){var _0x49b88a=shared[_0xf170('0x1c')];var _0x3709a6=_0x49b88a[_0x1802e2];var _0x357e05=_0x49b88a[_0x371dfb[_0xf170('0x1d')]];if(!_[_0xf170('0x1b')](_0x3709a6)&&!_['isNil'](_0x357e05)){var _0x5116e2=_0x3709a6['utcOffset']-_0x357e05['utcOffset'];_0x357cf3=_0x371dfb[_0xf170('0x17')]?_0x371dfb[_0xf170('0x17')]:moment();var _0x4ee84f=moment(_0x357cf3)[_0xf170('0x1e')](_0x5116e2,'minutes');_0x279c0d({'ret':_0x4ee84f[_0xf170('0x18')](_0xf170('0x19'))});}else _0x279c0d({'ret':_0x357cf3});}else _0x279c0d({'ret':_0x357cf3});}else{_0x279c0d({'ret':_0x357cf3});}});}});return 0xa;}var _0xa39a38=function(_0x4f48d4){return new BPromise(function(_0x4ff68f,_0x21cffc){_0x449249(_0x4f48d4,_0x5da77c)['then'](function(_0x11f6da){_0x5da77c[_0xf170('0x17')]=_0x11f6da['ret'];_0x3acf6[_0xf170('0x1f')][_0xf170('0x20')]({'where':{'phone':_0x5da77c[_0xf170('0xe')],'VoiceQueueId':_0x4f48d4['id']}})[_0xf170('0x21')](function(_0x5d1afe){if(!_[_0xf170('0x1b')](_0x5d1afe)){throw new Error(_0xf170('0x22')+_0x5da77c[_0xf170('0xe')]+_0xf170('0x23')+_0x4f48d4['id']);}return _0x3acf6[_0xf170('0x1f')][_0xf170('0x24')]({'phone':_0x5da77c[_0xf170('0xe')],'ContactId':_0x5da77c['id'],'ListId':_0x5da77c[_0xf170('0x25')],'priority':_0x5da77c[_0xf170('0x26')]?_0x5da77c[_0xf170('0x26')]:0x2,'scheduledat':_0x5da77c[_0xf170('0x17')]?_0x5da77c[_0xf170('0x17')]:moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x5da77c[_0xf170('0x27')]?!![]:![],'callbackuniqueid':_0x5da77c[_0xf170('0x27')]?_0x5da77c[_0xf170('0x27')]:undefined,'callbackat':_0x5da77c[_0xf170('0x27')]?moment()[_0xf170('0x18')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0x4f48d4['id']});})[_0xf170('0x28')](function(_0x4ccb03){_0x21cffc(_0x4ccb03);});});});};var _0x501965=function(_0x204057){return new BPromise(function(_0x3a9748,_0x15d632){_0x449249(_0x204057,_0x5da77c)[_0xf170('0x21')](function(_0x55c81c){_0x5da77c[_0xf170('0x17')]=_0x55c81c[_0xf170('0x29')];_0x3acf6[_0xf170('0x1f')][_0xf170('0x20')]({'where':{'phone':_0x5da77c[_0xf170('0xe')],'VoiceQueueId':_0x204057['id']}})[_0xf170('0x21')](function(_0x5c62fd){if(!_[_0xf170('0x1b')](_0x5c62fd)){throw new Error(_0xf170('0x22')+_0x5da77c[_0xf170('0xe')]+_0xf170('0x2a')+_0x204057['id']);}return _0x3acf6[_0xf170('0x2b')]['findOne']({'where':{'calleridnum':_0x5da77c[_0xf170('0xe')],'VoiceQueueId':_0x204057['id']}});})[_0xf170('0x21')](function(_0x3a1629){if(!_[_0xf170('0x1b')](_0x3a1629)){throw new Error(_0xf170('0x2c')+_0x5da77c[_0xf170('0xe')]+_0xf170('0x2d')+_0x204057['id']);}return _0x3acf6['CmHopper'][_0xf170('0x24')]({'phone':_0x5da77c[_0xf170('0xe')],'ContactId':_0x5da77c['id'],'ListId':_0x5da77c[_0xf170('0x25')],'priority':_0x5da77c[_0xf170('0x26')]?_0x5da77c[_0xf170('0x26')]:0x2,'scheduledat':_0x5da77c[_0xf170('0x17')]?_0x5da77c[_0xf170('0x17')]:moment()['format'](_0xf170('0x19')),'callback':_0x5da77c['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x5da77c['callbackUniqueid']?_0x5da77c[_0xf170('0x27')]:undefined,'callbackat':_0x5da77c['callbackUniqueid']?moment()['format'](_0xf170('0x19')):undefined,'VoiceQueueId':_0x204057['id']});})[_0xf170('0x28')](function(_0x44a188){_0x15d632(_0x44a188);});});});};function _0x81efe8(){return function(_0x239430){logger[_0xf170('0x2e')]('cmContact',_0xf170('0x2f'),util[_0xf170('0x16')](_0x239430,{'showHidden':![],'depth':null}));};}function _0x4779a9(_0x487a3d,_0x181d45){var _0x1b4164=_0x181d45[_0xf170('0x17')]?_0x181d45['scheduledat']:moment()[_0xf170('0x18')](_0xf170('0x19'));return new BPromise(function(_0x5ee63e,_0x12942a){if(_[_0xf170('0x1b')](_0x181d45[_0xf170('0x1d')])){_0x5ee63e({'ret':_0x1b4164});}else{_0x3acf6[_0xf170('0x30')][_0xf170('0x20')]({'where':{'id':_0x487a3d['id']}})[_0xf170('0x21')](function(_0xd9e88e){if(!_[_0xf170('0x1b')](_0xd9e88e)){var _0x347c0f=_0xd9e88e[_0xf170('0x1d')];if(!_[_0xf170('0x1b')](_0x347c0f)){var _0x594c96=shared[_0xf170('0x1c')];var _0x5a1a3c=_0x594c96[_0x347c0f];var _0x24d1ce=_0x594c96[_0x181d45['dialTimezone']];if(!_[_0xf170('0x1b')](_0x5a1a3c)&&!_[_0xf170('0x1b')](_0x24d1ce)){var _0x3759e0=_0x5a1a3c[_0xf170('0x31')]-_0x24d1ce[_0xf170('0x31')];_0x1b4164=_0x181d45[_0xf170('0x17')]?_0x181d45[_0xf170('0x17')]:moment();var _0xf6e1d1=moment(_0x1b4164)['add'](_0x3759e0,_0xf170('0x32'));_0x5ee63e({'ret':_0xf6e1d1[_0xf170('0x18')]('YYYY-MM-DD\x20HH:mm:ss')});}else _0x5ee63e({'ret':_0x1b4164});}else _0x5ee63e({'ret':_0x1b4164});}else{_0x5ee63e({'ret':_0x1b4164});}});}});return 0xa;}var _0x3058cf=function(_0x2626dc){return new BPromise(function(_0x2aba56,_0x4f301c){_0x4779a9(_0x2626dc,_0x5da77c)[_0xf170('0x21')](function(_0xdd1544){_0x5da77c['scheduledat']=_0xdd1544[_0xf170('0x29')];_0x3acf6[_0xf170('0x1f')][_0xf170('0x20')]({'where':{'phone':_0x5da77c['phone'],'CampaignId':_0x2626dc['id']}})[_0xf170('0x21')](function(_0x22461c){if(!_[_0xf170('0x1b')](_0x22461c)){throw new Error(_0xf170('0x22')+_0x5da77c['phone']+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20'+_0x2626dc['id']);}return _0x3acf6[_0xf170('0x1f')][_0xf170('0x24')]({'phone':_0x5da77c[_0xf170('0xe')],'ContactId':_0x5da77c['id'],'ListId':_0x5da77c[_0xf170('0x25')],'priority':_0x5da77c[_0xf170('0x26')]?_0x5da77c[_0xf170('0x26')]:0x2,'scheduledat':_0x5da77c['scheduledat']?_0x5da77c[_0xf170('0x17')]:moment()[_0xf170('0x18')](_0xf170('0x19')),'callback':_0x5da77c[_0xf170('0x27')]?!![]:![],'callbackuniqueid':_0x5da77c[_0xf170('0x27')]?_0x5da77c[_0xf170('0x27')]:undefined,'callbackat':_0x5da77c[_0xf170('0x27')]?moment()[_0xf170('0x18')](_0xf170('0x19')):undefined,'CampaignId':_0x2626dc['id']});})[_0xf170('0x28')](function(_0x86d24a){_0x4f301c(_0x86d24a);});});});};var _0x112cb8=function(_0x507c89){return new BPromise(function(_0x1986b5,_0x78c4d0){_0x4779a9(_0x507c89,_0x5da77c)[_0xf170('0x21')](function(_0x251fb5){_0x5da77c[_0xf170('0x17')]=_0x251fb5['ret'];_0x3acf6[_0xf170('0x1f')][_0xf170('0x20')]({'where':{'phone':_0x5da77c[_0xf170('0xe')],'CampaignId':_0x507c89['id']}})[_0xf170('0x21')](function(_0x2f4fe1){if(!_[_0xf170('0x1b')](_0x2f4fe1)){throw new Error(_0xf170('0x22')+_0x5da77c[_0xf170('0xe')]+_0xf170('0x33')+_0x507c89['id']);}return _0x3acf6['CmHopperFinal'][_0xf170('0x20')]({'where':{'calleridnum':_0x5da77c['phone'],'CampaignId':_0x507c89['id']}});})[_0xf170('0x21')](function(_0x5d7bae){if(!_[_0xf170('0x1b')](_0x5d7bae)){throw new Error('cmContact,\x20afterCreate,\x20'+_0x5da77c[_0xf170('0xe')]+_0xf170('0x34')+_0x507c89['id']);}return _0x3acf6[_0xf170('0x1f')][_0xf170('0x24')]({'phone':_0x5da77c[_0xf170('0xe')],'ContactId':_0x5da77c['id'],'ListId':_0x5da77c['ListId'],'priority':_0x5da77c[_0xf170('0x26')]?_0x5da77c[_0xf170('0x26')]:0x2,'scheduledat':_0x5da77c['scheduledat']?_0x5da77c[_0xf170('0x17')]:moment()[_0xf170('0x18')](_0xf170('0x19')),'callback':_0x5da77c['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x5da77c[_0xf170('0x27')]?_0x5da77c[_0xf170('0x27')]:undefined,'callbackat':_0x5da77c[_0xf170('0x27')]?moment()[_0xf170('0x18')](_0xf170('0x19')):undefined,'CampaignId':_0x507c89['id']});})[_0xf170('0x28')](function(_0x51dc53){_0x78c4d0(_0x51dc53);});});});};if(_0x5da77c['ListId']){_0x3acf6[_0xf170('0x1a')][_0xf170('0x35')]({'where':{'type':_0xf170('0x36')},'attributes':['id',_0xf170('0x37'),'dialTimezone'],'include':[{'model':_0x3acf6['CmList'],'as':_0xf170('0x38'),'where':{'id':_0x5da77c[_0xf170('0x25')]}}]})[_0xf170('0x21')](function(_0x6c4a10){if(_0x6c4a10){var _0x1130b3=[];for(var _0x5f4fec=0x0,_0x2f9234;_0x5f4fec<_0x6c4a10['length'];_0x5f4fec+=0x1){_0x2f9234=_0x6c4a10[_0x5f4fec][_0xf170('0x39')]({'plain':!![]});switch(_0x2f9234[_0xf170('0x37')]){case _0xf170('0x3a'):_0x501965(_0x2f9234)[_0xf170('0x28')](_0x1dc950());break;case'onlyIfOpen':_0xa39a38(_0x2f9234)[_0xf170('0x28')](_0x1dc950());break;default:_0x4779a9(_0x2f9234,_0x5da77c)[_0xf170('0x21')](function(_0x69e4c0){_0x5da77c[_0xf170('0x17')]=_0x69e4c0[_0xf170('0x29')];_0x3acf6[_0xf170('0x1f')][_0xf170('0x24')]({'phone':_0x5da77c[_0xf170('0xe')],'ContactId':_0x5da77c['id'],'ListId':_0x5da77c[_0xf170('0x25')],'scheduledat':_0x5da77c[_0xf170('0x17')]?_0x5da77c[_0xf170('0x17')]:moment()['format'](_0xf170('0x19')),'priority':_0x5da77c[_0xf170('0x26')]?_0x5da77c['priority']:0x2,'callback':_0x5da77c['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x5da77c['callbackUniqueid']?_0x5da77c[_0xf170('0x27')]:undefined,'callbackat':_0x5da77c[_0xf170('0x27')]?moment()[_0xf170('0x18')](_0xf170('0x19')):undefined,'VoiceQueueId':_0x2f9234['id']})[_0xf170('0x28')](_0x1dc950());});}}}})[_0xf170('0x21')](function(){return _0x3acf6['VoiceQueue']['findAll']({'where':{'type':_0xf170('0x36')},'attributes':['id'],'include':[{'model':_0x3acf6[_0xf170('0x3b')],'as':_0xf170('0x3c'),'where':{'id':_0x5da77c[_0xf170('0x25')]}}]})[_0xf170('0x21')](function(_0x7e480e){if(_0x7e480e){var _0x4f4089=[];for(var _0xc8d053=0x0,_0x2ae17a;_0xc8d053<_0x7e480e[_0xf170('0x3d')];_0xc8d053+=0x1){_0x2ae17a=_0x7e480e[_0xc8d053]['get']({'plain':!![]});_0x3acf6[_0xf170('0x3e')]['create']({'phone':_0x5da77c[_0xf170('0xe')],'ContactId':_0x5da77c['id'],'ListId':_0x5da77c[_0xf170('0x25')],'VoiceQueueId':_0x2ae17a['id']})[_0xf170('0x28')](function(_0x56fadd){logger[_0xf170('0x2e')]('cmContact,\x20%s,\x20%s',_0xf170('0x2f'),_0x56fadd['message']);});}}});})[_0xf170('0x21')](function(){return _0x3acf6[_0xf170('0x30')]['findAll']({'attributes':['id',_0xf170('0x37'),'dialTimezone'],'include':[{'model':_0x3acf6[_0xf170('0x3b')],'as':_0xf170('0x38'),'where':{'id':_0x5da77c[_0xf170('0x25')]}}]})[_0xf170('0x21')](function(_0x2dac9b){if(_0x2dac9b){var _0x6a3bed=[];for(var _0x5035d9=0x0,_0x33c70c;_0x5035d9<_0x2dac9b['length'];_0x5035d9+=0x1){_0x33c70c=_0x2dac9b[_0x5035d9][_0xf170('0x39')]({'plain':!![]});switch(_0x33c70c[_0xf170('0x37')]){case _0xf170('0x3a'):_0x112cb8(_0x33c70c)['catch'](_0x81efe8());break;case'onlyIfOpen':_0x3058cf(_0x33c70c)[_0xf170('0x28')](_0x81efe8());break;default:_0x3acf6['CmHopper'][_0xf170('0x24')]({'phone':_0x5da77c['phone'],'ContactId':_0x5da77c['id'],'ListId':_0x5da77c[_0xf170('0x25')],'scheduledat':_0x5da77c[_0xf170('0x17')]?_0x5da77c['scheduledat']:moment()[_0xf170('0x18')]('YYYY-MM-DD\x20HH:mm:ss'),'priority':_0x5da77c[_0xf170('0x26')]?_0x5da77c[_0xf170('0x26')]:0x2,'callback':_0x5da77c['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x5da77c['callbackUniqueid']?_0x5da77c[_0xf170('0x27')]:undefined,'callbackat':_0x5da77c[_0xf170('0x27')]?moment()[_0xf170('0x18')](_0xf170('0x19')):undefined,'CampaignId':_0x33c70c['id']})['catch'](_0x81efe8());}}}});})[_0xf170('0x21')](function(){return _0x3acf6[_0xf170('0x30')][_0xf170('0x35')]({'attributes':['id'],'include':[{'model':_0x3acf6[_0xf170('0x3b')],'as':_0xf170('0x3c'),'where':{'id':_0x5da77c[_0xf170('0x25')]}}]})['then'](function(_0x4495cb){if(_0x4495cb){var _0x3b4351=[];for(var _0x4d836f=0x0,_0x18e10d;_0x4d836f<_0x4495cb[_0xf170('0x3d')];_0x4d836f+=0x1){_0x18e10d=_0x4495cb[_0x4d836f][_0xf170('0x39')]({'plain':!![]});_0x3acf6['CmHopperBlack'][_0xf170('0x24')]({'phone':_0x5da77c[_0xf170('0xe')],'ContactId':_0x5da77c['id'],'ListId':_0x5da77c['ListId'],'CampaignId':_0x18e10d['id']})['catch'](function(_0x55bc0c){logger['error'](_0xf170('0x3f'),_0xf170('0x2f'),_0x55bc0c['message']);});}}});})['then'](function(){_0x437c71();})[_0xf170('0x28')](function(_0x28f439){logger[_0xf170('0x2e')](_0xf170('0x3f'),_0xf170('0x2f'),_0x28f439['message']);_0x437c71(_0x28f439);});}else{_0x437c71(new Error(_0xf170('0x40')));}},'afterDestroy':function(_0x1f850c,_0x29a06a,_0x16e235){var _0x2d55d8=_0x3892f4['models'];var _0x1c7eb8=_0x1f850c[_0xf170('0x39')]({'plain':!![]});return _0x2d55d8[_0xf170('0x1f')][_0xf170('0x35')]({'raw':!![],'where':{'ListId':_0x1c7eb8[_0xf170('0x25')],'ContactId':_0x1c7eb8['id']}})[_0xf170('0x21')](function(_0x515ed9){if(!_[_0xf170('0x41')](_0x515ed9)){var _0x33fda6=[];for(var _0x2e3d66=0x0;_0x2e3d66<_0x515ed9[_0xf170('0x3d')];_0x2e3d66+=0x1){var _0x42d4e1=_0x2d55d8[_0xf170('0x1f')][_0xf170('0x42')]({'where':{'ListId':_0x515ed9[_0x2e3d66]['ListId'],'ContactId':_0x515ed9[_0x2e3d66][_0xf170('0x43')],'VoiceQueueId':_0x515ed9[_0x2e3d66]['VoiceQueueId'],'CampaignId':_0x515ed9[_0x2e3d66][_0xf170('0x44')]}});_0x33fda6['push'](_0x42d4e1);}return BPromise[_0xf170('0x45')](_0x33fda6);}})[_0xf170('0x21')](function(_0x5ecfff){logger[_0xf170('0x46')](_0xf170('0x47'),util['inspect'](_0x5ecfff,{'showHidden':![],'depth':null}));_0x16e235();})['catch'](function(_0xba4c66){logger['error']('[CmContact][afterDestroy][Error]',util[_0xf170('0x16')](_0xba4c66,{'showHidden':![],'depth':null}));_0x16e235(_0xba4c66);});}}});}; \ No newline at end of file +var _0xc73e=['error','format','YYYY-MM-DD\x20HH:mm:ss','isNil','VoiceQueue','then','dialTimezone','timezones','utcOffset','scheduledat','add','minutes','ret','CmHopper','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','create','ListId','priority','callbackUniqueid','catch','findOne','cmContact,\x20afterCreate\x20','CmHopperFinal','cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20','cmContact','afterCreate','inspect','Campaign','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','findAll','outbound','dialCheckDuplicateType','Lists','length','always','onlyIfOpen','CmList','CmHopperBlack','cmContact,\x20%s,\x20%s','message','BlackLists','List\x20not\x20found','isEmpty','VoiceQueueId','CampaignId','all','[CmContact][afterDestroy][Error]','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment/shared','exports','define','cm_contacts','phone','fti_cm_contacts','firstName','lastName','mobile','fax','email','FULLTEXT','utf8mb4_unicode_ci','models','get'];(function(_0x253f0e,_0x3d2fe7){var _0x5d231a=function(_0x1f7f33){while(--_0x1f7f33){_0x253f0e['push'](_0x253f0e['shift']());}};_0x5d231a(++_0x3d2fe7);}(_0xc73e,0x1db));var _0xec73=function(_0x2d0c53,_0x15252c){_0x2d0c53=_0x2d0c53-0x0;var _0x50fc98=_0xc73e[_0x2d0c53];return _0x50fc98;};'use strict';var _=require(_0xec73('0x0'));var util=require(_0xec73('0x1'));var logger=require(_0xec73('0x2'))('api');var moment=require('moment');var BPromise=require(_0xec73('0x3'));var rp=require(_0xec73('0x4'));var fs=require('fs');var path=require(_0xec73('0x5'));var rimraf=require(_0xec73('0x6'));var config=require('../../config/environment');var shared=require(_0xec73('0x7'));var attributes=require('./cmContact.attributes');module[_0xec73('0x8')]=function(_0x20b195,_0x1c7069){return _0x20b195[_0xec73('0x9')]('CmContact',attributes,{'tableName':_0xec73('0xa'),'paranoid':!![],'indexes':[{'name':_0xec73('0xb'),'fields':['phone']},{'name':_0xec73('0xc'),'fields':[_0xec73('0xd'),_0xec73('0xe'),_0xec73('0xb'),_0xec73('0xf'),_0xec73('0x10'),_0xec73('0x11')],'type':_0xec73('0x12')}],'timestamps':!![],'charset':'utf8mb4','collate':_0xec73('0x13'),'hooks':{'afterCreate':function(_0x276ee6,_0x205b9f,_0x30ace8){var _0x270af3=_0x20b195[_0xec73('0x14')];var _0x4911b0=_0x276ee6[_0xec73('0x15')]({'plain':!![]});function _0x257cbc(){return function(_0x52e125){logger[_0xec73('0x16')]('cmContact','afterCreate',util['inspect'](_0x52e125,{'showHidden':![],'depth':null}));};}function _0x41a455(_0x203ab4,_0x273b35){var _0x5e0aee=_0x273b35['scheduledat']?_0x273b35['scheduledat']:moment()[_0xec73('0x17')](_0xec73('0x18'));return new BPromise(function(_0x4918b3,_0x572366){if(_[_0xec73('0x19')](_0x273b35['dialTimezone'])){_0x4918b3({'ret':_0x5e0aee});}else{_0x270af3[_0xec73('0x1a')]['findOne']({'where':{'id':_0x203ab4['id']}})[_0xec73('0x1b')](function(_0x212a00){if(!_['isNil'](_0x212a00)){var _0x388bbc=_0x212a00[_0xec73('0x1c')];if(!_[_0xec73('0x19')](_0x388bbc)){var _0x5ab99c=shared[_0xec73('0x1d')];var _0xc83d03=_0x5ab99c[_0x388bbc];var _0x350628=_0x5ab99c[_0x273b35['dialTimezone']];if(!_[_0xec73('0x19')](_0xc83d03)&&!_['isNil'](_0x350628)){var _0x3c9c78=_0xc83d03[_0xec73('0x1e')]-_0x350628[_0xec73('0x1e')];_0x5e0aee=_0x273b35[_0xec73('0x1f')]?_0x273b35[_0xec73('0x1f')]:moment();var _0x4c8d8e=moment(_0x5e0aee)[_0xec73('0x20')](_0x3c9c78,_0xec73('0x21'));_0x4918b3({'ret':_0x4c8d8e[_0xec73('0x17')](_0xec73('0x18'))});}else _0x4918b3({'ret':_0x5e0aee});}else _0x4918b3({'ret':_0x5e0aee});}else{_0x4918b3({'ret':_0x5e0aee});}});}});return 0xa;}var _0x16ebc9=function(_0x417d0e){return new BPromise(function(_0x4c3cd0,_0x26f2df){_0x41a455(_0x417d0e,_0x4911b0)['then'](function(_0xaafc9c){_0x4911b0[_0xec73('0x1f')]=_0xaafc9c[_0xec73('0x22')];_0x270af3[_0xec73('0x23')]['findOne']({'where':{'phone':_0x4911b0[_0xec73('0xb')],'VoiceQueueId':_0x417d0e['id']}})[_0xec73('0x1b')](function(_0x4a2d4b){if(!_[_0xec73('0x19')](_0x4a2d4b)){throw new Error('cmContact,\x20afterCreate\x20'+_0x4911b0[_0xec73('0xb')]+_0xec73('0x24')+_0x417d0e['id']);}return _0x270af3[_0xec73('0x23')][_0xec73('0x25')]({'phone':_0x4911b0[_0xec73('0xb')],'ContactId':_0x4911b0['id'],'ListId':_0x4911b0[_0xec73('0x26')],'priority':_0x4911b0[_0xec73('0x27')]?_0x4911b0[_0xec73('0x27')]:0x2,'scheduledat':_0x4911b0[_0xec73('0x1f')]?_0x4911b0[_0xec73('0x1f')]:moment()[_0xec73('0x17')](_0xec73('0x18')),'callback':_0x4911b0['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x4911b0[_0xec73('0x28')]?_0x4911b0[_0xec73('0x28')]:undefined,'callbackat':_0x4911b0[_0xec73('0x28')]?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0x417d0e['id']});})[_0xec73('0x29')](function(_0x691421){_0x26f2df(_0x691421);});});});};var _0x3d965d=function(_0x57ea90){return new BPromise(function(_0x5a57da,_0x2aacee){_0x41a455(_0x57ea90,_0x4911b0)[_0xec73('0x1b')](function(_0x3ed53c){_0x4911b0['scheduledat']=_0x3ed53c[_0xec73('0x22')];_0x270af3[_0xec73('0x23')][_0xec73('0x2a')]({'where':{'phone':_0x4911b0['phone'],'VoiceQueueId':_0x57ea90['id']}})[_0xec73('0x1b')](function(_0x151b57){if(!_[_0xec73('0x19')](_0x151b57)){throw new Error(_0xec73('0x2b')+_0x4911b0[_0xec73('0xb')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20'+_0x57ea90['id']);}return _0x270af3[_0xec73('0x2c')][_0xec73('0x2a')]({'where':{'calleridnum':_0x4911b0['phone'],'VoiceQueueId':_0x57ea90['id']}});})[_0xec73('0x1b')](function(_0xa7c9a9){if(!_[_0xec73('0x19')](_0xa7c9a9)){throw new Error(_0xec73('0x2d')+_0x4911b0[_0xec73('0xb')]+_0xec73('0x2e')+_0x57ea90['id']);}return _0x270af3[_0xec73('0x23')][_0xec73('0x25')]({'phone':_0x4911b0[_0xec73('0xb')],'ContactId':_0x4911b0['id'],'ListId':_0x4911b0[_0xec73('0x26')],'priority':_0x4911b0['priority']?_0x4911b0['priority']:0x2,'scheduledat':_0x4911b0['scheduledat']?_0x4911b0[_0xec73('0x1f')]:moment()['format'](_0xec73('0x18')),'callback':_0x4911b0[_0xec73('0x28')]?!![]:![],'callbackuniqueid':_0x4911b0[_0xec73('0x28')]?_0x4911b0[_0xec73('0x28')]:undefined,'callbackat':_0x4911b0[_0xec73('0x28')]?moment()['format'](_0xec73('0x18')):undefined,'VoiceQueueId':_0x57ea90['id']});})[_0xec73('0x29')](function(_0x2b09e7){_0x2aacee(_0x2b09e7);});});});};function _0x3a6c70(){return function(_0xed06e3){logger[_0xec73('0x16')](_0xec73('0x2f'),_0xec73('0x30'),util[_0xec73('0x31')](_0xed06e3,{'showHidden':![],'depth':null}));};}function _0x15bce5(_0x12274d,_0x23cb72){var _0x18d8b3=_0x23cb72[_0xec73('0x1f')]?_0x23cb72[_0xec73('0x1f')]:moment()[_0xec73('0x17')](_0xec73('0x18'));return new BPromise(function(_0x3aaa84,_0x38f263){if(_[_0xec73('0x19')](_0x23cb72[_0xec73('0x1c')])){_0x3aaa84({'ret':_0x18d8b3});}else{_0x270af3[_0xec73('0x32')]['findOne']({'where':{'id':_0x12274d['id']}})[_0xec73('0x1b')](function(_0x38955d){if(!_['isNil'](_0x38955d)){var _0x23e7b8=_0x38955d[_0xec73('0x1c')];if(!_[_0xec73('0x19')](_0x23e7b8)){var _0x2987f8=shared[_0xec73('0x1d')];var _0x17f25f=_0x2987f8[_0x23e7b8];var _0x53193e=_0x2987f8[_0x23cb72[_0xec73('0x1c')]];if(!_[_0xec73('0x19')](_0x17f25f)&&!_[_0xec73('0x19')](_0x53193e)){var _0x5cac6d=_0x17f25f['utcOffset']-_0x53193e[_0xec73('0x1e')];_0x18d8b3=_0x23cb72['scheduledat']?_0x23cb72[_0xec73('0x1f')]:moment();var _0x1a19ae=moment(_0x18d8b3)['add'](_0x5cac6d,_0xec73('0x21'));_0x3aaa84({'ret':_0x1a19ae[_0xec73('0x17')](_0xec73('0x18'))});}else _0x3aaa84({'ret':_0x18d8b3});}else _0x3aaa84({'ret':_0x18d8b3});}else{_0x3aaa84({'ret':_0x18d8b3});}});}});return 0xa;}var _0x4a48a4=function(_0x4f144a){return new BPromise(function(_0x7d53b0,_0x1c267f){_0x15bce5(_0x4f144a,_0x4911b0)['then'](function(_0x2b851a){_0x4911b0[_0xec73('0x1f')]=_0x2b851a[_0xec73('0x22')];_0x270af3[_0xec73('0x23')][_0xec73('0x2a')]({'where':{'phone':_0x4911b0['phone'],'CampaignId':_0x4f144a['id']}})[_0xec73('0x1b')](function(_0x55d11c){if(!_[_0xec73('0x19')](_0x55d11c)){throw new Error(_0xec73('0x2b')+_0x4911b0[_0xec73('0xb')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20'+_0x4f144a['id']);}return _0x270af3[_0xec73('0x23')][_0xec73('0x25')]({'phone':_0x4911b0[_0xec73('0xb')],'ContactId':_0x4911b0['id'],'ListId':_0x4911b0['ListId'],'priority':_0x4911b0['priority']?_0x4911b0[_0xec73('0x27')]:0x2,'scheduledat':_0x4911b0[_0xec73('0x1f')]?_0x4911b0['scheduledat']:moment()[_0xec73('0x17')](_0xec73('0x18')),'callback':_0x4911b0[_0xec73('0x28')]?!![]:![],'callbackuniqueid':_0x4911b0[_0xec73('0x28')]?_0x4911b0[_0xec73('0x28')]:undefined,'callbackat':_0x4911b0[_0xec73('0x28')]?moment()[_0xec73('0x17')](_0xec73('0x18')):undefined,'CampaignId':_0x4f144a['id']});})[_0xec73('0x29')](function(_0x455de0){_0x1c267f(_0x455de0);});});});};var _0x507747=function(_0x3eba92){return new BPromise(function(_0x2f7e0c,_0x1f27ac){_0x15bce5(_0x3eba92,_0x4911b0)[_0xec73('0x1b')](function(_0x302845){_0x4911b0[_0xec73('0x1f')]=_0x302845[_0xec73('0x22')];_0x270af3['CmHopper'][_0xec73('0x2a')]({'where':{'phone':_0x4911b0[_0xec73('0xb')],'CampaignId':_0x3eba92['id']}})['then'](function(_0x2ce860){if(!_[_0xec73('0x19')](_0x2ce860)){throw new Error(_0xec73('0x2b')+_0x4911b0['phone']+_0xec73('0x33')+_0x3eba92['id']);}return _0x270af3[_0xec73('0x2c')][_0xec73('0x2a')]({'where':{'calleridnum':_0x4911b0[_0xec73('0xb')],'CampaignId':_0x3eba92['id']}});})[_0xec73('0x1b')](function(_0x2344bf){if(!_[_0xec73('0x19')](_0x2344bf)){throw new Error(_0xec73('0x2d')+_0x4911b0[_0xec73('0xb')]+_0xec73('0x34')+_0x3eba92['id']);}return _0x270af3[_0xec73('0x23')][_0xec73('0x25')]({'phone':_0x4911b0[_0xec73('0xb')],'ContactId':_0x4911b0['id'],'ListId':_0x4911b0[_0xec73('0x26')],'priority':_0x4911b0[_0xec73('0x27')]?_0x4911b0[_0xec73('0x27')]:0x2,'scheduledat':_0x4911b0[_0xec73('0x1f')]?_0x4911b0[_0xec73('0x1f')]:moment()[_0xec73('0x17')](_0xec73('0x18')),'callback':_0x4911b0['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x4911b0[_0xec73('0x28')]?_0x4911b0[_0xec73('0x28')]:undefined,'callbackat':_0x4911b0[_0xec73('0x28')]?moment()[_0xec73('0x17')](_0xec73('0x18')):undefined,'CampaignId':_0x3eba92['id']});})[_0xec73('0x29')](function(_0x865952){_0x1f27ac(_0x865952);});});});};if(_0x4911b0['ListId']){_0x270af3[_0xec73('0x1a')][_0xec73('0x35')]({'where':{'type':_0xec73('0x36')},'attributes':['id',_0xec73('0x37'),_0xec73('0x1c')],'include':[{'model':_0x270af3['CmList'],'as':_0xec73('0x38'),'where':{'id':_0x4911b0[_0xec73('0x26')]}}]})[_0xec73('0x1b')](function(_0x5bc018){if(_0x5bc018){var _0x4ca594=[];for(var _0x232bbc=0x0,_0x4e718b;_0x232bbc<_0x5bc018[_0xec73('0x39')];_0x232bbc+=0x1){_0x4e718b=_0x5bc018[_0x232bbc]['get']({'plain':!![]});switch(_0x4e718b[_0xec73('0x37')]){case _0xec73('0x3a'):_0x3d965d(_0x4e718b)[_0xec73('0x29')](_0x257cbc());break;case _0xec73('0x3b'):_0x16ebc9(_0x4e718b)['catch'](_0x257cbc());break;default:_0x15bce5(_0x4e718b,_0x4911b0)['then'](function(_0x408682){_0x4911b0[_0xec73('0x1f')]=_0x408682[_0xec73('0x22')];_0x270af3[_0xec73('0x23')]['create']({'phone':_0x4911b0[_0xec73('0xb')],'ContactId':_0x4911b0['id'],'ListId':_0x4911b0[_0xec73('0x26')],'scheduledat':_0x4911b0['scheduledat']?_0x4911b0[_0xec73('0x1f')]:moment()[_0xec73('0x17')](_0xec73('0x18')),'priority':_0x4911b0['priority']?_0x4911b0[_0xec73('0x27')]:0x2,'callback':_0x4911b0[_0xec73('0x28')]?!![]:![],'callbackuniqueid':_0x4911b0[_0xec73('0x28')]?_0x4911b0[_0xec73('0x28')]:undefined,'callbackat':_0x4911b0['callbackUniqueid']?moment()[_0xec73('0x17')](_0xec73('0x18')):undefined,'VoiceQueueId':_0x4e718b['id']})[_0xec73('0x29')](_0x257cbc());});}}}})[_0xec73('0x1b')](function(){return _0x270af3[_0xec73('0x1a')]['findAll']({'where':{'type':_0xec73('0x36')},'attributes':['id'],'include':[{'model':_0x270af3[_0xec73('0x3c')],'as':'BlackLists','where':{'id':_0x4911b0['ListId']}}]})['then'](function(_0x3e13fa){if(_0x3e13fa){var _0x394055=[];for(var _0x59096d=0x0,_0x5b0e59;_0x59096d<_0x3e13fa[_0xec73('0x39')];_0x59096d+=0x1){_0x5b0e59=_0x3e13fa[_0x59096d][_0xec73('0x15')]({'plain':!![]});_0x270af3[_0xec73('0x3d')][_0xec73('0x25')]({'phone':_0x4911b0['phone'],'ContactId':_0x4911b0['id'],'ListId':_0x4911b0[_0xec73('0x26')],'VoiceQueueId':_0x5b0e59['id']})[_0xec73('0x29')](function(_0x18f8ae){logger[_0xec73('0x16')](_0xec73('0x3e'),_0xec73('0x30'),_0x18f8ae[_0xec73('0x3f')]);});}}});})[_0xec73('0x1b')](function(){return _0x270af3[_0xec73('0x32')][_0xec73('0x35')]({'attributes':['id',_0xec73('0x37'),_0xec73('0x1c')],'include':[{'model':_0x270af3['CmList'],'as':_0xec73('0x38'),'where':{'id':_0x4911b0[_0xec73('0x26')]}}]})[_0xec73('0x1b')](function(_0xd1ec06){if(_0xd1ec06){var _0x3b34e9=[];for(var _0x5de585=0x0,_0x270838;_0x5de585<_0xd1ec06[_0xec73('0x39')];_0x5de585+=0x1){_0x270838=_0xd1ec06[_0x5de585][_0xec73('0x15')]({'plain':!![]});switch(_0x270838[_0xec73('0x37')]){case _0xec73('0x3a'):_0x507747(_0x270838)[_0xec73('0x29')](_0x3a6c70());break;case'onlyIfOpen':_0x4a48a4(_0x270838)[_0xec73('0x29')](_0x3a6c70());break;default:_0x270af3[_0xec73('0x23')][_0xec73('0x25')]({'phone':_0x4911b0[_0xec73('0xb')],'ContactId':_0x4911b0['id'],'ListId':_0x4911b0[_0xec73('0x26')],'scheduledat':_0x4911b0[_0xec73('0x1f')]?_0x4911b0[_0xec73('0x1f')]:moment()[_0xec73('0x17')](_0xec73('0x18')),'priority':_0x4911b0[_0xec73('0x27')]?_0x4911b0[_0xec73('0x27')]:0x2,'callback':_0x4911b0[_0xec73('0x28')]?!![]:![],'callbackuniqueid':_0x4911b0[_0xec73('0x28')]?_0x4911b0[_0xec73('0x28')]:undefined,'callbackat':_0x4911b0[_0xec73('0x28')]?moment()[_0xec73('0x17')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x270838['id']})[_0xec73('0x29')](_0x3a6c70());}}}});})['then'](function(){return _0x270af3[_0xec73('0x32')][_0xec73('0x35')]({'attributes':['id'],'include':[{'model':_0x270af3['CmList'],'as':_0xec73('0x40'),'where':{'id':_0x4911b0[_0xec73('0x26')]}}]})['then'](function(_0x3214f4){if(_0x3214f4){var _0x5f2eab=[];for(var _0x597cfb=0x0,_0x68b744;_0x597cfb<_0x3214f4[_0xec73('0x39')];_0x597cfb+=0x1){_0x68b744=_0x3214f4[_0x597cfb][_0xec73('0x15')]({'plain':!![]});_0x270af3[_0xec73('0x3d')][_0xec73('0x25')]({'phone':_0x4911b0[_0xec73('0xb')],'ContactId':_0x4911b0['id'],'ListId':_0x4911b0[_0xec73('0x26')],'CampaignId':_0x68b744['id']})[_0xec73('0x29')](function(_0x33af0c){logger[_0xec73('0x16')](_0xec73('0x3e'),_0xec73('0x30'),_0x33af0c[_0xec73('0x3f')]);});}}});})[_0xec73('0x1b')](function(){_0x30ace8();})[_0xec73('0x29')](function(_0x57f045){logger[_0xec73('0x16')](_0xec73('0x3e'),'afterCreate',_0x57f045[_0xec73('0x3f')]);_0x30ace8(_0x57f045);});}else{_0x30ace8(new Error(_0xec73('0x41')));}},'afterDestroy':function(_0x15db54,_0x379628,_0x2c6408){var _0x3a252f=_0x20b195[_0xec73('0x14')];var _0x1fe814=_0x15db54[_0xec73('0x15')]({'plain':!![]});return _0x3a252f[_0xec73('0x23')][_0xec73('0x35')]({'raw':!![],'where':{'ListId':_0x1fe814[_0xec73('0x26')],'ContactId':_0x1fe814['id']}})[_0xec73('0x1b')](function(_0x90c27e){if(!_[_0xec73('0x42')](_0x90c27e)){var _0x55553b=[];for(var _0x1e85e5=0x0;_0x1e85e5<_0x90c27e[_0xec73('0x39')];_0x1e85e5+=0x1){var _0x5aefef=_0x3a252f['CmHopper']['destroy']({'where':{'ListId':_0x90c27e[_0x1e85e5][_0xec73('0x26')],'ContactId':_0x90c27e[_0x1e85e5]['ContactId'],'VoiceQueueId':_0x90c27e[_0x1e85e5][_0xec73('0x43')],'CampaignId':_0x90c27e[_0x1e85e5][_0xec73('0x44')]}});_0x55553b['push'](_0x5aefef);}return BPromise[_0xec73('0x45')](_0x55553b);}})[_0xec73('0x1b')](function(_0xdcc0e0){logger['info']('[CmContact][afterDestroy][Succesfull]',util[_0xec73('0x31')](_0xdcc0e0,{'showHidden':![],'depth':null}));_0x2c6408();})[_0xec73('0x29')](function(_0x1a5837){logger['error'](_0xec73('0x46'),util['inspect'](_0x1a5837,{'showHidden':![],'depth':null}));_0x2c6408(_0x1a5837);});}}});}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.rpc.js b/server/api/cmContact/cmContact.rpc.js index 5e8619d..d8a0a27 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(_0x56e118,_0x3d66a5){var _0x3cabec=function(_0x2cd50c){while(--_0x2cd50c){_0x56e118['push'](_0x56e118['shift']());}};_0x3cabec(++_0x3d66a5);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'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(_0x2d7c22,_0x34ca2c){var _0x5502db=function(_0x58a466){while(--_0x58a466){_0x2d7c22['push'](_0x2d7c22['shift']());}};_0x5502db(++_0x34ca2c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xa9e0[_0x411add];return _0x238242;};'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 81d0f6f..ece6bd9 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 _0x7217=['PHONE','INTEGER','STRING'];(function(_0x486141,_0x1ff5dd){var _0x4f619d=function(_0x1e6525){while(--_0x1e6525){_0x486141['push'](_0x486141['shift']());}};_0x4f619d(++_0x1ff5dd);}(_0x7217,0xa9));var _0x7721=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0x7217[_0x311c35];return _0x5cc50c;};'use strict';var Sequelize=require('sequelize');module['exports']={'CmContactId':{'type':Sequelize[_0x7721('0x0')],'primaryKey':!![]},'item':{'type':Sequelize['STRING'],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0x7721('0x0')],'defaultValue':null},'ItemClass':{'type':Sequelize[_0x7721('0x1')],'defaultValue':_0x7721('0x2')},'OrderBy':{'type':Sequelize[_0x7721('0x0')],'defaultValue':null},'description':{'type':Sequelize[_0x7721('0x1')],'defaultValue':null}}; \ No newline at end of file +var _0xd82a=['STRING','sequelize','exports','INTEGER'];(function(_0x49e02c,_0x88247){var _0xa40e64=function(_0x5c202a){while(--_0x5c202a){_0x49e02c['push'](_0x49e02c['shift']());}};_0xa40e64(++_0x88247);}(_0xd82a,0xbd));var _0xad82=function(_0x2fc012,_0x503e5b){_0x2fc012=_0x2fc012-0x0;var _0x2891f9=_0xd82a[_0x2fc012];return _0x2891f9;};'use strict';var Sequelize=require(_0xad82('0x0'));module[_0xad82('0x1')]={'CmContactId':{'type':Sequelize[_0xad82('0x2')],'primaryKey':!![]},'item':{'type':Sequelize[_0xad82('0x3')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize['INTEGER'],'defaultValue':null},'ItemClass':{'type':Sequelize[_0xad82('0x3')],'defaultValue':'PHONE'},'OrderBy':{'type':Sequelize[_0xad82('0x2')],'defaultValue':null},'description':{'type':Sequelize[_0xad82('0x3')],'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 c3abd59..e48b2ae 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 _0xe95e=['nolimit','sort','where','pick','filter','merge','VIRTUAL','options','CmContactHasItem','findAll','rows','show','includeAll','include','find','catch','create','user','role','UserProfileSection','userProfileId','autoAssociation','error','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../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','get','CmContactHasItems','UserProfileResource','destroy','name','send','index','type','key','map','query','keys','filters','intersection','model','attributes','length','hasOwnProperty'];(function(_0xed759,_0x247163){var _0x169bb1=function(_0x27fda4){while(--_0x27fda4){_0xed759['push'](_0xed759['shift']());}};_0x169bb1(++_0x247163);}(_0xe95e,0xbf));var _0xee95=function(_0x32ef5a,_0x38647a){_0x32ef5a=_0x32ef5a-0x0;var _0x31c603=_0xe95e[_0x32ef5a];return _0x31c603;};'use strict';var emlformat=require(_0xee95('0x0'));var rimraf=require(_0xee95('0x1'));var zipdir=require(_0xee95('0x2'));var jsonpatch=require(_0xee95('0x3'));var rp=require(_0xee95('0x4'));var moment=require(_0xee95('0x5'));var BPromise=require(_0xee95('0x6'));var Mustache=require(_0xee95('0x7'));var util=require(_0xee95('0x8'));var path=require(_0xee95('0x9'));var sox=require(_0xee95('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xee95('0xb'));var squel=require(_0xee95('0xc'));var crypto=require(_0xee95('0xd'));var jsforce=require(_0xee95('0xe'));var deskjs=require(_0xee95('0xf'));var toCsv=require(_0xee95('0x10'));var querystring=require(_0xee95('0x11'));var Papa=require(_0xee95('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xee95('0x13'));var logger=require(_0xee95('0x14'))(_0xee95('0x15'));var utils=require(_0xee95('0x16'));var config=require(_0xee95('0x17'));var licenseUtil=require(_0xee95('0x18'));var db=require(_0xee95('0x19'))['db'];function respondWithStatusCode(_0x250e07,_0x166128){_0x166128=_0x166128||0xcc;return function(_0xa67339){if(_0xa67339){return _0x250e07[_0xee95('0x1a')](_0x166128);}return _0x250e07[_0xee95('0x1b')](_0x166128)['end']();};}function respondWithResult(_0x38f08e,_0x101fd5){_0x101fd5=_0x101fd5||0xc8;return function(_0x474bd3){if(_0x474bd3){return _0x38f08e[_0xee95('0x1b')](_0x101fd5)['json'](_0x474bd3);}};}function respondWithFilteredResult(_0x491b4e,_0x144ca1){return function(_0x4ea030){if(_0x4ea030){var _0xaae6e6=typeof _0x144ca1[_0xee95('0x1c')]===_0xee95('0x1d')&&typeof _0x144ca1[_0xee95('0x1e')]===_0xee95('0x1d');var _0x26451b=_0x4ea030[_0xee95('0x1f')];var _0x1a1568=_0xaae6e6?0x0:_0x144ca1['offset'];var _0x561f01=_0xaae6e6?_0x4ea030[_0xee95('0x1f')]:_0x144ca1[_0xee95('0x1c')]+_0x144ca1[_0xee95('0x1e')];var _0x13431a;if(_0x561f01>=_0x26451b){_0x561f01=_0x26451b;_0x13431a=0xc8;}else{_0x13431a=0xce;}_0x491b4e[_0xee95('0x1b')](_0x13431a);return _0x491b4e[_0xee95('0x20')](_0xee95('0x21'),_0x1a1568+'-'+_0x561f01+'/'+_0x26451b)[_0xee95('0x22')](_0x4ea030);}return null;};}function patchUpdates(_0x2f6144){return function(_0x3236cc){try{jsonpatch[_0xee95('0x23')](_0x3236cc,_0x2f6144,!![]);}catch(_0x9c489a){return BPromise[_0xee95('0x24')](_0x9c489a);}return _0x3236cc[_0xee95('0x25')]();};}function saveUpdates(_0x3d2edc,_0x3a4107){return function(_0x20fd90){if(_0x20fd90){return _0x20fd90[_0xee95('0x26')](_0x3d2edc)['then'](function(_0x5a6848){return _0x5a6848;});}return null;};}function removeEntity(_0x3ccef6,_0x3b03c6){return function(_0x50751b){if(_0x50751b){return _0x50751b['destroy']()[_0xee95('0x27')](function(){var _0x5213d8=_0x50751b[_0xee95('0x28')]({'plain':!![]});var _0x566cee=_0xee95('0x29');return db[_0xee95('0x2a')][_0xee95('0x2b')]({'where':{'type':_0x566cee,'resourceId':_0x5213d8['id']}})[_0xee95('0x27')](function(){return _0x50751b;});})['then'](function(){_0x3ccef6[_0xee95('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0xca99ae,_0x300721){return function(_0x202633){if(!_0x202633){_0xca99ae[_0xee95('0x1a')](0x194);}return _0x202633;};}function handleError(_0x182470,_0x354972){_0x354972=_0x354972||0x1f4;return function(_0x41ee47){logger['error'](_0x41ee47['stack']);if(_0x41ee47[_0xee95('0x2c')]){delete _0x41ee47[_0xee95('0x2c')];}_0x182470[_0xee95('0x1b')](_0x354972)[_0xee95('0x2d')](_0x41ee47);};}exports[_0xee95('0x2e')]=function(_0x42f5d3,_0x285f5f){var _0x4ad43d={},_0x460e22={},_0x137ebf={'count':0x0,'rows':[]};var _0x1eaefa=_['map'](db['CmContactHasItem']['rawAttributes'],function(_0x37ae1c){return{'name':_0x37ae1c['fieldName'],'type':_0x37ae1c[_0xee95('0x2f')][_0xee95('0x30')]};});_0x460e22['model']=_[_0xee95('0x31')](_0x1eaefa,'name');_0x460e22[_0xee95('0x32')]=_[_0xee95('0x33')](_0x42f5d3[_0xee95('0x32')]);_0x460e22[_0xee95('0x34')]=_[_0xee95('0x35')](_0x460e22[_0xee95('0x36')],_0x460e22[_0xee95('0x32')]);_0x4ad43d[_0xee95('0x37')]=_['intersection'](_0x460e22[_0xee95('0x36')],qs['fields'](_0x42f5d3[_0xee95('0x32')]['fields']));_0x4ad43d[_0xee95('0x37')]=_0x4ad43d[_0xee95('0x37')][_0xee95('0x38')]?_0x4ad43d[_0xee95('0x37')]:_0x460e22['model'];if(!_0x42f5d3['query'][_0xee95('0x39')](_0xee95('0x3a'))){_0x4ad43d[_0xee95('0x1e')]=qs[_0xee95('0x1e')](_0x42f5d3[_0xee95('0x32')]['limit']);_0x4ad43d[_0xee95('0x1c')]=qs[_0xee95('0x1c')](_0x42f5d3[_0xee95('0x32')][_0xee95('0x1c')]);}_0x4ad43d['order']=qs[_0xee95('0x3b')](_0x42f5d3['query'][_0xee95('0x3b')]);_0x4ad43d[_0xee95('0x3c')]=qs['filters'](_[_0xee95('0x3d')](_0x42f5d3['query'],_0x460e22['filters']),_0x1eaefa);if(_0x42f5d3[_0xee95('0x32')][_0xee95('0x3e')]){_0x4ad43d[_0xee95('0x3c')]=_[_0xee95('0x3f')](_0x4ad43d[_0xee95('0x3c')],{'$or':_[_0xee95('0x31')](_0x1eaefa,function(_0xde64ca){if(_0xde64ca['type']!==_0xee95('0x40')){var _0x1a6166={};_0x1a6166[_0xde64ca['name']]={'$like':'%'+_0x42f5d3[_0xee95('0x32')][_0xee95('0x3e')]+'%'};return _0x1a6166;}})});}_0x4ad43d=_[_0xee95('0x3f')]({},_0x4ad43d,_0x42f5d3[_0xee95('0x41')]);var _0x428a36={'where':_0x4ad43d[_0xee95('0x3c')]};return db[_0xee95('0x42')][_0xee95('0x1f')](_0x428a36)[_0xee95('0x27')](function(_0x7fe2b){_0x137ebf['count']=_0x7fe2b;if(_0x42f5d3[_0xee95('0x32')]['includeAll']){_0x4ad43d['include']=[{'all':!![]}];}return db[_0xee95('0x42')][_0xee95('0x43')](_0x4ad43d);})['then'](function(_0x249c0f){_0x137ebf[_0xee95('0x44')]=_0x249c0f;return _0x137ebf;})[_0xee95('0x27')](respondWithFilteredResult(_0x285f5f,_0x4ad43d))['catch'](handleError(_0x285f5f,null));};exports[_0xee95('0x45')]=function(_0x155a85,_0x1710f3){var _0x4181ea={'raw':!![],'where':{'id':_0x155a85['params']['id']}},_0x1fb16f={};_0x1fb16f[_0xee95('0x36')]=_['keys'](db['CmContactHasItem']['rawAttributes']);_0x1fb16f['query']=_[_0xee95('0x33')](_0x155a85[_0xee95('0x32')]);_0x1fb16f[_0xee95('0x34')]=_[_0xee95('0x35')](_0x1fb16f[_0xee95('0x36')],_0x1fb16f['query']);_0x4181ea[_0xee95('0x37')]=_['intersection'](_0x1fb16f['model'],qs['fields'](_0x155a85[_0xee95('0x32')]['fields']));_0x4181ea[_0xee95('0x37')]=_0x4181ea[_0xee95('0x37')]['length']?_0x4181ea[_0xee95('0x37')]:_0x1fb16f['model'];if(_0x155a85[_0xee95('0x32')][_0xee95('0x46')]){_0x4181ea[_0xee95('0x47')]=[{'all':!![]}];}_0x4181ea=_[_0xee95('0x3f')]({},_0x4181ea,_0x155a85['options']);return db[_0xee95('0x42')][_0xee95('0x48')](_0x4181ea)['then'](handleEntityNotFound(_0x1710f3,null))[_0xee95('0x27')](respondWithResult(_0x1710f3,null))[_0xee95('0x49')](handleError(_0x1710f3,null));};exports['create']=function(_0x462b3e,_0x45da5d){return db[_0xee95('0x42')][_0xee95('0x4a')](_0x462b3e['body'],{})[_0xee95('0x27')](function(_0x132dc2){var _0x244a4a=_0x462b3e[_0xee95('0x4b')][_0xee95('0x28')]({'plain':!![]});if(!_0x244a4a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x244a4a[_0xee95('0x4c')]==='user'){var _0x53bcb1=_0x132dc2[_0xee95('0x28')]({'plain':!![]});var _0x1ec5e7='CmContactHasItems';return db[_0xee95('0x4d')][_0xee95('0x48')]({'where':{'name':_0x1ec5e7,'userProfileId':_0x244a4a[_0xee95('0x4e')]},'raw':!![]})[_0xee95('0x27')](function(_0x36ebf9){if(_0x36ebf9&&_0x36ebf9[_0xee95('0x4f')]===0x0){return db[_0xee95('0x2a')][_0xee95('0x4a')]({'name':_0x53bcb1[_0xee95('0x2c')],'resourceId':_0x53bcb1['id'],'type':_0x36ebf9[_0xee95('0x2c')],'sectionId':_0x36ebf9['id']},{})[_0xee95('0x27')](function(){return _0x132dc2;});}else{return _0x132dc2;}})[_0xee95('0x49')](function(_0x4d4ac7){logger[_0xee95('0x50')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4d4ac7);throw _0x4d4ac7;});}return _0x132dc2;})[_0xee95('0x27')](respondWithResult(_0x45da5d,0xc9))[_0xee95('0x49')](handleError(_0x45da5d,null));};exports[_0xee95('0x26')]=function(_0x389658,_0x2bbd88){if(_0x389658['body']['id']){delete _0x389658[_0xee95('0x51')]['id'];}return db[_0xee95('0x42')][_0xee95('0x48')]({'where':{'id':_0x389658[_0xee95('0x52')]['id']}})[_0xee95('0x27')](handleEntityNotFound(_0x2bbd88,null))[_0xee95('0x27')](saveUpdates(_0x389658[_0xee95('0x51')],null))[_0xee95('0x27')](respondWithResult(_0x2bbd88,null))[_0xee95('0x49')](handleError(_0x2bbd88,null));};exports['destroy']=function(_0x2eb6a5,_0x504b63){return db['CmContactHasItem']['find']({'where':{'id':_0x2eb6a5[_0xee95('0x52')]['id']}})[_0xee95('0x27')](handleEntityNotFound(_0x504b63,null))['then'](removeEntity(_0x504b63,null))[_0xee95('0x49')](handleError(_0x504b63,null));}; \ No newline at end of file +var _0x8abb=['to-csv','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','end','status','json','offset','limit','count','Content-Range','apply','reject','save','then','destroy','get','CmContactHasItems','UserProfileResource','error','name','send','index','CmContactHasItem','fieldName','type','key','model','map','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','rawAttributes','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','find','userProfileId','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox'];(function(_0x4a26a9,_0x109438){var _0x3ff10f=function(_0x540033){while(--_0x540033){_0x4a26a9['push'](_0x4a26a9['shift']());}};_0x3ff10f(++_0x109438);}(_0x8abb,0x1ef));var _0xb8ab=function(_0x33ace0,_0x484301){_0x33ace0=_0x33ace0-0x0;var _0xcd0e6a=_0x8abb[_0x33ace0];return _0xcd0e6a;};'use strict';var emlformat=require(_0xb8ab('0x0'));var rimraf=require(_0xb8ab('0x1'));var zipdir=require(_0xb8ab('0x2'));var jsonpatch=require(_0xb8ab('0x3'));var rp=require(_0xb8ab('0x4'));var moment=require(_0xb8ab('0x5'));var BPromise=require(_0xb8ab('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xb8ab('0x7'));var sox=require(_0xb8ab('0x8'));var csv=require(_0xb8ab('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb8ab('0xa'));var squel=require(_0xb8ab('0xb'));var crypto=require(_0xb8ab('0xc'));var jsforce=require(_0xb8ab('0xd'));var deskjs=require(_0xb8ab('0xe'));var toCsv=require(_0xb8ab('0x9'));var querystring=require(_0xb8ab('0xf'));var Papa=require(_0xb8ab('0x10'));var Redis=require(_0xb8ab('0x11'));var authService=require(_0xb8ab('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xb8ab('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb8ab('0x14'))(_0xb8ab('0x15'));var utils=require(_0xb8ab('0x16'));var config=require(_0xb8ab('0x17'));var licenseUtil=require(_0xb8ab('0x18'));var db=require(_0xb8ab('0x19'))['db'];function respondWithStatusCode(_0x321c62,_0x3d69cd){_0x3d69cd=_0x3d69cd||0xcc;return function(_0x1952fe){if(_0x1952fe){return _0x321c62['sendStatus'](_0x3d69cd);}return _0x321c62['status'](_0x3d69cd)[_0xb8ab('0x1a')]();};}function respondWithResult(_0x2505ce,_0x5a57b5){_0x5a57b5=_0x5a57b5||0xc8;return function(_0x10b876){if(_0x10b876){return _0x2505ce[_0xb8ab('0x1b')](_0x5a57b5)[_0xb8ab('0x1c')](_0x10b876);}};}function respondWithFilteredResult(_0x4fd554,_0x1588fb){return function(_0x27c27a){if(_0x27c27a){var _0x35cea=typeof _0x1588fb[_0xb8ab('0x1d')]==='undefined'&&typeof _0x1588fb[_0xb8ab('0x1e')]==='undefined';var _0x19b6fb=_0x27c27a[_0xb8ab('0x1f')];var _0x579c2a=_0x35cea?0x0:_0x1588fb['offset'];var _0x10aedc=_0x35cea?_0x27c27a[_0xb8ab('0x1f')]:_0x1588fb[_0xb8ab('0x1d')]+_0x1588fb[_0xb8ab('0x1e')];var _0x177058;if(_0x10aedc>=_0x19b6fb){_0x10aedc=_0x19b6fb;_0x177058=0xc8;}else{_0x177058=0xce;}_0x4fd554[_0xb8ab('0x1b')](_0x177058);return _0x4fd554['set'](_0xb8ab('0x20'),_0x579c2a+'-'+_0x10aedc+'/'+_0x19b6fb)[_0xb8ab('0x1c')](_0x27c27a);}return null;};}function patchUpdates(_0x4d7574){return function(_0x36a1fa){try{jsonpatch[_0xb8ab('0x21')](_0x36a1fa,_0x4d7574,!![]);}catch(_0x578a5a){return BPromise[_0xb8ab('0x22')](_0x578a5a);}return _0x36a1fa[_0xb8ab('0x23')]();};}function saveUpdates(_0x4d591a,_0x331a37){return function(_0x514d36){if(_0x514d36){return _0x514d36['update'](_0x4d591a)[_0xb8ab('0x24')](function(_0x42e24e){return _0x42e24e;});}return null;};}function removeEntity(_0x4d661d,_0x2941f5){return function(_0x3c4afd){if(_0x3c4afd){return _0x3c4afd[_0xb8ab('0x25')]()[_0xb8ab('0x24')](function(){var _0x40e02d=_0x3c4afd[_0xb8ab('0x26')]({'plain':!![]});var _0x1e2d8f=_0xb8ab('0x27');return db[_0xb8ab('0x28')]['destroy']({'where':{'type':_0x1e2d8f,'resourceId':_0x40e02d['id']}})['then'](function(){return _0x3c4afd;});})['then'](function(){_0x4d661d[_0xb8ab('0x1b')](0xcc)[_0xb8ab('0x1a')]();});}};}function handleEntityNotFound(_0x5bd009,_0x1a3ff0){return function(_0x58187d){if(!_0x58187d){_0x5bd009['sendStatus'](0x194);}return _0x58187d;};}function handleError(_0x549d0f,_0x539893){_0x539893=_0x539893||0x1f4;return function(_0x32e881){logger[_0xb8ab('0x29')](_0x32e881['stack']);if(_0x32e881['name']){delete _0x32e881[_0xb8ab('0x2a')];}_0x549d0f[_0xb8ab('0x1b')](_0x539893)[_0xb8ab('0x2b')](_0x32e881);};}exports[_0xb8ab('0x2c')]=function(_0x33f6b3,_0x5641fa){var _0x13ad1d={},_0x5aa838={},_0xda26b3={'count':0x0,'rows':[]};var _0x2e0d50=_['map'](db[_0xb8ab('0x2d')]['rawAttributes'],function(_0x55a5e8){return{'name':_0x55a5e8[_0xb8ab('0x2e')],'type':_0x55a5e8[_0xb8ab('0x2f')][_0xb8ab('0x30')]};});_0x5aa838[_0xb8ab('0x31')]=_[_0xb8ab('0x32')](_0x2e0d50,'name');_0x5aa838[_0xb8ab('0x33')]=_[_0xb8ab('0x34')](_0x33f6b3['query']);_0x5aa838['filters']=_['intersection'](_0x5aa838[_0xb8ab('0x31')],_0x5aa838[_0xb8ab('0x33')]);_0x13ad1d[_0xb8ab('0x35')]=_[_0xb8ab('0x36')](_0x5aa838[_0xb8ab('0x31')],qs['fields'](_0x33f6b3[_0xb8ab('0x33')][_0xb8ab('0x37')]));_0x13ad1d[_0xb8ab('0x35')]=_0x13ad1d[_0xb8ab('0x35')][_0xb8ab('0x38')]?_0x13ad1d['attributes']:_0x5aa838[_0xb8ab('0x31')];if(!_0x33f6b3[_0xb8ab('0x33')][_0xb8ab('0x39')](_0xb8ab('0x3a'))){_0x13ad1d[_0xb8ab('0x1e')]=qs[_0xb8ab('0x1e')](_0x33f6b3[_0xb8ab('0x33')][_0xb8ab('0x1e')]);_0x13ad1d['offset']=qs['offset'](_0x33f6b3[_0xb8ab('0x33')][_0xb8ab('0x1d')]);}_0x13ad1d[_0xb8ab('0x3b')]=qs[_0xb8ab('0x3c')](_0x33f6b3['query'][_0xb8ab('0x3c')]);_0x13ad1d[_0xb8ab('0x3d')]=qs['filters'](_[_0xb8ab('0x3e')](_0x33f6b3[_0xb8ab('0x33')],_0x5aa838[_0xb8ab('0x3f')]),_0x2e0d50);if(_0x33f6b3[_0xb8ab('0x33')]['filter']){_0x13ad1d['where']=_[_0xb8ab('0x40')](_0x13ad1d[_0xb8ab('0x3d')],{'$or':_[_0xb8ab('0x32')](_0x2e0d50,function(_0x96c5cd){if(_0x96c5cd['type']!==_0xb8ab('0x41')){var _0x2eb7ab={};_0x2eb7ab[_0x96c5cd[_0xb8ab('0x2a')]]={'$like':'%'+_0x33f6b3['query'][_0xb8ab('0x42')]+'%'};return _0x2eb7ab;}})});}_0x13ad1d=_[_0xb8ab('0x40')]({},_0x13ad1d,_0x33f6b3[_0xb8ab('0x43')]);var _0x8a4309={'where':_0x13ad1d[_0xb8ab('0x3d')]};return db[_0xb8ab('0x2d')]['count'](_0x8a4309)[_0xb8ab('0x24')](function(_0x42ba24){_0xda26b3[_0xb8ab('0x1f')]=_0x42ba24;if(_0x33f6b3[_0xb8ab('0x33')][_0xb8ab('0x44')]){_0x13ad1d[_0xb8ab('0x45')]=[{'all':!![]}];}return db[_0xb8ab('0x2d')][_0xb8ab('0x46')](_0x13ad1d);})['then'](function(_0x14db96){_0xda26b3[_0xb8ab('0x47')]=_0x14db96;return _0xda26b3;})[_0xb8ab('0x24')](respondWithFilteredResult(_0x5641fa,_0x13ad1d))['catch'](handleError(_0x5641fa,null));};exports[_0xb8ab('0x48')]=function(_0x3d4cab,_0x2300b0){var _0x150e68={'raw':!![],'where':{'id':_0x3d4cab[_0xb8ab('0x49')]['id']}},_0x1bbc5a={};_0x1bbc5a[_0xb8ab('0x31')]=_[_0xb8ab('0x34')](db[_0xb8ab('0x2d')][_0xb8ab('0x4a')]);_0x1bbc5a[_0xb8ab('0x33')]=_['keys'](_0x3d4cab[_0xb8ab('0x33')]);_0x1bbc5a[_0xb8ab('0x3f')]=_[_0xb8ab('0x36')](_0x1bbc5a[_0xb8ab('0x31')],_0x1bbc5a[_0xb8ab('0x33')]);_0x150e68[_0xb8ab('0x35')]=_[_0xb8ab('0x36')](_0x1bbc5a[_0xb8ab('0x31')],qs[_0xb8ab('0x37')](_0x3d4cab[_0xb8ab('0x33')][_0xb8ab('0x37')]));_0x150e68['attributes']=_0x150e68[_0xb8ab('0x35')][_0xb8ab('0x38')]?_0x150e68[_0xb8ab('0x35')]:_0x1bbc5a['model'];if(_0x3d4cab[_0xb8ab('0x33')][_0xb8ab('0x44')]){_0x150e68[_0xb8ab('0x45')]=[{'all':!![]}];}_0x150e68=_[_0xb8ab('0x40')]({},_0x150e68,_0x3d4cab[_0xb8ab('0x43')]);return db[_0xb8ab('0x2d')]['find'](_0x150e68)[_0xb8ab('0x24')](handleEntityNotFound(_0x2300b0,null))['then'](respondWithResult(_0x2300b0,null))[_0xb8ab('0x4b')](handleError(_0x2300b0,null));};exports['create']=function(_0x257d77,_0x12b47e){return db[_0xb8ab('0x2d')][_0xb8ab('0x4c')](_0x257d77[_0xb8ab('0x4d')],{})['then'](function(_0x5315e4){var _0xc35a31=_0x257d77['user'][_0xb8ab('0x26')]({'plain':!![]});if(!_0xc35a31)throw new Error(_0xb8ab('0x4e'));if(_0xc35a31['role']===_0xb8ab('0x4f')){var _0xc0c0f1=_0x5315e4[_0xb8ab('0x26')]({'plain':!![]});var _0x5200a8=_0xb8ab('0x27');return db[_0xb8ab('0x50')][_0xb8ab('0x51')]({'where':{'name':_0x5200a8,'userProfileId':_0xc35a31[_0xb8ab('0x52')]},'raw':!![]})[_0xb8ab('0x24')](function(_0x552d12){if(_0x552d12&&_0x552d12['autoAssociation']===0x0){return db[_0xb8ab('0x28')][_0xb8ab('0x4c')]({'name':_0xc0c0f1[_0xb8ab('0x2a')],'resourceId':_0xc0c0f1['id'],'type':_0x552d12[_0xb8ab('0x2a')],'sectionId':_0x552d12['id']},{})[_0xb8ab('0x24')](function(){return _0x5315e4;});}else{return _0x5315e4;}})[_0xb8ab('0x4b')](function(_0x11bbf2){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x11bbf2);throw _0x11bbf2;});}return _0x5315e4;})['then'](respondWithResult(_0x12b47e,0xc9))[_0xb8ab('0x4b')](handleError(_0x12b47e,null));};exports[_0xb8ab('0x53')]=function(_0x29f046,_0x5f3be9){if(_0x29f046['body']['id']){delete _0x29f046[_0xb8ab('0x4d')]['id'];}return db[_0xb8ab('0x2d')][_0xb8ab('0x51')]({'where':{'id':_0x29f046['params']['id']}})[_0xb8ab('0x24')](handleEntityNotFound(_0x5f3be9,null))['then'](saveUpdates(_0x29f046[_0xb8ab('0x4d')],null))[_0xb8ab('0x24')](respondWithResult(_0x5f3be9,null))[_0xb8ab('0x4b')](handleError(_0x5f3be9,null));};exports[_0xb8ab('0x25')]=function(_0x1e6b06,_0x49e098){return db[_0xb8ab('0x2d')][_0xb8ab('0x51')]({'where':{'id':_0x1e6b06[_0xb8ab('0x49')]['id']}})[_0xb8ab('0x24')](handleEntityNotFound(_0x49e098,null))[_0xb8ab('0x24')](removeEntity(_0x49e098,null))[_0xb8ab('0x4b')](handleError(_0x49e098,null));}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.model.js b/server/api/cmContactHasItem/cmContactHasItem.model.js index 4724447..b387a3d 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 _0xa656=['cm_contact_has_items','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment','./cmContactHasItem.attributes','exports','define','CmContactHasItem'];(function(_0x196267,_0x14865d){var _0x285525=function(_0x21ad44){while(--_0x21ad44){_0x196267['push'](_0x196267['shift']());}};_0x285525(++_0x14865d);}(_0xa656,0x115));var _0x6a65=function(_0x11074a,_0x26ab3e){_0x11074a=_0x11074a-0x0;var _0x5d24f8=_0xa656[_0x11074a];return _0x5d24f8;};'use strict';var _=require(_0x6a65('0x0'));var util=require(_0x6a65('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x6a65('0x2'));var rp=require(_0x6a65('0x3'));var fs=require('fs');var path=require(_0x6a65('0x4'));var rimraf=require(_0x6a65('0x5'));var config=require(_0x6a65('0x6'));var attributes=require(_0x6a65('0x7'));module[_0x6a65('0x8')]=function(_0x4d0a65,_0x42308a){return _0x4d0a65[_0x6a65('0x9')](_0x6a65('0xa'),attributes,{'tableName':_0x6a65('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9c0b=['exports','CmContactHasItem','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./cmContactHasItem.attributes'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0x9c0b,0xb2));var _0xb9c0=function(_0x340907,_0x4a9781){_0x340907=_0x340907-0x0;var _0x1cd555=_0x9c0b[_0x340907];return _0x1cd555;};'use strict';var _=require(_0xb9c0('0x0'));var util=require('util');var logger=require(_0xb9c0('0x1'))(_0xb9c0('0x2'));var moment=require('moment');var BPromise=require(_0xb9c0('0x3'));var rp=require(_0xb9c0('0x4'));var fs=require('fs');var path=require(_0xb9c0('0x5'));var rimraf=require(_0xb9c0('0x6'));var config=require(_0xb9c0('0x7'));var attributes=require(_0xb9c0('0x8'));module[_0xb9c0('0x9')]=function(_0x4601fa,_0x573cf1){return _0x4601fa['define'](_0xb9c0('0xa'),attributes,{'tableName':'cm_contact_has_items','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 34d6d43..9c77d5f 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 _0xc446=['CmContactHasItem,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','ioredis','../../config/utils','../../config/environment','jayson/promise','client','request','then','info','CmContactHasItem,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x26fc3b,_0x2b1be3){var _0x380e31=function(_0x391a02){while(--_0x391a02){_0x26fc3b['push'](_0x26fc3b['shift']());}};_0x380e31(++_0x2b1be3);}(_0xc446,0x157));var _0x6c44=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc446[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x6c44('0x0'));var util=require('util');var moment=require(_0x6c44('0x1'));var BPromise=require(_0x6c44('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6c44('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x6c44('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x6c44('0x5'));var jayson=require(_0x6c44('0x6'));var client=jayson[_0x6c44('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4edaaa,_0x348ae6,_0x5f50e3){return new BPromise(function(_0x3efd59,_0x2164be){return client[_0x6c44('0x8')](_0x4edaaa,_0x5f50e3)[_0x6c44('0x9')](function(_0x196a77){logger[_0x6c44('0xa')](_0x6c44('0xb'),_0x348ae6,_0x6c44('0xc'));logger[_0x6c44('0xd')](_0x6c44('0xe'),_0x348ae6,_0x6c44('0xc'),JSON[_0x6c44('0xf')](_0x196a77));if(_0x196a77['error']){if(_0x196a77[_0x6c44('0x10')][_0x6c44('0x11')]===0x1f4){logger[_0x6c44('0x10')](_0x6c44('0xb'),_0x348ae6,_0x196a77[_0x6c44('0x10')][_0x6c44('0x12')]);return _0x2164be(_0x196a77[_0x6c44('0x10')][_0x6c44('0x12')]);}logger[_0x6c44('0x10')](_0x6c44('0xb'),_0x348ae6,_0x196a77['error'][_0x6c44('0x12')]);return _0x3efd59(_0x196a77[_0x6c44('0x10')][_0x6c44('0x12')]);}else{logger[_0x6c44('0xa')](_0x6c44('0xb'),_0x348ae6,_0x6c44('0xc'));_0x3efd59(_0x196a77[_0x6c44('0x13')]['message']);}})[_0x6c44('0x14')](function(_0x15792b){logger['error']('CmContactHasItem,\x20%s,\x20%s',_0x348ae6,_0x15792b);_0x2164be(_0x15792b);});});} \ No newline at end of file +var _0x0495=['error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','CmContactHasItem,\x20%s,\x20%s','debug','request\x20sent','stringify'];(function(_0x529190,_0x1e19d6){var _0x228147=function(_0x495a11){while(--_0x495a11){_0x529190['push'](_0x529190['shift']());}};_0x228147(++_0x1e19d6);}(_0x0495,0xc1));var _0x5049=function(_0x33b643,_0x29efb1){_0x33b643=_0x33b643-0x0;var _0x5f4ede=_0x0495[_0x33b643];return _0x5f4ede;};'use strict';var _=require(_0x5049('0x0'));var util=require(_0x5049('0x1'));var moment=require(_0x5049('0x2'));var BPromise=require(_0x5049('0x3'));var rs=require(_0x5049('0x4'));var fs=require('fs');var Redis=require(_0x5049('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x5049('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x5049('0x7'));var jayson=require(_0x5049('0x8'));var client=jayson[_0x5049('0x9')][_0x5049('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5a4939,_0x2a8f8e,_0x32301e){return new BPromise(function(_0x247f13,_0x43ed5f){return client[_0x5049('0xb')](_0x5a4939,_0x32301e)['then'](function(_0x24d847){logger[_0x5049('0xc')](_0x5049('0xd'),_0x2a8f8e,'request\x20sent');logger[_0x5049('0xe')]('CmContactHasItem,\x20%s,\x20%s,\x20%s',_0x2a8f8e,_0x5049('0xf'),JSON[_0x5049('0x10')](_0x24d847));if(_0x24d847[_0x5049('0x11')]){if(_0x24d847[_0x5049('0x11')][_0x5049('0x12')]===0x1f4){logger['error'](_0x5049('0xd'),_0x2a8f8e,_0x24d847[_0x5049('0x11')][_0x5049('0x13')]);return _0x43ed5f(_0x24d847['error'][_0x5049('0x13')]);}logger[_0x5049('0x11')](_0x5049('0xd'),_0x2a8f8e,_0x24d847[_0x5049('0x11')][_0x5049('0x13')]);return _0x247f13(_0x24d847[_0x5049('0x11')]['message']);}else{logger[_0x5049('0xc')]('CmContactHasItem,\x20%s,\x20%s',_0x2a8f8e,_0x5049('0xf'));_0x247f13(_0x24d847['result'][_0x5049('0x13')]);}})[_0x5049('0x14')](function(_0x54f448){logger[_0x5049('0x11')]('CmContactHasItem,\x20%s,\x20%s',_0x2a8f8e,_0x54f448);_0x43ed5f(_0x54f448);});});} \ No newline at end of file diff --git a/server/api/cmContactHasItem/index.js b/server/api/cmContactHasItem/index.js index c081fa8..062261a 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 _0xc139=['Router','fs-extra','../../components/auth/service','./cmContactHasItem.controller','index','get','/:id','isAuthenticated','create','update','delete','destroy','exports','path','connect-timeout','express'];(function(_0x4ed520,_0x21be63){var _0x4415a6=function(_0x14b151){while(--_0x14b151){_0x4ed520['push'](_0x4ed520['shift']());}};_0x4415a6(++_0x21be63);}(_0xc139,0x10d));var _0x9c13=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc139[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9c13('0x0'));var timeout=require(_0x9c13('0x1'));var express=require(_0x9c13('0x2'));var router=express[_0x9c13('0x3')]();var fs_extra=require(_0x9c13('0x4'));var auth=require(_0x9c13('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x9c13('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x9c13('0x7')]);router[_0x9c13('0x8')](_0x9c13('0x9'),auth[_0x9c13('0xa')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x9c13('0xb')]);router['put']('/:id',auth[_0x9c13('0xa')](),controller[_0x9c13('0xc')]);router[_0x9c13('0xd')](_0x9c13('0x9'),auth[_0x9c13('0xa')](),controller[_0x9c13('0xe')]);module[_0x9c13('0xf')]=router; \ No newline at end of file +var _0x98f5=['create','put','update','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','get','isAuthenticated','index','/:id','show'];(function(_0x4a248b,_0x29e290){var _0x565f8c=function(_0x3944b1){while(--_0x3944b1){_0x4a248b['push'](_0x4a248b['shift']());}};_0x565f8c(++_0x29e290);}(_0x98f5,0x1ad));var _0x598f=function(_0x1462c2,_0x12a9da){_0x1462c2=_0x1462c2-0x0;var _0x143e0a=_0x98f5[_0x1462c2];return _0x143e0a;};'use strict';var multer=require(_0x598f('0x0'));var util=require(_0x598f('0x1'));var path=require(_0x598f('0x2'));var timeout=require(_0x598f('0x3'));var express=require(_0x598f('0x4'));var router=express[_0x598f('0x5')]();var fs_extra=require(_0x598f('0x6'));var auth=require(_0x598f('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./cmContactHasItem.controller');router[_0x598f('0x8')]('/',auth[_0x598f('0x9')](),controller[_0x598f('0xa')]);router[_0x598f('0x8')](_0x598f('0xb'),auth[_0x598f('0x9')](),controller[_0x598f('0xc')]);router['post']('/',auth[_0x598f('0x9')](),controller[_0x598f('0xd')]);router[_0x598f('0xe')](_0x598f('0xb'),auth[_0x598f('0x9')](),controller[_0x598f('0xf')]);router[_0x598f('0x10')](_0x598f('0xb'),auth[_0x598f('0x9')](),controller['destroy']);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 7206986..cbeb065 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 _0x7900=['VIRTUAL','getDataValue','alias','setDataValue','name','STRING','TEXT','long','type','select','parse','values','isArray','stringify','BOOLEAN','ENUM','sequelize','lodash','exports'];(function(_0x808062,_0x9e69c4){var _0x2163ef=function(_0x2884f8){while(--_0x2884f8){_0x808062['push'](_0x808062['shift']());}};_0x2163ef(++_0x9e69c4);}(_0x7900,0x179));var _0x0790=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7900[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x0790('0x0'));var _=require(_0x0790('0x1'));module[_0x0790('0x2')]={'name':{'type':Sequelize[_0x0790('0x3')],'get':function(_0x12229e){return this[_0x0790('0x4')](_0x0790('0x5'));}},'alias':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x3d4804){this[_0x0790('0x6')](_0x0790('0x5'),_0x3d4804?_0x3d4804:this[_0x0790('0x4')](_0x0790('0x7')));}},'type':{'type':Sequelize[_0x0790('0x8')],'allowNull':![]},'values':{'type':Sequelize[_0x0790('0x9')](_0x0790('0xa')),'get':function(){if(this[_0x0790('0x4')](_0x0790('0xb'))===_0x0790('0xc')){return JSON[_0x0790('0xd')](this['getDataValue'](_0x0790('0xe')));}else{return this[_0x0790('0x4')](_0x0790('0xe'));}},'set':function(_0x1da734){if(Array[_0x0790('0xf')](_0x1da734)){this[_0x0790('0x6')](_0x0790('0xe'),JSON[_0x0790('0x10')](_0x1da734));}else{this[_0x0790('0x6')](_0x0790('0xe'),_0x1da734);}}},'required':{'type':Sequelize[_0x0790('0x11')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x0790('0x11')],'defaultValue':![]},'actionType':{'type':Sequelize[_0x0790('0x12')]('voice')}}; \ No newline at end of file +var _0x10f7=['getDataValue','STRING','setDataValue','alias','name','TEXT','long','type','select','parse','values','isArray','stringify','BOOLEAN','ENUM','sequelize','lodash','exports','VIRTUAL'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x10f7,0x1b1));var _0x710f=function(_0x43d65d,_0x54d57c){_0x43d65d=_0x43d65d-0x0;var _0x2a5f77=_0x10f7[_0x43d65d];return _0x2a5f77;};'use strict';var Sequelize=require(_0x710f('0x0'));var _=require(_0x710f('0x1'));module[_0x710f('0x2')]={'name':{'type':Sequelize[_0x710f('0x3')],'get':function(_0x23615b){return this[_0x710f('0x4')]('alias');}},'alias':{'type':Sequelize[_0x710f('0x5')],'allowNull':![],'set':function(_0x26b5a6){this[_0x710f('0x6')](_0x710f('0x7'),_0x26b5a6?_0x26b5a6:this[_0x710f('0x4')](_0x710f('0x8')));}},'type':{'type':Sequelize[_0x710f('0x5')],'allowNull':![]},'values':{'type':Sequelize[_0x710f('0x9')](_0x710f('0xa')),'get':function(){if(this[_0x710f('0x4')](_0x710f('0xb'))===_0x710f('0xc')){return JSON[_0x710f('0xd')](this[_0x710f('0x4')](_0x710f('0xe')));}else{return this[_0x710f('0x4')]('values');}},'set':function(_0x2e2154){if(Array[_0x710f('0xf')](_0x2e2154)){this[_0x710f('0x6')](_0x710f('0xe'),JSON[_0x710f('0x10')](_0x2e2154));}else{this[_0x710f('0x6')]('values',_0x2e2154);}}},'required':{'type':Sequelize[_0x710f('0x11')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x710f('0x11')],'defaultValue':![]},'actionType':{'type':Sequelize[_0x710f('0x12')]('voice')}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index c9b1dbe..888d8f9 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 _0x5860=['papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','error','name','index','map','CmCustomField','rawAttributes','fieldName','type','key','model','differenceBy','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','findAll','rows','show','params','include','find','catch','body','sequelize','transaction','create','Sequelize','TEXT','text','INTEGER','switch','defaultValue','addColumn','cm_contacts','format','cf_%d','eml-format','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring'];(function(_0x29449d,_0x241933){var _0xe88c81=function(_0x475fa7){while(--_0x475fa7){_0x29449d['push'](_0x29449d['shift']());}};_0xe88c81(++_0x241933);}(_0x5860,0x147));var _0x0586=function(_0x2af29a,_0x4f44bc){_0x2af29a=_0x2af29a-0x0;var _0x5ef02f=_0x5860[_0x2af29a];return _0x5ef02f;};'use strict';var emlformat=require(_0x0586('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0586('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0586('0x2'));var moment=require(_0x0586('0x3'));var BPromise=require(_0x0586('0x4'));var Mustache=require('mustache');var util=require(_0x0586('0x5'));var path=require(_0x0586('0x6'));var sox=require(_0x0586('0x7'));var csv=require(_0x0586('0x8'));var ejs=require(_0x0586('0x9'));var fs=require('fs');var fs_extra=require(_0x0586('0xa'));var _=require(_0x0586('0xb'));var squel=require(_0x0586('0xc'));var crypto=require(_0x0586('0xd'));var jsforce=require(_0x0586('0xe'));var deskjs=require(_0x0586('0xf'));var toCsv=require('to-csv');var querystring=require(_0x0586('0x10'));var Papa=require(_0x0586('0x11'));var Redis=require(_0x0586('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x0586('0x13'));var hardwareService=require(_0x0586('0x14'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x0586('0x15'));var licenseUtil=require(_0x0586('0x16'));var db=require(_0x0586('0x17'))['db'];function respondWithStatusCode(_0x2062e4,_0x580046){_0x580046=_0x580046||0xcc;return function(_0x43af67){if(_0x43af67){return _0x2062e4[_0x0586('0x18')](_0x580046);}return _0x2062e4[_0x0586('0x19')](_0x580046)[_0x0586('0x1a')]();};}function respondWithResult(_0x115743,_0x56581){_0x56581=_0x56581||0xc8;return function(_0x463cc4){if(_0x463cc4){return _0x115743[_0x0586('0x19')](_0x56581)[_0x0586('0x1b')](_0x463cc4);}};}function respondWithFilteredResult(_0x2562ae,_0x5a0488){return function(_0x39df84){if(_0x39df84){var _0x343752=typeof _0x5a0488[_0x0586('0x1c')]===_0x0586('0x1d')&&typeof _0x5a0488[_0x0586('0x1e')]==='undefined';var _0x433ce2=_0x39df84[_0x0586('0x1f')];var _0x6e944a=_0x343752?0x0:_0x5a0488[_0x0586('0x1c')];var _0x799a33=_0x343752?_0x39df84[_0x0586('0x1f')]:_0x5a0488['offset']+_0x5a0488[_0x0586('0x1e')];var _0x18b7b0;if(_0x799a33>=_0x433ce2){_0x799a33=_0x433ce2;_0x18b7b0=0xc8;}else{_0x18b7b0=0xce;}_0x2562ae['status'](_0x18b7b0);return _0x2562ae['set'](_0x0586('0x20'),_0x6e944a+'-'+_0x799a33+'/'+_0x433ce2)[_0x0586('0x1b')](_0x39df84);}return null;};}function patchUpdates(_0x37529b){return function(_0x51e6b5){try{jsonpatch[_0x0586('0x21')](_0x51e6b5,_0x37529b,!![]);}catch(_0x112602){return BPromise[_0x0586('0x22')](_0x112602);}return _0x51e6b5[_0x0586('0x23')]();};}function saveUpdates(_0x265ab7,_0x247021){return function(_0x18c9a4){if(_0x18c9a4){return _0x18c9a4[_0x0586('0x24')](_0x265ab7)[_0x0586('0x25')](function(_0x625716){return _0x625716;});}return null;};}function removeEntity(_0x1522cd,_0x2d9cab){return function(_0x136e1f){if(_0x136e1f){return _0x136e1f['destroy']()['then'](function(){_0x1522cd['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4aa6d0,_0x4c416f){return function(_0x392708){if(!_0x392708){_0x4aa6d0[_0x0586('0x18')](0x194);}return _0x392708;};}function handleError(_0x4ea105,_0x4d7a52){_0x4d7a52=_0x4d7a52||0x1f4;return function(_0x2699d4){logger[_0x0586('0x26')](_0x2699d4['stack']);if(_0x2699d4[_0x0586('0x27')]){delete _0x2699d4['name'];}_0x4ea105[_0x0586('0x19')](_0x4d7a52)['send'](_0x2699d4);};}exports[_0x0586('0x28')]=function(_0x188c43,_0x7157c9){var _0xd77392={},_0x10e10d={},_0x345bf7={'count':0x0,'rows':[]};var _0x313fe4=_[_0x0586('0x29')](db[_0x0586('0x2a')][_0x0586('0x2b')],function(_0xa7bce){return{'name':_0xa7bce[_0x0586('0x2c')],'type':_0xa7bce[_0x0586('0x2d')][_0x0586('0x2e')]};});_0x10e10d[_0x0586('0x2f')]=_[_0x0586('0x30')](_[_0x0586('0x29')](_0x313fe4,_0x0586('0x27')),[_0x0586('0x27')]);_0x10e10d[_0x0586('0x31')]=_[_0x0586('0x32')](_0x188c43[_0x0586('0x31')]);_0x10e10d[_0x0586('0x33')]=_['intersection'](_0x10e10d[_0x0586('0x2f')],_0x10e10d['query']);_0xd77392[_0x0586('0x34')]=_[_0x0586('0x35')](_0x10e10d['model'],qs[_0x0586('0x36')](_0x188c43[_0x0586('0x31')]['fields']));_0xd77392[_0x0586('0x34')]=_0xd77392[_0x0586('0x34')]['length']?_0xd77392[_0x0586('0x34')]:_0x10e10d[_0x0586('0x2f')];if(!_0x188c43[_0x0586('0x31')][_0x0586('0x37')](_0x0586('0x38'))){_0xd77392['limit']=qs[_0x0586('0x1e')](_0x188c43[_0x0586('0x31')]['limit']);_0xd77392[_0x0586('0x1c')]=qs[_0x0586('0x1c')](_0x188c43[_0x0586('0x31')][_0x0586('0x1c')]);}_0xd77392[_0x0586('0x39')]=qs[_0x0586('0x3a')](_0x188c43[_0x0586('0x31')][_0x0586('0x3a')]);_0xd77392[_0x0586('0x3b')]=qs[_0x0586('0x33')](_[_0x0586('0x3c')](_0x188c43['query'],_0x10e10d[_0x0586('0x33')]),_0x313fe4);if(_0x188c43[_0x0586('0x31')][_0x0586('0x3d')]){_0xd77392['where']=_[_0x0586('0x3e')](_0xd77392[_0x0586('0x3b')],{'$or':_[_0x0586('0x29')](_0x313fe4,function(_0x130d96){if(_0x130d96[_0x0586('0x2d')]!=='VIRTUAL'){var _0x127f9b={};_0x127f9b[_0x130d96[_0x0586('0x27')]]={'$like':'%'+_0x188c43[_0x0586('0x31')]['filter']+'%'};return _0x127f9b;}})});}_0xd77392=_['merge']({},_0xd77392,_0x188c43[_0x0586('0x3f')]);var _0xb46915={'where':_0xd77392[_0x0586('0x3b')]};return db['CmCustomField'][_0x0586('0x1f')](_0xb46915)[_0x0586('0x25')](function(_0x3b4bca){_0x345bf7['count']=_0x3b4bca;if(_0x188c43[_0x0586('0x31')][_0x0586('0x40')]){_0xd77392['include']=[{'all':!![]}];}return db['CmCustomField'][_0x0586('0x41')](_0xd77392);})[_0x0586('0x25')](function(_0x1e270b){_0x345bf7[_0x0586('0x42')]=_0x1e270b;return _0x345bf7;})[_0x0586('0x25')](respondWithFilteredResult(_0x7157c9,_0xd77392))['catch'](handleError(_0x7157c9,null));};exports[_0x0586('0x43')]=function(_0x56d7b0,_0x520929){var _0x1c7cdd={'raw':!![],'where':{'id':_0x56d7b0[_0x0586('0x44')]['id']}},_0x36f7c3={};_0x36f7c3[_0x0586('0x2f')]=_[_0x0586('0x32')](db[_0x0586('0x2a')][_0x0586('0x2b')]);_0x36f7c3['query']=_['keys'](_0x56d7b0[_0x0586('0x31')]);_0x36f7c3[_0x0586('0x33')]=_[_0x0586('0x35')](_0x36f7c3[_0x0586('0x2f')],_0x36f7c3['query']);_0x1c7cdd[_0x0586('0x34')]=_['intersection'](_0x36f7c3['model'],qs[_0x0586('0x36')](_0x56d7b0[_0x0586('0x31')][_0x0586('0x36')]));_0x1c7cdd[_0x0586('0x34')]=_0x1c7cdd['attributes']['length']?_0x1c7cdd[_0x0586('0x34')]:_0x36f7c3[_0x0586('0x2f')];if(_0x56d7b0[_0x0586('0x31')][_0x0586('0x40')]){_0x1c7cdd[_0x0586('0x45')]=[{'all':!![]}];}_0x1c7cdd=_[_0x0586('0x3e')]({},_0x1c7cdd,_0x56d7b0['options']);return db[_0x0586('0x2a')][_0x0586('0x46')](_0x1c7cdd)[_0x0586('0x25')](handleEntityNotFound(_0x520929,null))[_0x0586('0x25')](respondWithResult(_0x520929,null))[_0x0586('0x47')](handleError(_0x520929,null));};exports[_0x0586('0x24')]=function(_0x4059e2,_0x47e19a){if(_0x4059e2[_0x0586('0x48')]['id']){delete _0x4059e2[_0x0586('0x48')]['id'];}return db[_0x0586('0x2a')]['find']({'where':{'id':_0x4059e2['params']['id']}})[_0x0586('0x25')](handleEntityNotFound(_0x47e19a,null))['then'](saveUpdates(_0x4059e2[_0x0586('0x48')],null))[_0x0586('0x25')](respondWithResult(_0x47e19a,null))[_0x0586('0x47')](handleError(_0x47e19a,null));};exports['destroy']=function(_0x4980dd,_0xcddb67){return db[_0x0586('0x2a')][_0x0586('0x46')]({'where':{'id':_0x4980dd[_0x0586('0x44')]['id']}})[_0x0586('0x25')](handleEntityNotFound(_0xcddb67,null))['then'](removeEntity(_0xcddb67,null))[_0x0586('0x47')](handleError(_0xcddb67,null));};exports['create']=function(_0x1e2db6,_0x696097){var _0x534555;return db[_0x0586('0x49')][_0x0586('0x4a')](function(_0x466c6a){return db[_0x0586('0x2a')][_0x0586('0x4b')](_0x1e2db6['body'],{'transaction':_0x466c6a})[_0x0586('0x25')](function(_0x2be908){_0x534555=_0x2be908;var _0x23a4d2={'type':db[_0x0586('0x4c')][_0x0586('0x4d')],'transaction':_0x466c6a};switch(_0x1e2db6['body']['type']){case _0x0586('0x4e'):_0x23a4d2[_0x0586('0x2d')]=db[_0x0586('0x4c')][_0x0586('0x4d')];break;case'number':_0x23a4d2[_0x0586('0x2d')]=db[_0x0586('0x4c')][_0x0586('0x4f')];break;case _0x0586('0x50'):_0x23a4d2['type']=db['Sequelize']['BOOLEAN'];_0x23a4d2[_0x0586('0x51')]=![];break;default:}return db[_0x0586('0x49')]['queryInterface'][_0x0586('0x52')](_0x0586('0x53'),util[_0x0586('0x54')](_0x0586('0x55'),_0x534555['id']),_0x23a4d2);})[_0x0586('0x25')](function(){return _0x534555;});})[_0x0586('0x25')](respondWithResult(_0x696097,0xc9))[_0x0586('0x47')](handleError(_0x696097,null));}; \ No newline at end of file +var _0x2217=['name','send','map','CmCustomField','fieldName','key','model','differenceBy','query','keys','filters','attributes','intersection','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','catch','show','rawAttributes','find','update','params','create','transaction','Sequelize','body','type','text','TEXT','INTEGER','switch','BOOLEAN','defaultValue','sequelize','queryInterface','addColumn','format','cf_%d','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','then','error','stack'];(function(_0x3d1a62,_0x140c4b){var _0x5b3e36=function(_0x3a2449){while(--_0x3a2449){_0x3d1a62['push'](_0x3d1a62['shift']());}};_0x5b3e36(++_0x140c4b);}(_0x2217,0x133));var _0x7221=function(_0x2f19ce,_0x57589e){_0x2f19ce=_0x2f19ce-0x0;var _0x585d22=_0x2217[_0x2f19ce];return _0x585d22;};'use strict';var emlformat=require(_0x7221('0x0'));var rimraf=require(_0x7221('0x1'));var zipdir=require(_0x7221('0x2'));var jsonpatch=require(_0x7221('0x3'));var rp=require(_0x7221('0x4'));var moment=require(_0x7221('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x7221('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7221('0x7'));var fs=require('fs');var fs_extra=require(_0x7221('0x8'));var _=require('lodash');var squel=require(_0x7221('0x9'));var crypto=require(_0x7221('0xa'));var jsforce=require(_0x7221('0xb'));var deskjs=require(_0x7221('0xc'));var toCsv=require(_0x7221('0xd'));var querystring=require(_0x7221('0xe'));var Papa=require(_0x7221('0xf'));var Redis=require(_0x7221('0x10'));var authService=require(_0x7221('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7221('0x12'));var logger=require(_0x7221('0x13'))(_0x7221('0x14'));var utils=require(_0x7221('0x15'));var config=require(_0x7221('0x16'));var licenseUtil=require(_0x7221('0x17'));var db=require(_0x7221('0x18'))['db'];function respondWithStatusCode(_0x36bf08,_0x488918){_0x488918=_0x488918||0xcc;return function(_0x37ba29){if(_0x37ba29){return _0x36bf08[_0x7221('0x19')](_0x488918);}return _0x36bf08[_0x7221('0x1a')](_0x488918)[_0x7221('0x1b')]();};}function respondWithResult(_0x16ced1,_0x3eaacb){_0x3eaacb=_0x3eaacb||0xc8;return function(_0x5661da){if(_0x5661da){return _0x16ced1[_0x7221('0x1a')](_0x3eaacb)['json'](_0x5661da);}};}function respondWithFilteredResult(_0x4f7ce5,_0x3296ac){return function(_0x4f7459){if(_0x4f7459){var _0x350dee=typeof _0x3296ac[_0x7221('0x1c')]===_0x7221('0x1d')&&typeof _0x3296ac[_0x7221('0x1e')]===_0x7221('0x1d');var _0x43a063=_0x4f7459[_0x7221('0x1f')];var _0x32ab17=_0x350dee?0x0:_0x3296ac[_0x7221('0x1c')];var _0x1203ea=_0x350dee?_0x4f7459[_0x7221('0x1f')]:_0x3296ac[_0x7221('0x1c')]+_0x3296ac[_0x7221('0x1e')];var _0x4f9eaa;if(_0x1203ea>=_0x43a063){_0x1203ea=_0x43a063;_0x4f9eaa=0xc8;}else{_0x4f9eaa=0xce;}_0x4f7ce5[_0x7221('0x1a')](_0x4f9eaa);return _0x4f7ce5[_0x7221('0x20')](_0x7221('0x21'),_0x32ab17+'-'+_0x1203ea+'/'+_0x43a063)['json'](_0x4f7459);}return null;};}function patchUpdates(_0x2da9d3){return function(_0x4040d1){try{jsonpatch[_0x7221('0x22')](_0x4040d1,_0x2da9d3,!![]);}catch(_0x966652){return BPromise[_0x7221('0x23')](_0x966652);}return _0x4040d1[_0x7221('0x24')]();};}function saveUpdates(_0x1eaa91,_0x223ab8){return function(_0x388ee0){if(_0x388ee0){return _0x388ee0['update'](_0x1eaa91)['then'](function(_0x10c99d){return _0x10c99d;});}return null;};}function removeEntity(_0x1395e9,_0x4d807e){return function(_0xecce39){if(_0xecce39){return _0xecce39[_0x7221('0x25')]()[_0x7221('0x26')](function(){_0x1395e9[_0x7221('0x1a')](0xcc)[_0x7221('0x1b')]();});}};}function handleEntityNotFound(_0x583fb8,_0x16d0c0){return function(_0x1c0469){if(!_0x1c0469){_0x583fb8[_0x7221('0x19')](0x194);}return _0x1c0469;};}function handleError(_0x44ddd4,_0x505174){_0x505174=_0x505174||0x1f4;return function(_0x1b04ba){logger[_0x7221('0x27')](_0x1b04ba[_0x7221('0x28')]);if(_0x1b04ba['name']){delete _0x1b04ba[_0x7221('0x29')];}_0x44ddd4['status'](_0x505174)[_0x7221('0x2a')](_0x1b04ba);};}exports['index']=function(_0x15ac86,_0x487875){var _0xe11584={},_0x10f0c8={},_0x3fd4c7={'count':0x0,'rows':[]};var _0x12827b=_[_0x7221('0x2b')](db[_0x7221('0x2c')]['rawAttributes'],function(_0x482b96){return{'name':_0x482b96[_0x7221('0x2d')],'type':_0x482b96['type'][_0x7221('0x2e')]};});_0x10f0c8[_0x7221('0x2f')]=_[_0x7221('0x30')](_[_0x7221('0x2b')](_0x12827b,_0x7221('0x29')),['name']);_0x10f0c8[_0x7221('0x31')]=_[_0x7221('0x32')](_0x15ac86['query']);_0x10f0c8[_0x7221('0x33')]=_['intersection'](_0x10f0c8[_0x7221('0x2f')],_0x10f0c8[_0x7221('0x31')]);_0xe11584[_0x7221('0x34')]=_[_0x7221('0x35')](_0x10f0c8[_0x7221('0x2f')],qs[_0x7221('0x36')](_0x15ac86[_0x7221('0x31')][_0x7221('0x36')]));_0xe11584['attributes']=_0xe11584['attributes'][_0x7221('0x37')]?_0xe11584['attributes']:_0x10f0c8[_0x7221('0x2f')];if(!_0x15ac86[_0x7221('0x31')]['hasOwnProperty']('nolimit')){_0xe11584['limit']=qs['limit'](_0x15ac86[_0x7221('0x31')][_0x7221('0x1e')]);_0xe11584[_0x7221('0x1c')]=qs[_0x7221('0x1c')](_0x15ac86[_0x7221('0x31')][_0x7221('0x1c')]);}_0xe11584[_0x7221('0x38')]=qs[_0x7221('0x39')](_0x15ac86[_0x7221('0x31')][_0x7221('0x39')]);_0xe11584[_0x7221('0x3a')]=qs[_0x7221('0x33')](_[_0x7221('0x3b')](_0x15ac86['query'],_0x10f0c8[_0x7221('0x33')]),_0x12827b);if(_0x15ac86['query'][_0x7221('0x3c')]){_0xe11584[_0x7221('0x3a')]=_[_0x7221('0x3d')](_0xe11584['where'],{'$or':_[_0x7221('0x2b')](_0x12827b,function(_0xd31635){if(_0xd31635['type']!==_0x7221('0x3e')){var _0x29c31e={};_0x29c31e[_0xd31635['name']]={'$like':'%'+_0x15ac86[_0x7221('0x31')][_0x7221('0x3c')]+'%'};return _0x29c31e;}})});}_0xe11584=_['merge']({},_0xe11584,_0x15ac86['options']);var _0x2a1774={'where':_0xe11584['where']};return db[_0x7221('0x2c')][_0x7221('0x1f')](_0x2a1774)['then'](function(_0x79fa2){_0x3fd4c7[_0x7221('0x1f')]=_0x79fa2;if(_0x15ac86[_0x7221('0x31')][_0x7221('0x3f')]){_0xe11584[_0x7221('0x40')]=[{'all':!![]}];}return db[_0x7221('0x2c')]['findAll'](_0xe11584);})[_0x7221('0x26')](function(_0x11f3c9){_0x3fd4c7['rows']=_0x11f3c9;return _0x3fd4c7;})['then'](respondWithFilteredResult(_0x487875,_0xe11584))[_0x7221('0x41')](handleError(_0x487875,null));};exports[_0x7221('0x42')]=function(_0x25dff3,_0x1f05c8){var _0x2466fe={'raw':!![],'where':{'id':_0x25dff3['params']['id']}},_0x1b09e6={};_0x1b09e6[_0x7221('0x2f')]=_[_0x7221('0x32')](db[_0x7221('0x2c')][_0x7221('0x43')]);_0x1b09e6['query']=_['keys'](_0x25dff3['query']);_0x1b09e6[_0x7221('0x33')]=_['intersection'](_0x1b09e6[_0x7221('0x2f')],_0x1b09e6[_0x7221('0x31')]);_0x2466fe[_0x7221('0x34')]=_['intersection'](_0x1b09e6['model'],qs['fields'](_0x25dff3[_0x7221('0x31')][_0x7221('0x36')]));_0x2466fe[_0x7221('0x34')]=_0x2466fe[_0x7221('0x34')][_0x7221('0x37')]?_0x2466fe[_0x7221('0x34')]:_0x1b09e6['model'];if(_0x25dff3[_0x7221('0x31')]['includeAll']){_0x2466fe[_0x7221('0x40')]=[{'all':!![]}];}_0x2466fe=_[_0x7221('0x3d')]({},_0x2466fe,_0x25dff3['options']);return db[_0x7221('0x2c')][_0x7221('0x44')](_0x2466fe)[_0x7221('0x26')](handleEntityNotFound(_0x1f05c8,null))[_0x7221('0x26')](respondWithResult(_0x1f05c8,null))[_0x7221('0x41')](handleError(_0x1f05c8,null));};exports[_0x7221('0x45')]=function(_0x482449,_0x17ab2b){if(_0x482449['body']['id']){delete _0x482449['body']['id'];}return db[_0x7221('0x2c')][_0x7221('0x44')]({'where':{'id':_0x482449[_0x7221('0x46')]['id']}})['then'](handleEntityNotFound(_0x17ab2b,null))[_0x7221('0x26')](saveUpdates(_0x482449['body'],null))['then'](respondWithResult(_0x17ab2b,null))[_0x7221('0x41')](handleError(_0x17ab2b,null));};exports[_0x7221('0x25')]=function(_0xdc6636,_0x40bb40){return db[_0x7221('0x2c')]['find']({'where':{'id':_0xdc6636[_0x7221('0x46')]['id']}})[_0x7221('0x26')](handleEntityNotFound(_0x40bb40,null))['then'](removeEntity(_0x40bb40,null))[_0x7221('0x41')](handleError(_0x40bb40,null));};exports[_0x7221('0x47')]=function(_0x37306c,_0x1c3435){var _0x4abb7d;return db['sequelize'][_0x7221('0x48')](function(_0x44e32b){return db[_0x7221('0x2c')]['create'](_0x37306c['body'],{'transaction':_0x44e32b})['then'](function(_0x23c823){_0x4abb7d=_0x23c823;var _0x9d6750={'type':db[_0x7221('0x49')]['TEXT'],'transaction':_0x44e32b};switch(_0x37306c[_0x7221('0x4a')][_0x7221('0x4b')]){case _0x7221('0x4c'):_0x9d6750[_0x7221('0x4b')]=db[_0x7221('0x49')][_0x7221('0x4d')];break;case'number':_0x9d6750['type']=db[_0x7221('0x49')][_0x7221('0x4e')];break;case _0x7221('0x4f'):_0x9d6750[_0x7221('0x4b')]=db[_0x7221('0x49')][_0x7221('0x50')];_0x9d6750[_0x7221('0x51')]=![];break;default:}return db[_0x7221('0x52')][_0x7221('0x53')][_0x7221('0x54')]('cm_contacts',util[_0x7221('0x55')](_0x7221('0x56'),_0x4abb7d['id']),_0x9d6750);})[_0x7221('0x26')](function(){return _0x4abb7d;});})[_0x7221('0x26')](respondWithResult(_0x1c3435,0xc9))['catch'](handleError(_0x1c3435,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index fe3693d..07e23f2 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 _0xe31f=['define','CmCustomField','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmCustomField.attributes','exports'];(function(_0x31937f,_0x11e249){var _0x46eaec=function(_0x279aed){while(--_0x279aed){_0x31937f['push'](_0x31937f['shift']());}};_0x46eaec(++_0x11e249);}(_0xe31f,0x15e));var _0xfe31=function(_0xaee2ba,_0x5e1e67){_0xaee2ba=_0xaee2ba-0x0;var _0x16d8c1=_0xe31f[_0xaee2ba];return _0x16d8c1;};'use strict';var _=require(_0xfe31('0x0'));var util=require(_0xfe31('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xfe31('0x2'));var BPromise=require(_0xfe31('0x3'));var rp=require(_0xfe31('0x4'));var fs=require('fs');var path=require(_0xfe31('0x5'));var rimraf=require(_0xfe31('0x6'));var config=require(_0xfe31('0x7'));var attributes=require(_0xfe31('0x8'));module[_0xfe31('0x9')]=function(_0x4c9d98,_0x4d3ac0){return _0x4c9d98[_0xfe31('0xa')](_0xfe31('0xb'),attributes,{'tableName':'cm_custom_fields','paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2864=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmCustomField.attributes','exports','define','CmCustomField','cm_custom_fields','lodash','util','../../config/logger'];(function(_0x5772d4,_0x5dafe2){var _0x29fda7=function(_0x382483){while(--_0x382483){_0x5772d4['push'](_0x5772d4['shift']());}};_0x29fda7(++_0x5dafe2);}(_0x2864,0x13f));var _0x4286=function(_0x3af76b,_0x3ff964){_0x3af76b=_0x3af76b-0x0;var _0x441064=_0x2864[_0x3af76b];return _0x441064;};'use strict';var _=require(_0x4286('0x0'));var util=require(_0x4286('0x1'));var logger=require(_0x4286('0x2'))('api');var moment=require(_0x4286('0x3'));var BPromise=require(_0x4286('0x4'));var rp=require(_0x4286('0x5'));var fs=require('fs');var path=require(_0x4286('0x6'));var rimraf=require(_0x4286('0x7'));var config=require(_0x4286('0x8'));var attributes=require(_0x4286('0x9'));module[_0x4286('0xa')]=function(_0x3247a,_0x2fb71a){return _0x3247a[_0x4286('0xb')](_0x4286('0xc'),attributes,{'tableName':_0x4286('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 268bb61..0ab81d3 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 _0xa1a9=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x3ce00b,_0x3a9c7f){var _0x2cb40e=function(_0x2b3f5f){while(--_0x2b3f5f){_0x3ce00b['push'](_0x3ce00b['shift']());}};_0x2cb40e(++_0x3a9c7f);}(_0xa1a9,0xd4));var _0x9a1a=function(_0x1a334f,_0x177b97){_0x1a334f=_0x1a334f-0x0;var _0x2f9710=_0xa1a9[_0x1a334f];return _0x2f9710;};'use strict';var _=require(_0x9a1a('0x0'));var util=require('util');var moment=require(_0x9a1a('0x1'));var BPromise=require(_0x9a1a('0x2'));var rs=require(_0x9a1a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9a1a('0x4'))['db'];var utils=require(_0x9a1a('0x5'));var logger=require(_0x9a1a('0x6'))(_0x9a1a('0x7'));var config=require('../../config/environment');var jayson=require(_0x9a1a('0x8'));var client=jayson[_0x9a1a('0x9')][_0x9a1a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x25b8c6,_0x2ba4ab,_0x4336a5){return new BPromise(function(_0x1deb18,_0x2dfea0){return client[_0x9a1a('0xb')](_0x25b8c6,_0x4336a5)[_0x9a1a('0xc')](function(_0x592edd){logger[_0x9a1a('0xd')](_0x9a1a('0xe'),_0x2ba4ab,_0x9a1a('0xf'));logger[_0x9a1a('0x10')](_0x9a1a('0x11'),_0x2ba4ab,_0x9a1a('0xf'),JSON[_0x9a1a('0x12')](_0x592edd));if(_0x592edd[_0x9a1a('0x13')]){if(_0x592edd['error'][_0x9a1a('0x14')]===0x1f4){logger[_0x9a1a('0x13')]('CmCustomField,\x20%s,\x20%s',_0x2ba4ab,_0x592edd['error'][_0x9a1a('0x15')]);return _0x2dfea0(_0x592edd[_0x9a1a('0x13')][_0x9a1a('0x15')]);}logger[_0x9a1a('0x13')](_0x9a1a('0xe'),_0x2ba4ab,_0x592edd[_0x9a1a('0x13')][_0x9a1a('0x15')]);return _0x1deb18(_0x592edd['error'][_0x9a1a('0x15')]);}else{logger[_0x9a1a('0xd')](_0x9a1a('0xe'),_0x2ba4ab,_0x9a1a('0xf'));_0x1deb18(_0x592edd[_0x9a1a('0x16')][_0x9a1a('0x15')]);}})[_0x9a1a('0x17')](function(_0x23da7c){logger[_0x9a1a('0x13')](_0x9a1a('0xe'),_0x2ba4ab,_0x23da7c);_0x2dfea0(_0x23da7c);});});} \ No newline at end of file +var _0x6816=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code','CmCustomField,\x20%s,\x20%s','message','result','catch','lodash'];(function(_0x5515a7,_0x2c4af1){var _0x43f4bf=function(_0x3d519d){while(--_0x3d519d){_0x5515a7['push'](_0x5515a7['shift']());}};_0x43f4bf(++_0x2c4af1);}(_0x6816,0x1cb));var _0x6681=function(_0x1d6ada,_0x38b03b){_0x1d6ada=_0x1d6ada-0x0;var _0x311337=_0x6816[_0x1d6ada];return _0x311337;};'use strict';var _=require(_0x6681('0x0'));var util=require('util');var moment=require(_0x6681('0x1'));var BPromise=require('bluebird');var rs=require(_0x6681('0x2'));var fs=require('fs');var Redis=require(_0x6681('0x3'));var db=require(_0x6681('0x4'))['db'];var utils=require(_0x6681('0x5'));var logger=require('../../config/logger')(_0x6681('0x6'));var config=require(_0x6681('0x7'));var jayson=require(_0x6681('0x8'));var client=jayson['client'][_0x6681('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x113488,_0x15e7c9,_0x2950ca){return new BPromise(function(_0x9d3a03,_0x192d6f){return client[_0x6681('0xa')](_0x113488,_0x2950ca)[_0x6681('0xb')](function(_0xec358f){logger[_0x6681('0xc')]('CmCustomField,\x20%s,\x20%s',_0x15e7c9,_0x6681('0xd'));logger[_0x6681('0xe')](_0x6681('0xf'),_0x15e7c9,_0x6681('0xd'),JSON[_0x6681('0x10')](_0xec358f));if(_0xec358f['error']){if(_0xec358f[_0x6681('0x11')][_0x6681('0x12')]===0x1f4){logger['error'](_0x6681('0x13'),_0x15e7c9,_0xec358f[_0x6681('0x11')][_0x6681('0x14')]);return _0x192d6f(_0xec358f[_0x6681('0x11')][_0x6681('0x14')]);}logger[_0x6681('0x11')](_0x6681('0x13'),_0x15e7c9,_0xec358f['error'][_0x6681('0x14')]);return _0x9d3a03(_0xec358f['error'][_0x6681('0x14')]);}else{logger[_0x6681('0xc')](_0x6681('0x13'),_0x15e7c9,_0x6681('0xd'));_0x9d3a03(_0xec358f[_0x6681('0x15')]['message']);}})[_0x6681('0x16')](function(_0x5b240d){logger['error'](_0x6681('0x13'),_0x15e7c9,_0x5b240d);_0x192d6f(_0x5b240d);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index 3cf90ef..72c8474 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 _0xecb2=['show','post','put','delete','destroy','exports','multer','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCustomField.controller','get','/:id','isAuthenticated'];(function(_0x48d737,_0x338ed9){var _0x12e5c8=function(_0x3fed01){while(--_0x3fed01){_0x48d737['push'](_0x48d737['shift']());}};_0x12e5c8(++_0x338ed9);}(_0xecb2,0xf6));var _0x2ecb=function(_0x5a46e7,_0x3be817){_0x5a46e7=_0x5a46e7-0x0;var _0x373f31=_0xecb2[_0x5a46e7];return _0x373f31;};'use strict';var multer=require(_0x2ecb('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x2ecb('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x2ecb('0x2'));var auth=require(_0x2ecb('0x3'));var interaction=require(_0x2ecb('0x4'));var config=require(_0x2ecb('0x5'));var controller=require(_0x2ecb('0x6'));router[_0x2ecb('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x2ecb('0x8'),auth[_0x2ecb('0x9')](),controller[_0x2ecb('0xa')]);router[_0x2ecb('0xb')]('/',auth[_0x2ecb('0x9')](),controller['create']);router[_0x2ecb('0xc')](_0x2ecb('0x8'),auth[_0x2ecb('0x9')](),controller['update']);router[_0x2ecb('0xd')](_0x2ecb('0x8'),auth[_0x2ecb('0x9')](),controller[_0x2ecb('0xe')]);module[_0x2ecb('0xf')]=router; \ No newline at end of file +var _0xa9b1=['index','/:id','show','post','create','put','delete','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','get','isAuthenticated'];(function(_0x4efe66,_0x4f2b98){var _0x4d5b98=function(_0x1ca83c){while(--_0x1ca83c){_0x4efe66['push'](_0x4efe66['shift']());}};_0x4d5b98(++_0x4f2b98);}(_0xa9b1,0x133));var _0x1a9b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa9b1[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1a9b('0x0'));var timeout=require(_0x1a9b('0x1'));var express=require(_0x1a9b('0x2'));var router=express[_0x1a9b('0x3')]();var fs_extra=require(_0x1a9b('0x4'));var auth=require(_0x1a9b('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./cmCustomField.controller');router[_0x1a9b('0x6')]('/',auth[_0x1a9b('0x7')](),controller[_0x1a9b('0x8')]);router[_0x1a9b('0x6')](_0x1a9b('0x9'),auth[_0x1a9b('0x7')](),controller[_0x1a9b('0xa')]);router[_0x1a9b('0xb')]('/',auth[_0x1a9b('0x7')](),controller[_0x1a9b('0xc')]);router[_0x1a9b('0xd')](_0x1a9b('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x1a9b('0xe')](_0x1a9b('0x9'),auth[_0x1a9b('0x7')](),controller['destroy']);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 11a7bec..78acd6d 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 _0x8c54=['format','INTEGER','DATE','contactListQueue','sequelize','STRING','BOOLEAN'];(function(_0x4ae89d,_0x5af74b){var _0x411fd7=function(_0x14079d){while(--_0x14079d){_0x4ae89d['push'](_0x4ae89d['shift']());}};_0x411fd7(++_0x5af74b);}(_0x8c54,0x1ee));var _0x48c5=function(_0x2f419b,_0x3e2405){_0x2f419b=_0x2f419b-0x0;var _0x32ef8f=_0x8c54[_0x2f419b];return _0x32ef8f;};'use strict';var moment=require('moment');var Sequelize=require(_0x48c5('0x0'));module['exports']={'phone':{'type':Sequelize[_0x48c5('0x1')],'allowNull':![]},'active':{'type':Sequelize[_0x48c5('0x2')],'defaultValue':![]},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0x48c5('0x3')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0x48c5('0x4')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x48c5('0x4')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x48c5('0x2')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x48c5('0x1')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x48c5('0x5')]},'priority':{'type':Sequelize[_0x48c5('0x4')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0x48c5('0x4')],'unique':_0x48c5('0x6')},'UserId':{'type':Sequelize[_0x48c5('0x4')]},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'CampaignId':{'type':Sequelize[_0x48c5('0x4')]},'countnosuchnumberretry':{'type':Sequelize[_0x48c5('0x4')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x48c5('0x4')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x48c5('0x4')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0x48c5('0x4')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x48c5('0x1')]},'recallmeNotifiedDate':{'type':Sequelize['DATE'],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file +var _0xb004=['contactListQueue','moment','sequelize','exports','STRING','BOOLEAN','DATE','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','UNSIGNED'];(function(_0x3cef2a,_0x48bc9d){var _0x4a303b=function(_0x4a270e){while(--_0x4a270e){_0x3cef2a['push'](_0x3cef2a['shift']());}};_0x4a303b(++_0x48bc9d);}(_0xb004,0x18d));var _0x4b00=function(_0x32b20b,_0xcdf322){_0x32b20b=_0x32b20b-0x0;var _0x3dd4bd=_0xb004[_0x32b20b];return _0x3dd4bd;};'use strict';var moment=require(_0x4b00('0x0'));var Sequelize=require(_0x4b00('0x1'));module[_0x4b00('0x2')]={'phone':{'type':Sequelize[_0x4b00('0x3')],'allowNull':![]},'active':{'type':Sequelize[_0x4b00('0x4')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x4b00('0x5')],'defaultValue':moment()[_0x4b00('0x6')](_0x4b00('0x7'))},'countbusyretry':{'type':Sequelize[_0x4b00('0x8')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x4b00('0x8')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x4b00('0x8')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x4b00('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x4b00('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x4b00('0x5')]},'priority':{'type':Sequelize[_0x4b00('0x8')](0x2)[_0x4b00('0x9')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x4b00('0x4')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x4b00('0x8')],'unique':_0x4b00('0xa')},'ListId':{'type':Sequelize[_0x4b00('0x8')],'unique':'contactListQueue'},'UserId':{'type':Sequelize[_0x4b00('0x8')]},'VoiceQueueId':{'type':Sequelize[_0x4b00('0x8')],'unique':_0x4b00('0xa')},'CampaignId':{'type':Sequelize[_0x4b00('0x8')]},'countnosuchnumberretry':{'type':Sequelize[_0x4b00('0x8')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x4b00('0x8')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x4b00('0x8')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x4b00('0x8')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x4b00('0x8')],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0x4b00('0x8')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x4b00('0x3')]},'recallmeNotifiedDate':{'type':Sequelize['DATE'],'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 e4d9942..d33d7d7 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 _0x723e=['concat','$and','$or','$gt','$lt','$ne','$eq','$not','$between','$notBetween','$notIn','$iLike','$like','$overlap','$contains','$any','attributes','fields','length','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','CmHopper','then','includeAll','include','rows','rawAttributes','find','catch','create','body','params','describe','destroy','CampaignId','VoiceQueueId','Campaign','omit','createdAt','updatedAt','state','statedesc','deleted','campaign','membername','user','deletedat','format','calleridnum','phone','queue','ivr','CmContact','ContactId','lastName','isNil','firstName','calleridname','finally','CmHopperFinal','CmHopperAdditionalPhone','end','outbound','preview','dialPreviewAutoRecallMe','transaction','value','direction','prev','isEmpty','hopperIds','priority','dialOrderByScheduledAt','ASC','DESC','literal','scheduledAt','findOne','scheduledat','recallme','LOCK','CmCompany','Company','CmList','List','VoiceQueue','Queue','dialActive','update','getPreviewRecall','sequelize','Contact','getOpenContacts','getVoiceQueues','entity\x20not\x20found','getTimezones','timezones','push','utcOffset','lodash','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','status','offset','undefined','limit','count','set','Content-Range','json','sendStatus','error','stack','name','send','index','map','fieldName','key','model','keys','query','filters','intersection'];(function(_0x446ac5,_0x20191b){var _0x4b3bb1=function(_0x27df21){while(--_0x27df21){_0x446ac5['push'](_0x446ac5['shift']());}};_0x4b3bb1(++_0x20191b);}(_0x723e,0x179));var _0xe723=function(_0x7ad123,_0xeeeef3){_0x7ad123=_0x7ad123-0x0;var _0x37d073=_0x723e[_0x7ad123];return _0x37d073;};'use strict';var moment=require('moment');var _=require(_0xe723('0x0'));var qs=require(_0xe723('0x1'));var logger=require(_0xe723('0x2'))(_0xe723('0x3'));var shared=require(_0xe723('0x4'));var db=require(_0xe723('0x5'))['db'];function respondWithResult(_0x39e35c,_0x1da20f){_0x1da20f=_0x1da20f||0xc8;return function(_0x8f78b2){if(_0x8f78b2){return _0x39e35c[_0xe723('0x6')](_0x1da20f)['json'](_0x8f78b2);}};}function respondWithFilteredResult(_0x32d689,_0x20c13b){return function(_0x1335cd){if(_0x1335cd){var _0x3bf082=typeof _0x20c13b[_0xe723('0x7')]===_0xe723('0x8')&&typeof _0x20c13b[_0xe723('0x9')]===_0xe723('0x8');var _0x4a6983=_0x1335cd[_0xe723('0xa')];var _0x270346=_0x3bf082?0x0:_0x20c13b[_0xe723('0x7')];var _0x5a43fb=_0x3bf082?_0x1335cd[_0xe723('0xa')]:_0x20c13b[_0xe723('0x7')]+_0x20c13b[_0xe723('0x9')];var _0x583291;if(_0x5a43fb>=_0x4a6983){_0x5a43fb=_0x4a6983;_0x583291=0xc8;}else{_0x583291=0xce;}_0x32d689[_0xe723('0x6')](_0x583291);return _0x32d689[_0xe723('0xb')](_0xe723('0xc'),_0x270346+'-'+_0x5a43fb+'/'+_0x4a6983)[_0xe723('0xd')](_0x1335cd);}return null;};}function saveUpdates(_0x236b69,_0x5c066c){return function(_0x29a1e){if(_0x29a1e){return _0x29a1e['update'](_0x236b69)['then'](function(_0x5201f2){return _0x5201f2;});}return null;};}function handleEntityNotFound(_0x57bc0e,_0x75c12c){return function(_0x30b2ba){if(!_0x30b2ba){_0x57bc0e[_0xe723('0xe')](0x194);}return _0x30b2ba;};}function handleError(_0x2b010b,_0xf29a39){_0xf29a39=_0xf29a39||0x1f4;return function(_0x5aec97){logger[_0xe723('0xf')](_0x5aec97[_0xe723('0x10')]);if(_0x5aec97[_0xe723('0x11')]){delete _0x5aec97[_0xe723('0x11')];}_0x2b010b[_0xe723('0x6')](_0xf29a39)[_0xe723('0x12')](_0x5aec97);};}exports[_0xe723('0x13')]=function(_0x4a6f95,_0x17e2c1){var _0x3906ea={},_0x2057d7={},_0x3012cf={'count':0x0,'rows':[]};var _0x262a8d=_[_0xe723('0x14')](db['CmHopper']['rawAttributes'],function(_0x31c839){return{'name':_0x31c839[_0xe723('0x15')],'type':_0x31c839['type'][_0xe723('0x16')]};});_0x2057d7[_0xe723('0x17')]=_['map'](_0x262a8d,_0xe723('0x11'));_0x2057d7['query']=_[_0xe723('0x18')](_0x4a6f95[_0xe723('0x19')]);_0x2057d7[_0xe723('0x1a')]=_[_0xe723('0x1b')](_0x2057d7[_0xe723('0x17')],_0x2057d7[_0xe723('0x19')]);_0x2057d7[_0xe723('0x1a')]=_[_0xe723('0x1c')](_0x2057d7[_0xe723('0x1a')],[_0xe723('0x1d'),_0xe723('0x1e'),_0xe723('0x1f'),'$gte',_0xe723('0x20'),'$lte',_0xe723('0x21'),_0xe723('0x22'),_0xe723('0x23'),_0xe723('0x24'),_0xe723('0x25'),'$in',_0xe723('0x26'),'$like','$notLike',_0xe723('0x27'),'$notILike',_0xe723('0x28'),_0xe723('0x29'),_0xe723('0x2a'),'$contained',_0xe723('0x2b')]);_0x3906ea[_0xe723('0x2c')]=_['intersection'](_0x2057d7[_0xe723('0x17')],qs['fields'](_0x4a6f95['query'][_0xe723('0x2d')]));_0x3906ea[_0xe723('0x2c')]=_0x3906ea[_0xe723('0x2c')][_0xe723('0x2e')]?_0x3906ea['attributes']:_0x2057d7['model'];if(!_0x4a6f95[_0xe723('0x19')]['hasOwnProperty'](_0xe723('0x2f'))){_0x3906ea[_0xe723('0x9')]=qs[_0xe723('0x9')](_0x4a6f95[_0xe723('0x19')][_0xe723('0x9')]);_0x3906ea[_0xe723('0x7')]=qs[_0xe723('0x7')](_0x4a6f95[_0xe723('0x19')][_0xe723('0x7')]);}_0x3906ea[_0xe723('0x30')]=qs[_0xe723('0x31')](_0x4a6f95[_0xe723('0x19')][_0xe723('0x31')]);_0x3906ea[_0xe723('0x32')]=qs['filters'](_[_0xe723('0x33')](_0x4a6f95['query'],_0x2057d7[_0xe723('0x1a')]),_0x262a8d);if(_0x4a6f95[_0xe723('0x19')]['filter']){_0x3906ea['where']=_[_0xe723('0x34')](_0x3906ea[_0xe723('0x32')],{'$or':_[_0xe723('0x14')](_0x262a8d,function(_0x2ef00d){if(_0x2ef00d[_0xe723('0x35')]!==_0xe723('0x36')){var _0x5122da={};_0x5122da[_0x2ef00d[_0xe723('0x11')]]={'$like':'%'+_0x4a6f95[_0xe723('0x19')][_0xe723('0x37')]+'%'};return _0x5122da;}})});}_0x3906ea=_[_0xe723('0x34')]({},_0x3906ea,_0x4a6f95[_0xe723('0x38')]);var _0x37bb5d={'where':_0x3906ea[_0xe723('0x32')]};return db[_0xe723('0x39')][_0xe723('0xa')](_0x37bb5d)[_0xe723('0x3a')](function(_0x9918d9){_0x3012cf[_0xe723('0xa')]=_0x9918d9;if(_0x4a6f95[_0xe723('0x19')][_0xe723('0x3b')]){_0x3906ea[_0xe723('0x3c')]=[{'all':!![]}];}return db[_0xe723('0x39')]['findAll'](_0x3906ea);})[_0xe723('0x3a')](function(_0x29c148){_0x3012cf[_0xe723('0x3d')]=_0x29c148;return _0x3012cf;})[_0xe723('0x3a')](respondWithFilteredResult(_0x17e2c1,_0x3906ea))['catch'](handleError(_0x17e2c1,null));};exports['show']=function(_0x105233,_0x3ba6ef){var _0xc0c2c7={'raw':!![],'where':{'id':_0x105233['params']['id']}},_0xfafc1d={};_0xfafc1d['model']=_[_0xe723('0x18')](db[_0xe723('0x39')][_0xe723('0x3e')]);_0xfafc1d[_0xe723('0x19')]=_[_0xe723('0x18')](_0x105233[_0xe723('0x19')]);_0xfafc1d[_0xe723('0x1a')]=_[_0xe723('0x1b')](_0xfafc1d[_0xe723('0x17')],_0xfafc1d['query']);_0xc0c2c7['attributes']=_[_0xe723('0x1b')](_0xfafc1d['model'],qs['fields'](_0x105233[_0xe723('0x19')]['fields']));_0xc0c2c7[_0xe723('0x2c')]=_0xc0c2c7[_0xe723('0x2c')][_0xe723('0x2e')]?_0xc0c2c7[_0xe723('0x2c')]:_0xfafc1d[_0xe723('0x17')];if(_0x105233[_0xe723('0x19')][_0xe723('0x3b')]){_0xc0c2c7['include']=[{'all':!![]}];}_0xc0c2c7=_['merge']({},_0xc0c2c7,_0x105233[_0xe723('0x38')]);return db['CmHopper'][_0xe723('0x3f')](_0xc0c2c7)['then'](handleEntityNotFound(_0x3ba6ef,null))[_0xe723('0x3a')](respondWithResult(_0x3ba6ef,null))[_0xe723('0x40')](handleError(_0x3ba6ef,null));};exports[_0xe723('0x41')]=function(_0x2c22c4,_0x119550){return db[_0xe723('0x39')][_0xe723('0x41')](_0x2c22c4[_0xe723('0x42')],{})[_0xe723('0x3a')](respondWithResult(_0x119550,0xc9))['catch'](handleError(_0x119550,null));};exports['update']=function(_0x1824b6,_0x23425b){if(_0x1824b6[_0xe723('0x42')]['id']){delete _0x1824b6['body']['id'];}return db['CmHopper']['find']({'where':{'id':_0x1824b6[_0xe723('0x43')]['id']}})[_0xe723('0x3a')](handleEntityNotFound(_0x23425b,null))[_0xe723('0x3a')](saveUpdates(_0x1824b6['body'],null))[_0xe723('0x3a')](respondWithResult(_0x23425b,null))[_0xe723('0x40')](handleError(_0x23425b,null));};exports[_0xe723('0x44')]=function(_0x38bd1a,_0x15bfd0){return db['CmHopper'][_0xe723('0x44')]()['then'](respondWithResult(_0x15bfd0,null))[_0xe723('0x40')](handleError(_0x15bfd0,null));};exports['destroy']=function(_0x52f42e,_0x1590fe){var _0x42a302;var _0x22a1d3=_0x52f42e['params']['id'];return db[_0xe723('0x39')]['find']({'where':{'id':_0x52f42e[_0xe723('0x43')]['id']}})[_0xe723('0x3a')](handleEntityNotFound(_0x1590fe,null))[_0xe723('0x3a')](function(_0x37329e){if(_0x37329e){return _0x37329e[_0xe723('0x45')]()[_0xe723('0x3a')](function(_0x41e1c4){return _0x41e1c4;});}})[_0xe723('0x3a')](function(_0x1bf58b){_0x42a302=_0x1bf58b;if(_0x1bf58b){if(_0x1bf58b['VoiceQueueId']||_0x1bf58b[_0xe723('0x46')]){return db[_0x1bf58b[_0xe723('0x47')]?'VoiceQueue':_0xe723('0x48')][_0xe723('0x3f')]({'where':{'id':_0x1bf58b['VoiceQueueId']?_0x1bf58b[_0xe723('0x47')]:_0x1bf58b['CampaignId']},'attributes':['id','name'],'raw':!![]});}}})[_0xe723('0x3a')](function(_0x1825fa){var _0x21d3ef={};if(_0x1825fa){_[_0xe723('0x34')](_0x21d3ef,_[_0xe723('0x49')](_0x42a302['dataValues'],[_0xe723('0x4a'),_0xe723('0x4b'),'id']));_0x21d3ef[_0xe723('0x4c')]=0x15;_0x21d3ef[_0xe723('0x4d')]=_0xe723('0x4e');_0x21d3ef[_0xe723('0x4f')]=_0x1825fa[_0xe723('0x11')];_0x21d3ef[_0xe723('0x50')]=_0x52f42e[_0xe723('0x51')][_0xe723('0x11')];_0x21d3ef['UserId']=_0x52f42e[_0xe723('0x51')]['id'];_0x21d3ef[_0xe723('0x4e')]=!![];_0x21d3ef[_0xe723('0x52')]=moment()[_0xe723('0x53')]('YYYY-MM-DD\x20HH:mm:ss');_0x21d3ef[_0xe723('0x54')]=_0x42a302[_0xe723('0x55')];_0x21d3ef['campaigntype']=_0x42a302[_0xe723('0x47')]?_0xe723('0x56'):_0xe723('0x57');return db[_0xe723('0x58')][_0xe723('0x3f')]({'where':{'id':_0x21d3ef[_0xe723('0x59')]},'attributes':['firstName',_0xe723('0x5a')]})['then'](function(_0x58a39f){if(!_[_0xe723('0x5b')](_0x1590fe)&&!_['isNil'](_0x58a39f[_0xe723('0x5c')])){_0x21d3ef[_0xe723('0x5d')]=_0x58a39f[_0xe723('0x5c')];if(!_[_0xe723('0x5b')](_0x58a39f[_0xe723('0x5a')])){_0x21d3ef['calleridname']+='\x20'+_0x58a39f[_0xe723('0x5a')];}}})[_0xe723('0x5e')](function(){return db[_0xe723('0x5f')]['create'](_0x21d3ef);});}})['then'](function(_0x4022a7){return db[_0xe723('0x60')][_0xe723('0x45')]({'where':{'CmHopperId':_0x22a1d3}});})['then'](function(){return _0x1590fe[_0xe723('0x6')](0xcc)[_0xe723('0x61')]();})['catch'](handleError(_0x1590fe,null));};exports['getPreview']=function(_0x2556bf,_0x7b0dd9){var _0x113860=[];return db[_0xe723('0x58')][_0xe723('0x44')]()[_0xe723('0x3a')](function(_0x6fbf5e){_0x113860=_['keys'](_0x6fbf5e);return _0x2556bf['user']['getVoiceQueues']({'where':{'type':_0xe723('0x62'),'dialActive':!![],'dialMethod':_0xe723('0x63')},'attributes':['id','dialOrderByScheduledAt',_0xe723('0x64')],'raw':!![]});})[_0xe723('0x3a')](function(_0x189b5c){if(_0x189b5c&&_0x189b5c['length']){return db['sequelize'][_0xe723('0x65')](function(_0x3868a9){var _0x2463c3={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0xe723('0x14')](_0x189b5c,'id')},'$or':[{'UserId':null},{'UserId':_0x2556bf['user']['id']}]};var _0x876a6d={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x189b5c)[_0xe723('0x37')]([_0xe723('0x64'),0x0])[_0xe723('0x14')]('id')[_0xe723('0x66')]()},'$or':[{'UserId':null},{'UserId':_0x2556bf[_0xe723('0x51')]['id']}]};var _0x1b0cd6={'$or':[_0x2463c3,_0x876a6d]};var _0x421520=[];if(_0x2556bf[_0xe723('0x42')]['direction']&&_0x2556bf[_0xe723('0x42')][_0xe723('0x67')]===_0xe723('0x68')){if(!_[_0xe723('0x69')](_0x2556bf[_0xe723('0x42')][_0xe723('0x6a')])){_0x1b0cd6['id']={'$in':_0x2556bf['body'][_0xe723('0x6a')]};}_0x421520=[[_0xe723('0x6b'),'ASC'],['scheduledAt',_0x189b5c[0x0][_0xe723('0x6c')]===_0xe723('0x6d')?_0xe723('0x6e'):'ASC'],db['sequelize'][_0xe723('0x6f')]('COALESCE(CmHopper.UserId,\x200)\x20ASC'),['id',_0xe723('0x6e')]];}else{if(!_[_0xe723('0x69')](_0x2556bf[_0xe723('0x42')][_0xe723('0x6a')])){_0x1b0cd6['id']={'$notIn':_0x2556bf[_0xe723('0x42')]['hopperIds']};}_0x421520=[['priority',_0xe723('0x6e')],[_0xe723('0x70'),_0x189b5c[0x0][_0xe723('0x6c')]],db['sequelize'][_0xe723('0x6f')]('COALESCE(CmHopper.UserId,\x200)\x20DESC'),['id','ASC']];}return db[_0xe723('0x39')][_0xe723('0x71')]({'attributes':['id',_0xe723('0x72'),_0xe723('0x55'),_0xe723('0x73')],'where':_0x1b0cd6,'order':_0x421520,'transaction':_0x3868a9,'lock':_0x3868a9[_0xe723('0x74')]['UPDATE'],'include':[{'model':db[_0xe723('0x58')],'as':'Contact','attributes':_0x113860,'include':[{'model':db[_0xe723('0x75')],'as':_0xe723('0x76'),'attributes':['id','name']}]},{'model':db[_0xe723('0x77')],'as':_0xe723('0x78'),'attributes':['id',_0xe723('0x11')]},{'model':db[_0xe723('0x79')],'as':_0xe723('0x7a'),'attributes':['id',_0xe723('0x11'),_0xe723('0x7b')]}]})[_0xe723('0x3a')](function(_0x33685e){if(_0x33685e){return _0x33685e[_0xe723('0x7c')]({'UserId':_0x2556bf[_0xe723('0x51')]['id']},{'transaction':_0x3868a9});}});});}})[_0xe723('0x3a')](handleEntityNotFound(_0x7b0dd9,null))[_0xe723('0x3a')](respondWithResult(_0x7b0dd9,null))[_0xe723('0x40')](handleError(_0x7b0dd9,null));};exports[_0xe723('0x7d')]=function(_0x4d5685,_0x3e8bd4,_0x44468e){var _0x1d4fe0=[];var _0x507267=_0x4d5685[_0xe723('0x43')]['id'];var _0x7af941=_0x4d5685[_0xe723('0x51')]['id'];return db[_0xe723('0x58')][_0xe723('0x44')]()[_0xe723('0x3a')](function(_0x1e2cb0){_0x1d4fe0=_[_0xe723('0x18')](_0x1e2cb0);return db[_0xe723('0x7e')][_0xe723('0x65')](function(_0x5dc44a){const _0x14cd1d={'id':_0x507267};return db[_0xe723('0x39')][_0xe723('0x71')]({'attributes':['id',_0xe723('0x72'),_0xe723('0x73')],'where':_0x14cd1d,'transaction':_0x5dc44a,'lock':_0x5dc44a[_0xe723('0x74')]['UPDATE'],'include':[{'model':db[_0xe723('0x58')],'as':_0xe723('0x7f'),'attributes':_0x1d4fe0,'include':[{'model':db['CmCompany'],'as':'Company','attributes':['id',_0xe723('0x11')]}]},{'model':db[_0xe723('0x77')],'as':'List','attributes':['id',_0xe723('0x11')]},{'model':db[_0xe723('0x79')],'as':'Queue','attributes':['id','name','dialActive']}]})[_0xe723('0x3a')](function(_0x48b73c){if(_0x48b73c){return _0x48b73c['update']({'UserId':_0x7af941},{'transaction':_0x5dc44a});}});});})['then'](handleEntityNotFound(_0x3e8bd4,null))[_0xe723('0x3a')](respondWithResult(_0x3e8bd4,null))[_0xe723('0x40')](handleError(_0x3e8bd4,null));};exports[_0xe723('0x80')]=function(_0x296bf1,_0x31ccef){return _0x296bf1[_0xe723('0x51')][_0xe723('0x81')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0xe723('0x63')},'attributes':['id'],'raw':!![]})[_0xe723('0x3a')](function(_0x36d962){if(_0x36d962&&_0x36d962[_0xe723('0x2e')]){return db[_0xe723('0x39')][_0xe723('0xa')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0xe723('0x14')](_0x36d962,'id')},'$or':[{'UserId':null},{'UserId':_0x296bf1['user']['id']}]}});}return 0x0;})['then'](function(_0x345278){if(!_[_0xe723('0x5b')](_0x345278)&&_['isNumber'](_0x345278)){return _0x31ccef[_0xe723('0x6')](0xc8)[_0xe723('0xd')]({'contacts':_0x345278});}else{logger[_0xe723('0xf')]('CmHopper,\x20%s,\x20%s,\x20%s','getOpenContacts',0x194,_0xe723('0x82'));_0x31ccef[_0xe723('0xe')](0x194);}})[_0xe723('0x40')](handleError(_0x31ccef,null));};exports[_0xe723('0x83')]=function(_0x155e7c,_0x34e46f){var _0x2674dd=shared[_0xe723('0x84')];var _0x5a8810=[];_['map'](_0x2674dd,function(_0x4b359f){_0x5a8810[_0xe723('0x85')]({'id':_0x4b359f[_0xe723('0x11')],'name':_0x4b359f[_0xe723('0x11')],'utcOffset':_0x4b359f[_0xe723('0x86')]});});return _0x34e46f[_0xe723('0x6')](0xc8)['json']({'tz':_0x5a8810});};exports['getTimezone']=function(_0x4cecc8,_0x374476){var _0x231ac9=shared[_0xe723('0x84')];var _0x1597aa={};if(!_['isNil'](_0x231ac9[_0x4cecc8['body']['id']]))_0x1597aa=_0x231ac9[_0x4cecc8['body']['id']];return _0x374476['status'](0xc8)[_0xe723('0xd')](_0x1597aa);}; \ No newline at end of file +var _0xf2cb=['transaction','YYYY-MM-DD\x20HH:mm:ss','value','direction','hopperIds','priority','ASC','COALESCE(CmHopper.UserId,\x200)\x20ASC','isEmpty','DESC','scheduledAt','literal','COALESCE(CmHopper.UserId,\x200)\x20DESC','scheduledat','phone','recallme','LOCK','UPDATE','Contact','Company','CmList','List','Queue','dialActive','getPreviewRecall','CmCompany','getOpenContacts','format','isNil','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','getTimezones','timezones','push','utcOffset','getTimezone','lodash','../../config/logger','../../config/environment','json','offset','limit','count','status','set','Content-Range','update','then','sendStatus','error','stack','name','send','map','CmHopper','rawAttributes','fieldName','type','key','query','keys','filters','intersection','concat','$or','$gt','$gte','$lt','$lte','$ne','$eq','$notBetween','$in','$notIn','$like','$notLike','$iLike','$notILike','$overlap','$contained','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','destroy','CampaignId','VoiceQueueId','VoiceQueue','Campaign','omit','dataValues','statedesc','deleted','campaign','user','deletedat','campaigntype','queue','ivr','CmContact','ContactId','firstName','calleridname','lastName','finally','CmHopperAdditionalPhone','getPreview','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','dialPreviewAutoRecallMe','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf2cb,0x130));var _0xbf2c=function(_0x4d2c94,_0x402f82){_0x4d2c94=_0x4d2c94-0x0;var _0x3781bd=_0xf2cb[_0x4d2c94];return _0x3781bd;};'use strict';var moment=require('moment');var _=require(_0xbf2c('0x0'));var qs=require('../../components/parsers/qs');var logger=require(_0xbf2c('0x1'))('api');var shared=require(_0xbf2c('0x2'));var db=require('../../mysqldb')['db'];function respondWithResult(_0x1ecb79,_0x41c649){_0x41c649=_0x41c649||0xc8;return function(_0x5abeb3){if(_0x5abeb3){return _0x1ecb79['status'](_0x41c649)[_0xbf2c('0x3')](_0x5abeb3);}};}function respondWithFilteredResult(_0x46d282,_0x1fc371){return function(_0xaacd25){if(_0xaacd25){var _0x516715=typeof _0x1fc371[_0xbf2c('0x4')]==='undefined'&&typeof _0x1fc371[_0xbf2c('0x5')]==='undefined';var _0x5f25ea=_0xaacd25[_0xbf2c('0x6')];var _0x16c303=_0x516715?0x0:_0x1fc371[_0xbf2c('0x4')];var _0x5e10f4=_0x516715?_0xaacd25[_0xbf2c('0x6')]:_0x1fc371[_0xbf2c('0x4')]+_0x1fc371[_0xbf2c('0x5')];var _0x27be1c;if(_0x5e10f4>=_0x5f25ea){_0x5e10f4=_0x5f25ea;_0x27be1c=0xc8;}else{_0x27be1c=0xce;}_0x46d282[_0xbf2c('0x7')](_0x27be1c);return _0x46d282[_0xbf2c('0x8')](_0xbf2c('0x9'),_0x16c303+'-'+_0x5e10f4+'/'+_0x5f25ea)[_0xbf2c('0x3')](_0xaacd25);}return null;};}function saveUpdates(_0x52983d,_0x149235){return function(_0x294d0d){if(_0x294d0d){return _0x294d0d[_0xbf2c('0xa')](_0x52983d)[_0xbf2c('0xb')](function(_0x5220e2){return _0x5220e2;});}return null;};}function handleEntityNotFound(_0x7665b1,_0x5a160b){return function(_0x557740){if(!_0x557740){_0x7665b1[_0xbf2c('0xc')](0x194);}return _0x557740;};}function handleError(_0x4f58c7,_0x47df49){_0x47df49=_0x47df49||0x1f4;return function(_0x3ed1c3){logger[_0xbf2c('0xd')](_0x3ed1c3[_0xbf2c('0xe')]);if(_0x3ed1c3[_0xbf2c('0xf')]){delete _0x3ed1c3[_0xbf2c('0xf')];}_0x4f58c7['status'](_0x47df49)[_0xbf2c('0x10')](_0x3ed1c3);};}exports['index']=function(_0x4ced7f,_0x1df2ab){var _0x298329={},_0x32a44d={},_0x266035={'count':0x0,'rows':[]};var _0x57e01a=_[_0xbf2c('0x11')](db[_0xbf2c('0x12')][_0xbf2c('0x13')],function(_0x5353e7){return{'name':_0x5353e7[_0xbf2c('0x14')],'type':_0x5353e7[_0xbf2c('0x15')][_0xbf2c('0x16')]};});_0x32a44d['model']=_[_0xbf2c('0x11')](_0x57e01a,_0xbf2c('0xf'));_0x32a44d[_0xbf2c('0x17')]=_[_0xbf2c('0x18')](_0x4ced7f['query']);_0x32a44d[_0xbf2c('0x19')]=_[_0xbf2c('0x1a')](_0x32a44d['model'],_0x32a44d[_0xbf2c('0x17')]);_0x32a44d[_0xbf2c('0x19')]=_[_0xbf2c('0x1b')](_0x32a44d['filters'],['$and',_0xbf2c('0x1c'),_0xbf2c('0x1d'),_0xbf2c('0x1e'),_0xbf2c('0x1f'),_0xbf2c('0x20'),_0xbf2c('0x21'),_0xbf2c('0x22'),'$not','$between',_0xbf2c('0x23'),_0xbf2c('0x24'),_0xbf2c('0x25'),_0xbf2c('0x26'),_0xbf2c('0x27'),_0xbf2c('0x28'),_0xbf2c('0x29'),_0xbf2c('0x26'),_0xbf2c('0x2a'),'$contains',_0xbf2c('0x2b'),'$any']);_0x298329[_0xbf2c('0x2c')]=_[_0xbf2c('0x1a')](_0x32a44d[_0xbf2c('0x2d')],qs[_0xbf2c('0x2e')](_0x4ced7f[_0xbf2c('0x17')]['fields']));_0x298329[_0xbf2c('0x2c')]=_0x298329[_0xbf2c('0x2c')][_0xbf2c('0x2f')]?_0x298329[_0xbf2c('0x2c')]:_0x32a44d[_0xbf2c('0x2d')];if(!_0x4ced7f[_0xbf2c('0x17')][_0xbf2c('0x30')](_0xbf2c('0x31'))){_0x298329['limit']=qs[_0xbf2c('0x5')](_0x4ced7f[_0xbf2c('0x17')][_0xbf2c('0x5')]);_0x298329['offset']=qs['offset'](_0x4ced7f[_0xbf2c('0x17')][_0xbf2c('0x4')]);}_0x298329[_0xbf2c('0x32')]=qs[_0xbf2c('0x33')](_0x4ced7f[_0xbf2c('0x17')][_0xbf2c('0x33')]);_0x298329[_0xbf2c('0x34')]=qs[_0xbf2c('0x19')](_[_0xbf2c('0x35')](_0x4ced7f['query'],_0x32a44d[_0xbf2c('0x19')]),_0x57e01a);if(_0x4ced7f[_0xbf2c('0x17')][_0xbf2c('0x36')]){_0x298329[_0xbf2c('0x34')]=_[_0xbf2c('0x37')](_0x298329[_0xbf2c('0x34')],{'$or':_[_0xbf2c('0x11')](_0x57e01a,function(_0x4722b3){if(_0x4722b3['type']!==_0xbf2c('0x38')){var _0x475594={};_0x475594[_0x4722b3[_0xbf2c('0xf')]]={'$like':'%'+_0x4ced7f['query'][_0xbf2c('0x36')]+'%'};return _0x475594;}})});}_0x298329=_[_0xbf2c('0x37')]({},_0x298329,_0x4ced7f[_0xbf2c('0x39')]);var _0x5402ff={'where':_0x298329[_0xbf2c('0x34')]};return db[_0xbf2c('0x12')]['count'](_0x5402ff)['then'](function(_0x47ab9a){_0x266035['count']=_0x47ab9a;if(_0x4ced7f['query'][_0xbf2c('0x3a')]){_0x298329[_0xbf2c('0x3b')]=[{'all':!![]}];}return db[_0xbf2c('0x12')][_0xbf2c('0x3c')](_0x298329);})[_0xbf2c('0xb')](function(_0x16fbd5){_0x266035[_0xbf2c('0x3d')]=_0x16fbd5;return _0x266035;})[_0xbf2c('0xb')](respondWithFilteredResult(_0x1df2ab,_0x298329))[_0xbf2c('0x3e')](handleError(_0x1df2ab,null));};exports[_0xbf2c('0x3f')]=function(_0x245eaf,_0x99abc8){var _0x3fbf90={'raw':!![],'where':{'id':_0x245eaf[_0xbf2c('0x40')]['id']}},_0x1eac50={};_0x1eac50[_0xbf2c('0x2d')]=_['keys'](db[_0xbf2c('0x12')][_0xbf2c('0x13')]);_0x1eac50[_0xbf2c('0x17')]=_[_0xbf2c('0x18')](_0x245eaf[_0xbf2c('0x17')]);_0x1eac50[_0xbf2c('0x19')]=_[_0xbf2c('0x1a')](_0x1eac50[_0xbf2c('0x2d')],_0x1eac50['query']);_0x3fbf90[_0xbf2c('0x2c')]=_[_0xbf2c('0x1a')](_0x1eac50[_0xbf2c('0x2d')],qs[_0xbf2c('0x2e')](_0x245eaf['query'][_0xbf2c('0x2e')]));_0x3fbf90['attributes']=_0x3fbf90[_0xbf2c('0x2c')][_0xbf2c('0x2f')]?_0x3fbf90[_0xbf2c('0x2c')]:_0x1eac50[_0xbf2c('0x2d')];if(_0x245eaf[_0xbf2c('0x17')][_0xbf2c('0x3a')]){_0x3fbf90['include']=[{'all':!![]}];}_0x3fbf90=_[_0xbf2c('0x37')]({},_0x3fbf90,_0x245eaf['options']);return db['CmHopper'][_0xbf2c('0x41')](_0x3fbf90)['then'](handleEntityNotFound(_0x99abc8,null))['then'](respondWithResult(_0x99abc8,null))[_0xbf2c('0x3e')](handleError(_0x99abc8,null));};exports[_0xbf2c('0x42')]=function(_0x56fc01,_0x403568){return db['CmHopper'][_0xbf2c('0x42')](_0x56fc01['body'],{})[_0xbf2c('0xb')](respondWithResult(_0x403568,0xc9))[_0xbf2c('0x3e')](handleError(_0x403568,null));};exports[_0xbf2c('0xa')]=function(_0x343255,_0x222721){if(_0x343255[_0xbf2c('0x43')]['id']){delete _0x343255['body']['id'];}return db[_0xbf2c('0x12')][_0xbf2c('0x41')]({'where':{'id':_0x343255[_0xbf2c('0x40')]['id']}})[_0xbf2c('0xb')](handleEntityNotFound(_0x222721,null))[_0xbf2c('0xb')](saveUpdates(_0x343255['body'],null))['then'](respondWithResult(_0x222721,null))[_0xbf2c('0x3e')](handleError(_0x222721,null));};exports['describe']=function(_0xa08482,_0x1c64e0){return db[_0xbf2c('0x12')][_0xbf2c('0x44')]()[_0xbf2c('0xb')](respondWithResult(_0x1c64e0,null))[_0xbf2c('0x3e')](handleError(_0x1c64e0,null));};exports[_0xbf2c('0x45')]=function(_0x1c3b78,_0x128e97){var _0x23912d;var _0x31791b=_0x1c3b78['params']['id'];return db[_0xbf2c('0x12')][_0xbf2c('0x41')]({'where':{'id':_0x1c3b78[_0xbf2c('0x40')]['id']}})[_0xbf2c('0xb')](handleEntityNotFound(_0x128e97,null))['then'](function(_0x4edca4){if(_0x4edca4){return _0x4edca4['destroy']()[_0xbf2c('0xb')](function(_0x2451ba){return _0x2451ba;});}})['then'](function(_0x5a0c37){_0x23912d=_0x5a0c37;if(_0x5a0c37){if(_0x5a0c37['VoiceQueueId']||_0x5a0c37[_0xbf2c('0x46')]){return db[_0x5a0c37[_0xbf2c('0x47')]?_0xbf2c('0x48'):_0xbf2c('0x49')][_0xbf2c('0x41')]({'where':{'id':_0x5a0c37[_0xbf2c('0x47')]?_0x5a0c37['VoiceQueueId']:_0x5a0c37[_0xbf2c('0x46')]},'attributes':['id',_0xbf2c('0xf')],'raw':!![]});}}})[_0xbf2c('0xb')](function(_0x3fa07e){var _0x36d1ec={};if(_0x3fa07e){_[_0xbf2c('0x37')](_0x36d1ec,_[_0xbf2c('0x4a')](_0x23912d[_0xbf2c('0x4b')],['createdAt','updatedAt','id']));_0x36d1ec['state']=0x15;_0x36d1ec[_0xbf2c('0x4c')]=_0xbf2c('0x4d');_0x36d1ec[_0xbf2c('0x4e')]=_0x3fa07e[_0xbf2c('0xf')];_0x36d1ec['membername']=_0x1c3b78[_0xbf2c('0x4f')][_0xbf2c('0xf')];_0x36d1ec['UserId']=_0x1c3b78[_0xbf2c('0x4f')]['id'];_0x36d1ec[_0xbf2c('0x4d')]=!![];_0x36d1ec[_0xbf2c('0x50')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x36d1ec['calleridnum']=_0x23912d['phone'];_0x36d1ec[_0xbf2c('0x51')]=_0x23912d[_0xbf2c('0x47')]?_0xbf2c('0x52'):_0xbf2c('0x53');return db[_0xbf2c('0x54')]['find']({'where':{'id':_0x36d1ec[_0xbf2c('0x55')]},'attributes':[_0xbf2c('0x56'),'lastName']})[_0xbf2c('0xb')](function(_0x3f0129){if(!_['isNil'](_0x128e97)&&!_['isNil'](_0x3f0129['firstName'])){_0x36d1ec[_0xbf2c('0x57')]=_0x3f0129['firstName'];if(!_['isNil'](_0x3f0129[_0xbf2c('0x58')])){_0x36d1ec[_0xbf2c('0x57')]+='\x20'+_0x3f0129[_0xbf2c('0x58')];}}})[_0xbf2c('0x59')](function(){return db['CmHopperFinal']['create'](_0x36d1ec);});}})[_0xbf2c('0xb')](function(_0xc0b6ff){return db[_0xbf2c('0x5a')][_0xbf2c('0x45')]({'where':{'CmHopperId':_0x31791b}});})[_0xbf2c('0xb')](function(){return _0x128e97['status'](0xcc)['end']();})[_0xbf2c('0x3e')](handleError(_0x128e97,null));};exports[_0xbf2c('0x5b')]=function(_0x40f93e,_0x45b91c){var _0x1f984e=[];return db[_0xbf2c('0x54')]['describe']()['then'](function(_0x47b287){_0x1f984e=_[_0xbf2c('0x18')](_0x47b287);return _0x40f93e[_0xbf2c('0x4f')][_0xbf2c('0x5c')]({'where':{'type':_0xbf2c('0x5d'),'dialActive':!![],'dialMethod':_0xbf2c('0x5e')},'attributes':['id',_0xbf2c('0x5f'),_0xbf2c('0x60')],'raw':!![]});})[_0xbf2c('0xb')](function(_0x50d44d){if(_0x50d44d&&_0x50d44d['length']){return db[_0xbf2c('0x61')][_0xbf2c('0x62')](function(_0x38ce66){var _0x42f789={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0xbf2c('0x63'))},'VoiceQueueId':{'$in':_[_0xbf2c('0x11')](_0x50d44d,'id')},'$or':[{'UserId':null},{'UserId':_0x40f93e[_0xbf2c('0x4f')]['id']}]};var _0x4ed155={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x50d44d)[_0xbf2c('0x36')]([_0xbf2c('0x60'),0x0])[_0xbf2c('0x11')]('id')[_0xbf2c('0x64')]()},'$or':[{'UserId':null},{'UserId':_0x40f93e['user']['id']}]};var _0x3e9448={'$or':[_0x42f789,_0x4ed155]};var _0x12bee7=[];if(_0x40f93e[_0xbf2c('0x43')]['direction']&&_0x40f93e['body'][_0xbf2c('0x65')]==='prev'){if(!_['isEmpty'](_0x40f93e[_0xbf2c('0x43')][_0xbf2c('0x66')])){_0x3e9448['id']={'$in':_0x40f93e[_0xbf2c('0x43')][_0xbf2c('0x66')]};}_0x12bee7=[[_0xbf2c('0x67'),'ASC'],['scheduledAt',_0x50d44d[0x0][_0xbf2c('0x5f')]===_0xbf2c('0x68')?'DESC':_0xbf2c('0x68')],db[_0xbf2c('0x61')]['literal'](_0xbf2c('0x69')),['id','DESC']];}else{if(!_[_0xbf2c('0x6a')](_0x40f93e[_0xbf2c('0x43')][_0xbf2c('0x66')])){_0x3e9448['id']={'$notIn':_0x40f93e['body'][_0xbf2c('0x66')]};}_0x12bee7=[[_0xbf2c('0x67'),_0xbf2c('0x6b')],[_0xbf2c('0x6c'),_0x50d44d[0x0][_0xbf2c('0x5f')]],db[_0xbf2c('0x61')][_0xbf2c('0x6d')](_0xbf2c('0x6e')),['id',_0xbf2c('0x68')]];}return db['CmHopper']['findOne']({'attributes':['id',_0xbf2c('0x6f'),_0xbf2c('0x70'),_0xbf2c('0x71')],'where':_0x3e9448,'order':_0x12bee7,'transaction':_0x38ce66,'lock':_0x38ce66[_0xbf2c('0x72')][_0xbf2c('0x73')],'include':[{'model':db[_0xbf2c('0x54')],'as':_0xbf2c('0x74'),'attributes':_0x1f984e,'include':[{'model':db['CmCompany'],'as':_0xbf2c('0x75'),'attributes':['id',_0xbf2c('0xf')]}]},{'model':db[_0xbf2c('0x76')],'as':_0xbf2c('0x77'),'attributes':['id',_0xbf2c('0xf')]},{'model':db['VoiceQueue'],'as':_0xbf2c('0x78'),'attributes':['id',_0xbf2c('0xf'),_0xbf2c('0x79')]}]})[_0xbf2c('0xb')](function(_0x4e7b32){if(_0x4e7b32){return _0x4e7b32[_0xbf2c('0xa')]({'UserId':_0x40f93e[_0xbf2c('0x4f')]['id']},{'transaction':_0x38ce66});}});});}})[_0xbf2c('0xb')](handleEntityNotFound(_0x45b91c,null))[_0xbf2c('0xb')](respondWithResult(_0x45b91c,null))[_0xbf2c('0x3e')](handleError(_0x45b91c,null));};exports[_0xbf2c('0x7a')]=function(_0x2029f7,_0x290f8c,_0x51617d){var _0x79cc7=[];var _0x5440a8=_0x2029f7[_0xbf2c('0x40')]['id'];var _0x12b821=_0x2029f7[_0xbf2c('0x4f')]['id'];return db['CmContact'][_0xbf2c('0x44')]()[_0xbf2c('0xb')](function(_0x4ff5c3){_0x79cc7=_[_0xbf2c('0x18')](_0x4ff5c3);return db['sequelize'][_0xbf2c('0x62')](function(_0x357989){const _0x307e46={'id':_0x5440a8};return db[_0xbf2c('0x12')]['findOne']({'attributes':['id','scheduledat',_0xbf2c('0x71')],'where':_0x307e46,'transaction':_0x357989,'lock':_0x357989[_0xbf2c('0x72')]['UPDATE'],'include':[{'model':db['CmContact'],'as':_0xbf2c('0x74'),'attributes':_0x79cc7,'include':[{'model':db[_0xbf2c('0x7b')],'as':_0xbf2c('0x75'),'attributes':['id',_0xbf2c('0xf')]}]},{'model':db[_0xbf2c('0x76')],'as':'List','attributes':['id',_0xbf2c('0xf')]},{'model':db[_0xbf2c('0x48')],'as':_0xbf2c('0x78'),'attributes':['id',_0xbf2c('0xf'),_0xbf2c('0x79')]}]})[_0xbf2c('0xb')](function(_0x26fdee){if(_0x26fdee){return _0x26fdee[_0xbf2c('0xa')]({'UserId':_0x12b821},{'transaction':_0x357989});}});});})[_0xbf2c('0xb')](handleEntityNotFound(_0x290f8c,null))[_0xbf2c('0xb')](respondWithResult(_0x290f8c,null))[_0xbf2c('0x3e')](handleError(_0x290f8c,null));};exports[_0xbf2c('0x7c')]=function(_0x5ecd37,_0x3ab5ac){return _0x5ecd37[_0xbf2c('0x4f')][_0xbf2c('0x5c')]({'where':{'type':_0xbf2c('0x5d'),'dialActive':!![],'dialMethod':_0xbf2c('0x5e')},'attributes':['id'],'raw':!![]})[_0xbf2c('0xb')](function(_0x545447){if(_0x545447&&_0x545447[_0xbf2c('0x2f')]){return db[_0xbf2c('0x12')]['count']({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xbf2c('0x7d')](_0xbf2c('0x63'))},'VoiceQueueId':{'$in':_[_0xbf2c('0x11')](_0x545447,'id')},'$or':[{'UserId':null},{'UserId':_0x5ecd37[_0xbf2c('0x4f')]['id']}]}});}return 0x0;})['then'](function(_0x2c7cf7){if(!_[_0xbf2c('0x7e')](_0x2c7cf7)&&_['isNumber'](_0x2c7cf7)){return _0x3ab5ac[_0xbf2c('0x7')](0xc8)[_0xbf2c('0x3')]({'contacts':_0x2c7cf7});}else{logger[_0xbf2c('0xd')](_0xbf2c('0x7f'),_0xbf2c('0x7c'),0x194,_0xbf2c('0x80'));_0x3ab5ac['sendStatus'](0x194);}})[_0xbf2c('0x3e')](handleError(_0x3ab5ac,null));};exports[_0xbf2c('0x81')]=function(_0x1377c1,_0x4fa011){var _0x2aa3c3=shared[_0xbf2c('0x82')];var _0x40681f=[];_[_0xbf2c('0x11')](_0x2aa3c3,function(_0x5f4f90){_0x40681f[_0xbf2c('0x83')]({'id':_0x5f4f90[_0xbf2c('0xf')],'name':_0x5f4f90[_0xbf2c('0xf')],'utcOffset':_0x5f4f90[_0xbf2c('0x84')]});});return _0x4fa011[_0xbf2c('0x7')](0xc8)[_0xbf2c('0x3')]({'tz':_0x40681f});};exports[_0xbf2c('0x85')]=function(_0x31d6f,_0x2fcb0a){var _0x391208=shared[_0xbf2c('0x82')];var _0x560da4={};if(!_[_0xbf2c('0x7e')](_0x391208[_0x31d6f['body']['id']]))_0x560da4=_0x391208[_0x31d6f[_0xbf2c('0x43')]['id']];return _0x2fcb0a[_0xbf2c('0x7')](0xc8)['json'](_0x560da4);}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index 2585094..dd6dc9b 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 _0x90b1=['priority','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','define','CmHopper','cm_hopper','scheduledat','phone'];(function(_0x5c9307,_0x5b97e4){var _0x373e29=function(_0xefebbd){while(--_0xefebbd){_0x5c9307['push'](_0x5c9307['shift']());}};_0x373e29(++_0x5b97e4);}(_0x90b1,0x1bb));var _0x190b=function(_0x41cb4b,_0x200468){_0x41cb4b=_0x41cb4b-0x0;var _0x1719c1=_0x90b1[_0x41cb4b];return _0x1719c1;};'use strict';var _=require(_0x190b('0x0'));var util=require(_0x190b('0x1'));var logger=require(_0x190b('0x2'))('api');var moment=require('moment');var BPromise=require(_0x190b('0x3'));var rp=require(_0x190b('0x4'));var fs=require('fs');var path=require(_0x190b('0x5'));var rimraf=require(_0x190b('0x6'));var config=require('../../config/environment');var attributes=require('./cmHopper.attributes');module['exports']=function(_0x5da9c1,_0x27ff8c){return _0x5da9c1[_0x190b('0x7')](_0x190b('0x8'),attributes,{'tableName':_0x190b('0x9'),'paranoid':![],'indexes':[{'name':_0x190b('0xa'),'fields':[_0x190b('0xa')]},{'name':_0x190b('0xb'),'fields':['phone']},{'name':_0x190b('0xc'),'fields':[_0x190b('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xeda8=['exports','define','cm_hopper','scheduledat','phone','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopper.attributes'];(function(_0x5192d7,_0x3dc1ae){var _0x3d79f4=function(_0x5b0a94){while(--_0x5b0a94){_0x5192d7['push'](_0x5192d7['shift']());}};_0x3d79f4(++_0x3dc1ae);}(_0xeda8,0x104));var _0x8eda=function(_0x2657a8,_0x1befe3){_0x2657a8=_0x2657a8-0x0;var _0x3cb723=_0xeda8[_0x2657a8];return _0x3cb723;};'use strict';var _=require(_0x8eda('0x0'));var util=require(_0x8eda('0x1'));var logger=require('../../config/logger')(_0x8eda('0x2'));var moment=require(_0x8eda('0x3'));var BPromise=require(_0x8eda('0x4'));var rp=require(_0x8eda('0x5'));var fs=require('fs');var path=require(_0x8eda('0x6'));var rimraf=require(_0x8eda('0x7'));var config=require(_0x8eda('0x8'));var attributes=require(_0x8eda('0x9'));module[_0x8eda('0xa')]=function(_0x1f3556,_0x349361){return _0x1f3556[_0x8eda('0xb')]('CmHopper',attributes,{'tableName':_0x8eda('0xc'),'paranoid':![],'indexes':[{'name':_0x8eda('0xd'),'fields':[_0x8eda('0xd')]},{'name':_0x8eda('0xe'),'fields':['phone']},{'name':'priority','fields':['priority']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index b053454..96b786b 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 _0x28e1=['debug','stringify','catch','error','message','ShowCmHopper','CreateCmHopper','create','body','UpdateCmHopper','update','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','DestroyCmHopper','destroy','GetContactDialer','CmContact','describe','findAll','order','UPDATE','Contact','User','name','voicePause','length','UserId','includes','push','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','MoveContactManagedDialer','sequelize','transaction','CmHopperFinal','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','COUNT','literal','format','YYYY-MM-DD\x20HH:mm:ss','contactsRescheduled','CountReScheduled','GetContactRecallMe','LOCK','all','GetContactByPhone','findOne','phone','dialTimezone','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','voiceQueueIds','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','NOW()','CmList','lodash','util','moment','../../mysqldb','../../config/logger','rpc','GetCmHopper','CmHopper','raw','options','where','limit','include','map','model','attributes','then','info'];(function(_0x51ece4,_0x39165c){var _0x2b7e27=function(_0x88b36e){while(--_0x88b36e){_0x51ece4['push'](_0x51ece4['shift']());}};_0x2b7e27(++_0x39165c);}(_0x28e1,0xcf));var _0x128e=function(_0xcb1481,_0x26036f){_0xcb1481=_0xcb1481-0x0;var _0x4c52df=_0x28e1[_0xcb1481];return _0x4c52df;};'use strict';var _=require(_0x128e('0x0'));var util=require(_0x128e('0x1'));var moment=require(_0x128e('0x2'));var BPromise=require('bluebird');var db=require(_0x128e('0x3'))['db'];var logger=require(_0x128e('0x4'))(_0x128e('0x5'));exports[_0x128e('0x6')]=function(_0x56fa23){var _0x42c59e=this;return new Promise(function(_0x4f546b,_0x116ae5){return db[_0x128e('0x7')]['findAll']({'raw':_0x56fa23['options']?_0x56fa23['options'][_0x128e('0x8')]===undefined?!![]:![]:!![],'where':_0x56fa23[_0x128e('0x9')]?_0x56fa23['options'][_0x128e('0xa')]||null:null,'attributes':_0x56fa23['options']?_0x56fa23[_0x128e('0x9')]['attributes']||null:null,'limit':_0x56fa23[_0x128e('0x9')]?_0x56fa23[_0x128e('0x9')][_0x128e('0xb')]||null:null,'include':_0x56fa23[_0x128e('0x9')]?_0x56fa23[_0x128e('0x9')][_0x128e('0xc')]?_[_0x128e('0xd')](_0x56fa23[_0x128e('0x9')][_0x128e('0xc')],function(_0x5f38cb){return{'model':db[_0x5f38cb[_0x128e('0xe')]],'as':_0x5f38cb['as'],'attributes':_0x5f38cb[_0x128e('0xf')],'include':_0x5f38cb[_0x128e('0xc')]?_['map'](_0x5f38cb[_0x128e('0xc')],function(_0x1dfeba){return{'model':db[_0x1dfeba['model']],'as':_0x1dfeba['as'],'attributes':_0x1dfeba['attributes'],'include':_0x1dfeba[_0x128e('0xc')]?_[_0x128e('0xd')](_0x1dfeba[_0x128e('0xc')],function(_0x5cd529){return{'model':db[_0x5cd529[_0x128e('0xe')]],'as':_0x5cd529['as'],'attributes':_0x5cd529[_0x128e('0xf')]};}):[]};}):[]};}):[]:[]})[_0x128e('0x10')](function(_0x1589a8){logger[_0x128e('0x11')](_0x128e('0x6'),_0x56fa23);logger[_0x128e('0x12')]('GetCmHopper',_0x56fa23,JSON[_0x128e('0x13')](_0x1589a8));_0x4f546b(_0x1589a8);})[_0x128e('0x14')](function(_0x56ec26){logger[_0x128e('0x15')]('GetCmHopper',_0x56ec26[_0x128e('0x16')],_0x56fa23);_0x116ae5(_0x42c59e[_0x128e('0x15')](0x1f4,_0x56ec26[_0x128e('0x16')]));});});};exports[_0x128e('0x17')]=function(_0x478d6d){var _0x446558=this;return new Promise(function(_0x3aa514,_0x1bf277){return db['CmHopper']['find']({'raw':_0x478d6d[_0x128e('0x9')]?_0x478d6d[_0x128e('0x9')][_0x128e('0x8')]===undefined?!![]:![]:!![],'where':_0x478d6d[_0x128e('0x9')]?_0x478d6d['options'][_0x128e('0xa')]||null:null,'attributes':_0x478d6d['options']?_0x478d6d['options']['attributes']||null:null,'include':_0x478d6d[_0x128e('0x9')]?_0x478d6d[_0x128e('0x9')][_0x128e('0xc')]?_['map'](_0x478d6d['options'][_0x128e('0xc')],function(_0x1ce5fd){return{'model':db[_0x1ce5fd[_0x128e('0xe')]],'as':_0x1ce5fd['as'],'attributes':_0x1ce5fd[_0x128e('0xf')],'include':_0x1ce5fd['include']?_[_0x128e('0xd')](_0x1ce5fd['include'],function(_0x119b2c){return{'model':db[_0x119b2c[_0x128e('0xe')]],'as':_0x119b2c['as'],'attributes':_0x119b2c['attributes'],'include':_0x119b2c[_0x128e('0xc')]?_[_0x128e('0xd')](_0x119b2c['include'],function(_0x49dbab){return{'model':db[_0x49dbab[_0x128e('0xe')]],'as':_0x49dbab['as'],'attributes':_0x49dbab[_0x128e('0xf')]};}):[]};}):[]};}):[]:[]})[_0x128e('0x10')](function(_0x2889e3){logger['info']('ShowCmHopper',_0x478d6d);logger[_0x128e('0x12')](_0x128e('0x17'),_0x478d6d,JSON[_0x128e('0x13')](_0x2889e3));_0x3aa514(_0x2889e3);})[_0x128e('0x14')](function(_0x11eb8f){logger[_0x128e('0x15')](_0x128e('0x17'),_0x11eb8f[_0x128e('0x16')],_0x478d6d);_0x1bf277(_0x446558[_0x128e('0x15')](0x1f4,_0x11eb8f['message']));});});};exports[_0x128e('0x18')]=function(_0x18b135){var _0x4fabba=this;return new Promise(function(_0x3e607b,_0x41e381){return db[_0x128e('0x7')][_0x128e('0x19')](_0x18b135[_0x128e('0x1a')],{'raw':_0x18b135[_0x128e('0x9')]?_0x18b135[_0x128e('0x9')][_0x128e('0x8')]===undefined?!![]:![]:!![]})[_0x128e('0x10')](function(_0x3e8770){logger['info'](_0x128e('0x18'),_0x18b135);logger[_0x128e('0x12')](_0x128e('0x18'),_0x18b135,JSON['stringify'](_0x3e8770));_0x3e607b(_0x3e8770);})[_0x128e('0x14')](function(_0x3e57bd){logger['error'](_0x128e('0x18'),_0x3e57bd['message'],_0x18b135);_0x41e381(_0x4fabba[_0x128e('0x15')](0x1f4,_0x3e57bd[_0x128e('0x16')]));});});};exports[_0x128e('0x1b')]=function(_0x32e863){var _0x1efdce=this;return new Promise(function(_0x115cc1,_0x2507eb){return db['CmHopper'][_0x128e('0x1c')](_0x32e863[_0x128e('0x1a')],{'raw':_0x32e863[_0x128e('0x9')]?_0x32e863[_0x128e('0x9')][_0x128e('0x8')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x32e863[_0x128e('0x9')]?_0x32e863[_0x128e('0x9')]['where']||null:null,'attributes':_0x32e863[_0x128e('0x9')]?_0x32e863[_0x128e('0x9')]['attributes']||null:null,'limit':_0x32e863['options']?_0x32e863['options'][_0x128e('0xb')]||null:null})['then'](function(_0x4b3740){logger['info'](_0x128e('0x1b'),_0x32e863);logger[_0x128e('0x11')](_0x128e('0x1d'),JSON['stringify'](_0x32e863[_0x128e('0x9')][_0x128e('0xa')]),_0x32e863[_0x128e('0x1a')][_0x128e('0x1e')]);logger['debug'](_0x128e('0x1b'),_0x32e863,JSON[_0x128e('0x13')](_0x4b3740));_0x115cc1(_0x4b3740);})[_0x128e('0x14')](function(_0x486864){logger[_0x128e('0x15')]('UpdateCmHopper',_0x486864['message'],_0x32e863);_0x2507eb(_0x1efdce[_0x128e('0x15')](0x1f4,_0x486864[_0x128e('0x16')]));});});};exports[_0x128e('0x1f')]=function(_0x3818dc){var _0x34c077=this;return new Promise(function(_0x5de750,_0xd4ea9d){return db[_0x128e('0x7')][_0x128e('0x20')]({'where':_0x3818dc[_0x128e('0x9')]?_0x3818dc['options'][_0x128e('0xa')]||null:null})[_0x128e('0x10')](function(_0x388cca){logger[_0x128e('0x11')](_0x128e('0x1f'),_0x3818dc);logger[_0x128e('0x12')](_0x128e('0x1f'),_0x3818dc,JSON['stringify'](_0x388cca));_0x5de750(_0x388cca);})['catch'](function(_0x445586){logger[_0x128e('0x15')]('DestroyCmHopper',_0x445586[_0x128e('0x16')],_0x3818dc);_0xd4ea9d(_0x34c077[_0x128e('0x15')](0x1f4,_0x445586[_0x128e('0x16')]));});});};exports[_0x128e('0x21')]=function(_0x53e7b5){var _0x2991b0=this;return new Promise(function(_0x1be2e9,_0x1ff29e){return db[_0x128e('0x22')][_0x128e('0x23')]()['then'](function(_0x5b3398){return db['sequelize']['transaction'](function(_0x586b11){return db[_0x128e('0x7')][_0x128e('0x24')]({'where':_0x53e7b5['options']?_0x53e7b5[_0x128e('0x9')][_0x128e('0xa')]||null:null,'attributes':_0x53e7b5['options']?_0x53e7b5[_0x128e('0x9')][_0x128e('0xf')]||null:null,'limit':_0x53e7b5[_0x128e('0x9')]?_0x53e7b5[_0x128e('0x9')][_0x128e('0xb')]||null:null,'order':_0x53e7b5[_0x128e('0x9')]?_0x53e7b5[_0x128e('0x9')][_0x128e('0x25')]||null:null,'transaction':_0x586b11,'lock':_0x586b11['LOCK'][_0x128e('0x26')],'include':[{'model':db[_0x128e('0x22')],'as':_0x128e('0x27'),'attributes':_['keys'](_0x5b3398)},{'model':db[_0x128e('0x28')],'as':'Agent','attributes':['id',_0x128e('0x29'),_0x128e('0x2a')]}]})[_0x128e('0x10')](function(_0x4d2d98){var _0x480b4b=[];var _0x4f91a8=[];for(var _0x16dc38=0x0;_0x16dc38<_0x4d2d98[_0x128e('0x2b')];_0x16dc38+=0x1){var _0x18919d=_0x4d2d98[_0x16dc38][_0x128e('0x2c')];if(_0x18919d===null){_0x480b4b['push'](_0x4d2d98[_0x16dc38]['update'](_0x53e7b5['body'],{'transaction':_0x586b11}));}else if(!_0x4f91a8[_0x128e('0x2d')](_0x18919d)){_0x4f91a8['push'](_0x18919d);_0x480b4b[_0x128e('0x2e')](_0x4d2d98[_0x16dc38][_0x128e('0x1c')](_0x53e7b5[_0x128e('0x1a')],{'transaction':_0x586b11}));}}return BPromise['all'](_0x480b4b);});})['then'](function(_0x1e30a2){logger[_0x128e('0x11')]('GetContactDialer',_0x53e7b5);if(_0x1e30a2[_0x128e('0x2b')]>0x0){logger[_0x128e('0x11')](_0x128e('0x2f'),_0x1e30a2[0x0][_0x128e('0x30')]['id'],_0x1e30a2[0x0][_0x128e('0x30')]['ContactId'],_0x1e30a2[0x0][_0x128e('0x30')][_0x128e('0x1e')]);}logger['debug'](_0x128e('0x21'),_0x53e7b5,JSON['stringify'](_0x1e30a2));_0x1be2e9(_0x1e30a2);})[_0x128e('0x14')](function(_0x3f84d2){logger[_0x128e('0x15')](_0x128e('0x21'),_0x3f84d2[_0x128e('0x16')],_0x53e7b5);_0x1ff29e(_0x2991b0[_0x128e('0x15')](0x1f4,_0x3f84d2[_0x128e('0x16')]));});});});};exports[_0x128e('0x31')]=function(_0x37bc2d){var _0x396bfc=this;return new Promise(function(_0x47a216,_0x13ec02){return db[_0x128e('0x32')][_0x128e('0x33')](function(_0x969534){return db[_0x128e('0x34')][_0x128e('0x19')](_0x37bc2d[_0x128e('0x1a')],{'raw':_0x37bc2d[_0x128e('0x9')]?_0x37bc2d[_0x128e('0x9')][_0x128e('0x8')]===undefined?!![]:![]:!![],'transaction':_0x969534})[_0x128e('0x10')](function(){logger[_0x128e('0x11')](_0x128e('0x35'),JSON['stringify'](_0x37bc2d['options'][_0x128e('0xa')]),_0x37bc2d['options'][_0x128e('0xa')][_0x128e('0x1e')]);return db[_0x128e('0x7')][_0x128e('0x20')]({'where':_0x37bc2d[_0x128e('0x9')]?_0x37bc2d['options'][_0x128e('0xa')]||null:null,'transaction':_0x969534});});})['then'](function(_0x4d17c4){logger[_0x128e('0x11')](_0x128e('0x31'),_0x37bc2d);logger['debug']('MoveContactManagedDialer',_0x37bc2d,JSON[_0x128e('0x13')](_0x4d17c4));_0x47a216(_0x4d17c4);})[_0x128e('0x14')](function(_0x192308){logger[_0x128e('0x15')](_0x128e('0x31'),_0x192308[_0x128e('0x16')],_0x37bc2d);_0x13ec02(_0x396bfc[_0x128e('0x15')](0x1f4,_0x192308['message']));});});};exports['CountReScheduled']=function(_0x29e9a5){var _0x550722=this;return new Promise(function(_0x3d9ddb,_0xcab5c7){return db[_0x128e('0x7')][_0x128e('0x24')]({'raw':_0x29e9a5[_0x128e('0x9')]?_0x29e9a5['options'][_0x128e('0x8')]===undefined?!![]:![]:!![],'where':_0x29e9a5['options']?_0x29e9a5[_0x128e('0x9')][_0x128e('0xa')]||null:null,'attributes':[[db['sequelize']['fn'](_0x128e('0x36'),db['sequelize']['fn']('IF',db[_0x128e('0x32')][_0x128e('0x37')]('`scheduledat`\x20>=\x20'+util[_0x128e('0x38')]('\x22%s\x22',moment()[_0x128e('0x38')](_0x128e('0x39')))+'\x20,\x201,\x20null'))),_0x128e('0x3a')]]})[_0x128e('0x10')](function(_0x35c88f){logger[_0x128e('0x11')]('CountReScheduled',_0x29e9a5);logger[_0x128e('0x12')](_0x128e('0x3b'),_0x29e9a5,JSON['stringify'](_0x35c88f));_0x3d9ddb(_0x35c88f);})[_0x128e('0x14')](function(_0x23d45d){logger[_0x128e('0x15')](_0x128e('0x3b'),_0x23d45d[_0x128e('0x16')],_0x29e9a5);_0xcab5c7(_0x550722[_0x128e('0x15')](0x1f4,_0x23d45d[_0x128e('0x16')]));});});};exports[_0x128e('0x3c')]=function(_0x1f2a93){var _0xceae72=this;return new Promise(function(_0x33b4a1,_0x36fe97){return db['CmContact'][_0x128e('0x23')]()[_0x128e('0x10')](function(){return db[_0x128e('0x32')][_0x128e('0x33')](function(_0x5985cf){return db['CmHopper']['findAll']({'where':_0x1f2a93[_0x128e('0x9')]?_0x1f2a93[_0x128e('0x9')][_0x128e('0xa')]||null:null,'attributes':_0x1f2a93[_0x128e('0x9')]?_0x1f2a93[_0x128e('0x9')][_0x128e('0xf')]||null:null,'limit':0x1,'order':_0x1f2a93['options']?_0x1f2a93[_0x128e('0x9')][_0x128e('0x25')]||null:null,'group':db[_0x128e('0x7')][_0x128e('0x2c')],'transaction':_0x5985cf,'lock':_0x5985cf[_0x128e('0x3d')][_0x128e('0x26')],'include':_0x1f2a93[_0x128e('0x9')]?_0x1f2a93['options'][_0x128e('0xc')]?_[_0x128e('0xd')](_0x1f2a93[_0x128e('0x9')][_0x128e('0xc')],function(_0x48c07b){return{'model':db[_0x48c07b[_0x128e('0xe')]],'as':_0x48c07b['as'],'attributes':_0x48c07b[_0x128e('0xf')],'include':_0x48c07b[_0x128e('0xc')]?_[_0x128e('0xd')](_0x48c07b['include'],function(_0x3e7136){return{'model':db[_0x3e7136[_0x128e('0xe')]],'as':_0x3e7136['as'],'attributes':_0x3e7136[_0x128e('0xf')],'include':_0x3e7136['include']?_[_0x128e('0xd')](_0x3e7136[_0x128e('0xc')],function(_0x313209){return{'model':db[_0x313209[_0x128e('0xe')]],'as':_0x313209['as'],'attributes':_0x313209[_0x128e('0xf')]};}):[]};}):[]};}):[]:[]})[_0x128e('0x10')](function(_0x3f7eaa){var _0x29aaca=[];for(var _0x6eac87=0x0;_0x6eac87<_0x3f7eaa[_0x128e('0x2b')];_0x6eac87+=0x1){_0x29aaca['push'](_0x3f7eaa[_0x6eac87][_0x128e('0x1c')](_0x1f2a93[_0x128e('0x1a')],{'transaction':_0x5985cf}));}return BPromise[_0x128e('0x3e')](_0x29aaca);});})[_0x128e('0x10')](function(_0x7b6bc4){logger['info'](_0x128e('0x3c'),_0x1f2a93);logger['debug'](_0x128e('0x3c'),_0x1f2a93,JSON[_0x128e('0x13')](_0x7b6bc4));_0x33b4a1(_0x7b6bc4);})['catch'](function(_0x58ad2b){logger[_0x128e('0x15')](_0x128e('0x3c'),_0x58ad2b[_0x128e('0x16')],_0x1f2a93);_0x36fe97(_0xceae72[_0x128e('0x15')](0x1f4,_0x58ad2b[_0x128e('0x16')]));});});});};exports['GetCmHopperPreview']=function(_0x313017){var _0x1136b1=this;return new Promise(function(_0x5b927c,_0x2d34b1){db[_0x128e('0x22')]['describe']()[_0x128e('0x10')](function(_0x15cf06){return db[_0x128e('0x7')][_0x128e('0x24')]({'raw':_0x313017[_0x128e('0x9')]?_0x313017[_0x128e('0x9')][_0x128e('0x8')]===undefined?!![]:![]:!![],'where':_0x313017[_0x128e('0x9')]?_0x313017[_0x128e('0x9')][_0x128e('0xa')]||null:null,'attributes':_0x313017[_0x128e('0x9')]?_0x313017['options']['attributes']||null:null,'limit':_0x313017['options']?_0x313017[_0x128e('0x9')][_0x128e('0xb')]||null:null,'include':_0x313017[_0x128e('0x9')]?_0x313017['options']['include']?_[_0x128e('0xd')](_0x313017[_0x128e('0x9')][_0x128e('0xc')],function(_0x1d9b51){return{'model':db[_0x1d9b51[_0x128e('0xe')]],'as':_0x1d9b51['as'],'attributes':_0x1d9b51['as']==='Contact'?_['keys'](_0x15cf06):_0x1d9b51[_0x128e('0xf')],'include':_0x1d9b51['include']?_[_0x128e('0xd')](_0x1d9b51[_0x128e('0xc')],function(_0x55b66e){return{'model':db[_0x55b66e[_0x128e('0xe')]],'as':_0x55b66e['as'],'attributes':_0x55b66e['attributes'],'include':_0x55b66e['include']?_[_0x128e('0xd')](_0x55b66e[_0x128e('0xc')],function(_0x3e4ce3){return{'model':db[_0x3e4ce3[_0x128e('0xe')]],'as':_0x3e4ce3['as'],'attributes':_0x3e4ce3[_0x128e('0xf')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1701da){logger[_0x128e('0x11')](_0x128e('0x6'),_0x313017);logger[_0x128e('0x12')](_0x128e('0x6'),_0x313017,JSON[_0x128e('0x13')](_0x1701da));_0x5b927c(_0x1701da);})[_0x128e('0x14')](function(_0x462611){logger[_0x128e('0x15')](_0x128e('0x6'),_0x462611[_0x128e('0x16')],_0x313017);_0x2d34b1(_0x1136b1[_0x128e('0x15')](0x1f4,_0x462611['message']));});});});};exports[_0x128e('0x3f')]=function(_0x53270b){var _0x31ab59=this;return new Promise(function(_0x555eec,_0x240d85){return db[_0x128e('0x22')][_0x128e('0x40')]({'raw':!![],'where':{'phone':_0x53270b['options']['where'][_0x128e('0x41')]},'attributes':['id',_0x128e('0x42')],'order':[['id','DESC']]})[_0x128e('0x10')](function(_0x31bdfe){logger['info'](_0x128e('0x43'),_0x53270b);logger[_0x128e('0x12')](_0x128e('0x43'),_0x53270b,JSON[_0x128e('0x13')](_0x31bdfe));_0x555eec(_0x31bdfe);})[_0x128e('0x14')](function(_0x2d3c93){logger[_0x128e('0x15')]('getContactByPhone',_0x2d3c93['message'],_0x53270b);_0x240d85(_0x31ab59[_0x128e('0x15')](0x1f4,_0x2d3c93[_0x128e('0x16')]));});});};exports[_0x128e('0x44')]=function(_0x29b90f){var _0x59984d=this;return new Promise(function(_0x5b0bca,_0x4879d6){return db[_0x128e('0x32')][_0x128e('0x33')](function(_0x12624a){var _0x136edf=_0x29b90f[_0x128e('0x9')]&&_0x29b90f[_0x128e('0x9')][_0x128e('0xa')]?_0x29b90f[_0x128e('0x9')]['where']:{};return db[_0x128e('0x7')][_0x128e('0x1c')](_0x29b90f[_0x128e('0x1a')],{'where':_0x136edf,'transaction':_0x12624a})[_0x128e('0x10')](function(_0x113fa6){logger[_0x128e('0x11')](_0x128e('0x44'),_0x29b90f);logger[_0x128e('0x12')](_0x128e('0x44'),_0x29b90f,JSON[_0x128e('0x13')](_0x113fa6));_0x5b0bca(_0x113fa6);})[_0x128e('0x14')](function(_0x510c3e){logger['error'](_0x128e('0x44'),_0x510c3e[_0x128e('0x16')],_0x29b90f);_0x4879d6(_0x59984d[_0x128e('0x15')](0x1f4,_0x510c3e[_0x128e('0x16')]));});});});};exports[_0x128e('0x45')]=function(_0x3dc99c){var _0x34b43=this;var _0x13b6fd=_0x3dc99c[_0x128e('0x1a')][_0x128e('0xa')][_0x128e('0x46')];var _0x3ae65c=_0x3dc99c['body'][_0x128e('0xa')]['interval'];var _0x5794d1=_0x3dc99c[_0x128e('0x1a')]['where']['availableAgentsIds'];return new Promise(function(_0x59c1b6,_0x17fd1b){return db['CmHopper'][_0x128e('0x24')]({'where':{'voiceQueueId':{'$in':_0x13b6fd},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0x128e('0x32')][_0x128e('0x37')](_0x128e('0x47')+_0x3ae65c+_0x128e('0x48')),'$gt':db[_0x128e('0x32')][_0x128e('0x37')](_0x128e('0x49'))}},'UserId':{'$in':_0x5794d1}},'include':[{'model':db[_0x128e('0x22')],'as':_0x128e('0x27')},{'model':db['User'],'as':'Agent','attributes':['id',_0x128e('0x29'),_0x128e('0x2a')]},{'model':db[_0x128e('0x4a')],'as':'List'}]})[_0x128e('0x10')](function(_0x8da44f){if(_0x8da44f[_0x128e('0x2b')]>0x0){return db[_0x128e('0x32')][_0x128e('0x33')](function(_0x5dc999){return db[_0x128e('0x7')][_0x128e('0x1c')]({'recallmeNotifiedDate':db['sequelize'][_0x128e('0x37')]('NOW()')},{'where':{'id':{'$in':_[_0x128e('0xd')](_0x8da44f,'id')}},'transaction':_0x5dc999})['then'](function(){_0x59c1b6(_0x8da44f);})['catch'](function(_0x3749bc){logger[_0x128e('0x15')](_0x128e('0x45'),_0x3749bc['message'],_0x3dc99c);_0x17fd1b(_0x34b43['error'](0x1f4,_0x3749bc['message']));});})[_0x128e('0x14')](function(_0x449d89){logger[_0x128e('0x15')](_0x128e('0x45'),_0x449d89['message'],_0x3dc99c);_0x17fd1b(_0x34b43[_0x128e('0x15')](0x1f4,_0x449d89[_0x128e('0x16')]));});}else{_0x59c1b6(_0x8da44f);}});});}; \ No newline at end of file +var _0x0f3e=['model','attributes','then','debug','catch','error','message','CmHopper','find','ShowCmHopper','CreateCmHopper','create','body','info','stringify','UpdateCmHopper','update','active','DestroyCmHopper','destroy','GetContactDialer','CmContact','describe','transaction','order','LOCK','UPDATE','Contact','User','Agent','name','voicePause','length','UserId','push','includes','all','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','MoveContactManagedDialer','sequelize','CmHopperFinal','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','CountReScheduled','findAll','literal','`scheduledat`\x20>=\x20','format','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','GetCmHopperPreview','keys','phone','DESC','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','voiceQueueIds','interval','availableAgentsIds','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','NOW()','CmList','List','util','moment','bluebird','../../mysqldb','rpc','GetCmHopper','options','raw','where','limit','include','map'];(function(_0x5505b7,_0x1dcacb){var _0x43e926=function(_0x1fd00e){while(--_0x1fd00e){_0x5505b7['push'](_0x5505b7['shift']());}};_0x43e926(++_0x1dcacb);}(_0x0f3e,0x92));var _0xe0f3=function(_0x472810,_0x14c7e2){_0x472810=_0x472810-0x0;var _0x3e9835=_0x0f3e[_0x472810];return _0x3e9835;};'use strict';var _=require('lodash');var util=require(_0xe0f3('0x0'));var moment=require(_0xe0f3('0x1'));var BPromise=require(_0xe0f3('0x2'));var db=require(_0xe0f3('0x3'))['db'];var logger=require('../../config/logger')(_0xe0f3('0x4'));exports[_0xe0f3('0x5')]=function(_0xf16457){var _0x34ca0c=this;return new Promise(function(_0x249fcd,_0x1747ca){return db['CmHopper']['findAll']({'raw':_0xf16457[_0xe0f3('0x6')]?_0xf16457[_0xe0f3('0x6')][_0xe0f3('0x7')]===undefined?!![]:![]:!![],'where':_0xf16457[_0xe0f3('0x6')]?_0xf16457[_0xe0f3('0x6')][_0xe0f3('0x8')]||null:null,'attributes':_0xf16457['options']?_0xf16457[_0xe0f3('0x6')]['attributes']||null:null,'limit':_0xf16457[_0xe0f3('0x6')]?_0xf16457[_0xe0f3('0x6')][_0xe0f3('0x9')]||null:null,'include':_0xf16457[_0xe0f3('0x6')]?_0xf16457[_0xe0f3('0x6')][_0xe0f3('0xa')]?_[_0xe0f3('0xb')](_0xf16457[_0xe0f3('0x6')]['include'],function(_0x510ff3){return{'model':db[_0x510ff3[_0xe0f3('0xc')]],'as':_0x510ff3['as'],'attributes':_0x510ff3[_0xe0f3('0xd')],'include':_0x510ff3[_0xe0f3('0xa')]?_[_0xe0f3('0xb')](_0x510ff3['include'],function(_0x37016c){return{'model':db[_0x37016c[_0xe0f3('0xc')]],'as':_0x37016c['as'],'attributes':_0x37016c['attributes'],'include':_0x37016c[_0xe0f3('0xa')]?_[_0xe0f3('0xb')](_0x37016c[_0xe0f3('0xa')],function(_0x4ae611){return{'model':db[_0x4ae611[_0xe0f3('0xc')]],'as':_0x4ae611['as'],'attributes':_0x4ae611['attributes']};}):[]};}):[]};}):[]:[]})[_0xe0f3('0xe')](function(_0x18b938){logger['info'](_0xe0f3('0x5'),_0xf16457);logger[_0xe0f3('0xf')](_0xe0f3('0x5'),_0xf16457,JSON['stringify'](_0x18b938));_0x249fcd(_0x18b938);})[_0xe0f3('0x10')](function(_0x5104d0){logger[_0xe0f3('0x11')](_0xe0f3('0x5'),_0x5104d0[_0xe0f3('0x12')],_0xf16457);_0x1747ca(_0x34ca0c[_0xe0f3('0x11')](0x1f4,_0x5104d0[_0xe0f3('0x12')]));});});};exports['ShowCmHopper']=function(_0x17dffa){var _0x48270a=this;return new Promise(function(_0x59e794,_0x6bcdcc){return db[_0xe0f3('0x13')][_0xe0f3('0x14')]({'raw':_0x17dffa[_0xe0f3('0x6')]?_0x17dffa[_0xe0f3('0x6')][_0xe0f3('0x7')]===undefined?!![]:![]:!![],'where':_0x17dffa[_0xe0f3('0x6')]?_0x17dffa[_0xe0f3('0x6')]['where']||null:null,'attributes':_0x17dffa[_0xe0f3('0x6')]?_0x17dffa['options'][_0xe0f3('0xd')]||null:null,'include':_0x17dffa[_0xe0f3('0x6')]?_0x17dffa[_0xe0f3('0x6')][_0xe0f3('0xa')]?_['map'](_0x17dffa[_0xe0f3('0x6')][_0xe0f3('0xa')],function(_0x409f48){return{'model':db[_0x409f48[_0xe0f3('0xc')]],'as':_0x409f48['as'],'attributes':_0x409f48['attributes'],'include':_0x409f48[_0xe0f3('0xa')]?_[_0xe0f3('0xb')](_0x409f48['include'],function(_0x2699c6){return{'model':db[_0x2699c6[_0xe0f3('0xc')]],'as':_0x2699c6['as'],'attributes':_0x2699c6['attributes'],'include':_0x2699c6['include']?_[_0xe0f3('0xb')](_0x2699c6[_0xe0f3('0xa')],function(_0xb3e95){return{'model':db[_0xb3e95[_0xe0f3('0xc')]],'as':_0xb3e95['as'],'attributes':_0xb3e95[_0xe0f3('0xd')]};}):[]};}):[]};}):[]:[]})[_0xe0f3('0xe')](function(_0x2adbc7){logger['info'](_0xe0f3('0x15'),_0x17dffa);logger[_0xe0f3('0xf')](_0xe0f3('0x15'),_0x17dffa,JSON['stringify'](_0x2adbc7));_0x59e794(_0x2adbc7);})[_0xe0f3('0x10')](function(_0x4ba83d){logger[_0xe0f3('0x11')](_0xe0f3('0x15'),_0x4ba83d[_0xe0f3('0x12')],_0x17dffa);_0x6bcdcc(_0x48270a[_0xe0f3('0x11')](0x1f4,_0x4ba83d[_0xe0f3('0x12')]));});});};exports[_0xe0f3('0x16')]=function(_0x8eeb6a){var _0x3df9ba=this;return new Promise(function(_0x44d407,_0x2b9e54){return db[_0xe0f3('0x13')][_0xe0f3('0x17')](_0x8eeb6a[_0xe0f3('0x18')],{'raw':_0x8eeb6a[_0xe0f3('0x6')]?_0x8eeb6a[_0xe0f3('0x6')][_0xe0f3('0x7')]===undefined?!![]:![]:!![]})[_0xe0f3('0xe')](function(_0x198a5d){logger[_0xe0f3('0x19')](_0xe0f3('0x16'),_0x8eeb6a);logger[_0xe0f3('0xf')](_0xe0f3('0x16'),_0x8eeb6a,JSON[_0xe0f3('0x1a')](_0x198a5d));_0x44d407(_0x198a5d);})['catch'](function(_0x20eda5){logger[_0xe0f3('0x11')](_0xe0f3('0x16'),_0x20eda5[_0xe0f3('0x12')],_0x8eeb6a);_0x2b9e54(_0x3df9ba[_0xe0f3('0x11')](0x1f4,_0x20eda5[_0xe0f3('0x12')]));});});};exports[_0xe0f3('0x1b')]=function(_0x99e73a){var _0x4db9b9=this;return new Promise(function(_0x50df37,_0x4cef29){return db['CmHopper'][_0xe0f3('0x1c')](_0x99e73a[_0xe0f3('0x18')],{'raw':_0x99e73a[_0xe0f3('0x6')]?_0x99e73a[_0xe0f3('0x6')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x99e73a['options']?_0x99e73a['options'][_0xe0f3('0x8')]||null:null,'attributes':_0x99e73a[_0xe0f3('0x6')]?_0x99e73a[_0xe0f3('0x6')][_0xe0f3('0xd')]||null:null,'limit':_0x99e73a[_0xe0f3('0x6')]?_0x99e73a['options'][_0xe0f3('0x9')]||null:null})[_0xe0f3('0xe')](function(_0x57931c){logger[_0xe0f3('0x19')](_0xe0f3('0x1b'),_0x99e73a);logger[_0xe0f3('0x19')]('UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON['stringify'](_0x99e73a[_0xe0f3('0x6')][_0xe0f3('0x8')]),_0x99e73a[_0xe0f3('0x18')][_0xe0f3('0x1d')]);logger['debug']('UpdateCmHopper',_0x99e73a,JSON[_0xe0f3('0x1a')](_0x57931c));_0x50df37(_0x57931c);})[_0xe0f3('0x10')](function(_0x2c3ba2){logger[_0xe0f3('0x11')](_0xe0f3('0x1b'),_0x2c3ba2['message'],_0x99e73a);_0x4cef29(_0x4db9b9[_0xe0f3('0x11')](0x1f4,_0x2c3ba2[_0xe0f3('0x12')]));});});};exports[_0xe0f3('0x1e')]=function(_0x3c4dc0){var _0x4b1077=this;return new Promise(function(_0x2d64a9,_0x22f772){return db[_0xe0f3('0x13')][_0xe0f3('0x1f')]({'where':_0x3c4dc0[_0xe0f3('0x6')]?_0x3c4dc0['options'][_0xe0f3('0x8')]||null:null})[_0xe0f3('0xe')](function(_0x38b8be){logger[_0xe0f3('0x19')](_0xe0f3('0x1e'),_0x3c4dc0);logger[_0xe0f3('0xf')]('DestroyCmHopper',_0x3c4dc0,JSON[_0xe0f3('0x1a')](_0x38b8be));_0x2d64a9(_0x38b8be);})[_0xe0f3('0x10')](function(_0xa69956){logger[_0xe0f3('0x11')]('DestroyCmHopper',_0xa69956['message'],_0x3c4dc0);_0x22f772(_0x4b1077[_0xe0f3('0x11')](0x1f4,_0xa69956[_0xe0f3('0x12')]));});});};exports[_0xe0f3('0x20')]=function(_0xa12a0a){var _0x3df8a7=this;return new Promise(function(_0x55e219,_0x5bd42b){return db[_0xe0f3('0x21')][_0xe0f3('0x22')]()[_0xe0f3('0xe')](function(_0xe057c6){return db['sequelize'][_0xe0f3('0x23')](function(_0x1b7b43){return db[_0xe0f3('0x13')]['findAll']({'where':_0xa12a0a['options']?_0xa12a0a['options'][_0xe0f3('0x8')]||null:null,'attributes':_0xa12a0a['options']?_0xa12a0a[_0xe0f3('0x6')][_0xe0f3('0xd')]||null:null,'limit':_0xa12a0a[_0xe0f3('0x6')]?_0xa12a0a[_0xe0f3('0x6')][_0xe0f3('0x9')]||null:null,'order':_0xa12a0a[_0xe0f3('0x6')]?_0xa12a0a[_0xe0f3('0x6')][_0xe0f3('0x24')]||null:null,'transaction':_0x1b7b43,'lock':_0x1b7b43[_0xe0f3('0x25')][_0xe0f3('0x26')],'include':[{'model':db[_0xe0f3('0x21')],'as':_0xe0f3('0x27'),'attributes':_['keys'](_0xe057c6)},{'model':db[_0xe0f3('0x28')],'as':_0xe0f3('0x29'),'attributes':['id',_0xe0f3('0x2a'),_0xe0f3('0x2b')]}]})['then'](function(_0x366f45){var _0x4d19e1=[];var _0x508ead=[];for(var _0xd3d04c=0x0;_0xd3d04c<_0x366f45[_0xe0f3('0x2c')];_0xd3d04c+=0x1){var _0x509fc5=_0x366f45[_0xd3d04c][_0xe0f3('0x2d')];if(_0x509fc5===null){_0x4d19e1[_0xe0f3('0x2e')](_0x366f45[_0xd3d04c]['update'](_0xa12a0a[_0xe0f3('0x18')],{'transaction':_0x1b7b43}));}else if(!_0x508ead[_0xe0f3('0x2f')](_0x509fc5)){_0x508ead['push'](_0x509fc5);_0x4d19e1[_0xe0f3('0x2e')](_0x366f45[_0xd3d04c][_0xe0f3('0x1c')](_0xa12a0a[_0xe0f3('0x18')],{'transaction':_0x1b7b43}));}}return BPromise[_0xe0f3('0x30')](_0x4d19e1);});})['then'](function(_0x3764ca){logger[_0xe0f3('0x19')](_0xe0f3('0x20'),_0xa12a0a);if(_0x3764ca['length']>0x0){logger['info'](_0xe0f3('0x31'),_0x3764ca[0x0][_0xe0f3('0x32')]['id'],_0x3764ca[0x0][_0xe0f3('0x32')]['ContactId'],_0x3764ca[0x0][_0xe0f3('0x32')]['active']);}logger[_0xe0f3('0xf')](_0xe0f3('0x20'),_0xa12a0a,JSON[_0xe0f3('0x1a')](_0x3764ca));_0x55e219(_0x3764ca);})[_0xe0f3('0x10')](function(_0x582bac){logger[_0xe0f3('0x11')](_0xe0f3('0x20'),_0x582bac[_0xe0f3('0x12')],_0xa12a0a);_0x5bd42b(_0x3df8a7[_0xe0f3('0x11')](0x1f4,_0x582bac[_0xe0f3('0x12')]));});});});};exports[_0xe0f3('0x33')]=function(_0x343ea1){var _0x321e28=this;return new Promise(function(_0x502447,_0x3cddb6){return db[_0xe0f3('0x34')][_0xe0f3('0x23')](function(_0x292b84){return db[_0xe0f3('0x35')][_0xe0f3('0x17')](_0x343ea1['body'],{'raw':_0x343ea1[_0xe0f3('0x6')]?_0x343ea1['options'][_0xe0f3('0x7')]===undefined?!![]:![]:!![],'transaction':_0x292b84})[_0xe0f3('0xe')](function(){logger['info'](_0xe0f3('0x36'),JSON[_0xe0f3('0x1a')](_0x343ea1[_0xe0f3('0x6')]['where']),_0x343ea1[_0xe0f3('0x6')]['where']['active']);return db['CmHopper'][_0xe0f3('0x1f')]({'where':_0x343ea1[_0xe0f3('0x6')]?_0x343ea1[_0xe0f3('0x6')][_0xe0f3('0x8')]||null:null,'transaction':_0x292b84});});})[_0xe0f3('0xe')](function(_0xbbc2b0){logger[_0xe0f3('0x19')](_0xe0f3('0x33'),_0x343ea1);logger[_0xe0f3('0xf')](_0xe0f3('0x33'),_0x343ea1,JSON['stringify'](_0xbbc2b0));_0x502447(_0xbbc2b0);})['catch'](function(_0x1c07d8){logger['error']('MoveContactManagedDialer',_0x1c07d8[_0xe0f3('0x12')],_0x343ea1);_0x3cddb6(_0x321e28[_0xe0f3('0x11')](0x1f4,_0x1c07d8[_0xe0f3('0x12')]));});});};exports[_0xe0f3('0x37')]=function(_0x1ffd31){var _0x57ff6b=this;return new Promise(function(_0x44591a,_0x5a7906){return db['CmHopper'][_0xe0f3('0x38')]({'raw':_0x1ffd31[_0xe0f3('0x6')]?_0x1ffd31[_0xe0f3('0x6')][_0xe0f3('0x7')]===undefined?!![]:![]:!![],'where':_0x1ffd31[_0xe0f3('0x6')]?_0x1ffd31[_0xe0f3('0x6')][_0xe0f3('0x8')]||null:null,'attributes':[[db[_0xe0f3('0x34')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xe0f3('0x34')][_0xe0f3('0x39')](_0xe0f3('0x3a')+util[_0xe0f3('0x3b')]('\x22%s\x22',moment()[_0xe0f3('0x3b')](_0xe0f3('0x3c')))+_0xe0f3('0x3d')))),_0xe0f3('0x3e')]]})[_0xe0f3('0xe')](function(_0x44e115){logger['info'](_0xe0f3('0x37'),_0x1ffd31);logger[_0xe0f3('0xf')](_0xe0f3('0x37'),_0x1ffd31,JSON[_0xe0f3('0x1a')](_0x44e115));_0x44591a(_0x44e115);})[_0xe0f3('0x10')](function(_0x2606bb){logger[_0xe0f3('0x11')]('CountReScheduled',_0x2606bb[_0xe0f3('0x12')],_0x1ffd31);_0x5a7906(_0x57ff6b[_0xe0f3('0x11')](0x1f4,_0x2606bb['message']));});});};exports[_0xe0f3('0x3f')]=function(_0x547360){var _0x10ecfc=this;return new Promise(function(_0x16cfa7,_0x55cbb6){return db[_0xe0f3('0x21')][_0xe0f3('0x22')]()[_0xe0f3('0xe')](function(){return db['sequelize']['transaction'](function(_0x4f8dbf){return db[_0xe0f3('0x13')][_0xe0f3('0x38')]({'where':_0x547360[_0xe0f3('0x6')]?_0x547360['options'][_0xe0f3('0x8')]||null:null,'attributes':_0x547360[_0xe0f3('0x6')]?_0x547360['options'][_0xe0f3('0xd')]||null:null,'limit':0x1,'order':_0x547360['options']?_0x547360[_0xe0f3('0x6')][_0xe0f3('0x24')]||null:null,'group':db['CmHopper'][_0xe0f3('0x2d')],'transaction':_0x4f8dbf,'lock':_0x4f8dbf[_0xe0f3('0x25')][_0xe0f3('0x26')],'include':_0x547360[_0xe0f3('0x6')]?_0x547360[_0xe0f3('0x6')]['include']?_['map'](_0x547360[_0xe0f3('0x6')][_0xe0f3('0xa')],function(_0x58fd9f){return{'model':db[_0x58fd9f[_0xe0f3('0xc')]],'as':_0x58fd9f['as'],'attributes':_0x58fd9f[_0xe0f3('0xd')],'include':_0x58fd9f[_0xe0f3('0xa')]?_['map'](_0x58fd9f[_0xe0f3('0xa')],function(_0xb5eec){return{'model':db[_0xb5eec['model']],'as':_0xb5eec['as'],'attributes':_0xb5eec[_0xe0f3('0xd')],'include':_0xb5eec[_0xe0f3('0xa')]?_[_0xe0f3('0xb')](_0xb5eec[_0xe0f3('0xa')],function(_0x4c121c){return{'model':db[_0x4c121c[_0xe0f3('0xc')]],'as':_0x4c121c['as'],'attributes':_0x4c121c[_0xe0f3('0xd')]};}):[]};}):[]};}):[]:[]})[_0xe0f3('0xe')](function(_0x402411){var _0x1d2640=[];for(var _0x53f55e=0x0;_0x53f55e<_0x402411['length'];_0x53f55e+=0x1){_0x1d2640['push'](_0x402411[_0x53f55e][_0xe0f3('0x1c')](_0x547360['body'],{'transaction':_0x4f8dbf}));}return BPromise[_0xe0f3('0x30')](_0x1d2640);});})[_0xe0f3('0xe')](function(_0xf1c986){logger[_0xe0f3('0x19')](_0xe0f3('0x3f'),_0x547360);logger[_0xe0f3('0xf')](_0xe0f3('0x3f'),_0x547360,JSON[_0xe0f3('0x1a')](_0xf1c986));_0x16cfa7(_0xf1c986);})[_0xe0f3('0x10')](function(_0x1c3b84){logger[_0xe0f3('0x11')](_0xe0f3('0x3f'),_0x1c3b84[_0xe0f3('0x12')],_0x547360);_0x55cbb6(_0x10ecfc[_0xe0f3('0x11')](0x1f4,_0x1c3b84[_0xe0f3('0x12')]));});});});};exports[_0xe0f3('0x40')]=function(_0x55698d){var _0x94c0bd=this;return new Promise(function(_0x431c95,_0x2f1528){db['CmContact']['describe']()['then'](function(_0x2112a3){return db['CmHopper']['findAll']({'raw':_0x55698d[_0xe0f3('0x6')]?_0x55698d[_0xe0f3('0x6')][_0xe0f3('0x7')]===undefined?!![]:![]:!![],'where':_0x55698d[_0xe0f3('0x6')]?_0x55698d[_0xe0f3('0x6')]['where']||null:null,'attributes':_0x55698d['options']?_0x55698d[_0xe0f3('0x6')][_0xe0f3('0xd')]||null:null,'limit':_0x55698d[_0xe0f3('0x6')]?_0x55698d[_0xe0f3('0x6')]['limit']||null:null,'include':_0x55698d[_0xe0f3('0x6')]?_0x55698d[_0xe0f3('0x6')][_0xe0f3('0xa')]?_['map'](_0x55698d[_0xe0f3('0x6')]['include'],function(_0x173e99){return{'model':db[_0x173e99[_0xe0f3('0xc')]],'as':_0x173e99['as'],'attributes':_0x173e99['as']===_0xe0f3('0x27')?_[_0xe0f3('0x41')](_0x2112a3):_0x173e99[_0xe0f3('0xd')],'include':_0x173e99[_0xe0f3('0xa')]?_[_0xe0f3('0xb')](_0x173e99[_0xe0f3('0xa')],function(_0x43a510){return{'model':db[_0x43a510[_0xe0f3('0xc')]],'as':_0x43a510['as'],'attributes':_0x43a510[_0xe0f3('0xd')],'include':_0x43a510[_0xe0f3('0xa')]?_[_0xe0f3('0xb')](_0x43a510[_0xe0f3('0xa')],function(_0x35572f){return{'model':db[_0x35572f[_0xe0f3('0xc')]],'as':_0x35572f['as'],'attributes':_0x35572f[_0xe0f3('0xd')]};}):[]};}):[]};}):[]:[]})[_0xe0f3('0xe')](function(_0x4b7b72){logger[_0xe0f3('0x19')](_0xe0f3('0x5'),_0x55698d);logger['debug'](_0xe0f3('0x5'),_0x55698d,JSON[_0xe0f3('0x1a')](_0x4b7b72));_0x431c95(_0x4b7b72);})[_0xe0f3('0x10')](function(_0x1a567c){logger['error'](_0xe0f3('0x5'),_0x1a567c[_0xe0f3('0x12')],_0x55698d);_0x2f1528(_0x94c0bd[_0xe0f3('0x11')](0x1f4,_0x1a567c[_0xe0f3('0x12')]));});});});};exports['GetContactByPhone']=function(_0x48ca0a){var _0x384b6b=this;return new Promise(function(_0x539130,_0x28bab9){return db['CmContact']['findOne']({'raw':!![],'where':{'phone':_0x48ca0a[_0xe0f3('0x6')][_0xe0f3('0x8')][_0xe0f3('0x42')]},'attributes':['id','dialTimezone'],'order':[['id',_0xe0f3('0x43')]]})['then'](function(_0x509161){logger[_0xe0f3('0x19')]('getContactByPhone',_0x48ca0a);logger[_0xe0f3('0xf')](_0xe0f3('0x44'),_0x48ca0a,JSON[_0xe0f3('0x1a')](_0x509161));_0x539130(_0x509161);})[_0xe0f3('0x10')](function(_0x1889c5){logger[_0xe0f3('0x11')](_0xe0f3('0x44'),_0x1889c5[_0xe0f3('0x12')],_0x48ca0a);_0x28bab9(_0x384b6b[_0xe0f3('0x11')](0x1f4,_0x1889c5[_0xe0f3('0x12')]));});});};exports['ResetActiveCalls']=function(_0x498a1f){var _0x57d7b2=this;return new Promise(function(_0x52a7e0,_0x2e4118){return db[_0xe0f3('0x34')]['transaction'](function(_0x21cfe0){var _0x49f4c7=_0x498a1f['options']&&_0x498a1f['options'][_0xe0f3('0x8')]?_0x498a1f[_0xe0f3('0x6')]['where']:{};return db[_0xe0f3('0x13')]['update'](_0x498a1f[_0xe0f3('0x18')],{'where':_0x49f4c7,'transaction':_0x21cfe0})['then'](function(_0x1889b0){logger['info'](_0xe0f3('0x45'),_0x498a1f);logger['debug'](_0xe0f3('0x45'),_0x498a1f,JSON[_0xe0f3('0x1a')](_0x1889b0));_0x52a7e0(_0x1889b0);})['catch'](function(_0x26ed12){logger[_0xe0f3('0x11')](_0xe0f3('0x45'),_0x26ed12[_0xe0f3('0x12')],_0x498a1f);_0x2e4118(_0x57d7b2[_0xe0f3('0x11')](0x1f4,_0x26ed12[_0xe0f3('0x12')]));});});});};exports[_0xe0f3('0x46')]=function(_0xe6d384){var _0x1fef64=this;var _0x5ab5ab=_0xe6d384[_0xe0f3('0x18')][_0xe0f3('0x8')][_0xe0f3('0x47')];var _0x293e72=_0xe6d384['body']['where'][_0xe0f3('0x48')];var _0x3bb65e=_0xe6d384[_0xe0f3('0x18')][_0xe0f3('0x8')][_0xe0f3('0x49')];return new Promise(function(_0xc7314,_0x41d5de){return db[_0xe0f3('0x13')][_0xe0f3('0x38')]({'where':{'voiceQueueId':{'$in':_0x5ab5ab},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0xe0f3('0x34')]['literal'](_0xe0f3('0x4a')+_0x293e72+_0xe0f3('0x4b')),'$gt':db['sequelize'][_0xe0f3('0x39')](_0xe0f3('0x4c'))}},'UserId':{'$in':_0x3bb65e}},'include':[{'model':db[_0xe0f3('0x21')],'as':_0xe0f3('0x27')},{'model':db[_0xe0f3('0x28')],'as':_0xe0f3('0x29'),'attributes':['id',_0xe0f3('0x2a'),'voicePause']},{'model':db[_0xe0f3('0x4d')],'as':_0xe0f3('0x4e')}]})[_0xe0f3('0xe')](function(_0x3b28d9){if(_0x3b28d9[_0xe0f3('0x2c')]>0x0){return db[_0xe0f3('0x34')]['transaction'](function(_0x2e2a2b){return db[_0xe0f3('0x13')]['update']({'recallmeNotifiedDate':db[_0xe0f3('0x34')][_0xe0f3('0x39')]('NOW()')},{'where':{'id':{'$in':_[_0xe0f3('0xb')](_0x3b28d9,'id')}},'transaction':_0x2e2a2b})[_0xe0f3('0xe')](function(){_0xc7314(_0x3b28d9);})[_0xe0f3('0x10')](function(_0x2e43ff){logger['error']('CmHopperHandlePreviewRecallNotifications',_0x2e43ff[_0xe0f3('0x12')],_0xe6d384);_0x41d5de(_0x1fef64[_0xe0f3('0x11')](0x1f4,_0x2e43ff[_0xe0f3('0x12')]));});})['catch'](function(_0x55daf4){logger[_0xe0f3('0x11')](_0xe0f3('0x46'),_0x55daf4[_0xe0f3('0x12')],_0xe6d384);_0x41d5de(_0x1fef64[_0xe0f3('0x11')](0x1f4,_0x55daf4[_0xe0f3('0x12')]));});}else{_0xc7314(_0x3b28d9);}});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index 518b35f..1f07488 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 _0x446d=['getPreview','/timezone','getTimezone','put','update','delete','destroy','exports','express','Router','get','isAuthenticated','index','/describe','describe','/opencontacts','/timezones','getTimezones','/:id','show','post','/preview'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x446d,0xa2));var _0xd446=function(_0x2af3e1,_0xb5207f){_0x2af3e1=_0x2af3e1-0x0;var _0xfa27d=_0x446d[_0x2af3e1];return _0xfa27d;};'use strict';var express=require(_0xd446('0x0'));var router=express[_0xd446('0x1')]();var auth=require('../../components/auth/service');var controller=require('./cmHopper.controller');router[_0xd446('0x2')]('/',auth[_0xd446('0x3')](),controller[_0xd446('0x4')]);router['get'](_0xd446('0x5'),auth['isAuthenticated'](),controller[_0xd446('0x6')]);router[_0xd446('0x2')](_0xd446('0x7'),auth['isAuthenticated'](),controller['getOpenContacts']);router[_0xd446('0x2')](_0xd446('0x8'),auth[_0xd446('0x3')](),controller[_0xd446('0x9')]);router['get'](_0xd446('0xa'),auth[_0xd446('0x3')](),controller[_0xd446('0xb')]);router['get']('/:id/previewrecall',auth[_0xd446('0x3')](),controller['getPreviewRecall']);router[_0xd446('0xc')]('/',auth[_0xd446('0x3')](),controller['create']);router[_0xd446('0xc')](_0xd446('0xd'),auth['isAuthenticated'](),controller[_0xd446('0xe')]);router[_0xd446('0xc')](_0xd446('0xf'),auth[_0xd446('0x3')](),controller[_0xd446('0x10')]);router[_0xd446('0x11')]('/:id',auth[_0xd446('0x3')](),controller[_0xd446('0x12')]);router[_0xd446('0x13')](_0xd446('0xa'),auth[_0xd446('0x3')](),controller[_0xd446('0x14')]);module[_0xd446('0x15')]=router; \ No newline at end of file +var _0x7b0b=['get','isAuthenticated','index','/describe','describe','/opencontacts','/timezones','getTimezones','/:id','getPreviewRecall','post','getPreview','/timezone','update','delete','express','Router','../../components/auth/service','./cmHopper.controller'];(function(_0x2c1456,_0x2506c6){var _0x3bf6b8=function(_0x31087b){while(--_0x31087b){_0x2c1456['push'](_0x2c1456['shift']());}};_0x3bf6b8(++_0x2506c6);}(_0x7b0b,0x94));var _0xb7b0=function(_0x542579,_0x36de29){_0x542579=_0x542579-0x0;var _0x15e5ee=_0x7b0b[_0x542579];return _0x15e5ee;};'use strict';var express=require(_0xb7b0('0x0'));var router=express[_0xb7b0('0x1')]();var auth=require(_0xb7b0('0x2'));var controller=require(_0xb7b0('0x3'));router[_0xb7b0('0x4')]('/',auth[_0xb7b0('0x5')](),controller[_0xb7b0('0x6')]);router[_0xb7b0('0x4')](_0xb7b0('0x7'),auth[_0xb7b0('0x5')](),controller[_0xb7b0('0x8')]);router['get'](_0xb7b0('0x9'),auth['isAuthenticated'](),controller['getOpenContacts']);router[_0xb7b0('0x4')](_0xb7b0('0xa'),auth[_0xb7b0('0x5')](),controller[_0xb7b0('0xb')]);router[_0xb7b0('0x4')](_0xb7b0('0xc'),auth['isAuthenticated'](),controller['show']);router['get']('/:id/previewrecall',auth[_0xb7b0('0x5')](),controller[_0xb7b0('0xd')]);router[_0xb7b0('0xe')]('/',auth[_0xb7b0('0x5')](),controller['create']);router['post']('/preview',auth['isAuthenticated'](),controller[_0xb7b0('0xf')]);router[_0xb7b0('0xe')](_0xb7b0('0x10'),auth[_0xb7b0('0x5')](),controller['getTimezone']);router['put'](_0xb7b0('0xc'),auth[_0xb7b0('0x5')](),controller[_0xb7b0('0x11')]);router[_0xb7b0('0x12')](_0xb7b0('0xc'),auth[_0xb7b0('0x5')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js index 3a5fa60..63c0297 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 _0x2159=['DATE','format','YYYY-MM-DD\x20HH:mm:ss','moment','sequelize','exports','INTEGER'];(function(_0x201740,_0x3de1f0){var _0x5b62a1=function(_0x532b0f){while(--_0x532b0f){_0x201740['push'](_0x201740['shift']());}};_0x5b62a1(++_0x3de1f0);}(_0x2159,0xff));var _0x9215=function(_0x5d43f5,_0x8c9030){_0x5d43f5=_0x5d43f5-0x0;var _0x453144=_0x2159[_0x5d43f5];return _0x453144;};'use strict';var moment=require(_0x9215('0x0'));var Sequelize=require(_0x9215('0x1'));module[_0x9215('0x2')]={'CmHopperId':{'type':Sequelize[_0x9215('0x3')]},'phone':{'type':Sequelize['STRING'],'allowNull':![]},'OrderBy':{'type':Sequelize[_0x9215('0x3')],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0x9215('0x4')],'defaultValue':moment()[_0x9215('0x5')](_0x9215('0x6'))},'countbusyretry':{'type':Sequelize[_0x9215('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x9215('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x9215('0x3')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0x9215('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x9215('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x9215('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x9215('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x0c06=['INTEGER','STRING','DATE','format','YYYY-MM-DD\x20HH:mm:ss','moment','sequelize','exports'];(function(_0x31a938,_0x4daec6){var _0x1bf341=function(_0x514261){while(--_0x514261){_0x31a938['push'](_0x31a938['shift']());}};_0x1bf341(++_0x4daec6);}(_0x0c06,0xe5));var _0x60c0=function(_0x1c77ca,_0x4b5694){_0x1c77ca=_0x1c77ca-0x0;var _0x2a32a0=_0x0c06[_0x1c77ca];return _0x2a32a0;};'use strict';var moment=require(_0x60c0('0x0'));var Sequelize=require(_0x60c0('0x1'));module[_0x60c0('0x2')]={'CmHopperId':{'type':Sequelize[_0x60c0('0x3')]},'phone':{'type':Sequelize[_0x60c0('0x4')],'allowNull':![]},'OrderBy':{'type':Sequelize[_0x60c0('0x3')],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0x60c0('0x5')],'defaultValue':moment()[_0x60c0('0x6')](_0x60c0('0x7'))},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0x60c0('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x60c0('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x60c0('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x60c0('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js index a69f297..10c0d57 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 _0x5b16=['filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','rows','catch','params','rawAttributes','find','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','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','CmHopperAdditionalPhones','end','sendStatus','stack','name','send','index','map','CmHopperAdditionalPhone','fieldName','type','key','model','query','keys'];(function(_0x342baa,_0x4a110f){var _0x1208f3=function(_0x56a645){while(--_0x56a645){_0x342baa['push'](_0x342baa['shift']());}};_0x1208f3(++_0x4a110f);}(_0x5b16,0x77));var _0x65b1=function(_0x231e16,_0x67347b){_0x231e16=_0x231e16-0x0;var _0x570a7c=_0x5b16[_0x231e16];return _0x570a7c;};'use strict';var emlformat=require(_0x65b1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x65b1('0x1'));var jsonpatch=require(_0x65b1('0x2'));var rp=require('request-promise');var moment=require(_0x65b1('0x3'));var BPromise=require(_0x65b1('0x4'));var Mustache=require('mustache');var util=require(_0x65b1('0x5'));var path=require(_0x65b1('0x6'));var sox=require(_0x65b1('0x7'));var csv=require(_0x65b1('0x8'));var ejs=require(_0x65b1('0x9'));var fs=require('fs');var fs_extra=require(_0x65b1('0xa'));var _=require(_0x65b1('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x65b1('0xc'));var deskjs=require(_0x65b1('0xd'));var toCsv=require(_0x65b1('0x8'));var querystring=require('querystring');var Papa=require(_0x65b1('0xe'));var Redis=require(_0x65b1('0xf'));var authService=require(_0x65b1('0x10'));var qs=require(_0x65b1('0x11'));var as=require(_0x65b1('0x12'));var hardwareService=require(_0x65b1('0x13'));var logger=require(_0x65b1('0x14'))(_0x65b1('0x15'));var utils=require(_0x65b1('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x65b1('0x17'));var db=require(_0x65b1('0x18'))['db'];function respondWithStatusCode(_0x563148,_0x1dfc2c){_0x1dfc2c=_0x1dfc2c||0xcc;return function(_0x5a760a){if(_0x5a760a){return _0x563148['sendStatus'](_0x1dfc2c);}return _0x563148[_0x65b1('0x19')](_0x1dfc2c)['end']();};}function respondWithResult(_0x3e4330,_0x10bcae){_0x10bcae=_0x10bcae||0xc8;return function(_0x52b5a2){if(_0x52b5a2){return _0x3e4330[_0x65b1('0x19')](_0x10bcae)[_0x65b1('0x1a')](_0x52b5a2);}};}function respondWithFilteredResult(_0x3e0dd9,_0x4c2ce0){return function(_0xe66326){if(_0xe66326){var _0x192b7e=typeof _0x4c2ce0['offset']===_0x65b1('0x1b')&&typeof _0x4c2ce0[_0x65b1('0x1c')]===_0x65b1('0x1b');var _0x2b66be=_0xe66326[_0x65b1('0x1d')];var _0x348757=_0x192b7e?0x0:_0x4c2ce0[_0x65b1('0x1e')];var _0x293344=_0x192b7e?_0xe66326['count']:_0x4c2ce0[_0x65b1('0x1e')]+_0x4c2ce0[_0x65b1('0x1c')];var _0x584b0d;if(_0x293344>=_0x2b66be){_0x293344=_0x2b66be;_0x584b0d=0xc8;}else{_0x584b0d=0xce;}_0x3e0dd9[_0x65b1('0x19')](_0x584b0d);return _0x3e0dd9[_0x65b1('0x1f')](_0x65b1('0x20'),_0x348757+'-'+_0x293344+'/'+_0x2b66be)[_0x65b1('0x1a')](_0xe66326);}return null;};}function patchUpdates(_0x8c1327){return function(_0x56fe13){try{jsonpatch[_0x65b1('0x21')](_0x56fe13,_0x8c1327,!![]);}catch(_0x28de90){return BPromise[_0x65b1('0x22')](_0x28de90);}return _0x56fe13[_0x65b1('0x23')]();};}function saveUpdates(_0x1a313f,_0x10091e){return function(_0x561f59){if(_0x561f59){return _0x561f59[_0x65b1('0x24')](_0x1a313f)[_0x65b1('0x25')](function(_0x5c2ce8){return _0x5c2ce8;});}return null;};}function removeEntity(_0x1e7ca9,_0x3dfa18){return function(_0x26fd52){if(_0x26fd52){return _0x26fd52[_0x65b1('0x26')]()['then'](function(){var _0x366034=_0x26fd52[_0x65b1('0x27')]({'plain':!![]});var _0x49552f=_0x65b1('0x28');return db['UserProfileResource'][_0x65b1('0x26')]({'where':{'type':_0x49552f,'resourceId':_0x366034['id']}})[_0x65b1('0x25')](function(){return _0x26fd52;});})[_0x65b1('0x25')](function(){_0x1e7ca9[_0x65b1('0x19')](0xcc)[_0x65b1('0x29')]();});}};}function handleEntityNotFound(_0x4cb791,_0x32ce65){return function(_0x542c03){if(!_0x542c03){_0x4cb791[_0x65b1('0x2a')](0x194);}return _0x542c03;};}function handleError(_0x2e5862,_0x228849){_0x228849=_0x228849||0x1f4;return function(_0x36e3a5){logger['error'](_0x36e3a5[_0x65b1('0x2b')]);if(_0x36e3a5[_0x65b1('0x2c')]){delete _0x36e3a5[_0x65b1('0x2c')];}_0x2e5862['status'](_0x228849)[_0x65b1('0x2d')](_0x36e3a5);};}exports[_0x65b1('0x2e')]=function(_0x4e6781,_0x56b75d){var _0x9bdea0={},_0x3c41ba={},_0x4b769f={'count':0x0,'rows':[]};var _0x7d433=_[_0x65b1('0x2f')](db[_0x65b1('0x30')]['rawAttributes'],function(_0x3aa98a){return{'name':_0x3aa98a[_0x65b1('0x31')],'type':_0x3aa98a[_0x65b1('0x32')][_0x65b1('0x33')]};});_0x3c41ba[_0x65b1('0x34')]=_[_0x65b1('0x2f')](_0x7d433,'name');_0x3c41ba[_0x65b1('0x35')]=_[_0x65b1('0x36')](_0x4e6781[_0x65b1('0x35')]);_0x3c41ba[_0x65b1('0x37')]=_[_0x65b1('0x38')](_0x3c41ba[_0x65b1('0x34')],_0x3c41ba['query']);_0x9bdea0[_0x65b1('0x39')]=_[_0x65b1('0x38')](_0x3c41ba[_0x65b1('0x34')],qs[_0x65b1('0x3a')](_0x4e6781[_0x65b1('0x35')][_0x65b1('0x3a')]));_0x9bdea0[_0x65b1('0x39')]=_0x9bdea0[_0x65b1('0x39')][_0x65b1('0x3b')]?_0x9bdea0[_0x65b1('0x39')]:_0x3c41ba[_0x65b1('0x34')];if(!_0x4e6781[_0x65b1('0x35')][_0x65b1('0x3c')](_0x65b1('0x3d'))){_0x9bdea0[_0x65b1('0x1c')]=qs[_0x65b1('0x1c')](_0x4e6781['query']['limit']);_0x9bdea0[_0x65b1('0x1e')]=qs['offset'](_0x4e6781[_0x65b1('0x35')][_0x65b1('0x1e')]);}_0x9bdea0[_0x65b1('0x3e')]=qs[_0x65b1('0x3f')](_0x4e6781[_0x65b1('0x35')]['sort']);_0x9bdea0[_0x65b1('0x40')]=qs[_0x65b1('0x37')](_[_0x65b1('0x41')](_0x4e6781[_0x65b1('0x35')],_0x3c41ba[_0x65b1('0x37')]),_0x7d433);if(_0x4e6781[_0x65b1('0x35')][_0x65b1('0x42')]){_0x9bdea0[_0x65b1('0x40')]=_['merge'](_0x9bdea0['where'],{'$or':_['map'](_0x7d433,function(_0x12f556){if(_0x12f556['type']!=='VIRTUAL'){var _0x523f2c={};_0x523f2c[_0x12f556['name']]={'$like':'%'+_0x4e6781[_0x65b1('0x35')][_0x65b1('0x42')]+'%'};return _0x523f2c;}})});}_0x9bdea0=_[_0x65b1('0x43')]({},_0x9bdea0,_0x4e6781[_0x65b1('0x44')]);var _0x9dc22e={'where':_0x9bdea0[_0x65b1('0x40')]};return db[_0x65b1('0x30')]['count'](_0x9dc22e)[_0x65b1('0x25')](function(_0x528b90){_0x4b769f['count']=_0x528b90;if(_0x4e6781['query'][_0x65b1('0x45')]){_0x9bdea0[_0x65b1('0x46')]=[{'all':!![]}];}return db[_0x65b1('0x30')]['findAll'](_0x9bdea0);})[_0x65b1('0x25')](function(_0x307338){_0x4b769f[_0x65b1('0x47')]=_0x307338;return _0x4b769f;})[_0x65b1('0x25')](respondWithFilteredResult(_0x56b75d,_0x9bdea0))[_0x65b1('0x48')](handleError(_0x56b75d,null));};exports['show']=function(_0x5e55dd,_0x4b25e8){var _0x10248e={'raw':!![],'where':{'id':_0x5e55dd[_0x65b1('0x49')]['id']}},_0x53264e={};_0x53264e[_0x65b1('0x34')]=_[_0x65b1('0x36')](db[_0x65b1('0x30')][_0x65b1('0x4a')]);_0x53264e[_0x65b1('0x35')]=_[_0x65b1('0x36')](_0x5e55dd['query']);_0x53264e[_0x65b1('0x37')]=_[_0x65b1('0x38')](_0x53264e[_0x65b1('0x34')],_0x53264e[_0x65b1('0x35')]);_0x10248e[_0x65b1('0x39')]=_[_0x65b1('0x38')](_0x53264e[_0x65b1('0x34')],qs[_0x65b1('0x3a')](_0x5e55dd[_0x65b1('0x35')][_0x65b1('0x3a')]));_0x10248e[_0x65b1('0x39')]=_0x10248e[_0x65b1('0x39')]['length']?_0x10248e[_0x65b1('0x39')]:_0x53264e['model'];if(_0x5e55dd[_0x65b1('0x35')]['includeAll']){_0x10248e[_0x65b1('0x46')]=[{'all':!![]}];}_0x10248e=_[_0x65b1('0x43')]({},_0x10248e,_0x5e55dd[_0x65b1('0x44')]);return db['CmHopperAdditionalPhone'][_0x65b1('0x4b')](_0x10248e)[_0x65b1('0x25')](handleEntityNotFound(_0x4b25e8,null))[_0x65b1('0x25')](respondWithResult(_0x4b25e8,null))[_0x65b1('0x48')](handleError(_0x4b25e8,null));};exports[_0x65b1('0x4c')]=function(_0x7e2c43,_0x52768a){return db[_0x65b1('0x30')]['create'](_0x7e2c43[_0x65b1('0x4d')],{})['then'](function(_0x4f6b65){var _0x532f5b=_0x7e2c43[_0x65b1('0x4e')][_0x65b1('0x27')]({'plain':!![]});if(!_0x532f5b)throw new Error(_0x65b1('0x4f'));if(_0x532f5b[_0x65b1('0x50')]==='user'){var _0x1c9309=_0x4f6b65['get']({'plain':!![]});var _0x17c88d=_0x65b1('0x28');return db[_0x65b1('0x51')][_0x65b1('0x4b')]({'where':{'name':_0x17c88d,'userProfileId':_0x532f5b[_0x65b1('0x52')]},'raw':!![]})[_0x65b1('0x25')](function(_0x5efdbe){if(_0x5efdbe&&_0x5efdbe[_0x65b1('0x53')]===0x0){return db[_0x65b1('0x54')][_0x65b1('0x4c')]({'name':_0x1c9309[_0x65b1('0x2c')],'resourceId':_0x1c9309['id'],'type':_0x5efdbe[_0x65b1('0x2c')],'sectionId':_0x5efdbe['id']},{})[_0x65b1('0x25')](function(){return _0x4f6b65;});}else{return _0x4f6b65;}})[_0x65b1('0x48')](function(_0x49d5e2){logger[_0x65b1('0x55')](_0x65b1('0x56'),_0x49d5e2);throw _0x49d5e2;});}return _0x4f6b65;})[_0x65b1('0x25')](respondWithResult(_0x52768a,0xc9))[_0x65b1('0x48')](handleError(_0x52768a,null));};exports[_0x65b1('0x24')]=function(_0x33fa50,_0x29a342){if(_0x33fa50[_0x65b1('0x4d')]['id']){delete _0x33fa50[_0x65b1('0x4d')]['id'];}return db[_0x65b1('0x30')]['find']({'where':{'id':_0x33fa50[_0x65b1('0x49')]['id']}})[_0x65b1('0x25')](handleEntityNotFound(_0x29a342,null))[_0x65b1('0x25')](saveUpdates(_0x33fa50['body'],null))[_0x65b1('0x25')](respondWithResult(_0x29a342,null))[_0x65b1('0x48')](handleError(_0x29a342,null));};exports['destroy']=function(_0x5a59fa,_0x568c42){return db[_0x65b1('0x30')][_0x65b1('0x4b')]({'where':{'id':_0x5a59fa[_0x65b1('0x49')]['id']}})[_0x65b1('0x25')](handleEntityNotFound(_0x568c42,null))[_0x65b1('0x25')](removeEntity(_0x568c42,null))[_0x65b1('0x48')](handleError(_0x568c42,null));}; \ No newline at end of file +var _0xdfff=['model','fields','attributes','hasOwnProperty','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','length','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','CmHopperAdditionalPhones','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','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','apply','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','map','CmHopperAdditionalPhone','rawAttributes','fieldName','key','query','keys','filters','intersection'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0xdfff,0x171));var _0xfdff=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdfff[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfdff('0x0'));var zipdir=require(_0xfdff('0x1'));var jsonpatch=require(_0xfdff('0x2'));var rp=require('request-promise');var moment=require(_0xfdff('0x3'));var BPromise=require(_0xfdff('0x4'));var Mustache=require('mustache');var util=require(_0xfdff('0x5'));var path=require(_0xfdff('0x6'));var sox=require(_0xfdff('0x7'));var csv=require(_0xfdff('0x8'));var ejs=require(_0xfdff('0x9'));var fs=require('fs');var fs_extra=require(_0xfdff('0xa'));var _=require(_0xfdff('0xb'));var squel=require(_0xfdff('0xc'));var crypto=require(_0xfdff('0xd'));var jsforce=require(_0xfdff('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xfdff('0xf'));var Papa=require(_0xfdff('0x10'));var Redis=require(_0xfdff('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xfdff('0x12'));var as=require(_0xfdff('0x13'));var hardwareService=require(_0xfdff('0x14'));var logger=require(_0xfdff('0x15'))(_0xfdff('0x16'));var utils=require(_0xfdff('0x17'));var config=require(_0xfdff('0x18'));var licenseUtil=require(_0xfdff('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x265138,_0x1f9ffb){_0x1f9ffb=_0x1f9ffb||0xcc;return function(_0x28228a){if(_0x28228a){return _0x265138[_0xfdff('0x1a')](_0x1f9ffb);}return _0x265138[_0xfdff('0x1b')](_0x1f9ffb)[_0xfdff('0x1c')]();};}function respondWithResult(_0x4671df,_0xfa6065){_0xfa6065=_0xfa6065||0xc8;return function(_0x50e32d){if(_0x50e32d){return _0x4671df[_0xfdff('0x1b')](_0xfa6065)[_0xfdff('0x1d')](_0x50e32d);}};}function respondWithFilteredResult(_0x270606,_0x544d02){return function(_0x297445){if(_0x297445){var _0x3d94fb=typeof _0x544d02[_0xfdff('0x1e')]===_0xfdff('0x1f')&&typeof _0x544d02[_0xfdff('0x20')]===_0xfdff('0x1f');var _0x5f152e=_0x297445['count'];var _0x56c01b=_0x3d94fb?0x0:_0x544d02[_0xfdff('0x1e')];var _0x42dce8=_0x3d94fb?_0x297445[_0xfdff('0x21')]:_0x544d02[_0xfdff('0x1e')]+_0x544d02[_0xfdff('0x20')];var _0x7418fa;if(_0x42dce8>=_0x5f152e){_0x42dce8=_0x5f152e;_0x7418fa=0xc8;}else{_0x7418fa=0xce;}_0x270606[_0xfdff('0x1b')](_0x7418fa);return _0x270606[_0xfdff('0x22')]('Content-Range',_0x56c01b+'-'+_0x42dce8+'/'+_0x5f152e)[_0xfdff('0x1d')](_0x297445);}return null;};}function patchUpdates(_0xaf4acd){return function(_0x4792d2){try{jsonpatch[_0xfdff('0x23')](_0x4792d2,_0xaf4acd,!![]);}catch(_0x30e0c0){return BPromise[_0xfdff('0x24')](_0x30e0c0);}return _0x4792d2[_0xfdff('0x25')]();};}function saveUpdates(_0x555f5d,_0x4c5c62){return function(_0x54d5d0){if(_0x54d5d0){return _0x54d5d0[_0xfdff('0x26')](_0x555f5d)[_0xfdff('0x27')](function(_0x3a57eb){return _0x3a57eb;});}return null;};}function removeEntity(_0x57f27d,_0x1670c2){return function(_0x1fe65b){if(_0x1fe65b){return _0x1fe65b[_0xfdff('0x28')]()[_0xfdff('0x27')](function(){var _0x1d3656=_0x1fe65b[_0xfdff('0x29')]({'plain':!![]});var _0x1d23bf='CmHopperAdditionalPhones';return db[_0xfdff('0x2a')][_0xfdff('0x28')]({'where':{'type':_0x1d23bf,'resourceId':_0x1d3656['id']}})['then'](function(){return _0x1fe65b;});})[_0xfdff('0x27')](function(){_0x57f27d[_0xfdff('0x1b')](0xcc)[_0xfdff('0x1c')]();});}};}function handleEntityNotFound(_0x41bae0,_0x1afb66){return function(_0x4f58e7){if(!_0x4f58e7){_0x41bae0['sendStatus'](0x194);}return _0x4f58e7;};}function handleError(_0x1385ec,_0xb89f4f){_0xb89f4f=_0xb89f4f||0x1f4;return function(_0x2bbc9b){logger[_0xfdff('0x2b')](_0x2bbc9b[_0xfdff('0x2c')]);if(_0x2bbc9b['name']){delete _0x2bbc9b[_0xfdff('0x2d')];}_0x1385ec[_0xfdff('0x1b')](_0xb89f4f)[_0xfdff('0x2e')](_0x2bbc9b);};}exports['index']=function(_0x36758e,_0x8a839){var _0x6e084f={},_0x48034b={},_0x4ed074={'count':0x0,'rows':[]};var _0x3bd6e4=_[_0xfdff('0x2f')](db[_0xfdff('0x30')][_0xfdff('0x31')],function(_0xb142a6){return{'name':_0xb142a6[_0xfdff('0x32')],'type':_0xb142a6['type'][_0xfdff('0x33')]};});_0x48034b['model']=_[_0xfdff('0x2f')](_0x3bd6e4,_0xfdff('0x2d'));_0x48034b[_0xfdff('0x34')]=_[_0xfdff('0x35')](_0x36758e[_0xfdff('0x34')]);_0x48034b[_0xfdff('0x36')]=_[_0xfdff('0x37')](_0x48034b['model'],_0x48034b[_0xfdff('0x34')]);_0x6e084f['attributes']=_[_0xfdff('0x37')](_0x48034b[_0xfdff('0x38')],qs['fields'](_0x36758e['query'][_0xfdff('0x39')]));_0x6e084f['attributes']=_0x6e084f[_0xfdff('0x3a')]['length']?_0x6e084f[_0xfdff('0x3a')]:_0x48034b[_0xfdff('0x38')];if(!_0x36758e['query'][_0xfdff('0x3b')]('nolimit')){_0x6e084f['limit']=qs['limit'](_0x36758e[_0xfdff('0x34')]['limit']);_0x6e084f[_0xfdff('0x1e')]=qs['offset'](_0x36758e['query'][_0xfdff('0x1e')]);}_0x6e084f['order']=qs[_0xfdff('0x3c')](_0x36758e[_0xfdff('0x34')][_0xfdff('0x3c')]);_0x6e084f[_0xfdff('0x3d')]=qs[_0xfdff('0x36')](_['pick'](_0x36758e[_0xfdff('0x34')],_0x48034b[_0xfdff('0x36')]),_0x3bd6e4);if(_0x36758e[_0xfdff('0x34')][_0xfdff('0x3e')]){_0x6e084f[_0xfdff('0x3d')]=_[_0xfdff('0x3f')](_0x6e084f['where'],{'$or':_[_0xfdff('0x2f')](_0x3bd6e4,function(_0x5774a3){if(_0x5774a3['type']!==_0xfdff('0x40')){var _0x9cc3db={};_0x9cc3db[_0x5774a3[_0xfdff('0x2d')]]={'$like':'%'+_0x36758e[_0xfdff('0x34')]['filter']+'%'};return _0x9cc3db;}})});}_0x6e084f=_[_0xfdff('0x3f')]({},_0x6e084f,_0x36758e['options']);var _0x21494e={'where':_0x6e084f[_0xfdff('0x3d')]};return db['CmHopperAdditionalPhone'][_0xfdff('0x21')](_0x21494e)['then'](function(_0x1fef8b){_0x4ed074[_0xfdff('0x21')]=_0x1fef8b;if(_0x36758e[_0xfdff('0x34')][_0xfdff('0x41')]){_0x6e084f[_0xfdff('0x42')]=[{'all':!![]}];}return db['CmHopperAdditionalPhone'][_0xfdff('0x43')](_0x6e084f);})[_0xfdff('0x27')](function(_0x428965){_0x4ed074[_0xfdff('0x44')]=_0x428965;return _0x4ed074;})[_0xfdff('0x27')](respondWithFilteredResult(_0x8a839,_0x6e084f))[_0xfdff('0x45')](handleError(_0x8a839,null));};exports[_0xfdff('0x46')]=function(_0x193972,_0x3362a3){var _0x30d01a={'raw':!![],'where':{'id':_0x193972[_0xfdff('0x47')]['id']}},_0x5b6498={};_0x5b6498['model']=_['keys'](db[_0xfdff('0x30')]['rawAttributes']);_0x5b6498['query']=_[_0xfdff('0x35')](_0x193972['query']);_0x5b6498[_0xfdff('0x36')]=_['intersection'](_0x5b6498[_0xfdff('0x38')],_0x5b6498[_0xfdff('0x34')]);_0x30d01a[_0xfdff('0x3a')]=_['intersection'](_0x5b6498[_0xfdff('0x38')],qs['fields'](_0x193972[_0xfdff('0x34')][_0xfdff('0x39')]));_0x30d01a['attributes']=_0x30d01a['attributes'][_0xfdff('0x48')]?_0x30d01a['attributes']:_0x5b6498['model'];if(_0x193972[_0xfdff('0x34')][_0xfdff('0x41')]){_0x30d01a[_0xfdff('0x42')]=[{'all':!![]}];}_0x30d01a=_[_0xfdff('0x3f')]({},_0x30d01a,_0x193972[_0xfdff('0x49')]);return db[_0xfdff('0x30')]['find'](_0x30d01a)[_0xfdff('0x27')](handleEntityNotFound(_0x3362a3,null))[_0xfdff('0x27')](respondWithResult(_0x3362a3,null))[_0xfdff('0x45')](handleError(_0x3362a3,null));};exports[_0xfdff('0x4a')]=function(_0x55a1e9,_0x33b438){return db[_0xfdff('0x30')][_0xfdff('0x4a')](_0x55a1e9[_0xfdff('0x4b')],{})['then'](function(_0x1cc587){var _0x3ecdd9=_0x55a1e9[_0xfdff('0x4c')]['get']({'plain':!![]});if(!_0x3ecdd9)throw new Error(_0xfdff('0x4d'));if(_0x3ecdd9[_0xfdff('0x4e')]===_0xfdff('0x4c')){var _0x9eff6e=_0x1cc587[_0xfdff('0x29')]({'plain':!![]});var _0x4c5720=_0xfdff('0x4f');return db[_0xfdff('0x50')][_0xfdff('0x51')]({'where':{'name':_0x4c5720,'userProfileId':_0x3ecdd9[_0xfdff('0x52')]},'raw':!![]})['then'](function(_0x2981f9){if(_0x2981f9&&_0x2981f9[_0xfdff('0x53')]===0x0){return db[_0xfdff('0x2a')][_0xfdff('0x4a')]({'name':_0x9eff6e[_0xfdff('0x2d')],'resourceId':_0x9eff6e['id'],'type':_0x2981f9[_0xfdff('0x2d')],'sectionId':_0x2981f9['id']},{})[_0xfdff('0x27')](function(){return _0x1cc587;});}else{return _0x1cc587;}})[_0xfdff('0x45')](function(_0x3e336f){logger[_0xfdff('0x2b')](_0xfdff('0x54'),_0x3e336f);throw _0x3e336f;});}return _0x1cc587;})[_0xfdff('0x27')](respondWithResult(_0x33b438,0xc9))[_0xfdff('0x45')](handleError(_0x33b438,null));};exports[_0xfdff('0x26')]=function(_0x486f08,_0x55fae7){if(_0x486f08['body']['id']){delete _0x486f08['body']['id'];}return db[_0xfdff('0x30')][_0xfdff('0x51')]({'where':{'id':_0x486f08[_0xfdff('0x47')]['id']}})[_0xfdff('0x27')](handleEntityNotFound(_0x55fae7,null))[_0xfdff('0x27')](saveUpdates(_0x486f08[_0xfdff('0x4b')],null))['then'](respondWithResult(_0x55fae7,null))[_0xfdff('0x45')](handleError(_0x55fae7,null));};exports[_0xfdff('0x28')]=function(_0x4211c6,_0x5f48d9){return db[_0xfdff('0x30')]['find']({'where':{'id':_0x4211c6[_0xfdff('0x47')]['id']}})[_0xfdff('0x27')](handleEntityNotFound(_0x5f48d9,null))[_0xfdff('0x27')](removeEntity(_0x5f48d9,null))[_0xfdff('0x45')](handleError(_0x5f48d9,null));}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js index 2f14f16..5b7d245 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 _0xadae=['lodash','util','../../config/logger','../../config/environment','exports','CmHopperAdditionalPhone','cm_hopper_additional_phones'];(function(_0x5ecc4b,_0x5a58a0){var _0x233dc6=function(_0x5b97e4){while(--_0x5b97e4){_0x5ecc4b['push'](_0x5ecc4b['shift']());}};_0x233dc6(++_0x5a58a0);}(_0xadae,0x134));var _0xeada=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xadae[_0x2763f2];return _0x3ef471;};'use strict';var _=require(_0xeada('0x0'));var util=require(_0xeada('0x1'));var logger=require(_0xeada('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xeada('0x3'));var attributes=require('./cmHopperAdditionalPhone.attributes');module[_0xeada('0x4')]=function(_0x5ef766,_0x5967e6){return _0x5ef766['define'](_0xeada('0x5'),attributes,{'tableName':_0xeada('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc457=['../../config/environment','./cmHopperAdditionalPhone.attributes','exports','cm_hopper_additional_phones','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x2cd6c9,_0xe6598){var _0x11ad0f=function(_0x1adf72){while(--_0x1adf72){_0x2cd6c9['push'](_0x2cd6c9['shift']());}};_0x11ad0f(++_0xe6598);}(_0xc457,0x190));var _0x7c45=function(_0x37796c,_0x1d45cd){_0x37796c=_0x37796c-0x0;var _0x524160=_0xc457[_0x37796c];return _0x524160;};'use strict';var _=require(_0x7c45('0x0'));var util=require(_0x7c45('0x1'));var logger=require(_0x7c45('0x2'))(_0x7c45('0x3'));var moment=require('moment');var BPromise=require(_0x7c45('0x4'));var rp=require(_0x7c45('0x5'));var fs=require('fs');var path=require(_0x7c45('0x6'));var rimraf=require(_0x7c45('0x7'));var config=require(_0x7c45('0x8'));var attributes=require(_0x7c45('0x9'));module[_0x7c45('0xa')]=function(_0x3b9519,_0x6f5f01){return _0x3b9519['define']('CmHopperAdditionalPhone',attributes,{'tableName':_0x7c45('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 08818b3..10b0997 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 _0xd139=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','info','CmHopperAdditionalPhone,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','VerifyAdditionalPhones','CmHopper','findOne','ContactId','body','ListId','CampaignId','then','CmHopperAdditionalPhone','OrderBy','ASC','countbusyretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','entity','dialGlobalMaxRetry','countcongestionretry','VoiceQueueId','duration','waitTime','isNil','scheduledat','add','minutes','phone','updatedAt','createdAt','sequelize','transaction','IncrementPreviewCounters','update','field','lodash','util'];(function(_0x43a625,_0x1a7f74){var _0x581656=function(_0x4aa76c){while(--_0x4aa76c){_0x43a625['push'](_0x43a625['shift']());}};_0x581656(++_0x1a7f74);}(_0xd139,0x14e));var _0x9d13=function(_0x414641,_0x20af11){_0x414641=_0x414641-0x0;var _0xbb293=_0xd139[_0x414641];return _0xbb293;};'use strict';var _=require(_0x9d13('0x0'));var util=require(_0x9d13('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x9d13('0x2'));var fs=require('fs');var Redis=require(_0x9d13('0x3'));var db=require(_0x9d13('0x4'))['db'];var utils=require(_0x9d13('0x5'));var logger=require(_0x9d13('0x6'))(_0x9d13('0x7'));var config=require(_0x9d13('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x9d13('0x9')][_0x9d13('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x50294b,_0x198d7d,_0x4b3db0){return new BPromise(function(_0x434ef6,_0x524947){return client['request'](_0x50294b,_0x4b3db0)['then'](function(_0x3ccdf9){logger[_0x9d13('0xb')](_0x9d13('0xc'),_0x198d7d,_0x9d13('0xd'));logger[_0x9d13('0xe')]('CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s',_0x198d7d,_0x9d13('0xd'),JSON[_0x9d13('0xf')](_0x3ccdf9));if(_0x3ccdf9[_0x9d13('0x10')]){if(_0x3ccdf9['error']['code']===0x1f4){logger[_0x9d13('0x10')](_0x9d13('0xc'),_0x198d7d,_0x3ccdf9[_0x9d13('0x10')][_0x9d13('0x11')]);return _0x524947(_0x3ccdf9[_0x9d13('0x10')]['message']);}logger['error'](_0x9d13('0xc'),_0x198d7d,_0x3ccdf9[_0x9d13('0x10')][_0x9d13('0x11')]);return _0x434ef6(_0x3ccdf9[_0x9d13('0x10')][_0x9d13('0x11')]);}else{logger[_0x9d13('0xb')](_0x9d13('0xc'),_0x198d7d,'request\x20sent');_0x434ef6(_0x3ccdf9[_0x9d13('0x12')][_0x9d13('0x11')]);}})[_0x9d13('0x13')](function(_0x250234){logger[_0x9d13('0x10')](_0x9d13('0xc'),_0x198d7d,_0x250234);_0x524947(_0x250234);});});}exports[_0x9d13('0x14')]=function(_0x10aa89){var _0x45a07a=this;return new Promise(function(_0x2acb0b,_0xa1de89){return db[_0x9d13('0x15')][_0x9d13('0x16')]({'raw':!![],'where':{'ContactId':_0x10aa89['body'][_0x9d13('0x17')],'ListId':_0x10aa89[_0x9d13('0x18')][_0x9d13('0x19')],'VoiceQueueId':_0x10aa89[_0x9d13('0x18')]['VoiceQueueId']===undefined?null:_0x10aa89['body']['VoiceQueueId'],'CampaignId':_0x10aa89[_0x9d13('0x18')][_0x9d13('0x1a')]===undefined?null:_0x10aa89[_0x9d13('0x18')][_0x9d13('0x1a')]}})[_0x9d13('0x1b')](function(_0x3040e7){if(_0x3040e7!=null){return db[_0x9d13('0x1c')][_0x9d13('0x16')]({'raw':!![],'where':{'CmHopperId':_0x3040e7['id'],'OrderBy':{'$gt':_0x3040e7['OrderBy']}},'order':[[_0x9d13('0x1d'),_0x9d13('0x1e')]]})[_0x9d13('0x1b')](function(_0x21999c){var _0x517003=0x0;if(_0x21999c){if(_0x21999c[_0x9d13('0x1f')]+_0x21999c['countcongestionretry']+_0x21999c[_0x9d13('0x20')]+_0x21999c[_0x9d13('0x21')]+_0x21999c[_0x9d13('0x22')]+_0x21999c[_0x9d13('0x23')]+_0x21999c[_0x9d13('0x24')]+_0x21999c[_0x9d13('0x25')]<_0x10aa89[_0x9d13('0x26')][_0x9d13('0x27')])_0x517003=0x1;_0x2acb0b({'additional':_0x517003});}else{return db['CmHopperAdditionalPhone'][_0x9d13('0x16')]({'raw':!![],'where':{'CmHopperId':_0x3040e7['id']},'order':[['OrderBy',_0x9d13('0x1e')]]})[_0x9d13('0x1b')](function(_0x2f314b){var _0x1d9f56=0x0;if(_0x2f314b){if(_0x2f314b[_0x9d13('0x1f')]+_0x2f314b[_0x9d13('0x28')]+_0x2f314b[_0x9d13('0x20')]+_0x2f314b[_0x9d13('0x21')]+_0x2f314b[_0x9d13('0x22')]+_0x2f314b[_0x9d13('0x23')]+_0x2f314b[_0x9d13('0x24')]+_0x2f314b[_0x9d13('0x25')]<_0x10aa89['entity'][_0x9d13('0x27')])_0x1d9f56=0x1;_0x2acb0b({'additional':_0x1d9f56});}else{_0x2acb0b({'additional':0x0});}})['catch'](function(_0x2295bc){logger[_0x9d13('0x10')]('VerifyAdditionalPhones',_0x2295bc[_0x9d13('0x11')]);_0xa1de89(_0x45a07a[_0x9d13('0x10')](0x1f4,_0x2295bc['message']));});}})['catch'](function(_0x5c5ab4){logger[_0x9d13('0x10')]('VerifyAdditionalPhones',_0x5c5ab4[_0x9d13('0x11')]);_0xa1de89(_0x45a07a[_0x9d13('0x10')](0x1f4,_0x5c5ab4[_0x9d13('0x11')]));});}else _0x2acb0b({'additional':0x0});});});};exports['SwapAdditionalPhones']=function(_0x443005){var _0x234dbb=this;return new Promise(function(_0x26d95e,_0x369c43){return db['CmHopper']['findOne']({'raw':!![],'where':{'ContactId':_0x443005[_0x9d13('0x18')][_0x9d13('0x17')],'ListId':_0x443005['body'][_0x9d13('0x19')],'VoiceQueueId':_0x443005[_0x9d13('0x18')][_0x9d13('0x29')]===undefined?null:_0x443005[_0x9d13('0x18')][_0x9d13('0x29')],'CampaignId':_0x443005[_0x9d13('0x18')][_0x9d13('0x1a')]===undefined?null:_0x443005['body'][_0x9d13('0x1a')]}})['then'](function(_0x4b60d7){if(_0x4b60d7!=null){return db['CmHopperAdditionalPhone'][_0x9d13('0x16')]({'raw':!![],'where':{'CmHopperId':_0x4b60d7['id'],'OrderBy':{'$gte':_0x4b60d7[_0x9d13('0x1d')]}},'order':[[_0x9d13('0x1d'),_0x9d13('0x1e')]]})[_0x9d13('0x1b')](function(_0x4b32d8){if(_0x4b32d8)return activateAdditionalPhone(_0x4b60d7,_0x443005[_0x9d13('0x18')],_0x4b32d8,_0x443005[_0x9d13('0x2a')],_0x443005[_0x9d13('0x2b')])[_0x9d13('0x1b')](function(_0x41ae16){_0x26d95e(_0x41ae16);});else{return db[_0x9d13('0x1c')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x4b60d7['id']},'order':[[_0x9d13('0x1d'),_0x9d13('0x1e')]]})[_0x9d13('0x1b')](function(_0x547a6b){if(_0x547a6b)return activateAdditionalPhone(_0x4b60d7,_0x443005['body'],_0x547a6b,_0x443005[_0x9d13('0x2a')],_0x443005[_0x9d13('0x2b')])[_0x9d13('0x1b')](function(_0x4a36ea){_0x26d95e(_0x4a36ea);});else{_0x26d95e({'id':_0x4b60d7['id'],'phone':''});}})[_0x9d13('0x13')](function(_0x198fe7){logger['error'](_0x9d13('0x14'),_0x198fe7[_0x9d13('0x11')]);_0x369c43(_0x234dbb[_0x9d13('0x10')](0x1f4,_0x198fe7[_0x9d13('0x11')]));});}})[_0x9d13('0x13')](function(_0x28a68c){logger[_0x9d13('0x10')](_0x9d13('0x14'),_0x28a68c[_0x9d13('0x11')]);_0x369c43(_0x234dbb['error'](0x1f4,_0x28a68c[_0x9d13('0x11')]));});}else _0x26d95e(0x1);});});};function activateAdditionalPhone(_0x1d2ee6,_0x26f255,_0x1dd5dc,_0x227e4c,_0x20e89e){return new Promise(function(_0x395972,_0x5635f4){var _0x30114a;if(_[_0x9d13('0x2c')](_0x1dd5dc[_0x9d13('0x2d')])){_0x1dd5dc[_0x9d13('0x2d')]=moment();}if(moment()>moment(_0x1dd5dc[_0x9d13('0x2d')])){_0x30114a=moment()[_0x9d13('0x2e')](_0x20e89e||0x3,'minutes');}else{if(_0x1dd5dc['OrderBy']==0x0){_0x30114a=moment(_0x1dd5dc[_0x9d13('0x2d')]);}else{_0x30114a=moment()['add'](_0x20e89e||0x3,_0x9d13('0x2f'));}}if(_['isNil'](_0x30114a)){_0x30114a=moment()[_0x9d13('0x2e')](_0x20e89e||0x3,_0x9d13('0x2f'));}var _0x1678c0={'phone':_0x1d2ee6[_0x9d13('0x30')],'active':0x0,'OrderBy':_[_0x9d13('0x2c')](_0x1d2ee6['OrderBy'])?0x0:_0x1d2ee6[_0x9d13('0x1d')],'scheduledat':moment()[_0x9d13('0x2e')](_0x227e4c||0x1,_0x9d13('0x2f')),'countbusyretry':_0x26f255[_0x9d13('0x1f')],'countcongestionretry':_0x26f255[_0x9d13('0x28')],'countnoanswerretry':_0x26f255[_0x9d13('0x20')],'countnosuchnumberretry':_0x26f255[_0x9d13('0x21')],'countdropretry':_0x26f255[_0x9d13('0x22')],'countabandonedretry':_0x26f255[_0x9d13('0x23')],'countmachineretry':_0x26f255[_0x9d13('0x24')],'countagentrejectretry':_0x26f255['countagentrejectretry'],'createdAt':_0x26f255['createdAt'],'updatedAt':_0x26f255[_0x9d13('0x31')]};var _0xece6c4={'CmHopperId':_0x1d2ee6['id'],'phone':_0x1dd5dc['phone'],'active':0x0,'OrderBy':_[_0x9d13('0x2c')](_0x1dd5dc['OrderBy'])?0x0:_0x1dd5dc[_0x9d13('0x1d')],'scheduledat':_0x30114a,'countbusyretry':_0x1dd5dc[_0x9d13('0x1f')],'countcongestionretry':_0x1dd5dc['countcongestionretry'],'countnoanswerretry':_0x1dd5dc['countnoanswerretry'],'countnosuchnumberretry':_0x1dd5dc[_0x9d13('0x21')],'countdropretry':_0x1dd5dc[_0x9d13('0x22')],'countabandonedretry':_0x1dd5dc[_0x9d13('0x23')],'countmachineretry':_0x1dd5dc[_0x9d13('0x24')],'countagentrejectretry':_0x1dd5dc[_0x9d13('0x25')],'createdAt':_0x1dd5dc[_0x9d13('0x32')],'updatedAt':_0x1dd5dc[_0x9d13('0x31')]};return db[_0x9d13('0x33')][_0x9d13('0x34')](function(_0x519c6f){return db[_0x9d13('0x1c')]['update'](_0x1678c0,{'where':{'id':_0x1dd5dc['id']}},{'transaction':_0x519c6f})['then'](function(){return db[_0x9d13('0x15')]['update'](_0xece6c4,{'where':{'id':_0x1d2ee6['id']}},{'transaction':_0x519c6f});});})[_0x9d13('0x1b')](function(_0x12849c){_0x395972({'id':_0x1d2ee6['id'],'phone':_0x1dd5dc[_0x9d13('0x30')]});})[_0x9d13('0x13')](function(_0x1aca60){logger[_0x9d13('0x10')]('activateAdditionalPhone',_0x1aca60[_0x9d13('0x11')]);_0x5635f4({'error':_0x1aca60[_0x9d13('0x11')]});});});}exports[_0x9d13('0x35')]=function(_0x3967e6){var _0x23ad92=this;return new Promise(function(_0x171968,_0xf26caa){return db['CmHopper'][_0x9d13('0x36')](_0x3967e6[_0x9d13('0x18')][_0x9d13('0x37')],{'where':{'id':_0x3967e6[_0x9d13('0x18')]['id']}})[_0x9d13('0x1b')](function(_0x28776d){_0x171968(_0x28776d);})[_0x9d13('0x13')](function(_0x2a8a65){logger[_0x9d13('0x10')](_0x9d13('0x35'),_0x2a8a65['message']);_0xf26caa(_0x23ad92[_0x9d13('0x10')](0x1f4,_0x2a8a65[_0x9d13('0x11')]));});});}; \ No newline at end of file +var _0x9e26=['result','VerifyAdditionalPhones','CmHopper','findOne','ContactId','ListId','body','VoiceQueueId','CampaignId','CmHopperAdditionalPhone','OrderBy','ASC','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','entity','dialGlobalMaxRetry','catch','duration','waitTime','isNil','scheduledat','add','minutes','phone','createdAt','sequelize','update','activateAdditionalPhone','IncrementPreviewCounters','field','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperAdditionalPhone,\x20%s,\x20%s','request\x20sent','debug','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x33aaef,_0x5ca365){var _0x41f560=function(_0x224da7){while(--_0x224da7){_0x33aaef['push'](_0x33aaef['shift']());}};_0x41f560(++_0x5ca365);}(_0x9e26,0x104));var _0x69e2=function(_0x76deaf,_0x158d6f){_0x76deaf=_0x76deaf-0x0;var _0x12ce60=_0x9e26[_0x76deaf];return _0x12ce60;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x69e2('0x0'));var BPromise=require('bluebird');var rs=require(_0x69e2('0x1'));var fs=require('fs');var Redis=require(_0x69e2('0x2'));var db=require(_0x69e2('0x3'))['db'];var utils=require(_0x69e2('0x4'));var logger=require('../../config/logger')(_0x69e2('0x5'));var config=require(_0x69e2('0x6'));var jayson=require(_0x69e2('0x7'));var client=jayson['client'][_0x69e2('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1d1183,_0x1e78fa,_0x2f9124){return new BPromise(function(_0x2f0d2d,_0x376baf){return client[_0x69e2('0x9')](_0x1d1183,_0x2f9124)[_0x69e2('0xa')](function(_0x434bc5){logger[_0x69e2('0xb')](_0x69e2('0xc'),_0x1e78fa,_0x69e2('0xd'));logger[_0x69e2('0xe')](_0x69e2('0xf'),_0x1e78fa,_0x69e2('0xd'),JSON[_0x69e2('0x10')](_0x434bc5));if(_0x434bc5[_0x69e2('0x11')]){if(_0x434bc5['error'][_0x69e2('0x12')]===0x1f4){logger[_0x69e2('0x11')](_0x69e2('0xc'),_0x1e78fa,_0x434bc5[_0x69e2('0x11')][_0x69e2('0x13')]);return _0x376baf(_0x434bc5['error'][_0x69e2('0x13')]);}logger[_0x69e2('0x11')](_0x69e2('0xc'),_0x1e78fa,_0x434bc5['error'][_0x69e2('0x13')]);return _0x2f0d2d(_0x434bc5[_0x69e2('0x11')][_0x69e2('0x13')]);}else{logger['info'](_0x69e2('0xc'),_0x1e78fa,_0x69e2('0xd'));_0x2f0d2d(_0x434bc5[_0x69e2('0x14')][_0x69e2('0x13')]);}})['catch'](function(_0x4e3159){logger['error'](_0x69e2('0xc'),_0x1e78fa,_0x4e3159);_0x376baf(_0x4e3159);});});}exports[_0x69e2('0x15')]=function(_0x5ce852){var _0x559158=this;return new Promise(function(_0x4de6d7,_0x37b609){return db[_0x69e2('0x16')][_0x69e2('0x17')]({'raw':!![],'where':{'ContactId':_0x5ce852['body'][_0x69e2('0x18')],'ListId':_0x5ce852['body'][_0x69e2('0x19')],'VoiceQueueId':_0x5ce852[_0x69e2('0x1a')][_0x69e2('0x1b')]===undefined?null:_0x5ce852[_0x69e2('0x1a')]['VoiceQueueId'],'CampaignId':_0x5ce852[_0x69e2('0x1a')][_0x69e2('0x1c')]===undefined?null:_0x5ce852[_0x69e2('0x1a')][_0x69e2('0x1c')]}})[_0x69e2('0xa')](function(_0x48466f){if(_0x48466f!=null){return db[_0x69e2('0x1d')][_0x69e2('0x17')]({'raw':!![],'where':{'CmHopperId':_0x48466f['id'],'OrderBy':{'$gt':_0x48466f['OrderBy']}},'order':[[_0x69e2('0x1e'),_0x69e2('0x1f')]]})[_0x69e2('0xa')](function(_0x45dce0){var _0x1ea7fd=0x0;if(_0x45dce0){if(_0x45dce0[_0x69e2('0x20')]+_0x45dce0[_0x69e2('0x21')]+_0x45dce0[_0x69e2('0x22')]+_0x45dce0[_0x69e2('0x23')]+_0x45dce0[_0x69e2('0x24')]+_0x45dce0[_0x69e2('0x25')]+_0x45dce0[_0x69e2('0x26')]+_0x45dce0[_0x69e2('0x27')]<_0x5ce852[_0x69e2('0x28')][_0x69e2('0x29')])_0x1ea7fd=0x1;_0x4de6d7({'additional':_0x1ea7fd});}else{return db[_0x69e2('0x1d')][_0x69e2('0x17')]({'raw':!![],'where':{'CmHopperId':_0x48466f['id']},'order':[[_0x69e2('0x1e'),'ASC']]})[_0x69e2('0xa')](function(_0x198b41){var _0x10f808=0x0;if(_0x198b41){if(_0x198b41[_0x69e2('0x20')]+_0x198b41[_0x69e2('0x21')]+_0x198b41['countnoanswerretry']+_0x198b41[_0x69e2('0x23')]+_0x198b41[_0x69e2('0x24')]+_0x198b41[_0x69e2('0x25')]+_0x198b41['countmachineretry']+_0x198b41[_0x69e2('0x27')]<_0x5ce852['entity'][_0x69e2('0x29')])_0x10f808=0x1;_0x4de6d7({'additional':_0x10f808});}else{_0x4de6d7({'additional':0x0});}})['catch'](function(_0x2ea4bc){logger[_0x69e2('0x11')](_0x69e2('0x15'),_0x2ea4bc[_0x69e2('0x13')]);_0x37b609(_0x559158['error'](0x1f4,_0x2ea4bc[_0x69e2('0x13')]));});}})[_0x69e2('0x2a')](function(_0x4ae11a){logger['error'](_0x69e2('0x15'),_0x4ae11a[_0x69e2('0x13')]);_0x37b609(_0x559158['error'](0x1f4,_0x4ae11a['message']));});}else _0x4de6d7({'additional':0x0});});});};exports['SwapAdditionalPhones']=function(_0x566e59){var _0xb59848=this;return new Promise(function(_0x3a93f2,_0x5a04dd){return db[_0x69e2('0x16')][_0x69e2('0x17')]({'raw':!![],'where':{'ContactId':_0x566e59['body'][_0x69e2('0x18')],'ListId':_0x566e59[_0x69e2('0x1a')][_0x69e2('0x19')],'VoiceQueueId':_0x566e59['body'][_0x69e2('0x1b')]===undefined?null:_0x566e59[_0x69e2('0x1a')][_0x69e2('0x1b')],'CampaignId':_0x566e59[_0x69e2('0x1a')][_0x69e2('0x1c')]===undefined?null:_0x566e59[_0x69e2('0x1a')]['CampaignId']}})[_0x69e2('0xa')](function(_0x387aea){if(_0x387aea!=null){return db[_0x69e2('0x1d')][_0x69e2('0x17')]({'raw':!![],'where':{'CmHopperId':_0x387aea['id'],'OrderBy':{'$gte':_0x387aea[_0x69e2('0x1e')]}},'order':[[_0x69e2('0x1e'),_0x69e2('0x1f')]]})[_0x69e2('0xa')](function(_0x219da8){if(_0x219da8)return activateAdditionalPhone(_0x387aea,_0x566e59[_0x69e2('0x1a')],_0x219da8,_0x566e59[_0x69e2('0x2b')],_0x566e59['waitTime'])[_0x69e2('0xa')](function(_0x18f465){_0x3a93f2(_0x18f465);});else{return db['CmHopperAdditionalPhone'][_0x69e2('0x17')]({'raw':!![],'where':{'CmHopperId':_0x387aea['id']},'order':[['OrderBy',_0x69e2('0x1f')]]})[_0x69e2('0xa')](function(_0x214ad7){if(_0x214ad7)return activateAdditionalPhone(_0x387aea,_0x566e59[_0x69e2('0x1a')],_0x214ad7,_0x566e59[_0x69e2('0x2b')],_0x566e59[_0x69e2('0x2c')])[_0x69e2('0xa')](function(_0x4449d1){_0x3a93f2(_0x4449d1);});else{_0x3a93f2({'id':_0x387aea['id'],'phone':''});}})[_0x69e2('0x2a')](function(_0xadb0dd){logger['error']('VerifyAdditionalPhones',_0xadb0dd['message']);_0x5a04dd(_0xb59848[_0x69e2('0x11')](0x1f4,_0xadb0dd['message']));});}})['catch'](function(_0x2c5a9d){logger[_0x69e2('0x11')](_0x69e2('0x15'),_0x2c5a9d[_0x69e2('0x13')]);_0x5a04dd(_0xb59848[_0x69e2('0x11')](0x1f4,_0x2c5a9d[_0x69e2('0x13')]));});}else _0x3a93f2(0x1);});});};function activateAdditionalPhone(_0x548395,_0x5a836c,_0xf99303,_0x3c88ef,_0x25854b){return new Promise(function(_0x42a42d,_0x22dc6e){var _0x1af261;if(_[_0x69e2('0x2d')](_0xf99303[_0x69e2('0x2e')])){_0xf99303[_0x69e2('0x2e')]=moment();}if(moment()>moment(_0xf99303['scheduledat'])){_0x1af261=moment()[_0x69e2('0x2f')](_0x25854b||0x3,_0x69e2('0x30'));}else{if(_0xf99303[_0x69e2('0x1e')]==0x0){_0x1af261=moment(_0xf99303[_0x69e2('0x2e')]);}else{_0x1af261=moment()['add'](_0x25854b||0x3,_0x69e2('0x30'));}}if(_[_0x69e2('0x2d')](_0x1af261)){_0x1af261=moment()[_0x69e2('0x2f')](_0x25854b||0x3,_0x69e2('0x30'));}var _0x5ed1a1={'phone':_0x548395[_0x69e2('0x31')],'active':0x0,'OrderBy':_[_0x69e2('0x2d')](_0x548395['OrderBy'])?0x0:_0x548395[_0x69e2('0x1e')],'scheduledat':moment()[_0x69e2('0x2f')](_0x3c88ef||0x1,_0x69e2('0x30')),'countbusyretry':_0x5a836c[_0x69e2('0x20')],'countcongestionretry':_0x5a836c[_0x69e2('0x21')],'countnoanswerretry':_0x5a836c[_0x69e2('0x22')],'countnosuchnumberretry':_0x5a836c[_0x69e2('0x23')],'countdropretry':_0x5a836c[_0x69e2('0x24')],'countabandonedretry':_0x5a836c[_0x69e2('0x25')],'countmachineretry':_0x5a836c[_0x69e2('0x26')],'countagentrejectretry':_0x5a836c[_0x69e2('0x27')],'createdAt':_0x5a836c['createdAt'],'updatedAt':_0x5a836c['updatedAt']};var _0x1f2816={'CmHopperId':_0x548395['id'],'phone':_0xf99303[_0x69e2('0x31')],'active':0x0,'OrderBy':_['isNil'](_0xf99303[_0x69e2('0x1e')])?0x0:_0xf99303[_0x69e2('0x1e')],'scheduledat':_0x1af261,'countbusyretry':_0xf99303[_0x69e2('0x20')],'countcongestionretry':_0xf99303[_0x69e2('0x21')],'countnoanswerretry':_0xf99303['countnoanswerretry'],'countnosuchnumberretry':_0xf99303[_0x69e2('0x23')],'countdropretry':_0xf99303['countdropretry'],'countabandonedretry':_0xf99303[_0x69e2('0x25')],'countmachineretry':_0xf99303['countmachineretry'],'countagentrejectretry':_0xf99303[_0x69e2('0x27')],'createdAt':_0xf99303[_0x69e2('0x32')],'updatedAt':_0xf99303['updatedAt']};return db[_0x69e2('0x33')]['transaction'](function(_0x3f796e){return db[_0x69e2('0x1d')][_0x69e2('0x34')](_0x5ed1a1,{'where':{'id':_0xf99303['id']}},{'transaction':_0x3f796e})['then'](function(){return db[_0x69e2('0x16')]['update'](_0x1f2816,{'where':{'id':_0x548395['id']}},{'transaction':_0x3f796e});});})[_0x69e2('0xa')](function(_0x4673bb){_0x42a42d({'id':_0x548395['id'],'phone':_0xf99303[_0x69e2('0x31')]});})[_0x69e2('0x2a')](function(_0x3f97ee){logger[_0x69e2('0x11')](_0x69e2('0x35'),_0x3f97ee[_0x69e2('0x13')]);_0x22dc6e({'error':_0x3f97ee[_0x69e2('0x13')]});});});}exports[_0x69e2('0x36')]=function(_0x40bc00){var _0x513505=this;return new Promise(function(_0x143a6d,_0x126d8b){return db[_0x69e2('0x16')][_0x69e2('0x34')](_0x40bc00[_0x69e2('0x1a')][_0x69e2('0x37')],{'where':{'id':_0x40bc00[_0x69e2('0x1a')]['id']}})[_0x69e2('0xa')](function(_0x9fc761){_0x143a6d(_0x9fc761);})[_0x69e2('0x2a')](function(_0x1b6687){logger[_0x69e2('0x11')](_0x69e2('0x36'),_0x1b6687[_0x69e2('0x13')]);_0x126d8b(_0x513505[_0x69e2('0x11')](0x1f4,_0x1b6687['message']));});});}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/index.js b/server/api/cmHopperAdditionalPhone/index.js index dbbfd05..7d00d9e 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 _0xe820=['get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','path','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x64dd09,_0x15713a){var _0x42be45=function(_0x5920d6){while(--_0x5920d6){_0x64dd09['push'](_0x64dd09['shift']());}};_0x42be45(++_0x15713a);}(_0xe820,0xd2));var _0x0e82=function(_0x39d484,_0x5eceba){_0x39d484=_0x39d484-0x0;var _0x232c12=_0xe820[_0x39d484];return _0x232c12;};'use strict';var multer=require(_0x0e82('0x0'));var util=require('util');var path=require(_0x0e82('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0e82('0x2')]();var fs_extra=require(_0x0e82('0x3'));var auth=require(_0x0e82('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x0e82('0x5'));var controller=require('./cmHopperAdditionalPhone.controller');router[_0x0e82('0x6')]('/',auth[_0x0e82('0x7')](),controller[_0x0e82('0x8')]);router[_0x0e82('0x6')](_0x0e82('0x9'),auth['isAuthenticated'](),controller[_0x0e82('0xa')]);router[_0x0e82('0xb')]('/',auth[_0x0e82('0x7')](),controller[_0x0e82('0xc')]);router[_0x0e82('0xd')]('/:id',auth[_0x0e82('0x7')](),controller[_0x0e82('0xe')]);router[_0x0e82('0xf')](_0x0e82('0x9'),auth[_0x0e82('0x7')](),controller[_0x0e82('0x10')]);module[_0x0e82('0x11')]=router; \ No newline at end of file +var _0x09e1=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout'];(function(_0x22a126,_0x5dd1fb){var _0xade95b=function(_0x3b1737){while(--_0x3b1737){_0x22a126['push'](_0x22a126['shift']());}};_0xade95b(++_0x5dd1fb);}(_0x09e1,0x9d));var _0x109e=function(_0x9c1cb1,_0x14fb83){_0x9c1cb1=_0x9c1cb1-0x0;var _0x1755c8=_0x09e1[_0x9c1cb1];return _0x1755c8;};'use strict';var multer=require(_0x109e('0x0'));var util=require('util');var path=require(_0x109e('0x1'));var timeout=require(_0x109e('0x2'));var express=require(_0x109e('0x3'));var router=express[_0x109e('0x4')]();var fs_extra=require(_0x109e('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x109e('0x6'));var config=require(_0x109e('0x7'));var controller=require('./cmHopperAdditionalPhone.controller');router[_0x109e('0x8')]('/',auth['isAuthenticated'](),controller[_0x109e('0x9')]);router[_0x109e('0x8')](_0x109e('0xa'),auth[_0x109e('0xb')](),controller[_0x109e('0xc')]);router[_0x109e('0xd')]('/',auth[_0x109e('0xb')](),controller[_0x109e('0xe')]);router[_0x109e('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x109e('0x10')]);router[_0x109e('0x11')](_0x109e('0xa'),auth[_0x109e('0xb')](),controller[_0x109e('0x12')]);module[_0x109e('0x13')]=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index 9bda291..3af435b 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 _0xb0df=['STRING','INTEGER','contactListQueue','sequelize','exports'];(function(_0x19a6de,_0x5df840){var _0x3fd18f=function(_0x2aef3f){while(--_0x2aef3f){_0x19a6de['push'](_0x19a6de['shift']());}};_0x3fd18f(++_0x5df840);}(_0xb0df,0x85));var _0xfb0d=function(_0x26bf51,_0x5e261a){_0x26bf51=_0x26bf51-0x0;var _0x503415=_0xb0df[_0x26bf51];return _0x503415;};'use strict';var moment=require('moment');var Sequelize=require(_0xfb0d('0x0'));module[_0xfb0d('0x1')]={'phone':{'type':Sequelize[_0xfb0d('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize[_0xfb0d('0x3')],'unique':_0xfb0d('0x4')},'ListId':{'type':Sequelize[_0xfb0d('0x3')],'unique':_0xfb0d('0x4')},'VoiceQueueId':{'type':Sequelize[_0xfb0d('0x3')],'unique':_0xfb0d('0x4')}}; \ No newline at end of file +var _0xb9a7=['moment','exports','STRING','INTEGER','contactListQueue'];(function(_0x28482c,_0x4f454f){var _0x3e0953=function(_0x2ebf2a){while(--_0x2ebf2a){_0x28482c['push'](_0x28482c['shift']());}};_0x3e0953(++_0x4f454f);}(_0xb9a7,0x172));var _0x7b9a=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0xb9a7[_0x36c5b0];return _0xf19333;};'use strict';var moment=require(_0x7b9a('0x0'));var Sequelize=require('sequelize');module[_0x7b9a('0x1')]={'phone':{'type':Sequelize[_0x7b9a('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x7b9a('0x3')],'unique':_0x7b9a('0x4')},'ListId':{'type':Sequelize[_0x7b9a('0x3')],'unique':_0x7b9a('0x4')},'VoiceQueueId':{'type':Sequelize[_0x7b9a('0x3')],'unique':_0x7b9a('0x4')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index 293f82a..706c438 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 _0x9cf7=['filters','filter','merge','options','CmHopperBlack','includeAll','include','findAll','rows','catch','show','params','keys','intersection','length','find','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','end','error','name','send','rawAttributes','fieldName','key','model','map','query','attributes','fields','hasOwnProperty','nolimit','sort','where','pick'];(function(_0x355ee7,_0x398425){var _0x228109=function(_0x433697){while(--_0x433697){_0x355ee7['push'](_0x355ee7['shift']());}};_0x228109(++_0x398425);}(_0x9cf7,0x13e));var _0x79cf=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0x9cf7[_0x18ab2a];return _0x16dcee;};'use strict';var emlformat=require(_0x79cf('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x79cf('0x1'));var jsonpatch=require(_0x79cf('0x2'));var rp=require(_0x79cf('0x3'));var moment=require(_0x79cf('0x4'));var BPromise=require(_0x79cf('0x5'));var Mustache=require(_0x79cf('0x6'));var util=require('util');var path=require(_0x79cf('0x7'));var sox=require(_0x79cf('0x8'));var csv=require(_0x79cf('0x9'));var ejs=require(_0x79cf('0xa'));var fs=require('fs');var fs_extra=require(_0x79cf('0xb'));var _=require(_0x79cf('0xc'));var squel=require(_0x79cf('0xd'));var crypto=require(_0x79cf('0xe'));var jsforce=require(_0x79cf('0xf'));var deskjs=require(_0x79cf('0x10'));var toCsv=require(_0x79cf('0x9'));var querystring=require(_0x79cf('0x11'));var Papa=require(_0x79cf('0x12'));var Redis=require(_0x79cf('0x13'));var authService=require(_0x79cf('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x79cf('0x15'))(_0x79cf('0x16'));var utils=require('../../config/utils');var config=require(_0x79cf('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x79cf('0x18'))['db'];function respondWithStatusCode(_0x197d55,_0x19026f){_0x19026f=_0x19026f||0xcc;return function(_0x5eb041){if(_0x5eb041){return _0x197d55[_0x79cf('0x19')](_0x19026f);}return _0x197d55[_0x79cf('0x1a')](_0x19026f)['end']();};}function respondWithResult(_0x4456ef,_0x536bb4){_0x536bb4=_0x536bb4||0xc8;return function(_0x4f8bec){if(_0x4f8bec){return _0x4456ef[_0x79cf('0x1a')](_0x536bb4)['json'](_0x4f8bec);}};}function respondWithFilteredResult(_0x3a1c4f,_0x298cf1){return function(_0x1d75b0){if(_0x1d75b0){var _0x40bda1=typeof _0x298cf1[_0x79cf('0x1b')]===_0x79cf('0x1c')&&typeof _0x298cf1[_0x79cf('0x1d')]===_0x79cf('0x1c');var _0x3119ad=_0x1d75b0[_0x79cf('0x1e')];var _0x3ebe2=_0x40bda1?0x0:_0x298cf1['offset'];var _0x57b7fb=_0x40bda1?_0x1d75b0[_0x79cf('0x1e')]:_0x298cf1['offset']+_0x298cf1[_0x79cf('0x1d')];var _0x2ffbd6;if(_0x57b7fb>=_0x3119ad){_0x57b7fb=_0x3119ad;_0x2ffbd6=0xc8;}else{_0x2ffbd6=0xce;}_0x3a1c4f[_0x79cf('0x1a')](_0x2ffbd6);return _0x3a1c4f[_0x79cf('0x1f')](_0x79cf('0x20'),_0x3ebe2+'-'+_0x57b7fb+'/'+_0x3119ad)[_0x79cf('0x21')](_0x1d75b0);}return null;};}function patchUpdates(_0x5bd30a){return function(_0x8f9e9f){try{jsonpatch[_0x79cf('0x22')](_0x8f9e9f,_0x5bd30a,!![]);}catch(_0x29bc24){return BPromise[_0x79cf('0x23')](_0x29bc24);}return _0x8f9e9f[_0x79cf('0x24')]();};}function saveUpdates(_0x30b42a,_0x49ea36){return function(_0x45cc95){if(_0x45cc95){return _0x45cc95[_0x79cf('0x25')](_0x30b42a)[_0x79cf('0x26')](function(_0x1ca790){return _0x1ca790;});}return null;};}function removeEntity(_0x262b19,_0x573479){return function(_0x54eba8){if(_0x54eba8){return _0x54eba8[_0x79cf('0x27')]()[_0x79cf('0x26')](function(){_0x262b19[_0x79cf('0x1a')](0xcc)[_0x79cf('0x28')]();});}};}function handleEntityNotFound(_0x5bfa74,_0x1ba209){return function(_0x18d3b6){if(!_0x18d3b6){_0x5bfa74['sendStatus'](0x194);}return _0x18d3b6;};}function handleError(_0x2be2b7,_0x46cb4c){_0x46cb4c=_0x46cb4c||0x1f4;return function(_0x575efe){logger[_0x79cf('0x29')](_0x575efe['stack']);if(_0x575efe[_0x79cf('0x2a')]){delete _0x575efe['name'];}_0x2be2b7[_0x79cf('0x1a')](_0x46cb4c)[_0x79cf('0x2b')](_0x575efe);};}exports['index']=function(_0x17e1e1,_0x1a06a5){var _0x4fd510={},_0xf65984={},_0x39a85c={'count':0x0,'rows':[]};var _0x99d58f=_['map'](db['CmHopperBlack'][_0x79cf('0x2c')],function(_0x55bf65){return{'name':_0x55bf65[_0x79cf('0x2d')],'type':_0x55bf65['type'][_0x79cf('0x2e')]};});_0xf65984[_0x79cf('0x2f')]=_[_0x79cf('0x30')](_0x99d58f,_0x79cf('0x2a'));_0xf65984['query']=_['keys'](_0x17e1e1[_0x79cf('0x31')]);_0xf65984['filters']=_['intersection'](_0xf65984[_0x79cf('0x2f')],_0xf65984['query']);_0x4fd510[_0x79cf('0x32')]=_['intersection'](_0xf65984[_0x79cf('0x2f')],qs[_0x79cf('0x33')](_0x17e1e1['query'][_0x79cf('0x33')]));_0x4fd510[_0x79cf('0x32')]=_0x4fd510['attributes']['length']?_0x4fd510[_0x79cf('0x32')]:_0xf65984[_0x79cf('0x2f')];if(!_0x17e1e1[_0x79cf('0x31')][_0x79cf('0x34')](_0x79cf('0x35'))){_0x4fd510[_0x79cf('0x1d')]=qs[_0x79cf('0x1d')](_0x17e1e1['query'][_0x79cf('0x1d')]);_0x4fd510[_0x79cf('0x1b')]=qs[_0x79cf('0x1b')](_0x17e1e1[_0x79cf('0x31')]['offset']);}_0x4fd510['order']=qs[_0x79cf('0x36')](_0x17e1e1[_0x79cf('0x31')][_0x79cf('0x36')]);_0x4fd510[_0x79cf('0x37')]=qs['filters'](_[_0x79cf('0x38')](_0x17e1e1[_0x79cf('0x31')],_0xf65984[_0x79cf('0x39')]),_0x99d58f);if(_0x17e1e1['query'][_0x79cf('0x3a')]){_0x4fd510['where']=_[_0x79cf('0x3b')](_0x4fd510[_0x79cf('0x37')],{'$or':_[_0x79cf('0x30')](_0x99d58f,function(_0x241090){if(_0x241090['type']!=='VIRTUAL'){var _0x14659b={};_0x14659b[_0x241090[_0x79cf('0x2a')]]={'$like':'%'+_0x17e1e1[_0x79cf('0x31')]['filter']+'%'};return _0x14659b;}})});}_0x4fd510=_[_0x79cf('0x3b')]({},_0x4fd510,_0x17e1e1[_0x79cf('0x3c')]);var _0x5850ac={'where':_0x4fd510['where']};return db[_0x79cf('0x3d')][_0x79cf('0x1e')](_0x5850ac)[_0x79cf('0x26')](function(_0x9b097a){_0x39a85c[_0x79cf('0x1e')]=_0x9b097a;if(_0x17e1e1[_0x79cf('0x31')][_0x79cf('0x3e')]){_0x4fd510[_0x79cf('0x3f')]=[{'all':!![]}];}return db['CmHopperBlack'][_0x79cf('0x40')](_0x4fd510);})[_0x79cf('0x26')](function(_0xac70ac){_0x39a85c[_0x79cf('0x41')]=_0xac70ac;return _0x39a85c;})[_0x79cf('0x26')](respondWithFilteredResult(_0x1a06a5,_0x4fd510))[_0x79cf('0x42')](handleError(_0x1a06a5,null));};exports[_0x79cf('0x43')]=function(_0x81a2d7,_0x399635){var _0x7a2076={'raw':!![],'where':{'id':_0x81a2d7[_0x79cf('0x44')]['id']}},_0x34563b={};_0x34563b[_0x79cf('0x2f')]=_[_0x79cf('0x45')](db['CmHopperBlack'][_0x79cf('0x2c')]);_0x34563b[_0x79cf('0x31')]=_[_0x79cf('0x45')](_0x81a2d7['query']);_0x34563b[_0x79cf('0x39')]=_[_0x79cf('0x46')](_0x34563b[_0x79cf('0x2f')],_0x34563b[_0x79cf('0x31')]);_0x7a2076[_0x79cf('0x32')]=_[_0x79cf('0x46')](_0x34563b[_0x79cf('0x2f')],qs[_0x79cf('0x33')](_0x81a2d7[_0x79cf('0x31')][_0x79cf('0x33')]));_0x7a2076[_0x79cf('0x32')]=_0x7a2076[_0x79cf('0x32')][_0x79cf('0x47')]?_0x7a2076[_0x79cf('0x32')]:_0x34563b[_0x79cf('0x2f')];if(_0x81a2d7[_0x79cf('0x31')][_0x79cf('0x3e')]){_0x7a2076[_0x79cf('0x3f')]=[{'all':!![]}];}_0x7a2076=_[_0x79cf('0x3b')]({},_0x7a2076,_0x81a2d7[_0x79cf('0x3c')]);return db[_0x79cf('0x3d')][_0x79cf('0x48')](_0x7a2076)[_0x79cf('0x26')](handleEntityNotFound(_0x399635,null))[_0x79cf('0x26')](respondWithResult(_0x399635,null))[_0x79cf('0x42')](handleError(_0x399635,null));};exports['update']=function(_0x28d03d,_0x2763d7){if(_0x28d03d[_0x79cf('0x49')]['id']){delete _0x28d03d[_0x79cf('0x49')]['id'];}return db[_0x79cf('0x3d')][_0x79cf('0x48')]({'where':{'id':_0x28d03d[_0x79cf('0x44')]['id']}})[_0x79cf('0x26')](handleEntityNotFound(_0x2763d7,null))[_0x79cf('0x26')](saveUpdates(_0x28d03d['body'],null))['then'](respondWithResult(_0x2763d7,null))[_0x79cf('0x42')](handleError(_0x2763d7,null));};exports[_0x79cf('0x27')]=function(_0x37ec4d,_0x38b652){return db[_0x79cf('0x3d')][_0x79cf('0x48')]({'where':{'id':_0x37ec4d[_0x79cf('0x44')]['id']}})[_0x79cf('0x26')](handleEntityNotFound(_0x38b652,null))[_0x79cf('0x26')](removeEntity(_0x38b652,null))['catch'](handleError(_0x38b652,null));};exports[_0x79cf('0x4a')]=function(_0xd1ab27,_0x51184a){return db[_0x79cf('0x3d')][_0x79cf('0x4a')]()[_0x79cf('0x26')](respondWithResult(_0x51184a,null))['catch'](handleError(_0x51184a,null));}; \ No newline at end of file +var _0xe5f0=['attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','includeAll','include','findAll','rows','catch','show','params','keys','options','find','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','send','index','map','CmHopperBlack','rawAttributes','fieldName','type','key','model','name','query','filters','intersection'];(function(_0x46b131,_0x5d67ad){var _0x41b942=function(_0x46acf8){while(--_0x46acf8){_0x46b131['push'](_0x46b131['shift']());}};_0x41b942(++_0x5d67ad);}(_0xe5f0,0x69));var _0x0e5f=function(_0x49b89a,_0x3fdbdb){_0x49b89a=_0x49b89a-0x0;var _0x5f3630=_0xe5f0[_0x49b89a];return _0x5f3630;};'use strict';var emlformat=require(_0x0e5f('0x0'));var rimraf=require(_0x0e5f('0x1'));var zipdir=require(_0x0e5f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0e5f('0x3'));var moment=require(_0x0e5f('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x0e5f('0x5'));var util=require(_0x0e5f('0x6'));var path=require(_0x0e5f('0x7'));var sox=require(_0x0e5f('0x8'));var csv=require(_0x0e5f('0x9'));var ejs=require(_0x0e5f('0xa'));var fs=require('fs');var fs_extra=require(_0x0e5f('0xb'));var _=require('lodash');var squel=require(_0x0e5f('0xc'));var crypto=require(_0x0e5f('0xd'));var jsforce=require(_0x0e5f('0xe'));var deskjs=require(_0x0e5f('0xf'));var toCsv=require(_0x0e5f('0x9'));var querystring=require(_0x0e5f('0x10'));var Papa=require(_0x0e5f('0x11'));var Redis=require(_0x0e5f('0x12'));var authService=require(_0x0e5f('0x13'));var qs=require(_0x0e5f('0x14'));var as=require(_0x0e5f('0x15'));var hardwareService=require(_0x0e5f('0x16'));var logger=require(_0x0e5f('0x17'))(_0x0e5f('0x18'));var utils=require('../../config/utils');var config=require(_0x0e5f('0x19'));var licenseUtil=require(_0x0e5f('0x1a'));var db=require(_0x0e5f('0x1b'))['db'];function respondWithStatusCode(_0x4e15c5,_0x1c12b2){_0x1c12b2=_0x1c12b2||0xcc;return function(_0x43a44d){if(_0x43a44d){return _0x4e15c5[_0x0e5f('0x1c')](_0x1c12b2);}return _0x4e15c5[_0x0e5f('0x1d')](_0x1c12b2)['end']();};}function respondWithResult(_0x21f76a,_0x38bd87){_0x38bd87=_0x38bd87||0xc8;return function(_0xe5eb85){if(_0xe5eb85){return _0x21f76a[_0x0e5f('0x1d')](_0x38bd87)[_0x0e5f('0x1e')](_0xe5eb85);}};}function respondWithFilteredResult(_0x20d1f6,_0x424554){return function(_0x4c73df){if(_0x4c73df){var _0x2a821b=typeof _0x424554['offset']===_0x0e5f('0x1f')&&typeof _0x424554[_0x0e5f('0x20')]===_0x0e5f('0x1f');var _0x417c14=_0x4c73df['count'];var _0x3a06e4=_0x2a821b?0x0:_0x424554[_0x0e5f('0x21')];var _0xb88104=_0x2a821b?_0x4c73df[_0x0e5f('0x22')]:_0x424554['offset']+_0x424554[_0x0e5f('0x20')];var _0x569321;if(_0xb88104>=_0x417c14){_0xb88104=_0x417c14;_0x569321=0xc8;}else{_0x569321=0xce;}_0x20d1f6[_0x0e5f('0x1d')](_0x569321);return _0x20d1f6[_0x0e5f('0x23')](_0x0e5f('0x24'),_0x3a06e4+'-'+_0xb88104+'/'+_0x417c14)['json'](_0x4c73df);}return null;};}function patchUpdates(_0x4e4747){return function(_0x47dbf2){try{jsonpatch[_0x0e5f('0x25')](_0x47dbf2,_0x4e4747,!![]);}catch(_0x2c48a0){return BPromise[_0x0e5f('0x26')](_0x2c48a0);}return _0x47dbf2[_0x0e5f('0x27')]();};}function saveUpdates(_0x42ad87,_0x2acb89){return function(_0xa63b98){if(_0xa63b98){return _0xa63b98[_0x0e5f('0x28')](_0x42ad87)[_0x0e5f('0x29')](function(_0x107185){return _0x107185;});}return null;};}function removeEntity(_0x199a84,_0x53a99e){return function(_0x5df6fa){if(_0x5df6fa){return _0x5df6fa[_0x0e5f('0x2a')]()['then'](function(){_0x199a84[_0x0e5f('0x1d')](0xcc)[_0x0e5f('0x2b')]();});}};}function handleEntityNotFound(_0x1a078d,_0x58207e){return function(_0x129f3e){if(!_0x129f3e){_0x1a078d[_0x0e5f('0x1c')](0x194);}return _0x129f3e;};}function handleError(_0x4bab19,_0x15794b){_0x15794b=_0x15794b||0x1f4;return function(_0x4ef3f6){logger[_0x0e5f('0x2c')](_0x4ef3f6[_0x0e5f('0x2d')]);if(_0x4ef3f6['name']){delete _0x4ef3f6['name'];}_0x4bab19[_0x0e5f('0x1d')](_0x15794b)[_0x0e5f('0x2e')](_0x4ef3f6);};}exports[_0x0e5f('0x2f')]=function(_0x36b35b,_0x2d16ed){var _0x4178c4={},_0x343d3f={},_0x25702c={'count':0x0,'rows':[]};var _0x596910=_[_0x0e5f('0x30')](db[_0x0e5f('0x31')][_0x0e5f('0x32')],function(_0x2ac18a){return{'name':_0x2ac18a[_0x0e5f('0x33')],'type':_0x2ac18a[_0x0e5f('0x34')][_0x0e5f('0x35')]};});_0x343d3f[_0x0e5f('0x36')]=_[_0x0e5f('0x30')](_0x596910,_0x0e5f('0x37'));_0x343d3f[_0x0e5f('0x38')]=_['keys'](_0x36b35b[_0x0e5f('0x38')]);_0x343d3f[_0x0e5f('0x39')]=_[_0x0e5f('0x3a')](_0x343d3f[_0x0e5f('0x36')],_0x343d3f['query']);_0x4178c4[_0x0e5f('0x3b')]=_['intersection'](_0x343d3f[_0x0e5f('0x36')],qs[_0x0e5f('0x3c')](_0x36b35b['query']['fields']));_0x4178c4[_0x0e5f('0x3b')]=_0x4178c4[_0x0e5f('0x3b')][_0x0e5f('0x3d')]?_0x4178c4['attributes']:_0x343d3f['model'];if(!_0x36b35b[_0x0e5f('0x38')][_0x0e5f('0x3e')](_0x0e5f('0x3f'))){_0x4178c4[_0x0e5f('0x20')]=qs[_0x0e5f('0x20')](_0x36b35b[_0x0e5f('0x38')][_0x0e5f('0x20')]);_0x4178c4[_0x0e5f('0x21')]=qs['offset'](_0x36b35b[_0x0e5f('0x38')]['offset']);}_0x4178c4[_0x0e5f('0x40')]=qs[_0x0e5f('0x41')](_0x36b35b[_0x0e5f('0x38')]['sort']);_0x4178c4[_0x0e5f('0x42')]=qs[_0x0e5f('0x39')](_[_0x0e5f('0x43')](_0x36b35b[_0x0e5f('0x38')],_0x343d3f[_0x0e5f('0x39')]),_0x596910);if(_0x36b35b[_0x0e5f('0x38')]['filter']){_0x4178c4['where']=_[_0x0e5f('0x44')](_0x4178c4[_0x0e5f('0x42')],{'$or':_[_0x0e5f('0x30')](_0x596910,function(_0x4e998b){if(_0x4e998b[_0x0e5f('0x34')]!=='VIRTUAL'){var _0x4b18ca={};_0x4b18ca[_0x4e998b[_0x0e5f('0x37')]]={'$like':'%'+_0x36b35b[_0x0e5f('0x38')][_0x0e5f('0x45')]+'%'};return _0x4b18ca;}})});}_0x4178c4=_['merge']({},_0x4178c4,_0x36b35b['options']);var _0x4ecef0={'where':_0x4178c4[_0x0e5f('0x42')]};return db[_0x0e5f('0x31')][_0x0e5f('0x22')](_0x4ecef0)[_0x0e5f('0x29')](function(_0x3d2573){_0x25702c['count']=_0x3d2573;if(_0x36b35b[_0x0e5f('0x38')][_0x0e5f('0x46')]){_0x4178c4[_0x0e5f('0x47')]=[{'all':!![]}];}return db[_0x0e5f('0x31')][_0x0e5f('0x48')](_0x4178c4);})[_0x0e5f('0x29')](function(_0x4d66e8){_0x25702c[_0x0e5f('0x49')]=_0x4d66e8;return _0x25702c;})['then'](respondWithFilteredResult(_0x2d16ed,_0x4178c4))[_0x0e5f('0x4a')](handleError(_0x2d16ed,null));};exports[_0x0e5f('0x4b')]=function(_0x495211,_0xd99a3b){var _0x5ca812={'raw':!![],'where':{'id':_0x495211[_0x0e5f('0x4c')]['id']}},_0x297cb2={};_0x297cb2[_0x0e5f('0x36')]=_[_0x0e5f('0x4d')](db['CmHopperBlack'][_0x0e5f('0x32')]);_0x297cb2[_0x0e5f('0x38')]=_[_0x0e5f('0x4d')](_0x495211[_0x0e5f('0x38')]);_0x297cb2['filters']=_[_0x0e5f('0x3a')](_0x297cb2['model'],_0x297cb2[_0x0e5f('0x38')]);_0x5ca812['attributes']=_[_0x0e5f('0x3a')](_0x297cb2[_0x0e5f('0x36')],qs[_0x0e5f('0x3c')](_0x495211[_0x0e5f('0x38')]['fields']));_0x5ca812['attributes']=_0x5ca812[_0x0e5f('0x3b')][_0x0e5f('0x3d')]?_0x5ca812[_0x0e5f('0x3b')]:_0x297cb2[_0x0e5f('0x36')];if(_0x495211[_0x0e5f('0x38')][_0x0e5f('0x46')]){_0x5ca812[_0x0e5f('0x47')]=[{'all':!![]}];}_0x5ca812=_['merge']({},_0x5ca812,_0x495211[_0x0e5f('0x4e')]);return db['CmHopperBlack'][_0x0e5f('0x4f')](_0x5ca812)['then'](handleEntityNotFound(_0xd99a3b,null))[_0x0e5f('0x29')](respondWithResult(_0xd99a3b,null))['catch'](handleError(_0xd99a3b,null));};exports[_0x0e5f('0x28')]=function(_0x5974e6,_0x410410){if(_0x5974e6[_0x0e5f('0x50')]['id']){delete _0x5974e6[_0x0e5f('0x50')]['id'];}return db[_0x0e5f('0x31')][_0x0e5f('0x4f')]({'where':{'id':_0x5974e6[_0x0e5f('0x4c')]['id']}})[_0x0e5f('0x29')](handleEntityNotFound(_0x410410,null))['then'](saveUpdates(_0x5974e6['body'],null))[_0x0e5f('0x29')](respondWithResult(_0x410410,null))[_0x0e5f('0x4a')](handleError(_0x410410,null));};exports[_0x0e5f('0x2a')]=function(_0x4e5a4e,_0x13498f){return db[_0x0e5f('0x31')][_0x0e5f('0x4f')]({'where':{'id':_0x4e5a4e[_0x0e5f('0x4c')]['id']}})[_0x0e5f('0x29')](handleEntityNotFound(_0x13498f,null))[_0x0e5f('0x29')](removeEntity(_0x13498f,null))[_0x0e5f('0x4a')](handleError(_0x13498f,null));};exports[_0x0e5f('0x51')]=function(_0x502f2e,_0x506357){return db[_0x0e5f('0x31')][_0x0e5f('0x51')]()[_0x0e5f('0x29')](respondWithResult(_0x506357,null))['catch'](handleError(_0x506357,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index 4af05c8..1270ea7 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 _0x66f1=['cm_hopper_black','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./cmHopperBlack.attributes','define','CmHopperBlack'];(function(_0x4baae2,_0x487ab6){var _0x1a2285=function(_0x1cea47){while(--_0x1cea47){_0x4baae2['push'](_0x4baae2['shift']());}};_0x1a2285(++_0x487ab6);}(_0x66f1,0x175));var _0x166f=function(_0x1d227e,_0x361094){_0x1d227e=_0x1d227e-0x0;var _0x7ccf13=_0x66f1[_0x1d227e];return _0x7ccf13;};'use strict';var _=require(_0x166f('0x0'));var util=require(_0x166f('0x1'));var logger=require(_0x166f('0x2'))(_0x166f('0x3'));var moment=require(_0x166f('0x4'));var BPromise=require(_0x166f('0x5'));var rp=require(_0x166f('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x166f('0x7'));var config=require('../../config/environment');var attributes=require(_0x166f('0x8'));module['exports']=function(_0x3a30a6,_0xfef711){return _0x3a30a6[_0x166f('0x9')](_0x166f('0xa'),attributes,{'tableName':_0x166f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9664=['bluebird','path','rimraf','./cmHopperBlack.attributes','define','CmHopperBlack','cm_hopper_black','util','../../config/logger','api'];(function(_0x1b881d,_0xded95d){var _0x3b718e=function(_0x4f63e0){while(--_0x4f63e0){_0x1b881d['push'](_0x1b881d['shift']());}};_0x3b718e(++_0xded95d);}(_0x9664,0x13d));var _0x4966=function(_0x460a5d,_0x3e0529){_0x460a5d=_0x460a5d-0x0;var _0x55c0ac=_0x9664[_0x460a5d];return _0x55c0ac;};'use strict';var _=require('lodash');var util=require(_0x4966('0x0'));var logger=require(_0x4966('0x1'))(_0x4966('0x2'));var moment=require('moment');var BPromise=require(_0x4966('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4966('0x4'));var rimraf=require(_0x4966('0x5'));var config=require('../../config/environment');var attributes=require(_0x4966('0x6'));module['exports']=function(_0x501a9f,_0x4c10fb){return _0x501a9f[_0x4966('0x7')](_0x4966('0x8'),attributes,{'tableName':_0x4966('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.rpc.js b/server/api/cmHopperBlack/cmHopperBlack.rpc.js index 5560d94..30ae87e 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 _0x1997=['attributes','limit','include','map','model','UpdateCmHopperBlack','body','raw','debug','DestroyCmHopperBlack','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetCmHopperBlack','CmHopperBlack','findAll','options','where'];(function(_0x3b7bb4,_0x223886){var _0x51d0f3=function(_0x2977ea){while(--_0x2977ea){_0x3b7bb4['push'](_0x3b7bb4['shift']());}};_0x51d0f3(++_0x223886);}(_0x1997,0x92));var _0x7199=function(_0x13843a,_0x4fdeb9){_0x13843a=_0x13843a-0x0;var _0x23b5e4=_0x1997[_0x13843a];return _0x23b5e4;};'use strict';var _=require(_0x7199('0x0'));var util=require('util');var moment=require(_0x7199('0x1'));var BPromise=require(_0x7199('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7199('0x3'))['db'];var utils=require(_0x7199('0x4'));var logger=require(_0x7199('0x5'))(_0x7199('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x7199('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4075dc,_0x38443d,_0x13eb40){return new BPromise(function(_0x452204,_0x54c459){return client[_0x7199('0x8')](_0x4075dc,_0x13eb40)[_0x7199('0x9')](function(_0x1bcf2f){logger[_0x7199('0xa')](_0x7199('0xb'),_0x38443d,_0x7199('0xc'));logger['debug']('CmHopperBlack,\x20%s,\x20%s,\x20%s',_0x38443d,_0x7199('0xc'),JSON[_0x7199('0xd')](_0x1bcf2f));if(_0x1bcf2f['error']){if(_0x1bcf2f[_0x7199('0xe')][_0x7199('0xf')]===0x1f4){logger[_0x7199('0xe')]('CmHopperBlack,\x20%s,\x20%s',_0x38443d,_0x1bcf2f['error'][_0x7199('0x10')]);return _0x54c459(_0x1bcf2f['error']['message']);}logger[_0x7199('0xe')](_0x7199('0xb'),_0x38443d,_0x1bcf2f[_0x7199('0xe')]['message']);return _0x452204(_0x1bcf2f[_0x7199('0xe')][_0x7199('0x10')]);}else{logger[_0x7199('0xa')](_0x7199('0xb'),_0x38443d,'request\x20sent');_0x452204(_0x1bcf2f[_0x7199('0x11')][_0x7199('0x10')]);}})[_0x7199('0x12')](function(_0x23c220){logger['error']('CmHopperBlack,\x20%s,\x20%s',_0x38443d,_0x23c220);_0x54c459(_0x23c220);});});}exports[_0x7199('0x13')]=function(_0x5b6dc4){var _0x190e03=this;return new Promise(function(_0x420094,_0x3da686){return db[_0x7199('0x14')][_0x7199('0x15')]({'raw':_0x5b6dc4[_0x7199('0x16')]?_0x5b6dc4[_0x7199('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x5b6dc4['options']?_0x5b6dc4[_0x7199('0x16')][_0x7199('0x17')]||null:null,'attributes':_0x5b6dc4['options']?_0x5b6dc4[_0x7199('0x16')][_0x7199('0x18')]||null:null,'limit':_0x5b6dc4[_0x7199('0x16')]?_0x5b6dc4[_0x7199('0x16')][_0x7199('0x19')]||null:null,'include':_0x5b6dc4[_0x7199('0x16')]?_0x5b6dc4['options'][_0x7199('0x1a')]?_[_0x7199('0x1b')](_0x5b6dc4[_0x7199('0x16')][_0x7199('0x1a')],function(_0x1d7142){return{'model':db[_0x1d7142['model']],'as':_0x1d7142['as'],'attributes':_0x1d7142[_0x7199('0x18')],'include':_0x1d7142[_0x7199('0x1a')]?_[_0x7199('0x1b')](_0x1d7142['include'],function(_0x30a3dc){return{'model':db[_0x30a3dc[_0x7199('0x1c')]],'as':_0x30a3dc['as'],'attributes':_0x30a3dc[_0x7199('0x18')],'include':_0x30a3dc[_0x7199('0x1a')]?_[_0x7199('0x1b')](_0x30a3dc['include'],function(_0x2b4ad3){return{'model':db[_0x2b4ad3[_0x7199('0x1c')]],'as':_0x2b4ad3['as'],'attributes':_0x2b4ad3['attributes']};}):[]};}):[]};}):[]:[]})[_0x7199('0x9')](function(_0x3ea74e){logger[_0x7199('0xa')](_0x7199('0x13'),_0x5b6dc4);logger['debug'](_0x7199('0x13'),_0x5b6dc4,JSON[_0x7199('0xd')](_0x3ea74e));_0x420094(_0x3ea74e);})[_0x7199('0x12')](function(_0xe464c7){logger[_0x7199('0xe')](_0x7199('0x13'),_0xe464c7[_0x7199('0x10')],_0x5b6dc4);_0x3da686(_0x190e03[_0x7199('0xe')](0x1f4,_0xe464c7[_0x7199('0x10')]));});});};exports[_0x7199('0x1d')]=function(_0x197883){var _0x3891ff=this;return new Promise(function(_0x10a8ad,_0x3d0a6f){return db['CmHopperBlack']['update'](_0x197883[_0x7199('0x1e')],{'raw':_0x197883['options']?_0x197883[_0x7199('0x16')][_0x7199('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x197883[_0x7199('0x16')]?_0x197883[_0x7199('0x16')][_0x7199('0x17')]||null:null,'attributes':_0x197883['options']?_0x197883[_0x7199('0x16')]['attributes']||null:null,'limit':_0x197883[_0x7199('0x16')]?_0x197883['options']['limit']||null:null})[_0x7199('0x9')](function(_0x21028c){logger[_0x7199('0xa')](_0x7199('0x1d'),_0x197883);logger[_0x7199('0x20')](_0x7199('0x1d'),_0x197883,JSON['stringify'](_0x21028c));_0x10a8ad(_0x21028c);})[_0x7199('0x12')](function(_0x3114b){logger[_0x7199('0xe')]('UpdateCmHopperBlack',_0x3114b['message'],_0x197883);_0x3d0a6f(_0x3891ff[_0x7199('0xe')](0x1f4,_0x3114b['message']));});});};exports[_0x7199('0x21')]=function(_0x10ca81){var _0x3eb705=this;return new Promise(function(_0x444350,_0x3811fd){return db[_0x7199('0x14')]['destroy']({'where':_0x10ca81[_0x7199('0x16')]?_0x10ca81['options'][_0x7199('0x17')]||null:null})[_0x7199('0x9')](function(_0x2a546a){logger[_0x7199('0xa')]('DestroyCmHopperBlack',_0x10ca81);logger[_0x7199('0x20')]('DestroyCmHopperBlack',_0x10ca81,JSON[_0x7199('0xd')](_0x2a546a));_0x444350(_0x2a546a);})['catch'](function(_0x201e13){logger[_0x7199('0xe')](_0x7199('0x21'),_0x201e13[_0x7199('0x10')],_0x10ca81);_0x3811fd(_0x3eb705[_0x7199('0xe')](0x1f4,_0x201e13[_0x7199('0x10')]));});});}; \ No newline at end of file +var _0x4f75=['message','GetCmHopperBlack','CmHopperBlack','options','where','attributes','limit','include','map','model','catch','UpdateCmHopperBlack','update','raw','DestroyCmHopperBlack','destroy','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x397f2d,_0x16863e){var _0x2b2eb=function(_0x2bd841){while(--_0x2bd841){_0x397f2d['push'](_0x397f2d['shift']());}};_0x2b2eb(++_0x16863e);}(_0x4f75,0x166));var _0x54f7=function(_0x38cf75,_0x59fe8d){_0x38cf75=_0x38cf75-0x0;var _0x4cf87a=_0x4f75[_0x38cf75];return _0x4cf87a;};'use strict';var _=require('lodash');var util=require(_0x54f7('0x0'));var moment=require(_0x54f7('0x1'));var BPromise=require(_0x54f7('0x2'));var rs=require(_0x54f7('0x3'));var fs=require('fs');var Redis=require(_0x54f7('0x4'));var db=require(_0x54f7('0x5'))['db'];var utils=require(_0x54f7('0x6'));var logger=require(_0x54f7('0x7'))(_0x54f7('0x8'));var config=require('../../config/environment');var jayson=require(_0x54f7('0x9'));var client=jayson[_0x54f7('0xa')][_0x54f7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3be359,_0x527a68,_0x1cb82f){return new BPromise(function(_0x1b0652,_0x46c873){return client[_0x54f7('0xc')](_0x3be359,_0x1cb82f)[_0x54f7('0xd')](function(_0x2ccd2a){logger[_0x54f7('0xe')](_0x54f7('0xf'),_0x527a68,_0x54f7('0x10'));logger[_0x54f7('0x11')](_0x54f7('0x12'),_0x527a68,'request\x20sent',JSON[_0x54f7('0x13')](_0x2ccd2a));if(_0x2ccd2a['error']){if(_0x2ccd2a[_0x54f7('0x14')][_0x54f7('0x15')]===0x1f4){logger[_0x54f7('0x14')](_0x54f7('0xf'),_0x527a68,_0x2ccd2a[_0x54f7('0x14')]['message']);return _0x46c873(_0x2ccd2a[_0x54f7('0x14')][_0x54f7('0x16')]);}logger[_0x54f7('0x14')](_0x54f7('0xf'),_0x527a68,_0x2ccd2a['error'][_0x54f7('0x16')]);return _0x1b0652(_0x2ccd2a[_0x54f7('0x14')][_0x54f7('0x16')]);}else{logger[_0x54f7('0xe')](_0x54f7('0xf'),_0x527a68,_0x54f7('0x10'));_0x1b0652(_0x2ccd2a['result']['message']);}})['catch'](function(_0x2af9de){logger[_0x54f7('0x14')](_0x54f7('0xf'),_0x527a68,_0x2af9de);_0x46c873(_0x2af9de);});});}exports[_0x54f7('0x17')]=function(_0x35b9f3){var _0x2aef87=this;return new Promise(function(_0x152b22,_0x1ea4af){return db[_0x54f7('0x18')]['findAll']({'raw':_0x35b9f3[_0x54f7('0x19')]?_0x35b9f3[_0x54f7('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x35b9f3['options']?_0x35b9f3[_0x54f7('0x19')][_0x54f7('0x1a')]||null:null,'attributes':_0x35b9f3[_0x54f7('0x19')]?_0x35b9f3[_0x54f7('0x19')][_0x54f7('0x1b')]||null:null,'limit':_0x35b9f3[_0x54f7('0x19')]?_0x35b9f3['options'][_0x54f7('0x1c')]||null:null,'include':_0x35b9f3[_0x54f7('0x19')]?_0x35b9f3['options'][_0x54f7('0x1d')]?_[_0x54f7('0x1e')](_0x35b9f3[_0x54f7('0x19')][_0x54f7('0x1d')],function(_0x42dfbe){return{'model':db[_0x42dfbe['model']],'as':_0x42dfbe['as'],'attributes':_0x42dfbe[_0x54f7('0x1b')],'include':_0x42dfbe['include']?_[_0x54f7('0x1e')](_0x42dfbe[_0x54f7('0x1d')],function(_0x3a819c){return{'model':db[_0x3a819c[_0x54f7('0x1f')]],'as':_0x3a819c['as'],'attributes':_0x3a819c['attributes'],'include':_0x3a819c[_0x54f7('0x1d')]?_['map'](_0x3a819c[_0x54f7('0x1d')],function(_0x559321){return{'model':db[_0x559321[_0x54f7('0x1f')]],'as':_0x559321['as'],'attributes':_0x559321[_0x54f7('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x54f7('0xd')](function(_0x508a1c){logger[_0x54f7('0xe')](_0x54f7('0x17'),_0x35b9f3);logger['debug'](_0x54f7('0x17'),_0x35b9f3,JSON[_0x54f7('0x13')](_0x508a1c));_0x152b22(_0x508a1c);})[_0x54f7('0x20')](function(_0x393fbe){logger['error'](_0x54f7('0x17'),_0x393fbe[_0x54f7('0x16')],_0x35b9f3);_0x1ea4af(_0x2aef87['error'](0x1f4,_0x393fbe[_0x54f7('0x16')]));});});};exports[_0x54f7('0x21')]=function(_0x40f157){var _0x8ecb0e=this;return new Promise(function(_0x4a0cb0,_0x55a9a9){return db['CmHopperBlack'][_0x54f7('0x22')](_0x40f157['body'],{'raw':_0x40f157[_0x54f7('0x19')]?_0x40f157[_0x54f7('0x19')][_0x54f7('0x23')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x40f157['options']?_0x40f157[_0x54f7('0x19')]['where']||null:null,'attributes':_0x40f157['options']?_0x40f157[_0x54f7('0x19')][_0x54f7('0x1b')]||null:null,'limit':_0x40f157[_0x54f7('0x19')]?_0x40f157[_0x54f7('0x19')][_0x54f7('0x1c')]||null:null})[_0x54f7('0xd')](function(_0x323a75){logger[_0x54f7('0xe')](_0x54f7('0x21'),_0x40f157);logger[_0x54f7('0x11')](_0x54f7('0x21'),_0x40f157,JSON[_0x54f7('0x13')](_0x323a75));_0x4a0cb0(_0x323a75);})[_0x54f7('0x20')](function(_0x529d7c){logger[_0x54f7('0x14')]('UpdateCmHopperBlack',_0x529d7c['message'],_0x40f157);_0x55a9a9(_0x8ecb0e[_0x54f7('0x14')](0x1f4,_0x529d7c[_0x54f7('0x16')]));});});};exports[_0x54f7('0x24')]=function(_0x11d33e){var _0x11a28b=this;return new Promise(function(_0x23d044,_0x3e9d68){return db[_0x54f7('0x18')][_0x54f7('0x25')]({'where':_0x11d33e['options']?_0x11d33e[_0x54f7('0x19')][_0x54f7('0x1a')]||null:null})[_0x54f7('0xd')](function(_0x5821c4){logger[_0x54f7('0xe')]('DestroyCmHopperBlack',_0x11d33e);logger[_0x54f7('0x11')]('DestroyCmHopperBlack',_0x11d33e,JSON['stringify'](_0x5821c4));_0x23d044(_0x5821c4);})[_0x54f7('0x20')](function(_0xef22e7){logger['error']('DestroyCmHopperBlack',_0xef22e7[_0x54f7('0x16')],_0x11d33e);_0x3e9d68(_0x11a28b[_0x54f7('0x14')](0x1f4,_0xef22e7['message']));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index 590f8b1..4a68ea6 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 _0x4137=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','get','index','/describe','isAuthenticated','/:id','show','put','update','delete','exports','multer','util','path','connect-timeout'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x4137,0xf8));var _0x7413=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x4137[_0x413feb];return _0x40ee88;};'use strict';var multer=require(_0x7413('0x0'));var util=require(_0x7413('0x1'));var path=require(_0x7413('0x2'));var timeout=require(_0x7413('0x3'));var express=require(_0x7413('0x4'));var router=express[_0x7413('0x5')]();var fs_extra=require(_0x7413('0x6'));var auth=require(_0x7413('0x7'));var interaction=require(_0x7413('0x8'));var config=require(_0x7413('0x9'));var controller=require(_0x7413('0xa'));router[_0x7413('0xb')]('/',auth['isAuthenticated'](),controller[_0x7413('0xc')]);router[_0x7413('0xb')](_0x7413('0xd'),auth[_0x7413('0xe')](),controller['describe']);router[_0x7413('0xb')](_0x7413('0xf'),auth['isAuthenticated'](),controller[_0x7413('0x10')]);router[_0x7413('0x11')]('/:id',auth[_0x7413('0xe')](),controller[_0x7413('0x12')]);router[_0x7413('0x13')](_0x7413('0xf'),auth[_0x7413('0xe')](),controller['destroy']);module[_0x7413('0x14')]=router; \ No newline at end of file +var _0xeff8=['util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','isAuthenticated','index','get','/describe','describe','/:id','update','exports','multer'];(function(_0x55a79d,_0x5ec923){var _0x2ca054=function(_0x1670c7){while(--_0x1670c7){_0x55a79d['push'](_0x55a79d['shift']());}};_0x2ca054(++_0x5ec923);}(_0xeff8,0x186));var _0x8eff=function(_0x2ec461,_0x5f588a){_0x2ec461=_0x2ec461-0x0;var _0x28603d=_0xeff8[_0x2ec461];return _0x28603d;};'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']('/',auth[_0x8eff('0x9')](),controller[_0x8eff('0xa')]);router[_0x8eff('0xb')](_0x8eff('0xc'),auth['isAuthenticated'](),controller[_0x8eff('0xd')]);router[_0x8eff('0xb')](_0x8eff('0xe'),auth[_0x8eff('0x9')](),controller['show']);router['put'](_0x8eff('0xe'),auth[_0x8eff('0x9')](),controller[_0x8eff('0xf')]);router['delete'](_0x8eff('0xe'),auth[_0x8eff('0x9')](),controller['destroy']);module[_0x8eff('0x10')]=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index 5fe11db..07bf87f 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 _0x73f4=['sequelize','exports','INTEGER','STRING','DATE','getDataValue','endtime','followuptime','diff','BOOLEAN'];(function(_0x548604,_0x289b7e){var _0x12394c=function(_0x32bb42){while(--_0x32bb42){_0x548604['push'](_0x548604['shift']());}};_0x12394c(++_0x289b7e);}(_0x73f4,0xdc));var _0x473f=function(_0x2fee96,_0x2f735d){_0x2fee96=_0x2fee96-0x0;var _0x2e6ad1=_0x73f4[_0x2fee96];return _0x2e6ad1;};'use strict';var Sequelize=require(_0x473f('0x0'));var moment=require('moment');module[_0x473f('0x1')]={'state':{'type':Sequelize[_0x473f('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x473f('0x3')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0x473f('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x473f('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x473f('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x473f('0x3')]},'originatecalleridnum':{'type':Sequelize[_0x473f('0x3')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x473f('0x3')]},'calleridname':{'type':Sequelize[_0x473f('0x3')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x473f('0x4')]},'answertime':{'type':Sequelize[_0x473f('0x4')]},'droptime':{'type':Sequelize[_0x473f('0x4')]},'endtime':{'type':Sequelize[_0x473f('0x4')]},'ringtime':{'type':Sequelize[_0x473f('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x473f('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x473f('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x473f('0x3')]},'campaign':{'type':Sequelize[_0x473f('0x3')]},'campaigntype':{'type':Sequelize[_0x473f('0x3')]},'membername':{'type':Sequelize[_0x473f('0x3')]},'reason':{'type':Sequelize[_0x473f('0x3')]},'disposition':{'type':Sequelize[_0x473f('0x3')]},'secondDisposition':{'type':Sequelize[_0x473f('0x3')]},'thirdDisposition':{'type':Sequelize[_0x473f('0x3')]},'dispositionat':{'type':Sequelize[_0x473f('0x4')],'set':function(_0x434daa){var _0x3617da=this[_0x473f('0x5')](_0x473f('0x6'));if(_0x3617da&&_0x434daa){this['setDataValue'](_0x473f('0x7'),moment(_0x434daa)[_0x473f('0x8')](moment(_0x3617da),'seconds'));}}},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x473f('0x9')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x473f('0x9')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x473f('0x4')]},'callback':{'type':Sequelize[_0x473f('0x9')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x473f('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x473f('0x4')]},'deleted':{'type':Sequelize[_0x473f('0x3')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x473f('0x4')]},'recallme':{'type':Sequelize[_0x473f('0x9')],'defaultValue':![]},'agiafterat':{'type':Sequelize['DATE']},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x473f('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x473f('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x1055=['INTEGER','DATE','getDataValue','endtime','setDataValue','diff','BOOLEAN','moment','exports','STRING'];(function(_0x1487a2,_0x30a40f){var _0x440c63=function(_0x44e3a0){while(--_0x44e3a0){_0x1487a2['push'](_0x1487a2['shift']());}};_0x440c63(++_0x30a40f);}(_0x1055,0x89));var _0x5105=function(_0x36cff7,_0x5cb048){_0x36cff7=_0x36cff7-0x0;var _0x21c697=_0x1055[_0x36cff7];return _0x21c697;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x5105('0x0'));module[_0x5105('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x5105('0x2')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0x5105('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x5105('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x5105('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x5105('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x5105('0x2')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0x5105('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x5105('0x2')]},'starttime':{'type':Sequelize[_0x5105('0x4')]},'responsetime':{'type':Sequelize[_0x5105('0x4')]},'answertime':{'type':Sequelize[_0x5105('0x4')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x5105('0x4')]},'ringtime':{'type':Sequelize[_0x5105('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x5105('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x5105('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x5105('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x5105('0x2')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x5105('0x2')]},'membername':{'type':Sequelize[_0x5105('0x2')]},'reason':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x5105('0x2')]},'thirdDisposition':{'type':Sequelize[_0x5105('0x2')]},'dispositionat':{'type':Sequelize[_0x5105('0x4')],'set':function(_0x15f01a){var _0x5485ba=this[_0x5105('0x5')](_0x5105('0x6'));if(_0x5485ba&&_0x15f01a){this[_0x5105('0x7')]('followuptime',moment(_0x15f01a)[_0x5105('0x8')](moment(_0x5485ba),'seconds'));}}},'amd':{'type':Sequelize[_0x5105('0x9')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'blacklist':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x5105('0x9')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x5105('0x4')]},'callback':{'type':Sequelize[_0x5105('0x9')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x5105('0x4')]},'deleted':{'type':Sequelize['STRING'],'defaultValue':null},'deletedat':{'type':Sequelize[_0x5105('0x4')]},'recallme':{'type':Sequelize[_0x5105('0x9')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x5105('0x4')]},'countnosuchnumberretry':{'type':Sequelize[_0x5105('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x5105('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x5105('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x5105('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x5105('0x3')],'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 b102049..be77d0b 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 _0x687b=['filter','VIRTUAL','options','include','findAll','rows','show','length','includeAll','merge','find','catch','describe','body','uniqueid','params','countContactsQueueCampaignHopperFinal','sequelize','COUNT','literal','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2019,\x201,\x20null','moveContactsQueueCampaignHopperFinal','into','fromQuery','phone','scheduledAt','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','field','ANY_VALUE(calleridnum)','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','from','VoiceQueueId\x20=\x20?','toString','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','select','cm_hopper_final','state\x20=\x204','group','Campaign','cm_hopper','CampaignId','CampaignId\x20=\x20?','state\x20=\x20?','calleridnum','checkContactHopper','CmHopper','findOne','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','save','update','then','destroy','end','error','stack','name','send','index','map','CmHopperFinal','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where'];(function(_0x3a0ebd,_0x47f368){var _0x51a660=function(_0x4023e6){while(--_0x4023e6){_0x3a0ebd['push'](_0x3a0ebd['shift']());}};_0x51a660(++_0x47f368);}(_0x687b,0x14a));var _0xb687=function(_0x27125a,_0x252d0d){_0x27125a=_0x27125a-0x0;var _0x391f7a=_0x687b[_0x27125a];return _0x391f7a;};'use strict';var emlformat=require(_0xb687('0x0'));var rimraf=require(_0xb687('0x1'));var zipdir=require(_0xb687('0x2'));var jsonpatch=require(_0xb687('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb687('0x4'));var Mustache=require(_0xb687('0x5'));var util=require(_0xb687('0x6'));var path=require(_0xb687('0x7'));var sox=require(_0xb687('0x8'));var csv=require(_0xb687('0x9'));var ejs=require(_0xb687('0xa'));var fs=require('fs');var fs_extra=require(_0xb687('0xb'));var _=require(_0xb687('0xc'));var squel=require(_0xb687('0xd'));var crypto=require('crypto');var jsforce=require(_0xb687('0xe'));var deskjs=require(_0xb687('0xf'));var toCsv=require('to-csv');var querystring=require(_0xb687('0x10'));var Papa=require(_0xb687('0x11'));var Redis=require(_0xb687('0x12'));var authService=require(_0xb687('0x13'));var qs=require(_0xb687('0x14'));var as=require(_0xb687('0x15'));var hardwareService=require(_0xb687('0x16'));var logger=require(_0xb687('0x17'))(_0xb687('0x18'));var utils=require('../../config/utils');var config=require(_0xb687('0x19'));var licenseUtil=require(_0xb687('0x1a'));var db=require(_0xb687('0x1b'))['db'];function respondWithStatusCode(_0x12a0be,_0x4f9c19){_0x4f9c19=_0x4f9c19||0xcc;return function(_0x4c97ed){if(_0x4c97ed){return _0x12a0be[_0xb687('0x1c')](_0x4f9c19);}return _0x12a0be[_0xb687('0x1d')](_0x4f9c19)['end']();};}function respondWithResult(_0x108fd0,_0x2f1ac0){_0x2f1ac0=_0x2f1ac0||0xc8;return function(_0x1f1f35){if(_0x1f1f35){return _0x108fd0[_0xb687('0x1d')](_0x2f1ac0)[_0xb687('0x1e')](_0x1f1f35);}};}function respondWithFilteredResult(_0x3ab914,_0x30622f){return function(_0x141375){if(_0x141375){var _0x263085=typeof _0x30622f[_0xb687('0x1f')]===_0xb687('0x20')&&typeof _0x30622f[_0xb687('0x21')]==='undefined';var _0x214b06=_0x141375[_0xb687('0x22')];var _0x30d370=_0x263085?0x0:_0x30622f['offset'];var _0x48958d=_0x263085?_0x141375[_0xb687('0x22')]:_0x30622f[_0xb687('0x1f')]+_0x30622f[_0xb687('0x21')];var _0x4b593b;if(_0x48958d>=_0x214b06){_0x48958d=_0x214b06;_0x4b593b=0xc8;}else{_0x4b593b=0xce;}_0x3ab914[_0xb687('0x1d')](_0x4b593b);return _0x3ab914['set'](_0xb687('0x23'),_0x30d370+'-'+_0x48958d+'/'+_0x214b06)[_0xb687('0x1e')](_0x141375);}return null;};}function patchUpdates(_0x170dc0){return function(_0x44bd0b){try{jsonpatch['apply'](_0x44bd0b,_0x170dc0,!![]);}catch(_0x3a73d5){return BPromise['reject'](_0x3a73d5);}return _0x44bd0b[_0xb687('0x24')]();};}function saveUpdates(_0x90e892,_0x274241){return function(_0x546fde){if(_0x546fde){return _0x546fde[_0xb687('0x25')](_0x90e892)[_0xb687('0x26')](function(_0xa95e91){return _0xa95e91;});}return null;};}function removeEntity(_0x16cdcb,_0xbf6c58){return function(_0x38866c){if(_0x38866c){return _0x38866c[_0xb687('0x27')]()[_0xb687('0x26')](function(){_0x16cdcb['status'](0xcc)[_0xb687('0x28')]();});}};}function handleEntityNotFound(_0x129347,_0x1c1585){return function(_0x1a0261){if(!_0x1a0261){_0x129347[_0xb687('0x1c')](0x194);}return _0x1a0261;};}function handleError(_0x4136c9,_0x17ff2b){_0x17ff2b=_0x17ff2b||0x1f4;return function(_0x3cb2f2){logger[_0xb687('0x29')](_0x3cb2f2[_0xb687('0x2a')]);if(_0x3cb2f2['name']){delete _0x3cb2f2[_0xb687('0x2b')];}_0x4136c9[_0xb687('0x1d')](_0x17ff2b)[_0xb687('0x2c')](_0x3cb2f2);};}exports[_0xb687('0x2d')]=function(_0x2e5c8d,_0x173c58){var _0x4e9a06={},_0x28b69a={},_0x5143af={'count':0x0,'rows':[]};var _0x360429=_[_0xb687('0x2e')](db[_0xb687('0x2f')][_0xb687('0x30')],function(_0x1ad3ef){return{'name':_0x1ad3ef[_0xb687('0x31')],'type':_0x1ad3ef[_0xb687('0x32')]['key']};});_0x28b69a[_0xb687('0x33')]=_[_0xb687('0x2e')](_0x360429,_0xb687('0x2b'));_0x28b69a[_0xb687('0x34')]=_[_0xb687('0x35')](_0x2e5c8d[_0xb687('0x34')]);_0x28b69a[_0xb687('0x36')]=_[_0xb687('0x37')](_0x28b69a[_0xb687('0x33')],_0x28b69a[_0xb687('0x34')]);_0x4e9a06[_0xb687('0x38')]=_['intersection'](_0x28b69a['model'],qs[_0xb687('0x39')](_0x2e5c8d[_0xb687('0x34')][_0xb687('0x39')]));_0x4e9a06[_0xb687('0x38')]=_0x4e9a06['attributes']['length']?_0x4e9a06[_0xb687('0x38')]:_0x28b69a[_0xb687('0x33')];if(!_0x2e5c8d['query'][_0xb687('0x3a')](_0xb687('0x3b'))){_0x4e9a06['limit']=qs[_0xb687('0x21')](_0x2e5c8d['query'][_0xb687('0x21')]);_0x4e9a06[_0xb687('0x1f')]=qs[_0xb687('0x1f')](_0x2e5c8d[_0xb687('0x34')][_0xb687('0x1f')]);}_0x4e9a06[_0xb687('0x3c')]=qs['sort'](_0x2e5c8d[_0xb687('0x34')][_0xb687('0x3d')]);_0x4e9a06[_0xb687('0x3e')]=qs[_0xb687('0x36')](_['pick'](_0x2e5c8d[_0xb687('0x34')],_0x28b69a[_0xb687('0x36')]),_0x360429);if(_0x2e5c8d[_0xb687('0x34')][_0xb687('0x3f')]){_0x4e9a06[_0xb687('0x3e')]=_['merge'](_0x4e9a06[_0xb687('0x3e')],{'$or':_[_0xb687('0x2e')](_0x360429,function(_0x24c013){if(_0x24c013[_0xb687('0x32')]!==_0xb687('0x40')){var _0x29cf09={};_0x29cf09[_0x24c013['name']]={'$like':'%'+_0x2e5c8d['query'][_0xb687('0x3f')]+'%'};return _0x29cf09;}})});}_0x4e9a06=_['merge']({},_0x4e9a06,_0x2e5c8d[_0xb687('0x41')]);var _0x2f4550={'where':_0x4e9a06['where']};return db[_0xb687('0x2f')][_0xb687('0x22')](_0x2f4550)['then'](function(_0x394b56){_0x5143af[_0xb687('0x22')]=_0x394b56;if(_0x2e5c8d[_0xb687('0x34')]['includeAll']){_0x4e9a06[_0xb687('0x42')]=[{'all':!![]}];}return db[_0xb687('0x2f')][_0xb687('0x43')](_0x4e9a06);})[_0xb687('0x26')](function(_0x140388){_0x5143af[_0xb687('0x44')]=_0x140388;return _0x5143af;})[_0xb687('0x26')](respondWithFilteredResult(_0x173c58,_0x4e9a06))['catch'](handleError(_0x173c58,null));};exports[_0xb687('0x45')]=function(_0x4cf6ad,_0x50fdb7){var _0xa3a9e0={'raw':!![],'where':{'id':_0x4cf6ad['params']['id']}},_0x430364={};_0x430364[_0xb687('0x33')]=_['keys'](db[_0xb687('0x2f')][_0xb687('0x30')]);_0x430364['query']=_[_0xb687('0x35')](_0x4cf6ad[_0xb687('0x34')]);_0x430364['filters']=_[_0xb687('0x37')](_0x430364[_0xb687('0x33')],_0x430364[_0xb687('0x34')]);_0xa3a9e0[_0xb687('0x38')]=_[_0xb687('0x37')](_0x430364[_0xb687('0x33')],qs[_0xb687('0x39')](_0x4cf6ad[_0xb687('0x34')][_0xb687('0x39')]));_0xa3a9e0[_0xb687('0x38')]=_0xa3a9e0[_0xb687('0x38')][_0xb687('0x46')]?_0xa3a9e0['attributes']:_0x430364[_0xb687('0x33')];if(_0x4cf6ad['query'][_0xb687('0x47')]){_0xa3a9e0[_0xb687('0x42')]=[{'all':!![]}];}_0xa3a9e0=_[_0xb687('0x48')]({},_0xa3a9e0,_0x4cf6ad[_0xb687('0x41')]);return db[_0xb687('0x2f')][_0xb687('0x49')](_0xa3a9e0)['then'](handleEntityNotFound(_0x50fdb7,null))['then'](respondWithResult(_0x50fdb7,null))[_0xb687('0x4a')](handleError(_0x50fdb7,null));};exports[_0xb687('0x4b')]=function(_0x40558a,_0x4f3069){return db['CmHopperFinal'][_0xb687('0x4b')]()[_0xb687('0x26')](respondWithResult(_0x4f3069,null))[_0xb687('0x4a')](handleError(_0x4f3069,null));};exports[_0xb687('0x25')]=function(_0x535c00,_0x33a0b0){if(_0x535c00[_0xb687('0x4c')][_0xb687('0x4d')]){delete _0x535c00[_0xb687('0x4c')]['uniqueid'];}return db['CmHopperFinal'][_0xb687('0x49')]({'where':{'uniqueid':_0x535c00[_0xb687('0x4e')]['id']}})[_0xb687('0x26')](handleEntityNotFound(_0x33a0b0,null))['then'](saveUpdates(_0x535c00['body'],null))[_0xb687('0x26')](respondWithResult(_0x33a0b0,null))[_0xb687('0x4a')](handleError(_0x33a0b0,null));};exports[_0xb687('0x4f')]=function(_0x22e618,_0x34205d,_0x1fb31a){return db[_0xb687('0x2f')][_0xb687('0x43')]({'raw':![],'where':{'VoiceQueueId':_0x22e618['params']['id']},'attributes':[[db[_0xb687('0x50')]['fn'](_0xb687('0x51'),db[_0xb687('0x50')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x200,\x201,\x20null'))),'noSuchContacts'],[db[_0xb687('0x50')]['fn'](_0xb687('0x51'),db[_0xb687('0x50')]['fn']('IF',db[_0xb687('0x50')][_0xb687('0x52')](_0xb687('0x53')))),_0xb687('0x54')],[db[_0xb687('0x50')]['fn'](_0xb687('0x51'),db[_0xb687('0x50')]['fn']('IF',db[_0xb687('0x50')][_0xb687('0x52')](_0xb687('0x55')))),_0xb687('0x56')],[db[_0xb687('0x50')]['fn'](_0xb687('0x51'),db[_0xb687('0x50')]['fn']('IF',db['sequelize']['literal'](_0xb687('0x57')))),_0xb687('0x58')],[db[_0xb687('0x50')]['fn'](_0xb687('0x51'),db['sequelize']['fn']('IF',db[_0xb687('0x50')][_0xb687('0x52')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0xb687('0x59')],[db['sequelize']['fn'](_0xb687('0x51'),db[_0xb687('0x50')]['fn']('IF',db['sequelize']['literal'](_0xb687('0x5a')))),_0xb687('0x5b')],[db['sequelize']['fn'](_0xb687('0x51'),db[_0xb687('0x50')]['fn']('IF',db[_0xb687('0x50')]['literal'](_0xb687('0x5c')))),'reCallContacts'],[db[_0xb687('0x50')]['fn'](_0xb687('0x51'),db[_0xb687('0x50')]['fn']('IF',db[_0xb687('0x50')][_0xb687('0x52')]('`state`\x20=\x2019,\x201,\x20null'))),'answeringMachine']]})[_0xb687('0x26')](handleEntityNotFound(_0x34205d,null))['then'](respondWithResult(_0x34205d,null))['catch'](handleError(_0x34205d,null));};exports['countContactsIvrCampaignHopperFinal']=function(_0x5d266c,_0x1cc507,_0x1db4ca){return db[_0xb687('0x2f')][_0xb687('0x43')]({'raw':![],'where':{'CampaignId':_0x5d266c[_0xb687('0x4e')]['id']},'attributes':[[db[_0xb687('0x50')]['fn'](_0xb687('0x51'),db[_0xb687('0x50')]['fn']('IF',db[_0xb687('0x50')][_0xb687('0x52')](_0xb687('0x5d')))),'noSuchContacts'],[db['sequelize']['fn'](_0xb687('0x51'),db['sequelize']['fn']('IF',db[_0xb687('0x50')][_0xb687('0x52')](_0xb687('0x53')))),_0xb687('0x54')],[db[_0xb687('0x50')]['fn']('COUNT',db[_0xb687('0x50')]['fn']('IF',db['sequelize'][_0xb687('0x52')](_0xb687('0x55')))),_0xb687('0x56')],[db[_0xb687('0x50')]['fn'](_0xb687('0x51'),db[_0xb687('0x50')]['fn']('IF',db[_0xb687('0x50')]['literal'](_0xb687('0x57')))),_0xb687('0x58')],[db[_0xb687('0x50')]['fn'](_0xb687('0x51'),db[_0xb687('0x50')]['fn']('IF',db['sequelize'][_0xb687('0x52')](_0xb687('0x5e')))),_0xb687('0x59')],[db[_0xb687('0x50')]['fn'](_0xb687('0x51'),db[_0xb687('0x50')]['fn']('IF',db[_0xb687('0x50')][_0xb687('0x52')](_0xb687('0x5a')))),_0xb687('0x5b')],[db[_0xb687('0x50')]['fn']('COUNT',db[_0xb687('0x50')]['fn']('IF',db[_0xb687('0x50')][_0xb687('0x52')](_0xb687('0x5c')))),'reCallContacts'],[db[_0xb687('0x50')]['fn'](_0xb687('0x51'),db['sequelize']['fn']('IF',db[_0xb687('0x50')][_0xb687('0x52')](_0xb687('0x5f')))),'answeringMachine']]})[_0xb687('0x26')](handleEntityNotFound(_0x1cc507,null))[_0xb687('0x26')](respondWithResult(_0x1cc507,null))['catch'](handleError(_0x1cc507,null));};exports[_0xb687('0x60')]=function(_0x5449c4,_0x2c2add,_0x431cc5){return db['VoiceQueue'][_0xb687('0x49')]({'where':{'id':_0x5449c4[_0xb687('0x4e')]['id']}})['then'](handleEntityNotFound(_0x2c2add,null))[_0xb687('0x26')](function(_0x1736ef){var _0x52285e;if(_0x1736ef){_0x52285e=squel['insert']()[_0xb687('0x61')]('cm_hopper')[_0xb687('0x62')]([_0xb687('0x63'),_0xb687('0x64'),_0xb687('0x65'),_0xb687('0x66'),_0xb687('0x67'),_0xb687('0x68'),_0xb687('0x69')],squel['select']()[_0xb687('0x6a')](_0xb687('0x6b'),_0xb687('0x63'))[_0xb687('0x6a')](_0xb687('0x6c'),_0xb687('0x64'))['field'](_0xb687('0x6d'),_0xb687('0x65'))['field'](_0xb687('0x6e'),_0xb687('0x66'))[_0xb687('0x6a')](_0xb687('0x6f'),'VoiceQueueId')[_0xb687('0x6a')]('NOW()','createdAt')[_0xb687('0x6a')]('NOW()','updatedAt')[_0xb687('0x70')]('cm_hopper_final')[_0xb687('0x3e')](_0xb687('0x71'),_0x5449c4['params']['id'][_0xb687('0x72')]())[_0xb687('0x3e')]('state\x20=\x20?',_0x5449c4[_0xb687('0x4c')][_0xb687('0x73')][_0xb687('0x72')]())[_0xb687('0x3e')](_0xb687('0x74'))[_0xb687('0x3e')](_0xb687('0x75'),squel[_0xb687('0x76')]()[_0xb687('0x6a')](_0xb687('0x63'))[_0xb687('0x70')]('cm_hopper')[_0xb687('0x3e')]('VoiceQueueId\x20=\x20?',_0x5449c4['params']['id'][_0xb687('0x72')]()))[_0xb687('0x3e')](_0xb687('0x75'),squel[_0xb687('0x76')]()[_0xb687('0x6a')]('calleridnum')['from'](_0xb687('0x77'))[_0xb687('0x3e')](_0xb687('0x71'),_0x5449c4[_0xb687('0x4e')]['id']['toString']())[_0xb687('0x3e')](_0xb687('0x78')))[_0xb687('0x79')](_0xb687('0x65')))[_0xb687('0x72')]();return db[_0xb687('0x50')][_0xb687('0x34')](_0x52285e);}return[];})[_0xb687('0x26')](respondWithResult(_0x2c2add,null))[_0xb687('0x4a')](handleError(_0x2c2add,null));};exports['moveContactsIvrCampaignHopperFinal']=function(_0x25f5c3,_0x33d1fc,_0x207953){return db[_0xb687('0x7a')][_0xb687('0x49')]({'where':{'id':_0x25f5c3['params']['id']}})[_0xb687('0x26')](handleEntityNotFound(_0x33d1fc,null))[_0xb687('0x26')](function(_0x48bbee){var _0x19ac6d;if(_0x48bbee){_0x19ac6d=squel['insert']()[_0xb687('0x61')](_0xb687('0x7b'))['fromQuery']([_0xb687('0x63'),_0xb687('0x64'),'ContactId',_0xb687('0x66'),_0xb687('0x7c'),_0xb687('0x68'),_0xb687('0x69')],squel[_0xb687('0x76')]()[_0xb687('0x6a')]('ANY_VALUE(calleridnum)',_0xb687('0x63'))[_0xb687('0x6a')](_0xb687('0x6c'),_0xb687('0x64'))[_0xb687('0x6a')](_0xb687('0x6d'),_0xb687('0x65'))[_0xb687('0x6a')](_0xb687('0x6e'),_0xb687('0x66'))[_0xb687('0x6a')]('ANY_VALUE(CampaignId)',_0xb687('0x7c'))['field'](_0xb687('0x6c'),_0xb687('0x68'))['field']('NOW()',_0xb687('0x69'))[_0xb687('0x70')](_0xb687('0x77'))[_0xb687('0x3e')](_0xb687('0x7d'),_0x25f5c3[_0xb687('0x4e')]['id'][_0xb687('0x72')]())[_0xb687('0x3e')](_0xb687('0x7e'),_0x25f5c3[_0xb687('0x4c')][_0xb687('0x73')][_0xb687('0x72')]())[_0xb687('0x3e')](_0xb687('0x74'))[_0xb687('0x3e')](_0xb687('0x75'),squel['select']()['field'](_0xb687('0x63'))['from']('cm_hopper')[_0xb687('0x3e')](_0xb687('0x7d'),_0x25f5c3['params']['id'][_0xb687('0x72')]()))[_0xb687('0x3e')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0xb687('0x76')]()[_0xb687('0x6a')](_0xb687('0x7f'))[_0xb687('0x70')](_0xb687('0x77'))[_0xb687('0x3e')](_0xb687('0x7d'),_0x25f5c3[_0xb687('0x4e')]['id'][_0xb687('0x72')]())['where'](_0xb687('0x78')))[_0xb687('0x79')]('ContactId'))[_0xb687('0x72')]();return db['sequelize'][_0xb687('0x34')](_0x19ac6d);}return[];})[_0xb687('0x26')](respondWithResult(_0x33d1fc,null))['catch'](handleError(_0x33d1fc,null));};exports[_0xb687('0x80')]=function(_0x20e46a,_0x1c389f,_0x45d0ab){return db[_0xb687('0x81')][_0xb687('0x82')]({'where':{'VoiceQueueId':_0x20e46a[_0xb687('0x4c')]['VoiceQueueId'],'CampaignId':_0x20e46a['body'][_0xb687('0x7c')],'ContactId':_0x20e46a['body'][_0xb687('0x65')]}})[_0xb687('0x26')](handleEntityNotFound(_0x1c389f,null))[_0xb687('0x26')](function(_0x312529){if(_0x312529){return _0x312529;}return null;})['then'](respondWithResult(_0x1c389f,null))[_0xb687('0x4a')](handleError(_0x1c389f,null));}; \ No newline at end of file +var _0x430c=['field','phone','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','CampaignId','ANY_VALUE(calleridnum)','ANY_VALUE(CampaignId)','createdAt','CampaignId\x20=\x20?','state\x20=\x20?','calleridnum\x20IS\x20NOT\x20NULL','from','checkContactHopper','CmHopper','findOne','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','status','end','json','limit','undefined','offset','count','set','Content-Range','then','destroy','error','stack','name','send','index','CmHopperFinal','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','describe','update','uniqueid','body','find','COUNT','sequelize','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','countContactsIvrCampaignHopperFinal','`state`\x20=\x208,\x201,\x20null','dropContacts','answeringMachine','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','into','scheduledAt','ContactId','ListId','VoiceQueueId','updatedAt','select'];(function(_0x4283c8,_0x10f507){var _0x5baece=function(_0x48045d){while(--_0x48045d){_0x4283c8['push'](_0x4283c8['shift']());}};_0x5baece(++_0x10f507);}(_0x430c,0x1a1));var _0xc430=function(_0x2afb44,_0x249a57){_0x2afb44=_0x2afb44-0x0;var _0x15ccc2=_0x430c[_0x2afb44];return _0x15ccc2;};'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['describe']=function(_0x10db27,_0x4eafae){return db[_0xc430('0x25')][_0xc430('0x44')]()[_0xc430('0x1e')](respondWithResult(_0x4eafae,null))['catch'](handleError(_0x4eafae,null));};exports[_0xc430('0x45')]=function(_0x2e7052,_0x19e563){if(_0x2e7052['body'][_0xc430('0x46')]){delete _0x2e7052[_0xc430('0x47')][_0xc430('0x46')];}return db[_0xc430('0x25')][_0xc430('0x48')]({'where':{'uniqueid':_0x2e7052[_0xc430('0x42')]['id']}})[_0xc430('0x1e')](handleEntityNotFound(_0x19e563,null))['then'](saveUpdates(_0x2e7052[_0xc430('0x47')],null))[_0xc430('0x1e')](respondWithResult(_0x19e563,null))[_0xc430('0x40')](handleError(_0x19e563,null));};exports['countContactsQueueCampaignHopperFinal']=function(_0x23cb41,_0x4178d7,_0x2d064b){return db[_0xc430('0x25')]['findAll']({'raw':![],'where':{'VoiceQueueId':_0x23cb41[_0xc430('0x42')]['id']},'attributes':[[db['sequelize']['fn'](_0xc430('0x49'),db[_0xc430('0x4a')]['fn']('IF',db[_0xc430('0x4a')][_0xc430('0x4b')](_0xc430('0x4c')))),_0xc430('0x4d')],[db['sequelize']['fn'](_0xc430('0x49'),db[_0xc430('0x4a')]['fn']('IF',db['sequelize'][_0xc430('0x4b')](_0xc430('0x4e')))),_0xc430('0x4f')],[db[_0xc430('0x4a')]['fn']('COUNT',db[_0xc430('0x4a')]['fn']('IF',db['sequelize'][_0xc430('0x4b')](_0xc430('0x50')))),_0xc430('0x51')],[db[_0xc430('0x4a')]['fn']('COUNT',db[_0xc430('0x4a')]['fn']('IF',db[_0xc430('0x4a')]['literal']('`state`\x20=\x208,\x201,\x20null'))),_0xc430('0x52')],[db[_0xc430('0x4a')]['fn'](_0xc430('0x49'),db[_0xc430('0x4a')]['fn']('IF',db[_0xc430('0x4a')][_0xc430('0x4b')](_0xc430('0x53')))),'dropContacts'],[db[_0xc430('0x4a')]['fn']('COUNT',db[_0xc430('0x4a')]['fn']('IF',db[_0xc430('0x4a')][_0xc430('0x4b')](_0xc430('0x54')))),_0xc430('0x55')],[db[_0xc430('0x4a')]['fn']('COUNT',db[_0xc430('0x4a')]['fn']('IF',db[_0xc430('0x4a')][_0xc430('0x4b')](_0xc430('0x56')))),_0xc430('0x57')],[db[_0xc430('0x4a')]['fn'](_0xc430('0x49'),db['sequelize']['fn']('IF',db[_0xc430('0x4a')]['literal'](_0xc430('0x58')))),'answeringMachine']]})[_0xc430('0x1e')](handleEntityNotFound(_0x4178d7,null))[_0xc430('0x1e')](respondWithResult(_0x4178d7,null))[_0xc430('0x40')](handleError(_0x4178d7,null));};exports[_0xc430('0x59')]=function(_0x147062,_0x45eec6,_0x5d3393){return db[_0xc430('0x25')][_0xc430('0x3e')]({'raw':![],'where':{'CampaignId':_0x147062['params']['id']},'attributes':[[db['sequelize']['fn'](_0xc430('0x49'),db[_0xc430('0x4a')]['fn']('IF',db[_0xc430('0x4a')][_0xc430('0x4b')](_0xc430('0x4c')))),_0xc430('0x4d')],[db[_0xc430('0x4a')]['fn'](_0xc430('0x49'),db[_0xc430('0x4a')]['fn']('IF',db[_0xc430('0x4a')][_0xc430('0x4b')](_0xc430('0x4e')))),'noAnswerContacts'],[db['sequelize']['fn'](_0xc430('0x49'),db['sequelize']['fn']('IF',db[_0xc430('0x4a')][_0xc430('0x4b')]('`state`\x20=\x205,\x201,\x20null'))),_0xc430('0x51')],[db['sequelize']['fn']('COUNT',db[_0xc430('0x4a')]['fn']('IF',db[_0xc430('0x4a')]['literal'](_0xc430('0x5a')))),'congestionContacts'],[db['sequelize']['fn'](_0xc430('0x49'),db[_0xc430('0x4a')]['fn']('IF',db[_0xc430('0x4a')][_0xc430('0x4b')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0xc430('0x5b')],[db[_0xc430('0x4a')]['fn'](_0xc430('0x49'),db[_0xc430('0x4a')]['fn']('IF',db['sequelize'][_0xc430('0x4b')](_0xc430('0x54')))),_0xc430('0x55')],[db[_0xc430('0x4a')]['fn'](_0xc430('0x49'),db[_0xc430('0x4a')]['fn']('IF',db[_0xc430('0x4a')][_0xc430('0x4b')](_0xc430('0x56')))),_0xc430('0x57')],[db[_0xc430('0x4a')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0xc430('0x4b')](_0xc430('0x58')))),_0xc430('0x5c')]]})['then'](handleEntityNotFound(_0x45eec6,null))['then'](respondWithResult(_0x45eec6,null))[_0xc430('0x40')](handleError(_0x45eec6,null));};exports[_0xc430('0x5d')]=function(_0x31ae3c,_0x19c080,_0x256290){return db[_0xc430('0x5e')][_0xc430('0x48')]({'where':{'id':_0x31ae3c[_0xc430('0x42')]['id']}})[_0xc430('0x1e')](handleEntityNotFound(_0x19c080,null))[_0xc430('0x1e')](function(_0x5ca0f2){var _0x6debfb;if(_0x5ca0f2){_0x6debfb=squel[_0xc430('0x5f')]()[_0xc430('0x60')]('cm_hopper')['fromQuery'](['phone',_0xc430('0x61'),_0xc430('0x62'),_0xc430('0x63'),_0xc430('0x64'),'createdAt',_0xc430('0x65')],squel[_0xc430('0x66')]()[_0xc430('0x67')]('ANY_VALUE(calleridnum)',_0xc430('0x68'))['field'](_0xc430('0x69'),_0xc430('0x61'))[_0xc430('0x67')](_0xc430('0x6a'),_0xc430('0x62'))['field'](_0xc430('0x6b'),_0xc430('0x63'))[_0xc430('0x67')](_0xc430('0x6c'),'VoiceQueueId')['field'](_0xc430('0x69'),'createdAt')['field'](_0xc430('0x69'),_0xc430('0x65'))['from'](_0xc430('0x6d'))[_0xc430('0x34')](_0xc430('0x6e'),_0x31ae3c[_0xc430('0x42')]['id'][_0xc430('0x6f')]())[_0xc430('0x34')]('state\x20=\x20?',_0x31ae3c[_0xc430('0x47')][_0xc430('0x70')][_0xc430('0x6f')]())[_0xc430('0x34')]('calleridnum\x20IS\x20NOT\x20NULL')[_0xc430('0x34')](_0xc430('0x71'),squel[_0xc430('0x66')]()['field'](_0xc430('0x68'))['from']('cm_hopper')[_0xc430('0x34')]('VoiceQueueId\x20=\x20?',_0x31ae3c[_0xc430('0x42')]['id']['toString']()))[_0xc430('0x34')](_0xc430('0x71'),squel['select']()[_0xc430('0x67')](_0xc430('0x72'))['from'](_0xc430('0x6d'))[_0xc430('0x34')]('VoiceQueueId\x20=\x20?',_0x31ae3c[_0xc430('0x42')]['id'][_0xc430('0x6f')]())['where'](_0xc430('0x73')))[_0xc430('0x74')](_0xc430('0x62')))[_0xc430('0x6f')]();return db[_0xc430('0x4a')][_0xc430('0x2c')](_0x6debfb);}return[];})[_0xc430('0x1e')](respondWithResult(_0x19c080,null))[_0xc430('0x40')](handleError(_0x19c080,null));};exports[_0xc430('0x75')]=function(_0x19789f,_0x24b380,_0x4fe467){return db[_0xc430('0x76')][_0xc430('0x48')]({'where':{'id':_0x19789f[_0xc430('0x42')]['id']}})['then'](handleEntityNotFound(_0x24b380,null))['then'](function(_0x150a8a){var _0x4edead;if(_0x150a8a){_0x4edead=squel[_0xc430('0x5f')]()[_0xc430('0x60')]('cm_hopper')['fromQuery']([_0xc430('0x68'),_0xc430('0x61'),_0xc430('0x62'),'ListId',_0xc430('0x77'),'createdAt','updatedAt'],squel[_0xc430('0x66')]()[_0xc430('0x67')](_0xc430('0x78'),'phone')[_0xc430('0x67')](_0xc430('0x69'),_0xc430('0x61'))[_0xc430('0x67')](_0xc430('0x6a'),'ContactId')['field'](_0xc430('0x6b'),_0xc430('0x63'))[_0xc430('0x67')](_0xc430('0x79'),_0xc430('0x77'))[_0xc430('0x67')](_0xc430('0x69'),_0xc430('0x7a'))[_0xc430('0x67')](_0xc430('0x69'),_0xc430('0x65'))['from'](_0xc430('0x6d'))[_0xc430('0x34')](_0xc430('0x7b'),_0x19789f[_0xc430('0x42')]['id']['toString']())['where'](_0xc430('0x7c'),_0x19789f['body'][_0xc430('0x70')][_0xc430('0x6f')]())[_0xc430('0x34')](_0xc430('0x7d'))[_0xc430('0x34')]('calleridnum\x20NOT\x20IN\x20(?)',squel['select']()['field']('phone')[_0xc430('0x7e')]('cm_hopper')['where'](_0xc430('0x7b'),_0x19789f[_0xc430('0x42')]['id'][_0xc430('0x6f')]()))[_0xc430('0x34')](_0xc430('0x71'),squel[_0xc430('0x66')]()[_0xc430('0x67')](_0xc430('0x72'))[_0xc430('0x7e')](_0xc430('0x6d'))[_0xc430('0x34')](_0xc430('0x7b'),_0x19789f[_0xc430('0x42')]['id']['toString']())[_0xc430('0x34')](_0xc430('0x73')))[_0xc430('0x74')](_0xc430('0x62')))[_0xc430('0x6f')]();return db[_0xc430('0x4a')][_0xc430('0x2c')](_0x4edead);}return[];})[_0xc430('0x1e')](respondWithResult(_0x24b380,null))['catch'](handleError(_0x24b380,null));};exports[_0xc430('0x7f')]=function(_0x6e48a3,_0x5be78a,_0x3bd6e1){return db[_0xc430('0x80')][_0xc430('0x81')]({'where':{'VoiceQueueId':_0x6e48a3[_0xc430('0x47')]['VoiceQueueId'],'CampaignId':_0x6e48a3[_0xc430('0x47')]['CampaignId'],'ContactId':_0x6e48a3['body'][_0xc430('0x62')]}})[_0xc430('0x1e')](handleEntityNotFound(_0x5be78a,null))[_0xc430('0x1e')](function(_0x207067){if(_0x207067){return _0x207067;}return null;})[_0xc430('0x1e')](respondWithResult(_0x5be78a,null))[_0xc430('0x40')](handleError(_0x5be78a,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index 0d10ea2..6968192 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 _0x7d04=['path','rimraf','../../config/environment','exports','define','calleridnum','uniqueid','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x4f8d92,_0x4e38e9){var _0x294d97=function(_0x4521d2){while(--_0x4521d2){_0x4f8d92['push'](_0x4f8d92['shift']());}};_0x294d97(++_0x4e38e9);}(_0x7d04,0x7c));var _0x47d0=function(_0x502d81,_0x49d6a4){_0x502d81=_0x502d81-0x0;var _0x592db5=_0x7d04[_0x502d81];return _0x592db5;};'use strict';var _=require(_0x47d0('0x0'));var util=require(_0x47d0('0x1'));var logger=require(_0x47d0('0x2'))(_0x47d0('0x3'));var moment=require(_0x47d0('0x4'));var BPromise=require('bluebird');var rp=require(_0x47d0('0x5'));var fs=require('fs');var path=require(_0x47d0('0x6'));var rimraf=require(_0x47d0('0x7'));var config=require(_0x47d0('0x8'));var attributes=require('./cmHopperFinal.attributes');module[_0x47d0('0x9')]=function(_0x43a92c,_0x53a8bd){return _0x43a92c[_0x47d0('0xa')]('CmHopperFinal',attributes,{'tableName':'cm_hopper_final','paranoid':![],'indexes':[{'name':'calleridnum','fields':[_0x47d0('0xb')]},{'name':_0x47d0('0xc'),'fields':[_0x47d0('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8ea6=['define','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./cmHopperFinal.attributes','exports'];(function(_0xbb091,_0x3fe7ee){var _0x467a04=function(_0x3a978d){while(--_0x3a978d){_0xbb091['push'](_0xbb091['shift']());}};_0x467a04(++_0x3fe7ee);}(_0x8ea6,0x10f));var _0x68ea=function(_0x392ca7,_0x3bada9){_0x392ca7=_0x392ca7-0x0;var _0x2add14=_0x8ea6[_0x392ca7];return _0x2add14;};'use strict';var _=require('lodash');var util=require(_0x68ea('0x0'));var logger=require(_0x68ea('0x1'))(_0x68ea('0x2'));var moment=require(_0x68ea('0x3'));var BPromise=require(_0x68ea('0x4'));var rp=require(_0x68ea('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x68ea('0x6'));var attributes=require(_0x68ea('0x7'));module[_0x68ea('0x8')]=function(_0x93e0c1,_0x2d12fd){return _0x93e0c1[_0x68ea('0x9')](_0x68ea('0xa'),attributes,{'tableName':_0x68ea('0xb'),'paranoid':![],'indexes':[{'name':_0x68ea('0xc'),'fields':[_0x68ea('0xc')]},{'name':_0x68ea('0xd'),'fields':[_0x68ea('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index 0a6ce70..4ea38c9 100644 --- a/server/api/cmHopperFinal/cmHopperFinal.rpc.js +++ b/server/api/cmHopperFinal/cmHopperFinal.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperFinal,\x20%s,\x20%s','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateCmHopperFinal','CmHopperFinal','create','options','raw'];(function(_0x386a08,_0x15ebd7){var _0x2bd829=function(_0x2485c0){while(--_0x2485c0){_0x386a08['push'](_0x386a08['shift']());}};_0x2bd829(++_0x15ebd7);}(_0xb10b,0x12a));var _0xbb10=function(_0x3805e9,_0x33a4ed){_0x3805e9=_0x3805e9-0x0;var _0x207e20=_0xb10b[_0x3805e9];return _0x207e20;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![]})[_0xbb10('0xc')](function(_0xdf237d){logger[_0xbb10('0xd')]('CreateCmHopperFinal',_0x378da8);logger[_0xbb10('0x1a')](_0xbb10('0x15'),_0x378da8,JSON['stringify'](_0xdf237d));_0x575cca(_0xdf237d);})['catch'](function(_0x8e2b97){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x8e2b97[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x8e2b97[_0xbb10('0x13')]));});});}; \ No newline at end of file +var _0x7a54=['../../config/environment','jayson/promise','http','info','CmHopperFinal,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','CmHopperFinal','create','body','options','raw','CreateCmHopperFinal','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0xca89e3,_0x2926da){var _0x1f00c2=function(_0x53a608){while(--_0x53a608){_0xca89e3['push'](_0xca89e3['shift']());}};_0x1f00c2(++_0x2926da);}(_0x7a54,0x106));var _0x47a5=function(_0x3be70f,_0x52bbfc){_0x3be70f=_0x3be70f-0x0;var _0x5b6e68=_0x7a54[_0x3be70f];return _0x5b6e68;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('CmHopperFinal,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['CreateCmHopperFinal']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateCmHopperFinal',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/index.js b/server/api/cmHopperFinal/index.js index bda36fa..53fff56 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 _0x7348=['../../components/auth/service','../../components/interaction/service','./cmHopperFinal.controller','isAuthenticated','get','/describe','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','put','/:id','update','exports','util','path','express','Router','fs-extra'];(function(_0x50f9c0,_0x4b97dd){var _0x114a23=function(_0x2e2c25){while(--_0x2e2c25){_0x50f9c0['push'](_0x50f9c0['shift']());}};_0x114a23(++_0x4b97dd);}(_0x7348,0x16b));var _0x8734=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x7348[_0x167cc1];return _0x10bc4b;};'use strict';var multer=require('multer');var util=require(_0x8734('0x0'));var path=require(_0x8734('0x1'));var timeout=require('connect-timeout');var express=require(_0x8734('0x2'));var router=express[_0x8734('0x3')]();var fs_extra=require(_0x8734('0x4'));var auth=require(_0x8734('0x5'));var interaction=require(_0x8734('0x6'));var config=require('../../config/environment');var controller=require(_0x8734('0x7'));router['get']('/',auth[_0x8734('0x8')](),controller['index']);router[_0x8734('0x9')](_0x8734('0xa'),auth[_0x8734('0x8')](),controller['describe']);router[_0x8734('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x8734('0xb')]);router['get'](_0x8734('0xc'),auth['isAuthenticated'](),controller[_0x8734('0xd')]);router[_0x8734('0x9')](_0x8734('0xe'),auth[_0x8734('0x8')](),controller['countContactsIvrCampaignHopperFinal']);router[_0x8734('0xf')](_0x8734('0x10'),auth[_0x8734('0x8')](),controller[_0x8734('0x11')]);router[_0x8734('0xf')](_0x8734('0x12'),auth[_0x8734('0x8')](),controller['moveContactsIvrCampaignHopperFinal']);router[_0x8734('0xf')]('/checkContactHopper',auth['isAuthenticated'](),controller['checkContactHopper']);router[_0x8734('0x13')](_0x8734('0x14'),auth[_0x8734('0x8')](),controller[_0x8734('0x15')]);module[_0x8734('0x16')]=router; \ No newline at end of file +var _0xc5c6=['connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','isAuthenticated','index','get','describe','/:id','show','/voice/queue/countAttributes/:id','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','/checkContactHopper','checkContactHopper','put','update','exports','util','path'];(function(_0x40e7b3,_0x23a8e7){var _0x2cfb20=function(_0x4cb603){while(--_0x4cb603){_0x40e7b3['push'](_0x40e7b3['shift']());}};_0x2cfb20(++_0x23a8e7);}(_0xc5c6,0x184));var _0x6c5c=function(_0x5a9c0c,_0x4ec485){_0x5a9c0c=_0x5a9c0c-0x0;var _0x53c77d=_0xc5c6[_0x5a9c0c];return _0x53c77d;};'use strict';var multer=require('multer');var util=require(_0x6c5c('0x0'));var path=require(_0x6c5c('0x1'));var timeout=require(_0x6c5c('0x2'));var express=require(_0x6c5c('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x6c5c('0x4'));var interaction=require(_0x6c5c('0x5'));var config=require(_0x6c5c('0x6'));var controller=require(_0x6c5c('0x7'));router['get']('/',auth[_0x6c5c('0x8')](),controller[_0x6c5c('0x9')]);router[_0x6c5c('0xa')]('/describe',auth[_0x6c5c('0x8')](),controller[_0x6c5c('0xb')]);router[_0x6c5c('0xa')](_0x6c5c('0xc'),auth['isAuthenticated'](),controller[_0x6c5c('0xd')]);router['get'](_0x6c5c('0xe'),auth[_0x6c5c('0x8')](),controller['countContactsQueueCampaignHopperFinal']);router['get'](_0x6c5c('0xf'),auth[_0x6c5c('0x8')](),controller[_0x6c5c('0x10')]);router[_0x6c5c('0x11')](_0x6c5c('0x12'),auth[_0x6c5c('0x8')](),controller[_0x6c5c('0x13')]);router[_0x6c5c('0x11')](_0x6c5c('0x14'),auth['isAuthenticated'](),controller['moveContactsIvrCampaignHopperFinal']);router[_0x6c5c('0x11')](_0x6c5c('0x15'),auth[_0x6c5c('0x8')](),controller[_0x6c5c('0x16')]);router[_0x6c5c('0x17')](_0x6c5c('0xc'),auth['isAuthenticated'](),controller[_0x6c5c('0x18')]);module[_0x6c5c('0x19')]=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index eadb737..eb317c7 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 _0x9c0b=['INTEGER','BOOLEAN','sequelize','exports','STRING','DATE'];(function(_0x88f752,_0x943f24){var _0x226eb7=function(_0x10057b){while(--_0x10057b){_0x88f752['push'](_0x88f752['shift']());}};_0x226eb7(++_0x943f24);}(_0x9c0b,0xc8));var _0xb9c0=function(_0x294e64,_0x22460a){_0x294e64=_0x294e64-0x0;var _0x42b05b=_0x9c0b[_0x294e64];return _0x42b05b;};'use strict';var Sequelize=require(_0xb9c0('0x0'));module[_0xb9c0('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0xb9c0('0x2')]},'scheduledat':{'type':Sequelize[_0xb9c0('0x3')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xb9c0('0x4')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xb9c0('0x4')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xb9c0('0x2')]},'originatecalleridnum':{'type':Sequelize[_0xb9c0('0x2')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xb9c0('0x2')]},'calleridname':{'type':Sequelize[_0xb9c0('0x2')]},'starttime':{'type':Sequelize[_0xb9c0('0x3')]},'responsetime':{'type':Sequelize[_0xb9c0('0x3')]},'answertime':{'type':Sequelize[_0xb9c0('0x3')]},'droptime':{'type':Sequelize[_0xb9c0('0x3')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0xb9c0('0x4')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xb9c0('0x4')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xb9c0('0x4')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xb9c0('0x4')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xb9c0('0x2')]},'campaign':{'type':Sequelize[_0xb9c0('0x2')]},'campaigntype':{'type':Sequelize[_0xb9c0('0x2')]},'membername':{'type':Sequelize[_0xb9c0('0x2')]},'reason':{'type':Sequelize[_0xb9c0('0x2')]},'amd':{'type':Sequelize[_0xb9c0('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0xb9c0('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0xb9c0('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xb9c0('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xb9c0('0x3')]},'recallme':{'type':Sequelize[_0xb9c0('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize['DATE']},'edited':{'type':Sequelize[_0xb9c0('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0xb9c0('0x4')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xb9c0('0x4')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xb9c0('0x4')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xb9c0('0x4')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xb9c0('0x2')]}}; \ No newline at end of file +var _0xf132=['sequelize','INTEGER','DATE','STRING','BOOLEAN'];(function(_0xa29e2b,_0x5c83a2){var _0x494035=function(_0x3b351b){while(--_0x3b351b){_0xa29e2b['push'](_0xa29e2b['shift']());}};_0x494035(++_0x5c83a2);}(_0xf132,0xaa));var _0x2f13=function(_0x4f0923,_0x118831){_0x4f0923=_0x4f0923-0x0;var _0x184380=_0xf132[_0x4f0923];return _0x184380;};'use strict';var Sequelize=require(_0x2f13('0x0'));module['exports']={'state':{'type':Sequelize[_0x2f13('0x1')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x2f13('0x2')]},'countbusyretry':{'type':Sequelize[_0x2f13('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x2f13('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x2f13('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x2f13('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0x2f13('0x3')]},'originatecalleridname':{'type':Sequelize[_0x2f13('0x3')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x2f13('0x2')]},'responsetime':{'type':Sequelize[_0x2f13('0x2')]},'answertime':{'type':Sequelize[_0x2f13('0x2')]},'droptime':{'type':Sequelize[_0x2f13('0x2')]},'endtime':{'type':Sequelize[_0x2f13('0x2')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x2f13('0x1')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x2f13('0x1')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x2f13('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x2f13('0x3')]},'campaign':{'type':Sequelize[_0x2f13('0x3')]},'campaigntype':{'type':Sequelize[_0x2f13('0x3')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0x2f13('0x3')]},'amd':{'type':Sequelize[_0x2f13('0x4')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x2f13('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x2f13('0x2')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'editedat':{'type':Sequelize[_0x2f13('0x2')]},'edited':{'type':Sequelize[_0x2f13('0x4')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x2f13('0x1')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x2f13('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x2f13('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x2f13('0x1')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x2f13('0x3')]}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index 40fb4cf..9a8f986 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 _0x4d1f=['create','body','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','Content-Range','apply','update','then','end','sendStatus','error','stack','name','index','map','CmHopperHistory','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','include','find','catch'];(function(_0x579d69,_0x25d50e){var _0x5e2b18=function(_0x54b258){while(--_0x54b258){_0x579d69['push'](_0x579d69['shift']());}};_0x5e2b18(++_0x25d50e);}(_0x4d1f,0x166));var _0xf4d1=function(_0x1168ed,_0x38daf0){_0x1168ed=_0x1168ed-0x0;var _0x366a8f=_0x4d1f[_0x1168ed];return _0x366a8f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf4d1('0x0'));var zipdir=require(_0xf4d1('0x1'));var jsonpatch=require(_0xf4d1('0x2'));var rp=require(_0xf4d1('0x3'));var moment=require(_0xf4d1('0x4'));var BPromise=require(_0xf4d1('0x5'));var Mustache=require(_0xf4d1('0x6'));var util=require(_0xf4d1('0x7'));var path=require('path');var sox=require(_0xf4d1('0x8'));var csv=require(_0xf4d1('0x9'));var ejs=require(_0xf4d1('0xa'));var fs=require('fs');var fs_extra=require(_0xf4d1('0xb'));var _=require('lodash');var squel=require(_0xf4d1('0xc'));var crypto=require(_0xf4d1('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xf4d1('0xe'));var Papa=require(_0xf4d1('0xf'));var Redis=require(_0xf4d1('0x10'));var authService=require(_0xf4d1('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xf4d1('0x12'))(_0xf4d1('0x13'));var utils=require('../../config/utils');var config=require(_0xf4d1('0x14'));var licenseUtil=require(_0xf4d1('0x15'));var db=require(_0xf4d1('0x16'))['db'];function respondWithStatusCode(_0x4c7c03,_0x114253){_0x114253=_0x114253||0xcc;return function(_0x2521b7){if(_0x2521b7){return _0x4c7c03['sendStatus'](_0x114253);}return _0x4c7c03['status'](_0x114253)['end']();};}function respondWithResult(_0x25d6f4,_0x47260e){_0x47260e=_0x47260e||0xc8;return function(_0x597ad7){if(_0x597ad7){return _0x25d6f4[_0xf4d1('0x17')](_0x47260e)[_0xf4d1('0x18')](_0x597ad7);}};}function respondWithFilteredResult(_0x27dd5f,_0xcd90a4){return function(_0x552ea7){if(_0x552ea7){var _0x1f3cb6=typeof _0xcd90a4[_0xf4d1('0x19')]===_0xf4d1('0x1a')&&typeof _0xcd90a4[_0xf4d1('0x1b')]===_0xf4d1('0x1a');var _0x5636c3=_0x552ea7[_0xf4d1('0x1c')];var _0x2d7f03=_0x1f3cb6?0x0:_0xcd90a4[_0xf4d1('0x19')];var _0x19f7fd=_0x1f3cb6?_0x552ea7['count']:_0xcd90a4[_0xf4d1('0x19')]+_0xcd90a4[_0xf4d1('0x1b')];var _0x4dd649;if(_0x19f7fd>=_0x5636c3){_0x19f7fd=_0x5636c3;_0x4dd649=0xc8;}else{_0x4dd649=0xce;}_0x27dd5f[_0xf4d1('0x17')](_0x4dd649);return _0x27dd5f['set'](_0xf4d1('0x1d'),_0x2d7f03+'-'+_0x19f7fd+'/'+_0x5636c3)[_0xf4d1('0x18')](_0x552ea7);}return null;};}function patchUpdates(_0x5ca8ec){return function(_0x4191ce){try{jsonpatch[_0xf4d1('0x1e')](_0x4191ce,_0x5ca8ec,!![]);}catch(_0x373f47){return BPromise['reject'](_0x373f47);}return _0x4191ce['save']();};}function saveUpdates(_0x43838a,_0x57d5a4){return function(_0x3eff8d){if(_0x3eff8d){return _0x3eff8d[_0xf4d1('0x1f')](_0x43838a)['then'](function(_0xd099ca){return _0xd099ca;});}return null;};}function removeEntity(_0x20cc22,_0x59c43a){return function(_0x555f00){if(_0x555f00){return _0x555f00['destroy']()[_0xf4d1('0x20')](function(){_0x20cc22[_0xf4d1('0x17')](0xcc)[_0xf4d1('0x21')]();});}};}function handleEntityNotFound(_0x38f6ae,_0x4e5eef){return function(_0x18639e){if(!_0x18639e){_0x38f6ae[_0xf4d1('0x22')](0x194);}return _0x18639e;};}function handleError(_0x4ffe7c,_0x54ec6c){_0x54ec6c=_0x54ec6c||0x1f4;return function(_0x7d2e2f){logger[_0xf4d1('0x23')](_0x7d2e2f[_0xf4d1('0x24')]);if(_0x7d2e2f[_0xf4d1('0x25')]){delete _0x7d2e2f[_0xf4d1('0x25')];}_0x4ffe7c[_0xf4d1('0x17')](_0x54ec6c)['send'](_0x7d2e2f);};}exports[_0xf4d1('0x26')]=function(_0x5924a7,_0x52a05b){var _0x516127={},_0x6cb1b4={},_0x3ee486={'count':0x0,'rows':[]};var _0x50d4a1=_[_0xf4d1('0x27')](db[_0xf4d1('0x28')][_0xf4d1('0x29')],function(_0x24074c){return{'name':_0x24074c[_0xf4d1('0x2a')],'type':_0x24074c['type'][_0xf4d1('0x2b')]};});_0x6cb1b4[_0xf4d1('0x2c')]=_['map'](_0x50d4a1,'name');_0x6cb1b4[_0xf4d1('0x2d')]=_[_0xf4d1('0x2e')](_0x5924a7[_0xf4d1('0x2d')]);_0x6cb1b4[_0xf4d1('0x2f')]=_[_0xf4d1('0x30')](_0x6cb1b4['model'],_0x6cb1b4[_0xf4d1('0x2d')]);_0x516127[_0xf4d1('0x31')]=_[_0xf4d1('0x30')](_0x6cb1b4['model'],qs[_0xf4d1('0x32')](_0x5924a7[_0xf4d1('0x2d')][_0xf4d1('0x32')]));_0x516127['attributes']=_0x516127[_0xf4d1('0x31')][_0xf4d1('0x33')]?_0x516127['attributes']:_0x6cb1b4[_0xf4d1('0x2c')];if(!_0x5924a7[_0xf4d1('0x2d')]['hasOwnProperty'](_0xf4d1('0x34'))){_0x516127['limit']=qs['limit'](_0x5924a7[_0xf4d1('0x2d')][_0xf4d1('0x1b')]);_0x516127['offset']=qs[_0xf4d1('0x19')](_0x5924a7[_0xf4d1('0x2d')]['offset']);}_0x516127[_0xf4d1('0x35')]=qs['sort'](_0x5924a7[_0xf4d1('0x2d')][_0xf4d1('0x36')]);_0x516127[_0xf4d1('0x37')]=qs[_0xf4d1('0x2f')](_[_0xf4d1('0x38')](_0x5924a7[_0xf4d1('0x2d')],_0x6cb1b4[_0xf4d1('0x2f')]),_0x50d4a1);if(_0x5924a7[_0xf4d1('0x2d')][_0xf4d1('0x39')]){_0x516127[_0xf4d1('0x37')]=_[_0xf4d1('0x3a')](_0x516127['where'],{'$or':_[_0xf4d1('0x27')](_0x50d4a1,function(_0x16a7b4){if(_0x16a7b4[_0xf4d1('0x3b')]!==_0xf4d1('0x3c')){var _0x1e7a11={};_0x1e7a11[_0x16a7b4['name']]={'$like':'%'+_0x5924a7[_0xf4d1('0x2d')][_0xf4d1('0x39')]+'%'};return _0x1e7a11;}})});}_0x516127=_[_0xf4d1('0x3a')]({},_0x516127,_0x5924a7[_0xf4d1('0x3d')]);var _0x24ada9={'where':_0x516127[_0xf4d1('0x37')]};return db['CmHopperHistory'][_0xf4d1('0x1c')](_0x24ada9)['then'](function(_0x4cd76a){_0x3ee486['count']=_0x4cd76a;if(_0x5924a7[_0xf4d1('0x2d')][_0xf4d1('0x3e')]){_0x516127['include']=[{'all':!![]}];}return db[_0xf4d1('0x28')][_0xf4d1('0x3f')](_0x516127);})[_0xf4d1('0x20')](function(_0x54de20){_0x3ee486[_0xf4d1('0x40')]=_0x54de20;return _0x3ee486;})[_0xf4d1('0x20')](respondWithFilteredResult(_0x52a05b,_0x516127))['catch'](handleError(_0x52a05b,null));};exports['show']=function(_0x211b8f,_0x1cc221){var _0xf9ac5f={'raw':!![],'where':{'id':_0x211b8f['params']['id']}},_0x5e2ccb={};_0x5e2ccb['model']=_['keys'](db[_0xf4d1('0x28')]['rawAttributes']);_0x5e2ccb[_0xf4d1('0x2d')]=_['keys'](_0x211b8f[_0xf4d1('0x2d')]);_0x5e2ccb[_0xf4d1('0x2f')]=_[_0xf4d1('0x30')](_0x5e2ccb[_0xf4d1('0x2c')],_0x5e2ccb[_0xf4d1('0x2d')]);_0xf9ac5f[_0xf4d1('0x31')]=_['intersection'](_0x5e2ccb[_0xf4d1('0x2c')],qs['fields'](_0x211b8f[_0xf4d1('0x2d')]['fields']));_0xf9ac5f['attributes']=_0xf9ac5f[_0xf4d1('0x31')][_0xf4d1('0x33')]?_0xf9ac5f[_0xf4d1('0x31')]:_0x5e2ccb[_0xf4d1('0x2c')];if(_0x211b8f['query'][_0xf4d1('0x3e')]){_0xf9ac5f[_0xf4d1('0x41')]=[{'all':!![]}];}_0xf9ac5f=_['merge']({},_0xf9ac5f,_0x211b8f['options']);return db[_0xf4d1('0x28')][_0xf4d1('0x42')](_0xf9ac5f)[_0xf4d1('0x20')](handleEntityNotFound(_0x1cc221,null))[_0xf4d1('0x20')](respondWithResult(_0x1cc221,null))[_0xf4d1('0x43')](handleError(_0x1cc221,null));};exports[_0xf4d1('0x44')]=function(_0x11a2fd,_0x526e2f){return db[_0xf4d1('0x28')][_0xf4d1('0x44')](_0x11a2fd[_0xf4d1('0x45')],{})[_0xf4d1('0x20')](respondWithResult(_0x526e2f,0xc9))[_0xf4d1('0x43')](handleError(_0x526e2f,null));};exports['describe']=function(_0x1fde47,_0x22ee40){return db[_0xf4d1('0x28')]['describe']()[_0xf4d1('0x20')](respondWithResult(_0x22ee40,null))[_0xf4d1('0x43')](handleError(_0x22ee40,null));};exports[_0xf4d1('0x1f')]=function(_0x10f574,_0x4efb00){if(_0x10f574['body']['uniqueid']){delete _0x10f574[_0xf4d1('0x45')]['uniqueid'];}return db[_0xf4d1('0x28')][_0xf4d1('0x42')]({'where':{'uniqueid':_0x10f574[_0xf4d1('0x46')]['id']}})[_0xf4d1('0x20')](handleEntityNotFound(_0x4efb00,null))[_0xf4d1('0x20')](saveUpdates(_0x10f574[_0xf4d1('0x45')],null))[_0xf4d1('0x20')](respondWithResult(_0x4efb00,null))[_0xf4d1('0x43')](handleError(_0x4efb00,null));}; \ No newline at end of file +var _0x3e8c=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','update','then','destroy','name','index','map','CmHopperHistory','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','uniqueid','eml-format'];(function(_0x5280f4,_0x3c36d0){var _0xba93e7=function(_0x14d63a){while(--_0x14d63a){_0x5280f4['push'](_0x5280f4['shift']());}};_0xba93e7(++_0x3c36d0);}(_0x3e8c,0x17b));var _0xc3e8=function(_0x2300a6,_0x1d6ab7){_0x2300a6=_0x2300a6-0x0;var _0x6d76e3=_0x3e8c[_0x2300a6];return _0x6d76e3;};'use strict';var emlformat=require(_0xc3e8('0x0'));var rimraf=require(_0xc3e8('0x1'));var zipdir=require(_0xc3e8('0x2'));var jsonpatch=require(_0xc3e8('0x3'));var rp=require(_0xc3e8('0x4'));var moment=require(_0xc3e8('0x5'));var BPromise=require(_0xc3e8('0x6'));var Mustache=require(_0xc3e8('0x7'));var util=require(_0xc3e8('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0xc3e8('0x9'));var ejs=require(_0xc3e8('0xa'));var fs=require('fs');var fs_extra=require(_0xc3e8('0xb'));var _=require(_0xc3e8('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xc3e8('0xd'));var deskjs=require(_0xc3e8('0xe'));var toCsv=require(_0xc3e8('0x9'));var querystring=require(_0xc3e8('0xf'));var Papa=require('papaparse');var Redis=require(_0xc3e8('0x10'));var authService=require(_0xc3e8('0x11'));var qs=require(_0xc3e8('0x12'));var as=require(_0xc3e8('0x13'));var hardwareService=require(_0xc3e8('0x14'));var logger=require(_0xc3e8('0x15'))(_0xc3e8('0x16'));var utils=require('../../config/utils');var config=require(_0xc3e8('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xc3e8('0x18'))['db'];function respondWithStatusCode(_0x2dfc67,_0x5a0377){_0x5a0377=_0x5a0377||0xcc;return function(_0x2aa273){if(_0x2aa273){return _0x2dfc67[_0xc3e8('0x19')](_0x5a0377);}return _0x2dfc67[_0xc3e8('0x1a')](_0x5a0377)[_0xc3e8('0x1b')]();};}function respondWithResult(_0x4e198a,_0x226d4c){_0x226d4c=_0x226d4c||0xc8;return function(_0x1e4bb4){if(_0x1e4bb4){return _0x4e198a[_0xc3e8('0x1a')](_0x226d4c)[_0xc3e8('0x1c')](_0x1e4bb4);}};}function respondWithFilteredResult(_0x4b7703,_0xbd3ef5){return function(_0x292bde){if(_0x292bde){var _0x39e568=typeof _0xbd3ef5['offset']===_0xc3e8('0x1d')&&typeof _0xbd3ef5[_0xc3e8('0x1e')]==='undefined';var _0x21fd7f=_0x292bde[_0xc3e8('0x1f')];var _0x4eb9ee=_0x39e568?0x0:_0xbd3ef5[_0xc3e8('0x20')];var _0x511330=_0x39e568?_0x292bde[_0xc3e8('0x1f')]:_0xbd3ef5[_0xc3e8('0x20')]+_0xbd3ef5['limit'];var _0x238f77;if(_0x511330>=_0x21fd7f){_0x511330=_0x21fd7f;_0x238f77=0xc8;}else{_0x238f77=0xce;}_0x4b7703[_0xc3e8('0x1a')](_0x238f77);return _0x4b7703['set'](_0xc3e8('0x21'),_0x4eb9ee+'-'+_0x511330+'/'+_0x21fd7f)['json'](_0x292bde);}return null;};}function patchUpdates(_0x3a7cdc){return function(_0x4c7362){try{jsonpatch[_0xc3e8('0x22')](_0x4c7362,_0x3a7cdc,!![]);}catch(_0x579326){return BPromise[_0xc3e8('0x23')](_0x579326);}return _0x4c7362['save']();};}function saveUpdates(_0x31454b,_0x3f4df8){return function(_0x45d2aa){if(_0x45d2aa){return _0x45d2aa[_0xc3e8('0x24')](_0x31454b)[_0xc3e8('0x25')](function(_0x42f107){return _0x42f107;});}return null;};}function removeEntity(_0x5af930,_0x5bf036){return function(_0x551309){if(_0x551309){return _0x551309[_0xc3e8('0x26')]()[_0xc3e8('0x25')](function(){_0x5af930[_0xc3e8('0x1a')](0xcc)[_0xc3e8('0x1b')]();});}};}function handleEntityNotFound(_0x15f104,_0x81c960){return function(_0x514779){if(!_0x514779){_0x15f104[_0xc3e8('0x19')](0x194);}return _0x514779;};}function handleError(_0x468c58,_0x2e307f){_0x2e307f=_0x2e307f||0x1f4;return function(_0x339cac){logger['error'](_0x339cac['stack']);if(_0x339cac[_0xc3e8('0x27')]){delete _0x339cac['name'];}_0x468c58[_0xc3e8('0x1a')](_0x2e307f)['send'](_0x339cac);};}exports[_0xc3e8('0x28')]=function(_0x3e2a3f,_0x141614){var _0x26679f={},_0x3ded09={},_0x397ed7={'count':0x0,'rows':[]};var _0x56895c=_[_0xc3e8('0x29')](db[_0xc3e8('0x2a')][_0xc3e8('0x2b')],function(_0x474432){return{'name':_0x474432[_0xc3e8('0x2c')],'type':_0x474432[_0xc3e8('0x2d')][_0xc3e8('0x2e')]};});_0x3ded09[_0xc3e8('0x2f')]=_['map'](_0x56895c,_0xc3e8('0x27'));_0x3ded09[_0xc3e8('0x30')]=_[_0xc3e8('0x31')](_0x3e2a3f[_0xc3e8('0x30')]);_0x3ded09[_0xc3e8('0x32')]=_['intersection'](_0x3ded09[_0xc3e8('0x2f')],_0x3ded09[_0xc3e8('0x30')]);_0x26679f[_0xc3e8('0x33')]=_[_0xc3e8('0x34')](_0x3ded09['model'],qs[_0xc3e8('0x35')](_0x3e2a3f[_0xc3e8('0x30')][_0xc3e8('0x35')]));_0x26679f[_0xc3e8('0x33')]=_0x26679f[_0xc3e8('0x33')][_0xc3e8('0x36')]?_0x26679f[_0xc3e8('0x33')]:_0x3ded09[_0xc3e8('0x2f')];if(!_0x3e2a3f[_0xc3e8('0x30')][_0xc3e8('0x37')]('nolimit')){_0x26679f[_0xc3e8('0x1e')]=qs[_0xc3e8('0x1e')](_0x3e2a3f['query'][_0xc3e8('0x1e')]);_0x26679f[_0xc3e8('0x20')]=qs['offset'](_0x3e2a3f[_0xc3e8('0x30')]['offset']);}_0x26679f[_0xc3e8('0x38')]=qs[_0xc3e8('0x39')](_0x3e2a3f[_0xc3e8('0x30')][_0xc3e8('0x39')]);_0x26679f['where']=qs['filters'](_[_0xc3e8('0x3a')](_0x3e2a3f[_0xc3e8('0x30')],_0x3ded09[_0xc3e8('0x32')]),_0x56895c);if(_0x3e2a3f['query'][_0xc3e8('0x3b')]){_0x26679f[_0xc3e8('0x3c')]=_[_0xc3e8('0x3d')](_0x26679f[_0xc3e8('0x3c')],{'$or':_[_0xc3e8('0x29')](_0x56895c,function(_0x23ec8d){if(_0x23ec8d[_0xc3e8('0x2d')]!==_0xc3e8('0x3e')){var _0xda4d84={};_0xda4d84[_0x23ec8d[_0xc3e8('0x27')]]={'$like':'%'+_0x3e2a3f['query'][_0xc3e8('0x3b')]+'%'};return _0xda4d84;}})});}_0x26679f=_['merge']({},_0x26679f,_0x3e2a3f[_0xc3e8('0x3f')]);var _0x2d573c={'where':_0x26679f[_0xc3e8('0x3c')]};return db['CmHopperHistory']['count'](_0x2d573c)[_0xc3e8('0x25')](function(_0x208a4d){_0x397ed7['count']=_0x208a4d;if(_0x3e2a3f[_0xc3e8('0x30')][_0xc3e8('0x40')]){_0x26679f[_0xc3e8('0x41')]=[{'all':!![]}];}return db['CmHopperHistory'][_0xc3e8('0x42')](_0x26679f);})['then'](function(_0x5311f9){_0x397ed7[_0xc3e8('0x43')]=_0x5311f9;return _0x397ed7;})['then'](respondWithFilteredResult(_0x141614,_0x26679f))[_0xc3e8('0x44')](handleError(_0x141614,null));};exports[_0xc3e8('0x45')]=function(_0x3c6712,_0x5bab03){var _0x4d14eb={'raw':!![],'where':{'id':_0x3c6712[_0xc3e8('0x46')]['id']}},_0x30d58c={};_0x30d58c[_0xc3e8('0x2f')]=_[_0xc3e8('0x31')](db[_0xc3e8('0x2a')][_0xc3e8('0x2b')]);_0x30d58c[_0xc3e8('0x30')]=_[_0xc3e8('0x31')](_0x3c6712[_0xc3e8('0x30')]);_0x30d58c[_0xc3e8('0x32')]=_['intersection'](_0x30d58c[_0xc3e8('0x2f')],_0x30d58c[_0xc3e8('0x30')]);_0x4d14eb['attributes']=_[_0xc3e8('0x34')](_0x30d58c[_0xc3e8('0x2f')],qs['fields'](_0x3c6712['query'][_0xc3e8('0x35')]));_0x4d14eb['attributes']=_0x4d14eb[_0xc3e8('0x33')][_0xc3e8('0x36')]?_0x4d14eb[_0xc3e8('0x33')]:_0x30d58c[_0xc3e8('0x2f')];if(_0x3c6712[_0xc3e8('0x30')]['includeAll']){_0x4d14eb[_0xc3e8('0x41')]=[{'all':!![]}];}_0x4d14eb=_[_0xc3e8('0x3d')]({},_0x4d14eb,_0x3c6712[_0xc3e8('0x3f')]);return db[_0xc3e8('0x2a')][_0xc3e8('0x47')](_0x4d14eb)[_0xc3e8('0x25')](handleEntityNotFound(_0x5bab03,null))[_0xc3e8('0x25')](respondWithResult(_0x5bab03,null))[_0xc3e8('0x44')](handleError(_0x5bab03,null));};exports['create']=function(_0x31970a,_0x64270a){return db[_0xc3e8('0x2a')][_0xc3e8('0x48')](_0x31970a[_0xc3e8('0x49')],{})['then'](respondWithResult(_0x64270a,0xc9))[_0xc3e8('0x44')](handleError(_0x64270a,null));};exports['describe']=function(_0x47082a,_0x2a8b3b){return db[_0xc3e8('0x2a')][_0xc3e8('0x4a')]()[_0xc3e8('0x25')](respondWithResult(_0x2a8b3b,null))['catch'](handleError(_0x2a8b3b,null));};exports['update']=function(_0x7f586e,_0x5dc36f){if(_0x7f586e[_0xc3e8('0x49')][_0xc3e8('0x4b')]){delete _0x7f586e['body'][_0xc3e8('0x4b')];}return db[_0xc3e8('0x2a')][_0xc3e8('0x47')]({'where':{'uniqueid':_0x7f586e['params']['id']}})[_0xc3e8('0x25')](handleEntityNotFound(_0x5dc36f,null))['then'](saveUpdates(_0x7f586e[_0xc3e8('0x49')],null))[_0xc3e8('0x25')](respondWithResult(_0x5dc36f,null))[_0xc3e8('0x44')](handleError(_0x5dc36f,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index 7c9b48f..536cf15 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 _0x6da9=['./cmHopperHistory.attributes','exports','define','cm_hopper_history','endtime','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x4c3ffe,_0x457374){var _0x28d3eb=function(_0x3ae2a3){while(--_0x3ae2a3){_0x4c3ffe['push'](_0x4c3ffe['shift']());}};_0x28d3eb(++_0x457374);}(_0x6da9,0x161));var _0x96da=function(_0x305c83,_0x1d142a){_0x305c83=_0x305c83-0x0;var _0x180efd=_0x6da9[_0x305c83];return _0x180efd;};'use strict';var _=require(_0x96da('0x0'));var util=require(_0x96da('0x1'));var logger=require(_0x96da('0x2'))(_0x96da('0x3'));var moment=require(_0x96da('0x4'));var BPromise=require(_0x96da('0x5'));var rp=require(_0x96da('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x96da('0x7'));module[_0x96da('0x8')]=function(_0x26fdbb,_0x5c4924){return _0x26fdbb[_0x96da('0x9')]('CmHopperHistory',attributes,{'tableName':_0x96da('0xa'),'paranoid':![],'indexes':[{'name':_0x96da('0xb'),'fields':[_0x96da('0xb')]},{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x81b7=['../../config/environment','./cmHopperHistory.attributes','exports','define','endtime','uniqueid','util','../../config/logger','api','moment','request-promise','rimraf'];(function(_0x548ccb,_0x1fab15){var _0x2f7701=function(_0x92da09){while(--_0x92da09){_0x548ccb['push'](_0x548ccb['shift']());}};_0x2f7701(++_0x1fab15);}(_0x81b7,0x1f2));var _0x781b=function(_0xe449bb,_0x515c55){_0xe449bb=_0xe449bb-0x0;var _0x3272d1=_0x81b7[_0xe449bb];return _0x3272d1;};'use strict';var _=require('lodash');var util=require(_0x781b('0x0'));var logger=require(_0x781b('0x1'))(_0x781b('0x2'));var moment=require(_0x781b('0x3'));var BPromise=require('bluebird');var rp=require(_0x781b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x781b('0x5'));var config=require(_0x781b('0x6'));var attributes=require(_0x781b('0x7'));module[_0x781b('0x8')]=function(_0x5eed8e,_0x3d9d36){return _0x5eed8e[_0x781b('0x9')]('CmHopperHistory',attributes,{'tableName':'cm_hopper_history','paranoid':![],'indexes':[{'name':_0x781b('0xa'),'fields':[_0x781b('0xa')]},{'name':_0x781b('0xb'),'fields':[_0x781b('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index dbb1dde..beb9711 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 _0x9d02=['lodash','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','request','info','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','error','code','CmHopperHistory,\x20%s,\x20%s','message','result','catch','CreateCmHopperHistory','CmHopperHistory','create','body','options','raw','stringify','AvgHandleTime','findAll','where','sequelize','col','predictiveIntervalTotalCalls','COUNT','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','AVG','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','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','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','outboundReCallsDay','campaign','then','GetVoiceQueueHopperHistory','ivrTotalCallsDays','ivrAnswerCallsDay','GetCampaignHopperHistory'];(function(_0x6eb02d,_0x20bdf5){var _0xb756de=function(_0x18fef2){while(--_0x18fef2){_0x6eb02d['push'](_0x6eb02d['shift']());}};_0xb756de(++_0x20bdf5);}(_0x9d02,0x118));var _0x29d0=function(_0x50c8cd,_0x1e4e8d){_0x50c8cd=_0x50c8cd-0x0;var _0x1dc8e5=_0x9d02[_0x50c8cd];return _0x1dc8e5;};'use strict';var _=require(_0x29d0('0x0'));var util=require('util');var moment=require(_0x29d0('0x1'));var BPromise=require('bluebird');var rs=require(_0x29d0('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x29d0('0x3'))['db'];var utils=require(_0x29d0('0x4'));var logger=require('../../config/logger')(_0x29d0('0x5'));var config=require(_0x29d0('0x6'));var jayson=require(_0x29d0('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5e35b3,_0x351d26,_0x18a02c){return new BPromise(function(_0x4a4019,_0x402fa6){return client[_0x29d0('0x8')](_0x5e35b3,_0x18a02c)['then'](function(_0x4bc0f9){logger[_0x29d0('0x9')]('CmHopperHistory,\x20%s,\x20%s',_0x351d26,_0x29d0('0xa'));logger[_0x29d0('0xb')](_0x29d0('0xc'),_0x351d26,_0x29d0('0xa'),JSON['stringify'](_0x4bc0f9));if(_0x4bc0f9['error']){if(_0x4bc0f9[_0x29d0('0xd')][_0x29d0('0xe')]===0x1f4){logger[_0x29d0('0xd')](_0x29d0('0xf'),_0x351d26,_0x4bc0f9[_0x29d0('0xd')][_0x29d0('0x10')]);return _0x402fa6(_0x4bc0f9[_0x29d0('0xd')][_0x29d0('0x10')]);}logger[_0x29d0('0xd')]('CmHopperHistory,\x20%s,\x20%s',_0x351d26,_0x4bc0f9[_0x29d0('0xd')][_0x29d0('0x10')]);return _0x4a4019(_0x4bc0f9[_0x29d0('0xd')][_0x29d0('0x10')]);}else{logger[_0x29d0('0x9')](_0x29d0('0xf'),_0x351d26,'request\x20sent');_0x4a4019(_0x4bc0f9[_0x29d0('0x11')][_0x29d0('0x10')]);}})[_0x29d0('0x12')](function(_0x49e919){logger[_0x29d0('0xd')](_0x29d0('0xf'),_0x351d26,_0x49e919);_0x402fa6(_0x49e919);});});}exports[_0x29d0('0x13')]=function(_0x443031){var _0x2b83e7=this;return new Promise(function(_0x28c0ee,_0x4fe4bb){return db[_0x29d0('0x14')][_0x29d0('0x15')](_0x443031[_0x29d0('0x16')],{'raw':_0x443031[_0x29d0('0x17')]?_0x443031[_0x29d0('0x17')][_0x29d0('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x385e63){logger[_0x29d0('0x9')](_0x29d0('0x13'),_0x443031);logger['debug'](_0x29d0('0x13'),_0x443031,JSON[_0x29d0('0x19')](_0x385e63));_0x28c0ee(_0x385e63);})[_0x29d0('0x12')](function(_0x4179a0){logger['error'](_0x29d0('0x13'),_0x4179a0[_0x29d0('0x10')],_0x443031);_0x4fe4bb(_0x2b83e7[_0x29d0('0xd')](0x1f4,_0x4179a0['message']));});});};exports[_0x29d0('0x1a')]=function(_0x1c80f2){var _0x7e2520=this;return new Promise(function(_0x4313fb,_0x2a976d){return db[_0x29d0('0x14')][_0x29d0('0x1b')]({'raw':_0x1c80f2['options']?_0x1c80f2[_0x29d0('0x17')][_0x29d0('0x18')]===undefined?!![]:![]:!![],'where':_0x1c80f2[_0x29d0('0x17')]?_0x1c80f2[_0x29d0('0x17')][_0x29d0('0x1c')]||null:null,'attributes':[[db[_0x29d0('0x1d')]['fn']('COUNT',db[_0x29d0('0x1d')][_0x29d0('0x1e')]('id')),_0x29d0('0x1f')],[db['sequelize']['fn'](_0x29d0('0x20'),db[_0x29d0('0x1d')]['fn']('IF',db[_0x29d0('0x1d')][_0x29d0('0x21')](_0x29d0('0x22')))),_0x29d0('0x23')],[db[_0x29d0('0x1d')]['fn'](_0x29d0('0x20'),db[_0x29d0('0x1d')]['fn']('IF',db[_0x29d0('0x1d')][_0x29d0('0x21')]('`state`\x20=\x2010,\x201,\x20null'))),_0x29d0('0x24')],[db[_0x29d0('0x1d')]['fn'](_0x29d0('0x20'),db['sequelize']['fn']('IF',db[_0x29d0('0x1d')]['literal'](_0x29d0('0x25')))),'predictiveIntervalDroppedCallsCallersExit'],[db[_0x29d0('0x1d')]['fn']('AVG',db[_0x29d0('0x1d')]['fn']('IF',db['sequelize'][_0x29d0('0x21')](_0x29d0('0x26')))),_0x29d0('0x27')],[db[_0x29d0('0x1d')]['fn'](_0x29d0('0x28'),db['sequelize']['fn']('IF',db[_0x29d0('0x1d')][_0x29d0('0x21')]('`state`\x20=\x204,\x20`talktime`,\x20null'))),'predictiveIntervalAvgTalktime']]})['then'](function(_0x57f049){logger[_0x29d0('0x9')]('AvgHandleTime',_0x1c80f2);logger[_0x29d0('0xb')](_0x29d0('0x1a'),_0x1c80f2,JSON[_0x29d0('0x19')](_0x57f049));_0x4313fb(_0x57f049);})[_0x29d0('0x12')](function(_0x5d2de9){logger[_0x29d0('0xd')](_0x29d0('0x1a'),_0x5d2de9[_0x29d0('0x10')],_0x1c80f2);_0x2a976d(_0x7e2520['error'](0x1f4,_0x5d2de9['message']));});});};exports['GetVoiceQueueHopperHistory']=function(_0x4bd1cf){var _0x4576a8=this;return new Promise(function(_0x26d731,_0xa5ee11){return db[_0x29d0('0x14')][_0x29d0('0x1b')]({'raw':_0x4bd1cf[_0x29d0('0x17')]?_0x4bd1cf[_0x29d0('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x4bd1cf[_0x29d0('0x17')]?_0x4bd1cf[_0x29d0('0x17')][_0x29d0('0x1c')]||null:null,'attributes':[['campaign',_0x29d0('0x29')],[db['sequelize']['fn'](_0x29d0('0x20'),db['sequelize']['fn']('IF',db['sequelize'][_0x29d0('0x21')](_0x29d0('0x2a')))),_0x29d0('0x2b')],[db['sequelize']['fn'](_0x29d0('0x20'),db[_0x29d0('0x1d')]['fn']('IF',db[_0x29d0('0x1d')][_0x29d0('0x21')](_0x29d0('0x2c')))),_0x29d0('0x2d')],[db[_0x29d0('0x1d')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x29d0('0x1d')]['literal'](_0x29d0('0x22')))),_0x29d0('0x2e')],[db[_0x29d0('0x1d')]['fn'](_0x29d0('0x20'),db[_0x29d0('0x1d')]['fn']('IF',db['sequelize'][_0x29d0('0x21')](_0x29d0('0x2f')))),_0x29d0('0x30')],[db[_0x29d0('0x1d')]['fn']('COUNT',db[_0x29d0('0x1d')]['fn']('IF',db[_0x29d0('0x1d')][_0x29d0('0x21')](_0x29d0('0x31')))),_0x29d0('0x32')],[db[_0x29d0('0x1d')]['fn'](_0x29d0('0x20'),db[_0x29d0('0x1d')]['fn']('IF',db[_0x29d0('0x1d')][_0x29d0('0x21')](_0x29d0('0x33')))),_0x29d0('0x34')],[db[_0x29d0('0x1d')]['fn'](_0x29d0('0x20'),db['sequelize']['fn']('IF',db[_0x29d0('0x1d')]['literal'](_0x29d0('0x35')))),_0x29d0('0x36')],[db[_0x29d0('0x1d')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x29d0('0x1d')][_0x29d0('0x21')](_0x29d0('0x37')))),_0x29d0('0x38')],[db['sequelize']['fn'](_0x29d0('0x20'),db[_0x29d0('0x1d')]['fn']('IF',db[_0x29d0('0x1d')][_0x29d0('0x21')](_0x29d0('0x39')))),_0x29d0('0x3a')],[db[_0x29d0('0x1d')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x29d0('0x1d')][_0x29d0('0x21')]('`state`\x20=\x2014,\x201,\x20null'))),_0x29d0('0x3b')],[db['sequelize']['fn'](_0x29d0('0x20'),db[_0x29d0('0x1d')]['fn']('IF',db[_0x29d0('0x1d')]['literal']('`state`\x20=\x2018,\x201,\x20null'))),_0x29d0('0x3c')],[db[_0x29d0('0x1d')]['fn'](_0x29d0('0x20'),db['sequelize']['fn']('IF',db['sequelize'][_0x29d0('0x21')]('`state`\x20=\x2016,\x201,\x20null'))),_0x29d0('0x3d')],[db[_0x29d0('0x1d')]['fn']('COUNT',db[_0x29d0('0x1d')]['fn']('IF',db[_0x29d0('0x1d')][_0x29d0('0x21')](_0x29d0('0x3e')))),'outboundRejectCallsDay'],[db[_0x29d0('0x1d')]['fn'](_0x29d0('0x20'),db[_0x29d0('0x1d')]['fn']('IF',db[_0x29d0('0x1d')]['literal']('`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'))),_0x29d0('0x3f')]],'group':[_0x29d0('0x40')]})[_0x29d0('0x41')](function(_0x30502b){logger[_0x29d0('0x9')](_0x29d0('0x42'),_0x4bd1cf);logger[_0x29d0('0xb')](_0x29d0('0x42'),_0x4bd1cf,JSON['stringify'](_0x30502b));_0x26d731(_0x30502b);})[_0x29d0('0x12')](function(_0x978177){logger['error'](_0x29d0('0x42'),_0x978177[_0x29d0('0x10')],_0x4bd1cf);_0xa5ee11(_0x4576a8[_0x29d0('0xd')](0x1f4,_0x978177['message']));});});};exports['GetCampaignHopperHistory']=function(_0x569fa8){var _0x20c847=this;return new Promise(function(_0x19a822,_0xcd472a){return db['CmHopperHistory'][_0x29d0('0x1b')]({'raw':_0x569fa8[_0x29d0('0x17')]?_0x569fa8[_0x29d0('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x569fa8[_0x29d0('0x17')]?_0x569fa8[_0x29d0('0x17')]['where']||null:null,'attributes':[[_0x29d0('0x40'),_0x29d0('0x29')],[db[_0x29d0('0x1d')]['fn']('COUNT',db['sequelize'][_0x29d0('0x1e')]('id')),_0x29d0('0x43')],[db[_0x29d0('0x1d')]['fn'](_0x29d0('0x20'),db[_0x29d0('0x1d')]['fn']('IF',db[_0x29d0('0x1d')][_0x29d0('0x21')]('`state`\x20=\x204,\x201,\x20null'))),_0x29d0('0x44')]],'group':[_0x29d0('0x40')]})['then'](function(_0x2ba1ce){logger[_0x29d0('0x9')](_0x29d0('0x45'),_0x569fa8);logger['debug']('GetCampaignHopperHistory',_0x569fa8,JSON['stringify'](_0x2ba1ce));_0x19a822(_0x2ba1ce);})['catch'](function(_0xb84374){logger['error'](_0x29d0('0x45'),_0xb84374[_0x29d0('0x10')],_0x569fa8);_0xcd472a(_0x20c847[_0x29d0('0xd')](0x1f4,_0xb84374[_0x29d0('0x10')]));});});}; \ No newline at end of file +var _0x8029=['lodash','util','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','then','CmHopperHistory,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','CreateCmHopperHistory','body','options','raw','debug','CmHopperHistory','sequelize','COUNT','col','literal','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`talktime`,\x20null','AvgHandleTime','GetVoiceQueueHopperHistory','findAll','where','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundAnswerCallsDay','outboundBusyCallsDay','`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=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','outboundRejectCallsDay','outboundReCallsDay','campaign','GetCampaignHopperHistory','`state`\x20=\x204,\x201,\x20null','ivrAnswerCallsDay'];(function(_0x5d5ea3,_0x3d2c62){var _0x564782=function(_0x21e2a7){while(--_0x21e2a7){_0x5d5ea3['push'](_0x5d5ea3['shift']());}};_0x564782(++_0x3d2c62);}(_0x8029,0xf8));var _0x9802=function(_0x201539,_0x4d357f){_0x201539=_0x201539-0x0;var _0x1976a2=_0x8029[_0x201539];return _0x1976a2;};'use strict';var _=require(_0x9802('0x0'));var util=require(_0x9802('0x1'));var moment=require('moment');var BPromise=require(_0x9802('0x2'));var rs=require(_0x9802('0x3'));var fs=require('fs');var Redis=require(_0x9802('0x4'));var db=require(_0x9802('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9802('0x6'));var config=require(_0x9802('0x7'));var jayson=require(_0x9802('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x52f9a0,_0x39f748,_0xa50d40){return new BPromise(function(_0x1d1405,_0x331bb1){return client['request'](_0x52f9a0,_0xa50d40)[_0x9802('0x9')](function(_0x2930eb){logger['info'](_0x9802('0xa'),_0x39f748,_0x9802('0xb'));logger['debug']('CmHopperHistory,\x20%s,\x20%s,\x20%s',_0x39f748,'request\x20sent',JSON[_0x9802('0xc')](_0x2930eb));if(_0x2930eb[_0x9802('0xd')]){if(_0x2930eb[_0x9802('0xd')][_0x9802('0xe')]===0x1f4){logger['error']('CmHopperHistory,\x20%s,\x20%s',_0x39f748,_0x2930eb[_0x9802('0xd')][_0x9802('0xf')]);return _0x331bb1(_0x2930eb[_0x9802('0xd')][_0x9802('0xf')]);}logger[_0x9802('0xd')](_0x9802('0xa'),_0x39f748,_0x2930eb[_0x9802('0xd')][_0x9802('0xf')]);return _0x1d1405(_0x2930eb[_0x9802('0xd')][_0x9802('0xf')]);}else{logger[_0x9802('0x10')](_0x9802('0xa'),_0x39f748,_0x9802('0xb'));_0x1d1405(_0x2930eb['result']['message']);}})[_0x9802('0x11')](function(_0x440c8d){logger[_0x9802('0xd')]('CmHopperHistory,\x20%s,\x20%s',_0x39f748,_0x440c8d);_0x331bb1(_0x440c8d);});});}exports[_0x9802('0x12')]=function(_0x1fd296){var _0x1b43f2=this;return new Promise(function(_0xa753e,_0x181a84){return db['CmHopperHistory']['create'](_0x1fd296[_0x9802('0x13')],{'raw':_0x1fd296[_0x9802('0x14')]?_0x1fd296[_0x9802('0x14')][_0x9802('0x15')]===undefined?!![]:![]:!![]})[_0x9802('0x9')](function(_0x567eed){logger[_0x9802('0x10')](_0x9802('0x12'),_0x1fd296);logger[_0x9802('0x16')](_0x9802('0x12'),_0x1fd296,JSON[_0x9802('0xc')](_0x567eed));_0xa753e(_0x567eed);})[_0x9802('0x11')](function(_0x36830d){logger[_0x9802('0xd')](_0x9802('0x12'),_0x36830d[_0x9802('0xf')],_0x1fd296);_0x181a84(_0x1b43f2[_0x9802('0xd')](0x1f4,_0x36830d['message']));});});};exports['AvgHandleTime']=function(_0x1163d6){var _0x5a695d=this;return new Promise(function(_0x43d624,_0x489a9d){return db[_0x9802('0x17')]['findAll']({'raw':_0x1163d6[_0x9802('0x14')]?_0x1163d6[_0x9802('0x14')][_0x9802('0x15')]===undefined?!![]:![]:!![],'where':_0x1163d6[_0x9802('0x14')]?_0x1163d6[_0x9802('0x14')]['where']||null:null,'attributes':[[db[_0x9802('0x18')]['fn'](_0x9802('0x19'),db['sequelize'][_0x9802('0x1a')]('id')),'predictiveIntervalTotalCalls'],[db['sequelize']['fn']('COUNT',db[_0x9802('0x18')]['fn']('IF',db[_0x9802('0x18')][_0x9802('0x1b')]('`state`\x20=\x204,\x201,\x20null'))),'predictiveIntervalAnsweredCalls'],[db[_0x9802('0x18')]['fn']('COUNT',db[_0x9802('0x18')]['fn']('IF',db['sequelize'][_0x9802('0x1b')](_0x9802('0x1c')))),_0x9802('0x1d')],[db[_0x9802('0x18')]['fn'](_0x9802('0x19'),db['sequelize']['fn']('IF',db[_0x9802('0x18')][_0x9802('0x1b')](_0x9802('0x1e')))),_0x9802('0x1f')],[db[_0x9802('0x18')]['fn'](_0x9802('0x20'),db[_0x9802('0x18')]['fn']('IF',db[_0x9802('0x18')][_0x9802('0x1b')]('`state`\x20=\x204,\x20`holdtime`,\x20null'))),'predictiveIntervalAvgHoldtime'],[db[_0x9802('0x18')]['fn']('AVG',db[_0x9802('0x18')]['fn']('IF',db['sequelize'][_0x9802('0x1b')](_0x9802('0x21')))),'predictiveIntervalAvgTalktime']]})[_0x9802('0x9')](function(_0x47ad87){logger['info']('AvgHandleTime',_0x1163d6);logger[_0x9802('0x16')]('AvgHandleTime',_0x1163d6,JSON[_0x9802('0xc')](_0x47ad87));_0x43d624(_0x47ad87);})[_0x9802('0x11')](function(_0x172a3a){logger['error'](_0x9802('0x22'),_0x172a3a['message'],_0x1163d6);_0x489a9d(_0x5a695d[_0x9802('0xd')](0x1f4,_0x172a3a[_0x9802('0xf')]));});});};exports[_0x9802('0x23')]=function(_0x31ff13){var _0x1460e7=this;return new Promise(function(_0x49f6bd,_0x5423e1){return db['CmHopperHistory'][_0x9802('0x24')]({'raw':_0x31ff13[_0x9802('0x14')]?_0x31ff13['options'][_0x9802('0x15')]===undefined?!![]:![]:!![],'where':_0x31ff13[_0x9802('0x14')]?_0x31ff13[_0x9802('0x14')][_0x9802('0x25')]||null:null,'attributes':[['campaign','name'],[db[_0x9802('0x18')]['fn']('COUNT',db[_0x9802('0x18')]['fn']('IF',db[_0x9802('0x18')][_0x9802('0x1b')](_0x9802('0x26')))),_0x9802('0x27')],[db[_0x9802('0x18')]['fn'](_0x9802('0x19'),db[_0x9802('0x18')]['fn']('IF',db[_0x9802('0x18')][_0x9802('0x1b')](_0x9802('0x28')))),'outboundNoAnswerCallsDay'],[db[_0x9802('0x18')]['fn'](_0x9802('0x19'),db['sequelize']['fn']('IF',db['sequelize']['literal']('`state`\x20=\x204,\x201,\x20null'))),_0x9802('0x29')],[db[_0x9802('0x18')]['fn'](_0x9802('0x19'),db[_0x9802('0x18')]['fn']('IF',db[_0x9802('0x18')]['literal']('`state`\x20=\x205,\x201,\x20null'))),_0x9802('0x2a')],[db[_0x9802('0x18')]['fn'](_0x9802('0x19'),db['sequelize']['fn']('IF',db[_0x9802('0x18')][_0x9802('0x1b')]('`state`\x20=\x208,\x201,\x20null'))),'outboundCongestionCallsDay'],[db[_0x9802('0x18')]['fn'](_0x9802('0x19'),db['sequelize']['fn']('IF',db[_0x9802('0x18')]['literal'](_0x9802('0x2b')))),_0x9802('0x2c')],[db[_0x9802('0x18')]['fn'](_0x9802('0x19'),db['sequelize']['fn']('IF',db['sequelize'][_0x9802('0x1b')](_0x9802('0x2d')))),_0x9802('0x2e')],[db[_0x9802('0x18')]['fn'](_0x9802('0x19'),db[_0x9802('0x18')]['fn']('IF',db[_0x9802('0x18')][_0x9802('0x1b')](_0x9802('0x2f')))),_0x9802('0x30')],[db[_0x9802('0x18')]['fn'](_0x9802('0x19'),db[_0x9802('0x18')]['fn']('IF',db[_0x9802('0x18')][_0x9802('0x1b')](_0x9802('0x31')))),_0x9802('0x32')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x9802('0x18')][_0x9802('0x1b')](_0x9802('0x33')))),_0x9802('0x34')],[db[_0x9802('0x18')]['fn'](_0x9802('0x19'),db[_0x9802('0x18')]['fn']('IF',db[_0x9802('0x18')]['literal']('`state`\x20=\x2018,\x201,\x20null'))),'outboundRejectCallsDay'],[db[_0x9802('0x18')]['fn'](_0x9802('0x19'),db[_0x9802('0x18')]['fn']('IF',db[_0x9802('0x18')][_0x9802('0x1b')](_0x9802('0x35')))),_0x9802('0x36')],[db[_0x9802('0x18')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x9802('0x18')][_0x9802('0x1b')](_0x9802('0x37')))),_0x9802('0x38')],[db[_0x9802('0x18')]['fn'](_0x9802('0x19'),db[_0x9802('0x18')]['fn']('IF',db['sequelize'][_0x9802('0x1b')]('`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'))),_0x9802('0x39')]],'group':[_0x9802('0x3a')]})['then'](function(_0x178fdc){logger['info'](_0x9802('0x23'),_0x31ff13);logger[_0x9802('0x16')](_0x9802('0x23'),_0x31ff13,JSON[_0x9802('0xc')](_0x178fdc));_0x49f6bd(_0x178fdc);})[_0x9802('0x11')](function(_0x2e7571){logger[_0x9802('0xd')](_0x9802('0x23'),_0x2e7571['message'],_0x31ff13);_0x5423e1(_0x1460e7['error'](0x1f4,_0x2e7571[_0x9802('0xf')]));});});};exports[_0x9802('0x3b')]=function(_0x29c076){var _0x1a04dc=this;return new Promise(function(_0x2b0e9f,_0x5aa639){return db[_0x9802('0x17')][_0x9802('0x24')]({'raw':_0x29c076[_0x9802('0x14')]?_0x29c076['options'][_0x9802('0x15')]===undefined?!![]:![]:!![],'where':_0x29c076[_0x9802('0x14')]?_0x29c076[_0x9802('0x14')]['where']||null:null,'attributes':[[_0x9802('0x3a'),'name'],[db[_0x9802('0x18')]['fn'](_0x9802('0x19'),db[_0x9802('0x18')][_0x9802('0x1a')]('id')),'ivrTotalCallsDays'],[db[_0x9802('0x18')]['fn'](_0x9802('0x19'),db[_0x9802('0x18')]['fn']('IF',db['sequelize'][_0x9802('0x1b')](_0x9802('0x3c')))),_0x9802('0x3d')]],'group':['campaign']})[_0x9802('0x9')](function(_0x2f6b26){logger[_0x9802('0x10')]('GetCampaignHopperHistory',_0x29c076);logger[_0x9802('0x16')](_0x9802('0x3b'),_0x29c076,JSON[_0x9802('0xc')](_0x2f6b26));_0x2b0e9f(_0x2f6b26);})[_0x9802('0x11')](function(_0x5e1fc3){logger[_0x9802('0xd')]('GetCampaignHopperHistory',_0x5e1fc3[_0x9802('0xf')],_0x29c076);_0x5aa639(_0x1a04dc[_0x9802('0xd')](0x1f4,_0x5e1fc3[_0x9802('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index 211395f..cf44915 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 _0x7ccf=['describe','/:id','post','create','put','update','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/describe'];(function(_0x44b3bd,_0x44c97d){var _0x1efc4a=function(_0x5d0205){while(--_0x5d0205){_0x44b3bd['push'](_0x44b3bd['shift']());}};_0x1efc4a(++_0x44c97d);}(_0x7ccf,0x1b0));var _0xf7cc=function(_0x2a67fe,_0x295c09){_0x2a67fe=_0x2a67fe-0x0;var _0x57e726=_0x7ccf[_0x2a67fe];return _0x57e726;};'use strict';var multer=require(_0xf7cc('0x0'));var util=require('util');var path=require(_0xf7cc('0x1'));var timeout=require('connect-timeout');var express=require(_0xf7cc('0x2'));var router=express[_0xf7cc('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xf7cc('0x4'));var interaction=require(_0xf7cc('0x5'));var config=require('../../config/environment');var controller=require('./cmHopperHistory.controller');router['get']('/',auth[_0xf7cc('0x6')](),controller[_0xf7cc('0x7')]);router[_0xf7cc('0x8')](_0xf7cc('0x9'),auth[_0xf7cc('0x6')](),controller[_0xf7cc('0xa')]);router[_0xf7cc('0x8')](_0xf7cc('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xf7cc('0xc')]('/',auth[_0xf7cc('0x6')](),controller[_0xf7cc('0xd')]);router[_0xf7cc('0xe')](_0xf7cc('0xb'),auth[_0xf7cc('0x6')](),controller[_0xf7cc('0xf')]);module[_0xf7cc('0x10')]=router; \ No newline at end of file +var _0x1348=['describe','/:id','post','isAuthenticated','create','put','update','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','get','/describe'];(function(_0x52e9e3,_0x24d28f){var _0x22ee01=function(_0x4771a6){while(--_0x4771a6){_0x52e9e3['push'](_0x52e9e3['shift']());}};_0x22ee01(++_0x24d28f);}(_0x1348,0x183));var _0x8134=function(_0x3a6f48,_0x11f57d){_0x3a6f48=_0x3a6f48-0x0;var _0x3110a8=_0x1348[_0x3a6f48];return _0x3110a8;};'use strict';var multer=require(_0x8134('0x0'));var util=require(_0x8134('0x1'));var path=require(_0x8134('0x2'));var timeout=require(_0x8134('0x3'));var express=require(_0x8134('0x4'));var router=express[_0x8134('0x5')]();var fs_extra=require(_0x8134('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x8134('0x7'));var config=require(_0x8134('0x8'));var controller=require(_0x8134('0x9'));router[_0x8134('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x8134('0xa')](_0x8134('0xb'),auth['isAuthenticated'](),controller[_0x8134('0xc')]);router[_0x8134('0xa')](_0x8134('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x8134('0xe')]('/',auth[_0x8134('0xf')](),controller[_0x8134('0x10')]);router[_0x8134('0x11')](_0x8134('0xd'),auth[_0x8134('0xf')](),controller[_0x8134('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index 43ff2b7..db2bb3e 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 _0xde64=['sequelize','exports','STRING','name'];(function(_0x127f2b,_0x764323){var _0x577712=function(_0x57ea03){while(--_0x57ea03){_0x127f2b['push'](_0x127f2b['shift']());}};_0x577712(++_0x764323);}(_0xde64,0x17c));var _0x4de6=function(_0x493fee,_0x1515b6){_0x493fee=_0x493fee-0x0;var _0x214cd8=_0xde64[_0x493fee];return _0x214cd8;};'use strict';var Sequelize=require(_0x4de6('0x0'));module[_0x4de6('0x1')]={'name':{'type':Sequelize[_0x4de6('0x2')],'unique':_0x4de6('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x4de6('0x2')]},'dialPrefix':{'type':Sequelize[_0x4de6('0x2')]}}; \ No newline at end of file +var _0xb13b=['STRING','name','sequelize','exports'];(function(_0x1eda20,_0x1149f4){var _0x31b953=function(_0x25f0d8){while(--_0x25f0d8){_0x1eda20['push'](_0x1eda20['shift']());}};_0x31b953(++_0x1149f4);}(_0xb13b,0x1de));var _0xbb13=function(_0x4a53d,_0x58a95e){_0x4a53d=_0x4a53d-0x0;var _0x27410e=_0xb13b[_0x4a53d];return _0x27410e;};'use strict';var Sequelize=require(_0xbb13('0x0'));module[_0xbb13('0x1')]={'name':{'type':Sequelize[_0xbb13('0x2')],'unique':_0xbb13('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xbb13('0x2')]},'dialPrefix':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index 679bf95..af69dfb 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 _0x8872=['sendStatus','error','name','send','index','CmList','rawAttributes','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','filter','where','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','Disposition','findOne','nolimit','order','removeDispositions','addContacts','CmContact','isArray','tags','ListId','push','omit','success','dataValues','errors','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','concat','format','cf_%d','pick','raw','getContactsCsv','OrderBy','from','cm_contacts','c.ListId\x20=\x20?','c.deletedAt\x20is\x20null','distinct','field','c.cf_','customField_','alias','select','ItemTypeId\x20=\x20?','CmContactId\x20=\x20c.id','additionalPhone_','description','isEmpty','now','/tmp/list_%d_%s.csv','setHeader','Content-disposition','Content-type','text/csv','download','addCustomField','sequelize','transaction','addCustomFields','TEXT','text','Sequelize','number','INTEGER','BOOLEAN','defaultValue','queryInterface','addColumn','cf_%s','getCustomFields','findAndCountAll','getGlobalCustomFields','addAgents','ids','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','info','spread','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./cmList.socket','register','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','then','get','Lists','UserProfileResource','end'];(function(_0x445202,_0x3566a1){var _0x5379a1=function(_0x38800f){while(--_0x38800f){_0x445202['push'](_0x445202['shift']());}};_0x5379a1(++_0x3566a1);}(_0x8872,0x117));var _0x2887=function(_0x569c3f,_0x454321){_0x569c3f=_0x569c3f-0x0;var _0x48909c=_0x8872[_0x569c3f];return _0x48909c;};'use strict';var emlformat=require(_0x2887('0x0'));var rimraf=require(_0x2887('0x1'));var zipdir=require(_0x2887('0x2'));var jsonpatch=require(_0x2887('0x3'));var rp=require(_0x2887('0x4'));var moment=require(_0x2887('0x5'));var BPromise=require(_0x2887('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x2887('0x7'));var sox=require(_0x2887('0x8'));var csv=require(_0x2887('0x9'));var ejs=require(_0x2887('0xa'));var fs=require('fs');var fs_extra=require(_0x2887('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x2887('0xc'));var deskjs=require(_0x2887('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2887('0xe'));var Redis=require(_0x2887('0xf'));var authService=require(_0x2887('0x10'));var qs=require(_0x2887('0x11'));var as=require(_0x2887('0x12'));var hardwareService=require(_0x2887('0x13'));var logger=require(_0x2887('0x14'))(_0x2887('0x15'));var utils=require('../../config/utils');var config=require(_0x2887('0x16'));var licenseUtil=require(_0x2887('0x17'));var db=require(_0x2887('0x18'))['db'];var csv_results;config[_0x2887('0x19')]=_[_0x2887('0x1a')](config[_0x2887('0x19')],{'host':_0x2887('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x2887('0x1c'))[_0x2887('0x1d')](socket);function respondWithStatusCode(_0x575b77,_0xe04837){_0xe04837=_0xe04837||0xcc;return function(_0x1f5c76){if(_0x1f5c76){return _0x575b77['sendStatus'](_0xe04837);}return _0x575b77[_0x2887('0x1e')](_0xe04837)['end']();};}function respondWithResult(_0x3dbc7b,_0x2b049e){_0x2b049e=_0x2b049e||0xc8;return function(_0x1220ca){if(_0x1220ca){return _0x3dbc7b[_0x2887('0x1e')](_0x2b049e)[_0x2887('0x1f')](_0x1220ca);}};}function respondWithFilteredResult(_0x4c0999,_0x33f2f2){return function(_0x3a1e66){if(_0x3a1e66){var _0x36ccb5=typeof _0x33f2f2[_0x2887('0x20')]===_0x2887('0x21')&&typeof _0x33f2f2[_0x2887('0x22')]===_0x2887('0x21');var _0x3dc037=_0x3a1e66[_0x2887('0x23')];var _0x5c9153=_0x36ccb5?0x0:_0x33f2f2['offset'];var _0x91c879=_0x36ccb5?_0x3a1e66['count']:_0x33f2f2[_0x2887('0x20')]+_0x33f2f2[_0x2887('0x22')];var _0x247ec7;if(_0x91c879>=_0x3dc037){_0x91c879=_0x3dc037;_0x247ec7=0xc8;}else{_0x247ec7=0xce;}_0x4c0999[_0x2887('0x1e')](_0x247ec7);return _0x4c0999[_0x2887('0x24')](_0x2887('0x25'),_0x5c9153+'-'+_0x91c879+'/'+_0x3dc037)[_0x2887('0x1f')](_0x3a1e66);}return null;};}function patchUpdates(_0x3657d4){return function(_0x566c5b){try{jsonpatch[_0x2887('0x26')](_0x566c5b,_0x3657d4,!![]);}catch(_0x52e92a){return BPromise['reject'](_0x52e92a);}return _0x566c5b[_0x2887('0x27')]();};}function saveUpdates(_0x5c84f6,_0x1c5253){return function(_0xe3d3fa){if(_0xe3d3fa){return _0xe3d3fa[_0x2887('0x28')](_0x5c84f6)['then'](function(_0x4f3e25){return _0x4f3e25;});}return null;};}function removeEntity(_0x509200,_0x1825f5){return function(_0x47e48e){if(_0x47e48e){return _0x47e48e[_0x2887('0x29')]()[_0x2887('0x2a')](function(){var _0x604b32=_0x47e48e[_0x2887('0x2b')]({'plain':!![]});var _0x1d81eb=_0x2887('0x2c');return db[_0x2887('0x2d')][_0x2887('0x29')]({'where':{'type':_0x1d81eb,'resourceId':_0x604b32['id']}})[_0x2887('0x2a')](function(){return _0x47e48e;});})[_0x2887('0x2a')](function(){_0x509200[_0x2887('0x1e')](0xcc)[_0x2887('0x2e')]();});}};}function handleEntityNotFound(_0x25d2ff,_0x1c66f5){return function(_0x7918c9){if(!_0x7918c9){_0x25d2ff[_0x2887('0x2f')](0x194);}return _0x7918c9;};}function handleError(_0x14ac91,_0x4f7167){_0x4f7167=_0x4f7167||0x1f4;return function(_0x14f8bf){logger[_0x2887('0x30')](_0x14f8bf['stack']);if(_0x14f8bf[_0x2887('0x31')]){delete _0x14f8bf[_0x2887('0x31')];}_0x14ac91[_0x2887('0x1e')](_0x4f7167)[_0x2887('0x32')](_0x14f8bf);};}exports[_0x2887('0x33')]=function(_0x52383b,_0x255af7){var _0x3d459d={},_0x251cce={},_0x3aeaec={'count':0x0,'rows':[]};var _0x5780bf=_['map'](db[_0x2887('0x34')][_0x2887('0x35')],function(_0x55bb95){return{'name':_0x55bb95['fieldName'],'type':_0x55bb95[_0x2887('0x36')]['key']};});_0x251cce[_0x2887('0x37')]=_[_0x2887('0x38')](_0x5780bf,_0x2887('0x31'));_0x251cce[_0x2887('0x39')]=_[_0x2887('0x3a')](_0x52383b[_0x2887('0x39')]);_0x251cce[_0x2887('0x3b')]=_[_0x2887('0x3c')](_0x251cce[_0x2887('0x37')],_0x251cce[_0x2887('0x39')]);_0x3d459d[_0x2887('0x3d')]=_[_0x2887('0x3c')](_0x251cce[_0x2887('0x37')],qs[_0x2887('0x3e')](_0x52383b[_0x2887('0x39')][_0x2887('0x3e')]));_0x3d459d[_0x2887('0x3d')]=_0x3d459d['attributes'][_0x2887('0x3f')]?_0x3d459d[_0x2887('0x3d')]:_0x251cce['model'];if(!_0x52383b[_0x2887('0x39')][_0x2887('0x40')]('nolimit')){_0x3d459d[_0x2887('0x22')]=qs['limit'](_0x52383b['query']['limit']);_0x3d459d[_0x2887('0x20')]=qs[_0x2887('0x20')](_0x52383b[_0x2887('0x39')][_0x2887('0x20')]);}_0x3d459d['order']=qs[_0x2887('0x41')](_0x52383b[_0x2887('0x39')][_0x2887('0x41')]);_0x3d459d['where']=qs[_0x2887('0x3b')](_['pick'](_0x52383b['query'],_0x251cce[_0x2887('0x3b')]),_0x5780bf);if(_0x52383b[_0x2887('0x39')][_0x2887('0x42')]){_0x3d459d[_0x2887('0x43')]=_[_0x2887('0x44')](_0x3d459d[_0x2887('0x43')],{'$or':_['map'](_0x5780bf,function(_0x24ea45){if(_0x24ea45[_0x2887('0x36')]!==_0x2887('0x45')){var _0x4f5e85={};_0x4f5e85[_0x24ea45[_0x2887('0x31')]]={'$like':'%'+_0x52383b[_0x2887('0x39')]['filter']+'%'};return _0x4f5e85;}})});}_0x3d459d=_['merge']({},_0x3d459d,_0x52383b[_0x2887('0x46')]);var _0x2b0278={'where':_0x3d459d['where']};return db[_0x2887('0x34')][_0x2887('0x23')](_0x2b0278)[_0x2887('0x2a')](function(_0x4437f8){_0x3aeaec[_0x2887('0x23')]=_0x4437f8;if(_0x52383b['query']['includeAll']){_0x3d459d[_0x2887('0x47')]=[{'all':!![]}];}return db[_0x2887('0x34')][_0x2887('0x48')](_0x3d459d);})[_0x2887('0x2a')](function(_0x4fd28a){_0x3aeaec[_0x2887('0x49')]=_0x4fd28a;return _0x3aeaec;})[_0x2887('0x2a')](respondWithFilteredResult(_0x255af7,_0x3d459d))[_0x2887('0x4a')](handleError(_0x255af7,null));};exports[_0x2887('0x4b')]=function(_0x315f08,_0x3bf51d){var _0x54ee0b={'raw':![],'where':{'id':_0x315f08[_0x2887('0x4c')]['id']}},_0x137ad1={};_0x137ad1[_0x2887('0x37')]=_[_0x2887('0x3a')](db[_0x2887('0x34')][_0x2887('0x35')]);_0x137ad1[_0x2887('0x39')]=_['keys'](_0x315f08['query']);_0x137ad1[_0x2887('0x3b')]=_[_0x2887('0x3c')](_0x137ad1[_0x2887('0x37')],_0x137ad1[_0x2887('0x39')]);_0x54ee0b[_0x2887('0x3d')]=_[_0x2887('0x3c')](_0x137ad1[_0x2887('0x37')],qs[_0x2887('0x3e')](_0x315f08[_0x2887('0x39')][_0x2887('0x3e')]));_0x54ee0b[_0x2887('0x3d')]=_0x54ee0b[_0x2887('0x3d')][_0x2887('0x3f')]?_0x54ee0b[_0x2887('0x3d')]:_0x137ad1[_0x2887('0x37')];if(_0x315f08[_0x2887('0x39')][_0x2887('0x4d')]){_0x54ee0b[_0x2887('0x47')]=[{'all':!![]}];}_0x54ee0b=_[_0x2887('0x44')]({},_0x54ee0b,_0x315f08[_0x2887('0x46')]);return db['CmList'][_0x2887('0x4e')](_0x54ee0b)[_0x2887('0x2a')](handleEntityNotFound(_0x3bf51d,null))[_0x2887('0x2a')](respondWithResult(_0x3bf51d,null))[_0x2887('0x4a')](handleError(_0x3bf51d,null));};exports[_0x2887('0x4f')]=function(_0x336b6c,_0x37f317){return db[_0x2887('0x34')][_0x2887('0x4f')](_0x336b6c[_0x2887('0x50')],{})['then'](function(_0x2f2669){var _0x538d9b=_0x336b6c[_0x2887('0x51')][_0x2887('0x2b')]({'plain':!![]});if(!_0x538d9b)throw new Error(_0x2887('0x52'));if(_0x538d9b[_0x2887('0x53')]==='user'){var _0x4c2870=_0x2f2669[_0x2887('0x2b')]({'plain':!![]});var _0x3ddb7='Lists';return db['UserProfileSection'][_0x2887('0x4e')]({'where':{'name':_0x3ddb7,'userProfileId':_0x538d9b[_0x2887('0x54')]},'raw':!![]})['then'](function(_0x3ba809){if(_0x3ba809&&_0x3ba809[_0x2887('0x55')]===0x0){return db[_0x2887('0x2d')]['create']({'name':_0x4c2870[_0x2887('0x31')],'resourceId':_0x4c2870['id'],'type':_0x3ba809['name'],'sectionId':_0x3ba809['id']},{})[_0x2887('0x2a')](function(){return _0x2f2669;});}else{return _0x2f2669;}})[_0x2887('0x4a')](function(_0x15e9ac){logger['error'](_0x2887('0x56'),_0x15e9ac);throw _0x15e9ac;});}return _0x2f2669;})[_0x2887('0x2a')](respondWithResult(_0x37f317,0xc9))['catch'](handleError(_0x37f317,null));};exports[_0x2887('0x28')]=function(_0x219a9f,_0x2afb22){if(_0x219a9f[_0x2887('0x50')]['id']){delete _0x219a9f['body']['id'];}return db[_0x2887('0x34')][_0x2887('0x4e')]({'where':{'id':_0x219a9f[_0x2887('0x4c')]['id']}})['then'](handleEntityNotFound(_0x2afb22,null))[_0x2887('0x2a')](saveUpdates(_0x219a9f[_0x2887('0x50')],null))[_0x2887('0x2a')](respondWithResult(_0x2afb22,null))[_0x2887('0x4a')](handleError(_0x2afb22,null));};exports[_0x2887('0x29')]=function(_0x49b4d3,_0x4ce3cc){return db[_0x2887('0x34')][_0x2887('0x4e')]({'where':{'id':_0x49b4d3[_0x2887('0x4c')]['id']}})[_0x2887('0x2a')](handleEntityNotFound(_0x4ce3cc,null))[_0x2887('0x2a')](removeEntity(_0x4ce3cc,null))[_0x2887('0x4a')](handleError(_0x4ce3cc,null));};exports[_0x2887('0x57')]=function(_0x5e9a71,_0x25ee74){return db[_0x2887('0x34')][_0x2887('0x57')]()[_0x2887('0x2a')](respondWithResult(_0x25ee74,null))[_0x2887('0x4a')](handleError(_0x25ee74,null));};exports[_0x2887('0x58')]=function(_0x1a1615,_0x5b6490,_0x2e5caf){if(_0x1a1615[_0x2887('0x50')]['id']){delete _0x1a1615[_0x2887('0x50')]['id'];}return db[_0x2887('0x34')][_0x2887('0x4e')]({'where':{'id':_0x1a1615[_0x2887('0x4c')]['id']}})[_0x2887('0x2a')](handleEntityNotFound(_0x5b6490,null))[_0x2887('0x2a')](function(_0x358896){if(_0x358896){_0x1a1615[_0x2887('0x50')]['ListId']=_0x358896['id'];return db[_0x2887('0x59')][_0x2887('0x4f')](_0x1a1615[_0x2887('0x50')]);}})[_0x2887('0x2a')](respondWithResult(_0x5b6490,null))['catch'](handleError(_0x5b6490,null));};exports['getDispositions']=function(_0x2f71a5,_0x52594e,_0x4ce9f7){var _0x2354e9={'raw':![],'where':{}};var _0x3b6f93={};var _0x24fe63={'count':0x0,'rows':[]};return db['CmList'][_0x2887('0x5a')]({'where':{'id':_0x2f71a5[_0x2887('0x4c')]['id']}})[_0x2887('0x2a')](handleEntityNotFound(_0x52594e,null))['then'](function(_0x3ba8c5){if(_0x3ba8c5){_0x3b6f93['model']=_['keys'](db[_0x2887('0x59')][_0x2887('0x35')]);_0x3b6f93[_0x2887('0x39')]=_['keys'](_0x2f71a5[_0x2887('0x39')]);_0x3b6f93[_0x2887('0x3b')]=_[_0x2887('0x3c')](_0x3b6f93[_0x2887('0x37')],_0x3b6f93[_0x2887('0x39')]);_0x2354e9[_0x2887('0x3d')]=_[_0x2887('0x3c')](_0x3b6f93[_0x2887('0x37')],qs[_0x2887('0x3e')](_0x2f71a5[_0x2887('0x39')]['fields']));_0x2354e9[_0x2887('0x3d')]=_0x2354e9[_0x2887('0x3d')][_0x2887('0x3f')]?_0x2354e9['attributes']:_0x3b6f93[_0x2887('0x37')];if(!_0x2f71a5[_0x2887('0x39')]['hasOwnProperty'](_0x2887('0x5b'))){_0x2354e9[_0x2887('0x22')]=qs[_0x2887('0x22')](_0x2f71a5[_0x2887('0x39')][_0x2887('0x22')]);_0x2354e9[_0x2887('0x20')]=qs[_0x2887('0x20')](_0x2f71a5[_0x2887('0x39')]['offset']);}_0x2354e9[_0x2887('0x5c')]=qs[_0x2887('0x41')](_0x2f71a5[_0x2887('0x39')][_0x2887('0x41')]);_0x2354e9[_0x2887('0x43')]=qs['filters'](_['pick'](_0x2f71a5[_0x2887('0x39')],_0x3b6f93[_0x2887('0x3b')]));_0x2354e9[_0x2887('0x43')]['ListId']=_0x3ba8c5['id'];if(_0x2f71a5['query'][_0x2887('0x42')]){_0x2354e9['where']=_[_0x2887('0x44')](_0x2354e9[_0x2887('0x43')],{'$or':_[_0x2887('0x38')](_0x2354e9[_0x2887('0x3d')],function(_0x59abce){var _0x387390={};_0x387390[_0x59abce]={'$like':'%'+_0x2f71a5[_0x2887('0x39')][_0x2887('0x42')]+'%'};return _0x387390;})});}_0x2354e9=_['merge']({},_0x2354e9,_0x2f71a5['options']);return db[_0x2887('0x59')]['count']({'where':_0x2354e9[_0x2887('0x43')]})[_0x2887('0x2a')](function(_0xef5740){_0x24fe63[_0x2887('0x23')]=_0xef5740;if(_0x2f71a5[_0x2887('0x39')][_0x2887('0x4d')]){_0x2354e9[_0x2887('0x47')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x2354e9);})[_0x2887('0x2a')](function(_0x5cc439){_0x24fe63[_0x2887('0x49')]=_0x5cc439;return _0x24fe63;});}})[_0x2887('0x2a')](respondWithFilteredResult(_0x52594e,_0x2354e9))[_0x2887('0x4a')](handleError(_0x52594e,null));};exports[_0x2887('0x5d')]=function(_0xb9eca8,_0x34c119,_0x4eb4d0){return db[_0x2887('0x34')][_0x2887('0x4e')]({'where':{'id':_0xb9eca8['params']['id']}})['then'](handleEntityNotFound(_0x34c119,null))[_0x2887('0x2a')](function(_0x33140d){if(_0x33140d){return _0x33140d[_0x2887('0x5d')](_0xb9eca8[_0x2887('0x39')]['ids']);}})[_0x2887('0x2a')](respondWithStatusCode(_0x34c119,null))['catch'](handleError(_0x34c119,null));};exports[_0x2887('0x5e')]=function(_0x194851,_0x5ea7cc,_0x347fba){return db['CmList'][_0x2887('0x4e')]({'where':{'id':_0x194851[_0x2887('0x4c')]['id']}})[_0x2887('0x2a')](handleEntityNotFound(_0x5ea7cc,null))[_0x2887('0x2a')](function(_0x457483){if(_0x457483){var _0x47c286=[];var _0x5aaf34={'success':[],'errors':[]};return db[_0x2887('0x5f')][_0x2887('0x57')]()[_0x2887('0x2a')](function(_0x1bb6df){if(_0x194851[_0x2887('0x50')]['tags']&&_[_0x2887('0x60')](_0x194851['body'][_0x2887('0x61')])){if(_0x194851[_0x2887('0x50')][_0x2887('0x61')][_0x2887('0x3f')]){_0x194851[_0x2887('0x50')][_0x2887('0x61')]=_0x194851[_0x2887('0x50')][_0x2887('0x61')]['join'](';')+';';}else{_0x194851['body'][_0x2887('0x61')]=null;}}else{_0x194851['body'][_0x2887('0x61')]=null;}if(_0x194851['body']&&_['isArray'](_0x194851['body'])){for(var _0x110b12=0x0;_0x110b12<_0x194851[_0x2887('0x50')][_0x2887('0x3f')];_0x110b12+=0x1){_0x194851[_0x2887('0x50')][_0x110b12][_0x2887('0x62')]=_0x194851[_0x2887('0x4c')]['id'];_0x47c286[_0x2887('0x63')](_0x194851[_0x2887('0x50')][_0x110b12]);}return BPromise['each'](_0x47c286,function(_0x398a6c){return db[_0x2887('0x5f')][_0x2887('0x4f')](_[_0x2887('0x64')](_0x398a6c,['ids','id'])||{},{'fields':_['keys'](_0x1bb6df),'raw':!![]})[_0x2887('0x2a')](function(_0x5627c5){_0x5aaf34[_0x2887('0x65')][_0x2887('0x63')](_0x5627c5[_0x2887('0x66')]);})[_0x2887('0x4a')](function(_0x193e9c){_0x5aaf34[_0x2887('0x67')][_0x2887('0x63')]({'data':_0x398a6c,'error':_0x193e9c[_0x2887('0x68')]});});})['then'](function(_0x4482b3){return _0x5aaf34;})[_0x2887('0x4a')](function(_0x1e209e){return _0x1e209e;});}else{_0x5ea7cc[_0x2887('0x1e')](0x190)['json']({'message':_0x2887('0x69')});}});}})[_0x2887('0x2a')](respondWithResult(_0x5ea7cc,null))[_0x2887('0x4a')](handleError(_0x5ea7cc,null));};exports[_0x2887('0x6a')]=function(_0x38688c,_0x5cfd1f,_0x5c1fcd){var _0x357ba8;return db[_0x2887('0x34')][_0x2887('0x4e')]({'where':{'id':_0x38688c[_0x2887('0x4c')]['id']},'include':[{'model':db[_0x2887('0x6b')],'as':'CustomFields'}]})[_0x2887('0x2a')](handleEntityNotFound(_0x5cfd1f,null))['then'](function(_0x47fc29){if(_0x47fc29){_0x357ba8=_0x47fc29;return db[_0x2887('0x5f')][_0x2887('0x35')];}})[_0x2887('0x2a')](function(_0x3a2e2f){if(_0x3a2e2f){var _0x9d813c={};var _0x40c01b={};_0x40c01b[_0x2887('0x37')]=_[_0x2887('0x6c')](_[_0x2887('0x3a')](_0x3a2e2f),_[_0x2887('0x38')](_0x357ba8['CustomFields'],function(_0x283ba7){return util[_0x2887('0x6d')](_0x2887('0x6e'),_0x283ba7['id']);}));_0x40c01b[_0x2887('0x39')]=_[_0x2887('0x3a')](_0x38688c['query']);_0x40c01b['filters']=_[_0x2887('0x3c')](_0x40c01b[_0x2887('0x37')],_0x40c01b[_0x2887('0x39')]);_0x9d813c[_0x2887('0x3d')]=_[_0x2887('0x3c')](_0x40c01b[_0x2887('0x37')],qs[_0x2887('0x3e')](_0x38688c[_0x2887('0x39')][_0x2887('0x3e')]));_0x9d813c[_0x2887('0x3d')]=_0x9d813c['attributes'][_0x2887('0x3f')]?_0x9d813c['attributes']:_0x40c01b['model'];if(!_0x38688c[_0x2887('0x39')][_0x2887('0x40')](_0x2887('0x5b'))){_0x9d813c[_0x2887('0x22')]=qs[_0x2887('0x22')](_0x38688c['query'][_0x2887('0x22')]);_0x9d813c['offset']=qs[_0x2887('0x20')](_0x38688c['query']['offset']);}_0x9d813c[_0x2887('0x5c')]=qs[_0x2887('0x41')](_0x38688c[_0x2887('0x39')][_0x2887('0x41')]);_0x9d813c[_0x2887('0x43')]=qs[_0x2887('0x3b')](_[_0x2887('0x6f')](_0x38688c[_0x2887('0x39')],_0x40c01b[_0x2887('0x3b')]));_0x9d813c[_0x2887('0x70')]=!![];if(_0x38688c[_0x2887('0x39')][_0x2887('0x42')]){_0x9d813c[_0x2887('0x43')]=_['merge'](_0x9d813c[_0x2887('0x43')],{'$or':_[_0x2887('0x38')](_0x9d813c[_0x2887('0x3d')],function(_0x16d67b){var _0x3da494={};_0x3da494[_0x16d67b]={'$like':'%'+_0x38688c[_0x2887('0x39')][_0x2887('0x42')]+'%'};return _0x3da494;})});}_0x9d813c=_[_0x2887('0x44')]({},_0x9d813c,_0x38688c[_0x2887('0x46')]);return _0x357ba8[_0x2887('0x6a')](_0x9d813c);}})['then'](respondWithResult(_0x5cfd1f,null))[_0x2887('0x4a')](handleError(_0x5cfd1f,null));};exports[_0x2887('0x71')]=function(_0x22f8a3,_0x56f344,_0xbe7319){var _0x22c58e;var _0x171d73;var _0x1d3b56;var _0x2419ca=_0x22f8a3[_0x2887('0x4c')]['id'];csv_results=[];return db['ContactItemType'][_0x2887('0x48')]({'attributes':['id',_0x2887('0x31')],'raw':!![],'order':[_0x2887('0x72')]})[_0x2887('0x2a')](function(_0x5a81ea){_0x22c58e=_0x5a81ea;var _0x118dd2=_[_0x2887('0x3a')](db[_0x2887('0x5f')]['rawAttributes']);return db['CmCustomField'][_0x2887('0x48')]({'raw':!![],'attributes':['id','alias']})['then'](function(_0x3930df){_0x171d73=_0x3930df;var _0x531570=squel['select']()[_0x2887('0x3e')](_0x118dd2)[_0x2887('0x73')](_0x2887('0x74'),'c')[_0x2887('0x43')](_0x2887('0x75'),_0x2419ca)[_0x2887('0x43')](_0x2887('0x76'))[_0x2887('0x77')]();for(var _0x86526c=0x0;_0x86526c<_0x171d73[_0x2887('0x3f')];_0x86526c++){_0x531570[_0x2887('0x78')](_0x2887('0x79')+_0x171d73[_0x86526c]['id'],_0x2887('0x7a')+_0x171d73[_0x86526c][_0x2887('0x7b')]);}for(var _0x86526c=0x0;_0x86526c<_0x22c58e[_0x2887('0x3f')];_0x86526c++){_0x531570[_0x2887('0x78')](squel[_0x2887('0x7c')]()['field']('item')[_0x2887('0x73')]('cm_contact_has_items')['where'](_0x2887('0x7d'),_0x22c58e[_0x86526c]['id'])['where'](_0x2887('0x7e')),_0x2887('0x7f')+_0x22c58e[_0x86526c][_0x2887('0x31')]);_0x531570[_0x2887('0x78')](squel[_0x2887('0x7c')]()[_0x2887('0x78')](_0x2887('0x80'))[_0x2887('0x73')]('cm_contact_has_items')[_0x2887('0x43')](_0x2887('0x7d'),_0x22c58e[_0x86526c]['id'])['where'](_0x2887('0x7e')),'description_additionalPhone_'+_0x22c58e[_0x86526c][_0x2887('0x31')]);}var _0x62d309=[];_0x62d309['push'](_0x531570['toString']());BPromise['each'](_0x62d309,handleQuery)['then'](function(_0x4012a2){handleQuery(_0x531570['toString']());var _0x55fa7b=csv_results[0x0];if(!_[_0x2887('0x81')](_0x55fa7b)){var _0x230133=toCsv(_0x55fa7b);var _0x406f62=Date[_0x2887('0x82')]();fs['writeFileSync'](util['format'](_0x2887('0x83'),_0x2419ca,_0x406f62),_0x230133);_0x56f344[_0x2887('0x84')](_0x2887('0x85'),'attachment;\x20filename='+util['format']('list_%d_%s.csv',_0x2419ca,_0x406f62));_0x56f344['setHeader'](_0x2887('0x86'),_0x2887('0x87'));return _0x56f344[_0x2887('0x88')](util[_0x2887('0x6d')](_0x2887('0x83'),_0x2419ca,_0x406f62));}else{return _0x56f344[_0x2887('0x2f')](0xcc);}});});});};exports[_0x2887('0x89')]=function(_0x8d8184,_0x38efaa,_0x13f059){var _0x10faa6;delete _0x8d8184[_0x2887('0x50')]['id'];return db[_0x2887('0x34')][_0x2887('0x5a')]({'where':{'id':_0x8d8184[_0x2887('0x4c')]['id']}})[_0x2887('0x2a')](handleEntityNotFound(_0x38efaa,null))[_0x2887('0x2a')](function(_0x560d27){if(_0x560d27){return db[_0x2887('0x8a')][_0x2887('0x8b')](function(_0x3fa79a){return db['CmCustomField'][_0x2887('0x4f')](_0x8d8184[_0x2887('0x50')],{'transaction':_0x3fa79a})[_0x2887('0x2a')](function(_0x2f3de2){_0x10faa6=_0x2f3de2;return _0x560d27[_0x2887('0x8c')](_0x2f3de2,{'transaction':_0x3fa79a});})[_0x2887('0x2a')](function(){var _0x5016cb={'type':db['Sequelize'][_0x2887('0x8d')],'transaction':_0x3fa79a};switch(_0x8d8184['body'][_0x2887('0x36')]){case _0x2887('0x8e'):_0x5016cb[_0x2887('0x36')]=db[_0x2887('0x8f')][_0x2887('0x8d')];break;case _0x2887('0x90'):_0x5016cb[_0x2887('0x36')]=db[_0x2887('0x8f')][_0x2887('0x91')];break;case'switch':_0x5016cb[_0x2887('0x36')]=db[_0x2887('0x8f')][_0x2887('0x92')];_0x5016cb[_0x2887('0x93')]=![];break;default:}return db['sequelize'][_0x2887('0x94')][_0x2887('0x95')](_0x2887('0x74'),util[_0x2887('0x6d')](_0x2887('0x96'),_0x10faa6['id']),_0x5016cb);})['then'](function(){return _0x10faa6;});});}})[_0x2887('0x2a')](respondWithResult(_0x38efaa,null))[_0x2887('0x4a')](handleError(_0x38efaa,null));};exports[_0x2887('0x97')]=function(_0x5075d0,_0x1e38ab,_0x2aac5c){var _0x4952c3={};var _0x4b9b18={};var _0x2c8945;var _0x9074a4;return db[_0x2887('0x34')][_0x2887('0x5a')]({'where':{'id':_0x5075d0[_0x2887('0x4c')]['id']}})['then'](handleEntityNotFound(_0x1e38ab,null))[_0x2887('0x2a')](function(_0x4921f3){if(_0x4921f3){_0x2c8945=_0x4921f3;_0x4b9b18[_0x2887('0x37')]=_[_0x2887('0x3a')](db[_0x2887('0x6b')]['rawAttributes']);_0x4b9b18[_0x2887('0x39')]=_[_0x2887('0x3a')](_0x5075d0[_0x2887('0x39')]);_0x4b9b18[_0x2887('0x3b')]=_[_0x2887('0x3c')](_0x4b9b18['model'],_0x4b9b18[_0x2887('0x39')]);_0x4952c3[_0x2887('0x3d')]=_[_0x2887('0x3c')](_0x4b9b18['model'],qs[_0x2887('0x3e')](_0x5075d0[_0x2887('0x39')][_0x2887('0x3e')]));_0x4952c3[_0x2887('0x3d')]=_0x4952c3[_0x2887('0x3d')][_0x2887('0x3f')]?_0x4952c3[_0x2887('0x3d')]:_0x4b9b18[_0x2887('0x37')];_0x4952c3['order']=qs['sort'](_0x5075d0['query']['sort']);_0x4952c3['where']=qs['filters'](_[_0x2887('0x6f')](_0x5075d0[_0x2887('0x39')],_0x4b9b18[_0x2887('0x3b')]));_0x4952c3['where']=_[_0x2887('0x44')](_0x4952c3[_0x2887('0x43')],{'$or':[{'ListId':_0x4921f3['id']},{'ListId':null}]});if(_0x5075d0['query'][_0x2887('0x42')]){_0x4952c3[_0x2887('0x43')]=_[_0x2887('0x44')](_0x4952c3[_0x2887('0x43')],{'$or':_[_0x2887('0x38')](_0x4952c3[_0x2887('0x3d')],function(_0x53867d){var _0x50bdc2={};_0x50bdc2[_0x53867d]={'$like':'%'+_0x5075d0['query']['filter']+'%'};return _0x50bdc2;})});}_0x4952c3=_[_0x2887('0x44')]({},_0x4952c3,_0x5075d0[_0x2887('0x46')]);return db[_0x2887('0x6b')][_0x2887('0x98')](_0x4952c3);}})['then'](respondWithResult(_0x1e38ab,null))[_0x2887('0x4a')](handleError(_0x1e38ab,null));};exports[_0x2887('0x99')]=function(_0x38e6cf,_0x29e1ca){return db[_0x2887('0x6b')][_0x2887('0x98')]({'where':{'ListId':null}})[_0x2887('0x2a')](handleEntityNotFound(_0x29e1ca,null))[_0x2887('0x2a')](function(_0x4124a7){return _0x4124a7;})[_0x2887('0x2a')](respondWithResult(_0x29e1ca,null))[_0x2887('0x4a')](handleError(_0x29e1ca,null));};exports[_0x2887('0x9a')]=function(_0x50f61a,_0xb90b35,_0x3cd1ff){return db[_0x2887('0x34')][_0x2887('0x4e')]({'where':{'id':_0x50f61a['params']['id']}})[_0x2887('0x2a')](handleEntityNotFound(_0xb90b35,null))[_0x2887('0x2a')](function(_0x367dde){if(_0x367dde){return _0x367dde[_0x2887('0x9a')](_0x50f61a[_0x2887('0x50')][_0x2887('0x9b')],_[_0x2887('0x64')](_0x50f61a['body'],[_0x2887('0x9b'),'id'])||{})['spread'](function(_0x46cc8c){for(var _0x4b291d=0x0;_0x4b291d<_0x50f61a[_0x2887('0x50')]['ids'][_0x2887('0x3f')];_0x4b291d+=0x1){socket[_0x2887('0x9c')](_0x2887('0x9d'),{'UserId':Number(_0x50f61a[_0x2887('0x50')][_0x2887('0x9b')][_0x4b291d]),'CmListId':Number(_0x50f61a[_0x2887('0x4c')]['id'])});}return _0x46cc8c;});}})[_0x2887('0x2a')](respondWithResult(_0xb90b35,null))[_0x2887('0x4a')](handleError(_0xb90b35,null));};exports[_0x2887('0x9e')]=function(_0x2e609a,_0x17de14,_0x3c26b7){return db['CmList'][_0x2887('0x4e')]({'where':{'id':_0x2e609a['params']['id']}})[_0x2887('0x2a')](handleEntityNotFound(_0x17de14,null))[_0x2887('0x2a')](function(_0x31cffe){if(_0x31cffe){return _0x31cffe[_0x2887('0x9e')](_0x2e609a[_0x2887('0x39')][_0x2887('0x9b')])[_0x2887('0x2a')](function(){if(_[_0x2887('0x60')](_0x2e609a[_0x2887('0x39')][_0x2887('0x9b')])){for(var _0x56a988=0x0;_0x56a988<_0x2e609a[_0x2887('0x39')][_0x2887('0x9b')][_0x2887('0x3f')];_0x56a988+=0x1){socket[_0x2887('0x9c')](_0x2887('0x9f'),{'UserId':Number(_0x2e609a['query'][_0x2887('0x9b')][_0x56a988]),'CmListId':Number(_0x2e609a[_0x2887('0x4c')]['id'])});}}else{socket['emit'](_0x2887('0x9f'),{'UserId':Number(_0x2e609a[_0x2887('0x39')][_0x2887('0x9b')]),'CmListId':Number(_0x2e609a[_0x2887('0x4c')]['id'])});}});}})[_0x2887('0x2a')](respondWithStatusCode(_0x17de14,null))[_0x2887('0x4a')](handleError(_0x17de14,null));};exports[_0x2887('0xa0')]=function(_0xafa8ad,_0x2140e0,_0x1886b9){var _0x233ac1={};var _0x4efba1={};var _0x4ffa69;var _0x353f21;return db['CmList'][_0x2887('0x5a')]({'where':{'id':_0xafa8ad[_0x2887('0x4c')]['id']}})[_0x2887('0x2a')](handleEntityNotFound(_0x2140e0,null))[_0x2887('0x2a')](function(_0x560fd3){if(_0x560fd3){_0x4ffa69=_0x560fd3;_0x4efba1[_0x2887('0x37')]=_[_0x2887('0x3a')](db['User'][_0x2887('0x35')]);_0x4efba1[_0x2887('0x39')]=_[_0x2887('0x3a')](_0xafa8ad[_0x2887('0x39')]);_0x4efba1[_0x2887('0x3b')]=_[_0x2887('0x3c')](_0x4efba1[_0x2887('0x37')],_0x4efba1[_0x2887('0x39')]);_0x233ac1[_0x2887('0x3d')]=_['intersection'](_0x4efba1[_0x2887('0x37')],qs[_0x2887('0x3e')](_0xafa8ad[_0x2887('0x39')]['fields']));_0x233ac1['attributes']=_0x233ac1[_0x2887('0x3d')][_0x2887('0x3f')]?_0x233ac1['attributes']:_0x4efba1[_0x2887('0x37')];_0x233ac1[_0x2887('0x5c')]=qs[_0x2887('0x41')](_0xafa8ad['query'][_0x2887('0x41')]);_0x233ac1[_0x2887('0x43')]=qs[_0x2887('0x3b')](_['pick'](_0xafa8ad[_0x2887('0x39')],_0x4efba1[_0x2887('0x3b')]));if(_0xafa8ad[_0x2887('0x39')][_0x2887('0x42')]){_0x233ac1['where']=_[_0x2887('0x44')](_0x233ac1['where'],{'$or':_[_0x2887('0x38')](_0x233ac1[_0x2887('0x3d')],function(_0x34125b){var _0x218af4={};_0x218af4[_0x34125b]={'$like':'%'+_0xafa8ad[_0x2887('0x39')]['filter']+'%'};return _0x218af4;})});}_0x233ac1=_[_0x2887('0x44')]({},_0x233ac1,_0xafa8ad[_0x2887('0x46')]);return _0x4ffa69[_0x2887('0xa0')](_0x233ac1);}})[_0x2887('0x2a')](function(_0x2133c8){if(_0x2133c8){_0x353f21=_0x2133c8[_0x2887('0x3f')];if(!_0xafa8ad[_0x2887('0x39')]['hasOwnProperty']('nolimit')){_0x233ac1[_0x2887('0x22')]=qs[_0x2887('0x22')](_0xafa8ad['query'][_0x2887('0x22')]);_0x233ac1[_0x2887('0x20')]=qs[_0x2887('0x20')](_0xafa8ad[_0x2887('0x39')]['offset']);}return _0x4ffa69[_0x2887('0xa0')](_0x233ac1);}})['then'](function(_0x429679){if(_0x429679){return _0x429679?{'count':_0x353f21,'rows':_0x429679}:null;}})['then'](respondWithResult(_0x2140e0,null))[_0x2887('0x4a')](handleError(_0x2140e0,null));};function handleQuery(_0x4290a1){logger[_0x2887('0xa1')](_0x4290a1);return db[_0x2887('0x8a')][_0x2887('0x39')](_0x4290a1)[_0x2887('0xa2')](function(_0x3115e5){csv_results[_0x2887('0x63')](_0x3115e5);})['catch'](function(_0x39ab93){logger[_0x2887('0x30')](_0x39ab93[_0x2887('0x68')]);});} \ No newline at end of file +var _0xd1ec=['getAgents','User','info','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./cmList.socket','sendStatus','status','end','offset','undefined','count','set','Content-Range','json','apply','reject','update','then','Lists','UserProfileResource','destroy','error','stack','name','send','index','map','CmList','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','keys','include','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','describe','addDisposition','ListId','Disposition','getDispositions','findOne','rawAttributes','removeDispositions','ids','addContacts','CmContact','tags','isArray','join','push','each','omit','success','dataValues','errors','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','concat','format','cf_%d','pick','raw','getContactsCsv','ContactItemType','OrderBy','alias','select','cm_contacts','c.ListId\x20=\x20?','c.deletedAt\x20is\x20null','field','c.cf_','customField_','item','from','cm_contact_has_items','ItemTypeId\x20=\x20?','CmContactId\x20=\x20c.id','additionalPhone_','description','toString','isEmpty','writeFileSync','/tmp/list_%d_%s.csv','Content-disposition','attachment;\x20filename=','setHeader','download','addCustomField','sequelize','transaction','addCustomFields','Sequelize','TEXT','number','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','cf_%s','findAndCountAll','getGlobalCustomFields','addAgents','spread','emit','userCmList:save','removeAgents','userCmList:remove'];(function(_0x115841,_0x401e20){var _0x29063c=function(_0x2988e9){while(--_0x2988e9){_0x115841['push'](_0x115841['shift']());}};_0x29063c(++_0x401e20);}(_0xd1ec,0x157));var _0xcd1e=function(_0x421510,_0x256346){_0x421510=_0x421510-0x0;var _0x12909d=_0xd1ec[_0x421510];return _0x12909d;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xcd1e('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcd1e('0x1'));var moment=require(_0xcd1e('0x2'));var BPromise=require(_0xcd1e('0x3'));var Mustache=require(_0xcd1e('0x4'));var util=require(_0xcd1e('0x5'));var path=require(_0xcd1e('0x6'));var sox=require(_0xcd1e('0x7'));var csv=require('to-csv');var ejs=require(_0xcd1e('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcd1e('0x9'));var squel=require(_0xcd1e('0xa'));var crypto=require(_0xcd1e('0xb'));var jsforce=require(_0xcd1e('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xcd1e('0xd'));var Papa=require(_0xcd1e('0xe'));var Redis=require(_0xcd1e('0xf'));var authService=require(_0xcd1e('0x10'));var qs=require(_0xcd1e('0x11'));var as=require(_0xcd1e('0x12'));var hardwareService=require(_0xcd1e('0x13'));var logger=require(_0xcd1e('0x14'))(_0xcd1e('0x15'));var utils=require(_0xcd1e('0x16'));var config=require(_0xcd1e('0x17'));var licenseUtil=require(_0xcd1e('0x18'));var db=require(_0xcd1e('0x19'))['db'];var csv_results;config['redis']=_[_0xcd1e('0x1a')](config[_0xcd1e('0x1b')],{'host':_0xcd1e('0x1c'),'port':0x18eb});var socket=require(_0xcd1e('0x1d'))(new Redis(config[_0xcd1e('0x1b')]));require(_0xcd1e('0x1e'))['register'](socket);function respondWithStatusCode(_0x262f49,_0x2e9cc3){_0x2e9cc3=_0x2e9cc3||0xcc;return function(_0x53f878){if(_0x53f878){return _0x262f49[_0xcd1e('0x1f')](_0x2e9cc3);}return _0x262f49[_0xcd1e('0x20')](_0x2e9cc3)[_0xcd1e('0x21')]();};}function respondWithResult(_0x222014,_0x2ee5c4){_0x2ee5c4=_0x2ee5c4||0xc8;return function(_0x5e9174){if(_0x5e9174){return _0x222014[_0xcd1e('0x20')](_0x2ee5c4)['json'](_0x5e9174);}};}function respondWithFilteredResult(_0x5f5003,_0x7dfc3e){return function(_0x17223f){if(_0x17223f){var _0x52ec9a=typeof _0x7dfc3e[_0xcd1e('0x22')]===_0xcd1e('0x23')&&typeof _0x7dfc3e['limit']===_0xcd1e('0x23');var _0x15ba44=_0x17223f[_0xcd1e('0x24')];var _0x8212ac=_0x52ec9a?0x0:_0x7dfc3e[_0xcd1e('0x22')];var _0x581b6f=_0x52ec9a?_0x17223f['count']:_0x7dfc3e[_0xcd1e('0x22')]+_0x7dfc3e['limit'];var _0x37c0a5;if(_0x581b6f>=_0x15ba44){_0x581b6f=_0x15ba44;_0x37c0a5=0xc8;}else{_0x37c0a5=0xce;}_0x5f5003[_0xcd1e('0x20')](_0x37c0a5);return _0x5f5003[_0xcd1e('0x25')](_0xcd1e('0x26'),_0x8212ac+'-'+_0x581b6f+'/'+_0x15ba44)[_0xcd1e('0x27')](_0x17223f);}return null;};}function patchUpdates(_0x4b127e){return function(_0x45473d){try{jsonpatch[_0xcd1e('0x28')](_0x45473d,_0x4b127e,!![]);}catch(_0x42737a){return BPromise[_0xcd1e('0x29')](_0x42737a);}return _0x45473d['save']();};}function saveUpdates(_0x147920,_0x3366a8){return function(_0x339bed){if(_0x339bed){return _0x339bed[_0xcd1e('0x2a')](_0x147920)[_0xcd1e('0x2b')](function(_0x4950a8){return _0x4950a8;});}return null;};}function removeEntity(_0x360f43,_0x5a06cc){return function(_0x13dfc1){if(_0x13dfc1){return _0x13dfc1['destroy']()[_0xcd1e('0x2b')](function(){var _0x3edd52=_0x13dfc1['get']({'plain':!![]});var _0xb7b21e=_0xcd1e('0x2c');return db[_0xcd1e('0x2d')][_0xcd1e('0x2e')]({'where':{'type':_0xb7b21e,'resourceId':_0x3edd52['id']}})[_0xcd1e('0x2b')](function(){return _0x13dfc1;});})[_0xcd1e('0x2b')](function(){_0x360f43[_0xcd1e('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x34197c,_0x385ec0){return function(_0x40b745){if(!_0x40b745){_0x34197c[_0xcd1e('0x1f')](0x194);}return _0x40b745;};}function handleError(_0x5ee504,_0x4473a0){_0x4473a0=_0x4473a0||0x1f4;return function(_0x4b6479){logger[_0xcd1e('0x2f')](_0x4b6479[_0xcd1e('0x30')]);if(_0x4b6479[_0xcd1e('0x31')]){delete _0x4b6479[_0xcd1e('0x31')];}_0x5ee504[_0xcd1e('0x20')](_0x4473a0)[_0xcd1e('0x32')](_0x4b6479);};}exports[_0xcd1e('0x33')]=function(_0x2ebb0f,_0x3eb757){var _0x144789={},_0xfdf2a6={},_0x484bd2={'count':0x0,'rows':[]};var _0x400175=_[_0xcd1e('0x34')](db[_0xcd1e('0x35')]['rawAttributes'],function(_0xa77546){return{'name':_0xa77546['fieldName'],'type':_0xa77546[_0xcd1e('0x36')][_0xcd1e('0x37')]};});_0xfdf2a6[_0xcd1e('0x38')]=_[_0xcd1e('0x34')](_0x400175,_0xcd1e('0x31'));_0xfdf2a6['query']=_['keys'](_0x2ebb0f[_0xcd1e('0x39')]);_0xfdf2a6[_0xcd1e('0x3a')]=_[_0xcd1e('0x3b')](_0xfdf2a6[_0xcd1e('0x38')],_0xfdf2a6['query']);_0x144789[_0xcd1e('0x3c')]=_[_0xcd1e('0x3b')](_0xfdf2a6[_0xcd1e('0x38')],qs[_0xcd1e('0x3d')](_0x2ebb0f[_0xcd1e('0x39')][_0xcd1e('0x3d')]));_0x144789['attributes']=_0x144789[_0xcd1e('0x3c')][_0xcd1e('0x3e')]?_0x144789[_0xcd1e('0x3c')]:_0xfdf2a6[_0xcd1e('0x38')];if(!_0x2ebb0f['query'][_0xcd1e('0x3f')](_0xcd1e('0x40'))){_0x144789[_0xcd1e('0x41')]=qs[_0xcd1e('0x41')](_0x2ebb0f[_0xcd1e('0x39')][_0xcd1e('0x41')]);_0x144789[_0xcd1e('0x22')]=qs[_0xcd1e('0x22')](_0x2ebb0f[_0xcd1e('0x39')]['offset']);}_0x144789[_0xcd1e('0x42')]=qs[_0xcd1e('0x43')](_0x2ebb0f[_0xcd1e('0x39')]['sort']);_0x144789[_0xcd1e('0x44')]=qs['filters'](_['pick'](_0x2ebb0f[_0xcd1e('0x39')],_0xfdf2a6[_0xcd1e('0x3a')]),_0x400175);if(_0x2ebb0f[_0xcd1e('0x39')][_0xcd1e('0x45')]){_0x144789[_0xcd1e('0x44')]=_[_0xcd1e('0x46')](_0x144789['where'],{'$or':_[_0xcd1e('0x34')](_0x400175,function(_0x3afd8e){if(_0x3afd8e['type']!==_0xcd1e('0x47')){var _0x2dbd17={};_0x2dbd17[_0x3afd8e[_0xcd1e('0x31')]]={'$like':'%'+_0x2ebb0f[_0xcd1e('0x39')][_0xcd1e('0x45')]+'%'};return _0x2dbd17;}})});}_0x144789=_[_0xcd1e('0x46')]({},_0x144789,_0x2ebb0f[_0xcd1e('0x48')]);var _0x22cb23={'where':_0x144789[_0xcd1e('0x44')]};return db['CmList'][_0xcd1e('0x24')](_0x22cb23)['then'](function(_0x1fdf8f){_0x484bd2[_0xcd1e('0x24')]=_0x1fdf8f;if(_0x2ebb0f[_0xcd1e('0x39')][_0xcd1e('0x49')]){_0x144789['include']=[{'all':!![]}];}return db['CmList'][_0xcd1e('0x4a')](_0x144789);})[_0xcd1e('0x2b')](function(_0x3dc47e){_0x484bd2[_0xcd1e('0x4b')]=_0x3dc47e;return _0x484bd2;})[_0xcd1e('0x2b')](respondWithFilteredResult(_0x3eb757,_0x144789))[_0xcd1e('0x4c')](handleError(_0x3eb757,null));};exports[_0xcd1e('0x4d')]=function(_0x2b10e3,_0x17c444){var _0x1e13d5={'raw':![],'where':{'id':_0x2b10e3[_0xcd1e('0x4e')]['id']}},_0x39c389={};_0x39c389[_0xcd1e('0x38')]=_[_0xcd1e('0x4f')](db[_0xcd1e('0x35')]['rawAttributes']);_0x39c389['query']=_[_0xcd1e('0x4f')](_0x2b10e3['query']);_0x39c389['filters']=_[_0xcd1e('0x3b')](_0x39c389['model'],_0x39c389[_0xcd1e('0x39')]);_0x1e13d5[_0xcd1e('0x3c')]=_[_0xcd1e('0x3b')](_0x39c389[_0xcd1e('0x38')],qs[_0xcd1e('0x3d')](_0x2b10e3[_0xcd1e('0x39')][_0xcd1e('0x3d')]));_0x1e13d5[_0xcd1e('0x3c')]=_0x1e13d5[_0xcd1e('0x3c')][_0xcd1e('0x3e')]?_0x1e13d5['attributes']:_0x39c389[_0xcd1e('0x38')];if(_0x2b10e3[_0xcd1e('0x39')][_0xcd1e('0x49')]){_0x1e13d5[_0xcd1e('0x50')]=[{'all':!![]}];}_0x1e13d5=_[_0xcd1e('0x46')]({},_0x1e13d5,_0x2b10e3['options']);return db[_0xcd1e('0x35')][_0xcd1e('0x51')](_0x1e13d5)[_0xcd1e('0x2b')](handleEntityNotFound(_0x17c444,null))[_0xcd1e('0x2b')](respondWithResult(_0x17c444,null))[_0xcd1e('0x4c')](handleError(_0x17c444,null));};exports[_0xcd1e('0x52')]=function(_0x4fa36b,_0x4934fc){return db[_0xcd1e('0x35')]['create'](_0x4fa36b[_0xcd1e('0x53')],{})['then'](function(_0x86ab7a){var _0x53a11a=_0x4fa36b[_0xcd1e('0x54')][_0xcd1e('0x55')]({'plain':!![]});if(!_0x53a11a)throw new Error(_0xcd1e('0x56'));if(_0x53a11a['role']===_0xcd1e('0x54')){var _0x428548=_0x86ab7a[_0xcd1e('0x55')]({'plain':!![]});var _0x355a8e='Lists';return db[_0xcd1e('0x57')][_0xcd1e('0x51')]({'where':{'name':_0x355a8e,'userProfileId':_0x53a11a[_0xcd1e('0x58')]},'raw':!![]})[_0xcd1e('0x2b')](function(_0x381193){if(_0x381193&&_0x381193[_0xcd1e('0x59')]===0x0){return db['UserProfileResource'][_0xcd1e('0x52')]({'name':_0x428548[_0xcd1e('0x31')],'resourceId':_0x428548['id'],'type':_0x381193[_0xcd1e('0x31')],'sectionId':_0x381193['id']},{})['then'](function(){return _0x86ab7a;});}else{return _0x86ab7a;}})[_0xcd1e('0x4c')](function(_0x3284cf){logger[_0xcd1e('0x2f')](_0xcd1e('0x5a'),_0x3284cf);throw _0x3284cf;});}return _0x86ab7a;})['then'](respondWithResult(_0x4934fc,0xc9))[_0xcd1e('0x4c')](handleError(_0x4934fc,null));};exports['update']=function(_0x5c42cd,_0xc9ba3d){if(_0x5c42cd[_0xcd1e('0x53')]['id']){delete _0x5c42cd[_0xcd1e('0x53')]['id'];}return db[_0xcd1e('0x35')][_0xcd1e('0x51')]({'where':{'id':_0x5c42cd[_0xcd1e('0x4e')]['id']}})[_0xcd1e('0x2b')](handleEntityNotFound(_0xc9ba3d,null))[_0xcd1e('0x2b')](saveUpdates(_0x5c42cd['body'],null))[_0xcd1e('0x2b')](respondWithResult(_0xc9ba3d,null))['catch'](handleError(_0xc9ba3d,null));};exports[_0xcd1e('0x2e')]=function(_0x1a0c61,_0x37bf36){return db['CmList'][_0xcd1e('0x51')]({'where':{'id':_0x1a0c61[_0xcd1e('0x4e')]['id']}})[_0xcd1e('0x2b')](handleEntityNotFound(_0x37bf36,null))['then'](removeEntity(_0x37bf36,null))[_0xcd1e('0x4c')](handleError(_0x37bf36,null));};exports[_0xcd1e('0x5b')]=function(_0x18d2b1,_0x13b873){return db[_0xcd1e('0x35')][_0xcd1e('0x5b')]()[_0xcd1e('0x2b')](respondWithResult(_0x13b873,null))[_0xcd1e('0x4c')](handleError(_0x13b873,null));};exports[_0xcd1e('0x5c')]=function(_0xa8419d,_0x1e862e,_0x59d73d){if(_0xa8419d[_0xcd1e('0x53')]['id']){delete _0xa8419d[_0xcd1e('0x53')]['id'];}return db[_0xcd1e('0x35')]['find']({'where':{'id':_0xa8419d[_0xcd1e('0x4e')]['id']}})['then'](handleEntityNotFound(_0x1e862e,null))[_0xcd1e('0x2b')](function(_0x557260){if(_0x557260){_0xa8419d[_0xcd1e('0x53')][_0xcd1e('0x5d')]=_0x557260['id'];return db[_0xcd1e('0x5e')][_0xcd1e('0x52')](_0xa8419d[_0xcd1e('0x53')]);}})['then'](respondWithResult(_0x1e862e,null))[_0xcd1e('0x4c')](handleError(_0x1e862e,null));};exports[_0xcd1e('0x5f')]=function(_0x22ca3d,_0x4ba122,_0x457390){var _0x59fe10={'raw':![],'where':{}};var _0x456504={};var _0x5f42d9={'count':0x0,'rows':[]};return db[_0xcd1e('0x35')][_0xcd1e('0x60')]({'where':{'id':_0x22ca3d[_0xcd1e('0x4e')]['id']}})[_0xcd1e('0x2b')](handleEntityNotFound(_0x4ba122,null))[_0xcd1e('0x2b')](function(_0x4654fc){if(_0x4654fc){_0x456504[_0xcd1e('0x38')]=_[_0xcd1e('0x4f')](db[_0xcd1e('0x5e')][_0xcd1e('0x61')]);_0x456504[_0xcd1e('0x39')]=_[_0xcd1e('0x4f')](_0x22ca3d[_0xcd1e('0x39')]);_0x456504['filters']=_[_0xcd1e('0x3b')](_0x456504[_0xcd1e('0x38')],_0x456504[_0xcd1e('0x39')]);_0x59fe10[_0xcd1e('0x3c')]=_[_0xcd1e('0x3b')](_0x456504[_0xcd1e('0x38')],qs[_0xcd1e('0x3d')](_0x22ca3d[_0xcd1e('0x39')][_0xcd1e('0x3d')]));_0x59fe10[_0xcd1e('0x3c')]=_0x59fe10[_0xcd1e('0x3c')][_0xcd1e('0x3e')]?_0x59fe10['attributes']:_0x456504[_0xcd1e('0x38')];if(!_0x22ca3d['query'][_0xcd1e('0x3f')](_0xcd1e('0x40'))){_0x59fe10[_0xcd1e('0x41')]=qs[_0xcd1e('0x41')](_0x22ca3d[_0xcd1e('0x39')][_0xcd1e('0x41')]);_0x59fe10[_0xcd1e('0x22')]=qs[_0xcd1e('0x22')](_0x22ca3d[_0xcd1e('0x39')][_0xcd1e('0x22')]);}_0x59fe10[_0xcd1e('0x42')]=qs['sort'](_0x22ca3d[_0xcd1e('0x39')][_0xcd1e('0x43')]);_0x59fe10[_0xcd1e('0x44')]=qs[_0xcd1e('0x3a')](_['pick'](_0x22ca3d[_0xcd1e('0x39')],_0x456504['filters']));_0x59fe10[_0xcd1e('0x44')][_0xcd1e('0x5d')]=_0x4654fc['id'];if(_0x22ca3d['query'][_0xcd1e('0x45')]){_0x59fe10[_0xcd1e('0x44')]=_[_0xcd1e('0x46')](_0x59fe10[_0xcd1e('0x44')],{'$or':_[_0xcd1e('0x34')](_0x59fe10[_0xcd1e('0x3c')],function(_0xc7174f){var _0x55bb25={};_0x55bb25[_0xc7174f]={'$like':'%'+_0x22ca3d[_0xcd1e('0x39')]['filter']+'%'};return _0x55bb25;})});}_0x59fe10=_[_0xcd1e('0x46')]({},_0x59fe10,_0x22ca3d['options']);return db[_0xcd1e('0x5e')][_0xcd1e('0x24')]({'where':_0x59fe10[_0xcd1e('0x44')]})[_0xcd1e('0x2b')](function(_0x22b57d){_0x5f42d9[_0xcd1e('0x24')]=_0x22b57d;if(_0x22ca3d['query']['includeAll']){_0x59fe10['include']=[{'all':!![]}];}return db[_0xcd1e('0x5e')]['findAll'](_0x59fe10);})['then'](function(_0x4b8bb9){_0x5f42d9['rows']=_0x4b8bb9;return _0x5f42d9;});}})[_0xcd1e('0x2b')](respondWithFilteredResult(_0x4ba122,_0x59fe10))[_0xcd1e('0x4c')](handleError(_0x4ba122,null));};exports[_0xcd1e('0x62')]=function(_0x412f88,_0x2c33fb,_0x3f871e){return db[_0xcd1e('0x35')][_0xcd1e('0x51')]({'where':{'id':_0x412f88['params']['id']}})[_0xcd1e('0x2b')](handleEntityNotFound(_0x2c33fb,null))[_0xcd1e('0x2b')](function(_0x102a4d){if(_0x102a4d){return _0x102a4d['removeDispositions'](_0x412f88[_0xcd1e('0x39')][_0xcd1e('0x63')]);}})['then'](respondWithStatusCode(_0x2c33fb,null))[_0xcd1e('0x4c')](handleError(_0x2c33fb,null));};exports[_0xcd1e('0x64')]=function(_0x3c027f,_0x2f4857,_0xd4f787){return db[_0xcd1e('0x35')]['find']({'where':{'id':_0x3c027f[_0xcd1e('0x4e')]['id']}})[_0xcd1e('0x2b')](handleEntityNotFound(_0x2f4857,null))['then'](function(_0x1927cd){if(_0x1927cd){var _0x311976=[];var _0x4097be={'success':[],'errors':[]};return db[_0xcd1e('0x65')][_0xcd1e('0x5b')]()[_0xcd1e('0x2b')](function(_0x2a13f2){if(_0x3c027f[_0xcd1e('0x53')][_0xcd1e('0x66')]&&_[_0xcd1e('0x67')](_0x3c027f[_0xcd1e('0x53')]['tags'])){if(_0x3c027f[_0xcd1e('0x53')][_0xcd1e('0x66')]['length']){_0x3c027f[_0xcd1e('0x53')]['tags']=_0x3c027f[_0xcd1e('0x53')][_0xcd1e('0x66')][_0xcd1e('0x68')](';')+';';}else{_0x3c027f[_0xcd1e('0x53')][_0xcd1e('0x66')]=null;}}else{_0x3c027f[_0xcd1e('0x53')][_0xcd1e('0x66')]=null;}if(_0x3c027f[_0xcd1e('0x53')]&&_[_0xcd1e('0x67')](_0x3c027f[_0xcd1e('0x53')])){for(var _0x17a6ba=0x0;_0x17a6ba<_0x3c027f[_0xcd1e('0x53')][_0xcd1e('0x3e')];_0x17a6ba+=0x1){_0x3c027f[_0xcd1e('0x53')][_0x17a6ba]['ListId']=_0x3c027f['params']['id'];_0x311976[_0xcd1e('0x69')](_0x3c027f[_0xcd1e('0x53')][_0x17a6ba]);}return BPromise[_0xcd1e('0x6a')](_0x311976,function(_0x21764b){return db['CmContact']['create'](_[_0xcd1e('0x6b')](_0x21764b,[_0xcd1e('0x63'),'id'])||{},{'fields':_[_0xcd1e('0x4f')](_0x2a13f2),'raw':!![]})[_0xcd1e('0x2b')](function(_0x39cc68){_0x4097be[_0xcd1e('0x6c')]['push'](_0x39cc68[_0xcd1e('0x6d')]);})[_0xcd1e('0x4c')](function(_0x16fddf){_0x4097be[_0xcd1e('0x6e')]['push']({'data':_0x21764b,'error':_0x16fddf['message']});});})[_0xcd1e('0x2b')](function(_0x5186df){return _0x4097be;})['catch'](function(_0x3a02ab){return _0x3a02ab;});}else{_0x2f4857[_0xcd1e('0x20')](0x190)[_0xcd1e('0x27')]({'message':_0xcd1e('0x6f')});}});}})['then'](respondWithResult(_0x2f4857,null))[_0xcd1e('0x4c')](handleError(_0x2f4857,null));};exports[_0xcd1e('0x70')]=function(_0x2586a7,_0x552f2f,_0x56b9b7){var _0x375e6a;return db[_0xcd1e('0x35')]['find']({'where':{'id':_0x2586a7[_0xcd1e('0x4e')]['id']},'include':[{'model':db[_0xcd1e('0x71')],'as':_0xcd1e('0x72')}]})[_0xcd1e('0x2b')](handleEntityNotFound(_0x552f2f,null))[_0xcd1e('0x2b')](function(_0x14211d){if(_0x14211d){_0x375e6a=_0x14211d;return db[_0xcd1e('0x65')][_0xcd1e('0x61')];}})[_0xcd1e('0x2b')](function(_0x5f4d4f){if(_0x5f4d4f){var _0x2e6e91={};var _0x4c86c7={};_0x4c86c7[_0xcd1e('0x38')]=_[_0xcd1e('0x73')](_[_0xcd1e('0x4f')](_0x5f4d4f),_[_0xcd1e('0x34')](_0x375e6a[_0xcd1e('0x72')],function(_0x44698e){return util[_0xcd1e('0x74')](_0xcd1e('0x75'),_0x44698e['id']);}));_0x4c86c7[_0xcd1e('0x39')]=_[_0xcd1e('0x4f')](_0x2586a7[_0xcd1e('0x39')]);_0x4c86c7[_0xcd1e('0x3a')]=_[_0xcd1e('0x3b')](_0x4c86c7[_0xcd1e('0x38')],_0x4c86c7['query']);_0x2e6e91[_0xcd1e('0x3c')]=_[_0xcd1e('0x3b')](_0x4c86c7[_0xcd1e('0x38')],qs['fields'](_0x2586a7[_0xcd1e('0x39')][_0xcd1e('0x3d')]));_0x2e6e91['attributes']=_0x2e6e91[_0xcd1e('0x3c')][_0xcd1e('0x3e')]?_0x2e6e91[_0xcd1e('0x3c')]:_0x4c86c7[_0xcd1e('0x38')];if(!_0x2586a7[_0xcd1e('0x39')]['hasOwnProperty'](_0xcd1e('0x40'))){_0x2e6e91[_0xcd1e('0x41')]=qs[_0xcd1e('0x41')](_0x2586a7[_0xcd1e('0x39')][_0xcd1e('0x41')]);_0x2e6e91['offset']=qs['offset'](_0x2586a7[_0xcd1e('0x39')][_0xcd1e('0x22')]);}_0x2e6e91['order']=qs[_0xcd1e('0x43')](_0x2586a7[_0xcd1e('0x39')]['sort']);_0x2e6e91['where']=qs[_0xcd1e('0x3a')](_[_0xcd1e('0x76')](_0x2586a7[_0xcd1e('0x39')],_0x4c86c7['filters']));_0x2e6e91[_0xcd1e('0x77')]=!![];if(_0x2586a7[_0xcd1e('0x39')]['filter']){_0x2e6e91['where']=_['merge'](_0x2e6e91[_0xcd1e('0x44')],{'$or':_['map'](_0x2e6e91[_0xcd1e('0x3c')],function(_0x1db287){var _0x1419f5={};_0x1419f5[_0x1db287]={'$like':'%'+_0x2586a7[_0xcd1e('0x39')][_0xcd1e('0x45')]+'%'};return _0x1419f5;})});}_0x2e6e91=_['merge']({},_0x2e6e91,_0x2586a7[_0xcd1e('0x48')]);return _0x375e6a['getContacts'](_0x2e6e91);}})['then'](respondWithResult(_0x552f2f,null))[_0xcd1e('0x4c')](handleError(_0x552f2f,null));};exports[_0xcd1e('0x78')]=function(_0x126640,_0x13c83e,_0x1a3cd0){var _0x403406;var _0x4edf0c;var _0x1f00ff;var _0x3a0348=_0x126640['params']['id'];csv_results=[];return db[_0xcd1e('0x79')][_0xcd1e('0x4a')]({'attributes':['id',_0xcd1e('0x31')],'raw':!![],'order':[_0xcd1e('0x7a')]})[_0xcd1e('0x2b')](function(_0x47f290){_0x403406=_0x47f290;var _0x344c04=_[_0xcd1e('0x4f')](db[_0xcd1e('0x65')]['rawAttributes']);return db[_0xcd1e('0x71')]['findAll']({'raw':!![],'attributes':['id',_0xcd1e('0x7b')]})['then'](function(_0x145901){_0x4edf0c=_0x145901;var _0x213145=squel[_0xcd1e('0x7c')]()[_0xcd1e('0x3d')](_0x344c04)['from'](_0xcd1e('0x7d'),'c')[_0xcd1e('0x44')](_0xcd1e('0x7e'),_0x3a0348)[_0xcd1e('0x44')](_0xcd1e('0x7f'))['distinct']();for(var _0x1d6ad5=0x0;_0x1d6ad5<_0x4edf0c[_0xcd1e('0x3e')];_0x1d6ad5++){_0x213145[_0xcd1e('0x80')](_0xcd1e('0x81')+_0x4edf0c[_0x1d6ad5]['id'],_0xcd1e('0x82')+_0x4edf0c[_0x1d6ad5][_0xcd1e('0x7b')]);}for(var _0x1d6ad5=0x0;_0x1d6ad5<_0x403406[_0xcd1e('0x3e')];_0x1d6ad5++){_0x213145[_0xcd1e('0x80')](squel['select']()[_0xcd1e('0x80')](_0xcd1e('0x83'))[_0xcd1e('0x84')](_0xcd1e('0x85'))['where'](_0xcd1e('0x86'),_0x403406[_0x1d6ad5]['id'])[_0xcd1e('0x44')](_0xcd1e('0x87')),_0xcd1e('0x88')+_0x403406[_0x1d6ad5][_0xcd1e('0x31')]);_0x213145[_0xcd1e('0x80')](squel[_0xcd1e('0x7c')]()[_0xcd1e('0x80')](_0xcd1e('0x89'))[_0xcd1e('0x84')](_0xcd1e('0x85'))[_0xcd1e('0x44')](_0xcd1e('0x86'),_0x403406[_0x1d6ad5]['id'])['where'](_0xcd1e('0x87')),'description_additionalPhone_'+_0x403406[_0x1d6ad5][_0xcd1e('0x31')]);}var _0x5c25b1=[];_0x5c25b1['push'](_0x213145[_0xcd1e('0x8a')]());BPromise['each'](_0x5c25b1,handleQuery)[_0xcd1e('0x2b')](function(_0x1252aa){handleQuery(_0x213145['toString']());var _0x15d6cc=csv_results[0x0];if(!_[_0xcd1e('0x8b')](_0x15d6cc)){var _0x2cb630=toCsv(_0x15d6cc);var _0x598ec0=Date['now']();fs[_0xcd1e('0x8c')](util[_0xcd1e('0x74')](_0xcd1e('0x8d'),_0x3a0348,_0x598ec0),_0x2cb630);_0x13c83e['setHeader'](_0xcd1e('0x8e'),_0xcd1e('0x8f')+util[_0xcd1e('0x74')]('list_%d_%s.csv',_0x3a0348,_0x598ec0));_0x13c83e[_0xcd1e('0x90')]('Content-type','text/csv');return _0x13c83e[_0xcd1e('0x91')](util[_0xcd1e('0x74')](_0xcd1e('0x8d'),_0x3a0348,_0x598ec0));}else{return _0x13c83e[_0xcd1e('0x1f')](0xcc);}});});});};exports[_0xcd1e('0x92')]=function(_0x234405,_0x137543,_0x54651e){var _0x5bb040;delete _0x234405[_0xcd1e('0x53')]['id'];return db[_0xcd1e('0x35')][_0xcd1e('0x60')]({'where':{'id':_0x234405[_0xcd1e('0x4e')]['id']}})[_0xcd1e('0x2b')](handleEntityNotFound(_0x137543,null))[_0xcd1e('0x2b')](function(_0x12af83){if(_0x12af83){return db[_0xcd1e('0x93')][_0xcd1e('0x94')](function(_0x48f368){return db[_0xcd1e('0x71')][_0xcd1e('0x52')](_0x234405[_0xcd1e('0x53')],{'transaction':_0x48f368})['then'](function(_0x191e86){_0x5bb040=_0x191e86;return _0x12af83[_0xcd1e('0x95')](_0x191e86,{'transaction':_0x48f368});})['then'](function(){var _0x226589={'type':db[_0xcd1e('0x96')]['TEXT'],'transaction':_0x48f368};switch(_0x234405[_0xcd1e('0x53')][_0xcd1e('0x36')]){case'text':_0x226589['type']=db['Sequelize'][_0xcd1e('0x97')];break;case _0xcd1e('0x98'):_0x226589[_0xcd1e('0x36')]=db[_0xcd1e('0x96')][_0xcd1e('0x99')];break;case _0xcd1e('0x9a'):_0x226589[_0xcd1e('0x36')]=db['Sequelize'][_0xcd1e('0x9b')];_0x226589[_0xcd1e('0x9c')]=![];break;default:}return db[_0xcd1e('0x93')][_0xcd1e('0x9d')]['addColumn'](_0xcd1e('0x7d'),util[_0xcd1e('0x74')](_0xcd1e('0x9e'),_0x5bb040['id']),_0x226589);})[_0xcd1e('0x2b')](function(){return _0x5bb040;});});}})['then'](respondWithResult(_0x137543,null))['catch'](handleError(_0x137543,null));};exports['getCustomFields']=function(_0x4940db,_0x219ec6,_0x2c5031){var _0x35abaa={};var _0x376cc2={};var _0x19fbc9;var _0x44c49c;return db['CmList'][_0xcd1e('0x60')]({'where':{'id':_0x4940db[_0xcd1e('0x4e')]['id']}})['then'](handleEntityNotFound(_0x219ec6,null))[_0xcd1e('0x2b')](function(_0x5b0559){if(_0x5b0559){_0x19fbc9=_0x5b0559;_0x376cc2['model']=_[_0xcd1e('0x4f')](db[_0xcd1e('0x71')][_0xcd1e('0x61')]);_0x376cc2[_0xcd1e('0x39')]=_[_0xcd1e('0x4f')](_0x4940db['query']);_0x376cc2[_0xcd1e('0x3a')]=_['intersection'](_0x376cc2[_0xcd1e('0x38')],_0x376cc2[_0xcd1e('0x39')]);_0x35abaa[_0xcd1e('0x3c')]=_[_0xcd1e('0x3b')](_0x376cc2[_0xcd1e('0x38')],qs[_0xcd1e('0x3d')](_0x4940db[_0xcd1e('0x39')]['fields']));_0x35abaa[_0xcd1e('0x3c')]=_0x35abaa[_0xcd1e('0x3c')]['length']?_0x35abaa[_0xcd1e('0x3c')]:_0x376cc2[_0xcd1e('0x38')];_0x35abaa[_0xcd1e('0x42')]=qs[_0xcd1e('0x43')](_0x4940db['query'][_0xcd1e('0x43')]);_0x35abaa[_0xcd1e('0x44')]=qs[_0xcd1e('0x3a')](_[_0xcd1e('0x76')](_0x4940db[_0xcd1e('0x39')],_0x376cc2['filters']));_0x35abaa['where']=_[_0xcd1e('0x46')](_0x35abaa['where'],{'$or':[{'ListId':_0x5b0559['id']},{'ListId':null}]});if(_0x4940db[_0xcd1e('0x39')][_0xcd1e('0x45')]){_0x35abaa[_0xcd1e('0x44')]=_[_0xcd1e('0x46')](_0x35abaa[_0xcd1e('0x44')],{'$or':_[_0xcd1e('0x34')](_0x35abaa[_0xcd1e('0x3c')],function(_0x8aa7c3){var _0x44eaf7={};_0x44eaf7[_0x8aa7c3]={'$like':'%'+_0x4940db['query'][_0xcd1e('0x45')]+'%'};return _0x44eaf7;})});}_0x35abaa=_[_0xcd1e('0x46')]({},_0x35abaa,_0x4940db[_0xcd1e('0x48')]);return db[_0xcd1e('0x71')][_0xcd1e('0x9f')](_0x35abaa);}})[_0xcd1e('0x2b')](respondWithResult(_0x219ec6,null))[_0xcd1e('0x4c')](handleError(_0x219ec6,null));};exports[_0xcd1e('0xa0')]=function(_0x5760af,_0x911f6){return db[_0xcd1e('0x71')][_0xcd1e('0x9f')]({'where':{'ListId':null}})['then'](handleEntityNotFound(_0x911f6,null))[_0xcd1e('0x2b')](function(_0x1b9e48){return _0x1b9e48;})['then'](respondWithResult(_0x911f6,null))[_0xcd1e('0x4c')](handleError(_0x911f6,null));};exports[_0xcd1e('0xa1')]=function(_0x4eac23,_0x56d53d,_0x484988){return db['CmList'][_0xcd1e('0x51')]({'where':{'id':_0x4eac23[_0xcd1e('0x4e')]['id']}})[_0xcd1e('0x2b')](handleEntityNotFound(_0x56d53d,null))[_0xcd1e('0x2b')](function(_0x5628c1){if(_0x5628c1){return _0x5628c1[_0xcd1e('0xa1')](_0x4eac23[_0xcd1e('0x53')][_0xcd1e('0x63')],_[_0xcd1e('0x6b')](_0x4eac23[_0xcd1e('0x53')],[_0xcd1e('0x63'),'id'])||{})[_0xcd1e('0xa2')](function(_0x3e6248){for(var _0x43fb04=0x0;_0x43fb04<_0x4eac23[_0xcd1e('0x53')][_0xcd1e('0x63')]['length'];_0x43fb04+=0x1){socket[_0xcd1e('0xa3')](_0xcd1e('0xa4'),{'UserId':Number(_0x4eac23[_0xcd1e('0x53')][_0xcd1e('0x63')][_0x43fb04]),'CmListId':Number(_0x4eac23[_0xcd1e('0x4e')]['id'])});}return _0x3e6248;});}})['then'](respondWithResult(_0x56d53d,null))[_0xcd1e('0x4c')](handleError(_0x56d53d,null));};exports[_0xcd1e('0xa5')]=function(_0x11c2ab,_0x2f9fdf,_0xe10f66){return db[_0xcd1e('0x35')][_0xcd1e('0x51')]({'where':{'id':_0x11c2ab['params']['id']}})[_0xcd1e('0x2b')](handleEntityNotFound(_0x2f9fdf,null))[_0xcd1e('0x2b')](function(_0x5bbca1){if(_0x5bbca1){return _0x5bbca1['removeAgents'](_0x11c2ab[_0xcd1e('0x39')]['ids'])[_0xcd1e('0x2b')](function(){if(_[_0xcd1e('0x67')](_0x11c2ab[_0xcd1e('0x39')][_0xcd1e('0x63')])){for(var _0x8cc7ff=0x0;_0x8cc7ff<_0x11c2ab[_0xcd1e('0x39')][_0xcd1e('0x63')]['length'];_0x8cc7ff+=0x1){socket[_0xcd1e('0xa3')]('userCmList:remove',{'UserId':Number(_0x11c2ab['query'][_0xcd1e('0x63')][_0x8cc7ff]),'CmListId':Number(_0x11c2ab['params']['id'])});}}else{socket[_0xcd1e('0xa3')](_0xcd1e('0xa6'),{'UserId':Number(_0x11c2ab[_0xcd1e('0x39')][_0xcd1e('0x63')]),'CmListId':Number(_0x11c2ab['params']['id'])});}});}})['then'](respondWithStatusCode(_0x2f9fdf,null))['catch'](handleError(_0x2f9fdf,null));};exports[_0xcd1e('0xa7')]=function(_0x1fa806,_0x288683,_0x1bc0a5){var _0x463094={};var _0x47dd00={};var _0x4311e2;var _0x4fde51;return db[_0xcd1e('0x35')][_0xcd1e('0x60')]({'where':{'id':_0x1fa806[_0xcd1e('0x4e')]['id']}})[_0xcd1e('0x2b')](handleEntityNotFound(_0x288683,null))[_0xcd1e('0x2b')](function(_0x58bedd){if(_0x58bedd){_0x4311e2=_0x58bedd;_0x47dd00[_0xcd1e('0x38')]=_[_0xcd1e('0x4f')](db[_0xcd1e('0xa8')][_0xcd1e('0x61')]);_0x47dd00['query']=_[_0xcd1e('0x4f')](_0x1fa806[_0xcd1e('0x39')]);_0x47dd00[_0xcd1e('0x3a')]=_[_0xcd1e('0x3b')](_0x47dd00['model'],_0x47dd00[_0xcd1e('0x39')]);_0x463094['attributes']=_[_0xcd1e('0x3b')](_0x47dd00['model'],qs['fields'](_0x1fa806[_0xcd1e('0x39')]['fields']));_0x463094['attributes']=_0x463094[_0xcd1e('0x3c')]['length']?_0x463094[_0xcd1e('0x3c')]:_0x47dd00['model'];_0x463094[_0xcd1e('0x42')]=qs[_0xcd1e('0x43')](_0x1fa806[_0xcd1e('0x39')][_0xcd1e('0x43')]);_0x463094[_0xcd1e('0x44')]=qs['filters'](_[_0xcd1e('0x76')](_0x1fa806[_0xcd1e('0x39')],_0x47dd00['filters']));if(_0x1fa806[_0xcd1e('0x39')]['filter']){_0x463094[_0xcd1e('0x44')]=_[_0xcd1e('0x46')](_0x463094[_0xcd1e('0x44')],{'$or':_[_0xcd1e('0x34')](_0x463094['attributes'],function(_0xd11c82){var _0x50f05a={};_0x50f05a[_0xd11c82]={'$like':'%'+_0x1fa806[_0xcd1e('0x39')][_0xcd1e('0x45')]+'%'};return _0x50f05a;})});}_0x463094=_[_0xcd1e('0x46')]({},_0x463094,_0x1fa806[_0xcd1e('0x48')]);return _0x4311e2[_0xcd1e('0xa7')](_0x463094);}})[_0xcd1e('0x2b')](function(_0x460aa4){if(_0x460aa4){_0x4fde51=_0x460aa4[_0xcd1e('0x3e')];if(!_0x1fa806[_0xcd1e('0x39')]['hasOwnProperty'](_0xcd1e('0x40'))){_0x463094[_0xcd1e('0x41')]=qs[_0xcd1e('0x41')](_0x1fa806[_0xcd1e('0x39')][_0xcd1e('0x41')]);_0x463094[_0xcd1e('0x22')]=qs['offset'](_0x1fa806[_0xcd1e('0x39')][_0xcd1e('0x22')]);}return _0x4311e2[_0xcd1e('0xa7')](_0x463094);}})[_0xcd1e('0x2b')](function(_0x48b358){if(_0x48b358){return _0x48b358?{'count':_0x4fde51,'rows':_0x48b358}:null;}})[_0xcd1e('0x2b')](respondWithResult(_0x288683,null))[_0xcd1e('0x4c')](handleError(_0x288683,null));};function handleQuery(_0x34222e){logger[_0xcd1e('0xa9')](_0x34222e);return db[_0xcd1e('0x93')][_0xcd1e('0x39')](_0x34222e)['spread'](function(_0x47bc36){csv_results[_0xcd1e('0x69')](_0x47bc36);})[_0xcd1e('0x4c')](function(_0x1039a9){logger[_0xcd1e('0x2f')](_0x1039a9['message']);});} \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index 7578756..1754c3e 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 _0x3e74=['hasOwnProperty','exports','events','CmList','setMaxListeners','save','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3e74,0x175));var _0x43e7=function(_0x286d20,_0x4118af){_0x286d20=_0x286d20-0x0;var _0x326b32=_0x3e74[_0x286d20];return _0x326b32;};'use strict';var EventEmitter=require(_0x43e7('0x0'));var CmList=require('../../mysqldb')['db'][_0x43e7('0x1')];var CmListEvents=new EventEmitter();CmListEvents[_0x43e7('0x2')](0x0);var events={'afterCreate':_0x43e7('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0xc58479){return function(_0x4f9bbe,_0x128b0f,_0xe838b4){CmListEvents[_0x43e7('0x4')](_0xc58479+':'+_0x4f9bbe['id'],_0x4f9bbe);CmListEvents[_0x43e7('0x4')](_0xc58479,_0x4f9bbe);_0xe838b4(null);};}for(var e in events){if(events[_0x43e7('0x5')](e)){var event=events[e];CmList['hook'](e,emitEvent(event));}}module[_0x43e7('0x6')]=CmListEvents; \ No newline at end of file +var _0x814b=['update','emit','hook','exports','events','../../mysqldb','CmList','setMaxListeners','save'];(function(_0x33fb76,_0x450ed3){var _0x41033e=function(_0x14ed5e){while(--_0x14ed5e){_0x33fb76['push'](_0x33fb76['shift']());}};_0x41033e(++_0x450ed3);}(_0x814b,0x1a2));var _0xb814=function(_0x37ffea,_0x25b006){_0x37ffea=_0x37ffea-0x0;var _0x2e2615=_0x814b[_0x37ffea];return _0x2e2615;};'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 162f560..f36bcdc 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 _0xb903=['rimraf','../../config/environment','./cmList.attributes','exports','cm_lists','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x2d2f17,_0x2bd8a9){var _0x5a49ae=function(_0x1383d2){while(--_0x1383d2){_0x2d2f17['push'](_0x2d2f17['shift']());}};_0x5a49ae(++_0x2bd8a9);}(_0xb903,0x185));var _0x3b90=function(_0x2dc438,_0x3851c2){_0x2dc438=_0x2dc438-0x0;var _0x13029a=_0xb903[_0x2dc438];return _0x13029a;};'use strict';var _=require(_0x3b90('0x0'));var util=require(_0x3b90('0x1'));var logger=require(_0x3b90('0x2'))(_0x3b90('0x3'));var moment=require('moment');var BPromise=require(_0x3b90('0x4'));var rp=require(_0x3b90('0x5'));var fs=require('fs');var path=require(_0x3b90('0x6'));var rimraf=require(_0x3b90('0x7'));var config=require(_0x3b90('0x8'));var attributes=require(_0x3b90('0x9'));module[_0x3b90('0xa')]=function(_0x5acd76,_0x15b68f){return _0x5acd76['define']('CmList',attributes,{'tableName':_0x3b90('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbec5=['request-promise','path','../../config/environment','./cmList.attributes','exports','define','CmList','cm_lists','lodash','util','api','moment','bluebird'];(function(_0x556d81,_0x3c42ab){var _0x3eca5b=function(_0x167de2){while(--_0x167de2){_0x556d81['push'](_0x556d81['shift']());}};_0x3eca5b(++_0x3c42ab);}(_0xbec5,0xe5));var _0x5bec=function(_0x879e31,_0x139d02){_0x879e31=_0x879e31-0x0;var _0x3467e8=_0xbec5[_0x879e31];return _0x3467e8;};'use strict';var _=require(_0x5bec('0x0'));var util=require(_0x5bec('0x1'));var logger=require('../../config/logger')(_0x5bec('0x2'));var moment=require(_0x5bec('0x3'));var BPromise=require(_0x5bec('0x4'));var rp=require(_0x5bec('0x5'));var fs=require('fs');var path=require(_0x5bec('0x6'));var rimraf=require('rimraf');var config=require(_0x5bec('0x7'));var attributes=require(_0x5bec('0x8'));module[_0x5bec('0x9')]=function(_0x4aaac6,_0x3ed67a){return _0x4aaac6[_0x5bec('0xa')](_0x5bec('0xb'),attributes,{'tableName':_0x5bec('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmList/cmList.rpc.js b/server/api/cmList/cmList.rpc.js index 0025642..29e2ece 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 _0xc744=['localhost','./cmList.socket','register','request','then','info','CmList,\x20%s,\x20%s','debug','CmList,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0xc744,0xc4));var _0x4c74=function(_0x5b058b,_0x294c77){_0x5b058b=_0x5b058b-0x0;var _0x2a78ad=_0xc744[_0x5b058b];return _0x2a78ad;};'use strict';var _=require(_0x4c74('0x0'));var util=require(_0x4c74('0x1'));var moment=require(_0x4c74('0x2'));var BPromise=require(_0x4c74('0x3'));var rs=require(_0x4c74('0x4'));var fs=require('fs');var Redis=require(_0x4c74('0x5'));var db=require(_0x4c74('0x6'))['db'];var utils=require(_0x4c74('0x7'));var logger=require('../../config/logger')(_0x4c74('0x8'));var config=require(_0x4c74('0x9'));var jayson=require(_0x4c74('0xa'));var client=jayson[_0x4c74('0xb')][_0x4c74('0xc')]({'port':0x232a});config[_0x4c74('0xd')]=_['defaults'](config['redis'],{'host':_0x4c74('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x4c74('0xf'))[_0x4c74('0x10')](socket);function respondWithRpcPromise(_0x2e3477,_0x199a9b,_0x32ed2b){return new BPromise(function(_0x23270f,_0x4e00e8){return client[_0x4c74('0x11')](_0x2e3477,_0x32ed2b)[_0x4c74('0x12')](function(_0x539f23){logger[_0x4c74('0x13')](_0x4c74('0x14'),_0x199a9b,'request\x20sent');logger[_0x4c74('0x15')](_0x4c74('0x16'),_0x199a9b,_0x4c74('0x17'),JSON[_0x4c74('0x18')](_0x539f23));if(_0x539f23['error']){if(_0x539f23['error'][_0x4c74('0x19')]===0x1f4){logger[_0x4c74('0x1a')](_0x4c74('0x14'),_0x199a9b,_0x539f23[_0x4c74('0x1a')][_0x4c74('0x1b')]);return _0x4e00e8(_0x539f23['error'][_0x4c74('0x1b')]);}logger['error'](_0x4c74('0x14'),_0x199a9b,_0x539f23[_0x4c74('0x1a')]['message']);return _0x23270f(_0x539f23[_0x4c74('0x1a')][_0x4c74('0x1b')]);}else{logger[_0x4c74('0x13')](_0x4c74('0x14'),_0x199a9b,_0x4c74('0x17'));_0x23270f(_0x539f23[_0x4c74('0x1c')][_0x4c74('0x1b')]);}})[_0x4c74('0x1d')](function(_0x5cc088){logger[_0x4c74('0x1a')](_0x4c74('0x14'),_0x199a9b,_0x5cc088);_0x4e00e8(_0x5cc088);});});} \ No newline at end of file +var _0xd717=['http','redis','defaults','localhost','./cmList.socket','register','request','then','info','CmList,\x20%s,\x20%s','CmList,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client'];(function(_0x581a18,_0x16c0c0){var _0x9b0c59=function(_0x3c03bb){while(--_0x3c03bb){_0x581a18['push'](_0x581a18['shift']());}};_0x9b0c59(++_0x16c0c0);}(_0xd717,0x146));var _0x7d71=function(_0x1b131e,_0x2e4f4c){_0x1b131e=_0x1b131e-0x0;var _0x3937a3=_0xd717[_0x1b131e];return _0x3937a3;};'use strict';var _=require(_0x7d71('0x0'));var util=require(_0x7d71('0x1'));var moment=require(_0x7d71('0x2'));var BPromise=require(_0x7d71('0x3'));var rs=require(_0x7d71('0x4'));var fs=require('fs');var Redis=require(_0x7d71('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x7d71('0x6'));var logger=require(_0x7d71('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x7d71('0x8'));var client=jayson[_0x7d71('0x9')][_0x7d71('0xa')]({'port':0x232a});config[_0x7d71('0xb')]=_[_0x7d71('0xc')](config[_0x7d71('0xb')],{'host':_0x7d71('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x7d71('0xe'))[_0x7d71('0xf')](socket);function respondWithRpcPromise(_0x31395c,_0x20b679,_0x230d98){return new BPromise(function(_0x4eb0fc,_0xed751){return client[_0x7d71('0x10')](_0x31395c,_0x230d98)[_0x7d71('0x11')](function(_0x2a8edd){logger[_0x7d71('0x12')](_0x7d71('0x13'),_0x20b679,'request\x20sent');logger['debug'](_0x7d71('0x14'),_0x20b679,_0x7d71('0x15'),JSON[_0x7d71('0x16')](_0x2a8edd));if(_0x2a8edd[_0x7d71('0x17')]){if(_0x2a8edd[_0x7d71('0x17')][_0x7d71('0x18')]===0x1f4){logger[_0x7d71('0x17')]('CmList,\x20%s,\x20%s',_0x20b679,_0x2a8edd[_0x7d71('0x17')]['message']);return _0xed751(_0x2a8edd['error'][_0x7d71('0x19')]);}logger[_0x7d71('0x17')]('CmList,\x20%s,\x20%s',_0x20b679,_0x2a8edd['error'][_0x7d71('0x19')]);return _0x4eb0fc(_0x2a8edd[_0x7d71('0x17')][_0x7d71('0x19')]);}else{logger[_0x7d71('0x12')](_0x7d71('0x13'),_0x20b679,_0x7d71('0x15'));_0x4eb0fc(_0x2a8edd[_0x7d71('0x1a')]['message']);}})[_0x7d71('0x1b')](function(_0x505b26){logger[_0x7d71('0x17')](_0x7d71('0x13'),_0x20b679,_0x505b26);_0xed751(_0x505b26);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index 9205044..47a2b36 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 _0x825a=['cmList:','./cmList.events','remove','update','emit','removeListener','register','length'];(function(_0x11db1c,_0x2e7a75){var _0x48d116=function(_0x29cc2d){while(--_0x29cc2d){_0x11db1c['push'](_0x11db1c['shift']());}};_0x48d116(++_0x2e7a75);}(_0x825a,0x1a9));var _0xa825=function(_0x5cb1af,_0x4bdc8c){_0x5cb1af=_0x5cb1af-0x0;var _0x8d7940=_0x825a[_0x5cb1af];return _0x8d7940;};'use strict';var CmListEvents=require(_0xa825('0x0'));var events=['save',_0xa825('0x1'),_0xa825('0x2')];function createListener(_0x1d60cb,_0x3a794d){return function(_0x15f6ec){_0x3a794d[_0xa825('0x3')](_0x1d60cb,_0x15f6ec);};}function removeListener(_0x586901,_0x5ea931){return function(){CmListEvents[_0xa825('0x4')](_0x586901,_0x5ea931);};}exports[_0xa825('0x5')]=function(_0x308a81){for(var _0x2ffb8e=0x0,_0x3ec5df=events[_0xa825('0x6')];_0x2ffb8e<_0x3ec5df;_0x2ffb8e++){var _0x19e4da=events[_0x2ffb8e];var _0xee6883=createListener(_0xa825('0x7')+_0x19e4da,_0x308a81);CmListEvents['on'](_0x19e4da,_0xee6883);}}; \ No newline at end of file +var _0x39b5=['length','cmList:','remove','removeListener'];(function(_0x5c5c52,_0x36d085){var _0x4229ff=function(_0x3806df){while(--_0x3806df){_0x5c5c52['push'](_0x5c5c52['shift']());}};_0x4229ff(++_0x36d085);}(_0x39b5,0x1ba));var _0x539b=function(_0x890b53,_0x2b6c6f){_0x890b53=_0x890b53-0x0;var _0x207430=_0x39b5[_0x890b53];return _0x207430;};'use strict';var CmListEvents=require('./cmList.events');var events=['save',_0x539b('0x0'),'update'];function createListener(_0x4595f0,_0x1a6434){return function(_0x55979d){_0x1a6434['emit'](_0x4595f0,_0x55979d);};}function removeListener(_0x222da1,_0x516169){return function(){CmListEvents[_0x539b('0x1')](_0x222da1,_0x516169);};}exports['register']=function(_0x3e2164){for(var _0x11a8e8=0x0,_0x31de19=events[_0x539b('0x2')];_0x11a8e8<_0x31de19;_0x11a8e8++){var _0x280b62=events[_0x11a8e8];var _0x102307=createListener(_0x539b('0x3')+_0x280b62,_0x3e2164);CmListEvents['on'](_0x280b62,_0x102307);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index 5e78b8a..cf40a8c 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 _0x2632=['/:id/fields','getCustomFields','/:id/users','post','create','/:id/dispositions','addDisposition','addContacts','addCustomField','put','/:id','update','delete','removeAgents','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','isAuthenticated','index','/describe','/global_fields','getGlobalCustomFields','get','show','getDispositions','/:id/contacts','getContacts','/:id/contacts/csv'];(function(_0x17785e,_0xbfe61d){var _0x43a276=function(_0x358414){while(--_0x358414){_0x17785e['push'](_0x17785e['shift']());}};_0x43a276(++_0xbfe61d);}(_0x2632,0xae));var _0x2263=function(_0x282ce6,_0x548677){_0x282ce6=_0x282ce6-0x0;var _0x4da37d=_0x2632[_0x282ce6];return _0x4da37d;};'use strict';var multer=require('multer');var util=require(_0x2263('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x2263('0x1'));var router=express['Router']();var fs_extra=require(_0x2263('0x2'));var auth=require(_0x2263('0x3'));var interaction=require(_0x2263('0x4'));var config=require(_0x2263('0x5'));var controller=require(_0x2263('0x6'));router['get']('/',auth[_0x2263('0x7')](),controller[_0x2263('0x8')]);router['get'](_0x2263('0x9'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x2263('0xa'),auth[_0x2263('0x7')](),controller[_0x2263('0xb')]);router[_0x2263('0xc')]('/:id',auth[_0x2263('0x7')](),controller[_0x2263('0xd')]);router['get']('/:id/dispositions',auth[_0x2263('0x7')](),controller[_0x2263('0xe')]);router[_0x2263('0xc')](_0x2263('0xf'),auth[_0x2263('0x7')](),controller[_0x2263('0x10')]);router[_0x2263('0xc')](_0x2263('0x11'),auth['isAuthenticated'](),controller['getContactsCsv']);router[_0x2263('0xc')](_0x2263('0x12'),auth['isAuthenticated'](),controller[_0x2263('0x13')]);router['get'](_0x2263('0x14'),auth[_0x2263('0x7')](),controller['getAgents']);router[_0x2263('0x15')]('/',auth[_0x2263('0x7')](),controller[_0x2263('0x16')]);router['post'](_0x2263('0x17'),auth['isAuthenticated'](),controller[_0x2263('0x18')]);router[_0x2263('0x15')](_0x2263('0xf'),auth[_0x2263('0x7')](),controller[_0x2263('0x19')]);router['post']('/:id/fields',auth[_0x2263('0x7')](),controller[_0x2263('0x1a')]);router[_0x2263('0x15')](_0x2263('0x14'),auth[_0x2263('0x7')](),controller['addAgents']);router[_0x2263('0x1b')](_0x2263('0x1c'),auth[_0x2263('0x7')](),controller[_0x2263('0x1d')]);router[_0x2263('0x1e')](_0x2263('0x1c'),auth[_0x2263('0x7')](),controller['destroy']);router['delete'](_0x2263('0x17'),auth[_0x2263('0x7')](),controller['removeDispositions']);router['delete'](_0x2263('0x14'),auth[_0x2263('0x7')](),controller[_0x2263('0x1f')]);module['exports']=router; \ No newline at end of file +var _0x3ee8=['post','addContacts','put','/:id','update','destroy','delete','removeDispositions','removeAgents','exports','multer','util','Router','../../components/auth/service','../../config/environment','./cmList.controller','isAuthenticated','get','/describe','describe','getGlobalCustomFields','/:id/dispositions','getDispositions','/:id/contacts','getContacts','/:id/contacts/csv','getContactsCsv','/:id/fields','/:id/users','getAgents'];(function(_0x3791a5,_0x3e9d44){var _0x495f05=function(_0x2a2e0c){while(--_0x2a2e0c){_0x3791a5['push'](_0x3791a5['shift']());}};_0x495f05(++_0x3e9d44);}(_0x3ee8,0x136));var _0x83ee=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3ee8[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x83ee('0x0'));var util=require(_0x83ee('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x83ee('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x83ee('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x83ee('0x4'));var controller=require(_0x83ee('0x5'));router['get']('/',auth[_0x83ee('0x6')](),controller['index']);router[_0x83ee('0x7')](_0x83ee('0x8'),auth[_0x83ee('0x6')](),controller[_0x83ee('0x9')]);router[_0x83ee('0x7')]('/global_fields',auth[_0x83ee('0x6')](),controller[_0x83ee('0xa')]);router[_0x83ee('0x7')]('/:id',auth[_0x83ee('0x6')](),controller['show']);router['get'](_0x83ee('0xb'),auth['isAuthenticated'](),controller[_0x83ee('0xc')]);router[_0x83ee('0x7')](_0x83ee('0xd'),auth[_0x83ee('0x6')](),controller[_0x83ee('0xe')]);router[_0x83ee('0x7')](_0x83ee('0xf'),auth[_0x83ee('0x6')](),controller[_0x83ee('0x10')]);router[_0x83ee('0x7')](_0x83ee('0x11'),auth[_0x83ee('0x6')](),controller['getCustomFields']);router[_0x83ee('0x7')](_0x83ee('0x12'),auth[_0x83ee('0x6')](),controller[_0x83ee('0x13')]);router['post']('/',auth[_0x83ee('0x6')](),controller['create']);router[_0x83ee('0x14')](_0x83ee('0xb'),auth['isAuthenticated'](),controller['addDisposition']);router['post'](_0x83ee('0xd'),auth[_0x83ee('0x6')](),controller[_0x83ee('0x15')]);router[_0x83ee('0x14')](_0x83ee('0x11'),auth[_0x83ee('0x6')](),controller['addCustomField']);router[_0x83ee('0x14')]('/:id/users',auth[_0x83ee('0x6')](),controller['addAgents']);router[_0x83ee('0x16')](_0x83ee('0x17'),auth[_0x83ee('0x6')](),controller[_0x83ee('0x18')]);router['delete'](_0x83ee('0x17'),auth[_0x83ee('0x6')](),controller[_0x83ee('0x19')]);router[_0x83ee('0x1a')]('/:id/dispositions',auth[_0x83ee('0x6')](),controller[_0x83ee('0x1b')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0x83ee('0x1c')]);module[_0x83ee('0x1d')]=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index cfc9ca6..ab22dae 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 _0x27d9=['sequelize','exports','VIRTUAL','getDataValue','field','STRING'];(function(_0x35b190,_0x589b87){var _0x4175e0=function(_0x34ee92){while(--_0x34ee92){_0x35b190['push'](_0x35b190['shift']());}};_0x4175e0(++_0x589b87);}(_0x27d9,0x1a4));var _0x927d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x27d9[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x927d('0x0'));module[_0x927d('0x1')]={'name':{'type':Sequelize[_0x927d('0x2')],'get':function(_0x26200d){return this[_0x927d('0x3')](_0x927d('0x4'));}},'field':{'type':Sequelize[_0x927d('0x5')],'allowNull':![]},'operator':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x927d('0x5')],'allowNull':![]}}; \ No newline at end of file +var _0xe155=['getDataValue','field','STRING','sequelize','exports'];(function(_0x2afb08,_0x324211){var _0x38cc5a=function(_0x5ac471){while(--_0x5ac471){_0x2afb08['push'](_0x2afb08['shift']());}};_0x38cc5a(++_0x324211);}(_0xe155,0x120));var _0x5e15=function(_0x287ce9,_0x11efc0){_0x287ce9=_0x287ce9-0x0;var _0x5bd8e6=_0xe155[_0x287ce9];return _0x5bd8e6;};'use strict';var Sequelize=require(_0x5e15('0x0'));module[_0x5e15('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x7db512){return this[_0x5e15('0x2')](_0x5e15('0x3'));}},'field':{'type':Sequelize[_0x5e15('0x4')],'allowNull':![]},'operator':{'type':Sequelize[_0x5e15('0x4')],'allowNull':![]},'value':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index d020350..9d7c236 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(_0x2fbfb7,_0x48b974){var _0x34357e=function(_0x4b7fe5){while(--_0x4b7fe5){_0x2fbfb7['push'](_0x2fbfb7['shift']());}};_0x34357e(++_0x48b974);}(_0x7a54,0x106));var _0x47a5=function(_0x38d8b9,_0x353e93){_0x38d8b9=_0x38d8b9-0x0;var _0x555b09=_0x7a54[_0x38d8b9];return _0x555b09;};'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(_0x4e3ab0,_0x4c9bd3){var _0x4b03b9=function(_0x5c7bd5){while(--_0x5c7bd5){_0x4e3ab0['push'](_0x4e3ab0['shift']());}};_0x4b03b9(++_0x4c9bd3);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'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 7a10f17..22efdcd 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 _0xcd07=['request-promise','rimraf','../../config/environment','./condition.attributes','Condition','tools_conditions','util','../../config/logger','api','moment','bluebird'];(function(_0x18d45a,_0x586837){var _0x303688=function(_0x4a1d82){while(--_0x4a1d82){_0x18d45a['push'](_0x18d45a['shift']());}};_0x303688(++_0x586837);}(_0xcd07,0xa0));var _0x7cd0=function(_0x4fdb10,_0x34c498){_0x4fdb10=_0x4fdb10-0x0;var _0xbd8dea=_0xcd07[_0x4fdb10];return _0xbd8dea;};'use strict';var _=require('lodash');var util=require(_0x7cd0('0x0'));var logger=require(_0x7cd0('0x1'))(_0x7cd0('0x2'));var moment=require(_0x7cd0('0x3'));var BPromise=require(_0x7cd0('0x4'));var rp=require(_0x7cd0('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7cd0('0x6'));var config=require(_0x7cd0('0x7'));var attributes=require(_0x7cd0('0x8'));module['exports']=function(_0x151909,_0x51a814){return _0x151909['define'](_0x7cd0('0x9'),attributes,{'tableName':_0x7cd0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa2df=['request-promise','path','rimraf','./condition.attributes','define','tools_conditions','util','../../config/logger','api','moment'];(function(_0x3861e2,_0x2a08fa){var _0xce1fda=function(_0x492a76){while(--_0x492a76){_0x3861e2['push'](_0x3861e2['shift']());}};_0xce1fda(++_0x2a08fa);}(_0xa2df,0x182));var _0xfa2d=function(_0x44051f,_0x5e4815){_0x44051f=_0x44051f-0x0;var _0x51bc4b=_0xa2df[_0x44051f];return _0x51bc4b;};'use strict';var _=require('lodash');var util=require(_0xfa2d('0x0'));var logger=require(_0xfa2d('0x1'))(_0xfa2d('0x2'));var moment=require(_0xfa2d('0x3'));var BPromise=require('bluebird');var rp=require(_0xfa2d('0x4'));var fs=require('fs');var path=require(_0xfa2d('0x5'));var rimraf=require(_0xfa2d('0x6'));var config=require('../../config/environment');var attributes=require(_0xfa2d('0x7'));module['exports']=function(_0x16bca6,_0x3d7c9c){return _0x16bca6[_0xfa2d('0x8')]('Condition',attributes,{'tableName':_0xfa2d('0x9'),'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 63e993f..56b7bbc 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 _0xfeb5=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','request','then','info','Condition,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','util'];(function(_0x502953,_0x28de83){var _0x2fa32d=function(_0x3b3a52){while(--_0x3b3a52){_0x502953['push'](_0x502953['shift']());}};_0x2fa32d(++_0x28de83);}(_0xfeb5,0x102));var _0x5feb=function(_0x3bdce2,_0x14a65e){_0x3bdce2=_0x3bdce2-0x0;var _0x14cb89=_0xfeb5[_0x3bdce2];return _0x14cb89;};'use strict';var _=require(_0x5feb('0x0'));var util=require(_0x5feb('0x1'));var moment=require('moment');var BPromise=require(_0x5feb('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5feb('0x3'));var db=require(_0x5feb('0x4'))['db'];var utils=require(_0x5feb('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x5feb('0x6'));var jayson=require(_0x5feb('0x7'));var client=jayson[_0x5feb('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1d281f,_0x3aeca8,_0x7617be){return new BPromise(function(_0x4bacf1,_0x4dc6c8){return client[_0x5feb('0x9')](_0x1d281f,_0x7617be)[_0x5feb('0xa')](function(_0x2be9c8){logger[_0x5feb('0xb')](_0x5feb('0xc'),_0x3aeca8,_0x5feb('0xd'));logger[_0x5feb('0xe')]('Condition,\x20%s,\x20%s,\x20%s',_0x3aeca8,_0x5feb('0xd'),JSON['stringify'](_0x2be9c8));if(_0x2be9c8['error']){if(_0x2be9c8[_0x5feb('0xf')][_0x5feb('0x10')]===0x1f4){logger[_0x5feb('0xf')](_0x5feb('0xc'),_0x3aeca8,_0x2be9c8[_0x5feb('0xf')]['message']);return _0x4dc6c8(_0x2be9c8['error']['message']);}logger[_0x5feb('0xf')]('Condition,\x20%s,\x20%s',_0x3aeca8,_0x2be9c8['error'][_0x5feb('0x11')]);return _0x4bacf1(_0x2be9c8[_0x5feb('0xf')][_0x5feb('0x11')]);}else{logger[_0x5feb('0xb')](_0x5feb('0xc'),_0x3aeca8,_0x5feb('0xd'));_0x4bacf1(_0x2be9c8[_0x5feb('0x12')]['message']);}})[_0x5feb('0x13')](function(_0xd27e88){logger['error'](_0x5feb('0xc'),_0x3aeca8,_0xd27e88);_0x4dc6c8(_0xd27e88);});});} \ No newline at end of file +var _0xf72b=['debug','Condition,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Condition,\x20%s,\x20%s','result','catch','lodash','util','randomstring','../../mysqldb','../../config/logger','../../config/environment','client','http','then','info','request\x20sent'];(function(_0x25ad94,_0x103f0e){var _0x5dacb9=function(_0xde0b74){while(--_0xde0b74){_0x25ad94['push'](_0x25ad94['shift']());}};_0x5dacb9(++_0x103f0e);}(_0xf72b,0xa9));var _0xbf72=function(_0x1d4acf,_0x39faa2){_0x1d4acf=_0x1d4acf-0x0;var _0x157e7f=_0xf72b[_0x1d4acf];return _0x157e7f;};'use strict';var _=require(_0xbf72('0x0'));var util=require(_0xbf72('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbf72('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbf72('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xbf72('0x4'))('rpc');var config=require(_0xbf72('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xbf72('0x6')][_0xbf72('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x53c658,_0xf33b1b,_0x817685){return new BPromise(function(_0x5d2c4d,_0x23099c){return client['request'](_0x53c658,_0x817685)[_0xbf72('0x8')](function(_0x360b6d){logger[_0xbf72('0x9')]('Condition,\x20%s,\x20%s',_0xf33b1b,_0xbf72('0xa'));logger[_0xbf72('0xb')](_0xbf72('0xc'),_0xf33b1b,'request\x20sent',JSON[_0xbf72('0xd')](_0x360b6d));if(_0x360b6d['error']){if(_0x360b6d[_0xbf72('0xe')][_0xbf72('0xf')]===0x1f4){logger[_0xbf72('0xe')]('Condition,\x20%s,\x20%s',_0xf33b1b,_0x360b6d[_0xbf72('0xe')]['message']);return _0x23099c(_0x360b6d[_0xbf72('0xe')][_0xbf72('0x10')]);}logger[_0xbf72('0xe')](_0xbf72('0x11'),_0xf33b1b,_0x360b6d[_0xbf72('0xe')][_0xbf72('0x10')]);return _0x5d2c4d(_0x360b6d[_0xbf72('0xe')][_0xbf72('0x10')]);}else{logger[_0xbf72('0x9')]('Condition,\x20%s,\x20%s',_0xf33b1b,_0xbf72('0xa'));_0x5d2c4d(_0x360b6d[_0xbf72('0x12')][_0xbf72('0x10')]);}})[_0xbf72('0x13')](function(_0x31b4fd){logger['error'](_0xbf72('0x11'),_0xf33b1b,_0x31b4fd);_0x23099c(_0x31b4fd);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index 456a18e..79e220c 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 _0xe775=['../../config/environment','./condition.controller','put','/:id','isAuthenticated','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x16af46,_0x49be9b){var _0x40e491=function(_0x3bdf02){while(--_0x3bdf02){_0x16af46['push'](_0x16af46['shift']());}};_0x40e491(++_0x49be9b);}(_0xe775,0x1c3));var _0x5e77=function(_0xc55d64,_0x133f2d){_0xc55d64=_0xc55d64-0x0;var _0x4194f6=_0xe775[_0xc55d64];return _0x4194f6;};'use strict';var multer=require(_0x5e77('0x0'));var util=require(_0x5e77('0x1'));var path=require('path');var timeout=require(_0x5e77('0x2'));var express=require(_0x5e77('0x3'));var router=express[_0x5e77('0x4')]();var fs_extra=require(_0x5e77('0x5'));var auth=require(_0x5e77('0x6'));var interaction=require(_0x5e77('0x7'));var config=require(_0x5e77('0x8'));var controller=require(_0x5e77('0x9'));router[_0x5e77('0xa')](_0x5e77('0xb'),auth[_0x5e77('0xc')](),controller[_0x5e77('0xd')]);router[_0x5e77('0xe')](_0x5e77('0xb'),auth[_0x5e77('0xc')](),controller[_0x5e77('0xf')]);module[_0x5e77('0x10')]=router; \ No newline at end of file +var _0xcf36=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./condition.controller','isAuthenticated','delete','/:id','destroy','exports','multer','util'];(function(_0x3312d9,_0x3dd03a){var _0x88c719=function(_0x2a324b){while(--_0x2a324b){_0x3312d9['push'](_0x3312d9['shift']());}};_0x88c719(++_0x3dd03a);}(_0xcf36,0xdf));var _0x6cf3=function(_0x247a4e,_0x6f85f8){_0x247a4e=_0x247a4e-0x0;var _0x2feec7=_0xcf36[_0x247a4e];return _0x2feec7;};'use strict';var multer=require(_0x6cf3('0x0'));var util=require(_0x6cf3('0x1'));var path=require(_0x6cf3('0x2'));var timeout=require(_0x6cf3('0x3'));var express=require('express');var router=express[_0x6cf3('0x4')]();var fs_extra=require(_0x6cf3('0x5'));var auth=require(_0x6cf3('0x6'));var interaction=require(_0x6cf3('0x7'));var config=require(_0x6cf3('0x8'));var controller=require(_0x6cf3('0x9'));router['put']('/:id',auth[_0x6cf3('0xa')](),controller['update']);router[_0x6cf3('0xb')](_0x6cf3('0xc'),auth[_0x6cf3('0xa')](),controller[_0x6cf3('0xd')]);module[_0x6cf3('0xe')]=router; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.attributes.js b/server/api/contactItemType/contactItemType.attributes.js index 5467b72..c8f905e 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 _0xa2ab=['name','INTEGER','STRING','sequelize'];(function(_0x485840,_0x122071){var _0x41ec7d=function(_0x1e45d0){while(--_0x1e45d0){_0x485840['push'](_0x485840['shift']());}};_0x41ec7d(++_0x122071);}(_0xa2ab,0xef));var _0xba2a=function(_0x59cd35,_0x5a9053){_0x59cd35=_0x59cd35-0x0;var _0x26e325=_0xa2ab[_0x59cd35];return _0x26e325;};'use strict';var Sequelize=require(_0xba2a('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xba2a('0x1')},'OrderBy':{'type':Sequelize[_0xba2a('0x2')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0xba2a('0x3')],'allowNull':!![]}}; \ No newline at end of file +var _0x0399=['exports','STRING','name','INTEGER','sequelize'];(function(_0x3311de,_0x20651d){var _0x5c04e6=function(_0x4cf48a){while(--_0x4cf48a){_0x3311de['push'](_0x3311de['shift']());}};_0x5c04e6(++_0x20651d);}(_0x0399,0x180));var _0x9039=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x0399[_0x1cc8fe];return _0x230054;};'use strict';var Sequelize=require(_0x9039('0x0'));module[_0x9039('0x1')]={'name':{'type':Sequelize[_0x9039('0x2')],'allowNull':![],'unique':_0x9039('0x3')},'OrderBy':{'type':Sequelize[_0x9039('0x4')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0x9039('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 2f85f6b..695788e 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 _0xa30a=['offset','undefined','count','limit','apply','save','update','then','get','ContactItemTypes','UserProfileResource','sendStatus','error','stack','name','send','index','map','ContactItemType','rawAttributes','fieldName','type','query','keys','filters','attributes','model','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','show','params','intersection','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','destroy','CmContactHasItem','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json'];(function(_0x6218f9,_0x221546){var _0x38f432=function(_0x59ee33){while(--_0x59ee33){_0x6218f9['push'](_0x6218f9['shift']());}};_0x38f432(++_0x221546);}(_0xa30a,0xd7));var _0xaa30=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa30a[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0xaa30('0x0'));var rimraf=require(_0xaa30('0x1'));var zipdir=require(_0xaa30('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xaa30('0x3'));var moment=require(_0xaa30('0x4'));var BPromise=require(_0xaa30('0x5'));var Mustache=require(_0xaa30('0x6'));var util=require(_0xaa30('0x7'));var path=require(_0xaa30('0x8'));var sox=require(_0xaa30('0x9'));var csv=require('to-csv');var ejs=require(_0xaa30('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xaa30('0xb'));var squel=require(_0xaa30('0xc'));var crypto=require(_0xaa30('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xaa30('0xe'));var toCsv=require(_0xaa30('0xf'));var querystring=require(_0xaa30('0x10'));var Papa=require(_0xaa30('0x11'));var Redis=require(_0xaa30('0x12'));var authService=require(_0xaa30('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xaa30('0x14'));var logger=require('../../config/logger')(_0xaa30('0x15'));var utils=require(_0xaa30('0x16'));var config=require(_0xaa30('0x17'));var licenseUtil=require(_0xaa30('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xec992f,_0x3de2d1){_0x3de2d1=_0x3de2d1||0xcc;return function(_0xcd1d3b){if(_0xcd1d3b){return _0xec992f['sendStatus'](_0x3de2d1);}return _0xec992f[_0xaa30('0x19')](_0x3de2d1)[_0xaa30('0x1a')]();};}function respondWithResult(_0x25c02e,_0x14de74){_0x14de74=_0x14de74||0xc8;return function(_0x41f1d9){if(_0x41f1d9){return _0x25c02e[_0xaa30('0x19')](_0x14de74)[_0xaa30('0x1b')](_0x41f1d9);}};}function respondWithFilteredResult(_0x3b8095,_0x2e37af){return function(_0xfae724){if(_0xfae724){var _0x519518=typeof _0x2e37af[_0xaa30('0x1c')]==='undefined'&&typeof _0x2e37af['limit']===_0xaa30('0x1d');var _0x153939=_0xfae724[_0xaa30('0x1e')];var _0x540e36=_0x519518?0x0:_0x2e37af['offset'];var _0x53f9fd=_0x519518?_0xfae724[_0xaa30('0x1e')]:_0x2e37af['offset']+_0x2e37af[_0xaa30('0x1f')];var _0x332a0a;if(_0x53f9fd>=_0x153939){_0x53f9fd=_0x153939;_0x332a0a=0xc8;}else{_0x332a0a=0xce;}_0x3b8095['status'](_0x332a0a);return _0x3b8095['set']('Content-Range',_0x540e36+'-'+_0x53f9fd+'/'+_0x153939)[_0xaa30('0x1b')](_0xfae724);}return null;};}function patchUpdates(_0x3e4f1d){return function(_0x61b85){try{jsonpatch[_0xaa30('0x20')](_0x61b85,_0x3e4f1d,!![]);}catch(_0x43a526){return BPromise['reject'](_0x43a526);}return _0x61b85[_0xaa30('0x21')]();};}function saveUpdates(_0x24bb25,_0x2e16e7){return function(_0x2d9e35){if(_0x2d9e35){return _0x2d9e35[_0xaa30('0x22')](_0x24bb25)['then'](function(_0x325b42){return _0x325b42;});}return null;};}function removeEntity(_0x13128a,_0x2fecdd){return function(_0x326f84){if(_0x326f84){return _0x326f84['destroy']()[_0xaa30('0x23')](function(){var _0x1be54c=_0x326f84[_0xaa30('0x24')]({'plain':!![]});var _0x12da2f=_0xaa30('0x25');return db[_0xaa30('0x26')]['destroy']({'where':{'type':_0x12da2f,'resourceId':_0x1be54c['id']}})[_0xaa30('0x23')](function(){return _0x326f84;});})[_0xaa30('0x23')](function(){_0x13128a['status'](0xcc)[_0xaa30('0x1a')]();});}};}function handleEntityNotFound(_0x5b3efb,_0x2da4da){return function(_0x33a0c9){if(!_0x33a0c9){_0x5b3efb[_0xaa30('0x27')](0x194);}return _0x33a0c9;};}function handleError(_0xd1eb3a,_0x37b4a6){_0x37b4a6=_0x37b4a6||0x1f4;return function(_0xc10b8f){logger[_0xaa30('0x28')](_0xc10b8f[_0xaa30('0x29')]);if(_0xc10b8f[_0xaa30('0x2a')]){delete _0xc10b8f[_0xaa30('0x2a')];}_0xd1eb3a[_0xaa30('0x19')](_0x37b4a6)[_0xaa30('0x2b')](_0xc10b8f);};}exports[_0xaa30('0x2c')]=function(_0x46abb9,_0x40e4ee){var _0x1a3f64={},_0x230d56={},_0x1fa8d4={'count':0x0,'rows':[]};var _0x484ffb=_[_0xaa30('0x2d')](db[_0xaa30('0x2e')][_0xaa30('0x2f')],function(_0x20916f){return{'name':_0x20916f[_0xaa30('0x30')],'type':_0x20916f[_0xaa30('0x31')]['key']};});_0x230d56['model']=_['map'](_0x484ffb,_0xaa30('0x2a'));_0x230d56[_0xaa30('0x32')]=_[_0xaa30('0x33')](_0x46abb9[_0xaa30('0x32')]);_0x230d56[_0xaa30('0x34')]=_['intersection'](_0x230d56['model'],_0x230d56[_0xaa30('0x32')]);_0x1a3f64[_0xaa30('0x35')]=_['intersection'](_0x230d56[_0xaa30('0x36')],qs['fields'](_0x46abb9[_0xaa30('0x32')]['fields']));_0x1a3f64[_0xaa30('0x35')]=_0x1a3f64[_0xaa30('0x35')]['length']?_0x1a3f64[_0xaa30('0x35')]:_0x230d56[_0xaa30('0x36')];if(!_0x46abb9[_0xaa30('0x32')][_0xaa30('0x37')](_0xaa30('0x38'))){_0x1a3f64[_0xaa30('0x1f')]=qs['limit'](_0x46abb9[_0xaa30('0x32')][_0xaa30('0x1f')]);_0x1a3f64['offset']=qs[_0xaa30('0x1c')](_0x46abb9[_0xaa30('0x32')][_0xaa30('0x1c')]);}_0x1a3f64['order']=qs['sort'](_0x46abb9[_0xaa30('0x32')][_0xaa30('0x39')]);_0x1a3f64[_0xaa30('0x3a')]=qs[_0xaa30('0x34')](_[_0xaa30('0x3b')](_0x46abb9[_0xaa30('0x32')],_0x230d56['filters']),_0x484ffb);if(_0x46abb9['query'][_0xaa30('0x3c')]){_0x1a3f64[_0xaa30('0x3a')]=_[_0xaa30('0x3d')](_0x1a3f64['where'],{'$or':_[_0xaa30('0x2d')](_0x484ffb,function(_0x1c8cd7){if(_0x1c8cd7[_0xaa30('0x31')]!==_0xaa30('0x3e')){var _0x554144={};_0x554144[_0x1c8cd7[_0xaa30('0x2a')]]={'$like':'%'+_0x46abb9[_0xaa30('0x32')][_0xaa30('0x3c')]+'%'};return _0x554144;}})});}_0x1a3f64=_[_0xaa30('0x3d')]({},_0x1a3f64,_0x46abb9[_0xaa30('0x3f')]);var _0x4f72a7={'where':_0x1a3f64[_0xaa30('0x3a')]};return db[_0xaa30('0x2e')][_0xaa30('0x1e')](_0x4f72a7)[_0xaa30('0x23')](function(_0x13f08f){_0x1fa8d4[_0xaa30('0x1e')]=_0x13f08f;if(_0x46abb9[_0xaa30('0x32')][_0xaa30('0x40')]){_0x1a3f64['include']=[{'all':!![]}];}return db['ContactItemType'][_0xaa30('0x41')](_0x1a3f64);})['then'](function(_0x5208f8){_0x1fa8d4['rows']=_0x5208f8;return _0x1fa8d4;})[_0xaa30('0x23')](respondWithFilteredResult(_0x40e4ee,_0x1a3f64))['catch'](handleError(_0x40e4ee,null));};exports[_0xaa30('0x42')]=function(_0x55f0bb,_0x421f79){var _0x3b892b={'raw':!![],'where':{'id':_0x55f0bb[_0xaa30('0x43')]['id']}},_0x3f530e={};_0x3f530e[_0xaa30('0x36')]=_[_0xaa30('0x33')](db[_0xaa30('0x2e')][_0xaa30('0x2f')]);_0x3f530e[_0xaa30('0x32')]=_[_0xaa30('0x33')](_0x55f0bb[_0xaa30('0x32')]);_0x3f530e['filters']=_[_0xaa30('0x44')](_0x3f530e[_0xaa30('0x36')],_0x3f530e[_0xaa30('0x32')]);_0x3b892b[_0xaa30('0x35')]=_[_0xaa30('0x44')](_0x3f530e['model'],qs['fields'](_0x55f0bb[_0xaa30('0x32')]['fields']));_0x3b892b[_0xaa30('0x35')]=_0x3b892b[_0xaa30('0x35')][_0xaa30('0x45')]?_0x3b892b[_0xaa30('0x35')]:_0x3f530e[_0xaa30('0x36')];if(_0x55f0bb[_0xaa30('0x32')][_0xaa30('0x40')]){_0x3b892b['include']=[{'all':!![]}];}_0x3b892b=_[_0xaa30('0x3d')]({},_0x3b892b,_0x55f0bb[_0xaa30('0x3f')]);return db[_0xaa30('0x2e')]['find'](_0x3b892b)[_0xaa30('0x23')](handleEntityNotFound(_0x421f79,null))[_0xaa30('0x23')](respondWithResult(_0x421f79,null))['catch'](handleError(_0x421f79,null));};exports[_0xaa30('0x46')]=function(_0x4a8fcc,_0x25d227){return db['ContactItemType']['create'](_0x4a8fcc[_0xaa30('0x47')],{})['then'](function(_0x56389c){var _0xf6a737=_0x4a8fcc[_0xaa30('0x48')][_0xaa30('0x24')]({'plain':!![]});if(!_0xf6a737)throw new Error(_0xaa30('0x49'));if(_0xf6a737[_0xaa30('0x4a')]===_0xaa30('0x48')){var _0x5616cd=_0x56389c[_0xaa30('0x24')]({'plain':!![]});var _0x17868d=_0xaa30('0x25');return db['UserProfileSection']['find']({'where':{'name':_0x17868d,'userProfileId':_0xf6a737['userProfileId']},'raw':!![]})['then'](function(_0x998162){if(_0x998162&&_0x998162[_0xaa30('0x4b')]===0x0){return db[_0xaa30('0x26')][_0xaa30('0x46')]({'name':_0x5616cd[_0xaa30('0x2a')],'resourceId':_0x5616cd['id'],'type':_0x998162[_0xaa30('0x2a')],'sectionId':_0x998162['id']},{})['then'](function(){return _0x56389c;});}else{return _0x56389c;}})[_0xaa30('0x4c')](function(_0x2db9d5){logger[_0xaa30('0x28')](_0xaa30('0x4d'),_0x2db9d5);throw _0x2db9d5;});}return _0x56389c;})['then'](respondWithResult(_0x25d227,0xc9))[_0xaa30('0x4c')](handleError(_0x25d227,null));};exports[_0xaa30('0x22')]=function(_0x399007,_0x1edd3a){if(_0x399007[_0xaa30('0x47')]['id']){delete _0x399007['body']['id'];}return db['ContactItemType'][_0xaa30('0x4e')]({'where':{'id':_0x399007[_0xaa30('0x43')]['id']}})[_0xaa30('0x23')](handleEntityNotFound(_0x1edd3a,null))['then'](saveUpdates(_0x399007[_0xaa30('0x47')],null))['then'](respondWithResult(_0x1edd3a,null))[_0xaa30('0x4c')](handleError(_0x1edd3a,null));};exports[_0xaa30('0x4f')]=function(_0x483a01,_0x1fdca8){return db[_0xaa30('0x2e')]['find']({'where':{'id':_0x483a01[_0xaa30('0x43')]['id']}})['then'](handleEntityNotFound(_0x1fdca8,null))['then'](db[_0xaa30('0x50')][_0xaa30('0x22')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x483a01[_0xaa30('0x43')]['id']}}))['then'](removeEntity(_0x1fdca8,null))[_0xaa30('0x4c')](handleError(_0x1fdca8,null));}; \ No newline at end of file +var _0xeb3b=['autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','CmContactHasItem','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','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/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','count','offset','limit','Content-Range','reject','save','then','destroy','get','ContactItemTypes','UserProfileResource','error','name','map','ContactItemType','rawAttributes','fieldName','type','key','keys','query','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','length','create','body','user','role','UserProfileSection','find','userProfileId'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0xeb3b,0x19e));var _0xbeb3=function(_0x18546c,_0x4daf94){_0x18546c=_0x18546c-0x0;var _0x46ef43=_0xeb3b[_0x18546c];return _0x46ef43;};'use strict';var emlformat=require(_0xbeb3('0x0'));var rimraf=require(_0xbeb3('0x1'));var zipdir=require(_0xbeb3('0x2'));var jsonpatch=require(_0xbeb3('0x3'));var rp=require(_0xbeb3('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xbeb3('0x5'));var util=require('util');var path=require(_0xbeb3('0x6'));var sox=require('sox');var csv=require(_0xbeb3('0x7'));var ejs=require(_0xbeb3('0x8'));var fs=require('fs');var fs_extra=require(_0xbeb3('0x9'));var _=require(_0xbeb3('0xa'));var squel=require(_0xbeb3('0xb'));var crypto=require(_0xbeb3('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xbeb3('0xd'));var toCsv=require(_0xbeb3('0x7'));var querystring=require(_0xbeb3('0xe'));var Papa=require(_0xbeb3('0xf'));var Redis=require(_0xbeb3('0x10'));var authService=require(_0xbeb3('0x11'));var qs=require(_0xbeb3('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbeb3('0x13'));var logger=require(_0xbeb3('0x14'))('api');var utils=require(_0xbeb3('0x15'));var config=require(_0xbeb3('0x16'));var licenseUtil=require(_0xbeb3('0x17'));var db=require(_0xbeb3('0x18'))['db'];function respondWithStatusCode(_0x19868e,_0x313296){_0x313296=_0x313296||0xcc;return function(_0x5b9ace){if(_0x5b9ace){return _0x19868e['sendStatus'](_0x313296);}return _0x19868e[_0xbeb3('0x19')](_0x313296)[_0xbeb3('0x1a')]();};}function respondWithResult(_0x5f521b,_0x4dfb28){_0x4dfb28=_0x4dfb28||0xc8;return function(_0xed9879){if(_0xed9879){return _0x5f521b[_0xbeb3('0x19')](_0x4dfb28)[_0xbeb3('0x1b')](_0xed9879);}};}function respondWithFilteredResult(_0x43d58a,_0x26daf2){return function(_0x535836){if(_0x535836){var _0x1aeaee=typeof _0x26daf2['offset']===_0xbeb3('0x1c')&&typeof _0x26daf2['limit']==='undefined';var _0x4f8481=_0x535836[_0xbeb3('0x1d')];var _0x44a4bb=_0x1aeaee?0x0:_0x26daf2[_0xbeb3('0x1e')];var _0x10b15d=_0x1aeaee?_0x535836['count']:_0x26daf2[_0xbeb3('0x1e')]+_0x26daf2[_0xbeb3('0x1f')];var _0xe2cc47;if(_0x10b15d>=_0x4f8481){_0x10b15d=_0x4f8481;_0xe2cc47=0xc8;}else{_0xe2cc47=0xce;}_0x43d58a['status'](_0xe2cc47);return _0x43d58a['set'](_0xbeb3('0x20'),_0x44a4bb+'-'+_0x10b15d+'/'+_0x4f8481)['json'](_0x535836);}return null;};}function patchUpdates(_0x1d917b){return function(_0x50b005){try{jsonpatch['apply'](_0x50b005,_0x1d917b,!![]);}catch(_0xfa2736){return BPromise[_0xbeb3('0x21')](_0xfa2736);}return _0x50b005[_0xbeb3('0x22')]();};}function saveUpdates(_0x4bd89e,_0x301899){return function(_0x18ea0f){if(_0x18ea0f){return _0x18ea0f['update'](_0x4bd89e)[_0xbeb3('0x23')](function(_0x366bdb){return _0x366bdb;});}return null;};}function removeEntity(_0x55a59d,_0xfc384a){return function(_0x278fe4){if(_0x278fe4){return _0x278fe4[_0xbeb3('0x24')]()[_0xbeb3('0x23')](function(){var _0x2bc188=_0x278fe4[_0xbeb3('0x25')]({'plain':!![]});var _0x84921a=_0xbeb3('0x26');return db[_0xbeb3('0x27')]['destroy']({'where':{'type':_0x84921a,'resourceId':_0x2bc188['id']}})['then'](function(){return _0x278fe4;});})[_0xbeb3('0x23')](function(){_0x55a59d['status'](0xcc)[_0xbeb3('0x1a')]();});}};}function handleEntityNotFound(_0xda808c,_0x138adf){return function(_0x400f65){if(!_0x400f65){_0xda808c['sendStatus'](0x194);}return _0x400f65;};}function handleError(_0x2fe7ec,_0x5bc3e1){_0x5bc3e1=_0x5bc3e1||0x1f4;return function(_0x26cd8f){logger[_0xbeb3('0x28')](_0x26cd8f['stack']);if(_0x26cd8f['name']){delete _0x26cd8f[_0xbeb3('0x29')];}_0x2fe7ec['status'](_0x5bc3e1)['send'](_0x26cd8f);};}exports['index']=function(_0x5bfef7,_0xf5dbaf){var _0x4e9a04={},_0x3767cc={},_0x3dff2d={'count':0x0,'rows':[]};var _0x1b4c2e=_[_0xbeb3('0x2a')](db[_0xbeb3('0x2b')][_0xbeb3('0x2c')],function(_0x411cd3){return{'name':_0x411cd3[_0xbeb3('0x2d')],'type':_0x411cd3[_0xbeb3('0x2e')][_0xbeb3('0x2f')]};});_0x3767cc['model']=_[_0xbeb3('0x2a')](_0x1b4c2e,_0xbeb3('0x29'));_0x3767cc['query']=_[_0xbeb3('0x30')](_0x5bfef7[_0xbeb3('0x31')]);_0x3767cc[_0xbeb3('0x32')]=_[_0xbeb3('0x33')](_0x3767cc['model'],_0x3767cc[_0xbeb3('0x31')]);_0x4e9a04[_0xbeb3('0x34')]=_[_0xbeb3('0x33')](_0x3767cc[_0xbeb3('0x35')],qs[_0xbeb3('0x36')](_0x5bfef7[_0xbeb3('0x31')][_0xbeb3('0x36')]));_0x4e9a04[_0xbeb3('0x34')]=_0x4e9a04[_0xbeb3('0x34')]['length']?_0x4e9a04[_0xbeb3('0x34')]:_0x3767cc['model'];if(!_0x5bfef7[_0xbeb3('0x31')][_0xbeb3('0x37')](_0xbeb3('0x38'))){_0x4e9a04[_0xbeb3('0x1f')]=qs[_0xbeb3('0x1f')](_0x5bfef7[_0xbeb3('0x31')][_0xbeb3('0x1f')]);_0x4e9a04[_0xbeb3('0x1e')]=qs['offset'](_0x5bfef7[_0xbeb3('0x31')]['offset']);}_0x4e9a04['order']=qs['sort'](_0x5bfef7[_0xbeb3('0x31')][_0xbeb3('0x39')]);_0x4e9a04[_0xbeb3('0x3a')]=qs[_0xbeb3('0x32')](_[_0xbeb3('0x3b')](_0x5bfef7[_0xbeb3('0x31')],_0x3767cc['filters']),_0x1b4c2e);if(_0x5bfef7[_0xbeb3('0x31')][_0xbeb3('0x3c')]){_0x4e9a04[_0xbeb3('0x3a')]=_['merge'](_0x4e9a04['where'],{'$or':_['map'](_0x1b4c2e,function(_0x46f570){if(_0x46f570[_0xbeb3('0x2e')]!==_0xbeb3('0x3d')){var _0x5d5225={};_0x5d5225[_0x46f570[_0xbeb3('0x29')]]={'$like':'%'+_0x5bfef7['query'][_0xbeb3('0x3c')]+'%'};return _0x5d5225;}})});}_0x4e9a04=_[_0xbeb3('0x3e')]({},_0x4e9a04,_0x5bfef7[_0xbeb3('0x3f')]);var _0x44632a={'where':_0x4e9a04['where']};return db['ContactItemType'][_0xbeb3('0x1d')](_0x44632a)[_0xbeb3('0x23')](function(_0x3d4262){_0x3dff2d[_0xbeb3('0x1d')]=_0x3d4262;if(_0x5bfef7[_0xbeb3('0x31')][_0xbeb3('0x40')]){_0x4e9a04[_0xbeb3('0x41')]=[{'all':!![]}];}return db[_0xbeb3('0x2b')]['findAll'](_0x4e9a04);})[_0xbeb3('0x23')](function(_0x39f2d2){_0x3dff2d[_0xbeb3('0x42')]=_0x39f2d2;return _0x3dff2d;})[_0xbeb3('0x23')](respondWithFilteredResult(_0xf5dbaf,_0x4e9a04))[_0xbeb3('0x43')](handleError(_0xf5dbaf,null));};exports[_0xbeb3('0x44')]=function(_0x1ef1cd,_0x5234bc){var _0x284616={'raw':!![],'where':{'id':_0x1ef1cd[_0xbeb3('0x45')]['id']}},_0xd0403f={};_0xd0403f[_0xbeb3('0x35')]=_[_0xbeb3('0x30')](db[_0xbeb3('0x2b')][_0xbeb3('0x2c')]);_0xd0403f[_0xbeb3('0x31')]=_[_0xbeb3('0x30')](_0x1ef1cd[_0xbeb3('0x31')]);_0xd0403f[_0xbeb3('0x32')]=_[_0xbeb3('0x33')](_0xd0403f[_0xbeb3('0x35')],_0xd0403f['query']);_0x284616[_0xbeb3('0x34')]=_[_0xbeb3('0x33')](_0xd0403f[_0xbeb3('0x35')],qs['fields'](_0x1ef1cd['query'][_0xbeb3('0x36')]));_0x284616[_0xbeb3('0x34')]=_0x284616[_0xbeb3('0x34')][_0xbeb3('0x46')]?_0x284616['attributes']:_0xd0403f[_0xbeb3('0x35')];if(_0x1ef1cd['query']['includeAll']){_0x284616[_0xbeb3('0x41')]=[{'all':!![]}];}_0x284616=_[_0xbeb3('0x3e')]({},_0x284616,_0x1ef1cd[_0xbeb3('0x3f')]);return db[_0xbeb3('0x2b')]['find'](_0x284616)[_0xbeb3('0x23')](handleEntityNotFound(_0x5234bc,null))[_0xbeb3('0x23')](respondWithResult(_0x5234bc,null))[_0xbeb3('0x43')](handleError(_0x5234bc,null));};exports['create']=function(_0x3f93ab,_0x58c49f){return db['ContactItemType'][_0xbeb3('0x47')](_0x3f93ab[_0xbeb3('0x48')],{})[_0xbeb3('0x23')](function(_0x55e546){var _0x23d63c=_0x3f93ab[_0xbeb3('0x49')][_0xbeb3('0x25')]({'plain':!![]});if(!_0x23d63c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x23d63c[_0xbeb3('0x4a')]==='user'){var _0x39605b=_0x55e546['get']({'plain':!![]});var _0x111d0d=_0xbeb3('0x26');return db[_0xbeb3('0x4b')][_0xbeb3('0x4c')]({'where':{'name':_0x111d0d,'userProfileId':_0x23d63c[_0xbeb3('0x4d')]},'raw':!![]})[_0xbeb3('0x23')](function(_0x135ca0){if(_0x135ca0&&_0x135ca0[_0xbeb3('0x4e')]===0x0){return db['UserProfileResource'][_0xbeb3('0x47')]({'name':_0x39605b[_0xbeb3('0x29')],'resourceId':_0x39605b['id'],'type':_0x135ca0[_0xbeb3('0x29')],'sectionId':_0x135ca0['id']},{})[_0xbeb3('0x23')](function(){return _0x55e546;});}else{return _0x55e546;}})['catch'](function(_0x2771e3){logger[_0xbeb3('0x28')](_0xbeb3('0x4f'),_0x2771e3);throw _0x2771e3;});}return _0x55e546;})[_0xbeb3('0x23')](respondWithResult(_0x58c49f,0xc9))['catch'](handleError(_0x58c49f,null));};exports[_0xbeb3('0x50')]=function(_0x5e094f,_0x15d828){if(_0x5e094f[_0xbeb3('0x48')]['id']){delete _0x5e094f[_0xbeb3('0x48')]['id'];}return db['ContactItemType'][_0xbeb3('0x4c')]({'where':{'id':_0x5e094f[_0xbeb3('0x45')]['id']}})[_0xbeb3('0x23')](handleEntityNotFound(_0x15d828,null))[_0xbeb3('0x23')](saveUpdates(_0x5e094f[_0xbeb3('0x48')],null))[_0xbeb3('0x23')](respondWithResult(_0x15d828,null))[_0xbeb3('0x43')](handleError(_0x15d828,null));};exports[_0xbeb3('0x24')]=function(_0x27024e,_0x39fead){return db['ContactItemType'][_0xbeb3('0x4c')]({'where':{'id':_0x27024e[_0xbeb3('0x45')]['id']}})[_0xbeb3('0x23')](handleEntityNotFound(_0x39fead,null))[_0xbeb3('0x23')](db[_0xbeb3('0x51')]['update']({'ItemTypeId':null},{'where':{'ItemTypeId':_0x27024e['params']['id']}}))[_0xbeb3('0x23')](removeEntity(_0x39fead,null))[_0xbeb3('0x43')](handleError(_0x39fead,null));}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.model.js b/server/api/contactItemType/contactItemType.model.js index b9ba9ff..db7668b 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 _0xd59e=['tools_contact_item_types','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./contactItemType.attributes','exports','define','ContactItemType'];(function(_0x888608,_0x3e787f){var _0x113485=function(_0x46a168){while(--_0x46a168){_0x888608['push'](_0x888608['shift']());}};_0x113485(++_0x3e787f);}(_0xd59e,0x69));var _0xed59=function(_0x40f220,_0xef9391){_0x40f220=_0x40f220-0x0;var _0x1f338d=_0xd59e[_0x40f220];return _0x1f338d;};'use strict';var _=require(_0xed59('0x0'));var util=require('util');var logger=require(_0xed59('0x1'))(_0xed59('0x2'));var moment=require(_0xed59('0x3'));var BPromise=require(_0xed59('0x4'));var rp=require(_0xed59('0x5'));var fs=require('fs');var path=require(_0xed59('0x6'));var rimraf=require('rimraf');var config=require(_0xed59('0x7'));var attributes=require(_0xed59('0x8'));module[_0xed59('0x9')]=function(_0x8f0598,_0x5cdc0f){return _0x8f0598[_0xed59('0xa')](_0xed59('0xb'),attributes,{'tableName':_0xed59('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x137c=['request-promise','path','rimraf','../../config/environment','./contactItemType.attributes','exports','define','tools_contact_item_types','../../config/logger','moment'];(function(_0x3da612,_0x332456){var _0x1a9d1d=function(_0x5ca0d0){while(--_0x5ca0d0){_0x3da612['push'](_0x3da612['shift']());}};_0x1a9d1d(++_0x332456);}(_0x137c,0x12a));var _0xc137=function(_0x36ed3c,_0x44a00a){_0x36ed3c=_0x36ed3c-0x0;var _0x52a2e0=_0x137c[_0x36ed3c];return _0x52a2e0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xc137('0x0'))('api');var moment=require(_0xc137('0x1'));var BPromise=require('bluebird');var rp=require(_0xc137('0x2'));var fs=require('fs');var path=require(_0xc137('0x3'));var rimraf=require(_0xc137('0x4'));var config=require(_0xc137('0x5'));var attributes=require(_0xc137('0x6'));module[_0xc137('0x7')]=function(_0x51181e,_0x24e83b){return _0x51181e[_0xc137('0x8')]('ContactItemType',attributes,{'tableName':_0xc137('0x9'),'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 1a3f770..dbfae28 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 _0xcec9=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','request','then','info','ContactItemType,\x20%s,\x20%s','request\x20sent','debug','ContactItemType,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash'];(function(_0x2e4a0f,_0x3a9bb6){var _0x25a3cd=function(_0x1c614f){while(--_0x1c614f){_0x2e4a0f['push'](_0x2e4a0f['shift']());}};_0x25a3cd(++_0x3a9bb6);}(_0xcec9,0x164));var _0x9cec=function(_0x37ec7,_0x13460c){_0x37ec7=_0x37ec7-0x0;var _0x351c70=_0xcec9[_0x37ec7];return _0x351c70;};'use strict';var _=require(_0x9cec('0x0'));var util=require(_0x9cec('0x1'));var moment=require(_0x9cec('0x2'));var BPromise=require(_0x9cec('0x3'));var rs=require(_0x9cec('0x4'));var fs=require('fs');var Redis=require(_0x9cec('0x5'));var db=require(_0x9cec('0x6'))['db'];var utils=require(_0x9cec('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x9cec('0x8'));var jayson=require(_0x9cec('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4075f4,_0x466b70,_0x2a998a){return new BPromise(function(_0x584d48,_0x2c0bfd){return client[_0x9cec('0xa')](_0x4075f4,_0x2a998a)[_0x9cec('0xb')](function(_0xfb2e85){logger[_0x9cec('0xc')](_0x9cec('0xd'),_0x466b70,_0x9cec('0xe'));logger[_0x9cec('0xf')](_0x9cec('0x10'),_0x466b70,_0x9cec('0xe'),JSON[_0x9cec('0x11')](_0xfb2e85));if(_0xfb2e85[_0x9cec('0x12')]){if(_0xfb2e85[_0x9cec('0x12')]['code']===0x1f4){logger[_0x9cec('0x12')](_0x9cec('0xd'),_0x466b70,_0xfb2e85[_0x9cec('0x12')][_0x9cec('0x13')]);return _0x2c0bfd(_0xfb2e85[_0x9cec('0x12')]['message']);}logger[_0x9cec('0x12')](_0x9cec('0xd'),_0x466b70,_0xfb2e85['error'][_0x9cec('0x13')]);return _0x584d48(_0xfb2e85[_0x9cec('0x12')][_0x9cec('0x13')]);}else{logger[_0x9cec('0xc')](_0x9cec('0xd'),_0x466b70,_0x9cec('0xe'));_0x584d48(_0xfb2e85[_0x9cec('0x14')][_0x9cec('0x13')]);}})['catch'](function(_0x10f333){logger[_0x9cec('0x12')](_0x9cec('0xd'),_0x466b70,_0x10f333);_0x2c0bfd(_0x10f333);});});} \ No newline at end of file +var _0x223e=['../../config/logger','rpc','client','http','request','then','info','request\x20sent','ContactItemType,\x20%s,\x20%s,\x20%s','stringify','error','ContactItemType,\x20%s,\x20%s','message','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x4536cf,_0x442c06){var _0x2f7b30=function(_0x2ca7ab){while(--_0x2ca7ab){_0x4536cf['push'](_0x4536cf['shift']());}};_0x2f7b30(++_0x442c06);}(_0x223e,0x1b1));var _0xe223=function(_0x489b87,_0xd51c93){_0x489b87=_0x489b87-0x0;var _0x1823b6=_0x223e[_0x489b87];return _0x1823b6;};'use strict';var _=require(_0xe223('0x0'));var util=require(_0xe223('0x1'));var moment=require(_0xe223('0x2'));var BPromise=require('bluebird');var rs=require(_0xe223('0x3'));var fs=require('fs');var Redis=require(_0xe223('0x4'));var db=require(_0xe223('0x5'))['db'];var utils=require(_0xe223('0x6'));var logger=require(_0xe223('0x7'))(_0xe223('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe223('0x9')][_0xe223('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4a8891,_0x24fdd9,_0x366d9b){return new BPromise(function(_0x4cffbb,_0x4370e1){return client[_0xe223('0xb')](_0x4a8891,_0x366d9b)[_0xe223('0xc')](function(_0x42d99a){logger[_0xe223('0xd')]('ContactItemType,\x20%s,\x20%s',_0x24fdd9,_0xe223('0xe'));logger['debug'](_0xe223('0xf'),_0x24fdd9,_0xe223('0xe'),JSON[_0xe223('0x10')](_0x42d99a));if(_0x42d99a[_0xe223('0x11')]){if(_0x42d99a[_0xe223('0x11')]['code']===0x1f4){logger[_0xe223('0x11')](_0xe223('0x12'),_0x24fdd9,_0x42d99a[_0xe223('0x11')][_0xe223('0x13')]);return _0x4370e1(_0x42d99a[_0xe223('0x11')][_0xe223('0x13')]);}logger[_0xe223('0x11')]('ContactItemType,\x20%s,\x20%s',_0x24fdd9,_0x42d99a[_0xe223('0x11')][_0xe223('0x13')]);return _0x4cffbb(_0x42d99a[_0xe223('0x11')][_0xe223('0x13')]);}else{logger['info']('ContactItemType,\x20%s,\x20%s',_0x24fdd9,_0xe223('0xe'));_0x4cffbb(_0x42d99a['result'][_0xe223('0x13')]);}})['catch'](function(_0x746d36){logger['error']('ContactItemType,\x20%s,\x20%s',_0x24fdd9,_0x746d36);_0x4370e1(_0x746d36);});});} \ No newline at end of file diff --git a/server/api/contactItemType/index.js b/server/api/contactItemType/index.js index 4823fb7..6690f34 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 _0xfe65=['index','/:id','post','put','update','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./contactItemType.controller','get','isAuthenticated'];(function(_0x10a90a,_0x524ac2){var _0x57b51d=function(_0x3c6973){while(--_0x3c6973){_0x10a90a['push'](_0x10a90a['shift']());}};_0x57b51d(++_0x524ac2);}(_0xfe65,0x95));var _0x5fe6=function(_0x4f0bc0,_0x4b6788){_0x4f0bc0=_0x4f0bc0-0x0;var _0x324868=_0xfe65[_0x4f0bc0];return _0x324868;};'use strict';var multer=require('multer');var util=require(_0x5fe6('0x0'));var path=require('path');var timeout=require(_0x5fe6('0x1'));var express=require(_0x5fe6('0x2'));var router=express[_0x5fe6('0x3')]();var fs_extra=require(_0x5fe6('0x4'));var auth=require(_0x5fe6('0x5'));var interaction=require(_0x5fe6('0x6'));var config=require(_0x5fe6('0x7'));var controller=require(_0x5fe6('0x8'));router[_0x5fe6('0x9')]('/',auth[_0x5fe6('0xa')](),controller[_0x5fe6('0xb')]);router[_0x5fe6('0x9')](_0x5fe6('0xc'),auth[_0x5fe6('0xa')](),controller['show']);router[_0x5fe6('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x5fe6('0xe')](_0x5fe6('0xc'),auth['isAuthenticated'](),controller[_0x5fe6('0xf')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xfffa=['create','update','delete','destroy','exports','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./contactItemType.controller','get','isAuthenticated','/:id','show','post'];(function(_0x576170,_0x1712ae){var _0x397c70=function(_0x2eb9de){while(--_0x2eb9de){_0x576170['push'](_0x576170['shift']());}};_0x397c70(++_0x1712ae);}(_0xfffa,0x7c));var _0xafff=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xfffa[_0x20a584];return _0x4b41a8;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xafff('0x0'));var router=express[_0xafff('0x1')]();var fs_extra=require(_0xafff('0x2'));var auth=require(_0xafff('0x3'));var interaction=require(_0xafff('0x4'));var config=require(_0xafff('0x5'));var controller=require(_0xafff('0x6'));router[_0xafff('0x7')]('/',auth[_0xafff('0x8')](),controller['index']);router[_0xafff('0x7')](_0xafff('0x9'),auth['isAuthenticated'](),controller[_0xafff('0xa')]);router[_0xafff('0xb')]('/',auth[_0xafff('0x8')](),controller[_0xafff('0xc')]);router['put']('/:id',auth[_0xafff('0x8')](),controller[_0xafff('0xd')]);router[_0xafff('0xe')](_0xafff('0x9'),auth['isAuthenticated'](),controller[_0xafff('0xf')]);module[_0xafff('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 93ba198..3c4582f 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 _0x2032=['name','exports','STRING'];(function(_0x6a5a73,_0x4806d1){var _0x292e28=function(_0x6a8071){while(--_0x6a8071){_0x6a5a73['push'](_0x6a5a73['shift']());}};_0x292e28(++_0x4806d1);}(_0x2032,0xd9));var _0x2203=function(_0x30b391,_0x238485){_0x30b391=_0x30b391-0x0;var _0x152048=_0x2032[_0x30b391];return _0x152048;};'use strict';var Sequelize=require('sequelize');module[_0x2203('0x0')]={'name':{'type':Sequelize[_0x2203('0x1')],'allowNull':![],'unique':_0x2203('0x2')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x757a=['exports','STRING'];(function(_0x4468d2,_0x6e095c){var _0x45f1bf=function(_0x138d36){while(--_0x138d36){_0x4468d2['push'](_0x4468d2['shift']());}};_0x45f1bf(++_0x6e095c);}(_0x757a,0xde));var _0xa757=function(_0x453184,_0x3ffc68){_0x453184=_0x453184-0x0;var _0x5a0121=_0x757a[_0x453184];return _0x5a0121;};'use strict';var Sequelize=require('sequelize');module[_0xa757('0x0')]={'name':{'type':Sequelize[_0xa757('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index 09b5883..24b84f4 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 _0xc00f=['attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','catch','show','params','include','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','CustomDashboards','UserProfileSection','userProfileId','iframe','attrUrl','attrs','value','https://','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','attrMetric','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','total','attrSerie2','attrSerie3','web-report','attrReport','attrRefresh','stringify','addItem','DashboardId','DashboardItem','getItems','findOne','fast-json-patch','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','redis','./dashboard.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','destroy','UserProfileResource','error','stack','name','index','map','Dashboard','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection'];(function(_0x26ea06,_0x4a12b5){var _0x589e17=function(_0x3e57dc){while(--_0x3e57dc){_0x26ea06['push'](_0x26ea06['shift']());}};_0x589e17(++_0x4a12b5);}(_0xc00f,0x1d7));var _0xfc00=function(_0xb518e5,_0x5b627c){_0xb518e5=_0xb518e5-0x0;var _0x59c78e=_0xc00f[_0xb518e5];return _0x59c78e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xfc00('0x0'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xfc00('0x1'));var Mustache=require(_0xfc00('0x2'));var util=require(_0xfc00('0x3'));var path=require(_0xfc00('0x4'));var sox=require(_0xfc00('0x5'));var csv=require('to-csv');var ejs=require(_0xfc00('0x6'));var fs=require('fs');var fs_extra=require(_0xfc00('0x7'));var _=require(_0xfc00('0x8'));var squel=require(_0xfc00('0x9'));var crypto=require(_0xfc00('0xa'));var jsforce=require(_0xfc00('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xfc00('0xc'));var querystring=require(_0xfc00('0xd'));var Papa=require(_0xfc00('0xe'));var Redis=require(_0xfc00('0xf'));var authService=require(_0xfc00('0x10'));var qs=require(_0xfc00('0x11'));var as=require(_0xfc00('0x12'));var hardwareService=require(_0xfc00('0x13'));var logger=require(_0xfc00('0x14'))('api');var utils=require(_0xfc00('0x15'));var config=require(_0xfc00('0x16'));var licenseUtil=require(_0xfc00('0x17'));var db=require(_0xfc00('0x18'))['db'];config['redis']=_[_0xfc00('0x19')](config['redis'],{'host':_0xfc00('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfc00('0x1b')]));require(_0xfc00('0x1c'))[_0xfc00('0x1d')](socket);function respondWithStatusCode(_0x186a90,_0xd3c961){_0xd3c961=_0xd3c961||0xcc;return function(_0x58ea8d){if(_0x58ea8d){return _0x186a90[_0xfc00('0x1e')](_0xd3c961);}return _0x186a90[_0xfc00('0x1f')](_0xd3c961)[_0xfc00('0x20')]();};}function respondWithResult(_0x52649b,_0x4030d9){_0x4030d9=_0x4030d9||0xc8;return function(_0x4a4852){if(_0x4a4852){return _0x52649b[_0xfc00('0x1f')](_0x4030d9)[_0xfc00('0x21')](_0x4a4852);}};}function respondWithFilteredResult(_0x5f3412,_0x480cfa){return function(_0x4b3142){if(_0x4b3142){var _0x47f19a=typeof _0x480cfa[_0xfc00('0x22')]==='undefined'&&typeof _0x480cfa[_0xfc00('0x23')]===_0xfc00('0x24');var _0x5d3c41=_0x4b3142[_0xfc00('0x25')];var _0x14d623=_0x47f19a?0x0:_0x480cfa[_0xfc00('0x22')];var _0x82c148=_0x47f19a?_0x4b3142[_0xfc00('0x25')]:_0x480cfa['offset']+_0x480cfa['limit'];var _0x253ab6;if(_0x82c148>=_0x5d3c41){_0x82c148=_0x5d3c41;_0x253ab6=0xc8;}else{_0x253ab6=0xce;}_0x5f3412[_0xfc00('0x1f')](_0x253ab6);return _0x5f3412['set'](_0xfc00('0x26'),_0x14d623+'-'+_0x82c148+'/'+_0x5d3c41)[_0xfc00('0x21')](_0x4b3142);}return null;};}function patchUpdates(_0x3cecdc){return function(_0x7c0172){try{jsonpatch[_0xfc00('0x27')](_0x7c0172,_0x3cecdc,!![]);}catch(_0x1aed7d){return BPromise[_0xfc00('0x28')](_0x1aed7d);}return _0x7c0172[_0xfc00('0x29')]();};}function saveUpdates(_0x1c012a,_0x42443b){return function(_0x2f32c6){if(_0x2f32c6){return _0x2f32c6[_0xfc00('0x2a')](_0x1c012a)[_0xfc00('0x2b')](function(_0x1e42f9){return _0x1e42f9;});}return null;};}function removeEntity(_0xc6d0b5,_0x2f0f55){return function(_0x3b7ed0){if(_0x3b7ed0){return _0x3b7ed0[_0xfc00('0x2c')]()[_0xfc00('0x2b')](function(){var _0x1c07f7=_0x3b7ed0['get']({'plain':!![]});var _0x299e30='CustomDashboards';return db[_0xfc00('0x2d')][_0xfc00('0x2c')]({'where':{'type':_0x299e30,'resourceId':_0x1c07f7['id']}})[_0xfc00('0x2b')](function(){return _0x3b7ed0;});})[_0xfc00('0x2b')](function(){_0xc6d0b5['status'](0xcc)[_0xfc00('0x20')]();});}};}function handleEntityNotFound(_0x191fa7,_0x46461e){return function(_0x16ddd0){if(!_0x16ddd0){_0x191fa7[_0xfc00('0x1e')](0x194);}return _0x16ddd0;};}function handleError(_0x59d819,_0x375fc1){_0x375fc1=_0x375fc1||0x1f4;return function(_0x483c63){logger[_0xfc00('0x2e')](_0x483c63[_0xfc00('0x2f')]);if(_0x483c63[_0xfc00('0x30')]){delete _0x483c63[_0xfc00('0x30')];}_0x59d819[_0xfc00('0x1f')](_0x375fc1)['send'](_0x483c63);};}exports[_0xfc00('0x31')]=function(_0x333bc7,_0x1b35b0){var _0x550e6f={},_0xf324ca={},_0x1ee2a4={'count':0x0,'rows':[]};var _0xc87948=_[_0xfc00('0x32')](db[_0xfc00('0x33')][_0xfc00('0x34')],function(_0x2b3798){return{'name':_0x2b3798[_0xfc00('0x35')],'type':_0x2b3798[_0xfc00('0x36')][_0xfc00('0x37')]};});_0xf324ca[_0xfc00('0x38')]=_[_0xfc00('0x32')](_0xc87948,_0xfc00('0x30'));_0xf324ca[_0xfc00('0x39')]=_[_0xfc00('0x3a')](_0x333bc7[_0xfc00('0x39')]);_0xf324ca[_0xfc00('0x3b')]=_[_0xfc00('0x3c')](_0xf324ca[_0xfc00('0x38')],_0xf324ca[_0xfc00('0x39')]);_0x550e6f[_0xfc00('0x3d')]=_[_0xfc00('0x3c')](_0xf324ca[_0xfc00('0x38')],qs['fields'](_0x333bc7[_0xfc00('0x39')][_0xfc00('0x3e')]));_0x550e6f['attributes']=_0x550e6f['attributes'][_0xfc00('0x3f')]?_0x550e6f[_0xfc00('0x3d')]:_0xf324ca[_0xfc00('0x38')];if(!_0x333bc7[_0xfc00('0x39')][_0xfc00('0x40')](_0xfc00('0x41'))){_0x550e6f[_0xfc00('0x23')]=qs[_0xfc00('0x23')](_0x333bc7[_0xfc00('0x39')]['limit']);_0x550e6f[_0xfc00('0x22')]=qs[_0xfc00('0x22')](_0x333bc7['query'][_0xfc00('0x22')]);}_0x550e6f[_0xfc00('0x42')]=qs[_0xfc00('0x43')](_0x333bc7[_0xfc00('0x39')]['sort']);_0x550e6f[_0xfc00('0x44')]=qs[_0xfc00('0x3b')](_[_0xfc00('0x45')](_0x333bc7[_0xfc00('0x39')],_0xf324ca[_0xfc00('0x3b')]),_0xc87948);if(_0x333bc7[_0xfc00('0x39')][_0xfc00('0x46')]){_0x550e6f[_0xfc00('0x44')]=_[_0xfc00('0x47')](_0x550e6f[_0xfc00('0x44')],{'$or':_['map'](_0xc87948,function(_0xb7f2e7){if(_0xb7f2e7[_0xfc00('0x36')]!==_0xfc00('0x48')){var _0x85ea20={};_0x85ea20[_0xb7f2e7[_0xfc00('0x30')]]={'$like':'%'+_0x333bc7[_0xfc00('0x39')]['filter']+'%'};return _0x85ea20;}})});}_0x550e6f=_['merge']({},_0x550e6f,_0x333bc7[_0xfc00('0x49')]);var _0x31219c={'where':_0x550e6f[_0xfc00('0x44')]};return db[_0xfc00('0x33')][_0xfc00('0x25')](_0x31219c)[_0xfc00('0x2b')](function(_0x162e18){_0x1ee2a4[_0xfc00('0x25')]=_0x162e18;if(_0x333bc7['query'][_0xfc00('0x4a')]){_0x550e6f['include']=[{'all':!![]}];}return db[_0xfc00('0x33')][_0xfc00('0x4b')](_0x550e6f);})[_0xfc00('0x2b')](function(_0x1bf9e3){_0x1ee2a4['rows']=_0x1bf9e3;return _0x1ee2a4;})[_0xfc00('0x2b')](respondWithFilteredResult(_0x1b35b0,_0x550e6f))[_0xfc00('0x4c')](handleError(_0x1b35b0,null));};exports[_0xfc00('0x4d')]=function(_0x1683b9,_0x5006bd){var _0x3fbcfa={'raw':![],'where':{'id':_0x1683b9[_0xfc00('0x4e')]['id']}},_0x4c2a82={};_0x4c2a82[_0xfc00('0x38')]=_[_0xfc00('0x3a')](db[_0xfc00('0x33')][_0xfc00('0x34')]);_0x4c2a82['query']=_[_0xfc00('0x3a')](_0x1683b9[_0xfc00('0x39')]);_0x4c2a82[_0xfc00('0x3b')]=_[_0xfc00('0x3c')](_0x4c2a82[_0xfc00('0x38')],_0x4c2a82['query']);_0x3fbcfa[_0xfc00('0x3d')]=_['intersection'](_0x4c2a82[_0xfc00('0x38')],qs['fields'](_0x1683b9[_0xfc00('0x39')][_0xfc00('0x3e')]));_0x3fbcfa['attributes']=_0x3fbcfa[_0xfc00('0x3d')][_0xfc00('0x3f')]?_0x3fbcfa[_0xfc00('0x3d')]:_0x4c2a82[_0xfc00('0x38')];if(_0x1683b9[_0xfc00('0x39')][_0xfc00('0x4a')]){_0x3fbcfa[_0xfc00('0x4f')]=[{'all':!![]}];}_0x3fbcfa=_[_0xfc00('0x47')]({},_0x3fbcfa,_0x1683b9['options']);return db['Dashboard'][_0xfc00('0x50')](_0x3fbcfa)['then'](handleEntityNotFound(_0x5006bd,null))[_0xfc00('0x2b')](respondWithResult(_0x5006bd,null))[_0xfc00('0x4c')](handleError(_0x5006bd,null));};exports['create']=function(_0x4f78b2,_0x1581a5){return db[_0xfc00('0x33')][_0xfc00('0x51')](_0x4f78b2[_0xfc00('0x52')],{})['then'](function(_0x100a39){var _0x5ca353=_0x4f78b2[_0xfc00('0x53')][_0xfc00('0x54')]({'plain':!![]});if(!_0x5ca353)throw new Error(_0xfc00('0x55'));if(_0x5ca353[_0xfc00('0x56')]===_0xfc00('0x53')){var _0x535f70=_0x100a39['get']({'plain':!![]});var _0x1c6318='CustomDashboards';return db['UserProfileSection'][_0xfc00('0x50')]({'where':{'name':_0x1c6318,'userProfileId':_0x5ca353['userProfileId']},'raw':!![]})[_0xfc00('0x2b')](function(_0x140275){if(_0x140275&&_0x140275[_0xfc00('0x57')]===0x0){return db[_0xfc00('0x2d')][_0xfc00('0x51')]({'name':_0x535f70[_0xfc00('0x30')],'resourceId':_0x535f70['id'],'type':_0x140275['name'],'sectionId':_0x140275['id']},{})[_0xfc00('0x2b')](function(){return _0x100a39;});}else{return _0x100a39;}})[_0xfc00('0x4c')](function(_0x3864cc){logger[_0xfc00('0x2e')](_0xfc00('0x58'),_0x3864cc);throw _0x3864cc;});}return _0x100a39;})['then'](respondWithResult(_0x1581a5,0xc9))['catch'](handleError(_0x1581a5,null));};exports[_0xfc00('0x59')]=function(_0x4ada42,_0x3dd6f4){var _0x470c2f={'where':{'id':_0x4ada42[_0xfc00('0x4e')]['id']}},_0x2e96f3={};_0x2e96f3[_0xfc00('0x38')]=_[_0xfc00('0x3a')](db['Dashboard'][_0xfc00('0x34')]);_0x470c2f['attributes']=_[_0xfc00('0x3c')](_0x2e96f3[_0xfc00('0x38')],qs[_0xfc00('0x3e')](_0x4ada42[_0xfc00('0x39')][_0xfc00('0x3e')]));_0x470c2f[_0xfc00('0x3d')]=_0x470c2f[_0xfc00('0x3d')]['length']?_0x470c2f[_0xfc00('0x3d')]:_0x2e96f3['model'];if(_0x4ada42['query'][_0xfc00('0x4a')]){_0x470c2f[_0xfc00('0x4f')]=[{'all':!![]}];}_0x470c2f=_['merge']({},_0x470c2f,_0x4ada42[_0xfc00('0x49')]);return db['Dashboard'][_0xfc00('0x50')](_0x470c2f)['then'](handleEntityNotFound(_0x3dd6f4,null))['then'](function(_0x8e723d){if(_0x8e723d){var _0x302b9e=_0x8e723d[_0xfc00('0x54')]({'plain':!![]});_0x302b9e=qs[_0xfc00('0x5a')](_0x302b9e,['id',_0xfc00('0x5b'),'updatedAt']);_0x4ada42[_0xfc00('0x52')]=_[_0xfc00('0x5a')](_0x4ada42[_0xfc00('0x52')],['id',_0xfc00('0x5b'),_0xfc00('0x5c')]);return db[_0xfc00('0x33')]['create'](_['merge'](_0x302b9e,_0x4ada42[_0xfc00('0x52')]),{'include':_0x4ada42[_0xfc00('0x39')]['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x139bc6){var _0x33f726=_0x4ada42[_0xfc00('0x53')][_0xfc00('0x54')]({'plain':!![]});if(!_0x33f726)throw new Error(_0xfc00('0x55'));if(_0x33f726[_0xfc00('0x56')]===_0xfc00('0x53')){var _0x1bd36f=_0x139bc6['get']({'plain':!![]});var _0x265fcb=_0xfc00('0x5d');return db[_0xfc00('0x5e')]['find']({'where':{'name':_0x265fcb,'userProfileId':_0x33f726[_0xfc00('0x5f')]},'raw':!![]})[_0xfc00('0x2b')](function(_0x1bff24){if(_0x1bff24&&_0x1bff24['autoAssociation']===0x0){return db[_0xfc00('0x2d')][_0xfc00('0x51')]({'name':_0x1bd36f[_0xfc00('0x30')],'resourceId':_0x1bd36f['id'],'type':_0x1bff24[_0xfc00('0x30')],'sectionId':_0x1bff24['id']},{})['then'](function(){return _0x139bc6;});}else{return _0x139bc6;}})['catch'](function(_0x2eb0b7){logger[_0xfc00('0x2e')](_0xfc00('0x58'),_0x2eb0b7);throw _0x2eb0b7;});}return _0x139bc6;});}})[_0xfc00('0x2b')](respondWithResult(_0x3dd6f4,0xc9))[_0xfc00('0x4c')](handleError(_0x3dd6f4,null));};exports[_0xfc00('0x2a')]=function(_0xb2ee40,_0x2b6662){if(_0xb2ee40[_0xfc00('0x52')]['id']){delete _0xb2ee40[_0xfc00('0x52')]['id'];}return db[_0xfc00('0x33')][_0xfc00('0x50')]({'where':{'id':_0xb2ee40['params']['id']}})[_0xfc00('0x2b')](handleEntityNotFound(_0x2b6662,null))[_0xfc00('0x2b')](saveUpdates(_0xb2ee40[_0xfc00('0x52')],null))[_0xfc00('0x2b')](respondWithResult(_0x2b6662,null))[_0xfc00('0x4c')](handleError(_0x2b6662,null));};exports['destroy']=function(_0x39deb5,_0x742a7){return db[_0xfc00('0x33')][_0xfc00('0x50')]({'where':{'id':_0x39deb5[_0xfc00('0x4e')]['id']}})['then'](handleEntityNotFound(_0x742a7,null))[_0xfc00('0x2b')](removeEntity(_0x742a7,null))[_0xfc00('0x4c')](handleError(_0x742a7,null));};function widgetAttributes(_0x5a6f67){try{switch(_0x5a6f67[_0xfc00('0x36')]){case _0xfc00('0x60'):return[{'name':_0xfc00('0x61'),'value':_0x5a6f67[_0xfc00('0x61')]||(_0x5a6f67[_0xfc00('0x62')]&&_0x5a6f67[_0xfc00('0x62')][0x0]?_0x5a6f67[_0xfc00('0x62')][0x0][_0xfc00('0x63')]:undefined)||_0xfc00('0x64')}];case'custom':return[{'name':_0xfc00('0x65'),'value':_0x5a6f67['attrPath']||(_0x5a6f67[_0xfc00('0x62')]&&_0x5a6f67[_0xfc00('0x62')][0x0]?_0x5a6f67[_0xfc00('0x62')][0x0]['value']:undefined)||''}];case _0xfc00('0x66'):return[{'name':_0xfc00('0x67'),'value':_0x5a6f67[_0xfc00('0x67')]||(_0x5a6f67[_0xfc00('0x62')]&&_0x5a6f67['attrs'][0x0]?_0x5a6f67[_0xfc00('0x62')][0x0][_0xfc00('0x63')]:undefined)||_0xfc00('0x68')},{'name':'attrTimezone','value':_0x5a6f67[_0xfc00('0x69')]||(_0x5a6f67[_0xfc00('0x62')]&&_0x5a6f67[_0xfc00('0x62')][0x1]?_0x5a6f67[_0xfc00('0x62')][0x1][_0xfc00('0x63')]:undefined)||_0xfc00('0x6a')},{'name':_0xfc00('0x6b'),'value':_0x5a6f67[_0xfc00('0x6b')]||(_0x5a6f67[_0xfc00('0x62')]&&_0x5a6f67['attrs'][0x2]?_0x5a6f67[_0xfc00('0x62')][0x2][_0xfc00('0x63')]:undefined)||0xc}];case'counter':return[{'name':'attrMetric','value':_0x5a6f67[_0xfc00('0x6c')]||(_0x5a6f67['attrs']&&_0x5a6f67[_0xfc00('0x62')][0x0]?_0x5a6f67[_0xfc00('0x62')][0x0]['value']:undefined)||'total'},{'name':_0xfc00('0x6d'),'value':_0x5a6f67['attrVoiceQueues']||(_0x5a6f67[_0xfc00('0x62')]&&_0x5a6f67[_0xfc00('0x62')][0x1]?_0x5a6f67[_0xfc00('0x62')][0x1][_0xfc00('0x63')]:undefined)||[]},{'name':'attrFontSize','value':_0x5a6f67[_0xfc00('0x6b')]||(_0x5a6f67[_0xfc00('0x62')]&&_0x5a6f67['attrs'][0x2]?_0x5a6f67[_0xfc00('0x62')][0x2][_0xfc00('0x63')]:undefined)||0x14},{'name':_0xfc00('0x6e'),'value':_0x5a6f67[_0xfc00('0x6e')]||(_0x5a6f67[_0xfc00('0x62')]&&_0x5a6f67['attrs'][0x3]?_0x5a6f67[_0xfc00('0x62')][0x3]['value']:undefined)||_0xfc00('0x6f')},{'name':_0xfc00('0x70'),'value':_0x5a6f67[_0xfc00('0x70')]||(_0x5a6f67[_0xfc00('0x62')]&&_0x5a6f67[_0xfc00('0x62')][0x4]?_0x5a6f67[_0xfc00('0x62')][0x4][_0xfc00('0x63')]:undefined)||''},{'name':_0xfc00('0x71'),'value':_0x5a6f67['attrFaxAccounts']||(_0x5a6f67[_0xfc00('0x62')]&&_0x5a6f67[_0xfc00('0x62')][0x5]?_0x5a6f67['attrs'][0x5][_0xfc00('0x63')]:undefined)||''},{'name':_0xfc00('0x72'),'value':_0x5a6f67[_0xfc00('0x72')]||(_0x5a6f67[_0xfc00('0x62')]&&_0x5a6f67[_0xfc00('0x62')][0x6]?_0x5a6f67[_0xfc00('0x62')][0x6][_0xfc00('0x63')]:undefined)||''},{'name':_0xfc00('0x73'),'value':_0x5a6f67[_0xfc00('0x73')]||(_0x5a6f67[_0xfc00('0x62')]&&_0x5a6f67[_0xfc00('0x62')][0x7]?_0x5a6f67[_0xfc00('0x62')][0x7][_0xfc00('0x63')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x5a6f67[_0xfc00('0x74')]||(_0x5a6f67[_0xfc00('0x62')]&&_0x5a6f67['attrs'][0x8]?_0x5a6f67['attrs'][0x8][_0xfc00('0x63')]:undefined)||''},{'name':'attrChatWebsites','value':_0x5a6f67[_0xfc00('0x75')]||(_0x5a6f67['attrs']&&_0x5a6f67[_0xfc00('0x62')][0x9]?_0x5a6f67[_0xfc00('0x62')][0x9]['value']:undefined)||''}];case _0xfc00('0x76'):case _0xfc00('0x77'):return[{'name':_0xfc00('0x78'),'value':_0x5a6f67['attrSerie1']||(_0x5a6f67[_0xfc00('0x62')]&&_0x5a6f67[_0xfc00('0x62')][0x0]?_0x5a6f67[_0xfc00('0x62')][0x0][_0xfc00('0x63')]:undefined)||_0xfc00('0x79')},{'name':_0xfc00('0x7a'),'value':_0x5a6f67['attrSerie2']||(_0x5a6f67[_0xfc00('0x62')]&&_0x5a6f67[_0xfc00('0x62')][0x1]?_0x5a6f67[_0xfc00('0x62')][0x1][_0xfc00('0x63')]:undefined)||null},{'name':_0xfc00('0x7b'),'value':_0x5a6f67[_0xfc00('0x7b')]||(_0x5a6f67[_0xfc00('0x62')]&&_0x5a6f67[_0xfc00('0x62')][0x2]?_0x5a6f67[_0xfc00('0x62')][0x2][_0xfc00('0x63')]:undefined)||null},{'name':_0xfc00('0x6d'),'value':_0x5a6f67[_0xfc00('0x6d')]||(_0x5a6f67['attrs']&&_0x5a6f67[_0xfc00('0x62')][0x3]?_0x5a6f67[_0xfc00('0x62')][0x3][_0xfc00('0x63')]:undefined)||[]},{'name':_0xfc00('0x6e'),'value':_0x5a6f67[_0xfc00('0x6e')]||(_0x5a6f67[_0xfc00('0x62')]&&_0x5a6f67[_0xfc00('0x62')][0x4]?_0x5a6f67['attrs'][0x4][_0xfc00('0x63')]:undefined)||_0xfc00('0x6f')},{'name':_0xfc00('0x70'),'value':_0x5a6f67[_0xfc00('0x70')]||(_0x5a6f67['attrs']&&_0x5a6f67[_0xfc00('0x62')][0x5]?_0x5a6f67[_0xfc00('0x62')][0x5][_0xfc00('0x63')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x5a6f67['attrFaxAccounts']||(_0x5a6f67[_0xfc00('0x62')]&&_0x5a6f67[_0xfc00('0x62')][0x6]?_0x5a6f67[_0xfc00('0x62')][0x6]['value']:undefined)||''},{'name':_0xfc00('0x72'),'value':_0x5a6f67[_0xfc00('0x72')]||(_0x5a6f67['attrs']&&_0x5a6f67['attrs'][0x7]?_0x5a6f67[_0xfc00('0x62')][0x7]['value']:undefined)||''},{'name':_0xfc00('0x73'),'value':_0x5a6f67['attrOpenchannelAccounts']||(_0x5a6f67['attrs']&&_0x5a6f67['attrs'][0x8]?_0x5a6f67['attrs'][0x8]['value']:undefined)||''},{'name':_0xfc00('0x74'),'value':_0x5a6f67[_0xfc00('0x74')]||(_0x5a6f67['attrs']&&_0x5a6f67[_0xfc00('0x62')][0x9]?_0x5a6f67[_0xfc00('0x62')][0x9][_0xfc00('0x63')]:undefined)||''},{'name':_0xfc00('0x75'),'value':_0x5a6f67[_0xfc00('0x75')]||(_0x5a6f67[_0xfc00('0x62')]&&_0x5a6f67[_0xfc00('0x62')][0xa]?_0x5a6f67[_0xfc00('0x62')][0xa]['value']:undefined)||''}];case _0xfc00('0x7c'):return[{'name':'attrReport','type':_0x5a6f67['reportType']||(_0x5a6f67[_0xfc00('0x62')]&&_0x5a6f67[_0xfc00('0x62')][0x0]?_0x5a6f67['attrs'][0x0][_0xfc00('0x36')]:undefined)||null,'value':_0x5a6f67[_0xfc00('0x7d')]||(_0x5a6f67[_0xfc00('0x62')]&&_0x5a6f67[_0xfc00('0x62')][0x0]?_0x5a6f67[_0xfc00('0x62')][0x0][_0xfc00('0x63')]:undefined)||null},{'name':_0xfc00('0x7e'),'value':_0x5a6f67[_0xfc00('0x7e')]||(_0x5a6f67[_0xfc00('0x62')]&&_0x5a6f67['attrs'][0x1]?_0x5a6f67[_0xfc00('0x62')][0x1][_0xfc00('0x63')]:undefined)||0x0}];default:return[];}}catch(_0x3075e9){logger[_0xfc00('0x2e')]('widgetAttributes:\x20%s',JSON[_0xfc00('0x7f')](_0x3075e9));return[];}}exports[_0xfc00('0x80')]=function(_0x1b40fb,_0x5afe1e,_0x32f789){if(_0x1b40fb[_0xfc00('0x52')]['id']){delete _0x1b40fb['body']['id'];}return db[_0xfc00('0x33')][_0xfc00('0x50')]({'where':{'id':_0x1b40fb[_0xfc00('0x4e')]['id']}})[_0xfc00('0x2b')](handleEntityNotFound(_0x5afe1e,null))[_0xfc00('0x2b')](function(_0xf3eb8d){if(_0xf3eb8d){_0x1b40fb[_0xfc00('0x52')][_0xfc00('0x81')]=_0xf3eb8d['id'];_0x1b40fb['body']['attrs']=widgetAttributes(_0x1b40fb[_0xfc00('0x52')]);return db[_0xfc00('0x82')][_0xfc00('0x51')](_0x1b40fb[_0xfc00('0x52')]);}})[_0xfc00('0x2b')](respondWithResult(_0x5afe1e,null))[_0xfc00('0x4c')](handleError(_0x5afe1e,null));};exports[_0xfc00('0x83')]=function(_0x5b0f7a,_0x30dcd0,_0x4262e3){var _0x2acbef={};var _0x2660c9={};var _0x73fabb;var _0x671788;return db['Dashboard'][_0xfc00('0x84')]({'where':{'id':_0x5b0f7a['params']['id']}})['then'](handleEntityNotFound(_0x30dcd0,null))[_0xfc00('0x2b')](function(_0x57f7a6){if(_0x57f7a6){_0x73fabb=_0x57f7a6;_0x2660c9[_0xfc00('0x38')]=_[_0xfc00('0x3a')](db[_0xfc00('0x82')]['rawAttributes']);_0x2660c9[_0xfc00('0x39')]=_['keys'](_0x5b0f7a[_0xfc00('0x39')]);_0x2660c9['filters']=_[_0xfc00('0x3c')](_0x2660c9['model'],_0x2660c9[_0xfc00('0x39')]);_0x2acbef['attributes']=_[_0xfc00('0x3c')](_0x2660c9['model'],qs['fields'](_0x5b0f7a[_0xfc00('0x39')]['fields']));_0x2acbef[_0xfc00('0x3d')]=_0x2acbef[_0xfc00('0x3d')][_0xfc00('0x3f')]?_0x2acbef[_0xfc00('0x3d')]:_0x2660c9['model'];_0x2acbef[_0xfc00('0x42')]=qs[_0xfc00('0x43')](_0x5b0f7a[_0xfc00('0x39')][_0xfc00('0x43')]);_0x2acbef[_0xfc00('0x44')]=qs['filters'](_['pick'](_0x5b0f7a[_0xfc00('0x39')],_0x2660c9['filters']));if(_0x5b0f7a[_0xfc00('0x39')][_0xfc00('0x46')]){_0x2acbef[_0xfc00('0x44')]=_[_0xfc00('0x47')](_0x2acbef[_0xfc00('0x44')],{'$or':_[_0xfc00('0x32')](_0x2acbef[_0xfc00('0x3d')],function(_0xa7192){var _0x1405b2={};_0x1405b2[_0xa7192]={'$like':'%'+_0x5b0f7a['query'][_0xfc00('0x46')]+'%'};return _0x1405b2;})});}_0x2acbef=_[_0xfc00('0x47')]({},_0x2acbef,_0x5b0f7a[_0xfc00('0x49')]);return _0x73fabb[_0xfc00('0x83')](_0x2acbef);}})[_0xfc00('0x2b')](function(_0x3ea914){if(_0x3ea914){_0x671788=_0x3ea914[_0xfc00('0x3f')];if(!_0x5b0f7a[_0xfc00('0x39')][_0xfc00('0x40')](_0xfc00('0x41'))){_0x2acbef[_0xfc00('0x23')]=qs[_0xfc00('0x23')](_0x5b0f7a[_0xfc00('0x39')]['limit']);_0x2acbef['offset']=qs[_0xfc00('0x22')](_0x5b0f7a[_0xfc00('0x39')][_0xfc00('0x22')]);}return _0x73fabb[_0xfc00('0x83')](_0x2acbef);}})[_0xfc00('0x2b')](function(_0x728c27){if(_0x728c27){return _0x728c27?{'count':_0x671788,'rows':_0x728c27}:null;}})['then'](respondWithResult(_0x30dcd0,null))[_0xfc00('0x4c')](handleError(_0x30dcd0,null));}; \ No newline at end of file +var _0x3000=['get','role','user','UserProfileSection','userProfileId','autoAssociation','error','catch','params','createdAt','updatedAt','omit','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','attrEmailAccounts','web-report','reportType','attrReport','attrRefresh','widgetAttributes:\x20%s','addItem','DashboardItem','getItems','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','./dashboard.socket','end','status','offset','undefined','count','limit','Content-Range','json','apply','reject','save','update','then','CustomDashboards','UserProfileResource','destroy','sendStatus','stack','name','index','map','Dashboard','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','keys','options','find','create','body'];(function(_0x6cf19c,_0x2f3f02){var _0xce14f3=function(_0x474587){while(--_0x474587){_0x6cf19c['push'](_0x6cf19c['shift']());}};_0xce14f3(++_0x2f3f02);}(_0x3000,0x12f));var _0x0300=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3000[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x0300('0x0'));var rimraf=require(_0x0300('0x1'));var zipdir=require(_0x0300('0x2'));var jsonpatch=require(_0x0300('0x3'));var rp=require(_0x0300('0x4'));var moment=require(_0x0300('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x0300('0x6'));var path=require(_0x0300('0x7'));var sox=require(_0x0300('0x8'));var csv=require(_0x0300('0x9'));var ejs=require(_0x0300('0xa'));var fs=require('fs');var fs_extra=require(_0x0300('0xb'));var _=require(_0x0300('0xc'));var squel=require(_0x0300('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x0300('0x9'));var querystring=require('querystring');var Papa=require(_0x0300('0xe'));var Redis=require('ioredis');var authService=require(_0x0300('0xf'));var qs=require(_0x0300('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0300('0x11'));var logger=require(_0x0300('0x12'))(_0x0300('0x13'));var utils=require(_0x0300('0x14'));var config=require(_0x0300('0x15'));var licenseUtil=require(_0x0300('0x16'));var db=require(_0x0300('0x17'))['db'];config['redis']=_[_0x0300('0x18')](config[_0x0300('0x19')],{'host':_0x0300('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0300('0x19')]));require(_0x0300('0x1b'))['register'](socket);function respondWithStatusCode(_0x4999d9,_0x380728){_0x380728=_0x380728||0xcc;return function(_0x223723){if(_0x223723){return _0x4999d9['sendStatus'](_0x380728);}return _0x4999d9['status'](_0x380728)[_0x0300('0x1c')]();};}function respondWithResult(_0x4c3862,_0x14379b){_0x14379b=_0x14379b||0xc8;return function(_0x468d04){if(_0x468d04){return _0x4c3862[_0x0300('0x1d')](_0x14379b)['json'](_0x468d04);}};}function respondWithFilteredResult(_0x5cbf76,_0x298a8a){return function(_0x4a4ca7){if(_0x4a4ca7){var _0xa998ba=typeof _0x298a8a[_0x0300('0x1e')]==='undefined'&&typeof _0x298a8a['limit']===_0x0300('0x1f');var _0x4a8723=_0x4a4ca7[_0x0300('0x20')];var _0x39257d=_0xa998ba?0x0:_0x298a8a[_0x0300('0x1e')];var _0x17391a=_0xa998ba?_0x4a4ca7[_0x0300('0x20')]:_0x298a8a[_0x0300('0x1e')]+_0x298a8a[_0x0300('0x21')];var _0x4044e5;if(_0x17391a>=_0x4a8723){_0x17391a=_0x4a8723;_0x4044e5=0xc8;}else{_0x4044e5=0xce;}_0x5cbf76['status'](_0x4044e5);return _0x5cbf76['set'](_0x0300('0x22'),_0x39257d+'-'+_0x17391a+'/'+_0x4a8723)[_0x0300('0x23')](_0x4a4ca7);}return null;};}function patchUpdates(_0x589198){return function(_0x1a91dc){try{jsonpatch[_0x0300('0x24')](_0x1a91dc,_0x589198,!![]);}catch(_0x33c2ba){return BPromise[_0x0300('0x25')](_0x33c2ba);}return _0x1a91dc[_0x0300('0x26')]();};}function saveUpdates(_0xe3b908,_0x3155df){return function(_0x146b04){if(_0x146b04){return _0x146b04[_0x0300('0x27')](_0xe3b908)[_0x0300('0x28')](function(_0x127f36){return _0x127f36;});}return null;};}function removeEntity(_0xc8bd11,_0x179f6e){return function(_0x5cec60){if(_0x5cec60){return _0x5cec60['destroy']()[_0x0300('0x28')](function(){var _0x53a292=_0x5cec60['get']({'plain':!![]});var _0x4e78ae=_0x0300('0x29');return db[_0x0300('0x2a')][_0x0300('0x2b')]({'where':{'type':_0x4e78ae,'resourceId':_0x53a292['id']}})[_0x0300('0x28')](function(){return _0x5cec60;});})[_0x0300('0x28')](function(){_0xc8bd11['status'](0xcc)[_0x0300('0x1c')]();});}};}function handleEntityNotFound(_0x1affcb,_0x5a1c25){return function(_0x3a83c0){if(!_0x3a83c0){_0x1affcb[_0x0300('0x2c')](0x194);}return _0x3a83c0;};}function handleError(_0x4645cb,_0x38c2f1){_0x38c2f1=_0x38c2f1||0x1f4;return function(_0x5aa5c1){logger['error'](_0x5aa5c1[_0x0300('0x2d')]);if(_0x5aa5c1[_0x0300('0x2e')]){delete _0x5aa5c1[_0x0300('0x2e')];}_0x4645cb['status'](_0x38c2f1)['send'](_0x5aa5c1);};}exports[_0x0300('0x2f')]=function(_0x52f41a,_0x6f42f3){var _0x4ce274={},_0x214ae0={},_0x4c2d82={'count':0x0,'rows':[]};var _0x309c4e=_[_0x0300('0x30')](db[_0x0300('0x31')][_0x0300('0x32')],function(_0x1eccaf){return{'name':_0x1eccaf[_0x0300('0x33')],'type':_0x1eccaf[_0x0300('0x34')][_0x0300('0x35')]};});_0x214ae0[_0x0300('0x36')]=_['map'](_0x309c4e,_0x0300('0x2e'));_0x214ae0[_0x0300('0x37')]=_['keys'](_0x52f41a[_0x0300('0x37')]);_0x214ae0[_0x0300('0x38')]=_[_0x0300('0x39')](_0x214ae0['model'],_0x214ae0[_0x0300('0x37')]);_0x4ce274[_0x0300('0x3a')]=_['intersection'](_0x214ae0['model'],qs[_0x0300('0x3b')](_0x52f41a['query'][_0x0300('0x3b')]));_0x4ce274['attributes']=_0x4ce274[_0x0300('0x3a')][_0x0300('0x3c')]?_0x4ce274['attributes']:_0x214ae0[_0x0300('0x36')];if(!_0x52f41a[_0x0300('0x37')]['hasOwnProperty'](_0x0300('0x3d'))){_0x4ce274[_0x0300('0x21')]=qs[_0x0300('0x21')](_0x52f41a['query'][_0x0300('0x21')]);_0x4ce274['offset']=qs['offset'](_0x52f41a[_0x0300('0x37')][_0x0300('0x1e')]);}_0x4ce274[_0x0300('0x3e')]=qs[_0x0300('0x3f')](_0x52f41a[_0x0300('0x37')]['sort']);_0x4ce274[_0x0300('0x40')]=qs[_0x0300('0x38')](_[_0x0300('0x41')](_0x52f41a[_0x0300('0x37')],_0x214ae0[_0x0300('0x38')]),_0x309c4e);if(_0x52f41a[_0x0300('0x37')][_0x0300('0x42')]){_0x4ce274[_0x0300('0x40')]=_[_0x0300('0x43')](_0x4ce274[_0x0300('0x40')],{'$or':_[_0x0300('0x30')](_0x309c4e,function(_0xf9195d){if(_0xf9195d[_0x0300('0x34')]!==_0x0300('0x44')){var _0x5a2fe4={};_0x5a2fe4[_0xf9195d[_0x0300('0x2e')]]={'$like':'%'+_0x52f41a[_0x0300('0x37')][_0x0300('0x42')]+'%'};return _0x5a2fe4;}})});}_0x4ce274=_['merge']({},_0x4ce274,_0x52f41a['options']);var _0x28bf72={'where':_0x4ce274[_0x0300('0x40')]};return db[_0x0300('0x31')][_0x0300('0x20')](_0x28bf72)[_0x0300('0x28')](function(_0x894e3d){_0x4c2d82[_0x0300('0x20')]=_0x894e3d;if(_0x52f41a[_0x0300('0x37')][_0x0300('0x45')]){_0x4ce274[_0x0300('0x46')]=[{'all':!![]}];}return db['Dashboard'][_0x0300('0x47')](_0x4ce274);})[_0x0300('0x28')](function(_0x3471c4){_0x4c2d82[_0x0300('0x48')]=_0x3471c4;return _0x4c2d82;})[_0x0300('0x28')](respondWithFilteredResult(_0x6f42f3,_0x4ce274))['catch'](handleError(_0x6f42f3,null));};exports['show']=function(_0x231d13,_0x35e729){var _0x46a4e3={'raw':![],'where':{'id':_0x231d13['params']['id']}},_0x57dad6={};_0x57dad6[_0x0300('0x36')]=_[_0x0300('0x49')](db[_0x0300('0x31')][_0x0300('0x32')]);_0x57dad6[_0x0300('0x37')]=_[_0x0300('0x49')](_0x231d13[_0x0300('0x37')]);_0x57dad6['filters']=_[_0x0300('0x39')](_0x57dad6[_0x0300('0x36')],_0x57dad6[_0x0300('0x37')]);_0x46a4e3[_0x0300('0x3a')]=_[_0x0300('0x39')](_0x57dad6[_0x0300('0x36')],qs['fields'](_0x231d13['query'][_0x0300('0x3b')]));_0x46a4e3[_0x0300('0x3a')]=_0x46a4e3[_0x0300('0x3a')][_0x0300('0x3c')]?_0x46a4e3[_0x0300('0x3a')]:_0x57dad6[_0x0300('0x36')];if(_0x231d13[_0x0300('0x37')]['includeAll']){_0x46a4e3[_0x0300('0x46')]=[{'all':!![]}];}_0x46a4e3=_[_0x0300('0x43')]({},_0x46a4e3,_0x231d13[_0x0300('0x4a')]);return db['Dashboard'][_0x0300('0x4b')](_0x46a4e3)[_0x0300('0x28')](handleEntityNotFound(_0x35e729,null))[_0x0300('0x28')](respondWithResult(_0x35e729,null))['catch'](handleError(_0x35e729,null));};exports[_0x0300('0x4c')]=function(_0x592c8a,_0x5ab10b){return db[_0x0300('0x31')][_0x0300('0x4c')](_0x592c8a[_0x0300('0x4d')],{})[_0x0300('0x28')](function(_0x42704d){var _0x31bd29=_0x592c8a['user'][_0x0300('0x4e')]({'plain':!![]});if(!_0x31bd29)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x31bd29[_0x0300('0x4f')]===_0x0300('0x50')){var _0x730321=_0x42704d[_0x0300('0x4e')]({'plain':!![]});var _0x48fab7=_0x0300('0x29');return db[_0x0300('0x51')]['find']({'where':{'name':_0x48fab7,'userProfileId':_0x31bd29[_0x0300('0x52')]},'raw':!![]})[_0x0300('0x28')](function(_0x24e3c3){if(_0x24e3c3&&_0x24e3c3[_0x0300('0x53')]===0x0){return db[_0x0300('0x2a')][_0x0300('0x4c')]({'name':_0x730321['name'],'resourceId':_0x730321['id'],'type':_0x24e3c3['name'],'sectionId':_0x24e3c3['id']},{})[_0x0300('0x28')](function(){return _0x42704d;});}else{return _0x42704d;}})['catch'](function(_0x3cf6d5){logger[_0x0300('0x54')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3cf6d5);throw _0x3cf6d5;});}return _0x42704d;})[_0x0300('0x28')](respondWithResult(_0x5ab10b,0xc9))[_0x0300('0x55')](handleError(_0x5ab10b,null));};exports['clone']=function(_0x4b0868,_0x55f677){var _0x4d57b8={'where':{'id':_0x4b0868[_0x0300('0x56')]['id']}},_0x1a5a76={};_0x1a5a76[_0x0300('0x36')]=_[_0x0300('0x49')](db[_0x0300('0x31')][_0x0300('0x32')]);_0x4d57b8[_0x0300('0x3a')]=_[_0x0300('0x39')](_0x1a5a76[_0x0300('0x36')],qs[_0x0300('0x3b')](_0x4b0868[_0x0300('0x37')]['fields']));_0x4d57b8[_0x0300('0x3a')]=_0x4d57b8[_0x0300('0x3a')][_0x0300('0x3c')]?_0x4d57b8[_0x0300('0x3a')]:_0x1a5a76[_0x0300('0x36')];if(_0x4b0868['query'][_0x0300('0x45')]){_0x4d57b8[_0x0300('0x46')]=[{'all':!![]}];}_0x4d57b8=_['merge']({},_0x4d57b8,_0x4b0868[_0x0300('0x4a')]);return db[_0x0300('0x31')][_0x0300('0x4b')](_0x4d57b8)[_0x0300('0x28')](handleEntityNotFound(_0x55f677,null))[_0x0300('0x28')](function(_0x55a7f7){if(_0x55a7f7){var _0x391154=_0x55a7f7[_0x0300('0x4e')]({'plain':!![]});_0x391154=qs['omit'](_0x391154,['id',_0x0300('0x57'),_0x0300('0x58')]);_0x4b0868[_0x0300('0x4d')]=_[_0x0300('0x59')](_0x4b0868['body'],['id',_0x0300('0x57'),_0x0300('0x58')]);return db['Dashboard'][_0x0300('0x4c')](_[_0x0300('0x43')](_0x391154,_0x4b0868['body']),{'include':_0x4b0868[_0x0300('0x37')][_0x0300('0x45')]?[{'all':!![]}]:undefined})['then'](function(_0xf173b0){var _0x5782df=_0x4b0868[_0x0300('0x50')][_0x0300('0x4e')]({'plain':!![]});if(!_0x5782df)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5782df[_0x0300('0x4f')]===_0x0300('0x50')){var _0x184160=_0xf173b0[_0x0300('0x4e')]({'plain':!![]});var _0x17a8bb=_0x0300('0x29');return db[_0x0300('0x51')]['find']({'where':{'name':_0x17a8bb,'userProfileId':_0x5782df[_0x0300('0x52')]},'raw':!![]})[_0x0300('0x28')](function(_0x2f919c){if(_0x2f919c&&_0x2f919c[_0x0300('0x53')]===0x0){return db[_0x0300('0x2a')][_0x0300('0x4c')]({'name':_0x184160['name'],'resourceId':_0x184160['id'],'type':_0x2f919c[_0x0300('0x2e')],'sectionId':_0x2f919c['id']},{})[_0x0300('0x28')](function(){return _0xf173b0;});}else{return _0xf173b0;}})[_0x0300('0x55')](function(_0x347d4a){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x347d4a);throw _0x347d4a;});}return _0xf173b0;});}})[_0x0300('0x28')](respondWithResult(_0x55f677,0xc9))['catch'](handleError(_0x55f677,null));};exports[_0x0300('0x27')]=function(_0x29fab4,_0x6b4e85){if(_0x29fab4[_0x0300('0x4d')]['id']){delete _0x29fab4[_0x0300('0x4d')]['id'];}return db[_0x0300('0x31')][_0x0300('0x4b')]({'where':{'id':_0x29fab4[_0x0300('0x56')]['id']}})[_0x0300('0x28')](handleEntityNotFound(_0x6b4e85,null))['then'](saveUpdates(_0x29fab4['body'],null))[_0x0300('0x28')](respondWithResult(_0x6b4e85,null))[_0x0300('0x55')](handleError(_0x6b4e85,null));};exports[_0x0300('0x2b')]=function(_0x422cba,_0x189291){return db[_0x0300('0x31')]['find']({'where':{'id':_0x422cba[_0x0300('0x56')]['id']}})[_0x0300('0x28')](handleEntityNotFound(_0x189291,null))[_0x0300('0x28')](removeEntity(_0x189291,null))[_0x0300('0x55')](handleError(_0x189291,null));};function widgetAttributes(_0x1a3efe){try{switch(_0x1a3efe['type']){case'iframe':return[{'name':_0x0300('0x5a'),'value':_0x1a3efe[_0x0300('0x5a')]||(_0x1a3efe[_0x0300('0x5b')]&&_0x1a3efe['attrs'][0x0]?_0x1a3efe[_0x0300('0x5b')][0x0][_0x0300('0x5c')]:undefined)||_0x0300('0x5d')}];case _0x0300('0x5e'):return[{'name':_0x0300('0x5f'),'value':_0x1a3efe[_0x0300('0x5f')]||(_0x1a3efe['attrs']&&_0x1a3efe[_0x0300('0x5b')][0x0]?_0x1a3efe[_0x0300('0x5b')][0x0][_0x0300('0x5c')]:undefined)||''}];case _0x0300('0x60'):return[{'name':_0x0300('0x61'),'value':_0x1a3efe[_0x0300('0x61')]||(_0x1a3efe[_0x0300('0x5b')]&&_0x1a3efe[_0x0300('0x5b')][0x0]?_0x1a3efe[_0x0300('0x5b')][0x0][_0x0300('0x5c')]:undefined)||'HH:mm:ss'},{'name':_0x0300('0x62'),'value':_0x1a3efe['attrTimezone']||(_0x1a3efe['attrs']&&_0x1a3efe[_0x0300('0x5b')][0x1]?_0x1a3efe['attrs'][0x1][_0x0300('0x5c')]:undefined)||_0x0300('0x63')},{'name':'attrFontSize','value':_0x1a3efe[_0x0300('0x64')]||(_0x1a3efe[_0x0300('0x5b')]&&_0x1a3efe[_0x0300('0x5b')][0x2]?_0x1a3efe[_0x0300('0x5b')][0x2]['value']:undefined)||0xc}];case _0x0300('0x65'):return[{'name':_0x0300('0x66'),'value':_0x1a3efe[_0x0300('0x66')]||(_0x1a3efe[_0x0300('0x5b')]&&_0x1a3efe[_0x0300('0x5b')][0x0]?_0x1a3efe[_0x0300('0x5b')][0x0]['value']:undefined)||_0x0300('0x67')},{'name':_0x0300('0x68'),'value':_0x1a3efe[_0x0300('0x68')]||(_0x1a3efe[_0x0300('0x5b')]&&_0x1a3efe[_0x0300('0x5b')][0x1]?_0x1a3efe[_0x0300('0x5b')][0x1][_0x0300('0x5c')]:undefined)||[]},{'name':_0x0300('0x64'),'value':_0x1a3efe[_0x0300('0x64')]||(_0x1a3efe[_0x0300('0x5b')]&&_0x1a3efe[_0x0300('0x5b')][0x2]?_0x1a3efe[_0x0300('0x5b')][0x2][_0x0300('0x5c')]:undefined)||0x14},{'name':_0x0300('0x69'),'value':_0x1a3efe[_0x0300('0x69')]||(_0x1a3efe[_0x0300('0x5b')]&&_0x1a3efe[_0x0300('0x5b')][0x3]?_0x1a3efe[_0x0300('0x5b')][0x3][_0x0300('0x5c')]:undefined)||_0x0300('0x6a')},{'name':'attrEmailAccounts','value':_0x1a3efe['attrEmailAccounts']||(_0x1a3efe[_0x0300('0x5b')]&&_0x1a3efe[_0x0300('0x5b')][0x4]?_0x1a3efe[_0x0300('0x5b')][0x4][_0x0300('0x5c')]:undefined)||''},{'name':_0x0300('0x6b'),'value':_0x1a3efe[_0x0300('0x6b')]||(_0x1a3efe['attrs']&&_0x1a3efe[_0x0300('0x5b')][0x5]?_0x1a3efe['attrs'][0x5][_0x0300('0x5c')]:undefined)||''},{'name':_0x0300('0x6c'),'value':_0x1a3efe['attrSmsAccounts']||(_0x1a3efe['attrs']&&_0x1a3efe[_0x0300('0x5b')][0x6]?_0x1a3efe[_0x0300('0x5b')][0x6]['value']:undefined)||''},{'name':_0x0300('0x6d'),'value':_0x1a3efe['attrOpenchannelAccounts']||(_0x1a3efe[_0x0300('0x5b')]&&_0x1a3efe[_0x0300('0x5b')][0x7]?_0x1a3efe['attrs'][0x7][_0x0300('0x5c')]:undefined)||''},{'name':_0x0300('0x6e'),'value':_0x1a3efe[_0x0300('0x6e')]||(_0x1a3efe[_0x0300('0x5b')]&&_0x1a3efe[_0x0300('0x5b')][0x8]?_0x1a3efe[_0x0300('0x5b')][0x8][_0x0300('0x5c')]:undefined)||''},{'name':'attrChatWebsites','value':_0x1a3efe[_0x0300('0x6f')]||(_0x1a3efe['attrs']&&_0x1a3efe[_0x0300('0x5b')][0x9]?_0x1a3efe['attrs'][0x9][_0x0300('0x5c')]:undefined)||''}];case _0x0300('0x70'):case _0x0300('0x71'):return[{'name':_0x0300('0x72'),'value':_0x1a3efe[_0x0300('0x72')]||(_0x1a3efe[_0x0300('0x5b')]&&_0x1a3efe[_0x0300('0x5b')][0x0]?_0x1a3efe['attrs'][0x0][_0x0300('0x5c')]:undefined)||_0x0300('0x67')},{'name':_0x0300('0x73'),'value':_0x1a3efe[_0x0300('0x73')]||(_0x1a3efe['attrs']&&_0x1a3efe[_0x0300('0x5b')][0x1]?_0x1a3efe[_0x0300('0x5b')][0x1][_0x0300('0x5c')]:undefined)||null},{'name':_0x0300('0x74'),'value':_0x1a3efe['attrSerie3']||(_0x1a3efe[_0x0300('0x5b')]&&_0x1a3efe['attrs'][0x2]?_0x1a3efe[_0x0300('0x5b')][0x2][_0x0300('0x5c')]:undefined)||null},{'name':_0x0300('0x68'),'value':_0x1a3efe[_0x0300('0x68')]||(_0x1a3efe[_0x0300('0x5b')]&&_0x1a3efe['attrs'][0x3]?_0x1a3efe[_0x0300('0x5b')][0x3][_0x0300('0x5c')]:undefined)||[]},{'name':'attrChannel','value':_0x1a3efe['attrChannel']||(_0x1a3efe[_0x0300('0x5b')]&&_0x1a3efe[_0x0300('0x5b')][0x4]?_0x1a3efe[_0x0300('0x5b')][0x4][_0x0300('0x5c')]:undefined)||_0x0300('0x6a')},{'name':_0x0300('0x75'),'value':_0x1a3efe[_0x0300('0x75')]||(_0x1a3efe[_0x0300('0x5b')]&&_0x1a3efe[_0x0300('0x5b')][0x5]?_0x1a3efe[_0x0300('0x5b')][0x5][_0x0300('0x5c')]:undefined)||''},{'name':_0x0300('0x6b'),'value':_0x1a3efe[_0x0300('0x6b')]||(_0x1a3efe[_0x0300('0x5b')]&&_0x1a3efe[_0x0300('0x5b')][0x6]?_0x1a3efe[_0x0300('0x5b')][0x6]['value']:undefined)||''},{'name':'attrSmsAccounts','value':_0x1a3efe['attrSmsAccounts']||(_0x1a3efe[_0x0300('0x5b')]&&_0x1a3efe['attrs'][0x7]?_0x1a3efe[_0x0300('0x5b')][0x7][_0x0300('0x5c')]:undefined)||''},{'name':_0x0300('0x6d'),'value':_0x1a3efe[_0x0300('0x6d')]||(_0x1a3efe[_0x0300('0x5b')]&&_0x1a3efe['attrs'][0x8]?_0x1a3efe['attrs'][0x8][_0x0300('0x5c')]:undefined)||''},{'name':_0x0300('0x6e'),'value':_0x1a3efe['attrWhatsappAccounts']||(_0x1a3efe[_0x0300('0x5b')]&&_0x1a3efe[_0x0300('0x5b')][0x9]?_0x1a3efe['attrs'][0x9]['value']:undefined)||''},{'name':_0x0300('0x6f'),'value':_0x1a3efe[_0x0300('0x6f')]||(_0x1a3efe[_0x0300('0x5b')]&&_0x1a3efe[_0x0300('0x5b')][0xa]?_0x1a3efe[_0x0300('0x5b')][0xa][_0x0300('0x5c')]:undefined)||''}];case _0x0300('0x76'):return[{'name':'attrReport','type':_0x1a3efe[_0x0300('0x77')]||(_0x1a3efe[_0x0300('0x5b')]&&_0x1a3efe[_0x0300('0x5b')][0x0]?_0x1a3efe['attrs'][0x0][_0x0300('0x34')]:undefined)||null,'value':_0x1a3efe[_0x0300('0x78')]||(_0x1a3efe['attrs']&&_0x1a3efe[_0x0300('0x5b')][0x0]?_0x1a3efe[_0x0300('0x5b')][0x0][_0x0300('0x5c')]:undefined)||null},{'name':_0x0300('0x79'),'value':_0x1a3efe[_0x0300('0x79')]||(_0x1a3efe['attrs']&&_0x1a3efe[_0x0300('0x5b')][0x1]?_0x1a3efe[_0x0300('0x5b')][0x1][_0x0300('0x5c')]:undefined)||0x0}];default:return[];}}catch(_0x51d883){logger[_0x0300('0x54')](_0x0300('0x7a'),JSON['stringify'](_0x51d883));return[];}}exports[_0x0300('0x7b')]=function(_0x87c405,_0x5a8884,_0x34fbed){if(_0x87c405['body']['id']){delete _0x87c405[_0x0300('0x4d')]['id'];}return db['Dashboard'][_0x0300('0x4b')]({'where':{'id':_0x87c405['params']['id']}})['then'](handleEntityNotFound(_0x5a8884,null))[_0x0300('0x28')](function(_0x1872b5){if(_0x1872b5){_0x87c405[_0x0300('0x4d')]['DashboardId']=_0x1872b5['id'];_0x87c405[_0x0300('0x4d')][_0x0300('0x5b')]=widgetAttributes(_0x87c405[_0x0300('0x4d')]);return db[_0x0300('0x7c')][_0x0300('0x4c')](_0x87c405[_0x0300('0x4d')]);}})[_0x0300('0x28')](respondWithResult(_0x5a8884,null))[_0x0300('0x55')](handleError(_0x5a8884,null));};exports[_0x0300('0x7d')]=function(_0x25c443,_0x4bcffa,_0x5e2f2b){var _0x526cb9={};var _0x1a25ac={};var _0x400df6;var _0x1e3096;return db[_0x0300('0x31')][_0x0300('0x7e')]({'where':{'id':_0x25c443[_0x0300('0x56')]['id']}})[_0x0300('0x28')](handleEntityNotFound(_0x4bcffa,null))[_0x0300('0x28')](function(_0x4a0911){if(_0x4a0911){_0x400df6=_0x4a0911;_0x1a25ac[_0x0300('0x36')]=_[_0x0300('0x49')](db['DashboardItem'][_0x0300('0x32')]);_0x1a25ac[_0x0300('0x37')]=_[_0x0300('0x49')](_0x25c443['query']);_0x1a25ac[_0x0300('0x38')]=_['intersection'](_0x1a25ac[_0x0300('0x36')],_0x1a25ac[_0x0300('0x37')]);_0x526cb9[_0x0300('0x3a')]=_[_0x0300('0x39')](_0x1a25ac[_0x0300('0x36')],qs[_0x0300('0x3b')](_0x25c443[_0x0300('0x37')][_0x0300('0x3b')]));_0x526cb9['attributes']=_0x526cb9[_0x0300('0x3a')][_0x0300('0x3c')]?_0x526cb9[_0x0300('0x3a')]:_0x1a25ac[_0x0300('0x36')];_0x526cb9['order']=qs[_0x0300('0x3f')](_0x25c443[_0x0300('0x37')][_0x0300('0x3f')]);_0x526cb9[_0x0300('0x40')]=qs[_0x0300('0x38')](_[_0x0300('0x41')](_0x25c443[_0x0300('0x37')],_0x1a25ac[_0x0300('0x38')]));if(_0x25c443[_0x0300('0x37')][_0x0300('0x42')]){_0x526cb9[_0x0300('0x40')]=_[_0x0300('0x43')](_0x526cb9['where'],{'$or':_[_0x0300('0x30')](_0x526cb9['attributes'],function(_0x3adb80){var _0x58e39a={};_0x58e39a[_0x3adb80]={'$like':'%'+_0x25c443[_0x0300('0x37')]['filter']+'%'};return _0x58e39a;})});}_0x526cb9=_[_0x0300('0x43')]({},_0x526cb9,_0x25c443[_0x0300('0x4a')]);return _0x400df6['getItems'](_0x526cb9);}})[_0x0300('0x28')](function(_0x1f688e){if(_0x1f688e){_0x1e3096=_0x1f688e['length'];if(!_0x25c443[_0x0300('0x37')]['hasOwnProperty'](_0x0300('0x3d'))){_0x526cb9[_0x0300('0x21')]=qs[_0x0300('0x21')](_0x25c443[_0x0300('0x37')][_0x0300('0x21')]);_0x526cb9[_0x0300('0x1e')]=qs[_0x0300('0x1e')](_0x25c443[_0x0300('0x37')][_0x0300('0x1e')]);}return _0x400df6['getItems'](_0x526cb9);}})['then'](function(_0x458c7a){if(_0x458c7a){return _0x458c7a?{'count':_0x1e3096,'rows':_0x458c7a}:null;}})['then'](respondWithResult(_0x4bcffa,null))['catch'](handleError(_0x4bcffa,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index ae2567f..6afac38 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 _0x7953=['hook','exports','events','../../mysqldb','Dashboard','save','remove','emit','hasOwnProperty'];(function(_0x119175,_0xbf50a8){var _0x514223=function(_0xf05c03){while(--_0xf05c03){_0x119175['push'](_0x119175['shift']());}};_0x514223(++_0xbf50a8);}(_0x7953,0x1c4));var _0x3795=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0x7953[_0x36c5b0];return _0xf19333;};'use strict';var EventEmitter=require(_0x3795('0x0'));var Dashboard=require(_0x3795('0x1'))['db'][_0x3795('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3795('0x3'),'afterUpdate':'update','afterDestroy':_0x3795('0x4')};function emitEvent(_0x5ea6c1){return function(_0x20ab50,_0x134fb7,_0x21bb6e){DashboardEvents['emit'](_0x5ea6c1+':'+_0x20ab50['id'],_0x20ab50);DashboardEvents[_0x3795('0x5')](_0x5ea6c1,_0x20ab50);_0x21bb6e(null);};}for(var e in events){if(events[_0x3795('0x6')](e)){var event=events[e];Dashboard[_0x3795('0x7')](e,emitEvent(event));}}module[_0x3795('0x8')]=DashboardEvents; \ No newline at end of file +var _0x7cc4=['save','update','remove','hasOwnProperty','hook','setMaxListeners'];(function(_0x158f93,_0x85a1eb){var _0x3f0186=function(_0x14d4ad){while(--_0x14d4ad){_0x158f93['push'](_0x158f93['shift']());}};_0x3f0186(++_0x85a1eb);}(_0x7cc4,0x155));var _0x47cc=function(_0x98db33,_0x397f20){_0x98db33=_0x98db33-0x0;var _0x5ae63a=_0x7cc4[_0x98db33];return _0x5ae63a;};'use strict';var EventEmitter=require('events');var Dashboard=require('../../mysqldb')['db']['Dashboard'];var DashboardEvents=new EventEmitter();DashboardEvents[_0x47cc('0x0')](0x0);var events={'afterCreate':_0x47cc('0x1'),'afterUpdate':_0x47cc('0x2'),'afterDestroy':_0x47cc('0x3')};function emitEvent(_0x353486){return function(_0x202709,_0x17f328,_0x5e1e2e){DashboardEvents['emit'](_0x353486+':'+_0x202709['id'],_0x202709);DashboardEvents['emit'](_0x353486,_0x202709);_0x5e1e2e(null);};}for(var e in events){if(events[_0x47cc('0x4')](e)){var event=events[e];Dashboard[_0x47cc('0x5')](e,emitEvent(event));}}module['exports']=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index 951b6c1..610f331 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 _0xd21f=['util','../../config/logger','moment','bluebird','path','../../config/environment','exports','define','Dashboard','dashboards','lodash'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xd21f,0x175));var _0xfd21=function(_0x52c4e9,_0x5412d0){_0x52c4e9=_0x52c4e9-0x0;var _0x252a03=_0xd21f[_0x52c4e9];return _0x252a03;};'use strict';var _=require(_0xfd21('0x0'));var util=require(_0xfd21('0x1'));var logger=require(_0xfd21('0x2'))('api');var moment=require(_0xfd21('0x3'));var BPromise=require(_0xfd21('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfd21('0x5'));var rimraf=require('rimraf');var config=require(_0xfd21('0x6'));var attributes=require('./dashboard.attributes');module[_0xfd21('0x7')]=function(_0x3ecd51,_0x45cec4){return _0x3ecd51[_0xfd21('0x8')](_0xfd21('0x9'),attributes,{'tableName':_0xfd21('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xae4e=['rimraf','../../config/environment','./dashboard.attributes','exports','define','Dashboard','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x5208fa,_0x2e0115){var _0x340255=function(_0x243db1){while(--_0x243db1){_0x5208fa['push'](_0x5208fa['shift']());}};_0x340255(++_0x2e0115);}(_0xae4e,0x14b));var _0xeae4=function(_0x16b7d7,_0x8fc0f8){_0x16b7d7=_0x16b7d7-0x0;var _0x5e8328=_0xae4e[_0x16b7d7];return _0x5e8328;};'use strict';var _=require(_0xeae4('0x0'));var util=require(_0xeae4('0x1'));var logger=require(_0xeae4('0x2'))(_0xeae4('0x3'));var moment=require(_0xeae4('0x4'));var BPromise=require(_0xeae4('0x5'));var rp=require(_0xeae4('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xeae4('0x7'));var config=require(_0xeae4('0x8'));var attributes=require(_0xeae4('0x9'));module[_0xeae4('0xa')]=function(_0x48127b,_0x3359c7){return _0x48127b[_0xeae4('0xb')](_0xeae4('0xc'),attributes,{'tableName':'dashboards','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.rpc.js b/server/api/dashboard/dashboard.rpc.js index d469e29..302e4bf 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 _0xf9fb=['moment','bluebird','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','redis','defaults','socket.io-emitter','./dashboard.socket','register','request','info','Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','code','error','message','lodash','util'];(function(_0x5c1727,_0x4acc94){var _0x88b8f9=function(_0x237dc7){while(--_0x237dc7){_0x5c1727['push'](_0x5c1727['shift']());}};_0x88b8f9(++_0x4acc94);}(_0xf9fb,0xad));var _0xbf9f=function(_0x56556d,_0x5d32ba){_0x56556d=_0x56556d-0x0;var _0x5404f3=_0xf9fb[_0x56556d];return _0x5404f3;};'use strict';var _=require(_0xbf9f('0x0'));var util=require(_0xbf9f('0x1'));var moment=require(_0xbf9f('0x2'));var BPromise=require(_0xbf9f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbf9f('0x4'))['db'];var utils=require(_0xbf9f('0x5'));var logger=require('../../config/logger')(_0xbf9f('0x6'));var config=require('../../config/environment');var jayson=require(_0xbf9f('0x7'));var client=jayson[_0xbf9f('0x8')][_0xbf9f('0x9')]({'port':0x232a});config[_0xbf9f('0xa')]=_[_0xbf9f('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xbf9f('0xc'))(new Redis(config[_0xbf9f('0xa')]));require(_0xbf9f('0xd'))[_0xbf9f('0xe')](socket);function respondWithRpcPromise(_0x2259fc,_0x8770b7,_0x3057a5){return new BPromise(function(_0x2c75b1,_0x513511){return client[_0xbf9f('0xf')](_0x2259fc,_0x3057a5)['then'](function(_0x28aee3){logger[_0xbf9f('0x10')](_0xbf9f('0x11'),_0x8770b7,_0xbf9f('0x12'));logger[_0xbf9f('0x13')](_0xbf9f('0x14'),_0x8770b7,_0xbf9f('0x12'),JSON[_0xbf9f('0x15')](_0x28aee3));if(_0x28aee3['error']){if(_0x28aee3['error'][_0xbf9f('0x16')]===0x1f4){logger[_0xbf9f('0x17')](_0xbf9f('0x11'),_0x8770b7,_0x28aee3[_0xbf9f('0x17')][_0xbf9f('0x18')]);return _0x513511(_0x28aee3[_0xbf9f('0x17')]['message']);}logger[_0xbf9f('0x17')](_0xbf9f('0x11'),_0x8770b7,_0x28aee3['error'][_0xbf9f('0x18')]);return _0x2c75b1(_0x28aee3[_0xbf9f('0x17')][_0xbf9f('0x18')]);}else{logger[_0xbf9f('0x10')](_0xbf9f('0x11'),_0x8770b7,_0xbf9f('0x12'));_0x2c75b1(_0x28aee3['result'][_0xbf9f('0x18')]);}})['catch'](function(_0xc32af1){logger['error'](_0xbf9f('0x11'),_0x8770b7,_0xc32af1);_0x513511(_0xc32af1);});});} \ No newline at end of file +var _0x6212=['defaults','redis','localhost','socket.io-emitter','./dashboard.socket','request','then','info','Dashboard,\x20%s,\x20%s','Dashboard,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','http'];(function(_0x1e4360,_0x930b9b){var _0x31e6b4=function(_0x49dd8e){while(--_0x49dd8e){_0x1e4360['push'](_0x1e4360['shift']());}};_0x31e6b4(++_0x930b9b);}(_0x6212,0xad));var _0x2621=function(_0x1ce62c,_0x46b942){_0x1ce62c=_0x1ce62c-0x0;var _0x3c6476=_0x6212[_0x1ce62c];return _0x3c6476;};'use strict';var _=require(_0x2621('0x0'));var util=require(_0x2621('0x1'));var moment=require('moment');var BPromise=require(_0x2621('0x2'));var rs=require(_0x2621('0x3'));var fs=require('fs');var Redis=require(_0x2621('0x4'));var db=require(_0x2621('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2621('0x6'));var config=require('../../config/environment');var jayson=require(_0x2621('0x7'));var client=jayson['client'][_0x2621('0x8')]({'port':0x232a});config['redis']=_[_0x2621('0x9')](config[_0x2621('0xa')],{'host':_0x2621('0xb'),'port':0x18eb});var socket=require(_0x2621('0xc'))(new Redis(config[_0x2621('0xa')]));require(_0x2621('0xd'))['register'](socket);function respondWithRpcPromise(_0x5a6f31,_0x53c427,_0x4ac890){return new BPromise(function(_0x23c319,_0x5da51f){return client[_0x2621('0xe')](_0x5a6f31,_0x4ac890)[_0x2621('0xf')](function(_0x15b843){logger[_0x2621('0x10')](_0x2621('0x11'),_0x53c427,'request\x20sent');logger['debug'](_0x2621('0x12'),_0x53c427,_0x2621('0x13'),JSON[_0x2621('0x14')](_0x15b843));if(_0x15b843[_0x2621('0x15')]){if(_0x15b843[_0x2621('0x15')][_0x2621('0x16')]===0x1f4){logger[_0x2621('0x15')](_0x2621('0x11'),_0x53c427,_0x15b843[_0x2621('0x15')][_0x2621('0x17')]);return _0x5da51f(_0x15b843[_0x2621('0x15')]['message']);}logger[_0x2621('0x15')](_0x2621('0x11'),_0x53c427,_0x15b843[_0x2621('0x15')][_0x2621('0x17')]);return _0x23c319(_0x15b843[_0x2621('0x15')][_0x2621('0x17')]);}else{logger['info'](_0x2621('0x11'),_0x53c427,_0x2621('0x13'));_0x23c319(_0x15b843[_0x2621('0x18')][_0x2621('0x17')]);}})[_0x2621('0x19')](function(_0x1b4626){logger['error'](_0x2621('0x11'),_0x53c427,_0x1b4626);_0x5da51f(_0x1b4626);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index 5fdcd33..4331365 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 _0xb9f4=['remove','update','emit','removeListener','register','length','./dashboard.events','save'];(function(_0x4c2b0c,_0x2058bf){var _0x452b30=function(_0x46ed52){while(--_0x46ed52){_0x4c2b0c['push'](_0x4c2b0c['shift']());}};_0x452b30(++_0x2058bf);}(_0xb9f4,0xce));var _0x4b9f=function(_0x2f3e93,_0xe3e023){_0x2f3e93=_0x2f3e93-0x0;var _0x4c7cc9=_0xb9f4[_0x2f3e93];return _0x4c7cc9;};'use strict';var DashboardEvents=require(_0x4b9f('0x0'));var events=[_0x4b9f('0x1'),_0x4b9f('0x2'),_0x4b9f('0x3')];function createListener(_0x529607,_0x43bf9d){return function(_0x176ceb){_0x43bf9d[_0x4b9f('0x4')](_0x529607,_0x176ceb);};}function removeListener(_0x557ce7,_0x3dc0cb){return function(){DashboardEvents[_0x4b9f('0x5')](_0x557ce7,_0x3dc0cb);};}exports[_0x4b9f('0x6')]=function(_0x54db04){for(var _0x3f7a51=0x0,_0x2b1acc=events[_0x4b9f('0x7')];_0x3f7a51<_0x2b1acc;_0x3f7a51++){var _0x5070b4=events[_0x3f7a51];var _0x1e5179=createListener('dashboard:'+_0x5070b4,_0x54db04);DashboardEvents['on'](_0x5070b4,_0x1e5179);}}; \ No newline at end of file +var _0xdca9=['dashboard:','./dashboard.events','remove','update','emit','register','length'];(function(_0x41a0c7,_0x3e657b){var _0x325531=function(_0x4e2060){while(--_0x4e2060){_0x41a0c7['push'](_0x41a0c7['shift']());}};_0x325531(++_0x3e657b);}(_0xdca9,0x189));var _0x9dca=function(_0x4bb762,_0x17a0ee){_0x4bb762=_0x4bb762-0x0;var _0x4ef7e5=_0xdca9[_0x4bb762];return _0x4ef7e5;};'use strict';var DashboardEvents=require(_0x9dca('0x0'));var events=['save',_0x9dca('0x1'),_0x9dca('0x2')];function createListener(_0x2ede43,_0x495ca2){return function(_0x239f4c){_0x495ca2[_0x9dca('0x3')](_0x2ede43,_0x239f4c);};}function removeListener(_0x16e070,_0x4c0111){return function(){DashboardEvents['removeListener'](_0x16e070,_0x4c0111);};}exports[_0x9dca('0x4')]=function(_0x392a12){for(var _0x445897=0x0,_0x5a267f=events[_0x9dca('0x5')];_0x445897<_0x5a267f;_0x445897++){var _0x108ef5=events[_0x445897];var _0x4cb07a=createListener(_0x9dca('0x6')+_0x108ef5,_0x392a12);DashboardEvents['on'](_0x108ef5,_0x4cb07a);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index 975c58f..4b08e3c 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 _0x0c90=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','/:id/items','getItems','post','/:id/clone','addItem','put','/:id','delete','destroy','multer','connect-timeout','express','Router','fs-extra'];(function(_0x154584,_0x421e12){var _0x969074=function(_0x17303b){while(--_0x17303b){_0x154584['push'](_0x154584['shift']());}};_0x969074(++_0x421e12);}(_0x0c90,0x19f));var _0x00c9=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x0c90[_0x178e48];return _0x440d7e;};'use strict';var multer=require(_0x00c9('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x00c9('0x1'));var express=require(_0x00c9('0x2'));var router=express[_0x00c9('0x3')]();var fs_extra=require(_0x00c9('0x4'));var auth=require(_0x00c9('0x5'));var interaction=require(_0x00c9('0x6'));var config=require(_0x00c9('0x7'));var controller=require('./dashboard.controller');router[_0x00c9('0x8')]('/',auth[_0x00c9('0x9')](),controller[_0x00c9('0xa')]);router[_0x00c9('0x8')]('/:id',auth[_0x00c9('0x9')](),controller[_0x00c9('0xb')]);router[_0x00c9('0x8')](_0x00c9('0xc'),auth['isAuthenticated'](),controller[_0x00c9('0xd')]);router[_0x00c9('0xe')]('/',auth[_0x00c9('0x9')](),controller['create']);router[_0x00c9('0xe')](_0x00c9('0xf'),auth[_0x00c9('0x9')](),controller['clone']);router[_0x00c9('0xe')](_0x00c9('0xc'),auth[_0x00c9('0x9')](),controller[_0x00c9('0x10')]);router[_0x00c9('0x11')](_0x00c9('0x12'),auth[_0x00c9('0x9')](),controller['update']);router[_0x00c9('0x13')](_0x00c9('0x12'),auth['isAuthenticated'](),controller[_0x00c9('0x14')]);module['exports']=router; \ No newline at end of file +var _0x9b61=['post','/:id/clone','/:id/items','addItem','update','delete','destroy','exports','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','get','isAuthenticated','/:id'];(function(_0x4c8646,_0x23ee27){var _0x3b86aa=function(_0x20d2a7){while(--_0x20d2a7){_0x4c8646['push'](_0x4c8646['shift']());}};_0x3b86aa(++_0x23ee27);}(_0x9b61,0x128));var _0x19b6=function(_0x37bad0,_0x1950b9){_0x37bad0=_0x37bad0-0x0;var _0x1154e2=_0x9b61[_0x37bad0];return _0x1154e2;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x19b6('0x0'));var express=require('express');var router=express[_0x19b6('0x1')]();var fs_extra=require(_0x19b6('0x2'));var auth=require(_0x19b6('0x3'));var interaction=require(_0x19b6('0x4'));var config=require(_0x19b6('0x5'));var controller=require(_0x19b6('0x6'));router[_0x19b6('0x7')]('/',auth[_0x19b6('0x8')](),controller['index']);router[_0x19b6('0x7')](_0x19b6('0x9'),auth[_0x19b6('0x8')](),controller['show']);router[_0x19b6('0x7')]('/:id/items',auth[_0x19b6('0x8')](),controller['getItems']);router[_0x19b6('0xa')]('/',auth[_0x19b6('0x8')](),controller['create']);router['post'](_0x19b6('0xb'),auth[_0x19b6('0x8')](),controller['clone']);router[_0x19b6('0xa')](_0x19b6('0xc'),auth['isAuthenticated'](),controller[_0x19b6('0xd')]);router['put']('/:id',auth[_0x19b6('0x8')](),controller[_0x19b6('0xe')]);router[_0x19b6('0xf')](_0x19b6('0x9'),auth[_0x19b6('0x8')](),controller[_0x19b6('0x10')]);module[_0x19b6('0x11')]=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index a302f5b..26b8124 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 _0x9536=['squel','lodash','exports','STRING','long','parse','getDataValue','attrs','setDataValue','stringify','INTEGER','#ffffff','#2196f3','sequelize'];(function(_0x1ede50,_0x1bbda6){var _0x5979cc=function(_0x112d62){while(--_0x112d62){_0x1ede50['push'](_0x1ede50['shift']());}};_0x5979cc(++_0x1bbda6);}(_0x9536,0x179));var _0x6953=function(_0x5cb97e,_0x132a39){_0x5cb97e=_0x5cb97e-0x0;var _0x1714b4=_0x9536[_0x5cb97e];return _0x1714b4;};'use strict';var Sequelize=require(_0x6953('0x0'));var squel=require(_0x6953('0x1'));var _=require(_0x6953('0x2'));module[_0x6953('0x3')]={'title':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x6953('0x4')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize['TEXT'](_0x6953('0x5')),'get':function(){try{return JSON[_0x6953('0x6')](this[_0x6953('0x7')](_0x6953('0x8')));}catch(_0x2f3cc3){return[];}},'set':function(_0x494ac2){try{this[_0x6953('0x9')](_0x6953('0x8'),JSON[_0x6953('0xa')](_0x494ac2));}catch(_0x3e1aff){this[_0x6953('0x9')]('attrs',JSON[_0x6953('0xa')]([]));}}},'sizeX':{'type':Sequelize[_0x6953('0xb')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x6953('0xb')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize['INTEGER']},'col':{'type':Sequelize[_0x6953('0xb')]},'background':{'type':Sequelize[_0x6953('0x4')],'allowNull':![],'defaultValue':_0x6953('0xc'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x6953('0x4')],'allowNull':![],'defaultValue':_0x6953('0xd'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x6953('0x4')]},'titleFontSize':{'type':Sequelize[_0x6953('0xb')],'defaultValue':0xc}}; \ No newline at end of file +var _0x187d=['stringify','INTEGER','#ffffff','sequelize','lodash','exports','STRING','TEXT','long','getDataValue','attrs','setDataValue'];(function(_0x52ba20,_0x1fd488){var _0x2e82c3=function(_0x52057b){while(--_0x52057b){_0x52ba20['push'](_0x52ba20['shift']());}};_0x2e82c3(++_0x1fd488);}(_0x187d,0x93));var _0xd187=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0x187d[_0x4baae2];return _0x1a2285;};'use strict';var Sequelize=require(_0xd187('0x0'));var squel=require('squel');var _=require(_0xd187('0x1'));module[_0xd187('0x2')]={'title':{'type':Sequelize[_0xd187('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xd187('0x3')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0xd187('0x4')](_0xd187('0x5')),'get':function(){try{return JSON['parse'](this[_0xd187('0x6')](_0xd187('0x7')));}catch(_0x4ebc8d){return[];}},'set':function(_0x1d2533){try{this[_0xd187('0x8')](_0xd187('0x7'),JSON[_0xd187('0x9')](_0x1d2533));}catch(_0x28ce2f){this[_0xd187('0x8')](_0xd187('0x7'),JSON[_0xd187('0x9')]([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xd187('0xa')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0xd187('0xa')]},'col':{'type':Sequelize[_0xd187('0xa')]},'background':{'type':Sequelize[_0xd187('0x3')],'allowNull':![],'defaultValue':_0xd187('0xb'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0xd187('0x3')],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0xd187('0x3')]},'titleFontSize':{'type':Sequelize[_0xd187('0xa')],'defaultValue':0xc}}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.controller.js b/server/api/dashboardItem/dashboardItem.controller.js index dca788e..84befa3 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 _0x9541=['../../config/logger','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','./dashboardItem.socket','register','status','end','json','offset','undefined','limit','count','set','apply','update','destroy','then','sendStatus','error','stack','name','send','show','params','model','keys','DashboardItem','rawAttributes','query','filters','intersection','fields','length','attributes','includeAll','include','merge','find','catch','type','iframe','attrUrl','attrs','https://','attrPath','value','clock','attrHourFormat','attrTimezone','attrFontSize','counter','attrMetric','attrVoiceQueues','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','total','attrSerie2','attrSerie3','attrChannel','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x184e1a,_0x2136c4){var _0x54c7b9=function(_0xfa3835){while(--_0xfa3835){_0x184e1a['push'](_0x184e1a['shift']());}};_0x54c7b9(++_0x2136c4);}(_0x9541,0xb3));var _0x1954=function(_0x3354ab,_0x3bc63a){_0x3354ab=_0x3354ab-0x0;var _0x581958=_0x9541[_0x3354ab];return _0x581958;};'use strict';var emlformat=require(_0x1954('0x0'));var rimraf=require(_0x1954('0x1'));var zipdir=require(_0x1954('0x2'));var jsonpatch=require(_0x1954('0x3'));var rp=require(_0x1954('0x4'));var moment=require(_0x1954('0x5'));var BPromise=require(_0x1954('0x6'));var Mustache=require(_0x1954('0x7'));var util=require('util');var path=require('path');var sox=require(_0x1954('0x8'));var csv=require(_0x1954('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1954('0xa'));var _=require(_0x1954('0xb'));var squel=require(_0x1954('0xc'));var crypto=require(_0x1954('0xd'));var jsforce=require(_0x1954('0xe'));var deskjs=require(_0x1954('0xf'));var toCsv=require('to-csv');var querystring=require(_0x1954('0x10'));var Papa=require(_0x1954('0x11'));var Redis=require(_0x1954('0x12'));var authService=require(_0x1954('0x13'));var qs=require(_0x1954('0x14'));var as=require(_0x1954('0x15'));var hardwareService=require(_0x1954('0x16'));var logger=require(_0x1954('0x17'))('api');var utils=require(_0x1954('0x18'));var config=require(_0x1954('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x1954('0x1a'))['db'];config['redis']=_[_0x1954('0x1b')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1954('0x1c')]));require(_0x1954('0x1d'))[_0x1954('0x1e')](socket);function respondWithStatusCode(_0x520dc7,_0x287fc3){_0x287fc3=_0x287fc3||0xcc;return function(_0x5c359d){if(_0x5c359d){return _0x520dc7['sendStatus'](_0x287fc3);}return _0x520dc7[_0x1954('0x1f')](_0x287fc3)[_0x1954('0x20')]();};}function respondWithResult(_0x36565c,_0x451bda){_0x451bda=_0x451bda||0xc8;return function(_0x7c8b78){if(_0x7c8b78){return _0x36565c[_0x1954('0x1f')](_0x451bda)[_0x1954('0x21')](_0x7c8b78);}};}function respondWithFilteredResult(_0x46b400,_0x1b8975){return function(_0xb9c2cd){if(_0xb9c2cd){var _0xc8cb0b=typeof _0x1b8975[_0x1954('0x22')]===_0x1954('0x23')&&typeof _0x1b8975[_0x1954('0x24')]===_0x1954('0x23');var _0x4503d7=_0xb9c2cd[_0x1954('0x25')];var _0x1c65da=_0xc8cb0b?0x0:_0x1b8975[_0x1954('0x22')];var _0x5b26c7=_0xc8cb0b?_0xb9c2cd['count']:_0x1b8975[_0x1954('0x22')]+_0x1b8975[_0x1954('0x24')];var _0x3a84c0;if(_0x5b26c7>=_0x4503d7){_0x5b26c7=_0x4503d7;_0x3a84c0=0xc8;}else{_0x3a84c0=0xce;}_0x46b400[_0x1954('0x1f')](_0x3a84c0);return _0x46b400[_0x1954('0x26')]('Content-Range',_0x1c65da+'-'+_0x5b26c7+'/'+_0x4503d7)[_0x1954('0x21')](_0xb9c2cd);}return null;};}function patchUpdates(_0x15dd0b){return function(_0x5ea2c3){try{jsonpatch[_0x1954('0x27')](_0x5ea2c3,_0x15dd0b,!![]);}catch(_0x6d8a2){return BPromise['reject'](_0x6d8a2);}return _0x5ea2c3['save']();};}function saveUpdates(_0x18a883,_0x363064){return function(_0x3b954b){if(_0x3b954b){return _0x3b954b[_0x1954('0x28')](_0x18a883)['then'](function(_0x21f395){return _0x21f395;});}return null;};}function removeEntity(_0x26484f,_0x27dc66){return function(_0x29b732){if(_0x29b732){return _0x29b732[_0x1954('0x29')]()[_0x1954('0x2a')](function(){_0x26484f[_0x1954('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c0a27,_0x337aad){return function(_0x513917){if(!_0x513917){_0x1c0a27[_0x1954('0x2b')](0x194);}return _0x513917;};}function handleError(_0x1a2f6b,_0x35ca31){_0x35ca31=_0x35ca31||0x1f4;return function(_0x3a488b){logger[_0x1954('0x2c')](_0x3a488b[_0x1954('0x2d')]);if(_0x3a488b[_0x1954('0x2e')]){delete _0x3a488b[_0x1954('0x2e')];}_0x1a2f6b[_0x1954('0x1f')](_0x35ca31)[_0x1954('0x2f')](_0x3a488b);};}exports[_0x1954('0x30')]=function(_0x3c27d3,_0x40da25){var _0x22509c={'raw':![],'where':{'id':_0x3c27d3[_0x1954('0x31')]['id']}},_0x228a57={};_0x228a57[_0x1954('0x32')]=_[_0x1954('0x33')](db[_0x1954('0x34')][_0x1954('0x35')]);_0x228a57[_0x1954('0x36')]=_[_0x1954('0x33')](_0x3c27d3[_0x1954('0x36')]);_0x228a57[_0x1954('0x37')]=_['intersection'](_0x228a57['model'],_0x228a57[_0x1954('0x36')]);_0x22509c['attributes']=_[_0x1954('0x38')](_0x228a57[_0x1954('0x32')],qs['fields'](_0x3c27d3[_0x1954('0x36')][_0x1954('0x39')]));_0x22509c['attributes']=_0x22509c['attributes'][_0x1954('0x3a')]?_0x22509c[_0x1954('0x3b')]:_0x228a57[_0x1954('0x32')];if(_0x3c27d3[_0x1954('0x36')][_0x1954('0x3c')]){_0x22509c[_0x1954('0x3d')]=[{'all':!![]}];}_0x22509c=_[_0x1954('0x3e')]({},_0x22509c,_0x3c27d3['options']);return db['DashboardItem'][_0x1954('0x3f')](_0x22509c)[_0x1954('0x2a')](handleEntityNotFound(_0x40da25,null))[_0x1954('0x2a')](respondWithResult(_0x40da25,null))[_0x1954('0x40')](handleError(_0x40da25,null));};exports[_0x1954('0x29')]=function(_0x1d2f96,_0x5d235f){return db[_0x1954('0x34')][_0x1954('0x3f')]({'where':{'id':_0x1d2f96['params']['id']}})[_0x1954('0x2a')](handleEntityNotFound(_0x5d235f,null))[_0x1954('0x2a')](removeEntity(_0x5d235f,null))['catch'](handleError(_0x5d235f,null));};function widgetAttributes(_0x580990){try{switch(_0x580990[_0x1954('0x41')]){case _0x1954('0x42'):return[{'name':'attrUrl','value':_0x580990[_0x1954('0x43')]||(_0x580990[_0x1954('0x44')]&&_0x580990[_0x1954('0x44')][0x0]?_0x580990[_0x1954('0x44')][0x0]['value']:undefined)||_0x1954('0x45')}];case'custom':return[{'name':_0x1954('0x46'),'value':_0x580990[_0x1954('0x46')]||(_0x580990[_0x1954('0x44')]&&_0x580990['attrs'][0x0]?_0x580990[_0x1954('0x44')][0x0][_0x1954('0x47')]:undefined)||''}];case _0x1954('0x48'):return[{'name':_0x1954('0x49'),'value':_0x580990[_0x1954('0x49')]||(_0x580990['attrs']&&_0x580990[_0x1954('0x44')][0x0]?_0x580990['attrs'][0x0][_0x1954('0x47')]:undefined)||'HH:mm:ss'},{'name':_0x1954('0x4a'),'value':_0x580990[_0x1954('0x4a')]||(_0x580990[_0x1954('0x44')]&&_0x580990[_0x1954('0x44')][0x1]?_0x580990['attrs'][0x1][_0x1954('0x47')]:undefined)||'0.00'},{'name':_0x1954('0x4b'),'value':_0x580990[_0x1954('0x4b')]||(_0x580990['attrs']&&_0x580990[_0x1954('0x44')][0x2]?_0x580990[_0x1954('0x44')][0x2][_0x1954('0x47')]:undefined)||0xc}];case _0x1954('0x4c'):return[{'name':_0x1954('0x4d'),'value':_0x580990[_0x1954('0x4d')]||(_0x580990[_0x1954('0x44')]&&_0x580990[_0x1954('0x44')][0x0]?_0x580990[_0x1954('0x44')][0x0]['value']:undefined)||'total'},{'name':'attrVoiceQueues','value':_0x580990[_0x1954('0x4e')]||(_0x580990['attrs']&&_0x580990[_0x1954('0x44')][0x1]?_0x580990[_0x1954('0x44')][0x1][_0x1954('0x47')]:undefined)||[]},{'name':_0x1954('0x4b'),'value':_0x580990[_0x1954('0x4b')]||(_0x580990[_0x1954('0x44')]&&_0x580990[_0x1954('0x44')][0x2]?_0x580990[_0x1954('0x44')][0x2][_0x1954('0x47')]:undefined)||0x14},{'name':'attrChannel','value':_0x580990['attrChannel']||(_0x580990[_0x1954('0x44')]&&_0x580990['attrs'][0x3]?_0x580990[_0x1954('0x44')][0x3]['value']:undefined)||_0x1954('0x4f')},{'name':_0x1954('0x50'),'value':_0x580990[_0x1954('0x50')]||(_0x580990[_0x1954('0x44')]&&_0x580990[_0x1954('0x44')][0x4]?_0x580990[_0x1954('0x44')][0x4][_0x1954('0x47')]:undefined)||''},{'name':_0x1954('0x51'),'value':_0x580990[_0x1954('0x51')]||(_0x580990[_0x1954('0x44')]&&_0x580990['attrs'][0x5]?_0x580990[_0x1954('0x44')][0x5][_0x1954('0x47')]:undefined)||''},{'name':_0x1954('0x52'),'value':_0x580990[_0x1954('0x52')]||(_0x580990['attrs']&&_0x580990[_0x1954('0x44')][0x6]?_0x580990[_0x1954('0x44')][0x6]['value']:undefined)||''},{'name':_0x1954('0x53'),'value':_0x580990['attrOpenchannelAccounts']||(_0x580990[_0x1954('0x44')]&&_0x580990[_0x1954('0x44')][0x7]?_0x580990[_0x1954('0x44')][0x7][_0x1954('0x47')]:undefined)||''},{'name':_0x1954('0x54'),'value':_0x580990[_0x1954('0x54')]||(_0x580990[_0x1954('0x44')]&&_0x580990['attrs'][0x8]?_0x580990[_0x1954('0x44')][0x8]['value']:undefined)||''},{'name':_0x1954('0x55'),'value':_0x580990[_0x1954('0x55')]||(_0x580990[_0x1954('0x44')]&&_0x580990['attrs'][0x9]?_0x580990[_0x1954('0x44')][0x9][_0x1954('0x47')]:undefined)||''}];case _0x1954('0x56'):case _0x1954('0x57'):return[{'name':_0x1954('0x58'),'value':_0x580990['attrSerie1']||(_0x580990[_0x1954('0x44')]&&_0x580990[_0x1954('0x44')][0x0]?_0x580990[_0x1954('0x44')][0x0][_0x1954('0x47')]:undefined)||_0x1954('0x59')},{'name':'attrSerie2','value':_0x580990[_0x1954('0x5a')]||(_0x580990[_0x1954('0x44')]&&_0x580990[_0x1954('0x44')][0x1]?_0x580990[_0x1954('0x44')][0x1][_0x1954('0x47')]:undefined)||null},{'name':_0x1954('0x5b'),'value':_0x580990[_0x1954('0x5b')]||(_0x580990[_0x1954('0x44')]&&_0x580990[_0x1954('0x44')][0x2]?_0x580990['attrs'][0x2][_0x1954('0x47')]:undefined)||null},{'name':_0x1954('0x4e'),'value':_0x580990[_0x1954('0x4e')]||(_0x580990[_0x1954('0x44')]&&_0x580990[_0x1954('0x44')][0x3]?_0x580990[_0x1954('0x44')][0x3][_0x1954('0x47')]:undefined)||[]},{'name':_0x1954('0x5c'),'value':_0x580990[_0x1954('0x5c')]||(_0x580990[_0x1954('0x44')]&&_0x580990[_0x1954('0x44')][0x4]?_0x580990[_0x1954('0x44')][0x4][_0x1954('0x47')]:undefined)||_0x1954('0x4f')},{'name':_0x1954('0x50'),'value':_0x580990[_0x1954('0x50')]||(_0x580990['attrs']&&_0x580990['attrs'][0x5]?_0x580990['attrs'][0x5]['value']:undefined)||''},{'name':_0x1954('0x51'),'value':_0x580990['attrFaxAccounts']||(_0x580990['attrs']&&_0x580990[_0x1954('0x44')][0x6]?_0x580990[_0x1954('0x44')][0x6][_0x1954('0x47')]:undefined)||''},{'name':_0x1954('0x52'),'value':_0x580990[_0x1954('0x52')]||(_0x580990['attrs']&&_0x580990['attrs'][0x7]?_0x580990[_0x1954('0x44')][0x7][_0x1954('0x47')]:undefined)||''},{'name':_0x1954('0x53'),'value':_0x580990[_0x1954('0x53')]||(_0x580990[_0x1954('0x44')]&&_0x580990[_0x1954('0x44')][0x8]?_0x580990[_0x1954('0x44')][0x8][_0x1954('0x47')]:undefined)||''},{'name':_0x1954('0x54'),'value':_0x580990['attrWhatsappAccounts']||(_0x580990[_0x1954('0x44')]&&_0x580990[_0x1954('0x44')][0x9]?_0x580990[_0x1954('0x44')][0x9]['value']:undefined)||''},{'name':_0x1954('0x55'),'value':_0x580990[_0x1954('0x55')]||(_0x580990[_0x1954('0x44')]&&_0x580990['attrs'][0xa]?_0x580990[_0x1954('0x44')][0xa]['value']:undefined)||''}];case _0x1954('0x5d'):return[{'name':_0x1954('0x5e'),'type':_0x580990[_0x1954('0x5f')]||(_0x580990[_0x1954('0x44')]&&_0x580990[_0x1954('0x44')][0x0]?_0x580990[_0x1954('0x44')][0x0][_0x1954('0x41')]:undefined)||null,'value':_0x580990[_0x1954('0x5e')]||(_0x580990[_0x1954('0x44')]&&_0x580990['attrs'][0x0]?_0x580990[_0x1954('0x44')][0x0][_0x1954('0x47')]:undefined)||null},{'name':'attrRefresh','value':_0x580990[_0x1954('0x60')]||(_0x580990[_0x1954('0x44')]&&_0x580990[_0x1954('0x44')][0x1]?_0x580990[_0x1954('0x44')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x1cce3d){logger[_0x1954('0x2c')](_0x1954('0x61'),JSON[_0x1954('0x62')](_0x1cce3d));return[];}}exports[_0x1954('0x63')]=function(_0x86cc39,_0x458306){if(_0x86cc39[_0x1954('0x64')]){_0x86cc39['body']['attrs']=widgetAttributes(_0x86cc39[_0x1954('0x64')]);}return db['DashboardItem'][_0x1954('0x63')](_0x86cc39['body'],{})[_0x1954('0x2a')](respondWithResult(_0x458306,0xc9))[_0x1954('0x40')](handleError(_0x458306,null));};exports[_0x1954('0x28')]=function(_0x5c5d9c,_0x3e1fe5){if(_0x5c5d9c[_0x1954('0x64')]['id']){delete _0x5c5d9c[_0x1954('0x64')]['id'];}_0x5c5d9c['body']['attrs']=widgetAttributes(_0x5c5d9c[_0x1954('0x64')]);return db[_0x1954('0x34')][_0x1954('0x3f')]({'where':{'id':_0x5c5d9c[_0x1954('0x31')]['id']}})['then'](handleEntityNotFound(_0x3e1fe5,null))[_0x1954('0x2a')](saveUpdates(_0x5c5d9c['body'],null))['then'](respondWithResult(_0x3e1fe5,null))['catch'](handleError(_0x3e1fe5,null));}; \ No newline at end of file +var _0xf9d5=['zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./dashboardItem.socket','status','end','undefined','limit','count','offset','apply','reject','update','then','destroy','sendStatus','error','stack','name','send','show','model','DashboardItem','query','keys','filters','intersection','fields','attributes','length','includeAll','include','merge','find','catch','type','iframe','attrs','value','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','create','body','params','rimraf'];(function(_0x34b97d,_0x103be0){var _0x43c004=function(_0x31854a){while(--_0x31854a){_0x34b97d['push'](_0x34b97d['shift']());}};_0x43c004(++_0x103be0);}(_0xf9d5,0x122));var _0x5f9d=function(_0x2a162d,_0x56fb94){_0x2a162d=_0x2a162d-0x0;var _0x4e82a7=_0xf9d5[_0x2a162d];return _0x4e82a7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5f9d('0x0'));var zipdir=require(_0x5f9d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5f9d('0x2'));var moment=require(_0x5f9d('0x3'));var BPromise=require(_0x5f9d('0x4'));var Mustache=require(_0x5f9d('0x5'));var util=require(_0x5f9d('0x6'));var path=require(_0x5f9d('0x7'));var sox=require(_0x5f9d('0x8'));var csv=require('to-csv');var ejs=require(_0x5f9d('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5f9d('0xa'));var squel=require(_0x5f9d('0xb'));var crypto=require('crypto');var jsforce=require(_0x5f9d('0xc'));var deskjs=require(_0x5f9d('0xd'));var toCsv=require(_0x5f9d('0xe'));var querystring=require(_0x5f9d('0xf'));var Papa=require(_0x5f9d('0x10'));var Redis=require(_0x5f9d('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x5f9d('0x12'));var as=require(_0x5f9d('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5f9d('0x14'));var utils=require(_0x5f9d('0x15'));var config=require(_0x5f9d('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x5f9d('0x17'))['db'];config[_0x5f9d('0x18')]=_[_0x5f9d('0x19')](config[_0x5f9d('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x5f9d('0x1a'))(new Redis(config[_0x5f9d('0x18')]));require(_0x5f9d('0x1b'))['register'](socket);function respondWithStatusCode(_0x8e2381,_0x3ae401){_0x3ae401=_0x3ae401||0xcc;return function(_0x57cb1a){if(_0x57cb1a){return _0x8e2381['sendStatus'](_0x3ae401);}return _0x8e2381[_0x5f9d('0x1c')](_0x3ae401)[_0x5f9d('0x1d')]();};}function respondWithResult(_0x3d4a1c,_0x26a76a){_0x26a76a=_0x26a76a||0xc8;return function(_0x3ffb29){if(_0x3ffb29){return _0x3d4a1c['status'](_0x26a76a)['json'](_0x3ffb29);}};}function respondWithFilteredResult(_0x54bd00,_0x3d8370){return function(_0x4fb9a5){if(_0x4fb9a5){var _0x432f1a=typeof _0x3d8370['offset']===_0x5f9d('0x1e')&&typeof _0x3d8370[_0x5f9d('0x1f')]===_0x5f9d('0x1e');var _0x55a31c=_0x4fb9a5[_0x5f9d('0x20')];var _0x16de94=_0x432f1a?0x0:_0x3d8370[_0x5f9d('0x21')];var _0x1e51d7=_0x432f1a?_0x4fb9a5[_0x5f9d('0x20')]:_0x3d8370[_0x5f9d('0x21')]+_0x3d8370[_0x5f9d('0x1f')];var _0x2563d5;if(_0x1e51d7>=_0x55a31c){_0x1e51d7=_0x55a31c;_0x2563d5=0xc8;}else{_0x2563d5=0xce;}_0x54bd00[_0x5f9d('0x1c')](_0x2563d5);return _0x54bd00['set']('Content-Range',_0x16de94+'-'+_0x1e51d7+'/'+_0x55a31c)['json'](_0x4fb9a5);}return null;};}function patchUpdates(_0x1bc76b){return function(_0x4bd98f){try{jsonpatch[_0x5f9d('0x22')](_0x4bd98f,_0x1bc76b,!![]);}catch(_0x5a3472){return BPromise[_0x5f9d('0x23')](_0x5a3472);}return _0x4bd98f['save']();};}function saveUpdates(_0x4875c5,_0x5086da){return function(_0x1f4c7b){if(_0x1f4c7b){return _0x1f4c7b[_0x5f9d('0x24')](_0x4875c5)[_0x5f9d('0x25')](function(_0x234511){return _0x234511;});}return null;};}function removeEntity(_0x542bbc,_0x379d2d){return function(_0x272b93){if(_0x272b93){return _0x272b93[_0x5f9d('0x26')]()[_0x5f9d('0x25')](function(){_0x542bbc[_0x5f9d('0x1c')](0xcc)[_0x5f9d('0x1d')]();});}};}function handleEntityNotFound(_0x2d66cc,_0x21cc63){return function(_0x3b1efc){if(!_0x3b1efc){_0x2d66cc[_0x5f9d('0x27')](0x194);}return _0x3b1efc;};}function handleError(_0x5e1f52,_0x154a98){_0x154a98=_0x154a98||0x1f4;return function(_0x1b9054){logger[_0x5f9d('0x28')](_0x1b9054[_0x5f9d('0x29')]);if(_0x1b9054[_0x5f9d('0x2a')]){delete _0x1b9054[_0x5f9d('0x2a')];}_0x5e1f52[_0x5f9d('0x1c')](_0x154a98)[_0x5f9d('0x2b')](_0x1b9054);};}exports[_0x5f9d('0x2c')]=function(_0x4f43b2,_0x4ed27d){var _0x4ba714={'raw':![],'where':{'id':_0x4f43b2['params']['id']}},_0x118f77={};_0x118f77[_0x5f9d('0x2d')]=_['keys'](db[_0x5f9d('0x2e')]['rawAttributes']);_0x118f77[_0x5f9d('0x2f')]=_[_0x5f9d('0x30')](_0x4f43b2[_0x5f9d('0x2f')]);_0x118f77[_0x5f9d('0x31')]=_[_0x5f9d('0x32')](_0x118f77['model'],_0x118f77[_0x5f9d('0x2f')]);_0x4ba714['attributes']=_[_0x5f9d('0x32')](_0x118f77['model'],qs[_0x5f9d('0x33')](_0x4f43b2[_0x5f9d('0x2f')]['fields']));_0x4ba714[_0x5f9d('0x34')]=_0x4ba714[_0x5f9d('0x34')][_0x5f9d('0x35')]?_0x4ba714['attributes']:_0x118f77[_0x5f9d('0x2d')];if(_0x4f43b2[_0x5f9d('0x2f')][_0x5f9d('0x36')]){_0x4ba714[_0x5f9d('0x37')]=[{'all':!![]}];}_0x4ba714=_[_0x5f9d('0x38')]({},_0x4ba714,_0x4f43b2['options']);return db[_0x5f9d('0x2e')][_0x5f9d('0x39')](_0x4ba714)[_0x5f9d('0x25')](handleEntityNotFound(_0x4ed27d,null))[_0x5f9d('0x25')](respondWithResult(_0x4ed27d,null))[_0x5f9d('0x3a')](handleError(_0x4ed27d,null));};exports[_0x5f9d('0x26')]=function(_0x48a8e8,_0x1692c0){return db[_0x5f9d('0x2e')][_0x5f9d('0x39')]({'where':{'id':_0x48a8e8['params']['id']}})['then'](handleEntityNotFound(_0x1692c0,null))[_0x5f9d('0x25')](removeEntity(_0x1692c0,null))[_0x5f9d('0x3a')](handleError(_0x1692c0,null));};function widgetAttributes(_0x16a667){try{switch(_0x16a667[_0x5f9d('0x3b')]){case _0x5f9d('0x3c'):return[{'name':'attrUrl','value':_0x16a667['attrUrl']||(_0x16a667[_0x5f9d('0x3d')]&&_0x16a667[_0x5f9d('0x3d')][0x0]?_0x16a667['attrs'][0x0][_0x5f9d('0x3e')]:undefined)||'https://'}];case _0x5f9d('0x3f'):return[{'name':_0x5f9d('0x40'),'value':_0x16a667['attrPath']||(_0x16a667[_0x5f9d('0x3d')]&&_0x16a667[_0x5f9d('0x3d')][0x0]?_0x16a667[_0x5f9d('0x3d')][0x0]['value']:undefined)||''}];case _0x5f9d('0x41'):return[{'name':_0x5f9d('0x42'),'value':_0x16a667[_0x5f9d('0x42')]||(_0x16a667[_0x5f9d('0x3d')]&&_0x16a667[_0x5f9d('0x3d')][0x0]?_0x16a667[_0x5f9d('0x3d')][0x0][_0x5f9d('0x3e')]:undefined)||_0x5f9d('0x43')},{'name':_0x5f9d('0x44'),'value':_0x16a667[_0x5f9d('0x44')]||(_0x16a667[_0x5f9d('0x3d')]&&_0x16a667[_0x5f9d('0x3d')][0x1]?_0x16a667[_0x5f9d('0x3d')][0x1][_0x5f9d('0x3e')]:undefined)||_0x5f9d('0x45')},{'name':_0x5f9d('0x46'),'value':_0x16a667[_0x5f9d('0x46')]||(_0x16a667[_0x5f9d('0x3d')]&&_0x16a667[_0x5f9d('0x3d')][0x2]?_0x16a667[_0x5f9d('0x3d')][0x2][_0x5f9d('0x3e')]:undefined)||0xc}];case _0x5f9d('0x47'):return[{'name':_0x5f9d('0x48'),'value':_0x16a667[_0x5f9d('0x48')]||(_0x16a667[_0x5f9d('0x3d')]&&_0x16a667[_0x5f9d('0x3d')][0x0]?_0x16a667[_0x5f9d('0x3d')][0x0][_0x5f9d('0x3e')]:undefined)||_0x5f9d('0x49')},{'name':_0x5f9d('0x4a'),'value':_0x16a667['attrVoiceQueues']||(_0x16a667[_0x5f9d('0x3d')]&&_0x16a667['attrs'][0x1]?_0x16a667[_0x5f9d('0x3d')][0x1][_0x5f9d('0x3e')]:undefined)||[]},{'name':_0x5f9d('0x46'),'value':_0x16a667[_0x5f9d('0x46')]||(_0x16a667[_0x5f9d('0x3d')]&&_0x16a667[_0x5f9d('0x3d')][0x2]?_0x16a667[_0x5f9d('0x3d')][0x2]['value']:undefined)||0x14},{'name':_0x5f9d('0x4b'),'value':_0x16a667[_0x5f9d('0x4b')]||(_0x16a667[_0x5f9d('0x3d')]&&_0x16a667['attrs'][0x3]?_0x16a667[_0x5f9d('0x3d')][0x3]['value']:undefined)||_0x5f9d('0x4c')},{'name':_0x5f9d('0x4d'),'value':_0x16a667[_0x5f9d('0x4d')]||(_0x16a667['attrs']&&_0x16a667['attrs'][0x4]?_0x16a667[_0x5f9d('0x3d')][0x4][_0x5f9d('0x3e')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x16a667[_0x5f9d('0x4e')]||(_0x16a667['attrs']&&_0x16a667[_0x5f9d('0x3d')][0x5]?_0x16a667[_0x5f9d('0x3d')][0x5][_0x5f9d('0x3e')]:undefined)||''},{'name':_0x5f9d('0x4f'),'value':_0x16a667[_0x5f9d('0x4f')]||(_0x16a667[_0x5f9d('0x3d')]&&_0x16a667[_0x5f9d('0x3d')][0x6]?_0x16a667[_0x5f9d('0x3d')][0x6][_0x5f9d('0x3e')]:undefined)||''},{'name':_0x5f9d('0x50'),'value':_0x16a667['attrOpenchannelAccounts']||(_0x16a667[_0x5f9d('0x3d')]&&_0x16a667[_0x5f9d('0x3d')][0x7]?_0x16a667['attrs'][0x7][_0x5f9d('0x3e')]:undefined)||''},{'name':_0x5f9d('0x51'),'value':_0x16a667[_0x5f9d('0x51')]||(_0x16a667[_0x5f9d('0x3d')]&&_0x16a667[_0x5f9d('0x3d')][0x8]?_0x16a667[_0x5f9d('0x3d')][0x8][_0x5f9d('0x3e')]:undefined)||''},{'name':_0x5f9d('0x52'),'value':_0x16a667['attrChatWebsites']||(_0x16a667['attrs']&&_0x16a667[_0x5f9d('0x3d')][0x9]?_0x16a667[_0x5f9d('0x3d')][0x9][_0x5f9d('0x3e')]:undefined)||''}];case _0x5f9d('0x53'):case _0x5f9d('0x54'):return[{'name':_0x5f9d('0x55'),'value':_0x16a667[_0x5f9d('0x55')]||(_0x16a667[_0x5f9d('0x3d')]&&_0x16a667[_0x5f9d('0x3d')][0x0]?_0x16a667['attrs'][0x0]['value']:undefined)||_0x5f9d('0x49')},{'name':_0x5f9d('0x56'),'value':_0x16a667[_0x5f9d('0x56')]||(_0x16a667[_0x5f9d('0x3d')]&&_0x16a667[_0x5f9d('0x3d')][0x1]?_0x16a667[_0x5f9d('0x3d')][0x1][_0x5f9d('0x3e')]:undefined)||null},{'name':_0x5f9d('0x57'),'value':_0x16a667[_0x5f9d('0x57')]||(_0x16a667[_0x5f9d('0x3d')]&&_0x16a667['attrs'][0x2]?_0x16a667['attrs'][0x2][_0x5f9d('0x3e')]:undefined)||null},{'name':_0x5f9d('0x4a'),'value':_0x16a667[_0x5f9d('0x4a')]||(_0x16a667['attrs']&&_0x16a667[_0x5f9d('0x3d')][0x3]?_0x16a667['attrs'][0x3][_0x5f9d('0x3e')]:undefined)||[]},{'name':'attrChannel','value':_0x16a667['attrChannel']||(_0x16a667[_0x5f9d('0x3d')]&&_0x16a667['attrs'][0x4]?_0x16a667[_0x5f9d('0x3d')][0x4][_0x5f9d('0x3e')]:undefined)||_0x5f9d('0x4c')},{'name':_0x5f9d('0x4d'),'value':_0x16a667[_0x5f9d('0x4d')]||(_0x16a667[_0x5f9d('0x3d')]&&_0x16a667['attrs'][0x5]?_0x16a667[_0x5f9d('0x3d')][0x5]['value']:undefined)||''},{'name':_0x5f9d('0x4e'),'value':_0x16a667['attrFaxAccounts']||(_0x16a667['attrs']&&_0x16a667[_0x5f9d('0x3d')][0x6]?_0x16a667[_0x5f9d('0x3d')][0x6][_0x5f9d('0x3e')]:undefined)||''},{'name':_0x5f9d('0x4f'),'value':_0x16a667['attrSmsAccounts']||(_0x16a667['attrs']&&_0x16a667[_0x5f9d('0x3d')][0x7]?_0x16a667[_0x5f9d('0x3d')][0x7][_0x5f9d('0x3e')]:undefined)||''},{'name':_0x5f9d('0x50'),'value':_0x16a667[_0x5f9d('0x50')]||(_0x16a667['attrs']&&_0x16a667[_0x5f9d('0x3d')][0x8]?_0x16a667['attrs'][0x8][_0x5f9d('0x3e')]:undefined)||''},{'name':_0x5f9d('0x51'),'value':_0x16a667[_0x5f9d('0x51')]||(_0x16a667[_0x5f9d('0x3d')]&&_0x16a667['attrs'][0x9]?_0x16a667[_0x5f9d('0x3d')][0x9][_0x5f9d('0x3e')]:undefined)||''},{'name':_0x5f9d('0x52'),'value':_0x16a667[_0x5f9d('0x52')]||(_0x16a667['attrs']&&_0x16a667[_0x5f9d('0x3d')][0xa]?_0x16a667[_0x5f9d('0x3d')][0xa][_0x5f9d('0x3e')]:undefined)||''}];case _0x5f9d('0x58'):return[{'name':_0x5f9d('0x59'),'type':_0x16a667[_0x5f9d('0x5a')]||(_0x16a667[_0x5f9d('0x3d')]&&_0x16a667['attrs'][0x0]?_0x16a667[_0x5f9d('0x3d')][0x0][_0x5f9d('0x3b')]:undefined)||null,'value':_0x16a667[_0x5f9d('0x59')]||(_0x16a667[_0x5f9d('0x3d')]&&_0x16a667[_0x5f9d('0x3d')][0x0]?_0x16a667[_0x5f9d('0x3d')][0x0][_0x5f9d('0x3e')]:undefined)||null},{'name':_0x5f9d('0x5b'),'value':_0x16a667[_0x5f9d('0x5b')]||(_0x16a667[_0x5f9d('0x3d')]&&_0x16a667[_0x5f9d('0x3d')][0x1]?_0x16a667[_0x5f9d('0x3d')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x3e19ba){logger[_0x5f9d('0x28')](_0x5f9d('0x5c'),JSON[_0x5f9d('0x5d')](_0x3e19ba));return[];}}exports[_0x5f9d('0x5e')]=function(_0x53072a,_0x2a8d82){if(_0x53072a[_0x5f9d('0x5f')]){_0x53072a[_0x5f9d('0x5f')][_0x5f9d('0x3d')]=widgetAttributes(_0x53072a[_0x5f9d('0x5f')]);}return db['DashboardItem'][_0x5f9d('0x5e')](_0x53072a[_0x5f9d('0x5f')],{})[_0x5f9d('0x25')](respondWithResult(_0x2a8d82,0xc9))[_0x5f9d('0x3a')](handleError(_0x2a8d82,null));};exports[_0x5f9d('0x24')]=function(_0x27a83a,_0x2d5958){if(_0x27a83a[_0x5f9d('0x5f')]['id']){delete _0x27a83a['body']['id'];}_0x27a83a[_0x5f9d('0x5f')]['attrs']=widgetAttributes(_0x27a83a['body']);return db[_0x5f9d('0x2e')][_0x5f9d('0x39')]({'where':{'id':_0x27a83a[_0x5f9d('0x60')]['id']}})[_0x5f9d('0x25')](handleEntityNotFound(_0x2d5958,null))[_0x5f9d('0x25')](saveUpdates(_0x27a83a['body'],null))[_0x5f9d('0x25')](respondWithResult(_0x2d5958,null))[_0x5f9d('0x3a')](handleError(_0x2d5958,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index b730568..24eaa45 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 _0x2f0f=['hook','exports','events','../../mysqldb','DashboardItem','setMaxListeners','save','emit'];(function(_0x14ec5e,_0x6e3111){var _0x4c67a1=function(_0xc8aa1c){while(--_0xc8aa1c){_0x14ec5e['push'](_0x14ec5e['shift']());}};_0x4c67a1(++_0x6e3111);}(_0x2f0f,0xc2));var _0xf2f0=function(_0x147497,_0x43e433){_0x147497=_0x147497-0x0;var _0x35f45=_0x2f0f[_0x147497];return _0x35f45;};'use strict';var EventEmitter=require(_0xf2f0('0x0'));var DashboardItem=require(_0xf2f0('0x1'))['db'][_0xf2f0('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0xf2f0('0x3')](0x0);var events={'afterCreate':_0xf2f0('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x31a3d8){return function(_0x461246,_0x45123c,_0x1af8c1){DashboardItemEvents[_0xf2f0('0x5')](_0x31a3d8+':'+_0x461246['id'],_0x461246);DashboardItemEvents[_0xf2f0('0x5')](_0x31a3d8,_0x461246);_0x1af8c1(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];DashboardItem[_0xf2f0('0x6')](e,emitEvent(event));}}module[_0xf2f0('0x7')]=DashboardItemEvents; \ No newline at end of file +var _0xfdca=['emit','hasOwnProperty','events','../../mysqldb','DashboardItem','save','update','remove'];(function(_0x476bf4,_0x2a3755){var _0x788ffe=function(_0x13fa11){while(--_0x13fa11){_0x476bf4['push'](_0x476bf4['shift']());}};_0x788ffe(++_0x2a3755);}(_0xfdca,0x152));var _0xafdc=function(_0x3ee897,_0x524b0d){_0x3ee897=_0x3ee897-0x0;var _0xd2ce58=_0xfdca[_0x3ee897];return _0xd2ce58;};'use strict';var EventEmitter=require(_0xafdc('0x0'));var DashboardItem=require(_0xafdc('0x1'))['db'][_0xafdc('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xafdc('0x3'),'afterUpdate':_0xafdc('0x4'),'afterDestroy':_0xafdc('0x5')};function emitEvent(_0x5bb350){return function(_0x38d49b,_0x183454,_0x1952de){DashboardItemEvents[_0xafdc('0x6')](_0x5bb350+':'+_0x38d49b['id'],_0x38d49b);DashboardItemEvents['emit'](_0x5bb350,_0x38d49b);_0x1952de(null);};}for(var e in events){if(events[_0xafdc('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 138a34f..956b086 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 _0x1ee8=['request-promise','../../config/environment','./dashboardItem.attributes','define','dashboard_items','util','moment','bluebird'];(function(_0x115850,_0x4bb634){var _0xbad084=function(_0xa14074){while(--_0xa14074){_0x115850['push'](_0x115850['shift']());}};_0xbad084(++_0x4bb634);}(_0x1ee8,0x6d));var _0x81ee=function(_0x277779,_0x348b9e){_0x277779=_0x277779-0x0;var _0x2e2fe0=_0x1ee8[_0x277779];return _0x2e2fe0;};'use strict';var _=require('lodash');var util=require(_0x81ee('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x81ee('0x1'));var BPromise=require(_0x81ee('0x2'));var rp=require(_0x81ee('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x81ee('0x4'));var attributes=require(_0x81ee('0x5'));module['exports']=function(_0x333ceb,_0x9b2f78){return _0x333ceb[_0x81ee('0x6')]('DashboardItem',attributes,{'tableName':_0x81ee('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x406c=['DashboardItem','dashboard_items','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','./dashboardItem.attributes','exports','define'];(function(_0x57a940,_0x4d9071){var _0x39bdb6=function(_0x5be6f2){while(--_0x5be6f2){_0x57a940['push'](_0x57a940['shift']());}};_0x39bdb6(++_0x4d9071);}(_0x406c,0xda));var _0xc406=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x406c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc406('0x0'));var util=require('util');var logger=require(_0xc406('0x1'))(_0xc406('0x2'));var moment=require('moment');var BPromise=require(_0xc406('0x3'));var rp=require(_0xc406('0x4'));var fs=require('fs');var path=require(_0xc406('0x5'));var rimraf=require(_0xc406('0x6'));var config=require('../../config/environment');var attributes=require(_0xc406('0x7'));module[_0xc406('0x8')]=function(_0x1eb62c,_0x3067d5){return _0x1eb62c[_0xc406('0x9')](_0xc406('0xa'),attributes,{'tableName':_0xc406('0xb'),'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 84e5a82..9db2655 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 _0xb3df=['./dashboardItem.socket','register','then','info','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','code','error','DashboardItem,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter'];(function(_0x48a0b4,_0x2a4c3f){var _0x44b1e6=function(_0x3cfaa6){while(--_0x3cfaa6){_0x48a0b4['push'](_0x48a0b4['shift']());}};_0x44b1e6(++_0x2a4c3f);}(_0xb3df,0x1cf));var _0xfb3d=function(_0x46c698,_0x475514){_0x46c698=_0x46c698-0x0;var _0x4e24c3=_0xb3df[_0x46c698];return _0x4e24c3;};'use strict';var _=require(_0xfb3d('0x0'));var util=require(_0xfb3d('0x1'));var moment=require(_0xfb3d('0x2'));var BPromise=require(_0xfb3d('0x3'));var rs=require(_0xfb3d('0x4'));var fs=require('fs');var Redis=require(_0xfb3d('0x5'));var db=require(_0xfb3d('0x6'))['db'];var utils=require(_0xfb3d('0x7'));var logger=require('../../config/logger')(_0xfb3d('0x8'));var config=require(_0xfb3d('0x9'));var jayson=require(_0xfb3d('0xa'));var client=jayson[_0xfb3d('0xb')][_0xfb3d('0xc')]({'port':0x232a});config[_0xfb3d('0xd')]=_[_0xfb3d('0xe')](config['redis'],{'host':_0xfb3d('0xf'),'port':0x18eb});var socket=require(_0xfb3d('0x10'))(new Redis(config[_0xfb3d('0xd')]));require(_0xfb3d('0x11'))[_0xfb3d('0x12')](socket);function respondWithRpcPromise(_0x358e70,_0x1b074d,_0x167e8d){return new BPromise(function(_0x2ad992,_0x3a0eef){return client['request'](_0x358e70,_0x167e8d)[_0xfb3d('0x13')](function(_0x4e5b6f){logger[_0xfb3d('0x14')]('DashboardItem,\x20%s,\x20%s',_0x1b074d,_0xfb3d('0x15'));logger[_0xfb3d('0x16')](_0xfb3d('0x17'),_0x1b074d,_0xfb3d('0x15'),JSON[_0xfb3d('0x18')](_0x4e5b6f));if(_0x4e5b6f['error']){if(_0x4e5b6f['error'][_0xfb3d('0x19')]===0x1f4){logger[_0xfb3d('0x1a')](_0xfb3d('0x1b'),_0x1b074d,_0x4e5b6f[_0xfb3d('0x1a')]['message']);return _0x3a0eef(_0x4e5b6f[_0xfb3d('0x1a')]['message']);}logger[_0xfb3d('0x1a')](_0xfb3d('0x1b'),_0x1b074d,_0x4e5b6f[_0xfb3d('0x1a')][_0xfb3d('0x1c')]);return _0x2ad992(_0x4e5b6f[_0xfb3d('0x1a')][_0xfb3d('0x1c')]);}else{logger[_0xfb3d('0x14')](_0xfb3d('0x1b'),_0x1b074d,'request\x20sent');_0x2ad992(_0x4e5b6f['result']['message']);}})[_0xfb3d('0x1d')](function(_0x2307b7){logger[_0xfb3d('0x1a')](_0xfb3d('0x1b'),_0x1b074d,_0x2307b7);_0x3a0eef(_0x2307b7);});});} \ No newline at end of file +var _0xe03a=['defaults','./dashboardItem.socket','register','DashboardItem,\x20%s,\x20%s','request\x20sent','DashboardItem,\x20%s,\x20%s,\x20%s','error','code','message','result','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','http','redis'];(function(_0x7d891d,_0x200e32){var _0x331111=function(_0x2e1b3a){while(--_0x2e1b3a){_0x7d891d['push'](_0x7d891d['shift']());}};_0x331111(++_0x200e32);}(_0xe03a,0x92));var _0xae03=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe03a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xae03('0x0'));var rs=require(_0xae03('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xae03('0x2'))['db'];var utils=require(_0xae03('0x3'));var logger=require(_0xae03('0x4'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xae03('0x5')]({'port':0x232a});config[_0xae03('0x6')]=_[_0xae03('0x7')](config[_0xae03('0x6')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xae03('0x6')]));require(_0xae03('0x8'))[_0xae03('0x9')](socket);function respondWithRpcPromise(_0x40a63f,_0x17eb06,_0x367d1e){return new BPromise(function(_0x56c791,_0x36231b){return client['request'](_0x40a63f,_0x367d1e)['then'](function(_0x108747){logger['info'](_0xae03('0xa'),_0x17eb06,_0xae03('0xb'));logger['debug'](_0xae03('0xc'),_0x17eb06,_0xae03('0xb'),JSON['stringify'](_0x108747));if(_0x108747[_0xae03('0xd')]){if(_0x108747[_0xae03('0xd')][_0xae03('0xe')]===0x1f4){logger[_0xae03('0xd')](_0xae03('0xa'),_0x17eb06,_0x108747['error'][_0xae03('0xf')]);return _0x36231b(_0x108747[_0xae03('0xd')][_0xae03('0xf')]);}logger[_0xae03('0xd')](_0xae03('0xa'),_0x17eb06,_0x108747[_0xae03('0xd')][_0xae03('0xf')]);return _0x56c791(_0x108747[_0xae03('0xd')][_0xae03('0xf')]);}else{logger['info'](_0xae03('0xa'),_0x17eb06,_0xae03('0xb'));_0x56c791(_0x108747[_0xae03('0x10')][_0xae03('0xf')]);}})['catch'](function(_0x1ea346){logger[_0xae03('0xd')](_0xae03('0xa'),_0x17eb06,_0x1ea346);_0x36231b(_0x1ea346);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index 43a3c6f..5912e62 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 _0x05ee=['update','removeListener','length','./dashboardItem.events','save','remove'];(function(_0x2459fd,_0x575d9b){var _0x364cd2=function(_0x4b22f6){while(--_0x4b22f6){_0x2459fd['push'](_0x2459fd['shift']());}};_0x364cd2(++_0x575d9b);}(_0x05ee,0x111));var _0xe05e=function(_0xabbd2f,_0x44d05a){_0xabbd2f=_0xabbd2f-0x0;var _0x34a040=_0x05ee[_0xabbd2f];return _0x34a040;};'use strict';var DashboardItemEvents=require(_0xe05e('0x0'));var events=[_0xe05e('0x1'),_0xe05e('0x2'),_0xe05e('0x3')];function createListener(_0x546185,_0xa6a13a){return function(_0x801ef2){_0xa6a13a['emit'](_0x546185,_0x801ef2);};}function removeListener(_0x37645e,_0x132ede){return function(){DashboardItemEvents[_0xe05e('0x4')](_0x37645e,_0x132ede);};}exports['register']=function(_0x308356){for(var _0x3397f5=0x0,_0x12a874=events[_0xe05e('0x5')];_0x3397f5<_0x12a874;_0x3397f5++){var _0x3ea6f4=events[_0x3397f5];var _0x56ad4c=createListener('dashboardItem:'+_0x3ea6f4,_0x308356);DashboardItemEvents['on'](_0x3ea6f4,_0x56ad4c);}}; \ No newline at end of file +var _0xddef=['update','emit','register','dashboardItem:','./dashboardItem.events'];(function(_0x34933a,_0x327378){var _0x36abb4=function(_0x2d6814){while(--_0x2d6814){_0x34933a['push'](_0x34933a['shift']());}};_0x36abb4(++_0x327378);}(_0xddef,0x1c1));var _0xfdde=function(_0x2fc44f,_0x378dc5){_0x2fc44f=_0x2fc44f-0x0;var _0x13984c=_0xddef[_0x2fc44f];return _0x13984c;};'use strict';var DashboardItemEvents=require(_0xfdde('0x0'));var events=['save','remove',_0xfdde('0x1')];function createListener(_0x10180e,_0x2e4cbf){return function(_0x49c123){_0x2e4cbf[_0xfdde('0x2')](_0x10180e,_0x49c123);};}function removeListener(_0xbea272,_0xedd2a){return function(){DashboardItemEvents['removeListener'](_0xbea272,_0xedd2a);};}exports[_0xfdde('0x3')]=function(_0x342a35){for(var _0x166d7c=0x0,_0x176cd6=events['length'];_0x166d7c<_0x176cd6;_0x166d7c++){var _0xe58bfe=events[_0x166d7c];var _0x5c53b7=createListener(_0xfdde('0x4')+_0xe58bfe,_0x342a35);DashboardItemEvents['on'](_0xe58bfe,_0x5c53b7);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index b6625e4..0a8c433 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 _0x667f=['destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','/:id','isAuthenticated','show','create','put','update','delete'];(function(_0x12df28,_0x291c3c){var _0x37cd3c=function(_0x2b746d){while(--_0x2b746d){_0x12df28['push'](_0x12df28['shift']());}};_0x37cd3c(++_0x291c3c);}(_0x667f,0x8a));var _0xf667=function(_0x2da544,_0x17a9f7){_0x2da544=_0x2da544-0x0;var _0x1d2e53=_0x667f[_0x2da544];return _0x1d2e53;};'use strict';var multer=require(_0xf667('0x0'));var util=require('util');var path=require(_0xf667('0x1'));var timeout=require(_0xf667('0x2'));var express=require('express');var router=express[_0xf667('0x3')]();var fs_extra=require(_0xf667('0x4'));var auth=require(_0xf667('0x5'));var interaction=require(_0xf667('0x6'));var config=require('../../config/environment');var controller=require('./dashboardItem.controller');router[_0xf667('0x7')](_0xf667('0x8'),auth[_0xf667('0x9')](),controller[_0xf667('0xa')]);router['post']('/',auth['isAuthenticated'](),controller[_0xf667('0xb')]);router[_0xf667('0xc')](_0xf667('0x8'),auth[_0xf667('0x9')](),controller[_0xf667('0xd')]);router[_0xf667('0xe')]('/:id',auth[_0xf667('0x9')](),controller[_0xf667('0xf')]);module[_0xf667('0x10')]=router; \ No newline at end of file +var _0xea5d=['isAuthenticated','put','update','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','get','/:id','show','post'];(function(_0x11e03f,_0x20b967){var _0x5666fe=function(_0x19ce63){while(--_0x19ce63){_0x11e03f['push'](_0x11e03f['shift']());}};_0x5666fe(++_0x20b967);}(_0xea5d,0xd2));var _0xdea5=function(_0x1eac5f,_0x3d3111){_0x1eac5f=_0x1eac5f-0x0;var _0x5b624b=_0xea5d[_0x1eac5f];return _0x5b624b;};'use strict';var multer=require('multer');var util=require(_0xdea5('0x0'));var path=require(_0xdea5('0x1'));var timeout=require(_0xdea5('0x2'));var express=require(_0xdea5('0x3'));var router=express['Router']();var fs_extra=require(_0xdea5('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xdea5('0x5'));var config=require(_0xdea5('0x6'));var controller=require('./dashboardItem.controller');router[_0xdea5('0x7')](_0xdea5('0x8'),auth['isAuthenticated'](),controller[_0xdea5('0x9')]);router[_0xdea5('0xa')]('/',auth[_0xdea5('0xb')](),controller['create']);router[_0xdea5('0xc')](_0xdea5('0x8'),auth[_0xdea5('0xb')](),controller[_0xdea5('0xd')]);router[_0xdea5('0xe')](_0xdea5('0x8'),auth[_0xdea5('0xb')](),controller[_0xdea5('0xf')]);module[_0xdea5('0x10')]=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index 55bec70..b7dad38 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 _0xcd74=['sequelize','exports','STRING','ENUM','first'];(function(_0x1ef547,_0x31bfdb){var _0x1d697b=function(_0x57fbdc){while(--_0x57fbdc){_0x1ef547['push'](_0x1ef547['shift']());}};_0x1d697b(++_0x31bfdb);}(_0xcd74,0x1db));var _0x4cd7=function(_0x481bdf,_0x4f95f8){_0x481bdf=_0x481bdf-0x0;var _0x11f09d=_0xcd74[_0x481bdf];return _0x11f09d;};'use strict';var Sequelize=require(_0x4cd7('0x0'));module[_0x4cd7('0x1')]={'name':{'type':Sequelize[_0x4cd7('0x2')],'allowNull':![]},'level':{'type':Sequelize[_0x4cd7('0x3')](_0x4cd7('0x4'),'second','third'),'allowNull':![],'defaultValue':_0x4cd7('0x4')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x6c5b=['first','STRING','sequelize','exports','ENUM','third'];(function(_0x2af239,_0x412e98){var _0x26dd65=function(_0x4300f9){while(--_0x4300f9){_0x2af239['push'](_0x2af239['shift']());}};_0x26dd65(++_0x412e98);}(_0x6c5b,0x1d6));var _0xb6c5=function(_0x66de12,_0x4f6401){_0x66de12=_0x66de12-0x0;var _0x3e2ab5=_0x6c5b[_0x66de12];return _0x3e2ab5;};'use strict';var Sequelize=require(_0xb6c5('0x0'));module[_0xb6c5('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'level':{'type':Sequelize[_0xb6c5('0x2')]('first','second',_0xb6c5('0x3')),'allowNull':![],'defaultValue':_0xb6c5('0x4')},'description':{'type':Sequelize[_0xb6c5('0x5')]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index 99c1336..1361459 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 _0xa8bf=['query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','VIRTUAL','filter','merge','options','includeAll','findAll','rows','catch','show','params','rawAttributes','keys','intersection','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','status','json','offset','undefined','count','limit','Content-Range','apply','reject','update','destroy','then','get','Dispositions','UserProfileResource','end','sendStatus','stack','name','send','index','map','Disposition','type','key','model'];(function(_0x370b49,_0x151875){var _0x23864c=function(_0x142ae5){while(--_0x142ae5){_0x370b49['push'](_0x370b49['shift']());}};_0x23864c(++_0x151875);}(_0xa8bf,0x1c2));var _0xfa8b=function(_0x10a12a,_0xee7529){_0x10a12a=_0x10a12a-0x0;var _0x1905af=_0xa8bf[_0x10a12a];return _0x1905af;};'use strict';var emlformat=require(_0xfa8b('0x0'));var rimraf=require(_0xfa8b('0x1'));var zipdir=require(_0xfa8b('0x2'));var jsonpatch=require(_0xfa8b('0x3'));var rp=require(_0xfa8b('0x4'));var moment=require('moment');var BPromise=require(_0xfa8b('0x5'));var Mustache=require('mustache');var util=require(_0xfa8b('0x6'));var path=require(_0xfa8b('0x7'));var sox=require('sox');var csv=require(_0xfa8b('0x8'));var ejs=require(_0xfa8b('0x9'));var fs=require('fs');var fs_extra=require(_0xfa8b('0xa'));var _=require(_0xfa8b('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xfa8b('0xc'));var deskjs=require(_0xfa8b('0xd'));var toCsv=require(_0xfa8b('0x8'));var querystring=require(_0xfa8b('0xe'));var Papa=require('papaparse');var Redis=require(_0xfa8b('0xf'));var authService=require(_0xfa8b('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xfa8b('0x11'));var hardwareService=require(_0xfa8b('0x12'));var logger=require(_0xfa8b('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xfa8b('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xfa8b('0x15'))['db'];function respondWithStatusCode(_0x5934b6,_0x2f891f){_0x2f891f=_0x2f891f||0xcc;return function(_0x5f4142){if(_0x5f4142){return _0x5934b6['sendStatus'](_0x2f891f);}return _0x5934b6[_0xfa8b('0x16')](_0x2f891f)['end']();};}function respondWithResult(_0x12e0dd,_0x1febd1){_0x1febd1=_0x1febd1||0xc8;return function(_0x4afd00){if(_0x4afd00){return _0x12e0dd[_0xfa8b('0x16')](_0x1febd1)[_0xfa8b('0x17')](_0x4afd00);}};}function respondWithFilteredResult(_0x5a5fa1,_0x4e7b8f){return function(_0x50cb12){if(_0x50cb12){var _0x3ed057=typeof _0x4e7b8f[_0xfa8b('0x18')]===_0xfa8b('0x19')&&typeof _0x4e7b8f['limit']===_0xfa8b('0x19');var _0x3e0882=_0x50cb12[_0xfa8b('0x1a')];var _0x3c4397=_0x3ed057?0x0:_0x4e7b8f[_0xfa8b('0x18')];var _0x4db6f6=_0x3ed057?_0x50cb12[_0xfa8b('0x1a')]:_0x4e7b8f[_0xfa8b('0x18')]+_0x4e7b8f[_0xfa8b('0x1b')];var _0x2628ef;if(_0x4db6f6>=_0x3e0882){_0x4db6f6=_0x3e0882;_0x2628ef=0xc8;}else{_0x2628ef=0xce;}_0x5a5fa1[_0xfa8b('0x16')](_0x2628ef);return _0x5a5fa1['set'](_0xfa8b('0x1c'),_0x3c4397+'-'+_0x4db6f6+'/'+_0x3e0882)[_0xfa8b('0x17')](_0x50cb12);}return null;};}function patchUpdates(_0x34d284){return function(_0x4b1af0){try{jsonpatch[_0xfa8b('0x1d')](_0x4b1af0,_0x34d284,!![]);}catch(_0x4641a7){return BPromise[_0xfa8b('0x1e')](_0x4641a7);}return _0x4b1af0['save']();};}function saveUpdates(_0x320f60,_0x307499){return function(_0x955222){if(_0x955222){return _0x955222[_0xfa8b('0x1f')](_0x320f60)['then'](function(_0x35cf5b){return _0x35cf5b;});}return null;};}function removeEntity(_0x1a2b32,_0x346797){return function(_0x4936aa){if(_0x4936aa){return _0x4936aa[_0xfa8b('0x20')]()[_0xfa8b('0x21')](function(){var _0x370cae=_0x4936aa[_0xfa8b('0x22')]({'plain':!![]});var _0x162ff9=_0xfa8b('0x23');return db[_0xfa8b('0x24')][_0xfa8b('0x20')]({'where':{'type':_0x162ff9,'resourceId':_0x370cae['id']}})[_0xfa8b('0x21')](function(){return _0x4936aa;});})[_0xfa8b('0x21')](function(){_0x1a2b32['status'](0xcc)[_0xfa8b('0x25')]();});}};}function handleEntityNotFound(_0x3e12c4,_0x2b60da){return function(_0xa5c3a8){if(!_0xa5c3a8){_0x3e12c4[_0xfa8b('0x26')](0x194);}return _0xa5c3a8;};}function handleError(_0x55b3e3,_0x1659fa){_0x1659fa=_0x1659fa||0x1f4;return function(_0x1e08c9){logger['error'](_0x1e08c9[_0xfa8b('0x27')]);if(_0x1e08c9[_0xfa8b('0x28')]){delete _0x1e08c9['name'];}_0x55b3e3[_0xfa8b('0x16')](_0x1659fa)[_0xfa8b('0x29')](_0x1e08c9);};}exports[_0xfa8b('0x2a')]=function(_0x69834e,_0x2e3cc0){var _0x697f1b={},_0x118336={},_0x26d4d9={'count':0x0,'rows':[]};var _0x299f98=_[_0xfa8b('0x2b')](db[_0xfa8b('0x2c')]['rawAttributes'],function(_0x5e6462){return{'name':_0x5e6462['fieldName'],'type':_0x5e6462[_0xfa8b('0x2d')][_0xfa8b('0x2e')]};});_0x118336[_0xfa8b('0x2f')]=_[_0xfa8b('0x2b')](_0x299f98,_0xfa8b('0x28'));_0x118336[_0xfa8b('0x30')]=_['keys'](_0x69834e[_0xfa8b('0x30')]);_0x118336['filters']=_['intersection'](_0x118336[_0xfa8b('0x2f')],_0x118336[_0xfa8b('0x30')]);_0x697f1b['attributes']=_['intersection'](_0x118336[_0xfa8b('0x2f')],qs[_0xfa8b('0x31')](_0x69834e[_0xfa8b('0x30')][_0xfa8b('0x31')]));_0x697f1b[_0xfa8b('0x32')]=_0x697f1b['attributes'][_0xfa8b('0x33')]?_0x697f1b[_0xfa8b('0x32')]:_0x118336[_0xfa8b('0x2f')];if(!_0x69834e[_0xfa8b('0x30')][_0xfa8b('0x34')](_0xfa8b('0x35'))){_0x697f1b[_0xfa8b('0x1b')]=qs[_0xfa8b('0x1b')](_0x69834e[_0xfa8b('0x30')]['limit']);_0x697f1b[_0xfa8b('0x18')]=qs[_0xfa8b('0x18')](_0x69834e['query'][_0xfa8b('0x18')]);}_0x697f1b[_0xfa8b('0x36')]=qs['sort'](_0x69834e[_0xfa8b('0x30')][_0xfa8b('0x37')]);_0x697f1b[_0xfa8b('0x38')]=qs[_0xfa8b('0x39')](_[_0xfa8b('0x3a')](_0x69834e['query'],_0x118336[_0xfa8b('0x39')]),_0x299f98);if(_0x69834e[_0xfa8b('0x30')]['filter']){_0x697f1b[_0xfa8b('0x38')]=_['merge'](_0x697f1b[_0xfa8b('0x38')],{'$or':_['map'](_0x299f98,function(_0x57c839){if(_0x57c839['type']!==_0xfa8b('0x3b')){var _0x3ee7a8={};_0x3ee7a8[_0x57c839[_0xfa8b('0x28')]]={'$like':'%'+_0x69834e[_0xfa8b('0x30')][_0xfa8b('0x3c')]+'%'};return _0x3ee7a8;}})});}_0x697f1b=_[_0xfa8b('0x3d')]({},_0x697f1b,_0x69834e[_0xfa8b('0x3e')]);var _0x25c84a={'where':_0x697f1b['where']};return db[_0xfa8b('0x2c')][_0xfa8b('0x1a')](_0x25c84a)[_0xfa8b('0x21')](function(_0x54a8e1){_0x26d4d9[_0xfa8b('0x1a')]=_0x54a8e1;if(_0x69834e['query'][_0xfa8b('0x3f')]){_0x697f1b['include']=[{'all':!![]}];}return db[_0xfa8b('0x2c')][_0xfa8b('0x40')](_0x697f1b);})[_0xfa8b('0x21')](function(_0x5bc97e){_0x26d4d9[_0xfa8b('0x41')]=_0x5bc97e;return _0x26d4d9;})[_0xfa8b('0x21')](respondWithFilteredResult(_0x2e3cc0,_0x697f1b))[_0xfa8b('0x42')](handleError(_0x2e3cc0,null));};exports[_0xfa8b('0x43')]=function(_0x2edce2,_0x1421ee){var _0x399c2b={'raw':!![],'where':{'id':_0x2edce2[_0xfa8b('0x44')]['id']}},_0x5d9a7e={};_0x5d9a7e[_0xfa8b('0x2f')]=_['keys'](db[_0xfa8b('0x2c')][_0xfa8b('0x45')]);_0x5d9a7e['query']=_[_0xfa8b('0x46')](_0x2edce2[_0xfa8b('0x30')]);_0x5d9a7e[_0xfa8b('0x39')]=_[_0xfa8b('0x47')](_0x5d9a7e[_0xfa8b('0x2f')],_0x5d9a7e[_0xfa8b('0x30')]);_0x399c2b[_0xfa8b('0x32')]=_[_0xfa8b('0x47')](_0x5d9a7e[_0xfa8b('0x2f')],qs[_0xfa8b('0x31')](_0x2edce2[_0xfa8b('0x30')][_0xfa8b('0x31')]));_0x399c2b['attributes']=_0x399c2b[_0xfa8b('0x32')][_0xfa8b('0x33')]?_0x399c2b['attributes']:_0x5d9a7e[_0xfa8b('0x2f')];if(_0x2edce2[_0xfa8b('0x30')][_0xfa8b('0x3f')]){_0x399c2b[_0xfa8b('0x48')]=[{'all':!![]}];}_0x399c2b=_[_0xfa8b('0x3d')]({},_0x399c2b,_0x2edce2[_0xfa8b('0x3e')]);return db[_0xfa8b('0x2c')][_0xfa8b('0x49')](_0x399c2b)[_0xfa8b('0x21')](handleEntityNotFound(_0x1421ee,null))['then'](respondWithResult(_0x1421ee,null))[_0xfa8b('0x42')](handleError(_0x1421ee,null));};exports[_0xfa8b('0x4a')]=function(_0x45bedd,_0x53796f){return db[_0xfa8b('0x2c')][_0xfa8b('0x4a')](_0x45bedd[_0xfa8b('0x4b')],{})[_0xfa8b('0x21')](function(_0x39751b){var _0x4ac480=_0x45bedd[_0xfa8b('0x4c')][_0xfa8b('0x22')]({'plain':!![]});if(!_0x4ac480)throw new Error(_0xfa8b('0x4d'));if(_0x4ac480[_0xfa8b('0x4e')]===_0xfa8b('0x4c')){var _0x35305f=_0x39751b['get']({'plain':!![]});var _0x5e0ebb=_0xfa8b('0x23');return db['UserProfileSection'][_0xfa8b('0x49')]({'where':{'name':_0x5e0ebb,'userProfileId':_0x4ac480[_0xfa8b('0x4f')]},'raw':!![]})['then'](function(_0x396a14){if(_0x396a14&&_0x396a14[_0xfa8b('0x50')]===0x0){return db['UserProfileResource']['create']({'name':_0x35305f[_0xfa8b('0x28')],'resourceId':_0x35305f['id'],'type':_0x396a14[_0xfa8b('0x28')],'sectionId':_0x396a14['id']},{})['then'](function(){return _0x39751b;});}else{return _0x39751b;}})[_0xfa8b('0x42')](function(_0x5abe7f){logger[_0xfa8b('0x51')](_0xfa8b('0x52'),_0x5abe7f);throw _0x5abe7f;});}return _0x39751b;})[_0xfa8b('0x21')](respondWithResult(_0x53796f,0xc9))['catch'](handleError(_0x53796f,null));};exports[_0xfa8b('0x1f')]=function(_0x539b62,_0x1691b7){if(_0x539b62['body']['id']){delete _0x539b62['body']['id'];}return db[_0xfa8b('0x2c')]['find']({'where':{'id':_0x539b62['params']['id']}})[_0xfa8b('0x21')](handleEntityNotFound(_0x1691b7,null))[_0xfa8b('0x21')](saveUpdates(_0x539b62[_0xfa8b('0x4b')],null))['then'](respondWithResult(_0x1691b7,null))[_0xfa8b('0x42')](handleError(_0x1691b7,null));};exports['destroy']=function(_0x5a25d0,_0x1b54d7){return db['Disposition'][_0xfa8b('0x49')]({'where':{'id':_0x5a25d0[_0xfa8b('0x44')]['id']}})[_0xfa8b('0x21')](handleEntityNotFound(_0x1b54d7,null))[_0xfa8b('0x21')](removeEntity(_0x1b54d7,null))[_0xfa8b('0x42')](handleError(_0x1b54d7,null));}; \ No newline at end of file +var _0xa54c=['send','index','map','Disposition','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','params','rawAttributes','include','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Dispositions','userProfileId','catch','find','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','UserProfileResource','error','stack','name'];(function(_0x24289c,_0x388286){var _0x334fa5=function(_0x5c92e9){while(--_0x5c92e9){_0x24289c['push'](_0x24289c['shift']());}};_0x334fa5(++_0x388286);}(_0xa54c,0xcf));var _0xca54=function(_0x286726,_0x20a337){_0x286726=_0x286726-0x0;var _0xcd4fe9=_0xa54c[_0x286726];return _0xcd4fe9;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xca54('0x0'));var jsonpatch=require(_0xca54('0x1'));var rp=require('request-promise');var moment=require(_0xca54('0x2'));var BPromise=require(_0xca54('0x3'));var Mustache=require('mustache');var util=require(_0xca54('0x4'));var path=require(_0xca54('0x5'));var sox=require(_0xca54('0x6'));var csv=require(_0xca54('0x7'));var ejs=require(_0xca54('0x8'));var fs=require('fs');var fs_extra=require(_0xca54('0x9'));var _=require('lodash');var squel=require(_0xca54('0xa'));var crypto=require(_0xca54('0xb'));var jsforce=require(_0xca54('0xc'));var deskjs=require(_0xca54('0xd'));var toCsv=require(_0xca54('0x7'));var querystring=require('querystring');var Papa=require(_0xca54('0xe'));var Redis=require('ioredis');var authService=require(_0xca54('0xf'));var qs=require(_0xca54('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xca54('0x11'));var logger=require(_0xca54('0x12'))(_0xca54('0x13'));var utils=require(_0xca54('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xca54('0x15'));var db=require(_0xca54('0x16'))['db'];function respondWithStatusCode(_0xb0bc92,_0x3c017c){_0x3c017c=_0x3c017c||0xcc;return function(_0x1bb552){if(_0x1bb552){return _0xb0bc92[_0xca54('0x17')](_0x3c017c);}return _0xb0bc92[_0xca54('0x18')](_0x3c017c)[_0xca54('0x19')]();};}function respondWithResult(_0x51afc2,_0x5097ef){_0x5097ef=_0x5097ef||0xc8;return function(_0x3bf69c){if(_0x3bf69c){return _0x51afc2[_0xca54('0x18')](_0x5097ef)[_0xca54('0x1a')](_0x3bf69c);}};}function respondWithFilteredResult(_0x36fa4c,_0x3f9e05){return function(_0x335fa0){if(_0x335fa0){var _0x5bf530=typeof _0x3f9e05[_0xca54('0x1b')]===_0xca54('0x1c')&&typeof _0x3f9e05[_0xca54('0x1d')]===_0xca54('0x1c');var _0x45125c=_0x335fa0[_0xca54('0x1e')];var _0x430417=_0x5bf530?0x0:_0x3f9e05[_0xca54('0x1b')];var _0x39b15f=_0x5bf530?_0x335fa0['count']:_0x3f9e05[_0xca54('0x1b')]+_0x3f9e05['limit'];var _0x266026;if(_0x39b15f>=_0x45125c){_0x39b15f=_0x45125c;_0x266026=0xc8;}else{_0x266026=0xce;}_0x36fa4c['status'](_0x266026);return _0x36fa4c[_0xca54('0x1f')](_0xca54('0x20'),_0x430417+'-'+_0x39b15f+'/'+_0x45125c)[_0xca54('0x1a')](_0x335fa0);}return null;};}function patchUpdates(_0x544019){return function(_0x57c781){try{jsonpatch[_0xca54('0x21')](_0x57c781,_0x544019,!![]);}catch(_0x33d0b1){return BPromise['reject'](_0x33d0b1);}return _0x57c781[_0xca54('0x22')]();};}function saveUpdates(_0x506613,_0x493a3f){return function(_0x34e042){if(_0x34e042){return _0x34e042[_0xca54('0x23')](_0x506613)[_0xca54('0x24')](function(_0x344062){return _0x344062;});}return null;};}function removeEntity(_0x22c9d7,_0x3873e4){return function(_0x475ca6){if(_0x475ca6){return _0x475ca6[_0xca54('0x25')]()['then'](function(){var _0x10cd7e=_0x475ca6['get']({'plain':!![]});var _0x36cf0a='Dispositions';return db[_0xca54('0x26')][_0xca54('0x25')]({'where':{'type':_0x36cf0a,'resourceId':_0x10cd7e['id']}})[_0xca54('0x24')](function(){return _0x475ca6;});})[_0xca54('0x24')](function(){_0x22c9d7[_0xca54('0x18')](0xcc)[_0xca54('0x19')]();});}};}function handleEntityNotFound(_0x25794a,_0x5ddfc1){return function(_0x4bfe17){if(!_0x4bfe17){_0x25794a[_0xca54('0x17')](0x194);}return _0x4bfe17;};}function handleError(_0x267681,_0x41377b){_0x41377b=_0x41377b||0x1f4;return function(_0x5ccf80){logger[_0xca54('0x27')](_0x5ccf80[_0xca54('0x28')]);if(_0x5ccf80['name']){delete _0x5ccf80[_0xca54('0x29')];}_0x267681[_0xca54('0x18')](_0x41377b)[_0xca54('0x2a')](_0x5ccf80);};}exports[_0xca54('0x2b')]=function(_0x90ea71,_0x37144f){var _0x485860={},_0x4da97a={},_0x4c2180={'count':0x0,'rows':[]};var _0x3f4b7f=_[_0xca54('0x2c')](db[_0xca54('0x2d')]['rawAttributes'],function(_0x356afa){return{'name':_0x356afa[_0xca54('0x2e')],'type':_0x356afa[_0xca54('0x2f')][_0xca54('0x30')]};});_0x4da97a[_0xca54('0x31')]=_[_0xca54('0x2c')](_0x3f4b7f,'name');_0x4da97a[_0xca54('0x32')]=_[_0xca54('0x33')](_0x90ea71[_0xca54('0x32')]);_0x4da97a[_0xca54('0x34')]=_[_0xca54('0x35')](_0x4da97a['model'],_0x4da97a['query']);_0x485860[_0xca54('0x36')]=_[_0xca54('0x35')](_0x4da97a['model'],qs[_0xca54('0x37')](_0x90ea71[_0xca54('0x32')][_0xca54('0x37')]));_0x485860[_0xca54('0x36')]=_0x485860[_0xca54('0x36')][_0xca54('0x38')]?_0x485860[_0xca54('0x36')]:_0x4da97a['model'];if(!_0x90ea71[_0xca54('0x32')][_0xca54('0x39')](_0xca54('0x3a'))){_0x485860['limit']=qs[_0xca54('0x1d')](_0x90ea71[_0xca54('0x32')][_0xca54('0x1d')]);_0x485860[_0xca54('0x1b')]=qs['offset'](_0x90ea71['query'][_0xca54('0x1b')]);}_0x485860[_0xca54('0x3b')]=qs[_0xca54('0x3c')](_0x90ea71['query'][_0xca54('0x3c')]);_0x485860[_0xca54('0x3d')]=qs['filters'](_[_0xca54('0x3e')](_0x90ea71[_0xca54('0x32')],_0x4da97a['filters']),_0x3f4b7f);if(_0x90ea71[_0xca54('0x32')][_0xca54('0x3f')]){_0x485860[_0xca54('0x3d')]=_[_0xca54('0x40')](_0x485860['where'],{'$or':_[_0xca54('0x2c')](_0x3f4b7f,function(_0x35c72f){if(_0x35c72f['type']!==_0xca54('0x41')){var _0x18cccb={};_0x18cccb[_0x35c72f['name']]={'$like':'%'+_0x90ea71[_0xca54('0x32')]['filter']+'%'};return _0x18cccb;}})});}_0x485860=_['merge']({},_0x485860,_0x90ea71[_0xca54('0x42')]);var _0x4a7766={'where':_0x485860[_0xca54('0x3d')]};return db[_0xca54('0x2d')][_0xca54('0x1e')](_0x4a7766)[_0xca54('0x24')](function(_0x4c527c){_0x4c2180['count']=_0x4c527c;if(_0x90ea71[_0xca54('0x32')][_0xca54('0x43')]){_0x485860['include']=[{'all':!![]}];}return db['Disposition'][_0xca54('0x44')](_0x485860);})['then'](function(_0x1f213c){_0x4c2180[_0xca54('0x45')]=_0x1f213c;return _0x4c2180;})['then'](respondWithFilteredResult(_0x37144f,_0x485860))['catch'](handleError(_0x37144f,null));};exports['show']=function(_0x591691,_0x1877ae){var _0x3fa53d={'raw':!![],'where':{'id':_0x591691[_0xca54('0x46')]['id']}},_0x4e44fc={};_0x4e44fc[_0xca54('0x31')]=_[_0xca54('0x33')](db[_0xca54('0x2d')][_0xca54('0x47')]);_0x4e44fc[_0xca54('0x32')]=_[_0xca54('0x33')](_0x591691['query']);_0x4e44fc[_0xca54('0x34')]=_['intersection'](_0x4e44fc[_0xca54('0x31')],_0x4e44fc[_0xca54('0x32')]);_0x3fa53d[_0xca54('0x36')]=_['intersection'](_0x4e44fc[_0xca54('0x31')],qs[_0xca54('0x37')](_0x591691[_0xca54('0x32')][_0xca54('0x37')]));_0x3fa53d[_0xca54('0x36')]=_0x3fa53d['attributes'][_0xca54('0x38')]?_0x3fa53d[_0xca54('0x36')]:_0x4e44fc[_0xca54('0x31')];if(_0x591691['query'][_0xca54('0x43')]){_0x3fa53d[_0xca54('0x48')]=[{'all':!![]}];}_0x3fa53d=_[_0xca54('0x40')]({},_0x3fa53d,_0x591691[_0xca54('0x42')]);return db['Disposition']['find'](_0x3fa53d)[_0xca54('0x24')](handleEntityNotFound(_0x1877ae,null))[_0xca54('0x24')](respondWithResult(_0x1877ae,null))['catch'](handleError(_0x1877ae,null));};exports[_0xca54('0x49')]=function(_0x45077d,_0x35a6a5){return db[_0xca54('0x2d')][_0xca54('0x49')](_0x45077d[_0xca54('0x4a')],{})[_0xca54('0x24')](function(_0x243504){var _0x401382=_0x45077d[_0xca54('0x4b')][_0xca54('0x4c')]({'plain':!![]});if(!_0x401382)throw new Error(_0xca54('0x4d'));if(_0x401382[_0xca54('0x4e')]==='user'){var _0x68ca33=_0x243504[_0xca54('0x4c')]({'plain':!![]});var _0x575d9c=_0xca54('0x4f');return db['UserProfileSection']['find']({'where':{'name':_0x575d9c,'userProfileId':_0x401382[_0xca54('0x50')]},'raw':!![]})[_0xca54('0x24')](function(_0x37f579){if(_0x37f579&&_0x37f579['autoAssociation']===0x0){return db[_0xca54('0x26')][_0xca54('0x49')]({'name':_0x68ca33['name'],'resourceId':_0x68ca33['id'],'type':_0x37f579['name'],'sectionId':_0x37f579['id']},{})[_0xca54('0x24')](function(){return _0x243504;});}else{return _0x243504;}})['catch'](function(_0x56de7e){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x56de7e);throw _0x56de7e;});}return _0x243504;})['then'](respondWithResult(_0x35a6a5,0xc9))[_0xca54('0x51')](handleError(_0x35a6a5,null));};exports[_0xca54('0x23')]=function(_0x1172a2,_0x46a3f9){if(_0x1172a2['body']['id']){delete _0x1172a2['body']['id'];}return db['Disposition'][_0xca54('0x52')]({'where':{'id':_0x1172a2['params']['id']}})[_0xca54('0x24')](handleEntityNotFound(_0x46a3f9,null))[_0xca54('0x24')](saveUpdates(_0x1172a2[_0xca54('0x4a')],null))[_0xca54('0x24')](respondWithResult(_0x46a3f9,null))['catch'](handleError(_0x46a3f9,null));};exports['destroy']=function(_0x257186,_0x5cf5dd){return db['Disposition'][_0xca54('0x52')]({'where':{'id':_0x257186[_0xca54('0x46')]['id']}})[_0xca54('0x24')](handleEntityNotFound(_0x5cf5dd,null))[_0xca54('0x24')](removeEntity(_0x5cf5dd,null))[_0xca54('0x51')](handleError(_0x5cf5dd,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index 5913275..5ac8ebf 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 _0x01ff=['api','bluebird','request-promise','path','rimraf','./disposition.attributes','exports','Disposition','tools_dispositions','name_voice','name','ListId','name_chat','name_sms','SmsAccountId','name_fax','FaxAccountId','OpenchannelAccountId','name_whatsapp','WhatsappAccountId','../../config/logger'];(function(_0x35101c,_0x3fcd72){var _0x1e7512=function(_0x2e364b){while(--_0x2e364b){_0x35101c['push'](_0x35101c['shift']());}};_0x1e7512(++_0x3fcd72);}(_0x01ff,0x125));var _0xf01f=function(_0x238235,_0x826021){_0x238235=_0x238235-0x0;var _0x179d70=_0x01ff[_0x238235];return _0x179d70;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf01f('0x0'))(_0xf01f('0x1'));var moment=require('moment');var BPromise=require(_0xf01f('0x2'));var rp=require(_0xf01f('0x3'));var fs=require('fs');var path=require(_0xf01f('0x4'));var rimraf=require(_0xf01f('0x5'));var config=require('../../config/environment');var attributes=require(_0xf01f('0x6'));module[_0xf01f('0x7')]=function(_0xb62e,_0x4b9c17){return _0xb62e['define'](_0xf01f('0x8'),attributes,{'tableName':_0xf01f('0x9'),'paranoid':![],'indexes':[{'unique':!![],'name':_0xf01f('0xa'),'fields':[_0xf01f('0xb'),_0xf01f('0xc')]},{'unique':!![],'name':_0xf01f('0xd'),'fields':[_0xf01f('0xb'),'ChatWebsiteId']},{'unique':!![],'name':'name_mail','fields':[_0xf01f('0xb'),'MailAccountId']},{'unique':!![],'name':_0xf01f('0xe'),'fields':['name',_0xf01f('0xf')]},{'unique':!![],'name':_0xf01f('0x10'),'fields':['name',_0xf01f('0x11')]},{'unique':!![],'name':'name_openchannel','fields':['name',_0xf01f('0x12')]},{'unique':!![],'name':_0xf01f('0x13'),'fields':[_0xf01f('0xb'),_0xf01f('0x14')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9c26=['name_voice','name','name_chat','ChatWebsiteId','name_mail','name_sms','SmsAccountId','name_fax','FaxAccountId','name_openchannel','OpenchannelAccountId','name_whatsapp','WhatsappAccountId','../../config/logger','moment','bluebird','rimraf','./disposition.attributes','define','tools_dispositions'];(function(_0x5eacf6,_0x174135){var _0x1f68a1=function(_0x5277bb){while(--_0x5277bb){_0x5eacf6['push'](_0x5eacf6['shift']());}};_0x1f68a1(++_0x174135);}(_0x9c26,0x111));var _0x69c2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9c26[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x69c2('0x0'))('api');var moment=require(_0x69c2('0x1'));var BPromise=require(_0x69c2('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x69c2('0x3'));var config=require('../../config/environment');var attributes=require(_0x69c2('0x4'));module['exports']=function(_0x428f42,_0x5bb3ff){return _0x428f42[_0x69c2('0x5')]('Disposition',attributes,{'tableName':_0x69c2('0x6'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x69c2('0x7'),'fields':[_0x69c2('0x8'),'ListId']},{'unique':!![],'name':_0x69c2('0x9'),'fields':[_0x69c2('0x8'),_0x69c2('0xa')]},{'unique':!![],'name':_0x69c2('0xb'),'fields':[_0x69c2('0x8'),'MailAccountId']},{'unique':!![],'name':_0x69c2('0xc'),'fields':[_0x69c2('0x8'),_0x69c2('0xd')]},{'unique':!![],'name':_0x69c2('0xe'),'fields':['name',_0x69c2('0xf')]},{'unique':!![],'name':_0x69c2('0x10'),'fields':[_0x69c2('0x8'),_0x69c2('0x11')]},{'unique':!![],'name':_0x69c2('0x12'),'fields':[_0x69c2('0x8'),_0x69c2('0x13')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index 13e37b2..ad5b6b5 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(_0x52abb9,_0x328e54){var _0x3ddd67=function(_0x4e6919){while(--_0x4e6919){_0x52abb9['push'](_0x52abb9['shift']());}};_0x3ddd67(++_0x328e54);}(_0xa9e0,0x123));var _0x0a9e=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xa9e0[_0x40ac5e];return _0x2839d6;};'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(_0xfdb4e5,_0x20f58f){var _0x107fb5=function(_0x252788){while(--_0x252788){_0xfdb4e5['push'](_0xfdb4e5['shift']());}};_0x107fb5(++_0x20f58f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xa9e0[_0x4baae2];return _0x1a2285;};'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 d45c871..7ab3ce2 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 _0xb62a=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./disposition.controller','get','isAuthenticated','index','/:id','post','create','update','delete','destroy','exports'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xb62a,0x1a2));var _0xab62=function(_0x57645e,_0x5ba81e){_0x57645e=_0x57645e-0x0;var _0x10ad92=_0xb62a[_0x57645e];return _0x10ad92;};'use strict';var multer=require(_0xab62('0x0'));var util=require(_0xab62('0x1'));var path=require(_0xab62('0x2'));var timeout=require(_0xab62('0x3'));var express=require('express');var router=express[_0xab62('0x4')]();var fs_extra=require(_0xab62('0x5'));var auth=require(_0xab62('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xab62('0x7'));var controller=require(_0xab62('0x8'));router[_0xab62('0x9')]('/',auth[_0xab62('0xa')](),controller[_0xab62('0xb')]);router[_0xab62('0x9')](_0xab62('0xc'),auth[_0xab62('0xa')](),controller['show']);router[_0xab62('0xd')]('/',auth[_0xab62('0xa')](),controller[_0xab62('0xe')]);router['put'](_0xab62('0xc'),auth['isAuthenticated'](),controller[_0xab62('0xf')]);router[_0xab62('0x10')](_0xab62('0xc'),auth[_0xab62('0xa')](),controller[_0xab62('0x11')]);module[_0xab62('0x12')]=router; \ No newline at end of file +var _0x07a2=['./disposition.controller','get','isAuthenticated','/:id','post','create','put','update','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x1696b9,_0x2e3ee4){var _0x1e9de8=function(_0x4c06a3){while(--_0x4c06a3){_0x1696b9['push'](_0x1696b9['shift']());}};_0x1e9de8(++_0x2e3ee4);}(_0x07a2,0xac));var _0x207a=function(_0x14e9f0,_0x287f90){_0x14e9f0=_0x14e9f0-0x0;var _0xa63f7e=_0x07a2[_0x14e9f0];return _0xa63f7e;};'use strict';var multer=require('multer');var util=require(_0x207a('0x0'));var path=require(_0x207a('0x1'));var timeout=require('connect-timeout');var express=require(_0x207a('0x2'));var router=express[_0x207a('0x3')]();var fs_extra=require(_0x207a('0x4'));var auth=require(_0x207a('0x5'));var interaction=require(_0x207a('0x6'));var config=require(_0x207a('0x7'));var controller=require(_0x207a('0x8'));router[_0x207a('0x9')]('/',auth[_0x207a('0xa')](),controller['index']);router[_0x207a('0x9')](_0x207a('0xb'),auth[_0x207a('0xa')](),controller['show']);router[_0x207a('0xc')]('/',auth[_0x207a('0xa')](),controller[_0x207a('0xd')]);router[_0x207a('0xe')](_0x207a('0xb'),auth[_0x207a('0xa')](),controller[_0x207a('0xf')]);router['delete'](_0x207a('0xb'),auth[_0x207a('0xa')](),controller[_0x207a('0x10')]);module[_0x207a('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 b35579c..022326e 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 _0xa23f=['ENUM','yes','STRING','2400','4800','7200','12000','14400','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','mandatoryDisposition','sequelize','exports'];(function(_0x142156,_0x5169f8){var _0x5b1ea3=function(_0x26080b){while(--_0x26080b){_0x142156['push'](_0x142156['shift']());}};_0x5b1ea3(++_0x5169f8);}(_0xa23f,0x7c));var _0xfa23=function(_0x44f6b3,_0x189af6){_0x44f6b3=_0x44f6b3-0x0;var _0x397e29=_0xa23f[_0x44f6b3];return _0x397e29;};'use strict';var Sequelize=require(_0xfa23('0x0'));module[_0xfa23('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'ecm':{'type':Sequelize[_0xfa23('0x2')](_0xfa23('0x3'),'no'),'defaultValue':_0xfa23('0x3')},'headerinfo':{'type':Sequelize[_0xfa23('0x4')],'defaultValue':'xCALLY\x20Motion\x20Fax'},'localstationid':{'type':Sequelize[_0xfa23('0x4')],'unique':'localstationid'},'minrate':{'type':Sequelize[_0xfa23('0x2')](_0xfa23('0x5'),_0xfa23('0x6'),_0xfa23('0x7'),'9600',_0xfa23('0x8'),'14400'),'defaultValue':_0xfa23('0x6')},'maxrate':{'type':Sequelize[_0xfa23('0x2')](_0xfa23('0x5'),_0xfa23('0x6'),_0xfa23('0x7'),'9600','12000',_0xfa23('0x9')),'defaultValue':'14400'},'modem':{'type':Sequelize[_0xfa23('0x4')],'defaultValue':'v17,v27,v29'},'gateway':{'type':Sequelize[_0xfa23('0x4')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0xfa23('0x4')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0xfa23('0xa')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize['ENUM'](_0xfa23('0xb'),_0xfa23('0xc'),_0xfa23('0xd'),'KHOMP'),'defaultValue':'SIP'},'key':{'type':Sequelize[_0xfa23('0x4')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xfa23('0xe')],'defaultValue':function(){return _0xfa23('0xf');}},'notificationSound':{'type':Sequelize[_0xfa23('0x10')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xfa23('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xfa23('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xfa23('0x10')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xfa23('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xfa23('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xfa23('0xa')],'allowNull':!![],'defaultValue':null,'comment':_0xfa23('0x11')},'mandatoryDisposition':{'type':Sequelize[_0xfa23('0x10')],'defaultValue':![],'comment':_0xfa23('0x12'),'set':function(_0x4e5b77){if(!_0x4e5b77)this['setDataValue']('mandatoryDispositionPauseId',null);this[_0xfa23('0x13')](_0xfa23('0x14'),_0x4e5b77);}}}; \ No newline at end of file +var _0x71ab=['SIP','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','exports','STRING','yes','xCALLY\x20Motion\x20Fax','localstationid','ENUM','2400','4800','7200','9600','12000','14400','v17,v27,v29','DADHI','KHOMP'];(function(_0x1fe503,_0x6e1361){var _0x13740c=function(_0x32f783){while(--_0x32f783){_0x1fe503['push'](_0x1fe503['shift']());}};_0x13740c(++_0x6e1361);}(_0x71ab,0x64));var _0xb71a=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x71ab[_0x13d07a];return _0x5ee0ee;};'use strict';var Sequelize=require('sequelize');module[_0xb71a('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xb71a('0x1')]},'ecm':{'type':Sequelize['ENUM'](_0xb71a('0x2'),'no'),'defaultValue':_0xb71a('0x2')},'headerinfo':{'type':Sequelize[_0xb71a('0x1')],'defaultValue':_0xb71a('0x3')},'localstationid':{'type':Sequelize[_0xb71a('0x1')],'unique':_0xb71a('0x4')},'minrate':{'type':Sequelize[_0xb71a('0x5')](_0xb71a('0x6'),_0xb71a('0x7'),_0xb71a('0x8'),_0xb71a('0x9'),_0xb71a('0xa'),_0xb71a('0xb')),'defaultValue':_0xb71a('0x7')},'maxrate':{'type':Sequelize[_0xb71a('0x5')](_0xb71a('0x6'),_0xb71a('0x7'),_0xb71a('0x8'),'9600',_0xb71a('0xa'),'14400'),'defaultValue':_0xb71a('0xb')},'modem':{'type':Sequelize[_0xb71a('0x1')],'defaultValue':_0xb71a('0xc')},'gateway':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0xb71a('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0xb71a('0x5')]('SIP','IAX',_0xb71a('0xd'),_0xb71a('0xe')),'defaultValue':_0xb71a('0xf')},'key':{'type':Sequelize[_0xb71a('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xb71a('0x10')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xb71a('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xb71a('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xb71a('0x10')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xb71a('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xb71a('0x10')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xb71a('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xb71a('0x11')],'allowNull':!![],'defaultValue':null,'comment':_0xb71a('0x12')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xb71a('0x13'),'set':function(_0x2d6369){if(!_0x2d6369)this[_0xb71a('0x14')](_0xb71a('0x15'),null);this[_0xb71a('0x14')](_0xb71a('0x16'),_0x2d6369);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index 6b325f2..1ae3098 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 _0x5da1=['root','server/files/attachments','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','fax','Contacts','List\x20not\x20found','Send\x20Fax\x20failed','filename','Messages','Contact\x20not\x20found','spread','out','ContactId','dataValues','SendFax','info','SendFaxRpc,\x20%s','addAgents','userFaxAccount:save','removeAgents','isArray','emit','userFaxAccount:remove','getAgents','User','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','then','FaxAccount,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','sendStatus','status','end','json','undefined','count','limit','set','apply','reject','save','update','destroy','UserProfileResource','stack','name','send','Pause','map','FaxAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','offset','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','params','mandatoryDispositionPause','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','FaxAccounts','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','describe','FaxAccountId','Disposition','getDispositions','findOne','order','removeDispositions','ids','CannedAnswer','removeAnswers','addInteraction','FaxInteraction','omit','Contact','Owner','fullname','internal','Tag','Tags','color','tag','transaction','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','FaxApplication','findAndCountAll','priority','finally','getApplications','context','from-voip-provider','exten','localstationid','app','description','Fax\x20Extension','appdata','push','Answer','Set','ecm','maxrate','minrate','modem','t38timeout','FAXOPT(','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','VoiceExtension','bulkCreate','createdAt','updatedAt','TrunkId','ListId','findById','getMessages','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','CmList','List','CmContact','DESC','attachments'];(function(_0x528c55,_0x4667fc){var _0x198df1=function(_0x571d57){while(--_0x571d57){_0x528c55['push'](_0x528c55['shift']());}};_0x198df1(++_0x4667fc);}(_0x5da1,0xe0));var _0x15da=function(_0x6c5bc1,_0x5c0300){_0x6c5bc1=_0x6c5bc1-0x0;var _0x46b127=_0x5da1[_0x6c5bc1];return _0x46b127;};'use strict';var emlformat=require(_0x15da('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x15da('0x1'));var jsonpatch=require(_0x15da('0x2'));var rp=require(_0x15da('0x3'));var moment=require(_0x15da('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x15da('0x5'));var util=require(_0x15da('0x6'));var path=require(_0x15da('0x7'));var sox=require(_0x15da('0x8'));var csv=require('to-csv');var ejs=require(_0x15da('0x9'));var fs=require('fs');var fs_extra=require(_0x15da('0xa'));var _=require(_0x15da('0xb'));var squel=require(_0x15da('0xc'));var crypto=require(_0x15da('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x15da('0xe'));var toCsv=require(_0x15da('0xf'));var querystring=require(_0x15da('0x10'));var Papa=require(_0x15da('0x11'));var Redis=require(_0x15da('0x12'));var authService=require(_0x15da('0x13'));var qs=require(_0x15da('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x15da('0x15'));var logger=require(_0x15da('0x16'))(_0x15da('0x17'));var utils=require(_0x15da('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x15da('0x19'))['db'];config[_0x15da('0x1a')]=_[_0x15da('0x1b')](config[_0x15da('0x1a')],{'host':_0x15da('0x1c'),'port':0x18eb});var socket=require(_0x15da('0x1d'))(new Redis(config[_0x15da('0x1a')]));require('./faxAccount.socket')[_0x15da('0x1e')](socket);var jayson=require(_0x15da('0x1f'));var client=jayson[_0x15da('0x20')]['http']({'port':0x232c});var client9002=jayson['client'][_0x15da('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x508220,_0x1352dd,_0x283452,_0x13d30c){return new BPromise(function(_0x33857d,_0x2f1dd7){var _0x4659c9=_0x13d30c||client;return _0x4659c9['request'](_0x508220,_0x283452)[_0x15da('0x22')](function(_0x352244){logger['info'](_0x15da('0x23'),_0x1352dd,_0x15da('0x24'));logger['debug']('FaxAccount,\x20%s,\x20%s,\x20%s',_0x1352dd,'request\x20sent',JSON['stringify'](_0x352244));if(_0x352244[_0x15da('0x25')]){if(_0x352244[_0x15da('0x25')][_0x15da('0x26')]===0x1f4){logger[_0x15da('0x25')]('FaxAccount,\x20%s,\x20%s',_0x1352dd,_0x352244[_0x15da('0x25')][_0x15da('0x27')]);return _0x2f1dd7(_0x352244[_0x15da('0x25')]['message']);}logger[_0x15da('0x25')](_0x15da('0x23'),_0x1352dd,_0x352244['error'][_0x15da('0x27')]);return _0x33857d(_0x352244['error'][_0x15da('0x27')]);}else{logger['info'](_0x15da('0x23'),_0x1352dd,'request\x20sent');_0x33857d(_0x352244[_0x15da('0x28')][_0x15da('0x27')]);}})[_0x15da('0x29')](function(_0x59384a){logger[_0x15da('0x25')]('FaxAccount,\x20%s,\x20%s',_0x1352dd,_0x59384a);_0x2f1dd7(_0x59384a);});});}function respondWithStatusCode(_0x2e37ab,_0x2637e9){_0x2637e9=_0x2637e9||0xcc;return function(_0x2dd46f){if(_0x2dd46f){return _0x2e37ab[_0x15da('0x2a')](_0x2637e9);}return _0x2e37ab[_0x15da('0x2b')](_0x2637e9)[_0x15da('0x2c')]();};}function respondWithResult(_0x33d322,_0x1b1070){_0x1b1070=_0x1b1070||0xc8;return function(_0x5368fb){if(_0x5368fb){return _0x33d322['status'](_0x1b1070)[_0x15da('0x2d')](_0x5368fb);}};}function respondWithFilteredResult(_0x3a8c9c,_0x42e30d){return function(_0x3879df){if(_0x3879df){var _0x475d31=typeof _0x42e30d['offset']===_0x15da('0x2e')&&typeof _0x42e30d['limit']==='undefined';var _0x207442=_0x3879df[_0x15da('0x2f')];var _0x2b8769=_0x475d31?0x0:_0x42e30d['offset'];var _0x1fcc58=_0x475d31?_0x3879df[_0x15da('0x2f')]:_0x42e30d['offset']+_0x42e30d[_0x15da('0x30')];var _0x5ceaf7;if(_0x1fcc58>=_0x207442){_0x1fcc58=_0x207442;_0x5ceaf7=0xc8;}else{_0x5ceaf7=0xce;}_0x3a8c9c[_0x15da('0x2b')](_0x5ceaf7);return _0x3a8c9c[_0x15da('0x31')]('Content-Range',_0x2b8769+'-'+_0x1fcc58+'/'+_0x207442)[_0x15da('0x2d')](_0x3879df);}return null;};}function patchUpdates(_0x3af123){return function(_0x19000f){try{jsonpatch[_0x15da('0x32')](_0x19000f,_0x3af123,!![]);}catch(_0x175a9f){return BPromise[_0x15da('0x33')](_0x175a9f);}return _0x19000f[_0x15da('0x34')]();};}function saveUpdates(_0x4db925,_0x293b58){return function(_0x4fb543){if(_0x4fb543){return _0x4fb543[_0x15da('0x35')](_0x4db925)[_0x15da('0x22')](function(_0x5efbf4){return _0x5efbf4;});}return null;};}function removeEntity(_0x199e04,_0x111aa4){return function(_0x56b0c9){if(_0x56b0c9){return _0x56b0c9[_0x15da('0x36')]()[_0x15da('0x22')](function(){var _0x4f3397=_0x56b0c9['get']({'plain':!![]});var _0x3351cc='FaxAccounts';return db[_0x15da('0x37')][_0x15da('0x36')]({'where':{'type':_0x3351cc,'resourceId':_0x4f3397['id']}})[_0x15da('0x22')](function(){return _0x56b0c9;});})[_0x15da('0x22')](function(){_0x199e04['status'](0xcc)[_0x15da('0x2c')]();});}};}function handleEntityNotFound(_0x16f8e1,_0x1245f6){return function(_0x13ab7e){if(!_0x13ab7e){_0x16f8e1['sendStatus'](0x194);}return _0x13ab7e;};}function handleError(_0x5793aa,_0x2d351a){_0x2d351a=_0x2d351a||0x1f4;return function(_0x317028){logger[_0x15da('0x25')](_0x317028[_0x15da('0x38')]);if(_0x317028[_0x15da('0x39')]){delete _0x317028['name'];}_0x5793aa[_0x15da('0x2b')](_0x2d351a)[_0x15da('0x3a')](_0x317028);};}exports['index']=function(_0x4b4899,_0x1ec46a){var _0x3fbc0d={'include':[{'model':db[_0x15da('0x3b')],'as':'mandatoryDispositionPause'}]},_0x313c04={},_0x10b962={'count':0x0,'rows':[]};var _0x4cf328=_[_0x15da('0x3c')](db[_0x15da('0x3d')][_0x15da('0x3e')],function(_0x139fa0){return{'name':_0x139fa0[_0x15da('0x3f')],'type':_0x139fa0[_0x15da('0x40')][_0x15da('0x41')]};});_0x313c04[_0x15da('0x42')]=_[_0x15da('0x3c')](_0x4cf328,_0x15da('0x39'));_0x313c04[_0x15da('0x43')]=_[_0x15da('0x44')](_0x4b4899[_0x15da('0x43')]);_0x313c04[_0x15da('0x45')]=_[_0x15da('0x46')](_0x313c04[_0x15da('0x42')],_0x313c04['query']);_0x3fbc0d['attributes']=_['intersection'](_0x313c04[_0x15da('0x42')],qs[_0x15da('0x47')](_0x4b4899['query'][_0x15da('0x47')]));_0x3fbc0d['attributes']=_0x3fbc0d[_0x15da('0x48')][_0x15da('0x49')]?_0x3fbc0d['attributes']:_0x313c04[_0x15da('0x42')];if(!_0x4b4899[_0x15da('0x43')][_0x15da('0x4a')](_0x15da('0x4b'))){_0x3fbc0d[_0x15da('0x30')]=qs[_0x15da('0x30')](_0x4b4899[_0x15da('0x43')][_0x15da('0x30')]);_0x3fbc0d[_0x15da('0x4c')]=qs['offset'](_0x4b4899[_0x15da('0x43')][_0x15da('0x4c')]);}_0x3fbc0d['order']=qs[_0x15da('0x4d')](_0x4b4899['query'][_0x15da('0x4d')]);_0x3fbc0d[_0x15da('0x4e')]=qs[_0x15da('0x45')](_[_0x15da('0x4f')](_0x4b4899[_0x15da('0x43')],_0x313c04[_0x15da('0x45')]),_0x4cf328);if(_0x4b4899[_0x15da('0x43')][_0x15da('0x50')]){_0x3fbc0d[_0x15da('0x4e')]=_[_0x15da('0x51')](_0x3fbc0d[_0x15da('0x4e')],{'$or':_[_0x15da('0x3c')](_0x4cf328,function(_0x1234e8){if(_0x1234e8[_0x15da('0x40')]!=='VIRTUAL'){var _0x14697f={};_0x14697f[_0x1234e8[_0x15da('0x39')]]={'$like':'%'+_0x4b4899[_0x15da('0x43')]['filter']+'%'};return _0x14697f;}})});}_0x3fbc0d=_[_0x15da('0x51')]({},_0x3fbc0d,_0x4b4899[_0x15da('0x52')]);var _0x2b0024={'where':_0x3fbc0d['where']};return db[_0x15da('0x3d')][_0x15da('0x2f')](_0x2b0024)['then'](function(_0x19012d){_0x10b962[_0x15da('0x2f')]=_0x19012d;if(_0x4b4899[_0x15da('0x43')][_0x15da('0x53')]){_0x3fbc0d[_0x15da('0x54')]=[{'all':!![]}];}return db[_0x15da('0x3d')][_0x15da('0x55')](_0x3fbc0d);})[_0x15da('0x22')](function(_0xd96d1d){_0x10b962[_0x15da('0x56')]=_0xd96d1d;return _0x10b962;})['then'](respondWithFilteredResult(_0x1ec46a,_0x3fbc0d))['catch'](handleError(_0x1ec46a,null));};exports['show']=function(_0x205b85,_0x11bdde){var _0x3bd057={'raw':![],'where':{'id':_0x205b85[_0x15da('0x57')]['id']},'include':[{'model':db[_0x15da('0x3b')],'as':_0x15da('0x58')}]},_0x4de4cd={};_0x4de4cd['model']=_[_0x15da('0x44')](db[_0x15da('0x3d')][_0x15da('0x3e')]);_0x4de4cd[_0x15da('0x43')]=_['keys'](_0x205b85[_0x15da('0x43')]);_0x4de4cd[_0x15da('0x45')]=_[_0x15da('0x46')](_0x4de4cd['model'],_0x4de4cd[_0x15da('0x43')]);_0x3bd057['attributes']=_['intersection'](_0x4de4cd[_0x15da('0x42')],qs[_0x15da('0x47')](_0x205b85[_0x15da('0x43')][_0x15da('0x47')]));_0x3bd057[_0x15da('0x48')]=_0x3bd057[_0x15da('0x48')][_0x15da('0x49')]?_0x3bd057[_0x15da('0x48')]:_0x4de4cd[_0x15da('0x42')];if(_0x205b85[_0x15da('0x43')][_0x15da('0x53')]){_0x3bd057[_0x15da('0x54')]=[{'all':!![]}];}_0x3bd057=_['merge']({},_0x3bd057,_0x205b85[_0x15da('0x52')]);return db['FaxAccount']['find'](_0x3bd057)[_0x15da('0x22')](handleEntityNotFound(_0x11bdde,null))['then'](respondWithResult(_0x11bdde,null))[_0x15da('0x29')](handleError(_0x11bdde,null));};exports[_0x15da('0x59')]=function(_0x38102a,_0x4bb170){return db['FaxAccount'][_0x15da('0x59')](_0x38102a[_0x15da('0x5a')],{})['then'](function(_0x37f5e5){var _0xbff44=_0x38102a['user'][_0x15da('0x5b')]({'plain':!![]});if(!_0xbff44)throw new Error(_0x15da('0x5c'));if(_0xbff44['role']===_0x15da('0x5d')){var _0x3bfc2b=_0x37f5e5[_0x15da('0x5b')]({'plain':!![]});var _0x3d8d4f=_0x15da('0x5e');return db[_0x15da('0x5f')]['find']({'where':{'name':_0x3d8d4f,'userProfileId':_0xbff44[_0x15da('0x60')]},'raw':!![]})[_0x15da('0x22')](function(_0x550d97){if(_0x550d97&&_0x550d97[_0x15da('0x61')]===0x0){return db[_0x15da('0x37')][_0x15da('0x59')]({'name':_0x3bfc2b[_0x15da('0x39')],'resourceId':_0x3bfc2b['id'],'type':_0x550d97['name'],'sectionId':_0x550d97['id']},{})['then'](function(){return _0x37f5e5;});}else{return _0x37f5e5;}})['catch'](function(_0x4af211){logger['error'](_0x15da('0x62'),_0x4af211);throw _0x4af211;});}return _0x37f5e5;})['then'](respondWithResult(_0x4bb170,0xc9))[_0x15da('0x29')](handleError(_0x4bb170,null));};exports[_0x15da('0x35')]=function(_0x16825f,_0x345d0b){if(_0x16825f['body']['id']){delete _0x16825f[_0x15da('0x5a')]['id'];}return db[_0x15da('0x3d')][_0x15da('0x63')]({'where':{'id':_0x16825f['params']['id']},'include':[{'model':db[_0x15da('0x3b')],'as':'mandatoryDispositionPause'}]})[_0x15da('0x22')](handleEntityNotFound(_0x345d0b,null))[_0x15da('0x22')](saveUpdates(_0x16825f[_0x15da('0x5a')],null))[_0x15da('0x22')](respondWithResult(_0x345d0b,null))['catch'](handleError(_0x345d0b,null));};exports[_0x15da('0x36')]=function(_0x10794a,_0xf7438a){return db[_0x15da('0x3d')]['find']({'where':{'id':_0x10794a[_0x15da('0x57')]['id']}})['then'](handleEntityNotFound(_0xf7438a,null))[_0x15da('0x22')](removeEntity(_0xf7438a,null))[_0x15da('0x29')](handleError(_0xf7438a,null));};exports[_0x15da('0x64')]=function(_0x425b32,_0x9e9bd5){return db['FaxAccount'][_0x15da('0x64')]()[_0x15da('0x22')](respondWithResult(_0x9e9bd5,null))['catch'](handleError(_0x9e9bd5,null));};exports['addDisposition']=function(_0x30dc66,_0x3f78fd,_0x1b4b6c){if(_0x30dc66[_0x15da('0x5a')]['id']){delete _0x30dc66[_0x15da('0x5a')]['id'];}return db[_0x15da('0x3d')][_0x15da('0x63')]({'where':{'id':_0x30dc66[_0x15da('0x57')]['id']}})[_0x15da('0x22')](handleEntityNotFound(_0x3f78fd,null))[_0x15da('0x22')](function(_0x29509e){if(_0x29509e){_0x30dc66[_0x15da('0x5a')][_0x15da('0x65')]=_0x29509e['id'];return db[_0x15da('0x66')][_0x15da('0x59')](_0x30dc66['body']);}})['then'](respondWithResult(_0x3f78fd,null))[_0x15da('0x29')](handleError(_0x3f78fd,null));};exports[_0x15da('0x67')]=function(_0x5727bf,_0x2d94e6,_0x4122f9){var _0x18a776={'raw':![],'where':{}};var _0x564d54={};var _0x49419f={'count':0x0,'rows':[]};return db[_0x15da('0x3d')][_0x15da('0x68')]({'where':{'id':_0x5727bf[_0x15da('0x57')]['id']}})[_0x15da('0x22')](handleEntityNotFound(_0x2d94e6,null))['then'](function(_0x865344){if(_0x865344){_0x564d54[_0x15da('0x42')]=_[_0x15da('0x44')](db[_0x15da('0x66')][_0x15da('0x3e')]);_0x564d54[_0x15da('0x43')]=_[_0x15da('0x44')](_0x5727bf[_0x15da('0x43')]);_0x564d54[_0x15da('0x45')]=_[_0x15da('0x46')](_0x564d54[_0x15da('0x42')],_0x564d54['query']);_0x18a776[_0x15da('0x48')]=_['intersection'](_0x564d54[_0x15da('0x42')],qs[_0x15da('0x47')](_0x5727bf[_0x15da('0x43')]['fields']));_0x18a776[_0x15da('0x48')]=_0x18a776['attributes'][_0x15da('0x49')]?_0x18a776[_0x15da('0x48')]:_0x564d54[_0x15da('0x42')];if(!_0x5727bf[_0x15da('0x43')][_0x15da('0x4a')](_0x15da('0x4b'))){_0x18a776[_0x15da('0x30')]=qs['limit'](_0x5727bf['query'][_0x15da('0x30')]);_0x18a776[_0x15da('0x4c')]=qs[_0x15da('0x4c')](_0x5727bf['query'][_0x15da('0x4c')]);}_0x18a776[_0x15da('0x69')]=qs[_0x15da('0x4d')](_0x5727bf[_0x15da('0x43')][_0x15da('0x4d')]);_0x18a776[_0x15da('0x4e')]=qs['filters'](_['pick'](_0x5727bf[_0x15da('0x43')],_0x564d54[_0x15da('0x45')]));_0x18a776[_0x15da('0x4e')][_0x15da('0x65')]=_0x865344['id'];if(_0x5727bf[_0x15da('0x43')]['filter']){_0x18a776[_0x15da('0x4e')]=_[_0x15da('0x51')](_0x18a776['where'],{'$or':_[_0x15da('0x3c')](_0x18a776[_0x15da('0x48')],function(_0x5e48d2){var _0x5d32a5={};_0x5d32a5[_0x5e48d2]={'$like':'%'+_0x5727bf['query'][_0x15da('0x50')]+'%'};return _0x5d32a5;})});}_0x18a776=_['merge']({},_0x18a776,_0x5727bf[_0x15da('0x52')]);return db['Disposition']['count']({'where':_0x18a776[_0x15da('0x4e')]})['then'](function(_0x3c91e8){_0x49419f[_0x15da('0x2f')]=_0x3c91e8;if(_0x5727bf[_0x15da('0x43')][_0x15da('0x53')]){_0x18a776[_0x15da('0x54')]=[{'all':!![]}];}return db[_0x15da('0x66')][_0x15da('0x55')](_0x18a776);})[_0x15da('0x22')](function(_0xd1ff12){_0x49419f[_0x15da('0x56')]=_0xd1ff12;return _0x49419f;});}})[_0x15da('0x22')](respondWithFilteredResult(_0x2d94e6,_0x18a776))[_0x15da('0x29')](handleError(_0x2d94e6,null));};exports[_0x15da('0x6a')]=function(_0x5b1502,_0x33ddfe,_0x2f234e){return db['FaxAccount'][_0x15da('0x63')]({'where':{'id':_0x5b1502[_0x15da('0x57')]['id']}})[_0x15da('0x22')](handleEntityNotFound(_0x33ddfe,null))[_0x15da('0x22')](function(_0x56365c){if(_0x56365c){return _0x56365c['removeDispositions'](_0x5b1502['query'][_0x15da('0x6b')]);}})['then'](respondWithStatusCode(_0x33ddfe,null))[_0x15da('0x29')](handleError(_0x33ddfe,null));};exports['addAnswer']=function(_0x7e2a78,_0x1d3731,_0x2b5aa2){if(_0x7e2a78[_0x15da('0x5a')]['id']){delete _0x7e2a78[_0x15da('0x5a')]['id'];}return db[_0x15da('0x3d')][_0x15da('0x63')]({'where':{'id':_0x7e2a78[_0x15da('0x57')]['id']}})[_0x15da('0x22')](handleEntityNotFound(_0x1d3731,null))[_0x15da('0x22')](function(_0x4f60a6){if(_0x4f60a6){_0x7e2a78[_0x15da('0x5a')][_0x15da('0x65')]=_0x4f60a6['id'];return db[_0x15da('0x6c')]['create'](_0x7e2a78[_0x15da('0x5a')]);}})['then'](respondWithResult(_0x1d3731,null))[_0x15da('0x29')](handleError(_0x1d3731,null));};exports['getAnswers']=function(_0x498ac3,_0x26677c,_0x2c72d2){var _0x47d433={'raw':![],'where':{}};var _0x1ec300={};var _0xa1ae46={'count':0x0,'rows':[]};return db[_0x15da('0x3d')][_0x15da('0x68')]({'where':{'id':_0x498ac3[_0x15da('0x57')]['id']}})[_0x15da('0x22')](handleEntityNotFound(_0x26677c,null))[_0x15da('0x22')](function(_0x54254c){if(_0x54254c){_0x1ec300[_0x15da('0x42')]=_['keys'](db['CannedAnswer'][_0x15da('0x3e')]);_0x1ec300['query']=_[_0x15da('0x44')](_0x498ac3[_0x15da('0x43')]);_0x1ec300[_0x15da('0x45')]=_[_0x15da('0x46')](_0x1ec300[_0x15da('0x42')],_0x1ec300[_0x15da('0x43')]);_0x47d433['attributes']=_['intersection'](_0x1ec300[_0x15da('0x42')],qs['fields'](_0x498ac3['query'][_0x15da('0x47')]));_0x47d433['attributes']=_0x47d433[_0x15da('0x48')][_0x15da('0x49')]?_0x47d433[_0x15da('0x48')]:_0x1ec300[_0x15da('0x42')];if(!_0x498ac3[_0x15da('0x43')][_0x15da('0x4a')](_0x15da('0x4b'))){_0x47d433[_0x15da('0x30')]=qs[_0x15da('0x30')](_0x498ac3[_0x15da('0x43')][_0x15da('0x30')]);_0x47d433[_0x15da('0x4c')]=qs[_0x15da('0x4c')](_0x498ac3[_0x15da('0x43')][_0x15da('0x4c')]);}_0x47d433[_0x15da('0x69')]=qs[_0x15da('0x4d')](_0x498ac3[_0x15da('0x43')][_0x15da('0x4d')]);_0x47d433[_0x15da('0x4e')]=qs[_0x15da('0x45')](_[_0x15da('0x4f')](_0x498ac3[_0x15da('0x43')],_0x1ec300[_0x15da('0x45')]));_0x47d433[_0x15da('0x4e')]['FaxAccountId']=_0x54254c['id'];if(_0x498ac3['query'][_0x15da('0x50')]){_0x47d433[_0x15da('0x4e')]=_['merge'](_0x47d433[_0x15da('0x4e')],{'$or':_[_0x15da('0x3c')](_0x47d433[_0x15da('0x48')],function(_0x3c18ab){var _0x10aa45={};_0x10aa45[_0x3c18ab]={'$like':'%'+_0x498ac3[_0x15da('0x43')]['filter']+'%'};return _0x10aa45;})});}_0x47d433=_[_0x15da('0x51')]({},_0x47d433,_0x498ac3[_0x15da('0x52')]);return db['CannedAnswer'][_0x15da('0x2f')]({'where':_0x47d433[_0x15da('0x4e')]})[_0x15da('0x22')](function(_0x44edb8){_0xa1ae46[_0x15da('0x2f')]=_0x44edb8;if(_0x498ac3[_0x15da('0x43')][_0x15da('0x53')]){_0x47d433[_0x15da('0x54')]=[{'all':!![]}];}return db[_0x15da('0x6c')][_0x15da('0x55')](_0x47d433);})[_0x15da('0x22')](function(_0x4cd822){_0xa1ae46[_0x15da('0x56')]=_0x4cd822;return _0xa1ae46;});}})[_0x15da('0x22')](respondWithFilteredResult(_0x26677c,_0x47d433))['catch'](handleError(_0x26677c,null));};exports['removeAnswers']=function(_0x13527d,_0x5d2bfe,_0x297379){return db[_0x15da('0x3d')][_0x15da('0x63')]({'where':{'id':_0x13527d[_0x15da('0x57')]['id']}})[_0x15da('0x22')](handleEntityNotFound(_0x5d2bfe,null))[_0x15da('0x22')](function(_0x55c68b){if(_0x55c68b){return _0x55c68b[_0x15da('0x6d')](_0x13527d[_0x15da('0x43')][_0x15da('0x6b')]);}})[_0x15da('0x22')](respondWithStatusCode(_0x5d2bfe,null))[_0x15da('0x29')](handleError(_0x5d2bfe,null));};exports[_0x15da('0x6e')]=function(_0x1ff76a,_0x370e59,_0x431b4f){return db[_0x15da('0x6f')]['find']({'where':{'id':_0x1ff76a[_0x15da('0x57')]['id']}})[_0x15da('0x22')](handleEntityNotFound(_0x370e59,null))['then'](function(_0x57a52a){if(_0x57a52a){return _0x57a52a[_0x15da('0x6e')](_0x1ff76a[_0x15da('0x5a')][_0x15da('0x6b')],_[_0x15da('0x70')](_0x1ff76a[_0x15da('0x5a')],[_0x15da('0x6b'),'id'])||{});}})['then'](respondWithResult(_0x370e59,null))[_0x15da('0x29')](handleError(_0x370e59,null));};exports['getInteractions']=function(_0x481e2,_0xb8237c,_0x540311){var _0x667d00={'raw':![],'where':{}};var _0x3bd704={};var _0x79671d={'count':0x0,'rows':[]};return db[_0x15da('0x3d')][_0x15da('0x68')]({'where':{'id':_0x481e2[_0x15da('0x57')]['id']}})[_0x15da('0x22')](handleEntityNotFound(_0xb8237c,null))[_0x15da('0x22')](function(_0x5c02f5){if(_0x5c02f5){_0x3bd704[_0x15da('0x42')]=_[_0x15da('0x44')](db[_0x15da('0x6f')][_0x15da('0x3e')]);_0x3bd704[_0x15da('0x43')]=_[_0x15da('0x44')](_0x481e2[_0x15da('0x43')]);_0x3bd704[_0x15da('0x45')]=_[_0x15da('0x46')](_0x3bd704['model'],_0x3bd704['query']);_0x667d00['attributes']=_[_0x15da('0x46')](_0x3bd704['model'],qs['fields'](_0x481e2[_0x15da('0x43')]['fields']));_0x667d00[_0x15da('0x48')]=_0x667d00['attributes']['length']?_0x667d00['attributes']:_0x3bd704['model'];if(!_0x481e2[_0x15da('0x43')][_0x15da('0x4a')](_0x15da('0x4b'))){_0x667d00['limit']=qs[_0x15da('0x30')](_0x481e2[_0x15da('0x43')][_0x15da('0x30')]);_0x667d00[_0x15da('0x4c')]=qs[_0x15da('0x4c')](_0x481e2[_0x15da('0x43')][_0x15da('0x4c')]);}_0x667d00['order']=qs[_0x15da('0x4d')](_0x481e2[_0x15da('0x43')][_0x15da('0x4d')]);_0x667d00['where']=qs['filters'](_[_0x15da('0x4f')](_0x481e2[_0x15da('0x43')],_0x3bd704['filters']));_0x667d00[_0x15da('0x4e')]['FaxAccountId']=_0x5c02f5['id'];if(_0x481e2[_0x15da('0x43')][_0x15da('0x50')]){_0x667d00[_0x15da('0x4e')]=_[_0x15da('0x51')](_0x667d00[_0x15da('0x4e')],{'$or':_[_0x15da('0x3c')](_0x667d00[_0x15da('0x48')],function(_0x5f133b){var _0x5ca54d={};_0x5ca54d[_0x5f133b]={'$like':'%'+_0x481e2[_0x15da('0x43')][_0x15da('0x50')]+'%'};return _0x5ca54d;})});}_0x667d00=_[_0x15da('0x51')]({},_0x667d00,_0x481e2[_0x15da('0x52')]);return db[_0x15da('0x6f')][_0x15da('0x2f')]({'where':_0x667d00['where']})[_0x15da('0x22')](function(_0x513dbe){_0x79671d['count']=_0x513dbe;if(_0x481e2[_0x15da('0x43')][_0x15da('0x53')]){_0x667d00['include']=[{'model':db['CmContact'],'as':_0x15da('0x71'),'required':![]},{'model':db['User'],'as':_0x15da('0x72'),'attributes':[_0x15da('0x39'),_0x15da('0x73'),_0x15da('0x74')],'required':![]},{'model':db[_0x15da('0x75')],'as':_0x15da('0x76'),'attributes':['id','name',_0x15da('0x77')],'where':_0x481e2[_0x15da('0x43')][_0x15da('0x78')]?{'id':_0x481e2[_0x15da('0x43')][_0x15da('0x78')]}:undefined,'required':_0x481e2[_0x15da('0x43')]['tag']?!![]:![]}];}return db['FaxInteraction'][_0x15da('0x55')](_0x667d00);})[_0x15da('0x22')](function(_0x598eae){_0x79671d[_0x15da('0x56')]=_0x598eae;return _0x79671d;});}})['then'](respondWithFilteredResult(_0xb8237c,_0x667d00))[_0x15da('0x29')](handleError(_0xb8237c,null));};exports['addApplications']=function(_0x21945f,_0x591cd4){var _0x3607ec=_0x21945f['params']['id'];var _0xf80ad0=_0x21945f['body'];var _0xad3a39=0xc8;var _0x1060bb=null;return db['sequelize'][_0x15da('0x79')]({'isolationLevel':db[_0x15da('0x7a')][_0x15da('0x7b')][_0x15da('0x7c')][_0x15da('0x7d')]},function(_0x3c3803){return db[_0x15da('0x3d')]['findOne']({'where':{'id':_0x3607ec},'transaction':_0x3c3803})[_0x15da('0x22')](function(_0x2a794a){if(_0x2a794a){return db[_0x15da('0x7e')][_0x15da('0x36')]({'where':{'FaxAccountId':_0x3607ec},'transaction':_0x3c3803})['then'](function(){var _0x194859=_[_0x15da('0x3c')](_0xf80ad0,function(_0x4d9c9b){_0x4d9c9b[_0x15da('0x65')]=_0x3607ec;return _0x4d9c9b;});return db[_0x15da('0x7e')]['bulkCreate'](_0x194859,{'transaction':_0x3c3803});});}else{_0xad3a39=0x194;_0x1060bb=[];}});})[_0x15da('0x22')](function(){if(_0xad3a39!==0x194){return db[_0x15da('0x7e')][_0x15da('0x7f')]({'where':{'FaxAccountId':_0x3607ec},'order':_0x15da('0x80')})[_0x15da('0x22')](function(_0x53ec84){_0x1060bb=_0x53ec84;});}})['catch'](function(_0x430d8c){_0xad3a39=0x1f4;logger[_0x15da('0x25')](_0x430d8c[_0x15da('0x38')]);if(_0x430d8c[_0x15da('0x39')]){delete _0x430d8c[_0x15da('0x39')];}_0x1060bb=_0x430d8c;})[_0x15da('0x81')](function(){if(_0x1060bb===null){_0x591cd4[_0x15da('0x2a')](_0xad3a39);}else{if(_0xad3a39===0x1f4){_0x591cd4[_0x15da('0x2b')](_0xad3a39)[_0x15da('0x3a')](_0x1060bb);}else{_0x591cd4['status'](_0xad3a39)[_0x15da('0x2d')](_0x1060bb);}}});};exports[_0x15da('0x82')]=function(_0x454b25,_0x5e5c9c,_0x4d8adc){var _0x5a1d28={};var _0x5c90d2={};var _0x387ee9;var _0x2b4739;return db[_0x15da('0x3d')][_0x15da('0x68')]({'where':{'id':_0x454b25[_0x15da('0x57')]['id']}})[_0x15da('0x22')](handleEntityNotFound(_0x5e5c9c,null))[_0x15da('0x22')](function(_0x543110){if(_0x543110){_0x387ee9=_0x543110;_0x5c90d2[_0x15da('0x42')]=_[_0x15da('0x44')](db[_0x15da('0x7e')][_0x15da('0x3e')]);_0x5c90d2[_0x15da('0x43')]=_[_0x15da('0x44')](_0x454b25[_0x15da('0x43')]);_0x5c90d2[_0x15da('0x45')]=_['intersection'](_0x5c90d2[_0x15da('0x42')],_0x5c90d2[_0x15da('0x43')]);_0x5a1d28['attributes']=_[_0x15da('0x46')](_0x5c90d2[_0x15da('0x42')],qs[_0x15da('0x47')](_0x454b25[_0x15da('0x43')][_0x15da('0x47')]));_0x5a1d28[_0x15da('0x48')]=_0x5a1d28[_0x15da('0x48')][_0x15da('0x49')]?_0x5a1d28[_0x15da('0x48')]:_0x5c90d2[_0x15da('0x42')];_0x5a1d28[_0x15da('0x69')]=qs[_0x15da('0x4d')](_0x454b25[_0x15da('0x43')][_0x15da('0x4d')]);_0x5a1d28[_0x15da('0x4e')]=qs[_0x15da('0x45')](_[_0x15da('0x4f')](_0x454b25['query'],_0x5c90d2[_0x15da('0x45')]));if(_0x454b25['query'][_0x15da('0x50')]){_0x5a1d28['where']=_['merge'](_0x5a1d28[_0x15da('0x4e')],{'$or':_[_0x15da('0x3c')](_0x5a1d28[_0x15da('0x48')],function(_0x2c9e34){var _0xed6a4c={};_0xed6a4c[_0x2c9e34]={'$like':'%'+_0x454b25['query'][_0x15da('0x50')]+'%'};return _0xed6a4c;})});}_0x5a1d28=_[_0x15da('0x51')]({},_0x5a1d28,_0x454b25['options']);return _0x387ee9[_0x15da('0x82')](_0x5a1d28);}})[_0x15da('0x22')](function(_0x5889f1){if(_0x5889f1){_0x2b4739=_0x5889f1[_0x15da('0x49')];if(!_0x454b25['query'][_0x15da('0x4a')]('nolimit')){_0x5a1d28[_0x15da('0x30')]=qs[_0x15da('0x30')](_0x454b25[_0x15da('0x43')][_0x15da('0x30')]);_0x5a1d28[_0x15da('0x4c')]=qs['offset'](_0x454b25[_0x15da('0x43')]['offset']);}return _0x387ee9[_0x15da('0x82')](_0x5a1d28);}})['then'](function(_0x349ba5){if(_0x349ba5){return _0x349ba5?{'count':_0x2b4739,'rows':_0x349ba5}:null;}})[_0x15da('0x22')](respondWithResult(_0x5e5c9c,null))[_0x15da('0x29')](handleError(_0x5e5c9c,null));};function Extension(_0x2e140b,_0x2c09ce,_0x47968a,_0x172a74){this[_0x15da('0x83')]=_0x15da('0x84');this[_0x15da('0x85')]=_0x2e140b[_0x15da('0x86')];this[_0x15da('0x87')]=_0x172a74;this['type']='system';this[_0x15da('0x88')]=_0x15da('0x89');this[_0x15da('0x65')]=_0x2e140b['id'];this[_0x15da('0x80')]=_0x2c09ce;this[_0x15da('0x8a')]=_0x47968a;}function createExtensionsReciveFax(_0x33b000){var _0x2a94df=0x1;var _0x1e5e16=[];_0x1e5e16[_0x15da('0x8b')](new Extension(_0x33b000,_0x2a94df,'',_0x15da('0x8c')));_0x2a94df+=0x1;_0x1e5e16['push'](new Extension(_0x33b000,_0x2a94df,'CDR(type)=inbound-fax',_0x15da('0x8d')));_0x2a94df+=0x1;for(var _0x45e0bf in _0x33b000){if(_0x33b000[_0x15da('0x4a')](_0x45e0bf)&&(_0x45e0bf===_0x15da('0x8e')||_0x45e0bf===_0x15da('0x86')||_0x45e0bf==='gateway'||_0x45e0bf==='faxdetect'||_0x45e0bf==='headerinfo'||_0x45e0bf===_0x15da('0x8f')||_0x45e0bf===_0x15da('0x90')||_0x45e0bf===_0x15da('0x91')||_0x45e0bf===_0x15da('0x92'))){_0x1e5e16[_0x15da('0x8b')](new Extension(_0x33b000,_0x2a94df,_0x15da('0x93')+_0x45e0bf+')='+_0x33b000[_0x45e0bf],'Set'));_0x2a94df+=0x1;}}_0x1e5e16['push'](new Extension(_0x33b000,_0x2a94df,'6','Wait'));_0x2a94df+=0x1;_0x1e5e16['push'](new Extension(_0x33b000,_0x2a94df,_0x15da('0x94'),_0x15da('0x95')));_0x2a94df=0x0;return _0x1e5e16;}exports['addAccountApplications']=function(_0x348cae,_0x29140b,_0x282bf7){var _0x220c58;return db[_0x15da('0x7a')]['transaction'](function(_0x10d8fe){return db['FaxAccount'][_0x15da('0x59')](_0x348cae[_0x15da('0x5a')],{'transaction':_0x10d8fe})[_0x15da('0x22')](function(_0x22266b){_0x220c58=_0x22266b[_0x15da('0x5b')]({'plain':!![]});return db[_0x15da('0x96')][_0x15da('0x97')](createExtensionsReciveFax(_0x220c58),{'transaction':_0x10d8fe});});})[_0x15da('0x22')](function(){return _0x220c58;})[_0x15da('0x22')](respondWithResult(_0x29140b,null))[_0x15da('0x29')](handleError(_0x29140b,null));};exports['updateAccountApplications']=function(_0x9d8c7a,_0x8bccf1,_0x5263b4){var _0x23408e;return db['sequelize'][_0x15da('0x79')](function(_0x384390){return db[_0x15da('0x3d')]['update'](_0x9d8c7a[_0x15da('0x5a')],{'where':{'id':_0x9d8c7a[_0x15da('0x5a')]['id']},'transaction':_0x384390})[_0x15da('0x22')](function(_0x3a9741){return db[_0x15da('0x96')][_0x15da('0x36')]({'where':{'FaxAccountId':_0x9d8c7a[_0x15da('0x5a')]['id']},'transaction':_0x384390})['then'](function(_0x5229b1){return db[_0x15da('0x96')][_0x15da('0x97')](createExtensionsReciveFax(_[_0x15da('0x70')](_0x9d8c7a[_0x15da('0x5a')],['tech','key',_0x15da('0x98'),_0x15da('0x99'),_0x15da('0x9a'),_0x15da('0x9b')])),{'transaction':_0x384390});});});})[_0x15da('0x22')](function(){return db['FaxAccount'][_0x15da('0x9c')](_0x9d8c7a[_0x15da('0x5a')]['id']);})['then'](respondWithResult(_0x8bccf1,null))[_0x15da('0x29')](handleError(_0x8bccf1,null));};exports[_0x15da('0x9d')]=function(_0x4f1a15,_0x592fe3,_0x1bd59b){var _0x2d3a14={'raw':!![],'where':{}};var _0xd01184={};var _0x325d96={'count':0x0,'rows':[]};return db[_0x15da('0x3d')]['findOne']({'where':{'id':_0x4f1a15[_0x15da('0x57')]['id']}})[_0x15da('0x22')](handleEntityNotFound(_0x592fe3,null))[_0x15da('0x22')](function(_0x5020ef){if(_0x5020ef){_0xd01184['model']=_[_0x15da('0x44')](db[_0x15da('0x9e')]['rawAttributes']);_0xd01184['query']=_['keys'](_0x4f1a15[_0x15da('0x43')]);_0xd01184[_0x15da('0x45')]=_[_0x15da('0x46')](_0xd01184[_0x15da('0x42')],_0xd01184[_0x15da('0x43')]);_0x2d3a14[_0x15da('0x48')]=_[_0x15da('0x46')](_0xd01184[_0x15da('0x42')],qs[_0x15da('0x47')](_0x4f1a15['query'][_0x15da('0x47')]));_0x2d3a14['attributes']=_0x2d3a14[_0x15da('0x48')][_0x15da('0x49')]?_0x2d3a14[_0x15da('0x48')]:_0xd01184[_0x15da('0x42')];if(!_0x4f1a15[_0x15da('0x43')]['hasOwnProperty']('nolimit')){_0x2d3a14['limit']=qs[_0x15da('0x30')](_0x4f1a15[_0x15da('0x43')][_0x15da('0x30')]);_0x2d3a14[_0x15da('0x4c')]=qs['offset'](_0x4f1a15[_0x15da('0x43')][_0x15da('0x4c')]);}_0x2d3a14['order']=qs[_0x15da('0x4d')](_0x4f1a15[_0x15da('0x43')]['sort']);_0x2d3a14['where']=qs[_0x15da('0x45')](_[_0x15da('0x4f')](_0x4f1a15[_0x15da('0x43')],_0xd01184[_0x15da('0x45')]));_0x2d3a14['where'][_0x15da('0x65')]=_0x5020ef['id'];if(_0x4f1a15[_0x15da('0x43')][_0x15da('0x50')]){_0x2d3a14[_0x15da('0x4e')]=_[_0x15da('0x51')](_0x2d3a14['where'],{'$or':_[_0x15da('0x3c')](_0x2d3a14[_0x15da('0x48')],function(_0x5be48a){var _0x45d7c5={};_0x45d7c5[_0x5be48a]={'$like':'%'+_0x4f1a15[_0x15da('0x43')][_0x15da('0x50')]+'%'};return _0x45d7c5;})});}if(_0x4f1a15[_0x15da('0x43')][_0x15da('0x9f')]){var _0x82c562=_0x4f1a15[_0x15da('0x43')][_0x15da('0x9f')][_0x15da('0xa0')](',');var _0x5baa7f={};_0x5baa7f[_0x82c562[0x0]]={'$gte':moment(_0x82c562[0x1])[_0x15da('0xa1')](_0x15da('0xa2'))};_0x2d3a14['where']=_[_0x15da('0x51')](_0x2d3a14[_0x15da('0x4e')],_0x5baa7f);}_0x2d3a14=_[_0x15da('0x51')]({},_0x2d3a14,_0x4f1a15[_0x15da('0x52')]);return db[_0x15da('0x9e')][_0x15da('0x2f')]({'where':_0x2d3a14[_0x15da('0x4e')]})[_0x15da('0x22')](function(_0x3f4cf4){_0x325d96[_0x15da('0x2f')]=_0x3f4cf4;if(_0x4f1a15['query']['includeAll']){_0x2d3a14[_0x15da('0x54')]=[{'all':!![]}];}return db['FaxMessage'][_0x15da('0x55')](_0x2d3a14);})[_0x15da('0x22')](function(_0xb015ca){_0x325d96[_0x15da('0x56')]=_0xb015ca;return _0x325d96;});}})[_0x15da('0x22')](respondWithFilteredResult(_0x592fe3,_0x2d3a14))[_0x15da('0x29')](handleError(_0x592fe3,null));};exports['send']=function(_0xafe5cf,_0x4603b8,_0x3681f2){var _0x694545,_0xc3003c={},_0x36e1c1;if(_0xafe5cf['body']['to']){_0x36e1c1=_0xafe5cf[_0x15da('0x5a')]['to'][0x0];}return db[_0x15da('0x3d')][_0x15da('0x63')]({'where':{'id':_0xafe5cf[_0x15da('0x57')]['id']},'include':[{'model':db[_0x15da('0xa3')],'as':_0x15da('0xa4'),'include':[{'model':db[_0x15da('0xa5')],'as':'Contacts','where':{'fax':_0x36e1c1},'limit':0x1,'order':[[_0x15da('0x99'),_0x15da('0xa6')]]}]}]})[_0x15da('0x22')](handleEntityNotFound(_0x4603b8,null))[_0x15da('0x22')](function(_0x3aa0f1){_0x694545=_0x3aa0f1;if(_0xafe5cf[_0x15da('0x5a')][_0x15da('0xa7')]&&_0xafe5cf[_0x15da('0x5a')][_0x15da('0xa7')][_0x15da('0x49')]){for(var _0x396055=0x0;_0x396055<_0xafe5cf[_0x15da('0x5a')][_0x15da('0xa7')][_0x15da('0x49')];_0x396055+=0x1){_0xafe5cf[_0x15da('0x5a')][_0x15da('0xa7')][_0x396055]={'filename':_0xafe5cf[_0x15da('0x5a')]['attachments'][_0x396055][_0x15da('0x39')],'id':_0xafe5cf['body'][_0x15da('0xa7')][_0x396055]['id'],'path':path['join'](config[_0x15da('0xa8')],_0x15da('0xa9'),_0xafe5cf['body']['attachments'][_0x396055]['basename'])};}}return respondWithRpcPromise(_0x15da('0xaa'),_0x15da('0xaa'),{'FaxAccountId':_['isNil'](_0xafe5cf[_0x15da('0x57')]['id'])?undefined:_0xafe5cf[_0x15da('0x57')]['id'],'path':_['isNil'](_0xafe5cf[_0x15da('0x5a')][_0x15da('0xa7')][0x0]['path'])?undefined:_0xafe5cf['body'][_0x15da('0xa7')][0x0][_0x15da('0x7')],'fax':_[_0x15da('0xab')](_0xafe5cf[_0x15da('0x5a')]['to'][0x0])?undefined:_0xafe5cf[_0x15da('0x5a')]['to'][0x0]},client9002);})['then'](function(){if(_0x694545){if(_[_0x15da('0xab')](_0xafe5cf[_0x15da('0x5a')][_0x15da('0xac')])){_0xafe5cf[_0x15da('0x5a')][_0x15da('0xac')]=util['format'](_0x15da('0xad'),_0x694545['name'],_0x694545[_0x15da('0xae')]);}if(_0x694545['List']){if(_0x694545[_0x15da('0xa4')]['Contacts']['length']){return _0x694545[_0x15da('0xa4')][_0x15da('0xaf')][0x0];}else{return db['CmContact']['create'](_[_0x15da('0x1b')](_0xafe5cf[_0x15da('0x5a')],{'firstName':_0xafe5cf[_0x15da('0x5a')]['to'][0x0],'phone':_0xafe5cf['body']['to'][0x0],'fax':_0xafe5cf[_0x15da('0x5a')]['to'][0x0],'ListId':_0x694545['ListId']}));}}else{throw new Error(_0x15da('0xb0'));}}else{throw new Error(_0x15da('0xb1'));}})[_0x15da('0x22')](function(_0x178215){if(_0x178215){return db[_0x15da('0x6f')][_0x15da('0x63')]({'where':{'ContactId':_0x178215['id'],'closed':![],'FaxAccountId':_0x694545['id']}})[_0x15da('0x22')](function(_0x9e4df2){if(_0x9e4df2){return[_0x9e4df2,![]];}return db['FaxInteraction'][_0x15da('0x59')]({'UserId':_0xafe5cf[_0x15da('0x5d')]['id'],'ContactId':_0x178215['id'],'FaxAccountId':_0x694545['id'],'fax':_0xafe5cf[_0x15da('0x5a')]['to'][0x0],'firstMsgDirection':'out','Messages':[_[_0x15da('0x51')](_0xafe5cf[_0x15da('0x5a')],{'read':![],'body':_0xafe5cf['body']['attachments'][0x0][_0x15da('0xb2')],'FaxAccountId':_0x694545['id'],'UserId':_0xafe5cf['user']['id'],'ContactId':_0x178215['id'],'AttachmentId':_0xafe5cf[_0x15da('0x5a')]['attachments'][0x0]['id']})]},{'include':[{'model':db[_0x15da('0x9e')],'as':_0x15da('0xb3')}]})['then'](function(_0x593693){return[_0x593693,!![]];});});}else{throw new Error(_0x15da('0xb4'));}})[_0x15da('0xb5')](function(_0x312053,_0x52e251){if(_0x52e251){return _0x312053;}return db['FaxMessage'][_0x15da('0x59')]({'direction':_0x15da('0xb6'),'read':![],'body':_0xafe5cf[_0x15da('0x5a')][_0x15da('0xa7')][0x0][_0x15da('0xb2')],'FaxAccountId':_0x694545['id'],'FaxInteractionId':_0x312053['id'],'UserId':_0xafe5cf[_0x15da('0x5d')]['id'],'ContactId':_0x312053[_0x15da('0xb7')],'AttachmentId':_0xafe5cf['body'][_0x15da('0xa7')][0x0]['id']})[_0x15da('0x22')](function(_0x32094a){_0x312053[_0x15da('0xb8')][_0x15da('0xb3')]=[];_0x312053[_0x15da('0xb8')][_0x15da('0xb3')][_0x15da('0x8b')](_0x32094a[_0x15da('0xb8')]);return _0x312053;});})[_0x15da('0x22')](function(_0x1e461b){respondWithRpcPromise(_0x15da('0xb9'),_0x15da('0xb9'),{'FaxAccountId':_[_0x15da('0xab')](_0xafe5cf[_0x15da('0x57')]['id'])?undefined:_0xafe5cf[_0x15da('0x57')]['id'],'path':_[_0x15da('0xab')](_0xafe5cf['body'][_0x15da('0xa7')][0x0][_0x15da('0x7')])?undefined:_0xafe5cf[_0x15da('0x5a')]['attachments'][0x0][_0x15da('0x7')],'fax':_['isNil'](_0xafe5cf[_0x15da('0x5a')]['to'][0x0])?undefined:_0xafe5cf[_0x15da('0x5a')]['to'][0x0],'AttachmentId':_0xafe5cf[_0x15da('0x5a')][_0x15da('0xa7')][0x0]['id']},client9002)[_0x15da('0x22')](function(_0x54463f){logger[_0x15da('0xba')](_0x15da('0xbb'),_0x54463f);})[_0x15da('0x29')](function(_0x353b9f){logger[_0x15da('0xba')](_0x15da('0xbb'),_0x353b9f);});return _0x1e461b;})[_0x15da('0x22')](respondWithResult(_0x4603b8,null))['catch'](handleError(_0x4603b8,null));};exports['addAgents']=function(_0x975e34,_0x1bfa06,_0x2fe241){return db[_0x15da('0x3d')]['find']({'where':{'id':_0x975e34['params']['id']}})[_0x15da('0x22')](handleEntityNotFound(_0x1bfa06,null))[_0x15da('0x22')](function(_0x3e7040){if(_0x3e7040){return _0x3e7040[_0x15da('0xbc')](_0x975e34[_0x15da('0x5a')][_0x15da('0x6b')],_[_0x15da('0x70')](_0x975e34[_0x15da('0x5a')],[_0x15da('0x6b'),'id'])||{})['spread'](function(_0x56da41){for(var _0x202d22=0x0;_0x202d22<_0x975e34[_0x15da('0x5a')]['ids']['length'];_0x202d22+=0x1){socket['emit'](_0x15da('0xbd'),{'UserId':Number(_0x975e34[_0x15da('0x5a')][_0x15da('0x6b')][_0x202d22]),'FaxAccountId':Number(_0x975e34[_0x15da('0x57')]['id'])});}return _0x56da41;});}})[_0x15da('0x22')](respondWithResult(_0x1bfa06,null))[_0x15da('0x29')](handleError(_0x1bfa06,null));};exports[_0x15da('0xbe')]=function(_0x3c1e1e,_0x56694a,_0x5e9e82){return db['FaxAccount'][_0x15da('0x63')]({'where':{'id':_0x3c1e1e['params']['id']}})[_0x15da('0x22')](handleEntityNotFound(_0x56694a,null))[_0x15da('0x22')](function(_0x9d6398){if(_0x9d6398){return _0x9d6398[_0x15da('0xbe')](_0x3c1e1e['query'][_0x15da('0x6b')])[_0x15da('0x22')](function(){if(_[_0x15da('0xbf')](_0x3c1e1e['query']['ids'])){for(var _0x43cbc6=0x0;_0x43cbc6<_0x3c1e1e['query'][_0x15da('0x6b')][_0x15da('0x49')];_0x43cbc6+=0x1){socket[_0x15da('0xc0')](_0x15da('0xc1'),{'UserId':Number(_0x3c1e1e[_0x15da('0x43')]['ids'][_0x43cbc6]),'FaxAccountId':Number(_0x3c1e1e[_0x15da('0x57')]['id'])});}}else{socket[_0x15da('0xc0')](_0x15da('0xc1'),{'UserId':Number(_0x3c1e1e[_0x15da('0x43')][_0x15da('0x6b')]),'FaxAccountId':Number(_0x3c1e1e[_0x15da('0x57')]['id'])});}});}})[_0x15da('0x22')](respondWithStatusCode(_0x56694a,null))[_0x15da('0x29')](handleError(_0x56694a,null));};exports[_0x15da('0xc2')]=function(_0x5060bd,_0x4ee0cd,_0x1e5e50){var _0x489407={};var _0x324754={};var _0x2c1303;var _0x26c680;return db[_0x15da('0x3d')][_0x15da('0x68')]({'where':{'id':_0x5060bd[_0x15da('0x57')]['id']}})['then'](handleEntityNotFound(_0x4ee0cd,null))[_0x15da('0x22')](function(_0x440318){if(_0x440318){_0x2c1303=_0x440318;_0x324754[_0x15da('0x42')]=_[_0x15da('0x44')](db[_0x15da('0xc3')][_0x15da('0x3e')]);_0x324754[_0x15da('0x43')]=_[_0x15da('0x44')](_0x5060bd[_0x15da('0x43')]);_0x324754[_0x15da('0x45')]=_[_0x15da('0x46')](_0x324754[_0x15da('0x42')],_0x324754[_0x15da('0x43')]);_0x489407[_0x15da('0x48')]=_['intersection'](_0x324754['model'],qs[_0x15da('0x47')](_0x5060bd[_0x15da('0x43')][_0x15da('0x47')]));_0x489407['attributes']=_0x489407[_0x15da('0x48')][_0x15da('0x49')]?_0x489407[_0x15da('0x48')]:_0x324754['model'];_0x489407[_0x15da('0x69')]=qs['sort'](_0x5060bd[_0x15da('0x43')][_0x15da('0x4d')]);_0x489407[_0x15da('0x4e')]=qs[_0x15da('0x45')](_['pick'](_0x5060bd[_0x15da('0x43')],_0x324754[_0x15da('0x45')]));if(_0x5060bd['query'][_0x15da('0x50')]){_0x489407[_0x15da('0x4e')]=_[_0x15da('0x51')](_0x489407[_0x15da('0x4e')],{'$or':_[_0x15da('0x3c')](_0x489407[_0x15da('0x48')],function(_0x23ad59){var _0x168e76={};_0x168e76[_0x23ad59]={'$like':'%'+_0x5060bd['query'][_0x15da('0x50')]+'%'};return _0x168e76;})});}_0x489407=_[_0x15da('0x51')]({},_0x489407,_0x5060bd[_0x15da('0x52')]);return _0x2c1303[_0x15da('0xc2')](_0x489407);}})[_0x15da('0x22')](function(_0xf30939){if(_0xf30939){_0x26c680=_0xf30939[_0x15da('0x49')];if(!_0x5060bd['query'][_0x15da('0x4a')]('nolimit')){_0x489407[_0x15da('0x30')]=qs[_0x15da('0x30')](_0x5060bd['query']['limit']);_0x489407[_0x15da('0x4c')]=qs['offset'](_0x5060bd[_0x15da('0x43')][_0x15da('0x4c')]);}return _0x2c1303[_0x15da('0xc2')](_0x489407);}})[_0x15da('0x22')](function(_0x20354e){if(_0x20354e){return _0x20354e?{'count':_0x26c680,'rows':_0x20354e}:null;}})[_0x15da('0x22')](respondWithResult(_0x4ee0cd,null))[_0x15da('0x29')](handleError(_0x4ee0cd,null));}; \ No newline at end of file +var _0x9d1a=['basename','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','List','Contacts','List\x20not\x20found','Send\x20Fax\x20failed','filename','Messages','out','ContactId','dataValues','SendFax','addAgents','spread','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','eml-format','fast-json-patch','request-promise','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','FaxAccounts','UserProfileResource','stack','index','Pause','mandatoryDispositionPause','map','rawAttributes','fieldName','type','key','name','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','include','FaxAccount','findAll','rows','show','params','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','describe','addDisposition','FaxAccountId','Disposition','getDispositions','findOne','keys','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','addInteraction','omit','getInteractions','FaxInteraction','CmContact','Contact','User','fullname','internal','Tag','color','tag','addApplications','transaction','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','FaxApplication','bulkCreate','findAndCountAll','priority','finally','send','getApplications','context','exten','localstationid','app','Fax\x20Extension','appdata','push','Answer','CDR(type)=inbound-fax','Set','ecm','gateway','faxdetect','minrate','modem','t38timeout','FAXOPT(','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','VoiceExtension','updateAccountApplications','tech','updatedAt','TrunkId','ListId','findById','getMessages','FaxMessage','$gte','YYYY-MM-DD\x20HH:mm:ss','CmList','DESC','attachments','join','root','server/files/attachments'];(function(_0x31ba5f,_0x3c9e8f){var _0x1d58de=function(_0x240699){while(--_0x240699){_0x31ba5f['push'](_0x31ba5f['shift']());}};_0x1d58de(++_0x3c9e8f);}(_0x9d1a,0x1a3));var _0xa9d1=function(_0x169c76,_0x5a315a){_0x169c76=_0x169c76-0x0;var _0x458949=_0x9d1a[_0x169c76];return _0x458949;};'use strict';var emlformat=require(_0xa9d1('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa9d1('0x1'));var rp=require(_0xa9d1('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xa9d1('0x3'));var util=require('util');var path=require(_0xa9d1('0x4'));var sox=require('sox');var csv=require(_0xa9d1('0x5'));var ejs=require(_0xa9d1('0x6'));var fs=require('fs');var fs_extra=require(_0xa9d1('0x7'));var _=require(_0xa9d1('0x8'));var squel=require(_0xa9d1('0x9'));var crypto=require(_0xa9d1('0xa'));var jsforce=require(_0xa9d1('0xb'));var deskjs=require(_0xa9d1('0xc'));var toCsv=require(_0xa9d1('0x5'));var querystring=require(_0xa9d1('0xd'));var Papa=require(_0xa9d1('0xe'));var Redis=require(_0xa9d1('0xf'));var authService=require(_0xa9d1('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa9d1('0x11'));var logger=require(_0xa9d1('0x12'))(_0xa9d1('0x13'));var utils=require(_0xa9d1('0x14'));var config=require(_0xa9d1('0x15'));var licenseUtil=require(_0xa9d1('0x16'));var db=require('../../mysqldb')['db'];config[_0xa9d1('0x17')]=_[_0xa9d1('0x18')](config[_0xa9d1('0x17')],{'host':_0xa9d1('0x19'),'port':0x18eb});var socket=require(_0xa9d1('0x1a'))(new Redis(config[_0xa9d1('0x17')]));require('./faxAccount.socket')[_0xa9d1('0x1b')](socket);var jayson=require(_0xa9d1('0x1c'));var client=jayson[_0xa9d1('0x1d')][_0xa9d1('0x1e')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xa04e53,_0x59a6ac,_0x517c39,_0x3c3706){return new BPromise(function(_0x14de85,_0x539c86){var _0x2225c7=_0x3c3706||client;return _0x2225c7[_0xa9d1('0x1f')](_0xa04e53,_0x517c39)[_0xa9d1('0x20')](function(_0x1cfa3a){logger[_0xa9d1('0x21')](_0xa9d1('0x22'),_0x59a6ac,_0xa9d1('0x23'));logger[_0xa9d1('0x24')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x59a6ac,'request\x20sent',JSON[_0xa9d1('0x25')](_0x1cfa3a));if(_0x1cfa3a[_0xa9d1('0x26')]){if(_0x1cfa3a[_0xa9d1('0x26')][_0xa9d1('0x27')]===0x1f4){logger[_0xa9d1('0x26')](_0xa9d1('0x22'),_0x59a6ac,_0x1cfa3a[_0xa9d1('0x26')][_0xa9d1('0x28')]);return _0x539c86(_0x1cfa3a[_0xa9d1('0x26')][_0xa9d1('0x28')]);}logger[_0xa9d1('0x26')](_0xa9d1('0x22'),_0x59a6ac,_0x1cfa3a[_0xa9d1('0x26')]['message']);return _0x14de85(_0x1cfa3a[_0xa9d1('0x26')][_0xa9d1('0x28')]);}else{logger[_0xa9d1('0x21')](_0xa9d1('0x22'),_0x59a6ac,_0xa9d1('0x23'));_0x14de85(_0x1cfa3a[_0xa9d1('0x29')]['message']);}})[_0xa9d1('0x2a')](function(_0x3e4e78){logger['error'](_0xa9d1('0x22'),_0x59a6ac,_0x3e4e78);_0x539c86(_0x3e4e78);});});}function respondWithStatusCode(_0x25f50c,_0x5b468e){_0x5b468e=_0x5b468e||0xcc;return function(_0x1e0d85){if(_0x1e0d85){return _0x25f50c[_0xa9d1('0x2b')](_0x5b468e);}return _0x25f50c[_0xa9d1('0x2c')](_0x5b468e)[_0xa9d1('0x2d')]();};}function respondWithResult(_0x4387ef,_0x27942c){_0x27942c=_0x27942c||0xc8;return function(_0x2a87c6){if(_0x2a87c6){return _0x4387ef[_0xa9d1('0x2c')](_0x27942c)[_0xa9d1('0x2e')](_0x2a87c6);}};}function respondWithFilteredResult(_0x583d70,_0x2e2726){return function(_0x1e5301){if(_0x1e5301){var _0x36fa41=typeof _0x2e2726[_0xa9d1('0x2f')]==='undefined'&&typeof _0x2e2726[_0xa9d1('0x30')]===_0xa9d1('0x31');var _0x4dc49f=_0x1e5301['count'];var _0x4a68d8=_0x36fa41?0x0:_0x2e2726[_0xa9d1('0x2f')];var _0x221f72=_0x36fa41?_0x1e5301[_0xa9d1('0x32')]:_0x2e2726['offset']+_0x2e2726[_0xa9d1('0x30')];var _0x327e92;if(_0x221f72>=_0x4dc49f){_0x221f72=_0x4dc49f;_0x327e92=0xc8;}else{_0x327e92=0xce;}_0x583d70[_0xa9d1('0x2c')](_0x327e92);return _0x583d70[_0xa9d1('0x33')](_0xa9d1('0x34'),_0x4a68d8+'-'+_0x221f72+'/'+_0x4dc49f)[_0xa9d1('0x2e')](_0x1e5301);}return null;};}function patchUpdates(_0x4b69f4){return function(_0x5ea281){try{jsonpatch[_0xa9d1('0x35')](_0x5ea281,_0x4b69f4,!![]);}catch(_0x5450ed){return BPromise[_0xa9d1('0x36')](_0x5450ed);}return _0x5ea281[_0xa9d1('0x37')]();};}function saveUpdates(_0x4a8926,_0x2a143e){return function(_0x448d5e){if(_0x448d5e){return _0x448d5e[_0xa9d1('0x38')](_0x4a8926)[_0xa9d1('0x20')](function(_0x3655c0){return _0x3655c0;});}return null;};}function removeEntity(_0x2cb444,_0x5b8aa9){return function(_0x326625){if(_0x326625){return _0x326625[_0xa9d1('0x39')]()[_0xa9d1('0x20')](function(){var _0x7dfc44=_0x326625['get']({'plain':!![]});var _0x4ef61c=_0xa9d1('0x3a');return db[_0xa9d1('0x3b')][_0xa9d1('0x39')]({'where':{'type':_0x4ef61c,'resourceId':_0x7dfc44['id']}})[_0xa9d1('0x20')](function(){return _0x326625;});})['then'](function(){_0x2cb444[_0xa9d1('0x2c')](0xcc)[_0xa9d1('0x2d')]();});}};}function handleEntityNotFound(_0x457f7a,_0x3bfa4d){return function(_0x20b3ad){if(!_0x20b3ad){_0x457f7a[_0xa9d1('0x2b')](0x194);}return _0x20b3ad;};}function handleError(_0xb16dbe,_0x3f3cd6){_0x3f3cd6=_0x3f3cd6||0x1f4;return function(_0x4adca1){logger['error'](_0x4adca1[_0xa9d1('0x3c')]);if(_0x4adca1['name']){delete _0x4adca1['name'];}_0xb16dbe['status'](_0x3f3cd6)['send'](_0x4adca1);};}exports[_0xa9d1('0x3d')]=function(_0x27c213,_0x2085b4){var _0x210878={'include':[{'model':db[_0xa9d1('0x3e')],'as':_0xa9d1('0x3f')}]},_0x50d3fc={},_0x5e8e99={'count':0x0,'rows':[]};var _0x2a0b3f=_[_0xa9d1('0x40')](db['FaxAccount'][_0xa9d1('0x41')],function(_0x384bbf){return{'name':_0x384bbf[_0xa9d1('0x42')],'type':_0x384bbf[_0xa9d1('0x43')][_0xa9d1('0x44')]};});_0x50d3fc['model']=_[_0xa9d1('0x40')](_0x2a0b3f,_0xa9d1('0x45'));_0x50d3fc[_0xa9d1('0x46')]=_['keys'](_0x27c213[_0xa9d1('0x46')]);_0x50d3fc['filters']=_[_0xa9d1('0x47')](_0x50d3fc[_0xa9d1('0x48')],_0x50d3fc[_0xa9d1('0x46')]);_0x210878[_0xa9d1('0x49')]=_[_0xa9d1('0x47')](_0x50d3fc['model'],qs[_0xa9d1('0x4a')](_0x27c213[_0xa9d1('0x46')]['fields']));_0x210878[_0xa9d1('0x49')]=_0x210878[_0xa9d1('0x49')][_0xa9d1('0x4b')]?_0x210878[_0xa9d1('0x49')]:_0x50d3fc[_0xa9d1('0x48')];if(!_0x27c213[_0xa9d1('0x46')][_0xa9d1('0x4c')](_0xa9d1('0x4d'))){_0x210878[_0xa9d1('0x30')]=qs['limit'](_0x27c213[_0xa9d1('0x46')][_0xa9d1('0x30')]);_0x210878[_0xa9d1('0x2f')]=qs[_0xa9d1('0x2f')](_0x27c213['query'][_0xa9d1('0x2f')]);}_0x210878[_0xa9d1('0x4e')]=qs[_0xa9d1('0x4f')](_0x27c213[_0xa9d1('0x46')]['sort']);_0x210878['where']=qs[_0xa9d1('0x50')](_[_0xa9d1('0x51')](_0x27c213['query'],_0x50d3fc[_0xa9d1('0x50')]),_0x2a0b3f);if(_0x27c213[_0xa9d1('0x46')][_0xa9d1('0x52')]){_0x210878[_0xa9d1('0x53')]=_[_0xa9d1('0x54')](_0x210878['where'],{'$or':_[_0xa9d1('0x40')](_0x2a0b3f,function(_0x4d872b){if(_0x4d872b[_0xa9d1('0x43')]!==_0xa9d1('0x55')){var _0x3e4ab6={};_0x3e4ab6[_0x4d872b[_0xa9d1('0x45')]]={'$like':'%'+_0x27c213[_0xa9d1('0x46')][_0xa9d1('0x52')]+'%'};return _0x3e4ab6;}})});}_0x210878=_[_0xa9d1('0x54')]({},_0x210878,_0x27c213[_0xa9d1('0x56')]);var _0x3900a8={'where':_0x210878[_0xa9d1('0x53')]};return db['FaxAccount'][_0xa9d1('0x32')](_0x3900a8)['then'](function(_0x4ff481){_0x5e8e99['count']=_0x4ff481;if(_0x27c213[_0xa9d1('0x46')][_0xa9d1('0x57')]){_0x210878[_0xa9d1('0x58')]=[{'all':!![]}];}return db[_0xa9d1('0x59')][_0xa9d1('0x5a')](_0x210878);})[_0xa9d1('0x20')](function(_0x21f9bd){_0x5e8e99[_0xa9d1('0x5b')]=_0x21f9bd;return _0x5e8e99;})[_0xa9d1('0x20')](respondWithFilteredResult(_0x2085b4,_0x210878))['catch'](handleError(_0x2085b4,null));};exports[_0xa9d1('0x5c')]=function(_0x52e8eb,_0x15fe4e){var _0x3dae04={'raw':![],'where':{'id':_0x52e8eb[_0xa9d1('0x5d')]['id']},'include':[{'model':db[_0xa9d1('0x3e')],'as':_0xa9d1('0x3f')}]},_0x43869b={};_0x43869b['model']=_['keys'](db[_0xa9d1('0x59')][_0xa9d1('0x41')]);_0x43869b[_0xa9d1('0x46')]=_['keys'](_0x52e8eb[_0xa9d1('0x46')]);_0x43869b[_0xa9d1('0x50')]=_[_0xa9d1('0x47')](_0x43869b[_0xa9d1('0x48')],_0x43869b[_0xa9d1('0x46')]);_0x3dae04[_0xa9d1('0x49')]=_['intersection'](_0x43869b[_0xa9d1('0x48')],qs[_0xa9d1('0x4a')](_0x52e8eb[_0xa9d1('0x46')][_0xa9d1('0x4a')]));_0x3dae04[_0xa9d1('0x49')]=_0x3dae04[_0xa9d1('0x49')]['length']?_0x3dae04['attributes']:_0x43869b[_0xa9d1('0x48')];if(_0x52e8eb[_0xa9d1('0x46')]['includeAll']){_0x3dae04[_0xa9d1('0x58')]=[{'all':!![]}];}_0x3dae04=_['merge']({},_0x3dae04,_0x52e8eb[_0xa9d1('0x56')]);return db[_0xa9d1('0x59')]['find'](_0x3dae04)[_0xa9d1('0x20')](handleEntityNotFound(_0x15fe4e,null))['then'](respondWithResult(_0x15fe4e,null))[_0xa9d1('0x2a')](handleError(_0x15fe4e,null));};exports[_0xa9d1('0x5e')]=function(_0x4f9f7a,_0x5435d3){return db[_0xa9d1('0x59')][_0xa9d1('0x5e')](_0x4f9f7a['body'],{})['then'](function(_0x5011f4){var _0x2d60b5=_0x4f9f7a[_0xa9d1('0x5f')][_0xa9d1('0x60')]({'plain':!![]});if(!_0x2d60b5)throw new Error(_0xa9d1('0x61'));if(_0x2d60b5['role']===_0xa9d1('0x5f')){var _0x55c096=_0x5011f4[_0xa9d1('0x60')]({'plain':!![]});var _0x23f380=_0xa9d1('0x3a');return db[_0xa9d1('0x62')]['find']({'where':{'name':_0x23f380,'userProfileId':_0x2d60b5[_0xa9d1('0x63')]},'raw':!![]})[_0xa9d1('0x20')](function(_0x43276c){if(_0x43276c&&_0x43276c['autoAssociation']===0x0){return db[_0xa9d1('0x3b')]['create']({'name':_0x55c096['name'],'resourceId':_0x55c096['id'],'type':_0x43276c[_0xa9d1('0x45')],'sectionId':_0x43276c['id']},{})[_0xa9d1('0x20')](function(){return _0x5011f4;});}else{return _0x5011f4;}})[_0xa9d1('0x2a')](function(_0x2ac34e){logger[_0xa9d1('0x26')](_0xa9d1('0x64'),_0x2ac34e);throw _0x2ac34e;});}return _0x5011f4;})[_0xa9d1('0x20')](respondWithResult(_0x5435d3,0xc9))[_0xa9d1('0x2a')](handleError(_0x5435d3,null));};exports[_0xa9d1('0x38')]=function(_0x51d78f,_0x3238b8){if(_0x51d78f[_0xa9d1('0x65')]['id']){delete _0x51d78f[_0xa9d1('0x65')]['id'];}return db[_0xa9d1('0x59')][_0xa9d1('0x66')]({'where':{'id':_0x51d78f[_0xa9d1('0x5d')]['id']},'include':[{'model':db[_0xa9d1('0x3e')],'as':_0xa9d1('0x3f')}]})['then'](handleEntityNotFound(_0x3238b8,null))[_0xa9d1('0x20')](saveUpdates(_0x51d78f[_0xa9d1('0x65')],null))[_0xa9d1('0x20')](respondWithResult(_0x3238b8,null))['catch'](handleError(_0x3238b8,null));};exports[_0xa9d1('0x39')]=function(_0x1ae4f5,_0x4c9219){return db[_0xa9d1('0x59')][_0xa9d1('0x66')]({'where':{'id':_0x1ae4f5[_0xa9d1('0x5d')]['id']}})[_0xa9d1('0x20')](handleEntityNotFound(_0x4c9219,null))['then'](removeEntity(_0x4c9219,null))[_0xa9d1('0x2a')](handleError(_0x4c9219,null));};exports[_0xa9d1('0x67')]=function(_0x1552d4,_0x24b447){return db[_0xa9d1('0x59')]['describe']()[_0xa9d1('0x20')](respondWithResult(_0x24b447,null))['catch'](handleError(_0x24b447,null));};exports[_0xa9d1('0x68')]=function(_0x544f1a,_0x51a2ac,_0x36d4f0){if(_0x544f1a[_0xa9d1('0x65')]['id']){delete _0x544f1a['body']['id'];}return db[_0xa9d1('0x59')]['find']({'where':{'id':_0x544f1a['params']['id']}})['then'](handleEntityNotFound(_0x51a2ac,null))[_0xa9d1('0x20')](function(_0x50aae6){if(_0x50aae6){_0x544f1a[_0xa9d1('0x65')][_0xa9d1('0x69')]=_0x50aae6['id'];return db[_0xa9d1('0x6a')]['create'](_0x544f1a[_0xa9d1('0x65')]);}})[_0xa9d1('0x20')](respondWithResult(_0x51a2ac,null))[_0xa9d1('0x2a')](handleError(_0x51a2ac,null));};exports[_0xa9d1('0x6b')]=function(_0x67b7b1,_0xe4a480,_0x271e02){var _0x39c885={'raw':![],'where':{}};var _0x461f16={};var _0xf0264f={'count':0x0,'rows':[]};return db[_0xa9d1('0x59')][_0xa9d1('0x6c')]({'where':{'id':_0x67b7b1['params']['id']}})[_0xa9d1('0x20')](handleEntityNotFound(_0xe4a480,null))[_0xa9d1('0x20')](function(_0x5a11c3){if(_0x5a11c3){_0x461f16[_0xa9d1('0x48')]=_[_0xa9d1('0x6d')](db[_0xa9d1('0x6a')][_0xa9d1('0x41')]);_0x461f16[_0xa9d1('0x46')]=_[_0xa9d1('0x6d')](_0x67b7b1['query']);_0x461f16['filters']=_[_0xa9d1('0x47')](_0x461f16['model'],_0x461f16[_0xa9d1('0x46')]);_0x39c885[_0xa9d1('0x49')]=_[_0xa9d1('0x47')](_0x461f16[_0xa9d1('0x48')],qs[_0xa9d1('0x4a')](_0x67b7b1['query'][_0xa9d1('0x4a')]));_0x39c885[_0xa9d1('0x49')]=_0x39c885[_0xa9d1('0x49')]['length']?_0x39c885[_0xa9d1('0x49')]:_0x461f16[_0xa9d1('0x48')];if(!_0x67b7b1[_0xa9d1('0x46')]['hasOwnProperty'](_0xa9d1('0x4d'))){_0x39c885[_0xa9d1('0x30')]=qs[_0xa9d1('0x30')](_0x67b7b1['query'][_0xa9d1('0x30')]);_0x39c885[_0xa9d1('0x2f')]=qs['offset'](_0x67b7b1['query']['offset']);}_0x39c885[_0xa9d1('0x4e')]=qs[_0xa9d1('0x4f')](_0x67b7b1[_0xa9d1('0x46')]['sort']);_0x39c885[_0xa9d1('0x53')]=qs[_0xa9d1('0x50')](_[_0xa9d1('0x51')](_0x67b7b1[_0xa9d1('0x46')],_0x461f16['filters']));_0x39c885[_0xa9d1('0x53')][_0xa9d1('0x69')]=_0x5a11c3['id'];if(_0x67b7b1[_0xa9d1('0x46')][_0xa9d1('0x52')]){_0x39c885['where']=_[_0xa9d1('0x54')](_0x39c885['where'],{'$or':_['map'](_0x39c885[_0xa9d1('0x49')],function(_0x12fe1c){var _0x38463d={};_0x38463d[_0x12fe1c]={'$like':'%'+_0x67b7b1[_0xa9d1('0x46')]['filter']+'%'};return _0x38463d;})});}_0x39c885=_[_0xa9d1('0x54')]({},_0x39c885,_0x67b7b1[_0xa9d1('0x56')]);return db[_0xa9d1('0x6a')]['count']({'where':_0x39c885['where']})[_0xa9d1('0x20')](function(_0x3e145d){_0xf0264f[_0xa9d1('0x32')]=_0x3e145d;if(_0x67b7b1[_0xa9d1('0x46')][_0xa9d1('0x57')]){_0x39c885[_0xa9d1('0x58')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x39c885);})['then'](function(_0x438173){_0xf0264f[_0xa9d1('0x5b')]=_0x438173;return _0xf0264f;});}})[_0xa9d1('0x20')](respondWithFilteredResult(_0xe4a480,_0x39c885))[_0xa9d1('0x2a')](handleError(_0xe4a480,null));};exports['removeDispositions']=function(_0x5912af,_0x1d0335,_0x9cea7f){return db['FaxAccount'][_0xa9d1('0x66')]({'where':{'id':_0x5912af[_0xa9d1('0x5d')]['id']}})[_0xa9d1('0x20')](handleEntityNotFound(_0x1d0335,null))['then'](function(_0x3bf3c4){if(_0x3bf3c4){return _0x3bf3c4[_0xa9d1('0x6e')](_0x5912af[_0xa9d1('0x46')][_0xa9d1('0x6f')]);}})[_0xa9d1('0x20')](respondWithStatusCode(_0x1d0335,null))['catch'](handleError(_0x1d0335,null));};exports[_0xa9d1('0x70')]=function(_0x562d8e,_0x5dc60e,_0x3b70f3){if(_0x562d8e['body']['id']){delete _0x562d8e['body']['id'];}return db['FaxAccount']['find']({'where':{'id':_0x562d8e[_0xa9d1('0x5d')]['id']}})[_0xa9d1('0x20')](handleEntityNotFound(_0x5dc60e,null))[_0xa9d1('0x20')](function(_0x339c9b){if(_0x339c9b){_0x562d8e['body'][_0xa9d1('0x69')]=_0x339c9b['id'];return db['CannedAnswer']['create'](_0x562d8e['body']);}})['then'](respondWithResult(_0x5dc60e,null))[_0xa9d1('0x2a')](handleError(_0x5dc60e,null));};exports['getAnswers']=function(_0x255aab,_0x4cf6af,_0x2e714d){var _0x3cd63e={'raw':![],'where':{}};var _0x38b973={};var _0x19ff8d={'count':0x0,'rows':[]};return db[_0xa9d1('0x59')][_0xa9d1('0x6c')]({'where':{'id':_0x255aab[_0xa9d1('0x5d')]['id']}})[_0xa9d1('0x20')](handleEntityNotFound(_0x4cf6af,null))['then'](function(_0x5ac087){if(_0x5ac087){_0x38b973[_0xa9d1('0x48')]=_['keys'](db[_0xa9d1('0x71')][_0xa9d1('0x41')]);_0x38b973[_0xa9d1('0x46')]=_['keys'](_0x255aab[_0xa9d1('0x46')]);_0x38b973[_0xa9d1('0x50')]=_['intersection'](_0x38b973[_0xa9d1('0x48')],_0x38b973[_0xa9d1('0x46')]);_0x3cd63e[_0xa9d1('0x49')]=_[_0xa9d1('0x47')](_0x38b973[_0xa9d1('0x48')],qs[_0xa9d1('0x4a')](_0x255aab[_0xa9d1('0x46')][_0xa9d1('0x4a')]));_0x3cd63e[_0xa9d1('0x49')]=_0x3cd63e[_0xa9d1('0x49')][_0xa9d1('0x4b')]?_0x3cd63e['attributes']:_0x38b973['model'];if(!_0x255aab['query']['hasOwnProperty'](_0xa9d1('0x4d'))){_0x3cd63e['limit']=qs[_0xa9d1('0x30')](_0x255aab[_0xa9d1('0x46')][_0xa9d1('0x30')]);_0x3cd63e['offset']=qs['offset'](_0x255aab[_0xa9d1('0x46')]['offset']);}_0x3cd63e['order']=qs[_0xa9d1('0x4f')](_0x255aab[_0xa9d1('0x46')][_0xa9d1('0x4f')]);_0x3cd63e['where']=qs[_0xa9d1('0x50')](_[_0xa9d1('0x51')](_0x255aab['query'],_0x38b973[_0xa9d1('0x50')]));_0x3cd63e[_0xa9d1('0x53')][_0xa9d1('0x69')]=_0x5ac087['id'];if(_0x255aab[_0xa9d1('0x46')][_0xa9d1('0x52')]){_0x3cd63e[_0xa9d1('0x53')]=_['merge'](_0x3cd63e[_0xa9d1('0x53')],{'$or':_[_0xa9d1('0x40')](_0x3cd63e[_0xa9d1('0x49')],function(_0x1ab1ce){var _0x14eda0={};_0x14eda0[_0x1ab1ce]={'$like':'%'+_0x255aab[_0xa9d1('0x46')][_0xa9d1('0x52')]+'%'};return _0x14eda0;})});}_0x3cd63e=_['merge']({},_0x3cd63e,_0x255aab['options']);return db['CannedAnswer']['count']({'where':_0x3cd63e['where']})[_0xa9d1('0x20')](function(_0x34681a){_0x19ff8d['count']=_0x34681a;if(_0x255aab[_0xa9d1('0x46')][_0xa9d1('0x57')]){_0x3cd63e[_0xa9d1('0x58')]=[{'all':!![]}];}return db[_0xa9d1('0x71')][_0xa9d1('0x5a')](_0x3cd63e);})[_0xa9d1('0x20')](function(_0x18448c){_0x19ff8d[_0xa9d1('0x5b')]=_0x18448c;return _0x19ff8d;});}})[_0xa9d1('0x20')](respondWithFilteredResult(_0x4cf6af,_0x3cd63e))['catch'](handleError(_0x4cf6af,null));};exports['removeAnswers']=function(_0x3136a1,_0x3a1943,_0x414fd5){return db[_0xa9d1('0x59')]['find']({'where':{'id':_0x3136a1[_0xa9d1('0x5d')]['id']}})[_0xa9d1('0x20')](handleEntityNotFound(_0x3a1943,null))[_0xa9d1('0x20')](function(_0x2c88f0){if(_0x2c88f0){return _0x2c88f0[_0xa9d1('0x72')](_0x3136a1[_0xa9d1('0x46')][_0xa9d1('0x6f')]);}})[_0xa9d1('0x20')](respondWithStatusCode(_0x3a1943,null))[_0xa9d1('0x2a')](handleError(_0x3a1943,null));};exports[_0xa9d1('0x73')]=function(_0x1db0f5,_0x4dadd7,_0xf88832){return db['FaxInteraction']['find']({'where':{'id':_0x1db0f5[_0xa9d1('0x5d')]['id']}})[_0xa9d1('0x20')](handleEntityNotFound(_0x4dadd7,null))[_0xa9d1('0x20')](function(_0x4092ac){if(_0x4092ac){return _0x4092ac[_0xa9d1('0x73')](_0x1db0f5[_0xa9d1('0x65')][_0xa9d1('0x6f')],_[_0xa9d1('0x74')](_0x1db0f5[_0xa9d1('0x65')],[_0xa9d1('0x6f'),'id'])||{});}})[_0xa9d1('0x20')](respondWithResult(_0x4dadd7,null))[_0xa9d1('0x2a')](handleError(_0x4dadd7,null));};exports[_0xa9d1('0x75')]=function(_0xfb4c67,_0x1ac05c,_0x34dae2){var _0x1e95ce={'raw':![],'where':{}};var _0x2333d9={};var _0x21a131={'count':0x0,'rows':[]};return db[_0xa9d1('0x59')][_0xa9d1('0x6c')]({'where':{'id':_0xfb4c67[_0xa9d1('0x5d')]['id']}})[_0xa9d1('0x20')](handleEntityNotFound(_0x1ac05c,null))['then'](function(_0x551c91){if(_0x551c91){_0x2333d9[_0xa9d1('0x48')]=_[_0xa9d1('0x6d')](db[_0xa9d1('0x76')][_0xa9d1('0x41')]);_0x2333d9['query']=_[_0xa9d1('0x6d')](_0xfb4c67[_0xa9d1('0x46')]);_0x2333d9[_0xa9d1('0x50')]=_['intersection'](_0x2333d9[_0xa9d1('0x48')],_0x2333d9[_0xa9d1('0x46')]);_0x1e95ce[_0xa9d1('0x49')]=_['intersection'](_0x2333d9[_0xa9d1('0x48')],qs[_0xa9d1('0x4a')](_0xfb4c67['query']['fields']));_0x1e95ce['attributes']=_0x1e95ce[_0xa9d1('0x49')][_0xa9d1('0x4b')]?_0x1e95ce['attributes']:_0x2333d9[_0xa9d1('0x48')];if(!_0xfb4c67[_0xa9d1('0x46')][_0xa9d1('0x4c')]('nolimit')){_0x1e95ce[_0xa9d1('0x30')]=qs['limit'](_0xfb4c67[_0xa9d1('0x46')][_0xa9d1('0x30')]);_0x1e95ce['offset']=qs['offset'](_0xfb4c67['query'][_0xa9d1('0x2f')]);}_0x1e95ce[_0xa9d1('0x4e')]=qs[_0xa9d1('0x4f')](_0xfb4c67['query'][_0xa9d1('0x4f')]);_0x1e95ce[_0xa9d1('0x53')]=qs['filters'](_['pick'](_0xfb4c67['query'],_0x2333d9[_0xa9d1('0x50')]));_0x1e95ce[_0xa9d1('0x53')][_0xa9d1('0x69')]=_0x551c91['id'];if(_0xfb4c67[_0xa9d1('0x46')][_0xa9d1('0x52')]){_0x1e95ce[_0xa9d1('0x53')]=_['merge'](_0x1e95ce[_0xa9d1('0x53')],{'$or':_[_0xa9d1('0x40')](_0x1e95ce[_0xa9d1('0x49')],function(_0x53d536){var _0x15fa72={};_0x15fa72[_0x53d536]={'$like':'%'+_0xfb4c67[_0xa9d1('0x46')][_0xa9d1('0x52')]+'%'};return _0x15fa72;})});}_0x1e95ce=_[_0xa9d1('0x54')]({},_0x1e95ce,_0xfb4c67[_0xa9d1('0x56')]);return db[_0xa9d1('0x76')][_0xa9d1('0x32')]({'where':_0x1e95ce[_0xa9d1('0x53')]})[_0xa9d1('0x20')](function(_0x33d8e1){_0x21a131[_0xa9d1('0x32')]=_0x33d8e1;if(_0xfb4c67[_0xa9d1('0x46')][_0xa9d1('0x57')]){_0x1e95ce['include']=[{'model':db[_0xa9d1('0x77')],'as':_0xa9d1('0x78'),'required':![]},{'model':db[_0xa9d1('0x79')],'as':'Owner','attributes':['name',_0xa9d1('0x7a'),_0xa9d1('0x7b')],'required':![]},{'model':db[_0xa9d1('0x7c')],'as':'Tags','attributes':['id',_0xa9d1('0x45'),_0xa9d1('0x7d')],'where':_0xfb4c67[_0xa9d1('0x46')][_0xa9d1('0x7e')]?{'id':_0xfb4c67[_0xa9d1('0x46')][_0xa9d1('0x7e')]}:undefined,'required':_0xfb4c67[_0xa9d1('0x46')][_0xa9d1('0x7e')]?!![]:![]}];}return db['FaxInteraction'][_0xa9d1('0x5a')](_0x1e95ce);})['then'](function(_0x194371){_0x21a131[_0xa9d1('0x5b')]=_0x194371;return _0x21a131;});}})[_0xa9d1('0x20')](respondWithFilteredResult(_0x1ac05c,_0x1e95ce))['catch'](handleError(_0x1ac05c,null));};exports[_0xa9d1('0x7f')]=function(_0x25755e,_0x36c242){var _0x1d84fe=_0x25755e[_0xa9d1('0x5d')]['id'];var _0xd52412=_0x25755e[_0xa9d1('0x65')];var _0x146ed6=0xc8;var _0x8e98d7=null;return db['sequelize'][_0xa9d1('0x80')]({'isolationLevel':db[_0xa9d1('0x81')][_0xa9d1('0x82')][_0xa9d1('0x83')][_0xa9d1('0x84')]},function(_0x139b16){return db[_0xa9d1('0x59')]['findOne']({'where':{'id':_0x1d84fe},'transaction':_0x139b16})[_0xa9d1('0x20')](function(_0x33b4c3){if(_0x33b4c3){return db[_0xa9d1('0x85')][_0xa9d1('0x39')]({'where':{'FaxAccountId':_0x1d84fe},'transaction':_0x139b16})[_0xa9d1('0x20')](function(){var _0x36aa88=_[_0xa9d1('0x40')](_0xd52412,function(_0x1341e9){_0x1341e9['FaxAccountId']=_0x1d84fe;return _0x1341e9;});return db[_0xa9d1('0x85')][_0xa9d1('0x86')](_0x36aa88,{'transaction':_0x139b16});});}else{_0x146ed6=0x194;_0x8e98d7=[];}});})[_0xa9d1('0x20')](function(){if(_0x146ed6!==0x194){return db[_0xa9d1('0x85')][_0xa9d1('0x87')]({'where':{'FaxAccountId':_0x1d84fe},'order':_0xa9d1('0x88')})[_0xa9d1('0x20')](function(_0x213599){_0x8e98d7=_0x213599;});}})[_0xa9d1('0x2a')](function(_0x4df33c){_0x146ed6=0x1f4;logger[_0xa9d1('0x26')](_0x4df33c['stack']);if(_0x4df33c[_0xa9d1('0x45')]){delete _0x4df33c[_0xa9d1('0x45')];}_0x8e98d7=_0x4df33c;})[_0xa9d1('0x89')](function(){if(_0x8e98d7===null){_0x36c242['sendStatus'](_0x146ed6);}else{if(_0x146ed6===0x1f4){_0x36c242['status'](_0x146ed6)[_0xa9d1('0x8a')](_0x8e98d7);}else{_0x36c242[_0xa9d1('0x2c')](_0x146ed6)[_0xa9d1('0x2e')](_0x8e98d7);}}});};exports[_0xa9d1('0x8b')]=function(_0x4c8738,_0x505414,_0x4c0336){var _0x44e18b={};var _0x4a0608={};var _0x55c73d;var _0x424480;return db[_0xa9d1('0x59')]['findOne']({'where':{'id':_0x4c8738[_0xa9d1('0x5d')]['id']}})['then'](handleEntityNotFound(_0x505414,null))[_0xa9d1('0x20')](function(_0x3fb2c6){if(_0x3fb2c6){_0x55c73d=_0x3fb2c6;_0x4a0608[_0xa9d1('0x48')]=_[_0xa9d1('0x6d')](db[_0xa9d1('0x85')][_0xa9d1('0x41')]);_0x4a0608[_0xa9d1('0x46')]=_['keys'](_0x4c8738[_0xa9d1('0x46')]);_0x4a0608[_0xa9d1('0x50')]=_[_0xa9d1('0x47')](_0x4a0608[_0xa9d1('0x48')],_0x4a0608[_0xa9d1('0x46')]);_0x44e18b[_0xa9d1('0x49')]=_[_0xa9d1('0x47')](_0x4a0608[_0xa9d1('0x48')],qs[_0xa9d1('0x4a')](_0x4c8738[_0xa9d1('0x46')][_0xa9d1('0x4a')]));_0x44e18b[_0xa9d1('0x49')]=_0x44e18b['attributes'][_0xa9d1('0x4b')]?_0x44e18b[_0xa9d1('0x49')]:_0x4a0608[_0xa9d1('0x48')];_0x44e18b[_0xa9d1('0x4e')]=qs['sort'](_0x4c8738[_0xa9d1('0x46')][_0xa9d1('0x4f')]);_0x44e18b['where']=qs['filters'](_['pick'](_0x4c8738[_0xa9d1('0x46')],_0x4a0608[_0xa9d1('0x50')]));if(_0x4c8738['query']['filter']){_0x44e18b[_0xa9d1('0x53')]=_[_0xa9d1('0x54')](_0x44e18b['where'],{'$or':_[_0xa9d1('0x40')](_0x44e18b[_0xa9d1('0x49')],function(_0x324aa7){var _0x59c99a={};_0x59c99a[_0x324aa7]={'$like':'%'+_0x4c8738[_0xa9d1('0x46')][_0xa9d1('0x52')]+'%'};return _0x59c99a;})});}_0x44e18b=_['merge']({},_0x44e18b,_0x4c8738[_0xa9d1('0x56')]);return _0x55c73d[_0xa9d1('0x8b')](_0x44e18b);}})[_0xa9d1('0x20')](function(_0x5a649c){if(_0x5a649c){_0x424480=_0x5a649c['length'];if(!_0x4c8738[_0xa9d1('0x46')][_0xa9d1('0x4c')](_0xa9d1('0x4d'))){_0x44e18b[_0xa9d1('0x30')]=qs['limit'](_0x4c8738[_0xa9d1('0x46')][_0xa9d1('0x30')]);_0x44e18b['offset']=qs['offset'](_0x4c8738[_0xa9d1('0x46')][_0xa9d1('0x2f')]);}return _0x55c73d['getApplications'](_0x44e18b);}})[_0xa9d1('0x20')](function(_0x47c4e1){if(_0x47c4e1){return _0x47c4e1?{'count':_0x424480,'rows':_0x47c4e1}:null;}})[_0xa9d1('0x20')](respondWithResult(_0x505414,null))[_0xa9d1('0x2a')](handleError(_0x505414,null));};function Extension(_0x400cb9,_0x1d9a63,_0x28119b,_0x2fd9d9){this[_0xa9d1('0x8c')]='from-voip-provider';this[_0xa9d1('0x8d')]=_0x400cb9[_0xa9d1('0x8e')];this[_0xa9d1('0x8f')]=_0x2fd9d9;this['type']='system';this['description']=_0xa9d1('0x90');this[_0xa9d1('0x69')]=_0x400cb9['id'];this[_0xa9d1('0x88')]=_0x1d9a63;this[_0xa9d1('0x91')]=_0x28119b;}function createExtensionsReciveFax(_0x3f6335){var _0xd6d5aa=0x1;var _0x2b74fa=[];_0x2b74fa[_0xa9d1('0x92')](new Extension(_0x3f6335,_0xd6d5aa,'',_0xa9d1('0x93')));_0xd6d5aa+=0x1;_0x2b74fa[_0xa9d1('0x92')](new Extension(_0x3f6335,_0xd6d5aa,_0xa9d1('0x94'),_0xa9d1('0x95')));_0xd6d5aa+=0x1;for(var _0x57cdcf in _0x3f6335){if(_0x3f6335['hasOwnProperty'](_0x57cdcf)&&(_0x57cdcf===_0xa9d1('0x96')||_0x57cdcf==='localstationid'||_0x57cdcf===_0xa9d1('0x97')||_0x57cdcf===_0xa9d1('0x98')||_0x57cdcf==='headerinfo'||_0x57cdcf==='maxrate'||_0x57cdcf===_0xa9d1('0x99')||_0x57cdcf===_0xa9d1('0x9a')||_0x57cdcf===_0xa9d1('0x9b'))){_0x2b74fa[_0xa9d1('0x92')](new Extension(_0x3f6335,_0xd6d5aa,_0xa9d1('0x9c')+_0x57cdcf+')='+_0x3f6335[_0x57cdcf],_0xa9d1('0x95')));_0xd6d5aa+=0x1;}}_0x2b74fa[_0xa9d1('0x92')](new Extension(_0x3f6335,_0xd6d5aa,'6','Wait'));_0xd6d5aa+=0x1;_0x2b74fa[_0xa9d1('0x92')](new Extension(_0x3f6335,_0xd6d5aa,_0xa9d1('0x9d'),'ReceiveFax'));_0xd6d5aa=0x0;return _0x2b74fa;}exports['addAccountApplications']=function(_0x109623,_0xb6efc8,_0x2e4f73){var _0x35bcc8;return db['sequelize'][_0xa9d1('0x80')](function(_0x49794e){return db[_0xa9d1('0x59')][_0xa9d1('0x5e')](_0x109623['body'],{'transaction':_0x49794e})[_0xa9d1('0x20')](function(_0x2fa5b5){_0x35bcc8=_0x2fa5b5['get']({'plain':!![]});return db[_0xa9d1('0x9e')][_0xa9d1('0x86')](createExtensionsReciveFax(_0x35bcc8),{'transaction':_0x49794e});});})[_0xa9d1('0x20')](function(){return _0x35bcc8;})['then'](respondWithResult(_0xb6efc8,null))['catch'](handleError(_0xb6efc8,null));};exports[_0xa9d1('0x9f')]=function(_0x41046e,_0x5a75e4,_0x520fff){var _0x3e72ce;return db['sequelize'][_0xa9d1('0x80')](function(_0x4f2b5c){return db['FaxAccount'][_0xa9d1('0x38')](_0x41046e[_0xa9d1('0x65')],{'where':{'id':_0x41046e[_0xa9d1('0x65')]['id']},'transaction':_0x4f2b5c})['then'](function(_0x6dfe07){return db[_0xa9d1('0x9e')][_0xa9d1('0x39')]({'where':{'FaxAccountId':_0x41046e[_0xa9d1('0x65')]['id']},'transaction':_0x4f2b5c})['then'](function(_0x1ce9cc){return db[_0xa9d1('0x9e')][_0xa9d1('0x86')](createExtensionsReciveFax(_[_0xa9d1('0x74')](_0x41046e[_0xa9d1('0x65')],[_0xa9d1('0xa0'),_0xa9d1('0x44'),'createdAt',_0xa9d1('0xa1'),_0xa9d1('0xa2'),_0xa9d1('0xa3')])),{'transaction':_0x4f2b5c});});});})[_0xa9d1('0x20')](function(){return db[_0xa9d1('0x59')][_0xa9d1('0xa4')](_0x41046e[_0xa9d1('0x65')]['id']);})[_0xa9d1('0x20')](respondWithResult(_0x5a75e4,null))[_0xa9d1('0x2a')](handleError(_0x5a75e4,null));};exports[_0xa9d1('0xa5')]=function(_0x4f46c2,_0x2d7594,_0x76500){var _0x5e642e={'raw':!![],'where':{}};var _0x4b884e={};var _0x48911f={'count':0x0,'rows':[]};return db['FaxAccount'][_0xa9d1('0x6c')]({'where':{'id':_0x4f46c2['params']['id']}})[_0xa9d1('0x20')](handleEntityNotFound(_0x2d7594,null))[_0xa9d1('0x20')](function(_0xa210d0){if(_0xa210d0){_0x4b884e[_0xa9d1('0x48')]=_[_0xa9d1('0x6d')](db[_0xa9d1('0xa6')][_0xa9d1('0x41')]);_0x4b884e['query']=_['keys'](_0x4f46c2[_0xa9d1('0x46')]);_0x4b884e['filters']=_[_0xa9d1('0x47')](_0x4b884e[_0xa9d1('0x48')],_0x4b884e[_0xa9d1('0x46')]);_0x5e642e[_0xa9d1('0x49')]=_['intersection'](_0x4b884e[_0xa9d1('0x48')],qs[_0xa9d1('0x4a')](_0x4f46c2[_0xa9d1('0x46')][_0xa9d1('0x4a')]));_0x5e642e[_0xa9d1('0x49')]=_0x5e642e[_0xa9d1('0x49')]['length']?_0x5e642e[_0xa9d1('0x49')]:_0x4b884e[_0xa9d1('0x48')];if(!_0x4f46c2[_0xa9d1('0x46')][_0xa9d1('0x4c')](_0xa9d1('0x4d'))){_0x5e642e[_0xa9d1('0x30')]=qs['limit'](_0x4f46c2[_0xa9d1('0x46')][_0xa9d1('0x30')]);_0x5e642e[_0xa9d1('0x2f')]=qs[_0xa9d1('0x2f')](_0x4f46c2[_0xa9d1('0x46')]['offset']);}_0x5e642e[_0xa9d1('0x4e')]=qs[_0xa9d1('0x4f')](_0x4f46c2[_0xa9d1('0x46')][_0xa9d1('0x4f')]);_0x5e642e[_0xa9d1('0x53')]=qs[_0xa9d1('0x50')](_[_0xa9d1('0x51')](_0x4f46c2['query'],_0x4b884e[_0xa9d1('0x50')]));_0x5e642e[_0xa9d1('0x53')][_0xa9d1('0x69')]=_0xa210d0['id'];if(_0x4f46c2['query']['filter']){_0x5e642e[_0xa9d1('0x53')]=_[_0xa9d1('0x54')](_0x5e642e['where'],{'$or':_[_0xa9d1('0x40')](_0x5e642e[_0xa9d1('0x49')],function(_0x4b3c65){var _0x2af54e={};_0x2af54e[_0x4b3c65]={'$like':'%'+_0x4f46c2[_0xa9d1('0x46')][_0xa9d1('0x52')]+'%'};return _0x2af54e;})});}if(_0x4f46c2[_0xa9d1('0x46')][_0xa9d1('0xa7')]){var _0x2177d1=_0x4f46c2['query'][_0xa9d1('0xa7')]['split'](',');var _0x28efa8={};_0x28efa8[_0x2177d1[0x0]]={'$gte':moment(_0x2177d1[0x1])['format'](_0xa9d1('0xa8'))};_0x5e642e[_0xa9d1('0x53')]=_[_0xa9d1('0x54')](_0x5e642e[_0xa9d1('0x53')],_0x28efa8);}_0x5e642e=_['merge']({},_0x5e642e,_0x4f46c2[_0xa9d1('0x56')]);return db['FaxMessage'][_0xa9d1('0x32')]({'where':_0x5e642e['where']})[_0xa9d1('0x20')](function(_0x2439b0){_0x48911f[_0xa9d1('0x32')]=_0x2439b0;if(_0x4f46c2[_0xa9d1('0x46')][_0xa9d1('0x57')]){_0x5e642e['include']=[{'all':!![]}];}return db[_0xa9d1('0xa6')][_0xa9d1('0x5a')](_0x5e642e);})['then'](function(_0x380656){_0x48911f[_0xa9d1('0x5b')]=_0x380656;return _0x48911f;});}})[_0xa9d1('0x20')](respondWithFilteredResult(_0x2d7594,_0x5e642e))[_0xa9d1('0x2a')](handleError(_0x2d7594,null));};exports[_0xa9d1('0x8a')]=function(_0x9a359c,_0x499f67,_0x97035){var _0x3db9fb,_0x195e35={},_0x110917;if(_0x9a359c['body']['to']){_0x110917=_0x9a359c[_0xa9d1('0x65')]['to'][0x0];}return db[_0xa9d1('0x59')][_0xa9d1('0x66')]({'where':{'id':_0x9a359c[_0xa9d1('0x5d')]['id']},'include':[{'model':db[_0xa9d1('0xa9')],'as':'List','include':[{'model':db[_0xa9d1('0x77')],'as':'Contacts','where':{'fax':_0x110917},'limit':0x1,'order':[[_0xa9d1('0xa1'),_0xa9d1('0xaa')]]}]}]})[_0xa9d1('0x20')](handleEntityNotFound(_0x499f67,null))[_0xa9d1('0x20')](function(_0x5e782f){_0x3db9fb=_0x5e782f;if(_0x9a359c['body'][_0xa9d1('0xab')]&&_0x9a359c[_0xa9d1('0x65')]['attachments']['length']){for(var _0x479138=0x0;_0x479138<_0x9a359c[_0xa9d1('0x65')][_0xa9d1('0xab')][_0xa9d1('0x4b')];_0x479138+=0x1){_0x9a359c[_0xa9d1('0x65')][_0xa9d1('0xab')][_0x479138]={'filename':_0x9a359c[_0xa9d1('0x65')][_0xa9d1('0xab')][_0x479138][_0xa9d1('0x45')],'id':_0x9a359c[_0xa9d1('0x65')][_0xa9d1('0xab')][_0x479138]['id'],'path':path[_0xa9d1('0xac')](config[_0xa9d1('0xad')],_0xa9d1('0xae'),_0x9a359c[_0xa9d1('0x65')][_0xa9d1('0xab')][_0x479138][_0xa9d1('0xaf')])};}}return respondWithRpcPromise(_0xa9d1('0xb0'),_0xa9d1('0xb0'),{'FaxAccountId':_[_0xa9d1('0xb1')](_0x9a359c[_0xa9d1('0x5d')]['id'])?undefined:_0x9a359c['params']['id'],'path':_[_0xa9d1('0xb1')](_0x9a359c[_0xa9d1('0x65')][_0xa9d1('0xab')][0x0]['path'])?undefined:_0x9a359c[_0xa9d1('0x65')]['attachments'][0x0]['path'],'fax':_[_0xa9d1('0xb1')](_0x9a359c[_0xa9d1('0x65')]['to'][0x0])?undefined:_0x9a359c[_0xa9d1('0x65')]['to'][0x0]},client9002);})['then'](function(){if(_0x3db9fb){if(_[_0xa9d1('0xb1')](_0x9a359c[_0xa9d1('0x65')][_0xa9d1('0xb2')])){_0x9a359c[_0xa9d1('0x65')][_0xa9d1('0xb2')]=util['format'](_0xa9d1('0xb3'),_0x3db9fb[_0xa9d1('0x45')],_0x3db9fb['fax']);}if(_0x3db9fb[_0xa9d1('0xb4')]){if(_0x3db9fb[_0xa9d1('0xb4')][_0xa9d1('0xb5')][_0xa9d1('0x4b')]){return _0x3db9fb[_0xa9d1('0xb4')][_0xa9d1('0xb5')][0x0];}else{return db[_0xa9d1('0x77')][_0xa9d1('0x5e')](_[_0xa9d1('0x18')](_0x9a359c[_0xa9d1('0x65')],{'firstName':_0x9a359c[_0xa9d1('0x65')]['to'][0x0],'phone':_0x9a359c[_0xa9d1('0x65')]['to'][0x0],'fax':_0x9a359c[_0xa9d1('0x65')]['to'][0x0],'ListId':_0x3db9fb[_0xa9d1('0xa3')]}));}}else{throw new Error(_0xa9d1('0xb6'));}}else{throw new Error(_0xa9d1('0xb7'));}})['then'](function(_0x4e2ec5){if(_0x4e2ec5){return db[_0xa9d1('0x76')][_0xa9d1('0x66')]({'where':{'ContactId':_0x4e2ec5['id'],'closed':![],'FaxAccountId':_0x3db9fb['id']}})[_0xa9d1('0x20')](function(_0x39ab0f){if(_0x39ab0f){return[_0x39ab0f,![]];}return db[_0xa9d1('0x76')][_0xa9d1('0x5e')]({'UserId':_0x9a359c[_0xa9d1('0x5f')]['id'],'ContactId':_0x4e2ec5['id'],'FaxAccountId':_0x3db9fb['id'],'fax':_0x9a359c['body']['to'][0x0],'firstMsgDirection':'out','Messages':[_[_0xa9d1('0x54')](_0x9a359c[_0xa9d1('0x65')],{'read':![],'body':_0x9a359c[_0xa9d1('0x65')][_0xa9d1('0xab')][0x0][_0xa9d1('0xb8')],'FaxAccountId':_0x3db9fb['id'],'UserId':_0x9a359c[_0xa9d1('0x5f')]['id'],'ContactId':_0x4e2ec5['id'],'AttachmentId':_0x9a359c['body'][_0xa9d1('0xab')][0x0]['id']})]},{'include':[{'model':db['FaxMessage'],'as':_0xa9d1('0xb9')}]})[_0xa9d1('0x20')](function(_0x36431d){return[_0x36431d,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})['spread'](function(_0x1b5f9c,_0x3dd81f){if(_0x3dd81f){return _0x1b5f9c;}return db[_0xa9d1('0xa6')]['create']({'direction':_0xa9d1('0xba'),'read':![],'body':_0x9a359c[_0xa9d1('0x65')]['attachments'][0x0]['filename'],'FaxAccountId':_0x3db9fb['id'],'FaxInteractionId':_0x1b5f9c['id'],'UserId':_0x9a359c[_0xa9d1('0x5f')]['id'],'ContactId':_0x1b5f9c[_0xa9d1('0xbb')],'AttachmentId':_0x9a359c[_0xa9d1('0x65')]['attachments'][0x0]['id']})[_0xa9d1('0x20')](function(_0x4ff96c){_0x1b5f9c[_0xa9d1('0xbc')]['Messages']=[];_0x1b5f9c['dataValues']['Messages'][_0xa9d1('0x92')](_0x4ff96c[_0xa9d1('0xbc')]);return _0x1b5f9c;});})[_0xa9d1('0x20')](function(_0x48b19f){respondWithRpcPromise(_0xa9d1('0xbd'),_0xa9d1('0xbd'),{'FaxAccountId':_['isNil'](_0x9a359c[_0xa9d1('0x5d')]['id'])?undefined:_0x9a359c[_0xa9d1('0x5d')]['id'],'path':_[_0xa9d1('0xb1')](_0x9a359c['body']['attachments'][0x0]['path'])?undefined:_0x9a359c[_0xa9d1('0x65')][_0xa9d1('0xab')][0x0][_0xa9d1('0x4')],'fax':_['isNil'](_0x9a359c['body']['to'][0x0])?undefined:_0x9a359c['body']['to'][0x0],'AttachmentId':_0x9a359c[_0xa9d1('0x65')][_0xa9d1('0xab')][0x0]['id']},client9002)[_0xa9d1('0x20')](function(_0x453563){logger['info']('SendFaxRpc,\x20%s',_0x453563);})[_0xa9d1('0x2a')](function(_0x16f131){logger[_0xa9d1('0x21')]('SendFaxRpc,\x20%s',_0x16f131);});return _0x48b19f;})['then'](respondWithResult(_0x499f67,null))[_0xa9d1('0x2a')](handleError(_0x499f67,null));};exports[_0xa9d1('0xbe')]=function(_0x4374db,_0x48895f,_0x1be907){return db[_0xa9d1('0x59')][_0xa9d1('0x66')]({'where':{'id':_0x4374db[_0xa9d1('0x5d')]['id']}})[_0xa9d1('0x20')](handleEntityNotFound(_0x48895f,null))['then'](function(_0xd488e8){if(_0xd488e8){return _0xd488e8['addAgents'](_0x4374db[_0xa9d1('0x65')][_0xa9d1('0x6f')],_[_0xa9d1('0x74')](_0x4374db[_0xa9d1('0x65')],[_0xa9d1('0x6f'),'id'])||{})[_0xa9d1('0xbf')](function(_0x58bd27){for(var _0x39c8a7=0x0;_0x39c8a7<_0x4374db[_0xa9d1('0x65')][_0xa9d1('0x6f')][_0xa9d1('0x4b')];_0x39c8a7+=0x1){socket[_0xa9d1('0xc0')](_0xa9d1('0xc1'),{'UserId':Number(_0x4374db[_0xa9d1('0x65')][_0xa9d1('0x6f')][_0x39c8a7]),'FaxAccountId':Number(_0x4374db[_0xa9d1('0x5d')]['id'])});}return _0x58bd27;});}})['then'](respondWithResult(_0x48895f,null))['catch'](handleError(_0x48895f,null));};exports[_0xa9d1('0xc2')]=function(_0x421df8,_0xbde608,_0x1c586b){return db[_0xa9d1('0x59')][_0xa9d1('0x66')]({'where':{'id':_0x421df8[_0xa9d1('0x5d')]['id']}})[_0xa9d1('0x20')](handleEntityNotFound(_0xbde608,null))[_0xa9d1('0x20')](function(_0x35e1ae){if(_0x35e1ae){return _0x35e1ae['removeAgents'](_0x421df8[_0xa9d1('0x46')][_0xa9d1('0x6f')])[_0xa9d1('0x20')](function(){if(_[_0xa9d1('0xc3')](_0x421df8[_0xa9d1('0x46')]['ids'])){for(var _0x42b21d=0x0;_0x42b21d<_0x421df8[_0xa9d1('0x46')][_0xa9d1('0x6f')][_0xa9d1('0x4b')];_0x42b21d+=0x1){socket[_0xa9d1('0xc0')](_0xa9d1('0xc4'),{'UserId':Number(_0x421df8[_0xa9d1('0x46')][_0xa9d1('0x6f')][_0x42b21d]),'FaxAccountId':Number(_0x421df8[_0xa9d1('0x5d')]['id'])});}}else{socket[_0xa9d1('0xc0')](_0xa9d1('0xc4'),{'UserId':Number(_0x421df8[_0xa9d1('0x46')][_0xa9d1('0x6f')]),'FaxAccountId':Number(_0x421df8['params']['id'])});}});}})[_0xa9d1('0x20')](respondWithStatusCode(_0xbde608,null))[_0xa9d1('0x2a')](handleError(_0xbde608,null));};exports[_0xa9d1('0xc5')]=function(_0xcaff75,_0x32dfc0,_0x392253){var _0x423502={};var _0x33d414={};var _0x28ed56;var _0x938419;return db[_0xa9d1('0x59')][_0xa9d1('0x6c')]({'where':{'id':_0xcaff75[_0xa9d1('0x5d')]['id']}})['then'](handleEntityNotFound(_0x32dfc0,null))[_0xa9d1('0x20')](function(_0x31fc48){if(_0x31fc48){_0x28ed56=_0x31fc48;_0x33d414[_0xa9d1('0x48')]=_[_0xa9d1('0x6d')](db[_0xa9d1('0x79')][_0xa9d1('0x41')]);_0x33d414[_0xa9d1('0x46')]=_[_0xa9d1('0x6d')](_0xcaff75[_0xa9d1('0x46')]);_0x33d414['filters']=_[_0xa9d1('0x47')](_0x33d414['model'],_0x33d414[_0xa9d1('0x46')]);_0x423502['attributes']=_[_0xa9d1('0x47')](_0x33d414['model'],qs['fields'](_0xcaff75[_0xa9d1('0x46')]['fields']));_0x423502[_0xa9d1('0x49')]=_0x423502[_0xa9d1('0x49')]['length']?_0x423502[_0xa9d1('0x49')]:_0x33d414['model'];_0x423502[_0xa9d1('0x4e')]=qs[_0xa9d1('0x4f')](_0xcaff75[_0xa9d1('0x46')][_0xa9d1('0x4f')]);_0x423502[_0xa9d1('0x53')]=qs[_0xa9d1('0x50')](_['pick'](_0xcaff75[_0xa9d1('0x46')],_0x33d414['filters']));if(_0xcaff75[_0xa9d1('0x46')][_0xa9d1('0x52')]){_0x423502[_0xa9d1('0x53')]=_[_0xa9d1('0x54')](_0x423502['where'],{'$or':_[_0xa9d1('0x40')](_0x423502[_0xa9d1('0x49')],function(_0x531421){var _0x2eb824={};_0x2eb824[_0x531421]={'$like':'%'+_0xcaff75[_0xa9d1('0x46')][_0xa9d1('0x52')]+'%'};return _0x2eb824;})});}_0x423502=_['merge']({},_0x423502,_0xcaff75[_0xa9d1('0x56')]);return _0x28ed56[_0xa9d1('0xc5')](_0x423502);}})[_0xa9d1('0x20')](function(_0x28efa6){if(_0x28efa6){_0x938419=_0x28efa6['length'];if(!_0xcaff75['query'][_0xa9d1('0x4c')](_0xa9d1('0x4d'))){_0x423502[_0xa9d1('0x30')]=qs['limit'](_0xcaff75[_0xa9d1('0x46')][_0xa9d1('0x30')]);_0x423502[_0xa9d1('0x2f')]=qs[_0xa9d1('0x2f')](_0xcaff75[_0xa9d1('0x46')]['offset']);}return _0x28ed56[_0xa9d1('0xc5')](_0x423502);}})[_0xa9d1('0x20')](function(_0x582d18){if(_0x582d18){return _0x582d18?{'count':_0x938419,'rows':_0x582d18}:null;}})[_0xa9d1('0x20')](respondWithResult(_0x32dfc0,null))[_0xa9d1('0x2a')](handleError(_0x32dfc0,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index 8f7929f..56897c6 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 _0x7795=['update','emit','hasOwnProperty','hook','exports','events','FaxAccount','setMaxListeners','save'];(function(_0x1aebb2,_0x54ab2b){var _0x46ed80=function(_0x48c7ee){while(--_0x48c7ee){_0x1aebb2['push'](_0x1aebb2['shift']());}};_0x46ed80(++_0x54ab2b);}(_0x7795,0x149));var _0x5779=function(_0x3af182,_0x5af22e){_0x3af182=_0x3af182-0x0;var _0x376d04=_0x7795[_0x3af182];return _0x376d04;};'use strict';var EventEmitter=require(_0x5779('0x0'));var FaxAccount=require('../../mysqldb')['db'][_0x5779('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x5779('0x2')](0x0);var events={'afterCreate':_0x5779('0x3'),'afterUpdate':_0x5779('0x4'),'afterDestroy':'remove'};function emitEvent(_0x88cd49){return function(_0x52b28d,_0x24ec28,_0x443b4e){FaxAccountEvents[_0x5779('0x5')](_0x88cd49+':'+_0x52b28d['id'],_0x52b28d);FaxAccountEvents[_0x5779('0x5')](_0x88cd49,_0x52b28d);_0x443b4e(null);};}for(var e in events){if(events[_0x5779('0x6')](e)){var event=events[e];FaxAccount[_0x5779('0x7')](e,emitEvent(event));}}module[_0x5779('0x8')]=FaxAccountEvents; \ No newline at end of file +var _0x926f=['hook','exports','events','../../mysqldb','FaxAccount','setMaxListeners','save','update','remove','emit'];(function(_0x44dc2e,_0x8f8cfa){var _0x44e700=function(_0x59be17){while(--_0x59be17){_0x44dc2e['push'](_0x44dc2e['shift']());}};_0x44e700(++_0x8f8cfa);}(_0x926f,0xb6));var _0xf926=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x926f[_0x5b644e];return _0x49c6bf;};'use strict';var EventEmitter=require(_0xf926('0x0'));var FaxAccount=require(_0xf926('0x1'))['db'][_0xf926('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xf926('0x3')](0x0);var events={'afterCreate':_0xf926('0x4'),'afterUpdate':_0xf926('0x5'),'afterDestroy':_0xf926('0x6')};function emitEvent(_0x579719){return function(_0x2b459c,_0x3a463b,_0x2cd78b){FaxAccountEvents[_0xf926('0x7')](_0x579719+':'+_0x2b459c['id'],_0x2b459c);FaxAccountEvents[_0xf926('0x7')](_0x579719,_0x2b459c);_0x2cd78b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxAccount[_0xf926('0x8')](e,emitEvent(event));}}module[_0xf926('0x9')]=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index 476e087..a9bf8b6 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 _0xac0d=['../../config/environment','exports','FaxAccount','fax_accounts','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xac0d,0x10c));var _0xdac0=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0xac0d[_0x25bea7];return _0x175952;};'use strict';var _=require('lodash');var util=require(_0xdac0('0x0'));var logger=require(_0xdac0('0x1'))(_0xdac0('0x2'));var moment=require(_0xdac0('0x3'));var BPromise=require(_0xdac0('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdac0('0x5'));var rimraf=require(_0xdac0('0x6'));var config=require(_0xdac0('0x7'));var attributes=require('./faxAccount.attributes');module[_0xdac0('0x8')]=function(_0x5d6aa2,_0x3504d5){return _0x5d6aa2['define'](_0xdac0('0x9'),attributes,{'tableName':_0xdac0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9067=['exports','define','FaxAccount','lodash','util','../../config/logger','moment','bluebird','path','../../config/environment'];(function(_0x1a286f,_0x374d52){var _0x33e8b0=function(_0xc49f77){while(--_0xc49f77){_0x1a286f['push'](_0x1a286f['shift']());}};_0x33e8b0(++_0x374d52);}(_0x9067,0x12f));var _0x7906=function(_0x302fa4,_0x23c359){_0x302fa4=_0x302fa4-0x0;var _0x3491c1=_0x9067[_0x302fa4];return _0x3491c1;};'use strict';var _=require(_0x7906('0x0'));var util=require(_0x7906('0x1'));var logger=require(_0x7906('0x2'))('api');var moment=require(_0x7906('0x3'));var BPromise=require(_0x7906('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7906('0x5'));var rimraf=require('rimraf');var config=require(_0x7906('0x6'));var attributes=require('./faxAccount.attributes');module[_0x7906('0x7')]=function(_0x3e7d80,_0x59b484){return _0x3e7d80[_0x7906('0x8')](_0x7906('0x9'),attributes,{'tableName':'fax_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.rpc.js b/server/api/faxAccount/faxAccount.rpc.js index 46187f2..eca8824 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 _0x2c14=['FaxInteraction','Contact\x20not\x20found','autoclose','push','close','unmanaged','*,*,*,*','created','interaction','AttachmentId','User','name','UserId','unshift','waitForTheAssignedAgent','FaxQueue','queueId','queue','waitForTheAssignedQueue','Start','startRouting','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','./faxAccount.socket','register','then','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','GetFaxAccount','FaxAccount','findAll','options','raw','where','attributes','limit','include','model','map','catch','NotifyFaxAccount','body','fax','CmContact','describe','Sequelize','ValidationError','no\x20available\x20attributes','difference','keys','updatedAt','createdAt','CompanyId','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','get','applications','Applications','list','length','ListId','create'];(function(_0x46361e,_0x243aaf){var _0x14e302=function(_0x9ebecf){while(--_0x9ebecf){_0x46361e['push'](_0x46361e['shift']());}};_0x14e302(++_0x243aaf);}(_0x2c14,0x129));var _0x42c1=function(_0xe093e1,_0x475395){_0xe093e1=_0xe093e1-0x0;var _0x577773=_0x2c14[_0xe093e1];return _0x577773;};'use strict';var _=require(_0x42c1('0x0'));var util=require(_0x42c1('0x1'));var moment=require(_0x42c1('0x2'));var BPromise=require(_0x42c1('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x42c1('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x42c1('0x5'));var logger=require(_0x42c1('0x6'))(_0x42c1('0x7'));var config=require(_0x42c1('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x42c1('0x9')][_0x42c1('0xa')]({'port':0x232c});config[_0x42c1('0xb')]=_[_0x42c1('0xc')](config[_0x42c1('0xb')],{'host':_0x42c1('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x42c1('0xb')]));require(_0x42c1('0xe'))[_0x42c1('0xf')](socket);function respondWithRpcPromise(_0x37e7d6,_0x294364,_0xa5fe9f){return new BPromise(function(_0x2229fe,_0x5d0de6){return client['request'](_0x37e7d6,_0xa5fe9f)[_0x42c1('0x10')](function(_0x295c4){logger['info'](_0x42c1('0x11'),_0x294364,_0x42c1('0x12'));logger[_0x42c1('0x13')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x294364,_0x42c1('0x12'),JSON[_0x42c1('0x14')](_0x295c4));if(_0x295c4[_0x42c1('0x15')]){if(_0x295c4[_0x42c1('0x15')][_0x42c1('0x16')]===0x1f4){logger['error'](_0x42c1('0x11'),_0x294364,_0x295c4[_0x42c1('0x15')]['message']);return _0x5d0de6(_0x295c4[_0x42c1('0x15')]['message']);}logger['error'](_0x42c1('0x11'),_0x294364,_0x295c4[_0x42c1('0x15')]['message']);return _0x2229fe(_0x295c4['error'][_0x42c1('0x17')]);}else{logger[_0x42c1('0x18')](_0x42c1('0x11'),_0x294364,_0x42c1('0x12'));_0x2229fe(_0x295c4[_0x42c1('0x19')][_0x42c1('0x17')]);}})['catch'](function(_0x137de9){logger['error'](_0x42c1('0x11'),_0x294364,_0x137de9);_0x5d0de6(_0x137de9);});});}exports[_0x42c1('0x1a')]=function(_0x512724){var _0x297290=this;return new Promise(function(_0x16a3b5,_0x508f65){return db[_0x42c1('0x1b')][_0x42c1('0x1c')]({'raw':_0x512724[_0x42c1('0x1d')]?_0x512724[_0x42c1('0x1d')][_0x42c1('0x1e')]===undefined?!![]:![]:!![],'where':_0x512724[_0x42c1('0x1d')]?_0x512724[_0x42c1('0x1d')][_0x42c1('0x1f')]||null:null,'attributes':_0x512724[_0x42c1('0x1d')]?_0x512724[_0x42c1('0x1d')][_0x42c1('0x20')]||null:null,'limit':_0x512724[_0x42c1('0x1d')]?_0x512724[_0x42c1('0x1d')][_0x42c1('0x21')]||null:null,'include':_0x512724['options']?_0x512724['options'][_0x42c1('0x22')]?_['map'](_0x512724['options'][_0x42c1('0x22')],function(_0x2a2625){return{'model':db[_0x2a2625[_0x42c1('0x23')]],'as':_0x2a2625['as'],'attributes':_0x2a2625[_0x42c1('0x20')],'include':_0x2a2625[_0x42c1('0x22')]?_[_0x42c1('0x24')](_0x2a2625[_0x42c1('0x22')],function(_0x377b6a){return{'model':db[_0x377b6a[_0x42c1('0x23')]],'as':_0x377b6a['as'],'attributes':_0x377b6a[_0x42c1('0x20')],'include':_0x377b6a[_0x42c1('0x22')]?_[_0x42c1('0x24')](_0x377b6a[_0x42c1('0x22')],function(_0x1ee88d){return{'model':db[_0x1ee88d['model']],'as':_0x1ee88d['as'],'attributes':_0x1ee88d[_0x42c1('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x244ad3){logger[_0x42c1('0x18')]('GetFaxAccount',_0x512724);logger[_0x42c1('0x13')](_0x42c1('0x1a'),_0x512724,JSON['stringify'](_0x244ad3));_0x16a3b5(_0x244ad3);})[_0x42c1('0x25')](function(_0x57137a){logger['error'](_0x42c1('0x1a'),_0x57137a[_0x42c1('0x17')],_0x512724);_0x508f65(_0x297290[_0x42c1('0x15')](0x1f4,_0x57137a[_0x42c1('0x17')]));});});};exports[_0x42c1('0x26')]=function(_0x13a561,_0x5cee49,_0x365613){var _0xc369ce=this;return new Promise(function(_0x150a94,_0x5ca4e1){var _0x2009c1={'body':_0x13a561[_0x42c1('0x27')],'channel':_0x42c1('0x28')};var _0x2793a4=[];var _0x291453=[];var _0x4edc2c={};return db[_0x42c1('0x29')][_0x42c1('0x2a')]()[_0x42c1('0x10')](function(_0x127cab){if(!_0x127cab){throw new db[(_0x42c1('0x2b'))][(_0x42c1('0x2c'))](_0x42c1('0x2d'));}_0x2793a4=_[_0x42c1('0x2e')](_[_0x42c1('0x2f')](_0x127cab),['createdAt',_0x42c1('0x30')]);_0x291453=_[_0x42c1('0x2e')](_[_0x42c1('0x2f')](_0x127cab),[_0x42c1('0x31'),'updatedAt',_0x42c1('0x32'),'ListId']);if(_0x13a561[_0x42c1('0x27')]['id']){delete _0x13a561[_0x42c1('0x27')]['id'];}if(_[_0x42c1('0x33')](_0x13a561[_0x42c1('0x27')][_0x42c1('0x34')])){throw new db[(_0x42c1('0x2b'))][(_0x42c1('0x2c'))](_0x42c1('0x35'));}if(_[_0x42c1('0x33')](_0x13a561[_0x42c1('0x27')][_0x42c1('0x27')])||_0x13a561[_0x42c1('0x27')][_0x42c1('0x27')]===''){throw new db[(_0x42c1('0x2b'))][(_0x42c1('0x2c'))](_0x42c1('0x36'));}if(_[_0x42c1('0x33')](_0x13a561['body'][_0x42c1('0x37')])){throw new db[(_0x42c1('0x2b'))][(_0x42c1('0x2c'))](_0x42c1('0x38')+_0x291453);}if(!_[_0x42c1('0x39')](_0x291453,_0x13a561[_0x42c1('0x27')][_0x42c1('0x37')])){throw new db[(_0x42c1('0x2b'))]['ValidationError'](_0x42c1('0x3a')+_0x291453);}_0x4edc2c[_0x13a561[_0x42c1('0x27')][_0x42c1('0x37')]]=_0x13a561[_0x42c1('0x27')][_0x42c1('0x34')];})['then'](function(){return db[_0x42c1('0x1b')][_0x42c1('0x3b')]({'where':{'id':_0x13a561[_0x42c1('0x3c')]['id']},'include':[{'model':db['CmList'],'as':_0x42c1('0x3d'),'include':[{'model':db['CmContact'],'as':_0x42c1('0x3e'),'where':_0x4edc2c,'limit':0x1,'order':[[_0x42c1('0x30'),_0x42c1('0x3f')]]}]},{'model':db['FaxApplication'],'as':'Applications'}]});})[_0x42c1('0x10')](function(_0x80a48a){if(_0x80a48a&&_0x80a48a[_0x42c1('0x3d')]){var _0x2c0f2f=_0x80a48a[_0x42c1('0x40')]({'plain':!![]});_0x2009c1[_0x42c1('0x3c')]=_0x2c0f2f;_0x2009c1[_0x42c1('0x41')]=_0x2c0f2f[_0x42c1('0x42')];_0x2009c1[_0x42c1('0x43')]=_0x2c0f2f[_0x42c1('0x3d')];_0x2009c1[_0x42c1('0x41')]=_['orderBy'](_0x2009c1[_0x42c1('0x41')],['priority'],['asc']);if(_0x2009c1['account'][_0x42c1('0x42')]){delete _0x2009c1['account'][_0x42c1('0x42')];}if(_0x2009c1[_0x42c1('0x3c')][_0x42c1('0x3d')]&&_0x2009c1[_0x42c1('0x3c')][_0x42c1('0x3d')][_0x42c1('0x3e')][_0x42c1('0x44')]){return _0x2009c1[_0x42c1('0x3c')][_0x42c1('0x3d')]['Contacts'][0x0];}var _0x1027fb=_['defaults'](_0x13a561[_0x42c1('0x27')],{'firstName':_0x13a561[_0x42c1('0x27')][_0x42c1('0x34')],'ListId':_0x2c0f2f[_0x42c1('0x45')]});_0x1027fb[_0x13a561[_0x42c1('0x27')]['mapKey']]=_0x13a561['body']['from'];return db[_0x42c1('0x29')][_0x42c1('0x46')](_0x1027fb,{'fields':_0x2793a4,'raw':!![]});}})['then'](function(_0x1e6b87){_0x2009c1['contact']=_0x1e6b87;if(_0x1e6b87){var _0x170f06={'ContactId':_0x1e6b87['id'],'FaxAccountId':_0x13a561[_0x42c1('0x3c')]['id'],'fax':_0x1e6b87['fax']};return db[_0x42c1('0x47')][_0x42c1('0x3b')]({'where':{'ContactId':_0x1e6b87['id'],'closed':![],'FaxAccountId':_0x13a561['account']['id']}})[_0x42c1('0x10')](function(_0x4e90c7){if(_0x4e90c7){return[_0x4e90c7,![]];}return db[_0x42c1('0x47')][_0x42c1('0x46')](_0x170f06)[_0x42c1('0x10')](function(_0x22b70b){return[_0x22b70b,!![]];});});}else{throw new Error(_0x42c1('0x48'));}})['spread'](function(_0x318f3c,_0x1bc3d2){var _0x3791b1=_0x318f3c[_0x42c1('0x40')]({'plain':!![]});if(_0x1bc3d2){if(_0x2009c1[_0x42c1('0x3c')][_0x42c1('0x49')]){_0x2009c1['applications'][_0x42c1('0x4a')]({'id':0x0,'priority':_0x2009c1['applications'][_0x42c1('0x44')]+0x1,'app':_0x42c1('0x4b'),'appdata':_0x42c1('0x4c'),'interval':_0x42c1('0x4d')});}_0x3791b1[_0x42c1('0x4e')]=!![];}else{_0x3791b1[_0x42c1('0x4e')]=![];}_0x2009c1[_0x42c1('0x4f')]=_0x3791b1;return db['FaxMessage'][_0x42c1('0x46')]({'body':_0x13a561['body']['body'],'FaxAccountId':_0x13a561['account']['id'],'FaxInteractionId':_0x318f3c['id'],'direction':'in','ContactId':_0x318f3c['ContactId'],'AttachmentId':_0x13a561[_0x42c1('0x27')][_0x42c1('0x50')]});})[_0x42c1('0x10')](function(_0x44b63e){_0x2009c1['message']=_0x44b63e;if(!_0x2009c1['interaction']['UserId'])return;return db[_0x42c1('0x51')][_0x42c1('0x3b')]({'attributes':['id',_0x42c1('0x52')],'where':{'id':_0x2009c1[_0x42c1('0x4f')][_0x42c1('0x53')]}});})[_0x42c1('0x10')](function(_0x4d479c){if(_0x4d479c){_0x2009c1[_0x42c1('0x41')][_0x42c1('0x54')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x4d479c[_0x42c1('0x52')]+','+(_0x2009c1[_0x42c1('0x3c')][_0x42c1('0x55')]||0xa),'interval':'*,*,*,*'});}if(!_0x2009c1[_0x42c1('0x4f')]['queueId'])return;return db[_0x42c1('0x56')]['find']({'attributes':['id','name'],'where':{'id':_0x2009c1[_0x42c1('0x4f')][_0x42c1('0x57')]}});})[_0x42c1('0x10')](function(_0x26eaab){if(_0x26eaab){_0x2009c1[_0x42c1('0x41')][_0x42c1('0x54')]({'id':0x0,'priority':0x1,'app':_0x42c1('0x58'),'appdata':_0x26eaab[_0x42c1('0x52')]+','+(_0x2009c1['account'][_0x42c1('0x59')]||0x12c),'interval':_0x42c1('0x4d')});}return respondWithRpcPromise(_0x42c1('0x5a'),_0x42c1('0x5b'),_0x2009c1);})['then'](function(_0x5ab062){_0x150a94(_0x5ab062);})['catch'](function(_0x19f6ff){_0x5ca4e1(_0xc369ce['error'](0x1f4,_0x19f6ff['message']));});});}; \ No newline at end of file +var _0xb602=['waitForTheAssignedAgent','*,*,*,*','FaxQueue','name','queueId','unshift','waitForTheAssignedQueue','Start','startRouting','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','client','http','redis','defaults','socket.io-emitter','./faxAccount.socket','register','request','then','info','request\x20sent','debug','stringify','error','code','message','FaxAccount,\x20%s,\x20%s','result','catch','GetFaxAccount','FaxAccount','findAll','options','where','limit','map','include','attributes','model','body','fax','CmContact','describe','Sequelize','ValidationError','no\x20available\x20attributes','difference','keys','createdAt','ListId','from','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmList','List','Contacts','updatedAt','DESC','FaxApplication','Applications','get','applications','priority','asc','length','create','FaxInteraction','find','Contact\x20not\x20found','spread','push','unmanaged','created','interaction','FaxMessage','AttachmentId','UserId','User','agent'];(function(_0x23f7c9,_0x4db646){var _0x2e6814=function(_0x44d5dc){while(--_0x44d5dc){_0x23f7c9['push'](_0x23f7c9['shift']());}};_0x2e6814(++_0x4db646);}(_0xb602,0xbf));var _0x2b60=function(_0xc54c54,_0x59053b){_0xc54c54=_0xc54c54-0x0;var _0x476786=_0xb602[_0xc54c54];return _0x476786;};'use strict';var _=require(_0x2b60('0x0'));var util=require('util');var moment=require(_0x2b60('0x1'));var BPromise=require(_0x2b60('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2b60('0x3'));var db=require(_0x2b60('0x4'))['db'];var utils=require(_0x2b60('0x5'));var logger=require('../../config/logger')(_0x2b60('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2b60('0x7')][_0x2b60('0x8')]({'port':0x232c});config[_0x2b60('0x9')]=_[_0x2b60('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x2b60('0xb'))(new Redis(config[_0x2b60('0x9')]));require(_0x2b60('0xc'))[_0x2b60('0xd')](socket);function respondWithRpcPromise(_0x256977,_0x1b09ee,_0x40d736){return new BPromise(function(_0x125efb,_0x21e423){return client[_0x2b60('0xe')](_0x256977,_0x40d736)[_0x2b60('0xf')](function(_0x18bf2e){logger[_0x2b60('0x10')]('FaxAccount,\x20%s,\x20%s',_0x1b09ee,_0x2b60('0x11'));logger[_0x2b60('0x12')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x1b09ee,_0x2b60('0x11'),JSON[_0x2b60('0x13')](_0x18bf2e));if(_0x18bf2e[_0x2b60('0x14')]){if(_0x18bf2e['error'][_0x2b60('0x15')]===0x1f4){logger[_0x2b60('0x14')]('FaxAccount,\x20%s,\x20%s',_0x1b09ee,_0x18bf2e[_0x2b60('0x14')][_0x2b60('0x16')]);return _0x21e423(_0x18bf2e[_0x2b60('0x14')][_0x2b60('0x16')]);}logger[_0x2b60('0x14')](_0x2b60('0x17'),_0x1b09ee,_0x18bf2e[_0x2b60('0x14')][_0x2b60('0x16')]);return _0x125efb(_0x18bf2e[_0x2b60('0x14')][_0x2b60('0x16')]);}else{logger[_0x2b60('0x10')](_0x2b60('0x17'),_0x1b09ee,_0x2b60('0x11'));_0x125efb(_0x18bf2e[_0x2b60('0x18')]['message']);}})[_0x2b60('0x19')](function(_0x274a8c){logger[_0x2b60('0x14')](_0x2b60('0x17'),_0x1b09ee,_0x274a8c);_0x21e423(_0x274a8c);});});}exports[_0x2b60('0x1a')]=function(_0x5439d3){var _0x4fae10=this;return new Promise(function(_0x551f3d,_0x42964c){return db[_0x2b60('0x1b')][_0x2b60('0x1c')]({'raw':_0x5439d3['options']?_0x5439d3[_0x2b60('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x5439d3[_0x2b60('0x1d')]?_0x5439d3[_0x2b60('0x1d')][_0x2b60('0x1e')]||null:null,'attributes':_0x5439d3[_0x2b60('0x1d')]?_0x5439d3[_0x2b60('0x1d')]['attributes']||null:null,'limit':_0x5439d3[_0x2b60('0x1d')]?_0x5439d3[_0x2b60('0x1d')][_0x2b60('0x1f')]||null:null,'include':_0x5439d3[_0x2b60('0x1d')]?_0x5439d3['options']['include']?_[_0x2b60('0x20')](_0x5439d3['options'][_0x2b60('0x21')],function(_0xcbfd42){return{'model':db[_0xcbfd42['model']],'as':_0xcbfd42['as'],'attributes':_0xcbfd42[_0x2b60('0x22')],'include':_0xcbfd42['include']?_[_0x2b60('0x20')](_0xcbfd42[_0x2b60('0x21')],function(_0x10bb78){return{'model':db[_0x10bb78[_0x2b60('0x23')]],'as':_0x10bb78['as'],'attributes':_0x10bb78['attributes'],'include':_0x10bb78[_0x2b60('0x21')]?_[_0x2b60('0x20')](_0x10bb78[_0x2b60('0x21')],function(_0x3b7fa5){return{'model':db[_0x3b7fa5[_0x2b60('0x23')]],'as':_0x3b7fa5['as'],'attributes':_0x3b7fa5[_0x2b60('0x22')]};}):[]};}):[]};}):[]:[]})[_0x2b60('0xf')](function(_0x5db23d){logger[_0x2b60('0x10')]('GetFaxAccount',_0x5439d3);logger[_0x2b60('0x12')](_0x2b60('0x1a'),_0x5439d3,JSON[_0x2b60('0x13')](_0x5db23d));_0x551f3d(_0x5db23d);})['catch'](function(_0x3a200e){logger['error'](_0x2b60('0x1a'),_0x3a200e[_0x2b60('0x16')],_0x5439d3);_0x42964c(_0x4fae10[_0x2b60('0x14')](0x1f4,_0x3a200e[_0x2b60('0x16')]));});});};exports['NotifyFaxAccount']=function(_0x33b6f3,_0x463ddc,_0xf40ecb){var _0xab4bf7=this;return new Promise(function(_0xa0a371,_0x5ab8b4){var _0x5aa192={'body':_0x33b6f3[_0x2b60('0x24')],'channel':_0x2b60('0x25')};var _0x5312a8=[];var _0x39687a=[];var _0x1a5295={};return db[_0x2b60('0x26')][_0x2b60('0x27')]()[_0x2b60('0xf')](function(_0x38ee57){if(!_0x38ee57){throw new db[(_0x2b60('0x28'))][(_0x2b60('0x29'))](_0x2b60('0x2a'));}_0x5312a8=_[_0x2b60('0x2b')](_[_0x2b60('0x2c')](_0x38ee57),[_0x2b60('0x2d'),'updatedAt']);_0x39687a=_[_0x2b60('0x2b')](_[_0x2b60('0x2c')](_0x38ee57),[_0x2b60('0x2d'),'updatedAt','CompanyId',_0x2b60('0x2e')]);if(_0x33b6f3['body']['id']){delete _0x33b6f3['body']['id'];}if(_['isNil'](_0x33b6f3[_0x2b60('0x24')][_0x2b60('0x2f')])){throw new db['Sequelize'][(_0x2b60('0x29'))](_0x2b60('0x30'));}if(_[_0x2b60('0x31')](_0x33b6f3[_0x2b60('0x24')][_0x2b60('0x24')])||_0x33b6f3[_0x2b60('0x24')]['body']===''){throw new db[(_0x2b60('0x28'))]['ValidationError'](_0x2b60('0x32'));}if(_[_0x2b60('0x31')](_0x33b6f3['body'][_0x2b60('0x33')])){throw new db[(_0x2b60('0x28'))][(_0x2b60('0x29'))](_0x2b60('0x34')+_0x39687a);}if(!_[_0x2b60('0x35')](_0x39687a,_0x33b6f3[_0x2b60('0x24')]['mapKey'])){throw new db[(_0x2b60('0x28'))][(_0x2b60('0x29'))](_0x2b60('0x36')+_0x39687a);}_0x1a5295[_0x33b6f3[_0x2b60('0x24')][_0x2b60('0x33')]]=_0x33b6f3['body']['from'];})[_0x2b60('0xf')](function(){return db['FaxAccount']['find']({'where':{'id':_0x33b6f3[_0x2b60('0x37')]['id']},'include':[{'model':db[_0x2b60('0x38')],'as':_0x2b60('0x39'),'include':[{'model':db[_0x2b60('0x26')],'as':_0x2b60('0x3a'),'where':_0x1a5295,'limit':0x1,'order':[[_0x2b60('0x3b'),_0x2b60('0x3c')]]}]},{'model':db[_0x2b60('0x3d')],'as':_0x2b60('0x3e')}]});})[_0x2b60('0xf')](function(_0x3d6cf6){if(_0x3d6cf6&&_0x3d6cf6[_0x2b60('0x39')]){var _0xa35b2b=_0x3d6cf6[_0x2b60('0x3f')]({'plain':!![]});_0x5aa192['account']=_0xa35b2b;_0x5aa192[_0x2b60('0x40')]=_0xa35b2b[_0x2b60('0x3e')];_0x5aa192['list']=_0xa35b2b[_0x2b60('0x39')];_0x5aa192[_0x2b60('0x40')]=_['orderBy'](_0x5aa192[_0x2b60('0x40')],[_0x2b60('0x41')],[_0x2b60('0x42')]);if(_0x5aa192[_0x2b60('0x37')]['Applications']){delete _0x5aa192['account']['Applications'];}if(_0x5aa192['account'][_0x2b60('0x39')]&&_0x5aa192[_0x2b60('0x37')][_0x2b60('0x39')]['Contacts'][_0x2b60('0x43')]){return _0x5aa192[_0x2b60('0x37')][_0x2b60('0x39')][_0x2b60('0x3a')][0x0];}var _0x280d31=_[_0x2b60('0xa')](_0x33b6f3[_0x2b60('0x24')],{'firstName':_0x33b6f3['body'][_0x2b60('0x2f')],'ListId':_0xa35b2b[_0x2b60('0x2e')]});_0x280d31[_0x33b6f3['body'][_0x2b60('0x33')]]=_0x33b6f3[_0x2b60('0x24')][_0x2b60('0x2f')];return db['CmContact'][_0x2b60('0x44')](_0x280d31,{'fields':_0x5312a8,'raw':!![]});}})[_0x2b60('0xf')](function(_0x26a4d9){_0x5aa192['contact']=_0x26a4d9;if(_0x26a4d9){var _0xcf4ccb={'ContactId':_0x26a4d9['id'],'FaxAccountId':_0x33b6f3['account']['id'],'fax':_0x26a4d9['fax']};return db[_0x2b60('0x45')][_0x2b60('0x46')]({'where':{'ContactId':_0x26a4d9['id'],'closed':![],'FaxAccountId':_0x33b6f3[_0x2b60('0x37')]['id']}})['then'](function(_0x1f9c79){if(_0x1f9c79){return[_0x1f9c79,![]];}return db['FaxInteraction'][_0x2b60('0x44')](_0xcf4ccb)[_0x2b60('0xf')](function(_0x3c6fad){return[_0x3c6fad,!![]];});});}else{throw new Error(_0x2b60('0x47'));}})[_0x2b60('0x48')](function(_0x3a471f,_0x12411a){var _0x2ec0bf=_0x3a471f['get']({'plain':!![]});if(_0x12411a){if(_0x5aa192[_0x2b60('0x37')]['autoclose']){_0x5aa192[_0x2b60('0x40')][_0x2b60('0x49')]({'id':0x0,'priority':_0x5aa192['applications'][_0x2b60('0x43')]+0x1,'app':'close','appdata':_0x2b60('0x4a'),'interval':'*,*,*,*'});}_0x2ec0bf['created']=!![];}else{_0x2ec0bf[_0x2b60('0x4b')]=![];}_0x5aa192[_0x2b60('0x4c')]=_0x2ec0bf;return db[_0x2b60('0x4d')][_0x2b60('0x44')]({'body':_0x33b6f3[_0x2b60('0x24')][_0x2b60('0x24')],'FaxAccountId':_0x33b6f3[_0x2b60('0x37')]['id'],'FaxInteractionId':_0x3a471f['id'],'direction':'in','ContactId':_0x3a471f['ContactId'],'AttachmentId':_0x33b6f3[_0x2b60('0x24')][_0x2b60('0x4e')]});})[_0x2b60('0xf')](function(_0x55b3be){_0x5aa192[_0x2b60('0x16')]=_0x55b3be;if(!_0x5aa192[_0x2b60('0x4c')][_0x2b60('0x4f')])return;return db[_0x2b60('0x50')][_0x2b60('0x46')]({'attributes':['id','name'],'where':{'id':_0x5aa192[_0x2b60('0x4c')]['UserId']}});})[_0x2b60('0xf')](function(_0x439f85){if(_0x439f85){_0x5aa192['applications']['unshift']({'id':0x0,'priority':0x0,'app':_0x2b60('0x51'),'appdata':_0x439f85['name']+','+(_0x5aa192[_0x2b60('0x37')][_0x2b60('0x52')]||0xa),'interval':_0x2b60('0x53')});}if(!_0x5aa192[_0x2b60('0x4c')]['queueId'])return;return db[_0x2b60('0x54')]['find']({'attributes':['id',_0x2b60('0x55')],'where':{'id':_0x5aa192[_0x2b60('0x4c')][_0x2b60('0x56')]}});})[_0x2b60('0xf')](function(_0x2743f2){if(_0x2743f2){_0x5aa192['applications'][_0x2b60('0x57')]({'id':0x0,'priority':0x1,'app':'queue','appdata':_0x2743f2[_0x2b60('0x55')]+','+(_0x5aa192[_0x2b60('0x37')][_0x2b60('0x58')]||0x12c),'interval':_0x2b60('0x53')});}return respondWithRpcPromise(_0x2b60('0x59'),_0x2b60('0x5a'),_0x5aa192);})['then'](function(_0x40b975){_0xa0a371(_0x40b975);})[_0x2b60('0x19')](function(_0x3f97eb){_0x5ab8b4(_0xab4bf7[_0x2b60('0x14')](0x1f4,_0x3f97eb[_0x2b60('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index 311626d..f42d772 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 _0x352a=['register','length','faxAccount:','./faxAccount.events','save','remove','update','emit','removeListener'];(function(_0x28e5ef,_0x4e406f){var _0x128683=function(_0x189fe8){while(--_0x189fe8){_0x28e5ef['push'](_0x28e5ef['shift']());}};_0x128683(++_0x4e406f);}(_0x352a,0x123));var _0xa352=function(_0x45cb89,_0x99520e){_0x45cb89=_0x45cb89-0x0;var _0x5948c1=_0x352a[_0x45cb89];return _0x5948c1;};'use strict';var FaxAccountEvents=require(_0xa352('0x0'));var events=[_0xa352('0x1'),_0xa352('0x2'),_0xa352('0x3')];function createListener(_0x463941,_0x346566){return function(_0x37bbcd){_0x346566[_0xa352('0x4')](_0x463941,_0x37bbcd);};}function removeListener(_0x4db9c5,_0x362283){return function(){FaxAccountEvents[_0xa352('0x5')](_0x4db9c5,_0x362283);};}exports[_0xa352('0x6')]=function(_0x36af40){for(var _0x5c397e=0x0,_0x53124d=events[_0xa352('0x7')];_0x5c397e<_0x53124d;_0x5c397e++){var _0x327a4a=events[_0x5c397e];var _0x46b327=createListener(_0xa352('0x8')+_0x327a4a,_0x36af40);FaxAccountEvents['on'](_0x327a4a,_0x46b327);}}; \ No newline at end of file +var _0xf221=['length','faxAccount:','./faxAccount.events','save','remove','emit','register'];(function(_0x36c564,_0x4f73f3){var _0x288a9d=function(_0x90ba3){while(--_0x90ba3){_0x36c564['push'](_0x36c564['shift']());}};_0x288a9d(++_0x4f73f3);}(_0xf221,0xf7));var _0x1f22=function(_0x578ee0,_0x2c9593){_0x578ee0=_0x578ee0-0x0;var _0x507e92=_0xf221[_0x578ee0];return _0x507e92;};'use strict';var FaxAccountEvents=require(_0x1f22('0x0'));var events=[_0x1f22('0x1'),_0x1f22('0x2'),'update'];function createListener(_0x15e914,_0x3ec326){return function(_0x368af6){_0x3ec326[_0x1f22('0x3')](_0x15e914,_0x368af6);};}function removeListener(_0x1687f8,_0xe83cae){return function(){FaxAccountEvents['removeListener'](_0x1687f8,_0xe83cae);};}exports[_0x1f22('0x4')]=function(_0x1c8e08){for(var _0x57ce2f=0x0,_0x122a27=events[_0x1f22('0x5')];_0x57ce2f<_0x122a27;_0x57ce2f++){var _0x28e44d=events[_0x57ce2f];var _0x2fe6ef=createListener(_0x1f22('0x6')+_0x28e44d,_0x1c8e08);FaxAccountEvents['on'](_0x28e44d,_0x2fe6ef);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index 900bade..9427fd1 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 _0x0f6e=['/:id/messages','getMessages','/:id/users','getAgents','create','post','addDisposition','addAnswer','addInteraction','/:id/applications','addApplications','addAccountApplications','/updateaccountapplications','updateAccountApplications','send','addAgents','put','/:id','update','delete','destroy','removeDispositions','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./faxAccount.controller','get','index','/describe','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','isAuthenticated','getAnswers','getApplications'];(function(_0x2d0270,_0x104042){var _0x4b8643=function(_0x59d13c){while(--_0x59d13c){_0x2d0270['push'](_0x2d0270['shift']());}};_0x4b8643(++_0x104042);}(_0x0f6e,0x70));var _0xe0f6=function(_0x4654d5,_0x55fdf3){_0x4654d5=_0x4654d5-0x0;var _0x2da3f9=_0x0f6e[_0x4654d5];return _0x2da3f9;};'use strict';var multer=require(_0xe0f6('0x0'));var util=require(_0xe0f6('0x1'));var path=require(_0xe0f6('0x2'));var timeout=require(_0xe0f6('0x3'));var express=require(_0xe0f6('0x4'));var router=express[_0xe0f6('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xe0f6('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xe0f6('0x7'));var controller=require(_0xe0f6('0x8'));router[_0xe0f6('0x9')]('/',auth['isAuthenticated'](),controller[_0xe0f6('0xa')]);router[_0xe0f6('0x9')](_0xe0f6('0xb'),auth['isAuthenticated'](),controller[_0xe0f6('0xc')]);router[_0xe0f6('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe0f6('0xd')]);router[_0xe0f6('0x9')](_0xe0f6('0xe'),auth['isAuthenticated'](),controller[_0xe0f6('0xf')]);router[_0xe0f6('0x9')](_0xe0f6('0x10'),auth[_0xe0f6('0x11')](),controller[_0xe0f6('0x12')]);router[_0xe0f6('0x9')]('/:id/interactions',auth[_0xe0f6('0x11')](),controller['getInteractions']);router[_0xe0f6('0x9')]('/:id/applications',auth[_0xe0f6('0x11')](),controller[_0xe0f6('0x13')]);router[_0xe0f6('0x9')](_0xe0f6('0x14'),auth[_0xe0f6('0x11')](),controller[_0xe0f6('0x15')]);router['get'](_0xe0f6('0x16'),auth[_0xe0f6('0x11')](),controller[_0xe0f6('0x17')]);router['post']('/',auth[_0xe0f6('0x11')](),controller[_0xe0f6('0x18')]);router[_0xe0f6('0x19')](_0xe0f6('0xe'),auth[_0xe0f6('0x11')](),controller[_0xe0f6('0x1a')]);router[_0xe0f6('0x19')](_0xe0f6('0x10'),auth[_0xe0f6('0x11')](),controller[_0xe0f6('0x1b')]);router['post']('/:id/interactions',auth[_0xe0f6('0x11')](),controller[_0xe0f6('0x1c')]);router[_0xe0f6('0x19')](_0xe0f6('0x1d'),auth[_0xe0f6('0x11')](),controller[_0xe0f6('0x1e')]);router['post']('/addaccountapplications',auth[_0xe0f6('0x11')](),controller[_0xe0f6('0x1f')]);router[_0xe0f6('0x19')](_0xe0f6('0x20'),auth[_0xe0f6('0x11')](),controller[_0xe0f6('0x21')]);router[_0xe0f6('0x19')]('/:id/send',auth[_0xe0f6('0x11')](),controller[_0xe0f6('0x22')]);router[_0xe0f6('0x19')](_0xe0f6('0x16'),auth['isAuthenticated'](),controller[_0xe0f6('0x23')]);router[_0xe0f6('0x24')](_0xe0f6('0x25'),auth[_0xe0f6('0x11')](),controller[_0xe0f6('0x26')]);router[_0xe0f6('0x27')](_0xe0f6('0x25'),auth[_0xe0f6('0x11')](),controller[_0xe0f6('0x28')]);router[_0xe0f6('0x27')](_0xe0f6('0xe'),auth[_0xe0f6('0x11')](),controller[_0xe0f6('0x29')]);router[_0xe0f6('0x27')](_0xe0f6('0x10'),auth['isAuthenticated'](),controller['removeAnswers']);router[_0xe0f6('0x27')](_0xe0f6('0x16'),auth[_0xe0f6('0x11')](),controller[_0xe0f6('0x2a')]);module[_0xe0f6('0x2b')]=router; \ No newline at end of file +var _0x4044=['./faxAccount.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/canned_answers','getAnswers','getInteractions','getApplications','/:id/messages','getMessages','/:id/users','getAgents','post','/:id/dispositions','addAnswer','/:id/interactions','addInteraction','/:id/applications','addApplications','/addaccountapplications','/updateaccountapplications','updateAccountApplications','/:id/send','send','addAgents','put','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0xc6fb1d,_0x3857c4){var _0x5e903e=function(_0x6f1e84){while(--_0x6f1e84){_0xc6fb1d['push'](_0xc6fb1d['shift']());}};_0x5e903e(++_0x3857c4);}(_0x4044,0xf5));var _0x4404=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x4044[_0x14add3];return _0x4a174f;};'use strict';var multer=require('multer');var util=require(_0x4404('0x0'));var path=require('path');var timeout=require(_0x4404('0x1'));var express=require('express');var router=express[_0x4404('0x2')]();var fs_extra=require(_0x4404('0x3'));var auth=require(_0x4404('0x4'));var interaction=require(_0x4404('0x5'));var config=require(_0x4404('0x6'));var controller=require(_0x4404('0x7'));router[_0x4404('0x8')]('/',auth[_0x4404('0x9')](),controller[_0x4404('0xa')]);router[_0x4404('0x8')](_0x4404('0xb'),auth[_0x4404('0x9')](),controller['describe']);router[_0x4404('0x8')](_0x4404('0xc'),auth['isAuthenticated'](),controller[_0x4404('0xd')]);router[_0x4404('0x8')]('/:id/dispositions',auth[_0x4404('0x9')](),controller['getDispositions']);router[_0x4404('0x8')](_0x4404('0xe'),auth['isAuthenticated'](),controller[_0x4404('0xf')]);router[_0x4404('0x8')]('/:id/interactions',auth[_0x4404('0x9')](),controller[_0x4404('0x10')]);router[_0x4404('0x8')]('/:id/applications',auth[_0x4404('0x9')](),controller[_0x4404('0x11')]);router[_0x4404('0x8')](_0x4404('0x12'),auth[_0x4404('0x9')](),controller[_0x4404('0x13')]);router[_0x4404('0x8')](_0x4404('0x14'),auth[_0x4404('0x9')](),controller[_0x4404('0x15')]);router[_0x4404('0x16')]('/',auth[_0x4404('0x9')](),controller['create']);router[_0x4404('0x16')](_0x4404('0x17'),auth[_0x4404('0x9')](),controller['addDisposition']);router[_0x4404('0x16')](_0x4404('0xe'),auth[_0x4404('0x9')](),controller[_0x4404('0x18')]);router['post'](_0x4404('0x19'),auth[_0x4404('0x9')](),controller[_0x4404('0x1a')]);router[_0x4404('0x16')](_0x4404('0x1b'),auth['isAuthenticated'](),controller[_0x4404('0x1c')]);router[_0x4404('0x16')](_0x4404('0x1d'),auth['isAuthenticated'](),controller['addAccountApplications']);router[_0x4404('0x16')](_0x4404('0x1e'),auth['isAuthenticated'](),controller[_0x4404('0x1f')]);router[_0x4404('0x16')](_0x4404('0x20'),auth[_0x4404('0x9')](),controller[_0x4404('0x21')]);router[_0x4404('0x16')](_0x4404('0x14'),auth[_0x4404('0x9')](),controller[_0x4404('0x22')]);router[_0x4404('0x23')](_0x4404('0xc'),auth[_0x4404('0x9')](),controller['update']);router[_0x4404('0x24')]('/:id',auth[_0x4404('0x9')](),controller[_0x4404('0x25')]);router['delete']('/:id/dispositions',auth[_0x4404('0x9')](),controller[_0x4404('0x26')]);router['delete'](_0x4404('0xe'),auth[_0x4404('0x9')](),controller[_0x4404('0x27')]);router[_0x4404('0x24')](_0x4404('0x14'),auth[_0x4404('0x9')](),controller[_0x4404('0x28')]);module[_0x4404('0x29')]=router; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.attributes.js b/server/api/faxApplication/faxApplication.attributes.js index 548dec5..e2f4f80 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 _0x0b66=['INTEGER','STRING','noop','TEXT','*,*,*,*','sequelize','exports'];(function(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0x0b66,0x75));var _0x60b6=function(_0x45885f,_0x63316){_0x45885f=_0x45885f-0x0;var _0x500322=_0x0b66[_0x45885f];return _0x500322;};'use strict';var Sequelize=require(_0x60b6('0x0'));module[_0x60b6('0x1')]={'priority':{'type':Sequelize[_0x60b6('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x60b6('0x3')],'allowNull':![],'defaultValue':_0x60b6('0x4')},'appdata':{'type':Sequelize[_0x60b6('0x5')]()},'description':{'type':Sequelize[_0x60b6('0x3')]},'interval':{'type':Sequelize[_0x60b6('0x3')],'defaultValue':_0x60b6('0x6')}}; \ No newline at end of file +var _0xb418=['noop','TEXT','*,*,*,*','sequelize','STRING'];(function(_0x3d5eb1,_0x263e19){var _0x2403bb=function(_0x155048){while(--_0x155048){_0x3d5eb1['push'](_0x3d5eb1['shift']());}};_0x2403bb(++_0x263e19);}(_0xb418,0x14d));var _0x8b41=function(_0x2faddb,_0xc18b78){_0x2faddb=_0x2faddb-0x0;var _0x273c05=_0xb418[_0x2faddb];return _0x273c05;};'use strict';var Sequelize=require(_0x8b41('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x8b41('0x1')],'allowNull':![],'defaultValue':_0x8b41('0x2')},'appdata':{'type':Sequelize[_0x8b41('0x3')]()},'description':{'type':Sequelize[_0x8b41('0x1')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x8b41('0x4')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index 3a50ab8..0e158f9 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 _0xb1fa=['params','keys','length','options','find','create','body','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','hasOwnProperty','sort','filters','pick','filter','where','merge','include','FaxApplication','findAll','catch','show'];(function(_0x3608b0,_0x51e41e){var _0x4eb9e8=function(_0x36fdfd){while(--_0x36fdfd){_0x3608b0['push'](_0x3608b0['shift']());}};_0x4eb9e8(++_0x51e41e);}(_0xb1fa,0x1b7));var _0xab1f=function(_0x1e39d1,_0x5aa884){_0x1e39d1=_0x1e39d1-0x0;var _0x1ac9ce=_0xb1fa[_0x1e39d1];return _0x1ac9ce;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xab1f('0x0'));var jsonpatch=require(_0xab1f('0x1'));var rp=require('request-promise');var moment=require(_0xab1f('0x2'));var BPromise=require(_0xab1f('0x3'));var Mustache=require(_0xab1f('0x4'));var util=require(_0xab1f('0x5'));var path=require(_0xab1f('0x6'));var sox=require('sox');var csv=require(_0xab1f('0x7'));var ejs=require(_0xab1f('0x8'));var fs=require('fs');var fs_extra=require(_0xab1f('0x9'));var _=require(_0xab1f('0xa'));var squel=require(_0xab1f('0xb'));var crypto=require('crypto');var jsforce=require(_0xab1f('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xab1f('0xd'));var Redis=require(_0xab1f('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xab1f('0xf'));var as=require(_0xab1f('0x10'));var hardwareService=require(_0xab1f('0x11'));var logger=require(_0xab1f('0x12'))(_0xab1f('0x13'));var utils=require(_0xab1f('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xab1f('0x15'));var db=require(_0xab1f('0x16'))['db'];function respondWithStatusCode(_0x37b048,_0x45e13c){_0x45e13c=_0x45e13c||0xcc;return function(_0x3c0516){if(_0x3c0516){return _0x37b048[_0xab1f('0x17')](_0x45e13c);}return _0x37b048[_0xab1f('0x18')](_0x45e13c)['end']();};}function respondWithResult(_0x46a774,_0x4d4d4a){_0x4d4d4a=_0x4d4d4a||0xc8;return function(_0x4ae032){if(_0x4ae032){return _0x46a774[_0xab1f('0x18')](_0x4d4d4a)[_0xab1f('0x19')](_0x4ae032);}};}function respondWithFilteredResult(_0x58060b,_0x49e487){return function(_0x292b55){if(_0x292b55){var _0x34d224=typeof _0x49e487['offset']===_0xab1f('0x1a')&&typeof _0x49e487[_0xab1f('0x1b')]===_0xab1f('0x1a');var _0x4e144e=_0x292b55[_0xab1f('0x1c')];var _0x2c1ea6=_0x34d224?0x0:_0x49e487[_0xab1f('0x1d')];var _0x3690f4=_0x34d224?_0x292b55['count']:_0x49e487[_0xab1f('0x1d')]+_0x49e487[_0xab1f('0x1b')];var _0x1b055d;if(_0x3690f4>=_0x4e144e){_0x3690f4=_0x4e144e;_0x1b055d=0xc8;}else{_0x1b055d=0xce;}_0x58060b[_0xab1f('0x18')](_0x1b055d);return _0x58060b[_0xab1f('0x1e')](_0xab1f('0x1f'),_0x2c1ea6+'-'+_0x3690f4+'/'+_0x4e144e)[_0xab1f('0x19')](_0x292b55);}return null;};}function patchUpdates(_0x3f5f76){return function(_0x3c81d9){try{jsonpatch[_0xab1f('0x20')](_0x3c81d9,_0x3f5f76,!![]);}catch(_0x4930fe){return BPromise[_0xab1f('0x21')](_0x4930fe);}return _0x3c81d9[_0xab1f('0x22')]();};}function saveUpdates(_0x30f46b,_0x158ff4){return function(_0x1d6797){if(_0x1d6797){return _0x1d6797[_0xab1f('0x23')](_0x30f46b)[_0xab1f('0x24')](function(_0x586294){return _0x586294;});}return null;};}function removeEntity(_0x46bb7f,_0x176950){return function(_0x40f108){if(_0x40f108){return _0x40f108[_0xab1f('0x25')]()[_0xab1f('0x24')](function(){_0x46bb7f[_0xab1f('0x18')](0xcc)[_0xab1f('0x26')]();});}};}function handleEntityNotFound(_0x539485,_0x14fc96){return function(_0x143b28){if(!_0x143b28){_0x539485['sendStatus'](0x194);}return _0x143b28;};}function handleError(_0x56be0b,_0x433049){_0x433049=_0x433049||0x1f4;return function(_0x3417fd){logger[_0xab1f('0x27')](_0x3417fd['stack']);if(_0x3417fd['name']){delete _0x3417fd[_0xab1f('0x28')];}_0x56be0b[_0xab1f('0x18')](_0x433049)[_0xab1f('0x29')](_0x3417fd);};}exports[_0xab1f('0x2a')]=function(_0x4bf5df,_0x16a58b){var _0x53555b={},_0x1d7b10={},_0x108f6e={'count':0x0,'rows':[]};var _0x11a8ab=_[_0xab1f('0x2b')](db['FaxApplication'][_0xab1f('0x2c')],function(_0x159f0){return{'name':_0x159f0[_0xab1f('0x2d')],'type':_0x159f0[_0xab1f('0x2e')][_0xab1f('0x2f')]};});_0x1d7b10[_0xab1f('0x30')]=_['map'](_0x11a8ab,_0xab1f('0x28'));_0x1d7b10['query']=_['keys'](_0x4bf5df[_0xab1f('0x31')]);_0x1d7b10['filters']=_[_0xab1f('0x32')](_0x1d7b10[_0xab1f('0x30')],_0x1d7b10['query']);_0x53555b['attributes']=_[_0xab1f('0x32')](_0x1d7b10[_0xab1f('0x30')],qs[_0xab1f('0x33')](_0x4bf5df[_0xab1f('0x31')][_0xab1f('0x33')]));_0x53555b[_0xab1f('0x34')]=_0x53555b[_0xab1f('0x34')]['length']?_0x53555b[_0xab1f('0x34')]:_0x1d7b10[_0xab1f('0x30')];if(!_0x4bf5df[_0xab1f('0x31')][_0xab1f('0x35')]('nolimit')){_0x53555b[_0xab1f('0x1b')]=qs[_0xab1f('0x1b')](_0x4bf5df[_0xab1f('0x31')][_0xab1f('0x1b')]);_0x53555b['offset']=qs[_0xab1f('0x1d')](_0x4bf5df[_0xab1f('0x31')][_0xab1f('0x1d')]);}_0x53555b['order']=qs['sort'](_0x4bf5df['query'][_0xab1f('0x36')]);_0x53555b['where']=qs[_0xab1f('0x37')](_[_0xab1f('0x38')](_0x4bf5df['query'],_0x1d7b10['filters']),_0x11a8ab);if(_0x4bf5df[_0xab1f('0x31')][_0xab1f('0x39')]){_0x53555b[_0xab1f('0x3a')]=_['merge'](_0x53555b[_0xab1f('0x3a')],{'$or':_['map'](_0x11a8ab,function(_0x5b652b){if(_0x5b652b[_0xab1f('0x2e')]!=='VIRTUAL'){var _0x75819d={};_0x75819d[_0x5b652b['name']]={'$like':'%'+_0x4bf5df[_0xab1f('0x31')]['filter']+'%'};return _0x75819d;}})});}_0x53555b=_[_0xab1f('0x3b')]({},_0x53555b,_0x4bf5df['options']);var _0xf3f2e4={'where':_0x53555b[_0xab1f('0x3a')]};return db['FaxApplication']['count'](_0xf3f2e4)[_0xab1f('0x24')](function(_0x54c714){_0x108f6e[_0xab1f('0x1c')]=_0x54c714;if(_0x4bf5df[_0xab1f('0x31')]['includeAll']){_0x53555b[_0xab1f('0x3c')]=[{'all':!![]}];}return db[_0xab1f('0x3d')][_0xab1f('0x3e')](_0x53555b);})['then'](function(_0x10bc7e){_0x108f6e['rows']=_0x10bc7e;return _0x108f6e;})['then'](respondWithFilteredResult(_0x16a58b,_0x53555b))[_0xab1f('0x3f')](handleError(_0x16a58b,null));};exports[_0xab1f('0x40')]=function(_0x2fa952,_0x2e6fb3){var _0x9c475a={'raw':!![],'where':{'id':_0x2fa952[_0xab1f('0x41')]['id']}},_0x2a6f43={};_0x2a6f43['model']=_[_0xab1f('0x42')](db['FaxApplication'][_0xab1f('0x2c')]);_0x2a6f43[_0xab1f('0x31')]=_[_0xab1f('0x42')](_0x2fa952[_0xab1f('0x31')]);_0x2a6f43[_0xab1f('0x37')]=_[_0xab1f('0x32')](_0x2a6f43[_0xab1f('0x30')],_0x2a6f43[_0xab1f('0x31')]);_0x9c475a[_0xab1f('0x34')]=_[_0xab1f('0x32')](_0x2a6f43['model'],qs[_0xab1f('0x33')](_0x2fa952['query'][_0xab1f('0x33')]));_0x9c475a[_0xab1f('0x34')]=_0x9c475a[_0xab1f('0x34')][_0xab1f('0x43')]?_0x9c475a[_0xab1f('0x34')]:_0x2a6f43[_0xab1f('0x30')];if(_0x2fa952['query']['includeAll']){_0x9c475a['include']=[{'all':!![]}];}_0x9c475a=_[_0xab1f('0x3b')]({},_0x9c475a,_0x2fa952[_0xab1f('0x44')]);return db[_0xab1f('0x3d')][_0xab1f('0x45')](_0x9c475a)[_0xab1f('0x24')](handleEntityNotFound(_0x2e6fb3,null))['then'](respondWithResult(_0x2e6fb3,null))[_0xab1f('0x3f')](handleError(_0x2e6fb3,null));};exports['create']=function(_0x152492,_0x5c8431){return db['FaxApplication'][_0xab1f('0x46')](_0x152492[_0xab1f('0x47')],{})[_0xab1f('0x24')](respondWithResult(_0x5c8431,0xc9))[_0xab1f('0x3f')](handleError(_0x5c8431,null));};exports[_0xab1f('0x23')]=function(_0x539a68,_0x2389cf){if(_0x539a68[_0xab1f('0x47')]['id']){delete _0x539a68[_0xab1f('0x47')]['id'];}return db['FaxApplication'][_0xab1f('0x45')]({'where':{'id':_0x539a68[_0xab1f('0x41')]['id']}})[_0xab1f('0x24')](handleEntityNotFound(_0x2389cf,null))['then'](saveUpdates(_0x539a68[_0xab1f('0x47')],null))[_0xab1f('0x24')](respondWithResult(_0x2389cf,null))['catch'](handleError(_0x2389cf,null));};exports[_0xab1f('0x25')]=function(_0x41acae,_0x4aade2){return db['FaxApplication'][_0xab1f('0x45')]({'where':{'id':_0x41acae[_0xab1f('0x41')]['id']}})[_0xab1f('0x24')](handleEntityNotFound(_0x4aade2,null))[_0xab1f('0x24')](removeEntity(_0x4aade2,null))['catch'](handleError(_0x4aade2,null));}; \ No newline at end of file +var _0x65ff=['reject','update','then','destroy','stack','name','map','rawAttributes','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','where','pick','filters','merge','VIRTUAL','filter','options','FaxApplication','includeAll','findAll','catch','show','params','include','find','create','body','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply'];(function(_0x99b454,_0x328020){var _0x5e9b1d=function(_0x4e7ab2){while(--_0x4e7ab2){_0x99b454['push'](_0x99b454['shift']());}};_0x5e9b1d(++_0x328020);}(_0x65ff,0x1bd));var _0xf65f=function(_0x44881b,_0x541447){_0x44881b=_0x44881b-0x0;var _0x59b5cf=_0x65ff[_0x44881b];return _0x59b5cf;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xf65f('0x0'));var jsonpatch=require(_0xf65f('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf65f('0x2'));var Mustache=require('mustache');var util=require(_0xf65f('0x3'));var path=require(_0xf65f('0x4'));var sox=require(_0xf65f('0x5'));var csv=require(_0xf65f('0x6'));var ejs=require(_0xf65f('0x7'));var fs=require('fs');var fs_extra=require(_0xf65f('0x8'));var _=require('lodash');var squel=require(_0xf65f('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xf65f('0xa'));var toCsv=require('to-csv');var querystring=require(_0xf65f('0xb'));var Papa=require(_0xf65f('0xc'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xf65f('0xd'));var as=require(_0xf65f('0xe'));var hardwareService=require(_0xf65f('0xf'));var logger=require(_0xf65f('0x10'))(_0xf65f('0x11'));var utils=require(_0xf65f('0x12'));var config=require(_0xf65f('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xa6ab3f,_0x1050fe){_0x1050fe=_0x1050fe||0xcc;return function(_0x2f8d0f){if(_0x2f8d0f){return _0xa6ab3f[_0xf65f('0x14')](_0x1050fe);}return _0xa6ab3f[_0xf65f('0x15')](_0x1050fe)[_0xf65f('0x16')]();};}function respondWithResult(_0x1ce8e5,_0x45cef2){_0x45cef2=_0x45cef2||0xc8;return function(_0x211e41){if(_0x211e41){return _0x1ce8e5['status'](_0x45cef2)[_0xf65f('0x17')](_0x211e41);}};}function respondWithFilteredResult(_0x1c6632,_0x34ccdc){return function(_0x464e67){if(_0x464e67){var _0x14bf8d=typeof _0x34ccdc[_0xf65f('0x18')]===_0xf65f('0x19')&&typeof _0x34ccdc['limit']===_0xf65f('0x19');var _0x33f7ae=_0x464e67[_0xf65f('0x1a')];var _0x655874=_0x14bf8d?0x0:_0x34ccdc[_0xf65f('0x18')];var _0x38cf8c=_0x14bf8d?_0x464e67[_0xf65f('0x1a')]:_0x34ccdc[_0xf65f('0x18')]+_0x34ccdc[_0xf65f('0x1b')];var _0x5ed8cf;if(_0x38cf8c>=_0x33f7ae){_0x38cf8c=_0x33f7ae;_0x5ed8cf=0xc8;}else{_0x5ed8cf=0xce;}_0x1c6632['status'](_0x5ed8cf);return _0x1c6632[_0xf65f('0x1c')](_0xf65f('0x1d'),_0x655874+'-'+_0x38cf8c+'/'+_0x33f7ae)[_0xf65f('0x17')](_0x464e67);}return null;};}function patchUpdates(_0x22c2fa){return function(_0x1655ac){try{jsonpatch[_0xf65f('0x1e')](_0x1655ac,_0x22c2fa,!![]);}catch(_0x269736){return BPromise[_0xf65f('0x1f')](_0x269736);}return _0x1655ac['save']();};}function saveUpdates(_0x199dee,_0x2b3a4e){return function(_0x5804b2){if(_0x5804b2){return _0x5804b2[_0xf65f('0x20')](_0x199dee)[_0xf65f('0x21')](function(_0x53f1cb){return _0x53f1cb;});}return null;};}function removeEntity(_0x5d0e12,_0x14d462){return function(_0x5b29d1){if(_0x5b29d1){return _0x5b29d1[_0xf65f('0x22')]()[_0xf65f('0x21')](function(){_0x5d0e12[_0xf65f('0x15')](0xcc)[_0xf65f('0x16')]();});}};}function handleEntityNotFound(_0x2b7474,_0x3ce88a){return function(_0x41326e){if(!_0x41326e){_0x2b7474[_0xf65f('0x14')](0x194);}return _0x41326e;};}function handleError(_0x50fa08,_0x393ca8){_0x393ca8=_0x393ca8||0x1f4;return function(_0x54f693){logger['error'](_0x54f693[_0xf65f('0x23')]);if(_0x54f693[_0xf65f('0x24')]){delete _0x54f693[_0xf65f('0x24')];}_0x50fa08[_0xf65f('0x15')](_0x393ca8)['send'](_0x54f693);};}exports['index']=function(_0xf67fb0,_0x2bd81f){var _0x72974={},_0xdaaa7c={},_0x399794={'count':0x0,'rows':[]};var _0x555f23=_[_0xf65f('0x25')](db['FaxApplication'][_0xf65f('0x26')],function(_0x34c50d){return{'name':_0x34c50d['fieldName'],'type':_0x34c50d[_0xf65f('0x27')][_0xf65f('0x28')]};});_0xdaaa7c[_0xf65f('0x29')]=_[_0xf65f('0x25')](_0x555f23,_0xf65f('0x24'));_0xdaaa7c[_0xf65f('0x2a')]=_[_0xf65f('0x2b')](_0xf67fb0[_0xf65f('0x2a')]);_0xdaaa7c['filters']=_[_0xf65f('0x2c')](_0xdaaa7c[_0xf65f('0x29')],_0xdaaa7c[_0xf65f('0x2a')]);_0x72974['attributes']=_['intersection'](_0xdaaa7c[_0xf65f('0x29')],qs[_0xf65f('0x2d')](_0xf67fb0[_0xf65f('0x2a')][_0xf65f('0x2d')]));_0x72974[_0xf65f('0x2e')]=_0x72974[_0xf65f('0x2e')][_0xf65f('0x2f')]?_0x72974[_0xf65f('0x2e')]:_0xdaaa7c[_0xf65f('0x29')];if(!_0xf67fb0[_0xf65f('0x2a')][_0xf65f('0x30')](_0xf65f('0x31'))){_0x72974[_0xf65f('0x1b')]=qs['limit'](_0xf67fb0[_0xf65f('0x2a')][_0xf65f('0x1b')]);_0x72974['offset']=qs[_0xf65f('0x18')](_0xf67fb0[_0xf65f('0x2a')][_0xf65f('0x18')]);}_0x72974[_0xf65f('0x32')]=qs['sort'](_0xf67fb0[_0xf65f('0x2a')]['sort']);_0x72974[_0xf65f('0x33')]=qs['filters'](_[_0xf65f('0x34')](_0xf67fb0[_0xf65f('0x2a')],_0xdaaa7c[_0xf65f('0x35')]),_0x555f23);if(_0xf67fb0[_0xf65f('0x2a')]['filter']){_0x72974[_0xf65f('0x33')]=_[_0xf65f('0x36')](_0x72974[_0xf65f('0x33')],{'$or':_[_0xf65f('0x25')](_0x555f23,function(_0x279d02){if(_0x279d02[_0xf65f('0x27')]!==_0xf65f('0x37')){var _0x2d9e3b={};_0x2d9e3b[_0x279d02[_0xf65f('0x24')]]={'$like':'%'+_0xf67fb0[_0xf65f('0x2a')][_0xf65f('0x38')]+'%'};return _0x2d9e3b;}})});}_0x72974=_[_0xf65f('0x36')]({},_0x72974,_0xf67fb0[_0xf65f('0x39')]);var _0x241b22={'where':_0x72974[_0xf65f('0x33')]};return db[_0xf65f('0x3a')][_0xf65f('0x1a')](_0x241b22)['then'](function(_0x3c9f9f){_0x399794['count']=_0x3c9f9f;if(_0xf67fb0[_0xf65f('0x2a')][_0xf65f('0x3b')]){_0x72974['include']=[{'all':!![]}];}return db[_0xf65f('0x3a')][_0xf65f('0x3c')](_0x72974);})['then'](function(_0x998f58){_0x399794['rows']=_0x998f58;return _0x399794;})[_0xf65f('0x21')](respondWithFilteredResult(_0x2bd81f,_0x72974))[_0xf65f('0x3d')](handleError(_0x2bd81f,null));};exports[_0xf65f('0x3e')]=function(_0x6887e,_0x19bfe7){var _0x316500={'raw':!![],'where':{'id':_0x6887e[_0xf65f('0x3f')]['id']}},_0x38f439={};_0x38f439[_0xf65f('0x29')]=_['keys'](db[_0xf65f('0x3a')]['rawAttributes']);_0x38f439[_0xf65f('0x2a')]=_[_0xf65f('0x2b')](_0x6887e[_0xf65f('0x2a')]);_0x38f439[_0xf65f('0x35')]=_['intersection'](_0x38f439[_0xf65f('0x29')],_0x38f439[_0xf65f('0x2a')]);_0x316500['attributes']=_['intersection'](_0x38f439[_0xf65f('0x29')],qs[_0xf65f('0x2d')](_0x6887e[_0xf65f('0x2a')]['fields']));_0x316500['attributes']=_0x316500[_0xf65f('0x2e')][_0xf65f('0x2f')]?_0x316500[_0xf65f('0x2e')]:_0x38f439[_0xf65f('0x29')];if(_0x6887e[_0xf65f('0x2a')][_0xf65f('0x3b')]){_0x316500[_0xf65f('0x40')]=[{'all':!![]}];}_0x316500=_[_0xf65f('0x36')]({},_0x316500,_0x6887e[_0xf65f('0x39')]);return db[_0xf65f('0x3a')][_0xf65f('0x41')](_0x316500)[_0xf65f('0x21')](handleEntityNotFound(_0x19bfe7,null))['then'](respondWithResult(_0x19bfe7,null))[_0xf65f('0x3d')](handleError(_0x19bfe7,null));};exports[_0xf65f('0x42')]=function(_0x10d855,_0x3b4a7c){return db[_0xf65f('0x3a')]['create'](_0x10d855[_0xf65f('0x43')],{})[_0xf65f('0x21')](respondWithResult(_0x3b4a7c,0xc9))['catch'](handleError(_0x3b4a7c,null));};exports[_0xf65f('0x20')]=function(_0x162a44,_0x5358ec){if(_0x162a44['body']['id']){delete _0x162a44[_0xf65f('0x43')]['id'];}return db[_0xf65f('0x3a')][_0xf65f('0x41')]({'where':{'id':_0x162a44[_0xf65f('0x3f')]['id']}})[_0xf65f('0x21')](handleEntityNotFound(_0x5358ec,null))[_0xf65f('0x21')](saveUpdates(_0x162a44[_0xf65f('0x43')],null))[_0xf65f('0x21')](respondWithResult(_0x5358ec,null))['catch'](handleError(_0x5358ec,null));};exports[_0xf65f('0x22')]=function(_0x4ecbd0,_0x148836){return db[_0xf65f('0x3a')][_0xf65f('0x41')]({'where':{'id':_0x4ecbd0[_0xf65f('0x3f')]['id']}})[_0xf65f('0x21')](handleEntityNotFound(_0x148836,null))[_0xf65f('0x21')](removeEntity(_0x148836,null))[_0xf65f('0x3d')](handleError(_0x148836,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index 83333f2..8c7c2cf 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 _0x42a1=['moment','bluebird','request-promise','rimraf','../../config/environment','./faxApplication.attributes','exports','define','fax_applications','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api'];(function(_0xe10df3,_0x4195aa){var _0x3860e7=function(_0x500c87){while(--_0x500c87){_0xe10df3['push'](_0xe10df3['shift']());}};_0x3860e7(++_0x4195aa);}(_0x42a1,0x7b));var _0x142a=function(_0x490be3,_0xf0fca3){_0x490be3=_0x490be3-0x0;var _0x3f5140=_0x42a1[_0x490be3];return _0x3f5140;};'use strict';var _=require(_0x142a('0x0'));var util=require('util');var logger=require(_0x142a('0x1'))(_0x142a('0x2'));var moment=require(_0x142a('0x3'));var BPromise=require(_0x142a('0x4'));var rp=require(_0x142a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x142a('0x6'));var config=require(_0x142a('0x7'));var attributes=require(_0x142a('0x8'));module[_0x142a('0x9')]=function(_0x451c6f,_0xd18310){return _0x451c6f[_0x142a('0xa')]('FaxApplication',attributes,{'tableName':_0x142a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x142a('0xc'),'collate':_0x142a('0xd')});}; \ No newline at end of file +var _0x533a=['utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./faxApplication.attributes','define','FaxApplication'];(function(_0x305374,_0x394533){var _0x599932=function(_0x5cd734){while(--_0x5cd734){_0x305374['push'](_0x305374['shift']());}};_0x599932(++_0x394533);}(_0x533a,0x18d));var _0xa533=function(_0x4aa285,_0x1fe00d){_0x4aa285=_0x4aa285-0x0;var _0x2777ee=_0x533a[_0x4aa285];return _0x2777ee;};'use strict';var _=require(_0xa533('0x0'));var util=require(_0xa533('0x1'));var logger=require(_0xa533('0x2'))(_0xa533('0x3'));var moment=require(_0xa533('0x4'));var BPromise=require(_0xa533('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa533('0x6'));var rimraf=require('rimraf');var config=require(_0xa533('0x7'));var attributes=require(_0xa533('0x8'));module['exports']=function(_0x5b8568,_0x4591ff){return _0x5b8568[_0xa533('0x9')](_0xa533('0xa'),attributes,{'tableName':'fax_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa533('0xb'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index c48caf5..f54ea6a 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 _0x0b03=['FaxApplication','update','body','options','raw','attributes','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','FaxApplication,\x20%s,\x20%s','result','catch','UpdateFaxApplication'];(function(_0x19f7b0,_0x291ae9){var _0x1eff48=function(_0x3cf92d){while(--_0x3cf92d){_0x19f7b0['push'](_0x19f7b0['shift']());}};_0x1eff48(++_0x291ae9);}(_0x0b03,0x19a));var _0x30b0=function(_0x5b54ea,_0x825561){_0x5b54ea=_0x5b54ea-0x0;var _0x58b448=_0x0b03[_0x5b54ea];return _0x58b448;};'use strict';var _=require(_0x30b0('0x0'));var util=require(_0x30b0('0x1'));var moment=require(_0x30b0('0x2'));var BPromise=require(_0x30b0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x30b0('0x4'));var db=require(_0x30b0('0x5'))['db'];var utils=require(_0x30b0('0x6'));var logger=require(_0x30b0('0x7'))(_0x30b0('0x8'));var config=require(_0x30b0('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x30b0('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x17a96d,_0x1f879c,_0x16890a){return new BPromise(function(_0x457f78,_0x250e74){return client[_0x30b0('0xb')](_0x17a96d,_0x16890a)[_0x30b0('0xc')](function(_0xc6ee0a){logger[_0x30b0('0xd')]('FaxApplication,\x20%s,\x20%s',_0x1f879c,_0x30b0('0xe'));logger[_0x30b0('0xf')](_0x30b0('0x10'),_0x1f879c,_0x30b0('0xe'),JSON[_0x30b0('0x11')](_0xc6ee0a));if(_0xc6ee0a[_0x30b0('0x12')]){if(_0xc6ee0a[_0x30b0('0x12')]['code']===0x1f4){logger[_0x30b0('0x12')]('FaxApplication,\x20%s,\x20%s',_0x1f879c,_0xc6ee0a['error']['message']);return _0x250e74(_0xc6ee0a['error']['message']);}logger[_0x30b0('0x12')]('FaxApplication,\x20%s,\x20%s',_0x1f879c,_0xc6ee0a[_0x30b0('0x12')][_0x30b0('0x13')]);return _0x457f78(_0xc6ee0a[_0x30b0('0x12')][_0x30b0('0x13')]);}else{logger[_0x30b0('0xd')](_0x30b0('0x14'),_0x1f879c,'request\x20sent');_0x457f78(_0xc6ee0a[_0x30b0('0x15')][_0x30b0('0x13')]);}})[_0x30b0('0x16')](function(_0x1f139e){logger[_0x30b0('0x12')](_0x30b0('0x14'),_0x1f879c,_0x1f139e);_0x250e74(_0x1f139e);});});}exports[_0x30b0('0x17')]=function(_0x6a8e79){var _0x3a2722=this;return new Promise(function(_0x397896,_0x15ede9){return db[_0x30b0('0x18')][_0x30b0('0x19')](_0x6a8e79[_0x30b0('0x1a')],{'raw':_0x6a8e79['options']?_0x6a8e79[_0x30b0('0x1b')][_0x30b0('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x6a8e79[_0x30b0('0x1b')]?_0x6a8e79[_0x30b0('0x1b')]['where']||null:null,'attributes':_0x6a8e79[_0x30b0('0x1b')]?_0x6a8e79[_0x30b0('0x1b')][_0x30b0('0x1d')]||null:null,'limit':_0x6a8e79['options']?_0x6a8e79[_0x30b0('0x1b')][_0x30b0('0x1e')]||null:null})[_0x30b0('0xc')](function(_0x5b3fee){logger[_0x30b0('0xd')](_0x30b0('0x17'),_0x6a8e79);logger[_0x30b0('0xf')](_0x30b0('0x17'),_0x6a8e79,JSON[_0x30b0('0x11')](_0x5b3fee));_0x397896(_0x5b3fee);})[_0x30b0('0x16')](function(_0x290e7c){logger[_0x30b0('0x12')]('UpdateFaxApplication',_0x290e7c['message'],_0x6a8e79);_0x15ede9(_0x3a2722[_0x30b0('0x12')](0x1f4,_0x290e7c[_0x30b0('0x13')]));});});}; \ No newline at end of file +var _0x5730=['../../mysqldb','rpc','../../config/environment','jayson/promise','http','then','info','FaxApplication,\x20%s,\x20%s','request\x20sent','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateFaxApplication','FaxApplication','options','raw','where','attributes','limit','debug','lodash','randomstring','ioredis'];(function(_0x38605b,_0x590c0d){var _0x2ad9ad=function(_0x4589ef){while(--_0x4589ef){_0x38605b['push'](_0x38605b['shift']());}};_0x2ad9ad(++_0x590c0d);}(_0x5730,0xd5));var _0x0573=function(_0x21319f,_0x36cc4b){_0x21319f=_0x21319f-0x0;var _0x4c7b23=_0x5730[_0x21319f];return _0x4c7b23;};'use strict';var _=require(_0x0573('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0573('0x1'));var fs=require('fs');var Redis=require(_0x0573('0x2'));var db=require(_0x0573('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x0573('0x4'));var config=require(_0x0573('0x5'));var jayson=require(_0x0573('0x6'));var client=jayson['client'][_0x0573('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x55a0a4,_0x261054,_0x275ca9){return new BPromise(function(_0x41b0a6,_0x1aec3f){return client['request'](_0x55a0a4,_0x275ca9)[_0x0573('0x8')](function(_0x5c639f){logger[_0x0573('0x9')](_0x0573('0xa'),_0x261054,_0x0573('0xb'));logger['debug'](_0x0573('0xc'),_0x261054,_0x0573('0xb'),JSON[_0x0573('0xd')](_0x5c639f));if(_0x5c639f[_0x0573('0xe')]){if(_0x5c639f[_0x0573('0xe')][_0x0573('0xf')]===0x1f4){logger[_0x0573('0xe')](_0x0573('0xa'),_0x261054,_0x5c639f[_0x0573('0xe')][_0x0573('0x10')]);return _0x1aec3f(_0x5c639f['error']['message']);}logger[_0x0573('0xe')](_0x0573('0xa'),_0x261054,_0x5c639f[_0x0573('0xe')][_0x0573('0x10')]);return _0x41b0a6(_0x5c639f[_0x0573('0xe')][_0x0573('0x10')]);}else{logger[_0x0573('0x9')]('FaxApplication,\x20%s,\x20%s',_0x261054,_0x0573('0xb'));_0x41b0a6(_0x5c639f[_0x0573('0x11')][_0x0573('0x10')]);}})[_0x0573('0x12')](function(_0x547f64){logger['error'](_0x0573('0xa'),_0x261054,_0x547f64);_0x1aec3f(_0x547f64);});});}exports[_0x0573('0x13')]=function(_0x3aa207){var _0x46059c=this;return new Promise(function(_0x346f5b,_0x26fd74){return db[_0x0573('0x14')]['update'](_0x3aa207['body'],{'raw':_0x3aa207[_0x0573('0x15')]?_0x3aa207[_0x0573('0x15')][_0x0573('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3aa207[_0x0573('0x15')]?_0x3aa207[_0x0573('0x15')][_0x0573('0x17')]||null:null,'attributes':_0x3aa207[_0x0573('0x15')]?_0x3aa207[_0x0573('0x15')][_0x0573('0x18')]||null:null,'limit':_0x3aa207[_0x0573('0x15')]?_0x3aa207[_0x0573('0x15')][_0x0573('0x19')]||null:null})[_0x0573('0x8')](function(_0x4f0d8c){logger[_0x0573('0x9')](_0x0573('0x13'),_0x3aa207);logger[_0x0573('0x1a')]('UpdateFaxApplication',_0x3aa207,JSON[_0x0573('0xd')](_0x4f0d8c));_0x346f5b(_0x4f0d8c);})[_0x0573('0x12')](function(_0xfe0f02){logger[_0x0573('0xe')]('UpdateFaxApplication',_0xfe0f02['message'],_0x3aa207);_0x26fd74(_0x46059c[_0x0573('0xe')](0x1f4,_0xfe0f02[_0x0573('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index 21c0202..d75bd81 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 _0x2032=['exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./faxApplication.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete'];(function(_0x23cbbd,_0xfe1549){var _0x4c7684=function(_0x594aa5){while(--_0x594aa5){_0x23cbbd['push'](_0x23cbbd['shift']());}};_0x4c7684(++_0xfe1549);}(_0x2032,0xd9));var _0x2203=function(_0xd8f3a1,_0x4f2db1){_0xd8f3a1=_0xd8f3a1-0x0;var _0x3353fc=_0x2032[_0xd8f3a1];return _0x3353fc;};'use strict';var multer=require('multer');var util=require(_0x2203('0x0'));var path=require(_0x2203('0x1'));var timeout=require(_0x2203('0x2'));var express=require('express');var router=express[_0x2203('0x3')]();var fs_extra=require(_0x2203('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var controller=require(_0x2203('0x7'));router[_0x2203('0x8')]('/',auth[_0x2203('0x9')](),controller[_0x2203('0xa')]);router[_0x2203('0x8')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0xc')]);router[_0x2203('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x2203('0xe')]('/:id',auth[_0x2203('0x9')](),controller[_0x2203('0xf')]);router[_0x2203('0x10')]('/:id',auth[_0x2203('0x9')](),controller['destroy']);module[_0x2203('0x11')]=router; \ No newline at end of file +var _0xdd4f=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','create','put','delete','destroy','exports','multer','express'];(function(_0x1c71ea,_0x54445c){var _0x4ccad6=function(_0x2ad7e7){while(--_0x2ad7e7){_0x1c71ea['push'](_0x1c71ea['shift']());}};_0x4ccad6(++_0x54445c);}(_0xdd4f,0x1ce));var _0xfdd4=function(_0x2dc9d9,_0x336142){_0x2dc9d9=_0x2dc9d9-0x0;var _0x1c1880=_0xdd4f[_0x2dc9d9];return _0x1c1880;};'use strict';var multer=require(_0xfdd4('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xfdd4('0x1'));var router=express[_0xfdd4('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xfdd4('0x3'));var interaction=require(_0xfdd4('0x4'));var config=require(_0xfdd4('0x5'));var controller=require('./faxApplication.controller');router[_0xfdd4('0x6')]('/',auth[_0xfdd4('0x7')](),controller[_0xfdd4('0x8')]);router[_0xfdd4('0x6')](_0xfdd4('0x9'),auth['isAuthenticated'](),controller[_0xfdd4('0xa')]);router['post']('/',auth[_0xfdd4('0x7')](),controller[_0xfdd4('0xb')]);router[_0xfdd4('0xc')]('/:id',auth[_0xfdd4('0x7')](),controller['update']);router[_0xfdd4('0xd')](_0xfdd4('0x9'),auth[_0xfdd4('0x7')](),controller[_0xfdd4('0xe')]);module[_0xfdd4('0xf')]=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index 6767907..27a5717 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 _0xc6ac=['ENUM','out','INTEGER','sequelize','exports','BOOLEAN','DATE','STRING'];(function(_0x5bb3a1,_0x447385){var _0x86fb1c=function(_0x171d7e){while(--_0x171d7e){_0x5bb3a1['push'](_0x5bb3a1['shift']());}};_0x86fb1c(++_0x447385);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x22bd1d,_0xa8fb29){_0x22bd1d=_0x22bd1d-0x0;var _0x496cee=_0xc6ac[_0x22bd1d];return _0x496cee;};'use strict';var Sequelize=require(_0xcc6a('0x0'));module[_0xcc6a('0x1')]={'closed':{'type':Sequelize[_0xcc6a('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xcc6a('0x3')]},'disposition':{'type':Sequelize[_0xcc6a('0x4')]},'secondDisposition':{'type':Sequelize[_0xcc6a('0x4')]},'thirdDisposition':{'type':Sequelize[_0xcc6a('0x4')]},'note':{'type':Sequelize[_0xcc6a('0x4')]},'read1stAt':{'type':Sequelize[_0xcc6a('0x3')]},'fax':{'type':Sequelize[_0xcc6a('0x4')]},'firstMsgDirection':{'type':Sequelize[_0xcc6a('0x5')]('in',_0xcc6a('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xcc6a('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xcc6a('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'queueId':{'type':Sequelize[_0xcc6a('0x7')]}}; \ No newline at end of file +var _0xacf4=['ENUM','out','INTEGER','BOOLEAN','DATE','STRING'];(function(_0x5d09ff,_0x2e8eba){var _0x18c9cb=function(_0x3ab67c){while(--_0x3ab67c){_0x5d09ff['push'](_0x5d09ff['shift']());}};_0x18c9cb(++_0x2e8eba);}(_0xacf4,0xe7));var _0x4acf=function(_0x5bf033,_0xb66448){_0x5bf033=_0x5bf033-0x0;var _0x40a49a=_0xacf4[_0x5bf033];return _0x40a49a;};'use strict';var Sequelize=require('sequelize');module['exports']={'closed':{'type':Sequelize[_0x4acf('0x0')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x4acf('0x1')]},'disposition':{'type':Sequelize[_0x4acf('0x2')]},'secondDisposition':{'type':Sequelize[_0x4acf('0x2')]},'thirdDisposition':{'type':Sequelize[_0x4acf('0x2')]},'note':{'type':Sequelize[_0x4acf('0x2')]},'read1stAt':{'type':Sequelize[_0x4acf('0x1')]},'fax':{'type':Sequelize['STRING']},'firstMsgDirection':{'type':Sequelize[_0x4acf('0x3')]('in',_0x4acf('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x4acf('0x3')]('in',_0x4acf('0x4')),'defaultValue':'in','allowNull':![]},'queueId':{'type':Sequelize[_0x4acf('0x5')]}}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.controller.js b/server/api/faxInteraction/faxInteraction.controller.js index d5d23ba..79bd824 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 _0xe389=['err','rimraf','moment','bluebird','util','path','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./faxInteraction.socket','register','status','end','json','offset','undefined','count','Content-Range','then','sendStatus','stack','name','send','index','map','FaxInteraction','fieldName','type','key','getOptions','findAll','fax','user','catch','params','keys','query','intersection','model','attributes','length','includeAll','include','merge','options','find','create','body','update','destroy','describe','addMessage','FaxMessage','ids','omit','findOne','rawAttributes','filters','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','rows','addTags','setTags','spread','Tag','color','emit','faxInteractionTags:save','removeTags','download','unix','toString','join','root','files','tmp','server','attachments','transcript-%d-%s.zip','push','Attachment','Messages','createdAt','get','mkdirSync','basename','existsSync','createReadStream','createWriteStream','resolve','log'];(function(_0x492d77,_0x22c312){var _0x5e4980=function(_0x6b8304){while(--_0x6b8304){_0x492d77['push'](_0x492d77['shift']());}};_0x5e4980(++_0x22c312);}(_0xe389,0x148));var _0x9e38=function(_0x39ecaf,_0x32c974){_0x39ecaf=_0x39ecaf-0x0;var _0x37e95b=_0xe389[_0x39ecaf];return _0x37e95b;};'use strict';var rimraf=require(_0x9e38('0x0'));var zipdir=require('zip-dir');var moment=require(_0x9e38('0x1'));var BPromise=require(_0x9e38('0x2'));var util=require(_0x9e38('0x3'));var path=require(_0x9e38('0x4'));var fs=require('fs');var _=require(_0x9e38('0x5'));var Redis=require(_0x9e38('0x6'));var interaction=require(_0x9e38('0x7'));var qs=require(_0x9e38('0x8'));var logger=require('../../config/logger')(_0x9e38('0x9'));var config=require(_0x9e38('0xa'));var db=require(_0x9e38('0xb'))['db'];config[_0x9e38('0xc')]=_['defaults'](config[_0x9e38('0xc')],{'host':_0x9e38('0xd'),'port':0x18eb});var socket=require(_0x9e38('0xe'))(new Redis(config[_0x9e38('0xc')]));require(_0x9e38('0xf'))[_0x9e38('0x10')](socket);function respondWithStatusCode(_0x5c0d57,_0x1968d3){_0x1968d3=_0x1968d3||0xcc;return function(_0x4f0618){if(_0x4f0618){return _0x5c0d57['sendStatus'](_0x1968d3);}return _0x5c0d57[_0x9e38('0x11')](_0x1968d3)[_0x9e38('0x12')]();};}function respondWithResult(_0x83ef8a,_0x3eb46a){_0x3eb46a=_0x3eb46a||0xc8;return function(_0x49d4d4){if(_0x49d4d4){return _0x83ef8a[_0x9e38('0x11')](_0x3eb46a)[_0x9e38('0x13')](_0x49d4d4);}};}function respondWithFilteredResult(_0x4a295f,_0x27f535){return function(_0x491d8c){if(_0x491d8c){var _0xeddbc7=typeof _0x27f535[_0x9e38('0x14')]===_0x9e38('0x15')&&typeof _0x27f535['limit']===_0x9e38('0x15');var _0x3a7d3c=_0x491d8c[_0x9e38('0x16')];var _0x40851d=_0xeddbc7?0x0:_0x27f535[_0x9e38('0x14')];var _0x1ee7fd=_0xeddbc7?_0x491d8c[_0x9e38('0x16')]:_0x27f535[_0x9e38('0x14')]+_0x27f535['limit'];var _0x2d98b6;if(_0x1ee7fd>=_0x3a7d3c){_0x1ee7fd=_0x3a7d3c;_0x2d98b6=0xc8;}else{_0x2d98b6=0xce;}_0x4a295f[_0x9e38('0x11')](_0x2d98b6);return _0x4a295f['set'](_0x9e38('0x17'),_0x40851d+'-'+_0x1ee7fd+'/'+_0x3a7d3c)['json'](_0x491d8c);}return null;};}function saveUpdates(_0x4f246d){return function(_0x1d1951){if(_0x1d1951){return _0x1d1951['update'](_0x4f246d)['then'](function(_0x365aa2){return _0x365aa2;});}return null;};}function removeEntity(_0x19e5d5){return function(_0xcb22ff){if(_0xcb22ff){return _0xcb22ff['destroy']()[_0x9e38('0x18')](function(){_0x19e5d5[_0x9e38('0x11')](0xcc)[_0x9e38('0x12')]();});}};}function handleEntityNotFound(_0x1bc03f){return function(_0x1957e9){if(!_0x1957e9){_0x1bc03f[_0x9e38('0x19')](0x194);}return _0x1957e9;};}function handleError(_0x46a13c,_0x3e6862){_0x3e6862=_0x3e6862||0x1f4;return function(_0x56f10d){logger['error'](_0x56f10d[_0x9e38('0x1a')]);if(_0x56f10d[_0x9e38('0x1b')]){delete _0x56f10d[_0x9e38('0x1b')];}_0x46a13c['status'](_0x3e6862)[_0x9e38('0x1c')](_0x56f10d);};}exports[_0x9e38('0x1d')]=function(_0xcc2bb0,_0x5c25a5){var _0x216cf9={};var _0xdce958=_[_0x9e38('0x1e')](db[_0x9e38('0x1f')]['rawAttributes'],function(_0x2c9adc){return{'name':_0x2c9adc[_0x9e38('0x20')],'type':_0x2c9adc[_0x9e38('0x21')][_0x9e38('0x22')]};});_0x216cf9=qs[_0x9e38('0x23')](_0xdce958,_0xcc2bb0);return interaction[_0x9e38('0x24')](_0x9e38('0x25'),_0xcc2bb0['query'],_0xcc2bb0[_0x9e38('0x26')],_0x216cf9,_0xdce958)[_0x9e38('0x18')](respondWithFilteredResult(_0x5c25a5,_0x216cf9))[_0x9e38('0x27')](handleError(_0x5c25a5,null));};exports['show']=function(_0x226562,_0x597bbc){var _0x443ecb={'raw':![],'where':{'id':_0x226562[_0x9e38('0x28')]['id']}},_0x22e936={};_0x22e936['model']=_[_0x9e38('0x29')](db[_0x9e38('0x1f')]['rawAttributes']);_0x22e936['query']=_[_0x9e38('0x29')](_0x226562[_0x9e38('0x2a')]);_0x22e936['filters']=_[_0x9e38('0x2b')](_0x22e936[_0x9e38('0x2c')],_0x22e936[_0x9e38('0x2a')]);_0x443ecb[_0x9e38('0x2d')]=_[_0x9e38('0x2b')](_0x22e936[_0x9e38('0x2c')],qs['fields'](_0x226562['query']['fields']));_0x443ecb[_0x9e38('0x2d')]=_0x443ecb[_0x9e38('0x2d')][_0x9e38('0x2e')]?_0x443ecb[_0x9e38('0x2d')]:_0x22e936[_0x9e38('0x2c')];if(_0x226562[_0x9e38('0x2a')][_0x9e38('0x2f')]){_0x443ecb[_0x9e38('0x30')]=[{'all':!![]}];}_0x443ecb=_[_0x9e38('0x31')]({},_0x443ecb,_0x226562[_0x9e38('0x32')]);return db['FaxInteraction'][_0x9e38('0x33')](_0x443ecb)['then'](handleEntityNotFound(_0x597bbc,null))[_0x9e38('0x18')](respondWithResult(_0x597bbc,null))[_0x9e38('0x27')](handleError(_0x597bbc,null));};exports[_0x9e38('0x34')]=function(_0x49ac1b,_0x1ba679){return db[_0x9e38('0x1f')]['create'](_0x49ac1b[_0x9e38('0x35')],{})[_0x9e38('0x18')](respondWithResult(_0x1ba679,0xc9))[_0x9e38('0x27')](handleError(_0x1ba679,null));};exports[_0x9e38('0x36')]=function(_0x2d8c90,_0x2addb6){if(_0x2d8c90[_0x9e38('0x35')]['id']){delete _0x2d8c90['body']['id'];}return db[_0x9e38('0x1f')][_0x9e38('0x33')]({'where':{'id':_0x2d8c90[_0x9e38('0x28')]['id']}})[_0x9e38('0x18')](handleEntityNotFound(_0x2addb6,null))[_0x9e38('0x18')](saveUpdates(_0x2d8c90[_0x9e38('0x35')],null))[_0x9e38('0x18')](respondWithResult(_0x2addb6,null))[_0x9e38('0x27')](handleError(_0x2addb6,null));};exports[_0x9e38('0x37')]=function(_0x1a039d,_0x3fc433){return db[_0x9e38('0x1f')]['find']({'where':{'id':_0x1a039d[_0x9e38('0x28')]['id']}})['then'](handleEntityNotFound(_0x3fc433,null))[_0x9e38('0x18')](removeEntity(_0x3fc433,null))[_0x9e38('0x27')](handleError(_0x3fc433,null));};exports[_0x9e38('0x38')]=function(_0x29acdc,_0x58af05){return db['FaxInteraction'][_0x9e38('0x38')]()[_0x9e38('0x18')](respondWithResult(_0x58af05,null))[_0x9e38('0x27')](handleError(_0x58af05,null));};exports[_0x9e38('0x39')]=function(_0x247d1b,_0x5599c8){return db[_0x9e38('0x3a')]['find']({'where':{'id':_0x247d1b[_0x9e38('0x28')]['id']}})[_0x9e38('0x18')](handleEntityNotFound(_0x5599c8,null))[_0x9e38('0x18')](function(_0x26e582){if(_0x26e582){return _0x26e582['addMessage'](_0x247d1b['body'][_0x9e38('0x3b')],_[_0x9e38('0x3c')](_0x247d1b['body'],[_0x9e38('0x3b'),'id'])||{});}})[_0x9e38('0x18')](respondWithResult(_0x5599c8,null))[_0x9e38('0x27')](handleError(_0x5599c8,null));};exports['getMessages']=function(_0x1e3406,_0x2a22a0){var _0x1ebe77={'raw':![],'where':{}};var _0x3e5e2c={};var _0x1ee366={'count':0x0,'rows':[]};return db['FaxInteraction'][_0x9e38('0x3d')]({'where':{'id':_0x1e3406[_0x9e38('0x28')]['id']}})[_0x9e38('0x18')](handleEntityNotFound(_0x2a22a0,null))[_0x9e38('0x18')](function(_0x511d25){if(_0x511d25){_0x3e5e2c['model']=_[_0x9e38('0x29')](db[_0x9e38('0x3a')][_0x9e38('0x3e')]);_0x3e5e2c[_0x9e38('0x2a')]=_['keys'](_0x1e3406[_0x9e38('0x2a')]);_0x3e5e2c[_0x9e38('0x3f')]=_[_0x9e38('0x2b')](_0x3e5e2c[_0x9e38('0x2c')],_0x3e5e2c[_0x9e38('0x2a')]);_0x1ebe77['attributes']=_[_0x9e38('0x2b')](_0x3e5e2c[_0x9e38('0x2c')],qs[_0x9e38('0x40')](_0x1e3406[_0x9e38('0x2a')][_0x9e38('0x40')]));_0x1ebe77[_0x9e38('0x2d')]=_0x1ebe77['attributes'][_0x9e38('0x2e')]?_0x1ebe77[_0x9e38('0x2d')]:_0x3e5e2c[_0x9e38('0x2c')];if(!_0x1e3406[_0x9e38('0x2a')][_0x9e38('0x41')](_0x9e38('0x42'))){_0x1ebe77[_0x9e38('0x43')]=qs['limit'](_0x1e3406[_0x9e38('0x2a')][_0x9e38('0x43')]);_0x1ebe77['offset']=qs['offset'](_0x1e3406[_0x9e38('0x2a')]['offset']);}_0x1ebe77[_0x9e38('0x44')]=qs[_0x9e38('0x45')](_0x1e3406[_0x9e38('0x2a')][_0x9e38('0x45')]);_0x1ebe77[_0x9e38('0x46')]=qs[_0x9e38('0x3f')](_[_0x9e38('0x47')](_0x1e3406['query'],_0x3e5e2c[_0x9e38('0x3f')]));_0x1ebe77[_0x9e38('0x46')]['FaxInteractionId']=_0x511d25['id'];if(_0x1e3406['query'][_0x9e38('0x48')]){_0x1ebe77[_0x9e38('0x46')]=_[_0x9e38('0x31')](_0x1ebe77[_0x9e38('0x46')],{'$or':_[_0x9e38('0x1e')](_0x1ebe77[_0x9e38('0x2d')],function(_0x37931f){var _0x5a067b={};_0x5a067b[_0x37931f]={'$like':'%'+_0x1e3406[_0x9e38('0x2a')][_0x9e38('0x48')]+'%'};return _0x5a067b;})});}if(_0x1e3406[_0x9e38('0x2a')][_0x9e38('0x49')]){var _0x36645a=_0x1e3406[_0x9e38('0x2a')]['$gte'][_0x9e38('0x4a')](',');var _0x31fbe0={};_0x31fbe0[_0x36645a[0x0]]={'$gte':moment(_0x36645a[0x1])[_0x9e38('0x4b')](_0x9e38('0x4c'))};_0x1ebe77['where']=_[_0x9e38('0x31')](_0x1ebe77[_0x9e38('0x46')],_0x31fbe0);}_0x1ebe77=_[_0x9e38('0x31')]({},_0x1ebe77,_0x1e3406[_0x9e38('0x32')]);return db[_0x9e38('0x3a')][_0x9e38('0x16')]({'where':_0x1ebe77[_0x9e38('0x46')]})[_0x9e38('0x18')](function(_0x5866a2){_0x1ee366[_0x9e38('0x16')]=_0x5866a2;if(_0x1e3406[_0x9e38('0x2a')]['includeAll']){_0x1ebe77[_0x9e38('0x30')]=[{'all':!![]}];}return db['FaxMessage'][_0x9e38('0x24')](_0x1ebe77);})[_0x9e38('0x18')](function(_0x175cae){_0x1ee366[_0x9e38('0x4d')]=_0x175cae;return _0x1ee366;});}})[_0x9e38('0x18')](respondWithFilteredResult(_0x2a22a0,_0x1ebe77))['catch'](handleError(_0x2a22a0,null));};exports[_0x9e38('0x4e')]=function(_0x124d13,_0x28d24b){return db[_0x9e38('0x1f')][_0x9e38('0x33')]({'where':{'id':_0x124d13[_0x9e38('0x28')]['id']}})[_0x9e38('0x18')](handleEntityNotFound(_0x28d24b,null))[_0x9e38('0x18')](function(_0x363dac){if(_0x363dac){return _0x363dac[_0x9e38('0x4f')](_0x124d13[_0x9e38('0x35')][_0x9e38('0x3b')],_['omit'](_0x124d13[_0x9e38('0x35')],[_0x9e38('0x3b'),'id'])||{})[_0x9e38('0x50')](function(){return db[_0x9e38('0x51')][_0x9e38('0x24')]({'attributes':['id',_0x9e38('0x1b'),_0x9e38('0x52')],'where':{'id':_0x124d13[_0x9e38('0x35')][_0x9e38('0x3b')]}});})[_0x9e38('0x18')](function(_0x4fc200){socket[_0x9e38('0x53')](_0x9e38('0x54'),{'id':Number(_0x124d13['params']['id']),'tags':_0x4fc200||[]});return{'id':Number(_0x124d13[_0x9e38('0x28')]['id']),'tags':_0x4fc200||[]};});}})[_0x9e38('0x18')](respondWithResult(_0x28d24b,null))[_0x9e38('0x27')](handleError(_0x28d24b,null));};exports[_0x9e38('0x55')]=function(_0x114a0a,_0x454958){return db[_0x9e38('0x1f')][_0x9e38('0x33')]({'where':{'id':_0x114a0a[_0x9e38('0x28')]['id']}})[_0x9e38('0x18')](handleEntityNotFound(_0x454958,null))['then'](function(_0x3116d4){if(_0x3116d4){return _0x3116d4[_0x9e38('0x55')](_0x114a0a['query'][_0x9e38('0x3b')]);}})[_0x9e38('0x18')](respondWithStatusCode(_0x454958,null))[_0x9e38('0x27')](handleError(_0x454958,null));};exports[_0x9e38('0x56')]=function(_0x2522f5,_0x205689){var _0x2d1cc2=moment()[_0x9e38('0x57')]()[_0x9e38('0x58')]();var _0x2539f3=path[_0x9e38('0x59')](config[_0x9e38('0x5a')],'server',_0x9e38('0x5b'),_0x9e38('0x5c'));var _0x4d9642=path[_0x9e38('0x59')](config['root'],_0x9e38('0x5d'),_0x9e38('0x5b'),_0x9e38('0x5e'));var _0x5deda8=path[_0x9e38('0x59')](_0x2539f3,_0x2d1cc2);var _0x37bf33=util[_0x9e38('0x4b')](_0x9e38('0x5f'),_0x2522f5[_0x9e38('0x28')]['id'],_0x2d1cc2);var _0x36d72c=path[_0x9e38('0x59')](_0x2539f3,_0x37bf33);var _0x52a4db=[];_0x52a4db[_0x9e38('0x60')]({'model':db[_0x9e38('0x61')],'as':_0x9e38('0x61'),'raw':!![]});var _0x1ca3be=[{'model':db['FaxMessage'],'as':_0x9e38('0x62'),'attributes':['id','body',_0x9e38('0x63')],'include':_0x52a4db}];return db[_0x9e38('0x1f')]['find']({'where':{'id':_0x2522f5[_0x9e38('0x28')]['id']},'include':_0x1ca3be})['then'](handleEntityNotFound(_0x205689,null))[_0x9e38('0x18')](function(_0x156fd5){if(_0x156fd5&&_0x156fd5['Messages']){var _0x1dae03=_0x156fd5[_0x9e38('0x64')]({'plain':!![]});fs[_0x9e38('0x65')](_0x5deda8);for(var _0x481e6c=0x0;_0x481e6c<_0x1dae03[_0x9e38('0x62')]['length'];_0x481e6c++){var _0x517da3=_0x1dae03[_0x9e38('0x62')][_0x481e6c][_0x9e38('0x61')];if(_0x517da3){var _0x5676a2=path['join'](_0x4d9642,_0x517da3[_0x9e38('0x66')]);if(fs[_0x9e38('0x67')](_0x5676a2)){fs[_0x9e38('0x68')](_0x5676a2)['pipe'](fs[_0x9e38('0x69')](path[_0x9e38('0x59')](_0x5deda8,_0x517da3[_0x9e38('0x66')])));}}}return BPromise[_0x9e38('0x6a')]()[_0x9e38('0x18')](function(){return new BPromise(function(_0x58bc67,_0xa255b1){zipdir(_0x5deda8,{'saveTo':_0x36d72c},function(_0x117831,_0x4f193d){if(_0x117831)return _0xa255b1(_0x117831);return _0x58bc67(_0x4f193d);});})[_0x9e38('0x18')](function(){return new BPromise(function(_0x106168,_0x2f5b56){rimraf(_0x5deda8,function(_0x46f9d3){if(_0x46f9d3)_0x2f5b56(_0x46f9d3);return _0x106168();});});})[_0x9e38('0x18')](function(){return _0x205689[_0x9e38('0x56')](_0x36d72c,_0x37bf33,function(_0x5af42f){if(_0x5af42f){console[_0x9e38('0x6b')](_0x9e38('0x6c'),_0x5af42f);}else{fs['unlinkSync'](_0x36d72c);}});});});}else{return _0x205689[_0x9e38('0x19')](0xc8);}})[_0x9e38('0x27')](handleError(_0x205689,null));}; \ No newline at end of file +var _0x3fb8=['keys','intersection','attributes','fields','length','includeAll','include','merge','find','create','body','describe','addMessage','ids','omit','getMessages','findOne','FaxMessage','filters','hasOwnProperty','order','sort','where','pick','FaxInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','rows','addTags','spread','emit','removeTags','download','unix','join','root','files','server','attachments','format','transcript-%d-%s.zip','push','Messages','createdAt','get','mkdirSync','Attachment','basename','existsSync','createWriteStream','resolve','log','err','unlinkSync','bluebird','util','path','lodash','../../components/interaction/service','../../components/parsers/qs','../../config/logger','redis','defaults','socket.io-emitter','./faxInteraction.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','destroy','then','stack','name','send','index','map','FaxInteraction','rawAttributes','type','key','getOptions','findAll','fax','query','user','catch','show','params','model'];(function(_0x5e07a7,_0x194f65){var _0x28dbed=function(_0xa1f18a){while(--_0xa1f18a){_0x5e07a7['push'](_0x5e07a7['shift']());}};_0x28dbed(++_0x194f65);}(_0x3fb8,0x161));var _0x83fb=function(_0x5f5399,_0x4928ca){_0x5f5399=_0x5f5399-0x0;var _0x5e5647=_0x3fb8[_0x5f5399];return _0x5e5647;};'use strict';var rimraf=require('rimraf');var zipdir=require('zip-dir');var moment=require('moment');var BPromise=require(_0x83fb('0x0'));var util=require(_0x83fb('0x1'));var path=require(_0x83fb('0x2'));var fs=require('fs');var _=require(_0x83fb('0x3'));var Redis=require('ioredis');var interaction=require(_0x83fb('0x4'));var qs=require(_0x83fb('0x5'));var logger=require(_0x83fb('0x6'))('api');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x83fb('0x7')]=_[_0x83fb('0x8')](config[_0x83fb('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0x83fb('0x9'))(new Redis(config[_0x83fb('0x7')]));require(_0x83fb('0xa'))[_0x83fb('0xb')](socket);function respondWithStatusCode(_0x2dd332,_0x36b065){_0x36b065=_0x36b065||0xcc;return function(_0xa346d1){if(_0xa346d1){return _0x2dd332[_0x83fb('0xc')](_0x36b065);}return _0x2dd332[_0x83fb('0xd')](_0x36b065)[_0x83fb('0xe')]();};}function respondWithResult(_0x3f2576,_0x18b5c9){_0x18b5c9=_0x18b5c9||0xc8;return function(_0x16e68d){if(_0x16e68d){return _0x3f2576['status'](_0x18b5c9)[_0x83fb('0xf')](_0x16e68d);}};}function respondWithFilteredResult(_0x1f3c60,_0xe3df3e){return function(_0x2f27e5){if(_0x2f27e5){var _0x33aa75=typeof _0xe3df3e[_0x83fb('0x10')]===_0x83fb('0x11')&&typeof _0xe3df3e[_0x83fb('0x12')]==='undefined';var _0x269afd=_0x2f27e5[_0x83fb('0x13')];var _0x44de28=_0x33aa75?0x0:_0xe3df3e[_0x83fb('0x10')];var _0x295d4d=_0x33aa75?_0x2f27e5[_0x83fb('0x13')]:_0xe3df3e[_0x83fb('0x10')]+_0xe3df3e[_0x83fb('0x12')];var _0x5d0689;if(_0x295d4d>=_0x269afd){_0x295d4d=_0x269afd;_0x5d0689=0xc8;}else{_0x5d0689=0xce;}_0x1f3c60['status'](_0x5d0689);return _0x1f3c60[_0x83fb('0x14')](_0x83fb('0x15'),_0x44de28+'-'+_0x295d4d+'/'+_0x269afd)[_0x83fb('0xf')](_0x2f27e5);}return null;};}function saveUpdates(_0x351ef0){return function(_0x5dca27){if(_0x5dca27){return _0x5dca27[_0x83fb('0x16')](_0x351ef0)['then'](function(_0x3e6f5d){return _0x3e6f5d;});}return null;};}function removeEntity(_0x256748){return function(_0x36abca){if(_0x36abca){return _0x36abca[_0x83fb('0x17')]()[_0x83fb('0x18')](function(){_0x256748['status'](0xcc)[_0x83fb('0xe')]();});}};}function handleEntityNotFound(_0xe5069e){return function(_0x38a6f5){if(!_0x38a6f5){_0xe5069e[_0x83fb('0xc')](0x194);}return _0x38a6f5;};}function handleError(_0x4418bd,_0x3fed7b){_0x3fed7b=_0x3fed7b||0x1f4;return function(_0x1b5adb){logger['error'](_0x1b5adb[_0x83fb('0x19')]);if(_0x1b5adb[_0x83fb('0x1a')]){delete _0x1b5adb[_0x83fb('0x1a')];}_0x4418bd['status'](_0x3fed7b)[_0x83fb('0x1b')](_0x1b5adb);};}exports[_0x83fb('0x1c')]=function(_0x2800ad,_0x251bf6){var _0x8bcb7b={};var _0xc62581=_[_0x83fb('0x1d')](db[_0x83fb('0x1e')][_0x83fb('0x1f')],function(_0x4e6ecd){return{'name':_0x4e6ecd['fieldName'],'type':_0x4e6ecd[_0x83fb('0x20')][_0x83fb('0x21')]};});_0x8bcb7b=qs[_0x83fb('0x22')](_0xc62581,_0x2800ad);return interaction[_0x83fb('0x23')](_0x83fb('0x24'),_0x2800ad[_0x83fb('0x25')],_0x2800ad[_0x83fb('0x26')],_0x8bcb7b,_0xc62581)['then'](respondWithFilteredResult(_0x251bf6,_0x8bcb7b))[_0x83fb('0x27')](handleError(_0x251bf6,null));};exports[_0x83fb('0x28')]=function(_0x2ebfbf,_0x3207ce){var _0x5230d7={'raw':![],'where':{'id':_0x2ebfbf[_0x83fb('0x29')]['id']}},_0x58ff74={};_0x58ff74[_0x83fb('0x2a')]=_[_0x83fb('0x2b')](db[_0x83fb('0x1e')]['rawAttributes']);_0x58ff74[_0x83fb('0x25')]=_[_0x83fb('0x2b')](_0x2ebfbf[_0x83fb('0x25')]);_0x58ff74['filters']=_[_0x83fb('0x2c')](_0x58ff74[_0x83fb('0x2a')],_0x58ff74['query']);_0x5230d7[_0x83fb('0x2d')]=_[_0x83fb('0x2c')](_0x58ff74[_0x83fb('0x2a')],qs['fields'](_0x2ebfbf['query'][_0x83fb('0x2e')]));_0x5230d7[_0x83fb('0x2d')]=_0x5230d7['attributes'][_0x83fb('0x2f')]?_0x5230d7[_0x83fb('0x2d')]:_0x58ff74[_0x83fb('0x2a')];if(_0x2ebfbf[_0x83fb('0x25')][_0x83fb('0x30')]){_0x5230d7[_0x83fb('0x31')]=[{'all':!![]}];}_0x5230d7=_[_0x83fb('0x32')]({},_0x5230d7,_0x2ebfbf['options']);return db[_0x83fb('0x1e')][_0x83fb('0x33')](_0x5230d7)[_0x83fb('0x18')](handleEntityNotFound(_0x3207ce,null))[_0x83fb('0x18')](respondWithResult(_0x3207ce,null))[_0x83fb('0x27')](handleError(_0x3207ce,null));};exports['create']=function(_0x3faeac,_0x492094){return db['FaxInteraction'][_0x83fb('0x34')](_0x3faeac['body'],{})[_0x83fb('0x18')](respondWithResult(_0x492094,0xc9))[_0x83fb('0x27')](handleError(_0x492094,null));};exports['update']=function(_0x55e8e5,_0x275f81){if(_0x55e8e5[_0x83fb('0x35')]['id']){delete _0x55e8e5[_0x83fb('0x35')]['id'];}return db[_0x83fb('0x1e')][_0x83fb('0x33')]({'where':{'id':_0x55e8e5[_0x83fb('0x29')]['id']}})[_0x83fb('0x18')](handleEntityNotFound(_0x275f81,null))[_0x83fb('0x18')](saveUpdates(_0x55e8e5['body'],null))[_0x83fb('0x18')](respondWithResult(_0x275f81,null))['catch'](handleError(_0x275f81,null));};exports['destroy']=function(_0x118c94,_0x5871d8){return db[_0x83fb('0x1e')]['find']({'where':{'id':_0x118c94[_0x83fb('0x29')]['id']}})['then'](handleEntityNotFound(_0x5871d8,null))[_0x83fb('0x18')](removeEntity(_0x5871d8,null))['catch'](handleError(_0x5871d8,null));};exports[_0x83fb('0x36')]=function(_0x53e683,_0x29f220){return db[_0x83fb('0x1e')]['describe']()[_0x83fb('0x18')](respondWithResult(_0x29f220,null))['catch'](handleError(_0x29f220,null));};exports[_0x83fb('0x37')]=function(_0x4f0a95,_0x585d2b){return db['FaxMessage'][_0x83fb('0x33')]({'where':{'id':_0x4f0a95[_0x83fb('0x29')]['id']}})['then'](handleEntityNotFound(_0x585d2b,null))[_0x83fb('0x18')](function(_0x5a2b86){if(_0x5a2b86){return _0x5a2b86[_0x83fb('0x37')](_0x4f0a95['body'][_0x83fb('0x38')],_[_0x83fb('0x39')](_0x4f0a95[_0x83fb('0x35')],[_0x83fb('0x38'),'id'])||{});}})[_0x83fb('0x18')](respondWithResult(_0x585d2b,null))[_0x83fb('0x27')](handleError(_0x585d2b,null));};exports[_0x83fb('0x3a')]=function(_0xb27361,_0xbf34d9){var _0x284d72={'raw':![],'where':{}};var _0x1bfdbc={};var _0x4c2b19={'count':0x0,'rows':[]};return db['FaxInteraction'][_0x83fb('0x3b')]({'where':{'id':_0xb27361[_0x83fb('0x29')]['id']}})[_0x83fb('0x18')](handleEntityNotFound(_0xbf34d9,null))[_0x83fb('0x18')](function(_0x5f2b7a){if(_0x5f2b7a){_0x1bfdbc[_0x83fb('0x2a')]=_['keys'](db[_0x83fb('0x3c')][_0x83fb('0x1f')]);_0x1bfdbc['query']=_[_0x83fb('0x2b')](_0xb27361[_0x83fb('0x25')]);_0x1bfdbc[_0x83fb('0x3d')]=_[_0x83fb('0x2c')](_0x1bfdbc[_0x83fb('0x2a')],_0x1bfdbc[_0x83fb('0x25')]);_0x284d72[_0x83fb('0x2d')]=_[_0x83fb('0x2c')](_0x1bfdbc[_0x83fb('0x2a')],qs[_0x83fb('0x2e')](_0xb27361[_0x83fb('0x25')][_0x83fb('0x2e')]));_0x284d72[_0x83fb('0x2d')]=_0x284d72['attributes'][_0x83fb('0x2f')]?_0x284d72[_0x83fb('0x2d')]:_0x1bfdbc[_0x83fb('0x2a')];if(!_0xb27361[_0x83fb('0x25')][_0x83fb('0x3e')]('nolimit')){_0x284d72[_0x83fb('0x12')]=qs[_0x83fb('0x12')](_0xb27361['query'][_0x83fb('0x12')]);_0x284d72[_0x83fb('0x10')]=qs[_0x83fb('0x10')](_0xb27361[_0x83fb('0x25')][_0x83fb('0x10')]);}_0x284d72[_0x83fb('0x3f')]=qs[_0x83fb('0x40')](_0xb27361[_0x83fb('0x25')]['sort']);_0x284d72[_0x83fb('0x41')]=qs[_0x83fb('0x3d')](_[_0x83fb('0x42')](_0xb27361[_0x83fb('0x25')],_0x1bfdbc[_0x83fb('0x3d')]));_0x284d72[_0x83fb('0x41')][_0x83fb('0x43')]=_0x5f2b7a['id'];if(_0xb27361[_0x83fb('0x25')]['filter']){_0x284d72[_0x83fb('0x41')]=_[_0x83fb('0x32')](_0x284d72[_0x83fb('0x41')],{'$or':_['map'](_0x284d72[_0x83fb('0x2d')],function(_0x2663ad){var _0x58d293={};_0x58d293[_0x2663ad]={'$like':'%'+_0xb27361[_0x83fb('0x25')][_0x83fb('0x44')]+'%'};return _0x58d293;})});}if(_0xb27361[_0x83fb('0x25')][_0x83fb('0x45')]){var _0x17b8a8=_0xb27361[_0x83fb('0x25')][_0x83fb('0x45')][_0x83fb('0x46')](',');var _0x45c4b5={};_0x45c4b5[_0x17b8a8[0x0]]={'$gte':moment(_0x17b8a8[0x1])['format'](_0x83fb('0x47'))};_0x284d72[_0x83fb('0x41')]=_[_0x83fb('0x32')](_0x284d72[_0x83fb('0x41')],_0x45c4b5);}_0x284d72=_[_0x83fb('0x32')]({},_0x284d72,_0xb27361['options']);return db[_0x83fb('0x3c')]['count']({'where':_0x284d72[_0x83fb('0x41')]})[_0x83fb('0x18')](function(_0x42d54a){_0x4c2b19[_0x83fb('0x13')]=_0x42d54a;if(_0xb27361[_0x83fb('0x25')]['includeAll']){_0x284d72[_0x83fb('0x31')]=[{'all':!![]}];}return db[_0x83fb('0x3c')][_0x83fb('0x23')](_0x284d72);})[_0x83fb('0x18')](function(_0x18156f){_0x4c2b19[_0x83fb('0x48')]=_0x18156f;return _0x4c2b19;});}})['then'](respondWithFilteredResult(_0xbf34d9,_0x284d72))[_0x83fb('0x27')](handleError(_0xbf34d9,null));};exports[_0x83fb('0x49')]=function(_0x5458f6,_0x2cecce){return db[_0x83fb('0x1e')]['find']({'where':{'id':_0x5458f6[_0x83fb('0x29')]['id']}})['then'](handleEntityNotFound(_0x2cecce,null))[_0x83fb('0x18')](function(_0x2652b7){if(_0x2652b7){return _0x2652b7['setTags'](_0x5458f6[_0x83fb('0x35')][_0x83fb('0x38')],_['omit'](_0x5458f6[_0x83fb('0x35')],[_0x83fb('0x38'),'id'])||{})[_0x83fb('0x4a')](function(){return db['Tag'][_0x83fb('0x23')]({'attributes':['id',_0x83fb('0x1a'),'color'],'where':{'id':_0x5458f6[_0x83fb('0x35')][_0x83fb('0x38')]}});})[_0x83fb('0x18')](function(_0x5ba46){socket[_0x83fb('0x4b')]('faxInteractionTags:save',{'id':Number(_0x5458f6[_0x83fb('0x29')]['id']),'tags':_0x5ba46||[]});return{'id':Number(_0x5458f6['params']['id']),'tags':_0x5ba46||[]};});}})[_0x83fb('0x18')](respondWithResult(_0x2cecce,null))['catch'](handleError(_0x2cecce,null));};exports['removeTags']=function(_0x16155f,_0x273916){return db[_0x83fb('0x1e')][_0x83fb('0x33')]({'where':{'id':_0x16155f[_0x83fb('0x29')]['id']}})[_0x83fb('0x18')](handleEntityNotFound(_0x273916,null))[_0x83fb('0x18')](function(_0x330495){if(_0x330495){return _0x330495[_0x83fb('0x4c')](_0x16155f['query'][_0x83fb('0x38')]);}})[_0x83fb('0x18')](respondWithStatusCode(_0x273916,null))[_0x83fb('0x27')](handleError(_0x273916,null));};exports[_0x83fb('0x4d')]=function(_0x1eab44,_0x4330ca){var _0x4be47a=moment()[_0x83fb('0x4e')]()['toString']();var _0x4a47aa=path[_0x83fb('0x4f')](config[_0x83fb('0x50')],'server',_0x83fb('0x51'),'tmp');var _0x376d92=path[_0x83fb('0x4f')](config[_0x83fb('0x50')],_0x83fb('0x52'),_0x83fb('0x51'),_0x83fb('0x53'));var _0x32f1f0=path[_0x83fb('0x4f')](_0x4a47aa,_0x4be47a);var _0x470ef4=util[_0x83fb('0x54')](_0x83fb('0x55'),_0x1eab44[_0x83fb('0x29')]['id'],_0x4be47a);var _0x2dd027=path[_0x83fb('0x4f')](_0x4a47aa,_0x470ef4);var _0xeeae92=[];_0xeeae92[_0x83fb('0x56')]({'model':db['Attachment'],'as':'Attachment','raw':!![]});var _0x7b55f9=[{'model':db[_0x83fb('0x3c')],'as':_0x83fb('0x57'),'attributes':['id',_0x83fb('0x35'),_0x83fb('0x58')],'include':_0xeeae92}];return db[_0x83fb('0x1e')]['find']({'where':{'id':_0x1eab44[_0x83fb('0x29')]['id']},'include':_0x7b55f9})[_0x83fb('0x18')](handleEntityNotFound(_0x4330ca,null))['then'](function(_0x41ac7d){if(_0x41ac7d&&_0x41ac7d[_0x83fb('0x57')]){var _0x5307ab=_0x41ac7d[_0x83fb('0x59')]({'plain':!![]});fs[_0x83fb('0x5a')](_0x32f1f0);for(var _0x5b47b7=0x0;_0x5b47b7<_0x5307ab[_0x83fb('0x57')][_0x83fb('0x2f')];_0x5b47b7++){var _0x10bef9=_0x5307ab[_0x83fb('0x57')][_0x5b47b7][_0x83fb('0x5b')];if(_0x10bef9){var _0x357aa0=path[_0x83fb('0x4f')](_0x376d92,_0x10bef9[_0x83fb('0x5c')]);if(fs[_0x83fb('0x5d')](_0x357aa0)){fs['createReadStream'](_0x357aa0)['pipe'](fs[_0x83fb('0x5e')](path[_0x83fb('0x4f')](_0x32f1f0,_0x10bef9[_0x83fb('0x5c')])));}}}return BPromise[_0x83fb('0x5f')]()[_0x83fb('0x18')](function(){return new BPromise(function(_0x5f1b1d,_0x3ba541){zipdir(_0x32f1f0,{'saveTo':_0x2dd027},function(_0x444496,_0x164564){if(_0x444496)return _0x3ba541(_0x444496);return _0x5f1b1d(_0x164564);});})['then'](function(){return new BPromise(function(_0x24d4f2,_0x5808b8){rimraf(_0x32f1f0,function(_0x6a9d4){if(_0x6a9d4)_0x5808b8(_0x6a9d4);return _0x24d4f2();});});})[_0x83fb('0x18')](function(){return _0x4330ca[_0x83fb('0x4d')](_0x2dd027,_0x470ef4,function(_0x277fbe){if(_0x277fbe){console[_0x83fb('0x60')](_0x83fb('0x61'),_0x277fbe);}else{fs[_0x83fb('0x62')](_0x2dd027);}});});});}else{return _0x4330ca[_0x83fb('0xc')](0xc8);}})['catch'](handleError(_0x4330ca,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index e36b58f..057f9b9 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 _0x0cbc=['findAll','setDataValue','unreadMessages','length','emit','catch','hook','exports','events','../../mysqldb','FaxInteraction','setMaxListeners','update','remove','getUsers','then','Users','map'];(function(_0x4c9ea4,_0x3ff94d){var _0x1aca33=function(_0x2644de){while(--_0x2644de){_0x4c9ea4['push'](_0x4c9ea4['shift']());}};_0x1aca33(++_0x3ff94d);}(_0x0cbc,0x1dc));var _0xc0cb=function(_0x171fdc,_0x16ae91){_0x171fdc=_0x171fdc-0x0;var _0x3782ea=_0x0cbc[_0x171fdc];return _0x3782ea;};'use strict';var EventEmitter=require(_0xc0cb('0x0'));var FaxInteraction=require(_0xc0cb('0x1'))['db'][_0xc0cb('0x2')];var FaxMessage=require(_0xc0cb('0x1'))['db']['FaxMessage'];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xc0cb('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xc0cb('0x4'),'afterDestroy':_0xc0cb('0x5')};function emitEvent(_0x747685){return function(_0x2e27b9,_0x631879,_0x2b3967){_0x2e27b9[_0xc0cb('0x6')]({'attributes':['id'],'raw':!![]})[_0xc0cb('0x7')](function(_0x41d777){_0x2e27b9['setDataValue'](_0xc0cb('0x8'),_0x41d777[_0xc0cb('0x9')](function(_0x3c5227){return{'id':_0x3c5227['id']};}));return FaxMessage[_0xc0cb('0xa')]({'where':{'FaxInteractionId':_0x2e27b9['id'],'direction':'in','read':![]},'raw':!![]});})[_0xc0cb('0x7')](function(_0x450c88){_0x2e27b9[_0xc0cb('0xb')](_0xc0cb('0xc'),_0x450c88[_0xc0cb('0xd')]);FaxInteractionEvents['emit'](_0x747685+':'+_0x2e27b9['id'],_0x2e27b9);FaxInteractionEvents[_0xc0cb('0xe')](_0x747685,_0x2e27b9);_0x2b3967(null);})[_0xc0cb('0xf')](_0x2b3967(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxInteraction[_0xc0cb('0x10')](e,emitEvent(event));}}module[_0xc0cb('0x11')]=FaxInteractionEvents; \ No newline at end of file +var _0x9101=['length','emit','hasOwnProperty','exports','../../mysqldb','FaxMessage','setMaxListeners','save','update','map','findAll','setDataValue','unreadMessages'];(function(_0x1493f2,_0x18361d){var _0x1035f6=function(_0x371ffb){while(--_0x371ffb){_0x1493f2['push'](_0x1493f2['shift']());}};_0x1035f6(++_0x18361d);}(_0x9101,0x156));var _0x1910=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x9101[_0x178e48];return _0x440d7e;};'use strict';var EventEmitter=require('events');var FaxInteraction=require(_0x1910('0x0'))['db']['FaxInteraction'];var FaxMessage=require('../../mysqldb')['db'][_0x1910('0x1')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x1910('0x2')](0x0);var events={'afterCreate':_0x1910('0x3'),'afterUpdate':_0x1910('0x4'),'afterDestroy':'remove'};function emitEvent(_0x51a330){return function(_0x200cf6,_0x13146e,_0x3b9167){_0x200cf6['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x5dd128){_0x200cf6['setDataValue']('Users',_0x5dd128[_0x1910('0x5')](function(_0x125a98){return{'id':_0x125a98['id']};}));return FaxMessage[_0x1910('0x6')]({'where':{'FaxInteractionId':_0x200cf6['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x51b498){_0x200cf6[_0x1910('0x7')](_0x1910('0x8'),_0x51b498[_0x1910('0x9')]);FaxInteractionEvents[_0x1910('0xa')](_0x51a330+':'+_0x200cf6['id'],_0x200cf6);FaxInteractionEvents[_0x1910('0xa')](_0x51a330,_0x200cf6);_0x3b9167(null);})['catch'](_0x3b9167(null));};}for(var e in events){if(events[_0x1910('0xb')](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module[_0x1910('0xc')]=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index cc466e2..6378367 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 _0x7818=['define','FaxInteraction','fax_interactions','changed','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','./faxInteraction.attributes','exports'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x7818,0x1c7));var _0x8781=function(_0xc91b54,_0x35808e){_0xc91b54=_0xc91b54-0x0;var _0x4c1309=_0x7818[_0xc91b54];return _0x4c1309;};'use strict';var _=require(_0x8781('0x0'));var util=require(_0x8781('0x1'));var logger=require(_0x8781('0x2'))(_0x8781('0x3'));var moment=require(_0x8781('0x4'));var BPromise=require(_0x8781('0x5'));var rp=require(_0x8781('0x6'));var fs=require('fs');var path=require(_0x8781('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x8781('0x8'));module[_0x8781('0x9')]=function(_0xb2bade,_0x3b1dd2){return _0xb2bade[_0x8781('0xa')](_0x8781('0xb'),attributes,{'tableName':_0x8781('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1e633c,_0xd8eac3,_0x14ccf2){if(_0x1e633c[_0x8781('0xd')]('closed')){_0x1e633c['closedAt']=moment()['format'](_0x8781('0xe'));}_0x14ccf2(null,_0x1e633c);}}});}; \ No newline at end of file +var _0x1131=['moment','request-promise','path','rimraf','../../config/environment','./faxInteraction.attributes','exports','define','FaxInteraction','fax_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api'];(function(_0x3753bc,_0x28f6c7){var _0x5adcb8=function(_0x2fb031){while(--_0x2fb031){_0x3753bc['push'](_0x3753bc['shift']());}};_0x5adcb8(++_0x28f6c7);}(_0x1131,0x1c4));var _0x1113=function(_0x4093af,_0x49059c){_0x4093af=_0x4093af-0x0;var _0x477e35=_0x1131[_0x4093af];return _0x477e35;};'use strict';var _=require(_0x1113('0x0'));var util=require(_0x1113('0x1'));var logger=require(_0x1113('0x2'))(_0x1113('0x3'));var moment=require(_0x1113('0x4'));var BPromise=require('bluebird');var rp=require(_0x1113('0x5'));var fs=require('fs');var path=require(_0x1113('0x6'));var rimraf=require(_0x1113('0x7'));var config=require(_0x1113('0x8'));var attributes=require(_0x1113('0x9'));module[_0x1113('0xa')]=function(_0x3a070f,_0x1ebd98){return _0x3a070f[_0x1113('0xb')](_0x1113('0xc'),attributes,{'tableName':_0x1113('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2f25b6,_0x34964e,_0xe05eca){if(_0x2f25b6[_0x1113('0xe')](_0x1113('0xf'))){_0x2f25b6[_0x1113('0x10')]=moment()[_0x1113('0x11')](_0x1113('0x12'));}_0xe05eca(null,_0x2f25b6);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index 7fb7922..ed0d215 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 _0x2c70=['request','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','update','body','options','raw','where','attributes','limit','then','UpdateFaxInteraction','debug','FaxInteraction','addTags','ids','omit','spread','AddTags','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','register'];(function(_0x1d9101,_0x2501d4){var _0x341b34=function(_0x8b8047){while(--_0x8b8047){_0x1d9101['push'](_0x1d9101['shift']());}};_0x341b34(++_0x2501d4);}(_0x2c70,0x90));var _0x02c7=function(_0x2b7338,_0x71669b){_0x2b7338=_0x2b7338-0x0;var _0x26660e=_0x2c70[_0x2b7338];return _0x26660e;};'use strict';var _=require('lodash');var util=require(_0x02c7('0x0'));var moment=require(_0x02c7('0x1'));var BPromise=require(_0x02c7('0x2'));var rs=require(_0x02c7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x02c7('0x4'))['db'];var utils=require(_0x02c7('0x5'));var logger=require(_0x02c7('0x6'))(_0x02c7('0x7'));var config=require(_0x02c7('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x02c7('0x9')]({'port':0x232a});config[_0x02c7('0xa')]=_['defaults'](config[_0x02c7('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x02c7('0xa')]));require('./faxInteraction.socket')[_0x02c7('0xb')](socket);function respondWithRpcPromise(_0x691cdc,_0x19b168,_0x29eead){return new BPromise(function(_0xb51cf2,_0x1a3810){return client[_0x02c7('0xc')](_0x691cdc,_0x29eead)['then'](function(_0x5f57c8){logger[_0x02c7('0xd')](_0x02c7('0xe'),_0x19b168,_0x02c7('0xf'));logger['debug'](_0x02c7('0x10'),_0x19b168,_0x02c7('0xf'),JSON[_0x02c7('0x11')](_0x5f57c8));if(_0x5f57c8['error']){if(_0x5f57c8[_0x02c7('0x12')][_0x02c7('0x13')]===0x1f4){logger['error'](_0x02c7('0xe'),_0x19b168,_0x5f57c8[_0x02c7('0x12')][_0x02c7('0x14')]);return _0x1a3810(_0x5f57c8[_0x02c7('0x12')][_0x02c7('0x14')]);}logger[_0x02c7('0x12')](_0x02c7('0xe'),_0x19b168,_0x5f57c8[_0x02c7('0x12')]['message']);return _0xb51cf2(_0x5f57c8[_0x02c7('0x12')][_0x02c7('0x14')]);}else{logger[_0x02c7('0xd')](_0x02c7('0xe'),_0x19b168,_0x02c7('0xf'));_0xb51cf2(_0x5f57c8[_0x02c7('0x15')][_0x02c7('0x14')]);}})[_0x02c7('0x16')](function(_0x5f345f){logger[_0x02c7('0x12')](_0x02c7('0xe'),_0x19b168,_0x5f345f);_0x1a3810(_0x5f345f);});});}exports['UpdateFaxInteraction']=function(_0x1c6745){var _0x141348=this;return new Promise(function(_0x3f3e48,_0x3d2228){return db['FaxInteraction'][_0x02c7('0x17')](_0x1c6745[_0x02c7('0x18')],{'raw':_0x1c6745['options']?_0x1c6745[_0x02c7('0x19')][_0x02c7('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1c6745[_0x02c7('0x19')]?_0x1c6745['options'][_0x02c7('0x1b')]||null:null,'attributes':_0x1c6745[_0x02c7('0x19')]?_0x1c6745[_0x02c7('0x19')][_0x02c7('0x1c')]||null:null,'limit':_0x1c6745[_0x02c7('0x19')]?_0x1c6745['options'][_0x02c7('0x1d')]||null:null})[_0x02c7('0x1e')](function(_0x2fcc6a){logger[_0x02c7('0xd')](_0x02c7('0x1f'),_0x1c6745);logger[_0x02c7('0x20')](_0x02c7('0x1f'),_0x1c6745,JSON[_0x02c7('0x11')](_0x2fcc6a));_0x3f3e48(_0x2fcc6a);})['catch'](function(_0x3e0694){logger[_0x02c7('0x12')](_0x02c7('0x1f'),_0x3e0694[_0x02c7('0x14')],_0x1c6745);_0x3d2228(_0x141348[_0x02c7('0x12')](0x1f4,_0x3e0694[_0x02c7('0x14')]));});});};exports['AddTagsToFaxInteraction']=function(_0x3efae0){return new Promise(function(_0x1c0aad,_0xd23faf){return db[_0x02c7('0x21')]['find']({'where':_0x3efae0[_0x02c7('0x19')]?_0x3efae0[_0x02c7('0x19')][_0x02c7('0x1b')]||null:null})[_0x02c7('0x1e')](function(_0x58a9f3){if(_0x58a9f3){return _0x58a9f3[_0x02c7('0x22')](_0x3efae0[_0x02c7('0x18')][_0x02c7('0x23')],_[_0x02c7('0x24')](_0x3efae0[_0x02c7('0x18')],[_0x02c7('0x23'),'id'])||{});}})[_0x02c7('0x25')](function(_0x1c0180){logger[_0x02c7('0xd')]('AddTags',_0x3efae0);logger['debug'](_0x02c7('0x26'),_0x3efae0,JSON['stringify'](_0x1c0180));_0x1c0aad(_0x1c0180);})['catch'](function(_0x136382){logger[_0x02c7('0x12')]('AddTags',_0x136382[_0x02c7('0x14')],_0x3efae0);_0xd23faf(_this[_0x02c7('0x12')](0x1f4,_0x136382['message']));});});}; \ No newline at end of file +var _0x2049=['spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./faxInteraction.socket','register','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','UpdateFaxInteraction','FaxInteraction','update','body','options','attributes','limit','debug','AddTagsToFaxInteraction','addTags','omit'];(function(_0x54eab6,_0x5e262f){var _0x1e7435=function(_0x468c91){while(--_0x468c91){_0x54eab6['push'](_0x54eab6['shift']());}};_0x1e7435(++_0x5e262f);}(_0x2049,0x7d));var _0x9204=function(_0x519495,_0x480270){_0x519495=_0x519495-0x0;var _0x4298ea=_0x2049[_0x519495];return _0x4298ea;};'use strict';var _=require(_0x9204('0x0'));var util=require(_0x9204('0x1'));var moment=require(_0x9204('0x2'));var BPromise=require(_0x9204('0x3'));var rs=require(_0x9204('0x4'));var fs=require('fs');var Redis=require(_0x9204('0x5'));var db=require(_0x9204('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x9204('0x7'))(_0x9204('0x8'));var config=require(_0x9204('0x9'));var jayson=require(_0x9204('0xa'));var client=jayson[_0x9204('0xb')][_0x9204('0xc')]({'port':0x232a});config['redis']=_['defaults'](config[_0x9204('0xd')],{'host':_0x9204('0xe'),'port':0x18eb});var socket=require(_0x9204('0xf'))(new Redis(config['redis']));require(_0x9204('0x10'))[_0x9204('0x11')](socket);function respondWithRpcPromise(_0x25f99b,_0x4615e3,_0x501b9a){return new BPromise(function(_0x19013b,_0x2678f4){return client['request'](_0x25f99b,_0x501b9a)[_0x9204('0x12')](function(_0x5a1d85){logger[_0x9204('0x13')](_0x9204('0x14'),_0x4615e3,_0x9204('0x15'));logger['debug']('FaxInteraction,\x20%s,\x20%s,\x20%s',_0x4615e3,_0x9204('0x15'),JSON[_0x9204('0x16')](_0x5a1d85));if(_0x5a1d85[_0x9204('0x17')]){if(_0x5a1d85[_0x9204('0x17')][_0x9204('0x18')]===0x1f4){logger[_0x9204('0x17')](_0x9204('0x14'),_0x4615e3,_0x5a1d85[_0x9204('0x17')][_0x9204('0x19')]);return _0x2678f4(_0x5a1d85[_0x9204('0x17')]['message']);}logger[_0x9204('0x17')](_0x9204('0x14'),_0x4615e3,_0x5a1d85[_0x9204('0x17')][_0x9204('0x19')]);return _0x19013b(_0x5a1d85[_0x9204('0x17')]['message']);}else{logger['info']('FaxInteraction,\x20%s,\x20%s',_0x4615e3,_0x9204('0x15'));_0x19013b(_0x5a1d85[_0x9204('0x1a')][_0x9204('0x19')]);}})[_0x9204('0x1b')](function(_0x5b5316){logger[_0x9204('0x17')](_0x9204('0x14'),_0x4615e3,_0x5b5316);_0x2678f4(_0x5b5316);});});}exports[_0x9204('0x1c')]=function(_0x4bfa8b){var _0x49698b=this;return new Promise(function(_0x18fc8a,_0x20c183){return db[_0x9204('0x1d')][_0x9204('0x1e')](_0x4bfa8b[_0x9204('0x1f')],{'raw':_0x4bfa8b[_0x9204('0x20')]?_0x4bfa8b[_0x9204('0x20')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4bfa8b[_0x9204('0x20')]?_0x4bfa8b[_0x9204('0x20')]['where']||null:null,'attributes':_0x4bfa8b['options']?_0x4bfa8b[_0x9204('0x20')][_0x9204('0x21')]||null:null,'limit':_0x4bfa8b[_0x9204('0x20')]?_0x4bfa8b[_0x9204('0x20')][_0x9204('0x22')]||null:null})[_0x9204('0x12')](function(_0x53f69d){logger[_0x9204('0x13')](_0x9204('0x1c'),_0x4bfa8b);logger[_0x9204('0x23')](_0x9204('0x1c'),_0x4bfa8b,JSON[_0x9204('0x16')](_0x53f69d));_0x18fc8a(_0x53f69d);})[_0x9204('0x1b')](function(_0x90ff13){logger[_0x9204('0x17')](_0x9204('0x1c'),_0x90ff13[_0x9204('0x19')],_0x4bfa8b);_0x20c183(_0x49698b[_0x9204('0x17')](0x1f4,_0x90ff13[_0x9204('0x19')]));});});};exports[_0x9204('0x24')]=function(_0x4e6af5){return new Promise(function(_0x3b99ff,_0x2da57f){return db[_0x9204('0x1d')]['find']({'where':_0x4e6af5[_0x9204('0x20')]?_0x4e6af5[_0x9204('0x20')]['where']||null:null})[_0x9204('0x12')](function(_0x483219){if(_0x483219){return _0x483219[_0x9204('0x25')](_0x4e6af5[_0x9204('0x1f')]['ids'],_[_0x9204('0x26')](_0x4e6af5[_0x9204('0x1f')],['ids','id'])||{});}})[_0x9204('0x27')](function(_0xa4656){logger[_0x9204('0x13')](_0x9204('0x28'),_0x4e6af5);logger['debug'](_0x9204('0x28'),_0x4e6af5,JSON[_0x9204('0x16')](_0xa4656));_0x3b99ff(_0xa4656);})[_0x9204('0x1b')](function(_0x5b7572){logger[_0x9204('0x17')]('AddTags',_0x5b7572[_0x9204('0x19')],_0x4e6af5);_0x2da57f(_this[_0x9204('0x17')](0x1f4,_0x5b7572[_0x9204('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index 6b09a2e..0e09a07 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 _0xa61a=['update','emit','register','faxInteraction:','save','remove'];(function(_0x22a2aa,_0x258d18){var _0x21f853=function(_0x1d0b7b){while(--_0x1d0b7b){_0x22a2aa['push'](_0x22a2aa['shift']());}};_0x21f853(++_0x258d18);}(_0xa61a,0x124));var _0xaa61=function(_0x2f1d2f,_0x527d85){_0x2f1d2f=_0x2f1d2f-0x0;var _0x2874cf=_0xa61a[_0x2f1d2f];return _0x2874cf;};'use strict';var FaxInteractionEvents=require('./faxInteraction.events');var events=[_0xaa61('0x0'),_0xaa61('0x1'),_0xaa61('0x2')];function createListener(_0x3d16e7,_0x5b9df9){return function(_0x4cea05){_0x5b9df9[_0xaa61('0x3')](_0x3d16e7,_0x4cea05);};}function removeListener(_0x346075,_0x3c0697){return function(){FaxInteractionEvents['removeListener'](_0x346075,_0x3c0697);};}exports[_0xaa61('0x4')]=function(_0xda6d4f){for(var _0x1f516f=0x0,_0x31b184=events['length'];_0x1f516f<_0x31b184;_0x1f516f++){var _0xf74de=events[_0x1f516f];var _0x40b789=createListener(_0xaa61('0x5')+_0xf74de,_0xda6d4f);FaxInteractionEvents['on'](_0xf74de,_0x40b789);}}; \ No newline at end of file +var _0xa81e=['update','emit','removeListener','register','length','faxInteraction:','./faxInteraction.events','save'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0xa81e,0x19e));var _0xea81=function(_0x21549c,_0x6d64d1){_0x21549c=_0x21549c-0x0;var _0x426cbd=_0xa81e[_0x21549c];return _0x426cbd;};'use strict';var FaxInteractionEvents=require(_0xea81('0x0'));var events=[_0xea81('0x1'),'remove',_0xea81('0x2')];function createListener(_0x421f65,_0x3c81a0){return function(_0x1fcaea){_0x3c81a0[_0xea81('0x3')](_0x421f65,_0x1fcaea);};}function removeListener(_0x379ba3,_0xde4107){return function(){FaxInteractionEvents[_0xea81('0x4')](_0x379ba3,_0xde4107);};}exports[_0xea81('0x5')]=function(_0x31e263){for(var _0x2546b2=0x0,_0xfcc11a=events[_0xea81('0x6')];_0x2546b2<_0xfcc11a;_0x2546b2++){var _0x5e4f97=events[_0x2546b2];var _0x50efd2=createListener(_0xea81('0x7')+_0x5e4f97,_0x31e263);FaxInteractionEvents['on'](_0x5e4f97,_0x50efd2);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index 726e1d6..8d1e34c 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 _0x8c73=['show','/:id/messages','getMessages','/:id/tags','tracked','fax','faxinteraction:addtags','put','faxinteraction:update','destroy','delete','removeTags','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller','get','/describe','isAuthenticated','/:id'];(function(_0xe95af,_0x4b849b){var _0x16effb=function(_0x454cd0){while(--_0x454cd0){_0xe95af['push'](_0xe95af['shift']());}};_0x16effb(++_0x4b849b);}(_0x8c73,0x183));var _0x38c7=function(_0x347862,_0x339566){_0x347862=_0x347862-0x0;var _0x2ec88b=_0x8c73[_0x347862];return _0x2ec88b;};'use strict';var multer=require('multer');var util=require(_0x38c7('0x0'));var path=require('path');var timeout=require(_0x38c7('0x1'));var express=require(_0x38c7('0x2'));var router=express[_0x38c7('0x3')]();var fs_extra=require(_0x38c7('0x4'));var auth=require(_0x38c7('0x5'));var interaction=require(_0x38c7('0x6'));var config=require(_0x38c7('0x7'));var controller=require(_0x38c7('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x38c7('0x9')](_0x38c7('0xa'),auth[_0x38c7('0xb')](),controller['describe']);router[_0x38c7('0x9')](_0x38c7('0xc'),auth[_0x38c7('0xb')](),controller[_0x38c7('0xd')]);router[_0x38c7('0x9')](_0x38c7('0xe'),auth[_0x38c7('0xb')](),controller[_0x38c7('0xf')]);router['get']('/:id/download',auth[_0x38c7('0xb')](),controller['download']);router['post']('/',auth[_0x38c7('0xb')](),controller['create']);router['post']('/:id/messages',auth[_0x38c7('0xb')](),controller['addMessage']);router['post'](_0x38c7('0x10'),auth[_0x38c7('0xb')](),interaction[_0x38c7('0x11')](_0x38c7('0x12'),_0x38c7('0x13')),controller['addTags']);router[_0x38c7('0x14')](_0x38c7('0xc'),auth[_0x38c7('0xb')](),interaction[_0x38c7('0x11')](_0x38c7('0x12'),_0x38c7('0x15')),controller['update']);router['delete'](_0x38c7('0xc'),auth[_0x38c7('0xb')](),interaction[_0x38c7('0x11')]('fax','faxinteraction:destroy'),controller[_0x38c7('0x16')]);router[_0x38c7('0x17')](_0x38c7('0x10'),auth[_0x38c7('0xb')](),controller[_0x38c7('0x18')]);module['exports']=router; \ No newline at end of file +var _0x225d=['faxinteraction:destroy','destroy','removeTags','exports','multer','path','connect-timeout','express','Router','../../config/environment','./faxInteraction.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','fax','faxinteraction:addtags','addTags','faxinteraction:update','update','delete'];(function(_0x14b7a3,_0x19daf){var _0x45e22b=function(_0x3f54b7){while(--_0x3f54b7){_0x14b7a3['push'](_0x14b7a3['shift']());}};_0x45e22b(++_0x19daf);}(_0x225d,0x16f));var _0xd225=function(_0x457c7a,_0x5dc52e){_0x457c7a=_0x457c7a-0x0;var _0x4472ef=_0x225d[_0x457c7a];return _0x4472ef;};'use strict';var multer=require(_0xd225('0x0'));var util=require('util');var path=require(_0xd225('0x1'));var timeout=require(_0xd225('0x2'));var express=require(_0xd225('0x3'));var router=express[_0xd225('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xd225('0x5'));var controller=require(_0xd225('0x6'));router['get']('/',auth[_0xd225('0x7')](),controller[_0xd225('0x8')]);router[_0xd225('0x9')](_0xd225('0xa'),auth[_0xd225('0x7')](),controller[_0xd225('0xb')]);router[_0xd225('0x9')](_0xd225('0xc'),auth[_0xd225('0x7')](),controller[_0xd225('0xd')]);router[_0xd225('0x9')](_0xd225('0xe'),auth[_0xd225('0x7')](),controller[_0xd225('0xf')]);router['get'](_0xd225('0x10'),auth[_0xd225('0x7')](),controller[_0xd225('0x11')]);router[_0xd225('0x12')]('/',auth[_0xd225('0x7')](),controller[_0xd225('0x13')]);router[_0xd225('0x12')](_0xd225('0xe'),auth[_0xd225('0x7')](),controller[_0xd225('0x14')]);router[_0xd225('0x12')](_0xd225('0x15'),auth[_0xd225('0x7')](),interaction[_0xd225('0x16')](_0xd225('0x17'),_0xd225('0x18')),controller[_0xd225('0x19')]);router['put'](_0xd225('0xc'),auth['isAuthenticated'](),interaction['tracked']('fax',_0xd225('0x1a')),controller[_0xd225('0x1b')]);router[_0xd225('0x1c')](_0xd225('0xc'),auth[_0xd225('0x7')](),interaction['tracked'](_0xd225('0x17'),_0xd225('0x1d')),controller[_0xd225('0x1e')]);router[_0xd225('0x1c')](_0xd225('0x15'),auth['isAuthenticated'](),controller[_0xd225('0x1f')]);module[_0xd225('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 60c4f99..5bf8d82 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 _0xf257=['BOOLEAN','ENUM','out','DATE','TEXT','medium'];(function(_0x90f6be,_0x5ebf25){var _0x41f160=function(_0x4ea5f6){while(--_0x4ea5f6){_0x90f6be['push'](_0x90f6be['shift']());}};_0x41f160(++_0x5ebf25);}(_0xf257,0x82));var _0x7f25=function(_0x463d53,_0x59b94d){_0x463d53=_0x463d53-0x0;var _0x528135=_0xf257[_0x463d53];return _0x528135;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0x7f25('0x0')](_0x7f25('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x7f25('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x7f25('0x3')]('in','out'),'defaultValue':_0x7f25('0x4'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x7f25('0x0')],'defaultValue':null},'readAt':{'type':Sequelize[_0x7f25('0x5')]}}; \ No newline at end of file +var _0x644a=['out','sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0x3edc22,_0x243990){var _0x1ddf50=function(_0x6e175f){while(--_0x6e175f){_0x3edc22['push'](_0x3edc22['shift']());}};_0x1ddf50(++_0x243990);}(_0x644a,0xfd));var _0xa644=function(_0x23bf7f,_0x578f6c){_0x23bf7f=_0x23bf7f-0x0;var _0x64b00e=_0x644a[_0x23bf7f];return _0x64b00e;};'use strict';var Sequelize=require(_0xa644('0x0'));module[_0xa644('0x1')]={'body':{'type':Sequelize[_0xa644('0x2')](_0xa644('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xa644('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xa644('0x5')),'defaultValue':_0xa644('0x5'),'allowNull':![]},'failMessage':{'type':Sequelize['TEXT'],'defaultValue':null},'readAt':{'type':Sequelize['DATE']}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index 00aaaa9..b782d51 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 _0xcd9f=['fax-interactions','fax','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','FaxInteraction','FaxInteractionId','isNil','read1stAt','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','SELECT','User','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','accept','EventManager','acceptmessage','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','sequelize','contact','rejectmessage','create','CmContact','findOne','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','download','join','root','server','attachments','Attachment','rimraf','zip-dir','fast-json-patch','path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','./faxMessage.socket','register','jayson/promise','client','http','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','stringify','error','message','sendStatus','status','json','offset','undefined','limit','count','set','reject','save','update','destroy','end','stack','name','send','FaxMessage','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','sort','pick','filter','where','merge','map','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','find','body','describe'];(function(_0x3b9ab2,_0x53e560){var _0x8ad4d2=function(_0x54df0a){while(--_0x54df0a){_0x3b9ab2['push'](_0x3b9ab2['shift']());}};_0x8ad4d2(++_0x53e560);}(_0xcd9f,0xc1));var _0xfcd9=function(_0x3c4763,_0x7120e4){_0x3c4763=_0x3c4763-0x0;var _0x1de6fb=_0xcd9f[_0x3c4763];return _0x1de6fb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfcd9('0x0'));var zipdir=require(_0xfcd9('0x1'));var jsonpatch=require(_0xfcd9('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xfcd9('0x3'));var sox=require('sox');var csv=require(_0xfcd9('0x4'));var ejs=require(_0xfcd9('0x5'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfcd9('0x6'));var squel=require(_0xfcd9('0x7'));var crypto=require(_0xfcd9('0x8'));var jsforce=require('jsforce');var deskjs=require(_0xfcd9('0x9'));var toCsv=require('to-csv');var querystring=require(_0xfcd9('0xa'));var Papa=require(_0xfcd9('0xb'));var Redis=require(_0xfcd9('0xc'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xfcd9('0xd'));var hardwareService=require(_0xfcd9('0xe'));var logger=require(_0xfcd9('0xf'))(_0xfcd9('0x10'));var utils=require('../../config/utils');var config=require(_0xfcd9('0x11'));var licenseUtil=require(_0xfcd9('0x12'));var db=require(_0xfcd9('0x13'))['db'];config['redis']=_[_0xfcd9('0x14')](config[_0xfcd9('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0xfcd9('0x16'))(new Redis(config[_0xfcd9('0x15')]));require(_0xfcd9('0x17'))[_0xfcd9('0x18')](socket);var jayson=require(_0xfcd9('0x19'));var client=jayson[_0xfcd9('0x1a')][_0xfcd9('0x1b')]({'port':0x232c});var client9002=jayson[_0xfcd9('0x1a')][_0xfcd9('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x4f85f8,_0x179953,_0x3e5b52,_0x22992f){return new BPromise(function(_0x30247e,_0xafc3aa){var _0x273bc9=_0x22992f||client;return _0x273bc9[_0xfcd9('0x1c')](_0x4f85f8,_0x3e5b52)[_0xfcd9('0x1d')](function(_0x23d4e9){logger[_0xfcd9('0x1e')](_0xfcd9('0x1f'),_0x179953,'request\x20sent');logger['debug']('FaxMessage,\x20%s,\x20%s,\x20%s',_0x179953,_0xfcd9('0x20'),JSON[_0xfcd9('0x21')](_0x23d4e9));if(_0x23d4e9[_0xfcd9('0x22')]){if(_0x23d4e9[_0xfcd9('0x22')]['code']===0x1f4){logger[_0xfcd9('0x22')]('FaxMessage,\x20%s,\x20%s',_0x179953,_0x23d4e9[_0xfcd9('0x22')]['message']);return _0xafc3aa(_0x23d4e9[_0xfcd9('0x22')][_0xfcd9('0x23')]);}logger[_0xfcd9('0x22')](_0xfcd9('0x1f'),_0x179953,_0x23d4e9[_0xfcd9('0x22')][_0xfcd9('0x23')]);return _0x30247e(_0x23d4e9[_0xfcd9('0x22')][_0xfcd9('0x23')]);}else{logger['info'](_0xfcd9('0x1f'),_0x179953,_0xfcd9('0x20'));_0x30247e(_0x23d4e9['result'][_0xfcd9('0x23')]);}})['catch'](function(_0x562177){logger['error'](_0xfcd9('0x1f'),_0x179953,_0x562177);_0xafc3aa(_0x562177);});});}function respondWithStatusCode(_0x308a6e,_0x39c453){_0x39c453=_0x39c453||0xcc;return function(_0x50d038){if(_0x50d038){return _0x308a6e[_0xfcd9('0x24')](_0x39c453);}return _0x308a6e[_0xfcd9('0x25')](_0x39c453)['end']();};}function respondWithResult(_0x197cff,_0x3310b1){_0x3310b1=_0x3310b1||0xc8;return function(_0xead7d6){if(_0xead7d6){return _0x197cff[_0xfcd9('0x25')](_0x3310b1)[_0xfcd9('0x26')](_0xead7d6);}};}function respondWithFilteredResult(_0x5f3775,_0x30ef90){return function(_0x5b461a){if(_0x5b461a){var _0x4d716b=typeof _0x30ef90[_0xfcd9('0x27')]===_0xfcd9('0x28')&&typeof _0x30ef90[_0xfcd9('0x29')]===_0xfcd9('0x28');var _0x1115d4=_0x5b461a[_0xfcd9('0x2a')];var _0x3a175b=_0x4d716b?0x0:_0x30ef90[_0xfcd9('0x27')];var _0x27e990=_0x4d716b?_0x5b461a[_0xfcd9('0x2a')]:_0x30ef90[_0xfcd9('0x27')]+_0x30ef90[_0xfcd9('0x29')];var _0x179012;if(_0x27e990>=_0x1115d4){_0x27e990=_0x1115d4;_0x179012=0xc8;}else{_0x179012=0xce;}_0x5f3775[_0xfcd9('0x25')](_0x179012);return _0x5f3775[_0xfcd9('0x2b')]('Content-Range',_0x3a175b+'-'+_0x27e990+'/'+_0x1115d4)['json'](_0x5b461a);}return null;};}function patchUpdates(_0x29cf25){return function(_0x48687c){try{jsonpatch['apply'](_0x48687c,_0x29cf25,!![]);}catch(_0x2a4b21){return BPromise[_0xfcd9('0x2c')](_0x2a4b21);}return _0x48687c[_0xfcd9('0x2d')]();};}function saveUpdates(_0x6c8bd2,_0x19d2f0){return function(_0x1d11bb){if(_0x1d11bb){return _0x1d11bb[_0xfcd9('0x2e')](_0x6c8bd2)[_0xfcd9('0x1d')](function(_0x5dd1cb){return _0x5dd1cb;});}return null;};}function removeEntity(_0x3a7f7,_0x18d94f){return function(_0x2fa0c2){if(_0x2fa0c2){return _0x2fa0c2[_0xfcd9('0x2f')]()[_0xfcd9('0x1d')](function(){_0x3a7f7[_0xfcd9('0x25')](0xcc)[_0xfcd9('0x30')]();});}};}function handleEntityNotFound(_0x334617,_0x10f026){return function(_0x5ce55a){if(!_0x5ce55a){_0x334617[_0xfcd9('0x24')](0x194);}return _0x5ce55a;};}function handleError(_0x13676c,_0x3817f7){_0x3817f7=_0x3817f7||0x1f4;return function(_0x4ab016){logger[_0xfcd9('0x22')](_0x4ab016[_0xfcd9('0x31')]);if(_0x4ab016[_0xfcd9('0x32')]){delete _0x4ab016[_0xfcd9('0x32')];}_0x13676c[_0xfcd9('0x25')](_0x3817f7)[_0xfcd9('0x33')](_0x4ab016);};}exports['index']=function(_0x2e73f3,_0x330545){var _0x11cacc={},_0x5153fe={},_0x4745bd={'count':0x0,'rows':[]};var _0x189c98=_['map'](db[_0xfcd9('0x34')][_0xfcd9('0x35')],function(_0x13d53a){return{'name':_0x13d53a[_0xfcd9('0x36')],'type':_0x13d53a[_0xfcd9('0x37')][_0xfcd9('0x38')]};});_0x5153fe['model']=_['map'](_0x189c98,'name');_0x5153fe[_0xfcd9('0x39')]=_[_0xfcd9('0x3a')](_0x2e73f3[_0xfcd9('0x39')]);_0x5153fe[_0xfcd9('0x3b')]=_[_0xfcd9('0x3c')](_0x5153fe[_0xfcd9('0x3d')],_0x5153fe[_0xfcd9('0x39')]);_0x11cacc[_0xfcd9('0x3e')]=_[_0xfcd9('0x3c')](_0x5153fe['model'],qs[_0xfcd9('0x3f')](_0x2e73f3[_0xfcd9('0x39')]['fields']));_0x11cacc[_0xfcd9('0x3e')]=_0x11cacc[_0xfcd9('0x3e')][_0xfcd9('0x40')]?_0x11cacc[_0xfcd9('0x3e')]:_0x5153fe['model'];if(!_0x2e73f3[_0xfcd9('0x39')]['hasOwnProperty']('nolimit')){_0x11cacc[_0xfcd9('0x29')]=qs[_0xfcd9('0x29')](_0x2e73f3[_0xfcd9('0x39')][_0xfcd9('0x29')]);_0x11cacc[_0xfcd9('0x27')]=qs[_0xfcd9('0x27')](_0x2e73f3['query'][_0xfcd9('0x27')]);}_0x11cacc['order']=qs[_0xfcd9('0x41')](_0x2e73f3[_0xfcd9('0x39')][_0xfcd9('0x41')]);_0x11cacc['where']=qs[_0xfcd9('0x3b')](_[_0xfcd9('0x42')](_0x2e73f3['query'],_0x5153fe['filters']),_0x189c98);if(_0x2e73f3[_0xfcd9('0x39')][_0xfcd9('0x43')]){_0x11cacc[_0xfcd9('0x44')]=_[_0xfcd9('0x45')](_0x11cacc[_0xfcd9('0x44')],{'$or':_[_0xfcd9('0x46')](_0x189c98,function(_0xfc57b5){if(_0xfc57b5[_0xfcd9('0x37')]!==_0xfcd9('0x47')){var _0x2f8852={};_0x2f8852[_0xfc57b5[_0xfcd9('0x32')]]={'$like':'%'+_0x2e73f3[_0xfcd9('0x39')]['filter']+'%'};return _0x2f8852;}})});}_0x11cacc=_[_0xfcd9('0x45')]({},_0x11cacc,_0x2e73f3[_0xfcd9('0x48')]);var _0x28adeb={'where':_0x11cacc[_0xfcd9('0x44')]};return db['FaxMessage']['count'](_0x28adeb)['then'](function(_0x4be9d9){_0x4745bd[_0xfcd9('0x2a')]=_0x4be9d9;if(_0x2e73f3[_0xfcd9('0x39')][_0xfcd9('0x49')]){_0x11cacc['include']=[{'all':!![]}];}return db[_0xfcd9('0x34')][_0xfcd9('0x4a')](_0x11cacc);})[_0xfcd9('0x1d')](function(_0x345e70){_0x4745bd[_0xfcd9('0x4b')]=_0x345e70;return _0x4745bd;})[_0xfcd9('0x1d')](respondWithFilteredResult(_0x330545,_0x11cacc))[_0xfcd9('0x4c')](handleError(_0x330545,null));};exports[_0xfcd9('0x4d')]=function(_0x12c530,_0x4fbdea){var _0x434074={'raw':!![],'where':{'id':_0x12c530[_0xfcd9('0x4e')]['id']}},_0x7cbf2a={};_0x7cbf2a[_0xfcd9('0x3d')]=_['keys'](db['FaxMessage'][_0xfcd9('0x35')]);_0x7cbf2a[_0xfcd9('0x39')]=_[_0xfcd9('0x3a')](_0x12c530[_0xfcd9('0x39')]);_0x7cbf2a[_0xfcd9('0x3b')]=_[_0xfcd9('0x3c')](_0x7cbf2a[_0xfcd9('0x3d')],_0x7cbf2a[_0xfcd9('0x39')]);_0x434074['attributes']=_[_0xfcd9('0x3c')](_0x7cbf2a[_0xfcd9('0x3d')],qs['fields'](_0x12c530[_0xfcd9('0x39')]['fields']));_0x434074[_0xfcd9('0x3e')]=_0x434074['attributes'][_0xfcd9('0x40')]?_0x434074[_0xfcd9('0x3e')]:_0x7cbf2a[_0xfcd9('0x3d')];if(_0x12c530[_0xfcd9('0x39')][_0xfcd9('0x49')]){_0x434074[_0xfcd9('0x4f')]=[{'all':!![]}];}_0x434074=_['merge']({},_0x434074,_0x12c530[_0xfcd9('0x48')]);return db['FaxMessage'][_0xfcd9('0x50')](_0x434074)[_0xfcd9('0x1d')](handleEntityNotFound(_0x4fbdea,null))[_0xfcd9('0x1d')](respondWithResult(_0x4fbdea,null))[_0xfcd9('0x4c')](handleError(_0x4fbdea,null));};exports['update']=function(_0x40c434,_0x5476c5){if(_0x40c434[_0xfcd9('0x51')]['id']){delete _0x40c434[_0xfcd9('0x51')]['id'];}return db[_0xfcd9('0x34')][_0xfcd9('0x50')]({'where':{'id':_0x40c434[_0xfcd9('0x4e')]['id']}})[_0xfcd9('0x1d')](handleEntityNotFound(_0x5476c5,null))[_0xfcd9('0x1d')](saveUpdates(_0x40c434[_0xfcd9('0x51')],null))[_0xfcd9('0x1d')](respondWithResult(_0x5476c5,null))['catch'](handleError(_0x5476c5,null));};exports[_0xfcd9('0x2f')]=function(_0x4093df,_0x237ce7){return db[_0xfcd9('0x34')][_0xfcd9('0x50')]({'where':{'id':_0x4093df[_0xfcd9('0x4e')]['id']}})[_0xfcd9('0x1d')](handleEntityNotFound(_0x237ce7,null))[_0xfcd9('0x1d')](removeEntity(_0x237ce7,null))[_0xfcd9('0x4c')](handleError(_0x237ce7,null));};exports[_0xfcd9('0x52')]=function(_0x53e2f7,_0x37011c){return db[_0xfcd9('0x34')][_0xfcd9('0x52')]()[_0xfcd9('0x1d')](respondWithResult(_0x37011c,null))[_0xfcd9('0x4c')](handleError(_0x37011c,null));};var interaction_log=require('../../config/logger')(_0xfcd9('0x53'));exports['accept']=function(_0x413ac2,_0x767853,_0x1634eb){var _0x28f48c={'agent':{},'channel':_0xfcd9('0x54')};if(_0x413ac2[_0xfcd9('0x51')]['id']){delete _0x413ac2[_0xfcd9('0x51')]['id'];}_0x413ac2['body'][_0xfcd9('0x55')]=!![];_0x413ac2[_0xfcd9('0x51')][_0xfcd9('0x56')]=moment()[_0xfcd9('0x57')](_0xfcd9('0x58'));_0x413ac2['body'][_0xfcd9('0x59')]=_0x413ac2['body'][_0xfcd9('0x59')]||_0x413ac2['user']['id'];_0x28f48c[_0xfcd9('0x5a')]['id']=_0x413ac2[_0xfcd9('0x51')]['UserId'];return db[_0xfcd9('0x34')][_0xfcd9('0x50')]({'where':{'id':_0x413ac2['params']['id'],'UserId':null}})[_0xfcd9('0x1d')](handleEntityNotFound(_0x767853,null))[_0xfcd9('0x1d')](saveUpdates(_0x413ac2[_0xfcd9('0x51')],null))[_0xfcd9('0x1d')](function(_0x36f41f){if(_0x36f41f){_0x28f48c['message']=_0x36f41f[_0xfcd9('0x5b')]({'plain':!![]});return db[_0xfcd9('0x5c')][_0xfcd9('0x50')]({'where':{'id':_0x36f41f[_0xfcd9('0x5d')]}});}return null;})[_0xfcd9('0x1d')](handleEntityNotFound(_0x767853,null))[_0xfcd9('0x1d')](function(_0x1150c6){if(_0x1150c6){return _0x1150c6[_0xfcd9('0x2e')]({'UserId':_0x413ac2[_0xfcd9('0x51')][_0xfcd9('0x59')],'read1stAt':_[_0xfcd9('0x5e')](_0x1150c6[_0xfcd9('0x5f')])?moment()[_0xfcd9('0x57')](_0xfcd9('0x58')):undefined});}return null;})[_0xfcd9('0x1d')](function(_0x5cd3e9){if(_0x5cd3e9){_0x28f48c[_0xfcd9('0x60')]=_0x5cd3e9[_0xfcd9('0x5b')]({'plain':!![]});interaction_log[_0xfcd9('0x1e')](_0xfcd9('0x61'),_0x413ac2['user']['id'],_0x413ac2[_0xfcd9('0x62')][_0xfcd9('0x32')],_0x413ac2[_0xfcd9('0x62')][_0xfcd9('0x63')],_0x28f48c['interaction']['id'],_0x413ac2['body']?JSON[_0xfcd9('0x21')](_0x413ac2['body']):'null');return respondWithRpcPromise(_0xfcd9('0x64'),'acceptMessage',_0x28f48c);}return null;})[_0xfcd9('0x1d')](function(_0x1993a2){var _0x49d503=_0xfcd9('0x65')+_0x1993a2[_0xfcd9('0x23')][_0xfcd9('0x66')];return db['sequelize'][_0xfcd9('0x39')](_0x49d503,{'type':db[_0xfcd9('0x67')][_0xfcd9('0x68')][_0xfcd9('0x69')],'raw':!![]})[_0xfcd9('0x1d')](function(_0x4f64d1){return _0x4f64d1;});})[_0xfcd9('0x1d')](function(_0x1dee0a){if(_0x1dee0a){_0x28f48c['message']['contact']=_0x1dee0a[0x0];if(!_0x413ac2['body']['UserId'])return;return db[_0xfcd9('0x6a')][_0xfcd9('0x50')]({'where':{'id':_0x413ac2['body']['UserId'],'role':_0xfcd9('0x5a')},'attributes':['id',_0xfcd9('0x32'),'fullname',_0xfcd9('0x6b'),_0xfcd9('0x6c')],'raw':!![]});}return null;})['then'](function(_0x511226){if(!_0x511226)return null;_0x28f48c[_0xfcd9('0x23')]['agent']=_0x511226;return _0x28f48c;})[_0xfcd9('0x1d')](function(_0x20353b){if(_0x20353b){if(_0x413ac2['body'][_0xfcd9('0x6d')]){_0x28f48c[_0xfcd9('0x23')][_0xfcd9('0x6e')]=util[_0xfcd9('0x57')](_0xfcd9('0x6f'),_0x413ac2[_0xfcd9('0x62')][_0xfcd9('0x32')]);_0x28f48c['message'][_0xfcd9('0x70')]=_0x28f48c[_0xfcd9('0x70')];_0x28f48c[_0xfcd9('0x23')][_0xfcd9('0x71')]=_0x28f48c['channel'];_0x28f48c[_0xfcd9('0x23')][_0xfcd9('0x72')]=_0xfcd9('0x73');return respondWithRpcPromise(_0xfcd9('0x74'),_0xfcd9('0x74'),{'event':_0xfcd9('0x75'),'message':_0x28f48c[_0xfcd9('0x23')]},client9002)[_0xfcd9('0x1d')](function(){return _0x28f48c;});}return _0x28f48c;}return null;})[_0xfcd9('0x1d')](respondWithResult(_0x767853,null))['catch'](handleError(_0x767853,null));};var interaction_log=require('../../config/logger')(_0xfcd9('0x53'));exports[_0xfcd9('0x2c')]=function(_0x3fc379,_0x473f0f,_0x1e1958){var _0xa5c47a={'agent':{},'channel':'fax'};if(_0x3fc379[_0xfcd9('0x51')]['id']){delete _0x3fc379[_0xfcd9('0x51')]['id'];}_0x3fc379[_0xfcd9('0x51')][_0xfcd9('0x59')]=_0x3fc379[_0xfcd9('0x51')][_0xfcd9('0x59')]||_0x3fc379['user']['id'];_0xa5c47a[_0xfcd9('0x5a')]['id']=_0x3fc379[_0xfcd9('0x51')]['UserId'];return db[_0xfcd9('0x34')][_0xfcd9('0x50')]({'where':{'id':_0x3fc379[_0xfcd9('0x4e')]['id'],'UserId':null}})[_0xfcd9('0x1d')](handleEntityNotFound(_0x473f0f,null))[_0xfcd9('0x1d')](function(_0x160cab){if(_0x160cab){_0xa5c47a[_0xfcd9('0x23')]=_0x160cab[_0xfcd9('0x5b')]({'plain':!![]});return db[_0xfcd9('0x5c')][_0xfcd9('0x50')]({'where':{'id':_0x160cab['FaxInteractionId']}});}return null;})[_0xfcd9('0x1d')](handleEntityNotFound(_0x473f0f,null))[_0xfcd9('0x1d')](function(_0x21e50f){if(_0x21e50f){_0xa5c47a[_0xfcd9('0x60')]=_0x21e50f[_0xfcd9('0x5b')]({'plain':!![]});interaction_log[_0xfcd9('0x1e')](_0xfcd9('0x76'),_0x3fc379[_0xfcd9('0x62')]['id'],_0x3fc379['user'][_0xfcd9('0x32')],_0x3fc379[_0xfcd9('0x62')][_0xfcd9('0x63')],_0xa5c47a[_0xfcd9('0x60')]['id'],_0x3fc379[_0xfcd9('0x51')]?JSON[_0xfcd9('0x21')](_0x3fc379[_0xfcd9('0x51')]):_0xfcd9('0x77'));return respondWithRpcPromise(_0xfcd9('0x78'),'rejectMessage',_0xa5c47a);}return null;})[_0xfcd9('0x1d')](function(_0x5583c){var _0x56d8ef=_0xfcd9('0x65')+_0x5583c[_0xfcd9('0x23')][_0xfcd9('0x66')];return db[_0xfcd9('0x79')][_0xfcd9('0x39')](_0x56d8ef,{'type':db[_0xfcd9('0x67')][_0xfcd9('0x68')][_0xfcd9('0x69')],'raw':!![]})['then'](function(_0xe9bcb3){return _0xe9bcb3;});})[_0xfcd9('0x1d')](function(_0x584db2){if(_0x584db2){_0xa5c47a[_0xfcd9('0x23')][_0xfcd9('0x7a')]=_0x584db2[0x0];if(!_0x3fc379[_0xfcd9('0x51')][_0xfcd9('0x59')])return;return db[_0xfcd9('0x6a')][_0xfcd9('0x50')]({'where':{'id':_0x3fc379[_0xfcd9('0x51')]['UserId'],'role':_0xfcd9('0x5a')},'attributes':['id','name','fullname','email',_0xfcd9('0x6c')],'raw':!![]});}return null;})['then'](function(_0xf9257f){if(!_0xf9257f)return null;_0xa5c47a[_0xfcd9('0x23')][_0xfcd9('0x5a')]=_0xf9257f;return _0xa5c47a;})[_0xfcd9('0x1d')](function(_0x4466b1){if(_0x4466b1){_0x4466b1[_0xfcd9('0x23')][_0xfcd9('0x6e')]=util['format'](_0xfcd9('0x6f'),_0x3fc379[_0xfcd9('0x62')][_0xfcd9('0x32')]);_0x4466b1[_0xfcd9('0x23')][_0xfcd9('0x70')]=_0xa5c47a['channel'];_0x4466b1['message'][_0xfcd9('0x71')]=_0xa5c47a[_0xfcd9('0x70')];_0x4466b1[_0xfcd9('0x23')][_0xfcd9('0x72')]=_0xfcd9('0x2c');respondWithRpcPromise(_0xfcd9('0x74'),_0xfcd9('0x74'),{'event':_0xfcd9('0x7b'),'message':_0x4466b1[_0xfcd9('0x23')]},client9002);return _0xa5c47a;}return null;})[_0xfcd9('0x1d')](respondWithResult(_0x473f0f,null))[_0xfcd9('0x4c')](handleError(_0x473f0f,null));};exports[_0xfcd9('0x7c')]=function(_0x25ddc5,_0x417e34){var _0x468bf0;return db[_0xfcd9('0x34')][_0xfcd9('0x7c')](_0x25ddc5['body'],{})[_0xfcd9('0x1d')](function(_0x24edce){_0x468bf0=_0x24edce;return db[_0xfcd9('0x7d')]['findOne']({'where':{'id':_0x468bf0[_0xfcd9('0x66')]}});})[_0xfcd9('0x1d')](function(_0xfff894){if(_[_0xfcd9('0x5e')](_0xfff894)){return;}else{_0x468bf0[_0xfcd9('0x54')]=_0xfff894['fax'];return db['Attachment'][_0xfcd9('0x7e')]({'where':{'id':_0x468bf0[_0xfcd9('0x7f')]}});}})[_0xfcd9('0x1d')](function(_0x56c006){return respondWithRpcPromise(_0xfcd9('0x80'),'SendFax',{'FaxAccountId':_['isNil'](_0x25ddc5[_0xfcd9('0x51')])?undefined:_0x25ddc5[_0xfcd9('0x51')][_0xfcd9('0x81')],'path':_[_0xfcd9('0x5e')](_0x56c006)?undefined:util[_0xfcd9('0x57')](_0xfcd9('0x82'),_0x56c006[_0xfcd9('0x83')]),'fax':_['isNil'](_0x468bf0[_0xfcd9('0x54')])?undefined:_0x468bf0[_0xfcd9('0x54')],'AttachmentId':_0x468bf0[_0xfcd9('0x7f')]},client9002);})[_0xfcd9('0x1d')](respondWithResult(_0x417e34,0xc9))[_0xfcd9('0x4c')](handleError(_0x417e34,null));};exports[_0xfcd9('0x84')]=function(_0x51ff50,_0x119801){var _0x583d91=path[_0xfcd9('0x85')](config[_0xfcd9('0x86')],_0xfcd9('0x87'),'files',_0xfcd9('0x88'));return db[_0xfcd9('0x34')][_0xfcd9('0x50')]({'where':{'id':_0x51ff50[_0xfcd9('0x4e')]['id']},'include':[{'model':db[_0xfcd9('0x89')],'as':'Attachment'}]})['then'](handleEntityNotFound(_0x119801,null))[_0xfcd9('0x1d')](function(_0x2beac8){if(_0x2beac8){return _0x119801['download'](path[_0xfcd9('0x85')](_0x583d91,_0x2beac8[_0xfcd9('0x89')][_0xfcd9('0x83')]));}})[_0xfcd9('0x4c')](handleError(_0x119801,null));}; \ No newline at end of file +var _0x5d46=['accept','EventManager','acceptmessage','fax','get','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','ContactId','QueryTypes','motionChannel','rejectmessage','create','CmContact','findOne','Attachment','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','download','root','server','files','attachments','join','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','fs-extra','lodash','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','register','jayson/promise','client','http','request','then','debug','stringify','error','code','FaxMessage,\x20%s,\x20%s','message','info','request\x20sent','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','stack','name','index','FaxMessage','key','map','query','filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','params','keys','body','find','describe','fax-interactions','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','FaxInteraction','FaxInteractionId','isNil','read1stAt','interaction','user','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','SELECT','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','event'];(function(_0x3b8de3,_0x363e34){var _0x4ac1f4=function(_0x411eb7){while(--_0x411eb7){_0x3b8de3['push'](_0x3b8de3['shift']());}};_0x4ac1f4(++_0x363e34);}(_0x5d46,0x148));var _0x65d4=function(_0x428a37,_0x5ce5ee){_0x428a37=_0x428a37-0x0;var _0x5399bd=_0x5d46[_0x428a37];return _0x5399bd;};'use strict';var emlformat=require(_0x65d4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x65d4('0x1'));var jsonpatch=require(_0x65d4('0x2'));var rp=require(_0x65d4('0x3'));var moment=require(_0x65d4('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x65d4('0x5'));var util=require(_0x65d4('0x6'));var path=require(_0x65d4('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x65d4('0x8'));var fs=require('fs');var fs_extra=require(_0x65d4('0x9'));var _=require(_0x65d4('0xa'));var squel=require(_0x65d4('0xb'));var crypto=require('crypto');var jsforce=require(_0x65d4('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x65d4('0xd'));var querystring=require(_0x65d4('0xe'));var Papa=require(_0x65d4('0xf'));var Redis=require(_0x65d4('0x10'));var authService=require(_0x65d4('0x11'));var qs=require(_0x65d4('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x65d4('0x13'));var logger=require(_0x65d4('0x14'))(_0x65d4('0x15'));var utils=require(_0x65d4('0x16'));var config=require(_0x65d4('0x17'));var licenseUtil=require(_0x65d4('0x18'));var db=require(_0x65d4('0x19'))['db'];config[_0x65d4('0x1a')]=_[_0x65d4('0x1b')](config[_0x65d4('0x1a')],{'host':_0x65d4('0x1c'),'port':0x18eb});var socket=require(_0x65d4('0x1d'))(new Redis(config[_0x65d4('0x1a')]));require(_0x65d4('0x1e'))[_0x65d4('0x1f')](socket);var jayson=require(_0x65d4('0x20'));var client=jayson[_0x65d4('0x21')][_0x65d4('0x22')]({'port':0x232c});var client9002=jayson[_0x65d4('0x21')][_0x65d4('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x406ce2,_0x325047,_0x1f8fed,_0x276a72){return new BPromise(function(_0x2264bf,_0xd3a69a){var _0x6a7871=_0x276a72||client;return _0x6a7871[_0x65d4('0x23')](_0x406ce2,_0x1f8fed)[_0x65d4('0x24')](function(_0x2aba09){logger['info']('FaxMessage,\x20%s,\x20%s',_0x325047,'request\x20sent');logger[_0x65d4('0x25')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x325047,'request\x20sent',JSON[_0x65d4('0x26')](_0x2aba09));if(_0x2aba09[_0x65d4('0x27')]){if(_0x2aba09[_0x65d4('0x27')][_0x65d4('0x28')]===0x1f4){logger[_0x65d4('0x27')](_0x65d4('0x29'),_0x325047,_0x2aba09[_0x65d4('0x27')][_0x65d4('0x2a')]);return _0xd3a69a(_0x2aba09['error'][_0x65d4('0x2a')]);}logger['error']('FaxMessage,\x20%s,\x20%s',_0x325047,_0x2aba09[_0x65d4('0x27')][_0x65d4('0x2a')]);return _0x2264bf(_0x2aba09[_0x65d4('0x27')][_0x65d4('0x2a')]);}else{logger[_0x65d4('0x2b')](_0x65d4('0x29'),_0x325047,_0x65d4('0x2c'));_0x2264bf(_0x2aba09[_0x65d4('0x2d')]['message']);}})[_0x65d4('0x2e')](function(_0x46998a){logger[_0x65d4('0x27')](_0x65d4('0x29'),_0x325047,_0x46998a);_0xd3a69a(_0x46998a);});});}function respondWithStatusCode(_0xb0dac4,_0x343ee5){_0x343ee5=_0x343ee5||0xcc;return function(_0x203c5e){if(_0x203c5e){return _0xb0dac4[_0x65d4('0x2f')](_0x343ee5);}return _0xb0dac4[_0x65d4('0x30')](_0x343ee5)[_0x65d4('0x31')]();};}function respondWithResult(_0x24641a,_0x308bcf){_0x308bcf=_0x308bcf||0xc8;return function(_0x430e47){if(_0x430e47){return _0x24641a[_0x65d4('0x30')](_0x308bcf)[_0x65d4('0x32')](_0x430e47);}};}function respondWithFilteredResult(_0x352df0,_0x506a2b){return function(_0x171332){if(_0x171332){var _0x1d66a2=typeof _0x506a2b[_0x65d4('0x33')]===_0x65d4('0x34')&&typeof _0x506a2b[_0x65d4('0x35')]===_0x65d4('0x34');var _0x2b63df=_0x171332[_0x65d4('0x36')];var _0xb8f0d4=_0x1d66a2?0x0:_0x506a2b[_0x65d4('0x33')];var _0xc4c149=_0x1d66a2?_0x171332[_0x65d4('0x36')]:_0x506a2b[_0x65d4('0x33')]+_0x506a2b[_0x65d4('0x35')];var _0x2d81b6;if(_0xc4c149>=_0x2b63df){_0xc4c149=_0x2b63df;_0x2d81b6=0xc8;}else{_0x2d81b6=0xce;}_0x352df0[_0x65d4('0x30')](_0x2d81b6);return _0x352df0['set'](_0x65d4('0x37'),_0xb8f0d4+'-'+_0xc4c149+'/'+_0x2b63df)[_0x65d4('0x32')](_0x171332);}return null;};}function patchUpdates(_0x4e0364){return function(_0x101345){try{jsonpatch[_0x65d4('0x38')](_0x101345,_0x4e0364,!![]);}catch(_0x5b90ba){return BPromise[_0x65d4('0x39')](_0x5b90ba);}return _0x101345[_0x65d4('0x3a')]();};}function saveUpdates(_0x2ca592,_0x4792d6){return function(_0x5d05ae){if(_0x5d05ae){return _0x5d05ae[_0x65d4('0x3b')](_0x2ca592)[_0x65d4('0x24')](function(_0x4a6901){return _0x4a6901;});}return null;};}function removeEntity(_0x4b586a,_0x8cb3db){return function(_0x4cc791){if(_0x4cc791){return _0x4cc791[_0x65d4('0x3c')]()[_0x65d4('0x24')](function(){_0x4b586a[_0x65d4('0x30')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d278d,_0x2114dd){return function(_0x346b1a){if(!_0x346b1a){_0x5d278d[_0x65d4('0x2f')](0x194);}return _0x346b1a;};}function handleError(_0x3449d0,_0x3bc5aa){_0x3bc5aa=_0x3bc5aa||0x1f4;return function(_0x294bbd){logger['error'](_0x294bbd[_0x65d4('0x3d')]);if(_0x294bbd[_0x65d4('0x3e')]){delete _0x294bbd['name'];}_0x3449d0['status'](_0x3bc5aa)['send'](_0x294bbd);};}exports[_0x65d4('0x3f')]=function(_0x496409,_0x3df655){var _0x40e336={},_0x10a124={},_0x2d0d4e={'count':0x0,'rows':[]};var _0x1593d2=_['map'](db[_0x65d4('0x40')]['rawAttributes'],function(_0x21dc34){return{'name':_0x21dc34['fieldName'],'type':_0x21dc34['type'][_0x65d4('0x41')]};});_0x10a124['model']=_[_0x65d4('0x42')](_0x1593d2,_0x65d4('0x3e'));_0x10a124[_0x65d4('0x43')]=_['keys'](_0x496409[_0x65d4('0x43')]);_0x10a124[_0x65d4('0x44')]=_[_0x65d4('0x45')](_0x10a124['model'],_0x10a124[_0x65d4('0x43')]);_0x40e336['attributes']=_[_0x65d4('0x45')](_0x10a124[_0x65d4('0x46')],qs[_0x65d4('0x47')](_0x496409[_0x65d4('0x43')][_0x65d4('0x47')]));_0x40e336['attributes']=_0x40e336[_0x65d4('0x48')][_0x65d4('0x49')]?_0x40e336[_0x65d4('0x48')]:_0x10a124['model'];if(!_0x496409[_0x65d4('0x43')]['hasOwnProperty'](_0x65d4('0x4a'))){_0x40e336[_0x65d4('0x35')]=qs[_0x65d4('0x35')](_0x496409[_0x65d4('0x43')]['limit']);_0x40e336['offset']=qs[_0x65d4('0x33')](_0x496409[_0x65d4('0x43')]['offset']);}_0x40e336[_0x65d4('0x4b')]=qs[_0x65d4('0x4c')](_0x496409[_0x65d4('0x43')][_0x65d4('0x4c')]);_0x40e336[_0x65d4('0x4d')]=qs[_0x65d4('0x44')](_['pick'](_0x496409[_0x65d4('0x43')],_0x10a124[_0x65d4('0x44')]),_0x1593d2);if(_0x496409['query']['filter']){_0x40e336['where']=_[_0x65d4('0x4e')](_0x40e336[_0x65d4('0x4d')],{'$or':_[_0x65d4('0x42')](_0x1593d2,function(_0x180049){if(_0x180049[_0x65d4('0x4f')]!==_0x65d4('0x50')){var _0xea10dc={};_0xea10dc[_0x180049[_0x65d4('0x3e')]]={'$like':'%'+_0x496409[_0x65d4('0x43')][_0x65d4('0x51')]+'%'};return _0xea10dc;}})});}_0x40e336=_['merge']({},_0x40e336,_0x496409[_0x65d4('0x52')]);var _0x147124={'where':_0x40e336[_0x65d4('0x4d')]};return db['FaxMessage'][_0x65d4('0x36')](_0x147124)[_0x65d4('0x24')](function(_0x925e2f){_0x2d0d4e[_0x65d4('0x36')]=_0x925e2f;if(_0x496409['query'][_0x65d4('0x53')]){_0x40e336[_0x65d4('0x54')]=[{'all':!![]}];}return db['FaxMessage'][_0x65d4('0x55')](_0x40e336);})[_0x65d4('0x24')](function(_0x583d43){_0x2d0d4e[_0x65d4('0x56')]=_0x583d43;return _0x2d0d4e;})[_0x65d4('0x24')](respondWithFilteredResult(_0x3df655,_0x40e336))[_0x65d4('0x2e')](handleError(_0x3df655,null));};exports['show']=function(_0x2e069f,_0x2a6a4b){var _0x39a66b={'raw':!![],'where':{'id':_0x2e069f[_0x65d4('0x57')]['id']}},_0x45726b={};_0x45726b[_0x65d4('0x46')]=_[_0x65d4('0x58')](db[_0x65d4('0x40')]['rawAttributes']);_0x45726b[_0x65d4('0x43')]=_[_0x65d4('0x58')](_0x2e069f[_0x65d4('0x43')]);_0x45726b[_0x65d4('0x44')]=_[_0x65d4('0x45')](_0x45726b['model'],_0x45726b[_0x65d4('0x43')]);_0x39a66b[_0x65d4('0x48')]=_['intersection'](_0x45726b['model'],qs[_0x65d4('0x47')](_0x2e069f[_0x65d4('0x43')][_0x65d4('0x47')]));_0x39a66b[_0x65d4('0x48')]=_0x39a66b[_0x65d4('0x48')][_0x65d4('0x49')]?_0x39a66b[_0x65d4('0x48')]:_0x45726b['model'];if(_0x2e069f[_0x65d4('0x43')][_0x65d4('0x53')]){_0x39a66b[_0x65d4('0x54')]=[{'all':!![]}];}_0x39a66b=_['merge']({},_0x39a66b,_0x2e069f[_0x65d4('0x52')]);return db[_0x65d4('0x40')]['find'](_0x39a66b)[_0x65d4('0x24')](handleEntityNotFound(_0x2a6a4b,null))['then'](respondWithResult(_0x2a6a4b,null))[_0x65d4('0x2e')](handleError(_0x2a6a4b,null));};exports['update']=function(_0x5efe18,_0x4e574c){if(_0x5efe18['body']['id']){delete _0x5efe18[_0x65d4('0x59')]['id'];}return db[_0x65d4('0x40')]['find']({'where':{'id':_0x5efe18[_0x65d4('0x57')]['id']}})[_0x65d4('0x24')](handleEntityNotFound(_0x4e574c,null))[_0x65d4('0x24')](saveUpdates(_0x5efe18['body'],null))[_0x65d4('0x24')](respondWithResult(_0x4e574c,null))[_0x65d4('0x2e')](handleError(_0x4e574c,null));};exports[_0x65d4('0x3c')]=function(_0xe69af7,_0x133c13){return db['FaxMessage'][_0x65d4('0x5a')]({'where':{'id':_0xe69af7[_0x65d4('0x57')]['id']}})[_0x65d4('0x24')](handleEntityNotFound(_0x133c13,null))[_0x65d4('0x24')](removeEntity(_0x133c13,null))[_0x65d4('0x2e')](handleError(_0x133c13,null));};exports[_0x65d4('0x5b')]=function(_0x39f0f3,_0x3b1621){return db[_0x65d4('0x40')][_0x65d4('0x5b')]()[_0x65d4('0x24')](respondWithResult(_0x3b1621,null))[_0x65d4('0x2e')](handleError(_0x3b1621,null));};var interaction_log=require('../../config/logger')(_0x65d4('0x5c'));exports['accept']=function(_0x377468,_0x43faed,_0x5bf27e){var _0x102767={'agent':{},'channel':'fax'};if(_0x377468[_0x65d4('0x59')]['id']){delete _0x377468[_0x65d4('0x59')]['id'];}_0x377468[_0x65d4('0x59')][_0x65d4('0x5d')]=!![];_0x377468[_0x65d4('0x59')][_0x65d4('0x5e')]=moment()[_0x65d4('0x5f')](_0x65d4('0x60'));_0x377468[_0x65d4('0x59')][_0x65d4('0x61')]=_0x377468[_0x65d4('0x59')]['UserId']||_0x377468['user']['id'];_0x102767[_0x65d4('0x62')]['id']=_0x377468[_0x65d4('0x59')][_0x65d4('0x61')];return db[_0x65d4('0x40')][_0x65d4('0x5a')]({'where':{'id':_0x377468[_0x65d4('0x57')]['id'],'UserId':null}})[_0x65d4('0x24')](handleEntityNotFound(_0x43faed,null))[_0x65d4('0x24')](saveUpdates(_0x377468[_0x65d4('0x59')],null))[_0x65d4('0x24')](function(_0x142b11){if(_0x142b11){_0x102767['message']=_0x142b11['get']({'plain':!![]});return db[_0x65d4('0x63')][_0x65d4('0x5a')]({'where':{'id':_0x142b11[_0x65d4('0x64')]}});}return null;})[_0x65d4('0x24')](handleEntityNotFound(_0x43faed,null))[_0x65d4('0x24')](function(_0x4761e9){if(_0x4761e9){return _0x4761e9[_0x65d4('0x3b')]({'UserId':_0x377468[_0x65d4('0x59')][_0x65d4('0x61')],'read1stAt':_[_0x65d4('0x65')](_0x4761e9[_0x65d4('0x66')])?moment()[_0x65d4('0x5f')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x3c0f49){if(_0x3c0f49){_0x102767[_0x65d4('0x67')]=_0x3c0f49['get']({'plain':!![]});interaction_log[_0x65d4('0x2b')]('[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x377468[_0x65d4('0x68')]['id'],_0x377468['user'][_0x65d4('0x3e')],_0x377468[_0x65d4('0x68')]['role'],_0x102767[_0x65d4('0x67')]['id'],_0x377468[_0x65d4('0x59')]?JSON[_0x65d4('0x26')](_0x377468[_0x65d4('0x59')]):_0x65d4('0x69'));return respondWithRpcPromise(_0x65d4('0x6a'),_0x65d4('0x6b'),_0x102767);}return null;})['then'](function(_0x502cd0){var _0x6a585f=_0x65d4('0x6c')+_0x502cd0[_0x65d4('0x2a')]['ContactId'];return db[_0x65d4('0x6d')]['query'](_0x6a585f,{'type':db[_0x65d4('0x6e')]['QueryTypes'][_0x65d4('0x6f')],'raw':!![]})[_0x65d4('0x24')](function(_0xbed23f){return _0xbed23f;});})[_0x65d4('0x24')](function(_0x5a95a6){if(_0x5a95a6){_0x102767[_0x65d4('0x2a')][_0x65d4('0x70')]=_0x5a95a6[0x0];if(!_0x377468[_0x65d4('0x59')][_0x65d4('0x61')])return;return db[_0x65d4('0x71')][_0x65d4('0x5a')]({'where':{'id':_0x377468[_0x65d4('0x59')][_0x65d4('0x61')],'role':_0x65d4('0x62')},'attributes':['id',_0x65d4('0x3e'),_0x65d4('0x72'),_0x65d4('0x73'),_0x65d4('0x74')],'raw':!![]});}return null;})[_0x65d4('0x24')](function(_0x3afa1a){if(!_0x3afa1a)return null;_0x102767[_0x65d4('0x2a')]['agent']=_0x3afa1a;return _0x102767;})[_0x65d4('0x24')](function(_0x237701){if(_0x237701){if(_0x377468[_0x65d4('0x59')][_0x65d4('0x75')]){_0x102767[_0x65d4('0x2a')][_0x65d4('0x76')]=util[_0x65d4('0x5f')](_0x65d4('0x77'),_0x377468[_0x65d4('0x68')][_0x65d4('0x3e')]);_0x102767[_0x65d4('0x2a')][_0x65d4('0x78')]=_0x102767[_0x65d4('0x78')];_0x102767[_0x65d4('0x2a')]['motionChannel']=_0x102767[_0x65d4('0x78')];_0x102767['message'][_0x65d4('0x79')]=_0x65d4('0x7a');return respondWithRpcPromise(_0x65d4('0x7b'),'EventManager',{'event':_0x65d4('0x7c'),'message':_0x102767[_0x65d4('0x2a')]},client9002)[_0x65d4('0x24')](function(){return _0x102767;});}return _0x102767;}return null;})[_0x65d4('0x24')](respondWithResult(_0x43faed,null))[_0x65d4('0x2e')](handleError(_0x43faed,null));};var interaction_log=require(_0x65d4('0x14'))(_0x65d4('0x5c'));exports[_0x65d4('0x39')]=function(_0x3d01e6,_0x31b592,_0x214cc4){var _0x560d16={'agent':{},'channel':_0x65d4('0x7d')};if(_0x3d01e6[_0x65d4('0x59')]['id']){delete _0x3d01e6[_0x65d4('0x59')]['id'];}_0x3d01e6[_0x65d4('0x59')][_0x65d4('0x61')]=_0x3d01e6[_0x65d4('0x59')][_0x65d4('0x61')]||_0x3d01e6[_0x65d4('0x68')]['id'];_0x560d16[_0x65d4('0x62')]['id']=_0x3d01e6[_0x65d4('0x59')]['UserId'];return db[_0x65d4('0x40')][_0x65d4('0x5a')]({'where':{'id':_0x3d01e6[_0x65d4('0x57')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x31b592,null))[_0x65d4('0x24')](function(_0x4e6551){if(_0x4e6551){_0x560d16[_0x65d4('0x2a')]=_0x4e6551[_0x65d4('0x7e')]({'plain':!![]});return db[_0x65d4('0x63')][_0x65d4('0x5a')]({'where':{'id':_0x4e6551[_0x65d4('0x64')]}});}return null;})['then'](handleEntityNotFound(_0x31b592,null))[_0x65d4('0x24')](function(_0xf99b83){if(_0xf99b83){_0x560d16[_0x65d4('0x67')]=_0xf99b83[_0x65d4('0x7e')]({'plain':!![]});interaction_log[_0x65d4('0x2b')](_0x65d4('0x7f'),_0x3d01e6[_0x65d4('0x68')]['id'],_0x3d01e6[_0x65d4('0x68')][_0x65d4('0x3e')],_0x3d01e6[_0x65d4('0x68')][_0x65d4('0x80')],_0x560d16['interaction']['id'],_0x3d01e6[_0x65d4('0x59')]?JSON[_0x65d4('0x26')](_0x3d01e6[_0x65d4('0x59')]):_0x65d4('0x69'));return respondWithRpcPromise(_0x65d4('0x81'),_0x65d4('0x82'),_0x560d16);}return null;})['then'](function(_0x3ba7c9){var _0x2f2eca='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x3ba7c9['message'][_0x65d4('0x83')];return db[_0x65d4('0x6d')][_0x65d4('0x43')](_0x2f2eca,{'type':db[_0x65d4('0x6e')][_0x65d4('0x84')]['SELECT'],'raw':!![]})['then'](function(_0x5a0372){return _0x5a0372;});})['then'](function(_0x451ecc){if(_0x451ecc){_0x560d16['message']['contact']=_0x451ecc[0x0];if(!_0x3d01e6[_0x65d4('0x59')]['UserId'])return;return db['User'][_0x65d4('0x5a')]({'where':{'id':_0x3d01e6[_0x65d4('0x59')][_0x65d4('0x61')],'role':'agent'},'attributes':['id',_0x65d4('0x3e'),_0x65d4('0x72'),_0x65d4('0x73'),'internal'],'raw':!![]});}return null;})[_0x65d4('0x24')](function(_0x3413e6){if(!_0x3413e6)return null;_0x560d16[_0x65d4('0x2a')]['agent']=_0x3413e6;return _0x560d16;})[_0x65d4('0x24')](function(_0xab88b7){if(_0xab88b7){_0xab88b7[_0x65d4('0x2a')][_0x65d4('0x76')]=util[_0x65d4('0x5f')]('SIP/%s',_0x3d01e6[_0x65d4('0x68')][_0x65d4('0x3e')]);_0xab88b7[_0x65d4('0x2a')][_0x65d4('0x78')]=_0x560d16[_0x65d4('0x78')];_0xab88b7[_0x65d4('0x2a')][_0x65d4('0x85')]=_0x560d16[_0x65d4('0x78')];_0xab88b7[_0x65d4('0x2a')][_0x65d4('0x79')]=_0x65d4('0x39');respondWithRpcPromise(_0x65d4('0x7b'),'EventManager',{'event':_0x65d4('0x86'),'message':_0xab88b7[_0x65d4('0x2a')]},client9002);return _0x560d16;}return null;})[_0x65d4('0x24')](respondWithResult(_0x31b592,null))[_0x65d4('0x2e')](handleError(_0x31b592,null));};exports[_0x65d4('0x87')]=function(_0x2cf33a,_0x2e851c){var _0x392e5e;return db[_0x65d4('0x40')][_0x65d4('0x87')](_0x2cf33a['body'],{})[_0x65d4('0x24')](function(_0x3791c8){_0x392e5e=_0x3791c8;return db[_0x65d4('0x88')][_0x65d4('0x89')]({'where':{'id':_0x392e5e['ContactId']}});})['then'](function(_0x58a747){if(_['isNil'](_0x58a747)){return;}else{_0x392e5e[_0x65d4('0x7d')]=_0x58a747[_0x65d4('0x7d')];return db[_0x65d4('0x8a')][_0x65d4('0x89')]({'where':{'id':_0x392e5e[_0x65d4('0x8b')]}});}})[_0x65d4('0x24')](function(_0x40a4b2){return respondWithRpcPromise(_0x65d4('0x8c'),_0x65d4('0x8c'),{'FaxAccountId':_[_0x65d4('0x65')](_0x2cf33a[_0x65d4('0x59')])?undefined:_0x2cf33a[_0x65d4('0x59')][_0x65d4('0x8d')],'path':_['isNil'](_0x40a4b2)?undefined:util[_0x65d4('0x5f')](_0x65d4('0x8e'),_0x40a4b2[_0x65d4('0x8f')]),'fax':_[_0x65d4('0x65')](_0x392e5e['fax'])?undefined:_0x392e5e['fax'],'AttachmentId':_0x392e5e[_0x65d4('0x8b')]},client9002);})[_0x65d4('0x24')](respondWithResult(_0x2e851c,0xc9))[_0x65d4('0x2e')](handleError(_0x2e851c,null));};exports[_0x65d4('0x90')]=function(_0x34297b,_0xbae71d){var _0x1981df=path['join'](config[_0x65d4('0x91')],_0x65d4('0x92'),_0x65d4('0x93'),_0x65d4('0x94'));return db[_0x65d4('0x40')]['find']({'where':{'id':_0x34297b['params']['id']},'include':[{'model':db[_0x65d4('0x8a')],'as':_0x65d4('0x8a')}]})[_0x65d4('0x24')](handleEntityNotFound(_0xbae71d,null))[_0x65d4('0x24')](function(_0x510c65){if(_0x510c65){return _0xbae71d[_0x65d4('0x90')](path[_0x65d4('0x95')](_0x1981df,_0x510c65['Attachment']['basename']));}})[_0x65d4('0x2e')](handleError(_0xbae71d,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index f3c932a..401349f 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 _0xeda8=['../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xeda8,0x104));var _0x8eda=function(_0x96776d,_0x40902c){_0x96776d=_0x96776d-0x0;var _0x3e015b=_0xeda8[_0x96776d];return _0x3e015b;};'use strict';var EventEmitter=require(_0x8eda('0x0'));var FaxMessage=require(_0x8eda('0x1'))['db']['FaxMessage'];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x8eda('0x2')](0x0);var events={'afterCreate':_0x8eda('0x3'),'afterUpdate':_0x8eda('0x4'),'afterDestroy':_0x8eda('0x5')};function emitEvent(_0x37ab2c){return function(_0x94b83f,_0x25b19a,_0x3eb7b1){FaxMessageEvents[_0x8eda('0x6')](_0x37ab2c+':'+_0x94b83f['id'],_0x94b83f);FaxMessageEvents[_0x8eda('0x6')](_0x37ab2c,_0x94b83f);_0x3eb7b1(null);};}for(var e in events){if(events[_0x8eda('0x7')](e)){var event=events[e];FaxMessage[_0x8eda('0x8')](e,emitEvent(event));}}module['exports']=FaxMessageEvents; \ No newline at end of file +var _0x8ce1=['FaxMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x3c1d98,_0x5e8a76){var _0x462c73=function(_0x402ddc){while(--_0x402ddc){_0x3c1d98['push'](_0x3c1d98['shift']());}};_0x462c73(++_0x5e8a76);}(_0x8ce1,0x152));var _0x18ce=function(_0x7b55f9,_0x3006e5){_0x7b55f9=_0x7b55f9-0x0;var _0x22aec1=_0x8ce1[_0x7b55f9];return _0x22aec1;};'use strict';var EventEmitter=require(_0x18ce('0x0'));var FaxMessage=require(_0x18ce('0x1'))['db'][_0x18ce('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x18ce('0x3')](0x0);var events={'afterCreate':_0x18ce('0x4'),'afterUpdate':_0x18ce('0x5'),'afterDestroy':_0x18ce('0x6')};function emitEvent(_0x5e10bb){return function(_0x194532,_0xcffe1d,_0x37947f){FaxMessageEvents[_0x18ce('0x7')](_0x5e10bb+':'+_0x194532['id'],_0x194532);FaxMessageEvents['emit'](_0x5e10bb,_0x194532);_0x37947f(null);};}for(var e in events){if(events[_0x18ce('0x8')](e)){var event=events[e];FaxMessage[_0x18ce('0x9')](e,emitEvent(event));}}module['exports']=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index a251889..9dc6786 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 _0x4998=['createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./faxMessage.attributes','exports','define','FaxMessage','fti_fax_messages','body','FULLTEXT','get','direction','toLowerCase','UserId','FaxInteraction','findOne','update'];(function(_0x2751cd,_0x577ff2){var _0x1bd43a=function(_0x4ac90a){while(--_0x4ac90a){_0x2751cd['push'](_0x2751cd['shift']());}};_0x1bd43a(++_0x577ff2);}(_0x4998,0xe5));var _0x8499=function(_0x313c96,_0x3cee6e){_0x313c96=_0x313c96-0x0;var _0x522f53=_0x4998[_0x313c96];return _0x522f53;};'use strict';var _=require(_0x8499('0x0'));var util=require(_0x8499('0x1'));var logger=require(_0x8499('0x2'))(_0x8499('0x3'));var moment=require(_0x8499('0x4'));var BPromise=require(_0x8499('0x5'));var rp=require(_0x8499('0x6'));var fs=require('fs');var path=require(_0x8499('0x7'));var rimraf=require(_0x8499('0x8'));var config=require('../../config/environment');var attributes=require(_0x8499('0x9'));module[_0x8499('0xa')]=function(_0x4ca613,_0x59e2fa){return _0x4ca613[_0x8499('0xb')](_0x8499('0xc'),attributes,{'tableName':'fax_messages','paranoid':![],'indexes':[{'name':_0x8499('0xd'),'fields':[_0x8499('0xe')],'type':_0x8499('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x7da5b1,_0x719583,_0x586e21){var _0x598517=_0x4ca613['models'];var _0x587b10=_0x7da5b1[_0x8499('0x10')]({'plain':!![]});if(_0x587b10[_0x8499('0x11')][_0x8499('0x12')]()==='in'||_0x587b10[_0x8499('0x11')]['toLowerCase']()==='out'&&!_0x587b10['secret']&&!_['isNil'](_0x587b10[_0x8499('0x13')])){_0x598517[_0x8499('0x14')][_0x8499('0x15')]({'where':{'id':_0x587b10['FaxInteractionId']}})['then'](function(_0xa70e1){if(_0xa70e1){_0xa70e1[_0x8499('0x16')]({'lastMsgAt':_0x587b10[_0x8499('0x17')],'lastMsgDirection':_0x587b10['direction']['toLowerCase']()});}})[_0x8499('0x18')](function(_0x2f24eb){console[_0x8499('0x19')](_0x2f24eb);});}_0x586e21();}},'charset':_0x8499('0x1a'),'collate':_0x8499('0x1b')});}; \ No newline at end of file +var _0x2e8f=['request-promise','path','../../config/environment','./faxMessage.attributes','exports','FaxMessage','fax_messages','fti_fax_messages','body','FULLTEXT','models','toLowerCase','out','secret','isNil','FaxInteraction','FaxInteractionId','then','update','createdAt','direction','error','utf8mb4','lodash','../../config/logger','moment'];(function(_0x35b343,_0x402267){var _0x2e9166=function(_0x15f353){while(--_0x15f353){_0x35b343['push'](_0x35b343['shift']());}};_0x2e9166(++_0x402267);}(_0x2e8f,0x183));var _0xf2e8=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x2e8f[_0x2641f9];return _0x585741;};'use strict';var _=require(_0xf2e8('0x0'));var util=require('util');var logger=require(_0xf2e8('0x1'))('api');var moment=require(_0xf2e8('0x2'));var BPromise=require('bluebird');var rp=require(_0xf2e8('0x3'));var fs=require('fs');var path=require(_0xf2e8('0x4'));var rimraf=require('rimraf');var config=require(_0xf2e8('0x5'));var attributes=require(_0xf2e8('0x6'));module[_0xf2e8('0x7')]=function(_0x539f5b,_0x3eacca){return _0x539f5b['define'](_0xf2e8('0x8'),attributes,{'tableName':_0xf2e8('0x9'),'paranoid':![],'indexes':[{'name':_0xf2e8('0xa'),'fields':[_0xf2e8('0xb')],'type':_0xf2e8('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x47fc64,_0xda79f9,_0x249a35){var _0x571263=_0x539f5b[_0xf2e8('0xd')];var _0x5b5021=_0x47fc64['get']({'plain':!![]});if(_0x5b5021['direction'][_0xf2e8('0xe')]()==='in'||_0x5b5021['direction']['toLowerCase']()===_0xf2e8('0xf')&&!_0x5b5021[_0xf2e8('0x10')]&&!_[_0xf2e8('0x11')](_0x5b5021['UserId'])){_0x571263[_0xf2e8('0x12')]['findOne']({'where':{'id':_0x5b5021[_0xf2e8('0x13')]}})[_0xf2e8('0x14')](function(_0x46f605){if(_0x46f605){_0x46f605[_0xf2e8('0x15')]({'lastMsgAt':_0x5b5021[_0xf2e8('0x16')],'lastMsgDirection':_0x5b5021[_0xf2e8('0x17')][_0xf2e8('0xe')]()});}})['catch'](function(_0x42dfc0){console[_0xf2e8('0x18')](_0x42dfc0);});}_0x249a35();}},'charset':_0xf2e8('0x19'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index 8427435..f73c07a 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 _0xdace=['FaxMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','FaxMessage','create','body','options','raw','CreateFaxMessage','UpdateFaxMessage','update','attributes','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','defaults','redis','localhost','./faxMessage.socket','register','then','FaxMessage,\x20%s,\x20%s','debug'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0xdace,0xc5));var _0xedac=function(_0x432fca,_0xb0b1b5){_0x432fca=_0x432fca-0x0;var _0x3adba4=_0xdace[_0x432fca];return _0x3adba4;};'use strict';var _=require(_0xedac('0x0'));var util=require('util');var moment=require(_0xedac('0x1'));var BPromise=require(_0xedac('0x2'));var rs=require(_0xedac('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xedac('0x4'))['db'];var utils=require(_0xedac('0x5'));var logger=require(_0xedac('0x6'))(_0xedac('0x7'));var config=require('../../config/environment');var jayson=require(_0xedac('0x8'));var client=jayson[_0xedac('0x9')][_0xedac('0xa')]({'port':0x232a});config['redis']=_[_0xedac('0xb')](config[_0xedac('0xc')],{'host':_0xedac('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xedac('0xc')]));require(_0xedac('0xe'))[_0xedac('0xf')](socket);function respondWithRpcPromise(_0x4af030,_0x5e188c,_0x144368){return new BPromise(function(_0x2ea11d,_0x57e1bf){return client['request'](_0x4af030,_0x144368)[_0xedac('0x10')](function(_0x25395d){logger['info'](_0xedac('0x11'),_0x5e188c,'request\x20sent');logger[_0xedac('0x12')](_0xedac('0x13'),_0x5e188c,_0xedac('0x14'),JSON[_0xedac('0x15')](_0x25395d));if(_0x25395d[_0xedac('0x16')]){if(_0x25395d[_0xedac('0x16')][_0xedac('0x17')]===0x1f4){logger[_0xedac('0x16')]('FaxMessage,\x20%s,\x20%s',_0x5e188c,_0x25395d[_0xedac('0x16')][_0xedac('0x18')]);return _0x57e1bf(_0x25395d[_0xedac('0x16')][_0xedac('0x18')]);}logger[_0xedac('0x16')]('FaxMessage,\x20%s,\x20%s',_0x5e188c,_0x25395d[_0xedac('0x16')]['message']);return _0x2ea11d(_0x25395d[_0xedac('0x16')][_0xedac('0x18')]);}else{logger[_0xedac('0x19')](_0xedac('0x11'),_0x5e188c,'request\x20sent');_0x2ea11d(_0x25395d['result'][_0xedac('0x18')]);}})[_0xedac('0x1a')](function(_0x25fe64){logger[_0xedac('0x16')]('FaxMessage,\x20%s,\x20%s',_0x5e188c,_0x25fe64);_0x57e1bf(_0x25fe64);});});}exports['CreateFaxMessage']=function(_0x2b2ae9){var _0x17766c=this;return new Promise(function(_0x23c609,_0xcc1605){return db[_0xedac('0x1b')][_0xedac('0x1c')](_0x2b2ae9[_0xedac('0x1d')],{'raw':_0x2b2ae9[_0xedac('0x1e')]?_0x2b2ae9['options'][_0xedac('0x1f')]===undefined?!![]:![]:!![]})['then'](function(_0x29cd40){logger[_0xedac('0x19')]('CreateFaxMessage',_0x2b2ae9);logger[_0xedac('0x12')](_0xedac('0x20'),_0x2b2ae9,JSON[_0xedac('0x15')](_0x29cd40));_0x23c609(_0x29cd40);})[_0xedac('0x1a')](function(_0x6b13ca){logger[_0xedac('0x16')]('CreateFaxMessage',_0x6b13ca[_0xedac('0x18')],_0x2b2ae9);_0xcc1605(_0x17766c[_0xedac('0x16')](0x1f4,_0x6b13ca[_0xedac('0x18')]));});});};exports[_0xedac('0x21')]=function(_0x1ff33e){var _0x453a3c=this;return new Promise(function(_0x40ba53,_0x26c6f7){return db[_0xedac('0x1b')][_0xedac('0x22')](_0x1ff33e['body'],{'raw':_0x1ff33e[_0xedac('0x1e')]?_0x1ff33e[_0xedac('0x1e')][_0xedac('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1ff33e['options']?_0x1ff33e[_0xedac('0x1e')]['where']||null:null,'attributes':_0x1ff33e['options']?_0x1ff33e[_0xedac('0x1e')][_0xedac('0x23')]||null:null,'limit':_0x1ff33e[_0xedac('0x1e')]?_0x1ff33e[_0xedac('0x1e')]['limit']||null:null})['then'](function(_0xe813e6){logger[_0xedac('0x19')](_0xedac('0x21'),_0x1ff33e);logger[_0xedac('0x12')](_0xedac('0x21'),_0x1ff33e,JSON[_0xedac('0x15')](_0xe813e6));_0x40ba53(_0xe813e6);})[_0xedac('0x1a')](function(_0x483233){logger[_0xedac('0x16')](_0xedac('0x21'),_0x483233[_0xedac('0x18')],_0x1ff33e);_0x26c6f7(_0x453a3c['error'](0x1f4,_0x483233[_0xedac('0x18')]));});});}; \ No newline at end of file +var _0x032e=['FaxMessage,\x20%s,\x20%s','debug','FaxMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateFaxMessage','FaxMessage','create','body','options','raw','UpdateFaxMessage','where','attributes','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','register','request','then','info'];(function(_0x1fde89,_0x342ec0){var _0x112aa9=function(_0xdb83a0){while(--_0xdb83a0){_0x1fde89['push'](_0x1fde89['shift']());}};_0x112aa9(++_0x342ec0);}(_0x032e,0x124));var _0xe032=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0x032e[_0x5783f4];return _0x28e380;};'use strict';var _=require(_0xe032('0x0'));var util=require('util');var moment=require(_0xe032('0x1'));var BPromise=require(_0xe032('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe032('0x3'))['db'];var utils=require(_0xe032('0x4'));var logger=require(_0xe032('0x5'))(_0xe032('0x6'));var config=require(_0xe032('0x7'));var jayson=require(_0xe032('0x8'));var client=jayson[_0xe032('0x9')][_0xe032('0xa')]({'port':0x232a});config[_0xe032('0xb')]=_[_0xe032('0xc')](config[_0xe032('0xb')],{'host':_0xe032('0xd'),'port':0x18eb});var socket=require(_0xe032('0xe'))(new Redis(config[_0xe032('0xb')]));require(_0xe032('0xf'))[_0xe032('0x10')](socket);function respondWithRpcPromise(_0x2dc9e5,_0x167bd9,_0x4aec53){return new BPromise(function(_0x1382e1,_0x1ce2ae){return client[_0xe032('0x11')](_0x2dc9e5,_0x4aec53)[_0xe032('0x12')](function(_0x244f93){logger[_0xe032('0x13')](_0xe032('0x14'),_0x167bd9,'request\x20sent');logger[_0xe032('0x15')](_0xe032('0x16'),_0x167bd9,_0xe032('0x17'),JSON[_0xe032('0x18')](_0x244f93));if(_0x244f93['error']){if(_0x244f93[_0xe032('0x19')][_0xe032('0x1a')]===0x1f4){logger[_0xe032('0x19')](_0xe032('0x14'),_0x167bd9,_0x244f93[_0xe032('0x19')][_0xe032('0x1b')]);return _0x1ce2ae(_0x244f93[_0xe032('0x19')]['message']);}logger[_0xe032('0x19')](_0xe032('0x14'),_0x167bd9,_0x244f93[_0xe032('0x19')][_0xe032('0x1b')]);return _0x1382e1(_0x244f93[_0xe032('0x19')][_0xe032('0x1b')]);}else{logger['info'](_0xe032('0x14'),_0x167bd9,_0xe032('0x17'));_0x1382e1(_0x244f93[_0xe032('0x1c')][_0xe032('0x1b')]);}})[_0xe032('0x1d')](function(_0x5721ce){logger['error']('FaxMessage,\x20%s,\x20%s',_0x167bd9,_0x5721ce);_0x1ce2ae(_0x5721ce);});});}exports[_0xe032('0x1e')]=function(_0x505d8c){var _0x46dc27=this;return new Promise(function(_0x4608e4,_0x3f0257){return db[_0xe032('0x1f')][_0xe032('0x20')](_0x505d8c[_0xe032('0x21')],{'raw':_0x505d8c[_0xe032('0x22')]?_0x505d8c['options'][_0xe032('0x23')]===undefined?!![]:![]:!![]})[_0xe032('0x12')](function(_0x232e8f){logger[_0xe032('0x13')](_0xe032('0x1e'),_0x505d8c);logger[_0xe032('0x15')](_0xe032('0x1e'),_0x505d8c,JSON[_0xe032('0x18')](_0x232e8f));_0x4608e4(_0x232e8f);})['catch'](function(_0x4f1aa3){logger['error'](_0xe032('0x1e'),_0x4f1aa3[_0xe032('0x1b')],_0x505d8c);_0x3f0257(_0x46dc27[_0xe032('0x19')](0x1f4,_0x4f1aa3[_0xe032('0x1b')]));});});};exports[_0xe032('0x24')]=function(_0x200671){var _0x36ece7=this;return new Promise(function(_0x2b6ffa,_0x4dcbf1){return db[_0xe032('0x1f')]['update'](_0x200671[_0xe032('0x21')],{'raw':_0x200671[_0xe032('0x22')]?_0x200671[_0xe032('0x22')][_0xe032('0x23')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x200671['options']?_0x200671['options'][_0xe032('0x25')]||null:null,'attributes':_0x200671[_0xe032('0x22')]?_0x200671[_0xe032('0x22')][_0xe032('0x26')]||null:null,'limit':_0x200671['options']?_0x200671['options']['limit']||null:null})[_0xe032('0x12')](function(_0x1dd34f){logger[_0xe032('0x13')](_0xe032('0x24'),_0x200671);logger['debug'](_0xe032('0x24'),_0x200671,JSON[_0xe032('0x18')](_0x1dd34f));_0x2b6ffa(_0x1dd34f);})[_0xe032('0x1d')](function(_0x4348f8){logger[_0xe032('0x19')]('UpdateFaxMessage',_0x4348f8[_0xe032('0x1b')],_0x200671);_0x4dcbf1(_0x36ece7[_0xe032('0x19')](0x1f4,_0x4348f8[_0xe032('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index 75920c3..d1cf584 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 _0x2bcb=['faxMessage:','./faxMessage.events','update','emit','removeListener'];(function(_0x1933a1,_0x5ea5e1){var _0x362416=function(_0x24bee3){while(--_0x24bee3){_0x1933a1['push'](_0x1933a1['shift']());}};_0x362416(++_0x5ea5e1);}(_0x2bcb,0x1e6));var _0xb2bc=function(_0x44e80d,_0x4efd18){_0x44e80d=_0x44e80d-0x0;var _0x59169a=_0x2bcb[_0x44e80d];return _0x59169a;};'use strict';var FaxMessageEvents=require(_0xb2bc('0x0'));var events=['save','remove',_0xb2bc('0x1')];function createListener(_0x3199ba,_0xd1cf2a){return function(_0x1f831e){_0xd1cf2a[_0xb2bc('0x2')](_0x3199ba,_0x1f831e);};}function removeListener(_0x5ef804,_0x41b169){return function(){FaxMessageEvents[_0xb2bc('0x3')](_0x5ef804,_0x41b169);};}exports['register']=function(_0x27d57b){for(var _0x38dbcf=0x0,_0x4eb8b2=events['length'];_0x38dbcf<_0x4eb8b2;_0x38dbcf++){var _0x1ec761=events[_0x38dbcf];var _0x331d45=createListener(_0xb2bc('0x4')+_0x1ec761,_0x27d57b);FaxMessageEvents['on'](_0x1ec761,_0x331d45);}}; \ No newline at end of file +var _0xc36a=['length','faxMessage:','./faxMessage.events','save','remove','update','emit','register'];(function(_0x929c7e,_0x38c4cc){var _0x5de099=function(_0xc4e8d8){while(--_0xc4e8d8){_0x929c7e['push'](_0x929c7e['shift']());}};_0x5de099(++_0x38c4cc);}(_0xc36a,0x1a2));var _0xac36=function(_0x576451,_0x5b40ef){_0x576451=_0x576451-0x0;var _0x766481=_0xc36a[_0x576451];return _0x766481;};'use strict';var FaxMessageEvents=require(_0xac36('0x0'));var events=[_0xac36('0x1'),_0xac36('0x2'),_0xac36('0x3')];function createListener(_0xd4caf8,_0x4a55df){return function(_0x51c26d){_0x4a55df[_0xac36('0x4')](_0xd4caf8,_0x51c26d);};}function removeListener(_0x5cd4d7,_0x38ab77){return function(){FaxMessageEvents['removeListener'](_0x5cd4d7,_0x38ab77);};}exports[_0xac36('0x5')]=function(_0xb30315){for(var _0x5e19ce=0x0,_0x5e7ffa=events[_0xac36('0x6')];_0x5e19ce<_0x5e7ffa;_0x5e19ce++){var _0x50f02e=events[_0x5e19ce];var _0x1e0742=createListener(_0xac36('0x7')+_0x50f02e,_0xb30315);FaxMessageEvents['on'](_0x50f02e,_0x1e0742);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index d7626c6..0ab36d4 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 _0x9aea=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxMessage.controller','get','index','/describe','describe','/:id','isAuthenticated','show','/:id/download','download','fax','faxmessage:create','create','put','update','accept','/:id/reject','reject','delete','destroy','exports','multer','path','express'];(function(_0x1791cb,_0x4de9ca){var _0x29963f=function(_0x35a43d){while(--_0x35a43d){_0x1791cb['push'](_0x1791cb['shift']());}};_0x29963f(++_0x4de9ca);}(_0x9aea,0xdd));var _0xa9ae=function(_0x468c97,_0x48197c){_0x468c97=_0x468c97-0x0;var _0x1ebac3=_0x9aea[_0x468c97];return _0x1ebac3;};'use strict';var multer=require(_0xa9ae('0x0'));var util=require('util');var path=require(_0xa9ae('0x1'));var timeout=require('connect-timeout');var express=require(_0xa9ae('0x2'));var router=express[_0xa9ae('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xa9ae('0x4'));var interaction=require(_0xa9ae('0x5'));var config=require(_0xa9ae('0x6'));var controller=require(_0xa9ae('0x7'));router[_0xa9ae('0x8')]('/',auth['isAuthenticated'](),controller[_0xa9ae('0x9')]);router[_0xa9ae('0x8')](_0xa9ae('0xa'),auth['isAuthenticated'](),controller[_0xa9ae('0xb')]);router[_0xa9ae('0x8')](_0xa9ae('0xc'),auth[_0xa9ae('0xd')](),controller[_0xa9ae('0xe')]);router[_0xa9ae('0x8')](_0xa9ae('0xf'),auth[_0xa9ae('0xd')](),controller[_0xa9ae('0x10')]);router['post']('/',auth[_0xa9ae('0xd')](),interaction['tracked'](_0xa9ae('0x11'),_0xa9ae('0x12')),controller[_0xa9ae('0x13')]);router[_0xa9ae('0x14')](_0xa9ae('0xc'),auth[_0xa9ae('0xd')](),controller[_0xa9ae('0x15')]);router[_0xa9ae('0x14')]('/:id/accept',auth[_0xa9ae('0xd')](),controller[_0xa9ae('0x16')]);router[_0xa9ae('0x14')](_0xa9ae('0x17'),auth['isAuthenticated'](),controller[_0xa9ae('0x18')]);router[_0xa9ae('0x19')](_0xa9ae('0xc'),auth[_0xa9ae('0xd')](),controller[_0xa9ae('0x1a')]);module[_0xa9ae('0x1b')]=router; \ No newline at end of file +var _0xcea2=['create','put','update','/:id/accept','accept','reject','destroy','exports','multer','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./faxMessage.controller','isAuthenticated','get','/describe','describe','/:id','show','/:id/download','download','post','tracked'];(function(_0x1e9287,_0x37f584){var _0x44342e=function(_0x2f559e){while(--_0x2f559e){_0x1e9287['push'](_0x1e9287['shift']());}};_0x44342e(++_0x37f584);}(_0xcea2,0x15a));var _0x2cea=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0xcea2[_0x13d07a];return _0x5ee0ee;};'use strict';var multer=require(_0x2cea('0x0'));var util=require('util');var path=require(_0x2cea('0x1'));var timeout=require('connect-timeout');var express=require(_0x2cea('0x2'));var router=express[_0x2cea('0x3')]();var fs_extra=require(_0x2cea('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2cea('0x5'));var config=require(_0x2cea('0x6'));var controller=require(_0x2cea('0x7'));router['get']('/',auth[_0x2cea('0x8')](),controller['index']);router[_0x2cea('0x9')](_0x2cea('0xa'),auth[_0x2cea('0x8')](),controller[_0x2cea('0xb')]);router[_0x2cea('0x9')](_0x2cea('0xc'),auth['isAuthenticated'](),controller[_0x2cea('0xd')]);router[_0x2cea('0x9')](_0x2cea('0xe'),auth[_0x2cea('0x8')](),controller[_0x2cea('0xf')]);router[_0x2cea('0x10')]('/',auth[_0x2cea('0x8')](),interaction[_0x2cea('0x11')]('fax','faxmessage:create'),controller[_0x2cea('0x12')]);router[_0x2cea('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x2cea('0x14')]);router['put'](_0x2cea('0x15'),auth[_0x2cea('0x8')](),controller[_0x2cea('0x16')]);router['put']('/:id/reject',auth['isAuthenticated'](),controller[_0x2cea('0x17')]);router['delete'](_0x2cea('0xc'),auth[_0x2cea('0x8')](),controller[_0x2cea('0x18')]);module[_0x2cea('0x19')]=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index f39d47e..89f77c4 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 _0xc48d=['beepall','roundrobin','sequelize','exports','STRING','INTEGER','ENUM','rrmemory'];(function(_0x21d0c3,_0x16c71c){var _0x4df18e=function(_0x576bfe){while(--_0x576bfe){_0x21d0c3['push'](_0x21d0c3['shift']());}};_0x4df18e(++_0x16c71c);}(_0xc48d,0x11a));var _0xdc48=function(_0x470bfb,_0x389787){_0x470bfb=_0x470bfb-0x0;var _0x2f5d97=_0xc48d[_0x470bfb];return _0x2f5d97;};'use strict';var Sequelize=require(_0xdc48('0x0'));module[_0xdc48('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xdc48('0x2')]},'timeout':{'type':Sequelize[_0xdc48('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xdc48('0x4')](_0xdc48('0x5'),_0xdc48('0x6'),_0xdc48('0x7')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xdc48('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x51a9=['STRING','name','INTEGER','rrmemory','beepall','roundrobin','sequelize','exports'];(function(_0x1678f2,_0x2ecc97){var _0x418a84=function(_0x5a1a8e){while(--_0x5a1a8e){_0x1678f2['push'](_0x1678f2['shift']());}};_0x418a84(++_0x2ecc97);}(_0x51a9,0x86));var _0x951a=function(_0x3a373e,_0x2e9017){_0x3a373e=_0x3a373e-0x0;var _0x51339d=_0x51a9[_0x3a373e];return _0x51339d;};'use strict';var Sequelize=require(_0x951a('0x0'));module[_0x951a('0x1')]={'name':{'type':Sequelize[_0x951a('0x2')],'unique':_0x951a('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x951a('0x2')]},'timeout':{'type':Sequelize[_0x951a('0x4')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x951a('0x5'),_0x951a('0x6'),_0x951a('0x7')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x951a('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 8cb6513..7420a60 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 _0x1115=['sort','FaxQueueId','merge','map','filter','options','findAll','findAndCountAll','UserId','agent','faxPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','pick','addTeams','Agents','online','voicePause','interface','flatMap','transaction','each','findOrCreate','emit','userFaxQueue:save','ids','select','field','from','team_has_fax_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','TeamId','includes','all','union','compact','value','sequelize','removeTeams','isEmpty','removeAgents','forEach','userFaxQueue:remove','addAgents','spread','User','getAgents','util','lodash','squel','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','./faxQueue.socket','sendStatus','json','offset','undefined','limit','count','set','update','destroy','then','get','FaxQueues','UserProfileResource','status','end','error','name','send','index','FaxQueue','rawAttributes','fieldName','type','key','getOptions','where','include','rows','params','model','keys','query','attributes','intersection','fields','length','includeAll','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserFaxQueue','filters','hasOwnProperty','nolimit','order'];(function(_0x2a3cb2,_0x55280a){var _0x4120af=function(_0x2f470c){while(--_0x2f470c){_0x2a3cb2['push'](_0x2a3cb2['shift']());}};_0x4120af(++_0x55280a);}(_0x1115,0x1b6));var _0x5111=function(_0x428dd8,_0x2c30b4){_0x428dd8=_0x428dd8-0x0;var _0x9776cf=_0x1115[_0x428dd8];return _0x9776cf;};'use strict';var BPromise=require('bluebird');var util=require(_0x5111('0x0'));var _=require(_0x5111('0x1'));var squel=require(_0x5111('0x2'));var Redis=require(_0x5111('0x3'));var qs=require(_0x5111('0x4'));var logger=require(_0x5111('0x5'))(_0x5111('0x6'));var config=require(_0x5111('0x7'));var db=require(_0x5111('0x8'))['db'];config['redis']=_['defaults'](config[_0x5111('0x9')],{'host':_0x5111('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5111('0x9')]));require(_0x5111('0xb'))['register'](socket);function respondWithStatusCode(_0x42a3c5,_0x5e629a){_0x5e629a=_0x5e629a||0xcc;return function(_0x2d8e0a){if(_0x2d8e0a){return _0x42a3c5[_0x5111('0xc')](_0x5e629a);}return _0x42a3c5['status'](_0x5e629a)['end']();};}function respondWithResult(_0x347d87,_0x5a826a){_0x5a826a=_0x5a826a||0xc8;return function(_0x162624){if(_0x162624){return _0x347d87['status'](_0x5a826a)[_0x5111('0xd')](_0x162624);}};}function respondWithFilteredResult(_0x532984,_0x1fa1d2){return function(_0x334450){if(_0x334450){var _0x46043a=typeof _0x1fa1d2[_0x5111('0xe')]===_0x5111('0xf')&&typeof _0x1fa1d2[_0x5111('0x10')]===_0x5111('0xf');var _0x10e3c4=_0x334450[_0x5111('0x11')];var _0x62ce44=_0x46043a?0x0:_0x1fa1d2[_0x5111('0xe')];var _0x3e60b5=_0x46043a?_0x334450[_0x5111('0x11')]:_0x1fa1d2[_0x5111('0xe')]+_0x1fa1d2[_0x5111('0x10')];var _0x45052e;if(_0x3e60b5>=_0x10e3c4){_0x3e60b5=_0x10e3c4;_0x45052e=0xc8;}else{_0x45052e=0xce;}_0x532984['status'](_0x45052e);return _0x532984[_0x5111('0x12')]('Content-Range',_0x62ce44+'-'+_0x3e60b5+'/'+_0x10e3c4)['json'](_0x334450);}return null;};}function saveUpdates(_0x387e1e){return function(_0x843784){if(_0x843784){return _0x843784[_0x5111('0x13')](_0x387e1e)['then'](function(_0x367f8d){return _0x367f8d;});}return null;};}function removeEntity(_0xa3f4ba){return function(_0x52c614){if(_0x52c614){return _0x52c614[_0x5111('0x14')]()[_0x5111('0x15')](function(){var _0x28f24b=_0x52c614[_0x5111('0x16')]({'plain':!![]});var _0x5e8f1d=_0x5111('0x17');return db[_0x5111('0x18')][_0x5111('0x14')]({'where':{'type':_0x5e8f1d,'resourceId':_0x28f24b['id']}})[_0x5111('0x15')](function(){return _0x52c614;});})[_0x5111('0x15')](function(){_0xa3f4ba[_0x5111('0x19')](0xcc)[_0x5111('0x1a')]();});}};}function handleEntityNotFound(_0x262e58){return function(_0x6a1158){if(!_0x6a1158){_0x262e58[_0x5111('0xc')](0x194);}return _0x6a1158;};}function handleError(_0x4b73ce,_0x3f462d){_0x3f462d=_0x3f462d||0x1f4;return function(_0x162ff9){logger[_0x5111('0x1b')](_0x162ff9['stack']);if(_0x162ff9[_0x5111('0x1c')]){delete _0x162ff9[_0x5111('0x1c')];}_0x4b73ce[_0x5111('0x19')](_0x3f462d)[_0x5111('0x1d')](_0x162ff9);};}exports[_0x5111('0x1e')]=function(_0x33fea2,_0x5990){var _0x316b39={};var _0x382bd0={'count':0x0,'rows':[]};var _0x1a5793=_['map'](db[_0x5111('0x1f')][_0x5111('0x20')],function(_0x151b67){return{'name':_0x151b67[_0x5111('0x21')],'type':_0x151b67[_0x5111('0x22')][_0x5111('0x23')]};});_0x316b39=qs[_0x5111('0x24')](_0x1a5793,_0x33fea2);var _0x4be100={'where':_0x316b39[_0x5111('0x25')]};return db[_0x5111('0x1f')][_0x5111('0x11')](_0x4be100)['then'](function(_0xdf9031){_0x382bd0[_0x5111('0x11')]=_0xdf9031;_0x316b39[_0x5111('0x26')]=qs['include'](_0x33fea2['query']);return db[_0x5111('0x1f')]['findAll'](_0x316b39);})[_0x5111('0x15')](function(_0x5b5a6d){_0x382bd0[_0x5111('0x27')]=_0x5b5a6d;return _0x382bd0;})['then'](respondWithFilteredResult(_0x5990,_0x316b39))['catch'](handleError(_0x5990,null));};exports['show']=function(_0x36d86c,_0x3fb9a5){var _0xe0839e={'raw':!![],'where':{'id':_0x36d86c[_0x5111('0x28')]['id']}},_0x3763f4={};_0x3763f4[_0x5111('0x29')]=_[_0x5111('0x2a')](db['FaxQueue'][_0x5111('0x20')]);_0x3763f4[_0x5111('0x2b')]=_[_0x5111('0x2a')](_0x36d86c[_0x5111('0x2b')]);_0x3763f4['filters']=_['intersection'](_0x3763f4[_0x5111('0x29')],_0x3763f4[_0x5111('0x2b')]);_0xe0839e[_0x5111('0x2c')]=_[_0x5111('0x2d')](_0x3763f4[_0x5111('0x29')],qs[_0x5111('0x2e')](_0x36d86c[_0x5111('0x2b')][_0x5111('0x2e')]));_0xe0839e['attributes']=_0xe0839e[_0x5111('0x2c')][_0x5111('0x2f')]?_0xe0839e[_0x5111('0x2c')]:_0x3763f4['model'];if(_0x36d86c[_0x5111('0x2b')][_0x5111('0x30')]){_0xe0839e[_0x5111('0x26')]=[{'all':!![]}];}_0xe0839e=_['merge']({},_0xe0839e,_0x36d86c['options']);return db['FaxQueue'][_0x5111('0x31')](_0xe0839e)[_0x5111('0x15')](handleEntityNotFound(_0x3fb9a5,null))[_0x5111('0x15')](respondWithResult(_0x3fb9a5,null))[_0x5111('0x32')](handleError(_0x3fb9a5,null));};exports[_0x5111('0x33')]=function(_0x570126,_0x45d094){return db[_0x5111('0x1f')][_0x5111('0x33')](_0x570126[_0x5111('0x34')],{})['then'](function(_0x1d0646){var _0x444d82=_0x570126[_0x5111('0x35')][_0x5111('0x16')]({'plain':!![]});if(!_0x444d82)throw new Error(_0x5111('0x36'));if(_0x444d82[_0x5111('0x37')]===_0x5111('0x35')){var _0x41b6ac=_0x1d0646[_0x5111('0x16')]({'plain':!![]});var _0x222e9c=_0x5111('0x17');return db[_0x5111('0x38')][_0x5111('0x31')]({'where':{'name':_0x222e9c,'userProfileId':_0x444d82['userProfileId']},'raw':!![]})[_0x5111('0x15')](function(_0xf00f9){if(_0xf00f9&&_0xf00f9['autoAssociation']===0x0){return db[_0x5111('0x18')][_0x5111('0x33')]({'name':_0x41b6ac[_0x5111('0x1c')],'resourceId':_0x41b6ac['id'],'type':_0xf00f9[_0x5111('0x1c')],'sectionId':_0xf00f9['id']},{})[_0x5111('0x15')](function(){return _0x1d0646;});}else{return _0x1d0646;}})[_0x5111('0x32')](function(_0x1f1534){logger['error'](_0x5111('0x39'),_0x1f1534);throw _0x1f1534;});}return _0x1d0646;})[_0x5111('0x15')](respondWithResult(_0x45d094,0xc9))[_0x5111('0x32')](handleError(_0x45d094,null));};exports[_0x5111('0x13')]=function(_0x96893c,_0x49307f){if(_0x96893c['body']['id']){delete _0x96893c[_0x5111('0x34')]['id'];}return db[_0x5111('0x1f')]['find']({'where':{'id':_0x96893c[_0x5111('0x28')]['id']}})[_0x5111('0x15')](handleEntityNotFound(_0x49307f,null))[_0x5111('0x15')](saveUpdates(_0x96893c[_0x5111('0x34')],null))[_0x5111('0x15')](respondWithResult(_0x49307f,null))[_0x5111('0x32')](handleError(_0x49307f,null));};exports[_0x5111('0x14')]=function(_0x461787,_0xe99d8e){return db[_0x5111('0x1f')]['find']({'where':{'id':_0x461787['params']['id']}})[_0x5111('0x15')](handleEntityNotFound(_0xe99d8e,null))[_0x5111('0x15')](removeEntity(_0xe99d8e,null))[_0x5111('0x32')](handleError(_0xe99d8e,null));};exports[_0x5111('0x3a')]=function(_0x24abe7,_0x4ff01a){return db['FaxQueue'][_0x5111('0x3a')]()[_0x5111('0x15')](respondWithResult(_0x4ff01a,null))[_0x5111('0x32')](handleError(_0x4ff01a,null));};exports[_0x5111('0x3b')]=function(_0x5d5b0b,_0x2242b7){var _0x135993={'raw':!![],'where':{}},_0xf2dc3c={},_0x4fb6e8;return db[_0x5111('0x1f')][_0x5111('0x3c')]({'where':{'id':_0x5d5b0b[_0x5111('0x28')]['id']}})[_0x5111('0x15')](handleEntityNotFound(_0x2242b7,null))['then'](function(_0x4ab584){if(_0x4ab584){_0x4fb6e8=_0x4ab584[_0x5111('0x16')]({'plain':!![]});_0xf2dc3c['model']=_['keys'](db[_0x5111('0x3d')][_0x5111('0x20')]);_0xf2dc3c['query']=_[_0x5111('0x2a')](_0x5d5b0b[_0x5111('0x2b')]);_0xf2dc3c[_0x5111('0x3e')]=_[_0x5111('0x2d')](_0xf2dc3c[_0x5111('0x29')],_0xf2dc3c[_0x5111('0x2b')]);_0x135993[_0x5111('0x2c')]=_[_0x5111('0x2d')](_0xf2dc3c[_0x5111('0x29')],qs[_0x5111('0x2e')](_0x5d5b0b[_0x5111('0x2b')][_0x5111('0x2e')]));_0x135993['attributes']=_0x135993[_0x5111('0x2c')][_0x5111('0x2f')]?_0x135993[_0x5111('0x2c')]:_0xf2dc3c[_0x5111('0x29')];if(!_0x5d5b0b[_0x5111('0x2b')][_0x5111('0x3f')](_0x5111('0x40'))){_0x135993['limit']=qs['limit'](_0x5d5b0b[_0x5111('0x2b')]['limit']);_0x135993[_0x5111('0xe')]=qs[_0x5111('0xe')](_0x5d5b0b[_0x5111('0x2b')][_0x5111('0xe')]);}_0x135993[_0x5111('0x41')]=qs[_0x5111('0x42')](_0x5d5b0b[_0x5111('0x2b')]['sort']);_0x135993[_0x5111('0x25')]=qs[_0x5111('0x3e')](_['pick'](_0x5d5b0b[_0x5111('0x2b')],_0xf2dc3c[_0x5111('0x3e')]));_0x135993['where'][_0x5111('0x43')]=_0x4ab584['id'];if(_0x5d5b0b['query']['filter']){_0x135993['where']=_[_0x5111('0x44')](_0x135993[_0x5111('0x25')],{'$or':_[_0x5111('0x45')](_0x135993[_0x5111('0x2c')],function(_0x513d8b){var _0x14a940={};_0x14a940[_0x513d8b]={'$like':'%'+_0x5d5b0b[_0x5111('0x2b')][_0x5111('0x46')]+'%'};return _0x14a940;})});}_0x135993=_['merge']({},_0x135993,_0x5d5b0b[_0x5111('0x47')]);return db[_0x5111('0x3d')][_0x5111('0x48')](_0x135993);}})['then'](function(_0x11413a){if(_0x11413a){return db['User'][_0x5111('0x49')]({'where':{'id':_[_0x5111('0x45')](_0x11413a,_0x5111('0x4a')),'role':_0x5111('0x4b')},'attributes':['id','name',_0x5111('0x4c'),_0x5111('0x4d'),_0x5111('0x4e')]});}})[_0x5111('0x15')](function(_0x2b07ae){if(_0x2b07ae){return{'count':_0x2b07ae[_0x5111('0x11')],'rows':_[_0x5111('0x45')](_0x2b07ae['rows'],function(_0x27edea){return{'membername':_0x27edea['name'],'UserId':_0x27edea['id'],'queue_name':_0x4fb6e8[_0x5111('0x1c')],'FaxQueueId':_0x4fb6e8['id'],'interface':util[_0x5111('0x4f')](_0x5111('0x50'),_0x5111('0x51'),_0x27edea[_0x5111('0x1c')]),'penalty':0x0,'paused':_0x27edea[_0x5111('0x4c')],'createdAt':_0x27edea['createdAt'],'updatedAt':_0x27edea[_0x5111('0x4d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x5111('0x15')](respondWithFilteredResult(_0x2242b7,_0x135993))[_0x5111('0x32')](handleError(_0x2242b7,null));};exports[_0x5111('0x52')]=function(_0x3384ee,_0x434c07){var _0x5e7249={};var _0x2334a2={};var _0x13ce00;var _0x40d206;return db[_0x5111('0x1f')][_0x5111('0x3c')]({'where':{'id':_0x3384ee['params']['id']}})[_0x5111('0x15')](handleEntityNotFound(_0x434c07,null))[_0x5111('0x15')](function(_0x18f6c8){if(_0x18f6c8){_0x13ce00=_0x18f6c8;_0x2334a2[_0x5111('0x29')]=_[_0x5111('0x2a')](db[_0x5111('0x53')][_0x5111('0x20')]);_0x2334a2['query']=_['keys'](_0x3384ee['query']);_0x2334a2[_0x5111('0x3e')]=_[_0x5111('0x2d')](_0x2334a2[_0x5111('0x29')],_0x2334a2[_0x5111('0x2b')]);_0x5e7249[_0x5111('0x2c')]=_['intersection'](_0x2334a2[_0x5111('0x29')],qs[_0x5111('0x2e')](_0x3384ee[_0x5111('0x2b')][_0x5111('0x2e')]));_0x5e7249[_0x5111('0x2c')]=_0x5e7249[_0x5111('0x2c')][_0x5111('0x2f')]?_0x5e7249[_0x5111('0x2c')]:_0x2334a2[_0x5111('0x29')];_0x5e7249[_0x5111('0x41')]=qs['sort'](_0x3384ee[_0x5111('0x2b')][_0x5111('0x42')]);_0x5e7249['where']=qs[_0x5111('0x3e')](_[_0x5111('0x54')](_0x3384ee['query'],_0x2334a2[_0x5111('0x3e')]));if(_0x3384ee[_0x5111('0x2b')][_0x5111('0x46')]){_0x5e7249[_0x5111('0x25')]=_[_0x5111('0x44')](_0x5e7249[_0x5111('0x25')],{'$or':_[_0x5111('0x45')](_0x5e7249['attributes'],function(_0x72cc93){var _0x56c89c={};_0x56c89c[_0x72cc93]={'$like':'%'+_0x3384ee['query'][_0x5111('0x46')]+'%'};return _0x56c89c;})});}_0x5e7249=_['merge']({},_0x5e7249,_0x3384ee[_0x5111('0x47')]);return _0x13ce00['getTeams'](_0x5e7249);}})[_0x5111('0x15')](function(_0x206442){if(_0x206442){_0x40d206=_0x206442[_0x5111('0x2f')];if(!_0x3384ee[_0x5111('0x2b')][_0x5111('0x3f')](_0x5111('0x40'))){_0x5e7249[_0x5111('0x10')]=qs[_0x5111('0x10')](_0x3384ee[_0x5111('0x2b')][_0x5111('0x10')]);_0x5e7249[_0x5111('0xe')]=qs[_0x5111('0xe')](_0x3384ee[_0x5111('0x2b')]['offset']);}return _0x13ce00[_0x5111('0x52')](_0x5e7249);}})['then'](function(_0x2561c8){if(_0x2561c8){return _0x2561c8?{'count':_0x40d206,'rows':_0x2561c8}:null;}})['then'](respondWithResult(_0x434c07,null))[_0x5111('0x32')](handleError(_0x434c07,null));};exports[_0x5111('0x55')]=function(_0x36c719,_0x140cad){var _0x30d604=_0x36c719['body']['ids'];return db[_0x5111('0x53')]['findAll']({'where':{'id':_0x30d604},'attributes':['id'],'include':[{'model':db['User'],'as':_0x5111('0x56'),'attributes':['id',_0x5111('0x1c'),_0x5111('0x57'),_0x5111('0x58'),_0x5111('0x59')],'raw':!![]}]})[_0x5111('0x15')](function(_0x5b7b02){if(_0x5b7b02){var _0x220375=_[_0x5111('0x5a')](_0x5b7b02,function(_0x5add8f){var _0x435e72=_0x5add8f['get']({'plain':!![]});return _0x435e72[_0x5111('0x56')];});return db[_0x5111('0x1f')][_0x5111('0x31')]({'where':{'id':_0x36c719[_0x5111('0x28')]['id']}})['then'](function(_0x1f8ac1){return db['sequelize'][_0x5111('0x5b')](function(_0x57388d){return _0x1f8ac1[_0x5111('0x55')](_0x30d604,{'transaction':_0x57388d})[_0x5111('0x15')](function(){return BPromise[_0x5111('0x5c')](_0x220375,function(_0x199dbb){return db[_0x5111('0x3d')][_0x5111('0x5d')]({'where':{'UserId':_0x199dbb['id'],'FaxQueueId':_0x36c719[_0x5111('0x28')]['id']},'transaction':_0x57388d});});})[_0x5111('0x15')](function(){_0x220375['forEach'](function(_0x97815f){socket[_0x5111('0x5e')](_0x5111('0x5f'),{'UserId':_0x97815f['id'],'FaxQueueId':_0x1f8ac1['id']});});});});});}})[_0x5111('0x15')](respondWithStatusCode(_0x140cad,null))[_0x5111('0x32')](handleError(_0x140cad,null));};exports['removeTeams']=function(_0x389078,_0x367b4a){return db['Team'][_0x5111('0x48')]({'where':{'id':_0x389078[_0x5111('0x2b')][_0x5111('0x60')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x5111('0x56'),'attributes':['id'],'raw':!![]}]})[_0x5111('0x15')](handleEntityNotFound(_0x367b4a,null))['then'](function(_0x2dfa6e){var _0x56bb3d=_[_0x5111('0x45')](_0x2dfa6e,'id');var _0x5dcc50=[];var _0x27dd95=[];var _0x44b7ff=squel[_0x5111('0x61')]();_0x44b7ff[_0x5111('0x62')]('tq.TeamId')[_0x5111('0x63')](_0x5111('0x64'),'tq')[_0x5111('0x65')](_0x5111('0x66'),'ut',_0x5111('0x67'))[_0x5111('0x25')](_0x5111('0x68'),_0x389078[_0x5111('0x28')]['id']);for(var _0x439c1d=0x0;_0x439c1d<_0x2dfa6e[_0x5111('0x2f')];_0x439c1d+=0x1){let _0x4be0f0=_0x2dfa6e[_0x439c1d];for(var _0x1c31da=0x0;_0x1c31da<_0x4be0f0[_0x5111('0x56')]['length'];_0x1c31da+=0x1){let _0x44d460=_0x4be0f0[_0x5111('0x56')][_0x1c31da];var _0x4eb0b9=_0x44b7ff['clone']();_0x4eb0b9['where'](_0x5111('0x69'),_0x44d460['id']);_0x27dd95[_0x5111('0x6a')](db['sequelize'][_0x5111('0x2b')](_0x4eb0b9[_0x5111('0x6b')](),{'type':db['sequelize'][_0x5111('0x6c')][_0x5111('0x6d')]})[_0x5111('0x15')](function(_0x2a58f5){if(_0x2a58f5[_0x5111('0x2f')]===0x1){return _0x44d460['id'];}else{var _0x779d7f=_['every'](_[_0x5111('0x45')](_0x2a58f5,_0x5111('0x6e')),function(_0x6319a0){return _[_0x5111('0x6f')](_0x56bb3d,_0x6319a0);});if(_0x779d7f){return _0x44d460['id'];}}}));}}return BPromise[_0x5111('0x70')](_0x27dd95)['then'](function(_0x1efb6a){_0x5dcc50=_(_0x5dcc50)[_0x5111('0x71')](_0x1efb6a)[_0x5111('0x72')]()[_0x5111('0x73')]();return db[_0x5111('0x1f')][_0x5111('0x31')]({'where':{'id':_0x389078[_0x5111('0x28')]['id']}})['then'](function(_0x5a95a4){return db[_0x5111('0x74')][_0x5111('0x5b')](function(_0x2e4783){return _0x5a95a4[_0x5111('0x75')](_0x389078[_0x5111('0x2b')][_0x5111('0x60')],{'transaction':_0x2e4783})[_0x5111('0x15')](function(){if(!_[_0x5111('0x76')](_0x5dcc50)){return _0x5a95a4[_0x5111('0x77')](_0x5dcc50,{'transaction':_0x2e4783});}})[_0x5111('0x15')](function(){_0x5dcc50[_0x5111('0x78')](function(_0x48db8d){socket[_0x5111('0x5e')](_0x5111('0x79'),{'UserId':_0x48db8d,'FaxQueueId':_0x5a95a4['id']});});});});});});})['then'](respondWithStatusCode(_0x367b4a,null))[_0x5111('0x32')](handleError(_0x367b4a,null));};exports[_0x5111('0x7a')]=function(_0xc3780d,_0x248d95){return db['FaxQueue'][_0x5111('0x31')]({'where':{'id':_0xc3780d[_0x5111('0x28')]['id']}})['then'](handleEntityNotFound(_0x248d95,null))['then'](function(_0x1688f3){if(_0x1688f3){return _0x1688f3[_0x5111('0x7a')](_0xc3780d[_0x5111('0x34')][_0x5111('0x60')],_['omit'](_0xc3780d[_0x5111('0x34')],[_0x5111('0x60'),'id'])||{})[_0x5111('0x7b')](function(_0x292c67){for(var _0x2623a6=0x0;_0x2623a6<_0xc3780d[_0x5111('0x34')][_0x5111('0x60')]['length'];_0x2623a6+=0x1){socket[_0x5111('0x5e')](_0x5111('0x5f'),{'UserId':Number(_0xc3780d['body']['ids'][_0x2623a6]),'FaxQueueId':Number(_0xc3780d[_0x5111('0x28')]['id'])});}return _0x292c67;});}})[_0x5111('0x15')](respondWithResult(_0x248d95,null))[_0x5111('0x32')](handleError(_0x248d95,null));};exports['removeAgents']=function(_0x4a5b3e,_0x2e99a4){return db[_0x5111('0x1f')]['find']({'where':{'id':_0x4a5b3e[_0x5111('0x28')]['id']}})[_0x5111('0x15')](handleEntityNotFound(_0x2e99a4,null))[_0x5111('0x15')](function(_0x46ca55){if(_0x46ca55){return _0x46ca55[_0x5111('0x77')](_0x4a5b3e[_0x5111('0x2b')]['ids'])['then'](function(){if(_['isArray'](_0x4a5b3e[_0x5111('0x2b')]['ids'])){for(var _0x28fc7e=0x0;_0x28fc7e<_0x4a5b3e['query'][_0x5111('0x60')][_0x5111('0x2f')];_0x28fc7e+=0x1){socket[_0x5111('0x5e')](_0x5111('0x79'),{'UserId':Number(_0x4a5b3e[_0x5111('0x2b')][_0x5111('0x60')][_0x28fc7e]),'FaxQueueId':Number(_0x4a5b3e['params']['id'])});}}else{socket[_0x5111('0x5e')]('userFaxQueue:remove',{'UserId':Number(_0x4a5b3e[_0x5111('0x2b')]['ids']),'FaxQueueId':Number(_0x4a5b3e['params']['id'])});}});}})[_0x5111('0x15')](respondWithStatusCode(_0x2e99a4,null))[_0x5111('0x32')](handleError(_0x2e99a4,null));};exports['getAgents']=function(_0x1404be,_0x163f83){var _0xb8920={};var _0x1826b9={};var _0x390857;var _0x1a8114;return db[_0x5111('0x1f')]['findOne']({'where':{'id':_0x1404be[_0x5111('0x28')]['id']}})[_0x5111('0x15')](handleEntityNotFound(_0x163f83,null))[_0x5111('0x15')](function(_0x32745c){if(_0x32745c){_0x390857=_0x32745c;_0x1826b9[_0x5111('0x29')]=_['keys'](db[_0x5111('0x7c')][_0x5111('0x20')]);_0x1826b9[_0x5111('0x2b')]=_['keys'](_0x1404be['query']);_0x1826b9[_0x5111('0x3e')]=_['intersection'](_0x1826b9[_0x5111('0x29')],_0x1826b9[_0x5111('0x2b')]);_0xb8920[_0x5111('0x2c')]=_['intersection'](_0x1826b9[_0x5111('0x29')],qs['fields'](_0x1404be[_0x5111('0x2b')][_0x5111('0x2e')]));_0xb8920['attributes']=_0xb8920[_0x5111('0x2c')][_0x5111('0x2f')]?_0xb8920[_0x5111('0x2c')]:_0x1826b9[_0x5111('0x29')];_0xb8920[_0x5111('0x41')]=qs[_0x5111('0x42')](_0x1404be['query'][_0x5111('0x42')]);_0xb8920[_0x5111('0x25')]=qs[_0x5111('0x3e')](_['pick'](_0x1404be[_0x5111('0x2b')],_0x1826b9[_0x5111('0x3e')]));if(_0x1404be[_0x5111('0x2b')][_0x5111('0x46')]){_0xb8920[_0x5111('0x25')]=_[_0x5111('0x44')](_0xb8920[_0x5111('0x25')],{'$or':_[_0x5111('0x45')](_0xb8920['attributes'],function(_0x3ec675){var _0x5aba55={};_0x5aba55[_0x3ec675]={'$like':'%'+_0x1404be[_0x5111('0x2b')][_0x5111('0x46')]+'%'};return _0x5aba55;})});}_0xb8920=_[_0x5111('0x44')]({},_0xb8920,_0x1404be[_0x5111('0x47')]);return _0x390857[_0x5111('0x7d')](_0xb8920);}})['then'](function(_0xfecd37){if(_0xfecd37){_0x1a8114=_0xfecd37[_0x5111('0x2f')];if(!_0x1404be[_0x5111('0x2b')][_0x5111('0x3f')](_0x5111('0x40'))){_0xb8920[_0x5111('0x10')]=qs[_0x5111('0x10')](_0x1404be[_0x5111('0x2b')]['limit']);_0xb8920['offset']=qs[_0x5111('0xe')](_0x1404be[_0x5111('0x2b')][_0x5111('0xe')]);}return _0x390857['getAgents'](_0xb8920);}})['then'](function(_0x506359){if(_0x506359){return _0x506359?{'count':_0x1a8114,'rows':_0x506359}:null;}})['then'](respondWithResult(_0x163f83,null))[_0x5111('0x32')](handleError(_0x163f83,null));}; \ No newline at end of file +var _0x71ab=['Content-Range','update','then','destroy','get','FaxQueues','error','stack','name','send','index','map','FaxQueue','rawAttributes','fieldName','type','getOptions','where','include','query','rows','show','params','keys','filters','intersection','model','attributes','fields','length','includeAll','options','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserFaxQueue','hasOwnProperty','nolimit','order','sort','FaxQueueId','merge','filter','findAndCountAll','UserId','agent','faxPause','updatedAt','format','%s/%s','getTeams','Team','pick','ids','findAll','User','Agents','online','voicePause','flatMap','sequelize','each','removeTeams','select','field','tq.TeamId','team_has_fax_queues','join','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','transaction','removeAgents','forEach','userFaxQueue:remove','addAgents','spread','emit','isArray','getAgents','util','squel','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','sendStatus','status','json','limit','undefined','count','offset','set'];(function(_0x246b9a,_0x6e236e){var _0x1e8150=function(_0x337f2e){while(--_0x337f2e){_0x246b9a['push'](_0x246b9a['shift']());}};_0x1e8150(++_0x6e236e);}(_0x71ab,0x64));var _0xb71a=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x71ab[_0x2b4411];return _0x8e41ef;};'use strict';var BPromise=require('bluebird');var util=require(_0xb71a('0x0'));var _=require('lodash');var squel=require(_0xb71a('0x1'));var Redis=require('ioredis');var qs=require(_0xb71a('0x2'));var logger=require(_0xb71a('0x3'))(_0xb71a('0x4'));var config=require(_0xb71a('0x5'));var db=require(_0xb71a('0x6'))['db'];config[_0xb71a('0x7')]=_[_0xb71a('0x8')](config[_0xb71a('0x7')],{'host':_0xb71a('0x9'),'port':0x18eb});var socket=require(_0xb71a('0xa'))(new Redis(config[_0xb71a('0x7')]));require(_0xb71a('0xb'))[_0xb71a('0xc')](socket);function respondWithStatusCode(_0x471ab6,_0x18c7a6){_0x18c7a6=_0x18c7a6||0xcc;return function(_0xbfef18){if(_0xbfef18){return _0x471ab6[_0xb71a('0xd')](_0x18c7a6);}return _0x471ab6[_0xb71a('0xe')](_0x18c7a6)['end']();};}function respondWithResult(_0xfec897,_0x58956d){_0x58956d=_0x58956d||0xc8;return function(_0x3d7bd7){if(_0x3d7bd7){return _0xfec897[_0xb71a('0xe')](_0x58956d)[_0xb71a('0xf')](_0x3d7bd7);}};}function respondWithFilteredResult(_0x591311,_0x3909b4){return function(_0x4c167a){if(_0x4c167a){var _0x2a2d75=typeof _0x3909b4['offset']==='undefined'&&typeof _0x3909b4[_0xb71a('0x10')]===_0xb71a('0x11');var _0x315ca8=_0x4c167a[_0xb71a('0x12')];var _0x483d77=_0x2a2d75?0x0:_0x3909b4['offset'];var _0x5364e3=_0x2a2d75?_0x4c167a[_0xb71a('0x12')]:_0x3909b4[_0xb71a('0x13')]+_0x3909b4[_0xb71a('0x10')];var _0x42fc55;if(_0x5364e3>=_0x315ca8){_0x5364e3=_0x315ca8;_0x42fc55=0xc8;}else{_0x42fc55=0xce;}_0x591311[_0xb71a('0xe')](_0x42fc55);return _0x591311[_0xb71a('0x14')](_0xb71a('0x15'),_0x483d77+'-'+_0x5364e3+'/'+_0x315ca8)[_0xb71a('0xf')](_0x4c167a);}return null;};}function saveUpdates(_0x7710a8){return function(_0x5588cf){if(_0x5588cf){return _0x5588cf[_0xb71a('0x16')](_0x7710a8)[_0xb71a('0x17')](function(_0x374c8c){return _0x374c8c;});}return null;};}function removeEntity(_0x346524){return function(_0x2bdb61){if(_0x2bdb61){return _0x2bdb61[_0xb71a('0x18')]()[_0xb71a('0x17')](function(){var _0x7cd1f9=_0x2bdb61[_0xb71a('0x19')]({'plain':!![]});var _0x2eab08=_0xb71a('0x1a');return db['UserProfileResource']['destroy']({'where':{'type':_0x2eab08,'resourceId':_0x7cd1f9['id']}})[_0xb71a('0x17')](function(){return _0x2bdb61;});})[_0xb71a('0x17')](function(){_0x346524['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1cfd1c){return function(_0x4fe4fb){if(!_0x4fe4fb){_0x1cfd1c[_0xb71a('0xd')](0x194);}return _0x4fe4fb;};}function handleError(_0x4227c7,_0x3ac77b){_0x3ac77b=_0x3ac77b||0x1f4;return function(_0x18fa8d){logger[_0xb71a('0x1b')](_0x18fa8d[_0xb71a('0x1c')]);if(_0x18fa8d[_0xb71a('0x1d')]){delete _0x18fa8d[_0xb71a('0x1d')];}_0x4227c7['status'](_0x3ac77b)[_0xb71a('0x1e')](_0x18fa8d);};}exports[_0xb71a('0x1f')]=function(_0x353930,_0xa0743a){var _0x3401f7={};var _0x1a010d={'count':0x0,'rows':[]};var _0x20ed75=_[_0xb71a('0x20')](db[_0xb71a('0x21')][_0xb71a('0x22')],function(_0x45b849){return{'name':_0x45b849[_0xb71a('0x23')],'type':_0x45b849[_0xb71a('0x24')]['key']};});_0x3401f7=qs[_0xb71a('0x25')](_0x20ed75,_0x353930);var _0x39d874={'where':_0x3401f7[_0xb71a('0x26')]};return db[_0xb71a('0x21')][_0xb71a('0x12')](_0x39d874)[_0xb71a('0x17')](function(_0x44826e){_0x1a010d[_0xb71a('0x12')]=_0x44826e;_0x3401f7[_0xb71a('0x27')]=qs[_0xb71a('0x27')](_0x353930[_0xb71a('0x28')]);return db['FaxQueue']['findAll'](_0x3401f7);})[_0xb71a('0x17')](function(_0x5c2a45){_0x1a010d[_0xb71a('0x29')]=_0x5c2a45;return _0x1a010d;})[_0xb71a('0x17')](respondWithFilteredResult(_0xa0743a,_0x3401f7))['catch'](handleError(_0xa0743a,null));};exports[_0xb71a('0x2a')]=function(_0xa42f25,_0x1fe058){var _0x251d82={'raw':!![],'where':{'id':_0xa42f25[_0xb71a('0x2b')]['id']}},_0x3d3d81={};_0x3d3d81['model']=_[_0xb71a('0x2c')](db[_0xb71a('0x21')][_0xb71a('0x22')]);_0x3d3d81[_0xb71a('0x28')]=_['keys'](_0xa42f25[_0xb71a('0x28')]);_0x3d3d81[_0xb71a('0x2d')]=_[_0xb71a('0x2e')](_0x3d3d81[_0xb71a('0x2f')],_0x3d3d81[_0xb71a('0x28')]);_0x251d82[_0xb71a('0x30')]=_[_0xb71a('0x2e')](_0x3d3d81[_0xb71a('0x2f')],qs[_0xb71a('0x31')](_0xa42f25[_0xb71a('0x28')]['fields']));_0x251d82['attributes']=_0x251d82[_0xb71a('0x30')][_0xb71a('0x32')]?_0x251d82[_0xb71a('0x30')]:_0x3d3d81[_0xb71a('0x2f')];if(_0xa42f25[_0xb71a('0x28')][_0xb71a('0x33')]){_0x251d82[_0xb71a('0x27')]=[{'all':!![]}];}_0x251d82=_['merge']({},_0x251d82,_0xa42f25[_0xb71a('0x34')]);return db['FaxQueue'][_0xb71a('0x35')](_0x251d82)[_0xb71a('0x17')](handleEntityNotFound(_0x1fe058,null))[_0xb71a('0x17')](respondWithResult(_0x1fe058,null))[_0xb71a('0x36')](handleError(_0x1fe058,null));};exports['create']=function(_0x39d12c,_0x3ff4ed){return db[_0xb71a('0x21')][_0xb71a('0x37')](_0x39d12c[_0xb71a('0x38')],{})[_0xb71a('0x17')](function(_0x4571c0){var _0x2756b9=_0x39d12c[_0xb71a('0x39')]['get']({'plain':!![]});if(!_0x2756b9)throw new Error(_0xb71a('0x3a'));if(_0x2756b9['role']===_0xb71a('0x39')){var _0x2ba298=_0x4571c0[_0xb71a('0x19')]({'plain':!![]});var _0x3cca63=_0xb71a('0x1a');return db[_0xb71a('0x3b')]['find']({'where':{'name':_0x3cca63,'userProfileId':_0x2756b9['userProfileId']},'raw':!![]})['then'](function(_0x35fea9){if(_0x35fea9&&_0x35fea9['autoAssociation']===0x0){return db[_0xb71a('0x3c')][_0xb71a('0x37')]({'name':_0x2ba298[_0xb71a('0x1d')],'resourceId':_0x2ba298['id'],'type':_0x35fea9[_0xb71a('0x1d')],'sectionId':_0x35fea9['id']},{})[_0xb71a('0x17')](function(){return _0x4571c0;});}else{return _0x4571c0;}})[_0xb71a('0x36')](function(_0x59530a){logger[_0xb71a('0x1b')](_0xb71a('0x3d'),_0x59530a);throw _0x59530a;});}return _0x4571c0;})[_0xb71a('0x17')](respondWithResult(_0x3ff4ed,0xc9))[_0xb71a('0x36')](handleError(_0x3ff4ed,null));};exports[_0xb71a('0x16')]=function(_0x2f08d2,_0x55cbca){if(_0x2f08d2[_0xb71a('0x38')]['id']){delete _0x2f08d2[_0xb71a('0x38')]['id'];}return db[_0xb71a('0x21')][_0xb71a('0x35')]({'where':{'id':_0x2f08d2[_0xb71a('0x2b')]['id']}})[_0xb71a('0x17')](handleEntityNotFound(_0x55cbca,null))[_0xb71a('0x17')](saveUpdates(_0x2f08d2['body'],null))['then'](respondWithResult(_0x55cbca,null))[_0xb71a('0x36')](handleError(_0x55cbca,null));};exports[_0xb71a('0x18')]=function(_0x2f6b72,_0x273964){return db['FaxQueue'][_0xb71a('0x35')]({'where':{'id':_0x2f6b72['params']['id']}})[_0xb71a('0x17')](handleEntityNotFound(_0x273964,null))[_0xb71a('0x17')](removeEntity(_0x273964,null))['catch'](handleError(_0x273964,null));};exports[_0xb71a('0x3e')]=function(_0x274a94,_0x1129ab){return db[_0xb71a('0x21')]['describe']()[_0xb71a('0x17')](respondWithResult(_0x1129ab,null))[_0xb71a('0x36')](handleError(_0x1129ab,null));};exports[_0xb71a('0x3f')]=function(_0x5516bd,_0x350c89){var _0x1cd434={'raw':!![],'where':{}},_0x29b0bd={},_0x5e9eea;return db[_0xb71a('0x21')][_0xb71a('0x40')]({'where':{'id':_0x5516bd[_0xb71a('0x2b')]['id']}})[_0xb71a('0x17')](handleEntityNotFound(_0x350c89,null))[_0xb71a('0x17')](function(_0x550a67){if(_0x550a67){_0x5e9eea=_0x550a67[_0xb71a('0x19')]({'plain':!![]});_0x29b0bd[_0xb71a('0x2f')]=_[_0xb71a('0x2c')](db[_0xb71a('0x41')]['rawAttributes']);_0x29b0bd['query']=_[_0xb71a('0x2c')](_0x5516bd[_0xb71a('0x28')]);_0x29b0bd[_0xb71a('0x2d')]=_[_0xb71a('0x2e')](_0x29b0bd[_0xb71a('0x2f')],_0x29b0bd[_0xb71a('0x28')]);_0x1cd434[_0xb71a('0x30')]=_[_0xb71a('0x2e')](_0x29b0bd[_0xb71a('0x2f')],qs[_0xb71a('0x31')](_0x5516bd['query'][_0xb71a('0x31')]));_0x1cd434[_0xb71a('0x30')]=_0x1cd434['attributes'][_0xb71a('0x32')]?_0x1cd434['attributes']:_0x29b0bd[_0xb71a('0x2f')];if(!_0x5516bd[_0xb71a('0x28')][_0xb71a('0x42')](_0xb71a('0x43'))){_0x1cd434[_0xb71a('0x10')]=qs['limit'](_0x5516bd[_0xb71a('0x28')]['limit']);_0x1cd434[_0xb71a('0x13')]=qs[_0xb71a('0x13')](_0x5516bd['query']['offset']);}_0x1cd434[_0xb71a('0x44')]=qs[_0xb71a('0x45')](_0x5516bd['query']['sort']);_0x1cd434['where']=qs[_0xb71a('0x2d')](_['pick'](_0x5516bd['query'],_0x29b0bd[_0xb71a('0x2d')]));_0x1cd434[_0xb71a('0x26')][_0xb71a('0x46')]=_0x550a67['id'];if(_0x5516bd[_0xb71a('0x28')]['filter']){_0x1cd434[_0xb71a('0x26')]=_[_0xb71a('0x47')](_0x1cd434[_0xb71a('0x26')],{'$or':_['map'](_0x1cd434[_0xb71a('0x30')],function(_0x7de9e6){var _0x4dee60={};_0x4dee60[_0x7de9e6]={'$like':'%'+_0x5516bd[_0xb71a('0x28')][_0xb71a('0x48')]+'%'};return _0x4dee60;})});}_0x1cd434=_[_0xb71a('0x47')]({},_0x1cd434,_0x5516bd['options']);return db[_0xb71a('0x41')]['findAll'](_0x1cd434);}})[_0xb71a('0x17')](function(_0x32c774){if(_0x32c774){return db['User'][_0xb71a('0x49')]({'where':{'id':_[_0xb71a('0x20')](_0x32c774,_0xb71a('0x4a')),'role':_0xb71a('0x4b')},'attributes':['id',_0xb71a('0x1d'),_0xb71a('0x4c'),_0xb71a('0x4d'),'createdAt']});}})['then'](function(_0x19c72d){if(_0x19c72d){return{'count':_0x19c72d[_0xb71a('0x12')],'rows':_[_0xb71a('0x20')](_0x19c72d[_0xb71a('0x29')],function(_0x4002fc){return{'membername':_0x4002fc['name'],'UserId':_0x4002fc['id'],'queue_name':_0x5e9eea['name'],'FaxQueueId':_0x5e9eea['id'],'interface':util[_0xb71a('0x4e')](_0xb71a('0x4f'),'SIP',_0x4002fc[_0xb71a('0x1d')]),'penalty':0x0,'paused':_0x4002fc[_0xb71a('0x4c')],'createdAt':_0x4002fc['createdAt'],'updatedAt':_0x4002fc[_0xb71a('0x4d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xb71a('0x17')](respondWithFilteredResult(_0x350c89,_0x1cd434))[_0xb71a('0x36')](handleError(_0x350c89,null));};exports[_0xb71a('0x50')]=function(_0x59e2a0,_0x22146b){var _0x32e9e5={};var _0x4c80f8={};var _0x471c3c;var _0x73f725;return db[_0xb71a('0x21')][_0xb71a('0x40')]({'where':{'id':_0x59e2a0[_0xb71a('0x2b')]['id']}})[_0xb71a('0x17')](handleEntityNotFound(_0x22146b,null))[_0xb71a('0x17')](function(_0xac0cee){if(_0xac0cee){_0x471c3c=_0xac0cee;_0x4c80f8['model']=_[_0xb71a('0x2c')](db[_0xb71a('0x51')]['rawAttributes']);_0x4c80f8[_0xb71a('0x28')]=_[_0xb71a('0x2c')](_0x59e2a0['query']);_0x4c80f8[_0xb71a('0x2d')]=_[_0xb71a('0x2e')](_0x4c80f8[_0xb71a('0x2f')],_0x4c80f8[_0xb71a('0x28')]);_0x32e9e5[_0xb71a('0x30')]=_[_0xb71a('0x2e')](_0x4c80f8['model'],qs['fields'](_0x59e2a0[_0xb71a('0x28')][_0xb71a('0x31')]));_0x32e9e5[_0xb71a('0x30')]=_0x32e9e5['attributes'][_0xb71a('0x32')]?_0x32e9e5['attributes']:_0x4c80f8[_0xb71a('0x2f')];_0x32e9e5['order']=qs['sort'](_0x59e2a0[_0xb71a('0x28')][_0xb71a('0x45')]);_0x32e9e5[_0xb71a('0x26')]=qs[_0xb71a('0x2d')](_[_0xb71a('0x52')](_0x59e2a0['query'],_0x4c80f8[_0xb71a('0x2d')]));if(_0x59e2a0['query'][_0xb71a('0x48')]){_0x32e9e5[_0xb71a('0x26')]=_[_0xb71a('0x47')](_0x32e9e5['where'],{'$or':_['map'](_0x32e9e5[_0xb71a('0x30')],function(_0x39ee35){var _0x1a96fc={};_0x1a96fc[_0x39ee35]={'$like':'%'+_0x59e2a0[_0xb71a('0x28')][_0xb71a('0x48')]+'%'};return _0x1a96fc;})});}_0x32e9e5=_['merge']({},_0x32e9e5,_0x59e2a0[_0xb71a('0x34')]);return _0x471c3c[_0xb71a('0x50')](_0x32e9e5);}})[_0xb71a('0x17')](function(_0x2b32fc){if(_0x2b32fc){_0x73f725=_0x2b32fc[_0xb71a('0x32')];if(!_0x59e2a0['query']['hasOwnProperty'](_0xb71a('0x43'))){_0x32e9e5[_0xb71a('0x10')]=qs[_0xb71a('0x10')](_0x59e2a0[_0xb71a('0x28')][_0xb71a('0x10')]);_0x32e9e5[_0xb71a('0x13')]=qs[_0xb71a('0x13')](_0x59e2a0['query'][_0xb71a('0x13')]);}return _0x471c3c[_0xb71a('0x50')](_0x32e9e5);}})['then'](function(_0x3a21e2){if(_0x3a21e2){return _0x3a21e2?{'count':_0x73f725,'rows':_0x3a21e2}:null;}})[_0xb71a('0x17')](respondWithResult(_0x22146b,null))[_0xb71a('0x36')](handleError(_0x22146b,null));};exports['addTeams']=function(_0x6d255e,_0x1971ce){var _0x83cfaa=_0x6d255e['body'][_0xb71a('0x53')];return db[_0xb71a('0x51')][_0xb71a('0x54')]({'where':{'id':_0x83cfaa},'attributes':['id'],'include':[{'model':db[_0xb71a('0x55')],'as':_0xb71a('0x56'),'attributes':['id',_0xb71a('0x1d'),_0xb71a('0x57'),_0xb71a('0x58'),'interface'],'raw':!![]}]})[_0xb71a('0x17')](function(_0x507da4){if(_0x507da4){var _0x57896d=_[_0xb71a('0x59')](_0x507da4,function(_0x43e4b8){var _0x2cf441=_0x43e4b8[_0xb71a('0x19')]({'plain':!![]});return _0x2cf441['Agents'];});return db[_0xb71a('0x21')]['find']({'where':{'id':_0x6d255e[_0xb71a('0x2b')]['id']}})[_0xb71a('0x17')](function(_0x5e9964){return db[_0xb71a('0x5a')]['transaction'](function(_0x15995f){return _0x5e9964['addTeams'](_0x83cfaa,{'transaction':_0x15995f})[_0xb71a('0x17')](function(){return BPromise[_0xb71a('0x5b')](_0x57896d,function(_0x208585){return db[_0xb71a('0x41')]['findOrCreate']({'where':{'UserId':_0x208585['id'],'FaxQueueId':_0x6d255e[_0xb71a('0x2b')]['id']},'transaction':_0x15995f});});})[_0xb71a('0x17')](function(){_0x57896d['forEach'](function(_0x2c7157){socket['emit']('userFaxQueue:save',{'UserId':_0x2c7157['id'],'FaxQueueId':_0x5e9964['id']});});});});});}})['then'](respondWithStatusCode(_0x1971ce,null))['catch'](handleError(_0x1971ce,null));};exports[_0xb71a('0x5c')]=function(_0x1e27ff,_0xdda01d){return db['Team'][_0xb71a('0x54')]({'where':{'id':_0x1e27ff[_0xb71a('0x28')]['ids']},'attributes':['id'],'include':[{'model':db[_0xb71a('0x55')],'as':_0xb71a('0x56'),'attributes':['id'],'raw':!![]}]})[_0xb71a('0x17')](handleEntityNotFound(_0xdda01d,null))[_0xb71a('0x17')](function(_0x3209d3){var _0x16fbc1=_['map'](_0x3209d3,'id');var _0x456350=[];var _0x2772f8=[];var _0xf6a6ee=squel[_0xb71a('0x5d')]();_0xf6a6ee[_0xb71a('0x5e')](_0xb71a('0x5f'))['from'](_0xb71a('0x60'),'tq')[_0xb71a('0x61')]('user_has_teams','ut',_0xb71a('0x62'))[_0xb71a('0x26')](_0xb71a('0x63'),_0x1e27ff['params']['id']);for(var _0x3ab7f5=0x0;_0x3ab7f5<_0x3209d3[_0xb71a('0x32')];_0x3ab7f5+=0x1){let _0x28bc74=_0x3209d3[_0x3ab7f5];for(var _0x575a0a=0x0;_0x575a0a<_0x28bc74[_0xb71a('0x56')][_0xb71a('0x32')];_0x575a0a+=0x1){let _0x5c0fd6=_0x28bc74[_0xb71a('0x56')][_0x575a0a];var _0x3076c1=_0xf6a6ee[_0xb71a('0x64')]();_0x3076c1[_0xb71a('0x26')]('ut.UserId\x20=\x20?',_0x5c0fd6['id']);_0x2772f8[_0xb71a('0x65')](db[_0xb71a('0x5a')][_0xb71a('0x28')](_0x3076c1[_0xb71a('0x66')](),{'type':db['sequelize'][_0xb71a('0x67')][_0xb71a('0x68')]})['then'](function(_0x3c4d1b){if(_0x3c4d1b[_0xb71a('0x32')]===0x1){return _0x5c0fd6['id'];}else{var _0x5df234=_[_0xb71a('0x69')](_[_0xb71a('0x20')](_0x3c4d1b,_0xb71a('0x6a')),function(_0x572810){return _[_0xb71a('0x6b')](_0x16fbc1,_0x572810);});if(_0x5df234){return _0x5c0fd6['id'];}}}));}}return BPromise[_0xb71a('0x6c')](_0x2772f8)[_0xb71a('0x17')](function(_0xd5ff7b){_0x456350=_(_0x456350)[_0xb71a('0x6d')](_0xd5ff7b)[_0xb71a('0x6e')]()[_0xb71a('0x6f')]();return db[_0xb71a('0x21')][_0xb71a('0x35')]({'where':{'id':_0x1e27ff['params']['id']}})['then'](function(_0x36a75e){return db[_0xb71a('0x5a')][_0xb71a('0x70')](function(_0x1ee5d1){return _0x36a75e[_0xb71a('0x5c')](_0x1e27ff[_0xb71a('0x28')]['ids'],{'transaction':_0x1ee5d1})[_0xb71a('0x17')](function(){if(!_['isEmpty'](_0x456350)){return _0x36a75e[_0xb71a('0x71')](_0x456350,{'transaction':_0x1ee5d1});}})['then'](function(){_0x456350[_0xb71a('0x72')](function(_0x2b5ef8){socket['emit'](_0xb71a('0x73'),{'UserId':_0x2b5ef8,'FaxQueueId':_0x36a75e['id']});});});});});});})[_0xb71a('0x17')](respondWithStatusCode(_0xdda01d,null))[_0xb71a('0x36')](handleError(_0xdda01d,null));};exports[_0xb71a('0x74')]=function(_0x218517,_0x49146b){return db[_0xb71a('0x21')][_0xb71a('0x35')]({'where':{'id':_0x218517['params']['id']}})[_0xb71a('0x17')](handleEntityNotFound(_0x49146b,null))[_0xb71a('0x17')](function(_0x533316){if(_0x533316){return _0x533316[_0xb71a('0x74')](_0x218517[_0xb71a('0x38')][_0xb71a('0x53')],_['omit'](_0x218517[_0xb71a('0x38')],[_0xb71a('0x53'),'id'])||{})[_0xb71a('0x75')](function(_0x5f57da){for(var _0x13b3a8=0x0;_0x13b3a8<_0x218517[_0xb71a('0x38')][_0xb71a('0x53')][_0xb71a('0x32')];_0x13b3a8+=0x1){socket[_0xb71a('0x76')]('userFaxQueue:save',{'UserId':Number(_0x218517[_0xb71a('0x38')]['ids'][_0x13b3a8]),'FaxQueueId':Number(_0x218517[_0xb71a('0x2b')]['id'])});}return _0x5f57da;});}})[_0xb71a('0x17')](respondWithResult(_0x49146b,null))[_0xb71a('0x36')](handleError(_0x49146b,null));};exports['removeAgents']=function(_0x589618,_0x77dc7){return db[_0xb71a('0x21')][_0xb71a('0x35')]({'where':{'id':_0x589618[_0xb71a('0x2b')]['id']}})[_0xb71a('0x17')](handleEntityNotFound(_0x77dc7,null))[_0xb71a('0x17')](function(_0x38ffc1){if(_0x38ffc1){return _0x38ffc1[_0xb71a('0x71')](_0x589618[_0xb71a('0x28')][_0xb71a('0x53')])[_0xb71a('0x17')](function(){if(_[_0xb71a('0x77')](_0x589618[_0xb71a('0x28')][_0xb71a('0x53')])){for(var _0x464da5=0x0;_0x464da5<_0x589618['query'][_0xb71a('0x53')][_0xb71a('0x32')];_0x464da5+=0x1){socket[_0xb71a('0x76')]('userFaxQueue:remove',{'UserId':Number(_0x589618['query']['ids'][_0x464da5]),'FaxQueueId':Number(_0x589618[_0xb71a('0x2b')]['id'])});}}else{socket['emit'](_0xb71a('0x73'),{'UserId':Number(_0x589618[_0xb71a('0x28')]['ids']),'FaxQueueId':Number(_0x589618['params']['id'])});}});}})[_0xb71a('0x17')](respondWithStatusCode(_0x77dc7,null))[_0xb71a('0x36')](handleError(_0x77dc7,null));};exports[_0xb71a('0x78')]=function(_0x3d6d60,_0x3362be){var _0x86854b={};var _0x1afba9={};var _0x28d4cf;var _0x336d27;return db[_0xb71a('0x21')][_0xb71a('0x40')]({'where':{'id':_0x3d6d60[_0xb71a('0x2b')]['id']}})[_0xb71a('0x17')](handleEntityNotFound(_0x3362be,null))[_0xb71a('0x17')](function(_0x330ef2){if(_0x330ef2){_0x28d4cf=_0x330ef2;_0x1afba9[_0xb71a('0x2f')]=_[_0xb71a('0x2c')](db[_0xb71a('0x55')][_0xb71a('0x22')]);_0x1afba9[_0xb71a('0x28')]=_[_0xb71a('0x2c')](_0x3d6d60[_0xb71a('0x28')]);_0x1afba9['filters']=_[_0xb71a('0x2e')](_0x1afba9[_0xb71a('0x2f')],_0x1afba9[_0xb71a('0x28')]);_0x86854b[_0xb71a('0x30')]=_[_0xb71a('0x2e')](_0x1afba9[_0xb71a('0x2f')],qs[_0xb71a('0x31')](_0x3d6d60[_0xb71a('0x28')][_0xb71a('0x31')]));_0x86854b[_0xb71a('0x30')]=_0x86854b[_0xb71a('0x30')][_0xb71a('0x32')]?_0x86854b[_0xb71a('0x30')]:_0x1afba9[_0xb71a('0x2f')];_0x86854b[_0xb71a('0x44')]=qs[_0xb71a('0x45')](_0x3d6d60[_0xb71a('0x28')][_0xb71a('0x45')]);_0x86854b[_0xb71a('0x26')]=qs[_0xb71a('0x2d')](_['pick'](_0x3d6d60[_0xb71a('0x28')],_0x1afba9[_0xb71a('0x2d')]));if(_0x3d6d60[_0xb71a('0x28')][_0xb71a('0x48')]){_0x86854b[_0xb71a('0x26')]=_[_0xb71a('0x47')](_0x86854b[_0xb71a('0x26')],{'$or':_[_0xb71a('0x20')](_0x86854b['attributes'],function(_0x5e899b){var _0x1e5e4c={};_0x1e5e4c[_0x5e899b]={'$like':'%'+_0x3d6d60[_0xb71a('0x28')][_0xb71a('0x48')]+'%'};return _0x1e5e4c;})});}_0x86854b=_[_0xb71a('0x47')]({},_0x86854b,_0x3d6d60['options']);return _0x28d4cf[_0xb71a('0x78')](_0x86854b);}})[_0xb71a('0x17')](function(_0x46c2a1){if(_0x46c2a1){_0x336d27=_0x46c2a1[_0xb71a('0x32')];if(!_0x3d6d60[_0xb71a('0x28')][_0xb71a('0x42')](_0xb71a('0x43'))){_0x86854b['limit']=qs[_0xb71a('0x10')](_0x3d6d60[_0xb71a('0x28')][_0xb71a('0x10')]);_0x86854b['offset']=qs[_0xb71a('0x13')](_0x3d6d60[_0xb71a('0x28')][_0xb71a('0x13')]);}return _0x28d4cf['getAgents'](_0x86854b);}})[_0xb71a('0x17')](function(_0x398cda){if(_0x398cda){return _0x398cda?{'count':_0x336d27,'rows':_0x398cda}:null;}})[_0xb71a('0x17')](respondWithResult(_0x3362be,null))[_0xb71a('0x36')](handleError(_0x3362be,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index 3504331..476569f 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 _0x5f37=['events','../../mysqldb','FaxQueue','setMaxListeners','save','emit','hook','exports'];(function(_0x45313f,_0x46caf4){var _0x402910=function(_0x4883d8){while(--_0x4883d8){_0x45313f['push'](_0x45313f['shift']());}};_0x402910(++_0x46caf4);}(_0x5f37,0xe0));var _0x75f3=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x5f37[_0x2641f9];return _0x585741;};'use strict';var EventEmitter=require(_0x75f3('0x0'));var FaxQueue=require(_0x75f3('0x1'))['db'][_0x75f3('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x75f3('0x3')](0x0);var events={'afterCreate':_0x75f3('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x5ab3dc){return function(_0x5e6623,_0x131f12,_0xd4336a){FaxQueueEvents[_0x75f3('0x5')](_0x5ab3dc+':'+_0x5e6623['id'],_0x5e6623);FaxQueueEvents[_0x75f3('0x5')](_0x5ab3dc,_0x5e6623);_0xd4336a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxQueue[_0x75f3('0x6')](e,emitEvent(event));}}module[_0x75f3('0x7')]=FaxQueueEvents; \ No newline at end of file +var _0x1f10=['emit','hasOwnProperty','hook','../../mysqldb','FaxQueue','setMaxListeners','save'];(function(_0x4dc070,_0x44a160){var _0x408110=function(_0x964afc){while(--_0x964afc){_0x4dc070['push'](_0x4dc070['shift']());}};_0x408110(++_0x44a160);}(_0x1f10,0x1a0));var _0x01f1=function(_0x3e14b6,_0x25920d){_0x3e14b6=_0x3e14b6-0x0;var _0x4965b4=_0x1f10[_0x3e14b6];return _0x4965b4;};'use strict';var EventEmitter=require('events');var FaxQueue=require(_0x01f1('0x0'))['db'][_0x01f1('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x01f1('0x2')](0x0);var events={'afterCreate':_0x01f1('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x3cfeec){return function(_0x4166e0,_0x368b44,_0x129ece){FaxQueueEvents['emit'](_0x3cfeec+':'+_0x4166e0['id'],_0x4166e0);FaxQueueEvents[_0x01f1('0x4')](_0x3cfeec,_0x4166e0);_0x129ece(null);};}for(var e in events){if(events[_0x01f1('0x5')](e)){var event=events[e];FaxQueue[_0x01f1('0x6')](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 fa4cb37..d144f56 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 _0xad8b=['moment','bluebird','path','rimraf','../../config/environment','./faxQueue.attributes','FaxQueue','fax_queues','lodash','util','api'];(function(_0xe166e1,_0x4becb1){var _0x1b66f2=function(_0x354aaf){while(--_0x354aaf){_0xe166e1['push'](_0xe166e1['shift']());}};_0x1b66f2(++_0x4becb1);}(_0xad8b,0x8c));var _0xbad8=function(_0xaa431b,_0x35f040){_0xaa431b=_0xaa431b-0x0;var _0x30d808=_0xad8b[_0xaa431b];return _0x30d808;};'use strict';var _=require(_0xbad8('0x0'));var util=require(_0xbad8('0x1'));var logger=require('../../config/logger')(_0xbad8('0x2'));var moment=require(_0xbad8('0x3'));var BPromise=require(_0xbad8('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbad8('0x5'));var rimraf=require(_0xbad8('0x6'));var config=require(_0xbad8('0x7'));var attributes=require(_0xbad8('0x8'));module['exports']=function(_0x4ca6db,_0x388ada){return _0x4ca6db['define'](_0xbad8('0x9'),attributes,{'tableName':_0xbad8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x271c=['request-promise','rimraf','../../config/environment','./faxQueue.attributes','exports','define','fax_queues','lodash','util','../../config/logger','api','moment'];(function(_0x52f3b6,_0x57f15f){var _0x160c35=function(_0x30aad7){while(--_0x30aad7){_0x52f3b6['push'](_0x52f3b6['shift']());}};_0x160c35(++_0x57f15f);}(_0x271c,0x1ab));var _0xc271=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x271c[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0xc271('0x0'));var util=require(_0xc271('0x1'));var logger=require(_0xc271('0x2'))(_0xc271('0x3'));var moment=require(_0xc271('0x4'));var BPromise=require('bluebird');var rp=require(_0xc271('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc271('0x6'));var config=require(_0xc271('0x7'));var attributes=require(_0xc271('0x8'));module[_0xc271('0x9')]=function(_0x424fee,_0x3473c1){return _0x424fee[_0xc271('0xa')]('FaxQueue',attributes,{'tableName':_0xc271('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.rpc.js b/server/api/faxQueue/faxQueue.rpc.js index e29f05d..0203a7e 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 _0x5bfa=['./faxQueue.socket','request','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','GetFaxQueue','findAll','options','raw','where','attributes','limit','include','map','model','debug','find','ShowFaxQueue','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5bfa,0x138));var _0xa5bf=function(_0x5c768b,_0x5e88a6){_0x5c768b=_0x5c768b-0x0;var _0x335af8=_0x5bfa[_0x5c768b];return _0x335af8;};'use strict';var _=require(_0xa5bf('0x0'));var util=require(_0xa5bf('0x1'));var moment=require(_0xa5bf('0x2'));var BPromise=require(_0xa5bf('0x3'));var rs=require(_0xa5bf('0x4'));var fs=require('fs');var Redis=require(_0xa5bf('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xa5bf('0x6'));var logger=require(_0xa5bf('0x7'))(_0xa5bf('0x8'));var config=require(_0xa5bf('0x9'));var jayson=require(_0xa5bf('0xa'));var client=jayson[_0xa5bf('0xb')][_0xa5bf('0xc')]({'port':0x232a});config[_0xa5bf('0xd')]=_['defaults'](config[_0xa5bf('0xd')],{'host':_0xa5bf('0xe'),'port':0x18eb});var socket=require(_0xa5bf('0xf'))(new Redis(config[_0xa5bf('0xd')]));require(_0xa5bf('0x10'))['register'](socket);function respondWithRpcPromise(_0x299436,_0x2479ef,_0x528379){return new BPromise(function(_0x555e50,_0x2a3de1){return client[_0xa5bf('0x11')](_0x299436,_0x528379)[_0xa5bf('0x12')](function(_0x5c6616){logger[_0xa5bf('0x13')](_0xa5bf('0x14'),_0x2479ef,_0xa5bf('0x15'));logger['debug'](_0xa5bf('0x16'),_0x2479ef,_0xa5bf('0x15'),JSON[_0xa5bf('0x17')](_0x5c6616));if(_0x5c6616[_0xa5bf('0x18')]){if(_0x5c6616[_0xa5bf('0x18')][_0xa5bf('0x19')]===0x1f4){logger[_0xa5bf('0x18')]('FaxQueue,\x20%s,\x20%s',_0x2479ef,_0x5c6616[_0xa5bf('0x18')][_0xa5bf('0x1a')]);return _0x2a3de1(_0x5c6616[_0xa5bf('0x18')][_0xa5bf('0x1a')]);}logger['error'](_0xa5bf('0x14'),_0x2479ef,_0x5c6616[_0xa5bf('0x18')][_0xa5bf('0x1a')]);return _0x555e50(_0x5c6616[_0xa5bf('0x18')]['message']);}else{logger[_0xa5bf('0x13')]('FaxQueue,\x20%s,\x20%s',_0x2479ef,_0xa5bf('0x15'));_0x555e50(_0x5c6616['result'][_0xa5bf('0x1a')]);}})['catch'](function(_0x2d1ebe){logger[_0xa5bf('0x18')](_0xa5bf('0x14'),_0x2479ef,_0x2d1ebe);_0x2a3de1(_0x2d1ebe);});});}exports[_0xa5bf('0x1b')]=function(_0x5742ed){var _0x227726=this;return new Promise(function(_0x4c5add,_0x25c90c){return db['FaxQueue'][_0xa5bf('0x1c')]({'raw':_0x5742ed[_0xa5bf('0x1d')]?_0x5742ed[_0xa5bf('0x1d')][_0xa5bf('0x1e')]===undefined?!![]:![]:!![],'where':_0x5742ed[_0xa5bf('0x1d')]?_0x5742ed[_0xa5bf('0x1d')][_0xa5bf('0x1f')]||null:null,'attributes':_0x5742ed[_0xa5bf('0x1d')]?_0x5742ed[_0xa5bf('0x1d')][_0xa5bf('0x20')]||null:null,'limit':_0x5742ed['options']?_0x5742ed[_0xa5bf('0x1d')][_0xa5bf('0x21')]||null:null,'include':_0x5742ed[_0xa5bf('0x1d')]?_0x5742ed['options'][_0xa5bf('0x22')]?_[_0xa5bf('0x23')](_0x5742ed[_0xa5bf('0x1d')][_0xa5bf('0x22')],function(_0x2a65f5){return{'model':db[_0x2a65f5['model']],'as':_0x2a65f5['as'],'attributes':_0x2a65f5['attributes'],'include':_0x2a65f5[_0xa5bf('0x22')]?_['map'](_0x2a65f5[_0xa5bf('0x22')],function(_0x2a3fe0){return{'model':db[_0x2a3fe0['model']],'as':_0x2a3fe0['as'],'attributes':_0x2a3fe0[_0xa5bf('0x20')],'include':_0x2a3fe0[_0xa5bf('0x22')]?_[_0xa5bf('0x23')](_0x2a3fe0[_0xa5bf('0x22')],function(_0x4e980a){return{'model':db[_0x4e980a[_0xa5bf('0x24')]],'as':_0x4e980a['as'],'attributes':_0x4e980a[_0xa5bf('0x20')]};}):[]};}):[]};}):[]:[]})[_0xa5bf('0x12')](function(_0x4f7246){logger[_0xa5bf('0x13')]('GetFaxQueue',_0x5742ed);logger[_0xa5bf('0x25')](_0xa5bf('0x1b'),_0x5742ed,JSON[_0xa5bf('0x17')](_0x4f7246));_0x4c5add(_0x4f7246);})['catch'](function(_0xb18c5a){logger[_0xa5bf('0x18')](_0xa5bf('0x1b'),_0xb18c5a[_0xa5bf('0x1a')],_0x5742ed);_0x25c90c(_0x227726[_0xa5bf('0x18')](0x1f4,_0xb18c5a[_0xa5bf('0x1a')]));});});};exports['ShowFaxQueue']=function(_0x33997e){var _0x52178f=this;return new Promise(function(_0x26de7c,_0x2f8bb5){return db['FaxQueue'][_0xa5bf('0x26')]({'raw':_0x33997e[_0xa5bf('0x1d')]?_0x33997e[_0xa5bf('0x1d')][_0xa5bf('0x1e')]===undefined?!![]:![]:!![],'where':_0x33997e[_0xa5bf('0x1d')]?_0x33997e[_0xa5bf('0x1d')][_0xa5bf('0x1f')]||null:null,'attributes':_0x33997e[_0xa5bf('0x1d')]?_0x33997e[_0xa5bf('0x1d')][_0xa5bf('0x20')]||null:null,'include':_0x33997e[_0xa5bf('0x1d')]?_0x33997e['options'][_0xa5bf('0x22')]?_[_0xa5bf('0x23')](_0x33997e[_0xa5bf('0x1d')]['include'],function(_0x531414){return{'model':db[_0x531414[_0xa5bf('0x24')]],'as':_0x531414['as'],'attributes':_0x531414['attributes'],'include':_0x531414[_0xa5bf('0x22')]?_[_0xa5bf('0x23')](_0x531414[_0xa5bf('0x22')],function(_0xf69de3){return{'model':db[_0xf69de3['model']],'as':_0xf69de3['as'],'attributes':_0xf69de3[_0xa5bf('0x20')],'include':_0xf69de3[_0xa5bf('0x22')]?_['map'](_0xf69de3['include'],function(_0x29843d){return{'model':db[_0x29843d[_0xa5bf('0x24')]],'as':_0x29843d['as'],'attributes':_0x29843d[_0xa5bf('0x20')]};}):[]};}):[]};}):[]:[]})[_0xa5bf('0x12')](function(_0x472210){logger[_0xa5bf('0x13')](_0xa5bf('0x27'),_0x33997e);logger[_0xa5bf('0x25')]('ShowFaxQueue',_0x33997e,JSON[_0xa5bf('0x17')](_0x472210));_0x26de7c(_0x472210);})[_0xa5bf('0x28')](function(_0x5e532e){logger[_0xa5bf('0x18')](_0xa5bf('0x27'),_0x5e532e['message'],_0x33997e);_0x2f8bb5(_0x52178f[_0xa5bf('0x18')](0x1f4,_0x5e532e[_0xa5bf('0x1a')]));});});}; \ No newline at end of file +var _0x5ca2=['register','request','info','FaxQueue,\x20%s,\x20%s','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','GetFaxQueue','options','where','attributes','map','include','model','then','ShowFaxQueue','FaxQueue','raw','catch','util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./faxQueue.socket'];(function(_0x3c6da0,_0x32db08){var _0x1cb749=function(_0x113fa9){while(--_0x113fa9){_0x3c6da0['push'](_0x3c6da0['shift']());}};_0x1cb749(++_0x32db08);}(_0x5ca2,0xa6));var _0x25ca=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5ca2[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x25ca('0x0'));var moment=require('moment');var BPromise=require(_0x25ca('0x1'));var rs=require(_0x25ca('0x2'));var fs=require('fs');var Redis=require(_0x25ca('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x25ca('0x4'))(_0x25ca('0x5'));var config=require(_0x25ca('0x6'));var jayson=require(_0x25ca('0x7'));var client=jayson[_0x25ca('0x8')][_0x25ca('0x9')]({'port':0x232a});config[_0x25ca('0xa')]=_[_0x25ca('0xb')](config[_0x25ca('0xa')],{'host':_0x25ca('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x25ca('0xa')]));require(_0x25ca('0xd'))[_0x25ca('0xe')](socket);function respondWithRpcPromise(_0x205021,_0xf9b6c,_0x1bbb04){return new BPromise(function(_0xf820a2,_0x478474){return client[_0x25ca('0xf')](_0x205021,_0x1bbb04)['then'](function(_0x5eed8f){logger[_0x25ca('0x10')](_0x25ca('0x11'),_0xf9b6c,'request\x20sent');logger['debug'](_0x25ca('0x12'),_0xf9b6c,'request\x20sent',JSON[_0x25ca('0x13')](_0x5eed8f));if(_0x5eed8f[_0x25ca('0x14')]){if(_0x5eed8f['error'][_0x25ca('0x15')]===0x1f4){logger[_0x25ca('0x14')](_0x25ca('0x11'),_0xf9b6c,_0x5eed8f[_0x25ca('0x14')]['message']);return _0x478474(_0x5eed8f[_0x25ca('0x14')][_0x25ca('0x16')]);}logger[_0x25ca('0x14')](_0x25ca('0x11'),_0xf9b6c,_0x5eed8f['error'][_0x25ca('0x16')]);return _0xf820a2(_0x5eed8f[_0x25ca('0x14')][_0x25ca('0x16')]);}else{logger['info'](_0x25ca('0x11'),_0xf9b6c,_0x25ca('0x17'));_0xf820a2(_0x5eed8f['result'][_0x25ca('0x16')]);}})['catch'](function(_0x1ed1b4){logger[_0x25ca('0x14')](_0x25ca('0x11'),_0xf9b6c,_0x1ed1b4);_0x478474(_0x1ed1b4);});});}exports[_0x25ca('0x18')]=function(_0x48f216){var _0xf61eca=this;return new Promise(function(_0x42ca1d,_0x5be915){return db['FaxQueue']['findAll']({'raw':_0x48f216['options']?_0x48f216['options']['raw']===undefined?!![]:![]:!![],'where':_0x48f216[_0x25ca('0x19')]?_0x48f216[_0x25ca('0x19')][_0x25ca('0x1a')]||null:null,'attributes':_0x48f216[_0x25ca('0x19')]?_0x48f216[_0x25ca('0x19')][_0x25ca('0x1b')]||null:null,'limit':_0x48f216[_0x25ca('0x19')]?_0x48f216['options']['limit']||null:null,'include':_0x48f216[_0x25ca('0x19')]?_0x48f216[_0x25ca('0x19')]['include']?_[_0x25ca('0x1c')](_0x48f216['options']['include'],function(_0x37ca68){return{'model':db[_0x37ca68['model']],'as':_0x37ca68['as'],'attributes':_0x37ca68[_0x25ca('0x1b')],'include':_0x37ca68[_0x25ca('0x1d')]?_['map'](_0x37ca68[_0x25ca('0x1d')],function(_0x554951){return{'model':db[_0x554951[_0x25ca('0x1e')]],'as':_0x554951['as'],'attributes':_0x554951[_0x25ca('0x1b')],'include':_0x554951[_0x25ca('0x1d')]?_[_0x25ca('0x1c')](_0x554951['include'],function(_0x17dbb9){return{'model':db[_0x17dbb9['model']],'as':_0x17dbb9['as'],'attributes':_0x17dbb9[_0x25ca('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x25ca('0x1f')](function(_0x16c68e){logger[_0x25ca('0x10')](_0x25ca('0x18'),_0x48f216);logger['debug'](_0x25ca('0x18'),_0x48f216,JSON[_0x25ca('0x13')](_0x16c68e));_0x42ca1d(_0x16c68e);})['catch'](function(_0x5ee10d){logger[_0x25ca('0x14')](_0x25ca('0x18'),_0x5ee10d[_0x25ca('0x16')],_0x48f216);_0x5be915(_0xf61eca[_0x25ca('0x14')](0x1f4,_0x5ee10d[_0x25ca('0x16')]));});});};exports[_0x25ca('0x20')]=function(_0x4d26f1){var _0x3d123e=this;return new Promise(function(_0x2f6ab5,_0x486c21){return db[_0x25ca('0x21')]['find']({'raw':_0x4d26f1[_0x25ca('0x19')]?_0x4d26f1[_0x25ca('0x19')][_0x25ca('0x22')]===undefined?!![]:![]:!![],'where':_0x4d26f1[_0x25ca('0x19')]?_0x4d26f1[_0x25ca('0x19')]['where']||null:null,'attributes':_0x4d26f1[_0x25ca('0x19')]?_0x4d26f1[_0x25ca('0x19')][_0x25ca('0x1b')]||null:null,'include':_0x4d26f1[_0x25ca('0x19')]?_0x4d26f1['options'][_0x25ca('0x1d')]?_[_0x25ca('0x1c')](_0x4d26f1['options'][_0x25ca('0x1d')],function(_0x3d397f){return{'model':db[_0x3d397f[_0x25ca('0x1e')]],'as':_0x3d397f['as'],'attributes':_0x3d397f[_0x25ca('0x1b')],'include':_0x3d397f[_0x25ca('0x1d')]?_[_0x25ca('0x1c')](_0x3d397f[_0x25ca('0x1d')],function(_0x1efd6c){return{'model':db[_0x1efd6c[_0x25ca('0x1e')]],'as':_0x1efd6c['as'],'attributes':_0x1efd6c['attributes'],'include':_0x1efd6c[_0x25ca('0x1d')]?_['map'](_0x1efd6c['include'],function(_0x111219){return{'model':db[_0x111219[_0x25ca('0x1e')]],'as':_0x111219['as'],'attributes':_0x111219[_0x25ca('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x19d7d){logger[_0x25ca('0x10')]('ShowFaxQueue',_0x4d26f1);logger['debug'](_0x25ca('0x20'),_0x4d26f1,JSON['stringify'](_0x19d7d));_0x2f6ab5(_0x19d7d);})[_0x25ca('0x23')](function(_0x23949d){logger[_0x25ca('0x14')](_0x25ca('0x20'),_0x23949d[_0x25ca('0x16')],_0x4d26f1);_0x486c21(_0x3d123e['error'](0x1f4,_0x23949d[_0x25ca('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index c75abbf..3163f36 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 _0xc628=['emit','removeListener','register','length','./faxQueue.events','save','remove'];(function(_0x390e6c,_0x4d7d42){var _0x596b05=function(_0xe6d4aa){while(--_0xe6d4aa){_0x390e6c['push'](_0x390e6c['shift']());}};_0x596b05(++_0x4d7d42);}(_0xc628,0x6d));var _0x8c62=function(_0xa6953d,_0x3cdd33){_0xa6953d=_0xa6953d-0x0;var _0x381ccc=_0xc628[_0xa6953d];return _0x381ccc;};'use strict';var FaxQueueEvents=require(_0x8c62('0x0'));var events=[_0x8c62('0x1'),_0x8c62('0x2'),'update'];function createListener(_0x150fb8,_0x3cab01){return function(_0x15dc5f){_0x3cab01[_0x8c62('0x3')](_0x150fb8,_0x15dc5f);};}function removeListener(_0x249544,_0xe09324){return function(){FaxQueueEvents[_0x8c62('0x4')](_0x249544,_0xe09324);};}exports[_0x8c62('0x5')]=function(_0x4cdc3b){for(var _0x375825=0x0,_0x4f623d=events[_0x8c62('0x6')];_0x375825<_0x4f623d;_0x375825++){var _0x1a1874=events[_0x375825];var _0x42ead3=createListener('faxQueue:'+_0x1a1874,_0x4cdc3b);FaxQueueEvents['on'](_0x1a1874,_0x42ead3);}}; \ No newline at end of file +var _0xc387=['removeListener','register','length','./faxQueue.events','save','remove','emit'];(function(_0x1ffd62,_0x29a335){var _0x21ee6c=function(_0x5da8ec){while(--_0x5da8ec){_0x1ffd62['push'](_0x1ffd62['shift']());}};_0x21ee6c(++_0x29a335);}(_0xc387,0x168));var _0x7c38=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xc387[_0x14add3];return _0x4a174f;};'use strict';var FaxQueueEvents=require(_0x7c38('0x0'));var events=[_0x7c38('0x1'),_0x7c38('0x2'),'update'];function createListener(_0x310aa0,_0x14feee){return function(_0x299afe){_0x14feee[_0x7c38('0x3')](_0x310aa0,_0x299afe);};}function removeListener(_0x5c1d00,_0x4bd971){return function(){FaxQueueEvents[_0x7c38('0x4')](_0x5c1d00,_0x4bd971);};}exports[_0x7c38('0x5')]=function(_0x1b5151){for(var _0x1636a0=0x0,_0x5e32cd=events[_0x7c38('0x6')];_0x1636a0<_0x5e32cd;_0x1636a0++){var _0x2c5a0b=events[_0x1636a0];var _0x7a57e7=createListener('faxQueue:'+_0x2c5a0b,_0x1b5151);FaxQueueEvents['on'](_0x2c5a0b,_0x7a57e7);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index ae87ee5..79e4349 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 _0x6363=['../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getAgents','post','create','addTeams','/:id/users','addAgents','put','update','delete','removeTeams','removeAgents','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x398294,_0x5ceb9d){var _0x2a872d=function(_0x390883){while(--_0x390883){_0x398294['push'](_0x398294['shift']());}};_0x2a872d(++_0x5ceb9d);}(_0x6363,0x13a));var _0x3636=function(_0x57fc27,_0x5e4d8b){_0x57fc27=_0x57fc27-0x0;var _0x44d5b8=_0x6363[_0x57fc27];return _0x44d5b8;};'use strict';var multer=require(_0x3636('0x0'));var util=require('util');var path=require(_0x3636('0x1'));var timeout=require(_0x3636('0x2'));var express=require(_0x3636('0x3'));var router=express[_0x3636('0x4')]();var fs_extra=require(_0x3636('0x5'));var auth=require(_0x3636('0x6'));var interaction=require(_0x3636('0x7'));var config=require(_0x3636('0x8'));var controller=require(_0x3636('0x9'));router[_0x3636('0xa')]('/',auth[_0x3636('0xb')](),controller[_0x3636('0xc')]);router[_0x3636('0xa')](_0x3636('0xd'),auth['isAuthenticated'](),controller[_0x3636('0xe')]);router['get'](_0x3636('0xf'),auth[_0x3636('0xb')](),controller[_0x3636('0x10')]);router[_0x3636('0xa')](_0x3636('0x11'),auth[_0x3636('0xb')](),controller[_0x3636('0x12')]);router[_0x3636('0xa')](_0x3636('0x13'),auth['isAuthenticated'](),controller['getTeams']);router[_0x3636('0xa')]('/:id/users',auth[_0x3636('0xb')](),controller[_0x3636('0x14')]);router[_0x3636('0x15')]('/',auth[_0x3636('0xb')](),controller[_0x3636('0x16')]);router[_0x3636('0x15')](_0x3636('0x13'),auth[_0x3636('0xb')](),controller[_0x3636('0x17')]);router[_0x3636('0x15')](_0x3636('0x18'),auth[_0x3636('0xb')](),controller[_0x3636('0x19')]);router[_0x3636('0x1a')](_0x3636('0xf'),auth[_0x3636('0xb')](),controller[_0x3636('0x1b')]);router['delete'](_0x3636('0xf'),auth[_0x3636('0xb')](),controller['destroy']);router[_0x3636('0x1c')]('/:id/teams',auth['isAuthenticated'](),controller[_0x3636('0x1d')]);router[_0x3636('0x1c')](_0x3636('0x18'),auth[_0x3636('0xb')](),controller[_0x3636('0x1e')]);module[_0x3636('0x1f')]=router; \ No newline at end of file +var _0x524e=['isAuthenticated','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','create','post','addAgents','update','removeTeams','delete','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueue.controller','get','index','/describe','describe','/:id'];(function(_0x4c5fa3,_0x5f48d8){var _0x3486cd=function(_0x2b2ea3){while(--_0x2b2ea3){_0x4c5fa3['push'](_0x4c5fa3['shift']());}};_0x3486cd(++_0x5f48d8);}(_0x524e,0x15e));var _0xe524=function(_0x7bff2f,_0x5b07be){_0x7bff2f=_0x7bff2f-0x0;var _0x12c445=_0x524e[_0x7bff2f];return _0x12c445;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe524('0x0'));var timeout=require(_0xe524('0x1'));var express=require(_0xe524('0x2'));var router=express[_0xe524('0x3')]();var fs_extra=require(_0xe524('0x4'));var auth=require(_0xe524('0x5'));var interaction=require(_0xe524('0x6'));var config=require(_0xe524('0x7'));var controller=require(_0xe524('0x8'));router[_0xe524('0x9')]('/',auth['isAuthenticated'](),controller[_0xe524('0xa')]);router[_0xe524('0x9')](_0xe524('0xb'),auth['isAuthenticated'](),controller[_0xe524('0xc')]);router[_0xe524('0x9')](_0xe524('0xd'),auth[_0xe524('0xe')](),controller[_0xe524('0xf')]);router[_0xe524('0x9')](_0xe524('0x10'),auth[_0xe524('0xe')](),controller[_0xe524('0x11')]);router[_0xe524('0x9')](_0xe524('0x12'),auth[_0xe524('0xe')](),controller[_0xe524('0x13')]);router[_0xe524('0x9')](_0xe524('0x14'),auth[_0xe524('0xe')](),controller['getAgents']);router['post']('/',auth[_0xe524('0xe')](),controller[_0xe524('0x15')]);router[_0xe524('0x16')](_0xe524('0x12'),auth[_0xe524('0xe')](),controller['addTeams']);router[_0xe524('0x16')]('/:id/users',auth[_0xe524('0xe')](),controller[_0xe524('0x17')]);router['put'](_0xe524('0xd'),auth['isAuthenticated'](),controller[_0xe524('0x18')]);router['delete'](_0xe524('0xd'),auth['isAuthenticated'](),controller['destroy']);router['delete'](_0xe524('0x12'),auth['isAuthenticated'](),controller[_0xe524('0x19')]);router[_0xe524('0x1a')](_0xe524('0x14'),auth[_0xe524('0xe')](),controller['removeAgents']);module[_0xe524('0x1b')]=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index 90c4f8a..d17c0f1 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 _0xc7b9=['moment','sequelize','exports','STRING','DATE'];(function(_0x40ac5e,_0x2de228){var _0x2839d6=function(_0x123d47){while(--_0x123d47){_0x40ac5e['push'](_0x40ac5e['shift']());}};_0x2839d6(++_0x2de228);}(_0xc7b9,0x1b3));var _0x9c7b=function(_0x272bae,_0x5acf53){_0x272bae=_0x272bae-0x0;var _0x322f77=_0xc7b9[_0x272bae];return _0x322f77;};'use strict';var moment=require(_0x9c7b('0x0'));var Sequelize=require(_0x9c7b('0x1'));module[_0x9c7b('0x2')]={'uniqueid':{'type':Sequelize[_0x9c7b('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x9c7b('0x3')]},'joinAt':{'type':Sequelize[_0x9c7b('0x4')]},'leaveAt':{'type':Sequelize[_0x9c7b('0x4')]},'acceptAt':{'type':Sequelize[_0x9c7b('0x4')]},'exitAt':{'type':Sequelize[_0x9c7b('0x4')]},'reason':{'type':Sequelize[_0x9c7b('0x3')]}}; \ No newline at end of file +var _0x8077=['STRING','DATE','moment','sequelize','exports'];(function(_0x55a9c2,_0x126ee9){var _0x1fc7ad=function(_0x5dba9d){while(--_0x5dba9d){_0x55a9c2['push'](_0x55a9c2['shift']());}};_0x1fc7ad(++_0x126ee9);}(_0x8077,0x133));var _0x7807=function(_0x5de8cf,_0x11c0af){_0x5de8cf=_0x5de8cf-0x0;var _0x24ca2f=_0x8077[_0x5de8cf];return _0x24ca2f;};'use strict';var moment=require(_0x7807('0x0'));var Sequelize=require(_0x7807('0x1'));module[_0x7807('0x2')]={'uniqueid':{'type':Sequelize[_0x7807('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x7807('0x3')]},'joinAt':{'type':Sequelize[_0x7807('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x7807('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x7807('0x3')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index d3195b4..d6459cd 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 _0xcd4e=['Content-Range','apply','save','update','destroy','then','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','rows','catch','show','params','keys','FaxQueueReport','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','sendStatus','status','json','undefined','limit','count','offset','set'];(function(_0x405832,_0x10f728){var _0x138aab=function(_0x5d3759){while(--_0x5d3759){_0x405832['push'](_0x405832['shift']());}};_0x138aab(++_0x10f728);}(_0xcd4e,0x187));var _0xecd4=function(_0x3c02af,_0x168cf2){_0x3c02af=_0x3c02af-0x0;var _0x1bd9e6=_0xcd4e[_0x3c02af];return _0x1bd9e6;};'use strict';var emlformat=require(_0xecd4('0x0'));var rimraf=require(_0xecd4('0x1'));var zipdir=require(_0xecd4('0x2'));var jsonpatch=require(_0xecd4('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xecd4('0x4'));var Mustache=require(_0xecd4('0x5'));var util=require('util');var path=require(_0xecd4('0x6'));var sox=require('sox');var csv=require(_0xecd4('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xecd4('0x8'));var _=require(_0xecd4('0x9'));var squel=require(_0xecd4('0xa'));var crypto=require(_0xecd4('0xb'));var jsforce=require(_0xecd4('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xecd4('0x7'));var querystring=require(_0xecd4('0xd'));var Papa=require('papaparse');var Redis=require(_0xecd4('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xecd4('0xf'));var as=require(_0xecd4('0x10'));var hardwareService=require(_0xecd4('0x11'));var logger=require('../../config/logger')(_0xecd4('0x12'));var utils=require(_0xecd4('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xecd4('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3ccd07,_0x1a5f58){_0x1a5f58=_0x1a5f58||0xcc;return function(_0x425de2){if(_0x425de2){return _0x3ccd07[_0xecd4('0x15')](_0x1a5f58);}return _0x3ccd07[_0xecd4('0x16')](_0x1a5f58)['end']();};}function respondWithResult(_0x3645d1,_0x21cb7b){_0x21cb7b=_0x21cb7b||0xc8;return function(_0x15dddc){if(_0x15dddc){return _0x3645d1[_0xecd4('0x16')](_0x21cb7b)[_0xecd4('0x17')](_0x15dddc);}};}function respondWithFilteredResult(_0x1b69a2,_0x2add6f){return function(_0x39d681){if(_0x39d681){var _0x1fb460=typeof _0x2add6f['offset']===_0xecd4('0x18')&&typeof _0x2add6f[_0xecd4('0x19')]===_0xecd4('0x18');var _0x2b542c=_0x39d681[_0xecd4('0x1a')];var _0x2470ec=_0x1fb460?0x0:_0x2add6f['offset'];var _0x703bb4=_0x1fb460?_0x39d681['count']:_0x2add6f[_0xecd4('0x1b')]+_0x2add6f[_0xecd4('0x19')];var _0x38eb18;if(_0x703bb4>=_0x2b542c){_0x703bb4=_0x2b542c;_0x38eb18=0xc8;}else{_0x38eb18=0xce;}_0x1b69a2[_0xecd4('0x16')](_0x38eb18);return _0x1b69a2[_0xecd4('0x1c')](_0xecd4('0x1d'),_0x2470ec+'-'+_0x703bb4+'/'+_0x2b542c)[_0xecd4('0x17')](_0x39d681);}return null;};}function patchUpdates(_0x26bb76){return function(_0x21d7d1){try{jsonpatch[_0xecd4('0x1e')](_0x21d7d1,_0x26bb76,!![]);}catch(_0x14d24c){return BPromise['reject'](_0x14d24c);}return _0x21d7d1[_0xecd4('0x1f')]();};}function saveUpdates(_0x353f13,_0x269451){return function(_0x588f0b){if(_0x588f0b){return _0x588f0b[_0xecd4('0x20')](_0x353f13)['then'](function(_0x57ae55){return _0x57ae55;});}return null;};}function removeEntity(_0x2e5a0a,_0x11c791){return function(_0x104507){if(_0x104507){return _0x104507[_0xecd4('0x21')]()[_0xecd4('0x22')](function(){_0x2e5a0a[_0xecd4('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2910e1,_0x38b6da){return function(_0x1b76d7){if(!_0x1b76d7){_0x2910e1['sendStatus'](0x194);}return _0x1b76d7;};}function handleError(_0x2d0a43,_0x3941d4){_0x3941d4=_0x3941d4||0x1f4;return function(_0x3ccb67){logger['error'](_0x3ccb67[_0xecd4('0x23')]);if(_0x3ccb67[_0xecd4('0x24')]){delete _0x3ccb67['name'];}_0x2d0a43[_0xecd4('0x16')](_0x3941d4)['send'](_0x3ccb67);};}exports[_0xecd4('0x25')]=function(_0x40b76f,_0x40d0a2){var _0x5e509a={},_0x3b1ef0={},_0x48e059={'count':0x0,'rows':[]};var _0x220ec5=_[_0xecd4('0x26')](db['FaxQueueReport'][_0xecd4('0x27')],function(_0x46696e){return{'name':_0x46696e[_0xecd4('0x28')],'type':_0x46696e[_0xecd4('0x29')][_0xecd4('0x2a')]};});_0x3b1ef0[_0xecd4('0x2b')]=_['map'](_0x220ec5,_0xecd4('0x24'));_0x3b1ef0[_0xecd4('0x2c')]=_['keys'](_0x40b76f[_0xecd4('0x2c')]);_0x3b1ef0[_0xecd4('0x2d')]=_['intersection'](_0x3b1ef0[_0xecd4('0x2b')],_0x3b1ef0[_0xecd4('0x2c')]);_0x5e509a[_0xecd4('0x2e')]=_[_0xecd4('0x2f')](_0x3b1ef0[_0xecd4('0x2b')],qs[_0xecd4('0x30')](_0x40b76f[_0xecd4('0x2c')][_0xecd4('0x30')]));_0x5e509a[_0xecd4('0x2e')]=_0x5e509a['attributes'][_0xecd4('0x31')]?_0x5e509a[_0xecd4('0x2e')]:_0x3b1ef0[_0xecd4('0x2b')];if(!_0x40b76f['query'][_0xecd4('0x32')](_0xecd4('0x33'))){_0x5e509a['limit']=qs['limit'](_0x40b76f[_0xecd4('0x2c')]['limit']);_0x5e509a['offset']=qs[_0xecd4('0x1b')](_0x40b76f[_0xecd4('0x2c')][_0xecd4('0x1b')]);}_0x5e509a['order']=qs['sort'](_0x40b76f[_0xecd4('0x2c')][_0xecd4('0x34')]);_0x5e509a[_0xecd4('0x35')]=qs[_0xecd4('0x2d')](_[_0xecd4('0x36')](_0x40b76f[_0xecd4('0x2c')],_0x3b1ef0['filters']),_0x220ec5);if(_0x40b76f['query'][_0xecd4('0x37')]){_0x5e509a[_0xecd4('0x35')]=_['merge'](_0x5e509a[_0xecd4('0x35')],{'$or':_[_0xecd4('0x26')](_0x220ec5,function(_0x43c32d){if(_0x43c32d[_0xecd4('0x29')]!=='VIRTUAL'){var _0x4794fa={};_0x4794fa[_0x43c32d[_0xecd4('0x24')]]={'$like':'%'+_0x40b76f[_0xecd4('0x2c')][_0xecd4('0x37')]+'%'};return _0x4794fa;}})});}_0x5e509a=_[_0xecd4('0x38')]({},_0x5e509a,_0x40b76f[_0xecd4('0x39')]);var _0x32c1db={'where':_0x5e509a['where']};return db['FaxQueueReport']['count'](_0x32c1db)[_0xecd4('0x22')](function(_0x4a0009){_0x48e059[_0xecd4('0x1a')]=_0x4a0009;if(_0x40b76f['query'][_0xecd4('0x3a')]){_0x5e509a[_0xecd4('0x3b')]=[{'all':!![]}];}return db['FaxQueueReport']['findAll'](_0x5e509a);})[_0xecd4('0x22')](function(_0x107dcb){_0x48e059[_0xecd4('0x3c')]=_0x107dcb;return _0x48e059;})['then'](respondWithFilteredResult(_0x40d0a2,_0x5e509a))[_0xecd4('0x3d')](handleError(_0x40d0a2,null));};exports[_0xecd4('0x3e')]=function(_0xbf419,_0x4aaf66){var _0x256612={'raw':!![],'where':{'id':_0xbf419[_0xecd4('0x3f')]['id']}},_0xd732a1={};_0xd732a1[_0xecd4('0x2b')]=_[_0xecd4('0x40')](db[_0xecd4('0x41')]['rawAttributes']);_0xd732a1[_0xecd4('0x2c')]=_[_0xecd4('0x40')](_0xbf419[_0xecd4('0x2c')]);_0xd732a1['filters']=_[_0xecd4('0x2f')](_0xd732a1[_0xecd4('0x2b')],_0xd732a1['query']);_0x256612[_0xecd4('0x2e')]=_['intersection'](_0xd732a1[_0xecd4('0x2b')],qs[_0xecd4('0x30')](_0xbf419[_0xecd4('0x2c')][_0xecd4('0x30')]));_0x256612[_0xecd4('0x2e')]=_0x256612[_0xecd4('0x2e')][_0xecd4('0x31')]?_0x256612[_0xecd4('0x2e')]:_0xd732a1['model'];if(_0xbf419['query'][_0xecd4('0x3a')]){_0x256612[_0xecd4('0x3b')]=[{'all':!![]}];}_0x256612=_[_0xecd4('0x38')]({},_0x256612,_0xbf419[_0xecd4('0x39')]);return db[_0xecd4('0x41')][_0xecd4('0x42')](_0x256612)[_0xecd4('0x22')](handleEntityNotFound(_0x4aaf66,null))[_0xecd4('0x22')](respondWithResult(_0x4aaf66,null))[_0xecd4('0x3d')](handleError(_0x4aaf66,null));};exports[_0xecd4('0x43')]=function(_0x1a29a,_0x234b0a){return db['FaxQueueReport']['create'](_0x1a29a[_0xecd4('0x44')],{})[_0xecd4('0x22')](respondWithResult(_0x234b0a,0xc9))[_0xecd4('0x3d')](handleError(_0x234b0a,null));};exports[_0xecd4('0x20')]=function(_0x161ec3,_0x34d09a){if(_0x161ec3[_0xecd4('0x44')]['id']){delete _0x161ec3[_0xecd4('0x44')]['id'];}return db[_0xecd4('0x41')]['find']({'where':{'id':_0x161ec3['params']['id']}})[_0xecd4('0x22')](handleEntityNotFound(_0x34d09a,null))[_0xecd4('0x22')](saveUpdates(_0x161ec3[_0xecd4('0x44')],null))[_0xecd4('0x22')](respondWithResult(_0x34d09a,null))[_0xecd4('0x3d')](handleError(_0x34d09a,null));};exports['destroy']=function(_0x3f5f8c,_0x247ab5){return db[_0xecd4('0x41')][_0xecd4('0x42')]({'where':{'id':_0x3f5f8c[_0xecd4('0x3f')]['id']}})['then'](handleEntityNotFound(_0x247ab5,null))['then'](removeEntity(_0x247ab5,null))['catch'](handleError(_0x247ab5,null));};exports['describe']=function(_0x2f50bc,_0x5c45c8){return db[_0xecd4('0x41')][_0xecd4('0x45')]()[_0xecd4('0x22')](respondWithResult(_0x5c45c8,null))[_0xecd4('0x3d')](handleError(_0x5c45c8,null));}; \ No newline at end of file +var _0xb75c=['Content-Range','json','apply','save','then','destroy','error','stack','name','send','index','map','FaxQueueReport','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','create','body','catch','find','describe','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','sox','fs-extra','lodash','squel','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xb75c,0x1ce));var _0xcb75=function(_0x551d54,_0x1db9e6){_0x551d54=_0x551d54-0x0;var _0x4a63e0=_0xb75c[_0x551d54];return _0x4a63e0;};'use strict';var emlformat=require(_0xcb75('0x0'));var rimraf=require(_0xcb75('0x1'));var zipdir=require(_0xcb75('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcb75('0x3'));var moment=require('moment');var BPromise=require(_0xcb75('0x4'));var Mustache=require(_0xcb75('0x5'));var util=require(_0xcb75('0x6'));var path=require('path');var sox=require(_0xcb75('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcb75('0x8'));var _=require(_0xcb75('0x9'));var squel=require(_0xcb75('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xcb75('0xb'));var querystring=require(_0xcb75('0xc'));var Papa=require(_0xcb75('0xd'));var Redis=require('ioredis');var authService=require(_0xcb75('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xcb75('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcb75('0x10'))('api');var utils=require(_0xcb75('0x11'));var config=require(_0xcb75('0x12'));var licenseUtil=require(_0xcb75('0x13'));var db=require(_0xcb75('0x14'))['db'];function respondWithStatusCode(_0x526c03,_0x1e0bba){_0x1e0bba=_0x1e0bba||0xcc;return function(_0x13c953){if(_0x13c953){return _0x526c03[_0xcb75('0x15')](_0x1e0bba);}return _0x526c03[_0xcb75('0x16')](_0x1e0bba)[_0xcb75('0x17')]();};}function respondWithResult(_0x3ae629,_0x23c719){_0x23c719=_0x23c719||0xc8;return function(_0x2c14a1){if(_0x2c14a1){return _0x3ae629['status'](_0x23c719)['json'](_0x2c14a1);}};}function respondWithFilteredResult(_0xa0ce25,_0x1af8c1){return function(_0x589afc){if(_0x589afc){var _0x1b9765=typeof _0x1af8c1[_0xcb75('0x18')]==='undefined'&&typeof _0x1af8c1[_0xcb75('0x19')]===_0xcb75('0x1a');var _0x1a0413=_0x589afc[_0xcb75('0x1b')];var _0x57ad84=_0x1b9765?0x0:_0x1af8c1[_0xcb75('0x18')];var _0x32a66f=_0x1b9765?_0x589afc['count']:_0x1af8c1[_0xcb75('0x18')]+_0x1af8c1[_0xcb75('0x19')];var _0x6be8f0;if(_0x32a66f>=_0x1a0413){_0x32a66f=_0x1a0413;_0x6be8f0=0xc8;}else{_0x6be8f0=0xce;}_0xa0ce25[_0xcb75('0x16')](_0x6be8f0);return _0xa0ce25['set'](_0xcb75('0x1c'),_0x57ad84+'-'+_0x32a66f+'/'+_0x1a0413)[_0xcb75('0x1d')](_0x589afc);}return null;};}function patchUpdates(_0x14bba7){return function(_0x2489e9){try{jsonpatch[_0xcb75('0x1e')](_0x2489e9,_0x14bba7,!![]);}catch(_0x232c57){return BPromise['reject'](_0x232c57);}return _0x2489e9[_0xcb75('0x1f')]();};}function saveUpdates(_0x4ca28b,_0x265cf2){return function(_0x78e743){if(_0x78e743){return _0x78e743['update'](_0x4ca28b)[_0xcb75('0x20')](function(_0x1a7154){return _0x1a7154;});}return null;};}function removeEntity(_0x5b0874,_0x29a56e){return function(_0x338222){if(_0x338222){return _0x338222[_0xcb75('0x21')]()[_0xcb75('0x20')](function(){_0x5b0874[_0xcb75('0x16')](0xcc)[_0xcb75('0x17')]();});}};}function handleEntityNotFound(_0x1f6df6,_0x5a61dd){return function(_0x263d46){if(!_0x263d46){_0x1f6df6[_0xcb75('0x15')](0x194);}return _0x263d46;};}function handleError(_0x501dcf,_0x417342){_0x417342=_0x417342||0x1f4;return function(_0x37928b){logger[_0xcb75('0x22')](_0x37928b[_0xcb75('0x23')]);if(_0x37928b[_0xcb75('0x24')]){delete _0x37928b[_0xcb75('0x24')];}_0x501dcf[_0xcb75('0x16')](_0x417342)[_0xcb75('0x25')](_0x37928b);};}exports[_0xcb75('0x26')]=function(_0x54d718,_0x1bcf39){var _0x41e5fe={},_0x567087={},_0x153370={'count':0x0,'rows':[]};var _0x1b5c0d=_[_0xcb75('0x27')](db[_0xcb75('0x28')][_0xcb75('0x29')],function(_0x4bd240){return{'name':_0x4bd240['fieldName'],'type':_0x4bd240['type']['key']};});_0x567087[_0xcb75('0x2a')]=_['map'](_0x1b5c0d,_0xcb75('0x24'));_0x567087['query']=_[_0xcb75('0x2b')](_0x54d718[_0xcb75('0x2c')]);_0x567087[_0xcb75('0x2d')]=_['intersection'](_0x567087['model'],_0x567087[_0xcb75('0x2c')]);_0x41e5fe[_0xcb75('0x2e')]=_[_0xcb75('0x2f')](_0x567087[_0xcb75('0x2a')],qs[_0xcb75('0x30')](_0x54d718[_0xcb75('0x2c')][_0xcb75('0x30')]));_0x41e5fe[_0xcb75('0x2e')]=_0x41e5fe[_0xcb75('0x2e')][_0xcb75('0x31')]?_0x41e5fe[_0xcb75('0x2e')]:_0x567087[_0xcb75('0x2a')];if(!_0x54d718['query'][_0xcb75('0x32')](_0xcb75('0x33'))){_0x41e5fe['limit']=qs[_0xcb75('0x19')](_0x54d718[_0xcb75('0x2c')][_0xcb75('0x19')]);_0x41e5fe['offset']=qs['offset'](_0x54d718[_0xcb75('0x2c')][_0xcb75('0x18')]);}_0x41e5fe['order']=qs[_0xcb75('0x34')](_0x54d718['query'][_0xcb75('0x34')]);_0x41e5fe[_0xcb75('0x35')]=qs[_0xcb75('0x2d')](_['pick'](_0x54d718[_0xcb75('0x2c')],_0x567087[_0xcb75('0x2d')]),_0x1b5c0d);if(_0x54d718[_0xcb75('0x2c')][_0xcb75('0x36')]){_0x41e5fe[_0xcb75('0x35')]=_[_0xcb75('0x37')](_0x41e5fe[_0xcb75('0x35')],{'$or':_[_0xcb75('0x27')](_0x1b5c0d,function(_0x117bbd){if(_0x117bbd[_0xcb75('0x38')]!==_0xcb75('0x39')){var _0x4b1dbb={};_0x4b1dbb[_0x117bbd['name']]={'$like':'%'+_0x54d718['query'][_0xcb75('0x36')]+'%'};return _0x4b1dbb;}})});}_0x41e5fe=_[_0xcb75('0x37')]({},_0x41e5fe,_0x54d718[_0xcb75('0x3a')]);var _0x409ac9={'where':_0x41e5fe['where']};return db[_0xcb75('0x28')][_0xcb75('0x1b')](_0x409ac9)[_0xcb75('0x20')](function(_0x401a61){_0x153370[_0xcb75('0x1b')]=_0x401a61;if(_0x54d718['query'][_0xcb75('0x3b')]){_0x41e5fe[_0xcb75('0x3c')]=[{'all':!![]}];}return db[_0xcb75('0x28')][_0xcb75('0x3d')](_0x41e5fe);})[_0xcb75('0x20')](function(_0x53db83){_0x153370[_0xcb75('0x3e')]=_0x53db83;return _0x153370;})[_0xcb75('0x20')](respondWithFilteredResult(_0x1bcf39,_0x41e5fe))['catch'](handleError(_0x1bcf39,null));};exports[_0xcb75('0x3f')]=function(_0x53a1d8,_0xba1470){var _0x3be469={'raw':!![],'where':{'id':_0x53a1d8[_0xcb75('0x40')]['id']}},_0x20996a={};_0x20996a[_0xcb75('0x2a')]=_[_0xcb75('0x2b')](db[_0xcb75('0x28')][_0xcb75('0x29')]);_0x20996a[_0xcb75('0x2c')]=_['keys'](_0x53a1d8[_0xcb75('0x2c')]);_0x20996a[_0xcb75('0x2d')]=_[_0xcb75('0x2f')](_0x20996a[_0xcb75('0x2a')],_0x20996a[_0xcb75('0x2c')]);_0x3be469[_0xcb75('0x2e')]=_[_0xcb75('0x2f')](_0x20996a[_0xcb75('0x2a')],qs[_0xcb75('0x30')](_0x53a1d8[_0xcb75('0x2c')][_0xcb75('0x30')]));_0x3be469[_0xcb75('0x2e')]=_0x3be469[_0xcb75('0x2e')][_0xcb75('0x31')]?_0x3be469[_0xcb75('0x2e')]:_0x20996a[_0xcb75('0x2a')];if(_0x53a1d8['query']['includeAll']){_0x3be469[_0xcb75('0x3c')]=[{'all':!![]}];}_0x3be469=_[_0xcb75('0x37')]({},_0x3be469,_0x53a1d8[_0xcb75('0x3a')]);return db[_0xcb75('0x28')]['find'](_0x3be469)[_0xcb75('0x20')](handleEntityNotFound(_0xba1470,null))[_0xcb75('0x20')](respondWithResult(_0xba1470,null))['catch'](handleError(_0xba1470,null));};exports[_0xcb75('0x41')]=function(_0x2bd64b,_0x44273a){return db[_0xcb75('0x28')][_0xcb75('0x41')](_0x2bd64b[_0xcb75('0x42')],{})[_0xcb75('0x20')](respondWithResult(_0x44273a,0xc9))[_0xcb75('0x43')](handleError(_0x44273a,null));};exports['update']=function(_0x1fb0a3,_0x122f3e){if(_0x1fb0a3['body']['id']){delete _0x1fb0a3[_0xcb75('0x42')]['id'];}return db['FaxQueueReport']['find']({'where':{'id':_0x1fb0a3[_0xcb75('0x40')]['id']}})[_0xcb75('0x20')](handleEntityNotFound(_0x122f3e,null))[_0xcb75('0x20')](saveUpdates(_0x1fb0a3[_0xcb75('0x42')],null))[_0xcb75('0x20')](respondWithResult(_0x122f3e,null))[_0xcb75('0x43')](handleError(_0x122f3e,null));};exports[_0xcb75('0x21')]=function(_0x12fa20,_0x19f174){return db[_0xcb75('0x28')][_0xcb75('0x44')]({'where':{'id':_0x12fa20[_0xcb75('0x40')]['id']}})[_0xcb75('0x20')](handleEntityNotFound(_0x19f174,null))[_0xcb75('0x20')](removeEntity(_0x19f174,null))[_0xcb75('0x43')](handleError(_0x19f174,null));};exports[_0xcb75('0x45')]=function(_0x48fc4a,_0x4e86d8){return db['FaxQueueReport'][_0xcb75('0x45')]()[_0xcb75('0x20')](respondWithResult(_0x4e86d8,null))[_0xcb75('0x43')](handleError(_0x4e86d8,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index 9bfbfbd..31afd9a 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 _0xabce=['path','rimraf','../../config/environment','define','report_fax_queue','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0x3356d9,_0x4b2e3e){var _0x37b8ce=function(_0x3b45ac){while(--_0x3b45ac){_0x3356d9['push'](_0x3356d9['shift']());}};_0x37b8ce(++_0x4b2e3e);}(_0xabce,0x103));var _0xeabc=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xabce[_0x4baae2];return _0x1a2285;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var 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('./faxQueueReport.attributes');module['exports']=function(_0x1b07a8,_0x52a4d7){return _0x1b07a8[_0xeabc('0x8')]('FaxQueueReport',attributes,{'tableName':_0xeabc('0x9'),'paranoid':![],'indexes':[{'name':_0xeabc('0xa'),'fields':[_0xeabc('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xabce=['path','rimraf','../../config/environment','define','report_fax_queue','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0x240415,_0x37892d){var _0x4b56de=function(_0x9cb890){while(--_0x9cb890){_0x240415['push'](_0x240415['shift']());}};_0x4b56de(++_0x37892d);}(_0xabce,0x103));var _0xeabc=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0xabce[_0x21aec3];return _0x288bbc;};'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('./faxQueueReport.attributes');module['exports']=function(_0x1b07a8,_0x52a4d7){return _0x1b07a8[_0xeabc('0x8')]('FaxQueueReport',attributes,{'tableName':_0xeabc('0x9'),'paranoid':![],'indexes':[{'name':_0xeabc('0xa'),'fields':[_0xeabc('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index d53835b..fd82aa8 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 _0x2671=['update','attributes','limit','stringify','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','error','message','catch','CreateFaxQueueReport','FaxQueueReport','create','body','options','raw','then','UpdateFaxQueueReport'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0x2671,0x1d5));var _0x1267=function(_0x4bf3a7,_0x5d756b){_0x4bf3a7=_0x4bf3a7-0x0;var _0x58c9cc=_0x2671[_0x4bf3a7];return _0x58c9cc;};'use strict';var _=require(_0x1267('0x0'));var util=require(_0x1267('0x1'));var moment=require(_0x1267('0x2'));var BPromise=require(_0x1267('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1267('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1267('0x5'));var logger=require(_0x1267('0x6'))(_0x1267('0x7'));var config=require(_0x1267('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x1267('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x291d07,_0x4510a4,_0x16679a){return new BPromise(function(_0x5eb632,_0x693b41){return client[_0x1267('0xa')](_0x291d07,_0x16679a)['then'](function(_0x9743e7){logger[_0x1267('0xb')](_0x1267('0xc'),_0x4510a4,_0x1267('0xd'));logger[_0x1267('0xe')](_0x1267('0xf'),_0x4510a4,_0x1267('0xd'),JSON['stringify'](_0x9743e7));if(_0x9743e7['error']){if(_0x9743e7[_0x1267('0x10')]['code']===0x1f4){logger['error'](_0x1267('0xc'),_0x4510a4,_0x9743e7[_0x1267('0x10')][_0x1267('0x11')]);return _0x693b41(_0x9743e7['error'][_0x1267('0x11')]);}logger[_0x1267('0x10')](_0x1267('0xc'),_0x4510a4,_0x9743e7['error'][_0x1267('0x11')]);return _0x5eb632(_0x9743e7[_0x1267('0x10')]['message']);}else{logger[_0x1267('0xb')]('FaxQueueReport,\x20%s,\x20%s',_0x4510a4,_0x1267('0xd'));_0x5eb632(_0x9743e7['result']['message']);}})[_0x1267('0x12')](function(_0x444d18){logger['error'](_0x1267('0xc'),_0x4510a4,_0x444d18);_0x693b41(_0x444d18);});});}exports[_0x1267('0x13')]=function(_0x41df46){var _0x53c818=this;return new Promise(function(_0x1ff2f8,_0x551204){return db[_0x1267('0x14')][_0x1267('0x15')](_0x41df46[_0x1267('0x16')],{'raw':_0x41df46['options']?_0x41df46[_0x1267('0x17')][_0x1267('0x18')]===undefined?!![]:![]:!![]})[_0x1267('0x19')](function(_0x19e604){logger['info'](_0x1267('0x13'),_0x41df46);logger[_0x1267('0xe')]('CreateFaxQueueReport',_0x41df46,JSON['stringify'](_0x19e604));_0x1ff2f8(_0x19e604);})[_0x1267('0x12')](function(_0x1a120b){logger[_0x1267('0x10')]('CreateFaxQueueReport',_0x1a120b[_0x1267('0x11')],_0x41df46);_0x551204(_0x53c818[_0x1267('0x10')](0x1f4,_0x1a120b['message']));});});};exports[_0x1267('0x1a')]=function(_0x3fed04){var _0x150d6b=this;return new Promise(function(_0x5912fb,_0x4eac5d){return db[_0x1267('0x14')][_0x1267('0x1b')](_0x3fed04[_0x1267('0x16')],{'raw':_0x3fed04[_0x1267('0x17')]?_0x3fed04['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3fed04['options']?_0x3fed04['options']['where']||null:null,'attributes':_0x3fed04[_0x1267('0x17')]?_0x3fed04[_0x1267('0x17')][_0x1267('0x1c')]||null:null,'limit':_0x3fed04[_0x1267('0x17')]?_0x3fed04[_0x1267('0x17')][_0x1267('0x1d')]||null:null})[_0x1267('0x19')](function(_0x4dbc4d){logger[_0x1267('0xb')](_0x1267('0x1a'),_0x3fed04);logger[_0x1267('0xe')](_0x1267('0x1a'),_0x3fed04,JSON[_0x1267('0x1e')](_0x4dbc4d));_0x5912fb(_0x4dbc4d);})[_0x1267('0x12')](function(_0x398cc8){logger[_0x1267('0x10')](_0x1267('0x1a'),_0x398cc8[_0x1267('0x11')],_0x3fed04);_0x4eac5d(_0x150d6b[_0x1267('0x10')](0x1f4,_0x398cc8[_0x1267('0x11')]));});});}; \ No newline at end of file +var _0x4824=['CreateFaxQueueReport','UpdateFaxQueueReport','FaxQueueReport','update','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','request','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','create','body','options','raw','then'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x4824,0x1d4));var _0x4482=function(_0x21a2f6,_0x247d98){_0x21a2f6=_0x21a2f6-0x0;var _0xfbf566=_0x4824[_0x21a2f6];return _0xfbf566;};'use strict';var _=require(_0x4482('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x4482('0x1'));var rs=require(_0x4482('0x2'));var fs=require('fs');var Redis=require(_0x4482('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4482('0x4'));var logger=require(_0x4482('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x4482('0x6'));var client=jayson[_0x4482('0x7')][_0x4482('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x31fb16,_0x314381,_0x4db73a){return new BPromise(function(_0x2a0b98,_0xf789e0){return client[_0x4482('0x9')](_0x31fb16,_0x4db73a)['then'](function(_0x5cd2f2){logger[_0x4482('0xa')](_0x4482('0xb'),_0x314381,_0x4482('0xc'));logger[_0x4482('0xd')](_0x4482('0xe'),_0x314381,_0x4482('0xc'),JSON[_0x4482('0xf')](_0x5cd2f2));if(_0x5cd2f2[_0x4482('0x10')]){if(_0x5cd2f2[_0x4482('0x10')][_0x4482('0x11')]===0x1f4){logger['error']('FaxQueueReport,\x20%s,\x20%s',_0x314381,_0x5cd2f2[_0x4482('0x10')]['message']);return _0xf789e0(_0x5cd2f2[_0x4482('0x10')][_0x4482('0x12')]);}logger[_0x4482('0x10')](_0x4482('0xb'),_0x314381,_0x5cd2f2['error']['message']);return _0x2a0b98(_0x5cd2f2['error'][_0x4482('0x12')]);}else{logger[_0x4482('0xa')](_0x4482('0xb'),_0x314381,'request\x20sent');_0x2a0b98(_0x5cd2f2['result']['message']);}})[_0x4482('0x13')](function(_0xcaea85){logger[_0x4482('0x10')](_0x4482('0xb'),_0x314381,_0xcaea85);_0xf789e0(_0xcaea85);});});}exports['CreateFaxQueueReport']=function(_0x328787){var _0x2de754=this;return new Promise(function(_0x3ded3e,_0x42d10c){return db['FaxQueueReport'][_0x4482('0x14')](_0x328787[_0x4482('0x15')],{'raw':_0x328787[_0x4482('0x16')]?_0x328787[_0x4482('0x16')][_0x4482('0x17')]===undefined?!![]:![]:!![]})[_0x4482('0x18')](function(_0xceef4c){logger[_0x4482('0xa')](_0x4482('0x19'),_0x328787);logger[_0x4482('0xd')]('CreateFaxQueueReport',_0x328787,JSON[_0x4482('0xf')](_0xceef4c));_0x3ded3e(_0xceef4c);})[_0x4482('0x13')](function(_0x42af53){logger[_0x4482('0x10')](_0x4482('0x19'),_0x42af53['message'],_0x328787);_0x42d10c(_0x2de754['error'](0x1f4,_0x42af53[_0x4482('0x12')]));});});};exports[_0x4482('0x1a')]=function(_0xc20a21){var _0x1acd49=this;return new Promise(function(_0x3e72f3,_0x57f3c7){return db[_0x4482('0x1b')][_0x4482('0x1c')](_0xc20a21[_0x4482('0x15')],{'raw':_0xc20a21[_0x4482('0x16')]?_0xc20a21[_0x4482('0x16')][_0x4482('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xc20a21['options']?_0xc20a21['options']['where']||null:null,'attributes':_0xc20a21[_0x4482('0x16')]?_0xc20a21[_0x4482('0x16')]['attributes']||null:null,'limit':_0xc20a21[_0x4482('0x16')]?_0xc20a21[_0x4482('0x16')]['limit']||null:null})[_0x4482('0x18')](function(_0x14513c){logger[_0x4482('0xa')](_0x4482('0x1a'),_0xc20a21);logger[_0x4482('0xd')](_0x4482('0x1a'),_0xc20a21,JSON[_0x4482('0xf')](_0x14513c));_0x3e72f3(_0x14513c);})[_0x4482('0x13')](function(_0x29b4c5){logger['error'](_0x4482('0x1a'),_0x29b4c5['message'],_0xc20a21);_0x57f3c7(_0x1acd49['error'](0x1f4,_0x29b4c5[_0x4482('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index 91b203b..e1b5c3e 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 _0x7f1e=['isAuthenticated','index','/describe','describe','show','post','create','put','/:id','update','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../config/environment','get'];(function(_0x22aeb7,_0x31bafc){var _0x5a4da6=function(_0x4406f2){while(--_0x4406f2){_0x22aeb7['push'](_0x22aeb7['shift']());}};_0x5a4da6(++_0x31bafc);}(_0x7f1e,0x19c));var _0xe7f1=function(_0x410be9,_0x559186){_0x410be9=_0x410be9-0x0;var _0x3ec84b=_0x7f1e[_0x410be9];return _0x3ec84b;};'use strict';var multer=require(_0xe7f1('0x0'));var util=require(_0xe7f1('0x1'));var path=require('path');var timeout=require(_0xe7f1('0x2'));var express=require(_0xe7f1('0x3'));var router=express[_0xe7f1('0x4')]();var fs_extra=require(_0xe7f1('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xe7f1('0x6'));var controller=require('./faxQueueReport.controller');router[_0xe7f1('0x7')]('/',auth[_0xe7f1('0x8')](),controller[_0xe7f1('0x9')]);router[_0xe7f1('0x7')](_0xe7f1('0xa'),auth[_0xe7f1('0x8')](),controller[_0xe7f1('0xb')]);router[_0xe7f1('0x7')]('/:id',auth[_0xe7f1('0x8')](),controller[_0xe7f1('0xc')]);router[_0xe7f1('0xd')]('/',auth[_0xe7f1('0x8')](),controller[_0xe7f1('0xe')]);router[_0xe7f1('0xf')](_0xe7f1('0x10'),auth['isAuthenticated'](),controller[_0xe7f1('0x11')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xe7f1('0x12')]);module[_0xe7f1('0x13')]=router; \ No newline at end of file +var _0x3bbb=['/:id','post','create','put','delete','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe'];(function(_0x1aba25,_0x1faed1){var _0x47d997=function(_0x4f9e11){while(--_0x4f9e11){_0x1aba25['push'](_0x1aba25['shift']());}};_0x47d997(++_0x1faed1);}(_0x3bbb,0x1c0));var _0xb3bb=function(_0xef4cf0,_0x16c9c3){_0xef4cf0=_0xef4cf0-0x0;var _0x497ad2=_0x3bbb[_0xef4cf0];return _0x497ad2;};'use strict';var multer=require('multer');var util=require(_0xb3bb('0x0'));var path=require('path');var timeout=require(_0xb3bb('0x1'));var express=require(_0xb3bb('0x2'));var router=express[_0xb3bb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xb3bb('0x4'));var interaction=require(_0xb3bb('0x5'));var config=require(_0xb3bb('0x6'));var controller=require('./faxQueueReport.controller');router[_0xb3bb('0x7')]('/',auth[_0xb3bb('0x8')](),controller['index']);router[_0xb3bb('0x7')](_0xb3bb('0x9'),auth['isAuthenticated'](),controller[_0xb3bb('0xa')]);router[_0xb3bb('0x7')](_0xb3bb('0xb'),auth[_0xb3bb('0x8')](),controller['show']);router[_0xb3bb('0xc')]('/',auth[_0xb3bb('0x8')](),controller[_0xb3bb('0xd')]);router[_0xb3bb('0xe')]('/:id',auth[_0xb3bb('0x8')](),controller['update']);router[_0xb3bb('0xf')](_0xb3bb('0xb'),auth[_0xb3bb('0x8')](),controller['destroy']);module[_0xb3bb('0x10')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index b657563..591c9a0 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 _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x36ef8c,_0x285e19){var _0x2a27d1=function(_0x4a1a89){while(--_0x4a1a89){_0x36ef8c['push'](_0x36ef8c['shift']());}};_0x2a27d1(++_0x285e19);}(_0x70e0,0x17b));var _0x070e=function(_0x8335b,_0x1ddd58){_0x8335b=_0x8335b-0x0;var _0x611a64=_0x70e0[_0x8335b];return _0x611a64;};'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 _0x34e8=['queue','DATE','NOW','moment','sequelize','exports','STRING','account','agent'];(function(_0xd034c8,_0x4b5fbe){var _0x37c283=function(_0x1fc5c3){while(--_0x1fc5c3){_0xd034c8['push'](_0xd034c8['shift']());}};_0x37c283(++_0x4b5fbe);}(_0x34e8,0x12c));var _0x834e=function(_0xca972b,_0x29f0c0){_0xca972b=_0xca972b-0x0;var _0x1f196e=_0x34e8[_0xca972b];return _0x1f196e;};'use strict';var moment=require(_0x834e('0x0'));var Sequelize=require(_0x834e('0x1'));module[_0x834e('0x2')]={'uniqueid':{'type':Sequelize[_0x834e('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x834e('0x4'),_0x834e('0x5'),_0x834e('0x6')),'allowNull':![],'defaultValue':_0x834e('0x6')},'transferredAt':{'type':Sequelize[_0x834e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x834e('0x8')]}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index 871fe9d..dc3d0b1 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 _0xc8d9=['apply','save','then','destroy','error','stack','name','send','index','map','FaxTransferReport','rawAttributes','fieldName','type','model','query','keys','attributes','intersection','fields','length','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','body','update','describe','eml-format','rimraf','fast-json-patch','moment','mustache','path','to-csv','fs-extra','lodash','squel','crypto','querystring','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range'];(function(_0x22d68a,_0x3f6978){var _0x131c53=function(_0x1781dc){while(--_0x1781dc){_0x22d68a['push'](_0x22d68a['shift']());}};_0x131c53(++_0x3f6978);}(_0xc8d9,0x141));var _0x9c8d=function(_0x4991d6,_0x348deb){_0x4991d6=_0x4991d6-0x0;var _0x50faf7=_0xc8d9[_0x4991d6];return _0x50faf7;};'use strict';var emlformat=require(_0x9c8d('0x0'));var rimraf=require(_0x9c8d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9c8d('0x2'));var rp=require('request-promise');var moment=require(_0x9c8d('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x9c8d('0x4'));var util=require('util');var path=require(_0x9c8d('0x5'));var sox=require('sox');var csv=require(_0x9c8d('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9c8d('0x7'));var _=require(_0x9c8d('0x8'));var squel=require(_0x9c8d('0x9'));var crypto=require(_0x9c8d('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x9c8d('0x6'));var querystring=require(_0x9c8d('0xb'));var Papa=require('papaparse');var Redis=require(_0x9c8d('0xc'));var authService=require(_0x9c8d('0xd'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9c8d('0xe'));var logger=require('../../config/logger')(_0x9c8d('0xf'));var utils=require(_0x9c8d('0x10'));var config=require(_0x9c8d('0x11'));var licenseUtil=require(_0x9c8d('0x12'));var db=require(_0x9c8d('0x13'))['db'];function respondWithStatusCode(_0x43e433,_0x1af283){_0x1af283=_0x1af283||0xcc;return function(_0xe17c56){if(_0xe17c56){return _0x43e433[_0x9c8d('0x14')](_0x1af283);}return _0x43e433[_0x9c8d('0x15')](_0x1af283)[_0x9c8d('0x16')]();};}function respondWithResult(_0x1db482,_0x42e737){_0x42e737=_0x42e737||0xc8;return function(_0x2603e2){if(_0x2603e2){return _0x1db482[_0x9c8d('0x15')](_0x42e737)[_0x9c8d('0x17')](_0x2603e2);}};}function respondWithFilteredResult(_0x47b7b2,_0x7db300){return function(_0x30a9a0){if(_0x30a9a0){var _0xce2931=typeof _0x7db300[_0x9c8d('0x18')]===_0x9c8d('0x19')&&typeof _0x7db300[_0x9c8d('0x1a')]===_0x9c8d('0x19');var _0xba5bb6=_0x30a9a0[_0x9c8d('0x1b')];var _0x3dc8e1=_0xce2931?0x0:_0x7db300['offset'];var _0x3bab76=_0xce2931?_0x30a9a0['count']:_0x7db300['offset']+_0x7db300[_0x9c8d('0x1a')];var _0x2d1a59;if(_0x3bab76>=_0xba5bb6){_0x3bab76=_0xba5bb6;_0x2d1a59=0xc8;}else{_0x2d1a59=0xce;}_0x47b7b2[_0x9c8d('0x15')](_0x2d1a59);return _0x47b7b2['set'](_0x9c8d('0x1c'),_0x3dc8e1+'-'+_0x3bab76+'/'+_0xba5bb6)[_0x9c8d('0x17')](_0x30a9a0);}return null;};}function patchUpdates(_0x127567){return function(_0x76bd6d){try{jsonpatch[_0x9c8d('0x1d')](_0x76bd6d,_0x127567,!![]);}catch(_0x8744b4){return BPromise['reject'](_0x8744b4);}return _0x76bd6d[_0x9c8d('0x1e')]();};}function saveUpdates(_0x1d099c,_0x43783c){return function(_0x5c1be2){if(_0x5c1be2){return _0x5c1be2['update'](_0x1d099c)[_0x9c8d('0x1f')](function(_0x215e1f){return _0x215e1f;});}return null;};}function removeEntity(_0x2c4459,_0x3a7d33){return function(_0x28fb86){if(_0x28fb86){return _0x28fb86[_0x9c8d('0x20')]()['then'](function(){_0x2c4459['status'](0xcc)[_0x9c8d('0x16')]();});}};}function handleEntityNotFound(_0x449a74,_0x2ef0a2){return function(_0x52a840){if(!_0x52a840){_0x449a74['sendStatus'](0x194);}return _0x52a840;};}function handleError(_0x1fb0ec,_0xc6d681){_0xc6d681=_0xc6d681||0x1f4;return function(_0x153d07){logger[_0x9c8d('0x21')](_0x153d07[_0x9c8d('0x22')]);if(_0x153d07[_0x9c8d('0x23')]){delete _0x153d07[_0x9c8d('0x23')];}_0x1fb0ec[_0x9c8d('0x15')](_0xc6d681)[_0x9c8d('0x24')](_0x153d07);};}exports[_0x9c8d('0x25')]=function(_0x3872ea,_0x42b1c4){var _0x567d96={},_0x405164={},_0x194b0d={'count':0x0,'rows':[]};var _0x37a317=_[_0x9c8d('0x26')](db[_0x9c8d('0x27')][_0x9c8d('0x28')],function(_0x27b446){return{'name':_0x27b446[_0x9c8d('0x29')],'type':_0x27b446[_0x9c8d('0x2a')]['key']};});_0x405164[_0x9c8d('0x2b')]=_[_0x9c8d('0x26')](_0x37a317,'name');_0x405164[_0x9c8d('0x2c')]=_[_0x9c8d('0x2d')](_0x3872ea[_0x9c8d('0x2c')]);_0x405164['filters']=_['intersection'](_0x405164['model'],_0x405164[_0x9c8d('0x2c')]);_0x567d96[_0x9c8d('0x2e')]=_[_0x9c8d('0x2f')](_0x405164[_0x9c8d('0x2b')],qs[_0x9c8d('0x30')](_0x3872ea[_0x9c8d('0x2c')][_0x9c8d('0x30')]));_0x567d96[_0x9c8d('0x2e')]=_0x567d96[_0x9c8d('0x2e')][_0x9c8d('0x31')]?_0x567d96[_0x9c8d('0x2e')]:_0x405164[_0x9c8d('0x2b')];if(!_0x3872ea[_0x9c8d('0x2c')]['hasOwnProperty'](_0x9c8d('0x32'))){_0x567d96[_0x9c8d('0x1a')]=qs[_0x9c8d('0x1a')](_0x3872ea[_0x9c8d('0x2c')]['limit']);_0x567d96[_0x9c8d('0x18')]=qs[_0x9c8d('0x18')](_0x3872ea['query'][_0x9c8d('0x18')]);}_0x567d96[_0x9c8d('0x33')]=qs[_0x9c8d('0x34')](_0x3872ea['query'][_0x9c8d('0x34')]);_0x567d96['where']=qs[_0x9c8d('0x35')](_['pick'](_0x3872ea[_0x9c8d('0x2c')],_0x405164[_0x9c8d('0x35')]),_0x37a317);if(_0x3872ea[_0x9c8d('0x2c')][_0x9c8d('0x36')]){_0x567d96[_0x9c8d('0x37')]=_[_0x9c8d('0x38')](_0x567d96[_0x9c8d('0x37')],{'$or':_[_0x9c8d('0x26')](_0x37a317,function(_0xf7e4fc){if(_0xf7e4fc['type']!==_0x9c8d('0x39')){var _0x609616={};_0x609616[_0xf7e4fc[_0x9c8d('0x23')]]={'$like':'%'+_0x3872ea[_0x9c8d('0x2c')][_0x9c8d('0x36')]+'%'};return _0x609616;}})});}_0x567d96=_[_0x9c8d('0x38')]({},_0x567d96,_0x3872ea[_0x9c8d('0x3a')]);var _0x1c1e2f={'where':_0x567d96[_0x9c8d('0x37')]};return db[_0x9c8d('0x27')][_0x9c8d('0x1b')](_0x1c1e2f)['then'](function(_0x21e8ad){_0x194b0d['count']=_0x21e8ad;if(_0x3872ea[_0x9c8d('0x2c')][_0x9c8d('0x3b')]){_0x567d96[_0x9c8d('0x3c')]=[{'all':!![]}];}return db[_0x9c8d('0x27')]['findAll'](_0x567d96);})[_0x9c8d('0x1f')](function(_0x5ca8dd){_0x194b0d[_0x9c8d('0x3d')]=_0x5ca8dd;return _0x194b0d;})['then'](respondWithFilteredResult(_0x42b1c4,_0x567d96))[_0x9c8d('0x3e')](handleError(_0x42b1c4,null));};exports[_0x9c8d('0x3f')]=function(_0xd0fcba,_0x39e741){var _0x25082d={'raw':!![],'where':{'id':_0xd0fcba[_0x9c8d('0x40')]['id']}},_0x34f85f={};_0x34f85f[_0x9c8d('0x2b')]=_[_0x9c8d('0x2d')](db[_0x9c8d('0x27')][_0x9c8d('0x28')]);_0x34f85f[_0x9c8d('0x2c')]=_[_0x9c8d('0x2d')](_0xd0fcba[_0x9c8d('0x2c')]);_0x34f85f[_0x9c8d('0x35')]=_[_0x9c8d('0x2f')](_0x34f85f[_0x9c8d('0x2b')],_0x34f85f['query']);_0x25082d[_0x9c8d('0x2e')]=_[_0x9c8d('0x2f')](_0x34f85f[_0x9c8d('0x2b')],qs[_0x9c8d('0x30')](_0xd0fcba[_0x9c8d('0x2c')]['fields']));_0x25082d['attributes']=_0x25082d[_0x9c8d('0x2e')][_0x9c8d('0x31')]?_0x25082d[_0x9c8d('0x2e')]:_0x34f85f[_0x9c8d('0x2b')];if(_0xd0fcba[_0x9c8d('0x2c')][_0x9c8d('0x3b')]){_0x25082d[_0x9c8d('0x3c')]=[{'all':!![]}];}_0x25082d=_[_0x9c8d('0x38')]({},_0x25082d,_0xd0fcba[_0x9c8d('0x3a')]);return db[_0x9c8d('0x27')][_0x9c8d('0x41')](_0x25082d)[_0x9c8d('0x1f')](handleEntityNotFound(_0x39e741,null))['then'](respondWithResult(_0x39e741,null))['catch'](handleError(_0x39e741,null));};exports['create']=function(_0x4b4bac,_0x8c0969){return db['FaxTransferReport'][_0x9c8d('0x42')](_0x4b4bac[_0x9c8d('0x43')],{})[_0x9c8d('0x1f')](respondWithResult(_0x8c0969,0xc9))['catch'](handleError(_0x8c0969,null));};exports[_0x9c8d('0x44')]=function(_0x4df202,_0x1fc39f){if(_0x4df202[_0x9c8d('0x43')]['id']){delete _0x4df202[_0x9c8d('0x43')]['id'];}return db[_0x9c8d('0x27')][_0x9c8d('0x41')]({'where':{'id':_0x4df202[_0x9c8d('0x40')]['id']}})[_0x9c8d('0x1f')](handleEntityNotFound(_0x1fc39f,null))['then'](saveUpdates(_0x4df202[_0x9c8d('0x43')],null))[_0x9c8d('0x1f')](respondWithResult(_0x1fc39f,null))[_0x9c8d('0x3e')](handleError(_0x1fc39f,null));};exports[_0x9c8d('0x20')]=function(_0x4ad7e6,_0x3a968d){return db['FaxTransferReport'][_0x9c8d('0x41')]({'where':{'id':_0x4ad7e6['params']['id']}})[_0x9c8d('0x1f')](handleEntityNotFound(_0x3a968d,null))[_0x9c8d('0x1f')](removeEntity(_0x3a968d,null))[_0x9c8d('0x3e')](handleError(_0x3a968d,null));};exports[_0x9c8d('0x45')]=function(_0x5c526c,_0x5927d8){return db[_0x9c8d('0x27')]['describe']()['then'](respondWithResult(_0x5927d8,null))[_0x9c8d('0x3e')](handleError(_0x5927d8,null));}; \ No newline at end of file +var _0x89bd=['VIRTUAL','filter','options','FaxTransferReport','includeAll','include','findAll','rows','catch','show','find','create','update','body','params','describe','rimraf','fast-json-patch','request-promise','bluebird','util','path','ejs','squel','crypto','jsforce','desk.js','to-csv','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','limit','count','Content-Range','apply','reject','save','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','pick','merge'];(function(_0x4a226f,_0x3cb733){var _0x251cf2=function(_0x83a828){while(--_0x83a828){_0x4a226f['push'](_0x4a226f['shift']());}};_0x251cf2(++_0x3cb733);}(_0x89bd,0x1d8));var _0xd89b=function(_0x233ab8,_0xb0d3d1){_0x233ab8=_0x233ab8-0x0;var _0x3bbdee=_0x89bd[_0x233ab8];return _0x3bbdee;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd89b('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd89b('0x1'));var rp=require(_0xd89b('0x2'));var moment=require('moment');var BPromise=require(_0xd89b('0x3'));var Mustache=require('mustache');var util=require(_0xd89b('0x4'));var path=require(_0xd89b('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd89b('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xd89b('0x7'));var crypto=require(_0xd89b('0x8'));var jsforce=require(_0xd89b('0x9'));var deskjs=require(_0xd89b('0xa'));var toCsv=require(_0xd89b('0xb'));var querystring=require('querystring');var Papa=require(_0xd89b('0xc'));var Redis=require(_0xd89b('0xd'));var authService=require(_0xd89b('0xe'));var qs=require(_0xd89b('0xf'));var as=require(_0xd89b('0x10'));var hardwareService=require(_0xd89b('0x11'));var logger=require(_0xd89b('0x12'))('api');var utils=require(_0xd89b('0x13'));var config=require(_0xd89b('0x14'));var licenseUtil=require(_0xd89b('0x15'));var db=require(_0xd89b('0x16'))['db'];function respondWithStatusCode(_0x56be30,_0x461a27){_0x461a27=_0x461a27||0xcc;return function(_0x10e136){if(_0x10e136){return _0x56be30[_0xd89b('0x17')](_0x461a27);}return _0x56be30[_0xd89b('0x18')](_0x461a27)[_0xd89b('0x19')]();};}function respondWithResult(_0x5c4857,_0x24ec52){_0x24ec52=_0x24ec52||0xc8;return function(_0x154498){if(_0x154498){return _0x5c4857['status'](_0x24ec52)[_0xd89b('0x1a')](_0x154498);}};}function respondWithFilteredResult(_0x1bc93a,_0x11da85){return function(_0x5eced0){if(_0x5eced0){var _0x4d9c19=typeof _0x11da85[_0xd89b('0x1b')]===_0xd89b('0x1c')&&typeof _0x11da85[_0xd89b('0x1d')]==='undefined';var _0x177ed9=_0x5eced0[_0xd89b('0x1e')];var _0x1d3d9c=_0x4d9c19?0x0:_0x11da85[_0xd89b('0x1b')];var _0x3703b7=_0x4d9c19?_0x5eced0[_0xd89b('0x1e')]:_0x11da85[_0xd89b('0x1b')]+_0x11da85['limit'];var _0x26df9a;if(_0x3703b7>=_0x177ed9){_0x3703b7=_0x177ed9;_0x26df9a=0xc8;}else{_0x26df9a=0xce;}_0x1bc93a[_0xd89b('0x18')](_0x26df9a);return _0x1bc93a['set'](_0xd89b('0x1f'),_0x1d3d9c+'-'+_0x3703b7+'/'+_0x177ed9)[_0xd89b('0x1a')](_0x5eced0);}return null;};}function patchUpdates(_0x3649cc){return function(_0x3cb1ef){try{jsonpatch[_0xd89b('0x20')](_0x3cb1ef,_0x3649cc,!![]);}catch(_0x52829f){return BPromise[_0xd89b('0x21')](_0x52829f);}return _0x3cb1ef[_0xd89b('0x22')]();};}function saveUpdates(_0x25c2a6,_0x46e996){return function(_0x364b37){if(_0x364b37){return _0x364b37['update'](_0x25c2a6)[_0xd89b('0x23')](function(_0x267e52){return _0x267e52;});}return null;};}function removeEntity(_0x42e331,_0x38a568){return function(_0x3d9a84){if(_0x3d9a84){return _0x3d9a84[_0xd89b('0x24')]()[_0xd89b('0x23')](function(){_0x42e331[_0xd89b('0x18')](0xcc)[_0xd89b('0x19')]();});}};}function handleEntityNotFound(_0x253590,_0x3e2169){return function(_0x29e0dd){if(!_0x29e0dd){_0x253590[_0xd89b('0x17')](0x194);}return _0x29e0dd;};}function handleError(_0x3ddaff,_0x31ea66){_0x31ea66=_0x31ea66||0x1f4;return function(_0x3f5ce3){logger['error'](_0x3f5ce3[_0xd89b('0x25')]);if(_0x3f5ce3[_0xd89b('0x26')]){delete _0x3f5ce3[_0xd89b('0x26')];}_0x3ddaff[_0xd89b('0x18')](_0x31ea66)[_0xd89b('0x27')](_0x3f5ce3);};}exports[_0xd89b('0x28')]=function(_0xdd987d,_0x392f0a){var _0x48e4ea={},_0x9000d4={},_0x31d889={'count':0x0,'rows':[]};var _0x31b0f4=_[_0xd89b('0x29')](db['FaxTransferReport'][_0xd89b('0x2a')],function(_0x4e07f0){return{'name':_0x4e07f0[_0xd89b('0x2b')],'type':_0x4e07f0[_0xd89b('0x2c')][_0xd89b('0x2d')]};});_0x9000d4['model']=_['map'](_0x31b0f4,_0xd89b('0x26'));_0x9000d4[_0xd89b('0x2e')]=_[_0xd89b('0x2f')](_0xdd987d['query']);_0x9000d4[_0xd89b('0x30')]=_[_0xd89b('0x31')](_0x9000d4['model'],_0x9000d4[_0xd89b('0x2e')]);_0x48e4ea['attributes']=_[_0xd89b('0x31')](_0x9000d4[_0xd89b('0x32')],qs[_0xd89b('0x33')](_0xdd987d[_0xd89b('0x2e')][_0xd89b('0x33')]));_0x48e4ea[_0xd89b('0x34')]=_0x48e4ea[_0xd89b('0x34')][_0xd89b('0x35')]?_0x48e4ea[_0xd89b('0x34')]:_0x9000d4['model'];if(!_0xdd987d[_0xd89b('0x2e')][_0xd89b('0x36')]('nolimit')){_0x48e4ea[_0xd89b('0x1d')]=qs[_0xd89b('0x1d')](_0xdd987d['query'][_0xd89b('0x1d')]);_0x48e4ea[_0xd89b('0x1b')]=qs[_0xd89b('0x1b')](_0xdd987d[_0xd89b('0x2e')][_0xd89b('0x1b')]);}_0x48e4ea[_0xd89b('0x37')]=qs[_0xd89b('0x38')](_0xdd987d['query']['sort']);_0x48e4ea[_0xd89b('0x39')]=qs[_0xd89b('0x30')](_[_0xd89b('0x3a')](_0xdd987d['query'],_0x9000d4[_0xd89b('0x30')]),_0x31b0f4);if(_0xdd987d[_0xd89b('0x2e')]['filter']){_0x48e4ea[_0xd89b('0x39')]=_[_0xd89b('0x3b')](_0x48e4ea[_0xd89b('0x39')],{'$or':_[_0xd89b('0x29')](_0x31b0f4,function(_0x2201b6){if(_0x2201b6['type']!==_0xd89b('0x3c')){var _0x5f550a={};_0x5f550a[_0x2201b6['name']]={'$like':'%'+_0xdd987d[_0xd89b('0x2e')][_0xd89b('0x3d')]+'%'};return _0x5f550a;}})});}_0x48e4ea=_[_0xd89b('0x3b')]({},_0x48e4ea,_0xdd987d[_0xd89b('0x3e')]);var _0x83ee26={'where':_0x48e4ea[_0xd89b('0x39')]};return db[_0xd89b('0x3f')][_0xd89b('0x1e')](_0x83ee26)[_0xd89b('0x23')](function(_0x120b25){_0x31d889[_0xd89b('0x1e')]=_0x120b25;if(_0xdd987d[_0xd89b('0x2e')][_0xd89b('0x40')]){_0x48e4ea[_0xd89b('0x41')]=[{'all':!![]}];}return db[_0xd89b('0x3f')][_0xd89b('0x42')](_0x48e4ea);})[_0xd89b('0x23')](function(_0x1c019a){_0x31d889[_0xd89b('0x43')]=_0x1c019a;return _0x31d889;})[_0xd89b('0x23')](respondWithFilteredResult(_0x392f0a,_0x48e4ea))[_0xd89b('0x44')](handleError(_0x392f0a,null));};exports[_0xd89b('0x45')]=function(_0x14e7fa,_0x1b5647){var _0x32315b={'raw':!![],'where':{'id':_0x14e7fa['params']['id']}},_0x2fc311={};_0x2fc311[_0xd89b('0x32')]=_[_0xd89b('0x2f')](db[_0xd89b('0x3f')][_0xd89b('0x2a')]);_0x2fc311[_0xd89b('0x2e')]=_[_0xd89b('0x2f')](_0x14e7fa[_0xd89b('0x2e')]);_0x2fc311[_0xd89b('0x30')]=_[_0xd89b('0x31')](_0x2fc311[_0xd89b('0x32')],_0x2fc311[_0xd89b('0x2e')]);_0x32315b[_0xd89b('0x34')]=_[_0xd89b('0x31')](_0x2fc311['model'],qs[_0xd89b('0x33')](_0x14e7fa[_0xd89b('0x2e')]['fields']));_0x32315b[_0xd89b('0x34')]=_0x32315b['attributes'][_0xd89b('0x35')]?_0x32315b[_0xd89b('0x34')]:_0x2fc311[_0xd89b('0x32')];if(_0x14e7fa[_0xd89b('0x2e')][_0xd89b('0x40')]){_0x32315b[_0xd89b('0x41')]=[{'all':!![]}];}_0x32315b=_['merge']({},_0x32315b,_0x14e7fa[_0xd89b('0x3e')]);return db[_0xd89b('0x3f')][_0xd89b('0x46')](_0x32315b)[_0xd89b('0x23')](handleEntityNotFound(_0x1b5647,null))['then'](respondWithResult(_0x1b5647,null))[_0xd89b('0x44')](handleError(_0x1b5647,null));};exports[_0xd89b('0x47')]=function(_0x101725,_0x1ba532){return db[_0xd89b('0x3f')][_0xd89b('0x47')](_0x101725['body'],{})[_0xd89b('0x23')](respondWithResult(_0x1ba532,0xc9))[_0xd89b('0x44')](handleError(_0x1ba532,null));};exports[_0xd89b('0x48')]=function(_0x2183c3,_0x402f88){if(_0x2183c3[_0xd89b('0x49')]['id']){delete _0x2183c3[_0xd89b('0x49')]['id'];}return db[_0xd89b('0x3f')][_0xd89b('0x46')]({'where':{'id':_0x2183c3[_0xd89b('0x4a')]['id']}})[_0xd89b('0x23')](handleEntityNotFound(_0x402f88,null))[_0xd89b('0x23')](saveUpdates(_0x2183c3[_0xd89b('0x49')],null))[_0xd89b('0x23')](respondWithResult(_0x402f88,null))[_0xd89b('0x44')](handleError(_0x402f88,null));};exports[_0xd89b('0x24')]=function(_0x33b21e,_0x281ff8){return db[_0xd89b('0x3f')][_0xd89b('0x46')]({'where':{'id':_0x33b21e[_0xd89b('0x4a')]['id']}})['then'](handleEntityNotFound(_0x281ff8,null))[_0xd89b('0x23')](removeEntity(_0x281ff8,null))['catch'](handleError(_0x281ff8,null));};exports[_0xd89b('0x4b')]=function(_0x138075,_0x5c85e6){return db[_0xd89b('0x3f')][_0xd89b('0x4b')]()[_0xd89b('0x23')](respondWithResult(_0x5c85e6,null))[_0xd89b('0x44')](handleError(_0x5c85e6,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index 7654371..bc51411 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 _0x7497=['request-promise','path','rimraf','../../config/environment','./faxTransferReport.attributes','exports','define','uniqueid','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x4f2be2,_0x2aa7da){var _0x32e56f=function(_0x2a48ac){while(--_0x2a48ac){_0x4f2be2['push'](_0x4f2be2['shift']());}};_0x32e56f(++_0x2aa7da);}(_0x7497,0x13c));var _0x7749=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7497[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7749('0x0'));var util=require(_0x7749('0x1'));var logger=require(_0x7749('0x2'))(_0x7749('0x3'));var moment=require(_0x7749('0x4'));var BPromise=require(_0x7749('0x5'));var rp=require(_0x7749('0x6'));var fs=require('fs');var path=require(_0x7749('0x7'));var rimraf=require(_0x7749('0x8'));var config=require(_0x7749('0x9'));var attributes=require(_0x7749('0xa'));module[_0x7749('0xb')]=function(_0x35c27b,_0x341c81){return _0x35c27b[_0x7749('0xc')]('FaxTransferReport',attributes,{'tableName':'report_fax_transfer','paranoid':![],'indexes':[{'name':_0x7749('0xd'),'fields':[_0x7749('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x213d=['../../config/environment','./faxTransferReport.attributes','report_fax_transfer','uniqueid','lodash','util','../../config/logger','request-promise','path','rimraf'];(function(_0x4a58cb,_0x2239a5){var _0x3bd47b=function(_0xf1b152){while(--_0xf1b152){_0x4a58cb['push'](_0x4a58cb['shift']());}};_0x3bd47b(++_0x2239a5);}(_0x213d,0x1bc));var _0xd213=function(_0x13b02f,_0x462a53){_0x13b02f=_0x13b02f-0x0;var _0x12e9a6=_0x213d[_0x13b02f];return _0x12e9a6;};'use strict';var _=require(_0xd213('0x0'));var util=require(_0xd213('0x1'));var logger=require(_0xd213('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xd213('0x3'));var fs=require('fs');var path=require(_0xd213('0x4'));var rimraf=require(_0xd213('0x5'));var config=require(_0xd213('0x6'));var attributes=require(_0xd213('0x7'));module['exports']=function(_0x4ddf28,_0x44e619){return _0x4ddf28['define']('FaxTransferReport',attributes,{'tableName':_0xd213('0x8'),'paranoid':![],'indexes':[{'name':_0xd213('0x9'),'fields':[_0xd213('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index 8982ca6..972459e 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 _0xf8fa=['request\x20sent','debug','stringify','error','message','result','catch','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','client','http','request','then','info','FaxTransferReport,\x20%s,\x20%s'];(function(_0x56eca2,_0x52fc38){var _0x53330c=function(_0x41650c){while(--_0x41650c){_0x56eca2['push'](_0x56eca2['shift']());}};_0x53330c(++_0x52fc38);}(_0xf8fa,0x79));var _0xaf8f=function(_0x56d3a2,_0x5f191b){_0x56d3a2=_0x56d3a2-0x0;var _0x2c14d0=_0xf8fa[_0x56d3a2];return _0x2c14d0;};'use strict';var _=require('lodash');var util=require(_0xaf8f('0x0'));var moment=require(_0xaf8f('0x1'));var BPromise=require('bluebird');var rs=require(_0xaf8f('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaf8f('0x3'))['db'];var utils=require(_0xaf8f('0x4'));var logger=require(_0xaf8f('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xaf8f('0x6')][_0xaf8f('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x589bff,_0x14c340,_0x4b18ef){return new BPromise(function(_0x569126,_0x6e28d){return client[_0xaf8f('0x8')](_0x589bff,_0x4b18ef)[_0xaf8f('0x9')](function(_0x32cfae){logger[_0xaf8f('0xa')](_0xaf8f('0xb'),_0x14c340,_0xaf8f('0xc'));logger[_0xaf8f('0xd')]('FaxTransferReport,\x20%s,\x20%s,\x20%s',_0x14c340,_0xaf8f('0xc'),JSON[_0xaf8f('0xe')](_0x32cfae));if(_0x32cfae[_0xaf8f('0xf')]){if(_0x32cfae[_0xaf8f('0xf')]['code']===0x1f4){logger['error'](_0xaf8f('0xb'),_0x14c340,_0x32cfae[_0xaf8f('0xf')][_0xaf8f('0x10')]);return _0x6e28d(_0x32cfae[_0xaf8f('0xf')][_0xaf8f('0x10')]);}logger['error']('FaxTransferReport,\x20%s,\x20%s',_0x14c340,_0x32cfae['error'][_0xaf8f('0x10')]);return _0x569126(_0x32cfae[_0xaf8f('0xf')][_0xaf8f('0x10')]);}else{logger[_0xaf8f('0xa')](_0xaf8f('0xb'),_0x14c340,_0xaf8f('0xc'));_0x569126(_0x32cfae[_0xaf8f('0x11')][_0xaf8f('0x10')]);}})[_0xaf8f('0x12')](function(_0x133423){logger[_0xaf8f('0xf')](_0xaf8f('0xb'),_0x14c340,_0x133423);_0x6e28d(_0x133423);});});} \ No newline at end of file +var _0xee19=['jayson/promise','client','http','then','info','FaxTransferReport,\x20%s,\x20%s','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x2bfb35,_0x252eb1){var _0x3e66a6=function(_0x4bcd6c){while(--_0x4bcd6c){_0x2bfb35['push'](_0x2bfb35['shift']());}};_0x3e66a6(++_0x252eb1);}(_0xee19,0x1bf));var _0x9ee1=function(_0x12f26e,_0x1dfc0c){_0x12f26e=_0x12f26e-0x0;var _0xf27705=_0xee19[_0x12f26e];return _0xf27705;};'use strict';var _=require(_0x9ee1('0x0'));var util=require(_0x9ee1('0x1'));var moment=require(_0x9ee1('0x2'));var BPromise=require(_0x9ee1('0x3'));var rs=require(_0x9ee1('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9ee1('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x9ee1('0x6'))(_0x9ee1('0x7'));var config=require(_0x9ee1('0x8'));var jayson=require(_0x9ee1('0x9'));var client=jayson[_0x9ee1('0xa')][_0x9ee1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x585f94,_0x192f2f,_0x341949){return new BPromise(function(_0xd817a,_0x19ffc0){return client['request'](_0x585f94,_0x341949)[_0x9ee1('0xc')](function(_0x32d3e1){logger[_0x9ee1('0xd')](_0x9ee1('0xe'),_0x192f2f,'request\x20sent');logger[_0x9ee1('0xf')](_0x9ee1('0x10'),_0x192f2f,_0x9ee1('0x11'),JSON[_0x9ee1('0x12')](_0x32d3e1));if(_0x32d3e1[_0x9ee1('0x13')]){if(_0x32d3e1[_0x9ee1('0x13')][_0x9ee1('0x14')]===0x1f4){logger[_0x9ee1('0x13')]('FaxTransferReport,\x20%s,\x20%s',_0x192f2f,_0x32d3e1[_0x9ee1('0x13')][_0x9ee1('0x15')]);return _0x19ffc0(_0x32d3e1[_0x9ee1('0x13')][_0x9ee1('0x15')]);}logger[_0x9ee1('0x13')](_0x9ee1('0xe'),_0x192f2f,_0x32d3e1[_0x9ee1('0x13')][_0x9ee1('0x15')]);return _0xd817a(_0x32d3e1[_0x9ee1('0x13')][_0x9ee1('0x15')]);}else{logger[_0x9ee1('0xd')](_0x9ee1('0xe'),_0x192f2f,_0x9ee1('0x11'));_0xd817a(_0x32d3e1[_0x9ee1('0x16')][_0x9ee1('0x15')]);}})[_0x9ee1('0x17')](function(_0x19fe1b){logger['error']('FaxTransferReport,\x20%s,\x20%s',_0x192f2f,_0x19fe1b);_0x19ffc0(_0x19fe1b);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index 2ccf9f8..aaeebd3 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 _0x9235=['util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy'];(function(_0x5b2414,_0x16d22f){var _0x30a395=function(_0x450826){while(--_0x450826){_0x5b2414['push'](_0x5b2414['shift']());}};_0x30a395(++_0x16d22f);}(_0x9235,0x8c));var _0x5923=function(_0x2d54c3,_0x2f7f9d){_0x2d54c3=_0x2d54c3-0x0;var _0x24575c=_0x9235[_0x2d54c3];return _0x24575c;};'use strict';var multer=require('multer');var util=require(_0x5923('0x0'));var path=require(_0x5923('0x1'));var timeout=require(_0x5923('0x2'));var express=require(_0x5923('0x3'));var router=express[_0x5923('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x5923('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x5923('0x6'));var controller=require('./faxTransferReport.controller');router[_0x5923('0x7')]('/',auth[_0x5923('0x8')](),controller[_0x5923('0x9')]);router['get'](_0x5923('0xa'),auth[_0x5923('0x8')](),controller[_0x5923('0xb')]);router[_0x5923('0x7')](_0x5923('0xc'),auth[_0x5923('0x8')](),controller[_0x5923('0xd')]);router[_0x5923('0xe')]('/',auth[_0x5923('0x8')](),controller[_0x5923('0xf')]);router[_0x5923('0x10')](_0x5923('0xc'),auth[_0x5923('0x8')](),controller[_0x5923('0x11')]);router[_0x5923('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x5923('0x13')]);module['exports']=router; \ No newline at end of file +var _0x637d=['/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated'];(function(_0xfbd40a,_0x3d6bf1){var _0x3ad856=function(_0x41e943){while(--_0x41e943){_0xfbd40a['push'](_0xfbd40a['shift']());}};_0x3ad856(++_0x3d6bf1);}(_0x637d,0x129));var _0xd637=function(_0xfa3795,_0x16b735){_0xfa3795=_0xfa3795-0x0;var _0x4e3a09=_0x637d[_0xfa3795];return _0x4e3a09;};'use strict';var multer=require(_0xd637('0x0'));var util=require(_0xd637('0x1'));var path=require(_0xd637('0x2'));var timeout=require(_0xd637('0x3'));var express=require(_0xd637('0x4'));var router=express[_0xd637('0x5')]();var fs_extra=require(_0xd637('0x6'));var auth=require(_0xd637('0x7'));var interaction=require(_0xd637('0x8'));var config=require('../../config/environment');var controller=require('./faxTransferReport.controller');router[_0xd637('0x9')]('/',auth[_0xd637('0xa')](),controller['index']);router['get'](_0xd637('0xb'),auth[_0xd637('0xa')](),controller[_0xd637('0xc')]);router[_0xd637('0x9')](_0xd637('0xd'),auth[_0xd637('0xa')](),controller[_0xd637('0xe')]);router[_0xd637('0xf')]('/',auth[_0xd637('0xa')](),controller[_0xd637('0x10')]);router[_0xd637('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xd637('0x12')]);router[_0xd637('0x13')](_0xd637('0xd'),auth['isAuthenticated'](),controller[_0xd637('0x14')]);module[_0xd637('0x15')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index 6b3ec67..77fc50b 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 _0x3e30=['./intDeskAccount.controller','isAuthenticated','index','/:id','show','get','/:id/configurations','getConfigurations','/:id/fields','post','create','addConfiguration','update','delete','destroy','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x5b7788,_0x309ae5){var _0x573871=function(_0x5c79fd){while(--_0x5c79fd){_0x5b7788['push'](_0x5b7788['shift']());}};_0x573871(++_0x309ae5);}(_0x3e30,0x185));var _0x03e3=function(_0x3972c0,_0x4b49ea){_0x3972c0=_0x3972c0-0x0;var _0x1c7018=_0x3e30[_0x3972c0];return _0x1c7018;};'use strict';var multer=require('multer');var util=require(_0x03e3('0x0'));var path=require('path');var timeout=require(_0x03e3('0x1'));var express=require(_0x03e3('0x2'));var router=express['Router']();var fs_extra=require(_0x03e3('0x3'));var auth=require(_0x03e3('0x4'));var interaction=require(_0x03e3('0x5'));var config=require(_0x03e3('0x6'));var controller=require(_0x03e3('0x7'));router['get']('/',auth[_0x03e3('0x8')](),controller[_0x03e3('0x9')]);router['get'](_0x03e3('0xa'),auth['isAuthenticated'](),controller[_0x03e3('0xb')]);router[_0x03e3('0xc')](_0x03e3('0xd'),auth[_0x03e3('0x8')](),controller[_0x03e3('0xe')]);router['get'](_0x03e3('0xf'),auth[_0x03e3('0x8')](),controller['getFields']);router[_0x03e3('0x10')]('/',auth['isAuthenticated'](),controller[_0x03e3('0x11')]);router[_0x03e3('0x10')](_0x03e3('0xd'),auth[_0x03e3('0x8')](),controller[_0x03e3('0x12')]);router['put'](_0x03e3('0xa'),auth[_0x03e3('0x8')](),controller[_0x03e3('0x13')]);router[_0x03e3('0x14')]('/:id',auth[_0x03e3('0x8')](),controller[_0x03e3('0x15')]);module['exports']=router; \ No newline at end of file +var _0xf7e4=['isAuthenticated','show','get','/:id/fields','getFields','post','/:id/configurations','addConfiguration','/:id','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','index'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf7e4,0x1ef));var _0x4f7e=function(_0x7e57fd,_0x28d416){_0x7e57fd=_0x7e57fd-0x0;var _0x4b61f8=_0xf7e4[_0x7e57fd];return _0x4b61f8;};'use strict';var multer=require('multer');var util=require(_0x4f7e('0x0'));var path=require(_0x4f7e('0x1'));var timeout=require(_0x4f7e('0x2'));var express=require(_0x4f7e('0x3'));var router=express[_0x4f7e('0x4')]();var fs_extra=require(_0x4f7e('0x5'));var auth=require(_0x4f7e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x4f7e('0x7'));var controller=require('./intDeskAccount.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x4f7e('0x8')]);router['get']('/:id',auth[_0x4f7e('0x9')](),controller[_0x4f7e('0xa')]);router[_0x4f7e('0xb')]('/:id/configurations',auth[_0x4f7e('0x9')](),controller['getConfigurations']);router['get'](_0x4f7e('0xc'),auth[_0x4f7e('0x9')](),controller[_0x4f7e('0xd')]);router['post']('/',auth[_0x4f7e('0x9')](),controller['create']);router[_0x4f7e('0xe')](_0x4f7e('0xf'),auth[_0x4f7e('0x9')](),controller[_0x4f7e('0x10')]);router['put'](_0x4f7e('0x11'),auth['isAuthenticated'](),controller['update']);router[_0x4f7e('0x12')](_0x4f7e('0x11'),auth[_0x4f7e('0x9')](),controller[_0x4f7e('0x13')]);module[_0x4f7e('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 09b29dc..32eedf4 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 _0x1ae4=['integrationTab','sequelize','exports','STRING','ENUM','basic'];(function(_0x37ae2e,_0x35be3a){var _0x19c50f=function(_0x49732a){while(--_0x49732a){_0x37ae2e['push'](_0x37ae2e['shift']());}};_0x19c50f(++_0x35be3a);}(_0x1ae4,0x103));var _0x41ae=function(_0x208ca5,_0x4a4689){_0x208ca5=_0x208ca5-0x0;var _0x59cb7d=_0x1ae4[_0x208ca5];return _0x59cb7d;};'use strict';var Sequelize=require(_0x41ae('0x0'));module[_0x41ae('0x1')]={'name':{'type':Sequelize[_0x41ae('0x2')]},'description':{'type':Sequelize[_0x41ae('0x2')]},'username':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x41ae('0x2')]},'authType':{'type':Sequelize[_0x41ae('0x3')](_0x41ae('0x4')),'defaultValue':_0x41ae('0x4')},'password':{'type':Sequelize[_0x41ae('0x2')]},'consumerKey':{'type':Sequelize[_0x41ae('0x2')]},'consumerSecret':{'type':Sequelize[_0x41ae('0x2')]},'token':{'type':Sequelize[_0x41ae('0x2')]},'tokenSecret':{'type':Sequelize[_0x41ae('0x2')]},'serverUrl':{'type':Sequelize[_0x41ae('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x41ae('0x3')](_0x41ae('0x5'),'newTab'),'defaultValue':_0x41ae('0x5')}}; \ No newline at end of file +var _0x8e1f=['ENUM','integrationTab','newTab','sequelize','STRING','basic'];(function(_0x2c763e,_0x4654de){var _0x53b5b8=function(_0x449c4b){while(--_0x449c4b){_0x2c763e['push'](_0x2c763e['shift']());}};_0x53b5b8(++_0x4654de);}(_0x8e1f,0xed));var _0xf8e1=function(_0x4d5cac,_0x5bf7bd){_0x4d5cac=_0x4d5cac-0x0;var _0x513307=_0x8e1f[_0x4d5cac];return _0x513307;};'use strict';var Sequelize=require(_0xf8e1('0x0'));module['exports']={'name':{'type':Sequelize[_0xf8e1('0x1')]},'description':{'type':Sequelize[_0xf8e1('0x1')]},'username':{'type':Sequelize[_0xf8e1('0x1')]},'remoteUri':{'type':Sequelize['STRING']},'authType':{'type':Sequelize['ENUM'](_0xf8e1('0x2')),'defaultValue':'basic'},'password':{'type':Sequelize[_0xf8e1('0x1')]},'consumerKey':{'type':Sequelize[_0xf8e1('0x1')]},'consumerSecret':{'type':Sequelize[_0xf8e1('0x1')]},'token':{'type':Sequelize[_0xf8e1('0x1')]},'tokenSecret':{'type':Sequelize[_0xf8e1('0x1')]},'serverUrl':{'type':Sequelize[_0xf8e1('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xf8e1('0x3')](_0xf8e1('0x4'),_0xf8e1('0x5')),'defaultValue':'integrationTab'}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index 8850606..54e215c 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 _0xc155=['query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','find','catch','create','body','params','getConfigurations','DeskConfiguration','filter','addConfiguration','findOne','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','DeskField','getFields','remoteUri','authType','username','password','consumerKey','consumerSecret','token','slice','substring','lastIndexOf','GET','format','application/json','Authorization','%s:%s','base64','concat','_embedded','active','label','stringify','Wrong\x20credentials','statusCode','eml-format','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','sendStatus','error','name','send','map','DeskAccount','rawAttributes','fieldName','type','key'];(function(_0x347ec3,_0x20c6a5){var _0x4beb3a=function(_0x254a1e){while(--_0x254a1e){_0x347ec3['push'](_0x347ec3['shift']());}};_0x4beb3a(++_0x20c6a5);}(_0xc155,0x182));var _0x5c15=function(_0x5194c9,_0x10146f){_0x5194c9=_0x5194c9-0x0;var _0x34b94f=_0xc155[_0x5194c9];return _0x34b94f;};'use strict';var emlformat=require(_0x5c15('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5c15('0x1'));var rp=require(_0x5c15('0x2'));var moment=require(_0x5c15('0x3'));var BPromise=require(_0x5c15('0x4'));var Mustache=require('mustache');var util=require(_0x5c15('0x5'));var path=require('path');var sox=require(_0x5c15('0x6'));var csv=require(_0x5c15('0x7'));var ejs=require(_0x5c15('0x8'));var fs=require('fs');var fs_extra=require(_0x5c15('0x9'));var _=require('lodash');var squel=require(_0x5c15('0xa'));var crypto=require('crypto');var jsforce=require(_0x5c15('0xb'));var deskjs=require(_0x5c15('0xc'));var toCsv=require(_0x5c15('0x7'));var querystring=require(_0x5c15('0xd'));var Papa=require(_0x5c15('0xe'));var Redis=require(_0x5c15('0xf'));var authService=require(_0x5c15('0x10'));var qs=require(_0x5c15('0x11'));var as=require(_0x5c15('0x12'));var hardwareService=require(_0x5c15('0x13'));var logger=require('../../config/logger')(_0x5c15('0x14'));var utils=require(_0x5c15('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x5c15('0x16'));var db=require(_0x5c15('0x17'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x93e44d,_0xa57418){_0xa57418=_0xa57418||0xcc;return function(_0x4d7ac4){if(_0x4d7ac4){return _0x93e44d['sendStatus'](_0xa57418);}return _0x93e44d[_0x5c15('0x18')](_0xa57418)['end']();};}function respondWithResult(_0x49d518,_0x4851a7){_0x4851a7=_0x4851a7||0xc8;return function(_0x3faa4a){if(_0x3faa4a){return _0x49d518[_0x5c15('0x18')](_0x4851a7)[_0x5c15('0x19')](_0x3faa4a);}};}function respondWithFilteredResult(_0x109125,_0x33f45b){return function(_0x56ad55){if(_0x56ad55){var _0xd10f69=typeof _0x33f45b[_0x5c15('0x1a')]===_0x5c15('0x1b')&&typeof _0x33f45b[_0x5c15('0x1c')]==='undefined';var _0x5c39f9=_0x56ad55[_0x5c15('0x1d')];var _0x19fa58=_0xd10f69?0x0:_0x33f45b[_0x5c15('0x1a')];var _0x1f6d1a=_0xd10f69?_0x56ad55[_0x5c15('0x1d')]:_0x33f45b[_0x5c15('0x1a')]+_0x33f45b[_0x5c15('0x1c')];var _0x44f233;if(_0x1f6d1a>=_0x5c39f9){_0x1f6d1a=_0x5c39f9;_0x44f233=0xc8;}else{_0x44f233=0xce;}_0x109125['status'](_0x44f233);return _0x109125['set'](_0x5c15('0x1e'),_0x19fa58+'-'+_0x1f6d1a+'/'+_0x5c39f9)[_0x5c15('0x19')](_0x56ad55);}return null;};}function patchUpdates(_0x10e82b){return function(_0x5da10c){try{jsonpatch[_0x5c15('0x1f')](_0x5da10c,_0x10e82b,!![]);}catch(_0x9d4dcd){return BPromise[_0x5c15('0x20')](_0x9d4dcd);}return _0x5da10c[_0x5c15('0x21')]();};}function saveUpdates(_0x678777,_0x52ca4b){return function(_0x4babd0){if(_0x4babd0){return _0x4babd0[_0x5c15('0x22')](_0x678777)['then'](function(_0x5d6c01){return _0x5d6c01;});}return null;};}function removeEntity(_0x2386a3,_0x506e43){return function(_0x319463){if(_0x319463){return _0x319463['destroy']()[_0x5c15('0x23')](function(){_0x2386a3[_0x5c15('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1ebffb,_0x2fd404){return function(_0x524b0c){if(!_0x524b0c){_0x1ebffb[_0x5c15('0x24')](0x194);}return _0x524b0c;};}function handleError(_0x34b28d,_0x363922){_0x363922=_0x363922||0x1f4;return function(_0x2ea2d6){logger[_0x5c15('0x25')](_0x2ea2d6['stack']);if(_0x2ea2d6[_0x5c15('0x26')]){delete _0x2ea2d6[_0x5c15('0x26')];}_0x34b28d['status'](_0x363922)[_0x5c15('0x27')](_0x2ea2d6);};}exports['index']=function(_0x3c1afc,_0x262239){var _0x486f00={},_0x47c0c1={},_0x3d84e1={'count':0x0,'rows':[]};var _0x1e556a=_[_0x5c15('0x28')](db[_0x5c15('0x29')][_0x5c15('0x2a')],function(_0x1a467b){return{'name':_0x1a467b[_0x5c15('0x2b')],'type':_0x1a467b[_0x5c15('0x2c')][_0x5c15('0x2d')]};});_0x47c0c1['model']=_['map'](_0x1e556a,'name');_0x47c0c1[_0x5c15('0x2e')]=_[_0x5c15('0x2f')](_0x3c1afc['query']);_0x47c0c1[_0x5c15('0x30')]=_[_0x5c15('0x31')](_0x47c0c1[_0x5c15('0x32')],_0x47c0c1[_0x5c15('0x2e')]);_0x486f00[_0x5c15('0x33')]=_[_0x5c15('0x31')](_0x47c0c1['model'],qs['fields'](_0x3c1afc[_0x5c15('0x2e')][_0x5c15('0x34')]));_0x486f00['attributes']=_0x486f00['attributes'][_0x5c15('0x35')]?_0x486f00['attributes']:_0x47c0c1['model'];if(!_0x3c1afc[_0x5c15('0x2e')][_0x5c15('0x36')](_0x5c15('0x37'))){_0x486f00['limit']=qs[_0x5c15('0x1c')](_0x3c1afc[_0x5c15('0x2e')][_0x5c15('0x1c')]);_0x486f00['offset']=qs['offset'](_0x3c1afc[_0x5c15('0x2e')]['offset']);}_0x486f00[_0x5c15('0x38')]=qs[_0x5c15('0x39')](_0x3c1afc[_0x5c15('0x2e')][_0x5c15('0x39')]);_0x486f00[_0x5c15('0x3a')]=qs[_0x5c15('0x30')](_[_0x5c15('0x3b')](_0x3c1afc[_0x5c15('0x2e')],_0x47c0c1[_0x5c15('0x30')]),_0x1e556a);if(_0x3c1afc['query']['filter']){_0x486f00['where']=_[_0x5c15('0x3c')](_0x486f00[_0x5c15('0x3a')],{'$or':_['map'](_0x1e556a,function(_0x1ed1cd){if(_0x1ed1cd[_0x5c15('0x2c')]!==_0x5c15('0x3d')){var _0x3db328={};_0x3db328[_0x1ed1cd[_0x5c15('0x26')]]={'$like':'%'+_0x3c1afc[_0x5c15('0x2e')]['filter']+'%'};return _0x3db328;}})});}_0x486f00=_[_0x5c15('0x3c')]({},_0x486f00,_0x3c1afc[_0x5c15('0x3e')]);var _0x6c5d9a={'where':_0x486f00[_0x5c15('0x3a')]};return db[_0x5c15('0x29')][_0x5c15('0x1d')](_0x6c5d9a)[_0x5c15('0x23')](function(_0x2a4b91){_0x3d84e1[_0x5c15('0x1d')]=_0x2a4b91;if(_0x3c1afc[_0x5c15('0x2e')][_0x5c15('0x3f')]){_0x486f00[_0x5c15('0x40')]=[{'all':!![]}];}return db['DeskAccount'][_0x5c15('0x41')](_0x486f00);})[_0x5c15('0x23')](function(_0x3e6587){_0x3d84e1[_0x5c15('0x42')]=_0x3e6587;return _0x3d84e1;})[_0x5c15('0x23')](respondWithFilteredResult(_0x262239,_0x486f00))['catch'](handleError(_0x262239,null));};exports[_0x5c15('0x43')]=function(_0x5e0ca8,_0x3025d5){var _0x46a6e2={'raw':![],'where':{'id':_0x5e0ca8['params']['id']}},_0x34ca22={};_0x34ca22[_0x5c15('0x32')]=_[_0x5c15('0x2f')](db[_0x5c15('0x29')][_0x5c15('0x2a')]);_0x34ca22[_0x5c15('0x2e')]=_[_0x5c15('0x2f')](_0x5e0ca8['query']);_0x34ca22['filters']=_[_0x5c15('0x31')](_0x34ca22[_0x5c15('0x32')],_0x34ca22[_0x5c15('0x2e')]);_0x46a6e2[_0x5c15('0x33')]=_[_0x5c15('0x31')](_0x34ca22[_0x5c15('0x32')],qs[_0x5c15('0x34')](_0x5e0ca8[_0x5c15('0x2e')][_0x5c15('0x34')]));_0x46a6e2[_0x5c15('0x33')]=_0x46a6e2[_0x5c15('0x33')][_0x5c15('0x35')]?_0x46a6e2['attributes']:_0x34ca22['model'];if(_0x5e0ca8['query'][_0x5c15('0x3f')]){_0x46a6e2[_0x5c15('0x40')]=[{'all':!![]}];}_0x46a6e2=_[_0x5c15('0x3c')]({},_0x46a6e2,_0x5e0ca8['options']);return db[_0x5c15('0x29')][_0x5c15('0x44')](_0x46a6e2)['then'](handleEntityNotFound(_0x3025d5,null))[_0x5c15('0x23')](respondWithResult(_0x3025d5,null))[_0x5c15('0x45')](handleError(_0x3025d5,null));};exports[_0x5c15('0x46')]=function(_0x47f45a,_0x3945de){return db[_0x5c15('0x29')][_0x5c15('0x46')](_0x47f45a[_0x5c15('0x47')],{})['then'](respondWithResult(_0x3945de,0xc9))[_0x5c15('0x45')](handleError(_0x3945de,null));};exports['update']=function(_0x4637a1,_0x564c0b){if(_0x4637a1[_0x5c15('0x47')]['id']){delete _0x4637a1[_0x5c15('0x47')]['id'];}return db[_0x5c15('0x29')][_0x5c15('0x44')]({'where':{'id':_0x4637a1[_0x5c15('0x48')]['id']}})[_0x5c15('0x23')](handleEntityNotFound(_0x564c0b,null))['then'](saveUpdates(_0x4637a1[_0x5c15('0x47')],null))[_0x5c15('0x23')](respondWithResult(_0x564c0b,null))['catch'](handleError(_0x564c0b,null));};exports['destroy']=function(_0x3ddc2c,_0x1710c3){return db[_0x5c15('0x29')][_0x5c15('0x44')]({'where':{'id':_0x3ddc2c[_0x5c15('0x48')]['id']}})['then'](handleEntityNotFound(_0x1710c3,null))[_0x5c15('0x23')](removeEntity(_0x1710c3,null))['catch'](handleError(_0x1710c3,null));};exports[_0x5c15('0x49')]=function(_0x5db34d,_0x1ec4b7,_0x3fb04a){var _0x4e071e={};var _0x71e02d={};var _0x4e8f11;var _0x386b98;return db[_0x5c15('0x29')]['findOne']({'where':{'id':_0x5db34d[_0x5c15('0x48')]['id']}})[_0x5c15('0x23')](handleEntityNotFound(_0x1ec4b7,null))[_0x5c15('0x23')](function(_0x585250){if(_0x585250){_0x4e8f11=_0x585250;_0x71e02d[_0x5c15('0x32')]=_[_0x5c15('0x2f')](db[_0x5c15('0x4a')][_0x5c15('0x2a')]);_0x71e02d[_0x5c15('0x2e')]=_[_0x5c15('0x2f')](_0x5db34d[_0x5c15('0x2e')]);_0x71e02d[_0x5c15('0x30')]=_[_0x5c15('0x31')](_0x71e02d[_0x5c15('0x32')],_0x71e02d[_0x5c15('0x2e')]);_0x4e071e['attributes']=_[_0x5c15('0x31')](_0x71e02d['model'],qs[_0x5c15('0x34')](_0x5db34d[_0x5c15('0x2e')]['fields']));_0x4e071e[_0x5c15('0x33')]=_0x4e071e[_0x5c15('0x33')][_0x5c15('0x35')]?_0x4e071e[_0x5c15('0x33')]:_0x71e02d[_0x5c15('0x32')];_0x4e071e[_0x5c15('0x38')]=qs[_0x5c15('0x39')](_0x5db34d[_0x5c15('0x2e')][_0x5c15('0x39')]);_0x4e071e[_0x5c15('0x3a')]=qs[_0x5c15('0x30')](_[_0x5c15('0x3b')](_0x5db34d[_0x5c15('0x2e')],_0x71e02d[_0x5c15('0x30')]));if(_0x5db34d[_0x5c15('0x2e')][_0x5c15('0x4b')]){_0x4e071e[_0x5c15('0x3a')]=_[_0x5c15('0x3c')](_0x4e071e['where'],{'$or':_[_0x5c15('0x28')](_0x4e071e[_0x5c15('0x33')],function(_0x4dd349){var _0x2c23af={};_0x2c23af[_0x4dd349]={'$like':'%'+_0x5db34d[_0x5c15('0x2e')][_0x5c15('0x4b')]+'%'};return _0x2c23af;})});}_0x4e071e=_['merge']({},_0x4e071e,_0x5db34d[_0x5c15('0x3e')]);return _0x4e8f11[_0x5c15('0x49')](_0x4e071e);}})['then'](function(_0x1eeb79){if(_0x1eeb79){_0x386b98=_0x1eeb79[_0x5c15('0x35')];if(!_0x5db34d[_0x5c15('0x2e')][_0x5c15('0x36')](_0x5c15('0x37'))){_0x4e071e[_0x5c15('0x1c')]=qs[_0x5c15('0x1c')](_0x5db34d[_0x5c15('0x2e')][_0x5c15('0x1c')]);_0x4e071e['offset']=qs[_0x5c15('0x1a')](_0x5db34d[_0x5c15('0x2e')][_0x5c15('0x1a')]);}return _0x4e8f11[_0x5c15('0x49')](_0x4e071e);}})[_0x5c15('0x23')](function(_0x47b511){if(_0x47b511){return _0x47b511?{'count':_0x386b98,'rows':_0x47b511}:null;}})[_0x5c15('0x23')](respondWithResult(_0x1ec4b7,null))['catch'](handleError(_0x1ec4b7,null));};exports[_0x5c15('0x4c')]=function(_0x3df1db,_0x24454f,_0x5bbb06){if(_0x3df1db['body']['id']){delete _0x3df1db[_0x5c15('0x47')]['id'];}return db[_0x5c15('0x29')][_0x5c15('0x4d')]({'where':{'id':_0x3df1db[_0x5c15('0x48')]['id']}})[_0x5c15('0x23')](handleEntityNotFound(_0x24454f,null))['then'](function(_0x52ae7b){if(_0x52ae7b){_0x3df1db[_0x5c15('0x47')][_0x5c15('0x4e')]=_0x52ae7b['id'];_0x3df1db[_0x5c15('0x47')][_0x5c15('0x4f')]=integrations[_0x5c15('0x50')](_0x3df1db['body']['channel'],_0x3df1db['body'][_0x5c15('0x2c')]);_0x3df1db[_0x5c15('0x47')][_0x5c15('0x51')]=integrations[_0x5c15('0x52')](_0x3df1db[_0x5c15('0x47')]['channel'],_0x3df1db['body'][_0x5c15('0x2c')]);return db[_0x5c15('0x4a')][_0x5c15('0x46')](_0x3df1db[_0x5c15('0x47')],{'include':[{'model':db['DeskField'],'as':'Subjects'},{'model':db[_0x5c15('0x53')],'as':_0x5c15('0x51')}]});}return null;})[_0x5c15('0x23')](respondWithResult(_0x24454f,null))[_0x5c15('0x45')](handleError(_0x24454f,null));};exports[_0x5c15('0x54')]=function(_0x460ab8,_0x9ca88e,_0x287c06){var _0x289131=[{'name':'priority','label':'priority','custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x104e46='';return db[_0x5c15('0x29')]['findOne']({'where':{'id':_0x460ab8[_0x5c15('0x48')]['id']},'attributes':['id',_0x5c15('0x55'),_0x5c15('0x56'),_0x5c15('0x57'),_0x5c15('0x58'),_0x5c15('0x59'),_0x5c15('0x5a'),_0x5c15('0x5b'),'tokenSecret']})[_0x5c15('0x23')](handleEntityNotFound(_0x9ca88e,null))[_0x5c15('0x23')](function(_0x4be905){if(_0x4be905){_0x104e46=_0x4be905['remoteUri'];var _0x5a6f8a=_0x104e46[_0x5c15('0x5c')](-0x1);if(_0x5a6f8a==='/'){_0x104e46=_0x104e46[_0x5c15('0x5d')](0x0,_0x104e46[_0x5c15('0x5e')](_0x5a6f8a));}var _0x1e60c9={'method':_0x5c15('0x5f'),'uri':util[_0x5c15('0x60')]('%s/custom_fields',_0x104e46),'headers':{'Content-Type':_0x5c15('0x61'),'Accept':_0x5c15('0x61')},'json':!![]};if(_0x4be905[_0x5c15('0x56')]==='basic'){_0x1e60c9['headers'][_0x5c15('0x62')]=util[_0x5c15('0x60')]('Basic\x20%s',new Buffer(util[_0x5c15('0x60')](_0x5c15('0x63'),_0x4be905[_0x5c15('0x57')],_0x4be905[_0x5c15('0x58')]))['toString'](_0x5c15('0x64')));}return rp(_0x1e60c9)['then'](function(_0x1ec140){return _0x289131[_0x5c15('0x65')](_[_0x5c15('0x28')](_0x1ec140[_0x5c15('0x66')]['entries'],function(_0x265bda){return{'id':_0x265bda[_0x5c15('0x26')],'name':_0x265bda[_0x5c15('0x26')],'type':_0x265bda[_0x5c15('0x2c')],'active':_0x265bda[_0x5c15('0x67')],'label':_0x265bda[_0x5c15('0x68')],'custom':!![]};}));});}})['then'](function(_0x1c16b8){return{'count':_0x1c16b8[_0x5c15('0x35')],'rows':_0x1c16b8};})[_0x5c15('0x23')](respondWithResult(_0x9ca88e,null))[_0x5c15('0x45')](function(_0x31af04){var _0x722b3f=_0x460ab8[_0x5c15('0x2e')]['test']?0x1f4:_0x31af04['statusCode']||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0x5c15('0x54'),_0x722b3f,JSON[_0x5c15('0x69')](_0x31af04));delete _0x31af04[_0x5c15('0x26')];if(_0x722b3f===0x191){_0x722b3f=0x190;}_0x9ca88e[_0x5c15('0x18')](_0x722b3f)[_0x5c15('0x27')](_0x460ab8[_0x5c15('0x2e')]['test']?{'message':_0x5c15('0x6a'),'statusCode':_0x31af04[_0x5c15('0x6b')]}:_0x31af04);});}; \ No newline at end of file +var _0x8232=['pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','findOne','keys','DeskConfiguration','length','getConfigurations','addConfiguration','AccountId','getSubjects','channel','Descriptions','getDescriptions','DeskField','priority','authType','username','consumerKey','token','tokenSecret','slice','substring','lastIndexOf','GET','format','%s/custom_fields','application/json','basic','Authorization','Basic\x20%s','%s:%s','password','toString','base64','concat','_embedded','entries','active','label','test','statusCode','stringify','send','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','offset','undefined','count','limit','set','Content-Range','json','save','update','then','destroy','end','error','stack','name','index','map','DeskAccount','type','key','query','model','attributes','intersection','fields','hasOwnProperty','order','sort','where','filters'];(function(_0x50b89e,_0x5c58e3){var _0x4dfc20=function(_0x20cdd4){while(--_0x20cdd4){_0x50b89e['push'](_0x50b89e['shift']());}};_0x4dfc20(++_0x5c58e3);}(_0x8232,0x126));var _0x2823=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0x8232[_0x311c35];return _0x5cc50c;};'use strict';var emlformat=require(_0x2823('0x0'));var rimraf=require(_0x2823('0x1'));var zipdir=require(_0x2823('0x2'));var jsonpatch=require(_0x2823('0x3'));var rp=require('request-promise');var moment=require(_0x2823('0x4'));var BPromise=require(_0x2823('0x5'));var Mustache=require(_0x2823('0x6'));var util=require(_0x2823('0x7'));var path=require(_0x2823('0x8'));var sox=require(_0x2823('0x9'));var csv=require(_0x2823('0xa'));var ejs=require(_0x2823('0xb'));var fs=require('fs');var fs_extra=require(_0x2823('0xc'));var _=require(_0x2823('0xd'));var squel=require(_0x2823('0xe'));var crypto=require(_0x2823('0xf'));var jsforce=require(_0x2823('0x10'));var deskjs=require(_0x2823('0x11'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2823('0x12'));var Redis=require(_0x2823('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x2823('0x14'));var as=require(_0x2823('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2823('0x16'))('api');var utils=require(_0x2823('0x17'));var config=require(_0x2823('0x18'));var licenseUtil=require(_0x2823('0x19'));var db=require(_0x2823('0x1a'))['db'];var integrations=require(_0x2823('0x1b'));function respondWithStatusCode(_0x34c318,_0x3ef505){_0x3ef505=_0x3ef505||0xcc;return function(_0x3d318a){if(_0x3d318a){return _0x34c318[_0x2823('0x1c')](_0x3ef505);}return _0x34c318[_0x2823('0x1d')](_0x3ef505)['end']();};}function respondWithResult(_0xe115f5,_0x55c25d){_0x55c25d=_0x55c25d||0xc8;return function(_0x17b897){if(_0x17b897){return _0xe115f5['status'](_0x55c25d)['json'](_0x17b897);}};}function respondWithFilteredResult(_0x47872b,_0x1f5e44){return function(_0x39159f){if(_0x39159f){var _0x1bca48=typeof _0x1f5e44[_0x2823('0x1e')]===_0x2823('0x1f')&&typeof _0x1f5e44['limit']==='undefined';var _0x1b68f3=_0x39159f[_0x2823('0x20')];var _0x217d4a=_0x1bca48?0x0:_0x1f5e44[_0x2823('0x1e')];var _0x4ab168=_0x1bca48?_0x39159f[_0x2823('0x20')]:_0x1f5e44[_0x2823('0x1e')]+_0x1f5e44[_0x2823('0x21')];var _0x458b32;if(_0x4ab168>=_0x1b68f3){_0x4ab168=_0x1b68f3;_0x458b32=0xc8;}else{_0x458b32=0xce;}_0x47872b[_0x2823('0x1d')](_0x458b32);return _0x47872b[_0x2823('0x22')](_0x2823('0x23'),_0x217d4a+'-'+_0x4ab168+'/'+_0x1b68f3)[_0x2823('0x24')](_0x39159f);}return null;};}function patchUpdates(_0x95d580){return function(_0x1a6af8){try{jsonpatch['apply'](_0x1a6af8,_0x95d580,!![]);}catch(_0x4c961f){return BPromise['reject'](_0x4c961f);}return _0x1a6af8[_0x2823('0x25')]();};}function saveUpdates(_0x4c8ed2,_0x125ddc){return function(_0x58447c){if(_0x58447c){return _0x58447c[_0x2823('0x26')](_0x4c8ed2)[_0x2823('0x27')](function(_0x27cb70){return _0x27cb70;});}return null;};}function removeEntity(_0x1f92d3,_0x2e6546){return function(_0x423384){if(_0x423384){return _0x423384[_0x2823('0x28')]()[_0x2823('0x27')](function(){_0x1f92d3[_0x2823('0x1d')](0xcc)[_0x2823('0x29')]();});}};}function handleEntityNotFound(_0x1516c6,_0x1d1fc9){return function(_0x4be070){if(!_0x4be070){_0x1516c6['sendStatus'](0x194);}return _0x4be070;};}function handleError(_0x5dd117,_0x51c6ae){_0x51c6ae=_0x51c6ae||0x1f4;return function(_0x58eafb){logger[_0x2823('0x2a')](_0x58eafb[_0x2823('0x2b')]);if(_0x58eafb['name']){delete _0x58eafb[_0x2823('0x2c')];}_0x5dd117[_0x2823('0x1d')](_0x51c6ae)['send'](_0x58eafb);};}exports[_0x2823('0x2d')]=function(_0x165970,_0xd46c92){var _0x40c332={},_0x1cf49e={},_0xefa7a5={'count':0x0,'rows':[]};var _0x3f7c67=_[_0x2823('0x2e')](db[_0x2823('0x2f')]['rawAttributes'],function(_0xe9dc50){return{'name':_0xe9dc50['fieldName'],'type':_0xe9dc50[_0x2823('0x30')][_0x2823('0x31')]};});_0x1cf49e['model']=_[_0x2823('0x2e')](_0x3f7c67,'name');_0x1cf49e[_0x2823('0x32')]=_['keys'](_0x165970[_0x2823('0x32')]);_0x1cf49e['filters']=_['intersection'](_0x1cf49e[_0x2823('0x33')],_0x1cf49e[_0x2823('0x32')]);_0x40c332[_0x2823('0x34')]=_[_0x2823('0x35')](_0x1cf49e[_0x2823('0x33')],qs[_0x2823('0x36')](_0x165970[_0x2823('0x32')][_0x2823('0x36')]));_0x40c332[_0x2823('0x34')]=_0x40c332[_0x2823('0x34')]['length']?_0x40c332[_0x2823('0x34')]:_0x1cf49e[_0x2823('0x33')];if(!_0x165970[_0x2823('0x32')][_0x2823('0x37')]('nolimit')){_0x40c332[_0x2823('0x21')]=qs[_0x2823('0x21')](_0x165970[_0x2823('0x32')][_0x2823('0x21')]);_0x40c332[_0x2823('0x1e')]=qs[_0x2823('0x1e')](_0x165970[_0x2823('0x32')]['offset']);}_0x40c332[_0x2823('0x38')]=qs[_0x2823('0x39')](_0x165970[_0x2823('0x32')][_0x2823('0x39')]);_0x40c332[_0x2823('0x3a')]=qs[_0x2823('0x3b')](_[_0x2823('0x3c')](_0x165970[_0x2823('0x32')],_0x1cf49e[_0x2823('0x3b')]),_0x3f7c67);if(_0x165970[_0x2823('0x32')]['filter']){_0x40c332[_0x2823('0x3a')]=_[_0x2823('0x3d')](_0x40c332['where'],{'$or':_['map'](_0x3f7c67,function(_0x5629a6){if(_0x5629a6[_0x2823('0x30')]!==_0x2823('0x3e')){var _0x5ce5b8={};_0x5ce5b8[_0x5629a6[_0x2823('0x2c')]]={'$like':'%'+_0x165970[_0x2823('0x32')][_0x2823('0x3f')]+'%'};return _0x5ce5b8;}})});}_0x40c332=_[_0x2823('0x3d')]({},_0x40c332,_0x165970[_0x2823('0x40')]);var _0x51aa26={'where':_0x40c332[_0x2823('0x3a')]};return db[_0x2823('0x2f')][_0x2823('0x20')](_0x51aa26)[_0x2823('0x27')](function(_0x184c61){_0xefa7a5[_0x2823('0x20')]=_0x184c61;if(_0x165970[_0x2823('0x32')][_0x2823('0x41')]){_0x40c332[_0x2823('0x42')]=[{'all':!![]}];}return db['DeskAccount'][_0x2823('0x43')](_0x40c332);})[_0x2823('0x27')](function(_0x310528){_0xefa7a5[_0x2823('0x44')]=_0x310528;return _0xefa7a5;})[_0x2823('0x27')](respondWithFilteredResult(_0xd46c92,_0x40c332))[_0x2823('0x45')](handleError(_0xd46c92,null));};exports[_0x2823('0x46')]=function(_0x30c896,_0x3b6930){var _0x655555={'raw':![],'where':{'id':_0x30c896[_0x2823('0x47')]['id']}},_0x32a55d={};_0x32a55d['model']=_['keys'](db[_0x2823('0x2f')][_0x2823('0x48')]);_0x32a55d[_0x2823('0x32')]=_['keys'](_0x30c896['query']);_0x32a55d['filters']=_[_0x2823('0x35')](_0x32a55d[_0x2823('0x33')],_0x32a55d[_0x2823('0x32')]);_0x655555[_0x2823('0x34')]=_[_0x2823('0x35')](_0x32a55d[_0x2823('0x33')],qs[_0x2823('0x36')](_0x30c896[_0x2823('0x32')][_0x2823('0x36')]));_0x655555[_0x2823('0x34')]=_0x655555[_0x2823('0x34')]['length']?_0x655555[_0x2823('0x34')]:_0x32a55d['model'];if(_0x30c896['query']['includeAll']){_0x655555[_0x2823('0x42')]=[{'all':!![]}];}_0x655555=_[_0x2823('0x3d')]({},_0x655555,_0x30c896[_0x2823('0x40')]);return db[_0x2823('0x2f')][_0x2823('0x49')](_0x655555)[_0x2823('0x27')](handleEntityNotFound(_0x3b6930,null))[_0x2823('0x27')](respondWithResult(_0x3b6930,null))[_0x2823('0x45')](handleError(_0x3b6930,null));};exports[_0x2823('0x4a')]=function(_0x100a42,_0x57d634){return db['DeskAccount'][_0x2823('0x4a')](_0x100a42[_0x2823('0x4b')],{})[_0x2823('0x27')](respondWithResult(_0x57d634,0xc9))[_0x2823('0x45')](handleError(_0x57d634,null));};exports[_0x2823('0x26')]=function(_0x5078dd,_0x9d62c2){if(_0x5078dd[_0x2823('0x4b')]['id']){delete _0x5078dd[_0x2823('0x4b')]['id'];}return db[_0x2823('0x2f')]['find']({'where':{'id':_0x5078dd[_0x2823('0x47')]['id']}})[_0x2823('0x27')](handleEntityNotFound(_0x9d62c2,null))[_0x2823('0x27')](saveUpdates(_0x5078dd[_0x2823('0x4b')],null))[_0x2823('0x27')](respondWithResult(_0x9d62c2,null))[_0x2823('0x45')](handleError(_0x9d62c2,null));};exports[_0x2823('0x28')]=function(_0x291dd7,_0x262192){return db[_0x2823('0x2f')][_0x2823('0x49')]({'where':{'id':_0x291dd7[_0x2823('0x47')]['id']}})[_0x2823('0x27')](handleEntityNotFound(_0x262192,null))[_0x2823('0x27')](removeEntity(_0x262192,null))[_0x2823('0x45')](handleError(_0x262192,null));};exports['getConfigurations']=function(_0x5a5545,_0x35ee5b,_0x2bde2c){var _0x4ca91e={};var _0x384d5b={};var _0x33f4de;var _0x5c9d94;return db[_0x2823('0x2f')][_0x2823('0x4c')]({'where':{'id':_0x5a5545['params']['id']}})[_0x2823('0x27')](handleEntityNotFound(_0x35ee5b,null))[_0x2823('0x27')](function(_0x39b79b){if(_0x39b79b){_0x33f4de=_0x39b79b;_0x384d5b[_0x2823('0x33')]=_[_0x2823('0x4d')](db[_0x2823('0x4e')][_0x2823('0x48')]);_0x384d5b[_0x2823('0x32')]=_[_0x2823('0x4d')](_0x5a5545[_0x2823('0x32')]);_0x384d5b[_0x2823('0x3b')]=_[_0x2823('0x35')](_0x384d5b[_0x2823('0x33')],_0x384d5b['query']);_0x4ca91e[_0x2823('0x34')]=_[_0x2823('0x35')](_0x384d5b['model'],qs[_0x2823('0x36')](_0x5a5545[_0x2823('0x32')][_0x2823('0x36')]));_0x4ca91e['attributes']=_0x4ca91e[_0x2823('0x34')][_0x2823('0x4f')]?_0x4ca91e[_0x2823('0x34')]:_0x384d5b[_0x2823('0x33')];_0x4ca91e[_0x2823('0x38')]=qs[_0x2823('0x39')](_0x5a5545['query'][_0x2823('0x39')]);_0x4ca91e[_0x2823('0x3a')]=qs[_0x2823('0x3b')](_[_0x2823('0x3c')](_0x5a5545[_0x2823('0x32')],_0x384d5b['filters']));if(_0x5a5545[_0x2823('0x32')]['filter']){_0x4ca91e['where']=_[_0x2823('0x3d')](_0x4ca91e['where'],{'$or':_['map'](_0x4ca91e['attributes'],function(_0xadf114){var _0x4b1d37={};_0x4b1d37[_0xadf114]={'$like':'%'+_0x5a5545[_0x2823('0x32')][_0x2823('0x3f')]+'%'};return _0x4b1d37;})});}_0x4ca91e=_[_0x2823('0x3d')]({},_0x4ca91e,_0x5a5545['options']);return _0x33f4de[_0x2823('0x50')](_0x4ca91e);}})[_0x2823('0x27')](function(_0x5c1b58){if(_0x5c1b58){_0x5c9d94=_0x5c1b58[_0x2823('0x4f')];if(!_0x5a5545[_0x2823('0x32')][_0x2823('0x37')]('nolimit')){_0x4ca91e[_0x2823('0x21')]=qs[_0x2823('0x21')](_0x5a5545[_0x2823('0x32')][_0x2823('0x21')]);_0x4ca91e['offset']=qs['offset'](_0x5a5545[_0x2823('0x32')][_0x2823('0x1e')]);}return _0x33f4de[_0x2823('0x50')](_0x4ca91e);}})[_0x2823('0x27')](function(_0x4f8437){if(_0x4f8437){return _0x4f8437?{'count':_0x5c9d94,'rows':_0x4f8437}:null;}})[_0x2823('0x27')](respondWithResult(_0x35ee5b,null))[_0x2823('0x45')](handleError(_0x35ee5b,null));};exports[_0x2823('0x51')]=function(_0x15eeef,_0x35512b,_0x5ef59c){if(_0x15eeef[_0x2823('0x4b')]['id']){delete _0x15eeef[_0x2823('0x4b')]['id'];}return db[_0x2823('0x2f')]['findOne']({'where':{'id':_0x15eeef['params']['id']}})[_0x2823('0x27')](handleEntityNotFound(_0x35512b,null))[_0x2823('0x27')](function(_0x1e8eb2){if(_0x1e8eb2){_0x15eeef[_0x2823('0x4b')][_0x2823('0x52')]=_0x1e8eb2['id'];_0x15eeef[_0x2823('0x4b')]['Subjects']=integrations[_0x2823('0x53')](_0x15eeef[_0x2823('0x4b')][_0x2823('0x54')],_0x15eeef[_0x2823('0x4b')][_0x2823('0x30')]);_0x15eeef[_0x2823('0x4b')][_0x2823('0x55')]=integrations[_0x2823('0x56')](_0x15eeef[_0x2823('0x4b')][_0x2823('0x54')],_0x15eeef[_0x2823('0x4b')]['type']);return db[_0x2823('0x4e')][_0x2823('0x4a')](_0x15eeef[_0x2823('0x4b')],{'include':[{'model':db[_0x2823('0x57')],'as':'Subjects'},{'model':db[_0x2823('0x57')],'as':_0x2823('0x55')}]});}return null;})[_0x2823('0x27')](respondWithResult(_0x35512b,null))['catch'](handleError(_0x35512b,null));};exports['getFields']=function(_0x2e91a0,_0x1b31a3,_0x29ce07){var _0x59f521=[{'name':'priority','label':_0x2823('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 _0x39426f='';return db[_0x2823('0x2f')][_0x2823('0x4c')]({'where':{'id':_0x2e91a0[_0x2823('0x47')]['id']},'attributes':['id','remoteUri',_0x2823('0x59'),_0x2823('0x5a'),'password',_0x2823('0x5b'),'consumerSecret',_0x2823('0x5c'),_0x2823('0x5d')]})['then'](handleEntityNotFound(_0x1b31a3,null))['then'](function(_0x50ac9b){if(_0x50ac9b){_0x39426f=_0x50ac9b['remoteUri'];var _0x2f5484=_0x39426f[_0x2823('0x5e')](-0x1);if(_0x2f5484==='/'){_0x39426f=_0x39426f[_0x2823('0x5f')](0x0,_0x39426f[_0x2823('0x60')](_0x2f5484));}var _0x153631={'method':_0x2823('0x61'),'uri':util[_0x2823('0x62')](_0x2823('0x63'),_0x39426f),'headers':{'Content-Type':_0x2823('0x64'),'Accept':_0x2823('0x64')},'json':!![]};if(_0x50ac9b[_0x2823('0x59')]===_0x2823('0x65')){_0x153631['headers'][_0x2823('0x66')]=util[_0x2823('0x62')](_0x2823('0x67'),new Buffer(util[_0x2823('0x62')](_0x2823('0x68'),_0x50ac9b[_0x2823('0x5a')],_0x50ac9b[_0x2823('0x69')]))[_0x2823('0x6a')](_0x2823('0x6b')));}return rp(_0x153631)[_0x2823('0x27')](function(_0x13137c){return _0x59f521[_0x2823('0x6c')](_[_0x2823('0x2e')](_0x13137c[_0x2823('0x6d')][_0x2823('0x6e')],function(_0x37f251){return{'id':_0x37f251['name'],'name':_0x37f251[_0x2823('0x2c')],'type':_0x37f251[_0x2823('0x30')],'active':_0x37f251[_0x2823('0x6f')],'label':_0x37f251[_0x2823('0x70')],'custom':!![]};}));});}})[_0x2823('0x27')](function(_0x5cb6b4){return{'count':_0x5cb6b4[_0x2823('0x4f')],'rows':_0x5cb6b4};})['then'](respondWithResult(_0x1b31a3,null))['catch'](function(_0x4d0258){var _0xdb95a4=_0x2e91a0[_0x2823('0x32')][_0x2823('0x71')]?0x1f4:_0x4d0258[_0x2823('0x72')]||0x1f4;logger[_0x2823('0x2a')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0xdb95a4,JSON[_0x2823('0x73')](_0x4d0258));delete _0x4d0258[_0x2823('0x2c')];if(_0xdb95a4===0x191){_0xdb95a4=0x190;}_0x1b31a3['status'](_0xdb95a4)[_0x2823('0x74')](_0x2e91a0[_0x2823('0x32')][_0x2823('0x71')]?{'message':_0x2823('0x75'),'statusCode':_0x4d0258[_0x2823('0x72')]}:_0x4d0258);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index 70f87f2..c59883b 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 _0x3f38=['util','../../config/logger','api','request-promise','path','../../config/environment','../../components/integrations/configuration','exports','define','DeskAccount','int_desk_accounts','lodash'];(function(_0x22c29e,_0x24337a){var _0x5d7e57=function(_0x3f990a){while(--_0x3f990a){_0x22c29e['push'](_0x22c29e['shift']());}};_0x5d7e57(++_0x24337a);}(_0x3f38,0xef));var _0x83f3=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x3f38[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0x83f3('0x0'));var util=require(_0x83f3('0x1'));var logger=require(_0x83f3('0x2'))(_0x83f3('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x83f3('0x4'));var fs=require('fs');var path=require(_0x83f3('0x5'));var rimraf=require('rimraf');var config=require(_0x83f3('0x6'));var attributes=require('./intDeskAccount.attributes');var integrations=require(_0x83f3('0x7'));module[_0x83f3('0x8')]=function(_0x2f939f,_0x4920cb){return _0x2f939f[_0x83f3('0x9')](_0x83f3('0xa'),attributes,{'tableName':_0x83f3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbd21=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','define','DeskAccount','int_desk_accounts','lodash'];(function(_0x5afcaf,_0x129776){var _0x1b9f90=function(_0x5cee13){while(--_0x5cee13){_0x5afcaf['push'](_0x5afcaf['shift']());}};_0x1b9f90(++_0x129776);}(_0xbd21,0xed));var _0x1bd2=function(_0x5d92a1,_0x1039a5){_0x5d92a1=_0x5d92a1-0x0;var _0x53ee27=_0xbd21[_0x5d92a1];return _0x53ee27;};'use strict';var _=require(_0x1bd2('0x0'));var util=require(_0x1bd2('0x1'));var logger=require(_0x1bd2('0x2'))(_0x1bd2('0x3'));var moment=require(_0x1bd2('0x4'));var BPromise=require(_0x1bd2('0x5'));var rp=require(_0x1bd2('0x6'));var fs=require('fs');var path=require(_0x1bd2('0x7'));var rimraf=require(_0x1bd2('0x8'));var config=require(_0x1bd2('0x9'));var attributes=require('./intDeskAccount.attributes');var integrations=require(_0x1bd2('0xa'));module['exports']=function(_0x5befdc,_0x405195){return _0x5befdc[_0x1bd2('0xb')](_0x1bd2('0xc'),attributes,{'tableName':_0x1bd2('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.rpc.js b/server/api/intDeskAccount/intDeskAccount.rpc.js index 16b397f..3848211 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 _0xf749=['debug','stringify','catch','ShowDeskAccount','lodash','util','moment','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','DeskAccount,\x20%s,\x20%s','DeskAccount,\x20%s,\x20%s,\x20%s','error','message','GetDeskAccount','DeskAccount','findAll','options','raw','where','attributes','include','map','model'];(function(_0x43b08,_0x15f967){var _0x5e05f4=function(_0x4bb0cb){while(--_0x4bb0cb){_0x43b08['push'](_0x43b08['shift']());}};_0x5e05f4(++_0x15f967);}(_0xf749,0x178));var _0x9f74=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0xf749[_0x46e363];return _0x3fb059;};'use strict';var _=require(_0x9f74('0x0'));var util=require(_0x9f74('0x1'));var moment=require(_0x9f74('0x2'));var BPromise=require('bluebird');var rs=require(_0x9f74('0x3'));var fs=require('fs');var Redis=require(_0x9f74('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x9f74('0x5'))('rpc');var config=require(_0x9f74('0x6'));var jayson=require(_0x9f74('0x7'));var client=jayson[_0x9f74('0x8')][_0x9f74('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1d09a5,_0x2beb51,_0x2715e6){return new BPromise(function(_0xa9084c,_0x4cddde){return client[_0x9f74('0xa')](_0x1d09a5,_0x2715e6)[_0x9f74('0xb')](function(_0x33a913){logger[_0x9f74('0xc')](_0x9f74('0xd'),_0x2beb51,'request\x20sent');logger['debug'](_0x9f74('0xe'),_0x2beb51,'request\x20sent',JSON['stringify'](_0x33a913));if(_0x33a913['error']){if(_0x33a913[_0x9f74('0xf')]['code']===0x1f4){logger[_0x9f74('0xf')](_0x9f74('0xd'),_0x2beb51,_0x33a913[_0x9f74('0xf')][_0x9f74('0x10')]);return _0x4cddde(_0x33a913[_0x9f74('0xf')][_0x9f74('0x10')]);}logger[_0x9f74('0xf')](_0x9f74('0xd'),_0x2beb51,_0x33a913['error'][_0x9f74('0x10')]);return _0xa9084c(_0x33a913['error'][_0x9f74('0x10')]);}else{logger[_0x9f74('0xc')](_0x9f74('0xd'),_0x2beb51,'request\x20sent');_0xa9084c(_0x33a913['result']['message']);}})['catch'](function(_0x3ad43d){logger[_0x9f74('0xf')](_0x9f74('0xd'),_0x2beb51,_0x3ad43d);_0x4cddde(_0x3ad43d);});});}exports[_0x9f74('0x11')]=function(_0x4b9fa1){var _0x570aea=this;return new Promise(function(_0xc5d37f,_0xaa40c4){return db[_0x9f74('0x12')][_0x9f74('0x13')]({'raw':_0x4b9fa1['options']?_0x4b9fa1[_0x9f74('0x14')][_0x9f74('0x15')]===undefined?!![]:![]:!![],'where':_0x4b9fa1[_0x9f74('0x14')]?_0x4b9fa1[_0x9f74('0x14')][_0x9f74('0x16')]||null:null,'attributes':_0x4b9fa1['options']?_0x4b9fa1[_0x9f74('0x14')][_0x9f74('0x17')]||null:null,'limit':_0x4b9fa1[_0x9f74('0x14')]?_0x4b9fa1['options']['limit']||null:null,'include':_0x4b9fa1[_0x9f74('0x14')]?_0x4b9fa1[_0x9f74('0x14')][_0x9f74('0x18')]?_[_0x9f74('0x19')](_0x4b9fa1[_0x9f74('0x14')][_0x9f74('0x18')],function(_0xac97b7){return{'model':db[_0xac97b7[_0x9f74('0x1a')]],'as':_0xac97b7['as'],'attributes':_0xac97b7[_0x9f74('0x17')],'include':_0xac97b7[_0x9f74('0x18')]?_[_0x9f74('0x19')](_0xac97b7[_0x9f74('0x18')],function(_0x26f459){return{'model':db[_0x26f459[_0x9f74('0x1a')]],'as':_0x26f459['as'],'attributes':_0x26f459[_0x9f74('0x17')],'include':_0x26f459['include']?_[_0x9f74('0x19')](_0x26f459[_0x9f74('0x18')],function(_0x10d7be){return{'model':db[_0x10d7be[_0x9f74('0x1a')]],'as':_0x10d7be['as'],'attributes':_0x10d7be[_0x9f74('0x17')]};}):[]};}):[]};}):[]:[]})[_0x9f74('0xb')](function(_0x4b81de){logger[_0x9f74('0xc')](_0x9f74('0x11'),_0x4b9fa1);logger[_0x9f74('0x1b')]('GetDeskAccount',_0x4b9fa1,JSON[_0x9f74('0x1c')](_0x4b81de));_0xc5d37f(_0x4b81de);})[_0x9f74('0x1d')](function(_0x3f1a54){logger[_0x9f74('0xf')](_0x9f74('0x11'),_0x3f1a54['message'],_0x4b9fa1);_0xaa40c4(_0x570aea[_0x9f74('0xf')](0x1f4,_0x3f1a54['message']));});});};exports[_0x9f74('0x1e')]=function(_0xb087b5){var _0xb42b9=this;return new Promise(function(_0x1fd0bd,_0x1e3fb2){return db['DeskAccount']['find']({'raw':_0xb087b5[_0x9f74('0x14')]?_0xb087b5['options'][_0x9f74('0x15')]===undefined?!![]:![]:!![],'where':_0xb087b5[_0x9f74('0x14')]?_0xb087b5[_0x9f74('0x14')][_0x9f74('0x16')]||null:null,'attributes':_0xb087b5[_0x9f74('0x14')]?_0xb087b5['options'][_0x9f74('0x17')]||null:null,'include':_0xb087b5[_0x9f74('0x14')]?_0xb087b5[_0x9f74('0x14')]['include']?_[_0x9f74('0x19')](_0xb087b5[_0x9f74('0x14')]['include'],function(_0x3e65c9){return{'model':db[_0x3e65c9[_0x9f74('0x1a')]],'as':_0x3e65c9['as'],'attributes':_0x3e65c9[_0x9f74('0x17')],'include':_0x3e65c9[_0x9f74('0x18')]?_['map'](_0x3e65c9[_0x9f74('0x18')],function(_0x3e1274){return{'model':db[_0x3e1274['model']],'as':_0x3e1274['as'],'attributes':_0x3e1274[_0x9f74('0x17')],'include':_0x3e1274['include']?_[_0x9f74('0x19')](_0x3e1274[_0x9f74('0x18')],function(_0x8384dd){return{'model':db[_0x8384dd[_0x9f74('0x1a')]],'as':_0x8384dd['as'],'attributes':_0x8384dd['attributes']};}):[]};}):[]};}):[]:[]})[_0x9f74('0xb')](function(_0x5b2565){logger[_0x9f74('0xc')]('ShowDeskAccount',_0xb087b5);logger[_0x9f74('0x1b')](_0x9f74('0x1e'),_0xb087b5,JSON['stringify'](_0x5b2565));_0x1fd0bd(_0x5b2565);})[_0x9f74('0x1d')](function(_0x3f4319){logger['error'](_0x9f74('0x1e'),_0x3f4319[_0x9f74('0x10')],_0xb087b5);_0x1e3fb2(_0xb42b9['error'](0x1f4,_0x3f4319['message']));});});}; \ No newline at end of file +var _0x7849=['stringify','error','message','catch','GetDeskAccount','DeskAccount','findAll','options','where','attributes','limit','map','model','include','find','raw','ShowDeskAccount','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s'];(function(_0x3704aa,_0x3c6b14){var _0x127a94=function(_0x69db71){while(--_0x69db71){_0x3704aa['push'](_0x3704aa['shift']());}};_0x127a94(++_0x3c6b14);}(_0x7849,0x1b5));var _0x9784=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7849[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x9784('0x0'));var util=require(_0x9784('0x1'));var moment=require(_0x9784('0x2'));var BPromise=require('bluebird');var rs=require(_0x9784('0x3'));var fs=require('fs');var Redis=require(_0x9784('0x4'));var db=require(_0x9784('0x5'))['db'];var utils=require(_0x9784('0x6'));var logger=require(_0x9784('0x7'))(_0x9784('0x8'));var config=require('../../config/environment');var jayson=require(_0x9784('0x9'));var client=jayson[_0x9784('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x53df29,_0x53e0b4,_0x1e2cc6){return new BPromise(function(_0x441c63,_0x32530b){return client[_0x9784('0xb')](_0x53df29,_0x1e2cc6)[_0x9784('0xc')](function(_0x44a559){logger[_0x9784('0xd')](_0x9784('0xe'),_0x53e0b4,_0x9784('0xf'));logger[_0x9784('0x10')](_0x9784('0x11'),_0x53e0b4,_0x9784('0xf'),JSON[_0x9784('0x12')](_0x44a559));if(_0x44a559[_0x9784('0x13')]){if(_0x44a559[_0x9784('0x13')]['code']===0x1f4){logger[_0x9784('0x13')](_0x9784('0xe'),_0x53e0b4,_0x44a559[_0x9784('0x13')][_0x9784('0x14')]);return _0x32530b(_0x44a559[_0x9784('0x13')][_0x9784('0x14')]);}logger[_0x9784('0x13')](_0x9784('0xe'),_0x53e0b4,_0x44a559['error'][_0x9784('0x14')]);return _0x441c63(_0x44a559[_0x9784('0x13')][_0x9784('0x14')]);}else{logger[_0x9784('0xd')]('DeskAccount,\x20%s,\x20%s',_0x53e0b4,_0x9784('0xf'));_0x441c63(_0x44a559['result']['message']);}})[_0x9784('0x15')](function(_0x236575){logger[_0x9784('0x13')]('DeskAccount,\x20%s,\x20%s',_0x53e0b4,_0x236575);_0x32530b(_0x236575);});});}exports[_0x9784('0x16')]=function(_0x56e10d){var _0x4bd28c=this;return new Promise(function(_0x41deba,_0x3ae9d0){return db[_0x9784('0x17')][_0x9784('0x18')]({'raw':_0x56e10d[_0x9784('0x19')]?_0x56e10d[_0x9784('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x56e10d['options']?_0x56e10d[_0x9784('0x19')][_0x9784('0x1a')]||null:null,'attributes':_0x56e10d[_0x9784('0x19')]?_0x56e10d[_0x9784('0x19')][_0x9784('0x1b')]||null:null,'limit':_0x56e10d[_0x9784('0x19')]?_0x56e10d['options'][_0x9784('0x1c')]||null:null,'include':_0x56e10d[_0x9784('0x19')]?_0x56e10d['options']['include']?_[_0x9784('0x1d')](_0x56e10d[_0x9784('0x19')]['include'],function(_0x4dddc2){return{'model':db[_0x4dddc2[_0x9784('0x1e')]],'as':_0x4dddc2['as'],'attributes':_0x4dddc2[_0x9784('0x1b')],'include':_0x4dddc2['include']?_[_0x9784('0x1d')](_0x4dddc2[_0x9784('0x1f')],function(_0x46229c){return{'model':db[_0x46229c[_0x9784('0x1e')]],'as':_0x46229c['as'],'attributes':_0x46229c[_0x9784('0x1b')],'include':_0x46229c['include']?_[_0x9784('0x1d')](_0x46229c['include'],function(_0xbcabbd){return{'model':db[_0xbcabbd[_0x9784('0x1e')]],'as':_0xbcabbd['as'],'attributes':_0xbcabbd[_0x9784('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x9784('0xc')](function(_0x14ecbc){logger[_0x9784('0xd')](_0x9784('0x16'),_0x56e10d);logger[_0x9784('0x10')](_0x9784('0x16'),_0x56e10d,JSON[_0x9784('0x12')](_0x14ecbc));_0x41deba(_0x14ecbc);})['catch'](function(_0x4293fd){logger[_0x9784('0x13')]('GetDeskAccount',_0x4293fd[_0x9784('0x14')],_0x56e10d);_0x3ae9d0(_0x4bd28c[_0x9784('0x13')](0x1f4,_0x4293fd[_0x9784('0x14')]));});});};exports['ShowDeskAccount']=function(_0xd18c1a){var _0x33ce25=this;return new Promise(function(_0x590207,_0x233117){return db[_0x9784('0x17')][_0x9784('0x20')]({'raw':_0xd18c1a['options']?_0xd18c1a[_0x9784('0x19')][_0x9784('0x21')]===undefined?!![]:![]:!![],'where':_0xd18c1a[_0x9784('0x19')]?_0xd18c1a[_0x9784('0x19')][_0x9784('0x1a')]||null:null,'attributes':_0xd18c1a['options']?_0xd18c1a[_0x9784('0x19')][_0x9784('0x1b')]||null:null,'include':_0xd18c1a[_0x9784('0x19')]?_0xd18c1a['options'][_0x9784('0x1f')]?_['map'](_0xd18c1a['options'][_0x9784('0x1f')],function(_0x457388){return{'model':db[_0x457388[_0x9784('0x1e')]],'as':_0x457388['as'],'attributes':_0x457388['attributes'],'include':_0x457388[_0x9784('0x1f')]?_['map'](_0x457388[_0x9784('0x1f')],function(_0x1a3e9d){return{'model':db[_0x1a3e9d[_0x9784('0x1e')]],'as':_0x1a3e9d['as'],'attributes':_0x1a3e9d['attributes'],'include':_0x1a3e9d[_0x9784('0x1f')]?_['map'](_0x1a3e9d['include'],function(_0x7ee58b){return{'model':db[_0x7ee58b['model']],'as':_0x7ee58b['as'],'attributes':_0x7ee58b[_0x9784('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x9784('0xc')](function(_0x217e97){logger[_0x9784('0xd')](_0x9784('0x22'),_0xd18c1a);logger[_0x9784('0x10')](_0x9784('0x22'),_0xd18c1a,JSON[_0x9784('0x12')](_0x217e97));_0x590207(_0x217e97);})[_0x9784('0x15')](function(_0x3227ef){logger[_0x9784('0x13')](_0x9784('0x22'),_0x3227ef[_0x9784('0x14')],_0xd18c1a);_0x233117(_0x33ce25[_0x9784('0x13')](0x1f4,_0x3227ef['message']));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index 93648e1..5cd6660 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 _0x9957=['/:id/subjects','getSubjects','getDescriptions','/:id/tags','getTags','post','create','setTags','put','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields'];(function(_0x4d085f,_0x3c7393){var _0x1ae582=function(_0x2fffce){while(--_0x2fffce){_0x4d085f['push'](_0x4d085f['shift']());}};_0x1ae582(++_0x3c7393);}(_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/fields',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/descriptions',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x14')]('/:id/tags',auth['isAuthenticated'](),controller[_0x7995('0x16')]);router[_0x7995('0x17')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x18')]);router[_0x7995('0x19')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller['destroy']);module[_0x7995('0x1a')]=router; \ No newline at end of file +var _0x9c44=['destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./intDeskConfiguration.controller','isAuthenticated','index','get','/:id','/:id/fields','getFields','getSubjects','/:id/descriptions','/:id/tags','post','setTags','put','update'];(function(_0x17b617,_0x2979b1){var _0x186663=function(_0x2f88b7){while(--_0x2f88b7){_0x17b617['push'](_0x17b617['shift']());}};_0x186663(++_0x2979b1);}(_0x9c44,0x178));var _0x49c4=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0x9c44[_0x334841];return _0x5beb4b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x49c4('0x6'));router['get']('/',auth[_0x49c4('0x7')](),controller[_0x49c4('0x8')]);router[_0x49c4('0x9')](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller['show']);router[_0x49c4('0x9')](_0x49c4('0xb'),auth[_0x49c4('0x7')](),controller[_0x49c4('0xc')]);router['get']('/:id/subjects',auth[_0x49c4('0x7')](),controller[_0x49c4('0xd')]);router['get'](_0x49c4('0xe'),auth[_0x49c4('0x7')](),controller['getDescriptions']);router['get'](_0x49c4('0xf'),auth[_0x49c4('0x7')](),controller['getTags']);router[_0x49c4('0x10')]('/',auth[_0x49c4('0x7')](),controller['create']);router[_0x49c4('0x10')](_0x49c4('0xf'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x11')]);router[_0x49c4('0x12')](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x13')]);router['delete'](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x14')]);module[_0x49c4('0x15')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index ae4939e..d4402ee 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 _0xffad=['exports','STRING'];(function(_0xda44d7,_0x5836b2){var _0x18cad9=function(_0x55d29f){while(--_0x55d29f){_0xda44d7['push'](_0xda44d7['shift']());}};_0x18cad9(++_0x5836b2);}(_0xffad,0x104));var _0xdffa=function(_0x17b29a,_0x331f99){_0x17b29a=_0x17b29a-0x0;var _0x2b0c69=_0xffad[_0x17b29a];return _0x2b0c69;};'use strict';var Sequelize=require('sequelize');module[_0xdffa('0x0')]={'name':{'type':Sequelize[_0xdffa('0x1')]},'description':{'type':Sequelize[_0xdffa('0x1')]}}; \ No newline at end of file +var _0xfe73=['exports','STRING','sequelize'];(function(_0x5935eb,_0x82649b){var _0x34b049=function(_0xed1431){while(--_0xed1431){_0x5935eb['push'](_0x5935eb['shift']());}};_0x34b049(++_0x82649b);}(_0xfe73,0xf5));var _0x3fe7=function(_0x5f3f88,_0x562baf){_0x5f3f88=_0x5f3f88-0x0;var _0xd08119=_0xfe73[_0x5f3f88];return _0xd08119;};'use strict';var Sequelize=require(_0x3fe7('0x0'));module[_0x3fe7('0x1')]={'name':{'type':Sequelize[_0x3fe7('0x2')]},'description':{'type':Sequelize[_0x3fe7('0x2')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index 2535f51..23ecbad 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 _0x3c52=['index','rawAttributes','fieldName','type','map','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','findAll','catch','show','include','options','DeskConfiguration','find','create','body','params','getFields','DeskField','getSubjects','findOne','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','update','destroy','then','end','error','stack','name'];(function(_0x4d821c,_0x22bd0e){var _0x15dd5b=function(_0x20e8f2){while(--_0x20e8f2){_0x4d821c['push'](_0x4d821c['shift']());}};_0x15dd5b(++_0x22bd0e);}(_0x3c52,0xd2));var _0x23c5=function(_0x461685,_0x154c7b){_0x461685=_0x461685-0x0;var _0x441392=_0x3c52[_0x461685];return _0x441392;};'use strict';var emlformat=require(_0x23c5('0x0'));var rimraf=require(_0x23c5('0x1'));var zipdir=require(_0x23c5('0x2'));var jsonpatch=require(_0x23c5('0x3'));var rp=require('request-promise');var moment=require(_0x23c5('0x4'));var BPromise=require(_0x23c5('0x5'));var Mustache=require(_0x23c5('0x6'));var util=require('util');var path=require(_0x23c5('0x7'));var sox=require('sox');var csv=require(_0x23c5('0x8'));var ejs=require(_0x23c5('0x9'));var fs=require('fs');var fs_extra=require(_0x23c5('0xa'));var _=require(_0x23c5('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x23c5('0xc'));var deskjs=require(_0x23c5('0xd'));var toCsv=require(_0x23c5('0x8'));var querystring=require('querystring');var Papa=require(_0x23c5('0xe'));var Redis=require(_0x23c5('0xf'));var authService=require(_0x23c5('0x10'));var qs=require(_0x23c5('0x11'));var as=require(_0x23c5('0x12'));var hardwareService=require(_0x23c5('0x13'));var logger=require(_0x23c5('0x14'))(_0x23c5('0x15'));var utils=require(_0x23c5('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x23c5('0x17'));var db=require(_0x23c5('0x18'))['db'];function respondWithStatusCode(_0x4939e8,_0x18f73a){_0x18f73a=_0x18f73a||0xcc;return function(_0x4cba11){if(_0x4cba11){return _0x4939e8[_0x23c5('0x19')](_0x18f73a);}return _0x4939e8[_0x23c5('0x1a')](_0x18f73a)['end']();};}function respondWithResult(_0x388e34,_0x1b8d50){_0x1b8d50=_0x1b8d50||0xc8;return function(_0x5ce82e){if(_0x5ce82e){return _0x388e34[_0x23c5('0x1a')](_0x1b8d50)[_0x23c5('0x1b')](_0x5ce82e);}};}function respondWithFilteredResult(_0x3a896f,_0x114f54){return function(_0x3bacf2){if(_0x3bacf2){var _0x273bfb=typeof _0x114f54[_0x23c5('0x1c')]===_0x23c5('0x1d')&&typeof _0x114f54[_0x23c5('0x1e')]===_0x23c5('0x1d');var _0x1c1d2c=_0x3bacf2[_0x23c5('0x1f')];var _0x244bf1=_0x273bfb?0x0:_0x114f54[_0x23c5('0x1c')];var _0xc9a8f3=_0x273bfb?_0x3bacf2[_0x23c5('0x1f')]:_0x114f54[_0x23c5('0x1c')]+_0x114f54[_0x23c5('0x1e')];var _0x363782;if(_0xc9a8f3>=_0x1c1d2c){_0xc9a8f3=_0x1c1d2c;_0x363782=0xc8;}else{_0x363782=0xce;}_0x3a896f[_0x23c5('0x1a')](_0x363782);return _0x3a896f[_0x23c5('0x20')](_0x23c5('0x21'),_0x244bf1+'-'+_0xc9a8f3+'/'+_0x1c1d2c)[_0x23c5('0x1b')](_0x3bacf2);}return null;};}function patchUpdates(_0x4eae04){return function(_0x4b9b36){try{jsonpatch['apply'](_0x4b9b36,_0x4eae04,!![]);}catch(_0x254459){return BPromise[_0x23c5('0x22')](_0x254459);}return _0x4b9b36['save']();};}function saveUpdates(_0x5b92f4,_0x4f5f2b){return function(_0x3c3dfc){if(_0x3c3dfc){return _0x3c3dfc[_0x23c5('0x23')](_0x5b92f4)['then'](function(_0x39758d){return _0x39758d;});}return null;};}function removeEntity(_0x29facc,_0x16ebdc){return function(_0xd56817){if(_0xd56817){return _0xd56817[_0x23c5('0x24')]()[_0x23c5('0x25')](function(){_0x29facc['status'](0xcc)[_0x23c5('0x26')]();});}};}function handleEntityNotFound(_0x23c06f,_0x50f13c){return function(_0x4f0a0e){if(!_0x4f0a0e){_0x23c06f[_0x23c5('0x19')](0x194);}return _0x4f0a0e;};}function handleError(_0x29f72a,_0x1967aa){_0x1967aa=_0x1967aa||0x1f4;return function(_0x1e56e2){logger[_0x23c5('0x27')](_0x1e56e2[_0x23c5('0x28')]);if(_0x1e56e2[_0x23c5('0x29')]){delete _0x1e56e2[_0x23c5('0x29')];}_0x29f72a[_0x23c5('0x1a')](_0x1967aa)['send'](_0x1e56e2);};}exports[_0x23c5('0x2a')]=function(_0xe2e5b0,_0x35a246){var _0x22b1fc={},_0x92a5ef={},_0x297d79={'count':0x0,'rows':[]};var _0xa6eafa=_['map'](db['DeskConfiguration'][_0x23c5('0x2b')],function(_0x20b1e4){return{'name':_0x20b1e4[_0x23c5('0x2c')],'type':_0x20b1e4[_0x23c5('0x2d')]['key']};});_0x92a5ef['model']=_[_0x23c5('0x2e')](_0xa6eafa,_0x23c5('0x29'));_0x92a5ef['query']=_[_0x23c5('0x2f')](_0xe2e5b0[_0x23c5('0x30')]);_0x92a5ef[_0x23c5('0x31')]=_[_0x23c5('0x32')](_0x92a5ef[_0x23c5('0x33')],_0x92a5ef[_0x23c5('0x30')]);_0x22b1fc[_0x23c5('0x34')]=_['intersection'](_0x92a5ef[_0x23c5('0x33')],qs[_0x23c5('0x35')](_0xe2e5b0[_0x23c5('0x30')]['fields']));_0x22b1fc[_0x23c5('0x34')]=_0x22b1fc['attributes'][_0x23c5('0x36')]?_0x22b1fc[_0x23c5('0x34')]:_0x92a5ef[_0x23c5('0x33')];if(!_0xe2e5b0[_0x23c5('0x30')][_0x23c5('0x37')](_0x23c5('0x38'))){_0x22b1fc[_0x23c5('0x1e')]=qs[_0x23c5('0x1e')](_0xe2e5b0['query'][_0x23c5('0x1e')]);_0x22b1fc[_0x23c5('0x1c')]=qs[_0x23c5('0x1c')](_0xe2e5b0['query']['offset']);}_0x22b1fc[_0x23c5('0x39')]=qs[_0x23c5('0x3a')](_0xe2e5b0[_0x23c5('0x30')][_0x23c5('0x3a')]);_0x22b1fc[_0x23c5('0x3b')]=qs[_0x23c5('0x31')](_[_0x23c5('0x3c')](_0xe2e5b0['query'],_0x92a5ef[_0x23c5('0x31')]),_0xa6eafa);if(_0xe2e5b0[_0x23c5('0x30')]['filter']){_0x22b1fc[_0x23c5('0x3b')]=_[_0x23c5('0x3d')](_0x22b1fc[_0x23c5('0x3b')],{'$or':_['map'](_0xa6eafa,function(_0x123200){if(_0x123200[_0x23c5('0x2d')]!==_0x23c5('0x3e')){var _0x273177={};_0x273177[_0x123200[_0x23c5('0x29')]]={'$like':'%'+_0xe2e5b0['query'][_0x23c5('0x3f')]+'%'};return _0x273177;}})});}_0x22b1fc=_[_0x23c5('0x3d')]({},_0x22b1fc,_0xe2e5b0['options']);var _0x64bfc7={'where':_0x22b1fc[_0x23c5('0x3b')]};return db['DeskConfiguration'][_0x23c5('0x1f')](_0x64bfc7)[_0x23c5('0x25')](function(_0x178d39){_0x297d79[_0x23c5('0x1f')]=_0x178d39;if(_0xe2e5b0[_0x23c5('0x30')][_0x23c5('0x40')]){_0x22b1fc['include']=[{'all':!![]}];}return db['DeskConfiguration'][_0x23c5('0x41')](_0x22b1fc);})['then'](function(_0x475a96){_0x297d79['rows']=_0x475a96;return _0x297d79;})[_0x23c5('0x25')](respondWithFilteredResult(_0x35a246,_0x22b1fc))[_0x23c5('0x42')](handleError(_0x35a246,null));};exports[_0x23c5('0x43')]=function(_0x23411e,_0x2c8b1b){var _0x17fb12={'raw':![],'where':{'id':_0x23411e['params']['id']}},_0x3c98ec={};_0x3c98ec[_0x23c5('0x33')]=_[_0x23c5('0x2f')](db['DeskConfiguration'][_0x23c5('0x2b')]);_0x3c98ec[_0x23c5('0x30')]=_[_0x23c5('0x2f')](_0x23411e[_0x23c5('0x30')]);_0x3c98ec[_0x23c5('0x31')]=_[_0x23c5('0x32')](_0x3c98ec[_0x23c5('0x33')],_0x3c98ec[_0x23c5('0x30')]);_0x17fb12['attributes']=_[_0x23c5('0x32')](_0x3c98ec[_0x23c5('0x33')],qs[_0x23c5('0x35')](_0x23411e[_0x23c5('0x30')]['fields']));_0x17fb12['attributes']=_0x17fb12['attributes']['length']?_0x17fb12['attributes']:_0x3c98ec[_0x23c5('0x33')];if(_0x23411e[_0x23c5('0x30')][_0x23c5('0x40')]){_0x17fb12[_0x23c5('0x44')]=[{'all':!![]}];}_0x17fb12=_[_0x23c5('0x3d')]({},_0x17fb12,_0x23411e[_0x23c5('0x45')]);return db[_0x23c5('0x46')][_0x23c5('0x47')](_0x17fb12)[_0x23c5('0x25')](handleEntityNotFound(_0x2c8b1b,null))[_0x23c5('0x25')](respondWithResult(_0x2c8b1b,null))['catch'](handleError(_0x2c8b1b,null));};exports['create']=function(_0x11a623,_0x2a0255){return db[_0x23c5('0x46')][_0x23c5('0x48')](_0x11a623[_0x23c5('0x49')],{})[_0x23c5('0x25')](respondWithResult(_0x2a0255,0xc9))[_0x23c5('0x42')](handleError(_0x2a0255,null));};exports[_0x23c5('0x23')]=function(_0x577184,_0x1f48b4){if(_0x577184[_0x23c5('0x49')]['id']){delete _0x577184[_0x23c5('0x49')]['id'];}return db[_0x23c5('0x46')]['find']({'where':{'id':_0x577184['params']['id']}})[_0x23c5('0x25')](handleEntityNotFound(_0x1f48b4,null))[_0x23c5('0x25')](saveUpdates(_0x577184[_0x23c5('0x49')],null))['then'](respondWithResult(_0x1f48b4,null))[_0x23c5('0x42')](handleError(_0x1f48b4,null));};exports[_0x23c5('0x24')]=function(_0xddcad7,_0x4098e1){return db['DeskConfiguration'][_0x23c5('0x47')]({'where':{'id':_0xddcad7[_0x23c5('0x4a')]['id']}})[_0x23c5('0x25')](handleEntityNotFound(_0x4098e1,null))[_0x23c5('0x25')](removeEntity(_0x4098e1,null))[_0x23c5('0x42')](handleError(_0x4098e1,null));};exports[_0x23c5('0x4b')]=function(_0x4a1851,_0x2bc08f,_0x537589){var _0xdef26={};var _0x347c9c={};var _0x20290d;var _0x2cee15;return db[_0x23c5('0x46')]['findOne']({'where':{'id':_0x4a1851[_0x23c5('0x4a')]['id']}})[_0x23c5('0x25')](handleEntityNotFound(_0x2bc08f,null))['then'](function(_0x5b7f59){if(_0x5b7f59){_0x20290d=_0x5b7f59;_0x347c9c[_0x23c5('0x33')]=_[_0x23c5('0x2f')](db[_0x23c5('0x4c')][_0x23c5('0x2b')]);_0x347c9c[_0x23c5('0x30')]=_[_0x23c5('0x2f')](_0x4a1851[_0x23c5('0x30')]);_0x347c9c[_0x23c5('0x31')]=_['intersection'](_0x347c9c[_0x23c5('0x33')],_0x347c9c[_0x23c5('0x30')]);_0xdef26[_0x23c5('0x34')]=_[_0x23c5('0x32')](_0x347c9c[_0x23c5('0x33')],qs['fields'](_0x4a1851[_0x23c5('0x30')][_0x23c5('0x35')]));_0xdef26['attributes']=_0xdef26[_0x23c5('0x34')][_0x23c5('0x36')]?_0xdef26[_0x23c5('0x34')]:_0x347c9c[_0x23c5('0x33')];_0xdef26[_0x23c5('0x39')]=qs[_0x23c5('0x3a')](_0x4a1851[_0x23c5('0x30')][_0x23c5('0x3a')]);_0xdef26[_0x23c5('0x3b')]=qs[_0x23c5('0x31')](_[_0x23c5('0x3c')](_0x4a1851[_0x23c5('0x30')],_0x347c9c[_0x23c5('0x31')]));if(_0x4a1851[_0x23c5('0x30')][_0x23c5('0x3f')]){_0xdef26['where']=_[_0x23c5('0x3d')](_0xdef26['where'],{'$or':_[_0x23c5('0x2e')](_0xdef26['attributes'],function(_0x1fac20){var _0x3d5380={};_0x3d5380[_0x1fac20]={'$like':'%'+_0x4a1851[_0x23c5('0x30')][_0x23c5('0x3f')]+'%'};return _0x3d5380;})});}_0xdef26=_[_0x23c5('0x3d')]({},_0xdef26,_0x4a1851[_0x23c5('0x45')]);return _0x20290d[_0x23c5('0x4b')](_0xdef26);}})[_0x23c5('0x25')](function(_0x1756c5){if(_0x1756c5){_0x2cee15=_0x1756c5[_0x23c5('0x36')];if(!_0x4a1851['query'][_0x23c5('0x37')](_0x23c5('0x38'))){_0xdef26['limit']=qs[_0x23c5('0x1e')](_0x4a1851[_0x23c5('0x30')][_0x23c5('0x1e')]);_0xdef26[_0x23c5('0x1c')]=qs[_0x23c5('0x1c')](_0x4a1851['query'][_0x23c5('0x1c')]);}return _0x20290d['getFields'](_0xdef26);}})[_0x23c5('0x25')](function(_0x3f015f){if(_0x3f015f){return _0x3f015f?{'count':_0x2cee15,'rows':_0x3f015f}:null;}})[_0x23c5('0x25')](respondWithResult(_0x2bc08f,null))['catch'](handleError(_0x2bc08f,null));};exports[_0x23c5('0x4d')]=function(_0x3e23d8,_0x3e1f73,_0x2a0382){var _0x467aa3={};var _0xaae51e={};var _0x1b3e7a;var _0x145824;return db[_0x23c5('0x46')][_0x23c5('0x4e')]({'where':{'id':_0x3e23d8[_0x23c5('0x4a')]['id']}})[_0x23c5('0x25')](handleEntityNotFound(_0x3e1f73,null))[_0x23c5('0x25')](function(_0x177669){if(_0x177669){_0x1b3e7a=_0x177669;_0xaae51e[_0x23c5('0x33')]=_['keys'](db['DeskField'][_0x23c5('0x2b')]);_0xaae51e['query']=_[_0x23c5('0x2f')](_0x3e23d8[_0x23c5('0x30')]);_0xaae51e[_0x23c5('0x31')]=_[_0x23c5('0x32')](_0xaae51e[_0x23c5('0x33')],_0xaae51e['query']);_0x467aa3[_0x23c5('0x34')]=_[_0x23c5('0x32')](_0xaae51e['model'],qs['fields'](_0x3e23d8[_0x23c5('0x30')][_0x23c5('0x35')]));_0x467aa3['attributes']=_0x467aa3['attributes']['length']?_0x467aa3[_0x23c5('0x34')]:_0xaae51e[_0x23c5('0x33')];_0x467aa3[_0x23c5('0x39')]=qs[_0x23c5('0x3a')](_0x3e23d8[_0x23c5('0x30')][_0x23c5('0x3a')]);_0x467aa3[_0x23c5('0x3b')]=qs[_0x23c5('0x31')](_[_0x23c5('0x3c')](_0x3e23d8[_0x23c5('0x30')],_0xaae51e['filters']));if(_0x3e23d8[_0x23c5('0x30')][_0x23c5('0x3f')]){_0x467aa3[_0x23c5('0x3b')]=_[_0x23c5('0x3d')](_0x467aa3[_0x23c5('0x3b')],{'$or':_[_0x23c5('0x2e')](_0x467aa3[_0x23c5('0x34')],function(_0x17a42a){var _0x1b85ab={};_0x1b85ab[_0x17a42a]={'$like':'%'+_0x3e23d8['query'][_0x23c5('0x3f')]+'%'};return _0x1b85ab;})});}_0x467aa3=_[_0x23c5('0x3d')]({},_0x467aa3,_0x3e23d8[_0x23c5('0x45')]);return _0x1b3e7a['getSubjects'](_0x467aa3);}})['then'](function(_0xc63c80){if(_0xc63c80){_0x145824=_0xc63c80[_0x23c5('0x36')];if(!_0x3e23d8['query'][_0x23c5('0x37')](_0x23c5('0x38'))){_0x467aa3[_0x23c5('0x1e')]=qs[_0x23c5('0x1e')](_0x3e23d8[_0x23c5('0x30')][_0x23c5('0x1e')]);_0x467aa3['offset']=qs['offset'](_0x3e23d8[_0x23c5('0x30')][_0x23c5('0x1c')]);}return _0x1b3e7a[_0x23c5('0x4d')](_0x467aa3);}})[_0x23c5('0x25')](function(_0x2e8635){if(_0x2e8635){return _0x2e8635?{'count':_0x145824,'rows':_0x2e8635}:null;}})['then'](respondWithResult(_0x3e1f73,null))[_0x23c5('0x42')](handleError(_0x3e1f73,null));};exports['getDescriptions']=function(_0x25e519,_0x5ee048,_0x3eae85){var _0x4fabb3={};var _0xa6b957={};var _0x7f32a8;var _0x16ea9c;return db['DeskConfiguration'][_0x23c5('0x4e')]({'where':{'id':_0x25e519[_0x23c5('0x4a')]['id']}})[_0x23c5('0x25')](handleEntityNotFound(_0x5ee048,null))[_0x23c5('0x25')](function(_0x4955b2){if(_0x4955b2){_0x7f32a8=_0x4955b2;_0xa6b957[_0x23c5('0x33')]=_[_0x23c5('0x2f')](db[_0x23c5('0x4c')][_0x23c5('0x2b')]);_0xa6b957[_0x23c5('0x30')]=_[_0x23c5('0x2f')](_0x25e519[_0x23c5('0x30')]);_0xa6b957[_0x23c5('0x31')]=_[_0x23c5('0x32')](_0xa6b957['model'],_0xa6b957[_0x23c5('0x30')]);_0x4fabb3['attributes']=_[_0x23c5('0x32')](_0xa6b957['model'],qs[_0x23c5('0x35')](_0x25e519['query'][_0x23c5('0x35')]));_0x4fabb3[_0x23c5('0x34')]=_0x4fabb3[_0x23c5('0x34')][_0x23c5('0x36')]?_0x4fabb3['attributes']:_0xa6b957[_0x23c5('0x33')];_0x4fabb3['order']=qs[_0x23c5('0x3a')](_0x25e519[_0x23c5('0x30')][_0x23c5('0x3a')]);_0x4fabb3[_0x23c5('0x3b')]=qs['filters'](_[_0x23c5('0x3c')](_0x25e519[_0x23c5('0x30')],_0xa6b957[_0x23c5('0x31')]));if(_0x25e519['query'][_0x23c5('0x3f')]){_0x4fabb3[_0x23c5('0x3b')]=_[_0x23c5('0x3d')](_0x4fabb3['where'],{'$or':_[_0x23c5('0x2e')](_0x4fabb3['attributes'],function(_0x807dea){var _0x558a35={};_0x558a35[_0x807dea]={'$like':'%'+_0x25e519[_0x23c5('0x30')][_0x23c5('0x3f')]+'%'};return _0x558a35;})});}_0x4fabb3=_[_0x23c5('0x3d')]({},_0x4fabb3,_0x25e519[_0x23c5('0x45')]);return _0x7f32a8[_0x23c5('0x4f')](_0x4fabb3);}})[_0x23c5('0x25')](function(_0x216612){if(_0x216612){_0x16ea9c=_0x216612[_0x23c5('0x36')];if(!_0x25e519[_0x23c5('0x30')][_0x23c5('0x37')](_0x23c5('0x38'))){_0x4fabb3['limit']=qs[_0x23c5('0x1e')](_0x25e519['query']['limit']);_0x4fabb3[_0x23c5('0x1c')]=qs[_0x23c5('0x1c')](_0x25e519[_0x23c5('0x30')][_0x23c5('0x1c')]);}return _0x7f32a8[_0x23c5('0x4f')](_0x4fabb3);}})[_0x23c5('0x25')](function(_0x143f49){if(_0x143f49){return _0x143f49?{'count':_0x16ea9c,'rows':_0x143f49}:null;}})['then'](respondWithResult(_0x5ee048,null))[_0x23c5('0x42')](handleError(_0x5ee048,null));};exports[_0x23c5('0x50')]=function(_0x55b144,_0x37e707,_0x52227f){var _0x34d41e={};var _0x32e3bb={};var _0x3dab68;var _0x559dd9;return db['DeskConfiguration'][_0x23c5('0x4e')]({'where':{'id':_0x55b144['params']['id']}})[_0x23c5('0x25')](handleEntityNotFound(_0x37e707,null))['then'](function(_0xcd81a){if(_0xcd81a){_0x3dab68=_0xcd81a;_0x32e3bb[_0x23c5('0x33')]=_[_0x23c5('0x2f')](db[_0x23c5('0x51')][_0x23c5('0x2b')]);_0x32e3bb[_0x23c5('0x30')]=_[_0x23c5('0x2f')](_0x55b144[_0x23c5('0x30')]);_0x32e3bb[_0x23c5('0x31')]=_[_0x23c5('0x32')](_0x32e3bb['model'],_0x32e3bb[_0x23c5('0x30')]);_0x34d41e[_0x23c5('0x34')]=_[_0x23c5('0x32')](_0x32e3bb['model'],qs[_0x23c5('0x35')](_0x55b144[_0x23c5('0x30')][_0x23c5('0x35')]));_0x34d41e[_0x23c5('0x34')]=_0x34d41e[_0x23c5('0x34')][_0x23c5('0x36')]?_0x34d41e[_0x23c5('0x34')]:_0x32e3bb[_0x23c5('0x33')];_0x34d41e['order']=qs[_0x23c5('0x3a')](_0x55b144[_0x23c5('0x30')][_0x23c5('0x3a')]);_0x34d41e[_0x23c5('0x3b')]=qs[_0x23c5('0x31')](_['pick'](_0x55b144[_0x23c5('0x30')],_0x32e3bb[_0x23c5('0x31')]));if(_0x55b144['query'][_0x23c5('0x3f')]){_0x34d41e['where']=_[_0x23c5('0x3d')](_0x34d41e[_0x23c5('0x3b')],{'$or':_[_0x23c5('0x2e')](_0x34d41e[_0x23c5('0x34')],function(_0x19908b){var _0x121f7f={};_0x121f7f[_0x19908b]={'$like':'%'+_0x55b144[_0x23c5('0x30')][_0x23c5('0x3f')]+'%'};return _0x121f7f;})});}_0x34d41e=_[_0x23c5('0x3d')]({},_0x34d41e,_0x55b144[_0x23c5('0x45')]);return _0x3dab68['getTags'](_0x34d41e);}})['then'](function(_0x3fa13e){if(_0x3fa13e){_0x559dd9=_0x3fa13e[_0x23c5('0x36')];if(!_0x55b144['query']['hasOwnProperty'](_0x23c5('0x38'))){_0x34d41e['limit']=qs[_0x23c5('0x1e')](_0x55b144['query'][_0x23c5('0x1e')]);_0x34d41e[_0x23c5('0x1c')]=qs['offset'](_0x55b144['query'][_0x23c5('0x1c')]);}return _0x3dab68[_0x23c5('0x50')](_0x34d41e);}})[_0x23c5('0x25')](function(_0x4f2509){if(_0x4f2509){return _0x4f2509?{'count':_0x559dd9,'rows':_0x4f2509}:null;}})[_0x23c5('0x25')](respondWithResult(_0x37e707,null))[_0x23c5('0x42')](handleError(_0x37e707,null));};exports['setTags']=function(_0x4aa388,_0x1c3a7a,_0x496163){if(_0x4aa388[_0x23c5('0x49')]['id']){delete _0x4aa388[_0x23c5('0x49')]['id'];}return db[_0x23c5('0x46')][_0x23c5('0x4e')]({'where':{'id':_0x4aa388[_0x23c5('0x4a')]['id']}})[_0x23c5('0x25')](handleEntityNotFound(_0x1c3a7a,null))[_0x23c5('0x25')](function(_0x543d9d){if(_0x543d9d){return _0x543d9d[_0x23c5('0x52')](_0x4aa388[_0x23c5('0x49')][_0x23c5('0x53')]||[]);}return null;})[_0x23c5('0x25')](respondWithResult(_0x1c3a7a,null))[_0x23c5('0x42')](handleError(_0x1c3a7a,null));}; \ No newline at end of file +var _0x3d56=['ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','Content-Range','apply','save','update','then','destroy','error','stack','name','send','map','rawAttributes','type','key','model','keys','query','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filters','filter','merge','VIRTUAL','DeskConfiguration','include','findAll','catch','show','params','length','includeAll','find','create','body','getFields','findOne','DeskField','nolimit','getSubjects','options','getDescriptions','getTags','Tag','setTags'];(function(_0x3fd77c,_0x58405a){var _0x32f6ba=function(_0x1eca72){while(--_0x1eca72){_0x3fd77c['push'](_0x3fd77c['shift']());}};_0x32f6ba(++_0x58405a);}(_0x3d56,0x19b));var _0x63d5=function(_0x5ac605,_0x4ac11e){_0x5ac605=_0x5ac605-0x0;var _0x9a378b=_0x3d56[_0x5ac605];return _0x9a378b;};'use strict';var emlformat=require(_0x63d5('0x0'));var rimraf=require(_0x63d5('0x1'));var zipdir=require(_0x63d5('0x2'));var jsonpatch=require(_0x63d5('0x3'));var rp=require(_0x63d5('0x4'));var moment=require(_0x63d5('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x63d5('0x6'));var util=require('util');var path=require(_0x63d5('0x7'));var sox=require(_0x63d5('0x8'));var csv=require(_0x63d5('0x9'));var ejs=require(_0x63d5('0xa'));var fs=require('fs');var fs_extra=require(_0x63d5('0xb'));var _=require(_0x63d5('0xc'));var squel=require(_0x63d5('0xd'));var crypto=require(_0x63d5('0xe'));var jsforce=require(_0x63d5('0xf'));var deskjs=require(_0x63d5('0x10'));var toCsv=require(_0x63d5('0x9'));var querystring=require('querystring');var Papa=require(_0x63d5('0x11'));var Redis=require(_0x63d5('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x63d5('0x13'))(_0x63d5('0x14'));var utils=require(_0x63d5('0x15'));var config=require(_0x63d5('0x16'));var licenseUtil=require(_0x63d5('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x35f8c5,_0x6bae2a){_0x6bae2a=_0x6bae2a||0xcc;return function(_0x2f49b7){if(_0x2f49b7){return _0x35f8c5[_0x63d5('0x18')](_0x6bae2a);}return _0x35f8c5[_0x63d5('0x19')](_0x6bae2a)[_0x63d5('0x1a')]();};}function respondWithResult(_0x2f60f4,_0x2c6c78){_0x2c6c78=_0x2c6c78||0xc8;return function(_0x207314){if(_0x207314){return _0x2f60f4['status'](_0x2c6c78)['json'](_0x207314);}};}function respondWithFilteredResult(_0x3b25c1,_0x117398){return function(_0x2c02c9){if(_0x2c02c9){var _0x2253ae=typeof _0x117398[_0x63d5('0x1b')]===_0x63d5('0x1c')&&typeof _0x117398[_0x63d5('0x1d')]===_0x63d5('0x1c');var _0x59f092=_0x2c02c9['count'];var _0x46fb69=_0x2253ae?0x0:_0x117398[_0x63d5('0x1b')];var _0xf20640=_0x2253ae?_0x2c02c9[_0x63d5('0x1e')]:_0x117398['offset']+_0x117398[_0x63d5('0x1d')];var _0x3a36aa;if(_0xf20640>=_0x59f092){_0xf20640=_0x59f092;_0x3a36aa=0xc8;}else{_0x3a36aa=0xce;}_0x3b25c1[_0x63d5('0x19')](_0x3a36aa);return _0x3b25c1['set'](_0x63d5('0x1f'),_0x46fb69+'-'+_0xf20640+'/'+_0x59f092)['json'](_0x2c02c9);}return null;};}function patchUpdates(_0x1e111a){return function(_0x1e3bbd){try{jsonpatch[_0x63d5('0x20')](_0x1e3bbd,_0x1e111a,!![]);}catch(_0x43c756){return BPromise['reject'](_0x43c756);}return _0x1e3bbd[_0x63d5('0x21')]();};}function saveUpdates(_0x2c74e6,_0x5ecffb){return function(_0x22a8db){if(_0x22a8db){return _0x22a8db[_0x63d5('0x22')](_0x2c74e6)[_0x63d5('0x23')](function(_0x5b5aa9){return _0x5b5aa9;});}return null;};}function removeEntity(_0x4e3a3d,_0x24bd8d){return function(_0x36491d){if(_0x36491d){return _0x36491d[_0x63d5('0x24')]()[_0x63d5('0x23')](function(){_0x4e3a3d['status'](0xcc)[_0x63d5('0x1a')]();});}};}function handleEntityNotFound(_0x2fa5b4,_0x407c75){return function(_0x71d8aa){if(!_0x71d8aa){_0x2fa5b4[_0x63d5('0x18')](0x194);}return _0x71d8aa;};}function handleError(_0x2e265f,_0x6db4f9){_0x6db4f9=_0x6db4f9||0x1f4;return function(_0x41e11a){logger[_0x63d5('0x25')](_0x41e11a[_0x63d5('0x26')]);if(_0x41e11a[_0x63d5('0x27')]){delete _0x41e11a[_0x63d5('0x27')];}_0x2e265f[_0x63d5('0x19')](_0x6db4f9)[_0x63d5('0x28')](_0x41e11a);};}exports['index']=function(_0x46c8e3,_0x2948fc){var _0x48ecb6={},_0x3a1916={},_0x3485af={'count':0x0,'rows':[]};var _0x285c45=_[_0x63d5('0x29')](db['DeskConfiguration'][_0x63d5('0x2a')],function(_0x3cb2de){return{'name':_0x3cb2de['fieldName'],'type':_0x3cb2de[_0x63d5('0x2b')][_0x63d5('0x2c')]};});_0x3a1916[_0x63d5('0x2d')]=_[_0x63d5('0x29')](_0x285c45,'name');_0x3a1916['query']=_[_0x63d5('0x2e')](_0x46c8e3[_0x63d5('0x2f')]);_0x3a1916['filters']=_[_0x63d5('0x30')](_0x3a1916['model'],_0x3a1916[_0x63d5('0x2f')]);_0x48ecb6[_0x63d5('0x31')]=_[_0x63d5('0x30')](_0x3a1916[_0x63d5('0x2d')],qs[_0x63d5('0x32')](_0x46c8e3['query']['fields']));_0x48ecb6[_0x63d5('0x31')]=_0x48ecb6[_0x63d5('0x31')]['length']?_0x48ecb6[_0x63d5('0x31')]:_0x3a1916[_0x63d5('0x2d')];if(!_0x46c8e3[_0x63d5('0x2f')][_0x63d5('0x33')]('nolimit')){_0x48ecb6[_0x63d5('0x1d')]=qs['limit'](_0x46c8e3['query'][_0x63d5('0x1d')]);_0x48ecb6[_0x63d5('0x1b')]=qs[_0x63d5('0x1b')](_0x46c8e3[_0x63d5('0x2f')][_0x63d5('0x1b')]);}_0x48ecb6[_0x63d5('0x34')]=qs[_0x63d5('0x35')](_0x46c8e3['query'][_0x63d5('0x35')]);_0x48ecb6[_0x63d5('0x36')]=qs['filters'](_[_0x63d5('0x37')](_0x46c8e3[_0x63d5('0x2f')],_0x3a1916[_0x63d5('0x38')]),_0x285c45);if(_0x46c8e3['query'][_0x63d5('0x39')]){_0x48ecb6[_0x63d5('0x36')]=_[_0x63d5('0x3a')](_0x48ecb6[_0x63d5('0x36')],{'$or':_[_0x63d5('0x29')](_0x285c45,function(_0x342366){if(_0x342366[_0x63d5('0x2b')]!==_0x63d5('0x3b')){var _0x3bd361={};_0x3bd361[_0x342366[_0x63d5('0x27')]]={'$like':'%'+_0x46c8e3[_0x63d5('0x2f')][_0x63d5('0x39')]+'%'};return _0x3bd361;}})});}_0x48ecb6=_[_0x63d5('0x3a')]({},_0x48ecb6,_0x46c8e3['options']);var _0x2b794b={'where':_0x48ecb6[_0x63d5('0x36')]};return db[_0x63d5('0x3c')][_0x63d5('0x1e')](_0x2b794b)[_0x63d5('0x23')](function(_0x14d5fb){_0x3485af[_0x63d5('0x1e')]=_0x14d5fb;if(_0x46c8e3['query']['includeAll']){_0x48ecb6[_0x63d5('0x3d')]=[{'all':!![]}];}return db[_0x63d5('0x3c')][_0x63d5('0x3e')](_0x48ecb6);})['then'](function(_0x3a376f){_0x3485af['rows']=_0x3a376f;return _0x3485af;})[_0x63d5('0x23')](respondWithFilteredResult(_0x2948fc,_0x48ecb6))[_0x63d5('0x3f')](handleError(_0x2948fc,null));};exports[_0x63d5('0x40')]=function(_0x136805,_0x253011){var _0x25998f={'raw':![],'where':{'id':_0x136805[_0x63d5('0x41')]['id']}},_0x228b9e={};_0x228b9e['model']=_[_0x63d5('0x2e')](db['DeskConfiguration'][_0x63d5('0x2a')]);_0x228b9e[_0x63d5('0x2f')]=_[_0x63d5('0x2e')](_0x136805['query']);_0x228b9e['filters']=_[_0x63d5('0x30')](_0x228b9e[_0x63d5('0x2d')],_0x228b9e[_0x63d5('0x2f')]);_0x25998f[_0x63d5('0x31')]=_['intersection'](_0x228b9e[_0x63d5('0x2d')],qs[_0x63d5('0x32')](_0x136805[_0x63d5('0x2f')][_0x63d5('0x32')]));_0x25998f[_0x63d5('0x31')]=_0x25998f[_0x63d5('0x31')][_0x63d5('0x42')]?_0x25998f[_0x63d5('0x31')]:_0x228b9e[_0x63d5('0x2d')];if(_0x136805[_0x63d5('0x2f')][_0x63d5('0x43')]){_0x25998f[_0x63d5('0x3d')]=[{'all':!![]}];}_0x25998f=_[_0x63d5('0x3a')]({},_0x25998f,_0x136805['options']);return db[_0x63d5('0x3c')][_0x63d5('0x44')](_0x25998f)['then'](handleEntityNotFound(_0x253011,null))['then'](respondWithResult(_0x253011,null))[_0x63d5('0x3f')](handleError(_0x253011,null));};exports[_0x63d5('0x45')]=function(_0x1f3088,_0x5c1240){return db['DeskConfiguration']['create'](_0x1f3088[_0x63d5('0x46')],{})[_0x63d5('0x23')](respondWithResult(_0x5c1240,0xc9))['catch'](handleError(_0x5c1240,null));};exports[_0x63d5('0x22')]=function(_0x5a1768,_0x4b2569){if(_0x5a1768[_0x63d5('0x46')]['id']){delete _0x5a1768[_0x63d5('0x46')]['id'];}return db[_0x63d5('0x3c')]['find']({'where':{'id':_0x5a1768[_0x63d5('0x41')]['id']}})['then'](handleEntityNotFound(_0x4b2569,null))[_0x63d5('0x23')](saveUpdates(_0x5a1768[_0x63d5('0x46')],null))[_0x63d5('0x23')](respondWithResult(_0x4b2569,null))[_0x63d5('0x3f')](handleError(_0x4b2569,null));};exports['destroy']=function(_0x32284a,_0x5e825c){return db[_0x63d5('0x3c')][_0x63d5('0x44')]({'where':{'id':_0x32284a[_0x63d5('0x41')]['id']}})[_0x63d5('0x23')](handleEntityNotFound(_0x5e825c,null))[_0x63d5('0x23')](removeEntity(_0x5e825c,null))[_0x63d5('0x3f')](handleError(_0x5e825c,null));};exports[_0x63d5('0x47')]=function(_0x2e2866,_0x37841b,_0x50f91c){var _0xc1f561={};var _0x1544fd={};var _0x31628f;var _0xde0bf4;return db[_0x63d5('0x3c')][_0x63d5('0x48')]({'where':{'id':_0x2e2866[_0x63d5('0x41')]['id']}})[_0x63d5('0x23')](handleEntityNotFound(_0x37841b,null))[_0x63d5('0x23')](function(_0x3464be){if(_0x3464be){_0x31628f=_0x3464be;_0x1544fd[_0x63d5('0x2d')]=_[_0x63d5('0x2e')](db[_0x63d5('0x49')]['rawAttributes']);_0x1544fd[_0x63d5('0x2f')]=_[_0x63d5('0x2e')](_0x2e2866['query']);_0x1544fd[_0x63d5('0x38')]=_[_0x63d5('0x30')](_0x1544fd['model'],_0x1544fd[_0x63d5('0x2f')]);_0xc1f561[_0x63d5('0x31')]=_[_0x63d5('0x30')](_0x1544fd[_0x63d5('0x2d')],qs['fields'](_0x2e2866['query']['fields']));_0xc1f561['attributes']=_0xc1f561['attributes'][_0x63d5('0x42')]?_0xc1f561['attributes']:_0x1544fd[_0x63d5('0x2d')];_0xc1f561[_0x63d5('0x34')]=qs[_0x63d5('0x35')](_0x2e2866['query'][_0x63d5('0x35')]);_0xc1f561[_0x63d5('0x36')]=qs[_0x63d5('0x38')](_[_0x63d5('0x37')](_0x2e2866[_0x63d5('0x2f')],_0x1544fd['filters']));if(_0x2e2866[_0x63d5('0x2f')]['filter']){_0xc1f561[_0x63d5('0x36')]=_[_0x63d5('0x3a')](_0xc1f561[_0x63d5('0x36')],{'$or':_[_0x63d5('0x29')](_0xc1f561[_0x63d5('0x31')],function(_0x437641){var _0x58123b={};_0x58123b[_0x437641]={'$like':'%'+_0x2e2866['query'][_0x63d5('0x39')]+'%'};return _0x58123b;})});}_0xc1f561=_[_0x63d5('0x3a')]({},_0xc1f561,_0x2e2866['options']);return _0x31628f[_0x63d5('0x47')](_0xc1f561);}})[_0x63d5('0x23')](function(_0x161b8d){if(_0x161b8d){_0xde0bf4=_0x161b8d['length'];if(!_0x2e2866[_0x63d5('0x2f')]['hasOwnProperty'](_0x63d5('0x4a'))){_0xc1f561['limit']=qs[_0x63d5('0x1d')](_0x2e2866[_0x63d5('0x2f')][_0x63d5('0x1d')]);_0xc1f561[_0x63d5('0x1b')]=qs[_0x63d5('0x1b')](_0x2e2866['query'][_0x63d5('0x1b')]);}return _0x31628f['getFields'](_0xc1f561);}})[_0x63d5('0x23')](function(_0x5f0f83){if(_0x5f0f83){return _0x5f0f83?{'count':_0xde0bf4,'rows':_0x5f0f83}:null;}})['then'](respondWithResult(_0x37841b,null))[_0x63d5('0x3f')](handleError(_0x37841b,null));};exports[_0x63d5('0x4b')]=function(_0x48f9de,_0x12245d,_0x11bfdc){var _0x22e68b={};var _0xaac216={};var _0xa8dfc1;var _0x5b3b37;return db[_0x63d5('0x3c')]['findOne']({'where':{'id':_0x48f9de[_0x63d5('0x41')]['id']}})[_0x63d5('0x23')](handleEntityNotFound(_0x12245d,null))[_0x63d5('0x23')](function(_0x2fb265){if(_0x2fb265){_0xa8dfc1=_0x2fb265;_0xaac216['model']=_[_0x63d5('0x2e')](db[_0x63d5('0x49')][_0x63d5('0x2a')]);_0xaac216[_0x63d5('0x2f')]=_[_0x63d5('0x2e')](_0x48f9de[_0x63d5('0x2f')]);_0xaac216[_0x63d5('0x38')]=_[_0x63d5('0x30')](_0xaac216[_0x63d5('0x2d')],_0xaac216[_0x63d5('0x2f')]);_0x22e68b[_0x63d5('0x31')]=_[_0x63d5('0x30')](_0xaac216[_0x63d5('0x2d')],qs[_0x63d5('0x32')](_0x48f9de[_0x63d5('0x2f')][_0x63d5('0x32')]));_0x22e68b[_0x63d5('0x31')]=_0x22e68b[_0x63d5('0x31')]['length']?_0x22e68b[_0x63d5('0x31')]:_0xaac216['model'];_0x22e68b[_0x63d5('0x34')]=qs[_0x63d5('0x35')](_0x48f9de['query'][_0x63d5('0x35')]);_0x22e68b['where']=qs[_0x63d5('0x38')](_[_0x63d5('0x37')](_0x48f9de[_0x63d5('0x2f')],_0xaac216[_0x63d5('0x38')]));if(_0x48f9de[_0x63d5('0x2f')][_0x63d5('0x39')]){_0x22e68b['where']=_[_0x63d5('0x3a')](_0x22e68b[_0x63d5('0x36')],{'$or':_[_0x63d5('0x29')](_0x22e68b[_0x63d5('0x31')],function(_0x104c70){var _0x420217={};_0x420217[_0x104c70]={'$like':'%'+_0x48f9de['query'][_0x63d5('0x39')]+'%'};return _0x420217;})});}_0x22e68b=_[_0x63d5('0x3a')]({},_0x22e68b,_0x48f9de[_0x63d5('0x4c')]);return _0xa8dfc1['getSubjects'](_0x22e68b);}})[_0x63d5('0x23')](function(_0x11415b){if(_0x11415b){_0x5b3b37=_0x11415b[_0x63d5('0x42')];if(!_0x48f9de[_0x63d5('0x2f')][_0x63d5('0x33')](_0x63d5('0x4a'))){_0x22e68b['limit']=qs[_0x63d5('0x1d')](_0x48f9de[_0x63d5('0x2f')]['limit']);_0x22e68b[_0x63d5('0x1b')]=qs[_0x63d5('0x1b')](_0x48f9de['query'][_0x63d5('0x1b')]);}return _0xa8dfc1['getSubjects'](_0x22e68b);}})[_0x63d5('0x23')](function(_0x23282e){if(_0x23282e){return _0x23282e?{'count':_0x5b3b37,'rows':_0x23282e}:null;}})[_0x63d5('0x23')](respondWithResult(_0x12245d,null))['catch'](handleError(_0x12245d,null));};exports[_0x63d5('0x4d')]=function(_0x4484cb,_0x3d395c,_0x131b77){var _0x351f20={};var _0x7f3124={};var _0x46fe5b;var _0x3a413f;return db[_0x63d5('0x3c')][_0x63d5('0x48')]({'where':{'id':_0x4484cb[_0x63d5('0x41')]['id']}})['then'](handleEntityNotFound(_0x3d395c,null))[_0x63d5('0x23')](function(_0x21288f){if(_0x21288f){_0x46fe5b=_0x21288f;_0x7f3124[_0x63d5('0x2d')]=_[_0x63d5('0x2e')](db[_0x63d5('0x49')][_0x63d5('0x2a')]);_0x7f3124[_0x63d5('0x2f')]=_['keys'](_0x4484cb['query']);_0x7f3124[_0x63d5('0x38')]=_[_0x63d5('0x30')](_0x7f3124[_0x63d5('0x2d')],_0x7f3124['query']);_0x351f20[_0x63d5('0x31')]=_[_0x63d5('0x30')](_0x7f3124['model'],qs['fields'](_0x4484cb['query']['fields']));_0x351f20['attributes']=_0x351f20[_0x63d5('0x31')][_0x63d5('0x42')]?_0x351f20[_0x63d5('0x31')]:_0x7f3124[_0x63d5('0x2d')];_0x351f20[_0x63d5('0x34')]=qs[_0x63d5('0x35')](_0x4484cb['query']['sort']);_0x351f20[_0x63d5('0x36')]=qs[_0x63d5('0x38')](_[_0x63d5('0x37')](_0x4484cb[_0x63d5('0x2f')],_0x7f3124[_0x63d5('0x38')]));if(_0x4484cb['query'][_0x63d5('0x39')]){_0x351f20[_0x63d5('0x36')]=_[_0x63d5('0x3a')](_0x351f20[_0x63d5('0x36')],{'$or':_[_0x63d5('0x29')](_0x351f20[_0x63d5('0x31')],function(_0x50c849){var _0xa2e631={};_0xa2e631[_0x50c849]={'$like':'%'+_0x4484cb['query'][_0x63d5('0x39')]+'%'};return _0xa2e631;})});}_0x351f20=_[_0x63d5('0x3a')]({},_0x351f20,_0x4484cb[_0x63d5('0x4c')]);return _0x46fe5b[_0x63d5('0x4d')](_0x351f20);}})[_0x63d5('0x23')](function(_0x530429){if(_0x530429){_0x3a413f=_0x530429[_0x63d5('0x42')];if(!_0x4484cb[_0x63d5('0x2f')][_0x63d5('0x33')](_0x63d5('0x4a'))){_0x351f20[_0x63d5('0x1d')]=qs['limit'](_0x4484cb[_0x63d5('0x2f')][_0x63d5('0x1d')]);_0x351f20[_0x63d5('0x1b')]=qs[_0x63d5('0x1b')](_0x4484cb[_0x63d5('0x2f')][_0x63d5('0x1b')]);}return _0x46fe5b[_0x63d5('0x4d')](_0x351f20);}})[_0x63d5('0x23')](function(_0x14b1df){if(_0x14b1df){return _0x14b1df?{'count':_0x3a413f,'rows':_0x14b1df}:null;}})[_0x63d5('0x23')](respondWithResult(_0x3d395c,null))[_0x63d5('0x3f')](handleError(_0x3d395c,null));};exports[_0x63d5('0x4e')]=function(_0x566b41,_0x17cf14,_0x534d2b){var _0x10ca09={};var _0x47c0db={};var _0x2228a1;var _0x12e5b3;return db[_0x63d5('0x3c')][_0x63d5('0x48')]({'where':{'id':_0x566b41[_0x63d5('0x41')]['id']}})[_0x63d5('0x23')](handleEntityNotFound(_0x17cf14,null))['then'](function(_0x5874aa){if(_0x5874aa){_0x2228a1=_0x5874aa;_0x47c0db['model']=_['keys'](db[_0x63d5('0x4f')][_0x63d5('0x2a')]);_0x47c0db[_0x63d5('0x2f')]=_[_0x63d5('0x2e')](_0x566b41[_0x63d5('0x2f')]);_0x47c0db[_0x63d5('0x38')]=_['intersection'](_0x47c0db[_0x63d5('0x2d')],_0x47c0db[_0x63d5('0x2f')]);_0x10ca09[_0x63d5('0x31')]=_[_0x63d5('0x30')](_0x47c0db['model'],qs[_0x63d5('0x32')](_0x566b41[_0x63d5('0x2f')]['fields']));_0x10ca09[_0x63d5('0x31')]=_0x10ca09[_0x63d5('0x31')]['length']?_0x10ca09['attributes']:_0x47c0db['model'];_0x10ca09['order']=qs['sort'](_0x566b41[_0x63d5('0x2f')]['sort']);_0x10ca09[_0x63d5('0x36')]=qs[_0x63d5('0x38')](_[_0x63d5('0x37')](_0x566b41[_0x63d5('0x2f')],_0x47c0db[_0x63d5('0x38')]));if(_0x566b41[_0x63d5('0x2f')][_0x63d5('0x39')]){_0x10ca09[_0x63d5('0x36')]=_[_0x63d5('0x3a')](_0x10ca09[_0x63d5('0x36')],{'$or':_['map'](_0x10ca09[_0x63d5('0x31')],function(_0x89c56c){var _0x372a0a={};_0x372a0a[_0x89c56c]={'$like':'%'+_0x566b41[_0x63d5('0x2f')][_0x63d5('0x39')]+'%'};return _0x372a0a;})});}_0x10ca09=_[_0x63d5('0x3a')]({},_0x10ca09,_0x566b41[_0x63d5('0x4c')]);return _0x2228a1[_0x63d5('0x4e')](_0x10ca09);}})[_0x63d5('0x23')](function(_0x358139){if(_0x358139){_0x12e5b3=_0x358139[_0x63d5('0x42')];if(!_0x566b41[_0x63d5('0x2f')][_0x63d5('0x33')](_0x63d5('0x4a'))){_0x10ca09['limit']=qs[_0x63d5('0x1d')](_0x566b41[_0x63d5('0x2f')]['limit']);_0x10ca09['offset']=qs['offset'](_0x566b41[_0x63d5('0x2f')][_0x63d5('0x1b')]);}return _0x2228a1['getTags'](_0x10ca09);}})[_0x63d5('0x23')](function(_0xdf9570){if(_0xdf9570){return _0xdf9570?{'count':_0x12e5b3,'rows':_0xdf9570}:null;}})['then'](respondWithResult(_0x17cf14,null))[_0x63d5('0x3f')](handleError(_0x17cf14,null));};exports[_0x63d5('0x50')]=function(_0x58dca,_0xd88481,_0x428429){if(_0x58dca['body']['id']){delete _0x58dca[_0x63d5('0x46')]['id'];}return db[_0x63d5('0x3c')][_0x63d5('0x48')]({'where':{'id':_0x58dca[_0x63d5('0x41')]['id']}})[_0x63d5('0x23')](handleEntityNotFound(_0xd88481,null))[_0x63d5('0x23')](function(_0x267cd3){if(_0x267cd3){return _0x267cd3[_0x63d5('0x50')](_0x58dca[_0x63d5('0x46')][_0x63d5('0x51')]||[]);}return null;})[_0x63d5('0x23')](respondWithResult(_0xd88481,null))[_0x63d5('0x3f')](handleError(_0xd88481,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index 0714fbe..ebad234 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 _0x1c09=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDeskConfiguration.attributes','define','lodash','../../config/logger'];(function(_0x31c19c,_0xbe4b70){var _0x1a87f7=function(_0x23cf92){while(--_0x23cf92){_0x31c19c['push'](_0x31c19c['shift']());}};_0x1a87f7(++_0xbe4b70);}(_0x1c09,0x111));var _0x91c0=function(_0x505a0f,_0x8c4a1e){_0x505a0f=_0x505a0f-0x0;var _0x25f41b=_0x1c09[_0x505a0f];return _0x25f41b;};'use strict';var _=require(_0x91c0('0x0'));var util=require('util');var logger=require(_0x91c0('0x1'))(_0x91c0('0x2'));var moment=require(_0x91c0('0x3'));var BPromise=require(_0x91c0('0x4'));var rp=require(_0x91c0('0x5'));var fs=require('fs');var path=require(_0x91c0('0x6'));var rimraf=require(_0x91c0('0x7'));var config=require(_0x91c0('0x8'));var attributes=require(_0x91c0('0x9'));module['exports']=function(_0x428d8b,_0x563ae6){return _0x428d8b[_0x91c0('0xa')]('DeskConfiguration',attributes,{'tableName':'int_desk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaf00=['./intDeskConfiguration.attributes','exports','define','DeskConfiguration','int_desk_configurations','lodash','../../config/logger','api','moment','path','rimraf','../../config/environment'];(function(_0x466e57,_0x21b819){var _0x34df42=function(_0x3e9758){while(--_0x3e9758){_0x466e57['push'](_0x466e57['shift']());}};_0x34df42(++_0x21b819);}(_0xaf00,0xf5));var _0x0af0=function(_0x2e50a2,_0x27f31e){_0x2e50a2=_0x2e50a2-0x0;var _0x47e5de=_0xaf00[_0x2e50a2];return _0x47e5de;};'use strict';var _=require(_0x0af0('0x0'));var util=require('util');var logger=require(_0x0af0('0x1'))(_0x0af0('0x2'));var moment=require(_0x0af0('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x0af0('0x4'));var rimraf=require(_0x0af0('0x5'));var config=require(_0x0af0('0x6'));var attributes=require(_0x0af0('0x7'));module[_0x0af0('0x8')]=function(_0x2329b3,_0x3a85f0){return _0x2329b3[_0x0af0('0x9')](_0x0af0('0xa'),attributes,{'tableName':_0x0af0('0xb'),'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 b2b1171..254e795 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 _0x6629=['info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then'];(function(_0x4f8c61,_0x5bab21){var _0x503e65=function(_0x7c1c6d){while(--_0x7c1c6d){_0x4f8c61['push'](_0x4f8c61['shift']());}};_0x503e65(++_0x5bab21);}(_0x6629,0x1c2));var _0x9662=function(_0x2ab1de,_0x1aef5d){_0x2ab1de=_0x2ab1de-0x0;var _0x3f903f=_0x6629[_0x2ab1de];return _0x3f903f;};'use strict';var _=require(_0x9662('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x9662('0x1'));var rs=require(_0x9662('0x2'));var fs=require('fs');var Redis=require(_0x9662('0x3'));var db=require(_0x9662('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x9662('0x5'))(_0x9662('0x6'));var config=require(_0x9662('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x9662('0x8')][_0x9662('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x457681,_0x5ec533,_0x1a1809){return new BPromise(function(_0x58e45a,_0xa866f2){return client[_0x9662('0xa')](_0x457681,_0x1a1809)[_0x9662('0xb')](function(_0x11ae91){logger[_0x9662('0xc')](_0x9662('0xd'),_0x5ec533,_0x9662('0xe'));logger[_0x9662('0xf')](_0x9662('0x10'),_0x5ec533,_0x9662('0xe'),JSON[_0x9662('0x11')](_0x11ae91));if(_0x11ae91['error']){if(_0x11ae91[_0x9662('0x12')]['code']===0x1f4){logger[_0x9662('0x12')](_0x9662('0xd'),_0x5ec533,_0x11ae91['error'][_0x9662('0x13')]);return _0xa866f2(_0x11ae91[_0x9662('0x12')][_0x9662('0x13')]);}logger['error']('DeskConfiguration,\x20%s,\x20%s',_0x5ec533,_0x11ae91[_0x9662('0x12')]['message']);return _0x58e45a(_0x11ae91[_0x9662('0x12')][_0x9662('0x13')]);}else{logger[_0x9662('0xc')]('DeskConfiguration,\x20%s,\x20%s',_0x5ec533,'request\x20sent');_0x58e45a(_0x11ae91['result'][_0x9662('0x13')]);}})[_0x9662('0x14')](function(_0x4930c5){logger[_0x9662('0x12')](_0x9662('0xd'),_0x5ec533,_0x4930c5);_0xa866f2(_0x4930c5);});});} \ No newline at end of file +var _0x352e=['client','http','request','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x50e0b4,_0x1057f7){var _0x2fa8b0=function(_0x3766bc){while(--_0x3766bc){_0x50e0b4['push'](_0x50e0b4['shift']());}};_0x2fa8b0(++_0x1057f7);}(_0x352e,0x1a6));var _0xe352=function(_0x5ccb86,_0x23b679){_0x5ccb86=_0x5ccb86-0x0;var _0x5440d8=_0x352e[_0x5ccb86];return _0x5440d8;};'use strict';var _=require(_0xe352('0x0'));var util=require(_0xe352('0x1'));var moment=require(_0xe352('0x2'));var BPromise=require(_0xe352('0x3'));var rs=require(_0xe352('0x4'));var fs=require('fs');var Redis=require(_0xe352('0x5'));var db=require(_0xe352('0x6'))['db'];var utils=require(_0xe352('0x7'));var logger=require('../../config/logger')(_0xe352('0x8'));var config=require(_0xe352('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xe352('0xa')][_0xe352('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x32d7c6,_0x6549bb,_0x5b9266){return new BPromise(function(_0x2bd5e5,_0x3cfd5b){return client[_0xe352('0xc')](_0x32d7c6,_0x5b9266)[_0xe352('0xd')](function(_0x5b1b22){logger[_0xe352('0xe')](_0xe352('0xf'),_0x6549bb,_0xe352('0x10'));logger[_0xe352('0x11')](_0xe352('0x12'),_0x6549bb,_0xe352('0x10'),JSON['stringify'](_0x5b1b22));if(_0x5b1b22['error']){if(_0x5b1b22[_0xe352('0x13')][_0xe352('0x14')]===0x1f4){logger[_0xe352('0x13')](_0xe352('0xf'),_0x6549bb,_0x5b1b22[_0xe352('0x13')][_0xe352('0x15')]);return _0x3cfd5b(_0x5b1b22['error'][_0xe352('0x15')]);}logger[_0xe352('0x13')]('DeskConfiguration,\x20%s,\x20%s',_0x6549bb,_0x5b1b22[_0xe352('0x13')][_0xe352('0x15')]);return _0x2bd5e5(_0x5b1b22['error'][_0xe352('0x15')]);}else{logger[_0xe352('0xe')](_0xe352('0xf'),_0x6549bb,_0xe352('0x10'));_0x2bd5e5(_0x5b1b22[_0xe352('0x16')][_0xe352('0x15')]);}})[_0xe352('0x17')](function(_0x1fede5){logger['error'](_0xe352('0xf'),_0x6549bb,_0x1fede5);_0x3cfd5b(_0x1fede5);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index 2492d91..1a4f13c 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 _0x3b68=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','put','update','destroy','exports','util','path','connect-timeout','express','Router'];(function(_0x583262,_0x58f9a5){var _0x3399ca=function(_0x9e8ea4){while(--_0x9e8ea4){_0x583262['push'](_0x583262['shift']());}};_0x3399ca(++_0x58f9a5);}(_0x3b68,0x1bd));var _0x83b6=function(_0x20acf7,_0x23202c){_0x20acf7=_0x20acf7-0x0;var _0x35bf0e=_0x3b68[_0x20acf7];return _0x35bf0e;};'use strict';var multer=require('multer');var util=require(_0x83b6('0x0'));var path=require(_0x83b6('0x1'));var timeout=require(_0x83b6('0x2'));var express=require(_0x83b6('0x3'));var router=express[_0x83b6('0x4')]();var fs_extra=require(_0x83b6('0x5'));var auth=require(_0x83b6('0x6'));var interaction=require(_0x83b6('0x7'));var config=require(_0x83b6('0x8'));var controller=require('./intDeskField.controller');router[_0x83b6('0x9')]('/',auth[_0x83b6('0xa')](),controller[_0x83b6('0xb')]);router['get'](_0x83b6('0xc'),auth[_0x83b6('0xa')](),controller[_0x83b6('0xd')]);router['post']('/',auth[_0x83b6('0xa')](),controller['create']);router[_0x83b6('0xe')](_0x83b6('0xc'),auth[_0x83b6('0xa')](),controller[_0x83b6('0xf')]);router['delete'](_0x83b6('0xc'),auth[_0x83b6('0xa')](),controller[_0x83b6('0x10')]);module[_0x83b6('0x11')]=router; \ No newline at end of file +var _0x4a47=['get','isAuthenticated','index','post','put','/:id','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0x4a47,0x15e));var _0x74a4=function(_0x1d9163,_0x79567d){_0x1d9163=_0x1d9163-0x0;var _0xb42197=_0x4a47[_0x1d9163];return _0xb42197;};'use strict';var multer=require(_0x74a4('0x0'));var util=require(_0x74a4('0x1'));var path=require(_0x74a4('0x2'));var timeout=require(_0x74a4('0x3'));var express=require(_0x74a4('0x4'));var router=express[_0x74a4('0x5')]();var fs_extra=require(_0x74a4('0x6'));var auth=require(_0x74a4('0x7'));var interaction=require(_0x74a4('0x8'));var config=require(_0x74a4('0x9'));var controller=require('./intDeskField.controller');router[_0x74a4('0xa')]('/',auth[_0x74a4('0xb')](),controller[_0x74a4('0xc')]);router[_0x74a4('0xa')]('/:id',auth[_0x74a4('0xb')](),controller['show']);router[_0x74a4('0xd')]('/',auth[_0x74a4('0xb')](),controller['create']);router[_0x74a4('0xe')](_0x74a4('0xf'),auth['isAuthenticated'](),controller[_0x74a4('0x10')]);router['delete'](_0x74a4('0xf'),auth['isAuthenticated'](),controller['destroy']);module[_0x74a4('0x11')]=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index a65f6b7..f1c21d3 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 _0x57e4=['string','customVariable','keyValue','picklist','STRING','ENUM','variable','BOOLEAN','sequelize','exports'];(function(_0x50a5c1,_0x4e6f88){var _0x47b543=function(_0x1c8375){while(--_0x1c8375){_0x50a5c1['push'](_0x50a5c1['shift']());}};_0x47b543(++_0x4e6f88);}(_0x57e4,0x9e));var _0x457e=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x57e4[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0x457e('0x0'));module[_0x457e('0x1')]={'type':{'type':Sequelize['ENUM'](_0x457e('0x2'),'variable',_0x457e('0x3'),_0x457e('0x4'),_0x457e('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0x457e('0x6')]},'key':{'type':Sequelize[_0x457e('0x6')]},'keyType':{'type':Sequelize[_0x457e('0x7')](_0x457e('0x2'),_0x457e('0x8'),_0x457e('0x3'))},'keyContent':{'type':Sequelize[_0x457e('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x457e('0x6')]},'customField':{'type':Sequelize[_0x457e('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x457e('0x6')]}}; \ No newline at end of file +var _0xf674=['variable','customVariable','keyValue','STRING','BOOLEAN','exports','ENUM','string'];(function(_0x32df18,_0x36d040){var _0x42cd3b=function(_0x55b83d){while(--_0x55b83d){_0x32df18['push'](_0x32df18['shift']());}};_0x42cd3b(++_0x36d040);}(_0xf674,0x125));var _0x4f67=function(_0x476c6c,_0x434db8){_0x476c6c=_0x476c6c-0x0;var _0xbb94db=_0xf674[_0x476c6c];return _0xbb94db;};'use strict';var Sequelize=require('sequelize');module[_0x4f67('0x0')]={'type':{'type':Sequelize[_0x4f67('0x1')](_0x4f67('0x2'),_0x4f67('0x3'),_0x4f67('0x4'),_0x4f67('0x5'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x4f67('0x6')]},'keyType':{'type':Sequelize[_0x4f67('0x1')](_0x4f67('0x2'),_0x4f67('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x4f67('0x6')]},'idField':{'type':Sequelize[_0x4f67('0x6')]},'nameField':{'type':Sequelize[_0x4f67('0x6')]},'customField':{'type':Sequelize[_0x4f67('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x4f67('0x6')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index e741ea2..c52fa5b 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 _0x6075=['ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','set','reject','save','update','then','destroy','error','stack','name','send','index','map','DeskField','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','offset','order','sort','where','pick','filter','merge','type','includeAll','include','findAll','rows','catch','show','params','options','create','body','find','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse'];(function(_0x2ccb5b,_0x35eac4){var _0xa11bb3=function(_0x1b5983){while(--_0x1b5983){_0x2ccb5b['push'](_0x2ccb5b['shift']());}};_0xa11bb3(++_0x35eac4);}(_0x6075,0x126));var _0x5607=function(_0x545120,_0x3a0696){_0x545120=_0x545120-0x0;var _0x5162d3=_0x6075[_0x545120];return _0x5162d3;};'use strict';var emlformat=require(_0x5607('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5607('0x1'));var jsonpatch=require(_0x5607('0x2'));var rp=require('request-promise');var moment=require(_0x5607('0x3'));var BPromise=require(_0x5607('0x4'));var Mustache=require(_0x5607('0x5'));var util=require(_0x5607('0x6'));var path=require(_0x5607('0x7'));var sox=require(_0x5607('0x8'));var csv=require('to-csv');var ejs=require(_0x5607('0x9'));var fs=require('fs');var fs_extra=require(_0x5607('0xa'));var _=require(_0x5607('0xb'));var squel=require(_0x5607('0xc'));var crypto=require(_0x5607('0xd'));var jsforce=require(_0x5607('0xe'));var deskjs=require(_0x5607('0xf'));var toCsv=require(_0x5607('0x10'));var querystring=require('querystring');var Papa=require(_0x5607('0x11'));var Redis=require(_0x5607('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x5607('0x13'));var as=require(_0x5607('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5607('0x15'))(_0x5607('0x16'));var utils=require(_0x5607('0x17'));var config=require(_0x5607('0x18'));var licenseUtil=require(_0x5607('0x19'));var db=require(_0x5607('0x1a'))['db'];function respondWithStatusCode(_0x79cb4e,_0x147fc6){_0x147fc6=_0x147fc6||0xcc;return function(_0x40c2a2){if(_0x40c2a2){return _0x79cb4e[_0x5607('0x1b')](_0x147fc6);}return _0x79cb4e[_0x5607('0x1c')](_0x147fc6)[_0x5607('0x1d')]();};}function respondWithResult(_0x3dd987,_0x564b08){_0x564b08=_0x564b08||0xc8;return function(_0x2c8352){if(_0x2c8352){return _0x3dd987['status'](_0x564b08)[_0x5607('0x1e')](_0x2c8352);}};}function respondWithFilteredResult(_0x41b92f,_0x274829){return function(_0x423507){if(_0x423507){var _0x8573c=typeof _0x274829['offset']===_0x5607('0x1f')&&typeof _0x274829[_0x5607('0x20')]===_0x5607('0x1f');var _0x3c73f2=_0x423507['count'];var _0x2bf04b=_0x8573c?0x0:_0x274829['offset'];var _0x4d9218=_0x8573c?_0x423507[_0x5607('0x21')]:_0x274829['offset']+_0x274829[_0x5607('0x20')];var _0x14862a;if(_0x4d9218>=_0x3c73f2){_0x4d9218=_0x3c73f2;_0x14862a=0xc8;}else{_0x14862a=0xce;}_0x41b92f['status'](_0x14862a);return _0x41b92f[_0x5607('0x22')]('Content-Range',_0x2bf04b+'-'+_0x4d9218+'/'+_0x3c73f2)[_0x5607('0x1e')](_0x423507);}return null;};}function patchUpdates(_0x259e32){return function(_0x35bd58){try{jsonpatch['apply'](_0x35bd58,_0x259e32,!![]);}catch(_0xd136ca){return BPromise[_0x5607('0x23')](_0xd136ca);}return _0x35bd58[_0x5607('0x24')]();};}function saveUpdates(_0x59367e,_0x1b87a3){return function(_0x62819b){if(_0x62819b){return _0x62819b[_0x5607('0x25')](_0x59367e)[_0x5607('0x26')](function(_0x2570fd){return _0x2570fd;});}return null;};}function removeEntity(_0x63e5a3,_0x5a913a){return function(_0x3e5d10){if(_0x3e5d10){return _0x3e5d10[_0x5607('0x27')]()[_0x5607('0x26')](function(){_0x63e5a3['status'](0xcc)[_0x5607('0x1d')]();});}};}function handleEntityNotFound(_0x24ca34,_0x29a71e){return function(_0x19715d){if(!_0x19715d){_0x24ca34[_0x5607('0x1b')](0x194);}return _0x19715d;};}function handleError(_0x46b787,_0x2468dc){_0x2468dc=_0x2468dc||0x1f4;return function(_0x4ff19d){logger[_0x5607('0x28')](_0x4ff19d[_0x5607('0x29')]);if(_0x4ff19d[_0x5607('0x2a')]){delete _0x4ff19d[_0x5607('0x2a')];}_0x46b787[_0x5607('0x1c')](_0x2468dc)[_0x5607('0x2b')](_0x4ff19d);};}exports[_0x5607('0x2c')]=function(_0xc5bf85,_0x4bb306){var _0x5622bb={},_0x395c18={},_0x5557ac={'count':0x0,'rows':[]};var _0x6dcbc4=_[_0x5607('0x2d')](db[_0x5607('0x2e')][_0x5607('0x2f')],function(_0x44fb99){return{'name':_0x44fb99[_0x5607('0x30')],'type':_0x44fb99['type'][_0x5607('0x31')]};});_0x395c18[_0x5607('0x32')]=_[_0x5607('0x2d')](_0x6dcbc4,_0x5607('0x2a'));_0x395c18[_0x5607('0x33')]=_[_0x5607('0x34')](_0xc5bf85[_0x5607('0x33')]);_0x395c18[_0x5607('0x35')]=_['intersection'](_0x395c18[_0x5607('0x32')],_0x395c18['query']);_0x5622bb['attributes']=_[_0x5607('0x36')](_0x395c18[_0x5607('0x32')],qs[_0x5607('0x37')](_0xc5bf85[_0x5607('0x33')][_0x5607('0x37')]));_0x5622bb['attributes']=_0x5622bb[_0x5607('0x38')][_0x5607('0x39')]?_0x5622bb[_0x5607('0x38')]:_0x395c18[_0x5607('0x32')];if(!_0xc5bf85[_0x5607('0x33')]['hasOwnProperty'](_0x5607('0x3a'))){_0x5622bb[_0x5607('0x20')]=qs[_0x5607('0x20')](_0xc5bf85[_0x5607('0x33')][_0x5607('0x20')]);_0x5622bb[_0x5607('0x3b')]=qs['offset'](_0xc5bf85[_0x5607('0x33')][_0x5607('0x3b')]);}_0x5622bb[_0x5607('0x3c')]=qs[_0x5607('0x3d')](_0xc5bf85['query'][_0x5607('0x3d')]);_0x5622bb[_0x5607('0x3e')]=qs['filters'](_[_0x5607('0x3f')](_0xc5bf85[_0x5607('0x33')],_0x395c18[_0x5607('0x35')]),_0x6dcbc4);if(_0xc5bf85[_0x5607('0x33')][_0x5607('0x40')]){_0x5622bb[_0x5607('0x3e')]=_[_0x5607('0x41')](_0x5622bb[_0x5607('0x3e')],{'$or':_[_0x5607('0x2d')](_0x6dcbc4,function(_0x30782e){if(_0x30782e[_0x5607('0x42')]!=='VIRTUAL'){var _0x1098ff={};_0x1098ff[_0x30782e[_0x5607('0x2a')]]={'$like':'%'+_0xc5bf85[_0x5607('0x33')][_0x5607('0x40')]+'%'};return _0x1098ff;}})});}_0x5622bb=_['merge']({},_0x5622bb,_0xc5bf85['options']);var _0x28e4f6={'where':_0x5622bb['where']};return db['DeskField'][_0x5607('0x21')](_0x28e4f6)[_0x5607('0x26')](function(_0x1f71ad){_0x5557ac[_0x5607('0x21')]=_0x1f71ad;if(_0xc5bf85[_0x5607('0x33')][_0x5607('0x43')]){_0x5622bb[_0x5607('0x44')]=[{'all':!![]}];}return db[_0x5607('0x2e')][_0x5607('0x45')](_0x5622bb);})[_0x5607('0x26')](function(_0x2054cc){_0x5557ac[_0x5607('0x46')]=_0x2054cc;return _0x5557ac;})['then'](respondWithFilteredResult(_0x4bb306,_0x5622bb))[_0x5607('0x47')](handleError(_0x4bb306,null));};exports[_0x5607('0x48')]=function(_0xec2767,_0x510da5){var _0x53515e={'raw':!![],'where':{'id':_0xec2767[_0x5607('0x49')]['id']}},_0x4b47b5={};_0x4b47b5[_0x5607('0x32')]=_[_0x5607('0x34')](db[_0x5607('0x2e')]['rawAttributes']);_0x4b47b5[_0x5607('0x33')]=_['keys'](_0xec2767['query']);_0x4b47b5[_0x5607('0x35')]=_[_0x5607('0x36')](_0x4b47b5['model'],_0x4b47b5['query']);_0x53515e['attributes']=_[_0x5607('0x36')](_0x4b47b5[_0x5607('0x32')],qs['fields'](_0xec2767[_0x5607('0x33')][_0x5607('0x37')]));_0x53515e[_0x5607('0x38')]=_0x53515e[_0x5607('0x38')][_0x5607('0x39')]?_0x53515e[_0x5607('0x38')]:_0x4b47b5['model'];if(_0xec2767[_0x5607('0x33')][_0x5607('0x43')]){_0x53515e[_0x5607('0x44')]=[{'all':!![]}];}_0x53515e=_[_0x5607('0x41')]({},_0x53515e,_0xec2767[_0x5607('0x4a')]);return db[_0x5607('0x2e')]['find'](_0x53515e)[_0x5607('0x26')](handleEntityNotFound(_0x510da5,null))['then'](respondWithResult(_0x510da5,null))[_0x5607('0x47')](handleError(_0x510da5,null));};exports[_0x5607('0x4b')]=function(_0x474550,_0xf44f43){return db[_0x5607('0x2e')][_0x5607('0x4b')](_0x474550[_0x5607('0x4c')],{})['then'](respondWithResult(_0xf44f43,0xc9))[_0x5607('0x47')](handleError(_0xf44f43,null));};exports['update']=function(_0x745d7b,_0x115c59){if(_0x745d7b[_0x5607('0x4c')]['id']){delete _0x745d7b[_0x5607('0x4c')]['id'];}return db[_0x5607('0x2e')][_0x5607('0x4d')]({'where':{'id':_0x745d7b['params']['id']}})[_0x5607('0x26')](handleEntityNotFound(_0x115c59,null))['then'](saveUpdates(_0x745d7b[_0x5607('0x4c')],null))[_0x5607('0x26')](respondWithResult(_0x115c59,null))[_0x5607('0x47')](handleError(_0x115c59,null));};exports[_0x5607('0x27')]=function(_0x2e0bc5,_0x8fbf03){return db[_0x5607('0x2e')][_0x5607('0x4d')]({'where':{'id':_0x2e0bc5[_0x5607('0x49')]['id']}})[_0x5607('0x26')](handleEntityNotFound(_0x8fbf03,null))[_0x5607('0x26')](removeEntity(_0x8fbf03,null))['catch'](handleError(_0x8fbf03,null));}; \ No newline at end of file +var _0xf06c=['ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/environment','../../mysqldb','end','json','offset','undefined','count','limit','status','set','Content-Range','reject','update','then','destroy','sendStatus','name','send','index','DeskField','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','rawAttributes','include','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','papaparse'];(function(_0x309269,_0xf0edf8){var _0x133f1c=function(_0x3b0218){while(--_0x3b0218){_0x309269['push'](_0x309269['shift']());}};_0x133f1c(++_0xf0edf8);}(_0xf06c,0xc7));var _0xcf06=function(_0x325be2,_0x4a3e19){_0x325be2=_0x325be2-0x0;var _0x54986c=_0xf06c[_0x325be2];return _0x54986c;};'use strict';var emlformat=require(_0xcf06('0x0'));var rimraf=require(_0xcf06('0x1'));var zipdir=require(_0xcf06('0x2'));var jsonpatch=require(_0xcf06('0x3'));var rp=require(_0xcf06('0x4'));var moment=require('moment');var BPromise=require(_0xcf06('0x5'));var Mustache=require(_0xcf06('0x6'));var util=require(_0xcf06('0x7'));var path=require('path');var sox=require(_0xcf06('0x8'));var csv=require(_0xcf06('0x9'));var ejs=require(_0xcf06('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcf06('0xb'));var squel=require('squel');var crypto=require(_0xcf06('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xcf06('0xd'));var Redis=require(_0xcf06('0xe'));var authService=require(_0xcf06('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xcf06('0x10'));var logger=require('../../config/logger')(_0xcf06('0x11'));var utils=require('../../config/utils');var config=require(_0xcf06('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0xcf06('0x13'))['db'];function respondWithStatusCode(_0x570965,_0x2aaa5f){_0x2aaa5f=_0x2aaa5f||0xcc;return function(_0x3dc669){if(_0x3dc669){return _0x570965['sendStatus'](_0x2aaa5f);}return _0x570965['status'](_0x2aaa5f)[_0xcf06('0x14')]();};}function respondWithResult(_0x45f66a,_0x2fd686){_0x2fd686=_0x2fd686||0xc8;return function(_0x157689){if(_0x157689){return _0x45f66a['status'](_0x2fd686)[_0xcf06('0x15')](_0x157689);}};}function respondWithFilteredResult(_0x4aa0d,_0x5db932){return function(_0x584d2c){if(_0x584d2c){var _0x15a795=typeof _0x5db932[_0xcf06('0x16')]===_0xcf06('0x17')&&typeof _0x5db932['limit']===_0xcf06('0x17');var _0x18cd3f=_0x584d2c[_0xcf06('0x18')];var _0x569bbf=_0x15a795?0x0:_0x5db932[_0xcf06('0x16')];var _0x2a5ef5=_0x15a795?_0x584d2c[_0xcf06('0x18')]:_0x5db932[_0xcf06('0x16')]+_0x5db932[_0xcf06('0x19')];var _0x48886d;if(_0x2a5ef5>=_0x18cd3f){_0x2a5ef5=_0x18cd3f;_0x48886d=0xc8;}else{_0x48886d=0xce;}_0x4aa0d[_0xcf06('0x1a')](_0x48886d);return _0x4aa0d[_0xcf06('0x1b')](_0xcf06('0x1c'),_0x569bbf+'-'+_0x2a5ef5+'/'+_0x18cd3f)['json'](_0x584d2c);}return null;};}function patchUpdates(_0x465eed){return function(_0x19305d){try{jsonpatch['apply'](_0x19305d,_0x465eed,!![]);}catch(_0x362fcc){return BPromise[_0xcf06('0x1d')](_0x362fcc);}return _0x19305d['save']();};}function saveUpdates(_0x2edadc,_0x132eaa){return function(_0x139b17){if(_0x139b17){return _0x139b17[_0xcf06('0x1e')](_0x2edadc)[_0xcf06('0x1f')](function(_0x13fa04){return _0x13fa04;});}return null;};}function removeEntity(_0xe3304a,_0x26a685){return function(_0xb039dd){if(_0xb039dd){return _0xb039dd[_0xcf06('0x20')]()[_0xcf06('0x1f')](function(){_0xe3304a[_0xcf06('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x58840a,_0x87440){return function(_0x27beb7){if(!_0x27beb7){_0x58840a[_0xcf06('0x21')](0x194);}return _0x27beb7;};}function handleError(_0x27cbd9,_0x2e1617){_0x2e1617=_0x2e1617||0x1f4;return function(_0x6c3dcf){logger['error'](_0x6c3dcf['stack']);if(_0x6c3dcf[_0xcf06('0x22')]){delete _0x6c3dcf['name'];}_0x27cbd9[_0xcf06('0x1a')](_0x2e1617)[_0xcf06('0x23')](_0x6c3dcf);};}exports[_0xcf06('0x24')]=function(_0x474bfe,_0x120d0c){var _0x4651f4={},_0x303823={},_0x2b2508={'count':0x0,'rows':[]};var _0x2ec5b7=_['map'](db[_0xcf06('0x25')]['rawAttributes'],function(_0x92666b){return{'name':_0x92666b[_0xcf06('0x26')],'type':_0x92666b[_0xcf06('0x27')][_0xcf06('0x28')]};});_0x303823[_0xcf06('0x29')]=_[_0xcf06('0x2a')](_0x2ec5b7,'name');_0x303823[_0xcf06('0x2b')]=_[_0xcf06('0x2c')](_0x474bfe[_0xcf06('0x2b')]);_0x303823[_0xcf06('0x2d')]=_[_0xcf06('0x2e')](_0x303823[_0xcf06('0x29')],_0x303823[_0xcf06('0x2b')]);_0x4651f4[_0xcf06('0x2f')]=_[_0xcf06('0x2e')](_0x303823[_0xcf06('0x29')],qs['fields'](_0x474bfe[_0xcf06('0x2b')][_0xcf06('0x30')]));_0x4651f4[_0xcf06('0x2f')]=_0x4651f4[_0xcf06('0x2f')][_0xcf06('0x31')]?_0x4651f4[_0xcf06('0x2f')]:_0x303823[_0xcf06('0x29')];if(!_0x474bfe[_0xcf06('0x2b')][_0xcf06('0x32')](_0xcf06('0x33'))){_0x4651f4[_0xcf06('0x19')]=qs['limit'](_0x474bfe[_0xcf06('0x2b')][_0xcf06('0x19')]);_0x4651f4['offset']=qs[_0xcf06('0x16')](_0x474bfe['query'][_0xcf06('0x16')]);}_0x4651f4[_0xcf06('0x34')]=qs[_0xcf06('0x35')](_0x474bfe[_0xcf06('0x2b')]['sort']);_0x4651f4[_0xcf06('0x36')]=qs[_0xcf06('0x2d')](_[_0xcf06('0x37')](_0x474bfe[_0xcf06('0x2b')],_0x303823[_0xcf06('0x2d')]),_0x2ec5b7);if(_0x474bfe['query'][_0xcf06('0x38')]){_0x4651f4[_0xcf06('0x36')]=_[_0xcf06('0x39')](_0x4651f4[_0xcf06('0x36')],{'$or':_[_0xcf06('0x2a')](_0x2ec5b7,function(_0x45ddbf){if(_0x45ddbf[_0xcf06('0x27')]!==_0xcf06('0x3a')){var _0x3e0b3f={};_0x3e0b3f[_0x45ddbf[_0xcf06('0x22')]]={'$like':'%'+_0x474bfe[_0xcf06('0x2b')][_0xcf06('0x38')]+'%'};return _0x3e0b3f;}})});}_0x4651f4=_[_0xcf06('0x39')]({},_0x4651f4,_0x474bfe[_0xcf06('0x3b')]);var _0x446972={'where':_0x4651f4[_0xcf06('0x36')]};return db[_0xcf06('0x25')]['count'](_0x446972)[_0xcf06('0x1f')](function(_0x59b8ed){_0x2b2508[_0xcf06('0x18')]=_0x59b8ed;if(_0x474bfe[_0xcf06('0x2b')][_0xcf06('0x3c')]){_0x4651f4['include']=[{'all':!![]}];}return db[_0xcf06('0x25')][_0xcf06('0x3d')](_0x4651f4);})[_0xcf06('0x1f')](function(_0x38c153){_0x2b2508[_0xcf06('0x3e')]=_0x38c153;return _0x2b2508;})['then'](respondWithFilteredResult(_0x120d0c,_0x4651f4))['catch'](handleError(_0x120d0c,null));};exports[_0xcf06('0x3f')]=function(_0x518c2f,_0x120dae){var _0x40735b={'raw':!![],'where':{'id':_0x518c2f[_0xcf06('0x40')]['id']}},_0x4342e0={};_0x4342e0['model']=_[_0xcf06('0x2c')](db[_0xcf06('0x25')][_0xcf06('0x41')]);_0x4342e0['query']=_[_0xcf06('0x2c')](_0x518c2f['query']);_0x4342e0[_0xcf06('0x2d')]=_['intersection'](_0x4342e0[_0xcf06('0x29')],_0x4342e0['query']);_0x40735b[_0xcf06('0x2f')]=_[_0xcf06('0x2e')](_0x4342e0[_0xcf06('0x29')],qs['fields'](_0x518c2f[_0xcf06('0x2b')][_0xcf06('0x30')]));_0x40735b[_0xcf06('0x2f')]=_0x40735b['attributes'][_0xcf06('0x31')]?_0x40735b['attributes']:_0x4342e0[_0xcf06('0x29')];if(_0x518c2f[_0xcf06('0x2b')][_0xcf06('0x3c')]){_0x40735b[_0xcf06('0x42')]=[{'all':!![]}];}_0x40735b=_['merge']({},_0x40735b,_0x518c2f[_0xcf06('0x3b')]);return db[_0xcf06('0x25')][_0xcf06('0x43')](_0x40735b)['then'](handleEntityNotFound(_0x120dae,null))[_0xcf06('0x1f')](respondWithResult(_0x120dae,null))[_0xcf06('0x44')](handleError(_0x120dae,null));};exports['create']=function(_0xc392e,_0x8a988f){return db[_0xcf06('0x25')][_0xcf06('0x45')](_0xc392e[_0xcf06('0x46')],{})['then'](respondWithResult(_0x8a988f,0xc9))[_0xcf06('0x44')](handleError(_0x8a988f,null));};exports[_0xcf06('0x1e')]=function(_0x453e6e,_0x319314){if(_0x453e6e[_0xcf06('0x46')]['id']){delete _0x453e6e['body']['id'];}return db[_0xcf06('0x25')]['find']({'where':{'id':_0x453e6e[_0xcf06('0x40')]['id']}})[_0xcf06('0x1f')](handleEntityNotFound(_0x319314,null))[_0xcf06('0x1f')](saveUpdates(_0x453e6e[_0xcf06('0x46')],null))[_0xcf06('0x1f')](respondWithResult(_0x319314,null))['catch'](handleError(_0x319314,null));};exports[_0xcf06('0x20')]=function(_0x4e45dd,_0xc32502){return db[_0xcf06('0x25')][_0xcf06('0x43')]({'where':{'id':_0x4e45dd[_0xcf06('0x40')]['id']}})[_0xcf06('0x1f')](handleEntityNotFound(_0xc32502,null))[_0xcf06('0x1f')](removeEntity(_0xc32502,null))['catch'](handleError(_0xc32502,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index 27b63ba..e70713c 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 _0xce0e=['util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./intDeskField.attributes','exports','int_desk_fields','idField','lodash'];(function(_0x8b1e53,_0x4341d2){var _0x3df208=function(_0x2264bc){while(--_0x2264bc){_0x8b1e53['push'](_0x8b1e53['shift']());}};_0x3df208(++_0x4341d2);}(_0xce0e,0x167));var _0xece0=function(_0x57c17e,_0x2f2176){_0x57c17e=_0x57c17e-0x0;var _0x39b721=_0xce0e[_0x57c17e];return _0x39b721;};'use strict';var _=require(_0xece0('0x0'));var util=require(_0xece0('0x1'));var logger=require(_0xece0('0x2'))('api');var moment=require(_0xece0('0x3'));var BPromise=require(_0xece0('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xece0('0x5'));var rimraf=require(_0xece0('0x6'));var config=require(_0xece0('0x7'));var attributes=require(_0xece0('0x8'));module[_0xece0('0x9')]=function(_0xe8ec97,_0x32202c){return _0xe8ec97['define']('DeskField',attributes,{'tableName':_0xece0('0xa'),'paranoid':![],'indexes':[{'name':'desk_unique_index','fields':[_0xece0('0xb'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4beb=['api','bluebird','request-promise','path','./intDeskField.attributes','exports','define','DeskField','int_desk_fields','desk_unique_index','FieldId','../../config/logger'];(function(_0xaa6a4,_0x64b067){var _0xdc31a4=function(_0x4269d8){while(--_0x4269d8){_0xaa6a4['push'](_0xaa6a4['shift']());}};_0xdc31a4(++_0x64b067);}(_0x4beb,0xbf));var _0xb4be=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4beb[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xb4be('0x0'))(_0xb4be('0x1'));var moment=require('moment');var BPromise=require(_0xb4be('0x2'));var rp=require(_0xb4be('0x3'));var fs=require('fs');var path=require(_0xb4be('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xb4be('0x5'));module[_0xb4be('0x6')]=function(_0x91226e,_0x3c2ef1){return _0x91226e[_0xb4be('0x7')](_0xb4be('0x8'),attributes,{'tableName':_0xb4be('0x9'),'paranoid':![],'indexes':[{'name':_0xb4be('0xa'),'fields':['idField',_0xb4be('0xb')],'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 035ecc4..687ce16 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 _0xbcbd=['DeskField,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','DeskField,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3e8706,_0x3943f7){var _0x3166b6=function(_0x380541){while(--_0x380541){_0x3e8706['push'](_0x3e8706['shift']());}};_0x3166b6(++_0x3943f7);}(_0xbcbd,0x1d0));var _0xdbcb=function(_0x380a3f,_0x202483){_0x380a3f=_0x380a3f-0x0;var _0x2b4eca=_0xbcbd[_0x380a3f];return _0x2b4eca;};'use strict';var _=require(_0xdbcb('0x0'));var util=require(_0xdbcb('0x1'));var moment=require('moment');var BPromise=require(_0xdbcb('0x2'));var rs=require(_0xdbcb('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdbcb('0x4'))['db'];var utils=require(_0xdbcb('0x5'));var logger=require(_0xdbcb('0x6'))(_0xdbcb('0x7'));var config=require(_0xdbcb('0x8'));var jayson=require(_0xdbcb('0x9'));var client=jayson['client'][_0xdbcb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1a156c,_0x29dfac,_0x2cae00){return new BPromise(function(_0x4a0fc4,_0x10b3c4){return client['request'](_0x1a156c,_0x2cae00)[_0xdbcb('0xb')](function(_0xa369f9){logger[_0xdbcb('0xc')](_0xdbcb('0xd'),_0x29dfac,_0xdbcb('0xe'));logger[_0xdbcb('0xf')](_0xdbcb('0x10'),_0x29dfac,_0xdbcb('0xe'),JSON['stringify'](_0xa369f9));if(_0xa369f9[_0xdbcb('0x11')]){if(_0xa369f9[_0xdbcb('0x11')]['code']===0x1f4){logger[_0xdbcb('0x11')](_0xdbcb('0xd'),_0x29dfac,_0xa369f9[_0xdbcb('0x11')]['message']);return _0x10b3c4(_0xa369f9[_0xdbcb('0x11')][_0xdbcb('0x12')]);}logger[_0xdbcb('0x11')](_0xdbcb('0xd'),_0x29dfac,_0xa369f9['error'][_0xdbcb('0x12')]);return _0x4a0fc4(_0xa369f9[_0xdbcb('0x11')][_0xdbcb('0x12')]);}else{logger[_0xdbcb('0xc')](_0xdbcb('0xd'),_0x29dfac,_0xdbcb('0xe'));_0x4a0fc4(_0xa369f9['result'][_0xdbcb('0x12')]);}})[_0xdbcb('0x13')](function(_0x3815bc){logger[_0xdbcb('0x11')]('DeskField,\x20%s,\x20%s',_0x29dfac,_0x3815bc);_0x10b3c4(_0x3815bc);});});} \ No newline at end of file +var _0xb065=['randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','request','then','info','DeskField,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util'];(function(_0x4ed4d2,_0x47acf7){var _0x15ae2e=function(_0x3199f0){while(--_0x3199f0){_0x4ed4d2['push'](_0x4ed4d2['shift']());}};_0x15ae2e(++_0x47acf7);}(_0xb065,0x10c));var _0x5b06=function(_0x1c6179,_0x22db86){_0x1c6179=_0x1c6179-0x0;var _0x19a57b=_0xb065[_0x1c6179];return _0x19a57b;};'use strict';var _=require(_0x5b06('0x0'));var util=require(_0x5b06('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5b06('0x2'));var fs=require('fs');var Redis=require(_0x5b06('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x5b06('0x4'))(_0x5b06('0x5'));var config=require('../../config/environment');var jayson=require(_0x5b06('0x6'));var client=jayson[_0x5b06('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x391743,_0x3a6942,_0x2cb88f){return new BPromise(function(_0x234dac,_0x5e0e1e){return client[_0x5b06('0x8')](_0x391743,_0x2cb88f)[_0x5b06('0x9')](function(_0xfd3727){logger[_0x5b06('0xa')](_0x5b06('0xb'),_0x3a6942,_0x5b06('0xc'));logger['debug']('DeskField,\x20%s,\x20%s,\x20%s',_0x3a6942,_0x5b06('0xc'),JSON[_0x5b06('0xd')](_0xfd3727));if(_0xfd3727[_0x5b06('0xe')]){if(_0xfd3727[_0x5b06('0xe')][_0x5b06('0xf')]===0x1f4){logger[_0x5b06('0xe')](_0x5b06('0xb'),_0x3a6942,_0xfd3727[_0x5b06('0xe')][_0x5b06('0x10')]);return _0x5e0e1e(_0xfd3727[_0x5b06('0xe')]['message']);}logger['error'](_0x5b06('0xb'),_0x3a6942,_0xfd3727[_0x5b06('0xe')][_0x5b06('0x10')]);return _0x234dac(_0xfd3727[_0x5b06('0xe')][_0x5b06('0x10')]);}else{logger[_0x5b06('0xa')](_0x5b06('0xb'),_0x3a6942,_0x5b06('0xc'));_0x234dac(_0xfd3727['result'][_0x5b06('0x10')]);}})[_0x5b06('0x11')](function(_0x2cd6fd){logger[_0x5b06('0xe')](_0x5b06('0xb'),_0x3a6942,_0x2cd6fd);_0x5e0e1e(_0x2cd6fd);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index c843bc8..8ffe05f 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 _0x9c91=['delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','index','/:id','isAuthenticated','show','get','/:id/configurations','getConfigurations','post','put','update'];(function(_0x3ced69,_0x23967b){var _0x5932b4=function(_0xf98af2){while(--_0xf98af2){_0x3ced69['push'](_0x3ced69['shift']());}};_0x5932b4(++_0x23967b);}(_0x9c91,0x87));var _0x19c9=function(_0x38fe96,_0x2fd576){_0x38fe96=_0x38fe96-0x0;var _0x4b12f2=_0x9c91[_0x38fe96];return _0x4b12f2;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x19c9('0x0'));var timeout=require(_0x19c9('0x1'));var express=require(_0x19c9('0x2'));var router=express[_0x19c9('0x3')]();var fs_extra=require(_0x19c9('0x4'));var auth=require(_0x19c9('0x5'));var interaction=require(_0x19c9('0x6'));var config=require(_0x19c9('0x7'));var controller=require(_0x19c9('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x19c9('0x9')]);router['get'](_0x19c9('0xa'),auth[_0x19c9('0xb')](),controller[_0x19c9('0xc')]);router[_0x19c9('0xd')](_0x19c9('0xe'),auth[_0x19c9('0xb')](),controller[_0x19c9('0xf')]);router['get']('/:id/fields',auth[_0x19c9('0xb')](),controller['getFields']);router['post']('/',auth[_0x19c9('0xb')](),controller['create']);router[_0x19c9('0x10')]('/:id/configurations',auth[_0x19c9('0xb')](),controller['addConfiguration']);router[_0x19c9('0x11')](_0x19c9('0xa'),auth[_0x19c9('0xb')](),controller[_0x19c9('0x12')]);router[_0x19c9('0x13')](_0x19c9('0xa'),auth[_0x19c9('0xb')](),controller[_0x19c9('0x14')]);module[_0x19c9('0x15')]=router; \ No newline at end of file +var _0xa112=['util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','get','/:id','isAuthenticated','/:id/configurations','getConfigurations','/:id/fields','getFields','addConfiguration','put','update','delete','destroy','multer'];(function(_0x1d8bd3,_0x4776bd){var _0x119c35=function(_0x3ea2e5){while(--_0x3ea2e5){_0x1d8bd3['push'](_0x1d8bd3['shift']());}};_0x119c35(++_0x4776bd);}(_0xa112,0x1e3));var _0x2a11=function(_0xaa0309,_0x1c8008){_0xaa0309=_0xaa0309-0x0;var _0x5de7ce=_0xa112[_0xaa0309];return _0x5de7ce;};'use strict';var multer=require(_0x2a11('0x0'));var util=require(_0x2a11('0x1'));var path=require(_0x2a11('0x2'));var timeout=require(_0x2a11('0x3'));var express=require(_0x2a11('0x4'));var router=express['Router']();var fs_extra=require(_0x2a11('0x5'));var auth=require(_0x2a11('0x6'));var interaction=require(_0x2a11('0x7'));var config=require(_0x2a11('0x8'));var controller=require(_0x2a11('0x9'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x2a11('0xa')](_0x2a11('0xb'),auth[_0x2a11('0xc')](),controller['show']);router['get'](_0x2a11('0xd'),auth[_0x2a11('0xc')](),controller[_0x2a11('0xe')]);router[_0x2a11('0xa')](_0x2a11('0xf'),auth[_0x2a11('0xc')](),controller[_0x2a11('0x10')]);router['post']('/',auth[_0x2a11('0xc')](),controller['create']);router['post']('/:id/configurations',auth[_0x2a11('0xc')](),controller[_0x2a11('0x11')]);router[_0x2a11('0x12')](_0x2a11('0xb'),auth[_0x2a11('0xc')](),controller[_0x2a11('0x13')]);router[_0x2a11('0x14')](_0x2a11('0xb'),auth[_0x2a11('0xc')](),controller[_0x2a11('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index 07cd26d..03d6980 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 _0x7a3e=['STRING','sequelize','exports'];(function(_0x28d31d,_0x57a4e6){var _0x2df7c1=function(_0x52601d){while(--_0x52601d){_0x28d31d['push'](_0x28d31d['shift']());}};_0x2df7c1(++_0x57a4e6);}(_0x7a3e,0x18a));var _0xe7a3=function(_0x429ee3,_0x337a13){_0x429ee3=_0x429ee3-0x0;var _0x5a6447=_0x7a3e[_0x429ee3];return _0x5a6447;};'use strict';var Sequelize=require(_0xe7a3('0x0'));module[_0xe7a3('0x1')]={'name':{'type':Sequelize[_0xe7a3('0x2')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xe7a3('0x2')]},'remoteUri':{'type':Sequelize[_0xe7a3('0x2')]},'tenantId':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0xe7a3('0x2')]},'serverUrl':{'type':Sequelize[_0xe7a3('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xe7a3('0x2')]},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x04e7=['BOOLEAN','sequelize','exports','STRING'];(function(_0xd362e8,_0x1e097c){var _0x19dc42=function(_0x9a735c){while(--_0x9a735c){_0xd362e8['push'](_0xd362e8['shift']());}};_0x19dc42(++_0x1e097c);}(_0x04e7,0x121));var _0x704e=function(_0x155c64,_0x26ff95){_0x155c64=_0x155c64-0x0;var _0x1f154a=_0x04e7[_0x155c64];return _0x1f154a;};'use strict';var Sequelize=require(_0x704e('0x0'));module[_0x704e('0x1')]={'name':{'type':Sequelize[_0x704e('0x2')]},'username':{'type':Sequelize[_0x704e('0x2')]},'password':{'type':Sequelize[_0x704e('0x2')]},'remoteUri':{'type':Sequelize[_0x704e('0x2')]},'tenantId':{'type':Sequelize[_0x704e('0x2')]},'clientId':{'type':Sequelize[_0x704e('0x2')]},'clientSecret':{'type':Sequelize[_0x704e('0x2')]},'serverUrl':{'type':Sequelize[_0x704e('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x704e('0x2')]},'modernAuthentication':{'type':Sequelize[_0x704e('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index 35d5bcb..f01b493 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 _0x2964=['owneridname','owneridtype','owneridyominame','parentcaseidname','primarycontactidyominame','prioritycodename','productidname','productserialnumber','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname','socialprofileidname','statecode','statuscode','subjectidname','timezoneruleversionnumber','traversedpath','utcconversiontimezonecode','versionnumber','username','password','remoteUri','tenantId','clientId','clientSecret','modernAuthentication','data5','data7','access_token','CloudProvider','POST','https://login.microsoftonline.com/','/oauth2/token','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','MetadataId','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','includes','forEach','@odata.type','PicklistAttributeMetadata','push','all','isNil','BooleanAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','EntityNameAttributeMetadata','concat','test','Wrong\x20credentials',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','Options','UserLocalizedLabel','Label','DisplayName',')/Attributes(',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','OptionSet','TrueOption','true','FalseOption','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','LogicalName','request-promise','util','lodash','../../components/parsers/qs','../../config/logger','api','../../mysqldb','../../components/integrations/configuration','status','json','offset','undefined','limit','count','set','Content-Range','update','then','end','sendStatus','error','stack','name','send','index','map','Dynamics365Account','fieldName','key','model','query','filters','attributes','intersection','fields','hasOwnProperty','order','sort','where','merge','type','VIRTUAL','filter','options','include','findAll','rows','params','keys','rawAttributes','find','catch','body','getConfigurations','findOne','Dynamics365Configuration','length','addConfiguration','Subjects','getSubjects','channel','getDescriptions','create','Dynamics365Field','Descriptions','slice','substring','lastIndexOf','%s/api/data/v9.0/','getFields','incident','Incident','PhoneCall','description','customerid','ownerid','caseorigincode','phonenumber','regardingobjectid','directioncode','accountidyominame','contactidname','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdon','createdonbehalfbyyominame','customeridtype','entitlementidname','entityimage_url','firstresponsebykpiidname','followupby','influencescore','kbarticleidname','masteridname','modifiedbyexternalpartyname','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','numberofchildincidents','onholdtime','overriddencreatedon'];(function(_0x532af7,_0x34f52a){var _0x15fa83=function(_0xdf3fbc){while(--_0xdf3fbc){_0x532af7['push'](_0x532af7['shift']());}};_0x15fa83(++_0x34f52a);}(_0x2964,0x108));var _0x4296=function(_0x54cbc5,_0x54cca0){_0x54cbc5=_0x54cbc5-0x0;var _0x2b1a83=_0x2964[_0x54cbc5];return _0x2b1a83;};'use strict';var rp=require(_0x4296('0x0'));var util=require(_0x4296('0x1'));var _=require(_0x4296('0x2'));var qs=require(_0x4296('0x3'));var logger=require(_0x4296('0x4'))(_0x4296('0x5'));var db=require(_0x4296('0x6'))['db'];var integrations=require(_0x4296('0x7'));function respondWithResult(_0x155933,_0x4b5bad){_0x4b5bad=_0x4b5bad||0xc8;return function(_0x175352){if(_0x175352){return _0x155933[_0x4296('0x8')](_0x4b5bad)[_0x4296('0x9')](_0x175352);}};}function respondWithFilteredResult(_0x10a454,_0x15d705){return function(_0x273d90){if(_0x273d90){var _0x50a6c5=typeof _0x15d705[_0x4296('0xa')]===_0x4296('0xb')&&typeof _0x15d705[_0x4296('0xc')]===_0x4296('0xb');var _0x35a29a=_0x273d90[_0x4296('0xd')];var _0x3e826e=_0x50a6c5?0x0:_0x15d705[_0x4296('0xa')];var _0x1e3635=_0x50a6c5?_0x273d90[_0x4296('0xd')]:_0x15d705[_0x4296('0xa')]+_0x15d705[_0x4296('0xc')];var _0x5012c2;if(_0x1e3635>=_0x35a29a){_0x1e3635=_0x35a29a;_0x5012c2=0xc8;}else{_0x5012c2=0xce;}_0x10a454[_0x4296('0x8')](_0x5012c2);return _0x10a454[_0x4296('0xe')](_0x4296('0xf'),_0x3e826e+'-'+_0x1e3635+'/'+_0x35a29a)[_0x4296('0x9')](_0x273d90);}return null;};}function saveUpdates(_0x23ba5a){return function(_0x676674){if(_0x676674){return _0x676674[_0x4296('0x10')](_0x23ba5a)['then'](function(_0x302ac3){return _0x302ac3;});}return null;};}function removeEntity(_0x350b4b){return function(_0x3574da){if(_0x3574da){return _0x3574da['destroy']()[_0x4296('0x11')](function(){_0x350b4b[_0x4296('0x8')](0xcc)[_0x4296('0x12')]();});}};}function handleEntityNotFound(_0x53af4b){return function(_0x182910){if(!_0x182910){_0x53af4b[_0x4296('0x13')](0x194);}return _0x182910;};}function handleError(_0x1e7af8,_0x51ae32){_0x51ae32=_0x51ae32||0x1f4;return function(_0x3f5896){logger[_0x4296('0x14')](_0x3f5896[_0x4296('0x15')]);if(_0x3f5896[_0x4296('0x16')]){delete _0x3f5896[_0x4296('0x16')];}_0x1e7af8['status'](_0x51ae32)[_0x4296('0x17')](_0x3f5896);};}exports[_0x4296('0x18')]=function(_0x2d544c,_0x48cac6){var _0x13f40f={},_0x6c50b7={},_0x448f46={'count':0x0,'rows':[]};var _0x3d3b2e=_[_0x4296('0x19')](db[_0x4296('0x1a')]['rawAttributes'],function(_0x33839e){return{'name':_0x33839e[_0x4296('0x1b')],'type':_0x33839e['type'][_0x4296('0x1c')]};});_0x6c50b7[_0x4296('0x1d')]=_[_0x4296('0x19')](_0x3d3b2e,_0x4296('0x16'));_0x6c50b7['query']=_['keys'](_0x2d544c[_0x4296('0x1e')]);_0x6c50b7[_0x4296('0x1f')]=_['intersection'](_0x6c50b7[_0x4296('0x1d')],_0x6c50b7['query']);_0x13f40f[_0x4296('0x20')]=_[_0x4296('0x21')](_0x6c50b7[_0x4296('0x1d')],qs[_0x4296('0x22')](_0x2d544c['query'][_0x4296('0x22')]));_0x13f40f['attributes']=_0x13f40f[_0x4296('0x20')]['length']?_0x13f40f['attributes']:_0x6c50b7[_0x4296('0x1d')];if(!_0x2d544c[_0x4296('0x1e')][_0x4296('0x23')]('nolimit')){_0x13f40f[_0x4296('0xc')]=qs[_0x4296('0xc')](_0x2d544c['query'][_0x4296('0xc')]);_0x13f40f['offset']=qs['offset'](_0x2d544c[_0x4296('0x1e')][_0x4296('0xa')]);}_0x13f40f[_0x4296('0x24')]=qs[_0x4296('0x25')](_0x2d544c[_0x4296('0x1e')][_0x4296('0x25')]);_0x13f40f[_0x4296('0x26')]=qs[_0x4296('0x1f')](_['pick'](_0x2d544c[_0x4296('0x1e')],_0x6c50b7['filters']),_0x3d3b2e);if(_0x2d544c[_0x4296('0x1e')]['filter']){_0x13f40f['where']=_[_0x4296('0x27')](_0x13f40f['where'],{'$or':_[_0x4296('0x19')](_0x3d3b2e,function(_0x1dc461){if(_0x1dc461[_0x4296('0x28')]!==_0x4296('0x29')){var _0x11298f={};_0x11298f[_0x1dc461[_0x4296('0x16')]]={'$like':'%'+_0x2d544c[_0x4296('0x1e')][_0x4296('0x2a')]+'%'};return _0x11298f;}})});}_0x13f40f=_[_0x4296('0x27')]({},_0x13f40f,_0x2d544c[_0x4296('0x2b')]);var _0x13cc79={'where':_0x13f40f['where']};return db['Dynamics365Account'][_0x4296('0xd')](_0x13cc79)[_0x4296('0x11')](function(_0x22bc72){_0x448f46[_0x4296('0xd')]=_0x22bc72;if(_0x2d544c['query']['includeAll']){_0x13f40f[_0x4296('0x2c')]=[{'all':!![]}];}return db[_0x4296('0x1a')][_0x4296('0x2d')](_0x13f40f);})[_0x4296('0x11')](function(_0x5a9c15){_0x448f46[_0x4296('0x2e')]=_0x5a9c15;return _0x448f46;})[_0x4296('0x11')](respondWithFilteredResult(_0x48cac6,_0x13f40f))['catch'](handleError(_0x48cac6,null));};exports['show']=function(_0x583d33,_0xe9f20f){var _0x374054={'raw':![],'where':{'id':_0x583d33[_0x4296('0x2f')]['id']}},_0x4a9445={};_0x4a9445[_0x4296('0x1d')]=_[_0x4296('0x30')](db[_0x4296('0x1a')][_0x4296('0x31')]);_0x4a9445[_0x4296('0x1e')]=_[_0x4296('0x30')](_0x583d33[_0x4296('0x1e')]);_0x4a9445[_0x4296('0x1f')]=_[_0x4296('0x21')](_0x4a9445[_0x4296('0x1d')],_0x4a9445[_0x4296('0x1e')]);_0x374054[_0x4296('0x20')]=_['intersection'](_0x4a9445[_0x4296('0x1d')],qs[_0x4296('0x22')](_0x583d33[_0x4296('0x1e')][_0x4296('0x22')]));_0x374054[_0x4296('0x20')]=_0x374054[_0x4296('0x20')]['length']?_0x374054[_0x4296('0x20')]:_0x4a9445[_0x4296('0x1d')];if(_0x583d33[_0x4296('0x1e')]['includeAll']){_0x374054[_0x4296('0x2c')]=[{'all':!![]}];}_0x374054=_['merge']({},_0x374054,_0x583d33[_0x4296('0x2b')]);return db[_0x4296('0x1a')][_0x4296('0x32')](_0x374054)[_0x4296('0x11')](handleEntityNotFound(_0xe9f20f,null))[_0x4296('0x11')](respondWithResult(_0xe9f20f,null))[_0x4296('0x33')](handleError(_0xe9f20f,null));};exports['create']=function(_0x379f47,_0x19495d){return db['Dynamics365Account']['create'](_0x379f47[_0x4296('0x34')],{})[_0x4296('0x11')](respondWithResult(_0x19495d,0xc9))[_0x4296('0x33')](handleError(_0x19495d,null));};exports[_0x4296('0x10')]=function(_0x74bbd7,_0x592698){if(_0x74bbd7['body']['id']){delete _0x74bbd7[_0x4296('0x34')]['id'];}return db[_0x4296('0x1a')][_0x4296('0x32')]({'where':{'id':_0x74bbd7[_0x4296('0x2f')]['id']}})[_0x4296('0x11')](handleEntityNotFound(_0x592698,null))[_0x4296('0x11')](saveUpdates(_0x74bbd7[_0x4296('0x34')],null))[_0x4296('0x11')](respondWithResult(_0x592698,null))[_0x4296('0x33')](handleError(_0x592698,null));};exports['destroy']=function(_0xaffae0,_0x23a27c){return db[_0x4296('0x1a')]['find']({'where':{'id':_0xaffae0[_0x4296('0x2f')]['id']}})[_0x4296('0x11')](handleEntityNotFound(_0x23a27c,null))['then'](removeEntity(_0x23a27c,null))['catch'](handleError(_0x23a27c,null));};exports[_0x4296('0x35')]=function(_0x2b1aaa,_0x2865d8){var _0x4bd309={};var _0x562fc3={};var _0x54df55;var _0x2d2863;return db[_0x4296('0x1a')][_0x4296('0x36')]({'where':{'id':_0x2b1aaa['params']['id']}})['then'](handleEntityNotFound(_0x2865d8,null))[_0x4296('0x11')](function(_0x1ddb06){if(_0x1ddb06){_0x54df55=_0x1ddb06;_0x562fc3[_0x4296('0x1d')]=_[_0x4296('0x30')](db[_0x4296('0x37')][_0x4296('0x31')]);_0x562fc3[_0x4296('0x1e')]=_[_0x4296('0x30')](_0x2b1aaa['query']);_0x562fc3[_0x4296('0x1f')]=_[_0x4296('0x21')](_0x562fc3[_0x4296('0x1d')],_0x562fc3[_0x4296('0x1e')]);_0x4bd309[_0x4296('0x20')]=_[_0x4296('0x21')](_0x562fc3['model'],qs['fields'](_0x2b1aaa['query'][_0x4296('0x22')]));_0x4bd309[_0x4296('0x20')]=_0x4bd309[_0x4296('0x20')][_0x4296('0x38')]?_0x4bd309['attributes']:_0x562fc3[_0x4296('0x1d')];_0x4bd309[_0x4296('0x24')]=qs[_0x4296('0x25')](_0x2b1aaa[_0x4296('0x1e')][_0x4296('0x25')]);_0x4bd309[_0x4296('0x26')]=qs[_0x4296('0x1f')](_['pick'](_0x2b1aaa[_0x4296('0x1e')],_0x562fc3['filters']));if(_0x2b1aaa['query'][_0x4296('0x2a')]){_0x4bd309[_0x4296('0x26')]=_['merge'](_0x4bd309[_0x4296('0x26')],{'$or':_['map'](_0x4bd309['attributes'],function(_0x3ef143){var _0x41a71c={};_0x41a71c[_0x3ef143]={'$like':'%'+_0x2b1aaa['query']['filter']+'%'};return _0x41a71c;})});}_0x4bd309=_[_0x4296('0x27')]({},_0x4bd309,_0x2b1aaa[_0x4296('0x2b')]);return _0x54df55[_0x4296('0x35')](_0x4bd309);}})[_0x4296('0x11')](function(_0x44b665){if(_0x44b665){_0x2d2863=_0x44b665['length'];if(!_0x2b1aaa[_0x4296('0x1e')][_0x4296('0x23')]('nolimit')){_0x4bd309[_0x4296('0xc')]=qs[_0x4296('0xc')](_0x2b1aaa[_0x4296('0x1e')][_0x4296('0xc')]);_0x4bd309[_0x4296('0xa')]=qs[_0x4296('0xa')](_0x2b1aaa['query'][_0x4296('0xa')]);}return _0x54df55[_0x4296('0x35')](_0x4bd309);}})[_0x4296('0x11')](function(_0xc94881){if(_0xc94881){return _0xc94881?{'count':_0x2d2863,'rows':_0xc94881}:null;}})['then'](respondWithResult(_0x2865d8,null))['catch'](handleError(_0x2865d8,null));};exports[_0x4296('0x39')]=function(_0xf726d0,_0x5d1487){if(_0xf726d0[_0x4296('0x34')]['id']){delete _0xf726d0[_0x4296('0x34')]['id'];}return db[_0x4296('0x1a')][_0x4296('0x36')]({'where':{'id':_0xf726d0[_0x4296('0x2f')]['id']}})['then'](handleEntityNotFound(_0x5d1487,null))[_0x4296('0x11')](function(_0x4dc6c8){if(_0x4dc6c8){_0xf726d0[_0x4296('0x34')]['AccountId']=_0x4dc6c8['id'];_0xf726d0[_0x4296('0x34')][_0x4296('0x3a')]=integrations[_0x4296('0x3b')](_0xf726d0[_0x4296('0x34')][_0x4296('0x3c')],_0xf726d0[_0x4296('0x34')][_0x4296('0x28')]);_0xf726d0[_0x4296('0x34')]['Descriptions']=integrations[_0x4296('0x3d')](_0xf726d0[_0x4296('0x34')][_0x4296('0x3c')],_0xf726d0[_0x4296('0x34')]['type']);return db[_0x4296('0x37')][_0x4296('0x3e')](_0xf726d0[_0x4296('0x34')],{'include':[{'model':db[_0x4296('0x3f')],'as':_0x4296('0x3a')},{'model':db[_0x4296('0x3f')],'as':_0x4296('0x40')}]});}return null;})[_0x4296('0x11')](respondWithResult(_0x5d1487,null))[_0x4296('0x33')](handleError(_0x5d1487,null));};function sanitizeRemoteUri(_0x39d2ed){var _0x1dcee0=_0x39d2ed[_0x4296('0x41')](-0x1);if(_0x1dcee0==='/')return _0x39d2ed[_0x4296('0x42')](0x0,_0x39d2ed[_0x4296('0x43')](_0x1dcee0));return _0x39d2ed;}function getWebApiUrl(_0x896447){return util['format'](_0x4296('0x44'),_0x896447);}exports[_0x4296('0x45')]=function(_0xe4cf57,_0x3c3279){var _0x6e3e2e=_0xe4cf57['query']['ticketType'];var _0x7aacf3=_0x6e3e2e===_0x4296('0x46')?_0x4296('0x47'):_0x4296('0x48');var _0x36aee5='';var _0x43063b='';var _0x284da2='';var _0x538f19='';var _0x5bfef3='';var _0x50af4d='';var _0x14b54e='';var _0x338884='';var _0x139e5c=['title',_0x4296('0x49'),_0x4296('0x4a'),_0x4296('0x4b'),_0x4296('0x4c'),'subject',_0x4296('0x4d'),_0x4296('0x4e'),_0x4296('0x4f'),'phonecall_activity_parties'];var _0x2ca2d7=['accountidname',_0x4296('0x50'),'actualserviceunits','billedserviceunits',_0x4296('0x51'),'contactidyominame',_0x4296('0x52'),_0x4296('0x53'),_0x4296('0x54'),_0x4296('0x55'),_0x4296('0x56'),_0x4296('0x57'),_0x4296('0x58'),'createdonbehalfbyname',_0x4296('0x59'),'customeridname',_0x4296('0x5a'),'customeridyominame','emailaddress',_0x4296('0x5b'),'entityimage_timestamp',_0x4296('0x5c'),'escalatedon','exchangerate',_0x4296('0x5d'),_0x4296('0x5e'),'importsequencenumber',_0x4296('0x5f'),_0x4296('0x60'),'lastonholdtime',_0x4296('0x61'),_0x4296('0x62'),'modifiedbyexternalpartyyominame',_0x4296('0x63'),_0x4296('0x64'),_0x4296('0x65'),_0x4296('0x66'),_0x4296('0x67'),_0x4296('0x68'),'msdyn_iotalertname',_0x4296('0x69'),_0x4296('0x6a'),_0x4296('0x6b'),_0x4296('0x6c'),_0x4296('0x6d'),_0x4296('0x6e'),_0x4296('0x6f'),'primarycontactidname',_0x4296('0x70'),_0x4296('0x71'),_0x4296('0x72'),_0x4296('0x73'),_0x4296('0x74'),_0x4296('0x75'),_0x4296('0x76'),_0x4296('0x77'),_0x4296('0x78'),_0x4296('0x79'),_0x4296('0x7a'),'slaname',_0x4296('0x7b'),_0x4296('0x7c'),_0x4296('0x7d'),_0x4296('0x7e'),'ticketnumber',_0x4296('0x7f'),'transactioncurrencyidname',_0x4296('0x80'),_0x4296('0x81'),_0x4296('0x82')];var _0x57319b=_0x139e5c['concat'](_0x2ca2d7);return db[_0x4296('0x1a')]['findOne']({'where':{'id':_0xe4cf57['params']['id']},'attributes':['id',_0x4296('0x83'),_0x4296('0x84'),_0x4296('0x85'),_0x4296('0x86'),_0x4296('0x87'),_0x4296('0x88'),_0x4296('0x89')],'include':[{'model':db['CloudProvider'],'as':'CloudProvider','attributes':['id',_0x4296('0x8a'),_0x4296('0x8b')]}]})[_0x4296('0x11')](handleEntityNotFound(_0x3c3279,null))[_0x4296('0x11')](function(_0x532980){if(_0x532980){if(_0x532980[_0x4296('0x89')]){_0x532980[_0x4296('0x8c')]=_0x532980[_0x4296('0x8d')][_0x4296('0x8a')];_0x338884=sanitizeRemoteUri(_0x532980['CloudProvider'][_0x4296('0x8b')]);_0x14b54e=getWebApiUrl(_0x338884);return _0x532980;}_0x338884=sanitizeRemoteUri(_0x532980[_0x4296('0x85')]);_0x14b54e=getWebApiUrl(_0x338884);var _0x242be3={'method':_0x4296('0x8e'),'uri':_0x4296('0x8f')+_0x532980[_0x4296('0x86')]+_0x4296('0x90'),'form':{'client_id':_0x532980[_0x4296('0x87')],'resource':_0x338884,'username':_0x532980[_0x4296('0x83')],'password':_0x532980[_0x4296('0x84')],'grant_type':_0x4296('0x84'),'client_secret':_0x532980[_0x4296('0x88')]},'json':!![]};return rp(_0x242be3);}})[_0x4296('0x11')](function(_0x2190dd){_0x50af4d=_0x2190dd[_0x4296('0x8c')];var _0xde4bd5={'method':_0x4296('0x91'),'uri':encodeURI(_0x14b54e+_0x4296('0x92')+_0x7aacf3+'\x27'),'headers':{'Authorization':_0x4296('0x93')+_0x50af4d,'If-None-Match':null,'OData-Version':_0x4296('0x94')},'json':!![]};return rp(_0xde4bd5);})[_0x4296('0x11')](function(_0x41acef){var _0x4e6e45=_0x41acef['value'][0x0];var _0x4af67c=_0x4e6e45[_0x4296('0x95')];var _0x1adb32={'method':'GET','uri':_0x14b54e+_0x4296('0x96')+_0x4af67c+_0x4296('0x97'),'headers':{'Authorization':_0x4296('0x93')+_0x50af4d,'If-None-Match':null,'OData-Version':_0x4296('0x94')},'json':!![]};return rp(_0x1adb32);})['then'](function(_0x26bd3b){_0x36aee5=_0x26bd3b;_0x43063b=_0x36aee5[_0x4296('0x98')];_0x43063b=_['remove'](_0x43063b,function(_0x1b4984){return!_0x57319b[_0x4296('0x99')](_0x1b4984['LogicalName']);});var _0x435ef0=[];var _0x2ca1ef=[];_0x43063b[_0x4296('0x9a')](function(_0x4be975){if(_0x4be975[_0x4296('0x9b')]){var _0x27e017=_0x4be975[_0x4296('0x9b')][_0x4296('0x42')](_0x4be975[_0x4296('0x9b')]['lastIndexOf']('.')+0x1);if(_0x27e017===_0x4296('0x9c')){_0x435ef0[_0x4296('0x9d')](getSelectList(_0x14b54e,_0x6e3e2e,_0x2ca1ef,_0x36aee5['MetadataId'],_0x4be975[_0x4296('0x95')],_0x50af4d));}}});return Promise[_0x4296('0x9e')](_0x435ef0);})['then'](function(_0x49efab){_0x284da2=_0x49efab[0x0];var _0x12d001=[];var _0x46a875=[];_0x43063b['forEach'](function(_0x5c81c3){if(!_[_0x4296('0x9f')](_0x5c81c3['@odata.type'])){var _0x4ed167=_0x5c81c3[_0x4296('0x9b')]['substring'](_0x5c81c3[_0x4296('0x9b')]['lastIndexOf']('.')+0x1);if(_0x4ed167===_0x4296('0xa0')){_0x12d001[_0x4296('0x9d')](getBooleanList(_0x14b54e,_0x6e3e2e,_0x46a875,_0x36aee5['MetadataId'],_0x5c81c3[_0x4296('0x95')],_0x50af4d));}}});return Promise[_0x4296('0x9e')](_0x12d001);})[_0x4296('0x11')](function(_0xd2d03){_0x538f19=_0xd2d03[0x0];var _0x2c4917=[];var _0x43ee11=[];_0x43063b[_0x4296('0x9a')](function(_0x40f669){if(_0x40f669[_0x4296('0x9b')]){var _0x29d2dc=_0x40f669[_0x4296('0x9b')]['substring'](_0x40f669[_0x4296('0x9b')][_0x4296('0x43')]('.')+0x1);if(_0x29d2dc==='StringAttributeMetadata'||_0x29d2dc===_0x4296('0xa1')||_0x29d2dc===_0x4296('0xa2')||_0x29d2dc===_0x4296('0xa3')||_0x29d2dc===_0x4296('0xa4')||_0x29d2dc===_0x4296('0xa5')||_0x29d2dc==='StatusAttributeMetadata'||_0x29d2dc===_0x4296('0xa6')||_0x29d2dc==='StateAttributeMetadata'||_0x29d2dc==='DecimalAttributeMetadata'){_0x2c4917[_0x4296('0x9d')](getInputList(_0x14b54e,_0x6e3e2e,_0x29d2dc,_0x43ee11,_0x36aee5[_0x4296('0x95')],_0x40f669[_0x4296('0x95')],_0x50af4d));}}});return Promise[_0x4296('0x9e')](_0x2c4917);})[_0x4296('0x11')](function(_0x34f748){_0x5bfef3=_0x34f748[0x0];var _0x53c8f0=_0x284da2[_0x4296('0xa7')](_0x538f19)[_0x4296('0xa7')](_0x5bfef3);var _0x59fbc3={'count':_0x53c8f0[_0x4296('0x38')],'rows':_0x53c8f0};return _0x59fbc3;})[_0x4296('0x11')](respondWithResult(_0x3c3279,null))[_0x4296('0x33')](function(_0x5ee5a7){var _0x5e06e6=_0xe4cf57[_0x4296('0x1e')][_0x4296('0xa8')]?0x1f4:_0x5ee5a7['statusCode']||0x1f4;logger[_0x4296('0x14')](_0x5ee5a7[_0x4296('0x15')]);delete _0x5ee5a7['name'];if(_0x5e06e6===0x191){_0x5e06e6=0x190;}_0x3c3279['status'](_0x5e06e6)[_0x4296('0x17')](_0xe4cf57[_0x4296('0x1e')][_0x4296('0xa8')]?{'message':_0x4296('0xa9'),'statusCode':_0x5ee5a7['statusCode']}:_0x5ee5a7);});};function getSelectList(_0x1491b0,_0x3cb5e6,_0x5d3939,_0x29f3a7,_0x4e8540,_0x1dfd3a){var _0x465ce2={'method':_0x4296('0x91'),'uri':_0x1491b0+'EntityDefinitions('+_0x29f3a7+')/Attributes('+_0x4e8540+_0x4296('0xaa')+_0x4296('0xab'),'headers':{'Authorization':_0x4296('0x93')+_0x1dfd3a,'If-None-Match':null,'OData-Version':_0x4296('0x94')},'json':!![]};return rp(_0x465ce2)[_0x4296('0x11')](function(_0x3c50dc){var _0x859b54=[];var _0x4487bc=_0x3c50dc['OptionSet'][_0x4296('0xac')];_0x4487bc['forEach'](function(_0x141577){_0x859b54[_0x4296('0x9d')]({'name':_0x141577['Label'][_0x4296('0xad')][_0x4296('0xae')],'value':String(_0x141577['Value'])});});var _0x475949={'id':_0x3cb5e6+'_'+_0x3c50dc['LogicalName'],'name':_0x3c50dc[_0x4296('0xaf')][_0x4296('0xad')]['Label'],'custom':![],'options':_0x859b54};_0x5d3939[_0x4296('0x9d')](_0x475949);return _0x5d3939;});}function getBooleanList(_0x33009e,_0x161d7e,_0x404174,_0x1c55b6,_0xb5e199,_0x404703){var _0x2344dd={'method':_0x4296('0x91'),'uri':_0x33009e+'EntityDefinitions('+_0x1c55b6+_0x4296('0xb0')+_0xb5e199+_0x4296('0xb1'),'headers':{'Authorization':'Bearer\x20'+_0x404703,'If-None-Match':null,'OData-Version':_0x4296('0x94')},'json':!![]};return rp(_0x2344dd)['then'](function(_0x4ffb65){var _0x1dfc52=[];_0x1dfc52[_0x4296('0x9d')]({'name':_0x4ffb65[_0x4296('0xb2')][_0x4296('0xb3')]['Label'][_0x4296('0xad')][_0x4296('0xae')],'value':_0x4296('0xb4')},{'name':_0x4ffb65[_0x4296('0xb2')][_0x4296('0xb5')]['Label'][_0x4296('0xad')][_0x4296('0xae')],'value':_0x4296('0xb6')});var _0x2a1fb6={'id':_0x161d7e+'_'+_0x4ffb65['LogicalName'],'name':_0x4ffb65[_0x4296('0xaf')][_0x4296('0xad')][_0x4296('0xae')],'custom':![],'options':_0x1dfc52};_0x404174['push'](_0x2a1fb6);return _0x404174;});}function getInputList(_0x83f762,_0x2b2b6d,_0x1cf98,_0x4f5317,_0x6d36b9,_0x5b6f94,_0xe448e5){var _0x6b63e7={'method':_0x4296('0x91'),'uri':_0x83f762+_0x4296('0x96')+_0x6d36b9+_0x4296('0xb0')+_0x5b6f94+_0x4296('0xb7')+_0x1cf98+_0x4296('0xb8'),'headers':{'Authorization':_0x4296('0x93')+_0xe448e5,'If-None-Match':null,'OData-Version':_0x4296('0x94')},'json':!![]};return rp(_0x6b63e7)['then'](function(_0xbf35d5){var _0x39156f={'id':_0x2b2b6d+'_'+_0xbf35d5[_0x4296('0xb9')],'name':_0xbf35d5['DisplayName'][_0x4296('0xad')]?_0xbf35d5[_0x4296('0xaf')][_0x4296('0xad')]['Label']:_0xbf35d5['LogicalName'],'custom':![],'options':[]};_0x4f5317[_0x4296('0x9d')](_0x39156f);return _0x4f5317;});} \ No newline at end of file +var _0x1f8f=['clientSecret','modernAuthentication','CloudProvider','data5','data7','access_token','https://login.microsoftonline.com/','tenantId','/oauth2/token','GET','MetadataId','Bearer\x20','4.0','includes','forEach','@odata.type','substring','PicklistAttributeMetadata','push','all','BooleanAttributeMetadata','DoubleAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','test','statusCode','error','EntityDefinitions(',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Label','UserLocalizedLabel','Value','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','FalseOption','false','LogicalName',')/Microsoft.Dynamics.CRM.','request-promise','util','../../components/parsers/qs','../../config/logger','api','../../mysqldb','../../components/integrations/configuration','json','offset','undefined','limit','count','status','set','Content-Range','update','destroy','then','stack','name','send','map','Dynamics365Account','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','type','VIRTUAL','merge','includeAll','include','findAll','rows','catch','params','options','find','create','body','getConfigurations','findOne','Dynamics365Configuration','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','Dynamics365Field','lastIndexOf','format','%s/api/data/v9.0/','ticketType','incident','Incident','PhoneCall','title','description','caseorigincode','subject','phonenumber','directioncode','phonecall_activity_parties','accountidname','actualserviceunits','contactidname','contactidyominame','contractdetailidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridtype','customeridyominame','entitlementidname','entityimage_timestamp','exchangerate','followupby','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','onholdtime','owneridname','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame','productidname','productserialnumber','resolveby','responsiblecontactidyominame','slainvokedidname','slaname','statecode','statuscode','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','concat','username','password','remoteUri','clientId'];(function(_0x5d98f2,_0x56353d){var _0x109152=function(_0x31a34c){while(--_0x31a34c){_0x5d98f2['push'](_0x5d98f2['shift']());}};_0x109152(++_0x56353d);}(_0x1f8f,0x19c));var _0xf1f8=function(_0x558799,_0x2735b9){_0x558799=_0x558799-0x0;var _0x238ce6=_0x1f8f[_0x558799];return _0x238ce6;};'use strict';var rp=require(_0xf1f8('0x0'));var util=require(_0xf1f8('0x1'));var _=require('lodash');var qs=require(_0xf1f8('0x2'));var logger=require(_0xf1f8('0x3'))(_0xf1f8('0x4'));var db=require(_0xf1f8('0x5'))['db'];var integrations=require(_0xf1f8('0x6'));function respondWithResult(_0x2bc927,_0x5dda04){_0x5dda04=_0x5dda04||0xc8;return function(_0x2a7b94){if(_0x2a7b94){return _0x2bc927['status'](_0x5dda04)[_0xf1f8('0x7')](_0x2a7b94);}};}function respondWithFilteredResult(_0x112def,_0x4c96f6){return function(_0x494fce){if(_0x494fce){var _0xee2940=typeof _0x4c96f6[_0xf1f8('0x8')]===_0xf1f8('0x9')&&typeof _0x4c96f6[_0xf1f8('0xa')]===_0xf1f8('0x9');var _0x32bc61=_0x494fce[_0xf1f8('0xb')];var _0xb6f811=_0xee2940?0x0:_0x4c96f6[_0xf1f8('0x8')];var _0x4d7eba=_0xee2940?_0x494fce[_0xf1f8('0xb')]:_0x4c96f6[_0xf1f8('0x8')]+_0x4c96f6[_0xf1f8('0xa')];var _0x2fbdcf;if(_0x4d7eba>=_0x32bc61){_0x4d7eba=_0x32bc61;_0x2fbdcf=0xc8;}else{_0x2fbdcf=0xce;}_0x112def[_0xf1f8('0xc')](_0x2fbdcf);return _0x112def[_0xf1f8('0xd')](_0xf1f8('0xe'),_0xb6f811+'-'+_0x4d7eba+'/'+_0x32bc61)[_0xf1f8('0x7')](_0x494fce);}return null;};}function saveUpdates(_0x3ae1b2){return function(_0x37d42e){if(_0x37d42e){return _0x37d42e[_0xf1f8('0xf')](_0x3ae1b2)['then'](function(_0x347435){return _0x347435;});}return null;};}function removeEntity(_0x1d66f7){return function(_0x1a2d7f){if(_0x1a2d7f){return _0x1a2d7f[_0xf1f8('0x10')]()[_0xf1f8('0x11')](function(){_0x1d66f7[_0xf1f8('0xc')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51a30d){return function(_0x4378da){if(!_0x4378da){_0x51a30d['sendStatus'](0x194);}return _0x4378da;};}function handleError(_0x10387f,_0x222155){_0x222155=_0x222155||0x1f4;return function(_0x4e5b9d){logger['error'](_0x4e5b9d[_0xf1f8('0x12')]);if(_0x4e5b9d['name']){delete _0x4e5b9d[_0xf1f8('0x13')];}_0x10387f[_0xf1f8('0xc')](_0x222155)[_0xf1f8('0x14')](_0x4e5b9d);};}exports['index']=function(_0xd8761c,_0x4cc6fe){var _0x2f44d4={},_0x16d13c={},_0x1609e8={'count':0x0,'rows':[]};var _0x439bd4=_[_0xf1f8('0x15')](db[_0xf1f8('0x16')][_0xf1f8('0x17')],function(_0x556b51){return{'name':_0x556b51[_0xf1f8('0x18')],'type':_0x556b51['type'][_0xf1f8('0x19')]};});_0x16d13c[_0xf1f8('0x1a')]=_[_0xf1f8('0x15')](_0x439bd4,_0xf1f8('0x13'));_0x16d13c[_0xf1f8('0x1b')]=_[_0xf1f8('0x1c')](_0xd8761c['query']);_0x16d13c[_0xf1f8('0x1d')]=_['intersection'](_0x16d13c[_0xf1f8('0x1a')],_0x16d13c[_0xf1f8('0x1b')]);_0x2f44d4[_0xf1f8('0x1e')]=_[_0xf1f8('0x1f')](_0x16d13c[_0xf1f8('0x1a')],qs[_0xf1f8('0x20')](_0xd8761c[_0xf1f8('0x1b')][_0xf1f8('0x20')]));_0x2f44d4['attributes']=_0x2f44d4[_0xf1f8('0x1e')][_0xf1f8('0x21')]?_0x2f44d4[_0xf1f8('0x1e')]:_0x16d13c[_0xf1f8('0x1a')];if(!_0xd8761c[_0xf1f8('0x1b')][_0xf1f8('0x22')](_0xf1f8('0x23'))){_0x2f44d4['limit']=qs[_0xf1f8('0xa')](_0xd8761c['query'][_0xf1f8('0xa')]);_0x2f44d4[_0xf1f8('0x8')]=qs[_0xf1f8('0x8')](_0xd8761c[_0xf1f8('0x1b')][_0xf1f8('0x8')]);}_0x2f44d4[_0xf1f8('0x24')]=qs[_0xf1f8('0x25')](_0xd8761c[_0xf1f8('0x1b')][_0xf1f8('0x25')]);_0x2f44d4['where']=qs[_0xf1f8('0x1d')](_[_0xf1f8('0x26')](_0xd8761c[_0xf1f8('0x1b')],_0x16d13c['filters']),_0x439bd4);if(_0xd8761c[_0xf1f8('0x1b')][_0xf1f8('0x27')]){_0x2f44d4[_0xf1f8('0x28')]=_['merge'](_0x2f44d4[_0xf1f8('0x28')],{'$or':_[_0xf1f8('0x15')](_0x439bd4,function(_0x31b4de){if(_0x31b4de[_0xf1f8('0x29')]!==_0xf1f8('0x2a')){var _0x37a7dc={};_0x37a7dc[_0x31b4de[_0xf1f8('0x13')]]={'$like':'%'+_0xd8761c[_0xf1f8('0x1b')][_0xf1f8('0x27')]+'%'};return _0x37a7dc;}})});}_0x2f44d4=_[_0xf1f8('0x2b')]({},_0x2f44d4,_0xd8761c['options']);var _0x1c4c32={'where':_0x2f44d4['where']};return db[_0xf1f8('0x16')][_0xf1f8('0xb')](_0x1c4c32)[_0xf1f8('0x11')](function(_0x13329f){_0x1609e8[_0xf1f8('0xb')]=_0x13329f;if(_0xd8761c[_0xf1f8('0x1b')][_0xf1f8('0x2c')]){_0x2f44d4[_0xf1f8('0x2d')]=[{'all':!![]}];}return db[_0xf1f8('0x16')][_0xf1f8('0x2e')](_0x2f44d4);})['then'](function(_0x1982be){_0x1609e8[_0xf1f8('0x2f')]=_0x1982be;return _0x1609e8;})['then'](respondWithFilteredResult(_0x4cc6fe,_0x2f44d4))[_0xf1f8('0x30')](handleError(_0x4cc6fe,null));};exports['show']=function(_0x2f6499,_0x4d9256){var _0x5ee1bc={'raw':![],'where':{'id':_0x2f6499[_0xf1f8('0x31')]['id']}},_0x3845b6={};_0x3845b6['model']=_['keys'](db[_0xf1f8('0x16')][_0xf1f8('0x17')]);_0x3845b6[_0xf1f8('0x1b')]=_[_0xf1f8('0x1c')](_0x2f6499[_0xf1f8('0x1b')]);_0x3845b6[_0xf1f8('0x1d')]=_[_0xf1f8('0x1f')](_0x3845b6[_0xf1f8('0x1a')],_0x3845b6[_0xf1f8('0x1b')]);_0x5ee1bc[_0xf1f8('0x1e')]=_[_0xf1f8('0x1f')](_0x3845b6[_0xf1f8('0x1a')],qs[_0xf1f8('0x20')](_0x2f6499[_0xf1f8('0x1b')]['fields']));_0x5ee1bc['attributes']=_0x5ee1bc[_0xf1f8('0x1e')][_0xf1f8('0x21')]?_0x5ee1bc[_0xf1f8('0x1e')]:_0x3845b6[_0xf1f8('0x1a')];if(_0x2f6499['query']['includeAll']){_0x5ee1bc[_0xf1f8('0x2d')]=[{'all':!![]}];}_0x5ee1bc=_[_0xf1f8('0x2b')]({},_0x5ee1bc,_0x2f6499[_0xf1f8('0x32')]);return db[_0xf1f8('0x16')][_0xf1f8('0x33')](_0x5ee1bc)[_0xf1f8('0x11')](handleEntityNotFound(_0x4d9256,null))[_0xf1f8('0x11')](respondWithResult(_0x4d9256,null))[_0xf1f8('0x30')](handleError(_0x4d9256,null));};exports[_0xf1f8('0x34')]=function(_0x26a033,_0x32e85c){return db[_0xf1f8('0x16')][_0xf1f8('0x34')](_0x26a033[_0xf1f8('0x35')],{})[_0xf1f8('0x11')](respondWithResult(_0x32e85c,0xc9))[_0xf1f8('0x30')](handleError(_0x32e85c,null));};exports['update']=function(_0x5f1ba7,_0x2a0380){if(_0x5f1ba7[_0xf1f8('0x35')]['id']){delete _0x5f1ba7['body']['id'];}return db['Dynamics365Account'][_0xf1f8('0x33')]({'where':{'id':_0x5f1ba7[_0xf1f8('0x31')]['id']}})['then'](handleEntityNotFound(_0x2a0380,null))['then'](saveUpdates(_0x5f1ba7[_0xf1f8('0x35')],null))['then'](respondWithResult(_0x2a0380,null))[_0xf1f8('0x30')](handleError(_0x2a0380,null));};exports['destroy']=function(_0x98b9ab,_0x50d5b6){return db['Dynamics365Account']['find']({'where':{'id':_0x98b9ab[_0xf1f8('0x31')]['id']}})[_0xf1f8('0x11')](handleEntityNotFound(_0x50d5b6,null))['then'](removeEntity(_0x50d5b6,null))[_0xf1f8('0x30')](handleError(_0x50d5b6,null));};exports[_0xf1f8('0x36')]=function(_0x3ba07e,_0x3f7e54){var _0x26cef6={};var _0x445fc1={};var _0x2d4dc7;var _0x458f70;return db[_0xf1f8('0x16')][_0xf1f8('0x37')]({'where':{'id':_0x3ba07e[_0xf1f8('0x31')]['id']}})[_0xf1f8('0x11')](handleEntityNotFound(_0x3f7e54,null))[_0xf1f8('0x11')](function(_0x577f9e){if(_0x577f9e){_0x2d4dc7=_0x577f9e;_0x445fc1[_0xf1f8('0x1a')]=_['keys'](db[_0xf1f8('0x38')][_0xf1f8('0x17')]);_0x445fc1[_0xf1f8('0x1b')]=_[_0xf1f8('0x1c')](_0x3ba07e[_0xf1f8('0x1b')]);_0x445fc1[_0xf1f8('0x1d')]=_[_0xf1f8('0x1f')](_0x445fc1[_0xf1f8('0x1a')],_0x445fc1[_0xf1f8('0x1b')]);_0x26cef6['attributes']=_[_0xf1f8('0x1f')](_0x445fc1[_0xf1f8('0x1a')],qs[_0xf1f8('0x20')](_0x3ba07e[_0xf1f8('0x1b')][_0xf1f8('0x20')]));_0x26cef6[_0xf1f8('0x1e')]=_0x26cef6[_0xf1f8('0x1e')]['length']?_0x26cef6[_0xf1f8('0x1e')]:_0x445fc1[_0xf1f8('0x1a')];_0x26cef6[_0xf1f8('0x24')]=qs[_0xf1f8('0x25')](_0x3ba07e['query'][_0xf1f8('0x25')]);_0x26cef6['where']=qs[_0xf1f8('0x1d')](_[_0xf1f8('0x26')](_0x3ba07e[_0xf1f8('0x1b')],_0x445fc1[_0xf1f8('0x1d')]));if(_0x3ba07e[_0xf1f8('0x1b')]['filter']){_0x26cef6[_0xf1f8('0x28')]=_[_0xf1f8('0x2b')](_0x26cef6[_0xf1f8('0x28')],{'$or':_['map'](_0x26cef6[_0xf1f8('0x1e')],function(_0x37eee7){var _0x226efd={};_0x226efd[_0x37eee7]={'$like':'%'+_0x3ba07e['query'][_0xf1f8('0x27')]+'%'};return _0x226efd;})});}_0x26cef6=_[_0xf1f8('0x2b')]({},_0x26cef6,_0x3ba07e['options']);return _0x2d4dc7['getConfigurations'](_0x26cef6);}})[_0xf1f8('0x11')](function(_0x19bec0){if(_0x19bec0){_0x458f70=_0x19bec0[_0xf1f8('0x21')];if(!_0x3ba07e['query'][_0xf1f8('0x22')](_0xf1f8('0x23'))){_0x26cef6[_0xf1f8('0xa')]=qs[_0xf1f8('0xa')](_0x3ba07e[_0xf1f8('0x1b')]['limit']);_0x26cef6[_0xf1f8('0x8')]=qs['offset'](_0x3ba07e[_0xf1f8('0x1b')][_0xf1f8('0x8')]);}return _0x2d4dc7[_0xf1f8('0x36')](_0x26cef6);}})[_0xf1f8('0x11')](function(_0x3313d5){if(_0x3313d5){return _0x3313d5?{'count':_0x458f70,'rows':_0x3313d5}:null;}})['then'](respondWithResult(_0x3f7e54,null))[_0xf1f8('0x30')](handleError(_0x3f7e54,null));};exports[_0xf1f8('0x39')]=function(_0x4fe2ae,_0x545598){if(_0x4fe2ae['body']['id']){delete _0x4fe2ae[_0xf1f8('0x35')]['id'];}return db[_0xf1f8('0x16')][_0xf1f8('0x37')]({'where':{'id':_0x4fe2ae[_0xf1f8('0x31')]['id']}})[_0xf1f8('0x11')](handleEntityNotFound(_0x545598,null))['then'](function(_0xebbd51){if(_0xebbd51){_0x4fe2ae[_0xf1f8('0x35')][_0xf1f8('0x3a')]=_0xebbd51['id'];_0x4fe2ae[_0xf1f8('0x35')][_0xf1f8('0x3b')]=integrations[_0xf1f8('0x3c')](_0x4fe2ae['body'][_0xf1f8('0x3d')],_0x4fe2ae[_0xf1f8('0x35')]['type']);_0x4fe2ae[_0xf1f8('0x35')][_0xf1f8('0x3e')]=integrations[_0xf1f8('0x3f')](_0x4fe2ae[_0xf1f8('0x35')][_0xf1f8('0x3d')],_0x4fe2ae['body'][_0xf1f8('0x29')]);return db[_0xf1f8('0x38')]['create'](_0x4fe2ae[_0xf1f8('0x35')],{'include':[{'model':db[_0xf1f8('0x40')],'as':_0xf1f8('0x3b')},{'model':db[_0xf1f8('0x40')],'as':_0xf1f8('0x3e')}]});}return null;})[_0xf1f8('0x11')](respondWithResult(_0x545598,null))[_0xf1f8('0x30')](handleError(_0x545598,null));};function sanitizeRemoteUri(_0x37d633){var _0x2378f1=_0x37d633['slice'](-0x1);if(_0x2378f1==='/')return _0x37d633['substring'](0x0,_0x37d633[_0xf1f8('0x41')](_0x2378f1));return _0x37d633;}function getWebApiUrl(_0x3c7fee){return util[_0xf1f8('0x42')](_0xf1f8('0x43'),_0x3c7fee);}exports['getFields']=function(_0x4048ae,_0xdd8eda){var _0x568379=_0x4048ae[_0xf1f8('0x1b')][_0xf1f8('0x44')];var _0xa492db=_0x568379===_0xf1f8('0x45')?_0xf1f8('0x46'):_0xf1f8('0x47');var _0x2206bb='';var _0x5d1a14='';var _0x2f521c='';var _0x3a052f='';var _0x58331d='';var _0x433dba='';var _0x2befb2='';var _0x5beea6='';var _0x4007fb=[_0xf1f8('0x48'),_0xf1f8('0x49'),'customerid','ownerid',_0xf1f8('0x4a'),_0xf1f8('0x4b'),_0xf1f8('0x4c'),'regardingobjectid',_0xf1f8('0x4d'),_0xf1f8('0x4e')];var _0x4821f1=[_0xf1f8('0x4f'),'accountidyominame',_0xf1f8('0x50'),'billedserviceunits',_0xf1f8('0x51'),_0xf1f8('0x52'),_0xf1f8('0x53'),'contractidname',_0xf1f8('0x54'),_0xf1f8('0x55'),_0xf1f8('0x56'),_0xf1f8('0x57'),_0xf1f8('0x58'),_0xf1f8('0x59'),_0xf1f8('0x5a'),'customeridname',_0xf1f8('0x5b'),_0xf1f8('0x5c'),'emailaddress',_0xf1f8('0x5d'),_0xf1f8('0x5e'),'entityimage_url','escalatedon',_0xf1f8('0x5f'),'firstresponsebykpiidname',_0xf1f8('0x60'),'importsequencenumber','influencescore',_0xf1f8('0x61'),_0xf1f8('0x62'),_0xf1f8('0x63'),_0xf1f8('0x64'),'modifiedbyexternalpartyyominame',_0xf1f8('0x65'),_0xf1f8('0x66'),_0xf1f8('0x67'),'modifiedonbehalfbyname',_0xf1f8('0x68'),_0xf1f8('0x69'),_0xf1f8('0x6a'),_0xf1f8('0x6b'),_0xf1f8('0x6c'),'overriddencreatedon',_0xf1f8('0x6d'),_0xf1f8('0x6e'),_0xf1f8('0x6f'),_0xf1f8('0x70'),_0xf1f8('0x71'),_0xf1f8('0x72'),'prioritycodename',_0xf1f8('0x73'),_0xf1f8('0x74'),_0xf1f8('0x75'),'resolvebykpiidname','responseby','responsiblecontactidname',_0xf1f8('0x76'),'sentimentvalue',_0xf1f8('0x77'),_0xf1f8('0x78'),'socialprofileidname',_0xf1f8('0x79'),_0xf1f8('0x7a'),'subjectidname',_0xf1f8('0x7b'),_0xf1f8('0x7c'),_0xf1f8('0x7d'),_0xf1f8('0x7e'),_0xf1f8('0x7f'),_0xf1f8('0x80')];var _0x4b74e2=_0x4007fb[_0xf1f8('0x81')](_0x4821f1);return db[_0xf1f8('0x16')][_0xf1f8('0x37')]({'where':{'id':_0x4048ae['params']['id']},'attributes':['id',_0xf1f8('0x82'),_0xf1f8('0x83'),_0xf1f8('0x84'),'tenantId',_0xf1f8('0x85'),_0xf1f8('0x86'),_0xf1f8('0x87')],'include':[{'model':db[_0xf1f8('0x88')],'as':'CloudProvider','attributes':['id',_0xf1f8('0x89'),_0xf1f8('0x8a')]}]})['then'](handleEntityNotFound(_0xdd8eda,null))[_0xf1f8('0x11')](function(_0x42c5a1){if(_0x42c5a1){if(_0x42c5a1[_0xf1f8('0x87')]){_0x42c5a1[_0xf1f8('0x8b')]=_0x42c5a1[_0xf1f8('0x88')][_0xf1f8('0x89')];_0x5beea6=sanitizeRemoteUri(_0x42c5a1['CloudProvider'][_0xf1f8('0x8a')]);_0x2befb2=getWebApiUrl(_0x5beea6);return _0x42c5a1;}_0x5beea6=sanitizeRemoteUri(_0x42c5a1[_0xf1f8('0x84')]);_0x2befb2=getWebApiUrl(_0x5beea6);var _0x1ed9d0={'method':'POST','uri':_0xf1f8('0x8c')+_0x42c5a1[_0xf1f8('0x8d')]+_0xf1f8('0x8e'),'form':{'client_id':_0x42c5a1['clientId'],'resource':_0x5beea6,'username':_0x42c5a1[_0xf1f8('0x82')],'password':_0x42c5a1[_0xf1f8('0x83')],'grant_type':_0xf1f8('0x83'),'client_secret':_0x42c5a1['clientSecret']},'json':!![]};return rp(_0x1ed9d0);}})[_0xf1f8('0x11')](function(_0xcc839a){_0x433dba=_0xcc839a['access_token'];var _0x19a6b1={'method':_0xf1f8('0x8f'),'uri':encodeURI(_0x2befb2+'EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27'+_0xa492db+'\x27'),'headers':{'Authorization':'Bearer\x20'+_0x433dba,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x19a6b1);})[_0xf1f8('0x11')](function(_0x53de13){var _0x219e58=_0x53de13['value'][0x0];var _0x470cad=_0x219e58[_0xf1f8('0x90')];var _0x3ef764={'method':'GET','uri':_0x2befb2+'EntityDefinitions('+_0x470cad+')?$select=LogicalName&$expand=Attributes($select=LogicalName)','headers':{'Authorization':_0xf1f8('0x91')+_0x433dba,'If-None-Match':null,'OData-Version':_0xf1f8('0x92')},'json':!![]};return rp(_0x3ef764);})['then'](function(_0x46e0c9){_0x2206bb=_0x46e0c9;_0x5d1a14=_0x2206bb['Attributes'];_0x5d1a14=_['remove'](_0x5d1a14,function(_0x29c61f){return!_0x4b74e2[_0xf1f8('0x93')](_0x29c61f['LogicalName']);});var _0x41fa06=[];var _0x6e9e3c=[];_0x5d1a14[_0xf1f8('0x94')](function(_0x4cbb74){if(_0x4cbb74['@odata.type']){var _0x51cb1d=_0x4cbb74[_0xf1f8('0x95')][_0xf1f8('0x96')](_0x4cbb74['@odata.type'][_0xf1f8('0x41')]('.')+0x1);if(_0x51cb1d===_0xf1f8('0x97')){_0x41fa06[_0xf1f8('0x98')](getSelectList(_0x2befb2,_0x568379,_0x6e9e3c,_0x2206bb['MetadataId'],_0x4cbb74[_0xf1f8('0x90')],_0x433dba));}}});return Promise[_0xf1f8('0x99')](_0x41fa06);})['then'](function(_0x4b54dc){_0x2f521c=_0x4b54dc[0x0];var _0x164da2=[];var _0x236cde=[];_0x5d1a14['forEach'](function(_0x30dd74){if(!_['isNil'](_0x30dd74[_0xf1f8('0x95')])){var _0xebdd6a=_0x30dd74['@odata.type'][_0xf1f8('0x96')](_0x30dd74[_0xf1f8('0x95')][_0xf1f8('0x41')]('.')+0x1);if(_0xebdd6a===_0xf1f8('0x9a')){_0x164da2[_0xf1f8('0x98')](getBooleanList(_0x2befb2,_0x568379,_0x236cde,_0x2206bb['MetadataId'],_0x30dd74[_0xf1f8('0x90')],_0x433dba));}}});return Promise['all'](_0x164da2);})[_0xf1f8('0x11')](function(_0x519f31){_0x3a052f=_0x519f31[0x0];var _0x349bac=[];var _0x4ef17d=[];_0x5d1a14[_0xf1f8('0x94')](function(_0x5b8744){if(_0x5b8744['@odata.type']){var _0x340ee7=_0x5b8744[_0xf1f8('0x95')][_0xf1f8('0x96')](_0x5b8744[_0xf1f8('0x95')][_0xf1f8('0x41')]('.')+0x1);if(_0x340ee7==='StringAttributeMetadata'||_0x340ee7===_0xf1f8('0x9b')||_0x340ee7==='BigIntAttributeMetadata'||_0x340ee7===_0xf1f8('0x9c')||_0x340ee7===_0xf1f8('0x9d')||_0x340ee7===_0xf1f8('0x9e')||_0x340ee7===_0xf1f8('0x9f')||_0x340ee7===_0xf1f8('0xa0')||_0x340ee7===_0xf1f8('0xa1')||_0x340ee7===_0xf1f8('0xa2')){_0x349bac['push'](getInputList(_0x2befb2,_0x568379,_0x340ee7,_0x4ef17d,_0x2206bb['MetadataId'],_0x5b8744[_0xf1f8('0x90')],_0x433dba));}}});return Promise[_0xf1f8('0x99')](_0x349bac);})[_0xf1f8('0x11')](function(_0x51c2c5){_0x58331d=_0x51c2c5[0x0];var _0x242877=_0x2f521c[_0xf1f8('0x81')](_0x3a052f)['concat'](_0x58331d);var _0x4e2c8c={'count':_0x242877[_0xf1f8('0x21')],'rows':_0x242877};return _0x4e2c8c;})['then'](respondWithResult(_0xdd8eda,null))[_0xf1f8('0x30')](function(_0xf5bcf7){var _0x2f00d4=_0x4048ae[_0xf1f8('0x1b')][_0xf1f8('0xa3')]?0x1f4:_0xf5bcf7[_0xf1f8('0xa4')]||0x1f4;logger[_0xf1f8('0xa5')](_0xf5bcf7[_0xf1f8('0x12')]);delete _0xf5bcf7[_0xf1f8('0x13')];if(_0x2f00d4===0x191){_0x2f00d4=0x190;}_0xdd8eda[_0xf1f8('0xc')](_0x2f00d4)[_0xf1f8('0x14')](_0x4048ae[_0xf1f8('0x1b')][_0xf1f8('0xa3')]?{'message':'Wrong\x20credentials','statusCode':_0xf5bcf7['statusCode']}:_0xf5bcf7);});};function getSelectList(_0x204b8d,_0xcb0d7a,_0x74467c,_0x293886,_0x3b18eb,_0x324b6e){var _0x149958={'method':'GET','uri':_0x204b8d+_0xf1f8('0xa6')+_0x293886+_0xf1f8('0xa7')+_0x3b18eb+_0xf1f8('0xa8')+_0xf1f8('0xa9'),'headers':{'Authorization':_0xf1f8('0x91')+_0x324b6e,'If-None-Match':null,'OData-Version':_0xf1f8('0x92')},'json':!![]};return rp(_0x149958)[_0xf1f8('0x11')](function(_0x474041){var _0x4acdd5=[];var _0x1209b=_0x474041[_0xf1f8('0xaa')]['Options'];_0x1209b[_0xf1f8('0x94')](function(_0x28b52e){_0x4acdd5[_0xf1f8('0x98')]({'name':_0x28b52e[_0xf1f8('0xab')][_0xf1f8('0xac')][_0xf1f8('0xab')],'value':String(_0x28b52e[_0xf1f8('0xad')])});});var _0x4bdf2c={'id':_0xcb0d7a+'_'+_0x474041['LogicalName'],'name':_0x474041[_0xf1f8('0xae')]['UserLocalizedLabel'][_0xf1f8('0xab')],'custom':![],'options':_0x4acdd5};_0x74467c['push'](_0x4bdf2c);return _0x74467c;});}function getBooleanList(_0x177f6e,_0x196763,_0x201c12,_0x25a9a8,_0x3a627f,_0x36454a){var _0x2e080c={'method':_0xf1f8('0x8f'),'uri':_0x177f6e+_0xf1f8('0xa6')+_0x25a9a8+_0xf1f8('0xa7')+_0x3a627f+_0xf1f8('0xaf'),'headers':{'Authorization':_0xf1f8('0x91')+_0x36454a,'If-None-Match':null,'OData-Version':_0xf1f8('0x92')},'json':!![]};return rp(_0x2e080c)[_0xf1f8('0x11')](function(_0x327231){var _0x18197d=[];_0x18197d['push']({'name':_0x327231[_0xf1f8('0xaa')][_0xf1f8('0xb0')][_0xf1f8('0xab')][_0xf1f8('0xac')]['Label'],'value':_0xf1f8('0xb1')},{'name':_0x327231[_0xf1f8('0xaa')][_0xf1f8('0xb2')][_0xf1f8('0xab')][_0xf1f8('0xac')][_0xf1f8('0xab')],'value':_0xf1f8('0xb3')});var _0x2d9a9e={'id':_0x196763+'_'+_0x327231[_0xf1f8('0xb4')],'name':_0x327231[_0xf1f8('0xae')][_0xf1f8('0xac')][_0xf1f8('0xab')],'custom':![],'options':_0x18197d};_0x201c12[_0xf1f8('0x98')](_0x2d9a9e);return _0x201c12;});}function getInputList(_0x4032ec,_0x4821da,_0x4a140d,_0x3c3445,_0x1334e9,_0x1820dc,_0x3636d1){var _0xc7e5bb={'method':_0xf1f8('0x8f'),'uri':_0x4032ec+'EntityDefinitions('+_0x1334e9+_0xf1f8('0xa7')+_0x1820dc+_0xf1f8('0xb5')+_0x4a140d+'?$select=DisplayName,LogicalName','headers':{'Authorization':_0xf1f8('0x91')+_0x3636d1,'If-None-Match':null,'OData-Version':_0xf1f8('0x92')},'json':!![]};return rp(_0xc7e5bb)[_0xf1f8('0x11')](function(_0x3dabf7){var _0x27e3f6={'id':_0x4821da+'_'+_0x3dabf7[_0xf1f8('0xb4')],'name':_0x3dabf7['DisplayName'][_0xf1f8('0xac')]?_0x3dabf7[_0xf1f8('0xae')]['UserLocalizedLabel'][_0xf1f8('0xab')]:_0x3dabf7[_0xf1f8('0xb4')],'custom':![],'options':[]};_0x3c3445[_0xf1f8('0x98')](_0x27e3f6);return _0x3c3445;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index 2fc9d29..f6a80f7 100644 --- a/server/api/intDynamics365Account/intDynamics365Account.model.js +++ b/server/api/intDynamics365Account/intDynamics365Account.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','int_dynamics365_accounts','lodash','util'];(function(_0x4f6274,_0x2b8f02){var _0x3a575b=function(_0x179bd4){while(--_0x179bd4){_0x4f6274['push'](_0x4f6274['shift']());}};_0x3a575b(++_0x2b8f02);}(_0xe706,0xa3));var _0x6e70=function(_0x482115,_0x5550f5){_0x482115=_0x482115-0x0;var _0x40afb4=_0xe706[_0x482115];return _0x40afb4;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));var integrations=require(_0x6e70('0xa'));module[_0x6e70('0xb')]=function(_0x4381d1,_0x36357b){return _0x4381d1[_0x6e70('0xc')](_0x6e70('0xd'),attributes,{'tableName':_0x6e70('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcb91=['rimraf','./intDynamics365Account.attributes','../../components/integrations/configuration','Dynamics365Account','int_dynamics365_accounts','../../config/logger','api','moment','bluebird','path'];(function(_0x34cdea,_0x2837d4){var _0x3b8216=function(_0x93e0e8){while(--_0x93e0e8){_0x34cdea['push'](_0x34cdea['shift']());}};_0x3b8216(++_0x2837d4);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x903228,_0x42c429){_0x903228=_0x903228-0x0;var _0xcec81d=_0xcb91[_0x903228];return _0xcec81d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var moment=require(_0x1cb9('0x2'));var BPromise=require(_0x1cb9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1cb9('0x4'));var rimraf=require(_0x1cb9('0x5'));var config=require('../../config/environment');var attributes=require(_0x1cb9('0x6'));var integrations=require(_0x1cb9('0x7'));module['exports']=function(_0x226b69,_0x3f7deb){return _0x226b69['define'](_0x1cb9('0x8'),attributes,{'tableName':_0x1cb9('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.rpc.js b/server/api/intDynamics365Account/intDynamics365Account.rpc.js index e433297..a69401e 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 _0x2d88=['ShowDynamics365Account','find','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetDynamics365Account','Dynamics365Account','findAll','options','raw','where','limit','include','model','attributes','map'];(function(_0x75bc91,_0x1ed99d){var _0x9dddc6=function(_0x283fd8){while(--_0x283fd8){_0x75bc91['push'](_0x75bc91['shift']());}};_0x9dddc6(++_0x1ed99d);}(_0x2d88,0xec));var _0x82d8=function(_0x4c3f30,_0x419650){_0x4c3f30=_0x4c3f30-0x0;var _0x45e5ed=_0x2d88[_0x4c3f30];return _0x45e5ed;};'use strict';var _=require(_0x82d8('0x0'));var util=require(_0x82d8('0x1'));var moment=require(_0x82d8('0x2'));var BPromise=require(_0x82d8('0x3'));var rs=require(_0x82d8('0x4'));var fs=require('fs');var Redis=require(_0x82d8('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x82d8('0x6'));var logger=require(_0x82d8('0x7'))(_0x82d8('0x8'));var config=require(_0x82d8('0x9'));var jayson=require(_0x82d8('0xa'));var client=jayson[_0x82d8('0xb')][_0x82d8('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x44b2dd,_0x204862,_0x260459){return new BPromise(function(_0x139617,_0x37db01){return client[_0x82d8('0xd')](_0x44b2dd,_0x260459)[_0x82d8('0xe')](function(_0x40c43b){logger[_0x82d8('0xf')](_0x82d8('0x10'),_0x204862,_0x82d8('0x11'));logger[_0x82d8('0x12')](_0x82d8('0x13'),_0x204862,'request\x20sent',JSON[_0x82d8('0x14')](_0x40c43b));if(_0x40c43b['error']){if(_0x40c43b[_0x82d8('0x15')][_0x82d8('0x16')]===0x1f4){logger['error']('Dynamics365Account,\x20%s,\x20%s',_0x204862,_0x40c43b[_0x82d8('0x15')]['message']);return _0x37db01(_0x40c43b['error'][_0x82d8('0x17')]);}logger[_0x82d8('0x15')](_0x82d8('0x10'),_0x204862,_0x40c43b['error'][_0x82d8('0x17')]);return _0x139617(_0x40c43b[_0x82d8('0x15')][_0x82d8('0x17')]);}else{logger[_0x82d8('0xf')]('Dynamics365Account,\x20%s,\x20%s',_0x204862,_0x82d8('0x11'));_0x139617(_0x40c43b[_0x82d8('0x18')]['message']);}})[_0x82d8('0x19')](function(_0x378bbb){logger[_0x82d8('0x15')]('Dynamics365Account,\x20%s,\x20%s',_0x204862,_0x378bbb);_0x37db01(_0x378bbb);});});}exports[_0x82d8('0x1a')]=function(_0x28d895){var _0x1d96e5=this;return new Promise(function(_0x1181e8,_0x327023){return db[_0x82d8('0x1b')][_0x82d8('0x1c')]({'raw':_0x28d895[_0x82d8('0x1d')]?_0x28d895[_0x82d8('0x1d')][_0x82d8('0x1e')]===undefined?!![]:![]:!![],'where':_0x28d895[_0x82d8('0x1d')]?_0x28d895[_0x82d8('0x1d')][_0x82d8('0x1f')]||null:null,'attributes':_0x28d895[_0x82d8('0x1d')]?_0x28d895[_0x82d8('0x1d')]['attributes']||null:null,'limit':_0x28d895[_0x82d8('0x1d')]?_0x28d895[_0x82d8('0x1d')][_0x82d8('0x20')]||null:null,'include':_0x28d895[_0x82d8('0x1d')]?_0x28d895['options']['include']?_['map'](_0x28d895[_0x82d8('0x1d')][_0x82d8('0x21')],function(_0x222f06){return{'model':db[_0x222f06[_0x82d8('0x22')]],'as':_0x222f06['as'],'attributes':_0x222f06[_0x82d8('0x23')],'include':_0x222f06[_0x82d8('0x21')]?_['map'](_0x222f06[_0x82d8('0x21')],function(_0x3d24d9){return{'model':db[_0x3d24d9['model']],'as':_0x3d24d9['as'],'attributes':_0x3d24d9[_0x82d8('0x23')],'include':_0x3d24d9[_0x82d8('0x21')]?_[_0x82d8('0x24')](_0x3d24d9[_0x82d8('0x21')],function(_0x46b533){return{'model':db[_0x46b533[_0x82d8('0x22')]],'as':_0x46b533['as'],'attributes':_0x46b533[_0x82d8('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x348a54){logger[_0x82d8('0xf')]('GetDynamics365Account',_0x28d895);logger[_0x82d8('0x12')]('GetDynamics365Account',_0x28d895,JSON['stringify'](_0x348a54));_0x1181e8(_0x348a54);})[_0x82d8('0x19')](function(_0x2598fb){logger[_0x82d8('0x15')](_0x82d8('0x1a'),_0x2598fb[_0x82d8('0x17')],_0x28d895);_0x327023(_0x1d96e5[_0x82d8('0x15')](0x1f4,_0x2598fb[_0x82d8('0x17')]));});});};exports[_0x82d8('0x25')]=function(_0x4c51c2){var _0x42b1fa=this;return new Promise(function(_0x2230e3,_0x4460e6){return db[_0x82d8('0x1b')][_0x82d8('0x26')]({'raw':_0x4c51c2[_0x82d8('0x1d')]?_0x4c51c2['options'][_0x82d8('0x1e')]===undefined?!![]:![]:!![],'where':_0x4c51c2[_0x82d8('0x1d')]?_0x4c51c2['options'][_0x82d8('0x1f')]||null:null,'attributes':_0x4c51c2[_0x82d8('0x1d')]?_0x4c51c2[_0x82d8('0x1d')][_0x82d8('0x23')]||null:null,'include':_0x4c51c2[_0x82d8('0x1d')]?_0x4c51c2['options'][_0x82d8('0x21')]?_[_0x82d8('0x24')](_0x4c51c2[_0x82d8('0x1d')][_0x82d8('0x21')],function(_0x2ff150){return{'model':db[_0x2ff150[_0x82d8('0x22')]],'as':_0x2ff150['as'],'attributes':_0x2ff150[_0x82d8('0x23')],'include':_0x2ff150[_0x82d8('0x21')]?_[_0x82d8('0x24')](_0x2ff150[_0x82d8('0x21')],function(_0x23311a){return{'model':db[_0x23311a[_0x82d8('0x22')]],'as':_0x23311a['as'],'attributes':_0x23311a[_0x82d8('0x23')],'include':_0x23311a['include']?_['map'](_0x23311a['include'],function(_0x233657){return{'model':db[_0x233657[_0x82d8('0x22')]],'as':_0x233657['as'],'attributes':_0x233657[_0x82d8('0x23')]};}):[]};}):[]};}):[]:[]})[_0x82d8('0xe')](function(_0x4734e5){logger[_0x82d8('0xf')]('ShowDynamics365Account',_0x4c51c2);logger['debug']('ShowDynamics365Account',_0x4c51c2,JSON[_0x82d8('0x14')](_0x4734e5));_0x2230e3(_0x4734e5);})[_0x82d8('0x19')](function(_0x495a01){logger[_0x82d8('0x15')](_0x82d8('0x25'),_0x495a01['message'],_0x4c51c2);_0x4460e6(_0x42b1fa[_0x82d8('0x15')](0x1f4,_0x495a01[_0x82d8('0x17')]));});});}; \ No newline at end of file +var _0x431d=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','request','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','message','result','GetDynamics365Account','findAll','options','raw','where','attributes','include','map','model','ShowDynamics365Account','Dynamics365Account','find','catch','lodash'];(function(_0x4f3487,_0x143272){var _0x58d74f=function(_0x24ec84){while(--_0x24ec84){_0x4f3487['push'](_0x4f3487['shift']());}};_0x58d74f(++_0x143272);}(_0x431d,0x1db));var _0xd431=function(_0x55bd12,_0x3ccb52){_0x55bd12=_0x55bd12-0x0;var _0x1941dd=_0x431d[_0x55bd12];return _0x1941dd;};'use strict';var _=require(_0xd431('0x0'));var util=require(_0xd431('0x1'));var moment=require(_0xd431('0x2'));var BPromise=require(_0xd431('0x3'));var rs=require(_0xd431('0x4'));var fs=require('fs');var Redis=require(_0xd431('0x5'));var db=require(_0xd431('0x6'))['db'];var utils=require(_0xd431('0x7'));var logger=require(_0xd431('0x8'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xd431('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x217520,_0x4e42ca,_0xface44){return new BPromise(function(_0x6a7b6d,_0x5753d1){return client[_0xd431('0xa')](_0x217520,_0xface44)[_0xd431('0xb')](function(_0x1c6a34){logger[_0xd431('0xc')](_0xd431('0xd'),_0x4e42ca,_0xd431('0xe'));logger[_0xd431('0xf')](_0xd431('0x10'),_0x4e42ca,_0xd431('0xe'),JSON[_0xd431('0x11')](_0x1c6a34));if(_0x1c6a34['error']){if(_0x1c6a34[_0xd431('0x12')]['code']===0x1f4){logger['error'](_0xd431('0xd'),_0x4e42ca,_0x1c6a34[_0xd431('0x12')][_0xd431('0x13')]);return _0x5753d1(_0x1c6a34['error'][_0xd431('0x13')]);}logger['error'](_0xd431('0xd'),_0x4e42ca,_0x1c6a34[_0xd431('0x12')]['message']);return _0x6a7b6d(_0x1c6a34[_0xd431('0x12')][_0xd431('0x13')]);}else{logger[_0xd431('0xc')](_0xd431('0xd'),_0x4e42ca,_0xd431('0xe'));_0x6a7b6d(_0x1c6a34[_0xd431('0x14')][_0xd431('0x13')]);}})['catch'](function(_0x57b3d5){logger[_0xd431('0x12')](_0xd431('0xd'),_0x4e42ca,_0x57b3d5);_0x5753d1(_0x57b3d5);});});}exports[_0xd431('0x15')]=function(_0x40ebd8){var _0x1c4569=this;return new Promise(function(_0x34705f,_0x6f0355){return db['Dynamics365Account'][_0xd431('0x16')]({'raw':_0x40ebd8[_0xd431('0x17')]?_0x40ebd8[_0xd431('0x17')][_0xd431('0x18')]===undefined?!![]:![]:!![],'where':_0x40ebd8[_0xd431('0x17')]?_0x40ebd8[_0xd431('0x17')][_0xd431('0x19')]||null:null,'attributes':_0x40ebd8['options']?_0x40ebd8[_0xd431('0x17')][_0xd431('0x1a')]||null:null,'limit':_0x40ebd8['options']?_0x40ebd8[_0xd431('0x17')]['limit']||null:null,'include':_0x40ebd8[_0xd431('0x17')]?_0x40ebd8['options'][_0xd431('0x1b')]?_[_0xd431('0x1c')](_0x40ebd8[_0xd431('0x17')][_0xd431('0x1b')],function(_0x18e4ca){return{'model':db[_0x18e4ca[_0xd431('0x1d')]],'as':_0x18e4ca['as'],'attributes':_0x18e4ca[_0xd431('0x1a')],'include':_0x18e4ca['include']?_[_0xd431('0x1c')](_0x18e4ca[_0xd431('0x1b')],function(_0x2d0b90){return{'model':db[_0x2d0b90['model']],'as':_0x2d0b90['as'],'attributes':_0x2d0b90[_0xd431('0x1a')],'include':_0x2d0b90[_0xd431('0x1b')]?_[_0xd431('0x1c')](_0x2d0b90[_0xd431('0x1b')],function(_0xcfc92b){return{'model':db[_0xcfc92b[_0xd431('0x1d')]],'as':_0xcfc92b['as'],'attributes':_0xcfc92b[_0xd431('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xd431('0xb')](function(_0x5e629a){logger[_0xd431('0xc')](_0xd431('0x15'),_0x40ebd8);logger['debug'](_0xd431('0x15'),_0x40ebd8,JSON[_0xd431('0x11')](_0x5e629a));_0x34705f(_0x5e629a);})['catch'](function(_0x3f3da9){logger[_0xd431('0x12')](_0xd431('0x15'),_0x3f3da9[_0xd431('0x13')],_0x40ebd8);_0x6f0355(_0x1c4569['error'](0x1f4,_0x3f3da9[_0xd431('0x13')]));});});};exports[_0xd431('0x1e')]=function(_0x283176){var _0x55f1d5=this;return new Promise(function(_0x46d9e3,_0x38a004){return db[_0xd431('0x1f')][_0xd431('0x20')]({'raw':_0x283176[_0xd431('0x17')]?_0x283176['options'][_0xd431('0x18')]===undefined?!![]:![]:!![],'where':_0x283176[_0xd431('0x17')]?_0x283176[_0xd431('0x17')][_0xd431('0x19')]||null:null,'attributes':_0x283176['options']?_0x283176[_0xd431('0x17')][_0xd431('0x1a')]||null:null,'include':_0x283176[_0xd431('0x17')]?_0x283176[_0xd431('0x17')][_0xd431('0x1b')]?_['map'](_0x283176[_0xd431('0x17')][_0xd431('0x1b')],function(_0xe2ae00){return{'model':db[_0xe2ae00[_0xd431('0x1d')]],'as':_0xe2ae00['as'],'attributes':_0xe2ae00[_0xd431('0x1a')],'include':_0xe2ae00[_0xd431('0x1b')]?_[_0xd431('0x1c')](_0xe2ae00['include'],function(_0x9f7308){return{'model':db[_0x9f7308['model']],'as':_0x9f7308['as'],'attributes':_0x9f7308[_0xd431('0x1a')],'include':_0x9f7308[_0xd431('0x1b')]?_['map'](_0x9f7308[_0xd431('0x1b')],function(_0x525717){return{'model':db[_0x525717[_0xd431('0x1d')]],'as':_0x525717['as'],'attributes':_0x525717[_0xd431('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xd431('0xb')](function(_0x18d1ca){logger['info'](_0xd431('0x1e'),_0x283176);logger[_0xd431('0xf')](_0xd431('0x1e'),_0x283176,JSON[_0xd431('0x11')](_0x18d1ca));_0x46d9e3(_0x18d1ca);})[_0xd431('0x21')](function(_0x2e5516){logger['error']('ShowDynamics365Account',_0x2e5516['message'],_0x283176);_0x38a004(_0x55f1d5[_0xd431('0x12')](0x1f4,_0x2e5516[_0xd431('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index 24e084c..6c7a852 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 _0xe511=['create','put','update','delete','/:id','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','get','index','show','getFields','/:id/subjects','isAuthenticated','getSubjects','getDescriptions','post'];(function(_0x545ba4,_0x377a36){var _0x214e40=function(_0x4a4d0f){while(--_0x4a4d0f){_0x545ba4['push'](_0x545ba4['shift']());}};_0x214e40(++_0x377a36);}(_0xe511,0x16f));var _0x1e51=function(_0x543341,_0x25271a){_0x543341=_0x543341-0x0;var _0x59362b=_0xe511[_0x543341];return _0x59362b;};'use strict';var multer=require(_0x1e51('0x0'));var util=require(_0x1e51('0x1'));var path=require('path');var timeout=require(_0x1e51('0x2'));var express=require('express');var router=express[_0x1e51('0x3')]();var fs_extra=require(_0x1e51('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x1e51('0x5'));var config=require(_0x1e51('0x6'));var controller=require(_0x1e51('0x7'));router[_0x1e51('0x8')]('/',auth['isAuthenticated'](),controller[_0x1e51('0x9')]);router[_0x1e51('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x1e51('0xa')]);router[_0x1e51('0x8')]('/:id/fields',auth['isAuthenticated'](),controller[_0x1e51('0xb')]);router[_0x1e51('0x8')](_0x1e51('0xc'),auth[_0x1e51('0xd')](),controller[_0x1e51('0xe')]);router[_0x1e51('0x8')]('/:id/descriptions',auth[_0x1e51('0xd')](),controller[_0x1e51('0xf')]);router[_0x1e51('0x10')]('/',auth[_0x1e51('0xd')](),controller[_0x1e51('0x11')]);router[_0x1e51('0x12')]('/:id',auth[_0x1e51('0xd')](),controller[_0x1e51('0x13')]);router[_0x1e51('0x14')](_0x1e51('0x15'),auth[_0x1e51('0xd')](),controller[_0x1e51('0x16')]);module[_0x1e51('0x17')]=router; \ No newline at end of file +var _0xbc2c=['update','delete','destroy','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','get','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','post','create','put'];(function(_0x337d7c,_0x569a9f){var _0x5665f6=function(_0x44eca2){while(--_0x44eca2){_0x337d7c['push'](_0x337d7c['shift']());}};_0x5665f6(++_0x569a9f);}(_0xbc2c,0x123));var _0xcbc2=function(_0x57b248,_0x2d5053){_0x57b248=_0x57b248-0x0;var _0x3a55f5=_0xbc2c[_0x57b248];return _0x3a55f5;};'use strict';var multer=require(_0xcbc2('0x0'));var util=require(_0xcbc2('0x1'));var path=require(_0xcbc2('0x2'));var timeout=require(_0xcbc2('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xcbc2('0x4'));var auth=require(_0xcbc2('0x5'));var interaction=require(_0xcbc2('0x6'));var config=require(_0xcbc2('0x7'));var controller=require(_0xcbc2('0x8'));router[_0xcbc2('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xcbc2('0x9')](_0xcbc2('0xa'),auth[_0xcbc2('0xb')](),controller[_0xcbc2('0xc')]);router['get'](_0xcbc2('0xd'),auth[_0xcbc2('0xb')](),controller[_0xcbc2('0xe')]);router[_0xcbc2('0x9')](_0xcbc2('0xf'),auth[_0xcbc2('0xb')](),controller[_0xcbc2('0x10')]);router[_0xcbc2('0x9')](_0xcbc2('0x11'),auth[_0xcbc2('0xb')](),controller['getDescriptions']);router[_0xcbc2('0x12')]('/',auth[_0xcbc2('0xb')](),controller[_0xcbc2('0x13')]);router[_0xcbc2('0x14')](_0xcbc2('0xa'),auth[_0xcbc2('0xb')](),controller[_0xcbc2('0x15')]);router[_0xcbc2('0x16')](_0xcbc2('0xa'),auth[_0xcbc2('0xb')](),controller[_0xcbc2('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index 3567171..1bd56ba 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 _0xad0f=['exports','STRING','incident','phonecall','ENUM','contact','nothing','sequelize'];(function(_0x3d8c76,_0x4bf40e){var _0x3de364=function(_0x3b87cc){while(--_0x3b87cc){_0x3d8c76['push'](_0x3d8c76['shift']());}};_0x3de364(++_0x4bf40e);}(_0xad0f,0x1d7));var _0xfad0=function(_0x59d89e,_0x55edf5){_0x59d89e=_0x59d89e-0x0;var _0x554e93=_0xad0f[_0x59d89e];return _0x554e93;};'use strict';var Sequelize=require(_0xfad0('0x0'));module[_0xfad0('0x1')]={'name':{'type':Sequelize[_0xfad0('0x2')]},'description':{'type':Sequelize[_0xfad0('0x2')]},'ticketType':{'type':Sequelize['ENUM'](_0xfad0('0x3'),_0xfad0('0x4')),'defaultValue':_0xfad0('0x3')},'moduleCreate':{'type':Sequelize[_0xfad0('0x5')](_0xfad0('0x6'),_0xfad0('0x7')),'defaultValue':_0xfad0('0x6'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize[_0xfad0('0x2')],'allowNull':!![]},'openNewTab':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0xdce9=['nothing','sequelize','exports','STRING','ENUM','incident','phonecall','contact'];(function(_0x549544,_0x27a1fd){var _0x5e87b8=function(_0x2cf4b9){while(--_0x2cf4b9){_0x549544['push'](_0x549544['shift']());}};_0x5e87b8(++_0x27a1fd);}(_0xdce9,0x99));var _0x9dce=function(_0x322886,_0x144334){_0x322886=_0x322886-0x0;var _0x5e4747=_0xdce9[_0x322886];return _0x5e4747;};'use strict';var Sequelize=require(_0x9dce('0x0'));module[_0x9dce('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x9dce('0x2')]},'ticketType':{'type':Sequelize[_0x9dce('0x3')](_0x9dce('0x4'),_0x9dce('0x5')),'defaultValue':_0x9dce('0x4')},'moduleCreate':{'type':Sequelize['ENUM'](_0x9dce('0x6'),_0x9dce('0x7')),'defaultValue':_0x9dce('0x6'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize['STRING'],'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 938bda9..147453e 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 _0x4378=['save','update','then','destroy','error','stack','name','send','index','Dynamics365Configuration','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','filters','pick','filter','where','merge','map','VIRTUAL','includeAll','findAll','rows','catch','show','include','find','create','body','params','getFields','findOne','Dynamics365Field','options','nolimit','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','reject'];(function(_0x247d9a,_0x44b2af){var _0x282ff7=function(_0x2e4712){while(--_0x2e4712){_0x247d9a['push'](_0x247d9a['shift']());}};_0x282ff7(++_0x44b2af);}(_0x4378,0x80));var _0x8437=function(_0x2fa9b6,_0x265036){_0x2fa9b6=_0x2fa9b6-0x0;var _0x3d7adb=_0x4378[_0x2fa9b6];return _0x3d7adb;};'use strict';var emlformat=require(_0x8437('0x0'));var rimraf=require(_0x8437('0x1'));var zipdir=require(_0x8437('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8437('0x3'));var moment=require('moment');var BPromise=require(_0x8437('0x4'));var Mustache=require(_0x8437('0x5'));var util=require('util');var path=require(_0x8437('0x6'));var sox=require(_0x8437('0x7'));var csv=require(_0x8437('0x8'));var ejs=require(_0x8437('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8437('0xa'));var squel=require(_0x8437('0xb'));var crypto=require(_0x8437('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x8437('0xd'));var toCsv=require(_0x8437('0x8'));var querystring=require('querystring');var Papa=require(_0x8437('0xe'));var Redis=require(_0x8437('0xf'));var authService=require(_0x8437('0x10'));var qs=require(_0x8437('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8437('0x12'));var logger=require(_0x8437('0x13'))(_0x8437('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x8437('0x15'));var db=require(_0x8437('0x16'))['db'];function respondWithStatusCode(_0x275a1d,_0x1f63bf){_0x1f63bf=_0x1f63bf||0xcc;return function(_0x2eb326){if(_0x2eb326){return _0x275a1d[_0x8437('0x17')](_0x1f63bf);}return _0x275a1d['status'](_0x1f63bf)[_0x8437('0x18')]();};}function respondWithResult(_0x3015c7,_0x264af3){_0x264af3=_0x264af3||0xc8;return function(_0x39e732){if(_0x39e732){return _0x3015c7[_0x8437('0x19')](_0x264af3)[_0x8437('0x1a')](_0x39e732);}};}function respondWithFilteredResult(_0x22f010,_0x59160c){return function(_0x3c63f5){if(_0x3c63f5){var _0x2444c1=typeof _0x59160c['offset']===_0x8437('0x1b')&&typeof _0x59160c[_0x8437('0x1c')]===_0x8437('0x1b');var _0x454113=_0x3c63f5['count'];var _0x280b17=_0x2444c1?0x0:_0x59160c['offset'];var _0x182225=_0x2444c1?_0x3c63f5[_0x8437('0x1d')]:_0x59160c[_0x8437('0x1e')]+_0x59160c[_0x8437('0x1c')];var _0x5083f6;if(_0x182225>=_0x454113){_0x182225=_0x454113;_0x5083f6=0xc8;}else{_0x5083f6=0xce;}_0x22f010['status'](_0x5083f6);return _0x22f010[_0x8437('0x1f')](_0x8437('0x20'),_0x280b17+'-'+_0x182225+'/'+_0x454113)['json'](_0x3c63f5);}return null;};}function patchUpdates(_0x115842){return function(_0x3b6c9f){try{jsonpatch['apply'](_0x3b6c9f,_0x115842,!![]);}catch(_0x1a52e8){return BPromise[_0x8437('0x21')](_0x1a52e8);}return _0x3b6c9f[_0x8437('0x22')]();};}function saveUpdates(_0x34a0a7,_0x5bee32){return function(_0x25ac87){if(_0x25ac87){return _0x25ac87[_0x8437('0x23')](_0x34a0a7)[_0x8437('0x24')](function(_0x4f9e9f){return _0x4f9e9f;});}return null;};}function removeEntity(_0x1d4f4c,_0x374913){return function(_0x82a2d8){if(_0x82a2d8){return _0x82a2d8[_0x8437('0x25')]()['then'](function(){_0x1d4f4c[_0x8437('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x32731a,_0x35c396){return function(_0x4df984){if(!_0x4df984){_0x32731a[_0x8437('0x17')](0x194);}return _0x4df984;};}function handleError(_0x4b766c,_0x47bd19){_0x47bd19=_0x47bd19||0x1f4;return function(_0x2f8705){logger[_0x8437('0x26')](_0x2f8705[_0x8437('0x27')]);if(_0x2f8705['name']){delete _0x2f8705[_0x8437('0x28')];}_0x4b766c[_0x8437('0x19')](_0x47bd19)[_0x8437('0x29')](_0x2f8705);};}exports[_0x8437('0x2a')]=function(_0xf5ea6d,_0x12f078){var _0x53ef82={},_0x58f1b8={},_0x2c1b71={'count':0x0,'rows':[]};var _0x1437d0=_['map'](db[_0x8437('0x2b')][_0x8437('0x2c')],function(_0x2260ac){return{'name':_0x2260ac[_0x8437('0x2d')],'type':_0x2260ac['type'][_0x8437('0x2e')]};});_0x58f1b8[_0x8437('0x2f')]=_['map'](_0x1437d0,_0x8437('0x28'));_0x58f1b8[_0x8437('0x30')]=_[_0x8437('0x31')](_0xf5ea6d[_0x8437('0x30')]);_0x58f1b8['filters']=_[_0x8437('0x32')](_0x58f1b8[_0x8437('0x2f')],_0x58f1b8[_0x8437('0x30')]);_0x53ef82[_0x8437('0x33')]=_[_0x8437('0x32')](_0x58f1b8['model'],qs[_0x8437('0x34')](_0xf5ea6d[_0x8437('0x30')][_0x8437('0x34')]));_0x53ef82[_0x8437('0x33')]=_0x53ef82[_0x8437('0x33')][_0x8437('0x35')]?_0x53ef82[_0x8437('0x33')]:_0x58f1b8['model'];if(!_0xf5ea6d[_0x8437('0x30')][_0x8437('0x36')]('nolimit')){_0x53ef82['limit']=qs[_0x8437('0x1c')](_0xf5ea6d[_0x8437('0x30')][_0x8437('0x1c')]);_0x53ef82[_0x8437('0x1e')]=qs[_0x8437('0x1e')](_0xf5ea6d['query'][_0x8437('0x1e')]);}_0x53ef82[_0x8437('0x37')]=qs[_0x8437('0x38')](_0xf5ea6d[_0x8437('0x30')][_0x8437('0x38')]);_0x53ef82['where']=qs[_0x8437('0x39')](_[_0x8437('0x3a')](_0xf5ea6d['query'],_0x58f1b8[_0x8437('0x39')]),_0x1437d0);if(_0xf5ea6d['query'][_0x8437('0x3b')]){_0x53ef82[_0x8437('0x3c')]=_[_0x8437('0x3d')](_0x53ef82[_0x8437('0x3c')],{'$or':_[_0x8437('0x3e')](_0x1437d0,function(_0x3c5204){if(_0x3c5204['type']!==_0x8437('0x3f')){var _0x1f451b={};_0x1f451b[_0x3c5204[_0x8437('0x28')]]={'$like':'%'+_0xf5ea6d['query'][_0x8437('0x3b')]+'%'};return _0x1f451b;}})});}_0x53ef82=_[_0x8437('0x3d')]({},_0x53ef82,_0xf5ea6d['options']);var _0x5854f3={'where':_0x53ef82[_0x8437('0x3c')]};return db['Dynamics365Configuration'][_0x8437('0x1d')](_0x5854f3)[_0x8437('0x24')](function(_0x5f3ab4){_0x2c1b71['count']=_0x5f3ab4;if(_0xf5ea6d[_0x8437('0x30')][_0x8437('0x40')]){_0x53ef82['include']=[{'all':!![]}];}return db[_0x8437('0x2b')][_0x8437('0x41')](_0x53ef82);})[_0x8437('0x24')](function(_0x16265f){_0x2c1b71[_0x8437('0x42')]=_0x16265f;return _0x2c1b71;})[_0x8437('0x24')](respondWithFilteredResult(_0x12f078,_0x53ef82))[_0x8437('0x43')](handleError(_0x12f078,null));};exports[_0x8437('0x44')]=function(_0x134d87,_0x3672bc){var _0x71cc01={'raw':![],'where':{'id':_0x134d87['params']['id']}},_0x4d48f3={};_0x4d48f3[_0x8437('0x2f')]=_[_0x8437('0x31')](db[_0x8437('0x2b')][_0x8437('0x2c')]);_0x4d48f3[_0x8437('0x30')]=_[_0x8437('0x31')](_0x134d87['query']);_0x4d48f3[_0x8437('0x39')]=_['intersection'](_0x4d48f3[_0x8437('0x2f')],_0x4d48f3['query']);_0x71cc01[_0x8437('0x33')]=_[_0x8437('0x32')](_0x4d48f3[_0x8437('0x2f')],qs[_0x8437('0x34')](_0x134d87[_0x8437('0x30')][_0x8437('0x34')]));_0x71cc01['attributes']=_0x71cc01[_0x8437('0x33')][_0x8437('0x35')]?_0x71cc01[_0x8437('0x33')]:_0x4d48f3['model'];if(_0x134d87[_0x8437('0x30')][_0x8437('0x40')]){_0x71cc01[_0x8437('0x45')]=[{'all':!![]}];}_0x71cc01=_[_0x8437('0x3d')]({},_0x71cc01,_0x134d87['options']);return db[_0x8437('0x2b')][_0x8437('0x46')](_0x71cc01)[_0x8437('0x24')](handleEntityNotFound(_0x3672bc,null))[_0x8437('0x24')](respondWithResult(_0x3672bc,null))[_0x8437('0x43')](handleError(_0x3672bc,null));};exports[_0x8437('0x47')]=function(_0x4dc026,_0x12a6f5){return db[_0x8437('0x2b')]['create'](_0x4dc026[_0x8437('0x48')],{})[_0x8437('0x24')](respondWithResult(_0x12a6f5,0xc9))[_0x8437('0x43')](handleError(_0x12a6f5,null));};exports[_0x8437('0x23')]=function(_0x5823e3,_0x46fa41){if(_0x5823e3['body']['id']){delete _0x5823e3[_0x8437('0x48')]['id'];}return db[_0x8437('0x2b')][_0x8437('0x46')]({'where':{'id':_0x5823e3[_0x8437('0x49')]['id']}})['then'](handleEntityNotFound(_0x46fa41,null))['then'](saveUpdates(_0x5823e3[_0x8437('0x48')],null))['then'](respondWithResult(_0x46fa41,null))[_0x8437('0x43')](handleError(_0x46fa41,null));};exports[_0x8437('0x25')]=function(_0x5646be,_0x1b9cbd){return db['Dynamics365Configuration'][_0x8437('0x46')]({'where':{'id':_0x5646be[_0x8437('0x49')]['id']}})[_0x8437('0x24')](handleEntityNotFound(_0x1b9cbd,null))[_0x8437('0x24')](removeEntity(_0x1b9cbd,null))[_0x8437('0x43')](handleError(_0x1b9cbd,null));};exports[_0x8437('0x4a')]=function(_0x27dea0,_0x5413eb,_0x40bba7){var _0x40f286={};var _0x43df68={};var _0x3b3113;var _0x358c2f;return db['Dynamics365Configuration'][_0x8437('0x4b')]({'where':{'id':_0x27dea0[_0x8437('0x49')]['id']}})[_0x8437('0x24')](handleEntityNotFound(_0x5413eb,null))[_0x8437('0x24')](function(_0x41cb75){if(_0x41cb75){_0x3b3113=_0x41cb75;_0x43df68['model']=_[_0x8437('0x31')](db[_0x8437('0x4c')][_0x8437('0x2c')]);_0x43df68[_0x8437('0x30')]=_[_0x8437('0x31')](_0x27dea0['query']);_0x43df68[_0x8437('0x39')]=_[_0x8437('0x32')](_0x43df68[_0x8437('0x2f')],_0x43df68[_0x8437('0x30')]);_0x40f286['attributes']=_[_0x8437('0x32')](_0x43df68['model'],qs[_0x8437('0x34')](_0x27dea0[_0x8437('0x30')][_0x8437('0x34')]));_0x40f286['attributes']=_0x40f286[_0x8437('0x33')][_0x8437('0x35')]?_0x40f286[_0x8437('0x33')]:_0x43df68[_0x8437('0x2f')];_0x40f286[_0x8437('0x37')]=qs['sort'](_0x27dea0[_0x8437('0x30')][_0x8437('0x38')]);_0x40f286[_0x8437('0x3c')]=qs[_0x8437('0x39')](_['pick'](_0x27dea0[_0x8437('0x30')],_0x43df68['filters']));if(_0x27dea0[_0x8437('0x30')][_0x8437('0x3b')]){_0x40f286['where']=_[_0x8437('0x3d')](_0x40f286[_0x8437('0x3c')],{'$or':_[_0x8437('0x3e')](_0x40f286[_0x8437('0x33')],function(_0x15d9c8){var _0x2ed5c7={};_0x2ed5c7[_0x15d9c8]={'$like':'%'+_0x27dea0[_0x8437('0x30')][_0x8437('0x3b')]+'%'};return _0x2ed5c7;})});}_0x40f286=_[_0x8437('0x3d')]({},_0x40f286,_0x27dea0[_0x8437('0x4d')]);return _0x3b3113[_0x8437('0x4a')](_0x40f286);}})[_0x8437('0x24')](function(_0xd5826f){if(_0xd5826f){_0x358c2f=_0xd5826f[_0x8437('0x35')];if(!_0x27dea0['query'][_0x8437('0x36')](_0x8437('0x4e'))){_0x40f286[_0x8437('0x1c')]=qs['limit'](_0x27dea0[_0x8437('0x30')]['limit']);_0x40f286[_0x8437('0x1e')]=qs['offset'](_0x27dea0[_0x8437('0x30')][_0x8437('0x1e')]);}return _0x3b3113['getFields'](_0x40f286);}})[_0x8437('0x24')](function(_0x233b22){if(_0x233b22){return _0x233b22?{'count':_0x358c2f,'rows':_0x233b22}:null;}})[_0x8437('0x24')](respondWithResult(_0x5413eb,null))[_0x8437('0x43')](handleError(_0x5413eb,null));};exports['getSubjects']=function(_0x2d996b,_0x2a5dba,_0x401179){var _0x4147f1={};var _0x51c81e={};var _0x59a37d;var _0x41cfc2;return db[_0x8437('0x2b')][_0x8437('0x4b')]({'where':{'id':_0x2d996b[_0x8437('0x49')]['id']}})[_0x8437('0x24')](handleEntityNotFound(_0x2a5dba,null))[_0x8437('0x24')](function(_0x3909a0){if(_0x3909a0){_0x59a37d=_0x3909a0;_0x51c81e[_0x8437('0x2f')]=_[_0x8437('0x31')](db[_0x8437('0x4c')][_0x8437('0x2c')]);_0x51c81e[_0x8437('0x30')]=_[_0x8437('0x31')](_0x2d996b[_0x8437('0x30')]);_0x51c81e['filters']=_[_0x8437('0x32')](_0x51c81e[_0x8437('0x2f')],_0x51c81e[_0x8437('0x30')]);_0x4147f1['attributes']=_[_0x8437('0x32')](_0x51c81e['model'],qs['fields'](_0x2d996b[_0x8437('0x30')][_0x8437('0x34')]));_0x4147f1['attributes']=_0x4147f1['attributes'][_0x8437('0x35')]?_0x4147f1[_0x8437('0x33')]:_0x51c81e['model'];_0x4147f1[_0x8437('0x37')]=qs[_0x8437('0x38')](_0x2d996b[_0x8437('0x30')][_0x8437('0x38')]);_0x4147f1['where']=qs['filters'](_[_0x8437('0x3a')](_0x2d996b['query'],_0x51c81e[_0x8437('0x39')]));if(_0x2d996b[_0x8437('0x30')][_0x8437('0x3b')]){_0x4147f1[_0x8437('0x3c')]=_[_0x8437('0x3d')](_0x4147f1['where'],{'$or':_[_0x8437('0x3e')](_0x4147f1[_0x8437('0x33')],function(_0x470529){var _0x4e50f9={};_0x4e50f9[_0x470529]={'$like':'%'+_0x2d996b['query'][_0x8437('0x3b')]+'%'};return _0x4e50f9;})});}_0x4147f1=_[_0x8437('0x3d')]({},_0x4147f1,_0x2d996b['options']);return _0x59a37d[_0x8437('0x4f')](_0x4147f1);}})['then'](function(_0x1ddd7d){if(_0x1ddd7d){_0x41cfc2=_0x1ddd7d[_0x8437('0x35')];if(!_0x2d996b[_0x8437('0x30')][_0x8437('0x36')]('nolimit')){_0x4147f1[_0x8437('0x1c')]=qs[_0x8437('0x1c')](_0x2d996b['query'][_0x8437('0x1c')]);_0x4147f1[_0x8437('0x1e')]=qs[_0x8437('0x1e')](_0x2d996b[_0x8437('0x30')][_0x8437('0x1e')]);}return _0x59a37d[_0x8437('0x4f')](_0x4147f1);}})[_0x8437('0x24')](function(_0x49edee){if(_0x49edee){return _0x49edee?{'count':_0x41cfc2,'rows':_0x49edee}:null;}})[_0x8437('0x24')](respondWithResult(_0x2a5dba,null))[_0x8437('0x43')](handleError(_0x2a5dba,null));};exports[_0x8437('0x50')]=function(_0x1aa92e,_0xcf372d,_0x5056cd){var _0x2258a5={};var _0x3b79eb={};var _0x35af3d;var _0x43e2f0;return db[_0x8437('0x2b')][_0x8437('0x4b')]({'where':{'id':_0x1aa92e[_0x8437('0x49')]['id']}})[_0x8437('0x24')](handleEntityNotFound(_0xcf372d,null))[_0x8437('0x24')](function(_0x358100){if(_0x358100){_0x35af3d=_0x358100;_0x3b79eb['model']=_['keys'](db[_0x8437('0x4c')][_0x8437('0x2c')]);_0x3b79eb[_0x8437('0x30')]=_[_0x8437('0x31')](_0x1aa92e['query']);_0x3b79eb[_0x8437('0x39')]=_['intersection'](_0x3b79eb[_0x8437('0x2f')],_0x3b79eb[_0x8437('0x30')]);_0x2258a5[_0x8437('0x33')]=_[_0x8437('0x32')](_0x3b79eb['model'],qs[_0x8437('0x34')](_0x1aa92e['query'][_0x8437('0x34')]));_0x2258a5['attributes']=_0x2258a5[_0x8437('0x33')][_0x8437('0x35')]?_0x2258a5['attributes']:_0x3b79eb[_0x8437('0x2f')];_0x2258a5[_0x8437('0x37')]=qs[_0x8437('0x38')](_0x1aa92e[_0x8437('0x30')][_0x8437('0x38')]);_0x2258a5[_0x8437('0x3c')]=qs['filters'](_[_0x8437('0x3a')](_0x1aa92e['query'],_0x3b79eb['filters']));if(_0x1aa92e['query'][_0x8437('0x3b')]){_0x2258a5[_0x8437('0x3c')]=_['merge'](_0x2258a5[_0x8437('0x3c')],{'$or':_[_0x8437('0x3e')](_0x2258a5[_0x8437('0x33')],function(_0x45be9f){var _0x3f9e92={};_0x3f9e92[_0x45be9f]={'$like':'%'+_0x1aa92e[_0x8437('0x30')][_0x8437('0x3b')]+'%'};return _0x3f9e92;})});}_0x2258a5=_[_0x8437('0x3d')]({},_0x2258a5,_0x1aa92e['options']);return _0x35af3d[_0x8437('0x50')](_0x2258a5);}})[_0x8437('0x24')](function(_0x3279e9){if(_0x3279e9){_0x43e2f0=_0x3279e9[_0x8437('0x35')];if(!_0x1aa92e['query']['hasOwnProperty']('nolimit')){_0x2258a5[_0x8437('0x1c')]=qs[_0x8437('0x1c')](_0x1aa92e[_0x8437('0x30')][_0x8437('0x1c')]);_0x2258a5[_0x8437('0x1e')]=qs['offset'](_0x1aa92e[_0x8437('0x30')][_0x8437('0x1e')]);}return _0x35af3d[_0x8437('0x50')](_0x2258a5);}})[_0x8437('0x24')](function(_0x3806e3){if(_0x3806e3){return _0x3806e3?{'count':_0x43e2f0,'rows':_0x3806e3}:null;}})[_0x8437('0x24')](respondWithResult(_0xcf372d,null))[_0x8437('0x43')](handleError(_0xcf372d,null));}; \ No newline at end of file +var _0x2cbd=['catch','show','includeAll','find','create','body','update','params','getFields','findOne','Dynamics365Field','order','sort','pick','nolimit','getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','offset','count','limit','set','json','reject','save','then','destroy','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','filter','merge','VIRTUAL','options','where','Dynamics365Configuration','include','findAll','rows'];(function(_0x3f2ecf,_0x4ccad6){var _0xa6dd7e=function(_0x5e04c3){while(--_0x5e04c3){_0x3f2ecf['push'](_0x3f2ecf['shift']());}};_0xa6dd7e(++_0x4ccad6);}(_0x2cbd,0x159));var _0xd2cb=function(_0x2ddfd9,_0x5877d0){_0x2ddfd9=_0x2ddfd9-0x0;var _0x2668f0=_0x2cbd[_0x2ddfd9];return _0x2668f0;};'use strict';var emlformat=require(_0xd2cb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd2cb('0x1'));var jsonpatch=require(_0xd2cb('0x2'));var rp=require(_0xd2cb('0x3'));var moment=require(_0xd2cb('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd2cb('0x5'));var util=require(_0xd2cb('0x6'));var path=require(_0xd2cb('0x7'));var sox=require(_0xd2cb('0x8'));var csv=require(_0xd2cb('0x9'));var ejs=require(_0xd2cb('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xd2cb('0xb'));var crypto=require(_0xd2cb('0xc'));var jsforce=require(_0xd2cb('0xd'));var deskjs=require(_0xd2cb('0xe'));var toCsv=require(_0xd2cb('0x9'));var querystring=require(_0xd2cb('0xf'));var Papa=require(_0xd2cb('0x10'));var Redis=require(_0xd2cb('0x11'));var authService=require(_0xd2cb('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xd2cb('0x13'));var hardwareService=require(_0xd2cb('0x14'));var logger=require('../../config/logger')(_0xd2cb('0x15'));var utils=require('../../config/utils');var config=require(_0xd2cb('0x16'));var licenseUtil=require(_0xd2cb('0x17'));var db=require(_0xd2cb('0x18'))['db'];function respondWithStatusCode(_0x920b7f,_0x24b27e){_0x24b27e=_0x24b27e||0xcc;return function(_0x3b3d87){if(_0x3b3d87){return _0x920b7f[_0xd2cb('0x19')](_0x24b27e);}return _0x920b7f[_0xd2cb('0x1a')](_0x24b27e)[_0xd2cb('0x1b')]();};}function respondWithResult(_0x1b7a5b,_0x3b8e36){_0x3b8e36=_0x3b8e36||0xc8;return function(_0x44b81e){if(_0x44b81e){return _0x1b7a5b[_0xd2cb('0x1a')](_0x3b8e36)['json'](_0x44b81e);}};}function respondWithFilteredResult(_0x3e1075,_0x25b6c5){return function(_0x380764){if(_0x380764){var _0x339d4f=typeof _0x25b6c5['offset']===_0xd2cb('0x1c')&&typeof _0x25b6c5['limit']===_0xd2cb('0x1c');var _0x48b4e3=_0x380764['count'];var _0x4fb97b=_0x339d4f?0x0:_0x25b6c5[_0xd2cb('0x1d')];var _0x2d20e9=_0x339d4f?_0x380764[_0xd2cb('0x1e')]:_0x25b6c5[_0xd2cb('0x1d')]+_0x25b6c5[_0xd2cb('0x1f')];var _0x27ba59;if(_0x2d20e9>=_0x48b4e3){_0x2d20e9=_0x48b4e3;_0x27ba59=0xc8;}else{_0x27ba59=0xce;}_0x3e1075[_0xd2cb('0x1a')](_0x27ba59);return _0x3e1075[_0xd2cb('0x20')]('Content-Range',_0x4fb97b+'-'+_0x2d20e9+'/'+_0x48b4e3)[_0xd2cb('0x21')](_0x380764);}return null;};}function patchUpdates(_0x19003a){return function(_0x4d83f1){try{jsonpatch['apply'](_0x4d83f1,_0x19003a,!![]);}catch(_0x5b91b5){return BPromise[_0xd2cb('0x22')](_0x5b91b5);}return _0x4d83f1[_0xd2cb('0x23')]();};}function saveUpdates(_0x4c1cc2,_0x288f05){return function(_0x4217e1){if(_0x4217e1){return _0x4217e1['update'](_0x4c1cc2)[_0xd2cb('0x24')](function(_0x171a0f){return _0x171a0f;});}return null;};}function removeEntity(_0x3fb5d3,_0x4ad50e){return function(_0x5dfb18){if(_0x5dfb18){return _0x5dfb18[_0xd2cb('0x25')]()[_0xd2cb('0x24')](function(){_0x3fb5d3[_0xd2cb('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x25e493,_0x4fd9e3){return function(_0x43352b){if(!_0x43352b){_0x25e493[_0xd2cb('0x19')](0x194);}return _0x43352b;};}function handleError(_0x2aa708,_0x1141d2){_0x1141d2=_0x1141d2||0x1f4;return function(_0x200c6a){logger[_0xd2cb('0x26')](_0x200c6a['stack']);if(_0x200c6a[_0xd2cb('0x27')]){delete _0x200c6a[_0xd2cb('0x27')];}_0x2aa708[_0xd2cb('0x1a')](_0x1141d2)[_0xd2cb('0x28')](_0x200c6a);};}exports[_0xd2cb('0x29')]=function(_0x40da19,_0x1a3bc2){var _0x1f6011={},_0x30882e={},_0x253494={'count':0x0,'rows':[]};var _0x14990e=_[_0xd2cb('0x2a')](db['Dynamics365Configuration'][_0xd2cb('0x2b')],function(_0x571dd7){return{'name':_0x571dd7[_0xd2cb('0x2c')],'type':_0x571dd7[_0xd2cb('0x2d')][_0xd2cb('0x2e')]};});_0x30882e[_0xd2cb('0x2f')]=_[_0xd2cb('0x2a')](_0x14990e,_0xd2cb('0x27'));_0x30882e[_0xd2cb('0x30')]=_[_0xd2cb('0x31')](_0x40da19[_0xd2cb('0x30')]);_0x30882e[_0xd2cb('0x32')]=_[_0xd2cb('0x33')](_0x30882e[_0xd2cb('0x2f')],_0x30882e['query']);_0x1f6011[_0xd2cb('0x34')]=_[_0xd2cb('0x33')](_0x30882e[_0xd2cb('0x2f')],qs[_0xd2cb('0x35')](_0x40da19[_0xd2cb('0x30')][_0xd2cb('0x35')]));_0x1f6011[_0xd2cb('0x34')]=_0x1f6011['attributes'][_0xd2cb('0x36')]?_0x1f6011[_0xd2cb('0x34')]:_0x30882e[_0xd2cb('0x2f')];if(!_0x40da19[_0xd2cb('0x30')][_0xd2cb('0x37')]('nolimit')){_0x1f6011['limit']=qs[_0xd2cb('0x1f')](_0x40da19[_0xd2cb('0x30')][_0xd2cb('0x1f')]);_0x1f6011[_0xd2cb('0x1d')]=qs[_0xd2cb('0x1d')](_0x40da19[_0xd2cb('0x30')][_0xd2cb('0x1d')]);}_0x1f6011['order']=qs['sort'](_0x40da19[_0xd2cb('0x30')]['sort']);_0x1f6011['where']=qs[_0xd2cb('0x32')](_['pick'](_0x40da19[_0xd2cb('0x30')],_0x30882e['filters']),_0x14990e);if(_0x40da19['query'][_0xd2cb('0x38')]){_0x1f6011['where']=_[_0xd2cb('0x39')](_0x1f6011['where'],{'$or':_[_0xd2cb('0x2a')](_0x14990e,function(_0x1c07e0){if(_0x1c07e0[_0xd2cb('0x2d')]!==_0xd2cb('0x3a')){var _0x4ff05c={};_0x4ff05c[_0x1c07e0['name']]={'$like':'%'+_0x40da19[_0xd2cb('0x30')]['filter']+'%'};return _0x4ff05c;}})});}_0x1f6011=_[_0xd2cb('0x39')]({},_0x1f6011,_0x40da19[_0xd2cb('0x3b')]);var _0x1bdd97={'where':_0x1f6011[_0xd2cb('0x3c')]};return db[_0xd2cb('0x3d')][_0xd2cb('0x1e')](_0x1bdd97)[_0xd2cb('0x24')](function(_0x3270ac){_0x253494[_0xd2cb('0x1e')]=_0x3270ac;if(_0x40da19['query']['includeAll']){_0x1f6011[_0xd2cb('0x3e')]=[{'all':!![]}];}return db[_0xd2cb('0x3d')][_0xd2cb('0x3f')](_0x1f6011);})[_0xd2cb('0x24')](function(_0x1563ed){_0x253494[_0xd2cb('0x40')]=_0x1563ed;return _0x253494;})[_0xd2cb('0x24')](respondWithFilteredResult(_0x1a3bc2,_0x1f6011))[_0xd2cb('0x41')](handleError(_0x1a3bc2,null));};exports[_0xd2cb('0x42')]=function(_0x18d9a8,_0x1e61b5){var _0x3b47dc={'raw':![],'where':{'id':_0x18d9a8['params']['id']}},_0x3d2f29={};_0x3d2f29[_0xd2cb('0x2f')]=_[_0xd2cb('0x31')](db[_0xd2cb('0x3d')]['rawAttributes']);_0x3d2f29[_0xd2cb('0x30')]=_[_0xd2cb('0x31')](_0x18d9a8[_0xd2cb('0x30')]);_0x3d2f29['filters']=_[_0xd2cb('0x33')](_0x3d2f29['model'],_0x3d2f29['query']);_0x3b47dc[_0xd2cb('0x34')]=_['intersection'](_0x3d2f29[_0xd2cb('0x2f')],qs[_0xd2cb('0x35')](_0x18d9a8[_0xd2cb('0x30')][_0xd2cb('0x35')]));_0x3b47dc[_0xd2cb('0x34')]=_0x3b47dc['attributes'][_0xd2cb('0x36')]?_0x3b47dc[_0xd2cb('0x34')]:_0x3d2f29['model'];if(_0x18d9a8[_0xd2cb('0x30')][_0xd2cb('0x43')]){_0x3b47dc[_0xd2cb('0x3e')]=[{'all':!![]}];}_0x3b47dc=_['merge']({},_0x3b47dc,_0x18d9a8['options']);return db[_0xd2cb('0x3d')][_0xd2cb('0x44')](_0x3b47dc)['then'](handleEntityNotFound(_0x1e61b5,null))['then'](respondWithResult(_0x1e61b5,null))[_0xd2cb('0x41')](handleError(_0x1e61b5,null));};exports[_0xd2cb('0x45')]=function(_0x5ae812,_0x10d5a7){return db[_0xd2cb('0x3d')][_0xd2cb('0x45')](_0x5ae812[_0xd2cb('0x46')],{})[_0xd2cb('0x24')](respondWithResult(_0x10d5a7,0xc9))[_0xd2cb('0x41')](handleError(_0x10d5a7,null));};exports[_0xd2cb('0x47')]=function(_0x520c39,_0x3c9fc6){if(_0x520c39[_0xd2cb('0x46')]['id']){delete _0x520c39['body']['id'];}return db[_0xd2cb('0x3d')][_0xd2cb('0x44')]({'where':{'id':_0x520c39[_0xd2cb('0x48')]['id']}})['then'](handleEntityNotFound(_0x3c9fc6,null))['then'](saveUpdates(_0x520c39[_0xd2cb('0x46')],null))['then'](respondWithResult(_0x3c9fc6,null))[_0xd2cb('0x41')](handleError(_0x3c9fc6,null));};exports[_0xd2cb('0x25')]=function(_0x4a0a22,_0x3e08f4){return db[_0xd2cb('0x3d')][_0xd2cb('0x44')]({'where':{'id':_0x4a0a22['params']['id']}})[_0xd2cb('0x24')](handleEntityNotFound(_0x3e08f4,null))[_0xd2cb('0x24')](removeEntity(_0x3e08f4,null))['catch'](handleError(_0x3e08f4,null));};exports[_0xd2cb('0x49')]=function(_0x5b2a34,_0x148391,_0x2843cd){var _0x3e110f={};var _0x53af37={};var _0x5ec370;var _0x292ee8;return db[_0xd2cb('0x3d')][_0xd2cb('0x4a')]({'where':{'id':_0x5b2a34[_0xd2cb('0x48')]['id']}})[_0xd2cb('0x24')](handleEntityNotFound(_0x148391,null))[_0xd2cb('0x24')](function(_0x52644b){if(_0x52644b){_0x5ec370=_0x52644b;_0x53af37[_0xd2cb('0x2f')]=_[_0xd2cb('0x31')](db[_0xd2cb('0x4b')][_0xd2cb('0x2b')]);_0x53af37[_0xd2cb('0x30')]=_[_0xd2cb('0x31')](_0x5b2a34[_0xd2cb('0x30')]);_0x53af37[_0xd2cb('0x32')]=_[_0xd2cb('0x33')](_0x53af37['model'],_0x53af37['query']);_0x3e110f['attributes']=_[_0xd2cb('0x33')](_0x53af37['model'],qs[_0xd2cb('0x35')](_0x5b2a34[_0xd2cb('0x30')]['fields']));_0x3e110f[_0xd2cb('0x34')]=_0x3e110f['attributes'][_0xd2cb('0x36')]?_0x3e110f[_0xd2cb('0x34')]:_0x53af37[_0xd2cb('0x2f')];_0x3e110f[_0xd2cb('0x4c')]=qs[_0xd2cb('0x4d')](_0x5b2a34[_0xd2cb('0x30')][_0xd2cb('0x4d')]);_0x3e110f[_0xd2cb('0x3c')]=qs[_0xd2cb('0x32')](_[_0xd2cb('0x4e')](_0x5b2a34['query'],_0x53af37[_0xd2cb('0x32')]));if(_0x5b2a34['query'][_0xd2cb('0x38')]){_0x3e110f[_0xd2cb('0x3c')]=_['merge'](_0x3e110f[_0xd2cb('0x3c')],{'$or':_['map'](_0x3e110f[_0xd2cb('0x34')],function(_0x3628b6){var _0x3c4407={};_0x3c4407[_0x3628b6]={'$like':'%'+_0x5b2a34[_0xd2cb('0x30')][_0xd2cb('0x38')]+'%'};return _0x3c4407;})});}_0x3e110f=_['merge']({},_0x3e110f,_0x5b2a34[_0xd2cb('0x3b')]);return _0x5ec370['getFields'](_0x3e110f);}})[_0xd2cb('0x24')](function(_0xa48139){if(_0xa48139){_0x292ee8=_0xa48139[_0xd2cb('0x36')];if(!_0x5b2a34[_0xd2cb('0x30')][_0xd2cb('0x37')](_0xd2cb('0x4f'))){_0x3e110f[_0xd2cb('0x1f')]=qs[_0xd2cb('0x1f')](_0x5b2a34[_0xd2cb('0x30')][_0xd2cb('0x1f')]);_0x3e110f['offset']=qs[_0xd2cb('0x1d')](_0x5b2a34[_0xd2cb('0x30')][_0xd2cb('0x1d')]);}return _0x5ec370[_0xd2cb('0x49')](_0x3e110f);}})[_0xd2cb('0x24')](function(_0x26c3eb){if(_0x26c3eb){return _0x26c3eb?{'count':_0x292ee8,'rows':_0x26c3eb}:null;}})[_0xd2cb('0x24')](respondWithResult(_0x148391,null))[_0xd2cb('0x41')](handleError(_0x148391,null));};exports[_0xd2cb('0x50')]=function(_0x20bea7,_0x259f67,_0x1b0d70){var _0x475ab6={};var _0x3bbeaf={};var _0x4ab478;var _0xf730fb;return db[_0xd2cb('0x3d')][_0xd2cb('0x4a')]({'where':{'id':_0x20bea7[_0xd2cb('0x48')]['id']}})[_0xd2cb('0x24')](handleEntityNotFound(_0x259f67,null))[_0xd2cb('0x24')](function(_0x259847){if(_0x259847){_0x4ab478=_0x259847;_0x3bbeaf[_0xd2cb('0x2f')]=_['keys'](db[_0xd2cb('0x4b')][_0xd2cb('0x2b')]);_0x3bbeaf[_0xd2cb('0x30')]=_[_0xd2cb('0x31')](_0x20bea7['query']);_0x3bbeaf[_0xd2cb('0x32')]=_['intersection'](_0x3bbeaf['model'],_0x3bbeaf['query']);_0x475ab6[_0xd2cb('0x34')]=_[_0xd2cb('0x33')](_0x3bbeaf[_0xd2cb('0x2f')],qs[_0xd2cb('0x35')](_0x20bea7[_0xd2cb('0x30')][_0xd2cb('0x35')]));_0x475ab6[_0xd2cb('0x34')]=_0x475ab6['attributes'][_0xd2cb('0x36')]?_0x475ab6[_0xd2cb('0x34')]:_0x3bbeaf[_0xd2cb('0x2f')];_0x475ab6[_0xd2cb('0x4c')]=qs[_0xd2cb('0x4d')](_0x20bea7[_0xd2cb('0x30')][_0xd2cb('0x4d')]);_0x475ab6['where']=qs[_0xd2cb('0x32')](_[_0xd2cb('0x4e')](_0x20bea7['query'],_0x3bbeaf[_0xd2cb('0x32')]));if(_0x20bea7['query'][_0xd2cb('0x38')]){_0x475ab6['where']=_[_0xd2cb('0x39')](_0x475ab6['where'],{'$or':_[_0xd2cb('0x2a')](_0x475ab6[_0xd2cb('0x34')],function(_0x2d3f21){var _0x120a72={};_0x120a72[_0x2d3f21]={'$like':'%'+_0x20bea7['query']['filter']+'%'};return _0x120a72;})});}_0x475ab6=_['merge']({},_0x475ab6,_0x20bea7['options']);return _0x4ab478[_0xd2cb('0x50')](_0x475ab6);}})['then'](function(_0x1a6e52){if(_0x1a6e52){_0xf730fb=_0x1a6e52[_0xd2cb('0x36')];if(!_0x20bea7[_0xd2cb('0x30')][_0xd2cb('0x37')]('nolimit')){_0x475ab6['limit']=qs['limit'](_0x20bea7[_0xd2cb('0x30')][_0xd2cb('0x1f')]);_0x475ab6[_0xd2cb('0x1d')]=qs[_0xd2cb('0x1d')](_0x20bea7[_0xd2cb('0x30')][_0xd2cb('0x1d')]);}return _0x4ab478['getSubjects'](_0x475ab6);}})[_0xd2cb('0x24')](function(_0x254a6c){if(_0x254a6c){return _0x254a6c?{'count':_0xf730fb,'rows':_0x254a6c}:null;}})[_0xd2cb('0x24')](respondWithResult(_0x259f67,null))['catch'](handleError(_0x259f67,null));};exports['getDescriptions']=function(_0x5ee247,_0x121fd5,_0x43afb9){var _0x80b54a={};var _0x390191={};var _0x256a9f;var _0x3a0617;return db[_0xd2cb('0x3d')][_0xd2cb('0x4a')]({'where':{'id':_0x5ee247[_0xd2cb('0x48')]['id']}})[_0xd2cb('0x24')](handleEntityNotFound(_0x121fd5,null))[_0xd2cb('0x24')](function(_0x887015){if(_0x887015){_0x256a9f=_0x887015;_0x390191[_0xd2cb('0x2f')]=_[_0xd2cb('0x31')](db['Dynamics365Field']['rawAttributes']);_0x390191['query']=_[_0xd2cb('0x31')](_0x5ee247[_0xd2cb('0x30')]);_0x390191[_0xd2cb('0x32')]=_['intersection'](_0x390191['model'],_0x390191['query']);_0x80b54a[_0xd2cb('0x34')]=_[_0xd2cb('0x33')](_0x390191['model'],qs[_0xd2cb('0x35')](_0x5ee247[_0xd2cb('0x30')][_0xd2cb('0x35')]));_0x80b54a[_0xd2cb('0x34')]=_0x80b54a[_0xd2cb('0x34')]['length']?_0x80b54a[_0xd2cb('0x34')]:_0x390191[_0xd2cb('0x2f')];_0x80b54a[_0xd2cb('0x4c')]=qs[_0xd2cb('0x4d')](_0x5ee247[_0xd2cb('0x30')][_0xd2cb('0x4d')]);_0x80b54a[_0xd2cb('0x3c')]=qs['filters'](_[_0xd2cb('0x4e')](_0x5ee247[_0xd2cb('0x30')],_0x390191[_0xd2cb('0x32')]));if(_0x5ee247[_0xd2cb('0x30')][_0xd2cb('0x38')]){_0x80b54a[_0xd2cb('0x3c')]=_['merge'](_0x80b54a[_0xd2cb('0x3c')],{'$or':_[_0xd2cb('0x2a')](_0x80b54a[_0xd2cb('0x34')],function(_0x564bc7){var _0x66d1af={};_0x66d1af[_0x564bc7]={'$like':'%'+_0x5ee247[_0xd2cb('0x30')][_0xd2cb('0x38')]+'%'};return _0x66d1af;})});}_0x80b54a=_[_0xd2cb('0x39')]({},_0x80b54a,_0x5ee247[_0xd2cb('0x3b')]);return _0x256a9f[_0xd2cb('0x51')](_0x80b54a);}})[_0xd2cb('0x24')](function(_0x28dd51){if(_0x28dd51){_0x3a0617=_0x28dd51[_0xd2cb('0x36')];if(!_0x5ee247['query']['hasOwnProperty'](_0xd2cb('0x4f'))){_0x80b54a[_0xd2cb('0x1f')]=qs[_0xd2cb('0x1f')](_0x5ee247['query'][_0xd2cb('0x1f')]);_0x80b54a[_0xd2cb('0x1d')]=qs[_0xd2cb('0x1d')](_0x5ee247[_0xd2cb('0x30')]['offset']);}return _0x256a9f['getDescriptions'](_0x80b54a);}})[_0xd2cb('0x24')](function(_0xa2285c){if(_0xa2285c){return _0xa2285c?{'count':_0x3a0617,'rows':_0xa2285c}:null;}})[_0xd2cb('0x24')](respondWithResult(_0x121fd5,null))[_0xd2cb('0x41')](handleError(_0x121fd5,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index ac1c424..2ca0ed8 100644 --- a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js +++ b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3e74=['exports','Dynamics365Configuration','int_dynamics365_configurations','lodash','../../config/logger','api','moment','path','../../config/environment','./intDynamics365Configuration.attributes'];(function(_0x4b4c3b,_0x121398){var _0x125d77=function(_0x3cdff5){while(--_0x3cdff5){_0x4b4c3b['push'](_0x4b4c3b['shift']());}};_0x125d77(++_0x121398);}(_0x3e74,0x175));var _0x43e7=function(_0x10b9f6,_0x503a09){_0x10b9f6=_0x10b9f6-0x0;var _0x386092=_0x3e74[_0x10b9f6];return _0x386092;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var logger=require(_0x43e7('0x1'))(_0x43e7('0x2'));var moment=require(_0x43e7('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x43e7('0x4'));var rimraf=require('rimraf');var config=require(_0x43e7('0x5'));var attributes=require(_0x43e7('0x6'));module[_0x43e7('0x7')]=function(_0x1c503b,_0xc98b9c){return _0x1c503b['define'](_0x43e7('0x8'),attributes,{'tableName':_0x43e7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9c44=['request-promise','path','./intDynamics365Configuration.attributes','define','Dynamics365Configuration','int_dynamics365_configurations','../../config/logger','api','moment','bluebird'];(function(_0x1b60e3,_0x2d7494){var _0x14017e=function(_0x4f6127){while(--_0x4f6127){_0x1b60e3['push'](_0x1b60e3['shift']());}};_0x14017e(++_0x2d7494);}(_0x9c44,0x178));var _0x49c4=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x9c44[_0x1035c1];return _0x308d67;};'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 diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js index df84e29..fe7f68f 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 _0xa717=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Dynamics365Configuration,\x20%s,\x20%s','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa717,0x13e));var _0x7a71=function(_0x4d520d,_0x540526){_0x4d520d=_0x4d520d-0x0;var _0x5c375b=_0xa717[_0x4d520d];return _0x5c375b;};'use strict';var _=require(_0x7a71('0x0'));var util=require(_0x7a71('0x1'));var moment=require(_0x7a71('0x2'));var BPromise=require(_0x7a71('0x3'));var rs=require(_0x7a71('0x4'));var fs=require('fs');var Redis=require(_0x7a71('0x5'));var db=require(_0x7a71('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x7a71('0x7'))(_0x7a71('0x8'));var config=require(_0x7a71('0x9'));var jayson=require(_0x7a71('0xa'));var client=jayson[_0x7a71('0xb')][_0x7a71('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x9adab,_0x2a4316,_0x20d7f1){return new BPromise(function(_0x5a3436,_0xf2b4ad){return client[_0x7a71('0xd')](_0x9adab,_0x20d7f1)[_0x7a71('0xe')](function(_0x1b7eef){logger[_0x7a71('0xf')](_0x7a71('0x10'),_0x2a4316,'request\x20sent');logger['debug'](_0x7a71('0x11'),_0x2a4316,'request\x20sent',JSON[_0x7a71('0x12')](_0x1b7eef));if(_0x1b7eef[_0x7a71('0x13')]){if(_0x1b7eef[_0x7a71('0x13')][_0x7a71('0x14')]===0x1f4){logger['error'](_0x7a71('0x10'),_0x2a4316,_0x1b7eef['error']['message']);return _0xf2b4ad(_0x1b7eef[_0x7a71('0x13')][_0x7a71('0x15')]);}logger[_0x7a71('0x13')](_0x7a71('0x10'),_0x2a4316,_0x1b7eef[_0x7a71('0x13')][_0x7a71('0x15')]);return _0x5a3436(_0x1b7eef[_0x7a71('0x13')][_0x7a71('0x15')]);}else{logger[_0x7a71('0xf')](_0x7a71('0x10'),_0x2a4316,'request\x20sent');_0x5a3436(_0x1b7eef['result']['message']);}})[_0x7a71('0x16')](function(_0x297b72){logger['error'](_0x7a71('0x10'),_0x2a4316,_0x297b72);_0xf2b4ad(_0x297b72);});});} \ No newline at end of file +var _0x92c3=['code','message','info','result','catch','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0xfa716b,_0x1fa236){var _0xe946ab=function(_0x495c2e){while(--_0x495c2e){_0xfa716b['push'](_0xfa716b['shift']());}};_0xe946ab(++_0x1fa236);}(_0x92c3,0x139));var _0x392c=function(_0x24ede4,_0x52134f){_0x24ede4=_0x24ede4-0x0;var _0x30cf51=_0x92c3[_0x24ede4];return _0x30cf51;};'use strict';var _=require(_0x392c('0x0'));var util=require(_0x392c('0x1'));var moment=require('moment');var BPromise=require(_0x392c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x392c('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x392c('0x4'));var logger=require(_0x392c('0x5'))(_0x392c('0x6'));var config=require(_0x392c('0x7'));var jayson=require(_0x392c('0x8'));var client=jayson[_0x392c('0x9')][_0x392c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2615c7,_0x2229b1,_0x224cd9){return new BPromise(function(_0x23b022,_0x24ce5d){return client['request'](_0x2615c7,_0x224cd9)['then'](function(_0x1bdd85){logger['info'](_0x392c('0xb'),_0x2229b1,_0x392c('0xc'));logger[_0x392c('0xd')](_0x392c('0xe'),_0x2229b1,_0x392c('0xc'),JSON[_0x392c('0xf')](_0x1bdd85));if(_0x1bdd85[_0x392c('0x10')]){if(_0x1bdd85[_0x392c('0x10')][_0x392c('0x11')]===0x1f4){logger[_0x392c('0x10')]('Dynamics365Configuration,\x20%s,\x20%s',_0x2229b1,_0x1bdd85[_0x392c('0x10')]['message']);return _0x24ce5d(_0x1bdd85['error'][_0x392c('0x12')]);}logger[_0x392c('0x10')]('Dynamics365Configuration,\x20%s,\x20%s',_0x2229b1,_0x1bdd85[_0x392c('0x10')][_0x392c('0x12')]);return _0x23b022(_0x1bdd85['error'][_0x392c('0x12')]);}else{logger[_0x392c('0x13')](_0x392c('0xb'),_0x2229b1,'request\x20sent');_0x23b022(_0x1bdd85[_0x392c('0x14')][_0x392c('0x12')]);}})[_0x392c('0x15')](function(_0x511601){logger[_0x392c('0x10')](_0x392c('0xb'),_0x2229b1,_0x511601);_0x24ce5d(_0x511601);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index 515db3f..d2d4863 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 _0xcdc9=['update','delete','destroy','exports','multer','path','express','../../components/auth/service','isAuthenticated','index','get','/:id','show','post','create','put'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0xcdc9,0x1a4));var _0x9cdc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcdc9[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x9cdc('0x0'));var util=require('util');var path=require(_0x9cdc('0x1'));var timeout=require('connect-timeout');var express=require(_0x9cdc('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x9cdc('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intDynamics365Field.controller');router['get']('/',auth[_0x9cdc('0x4')](),controller[_0x9cdc('0x5')]);router[_0x9cdc('0x6')](_0x9cdc('0x7'),auth[_0x9cdc('0x4')](),controller[_0x9cdc('0x8')]);router[_0x9cdc('0x9')]('/',auth[_0x9cdc('0x4')](),controller[_0x9cdc('0xa')]);router[_0x9cdc('0xb')]('/:id',auth[_0x9cdc('0x4')](),controller[_0x9cdc('0xc')]);router[_0x9cdc('0xd')](_0x9cdc('0x7'),auth[_0x9cdc('0x4')](),controller[_0x9cdc('0xe')]);module[_0x9cdc('0xf')]=router; \ No newline at end of file +var _0xb853=['destroy','exports','multer','connect-timeout','Router','../../config/environment','get','index','/:id','isAuthenticated','show','update','delete'];(function(_0x2abe13,_0x1cdae5){var _0x3db615=function(_0x5d79c0){while(--_0x5d79c0){_0x2abe13['push'](_0x2abe13['shift']());}};_0x3db615(++_0x1cdae5);}(_0xb853,0x1a2));var _0x3b85=function(_0x302a85,_0x4ebe10){_0x302a85=_0x302a85-0x0;var _0x117b23=_0xb853[_0x302a85];return _0x117b23;};'use strict';var multer=require(_0x3b85('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x3b85('0x1'));var express=require('express');var router=express[_0x3b85('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x3b85('0x3'));var controller=require('./intDynamics365Field.controller');router[_0x3b85('0x4')]('/',auth['isAuthenticated'](),controller[_0x3b85('0x5')]);router[_0x3b85('0x4')](_0x3b85('0x6'),auth[_0x3b85('0x7')](),controller[_0x3b85('0x8')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x3b85('0x6'),auth['isAuthenticated'](),controller[_0x3b85('0x9')]);router[_0x3b85('0xa')](_0x3b85('0x6'),auth['isAuthenticated'](),controller[_0x3b85('0xb')]);module[_0x3b85('0xc')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index 3df54fb..37dce37 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 _0x82ad=['variable','customVariable','keyValue','picklist','STRING','BOOLEAN','exports','ENUM','string'];(function(_0x1127bf,_0x542714){var _0x5bdfce=function(_0x29b766){while(--_0x29b766){_0x1127bf['push'](_0x1127bf['shift']());}};_0x5bdfce(++_0x542714);}(_0x82ad,0x9f));var _0xd82a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x82ad[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0xd82a('0x0')]={'type':{'type':Sequelize[_0xd82a('0x1')](_0xd82a('0x2'),_0xd82a('0x3'),_0xd82a('0x4'),_0xd82a('0x5'),_0xd82a('0x6')),'defaultValue':_0xd82a('0x2')},'content':{'type':Sequelize[_0xd82a('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xd82a('0x1')](_0xd82a('0x2'),_0xd82a('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0xd82a('0x7')]},'idField':{'type':Sequelize[_0xd82a('0x7')]},'nameField':{'type':Sequelize[_0xd82a('0x7')]},'customField':{'type':Sequelize[_0xd82a('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xd82a('0x7')]}}; \ No newline at end of file +var _0xbdae=['exports','string','variable','customVariable','keyValue','picklist','STRING'];(function(_0x273c39,_0x1052e6){var _0x46d6b5=function(_0x44f1fb){while(--_0x44f1fb){_0x273c39['push'](_0x273c39['shift']());}};_0x46d6b5(++_0x1052e6);}(_0xbdae,0x196));var _0xebda=function(_0x2f5c2c,_0x7ebfaf){_0x2f5c2c=_0x2f5c2c-0x0;var _0x428e60=_0xbdae[_0x2f5c2c];return _0x428e60;};'use strict';var Sequelize=require('sequelize');module[_0xebda('0x0')]={'type':{'type':Sequelize['ENUM'](_0xebda('0x1'),_0xebda('0x2'),_0xebda('0x3'),_0xebda('0x4'),_0xebda('0x5')),'defaultValue':_0xebda('0x1')},'content':{'type':Sequelize[_0xebda('0x6')]},'key':{'type':Sequelize[_0xebda('0x6')]},'keyType':{'type':Sequelize['ENUM']('string',_0xebda('0x2'),_0xebda('0x3'))},'keyContent':{'type':Sequelize[_0xebda('0x6')]},'idField':{'type':Sequelize[_0xebda('0x6')]},'nameField':{'type':Sequelize[_0xebda('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xebda('0x6')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index 7fa9719..1967693 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 _0xdb4b=['undefined','count','offset','set','Content-Range','json','apply','reject','save','destroy','then','status','sendStatus','error','stack','name','send','index','Dynamics365Field','rawAttributes','fieldName','type','key','map','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','filter','merge','options','includeAll','include','findAll','rows','catch','show','create','body','update','find','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','end','limit'];(function(_0x35a3c2,_0x556835){var _0x3dde7f=function(_0x554478){while(--_0x554478){_0x35a3c2['push'](_0x35a3c2['shift']());}};_0x3dde7f(++_0x556835);}(_0xdb4b,0x16e));var _0xbdb4=function(_0x34cc52,_0x5f0c7e){_0x34cc52=_0x34cc52-0x0;var _0x296404=_0xdb4b[_0x34cc52];return _0x296404;};'use strict';var emlformat=require(_0xbdb4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbdb4('0x1'));var jsonpatch=require(_0xbdb4('0x2'));var rp=require(_0xbdb4('0x3'));var moment=require(_0xbdb4('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xbdb4('0x5'));var util=require(_0xbdb4('0x6'));var path=require(_0xbdb4('0x7'));var sox=require(_0xbdb4('0x8'));var csv=require('to-csv');var ejs=require(_0xbdb4('0x9'));var fs=require('fs');var fs_extra=require(_0xbdb4('0xa'));var _=require('lodash');var squel=require(_0xbdb4('0xb'));var crypto=require('crypto');var jsforce=require(_0xbdb4('0xc'));var deskjs=require(_0xbdb4('0xd'));var toCsv=require(_0xbdb4('0xe'));var querystring=require(_0xbdb4('0xf'));var Papa=require(_0xbdb4('0x10'));var Redis=require(_0xbdb4('0x11'));var authService=require(_0xbdb4('0x12'));var qs=require(_0xbdb4('0x13'));var as=require(_0xbdb4('0x14'));var hardwareService=require(_0xbdb4('0x15'));var logger=require(_0xbdb4('0x16'))(_0xbdb4('0x17'));var utils=require('../../config/utils');var config=require(_0xbdb4('0x18'));var licenseUtil=require(_0xbdb4('0x19'));var db=require(_0xbdb4('0x1a'))['db'];function respondWithStatusCode(_0x1b8a69,_0x3f05ec){_0x3f05ec=_0x3f05ec||0xcc;return function(_0x60f6ce){if(_0x60f6ce){return _0x1b8a69['sendStatus'](_0x3f05ec);}return _0x1b8a69['status'](_0x3f05ec)[_0xbdb4('0x1b')]();};}function respondWithResult(_0x1b1f5d,_0x13d58f){_0x13d58f=_0x13d58f||0xc8;return function(_0x44ad8c){if(_0x44ad8c){return _0x1b1f5d['status'](_0x13d58f)['json'](_0x44ad8c);}};}function respondWithFilteredResult(_0x31b809,_0x18613a){return function(_0x5992f5){if(_0x5992f5){var _0x251b94=typeof _0x18613a['offset']==='undefined'&&typeof _0x18613a[_0xbdb4('0x1c')]===_0xbdb4('0x1d');var _0x5ad888=_0x5992f5['count'];var _0x237211=_0x251b94?0x0:_0x18613a['offset'];var _0x2ee8d8=_0x251b94?_0x5992f5[_0xbdb4('0x1e')]:_0x18613a[_0xbdb4('0x1f')]+_0x18613a['limit'];var _0x5ee349;if(_0x2ee8d8>=_0x5ad888){_0x2ee8d8=_0x5ad888;_0x5ee349=0xc8;}else{_0x5ee349=0xce;}_0x31b809['status'](_0x5ee349);return _0x31b809[_0xbdb4('0x20')](_0xbdb4('0x21'),_0x237211+'-'+_0x2ee8d8+'/'+_0x5ad888)[_0xbdb4('0x22')](_0x5992f5);}return null;};}function patchUpdates(_0x486485){return function(_0x43bfa6){try{jsonpatch[_0xbdb4('0x23')](_0x43bfa6,_0x486485,!![]);}catch(_0x27c89d){return BPromise[_0xbdb4('0x24')](_0x27c89d);}return _0x43bfa6[_0xbdb4('0x25')]();};}function saveUpdates(_0x3aa883,_0x1eabdc){return function(_0x16205d){if(_0x16205d){return _0x16205d['update'](_0x3aa883)['then'](function(_0x457e75){return _0x457e75;});}return null;};}function removeEntity(_0x536057,_0x1a2894){return function(_0x1d2417){if(_0x1d2417){return _0x1d2417[_0xbdb4('0x26')]()[_0xbdb4('0x27')](function(){_0x536057[_0xbdb4('0x28')](0xcc)[_0xbdb4('0x1b')]();});}};}function handleEntityNotFound(_0x124db5,_0x1e0d08){return function(_0x3df4d2){if(!_0x3df4d2){_0x124db5[_0xbdb4('0x29')](0x194);}return _0x3df4d2;};}function handleError(_0x2e3788,_0x36026b){_0x36026b=_0x36026b||0x1f4;return function(_0x224a7c){logger[_0xbdb4('0x2a')](_0x224a7c[_0xbdb4('0x2b')]);if(_0x224a7c[_0xbdb4('0x2c')]){delete _0x224a7c[_0xbdb4('0x2c')];}_0x2e3788[_0xbdb4('0x28')](_0x36026b)[_0xbdb4('0x2d')](_0x224a7c);};}exports[_0xbdb4('0x2e')]=function(_0x1dcc89,_0x3c1ff6){var _0x293e82={},_0x5d8c60={},_0x502b28={'count':0x0,'rows':[]};var _0x3c1fa7=_['map'](db[_0xbdb4('0x2f')][_0xbdb4('0x30')],function(_0x1f7a0c){return{'name':_0x1f7a0c[_0xbdb4('0x31')],'type':_0x1f7a0c[_0xbdb4('0x32')][_0xbdb4('0x33')]};});_0x5d8c60['model']=_[_0xbdb4('0x34')](_0x3c1fa7,'name');_0x5d8c60['query']=_[_0xbdb4('0x35')](_0x1dcc89[_0xbdb4('0x36')]);_0x5d8c60[_0xbdb4('0x37')]=_[_0xbdb4('0x38')](_0x5d8c60[_0xbdb4('0x39')],_0x5d8c60[_0xbdb4('0x36')]);_0x293e82['attributes']=_[_0xbdb4('0x38')](_0x5d8c60[_0xbdb4('0x39')],qs[_0xbdb4('0x3a')](_0x1dcc89[_0xbdb4('0x36')][_0xbdb4('0x3a')]));_0x293e82['attributes']=_0x293e82[_0xbdb4('0x3b')][_0xbdb4('0x3c')]?_0x293e82[_0xbdb4('0x3b')]:_0x5d8c60[_0xbdb4('0x39')];if(!_0x1dcc89[_0xbdb4('0x36')][_0xbdb4('0x3d')]('nolimit')){_0x293e82[_0xbdb4('0x1c')]=qs[_0xbdb4('0x1c')](_0x1dcc89['query']['limit']);_0x293e82[_0xbdb4('0x1f')]=qs[_0xbdb4('0x1f')](_0x1dcc89['query'][_0xbdb4('0x1f')]);}_0x293e82[_0xbdb4('0x3e')]=qs[_0xbdb4('0x3f')](_0x1dcc89['query'][_0xbdb4('0x3f')]);_0x293e82[_0xbdb4('0x40')]=qs[_0xbdb4('0x37')](_['pick'](_0x1dcc89[_0xbdb4('0x36')],_0x5d8c60[_0xbdb4('0x37')]),_0x3c1fa7);if(_0x1dcc89[_0xbdb4('0x36')][_0xbdb4('0x41')]){_0x293e82[_0xbdb4('0x40')]=_[_0xbdb4('0x42')](_0x293e82[_0xbdb4('0x40')],{'$or':_[_0xbdb4('0x34')](_0x3c1fa7,function(_0x4373a0){if(_0x4373a0[_0xbdb4('0x32')]!=='VIRTUAL'){var _0x4c1e02={};_0x4c1e02[_0x4373a0[_0xbdb4('0x2c')]]={'$like':'%'+_0x1dcc89[_0xbdb4('0x36')][_0xbdb4('0x41')]+'%'};return _0x4c1e02;}})});}_0x293e82=_['merge']({},_0x293e82,_0x1dcc89[_0xbdb4('0x43')]);var _0x5e6891={'where':_0x293e82[_0xbdb4('0x40')]};return db[_0xbdb4('0x2f')][_0xbdb4('0x1e')](_0x5e6891)['then'](function(_0x4b10af){_0x502b28['count']=_0x4b10af;if(_0x1dcc89[_0xbdb4('0x36')][_0xbdb4('0x44')]){_0x293e82[_0xbdb4('0x45')]=[{'all':!![]}];}return db[_0xbdb4('0x2f')][_0xbdb4('0x46')](_0x293e82);})[_0xbdb4('0x27')](function(_0x4ff548){_0x502b28[_0xbdb4('0x47')]=_0x4ff548;return _0x502b28;})['then'](respondWithFilteredResult(_0x3c1ff6,_0x293e82))[_0xbdb4('0x48')](handleError(_0x3c1ff6,null));};exports[_0xbdb4('0x49')]=function(_0x2428b8,_0x1b5da4){var _0x572d93={'raw':!![],'where':{'id':_0x2428b8['params']['id']}},_0x54bcec={};_0x54bcec[_0xbdb4('0x39')]=_[_0xbdb4('0x35')](db[_0xbdb4('0x2f')][_0xbdb4('0x30')]);_0x54bcec['query']=_[_0xbdb4('0x35')](_0x2428b8[_0xbdb4('0x36')]);_0x54bcec[_0xbdb4('0x37')]=_[_0xbdb4('0x38')](_0x54bcec[_0xbdb4('0x39')],_0x54bcec['query']);_0x572d93[_0xbdb4('0x3b')]=_[_0xbdb4('0x38')](_0x54bcec[_0xbdb4('0x39')],qs[_0xbdb4('0x3a')](_0x2428b8[_0xbdb4('0x36')][_0xbdb4('0x3a')]));_0x572d93['attributes']=_0x572d93[_0xbdb4('0x3b')][_0xbdb4('0x3c')]?_0x572d93[_0xbdb4('0x3b')]:_0x54bcec[_0xbdb4('0x39')];if(_0x2428b8[_0xbdb4('0x36')]['includeAll']){_0x572d93[_0xbdb4('0x45')]=[{'all':!![]}];}_0x572d93=_['merge']({},_0x572d93,_0x2428b8[_0xbdb4('0x43')]);return db[_0xbdb4('0x2f')]['find'](_0x572d93)[_0xbdb4('0x27')](handleEntityNotFound(_0x1b5da4,null))[_0xbdb4('0x27')](respondWithResult(_0x1b5da4,null))['catch'](handleError(_0x1b5da4,null));};exports['create']=function(_0x4c3094,_0x3fb928){return db[_0xbdb4('0x2f')][_0xbdb4('0x4a')](_0x4c3094[_0xbdb4('0x4b')],{})['then'](respondWithResult(_0x3fb928,0xc9))[_0xbdb4('0x48')](handleError(_0x3fb928,null));};exports[_0xbdb4('0x4c')]=function(_0x67e7b6,_0x4b86ef){if(_0x67e7b6[_0xbdb4('0x4b')]['id']){delete _0x67e7b6[_0xbdb4('0x4b')]['id'];}return db[_0xbdb4('0x2f')][_0xbdb4('0x4d')]({'where':{'id':_0x67e7b6[_0xbdb4('0x4e')]['id']}})[_0xbdb4('0x27')](handleEntityNotFound(_0x4b86ef,null))[_0xbdb4('0x27')](saveUpdates(_0x67e7b6[_0xbdb4('0x4b')],null))[_0xbdb4('0x27')](respondWithResult(_0x4b86ef,null))['catch'](handleError(_0x4b86ef,null));};exports['destroy']=function(_0x585804,_0x268e42){return db[_0xbdb4('0x2f')]['find']({'where':{'id':_0x585804['params']['id']}})[_0xbdb4('0x27')](handleEntityNotFound(_0x268e42,null))[_0xbdb4('0x27')](removeEntity(_0x268e42,null))[_0xbdb4('0x48')](handleError(_0x268e42,null));}; \ No newline at end of file +var _0x663a=['pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','filters','length','find','catch','create','update','body','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','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','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','error','name','send','index','map','Dynamics365Field','rawAttributes','fieldName','type','key','model','keys','query','intersection','fields','attributes','hasOwnProperty','order','sort','where'];(function(_0x3555f9,_0x99185f){var _0x3fe2e7=function(_0x25a445){while(--_0x25a445){_0x3555f9['push'](_0x3555f9['shift']());}};_0x3fe2e7(++_0x99185f);}(_0x663a,0x1f2));var _0xa663=function(_0x2eabba,_0x2a18cd){_0x2eabba=_0x2eabba-0x0;var _0xfc0a5e=_0x663a[_0x2eabba];return _0xfc0a5e;};'use strict';var emlformat=require(_0xa663('0x0'));var rimraf=require(_0xa663('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa663('0x2'));var rp=require(_0xa663('0x3'));var moment=require(_0xa663('0x4'));var BPromise=require(_0xa663('0x5'));var Mustache=require(_0xa663('0x6'));var util=require(_0xa663('0x7'));var path=require(_0xa663('0x8'));var sox=require(_0xa663('0x9'));var csv=require(_0xa663('0xa'));var ejs=require(_0xa663('0xb'));var fs=require('fs');var fs_extra=require(_0xa663('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xa663('0xd'));var jsforce=require(_0xa663('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xa663('0xa'));var querystring=require(_0xa663('0xf'));var Papa=require(_0xa663('0x10'));var Redis=require(_0xa663('0x11'));var authService=require(_0xa663('0x12'));var qs=require(_0xa663('0x13'));var as=require(_0xa663('0x14'));var hardwareService=require(_0xa663('0x15'));var logger=require(_0xa663('0x16'))(_0xa663('0x17'));var utils=require(_0xa663('0x18'));var config=require(_0xa663('0x19'));var licenseUtil=require(_0xa663('0x1a'));var db=require(_0xa663('0x1b'))['db'];function respondWithStatusCode(_0x421ad8,_0x5d143a){_0x5d143a=_0x5d143a||0xcc;return function(_0x47358f){if(_0x47358f){return _0x421ad8[_0xa663('0x1c')](_0x5d143a);}return _0x421ad8['status'](_0x5d143a)[_0xa663('0x1d')]();};}function respondWithResult(_0x2dfff4,_0x640911){_0x640911=_0x640911||0xc8;return function(_0x3caa52){if(_0x3caa52){return _0x2dfff4[_0xa663('0x1e')](_0x640911)[_0xa663('0x1f')](_0x3caa52);}};}function respondWithFilteredResult(_0x2a41ff,_0x23c1a5){return function(_0x583e67){if(_0x583e67){var _0x5c743d=typeof _0x23c1a5[_0xa663('0x20')]===_0xa663('0x21')&&typeof _0x23c1a5[_0xa663('0x22')]===_0xa663('0x21');var _0xd55358=_0x583e67[_0xa663('0x23')];var _0x25a97e=_0x5c743d?0x0:_0x23c1a5['offset'];var _0x5dcdee=_0x5c743d?_0x583e67[_0xa663('0x23')]:_0x23c1a5[_0xa663('0x20')]+_0x23c1a5[_0xa663('0x22')];var _0x881917;if(_0x5dcdee>=_0xd55358){_0x5dcdee=_0xd55358;_0x881917=0xc8;}else{_0x881917=0xce;}_0x2a41ff[_0xa663('0x1e')](_0x881917);return _0x2a41ff['set'](_0xa663('0x24'),_0x25a97e+'-'+_0x5dcdee+'/'+_0xd55358)[_0xa663('0x1f')](_0x583e67);}return null;};}function patchUpdates(_0x32e4a3){return function(_0x5600ad){try{jsonpatch[_0xa663('0x25')](_0x5600ad,_0x32e4a3,!![]);}catch(_0x41a9c4){return BPromise[_0xa663('0x26')](_0x41a9c4);}return _0x5600ad[_0xa663('0x27')]();};}function saveUpdates(_0x3559b0,_0x5d4f7e){return function(_0x32f94e){if(_0x32f94e){return _0x32f94e['update'](_0x3559b0)[_0xa663('0x28')](function(_0x2930b2){return _0x2930b2;});}return null;};}function removeEntity(_0x159198,_0x3c0f52){return function(_0x2b5266){if(_0x2b5266){return _0x2b5266[_0xa663('0x29')]()['then'](function(){_0x159198[_0xa663('0x1e')](0xcc)[_0xa663('0x1d')]();});}};}function handleEntityNotFound(_0x11fb4e,_0x4e6f35){return function(_0x4906a5){if(!_0x4906a5){_0x11fb4e[_0xa663('0x1c')](0x194);}return _0x4906a5;};}function handleError(_0x304f9d,_0x5c607b){_0x5c607b=_0x5c607b||0x1f4;return function(_0x5cfc07){logger[_0xa663('0x2a')](_0x5cfc07['stack']);if(_0x5cfc07[_0xa663('0x2b')]){delete _0x5cfc07[_0xa663('0x2b')];}_0x304f9d[_0xa663('0x1e')](_0x5c607b)[_0xa663('0x2c')](_0x5cfc07);};}exports[_0xa663('0x2d')]=function(_0x25a7f9,_0x22562b){var _0x485a78={},_0x1bd059={},_0x241368={'count':0x0,'rows':[]};var _0x2d5f2e=_[_0xa663('0x2e')](db[_0xa663('0x2f')][_0xa663('0x30')],function(_0x557df9){return{'name':_0x557df9[_0xa663('0x31')],'type':_0x557df9[_0xa663('0x32')][_0xa663('0x33')]};});_0x1bd059[_0xa663('0x34')]=_[_0xa663('0x2e')](_0x2d5f2e,'name');_0x1bd059['query']=_[_0xa663('0x35')](_0x25a7f9[_0xa663('0x36')]);_0x1bd059['filters']=_[_0xa663('0x37')](_0x1bd059['model'],_0x1bd059[_0xa663('0x36')]);_0x485a78['attributes']=_[_0xa663('0x37')](_0x1bd059[_0xa663('0x34')],qs['fields'](_0x25a7f9[_0xa663('0x36')][_0xa663('0x38')]));_0x485a78[_0xa663('0x39')]=_0x485a78[_0xa663('0x39')]['length']?_0x485a78[_0xa663('0x39')]:_0x1bd059['model'];if(!_0x25a7f9[_0xa663('0x36')][_0xa663('0x3a')]('nolimit')){_0x485a78[_0xa663('0x22')]=qs['limit'](_0x25a7f9['query'][_0xa663('0x22')]);_0x485a78['offset']=qs['offset'](_0x25a7f9['query'][_0xa663('0x20')]);}_0x485a78[_0xa663('0x3b')]=qs[_0xa663('0x3c')](_0x25a7f9[_0xa663('0x36')][_0xa663('0x3c')]);_0x485a78[_0xa663('0x3d')]=qs['filters'](_[_0xa663('0x3e')](_0x25a7f9[_0xa663('0x36')],_0x1bd059['filters']),_0x2d5f2e);if(_0x25a7f9[_0xa663('0x36')]['filter']){_0x485a78[_0xa663('0x3d')]=_[_0xa663('0x3f')](_0x485a78[_0xa663('0x3d')],{'$or':_[_0xa663('0x2e')](_0x2d5f2e,function(_0x3e758e){if(_0x3e758e[_0xa663('0x32')]!==_0xa663('0x40')){var _0x17e6e9={};_0x17e6e9[_0x3e758e['name']]={'$like':'%'+_0x25a7f9[_0xa663('0x36')][_0xa663('0x41')]+'%'};return _0x17e6e9;}})});}_0x485a78=_[_0xa663('0x3f')]({},_0x485a78,_0x25a7f9[_0xa663('0x42')]);var _0x6294d4={'where':_0x485a78[_0xa663('0x3d')]};return db[_0xa663('0x2f')][_0xa663('0x23')](_0x6294d4)['then'](function(_0x12953d){_0x241368['count']=_0x12953d;if(_0x25a7f9[_0xa663('0x36')][_0xa663('0x43')]){_0x485a78[_0xa663('0x44')]=[{'all':!![]}];}return db[_0xa663('0x2f')][_0xa663('0x45')](_0x485a78);})[_0xa663('0x28')](function(_0x459fd6){_0x241368[_0xa663('0x46')]=_0x459fd6;return _0x241368;})[_0xa663('0x28')](respondWithFilteredResult(_0x22562b,_0x485a78))['catch'](handleError(_0x22562b,null));};exports[_0xa663('0x47')]=function(_0x543e90,_0xb41c56){var _0xb92fe1={'raw':!![],'where':{'id':_0x543e90['params']['id']}},_0x31541a={};_0x31541a[_0xa663('0x34')]=_[_0xa663('0x35')](db[_0xa663('0x2f')][_0xa663('0x30')]);_0x31541a['query']=_[_0xa663('0x35')](_0x543e90['query']);_0x31541a[_0xa663('0x48')]=_[_0xa663('0x37')](_0x31541a[_0xa663('0x34')],_0x31541a['query']);_0xb92fe1[_0xa663('0x39')]=_['intersection'](_0x31541a[_0xa663('0x34')],qs[_0xa663('0x38')](_0x543e90['query'][_0xa663('0x38')]));_0xb92fe1[_0xa663('0x39')]=_0xb92fe1[_0xa663('0x39')][_0xa663('0x49')]?_0xb92fe1['attributes']:_0x31541a[_0xa663('0x34')];if(_0x543e90[_0xa663('0x36')][_0xa663('0x43')]){_0xb92fe1[_0xa663('0x44')]=[{'all':!![]}];}_0xb92fe1=_['merge']({},_0xb92fe1,_0x543e90[_0xa663('0x42')]);return db[_0xa663('0x2f')][_0xa663('0x4a')](_0xb92fe1)[_0xa663('0x28')](handleEntityNotFound(_0xb41c56,null))[_0xa663('0x28')](respondWithResult(_0xb41c56,null))[_0xa663('0x4b')](handleError(_0xb41c56,null));};exports[_0xa663('0x4c')]=function(_0x377a6d,_0x1557c9){return db['Dynamics365Field'][_0xa663('0x4c')](_0x377a6d['body'],{})['then'](respondWithResult(_0x1557c9,0xc9))['catch'](handleError(_0x1557c9,null));};exports[_0xa663('0x4d')]=function(_0x5890ea,_0x1db2bb){if(_0x5890ea[_0xa663('0x4e')]['id']){delete _0x5890ea['body']['id'];}return db[_0xa663('0x2f')][_0xa663('0x4a')]({'where':{'id':_0x5890ea[_0xa663('0x4f')]['id']}})[_0xa663('0x28')](handleEntityNotFound(_0x1db2bb,null))[_0xa663('0x28')](saveUpdates(_0x5890ea['body'],null))[_0xa663('0x28')](respondWithResult(_0x1db2bb,null))[_0xa663('0x4b')](handleError(_0x1db2bb,null));};exports[_0xa663('0x29')]=function(_0x5b47ce,_0x3a63bd){return db['Dynamics365Field']['find']({'where':{'id':_0x5b47ce['params']['id']}})[_0xa663('0x28')](handleEntityNotFound(_0x3a63bd,null))[_0xa663('0x28')](removeEntity(_0x3a63bd,null))[_0xa663('0x4b')](handleError(_0x3a63bd,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index 4cc530b..e97aa49 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 _0xf5ad=['lodash','moment','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Field.attributes','exports','define','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','idField','FieldId'];(function(_0x4d5c5b,_0x54b72a){var _0x479ed2=function(_0x2777ac){while(--_0x2777ac){_0x4d5c5b['push'](_0x4d5c5b['shift']());}};_0x479ed2(++_0x54b72a);}(_0xf5ad,0x1ce));var _0xdf5a=function(_0x12b090,_0x45cacb){_0x12b090=_0x12b090-0x0;var _0x524e92=_0xf5ad[_0x12b090];return _0x524e92;};'use strict';var _=require(_0xdf5a('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xdf5a('0x1'));var BPromise=require(_0xdf5a('0x2'));var rp=require(_0xdf5a('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdf5a('0x4'));var config=require(_0xdf5a('0x5'));var attributes=require(_0xdf5a('0x6'));module[_0xdf5a('0x7')]=function(_0x1c8c56,_0x5f2aff){return _0x1c8c56[_0xdf5a('0x8')](_0xdf5a('0x9'),attributes,{'tableName':_0xdf5a('0xa'),'paranoid':![],'indexes':[{'name':_0xdf5a('0xb'),'fields':[_0xdf5a('0xc'),_0xdf5a('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xaecb=['FieldId','lodash','util','../../config/logger','api','moment','bluebird','../../config/environment','./intDynamics365Field.attributes','exports','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','idField'];(function(_0x3fba9f,_0x3b7b9b){var _0x192cf1=function(_0x557290){while(--_0x557290){_0x3fba9f['push'](_0x3fba9f['shift']());}};_0x192cf1(++_0x3b7b9b);}(_0xaecb,0xef));var _0xbaec=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xaecb[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xbaec('0x0'));var util=require(_0xbaec('0x1'));var logger=require(_0xbaec('0x2'))(_0xbaec('0x3'));var moment=require(_0xbaec('0x4'));var BPromise=require(_0xbaec('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xbaec('0x6'));var attributes=require(_0xbaec('0x7'));module[_0xbaec('0x8')]=function(_0x3bf41f,_0x161ac4){return _0x3bf41f['define'](_0xbaec('0x9'),attributes,{'tableName':_0xbaec('0xa'),'paranoid':![],'indexes':[{'name':_0xbaec('0xb'),'fields':[_0xbaec('0xc'),_0xbaec('0xd')],'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 d11143a..befd7bf 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 _0x6f87=['debug','error','code','message','result','catch','moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent'];(function(_0x3fa7ad,_0x182b55){var _0x59491f=function(_0x326b08){while(--_0x326b08){_0x3fa7ad['push'](_0x3fa7ad['shift']());}};_0x59491f(++_0x182b55);}(_0x6f87,0xc4));var _0x76f8=function(_0x51af32,_0x20e172){_0x51af32=_0x51af32-0x0;var _0x3040d3=_0x6f87[_0x51af32];return _0x3040d3;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x76f8('0x0'));var BPromise=require('bluebird');var rs=require(_0x76f8('0x1'));var fs=require('fs');var Redis=require(_0x76f8('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x76f8('0x3'));var logger=require('../../config/logger')(_0x76f8('0x4'));var config=require(_0x76f8('0x5'));var jayson=require(_0x76f8('0x6'));var client=jayson['client'][_0x76f8('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2fe67d,_0x49a458,_0x2a9b8b){return new BPromise(function(_0x2d6618,_0x474d69){return client[_0x76f8('0x8')](_0x2fe67d,_0x2a9b8b)[_0x76f8('0x9')](function(_0x434d6f){logger[_0x76f8('0xa')](_0x76f8('0xb'),_0x49a458,_0x76f8('0xc'));logger[_0x76f8('0xd')]('Dynamics365Field,\x20%s,\x20%s,\x20%s',_0x49a458,_0x76f8('0xc'),JSON['stringify'](_0x434d6f));if(_0x434d6f[_0x76f8('0xe')]){if(_0x434d6f[_0x76f8('0xe')][_0x76f8('0xf')]===0x1f4){logger[_0x76f8('0xe')](_0x76f8('0xb'),_0x49a458,_0x434d6f[_0x76f8('0xe')][_0x76f8('0x10')]);return _0x474d69(_0x434d6f['error']['message']);}logger[_0x76f8('0xe')](_0x76f8('0xb'),_0x49a458,_0x434d6f[_0x76f8('0xe')]['message']);return _0x2d6618(_0x434d6f[_0x76f8('0xe')][_0x76f8('0x10')]);}else{logger[_0x76f8('0xa')](_0x76f8('0xb'),_0x49a458,_0x76f8('0xc'));_0x2d6618(_0x434d6f[_0x76f8('0x11')]['message']);}})[_0x76f8('0x12')](function(_0x35b48b){logger['error'](_0x76f8('0xb'),_0x49a458,_0x35b48b);_0x474d69(_0x35b48b);});});} \ No newline at end of file +var _0xd93a=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','moment','bluebird','randomstring'];(function(_0x343027,_0x564e0c){var _0x98a521=function(_0x1e3583){while(--_0x1e3583){_0x343027['push'](_0x343027['shift']());}};_0x98a521(++_0x564e0c);}(_0xd93a,0x103));var _0xad93=function(_0x3e11a2,_0x3ca87a){_0x3e11a2=_0x3e11a2-0x0;var _0x5bb082=_0xd93a[_0x3e11a2];return _0x5bb082;};'use strict';var _=require(_0xad93('0x0'));var util=require(_0xad93('0x1'));var moment=require(_0xad93('0x2'));var BPromise=require(_0xad93('0x3'));var rs=require(_0xad93('0x4'));var fs=require('fs');var Redis=require(_0xad93('0x5'));var db=require(_0xad93('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xad93('0x7'))(_0xad93('0x8'));var config=require(_0xad93('0x9'));var jayson=require(_0xad93('0xa'));var client=jayson[_0xad93('0xb')][_0xad93('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5f198d,_0x1132b8,_0x1608da){return new BPromise(function(_0x469594,_0x4acd5c){return client[_0xad93('0xd')](_0x5f198d,_0x1608da)[_0xad93('0xe')](function(_0x58c29a){logger[_0xad93('0xf')](_0xad93('0x10'),_0x1132b8,_0xad93('0x11'));logger[_0xad93('0x12')](_0xad93('0x13'),_0x1132b8,_0xad93('0x11'),JSON[_0xad93('0x14')](_0x58c29a));if(_0x58c29a[_0xad93('0x15')]){if(_0x58c29a[_0xad93('0x15')][_0xad93('0x16')]===0x1f4){logger[_0xad93('0x15')](_0xad93('0x10'),_0x1132b8,_0x58c29a[_0xad93('0x15')][_0xad93('0x17')]);return _0x4acd5c(_0x58c29a[_0xad93('0x15')][_0xad93('0x17')]);}logger[_0xad93('0x15')](_0xad93('0x10'),_0x1132b8,_0x58c29a['error'][_0xad93('0x17')]);return _0x469594(_0x58c29a[_0xad93('0x15')][_0xad93('0x17')]);}else{logger[_0xad93('0xf')](_0xad93('0x10'),_0x1132b8,_0xad93('0x11'));_0x469594(_0x58c29a['result'][_0xad93('0x17')]);}})['catch'](function(_0x1b8733){logger[_0xad93('0x15')](_0xad93('0x10'),_0x1132b8,_0x1b8733);_0x4acd5c(_0x1b8733);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index d95e4bf..e4dbabe 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 _0x963c=['/:id/configurations','update','multer','Router','../../components/auth/service','../../config/environment','./intFreshdeskAccount.controller','get','index','/:id','isAuthenticated','show','/:id/fields','getFields','post'];(function(_0x131585,_0x1abd33){var _0x1fcca2=function(_0x8f165b){while(--_0x8f165b){_0x131585['push'](_0x131585['shift']());}};_0x1fcca2(++_0x1abd33);}(_0x963c,0xa7));var _0xc963=function(_0x3ee7a9,_0x548054){_0x3ee7a9=_0x3ee7a9-0x0;var _0x4c1219=_0x963c[_0x3ee7a9];return _0x4c1219;};'use strict';var multer=require(_0xc963('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xc963('0x1')]();var fs_extra=require('fs-extra');var auth=require(_0xc963('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0xc963('0x3'));var controller=require(_0xc963('0x4'));router[_0xc963('0x5')]('/',auth['isAuthenticated'](),controller[_0xc963('0x6')]);router['get'](_0xc963('0x7'),auth[_0xc963('0x8')](),controller[_0xc963('0x9')]);router[_0xc963('0x5')]('/:id/configurations',auth['isAuthenticated'](),controller['getConfigurations']);router[_0xc963('0x5')](_0xc963('0xa'),auth[_0xc963('0x8')](),controller[_0xc963('0xb')]);router[_0xc963('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0xc963('0xc')](_0xc963('0xd'),auth['isAuthenticated'](),controller['addConfiguration']);router['put'](_0xc963('0x7'),auth[_0xc963('0x8')](),controller[_0xc963('0xe')]);router['delete'](_0xc963('0x7'),auth[_0xc963('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x95ad=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','getConfigurations','getFields','post','create','/:id/configurations','addConfiguration','put','update','delete','multer','util','path'];(function(_0x1b48ee,_0x2d5942){var _0x154161=function(_0x3081f2){while(--_0x3081f2){_0x1b48ee['push'](_0x1b48ee['shift']());}};_0x154161(++_0x2d5942);}(_0x95ad,0x135));var _0xd95a=function(_0x2bd8d5,_0x2db5e8){_0x2bd8d5=_0x2bd8d5-0x0;var _0x522064=_0x95ad[_0x2bd8d5];return _0x522064;};'use strict';var multer=require(_0xd95a('0x0'));var util=require(_0xd95a('0x1'));var path=require(_0xd95a('0x2'));var timeout=require(_0xd95a('0x3'));var express=require(_0xd95a('0x4'));var router=express[_0xd95a('0x5')]();var fs_extra=require(_0xd95a('0x6'));var auth=require(_0xd95a('0x7'));var interaction=require(_0xd95a('0x8'));var config=require(_0xd95a('0x9'));var controller=require('./intFreshdeskAccount.controller');router[_0xd95a('0xa')]('/',auth[_0xd95a('0xb')](),controller[_0xd95a('0xc')]);router[_0xd95a('0xa')](_0xd95a('0xd'),auth[_0xd95a('0xb')](),controller[_0xd95a('0xe')]);router[_0xd95a('0xa')]('/:id/configurations',auth[_0xd95a('0xb')](),controller[_0xd95a('0xf')]);router[_0xd95a('0xa')]('/:id/fields',auth['isAuthenticated'](),controller[_0xd95a('0x10')]);router[_0xd95a('0x11')]('/',auth[_0xd95a('0xb')](),controller[_0xd95a('0x12')]);router[_0xd95a('0x11')](_0xd95a('0x13'),auth[_0xd95a('0xb')](),controller[_0xd95a('0x14')]);router[_0xd95a('0x15')](_0xd95a('0xd'),auth[_0xd95a('0xb')](),controller[_0xd95a('0x16')]);router[_0xd95a('0x17')]('/:id',auth[_0xd95a('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index d7c66d6..33b2579 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 _0x0598=['exports','STRING','sequelize'];(function(_0xea6018,_0x4cf082){var _0x57b54d=function(_0x49099a){while(--_0x49099a){_0xea6018['push'](_0xea6018['shift']());}};_0x57b54d(++_0x4cf082);}(_0x0598,0x92));var _0x8059=function(_0x3904fa,_0xa0d755){_0x3904fa=_0x3904fa-0x0;var _0x1d9d3b=_0x0598[_0x3904fa];return _0x1d9d3b;};'use strict';var Sequelize=require(_0x8059('0x0'));module[_0x8059('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x8059('0x2')]},'username':{'type':Sequelize['STRING'],'unique':'username'},'apiKey':{'type':Sequelize[_0x8059('0x2')]},'remoteUri':{'type':Sequelize[_0x8059('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x781d=['sequelize','exports','STRING','username','remoteUri'];(function(_0x1a3fe2,_0x553b71){var _0x490ee2=function(_0xc569b4){while(--_0xc569b4){_0x1a3fe2['push'](_0x1a3fe2['shift']());}};_0x490ee2(++_0x553b71);}(_0x781d,0x14a));var _0xd781=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x781d[_0x3bf83f];return _0x22c4a9;};'use strict';var Sequelize=require(_0xd781('0x0'));module[_0xd781('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xd781('0x2')],'unique':_0xd781('0x3')},'apiKey':{'type':Sequelize[_0xd781('0x2')]},'remoteUri':{'type':Sequelize[_0xd781('0x2')],'unique':_0xd781('0x4')},'serverUrl':{'type':Sequelize[_0xd781('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index 16758ac..db46b46 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 _0x4b6c=['getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','error','stack','name','status','send','index','FreshdeskAccount','fieldName','type','model','map','query','keys','intersection','fields','attributes','length','nolimit','order','sort','filters','pick','filter','where','merge','includeAll','include','show','params','rawAttributes','find','catch','create','body','destroy','getConfigurations','findOne','FreshdeskConfiguration','options','hasOwnProperty','addConfiguration','AccountId','Subjects','channel','Descriptions','getDescriptions','FreshdeskField','getFields','remoteUri','apiKey','%s/%s','api/v2/ticket_fields','format','Basic\x20%s','%s:X','toString','base64','requester','agent','description','priority','source','group','remove','includes','default','label','capitalize'];(function(_0x5ef3a1,_0x3e6faf){var _0x9fce0f=function(_0x10f154){while(--_0x10f154){_0x5ef3a1['push'](_0x5ef3a1['shift']());}};_0x9fce0f(++_0x3e6faf);}(_0x4b6c,0x14a));var _0xc4b6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4b6c[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xc4b6('0x0'));var rimraf=require(_0xc4b6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc4b6('0x2'));var rp=require(_0xc4b6('0x3'));var moment=require(_0xc4b6('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc4b6('0x5'));var util=require(_0xc4b6('0x6'));var path=require(_0xc4b6('0x7'));var sox=require('sox');var csv=require(_0xc4b6('0x8'));var ejs=require(_0xc4b6('0x9'));var fs=require('fs');var fs_extra=require(_0xc4b6('0xa'));var _=require(_0xc4b6('0xb'));var squel=require('squel');var crypto=require(_0xc4b6('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xc4b6('0x8'));var querystring=require(_0xc4b6('0xd'));var Papa=require(_0xc4b6('0xe'));var Redis=require(_0xc4b6('0xf'));var authService=require(_0xc4b6('0x10'));var qs=require(_0xc4b6('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc4b6('0x12'));var logger=require(_0xc4b6('0x13'))('api');var utils=require(_0xc4b6('0x14'));var config=require(_0xc4b6('0x15'));var licenseUtil=require(_0xc4b6('0x16'));var db=require(_0xc4b6('0x17'))['db'];var integrations=require(_0xc4b6('0x18'));function respondWithStatusCode(_0xd6208e,_0xf2a30e){_0xf2a30e=_0xf2a30e||0xcc;return function(_0x18991b){if(_0x18991b){return _0xd6208e[_0xc4b6('0x19')](_0xf2a30e);}return _0xd6208e['status'](_0xf2a30e)[_0xc4b6('0x1a')]();};}function respondWithResult(_0x2b7aab,_0x5d9008){_0x5d9008=_0x5d9008||0xc8;return function(_0x17b63b){if(_0x17b63b){return _0x2b7aab['status'](_0x5d9008)[_0xc4b6('0x1b')](_0x17b63b);}};}function respondWithFilteredResult(_0x408652,_0x20c517){return function(_0x23144b){if(_0x23144b){var _0x5f54fa=typeof _0x20c517['offset']===_0xc4b6('0x1c')&&typeof _0x20c517[_0xc4b6('0x1d')]===_0xc4b6('0x1c');var _0x32b425=_0x23144b[_0xc4b6('0x1e')];var _0x326600=_0x5f54fa?0x0:_0x20c517[_0xc4b6('0x1f')];var _0x784d54=_0x5f54fa?_0x23144b[_0xc4b6('0x1e')]:_0x20c517[_0xc4b6('0x1f')]+_0x20c517[_0xc4b6('0x1d')];var _0x19ad3f;if(_0x784d54>=_0x32b425){_0x784d54=_0x32b425;_0x19ad3f=0xc8;}else{_0x19ad3f=0xce;}_0x408652['status'](_0x19ad3f);return _0x408652[_0xc4b6('0x20')](_0xc4b6('0x21'),_0x326600+'-'+_0x784d54+'/'+_0x32b425)[_0xc4b6('0x1b')](_0x23144b);}return null;};}function patchUpdates(_0x15a3de){return function(_0x9b0780){try{jsonpatch[_0xc4b6('0x22')](_0x9b0780,_0x15a3de,!![]);}catch(_0x2ba273){return BPromise[_0xc4b6('0x23')](_0x2ba273);}return _0x9b0780['save']();};}function saveUpdates(_0x8fcdde,_0x41fedf){return function(_0x252cd3){if(_0x252cd3){return _0x252cd3[_0xc4b6('0x24')](_0x8fcdde)[_0xc4b6('0x25')](function(_0x214801){return _0x214801;});}return null;};}function removeEntity(_0x2c2d35,_0x81b146){return function(_0x187dac){if(_0x187dac){return _0x187dac['destroy']()['then'](function(){_0x2c2d35['status'](0xcc)[_0xc4b6('0x1a')]();});}};}function handleEntityNotFound(_0x31a69f,_0x4f5949){return function(_0x1c445b){if(!_0x1c445b){_0x31a69f[_0xc4b6('0x19')](0x194);}return _0x1c445b;};}function handleError(_0x50b946,_0x1209db){_0x1209db=_0x1209db||0x1f4;return function(_0x28fb10){logger[_0xc4b6('0x26')](_0x28fb10[_0xc4b6('0x27')]);if(_0x28fb10[_0xc4b6('0x28')]){delete _0x28fb10[_0xc4b6('0x28')];}_0x50b946[_0xc4b6('0x29')](_0x1209db)[_0xc4b6('0x2a')](_0x28fb10);};}exports[_0xc4b6('0x2b')]=function(_0x473e8d,_0x4a7b99){var _0x317924={},_0x17a744={},_0xb6ec64={'count':0x0,'rows':[]};var _0x5a98a1=_['map'](db[_0xc4b6('0x2c')]['rawAttributes'],function(_0x3ec5c1){return{'name':_0x3ec5c1[_0xc4b6('0x2d')],'type':_0x3ec5c1[_0xc4b6('0x2e')]['key']};});_0x17a744[_0xc4b6('0x2f')]=_[_0xc4b6('0x30')](_0x5a98a1,'name');_0x17a744[_0xc4b6('0x31')]=_[_0xc4b6('0x32')](_0x473e8d[_0xc4b6('0x31')]);_0x17a744['filters']=_['intersection'](_0x17a744[_0xc4b6('0x2f')],_0x17a744[_0xc4b6('0x31')]);_0x317924['attributes']=_[_0xc4b6('0x33')](_0x17a744['model'],qs[_0xc4b6('0x34')](_0x473e8d[_0xc4b6('0x31')][_0xc4b6('0x34')]));_0x317924[_0xc4b6('0x35')]=_0x317924[_0xc4b6('0x35')][_0xc4b6('0x36')]?_0x317924[_0xc4b6('0x35')]:_0x17a744['model'];if(!_0x473e8d['query']['hasOwnProperty'](_0xc4b6('0x37'))){_0x317924[_0xc4b6('0x1d')]=qs[_0xc4b6('0x1d')](_0x473e8d[_0xc4b6('0x31')]['limit']);_0x317924['offset']=qs[_0xc4b6('0x1f')](_0x473e8d[_0xc4b6('0x31')][_0xc4b6('0x1f')]);}_0x317924[_0xc4b6('0x38')]=qs[_0xc4b6('0x39')](_0x473e8d[_0xc4b6('0x31')][_0xc4b6('0x39')]);_0x317924['where']=qs[_0xc4b6('0x3a')](_[_0xc4b6('0x3b')](_0x473e8d['query'],_0x17a744[_0xc4b6('0x3a')]),_0x5a98a1);if(_0x473e8d[_0xc4b6('0x31')][_0xc4b6('0x3c')]){_0x317924[_0xc4b6('0x3d')]=_[_0xc4b6('0x3e')](_0x317924[_0xc4b6('0x3d')],{'$or':_[_0xc4b6('0x30')](_0x5a98a1,function(_0x36b744){if(_0x36b744[_0xc4b6('0x2e')]!=='VIRTUAL'){var _0x334af0={};_0x334af0[_0x36b744['name']]={'$like':'%'+_0x473e8d[_0xc4b6('0x31')][_0xc4b6('0x3c')]+'%'};return _0x334af0;}})});}_0x317924=_[_0xc4b6('0x3e')]({},_0x317924,_0x473e8d['options']);var _0x3e9f9c={'where':_0x317924[_0xc4b6('0x3d')]};return db[_0xc4b6('0x2c')][_0xc4b6('0x1e')](_0x3e9f9c)['then'](function(_0x532eff){_0xb6ec64[_0xc4b6('0x1e')]=_0x532eff;if(_0x473e8d[_0xc4b6('0x31')][_0xc4b6('0x3f')]){_0x317924[_0xc4b6('0x40')]=[{'all':!![]}];}return db[_0xc4b6('0x2c')]['findAll'](_0x317924);})[_0xc4b6('0x25')](function(_0x5d8473){_0xb6ec64['rows']=_0x5d8473;return _0xb6ec64;})[_0xc4b6('0x25')](respondWithFilteredResult(_0x4a7b99,_0x317924))['catch'](handleError(_0x4a7b99,null));};exports[_0xc4b6('0x41')]=function(_0x2f29e5,_0x2f709d){var _0x555acf={'raw':![],'where':{'id':_0x2f29e5[_0xc4b6('0x42')]['id']}},_0x1a47ad={};_0x1a47ad[_0xc4b6('0x2f')]=_[_0xc4b6('0x32')](db[_0xc4b6('0x2c')][_0xc4b6('0x43')]);_0x1a47ad['query']=_['keys'](_0x2f29e5[_0xc4b6('0x31')]);_0x1a47ad[_0xc4b6('0x3a')]=_['intersection'](_0x1a47ad['model'],_0x1a47ad['query']);_0x555acf[_0xc4b6('0x35')]=_[_0xc4b6('0x33')](_0x1a47ad[_0xc4b6('0x2f')],qs[_0xc4b6('0x34')](_0x2f29e5[_0xc4b6('0x31')][_0xc4b6('0x34')]));_0x555acf[_0xc4b6('0x35')]=_0x555acf['attributes'][_0xc4b6('0x36')]?_0x555acf[_0xc4b6('0x35')]:_0x1a47ad[_0xc4b6('0x2f')];if(_0x2f29e5[_0xc4b6('0x31')][_0xc4b6('0x3f')]){_0x555acf[_0xc4b6('0x40')]=[{'all':!![]}];}_0x555acf=_[_0xc4b6('0x3e')]({},_0x555acf,_0x2f29e5['options']);return db['FreshdeskAccount'][_0xc4b6('0x44')](_0x555acf)[_0xc4b6('0x25')](handleEntityNotFound(_0x2f709d,null))[_0xc4b6('0x25')](respondWithResult(_0x2f709d,null))[_0xc4b6('0x45')](handleError(_0x2f709d,null));};exports['create']=function(_0x5c7772,_0x2b65a2){return db[_0xc4b6('0x2c')][_0xc4b6('0x46')](_0x5c7772['body'],{})[_0xc4b6('0x25')](respondWithResult(_0x2b65a2,0xc9))['catch'](handleError(_0x2b65a2,null));};exports[_0xc4b6('0x24')]=function(_0x2f272f,_0x4f36b2){if(_0x2f272f[_0xc4b6('0x47')]['id']){delete _0x2f272f['body']['id'];}return db[_0xc4b6('0x2c')][_0xc4b6('0x44')]({'where':{'id':_0x2f272f[_0xc4b6('0x42')]['id']}})[_0xc4b6('0x25')](handleEntityNotFound(_0x4f36b2,null))[_0xc4b6('0x25')](saveUpdates(_0x2f272f['body'],null))[_0xc4b6('0x25')](respondWithResult(_0x4f36b2,null))[_0xc4b6('0x45')](handleError(_0x4f36b2,null));};exports[_0xc4b6('0x48')]=function(_0xd1643f,_0x3e94df){return db[_0xc4b6('0x2c')][_0xc4b6('0x44')]({'where':{'id':_0xd1643f[_0xc4b6('0x42')]['id']}})[_0xc4b6('0x25')](handleEntityNotFound(_0x3e94df,null))['then'](removeEntity(_0x3e94df,null))[_0xc4b6('0x45')](handleError(_0x3e94df,null));};exports[_0xc4b6('0x49')]=function(_0x41b113,_0x3c61b4,_0xb29c9){var _0x1f34d6={};var _0xad8b52={};var _0x3896e6;var _0x56d6d7;return db['FreshdeskAccount'][_0xc4b6('0x4a')]({'where':{'id':_0x41b113[_0xc4b6('0x42')]['id']}})['then'](handleEntityNotFound(_0x3c61b4,null))[_0xc4b6('0x25')](function(_0x290cd4){if(_0x290cd4){_0x3896e6=_0x290cd4;_0xad8b52[_0xc4b6('0x2f')]=_[_0xc4b6('0x32')](db[_0xc4b6('0x4b')]['rawAttributes']);_0xad8b52[_0xc4b6('0x31')]=_[_0xc4b6('0x32')](_0x41b113['query']);_0xad8b52[_0xc4b6('0x3a')]=_[_0xc4b6('0x33')](_0xad8b52['model'],_0xad8b52['query']);_0x1f34d6[_0xc4b6('0x35')]=_['intersection'](_0xad8b52['model'],qs[_0xc4b6('0x34')](_0x41b113[_0xc4b6('0x31')]['fields']));_0x1f34d6[_0xc4b6('0x35')]=_0x1f34d6[_0xc4b6('0x35')]['length']?_0x1f34d6[_0xc4b6('0x35')]:_0xad8b52[_0xc4b6('0x2f')];_0x1f34d6[_0xc4b6('0x38')]=qs[_0xc4b6('0x39')](_0x41b113['query'][_0xc4b6('0x39')]);_0x1f34d6[_0xc4b6('0x3d')]=qs[_0xc4b6('0x3a')](_[_0xc4b6('0x3b')](_0x41b113[_0xc4b6('0x31')],_0xad8b52[_0xc4b6('0x3a')]));if(_0x41b113[_0xc4b6('0x31')][_0xc4b6('0x3c')]){_0x1f34d6[_0xc4b6('0x3d')]=_[_0xc4b6('0x3e')](_0x1f34d6[_0xc4b6('0x3d')],{'$or':_[_0xc4b6('0x30')](_0x1f34d6[_0xc4b6('0x35')],function(_0x2f0c5d){var _0x319af1={};_0x319af1[_0x2f0c5d]={'$like':'%'+_0x41b113[_0xc4b6('0x31')]['filter']+'%'};return _0x319af1;})});}_0x1f34d6=_[_0xc4b6('0x3e')]({},_0x1f34d6,_0x41b113[_0xc4b6('0x4c')]);return _0x3896e6['getConfigurations'](_0x1f34d6);}})[_0xc4b6('0x25')](function(_0x280437){if(_0x280437){_0x56d6d7=_0x280437[_0xc4b6('0x36')];if(!_0x41b113[_0xc4b6('0x31')][_0xc4b6('0x4d')](_0xc4b6('0x37'))){_0x1f34d6[_0xc4b6('0x1d')]=qs[_0xc4b6('0x1d')](_0x41b113[_0xc4b6('0x31')][_0xc4b6('0x1d')]);_0x1f34d6[_0xc4b6('0x1f')]=qs[_0xc4b6('0x1f')](_0x41b113[_0xc4b6('0x31')][_0xc4b6('0x1f')]);}return _0x3896e6[_0xc4b6('0x49')](_0x1f34d6);}})[_0xc4b6('0x25')](function(_0x16cd26){if(_0x16cd26){return _0x16cd26?{'count':_0x56d6d7,'rows':_0x16cd26}:null;}})[_0xc4b6('0x25')](respondWithResult(_0x3c61b4,null))[_0xc4b6('0x45')](handleError(_0x3c61b4,null));};exports[_0xc4b6('0x4e')]=function(_0x452cac,_0x3df53e,_0x11b241){if(_0x452cac[_0xc4b6('0x47')]['id']){delete _0x452cac[_0xc4b6('0x47')]['id'];}return db[_0xc4b6('0x2c')][_0xc4b6('0x4a')]({'where':{'id':_0x452cac[_0xc4b6('0x42')]['id']}})[_0xc4b6('0x25')](handleEntityNotFound(_0x3df53e,null))['then'](function(_0x38c984){if(_0x38c984){_0x452cac['body'][_0xc4b6('0x4f')]=_0x38c984['id'];_0x452cac[_0xc4b6('0x47')][_0xc4b6('0x50')]=integrations['getSubjects'](_0x452cac[_0xc4b6('0x47')][_0xc4b6('0x51')],_0x452cac[_0xc4b6('0x47')]['type']);_0x452cac[_0xc4b6('0x47')][_0xc4b6('0x52')]=integrations[_0xc4b6('0x53')](_0x452cac['body'][_0xc4b6('0x51')],_0x452cac[_0xc4b6('0x47')][_0xc4b6('0x2e')]);return db['FreshdeskConfiguration'][_0xc4b6('0x46')](_0x452cac[_0xc4b6('0x47')],{'include':[{'model':db['FreshdeskField'],'as':_0xc4b6('0x50')},{'model':db[_0xc4b6('0x54')],'as':_0xc4b6('0x52')}]});}return null;})[_0xc4b6('0x25')](respondWithResult(_0x3df53e,null))[_0xc4b6('0x45')](handleError(_0x3df53e,null));};exports[_0xc4b6('0x55')]=function(_0x7f1ba3,_0x276e33,_0x89be5d){var _0x3c30ee='';return db['FreshdeskAccount'][_0xc4b6('0x4a')]({'where':{'id':_0x7f1ba3[_0xc4b6('0x42')]['id']},'attributes':['id',_0xc4b6('0x56'),_0xc4b6('0x57')]})['then'](handleEntityNotFound(_0x276e33,null))[_0xc4b6('0x25')](function(_0xba7ae){if(_0xba7ae){_0x3c30ee=_0xba7ae[_0xc4b6('0x56')];var _0x3f51b7=_0x3c30ee['slice'](-0x1);if(_0x3f51b7==='/'){_0x3c30ee=_0x3c30ee['substring'](0x0,_0x3c30ee['lastIndexOf'](_0x3f51b7));}return rp({'method':'GET','uri':util['format'](_0xc4b6('0x58'),_0x3c30ee,_0xc4b6('0x59')),'headers':{'Authorization':util[_0xc4b6('0x5a')](_0xc4b6('0x5b'),new Buffer(util[_0xc4b6('0x5a')](_0xc4b6('0x5c'),_0xba7ae['apiKey']))[_0xc4b6('0x5d')](_0xc4b6('0x5e')))},'json':!![]});}})[_0xc4b6('0x25')](function(_0x1c57eb){if(_0x1c57eb){var _0x45f38f=[_0xc4b6('0x5f'),'subject',_0xc4b6('0x60'),_0xc4b6('0x61'),_0xc4b6('0x29'),_0xc4b6('0x62'),'group',_0xc4b6('0x63'),'ticket_type',_0xc4b6('0x64'),'company'];_[_0xc4b6('0x65')](_0x1c57eb,function(_0x4ef015){return _0x45f38f[_0xc4b6('0x66')](_0x4ef015[_0xc4b6('0x28')])||!_0x4ef015[_0xc4b6('0x67')]&&_0x4ef015[_0xc4b6('0x2e')]!=='custom_text'&&_0x4ef015['type']!=='custom_dropdown';});return{'count':_0x1c57eb[_0xc4b6('0x36')],'rows':_[_0xc4b6('0x30')](_0x1c57eb,function(_0x3ea8ea){return{'id':_0x3ea8ea['name'],'name':_0x3ea8ea[_0xc4b6('0x68')],'custom':!_0x3ea8ea['default'],'options':_0x3ea8ea['choices']?_['map'](_0x3ea8ea['choices'],function(_0x5df998){return{'name':_[_0xc4b6('0x69')](_0x5df998),'value':_0x5df998};}):[]};})};}})[_0xc4b6('0x25')](respondWithResult(_0x276e33,null))[_0xc4b6('0x45')](function(_0x2c2d37){var _0x3184d1=_0x7f1ba3[_0xc4b6('0x31')]['test']?0x1f4:_0x2c2d37['statusCode']||0x1f4;logger[_0xc4b6('0x26')](_0xc4b6('0x6a'),_0xc4b6('0x55'),_0x3184d1,JSON[_0xc4b6('0x6b')](_0x2c2d37));delete _0x2c2d37['name'];if(_0x3184d1===0x191){_0x3184d1=0x190;}_0x276e33[_0xc4b6('0x29')](_0x3184d1)[_0xc4b6('0x2a')](_0x7f1ba3[_0xc4b6('0x31')]['test']?{'message':_0xc4b6('0x6c'),'statusCode':_0x2c2d37['statusCode']}:_0x2c2d37);});}; \ No newline at end of file +var _0x8b2b=['moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','sendStatus','error','stack','name','send','index','FreshdeskAccount','rawAttributes','fieldName','type','model','map','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','update','getConfigurations','findOne','addConfiguration','AccountId','Subjects','channel','FreshdeskConfiguration','FreshdeskField','Descriptions','apiKey','remoteUri','lastIndexOf','GET','%s/%s','api/v2/ticket_fields','format','Basic\x20%s','toString','base64','subject','agent','description','group','source','remove','custom_dropdown','label','default','choices','capitalize','getFields','stringify','test','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','request-promise'];(function(_0x38eb23,_0x196e8b){var _0x48506a=function(_0x36edb0){while(--_0x36edb0){_0x38eb23['push'](_0x38eb23['shift']());}};_0x48506a(++_0x196e8b);}(_0x8b2b,0x1c0));var _0xb8b2=function(_0x459570,_0x231186){_0x459570=_0x459570-0x0;var _0x4c175c=_0x8b2b[_0x459570];return _0x4c175c;};'use strict';var emlformat=require(_0xb8b2('0x0'));var rimraf=require(_0xb8b2('0x1'));var zipdir=require(_0xb8b2('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb8b2('0x3'));var moment=require(_0xb8b2('0x4'));var BPromise=require(_0xb8b2('0x5'));var Mustache=require(_0xb8b2('0x6'));var util=require(_0xb8b2('0x7'));var path=require(_0xb8b2('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xb8b2('0x9'));var fs=require('fs');var fs_extra=require(_0xb8b2('0xa'));var _=require(_0xb8b2('0xb'));var squel=require(_0xb8b2('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xb8b2('0xd'));var toCsv=require(_0xb8b2('0xe'));var querystring=require(_0xb8b2('0xf'));var Papa=require(_0xb8b2('0x10'));var Redis=require(_0xb8b2('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xb8b2('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xb8b2('0x13'))(_0xb8b2('0x14'));var utils=require(_0xb8b2('0x15'));var config=require(_0xb8b2('0x16'));var licenseUtil=require(_0xb8b2('0x17'));var db=require(_0xb8b2('0x18'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x3440bf,_0x5bd724){_0x5bd724=_0x5bd724||0xcc;return function(_0x5d6dc1){if(_0x5d6dc1){return _0x3440bf['sendStatus'](_0x5bd724);}return _0x3440bf[_0xb8b2('0x19')](_0x5bd724)[_0xb8b2('0x1a')]();};}function respondWithResult(_0x48b9df,_0x175885){_0x175885=_0x175885||0xc8;return function(_0x35ce5f){if(_0x35ce5f){return _0x48b9df[_0xb8b2('0x19')](_0x175885)[_0xb8b2('0x1b')](_0x35ce5f);}};}function respondWithFilteredResult(_0x46a592,_0x5b614d){return function(_0x4b5a28){if(_0x4b5a28){var _0xda50ef=typeof _0x5b614d[_0xb8b2('0x1c')]===_0xb8b2('0x1d')&&typeof _0x5b614d[_0xb8b2('0x1e')]===_0xb8b2('0x1d');var _0x50dc12=_0x4b5a28['count'];var _0x129341=_0xda50ef?0x0:_0x5b614d[_0xb8b2('0x1c')];var _0x18661d=_0xda50ef?_0x4b5a28[_0xb8b2('0x1f')]:_0x5b614d['offset']+_0x5b614d[_0xb8b2('0x1e')];var _0x913200;if(_0x18661d>=_0x50dc12){_0x18661d=_0x50dc12;_0x913200=0xc8;}else{_0x913200=0xce;}_0x46a592[_0xb8b2('0x19')](_0x913200);return _0x46a592[_0xb8b2('0x20')](_0xb8b2('0x21'),_0x129341+'-'+_0x18661d+'/'+_0x50dc12)[_0xb8b2('0x1b')](_0x4b5a28);}return null;};}function patchUpdates(_0x34ca46){return function(_0x4c1a22){try{jsonpatch[_0xb8b2('0x22')](_0x4c1a22,_0x34ca46,!![]);}catch(_0x28a2b5){return BPromise[_0xb8b2('0x23')](_0x28a2b5);}return _0x4c1a22[_0xb8b2('0x24')]();};}function saveUpdates(_0x316d3c,_0x5a0a43){return function(_0xe3b3c){if(_0xe3b3c){return _0xe3b3c['update'](_0x316d3c)[_0xb8b2('0x25')](function(_0x8239a7){return _0x8239a7;});}return null;};}function removeEntity(_0x2b40f8,_0x20082f){return function(_0x5dc876){if(_0x5dc876){return _0x5dc876[_0xb8b2('0x26')]()[_0xb8b2('0x25')](function(){_0x2b40f8[_0xb8b2('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x49c5b1,_0x517c2a){return function(_0x585d5b){if(!_0x585d5b){_0x49c5b1[_0xb8b2('0x27')](0x194);}return _0x585d5b;};}function handleError(_0x10d8f3,_0x3bdb27){_0x3bdb27=_0x3bdb27||0x1f4;return function(_0x3b611b){logger[_0xb8b2('0x28')](_0x3b611b[_0xb8b2('0x29')]);if(_0x3b611b[_0xb8b2('0x2a')]){delete _0x3b611b[_0xb8b2('0x2a')];}_0x10d8f3[_0xb8b2('0x19')](_0x3bdb27)[_0xb8b2('0x2b')](_0x3b611b);};}exports[_0xb8b2('0x2c')]=function(_0x6ae308,_0x140b18){var _0xeb28c8={},_0x396fb3={},_0x234a63={'count':0x0,'rows':[]};var _0x3f9dc8=_['map'](db[_0xb8b2('0x2d')][_0xb8b2('0x2e')],function(_0x42b97f){return{'name':_0x42b97f[_0xb8b2('0x2f')],'type':_0x42b97f[_0xb8b2('0x30')]['key']};});_0x396fb3[_0xb8b2('0x31')]=_[_0xb8b2('0x32')](_0x3f9dc8,_0xb8b2('0x2a'));_0x396fb3['query']=_[_0xb8b2('0x33')](_0x6ae308[_0xb8b2('0x34')]);_0x396fb3['filters']=_[_0xb8b2('0x35')](_0x396fb3[_0xb8b2('0x31')],_0x396fb3[_0xb8b2('0x34')]);_0xeb28c8[_0xb8b2('0x36')]=_[_0xb8b2('0x35')](_0x396fb3[_0xb8b2('0x31')],qs[_0xb8b2('0x37')](_0x6ae308[_0xb8b2('0x34')][_0xb8b2('0x37')]));_0xeb28c8[_0xb8b2('0x36')]=_0xeb28c8['attributes'][_0xb8b2('0x38')]?_0xeb28c8[_0xb8b2('0x36')]:_0x396fb3['model'];if(!_0x6ae308[_0xb8b2('0x34')][_0xb8b2('0x39')](_0xb8b2('0x3a'))){_0xeb28c8[_0xb8b2('0x1e')]=qs[_0xb8b2('0x1e')](_0x6ae308[_0xb8b2('0x34')][_0xb8b2('0x1e')]);_0xeb28c8[_0xb8b2('0x1c')]=qs[_0xb8b2('0x1c')](_0x6ae308[_0xb8b2('0x34')][_0xb8b2('0x1c')]);}_0xeb28c8[_0xb8b2('0x3b')]=qs[_0xb8b2('0x3c')](_0x6ae308[_0xb8b2('0x34')][_0xb8b2('0x3c')]);_0xeb28c8[_0xb8b2('0x3d')]=qs[_0xb8b2('0x3e')](_[_0xb8b2('0x3f')](_0x6ae308[_0xb8b2('0x34')],_0x396fb3[_0xb8b2('0x3e')]),_0x3f9dc8);if(_0x6ae308[_0xb8b2('0x34')][_0xb8b2('0x40')]){_0xeb28c8[_0xb8b2('0x3d')]=_[_0xb8b2('0x41')](_0xeb28c8[_0xb8b2('0x3d')],{'$or':_[_0xb8b2('0x32')](_0x3f9dc8,function(_0x1ec12b){if(_0x1ec12b['type']!=='VIRTUAL'){var _0x79d89b={};_0x79d89b[_0x1ec12b['name']]={'$like':'%'+_0x6ae308[_0xb8b2('0x34')][_0xb8b2('0x40')]+'%'};return _0x79d89b;}})});}_0xeb28c8=_[_0xb8b2('0x41')]({},_0xeb28c8,_0x6ae308[_0xb8b2('0x42')]);var _0x55566a={'where':_0xeb28c8['where']};return db[_0xb8b2('0x2d')][_0xb8b2('0x1f')](_0x55566a)[_0xb8b2('0x25')](function(_0x20c93f){_0x234a63[_0xb8b2('0x1f')]=_0x20c93f;if(_0x6ae308['query'][_0xb8b2('0x43')]){_0xeb28c8[_0xb8b2('0x44')]=[{'all':!![]}];}return db[_0xb8b2('0x2d')][_0xb8b2('0x45')](_0xeb28c8);})[_0xb8b2('0x25')](function(_0x509ff1){_0x234a63[_0xb8b2('0x46')]=_0x509ff1;return _0x234a63;})[_0xb8b2('0x25')](respondWithFilteredResult(_0x140b18,_0xeb28c8))[_0xb8b2('0x47')](handleError(_0x140b18,null));};exports[_0xb8b2('0x48')]=function(_0x1890fc,_0x1f0ed2){var _0x37370a={'raw':![],'where':{'id':_0x1890fc[_0xb8b2('0x49')]['id']}},_0x339c2e={};_0x339c2e[_0xb8b2('0x31')]=_['keys'](db['FreshdeskAccount'][_0xb8b2('0x2e')]);_0x339c2e['query']=_[_0xb8b2('0x33')](_0x1890fc[_0xb8b2('0x34')]);_0x339c2e[_0xb8b2('0x3e')]=_[_0xb8b2('0x35')](_0x339c2e[_0xb8b2('0x31')],_0x339c2e['query']);_0x37370a[_0xb8b2('0x36')]=_[_0xb8b2('0x35')](_0x339c2e[_0xb8b2('0x31')],qs[_0xb8b2('0x37')](_0x1890fc[_0xb8b2('0x34')][_0xb8b2('0x37')]));_0x37370a[_0xb8b2('0x36')]=_0x37370a[_0xb8b2('0x36')][_0xb8b2('0x38')]?_0x37370a[_0xb8b2('0x36')]:_0x339c2e[_0xb8b2('0x31')];if(_0x1890fc['query'][_0xb8b2('0x43')]){_0x37370a[_0xb8b2('0x44')]=[{'all':!![]}];}_0x37370a=_[_0xb8b2('0x41')]({},_0x37370a,_0x1890fc[_0xb8b2('0x42')]);return db[_0xb8b2('0x2d')][_0xb8b2('0x4a')](_0x37370a)[_0xb8b2('0x25')](handleEntityNotFound(_0x1f0ed2,null))[_0xb8b2('0x25')](respondWithResult(_0x1f0ed2,null))[_0xb8b2('0x47')](handleError(_0x1f0ed2,null));};exports[_0xb8b2('0x4b')]=function(_0x2f6795,_0xcc853b){return db[_0xb8b2('0x2d')]['create'](_0x2f6795[_0xb8b2('0x4c')],{})[_0xb8b2('0x25')](respondWithResult(_0xcc853b,0xc9))['catch'](handleError(_0xcc853b,null));};exports[_0xb8b2('0x4d')]=function(_0x2b9c9a,_0x3d94d1){if(_0x2b9c9a['body']['id']){delete _0x2b9c9a[_0xb8b2('0x4c')]['id'];}return db[_0xb8b2('0x2d')][_0xb8b2('0x4a')]({'where':{'id':_0x2b9c9a[_0xb8b2('0x49')]['id']}})[_0xb8b2('0x25')](handleEntityNotFound(_0x3d94d1,null))[_0xb8b2('0x25')](saveUpdates(_0x2b9c9a[_0xb8b2('0x4c')],null))[_0xb8b2('0x25')](respondWithResult(_0x3d94d1,null))[_0xb8b2('0x47')](handleError(_0x3d94d1,null));};exports[_0xb8b2('0x26')]=function(_0x79ae95,_0x4434b3){return db[_0xb8b2('0x2d')][_0xb8b2('0x4a')]({'where':{'id':_0x79ae95[_0xb8b2('0x49')]['id']}})['then'](handleEntityNotFound(_0x4434b3,null))['then'](removeEntity(_0x4434b3,null))[_0xb8b2('0x47')](handleError(_0x4434b3,null));};exports[_0xb8b2('0x4e')]=function(_0x5d8cbd,_0x765436,_0x14f67e){var _0x474859={};var _0x58c807={};var _0x422584;var _0x3a07b5;return db[_0xb8b2('0x2d')][_0xb8b2('0x4f')]({'where':{'id':_0x5d8cbd[_0xb8b2('0x49')]['id']}})[_0xb8b2('0x25')](handleEntityNotFound(_0x765436,null))[_0xb8b2('0x25')](function(_0x25ad26){if(_0x25ad26){_0x422584=_0x25ad26;_0x58c807['model']=_[_0xb8b2('0x33')](db['FreshdeskConfiguration'][_0xb8b2('0x2e')]);_0x58c807[_0xb8b2('0x34')]=_[_0xb8b2('0x33')](_0x5d8cbd[_0xb8b2('0x34')]);_0x58c807[_0xb8b2('0x3e')]=_[_0xb8b2('0x35')](_0x58c807[_0xb8b2('0x31')],_0x58c807['query']);_0x474859[_0xb8b2('0x36')]=_[_0xb8b2('0x35')](_0x58c807[_0xb8b2('0x31')],qs[_0xb8b2('0x37')](_0x5d8cbd[_0xb8b2('0x34')]['fields']));_0x474859[_0xb8b2('0x36')]=_0x474859['attributes']['length']?_0x474859[_0xb8b2('0x36')]:_0x58c807[_0xb8b2('0x31')];_0x474859[_0xb8b2('0x3b')]=qs[_0xb8b2('0x3c')](_0x5d8cbd[_0xb8b2('0x34')][_0xb8b2('0x3c')]);_0x474859[_0xb8b2('0x3d')]=qs[_0xb8b2('0x3e')](_[_0xb8b2('0x3f')](_0x5d8cbd[_0xb8b2('0x34')],_0x58c807[_0xb8b2('0x3e')]));if(_0x5d8cbd[_0xb8b2('0x34')]['filter']){_0x474859[_0xb8b2('0x3d')]=_[_0xb8b2('0x41')](_0x474859['where'],{'$or':_[_0xb8b2('0x32')](_0x474859[_0xb8b2('0x36')],function(_0x3be2b8){var _0xc8aed5={};_0xc8aed5[_0x3be2b8]={'$like':'%'+_0x5d8cbd[_0xb8b2('0x34')]['filter']+'%'};return _0xc8aed5;})});}_0x474859=_[_0xb8b2('0x41')]({},_0x474859,_0x5d8cbd['options']);return _0x422584[_0xb8b2('0x4e')](_0x474859);}})[_0xb8b2('0x25')](function(_0x35bd1d){if(_0x35bd1d){_0x3a07b5=_0x35bd1d['length'];if(!_0x5d8cbd[_0xb8b2('0x34')][_0xb8b2('0x39')](_0xb8b2('0x3a'))){_0x474859[_0xb8b2('0x1e')]=qs[_0xb8b2('0x1e')](_0x5d8cbd['query']['limit']);_0x474859[_0xb8b2('0x1c')]=qs[_0xb8b2('0x1c')](_0x5d8cbd[_0xb8b2('0x34')][_0xb8b2('0x1c')]);}return _0x422584[_0xb8b2('0x4e')](_0x474859);}})[_0xb8b2('0x25')](function(_0x40d79b){if(_0x40d79b){return _0x40d79b?{'count':_0x3a07b5,'rows':_0x40d79b}:null;}})[_0xb8b2('0x25')](respondWithResult(_0x765436,null))['catch'](handleError(_0x765436,null));};exports[_0xb8b2('0x50')]=function(_0x4f25bb,_0x4a248b,_0x1bae0f){if(_0x4f25bb[_0xb8b2('0x4c')]['id']){delete _0x4f25bb[_0xb8b2('0x4c')]['id'];}return db[_0xb8b2('0x2d')][_0xb8b2('0x4f')]({'where':{'id':_0x4f25bb[_0xb8b2('0x49')]['id']}})[_0xb8b2('0x25')](handleEntityNotFound(_0x4a248b,null))[_0xb8b2('0x25')](function(_0x552719){if(_0x552719){_0x4f25bb[_0xb8b2('0x4c')][_0xb8b2('0x51')]=_0x552719['id'];_0x4f25bb['body'][_0xb8b2('0x52')]=integrations['getSubjects'](_0x4f25bb[_0xb8b2('0x4c')][_0xb8b2('0x53')],_0x4f25bb[_0xb8b2('0x4c')][_0xb8b2('0x30')]);_0x4f25bb[_0xb8b2('0x4c')]['Descriptions']=integrations['getDescriptions'](_0x4f25bb[_0xb8b2('0x4c')][_0xb8b2('0x53')],_0x4f25bb['body'][_0xb8b2('0x30')]);return db[_0xb8b2('0x54')][_0xb8b2('0x4b')](_0x4f25bb['body'],{'include':[{'model':db[_0xb8b2('0x55')],'as':_0xb8b2('0x52')},{'model':db['FreshdeskField'],'as':_0xb8b2('0x56')}]});}return null;})[_0xb8b2('0x25')](respondWithResult(_0x4a248b,null))['catch'](handleError(_0x4a248b,null));};exports['getFields']=function(_0x41251c,_0x1b5402,_0x2a7709){var _0x5f206d='';return db['FreshdeskAccount']['findOne']({'where':{'id':_0x41251c[_0xb8b2('0x49')]['id']},'attributes':['id','remoteUri',_0xb8b2('0x57')]})[_0xb8b2('0x25')](handleEntityNotFound(_0x1b5402,null))[_0xb8b2('0x25')](function(_0x3610d4){if(_0x3610d4){_0x5f206d=_0x3610d4[_0xb8b2('0x58')];var _0x3f5b9f=_0x5f206d['slice'](-0x1);if(_0x3f5b9f==='/'){_0x5f206d=_0x5f206d['substring'](0x0,_0x5f206d[_0xb8b2('0x59')](_0x3f5b9f));}return rp({'method':_0xb8b2('0x5a'),'uri':util['format'](_0xb8b2('0x5b'),_0x5f206d,_0xb8b2('0x5c')),'headers':{'Authorization':util[_0xb8b2('0x5d')](_0xb8b2('0x5e'),new Buffer(util[_0xb8b2('0x5d')]('%s:X',_0x3610d4[_0xb8b2('0x57')]))[_0xb8b2('0x5f')](_0xb8b2('0x60')))},'json':!![]});}})['then'](function(_0xbdc200){if(_0xbdc200){var _0x2de419=['requester',_0xb8b2('0x61'),_0xb8b2('0x62'),_0xb8b2('0x63'),_0xb8b2('0x19'),'priority',_0xb8b2('0x64'),_0xb8b2('0x65'),'ticket_type',_0xb8b2('0x64'),'company'];_[_0xb8b2('0x66')](_0xbdc200,function(_0xf719bb){return _0x2de419['includes'](_0xf719bb['name'])||!_0xf719bb['default']&&_0xf719bb['type']!=='custom_text'&&_0xf719bb['type']!==_0xb8b2('0x67');});return{'count':_0xbdc200[_0xb8b2('0x38')],'rows':_[_0xb8b2('0x32')](_0xbdc200,function(_0x4076ca){return{'id':_0x4076ca[_0xb8b2('0x2a')],'name':_0x4076ca[_0xb8b2('0x68')],'custom':!_0x4076ca[_0xb8b2('0x69')],'options':_0x4076ca[_0xb8b2('0x6a')]?_[_0xb8b2('0x32')](_0x4076ca[_0xb8b2('0x6a')],function(_0xc86c24){return{'name':_[_0xb8b2('0x6b')](_0xc86c24),'value':_0xc86c24};}):[]};})};}})['then'](respondWithResult(_0x1b5402,null))['catch'](function(_0x13413e){var _0xf2946b=_0x41251c[_0xb8b2('0x34')]['test']?0x1f4:_0x13413e['statusCode']||0x1f4;logger[_0xb8b2('0x28')]('getFields,\x20%s,\x20%s,\x20%s',_0xb8b2('0x6c'),_0xf2946b,JSON[_0xb8b2('0x6d')](_0x13413e));delete _0x13413e[_0xb8b2('0x2a')];if(_0xf2946b===0x191){_0xf2946b=0x190;}_0x1b5402[_0xb8b2('0x19')](_0xf2946b)['send'](_0x41251c[_0xb8b2('0x34')][_0xb8b2('0x6e')]?{'message':_0xb8b2('0x6f'),'statusCode':_0x13413e[_0xb8b2('0x70')]}:_0x13413e);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index c1db8c8..3dc0492 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 _0xf7d4=['../../config/logger','api','bluebird','path','rimraf','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','define','FreshdeskAccount','lodash'];(function(_0x3ea913,_0x255df2){var _0x2b4f28=function(_0x48bb25){while(--_0x48bb25){_0x3ea913['push'](_0x3ea913['shift']());}};_0x2b4f28(++_0x255df2);}(_0xf7d4,0x107));var _0x4f7d=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xf7d4[_0x4e676e];return _0x336a3c;};'use strict';var _=require(_0x4f7d('0x0'));var util=require('util');var logger=require(_0x4f7d('0x1'))(_0x4f7d('0x2'));var moment=require('moment');var BPromise=require(_0x4f7d('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4f7d('0x4'));var rimraf=require(_0x4f7d('0x5'));var config=require(_0x4f7d('0x6'));var attributes=require(_0x4f7d('0x7'));var integrations=require(_0x4f7d('0x8'));module[_0x4f7d('0x9')]=function(_0x436625,_0x3572f8){return _0x436625[_0x4f7d('0xa')](_0x4f7d('0xb'),attributes,{'tableName':'int_freshdesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0fc9=['path','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','define','FreshdeskAccount','int_freshdesk_accounts','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x167307,_0x5a60ae){var _0x550140=function(_0x5b5009){while(--_0x5b5009){_0x167307['push'](_0x167307['shift']());}};_0x550140(++_0x5a60ae);}(_0x0fc9,0x94));var _0x90fc=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x0fc9[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x90fc('0x0'));var util=require(_0x90fc('0x1'));var logger=require(_0x90fc('0x2'))(_0x90fc('0x3'));var moment=require(_0x90fc('0x4'));var BPromise=require(_0x90fc('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x90fc('0x6'));var rimraf=require('rimraf');var config=require(_0x90fc('0x7'));var attributes=require(_0x90fc('0x8'));var integrations=require(_0x90fc('0x9'));module[_0x90fc('0xa')]=function(_0x379c55,_0x939d98){return _0x379c55[_0x90fc('0xb')](_0x90fc('0xc'),attributes,{'tableName':_0x90fc('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js index 90a3dd7..fd2427a 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 _0x3f25=['../../config/logger','../../config/environment','client','http','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','GetFreshdeskAccount','FreshdeskAccount','findAll','options','attributes','limit','include','map','model','then','debug','ShowFreshdeskAccount','where','util','moment','bluebird','../../mysqldb'];(function(_0x55b608,_0x279b75){var _0x3af307=function(_0x9a794d){while(--_0x9a794d){_0x55b608['push'](_0x55b608['shift']());}};_0x3af307(++_0x279b75);}(_0x3f25,0xd5));var _0x53f2=function(_0x29e2d6,_0x561e4c){_0x29e2d6=_0x29e2d6-0x0;var _0x196ca1=_0x3f25[_0x29e2d6];return _0x196ca1;};'use strict';var _=require('lodash');var util=require(_0x53f2('0x0'));var moment=require(_0x53f2('0x1'));var BPromise=require(_0x53f2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x53f2('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x53f2('0x4'))('rpc');var config=require(_0x53f2('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x53f2('0x6')][_0x53f2('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4b678d,_0x567102,_0x40231a){return new BPromise(function(_0x4fbd09,_0x2472c1){return client['request'](_0x4b678d,_0x40231a)['then'](function(_0x3f9669){logger[_0x53f2('0x8')](_0x53f2('0x9'),_0x567102,_0x53f2('0xa'));logger['debug'](_0x53f2('0xb'),_0x567102,_0x53f2('0xa'),JSON[_0x53f2('0xc')](_0x3f9669));if(_0x3f9669['error']){if(_0x3f9669['error'][_0x53f2('0xd')]===0x1f4){logger['error'](_0x53f2('0x9'),_0x567102,_0x3f9669[_0x53f2('0xe')][_0x53f2('0xf')]);return _0x2472c1(_0x3f9669[_0x53f2('0xe')][_0x53f2('0xf')]);}logger[_0x53f2('0xe')](_0x53f2('0x9'),_0x567102,_0x3f9669['error']['message']);return _0x4fbd09(_0x3f9669['error'][_0x53f2('0xf')]);}else{logger[_0x53f2('0x8')](_0x53f2('0x9'),_0x567102,_0x53f2('0xa'));_0x4fbd09(_0x3f9669[_0x53f2('0x10')][_0x53f2('0xf')]);}})[_0x53f2('0x11')](function(_0x3f4042){logger['error'](_0x53f2('0x9'),_0x567102,_0x3f4042);_0x2472c1(_0x3f4042);});});}exports[_0x53f2('0x12')]=function(_0x31b89e){var _0xded86f=this;return new Promise(function(_0x45aefe,_0xbffbe6){return db[_0x53f2('0x13')][_0x53f2('0x14')]({'raw':_0x31b89e[_0x53f2('0x15')]?_0x31b89e[_0x53f2('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x31b89e[_0x53f2('0x15')]?_0x31b89e[_0x53f2('0x15')]['where']||null:null,'attributes':_0x31b89e['options']?_0x31b89e['options'][_0x53f2('0x16')]||null:null,'limit':_0x31b89e[_0x53f2('0x15')]?_0x31b89e[_0x53f2('0x15')][_0x53f2('0x17')]||null:null,'include':_0x31b89e['options']?_0x31b89e[_0x53f2('0x15')][_0x53f2('0x18')]?_[_0x53f2('0x19')](_0x31b89e[_0x53f2('0x15')][_0x53f2('0x18')],function(_0x34895c){return{'model':db[_0x34895c[_0x53f2('0x1a')]],'as':_0x34895c['as'],'attributes':_0x34895c['attributes'],'include':_0x34895c[_0x53f2('0x18')]?_[_0x53f2('0x19')](_0x34895c['include'],function(_0x5330ef){return{'model':db[_0x5330ef['model']],'as':_0x5330ef['as'],'attributes':_0x5330ef[_0x53f2('0x16')],'include':_0x5330ef[_0x53f2('0x18')]?_[_0x53f2('0x19')](_0x5330ef[_0x53f2('0x18')],function(_0x326a45){return{'model':db[_0x326a45['model']],'as':_0x326a45['as'],'attributes':_0x326a45[_0x53f2('0x16')]};}):[]};}):[]};}):[]:[]})[_0x53f2('0x1b')](function(_0x231e92){logger['info'](_0x53f2('0x12'),_0x31b89e);logger[_0x53f2('0x1c')](_0x53f2('0x12'),_0x31b89e,JSON[_0x53f2('0xc')](_0x231e92));_0x45aefe(_0x231e92);})[_0x53f2('0x11')](function(_0x3e0476){logger['error'](_0x53f2('0x12'),_0x3e0476[_0x53f2('0xf')],_0x31b89e);_0xbffbe6(_0xded86f[_0x53f2('0xe')](0x1f4,_0x3e0476[_0x53f2('0xf')]));});});};exports[_0x53f2('0x1d')]=function(_0x1c690f){var _0x2574c0=this;return new Promise(function(_0x36f691,_0x25f0e8){return db[_0x53f2('0x13')]['find']({'raw':_0x1c690f[_0x53f2('0x15')]?_0x1c690f['options']['raw']===undefined?!![]:![]:!![],'where':_0x1c690f[_0x53f2('0x15')]?_0x1c690f[_0x53f2('0x15')][_0x53f2('0x1e')]||null:null,'attributes':_0x1c690f[_0x53f2('0x15')]?_0x1c690f[_0x53f2('0x15')][_0x53f2('0x16')]||null:null,'include':_0x1c690f[_0x53f2('0x15')]?_0x1c690f[_0x53f2('0x15')][_0x53f2('0x18')]?_['map'](_0x1c690f[_0x53f2('0x15')][_0x53f2('0x18')],function(_0x5b82fd){return{'model':db[_0x5b82fd[_0x53f2('0x1a')]],'as':_0x5b82fd['as'],'attributes':_0x5b82fd[_0x53f2('0x16')],'include':_0x5b82fd[_0x53f2('0x18')]?_[_0x53f2('0x19')](_0x5b82fd[_0x53f2('0x18')],function(_0x57e5c7){return{'model':db[_0x57e5c7[_0x53f2('0x1a')]],'as':_0x57e5c7['as'],'attributes':_0x57e5c7[_0x53f2('0x16')],'include':_0x57e5c7[_0x53f2('0x18')]?_[_0x53f2('0x19')](_0x57e5c7[_0x53f2('0x18')],function(_0x241ef1){return{'model':db[_0x241ef1[_0x53f2('0x1a')]],'as':_0x241ef1['as'],'attributes':_0x241ef1[_0x53f2('0x16')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xe3453e){logger[_0x53f2('0x8')](_0x53f2('0x1d'),_0x1c690f);logger['debug'](_0x53f2('0x1d'),_0x1c690f,JSON[_0x53f2('0xc')](_0xe3453e));_0x36f691(_0xe3453e);})['catch'](function(_0x3628dd){logger['error']('ShowFreshdeskAccount',_0x3628dd[_0x53f2('0xf')],_0x1c690f);_0x25f0e8(_0x2574c0[_0x53f2('0xe')](0x1f4,_0x3628dd[_0x53f2('0xf')]));});});}; \ No newline at end of file +var _0xb5f6=['error','code','message','result','catch','GetFreshdeskAccount','FreshdeskAccount','findAll','options','raw','where','attributes','limit','include','map','model','ShowFreshdeskAccount','find','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','FreshdeskAccount,\x20%s,\x20%s','FreshdeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x912e82,_0x48d569){var _0x4706f9=function(_0xe4c32e){while(--_0xe4c32e){_0x912e82['push'](_0x912e82['shift']());}};_0x4706f9(++_0x48d569);}(_0xb5f6,0x12a));var _0x6b5f=function(_0x13187a,_0x2fcec4){_0x13187a=_0x13187a-0x0;var _0x65b85f=_0xb5f6[_0x13187a];return _0x65b85f;};'use strict';var _=require('lodash');var util=require(_0x6b5f('0x0'));var moment=require(_0x6b5f('0x1'));var BPromise=require(_0x6b5f('0x2'));var rs=require(_0x6b5f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6b5f('0x4'))['db'];var utils=require(_0x6b5f('0x5'));var logger=require('../../config/logger')(_0x6b5f('0x6'));var config=require(_0x6b5f('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x6b5f('0x8')][_0x6b5f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x40db17,_0x502260,_0x2d8a2b){return new BPromise(function(_0x517f26,_0xc51d45){return client[_0x6b5f('0xa')](_0x40db17,_0x2d8a2b)[_0x6b5f('0xb')](function(_0x2cbf21){logger[_0x6b5f('0xc')](_0x6b5f('0xd'),_0x502260,'request\x20sent');logger['debug'](_0x6b5f('0xe'),_0x502260,_0x6b5f('0xf'),JSON[_0x6b5f('0x10')](_0x2cbf21));if(_0x2cbf21[_0x6b5f('0x11')]){if(_0x2cbf21['error'][_0x6b5f('0x12')]===0x1f4){logger['error'](_0x6b5f('0xd'),_0x502260,_0x2cbf21[_0x6b5f('0x11')]['message']);return _0xc51d45(_0x2cbf21[_0x6b5f('0x11')][_0x6b5f('0x13')]);}logger[_0x6b5f('0x11')](_0x6b5f('0xd'),_0x502260,_0x2cbf21[_0x6b5f('0x11')][_0x6b5f('0x13')]);return _0x517f26(_0x2cbf21[_0x6b5f('0x11')][_0x6b5f('0x13')]);}else{logger[_0x6b5f('0xc')](_0x6b5f('0xd'),_0x502260,_0x6b5f('0xf'));_0x517f26(_0x2cbf21[_0x6b5f('0x14')][_0x6b5f('0x13')]);}})[_0x6b5f('0x15')](function(_0x450daf){logger['error'](_0x6b5f('0xd'),_0x502260,_0x450daf);_0xc51d45(_0x450daf);});});}exports[_0x6b5f('0x16')]=function(_0x50f816){var _0x1607b8=this;return new Promise(function(_0x7d0374,_0x5a3ba0){return db[_0x6b5f('0x17')][_0x6b5f('0x18')]({'raw':_0x50f816['options']?_0x50f816[_0x6b5f('0x19')][_0x6b5f('0x1a')]===undefined?!![]:![]:!![],'where':_0x50f816[_0x6b5f('0x19')]?_0x50f816['options'][_0x6b5f('0x1b')]||null:null,'attributes':_0x50f816[_0x6b5f('0x19')]?_0x50f816[_0x6b5f('0x19')][_0x6b5f('0x1c')]||null:null,'limit':_0x50f816[_0x6b5f('0x19')]?_0x50f816[_0x6b5f('0x19')][_0x6b5f('0x1d')]||null:null,'include':_0x50f816['options']?_0x50f816[_0x6b5f('0x19')][_0x6b5f('0x1e')]?_[_0x6b5f('0x1f')](_0x50f816[_0x6b5f('0x19')]['include'],function(_0x378a61){return{'model':db[_0x378a61['model']],'as':_0x378a61['as'],'attributes':_0x378a61[_0x6b5f('0x1c')],'include':_0x378a61[_0x6b5f('0x1e')]?_[_0x6b5f('0x1f')](_0x378a61[_0x6b5f('0x1e')],function(_0x1accf8){return{'model':db[_0x1accf8['model']],'as':_0x1accf8['as'],'attributes':_0x1accf8[_0x6b5f('0x1c')],'include':_0x1accf8['include']?_['map'](_0x1accf8[_0x6b5f('0x1e')],function(_0x1e5f50){return{'model':db[_0x1e5f50[_0x6b5f('0x20')]],'as':_0x1e5f50['as'],'attributes':_0x1e5f50[_0x6b5f('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x6b5f('0xb')](function(_0x2b8a13){logger[_0x6b5f('0xc')](_0x6b5f('0x16'),_0x50f816);logger['debug'](_0x6b5f('0x16'),_0x50f816,JSON['stringify'](_0x2b8a13));_0x7d0374(_0x2b8a13);})['catch'](function(_0x38f679){logger[_0x6b5f('0x11')](_0x6b5f('0x16'),_0x38f679['message'],_0x50f816);_0x5a3ba0(_0x1607b8[_0x6b5f('0x11')](0x1f4,_0x38f679[_0x6b5f('0x13')]));});});};exports[_0x6b5f('0x21')]=function(_0x238621){var _0x5733b1=this;return new Promise(function(_0x58a2be,_0x4e16d5){return db['FreshdeskAccount'][_0x6b5f('0x22')]({'raw':_0x238621[_0x6b5f('0x19')]?_0x238621[_0x6b5f('0x19')][_0x6b5f('0x1a')]===undefined?!![]:![]:!![],'where':_0x238621[_0x6b5f('0x19')]?_0x238621[_0x6b5f('0x19')][_0x6b5f('0x1b')]||null:null,'attributes':_0x238621[_0x6b5f('0x19')]?_0x238621[_0x6b5f('0x19')][_0x6b5f('0x1c')]||null:null,'include':_0x238621['options']?_0x238621['options']['include']?_[_0x6b5f('0x1f')](_0x238621['options']['include'],function(_0x16f01e){return{'model':db[_0x16f01e['model']],'as':_0x16f01e['as'],'attributes':_0x16f01e[_0x6b5f('0x1c')],'include':_0x16f01e['include']?_[_0x6b5f('0x1f')](_0x16f01e[_0x6b5f('0x1e')],function(_0x23b83e){return{'model':db[_0x23b83e['model']],'as':_0x23b83e['as'],'attributes':_0x23b83e['attributes'],'include':_0x23b83e[_0x6b5f('0x1e')]?_[_0x6b5f('0x1f')](_0x23b83e[_0x6b5f('0x1e')],function(_0x51a845){return{'model':db[_0x51a845[_0x6b5f('0x20')]],'as':_0x51a845['as'],'attributes':_0x51a845[_0x6b5f('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x6b5f('0xb')](function(_0x26650d){logger[_0x6b5f('0xc')](_0x6b5f('0x21'),_0x238621);logger['debug'](_0x6b5f('0x21'),_0x238621,JSON[_0x6b5f('0x10')](_0x26650d));_0x58a2be(_0x26650d);})[_0x6b5f('0x15')](function(_0x5ed4eb){logger[_0x6b5f('0x11')]('ShowFreshdeskAccount',_0x5ed4eb[_0x6b5f('0x13')],_0x238621);_0x4e16d5(_0x5733b1[_0x6b5f('0x11')](0x1f4,_0x5ed4eb[_0x6b5f('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index 0df7ca4..ed320b9 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 _0x0357=['../../config/environment','get','isAuthenticated','index','/:id','show','/:id/fields','/:id/subjects','/:id/tags','getTags','post','setTags','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0x0357,0x7c));var _0x7035=function(_0x2ad04c,_0x242b88){_0x2ad04c=_0x2ad04c-0x0;var _0x4164a8=_0x0357[_0x2ad04c];return _0x4164a8;};'use strict';var multer=require(_0x7035('0x0'));var util=require(_0x7035('0x1'));var path=require(_0x7035('0x2'));var timeout=require(_0x7035('0x3'));var express=require(_0x7035('0x4'));var router=express[_0x7035('0x5')]();var fs_extra=require(_0x7035('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x7035('0x7'));var config=require(_0x7035('0x8'));var controller=require('./intFreshdeskConfiguration.controller');router[_0x7035('0x9')]('/',auth[_0x7035('0xa')](),controller[_0x7035('0xb')]);router[_0x7035('0x9')](_0x7035('0xc'),auth[_0x7035('0xa')](),controller[_0x7035('0xd')]);router['get'](_0x7035('0xe'),auth[_0x7035('0xa')](),controller['getFields']);router['get'](_0x7035('0xf'),auth[_0x7035('0xa')](),controller['getSubjects']);router['get']('/:id/descriptions',auth[_0x7035('0xa')](),controller['getDescriptions']);router[_0x7035('0x9')](_0x7035('0x10'),auth[_0x7035('0xa')](),controller[_0x7035('0x11')]);router[_0x7035('0x12')]('/',auth[_0x7035('0xa')](),controller['create']);router['post'](_0x7035('0x10'),auth[_0x7035('0xa')](),controller[_0x7035('0x13')]);router['put'](_0x7035('0xc'),auth[_0x7035('0xa')](),controller[_0x7035('0x14')]);router['delete'](_0x7035('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x7035('0x15')]=router; \ No newline at end of file +var _0x139c=['util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','get','index','/:id','isAuthenticated','show','/:id/fields','/:id/subjects','getSubjects','/:id/tags','getTags','post','create','setTags','put','exports','multer'];(function(_0xf48d35,_0x2044f4){var _0x23522=function(_0x5defe9){while(--_0x5defe9){_0xf48d35['push'](_0xf48d35['shift']());}};_0x23522(++_0x2044f4);}(_0x139c,0x17f));var _0xc139=function(_0x3f1f31,_0x6a09ec){_0x3f1f31=_0x3f1f31-0x0;var _0x1508b5=_0x139c[_0x3f1f31];return _0x1508b5;};'use strict';var multer=require(_0xc139('0x0'));var util=require(_0xc139('0x1'));var path=require('path');var timeout=require(_0xc139('0x2'));var express=require(_0xc139('0x3'));var router=express['Router']();var fs_extra=require(_0xc139('0x4'));var auth=require(_0xc139('0x5'));var interaction=require(_0xc139('0x6'));var config=require(_0xc139('0x7'));var controller=require(_0xc139('0x8'));router[_0xc139('0x9')]('/',auth['isAuthenticated'](),controller[_0xc139('0xa')]);router[_0xc139('0x9')](_0xc139('0xb'),auth[_0xc139('0xc')](),controller[_0xc139('0xd')]);router[_0xc139('0x9')](_0xc139('0xe'),auth[_0xc139('0xc')](),controller['getFields']);router['get'](_0xc139('0xf'),auth['isAuthenticated'](),controller[_0xc139('0x10')]);router[_0xc139('0x9')]('/:id/descriptions',auth[_0xc139('0xc')](),controller['getDescriptions']);router[_0xc139('0x9')](_0xc139('0x11'),auth[_0xc139('0xc')](),controller[_0xc139('0x12')]);router[_0xc139('0x13')]('/',auth[_0xc139('0xc')](),controller[_0xc139('0x14')]);router[_0xc139('0x13')](_0xc139('0x11'),auth[_0xc139('0xc')](),controller[_0xc139('0x15')]);router[_0xc139('0x16')](_0xc139('0xb'),auth[_0xc139('0xc')](),controller['update']);router['delete']('/:id',auth[_0xc139('0xc')](),controller['destroy']);module[_0xc139('0x17')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index 59836ce..81c630d 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 _0x25a4=['sequelize','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x25a4,0x93));var _0x425a=function(_0x127a60,_0x37f33a){_0x127a60=_0x127a60-0x0;var _0xc1f6a3=_0x25a4[_0x127a60];return _0xc1f6a3;};'use strict';var Sequelize=require(_0x425a('0x0'));module[_0x425a('0x1')]={'name':{'type':Sequelize[_0x425a('0x2')]},'description':{'type':Sequelize[_0x425a('0x2')]}}; \ No newline at end of file +var _0x31e8=['STRING','sequelize','exports'];(function(_0x3af58b,_0x5ea72a){var _0x627027=function(_0x3d5b1c){while(--_0x3d5b1c){_0x3af58b['push'](_0x3af58b['shift']());}};_0x627027(++_0x5ea72a);}(_0x31e8,0xb8));var _0x831e=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x31e8[_0x19950b];return _0x3c6b41;};'use strict';var Sequelize=require(_0x831e('0x0'));module[_0x831e('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x831e('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index 5bf9ce3..e222f2a 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 _0x8d23=['../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','save','update','then','destroy','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','FreshdeskConfiguration','includeAll','include','findAll','rows','show','params','keys','length','options','catch','create','body','find','findOne','getFields','getSubjects','FreshdeskField','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs'];(function(_0x47b550,_0x55ef1e){var _0x22b260=function(_0x29effa){while(--_0x29effa){_0x47b550['push'](_0x47b550['shift']());}};_0x22b260(++_0x55ef1e);}(_0x8d23,0x1e8));var _0x38d2=function(_0x558be4,_0x1070a1){_0x558be4=_0x558be4-0x0;var _0xcebed3=_0x8d23[_0x558be4];return _0xcebed3;};'use strict';var emlformat=require(_0x38d2('0x0'));var rimraf=require(_0x38d2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x38d2('0x2'));var rp=require(_0x38d2('0x3'));var moment=require(_0x38d2('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x38d2('0x5'));var util=require(_0x38d2('0x6'));var path=require(_0x38d2('0x7'));var sox=require(_0x38d2('0x8'));var csv=require(_0x38d2('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x38d2('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x38d2('0xb'));var jsforce=require(_0x38d2('0xc'));var deskjs=require(_0x38d2('0xd'));var toCsv=require(_0x38d2('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x38d2('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x38d2('0xf'));var as=require(_0x38d2('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x38d2('0x11'))(_0x38d2('0x12'));var utils=require(_0x38d2('0x13'));var config=require(_0x38d2('0x14'));var licenseUtil=require(_0x38d2('0x15'));var db=require(_0x38d2('0x16'))['db'];function respondWithStatusCode(_0x5abe9d,_0x294a0d){_0x294a0d=_0x294a0d||0xcc;return function(_0x3859b8){if(_0x3859b8){return _0x5abe9d[_0x38d2('0x17')](_0x294a0d);}return _0x5abe9d[_0x38d2('0x18')](_0x294a0d)[_0x38d2('0x19')]();};}function respondWithResult(_0x483ef3,_0x561d5e){_0x561d5e=_0x561d5e||0xc8;return function(_0xfa46ac){if(_0xfa46ac){return _0x483ef3[_0x38d2('0x18')](_0x561d5e)[_0x38d2('0x1a')](_0xfa46ac);}};}function respondWithFilteredResult(_0x1f087e,_0x538f4c){return function(_0x300a2c){if(_0x300a2c){var _0x2cd394=typeof _0x538f4c['offset']===_0x38d2('0x1b')&&typeof _0x538f4c[_0x38d2('0x1c')]==='undefined';var _0x255eb5=_0x300a2c[_0x38d2('0x1d')];var _0xe5b0fa=_0x2cd394?0x0:_0x538f4c[_0x38d2('0x1e')];var _0x22f557=_0x2cd394?_0x300a2c['count']:_0x538f4c[_0x38d2('0x1e')]+_0x538f4c[_0x38d2('0x1c')];var _0x55ae2d;if(_0x22f557>=_0x255eb5){_0x22f557=_0x255eb5;_0x55ae2d=0xc8;}else{_0x55ae2d=0xce;}_0x1f087e[_0x38d2('0x18')](_0x55ae2d);return _0x1f087e['set'](_0x38d2('0x1f'),_0xe5b0fa+'-'+_0x22f557+'/'+_0x255eb5)['json'](_0x300a2c);}return null;};}function patchUpdates(_0x2676ad){return function(_0x3ce9c8){try{jsonpatch[_0x38d2('0x20')](_0x3ce9c8,_0x2676ad,!![]);}catch(_0x47915e){return BPromise['reject'](_0x47915e);}return _0x3ce9c8[_0x38d2('0x21')]();};}function saveUpdates(_0x398328,_0x3e71be){return function(_0x348681){if(_0x348681){return _0x348681[_0x38d2('0x22')](_0x398328)[_0x38d2('0x23')](function(_0xffbdac){return _0xffbdac;});}return null;};}function removeEntity(_0x3c5e61,_0x9f0415){return function(_0xc0122a){if(_0xc0122a){return _0xc0122a[_0x38d2('0x24')]()[_0x38d2('0x23')](function(){_0x3c5e61['status'](0xcc)[_0x38d2('0x19')]();});}};}function handleEntityNotFound(_0x37b3f2,_0x316506){return function(_0x4b9cf0){if(!_0x4b9cf0){_0x37b3f2[_0x38d2('0x17')](0x194);}return _0x4b9cf0;};}function handleError(_0x5a72f6,_0x5b0fe3){_0x5b0fe3=_0x5b0fe3||0x1f4;return function(_0x2de138){logger[_0x38d2('0x25')](_0x2de138['stack']);if(_0x2de138[_0x38d2('0x26')]){delete _0x2de138[_0x38d2('0x26')];}_0x5a72f6[_0x38d2('0x18')](_0x5b0fe3)[_0x38d2('0x27')](_0x2de138);};}exports[_0x38d2('0x28')]=function(_0x2e7767,_0x712894){var _0x50e907={},_0x47cb81={},_0xb01fda={'count':0x0,'rows':[]};var _0x1c35a9=_[_0x38d2('0x29')](db['FreshdeskConfiguration'][_0x38d2('0x2a')],function(_0x154813){return{'name':_0x154813[_0x38d2('0x2b')],'type':_0x154813[_0x38d2('0x2c')][_0x38d2('0x2d')]};});_0x47cb81[_0x38d2('0x2e')]=_[_0x38d2('0x29')](_0x1c35a9,_0x38d2('0x26'));_0x47cb81['query']=_['keys'](_0x2e7767[_0x38d2('0x2f')]);_0x47cb81[_0x38d2('0x30')]=_['intersection'](_0x47cb81[_0x38d2('0x2e')],_0x47cb81[_0x38d2('0x2f')]);_0x50e907[_0x38d2('0x31')]=_[_0x38d2('0x32')](_0x47cb81[_0x38d2('0x2e')],qs[_0x38d2('0x33')](_0x2e7767[_0x38d2('0x2f')][_0x38d2('0x33')]));_0x50e907[_0x38d2('0x31')]=_0x50e907[_0x38d2('0x31')]['length']?_0x50e907[_0x38d2('0x31')]:_0x47cb81[_0x38d2('0x2e')];if(!_0x2e7767[_0x38d2('0x2f')][_0x38d2('0x34')](_0x38d2('0x35'))){_0x50e907['limit']=qs[_0x38d2('0x1c')](_0x2e7767['query'][_0x38d2('0x1c')]);_0x50e907['offset']=qs['offset'](_0x2e7767[_0x38d2('0x2f')][_0x38d2('0x1e')]);}_0x50e907[_0x38d2('0x36')]=qs[_0x38d2('0x37')](_0x2e7767[_0x38d2('0x2f')][_0x38d2('0x37')]);_0x50e907['where']=qs[_0x38d2('0x30')](_[_0x38d2('0x38')](_0x2e7767['query'],_0x47cb81['filters']),_0x1c35a9);if(_0x2e7767['query'][_0x38d2('0x39')]){_0x50e907[_0x38d2('0x3a')]=_[_0x38d2('0x3b')](_0x50e907['where'],{'$or':_['map'](_0x1c35a9,function(_0x503ae0){if(_0x503ae0[_0x38d2('0x2c')]!==_0x38d2('0x3c')){var _0x5138c4={};_0x5138c4[_0x503ae0[_0x38d2('0x26')]]={'$like':'%'+_0x2e7767[_0x38d2('0x2f')][_0x38d2('0x39')]+'%'};return _0x5138c4;}})});}_0x50e907=_[_0x38d2('0x3b')]({},_0x50e907,_0x2e7767['options']);var _0x3f681f={'where':_0x50e907[_0x38d2('0x3a')]};return db[_0x38d2('0x3d')][_0x38d2('0x1d')](_0x3f681f)[_0x38d2('0x23')](function(_0x4e97b7){_0xb01fda[_0x38d2('0x1d')]=_0x4e97b7;if(_0x2e7767['query'][_0x38d2('0x3e')]){_0x50e907[_0x38d2('0x3f')]=[{'all':!![]}];}return db['FreshdeskConfiguration'][_0x38d2('0x40')](_0x50e907);})[_0x38d2('0x23')](function(_0x28bbd8){_0xb01fda[_0x38d2('0x41')]=_0x28bbd8;return _0xb01fda;})['then'](respondWithFilteredResult(_0x712894,_0x50e907))['catch'](handleError(_0x712894,null));};exports[_0x38d2('0x42')]=function(_0x264749,_0x154214){var _0x42f2ae={'raw':![],'where':{'id':_0x264749[_0x38d2('0x43')]['id']}},_0x480b22={};_0x480b22[_0x38d2('0x2e')]=_[_0x38d2('0x44')](db[_0x38d2('0x3d')][_0x38d2('0x2a')]);_0x480b22[_0x38d2('0x2f')]=_['keys'](_0x264749[_0x38d2('0x2f')]);_0x480b22[_0x38d2('0x30')]=_[_0x38d2('0x32')](_0x480b22['model'],_0x480b22[_0x38d2('0x2f')]);_0x42f2ae['attributes']=_['intersection'](_0x480b22[_0x38d2('0x2e')],qs[_0x38d2('0x33')](_0x264749['query'][_0x38d2('0x33')]));_0x42f2ae[_0x38d2('0x31')]=_0x42f2ae[_0x38d2('0x31')][_0x38d2('0x45')]?_0x42f2ae[_0x38d2('0x31')]:_0x480b22[_0x38d2('0x2e')];if(_0x264749[_0x38d2('0x2f')][_0x38d2('0x3e')]){_0x42f2ae[_0x38d2('0x3f')]=[{'all':!![]}];}_0x42f2ae=_['merge']({},_0x42f2ae,_0x264749[_0x38d2('0x46')]);return db[_0x38d2('0x3d')]['find'](_0x42f2ae)[_0x38d2('0x23')](handleEntityNotFound(_0x154214,null))[_0x38d2('0x23')](respondWithResult(_0x154214,null))[_0x38d2('0x47')](handleError(_0x154214,null));};exports[_0x38d2('0x48')]=function(_0x5e17d3,_0x46d400){return db['FreshdeskConfiguration']['create'](_0x5e17d3['body'],{})[_0x38d2('0x23')](respondWithResult(_0x46d400,0xc9))['catch'](handleError(_0x46d400,null));};exports[_0x38d2('0x22')]=function(_0x39f7c4,_0x418aaa){if(_0x39f7c4['body']['id']){delete _0x39f7c4[_0x38d2('0x49')]['id'];}return db[_0x38d2('0x3d')][_0x38d2('0x4a')]({'where':{'id':_0x39f7c4[_0x38d2('0x43')]['id']}})[_0x38d2('0x23')](handleEntityNotFound(_0x418aaa,null))[_0x38d2('0x23')](saveUpdates(_0x39f7c4[_0x38d2('0x49')],null))[_0x38d2('0x23')](respondWithResult(_0x418aaa,null))[_0x38d2('0x47')](handleError(_0x418aaa,null));};exports[_0x38d2('0x24')]=function(_0x31c4e7,_0x27a2d6){return db[_0x38d2('0x3d')][_0x38d2('0x4a')]({'where':{'id':_0x31c4e7[_0x38d2('0x43')]['id']}})['then'](handleEntityNotFound(_0x27a2d6,null))[_0x38d2('0x23')](removeEntity(_0x27a2d6,null))[_0x38d2('0x47')](handleError(_0x27a2d6,null));};exports['getFields']=function(_0x19bc7c,_0x55652b,_0x1fae98){var _0x42de9c={};var _0x340756={};var _0xa90e80;var _0x419e98;return db['FreshdeskConfiguration'][_0x38d2('0x4b')]({'where':{'id':_0x19bc7c[_0x38d2('0x43')]['id']}})[_0x38d2('0x23')](handleEntityNotFound(_0x55652b,null))[_0x38d2('0x23')](function(_0x3be93c){if(_0x3be93c){_0xa90e80=_0x3be93c;_0x340756[_0x38d2('0x2e')]=_[_0x38d2('0x44')](db['FreshdeskField'][_0x38d2('0x2a')]);_0x340756[_0x38d2('0x2f')]=_[_0x38d2('0x44')](_0x19bc7c[_0x38d2('0x2f')]);_0x340756[_0x38d2('0x30')]=_[_0x38d2('0x32')](_0x340756[_0x38d2('0x2e')],_0x340756[_0x38d2('0x2f')]);_0x42de9c[_0x38d2('0x31')]=_[_0x38d2('0x32')](_0x340756[_0x38d2('0x2e')],qs['fields'](_0x19bc7c[_0x38d2('0x2f')]['fields']));_0x42de9c[_0x38d2('0x31')]=_0x42de9c['attributes'][_0x38d2('0x45')]?_0x42de9c['attributes']:_0x340756[_0x38d2('0x2e')];_0x42de9c[_0x38d2('0x36')]=qs['sort'](_0x19bc7c[_0x38d2('0x2f')][_0x38d2('0x37')]);_0x42de9c[_0x38d2('0x3a')]=qs[_0x38d2('0x30')](_[_0x38d2('0x38')](_0x19bc7c[_0x38d2('0x2f')],_0x340756[_0x38d2('0x30')]));if(_0x19bc7c[_0x38d2('0x2f')]['filter']){_0x42de9c[_0x38d2('0x3a')]=_[_0x38d2('0x3b')](_0x42de9c['where'],{'$or':_[_0x38d2('0x29')](_0x42de9c[_0x38d2('0x31')],function(_0x4c25f0){var _0x181ad8={};_0x181ad8[_0x4c25f0]={'$like':'%'+_0x19bc7c[_0x38d2('0x2f')][_0x38d2('0x39')]+'%'};return _0x181ad8;})});}_0x42de9c=_[_0x38d2('0x3b')]({},_0x42de9c,_0x19bc7c[_0x38d2('0x46')]);return _0xa90e80[_0x38d2('0x4c')](_0x42de9c);}})['then'](function(_0x5aa24f){if(_0x5aa24f){_0x419e98=_0x5aa24f['length'];if(!_0x19bc7c[_0x38d2('0x2f')][_0x38d2('0x34')](_0x38d2('0x35'))){_0x42de9c[_0x38d2('0x1c')]=qs['limit'](_0x19bc7c[_0x38d2('0x2f')][_0x38d2('0x1c')]);_0x42de9c[_0x38d2('0x1e')]=qs[_0x38d2('0x1e')](_0x19bc7c[_0x38d2('0x2f')]['offset']);}return _0xa90e80['getFields'](_0x42de9c);}})[_0x38d2('0x23')](function(_0x3200e4){if(_0x3200e4){return _0x3200e4?{'count':_0x419e98,'rows':_0x3200e4}:null;}})[_0x38d2('0x23')](respondWithResult(_0x55652b,null))[_0x38d2('0x47')](handleError(_0x55652b,null));};exports[_0x38d2('0x4d')]=function(_0x3d02e6,_0x24d47f,_0x1b7ce5){var _0x36e11a={};var _0x4fee77={};var _0x21b3c;var _0x1abed3;return db[_0x38d2('0x3d')][_0x38d2('0x4b')]({'where':{'id':_0x3d02e6[_0x38d2('0x43')]['id']}})[_0x38d2('0x23')](handleEntityNotFound(_0x24d47f,null))[_0x38d2('0x23')](function(_0x156d3b){if(_0x156d3b){_0x21b3c=_0x156d3b;_0x4fee77[_0x38d2('0x2e')]=_[_0x38d2('0x44')](db[_0x38d2('0x4e')]['rawAttributes']);_0x4fee77[_0x38d2('0x2f')]=_['keys'](_0x3d02e6[_0x38d2('0x2f')]);_0x4fee77[_0x38d2('0x30')]=_['intersection'](_0x4fee77[_0x38d2('0x2e')],_0x4fee77[_0x38d2('0x2f')]);_0x36e11a[_0x38d2('0x31')]=_[_0x38d2('0x32')](_0x4fee77[_0x38d2('0x2e')],qs[_0x38d2('0x33')](_0x3d02e6[_0x38d2('0x2f')][_0x38d2('0x33')]));_0x36e11a[_0x38d2('0x31')]=_0x36e11a['attributes'][_0x38d2('0x45')]?_0x36e11a[_0x38d2('0x31')]:_0x4fee77[_0x38d2('0x2e')];_0x36e11a[_0x38d2('0x36')]=qs['sort'](_0x3d02e6['query'][_0x38d2('0x37')]);_0x36e11a['where']=qs[_0x38d2('0x30')](_[_0x38d2('0x38')](_0x3d02e6[_0x38d2('0x2f')],_0x4fee77[_0x38d2('0x30')]));if(_0x3d02e6[_0x38d2('0x2f')]['filter']){_0x36e11a['where']=_[_0x38d2('0x3b')](_0x36e11a[_0x38d2('0x3a')],{'$or':_[_0x38d2('0x29')](_0x36e11a[_0x38d2('0x31')],function(_0x310abc){var _0x1924f1={};_0x1924f1[_0x310abc]={'$like':'%'+_0x3d02e6[_0x38d2('0x2f')][_0x38d2('0x39')]+'%'};return _0x1924f1;})});}_0x36e11a=_[_0x38d2('0x3b')]({},_0x36e11a,_0x3d02e6[_0x38d2('0x46')]);return _0x21b3c['getSubjects'](_0x36e11a);}})[_0x38d2('0x23')](function(_0x16e09e){if(_0x16e09e){_0x1abed3=_0x16e09e[_0x38d2('0x45')];if(!_0x3d02e6['query'][_0x38d2('0x34')](_0x38d2('0x35'))){_0x36e11a[_0x38d2('0x1c')]=qs[_0x38d2('0x1c')](_0x3d02e6['query'][_0x38d2('0x1c')]);_0x36e11a[_0x38d2('0x1e')]=qs[_0x38d2('0x1e')](_0x3d02e6[_0x38d2('0x2f')][_0x38d2('0x1e')]);}return _0x21b3c[_0x38d2('0x4d')](_0x36e11a);}})['then'](function(_0x5cfbba){if(_0x5cfbba){return _0x5cfbba?{'count':_0x1abed3,'rows':_0x5cfbba}:null;}})[_0x38d2('0x23')](respondWithResult(_0x24d47f,null))[_0x38d2('0x47')](handleError(_0x24d47f,null));};exports[_0x38d2('0x4f')]=function(_0xfc9c89,_0x5cf1e2,_0x49ee35){var _0x1ad7ee={};var _0x2fa9a0={};var _0x5d437c;var _0x256f86;return db[_0x38d2('0x3d')][_0x38d2('0x4b')]({'where':{'id':_0xfc9c89[_0x38d2('0x43')]['id']}})['then'](handleEntityNotFound(_0x5cf1e2,null))[_0x38d2('0x23')](function(_0x18e454){if(_0x18e454){_0x5d437c=_0x18e454;_0x2fa9a0[_0x38d2('0x2e')]=_['keys'](db[_0x38d2('0x4e')][_0x38d2('0x2a')]);_0x2fa9a0[_0x38d2('0x2f')]=_[_0x38d2('0x44')](_0xfc9c89[_0x38d2('0x2f')]);_0x2fa9a0[_0x38d2('0x30')]=_['intersection'](_0x2fa9a0[_0x38d2('0x2e')],_0x2fa9a0[_0x38d2('0x2f')]);_0x1ad7ee[_0x38d2('0x31')]=_[_0x38d2('0x32')](_0x2fa9a0[_0x38d2('0x2e')],qs[_0x38d2('0x33')](_0xfc9c89[_0x38d2('0x2f')][_0x38d2('0x33')]));_0x1ad7ee[_0x38d2('0x31')]=_0x1ad7ee[_0x38d2('0x31')][_0x38d2('0x45')]?_0x1ad7ee['attributes']:_0x2fa9a0[_0x38d2('0x2e')];_0x1ad7ee[_0x38d2('0x36')]=qs[_0x38d2('0x37')](_0xfc9c89[_0x38d2('0x2f')][_0x38d2('0x37')]);_0x1ad7ee[_0x38d2('0x3a')]=qs[_0x38d2('0x30')](_[_0x38d2('0x38')](_0xfc9c89[_0x38d2('0x2f')],_0x2fa9a0[_0x38d2('0x30')]));if(_0xfc9c89[_0x38d2('0x2f')][_0x38d2('0x39')]){_0x1ad7ee[_0x38d2('0x3a')]=_[_0x38d2('0x3b')](_0x1ad7ee[_0x38d2('0x3a')],{'$or':_['map'](_0x1ad7ee[_0x38d2('0x31')],function(_0x55901e){var _0x2368a7={};_0x2368a7[_0x55901e]={'$like':'%'+_0xfc9c89[_0x38d2('0x2f')][_0x38d2('0x39')]+'%'};return _0x2368a7;})});}_0x1ad7ee=_[_0x38d2('0x3b')]({},_0x1ad7ee,_0xfc9c89[_0x38d2('0x46')]);return _0x5d437c[_0x38d2('0x4f')](_0x1ad7ee);}})[_0x38d2('0x23')](function(_0x4bdcbd){if(_0x4bdcbd){_0x256f86=_0x4bdcbd[_0x38d2('0x45')];if(!_0xfc9c89['query'][_0x38d2('0x34')]('nolimit')){_0x1ad7ee['limit']=qs[_0x38d2('0x1c')](_0xfc9c89['query'][_0x38d2('0x1c')]);_0x1ad7ee[_0x38d2('0x1e')]=qs[_0x38d2('0x1e')](_0xfc9c89[_0x38d2('0x2f')]['offset']);}return _0x5d437c[_0x38d2('0x4f')](_0x1ad7ee);}})[_0x38d2('0x23')](function(_0x38dea7){if(_0x38dea7){return _0x38dea7?{'count':_0x256f86,'rows':_0x38dea7}:null;}})[_0x38d2('0x23')](respondWithResult(_0x5cf1e2,null))['catch'](handleError(_0x5cf1e2,null));};exports[_0x38d2('0x50')]=function(_0x257d13,_0x3ccc76,_0x51c2a1){var _0x6a4b9e={};var _0x1f881c={};var _0x2d0158;var _0x1cc5bd;return db[_0x38d2('0x3d')][_0x38d2('0x4b')]({'where':{'id':_0x257d13['params']['id']}})[_0x38d2('0x23')](handleEntityNotFound(_0x3ccc76,null))[_0x38d2('0x23')](function(_0x4e09fc){if(_0x4e09fc){_0x2d0158=_0x4e09fc;_0x1f881c['model']=_[_0x38d2('0x44')](db[_0x38d2('0x51')]['rawAttributes']);_0x1f881c[_0x38d2('0x2f')]=_[_0x38d2('0x44')](_0x257d13[_0x38d2('0x2f')]);_0x1f881c['filters']=_[_0x38d2('0x32')](_0x1f881c[_0x38d2('0x2e')],_0x1f881c[_0x38d2('0x2f')]);_0x6a4b9e[_0x38d2('0x31')]=_[_0x38d2('0x32')](_0x1f881c[_0x38d2('0x2e')],qs[_0x38d2('0x33')](_0x257d13[_0x38d2('0x2f')][_0x38d2('0x33')]));_0x6a4b9e[_0x38d2('0x31')]=_0x6a4b9e['attributes'][_0x38d2('0x45')]?_0x6a4b9e['attributes']:_0x1f881c['model'];_0x6a4b9e['order']=qs[_0x38d2('0x37')](_0x257d13[_0x38d2('0x2f')][_0x38d2('0x37')]);_0x6a4b9e[_0x38d2('0x3a')]=qs[_0x38d2('0x30')](_[_0x38d2('0x38')](_0x257d13[_0x38d2('0x2f')],_0x1f881c[_0x38d2('0x30')]));if(_0x257d13[_0x38d2('0x2f')][_0x38d2('0x39')]){_0x6a4b9e[_0x38d2('0x3a')]=_['merge'](_0x6a4b9e[_0x38d2('0x3a')],{'$or':_[_0x38d2('0x29')](_0x6a4b9e[_0x38d2('0x31')],function(_0x342ccd){var _0x225cbf={};_0x225cbf[_0x342ccd]={'$like':'%'+_0x257d13[_0x38d2('0x2f')]['filter']+'%'};return _0x225cbf;})});}_0x6a4b9e=_['merge']({},_0x6a4b9e,_0x257d13[_0x38d2('0x46')]);return _0x2d0158['getTags'](_0x6a4b9e);}})[_0x38d2('0x23')](function(_0x21ba7f){if(_0x21ba7f){_0x1cc5bd=_0x21ba7f[_0x38d2('0x45')];if(!_0x257d13[_0x38d2('0x2f')][_0x38d2('0x34')](_0x38d2('0x35'))){_0x6a4b9e[_0x38d2('0x1c')]=qs[_0x38d2('0x1c')](_0x257d13[_0x38d2('0x2f')][_0x38d2('0x1c')]);_0x6a4b9e[_0x38d2('0x1e')]=qs[_0x38d2('0x1e')](_0x257d13['query'][_0x38d2('0x1e')]);}return _0x2d0158[_0x38d2('0x50')](_0x6a4b9e);}})[_0x38d2('0x23')](function(_0x5a6a49){if(_0x5a6a49){return _0x5a6a49?{'count':_0x1cc5bd,'rows':_0x5a6a49}:null;}})[_0x38d2('0x23')](respondWithResult(_0x3ccc76,null))[_0x38d2('0x47')](handleError(_0x3ccc76,null));};exports[_0x38d2('0x52')]=function(_0x4a7648,_0x1424f4,_0x5431c5){if(_0x4a7648[_0x38d2('0x49')]['id']){delete _0x4a7648['body']['id'];}return db['FreshdeskConfiguration']['findOne']({'where':{'id':_0x4a7648[_0x38d2('0x43')]['id']}})[_0x38d2('0x23')](handleEntityNotFound(_0x1424f4,null))[_0x38d2('0x23')](function(_0x179d1d){if(_0x179d1d){return _0x179d1d[_0x38d2('0x52')](_0x4a7648[_0x38d2('0x49')][_0x38d2('0x53')]||[]);}return null;})['then'](respondWithResult(_0x1424f4,null))[_0x38d2('0x47')](handleError(_0x1424f4,null));}; \ No newline at end of file +var _0x5f4c=['keys','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','catch','params','create','body','find','findOne','getFields','nolimit','getSubjects','FreshdeskField','getDescriptions','Tag','getTags','setTags','ids','eml-format','rimraf','zip-dir','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/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','update','then','destroy','end','error','name','send','index','map','FreshdeskConfiguration','rawAttributes','type','query'];(function(_0x2b418d,_0x1d7c48){var _0x162164=function(_0x4413fc){while(--_0x4413fc){_0x2b418d['push'](_0x2b418d['shift']());}};_0x162164(++_0x1d7c48);}(_0x5f4c,0x124));var _0xc5f4=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x5f4c[_0xa464c9];return _0x3d73c4;};'use strict';var emlformat=require(_0xc5f4('0x0'));var rimraf=require(_0xc5f4('0x1'));var zipdir=require(_0xc5f4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc5f4('0x3'));var moment=require(_0xc5f4('0x4'));var BPromise=require(_0xc5f4('0x5'));var Mustache=require(_0xc5f4('0x6'));var util=require(_0xc5f4('0x7'));var path=require(_0xc5f4('0x8'));var sox=require(_0xc5f4('0x9'));var csv=require('to-csv');var ejs=require(_0xc5f4('0xa'));var fs=require('fs');var fs_extra=require(_0xc5f4('0xb'));var _=require(_0xc5f4('0xc'));var squel=require(_0xc5f4('0xd'));var crypto=require(_0xc5f4('0xe'));var jsforce=require(_0xc5f4('0xf'));var deskjs=require(_0xc5f4('0x10'));var toCsv=require(_0xc5f4('0x11'));var querystring=require(_0xc5f4('0x12'));var Papa=require(_0xc5f4('0x13'));var Redis=require(_0xc5f4('0x14'));var authService=require(_0xc5f4('0x15'));var qs=require(_0xc5f4('0x16'));var as=require(_0xc5f4('0x17'));var hardwareService=require(_0xc5f4('0x18'));var logger=require('../../config/logger')('api');var utils=require(_0xc5f4('0x19'));var config=require(_0xc5f4('0x1a'));var licenseUtil=require(_0xc5f4('0x1b'));var db=require(_0xc5f4('0x1c'))['db'];function respondWithStatusCode(_0x10f165,_0x17679c){_0x17679c=_0x17679c||0xcc;return function(_0x2cdd50){if(_0x2cdd50){return _0x10f165[_0xc5f4('0x1d')](_0x17679c);}return _0x10f165['status'](_0x17679c)['end']();};}function respondWithResult(_0x4c9094,_0x3a2d72){_0x3a2d72=_0x3a2d72||0xc8;return function(_0x2d68f1){if(_0x2d68f1){return _0x4c9094[_0xc5f4('0x1e')](_0x3a2d72)['json'](_0x2d68f1);}};}function respondWithFilteredResult(_0x1e46ee,_0x40a7dc){return function(_0x42d029){if(_0x42d029){var _0x4022aa=typeof _0x40a7dc[_0xc5f4('0x1f')]===_0xc5f4('0x20')&&typeof _0x40a7dc[_0xc5f4('0x21')]===_0xc5f4('0x20');var _0x48ff23=_0x42d029['count'];var _0x494d47=_0x4022aa?0x0:_0x40a7dc[_0xc5f4('0x1f')];var _0xa63b1e=_0x4022aa?_0x42d029[_0xc5f4('0x22')]:_0x40a7dc[_0xc5f4('0x1f')]+_0x40a7dc[_0xc5f4('0x21')];var _0x3d95f4;if(_0xa63b1e>=_0x48ff23){_0xa63b1e=_0x48ff23;_0x3d95f4=0xc8;}else{_0x3d95f4=0xce;}_0x1e46ee[_0xc5f4('0x1e')](_0x3d95f4);return _0x1e46ee[_0xc5f4('0x23')](_0xc5f4('0x24'),_0x494d47+'-'+_0xa63b1e+'/'+_0x48ff23)[_0xc5f4('0x25')](_0x42d029);}return null;};}function patchUpdates(_0x4d86f5){return function(_0x16ae40){try{jsonpatch[_0xc5f4('0x26')](_0x16ae40,_0x4d86f5,!![]);}catch(_0x404400){return BPromise['reject'](_0x404400);}return _0x16ae40['save']();};}function saveUpdates(_0xbd0637,_0x1559b8){return function(_0x6bd991){if(_0x6bd991){return _0x6bd991[_0xc5f4('0x27')](_0xbd0637)[_0xc5f4('0x28')](function(_0x42272d){return _0x42272d;});}return null;};}function removeEntity(_0x5d1245,_0x570569){return function(_0x13de56){if(_0x13de56){return _0x13de56[_0xc5f4('0x29')]()[_0xc5f4('0x28')](function(){_0x5d1245['status'](0xcc)[_0xc5f4('0x2a')]();});}};}function handleEntityNotFound(_0x486df9,_0x42fecb){return function(_0x22b42f){if(!_0x22b42f){_0x486df9[_0xc5f4('0x1d')](0x194);}return _0x22b42f;};}function handleError(_0x45b34e,_0x25576c){_0x25576c=_0x25576c||0x1f4;return function(_0x1d00a0){logger[_0xc5f4('0x2b')](_0x1d00a0['stack']);if(_0x1d00a0[_0xc5f4('0x2c')]){delete _0x1d00a0[_0xc5f4('0x2c')];}_0x45b34e[_0xc5f4('0x1e')](_0x25576c)[_0xc5f4('0x2d')](_0x1d00a0);};}exports[_0xc5f4('0x2e')]=function(_0x6d8a94,_0x5510d1){var _0x5655a1={},_0x5365c0={},_0x4d534d={'count':0x0,'rows':[]};var _0x5a0416=_[_0xc5f4('0x2f')](db[_0xc5f4('0x30')][_0xc5f4('0x31')],function(_0x341080){return{'name':_0x341080['fieldName'],'type':_0x341080[_0xc5f4('0x32')]['key']};});_0x5365c0['model']=_['map'](_0x5a0416,_0xc5f4('0x2c'));_0x5365c0[_0xc5f4('0x33')]=_[_0xc5f4('0x34')](_0x6d8a94[_0xc5f4('0x33')]);_0x5365c0['filters']=_[_0xc5f4('0x35')](_0x5365c0[_0xc5f4('0x36')],_0x5365c0['query']);_0x5655a1['attributes']=_['intersection'](_0x5365c0[_0xc5f4('0x36')],qs[_0xc5f4('0x37')](_0x6d8a94[_0xc5f4('0x33')][_0xc5f4('0x37')]));_0x5655a1[_0xc5f4('0x38')]=_0x5655a1[_0xc5f4('0x38')][_0xc5f4('0x39')]?_0x5655a1['attributes']:_0x5365c0[_0xc5f4('0x36')];if(!_0x6d8a94[_0xc5f4('0x33')][_0xc5f4('0x3a')]('nolimit')){_0x5655a1[_0xc5f4('0x21')]=qs['limit'](_0x6d8a94[_0xc5f4('0x33')]['limit']);_0x5655a1[_0xc5f4('0x1f')]=qs[_0xc5f4('0x1f')](_0x6d8a94[_0xc5f4('0x33')][_0xc5f4('0x1f')]);}_0x5655a1[_0xc5f4('0x3b')]=qs[_0xc5f4('0x3c')](_0x6d8a94[_0xc5f4('0x33')]['sort']);_0x5655a1[_0xc5f4('0x3d')]=qs[_0xc5f4('0x3e')](_[_0xc5f4('0x3f')](_0x6d8a94[_0xc5f4('0x33')],_0x5365c0[_0xc5f4('0x3e')]),_0x5a0416);if(_0x6d8a94[_0xc5f4('0x33')]['filter']){_0x5655a1[_0xc5f4('0x3d')]=_[_0xc5f4('0x40')](_0x5655a1['where'],{'$or':_[_0xc5f4('0x2f')](_0x5a0416,function(_0x1b8077){if(_0x1b8077[_0xc5f4('0x32')]!==_0xc5f4('0x41')){var _0x14907b={};_0x14907b[_0x1b8077[_0xc5f4('0x2c')]]={'$like':'%'+_0x6d8a94['query'][_0xc5f4('0x42')]+'%'};return _0x14907b;}})});}_0x5655a1=_[_0xc5f4('0x40')]({},_0x5655a1,_0x6d8a94[_0xc5f4('0x43')]);var _0x370d82={'where':_0x5655a1[_0xc5f4('0x3d')]};return db[_0xc5f4('0x30')]['count'](_0x370d82)['then'](function(_0x108bd8){_0x4d534d[_0xc5f4('0x22')]=_0x108bd8;if(_0x6d8a94[_0xc5f4('0x33')][_0xc5f4('0x44')]){_0x5655a1[_0xc5f4('0x45')]=[{'all':!![]}];}return db[_0xc5f4('0x30')][_0xc5f4('0x46')](_0x5655a1);})[_0xc5f4('0x28')](function(_0x12cab2){_0x4d534d['rows']=_0x12cab2;return _0x4d534d;})['then'](respondWithFilteredResult(_0x5510d1,_0x5655a1))[_0xc5f4('0x47')](handleError(_0x5510d1,null));};exports['show']=function(_0x2a993f,_0x352ef9){var _0x128849={'raw':![],'where':{'id':_0x2a993f[_0xc5f4('0x48')]['id']}},_0x173c6d={};_0x173c6d[_0xc5f4('0x36')]=_[_0xc5f4('0x34')](db['FreshdeskConfiguration'][_0xc5f4('0x31')]);_0x173c6d[_0xc5f4('0x33')]=_[_0xc5f4('0x34')](_0x2a993f[_0xc5f4('0x33')]);_0x173c6d['filters']=_['intersection'](_0x173c6d['model'],_0x173c6d[_0xc5f4('0x33')]);_0x128849['attributes']=_[_0xc5f4('0x35')](_0x173c6d[_0xc5f4('0x36')],qs['fields'](_0x2a993f[_0xc5f4('0x33')]['fields']));_0x128849[_0xc5f4('0x38')]=_0x128849[_0xc5f4('0x38')][_0xc5f4('0x39')]?_0x128849[_0xc5f4('0x38')]:_0x173c6d[_0xc5f4('0x36')];if(_0x2a993f['query'][_0xc5f4('0x44')]){_0x128849[_0xc5f4('0x45')]=[{'all':!![]}];}_0x128849=_[_0xc5f4('0x40')]({},_0x128849,_0x2a993f[_0xc5f4('0x43')]);return db[_0xc5f4('0x30')]['find'](_0x128849)[_0xc5f4('0x28')](handleEntityNotFound(_0x352ef9,null))[_0xc5f4('0x28')](respondWithResult(_0x352ef9,null))[_0xc5f4('0x47')](handleError(_0x352ef9,null));};exports[_0xc5f4('0x49')]=function(_0x33ef69,_0x2e82c){return db[_0xc5f4('0x30')][_0xc5f4('0x49')](_0x33ef69[_0xc5f4('0x4a')],{})[_0xc5f4('0x28')](respondWithResult(_0x2e82c,0xc9))['catch'](handleError(_0x2e82c,null));};exports[_0xc5f4('0x27')]=function(_0x1c13d0,_0x50db24){if(_0x1c13d0['body']['id']){delete _0x1c13d0[_0xc5f4('0x4a')]['id'];}return db['FreshdeskConfiguration'][_0xc5f4('0x4b')]({'where':{'id':_0x1c13d0['params']['id']}})[_0xc5f4('0x28')](handleEntityNotFound(_0x50db24,null))[_0xc5f4('0x28')](saveUpdates(_0x1c13d0[_0xc5f4('0x4a')],null))[_0xc5f4('0x28')](respondWithResult(_0x50db24,null))[_0xc5f4('0x47')](handleError(_0x50db24,null));};exports[_0xc5f4('0x29')]=function(_0x1db15b,_0x463a7f){return db[_0xc5f4('0x30')][_0xc5f4('0x4b')]({'where':{'id':_0x1db15b[_0xc5f4('0x48')]['id']}})['then'](handleEntityNotFound(_0x463a7f,null))[_0xc5f4('0x28')](removeEntity(_0x463a7f,null))[_0xc5f4('0x47')](handleError(_0x463a7f,null));};exports['getFields']=function(_0x4abfdd,_0x5818b4,_0x34cf19){var _0x2890d5={};var _0x1ff8bd={};var _0x47fb04;var _0x3d3f22;return db[_0xc5f4('0x30')][_0xc5f4('0x4c')]({'where':{'id':_0x4abfdd[_0xc5f4('0x48')]['id']}})[_0xc5f4('0x28')](handleEntityNotFound(_0x5818b4,null))['then'](function(_0x34ff31){if(_0x34ff31){_0x47fb04=_0x34ff31;_0x1ff8bd[_0xc5f4('0x36')]=_['keys'](db['FreshdeskField'][_0xc5f4('0x31')]);_0x1ff8bd[_0xc5f4('0x33')]=_[_0xc5f4('0x34')](_0x4abfdd[_0xc5f4('0x33')]);_0x1ff8bd[_0xc5f4('0x3e')]=_[_0xc5f4('0x35')](_0x1ff8bd[_0xc5f4('0x36')],_0x1ff8bd[_0xc5f4('0x33')]);_0x2890d5[_0xc5f4('0x38')]=_[_0xc5f4('0x35')](_0x1ff8bd[_0xc5f4('0x36')],qs[_0xc5f4('0x37')](_0x4abfdd[_0xc5f4('0x33')][_0xc5f4('0x37')]));_0x2890d5['attributes']=_0x2890d5[_0xc5f4('0x38')][_0xc5f4('0x39')]?_0x2890d5[_0xc5f4('0x38')]:_0x1ff8bd[_0xc5f4('0x36')];_0x2890d5['order']=qs['sort'](_0x4abfdd[_0xc5f4('0x33')][_0xc5f4('0x3c')]);_0x2890d5[_0xc5f4('0x3d')]=qs[_0xc5f4('0x3e')](_['pick'](_0x4abfdd['query'],_0x1ff8bd[_0xc5f4('0x3e')]));if(_0x4abfdd[_0xc5f4('0x33')][_0xc5f4('0x42')]){_0x2890d5[_0xc5f4('0x3d')]=_[_0xc5f4('0x40')](_0x2890d5[_0xc5f4('0x3d')],{'$or':_['map'](_0x2890d5['attributes'],function(_0x24cafb){var _0x11c88a={};_0x11c88a[_0x24cafb]={'$like':'%'+_0x4abfdd[_0xc5f4('0x33')][_0xc5f4('0x42')]+'%'};return _0x11c88a;})});}_0x2890d5=_[_0xc5f4('0x40')]({},_0x2890d5,_0x4abfdd['options']);return _0x47fb04[_0xc5f4('0x4d')](_0x2890d5);}})[_0xc5f4('0x28')](function(_0x5d1325){if(_0x5d1325){_0x3d3f22=_0x5d1325['length'];if(!_0x4abfdd['query'][_0xc5f4('0x3a')](_0xc5f4('0x4e'))){_0x2890d5[_0xc5f4('0x21')]=qs[_0xc5f4('0x21')](_0x4abfdd['query'][_0xc5f4('0x21')]);_0x2890d5[_0xc5f4('0x1f')]=qs[_0xc5f4('0x1f')](_0x4abfdd[_0xc5f4('0x33')][_0xc5f4('0x1f')]);}return _0x47fb04[_0xc5f4('0x4d')](_0x2890d5);}})[_0xc5f4('0x28')](function(_0x43e8d9){if(_0x43e8d9){return _0x43e8d9?{'count':_0x3d3f22,'rows':_0x43e8d9}:null;}})['then'](respondWithResult(_0x5818b4,null))[_0xc5f4('0x47')](handleError(_0x5818b4,null));};exports[_0xc5f4('0x4f')]=function(_0x453430,_0x3940be,_0x41a0bd){var _0x1a20d9={};var _0x566ed0={};var _0x47915a;var _0xb69753;return db['FreshdeskConfiguration'][_0xc5f4('0x4c')]({'where':{'id':_0x453430[_0xc5f4('0x48')]['id']}})[_0xc5f4('0x28')](handleEntityNotFound(_0x3940be,null))[_0xc5f4('0x28')](function(_0x76647b){if(_0x76647b){_0x47915a=_0x76647b;_0x566ed0[_0xc5f4('0x36')]=_[_0xc5f4('0x34')](db[_0xc5f4('0x50')][_0xc5f4('0x31')]);_0x566ed0[_0xc5f4('0x33')]=_[_0xc5f4('0x34')](_0x453430[_0xc5f4('0x33')]);_0x566ed0[_0xc5f4('0x3e')]=_['intersection'](_0x566ed0[_0xc5f4('0x36')],_0x566ed0[_0xc5f4('0x33')]);_0x1a20d9[_0xc5f4('0x38')]=_[_0xc5f4('0x35')](_0x566ed0[_0xc5f4('0x36')],qs[_0xc5f4('0x37')](_0x453430[_0xc5f4('0x33')][_0xc5f4('0x37')]));_0x1a20d9[_0xc5f4('0x38')]=_0x1a20d9['attributes']['length']?_0x1a20d9[_0xc5f4('0x38')]:_0x566ed0[_0xc5f4('0x36')];_0x1a20d9[_0xc5f4('0x3b')]=qs[_0xc5f4('0x3c')](_0x453430['query']['sort']);_0x1a20d9[_0xc5f4('0x3d')]=qs[_0xc5f4('0x3e')](_[_0xc5f4('0x3f')](_0x453430[_0xc5f4('0x33')],_0x566ed0['filters']));if(_0x453430[_0xc5f4('0x33')][_0xc5f4('0x42')]){_0x1a20d9[_0xc5f4('0x3d')]=_['merge'](_0x1a20d9[_0xc5f4('0x3d')],{'$or':_[_0xc5f4('0x2f')](_0x1a20d9[_0xc5f4('0x38')],function(_0x3673b7){var _0x47fcd7={};_0x47fcd7[_0x3673b7]={'$like':'%'+_0x453430[_0xc5f4('0x33')][_0xc5f4('0x42')]+'%'};return _0x47fcd7;})});}_0x1a20d9=_[_0xc5f4('0x40')]({},_0x1a20d9,_0x453430[_0xc5f4('0x43')]);return _0x47915a['getSubjects'](_0x1a20d9);}})[_0xc5f4('0x28')](function(_0x3cd177){if(_0x3cd177){_0xb69753=_0x3cd177[_0xc5f4('0x39')];if(!_0x453430[_0xc5f4('0x33')][_0xc5f4('0x3a')](_0xc5f4('0x4e'))){_0x1a20d9['limit']=qs[_0xc5f4('0x21')](_0x453430['query'][_0xc5f4('0x21')]);_0x1a20d9[_0xc5f4('0x1f')]=qs[_0xc5f4('0x1f')](_0x453430[_0xc5f4('0x33')]['offset']);}return _0x47915a['getSubjects'](_0x1a20d9);}})[_0xc5f4('0x28')](function(_0x51e9fe){if(_0x51e9fe){return _0x51e9fe?{'count':_0xb69753,'rows':_0x51e9fe}:null;}})['then'](respondWithResult(_0x3940be,null))[_0xc5f4('0x47')](handleError(_0x3940be,null));};exports[_0xc5f4('0x51')]=function(_0x33947d,_0x5e4226,_0x2b2ac7){var _0xf438a0={};var _0x3b8d63={};var _0x3d1247;var _0x387025;return db[_0xc5f4('0x30')][_0xc5f4('0x4c')]({'where':{'id':_0x33947d[_0xc5f4('0x48')]['id']}})['then'](handleEntityNotFound(_0x5e4226,null))[_0xc5f4('0x28')](function(_0x41fb91){if(_0x41fb91){_0x3d1247=_0x41fb91;_0x3b8d63[_0xc5f4('0x36')]=_[_0xc5f4('0x34')](db['FreshdeskField'][_0xc5f4('0x31')]);_0x3b8d63[_0xc5f4('0x33')]=_[_0xc5f4('0x34')](_0x33947d['query']);_0x3b8d63[_0xc5f4('0x3e')]=_[_0xc5f4('0x35')](_0x3b8d63[_0xc5f4('0x36')],_0x3b8d63[_0xc5f4('0x33')]);_0xf438a0[_0xc5f4('0x38')]=_['intersection'](_0x3b8d63['model'],qs[_0xc5f4('0x37')](_0x33947d[_0xc5f4('0x33')]['fields']));_0xf438a0['attributes']=_0xf438a0[_0xc5f4('0x38')][_0xc5f4('0x39')]?_0xf438a0[_0xc5f4('0x38')]:_0x3b8d63[_0xc5f4('0x36')];_0xf438a0[_0xc5f4('0x3b')]=qs['sort'](_0x33947d[_0xc5f4('0x33')]['sort']);_0xf438a0['where']=qs[_0xc5f4('0x3e')](_[_0xc5f4('0x3f')](_0x33947d['query'],_0x3b8d63[_0xc5f4('0x3e')]));if(_0x33947d[_0xc5f4('0x33')][_0xc5f4('0x42')]){_0xf438a0[_0xc5f4('0x3d')]=_[_0xc5f4('0x40')](_0xf438a0[_0xc5f4('0x3d')],{'$or':_[_0xc5f4('0x2f')](_0xf438a0[_0xc5f4('0x38')],function(_0x4f9649){var _0x1bb920={};_0x1bb920[_0x4f9649]={'$like':'%'+_0x33947d[_0xc5f4('0x33')][_0xc5f4('0x42')]+'%'};return _0x1bb920;})});}_0xf438a0=_[_0xc5f4('0x40')]({},_0xf438a0,_0x33947d[_0xc5f4('0x43')]);return _0x3d1247['getDescriptions'](_0xf438a0);}})[_0xc5f4('0x28')](function(_0x19e416){if(_0x19e416){_0x387025=_0x19e416[_0xc5f4('0x39')];if(!_0x33947d[_0xc5f4('0x33')]['hasOwnProperty'](_0xc5f4('0x4e'))){_0xf438a0[_0xc5f4('0x21')]=qs[_0xc5f4('0x21')](_0x33947d[_0xc5f4('0x33')]['limit']);_0xf438a0[_0xc5f4('0x1f')]=qs[_0xc5f4('0x1f')](_0x33947d[_0xc5f4('0x33')]['offset']);}return _0x3d1247['getDescriptions'](_0xf438a0);}})['then'](function(_0x2dbccb){if(_0x2dbccb){return _0x2dbccb?{'count':_0x387025,'rows':_0x2dbccb}:null;}})[_0xc5f4('0x28')](respondWithResult(_0x5e4226,null))[_0xc5f4('0x47')](handleError(_0x5e4226,null));};exports['getTags']=function(_0x2bc0bc,_0x30f339,_0xa3bab4){var _0x6df02e={};var _0x4f6cca={};var _0x4d2e0e;var _0x5b66b3;return db[_0xc5f4('0x30')][_0xc5f4('0x4c')]({'where':{'id':_0x2bc0bc[_0xc5f4('0x48')]['id']}})[_0xc5f4('0x28')](handleEntityNotFound(_0x30f339,null))['then'](function(_0x433c6d){if(_0x433c6d){_0x4d2e0e=_0x433c6d;_0x4f6cca[_0xc5f4('0x36')]=_[_0xc5f4('0x34')](db[_0xc5f4('0x52')][_0xc5f4('0x31')]);_0x4f6cca[_0xc5f4('0x33')]=_[_0xc5f4('0x34')](_0x2bc0bc[_0xc5f4('0x33')]);_0x4f6cca[_0xc5f4('0x3e')]=_[_0xc5f4('0x35')](_0x4f6cca[_0xc5f4('0x36')],_0x4f6cca[_0xc5f4('0x33')]);_0x6df02e['attributes']=_[_0xc5f4('0x35')](_0x4f6cca[_0xc5f4('0x36')],qs['fields'](_0x2bc0bc['query']['fields']));_0x6df02e[_0xc5f4('0x38')]=_0x6df02e[_0xc5f4('0x38')][_0xc5f4('0x39')]?_0x6df02e[_0xc5f4('0x38')]:_0x4f6cca[_0xc5f4('0x36')];_0x6df02e[_0xc5f4('0x3b')]=qs['sort'](_0x2bc0bc[_0xc5f4('0x33')][_0xc5f4('0x3c')]);_0x6df02e[_0xc5f4('0x3d')]=qs[_0xc5f4('0x3e')](_['pick'](_0x2bc0bc[_0xc5f4('0x33')],_0x4f6cca[_0xc5f4('0x3e')]));if(_0x2bc0bc['query'][_0xc5f4('0x42')]){_0x6df02e[_0xc5f4('0x3d')]=_['merge'](_0x6df02e[_0xc5f4('0x3d')],{'$or':_['map'](_0x6df02e[_0xc5f4('0x38')],function(_0x5aa7af){var _0x22f2b8={};_0x22f2b8[_0x5aa7af]={'$like':'%'+_0x2bc0bc[_0xc5f4('0x33')][_0xc5f4('0x42')]+'%'};return _0x22f2b8;})});}_0x6df02e=_[_0xc5f4('0x40')]({},_0x6df02e,_0x2bc0bc[_0xc5f4('0x43')]);return _0x4d2e0e[_0xc5f4('0x53')](_0x6df02e);}})[_0xc5f4('0x28')](function(_0x391b09){if(_0x391b09){_0x5b66b3=_0x391b09['length'];if(!_0x2bc0bc[_0xc5f4('0x33')][_0xc5f4('0x3a')](_0xc5f4('0x4e'))){_0x6df02e['limit']=qs[_0xc5f4('0x21')](_0x2bc0bc[_0xc5f4('0x33')]['limit']);_0x6df02e[_0xc5f4('0x1f')]=qs[_0xc5f4('0x1f')](_0x2bc0bc[_0xc5f4('0x33')][_0xc5f4('0x1f')]);}return _0x4d2e0e[_0xc5f4('0x53')](_0x6df02e);}})['then'](function(_0x12f8c1){if(_0x12f8c1){return _0x12f8c1?{'count':_0x5b66b3,'rows':_0x12f8c1}:null;}})[_0xc5f4('0x28')](respondWithResult(_0x30f339,null))[_0xc5f4('0x47')](handleError(_0x30f339,null));};exports[_0xc5f4('0x54')]=function(_0xf7af1c,_0x3707bb,_0x67b41a){if(_0xf7af1c[_0xc5f4('0x4a')]['id']){delete _0xf7af1c[_0xc5f4('0x4a')]['id'];}return db[_0xc5f4('0x30')][_0xc5f4('0x4c')]({'where':{'id':_0xf7af1c['params']['id']}})[_0xc5f4('0x28')](handleEntityNotFound(_0x3707bb,null))[_0xc5f4('0x28')](function(_0x402934){if(_0x402934){return _0x402934[_0xc5f4('0x54')](_0xf7af1c[_0xc5f4('0x4a')][_0xc5f4('0x55')]||[]);}return null;})['then'](respondWithResult(_0x3707bb,null))['catch'](handleError(_0x3707bb,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index 866df83..124a70a 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 _0x66fe=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskConfiguration.attributes','define','int_freshdesk_configurations'];(function(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0x66fe,0x68));var _0xe66f=function(_0x8ba526,_0x506c5d){_0x8ba526=_0x8ba526-0x0;var _0x29cc3b=_0x66fe[_0x8ba526];return _0x29cc3b;};'use strict';var _=require(_0xe66f('0x0'));var util=require(_0xe66f('0x1'));var logger=require(_0xe66f('0x2'))(_0xe66f('0x3'));var moment=require(_0xe66f('0x4'));var BPromise=require(_0xe66f('0x5'));var rp=require(_0xe66f('0x6'));var fs=require('fs');var path=require(_0xe66f('0x7'));var rimraf=require(_0xe66f('0x8'));var config=require(_0xe66f('0x9'));var attributes=require(_0xe66f('0xa'));module['exports']=function(_0xcc0a4,_0x3bcced){return _0xcc0a4[_0xe66f('0xb')]('FreshdeskConfiguration',attributes,{'tableName':_0xe66f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfa99=['FreshdeskConfiguration','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskConfiguration.attributes','exports'];(function(_0x284bc3,_0x22dffe){var _0x41ac81=function(_0x47031f){while(--_0x47031f){_0x284bc3['push'](_0x284bc3['shift']());}};_0x41ac81(++_0x22dffe);}(_0xfa99,0xe5));var _0x9fa9=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xfa99[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require('lodash');var util=require(_0x9fa9('0x0'));var logger=require(_0x9fa9('0x1'))(_0x9fa9('0x2'));var moment=require(_0x9fa9('0x3'));var BPromise=require(_0x9fa9('0x4'));var rp=require(_0x9fa9('0x5'));var fs=require('fs');var path=require(_0x9fa9('0x6'));var rimraf=require(_0x9fa9('0x7'));var config=require(_0x9fa9('0x8'));var attributes=require(_0x9fa9('0x9'));module[_0x9fa9('0xa')]=function(_0x2e9566,_0x91d635){return _0x2e9566['define'](_0x9fa9('0xb'),attributes,{'tableName':'int_freshdesk_configurations','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 ce25fcb..bea0590 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 _0x1006=['then','info','FreshdeskConfiguration,\x20%s,\x20%s','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x13c5a9,_0x547d90){var _0x25f7dc=function(_0x1fe88e){while(--_0x1fe88e){_0x13c5a9['push'](_0x13c5a9['shift']());}};_0x25f7dc(++_0x547d90);}(_0x1006,0x9b));var _0x6100=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0x1006[_0x13e741];return _0x3f8bb3;};'use strict';var _=require(_0x6100('0x0'));var util=require(_0x6100('0x1'));var moment=require(_0x6100('0x2'));var BPromise=require(_0x6100('0x3'));var rs=require(_0x6100('0x4'));var fs=require('fs');var Redis=require(_0x6100('0x5'));var db=require(_0x6100('0x6'))['db'];var utils=require(_0x6100('0x7'));var logger=require(_0x6100('0x8'))(_0x6100('0x9'));var config=require(_0x6100('0xa'));var jayson=require(_0x6100('0xb'));var client=jayson['client'][_0x6100('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x184d42,_0x51adcd,_0x2c36b4){return new BPromise(function(_0x30f738,_0x343f23){return client['request'](_0x184d42,_0x2c36b4)[_0x6100('0xd')](function(_0x1b58cc){logger[_0x6100('0xe')](_0x6100('0xf'),_0x51adcd,'request\x20sent');logger[_0x6100('0x10')](_0x6100('0x11'),_0x51adcd,_0x6100('0x12'),JSON['stringify'](_0x1b58cc));if(_0x1b58cc['error']){if(_0x1b58cc[_0x6100('0x13')][_0x6100('0x14')]===0x1f4){logger[_0x6100('0x13')](_0x6100('0xf'),_0x51adcd,_0x1b58cc['error'][_0x6100('0x15')]);return _0x343f23(_0x1b58cc['error']['message']);}logger[_0x6100('0x13')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x51adcd,_0x1b58cc[_0x6100('0x13')][_0x6100('0x15')]);return _0x30f738(_0x1b58cc[_0x6100('0x13')][_0x6100('0x15')]);}else{logger[_0x6100('0xe')](_0x6100('0xf'),_0x51adcd,_0x6100('0x12'));_0x30f738(_0x1b58cc[_0x6100('0x16')][_0x6100('0x15')]);}})[_0x6100('0x17')](function(_0x506b6c){logger['error'](_0x6100('0xf'),_0x51adcd,_0x506b6c);_0x343f23(_0x506b6c);});});} \ No newline at end of file +var _0x9afa=['../../config/environment','jayson/promise','client','http','request','then','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','FreshdeskConfiguration,\x20%s,\x20%s','message','info','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x45783c,_0x49c56d){var _0x1161da=function(_0x3c5d41){while(--_0x3c5d41){_0x45783c['push'](_0x45783c['shift']());}};_0x1161da(++_0x49c56d);}(_0x9afa,0x88));var _0xa9af=function(_0x279ed5,_0x2a8e27){_0x279ed5=_0x279ed5-0x0;var _0x4a3cfa=_0x9afa[_0x279ed5];return _0x4a3cfa;};'use strict';var _=require('lodash');var util=require(_0xa9af('0x0'));var moment=require(_0xa9af('0x1'));var BPromise=require('bluebird');var rs=require(_0xa9af('0x2'));var fs=require('fs');var Redis=require(_0xa9af('0x3'));var db=require(_0xa9af('0x4'))['db'];var utils=require(_0xa9af('0x5'));var logger=require(_0xa9af('0x6'))(_0xa9af('0x7'));var config=require(_0xa9af('0x8'));var jayson=require(_0xa9af('0x9'));var client=jayson[_0xa9af('0xa')][_0xa9af('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3393b0,_0x4037ea,_0x1d7cc7){return new BPromise(function(_0x20ef40,_0x5a7b01){return client[_0xa9af('0xc')](_0x3393b0,_0x1d7cc7)[_0xa9af('0xd')](function(_0x92e1a8){logger['info']('FreshdeskConfiguration,\x20%s,\x20%s',_0x4037ea,'request\x20sent');logger[_0xa9af('0xe')](_0xa9af('0xf'),_0x4037ea,_0xa9af('0x10'),JSON[_0xa9af('0x11')](_0x92e1a8));if(_0x92e1a8[_0xa9af('0x12')]){if(_0x92e1a8[_0xa9af('0x12')][_0xa9af('0x13')]===0x1f4){logger['error'](_0xa9af('0x14'),_0x4037ea,_0x92e1a8[_0xa9af('0x12')][_0xa9af('0x15')]);return _0x5a7b01(_0x92e1a8['error'][_0xa9af('0x15')]);}logger[_0xa9af('0x12')](_0xa9af('0x14'),_0x4037ea,_0x92e1a8['error'][_0xa9af('0x15')]);return _0x20ef40(_0x92e1a8[_0xa9af('0x12')][_0xa9af('0x15')]);}else{logger[_0xa9af('0x16')](_0xa9af('0x14'),_0x4037ea,'request\x20sent');_0x20ef40(_0x92e1a8['result'][_0xa9af('0x15')]);}})[_0xa9af('0x17')](function(_0x301ffb){logger[_0xa9af('0x12')](_0xa9af('0x14'),_0x4037ea,_0x301ffb);_0x5a7b01(_0x301ffb);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index 86f03ac..fd09bee 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 _0x393f=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','show','post','create','/:id','destroy','exports','util'];(function(_0x117f3c,_0x4ccecd){var _0x493180=function(_0x8bb7ef){while(--_0x8bb7ef){_0x117f3c['push'](_0x117f3c['shift']());}};_0x493180(++_0x4ccecd);}(_0x393f,0xa9));var _0xf393=function(_0x3c8fbf,_0x92e833){_0x3c8fbf=_0x3c8fbf-0x0;var _0x5b9ef5=_0x393f[_0x3c8fbf];return _0x5b9ef5;};'use strict';var multer=require('multer');var util=require(_0xf393('0x0'));var path=require(_0xf393('0x1'));var timeout=require(_0xf393('0x2'));var express=require('express');var router=express[_0xf393('0x3')]();var fs_extra=require(_0xf393('0x4'));var auth=require(_0xf393('0x5'));var interaction=require(_0xf393('0x6'));var config=require(_0xf393('0x7'));var controller=require('./intFreshdeskField.controller');router['get']('/',auth[_0xf393('0x8')](),controller[_0xf393('0x9')]);router[_0xf393('0xa')]('/:id',auth[_0xf393('0x8')](),controller[_0xf393('0xb')]);router[_0xf393('0xc')]('/',auth[_0xf393('0x8')](),controller[_0xf393('0xd')]);router['put'](_0xf393('0xe'),auth[_0xf393('0x8')](),controller['update']);router['delete']('/:id',auth[_0xf393('0x8')](),controller[_0xf393('0xf')]);module[_0xf393('0x10')]=router; \ No newline at end of file +var _0x595c=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','create','put','delete','/:id','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x7cfc8e,_0x556614){var _0x3a2e95=function(_0x490d6f){while(--_0x490d6f){_0x7cfc8e['push'](_0x7cfc8e['shift']());}};_0x3a2e95(++_0x556614);}(_0x595c,0x118));var _0xc595=function(_0x5dc57f,_0x131db8){_0x5dc57f=_0x5dc57f-0x0;var _0x5c6b7b=_0x595c[_0x5dc57f];return _0x5c6b7b;};'use strict';var multer=require(_0xc595('0x0'));var util=require(_0xc595('0x1'));var path=require(_0xc595('0x2'));var timeout=require(_0xc595('0x3'));var express=require(_0xc595('0x4'));var router=express['Router']();var fs_extra=require(_0xc595('0x5'));var auth=require(_0xc595('0x6'));var interaction=require(_0xc595('0x7'));var config=require(_0xc595('0x8'));var controller=require('./intFreshdeskField.controller');router[_0xc595('0x9')]('/',auth[_0xc595('0xa')](),controller[_0xc595('0xb')]);router[_0xc595('0x9')]('/:id',auth[_0xc595('0xa')](),controller[_0xc595('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0xc595('0xd')]);router[_0xc595('0xe')]('/:id',auth[_0xc595('0xa')](),controller['update']);router[_0xc595('0xf')](_0xc595('0x10'),auth[_0xc595('0xa')](),controller[_0xc595('0x11')]);module[_0xc595('0x12')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index 86fb516..bd3d103 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 _0xd00a=['string','variable','customVariable','picklist','STRING','BOOLEAN','sequelize','ENUM'];(function(_0x40e695,_0x366877){var _0x55a70e=function(_0x44cc1c){while(--_0x44cc1c){_0x40e695['push'](_0x40e695['shift']());}};_0x55a70e(++_0x366877);}(_0xd00a,0x196));var _0xad00=function(_0x127ed7,_0x18c2c5){_0x127ed7=_0x127ed7-0x0;var _0x17c7bb=_0xd00a[_0x127ed7];return _0x17c7bb;};'use strict';var Sequelize=require(_0xad00('0x0'));module['exports']={'type':{'type':Sequelize[_0xad00('0x1')](_0xad00('0x2'),_0xad00('0x3'),_0xad00('0x4'),'keyValue',_0xad00('0x5')),'defaultValue':_0xad00('0x2')},'content':{'type':Sequelize[_0xad00('0x6')]},'key':{'type':Sequelize[_0xad00('0x6')]},'keyType':{'type':Sequelize[_0xad00('0x1')]('string',_0xad00('0x3'),_0xad00('0x4'))},'keyContent':{'type':Sequelize[_0xad00('0x6')]},'idField':{'type':Sequelize[_0xad00('0x6')]},'nameField':{'type':Sequelize[_0xad00('0x6')]},'customField':{'type':Sequelize[_0xad00('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x712d=['STRING','BOOLEAN','exports','ENUM','string','variable','customVariable','picklist'];(function(_0x501aaf,_0x50a951){var _0x21abe8=function(_0x5b8ac6){while(--_0x5b8ac6){_0x501aaf['push'](_0x501aaf['shift']());}};_0x21abe8(++_0x50a951);}(_0x712d,0x1ca));var _0xd712=function(_0x1a21e4,_0x57d560){_0x1a21e4=_0x1a21e4-0x0;var _0x2ada35=_0x712d[_0x1a21e4];return _0x2ada35;};'use strict';var Sequelize=require('sequelize');module[_0xd712('0x0')]={'type':{'type':Sequelize[_0xd712('0x1')](_0xd712('0x2'),_0xd712('0x3'),_0xd712('0x4'),'keyValue',_0xd712('0x5')),'defaultValue':_0xd712('0x2')},'content':{'type':Sequelize[_0xd712('0x6')]},'key':{'type':Sequelize[_0xd712('0x6')]},'keyType':{'type':Sequelize[_0xd712('0x1')](_0xd712('0x2'),_0xd712('0x3'),_0xd712('0x4'))},'keyContent':{'type':Sequelize[_0xd712('0x6')]},'idField':{'type':Sequelize[_0xd712('0x6')]},'nameField':{'type':Sequelize[_0xd712('0x6')]},'customField':{'type':Sequelize[_0xd712('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index db8487a..5b8768f 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 _0xf403=['error','name','send','index','map','FreshdeskField','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','catch','show','params','intersection','include','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','count','offset','limit','Content-Range','apply','reject','update','then','destroy'];(function(_0x3f8282,_0x11b607){var _0x50f918=function(_0x3a37de){while(--_0x3a37de){_0x3f8282['push'](_0x3f8282['shift']());}};_0x50f918(++_0x11b607);}(_0xf403,0x1d3));var _0x3f40=function(_0x1d4a9c,_0x2f062b){_0x1d4a9c=_0x1d4a9c-0x0;var _0x208424=_0xf403[_0x1d4a9c];return _0x208424;};'use strict';var emlformat=require(_0x3f40('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3f40('0x1'));var jsonpatch=require(_0x3f40('0x2'));var rp=require(_0x3f40('0x3'));var moment=require(_0x3f40('0x4'));var BPromise=require(_0x3f40('0x5'));var Mustache=require(_0x3f40('0x6'));var util=require(_0x3f40('0x7'));var path=require(_0x3f40('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x3f40('0x9'));var fs=require('fs');var fs_extra=require(_0x3f40('0xa'));var _=require(_0x3f40('0xb'));var squel=require(_0x3f40('0xc'));var crypto=require('crypto');var jsforce=require(_0x3f40('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3f40('0xe'));var Papa=require(_0x3f40('0xf'));var Redis=require(_0x3f40('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x3f40('0x11'));var hardwareService=require(_0x3f40('0x12'));var logger=require(_0x3f40('0x13'))('api');var utils=require(_0x3f40('0x14'));var config=require(_0x3f40('0x15'));var licenseUtil=require(_0x3f40('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x332635,_0x509c02){_0x509c02=_0x509c02||0xcc;return function(_0x116460){if(_0x116460){return _0x332635[_0x3f40('0x17')](_0x509c02);}return _0x332635[_0x3f40('0x18')](_0x509c02)[_0x3f40('0x19')]();};}function respondWithResult(_0x569c6e,_0x2b2bfe){_0x2b2bfe=_0x2b2bfe||0xc8;return function(_0x308e97){if(_0x308e97){return _0x569c6e[_0x3f40('0x18')](_0x2b2bfe)[_0x3f40('0x1a')](_0x308e97);}};}function respondWithFilteredResult(_0x232241,_0x4e28b9){return function(_0x2e51ed){if(_0x2e51ed){var _0x3d11c9=typeof _0x4e28b9['offset']==='undefined'&&typeof _0x4e28b9['limit']===_0x3f40('0x1b');var _0x13b950=_0x2e51ed[_0x3f40('0x1c')];var _0x131e55=_0x3d11c9?0x0:_0x4e28b9[_0x3f40('0x1d')];var _0x5b4ebc=_0x3d11c9?_0x2e51ed[_0x3f40('0x1c')]:_0x4e28b9[_0x3f40('0x1d')]+_0x4e28b9[_0x3f40('0x1e')];var _0x29405a;if(_0x5b4ebc>=_0x13b950){_0x5b4ebc=_0x13b950;_0x29405a=0xc8;}else{_0x29405a=0xce;}_0x232241[_0x3f40('0x18')](_0x29405a);return _0x232241['set'](_0x3f40('0x1f'),_0x131e55+'-'+_0x5b4ebc+'/'+_0x13b950)['json'](_0x2e51ed);}return null;};}function patchUpdates(_0x12aabf){return function(_0x32b945){try{jsonpatch[_0x3f40('0x20')](_0x32b945,_0x12aabf,!![]);}catch(_0x113293){return BPromise[_0x3f40('0x21')](_0x113293);}return _0x32b945['save']();};}function saveUpdates(_0x27f5a5,_0x379b4e){return function(_0x117823){if(_0x117823){return _0x117823[_0x3f40('0x22')](_0x27f5a5)[_0x3f40('0x23')](function(_0xa1f39d){return _0xa1f39d;});}return null;};}function removeEntity(_0x4e1f47,_0x31fc91){return function(_0x59eb32){if(_0x59eb32){return _0x59eb32[_0x3f40('0x24')]()['then'](function(){_0x4e1f47[_0x3f40('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x37b47e,_0x5ae235){return function(_0x4b206b){if(!_0x4b206b){_0x37b47e['sendStatus'](0x194);}return _0x4b206b;};}function handleError(_0x30a945,_0x26e46b){_0x26e46b=_0x26e46b||0x1f4;return function(_0x140044){logger[_0x3f40('0x25')](_0x140044['stack']);if(_0x140044[_0x3f40('0x26')]){delete _0x140044['name'];}_0x30a945[_0x3f40('0x18')](_0x26e46b)[_0x3f40('0x27')](_0x140044);};}exports[_0x3f40('0x28')]=function(_0x5e0f25,_0x287632){var _0x4b5ef7={},_0x1cab5c={},_0x5b9079={'count':0x0,'rows':[]};var _0x49057b=_[_0x3f40('0x29')](db[_0x3f40('0x2a')][_0x3f40('0x2b')],function(_0xb23186){return{'name':_0xb23186[_0x3f40('0x2c')],'type':_0xb23186[_0x3f40('0x2d')][_0x3f40('0x2e')]};});_0x1cab5c[_0x3f40('0x2f')]=_['map'](_0x49057b,_0x3f40('0x26'));_0x1cab5c[_0x3f40('0x30')]=_[_0x3f40('0x31')](_0x5e0f25[_0x3f40('0x30')]);_0x1cab5c[_0x3f40('0x32')]=_['intersection'](_0x1cab5c[_0x3f40('0x2f')],_0x1cab5c[_0x3f40('0x30')]);_0x4b5ef7[_0x3f40('0x33')]=_['intersection'](_0x1cab5c[_0x3f40('0x2f')],qs[_0x3f40('0x34')](_0x5e0f25[_0x3f40('0x30')][_0x3f40('0x34')]));_0x4b5ef7[_0x3f40('0x33')]=_0x4b5ef7[_0x3f40('0x33')][_0x3f40('0x35')]?_0x4b5ef7[_0x3f40('0x33')]:_0x1cab5c[_0x3f40('0x2f')];if(!_0x5e0f25[_0x3f40('0x30')][_0x3f40('0x36')](_0x3f40('0x37'))){_0x4b5ef7[_0x3f40('0x1e')]=qs[_0x3f40('0x1e')](_0x5e0f25[_0x3f40('0x30')][_0x3f40('0x1e')]);_0x4b5ef7[_0x3f40('0x1d')]=qs[_0x3f40('0x1d')](_0x5e0f25[_0x3f40('0x30')][_0x3f40('0x1d')]);}_0x4b5ef7[_0x3f40('0x38')]=qs[_0x3f40('0x39')](_0x5e0f25[_0x3f40('0x30')][_0x3f40('0x39')]);_0x4b5ef7[_0x3f40('0x3a')]=qs[_0x3f40('0x32')](_[_0x3f40('0x3b')](_0x5e0f25[_0x3f40('0x30')],_0x1cab5c[_0x3f40('0x32')]),_0x49057b);if(_0x5e0f25[_0x3f40('0x30')]['filter']){_0x4b5ef7['where']=_[_0x3f40('0x3c')](_0x4b5ef7[_0x3f40('0x3a')],{'$or':_[_0x3f40('0x29')](_0x49057b,function(_0x4778ec){if(_0x4778ec[_0x3f40('0x2d')]!==_0x3f40('0x3d')){var _0x1ffa33={};_0x1ffa33[_0x4778ec['name']]={'$like':'%'+_0x5e0f25[_0x3f40('0x30')]['filter']+'%'};return _0x1ffa33;}})});}_0x4b5ef7=_[_0x3f40('0x3c')]({},_0x4b5ef7,_0x5e0f25[_0x3f40('0x3e')]);var _0xec24e4={'where':_0x4b5ef7['where']};return db[_0x3f40('0x2a')][_0x3f40('0x1c')](_0xec24e4)['then'](function(_0x1eb15c){_0x5b9079[_0x3f40('0x1c')]=_0x1eb15c;if(_0x5e0f25['query'][_0x3f40('0x3f')]){_0x4b5ef7['include']=[{'all':!![]}];}return db[_0x3f40('0x2a')]['findAll'](_0x4b5ef7);})['then'](function(_0x8e89a){_0x5b9079['rows']=_0x8e89a;return _0x5b9079;})[_0x3f40('0x23')](respondWithFilteredResult(_0x287632,_0x4b5ef7))[_0x3f40('0x40')](handleError(_0x287632,null));};exports[_0x3f40('0x41')]=function(_0x460237,_0x48b65e){var _0x237c91={'raw':!![],'where':{'id':_0x460237[_0x3f40('0x42')]['id']}},_0x5b0eaa={};_0x5b0eaa[_0x3f40('0x2f')]=_[_0x3f40('0x31')](db['FreshdeskField']['rawAttributes']);_0x5b0eaa[_0x3f40('0x30')]=_[_0x3f40('0x31')](_0x460237[_0x3f40('0x30')]);_0x5b0eaa[_0x3f40('0x32')]=_[_0x3f40('0x43')](_0x5b0eaa[_0x3f40('0x2f')],_0x5b0eaa[_0x3f40('0x30')]);_0x237c91[_0x3f40('0x33')]=_['intersection'](_0x5b0eaa[_0x3f40('0x2f')],qs['fields'](_0x460237['query'][_0x3f40('0x34')]));_0x237c91[_0x3f40('0x33')]=_0x237c91[_0x3f40('0x33')][_0x3f40('0x35')]?_0x237c91[_0x3f40('0x33')]:_0x5b0eaa[_0x3f40('0x2f')];if(_0x460237[_0x3f40('0x30')][_0x3f40('0x3f')]){_0x237c91[_0x3f40('0x44')]=[{'all':!![]}];}_0x237c91=_[_0x3f40('0x3c')]({},_0x237c91,_0x460237[_0x3f40('0x3e')]);return db[_0x3f40('0x2a')][_0x3f40('0x45')](_0x237c91)[_0x3f40('0x23')](handleEntityNotFound(_0x48b65e,null))['then'](respondWithResult(_0x48b65e,null))[_0x3f40('0x40')](handleError(_0x48b65e,null));};exports['create']=function(_0x2c1fa2,_0x2f16d6){return db['FreshdeskField'][_0x3f40('0x46')](_0x2c1fa2[_0x3f40('0x47')],{})[_0x3f40('0x23')](respondWithResult(_0x2f16d6,0xc9))[_0x3f40('0x40')](handleError(_0x2f16d6,null));};exports[_0x3f40('0x22')]=function(_0x268ae4,_0x851bfc){if(_0x268ae4[_0x3f40('0x47')]['id']){delete _0x268ae4[_0x3f40('0x47')]['id'];}return db[_0x3f40('0x2a')][_0x3f40('0x45')]({'where':{'id':_0x268ae4[_0x3f40('0x42')]['id']}})[_0x3f40('0x23')](handleEntityNotFound(_0x851bfc,null))[_0x3f40('0x23')](saveUpdates(_0x268ae4[_0x3f40('0x47')],null))[_0x3f40('0x23')](respondWithResult(_0x851bfc,null))[_0x3f40('0x40')](handleError(_0x851bfc,null));};exports[_0x3f40('0x24')]=function(_0x32bd05,_0x2d7e66){return db[_0x3f40('0x2a')]['find']({'where':{'id':_0x32bd05[_0x3f40('0x42')]['id']}})[_0x3f40('0x23')](handleEntityNotFound(_0x2d7e66,null))[_0x3f40('0x23')](removeEntity(_0x2d7e66,null))[_0x3f40('0x40')](handleError(_0x2d7e66,null));}; \ No newline at end of file +var _0x0490=['FreshdeskField','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','rimraf','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','limit','undefined','count','offset','set','json','apply','save','update','then','destroy','stack','name','send','index'];(function(_0x11a106,_0x5fc559){var _0x4b3b84=function(_0x3faeba){while(--_0x3faeba){_0x11a106['push'](_0x11a106['shift']());}};_0x4b3b84(++_0x5fc559);}(_0x0490,0x147));var _0x0049=function(_0x4547f6,_0x36c67a){_0x4547f6=_0x4547f6-0x0;var _0x504bee=_0x0490[_0x4547f6];return _0x504bee;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0049('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0049('0x1'));var Mustache=require(_0x0049('0x2'));var util=require(_0x0049('0x3'));var path=require(_0x0049('0x4'));var sox=require(_0x0049('0x5'));var csv=require(_0x0049('0x6'));var ejs=require(_0x0049('0x7'));var fs=require('fs');var fs_extra=require(_0x0049('0x8'));var _=require(_0x0049('0x9'));var squel=require('squel');var crypto=require(_0x0049('0xa'));var jsforce=require(_0x0049('0xb'));var deskjs=require(_0x0049('0xc'));var toCsv=require('to-csv');var querystring=require(_0x0049('0xd'));var Papa=require(_0x0049('0xe'));var Redis=require(_0x0049('0xf'));var authService=require(_0x0049('0x10'));var qs=require(_0x0049('0x11'));var as=require(_0x0049('0x12'));var hardwareService=require(_0x0049('0x13'));var logger=require(_0x0049('0x14'))(_0x0049('0x15'));var utils=require('../../config/utils');var config=require(_0x0049('0x16'));var licenseUtil=require(_0x0049('0x17'));var db=require(_0x0049('0x18'))['db'];function respondWithStatusCode(_0x5b4d44,_0x547be9){_0x547be9=_0x547be9||0xcc;return function(_0x3cf392){if(_0x3cf392){return _0x5b4d44[_0x0049('0x19')](_0x547be9);}return _0x5b4d44[_0x0049('0x1a')](_0x547be9)[_0x0049('0x1b')]();};}function respondWithResult(_0x42dc6b,_0x5934fc){_0x5934fc=_0x5934fc||0xc8;return function(_0x3aabfb){if(_0x3aabfb){return _0x42dc6b[_0x0049('0x1a')](_0x5934fc)['json'](_0x3aabfb);}};}function respondWithFilteredResult(_0x1802f5,_0x2aace1){return function(_0x2d6b06){if(_0x2d6b06){var _0x1a62aa=typeof _0x2aace1['offset']==='undefined'&&typeof _0x2aace1[_0x0049('0x1c')]===_0x0049('0x1d');var _0x291a94=_0x2d6b06[_0x0049('0x1e')];var _0x102b40=_0x1a62aa?0x0:_0x2aace1[_0x0049('0x1f')];var _0x191a20=_0x1a62aa?_0x2d6b06[_0x0049('0x1e')]:_0x2aace1[_0x0049('0x1f')]+_0x2aace1[_0x0049('0x1c')];var _0x59c64f;if(_0x191a20>=_0x291a94){_0x191a20=_0x291a94;_0x59c64f=0xc8;}else{_0x59c64f=0xce;}_0x1802f5[_0x0049('0x1a')](_0x59c64f);return _0x1802f5[_0x0049('0x20')]('Content-Range',_0x102b40+'-'+_0x191a20+'/'+_0x291a94)[_0x0049('0x21')](_0x2d6b06);}return null;};}function patchUpdates(_0x4624ff){return function(_0x2a5ec3){try{jsonpatch[_0x0049('0x22')](_0x2a5ec3,_0x4624ff,!![]);}catch(_0x144faa){return BPromise['reject'](_0x144faa);}return _0x2a5ec3[_0x0049('0x23')]();};}function saveUpdates(_0x462ceb,_0x49c00b){return function(_0x2170d2){if(_0x2170d2){return _0x2170d2[_0x0049('0x24')](_0x462ceb)[_0x0049('0x25')](function(_0x2507e9){return _0x2507e9;});}return null;};}function removeEntity(_0x91d727,_0x2e9f44){return function(_0x223c9c){if(_0x223c9c){return _0x223c9c[_0x0049('0x26')]()[_0x0049('0x25')](function(){_0x91d727[_0x0049('0x1a')](0xcc)[_0x0049('0x1b')]();});}};}function handleEntityNotFound(_0x211e5b,_0x47b0c4){return function(_0x217a12){if(!_0x217a12){_0x211e5b[_0x0049('0x19')](0x194);}return _0x217a12;};}function handleError(_0x3ce97f,_0x118bc0){_0x118bc0=_0x118bc0||0x1f4;return function(_0x435789){logger['error'](_0x435789[_0x0049('0x27')]);if(_0x435789['name']){delete _0x435789[_0x0049('0x28')];}_0x3ce97f[_0x0049('0x1a')](_0x118bc0)[_0x0049('0x29')](_0x435789);};}exports[_0x0049('0x2a')]=function(_0x4bc932,_0x305623){var _0x402774={},_0x2407d8={},_0x2b8715={'count':0x0,'rows':[]};var _0x414029=_['map'](db[_0x0049('0x2b')][_0x0049('0x2c')],function(_0x1c8b74){return{'name':_0x1c8b74['fieldName'],'type':_0x1c8b74[_0x0049('0x2d')][_0x0049('0x2e')]};});_0x2407d8[_0x0049('0x2f')]=_[_0x0049('0x30')](_0x414029,'name');_0x2407d8[_0x0049('0x31')]=_[_0x0049('0x32')](_0x4bc932['query']);_0x2407d8[_0x0049('0x33')]=_[_0x0049('0x34')](_0x2407d8['model'],_0x2407d8[_0x0049('0x31')]);_0x402774[_0x0049('0x35')]=_[_0x0049('0x34')](_0x2407d8[_0x0049('0x2f')],qs[_0x0049('0x36')](_0x4bc932['query'][_0x0049('0x36')]));_0x402774[_0x0049('0x35')]=_0x402774[_0x0049('0x35')][_0x0049('0x37')]?_0x402774[_0x0049('0x35')]:_0x2407d8['model'];if(!_0x4bc932[_0x0049('0x31')]['hasOwnProperty'](_0x0049('0x38'))){_0x402774[_0x0049('0x1c')]=qs[_0x0049('0x1c')](_0x4bc932['query'][_0x0049('0x1c')]);_0x402774['offset']=qs[_0x0049('0x1f')](_0x4bc932[_0x0049('0x31')][_0x0049('0x1f')]);}_0x402774['order']=qs[_0x0049('0x39')](_0x4bc932[_0x0049('0x31')][_0x0049('0x39')]);_0x402774[_0x0049('0x3a')]=qs[_0x0049('0x33')](_[_0x0049('0x3b')](_0x4bc932['query'],_0x2407d8[_0x0049('0x33')]),_0x414029);if(_0x4bc932[_0x0049('0x31')]['filter']){_0x402774['where']=_[_0x0049('0x3c')](_0x402774[_0x0049('0x3a')],{'$or':_[_0x0049('0x30')](_0x414029,function(_0x10b31b){if(_0x10b31b[_0x0049('0x2d')]!==_0x0049('0x3d')){var _0x2ab147={};_0x2ab147[_0x10b31b[_0x0049('0x28')]]={'$like':'%'+_0x4bc932['query'][_0x0049('0x3e')]+'%'};return _0x2ab147;}})});}_0x402774=_[_0x0049('0x3c')]({},_0x402774,_0x4bc932[_0x0049('0x3f')]);var _0x105904={'where':_0x402774[_0x0049('0x3a')]};return db[_0x0049('0x2b')][_0x0049('0x1e')](_0x105904)[_0x0049('0x25')](function(_0x48e0c5){_0x2b8715[_0x0049('0x1e')]=_0x48e0c5;if(_0x4bc932[_0x0049('0x31')][_0x0049('0x40')]){_0x402774[_0x0049('0x41')]=[{'all':!![]}];}return db[_0x0049('0x2b')][_0x0049('0x42')](_0x402774);})[_0x0049('0x25')](function(_0x21ea1a){_0x2b8715[_0x0049('0x43')]=_0x21ea1a;return _0x2b8715;})[_0x0049('0x25')](respondWithFilteredResult(_0x305623,_0x402774))[_0x0049('0x44')](handleError(_0x305623,null));};exports[_0x0049('0x45')]=function(_0x42c073,_0x4ebc42){var _0x22e083={'raw':!![],'where':{'id':_0x42c073[_0x0049('0x46')]['id']}},_0x2818dd={};_0x2818dd['model']=_['keys'](db[_0x0049('0x2b')]['rawAttributes']);_0x2818dd[_0x0049('0x31')]=_[_0x0049('0x32')](_0x42c073[_0x0049('0x31')]);_0x2818dd[_0x0049('0x33')]=_[_0x0049('0x34')](_0x2818dd[_0x0049('0x2f')],_0x2818dd[_0x0049('0x31')]);_0x22e083[_0x0049('0x35')]=_['intersection'](_0x2818dd['model'],qs['fields'](_0x42c073[_0x0049('0x31')][_0x0049('0x36')]));_0x22e083[_0x0049('0x35')]=_0x22e083['attributes'][_0x0049('0x37')]?_0x22e083[_0x0049('0x35')]:_0x2818dd[_0x0049('0x2f')];if(_0x42c073['query']['includeAll']){_0x22e083['include']=[{'all':!![]}];}_0x22e083=_[_0x0049('0x3c')]({},_0x22e083,_0x42c073['options']);return db['FreshdeskField'][_0x0049('0x47')](_0x22e083)[_0x0049('0x25')](handleEntityNotFound(_0x4ebc42,null))[_0x0049('0x25')](respondWithResult(_0x4ebc42,null))[_0x0049('0x44')](handleError(_0x4ebc42,null));};exports[_0x0049('0x48')]=function(_0x4a9961,_0xa60a2b){return db[_0x0049('0x2b')][_0x0049('0x48')](_0x4a9961[_0x0049('0x49')],{})[_0x0049('0x25')](respondWithResult(_0xa60a2b,0xc9))[_0x0049('0x44')](handleError(_0xa60a2b,null));};exports['update']=function(_0x433ce2,_0x5e9087){if(_0x433ce2[_0x0049('0x49')]['id']){delete _0x433ce2['body']['id'];}return db[_0x0049('0x2b')][_0x0049('0x47')]({'where':{'id':_0x433ce2[_0x0049('0x46')]['id']}})[_0x0049('0x25')](handleEntityNotFound(_0x5e9087,null))[_0x0049('0x25')](saveUpdates(_0x433ce2['body'],null))[_0x0049('0x25')](respondWithResult(_0x5e9087,null))[_0x0049('0x44')](handleError(_0x5e9087,null));};exports[_0x0049('0x26')]=function(_0x108694,_0x1cd1dc){return db[_0x0049('0x2b')]['find']({'where':{'id':_0x108694[_0x0049('0x46')]['id']}})['then'](handleEntityNotFound(_0x1cd1dc,null))[_0x0049('0x25')](removeEntity(_0x1cd1dc,null))[_0x0049('0x44')](handleError(_0x1cd1dc,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index aad920e..e29afbd 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 _0x7f47=['request-promise','path','../../config/environment','./intFreshdeskField.attributes','exports','FreshdeskField','int_freshdesk_fields','idField','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x41ab51,_0x150c64){var _0x20c52e=function(_0x238e30){while(--_0x238e30){_0x41ab51['push'](_0x41ab51['shift']());}};_0x20c52e(++_0x150c64);}(_0x7f47,0x12e));var _0x77f4=function(_0x5becd6,_0x13e651){_0x5becd6=_0x5becd6-0x0;var _0x3b7b78=_0x7f47[_0x5becd6];return _0x3b7b78;};'use strict';var _=require(_0x77f4('0x0'));var util=require(_0x77f4('0x1'));var logger=require(_0x77f4('0x2'))(_0x77f4('0x3'));var moment=require(_0x77f4('0x4'));var BPromise=require(_0x77f4('0x5'));var rp=require(_0x77f4('0x6'));var fs=require('fs');var path=require(_0x77f4('0x7'));var rimraf=require('rimraf');var config=require(_0x77f4('0x8'));var attributes=require(_0x77f4('0x9'));module[_0x77f4('0xa')]=function(_0x5f0951,_0x2cfdcf){return _0x5f0951['define'](_0x77f4('0xb'),attributes,{'tableName':_0x77f4('0xc'),'paranoid':![],'indexes':[{'name':'freshdesk_unique_index','fields':[_0x77f4('0xd'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9de3=['lodash','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./intFreshdeskField.attributes','exports','define','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index'];(function(_0xcf3b3e,_0x4edd7b){var _0x48c583=function(_0x5f0cff){while(--_0x5f0cff){_0xcf3b3e['push'](_0xcf3b3e['shift']());}};_0x48c583(++_0x4edd7b);}(_0x9de3,0xea));var _0x39de=function(_0x2e5902,_0x442eaa){_0x2e5902=_0x2e5902-0x0;var _0x93d732=_0x9de3[_0x2e5902];return _0x93d732;};'use strict';var _=require(_0x39de('0x0'));var util=require('util');var logger=require(_0x39de('0x1'))(_0x39de('0x2'));var moment=require(_0x39de('0x3'));var BPromise=require('bluebird');var rp=require(_0x39de('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x39de('0x5'));var config=require(_0x39de('0x6'));var attributes=require(_0x39de('0x7'));module[_0x39de('0x8')]=function(_0x529524,_0x2e8f82){return _0x529524[_0x39de('0x9')](_0x39de('0xa'),attributes,{'tableName':_0x39de('0xb'),'paranoid':![],'indexes':[{'name':_0x39de('0xc'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.rpc.js b/server/api/intFreshdeskField/intFreshdeskField.rpc.js index 0adadc7..f009cd3 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 _0x4733=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','message','FreshdeskField,\x20%s,\x20%s','catch'];(function(_0x3a85cc,_0x444e63){var _0x964321=function(_0x200b9a){while(--_0x200b9a){_0x3a85cc['push'](_0x3a85cc['shift']());}};_0x964321(++_0x444e63);}(_0x4733,0x142));var _0x3473=function(_0x200aa5,_0x197802){_0x200aa5=_0x200aa5-0x0;var _0x458200=_0x4733[_0x200aa5];return _0x458200;};'use strict';var _=require(_0x3473('0x0'));var util=require(_0x3473('0x1'));var moment=require(_0x3473('0x2'));var BPromise=require(_0x3473('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3473('0x4'));var db=require(_0x3473('0x5'))['db'];var utils=require(_0x3473('0x6'));var logger=require(_0x3473('0x7'))('rpc');var config=require(_0x3473('0x8'));var jayson=require(_0x3473('0x9'));var client=jayson[_0x3473('0xa')][_0x3473('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x290a00,_0x2c5513,_0x681a15){return new BPromise(function(_0x3a638d,_0x166ff6){return client[_0x3473('0xc')](_0x290a00,_0x681a15)[_0x3473('0xd')](function(_0x37cd51){logger[_0x3473('0xe')]('FreshdeskField,\x20%s,\x20%s',_0x2c5513,_0x3473('0xf'));logger[_0x3473('0x10')](_0x3473('0x11'),_0x2c5513,'request\x20sent',JSON[_0x3473('0x12')](_0x37cd51));if(_0x37cd51['error']){if(_0x37cd51[_0x3473('0x13')]['code']===0x1f4){logger[_0x3473('0x13')]('FreshdeskField,\x20%s,\x20%s',_0x2c5513,_0x37cd51['error'][_0x3473('0x14')]);return _0x166ff6(_0x37cd51[_0x3473('0x13')]['message']);}logger['error']('FreshdeskField,\x20%s,\x20%s',_0x2c5513,_0x37cd51[_0x3473('0x13')]['message']);return _0x3a638d(_0x37cd51[_0x3473('0x13')]['message']);}else{logger[_0x3473('0xe')](_0x3473('0x15'),_0x2c5513,_0x3473('0xf'));_0x3a638d(_0x37cd51['result'][_0x3473('0x14')]);}})[_0x3473('0x16')](function(_0x60524){logger[_0x3473('0x13')](_0x3473('0x15'),_0x2c5513,_0x60524);_0x166ff6(_0x60524);});});} \ No newline at end of file +var _0xac9a=['info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','then','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','FreshdeskField,\x20%s,\x20%s'];(function(_0x42f009,_0x5e27b1){var _0x22a1e0=function(_0x297993){while(--_0x297993){_0x42f009['push'](_0x42f009['shift']());}};_0x22a1e0(++_0x5e27b1);}(_0xac9a,0x18a));var _0xaac9=function(_0x55c138,_0x3f7aa8){_0x55c138=_0x55c138-0x0;var _0x569b52=_0xac9a[_0x55c138];return _0x569b52;};'use strict';var _=require(_0xaac9('0x0'));var util=require(_0xaac9('0x1'));var moment=require(_0xaac9('0x2'));var BPromise=require(_0xaac9('0x3'));var rs=require(_0xaac9('0x4'));var fs=require('fs');var Redis=require(_0xaac9('0x5'));var db=require(_0xaac9('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xaac9('0x7'))('rpc');var config=require(_0xaac9('0x8'));var jayson=require(_0xaac9('0x9'));var client=jayson[_0xaac9('0xa')][_0xaac9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x232b05,_0x50b0ef,_0x3cddaa){return new BPromise(function(_0x1322bf,_0x48b2f5){return client['request'](_0x232b05,_0x3cddaa)[_0xaac9('0xc')](function(_0x3f3228){logger['info']('FreshdeskField,\x20%s,\x20%s',_0x50b0ef,'request\x20sent');logger[_0xaac9('0xd')](_0xaac9('0xe'),_0x50b0ef,_0xaac9('0xf'),JSON[_0xaac9('0x10')](_0x3f3228));if(_0x3f3228['error']){if(_0x3f3228[_0xaac9('0x11')]['code']===0x1f4){logger['error']('FreshdeskField,\x20%s,\x20%s',_0x50b0ef,_0x3f3228[_0xaac9('0x11')][_0xaac9('0x12')]);return _0x48b2f5(_0x3f3228[_0xaac9('0x11')][_0xaac9('0x12')]);}logger['error'](_0xaac9('0x13'),_0x50b0ef,_0x3f3228[_0xaac9('0x11')][_0xaac9('0x12')]);return _0x1322bf(_0x3f3228[_0xaac9('0x11')][_0xaac9('0x12')]);}else{logger[_0xaac9('0x14')](_0xaac9('0x13'),_0x50b0ef,_0xaac9('0xf'));_0x1322bf(_0x3f3228[_0xaac9('0x15')]['message']);}})[_0xaac9('0x16')](function(_0x1864ee){logger[_0xaac9('0x11')]('FreshdeskField,\x20%s,\x20%s',_0x50b0ef,_0x1864ee);_0x48b2f5(_0x1864ee);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index 2bc06fa..e1d06d9 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 _0x0bb5=['./intFreshsalesAccount.controller','get','/:id','isAuthenticated','show','getConfigurations','/:id/fields','getFields','post','create','/:id/configurations','put','update','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x383553,_0x301570){var _0x510e88=function(_0x48b93d){while(--_0x48b93d){_0x383553['push'](_0x383553['shift']());}};_0x510e88(++_0x301570);}(_0x0bb5,0x148));var _0x50bb=function(_0x3a9d08,_0x28cee9){_0x3a9d08=_0x3a9d08-0x0;var _0x2325a7=_0x0bb5[_0x3a9d08];return _0x2325a7;};'use strict';var multer=require(_0x50bb('0x0'));var util=require(_0x50bb('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x50bb('0x2'));var router=express[_0x50bb('0x3')]();var fs_extra=require(_0x50bb('0x4'));var auth=require(_0x50bb('0x5'));var interaction=require(_0x50bb('0x6'));var config=require(_0x50bb('0x7'));var controller=require(_0x50bb('0x8'));router[_0x50bb('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x50bb('0x9')](_0x50bb('0xa'),auth[_0x50bb('0xb')](),controller[_0x50bb('0xc')]);router['get']('/:id/configurations',auth[_0x50bb('0xb')](),controller[_0x50bb('0xd')]);router[_0x50bb('0x9')](_0x50bb('0xe'),auth['isAuthenticated'](),controller[_0x50bb('0xf')]);router[_0x50bb('0x10')]('/',auth[_0x50bb('0xb')](),controller[_0x50bb('0x11')]);router[_0x50bb('0x10')](_0x50bb('0x12'),auth[_0x50bb('0xb')](),controller['addConfiguration']);router[_0x50bb('0x13')]('/:id',auth[_0x50bb('0xb')](),controller[_0x50bb('0x14')]);router[_0x50bb('0x15')]('/:id',auth[_0x50bb('0xb')](),controller[_0x50bb('0x16')]);module[_0x50bb('0x17')]=router; \ No newline at end of file +var _0xeb74=['getFields','post','/:id/configurations','addConfiguration','put','/:id','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated','show','getConfigurations','/:id/fields'];(function(_0x584ddd,_0x41c6b5){var _0x2421d9=function(_0x12dff5){while(--_0x12dff5){_0x584ddd['push'](_0x584ddd['shift']());}};_0x2421d9(++_0x41c6b5);}(_0xeb74,0xe3));var _0x4eb7=function(_0x40b086,_0x7a10fe){_0x40b086=_0x40b086-0x0;var _0x1f325d=_0xeb74[_0x40b086];return _0x1f325d;};'use strict';var multer=require(_0x4eb7('0x0'));var util=require(_0x4eb7('0x1'));var path=require(_0x4eb7('0x2'));var timeout=require(_0x4eb7('0x3'));var express=require(_0x4eb7('0x4'));var router=express[_0x4eb7('0x5')]();var fs_extra=require(_0x4eb7('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x4eb7('0x7'));var config=require(_0x4eb7('0x8'));var controller=require(_0x4eb7('0x9'));router[_0x4eb7('0xa')]('/',auth[_0x4eb7('0xb')](),controller['index']);router[_0x4eb7('0xa')]('/:id',auth[_0x4eb7('0xb')](),controller[_0x4eb7('0xc')]);router['get']('/:id/configurations',auth[_0x4eb7('0xb')](),controller[_0x4eb7('0xd')]);router['get'](_0x4eb7('0xe'),auth['isAuthenticated'](),controller[_0x4eb7('0xf')]);router[_0x4eb7('0x10')]('/',auth[_0x4eb7('0xb')](),controller['create']);router[_0x4eb7('0x10')](_0x4eb7('0x11'),auth[_0x4eb7('0xb')](),controller[_0x4eb7('0x12')]);router[_0x4eb7('0x13')](_0x4eb7('0x14'),auth[_0x4eb7('0xb')](),controller['update']);router['delete']('/:id',auth[_0x4eb7('0xb')](),controller['destroy']);module[_0x4eb7('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 1e6073b..190ce71 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 _0x0120=['remoteUri','sequelize','exports','STRING','username'];(function(_0x4d71bc,_0x4f2759){var _0xb529a8=function(_0x32daef){while(--_0x32daef){_0x4d71bc['push'](_0x4d71bc['shift']());}};_0xb529a8(++_0x4f2759);}(_0x0120,0x6f));var _0x0012=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0x0120[_0x4154a6];return _0x3b2786;};'use strict';var Sequelize=require(_0x0012('0x0'));module[_0x0012('0x1')]={'name':{'type':Sequelize[_0x0012('0x2')]},'description':{'type':Sequelize[_0x0012('0x2')]},'username':{'type':Sequelize[_0x0012('0x2')],'unique':_0x0012('0x3')},'apiKey':{'type':Sequelize[_0x0012('0x2')]},'remoteUri':{'type':Sequelize[_0x0012('0x2')],'unique':_0x0012('0x4')},'serverUrl':{'type':Sequelize[_0x0012('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x583c=['exports','STRING','username','sequelize'];(function(_0x35a375,_0x361953){var _0x167618=function(_0x43b047){while(--_0x43b047){_0x35a375['push'](_0x35a375['shift']());}};_0x167618(++_0x361953);}(_0x583c,0x12b));var _0xc583=function(_0x1c2f29,_0x5a2668){_0x1c2f29=_0x1c2f29-0x0;var _0x258465=_0x583c[_0x1c2f29];return _0x258465;};'use strict';var Sequelize=require(_0xc583('0x0'));module[_0xc583('0x1')]={'name':{'type':Sequelize[_0xc583('0x2')]},'description':{'type':Sequelize[_0xc583('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0xc583('0x3')},'apiKey':{'type':Sequelize[_0xc583('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0xc583('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 778ce8e..5d143ea 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 _0xabe5=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','count','set','apply','reject','save','then','stack','name','send','index','map','FreshsalesAccount','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','limit','order','sort','where','filter','VIRTUAL','merge','includeAll','include','findAll','catch','show','params','find','create','body','update','getConfigurations','findOne','FreshsalesConfiguration','pick','options','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','channel','type','FreshsalesField','Descriptions','getFields','username','remoteUri','apiKey','slice','lastIndexOf','GET','format','%s%s','Token\x20token=','users','email','Requested\x20Resource\x20not\x20Found','error','stringify','test','Wrong\x20credentials','statusCode','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js'];(function(_0x55c979,_0x36c5f0){var _0x690107=function(_0xa61dad){while(--_0xa61dad){_0x55c979['push'](_0x55c979['shift']());}};_0x690107(++_0x36c5f0);}(_0xabe5,0xc2));var _0x5abe=function(_0x4b2a00,_0x1692fc){_0x4b2a00=_0x4b2a00-0x0;var _0x5b692b=_0xabe5[_0x4b2a00];return _0x5b692b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5abe('0x0'));var zipdir=require(_0x5abe('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5abe('0x2'));var moment=require(_0x5abe('0x3'));var BPromise=require(_0x5abe('0x4'));var Mustache=require(_0x5abe('0x5'));var util=require(_0x5abe('0x6'));var path=require(_0x5abe('0x7'));var sox=require(_0x5abe('0x8'));var csv=require(_0x5abe('0x9'));var ejs=require(_0x5abe('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5abe('0xb'));var squel=require(_0x5abe('0xc'));var crypto=require(_0x5abe('0xd'));var jsforce=require(_0x5abe('0xe'));var deskjs=require(_0x5abe('0xf'));var toCsv=require('to-csv');var querystring=require(_0x5abe('0x10'));var Papa=require(_0x5abe('0x11'));var Redis=require(_0x5abe('0x12'));var authService=require(_0x5abe('0x13'));var qs=require(_0x5abe('0x14'));var as=require(_0x5abe('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5abe('0x16'));var utils=require(_0x5abe('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x5abe('0x18'));var db=require(_0x5abe('0x19'))['db'];var integrations=require(_0x5abe('0x1a'));function respondWithStatusCode(_0x4762c5,_0x383584){_0x383584=_0x383584||0xcc;return function(_0x145c72){if(_0x145c72){return _0x4762c5[_0x5abe('0x1b')](_0x383584);}return _0x4762c5[_0x5abe('0x1c')](_0x383584)[_0x5abe('0x1d')]();};}function respondWithResult(_0x4b8386,_0x1c8cc3){_0x1c8cc3=_0x1c8cc3||0xc8;return function(_0x4a1be2){if(_0x4a1be2){return _0x4b8386[_0x5abe('0x1c')](_0x1c8cc3)[_0x5abe('0x1e')](_0x4a1be2);}};}function respondWithFilteredResult(_0x338b11,_0x46305b){return function(_0x509ed7){if(_0x509ed7){var _0x12d8e1=typeof _0x46305b[_0x5abe('0x1f')]===_0x5abe('0x20')&&typeof _0x46305b['limit']===_0x5abe('0x20');var _0x6d2284=_0x509ed7[_0x5abe('0x21')];var _0x5a9200=_0x12d8e1?0x0:_0x46305b[_0x5abe('0x1f')];var _0x319dac=_0x12d8e1?_0x509ed7[_0x5abe('0x21')]:_0x46305b['offset']+_0x46305b['limit'];var _0x2d3eca;if(_0x319dac>=_0x6d2284){_0x319dac=_0x6d2284;_0x2d3eca=0xc8;}else{_0x2d3eca=0xce;}_0x338b11[_0x5abe('0x1c')](_0x2d3eca);return _0x338b11[_0x5abe('0x22')]('Content-Range',_0x5a9200+'-'+_0x319dac+'/'+_0x6d2284)['json'](_0x509ed7);}return null;};}function patchUpdates(_0x59213d){return function(_0x2c6e08){try{jsonpatch[_0x5abe('0x23')](_0x2c6e08,_0x59213d,!![]);}catch(_0x5dd252){return BPromise[_0x5abe('0x24')](_0x5dd252);}return _0x2c6e08[_0x5abe('0x25')]();};}function saveUpdates(_0x4969a2,_0x5c1de0){return function(_0x18547d){if(_0x18547d){return _0x18547d['update'](_0x4969a2)[_0x5abe('0x26')](function(_0x20a02b){return _0x20a02b;});}return null;};}function removeEntity(_0x4993d4,_0x3bda8a){return function(_0x3f837d){if(_0x3f837d){return _0x3f837d['destroy']()[_0x5abe('0x26')](function(){_0x4993d4[_0x5abe('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x14b57d,_0x250a37){return function(_0x167261){if(!_0x167261){_0x14b57d[_0x5abe('0x1b')](0x194);}return _0x167261;};}function handleError(_0x4d8f31,_0x38847c){_0x38847c=_0x38847c||0x1f4;return function(_0x2a6d07){logger['error'](_0x2a6d07[_0x5abe('0x27')]);if(_0x2a6d07[_0x5abe('0x28')]){delete _0x2a6d07[_0x5abe('0x28')];}_0x4d8f31[_0x5abe('0x1c')](_0x38847c)[_0x5abe('0x29')](_0x2a6d07);};}exports[_0x5abe('0x2a')]=function(_0x421fe1,_0x7d6e61){var _0x18477a={},_0x27062b={},_0x31994d={'count':0x0,'rows':[]};var _0x41ea19=_[_0x5abe('0x2b')](db[_0x5abe('0x2c')][_0x5abe('0x2d')],function(_0x73d8){return{'name':_0x73d8[_0x5abe('0x2e')],'type':_0x73d8['type'][_0x5abe('0x2f')]};});_0x27062b[_0x5abe('0x30')]=_['map'](_0x41ea19,_0x5abe('0x28'));_0x27062b[_0x5abe('0x31')]=_[_0x5abe('0x32')](_0x421fe1['query']);_0x27062b[_0x5abe('0x33')]=_[_0x5abe('0x34')](_0x27062b[_0x5abe('0x30')],_0x27062b['query']);_0x18477a[_0x5abe('0x35')]=_[_0x5abe('0x34')](_0x27062b[_0x5abe('0x30')],qs[_0x5abe('0x36')](_0x421fe1[_0x5abe('0x31')][_0x5abe('0x36')]));_0x18477a[_0x5abe('0x35')]=_0x18477a[_0x5abe('0x35')][_0x5abe('0x37')]?_0x18477a[_0x5abe('0x35')]:_0x27062b[_0x5abe('0x30')];if(!_0x421fe1[_0x5abe('0x31')]['hasOwnProperty']('nolimit')){_0x18477a[_0x5abe('0x38')]=qs['limit'](_0x421fe1[_0x5abe('0x31')][_0x5abe('0x38')]);_0x18477a[_0x5abe('0x1f')]=qs[_0x5abe('0x1f')](_0x421fe1[_0x5abe('0x31')]['offset']);}_0x18477a[_0x5abe('0x39')]=qs[_0x5abe('0x3a')](_0x421fe1[_0x5abe('0x31')][_0x5abe('0x3a')]);_0x18477a[_0x5abe('0x3b')]=qs[_0x5abe('0x33')](_['pick'](_0x421fe1[_0x5abe('0x31')],_0x27062b[_0x5abe('0x33')]),_0x41ea19);if(_0x421fe1[_0x5abe('0x31')][_0x5abe('0x3c')]){_0x18477a[_0x5abe('0x3b')]=_['merge'](_0x18477a[_0x5abe('0x3b')],{'$or':_['map'](_0x41ea19,function(_0x567b2e){if(_0x567b2e['type']!==_0x5abe('0x3d')){var _0x5c24d4={};_0x5c24d4[_0x567b2e[_0x5abe('0x28')]]={'$like':'%'+_0x421fe1[_0x5abe('0x31')][_0x5abe('0x3c')]+'%'};return _0x5c24d4;}})});}_0x18477a=_[_0x5abe('0x3e')]({},_0x18477a,_0x421fe1['options']);var _0x9007c9={'where':_0x18477a[_0x5abe('0x3b')]};return db[_0x5abe('0x2c')][_0x5abe('0x21')](_0x9007c9)[_0x5abe('0x26')](function(_0x4fd83e){_0x31994d[_0x5abe('0x21')]=_0x4fd83e;if(_0x421fe1[_0x5abe('0x31')][_0x5abe('0x3f')]){_0x18477a[_0x5abe('0x40')]=[{'all':!![]}];}return db['FreshsalesAccount'][_0x5abe('0x41')](_0x18477a);})['then'](function(_0x4c65e5){_0x31994d['rows']=_0x4c65e5;return _0x31994d;})[_0x5abe('0x26')](respondWithFilteredResult(_0x7d6e61,_0x18477a))[_0x5abe('0x42')](handleError(_0x7d6e61,null));};exports[_0x5abe('0x43')]=function(_0x2748f4,_0x1970af){var _0x249fdb={'raw':![],'where':{'id':_0x2748f4[_0x5abe('0x44')]['id']}},_0x48af78={};_0x48af78[_0x5abe('0x30')]=_[_0x5abe('0x32')](db[_0x5abe('0x2c')][_0x5abe('0x2d')]);_0x48af78[_0x5abe('0x31')]=_[_0x5abe('0x32')](_0x2748f4[_0x5abe('0x31')]);_0x48af78['filters']=_[_0x5abe('0x34')](_0x48af78[_0x5abe('0x30')],_0x48af78[_0x5abe('0x31')]);_0x249fdb[_0x5abe('0x35')]=_[_0x5abe('0x34')](_0x48af78[_0x5abe('0x30')],qs[_0x5abe('0x36')](_0x2748f4[_0x5abe('0x31')][_0x5abe('0x36')]));_0x249fdb[_0x5abe('0x35')]=_0x249fdb['attributes'][_0x5abe('0x37')]?_0x249fdb[_0x5abe('0x35')]:_0x48af78['model'];if(_0x2748f4[_0x5abe('0x31')][_0x5abe('0x3f')]){_0x249fdb[_0x5abe('0x40')]=[{'all':!![]}];}_0x249fdb=_['merge']({},_0x249fdb,_0x2748f4['options']);return db[_0x5abe('0x2c')][_0x5abe('0x45')](_0x249fdb)['then'](handleEntityNotFound(_0x1970af,null))['then'](respondWithResult(_0x1970af,null))[_0x5abe('0x42')](handleError(_0x1970af,null));};exports[_0x5abe('0x46')]=function(_0xfd2ed4,_0x19b5f8){return db[_0x5abe('0x2c')][_0x5abe('0x46')](_0xfd2ed4[_0x5abe('0x47')],{})[_0x5abe('0x26')](respondWithResult(_0x19b5f8,0xc9))['catch'](handleError(_0x19b5f8,null));};exports[_0x5abe('0x48')]=function(_0x44fe47,_0x3cfff1){if(_0x44fe47[_0x5abe('0x47')]['id']){delete _0x44fe47[_0x5abe('0x47')]['id'];}return db['FreshsalesAccount']['find']({'where':{'id':_0x44fe47[_0x5abe('0x44')]['id']}})[_0x5abe('0x26')](handleEntityNotFound(_0x3cfff1,null))[_0x5abe('0x26')](saveUpdates(_0x44fe47[_0x5abe('0x47')],null))[_0x5abe('0x26')](respondWithResult(_0x3cfff1,null))[_0x5abe('0x42')](handleError(_0x3cfff1,null));};exports['destroy']=function(_0x413330,_0x456b93){return db[_0x5abe('0x2c')][_0x5abe('0x45')]({'where':{'id':_0x413330[_0x5abe('0x44')]['id']}})['then'](handleEntityNotFound(_0x456b93,null))['then'](removeEntity(_0x456b93,null))[_0x5abe('0x42')](handleError(_0x456b93,null));};exports[_0x5abe('0x49')]=function(_0x2f6d35,_0x282480,_0x25a17e){var _0x4306c2={};var _0x185329={};var _0x5de34b;var _0x5225ba;return db['FreshsalesAccount'][_0x5abe('0x4a')]({'where':{'id':_0x2f6d35[_0x5abe('0x44')]['id']}})[_0x5abe('0x26')](handleEntityNotFound(_0x282480,null))['then'](function(_0x2d564a){if(_0x2d564a){_0x5de34b=_0x2d564a;_0x185329[_0x5abe('0x30')]=_[_0x5abe('0x32')](db[_0x5abe('0x4b')]['rawAttributes']);_0x185329[_0x5abe('0x31')]=_[_0x5abe('0x32')](_0x2f6d35[_0x5abe('0x31')]);_0x185329[_0x5abe('0x33')]=_['intersection'](_0x185329[_0x5abe('0x30')],_0x185329[_0x5abe('0x31')]);_0x4306c2['attributes']=_[_0x5abe('0x34')](_0x185329['model'],qs[_0x5abe('0x36')](_0x2f6d35[_0x5abe('0x31')][_0x5abe('0x36')]));_0x4306c2['attributes']=_0x4306c2[_0x5abe('0x35')][_0x5abe('0x37')]?_0x4306c2[_0x5abe('0x35')]:_0x185329[_0x5abe('0x30')];_0x4306c2[_0x5abe('0x39')]=qs[_0x5abe('0x3a')](_0x2f6d35[_0x5abe('0x31')][_0x5abe('0x3a')]);_0x4306c2[_0x5abe('0x3b')]=qs[_0x5abe('0x33')](_[_0x5abe('0x4c')](_0x2f6d35[_0x5abe('0x31')],_0x185329[_0x5abe('0x33')]));if(_0x2f6d35['query'][_0x5abe('0x3c')]){_0x4306c2[_0x5abe('0x3b')]=_[_0x5abe('0x3e')](_0x4306c2['where'],{'$or':_['map'](_0x4306c2[_0x5abe('0x35')],function(_0x144754){var _0x8a64f4={};_0x8a64f4[_0x144754]={'$like':'%'+_0x2f6d35['query']['filter']+'%'};return _0x8a64f4;})});}_0x4306c2=_[_0x5abe('0x3e')]({},_0x4306c2,_0x2f6d35[_0x5abe('0x4d')]);return _0x5de34b[_0x5abe('0x49')](_0x4306c2);}})[_0x5abe('0x26')](function(_0x2a38db){if(_0x2a38db){_0x5225ba=_0x2a38db['length'];if(!_0x2f6d35['query'][_0x5abe('0x4e')]('nolimit')){_0x4306c2[_0x5abe('0x38')]=qs[_0x5abe('0x38')](_0x2f6d35[_0x5abe('0x31')][_0x5abe('0x38')]);_0x4306c2[_0x5abe('0x1f')]=qs['offset'](_0x2f6d35['query'][_0x5abe('0x1f')]);}return _0x5de34b['getConfigurations'](_0x4306c2);}})['then'](function(_0x4a1360){if(_0x4a1360){return _0x4a1360?{'count':_0x5225ba,'rows':_0x4a1360}:null;}})[_0x5abe('0x26')](respondWithResult(_0x282480,null))[_0x5abe('0x42')](handleError(_0x282480,null));};exports[_0x5abe('0x4f')]=function(_0x59f4d1,_0xbdaa3d,_0x14bb7c){if(_0x59f4d1[_0x5abe('0x47')]['id']){delete _0x59f4d1[_0x5abe('0x47')]['id'];}return db['FreshsalesAccount'][_0x5abe('0x4a')]({'where':{'id':_0x59f4d1[_0x5abe('0x44')]['id']}})['then'](handleEntityNotFound(_0xbdaa3d,null))['then'](function(_0x1a27a6){if(_0x1a27a6){_0x59f4d1[_0x5abe('0x47')][_0x5abe('0x50')]=_0x1a27a6['id'];_0x59f4d1[_0x5abe('0x47')][_0x5abe('0x51')]=integrations[_0x5abe('0x52')](_0x59f4d1['body'][_0x5abe('0x53')],_0x59f4d1[_0x5abe('0x47')][_0x5abe('0x54')]);_0x59f4d1[_0x5abe('0x47')]['Descriptions']=integrations['getDescriptions'](_0x59f4d1[_0x5abe('0x47')]['channel'],_0x59f4d1[_0x5abe('0x47')]['type']);return db[_0x5abe('0x4b')][_0x5abe('0x46')](_0x59f4d1[_0x5abe('0x47')],{'include':[{'model':db[_0x5abe('0x55')],'as':_0x5abe('0x51')},{'model':db[_0x5abe('0x55')],'as':_0x5abe('0x56')}]});}return null;})[_0x5abe('0x26')](respondWithResult(_0xbdaa3d,null))[_0x5abe('0x42')](handleError(_0xbdaa3d,null));};exports[_0x5abe('0x57')]=function(_0xee5655,_0x13e8d1,_0x4c1f4a){var _0x47b03c='';var _0x336640='';return db[_0x5abe('0x2c')][_0x5abe('0x4a')]({'where':{'id':_0xee5655[_0x5abe('0x44')]['id']},'attributes':['id',_0x5abe('0x58'),_0x5abe('0x59'),_0x5abe('0x5a')]})[_0x5abe('0x26')](handleEntityNotFound(_0x13e8d1,null))[_0x5abe('0x26')](function(_0x7522c6){if(_0x7522c6){_0x336640=_0x7522c6['username'];_0x47b03c=_0x7522c6['remoteUri'];var _0x14ea74=_0x7522c6[_0x5abe('0x59')][_0x5abe('0x5b')](-0x1);if(_0x14ea74==='/'){_0x47b03c=_0x47b03c['substring'](0x0,_0x47b03c[_0x5abe('0x5c')](_0x14ea74));}return rp({'method':_0x5abe('0x5d'),'uri':util[_0x5abe('0x5e')](_0x5abe('0x5f'),_0x47b03c,'/api/selector/owners'),'headers':{'Authorization':_0x5abe('0x60')+_0x7522c6['apiKey']},'json':!![]});}})['then'](function(_0x5e55e1){if(_0x5e55e1){var _0x3ba618=_0x5e55e1[_0x5abe('0x61')];var _0x30f9c1=![];var _0x2bcf39=null;for(_0x2bcf39=0x0;_0x2bcf39<_0x3ba618[_0x5abe('0x37')];_0x2bcf39++){if(_0x3ba618[_0x2bcf39][_0x5abe('0x62')]===_0x336640){_0x30f9c1=!![];}}if(_0x30f9c1){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x5abe('0x63')});}}})['then'](respondWithResult(_0x13e8d1,null))['catch'](function(_0x3e2ac5){var _0x1c12da=_0xee5655[_0x5abe('0x31')]['test']?0x1f4:_0x3e2ac5['statusCode']||0x1f4;logger[_0x5abe('0x64')]('getFields,\x20%s,\x20%s,\x20%s',_0x5abe('0x57'),_0x1c12da,JSON[_0x5abe('0x65')](_0x3e2ac5));delete _0x3e2ac5[_0x5abe('0x28')];if(_0x1c12da===0x191){_0x1c12da=0x190;}_0x13e8d1[_0x5abe('0x1c')](_0x1c12da)['send'](_0xee5655[_0x5abe('0x31')][_0x5abe('0x66')]?{'message':_0x5abe('0x67'),'statusCode':_0x3e2ac5[_0x5abe('0x68')]}:_0x3e2ac5);});}; \ No newline at end of file +var _0x6e6f=['apiKey','username','remoteUri','slice','substring','format','%s%s','/api/selector/owners','Token\x20token=','users','email','Requested\x20Resource\x20not\x20Found','test','statusCode','Wrong\x20credentials','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','error','stack','name','send','index','map','FreshsalesAccount','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','catch','show','params','rawAttributes','find','create','update','body','getConfigurations','findOne','FreshsalesConfiguration','nolimit','addConfiguration','getSubjects','channel','Descriptions','getDescriptions','FreshsalesField','Subjects','getFields'];(function(_0xf8ef99,_0x3e389d){var _0x53a843=function(_0x5b278b){while(--_0x5b278b){_0xf8ef99['push'](_0xf8ef99['shift']());}};_0x53a843(++_0x3e389d);}(_0x6e6f,0x76));var _0xf6e6=function(_0x3855f4,_0x16073b){_0x3855f4=_0x3855f4-0x0;var _0x3d4e63=_0x6e6f[_0x3855f4];return _0x3d4e63;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf6e6('0x0'));var zipdir=require(_0xf6e6('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf6e6('0x2'));var moment=require(_0xf6e6('0x3'));var BPromise=require(_0xf6e6('0x4'));var Mustache=require(_0xf6e6('0x5'));var util=require(_0xf6e6('0x6'));var path=require(_0xf6e6('0x7'));var sox=require(_0xf6e6('0x8'));var csv=require('to-csv');var ejs=require(_0xf6e6('0x9'));var fs=require('fs');var fs_extra=require(_0xf6e6('0xa'));var _=require(_0xf6e6('0xb'));var squel=require(_0xf6e6('0xc'));var crypto=require(_0xf6e6('0xd'));var jsforce=require(_0xf6e6('0xe'));var deskjs=require(_0xf6e6('0xf'));var toCsv=require(_0xf6e6('0x10'));var querystring=require('querystring');var Papa=require(_0xf6e6('0x11'));var Redis=require(_0xf6e6('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xf6e6('0x13'));var as=require(_0xf6e6('0x14'));var hardwareService=require(_0xf6e6('0x15'));var logger=require(_0xf6e6('0x16'))(_0xf6e6('0x17'));var utils=require(_0xf6e6('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xf6e6('0x19'));var db=require('../../mysqldb')['db'];var integrations=require(_0xf6e6('0x1a'));function respondWithStatusCode(_0x49f6e1,_0x132117){_0x132117=_0x132117||0xcc;return function(_0x1476d3){if(_0x1476d3){return _0x49f6e1[_0xf6e6('0x1b')](_0x132117);}return _0x49f6e1[_0xf6e6('0x1c')](_0x132117)[_0xf6e6('0x1d')]();};}function respondWithResult(_0x3ac118,_0x5eb785){_0x5eb785=_0x5eb785||0xc8;return function(_0x47ed15){if(_0x47ed15){return _0x3ac118[_0xf6e6('0x1c')](_0x5eb785)[_0xf6e6('0x1e')](_0x47ed15);}};}function respondWithFilteredResult(_0x1cc43b,_0xffcde6){return function(_0xc0bac6){if(_0xc0bac6){var _0x36e928=typeof _0xffcde6[_0xf6e6('0x1f')]===_0xf6e6('0x20')&&typeof _0xffcde6[_0xf6e6('0x21')]===_0xf6e6('0x20');var _0x2acc10=_0xc0bac6[_0xf6e6('0x22')];var _0x1ddc3c=_0x36e928?0x0:_0xffcde6['offset'];var _0x439d86=_0x36e928?_0xc0bac6[_0xf6e6('0x22')]:_0xffcde6[_0xf6e6('0x1f')]+_0xffcde6[_0xf6e6('0x21')];var _0x335daf;if(_0x439d86>=_0x2acc10){_0x439d86=_0x2acc10;_0x335daf=0xc8;}else{_0x335daf=0xce;}_0x1cc43b['status'](_0x335daf);return _0x1cc43b[_0xf6e6('0x23')](_0xf6e6('0x24'),_0x1ddc3c+'-'+_0x439d86+'/'+_0x2acc10)[_0xf6e6('0x1e')](_0xc0bac6);}return null;};}function patchUpdates(_0x2993bd){return function(_0x3bcfba){try{jsonpatch[_0xf6e6('0x25')](_0x3bcfba,_0x2993bd,!![]);}catch(_0x5650d2){return BPromise[_0xf6e6('0x26')](_0x5650d2);}return _0x3bcfba['save']();};}function saveUpdates(_0x38b570,_0x2f4378){return function(_0x49b80f){if(_0x49b80f){return _0x49b80f['update'](_0x38b570)[_0xf6e6('0x27')](function(_0x303c96){return _0x303c96;});}return null;};}function removeEntity(_0x538f8d,_0x3d439b){return function(_0x46b308){if(_0x46b308){return _0x46b308[_0xf6e6('0x28')]()[_0xf6e6('0x27')](function(){_0x538f8d[_0xf6e6('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4a4ead,_0x2227e0){return function(_0x2bf171){if(!_0x2bf171){_0x4a4ead[_0xf6e6('0x1b')](0x194);}return _0x2bf171;};}function handleError(_0x518a17,_0x185eb6){_0x185eb6=_0x185eb6||0x1f4;return function(_0x3fb01b){logger[_0xf6e6('0x29')](_0x3fb01b[_0xf6e6('0x2a')]);if(_0x3fb01b[_0xf6e6('0x2b')]){delete _0x3fb01b[_0xf6e6('0x2b')];}_0x518a17['status'](_0x185eb6)[_0xf6e6('0x2c')](_0x3fb01b);};}exports[_0xf6e6('0x2d')]=function(_0x3ef2ff,_0x290841){var _0x128031={},_0x4a33aa={},_0x57e994={'count':0x0,'rows':[]};var _0x298c22=_[_0xf6e6('0x2e')](db[_0xf6e6('0x2f')]['rawAttributes'],function(_0x41aab0){return{'name':_0x41aab0[_0xf6e6('0x30')],'type':_0x41aab0[_0xf6e6('0x31')]['key']};});_0x4a33aa[_0xf6e6('0x32')]=_[_0xf6e6('0x2e')](_0x298c22,_0xf6e6('0x2b'));_0x4a33aa[_0xf6e6('0x33')]=_[_0xf6e6('0x34')](_0x3ef2ff[_0xf6e6('0x33')]);_0x4a33aa[_0xf6e6('0x35')]=_['intersection'](_0x4a33aa[_0xf6e6('0x32')],_0x4a33aa['query']);_0x128031[_0xf6e6('0x36')]=_[_0xf6e6('0x37')](_0x4a33aa[_0xf6e6('0x32')],qs['fields'](_0x3ef2ff[_0xf6e6('0x33')][_0xf6e6('0x38')]));_0x128031[_0xf6e6('0x36')]=_0x128031['attributes'][_0xf6e6('0x39')]?_0x128031[_0xf6e6('0x36')]:_0x4a33aa[_0xf6e6('0x32')];if(!_0x3ef2ff[_0xf6e6('0x33')]['hasOwnProperty']('nolimit')){_0x128031[_0xf6e6('0x21')]=qs['limit'](_0x3ef2ff['query']['limit']);_0x128031[_0xf6e6('0x1f')]=qs[_0xf6e6('0x1f')](_0x3ef2ff[_0xf6e6('0x33')]['offset']);}_0x128031[_0xf6e6('0x3a')]=qs[_0xf6e6('0x3b')](_0x3ef2ff[_0xf6e6('0x33')][_0xf6e6('0x3b')]);_0x128031[_0xf6e6('0x3c')]=qs[_0xf6e6('0x35')](_[_0xf6e6('0x3d')](_0x3ef2ff['query'],_0x4a33aa[_0xf6e6('0x35')]),_0x298c22);if(_0x3ef2ff[_0xf6e6('0x33')][_0xf6e6('0x3e')]){_0x128031['where']=_[_0xf6e6('0x3f')](_0x128031[_0xf6e6('0x3c')],{'$or':_[_0xf6e6('0x2e')](_0x298c22,function(_0x5cc359){if(_0x5cc359[_0xf6e6('0x31')]!==_0xf6e6('0x40')){var _0x3076fe={};_0x3076fe[_0x5cc359[_0xf6e6('0x2b')]]={'$like':'%'+_0x3ef2ff['query'][_0xf6e6('0x3e')]+'%'};return _0x3076fe;}})});}_0x128031=_[_0xf6e6('0x3f')]({},_0x128031,_0x3ef2ff[_0xf6e6('0x41')]);var _0x26d18d={'where':_0x128031[_0xf6e6('0x3c')]};return db[_0xf6e6('0x2f')][_0xf6e6('0x22')](_0x26d18d)[_0xf6e6('0x27')](function(_0x3a2b82){_0x57e994[_0xf6e6('0x22')]=_0x3a2b82;if(_0x3ef2ff['query'][_0xf6e6('0x42')]){_0x128031[_0xf6e6('0x43')]=[{'all':!![]}];}return db['FreshsalesAccount']['findAll'](_0x128031);})['then'](function(_0xfc15b8){_0x57e994['rows']=_0xfc15b8;return _0x57e994;})[_0xf6e6('0x27')](respondWithFilteredResult(_0x290841,_0x128031))[_0xf6e6('0x44')](handleError(_0x290841,null));};exports[_0xf6e6('0x45')]=function(_0x3f9fd7,_0x454e85){var _0x125af6={'raw':![],'where':{'id':_0x3f9fd7[_0xf6e6('0x46')]['id']}},_0x2192ec={};_0x2192ec[_0xf6e6('0x32')]=_['keys'](db[_0xf6e6('0x2f')][_0xf6e6('0x47')]);_0x2192ec['query']=_[_0xf6e6('0x34')](_0x3f9fd7[_0xf6e6('0x33')]);_0x2192ec[_0xf6e6('0x35')]=_[_0xf6e6('0x37')](_0x2192ec[_0xf6e6('0x32')],_0x2192ec[_0xf6e6('0x33')]);_0x125af6[_0xf6e6('0x36')]=_[_0xf6e6('0x37')](_0x2192ec[_0xf6e6('0x32')],qs[_0xf6e6('0x38')](_0x3f9fd7[_0xf6e6('0x33')]['fields']));_0x125af6[_0xf6e6('0x36')]=_0x125af6[_0xf6e6('0x36')][_0xf6e6('0x39')]?_0x125af6['attributes']:_0x2192ec['model'];if(_0x3f9fd7[_0xf6e6('0x33')]['includeAll']){_0x125af6['include']=[{'all':!![]}];}_0x125af6=_[_0xf6e6('0x3f')]({},_0x125af6,_0x3f9fd7[_0xf6e6('0x41')]);return db[_0xf6e6('0x2f')][_0xf6e6('0x48')](_0x125af6)[_0xf6e6('0x27')](handleEntityNotFound(_0x454e85,null))['then'](respondWithResult(_0x454e85,null))[_0xf6e6('0x44')](handleError(_0x454e85,null));};exports['create']=function(_0x34c9f9,_0x2d091e){return db[_0xf6e6('0x2f')][_0xf6e6('0x49')](_0x34c9f9['body'],{})[_0xf6e6('0x27')](respondWithResult(_0x2d091e,0xc9))[_0xf6e6('0x44')](handleError(_0x2d091e,null));};exports[_0xf6e6('0x4a')]=function(_0x32c25a,_0x1366b2){if(_0x32c25a[_0xf6e6('0x4b')]['id']){delete _0x32c25a[_0xf6e6('0x4b')]['id'];}return db['FreshsalesAccount'][_0xf6e6('0x48')]({'where':{'id':_0x32c25a['params']['id']}})[_0xf6e6('0x27')](handleEntityNotFound(_0x1366b2,null))['then'](saveUpdates(_0x32c25a[_0xf6e6('0x4b')],null))[_0xf6e6('0x27')](respondWithResult(_0x1366b2,null))[_0xf6e6('0x44')](handleError(_0x1366b2,null));};exports[_0xf6e6('0x28')]=function(_0x2d1cfa,_0x241d51){return db[_0xf6e6('0x2f')][_0xf6e6('0x48')]({'where':{'id':_0x2d1cfa[_0xf6e6('0x46')]['id']}})[_0xf6e6('0x27')](handleEntityNotFound(_0x241d51,null))['then'](removeEntity(_0x241d51,null))[_0xf6e6('0x44')](handleError(_0x241d51,null));};exports[_0xf6e6('0x4c')]=function(_0x119b48,_0x40b6cd,_0x4967e7){var _0x3ecdb9={};var _0x4dc3fd={};var _0x3471c4;var _0x20c54c;return db[_0xf6e6('0x2f')][_0xf6e6('0x4d')]({'where':{'id':_0x119b48[_0xf6e6('0x46')]['id']}})[_0xf6e6('0x27')](handleEntityNotFound(_0x40b6cd,null))['then'](function(_0x1b50e9){if(_0x1b50e9){_0x3471c4=_0x1b50e9;_0x4dc3fd[_0xf6e6('0x32')]=_['keys'](db[_0xf6e6('0x4e')][_0xf6e6('0x47')]);_0x4dc3fd[_0xf6e6('0x33')]=_[_0xf6e6('0x34')](_0x119b48['query']);_0x4dc3fd[_0xf6e6('0x35')]=_[_0xf6e6('0x37')](_0x4dc3fd[_0xf6e6('0x32')],_0x4dc3fd['query']);_0x3ecdb9[_0xf6e6('0x36')]=_['intersection'](_0x4dc3fd[_0xf6e6('0x32')],qs[_0xf6e6('0x38')](_0x119b48[_0xf6e6('0x33')][_0xf6e6('0x38')]));_0x3ecdb9['attributes']=_0x3ecdb9[_0xf6e6('0x36')]['length']?_0x3ecdb9[_0xf6e6('0x36')]:_0x4dc3fd[_0xf6e6('0x32')];_0x3ecdb9[_0xf6e6('0x3a')]=qs[_0xf6e6('0x3b')](_0x119b48[_0xf6e6('0x33')][_0xf6e6('0x3b')]);_0x3ecdb9[_0xf6e6('0x3c')]=qs[_0xf6e6('0x35')](_[_0xf6e6('0x3d')](_0x119b48[_0xf6e6('0x33')],_0x4dc3fd[_0xf6e6('0x35')]));if(_0x119b48['query'][_0xf6e6('0x3e')]){_0x3ecdb9[_0xf6e6('0x3c')]=_['merge'](_0x3ecdb9[_0xf6e6('0x3c')],{'$or':_['map'](_0x3ecdb9[_0xf6e6('0x36')],function(_0x17fd62){var _0x5bebac={};_0x5bebac[_0x17fd62]={'$like':'%'+_0x119b48[_0xf6e6('0x33')][_0xf6e6('0x3e')]+'%'};return _0x5bebac;})});}_0x3ecdb9=_[_0xf6e6('0x3f')]({},_0x3ecdb9,_0x119b48[_0xf6e6('0x41')]);return _0x3471c4['getConfigurations'](_0x3ecdb9);}})['then'](function(_0x145ca5){if(_0x145ca5){_0x20c54c=_0x145ca5['length'];if(!_0x119b48[_0xf6e6('0x33')]['hasOwnProperty'](_0xf6e6('0x4f'))){_0x3ecdb9[_0xf6e6('0x21')]=qs['limit'](_0x119b48[_0xf6e6('0x33')][_0xf6e6('0x21')]);_0x3ecdb9[_0xf6e6('0x1f')]=qs[_0xf6e6('0x1f')](_0x119b48[_0xf6e6('0x33')][_0xf6e6('0x1f')]);}return _0x3471c4[_0xf6e6('0x4c')](_0x3ecdb9);}})[_0xf6e6('0x27')](function(_0x4fd22f){if(_0x4fd22f){return _0x4fd22f?{'count':_0x20c54c,'rows':_0x4fd22f}:null;}})['then'](respondWithResult(_0x40b6cd,null))[_0xf6e6('0x44')](handleError(_0x40b6cd,null));};exports[_0xf6e6('0x50')]=function(_0x84eba1,_0x42b285,_0x4f3fa9){if(_0x84eba1[_0xf6e6('0x4b')]['id']){delete _0x84eba1[_0xf6e6('0x4b')]['id'];}return db[_0xf6e6('0x2f')][_0xf6e6('0x4d')]({'where':{'id':_0x84eba1[_0xf6e6('0x46')]['id']}})[_0xf6e6('0x27')](handleEntityNotFound(_0x42b285,null))[_0xf6e6('0x27')](function(_0x2a4388){if(_0x2a4388){_0x84eba1[_0xf6e6('0x4b')]['AccountId']=_0x2a4388['id'];_0x84eba1['body']['Subjects']=integrations[_0xf6e6('0x51')](_0x84eba1[_0xf6e6('0x4b')][_0xf6e6('0x52')],_0x84eba1[_0xf6e6('0x4b')][_0xf6e6('0x31')]);_0x84eba1[_0xf6e6('0x4b')][_0xf6e6('0x53')]=integrations[_0xf6e6('0x54')](_0x84eba1['body']['channel'],_0x84eba1[_0xf6e6('0x4b')]['type']);return db[_0xf6e6('0x4e')][_0xf6e6('0x49')](_0x84eba1[_0xf6e6('0x4b')],{'include':[{'model':db[_0xf6e6('0x55')],'as':_0xf6e6('0x56')},{'model':db[_0xf6e6('0x55')],'as':_0xf6e6('0x53')}]});}return null;})['then'](respondWithResult(_0x42b285,null))[_0xf6e6('0x44')](handleError(_0x42b285,null));};exports[_0xf6e6('0x57')]=function(_0x43b953,_0x49cef4,_0x208f5f){var _0x4872a8='';var _0x3a3970='';return db[_0xf6e6('0x2f')][_0xf6e6('0x4d')]({'where':{'id':_0x43b953[_0xf6e6('0x46')]['id']},'attributes':['id','username','remoteUri',_0xf6e6('0x58')]})[_0xf6e6('0x27')](handleEntityNotFound(_0x49cef4,null))['then'](function(_0x406844){if(_0x406844){_0x3a3970=_0x406844[_0xf6e6('0x59')];_0x4872a8=_0x406844['remoteUri'];var _0x3b5d31=_0x406844[_0xf6e6('0x5a')][_0xf6e6('0x5b')](-0x1);if(_0x3b5d31==='/'){_0x4872a8=_0x4872a8[_0xf6e6('0x5c')](0x0,_0x4872a8['lastIndexOf'](_0x3b5d31));}return rp({'method':'GET','uri':util[_0xf6e6('0x5d')](_0xf6e6('0x5e'),_0x4872a8,_0xf6e6('0x5f')),'headers':{'Authorization':_0xf6e6('0x60')+_0x406844['apiKey']},'json':!![]});}})[_0xf6e6('0x27')](function(_0x49eab4){if(_0x49eab4){var _0x38aabd=_0x49eab4[_0xf6e6('0x61')];var _0x3e9c5f=![];var _0x2a0042=null;for(_0x2a0042=0x0;_0x2a0042<_0x38aabd[_0xf6e6('0x39')];_0x2a0042++){if(_0x38aabd[_0x2a0042][_0xf6e6('0x62')]===_0x3a3970){_0x3e9c5f=!![];}}if(_0x3e9c5f){return!![];}else{throw new Error({'statusCode':0x194,'message':_0xf6e6('0x63')});}}})[_0xf6e6('0x27')](respondWithResult(_0x49cef4,null))[_0xf6e6('0x44')](function(_0x166a22){var _0x3e3991=_0x43b953[_0xf6e6('0x33')][_0xf6e6('0x64')]?0x1f4:_0x166a22[_0xf6e6('0x65')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0xf6e6('0x57'),_0x3e3991,JSON['stringify'](_0x166a22));delete _0x166a22[_0xf6e6('0x2b')];if(_0x3e3991===0x191){_0x3e3991=0x190;}_0x49cef4[_0xf6e6('0x1c')](_0x3e3991)[_0xf6e6('0x2c')](_0x43b953[_0xf6e6('0x33')][_0xf6e6('0x64')]?{'message':_0xf6e6('0x66'),'statusCode':_0x166a22['statusCode']}:_0x166a22);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index 483d0b9..f6a295a 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 _0xfcf0=['lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','define','int_freshsales_accounts'];(function(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0xfcf0,0x138));var _0x0fcf=function(_0x1562a2,_0x2e4655){_0x1562a2=_0x1562a2-0x0;var _0x39a636=_0xfcf0[_0x1562a2];return _0x39a636;};'use strict';var _=require(_0x0fcf('0x0'));var util=require(_0x0fcf('0x1'));var logger=require('../../config/logger')(_0x0fcf('0x2'));var moment=require(_0x0fcf('0x3'));var BPromise=require(_0x0fcf('0x4'));var rp=require(_0x0fcf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0fcf('0x6'));var config=require(_0x0fcf('0x7'));var attributes=require(_0x0fcf('0x8'));var integrations=require(_0x0fcf('0x9'));module[_0x0fcf('0xa')]=function(_0x1a7b03,_0x61bbb9){return _0x1a7b03[_0x0fcf('0xb')]('FreshsalesAccount',attributes,{'tableName':_0x0fcf('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xba34=['./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','FreshsalesAccount','int_freshsales_accounts','lodash','util','../../config/logger','api','moment','rimraf','../../config/environment'];(function(_0xf1fd0d,_0x186b34){var _0x3b3a0f=function(_0x2456e0){while(--_0x2456e0){_0xf1fd0d['push'](_0xf1fd0d['shift']());}};_0x3b3a0f(++_0x186b34);}(_0xba34,0x119));var _0x4ba3=function(_0x1ae6ec,_0x82c08e){_0x1ae6ec=_0x1ae6ec-0x0;var _0x50dcb1=_0xba34[_0x1ae6ec];return _0x50dcb1;};'use strict';var _=require(_0x4ba3('0x0'));var util=require(_0x4ba3('0x1'));var logger=require(_0x4ba3('0x2'))(_0x4ba3('0x3'));var moment=require(_0x4ba3('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x4ba3('0x5'));var config=require(_0x4ba3('0x6'));var attributes=require(_0x4ba3('0x7'));var integrations=require(_0x4ba3('0x8'));module[_0x4ba3('0x9')]=function(_0xb88621,_0xe5f99a){return _0xb88621['define'](_0x4ba3('0xa'),attributes,{'tableName':_0x4ba3('0xb'),'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 efa7159..ebad966 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 _0x187d=['error','message','catch','GetFreshsalesAccount','FreshsalesAccount','findAll','options','raw','attributes','include','model','find','where','map','ShowFreshsalesAccount','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x217603,_0x56a7da){var _0x3d8891=function(_0x14c664){while(--_0x14c664){_0x217603['push'](_0x217603['shift']());}};_0x3d8891(++_0x56a7da);}(_0x187d,0x93));var _0xd187=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0x187d[_0x173d7e];return _0x2220d6;};'use strict';var _=require(_0xd187('0x0'));var util=require('util');var moment=require(_0xd187('0x1'));var BPromise=require(_0xd187('0x2'));var rs=require(_0xd187('0x3'));var fs=require('fs');var Redis=require(_0xd187('0x4'));var db=require(_0xd187('0x5'))['db'];var utils=require(_0xd187('0x6'));var logger=require('../../config/logger')(_0xd187('0x7'));var config=require(_0xd187('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd187('0x9')][_0xd187('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x444a60,_0x1d3fe4,_0x28ce2f){return new BPromise(function(_0x2d6992,_0x358c45){return client[_0xd187('0xb')](_0x444a60,_0x28ce2f)['then'](function(_0x342539){logger[_0xd187('0xc')](_0xd187('0xd'),_0x1d3fe4,_0xd187('0xe'));logger[_0xd187('0xf')](_0xd187('0x10'),_0x1d3fe4,'request\x20sent',JSON[_0xd187('0x11')](_0x342539));if(_0x342539[_0xd187('0x12')]){if(_0x342539[_0xd187('0x12')]['code']===0x1f4){logger[_0xd187('0x12')](_0xd187('0xd'),_0x1d3fe4,_0x342539[_0xd187('0x12')]['message']);return _0x358c45(_0x342539[_0xd187('0x12')][_0xd187('0x13')]);}logger[_0xd187('0x12')](_0xd187('0xd'),_0x1d3fe4,_0x342539['error'][_0xd187('0x13')]);return _0x2d6992(_0x342539[_0xd187('0x12')][_0xd187('0x13')]);}else{logger[_0xd187('0xc')]('FreshsalesAccount,\x20%s,\x20%s',_0x1d3fe4,_0xd187('0xe'));_0x2d6992(_0x342539['result']['message']);}})[_0xd187('0x14')](function(_0x5a4986){logger['error'](_0xd187('0xd'),_0x1d3fe4,_0x5a4986);_0x358c45(_0x5a4986);});});}exports[_0xd187('0x15')]=function(_0x374fe0){var _0x10d9fd=this;return new Promise(function(_0x21df74,_0x253a7e){return db[_0xd187('0x16')][_0xd187('0x17')]({'raw':_0x374fe0[_0xd187('0x18')]?_0x374fe0[_0xd187('0x18')][_0xd187('0x19')]===undefined?!![]:![]:!![],'where':_0x374fe0[_0xd187('0x18')]?_0x374fe0[_0xd187('0x18')]['where']||null:null,'attributes':_0x374fe0[_0xd187('0x18')]?_0x374fe0[_0xd187('0x18')][_0xd187('0x1a')]||null:null,'limit':_0x374fe0['options']?_0x374fe0['options']['limit']||null:null,'include':_0x374fe0[_0xd187('0x18')]?_0x374fe0[_0xd187('0x18')][_0xd187('0x1b')]?_['map'](_0x374fe0[_0xd187('0x18')]['include'],function(_0x145771){return{'model':db[_0x145771['model']],'as':_0x145771['as'],'attributes':_0x145771[_0xd187('0x1a')],'include':_0x145771['include']?_['map'](_0x145771[_0xd187('0x1b')],function(_0x4d992b){return{'model':db[_0x4d992b[_0xd187('0x1c')]],'as':_0x4d992b['as'],'attributes':_0x4d992b[_0xd187('0x1a')],'include':_0x4d992b['include']?_['map'](_0x4d992b[_0xd187('0x1b')],function(_0xeff822){return{'model':db[_0xeff822[_0xd187('0x1c')]],'as':_0xeff822['as'],'attributes':_0xeff822[_0xd187('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2a20ed){logger[_0xd187('0xc')]('GetFreshsalesAccount',_0x374fe0);logger[_0xd187('0xf')](_0xd187('0x15'),_0x374fe0,JSON[_0xd187('0x11')](_0x2a20ed));_0x21df74(_0x2a20ed);})['catch'](function(_0x15e2e8){logger['error'](_0xd187('0x15'),_0x15e2e8[_0xd187('0x13')],_0x374fe0);_0x253a7e(_0x10d9fd[_0xd187('0x12')](0x1f4,_0x15e2e8[_0xd187('0x13')]));});});};exports['ShowFreshsalesAccount']=function(_0x140e54){var _0xb38778=this;return new Promise(function(_0x5bba10,_0x4cc587){return db[_0xd187('0x16')][_0xd187('0x1d')]({'raw':_0x140e54[_0xd187('0x18')]?_0x140e54[_0xd187('0x18')][_0xd187('0x19')]===undefined?!![]:![]:!![],'where':_0x140e54[_0xd187('0x18')]?_0x140e54[_0xd187('0x18')][_0xd187('0x1e')]||null:null,'attributes':_0x140e54['options']?_0x140e54[_0xd187('0x18')][_0xd187('0x1a')]||null:null,'include':_0x140e54[_0xd187('0x18')]?_0x140e54['options'][_0xd187('0x1b')]?_['map'](_0x140e54[_0xd187('0x18')][_0xd187('0x1b')],function(_0xf5b94e){return{'model':db[_0xf5b94e['model']],'as':_0xf5b94e['as'],'attributes':_0xf5b94e['attributes'],'include':_0xf5b94e[_0xd187('0x1b')]?_[_0xd187('0x1f')](_0xf5b94e['include'],function(_0x4591e0){return{'model':db[_0x4591e0[_0xd187('0x1c')]],'as':_0x4591e0['as'],'attributes':_0x4591e0[_0xd187('0x1a')],'include':_0x4591e0['include']?_['map'](_0x4591e0[_0xd187('0x1b')],function(_0xf32da2){return{'model':db[_0xf32da2['model']],'as':_0xf32da2['as'],'attributes':_0xf32da2['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x31d7f4){logger['info'](_0xd187('0x20'),_0x140e54);logger[_0xd187('0xf')]('ShowFreshsalesAccount',_0x140e54,JSON[_0xd187('0x11')](_0x31d7f4));_0x5bba10(_0x31d7f4);})['catch'](function(_0x293ce9){logger[_0xd187('0x12')]('ShowFreshsalesAccount',_0x293ce9[_0xd187('0x13')],_0x140e54);_0x4cc587(_0xb38778[_0xd187('0x12')](0x1f4,_0x293ce9['message']));});});}; \ No newline at end of file +var _0x90b1=['ShowFreshsalesAccount','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','http','request','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetFreshsalesAccount','FreshsalesAccount','findAll','options','raw','where','attributes','limit','map','include','model','then','find'];(function(_0x3fd322,_0x5c710e){var _0x235096=function(_0x52f7bc){while(--_0x52f7bc){_0x3fd322['push'](_0x3fd322['shift']());}};_0x235096(++_0x5c710e);}(_0x90b1,0x1bb));var _0x190b=function(_0x21f013,_0x3a2050){_0x21f013=_0x21f013-0x0;var _0x1addf8=_0x90b1[_0x21f013];return _0x1addf8;};'use strict';var _=require(_0x190b('0x0'));var util=require(_0x190b('0x1'));var moment=require(_0x190b('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x190b('0x3'));var db=require(_0x190b('0x4'))['db'];var utils=require(_0x190b('0x5'));var logger=require(_0x190b('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x190b('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x34a689,_0x3b57f7,_0x626aa1){return new BPromise(function(_0x311161,_0x802924){return client[_0x190b('0x8')](_0x34a689,_0x626aa1)['then'](function(_0x14b93d){logger[_0x190b('0x9')](_0x190b('0xa'),_0x3b57f7,_0x190b('0xb'));logger[_0x190b('0xc')](_0x190b('0xd'),_0x3b57f7,_0x190b('0xb'),JSON[_0x190b('0xe')](_0x14b93d));if(_0x14b93d['error']){if(_0x14b93d[_0x190b('0xf')][_0x190b('0x10')]===0x1f4){logger['error'](_0x190b('0xa'),_0x3b57f7,_0x14b93d[_0x190b('0xf')][_0x190b('0x11')]);return _0x802924(_0x14b93d[_0x190b('0xf')][_0x190b('0x11')]);}logger[_0x190b('0xf')](_0x190b('0xa'),_0x3b57f7,_0x14b93d[_0x190b('0xf')][_0x190b('0x11')]);return _0x311161(_0x14b93d[_0x190b('0xf')][_0x190b('0x11')]);}else{logger[_0x190b('0x9')](_0x190b('0xa'),_0x3b57f7,_0x190b('0xb'));_0x311161(_0x14b93d[_0x190b('0x12')][_0x190b('0x11')]);}})[_0x190b('0x13')](function(_0x5c63d9){logger[_0x190b('0xf')]('FreshsalesAccount,\x20%s,\x20%s',_0x3b57f7,_0x5c63d9);_0x802924(_0x5c63d9);});});}exports[_0x190b('0x14')]=function(_0x21e458){var _0x56d07a=this;return new Promise(function(_0x16c009,_0x50a3c4){return db[_0x190b('0x15')][_0x190b('0x16')]({'raw':_0x21e458[_0x190b('0x17')]?_0x21e458[_0x190b('0x17')][_0x190b('0x18')]===undefined?!![]:![]:!![],'where':_0x21e458[_0x190b('0x17')]?_0x21e458['options'][_0x190b('0x19')]||null:null,'attributes':_0x21e458[_0x190b('0x17')]?_0x21e458['options'][_0x190b('0x1a')]||null:null,'limit':_0x21e458['options']?_0x21e458['options'][_0x190b('0x1b')]||null:null,'include':_0x21e458[_0x190b('0x17')]?_0x21e458[_0x190b('0x17')]['include']?_[_0x190b('0x1c')](_0x21e458[_0x190b('0x17')][_0x190b('0x1d')],function(_0x292ce3){return{'model':db[_0x292ce3[_0x190b('0x1e')]],'as':_0x292ce3['as'],'attributes':_0x292ce3[_0x190b('0x1a')],'include':_0x292ce3[_0x190b('0x1d')]?_['map'](_0x292ce3['include'],function(_0x262a63){return{'model':db[_0x262a63[_0x190b('0x1e')]],'as':_0x262a63['as'],'attributes':_0x262a63['attributes'],'include':_0x262a63['include']?_[_0x190b('0x1c')](_0x262a63['include'],function(_0x328e5e){return{'model':db[_0x328e5e[_0x190b('0x1e')]],'as':_0x328e5e['as'],'attributes':_0x328e5e['attributes']};}):[]};}):[]};}):[]:[]})[_0x190b('0x1f')](function(_0x1deea6){logger['info'](_0x190b('0x14'),_0x21e458);logger[_0x190b('0xc')](_0x190b('0x14'),_0x21e458,JSON['stringify'](_0x1deea6));_0x16c009(_0x1deea6);})['catch'](function(_0x3730cc){logger['error'](_0x190b('0x14'),_0x3730cc[_0x190b('0x11')],_0x21e458);_0x50a3c4(_0x56d07a['error'](0x1f4,_0x3730cc[_0x190b('0x11')]));});});};exports['ShowFreshsalesAccount']=function(_0x40d060){var _0x4ff5a6=this;return new Promise(function(_0x19600d,_0x5650e1){return db[_0x190b('0x15')][_0x190b('0x20')]({'raw':_0x40d060['options']?_0x40d060[_0x190b('0x17')][_0x190b('0x18')]===undefined?!![]:![]:!![],'where':_0x40d060[_0x190b('0x17')]?_0x40d060[_0x190b('0x17')][_0x190b('0x19')]||null:null,'attributes':_0x40d060[_0x190b('0x17')]?_0x40d060[_0x190b('0x17')][_0x190b('0x1a')]||null:null,'include':_0x40d060['options']?_0x40d060['options'][_0x190b('0x1d')]?_[_0x190b('0x1c')](_0x40d060['options'][_0x190b('0x1d')],function(_0x2dcd39){return{'model':db[_0x2dcd39[_0x190b('0x1e')]],'as':_0x2dcd39['as'],'attributes':_0x2dcd39[_0x190b('0x1a')],'include':_0x2dcd39[_0x190b('0x1d')]?_[_0x190b('0x1c')](_0x2dcd39[_0x190b('0x1d')],function(_0x5492b0){return{'model':db[_0x5492b0['model']],'as':_0x5492b0['as'],'attributes':_0x5492b0[_0x190b('0x1a')],'include':_0x5492b0[_0x190b('0x1d')]?_[_0x190b('0x1c')](_0x5492b0['include'],function(_0x33e9db){return{'model':db[_0x33e9db[_0x190b('0x1e')]],'as':_0x33e9db['as'],'attributes':_0x33e9db[_0x190b('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2a8260){logger['info']('ShowFreshsalesAccount',_0x40d060);logger[_0x190b('0xc')](_0x190b('0x21'),_0x40d060,JSON['stringify'](_0x2a8260));_0x19600d(_0x2a8260);})[_0x190b('0x13')](function(_0xfd0d62){logger[_0x190b('0xf')]('ShowFreshsalesAccount',_0xfd0d62[_0x190b('0x11')],_0x40d060);_0x5650e1(_0x4ff5a6[_0x190b('0xf')](0x1f4,_0xfd0d62['message']));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index fb6b3fa..aedab97 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 _0xbe5a=['put','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/subjects','getSubjects','/:id/descriptions','/:id/fields','getFields','post','create'];(function(_0x8de415,_0x797f23){var _0x46b8fa=function(_0x3071a7){while(--_0x3071a7){_0x8de415['push'](_0x8de415['shift']());}};_0x46b8fa(++_0x797f23);}(_0xbe5a,0x130));var _0xabe5=function(_0xd1c39b,_0x16f0c6){_0xd1c39b=_0xd1c39b-0x0;var _0x58f5bc=_0xbe5a[_0xd1c39b];return _0x58f5bc;};'use strict';var multer=require(_0xabe5('0x0'));var util=require(_0xabe5('0x1'));var path=require(_0xabe5('0x2'));var timeout=require(_0xabe5('0x3'));var express=require(_0xabe5('0x4'));var router=express[_0xabe5('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xabe5('0x6'));var interaction=require(_0xabe5('0x7'));var config=require(_0xabe5('0x8'));var controller=require('./intFreshsalesConfiguration.controller');router[_0xabe5('0x9')]('/',auth[_0xabe5('0xa')](),controller[_0xabe5('0xb')]);router['get'](_0xabe5('0xc'),auth[_0xabe5('0xa')](),controller[_0xabe5('0xd')]);router[_0xabe5('0x9')](_0xabe5('0xe'),auth[_0xabe5('0xa')](),controller[_0xabe5('0xf')]);router[_0xabe5('0x9')](_0xabe5('0x10'),auth[_0xabe5('0xa')](),controller['getDescriptions']);router[_0xabe5('0x9')](_0xabe5('0x11'),auth[_0xabe5('0xa')](),controller[_0xabe5('0x12')]);router[_0xabe5('0x13')]('/',auth[_0xabe5('0xa')](),controller[_0xabe5('0x14')]);router[_0xabe5('0x15')]('/:id',auth[_0xabe5('0xa')](),controller[_0xabe5('0x16')]);router[_0xabe5('0x17')](_0xabe5('0xc'),auth[_0xabe5('0xa')](),controller['destroy']);module[_0xabe5('0x18')]=router; \ No newline at end of file +var _0x5295=['get','index','/:id','isAuthenticated','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/fields','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x3795ff,_0x26f700){var _0x51cd3e=function(_0x99343c){while(--_0x99343c){_0x3795ff['push'](_0x3795ff['shift']());}};_0x51cd3e(++_0x26f700);}(_0x5295,0x17d));var _0x5529=function(_0x18c45d,_0x53e3e8){_0x18c45d=_0x18c45d-0x0;var _0x32db62=_0x5295[_0x18c45d];return _0x32db62;};'use strict';var multer=require(_0x5529('0x0'));var util=require(_0x5529('0x1'));var path=require(_0x5529('0x2'));var timeout=require(_0x5529('0x3'));var express=require(_0x5529('0x4'));var router=express[_0x5529('0x5')]();var fs_extra=require(_0x5529('0x6'));var auth=require(_0x5529('0x7'));var interaction=require(_0x5529('0x8'));var config=require(_0x5529('0x9'));var controller=require('./intFreshsalesConfiguration.controller');router[_0x5529('0xa')]('/',auth['isAuthenticated'](),controller[_0x5529('0xb')]);router['get'](_0x5529('0xc'),auth[_0x5529('0xd')](),controller['show']);router[_0x5529('0xa')](_0x5529('0xe'),auth[_0x5529('0xd')](),controller[_0x5529('0xf')]);router[_0x5529('0xa')](_0x5529('0x10'),auth[_0x5529('0xd')](),controller[_0x5529('0x11')]);router[_0x5529('0xa')](_0x5529('0x12'),auth['isAuthenticated'](),controller['getFields']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x5529('0x13')](_0x5529('0xc'),auth[_0x5529('0xd')](),controller[_0x5529('0x14')]);router[_0x5529('0x15')](_0x5529('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x5529('0x16')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index 2f665dc..6e8a5c6 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 _0x9104=['STRING'];(function(_0x4f2a47,_0x5e2086){var _0xa5460d=function(_0x2f2be0){while(--_0x2f2be0){_0x4f2a47['push'](_0x4f2a47['shift']());}};_0xa5460d(++_0x5e2086);}(_0x9104,0x121));var _0x4910=function(_0x230202,_0x371c32){_0x230202=_0x230202-0x0;var _0x522289=_0x9104[_0x230202];return _0x522289;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x4910('0x0')]},'description':{'type':Sequelize[_0x4910('0x0')]}}; \ No newline at end of file +var _0x375b=['sequelize','exports','STRING'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0x375b,0x7b));var _0xb375=function(_0x2ec5c8,_0x24630d){_0x2ec5c8=_0x2ec5c8-0x0;var _0x5b1419=_0x375b[_0x2ec5c8];return _0x5b1419;};'use strict';var Sequelize=require(_0xb375('0x0'));module[_0xb375('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xb375('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index ceeed84..6026138 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 _0xd2f3=['fast-json-patch','bluebird','mustache','util','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','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','FreshsalesConfiguration','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','keys','fields','includeAll','find','create','body','getSubjects','findOne','FreshsalesField','getDescriptions','getFields','eml-format','rimraf','zip-dir'];(function(_0xe85653,_0x1f8530){var _0x3833da=function(_0x1e13f5){while(--_0x1e13f5){_0xe85653['push'](_0xe85653['shift']());}};_0x3833da(++_0x1f8530);}(_0xd2f3,0x1b0));var _0x3d2f=function(_0x5ddebc,_0xae4141){_0x5ddebc=_0x5ddebc-0x0;var _0x1e3308=_0xd2f3[_0x5ddebc];return _0x1e3308;};'use strict';var emlformat=require(_0x3d2f('0x0'));var rimraf=require(_0x3d2f('0x1'));var zipdir=require(_0x3d2f('0x2'));var jsonpatch=require(_0x3d2f('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3d2f('0x4'));var Mustache=require(_0x3d2f('0x5'));var util=require(_0x3d2f('0x6'));var path=require(_0x3d2f('0x7'));var sox=require(_0x3d2f('0x8'));var csv=require(_0x3d2f('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3d2f('0xa'));var _=require('lodash');var squel=require(_0x3d2f('0xb'));var crypto=require(_0x3d2f('0xc'));var jsforce=require(_0x3d2f('0xd'));var deskjs=require(_0x3d2f('0xe'));var toCsv=require(_0x3d2f('0x9'));var querystring=require(_0x3d2f('0xf'));var Papa=require(_0x3d2f('0x10'));var Redis=require(_0x3d2f('0x11'));var authService=require(_0x3d2f('0x12'));var qs=require(_0x3d2f('0x13'));var as=require(_0x3d2f('0x14'));var hardwareService=require(_0x3d2f('0x15'));var logger=require(_0x3d2f('0x16'))(_0x3d2f('0x17'));var utils=require(_0x3d2f('0x18'));var config=require(_0x3d2f('0x19'));var licenseUtil=require(_0x3d2f('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5a7816,_0x40a829){_0x40a829=_0x40a829||0xcc;return function(_0x4b4437){if(_0x4b4437){return _0x5a7816[_0x3d2f('0x1b')](_0x40a829);}return _0x5a7816[_0x3d2f('0x1c')](_0x40a829)[_0x3d2f('0x1d')]();};}function respondWithResult(_0x55773d,_0x23af0f){_0x23af0f=_0x23af0f||0xc8;return function(_0x357f26){if(_0x357f26){return _0x55773d[_0x3d2f('0x1c')](_0x23af0f)[_0x3d2f('0x1e')](_0x357f26);}};}function respondWithFilteredResult(_0x13c96a,_0x2ff552){return function(_0x1bbab7){if(_0x1bbab7){var _0xecda34=typeof _0x2ff552[_0x3d2f('0x1f')]===_0x3d2f('0x20')&&typeof _0x2ff552[_0x3d2f('0x21')]===_0x3d2f('0x20');var _0x1c3e8f=_0x1bbab7[_0x3d2f('0x22')];var _0x1b4a03=_0xecda34?0x0:_0x2ff552[_0x3d2f('0x1f')];var _0x1b04da=_0xecda34?_0x1bbab7[_0x3d2f('0x22')]:_0x2ff552[_0x3d2f('0x1f')]+_0x2ff552[_0x3d2f('0x21')];var _0x335cbf;if(_0x1b04da>=_0x1c3e8f){_0x1b04da=_0x1c3e8f;_0x335cbf=0xc8;}else{_0x335cbf=0xce;}_0x13c96a[_0x3d2f('0x1c')](_0x335cbf);return _0x13c96a[_0x3d2f('0x23')](_0x3d2f('0x24'),_0x1b4a03+'-'+_0x1b04da+'/'+_0x1c3e8f)['json'](_0x1bbab7);}return null;};}function patchUpdates(_0x815b31){return function(_0x279c4d){try{jsonpatch[_0x3d2f('0x25')](_0x279c4d,_0x815b31,!![]);}catch(_0xfd9ae9){return BPromise[_0x3d2f('0x26')](_0xfd9ae9);}return _0x279c4d[_0x3d2f('0x27')]();};}function saveUpdates(_0x3ccb07,_0x1f0f9b){return function(_0x38f164){if(_0x38f164){return _0x38f164[_0x3d2f('0x28')](_0x3ccb07)[_0x3d2f('0x29')](function(_0x4eca7d){return _0x4eca7d;});}return null;};}function removeEntity(_0x4d62fa,_0x123e7d){return function(_0x5eecf7){if(_0x5eecf7){return _0x5eecf7[_0x3d2f('0x2a')]()['then'](function(){_0x4d62fa[_0x3d2f('0x1c')](0xcc)[_0x3d2f('0x1d')]();});}};}function handleEntityNotFound(_0x284302,_0x3cd1b3){return function(_0x3c4279){if(!_0x3c4279){_0x284302[_0x3d2f('0x1b')](0x194);}return _0x3c4279;};}function handleError(_0x538146,_0x13277b){_0x13277b=_0x13277b||0x1f4;return function(_0x1bf1c2){logger[_0x3d2f('0x2b')](_0x1bf1c2[_0x3d2f('0x2c')]);if(_0x1bf1c2[_0x3d2f('0x2d')]){delete _0x1bf1c2['name'];}_0x538146['status'](_0x13277b)[_0x3d2f('0x2e')](_0x1bf1c2);};}exports[_0x3d2f('0x2f')]=function(_0x237d58,_0x28b26c){var _0x19dce4={},_0x479623={},_0x1bd1fa={'count':0x0,'rows':[]};var _0x3fb4ec=_['map'](db[_0x3d2f('0x30')][_0x3d2f('0x31')],function(_0xdfb620){return{'name':_0xdfb620[_0x3d2f('0x32')],'type':_0xdfb620[_0x3d2f('0x33')][_0x3d2f('0x34')]};});_0x479623[_0x3d2f('0x35')]=_[_0x3d2f('0x36')](_0x3fb4ec,_0x3d2f('0x2d'));_0x479623['query']=_['keys'](_0x237d58[_0x3d2f('0x37')]);_0x479623[_0x3d2f('0x38')]=_[_0x3d2f('0x39')](_0x479623['model'],_0x479623[_0x3d2f('0x37')]);_0x19dce4['attributes']=_[_0x3d2f('0x39')](_0x479623[_0x3d2f('0x35')],qs['fields'](_0x237d58[_0x3d2f('0x37')]['fields']));_0x19dce4[_0x3d2f('0x3a')]=_0x19dce4[_0x3d2f('0x3a')][_0x3d2f('0x3b')]?_0x19dce4[_0x3d2f('0x3a')]:_0x479623['model'];if(!_0x237d58[_0x3d2f('0x37')][_0x3d2f('0x3c')](_0x3d2f('0x3d'))){_0x19dce4[_0x3d2f('0x21')]=qs[_0x3d2f('0x21')](_0x237d58[_0x3d2f('0x37')]['limit']);_0x19dce4[_0x3d2f('0x1f')]=qs[_0x3d2f('0x1f')](_0x237d58[_0x3d2f('0x37')][_0x3d2f('0x1f')]);}_0x19dce4[_0x3d2f('0x3e')]=qs['sort'](_0x237d58[_0x3d2f('0x37')][_0x3d2f('0x3f')]);_0x19dce4[_0x3d2f('0x40')]=qs[_0x3d2f('0x38')](_[_0x3d2f('0x41')](_0x237d58[_0x3d2f('0x37')],_0x479623['filters']),_0x3fb4ec);if(_0x237d58[_0x3d2f('0x37')][_0x3d2f('0x42')]){_0x19dce4[_0x3d2f('0x40')]=_[_0x3d2f('0x43')](_0x19dce4[_0x3d2f('0x40')],{'$or':_[_0x3d2f('0x36')](_0x3fb4ec,function(_0x4292b0){if(_0x4292b0[_0x3d2f('0x33')]!==_0x3d2f('0x44')){var _0x5f2308={};_0x5f2308[_0x4292b0[_0x3d2f('0x2d')]]={'$like':'%'+_0x237d58[_0x3d2f('0x37')][_0x3d2f('0x42')]+'%'};return _0x5f2308;}})});}_0x19dce4=_['merge']({},_0x19dce4,_0x237d58[_0x3d2f('0x45')]);var _0x3cc1b6={'where':_0x19dce4[_0x3d2f('0x40')]};return db[_0x3d2f('0x30')]['count'](_0x3cc1b6)[_0x3d2f('0x29')](function(_0x1b8f3b){_0x1bd1fa[_0x3d2f('0x22')]=_0x1b8f3b;if(_0x237d58[_0x3d2f('0x37')]['includeAll']){_0x19dce4[_0x3d2f('0x46')]=[{'all':!![]}];}return db[_0x3d2f('0x30')][_0x3d2f('0x47')](_0x19dce4);})[_0x3d2f('0x29')](function(_0x4ca33b){_0x1bd1fa[_0x3d2f('0x48')]=_0x4ca33b;return _0x1bd1fa;})[_0x3d2f('0x29')](respondWithFilteredResult(_0x28b26c,_0x19dce4))[_0x3d2f('0x49')](handleError(_0x28b26c,null));};exports[_0x3d2f('0x4a')]=function(_0x421a97,_0x43cb39){var _0x29fe78={'raw':![],'where':{'id':_0x421a97[_0x3d2f('0x4b')]['id']}},_0x57bd2a={};_0x57bd2a[_0x3d2f('0x35')]=_[_0x3d2f('0x4c')](db[_0x3d2f('0x30')]['rawAttributes']);_0x57bd2a[_0x3d2f('0x37')]=_[_0x3d2f('0x4c')](_0x421a97['query']);_0x57bd2a[_0x3d2f('0x38')]=_[_0x3d2f('0x39')](_0x57bd2a[_0x3d2f('0x35')],_0x57bd2a[_0x3d2f('0x37')]);_0x29fe78['attributes']=_['intersection'](_0x57bd2a['model'],qs[_0x3d2f('0x4d')](_0x421a97[_0x3d2f('0x37')][_0x3d2f('0x4d')]));_0x29fe78[_0x3d2f('0x3a')]=_0x29fe78[_0x3d2f('0x3a')][_0x3d2f('0x3b')]?_0x29fe78[_0x3d2f('0x3a')]:_0x57bd2a[_0x3d2f('0x35')];if(_0x421a97['query'][_0x3d2f('0x4e')]){_0x29fe78[_0x3d2f('0x46')]=[{'all':!![]}];}_0x29fe78=_[_0x3d2f('0x43')]({},_0x29fe78,_0x421a97[_0x3d2f('0x45')]);return db[_0x3d2f('0x30')][_0x3d2f('0x4f')](_0x29fe78)[_0x3d2f('0x29')](handleEntityNotFound(_0x43cb39,null))[_0x3d2f('0x29')](respondWithResult(_0x43cb39,null))['catch'](handleError(_0x43cb39,null));};exports[_0x3d2f('0x50')]=function(_0x2bbb8b,_0x841597){return db[_0x3d2f('0x30')][_0x3d2f('0x50')](_0x2bbb8b[_0x3d2f('0x51')],{})['then'](respondWithResult(_0x841597,0xc9))['catch'](handleError(_0x841597,null));};exports[_0x3d2f('0x28')]=function(_0x5467c7,_0x8345ca){if(_0x5467c7[_0x3d2f('0x51')]['id']){delete _0x5467c7[_0x3d2f('0x51')]['id'];}return db[_0x3d2f('0x30')][_0x3d2f('0x4f')]({'where':{'id':_0x5467c7['params']['id']}})[_0x3d2f('0x29')](handleEntityNotFound(_0x8345ca,null))['then'](saveUpdates(_0x5467c7['body'],null))[_0x3d2f('0x29')](respondWithResult(_0x8345ca,null))['catch'](handleError(_0x8345ca,null));};exports[_0x3d2f('0x2a')]=function(_0x4aeb4c,_0xb36e42){return db[_0x3d2f('0x30')]['find']({'where':{'id':_0x4aeb4c['params']['id']}})['then'](handleEntityNotFound(_0xb36e42,null))[_0x3d2f('0x29')](removeEntity(_0xb36e42,null))[_0x3d2f('0x49')](handleError(_0xb36e42,null));};exports[_0x3d2f('0x52')]=function(_0x47eac8,_0x25d505,_0x1a77a1){var _0x18e12b={};var _0x47fe82={};var _0x3f4ee3;var _0x15adef;return db[_0x3d2f('0x30')][_0x3d2f('0x53')]({'where':{'id':_0x47eac8[_0x3d2f('0x4b')]['id']}})[_0x3d2f('0x29')](handleEntityNotFound(_0x25d505,null))['then'](function(_0xa2a6c7){if(_0xa2a6c7){_0x3f4ee3=_0xa2a6c7;_0x47fe82['model']=_[_0x3d2f('0x4c')](db[_0x3d2f('0x54')]['rawAttributes']);_0x47fe82[_0x3d2f('0x37')]=_['keys'](_0x47eac8[_0x3d2f('0x37')]);_0x47fe82[_0x3d2f('0x38')]=_[_0x3d2f('0x39')](_0x47fe82[_0x3d2f('0x35')],_0x47fe82[_0x3d2f('0x37')]);_0x18e12b[_0x3d2f('0x3a')]=_[_0x3d2f('0x39')](_0x47fe82[_0x3d2f('0x35')],qs[_0x3d2f('0x4d')](_0x47eac8['query'][_0x3d2f('0x4d')]));_0x18e12b[_0x3d2f('0x3a')]=_0x18e12b[_0x3d2f('0x3a')][_0x3d2f('0x3b')]?_0x18e12b[_0x3d2f('0x3a')]:_0x47fe82[_0x3d2f('0x35')];_0x18e12b[_0x3d2f('0x3e')]=qs[_0x3d2f('0x3f')](_0x47eac8[_0x3d2f('0x37')][_0x3d2f('0x3f')]);_0x18e12b[_0x3d2f('0x40')]=qs[_0x3d2f('0x38')](_[_0x3d2f('0x41')](_0x47eac8['query'],_0x47fe82[_0x3d2f('0x38')]));if(_0x47eac8[_0x3d2f('0x37')][_0x3d2f('0x42')]){_0x18e12b['where']=_[_0x3d2f('0x43')](_0x18e12b[_0x3d2f('0x40')],{'$or':_[_0x3d2f('0x36')](_0x18e12b['attributes'],function(_0x51a684){var _0x1c147b={};_0x1c147b[_0x51a684]={'$like':'%'+_0x47eac8[_0x3d2f('0x37')]['filter']+'%'};return _0x1c147b;})});}_0x18e12b=_[_0x3d2f('0x43')]({},_0x18e12b,_0x47eac8[_0x3d2f('0x45')]);return _0x3f4ee3[_0x3d2f('0x52')](_0x18e12b);}})[_0x3d2f('0x29')](function(_0x29f2e9){if(_0x29f2e9){_0x15adef=_0x29f2e9[_0x3d2f('0x3b')];if(!_0x47eac8[_0x3d2f('0x37')][_0x3d2f('0x3c')](_0x3d2f('0x3d'))){_0x18e12b['limit']=qs[_0x3d2f('0x21')](_0x47eac8[_0x3d2f('0x37')]['limit']);_0x18e12b[_0x3d2f('0x1f')]=qs[_0x3d2f('0x1f')](_0x47eac8[_0x3d2f('0x37')][_0x3d2f('0x1f')]);}return _0x3f4ee3[_0x3d2f('0x52')](_0x18e12b);}})[_0x3d2f('0x29')](function(_0x11836a){if(_0x11836a){return _0x11836a?{'count':_0x15adef,'rows':_0x11836a}:null;}})[_0x3d2f('0x29')](respondWithResult(_0x25d505,null))[_0x3d2f('0x49')](handleError(_0x25d505,null));};exports[_0x3d2f('0x55')]=function(_0x231c5c,_0x4fb375,_0x1b6698){var _0x472d88={};var _0x54a2ca={};var _0x489d04;var _0xad4e46;return db[_0x3d2f('0x30')][_0x3d2f('0x53')]({'where':{'id':_0x231c5c[_0x3d2f('0x4b')]['id']}})[_0x3d2f('0x29')](handleEntityNotFound(_0x4fb375,null))['then'](function(_0x230db0){if(_0x230db0){_0x489d04=_0x230db0;_0x54a2ca[_0x3d2f('0x35')]=_[_0x3d2f('0x4c')](db[_0x3d2f('0x54')][_0x3d2f('0x31')]);_0x54a2ca[_0x3d2f('0x37')]=_['keys'](_0x231c5c[_0x3d2f('0x37')]);_0x54a2ca['filters']=_[_0x3d2f('0x39')](_0x54a2ca[_0x3d2f('0x35')],_0x54a2ca[_0x3d2f('0x37')]);_0x472d88[_0x3d2f('0x3a')]=_[_0x3d2f('0x39')](_0x54a2ca[_0x3d2f('0x35')],qs[_0x3d2f('0x4d')](_0x231c5c[_0x3d2f('0x37')][_0x3d2f('0x4d')]));_0x472d88[_0x3d2f('0x3a')]=_0x472d88[_0x3d2f('0x3a')][_0x3d2f('0x3b')]?_0x472d88['attributes']:_0x54a2ca['model'];_0x472d88[_0x3d2f('0x3e')]=qs[_0x3d2f('0x3f')](_0x231c5c['query'][_0x3d2f('0x3f')]);_0x472d88[_0x3d2f('0x40')]=qs[_0x3d2f('0x38')](_[_0x3d2f('0x41')](_0x231c5c[_0x3d2f('0x37')],_0x54a2ca[_0x3d2f('0x38')]));if(_0x231c5c[_0x3d2f('0x37')][_0x3d2f('0x42')]){_0x472d88[_0x3d2f('0x40')]=_['merge'](_0x472d88[_0x3d2f('0x40')],{'$or':_[_0x3d2f('0x36')](_0x472d88[_0x3d2f('0x3a')],function(_0x19c218){var _0x14f772={};_0x14f772[_0x19c218]={'$like':'%'+_0x231c5c['query']['filter']+'%'};return _0x14f772;})});}_0x472d88=_[_0x3d2f('0x43')]({},_0x472d88,_0x231c5c[_0x3d2f('0x45')]);return _0x489d04[_0x3d2f('0x55')](_0x472d88);}})['then'](function(_0x1d897d){if(_0x1d897d){_0xad4e46=_0x1d897d[_0x3d2f('0x3b')];if(!_0x231c5c[_0x3d2f('0x37')][_0x3d2f('0x3c')](_0x3d2f('0x3d'))){_0x472d88['limit']=qs[_0x3d2f('0x21')](_0x231c5c[_0x3d2f('0x37')][_0x3d2f('0x21')]);_0x472d88[_0x3d2f('0x1f')]=qs[_0x3d2f('0x1f')](_0x231c5c[_0x3d2f('0x37')]['offset']);}return _0x489d04[_0x3d2f('0x55')](_0x472d88);}})[_0x3d2f('0x29')](function(_0x4fa029){if(_0x4fa029){return _0x4fa029?{'count':_0xad4e46,'rows':_0x4fa029}:null;}})[_0x3d2f('0x29')](respondWithResult(_0x4fb375,null))[_0x3d2f('0x49')](handleError(_0x4fb375,null));};exports[_0x3d2f('0x56')]=function(_0x532640,_0x319b6b,_0x3fff53){var _0x190798={};var _0xdd7bb2={};var _0x13e50a;var _0x6e2b17;return db[_0x3d2f('0x30')][_0x3d2f('0x53')]({'where':{'id':_0x532640['params']['id']}})[_0x3d2f('0x29')](handleEntityNotFound(_0x319b6b,null))[_0x3d2f('0x29')](function(_0x552114){if(_0x552114){_0x13e50a=_0x552114;_0xdd7bb2[_0x3d2f('0x35')]=_['keys'](db['FreshsalesField'][_0x3d2f('0x31')]);_0xdd7bb2[_0x3d2f('0x37')]=_['keys'](_0x532640['query']);_0xdd7bb2[_0x3d2f('0x38')]=_[_0x3d2f('0x39')](_0xdd7bb2[_0x3d2f('0x35')],_0xdd7bb2['query']);_0x190798[_0x3d2f('0x3a')]=_['intersection'](_0xdd7bb2['model'],qs[_0x3d2f('0x4d')](_0x532640[_0x3d2f('0x37')][_0x3d2f('0x4d')]));_0x190798[_0x3d2f('0x3a')]=_0x190798[_0x3d2f('0x3a')][_0x3d2f('0x3b')]?_0x190798[_0x3d2f('0x3a')]:_0xdd7bb2[_0x3d2f('0x35')];_0x190798[_0x3d2f('0x3e')]=qs['sort'](_0x532640['query']['sort']);_0x190798['where']=qs['filters'](_['pick'](_0x532640[_0x3d2f('0x37')],_0xdd7bb2[_0x3d2f('0x38')]));if(_0x532640['query']['filter']){_0x190798[_0x3d2f('0x40')]=_[_0x3d2f('0x43')](_0x190798[_0x3d2f('0x40')],{'$or':_[_0x3d2f('0x36')](_0x190798[_0x3d2f('0x3a')],function(_0x2d4343){var _0xdd646a={};_0xdd646a[_0x2d4343]={'$like':'%'+_0x532640[_0x3d2f('0x37')][_0x3d2f('0x42')]+'%'};return _0xdd646a;})});}_0x190798=_[_0x3d2f('0x43')]({},_0x190798,_0x532640['options']);return _0x13e50a['getFields'](_0x190798);}})[_0x3d2f('0x29')](function(_0x3ded27){if(_0x3ded27){_0x6e2b17=_0x3ded27[_0x3d2f('0x3b')];if(!_0x532640[_0x3d2f('0x37')][_0x3d2f('0x3c')]('nolimit')){_0x190798[_0x3d2f('0x21')]=qs['limit'](_0x532640[_0x3d2f('0x37')]['limit']);_0x190798['offset']=qs[_0x3d2f('0x1f')](_0x532640[_0x3d2f('0x37')]['offset']);}return _0x13e50a[_0x3d2f('0x56')](_0x190798);}})[_0x3d2f('0x29')](function(_0x227faf){if(_0x227faf){return _0x227faf?{'count':_0x6e2b17,'rows':_0x227faf}:null;}})[_0x3d2f('0x29')](respondWithResult(_0x319b6b,null))['catch'](handleError(_0x319b6b,null));}; \ No newline at end of file +var _0x60f1=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','crypto','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','status','json','offset','undefined','count','limit','apply','save','update','then','destroy','end','sendStatus','stack','name','index','map','rawAttributes','fieldName','type','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','FreshsalesConfiguration','findAll','rows','params','includeAll','find','catch','create','body','getSubjects','findOne','FreshsalesField','getDescriptions','getFields','eml-format'];(function(_0x13137e,_0x29c0f3){var _0x346261=function(_0x8c7d4f){while(--_0x8c7d4f){_0x13137e['push'](_0x13137e['shift']());}};_0x346261(++_0x29c0f3);}(_0x60f1,0x95));var _0x160f=function(_0x1eaf9a,_0x4a10c3){_0x1eaf9a=_0x1eaf9a-0x0;var _0x1fbedb=_0x60f1[_0x1eaf9a];return _0x1fbedb;};'use strict';var emlformat=require(_0x160f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x160f('0x1'));var jsonpatch=require(_0x160f('0x2'));var rp=require(_0x160f('0x3'));var moment=require(_0x160f('0x4'));var BPromise=require(_0x160f('0x5'));var Mustache=require(_0x160f('0x6'));var util=require('util');var path=require(_0x160f('0x7'));var sox=require(_0x160f('0x8'));var csv=require('to-csv');var ejs=require(_0x160f('0x9'));var fs=require('fs');var fs_extra=require(_0x160f('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x160f('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x160f('0xc'));var querystring=require(_0x160f('0xd'));var Papa=require(_0x160f('0xe'));var Redis=require('ioredis');var authService=require(_0x160f('0xf'));var qs=require(_0x160f('0x10'));var as=require(_0x160f('0x11'));var hardwareService=require(_0x160f('0x12'));var logger=require('../../config/logger')(_0x160f('0x13'));var utils=require(_0x160f('0x14'));var config=require(_0x160f('0x15'));var licenseUtil=require(_0x160f('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2945db,_0x3f6bdf){_0x3f6bdf=_0x3f6bdf||0xcc;return function(_0x251add){if(_0x251add){return _0x2945db['sendStatus'](_0x3f6bdf);}return _0x2945db[_0x160f('0x17')](_0x3f6bdf)['end']();};}function respondWithResult(_0x35a8c1,_0x2c7c2f){_0x2c7c2f=_0x2c7c2f||0xc8;return function(_0x5110f6){if(_0x5110f6){return _0x35a8c1['status'](_0x2c7c2f)[_0x160f('0x18')](_0x5110f6);}};}function respondWithFilteredResult(_0x11d29d,_0x1ae7e2){return function(_0x590947){if(_0x590947){var _0x465453=typeof _0x1ae7e2[_0x160f('0x19')]==='undefined'&&typeof _0x1ae7e2['limit']===_0x160f('0x1a');var _0x216b29=_0x590947[_0x160f('0x1b')];var _0x46966b=_0x465453?0x0:_0x1ae7e2[_0x160f('0x19')];var _0x386cae=_0x465453?_0x590947[_0x160f('0x1b')]:_0x1ae7e2['offset']+_0x1ae7e2[_0x160f('0x1c')];var _0x5d1395;if(_0x386cae>=_0x216b29){_0x386cae=_0x216b29;_0x5d1395=0xc8;}else{_0x5d1395=0xce;}_0x11d29d['status'](_0x5d1395);return _0x11d29d['set']('Content-Range',_0x46966b+'-'+_0x386cae+'/'+_0x216b29)[_0x160f('0x18')](_0x590947);}return null;};}function patchUpdates(_0x15b436){return function(_0x5736ea){try{jsonpatch[_0x160f('0x1d')](_0x5736ea,_0x15b436,!![]);}catch(_0x509b4d){return BPromise['reject'](_0x509b4d);}return _0x5736ea[_0x160f('0x1e')]();};}function saveUpdates(_0x225b8c,_0x553783){return function(_0x447a7e){if(_0x447a7e){return _0x447a7e[_0x160f('0x1f')](_0x225b8c)[_0x160f('0x20')](function(_0x1ec281){return _0x1ec281;});}return null;};}function removeEntity(_0x1f738d,_0x4eecc2){return function(_0x32c626){if(_0x32c626){return _0x32c626[_0x160f('0x21')]()[_0x160f('0x20')](function(){_0x1f738d['status'](0xcc)[_0x160f('0x22')]();});}};}function handleEntityNotFound(_0x3dbce4,_0x4ae0e2){return function(_0x2a3e97){if(!_0x2a3e97){_0x3dbce4[_0x160f('0x23')](0x194);}return _0x2a3e97;};}function handleError(_0x450d7a,_0x3b9d3d){_0x3b9d3d=_0x3b9d3d||0x1f4;return function(_0x272337){logger['error'](_0x272337[_0x160f('0x24')]);if(_0x272337[_0x160f('0x25')]){delete _0x272337[_0x160f('0x25')];}_0x450d7a[_0x160f('0x17')](_0x3b9d3d)['send'](_0x272337);};}exports[_0x160f('0x26')]=function(_0x38f2ff,_0x34cb4e){var _0x184caa={},_0x23db26={},_0x3372d0={'count':0x0,'rows':[]};var _0x25b1b7=_[_0x160f('0x27')](db['FreshsalesConfiguration'][_0x160f('0x28')],function(_0x1bdb59){return{'name':_0x1bdb59[_0x160f('0x29')],'type':_0x1bdb59[_0x160f('0x2a')]['key']};});_0x23db26[_0x160f('0x2b')]=_[_0x160f('0x27')](_0x25b1b7,_0x160f('0x25'));_0x23db26['query']=_[_0x160f('0x2c')](_0x38f2ff[_0x160f('0x2d')]);_0x23db26[_0x160f('0x2e')]=_['intersection'](_0x23db26[_0x160f('0x2b')],_0x23db26[_0x160f('0x2d')]);_0x184caa[_0x160f('0x2f')]=_[_0x160f('0x30')](_0x23db26[_0x160f('0x2b')],qs[_0x160f('0x31')](_0x38f2ff[_0x160f('0x2d')][_0x160f('0x31')]));_0x184caa[_0x160f('0x2f')]=_0x184caa['attributes'][_0x160f('0x32')]?_0x184caa['attributes']:_0x23db26[_0x160f('0x2b')];if(!_0x38f2ff[_0x160f('0x2d')][_0x160f('0x33')](_0x160f('0x34'))){_0x184caa[_0x160f('0x1c')]=qs['limit'](_0x38f2ff['query'][_0x160f('0x1c')]);_0x184caa[_0x160f('0x19')]=qs[_0x160f('0x19')](_0x38f2ff[_0x160f('0x2d')][_0x160f('0x19')]);}_0x184caa[_0x160f('0x35')]=qs[_0x160f('0x36')](_0x38f2ff[_0x160f('0x2d')]['sort']);_0x184caa[_0x160f('0x37')]=qs['filters'](_[_0x160f('0x38')](_0x38f2ff[_0x160f('0x2d')],_0x23db26['filters']),_0x25b1b7);if(_0x38f2ff['query'][_0x160f('0x39')]){_0x184caa['where']=_[_0x160f('0x3a')](_0x184caa[_0x160f('0x37')],{'$or':_[_0x160f('0x27')](_0x25b1b7,function(_0x580202){if(_0x580202[_0x160f('0x2a')]!==_0x160f('0x3b')){var _0x48b47a={};_0x48b47a[_0x580202[_0x160f('0x25')]]={'$like':'%'+_0x38f2ff[_0x160f('0x2d')]['filter']+'%'};return _0x48b47a;}})});}_0x184caa=_['merge']({},_0x184caa,_0x38f2ff[_0x160f('0x3c')]);var _0xce960={'where':_0x184caa[_0x160f('0x37')]};return db[_0x160f('0x3d')][_0x160f('0x1b')](_0xce960)[_0x160f('0x20')](function(_0x163252){_0x3372d0[_0x160f('0x1b')]=_0x163252;if(_0x38f2ff[_0x160f('0x2d')]['includeAll']){_0x184caa['include']=[{'all':!![]}];}return db[_0x160f('0x3d')][_0x160f('0x3e')](_0x184caa);})['then'](function(_0x3947b6){_0x3372d0[_0x160f('0x3f')]=_0x3947b6;return _0x3372d0;})[_0x160f('0x20')](respondWithFilteredResult(_0x34cb4e,_0x184caa))['catch'](handleError(_0x34cb4e,null));};exports['show']=function(_0x5c109e,_0x503f90){var _0x265bf0={'raw':![],'where':{'id':_0x5c109e[_0x160f('0x40')]['id']}},_0xa95293={};_0xa95293[_0x160f('0x2b')]=_['keys'](db['FreshsalesConfiguration'][_0x160f('0x28')]);_0xa95293[_0x160f('0x2d')]=_['keys'](_0x5c109e[_0x160f('0x2d')]);_0xa95293[_0x160f('0x2e')]=_['intersection'](_0xa95293[_0x160f('0x2b')],_0xa95293[_0x160f('0x2d')]);_0x265bf0[_0x160f('0x2f')]=_[_0x160f('0x30')](_0xa95293['model'],qs[_0x160f('0x31')](_0x5c109e['query'][_0x160f('0x31')]));_0x265bf0[_0x160f('0x2f')]=_0x265bf0[_0x160f('0x2f')][_0x160f('0x32')]?_0x265bf0[_0x160f('0x2f')]:_0xa95293[_0x160f('0x2b')];if(_0x5c109e['query'][_0x160f('0x41')]){_0x265bf0['include']=[{'all':!![]}];}_0x265bf0=_[_0x160f('0x3a')]({},_0x265bf0,_0x5c109e[_0x160f('0x3c')]);return db[_0x160f('0x3d')][_0x160f('0x42')](_0x265bf0)[_0x160f('0x20')](handleEntityNotFound(_0x503f90,null))[_0x160f('0x20')](respondWithResult(_0x503f90,null))[_0x160f('0x43')](handleError(_0x503f90,null));};exports[_0x160f('0x44')]=function(_0x383394,_0x33e310){return db[_0x160f('0x3d')][_0x160f('0x44')](_0x383394[_0x160f('0x45')],{})[_0x160f('0x20')](respondWithResult(_0x33e310,0xc9))[_0x160f('0x43')](handleError(_0x33e310,null));};exports[_0x160f('0x1f')]=function(_0x5d653d,_0x199699){if(_0x5d653d[_0x160f('0x45')]['id']){delete _0x5d653d[_0x160f('0x45')]['id'];}return db[_0x160f('0x3d')][_0x160f('0x42')]({'where':{'id':_0x5d653d['params']['id']}})[_0x160f('0x20')](handleEntityNotFound(_0x199699,null))[_0x160f('0x20')](saveUpdates(_0x5d653d['body'],null))[_0x160f('0x20')](respondWithResult(_0x199699,null))['catch'](handleError(_0x199699,null));};exports[_0x160f('0x21')]=function(_0x179852,_0xc6d17b){return db[_0x160f('0x3d')][_0x160f('0x42')]({'where':{'id':_0x179852[_0x160f('0x40')]['id']}})[_0x160f('0x20')](handleEntityNotFound(_0xc6d17b,null))['then'](removeEntity(_0xc6d17b,null))[_0x160f('0x43')](handleError(_0xc6d17b,null));};exports[_0x160f('0x46')]=function(_0x4c32ad,_0x2e5bc2,_0x3e61b2){var _0x2d68d0={};var _0x471b1f={};var _0x18ec5d;var _0x578618;return db[_0x160f('0x3d')][_0x160f('0x47')]({'where':{'id':_0x4c32ad[_0x160f('0x40')]['id']}})[_0x160f('0x20')](handleEntityNotFound(_0x2e5bc2,null))[_0x160f('0x20')](function(_0x192e8b){if(_0x192e8b){_0x18ec5d=_0x192e8b;_0x471b1f[_0x160f('0x2b')]=_[_0x160f('0x2c')](db[_0x160f('0x48')]['rawAttributes']);_0x471b1f[_0x160f('0x2d')]=_[_0x160f('0x2c')](_0x4c32ad[_0x160f('0x2d')]);_0x471b1f[_0x160f('0x2e')]=_[_0x160f('0x30')](_0x471b1f['model'],_0x471b1f[_0x160f('0x2d')]);_0x2d68d0[_0x160f('0x2f')]=_[_0x160f('0x30')](_0x471b1f[_0x160f('0x2b')],qs['fields'](_0x4c32ad['query'][_0x160f('0x31')]));_0x2d68d0[_0x160f('0x2f')]=_0x2d68d0[_0x160f('0x2f')][_0x160f('0x32')]?_0x2d68d0[_0x160f('0x2f')]:_0x471b1f[_0x160f('0x2b')];_0x2d68d0[_0x160f('0x35')]=qs[_0x160f('0x36')](_0x4c32ad['query']['sort']);_0x2d68d0[_0x160f('0x37')]=qs['filters'](_[_0x160f('0x38')](_0x4c32ad[_0x160f('0x2d')],_0x471b1f[_0x160f('0x2e')]));if(_0x4c32ad[_0x160f('0x2d')][_0x160f('0x39')]){_0x2d68d0[_0x160f('0x37')]=_[_0x160f('0x3a')](_0x2d68d0[_0x160f('0x37')],{'$or':_[_0x160f('0x27')](_0x2d68d0[_0x160f('0x2f')],function(_0x3d160b){var _0x156da6={};_0x156da6[_0x3d160b]={'$like':'%'+_0x4c32ad[_0x160f('0x2d')][_0x160f('0x39')]+'%'};return _0x156da6;})});}_0x2d68d0=_[_0x160f('0x3a')]({},_0x2d68d0,_0x4c32ad['options']);return _0x18ec5d['getSubjects'](_0x2d68d0);}})['then'](function(_0x5bcda1){if(_0x5bcda1){_0x578618=_0x5bcda1[_0x160f('0x32')];if(!_0x4c32ad[_0x160f('0x2d')][_0x160f('0x33')](_0x160f('0x34'))){_0x2d68d0[_0x160f('0x1c')]=qs[_0x160f('0x1c')](_0x4c32ad[_0x160f('0x2d')][_0x160f('0x1c')]);_0x2d68d0[_0x160f('0x19')]=qs[_0x160f('0x19')](_0x4c32ad[_0x160f('0x2d')][_0x160f('0x19')]);}return _0x18ec5d[_0x160f('0x46')](_0x2d68d0);}})[_0x160f('0x20')](function(_0x4214e6){if(_0x4214e6){return _0x4214e6?{'count':_0x578618,'rows':_0x4214e6}:null;}})[_0x160f('0x20')](respondWithResult(_0x2e5bc2,null))[_0x160f('0x43')](handleError(_0x2e5bc2,null));};exports[_0x160f('0x49')]=function(_0x103aa5,_0x4a9282,_0x27dd3c){var _0x4fb79a={};var _0x298064={};var _0x2c98ec;var _0x3dc5d4;return db[_0x160f('0x3d')]['findOne']({'where':{'id':_0x103aa5[_0x160f('0x40')]['id']}})[_0x160f('0x20')](handleEntityNotFound(_0x4a9282,null))[_0x160f('0x20')](function(_0x596045){if(_0x596045){_0x2c98ec=_0x596045;_0x298064[_0x160f('0x2b')]=_[_0x160f('0x2c')](db[_0x160f('0x48')]['rawAttributes']);_0x298064['query']=_[_0x160f('0x2c')](_0x103aa5[_0x160f('0x2d')]);_0x298064[_0x160f('0x2e')]=_[_0x160f('0x30')](_0x298064['model'],_0x298064[_0x160f('0x2d')]);_0x4fb79a[_0x160f('0x2f')]=_[_0x160f('0x30')](_0x298064[_0x160f('0x2b')],qs[_0x160f('0x31')](_0x103aa5[_0x160f('0x2d')][_0x160f('0x31')]));_0x4fb79a[_0x160f('0x2f')]=_0x4fb79a[_0x160f('0x2f')][_0x160f('0x32')]?_0x4fb79a[_0x160f('0x2f')]:_0x298064[_0x160f('0x2b')];_0x4fb79a[_0x160f('0x35')]=qs[_0x160f('0x36')](_0x103aa5['query'][_0x160f('0x36')]);_0x4fb79a[_0x160f('0x37')]=qs[_0x160f('0x2e')](_['pick'](_0x103aa5[_0x160f('0x2d')],_0x298064[_0x160f('0x2e')]));if(_0x103aa5[_0x160f('0x2d')][_0x160f('0x39')]){_0x4fb79a[_0x160f('0x37')]=_[_0x160f('0x3a')](_0x4fb79a[_0x160f('0x37')],{'$or':_['map'](_0x4fb79a[_0x160f('0x2f')],function(_0x420093){var _0x28b895={};_0x28b895[_0x420093]={'$like':'%'+_0x103aa5[_0x160f('0x2d')][_0x160f('0x39')]+'%'};return _0x28b895;})});}_0x4fb79a=_[_0x160f('0x3a')]({},_0x4fb79a,_0x103aa5['options']);return _0x2c98ec[_0x160f('0x49')](_0x4fb79a);}})[_0x160f('0x20')](function(_0x4f7a2f){if(_0x4f7a2f){_0x3dc5d4=_0x4f7a2f['length'];if(!_0x103aa5[_0x160f('0x2d')][_0x160f('0x33')](_0x160f('0x34'))){_0x4fb79a[_0x160f('0x1c')]=qs[_0x160f('0x1c')](_0x103aa5['query'][_0x160f('0x1c')]);_0x4fb79a['offset']=qs[_0x160f('0x19')](_0x103aa5[_0x160f('0x2d')][_0x160f('0x19')]);}return _0x2c98ec[_0x160f('0x49')](_0x4fb79a);}})[_0x160f('0x20')](function(_0x10f731){if(_0x10f731){return _0x10f731?{'count':_0x3dc5d4,'rows':_0x10f731}:null;}})[_0x160f('0x20')](respondWithResult(_0x4a9282,null))[_0x160f('0x43')](handleError(_0x4a9282,null));};exports['getFields']=function(_0x535855,_0x3e769c,_0x1f3073){var _0x2a3dc3={};var _0x11649e={};var _0x2b87b7;var _0x5e4ee3;return db['FreshsalesConfiguration'][_0x160f('0x47')]({'where':{'id':_0x535855[_0x160f('0x40')]['id']}})[_0x160f('0x20')](handleEntityNotFound(_0x3e769c,null))['then'](function(_0x4cff4f){if(_0x4cff4f){_0x2b87b7=_0x4cff4f;_0x11649e[_0x160f('0x2b')]=_['keys'](db[_0x160f('0x48')]['rawAttributes']);_0x11649e[_0x160f('0x2d')]=_[_0x160f('0x2c')](_0x535855[_0x160f('0x2d')]);_0x11649e[_0x160f('0x2e')]=_[_0x160f('0x30')](_0x11649e[_0x160f('0x2b')],_0x11649e[_0x160f('0x2d')]);_0x2a3dc3[_0x160f('0x2f')]=_[_0x160f('0x30')](_0x11649e[_0x160f('0x2b')],qs['fields'](_0x535855[_0x160f('0x2d')][_0x160f('0x31')]));_0x2a3dc3['attributes']=_0x2a3dc3[_0x160f('0x2f')][_0x160f('0x32')]?_0x2a3dc3[_0x160f('0x2f')]:_0x11649e['model'];_0x2a3dc3['order']=qs[_0x160f('0x36')](_0x535855[_0x160f('0x2d')]['sort']);_0x2a3dc3[_0x160f('0x37')]=qs[_0x160f('0x2e')](_[_0x160f('0x38')](_0x535855[_0x160f('0x2d')],_0x11649e[_0x160f('0x2e')]));if(_0x535855[_0x160f('0x2d')][_0x160f('0x39')]){_0x2a3dc3[_0x160f('0x37')]=_[_0x160f('0x3a')](_0x2a3dc3['where'],{'$or':_['map'](_0x2a3dc3[_0x160f('0x2f')],function(_0x1d6c00){var _0x317fc1={};_0x317fc1[_0x1d6c00]={'$like':'%'+_0x535855[_0x160f('0x2d')][_0x160f('0x39')]+'%'};return _0x317fc1;})});}_0x2a3dc3=_['merge']({},_0x2a3dc3,_0x535855['options']);return _0x2b87b7[_0x160f('0x4a')](_0x2a3dc3);}})[_0x160f('0x20')](function(_0xfd419f){if(_0xfd419f){_0x5e4ee3=_0xfd419f[_0x160f('0x32')];if(!_0x535855[_0x160f('0x2d')]['hasOwnProperty'](_0x160f('0x34'))){_0x2a3dc3[_0x160f('0x1c')]=qs[_0x160f('0x1c')](_0x535855[_0x160f('0x2d')][_0x160f('0x1c')]);_0x2a3dc3[_0x160f('0x19')]=qs['offset'](_0x535855[_0x160f('0x2d')]['offset']);}return _0x2b87b7[_0x160f('0x4a')](_0x2a3dc3);}})[_0x160f('0x20')](function(_0x21b07a){if(_0x21b07a){return _0x21b07a?{'count':_0x5e4ee3,'rows':_0x21b07a}:null;}})[_0x160f('0x20')](respondWithResult(_0x3e769c,null))[_0x160f('0x43')](handleError(_0x3e769c,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index 9e9c4e1..c01f0fb 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 _0xa7f4=['request-promise','path','rimraf','define','int_freshsales_configurations','lodash','util','../../config/logger','moment','bluebird'];(function(_0x44aca2,_0x58bb64){var _0x1d7ee1=function(_0x562076){while(--_0x562076){_0x44aca2['push'](_0x44aca2['shift']());}};_0x1d7ee1(++_0x58bb64);}(_0xa7f4,0x9b));var _0x4a7f=function(_0x264436,_0x3a4d6a){_0x264436=_0x264436-0x0;var _0x1ddb3c=_0xa7f4[_0x264436];return _0x1ddb3c;};'use strict';var _=require(_0x4a7f('0x0'));var util=require(_0x4a7f('0x1'));var logger=require(_0x4a7f('0x2'))('api');var moment=require(_0x4a7f('0x3'));var BPromise=require(_0x4a7f('0x4'));var rp=require(_0x4a7f('0x5'));var fs=require('fs');var path=require(_0x4a7f('0x6'));var rimraf=require(_0x4a7f('0x7'));var config=require('../../config/environment');var attributes=require('./intFreshsalesConfiguration.attributes');module['exports']=function(_0x67b88,_0x14f773){return _0x67b88[_0x4a7f('0x8')]('FreshsalesConfiguration',attributes,{'tableName':_0x4a7f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0fd2=['define','int_freshsales_configurations','lodash','../../config/logger','moment','bluebird','path','rimraf'];(function(_0x2c4ee5,_0x4710b6){var _0x3aa942=function(_0x4d56cd){while(--_0x4d56cd){_0x2c4ee5['push'](_0x2c4ee5['shift']());}};_0x3aa942(++_0x4710b6);}(_0x0fd2,0x152));var _0x20fd=function(_0x53de6d,_0x45c593){_0x53de6d=_0x53de6d-0x0;var _0x1661f2=_0x0fd2[_0x53de6d];return _0x1661f2;};'use strict';var _=require(_0x20fd('0x0'));var util=require('util');var logger=require(_0x20fd('0x1'))('api');var moment=require(_0x20fd('0x2'));var BPromise=require(_0x20fd('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x20fd('0x4'));var rimraf=require(_0x20fd('0x5'));var config=require('../../config/environment');var attributes=require('./intFreshsalesConfiguration.attributes');module['exports']=function(_0x3720e7,_0x2f62d7){return _0x3720e7[_0x20fd('0x6')]('FreshsalesConfiguration',attributes,{'tableName':_0x20fd('0x7'),'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 7a17e45..89bfae8 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 _0x7e7e=['FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','request','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x41e33e,_0x19bfed){var _0x53f0ad=function(_0x2f530a){while(--_0x2f530a){_0x41e33e['push'](_0x41e33e['shift']());}};_0x53f0ad(++_0x19bfed);}(_0x7e7e,0x125));var _0xe7e7=function(_0x1a51e4,_0x37caab){_0x1a51e4=_0x1a51e4-0x0;var _0x595532=_0x7e7e[_0x1a51e4];return _0x595532;};'use strict';var _=require('lodash');var util=require(_0xe7e7('0x0'));var moment=require('moment');var BPromise=require(_0xe7e7('0x1'));var rs=require(_0xe7e7('0x2'));var fs=require('fs');var Redis=require(_0xe7e7('0x3'));var db=require(_0xe7e7('0x4'))['db'];var utils=require(_0xe7e7('0x5'));var logger=require(_0xe7e7('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xe7e7('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1a6db6,_0x1a412e,_0x12a6c5){return new BPromise(function(_0x2e7d4c,_0x421c2e){return client[_0xe7e7('0x8')](_0x1a6db6,_0x12a6c5)['then'](function(_0x1cfca8){logger[_0xe7e7('0x9')](_0xe7e7('0xa'),_0x1a412e,_0xe7e7('0xb'));logger[_0xe7e7('0xc')](_0xe7e7('0xd'),_0x1a412e,_0xe7e7('0xb'),JSON[_0xe7e7('0xe')](_0x1cfca8));if(_0x1cfca8['error']){if(_0x1cfca8[_0xe7e7('0xf')]['code']===0x1f4){logger[_0xe7e7('0xf')](_0xe7e7('0xa'),_0x1a412e,_0x1cfca8[_0xe7e7('0xf')][_0xe7e7('0x10')]);return _0x421c2e(_0x1cfca8[_0xe7e7('0xf')][_0xe7e7('0x10')]);}logger[_0xe7e7('0xf')](_0xe7e7('0xa'),_0x1a412e,_0x1cfca8[_0xe7e7('0xf')][_0xe7e7('0x10')]);return _0x2e7d4c(_0x1cfca8[_0xe7e7('0xf')][_0xe7e7('0x10')]);}else{logger[_0xe7e7('0x9')](_0xe7e7('0xa'),_0x1a412e,_0xe7e7('0xb'));_0x2e7d4c(_0x1cfca8['result'][_0xe7e7('0x10')]);}})[_0xe7e7('0x11')](function(_0x3c303a){logger[_0xe7e7('0xf')](_0xe7e7('0xa'),_0x1a412e,_0x3c303a);_0x421c2e(_0x3c303a);});});} \ No newline at end of file +var _0xd853=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','then','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util'];(function(_0x313b7e,_0x585ac8){var _0xb3b50f=function(_0x165488){while(--_0x165488){_0x313b7e['push'](_0x313b7e['shift']());}};_0xb3b50f(++_0x585ac8);}(_0xd853,0x91));var _0x3d85=function(_0x9f9ed5,_0x56f438){_0x9f9ed5=_0x9f9ed5-0x0;var _0xbc71e3=_0xd853[_0x9f9ed5];return _0xbc71e3;};'use strict';var _=require(_0x3d85('0x0'));var util=require(_0x3d85('0x1'));var moment=require('moment');var BPromise=require(_0x3d85('0x2'));var rs=require(_0x3d85('0x3'));var fs=require('fs');var Redis=require(_0x3d85('0x4'));var db=require(_0x3d85('0x5'))['db'];var utils=require(_0x3d85('0x6'));var logger=require('../../config/logger')(_0x3d85('0x7'));var config=require(_0x3d85('0x8'));var jayson=require(_0x3d85('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2334a2,_0x3fad05,_0x1ad197){return new BPromise(function(_0x5996f6,_0xec1d89){return client['request'](_0x2334a2,_0x1ad197)[_0x3d85('0xa')](function(_0x282c48){logger[_0x3d85('0xb')](_0x3d85('0xc'),_0x3fad05,_0x3d85('0xd'));logger[_0x3d85('0xe')](_0x3d85('0xf'),_0x3fad05,'request\x20sent',JSON[_0x3d85('0x10')](_0x282c48));if(_0x282c48['error']){if(_0x282c48[_0x3d85('0x11')][_0x3d85('0x12')]===0x1f4){logger[_0x3d85('0x11')](_0x3d85('0xc'),_0x3fad05,_0x282c48[_0x3d85('0x11')][_0x3d85('0x13')]);return _0xec1d89(_0x282c48[_0x3d85('0x11')][_0x3d85('0x13')]);}logger['error'](_0x3d85('0xc'),_0x3fad05,_0x282c48[_0x3d85('0x11')][_0x3d85('0x13')]);return _0x5996f6(_0x282c48[_0x3d85('0x11')][_0x3d85('0x13')]);}else{logger[_0x3d85('0xb')](_0x3d85('0xc'),_0x3fad05,_0x3d85('0xd'));_0x5996f6(_0x282c48[_0x3d85('0x14')][_0x3d85('0x13')]);}})['catch'](function(_0x223235){logger[_0x3d85('0x11')](_0x3d85('0xc'),_0x3fad05,_0x223235);_0xec1d89(_0x223235);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index 8a0a29c..0d5b98d 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 _0x2060=['put','update','delete','destroy','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intFreshsalesField.controller','isAuthenticated','index','/:id','post','create'];(function(_0xc2e81b,_0x5e94c6){var _0x52dab5=function(_0x4449e9){while(--_0x4449e9){_0xc2e81b['push'](_0xc2e81b['shift']());}};_0x52dab5(++_0x5e94c6);}(_0x2060,0x1be));var _0x0206=function(_0x3311ab,_0x3aa1fa){_0x3311ab=_0x3311ab-0x0;var _0x1d6ec2=_0x2060[_0x3311ab];return _0x1d6ec2;};'use strict';var multer=require(_0x0206('0x0'));var util=require('util');var path=require(_0x0206('0x1'));var timeout=require(_0x0206('0x2'));var express=require(_0x0206('0x3'));var router=express[_0x0206('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x0206('0x5'));var interaction=require(_0x0206('0x6'));var config=require('../../config/environment');var controller=require(_0x0206('0x7'));router['get']('/',auth[_0x0206('0x8')](),controller[_0x0206('0x9')]);router['get'](_0x0206('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0206('0xb')]('/',auth[_0x0206('0x8')](),controller[_0x0206('0xc')]);router[_0x0206('0xd')](_0x0206('0xa'),auth[_0x0206('0x8')](),controller[_0x0206('0xe')]);router[_0x0206('0xf')](_0x0206('0xa'),auth[_0x0206('0x8')](),controller[_0x0206('0x10')]);module['exports']=router; \ No newline at end of file +var _0xfe57=['get','isAuthenticated','index','/:id','post','create','put','update','delete','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller'];(function(_0x35242b,_0x3c7a13){var _0x13647c=function(_0x5247ce){while(--_0x5247ce){_0x35242b['push'](_0x35242b['shift']());}};_0x13647c(++_0x3c7a13);}(_0xfe57,0x195));var _0x7fe5=function(_0x4d07cc,_0x587613){_0x4d07cc=_0x4d07cc-0x0;var _0x42de3b=_0xfe57[_0x4d07cc];return _0x42de3b;};'use strict';var multer=require(_0x7fe5('0x0'));var util=require(_0x7fe5('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x7fe5('0x2'));var router=express[_0x7fe5('0x3')]();var fs_extra=require(_0x7fe5('0x4'));var auth=require(_0x7fe5('0x5'));var interaction=require(_0x7fe5('0x6'));var config=require(_0x7fe5('0x7'));var controller=require(_0x7fe5('0x8'));router[_0x7fe5('0x9')]('/',auth[_0x7fe5('0xa')](),controller[_0x7fe5('0xb')]);router[_0x7fe5('0x9')](_0x7fe5('0xc'),auth[_0x7fe5('0xa')](),controller['show']);router[_0x7fe5('0xd')]('/',auth['isAuthenticated'](),controller[_0x7fe5('0xe')]);router[_0x7fe5('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x7fe5('0x10')]);router[_0x7fe5('0x11')]('/:id',auth[_0x7fe5('0xa')](),controller['destroy']);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 6814d79..805a4b9 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 _0x3534=['string','STRING','ENUM','BOOLEAN','sequelize','exports','variable','customVariable','keyValue'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x3534,0x109));var _0x4353=function(_0x360f16,_0x1738aa){_0x360f16=_0x360f16-0x0;var _0x455284=_0x3534[_0x360f16];return _0x455284;};'use strict';var Sequelize=require(_0x4353('0x0'));module[_0x4353('0x1')]={'type':{'type':Sequelize['ENUM']('string',_0x4353('0x2'),_0x4353('0x3'),_0x4353('0x4'),'picklist'),'defaultValue':_0x4353('0x5')},'content':{'type':Sequelize[_0x4353('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x4353('0x7')](_0x4353('0x5'),'variable',_0x4353('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x4353('0x6')]},'nameField':{'type':Sequelize[_0x4353('0x6')]},'customField':{'type':Sequelize[_0x4353('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x4353('0x6')]}}; \ No newline at end of file +var _0xf005=['BOOLEAN','sequelize','exports','variable','keyValue','picklist','STRING','customVariable'];(function(_0x314a0b,_0x25b08d){var _0x4b7590=function(_0x3370e4){while(--_0x3370e4){_0x314a0b['push'](_0x314a0b['shift']());}};_0x4b7590(++_0x25b08d);}(_0xf005,0xd1));var _0x5f00=function(_0xe21a74,_0xd19b1e){_0xe21a74=_0xe21a74-0x0;var _0x59e99a=_0xf005[_0xe21a74];return _0x59e99a;};'use strict';var Sequelize=require(_0x5f00('0x0'));module[_0x5f00('0x1')]={'type':{'type':Sequelize['ENUM']('string',_0x5f00('0x2'),'customVariable',_0x5f00('0x3'),_0x5f00('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0x5f00('0x5')]},'key':{'type':Sequelize[_0x5f00('0x5')]},'keyType':{'type':Sequelize['ENUM']('string','variable',_0x5f00('0x6'))},'keyContent':{'type':Sequelize[_0x5f00('0x5')]},'idField':{'type':Sequelize[_0x5f00('0x5')]},'nameField':{'type':Sequelize[_0x5f00('0x5')]},'customField':{'type':Sequelize[_0x5f00('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index ed37f05..55f0652 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 _0xcd30=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','reject','save','update','then','destroy','error','stack','name','send','index','FreshsalesField','rawAttributes','type','model','map','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','where','filters','pick','filter','merge','options','include','findAll','rows','catch','show','params','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x51d0a8,_0x377fb8){var _0x8d0df4=function(_0xf4ee16){while(--_0xf4ee16){_0x51d0a8['push'](_0x51d0a8['shift']());}};_0x8d0df4(++_0x377fb8);}(_0xcd30,0x10b));var _0x0cd3=function(_0xd10d51,_0x37eb56){_0xd10d51=_0xd10d51-0x0;var _0x5e7b61=_0xcd30[_0xd10d51];return _0x5e7b61;};'use strict';var emlformat=require(_0x0cd3('0x0'));var rimraf=require(_0x0cd3('0x1'));var zipdir=require(_0x0cd3('0x2'));var jsonpatch=require(_0x0cd3('0x3'));var rp=require(_0x0cd3('0x4'));var moment=require('moment');var BPromise=require(_0x0cd3('0x5'));var Mustache=require(_0x0cd3('0x6'));var util=require('util');var path=require(_0x0cd3('0x7'));var sox=require(_0x0cd3('0x8'));var csv=require(_0x0cd3('0x9'));var ejs=require(_0x0cd3('0xa'));var fs=require('fs');var fs_extra=require(_0x0cd3('0xb'));var _=require(_0x0cd3('0xc'));var squel=require(_0x0cd3('0xd'));var crypto=require(_0x0cd3('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x0cd3('0xf'));var toCsv=require('to-csv');var querystring=require(_0x0cd3('0x10'));var Papa=require('papaparse');var Redis=require(_0x0cd3('0x11'));var authService=require(_0x0cd3('0x12'));var qs=require(_0x0cd3('0x13'));var as=require(_0x0cd3('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x0cd3('0x15'));var licenseUtil=require(_0x0cd3('0x16'));var db=require(_0x0cd3('0x17'))['db'];function respondWithStatusCode(_0x249817,_0x245910){_0x245910=_0x245910||0xcc;return function(_0x817413){if(_0x817413){return _0x249817[_0x0cd3('0x18')](_0x245910);}return _0x249817[_0x0cd3('0x19')](_0x245910)[_0x0cd3('0x1a')]();};}function respondWithResult(_0x33a9cf,_0x1ef98e){_0x1ef98e=_0x1ef98e||0xc8;return function(_0x583e3c){if(_0x583e3c){return _0x33a9cf[_0x0cd3('0x19')](_0x1ef98e)[_0x0cd3('0x1b')](_0x583e3c);}};}function respondWithFilteredResult(_0x146149,_0x59a344){return function(_0x2fe3a2){if(_0x2fe3a2){var _0x3523f0=typeof _0x59a344[_0x0cd3('0x1c')]==='undefined'&&typeof _0x59a344[_0x0cd3('0x1d')]===_0x0cd3('0x1e');var _0x12cdef=_0x2fe3a2['count'];var _0x5e791b=_0x3523f0?0x0:_0x59a344[_0x0cd3('0x1c')];var _0x55ebd3=_0x3523f0?_0x2fe3a2[_0x0cd3('0x1f')]:_0x59a344[_0x0cd3('0x1c')]+_0x59a344['limit'];var _0x5d6ade;if(_0x55ebd3>=_0x12cdef){_0x55ebd3=_0x12cdef;_0x5d6ade=0xc8;}else{_0x5d6ade=0xce;}_0x146149[_0x0cd3('0x19')](_0x5d6ade);return _0x146149[_0x0cd3('0x20')]('Content-Range',_0x5e791b+'-'+_0x55ebd3+'/'+_0x12cdef)[_0x0cd3('0x1b')](_0x2fe3a2);}return null;};}function patchUpdates(_0x20f01e){return function(_0x49f7e6){try{jsonpatch['apply'](_0x49f7e6,_0x20f01e,!![]);}catch(_0xe583e6){return BPromise[_0x0cd3('0x21')](_0xe583e6);}return _0x49f7e6[_0x0cd3('0x22')]();};}function saveUpdates(_0x9e81bf,_0x132fe9){return function(_0x351b83){if(_0x351b83){return _0x351b83[_0x0cd3('0x23')](_0x9e81bf)[_0x0cd3('0x24')](function(_0x264c0a){return _0x264c0a;});}return null;};}function removeEntity(_0x706fe2,_0x58081f){return function(_0x244875){if(_0x244875){return _0x244875[_0x0cd3('0x25')]()['then'](function(){_0x706fe2[_0x0cd3('0x19')](0xcc)[_0x0cd3('0x1a')]();});}};}function handleEntityNotFound(_0x5cd6a8,_0x284377){return function(_0xc6faf3){if(!_0xc6faf3){_0x5cd6a8[_0x0cd3('0x18')](0x194);}return _0xc6faf3;};}function handleError(_0x572925,_0x30b05d){_0x30b05d=_0x30b05d||0x1f4;return function(_0x49800c){logger[_0x0cd3('0x26')](_0x49800c[_0x0cd3('0x27')]);if(_0x49800c[_0x0cd3('0x28')]){delete _0x49800c[_0x0cd3('0x28')];}_0x572925[_0x0cd3('0x19')](_0x30b05d)[_0x0cd3('0x29')](_0x49800c);};}exports[_0x0cd3('0x2a')]=function(_0x4e3a15,_0x5a5971){var _0x10fb2d={},_0x1f3be6={},_0x3b4c01={'count':0x0,'rows':[]};var _0x36ef7a=_['map'](db[_0x0cd3('0x2b')][_0x0cd3('0x2c')],function(_0x58d248){return{'name':_0x58d248['fieldName'],'type':_0x58d248[_0x0cd3('0x2d')]['key']};});_0x1f3be6[_0x0cd3('0x2e')]=_[_0x0cd3('0x2f')](_0x36ef7a,_0x0cd3('0x28'));_0x1f3be6[_0x0cd3('0x30')]=_[_0x0cd3('0x31')](_0x4e3a15[_0x0cd3('0x30')]);_0x1f3be6['filters']=_[_0x0cd3('0x32')](_0x1f3be6[_0x0cd3('0x2e')],_0x1f3be6[_0x0cd3('0x30')]);_0x10fb2d['attributes']=_[_0x0cd3('0x32')](_0x1f3be6[_0x0cd3('0x2e')],qs[_0x0cd3('0x33')](_0x4e3a15[_0x0cd3('0x30')][_0x0cd3('0x33')]));_0x10fb2d[_0x0cd3('0x34')]=_0x10fb2d[_0x0cd3('0x34')][_0x0cd3('0x35')]?_0x10fb2d[_0x0cd3('0x34')]:_0x1f3be6[_0x0cd3('0x2e')];if(!_0x4e3a15[_0x0cd3('0x30')][_0x0cd3('0x36')](_0x0cd3('0x37'))){_0x10fb2d[_0x0cd3('0x1d')]=qs[_0x0cd3('0x1d')](_0x4e3a15['query'][_0x0cd3('0x1d')]);_0x10fb2d['offset']=qs['offset'](_0x4e3a15[_0x0cd3('0x30')]['offset']);}_0x10fb2d[_0x0cd3('0x38')]=qs['sort'](_0x4e3a15[_0x0cd3('0x30')]['sort']);_0x10fb2d[_0x0cd3('0x39')]=qs[_0x0cd3('0x3a')](_[_0x0cd3('0x3b')](_0x4e3a15[_0x0cd3('0x30')],_0x1f3be6[_0x0cd3('0x3a')]),_0x36ef7a);if(_0x4e3a15[_0x0cd3('0x30')][_0x0cd3('0x3c')]){_0x10fb2d[_0x0cd3('0x39')]=_[_0x0cd3('0x3d')](_0x10fb2d['where'],{'$or':_[_0x0cd3('0x2f')](_0x36ef7a,function(_0x54171e){if(_0x54171e[_0x0cd3('0x2d')]!=='VIRTUAL'){var _0x4952c7={};_0x4952c7[_0x54171e[_0x0cd3('0x28')]]={'$like':'%'+_0x4e3a15[_0x0cd3('0x30')][_0x0cd3('0x3c')]+'%'};return _0x4952c7;}})});}_0x10fb2d=_[_0x0cd3('0x3d')]({},_0x10fb2d,_0x4e3a15[_0x0cd3('0x3e')]);var _0x3d7406={'where':_0x10fb2d['where']};return db[_0x0cd3('0x2b')]['count'](_0x3d7406)[_0x0cd3('0x24')](function(_0x62e236){_0x3b4c01[_0x0cd3('0x1f')]=_0x62e236;if(_0x4e3a15[_0x0cd3('0x30')]['includeAll']){_0x10fb2d[_0x0cd3('0x3f')]=[{'all':!![]}];}return db[_0x0cd3('0x2b')][_0x0cd3('0x40')](_0x10fb2d);})[_0x0cd3('0x24')](function(_0x19c5fc){_0x3b4c01[_0x0cd3('0x41')]=_0x19c5fc;return _0x3b4c01;})['then'](respondWithFilteredResult(_0x5a5971,_0x10fb2d))[_0x0cd3('0x42')](handleError(_0x5a5971,null));};exports[_0x0cd3('0x43')]=function(_0x58e0ee,_0x286fad){var _0x362bd5={'raw':!![],'where':{'id':_0x58e0ee[_0x0cd3('0x44')]['id']}},_0x5de17d={};_0x5de17d[_0x0cd3('0x2e')]=_['keys'](db[_0x0cd3('0x2b')][_0x0cd3('0x2c')]);_0x5de17d[_0x0cd3('0x30')]=_[_0x0cd3('0x31')](_0x58e0ee[_0x0cd3('0x30')]);_0x5de17d[_0x0cd3('0x3a')]=_[_0x0cd3('0x32')](_0x5de17d[_0x0cd3('0x2e')],_0x5de17d[_0x0cd3('0x30')]);_0x362bd5[_0x0cd3('0x34')]=_[_0x0cd3('0x32')](_0x5de17d[_0x0cd3('0x2e')],qs[_0x0cd3('0x33')](_0x58e0ee['query'][_0x0cd3('0x33')]));_0x362bd5[_0x0cd3('0x34')]=_0x362bd5['attributes'][_0x0cd3('0x35')]?_0x362bd5[_0x0cd3('0x34')]:_0x5de17d[_0x0cd3('0x2e')];if(_0x58e0ee[_0x0cd3('0x30')]['includeAll']){_0x362bd5[_0x0cd3('0x3f')]=[{'all':!![]}];}_0x362bd5=_[_0x0cd3('0x3d')]({},_0x362bd5,_0x58e0ee['options']);return db['FreshsalesField']['find'](_0x362bd5)[_0x0cd3('0x24')](handleEntityNotFound(_0x286fad,null))[_0x0cd3('0x24')](respondWithResult(_0x286fad,null))[_0x0cd3('0x42')](handleError(_0x286fad,null));};exports[_0x0cd3('0x45')]=function(_0x1fc8d3,_0x3ecce3){return db['FreshsalesField'][_0x0cd3('0x45')](_0x1fc8d3[_0x0cd3('0x46')],{})['then'](respondWithResult(_0x3ecce3,0xc9))[_0x0cd3('0x42')](handleError(_0x3ecce3,null));};exports[_0x0cd3('0x23')]=function(_0x47f36d,_0x135781){if(_0x47f36d[_0x0cd3('0x46')]['id']){delete _0x47f36d[_0x0cd3('0x46')]['id'];}return db[_0x0cd3('0x2b')][_0x0cd3('0x47')]({'where':{'id':_0x47f36d[_0x0cd3('0x44')]['id']}})[_0x0cd3('0x24')](handleEntityNotFound(_0x135781,null))['then'](saveUpdates(_0x47f36d[_0x0cd3('0x46')],null))[_0x0cd3('0x24')](respondWithResult(_0x135781,null))[_0x0cd3('0x42')](handleError(_0x135781,null));};exports[_0x0cd3('0x25')]=function(_0x28e005,_0x2f8287){return db[_0x0cd3('0x2b')][_0x0cd3('0x47')]({'where':{'id':_0x28e005['params']['id']}})[_0x0cd3('0x24')](handleEntityNotFound(_0x2f8287,null))[_0x0cd3('0x24')](removeEntity(_0x2f8287,null))[_0x0cd3('0x42')](handleError(_0x2f8287,null));}; \ No newline at end of file +var _0x75ff=['mustache','util','path','sox','ejs','fs-extra','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','status','end','offset','limit','undefined','count','Content-Range','json','update','then','destroy','error','stack','name','send','map','fieldName','type','model','query','filters','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','include','FreshsalesField','findAll','rows','catch','show','keys','intersection','length','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird'];(function(_0x29092c,_0x1b1048){var _0x195cb3=function(_0x2409ef){while(--_0x2409ef){_0x29092c['push'](_0x29092c['shift']());}};_0x195cb3(++_0x1b1048);}(_0x75ff,0x1eb));var _0xf75f=function(_0x2642cb,_0x4b917f){_0x2642cb=_0x2642cb-0x0;var _0xe6e41=_0x75ff[_0x2642cb];return _0xe6e41;};'use strict';var emlformat=require(_0xf75f('0x0'));var rimraf=require(_0xf75f('0x1'));var zipdir=require(_0xf75f('0x2'));var jsonpatch=require(_0xf75f('0x3'));var rp=require('request-promise');var moment=require(_0xf75f('0x4'));var BPromise=require(_0xf75f('0x5'));var Mustache=require(_0xf75f('0x6'));var util=require(_0xf75f('0x7'));var path=require(_0xf75f('0x8'));var sox=require(_0xf75f('0x9'));var csv=require('to-csv');var ejs=require(_0xf75f('0xa'));var fs=require('fs');var fs_extra=require(_0xf75f('0xb'));var _=require('lodash');var squel=require(_0xf75f('0xc'));var crypto=require('crypto');var jsforce=require(_0xf75f('0xd'));var deskjs=require(_0xf75f('0xe'));var toCsv=require(_0xf75f('0xf'));var querystring=require(_0xf75f('0x10'));var Papa=require(_0xf75f('0x11'));var Redis=require('ioredis');var authService=require(_0xf75f('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf75f('0x13'));var hardwareService=require(_0xf75f('0x14'));var logger=require(_0xf75f('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xf75f('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xf75f('0x17'))['db'];function respondWithStatusCode(_0x412f1f,_0x2a4dc5){_0x2a4dc5=_0x2a4dc5||0xcc;return function(_0x4f364a){if(_0x4f364a){return _0x412f1f['sendStatus'](_0x2a4dc5);}return _0x412f1f[_0xf75f('0x18')](_0x2a4dc5)[_0xf75f('0x19')]();};}function respondWithResult(_0x50191a,_0x3c50bc){_0x3c50bc=_0x3c50bc||0xc8;return function(_0x304444){if(_0x304444){return _0x50191a['status'](_0x3c50bc)['json'](_0x304444);}};}function respondWithFilteredResult(_0x554616,_0x1e75d5){return function(_0x454f33){if(_0x454f33){var _0x4554a5=typeof _0x1e75d5[_0xf75f('0x1a')]==='undefined'&&typeof _0x1e75d5[_0xf75f('0x1b')]===_0xf75f('0x1c');var _0x48d7da=_0x454f33[_0xf75f('0x1d')];var _0x2021a4=_0x4554a5?0x0:_0x1e75d5[_0xf75f('0x1a')];var _0x7175c1=_0x4554a5?_0x454f33[_0xf75f('0x1d')]:_0x1e75d5[_0xf75f('0x1a')]+_0x1e75d5[_0xf75f('0x1b')];var _0x43e5f0;if(_0x7175c1>=_0x48d7da){_0x7175c1=_0x48d7da;_0x43e5f0=0xc8;}else{_0x43e5f0=0xce;}_0x554616[_0xf75f('0x18')](_0x43e5f0);return _0x554616['set'](_0xf75f('0x1e'),_0x2021a4+'-'+_0x7175c1+'/'+_0x48d7da)[_0xf75f('0x1f')](_0x454f33);}return null;};}function patchUpdates(_0x4c5c80){return function(_0x135bae){try{jsonpatch['apply'](_0x135bae,_0x4c5c80,!![]);}catch(_0x52f191){return BPromise['reject'](_0x52f191);}return _0x135bae['save']();};}function saveUpdates(_0x29326e,_0x5b5555){return function(_0x3e4cb7){if(_0x3e4cb7){return _0x3e4cb7[_0xf75f('0x20')](_0x29326e)[_0xf75f('0x21')](function(_0x3474b1){return _0x3474b1;});}return null;};}function removeEntity(_0x40003c,_0x4a144a){return function(_0x2c3a9c){if(_0x2c3a9c){return _0x2c3a9c[_0xf75f('0x22')]()['then'](function(){_0x40003c[_0xf75f('0x18')](0xcc)[_0xf75f('0x19')]();});}};}function handleEntityNotFound(_0xd3960d,_0x47b7be){return function(_0x2a3077){if(!_0x2a3077){_0xd3960d['sendStatus'](0x194);}return _0x2a3077;};}function handleError(_0x4f6928,_0x3ca97b){_0x3ca97b=_0x3ca97b||0x1f4;return function(_0x3e96fd){logger[_0xf75f('0x23')](_0x3e96fd[_0xf75f('0x24')]);if(_0x3e96fd[_0xf75f('0x25')]){delete _0x3e96fd[_0xf75f('0x25')];}_0x4f6928[_0xf75f('0x18')](_0x3ca97b)[_0xf75f('0x26')](_0x3e96fd);};}exports['index']=function(_0xc06907,_0x25d3e1){var _0x256138={},_0x1c845a={},_0x2fbfde={'count':0x0,'rows':[]};var _0x59a390=_[_0xf75f('0x27')](db['FreshsalesField']['rawAttributes'],function(_0x2edf80){return{'name':_0x2edf80[_0xf75f('0x28')],'type':_0x2edf80[_0xf75f('0x29')]['key']};});_0x1c845a[_0xf75f('0x2a')]=_[_0xf75f('0x27')](_0x59a390,_0xf75f('0x25'));_0x1c845a[_0xf75f('0x2b')]=_['keys'](_0xc06907['query']);_0x1c845a[_0xf75f('0x2c')]=_['intersection'](_0x1c845a['model'],_0x1c845a[_0xf75f('0x2b')]);_0x256138[_0xf75f('0x2d')]=_['intersection'](_0x1c845a[_0xf75f('0x2a')],qs[_0xf75f('0x2e')](_0xc06907[_0xf75f('0x2b')][_0xf75f('0x2e')]));_0x256138[_0xf75f('0x2d')]=_0x256138['attributes']['length']?_0x256138['attributes']:_0x1c845a['model'];if(!_0xc06907[_0xf75f('0x2b')][_0xf75f('0x2f')](_0xf75f('0x30'))){_0x256138[_0xf75f('0x1b')]=qs[_0xf75f('0x1b')](_0xc06907[_0xf75f('0x2b')]['limit']);_0x256138['offset']=qs[_0xf75f('0x1a')](_0xc06907['query'][_0xf75f('0x1a')]);}_0x256138[_0xf75f('0x31')]=qs[_0xf75f('0x32')](_0xc06907['query'][_0xf75f('0x32')]);_0x256138['where']=qs[_0xf75f('0x2c')](_[_0xf75f('0x33')](_0xc06907[_0xf75f('0x2b')],_0x1c845a[_0xf75f('0x2c')]),_0x59a390);if(_0xc06907[_0xf75f('0x2b')]['filter']){_0x256138[_0xf75f('0x34')]=_[_0xf75f('0x35')](_0x256138['where'],{'$or':_[_0xf75f('0x27')](_0x59a390,function(_0x1dfc5e){if(_0x1dfc5e['type']!==_0xf75f('0x36')){var _0x51b4c7={};_0x51b4c7[_0x1dfc5e['name']]={'$like':'%'+_0xc06907[_0xf75f('0x2b')][_0xf75f('0x37')]+'%'};return _0x51b4c7;}})});}_0x256138=_[_0xf75f('0x35')]({},_0x256138,_0xc06907[_0xf75f('0x38')]);var _0xda2a03={'where':_0x256138['where']};return db['FreshsalesField']['count'](_0xda2a03)[_0xf75f('0x21')](function(_0x25de3f){_0x2fbfde[_0xf75f('0x1d')]=_0x25de3f;if(_0xc06907[_0xf75f('0x2b')][_0xf75f('0x39')]){_0x256138[_0xf75f('0x3a')]=[{'all':!![]}];}return db[_0xf75f('0x3b')][_0xf75f('0x3c')](_0x256138);})[_0xf75f('0x21')](function(_0x23c6f1){_0x2fbfde[_0xf75f('0x3d')]=_0x23c6f1;return _0x2fbfde;})[_0xf75f('0x21')](respondWithFilteredResult(_0x25d3e1,_0x256138))[_0xf75f('0x3e')](handleError(_0x25d3e1,null));};exports[_0xf75f('0x3f')]=function(_0x5ef55b,_0x5cffc7){var _0x14ce47={'raw':!![],'where':{'id':_0x5ef55b['params']['id']}},_0x53598e={};_0x53598e[_0xf75f('0x2a')]=_[_0xf75f('0x40')](db[_0xf75f('0x3b')]['rawAttributes']);_0x53598e['query']=_[_0xf75f('0x40')](_0x5ef55b['query']);_0x53598e['filters']=_[_0xf75f('0x41')](_0x53598e['model'],_0x53598e[_0xf75f('0x2b')]);_0x14ce47[_0xf75f('0x2d')]=_[_0xf75f('0x41')](_0x53598e[_0xf75f('0x2a')],qs[_0xf75f('0x2e')](_0x5ef55b[_0xf75f('0x2b')][_0xf75f('0x2e')]));_0x14ce47[_0xf75f('0x2d')]=_0x14ce47[_0xf75f('0x2d')][_0xf75f('0x42')]?_0x14ce47[_0xf75f('0x2d')]:_0x53598e[_0xf75f('0x2a')];if(_0x5ef55b['query'][_0xf75f('0x39')]){_0x14ce47[_0xf75f('0x3a')]=[{'all':!![]}];}_0x14ce47=_[_0xf75f('0x35')]({},_0x14ce47,_0x5ef55b[_0xf75f('0x38')]);return db[_0xf75f('0x3b')][_0xf75f('0x43')](_0x14ce47)[_0xf75f('0x21')](handleEntityNotFound(_0x5cffc7,null))['then'](respondWithResult(_0x5cffc7,null))[_0xf75f('0x3e')](handleError(_0x5cffc7,null));};exports[_0xf75f('0x44')]=function(_0x4c4871,_0x29f46d){return db[_0xf75f('0x3b')]['create'](_0x4c4871['body'],{})[_0xf75f('0x21')](respondWithResult(_0x29f46d,0xc9))[_0xf75f('0x3e')](handleError(_0x29f46d,null));};exports[_0xf75f('0x20')]=function(_0x4dc48c,_0x43ebdb){if(_0x4dc48c['body']['id']){delete _0x4dc48c[_0xf75f('0x45')]['id'];}return db[_0xf75f('0x3b')][_0xf75f('0x43')]({'where':{'id':_0x4dc48c[_0xf75f('0x46')]['id']}})[_0xf75f('0x21')](handleEntityNotFound(_0x43ebdb,null))['then'](saveUpdates(_0x4dc48c['body'],null))[_0xf75f('0x21')](respondWithResult(_0x43ebdb,null))[_0xf75f('0x3e')](handleError(_0x43ebdb,null));};exports[_0xf75f('0x22')]=function(_0x1e1e85,_0x2a0cf2){return db[_0xf75f('0x3b')][_0xf75f('0x43')]({'where':{'id':_0x1e1e85[_0xf75f('0x46')]['id']}})['then'](handleEntityNotFound(_0x2a0cf2,null))[_0xf75f('0x21')](removeEntity(_0x2a0cf2,null))['catch'](handleError(_0x2a0cf2,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index 40225f0..1cbf183 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 _0x2b50=['exports','int_freshsales_fields','freshsales_unique_index','idField','FieldId','lodash','../../config/logger','request-promise','path','rimraf','../../config/environment'];(function(_0x142cd8,_0x3dc7bf){var _0x1ecae5=function(_0x41150e){while(--_0x41150e){_0x142cd8['push'](_0x142cd8['shift']());}};_0x1ecae5(++_0x3dc7bf);}(_0x2b50,0x68));var _0x02b5=function(_0x4c689a,_0x5ef76e){_0x4c689a=_0x4c689a-0x0;var _0x46e149=_0x2b50[_0x4c689a];return _0x46e149;};'use strict';var _=require(_0x02b5('0x0'));var util=require('util');var logger=require(_0x02b5('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x02b5('0x2'));var fs=require('fs');var path=require(_0x02b5('0x3'));var rimraf=require(_0x02b5('0x4'));var config=require(_0x02b5('0x5'));var attributes=require('./intFreshsalesField.attributes');module[_0x02b5('0x6')]=function(_0x1670e0,_0x5ac1d1){return _0x1670e0['define']('FreshsalesField',attributes,{'tableName':_0x02b5('0x7'),'paranoid':![],'indexes':[{'name':_0x02b5('0x8'),'fields':[_0x02b5('0x9'),_0x02b5('0xa')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1d21=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','./intFreshsalesField.attributes','exports','define','FreshsalesField','int_freshsales_fields','idField','FieldId','lodash'];(function(_0x3f829f,_0x4565dc){var _0x577851=function(_0x571c05){while(--_0x571c05){_0x3f829f['push'](_0x3f829f['shift']());}};_0x577851(++_0x4565dc);}(_0x1d21,0x158));var _0x11d2=function(_0x12d812,_0x496bb7){_0x12d812=_0x12d812-0x0;var _0x3711ab=_0x1d21[_0x12d812];return _0x3711ab;};'use strict';var _=require(_0x11d2('0x0'));var util=require(_0x11d2('0x1'));var logger=require(_0x11d2('0x2'))(_0x11d2('0x3'));var moment=require('moment');var BPromise=require(_0x11d2('0x4'));var rp=require(_0x11d2('0x5'));var fs=require('fs');var path=require(_0x11d2('0x6'));var rimraf=require(_0x11d2('0x7'));var config=require('../../config/environment');var attributes=require(_0x11d2('0x8'));module[_0x11d2('0x9')]=function(_0x16e99c,_0x21a2d3){return _0x16e99c[_0x11d2('0xa')](_0x11d2('0xb'),attributes,{'tableName':_0x11d2('0xc'),'paranoid':![],'indexes':[{'name':'freshsales_unique_index','fields':[_0x11d2('0xd'),_0x11d2('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.rpc.js b/server/api/intFreshsalesField/intFreshsalesField.rpc.js index 660160e..664243f 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 _0x3f8a=['catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result'];(function(_0x35885a,_0x42fed7){var _0xe86249=function(_0x98edb3){while(--_0x98edb3){_0x35885a['push'](_0x35885a['shift']());}};_0xe86249(++_0x42fed7);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x2ef9cb,_0x11ec04){_0x2ef9cb=_0x2ef9cb-0x0;var _0x1ae5f4=_0x3f8a[_0x2ef9cb];return _0x1ae5f4;};'use strict';var _=require(_0xa3f8('0x0'));var util=require(_0xa3f8('0x1'));var moment=require(_0xa3f8('0x2'));var BPromise=require(_0xa3f8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa3f8('0x4'));var db=require(_0xa3f8('0x5'))['db'];var utils=require(_0xa3f8('0x6'));var logger=require(_0xa3f8('0x7'))(_0xa3f8('0x8'));var config=require(_0xa3f8('0x9'));var jayson=require(_0xa3f8('0xa'));var client=jayson[_0xa3f8('0xb')][_0xa3f8('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xf895d9,_0xcfea5,_0x268332){return new BPromise(function(_0x2faf2e,_0x2448de){return client[_0xa3f8('0xd')](_0xf895d9,_0x268332)[_0xa3f8('0xe')](function(_0xcdb0d4){logger['info'](_0xa3f8('0xf'),_0xcfea5,_0xa3f8('0x10'));logger[_0xa3f8('0x11')](_0xa3f8('0x12'),_0xcfea5,'request\x20sent',JSON[_0xa3f8('0x13')](_0xcdb0d4));if(_0xcdb0d4[_0xa3f8('0x14')]){if(_0xcdb0d4[_0xa3f8('0x14')][_0xa3f8('0x15')]===0x1f4){logger[_0xa3f8('0x14')](_0xa3f8('0xf'),_0xcfea5,_0xcdb0d4[_0xa3f8('0x14')][_0xa3f8('0x16')]);return _0x2448de(_0xcdb0d4[_0xa3f8('0x14')][_0xa3f8('0x16')]);}logger[_0xa3f8('0x14')](_0xa3f8('0xf'),_0xcfea5,_0xcdb0d4['error'][_0xa3f8('0x16')]);return _0x2faf2e(_0xcdb0d4[_0xa3f8('0x14')][_0xa3f8('0x16')]);}else{logger[_0xa3f8('0x17')]('FreshsalesField,\x20%s,\x20%s',_0xcfea5,_0xa3f8('0x10'));_0x2faf2e(_0xcdb0d4[_0xa3f8('0x18')][_0xa3f8('0x16')]);}})[_0xa3f8('0x19')](function(_0x45ef64){logger[_0xa3f8('0x14')](_0xa3f8('0xf'),_0xcfea5,_0x45ef64);_0x2448de(_0x45ef64);});});} \ No newline at end of file +var _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x5d0912,_0x5a54cf){var _0x3ab6d=function(_0x505055){while(--_0x505055){_0x5d0912['push'](_0x5d0912['shift']());}};_0x3ab6d(++_0x5a54cf);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0xc4aa[_0x5f09c5];return _0x426ad9;};'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')]('FreshsalesField,\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/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index eeedbe3..ca9d73b 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(_0xb8a9d9,_0x419509){var _0x5302f3=function(_0xc4607a){while(--_0xc4607a){_0xb8a9d9['push'](_0xb8a9d9['shift']());}};_0x5302f3(++_0x419509);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x5d5f7d,_0x1d9a54){var _0x2dd0d7=function(_0x1766d5){while(--_0x1766d5){_0x5d5f7d['push'](_0x5d5f7d['shift']());}};_0x2dd0d7(++_0x1d9a54);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0xa9e0[_0xf50820];return _0x2a9b10;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index 0d51dae..0e4bbd9 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 _0xf643=['ENUM','integrationTab','newTab','sequelize','exports','STRING','username'];(function(_0x59897b,_0x2ef26f){var _0x2367dd=function(_0x5d6ce3){while(--_0x5d6ce3){_0x59897b['push'](_0x59897b['shift']());}};_0x2367dd(++_0x2ef26f);}(_0xf643,0x122));var _0x3f64=function(_0x12156e,_0x550b21){_0x12156e=_0x12156e-0x0;var _0x55ada7=_0xf643[_0x12156e];return _0x55ada7;};'use strict';var Sequelize=require(_0x3f64('0x0'));module[_0x3f64('0x1')]={'name':{'type':Sequelize[_0x3f64('0x2')]},'description':{'type':Sequelize[_0x3f64('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x3f64('0x3')},'remoteUri':{'type':Sequelize[_0x3f64('0x2')]},'password':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x3f64('0x2')]},'clientSecret':{'type':Sequelize[_0x3f64('0x2')]},'securityToken':{'type':Sequelize[_0x3f64('0x2')]},'serverUrl':{'type':Sequelize[_0x3f64('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x3f64('0x4')](_0x3f64('0x5'),_0x3f64('0x6')),'defaultValue':_0x3f64('0x5')}}; \ No newline at end of file +var _0xaa64=['integrationTab','newTab','sequelize','exports','STRING','username','ENUM'];(function(_0x441d62,_0x3188f3){var _0x2099f0=function(_0x1df0d8){while(--_0x1df0d8){_0x441d62['push'](_0x441d62['shift']());}};_0x2099f0(++_0x3188f3);}(_0xaa64,0xf7));var _0x4aa6=function(_0x7f3b5f,_0xfe3d68){_0x7f3b5f=_0x7f3b5f-0x0;var _0x4d03cf=_0xaa64[_0x7f3b5f];return _0x4d03cf;};'use strict';var Sequelize=require(_0x4aa6('0x0'));module[_0x4aa6('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x4aa6('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x4aa6('0x3')},'remoteUri':{'type':Sequelize[_0x4aa6('0x2')]},'password':{'type':Sequelize[_0x4aa6('0x2')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0x4aa6('0x2')]},'securityToken':{'type':Sequelize[_0x4aa6('0x2')]},'serverUrl':{'type':Sequelize[_0x4aa6('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x4aa6('0x4')](_0x4aa6('0x5'),_0x4aa6('0x6')),'defaultValue':_0x4aa6('0x5')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index 5b4f13c..fea6c03 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 _0xbe7d=['SalesforceConfiguration','rawAttributes','addConfiguration','AccountId','Subjects','channel','Descriptions','getDescriptions','SalesforceField','Task','remoteUri','clientId','clientSecret','username','securityToken','slice','substring','lastIndexOf','Connection','login','password','concat','ticketType','sobject','OwnerId','ActivityDate','IsReminderSet','IsRecurrence','Subject','Description','string','int','picklist','boolean','email','textarea','phone','remove','includes','label','custom','picklistValues','value','True','true','false','test','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','Wrong\x20credentials','statusCode','eml-format','rimraf','request-promise','moment','mustache','util','path','sox','to-csv','ejs','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','destroy','then','stack','name','send','index','map','SalesforceAccount','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','create','body','find','getConfigurations','findOne'];(function(_0x3341b6,_0x338500){var _0x41491b=function(_0x267b91){while(--_0x267b91){_0x3341b6['push'](_0x3341b6['shift']());}};_0x41491b(++_0x338500);}(_0xbe7d,0x1b7));var _0xdbe7=function(_0x24502d,_0x3a7c6f){_0x24502d=_0x24502d-0x0;var _0xd3f48c=_0xbe7d[_0x24502d];return _0xd3f48c;};'use strict';var emlformat=require(_0xdbe7('0x0'));var rimraf=require(_0xdbe7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xdbe7('0x2'));var moment=require(_0xdbe7('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xdbe7('0x4'));var util=require(_0xdbe7('0x5'));var path=require(_0xdbe7('0x6'));var sox=require(_0xdbe7('0x7'));var csv=require(_0xdbe7('0x8'));var ejs=require(_0xdbe7('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xdbe7('0xa'));var crypto=require(_0xdbe7('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xdbe7('0xc'));var Papa=require(_0xdbe7('0xd'));var Redis=require(_0xdbe7('0xe'));var authService=require(_0xdbe7('0xf'));var qs=require(_0xdbe7('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdbe7('0x11'));var logger=require(_0xdbe7('0x12'))(_0xdbe7('0x13'));var utils=require(_0xdbe7('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xdbe7('0x15'));var db=require(_0xdbe7('0x16'))['db'];var integrations=require(_0xdbe7('0x17'));function respondWithStatusCode(_0x2f9d12,_0x1657a4){_0x1657a4=_0x1657a4||0xcc;return function(_0xc84db7){if(_0xc84db7){return _0x2f9d12[_0xdbe7('0x18')](_0x1657a4);}return _0x2f9d12[_0xdbe7('0x19')](_0x1657a4)[_0xdbe7('0x1a')]();};}function respondWithResult(_0x5b07bb,_0x4e1d8d){_0x4e1d8d=_0x4e1d8d||0xc8;return function(_0x37a069){if(_0x37a069){return _0x5b07bb[_0xdbe7('0x19')](_0x4e1d8d)[_0xdbe7('0x1b')](_0x37a069);}};}function respondWithFilteredResult(_0x337083,_0x16ead1){return function(_0x14b205){if(_0x14b205){var _0xdc736a=typeof _0x16ead1['offset']===_0xdbe7('0x1c')&&typeof _0x16ead1[_0xdbe7('0x1d')]==='undefined';var _0xc8ad3=_0x14b205[_0xdbe7('0x1e')];var _0x2cd9f2=_0xdc736a?0x0:_0x16ead1[_0xdbe7('0x1f')];var _0x254159=_0xdc736a?_0x14b205[_0xdbe7('0x1e')]:_0x16ead1[_0xdbe7('0x1f')]+_0x16ead1[_0xdbe7('0x1d')];var _0x41e4d3;if(_0x254159>=_0xc8ad3){_0x254159=_0xc8ad3;_0x41e4d3=0xc8;}else{_0x41e4d3=0xce;}_0x337083[_0xdbe7('0x19')](_0x41e4d3);return _0x337083[_0xdbe7('0x20')](_0xdbe7('0x21'),_0x2cd9f2+'-'+_0x254159+'/'+_0xc8ad3)[_0xdbe7('0x1b')](_0x14b205);}return null;};}function patchUpdates(_0x2310a9){return function(_0x5da9f8){try{jsonpatch[_0xdbe7('0x22')](_0x5da9f8,_0x2310a9,!![]);}catch(_0x379743){return BPromise['reject'](_0x379743);}return _0x5da9f8[_0xdbe7('0x23')]();};}function saveUpdates(_0x146aa4,_0xe0db93){return function(_0x3f132d){if(_0x3f132d){return _0x3f132d[_0xdbe7('0x24')](_0x146aa4)['then'](function(_0x4e6ada){return _0x4e6ada;});}return null;};}function removeEntity(_0x180cf5,_0x45c640){return function(_0x1a07dd){if(_0x1a07dd){return _0x1a07dd[_0xdbe7('0x25')]()[_0xdbe7('0x26')](function(){_0x180cf5[_0xdbe7('0x19')](0xcc)[_0xdbe7('0x1a')]();});}};}function handleEntityNotFound(_0x49d65e,_0x2dfb2f){return function(_0x37cda5){if(!_0x37cda5){_0x49d65e[_0xdbe7('0x18')](0x194);}return _0x37cda5;};}function handleError(_0x59bcd8,_0x4e3de0){_0x4e3de0=_0x4e3de0||0x1f4;return function(_0x2164ba){logger['error'](_0x2164ba[_0xdbe7('0x27')]);if(_0x2164ba[_0xdbe7('0x28')]){delete _0x2164ba[_0xdbe7('0x28')];}_0x59bcd8[_0xdbe7('0x19')](_0x4e3de0)[_0xdbe7('0x29')](_0x2164ba);};}exports[_0xdbe7('0x2a')]=function(_0x303cea,_0x164dc3){var _0x3f0233={},_0x4b3d39={},_0x345600={'count':0x0,'rows':[]};var _0x38e3e3=_[_0xdbe7('0x2b')](db[_0xdbe7('0x2c')]['rawAttributes'],function(_0x2c7d88){return{'name':_0x2c7d88[_0xdbe7('0x2d')],'type':_0x2c7d88[_0xdbe7('0x2e')][_0xdbe7('0x2f')]};});_0x4b3d39[_0xdbe7('0x30')]=_[_0xdbe7('0x2b')](_0x38e3e3,'name');_0x4b3d39[_0xdbe7('0x31')]=_[_0xdbe7('0x32')](_0x303cea['query']);_0x4b3d39[_0xdbe7('0x33')]=_[_0xdbe7('0x34')](_0x4b3d39[_0xdbe7('0x30')],_0x4b3d39[_0xdbe7('0x31')]);_0x3f0233[_0xdbe7('0x35')]=_[_0xdbe7('0x34')](_0x4b3d39['model'],qs[_0xdbe7('0x36')](_0x303cea[_0xdbe7('0x31')][_0xdbe7('0x36')]));_0x3f0233['attributes']=_0x3f0233['attributes'][_0xdbe7('0x37')]?_0x3f0233[_0xdbe7('0x35')]:_0x4b3d39[_0xdbe7('0x30')];if(!_0x303cea[_0xdbe7('0x31')][_0xdbe7('0x38')](_0xdbe7('0x39'))){_0x3f0233[_0xdbe7('0x1d')]=qs[_0xdbe7('0x1d')](_0x303cea[_0xdbe7('0x31')][_0xdbe7('0x1d')]);_0x3f0233[_0xdbe7('0x1f')]=qs[_0xdbe7('0x1f')](_0x303cea[_0xdbe7('0x31')][_0xdbe7('0x1f')]);}_0x3f0233[_0xdbe7('0x3a')]=qs[_0xdbe7('0x3b')](_0x303cea[_0xdbe7('0x31')]['sort']);_0x3f0233[_0xdbe7('0x3c')]=qs['filters'](_[_0xdbe7('0x3d')](_0x303cea['query'],_0x4b3d39[_0xdbe7('0x33')]),_0x38e3e3);if(_0x303cea['query'][_0xdbe7('0x3e')]){_0x3f0233[_0xdbe7('0x3c')]=_['merge'](_0x3f0233[_0xdbe7('0x3c')],{'$or':_['map'](_0x38e3e3,function(_0xe4a3fe){if(_0xe4a3fe['type']!==_0xdbe7('0x3f')){var _0x54ae28={};_0x54ae28[_0xe4a3fe[_0xdbe7('0x28')]]={'$like':'%'+_0x303cea['query']['filter']+'%'};return _0x54ae28;}})});}_0x3f0233=_[_0xdbe7('0x40')]({},_0x3f0233,_0x303cea[_0xdbe7('0x41')]);var _0x466a36={'where':_0x3f0233[_0xdbe7('0x3c')]};return db[_0xdbe7('0x2c')][_0xdbe7('0x1e')](_0x466a36)['then'](function(_0x9d6534){_0x345600[_0xdbe7('0x1e')]=_0x9d6534;if(_0x303cea['query'][_0xdbe7('0x42')]){_0x3f0233[_0xdbe7('0x43')]=[{'all':!![]}];}return db[_0xdbe7('0x2c')][_0xdbe7('0x44')](_0x3f0233);})['then'](function(_0x4ac766){_0x345600[_0xdbe7('0x45')]=_0x4ac766;return _0x345600;})[_0xdbe7('0x26')](respondWithFilteredResult(_0x164dc3,_0x3f0233))[_0xdbe7('0x46')](handleError(_0x164dc3,null));};exports['show']=function(_0x4a7b3f,_0x516ca6){var _0x16fe1d={'raw':![],'where':{'id':_0x4a7b3f[_0xdbe7('0x47')]['id']}},_0xb884a1={};_0xb884a1[_0xdbe7('0x30')]=_[_0xdbe7('0x32')](db[_0xdbe7('0x2c')]['rawAttributes']);_0xb884a1['query']=_[_0xdbe7('0x32')](_0x4a7b3f[_0xdbe7('0x31')]);_0xb884a1[_0xdbe7('0x33')]=_[_0xdbe7('0x34')](_0xb884a1[_0xdbe7('0x30')],_0xb884a1['query']);_0x16fe1d[_0xdbe7('0x35')]=_[_0xdbe7('0x34')](_0xb884a1[_0xdbe7('0x30')],qs[_0xdbe7('0x36')](_0x4a7b3f['query'][_0xdbe7('0x36')]));_0x16fe1d[_0xdbe7('0x35')]=_0x16fe1d[_0xdbe7('0x35')][_0xdbe7('0x37')]?_0x16fe1d['attributes']:_0xb884a1[_0xdbe7('0x30')];if(_0x4a7b3f[_0xdbe7('0x31')][_0xdbe7('0x42')]){_0x16fe1d[_0xdbe7('0x43')]=[{'all':!![]}];}_0x16fe1d=_['merge']({},_0x16fe1d,_0x4a7b3f[_0xdbe7('0x41')]);return db[_0xdbe7('0x2c')]['find'](_0x16fe1d)['then'](handleEntityNotFound(_0x516ca6,null))['then'](respondWithResult(_0x516ca6,null))[_0xdbe7('0x46')](handleError(_0x516ca6,null));};exports[_0xdbe7('0x48')]=function(_0x36596e,_0x108274){return db['SalesforceAccount'][_0xdbe7('0x48')](_0x36596e[_0xdbe7('0x49')],{})[_0xdbe7('0x26')](respondWithResult(_0x108274,0xc9))['catch'](handleError(_0x108274,null));};exports[_0xdbe7('0x24')]=function(_0x855b78,_0x1bfd59){if(_0x855b78[_0xdbe7('0x49')]['id']){delete _0x855b78[_0xdbe7('0x49')]['id'];}return db[_0xdbe7('0x2c')][_0xdbe7('0x4a')]({'where':{'id':_0x855b78['params']['id']}})[_0xdbe7('0x26')](handleEntityNotFound(_0x1bfd59,null))['then'](saveUpdates(_0x855b78[_0xdbe7('0x49')],null))[_0xdbe7('0x26')](respondWithResult(_0x1bfd59,null))[_0xdbe7('0x46')](handleError(_0x1bfd59,null));};exports[_0xdbe7('0x25')]=function(_0x2d6727,_0x328f36){return db[_0xdbe7('0x2c')]['find']({'where':{'id':_0x2d6727[_0xdbe7('0x47')]['id']}})[_0xdbe7('0x26')](handleEntityNotFound(_0x328f36,null))['then'](removeEntity(_0x328f36,null))[_0xdbe7('0x46')](handleError(_0x328f36,null));};exports[_0xdbe7('0x4b')]=function(_0x3a382c,_0x4cfd2e,_0x2dcf39){var _0xbfe497={};var _0x2560a0={};var _0x1d7444;var _0x386d7f;return db[_0xdbe7('0x2c')][_0xdbe7('0x4c')]({'where':{'id':_0x3a382c[_0xdbe7('0x47')]['id']}})['then'](handleEntityNotFound(_0x4cfd2e,null))[_0xdbe7('0x26')](function(_0x5596ec){if(_0x5596ec){_0x1d7444=_0x5596ec;_0x2560a0[_0xdbe7('0x30')]=_[_0xdbe7('0x32')](db[_0xdbe7('0x4d')][_0xdbe7('0x4e')]);_0x2560a0['query']=_[_0xdbe7('0x32')](_0x3a382c[_0xdbe7('0x31')]);_0x2560a0[_0xdbe7('0x33')]=_[_0xdbe7('0x34')](_0x2560a0[_0xdbe7('0x30')],_0x2560a0['query']);_0xbfe497['attributes']=_[_0xdbe7('0x34')](_0x2560a0[_0xdbe7('0x30')],qs[_0xdbe7('0x36')](_0x3a382c[_0xdbe7('0x31')][_0xdbe7('0x36')]));_0xbfe497[_0xdbe7('0x35')]=_0xbfe497[_0xdbe7('0x35')]['length']?_0xbfe497[_0xdbe7('0x35')]:_0x2560a0[_0xdbe7('0x30')];_0xbfe497[_0xdbe7('0x3a')]=qs[_0xdbe7('0x3b')](_0x3a382c[_0xdbe7('0x31')]['sort']);_0xbfe497[_0xdbe7('0x3c')]=qs['filters'](_[_0xdbe7('0x3d')](_0x3a382c[_0xdbe7('0x31')],_0x2560a0[_0xdbe7('0x33')]));if(_0x3a382c[_0xdbe7('0x31')][_0xdbe7('0x3e')]){_0xbfe497[_0xdbe7('0x3c')]=_['merge'](_0xbfe497['where'],{'$or':_[_0xdbe7('0x2b')](_0xbfe497[_0xdbe7('0x35')],function(_0x37e795){var _0x402203={};_0x402203[_0x37e795]={'$like':'%'+_0x3a382c[_0xdbe7('0x31')][_0xdbe7('0x3e')]+'%'};return _0x402203;})});}_0xbfe497=_['merge']({},_0xbfe497,_0x3a382c['options']);return _0x1d7444[_0xdbe7('0x4b')](_0xbfe497);}})[_0xdbe7('0x26')](function(_0x41643e){if(_0x41643e){_0x386d7f=_0x41643e[_0xdbe7('0x37')];if(!_0x3a382c[_0xdbe7('0x31')]['hasOwnProperty'](_0xdbe7('0x39'))){_0xbfe497[_0xdbe7('0x1d')]=qs[_0xdbe7('0x1d')](_0x3a382c[_0xdbe7('0x31')][_0xdbe7('0x1d')]);_0xbfe497[_0xdbe7('0x1f')]=qs[_0xdbe7('0x1f')](_0x3a382c[_0xdbe7('0x31')][_0xdbe7('0x1f')]);}return _0x1d7444['getConfigurations'](_0xbfe497);}})[_0xdbe7('0x26')](function(_0x2bc529){if(_0x2bc529){return _0x2bc529?{'count':_0x386d7f,'rows':_0x2bc529}:null;}})[_0xdbe7('0x26')](respondWithResult(_0x4cfd2e,null))[_0xdbe7('0x46')](handleError(_0x4cfd2e,null));};exports[_0xdbe7('0x4f')]=function(_0x2e4b7c,_0x4ac815,_0x431e2e){if(_0x2e4b7c[_0xdbe7('0x49')]['id']){delete _0x2e4b7c[_0xdbe7('0x49')]['id'];}return db[_0xdbe7('0x2c')][_0xdbe7('0x4c')]({'where':{'id':_0x2e4b7c[_0xdbe7('0x47')]['id']}})['then'](handleEntityNotFound(_0x4ac815,null))[_0xdbe7('0x26')](function(_0x4d7f40){if(_0x4d7f40){_0x2e4b7c[_0xdbe7('0x49')][_0xdbe7('0x50')]=_0x4d7f40['id'];_0x2e4b7c[_0xdbe7('0x49')][_0xdbe7('0x51')]=integrations['getSubjects'](_0x2e4b7c['body'][_0xdbe7('0x52')],_0x2e4b7c[_0xdbe7('0x49')][_0xdbe7('0x2e')]);_0x2e4b7c[_0xdbe7('0x49')][_0xdbe7('0x53')]=integrations[_0xdbe7('0x54')](_0x2e4b7c[_0xdbe7('0x49')]['channel'],_0x2e4b7c['body']['type']);return db['SalesforceConfiguration'][_0xdbe7('0x48')](_0x2e4b7c[_0xdbe7('0x49')],{'include':[{'model':db[_0xdbe7('0x55')],'as':_0xdbe7('0x51')},{'model':db[_0xdbe7('0x55')],'as':'Descriptions'}]});}return null;})[_0xdbe7('0x26')](respondWithResult(_0x4ac815,null))[_0xdbe7('0x46')](handleError(_0x4ac815,null));};exports['getFields']=function(_0x1722e8,_0x253f37,_0x4c3114){var _0x4cd8dd;var _0x2e46df='';var _0x3b93f3=_0xdbe7('0x56');return db[_0xdbe7('0x2c')][_0xdbe7('0x4c')]({'where':{'id':_0x1722e8[_0xdbe7('0x47')]['id']},'attributes':['id',_0xdbe7('0x57'),_0xdbe7('0x58'),_0xdbe7('0x59'),_0xdbe7('0x5a'),'password',_0xdbe7('0x5b')]})[_0xdbe7('0x26')](handleEntityNotFound(_0x253f37,null))[_0xdbe7('0x26')](function(_0x5bc28f){if(_0x5bc28f){_0x2e46df=_0x5bc28f['remoteUri'];var _0x26b43a=_0x2e46df[_0xdbe7('0x5c')](-0x1);if(_0x26b43a==='/'){_0x2e46df=_0x2e46df[_0xdbe7('0x5d')](0x0,_0x2e46df[_0xdbe7('0x5e')](_0x26b43a));}_0x4cd8dd=new jsforce[(_0xdbe7('0x5f'))]({'oauth2':{'loginUrl':_0x2e46df,'clientId':_0x5bc28f[_0xdbe7('0x58')],'clientSecret':_0x5bc28f[_0xdbe7('0x59')]}});return _0x4cd8dd[_0xdbe7('0x60')](_0x5bc28f['username'],_0x5bc28f[_0xdbe7('0x61')][_0xdbe7('0x62')](_0x5bc28f['securityToken']));}})[_0xdbe7('0x26')](function(_0x1e27d5){if(_0x1e27d5){if(!_['isNil'](_0x1722e8[_0xdbe7('0x31')][_0xdbe7('0x63')])){_0x3b93f3=_0x1722e8[_0xdbe7('0x31')][_0xdbe7('0x63')];}return _0x4cd8dd[_0xdbe7('0x64')](_0x3b93f3)['describe']();}})[_0xdbe7('0x26')](function(_0x388d86){var _0x581885=[_0xdbe7('0x65'),_0xdbe7('0x66'),_0xdbe7('0x67'),_0xdbe7('0x68'),_0xdbe7('0x69'),_0xdbe7('0x6a')];var _0x52f659=[_0xdbe7('0x6b'),_0xdbe7('0x6c'),_0xdbe7('0x6d'),_0xdbe7('0x6e'),_0xdbe7('0x6f'),_0xdbe7('0x70'),_0xdbe7('0x71')];if(_0x388d86){_[_0xdbe7('0x72')](_0x388d86['fields'],function(_0x4165a3){return _0x581885[_0xdbe7('0x73')](_0x4165a3[_0xdbe7('0x28')])||!_0x52f659[_0xdbe7('0x73')](_0x4165a3[_0xdbe7('0x2e')]);});return{'count':_0x388d86[_0xdbe7('0x36')][_0xdbe7('0x37')],'rows':_[_0xdbe7('0x2b')](_0x388d86[_0xdbe7('0x36')],function(_0x23ddf9){return{'id':_0x23ddf9[_0xdbe7('0x28')],'name':_0x23ddf9[_0xdbe7('0x74')],'custom':_0x23ddf9[_0xdbe7('0x75')],'options':_0x23ddf9['picklistValues']['length']>0x0?_[_0xdbe7('0x2b')](_0x23ddf9[_0xdbe7('0x76')],function(_0x2e520d){return{'name':_0x2e520d[_0xdbe7('0x74')],'value':_0x2e520d[_0xdbe7('0x77')]};}):_0x23ddf9[_0xdbe7('0x2e')]==_0xdbe7('0x6e')?[{'name':_0xdbe7('0x78'),'value':_0xdbe7('0x79')},{'name':'False','value':_0xdbe7('0x7a')}]:[]};})};}})[_0xdbe7('0x26')](respondWithResult(_0x253f37,null))['catch'](function(_0x2c27c6){var _0xcfaafd=_0x1722e8[_0xdbe7('0x31')][_0xdbe7('0x7b')]?0x1f4:_0x2c27c6['statusCode']||0x1f4;logger['error'](_0xdbe7('0x7c'),_0xdbe7('0x7d'),_0xcfaafd,JSON[_0xdbe7('0x7e')](_0x2c27c6));delete _0x2c27c6[_0xdbe7('0x28')];if(_0xcfaafd===0x191){_0xcfaafd=0x190;}_0x253f37['status'](_0xcfaafd)[_0xdbe7('0x29')](_0x1722e8['query']['test']?{'message':_0xdbe7('0x7f'),'statusCode':_0x2c27c6[_0xdbe7('0x80')]}:_0x2c27c6);});}; \ No newline at end of file +var _0xc4cb=['getSubjects','channel','Descriptions','getDescriptions','SalesforceConfiguration','SalesforceField','Task','clientSecret','username','password','remoteUri','slice','substring','lastIndexOf','clientId','login','concat','isNil','ticketType','sobject','describe','OwnerId','IsReminderSet','Subject','int','picklist','boolean','textarea','phone','remove','includes','label','custom','picklistValues','True','true','False','statusCode','getFields','stringify','send','test','Wrong\x20credentials','eml-format','zip-dir','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','end','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','sendStatus','error','index','map','SalesforceAccount','fieldName','key','model','name','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','show','keys','rawAttributes','include','find','create','body','params','getConfigurations','filter','hasOwnProperty','addConfiguration','findOne','Subjects'];(function(_0xfe69b5,_0x3eae9f){var _0x5867ea=function(_0x4cb5cc){while(--_0x4cb5cc){_0xfe69b5['push'](_0xfe69b5['shift']());}};_0x5867ea(++_0x3eae9f);}(_0xc4cb,0x11b));var _0xbc4c=function(_0x59c86e,_0x38ce57){_0x59c86e=_0x59c86e-0x0;var _0x48a50e=_0xc4cb[_0x59c86e];return _0x48a50e;};'use strict';var emlformat=require(_0xbc4c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbc4c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbc4c('0x2'));var moment=require(_0xbc4c('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xbc4c('0x4'));var util=require(_0xbc4c('0x5'));var path=require('path');var sox=require(_0xbc4c('0x6'));var csv=require(_0xbc4c('0x7'));var ejs=require(_0xbc4c('0x8'));var fs=require('fs');var fs_extra=require(_0xbc4c('0x9'));var _=require(_0xbc4c('0xa'));var squel=require(_0xbc4c('0xb'));var crypto=require(_0xbc4c('0xc'));var jsforce=require(_0xbc4c('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xbc4c('0x7'));var querystring=require('querystring');var Papa=require(_0xbc4c('0xe'));var Redis=require(_0xbc4c('0xf'));var authService=require(_0xbc4c('0x10'));var qs=require(_0xbc4c('0x11'));var as=require(_0xbc4c('0x12'));var hardwareService=require(_0xbc4c('0x13'));var logger=require('../../config/logger')(_0xbc4c('0x14'));var utils=require(_0xbc4c('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x601345,_0x2226cc){_0x2226cc=_0x2226cc||0xcc;return function(_0x4508fa){if(_0x4508fa){return _0x601345['sendStatus'](_0x2226cc);}return _0x601345['status'](_0x2226cc)[_0xbc4c('0x16')]();};}function respondWithResult(_0x1d7bd1,_0x3e38fb){_0x3e38fb=_0x3e38fb||0xc8;return function(_0x3bf338){if(_0x3bf338){return _0x1d7bd1[_0xbc4c('0x17')](_0x3e38fb)['json'](_0x3bf338);}};}function respondWithFilteredResult(_0xd54b36,_0x39f522){return function(_0x34931a){if(_0x34931a){var _0x54c743=typeof _0x39f522[_0xbc4c('0x18')]===_0xbc4c('0x19')&&typeof _0x39f522[_0xbc4c('0x1a')]===_0xbc4c('0x19');var _0x46f3f6=_0x34931a[_0xbc4c('0x1b')];var _0x3aef7f=_0x54c743?0x0:_0x39f522[_0xbc4c('0x18')];var _0x1228f7=_0x54c743?_0x34931a['count']:_0x39f522[_0xbc4c('0x18')]+_0x39f522[_0xbc4c('0x1a')];var _0x3fe136;if(_0x1228f7>=_0x46f3f6){_0x1228f7=_0x46f3f6;_0x3fe136=0xc8;}else{_0x3fe136=0xce;}_0xd54b36['status'](_0x3fe136);return _0xd54b36[_0xbc4c('0x1c')](_0xbc4c('0x1d'),_0x3aef7f+'-'+_0x1228f7+'/'+_0x46f3f6)['json'](_0x34931a);}return null;};}function patchUpdates(_0x1b5d6d){return function(_0x4e3f3a){try{jsonpatch[_0xbc4c('0x1e')](_0x4e3f3a,_0x1b5d6d,!![]);}catch(_0x2dd1f2){return BPromise[_0xbc4c('0x1f')](_0x2dd1f2);}return _0x4e3f3a[_0xbc4c('0x20')]();};}function saveUpdates(_0x43a87f,_0x58608f){return function(_0x2938b3){if(_0x2938b3){return _0x2938b3[_0xbc4c('0x21')](_0x43a87f)[_0xbc4c('0x22')](function(_0x17b6fe){return _0x17b6fe;});}return null;};}function removeEntity(_0x3b38ae,_0x39ca60){return function(_0x5c8fcb){if(_0x5c8fcb){return _0x5c8fcb['destroy']()[_0xbc4c('0x22')](function(){_0x3b38ae['status'](0xcc)[_0xbc4c('0x16')]();});}};}function handleEntityNotFound(_0x4f094e,_0x55e8e3){return function(_0x3a3057){if(!_0x3a3057){_0x4f094e[_0xbc4c('0x23')](0x194);}return _0x3a3057;};}function handleError(_0x1f322b,_0x16f327){_0x16f327=_0x16f327||0x1f4;return function(_0x38a5e4){logger[_0xbc4c('0x24')](_0x38a5e4['stack']);if(_0x38a5e4['name']){delete _0x38a5e4['name'];}_0x1f322b[_0xbc4c('0x17')](_0x16f327)['send'](_0x38a5e4);};}exports[_0xbc4c('0x25')]=function(_0x5002dc,_0x2cdde2){var _0x58a7a7={},_0x3e6525={},_0x35c781={'count':0x0,'rows':[]};var _0x4fe23e=_[_0xbc4c('0x26')](db[_0xbc4c('0x27')]['rawAttributes'],function(_0x1e5df5){return{'name':_0x1e5df5[_0xbc4c('0x28')],'type':_0x1e5df5['type'][_0xbc4c('0x29')]};});_0x3e6525[_0xbc4c('0x2a')]=_[_0xbc4c('0x26')](_0x4fe23e,_0xbc4c('0x2b'));_0x3e6525['query']=_['keys'](_0x5002dc[_0xbc4c('0x2c')]);_0x3e6525[_0xbc4c('0x2d')]=_[_0xbc4c('0x2e')](_0x3e6525[_0xbc4c('0x2a')],_0x3e6525[_0xbc4c('0x2c')]);_0x58a7a7[_0xbc4c('0x2f')]=_[_0xbc4c('0x2e')](_0x3e6525[_0xbc4c('0x2a')],qs[_0xbc4c('0x30')](_0x5002dc[_0xbc4c('0x2c')][_0xbc4c('0x30')]));_0x58a7a7[_0xbc4c('0x2f')]=_0x58a7a7[_0xbc4c('0x2f')][_0xbc4c('0x31')]?_0x58a7a7[_0xbc4c('0x2f')]:_0x3e6525[_0xbc4c('0x2a')];if(!_0x5002dc[_0xbc4c('0x2c')]['hasOwnProperty'](_0xbc4c('0x32'))){_0x58a7a7['limit']=qs[_0xbc4c('0x1a')](_0x5002dc[_0xbc4c('0x2c')][_0xbc4c('0x1a')]);_0x58a7a7['offset']=qs[_0xbc4c('0x18')](_0x5002dc[_0xbc4c('0x2c')][_0xbc4c('0x18')]);}_0x58a7a7[_0xbc4c('0x33')]=qs[_0xbc4c('0x34')](_0x5002dc['query'][_0xbc4c('0x34')]);_0x58a7a7[_0xbc4c('0x35')]=qs[_0xbc4c('0x2d')](_[_0xbc4c('0x36')](_0x5002dc['query'],_0x3e6525[_0xbc4c('0x2d')]),_0x4fe23e);if(_0x5002dc['query']['filter']){_0x58a7a7[_0xbc4c('0x35')]=_[_0xbc4c('0x37')](_0x58a7a7[_0xbc4c('0x35')],{'$or':_[_0xbc4c('0x26')](_0x4fe23e,function(_0x3f34dc){if(_0x3f34dc[_0xbc4c('0x38')]!==_0xbc4c('0x39')){var _0x2ff760={};_0x2ff760[_0x3f34dc[_0xbc4c('0x2b')]]={'$like':'%'+_0x5002dc['query']['filter']+'%'};return _0x2ff760;}})});}_0x58a7a7=_[_0xbc4c('0x37')]({},_0x58a7a7,_0x5002dc[_0xbc4c('0x3a')]);var _0xaab1a9={'where':_0x58a7a7['where']};return db['SalesforceAccount']['count'](_0xaab1a9)[_0xbc4c('0x22')](function(_0x36b911){_0x35c781[_0xbc4c('0x1b')]=_0x36b911;if(_0x5002dc['query'][_0xbc4c('0x3b')]){_0x58a7a7['include']=[{'all':!![]}];}return db['SalesforceAccount'][_0xbc4c('0x3c')](_0x58a7a7);})[_0xbc4c('0x22')](function(_0x1aedcb){_0x35c781[_0xbc4c('0x3d')]=_0x1aedcb;return _0x35c781;})[_0xbc4c('0x22')](respondWithFilteredResult(_0x2cdde2,_0x58a7a7))[_0xbc4c('0x3e')](handleError(_0x2cdde2,null));};exports[_0xbc4c('0x3f')]=function(_0x54af92,_0xf4292b){var _0x249c22={'raw':![],'where':{'id':_0x54af92['params']['id']}},_0x455270={};_0x455270[_0xbc4c('0x2a')]=_[_0xbc4c('0x40')](db[_0xbc4c('0x27')][_0xbc4c('0x41')]);_0x455270[_0xbc4c('0x2c')]=_[_0xbc4c('0x40')](_0x54af92['query']);_0x455270[_0xbc4c('0x2d')]=_[_0xbc4c('0x2e')](_0x455270[_0xbc4c('0x2a')],_0x455270[_0xbc4c('0x2c')]);_0x249c22[_0xbc4c('0x2f')]=_[_0xbc4c('0x2e')](_0x455270[_0xbc4c('0x2a')],qs[_0xbc4c('0x30')](_0x54af92[_0xbc4c('0x2c')]['fields']));_0x249c22[_0xbc4c('0x2f')]=_0x249c22['attributes'][_0xbc4c('0x31')]?_0x249c22[_0xbc4c('0x2f')]:_0x455270[_0xbc4c('0x2a')];if(_0x54af92[_0xbc4c('0x2c')][_0xbc4c('0x3b')]){_0x249c22[_0xbc4c('0x42')]=[{'all':!![]}];}_0x249c22=_['merge']({},_0x249c22,_0x54af92[_0xbc4c('0x3a')]);return db[_0xbc4c('0x27')][_0xbc4c('0x43')](_0x249c22)['then'](handleEntityNotFound(_0xf4292b,null))[_0xbc4c('0x22')](respondWithResult(_0xf4292b,null))[_0xbc4c('0x3e')](handleError(_0xf4292b,null));};exports[_0xbc4c('0x44')]=function(_0x10d51a,_0x1f95c0){return db[_0xbc4c('0x27')][_0xbc4c('0x44')](_0x10d51a[_0xbc4c('0x45')],{})[_0xbc4c('0x22')](respondWithResult(_0x1f95c0,0xc9))[_0xbc4c('0x3e')](handleError(_0x1f95c0,null));};exports[_0xbc4c('0x21')]=function(_0x4afc43,_0x4d7a99){if(_0x4afc43[_0xbc4c('0x45')]['id']){delete _0x4afc43[_0xbc4c('0x45')]['id'];}return db[_0xbc4c('0x27')]['find']({'where':{'id':_0x4afc43[_0xbc4c('0x46')]['id']}})[_0xbc4c('0x22')](handleEntityNotFound(_0x4d7a99,null))['then'](saveUpdates(_0x4afc43[_0xbc4c('0x45')],null))[_0xbc4c('0x22')](respondWithResult(_0x4d7a99,null))[_0xbc4c('0x3e')](handleError(_0x4d7a99,null));};exports['destroy']=function(_0xde1d4e,_0x2f7089){return db[_0xbc4c('0x27')][_0xbc4c('0x43')]({'where':{'id':_0xde1d4e[_0xbc4c('0x46')]['id']}})['then'](handleEntityNotFound(_0x2f7089,null))[_0xbc4c('0x22')](removeEntity(_0x2f7089,null))[_0xbc4c('0x3e')](handleError(_0x2f7089,null));};exports[_0xbc4c('0x47')]=function(_0x4c8c6c,_0x283d8b,_0x48242a){var _0xfe4866={};var _0x14a866={};var _0x6a445e;var _0x1d8754;return db['SalesforceAccount']['findOne']({'where':{'id':_0x4c8c6c[_0xbc4c('0x46')]['id']}})[_0xbc4c('0x22')](handleEntityNotFound(_0x283d8b,null))[_0xbc4c('0x22')](function(_0x214f1d){if(_0x214f1d){_0x6a445e=_0x214f1d;_0x14a866['model']=_[_0xbc4c('0x40')](db['SalesforceConfiguration']['rawAttributes']);_0x14a866[_0xbc4c('0x2c')]=_[_0xbc4c('0x40')](_0x4c8c6c[_0xbc4c('0x2c')]);_0x14a866[_0xbc4c('0x2d')]=_[_0xbc4c('0x2e')](_0x14a866['model'],_0x14a866[_0xbc4c('0x2c')]);_0xfe4866[_0xbc4c('0x2f')]=_['intersection'](_0x14a866[_0xbc4c('0x2a')],qs[_0xbc4c('0x30')](_0x4c8c6c[_0xbc4c('0x2c')][_0xbc4c('0x30')]));_0xfe4866[_0xbc4c('0x2f')]=_0xfe4866['attributes'][_0xbc4c('0x31')]?_0xfe4866['attributes']:_0x14a866[_0xbc4c('0x2a')];_0xfe4866[_0xbc4c('0x33')]=qs['sort'](_0x4c8c6c['query'][_0xbc4c('0x34')]);_0xfe4866[_0xbc4c('0x35')]=qs[_0xbc4c('0x2d')](_[_0xbc4c('0x36')](_0x4c8c6c[_0xbc4c('0x2c')],_0x14a866[_0xbc4c('0x2d')]));if(_0x4c8c6c[_0xbc4c('0x2c')][_0xbc4c('0x48')]){_0xfe4866[_0xbc4c('0x35')]=_[_0xbc4c('0x37')](_0xfe4866[_0xbc4c('0x35')],{'$or':_[_0xbc4c('0x26')](_0xfe4866['attributes'],function(_0x197ddf){var _0x47995e={};_0x47995e[_0x197ddf]={'$like':'%'+_0x4c8c6c[_0xbc4c('0x2c')][_0xbc4c('0x48')]+'%'};return _0x47995e;})});}_0xfe4866=_[_0xbc4c('0x37')]({},_0xfe4866,_0x4c8c6c['options']);return _0x6a445e[_0xbc4c('0x47')](_0xfe4866);}})['then'](function(_0x5acda8){if(_0x5acda8){_0x1d8754=_0x5acda8[_0xbc4c('0x31')];if(!_0x4c8c6c[_0xbc4c('0x2c')][_0xbc4c('0x49')](_0xbc4c('0x32'))){_0xfe4866[_0xbc4c('0x1a')]=qs[_0xbc4c('0x1a')](_0x4c8c6c[_0xbc4c('0x2c')][_0xbc4c('0x1a')]);_0xfe4866[_0xbc4c('0x18')]=qs[_0xbc4c('0x18')](_0x4c8c6c[_0xbc4c('0x2c')][_0xbc4c('0x18')]);}return _0x6a445e[_0xbc4c('0x47')](_0xfe4866);}})[_0xbc4c('0x22')](function(_0x54ba13){if(_0x54ba13){return _0x54ba13?{'count':_0x1d8754,'rows':_0x54ba13}:null;}})[_0xbc4c('0x22')](respondWithResult(_0x283d8b,null))[_0xbc4c('0x3e')](handleError(_0x283d8b,null));};exports[_0xbc4c('0x4a')]=function(_0x1108bc,_0x5e5e29,_0x1ffabc){if(_0x1108bc['body']['id']){delete _0x1108bc[_0xbc4c('0x45')]['id'];}return db[_0xbc4c('0x27')][_0xbc4c('0x4b')]({'where':{'id':_0x1108bc['params']['id']}})[_0xbc4c('0x22')](handleEntityNotFound(_0x5e5e29,null))[_0xbc4c('0x22')](function(_0x1c38ee){if(_0x1c38ee){_0x1108bc['body']['AccountId']=_0x1c38ee['id'];_0x1108bc[_0xbc4c('0x45')][_0xbc4c('0x4c')]=integrations[_0xbc4c('0x4d')](_0x1108bc['body'][_0xbc4c('0x4e')],_0x1108bc['body']['type']);_0x1108bc[_0xbc4c('0x45')][_0xbc4c('0x4f')]=integrations[_0xbc4c('0x50')](_0x1108bc[_0xbc4c('0x45')][_0xbc4c('0x4e')],_0x1108bc[_0xbc4c('0x45')][_0xbc4c('0x38')]);return db[_0xbc4c('0x51')][_0xbc4c('0x44')](_0x1108bc[_0xbc4c('0x45')],{'include':[{'model':db[_0xbc4c('0x52')],'as':_0xbc4c('0x4c')},{'model':db[_0xbc4c('0x52')],'as':'Descriptions'}]});}return null;})[_0xbc4c('0x22')](respondWithResult(_0x5e5e29,null))[_0xbc4c('0x3e')](handleError(_0x5e5e29,null));};exports['getFields']=function(_0x300432,_0x5cb182,_0x5836b6){var _0x135734;var _0x491ec8='';var _0x16c7e2=_0xbc4c('0x53');return db[_0xbc4c('0x27')][_0xbc4c('0x4b')]({'where':{'id':_0x300432[_0xbc4c('0x46')]['id']},'attributes':['id','remoteUri','clientId',_0xbc4c('0x54'),_0xbc4c('0x55'),_0xbc4c('0x56'),'securityToken']})[_0xbc4c('0x22')](handleEntityNotFound(_0x5cb182,null))['then'](function(_0x123301){if(_0x123301){_0x491ec8=_0x123301[_0xbc4c('0x57')];var _0x253399=_0x491ec8[_0xbc4c('0x58')](-0x1);if(_0x253399==='/'){_0x491ec8=_0x491ec8[_0xbc4c('0x59')](0x0,_0x491ec8[_0xbc4c('0x5a')](_0x253399));}_0x135734=new jsforce['Connection']({'oauth2':{'loginUrl':_0x491ec8,'clientId':_0x123301[_0xbc4c('0x5b')],'clientSecret':_0x123301[_0xbc4c('0x54')]}});return _0x135734[_0xbc4c('0x5c')](_0x123301['username'],_0x123301[_0xbc4c('0x56')][_0xbc4c('0x5d')](_0x123301['securityToken']));}})[_0xbc4c('0x22')](function(_0x3fa72a){if(_0x3fa72a){if(!_[_0xbc4c('0x5e')](_0x300432['query'][_0xbc4c('0x5f')])){_0x16c7e2=_0x300432['query'][_0xbc4c('0x5f')];}return _0x135734[_0xbc4c('0x60')](_0x16c7e2)[_0xbc4c('0x61')]();}})[_0xbc4c('0x22')](function(_0x52fa99){var _0x4cd548=[_0xbc4c('0x62'),'ActivityDate',_0xbc4c('0x63'),'IsRecurrence',_0xbc4c('0x64'),'Description'];var _0x5094fd=['string',_0xbc4c('0x65'),_0xbc4c('0x66'),_0xbc4c('0x67'),'email',_0xbc4c('0x68'),_0xbc4c('0x69')];if(_0x52fa99){_[_0xbc4c('0x6a')](_0x52fa99['fields'],function(_0x160557){return _0x4cd548[_0xbc4c('0x6b')](_0x160557['name'])||!_0x5094fd[_0xbc4c('0x6b')](_0x160557[_0xbc4c('0x38')]);});return{'count':_0x52fa99[_0xbc4c('0x30')]['length'],'rows':_['map'](_0x52fa99[_0xbc4c('0x30')],function(_0x5837b0){return{'id':_0x5837b0[_0xbc4c('0x2b')],'name':_0x5837b0[_0xbc4c('0x6c')],'custom':_0x5837b0[_0xbc4c('0x6d')],'options':_0x5837b0[_0xbc4c('0x6e')]['length']>0x0?_[_0xbc4c('0x26')](_0x5837b0[_0xbc4c('0x6e')],function(_0x2ace03){return{'name':_0x2ace03[_0xbc4c('0x6c')],'value':_0x2ace03['value']};}):_0x5837b0[_0xbc4c('0x38')]=='boolean'?[{'name':_0xbc4c('0x6f'),'value':_0xbc4c('0x70')},{'name':_0xbc4c('0x71'),'value':'false'}]:[]};})};}})['then'](respondWithResult(_0x5cb182,null))[_0xbc4c('0x3e')](function(_0x50fd90){var _0x3f365e=_0x300432[_0xbc4c('0x2c')]['test']?0x1f4:_0x50fd90[_0xbc4c('0x72')]||0x1f4;logger[_0xbc4c('0x24')]('getFields,\x20%s,\x20%s,\x20%s',_0xbc4c('0x73'),_0x3f365e,JSON[_0xbc4c('0x74')](_0x50fd90));delete _0x50fd90[_0xbc4c('0x2b')];if(_0x3f365e===0x191){_0x3f365e=0x190;}_0x5cb182[_0xbc4c('0x17')](_0x3f365e)[_0xbc4c('0x75')](_0x300432[_0xbc4c('0x2c')][_0xbc4c('0x76')]?{'message':_0xbc4c('0x77'),'statusCode':_0x50fd90[_0xbc4c('0x72')]}:_0x50fd90);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index 886ffa5..e887f28 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 _0x8aa7=['util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','define','SalesforceAccount','int_salesforce_accounts'];(function(_0x34421e,_0xf309a2){var _0x5725d7=function(_0x367fbf){while(--_0x367fbf){_0x34421e['push'](_0x34421e['shift']());}};_0x5725d7(++_0xf309a2);}(_0x8aa7,0xb6));var _0x78aa=function(_0x2b7764,_0x2606f1){_0x2b7764=_0x2b7764-0x0;var _0x848dcb=_0x8aa7[_0x2b7764];return _0x848dcb;};'use strict';var _=require('lodash');var util=require(_0x78aa('0x0'));var logger=require(_0x78aa('0x1'))(_0x78aa('0x2'));var moment=require(_0x78aa('0x3'));var BPromise=require(_0x78aa('0x4'));var rp=require(_0x78aa('0x5'));var fs=require('fs');var path=require(_0x78aa('0x6'));var rimraf=require('rimraf');var config=require(_0x78aa('0x7'));var attributes=require(_0x78aa('0x8'));var integrations=require(_0x78aa('0x9'));module[_0x78aa('0xa')]=function(_0x2d17c2,_0x369ee7){return _0x2d17c2[_0x78aa('0xb')](_0x78aa('0xc'),attributes,{'tableName':_0x78aa('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x37f8=['define','SalesforceAccount','int_salesforce_accounts','util','../../config/logger','api','moment','request-promise','exports'];(function(_0x44cfbb,_0x3c9d74){var _0x4c59ae=function(_0x312f1d){while(--_0x312f1d){_0x44cfbb['push'](_0x44cfbb['shift']());}};_0x4c59ae(++_0x3c9d74);}(_0x37f8,0xd2));var _0x837f=function(_0x5043cb,_0x3f246b){_0x5043cb=_0x5043cb-0x0;var _0x578c04=_0x37f8[_0x5043cb];return _0x578c04;};'use strict';var _=require('lodash');var util=require(_0x837f('0x0'));var logger=require(_0x837f('0x1'))(_0x837f('0x2'));var moment=require(_0x837f('0x3'));var BPromise=require('bluebird');var rp=require(_0x837f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intSalesforceAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0x837f('0x5')]=function(_0x42986f,_0x224ad2){return _0x42986f[_0x837f('0x6')](_0x837f('0x7'),attributes,{'tableName':_0x837f('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js b/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js index 58277ec..57e0609 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 _0x03d3=['result','SalesforceAccount','options','raw','where','attributes','limit','map','model','include','debug','GetSalesforceAccount','ShowSalesforceAccount','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','request\x20sent','stringify','error','code','SalesforceAccount,\x20%s,\x20%s','message'];(function(_0x538421,_0x3fb2ff){var _0x1d7e2d=function(_0x156ff5){while(--_0x156ff5){_0x538421['push'](_0x538421['shift']());}};_0x1d7e2d(++_0x3fb2ff);}(_0x03d3,0xda));var _0x303d=function(_0x22a714,_0x29bb8c){_0x22a714=_0x22a714-0x0;var _0x12e1f6=_0x03d3[_0x22a714];return _0x12e1f6;};'use strict';var _=require(_0x303d('0x0'));var util=require(_0x303d('0x1'));var moment=require(_0x303d('0x2'));var BPromise=require('bluebird');var rs=require(_0x303d('0x3'));var fs=require('fs');var Redis=require(_0x303d('0x4'));var db=require(_0x303d('0x5'))['db'];var utils=require(_0x303d('0x6'));var logger=require(_0x303d('0x7'))(_0x303d('0x8'));var config=require(_0x303d('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x303d('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x18e81c,_0xc434d,_0x36dc3e){return new BPromise(function(_0x315adc,_0xfdbdde){return client[_0x303d('0xb')](_0x18e81c,_0x36dc3e)[_0x303d('0xc')](function(_0x1327e5){logger[_0x303d('0xd')]('SalesforceAccount,\x20%s,\x20%s',_0xc434d,_0x303d('0xe'));logger['debug']('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0xc434d,'request\x20sent',JSON[_0x303d('0xf')](_0x1327e5));if(_0x1327e5[_0x303d('0x10')]){if(_0x1327e5[_0x303d('0x10')][_0x303d('0x11')]===0x1f4){logger[_0x303d('0x10')](_0x303d('0x12'),_0xc434d,_0x1327e5['error']['message']);return _0xfdbdde(_0x1327e5[_0x303d('0x10')][_0x303d('0x13')]);}logger[_0x303d('0x10')](_0x303d('0x12'),_0xc434d,_0x1327e5[_0x303d('0x10')]['message']);return _0x315adc(_0x1327e5[_0x303d('0x10')][_0x303d('0x13')]);}else{logger[_0x303d('0xd')](_0x303d('0x12'),_0xc434d,'request\x20sent');_0x315adc(_0x1327e5[_0x303d('0x14')]['message']);}})['catch'](function(_0x53e162){logger[_0x303d('0x10')](_0x303d('0x12'),_0xc434d,_0x53e162);_0xfdbdde(_0x53e162);});});}exports['GetSalesforceAccount']=function(_0x5f3ada){var _0x1545d5=this;return new Promise(function(_0x415113,_0x2b83c1){return db[_0x303d('0x15')]['findAll']({'raw':_0x5f3ada['options']?_0x5f3ada[_0x303d('0x16')][_0x303d('0x17')]===undefined?!![]:![]:!![],'where':_0x5f3ada[_0x303d('0x16')]?_0x5f3ada[_0x303d('0x16')][_0x303d('0x18')]||null:null,'attributes':_0x5f3ada[_0x303d('0x16')]?_0x5f3ada[_0x303d('0x16')][_0x303d('0x19')]||null:null,'limit':_0x5f3ada['options']?_0x5f3ada[_0x303d('0x16')][_0x303d('0x1a')]||null:null,'include':_0x5f3ada[_0x303d('0x16')]?_0x5f3ada['options']['include']?_[_0x303d('0x1b')](_0x5f3ada[_0x303d('0x16')]['include'],function(_0x32cb7c){return{'model':db[_0x32cb7c[_0x303d('0x1c')]],'as':_0x32cb7c['as'],'attributes':_0x32cb7c[_0x303d('0x19')],'include':_0x32cb7c[_0x303d('0x1d')]?_[_0x303d('0x1b')](_0x32cb7c['include'],function(_0x7ee3d4){return{'model':db[_0x7ee3d4[_0x303d('0x1c')]],'as':_0x7ee3d4['as'],'attributes':_0x7ee3d4[_0x303d('0x19')],'include':_0x7ee3d4[_0x303d('0x1d')]?_['map'](_0x7ee3d4[_0x303d('0x1d')],function(_0x1cb3c5){return{'model':db[_0x1cb3c5[_0x303d('0x1c')]],'as':_0x1cb3c5['as'],'attributes':_0x1cb3c5[_0x303d('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3352da){logger[_0x303d('0xd')]('GetSalesforceAccount',_0x5f3ada);logger[_0x303d('0x1e')](_0x303d('0x1f'),_0x5f3ada,JSON[_0x303d('0xf')](_0x3352da));_0x415113(_0x3352da);})['catch'](function(_0x270cd4){logger[_0x303d('0x10')](_0x303d('0x1f'),_0x270cd4[_0x303d('0x13')],_0x5f3ada);_0x2b83c1(_0x1545d5[_0x303d('0x10')](0x1f4,_0x270cd4['message']));});});};exports[_0x303d('0x20')]=function(_0x19407b){var _0x231f12=this;return new Promise(function(_0x362730,_0x51793d){return db['SalesforceAccount']['find']({'raw':_0x19407b[_0x303d('0x16')]?_0x19407b[_0x303d('0x16')][_0x303d('0x17')]===undefined?!![]:![]:!![],'where':_0x19407b[_0x303d('0x16')]?_0x19407b['options'][_0x303d('0x18')]||null:null,'attributes':_0x19407b[_0x303d('0x16')]?_0x19407b['options'][_0x303d('0x19')]||null:null,'include':_0x19407b[_0x303d('0x16')]?_0x19407b[_0x303d('0x16')][_0x303d('0x1d')]?_[_0x303d('0x1b')](_0x19407b[_0x303d('0x16')][_0x303d('0x1d')],function(_0x4ff6f7){return{'model':db[_0x4ff6f7['model']],'as':_0x4ff6f7['as'],'attributes':_0x4ff6f7[_0x303d('0x19')],'include':_0x4ff6f7[_0x303d('0x1d')]?_[_0x303d('0x1b')](_0x4ff6f7['include'],function(_0x2664e0){return{'model':db[_0x2664e0['model']],'as':_0x2664e0['as'],'attributes':_0x2664e0['attributes'],'include':_0x2664e0[_0x303d('0x1d')]?_[_0x303d('0x1b')](_0x2664e0[_0x303d('0x1d')],function(_0x1dd699){return{'model':db[_0x1dd699['model']],'as':_0x1dd699['as'],'attributes':_0x1dd699['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0xb114e8){logger[_0x303d('0xd')]('ShowSalesforceAccount',_0x19407b);logger['debug']('ShowSalesforceAccount',_0x19407b,JSON[_0x303d('0xf')](_0xb114e8));_0x362730(_0xb114e8);})[_0x303d('0x21')](function(_0x5739f4){logger[_0x303d('0x10')](_0x303d('0x20'),_0x5739f4[_0x303d('0x13')],_0x19407b);_0x51793d(_0x231f12[_0x303d('0x10')](0x1f4,_0x5739f4[_0x303d('0x13')]));});});}; \ No newline at end of file +var _0xce6a=['SalesforceAccount','raw','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','then','info','SalesforceAccount,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','catch','GetSalesforceAccount','findAll','options','where','limit','include','map','model','attributes','ShowSalesforceAccount'];(function(_0x517f18,_0x157f60){var _0x1327ab=function(_0x1993bf){while(--_0x1993bf){_0x517f18['push'](_0x517f18['shift']());}};_0x1327ab(++_0x157f60);}(_0xce6a,0xd4));var _0xace6=function(_0x5050e8,_0x581230){_0x5050e8=_0x5050e8-0x0;var _0x4bd89d=_0xce6a[_0x5050e8];return _0x4bd89d;};'use strict';var _=require('lodash');var util=require(_0xace6('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xace6('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xace6('0x2'))['db'];var utils=require(_0xace6('0x3'));var logger=require(_0xace6('0x4'))(_0xace6('0x5'));var config=require(_0xace6('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xace6('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1379f3,_0x1f6c4d,_0x1e6c15){return new BPromise(function(_0x18e650,_0x10bb5e){return client['request'](_0x1379f3,_0x1e6c15)[_0xace6('0x8')](function(_0x3a0691){logger[_0xace6('0x9')](_0xace6('0xa'),_0x1f6c4d,'request\x20sent');logger[_0xace6('0xb')]('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x1f6c4d,_0xace6('0xc'),JSON['stringify'](_0x3a0691));if(_0x3a0691[_0xace6('0xd')]){if(_0x3a0691['error'][_0xace6('0xe')]===0x1f4){logger['error'](_0xace6('0xa'),_0x1f6c4d,_0x3a0691['error']['message']);return _0x10bb5e(_0x3a0691[_0xace6('0xd')][_0xace6('0xf')]);}logger[_0xace6('0xd')](_0xace6('0xa'),_0x1f6c4d,_0x3a0691[_0xace6('0xd')][_0xace6('0xf')]);return _0x18e650(_0x3a0691[_0xace6('0xd')]['message']);}else{logger['info'](_0xace6('0xa'),_0x1f6c4d,_0xace6('0xc'));_0x18e650(_0x3a0691[_0xace6('0x10')]['message']);}})[_0xace6('0x11')](function(_0x58b6ce){logger['error'](_0xace6('0xa'),_0x1f6c4d,_0x58b6ce);_0x10bb5e(_0x58b6ce);});});}exports[_0xace6('0x12')]=function(_0x13888a){var _0x208927=this;return new Promise(function(_0xb4f47d,_0x4228f1){return db['SalesforceAccount'][_0xace6('0x13')]({'raw':_0x13888a[_0xace6('0x14')]?_0x13888a[_0xace6('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x13888a['options']?_0x13888a['options'][_0xace6('0x15')]||null:null,'attributes':_0x13888a[_0xace6('0x14')]?_0x13888a[_0xace6('0x14')]['attributes']||null:null,'limit':_0x13888a[_0xace6('0x14')]?_0x13888a[_0xace6('0x14')][_0xace6('0x16')]||null:null,'include':_0x13888a[_0xace6('0x14')]?_0x13888a[_0xace6('0x14')][_0xace6('0x17')]?_[_0xace6('0x18')](_0x13888a[_0xace6('0x14')][_0xace6('0x17')],function(_0x5856e0){return{'model':db[_0x5856e0[_0xace6('0x19')]],'as':_0x5856e0['as'],'attributes':_0x5856e0[_0xace6('0x1a')],'include':_0x5856e0[_0xace6('0x17')]?_['map'](_0x5856e0['include'],function(_0x154f73){return{'model':db[_0x154f73[_0xace6('0x19')]],'as':_0x154f73['as'],'attributes':_0x154f73[_0xace6('0x1a')],'include':_0x154f73[_0xace6('0x17')]?_['map'](_0x154f73[_0xace6('0x17')],function(_0x497154){return{'model':db[_0x497154[_0xace6('0x19')]],'as':_0x497154['as'],'attributes':_0x497154[_0xace6('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xace6('0x8')](function(_0x35ce75){logger['info'](_0xace6('0x12'),_0x13888a);logger[_0xace6('0xb')](_0xace6('0x12'),_0x13888a,JSON['stringify'](_0x35ce75));_0xb4f47d(_0x35ce75);})[_0xace6('0x11')](function(_0x27bfe3){logger[_0xace6('0xd')](_0xace6('0x12'),_0x27bfe3[_0xace6('0xf')],_0x13888a);_0x4228f1(_0x208927[_0xace6('0xd')](0x1f4,_0x27bfe3[_0xace6('0xf')]));});});};exports[_0xace6('0x1b')]=function(_0x3d259c){var _0x443846=this;return new Promise(function(_0x5b7853,_0x5abb7d){return db[_0xace6('0x1c')]['find']({'raw':_0x3d259c[_0xace6('0x14')]?_0x3d259c[_0xace6('0x14')][_0xace6('0x1d')]===undefined?!![]:![]:!![],'where':_0x3d259c[_0xace6('0x14')]?_0x3d259c[_0xace6('0x14')]['where']||null:null,'attributes':_0x3d259c[_0xace6('0x14')]?_0x3d259c[_0xace6('0x14')]['attributes']||null:null,'include':_0x3d259c[_0xace6('0x14')]?_0x3d259c['options'][_0xace6('0x17')]?_['map'](_0x3d259c['options'][_0xace6('0x17')],function(_0x55c8ab){return{'model':db[_0x55c8ab['model']],'as':_0x55c8ab['as'],'attributes':_0x55c8ab[_0xace6('0x1a')],'include':_0x55c8ab[_0xace6('0x17')]?_[_0xace6('0x18')](_0x55c8ab[_0xace6('0x17')],function(_0x3fa36f){return{'model':db[_0x3fa36f[_0xace6('0x19')]],'as':_0x3fa36f['as'],'attributes':_0x3fa36f[_0xace6('0x1a')],'include':_0x3fa36f[_0xace6('0x17')]?_[_0xace6('0x18')](_0x3fa36f[_0xace6('0x17')],function(_0x3fe481){return{'model':db[_0x3fe481[_0xace6('0x19')]],'as':_0x3fe481['as'],'attributes':_0x3fe481[_0xace6('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xace6('0x8')](function(_0x2d0ef8){logger['info'](_0xace6('0x1b'),_0x3d259c);logger[_0xace6('0xb')](_0xace6('0x1b'),_0x3d259c,JSON['stringify'](_0x2d0ef8));_0x5b7853(_0x2d0ef8);})['catch'](function(_0x35800e){logger[_0xace6('0xd')](_0xace6('0x1b'),_0x35800e[_0xace6('0xf')],_0x3d259c);_0x5abb7d(_0x443846['error'](0x1f4,_0x35800e[_0xace6('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index 33b550b..67d20be 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 _0xadb5=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','put','update','delete','destroy','exports','util','connect-timeout','express'];(function(_0x559be2,_0xefcf7c){var _0x8446e6=function(_0x141f3d){while(--_0x141f3d){_0x559be2['push'](_0x559be2['shift']());}};_0x8446e6(++_0xefcf7c);}(_0xadb5,0xad));var _0x5adb=function(_0x5ba8b6,_0x1a2e59){_0x5ba8b6=_0x5ba8b6-0x0;var _0x3f4bdf=_0xadb5[_0x5ba8b6];return _0x3f4bdf;};'use strict';var multer=require('multer');var util=require(_0x5adb('0x0'));var path=require('path');var timeout=require(_0x5adb('0x1'));var express=require(_0x5adb('0x2'));var router=express[_0x5adb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5adb('0x4'));var interaction=require(_0x5adb('0x5'));var config=require(_0x5adb('0x6'));var controller=require('./intSalesforceConfiguration.controller');router[_0x5adb('0x7')]('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0x9')]);router[_0x5adb('0x7')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xb')]);router[_0x5adb('0x7')](_0x5adb('0xc'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xd')]);router[_0x5adb('0x7')](_0x5adb('0xe'),auth[_0x5adb('0x8')](),controller['getSubjects']);router['get'](_0x5adb('0xf'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x10')]);router['post']('/',auth[_0x5adb('0x8')](),controller['create']);router[_0x5adb('0x11')]('/:id',auth[_0x5adb('0x8')](),controller[_0x5adb('0x12')]);router[_0x5adb('0x13')]('/:id',auth[_0x5adb('0x8')](),controller[_0x5adb('0x14')]);module[_0x5adb('0x15')]=router; \ No newline at end of file +var _0x5f2f=['Router','fs-extra','../../components/auth/service','./intSalesforceConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','create','put','update','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x32801e,_0x19448b){var _0x6301a=function(_0x4b1594){while(--_0x4b1594){_0x32801e['push'](_0x32801e['shift']());}};_0x6301a(++_0x19448b);}(_0x5f2f,0x73));var _0xf5f2=function(_0x145631,_0x1d45a2){_0x145631=_0x145631-0x0;var _0x20f698=_0x5f2f[_0x145631];return _0x20f698;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var fs_extra=require(_0xf5f2('0x6'));var auth=require(_0xf5f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5f2('0x8'));router[_0xf5f2('0x9')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0xb')]);router[_0xf5f2('0x9')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0xd')]);router[_0xf5f2('0x9')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x9')](_0xf5f2('0x10'),auth['isAuthenticated'](),controller[_0xf5f2('0x11')]);router['get']('/:id/descriptions',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x12')]);router['post']('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x13')]);router[_0xf5f2('0x14')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x15')]);router['delete'](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x16')]);module[_0xf5f2('0x17')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index eda87b1..9f29eb3 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 _0x38d8=['ENUM','Task','Case','contact','lead','account','nothing','exports','STRING'];(function(_0x57e25c,_0x2eafda){var _0x595b54=function(_0xfa7df8){while(--_0xfa7df8){_0x57e25c['push'](_0x57e25c['shift']());}};_0x595b54(++_0x2eafda);}(_0x38d8,0x14b));var _0x838d=function(_0x1bbc08,_0x444008){_0x1bbc08=_0x1bbc08-0x0;var _0x5d825b=_0x38d8[_0x1bbc08];return _0x5d825b;};'use strict';var Sequelize=require('sequelize');module[_0x838d('0x0')]={'name':{'type':Sequelize[_0x838d('0x1')]},'description':{'type':Sequelize[_0x838d('0x1')]},'ticketType':{'type':Sequelize[_0x838d('0x2')](_0x838d('0x3'),_0x838d('0x4')),'defaultValue':_0x838d('0x3')},'moduleSearch':{'type':Sequelize[_0x838d('0x2')]('contact_lead',_0x838d('0x5'),_0x838d('0x6'),'account_contact_lead',_0x838d('0x7')),'defaultValue':'contact_lead'},'moduleCreate':{'type':Sequelize['ENUM'](_0x838d('0x8'),_0x838d('0x5'),_0x838d('0x6'),'account'),'defaultValue':'lead'},'leadId':{'type':Sequelize[_0x838d('0x1')]},'additionalSearchAccount':{'type':Sequelize[_0x838d('0x1')]},'additionalSearchContact':{'type':Sequelize[_0x838d('0x1')]},'additionalSearchLead':{'type':Sequelize[_0x838d('0x1')]}}; \ No newline at end of file +var _0x0b66=['contact','exports','STRING','ENUM','Task','Case','lead','account_contact_lead','account','contact_lead','nothing'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x0b66,0x1b9));var _0x60b6=function(_0x507262,_0x3cbbc5){_0x507262=_0x507262-0x0;var _0x449c1e=_0x0b66[_0x507262];return _0x449c1e;};'use strict';var Sequelize=require('sequelize');module[_0x60b6('0x0')]={'name':{'type':Sequelize[_0x60b6('0x1')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0x60b6('0x2')](_0x60b6('0x3'),_0x60b6('0x4')),'defaultValue':_0x60b6('0x3')},'moduleSearch':{'type':Sequelize[_0x60b6('0x2')]('contact_lead','contact',_0x60b6('0x5'),_0x60b6('0x6'),_0x60b6('0x7')),'defaultValue':_0x60b6('0x8')},'moduleCreate':{'type':Sequelize['ENUM'](_0x60b6('0x9'),_0x60b6('0xa'),_0x60b6('0x5'),_0x60b6('0x7')),'defaultValue':'lead'},'leadId':{'type':Sequelize[_0x60b6('0x1')]},'additionalSearchAccount':{'type':Sequelize[_0x60b6('0x1')]},'additionalSearchContact':{'type':Sequelize['STRING']},'additionalSearchLead':{'type':Sequelize[_0x60b6('0x1')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index ae0e2f5..0d07c00 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 _0xe661=['VIRTUAL','options','includeAll','include','SalesforceConfiguration','findAll','rows','show','params','keys','find','create','body','catch','getFields','SalesforceField','nolimit','getSubjects','getDescriptions','findOne','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','limit','set','Content-Range','apply','update','then','destroy','end','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge'];(function(_0x80c735,_0x2e9fd4){var _0xd5b200=function(_0x1af766){while(--_0x1af766){_0x80c735['push'](_0x80c735['shift']());}};_0xd5b200(++_0x2e9fd4);}(_0xe661,0x64));var _0x1e66=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xe661[_0x3b380d];return _0x54502b;};'use strict';var emlformat=require(_0x1e66('0x0'));var rimraf=require(_0x1e66('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1e66('0x2'));var rp=require('request-promise');var moment=require(_0x1e66('0x3'));var BPromise=require(_0x1e66('0x4'));var Mustache=require(_0x1e66('0x5'));var util=require(_0x1e66('0x6'));var path=require(_0x1e66('0x7'));var sox=require(_0x1e66('0x8'));var csv=require(_0x1e66('0x9'));var ejs=require(_0x1e66('0xa'));var fs=require('fs');var fs_extra=require(_0x1e66('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x1e66('0xc'));var jsforce=require(_0x1e66('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x1e66('0xe'));var Redis=require('ioredis');var authService=require(_0x1e66('0xf'));var qs=require(_0x1e66('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1e66('0x11'));var logger=require(_0x1e66('0x12'))(_0x1e66('0x13'));var utils=require(_0x1e66('0x14'));var config=require(_0x1e66('0x15'));var licenseUtil=require(_0x1e66('0x16'));var db=require(_0x1e66('0x17'))['db'];function respondWithStatusCode(_0x24bb4f,_0x4e4c33){_0x4e4c33=_0x4e4c33||0xcc;return function(_0x1c0335){if(_0x1c0335){return _0x24bb4f[_0x1e66('0x18')](_0x4e4c33);}return _0x24bb4f[_0x1e66('0x19')](_0x4e4c33)['end']();};}function respondWithResult(_0x23e03f,_0x3faadd){_0x3faadd=_0x3faadd||0xc8;return function(_0xcf1ef3){if(_0xcf1ef3){return _0x23e03f[_0x1e66('0x19')](_0x3faadd)['json'](_0xcf1ef3);}};}function respondWithFilteredResult(_0x31fe82,_0xe73dfb){return function(_0x4d2a4c){if(_0x4d2a4c){var _0x374557=typeof _0xe73dfb[_0x1e66('0x1a')]===_0x1e66('0x1b')&&typeof _0xe73dfb['limit']==='undefined';var _0x3418a0=_0x4d2a4c[_0x1e66('0x1c')];var _0x179f3f=_0x374557?0x0:_0xe73dfb[_0x1e66('0x1a')];var _0x1d0303=_0x374557?_0x4d2a4c[_0x1e66('0x1c')]:_0xe73dfb[_0x1e66('0x1a')]+_0xe73dfb[_0x1e66('0x1d')];var _0x49f4d3;if(_0x1d0303>=_0x3418a0){_0x1d0303=_0x3418a0;_0x49f4d3=0xc8;}else{_0x49f4d3=0xce;}_0x31fe82[_0x1e66('0x19')](_0x49f4d3);return _0x31fe82[_0x1e66('0x1e')](_0x1e66('0x1f'),_0x179f3f+'-'+_0x1d0303+'/'+_0x3418a0)['json'](_0x4d2a4c);}return null;};}function patchUpdates(_0x3719d9){return function(_0x3818f0){try{jsonpatch[_0x1e66('0x20')](_0x3818f0,_0x3719d9,!![]);}catch(_0x2d87ae){return BPromise['reject'](_0x2d87ae);}return _0x3818f0['save']();};}function saveUpdates(_0x112587,_0x78d26a){return function(_0x36ec16){if(_0x36ec16){return _0x36ec16[_0x1e66('0x21')](_0x112587)[_0x1e66('0x22')](function(_0x15c850){return _0x15c850;});}return null;};}function removeEntity(_0x555369,_0x1553c2){return function(_0x371a83){if(_0x371a83){return _0x371a83[_0x1e66('0x23')]()['then'](function(){_0x555369[_0x1e66('0x19')](0xcc)[_0x1e66('0x24')]();});}};}function handleEntityNotFound(_0x1257cb,_0x41232d){return function(_0x32be1a){if(!_0x32be1a){_0x1257cb[_0x1e66('0x18')](0x194);}return _0x32be1a;};}function handleError(_0x2e427b,_0x2b01f9){_0x2b01f9=_0x2b01f9||0x1f4;return function(_0x3cb7b4){logger[_0x1e66('0x25')](_0x3cb7b4['stack']);if(_0x3cb7b4[_0x1e66('0x26')]){delete _0x3cb7b4['name'];}_0x2e427b['status'](_0x2b01f9)[_0x1e66('0x27')](_0x3cb7b4);};}exports[_0x1e66('0x28')]=function(_0x11386f,_0x54114c){var _0x26a012={},_0x4ecb6b={},_0x67305f={'count':0x0,'rows':[]};var _0x5169f9=_[_0x1e66('0x29')](db['SalesforceConfiguration'][_0x1e66('0x2a')],function(_0x53271f){return{'name':_0x53271f[_0x1e66('0x2b')],'type':_0x53271f[_0x1e66('0x2c')][_0x1e66('0x2d')]};});_0x4ecb6b[_0x1e66('0x2e')]=_['map'](_0x5169f9,_0x1e66('0x26'));_0x4ecb6b['query']=_['keys'](_0x11386f[_0x1e66('0x2f')]);_0x4ecb6b[_0x1e66('0x30')]=_[_0x1e66('0x31')](_0x4ecb6b[_0x1e66('0x2e')],_0x4ecb6b[_0x1e66('0x2f')]);_0x26a012[_0x1e66('0x32')]=_['intersection'](_0x4ecb6b[_0x1e66('0x2e')],qs[_0x1e66('0x33')](_0x11386f['query'][_0x1e66('0x33')]));_0x26a012[_0x1e66('0x32')]=_0x26a012['attributes'][_0x1e66('0x34')]?_0x26a012[_0x1e66('0x32')]:_0x4ecb6b['model'];if(!_0x11386f[_0x1e66('0x2f')][_0x1e66('0x35')]('nolimit')){_0x26a012[_0x1e66('0x1d')]=qs[_0x1e66('0x1d')](_0x11386f[_0x1e66('0x2f')]['limit']);_0x26a012['offset']=qs['offset'](_0x11386f[_0x1e66('0x2f')][_0x1e66('0x1a')]);}_0x26a012[_0x1e66('0x36')]=qs[_0x1e66('0x37')](_0x11386f[_0x1e66('0x2f')][_0x1e66('0x37')]);_0x26a012[_0x1e66('0x38')]=qs[_0x1e66('0x30')](_[_0x1e66('0x39')](_0x11386f[_0x1e66('0x2f')],_0x4ecb6b['filters']),_0x5169f9);if(_0x11386f['query'][_0x1e66('0x3a')]){_0x26a012[_0x1e66('0x38')]=_[_0x1e66('0x3b')](_0x26a012['where'],{'$or':_['map'](_0x5169f9,function(_0x232d91){if(_0x232d91[_0x1e66('0x2c')]!==_0x1e66('0x3c')){var _0x5a8543={};_0x5a8543[_0x232d91[_0x1e66('0x26')]]={'$like':'%'+_0x11386f['query'][_0x1e66('0x3a')]+'%'};return _0x5a8543;}})});}_0x26a012=_[_0x1e66('0x3b')]({},_0x26a012,_0x11386f[_0x1e66('0x3d')]);var _0x3bc629={'where':_0x26a012[_0x1e66('0x38')]};return db['SalesforceConfiguration'][_0x1e66('0x1c')](_0x3bc629)[_0x1e66('0x22')](function(_0x329237){_0x67305f[_0x1e66('0x1c')]=_0x329237;if(_0x11386f[_0x1e66('0x2f')][_0x1e66('0x3e')]){_0x26a012[_0x1e66('0x3f')]=[{'all':!![]}];}return db[_0x1e66('0x40')][_0x1e66('0x41')](_0x26a012);})[_0x1e66('0x22')](function(_0x2244bf){_0x67305f[_0x1e66('0x42')]=_0x2244bf;return _0x67305f;})[_0x1e66('0x22')](respondWithFilteredResult(_0x54114c,_0x26a012))['catch'](handleError(_0x54114c,null));};exports[_0x1e66('0x43')]=function(_0x52e7a4,_0x33ab22){var _0x1c181c={'raw':![],'where':{'id':_0x52e7a4[_0x1e66('0x44')]['id']}},_0x5671c1={};_0x5671c1[_0x1e66('0x2e')]=_[_0x1e66('0x45')](db[_0x1e66('0x40')][_0x1e66('0x2a')]);_0x5671c1[_0x1e66('0x2f')]=_[_0x1e66('0x45')](_0x52e7a4[_0x1e66('0x2f')]);_0x5671c1[_0x1e66('0x30')]=_[_0x1e66('0x31')](_0x5671c1[_0x1e66('0x2e')],_0x5671c1[_0x1e66('0x2f')]);_0x1c181c['attributes']=_['intersection'](_0x5671c1[_0x1e66('0x2e')],qs[_0x1e66('0x33')](_0x52e7a4[_0x1e66('0x2f')][_0x1e66('0x33')]));_0x1c181c[_0x1e66('0x32')]=_0x1c181c[_0x1e66('0x32')][_0x1e66('0x34')]?_0x1c181c[_0x1e66('0x32')]:_0x5671c1['model'];if(_0x52e7a4['query'][_0x1e66('0x3e')]){_0x1c181c[_0x1e66('0x3f')]=[{'all':!![]}];}_0x1c181c=_['merge']({},_0x1c181c,_0x52e7a4['options']);return db[_0x1e66('0x40')][_0x1e66('0x46')](_0x1c181c)[_0x1e66('0x22')](handleEntityNotFound(_0x33ab22,null))[_0x1e66('0x22')](respondWithResult(_0x33ab22,null))['catch'](handleError(_0x33ab22,null));};exports[_0x1e66('0x47')]=function(_0x4b4803,_0xd6d285){return db[_0x1e66('0x40')][_0x1e66('0x47')](_0x4b4803[_0x1e66('0x48')],{})[_0x1e66('0x22')](respondWithResult(_0xd6d285,0xc9))[_0x1e66('0x49')](handleError(_0xd6d285,null));};exports[_0x1e66('0x21')]=function(_0x1e82f7,_0x588559){if(_0x1e82f7[_0x1e66('0x48')]['id']){delete _0x1e82f7[_0x1e66('0x48')]['id'];}return db[_0x1e66('0x40')][_0x1e66('0x46')]({'where':{'id':_0x1e82f7[_0x1e66('0x44')]['id']}})[_0x1e66('0x22')](handleEntityNotFound(_0x588559,null))[_0x1e66('0x22')](saveUpdates(_0x1e82f7[_0x1e66('0x48')],null))[_0x1e66('0x22')](respondWithResult(_0x588559,null))['catch'](handleError(_0x588559,null));};exports[_0x1e66('0x23')]=function(_0x36ced0,_0x90b974){return db[_0x1e66('0x40')][_0x1e66('0x46')]({'where':{'id':_0x36ced0[_0x1e66('0x44')]['id']}})[_0x1e66('0x22')](handleEntityNotFound(_0x90b974,null))[_0x1e66('0x22')](removeEntity(_0x90b974,null))[_0x1e66('0x49')](handleError(_0x90b974,null));};exports[_0x1e66('0x4a')]=function(_0x943792,_0x276249,_0x33d96a){var _0x37040c={};var _0x45c61c={};var _0x5eb342;var _0x5bafd4;return db[_0x1e66('0x40')]['findOne']({'where':{'id':_0x943792[_0x1e66('0x44')]['id']}})[_0x1e66('0x22')](handleEntityNotFound(_0x276249,null))['then'](function(_0x45a09c){if(_0x45a09c){_0x5eb342=_0x45a09c;_0x45c61c['model']=_[_0x1e66('0x45')](db[_0x1e66('0x4b')][_0x1e66('0x2a')]);_0x45c61c[_0x1e66('0x2f')]=_['keys'](_0x943792[_0x1e66('0x2f')]);_0x45c61c[_0x1e66('0x30')]=_['intersection'](_0x45c61c['model'],_0x45c61c[_0x1e66('0x2f')]);_0x37040c['attributes']=_[_0x1e66('0x31')](_0x45c61c[_0x1e66('0x2e')],qs[_0x1e66('0x33')](_0x943792['query']['fields']));_0x37040c[_0x1e66('0x32')]=_0x37040c[_0x1e66('0x32')][_0x1e66('0x34')]?_0x37040c[_0x1e66('0x32')]:_0x45c61c[_0x1e66('0x2e')];_0x37040c[_0x1e66('0x36')]=qs['sort'](_0x943792[_0x1e66('0x2f')][_0x1e66('0x37')]);_0x37040c[_0x1e66('0x38')]=qs[_0x1e66('0x30')](_[_0x1e66('0x39')](_0x943792[_0x1e66('0x2f')],_0x45c61c[_0x1e66('0x30')]));if(_0x943792['query']['filter']){_0x37040c[_0x1e66('0x38')]=_[_0x1e66('0x3b')](_0x37040c[_0x1e66('0x38')],{'$or':_[_0x1e66('0x29')](_0x37040c['attributes'],function(_0x39e043){var _0x59a7ba={};_0x59a7ba[_0x39e043]={'$like':'%'+_0x943792[_0x1e66('0x2f')][_0x1e66('0x3a')]+'%'};return _0x59a7ba;})});}_0x37040c=_[_0x1e66('0x3b')]({},_0x37040c,_0x943792[_0x1e66('0x3d')]);return _0x5eb342[_0x1e66('0x4a')](_0x37040c);}})[_0x1e66('0x22')](function(_0x30e9a2){if(_0x30e9a2){_0x5bafd4=_0x30e9a2['length'];if(!_0x943792[_0x1e66('0x2f')][_0x1e66('0x35')](_0x1e66('0x4c'))){_0x37040c[_0x1e66('0x1d')]=qs[_0x1e66('0x1d')](_0x943792['query'][_0x1e66('0x1d')]);_0x37040c[_0x1e66('0x1a')]=qs[_0x1e66('0x1a')](_0x943792[_0x1e66('0x2f')][_0x1e66('0x1a')]);}return _0x5eb342[_0x1e66('0x4a')](_0x37040c);}})['then'](function(_0x215434){if(_0x215434){return _0x215434?{'count':_0x5bafd4,'rows':_0x215434}:null;}})[_0x1e66('0x22')](respondWithResult(_0x276249,null))[_0x1e66('0x49')](handleError(_0x276249,null));};exports[_0x1e66('0x4d')]=function(_0x557856,_0x550592,_0x50d1bf){var _0x343dea={};var _0x173f2c={};var _0x38f9ec;var _0x2a7f1e;return db[_0x1e66('0x40')]['findOne']({'where':{'id':_0x557856[_0x1e66('0x44')]['id']}})[_0x1e66('0x22')](handleEntityNotFound(_0x550592,null))[_0x1e66('0x22')](function(_0x3fccf3){if(_0x3fccf3){_0x38f9ec=_0x3fccf3;_0x173f2c[_0x1e66('0x2e')]=_[_0x1e66('0x45')](db[_0x1e66('0x4b')]['rawAttributes']);_0x173f2c[_0x1e66('0x2f')]=_[_0x1e66('0x45')](_0x557856[_0x1e66('0x2f')]);_0x173f2c[_0x1e66('0x30')]=_['intersection'](_0x173f2c[_0x1e66('0x2e')],_0x173f2c['query']);_0x343dea[_0x1e66('0x32')]=_[_0x1e66('0x31')](_0x173f2c[_0x1e66('0x2e')],qs['fields'](_0x557856[_0x1e66('0x2f')][_0x1e66('0x33')]));_0x343dea[_0x1e66('0x32')]=_0x343dea[_0x1e66('0x32')][_0x1e66('0x34')]?_0x343dea[_0x1e66('0x32')]:_0x173f2c[_0x1e66('0x2e')];_0x343dea[_0x1e66('0x36')]=qs[_0x1e66('0x37')](_0x557856['query'][_0x1e66('0x37')]);_0x343dea['where']=qs[_0x1e66('0x30')](_[_0x1e66('0x39')](_0x557856['query'],_0x173f2c[_0x1e66('0x30')]));if(_0x557856[_0x1e66('0x2f')][_0x1e66('0x3a')]){_0x343dea['where']=_[_0x1e66('0x3b')](_0x343dea[_0x1e66('0x38')],{'$or':_['map'](_0x343dea['attributes'],function(_0x1dca4c){var _0x3bcef4={};_0x3bcef4[_0x1dca4c]={'$like':'%'+_0x557856['query'][_0x1e66('0x3a')]+'%'};return _0x3bcef4;})});}_0x343dea=_['merge']({},_0x343dea,_0x557856['options']);return _0x38f9ec[_0x1e66('0x4d')](_0x343dea);}})[_0x1e66('0x22')](function(_0x565238){if(_0x565238){_0x2a7f1e=_0x565238['length'];if(!_0x557856['query']['hasOwnProperty'](_0x1e66('0x4c'))){_0x343dea[_0x1e66('0x1d')]=qs[_0x1e66('0x1d')](_0x557856[_0x1e66('0x2f')][_0x1e66('0x1d')]);_0x343dea['offset']=qs[_0x1e66('0x1a')](_0x557856[_0x1e66('0x2f')]['offset']);}return _0x38f9ec[_0x1e66('0x4d')](_0x343dea);}})[_0x1e66('0x22')](function(_0x506e06){if(_0x506e06){return _0x506e06?{'count':_0x2a7f1e,'rows':_0x506e06}:null;}})[_0x1e66('0x22')](respondWithResult(_0x550592,null))[_0x1e66('0x49')](handleError(_0x550592,null));};exports[_0x1e66('0x4e')]=function(_0x2d0695,_0x3b17f1,_0x4e2a29){var _0x7110c2={};var _0x3f8d17={};var _0x49a151;var _0x9187ef;return db[_0x1e66('0x40')][_0x1e66('0x4f')]({'where':{'id':_0x2d0695['params']['id']}})['then'](handleEntityNotFound(_0x3b17f1,null))[_0x1e66('0x22')](function(_0x3d845e){if(_0x3d845e){_0x49a151=_0x3d845e;_0x3f8d17[_0x1e66('0x2e')]=_['keys'](db[_0x1e66('0x4b')]['rawAttributes']);_0x3f8d17[_0x1e66('0x2f')]=_[_0x1e66('0x45')](_0x2d0695['query']);_0x3f8d17[_0x1e66('0x30')]=_[_0x1e66('0x31')](_0x3f8d17[_0x1e66('0x2e')],_0x3f8d17['query']);_0x7110c2[_0x1e66('0x32')]=_['intersection'](_0x3f8d17[_0x1e66('0x2e')],qs['fields'](_0x2d0695[_0x1e66('0x2f')][_0x1e66('0x33')]));_0x7110c2['attributes']=_0x7110c2[_0x1e66('0x32')]['length']?_0x7110c2['attributes']:_0x3f8d17['model'];_0x7110c2['order']=qs[_0x1e66('0x37')](_0x2d0695[_0x1e66('0x2f')]['sort']);_0x7110c2[_0x1e66('0x38')]=qs[_0x1e66('0x30')](_[_0x1e66('0x39')](_0x2d0695['query'],_0x3f8d17[_0x1e66('0x30')]));if(_0x2d0695[_0x1e66('0x2f')][_0x1e66('0x3a')]){_0x7110c2[_0x1e66('0x38')]=_[_0x1e66('0x3b')](_0x7110c2['where'],{'$or':_[_0x1e66('0x29')](_0x7110c2['attributes'],function(_0x4aadf0){var _0x4dc030={};_0x4dc030[_0x4aadf0]={'$like':'%'+_0x2d0695['query'][_0x1e66('0x3a')]+'%'};return _0x4dc030;})});}_0x7110c2=_[_0x1e66('0x3b')]({},_0x7110c2,_0x2d0695[_0x1e66('0x3d')]);return _0x49a151['getDescriptions'](_0x7110c2);}})[_0x1e66('0x22')](function(_0x323291){if(_0x323291){_0x9187ef=_0x323291[_0x1e66('0x34')];if(!_0x2d0695[_0x1e66('0x2f')][_0x1e66('0x35')](_0x1e66('0x4c'))){_0x7110c2[_0x1e66('0x1d')]=qs[_0x1e66('0x1d')](_0x2d0695['query']['limit']);_0x7110c2[_0x1e66('0x1a')]=qs[_0x1e66('0x1a')](_0x2d0695['query'][_0x1e66('0x1a')]);}return _0x49a151['getDescriptions'](_0x7110c2);}})[_0x1e66('0x22')](function(_0x9bc6b0){if(_0x9bc6b0){return _0x9bc6b0?{'count':_0x9187ef,'rows':_0x9bc6b0}:null;}})[_0x1e66('0x22')](respondWithResult(_0x3b17f1,null))['catch'](handleError(_0x3b17f1,null));}; \ No newline at end of file +var _0x27cf=['json','offset','undefined','limit','count','set','Content-Range','apply','then','sendStatus','error','stack','name','send','map','SalesforceConfiguration','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','includeAll','include','findAll','show','params','keys','options','find','catch','create','body','getFields','findOne','SalesforceField','pick','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status'];(function(_0x20e40f,_0x1bd601){var _0x13d00b=function(_0x240c33){while(--_0x240c33){_0x20e40f['push'](_0x20e40f['shift']());}};_0x13d00b(++_0x1bd601);}(_0x27cf,0x1aa));var _0xf27c=function(_0x39d544,_0x35c14f){_0x39d544=_0x39d544-0x0;var _0x5a5ff2=_0x27cf[_0x39d544];return _0x5a5ff2;};'use strict';var emlformat=require(_0xf27c('0x0'));var rimraf=require(_0xf27c('0x1'));var zipdir=require(_0xf27c('0x2'));var jsonpatch=require(_0xf27c('0x3'));var rp=require('request-promise');var moment=require(_0xf27c('0x4'));var BPromise=require(_0xf27c('0x5'));var Mustache=require(_0xf27c('0x6'));var util=require(_0xf27c('0x7'));var path=require(_0xf27c('0x8'));var sox=require('sox');var csv=require(_0xf27c('0x9'));var ejs=require(_0xf27c('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf27c('0xb'));var squel=require(_0xf27c('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xf27c('0xd'));var toCsv=require(_0xf27c('0x9'));var querystring=require(_0xf27c('0xe'));var Papa=require(_0xf27c('0xf'));var Redis=require('ioredis');var authService=require(_0xf27c('0x10'));var qs=require(_0xf27c('0x11'));var as=require(_0xf27c('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xf27c('0x13'));var config=require(_0xf27c('0x14'));var licenseUtil=require(_0xf27c('0x15'));var db=require(_0xf27c('0x16'))['db'];function respondWithStatusCode(_0x43a8a7,_0x59703f){_0x59703f=_0x59703f||0xcc;return function(_0x141c42){if(_0x141c42){return _0x43a8a7['sendStatus'](_0x59703f);}return _0x43a8a7[_0xf27c('0x17')](_0x59703f)['end']();};}function respondWithResult(_0x15a9e1,_0x143659){_0x143659=_0x143659||0xc8;return function(_0x5a405a){if(_0x5a405a){return _0x15a9e1[_0xf27c('0x17')](_0x143659)[_0xf27c('0x18')](_0x5a405a);}};}function respondWithFilteredResult(_0x59f1df,_0x466758){return function(_0x4073f1){if(_0x4073f1){var _0x2343a0=typeof _0x466758[_0xf27c('0x19')]===_0xf27c('0x1a')&&typeof _0x466758[_0xf27c('0x1b')]===_0xf27c('0x1a');var _0x2bad3e=_0x4073f1[_0xf27c('0x1c')];var _0x29b81d=_0x2343a0?0x0:_0x466758[_0xf27c('0x19')];var _0x980c4=_0x2343a0?_0x4073f1[_0xf27c('0x1c')]:_0x466758[_0xf27c('0x19')]+_0x466758[_0xf27c('0x1b')];var _0x4e18dc;if(_0x980c4>=_0x2bad3e){_0x980c4=_0x2bad3e;_0x4e18dc=0xc8;}else{_0x4e18dc=0xce;}_0x59f1df[_0xf27c('0x17')](_0x4e18dc);return _0x59f1df[_0xf27c('0x1d')](_0xf27c('0x1e'),_0x29b81d+'-'+_0x980c4+'/'+_0x2bad3e)[_0xf27c('0x18')](_0x4073f1);}return null;};}function patchUpdates(_0x84e424){return function(_0x34d379){try{jsonpatch[_0xf27c('0x1f')](_0x34d379,_0x84e424,!![]);}catch(_0x4f4f35){return BPromise['reject'](_0x4f4f35);}return _0x34d379['save']();};}function saveUpdates(_0x582837,_0x1925d0){return function(_0x5239a1){if(_0x5239a1){return _0x5239a1['update'](_0x582837)[_0xf27c('0x20')](function(_0x1ad6cf){return _0x1ad6cf;});}return null;};}function removeEntity(_0x341c39,_0x24eb69){return function(_0x51190a){if(_0x51190a){return _0x51190a['destroy']()['then'](function(){_0x341c39[_0xf27c('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5c0fba,_0x3a6bb5){return function(_0x266b1a){if(!_0x266b1a){_0x5c0fba[_0xf27c('0x21')](0x194);}return _0x266b1a;};}function handleError(_0x30fd94,_0x428145){_0x428145=_0x428145||0x1f4;return function(_0x157356){logger[_0xf27c('0x22')](_0x157356[_0xf27c('0x23')]);if(_0x157356[_0xf27c('0x24')]){delete _0x157356['name'];}_0x30fd94[_0xf27c('0x17')](_0x428145)[_0xf27c('0x25')](_0x157356);};}exports['index']=function(_0x2e1825,_0x58bcaa){var _0x1a1ad6={},_0x52e65f={},_0x5bb8d0={'count':0x0,'rows':[]};var _0x53c9ef=_[_0xf27c('0x26')](db[_0xf27c('0x27')][_0xf27c('0x28')],function(_0x317f4d){return{'name':_0x317f4d[_0xf27c('0x29')],'type':_0x317f4d[_0xf27c('0x2a')][_0xf27c('0x2b')]};});_0x52e65f[_0xf27c('0x2c')]=_[_0xf27c('0x26')](_0x53c9ef,_0xf27c('0x24'));_0x52e65f[_0xf27c('0x2d')]=_['keys'](_0x2e1825[_0xf27c('0x2d')]);_0x52e65f[_0xf27c('0x2e')]=_[_0xf27c('0x2f')](_0x52e65f[_0xf27c('0x2c')],_0x52e65f[_0xf27c('0x2d')]);_0x1a1ad6[_0xf27c('0x30')]=_[_0xf27c('0x2f')](_0x52e65f[_0xf27c('0x2c')],qs[_0xf27c('0x31')](_0x2e1825[_0xf27c('0x2d')][_0xf27c('0x31')]));_0x1a1ad6[_0xf27c('0x30')]=_0x1a1ad6[_0xf27c('0x30')][_0xf27c('0x32')]?_0x1a1ad6['attributes']:_0x52e65f['model'];if(!_0x2e1825[_0xf27c('0x2d')][_0xf27c('0x33')](_0xf27c('0x34'))){_0x1a1ad6['limit']=qs['limit'](_0x2e1825[_0xf27c('0x2d')][_0xf27c('0x1b')]);_0x1a1ad6['offset']=qs[_0xf27c('0x19')](_0x2e1825['query'][_0xf27c('0x19')]);}_0x1a1ad6[_0xf27c('0x35')]=qs['sort'](_0x2e1825[_0xf27c('0x2d')][_0xf27c('0x36')]);_0x1a1ad6['where']=qs[_0xf27c('0x2e')](_['pick'](_0x2e1825['query'],_0x52e65f[_0xf27c('0x2e')]),_0x53c9ef);if(_0x2e1825[_0xf27c('0x2d')][_0xf27c('0x37')]){_0x1a1ad6[_0xf27c('0x38')]=_[_0xf27c('0x39')](_0x1a1ad6['where'],{'$or':_['map'](_0x53c9ef,function(_0xea8cf7){if(_0xea8cf7[_0xf27c('0x2a')]!=='VIRTUAL'){var _0x49ec55={};_0x49ec55[_0xea8cf7[_0xf27c('0x24')]]={'$like':'%'+_0x2e1825[_0xf27c('0x2d')][_0xf27c('0x37')]+'%'};return _0x49ec55;}})});}_0x1a1ad6=_[_0xf27c('0x39')]({},_0x1a1ad6,_0x2e1825['options']);var _0x385053={'where':_0x1a1ad6[_0xf27c('0x38')]};return db[_0xf27c('0x27')][_0xf27c('0x1c')](_0x385053)[_0xf27c('0x20')](function(_0x1941f3){_0x5bb8d0[_0xf27c('0x1c')]=_0x1941f3;if(_0x2e1825[_0xf27c('0x2d')][_0xf27c('0x3a')]){_0x1a1ad6[_0xf27c('0x3b')]=[{'all':!![]}];}return db[_0xf27c('0x27')][_0xf27c('0x3c')](_0x1a1ad6);})[_0xf27c('0x20')](function(_0x51e47d){_0x5bb8d0['rows']=_0x51e47d;return _0x5bb8d0;})[_0xf27c('0x20')](respondWithFilteredResult(_0x58bcaa,_0x1a1ad6))['catch'](handleError(_0x58bcaa,null));};exports[_0xf27c('0x3d')]=function(_0x10662d,_0x4d32ad){var _0x2caaf0={'raw':![],'where':{'id':_0x10662d[_0xf27c('0x3e')]['id']}},_0x314c8b={};_0x314c8b[_0xf27c('0x2c')]=_['keys'](db[_0xf27c('0x27')][_0xf27c('0x28')]);_0x314c8b[_0xf27c('0x2d')]=_[_0xf27c('0x3f')](_0x10662d[_0xf27c('0x2d')]);_0x314c8b[_0xf27c('0x2e')]=_[_0xf27c('0x2f')](_0x314c8b[_0xf27c('0x2c')],_0x314c8b[_0xf27c('0x2d')]);_0x2caaf0[_0xf27c('0x30')]=_[_0xf27c('0x2f')](_0x314c8b[_0xf27c('0x2c')],qs['fields'](_0x10662d[_0xf27c('0x2d')][_0xf27c('0x31')]));_0x2caaf0[_0xf27c('0x30')]=_0x2caaf0['attributes'][_0xf27c('0x32')]?_0x2caaf0[_0xf27c('0x30')]:_0x314c8b[_0xf27c('0x2c')];if(_0x10662d['query'][_0xf27c('0x3a')]){_0x2caaf0[_0xf27c('0x3b')]=[{'all':!![]}];}_0x2caaf0=_[_0xf27c('0x39')]({},_0x2caaf0,_0x10662d[_0xf27c('0x40')]);return db[_0xf27c('0x27')][_0xf27c('0x41')](_0x2caaf0)[_0xf27c('0x20')](handleEntityNotFound(_0x4d32ad,null))['then'](respondWithResult(_0x4d32ad,null))[_0xf27c('0x42')](handleError(_0x4d32ad,null));};exports[_0xf27c('0x43')]=function(_0x54e7aa,_0x187b61){return db[_0xf27c('0x27')]['create'](_0x54e7aa[_0xf27c('0x44')],{})[_0xf27c('0x20')](respondWithResult(_0x187b61,0xc9))[_0xf27c('0x42')](handleError(_0x187b61,null));};exports['update']=function(_0x3fa12e,_0xabadfc){if(_0x3fa12e[_0xf27c('0x44')]['id']){delete _0x3fa12e['body']['id'];}return db[_0xf27c('0x27')][_0xf27c('0x41')]({'where':{'id':_0x3fa12e['params']['id']}})['then'](handleEntityNotFound(_0xabadfc,null))[_0xf27c('0x20')](saveUpdates(_0x3fa12e['body'],null))[_0xf27c('0x20')](respondWithResult(_0xabadfc,null))[_0xf27c('0x42')](handleError(_0xabadfc,null));};exports['destroy']=function(_0x4762f0,_0x3743bd){return db[_0xf27c('0x27')]['find']({'where':{'id':_0x4762f0[_0xf27c('0x3e')]['id']}})['then'](handleEntityNotFound(_0x3743bd,null))[_0xf27c('0x20')](removeEntity(_0x3743bd,null))[_0xf27c('0x42')](handleError(_0x3743bd,null));};exports[_0xf27c('0x45')]=function(_0x23174b,_0x4ced37,_0x41c64e){var _0x18419b={};var _0xd0542b={};var _0xf707b0;var _0x26ff2b;return db[_0xf27c('0x27')][_0xf27c('0x46')]({'where':{'id':_0x23174b[_0xf27c('0x3e')]['id']}})[_0xf27c('0x20')](handleEntityNotFound(_0x4ced37,null))[_0xf27c('0x20')](function(_0x73e023){if(_0x73e023){_0xf707b0=_0x73e023;_0xd0542b['model']=_[_0xf27c('0x3f')](db[_0xf27c('0x47')][_0xf27c('0x28')]);_0xd0542b[_0xf27c('0x2d')]=_[_0xf27c('0x3f')](_0x23174b[_0xf27c('0x2d')]);_0xd0542b[_0xf27c('0x2e')]=_[_0xf27c('0x2f')](_0xd0542b[_0xf27c('0x2c')],_0xd0542b[_0xf27c('0x2d')]);_0x18419b[_0xf27c('0x30')]=_['intersection'](_0xd0542b[_0xf27c('0x2c')],qs[_0xf27c('0x31')](_0x23174b[_0xf27c('0x2d')][_0xf27c('0x31')]));_0x18419b['attributes']=_0x18419b[_0xf27c('0x30')][_0xf27c('0x32')]?_0x18419b[_0xf27c('0x30')]:_0xd0542b[_0xf27c('0x2c')];_0x18419b[_0xf27c('0x35')]=qs[_0xf27c('0x36')](_0x23174b[_0xf27c('0x2d')]['sort']);_0x18419b[_0xf27c('0x38')]=qs['filters'](_[_0xf27c('0x48')](_0x23174b[_0xf27c('0x2d')],_0xd0542b[_0xf27c('0x2e')]));if(_0x23174b['query'][_0xf27c('0x37')]){_0x18419b[_0xf27c('0x38')]=_[_0xf27c('0x39')](_0x18419b[_0xf27c('0x38')],{'$or':_[_0xf27c('0x26')](_0x18419b[_0xf27c('0x30')],function(_0x18e332){var _0x5eb2c6={};_0x5eb2c6[_0x18e332]={'$like':'%'+_0x23174b[_0xf27c('0x2d')][_0xf27c('0x37')]+'%'};return _0x5eb2c6;})});}_0x18419b=_[_0xf27c('0x39')]({},_0x18419b,_0x23174b[_0xf27c('0x40')]);return _0xf707b0[_0xf27c('0x45')](_0x18419b);}})[_0xf27c('0x20')](function(_0x4bd89b){if(_0x4bd89b){_0x26ff2b=_0x4bd89b[_0xf27c('0x32')];if(!_0x23174b[_0xf27c('0x2d')][_0xf27c('0x33')](_0xf27c('0x34'))){_0x18419b[_0xf27c('0x1b')]=qs['limit'](_0x23174b[_0xf27c('0x2d')][_0xf27c('0x1b')]);_0x18419b[_0xf27c('0x19')]=qs[_0xf27c('0x19')](_0x23174b[_0xf27c('0x2d')][_0xf27c('0x19')]);}return _0xf707b0[_0xf27c('0x45')](_0x18419b);}})[_0xf27c('0x20')](function(_0x18b7d4){if(_0x18b7d4){return _0x18b7d4?{'count':_0x26ff2b,'rows':_0x18b7d4}:null;}})['then'](respondWithResult(_0x4ced37,null))[_0xf27c('0x42')](handleError(_0x4ced37,null));};exports[_0xf27c('0x49')]=function(_0x533444,_0x2762b8,_0x125bb2){var _0x489575={};var _0x59ad0a={};var _0x3b3795;var _0x29587a;return db[_0xf27c('0x27')][_0xf27c('0x46')]({'where':{'id':_0x533444[_0xf27c('0x3e')]['id']}})[_0xf27c('0x20')](handleEntityNotFound(_0x2762b8,null))['then'](function(_0x2b64e){if(_0x2b64e){_0x3b3795=_0x2b64e;_0x59ad0a[_0xf27c('0x2c')]=_[_0xf27c('0x3f')](db[_0xf27c('0x47')][_0xf27c('0x28')]);_0x59ad0a[_0xf27c('0x2d')]=_[_0xf27c('0x3f')](_0x533444[_0xf27c('0x2d')]);_0x59ad0a[_0xf27c('0x2e')]=_[_0xf27c('0x2f')](_0x59ad0a[_0xf27c('0x2c')],_0x59ad0a[_0xf27c('0x2d')]);_0x489575[_0xf27c('0x30')]=_[_0xf27c('0x2f')](_0x59ad0a[_0xf27c('0x2c')],qs[_0xf27c('0x31')](_0x533444[_0xf27c('0x2d')]['fields']));_0x489575[_0xf27c('0x30')]=_0x489575[_0xf27c('0x30')][_0xf27c('0x32')]?_0x489575[_0xf27c('0x30')]:_0x59ad0a[_0xf27c('0x2c')];_0x489575[_0xf27c('0x35')]=qs[_0xf27c('0x36')](_0x533444['query'][_0xf27c('0x36')]);_0x489575[_0xf27c('0x38')]=qs[_0xf27c('0x2e')](_[_0xf27c('0x48')](_0x533444[_0xf27c('0x2d')],_0x59ad0a[_0xf27c('0x2e')]));if(_0x533444[_0xf27c('0x2d')][_0xf27c('0x37')]){_0x489575[_0xf27c('0x38')]=_[_0xf27c('0x39')](_0x489575['where'],{'$or':_[_0xf27c('0x26')](_0x489575[_0xf27c('0x30')],function(_0x3c02c7){var _0x5e80c4={};_0x5e80c4[_0x3c02c7]={'$like':'%'+_0x533444[_0xf27c('0x2d')]['filter']+'%'};return _0x5e80c4;})});}_0x489575=_[_0xf27c('0x39')]({},_0x489575,_0x533444[_0xf27c('0x40')]);return _0x3b3795[_0xf27c('0x49')](_0x489575);}})['then'](function(_0x585f23){if(_0x585f23){_0x29587a=_0x585f23[_0xf27c('0x32')];if(!_0x533444[_0xf27c('0x2d')]['hasOwnProperty'](_0xf27c('0x34'))){_0x489575[_0xf27c('0x1b')]=qs[_0xf27c('0x1b')](_0x533444[_0xf27c('0x2d')][_0xf27c('0x1b')]);_0x489575[_0xf27c('0x19')]=qs[_0xf27c('0x19')](_0x533444[_0xf27c('0x2d')][_0xf27c('0x19')]);}return _0x3b3795[_0xf27c('0x49')](_0x489575);}})['then'](function(_0xd1ca61){if(_0xd1ca61){return _0xd1ca61?{'count':_0x29587a,'rows':_0xd1ca61}:null;}})[_0xf27c('0x20')](respondWithResult(_0x2762b8,null))[_0xf27c('0x42')](handleError(_0x2762b8,null));};exports[_0xf27c('0x4a')]=function(_0x66505,_0x5dcb24,_0x1ab9c3){var _0x115f2e={};var _0x579f57={};var _0x5d0095;var _0x51c88a;return db[_0xf27c('0x27')][_0xf27c('0x46')]({'where':{'id':_0x66505[_0xf27c('0x3e')]['id']}})[_0xf27c('0x20')](handleEntityNotFound(_0x5dcb24,null))['then'](function(_0x4b959a){if(_0x4b959a){_0x5d0095=_0x4b959a;_0x579f57[_0xf27c('0x2c')]=_[_0xf27c('0x3f')](db['SalesforceField'][_0xf27c('0x28')]);_0x579f57['query']=_[_0xf27c('0x3f')](_0x66505[_0xf27c('0x2d')]);_0x579f57['filters']=_[_0xf27c('0x2f')](_0x579f57[_0xf27c('0x2c')],_0x579f57[_0xf27c('0x2d')]);_0x115f2e['attributes']=_['intersection'](_0x579f57['model'],qs[_0xf27c('0x31')](_0x66505['query'][_0xf27c('0x31')]));_0x115f2e[_0xf27c('0x30')]=_0x115f2e[_0xf27c('0x30')][_0xf27c('0x32')]?_0x115f2e['attributes']:_0x579f57[_0xf27c('0x2c')];_0x115f2e[_0xf27c('0x35')]=qs['sort'](_0x66505[_0xf27c('0x2d')]['sort']);_0x115f2e[_0xf27c('0x38')]=qs[_0xf27c('0x2e')](_[_0xf27c('0x48')](_0x66505[_0xf27c('0x2d')],_0x579f57[_0xf27c('0x2e')]));if(_0x66505['query'][_0xf27c('0x37')]){_0x115f2e[_0xf27c('0x38')]=_[_0xf27c('0x39')](_0x115f2e[_0xf27c('0x38')],{'$or':_[_0xf27c('0x26')](_0x115f2e['attributes'],function(_0x3e010f){var _0x14c231={};_0x14c231[_0x3e010f]={'$like':'%'+_0x66505[_0xf27c('0x2d')][_0xf27c('0x37')]+'%'};return _0x14c231;})});}_0x115f2e=_[_0xf27c('0x39')]({},_0x115f2e,_0x66505[_0xf27c('0x40')]);return _0x5d0095[_0xf27c('0x4a')](_0x115f2e);}})[_0xf27c('0x20')](function(_0x28fdb1){if(_0x28fdb1){_0x51c88a=_0x28fdb1['length'];if(!_0x66505[_0xf27c('0x2d')][_0xf27c('0x33')](_0xf27c('0x34'))){_0x115f2e[_0xf27c('0x1b')]=qs['limit'](_0x66505['query'][_0xf27c('0x1b')]);_0x115f2e['offset']=qs['offset'](_0x66505[_0xf27c('0x2d')][_0xf27c('0x19')]);}return _0x5d0095[_0xf27c('0x4a')](_0x115f2e);}})[_0xf27c('0x20')](function(_0x44928d){if(_0x44928d){return _0x44928d?{'count':_0x51c88a,'rows':_0x44928d}:null;}})[_0xf27c('0x20')](respondWithResult(_0x5dcb24,null))[_0xf27c('0x42')](handleError(_0x5dcb24,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index 7666595..e81a11a 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 _0xae46=['../../config/environment','./intSalesforceConfiguration.attributes','define','int_salesforce_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x9718de,_0x17026c){var _0x10cd51=function(_0x14cf22){while(--_0x14cf22){_0x9718de['push'](_0x9718de['shift']());}};_0x10cd51(++_0x17026c);}(_0xae46,0xad));var _0x6ae4=function(_0x4366e1,_0x312378){_0x4366e1=_0x4366e1-0x0;var _0x265f9b=_0xae46[_0x4366e1];return _0x265f9b;};'use strict';var _=require(_0x6ae4('0x0'));var util=require(_0x6ae4('0x1'));var logger=require(_0x6ae4('0x2'))(_0x6ae4('0x3'));var moment=require(_0x6ae4('0x4'));var BPromise=require(_0x6ae4('0x5'));var rp=require(_0x6ae4('0x6'));var fs=require('fs');var path=require(_0x6ae4('0x7'));var rimraf=require(_0x6ae4('0x8'));var config=require(_0x6ae4('0x9'));var attributes=require(_0x6ae4('0xa'));module['exports']=function(_0x40e9e7,_0x36e396){return _0x40e9e7[_0x6ae4('0xb')]('SalesforceConfiguration',attributes,{'tableName':_0x6ae4('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb81d=['int_salesforce_configurations','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./intSalesforceConfiguration.attributes','exports','define','SalesforceConfiguration'];(function(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0xb81d,0x105));var _0xdb81=function(_0x48f62a,_0x45704f){_0x48f62a=_0x48f62a-0x0;var _0x3eac07=_0xb81d[_0x48f62a];return _0x3eac07;};'use strict';var _=require(_0xdb81('0x0'));var util=require(_0xdb81('0x1'));var logger=require(_0xdb81('0x2'))(_0xdb81('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xdb81('0x4'));var fs=require('fs');var path=require(_0xdb81('0x5'));var rimraf=require(_0xdb81('0x6'));var config=require(_0xdb81('0x7'));var attributes=require(_0xdb81('0x8'));module[_0xdb81('0x9')]=function(_0x1a6322,_0x69341){return _0x1a6322[_0xdb81('0xa')](_0xdb81('0xb'),attributes,{'tableName':_0xdb81('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js index 78f7341..54db9cf 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 _0x1fc6=['error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/logger','../../config/environment','client','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0x1fc6,0x77));var _0x61fc=function(_0x33a694,_0x9b6640){_0x33a694=_0x33a694-0x0;var _0x41ff01=_0x1fc6[_0x33a694];return _0x41ff01;};'use strict';var _=require(_0x61fc('0x0'));var util=require(_0x61fc('0x1'));var moment=require(_0x61fc('0x2'));var BPromise=require(_0x61fc('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x61fc('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x61fc('0x5'))('rpc');var config=require(_0x61fc('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x61fc('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x553020,_0x3e528e,_0x4f2db4){return new BPromise(function(_0x3ae497,_0xcbbdcf){return client['request'](_0x553020,_0x4f2db4)['then'](function(_0x592229){logger[_0x61fc('0x8')](_0x61fc('0x9'),_0x3e528e,_0x61fc('0xa'));logger[_0x61fc('0xb')](_0x61fc('0xc'),_0x3e528e,_0x61fc('0xa'),JSON[_0x61fc('0xd')](_0x592229));if(_0x592229['error']){if(_0x592229[_0x61fc('0xe')][_0x61fc('0xf')]===0x1f4){logger['error'](_0x61fc('0x9'),_0x3e528e,_0x592229[_0x61fc('0xe')][_0x61fc('0x10')]);return _0xcbbdcf(_0x592229[_0x61fc('0xe')][_0x61fc('0x10')]);}logger['error'](_0x61fc('0x9'),_0x3e528e,_0x592229[_0x61fc('0xe')][_0x61fc('0x10')]);return _0x3ae497(_0x592229[_0x61fc('0xe')][_0x61fc('0x10')]);}else{logger[_0x61fc('0x8')](_0x61fc('0x9'),_0x3e528e,'request\x20sent');_0x3ae497(_0x592229[_0x61fc('0x11')]['message']);}})[_0x61fc('0x12')](function(_0x289d05){logger[_0x61fc('0xe')](_0x61fc('0x9'),_0x3e528e,_0x289d05);_0xcbbdcf(_0x289d05);});});} \ No newline at end of file +var _0x043f=['info','debug','request\x20sent','error','SalesforceConfiguration,\x20%s,\x20%s','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x4493de,_0x5bbecc){var _0x113682=function(_0x89a705){while(--_0x89a705){_0x4493de['push'](_0x4493de['shift']());}};_0x113682(++_0x5bbecc);}(_0x043f,0x197));var _0xf043=function(_0x13635d,_0x14d83e){_0x13635d=_0x13635d-0x0;var _0x3505b9=_0x043f[_0x13635d];return _0x3505b9;};'use strict';var _=require(_0xf043('0x0'));var util=require('util');var moment=require(_0xf043('0x1'));var BPromise=require(_0xf043('0x2'));var rs=require(_0xf043('0x3'));var fs=require('fs');var Redis=require(_0xf043('0x4'));var db=require(_0xf043('0x5'))['db'];var utils=require(_0xf043('0x6'));var logger=require('../../config/logger')(_0xf043('0x7'));var config=require(_0xf043('0x8'));var jayson=require(_0xf043('0x9'));var client=jayson['client'][_0xf043('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1cd937,_0x579831,_0x8b0338){return new BPromise(function(_0x3cb54d,_0x41f618){return client[_0xf043('0xb')](_0x1cd937,_0x8b0338)[_0xf043('0xc')](function(_0x297552){logger[_0xf043('0xd')]('SalesforceConfiguration,\x20%s,\x20%s',_0x579831,'request\x20sent');logger[_0xf043('0xe')]('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x579831,_0xf043('0xf'),JSON['stringify'](_0x297552));if(_0x297552[_0xf043('0x10')]){if(_0x297552[_0xf043('0x10')]['code']===0x1f4){logger[_0xf043('0x10')](_0xf043('0x11'),_0x579831,_0x297552[_0xf043('0x10')][_0xf043('0x12')]);return _0x41f618(_0x297552[_0xf043('0x10')][_0xf043('0x12')]);}logger['error'](_0xf043('0x11'),_0x579831,_0x297552[_0xf043('0x10')]['message']);return _0x3cb54d(_0x297552['error']['message']);}else{logger[_0xf043('0xd')](_0xf043('0x11'),_0x579831,_0xf043('0xf'));_0x3cb54d(_0x297552[_0xf043('0x13')][_0xf043('0x12')]);}})['catch'](function(_0x179f92){logger[_0xf043('0x10')](_0xf043('0x11'),_0x579831,_0x179f92);_0x41f618(_0x179f92);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index 206eb38..b5b3d5e 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 _0x56e5=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSalesforceField.controller','get','isAuthenticated','index','/:id','post','put','delete'];(function(_0x25d846,_0x5eb082){var _0x242331=function(_0x4b6276){while(--_0x4b6276){_0x25d846['push'](_0x25d846['shift']());}};_0x242331(++_0x5eb082);}(_0x56e5,0xb6));var _0x556e=function(_0x3f5bc5,_0x378fde){_0x3f5bc5=_0x3f5bc5-0x0;var _0x25979c=_0x56e5[_0x3f5bc5];return _0x25979c;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x556e('0x0'));var express=require('express');var router=express[_0x556e('0x1')]();var fs_extra=require(_0x556e('0x2'));var auth=require(_0x556e('0x3'));var interaction=require(_0x556e('0x4'));var config=require('../../config/environment');var controller=require(_0x556e('0x5'));router[_0x556e('0x6')]('/',auth[_0x556e('0x7')](),controller[_0x556e('0x8')]);router['get'](_0x556e('0x9'),auth[_0x556e('0x7')](),controller['show']);router[_0x556e('0xa')]('/',auth[_0x556e('0x7')](),controller['create']);router[_0x556e('0xb')](_0x556e('0x9'),auth[_0x556e('0x7')](),controller['update']);router[_0x556e('0xc')]('/:id',auth[_0x556e('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xe89e=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','get','isAuthenticated','index','/:id','show','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x44e111,_0x427b22){var _0x551dc2=function(_0x5902b2){while(--_0x5902b2){_0x44e111['push'](_0x44e111['shift']());}};_0x551dc2(++_0x427b22);}(_0xe89e,0x160));var _0xee89=function(_0x1ab919,_0x3b6624){_0x1ab919=_0x1ab919-0x0;var _0x2e2795=_0xe89e[_0x1ab919];return _0x2e2795;};'use strict';var multer=require(_0xee89('0x0'));var util=require(_0xee89('0x1'));var path=require(_0xee89('0x2'));var timeout=require(_0xee89('0x3'));var express=require(_0xee89('0x4'));var router=express[_0xee89('0x5')]();var fs_extra=require(_0xee89('0x6'));var auth=require(_0xee89('0x7'));var interaction=require(_0xee89('0x8'));var config=require(_0xee89('0x9'));var controller=require(_0xee89('0xa'));router[_0xee89('0xb')]('/',auth[_0xee89('0xc')](),controller[_0xee89('0xd')]);router[_0xee89('0xb')](_0xee89('0xe'),auth['isAuthenticated'](),controller[_0xee89('0xf')]);router['post']('/',auth[_0xee89('0xc')](),controller[_0xee89('0x10')]);router[_0xee89('0x11')]('/:id',auth[_0xee89('0xc')](),controller['update']);router[_0xee89('0x12')](_0xee89('0xe'),auth['isAuthenticated'](),controller[_0xee89('0x13')]);module[_0xee89('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index d9a05ab..6e4ee9d 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 _0x1126=['STRING','ENUM','sequelize','exports','variable','customVariable','keyValue','picklist','string'];(function(_0x2311ad,_0x43404f){var _0x4be13e=function(_0x14cf9d){while(--_0x14cf9d){_0x2311ad['push'](_0x2311ad['shift']());}};_0x4be13e(++_0x43404f);}(_0x1126,0xd1));var _0x6112=function(_0x7ecc0,_0x3c5cc5){_0x7ecc0=_0x7ecc0-0x0;var _0x5d016b=_0x1126[_0x7ecc0];return _0x5d016b;};'use strict';var Sequelize=require(_0x6112('0x0'));module[_0x6112('0x1')]={'type':{'type':Sequelize['ENUM']('string',_0x6112('0x2'),_0x6112('0x3'),_0x6112('0x4'),_0x6112('0x5')),'defaultValue':_0x6112('0x6')},'content':{'type':Sequelize[_0x6112('0x7')]},'key':{'type':Sequelize[_0x6112('0x7')]},'keyType':{'type':Sequelize[_0x6112('0x8')](_0x6112('0x6'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0x6112('0x7')]},'idField':{'type':Sequelize[_0x6112('0x7')]},'variableName':{'type':Sequelize[_0x6112('0x7')]}}; \ No newline at end of file +var _0xf081=['sequelize','ENUM','string','variable','customVariable','picklist','STRING'];(function(_0x362882,_0x3012cf){var _0x4632c9=function(_0x1cdbb8){while(--_0x1cdbb8){_0x362882['push'](_0x362882['shift']());}};_0x4632c9(++_0x3012cf);}(_0xf081,0x77));var _0x1f08=function(_0x4fbfd9,_0x3ab91a){_0x4fbfd9=_0x4fbfd9-0x0;var _0x31dc94=_0xf081[_0x4fbfd9];return _0x31dc94;};'use strict';var Sequelize=require(_0x1f08('0x0'));module['exports']={'type':{'type':Sequelize[_0x1f08('0x1')](_0x1f08('0x2'),_0x1f08('0x3'),_0x1f08('0x4'),'keyValue',_0x1f08('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0x1f08('0x6')]},'key':{'type':Sequelize[_0x1f08('0x6')]},'keyType':{'type':Sequelize[_0x1f08('0x1')](_0x1f08('0x2'),_0x1f08('0x3'),_0x1f08('0x4'))},'keyContent':{'type':Sequelize[_0x1f08('0x6')]},'idField':{'type':Sequelize[_0x1f08('0x6')]},'variableName':{'type':Sequelize[_0x1f08('0x6')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index 4a406ac..83b9e83 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 _0x9c2a=['index','map','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','SalesforceField','includeAll','include','rows','catch','show','params','keys','length','create','body','find','eml-format','rimraf','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','apply','reject','save','update','then','destroy','name'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x9c2a,0xb5));var _0xa9c2=function(_0x2f2e0e,_0xbeb776){_0x2f2e0e=_0x2f2e0e-0x0;var _0x465367=_0x9c2a[_0x2f2e0e];return _0x465367;};'use strict';var emlformat=require(_0xa9c2('0x0'));var rimraf=require(_0xa9c2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa9c2('0x2'));var rp=require(_0xa9c2('0x3'));var moment=require(_0xa9c2('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xa9c2('0x5'));var path=require('path');var sox=require(_0xa9c2('0x6'));var csv=require(_0xa9c2('0x7'));var ejs=require(_0xa9c2('0x8'));var fs=require('fs');var fs_extra=require(_0xa9c2('0x9'));var _=require(_0xa9c2('0xa'));var squel=require(_0xa9c2('0xb'));var crypto=require(_0xa9c2('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xa9c2('0xd'));var toCsv=require('to-csv');var querystring=require(_0xa9c2('0xe'));var Papa=require(_0xa9c2('0xf'));var Redis=require(_0xa9c2('0x10'));var authService=require(_0xa9c2('0x11'));var qs=require(_0xa9c2('0x12'));var as=require(_0xa9c2('0x13'));var hardwareService=require(_0xa9c2('0x14'));var logger=require(_0xa9c2('0x15'))(_0xa9c2('0x16'));var utils=require(_0xa9c2('0x17'));var config=require(_0xa9c2('0x18'));var licenseUtil=require(_0xa9c2('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1e2467,_0x41b0bf){_0x41b0bf=_0x41b0bf||0xcc;return function(_0x5ce8a9){if(_0x5ce8a9){return _0x1e2467[_0xa9c2('0x1a')](_0x41b0bf);}return _0x1e2467[_0xa9c2('0x1b')](_0x41b0bf)[_0xa9c2('0x1c')]();};}function respondWithResult(_0x50ddf7,_0x581ec0){_0x581ec0=_0x581ec0||0xc8;return function(_0x5075c4){if(_0x5075c4){return _0x50ddf7[_0xa9c2('0x1b')](_0x581ec0)[_0xa9c2('0x1d')](_0x5075c4);}};}function respondWithFilteredResult(_0x31fc7a,_0x12d6b9){return function(_0x245769){if(_0x245769){var _0x5a9ee8=typeof _0x12d6b9['offset']===_0xa9c2('0x1e')&&typeof _0x12d6b9[_0xa9c2('0x1f')]===_0xa9c2('0x1e');var _0x3c62e0=_0x245769['count'];var _0x479b2a=_0x5a9ee8?0x0:_0x12d6b9['offset'];var _0x2be264=_0x5a9ee8?_0x245769[_0xa9c2('0x20')]:_0x12d6b9[_0xa9c2('0x21')]+_0x12d6b9[_0xa9c2('0x1f')];var _0x2fcdec;if(_0x2be264>=_0x3c62e0){_0x2be264=_0x3c62e0;_0x2fcdec=0xc8;}else{_0x2fcdec=0xce;}_0x31fc7a[_0xa9c2('0x1b')](_0x2fcdec);return _0x31fc7a['set']('Content-Range',_0x479b2a+'-'+_0x2be264+'/'+_0x3c62e0)[_0xa9c2('0x1d')](_0x245769);}return null;};}function patchUpdates(_0x12a573){return function(_0x1f4066){try{jsonpatch[_0xa9c2('0x22')](_0x1f4066,_0x12a573,!![]);}catch(_0x1ac17d){return BPromise[_0xa9c2('0x23')](_0x1ac17d);}return _0x1f4066[_0xa9c2('0x24')]();};}function saveUpdates(_0x5dbb28,_0x1d193d){return function(_0x1957cd){if(_0x1957cd){return _0x1957cd[_0xa9c2('0x25')](_0x5dbb28)[_0xa9c2('0x26')](function(_0x196816){return _0x196816;});}return null;};}function removeEntity(_0x393a8f,_0x4bd128){return function(_0x14d63c){if(_0x14d63c){return _0x14d63c[_0xa9c2('0x27')]()[_0xa9c2('0x26')](function(){_0x393a8f[_0xa9c2('0x1b')](0xcc)[_0xa9c2('0x1c')]();});}};}function handleEntityNotFound(_0x26069e,_0x3b6ca9){return function(_0x6dfec0){if(!_0x6dfec0){_0x26069e['sendStatus'](0x194);}return _0x6dfec0;};}function handleError(_0x35f2f8,_0x2ebc2c){_0x2ebc2c=_0x2ebc2c||0x1f4;return function(_0xd87a1e){logger['error'](_0xd87a1e['stack']);if(_0xd87a1e[_0xa9c2('0x28')]){delete _0xd87a1e[_0xa9c2('0x28')];}_0x35f2f8['status'](_0x2ebc2c)['send'](_0xd87a1e);};}exports[_0xa9c2('0x29')]=function(_0x4be27e,_0x115c7e){var _0x406d02={},_0x174358={},_0x212104={'count':0x0,'rows':[]};var _0x2fa3d6=_[_0xa9c2('0x2a')](db['SalesforceField'][_0xa9c2('0x2b')],function(_0x423c54){return{'name':_0x423c54[_0xa9c2('0x2c')],'type':_0x423c54[_0xa9c2('0x2d')]['key']};});_0x174358[_0xa9c2('0x2e')]=_[_0xa9c2('0x2a')](_0x2fa3d6,_0xa9c2('0x28'));_0x174358['query']=_['keys'](_0x4be27e[_0xa9c2('0x2f')]);_0x174358[_0xa9c2('0x30')]=_[_0xa9c2('0x31')](_0x174358[_0xa9c2('0x2e')],_0x174358[_0xa9c2('0x2f')]);_0x406d02[_0xa9c2('0x32')]=_[_0xa9c2('0x31')](_0x174358['model'],qs['fields'](_0x4be27e['query'][_0xa9c2('0x33')]));_0x406d02[_0xa9c2('0x32')]=_0x406d02[_0xa9c2('0x32')]['length']?_0x406d02[_0xa9c2('0x32')]:_0x174358[_0xa9c2('0x2e')];if(!_0x4be27e[_0xa9c2('0x2f')][_0xa9c2('0x34')](_0xa9c2('0x35'))){_0x406d02['limit']=qs[_0xa9c2('0x1f')](_0x4be27e[_0xa9c2('0x2f')][_0xa9c2('0x1f')]);_0x406d02[_0xa9c2('0x21')]=qs[_0xa9c2('0x21')](_0x4be27e[_0xa9c2('0x2f')]['offset']);}_0x406d02[_0xa9c2('0x36')]=qs[_0xa9c2('0x37')](_0x4be27e['query'][_0xa9c2('0x37')]);_0x406d02['where']=qs['filters'](_[_0xa9c2('0x38')](_0x4be27e['query'],_0x174358['filters']),_0x2fa3d6);if(_0x4be27e[_0xa9c2('0x2f')][_0xa9c2('0x39')]){_0x406d02['where']=_[_0xa9c2('0x3a')](_0x406d02[_0xa9c2('0x3b')],{'$or':_[_0xa9c2('0x2a')](_0x2fa3d6,function(_0x1d0944){if(_0x1d0944['type']!==_0xa9c2('0x3c')){var _0x25f8a6={};_0x25f8a6[_0x1d0944[_0xa9c2('0x28')]]={'$like':'%'+_0x4be27e[_0xa9c2('0x2f')][_0xa9c2('0x39')]+'%'};return _0x25f8a6;}})});}_0x406d02=_[_0xa9c2('0x3a')]({},_0x406d02,_0x4be27e[_0xa9c2('0x3d')]);var _0x440dc1={'where':_0x406d02[_0xa9c2('0x3b')]};return db[_0xa9c2('0x3e')][_0xa9c2('0x20')](_0x440dc1)[_0xa9c2('0x26')](function(_0x393c04){_0x212104[_0xa9c2('0x20')]=_0x393c04;if(_0x4be27e['query'][_0xa9c2('0x3f')]){_0x406d02[_0xa9c2('0x40')]=[{'all':!![]}];}return db[_0xa9c2('0x3e')]['findAll'](_0x406d02);})[_0xa9c2('0x26')](function(_0x1624f1){_0x212104[_0xa9c2('0x41')]=_0x1624f1;return _0x212104;})[_0xa9c2('0x26')](respondWithFilteredResult(_0x115c7e,_0x406d02))[_0xa9c2('0x42')](handleError(_0x115c7e,null));};exports[_0xa9c2('0x43')]=function(_0xf4f1c7,_0x33c5a1){var _0x490a43={'raw':!![],'where':{'id':_0xf4f1c7[_0xa9c2('0x44')]['id']}},_0x519f32={};_0x519f32[_0xa9c2('0x2e')]=_['keys'](db[_0xa9c2('0x3e')][_0xa9c2('0x2b')]);_0x519f32[_0xa9c2('0x2f')]=_[_0xa9c2('0x45')](_0xf4f1c7['query']);_0x519f32[_0xa9c2('0x30')]=_[_0xa9c2('0x31')](_0x519f32[_0xa9c2('0x2e')],_0x519f32[_0xa9c2('0x2f')]);_0x490a43[_0xa9c2('0x32')]=_[_0xa9c2('0x31')](_0x519f32[_0xa9c2('0x2e')],qs['fields'](_0xf4f1c7[_0xa9c2('0x2f')][_0xa9c2('0x33')]));_0x490a43['attributes']=_0x490a43[_0xa9c2('0x32')][_0xa9c2('0x46')]?_0x490a43[_0xa9c2('0x32')]:_0x519f32[_0xa9c2('0x2e')];if(_0xf4f1c7[_0xa9c2('0x2f')]['includeAll']){_0x490a43[_0xa9c2('0x40')]=[{'all':!![]}];}_0x490a43=_[_0xa9c2('0x3a')]({},_0x490a43,_0xf4f1c7[_0xa9c2('0x3d')]);return db['SalesforceField']['find'](_0x490a43)['then'](handleEntityNotFound(_0x33c5a1,null))[_0xa9c2('0x26')](respondWithResult(_0x33c5a1,null))[_0xa9c2('0x42')](handleError(_0x33c5a1,null));};exports[_0xa9c2('0x47')]=function(_0x218e86,_0x1eff7e){return db[_0xa9c2('0x3e')][_0xa9c2('0x47')](_0x218e86[_0xa9c2('0x48')],{})[_0xa9c2('0x26')](respondWithResult(_0x1eff7e,0xc9))[_0xa9c2('0x42')](handleError(_0x1eff7e,null));};exports['update']=function(_0x205010,_0x5eddcf){if(_0x205010['body']['id']){delete _0x205010[_0xa9c2('0x48')]['id'];}return db[_0xa9c2('0x3e')][_0xa9c2('0x49')]({'where':{'id':_0x205010[_0xa9c2('0x44')]['id']}})[_0xa9c2('0x26')](handleEntityNotFound(_0x5eddcf,null))[_0xa9c2('0x26')](saveUpdates(_0x205010[_0xa9c2('0x48')],null))['then'](respondWithResult(_0x5eddcf,null))[_0xa9c2('0x42')](handleError(_0x5eddcf,null));};exports[_0xa9c2('0x27')]=function(_0x2e08e2,_0x1382ca){return db[_0xa9c2('0x3e')][_0xa9c2('0x49')]({'where':{'id':_0x2e08e2[_0xa9c2('0x44')]['id']}})[_0xa9c2('0x26')](handleEntityNotFound(_0x1382ca,null))['then'](removeEntity(_0x1382ca,null))[_0xa9c2('0x42')](handleError(_0x1382ca,null));}; \ No newline at end of file +var _0x9e9e=['model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','name','options','includeAll','findAll','catch','params','keys','include','find','body','zip-dir','fast-json-patch','moment','bluebird','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/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','update','destroy','then','error','stack','send','index','map','SalesforceField','rawAttributes','type','query','filters'];(function(_0x1cc3bf,_0x132423){var _0xa6afef=function(_0x44bb18){while(--_0x44bb18){_0x1cc3bf['push'](_0x1cc3bf['shift']());}};_0xa6afef(++_0x132423);}(_0x9e9e,0xa4));var _0xe9e9=function(_0x3aeb36,_0x312dc9){_0x3aeb36=_0x3aeb36-0x0;var _0xa2ef21=_0x9e9e[_0x3aeb36];return _0xa2ef21;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe9e9('0x0'));var jsonpatch=require(_0xe9e9('0x1'));var rp=require('request-promise');var moment=require(_0xe9e9('0x2'));var BPromise=require(_0xe9e9('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0xe9e9('0x4'));var sox=require(_0xe9e9('0x5'));var csv=require(_0xe9e9('0x6'));var ejs=require(_0xe9e9('0x7'));var fs=require('fs');var fs_extra=require(_0xe9e9('0x8'));var _=require(_0xe9e9('0x9'));var squel=require(_0xe9e9('0xa'));var crypto=require('crypto');var jsforce=require(_0xe9e9('0xb'));var deskjs=require(_0xe9e9('0xc'));var toCsv=require('to-csv');var querystring=require(_0xe9e9('0xd'));var Papa=require(_0xe9e9('0xe'));var Redis=require(_0xe9e9('0xf'));var authService=require(_0xe9e9('0x10'));var qs=require(_0xe9e9('0x11'));var as=require(_0xe9e9('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xe9e9('0x13'));var config=require(_0xe9e9('0x14'));var licenseUtil=require(_0xe9e9('0x15'));var db=require(_0xe9e9('0x16'))['db'];function respondWithStatusCode(_0x151209,_0x2bd7ac){_0x2bd7ac=_0x2bd7ac||0xcc;return function(_0x4b3bd0){if(_0x4b3bd0){return _0x151209[_0xe9e9('0x17')](_0x2bd7ac);}return _0x151209[_0xe9e9('0x18')](_0x2bd7ac)[_0xe9e9('0x19')]();};}function respondWithResult(_0x28fad0,_0x57325d){_0x57325d=_0x57325d||0xc8;return function(_0x226aad){if(_0x226aad){return _0x28fad0[_0xe9e9('0x18')](_0x57325d)[_0xe9e9('0x1a')](_0x226aad);}};}function respondWithFilteredResult(_0xb13d50,_0x26cd8a){return function(_0x44359a){if(_0x44359a){var _0x1d20ba=typeof _0x26cd8a[_0xe9e9('0x1b')]===_0xe9e9('0x1c')&&typeof _0x26cd8a[_0xe9e9('0x1d')]===_0xe9e9('0x1c');var _0xa0679c=_0x44359a[_0xe9e9('0x1e')];var _0x54df65=_0x1d20ba?0x0:_0x26cd8a[_0xe9e9('0x1b')];var _0x4ffcfe=_0x1d20ba?_0x44359a['count']:_0x26cd8a[_0xe9e9('0x1b')]+_0x26cd8a[_0xe9e9('0x1d')];var _0xb0266d;if(_0x4ffcfe>=_0xa0679c){_0x4ffcfe=_0xa0679c;_0xb0266d=0xc8;}else{_0xb0266d=0xce;}_0xb13d50[_0xe9e9('0x18')](_0xb0266d);return _0xb13d50['set'](_0xe9e9('0x1f'),_0x54df65+'-'+_0x4ffcfe+'/'+_0xa0679c)[_0xe9e9('0x1a')](_0x44359a);}return null;};}function patchUpdates(_0x1f5b44){return function(_0x5e633f){try{jsonpatch[_0xe9e9('0x20')](_0x5e633f,_0x1f5b44,!![]);}catch(_0x27fee0){return BPromise['reject'](_0x27fee0);}return _0x5e633f['save']();};}function saveUpdates(_0x57c2ba,_0x407c44){return function(_0x115602){if(_0x115602){return _0x115602[_0xe9e9('0x21')](_0x57c2ba)['then'](function(_0x59ea07){return _0x59ea07;});}return null;};}function removeEntity(_0x4efd97,_0x1fdba1){return function(_0x559cbd){if(_0x559cbd){return _0x559cbd[_0xe9e9('0x22')]()[_0xe9e9('0x23')](function(){_0x4efd97[_0xe9e9('0x18')](0xcc)[_0xe9e9('0x19')]();});}};}function handleEntityNotFound(_0x26a44d,_0x350748){return function(_0x19a2de){if(!_0x19a2de){_0x26a44d[_0xe9e9('0x17')](0x194);}return _0x19a2de;};}function handleError(_0x5caad7,_0x576b05){_0x576b05=_0x576b05||0x1f4;return function(_0xdf4bef){logger[_0xe9e9('0x24')](_0xdf4bef[_0xe9e9('0x25')]);if(_0xdf4bef['name']){delete _0xdf4bef['name'];}_0x5caad7[_0xe9e9('0x18')](_0x576b05)[_0xe9e9('0x26')](_0xdf4bef);};}exports[_0xe9e9('0x27')]=function(_0x4d32ba,_0x177609){var _0x2d9714={},_0xcd825e={},_0x1ec8f8={'count':0x0,'rows':[]};var _0x5ed85b=_[_0xe9e9('0x28')](db[_0xe9e9('0x29')][_0xe9e9('0x2a')],function(_0x1df3d){return{'name':_0x1df3d['fieldName'],'type':_0x1df3d[_0xe9e9('0x2b')]['key']};});_0xcd825e['model']=_[_0xe9e9('0x28')](_0x5ed85b,'name');_0xcd825e[_0xe9e9('0x2c')]=_['keys'](_0x4d32ba['query']);_0xcd825e[_0xe9e9('0x2d')]=_['intersection'](_0xcd825e[_0xe9e9('0x2e')],_0xcd825e[_0xe9e9('0x2c')]);_0x2d9714[_0xe9e9('0x2f')]=_[_0xe9e9('0x30')](_0xcd825e['model'],qs['fields'](_0x4d32ba[_0xe9e9('0x2c')][_0xe9e9('0x31')]));_0x2d9714[_0xe9e9('0x2f')]=_0x2d9714[_0xe9e9('0x2f')][_0xe9e9('0x32')]?_0x2d9714[_0xe9e9('0x2f')]:_0xcd825e[_0xe9e9('0x2e')];if(!_0x4d32ba[_0xe9e9('0x2c')][_0xe9e9('0x33')](_0xe9e9('0x34'))){_0x2d9714[_0xe9e9('0x1d')]=qs['limit'](_0x4d32ba[_0xe9e9('0x2c')]['limit']);_0x2d9714[_0xe9e9('0x1b')]=qs[_0xe9e9('0x1b')](_0x4d32ba['query'][_0xe9e9('0x1b')]);}_0x2d9714[_0xe9e9('0x35')]=qs[_0xe9e9('0x36')](_0x4d32ba[_0xe9e9('0x2c')][_0xe9e9('0x36')]);_0x2d9714['where']=qs['filters'](_[_0xe9e9('0x37')](_0x4d32ba[_0xe9e9('0x2c')],_0xcd825e['filters']),_0x5ed85b);if(_0x4d32ba['query'][_0xe9e9('0x38')]){_0x2d9714[_0xe9e9('0x39')]=_[_0xe9e9('0x3a')](_0x2d9714['where'],{'$or':_[_0xe9e9('0x28')](_0x5ed85b,function(_0x3468ff){if(_0x3468ff[_0xe9e9('0x2b')]!==_0xe9e9('0x3b')){var _0x43bc4e={};_0x43bc4e[_0x3468ff[_0xe9e9('0x3c')]]={'$like':'%'+_0x4d32ba['query'][_0xe9e9('0x38')]+'%'};return _0x43bc4e;}})});}_0x2d9714=_[_0xe9e9('0x3a')]({},_0x2d9714,_0x4d32ba[_0xe9e9('0x3d')]);var _0x5811f4={'where':_0x2d9714[_0xe9e9('0x39')]};return db['SalesforceField']['count'](_0x5811f4)['then'](function(_0x34d7c0){_0x1ec8f8[_0xe9e9('0x1e')]=_0x34d7c0;if(_0x4d32ba[_0xe9e9('0x2c')][_0xe9e9('0x3e')]){_0x2d9714['include']=[{'all':!![]}];}return db[_0xe9e9('0x29')][_0xe9e9('0x3f')](_0x2d9714);})[_0xe9e9('0x23')](function(_0x30833c){_0x1ec8f8['rows']=_0x30833c;return _0x1ec8f8;})['then'](respondWithFilteredResult(_0x177609,_0x2d9714))[_0xe9e9('0x40')](handleError(_0x177609,null));};exports['show']=function(_0x1a50b9,_0x37cd0e){var _0x4343e9={'raw':!![],'where':{'id':_0x1a50b9[_0xe9e9('0x41')]['id']}},_0x536997={};_0x536997[_0xe9e9('0x2e')]=_[_0xe9e9('0x42')](db[_0xe9e9('0x29')]['rawAttributes']);_0x536997[_0xe9e9('0x2c')]=_['keys'](_0x1a50b9[_0xe9e9('0x2c')]);_0x536997[_0xe9e9('0x2d')]=_[_0xe9e9('0x30')](_0x536997[_0xe9e9('0x2e')],_0x536997['query']);_0x4343e9[_0xe9e9('0x2f')]=_['intersection'](_0x536997[_0xe9e9('0x2e')],qs[_0xe9e9('0x31')](_0x1a50b9[_0xe9e9('0x2c')][_0xe9e9('0x31')]));_0x4343e9[_0xe9e9('0x2f')]=_0x4343e9[_0xe9e9('0x2f')][_0xe9e9('0x32')]?_0x4343e9[_0xe9e9('0x2f')]:_0x536997['model'];if(_0x1a50b9[_0xe9e9('0x2c')][_0xe9e9('0x3e')]){_0x4343e9[_0xe9e9('0x43')]=[{'all':!![]}];}_0x4343e9=_['merge']({},_0x4343e9,_0x1a50b9['options']);return db[_0xe9e9('0x29')][_0xe9e9('0x44')](_0x4343e9)['then'](handleEntityNotFound(_0x37cd0e,null))['then'](respondWithResult(_0x37cd0e,null))['catch'](handleError(_0x37cd0e,null));};exports['create']=function(_0x2235be,_0x2a24a6){return db[_0xe9e9('0x29')]['create'](_0x2235be[_0xe9e9('0x45')],{})[_0xe9e9('0x23')](respondWithResult(_0x2a24a6,0xc9))[_0xe9e9('0x40')](handleError(_0x2a24a6,null));};exports['update']=function(_0x2a2301,_0x49c5f4){if(_0x2a2301[_0xe9e9('0x45')]['id']){delete _0x2a2301[_0xe9e9('0x45')]['id'];}return db[_0xe9e9('0x29')][_0xe9e9('0x44')]({'where':{'id':_0x2a2301['params']['id']}})[_0xe9e9('0x23')](handleEntityNotFound(_0x49c5f4,null))[_0xe9e9('0x23')](saveUpdates(_0x2a2301[_0xe9e9('0x45')],null))[_0xe9e9('0x23')](respondWithResult(_0x49c5f4,null))[_0xe9e9('0x40')](handleError(_0x49c5f4,null));};exports[_0xe9e9('0x22')]=function(_0x91697d,_0x4079dc){return db['SalesforceField'][_0xe9e9('0x44')]({'where':{'id':_0x91697d['params']['id']}})['then'](handleEntityNotFound(_0x4079dc,null))[_0xe9e9('0x23')](removeEntity(_0x4079dc,null))[_0xe9e9('0x40')](handleError(_0x4079dc,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index 3e08c49..34e8e91 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 _0x044d=['request-promise','path','rimraf','exports','define','int_salesforce_fields','salesforce_unique_index','FieldId','lodash','../../config/logger','moment'];(function(_0x5f4126,_0x4173a2){var _0x3174ce=function(_0x10dc42){while(--_0x10dc42){_0x5f4126['push'](_0x5f4126['shift']());}};_0x3174ce(++_0x4173a2);}(_0x044d,0x1cb));var _0xd044=function(_0x4e2969,_0x5dfcda){_0x4e2969=_0x4e2969-0x0;var _0x5c4dd7=_0x044d[_0x4e2969];return _0x5c4dd7;};'use strict';var _=require(_0xd044('0x0'));var util=require('util');var logger=require(_0xd044('0x1'))('api');var moment=require(_0xd044('0x2'));var BPromise=require('bluebird');var rp=require(_0xd044('0x3'));var fs=require('fs');var path=require(_0xd044('0x4'));var rimraf=require(_0xd044('0x5'));var config=require('../../config/environment');var attributes=require('./intSalesforceField.attributes');module[_0xd044('0x6')]=function(_0x5ae087,_0x44e712){return _0x5ae087[_0xd044('0x7')]('SalesforceField',attributes,{'tableName':_0xd044('0x8'),'paranoid':![],'indexes':[{'name':_0xd044('0x9'),'fields':['idField',_0xd044('0xa')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xca7b=['lodash','util','api','moment','path','rimraf','../../config/environment','./intSalesforceField.attributes','exports','define','SalesforceField','idField','FieldId'];(function(_0x1e6d9a,_0x548cf2){var _0x59b4da=function(_0x24a41d){while(--_0x24a41d){_0x1e6d9a['push'](_0x1e6d9a['shift']());}};_0x59b4da(++_0x548cf2);}(_0xca7b,0x1a0));var _0xbca7=function(_0x187b21,_0x2a5a16){_0x187b21=_0x187b21-0x0;var _0x1593ce=_0xca7b[_0x187b21];return _0x1593ce;};'use strict';var _=require(_0xbca7('0x0'));var util=require(_0xbca7('0x1'));var logger=require('../../config/logger')(_0xbca7('0x2'));var moment=require(_0xbca7('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xbca7('0x4'));var rimraf=require(_0xbca7('0x5'));var config=require(_0xbca7('0x6'));var attributes=require(_0xbca7('0x7'));module[_0xbca7('0x8')]=function(_0x5f0767,_0x3ad72f){return _0x5f0767[_0xbca7('0x9')](_0xbca7('0xa'),attributes,{'tableName':'int_salesforce_fields','paranoid':![],'indexes':[{'name':'salesforce_unique_index','fields':[_0xbca7('0xb'),_0xbca7('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.rpc.js b/server/api/intSalesforceField/intSalesforceField.rpc.js index ecb57f0..4adac8a 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 _0xb782=['../../config/utils','rpc','../../config/environment','jayson/promise','client','then','info','SalesforceField,\x20%s,\x20%s','request\x20sent','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','message','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0xc0a3d3,_0x2c8d00){var _0x3386e8=function(_0x3f9df4){while(--_0x3f9df4){_0xc0a3d3['push'](_0xc0a3d3['shift']());}};_0x3386e8(++_0x2c8d00);}(_0xb782,0x9d));var _0x2b78=function(_0xb0a145,_0x408853){_0xb0a145=_0xb0a145-0x0;var _0x57de6f=_0xb782[_0xb0a145];return _0x57de6f;};'use strict';var _=require('lodash');var util=require(_0x2b78('0x0'));var moment=require('moment');var BPromise=require(_0x2b78('0x1'));var rs=require(_0x2b78('0x2'));var fs=require('fs');var Redis=require(_0x2b78('0x3'));var db=require(_0x2b78('0x4'))['db'];var utils=require(_0x2b78('0x5'));var logger=require('../../config/logger')(_0x2b78('0x6'));var config=require(_0x2b78('0x7'));var jayson=require(_0x2b78('0x8'));var client=jayson[_0x2b78('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1a59e4,_0x4d25a7,_0x821501){return new BPromise(function(_0x55ffbb,_0x555ffa){return client['request'](_0x1a59e4,_0x821501)[_0x2b78('0xa')](function(_0x2693b3){logger[_0x2b78('0xb')](_0x2b78('0xc'),_0x4d25a7,_0x2b78('0xd'));logger['debug'](_0x2b78('0xe'),_0x4d25a7,_0x2b78('0xd'),JSON[_0x2b78('0xf')](_0x2693b3));if(_0x2693b3[_0x2b78('0x10')]){if(_0x2693b3[_0x2b78('0x10')]['code']===0x1f4){logger[_0x2b78('0x10')](_0x2b78('0xc'),_0x4d25a7,_0x2693b3[_0x2b78('0x10')][_0x2b78('0x11')]);return _0x555ffa(_0x2693b3['error'][_0x2b78('0x11')]);}logger[_0x2b78('0x10')](_0x2b78('0xc'),_0x4d25a7,_0x2693b3[_0x2b78('0x10')][_0x2b78('0x11')]);return _0x55ffbb(_0x2693b3['error']['message']);}else{logger[_0x2b78('0xb')]('SalesforceField,\x20%s,\x20%s',_0x4d25a7,'request\x20sent');_0x55ffbb(_0x2693b3['result']['message']);}})['catch'](function(_0x188de4){logger[_0x2b78('0x10')](_0x2b78('0xc'),_0x4d25a7,_0x188de4);_0x555ffa(_0x188de4);});});} \ No newline at end of file +var _0xf14d=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','SalesforceField,\x20%s,\x20%s','request\x20sent','SalesforceField,\x20%s,\x20%s,\x20%s','error','code','message','info','result'];(function(_0x8f6f66,_0x4c0d9c){var _0xb86238=function(_0x139885){while(--_0x139885){_0x8f6f66['push'](_0x8f6f66['shift']());}};_0xb86238(++_0x4c0d9c);}(_0xf14d,0x11e));var _0xdf14=function(_0x4f5e17,_0x4a60e1){_0x4f5e17=_0x4f5e17-0x0;var _0x48ab6e=_0xf14d[_0x4f5e17];return _0x48ab6e;};'use strict';var _=require(_0xdf14('0x0'));var util=require(_0xdf14('0x1'));var moment=require(_0xdf14('0x2'));var BPromise=require(_0xdf14('0x3'));var rs=require(_0xdf14('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdf14('0x5'))['db'];var utils=require(_0xdf14('0x6'));var logger=require(_0xdf14('0x7'))(_0xdf14('0x8'));var config=require('../../config/environment');var jayson=require(_0xdf14('0x9'));var client=jayson[_0xdf14('0xa')][_0xdf14('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x596d36,_0x4c3a52,_0x19d73a){return new BPromise(function(_0x3a8e84,_0x290d54){return client[_0xdf14('0xc')](_0x596d36,_0x19d73a)[_0xdf14('0xd')](function(_0x330b85){logger['info'](_0xdf14('0xe'),_0x4c3a52,_0xdf14('0xf'));logger['debug'](_0xdf14('0x10'),_0x4c3a52,_0xdf14('0xf'),JSON['stringify'](_0x330b85));if(_0x330b85['error']){if(_0x330b85[_0xdf14('0x11')][_0xdf14('0x12')]===0x1f4){logger['error'](_0xdf14('0xe'),_0x4c3a52,_0x330b85['error'][_0xdf14('0x13')]);return _0x290d54(_0x330b85[_0xdf14('0x11')][_0xdf14('0x13')]);}logger[_0xdf14('0x11')](_0xdf14('0xe'),_0x4c3a52,_0x330b85[_0xdf14('0x11')][_0xdf14('0x13')]);return _0x3a8e84(_0x330b85['error'][_0xdf14('0x13')]);}else{logger[_0xdf14('0x14')](_0xdf14('0xe'),_0x4c3a52,_0xdf14('0xf'));_0x3a8e84(_0x330b85[_0xdf14('0x15')][_0xdf14('0x13')]);}})['catch'](function(_0x4a2f38){logger[_0xdf14('0x11')](_0xdf14('0xe'),_0x4c3a52,_0x4a2f38);_0x290d54(_0x4a2f38);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index 9f5537f..66fe7d9 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 _0x4d0b=['/:id/fields','post','create','addConfiguration','put','update','delete','destroy','exports','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations'];(function(_0x4aa945,_0x2f6bf0){var _0x5679f8=function(_0x3adb00){while(--_0x3adb00){_0x4aa945['push'](_0x4aa945['shift']());}};_0x5679f8(++_0x2f6bf0);}(_0x4d0b,0x1d5));var _0xb4d0=function(_0x10b8d3,_0x26692a){_0x10b8d3=_0x10b8d3-0x0;var _0x8de4fd=_0x4d0b[_0x10b8d3];return _0x8de4fd;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xb4d0('0x0'));var timeout=require(_0xb4d0('0x1'));var express=require(_0xb4d0('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xb4d0('0x3'));var interaction=require(_0xb4d0('0x4'));var config=require(_0xb4d0('0x5'));var controller=require(_0xb4d0('0x6'));router[_0xb4d0('0x7')]('/',auth[_0xb4d0('0x8')](),controller[_0xb4d0('0x9')]);router[_0xb4d0('0x7')](_0xb4d0('0xa'),auth[_0xb4d0('0x8')](),controller[_0xb4d0('0xb')]);router['get'](_0xb4d0('0xc'),auth[_0xb4d0('0x8')](),controller[_0xb4d0('0xd')]);router['get'](_0xb4d0('0xe'),auth[_0xb4d0('0x8')](),controller['getFields']);router[_0xb4d0('0xf')]('/',auth[_0xb4d0('0x8')](),controller[_0xb4d0('0x10')]);router[_0xb4d0('0xf')](_0xb4d0('0xc'),auth['isAuthenticated'](),controller[_0xb4d0('0x11')]);router[_0xb4d0('0x12')]('/:id',auth[_0xb4d0('0x8')](),controller[_0xb4d0('0x13')]);router[_0xb4d0('0x14')](_0xb4d0('0xa'),auth[_0xb4d0('0x8')](),controller[_0xb4d0('0x15')]);module[_0xb4d0('0x16')]=router; \ No newline at end of file +var _0x220b=['util','path','connect-timeout','express','fs-extra','../../components/interaction/service','./intServicenowAccount.controller','get','isAuthenticated','index','/:id','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','delete','destroy'];(function(_0xc12f77,_0xa77108){var _0x128aaa=function(_0x3acf43){while(--_0x3acf43){_0xc12f77['push'](_0xc12f77['shift']());}};_0x128aaa(++_0xa77108);}(_0x220b,0x1a2));var _0xb220=function(_0x4e170e,_0x207e58){_0x4e170e=_0x4e170e-0x0;var _0x338291=_0x220b[_0x4e170e];return _0x338291;};'use strict';var multer=require('multer');var util=require(_0xb220('0x0'));var path=require(_0xb220('0x1'));var timeout=require(_0xb220('0x2'));var express=require(_0xb220('0x3'));var router=express['Router']();var fs_extra=require(_0xb220('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xb220('0x5'));var config=require('../../config/environment');var controller=require(_0xb220('0x6'));router[_0xb220('0x7')]('/',auth[_0xb220('0x8')](),controller[_0xb220('0x9')]);router['get'](_0xb220('0xa'),auth[_0xb220('0x8')](),controller['show']);router[_0xb220('0x7')](_0xb220('0xb'),auth[_0xb220('0x8')](),controller[_0xb220('0xc')]);router[_0xb220('0x7')](_0xb220('0xd'),auth[_0xb220('0x8')](),controller[_0xb220('0xe')]);router[_0xb220('0xf')]('/',auth['isAuthenticated'](),controller[_0xb220('0x10')]);router[_0xb220('0xf')]('/:id/configurations',auth['isAuthenticated'](),controller['addConfiguration']);router['put']('/:id',auth[_0xb220('0x8')](),controller['update']);router[_0xb220('0x11')](_0xb220('0xa'),auth[_0xb220('0x8')](),controller[_0xb220('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index d75c0a6..a378a8c 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 _0x7fb8=['STRING','username','sequelize'];(function(_0x1a16c0,_0x4f47bc){var _0xfb99d3=function(_0x117d59){while(--_0x117d59){_0x1a16c0['push'](_0x1a16c0['shift']());}};_0xfb99d3(++_0x4f47bc);}(_0x7fb8,0xad));var _0x87fb=function(_0x11ad36,_0x4c98f6){_0x11ad36=_0x11ad36-0x0;var _0x5d7905=_0x7fb8[_0x11ad36];return _0x5d7905;};'use strict';var Sequelize=require(_0x87fb('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x87fb('0x1')]},'username':{'type':Sequelize[_0x87fb('0x1')],'unique':_0x87fb('0x2')},'password':{'type':Sequelize[_0x87fb('0x1')]},'email':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x87fb('0x1')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x87fb('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x0407=['STRING','username','sequelize','exports'];(function(_0x180401,_0x1ffac6){var _0x32a876=function(_0x54ed5f){while(--_0x54ed5f){_0x180401['push'](_0x180401['shift']());}};_0x32a876(++_0x1ffac6);}(_0x0407,0x1a2));var _0x7040=function(_0x415603,_0x21320c){_0x415603=_0x415603-0x0;var _0x131e72=_0x0407[_0x415603];return _0x131e72;};'use strict';var Sequelize=require(_0x7040('0x0'));module[_0x7040('0x1')]={'name':{'type':Sequelize[_0x7040('0x2')]},'description':{'type':Sequelize[_0x7040('0x2')]},'username':{'type':Sequelize[_0x7040('0x2')],'unique':_0x7040('0x3')},'password':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x7040('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x7040('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 87c2c4e..fd034a2 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 _0xbcfb=['delivery_plan','impact','active','work_notes_list','expected_start','group_list','work_end','reopened_time','caller_id','work_notes','short_description','assignment_group','business_stc','additional_assignee_list','calendar_duration','notify','close_notes','closed_by','follow_up','sys_id','contact_type','reopened_by','urgency','company','activity_due','assigned_to','comments','sla_due','approval','comments_and_work_notes','sys_tags','escalation','upon_approval','correlation_id','location','username','password','email','remoteUri','serverUrl','substring','lastIndexOf','%s/api/now/table/','GET','incident?sysparm_display_value=all','result','incident\x20table\x20objects','includes','forEach','label','all','TCL:\x20_object','log','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','internalType','push','concat','test','statusCode','error','Wrong\x20credentials','boolean','True','true','False','false','sys_choice?sysparm_query=name=incident^element=','inactive','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','limit','undefined','count','offset','set','Content-Range','json','reject','update','destroy','stack','name','send','index','map','ServicenowAccount','fieldName','type','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','then','includeAll','include','findAll','rows','catch','params','length','options','find','create','body','getConfigurations','findOne','rawAttributes','addConfiguration','AccountId','Subjects','channel','Descriptions','getDescriptions','ServicenowConfiguration','ServicenowField','getFields','made_sla','hold_reason','knowledge','subcategory','close_code','incident_state','severity','category','caused_by','watch_list','upon_reject','sys_updated_on','child_incidents','approval_history','number','sys_updated_by','opened_by','user_input','sys_domain','sys_created_by','closed_at','cmdb_ci'];(function(_0x510431,_0x123086){var _0x52c04c=function(_0xfafb36){while(--_0xfafb36){_0x510431['push'](_0x510431['shift']());}};_0x52c04c(++_0x123086);}(_0xbcfb,0x1a6));var _0xbbcf=function(_0x154192,_0x2d360f){_0x154192=_0x154192-0x0;var _0x3c2792=_0xbcfb[_0x154192];return _0x3c2792;};'use strict';var emlformat=require(_0xbbcf('0x0'));var rimraf=require(_0xbbcf('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbbcf('0x2'));var rp=require(_0xbbcf('0x3'));var moment=require(_0xbbcf('0x4'));var BPromise=require(_0xbbcf('0x5'));var Mustache=require(_0xbbcf('0x6'));var util=require(_0xbbcf('0x7'));var path=require('path');var sox=require(_0xbbcf('0x8'));var csv=require(_0xbbcf('0x9'));var ejs=require(_0xbbcf('0xa'));var fs=require('fs');var fs_extra=require(_0xbbcf('0xb'));var _=require(_0xbbcf('0xc'));var squel=require(_0xbbcf('0xd'));var crypto=require('crypto');var jsforce=require(_0xbbcf('0xe'));var deskjs=require(_0xbbcf('0xf'));var toCsv=require('to-csv');var querystring=require(_0xbbcf('0x10'));var Papa=require(_0xbbcf('0x11'));var Redis=require(_0xbbcf('0x12'));var authService=require(_0xbbcf('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xbbcf('0x14'));var hardwareService=require(_0xbbcf('0x15'));var logger=require(_0xbbcf('0x16'))(_0xbbcf('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xbbcf('0x18'));var db=require(_0xbbcf('0x19'))['db'];var integrations=require(_0xbbcf('0x1a'));function respondWithStatusCode(_0x302121,_0x18cede){_0x18cede=_0x18cede||0xcc;return function(_0x87f08c){if(_0x87f08c){return _0x302121[_0xbbcf('0x1b')](_0x18cede);}return _0x302121[_0xbbcf('0x1c')](_0x18cede)[_0xbbcf('0x1d')]();};}function respondWithResult(_0x1aaa9c,_0x32f039){_0x32f039=_0x32f039||0xc8;return function(_0x5c48f3){if(_0x5c48f3){return _0x1aaa9c['status'](_0x32f039)['json'](_0x5c48f3);}};}function respondWithFilteredResult(_0x1d1a76,_0xac86e6){return function(_0x41bdec){if(_0x41bdec){var _0x3d14ae=typeof _0xac86e6['offset']==='undefined'&&typeof _0xac86e6[_0xbbcf('0x1e')]===_0xbbcf('0x1f');var _0x48f572=_0x41bdec[_0xbbcf('0x20')];var _0xf2307d=_0x3d14ae?0x0:_0xac86e6[_0xbbcf('0x21')];var _0x597d6c=_0x3d14ae?_0x41bdec[_0xbbcf('0x20')]:_0xac86e6[_0xbbcf('0x21')]+_0xac86e6[_0xbbcf('0x1e')];var _0x88e6b4;if(_0x597d6c>=_0x48f572){_0x597d6c=_0x48f572;_0x88e6b4=0xc8;}else{_0x88e6b4=0xce;}_0x1d1a76[_0xbbcf('0x1c')](_0x88e6b4);return _0x1d1a76[_0xbbcf('0x22')](_0xbbcf('0x23'),_0xf2307d+'-'+_0x597d6c+'/'+_0x48f572)[_0xbbcf('0x24')](_0x41bdec);}return null;};}function patchUpdates(_0x224be7){return function(_0x20985c){try{jsonpatch['apply'](_0x20985c,_0x224be7,!![]);}catch(_0x1ee6a3){return BPromise[_0xbbcf('0x25')](_0x1ee6a3);}return _0x20985c['save']();};}function saveUpdates(_0x680ca3,_0x5ab3e5){return function(_0x54a368){if(_0x54a368){return _0x54a368[_0xbbcf('0x26')](_0x680ca3)['then'](function(_0x1089d3){return _0x1089d3;});}return null;};}function removeEntity(_0x15e2d4,_0x927189){return function(_0x46a832){if(_0x46a832){return _0x46a832[_0xbbcf('0x27')]()['then'](function(){_0x15e2d4[_0xbbcf('0x1c')](0xcc)[_0xbbcf('0x1d')]();});}};}function handleEntityNotFound(_0x20311e,_0x23fa01){return function(_0xef223d){if(!_0xef223d){_0x20311e[_0xbbcf('0x1b')](0x194);}return _0xef223d;};}function handleError(_0x509395,_0x34cdf7){_0x34cdf7=_0x34cdf7||0x1f4;return function(_0x3be372){logger['error'](_0x3be372[_0xbbcf('0x28')]);if(_0x3be372[_0xbbcf('0x29')]){delete _0x3be372['name'];}_0x509395[_0xbbcf('0x1c')](_0x34cdf7)[_0xbbcf('0x2a')](_0x3be372);};}exports[_0xbbcf('0x2b')]=function(_0x455132,_0xd02332){var _0x4218cc={},_0x2e8e26={},_0x2e5c12={'count':0x0,'rows':[]};var _0x419acf=_[_0xbbcf('0x2c')](db[_0xbbcf('0x2d')]['rawAttributes'],function(_0x1b1651){return{'name':_0x1b1651[_0xbbcf('0x2e')],'type':_0x1b1651[_0xbbcf('0x2f')]['key']};});_0x2e8e26[_0xbbcf('0x30')]=_[_0xbbcf('0x2c')](_0x419acf,_0xbbcf('0x29'));_0x2e8e26[_0xbbcf('0x31')]=_[_0xbbcf('0x32')](_0x455132[_0xbbcf('0x31')]);_0x2e8e26[_0xbbcf('0x33')]=_['intersection'](_0x2e8e26[_0xbbcf('0x30')],_0x2e8e26[_0xbbcf('0x31')]);_0x4218cc[_0xbbcf('0x34')]=_[_0xbbcf('0x35')](_0x2e8e26[_0xbbcf('0x30')],qs[_0xbbcf('0x36')](_0x455132['query'][_0xbbcf('0x36')]));_0x4218cc[_0xbbcf('0x34')]=_0x4218cc[_0xbbcf('0x34')]['length']?_0x4218cc[_0xbbcf('0x34')]:_0x2e8e26[_0xbbcf('0x30')];if(!_0x455132[_0xbbcf('0x31')][_0xbbcf('0x37')]('nolimit')){_0x4218cc['limit']=qs[_0xbbcf('0x1e')](_0x455132[_0xbbcf('0x31')][_0xbbcf('0x1e')]);_0x4218cc['offset']=qs[_0xbbcf('0x21')](_0x455132[_0xbbcf('0x31')][_0xbbcf('0x21')]);}_0x4218cc[_0xbbcf('0x38')]=qs['sort'](_0x455132['query'][_0xbbcf('0x39')]);_0x4218cc[_0xbbcf('0x3a')]=qs[_0xbbcf('0x33')](_[_0xbbcf('0x3b')](_0x455132[_0xbbcf('0x31')],_0x2e8e26['filters']),_0x419acf);if(_0x455132[_0xbbcf('0x31')][_0xbbcf('0x3c')]){_0x4218cc[_0xbbcf('0x3a')]=_[_0xbbcf('0x3d')](_0x4218cc[_0xbbcf('0x3a')],{'$or':_['map'](_0x419acf,function(_0xaf9183){if(_0xaf9183['type']!==_0xbbcf('0x3e')){var _0x4a4829={};_0x4a4829[_0xaf9183[_0xbbcf('0x29')]]={'$like':'%'+_0x455132[_0xbbcf('0x31')]['filter']+'%'};return _0x4a4829;}})});}_0x4218cc=_[_0xbbcf('0x3d')]({},_0x4218cc,_0x455132['options']);var _0x411557={'where':_0x4218cc[_0xbbcf('0x3a')]};return db['ServicenowAccount'][_0xbbcf('0x20')](_0x411557)[_0xbbcf('0x3f')](function(_0x1a3d1a){_0x2e5c12[_0xbbcf('0x20')]=_0x1a3d1a;if(_0x455132[_0xbbcf('0x31')][_0xbbcf('0x40')]){_0x4218cc[_0xbbcf('0x41')]=[{'all':!![]}];}return db['ServicenowAccount'][_0xbbcf('0x42')](_0x4218cc);})['then'](function(_0x2be004){_0x2e5c12[_0xbbcf('0x43')]=_0x2be004;return _0x2e5c12;})[_0xbbcf('0x3f')](respondWithFilteredResult(_0xd02332,_0x4218cc))[_0xbbcf('0x44')](handleError(_0xd02332,null));};exports['show']=function(_0x2a4670,_0x23fcd8){var _0x5f21c8={'raw':![],'where':{'id':_0x2a4670[_0xbbcf('0x45')]['id']}},_0x181abd={};_0x181abd[_0xbbcf('0x30')]=_[_0xbbcf('0x32')](db[_0xbbcf('0x2d')]['rawAttributes']);_0x181abd[_0xbbcf('0x31')]=_[_0xbbcf('0x32')](_0x2a4670[_0xbbcf('0x31')]);_0x181abd[_0xbbcf('0x33')]=_[_0xbbcf('0x35')](_0x181abd['model'],_0x181abd[_0xbbcf('0x31')]);_0x5f21c8[_0xbbcf('0x34')]=_[_0xbbcf('0x35')](_0x181abd['model'],qs[_0xbbcf('0x36')](_0x2a4670[_0xbbcf('0x31')][_0xbbcf('0x36')]));_0x5f21c8[_0xbbcf('0x34')]=_0x5f21c8['attributes'][_0xbbcf('0x46')]?_0x5f21c8[_0xbbcf('0x34')]:_0x181abd['model'];if(_0x2a4670[_0xbbcf('0x31')][_0xbbcf('0x40')]){_0x5f21c8['include']=[{'all':!![]}];}_0x5f21c8=_[_0xbbcf('0x3d')]({},_0x5f21c8,_0x2a4670[_0xbbcf('0x47')]);return db[_0xbbcf('0x2d')][_0xbbcf('0x48')](_0x5f21c8)[_0xbbcf('0x3f')](handleEntityNotFound(_0x23fcd8,null))[_0xbbcf('0x3f')](respondWithResult(_0x23fcd8,null))[_0xbbcf('0x44')](handleError(_0x23fcd8,null));};exports[_0xbbcf('0x49')]=function(_0x2472c6,_0x24eabc){return db[_0xbbcf('0x2d')][_0xbbcf('0x49')](_0x2472c6[_0xbbcf('0x4a')],{})[_0xbbcf('0x3f')](respondWithResult(_0x24eabc,0xc9))['catch'](handleError(_0x24eabc,null));};exports[_0xbbcf('0x26')]=function(_0x3ce66f,_0x4430ae){if(_0x3ce66f[_0xbbcf('0x4a')]['id']){delete _0x3ce66f['body']['id'];}return db[_0xbbcf('0x2d')][_0xbbcf('0x48')]({'where':{'id':_0x3ce66f[_0xbbcf('0x45')]['id']}})[_0xbbcf('0x3f')](handleEntityNotFound(_0x4430ae,null))[_0xbbcf('0x3f')](saveUpdates(_0x3ce66f['body'],null))[_0xbbcf('0x3f')](respondWithResult(_0x4430ae,null))[_0xbbcf('0x44')](handleError(_0x4430ae,null));};exports[_0xbbcf('0x27')]=function(_0x210dce,_0x3cf28b){return db[_0xbbcf('0x2d')][_0xbbcf('0x48')]({'where':{'id':_0x210dce['params']['id']}})[_0xbbcf('0x3f')](handleEntityNotFound(_0x3cf28b,null))['then'](removeEntity(_0x3cf28b,null))['catch'](handleError(_0x3cf28b,null));};exports[_0xbbcf('0x4b')]=function(_0x530382,_0x197570,_0x10fcc5){var _0x39ea11={};var _0x244ef4={};var _0x10d0d1;var _0x30bc5d;return db[_0xbbcf('0x2d')][_0xbbcf('0x4c')]({'where':{'id':_0x530382['params']['id']}})[_0xbbcf('0x3f')](handleEntityNotFound(_0x197570,null))['then'](function(_0x172f1c){if(_0x172f1c){_0x10d0d1=_0x172f1c;_0x244ef4[_0xbbcf('0x30')]=_[_0xbbcf('0x32')](db['ServicenowConfiguration'][_0xbbcf('0x4d')]);_0x244ef4['query']=_[_0xbbcf('0x32')](_0x530382[_0xbbcf('0x31')]);_0x244ef4[_0xbbcf('0x33')]=_[_0xbbcf('0x35')](_0x244ef4['model'],_0x244ef4[_0xbbcf('0x31')]);_0x39ea11['attributes']=_[_0xbbcf('0x35')](_0x244ef4['model'],qs['fields'](_0x530382['query'][_0xbbcf('0x36')]));_0x39ea11[_0xbbcf('0x34')]=_0x39ea11[_0xbbcf('0x34')][_0xbbcf('0x46')]?_0x39ea11['attributes']:_0x244ef4[_0xbbcf('0x30')];_0x39ea11[_0xbbcf('0x38')]=qs['sort'](_0x530382[_0xbbcf('0x31')][_0xbbcf('0x39')]);_0x39ea11['where']=qs[_0xbbcf('0x33')](_[_0xbbcf('0x3b')](_0x530382[_0xbbcf('0x31')],_0x244ef4['filters']));if(_0x530382[_0xbbcf('0x31')][_0xbbcf('0x3c')]){_0x39ea11[_0xbbcf('0x3a')]=_[_0xbbcf('0x3d')](_0x39ea11[_0xbbcf('0x3a')],{'$or':_[_0xbbcf('0x2c')](_0x39ea11[_0xbbcf('0x34')],function(_0x79e35e){var _0x1120c8={};_0x1120c8[_0x79e35e]={'$like':'%'+_0x530382[_0xbbcf('0x31')]['filter']+'%'};return _0x1120c8;})});}_0x39ea11=_[_0xbbcf('0x3d')]({},_0x39ea11,_0x530382[_0xbbcf('0x47')]);return _0x10d0d1['getConfigurations'](_0x39ea11);}})[_0xbbcf('0x3f')](function(_0x1e2fa1){if(_0x1e2fa1){_0x30bc5d=_0x1e2fa1[_0xbbcf('0x46')];if(!_0x530382[_0xbbcf('0x31')][_0xbbcf('0x37')]('nolimit')){_0x39ea11[_0xbbcf('0x1e')]=qs[_0xbbcf('0x1e')](_0x530382['query'][_0xbbcf('0x1e')]);_0x39ea11['offset']=qs[_0xbbcf('0x21')](_0x530382[_0xbbcf('0x31')][_0xbbcf('0x21')]);}return _0x10d0d1[_0xbbcf('0x4b')](_0x39ea11);}})[_0xbbcf('0x3f')](function(_0x5f4776){if(_0x5f4776){return _0x5f4776?{'count':_0x30bc5d,'rows':_0x5f4776}:null;}})[_0xbbcf('0x3f')](respondWithResult(_0x197570,null))[_0xbbcf('0x44')](handleError(_0x197570,null));};exports[_0xbbcf('0x4e')]=function(_0x11fbf2,_0x25b26a,_0x389d47){if(_0x11fbf2['body']['id']){delete _0x11fbf2[_0xbbcf('0x4a')]['id'];}return db[_0xbbcf('0x2d')]['findOne']({'where':{'id':_0x11fbf2[_0xbbcf('0x45')]['id']}})[_0xbbcf('0x3f')](handleEntityNotFound(_0x25b26a,null))[_0xbbcf('0x3f')](function(_0x279b51){if(_0x279b51){_0x11fbf2[_0xbbcf('0x4a')][_0xbbcf('0x4f')]=_0x279b51['id'];_0x11fbf2['body'][_0xbbcf('0x50')]=integrations['getSubjects'](_0x11fbf2[_0xbbcf('0x4a')][_0xbbcf('0x51')],_0x11fbf2[_0xbbcf('0x4a')][_0xbbcf('0x2f')]);_0x11fbf2[_0xbbcf('0x4a')][_0xbbcf('0x52')]=integrations[_0xbbcf('0x53')](_0x11fbf2[_0xbbcf('0x4a')][_0xbbcf('0x51')],_0x11fbf2[_0xbbcf('0x4a')][_0xbbcf('0x2f')]);return db[_0xbbcf('0x54')][_0xbbcf('0x49')](_0x11fbf2[_0xbbcf('0x4a')],{'include':[{'model':db[_0xbbcf('0x55')],'as':_0xbbcf('0x50')},{'model':db[_0xbbcf('0x55')],'as':_0xbbcf('0x52')}]});}return null;})[_0xbbcf('0x3f')](respondWithResult(_0x25b26a,null))[_0xbbcf('0x44')](handleError(_0x25b26a,null));};exports[_0xbbcf('0x56')]=function(_0x2e9076,_0x582c9f,_0x4c3350){var _0x2fa724=[_0xbbcf('0x57'),_0xbbcf('0x58'),_0xbbcf('0x59'),_0xbbcf('0x5a'),_0xbbcf('0x5b'),'notify',_0xbbcf('0x5c'),_0xbbcf('0x5d'),_0xbbcf('0x5e')];var _0x1fb757=['parent','made_sla',_0xbbcf('0x5f'),_0xbbcf('0x60'),_0xbbcf('0x61'),_0xbbcf('0x62'),_0xbbcf('0x63'),_0xbbcf('0x58'),_0xbbcf('0x64'),_0xbbcf('0x65'),'resolved_by',_0xbbcf('0x66'),_0xbbcf('0x67'),_0xbbcf('0x68'),'sys_created_on',_0xbbcf('0x69'),'state',_0xbbcf('0x6a'),'knowledge','order','calendar_stc',_0xbbcf('0x6b'),_0xbbcf('0x6c'),_0xbbcf('0x6d'),_0xbbcf('0x6e'),_0xbbcf('0x6f'),_0xbbcf('0x70'),'business_service','priority','sys_domain_path','rfc','time_worked',_0xbbcf('0x71'),'opened_at','business_duration',_0xbbcf('0x72'),_0xbbcf('0x73'),_0xbbcf('0x74'),'resolved_at',_0xbbcf('0x75'),'approval_set',_0xbbcf('0x5a'),_0xbbcf('0x76'),_0xbbcf('0x77'),_0xbbcf('0x5b'),'correlation_display','delivery_task','work_start',_0xbbcf('0x78'),_0xbbcf('0x79'),_0xbbcf('0x7a'),'description',_0xbbcf('0x7b'),_0xbbcf('0x7c'),'sys_class_name',_0xbbcf('0x7d'),_0xbbcf('0x7e'),_0xbbcf('0x7f'),'parent_incident',_0xbbcf('0x80'),_0xbbcf('0x81'),_0xbbcf('0x82'),_0xbbcf('0x5c'),_0xbbcf('0x83'),'problem_id',_0xbbcf('0x84'),'reassignment_count',_0xbbcf('0x85'),_0xbbcf('0x86'),'severity',_0xbbcf('0x87'),_0xbbcf('0x88'),_0xbbcf('0x89'),_0xbbcf('0x8a'),'due_date','sys_mod_count','reopen_count',_0xbbcf('0x8b'),_0xbbcf('0x8c'),_0xbbcf('0x8d'),_0xbbcf('0x8e'),_0xbbcf('0x8f'),_0xbbcf('0x5e')];var _0x31a14d='';var _0x1bddb0='';var _0x4b12b6=[];var _0x58f0e7='';var _0x4cc03d='';var _0x48858f=[];var _0x5154e6='';var _0x16e42e='';var _0x561132={};var _0x1aecda='';return db['ServicenowAccount'][_0xbbcf('0x4c')]({'where':{'id':_0x2e9076[_0xbbcf('0x45')]['id']},'attributes':['id',_0xbbcf('0x90'),_0xbbcf('0x91'),_0xbbcf('0x92'),_0xbbcf('0x93'),_0xbbcf('0x94')]})[_0xbbcf('0x3f')](handleEntityNotFound(_0x582c9f,null))[_0xbbcf('0x3f')](function(_0x1c1b82){if(_0x1c1b82){_0x1aecda=_0x1c1b82[_0xbbcf('0x93')];var _0x728721=_0x1aecda['slice'](-0x1);if(_0x728721==='/'){_0x1aecda=_0x1aecda[_0xbbcf('0x95')](0x0,_0x1aecda[_0xbbcf('0x96')](_0x728721));}_0x16e42e=util['format']('%s/api/now/doc/table/schema/',_0x1aecda);_0x5154e6=util['format'](_0xbbcf('0x97'),_0x1aecda);_0x561132={'user':_0x1c1b82['username'],'pass':_0x1c1b82[_0xbbcf('0x91')]};var _0x5d513c={'method':_0xbbcf('0x98'),'uri':_0x16e42e+_0xbbcf('0x99'),'auth':_0x561132,'json':!![]};return rp(_0x5d513c);}})['then'](function(_0x109172){if(_0x109172[_0xbbcf('0x9a')][_0xbbcf('0x46')]>0x0){_0x31a14d=_0x109172[_0xbbcf('0x9a')];}console['log'](_0xbbcf('0x9b'),_0x31a14d);_0x48858f=[];_0x1bddb0=Object['assign']([],_0x31a14d);_['remove'](_0x1bddb0,function(_0x4a266f){return!_0x2fa724[_0xbbcf('0x9c')](_0x4a266f['name']);});_0x1bddb0[_0xbbcf('0x9d')](function(_0xdaddc3){var _0x35c4bd=createFieldObject(_0x5154e6,_0x561132,_0xdaddc3['internalType'],_0xdaddc3[_0xbbcf('0x29')],_0xdaddc3[_0xbbcf('0x9e')],![]);_0x48858f['push'](_0x35c4bd);});return Promise[_0xbbcf('0x9f')](_0x48858f);})['then'](function(_0x4429d6){_0x4b12b6=_0x4429d6;_0x58f0e7=Object['assign']([],_0x31a14d);console['log'](_0xbbcf('0xa0'),_0x31a14d);_['remove'](_0x58f0e7,function(_0x59a2d6){return _0x1fb757[_0xbbcf('0x9c')](_0x59a2d6[_0xbbcf('0x29')]);});console[_0xbbcf('0xa1')](_0xbbcf('0xa2'),_0x58f0e7);_0x48858f=[];_0x58f0e7['forEach'](function(_0x13c5f7){var _0xc7ba37=createFieldObject(_0x5154e6,_0x561132,_0x13c5f7[_0xbbcf('0xa3')],_0x13c5f7['name'],_0x13c5f7['label'],!![]);_0x48858f[_0xbbcf('0xa4')](_0xc7ba37);});return Promise[_0xbbcf('0x9f')](_0x48858f);})['then'](function(_0x4e7017){_0x4cc03d=_0x4e7017;var _0x4fba93=_0x4b12b6[_0xbbcf('0xa5')](_0x4cc03d);return{'count':_0x4fba93[_0xbbcf('0x46')],'rows':_0x4fba93};})[_0xbbcf('0x3f')](respondWithResult(_0x582c9f,null))[_0xbbcf('0x44')](function(_0x6edd96){console['log']('ServiceNow\x20error:\x20'+_0x6edd96);var _0x5ddc32=_0x2e9076[_0xbbcf('0x31')][_0xbbcf('0xa6')]?0x1f4:_0x6edd96[_0xbbcf('0xa7')]||0x1f4;logger[_0xbbcf('0xa8')](_0x6edd96['stack']);delete _0x6edd96['name'];if(_0x5ddc32===0x191){_0x5ddc32=0x190;}_0x582c9f[_0xbbcf('0x1c')](_0x5ddc32)[_0xbbcf('0x2a')](_0x2e9076[_0xbbcf('0x31')][_0xbbcf('0xa6')]?{'message':_0xbbcf('0xa9'),'statusCode':_0x6edd96['statusCode']}:_0x6edd96);});};function createFieldObject(_0x205f20,_0x42dac8,_0x4d0c96,_0x34e6c0,_0x136094,_0xc1f2d7){return new Promise(function(_0x3c27ff,_0x2b5f41){var _0x243330={'id':_0x34e6c0,'name':_0x136094,'custom':_0xc1f2d7};if(_0x4d0c96===_0xbbcf('0xaa')){_0x243330[_0xbbcf('0x47')]=[{'name':_0xbbcf('0xab'),'value':_0xbbcf('0xac')},{'name':_0xbbcf('0xad'),'value':_0xbbcf('0xae')}];_0x3c27ff(_0x243330);}else{var _0x334f5c={'method':_0xbbcf('0x98'),'uri':_0x205f20+_0xbbcf('0xaf')+_0x34e6c0,'auth':_0x42dac8,'json':!![]};return rp(_0x334f5c)[_0xbbcf('0x3f')](function(_0x183233){var _0x5c1699=[];if(_0x183233[_0xbbcf('0x9a')][_0xbbcf('0x46')]>0x0){_0x183233[_0xbbcf('0x9a')][_0xbbcf('0x9d')](function(_0x25b5a4){if(_0x25b5a4[_0xbbcf('0xb0')]===_0xbbcf('0xae')){var _0x17300a={'name':_0x25b5a4['label'],'value':_0x25b5a4['value']};_0x5c1699[_0xbbcf('0xa4')](_0x17300a);}});}_0x243330[_0xbbcf('0x47')]=_0x5c1699;if(_0x243330[_0xbbcf('0x47')]['length']>0x0){_0x3c27ff(_0x243330);}else{if(_0xc1f2d7==![]){_0x3c27ff();}else{_0x3c27ff(_0x243330);}}});}});} \ No newline at end of file +var _0x9059=['nolimit','sort','where','pick','filter','merge','VIRTUAL','ServicenowAccount','includeAll','findAll','rows','catch','show','params','rawAttributes','include','find','create','body','getConfigurations','ServicenowConfiguration','order','options','findOne','AccountId','Subjects','channel','Descriptions','getDescriptions','ServicenowField','getFields','made_sla','hold_reason','knowledge','subcategory','close_code','notify','incident_state','watch_list','upon_reject','approval_history','resolved_by','sys_updated_by','opened_by','sys_domain','state','sys_created_by','calendar_stc','cmdb_ci','delivery_plan','active','work_notes_list','business_service','priority','rfc','expected_start','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','calendar_duration','follow_up','parent_incident','sys_id','contact_type','reopened_by','urgency','problem_id','company','reassignment_count','assigned_to','severity','comments','approval','comments_and_work_notes','due_date','sys_mod_count','reopen_count','sys_tags','escalation','upon_approval','correlation_id','category','password','email','remoteUri','serverUrl','slice','substring','lastIndexOf','format','%s/api/now/table/','username','GET','incident\x20table\x20objects','assign','remove','includes','internalType','label','push','all','log','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','forEach','test','statusCode','Wrong\x20credentials','boolean','True','true','False','false','inactive','value','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty'];(function(_0x42c781,_0x351948){var _0x27b600=function(_0x3215c0){while(--_0x3215c0){_0x42c781['push'](_0x42c781['shift']());}};_0x27b600(++_0x351948);}(_0x9059,0x7f));var _0x9905=function(_0x52a4dc,_0x2e6f85){_0x52a4dc=_0x52a4dc-0x0;var _0x29c783=_0x9059[_0x52a4dc];return _0x29c783;};'use strict';var emlformat=require(_0x9905('0x0'));var rimraf=require(_0x9905('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9905('0x2'));var rp=require(_0x9905('0x3'));var moment=require(_0x9905('0x4'));var BPromise=require(_0x9905('0x5'));var Mustache=require('mustache');var util=require(_0x9905('0x6'));var path=require('path');var sox=require(_0x9905('0x7'));var csv=require(_0x9905('0x8'));var ejs=require(_0x9905('0x9'));var fs=require('fs');var fs_extra=require(_0x9905('0xa'));var _=require(_0x9905('0xb'));var squel=require(_0x9905('0xc'));var crypto=require(_0x9905('0xd'));var jsforce=require(_0x9905('0xe'));var deskjs=require(_0x9905('0xf'));var toCsv=require(_0x9905('0x8'));var querystring=require(_0x9905('0x10'));var Papa=require(_0x9905('0x11'));var Redis=require(_0x9905('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x9905('0x13'));var as=require(_0x9905('0x14'));var hardwareService=require(_0x9905('0x15'));var logger=require('../../config/logger')(_0x9905('0x16'));var utils=require(_0x9905('0x17'));var config=require(_0x9905('0x18'));var licenseUtil=require(_0x9905('0x19'));var db=require('../../mysqldb')['db'];var integrations=require(_0x9905('0x1a'));function respondWithStatusCode(_0x4ebc78,_0x59788d){_0x59788d=_0x59788d||0xcc;return function(_0x1b5df0){if(_0x1b5df0){return _0x4ebc78[_0x9905('0x1b')](_0x59788d);}return _0x4ebc78['status'](_0x59788d)[_0x9905('0x1c')]();};}function respondWithResult(_0x27e57a,_0x516eea){_0x516eea=_0x516eea||0xc8;return function(_0x2188d9){if(_0x2188d9){return _0x27e57a[_0x9905('0x1d')](_0x516eea)[_0x9905('0x1e')](_0x2188d9);}};}function respondWithFilteredResult(_0x4b8897,_0x397303){return function(_0x26f847){if(_0x26f847){var _0x4796da=typeof _0x397303[_0x9905('0x1f')]===_0x9905('0x20')&&typeof _0x397303['limit']===_0x9905('0x20');var _0x1b54bb=_0x26f847[_0x9905('0x21')];var _0x1f0eba=_0x4796da?0x0:_0x397303['offset'];var _0xca0456=_0x4796da?_0x26f847[_0x9905('0x21')]:_0x397303[_0x9905('0x1f')]+_0x397303[_0x9905('0x22')];var _0x108a4d;if(_0xca0456>=_0x1b54bb){_0xca0456=_0x1b54bb;_0x108a4d=0xc8;}else{_0x108a4d=0xce;}_0x4b8897['status'](_0x108a4d);return _0x4b8897[_0x9905('0x23')](_0x9905('0x24'),_0x1f0eba+'-'+_0xca0456+'/'+_0x1b54bb)['json'](_0x26f847);}return null;};}function patchUpdates(_0x4b3f99){return function(_0x5dca80){try{jsonpatch[_0x9905('0x25')](_0x5dca80,_0x4b3f99,!![]);}catch(_0x57eb31){return BPromise[_0x9905('0x26')](_0x57eb31);}return _0x5dca80['save']();};}function saveUpdates(_0x1fb035,_0x48ad48){return function(_0x2333e7){if(_0x2333e7){return _0x2333e7[_0x9905('0x27')](_0x1fb035)[_0x9905('0x28')](function(_0x54d99d){return _0x54d99d;});}return null;};}function removeEntity(_0x46aeed,_0x524b9f){return function(_0x7dd0f8){if(_0x7dd0f8){return _0x7dd0f8[_0x9905('0x29')]()[_0x9905('0x28')](function(){_0x46aeed[_0x9905('0x1d')](0xcc)[_0x9905('0x1c')]();});}};}function handleEntityNotFound(_0xc88085,_0x371a12){return function(_0x59a5ed){if(!_0x59a5ed){_0xc88085[_0x9905('0x1b')](0x194);}return _0x59a5ed;};}function handleError(_0xf07ce6,_0x4f05ab){_0x4f05ab=_0x4f05ab||0x1f4;return function(_0x42526b){logger[_0x9905('0x2a')](_0x42526b[_0x9905('0x2b')]);if(_0x42526b[_0x9905('0x2c')]){delete _0x42526b[_0x9905('0x2c')];}_0xf07ce6['status'](_0x4f05ab)[_0x9905('0x2d')](_0x42526b);};}exports[_0x9905('0x2e')]=function(_0x58dfcc,_0x54ddf5){var _0x4d7c5b={},_0x31e78c={},_0x572f74={'count':0x0,'rows':[]};var _0x5b64a2=_['map'](db['ServicenowAccount']['rawAttributes'],function(_0x3edd78){return{'name':_0x3edd78[_0x9905('0x2f')],'type':_0x3edd78[_0x9905('0x30')][_0x9905('0x31')]};});_0x31e78c[_0x9905('0x32')]=_[_0x9905('0x33')](_0x5b64a2,_0x9905('0x2c'));_0x31e78c[_0x9905('0x34')]=_[_0x9905('0x35')](_0x58dfcc[_0x9905('0x34')]);_0x31e78c[_0x9905('0x36')]=_[_0x9905('0x37')](_0x31e78c[_0x9905('0x32')],_0x31e78c['query']);_0x4d7c5b['attributes']=_[_0x9905('0x37')](_0x31e78c[_0x9905('0x32')],qs[_0x9905('0x38')](_0x58dfcc['query']['fields']));_0x4d7c5b[_0x9905('0x39')]=_0x4d7c5b['attributes'][_0x9905('0x3a')]?_0x4d7c5b[_0x9905('0x39')]:_0x31e78c[_0x9905('0x32')];if(!_0x58dfcc[_0x9905('0x34')][_0x9905('0x3b')](_0x9905('0x3c'))){_0x4d7c5b[_0x9905('0x22')]=qs[_0x9905('0x22')](_0x58dfcc[_0x9905('0x34')][_0x9905('0x22')]);_0x4d7c5b[_0x9905('0x1f')]=qs[_0x9905('0x1f')](_0x58dfcc[_0x9905('0x34')][_0x9905('0x1f')]);}_0x4d7c5b['order']=qs[_0x9905('0x3d')](_0x58dfcc[_0x9905('0x34')][_0x9905('0x3d')]);_0x4d7c5b[_0x9905('0x3e')]=qs[_0x9905('0x36')](_[_0x9905('0x3f')](_0x58dfcc[_0x9905('0x34')],_0x31e78c[_0x9905('0x36')]),_0x5b64a2);if(_0x58dfcc[_0x9905('0x34')][_0x9905('0x40')]){_0x4d7c5b[_0x9905('0x3e')]=_[_0x9905('0x41')](_0x4d7c5b[_0x9905('0x3e')],{'$or':_[_0x9905('0x33')](_0x5b64a2,function(_0xe2346a){if(_0xe2346a[_0x9905('0x30')]!==_0x9905('0x42')){var _0x3348a3={};_0x3348a3[_0xe2346a[_0x9905('0x2c')]]={'$like':'%'+_0x58dfcc[_0x9905('0x34')][_0x9905('0x40')]+'%'};return _0x3348a3;}})});}_0x4d7c5b=_[_0x9905('0x41')]({},_0x4d7c5b,_0x58dfcc['options']);var _0x437191={'where':_0x4d7c5b[_0x9905('0x3e')]};return db[_0x9905('0x43')][_0x9905('0x21')](_0x437191)[_0x9905('0x28')](function(_0x4b5169){_0x572f74[_0x9905('0x21')]=_0x4b5169;if(_0x58dfcc['query'][_0x9905('0x44')]){_0x4d7c5b['include']=[{'all':!![]}];}return db['ServicenowAccount'][_0x9905('0x45')](_0x4d7c5b);})[_0x9905('0x28')](function(_0xf2b03c){_0x572f74[_0x9905('0x46')]=_0xf2b03c;return _0x572f74;})[_0x9905('0x28')](respondWithFilteredResult(_0x54ddf5,_0x4d7c5b))[_0x9905('0x47')](handleError(_0x54ddf5,null));};exports[_0x9905('0x48')]=function(_0x144bae,_0x5abdcc){var _0x22415b={'raw':![],'where':{'id':_0x144bae[_0x9905('0x49')]['id']}},_0x56ba7a={};_0x56ba7a['model']=_[_0x9905('0x35')](db[_0x9905('0x43')][_0x9905('0x4a')]);_0x56ba7a[_0x9905('0x34')]=_[_0x9905('0x35')](_0x144bae[_0x9905('0x34')]);_0x56ba7a[_0x9905('0x36')]=_[_0x9905('0x37')](_0x56ba7a[_0x9905('0x32')],_0x56ba7a[_0x9905('0x34')]);_0x22415b[_0x9905('0x39')]=_[_0x9905('0x37')](_0x56ba7a[_0x9905('0x32')],qs[_0x9905('0x38')](_0x144bae['query'][_0x9905('0x38')]));_0x22415b[_0x9905('0x39')]=_0x22415b['attributes']['length']?_0x22415b['attributes']:_0x56ba7a[_0x9905('0x32')];if(_0x144bae[_0x9905('0x34')]['includeAll']){_0x22415b[_0x9905('0x4b')]=[{'all':!![]}];}_0x22415b=_[_0x9905('0x41')]({},_0x22415b,_0x144bae['options']);return db[_0x9905('0x43')][_0x9905('0x4c')](_0x22415b)[_0x9905('0x28')](handleEntityNotFound(_0x5abdcc,null))['then'](respondWithResult(_0x5abdcc,null))[_0x9905('0x47')](handleError(_0x5abdcc,null));};exports[_0x9905('0x4d')]=function(_0x16536f,_0x1e8a38){return db[_0x9905('0x43')][_0x9905('0x4d')](_0x16536f[_0x9905('0x4e')],{})['then'](respondWithResult(_0x1e8a38,0xc9))['catch'](handleError(_0x1e8a38,null));};exports['update']=function(_0x3f323d,_0x4aa7da){if(_0x3f323d['body']['id']){delete _0x3f323d[_0x9905('0x4e')]['id'];}return db[_0x9905('0x43')]['find']({'where':{'id':_0x3f323d[_0x9905('0x49')]['id']}})[_0x9905('0x28')](handleEntityNotFound(_0x4aa7da,null))[_0x9905('0x28')](saveUpdates(_0x3f323d[_0x9905('0x4e')],null))[_0x9905('0x28')](respondWithResult(_0x4aa7da,null))[_0x9905('0x47')](handleError(_0x4aa7da,null));};exports[_0x9905('0x29')]=function(_0x5d9b3a,_0x434f72){return db[_0x9905('0x43')][_0x9905('0x4c')]({'where':{'id':_0x5d9b3a[_0x9905('0x49')]['id']}})['then'](handleEntityNotFound(_0x434f72,null))['then'](removeEntity(_0x434f72,null))[_0x9905('0x47')](handleError(_0x434f72,null));};exports[_0x9905('0x4f')]=function(_0x420b6f,_0x4ce423,_0x440419){var _0x27a11b={};var _0x1d0ecf={};var _0x2b1065;var _0x15b10d;return db[_0x9905('0x43')]['findOne']({'where':{'id':_0x420b6f[_0x9905('0x49')]['id']}})[_0x9905('0x28')](handleEntityNotFound(_0x4ce423,null))[_0x9905('0x28')](function(_0x50a773){if(_0x50a773){_0x2b1065=_0x50a773;_0x1d0ecf[_0x9905('0x32')]=_[_0x9905('0x35')](db[_0x9905('0x50')][_0x9905('0x4a')]);_0x1d0ecf[_0x9905('0x34')]=_['keys'](_0x420b6f[_0x9905('0x34')]);_0x1d0ecf['filters']=_[_0x9905('0x37')](_0x1d0ecf[_0x9905('0x32')],_0x1d0ecf[_0x9905('0x34')]);_0x27a11b['attributes']=_[_0x9905('0x37')](_0x1d0ecf['model'],qs[_0x9905('0x38')](_0x420b6f[_0x9905('0x34')][_0x9905('0x38')]));_0x27a11b[_0x9905('0x39')]=_0x27a11b[_0x9905('0x39')][_0x9905('0x3a')]?_0x27a11b[_0x9905('0x39')]:_0x1d0ecf[_0x9905('0x32')];_0x27a11b[_0x9905('0x51')]=qs[_0x9905('0x3d')](_0x420b6f['query']['sort']);_0x27a11b[_0x9905('0x3e')]=qs[_0x9905('0x36')](_[_0x9905('0x3f')](_0x420b6f[_0x9905('0x34')],_0x1d0ecf['filters']));if(_0x420b6f['query'][_0x9905('0x40')]){_0x27a11b[_0x9905('0x3e')]=_['merge'](_0x27a11b[_0x9905('0x3e')],{'$or':_[_0x9905('0x33')](_0x27a11b[_0x9905('0x39')],function(_0x270405){var _0x4c713a={};_0x4c713a[_0x270405]={'$like':'%'+_0x420b6f[_0x9905('0x34')]['filter']+'%'};return _0x4c713a;})});}_0x27a11b=_['merge']({},_0x27a11b,_0x420b6f[_0x9905('0x52')]);return _0x2b1065[_0x9905('0x4f')](_0x27a11b);}})[_0x9905('0x28')](function(_0x26a304){if(_0x26a304){_0x15b10d=_0x26a304[_0x9905('0x3a')];if(!_0x420b6f[_0x9905('0x34')][_0x9905('0x3b')](_0x9905('0x3c'))){_0x27a11b['limit']=qs[_0x9905('0x22')](_0x420b6f[_0x9905('0x34')][_0x9905('0x22')]);_0x27a11b[_0x9905('0x1f')]=qs[_0x9905('0x1f')](_0x420b6f[_0x9905('0x34')][_0x9905('0x1f')]);}return _0x2b1065[_0x9905('0x4f')](_0x27a11b);}})[_0x9905('0x28')](function(_0x3e9538){if(_0x3e9538){return _0x3e9538?{'count':_0x15b10d,'rows':_0x3e9538}:null;}})[_0x9905('0x28')](respondWithResult(_0x4ce423,null))['catch'](handleError(_0x4ce423,null));};exports['addConfiguration']=function(_0x5b6a42,_0x29747b,_0x5e1c72){if(_0x5b6a42[_0x9905('0x4e')]['id']){delete _0x5b6a42[_0x9905('0x4e')]['id'];}return db[_0x9905('0x43')][_0x9905('0x53')]({'where':{'id':_0x5b6a42[_0x9905('0x49')]['id']}})['then'](handleEntityNotFound(_0x29747b,null))['then'](function(_0x5c2387){if(_0x5c2387){_0x5b6a42['body'][_0x9905('0x54')]=_0x5c2387['id'];_0x5b6a42[_0x9905('0x4e')][_0x9905('0x55')]=integrations['getSubjects'](_0x5b6a42[_0x9905('0x4e')][_0x9905('0x56')],_0x5b6a42[_0x9905('0x4e')][_0x9905('0x30')]);_0x5b6a42[_0x9905('0x4e')][_0x9905('0x57')]=integrations[_0x9905('0x58')](_0x5b6a42['body']['channel'],_0x5b6a42['body'][_0x9905('0x30')]);return db[_0x9905('0x50')][_0x9905('0x4d')](_0x5b6a42['body'],{'include':[{'model':db[_0x9905('0x59')],'as':_0x9905('0x55')},{'model':db[_0x9905('0x59')],'as':_0x9905('0x57')}]});}return null;})[_0x9905('0x28')](respondWithResult(_0x29747b,null))[_0x9905('0x47')](handleError(_0x29747b,null));};exports[_0x9905('0x5a')]=function(_0x2addbc,_0x2a7eac,_0x43c643){var _0x3d7b55=[_0x9905('0x5b'),_0x9905('0x5c'),_0x9905('0x5d'),_0x9905('0x5e'),_0x9905('0x5f'),_0x9905('0x60'),_0x9905('0x61'),'severity','category'];var _0x3689ac=['parent',_0x9905('0x5b'),'caused_by',_0x9905('0x62'),_0x9905('0x63'),'sys_updated_on','child_incidents',_0x9905('0x5c'),_0x9905('0x64'),'number',_0x9905('0x65'),_0x9905('0x66'),_0x9905('0x67'),'user_input','sys_created_on',_0x9905('0x68'),_0x9905('0x69'),_0x9905('0x6a'),_0x9905('0x5d'),'order',_0x9905('0x6b'),'closed_at',_0x9905('0x6c'),_0x9905('0x6d'),'impact',_0x9905('0x6e'),_0x9905('0x6f'),_0x9905('0x70'),_0x9905('0x71'),'sys_domain_path',_0x9905('0x72'),'time_worked',_0x9905('0x73'),_0x9905('0x74'),'business_duration',_0x9905('0x75'),_0x9905('0x76'),_0x9905('0x77'),_0x9905('0x78'),_0x9905('0x79'),_0x9905('0x7a'),_0x9905('0x5e'),_0x9905('0x7b'),_0x9905('0x7c'),'close_code',_0x9905('0x7d'),_0x9905('0x7e'),_0x9905('0x7f'),_0x9905('0x80'),_0x9905('0x81'),_0x9905('0x82'),'description',_0x9905('0x83'),'notify','sys_class_name','close_notes','closed_by',_0x9905('0x84'),_0x9905('0x85'),_0x9905('0x86'),_0x9905('0x87'),_0x9905('0x88'),'incident_state',_0x9905('0x89'),_0x9905('0x8a'),_0x9905('0x8b'),_0x9905('0x8c'),'activity_due',_0x9905('0x8d'),_0x9905('0x8e'),_0x9905('0x8f'),'sla_due',_0x9905('0x90'),_0x9905('0x91'),_0x9905('0x92'),_0x9905('0x93'),_0x9905('0x94'),_0x9905('0x95'),_0x9905('0x96'),_0x9905('0x97'),_0x9905('0x98'),'location',_0x9905('0x99')];var _0x25283f='';var _0x10df12='';var _0x39aacf=[];var _0x1b2266='';var _0x22405e='';var _0x213937=[];var _0x5d4f3b='';var _0x1de463='';var _0x43f1ad={};var _0xa0268a='';return db[_0x9905('0x43')]['findOne']({'where':{'id':_0x2addbc['params']['id']},'attributes':['id','username',_0x9905('0x9a'),_0x9905('0x9b'),_0x9905('0x9c'),_0x9905('0x9d')]})[_0x9905('0x28')](handleEntityNotFound(_0x2a7eac,null))[_0x9905('0x28')](function(_0x4ad5ad){if(_0x4ad5ad){_0xa0268a=_0x4ad5ad[_0x9905('0x9c')];var _0x385457=_0xa0268a[_0x9905('0x9e')](-0x1);if(_0x385457==='/'){_0xa0268a=_0xa0268a[_0x9905('0x9f')](0x0,_0xa0268a[_0x9905('0xa0')](_0x385457));}_0x1de463=util['format']('%s/api/now/doc/table/schema/',_0xa0268a);_0x5d4f3b=util[_0x9905('0xa1')](_0x9905('0xa2'),_0xa0268a);_0x43f1ad={'user':_0x4ad5ad[_0x9905('0xa3')],'pass':_0x4ad5ad['password']};var _0x368a0d={'method':_0x9905('0xa4'),'uri':_0x1de463+'incident?sysparm_display_value=all','auth':_0x43f1ad,'json':!![]};return rp(_0x368a0d);}})[_0x9905('0x28')](function(_0x118b5a){if(_0x118b5a['result'][_0x9905('0x3a')]>0x0){_0x25283f=_0x118b5a['result'];}console['log'](_0x9905('0xa5'),_0x25283f);_0x213937=[];_0x10df12=Object[_0x9905('0xa6')]([],_0x25283f);_[_0x9905('0xa7')](_0x10df12,function(_0x25aec9){return!_0x3d7b55[_0x9905('0xa8')](_0x25aec9['name']);});_0x10df12['forEach'](function(_0x4cb9ef){var _0x453ab6=createFieldObject(_0x5d4f3b,_0x43f1ad,_0x4cb9ef[_0x9905('0xa9')],_0x4cb9ef[_0x9905('0x2c')],_0x4cb9ef[_0x9905('0xaa')],![]);_0x213937[_0x9905('0xab')](_0x453ab6);});return Promise[_0x9905('0xac')](_0x213937);})[_0x9905('0x28')](function(_0x47a94e){_0x39aacf=_0x47a94e;_0x1b2266=Object[_0x9905('0xa6')]([],_0x25283f);console[_0x9905('0xad')](_0x9905('0xae'),_0x25283f);_[_0x9905('0xa7')](_0x1b2266,function(_0x5cd2f3){return _0x3689ac['includes'](_0x5cd2f3[_0x9905('0x2c')]);});console[_0x9905('0xad')](_0x9905('0xaf'),_0x1b2266);_0x213937=[];_0x1b2266[_0x9905('0xb0')](function(_0x1950af){var _0x82fc40=createFieldObject(_0x5d4f3b,_0x43f1ad,_0x1950af['internalType'],_0x1950af[_0x9905('0x2c')],_0x1950af[_0x9905('0xaa')],!![]);_0x213937[_0x9905('0xab')](_0x82fc40);});return Promise[_0x9905('0xac')](_0x213937);})[_0x9905('0x28')](function(_0xa3a43f){_0x22405e=_0xa3a43f;var _0x3ec289=_0x39aacf['concat'](_0x22405e);return{'count':_0x3ec289[_0x9905('0x3a')],'rows':_0x3ec289};})[_0x9905('0x28')](respondWithResult(_0x2a7eac,null))['catch'](function(_0x344db1){console[_0x9905('0xad')]('ServiceNow\x20error:\x20'+_0x344db1);var _0x3bc255=_0x2addbc[_0x9905('0x34')][_0x9905('0xb1')]?0x1f4:_0x344db1[_0x9905('0xb2')]||0x1f4;logger[_0x9905('0x2a')](_0x344db1[_0x9905('0x2b')]);delete _0x344db1[_0x9905('0x2c')];if(_0x3bc255===0x191){_0x3bc255=0x190;}_0x2a7eac[_0x9905('0x1d')](_0x3bc255)[_0x9905('0x2d')](_0x2addbc[_0x9905('0x34')]['test']?{'message':_0x9905('0xb3'),'statusCode':_0x344db1[_0x9905('0xb2')]}:_0x344db1);});};function createFieldObject(_0xb95b91,_0x4e83ad,_0x524f39,_0x52ec19,_0x2873d1,_0x495d73){return new Promise(function(_0x4e945e,_0x58a103){var _0x1fd0c1={'id':_0x52ec19,'name':_0x2873d1,'custom':_0x495d73};if(_0x524f39===_0x9905('0xb4')){_0x1fd0c1[_0x9905('0x52')]=[{'name':_0x9905('0xb5'),'value':_0x9905('0xb6')},{'name':_0x9905('0xb7'),'value':_0x9905('0xb8')}];_0x4e945e(_0x1fd0c1);}else{var _0x168abe={'method':_0x9905('0xa4'),'uri':_0xb95b91+'sys_choice?sysparm_query=name=incident^element='+_0x52ec19,'auth':_0x4e83ad,'json':!![]};return rp(_0x168abe)[_0x9905('0x28')](function(_0x7ee5ed){var _0x46d025=[];if(_0x7ee5ed['result'][_0x9905('0x3a')]>0x0){_0x7ee5ed['result'][_0x9905('0xb0')](function(_0x86aad5){if(_0x86aad5[_0x9905('0xb9')]===_0x9905('0xb8')){var _0x23b7c4={'name':_0x86aad5[_0x9905('0xaa')],'value':_0x86aad5[_0x9905('0xba')]};_0x46d025[_0x9905('0xab')](_0x23b7c4);}});}_0x1fd0c1[_0x9905('0x52')]=_0x46d025;if(_0x1fd0c1['options'][_0x9905('0x3a')]>0x0){_0x4e945e(_0x1fd0c1);}else{if(_0x495d73==![]){_0x4e945e();}else{_0x4e945e(_0x1fd0c1);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index 45b78b0..fcfe864 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 _0xba34=['./intServicenowAccount.attributes','../../components/integrations/configuration','exports','ServicenowAccount','int_servicenow_accounts','lodash','util','../../config/logger','api','moment','rimraf','../../config/environment'];(function(_0x424cc7,_0x47386f){var _0x180167=function(_0x4a0c13){while(--_0x4a0c13){_0x424cc7['push'](_0x424cc7['shift']());}};_0x180167(++_0x47386f);}(_0xba34,0x119));var _0x4ba3=function(_0x4aa954,_0x70a67b){_0x4aa954=_0x4aa954-0x0;var _0x3ea2cd=_0xba34[_0x4aa954];return _0x3ea2cd;};'use strict';var _=require(_0x4ba3('0x0'));var util=require(_0x4ba3('0x1'));var logger=require(_0x4ba3('0x2'))(_0x4ba3('0x3'));var moment=require(_0x4ba3('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x4ba3('0x5'));var config=require(_0x4ba3('0x6'));var attributes=require(_0x4ba3('0x7'));var integrations=require(_0x4ba3('0x8'));module[_0x4ba3('0x9')]=function(_0xb88621,_0xe5f99a){return _0xb88621['define'](_0x4ba3('0xa'),attributes,{'tableName':_0x4ba3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xafc4=['path','../../components/integrations/configuration','exports','define','ServicenowAccount','lodash','../../config/logger','moment','bluebird','request-promise'];(function(_0x51eaf2,_0x5f1779){var _0x2b0e99=function(_0x291739){while(--_0x291739){_0x51eaf2['push'](_0x51eaf2['shift']());}};_0x2b0e99(++_0x5f1779);}(_0xafc4,0x69));var _0x4afc=function(_0x37f2f9,_0x662e94){_0x37f2f9=_0x37f2f9-0x0;var _0x1b3e97=_0xafc4[_0x37f2f9];return _0x1b3e97;};'use strict';var _=require(_0x4afc('0x0'));var util=require('util');var logger=require(_0x4afc('0x1'))('api');var moment=require(_0x4afc('0x2'));var BPromise=require(_0x4afc('0x3'));var rp=require(_0x4afc('0x4'));var fs=require('fs');var path=require(_0x4afc('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intServicenowAccount.attributes');var integrations=require(_0x4afc('0x6'));module[_0x4afc('0x7')]=function(_0x16953b,_0x1bb281){return _0x16953b[_0x4afc('0x8')](_0x4afc('0x9'),attributes,{'tableName':'int_servicenow_accounts','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 17ffc6a..319743d 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 _0x7803=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','ServicenowAccount,\x20%s,\x20%s','ServicenowAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','ServicenowAccount','findAll','options','raw','attributes','include','map','model','GetServicenowAccount','debug','stringify','ShowServicenowAccount','find','where','util','bluebird'];(function(_0x3dc4d4,_0x1840ac){var _0x460917=function(_0x32e107){while(--_0x32e107){_0x3dc4d4['push'](_0x3dc4d4['shift']());}};_0x460917(++_0x1840ac);}(_0x7803,0x67));var _0x3780=function(_0xcb34ac,_0x3f7426){_0xcb34ac=_0xcb34ac-0x0;var _0x3b1a80=_0x7803[_0xcb34ac];return _0x3b1a80;};'use strict';var _=require('lodash');var util=require(_0x3780('0x0'));var moment=require('moment');var BPromise=require(_0x3780('0x1'));var rs=require(_0x3780('0x2'));var fs=require('fs');var Redis=require(_0x3780('0x3'));var db=require(_0x3780('0x4'))['db'];var utils=require(_0x3780('0x5'));var logger=require('../../config/logger')(_0x3780('0x6'));var config=require(_0x3780('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x3780('0x8')][_0x3780('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x34a1be,_0x183e24,_0x12e1d1){return new BPromise(function(_0x5e1b24,_0x277eb1){return client[_0x3780('0xa')](_0x34a1be,_0x12e1d1)[_0x3780('0xb')](function(_0x240c8a){logger[_0x3780('0xc')](_0x3780('0xd'),_0x183e24,'request\x20sent');logger['debug'](_0x3780('0xe'),_0x183e24,_0x3780('0xf'),JSON['stringify'](_0x240c8a));if(_0x240c8a[_0x3780('0x10')]){if(_0x240c8a[_0x3780('0x10')][_0x3780('0x11')]===0x1f4){logger[_0x3780('0x10')](_0x3780('0xd'),_0x183e24,_0x240c8a[_0x3780('0x10')][_0x3780('0x12')]);return _0x277eb1(_0x240c8a[_0x3780('0x10')][_0x3780('0x12')]);}logger[_0x3780('0x10')](_0x3780('0xd'),_0x183e24,_0x240c8a[_0x3780('0x10')][_0x3780('0x12')]);return _0x5e1b24(_0x240c8a[_0x3780('0x10')][_0x3780('0x12')]);}else{logger['info'](_0x3780('0xd'),_0x183e24,_0x3780('0xf'));_0x5e1b24(_0x240c8a[_0x3780('0x13')][_0x3780('0x12')]);}})[_0x3780('0x14')](function(_0x182fe6){logger[_0x3780('0x10')](_0x3780('0xd'),_0x183e24,_0x182fe6);_0x277eb1(_0x182fe6);});});}exports['GetServicenowAccount']=function(_0xd64381){var _0x3cb503=this;return new Promise(function(_0x10ec43,_0x58363d){return db[_0x3780('0x15')][_0x3780('0x16')]({'raw':_0xd64381[_0x3780('0x17')]?_0xd64381[_0x3780('0x17')][_0x3780('0x18')]===undefined?!![]:![]:!![],'where':_0xd64381[_0x3780('0x17')]?_0xd64381[_0x3780('0x17')]['where']||null:null,'attributes':_0xd64381[_0x3780('0x17')]?_0xd64381[_0x3780('0x17')][_0x3780('0x19')]||null:null,'limit':_0xd64381[_0x3780('0x17')]?_0xd64381[_0x3780('0x17')]['limit']||null:null,'include':_0xd64381[_0x3780('0x17')]?_0xd64381[_0x3780('0x17')][_0x3780('0x1a')]?_[_0x3780('0x1b')](_0xd64381['options'][_0x3780('0x1a')],function(_0x117275){return{'model':db[_0x117275[_0x3780('0x1c')]],'as':_0x117275['as'],'attributes':_0x117275['attributes'],'include':_0x117275['include']?_[_0x3780('0x1b')](_0x117275[_0x3780('0x1a')],function(_0x3071ee){return{'model':db[_0x3071ee[_0x3780('0x1c')]],'as':_0x3071ee['as'],'attributes':_0x3071ee[_0x3780('0x19')],'include':_0x3071ee[_0x3780('0x1a')]?_['map'](_0x3071ee[_0x3780('0x1a')],function(_0x556fed){return{'model':db[_0x556fed['model']],'as':_0x556fed['as'],'attributes':_0x556fed['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x34a84c){logger[_0x3780('0xc')](_0x3780('0x1d'),_0xd64381);logger[_0x3780('0x1e')]('GetServicenowAccount',_0xd64381,JSON[_0x3780('0x1f')](_0x34a84c));_0x10ec43(_0x34a84c);})[_0x3780('0x14')](function(_0x1ea61d){logger[_0x3780('0x10')](_0x3780('0x1d'),_0x1ea61d[_0x3780('0x12')],_0xd64381);_0x58363d(_0x3cb503[_0x3780('0x10')](0x1f4,_0x1ea61d[_0x3780('0x12')]));});});};exports[_0x3780('0x20')]=function(_0x53c8f8){var _0x161507=this;return new Promise(function(_0x3b83ba,_0x27acba){return db[_0x3780('0x15')][_0x3780('0x21')]({'raw':_0x53c8f8[_0x3780('0x17')]?_0x53c8f8['options'][_0x3780('0x18')]===undefined?!![]:![]:!![],'where':_0x53c8f8[_0x3780('0x17')]?_0x53c8f8[_0x3780('0x17')][_0x3780('0x22')]||null:null,'attributes':_0x53c8f8['options']?_0x53c8f8[_0x3780('0x17')][_0x3780('0x19')]||null:null,'include':_0x53c8f8[_0x3780('0x17')]?_0x53c8f8[_0x3780('0x17')][_0x3780('0x1a')]?_[_0x3780('0x1b')](_0x53c8f8[_0x3780('0x17')][_0x3780('0x1a')],function(_0x28b4ac){return{'model':db[_0x28b4ac[_0x3780('0x1c')]],'as':_0x28b4ac['as'],'attributes':_0x28b4ac[_0x3780('0x19')],'include':_0x28b4ac[_0x3780('0x1a')]?_[_0x3780('0x1b')](_0x28b4ac[_0x3780('0x1a')],function(_0x2a76ec){return{'model':db[_0x2a76ec[_0x3780('0x1c')]],'as':_0x2a76ec['as'],'attributes':_0x2a76ec[_0x3780('0x19')],'include':_0x2a76ec[_0x3780('0x1a')]?_[_0x3780('0x1b')](_0x2a76ec[_0x3780('0x1a')],function(_0x439e6a){return{'model':db[_0x439e6a[_0x3780('0x1c')]],'as':_0x439e6a['as'],'attributes':_0x439e6a['attributes']};}):[]};}):[]};}):[]:[]})[_0x3780('0xb')](function(_0x36bd1b){logger[_0x3780('0xc')](_0x3780('0x20'),_0x53c8f8);logger[_0x3780('0x1e')]('ShowServicenowAccount',_0x53c8f8,JSON['stringify'](_0x36bd1b));_0x3b83ba(_0x36bd1b);})['catch'](function(_0x4556ad){logger[_0x3780('0x10')](_0x3780('0x20'),_0x4556ad[_0x3780('0x12')],_0x53c8f8);_0x27acba(_0x161507[_0x3780('0x10')](0x1f4,_0x4556ad[_0x3780('0x12')]));});});}; \ No newline at end of file +var _0x9caa=['rpc','../../config/environment','jayson/promise','client','http','request','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','GetServicenowAccount','options','raw','where','attributes','limit','include','model','debug','catch','ServicenowAccount','find','map','then','ShowServicenowAccount','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x113982,_0x597be2){var _0x13ff92=function(_0x344be9){while(--_0x344be9){_0x113982['push'](_0x113982['shift']());}};_0x13ff92(++_0x597be2);}(_0x9caa,0x135));var _0xa9ca=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x9caa[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0xa9ca('0x0'));var util=require(_0xa9ca('0x1'));var moment=require('moment');var BPromise=require(_0xa9ca('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa9ca('0x3'))['db'];var utils=require(_0xa9ca('0x4'));var logger=require(_0xa9ca('0x5'))(_0xa9ca('0x6'));var config=require(_0xa9ca('0x7'));var jayson=require(_0xa9ca('0x8'));var client=jayson[_0xa9ca('0x9')][_0xa9ca('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x48bb27,_0x58c2ed,_0x2f1e2b){return new BPromise(function(_0x518331,_0x3e61cc){return client[_0xa9ca('0xb')](_0x48bb27,_0x2f1e2b)['then'](function(_0x3c4fc8){logger[_0xa9ca('0xc')](_0xa9ca('0xd'),_0x58c2ed,_0xa9ca('0xe'));logger['debug']('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0x58c2ed,_0xa9ca('0xe'),JSON[_0xa9ca('0xf')](_0x3c4fc8));if(_0x3c4fc8[_0xa9ca('0x10')]){if(_0x3c4fc8['error'][_0xa9ca('0x11')]===0x1f4){logger['error'](_0xa9ca('0xd'),_0x58c2ed,_0x3c4fc8[_0xa9ca('0x10')]['message']);return _0x3e61cc(_0x3c4fc8[_0xa9ca('0x10')][_0xa9ca('0x12')]);}logger['error'](_0xa9ca('0xd'),_0x58c2ed,_0x3c4fc8[_0xa9ca('0x10')]['message']);return _0x518331(_0x3c4fc8[_0xa9ca('0x10')][_0xa9ca('0x12')]);}else{logger[_0xa9ca('0xc')](_0xa9ca('0xd'),_0x58c2ed,_0xa9ca('0xe'));_0x518331(_0x3c4fc8[_0xa9ca('0x13')][_0xa9ca('0x12')]);}})['catch'](function(_0x140d63){logger[_0xa9ca('0x10')](_0xa9ca('0xd'),_0x58c2ed,_0x140d63);_0x3e61cc(_0x140d63);});});}exports[_0xa9ca('0x14')]=function(_0x17ca55){var _0x538b81=this;return new Promise(function(_0x1d6675,_0x5decb5){return db['ServicenowAccount']['findAll']({'raw':_0x17ca55['options']?_0x17ca55[_0xa9ca('0x15')][_0xa9ca('0x16')]===undefined?!![]:![]:!![],'where':_0x17ca55['options']?_0x17ca55[_0xa9ca('0x15')][_0xa9ca('0x17')]||null:null,'attributes':_0x17ca55['options']?_0x17ca55['options'][_0xa9ca('0x18')]||null:null,'limit':_0x17ca55[_0xa9ca('0x15')]?_0x17ca55[_0xa9ca('0x15')][_0xa9ca('0x19')]||null:null,'include':_0x17ca55[_0xa9ca('0x15')]?_0x17ca55[_0xa9ca('0x15')][_0xa9ca('0x1a')]?_['map'](_0x17ca55[_0xa9ca('0x15')][_0xa9ca('0x1a')],function(_0x2da105){return{'model':db[_0x2da105[_0xa9ca('0x1b')]],'as':_0x2da105['as'],'attributes':_0x2da105['attributes'],'include':_0x2da105[_0xa9ca('0x1a')]?_['map'](_0x2da105[_0xa9ca('0x1a')],function(_0xf7c762){return{'model':db[_0xf7c762[_0xa9ca('0x1b')]],'as':_0xf7c762['as'],'attributes':_0xf7c762[_0xa9ca('0x18')],'include':_0xf7c762[_0xa9ca('0x1a')]?_['map'](_0xf7c762[_0xa9ca('0x1a')],function(_0x52ee21){return{'model':db[_0x52ee21[_0xa9ca('0x1b')]],'as':_0x52ee21['as'],'attributes':_0x52ee21['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3bc925){logger[_0xa9ca('0xc')]('GetServicenowAccount',_0x17ca55);logger[_0xa9ca('0x1c')]('GetServicenowAccount',_0x17ca55,JSON['stringify'](_0x3bc925));_0x1d6675(_0x3bc925);})[_0xa9ca('0x1d')](function(_0x5c54ae){logger[_0xa9ca('0x10')](_0xa9ca('0x14'),_0x5c54ae['message'],_0x17ca55);_0x5decb5(_0x538b81[_0xa9ca('0x10')](0x1f4,_0x5c54ae[_0xa9ca('0x12')]));});});};exports['ShowServicenowAccount']=function(_0x2cf529){var _0x20b98f=this;return new Promise(function(_0x199360,_0x3cf64c){return db[_0xa9ca('0x1e')][_0xa9ca('0x1f')]({'raw':_0x2cf529[_0xa9ca('0x15')]?_0x2cf529[_0xa9ca('0x15')][_0xa9ca('0x16')]===undefined?!![]:![]:!![],'where':_0x2cf529['options']?_0x2cf529[_0xa9ca('0x15')][_0xa9ca('0x17')]||null:null,'attributes':_0x2cf529[_0xa9ca('0x15')]?_0x2cf529[_0xa9ca('0x15')][_0xa9ca('0x18')]||null:null,'include':_0x2cf529[_0xa9ca('0x15')]?_0x2cf529['options'][_0xa9ca('0x1a')]?_[_0xa9ca('0x20')](_0x2cf529['options'][_0xa9ca('0x1a')],function(_0x593276){return{'model':db[_0x593276['model']],'as':_0x593276['as'],'attributes':_0x593276[_0xa9ca('0x18')],'include':_0x593276[_0xa9ca('0x1a')]?_[_0xa9ca('0x20')](_0x593276[_0xa9ca('0x1a')],function(_0x52ea14){return{'model':db[_0x52ea14[_0xa9ca('0x1b')]],'as':_0x52ea14['as'],'attributes':_0x52ea14[_0xa9ca('0x18')],'include':_0x52ea14[_0xa9ca('0x1a')]?_[_0xa9ca('0x20')](_0x52ea14['include'],function(_0x177eea){return{'model':db[_0x177eea[_0xa9ca('0x1b')]],'as':_0x177eea['as'],'attributes':_0x177eea['attributes']};}):[]};}):[]};}):[]:[]})[_0xa9ca('0x21')](function(_0x168319){logger['info'](_0xa9ca('0x22'),_0x2cf529);logger['debug'](_0xa9ca('0x22'),_0x2cf529,JSON[_0xa9ca('0xf')](_0x168319));_0x199360(_0x168319);})['catch'](function(_0x1853c1){logger[_0xa9ca('0x10')]('ShowServicenowAccount',_0x1853c1[_0xa9ca('0x12')],_0x2cf529);_0x3cf64c(_0x20b98f[_0xa9ca('0x10')](0x1f4,_0x1853c1[_0xa9ca('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index 1e587f9..a3b9219 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 _0xdb29=['/:id/fields','getFields','getDescriptions','create','put','delete','/:id','destroy','exports','util','path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','./intServicenowConfiguration.controller','get','isAuthenticated','show'];(function(_0xa04b18,_0xbf67ec){var _0x5ac1af=function(_0x187d0b){while(--_0x187d0b){_0xa04b18['push'](_0xa04b18['shift']());}};_0x5ac1af(++_0xbf67ec);}(_0xdb29,0x7b));var _0x9db2=function(_0x10c7c1,_0x3f538c){_0x10c7c1=_0x10c7c1-0x0;var _0x16627b=_0xdb29[_0x10c7c1];return _0x16627b;};'use strict';var multer=require('multer');var util=require(_0x9db2('0x0'));var path=require(_0x9db2('0x1'));var timeout=require(_0x9db2('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x9db2('0x3'));var auth=require(_0x9db2('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x9db2('0x5'));var controller=require(_0x9db2('0x6'));router[_0x9db2('0x7')]('/',auth[_0x9db2('0x8')](),controller['index']);router[_0x9db2('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x9db2('0x9')]);router[_0x9db2('0x7')](_0x9db2('0xa'),auth[_0x9db2('0x8')](),controller[_0x9db2('0xb')]);router[_0x9db2('0x7')]('/:id/subjects',auth[_0x9db2('0x8')](),controller['getSubjects']);router[_0x9db2('0x7')]('/:id/descriptions',auth[_0x9db2('0x8')](),controller[_0x9db2('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x9db2('0xd')]);router[_0x9db2('0xe')]('/:id',auth[_0x9db2('0x8')](),controller['update']);router[_0x9db2('0xf')](_0x9db2('0x10'),auth[_0x9db2('0x8')](),controller[_0x9db2('0x11')]);module[_0x9db2('0x12')]=router; \ No newline at end of file +var _0x2597=['create','put','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','get','index','/:id','show','/:id/fields','isAuthenticated','getFields','getSubjects','/:id/descriptions','getDescriptions','post'];(function(_0x2cc569,_0x4e9568){var _0x1bfc2e=function(_0x5b8fcb){while(--_0x5b8fcb){_0x2cc569['push'](_0x2cc569['shift']());}};_0x1bfc2e(++_0x4e9568);}(_0x2597,0x13c));var _0x7259=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x2597[_0x42cae2];return _0x5f256f;};'use strict';var multer=require('multer');var util=require(_0x7259('0x0'));var path=require(_0x7259('0x1'));var timeout=require(_0x7259('0x2'));var express=require(_0x7259('0x3'));var router=express[_0x7259('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x7259('0x5'));var interaction=require(_0x7259('0x6'));var config=require(_0x7259('0x7'));var controller=require(_0x7259('0x8'));router[_0x7259('0x9')]('/',auth['isAuthenticated'](),controller[_0x7259('0xa')]);router[_0x7259('0x9')](_0x7259('0xb'),auth['isAuthenticated'](),controller[_0x7259('0xc')]);router[_0x7259('0x9')](_0x7259('0xd'),auth[_0x7259('0xe')](),controller[_0x7259('0xf')]);router[_0x7259('0x9')]('/:id/subjects',auth['isAuthenticated'](),controller[_0x7259('0x10')]);router[_0x7259('0x9')](_0x7259('0x11'),auth[_0x7259('0xe')](),controller[_0x7259('0x12')]);router[_0x7259('0x13')]('/',auth[_0x7259('0xe')](),controller[_0x7259('0x14')]);router[_0x7259('0x15')]('/:id',auth[_0x7259('0xe')](),controller['update']);router['delete'](_0x7259('0xb'),auth[_0x7259('0xe')](),controller[_0x7259('0x16')]);module[_0x7259('0x17')]=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index f941724..5badd9f 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 _0x2993=['exports','STRING','sequelize'];(function(_0x580c9d,_0x1031f3){var _0x24703a=function(_0x4f7744){while(--_0x4f7744){_0x580c9d['push'](_0x580c9d['shift']());}};_0x24703a(++_0x1031f3);}(_0x2993,0x158));var _0x3299=function(_0x292b7a,_0x442c41){_0x292b7a=_0x292b7a-0x0;var _0x4b0f45=_0x2993[_0x292b7a];return _0x4b0f45;};'use strict';var Sequelize=require(_0x3299('0x0'));module[_0x3299('0x1')]={'name':{'type':Sequelize[_0x3299('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x0495=['exports','STRING','sequelize'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0x0495,0x86));var _0x5049=function(_0x4591f7,_0x5bbb1d){_0x4591f7=_0x4591f7-0x0;var _0x2062bc=_0x0495[_0x4591f7];return _0x2062bc;};'use strict';var Sequelize=require(_0x5049('0x0'));module[_0x5049('0x1')]={'name':{'type':Sequelize[_0x5049('0x2')]},'description':{'type':Sequelize[_0x5049('0x2')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index 44c4d02..1e50c70 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 _0x2785=['undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','ServicenowConfiguration','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','include','rows','catch','params','options','find','create','body','findOne','ServicenowField','pick','getFields','getSubjects','getDescriptions','rimraf','fast-json-patch','request-promise','moment','mustache','util','to-csv','ejs','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','limit'];(function(_0x167c96,_0x56493c){var _0x575f47=function(_0x479847){while(--_0x479847){_0x167c96['push'](_0x167c96['shift']());}};_0x575f47(++_0x56493c);}(_0x2785,0xd1));var _0x5278=function(_0x487a72,_0x4ee2df){_0x487a72=_0x487a72-0x0;var _0xcd3559=_0x2785[_0x487a72];return _0xcd3559;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5278('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5278('0x1'));var rp=require(_0x5278('0x2'));var moment=require(_0x5278('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5278('0x4'));var util=require(_0x5278('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x5278('0x6'));var ejs=require(_0x5278('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x5278('0x8'));var deskjs=require(_0x5278('0x9'));var toCsv=require(_0x5278('0x6'));var querystring=require(_0x5278('0xa'));var Papa=require(_0x5278('0xb'));var Redis=require(_0x5278('0xc'));var authService=require(_0x5278('0xd'));var qs=require(_0x5278('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5278('0xf'));var logger=require(_0x5278('0x10'))(_0x5278('0x11'));var utils=require('../../config/utils');var config=require(_0x5278('0x12'));var licenseUtil=require(_0x5278('0x13'));var db=require(_0x5278('0x14'))['db'];function respondWithStatusCode(_0x22126d,_0x392987){_0x392987=_0x392987||0xcc;return function(_0xc311ef){if(_0xc311ef){return _0x22126d['sendStatus'](_0x392987);}return _0x22126d[_0x5278('0x15')](_0x392987)['end']();};}function respondWithResult(_0x2b5138,_0x8c7c0c){_0x8c7c0c=_0x8c7c0c||0xc8;return function(_0x56192d){if(_0x56192d){return _0x2b5138[_0x5278('0x15')](_0x8c7c0c)[_0x5278('0x16')](_0x56192d);}};}function respondWithFilteredResult(_0x19549c,_0x5a6bd4){return function(_0x58cb49){if(_0x58cb49){var _0x39f48a=typeof _0x5a6bd4[_0x5278('0x17')]==='undefined'&&typeof _0x5a6bd4[_0x5278('0x18')]===_0x5278('0x19');var _0x593694=_0x58cb49[_0x5278('0x1a')];var _0x30d475=_0x39f48a?0x0:_0x5a6bd4[_0x5278('0x17')];var _0x32ca99=_0x39f48a?_0x58cb49[_0x5278('0x1a')]:_0x5a6bd4[_0x5278('0x17')]+_0x5a6bd4['limit'];var _0x54a5f6;if(_0x32ca99>=_0x593694){_0x32ca99=_0x593694;_0x54a5f6=0xc8;}else{_0x54a5f6=0xce;}_0x19549c[_0x5278('0x15')](_0x54a5f6);return _0x19549c[_0x5278('0x1b')](_0x5278('0x1c'),_0x30d475+'-'+_0x32ca99+'/'+_0x593694)[_0x5278('0x16')](_0x58cb49);}return null;};}function patchUpdates(_0x9c2d0e){return function(_0x3f84ac){try{jsonpatch[_0x5278('0x1d')](_0x3f84ac,_0x9c2d0e,!![]);}catch(_0x9684dc){return BPromise[_0x5278('0x1e')](_0x9684dc);}return _0x3f84ac[_0x5278('0x1f')]();};}function saveUpdates(_0x2d3835,_0x5c57a1){return function(_0x5b8e2f){if(_0x5b8e2f){return _0x5b8e2f[_0x5278('0x20')](_0x2d3835)[_0x5278('0x21')](function(_0x172c64){return _0x172c64;});}return null;};}function removeEntity(_0x584452,_0x5c22e5){return function(_0x281a19){if(_0x281a19){return _0x281a19[_0x5278('0x22')]()['then'](function(){_0x584452['status'](0xcc)[_0x5278('0x23')]();});}};}function handleEntityNotFound(_0x5cdc1d,_0x493a55){return function(_0x3f45ba){if(!_0x3f45ba){_0x5cdc1d['sendStatus'](0x194);}return _0x3f45ba;};}function handleError(_0x5406f7,_0x159cf1){_0x159cf1=_0x159cf1||0x1f4;return function(_0x35ed6a){logger[_0x5278('0x24')](_0x35ed6a[_0x5278('0x25')]);if(_0x35ed6a[_0x5278('0x26')]){delete _0x35ed6a[_0x5278('0x26')];}_0x5406f7[_0x5278('0x15')](_0x159cf1)[_0x5278('0x27')](_0x35ed6a);};}exports[_0x5278('0x28')]=function(_0x2849c9,_0x225067){var _0x301a15={},_0x5bba5b={},_0x5e482a={'count':0x0,'rows':[]};var _0x3aab8f=_['map'](db[_0x5278('0x29')][_0x5278('0x2a')],function(_0x2f0f70){return{'name':_0x2f0f70[_0x5278('0x2b')],'type':_0x2f0f70[_0x5278('0x2c')][_0x5278('0x2d')]};});_0x5bba5b[_0x5278('0x2e')]=_[_0x5278('0x2f')](_0x3aab8f,_0x5278('0x26'));_0x5bba5b[_0x5278('0x30')]=_[_0x5278('0x31')](_0x2849c9[_0x5278('0x30')]);_0x5bba5b[_0x5278('0x32')]=_[_0x5278('0x33')](_0x5bba5b[_0x5278('0x2e')],_0x5bba5b['query']);_0x301a15[_0x5278('0x34')]=_[_0x5278('0x33')](_0x5bba5b[_0x5278('0x2e')],qs[_0x5278('0x35')](_0x2849c9[_0x5278('0x30')][_0x5278('0x35')]));_0x301a15[_0x5278('0x34')]=_0x301a15[_0x5278('0x34')][_0x5278('0x36')]?_0x301a15['attributes']:_0x5bba5b[_0x5278('0x2e')];if(!_0x2849c9['query'][_0x5278('0x37')](_0x5278('0x38'))){_0x301a15[_0x5278('0x18')]=qs['limit'](_0x2849c9[_0x5278('0x30')][_0x5278('0x18')]);_0x301a15[_0x5278('0x17')]=qs[_0x5278('0x17')](_0x2849c9[_0x5278('0x30')][_0x5278('0x17')]);}_0x301a15[_0x5278('0x39')]=qs[_0x5278('0x3a')](_0x2849c9['query'][_0x5278('0x3a')]);_0x301a15[_0x5278('0x3b')]=qs[_0x5278('0x32')](_['pick'](_0x2849c9[_0x5278('0x30')],_0x5bba5b[_0x5278('0x32')]),_0x3aab8f);if(_0x2849c9[_0x5278('0x30')][_0x5278('0x3c')]){_0x301a15[_0x5278('0x3b')]=_[_0x5278('0x3d')](_0x301a15[_0x5278('0x3b')],{'$or':_[_0x5278('0x2f')](_0x3aab8f,function(_0x27b8c7){if(_0x27b8c7[_0x5278('0x2c')]!==_0x5278('0x3e')){var _0x3423e6={};_0x3423e6[_0x27b8c7[_0x5278('0x26')]]={'$like':'%'+_0x2849c9[_0x5278('0x30')][_0x5278('0x3c')]+'%'};return _0x3423e6;}})});}_0x301a15=_['merge']({},_0x301a15,_0x2849c9['options']);var _0x12140c={'where':_0x301a15['where']};return db[_0x5278('0x29')][_0x5278('0x1a')](_0x12140c)[_0x5278('0x21')](function(_0x346a24){_0x5e482a[_0x5278('0x1a')]=_0x346a24;if(_0x2849c9['query'][_0x5278('0x3f')]){_0x301a15[_0x5278('0x40')]=[{'all':!![]}];}return db[_0x5278('0x29')]['findAll'](_0x301a15);})[_0x5278('0x21')](function(_0x42f84f){_0x5e482a[_0x5278('0x41')]=_0x42f84f;return _0x5e482a;})[_0x5278('0x21')](respondWithFilteredResult(_0x225067,_0x301a15))[_0x5278('0x42')](handleError(_0x225067,null));};exports['show']=function(_0x142958,_0x4f7586){var _0x294258={'raw':![],'where':{'id':_0x142958[_0x5278('0x43')]['id']}},_0x388a52={};_0x388a52[_0x5278('0x2e')]=_['keys'](db[_0x5278('0x29')][_0x5278('0x2a')]);_0x388a52[_0x5278('0x30')]=_['keys'](_0x142958['query']);_0x388a52['filters']=_[_0x5278('0x33')](_0x388a52['model'],_0x388a52[_0x5278('0x30')]);_0x294258[_0x5278('0x34')]=_['intersection'](_0x388a52['model'],qs[_0x5278('0x35')](_0x142958[_0x5278('0x30')][_0x5278('0x35')]));_0x294258[_0x5278('0x34')]=_0x294258[_0x5278('0x34')][_0x5278('0x36')]?_0x294258[_0x5278('0x34')]:_0x388a52[_0x5278('0x2e')];if(_0x142958[_0x5278('0x30')][_0x5278('0x3f')]){_0x294258[_0x5278('0x40')]=[{'all':!![]}];}_0x294258=_[_0x5278('0x3d')]({},_0x294258,_0x142958[_0x5278('0x44')]);return db[_0x5278('0x29')][_0x5278('0x45')](_0x294258)['then'](handleEntityNotFound(_0x4f7586,null))[_0x5278('0x21')](respondWithResult(_0x4f7586,null))['catch'](handleError(_0x4f7586,null));};exports[_0x5278('0x46')]=function(_0x421380,_0x25f1f0){return db[_0x5278('0x29')]['create'](_0x421380['body'],{})[_0x5278('0x21')](respondWithResult(_0x25f1f0,0xc9))[_0x5278('0x42')](handleError(_0x25f1f0,null));};exports[_0x5278('0x20')]=function(_0x104291,_0x1de699){if(_0x104291[_0x5278('0x47')]['id']){delete _0x104291['body']['id'];}return db[_0x5278('0x29')][_0x5278('0x45')]({'where':{'id':_0x104291[_0x5278('0x43')]['id']}})[_0x5278('0x21')](handleEntityNotFound(_0x1de699,null))[_0x5278('0x21')](saveUpdates(_0x104291[_0x5278('0x47')],null))['then'](respondWithResult(_0x1de699,null))[_0x5278('0x42')](handleError(_0x1de699,null));};exports[_0x5278('0x22')]=function(_0x532aaf,_0x5176a0){return db[_0x5278('0x29')][_0x5278('0x45')]({'where':{'id':_0x532aaf[_0x5278('0x43')]['id']}})[_0x5278('0x21')](handleEntityNotFound(_0x5176a0,null))[_0x5278('0x21')](removeEntity(_0x5176a0,null))[_0x5278('0x42')](handleError(_0x5176a0,null));};exports['getFields']=function(_0x129aec,_0x4f7f4c,_0x152cc2){var _0x2a19da={};var _0x3411d4={};var _0x5d622f;var _0x284f37;return db[_0x5278('0x29')][_0x5278('0x48')]({'where':{'id':_0x129aec['params']['id']}})[_0x5278('0x21')](handleEntityNotFound(_0x4f7f4c,null))[_0x5278('0x21')](function(_0x265b3f){if(_0x265b3f){_0x5d622f=_0x265b3f;_0x3411d4[_0x5278('0x2e')]=_['keys'](db[_0x5278('0x49')][_0x5278('0x2a')]);_0x3411d4[_0x5278('0x30')]=_[_0x5278('0x31')](_0x129aec[_0x5278('0x30')]);_0x3411d4[_0x5278('0x32')]=_[_0x5278('0x33')](_0x3411d4[_0x5278('0x2e')],_0x3411d4[_0x5278('0x30')]);_0x2a19da[_0x5278('0x34')]=_[_0x5278('0x33')](_0x3411d4[_0x5278('0x2e')],qs[_0x5278('0x35')](_0x129aec[_0x5278('0x30')]['fields']));_0x2a19da['attributes']=_0x2a19da['attributes'][_0x5278('0x36')]?_0x2a19da['attributes']:_0x3411d4['model'];_0x2a19da[_0x5278('0x39')]=qs[_0x5278('0x3a')](_0x129aec[_0x5278('0x30')]['sort']);_0x2a19da[_0x5278('0x3b')]=qs[_0x5278('0x32')](_[_0x5278('0x4a')](_0x129aec['query'],_0x3411d4[_0x5278('0x32')]));if(_0x129aec[_0x5278('0x30')][_0x5278('0x3c')]){_0x2a19da[_0x5278('0x3b')]=_[_0x5278('0x3d')](_0x2a19da['where'],{'$or':_['map'](_0x2a19da[_0x5278('0x34')],function(_0x331e50){var _0x302ffa={};_0x302ffa[_0x331e50]={'$like':'%'+_0x129aec['query'][_0x5278('0x3c')]+'%'};return _0x302ffa;})});}_0x2a19da=_['merge']({},_0x2a19da,_0x129aec['options']);return _0x5d622f[_0x5278('0x4b')](_0x2a19da);}})[_0x5278('0x21')](function(_0x995063){if(_0x995063){_0x284f37=_0x995063['length'];if(!_0x129aec['query'][_0x5278('0x37')](_0x5278('0x38'))){_0x2a19da[_0x5278('0x18')]=qs[_0x5278('0x18')](_0x129aec['query'][_0x5278('0x18')]);_0x2a19da['offset']=qs['offset'](_0x129aec[_0x5278('0x30')]['offset']);}return _0x5d622f['getFields'](_0x2a19da);}})[_0x5278('0x21')](function(_0x4d6cd5){if(_0x4d6cd5){return _0x4d6cd5?{'count':_0x284f37,'rows':_0x4d6cd5}:null;}})[_0x5278('0x21')](respondWithResult(_0x4f7f4c,null))[_0x5278('0x42')](handleError(_0x4f7f4c,null));};exports['getSubjects']=function(_0x30c73e,_0x3fcbe7,_0x57e3dd){var _0x4debe8={};var _0x55c9b4={};var _0x558b2c;var _0x353814;return db['ServicenowConfiguration']['findOne']({'where':{'id':_0x30c73e[_0x5278('0x43')]['id']}})[_0x5278('0x21')](handleEntityNotFound(_0x3fcbe7,null))['then'](function(_0x6f3346){if(_0x6f3346){_0x558b2c=_0x6f3346;_0x55c9b4[_0x5278('0x2e')]=_[_0x5278('0x31')](db[_0x5278('0x49')]['rawAttributes']);_0x55c9b4[_0x5278('0x30')]=_[_0x5278('0x31')](_0x30c73e[_0x5278('0x30')]);_0x55c9b4['filters']=_['intersection'](_0x55c9b4[_0x5278('0x2e')],_0x55c9b4[_0x5278('0x30')]);_0x4debe8[_0x5278('0x34')]=_['intersection'](_0x55c9b4['model'],qs['fields'](_0x30c73e[_0x5278('0x30')][_0x5278('0x35')]));_0x4debe8[_0x5278('0x34')]=_0x4debe8[_0x5278('0x34')][_0x5278('0x36')]?_0x4debe8[_0x5278('0x34')]:_0x55c9b4[_0x5278('0x2e')];_0x4debe8['order']=qs['sort'](_0x30c73e[_0x5278('0x30')]['sort']);_0x4debe8[_0x5278('0x3b')]=qs[_0x5278('0x32')](_['pick'](_0x30c73e[_0x5278('0x30')],_0x55c9b4[_0x5278('0x32')]));if(_0x30c73e[_0x5278('0x30')]['filter']){_0x4debe8[_0x5278('0x3b')]=_['merge'](_0x4debe8[_0x5278('0x3b')],{'$or':_[_0x5278('0x2f')](_0x4debe8['attributes'],function(_0x58f564){var _0x144df7={};_0x144df7[_0x58f564]={'$like':'%'+_0x30c73e['query']['filter']+'%'};return _0x144df7;})});}_0x4debe8=_[_0x5278('0x3d')]({},_0x4debe8,_0x30c73e[_0x5278('0x44')]);return _0x558b2c[_0x5278('0x4c')](_0x4debe8);}})[_0x5278('0x21')](function(_0x2f22e5){if(_0x2f22e5){_0x353814=_0x2f22e5[_0x5278('0x36')];if(!_0x30c73e[_0x5278('0x30')][_0x5278('0x37')]('nolimit')){_0x4debe8[_0x5278('0x18')]=qs[_0x5278('0x18')](_0x30c73e[_0x5278('0x30')][_0x5278('0x18')]);_0x4debe8[_0x5278('0x17')]=qs[_0x5278('0x17')](_0x30c73e[_0x5278('0x30')][_0x5278('0x17')]);}return _0x558b2c['getSubjects'](_0x4debe8);}})[_0x5278('0x21')](function(_0x4af3ea){if(_0x4af3ea){return _0x4af3ea?{'count':_0x353814,'rows':_0x4af3ea}:null;}})[_0x5278('0x21')](respondWithResult(_0x3fcbe7,null))[_0x5278('0x42')](handleError(_0x3fcbe7,null));};exports[_0x5278('0x4d')]=function(_0x191577,_0x2b1fcf,_0x5a0ec5){var _0x5f5874={};var _0x7ab5b6={};var _0x122bb6;var _0x47c201;return db[_0x5278('0x29')][_0x5278('0x48')]({'where':{'id':_0x191577[_0x5278('0x43')]['id']}})['then'](handleEntityNotFound(_0x2b1fcf,null))[_0x5278('0x21')](function(_0x7f7289){if(_0x7f7289){_0x122bb6=_0x7f7289;_0x7ab5b6['model']=_[_0x5278('0x31')](db[_0x5278('0x49')][_0x5278('0x2a')]);_0x7ab5b6['query']=_[_0x5278('0x31')](_0x191577[_0x5278('0x30')]);_0x7ab5b6[_0x5278('0x32')]=_[_0x5278('0x33')](_0x7ab5b6[_0x5278('0x2e')],_0x7ab5b6['query']);_0x5f5874['attributes']=_[_0x5278('0x33')](_0x7ab5b6['model'],qs[_0x5278('0x35')](_0x191577[_0x5278('0x30')][_0x5278('0x35')]));_0x5f5874[_0x5278('0x34')]=_0x5f5874[_0x5278('0x34')][_0x5278('0x36')]?_0x5f5874[_0x5278('0x34')]:_0x7ab5b6['model'];_0x5f5874[_0x5278('0x39')]=qs[_0x5278('0x3a')](_0x191577[_0x5278('0x30')][_0x5278('0x3a')]);_0x5f5874[_0x5278('0x3b')]=qs[_0x5278('0x32')](_[_0x5278('0x4a')](_0x191577[_0x5278('0x30')],_0x7ab5b6[_0x5278('0x32')]));if(_0x191577['query'][_0x5278('0x3c')]){_0x5f5874[_0x5278('0x3b')]=_['merge'](_0x5f5874[_0x5278('0x3b')],{'$or':_['map'](_0x5f5874[_0x5278('0x34')],function(_0x5225c4){var _0x4b76d9={};_0x4b76d9[_0x5225c4]={'$like':'%'+_0x191577['query'][_0x5278('0x3c')]+'%'};return _0x4b76d9;})});}_0x5f5874=_[_0x5278('0x3d')]({},_0x5f5874,_0x191577['options']);return _0x122bb6[_0x5278('0x4d')](_0x5f5874);}})['then'](function(_0x296df1){if(_0x296df1){_0x47c201=_0x296df1[_0x5278('0x36')];if(!_0x191577[_0x5278('0x30')][_0x5278('0x37')]('nolimit')){_0x5f5874[_0x5278('0x18')]=qs[_0x5278('0x18')](_0x191577[_0x5278('0x30')][_0x5278('0x18')]);_0x5f5874['offset']=qs[_0x5278('0x17')](_0x191577[_0x5278('0x30')][_0x5278('0x17')]);}return _0x122bb6['getDescriptions'](_0x5f5874);}})[_0x5278('0x21')](function(_0x283ffd){if(_0x283ffd){return _0x283ffd?{'count':_0x47c201,'rows':_0x283ffd}:null;}})[_0x5278('0x21')](respondWithResult(_0x2b1fcf,null))['catch'](handleError(_0x2b1fcf,null));}; \ No newline at end of file +var _0x7aa0=['../../config/environment','../../config/license/util','sendStatus','end','status','undefined','count','offset','set','Content-Range','json','reject','save','update','then','destroy','error','name','send','index','rawAttributes','fieldName','type','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','limit','order','sort','where','pick','filter','merge','map','VIRTUAL','ServicenowConfiguration','includeAll','include','findAll','rows','catch','params','length','options','create','body','find','getFields','findOne','ServicenowField','nolimit','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','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'];(function(_0x2e00d2,_0x12ef23){var _0x5258f5=function(_0x26af03){while(--_0x26af03){_0x2e00d2['push'](_0x2e00d2['shift']());}};_0x5258f5(++_0x12ef23);}(_0x7aa0,0x8c));var _0x07aa=function(_0x1324dc,_0x430524){_0x1324dc=_0x1324dc-0x0;var _0x29f70f=_0x7aa0[_0x1324dc];return _0x29f70f;};'use strict';var emlformat=require(_0x07aa('0x0'));var rimraf=require(_0x07aa('0x1'));var zipdir=require(_0x07aa('0x2'));var jsonpatch=require(_0x07aa('0x3'));var rp=require(_0x07aa('0x4'));var moment=require('moment');var BPromise=require(_0x07aa('0x5'));var Mustache=require('mustache');var util=require(_0x07aa('0x6'));var path=require(_0x07aa('0x7'));var sox=require(_0x07aa('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x07aa('0x9'));var _=require(_0x07aa('0xa'));var squel=require(_0x07aa('0xb'));var crypto=require(_0x07aa('0xc'));var jsforce=require(_0x07aa('0xd'));var deskjs=require(_0x07aa('0xe'));var toCsv=require('to-csv');var querystring=require(_0x07aa('0xf'));var Papa=require('papaparse');var Redis=require(_0x07aa('0x10'));var authService=require(_0x07aa('0x11'));var qs=require(_0x07aa('0x12'));var as=require(_0x07aa('0x13'));var hardwareService=require(_0x07aa('0x14'));var logger=require(_0x07aa('0x15'))(_0x07aa('0x16'));var utils=require(_0x07aa('0x17'));var config=require(_0x07aa('0x18'));var licenseUtil=require(_0x07aa('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x47ddb4,_0xe0788e){_0xe0788e=_0xe0788e||0xcc;return function(_0x2ba8d2){if(_0x2ba8d2){return _0x47ddb4[_0x07aa('0x1a')](_0xe0788e);}return _0x47ddb4['status'](_0xe0788e)[_0x07aa('0x1b')]();};}function respondWithResult(_0x39b1fc,_0x4c563c){_0x4c563c=_0x4c563c||0xc8;return function(_0x1eade1){if(_0x1eade1){return _0x39b1fc[_0x07aa('0x1c')](_0x4c563c)['json'](_0x1eade1);}};}function respondWithFilteredResult(_0x45450b,_0x1a2099){return function(_0x29a9a7){if(_0x29a9a7){var _0x29ab68=typeof _0x1a2099['offset']===_0x07aa('0x1d')&&typeof _0x1a2099['limit']===_0x07aa('0x1d');var _0x7bbe2b=_0x29a9a7[_0x07aa('0x1e')];var _0x3c9c56=_0x29ab68?0x0:_0x1a2099[_0x07aa('0x1f')];var _0x392031=_0x29ab68?_0x29a9a7[_0x07aa('0x1e')]:_0x1a2099[_0x07aa('0x1f')]+_0x1a2099['limit'];var _0x1b88f2;if(_0x392031>=_0x7bbe2b){_0x392031=_0x7bbe2b;_0x1b88f2=0xc8;}else{_0x1b88f2=0xce;}_0x45450b[_0x07aa('0x1c')](_0x1b88f2);return _0x45450b[_0x07aa('0x20')](_0x07aa('0x21'),_0x3c9c56+'-'+_0x392031+'/'+_0x7bbe2b)[_0x07aa('0x22')](_0x29a9a7);}return null;};}function patchUpdates(_0x242518){return function(_0x4193cd){try{jsonpatch['apply'](_0x4193cd,_0x242518,!![]);}catch(_0x36f2c2){return BPromise[_0x07aa('0x23')](_0x36f2c2);}return _0x4193cd[_0x07aa('0x24')]();};}function saveUpdates(_0x3a1f69,_0x28929a){return function(_0x5aeaea){if(_0x5aeaea){return _0x5aeaea[_0x07aa('0x25')](_0x3a1f69)[_0x07aa('0x26')](function(_0x121a7a){return _0x121a7a;});}return null;};}function removeEntity(_0x54e45d,_0x495bf5){return function(_0x30c0e0){if(_0x30c0e0){return _0x30c0e0[_0x07aa('0x27')]()[_0x07aa('0x26')](function(){_0x54e45d['status'](0xcc)[_0x07aa('0x1b')]();});}};}function handleEntityNotFound(_0x56686b,_0x1835d7){return function(_0x513cda){if(!_0x513cda){_0x56686b[_0x07aa('0x1a')](0x194);}return _0x513cda;};}function handleError(_0x3f18ee,_0x4f1314){_0x4f1314=_0x4f1314||0x1f4;return function(_0x59ffd0){logger[_0x07aa('0x28')](_0x59ffd0['stack']);if(_0x59ffd0[_0x07aa('0x29')]){delete _0x59ffd0[_0x07aa('0x29')];}_0x3f18ee[_0x07aa('0x1c')](_0x4f1314)[_0x07aa('0x2a')](_0x59ffd0);};}exports[_0x07aa('0x2b')]=function(_0x10826c,_0x5b391e){var _0x219da5={},_0x5330ae={},_0x20b980={'count':0x0,'rows':[]};var _0x3c1f13=_['map'](db['ServicenowConfiguration'][_0x07aa('0x2c')],function(_0x1e5d34){return{'name':_0x1e5d34[_0x07aa('0x2d')],'type':_0x1e5d34[_0x07aa('0x2e')]['key']};});_0x5330ae['model']=_['map'](_0x3c1f13,_0x07aa('0x29'));_0x5330ae[_0x07aa('0x2f')]=_[_0x07aa('0x30')](_0x10826c[_0x07aa('0x2f')]);_0x5330ae[_0x07aa('0x31')]=_[_0x07aa('0x32')](_0x5330ae['model'],_0x5330ae[_0x07aa('0x2f')]);_0x219da5['attributes']=_[_0x07aa('0x32')](_0x5330ae[_0x07aa('0x33')],qs['fields'](_0x10826c[_0x07aa('0x2f')][_0x07aa('0x34')]));_0x219da5[_0x07aa('0x35')]=_0x219da5['attributes']['length']?_0x219da5[_0x07aa('0x35')]:_0x5330ae['model'];if(!_0x10826c[_0x07aa('0x2f')][_0x07aa('0x36')]('nolimit')){_0x219da5['limit']=qs[_0x07aa('0x37')](_0x10826c['query']['limit']);_0x219da5[_0x07aa('0x1f')]=qs['offset'](_0x10826c[_0x07aa('0x2f')][_0x07aa('0x1f')]);}_0x219da5[_0x07aa('0x38')]=qs[_0x07aa('0x39')](_0x10826c['query']['sort']);_0x219da5[_0x07aa('0x3a')]=qs['filters'](_[_0x07aa('0x3b')](_0x10826c[_0x07aa('0x2f')],_0x5330ae[_0x07aa('0x31')]),_0x3c1f13);if(_0x10826c[_0x07aa('0x2f')][_0x07aa('0x3c')]){_0x219da5['where']=_[_0x07aa('0x3d')](_0x219da5[_0x07aa('0x3a')],{'$or':_[_0x07aa('0x3e')](_0x3c1f13,function(_0x2ec867){if(_0x2ec867['type']!==_0x07aa('0x3f')){var _0x4a80eb={};_0x4a80eb[_0x2ec867[_0x07aa('0x29')]]={'$like':'%'+_0x10826c['query'][_0x07aa('0x3c')]+'%'};return _0x4a80eb;}})});}_0x219da5=_[_0x07aa('0x3d')]({},_0x219da5,_0x10826c['options']);var _0x28dd6d={'where':_0x219da5[_0x07aa('0x3a')]};return db[_0x07aa('0x40')][_0x07aa('0x1e')](_0x28dd6d)[_0x07aa('0x26')](function(_0x3e9064){_0x20b980[_0x07aa('0x1e')]=_0x3e9064;if(_0x10826c['query'][_0x07aa('0x41')]){_0x219da5[_0x07aa('0x42')]=[{'all':!![]}];}return db[_0x07aa('0x40')][_0x07aa('0x43')](_0x219da5);})[_0x07aa('0x26')](function(_0x3892df){_0x20b980[_0x07aa('0x44')]=_0x3892df;return _0x20b980;})[_0x07aa('0x26')](respondWithFilteredResult(_0x5b391e,_0x219da5))[_0x07aa('0x45')](handleError(_0x5b391e,null));};exports['show']=function(_0x1b8bbf,_0x74de4d){var _0x4c1114={'raw':![],'where':{'id':_0x1b8bbf[_0x07aa('0x46')]['id']}},_0x227e15={};_0x227e15[_0x07aa('0x33')]=_['keys'](db[_0x07aa('0x40')][_0x07aa('0x2c')]);_0x227e15[_0x07aa('0x2f')]=_[_0x07aa('0x30')](_0x1b8bbf['query']);_0x227e15['filters']=_['intersection'](_0x227e15[_0x07aa('0x33')],_0x227e15[_0x07aa('0x2f')]);_0x4c1114[_0x07aa('0x35')]=_[_0x07aa('0x32')](_0x227e15[_0x07aa('0x33')],qs['fields'](_0x1b8bbf[_0x07aa('0x2f')][_0x07aa('0x34')]));_0x4c1114[_0x07aa('0x35')]=_0x4c1114['attributes'][_0x07aa('0x47')]?_0x4c1114[_0x07aa('0x35')]:_0x227e15[_0x07aa('0x33')];if(_0x1b8bbf[_0x07aa('0x2f')]['includeAll']){_0x4c1114['include']=[{'all':!![]}];}_0x4c1114=_[_0x07aa('0x3d')]({},_0x4c1114,_0x1b8bbf[_0x07aa('0x48')]);return db[_0x07aa('0x40')]['find'](_0x4c1114)[_0x07aa('0x26')](handleEntityNotFound(_0x74de4d,null))[_0x07aa('0x26')](respondWithResult(_0x74de4d,null))[_0x07aa('0x45')](handleError(_0x74de4d,null));};exports[_0x07aa('0x49')]=function(_0x31c41c,_0x390f93){return db[_0x07aa('0x40')]['create'](_0x31c41c[_0x07aa('0x4a')],{})[_0x07aa('0x26')](respondWithResult(_0x390f93,0xc9))[_0x07aa('0x45')](handleError(_0x390f93,null));};exports[_0x07aa('0x25')]=function(_0xca0ca1,_0x18de86){if(_0xca0ca1[_0x07aa('0x4a')]['id']){delete _0xca0ca1[_0x07aa('0x4a')]['id'];}return db[_0x07aa('0x40')][_0x07aa('0x4b')]({'where':{'id':_0xca0ca1[_0x07aa('0x46')]['id']}})['then'](handleEntityNotFound(_0x18de86,null))[_0x07aa('0x26')](saveUpdates(_0xca0ca1['body'],null))[_0x07aa('0x26')](respondWithResult(_0x18de86,null))[_0x07aa('0x45')](handleError(_0x18de86,null));};exports['destroy']=function(_0x21998e,_0x23c996){return db[_0x07aa('0x40')][_0x07aa('0x4b')]({'where':{'id':_0x21998e[_0x07aa('0x46')]['id']}})[_0x07aa('0x26')](handleEntityNotFound(_0x23c996,null))[_0x07aa('0x26')](removeEntity(_0x23c996,null))[_0x07aa('0x45')](handleError(_0x23c996,null));};exports[_0x07aa('0x4c')]=function(_0x85a822,_0x3105d6,_0x550285){var _0x56bea2={};var _0x3fa8b={};var _0x37fa9b;var _0x5f1702;return db[_0x07aa('0x40')][_0x07aa('0x4d')]({'where':{'id':_0x85a822[_0x07aa('0x46')]['id']}})[_0x07aa('0x26')](handleEntityNotFound(_0x3105d6,null))[_0x07aa('0x26')](function(_0x5f4354){if(_0x5f4354){_0x37fa9b=_0x5f4354;_0x3fa8b[_0x07aa('0x33')]=_[_0x07aa('0x30')](db[_0x07aa('0x4e')]['rawAttributes']);_0x3fa8b['query']=_[_0x07aa('0x30')](_0x85a822[_0x07aa('0x2f')]);_0x3fa8b[_0x07aa('0x31')]=_[_0x07aa('0x32')](_0x3fa8b[_0x07aa('0x33')],_0x3fa8b[_0x07aa('0x2f')]);_0x56bea2[_0x07aa('0x35')]=_['intersection'](_0x3fa8b[_0x07aa('0x33')],qs[_0x07aa('0x34')](_0x85a822['query'][_0x07aa('0x34')]));_0x56bea2[_0x07aa('0x35')]=_0x56bea2[_0x07aa('0x35')][_0x07aa('0x47')]?_0x56bea2['attributes']:_0x3fa8b[_0x07aa('0x33')];_0x56bea2['order']=qs[_0x07aa('0x39')](_0x85a822['query'][_0x07aa('0x39')]);_0x56bea2[_0x07aa('0x3a')]=qs[_0x07aa('0x31')](_['pick'](_0x85a822[_0x07aa('0x2f')],_0x3fa8b[_0x07aa('0x31')]));if(_0x85a822[_0x07aa('0x2f')][_0x07aa('0x3c')]){_0x56bea2[_0x07aa('0x3a')]=_[_0x07aa('0x3d')](_0x56bea2[_0x07aa('0x3a')],{'$or':_[_0x07aa('0x3e')](_0x56bea2[_0x07aa('0x35')],function(_0x1b417e){var _0x1348be={};_0x1348be[_0x1b417e]={'$like':'%'+_0x85a822[_0x07aa('0x2f')][_0x07aa('0x3c')]+'%'};return _0x1348be;})});}_0x56bea2=_[_0x07aa('0x3d')]({},_0x56bea2,_0x85a822[_0x07aa('0x48')]);return _0x37fa9b['getFields'](_0x56bea2);}})['then'](function(_0x1ebcae){if(_0x1ebcae){_0x5f1702=_0x1ebcae[_0x07aa('0x47')];if(!_0x85a822[_0x07aa('0x2f')][_0x07aa('0x36')](_0x07aa('0x4f'))){_0x56bea2[_0x07aa('0x37')]=qs[_0x07aa('0x37')](_0x85a822['query'][_0x07aa('0x37')]);_0x56bea2[_0x07aa('0x1f')]=qs['offset'](_0x85a822[_0x07aa('0x2f')]['offset']);}return _0x37fa9b[_0x07aa('0x4c')](_0x56bea2);}})[_0x07aa('0x26')](function(_0x72b1e7){if(_0x72b1e7){return _0x72b1e7?{'count':_0x5f1702,'rows':_0x72b1e7}:null;}})[_0x07aa('0x26')](respondWithResult(_0x3105d6,null))[_0x07aa('0x45')](handleError(_0x3105d6,null));};exports[_0x07aa('0x50')]=function(_0x531fad,_0x316101,_0x33ee86){var _0x1e99f8={};var _0x2eea49={};var _0x560f79;var _0x411feb;return db[_0x07aa('0x40')][_0x07aa('0x4d')]({'where':{'id':_0x531fad[_0x07aa('0x46')]['id']}})[_0x07aa('0x26')](handleEntityNotFound(_0x316101,null))[_0x07aa('0x26')](function(_0x2bfcc0){if(_0x2bfcc0){_0x560f79=_0x2bfcc0;_0x2eea49['model']=_[_0x07aa('0x30')](db[_0x07aa('0x4e')][_0x07aa('0x2c')]);_0x2eea49[_0x07aa('0x2f')]=_[_0x07aa('0x30')](_0x531fad['query']);_0x2eea49[_0x07aa('0x31')]=_[_0x07aa('0x32')](_0x2eea49[_0x07aa('0x33')],_0x2eea49[_0x07aa('0x2f')]);_0x1e99f8[_0x07aa('0x35')]=_['intersection'](_0x2eea49[_0x07aa('0x33')],qs['fields'](_0x531fad[_0x07aa('0x2f')][_0x07aa('0x34')]));_0x1e99f8[_0x07aa('0x35')]=_0x1e99f8[_0x07aa('0x35')]['length']?_0x1e99f8[_0x07aa('0x35')]:_0x2eea49[_0x07aa('0x33')];_0x1e99f8['order']=qs[_0x07aa('0x39')](_0x531fad[_0x07aa('0x2f')][_0x07aa('0x39')]);_0x1e99f8[_0x07aa('0x3a')]=qs[_0x07aa('0x31')](_[_0x07aa('0x3b')](_0x531fad[_0x07aa('0x2f')],_0x2eea49[_0x07aa('0x31')]));if(_0x531fad[_0x07aa('0x2f')][_0x07aa('0x3c')]){_0x1e99f8[_0x07aa('0x3a')]=_[_0x07aa('0x3d')](_0x1e99f8[_0x07aa('0x3a')],{'$or':_[_0x07aa('0x3e')](_0x1e99f8['attributes'],function(_0x44b8d6){var _0x33f7d3={};_0x33f7d3[_0x44b8d6]={'$like':'%'+_0x531fad['query']['filter']+'%'};return _0x33f7d3;})});}_0x1e99f8=_[_0x07aa('0x3d')]({},_0x1e99f8,_0x531fad[_0x07aa('0x48')]);return _0x560f79['getSubjects'](_0x1e99f8);}})[_0x07aa('0x26')](function(_0x5d0894){if(_0x5d0894){_0x411feb=_0x5d0894[_0x07aa('0x47')];if(!_0x531fad[_0x07aa('0x2f')][_0x07aa('0x36')]('nolimit')){_0x1e99f8[_0x07aa('0x37')]=qs[_0x07aa('0x37')](_0x531fad[_0x07aa('0x2f')][_0x07aa('0x37')]);_0x1e99f8[_0x07aa('0x1f')]=qs['offset'](_0x531fad['query'][_0x07aa('0x1f')]);}return _0x560f79['getSubjects'](_0x1e99f8);}})[_0x07aa('0x26')](function(_0xc187b2){if(_0xc187b2){return _0xc187b2?{'count':_0x411feb,'rows':_0xc187b2}:null;}})[_0x07aa('0x26')](respondWithResult(_0x316101,null))[_0x07aa('0x45')](handleError(_0x316101,null));};exports[_0x07aa('0x51')]=function(_0x1cb771,_0x5075be,_0x3ae255){var _0x2de904={};var _0x1dbc86={};var _0x39fbde;var _0x581ebe;return db[_0x07aa('0x40')]['findOne']({'where':{'id':_0x1cb771[_0x07aa('0x46')]['id']}})[_0x07aa('0x26')](handleEntityNotFound(_0x5075be,null))[_0x07aa('0x26')](function(_0x39e6e2){if(_0x39e6e2){_0x39fbde=_0x39e6e2;_0x1dbc86[_0x07aa('0x33')]=_['keys'](db['ServicenowField']['rawAttributes']);_0x1dbc86[_0x07aa('0x2f')]=_[_0x07aa('0x30')](_0x1cb771[_0x07aa('0x2f')]);_0x1dbc86['filters']=_[_0x07aa('0x32')](_0x1dbc86[_0x07aa('0x33')],_0x1dbc86[_0x07aa('0x2f')]);_0x2de904[_0x07aa('0x35')]=_[_0x07aa('0x32')](_0x1dbc86[_0x07aa('0x33')],qs[_0x07aa('0x34')](_0x1cb771['query'][_0x07aa('0x34')]));_0x2de904[_0x07aa('0x35')]=_0x2de904[_0x07aa('0x35')][_0x07aa('0x47')]?_0x2de904[_0x07aa('0x35')]:_0x1dbc86[_0x07aa('0x33')];_0x2de904[_0x07aa('0x38')]=qs[_0x07aa('0x39')](_0x1cb771[_0x07aa('0x2f')][_0x07aa('0x39')]);_0x2de904['where']=qs[_0x07aa('0x31')](_[_0x07aa('0x3b')](_0x1cb771[_0x07aa('0x2f')],_0x1dbc86[_0x07aa('0x31')]));if(_0x1cb771[_0x07aa('0x2f')]['filter']){_0x2de904[_0x07aa('0x3a')]=_[_0x07aa('0x3d')](_0x2de904[_0x07aa('0x3a')],{'$or':_[_0x07aa('0x3e')](_0x2de904[_0x07aa('0x35')],function(_0x1eeebe){var _0x177c48={};_0x177c48[_0x1eeebe]={'$like':'%'+_0x1cb771[_0x07aa('0x2f')][_0x07aa('0x3c')]+'%'};return _0x177c48;})});}_0x2de904=_[_0x07aa('0x3d')]({},_0x2de904,_0x1cb771[_0x07aa('0x48')]);return _0x39fbde[_0x07aa('0x51')](_0x2de904);}})[_0x07aa('0x26')](function(_0x1f0e6e){if(_0x1f0e6e){_0x581ebe=_0x1f0e6e['length'];if(!_0x1cb771[_0x07aa('0x2f')][_0x07aa('0x36')](_0x07aa('0x4f'))){_0x2de904[_0x07aa('0x37')]=qs['limit'](_0x1cb771[_0x07aa('0x2f')][_0x07aa('0x37')]);_0x2de904['offset']=qs['offset'](_0x1cb771[_0x07aa('0x2f')][_0x07aa('0x1f')]);}return _0x39fbde[_0x07aa('0x51')](_0x2de904);}})['then'](function(_0x1660e9){if(_0x1660e9){return _0x1660e9?{'count':_0x581ebe,'rows':_0x1660e9}:null;}})[_0x07aa('0x26')](respondWithResult(_0x5075be,null))['catch'](handleError(_0x5075be,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index cca0980..4de8b85 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 _0x8383=['request-promise','path','rimraf','../../config/environment','./intServicenowConfiguration.attributes','exports','define','ServicenowConfiguration','lodash','api','moment','bluebird'];(function(_0x4beaaa,_0x5713b8){var _0x2da88b=function(_0x260c8d){while(--_0x260c8d){_0x4beaaa['push'](_0x4beaaa['shift']());}};_0x2da88b(++_0x5713b8);}(_0x8383,0x98));var _0x3838=function(_0xacbb4b,_0x10a45d){_0xacbb4b=_0xacbb4b-0x0;var _0x609c46=_0x8383[_0xacbb4b];return _0x609c46;};'use strict';var _=require(_0x3838('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x3838('0x1'));var moment=require(_0x3838('0x2'));var BPromise=require(_0x3838('0x3'));var rp=require(_0x3838('0x4'));var fs=require('fs');var path=require(_0x3838('0x5'));var rimraf=require(_0x3838('0x6'));var config=require(_0x3838('0x7'));var attributes=require(_0x3838('0x8'));module[_0x3838('0x9')]=function(_0x7a4cc0,_0x509656){return _0x7a4cc0[_0x3838('0xa')](_0x3838('0xb'),attributes,{'tableName':'int_servicenow_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7269=['../../config/logger','bluebird','request-promise','rimraf','../../config/environment','./intServicenowConfiguration.attributes','exports','define','ServicenowConfiguration','int_servicenow_configurations','lodash','util'];(function(_0x5a6c96,_0x5de6a3){var _0xc0b988=function(_0xf82ead){while(--_0xf82ead){_0x5a6c96['push'](_0x5a6c96['shift']());}};_0xc0b988(++_0x5de6a3);}(_0x7269,0x76));var _0x9726=function(_0x31647b,_0x389c08){_0x31647b=_0x31647b-0x0;var _0x28a70b=_0x7269[_0x31647b];return _0x28a70b;};'use strict';var _=require(_0x9726('0x0'));var util=require(_0x9726('0x1'));var logger=require(_0x9726('0x2'))('api');var moment=require('moment');var BPromise=require(_0x9726('0x3'));var rp=require(_0x9726('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9726('0x5'));var config=require(_0x9726('0x6'));var attributes=require(_0x9726('0x7'));module[_0x9726('0x8')]=function(_0x795889,_0x832cb){return _0x795889[_0x9726('0x9')](_0x9726('0xa'),attributes,{'tableName':_0x9726('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js index da194bd..df04247 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 _0xf3d0=['http','request','then','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ServicenowConfiguration,\x20%s,\x20%s','message','info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client'];(function(_0x5b40a7,_0xdaf7ce){var _0x18948f=function(_0x169645){while(--_0x169645){_0x5b40a7['push'](_0x5b40a7['shift']());}};_0x18948f(++_0xdaf7ce);}(_0xf3d0,0x18e));var _0x0f3d=function(_0x3778d2,_0x2e24dc){_0x3778d2=_0x3778d2-0x0;var _0x4cc1ed=_0xf3d0[_0x3778d2];return _0x4cc1ed;};'use strict';var _=require(_0x0f3d('0x0'));var util=require(_0x0f3d('0x1'));var moment=require('moment');var BPromise=require(_0x0f3d('0x2'));var rs=require(_0x0f3d('0x3'));var fs=require('fs');var Redis=require(_0x0f3d('0x4'));var db=require(_0x0f3d('0x5'))['db'];var utils=require(_0x0f3d('0x6'));var logger=require(_0x0f3d('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x0f3d('0x8'));var client=jayson[_0x0f3d('0x9')][_0x0f3d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d14c5,_0x2e168c,_0x2dbd7c){return new BPromise(function(_0x4246a8,_0x3fb2f8){return client[_0x0f3d('0xb')](_0x1d14c5,_0x2dbd7c)[_0x0f3d('0xc')](function(_0x3e9a5a){logger['info']('ServicenowConfiguration,\x20%s,\x20%s',_0x2e168c,'request\x20sent');logger[_0x0f3d('0xd')](_0x0f3d('0xe'),_0x2e168c,_0x0f3d('0xf'),JSON[_0x0f3d('0x10')](_0x3e9a5a));if(_0x3e9a5a['error']){if(_0x3e9a5a[_0x0f3d('0x11')][_0x0f3d('0x12')]===0x1f4){logger[_0x0f3d('0x11')]('ServicenowConfiguration,\x20%s,\x20%s',_0x2e168c,_0x3e9a5a[_0x0f3d('0x11')]['message']);return _0x3fb2f8(_0x3e9a5a[_0x0f3d('0x11')]['message']);}logger[_0x0f3d('0x11')](_0x0f3d('0x13'),_0x2e168c,_0x3e9a5a[_0x0f3d('0x11')][_0x0f3d('0x14')]);return _0x4246a8(_0x3e9a5a[_0x0f3d('0x11')]['message']);}else{logger[_0x0f3d('0x15')](_0x0f3d('0x13'),_0x2e168c,_0x0f3d('0xf'));_0x4246a8(_0x3e9a5a[_0x0f3d('0x16')][_0x0f3d('0x14')]);}})[_0x0f3d('0x17')](function(_0x17500d){logger[_0x0f3d('0x11')](_0x0f3d('0x13'),_0x2e168c,_0x17500d);_0x3fb2f8(_0x17500d);});});} \ No newline at end of file +var _0x6a05=['ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x21df50,_0x36628b){var _0x490122=function(_0x2a7735){while(--_0x2a7735){_0x21df50['push'](_0x21df50['shift']());}};_0x490122(++_0x36628b);}(_0x6a05,0x111));var _0x56a0=function(_0x33add6,_0x435ffe){_0x33add6=_0x33add6-0x0;var _0x1d96ec=_0x6a05[_0x33add6];return _0x1d96ec;};'use strict';var _=require(_0x56a0('0x0'));var util=require(_0x56a0('0x1'));var moment=require(_0x56a0('0x2'));var BPromise=require(_0x56a0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x56a0('0x4'));var db=require(_0x56a0('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x56a0('0x6'))(_0x56a0('0x7'));var config=require(_0x56a0('0x8'));var jayson=require(_0x56a0('0x9'));var client=jayson[_0x56a0('0xa')][_0x56a0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x586c22,_0xda03b2,_0xa042a0){return new BPromise(function(_0x21dfb7,_0x3b9eee){return client[_0x56a0('0xc')](_0x586c22,_0xa042a0)['then'](function(_0x548c38){logger['info'](_0x56a0('0xd'),_0xda03b2,_0x56a0('0xe'));logger['debug'](_0x56a0('0xf'),_0xda03b2,_0x56a0('0xe'),JSON[_0x56a0('0x10')](_0x548c38));if(_0x548c38[_0x56a0('0x11')]){if(_0x548c38[_0x56a0('0x11')][_0x56a0('0x12')]===0x1f4){logger[_0x56a0('0x11')](_0x56a0('0xd'),_0xda03b2,_0x548c38['error'][_0x56a0('0x13')]);return _0x3b9eee(_0x548c38[_0x56a0('0x11')][_0x56a0('0x13')]);}logger['error'](_0x56a0('0xd'),_0xda03b2,_0x548c38[_0x56a0('0x11')]['message']);return _0x21dfb7(_0x548c38[_0x56a0('0x11')][_0x56a0('0x13')]);}else{logger[_0x56a0('0x14')](_0x56a0('0xd'),_0xda03b2,_0x56a0('0xe'));_0x21dfb7(_0x548c38[_0x56a0('0x15')][_0x56a0('0x13')]);}})['catch'](function(_0x483cbe){logger[_0x56a0('0x11')](_0x56a0('0xd'),_0xda03b2,_0x483cbe);_0x3b9eee(_0x483cbe);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index dd1c274..3a242a5 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 _0x26e3=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowField.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','exports','multer'];(function(_0x31dd97,_0x87c48){var _0x3d931f=function(_0x346085){while(--_0x346085){_0x31dd97['push'](_0x31dd97['shift']());}};_0x3d931f(++_0x87c48);}(_0x26e3,0xb7));var _0x326e=function(_0x36bff5,_0x3156cb){_0x36bff5=_0x36bff5-0x0;var _0x80ade5=_0x26e3[_0x36bff5];return _0x80ade5;};'use strict';var multer=require(_0x326e('0x0'));var util=require(_0x326e('0x1'));var path=require(_0x326e('0x2'));var timeout=require(_0x326e('0x3'));var express=require(_0x326e('0x4'));var router=express[_0x326e('0x5')]();var fs_extra=require(_0x326e('0x6'));var auth=require(_0x326e('0x7'));var interaction=require(_0x326e('0x8'));var config=require(_0x326e('0x9'));var controller=require(_0x326e('0xa'));router[_0x326e('0xb')]('/',auth[_0x326e('0xc')](),controller[_0x326e('0xd')]);router[_0x326e('0xb')]('/:id',auth[_0x326e('0xc')](),controller[_0x326e('0xe')]);router[_0x326e('0xf')]('/',auth[_0x326e('0xc')](),controller[_0x326e('0x10')]);router[_0x326e('0x11')](_0x326e('0x12'),auth[_0x326e('0xc')](),controller[_0x326e('0x13')]);router[_0x326e('0x14')]('/:id',auth[_0x326e('0xc')](),controller[_0x326e('0x15')]);module[_0x326e('0x16')]=router; \ No newline at end of file +var _0x6ee9=['get','isAuthenticated','index','/:id','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./intServicenowField.controller'];(function(_0x5ed024,_0x20fcac){var _0x529b32=function(_0x373b27){while(--_0x373b27){_0x5ed024['push'](_0x5ed024['shift']());}};_0x529b32(++_0x20fcac);}(_0x6ee9,0xa2));var _0x96ee=function(_0x3c6c70,_0x247b05){_0x3c6c70=_0x3c6c70-0x0;var _0x324344=_0x6ee9[_0x3c6c70];return _0x324344;};'use strict';var multer=require(_0x96ee('0x0'));var util=require(_0x96ee('0x1'));var path=require(_0x96ee('0x2'));var timeout=require(_0x96ee('0x3'));var express=require(_0x96ee('0x4'));var router=express['Router']();var fs_extra=require(_0x96ee('0x5'));var auth=require(_0x96ee('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x96ee('0x7'));var controller=require(_0x96ee('0x8'));router[_0x96ee('0x9')]('/',auth[_0x96ee('0xa')](),controller[_0x96ee('0xb')]);router[_0x96ee('0x9')](_0x96ee('0xc'),auth[_0x96ee('0xa')](),controller['show']);router[_0x96ee('0xd')]('/',auth[_0x96ee('0xa')](),controller[_0x96ee('0xe')]);router[_0x96ee('0xf')](_0x96ee('0xc'),auth[_0x96ee('0xa')](),controller[_0x96ee('0x10')]);router[_0x96ee('0x11')](_0x96ee('0xc'),auth[_0x96ee('0xa')](),controller['destroy']);module[_0x96ee('0x12')]=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index fda99a9..44838af 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 _0xcea9=['exports','ENUM','variable','customVariable','keyValue','picklist','STRING','string','sequelize'];(function(_0x4eb8cb,_0x38cf86){var _0xac8db9=function(_0xf3bbf2){while(--_0xf3bbf2){_0x4eb8cb['push'](_0x4eb8cb['shift']());}};_0xac8db9(++_0x38cf86);}(_0xcea9,0x179));var _0x9cea=function(_0xf10789,_0x557473){_0xf10789=_0xf10789-0x0;var _0x3b57d1=_0xcea9[_0xf10789];return _0x3b57d1;};'use strict';var Sequelize=require(_0x9cea('0x0'));module[_0x9cea('0x1')]={'type':{'type':Sequelize[_0x9cea('0x2')]('string',_0x9cea('0x3'),_0x9cea('0x4'),_0x9cea('0x5'),_0x9cea('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0x9cea('0x7')]},'key':{'type':Sequelize[_0x9cea('0x7')]},'keyType':{'type':Sequelize[_0x9cea('0x2')](_0x9cea('0x8'),_0x9cea('0x3'),_0x9cea('0x4'))},'keyContent':{'type':Sequelize[_0x9cea('0x7')]},'idField':{'type':Sequelize[_0x9cea('0x7')]},'nameField':{'type':Sequelize[_0x9cea('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x2753=['BOOLEAN','sequelize','exports','ENUM','string','variable','keyValue','picklist','STRING','customVariable'];(function(_0x40a825,_0x3bac79){var _0x273a54=function(_0x5628d8){while(--_0x5628d8){_0x40a825['push'](_0x40a825['shift']());}};_0x273a54(++_0x3bac79);}(_0x2753,0xe7));var _0x3275=function(_0x423f1c,_0x2adb8c){_0x423f1c=_0x423f1c-0x0;var _0xebed4c=_0x2753[_0x423f1c];return _0xebed4c;};'use strict';var Sequelize=require(_0x3275('0x0'));module[_0x3275('0x1')]={'type':{'type':Sequelize[_0x3275('0x2')](_0x3275('0x3'),_0x3275('0x4'),'customVariable',_0x3275('0x5'),_0x3275('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0x3275('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x3275('0x2')](_0x3275('0x3'),_0x3275('0x4'),_0x3275('0x8'))},'keyContent':{'type':Sequelize[_0x3275('0x7')]},'idField':{'type':Sequelize[_0x3275('0x7')]},'nameField':{'type':Sequelize[_0x3275('0x7')]},'customField':{'type':Sequelize[_0x3275('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x3275('0x7')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index a633925..4873145 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 _0xd008=['type','key','map','query','keys','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','intersection','create','body','find','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','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','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','apply','update','then','destroy','error','name','send','index','ServicenowField','rawAttributes','fieldName'];(function(_0x4ff5c6,_0x256275){var _0x53f112=function(_0x5310e5){while(--_0x5310e5){_0x4ff5c6['push'](_0x4ff5c6['shift']());}};_0x53f112(++_0x256275);}(_0xd008,0x103));var _0x8d00=function(_0x499db0,_0x216ff9){_0x499db0=_0x499db0-0x0;var _0x55bbdb=_0xd008[_0x499db0];return _0x55bbdb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8d00('0x0'));var zipdir=require(_0x8d00('0x1'));var jsonpatch=require(_0x8d00('0x2'));var rp=require(_0x8d00('0x3'));var moment=require('moment');var BPromise=require(_0x8d00('0x4'));var Mustache=require(_0x8d00('0x5'));var util=require('util');var path=require(_0x8d00('0x6'));var sox=require(_0x8d00('0x7'));var csv=require(_0x8d00('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8d00('0x9'));var _=require(_0x8d00('0xa'));var squel=require(_0x8d00('0xb'));var crypto=require(_0x8d00('0xc'));var jsforce=require(_0x8d00('0xd'));var deskjs=require(_0x8d00('0xe'));var toCsv=require(_0x8d00('0x8'));var querystring=require(_0x8d00('0xf'));var Papa=require(_0x8d00('0x10'));var Redis=require(_0x8d00('0x11'));var authService=require(_0x8d00('0x12'));var qs=require(_0x8d00('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8d00('0x14'));var logger=require(_0x8d00('0x15'))('api');var utils=require(_0x8d00('0x16'));var config=require(_0x8d00('0x17'));var licenseUtil=require(_0x8d00('0x18'));var db=require(_0x8d00('0x19'))['db'];function respondWithStatusCode(_0xe1e2d,_0xcf1876){_0xcf1876=_0xcf1876||0xcc;return function(_0x203625){if(_0x203625){return _0xe1e2d[_0x8d00('0x1a')](_0xcf1876);}return _0xe1e2d[_0x8d00('0x1b')](_0xcf1876)[_0x8d00('0x1c')]();};}function respondWithResult(_0x3432c9,_0x148314){_0x148314=_0x148314||0xc8;return function(_0x1932c1){if(_0x1932c1){return _0x3432c9['status'](_0x148314)[_0x8d00('0x1d')](_0x1932c1);}};}function respondWithFilteredResult(_0x3d0146,_0x51b910){return function(_0x39bc33){if(_0x39bc33){var _0xd16482=typeof _0x51b910[_0x8d00('0x1e')]===_0x8d00('0x1f')&&typeof _0x51b910[_0x8d00('0x20')]===_0x8d00('0x1f');var _0x32b7ac=_0x39bc33['count'];var _0x3e3a1d=_0xd16482?0x0:_0x51b910[_0x8d00('0x1e')];var _0x43d9fd=_0xd16482?_0x39bc33[_0x8d00('0x21')]:_0x51b910[_0x8d00('0x1e')]+_0x51b910['limit'];var _0x3a1552;if(_0x43d9fd>=_0x32b7ac){_0x43d9fd=_0x32b7ac;_0x3a1552=0xc8;}else{_0x3a1552=0xce;}_0x3d0146['status'](_0x3a1552);return _0x3d0146['set']('Content-Range',_0x3e3a1d+'-'+_0x43d9fd+'/'+_0x32b7ac)['json'](_0x39bc33);}return null;};}function patchUpdates(_0x5421f4){return function(_0x423f60){try{jsonpatch[_0x8d00('0x22')](_0x423f60,_0x5421f4,!![]);}catch(_0x1bc6fc){return BPromise['reject'](_0x1bc6fc);}return _0x423f60['save']();};}function saveUpdates(_0x270b06,_0x23cf80){return function(_0x242370){if(_0x242370){return _0x242370[_0x8d00('0x23')](_0x270b06)[_0x8d00('0x24')](function(_0x303262){return _0x303262;});}return null;};}function removeEntity(_0x3d9488,_0x44802e){return function(_0x1fb500){if(_0x1fb500){return _0x1fb500[_0x8d00('0x25')]()['then'](function(){_0x3d9488[_0x8d00('0x1b')](0xcc)[_0x8d00('0x1c')]();});}};}function handleEntityNotFound(_0x562975,_0x420462){return function(_0x5dc569){if(!_0x5dc569){_0x562975['sendStatus'](0x194);}return _0x5dc569;};}function handleError(_0xa41c8e,_0x5e6ea6){_0x5e6ea6=_0x5e6ea6||0x1f4;return function(_0xf656db){logger[_0x8d00('0x26')](_0xf656db['stack']);if(_0xf656db[_0x8d00('0x27')]){delete _0xf656db[_0x8d00('0x27')];}_0xa41c8e['status'](_0x5e6ea6)[_0x8d00('0x28')](_0xf656db);};}exports[_0x8d00('0x29')]=function(_0x6ba5dc,_0x46568c){var _0x2541dd={},_0x45ce2a={},_0x28cd84={'count':0x0,'rows':[]};var _0x466a30=_['map'](db[_0x8d00('0x2a')][_0x8d00('0x2b')],function(_0x4fcb7a){return{'name':_0x4fcb7a[_0x8d00('0x2c')],'type':_0x4fcb7a[_0x8d00('0x2d')][_0x8d00('0x2e')]};});_0x45ce2a['model']=_[_0x8d00('0x2f')](_0x466a30,'name');_0x45ce2a[_0x8d00('0x30')]=_[_0x8d00('0x31')](_0x6ba5dc[_0x8d00('0x30')]);_0x45ce2a['filters']=_['intersection'](_0x45ce2a[_0x8d00('0x32')],_0x45ce2a[_0x8d00('0x30')]);_0x2541dd[_0x8d00('0x33')]=_['intersection'](_0x45ce2a['model'],qs[_0x8d00('0x34')](_0x6ba5dc[_0x8d00('0x30')]['fields']));_0x2541dd[_0x8d00('0x33')]=_0x2541dd[_0x8d00('0x33')][_0x8d00('0x35')]?_0x2541dd[_0x8d00('0x33')]:_0x45ce2a[_0x8d00('0x32')];if(!_0x6ba5dc[_0x8d00('0x30')][_0x8d00('0x36')](_0x8d00('0x37'))){_0x2541dd['limit']=qs[_0x8d00('0x20')](_0x6ba5dc['query'][_0x8d00('0x20')]);_0x2541dd[_0x8d00('0x1e')]=qs[_0x8d00('0x1e')](_0x6ba5dc[_0x8d00('0x30')]['offset']);}_0x2541dd[_0x8d00('0x38')]=qs[_0x8d00('0x39')](_0x6ba5dc[_0x8d00('0x30')][_0x8d00('0x39')]);_0x2541dd[_0x8d00('0x3a')]=qs[_0x8d00('0x3b')](_[_0x8d00('0x3c')](_0x6ba5dc[_0x8d00('0x30')],_0x45ce2a[_0x8d00('0x3b')]),_0x466a30);if(_0x6ba5dc[_0x8d00('0x30')][_0x8d00('0x3d')]){_0x2541dd[_0x8d00('0x3a')]=_['merge'](_0x2541dd[_0x8d00('0x3a')],{'$or':_[_0x8d00('0x2f')](_0x466a30,function(_0x33800c){if(_0x33800c[_0x8d00('0x2d')]!==_0x8d00('0x3e')){var _0x2f3411={};_0x2f3411[_0x33800c[_0x8d00('0x27')]]={'$like':'%'+_0x6ba5dc[_0x8d00('0x30')][_0x8d00('0x3d')]+'%'};return _0x2f3411;}})});}_0x2541dd=_[_0x8d00('0x3f')]({},_0x2541dd,_0x6ba5dc[_0x8d00('0x40')]);var _0x4259a6={'where':_0x2541dd[_0x8d00('0x3a')]};return db['ServicenowField'][_0x8d00('0x21')](_0x4259a6)['then'](function(_0x12a63e){_0x28cd84[_0x8d00('0x21')]=_0x12a63e;if(_0x6ba5dc[_0x8d00('0x30')][_0x8d00('0x41')]){_0x2541dd[_0x8d00('0x42')]=[{'all':!![]}];}return db[_0x8d00('0x2a')][_0x8d00('0x43')](_0x2541dd);})[_0x8d00('0x24')](function(_0x5cdb6b){_0x28cd84[_0x8d00('0x44')]=_0x5cdb6b;return _0x28cd84;})['then'](respondWithFilteredResult(_0x46568c,_0x2541dd))[_0x8d00('0x45')](handleError(_0x46568c,null));};exports[_0x8d00('0x46')]=function(_0x56aaa0,_0x48766d){var _0x3b6979={'raw':!![],'where':{'id':_0x56aaa0[_0x8d00('0x47')]['id']}},_0xb2e558={};_0xb2e558['model']=_[_0x8d00('0x31')](db[_0x8d00('0x2a')][_0x8d00('0x2b')]);_0xb2e558[_0x8d00('0x30')]=_['keys'](_0x56aaa0[_0x8d00('0x30')]);_0xb2e558[_0x8d00('0x3b')]=_[_0x8d00('0x48')](_0xb2e558[_0x8d00('0x32')],_0xb2e558[_0x8d00('0x30')]);_0x3b6979[_0x8d00('0x33')]=_['intersection'](_0xb2e558['model'],qs[_0x8d00('0x34')](_0x56aaa0[_0x8d00('0x30')][_0x8d00('0x34')]));_0x3b6979[_0x8d00('0x33')]=_0x3b6979[_0x8d00('0x33')][_0x8d00('0x35')]?_0x3b6979[_0x8d00('0x33')]:_0xb2e558[_0x8d00('0x32')];if(_0x56aaa0[_0x8d00('0x30')][_0x8d00('0x41')]){_0x3b6979[_0x8d00('0x42')]=[{'all':!![]}];}_0x3b6979=_[_0x8d00('0x3f')]({},_0x3b6979,_0x56aaa0['options']);return db[_0x8d00('0x2a')]['find'](_0x3b6979)['then'](handleEntityNotFound(_0x48766d,null))[_0x8d00('0x24')](respondWithResult(_0x48766d,null))[_0x8d00('0x45')](handleError(_0x48766d,null));};exports[_0x8d00('0x49')]=function(_0x4b567d,_0x3f1683){return db[_0x8d00('0x2a')]['create'](_0x4b567d[_0x8d00('0x4a')],{})[_0x8d00('0x24')](respondWithResult(_0x3f1683,0xc9))[_0x8d00('0x45')](handleError(_0x3f1683,null));};exports['update']=function(_0x43c79b,_0x6aea47){if(_0x43c79b[_0x8d00('0x4a')]['id']){delete _0x43c79b['body']['id'];}return db[_0x8d00('0x2a')][_0x8d00('0x4b')]({'where':{'id':_0x43c79b[_0x8d00('0x47')]['id']}})['then'](handleEntityNotFound(_0x6aea47,null))[_0x8d00('0x24')](saveUpdates(_0x43c79b[_0x8d00('0x4a')],null))[_0x8d00('0x24')](respondWithResult(_0x6aea47,null))['catch'](handleError(_0x6aea47,null));};exports[_0x8d00('0x25')]=function(_0x3c65f3,_0x4384fc){return db[_0x8d00('0x2a')]['find']({'where':{'id':_0x3c65f3[_0x8d00('0x47')]['id']}})['then'](handleEntityNotFound(_0x4384fc,null))[_0x8d00('0x24')](removeEntity(_0x4384fc,null))[_0x8d00('0x45')](handleError(_0x4384fc,null));}; \ No newline at end of file +var _0x9820=['send','index','ServicenowField','rawAttributes','fieldName','type','key','model','query','attributes','intersection','fields','length','order','sort','filters','filter','where','merge','map','options','includeAll','include','rows','catch','show','params','keys','create','body','find','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','stack','name'];(function(_0x5edd05,_0x8ac1d3){var _0x19b62e=function(_0x2a25d5){while(--_0x2a25d5){_0x5edd05['push'](_0x5edd05['shift']());}};_0x19b62e(++_0x8ac1d3);}(_0x9820,0x6a));var _0x0982=function(_0x18e1ba,_0x25acc1){_0x18e1ba=_0x18e1ba-0x0;var _0x3bedee=_0x9820[_0x18e1ba];return _0x3bedee;};'use strict';var emlformat=require(_0x0982('0x0'));var rimraf=require(_0x0982('0x1'));var zipdir=require(_0x0982('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0982('0x3'));var moment=require(_0x0982('0x4'));var BPromise=require(_0x0982('0x5'));var Mustache=require('mustache');var util=require(_0x0982('0x6'));var path=require(_0x0982('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0982('0x8'));var fs=require('fs');var fs_extra=require(_0x0982('0x9'));var _=require(_0x0982('0xa'));var squel=require(_0x0982('0xb'));var crypto=require(_0x0982('0xc'));var jsforce=require(_0x0982('0xd'));var deskjs=require(_0x0982('0xe'));var toCsv=require(_0x0982('0xf'));var querystring=require(_0x0982('0x10'));var Papa=require(_0x0982('0x11'));var Redis=require(_0x0982('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x0982('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0982('0x14'))(_0x0982('0x15'));var utils=require(_0x0982('0x16'));var config=require(_0x0982('0x17'));var licenseUtil=require(_0x0982('0x18'));var db=require(_0x0982('0x19'))['db'];function respondWithStatusCode(_0x126be7,_0x3852c1){_0x3852c1=_0x3852c1||0xcc;return function(_0x1cfa11){if(_0x1cfa11){return _0x126be7[_0x0982('0x1a')](_0x3852c1);}return _0x126be7['status'](_0x3852c1)[_0x0982('0x1b')]();};}function respondWithResult(_0x2c18a3,_0x5225f0){_0x5225f0=_0x5225f0||0xc8;return function(_0x3ed111){if(_0x3ed111){return _0x2c18a3[_0x0982('0x1c')](_0x5225f0)['json'](_0x3ed111);}};}function respondWithFilteredResult(_0x1bc99a,_0x2956b0){return function(_0x2beb22){if(_0x2beb22){var _0x3f5415=typeof _0x2956b0[_0x0982('0x1d')]===_0x0982('0x1e')&&typeof _0x2956b0[_0x0982('0x1f')]===_0x0982('0x1e');var _0x568a86=_0x2beb22[_0x0982('0x20')];var _0x4ee46e=_0x3f5415?0x0:_0x2956b0[_0x0982('0x1d')];var _0x319dac=_0x3f5415?_0x2beb22[_0x0982('0x20')]:_0x2956b0[_0x0982('0x1d')]+_0x2956b0[_0x0982('0x1f')];var _0x435f1b;if(_0x319dac>=_0x568a86){_0x319dac=_0x568a86;_0x435f1b=0xc8;}else{_0x435f1b=0xce;}_0x1bc99a[_0x0982('0x1c')](_0x435f1b);return _0x1bc99a[_0x0982('0x21')](_0x0982('0x22'),_0x4ee46e+'-'+_0x319dac+'/'+_0x568a86)[_0x0982('0x23')](_0x2beb22);}return null;};}function patchUpdates(_0x3d1f27){return function(_0x5b9e9f){try{jsonpatch[_0x0982('0x24')](_0x5b9e9f,_0x3d1f27,!![]);}catch(_0x4ebe83){return BPromise[_0x0982('0x25')](_0x4ebe83);}return _0x5b9e9f[_0x0982('0x26')]();};}function saveUpdates(_0x4d8482,_0x2ad2a0){return function(_0x19f2d5){if(_0x19f2d5){return _0x19f2d5[_0x0982('0x27')](_0x4d8482)[_0x0982('0x28')](function(_0x1e4ffe){return _0x1e4ffe;});}return null;};}function removeEntity(_0x41a18c,_0xdef0e0){return function(_0x503b87){if(_0x503b87){return _0x503b87[_0x0982('0x29')]()['then'](function(){_0x41a18c[_0x0982('0x1c')](0xcc)[_0x0982('0x1b')]();});}};}function handleEntityNotFound(_0x3acef6,_0x49864b){return function(_0x4acaf4){if(!_0x4acaf4){_0x3acef6[_0x0982('0x1a')](0x194);}return _0x4acaf4;};}function handleError(_0x41c3e4,_0x314756){_0x314756=_0x314756||0x1f4;return function(_0x5d656e){logger['error'](_0x5d656e[_0x0982('0x2a')]);if(_0x5d656e[_0x0982('0x2b')]){delete _0x5d656e['name'];}_0x41c3e4[_0x0982('0x1c')](_0x314756)[_0x0982('0x2c')](_0x5d656e);};}exports[_0x0982('0x2d')]=function(_0x12e2cd,_0x2e4aa1){var _0x19ec5e={},_0x61bd55={},_0x1a1fbe={'count':0x0,'rows':[]};var _0x4374d0=_['map'](db[_0x0982('0x2e')][_0x0982('0x2f')],function(_0x70c0bc){return{'name':_0x70c0bc[_0x0982('0x30')],'type':_0x70c0bc[_0x0982('0x31')][_0x0982('0x32')]};});_0x61bd55[_0x0982('0x33')]=_['map'](_0x4374d0,_0x0982('0x2b'));_0x61bd55[_0x0982('0x34')]=_['keys'](_0x12e2cd['query']);_0x61bd55['filters']=_['intersection'](_0x61bd55[_0x0982('0x33')],_0x61bd55['query']);_0x19ec5e[_0x0982('0x35')]=_[_0x0982('0x36')](_0x61bd55[_0x0982('0x33')],qs[_0x0982('0x37')](_0x12e2cd['query'][_0x0982('0x37')]));_0x19ec5e[_0x0982('0x35')]=_0x19ec5e[_0x0982('0x35')][_0x0982('0x38')]?_0x19ec5e[_0x0982('0x35')]:_0x61bd55[_0x0982('0x33')];if(!_0x12e2cd[_0x0982('0x34')]['hasOwnProperty']('nolimit')){_0x19ec5e[_0x0982('0x1f')]=qs[_0x0982('0x1f')](_0x12e2cd[_0x0982('0x34')][_0x0982('0x1f')]);_0x19ec5e[_0x0982('0x1d')]=qs[_0x0982('0x1d')](_0x12e2cd[_0x0982('0x34')]['offset']);}_0x19ec5e[_0x0982('0x39')]=qs[_0x0982('0x3a')](_0x12e2cd['query'][_0x0982('0x3a')]);_0x19ec5e['where']=qs[_0x0982('0x3b')](_['pick'](_0x12e2cd[_0x0982('0x34')],_0x61bd55[_0x0982('0x3b')]),_0x4374d0);if(_0x12e2cd[_0x0982('0x34')][_0x0982('0x3c')]){_0x19ec5e[_0x0982('0x3d')]=_[_0x0982('0x3e')](_0x19ec5e[_0x0982('0x3d')],{'$or':_[_0x0982('0x3f')](_0x4374d0,function(_0x49ddbc){if(_0x49ddbc['type']!=='VIRTUAL'){var _0x35ace1={};_0x35ace1[_0x49ddbc[_0x0982('0x2b')]]={'$like':'%'+_0x12e2cd['query'][_0x0982('0x3c')]+'%'};return _0x35ace1;}})});}_0x19ec5e=_[_0x0982('0x3e')]({},_0x19ec5e,_0x12e2cd[_0x0982('0x40')]);var _0x34206b={'where':_0x19ec5e[_0x0982('0x3d')]};return db[_0x0982('0x2e')][_0x0982('0x20')](_0x34206b)['then'](function(_0x32641b){_0x1a1fbe['count']=_0x32641b;if(_0x12e2cd[_0x0982('0x34')][_0x0982('0x41')]){_0x19ec5e[_0x0982('0x42')]=[{'all':!![]}];}return db[_0x0982('0x2e')]['findAll'](_0x19ec5e);})[_0x0982('0x28')](function(_0x16d774){_0x1a1fbe[_0x0982('0x43')]=_0x16d774;return _0x1a1fbe;})[_0x0982('0x28')](respondWithFilteredResult(_0x2e4aa1,_0x19ec5e))[_0x0982('0x44')](handleError(_0x2e4aa1,null));};exports[_0x0982('0x45')]=function(_0x122564,_0x5854c5){var _0x5c77a7={'raw':!![],'where':{'id':_0x122564[_0x0982('0x46')]['id']}},_0x3c1964={};_0x3c1964[_0x0982('0x33')]=_[_0x0982('0x47')](db[_0x0982('0x2e')][_0x0982('0x2f')]);_0x3c1964[_0x0982('0x34')]=_[_0x0982('0x47')](_0x122564[_0x0982('0x34')]);_0x3c1964['filters']=_[_0x0982('0x36')](_0x3c1964[_0x0982('0x33')],_0x3c1964[_0x0982('0x34')]);_0x5c77a7['attributes']=_[_0x0982('0x36')](_0x3c1964[_0x0982('0x33')],qs[_0x0982('0x37')](_0x122564['query'][_0x0982('0x37')]));_0x5c77a7[_0x0982('0x35')]=_0x5c77a7['attributes'][_0x0982('0x38')]?_0x5c77a7[_0x0982('0x35')]:_0x3c1964[_0x0982('0x33')];if(_0x122564[_0x0982('0x34')][_0x0982('0x41')]){_0x5c77a7['include']=[{'all':!![]}];}_0x5c77a7=_[_0x0982('0x3e')]({},_0x5c77a7,_0x122564[_0x0982('0x40')]);return db['ServicenowField']['find'](_0x5c77a7)[_0x0982('0x28')](handleEntityNotFound(_0x5854c5,null))[_0x0982('0x28')](respondWithResult(_0x5854c5,null))[_0x0982('0x44')](handleError(_0x5854c5,null));};exports[_0x0982('0x48')]=function(_0x34b9fa,_0x55ea95){return db[_0x0982('0x2e')][_0x0982('0x48')](_0x34b9fa[_0x0982('0x49')],{})[_0x0982('0x28')](respondWithResult(_0x55ea95,0xc9))[_0x0982('0x44')](handleError(_0x55ea95,null));};exports[_0x0982('0x27')]=function(_0x2ea230,_0x63332b){if(_0x2ea230[_0x0982('0x49')]['id']){delete _0x2ea230[_0x0982('0x49')]['id'];}return db[_0x0982('0x2e')]['find']({'where':{'id':_0x2ea230[_0x0982('0x46')]['id']}})['then'](handleEntityNotFound(_0x63332b,null))[_0x0982('0x28')](saveUpdates(_0x2ea230[_0x0982('0x49')],null))[_0x0982('0x28')](respondWithResult(_0x63332b,null))['catch'](handleError(_0x63332b,null));};exports[_0x0982('0x29')]=function(_0x55da53,_0xe7bb31){return db[_0x0982('0x2e')][_0x0982('0x4a')]({'where':{'id':_0x55da53['params']['id']}})[_0x0982('0x28')](handleEntityNotFound(_0xe7bb31,null))[_0x0982('0x28')](removeEntity(_0xe7bb31,null))['catch'](handleError(_0xe7bb31,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index 5679200..2f267a6 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 _0x0347=['./intServicenowField.attributes','ServicenowField','int_servicenow_fields','idField','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x232a42,_0x5c9b1a){var _0x38b2dc=function(_0x41314f){while(--_0x41314f){_0x232a42['push'](_0x232a42['shift']());}};_0x38b2dc(++_0x5c9b1a);}(_0x0347,0x1f0));var _0x7034=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x0347[_0x3e5086];return _0xfeb102;};'use strict';var _=require('lodash');var util=require(_0x7034('0x0'));var logger=require(_0x7034('0x1'))(_0x7034('0x2'));var moment=require(_0x7034('0x3'));var BPromise=require(_0x7034('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7034('0x5'));var rimraf=require(_0x7034('0x6'));var config=require(_0x7034('0x7'));var attributes=require(_0x7034('0x8'));module['exports']=function(_0x5c3c83,_0x381957){return _0x5c3c83['define'](_0x7034('0x9'),attributes,{'tableName':_0x7034('0xa'),'paranoid':![],'indexes':[{'name':'servicenow_unique_index','fields':[_0x7034('0xb'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3a83=['bluebird','request-promise','rimraf','../../config/environment','./intServicenowField.attributes','define','ServicenowField','int_servicenow_fields','servicenow_unique_index','idField','util','api','moment'];(function(_0x1bfc8b,_0x40c019){var _0x4d7763=function(_0x3e7929){while(--_0x3e7929){_0x1bfc8b['push'](_0x1bfc8b['shift']());}};_0x4d7763(++_0x40c019);}(_0x3a83,0x7f));var _0x33a8=function(_0x2fefe8,_0x21393d){_0x2fefe8=_0x2fefe8-0x0;var _0xada138=_0x3a83[_0x2fefe8];return _0xada138;};'use strict';var _=require('lodash');var util=require(_0x33a8('0x0'));var logger=require('../../config/logger')(_0x33a8('0x1'));var moment=require(_0x33a8('0x2'));var BPromise=require(_0x33a8('0x3'));var rp=require(_0x33a8('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x33a8('0x5'));var config=require(_0x33a8('0x6'));var attributes=require(_0x33a8('0x7'));module['exports']=function(_0x42c4b2,_0x1f4838){return _0x42c4b2[_0x33a8('0x8')](_0x33a8('0x9'),attributes,{'tableName':_0x33a8('0xa'),'paranoid':![],'indexes':[{'name':_0x33a8('0xb'),'fields':[_0x33a8('0xc'),'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 8e4210d..e9e5ce3 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 _0xcb91=['stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s'];(function(_0x22d927,_0x1fc288){var _0x5422fb=function(_0x2ab415){while(--_0x2ab415){_0x22d927['push'](_0x22d927['shift']());}};_0x5422fb(++_0x1fc288);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x3cec8c,_0x3f6c1d){_0x3cec8c=_0x3cec8c-0x0;var _0x38032e=_0xcb91[_0x3cec8c];return _0x38032e;};'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')]('ServicenowField,\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 +var _0xf4eb=['ServicenowField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x12baa8,_0x43ce92){var _0x49e7b7=function(_0x53498f){while(--_0x53498f){_0x12baa8['push'](_0x12baa8['shift']());}};_0x49e7b7(++_0x43ce92);}(_0xf4eb,0xec));var _0xbf4e=function(_0x3e3019,_0x4689ed){_0x3e3019=_0x3e3019-0x0;var _0x4f2ae2=_0xf4eb[_0x3e3019];return _0x4f2ae2;};'use strict';var _=require(_0xbf4e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbf4e('0x1'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbf4e('0x2'))(_0xbf4e('0x3'));var config=require(_0xbf4e('0x4'));var jayson=require(_0xbf4e('0x5'));var client=jayson[_0xbf4e('0x6')][_0xbf4e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x15b99f,_0x540736,_0x449d55){return new BPromise(function(_0x5013c2,_0x5e23d4){return client[_0xbf4e('0x8')](_0x15b99f,_0x449d55)[_0xbf4e('0x9')](function(_0xcc4097){logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));logger[_0xbf4e('0xd')]('ServicenowField,\x20%s,\x20%s,\x20%s',_0x540736,'request\x20sent',JSON[_0xbf4e('0xe')](_0xcc4097));if(_0xcc4097['error']){if(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x10')]===0x1f4){logger['error'](_0xbf4e('0xb'),_0x540736,_0xcc4097['error']['message']);return _0x5e23d4(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);}logger[_0xbf4e('0xf')](_0xbf4e('0xb'),_0x540736,_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);return _0x5013c2(_0xcc4097['error']['message']);}else{logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));_0x5013c2(_0xcc4097['result'][_0xbf4e('0x11')]);}})[_0xbf4e('0x12')](function(_0x912fc0){logger[_0xbf4e('0xf')]('ServicenowField,\x20%s,\x20%s',_0x540736,_0x912fc0);_0x5e23d4(_0x912fc0);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index bccc0fb..40db92c 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(_0x157e5e,_0x179639){var _0x2d692d=function(_0x359fb4){while(--_0x359fb4){_0x157e5e['push'](_0x157e5e['shift']());}};_0x2d692d(++_0x179639);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file +var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x3b318f,_0x4d8760){var _0x11a804=function(_0x2661f3){while(--_0x2661f3){_0x3b318f['push'](_0x3b318f['shift']());}};_0x11a804(++_0x4d8760);}(_0x9957,0x93));var _0x7995=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x9957[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js index de0ca15..395a4d3 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(_0x3af94f,_0x42b4e3){var _0x46cc4b=function(_0x4656c3){while(--_0x4656c3){_0x3af94f['push'](_0x3af94f['shift']());}};_0x46cc4b(++_0x42b4e3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0xa9e0[_0x220dbb];return _0x2b77de;};'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(_0x3570bd,_0x1dc55b){var _0x415862=function(_0x2dab5f){while(--_0x2dab5f){_0x3570bd['push'](_0x3570bd['shift']());}};_0x415862(++_0x1dc55b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xa9e0[_0x40ac5e];return _0x2839d6;};'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 c3ce8ed..7b19e42 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 _0x41d8=['Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','count','set','Content-Range','apply','reject','update','then','destroy','stack','name','send','index','map','fieldName','type','model','keys','query','filters','fields','attributes','length','hasOwnProperty','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','SugarcrmAccount','rawAttributes','intersection','create','body','find','params','getConfigurations','order','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','SugarcrmField','getFields','assigned_user_id','created_by','description','date_start','duration_minutes','parent_type','direction','findOne','password','remoteUri','substring','lastIndexOf','POST','format','%s%s','/service/v4_1/rest.php','login','JSON','stringify','PLAIN','xCALLY\x20Motion\x20Integration','Password\x20Expired','get_module_fields','Calls','values','module_fields','remove','includes','label','endsWith','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','test'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x41d8,0xed));var _0x841d=function(_0x3c22e0,_0x1dc6ea){_0x3c22e0=_0x3c22e0-0x0;var _0x215811=_0x41d8[_0x3c22e0];return _0x215811;};'use strict';var emlformat=require(_0x841d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x841d('0x1'));var jsonpatch=require(_0x841d('0x2'));var rp=require(_0x841d('0x3'));var moment=require(_0x841d('0x4'));var BPromise=require(_0x841d('0x5'));var Mustache=require(_0x841d('0x6'));var util=require('util');var path=require('path');var sox=require(_0x841d('0x7'));var csv=require(_0x841d('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x841d('0x9'));var _=require(_0x841d('0xa'));var squel=require(_0x841d('0xb'));var crypto=require(_0x841d('0xc'));var jsforce=require(_0x841d('0xd'));var deskjs=require(_0x841d('0xe'));var toCsv=require('to-csv');var querystring=require(_0x841d('0xf'));var Papa=require('papaparse');var Redis=require(_0x841d('0x10'));var authService=require(_0x841d('0x11'));var qs=require(_0x841d('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x841d('0x13'))(_0x841d('0x14'));var utils=require('../../config/utils');var config=require(_0x841d('0x15'));var licenseUtil=require(_0x841d('0x16'));var db=require(_0x841d('0x17'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x2f19d3,_0x3a9f8e){_0x3a9f8e=_0x3a9f8e||0xcc;return function(_0x45e7b5){if(_0x45e7b5){return _0x2f19d3[_0x841d('0x18')](_0x3a9f8e);}return _0x2f19d3[_0x841d('0x19')](_0x3a9f8e)['end']();};}function respondWithResult(_0xdbb836,_0xc866ac){_0xc866ac=_0xc866ac||0xc8;return function(_0x149e63){if(_0x149e63){return _0xdbb836['status'](_0xc866ac)[_0x841d('0x1a')](_0x149e63);}};}function respondWithFilteredResult(_0x165d6f,_0x4de9aa){return function(_0x4b25d8){if(_0x4b25d8){var _0x3d250e=typeof _0x4de9aa[_0x841d('0x1b')]==='undefined'&&typeof _0x4de9aa[_0x841d('0x1c')]==='undefined';var _0x1557ee=_0x4b25d8[_0x841d('0x1d')];var _0x2972c9=_0x3d250e?0x0:_0x4de9aa[_0x841d('0x1b')];var _0x2e5630=_0x3d250e?_0x4b25d8[_0x841d('0x1d')]:_0x4de9aa[_0x841d('0x1b')]+_0x4de9aa['limit'];var _0x543250;if(_0x2e5630>=_0x1557ee){_0x2e5630=_0x1557ee;_0x543250=0xc8;}else{_0x543250=0xce;}_0x165d6f[_0x841d('0x19')](_0x543250);return _0x165d6f[_0x841d('0x1e')](_0x841d('0x1f'),_0x2972c9+'-'+_0x2e5630+'/'+_0x1557ee)[_0x841d('0x1a')](_0x4b25d8);}return null;};}function patchUpdates(_0x466382){return function(_0x2ea791){try{jsonpatch[_0x841d('0x20')](_0x2ea791,_0x466382,!![]);}catch(_0x4b9b16){return BPromise[_0x841d('0x21')](_0x4b9b16);}return _0x2ea791['save']();};}function saveUpdates(_0x331577,_0x18e225){return function(_0x33001c){if(_0x33001c){return _0x33001c[_0x841d('0x22')](_0x331577)[_0x841d('0x23')](function(_0x5b727c){return _0x5b727c;});}return null;};}function removeEntity(_0x4b905f,_0x4005d9){return function(_0x303a9b){if(_0x303a9b){return _0x303a9b[_0x841d('0x24')]()[_0x841d('0x23')](function(){_0x4b905f[_0x841d('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x193bd3,_0x1151cb){return function(_0x171f2b){if(!_0x171f2b){_0x193bd3[_0x841d('0x18')](0x194);}return _0x171f2b;};}function handleError(_0x82e139,_0x149c9e){_0x149c9e=_0x149c9e||0x1f4;return function(_0x566f43){logger['error'](_0x566f43[_0x841d('0x25')]);if(_0x566f43[_0x841d('0x26')]){delete _0x566f43['name'];}_0x82e139[_0x841d('0x19')](_0x149c9e)[_0x841d('0x27')](_0x566f43);};}exports[_0x841d('0x28')]=function(_0x3f452d,_0x31271a){var _0x5ab7e6={},_0x3ec158={},_0x28abb4={'count':0x0,'rows':[]};var _0x57ec81=_[_0x841d('0x29')](db['SugarcrmAccount']['rawAttributes'],function(_0x53fad3){return{'name':_0x53fad3[_0x841d('0x2a')],'type':_0x53fad3[_0x841d('0x2b')]['key']};});_0x3ec158[_0x841d('0x2c')]=_[_0x841d('0x29')](_0x57ec81,_0x841d('0x26'));_0x3ec158['query']=_[_0x841d('0x2d')](_0x3f452d[_0x841d('0x2e')]);_0x3ec158[_0x841d('0x2f')]=_['intersection'](_0x3ec158[_0x841d('0x2c')],_0x3ec158[_0x841d('0x2e')]);_0x5ab7e6['attributes']=_['intersection'](_0x3ec158[_0x841d('0x2c')],qs[_0x841d('0x30')](_0x3f452d[_0x841d('0x2e')][_0x841d('0x30')]));_0x5ab7e6[_0x841d('0x31')]=_0x5ab7e6['attributes'][_0x841d('0x32')]?_0x5ab7e6[_0x841d('0x31')]:_0x3ec158['model'];if(!_0x3f452d[_0x841d('0x2e')][_0x841d('0x33')]('nolimit')){_0x5ab7e6[_0x841d('0x1c')]=qs[_0x841d('0x1c')](_0x3f452d[_0x841d('0x2e')][_0x841d('0x1c')]);_0x5ab7e6['offset']=qs['offset'](_0x3f452d['query']['offset']);}_0x5ab7e6['order']=qs[_0x841d('0x34')](_0x3f452d[_0x841d('0x2e')][_0x841d('0x34')]);_0x5ab7e6['where']=qs[_0x841d('0x2f')](_[_0x841d('0x35')](_0x3f452d[_0x841d('0x2e')],_0x3ec158[_0x841d('0x2f')]),_0x57ec81);if(_0x3f452d[_0x841d('0x2e')][_0x841d('0x36')]){_0x5ab7e6[_0x841d('0x37')]=_[_0x841d('0x38')](_0x5ab7e6['where'],{'$or':_[_0x841d('0x29')](_0x57ec81,function(_0x21ed80){if(_0x21ed80[_0x841d('0x2b')]!==_0x841d('0x39')){var _0x4b3c46={};_0x4b3c46[_0x21ed80[_0x841d('0x26')]]={'$like':'%'+_0x3f452d['query'][_0x841d('0x36')]+'%'};return _0x4b3c46;}})});}_0x5ab7e6=_[_0x841d('0x38')]({},_0x5ab7e6,_0x3f452d[_0x841d('0x3a')]);var _0x5182d0={'where':_0x5ab7e6[_0x841d('0x37')]};return db['SugarcrmAccount'][_0x841d('0x1d')](_0x5182d0)[_0x841d('0x23')](function(_0x1e35e5){_0x28abb4[_0x841d('0x1d')]=_0x1e35e5;if(_0x3f452d[_0x841d('0x2e')][_0x841d('0x3b')]){_0x5ab7e6[_0x841d('0x3c')]=[{'all':!![]}];}return db['SugarcrmAccount'][_0x841d('0x3d')](_0x5ab7e6);})['then'](function(_0xf61427){_0x28abb4['rows']=_0xf61427;return _0x28abb4;})[_0x841d('0x23')](respondWithFilteredResult(_0x31271a,_0x5ab7e6))[_0x841d('0x3e')](handleError(_0x31271a,null));};exports[_0x841d('0x3f')]=function(_0x356191,_0xa1dcee){var _0x88a6b7={'raw':![],'where':{'id':_0x356191['params']['id']}},_0x5c0821={};_0x5c0821[_0x841d('0x2c')]=_['keys'](db[_0x841d('0x40')][_0x841d('0x41')]);_0x5c0821[_0x841d('0x2e')]=_['keys'](_0x356191[_0x841d('0x2e')]);_0x5c0821['filters']=_[_0x841d('0x42')](_0x5c0821[_0x841d('0x2c')],_0x5c0821[_0x841d('0x2e')]);_0x88a6b7['attributes']=_['intersection'](_0x5c0821[_0x841d('0x2c')],qs['fields'](_0x356191[_0x841d('0x2e')]['fields']));_0x88a6b7['attributes']=_0x88a6b7['attributes'][_0x841d('0x32')]?_0x88a6b7['attributes']:_0x5c0821['model'];if(_0x356191['query'][_0x841d('0x3b')]){_0x88a6b7['include']=[{'all':!![]}];}_0x88a6b7=_[_0x841d('0x38')]({},_0x88a6b7,_0x356191[_0x841d('0x3a')]);return db[_0x841d('0x40')]['find'](_0x88a6b7)[_0x841d('0x23')](handleEntityNotFound(_0xa1dcee,null))[_0x841d('0x23')](respondWithResult(_0xa1dcee,null))[_0x841d('0x3e')](handleError(_0xa1dcee,null));};exports[_0x841d('0x43')]=function(_0x338f1f,_0x9d4d1d){return db[_0x841d('0x40')][_0x841d('0x43')](_0x338f1f['body'],{})[_0x841d('0x23')](respondWithResult(_0x9d4d1d,0xc9))[_0x841d('0x3e')](handleError(_0x9d4d1d,null));};exports[_0x841d('0x22')]=function(_0x4ef8f3,_0x34b96b){if(_0x4ef8f3[_0x841d('0x44')]['id']){delete _0x4ef8f3[_0x841d('0x44')]['id'];}return db['SugarcrmAccount'][_0x841d('0x45')]({'where':{'id':_0x4ef8f3[_0x841d('0x46')]['id']}})[_0x841d('0x23')](handleEntityNotFound(_0x34b96b,null))['then'](saveUpdates(_0x4ef8f3[_0x841d('0x44')],null))[_0x841d('0x23')](respondWithResult(_0x34b96b,null))[_0x841d('0x3e')](handleError(_0x34b96b,null));};exports[_0x841d('0x24')]=function(_0x4e75b6,_0x277c23){return db[_0x841d('0x40')][_0x841d('0x45')]({'where':{'id':_0x4e75b6[_0x841d('0x46')]['id']}})[_0x841d('0x23')](handleEntityNotFound(_0x277c23,null))['then'](removeEntity(_0x277c23,null))[_0x841d('0x3e')](handleError(_0x277c23,null));};exports[_0x841d('0x47')]=function(_0xb79813,_0x258e28,_0x3e7604){var _0x303587={};var _0x48cc87={};var _0x146525;var _0x4e8069;return db[_0x841d('0x40')]['findOne']({'where':{'id':_0xb79813[_0x841d('0x46')]['id']}})[_0x841d('0x23')](handleEntityNotFound(_0x258e28,null))['then'](function(_0x4c1ee6){if(_0x4c1ee6){_0x146525=_0x4c1ee6;_0x48cc87[_0x841d('0x2c')]=_[_0x841d('0x2d')](db['SugarcrmConfiguration'][_0x841d('0x41')]);_0x48cc87['query']=_[_0x841d('0x2d')](_0xb79813[_0x841d('0x2e')]);_0x48cc87[_0x841d('0x2f')]=_[_0x841d('0x42')](_0x48cc87[_0x841d('0x2c')],_0x48cc87[_0x841d('0x2e')]);_0x303587['attributes']=_['intersection'](_0x48cc87[_0x841d('0x2c')],qs['fields'](_0xb79813[_0x841d('0x2e')][_0x841d('0x30')]));_0x303587['attributes']=_0x303587['attributes'][_0x841d('0x32')]?_0x303587[_0x841d('0x31')]:_0x48cc87['model'];_0x303587[_0x841d('0x48')]=qs[_0x841d('0x34')](_0xb79813[_0x841d('0x2e')][_0x841d('0x34')]);_0x303587['where']=qs[_0x841d('0x2f')](_[_0x841d('0x35')](_0xb79813[_0x841d('0x2e')],_0x48cc87[_0x841d('0x2f')]));if(_0xb79813['query'][_0x841d('0x36')]){_0x303587[_0x841d('0x37')]=_[_0x841d('0x38')](_0x303587[_0x841d('0x37')],{'$or':_[_0x841d('0x29')](_0x303587[_0x841d('0x31')],function(_0x75625d){var _0x3f7b7c={};_0x3f7b7c[_0x75625d]={'$like':'%'+_0xb79813[_0x841d('0x2e')]['filter']+'%'};return _0x3f7b7c;})});}_0x303587=_['merge']({},_0x303587,_0xb79813['options']);return _0x146525['getConfigurations'](_0x303587);}})[_0x841d('0x23')](function(_0x590080){if(_0x590080){_0x4e8069=_0x590080[_0x841d('0x32')];if(!_0xb79813[_0x841d('0x2e')][_0x841d('0x33')](_0x841d('0x49'))){_0x303587[_0x841d('0x1c')]=qs[_0x841d('0x1c')](_0xb79813[_0x841d('0x2e')][_0x841d('0x1c')]);_0x303587[_0x841d('0x1b')]=qs['offset'](_0xb79813['query'][_0x841d('0x1b')]);}return _0x146525[_0x841d('0x47')](_0x303587);}})[_0x841d('0x23')](function(_0x260987){if(_0x260987){return _0x260987?{'count':_0x4e8069,'rows':_0x260987}:null;}})['then'](respondWithResult(_0x258e28,null))[_0x841d('0x3e')](handleError(_0x258e28,null));};exports[_0x841d('0x4a')]=function(_0x17f5fc,_0x291a46,_0x14a206){if(_0x17f5fc['body']['id']){delete _0x17f5fc['body']['id'];}return db[_0x841d('0x40')]['findOne']({'where':{'id':_0x17f5fc['params']['id']}})[_0x841d('0x23')](handleEntityNotFound(_0x291a46,null))[_0x841d('0x23')](function(_0x24e135){if(_0x24e135){_0x17f5fc[_0x841d('0x44')][_0x841d('0x4b')]=_0x24e135['id'];_0x17f5fc[_0x841d('0x44')][_0x841d('0x4c')]=integrations[_0x841d('0x4d')](_0x17f5fc[_0x841d('0x44')][_0x841d('0x4e')],_0x17f5fc[_0x841d('0x44')]['type']);_0x17f5fc['body'][_0x841d('0x4f')]=integrations[_0x841d('0x50')](_0x17f5fc['body'][_0x841d('0x4e')],_0x17f5fc[_0x841d('0x44')][_0x841d('0x2b')]);return db['SugarcrmConfiguration'][_0x841d('0x43')](_0x17f5fc['body'],{'include':[{'model':db[_0x841d('0x51')],'as':_0x841d('0x4c')},{'model':db[_0x841d('0x51')],'as':_0x841d('0x4f')}]});}return null;})[_0x841d('0x23')](respondWithResult(_0x291a46,null))['catch'](handleError(_0x291a46,null));};exports[_0x841d('0x52')]=function(_0x147c79,_0xc11ce9,_0xc0d3ac){var _0x37ebe2='';var _0x232488=['id',_0x841d('0x26'),_0x841d('0x53'),_0x841d('0x54'),_0x841d('0x55'),_0x841d('0x56'),'duration_hours',_0x841d('0x57'),'parent_id',_0x841d('0x58'),'parent_name',_0x841d('0x59')];return db['SugarcrmAccount'][_0x841d('0x5a')]({'where':{'id':_0x147c79[_0x841d('0x46')]['id']},'attributes':['id','username',_0x841d('0x5b'),_0x841d('0x5c')]})['then'](handleEntityNotFound(_0xc11ce9,null))[_0x841d('0x23')](function(_0x20167a){if(_0x20167a){_0x37ebe2=_0x20167a[_0x841d('0x5c')];var _0x56d887=_0x37ebe2['slice'](-0x1);if(_0x56d887==='/'){_0x37ebe2=_0x37ebe2[_0x841d('0x5d')](0x0,_0x37ebe2[_0x841d('0x5e')](_0x56d887));}return rp({'method':_0x841d('0x5f'),'uri':util[_0x841d('0x60')](_0x841d('0x61'),_0x37ebe2,_0x841d('0x62')),'json':!![],'form':{'method':_0x841d('0x63'),'input_type':_0x841d('0x64'),'response_type':'JSON','rest_data':JSON[_0x841d('0x65')]({'user_auth':{'user_name':_0x20167a['username'],'password':_0x20167a['password'],'encryption':_0x841d('0x66')},'application':_0x841d('0x67')})}});}})[_0x841d('0x23')](function(_0x5fdb6a){if(_0x5fdb6a&&_0x5fdb6a['name']!=='Invalid\x20Login'&&_0x5fdb6a[_0x841d('0x26')]!==_0x841d('0x68')){return rp({'method':_0x841d('0x5f'),'uri':util[_0x841d('0x60')](_0x841d('0x61'),_0x37ebe2,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0x841d('0x69'),'input_type':_0x841d('0x64'),'response_type':_0x841d('0x64'),'rest_data':JSON[_0x841d('0x65')]({'session':_0x5fdb6a['id'],'module_name':_0x841d('0x6a')})}})[_0x841d('0x23')](function(_0x51a802){if(_0x51a802){var _0x2c96b2=_[_0x841d('0x6b')](_0x51a802[_0x841d('0x6c')]);_[_0x841d('0x6d')](_0x2c96b2,function(_0x4210a4){return _0x232488[_0x841d('0x6e')](_0x4210a4['name']);});return{'count':_0x2c96b2['length'],'rows':_[_0x841d('0x29')](_0x2c96b2,function(_0x143a2c){return{'id':_0x143a2c[_0x841d('0x26')],'name':_0x143a2c[_0x841d('0x6f')],'custom':_[_0x841d('0x70')](_0x143a2c[_0x841d('0x26')],'_c')?!![]:![],'options':_0x143a2c[_0x841d('0x3a')]?_['map'](_[_0x841d('0x6b')](_0x143a2c[_0x841d('0x3a')]),function(_0x282fbf){return{'name':_0x282fbf['value'],'value':_0x282fbf[_0x841d('0x26')]};}):[]};})};}})[_0x841d('0x23')](respondWithResult(_0xc11ce9,null))[_0x841d('0x3e')](function(_0x19661c){var _0x14c71d=_0x147c79[_0x841d('0x2e')]['test']?0x1f4:_0x19661c[_0x841d('0x71')]||0x1f4;logger[_0x841d('0x72')](_0x841d('0x73'),_0x841d('0x52'),_0x14c71d,JSON[_0x841d('0x65')](_0x19661c));delete _0x19661c['name'];if(_0x14c71d===0x191){_0x14c71d=0x190;}_0xc11ce9[_0x841d('0x19')](_0x14c71d)['send'](_0x147c79['query'][_0x841d('0x74')]?{'message':'Wrong\x20credentials','statusCode':_0x19661c[_0x841d('0x71')]}:_0x19661c);});}else{var _0x3afd7b=0x1f4;_0xc11ce9[_0x841d('0x19')](_0x3afd7b)[_0x841d('0x27')]({'message':_0x841d('0x75'),'statusCode':0x190});}});}; \ No newline at end of file +var _0xab6f=['duration_hours','duration_minutes','parent_name','direction','remoteUri','substring','lastIndexOf','format','%s%s','/service/v4_1/rest.php','login','JSON','stringify','username','password','PLAIN','xCALLY\x20Motion\x20Integration','POST','get_module_fields','values','module_fields','remove','includes','label','endsWith','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','send','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','fs-extra','squel','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','../../components/integrations/configuration','sendStatus','status','end','json','offset','limit','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name','index','map','SugarcrmAccount','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','include','findAll','rows','catch','show','find','create','body','params','getConfigurations','findOne','SugarcrmConfiguration','order','length','addConfiguration','AccountId','channel','Descriptions','SugarcrmField','Subjects','getFields','assigned_user_id'];(function(_0xae1ecf,_0x57455c){var _0x3d46cd=function(_0x4e58d9){while(--_0x4e58d9){_0xae1ecf['push'](_0xae1ecf['shift']());}};_0x3d46cd(++_0x57455c);}(_0xab6f,0x177));var _0xfab6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xab6f[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xfab6('0x0'));var rimraf=require(_0xfab6('0x1'));var zipdir=require(_0xfab6('0x2'));var jsonpatch=require(_0xfab6('0x3'));var rp=require(_0xfab6('0x4'));var moment=require(_0xfab6('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xfab6('0x6'));var path=require(_0xfab6('0x7'));var sox=require(_0xfab6('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfab6('0x9'));var _=require('lodash');var squel=require(_0xfab6('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xfab6('0xb'));var toCsv=require(_0xfab6('0xc'));var querystring=require(_0xfab6('0xd'));var Papa=require(_0xfab6('0xe'));var Redis=require(_0xfab6('0xf'));var authService=require(_0xfab6('0x10'));var qs=require(_0xfab6('0x11'));var as=require(_0xfab6('0x12'));var hardwareService=require(_0xfab6('0x13'));var logger=require('../../config/logger')(_0xfab6('0x14'));var utils=require(_0xfab6('0x15'));var config=require(_0xfab6('0x16'));var licenseUtil=require(_0xfab6('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0xfab6('0x18'));function respondWithStatusCode(_0x2ecc89,_0x747e75){_0x747e75=_0x747e75||0xcc;return function(_0x1d4471){if(_0x1d4471){return _0x2ecc89[_0xfab6('0x19')](_0x747e75);}return _0x2ecc89[_0xfab6('0x1a')](_0x747e75)[_0xfab6('0x1b')]();};}function respondWithResult(_0x353bc4,_0x5de3d2){_0x5de3d2=_0x5de3d2||0xc8;return function(_0x59764d){if(_0x59764d){return _0x353bc4[_0xfab6('0x1a')](_0x5de3d2)[_0xfab6('0x1c')](_0x59764d);}};}function respondWithFilteredResult(_0x47118e,_0x21e847){return function(_0xb4f55b){if(_0xb4f55b){var _0x22e315=typeof _0x21e847[_0xfab6('0x1d')]==='undefined'&&typeof _0x21e847[_0xfab6('0x1e')]==='undefined';var _0x429abd=_0xb4f55b[_0xfab6('0x1f')];var _0x5dbd8d=_0x22e315?0x0:_0x21e847[_0xfab6('0x1d')];var _0x2f84b5=_0x22e315?_0xb4f55b['count']:_0x21e847[_0xfab6('0x1d')]+_0x21e847[_0xfab6('0x1e')];var _0x7027d2;if(_0x2f84b5>=_0x429abd){_0x2f84b5=_0x429abd;_0x7027d2=0xc8;}else{_0x7027d2=0xce;}_0x47118e[_0xfab6('0x1a')](_0x7027d2);return _0x47118e[_0xfab6('0x20')](_0xfab6('0x21'),_0x5dbd8d+'-'+_0x2f84b5+'/'+_0x429abd)[_0xfab6('0x1c')](_0xb4f55b);}return null;};}function patchUpdates(_0x45d2ef){return function(_0x1a826b){try{jsonpatch['apply'](_0x1a826b,_0x45d2ef,!![]);}catch(_0x523103){return BPromise[_0xfab6('0x22')](_0x523103);}return _0x1a826b[_0xfab6('0x23')]();};}function saveUpdates(_0x58c994,_0x18ed49){return function(_0x2969dd){if(_0x2969dd){return _0x2969dd[_0xfab6('0x24')](_0x58c994)[_0xfab6('0x25')](function(_0x3071b2){return _0x3071b2;});}return null;};}function removeEntity(_0x6a531a,_0x3384cb){return function(_0x966aee){if(_0x966aee){return _0x966aee[_0xfab6('0x26')]()[_0xfab6('0x25')](function(){_0x6a531a[_0xfab6('0x1a')](0xcc)[_0xfab6('0x1b')]();});}};}function handleEntityNotFound(_0x552e0d,_0xba6cf){return function(_0x25177d){if(!_0x25177d){_0x552e0d[_0xfab6('0x19')](0x194);}return _0x25177d;};}function handleError(_0x40de17,_0x1c6212){_0x1c6212=_0x1c6212||0x1f4;return function(_0x400791){logger[_0xfab6('0x27')](_0x400791[_0xfab6('0x28')]);if(_0x400791[_0xfab6('0x29')]){delete _0x400791[_0xfab6('0x29')];}_0x40de17[_0xfab6('0x1a')](_0x1c6212)['send'](_0x400791);};}exports[_0xfab6('0x2a')]=function(_0x13009d,_0x221da3){var _0xdafb75={},_0x41193c={},_0x528977={'count':0x0,'rows':[]};var _0x56dddc=_[_0xfab6('0x2b')](db[_0xfab6('0x2c')][_0xfab6('0x2d')],function(_0x31d37c){return{'name':_0x31d37c[_0xfab6('0x2e')],'type':_0x31d37c[_0xfab6('0x2f')]['key']};});_0x41193c[_0xfab6('0x30')]=_['map'](_0x56dddc,'name');_0x41193c[_0xfab6('0x31')]=_[_0xfab6('0x32')](_0x13009d[_0xfab6('0x31')]);_0x41193c[_0xfab6('0x33')]=_[_0xfab6('0x34')](_0x41193c[_0xfab6('0x30')],_0x41193c[_0xfab6('0x31')]);_0xdafb75[_0xfab6('0x35')]=_[_0xfab6('0x34')](_0x41193c['model'],qs[_0xfab6('0x36')](_0x13009d[_0xfab6('0x31')][_0xfab6('0x36')]));_0xdafb75['attributes']=_0xdafb75[_0xfab6('0x35')]['length']?_0xdafb75[_0xfab6('0x35')]:_0x41193c[_0xfab6('0x30')];if(!_0x13009d[_0xfab6('0x31')][_0xfab6('0x37')](_0xfab6('0x38'))){_0xdafb75[_0xfab6('0x1e')]=qs[_0xfab6('0x1e')](_0x13009d[_0xfab6('0x31')][_0xfab6('0x1e')]);_0xdafb75[_0xfab6('0x1d')]=qs['offset'](_0x13009d[_0xfab6('0x31')][_0xfab6('0x1d')]);}_0xdafb75['order']=qs['sort'](_0x13009d[_0xfab6('0x31')][_0xfab6('0x39')]);_0xdafb75[_0xfab6('0x3a')]=qs['filters'](_[_0xfab6('0x3b')](_0x13009d[_0xfab6('0x31')],_0x41193c[_0xfab6('0x33')]),_0x56dddc);if(_0x13009d[_0xfab6('0x31')][_0xfab6('0x3c')]){_0xdafb75[_0xfab6('0x3a')]=_[_0xfab6('0x3d')](_0xdafb75['where'],{'$or':_[_0xfab6('0x2b')](_0x56dddc,function(_0x54f6ba){if(_0x54f6ba[_0xfab6('0x2f')]!=='VIRTUAL'){var _0x138206={};_0x138206[_0x54f6ba[_0xfab6('0x29')]]={'$like':'%'+_0x13009d[_0xfab6('0x31')]['filter']+'%'};return _0x138206;}})});}_0xdafb75=_['merge']({},_0xdafb75,_0x13009d[_0xfab6('0x3e')]);var _0x58952d={'where':_0xdafb75[_0xfab6('0x3a')]};return db[_0xfab6('0x2c')][_0xfab6('0x1f')](_0x58952d)[_0xfab6('0x25')](function(_0x182cf0){_0x528977[_0xfab6('0x1f')]=_0x182cf0;if(_0x13009d[_0xfab6('0x31')]['includeAll']){_0xdafb75[_0xfab6('0x3f')]=[{'all':!![]}];}return db[_0xfab6('0x2c')][_0xfab6('0x40')](_0xdafb75);})[_0xfab6('0x25')](function(_0x105e5f){_0x528977[_0xfab6('0x41')]=_0x105e5f;return _0x528977;})[_0xfab6('0x25')](respondWithFilteredResult(_0x221da3,_0xdafb75))[_0xfab6('0x42')](handleError(_0x221da3,null));};exports[_0xfab6('0x43')]=function(_0x1edb62,_0x394529){var _0x1582f6={'raw':![],'where':{'id':_0x1edb62['params']['id']}},_0xfbebe1={};_0xfbebe1[_0xfab6('0x30')]=_[_0xfab6('0x32')](db[_0xfab6('0x2c')][_0xfab6('0x2d')]);_0xfbebe1[_0xfab6('0x31')]=_[_0xfab6('0x32')](_0x1edb62[_0xfab6('0x31')]);_0xfbebe1[_0xfab6('0x33')]=_[_0xfab6('0x34')](_0xfbebe1['model'],_0xfbebe1[_0xfab6('0x31')]);_0x1582f6[_0xfab6('0x35')]=_[_0xfab6('0x34')](_0xfbebe1[_0xfab6('0x30')],qs[_0xfab6('0x36')](_0x1edb62[_0xfab6('0x31')]['fields']));_0x1582f6[_0xfab6('0x35')]=_0x1582f6[_0xfab6('0x35')]['length']?_0x1582f6[_0xfab6('0x35')]:_0xfbebe1[_0xfab6('0x30')];if(_0x1edb62[_0xfab6('0x31')]['includeAll']){_0x1582f6[_0xfab6('0x3f')]=[{'all':!![]}];}_0x1582f6=_['merge']({},_0x1582f6,_0x1edb62[_0xfab6('0x3e')]);return db[_0xfab6('0x2c')][_0xfab6('0x44')](_0x1582f6)[_0xfab6('0x25')](handleEntityNotFound(_0x394529,null))[_0xfab6('0x25')](respondWithResult(_0x394529,null))[_0xfab6('0x42')](handleError(_0x394529,null));};exports[_0xfab6('0x45')]=function(_0x3bc51c,_0x297bd2){return db['SugarcrmAccount']['create'](_0x3bc51c['body'],{})[_0xfab6('0x25')](respondWithResult(_0x297bd2,0xc9))['catch'](handleError(_0x297bd2,null));};exports[_0xfab6('0x24')]=function(_0x2e93a6,_0x34cc75){if(_0x2e93a6[_0xfab6('0x46')]['id']){delete _0x2e93a6[_0xfab6('0x46')]['id'];}return db[_0xfab6('0x2c')][_0xfab6('0x44')]({'where':{'id':_0x2e93a6['params']['id']}})[_0xfab6('0x25')](handleEntityNotFound(_0x34cc75,null))[_0xfab6('0x25')](saveUpdates(_0x2e93a6[_0xfab6('0x46')],null))[_0xfab6('0x25')](respondWithResult(_0x34cc75,null))[_0xfab6('0x42')](handleError(_0x34cc75,null));};exports[_0xfab6('0x26')]=function(_0x540ec2,_0x6d59c0){return db[_0xfab6('0x2c')][_0xfab6('0x44')]({'where':{'id':_0x540ec2[_0xfab6('0x47')]['id']}})['then'](handleEntityNotFound(_0x6d59c0,null))[_0xfab6('0x25')](removeEntity(_0x6d59c0,null))[_0xfab6('0x42')](handleError(_0x6d59c0,null));};exports[_0xfab6('0x48')]=function(_0x27e7c8,_0x72e820,_0xdad90f){var _0x50e3ce={};var _0x1ad8fc={};var _0x3553f5;var _0x27ad2c;return db[_0xfab6('0x2c')][_0xfab6('0x49')]({'where':{'id':_0x27e7c8[_0xfab6('0x47')]['id']}})[_0xfab6('0x25')](handleEntityNotFound(_0x72e820,null))[_0xfab6('0x25')](function(_0x190fe0){if(_0x190fe0){_0x3553f5=_0x190fe0;_0x1ad8fc['model']=_[_0xfab6('0x32')](db[_0xfab6('0x4a')][_0xfab6('0x2d')]);_0x1ad8fc[_0xfab6('0x31')]=_[_0xfab6('0x32')](_0x27e7c8[_0xfab6('0x31')]);_0x1ad8fc[_0xfab6('0x33')]=_[_0xfab6('0x34')](_0x1ad8fc[_0xfab6('0x30')],_0x1ad8fc[_0xfab6('0x31')]);_0x50e3ce[_0xfab6('0x35')]=_['intersection'](_0x1ad8fc[_0xfab6('0x30')],qs['fields'](_0x27e7c8[_0xfab6('0x31')][_0xfab6('0x36')]));_0x50e3ce[_0xfab6('0x35')]=_0x50e3ce[_0xfab6('0x35')]['length']?_0x50e3ce[_0xfab6('0x35')]:_0x1ad8fc[_0xfab6('0x30')];_0x50e3ce[_0xfab6('0x4b')]=qs[_0xfab6('0x39')](_0x27e7c8[_0xfab6('0x31')][_0xfab6('0x39')]);_0x50e3ce[_0xfab6('0x3a')]=qs[_0xfab6('0x33')](_[_0xfab6('0x3b')](_0x27e7c8[_0xfab6('0x31')],_0x1ad8fc[_0xfab6('0x33')]));if(_0x27e7c8['query'][_0xfab6('0x3c')]){_0x50e3ce[_0xfab6('0x3a')]=_['merge'](_0x50e3ce[_0xfab6('0x3a')],{'$or':_[_0xfab6('0x2b')](_0x50e3ce[_0xfab6('0x35')],function(_0x1e61c8){var _0x258dac={};_0x258dac[_0x1e61c8]={'$like':'%'+_0x27e7c8[_0xfab6('0x31')][_0xfab6('0x3c')]+'%'};return _0x258dac;})});}_0x50e3ce=_[_0xfab6('0x3d')]({},_0x50e3ce,_0x27e7c8[_0xfab6('0x3e')]);return _0x3553f5[_0xfab6('0x48')](_0x50e3ce);}})[_0xfab6('0x25')](function(_0x53e146){if(_0x53e146){_0x27ad2c=_0x53e146[_0xfab6('0x4c')];if(!_0x27e7c8[_0xfab6('0x31')][_0xfab6('0x37')]('nolimit')){_0x50e3ce[_0xfab6('0x1e')]=qs['limit'](_0x27e7c8[_0xfab6('0x31')][_0xfab6('0x1e')]);_0x50e3ce[_0xfab6('0x1d')]=qs[_0xfab6('0x1d')](_0x27e7c8[_0xfab6('0x31')][_0xfab6('0x1d')]);}return _0x3553f5[_0xfab6('0x48')](_0x50e3ce);}})[_0xfab6('0x25')](function(_0x5f42a9){if(_0x5f42a9){return _0x5f42a9?{'count':_0x27ad2c,'rows':_0x5f42a9}:null;}})[_0xfab6('0x25')](respondWithResult(_0x72e820,null))[_0xfab6('0x42')](handleError(_0x72e820,null));};exports[_0xfab6('0x4d')]=function(_0x559e66,_0x3fc70a,_0x42a79a){if(_0x559e66[_0xfab6('0x46')]['id']){delete _0x559e66['body']['id'];}return db['SugarcrmAccount'][_0xfab6('0x49')]({'where':{'id':_0x559e66[_0xfab6('0x47')]['id']}})[_0xfab6('0x25')](handleEntityNotFound(_0x3fc70a,null))[_0xfab6('0x25')](function(_0x337886){if(_0x337886){_0x559e66[_0xfab6('0x46')][_0xfab6('0x4e')]=_0x337886['id'];_0x559e66[_0xfab6('0x46')]['Subjects']=integrations['getSubjects'](_0x559e66[_0xfab6('0x46')][_0xfab6('0x4f')],_0x559e66[_0xfab6('0x46')][_0xfab6('0x2f')]);_0x559e66[_0xfab6('0x46')][_0xfab6('0x50')]=integrations['getDescriptions'](_0x559e66[_0xfab6('0x46')][_0xfab6('0x4f')],_0x559e66[_0xfab6('0x46')][_0xfab6('0x2f')]);return db[_0xfab6('0x4a')]['create'](_0x559e66[_0xfab6('0x46')],{'include':[{'model':db[_0xfab6('0x51')],'as':_0xfab6('0x52')},{'model':db[_0xfab6('0x51')],'as':_0xfab6('0x50')}]});}return null;})['then'](respondWithResult(_0x3fc70a,null))[_0xfab6('0x42')](handleError(_0x3fc70a,null));};exports[_0xfab6('0x53')]=function(_0x46f88f,_0x54fc18,_0xe58ea9){var _0x5ae032='';var _0x5281d9=['id',_0xfab6('0x29'),_0xfab6('0x54'),'created_by','description','date_start',_0xfab6('0x55'),_0xfab6('0x56'),'parent_id','parent_type',_0xfab6('0x57'),_0xfab6('0x58')];return db[_0xfab6('0x2c')][_0xfab6('0x49')]({'where':{'id':_0x46f88f[_0xfab6('0x47')]['id']},'attributes':['id','username','password','remoteUri']})['then'](handleEntityNotFound(_0x54fc18,null))[_0xfab6('0x25')](function(_0x52b06d){if(_0x52b06d){_0x5ae032=_0x52b06d[_0xfab6('0x59')];var _0x575a7c=_0x5ae032['slice'](-0x1);if(_0x575a7c==='/'){_0x5ae032=_0x5ae032[_0xfab6('0x5a')](0x0,_0x5ae032[_0xfab6('0x5b')](_0x575a7c));}return rp({'method':'POST','uri':util[_0xfab6('0x5c')](_0xfab6('0x5d'),_0x5ae032,_0xfab6('0x5e')),'json':!![],'form':{'method':_0xfab6('0x5f'),'input_type':_0xfab6('0x60'),'response_type':_0xfab6('0x60'),'rest_data':JSON[_0xfab6('0x61')]({'user_auth':{'user_name':_0x52b06d[_0xfab6('0x62')],'password':_0x52b06d[_0xfab6('0x63')],'encryption':_0xfab6('0x64')},'application':_0xfab6('0x65')})}});}})[_0xfab6('0x25')](function(_0x397242){if(_0x397242&&_0x397242[_0xfab6('0x29')]!=='Invalid\x20Login'&&_0x397242['name']!=='Password\x20Expired'){return rp({'method':_0xfab6('0x66'),'uri':util[_0xfab6('0x5c')]('%s%s',_0x5ae032,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0xfab6('0x67'),'input_type':'JSON','response_type':_0xfab6('0x60'),'rest_data':JSON[_0xfab6('0x61')]({'session':_0x397242['id'],'module_name':'Calls'})}})[_0xfab6('0x25')](function(_0x8ca5f1){if(_0x8ca5f1){var _0xe70bfb=_[_0xfab6('0x68')](_0x8ca5f1[_0xfab6('0x69')]);_[_0xfab6('0x6a')](_0xe70bfb,function(_0x53219b){return _0x5281d9[_0xfab6('0x6b')](_0x53219b[_0xfab6('0x29')]);});return{'count':_0xe70bfb[_0xfab6('0x4c')],'rows':_[_0xfab6('0x2b')](_0xe70bfb,function(_0x31f38a){return{'id':_0x31f38a[_0xfab6('0x29')],'name':_0x31f38a[_0xfab6('0x6c')],'custom':_[_0xfab6('0x6d')](_0x31f38a[_0xfab6('0x29')],'_c')?!![]:![],'options':_0x31f38a[_0xfab6('0x3e')]?_[_0xfab6('0x2b')](_[_0xfab6('0x68')](_0x31f38a['options']),function(_0x1b847b){return{'name':_0x1b847b['value'],'value':_0x1b847b[_0xfab6('0x29')]};}):[]};})};}})[_0xfab6('0x25')](respondWithResult(_0x54fc18,null))[_0xfab6('0x42')](function(_0x2b9097){var _0x5a6362=_0x46f88f[_0xfab6('0x31')][_0xfab6('0x6e')]?0x1f4:_0x2b9097[_0xfab6('0x6f')]||0x1f4;logger[_0xfab6('0x27')](_0xfab6('0x70'),_0xfab6('0x53'),_0x5a6362,JSON['stringify'](_0x2b9097));delete _0x2b9097['name'];if(_0x5a6362===0x191){_0x5a6362=0x190;}_0x54fc18['status'](_0x5a6362)[_0xfab6('0x71')](_0x46f88f[_0xfab6('0x31')][_0xfab6('0x6e')]?{'message':'Wrong\x20credentials','statusCode':_0x2b9097[_0xfab6('0x6f')]}:_0x2b9097);});}else{var _0x1b863e=0x1f4;_0x54fc18[_0xfab6('0x1a')](_0x1b863e)['send']({'message':_0xfab6('0x72'),'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 702ea0e..7b8957a 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 _0xf503=['moment','bluebird','request-promise','path','../../config/environment','./intSugarcrmAccount.attributes','define','SugarcrmAccount','int_sugarcrm_accounts','lodash','util','../../config/logger','api'];(function(_0x37cfee,_0x1ddc2e){var _0x1de0a1=function(_0x2a44ab){while(--_0x2a44ab){_0x37cfee['push'](_0x37cfee['shift']());}};_0x1de0a1(++_0x1ddc2e);}(_0xf503,0x11a));var _0x3f50=function(_0x14914a,_0x3eae81){_0x14914a=_0x14914a-0x0;var _0x3766ec=_0xf503[_0x14914a];return _0x3766ec;};'use strict';var _=require(_0x3f50('0x0'));var util=require(_0x3f50('0x1'));var logger=require(_0x3f50('0x2'))(_0x3f50('0x3'));var moment=require(_0x3f50('0x4'));var BPromise=require(_0x3f50('0x5'));var rp=require(_0x3f50('0x6'));var fs=require('fs');var path=require(_0x3f50('0x7'));var rimraf=require('rimraf');var config=require(_0x3f50('0x8'));var attributes=require(_0x3f50('0x9'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x4afb1a,_0x1291b7){return _0x4afb1a[_0x3f50('0xa')](_0x3f50('0xb'),attributes,{'tableName':_0x3f50('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xeefe=['SugarcrmAccount','int_sugarcrm_accounts','lodash','../../config/logger','moment','bluebird','path','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','define'];(function(_0x23a673,_0x31e4bc){var _0x2213b7=function(_0x3c5dcc){while(--_0x3c5dcc){_0x23a673['push'](_0x23a673['shift']());}};_0x2213b7(++_0x31e4bc);}(_0xeefe,0xf2));var _0xeeef=function(_0x34c1b5,_0x2f1899){_0x34c1b5=_0x34c1b5-0x0;var _0x156496=_0xeefe[_0x34c1b5];return _0x156496;};'use strict';var _=require(_0xeeef('0x0'));var util=require('util');var logger=require(_0xeeef('0x1'))('api');var moment=require(_0xeeef('0x2'));var BPromise=require(_0xeeef('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xeeef('0x4'));var rimraf=require('rimraf');var config=require(_0xeeef('0x5'));var attributes=require(_0xeeef('0x6'));var integrations=require(_0xeeef('0x7'));module[_0xeeef('0x8')]=function(_0x5e4490,_0x2d5d92){return _0x5e4490[_0xeeef('0x9')](_0xeeef('0xa'),attributes,{'tableName':_0xeeef('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js index 16bfe90..520672f 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 _0xe354=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','code','error','message','info','result','catch','GetSugarcrmAccount','options','where','attributes','limit','include','map','model','ShowSugarcrmAccount','find','stringify','lodash','moment','bluebird'];(function(_0x44ce86,_0x370383){var _0x35be15=function(_0x3f3135){while(--_0x3f3135){_0x44ce86['push'](_0x44ce86['shift']());}};_0x35be15(++_0x370383);}(_0xe354,0x1d9));var _0x4e35=function(_0x25ddb1,_0x28caba){_0x25ddb1=_0x25ddb1-0x0;var _0x15f64b=_0xe354[_0x25ddb1];return _0x15f64b;};'use strict';var _=require(_0x4e35('0x0'));var util=require('util');var moment=require(_0x4e35('0x1'));var BPromise=require(_0x4e35('0x2'));var rs=require(_0x4e35('0x3'));var fs=require('fs');var Redis=require(_0x4e35('0x4'));var db=require(_0x4e35('0x5'))['db'];var utils=require(_0x4e35('0x6'));var logger=require(_0x4e35('0x7'))(_0x4e35('0x8'));var config=require(_0x4e35('0x9'));var jayson=require(_0x4e35('0xa'));var client=jayson[_0x4e35('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2f0e61,_0x55ccf6,_0x1a38a1){return new BPromise(function(_0x1579f8,_0x2f045d){return client['request'](_0x2f0e61,_0x1a38a1)[_0x4e35('0xc')](function(_0x27b632){logger['info'](_0x4e35('0xd'),_0x55ccf6,_0x4e35('0xe'));logger[_0x4e35('0xf')](_0x4e35('0x10'),_0x55ccf6,_0x4e35('0xe'),JSON['stringify'](_0x27b632));if(_0x27b632['error']){if(_0x27b632['error'][_0x4e35('0x11')]===0x1f4){logger[_0x4e35('0x12')](_0x4e35('0xd'),_0x55ccf6,_0x27b632['error'][_0x4e35('0x13')]);return _0x2f045d(_0x27b632[_0x4e35('0x12')]['message']);}logger[_0x4e35('0x12')](_0x4e35('0xd'),_0x55ccf6,_0x27b632[_0x4e35('0x12')][_0x4e35('0x13')]);return _0x1579f8(_0x27b632[_0x4e35('0x12')][_0x4e35('0x13')]);}else{logger[_0x4e35('0x14')](_0x4e35('0xd'),_0x55ccf6,_0x4e35('0xe'));_0x1579f8(_0x27b632[_0x4e35('0x15')]['message']);}})[_0x4e35('0x16')](function(_0x26d07c){logger['error'](_0x4e35('0xd'),_0x55ccf6,_0x26d07c);_0x2f045d(_0x26d07c);});});}exports[_0x4e35('0x17')]=function(_0x2cebcb){var _0x284d87=this;return new Promise(function(_0x172ec4,_0xb60503){return db['SugarcrmAccount']['findAll']({'raw':_0x2cebcb[_0x4e35('0x18')]?_0x2cebcb[_0x4e35('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x2cebcb[_0x4e35('0x18')]?_0x2cebcb[_0x4e35('0x18')][_0x4e35('0x19')]||null:null,'attributes':_0x2cebcb['options']?_0x2cebcb[_0x4e35('0x18')][_0x4e35('0x1a')]||null:null,'limit':_0x2cebcb[_0x4e35('0x18')]?_0x2cebcb['options'][_0x4e35('0x1b')]||null:null,'include':_0x2cebcb[_0x4e35('0x18')]?_0x2cebcb[_0x4e35('0x18')][_0x4e35('0x1c')]?_[_0x4e35('0x1d')](_0x2cebcb['options'][_0x4e35('0x1c')],function(_0x28358f){return{'model':db[_0x28358f[_0x4e35('0x1e')]],'as':_0x28358f['as'],'attributes':_0x28358f[_0x4e35('0x1a')],'include':_0x28358f[_0x4e35('0x1c')]?_['map'](_0x28358f[_0x4e35('0x1c')],function(_0xadd9ba){return{'model':db[_0xadd9ba[_0x4e35('0x1e')]],'as':_0xadd9ba['as'],'attributes':_0xadd9ba[_0x4e35('0x1a')],'include':_0xadd9ba[_0x4e35('0x1c')]?_['map'](_0xadd9ba[_0x4e35('0x1c')],function(_0x1bb793){return{'model':db[_0x1bb793[_0x4e35('0x1e')]],'as':_0x1bb793['as'],'attributes':_0x1bb793[_0x4e35('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5397a2){logger[_0x4e35('0x14')](_0x4e35('0x17'),_0x2cebcb);logger[_0x4e35('0xf')](_0x4e35('0x17'),_0x2cebcb,JSON['stringify'](_0x5397a2));_0x172ec4(_0x5397a2);})[_0x4e35('0x16')](function(_0x554a22){logger[_0x4e35('0x12')]('GetSugarcrmAccount',_0x554a22[_0x4e35('0x13')],_0x2cebcb);_0xb60503(_0x284d87['error'](0x1f4,_0x554a22[_0x4e35('0x13')]));});});};exports[_0x4e35('0x1f')]=function(_0xf6a92b){var _0x24b989=this;return new Promise(function(_0x3469fd,_0x2b462e){return db['SugarcrmAccount'][_0x4e35('0x20')]({'raw':_0xf6a92b['options']?_0xf6a92b['options']['raw']===undefined?!![]:![]:!![],'where':_0xf6a92b[_0x4e35('0x18')]?_0xf6a92b['options'][_0x4e35('0x19')]||null:null,'attributes':_0xf6a92b['options']?_0xf6a92b[_0x4e35('0x18')][_0x4e35('0x1a')]||null:null,'include':_0xf6a92b[_0x4e35('0x18')]?_0xf6a92b[_0x4e35('0x18')][_0x4e35('0x1c')]?_[_0x4e35('0x1d')](_0xf6a92b[_0x4e35('0x18')][_0x4e35('0x1c')],function(_0x38a1cc){return{'model':db[_0x38a1cc['model']],'as':_0x38a1cc['as'],'attributes':_0x38a1cc[_0x4e35('0x1a')],'include':_0x38a1cc[_0x4e35('0x1c')]?_['map'](_0x38a1cc[_0x4e35('0x1c')],function(_0x520a86){return{'model':db[_0x520a86[_0x4e35('0x1e')]],'as':_0x520a86['as'],'attributes':_0x520a86[_0x4e35('0x1a')],'include':_0x520a86[_0x4e35('0x1c')]?_[_0x4e35('0x1d')](_0x520a86[_0x4e35('0x1c')],function(_0x32a9e0){return{'model':db[_0x32a9e0[_0x4e35('0x1e')]],'as':_0x32a9e0['as'],'attributes':_0x32a9e0[_0x4e35('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x4e35('0xc')](function(_0x19658f){logger[_0x4e35('0x14')](_0x4e35('0x1f'),_0xf6a92b);logger[_0x4e35('0xf')](_0x4e35('0x1f'),_0xf6a92b,JSON[_0x4e35('0x21')](_0x19658f));_0x3469fd(_0x19658f);})[_0x4e35('0x16')](function(_0x1b3197){logger[_0x4e35('0x12')](_0x4e35('0x1f'),_0x1b3197[_0x4e35('0x13')],_0xf6a92b);_0x2b462e(_0x24b989[_0x4e35('0x12')](0x1f4,_0x1b3197[_0x4e35('0x13')]));});});}; \ No newline at end of file +var _0x14e7=['findAll','options','raw','where','attributes','limit','include','model','map','ShowSugarcrmAccount','find','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetSugarcrmAccount','SugarcrmAccount'];(function(_0x42ff9e,_0x43ffcc){var _0x5e4424=function(_0x29da3f){while(--_0x29da3f){_0x42ff9e['push'](_0x42ff9e['shift']());}};_0x5e4424(++_0x43ffcc);}(_0x14e7,0xf9));var _0x714e=function(_0x2bd937,_0x1619d8){_0x2bd937=_0x2bd937-0x0;var _0x42e35e=_0x14e7[_0x2bd937];return _0x42e35e;};'use strict';var _=require(_0x714e('0x0'));var util=require('util');var moment=require(_0x714e('0x1'));var BPromise=require(_0x714e('0x2'));var rs=require(_0x714e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x714e('0x4'));var logger=require(_0x714e('0x5'))(_0x714e('0x6'));var config=require(_0x714e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x714e('0x8')][_0x714e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3f2a2e,_0x5e294b,_0x132273){return new BPromise(function(_0x4031f5,_0x210c94){return client['request'](_0x3f2a2e,_0x132273)['then'](function(_0x43df85){logger[_0x714e('0xa')](_0x714e('0xb'),_0x5e294b,_0x714e('0xc'));logger[_0x714e('0xd')](_0x714e('0xe'),_0x5e294b,_0x714e('0xc'),JSON[_0x714e('0xf')](_0x43df85));if(_0x43df85[_0x714e('0x10')]){if(_0x43df85[_0x714e('0x10')][_0x714e('0x11')]===0x1f4){logger[_0x714e('0x10')](_0x714e('0xb'),_0x5e294b,_0x43df85[_0x714e('0x10')][_0x714e('0x12')]);return _0x210c94(_0x43df85[_0x714e('0x10')][_0x714e('0x12')]);}logger['error'](_0x714e('0xb'),_0x5e294b,_0x43df85[_0x714e('0x10')][_0x714e('0x12')]);return _0x4031f5(_0x43df85[_0x714e('0x10')][_0x714e('0x12')]);}else{logger[_0x714e('0xa')](_0x714e('0xb'),_0x5e294b,_0x714e('0xc'));_0x4031f5(_0x43df85[_0x714e('0x13')][_0x714e('0x12')]);}})[_0x714e('0x14')](function(_0x407d2a){logger[_0x714e('0x10')]('SugarcrmAccount,\x20%s,\x20%s',_0x5e294b,_0x407d2a);_0x210c94(_0x407d2a);});});}exports[_0x714e('0x15')]=function(_0x5d2c28){var _0xc8515a=this;return new Promise(function(_0x2171fa,_0x28bc51){return db[_0x714e('0x16')][_0x714e('0x17')]({'raw':_0x5d2c28[_0x714e('0x18')]?_0x5d2c28['options'][_0x714e('0x19')]===undefined?!![]:![]:!![],'where':_0x5d2c28[_0x714e('0x18')]?_0x5d2c28[_0x714e('0x18')][_0x714e('0x1a')]||null:null,'attributes':_0x5d2c28[_0x714e('0x18')]?_0x5d2c28['options'][_0x714e('0x1b')]||null:null,'limit':_0x5d2c28[_0x714e('0x18')]?_0x5d2c28['options'][_0x714e('0x1c')]||null:null,'include':_0x5d2c28[_0x714e('0x18')]?_0x5d2c28[_0x714e('0x18')]['include']?_['map'](_0x5d2c28[_0x714e('0x18')][_0x714e('0x1d')],function(_0x4bb95c){return{'model':db[_0x4bb95c[_0x714e('0x1e')]],'as':_0x4bb95c['as'],'attributes':_0x4bb95c[_0x714e('0x1b')],'include':_0x4bb95c[_0x714e('0x1d')]?_[_0x714e('0x1f')](_0x4bb95c[_0x714e('0x1d')],function(_0x21a675){return{'model':db[_0x21a675[_0x714e('0x1e')]],'as':_0x21a675['as'],'attributes':_0x21a675[_0x714e('0x1b')],'include':_0x21a675[_0x714e('0x1d')]?_[_0x714e('0x1f')](_0x21a675[_0x714e('0x1d')],function(_0x38a075){return{'model':db[_0x38a075[_0x714e('0x1e')]],'as':_0x38a075['as'],'attributes':_0x38a075[_0x714e('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xbf42a2){logger[_0x714e('0xa')](_0x714e('0x15'),_0x5d2c28);logger[_0x714e('0xd')](_0x714e('0x15'),_0x5d2c28,JSON[_0x714e('0xf')](_0xbf42a2));_0x2171fa(_0xbf42a2);})[_0x714e('0x14')](function(_0x503341){logger[_0x714e('0x10')](_0x714e('0x15'),_0x503341[_0x714e('0x12')],_0x5d2c28);_0x28bc51(_0xc8515a['error'](0x1f4,_0x503341[_0x714e('0x12')]));});});};exports[_0x714e('0x20')]=function(_0x28ecd5){var _0x3c6c93=this;return new Promise(function(_0x162bdb,_0x12018e){return db[_0x714e('0x16')][_0x714e('0x21')]({'raw':_0x28ecd5[_0x714e('0x18')]?_0x28ecd5['options'][_0x714e('0x19')]===undefined?!![]:![]:!![],'where':_0x28ecd5[_0x714e('0x18')]?_0x28ecd5[_0x714e('0x18')][_0x714e('0x1a')]||null:null,'attributes':_0x28ecd5[_0x714e('0x18')]?_0x28ecd5[_0x714e('0x18')][_0x714e('0x1b')]||null:null,'include':_0x28ecd5[_0x714e('0x18')]?_0x28ecd5['options'][_0x714e('0x1d')]?_[_0x714e('0x1f')](_0x28ecd5[_0x714e('0x18')][_0x714e('0x1d')],function(_0x177a68){return{'model':db[_0x177a68[_0x714e('0x1e')]],'as':_0x177a68['as'],'attributes':_0x177a68[_0x714e('0x1b')],'include':_0x177a68[_0x714e('0x1d')]?_[_0x714e('0x1f')](_0x177a68[_0x714e('0x1d')],function(_0x326e91){return{'model':db[_0x326e91[_0x714e('0x1e')]],'as':_0x326e91['as'],'attributes':_0x326e91[_0x714e('0x1b')],'include':_0x326e91[_0x714e('0x1d')]?_['map'](_0x326e91['include'],function(_0x289dea){return{'model':db[_0x289dea[_0x714e('0x1e')]],'as':_0x289dea['as'],'attributes':_0x289dea[_0x714e('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x11ac3f){logger[_0x714e('0xa')]('ShowSugarcrmAccount',_0x28ecd5);logger[_0x714e('0xd')](_0x714e('0x20'),_0x28ecd5,JSON[_0x714e('0xf')](_0x11ac3f));_0x162bdb(_0x11ac3f);})[_0x714e('0x14')](function(_0x2828e4){logger[_0x714e('0x10')](_0x714e('0x20'),_0x2828e4[_0x714e('0x12')],_0x28ecd5);_0x12018e(_0x3c6c93[_0x714e('0x10')](0x1f4,_0x2828e4['message']));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index 9efa5c6..5fa8bbd 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 _0xa04a=['isAuthenticated','index','show','get','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller'];(function(_0x5b0476,_0x279a92){var _0x497d47=function(_0x4d9bbd){while(--_0x4d9bbd){_0x5b0476['push'](_0x5b0476['shift']());}};_0x497d47(++_0x279a92);}(_0xa04a,0x1d8));var _0xaa04=function(_0x565836,_0xd9d455){_0x565836=_0x565836-0x0;var _0x5eb222=_0xa04a[_0x565836];return _0x5eb222;};'use strict';var multer=require(_0xaa04('0x0'));var util=require(_0xaa04('0x1'));var path=require(_0xaa04('0x2'));var timeout=require(_0xaa04('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xaa04('0x4'));var interaction=require(_0xaa04('0x5'));var config=require(_0xaa04('0x6'));var controller=require(_0xaa04('0x7'));router['get']('/',auth[_0xaa04('0x8')](),controller[_0xaa04('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xaa04('0xa')]);router[_0xaa04('0xb')]('/:id/fields',auth[_0xaa04('0x8')](),controller[_0xaa04('0xc')]);router['get'](_0xaa04('0xd'),auth['isAuthenticated'](),controller[_0xaa04('0xe')]);router[_0xaa04('0xb')](_0xaa04('0xf'),auth[_0xaa04('0x8')](),controller[_0xaa04('0x10')]);router[_0xaa04('0x11')]('/',auth[_0xaa04('0x8')](),controller[_0xaa04('0x12')]);router[_0xaa04('0x13')](_0xaa04('0x14'),auth[_0xaa04('0x8')](),controller[_0xaa04('0x15')]);router['delete'](_0xaa04('0x14'),auth[_0xaa04('0x8')](),controller[_0xaa04('0x16')]);module[_0xaa04('0x17')]=router; \ No newline at end of file +var _0x135a=['get','index','isAuthenticated','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','post','create','put','delete','/:id','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller'];(function(_0x47066d,_0x2ea60d){var _0x34baa9=function(_0x1fa0de){while(--_0x1fa0de){_0x47066d['push'](_0x47066d['shift']());}};_0x34baa9(++_0x2ea60d);}(_0x135a,0x117));var _0xa135=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x135a[_0x4565bf];return _0x5610ba;};'use strict';var multer=require(_0xa135('0x0'));var util=require('util');var path=require(_0xa135('0x1'));var timeout=require(_0xa135('0x2'));var express=require(_0xa135('0x3'));var router=express[_0xa135('0x4')]();var fs_extra=require(_0xa135('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xa135('0x6'));var config=require(_0xa135('0x7'));var controller=require(_0xa135('0x8'));router[_0xa135('0x9')]('/',auth['isAuthenticated'](),controller[_0xa135('0xa')]);router[_0xa135('0x9')]('/:id',auth[_0xa135('0xb')](),controller[_0xa135('0xc')]);router[_0xa135('0x9')]('/:id/fields',auth[_0xa135('0xb')](),controller[_0xa135('0xd')]);router[_0xa135('0x9')](_0xa135('0xe'),auth['isAuthenticated'](),controller[_0xa135('0xf')]);router[_0xa135('0x9')](_0xa135('0x10'),auth['isAuthenticated'](),controller['getDescriptions']);router[_0xa135('0x11')]('/',auth[_0xa135('0xb')](),controller[_0xa135('0x12')]);router[_0xa135('0x13')]('/:id',auth[_0xa135('0xb')](),controller['update']);router[_0xa135('0x14')](_0xa135('0x15'),auth[_0xa135('0xb')](),controller[_0xa135('0x16')]);module[_0xa135('0x17')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index 531ec9e..adf6c3a 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 _0x6973=['sequelize','exports'];(function(_0x458db5,_0xeca3b){var _0x3566de=function(_0x3b5bc0){while(--_0x3b5bc0){_0x458db5['push'](_0x458db5['shift']());}};_0x3566de(++_0xeca3b);}(_0x6973,0x1aa));var _0x3697=function(_0x44b978,_0x4eab9e){_0x44b978=_0x44b978-0x0;var _0xe3a299=_0x6973[_0x44b978];return _0xe3a299;};'use strict';var Sequelize=require(_0x3697('0x0'));module[_0x3697('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x803d=['exports','STRING','sequelize'];(function(_0x2446df,_0x19228f){var _0x36d276=function(_0xe1d269){while(--_0xe1d269){_0x2446df['push'](_0x2446df['shift']());}};_0x36d276(++_0x19228f);}(_0x803d,0x149));var _0xd803=function(_0x24f94b,_0x3eb0ef){_0x24f94b=_0x24f94b-0x0;var _0x5d6bfb=_0x803d[_0x24f94b];return _0x5d6bfb;};'use strict';var Sequelize=require(_0xd803('0x0'));module[_0xd803('0x1')]={'name':{'type':Sequelize[_0xd803('0x2')]},'description':{'type':Sequelize[_0xd803('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index ea44697..4438830 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 _0xaac1=['../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','error','name','send','map','SugarcrmConfiguration','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filters','filter','merge','includeAll','include','findAll','rows','catch','show','options','find','create','body','destroy','params','getFields','SugarcrmField','order','getSubjects','getDescriptions','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x4b9cef,_0x527a7d){var _0x2f2147=function(_0xac0a0a){while(--_0xac0a0a){_0x4b9cef['push'](_0x4b9cef['shift']());}};_0x2f2147(++_0x527a7d);}(_0xaac1,0x173));var _0x1aac=function(_0x55cd5c,_0xe45d1d){_0x55cd5c=_0x55cd5c-0x0;var _0x3e0643=_0xaac1[_0x55cd5c];return _0x3e0643;};'use strict';var emlformat=require(_0x1aac('0x0'));var rimraf=require(_0x1aac('0x1'));var zipdir=require(_0x1aac('0x2'));var jsonpatch=require(_0x1aac('0x3'));var rp=require(_0x1aac('0x4'));var moment=require('moment');var BPromise=require(_0x1aac('0x5'));var Mustache=require('mustache');var util=require(_0x1aac('0x6'));var path=require(_0x1aac('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1aac('0x8'));var fs=require('fs');var fs_extra=require(_0x1aac('0x9'));var _=require(_0x1aac('0xa'));var squel=require('squel');var crypto=require(_0x1aac('0xb'));var jsforce=require(_0x1aac('0xc'));var deskjs=require(_0x1aac('0xd'));var toCsv=require(_0x1aac('0xe'));var querystring=require('querystring');var Papa=require(_0x1aac('0xf'));var Redis=require(_0x1aac('0x10'));var authService=require(_0x1aac('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x1aac('0x12'));var hardwareService=require(_0x1aac('0x13'));var logger=require(_0x1aac('0x14'))(_0x1aac('0x15'));var utils=require(_0x1aac('0x16'));var config=require(_0x1aac('0x17'));var licenseUtil=require(_0x1aac('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1c90bd,_0x557cca){_0x557cca=_0x557cca||0xcc;return function(_0x6743ac){if(_0x6743ac){return _0x1c90bd[_0x1aac('0x19')](_0x557cca);}return _0x1c90bd[_0x1aac('0x1a')](_0x557cca)[_0x1aac('0x1b')]();};}function respondWithResult(_0x1ccbd4,_0x913f6f){_0x913f6f=_0x913f6f||0xc8;return function(_0x489ba9){if(_0x489ba9){return _0x1ccbd4[_0x1aac('0x1a')](_0x913f6f)[_0x1aac('0x1c')](_0x489ba9);}};}function respondWithFilteredResult(_0x24c14c,_0x58d357){return function(_0x1653b8){if(_0x1653b8){var _0x39f502=typeof _0x58d357[_0x1aac('0x1d')]===_0x1aac('0x1e')&&typeof _0x58d357[_0x1aac('0x1f')]===_0x1aac('0x1e');var _0x51ac9c=_0x1653b8[_0x1aac('0x20')];var _0x305c22=_0x39f502?0x0:_0x58d357['offset'];var _0xaaf2ea=_0x39f502?_0x1653b8['count']:_0x58d357['offset']+_0x58d357[_0x1aac('0x1f')];var _0x11be51;if(_0xaaf2ea>=_0x51ac9c){_0xaaf2ea=_0x51ac9c;_0x11be51=0xc8;}else{_0x11be51=0xce;}_0x24c14c['status'](_0x11be51);return _0x24c14c[_0x1aac('0x21')](_0x1aac('0x22'),_0x305c22+'-'+_0xaaf2ea+'/'+_0x51ac9c)['json'](_0x1653b8);}return null;};}function patchUpdates(_0x101e43){return function(_0x53aac3){try{jsonpatch['apply'](_0x53aac3,_0x101e43,!![]);}catch(_0x247d0e){return BPromise['reject'](_0x247d0e);}return _0x53aac3['save']();};}function saveUpdates(_0x422cdf,_0xf0bcf0){return function(_0x189688){if(_0x189688){return _0x189688[_0x1aac('0x23')](_0x422cdf)[_0x1aac('0x24')](function(_0x30d031){return _0x30d031;});}return null;};}function removeEntity(_0x3d81be,_0x451c8b){return function(_0x3d3ff4){if(_0x3d3ff4){return _0x3d3ff4['destroy']()['then'](function(){_0x3d81be['status'](0xcc)[_0x1aac('0x1b')]();});}};}function handleEntityNotFound(_0x4a637c,_0x3f194e){return function(_0x5730e4){if(!_0x5730e4){_0x4a637c[_0x1aac('0x19')](0x194);}return _0x5730e4;};}function handleError(_0x518ec7,_0x52e07f){_0x52e07f=_0x52e07f||0x1f4;return function(_0x29192b){logger[_0x1aac('0x25')](_0x29192b['stack']);if(_0x29192b[_0x1aac('0x26')]){delete _0x29192b[_0x1aac('0x26')];}_0x518ec7['status'](_0x52e07f)[_0x1aac('0x27')](_0x29192b);};}exports['index']=function(_0x5ac48f,_0x3ee61d){var _0x98c82a={},_0x3983f3={},_0x2d6d41={'count':0x0,'rows':[]};var _0x2cbea5=_[_0x1aac('0x28')](db[_0x1aac('0x29')][_0x1aac('0x2a')],function(_0x118a97){return{'name':_0x118a97[_0x1aac('0x2b')],'type':_0x118a97[_0x1aac('0x2c')][_0x1aac('0x2d')]};});_0x3983f3[_0x1aac('0x2e')]=_[_0x1aac('0x28')](_0x2cbea5,_0x1aac('0x26'));_0x3983f3[_0x1aac('0x2f')]=_[_0x1aac('0x30')](_0x5ac48f[_0x1aac('0x2f')]);_0x3983f3['filters']=_['intersection'](_0x3983f3['model'],_0x3983f3[_0x1aac('0x2f')]);_0x98c82a[_0x1aac('0x31')]=_[_0x1aac('0x32')](_0x3983f3[_0x1aac('0x2e')],qs['fields'](_0x5ac48f[_0x1aac('0x2f')][_0x1aac('0x33')]));_0x98c82a['attributes']=_0x98c82a[_0x1aac('0x31')][_0x1aac('0x34')]?_0x98c82a['attributes']:_0x3983f3[_0x1aac('0x2e')];if(!_0x5ac48f['query'][_0x1aac('0x35')](_0x1aac('0x36'))){_0x98c82a['limit']=qs[_0x1aac('0x1f')](_0x5ac48f[_0x1aac('0x2f')][_0x1aac('0x1f')]);_0x98c82a['offset']=qs['offset'](_0x5ac48f[_0x1aac('0x2f')]['offset']);}_0x98c82a['order']=qs[_0x1aac('0x37')](_0x5ac48f[_0x1aac('0x2f')][_0x1aac('0x37')]);_0x98c82a[_0x1aac('0x38')]=qs['filters'](_[_0x1aac('0x39')](_0x5ac48f[_0x1aac('0x2f')],_0x3983f3[_0x1aac('0x3a')]),_0x2cbea5);if(_0x5ac48f['query'][_0x1aac('0x3b')]){_0x98c82a[_0x1aac('0x38')]=_[_0x1aac('0x3c')](_0x98c82a['where'],{'$or':_[_0x1aac('0x28')](_0x2cbea5,function(_0x251f97){if(_0x251f97['type']!=='VIRTUAL'){var _0x29c0c6={};_0x29c0c6[_0x251f97[_0x1aac('0x26')]]={'$like':'%'+_0x5ac48f['query'][_0x1aac('0x3b')]+'%'};return _0x29c0c6;}})});}_0x98c82a=_[_0x1aac('0x3c')]({},_0x98c82a,_0x5ac48f['options']);var _0xe352b1={'where':_0x98c82a['where']};return db[_0x1aac('0x29')][_0x1aac('0x20')](_0xe352b1)['then'](function(_0x1a8a35){_0x2d6d41[_0x1aac('0x20')]=_0x1a8a35;if(_0x5ac48f[_0x1aac('0x2f')][_0x1aac('0x3d')]){_0x98c82a[_0x1aac('0x3e')]=[{'all':!![]}];}return db[_0x1aac('0x29')][_0x1aac('0x3f')](_0x98c82a);})[_0x1aac('0x24')](function(_0x4b2da7){_0x2d6d41[_0x1aac('0x40')]=_0x4b2da7;return _0x2d6d41;})[_0x1aac('0x24')](respondWithFilteredResult(_0x3ee61d,_0x98c82a))[_0x1aac('0x41')](handleError(_0x3ee61d,null));};exports[_0x1aac('0x42')]=function(_0x3d65c2,_0x330f00){var _0x7787a2={'raw':![],'where':{'id':_0x3d65c2['params']['id']}},_0x40613f={};_0x40613f['model']=_[_0x1aac('0x30')](db['SugarcrmConfiguration']['rawAttributes']);_0x40613f['query']=_[_0x1aac('0x30')](_0x3d65c2[_0x1aac('0x2f')]);_0x40613f['filters']=_[_0x1aac('0x32')](_0x40613f[_0x1aac('0x2e')],_0x40613f[_0x1aac('0x2f')]);_0x7787a2[_0x1aac('0x31')]=_['intersection'](_0x40613f[_0x1aac('0x2e')],qs[_0x1aac('0x33')](_0x3d65c2[_0x1aac('0x2f')][_0x1aac('0x33')]));_0x7787a2[_0x1aac('0x31')]=_0x7787a2[_0x1aac('0x31')][_0x1aac('0x34')]?_0x7787a2['attributes']:_0x40613f[_0x1aac('0x2e')];if(_0x3d65c2[_0x1aac('0x2f')][_0x1aac('0x3d')]){_0x7787a2[_0x1aac('0x3e')]=[{'all':!![]}];}_0x7787a2=_[_0x1aac('0x3c')]({},_0x7787a2,_0x3d65c2[_0x1aac('0x43')]);return db[_0x1aac('0x29')][_0x1aac('0x44')](_0x7787a2)[_0x1aac('0x24')](handleEntityNotFound(_0x330f00,null))['then'](respondWithResult(_0x330f00,null))[_0x1aac('0x41')](handleError(_0x330f00,null));};exports[_0x1aac('0x45')]=function(_0x3b77ca,_0x2f43b1){return db[_0x1aac('0x29')][_0x1aac('0x45')](_0x3b77ca['body'],{})[_0x1aac('0x24')](respondWithResult(_0x2f43b1,0xc9))['catch'](handleError(_0x2f43b1,null));};exports[_0x1aac('0x23')]=function(_0x1e94f0,_0x1bfe44){if(_0x1e94f0[_0x1aac('0x46')]['id']){delete _0x1e94f0[_0x1aac('0x46')]['id'];}return db[_0x1aac('0x29')][_0x1aac('0x44')]({'where':{'id':_0x1e94f0['params']['id']}})[_0x1aac('0x24')](handleEntityNotFound(_0x1bfe44,null))[_0x1aac('0x24')](saveUpdates(_0x1e94f0[_0x1aac('0x46')],null))['then'](respondWithResult(_0x1bfe44,null))[_0x1aac('0x41')](handleError(_0x1bfe44,null));};exports[_0x1aac('0x47')]=function(_0x482b97,_0xfcb9d8){return db[_0x1aac('0x29')][_0x1aac('0x44')]({'where':{'id':_0x482b97[_0x1aac('0x48')]['id']}})[_0x1aac('0x24')](handleEntityNotFound(_0xfcb9d8,null))[_0x1aac('0x24')](removeEntity(_0xfcb9d8,null))[_0x1aac('0x41')](handleError(_0xfcb9d8,null));};exports[_0x1aac('0x49')]=function(_0x2210a2,_0x170a22,_0x52413d){var _0x392d05={};var _0x23f0e4={};var _0x4dea26;var _0x54f4d4;return db['SugarcrmConfiguration']['findOne']({'where':{'id':_0x2210a2[_0x1aac('0x48')]['id']}})[_0x1aac('0x24')](handleEntityNotFound(_0x170a22,null))[_0x1aac('0x24')](function(_0x33e8bb){if(_0x33e8bb){_0x4dea26=_0x33e8bb;_0x23f0e4[_0x1aac('0x2e')]=_[_0x1aac('0x30')](db[_0x1aac('0x4a')]['rawAttributes']);_0x23f0e4[_0x1aac('0x2f')]=_[_0x1aac('0x30')](_0x2210a2[_0x1aac('0x2f')]);_0x23f0e4['filters']=_[_0x1aac('0x32')](_0x23f0e4[_0x1aac('0x2e')],_0x23f0e4[_0x1aac('0x2f')]);_0x392d05[_0x1aac('0x31')]=_[_0x1aac('0x32')](_0x23f0e4[_0x1aac('0x2e')],qs['fields'](_0x2210a2['query'][_0x1aac('0x33')]));_0x392d05['attributes']=_0x392d05[_0x1aac('0x31')][_0x1aac('0x34')]?_0x392d05['attributes']:_0x23f0e4[_0x1aac('0x2e')];_0x392d05[_0x1aac('0x4b')]=qs[_0x1aac('0x37')](_0x2210a2[_0x1aac('0x2f')][_0x1aac('0x37')]);_0x392d05[_0x1aac('0x38')]=qs[_0x1aac('0x3a')](_[_0x1aac('0x39')](_0x2210a2[_0x1aac('0x2f')],_0x23f0e4['filters']));if(_0x2210a2[_0x1aac('0x2f')][_0x1aac('0x3b')]){_0x392d05[_0x1aac('0x38')]=_[_0x1aac('0x3c')](_0x392d05[_0x1aac('0x38')],{'$or':_[_0x1aac('0x28')](_0x392d05[_0x1aac('0x31')],function(_0x57b451){var _0x555ef2={};_0x555ef2[_0x57b451]={'$like':'%'+_0x2210a2[_0x1aac('0x2f')]['filter']+'%'};return _0x555ef2;})});}_0x392d05=_[_0x1aac('0x3c')]({},_0x392d05,_0x2210a2[_0x1aac('0x43')]);return _0x4dea26['getFields'](_0x392d05);}})[_0x1aac('0x24')](function(_0x126d8b){if(_0x126d8b){_0x54f4d4=_0x126d8b['length'];if(!_0x2210a2[_0x1aac('0x2f')][_0x1aac('0x35')](_0x1aac('0x36'))){_0x392d05[_0x1aac('0x1f')]=qs['limit'](_0x2210a2[_0x1aac('0x2f')][_0x1aac('0x1f')]);_0x392d05[_0x1aac('0x1d')]=qs[_0x1aac('0x1d')](_0x2210a2[_0x1aac('0x2f')]['offset']);}return _0x4dea26[_0x1aac('0x49')](_0x392d05);}})['then'](function(_0x1a5d18){if(_0x1a5d18){return _0x1a5d18?{'count':_0x54f4d4,'rows':_0x1a5d18}:null;}})[_0x1aac('0x24')](respondWithResult(_0x170a22,null))[_0x1aac('0x41')](handleError(_0x170a22,null));};exports[_0x1aac('0x4c')]=function(_0x429f4a,_0xaa18da,_0xc1cc24){var _0x4852a4={};var _0x499a32={};var _0x540599;var _0x42312a;return db[_0x1aac('0x29')]['findOne']({'where':{'id':_0x429f4a[_0x1aac('0x48')]['id']}})[_0x1aac('0x24')](handleEntityNotFound(_0xaa18da,null))[_0x1aac('0x24')](function(_0x1c4150){if(_0x1c4150){_0x540599=_0x1c4150;_0x499a32[_0x1aac('0x2e')]=_[_0x1aac('0x30')](db[_0x1aac('0x4a')][_0x1aac('0x2a')]);_0x499a32[_0x1aac('0x2f')]=_[_0x1aac('0x30')](_0x429f4a[_0x1aac('0x2f')]);_0x499a32[_0x1aac('0x3a')]=_[_0x1aac('0x32')](_0x499a32[_0x1aac('0x2e')],_0x499a32[_0x1aac('0x2f')]);_0x4852a4[_0x1aac('0x31')]=_[_0x1aac('0x32')](_0x499a32[_0x1aac('0x2e')],qs[_0x1aac('0x33')](_0x429f4a[_0x1aac('0x2f')][_0x1aac('0x33')]));_0x4852a4['attributes']=_0x4852a4['attributes'][_0x1aac('0x34')]?_0x4852a4[_0x1aac('0x31')]:_0x499a32[_0x1aac('0x2e')];_0x4852a4[_0x1aac('0x4b')]=qs[_0x1aac('0x37')](_0x429f4a[_0x1aac('0x2f')]['sort']);_0x4852a4[_0x1aac('0x38')]=qs[_0x1aac('0x3a')](_[_0x1aac('0x39')](_0x429f4a['query'],_0x499a32[_0x1aac('0x3a')]));if(_0x429f4a[_0x1aac('0x2f')][_0x1aac('0x3b')]){_0x4852a4['where']=_[_0x1aac('0x3c')](_0x4852a4[_0x1aac('0x38')],{'$or':_[_0x1aac('0x28')](_0x4852a4['attributes'],function(_0x231070){var _0x19ed26={};_0x19ed26[_0x231070]={'$like':'%'+_0x429f4a[_0x1aac('0x2f')][_0x1aac('0x3b')]+'%'};return _0x19ed26;})});}_0x4852a4=_[_0x1aac('0x3c')]({},_0x4852a4,_0x429f4a[_0x1aac('0x43')]);return _0x540599[_0x1aac('0x4c')](_0x4852a4);}})['then'](function(_0x57ad16){if(_0x57ad16){_0x42312a=_0x57ad16[_0x1aac('0x34')];if(!_0x429f4a[_0x1aac('0x2f')][_0x1aac('0x35')](_0x1aac('0x36'))){_0x4852a4[_0x1aac('0x1f')]=qs['limit'](_0x429f4a['query']['limit']);_0x4852a4[_0x1aac('0x1d')]=qs[_0x1aac('0x1d')](_0x429f4a[_0x1aac('0x2f')]['offset']);}return _0x540599[_0x1aac('0x4c')](_0x4852a4);}})[_0x1aac('0x24')](function(_0x433344){if(_0x433344){return _0x433344?{'count':_0x42312a,'rows':_0x433344}:null;}})[_0x1aac('0x24')](respondWithResult(_0xaa18da,null))[_0x1aac('0x41')](handleError(_0xaa18da,null));};exports[_0x1aac('0x4d')]=function(_0x5728fb,_0x140de1,_0xe2b2db){var _0x459d74={};var _0x89e1b7={};var _0x1d5ef4;var _0x55b210;return db[_0x1aac('0x29')][_0x1aac('0x4e')]({'where':{'id':_0x5728fb[_0x1aac('0x48')]['id']}})['then'](handleEntityNotFound(_0x140de1,null))['then'](function(_0x21b612){if(_0x21b612){_0x1d5ef4=_0x21b612;_0x89e1b7['model']=_[_0x1aac('0x30')](db[_0x1aac('0x4a')][_0x1aac('0x2a')]);_0x89e1b7[_0x1aac('0x2f')]=_['keys'](_0x5728fb[_0x1aac('0x2f')]);_0x89e1b7['filters']=_[_0x1aac('0x32')](_0x89e1b7['model'],_0x89e1b7[_0x1aac('0x2f')]);_0x459d74[_0x1aac('0x31')]=_['intersection'](_0x89e1b7[_0x1aac('0x2e')],qs['fields'](_0x5728fb[_0x1aac('0x2f')][_0x1aac('0x33')]));_0x459d74[_0x1aac('0x31')]=_0x459d74[_0x1aac('0x31')][_0x1aac('0x34')]?_0x459d74[_0x1aac('0x31')]:_0x89e1b7[_0x1aac('0x2e')];_0x459d74[_0x1aac('0x4b')]=qs[_0x1aac('0x37')](_0x5728fb['query']['sort']);_0x459d74[_0x1aac('0x38')]=qs[_0x1aac('0x3a')](_['pick'](_0x5728fb[_0x1aac('0x2f')],_0x89e1b7[_0x1aac('0x3a')]));if(_0x5728fb[_0x1aac('0x2f')][_0x1aac('0x3b')]){_0x459d74[_0x1aac('0x38')]=_['merge'](_0x459d74[_0x1aac('0x38')],{'$or':_[_0x1aac('0x28')](_0x459d74[_0x1aac('0x31')],function(_0xdee8d8){var _0x5c67f7={};_0x5c67f7[_0xdee8d8]={'$like':'%'+_0x5728fb['query']['filter']+'%'};return _0x5c67f7;})});}_0x459d74=_[_0x1aac('0x3c')]({},_0x459d74,_0x5728fb['options']);return _0x1d5ef4[_0x1aac('0x4d')](_0x459d74);}})['then'](function(_0x13c392){if(_0x13c392){_0x55b210=_0x13c392['length'];if(!_0x5728fb[_0x1aac('0x2f')][_0x1aac('0x35')](_0x1aac('0x36'))){_0x459d74[_0x1aac('0x1f')]=qs['limit'](_0x5728fb[_0x1aac('0x2f')][_0x1aac('0x1f')]);_0x459d74['offset']=qs[_0x1aac('0x1d')](_0x5728fb['query'][_0x1aac('0x1d')]);}return _0x1d5ef4[_0x1aac('0x4d')](_0x459d74);}})[_0x1aac('0x24')](function(_0x72d478){if(_0x72d478){return _0x72d478?{'count':_0x55b210,'rows':_0x72d478}:null;}})[_0x1aac('0x24')](respondWithResult(_0x140de1,null))[_0x1aac('0x41')](handleError(_0x140de1,null));}; \ No newline at end of file +var _0x3dae=['include','find','create','body','SugarcrmField','getFields','getSubjects','getDescriptions','findOne','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy','sendStatus','name','send','rawAttributes','fieldName','type','map','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','SugarcrmConfiguration','rows','catch','show','params','keys'];(function(_0x4d8ed9,_0x2ae284){var _0x1e2140=function(_0x9cca89){while(--_0x9cca89){_0x4d8ed9['push'](_0x4d8ed9['shift']());}};_0x1e2140(++_0x2ae284);}(_0x3dae,0x180));var _0xe3da=function(_0x466c4e,_0x42ed54){_0x466c4e=_0x466c4e-0x0;var _0x2ff8ab=_0x3dae[_0x466c4e];return _0x2ff8ab;};'use strict';var emlformat=require(_0xe3da('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe3da('0x1'));var jsonpatch=require(_0xe3da('0x2'));var rp=require(_0xe3da('0x3'));var moment=require('moment');var BPromise=require(_0xe3da('0x4'));var Mustache=require('mustache');var util=require(_0xe3da('0x5'));var path=require(_0xe3da('0x6'));var sox=require(_0xe3da('0x7'));var csv=require(_0xe3da('0x8'));var ejs=require(_0xe3da('0x9'));var fs=require('fs');var fs_extra=require(_0xe3da('0xa'));var _=require('lodash');var squel=require(_0xe3da('0xb'));var crypto=require(_0xe3da('0xc'));var jsforce=require(_0xe3da('0xd'));var deskjs=require(_0xe3da('0xe'));var toCsv=require(_0xe3da('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe3da('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe3da('0x10'));var logger=require(_0xe3da('0x11'))(_0xe3da('0x12'));var utils=require(_0xe3da('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xe3da('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x49e4e3,_0xa610f8){_0xa610f8=_0xa610f8||0xcc;return function(_0x62b9f9){if(_0x62b9f9){return _0x49e4e3['sendStatus'](_0xa610f8);}return _0x49e4e3[_0xe3da('0x15')](_0xa610f8)[_0xe3da('0x16')]();};}function respondWithResult(_0xa0d4de,_0x5d4173){_0x5d4173=_0x5d4173||0xc8;return function(_0x18f9e1){if(_0x18f9e1){return _0xa0d4de[_0xe3da('0x15')](_0x5d4173)[_0xe3da('0x17')](_0x18f9e1);}};}function respondWithFilteredResult(_0x1c4b6f,_0x47710e){return function(_0x17020b){if(_0x17020b){var _0x897a25=typeof _0x47710e[_0xe3da('0x18')]===_0xe3da('0x19')&&typeof _0x47710e['limit']===_0xe3da('0x19');var _0x44ba53=_0x17020b[_0xe3da('0x1a')];var _0x860ff7=_0x897a25?0x0:_0x47710e[_0xe3da('0x18')];var _0x4d2af3=_0x897a25?_0x17020b[_0xe3da('0x1a')]:_0x47710e[_0xe3da('0x18')]+_0x47710e[_0xe3da('0x1b')];var _0x860aaa;if(_0x4d2af3>=_0x44ba53){_0x4d2af3=_0x44ba53;_0x860aaa=0xc8;}else{_0x860aaa=0xce;}_0x1c4b6f[_0xe3da('0x15')](_0x860aaa);return _0x1c4b6f['set'](_0xe3da('0x1c'),_0x860ff7+'-'+_0x4d2af3+'/'+_0x44ba53)[_0xe3da('0x17')](_0x17020b);}return null;};}function patchUpdates(_0x2d5b06){return function(_0x22e279){try{jsonpatch[_0xe3da('0x1d')](_0x22e279,_0x2d5b06,!![]);}catch(_0x1cd647){return BPromise[_0xe3da('0x1e')](_0x1cd647);}return _0x22e279[_0xe3da('0x1f')]();};}function saveUpdates(_0x486bf2,_0x1513d3){return function(_0xc54d7a){if(_0xc54d7a){return _0xc54d7a[_0xe3da('0x20')](_0x486bf2)[_0xe3da('0x21')](function(_0x5419ec){return _0x5419ec;});}return null;};}function removeEntity(_0x16d570,_0x117c43){return function(_0x507be4){if(_0x507be4){return _0x507be4[_0xe3da('0x22')]()[_0xe3da('0x21')](function(){_0x16d570[_0xe3da('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x46f7d0,_0x5ca18e){return function(_0x1f4e65){if(!_0x1f4e65){_0x46f7d0[_0xe3da('0x23')](0x194);}return _0x1f4e65;};}function handleError(_0x380c51,_0xce5ad5){_0xce5ad5=_0xce5ad5||0x1f4;return function(_0x296548){logger['error'](_0x296548['stack']);if(_0x296548[_0xe3da('0x24')]){delete _0x296548[_0xe3da('0x24')];}_0x380c51[_0xe3da('0x15')](_0xce5ad5)[_0xe3da('0x25')](_0x296548);};}exports['index']=function(_0x597a1b,_0x4cd939){var _0x4e1d97={},_0x36aef4={},_0x258eea={'count':0x0,'rows':[]};var _0x2d8be0=_['map'](db['SugarcrmConfiguration'][_0xe3da('0x26')],function(_0x47c321){return{'name':_0x47c321[_0xe3da('0x27')],'type':_0x47c321[_0xe3da('0x28')]['key']};});_0x36aef4['model']=_[_0xe3da('0x29')](_0x2d8be0,_0xe3da('0x24'));_0x36aef4[_0xe3da('0x2a')]=_['keys'](_0x597a1b[_0xe3da('0x2a')]);_0x36aef4[_0xe3da('0x2b')]=_['intersection'](_0x36aef4[_0xe3da('0x2c')],_0x36aef4['query']);_0x4e1d97[_0xe3da('0x2d')]=_[_0xe3da('0x2e')](_0x36aef4['model'],qs[_0xe3da('0x2f')](_0x597a1b[_0xe3da('0x2a')][_0xe3da('0x2f')]));_0x4e1d97['attributes']=_0x4e1d97['attributes'][_0xe3da('0x30')]?_0x4e1d97[_0xe3da('0x2d')]:_0x36aef4[_0xe3da('0x2c')];if(!_0x597a1b[_0xe3da('0x2a')][_0xe3da('0x31')](_0xe3da('0x32'))){_0x4e1d97['limit']=qs[_0xe3da('0x1b')](_0x597a1b['query']['limit']);_0x4e1d97['offset']=qs['offset'](_0x597a1b[_0xe3da('0x2a')][_0xe3da('0x18')]);}_0x4e1d97[_0xe3da('0x33')]=qs[_0xe3da('0x34')](_0x597a1b[_0xe3da('0x2a')]['sort']);_0x4e1d97['where']=qs[_0xe3da('0x2b')](_[_0xe3da('0x35')](_0x597a1b[_0xe3da('0x2a')],_0x36aef4[_0xe3da('0x2b')]),_0x2d8be0);if(_0x597a1b[_0xe3da('0x2a')][_0xe3da('0x36')]){_0x4e1d97[_0xe3da('0x37')]=_[_0xe3da('0x38')](_0x4e1d97[_0xe3da('0x37')],{'$or':_['map'](_0x2d8be0,function(_0x2bdfdf){if(_0x2bdfdf['type']!==_0xe3da('0x39')){var _0x5297b1={};_0x5297b1[_0x2bdfdf[_0xe3da('0x24')]]={'$like':'%'+_0x597a1b['query'][_0xe3da('0x36')]+'%'};return _0x5297b1;}})});}_0x4e1d97=_['merge']({},_0x4e1d97,_0x597a1b[_0xe3da('0x3a')]);var _0xacbd8d={'where':_0x4e1d97[_0xe3da('0x37')]};return db['SugarcrmConfiguration']['count'](_0xacbd8d)[_0xe3da('0x21')](function(_0x1f656f){_0x258eea[_0xe3da('0x1a')]=_0x1f656f;if(_0x597a1b['query'][_0xe3da('0x3b')]){_0x4e1d97['include']=[{'all':!![]}];}return db[_0xe3da('0x3c')]['findAll'](_0x4e1d97);})['then'](function(_0x50708c){_0x258eea[_0xe3da('0x3d')]=_0x50708c;return _0x258eea;})['then'](respondWithFilteredResult(_0x4cd939,_0x4e1d97))[_0xe3da('0x3e')](handleError(_0x4cd939,null));};exports[_0xe3da('0x3f')]=function(_0x22bbe7,_0xdc89d4){var _0x1353eb={'raw':![],'where':{'id':_0x22bbe7[_0xe3da('0x40')]['id']}},_0x57358a={};_0x57358a[_0xe3da('0x2c')]=_[_0xe3da('0x41')](db[_0xe3da('0x3c')]['rawAttributes']);_0x57358a['query']=_[_0xe3da('0x41')](_0x22bbe7[_0xe3da('0x2a')]);_0x57358a[_0xe3da('0x2b')]=_[_0xe3da('0x2e')](_0x57358a[_0xe3da('0x2c')],_0x57358a['query']);_0x1353eb[_0xe3da('0x2d')]=_[_0xe3da('0x2e')](_0x57358a[_0xe3da('0x2c')],qs['fields'](_0x22bbe7[_0xe3da('0x2a')][_0xe3da('0x2f')]));_0x1353eb[_0xe3da('0x2d')]=_0x1353eb[_0xe3da('0x2d')][_0xe3da('0x30')]?_0x1353eb['attributes']:_0x57358a[_0xe3da('0x2c')];if(_0x22bbe7[_0xe3da('0x2a')][_0xe3da('0x3b')]){_0x1353eb[_0xe3da('0x42')]=[{'all':!![]}];}_0x1353eb=_[_0xe3da('0x38')]({},_0x1353eb,_0x22bbe7[_0xe3da('0x3a')]);return db['SugarcrmConfiguration'][_0xe3da('0x43')](_0x1353eb)[_0xe3da('0x21')](handleEntityNotFound(_0xdc89d4,null))['then'](respondWithResult(_0xdc89d4,null))[_0xe3da('0x3e')](handleError(_0xdc89d4,null));};exports[_0xe3da('0x44')]=function(_0x4bd9b5,_0x391305){return db[_0xe3da('0x3c')]['create'](_0x4bd9b5[_0xe3da('0x45')],{})[_0xe3da('0x21')](respondWithResult(_0x391305,0xc9))['catch'](handleError(_0x391305,null));};exports[_0xe3da('0x20')]=function(_0x2e08f6,_0x162a0a){if(_0x2e08f6[_0xe3da('0x45')]['id']){delete _0x2e08f6['body']['id'];}return db[_0xe3da('0x3c')][_0xe3da('0x43')]({'where':{'id':_0x2e08f6[_0xe3da('0x40')]['id']}})['then'](handleEntityNotFound(_0x162a0a,null))[_0xe3da('0x21')](saveUpdates(_0x2e08f6[_0xe3da('0x45')],null))[_0xe3da('0x21')](respondWithResult(_0x162a0a,null))[_0xe3da('0x3e')](handleError(_0x162a0a,null));};exports[_0xe3da('0x22')]=function(_0x352546,_0xce38f1){return db['SugarcrmConfiguration'][_0xe3da('0x43')]({'where':{'id':_0x352546['params']['id']}})[_0xe3da('0x21')](handleEntityNotFound(_0xce38f1,null))[_0xe3da('0x21')](removeEntity(_0xce38f1,null))[_0xe3da('0x3e')](handleError(_0xce38f1,null));};exports['getFields']=function(_0x189343,_0x317da9,_0x4cd0c8){var _0x299193={};var _0x156ea2={};var _0x533237;var _0xd1a266;return db[_0xe3da('0x3c')]['findOne']({'where':{'id':_0x189343['params']['id']}})[_0xe3da('0x21')](handleEntityNotFound(_0x317da9,null))['then'](function(_0x2a9fe9){if(_0x2a9fe9){_0x533237=_0x2a9fe9;_0x156ea2[_0xe3da('0x2c')]=_[_0xe3da('0x41')](db[_0xe3da('0x46')][_0xe3da('0x26')]);_0x156ea2['query']=_['keys'](_0x189343['query']);_0x156ea2[_0xe3da('0x2b')]=_[_0xe3da('0x2e')](_0x156ea2['model'],_0x156ea2['query']);_0x299193[_0xe3da('0x2d')]=_[_0xe3da('0x2e')](_0x156ea2[_0xe3da('0x2c')],qs['fields'](_0x189343[_0xe3da('0x2a')][_0xe3da('0x2f')]));_0x299193[_0xe3da('0x2d')]=_0x299193[_0xe3da('0x2d')][_0xe3da('0x30')]?_0x299193['attributes']:_0x156ea2['model'];_0x299193[_0xe3da('0x33')]=qs[_0xe3da('0x34')](_0x189343[_0xe3da('0x2a')][_0xe3da('0x34')]);_0x299193['where']=qs['filters'](_[_0xe3da('0x35')](_0x189343[_0xe3da('0x2a')],_0x156ea2[_0xe3da('0x2b')]));if(_0x189343[_0xe3da('0x2a')][_0xe3da('0x36')]){_0x299193[_0xe3da('0x37')]=_[_0xe3da('0x38')](_0x299193['where'],{'$or':_[_0xe3da('0x29')](_0x299193[_0xe3da('0x2d')],function(_0x40c13c){var _0x10c57d={};_0x10c57d[_0x40c13c]={'$like':'%'+_0x189343['query'][_0xe3da('0x36')]+'%'};return _0x10c57d;})});}_0x299193=_[_0xe3da('0x38')]({},_0x299193,_0x189343[_0xe3da('0x3a')]);return _0x533237[_0xe3da('0x47')](_0x299193);}})['then'](function(_0x4001d7){if(_0x4001d7){_0xd1a266=_0x4001d7[_0xe3da('0x30')];if(!_0x189343[_0xe3da('0x2a')][_0xe3da('0x31')](_0xe3da('0x32'))){_0x299193[_0xe3da('0x1b')]=qs['limit'](_0x189343[_0xe3da('0x2a')][_0xe3da('0x1b')]);_0x299193[_0xe3da('0x18')]=qs[_0xe3da('0x18')](_0x189343[_0xe3da('0x2a')][_0xe3da('0x18')]);}return _0x533237[_0xe3da('0x47')](_0x299193);}})[_0xe3da('0x21')](function(_0x3c3fa2){if(_0x3c3fa2){return _0x3c3fa2?{'count':_0xd1a266,'rows':_0x3c3fa2}:null;}})['then'](respondWithResult(_0x317da9,null))[_0xe3da('0x3e')](handleError(_0x317da9,null));};exports[_0xe3da('0x48')]=function(_0x4a99a2,_0x2bb697,_0x5f4d23){var _0x4f8d1d={};var _0x5682a3={};var _0x48950a;var _0x148f9c;return db[_0xe3da('0x3c')]['findOne']({'where':{'id':_0x4a99a2['params']['id']}})[_0xe3da('0x21')](handleEntityNotFound(_0x2bb697,null))[_0xe3da('0x21')](function(_0x46c4a3){if(_0x46c4a3){_0x48950a=_0x46c4a3;_0x5682a3[_0xe3da('0x2c')]=_['keys'](db[_0xe3da('0x46')][_0xe3da('0x26')]);_0x5682a3[_0xe3da('0x2a')]=_['keys'](_0x4a99a2[_0xe3da('0x2a')]);_0x5682a3[_0xe3da('0x2b')]=_[_0xe3da('0x2e')](_0x5682a3['model'],_0x5682a3['query']);_0x4f8d1d[_0xe3da('0x2d')]=_[_0xe3da('0x2e')](_0x5682a3[_0xe3da('0x2c')],qs['fields'](_0x4a99a2[_0xe3da('0x2a')][_0xe3da('0x2f')]));_0x4f8d1d['attributes']=_0x4f8d1d[_0xe3da('0x2d')][_0xe3da('0x30')]?_0x4f8d1d[_0xe3da('0x2d')]:_0x5682a3[_0xe3da('0x2c')];_0x4f8d1d[_0xe3da('0x33')]=qs[_0xe3da('0x34')](_0x4a99a2[_0xe3da('0x2a')][_0xe3da('0x34')]);_0x4f8d1d['where']=qs['filters'](_['pick'](_0x4a99a2['query'],_0x5682a3[_0xe3da('0x2b')]));if(_0x4a99a2[_0xe3da('0x2a')]['filter']){_0x4f8d1d['where']=_['merge'](_0x4f8d1d[_0xe3da('0x37')],{'$or':_[_0xe3da('0x29')](_0x4f8d1d[_0xe3da('0x2d')],function(_0x7c1242){var _0x1524e4={};_0x1524e4[_0x7c1242]={'$like':'%'+_0x4a99a2[_0xe3da('0x2a')][_0xe3da('0x36')]+'%'};return _0x1524e4;})});}_0x4f8d1d=_[_0xe3da('0x38')]({},_0x4f8d1d,_0x4a99a2[_0xe3da('0x3a')]);return _0x48950a['getSubjects'](_0x4f8d1d);}})['then'](function(_0x55c0f6){if(_0x55c0f6){_0x148f9c=_0x55c0f6[_0xe3da('0x30')];if(!_0x4a99a2[_0xe3da('0x2a')][_0xe3da('0x31')](_0xe3da('0x32'))){_0x4f8d1d[_0xe3da('0x1b')]=qs['limit'](_0x4a99a2[_0xe3da('0x2a')]['limit']);_0x4f8d1d[_0xe3da('0x18')]=qs[_0xe3da('0x18')](_0x4a99a2[_0xe3da('0x2a')]['offset']);}return _0x48950a[_0xe3da('0x48')](_0x4f8d1d);}})[_0xe3da('0x21')](function(_0x4f1128){if(_0x4f1128){return _0x4f1128?{'count':_0x148f9c,'rows':_0x4f1128}:null;}})[_0xe3da('0x21')](respondWithResult(_0x2bb697,null))[_0xe3da('0x3e')](handleError(_0x2bb697,null));};exports[_0xe3da('0x49')]=function(_0x4772a0,_0x2f19ef,_0x232177){var _0x2c733b={};var _0x34e343={};var _0x3290c8;var _0x466332;return db[_0xe3da('0x3c')][_0xe3da('0x4a')]({'where':{'id':_0x4772a0[_0xe3da('0x40')]['id']}})['then'](handleEntityNotFound(_0x2f19ef,null))[_0xe3da('0x21')](function(_0xdec9a9){if(_0xdec9a9){_0x3290c8=_0xdec9a9;_0x34e343[_0xe3da('0x2c')]=_[_0xe3da('0x41')](db[_0xe3da('0x46')][_0xe3da('0x26')]);_0x34e343[_0xe3da('0x2a')]=_[_0xe3da('0x41')](_0x4772a0['query']);_0x34e343[_0xe3da('0x2b')]=_['intersection'](_0x34e343[_0xe3da('0x2c')],_0x34e343[_0xe3da('0x2a')]);_0x2c733b[_0xe3da('0x2d')]=_[_0xe3da('0x2e')](_0x34e343['model'],qs[_0xe3da('0x2f')](_0x4772a0[_0xe3da('0x2a')][_0xe3da('0x2f')]));_0x2c733b[_0xe3da('0x2d')]=_0x2c733b[_0xe3da('0x2d')][_0xe3da('0x30')]?_0x2c733b['attributes']:_0x34e343[_0xe3da('0x2c')];_0x2c733b[_0xe3da('0x33')]=qs[_0xe3da('0x34')](_0x4772a0[_0xe3da('0x2a')]['sort']);_0x2c733b[_0xe3da('0x37')]=qs[_0xe3da('0x2b')](_['pick'](_0x4772a0['query'],_0x34e343['filters']));if(_0x4772a0[_0xe3da('0x2a')][_0xe3da('0x36')]){_0x2c733b['where']=_['merge'](_0x2c733b['where'],{'$or':_[_0xe3da('0x29')](_0x2c733b['attributes'],function(_0x2bb69e){var _0x4d16dc={};_0x4d16dc[_0x2bb69e]={'$like':'%'+_0x4772a0[_0xe3da('0x2a')]['filter']+'%'};return _0x4d16dc;})});}_0x2c733b=_['merge']({},_0x2c733b,_0x4772a0['options']);return _0x3290c8[_0xe3da('0x49')](_0x2c733b);}})['then'](function(_0x1f2d5b){if(_0x1f2d5b){_0x466332=_0x1f2d5b['length'];if(!_0x4772a0[_0xe3da('0x2a')][_0xe3da('0x31')](_0xe3da('0x32'))){_0x2c733b[_0xe3da('0x1b')]=qs[_0xe3da('0x1b')](_0x4772a0[_0xe3da('0x2a')][_0xe3da('0x1b')]);_0x2c733b['offset']=qs['offset'](_0x4772a0[_0xe3da('0x2a')][_0xe3da('0x18')]);}return _0x3290c8[_0xe3da('0x49')](_0x2c733b);}})['then'](function(_0x3714ac){if(_0x3714ac){return _0x3714ac?{'count':_0x466332,'rows':_0x3714ac}:null;}})['then'](respondWithResult(_0x2f19ef,null))[_0xe3da('0x3e')](handleError(_0x2f19ef,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index e0d13be..fdb5a4e 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 _0x9998=['path','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','define','SugarcrmConfiguration','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x1bfba8,_0x4cc896){var _0x3a9d66=function(_0x32aa6a){while(--_0x32aa6a){_0x1bfba8['push'](_0x1bfba8['shift']());}};_0x3a9d66(++_0x4cc896);}(_0x9998,0xf8));var _0x8999=function(_0x5e0d63,_0x321c2e){_0x5e0d63=_0x5e0d63-0x0;var _0x10a581=_0x9998[_0x5e0d63];return _0x10a581;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8999('0x0'))(_0x8999('0x1'));var moment=require(_0x8999('0x2'));var BPromise=require(_0x8999('0x3'));var rp=require(_0x8999('0x4'));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['exports']=function(_0x1d63a2,_0x46e6b0){return _0x1d63a2[_0x8999('0x9')](_0x8999('0xa'),attributes,{'tableName':'int_sugarcrm_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5356=['moment','bluebird','request-promise','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','exports','define','SugarcrmConfiguration','int_sugarcrm_configurations','lodash','util','../../config/logger'];(function(_0x1c00a8,_0x420997){var _0x168ff6=function(_0x12800e){while(--_0x12800e){_0x1c00a8['push'](_0x1c00a8['shift']());}};_0x168ff6(++_0x420997);}(_0x5356,0x1aa));var _0x6535=function(_0x26d94c,_0x4bf18f){_0x26d94c=_0x26d94c-0x0;var _0x4a9392=_0x5356[_0x26d94c];return _0x4a9392;};'use strict';var _=require(_0x6535('0x0'));var util=require(_0x6535('0x1'));var logger=require(_0x6535('0x2'))('api');var moment=require(_0x6535('0x3'));var BPromise=require(_0x6535('0x4'));var rp=require(_0x6535('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6535('0x6'));var config=require(_0x6535('0x7'));var attributes=require(_0x6535('0x8'));module[_0x6535('0x9')]=function(_0x4ff2f0,_0x35f2d5){return _0x4ff2f0[_0x6535('0xa')](_0x6535('0xb'),attributes,{'tableName':_0x6535('0xc'),'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 9495a3a..b5900a0 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 _0x3444=['randomstring','../../config/utils','../../config/environment','jayson/promise','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment'];(function(_0x21dd50,_0x921f70){var _0x1b7d5e=function(_0x317101){while(--_0x317101){_0x21dd50['push'](_0x21dd50['shift']());}};_0x1b7d5e(++_0x921f70);}(_0x3444,0x166));var _0x4344=function(_0x50a12c,_0x4784e4){_0x50a12c=_0x50a12c-0x0;var _0x476184=_0x3444[_0x50a12c];return _0x476184;};'use strict';var _=require(_0x4344('0x0'));var util=require('util');var moment=require(_0x4344('0x1'));var BPromise=require('bluebird');var rs=require(_0x4344('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4344('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0x4344('0x4'));var jayson=require(_0x4344('0x5'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x70062d,_0x87e305,_0x377667){return new BPromise(function(_0x80835e,_0x439d54){return client[_0x4344('0x6')](_0x70062d,_0x377667)[_0x4344('0x7')](function(_0x250ff2){logger[_0x4344('0x8')](_0x4344('0x9'),_0x87e305,_0x4344('0xa'));logger[_0x4344('0xb')](_0x4344('0xc'),_0x87e305,_0x4344('0xa'),JSON[_0x4344('0xd')](_0x250ff2));if(_0x250ff2['error']){if(_0x250ff2['error']['code']===0x1f4){logger[_0x4344('0xe')](_0x4344('0x9'),_0x87e305,_0x250ff2[_0x4344('0xe')][_0x4344('0xf')]);return _0x439d54(_0x250ff2[_0x4344('0xe')][_0x4344('0xf')]);}logger[_0x4344('0xe')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x87e305,_0x250ff2['error'][_0x4344('0xf')]);return _0x80835e(_0x250ff2['error'][_0x4344('0xf')]);}else{logger[_0x4344('0x8')](_0x4344('0x9'),_0x87e305,_0x4344('0xa'));_0x80835e(_0x250ff2[_0x4344('0x10')][_0x4344('0xf')]);}})[_0x4344('0x11')](function(_0x597945){logger['error'](_0x4344('0x9'),_0x87e305,_0x597945);_0x439d54(_0x597945);});});} \ No newline at end of file +var _0x50a2=['lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','http','request','then','SugarcrmConfiguration,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result'];(function(_0x3b231a,_0x53a00d){var _0x18d67a=function(_0x5e14c6){while(--_0x5e14c6){_0x3b231a['push'](_0x3b231a['shift']());}};_0x18d67a(++_0x53a00d);}(_0x50a2,0x1b0));var _0x250a=function(_0xf8badc,_0x46c03a){_0xf8badc=_0xf8badc-0x0;var _0x30e845=_0x50a2[_0xf8badc];return _0x30e845;};'use strict';var _=require(_0x250a('0x0'));var util=require(_0x250a('0x1'));var moment=require(_0x250a('0x2'));var BPromise=require('bluebird');var rs=require(_0x250a('0x3'));var fs=require('fs');var Redis=require(_0x250a('0x4'));var db=require(_0x250a('0x5'))['db'];var utils=require(_0x250a('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x250a('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x38d0a0,_0x59e4ac,_0x227a5b){return new BPromise(function(_0x52f79f,_0x5c644b){return client[_0x250a('0x8')](_0x38d0a0,_0x227a5b)[_0x250a('0x9')](function(_0x1f7bd1){logger['info'](_0x250a('0xa'),_0x59e4ac,'request\x20sent');logger[_0x250a('0xb')]('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x59e4ac,'request\x20sent',JSON[_0x250a('0xc')](_0x1f7bd1));if(_0x1f7bd1['error']){if(_0x1f7bd1[_0x250a('0xd')][_0x250a('0xe')]===0x1f4){logger[_0x250a('0xd')](_0x250a('0xa'),_0x59e4ac,_0x1f7bd1[_0x250a('0xd')][_0x250a('0xf')]);return _0x5c644b(_0x1f7bd1[_0x250a('0xd')][_0x250a('0xf')]);}logger[_0x250a('0xd')](_0x250a('0xa'),_0x59e4ac,_0x1f7bd1['error'][_0x250a('0xf')]);return _0x52f79f(_0x1f7bd1['error'][_0x250a('0xf')]);}else{logger['info']('SugarcrmConfiguration,\x20%s,\x20%s',_0x59e4ac,_0x250a('0x10'));_0x52f79f(_0x1f7bd1[_0x250a('0x11')][_0x250a('0xf')]);}})['catch'](function(_0x10cbda){logger[_0x250a('0xd')](_0x250a('0xa'),_0x59e4ac,_0x10cbda);_0x5c644b(_0x10cbda);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index b3191b6..330e5d6 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 _0x2f9f=['multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','create','put','update','delete','exports'];(function(_0x33d8f5,_0x3c8786){var _0x4cce93=function(_0x57032d){while(--_0x57032d){_0x33d8f5['push'](_0x33d8f5['shift']());}};_0x4cce93(++_0x3c8786);}(_0x2f9f,0x165));var _0xf2f9=function(_0x178c2a,_0x517cf4){_0x178c2a=_0x178c2a-0x0;var _0x549c06=_0x2f9f[_0x178c2a];return _0x549c06;};'use strict';var multer=require(_0xf2f9('0x0'));var util=require(_0xf2f9('0x1'));var path=require(_0xf2f9('0x2'));var timeout=require(_0xf2f9('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xf2f9('0x4'));var auth=require(_0xf2f9('0x5'));var interaction=require(_0xf2f9('0x6'));var config=require(_0xf2f9('0x7'));var controller=require('./intSugarcrmField.controller');router[_0xf2f9('0x8')]('/',auth['isAuthenticated'](),controller[_0xf2f9('0x9')]);router[_0xf2f9('0x8')](_0xf2f9('0xa'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xf2f9('0xb')](),controller[_0xf2f9('0xc')]);router[_0xf2f9('0xd')](_0xf2f9('0xa'),auth[_0xf2f9('0xb')](),controller[_0xf2f9('0xe')]);router[_0xf2f9('0xf')](_0xf2f9('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0xf2f9('0x10')]=router; \ No newline at end of file +var _0xb9b8=['/:id','isAuthenticated','show','post','create','update','delete','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intSugarcrmField.controller','get'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xb9b8,0x7e));var _0x8b9b=function(_0x4c184d,_0x4278ab){_0x4c184d=_0x4c184d-0x0;var _0x23d997=_0xb9b8[_0x4c184d];return _0x23d997;};'use strict';var multer=require(_0x8b9b('0x0'));var util=require(_0x8b9b('0x1'));var path=require(_0x8b9b('0x2'));var timeout=require(_0x8b9b('0x3'));var express=require(_0x8b9b('0x4'));var router=express[_0x8b9b('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x8b9b('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x8b9b('0x7'));var controller=require(_0x8b9b('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x8b9b('0x9')](_0x8b9b('0xa'),auth[_0x8b9b('0xb')](),controller[_0x8b9b('0xc')]);router[_0x8b9b('0xd')]('/',auth[_0x8b9b('0xb')](),controller[_0x8b9b('0xe')]);router['put'](_0x8b9b('0xa'),auth[_0x8b9b('0xb')](),controller[_0x8b9b('0xf')]);router[_0x8b9b('0x10')](_0x8b9b('0xa'),auth['isAuthenticated'](),controller['destroy']);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 17bab8f..218de5c 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 _0xc1af=['variable','customVariable','picklist','string','STRING','exports','ENUM'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xc1af,0xd0));var _0xfc1a=function(_0x82db70,_0x51d2b0){_0x82db70=_0x82db70-0x0;var _0x464eab=_0xc1af[_0x82db70];return _0x464eab;};'use strict';var Sequelize=require('sequelize');module[_0xfc1a('0x0')]={'type':{'type':Sequelize[_0xfc1a('0x1')]('string',_0xfc1a('0x2'),_0xfc1a('0x3'),'keyValue',_0xfc1a('0x4')),'defaultValue':_0xfc1a('0x5')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xfc1a('0x6')]},'keyType':{'type':Sequelize[_0xfc1a('0x1')](_0xfc1a('0x5'),_0xfc1a('0x2'),_0xfc1a('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xfc1a('0x6')]},'nameField':{'type':Sequelize[_0xfc1a('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xfc1a('0x6')]}}; \ No newline at end of file +var _0xc266=['string','customVariable','keyValue','picklist','STRING','variable','BOOLEAN','sequelize','exports','ENUM'];(function(_0x2aec52,_0x59d962){var _0x3b8835=function(_0x3e2604){while(--_0x3e2604){_0x2aec52['push'](_0x2aec52['shift']());}};_0x3b8835(++_0x59d962);}(_0xc266,0xd9));var _0x6c26=function(_0x314468,_0x2ee724){_0x314468=_0x314468-0x0;var _0xb8eb17=_0xc266[_0x314468];return _0xb8eb17;};'use strict';var Sequelize=require(_0x6c26('0x0'));module[_0x6c26('0x1')]={'type':{'type':Sequelize[_0x6c26('0x2')](_0x6c26('0x3'),'variable',_0x6c26('0x4'),_0x6c26('0x5'),_0x6c26('0x6')),'defaultValue':_0x6c26('0x3')},'content':{'type':Sequelize[_0x6c26('0x7')]},'key':{'type':Sequelize[_0x6c26('0x7')]},'keyType':{'type':Sequelize[_0x6c26('0x2')]('string',_0x6c26('0x8'),_0x6c26('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x6c26('0x7')]},'nameField':{'type':Sequelize[_0x6c26('0x7')]},'customField':{'type':Sequelize[_0x6c26('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6c26('0x7')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index a664449..118873c 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 _0xcf12=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set','apply','save','update','then','destroy','error','stack','name','send','map','SugarcrmField','fieldName','key','model','intersection','attributes','fields','length','query','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','include','findAll','catch','show','params','rawAttributes','includeAll','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api'];(function(_0x179d06,_0x13788d){var _0x52c18f=function(_0x4a90c9){while(--_0x4a90c9){_0x179d06['push'](_0x179d06['shift']());}};_0x52c18f(++_0x13788d);}(_0xcf12,0x1ab));var _0x2cf1=function(_0x3758bc,_0x40e87e){_0x3758bc=_0x3758bc-0x0;var _0x158922=_0xcf12[_0x3758bc];return _0x158922;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2cf1('0x0'));var zipdir=require(_0x2cf1('0x1'));var jsonpatch=require(_0x2cf1('0x2'));var rp=require(_0x2cf1('0x3'));var moment=require(_0x2cf1('0x4'));var BPromise=require(_0x2cf1('0x5'));var Mustache=require('mustache');var util=require(_0x2cf1('0x6'));var path=require(_0x2cf1('0x7'));var sox=require(_0x2cf1('0x8'));var csv=require(_0x2cf1('0x9'));var ejs=require(_0x2cf1('0xa'));var fs=require('fs');var fs_extra=require(_0x2cf1('0xb'));var _=require(_0x2cf1('0xc'));var squel=require(_0x2cf1('0xd'));var crypto=require(_0x2cf1('0xe'));var jsforce=require(_0x2cf1('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x2cf1('0x9'));var querystring=require(_0x2cf1('0x10'));var Papa=require(_0x2cf1('0x11'));var Redis=require(_0x2cf1('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x2cf1('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2cf1('0x14'));var logger=require(_0x2cf1('0x15'))(_0x2cf1('0x16'));var utils=require(_0x2cf1('0x17'));var config=require(_0x2cf1('0x18'));var licenseUtil=require(_0x2cf1('0x19'));var db=require(_0x2cf1('0x1a'))['db'];function respondWithStatusCode(_0x2f83a0,_0x560c28){_0x560c28=_0x560c28||0xcc;return function(_0x1510ee){if(_0x1510ee){return _0x2f83a0[_0x2cf1('0x1b')](_0x560c28);}return _0x2f83a0['status'](_0x560c28)[_0x2cf1('0x1c')]();};}function respondWithResult(_0x4e2be9,_0x470370){_0x470370=_0x470370||0xc8;return function(_0x3d9872){if(_0x3d9872){return _0x4e2be9[_0x2cf1('0x1d')](_0x470370)[_0x2cf1('0x1e')](_0x3d9872);}};}function respondWithFilteredResult(_0x53a654,_0x1185f1){return function(_0x3f5268){if(_0x3f5268){var _0x4b98af=typeof _0x1185f1[_0x2cf1('0x1f')]==='undefined'&&typeof _0x1185f1[_0x2cf1('0x20')]===_0x2cf1('0x21');var _0x58312b=_0x3f5268[_0x2cf1('0x22')];var _0x2c54a0=_0x4b98af?0x0:_0x1185f1['offset'];var _0x15f830=_0x4b98af?_0x3f5268[_0x2cf1('0x22')]:_0x1185f1[_0x2cf1('0x1f')]+_0x1185f1['limit'];var _0x2bdda1;if(_0x15f830>=_0x58312b){_0x15f830=_0x58312b;_0x2bdda1=0xc8;}else{_0x2bdda1=0xce;}_0x53a654['status'](_0x2bdda1);return _0x53a654[_0x2cf1('0x23')]('Content-Range',_0x2c54a0+'-'+_0x15f830+'/'+_0x58312b)['json'](_0x3f5268);}return null;};}function patchUpdates(_0x3965c0){return function(_0x10d4c3){try{jsonpatch[_0x2cf1('0x24')](_0x10d4c3,_0x3965c0,!![]);}catch(_0x2a97bd){return BPromise['reject'](_0x2a97bd);}return _0x10d4c3[_0x2cf1('0x25')]();};}function saveUpdates(_0x4b1abd,_0x37d70b){return function(_0x34b6c9){if(_0x34b6c9){return _0x34b6c9[_0x2cf1('0x26')](_0x4b1abd)[_0x2cf1('0x27')](function(_0x431290){return _0x431290;});}return null;};}function removeEntity(_0x52c613,_0x4890d0){return function(_0x14a6e6){if(_0x14a6e6){return _0x14a6e6[_0x2cf1('0x28')]()[_0x2cf1('0x27')](function(){_0x52c613[_0x2cf1('0x1d')](0xcc)[_0x2cf1('0x1c')]();});}};}function handleEntityNotFound(_0x403eb7,_0x6f0c6d){return function(_0x43eb21){if(!_0x43eb21){_0x403eb7[_0x2cf1('0x1b')](0x194);}return _0x43eb21;};}function handleError(_0xa07aec,_0x4dd84b){_0x4dd84b=_0x4dd84b||0x1f4;return function(_0x4c7aae){logger[_0x2cf1('0x29')](_0x4c7aae[_0x2cf1('0x2a')]);if(_0x4c7aae[_0x2cf1('0x2b')]){delete _0x4c7aae['name'];}_0xa07aec['status'](_0x4dd84b)[_0x2cf1('0x2c')](_0x4c7aae);};}exports['index']=function(_0x101be7,_0x40bd82){var _0x32b69e={},_0x1d5341={},_0x2891c5={'count':0x0,'rows':[]};var _0x45a067=_[_0x2cf1('0x2d')](db[_0x2cf1('0x2e')]['rawAttributes'],function(_0x16772b){return{'name':_0x16772b[_0x2cf1('0x2f')],'type':_0x16772b['type'][_0x2cf1('0x30')]};});_0x1d5341[_0x2cf1('0x31')]=_['map'](_0x45a067,_0x2cf1('0x2b'));_0x1d5341['query']=_['keys'](_0x101be7['query']);_0x1d5341['filters']=_[_0x2cf1('0x32')](_0x1d5341[_0x2cf1('0x31')],_0x1d5341['query']);_0x32b69e[_0x2cf1('0x33')]=_[_0x2cf1('0x32')](_0x1d5341[_0x2cf1('0x31')],qs['fields'](_0x101be7['query'][_0x2cf1('0x34')]));_0x32b69e[_0x2cf1('0x33')]=_0x32b69e[_0x2cf1('0x33')][_0x2cf1('0x35')]?_0x32b69e['attributes']:_0x1d5341[_0x2cf1('0x31')];if(!_0x101be7[_0x2cf1('0x36')]['hasOwnProperty']('nolimit')){_0x32b69e[_0x2cf1('0x20')]=qs['limit'](_0x101be7[_0x2cf1('0x36')][_0x2cf1('0x20')]);_0x32b69e[_0x2cf1('0x1f')]=qs[_0x2cf1('0x1f')](_0x101be7[_0x2cf1('0x36')][_0x2cf1('0x1f')]);}_0x32b69e[_0x2cf1('0x37')]=qs[_0x2cf1('0x38')](_0x101be7['query'][_0x2cf1('0x38')]);_0x32b69e[_0x2cf1('0x39')]=qs[_0x2cf1('0x3a')](_[_0x2cf1('0x3b')](_0x101be7['query'],_0x1d5341[_0x2cf1('0x3a')]),_0x45a067);if(_0x101be7['query'][_0x2cf1('0x3c')]){_0x32b69e[_0x2cf1('0x39')]=_[_0x2cf1('0x3d')](_0x32b69e['where'],{'$or':_[_0x2cf1('0x2d')](_0x45a067,function(_0x455a26){if(_0x455a26[_0x2cf1('0x3e')]!==_0x2cf1('0x3f')){var _0x311205={};_0x311205[_0x455a26[_0x2cf1('0x2b')]]={'$like':'%'+_0x101be7['query']['filter']+'%'};return _0x311205;}})});}_0x32b69e=_[_0x2cf1('0x3d')]({},_0x32b69e,_0x101be7[_0x2cf1('0x40')]);var _0x48494f={'where':_0x32b69e[_0x2cf1('0x39')]};return db[_0x2cf1('0x2e')][_0x2cf1('0x22')](_0x48494f)['then'](function(_0x30e2c2){_0x2891c5[_0x2cf1('0x22')]=_0x30e2c2;if(_0x101be7['query']['includeAll']){_0x32b69e[_0x2cf1('0x41')]=[{'all':!![]}];}return db['SugarcrmField'][_0x2cf1('0x42')](_0x32b69e);})[_0x2cf1('0x27')](function(_0x2d1d0a){_0x2891c5['rows']=_0x2d1d0a;return _0x2891c5;})[_0x2cf1('0x27')](respondWithFilteredResult(_0x40bd82,_0x32b69e))[_0x2cf1('0x43')](handleError(_0x40bd82,null));};exports[_0x2cf1('0x44')]=function(_0x5bccd3,_0x59b86b){var _0x12ff01={'raw':!![],'where':{'id':_0x5bccd3[_0x2cf1('0x45')]['id']}},_0x1aba6b={};_0x1aba6b[_0x2cf1('0x31')]=_['keys'](db[_0x2cf1('0x2e')][_0x2cf1('0x46')]);_0x1aba6b['query']=_['keys'](_0x5bccd3[_0x2cf1('0x36')]);_0x1aba6b[_0x2cf1('0x3a')]=_[_0x2cf1('0x32')](_0x1aba6b[_0x2cf1('0x31')],_0x1aba6b[_0x2cf1('0x36')]);_0x12ff01[_0x2cf1('0x33')]=_[_0x2cf1('0x32')](_0x1aba6b['model'],qs[_0x2cf1('0x34')](_0x5bccd3[_0x2cf1('0x36')]['fields']));_0x12ff01[_0x2cf1('0x33')]=_0x12ff01[_0x2cf1('0x33')][_0x2cf1('0x35')]?_0x12ff01['attributes']:_0x1aba6b[_0x2cf1('0x31')];if(_0x5bccd3['query'][_0x2cf1('0x47')]){_0x12ff01[_0x2cf1('0x41')]=[{'all':!![]}];}_0x12ff01=_[_0x2cf1('0x3d')]({},_0x12ff01,_0x5bccd3['options']);return db[_0x2cf1('0x2e')][_0x2cf1('0x48')](_0x12ff01)[_0x2cf1('0x27')](handleEntityNotFound(_0x59b86b,null))[_0x2cf1('0x27')](respondWithResult(_0x59b86b,null))[_0x2cf1('0x43')](handleError(_0x59b86b,null));};exports[_0x2cf1('0x49')]=function(_0x13fffa,_0x56f9ce){return db['SugarcrmField'][_0x2cf1('0x49')](_0x13fffa['body'],{})['then'](respondWithResult(_0x56f9ce,0xc9))[_0x2cf1('0x43')](handleError(_0x56f9ce,null));};exports[_0x2cf1('0x26')]=function(_0x3f9c54,_0x3a7aa6){if(_0x3f9c54[_0x2cf1('0x4a')]['id']){delete _0x3f9c54['body']['id'];}return db[_0x2cf1('0x2e')][_0x2cf1('0x48')]({'where':{'id':_0x3f9c54[_0x2cf1('0x45')]['id']}})['then'](handleEntityNotFound(_0x3a7aa6,null))[_0x2cf1('0x27')](saveUpdates(_0x3f9c54[_0x2cf1('0x4a')],null))['then'](respondWithResult(_0x3a7aa6,null))[_0x2cf1('0x43')](handleError(_0x3a7aa6,null));};exports[_0x2cf1('0x28')]=function(_0x981952,_0xaf7f7a){return db[_0x2cf1('0x2e')][_0x2cf1('0x48')]({'where':{'id':_0x981952[_0x2cf1('0x45')]['id']}})[_0x2cf1('0x27')](handleEntityNotFound(_0xaf7f7a,null))['then'](removeEntity(_0xaf7f7a,null))['catch'](handleError(_0xaf7f7a,null));}; \ No newline at end of file +var _0x9a7d=['SugarcrmField','includeAll','include','rows','catch','show','params','length','create','body','find','zip-dir','request-promise','moment','bluebird','mustache','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','count','offset','reject','save','update','then','destroy','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','keys','query','filters','attributes','intersection','fields','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options'];(function(_0xf03591,_0x26504c){var _0x25cd8e=function(_0x56bb13){while(--_0x56bb13){_0xf03591['push'](_0xf03591['shift']());}};_0x25cd8e(++_0x26504c);}(_0x9a7d,0x11f));var _0xd9a7=function(_0x5a96e6,_0x3595c1){_0x5a96e6=_0x5a96e6-0x0;var _0x29151d=_0x9a7d[_0x5a96e6];return _0x29151d;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xd9a7('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd9a7('0x1'));var moment=require(_0xd9a7('0x2'));var BPromise=require(_0xd9a7('0x3'));var Mustache=require(_0xd9a7('0x4'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xd9a7('0x5'));var ejs=require(_0xd9a7('0x6'));var fs=require('fs');var fs_extra=require(_0xd9a7('0x7'));var _=require(_0xd9a7('0x8'));var squel=require(_0xd9a7('0x9'));var crypto=require(_0xd9a7('0xa'));var jsforce=require(_0xd9a7('0xb'));var deskjs=require(_0xd9a7('0xc'));var toCsv=require('to-csv');var querystring=require(_0xd9a7('0xd'));var Papa=require(_0xd9a7('0xe'));var Redis=require(_0xd9a7('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xd9a7('0x10'));var as=require(_0xd9a7('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xd9a7('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xd9a7('0x13'));var db=require(_0xd9a7('0x14'))['db'];function respondWithStatusCode(_0x215e59,_0x4de94a){_0x4de94a=_0x4de94a||0xcc;return function(_0x5b3e26){if(_0x5b3e26){return _0x215e59[_0xd9a7('0x15')](_0x4de94a);}return _0x215e59[_0xd9a7('0x16')](_0x4de94a)[_0xd9a7('0x17')]();};}function respondWithResult(_0x274ce8,_0xc6ad7e){_0xc6ad7e=_0xc6ad7e||0xc8;return function(_0x40a011){if(_0x40a011){return _0x274ce8[_0xd9a7('0x16')](_0xc6ad7e)[_0xd9a7('0x18')](_0x40a011);}};}function respondWithFilteredResult(_0x5d71b2,_0x39380e){return function(_0xc30f76){if(_0xc30f76){var _0x1fb89a=typeof _0x39380e['offset']==='undefined'&&typeof _0x39380e[_0xd9a7('0x19')]==='undefined';var _0x466079=_0xc30f76[_0xd9a7('0x1a')];var _0x25c4de=_0x1fb89a?0x0:_0x39380e[_0xd9a7('0x1b')];var _0x4aef00=_0x1fb89a?_0xc30f76[_0xd9a7('0x1a')]:_0x39380e[_0xd9a7('0x1b')]+_0x39380e[_0xd9a7('0x19')];var _0x2f00ca;if(_0x4aef00>=_0x466079){_0x4aef00=_0x466079;_0x2f00ca=0xc8;}else{_0x2f00ca=0xce;}_0x5d71b2[_0xd9a7('0x16')](_0x2f00ca);return _0x5d71b2['set']('Content-Range',_0x25c4de+'-'+_0x4aef00+'/'+_0x466079)[_0xd9a7('0x18')](_0xc30f76);}return null;};}function patchUpdates(_0x45fb7b){return function(_0x58caa1){try{jsonpatch['apply'](_0x58caa1,_0x45fb7b,!![]);}catch(_0x530c83){return BPromise[_0xd9a7('0x1c')](_0x530c83);}return _0x58caa1[_0xd9a7('0x1d')]();};}function saveUpdates(_0x42cb94,_0x553470){return function(_0x573ca7){if(_0x573ca7){return _0x573ca7[_0xd9a7('0x1e')](_0x42cb94)[_0xd9a7('0x1f')](function(_0xb745cb){return _0xb745cb;});}return null;};}function removeEntity(_0x506ba7,_0x4926fe){return function(_0x285ba6){if(_0x285ba6){return _0x285ba6[_0xd9a7('0x20')]()[_0xd9a7('0x1f')](function(){_0x506ba7[_0xd9a7('0x16')](0xcc)[_0xd9a7('0x17')]();});}};}function handleEntityNotFound(_0x4b74b8,_0x11dd2e){return function(_0x13da31){if(!_0x13da31){_0x4b74b8[_0xd9a7('0x15')](0x194);}return _0x13da31;};}function handleError(_0x2e3b2b,_0x4fda47){_0x4fda47=_0x4fda47||0x1f4;return function(_0x18e970){logger['error'](_0x18e970[_0xd9a7('0x21')]);if(_0x18e970[_0xd9a7('0x22')]){delete _0x18e970[_0xd9a7('0x22')];}_0x2e3b2b['status'](_0x4fda47)[_0xd9a7('0x23')](_0x18e970);};}exports[_0xd9a7('0x24')]=function(_0x50228d,_0x46adaf){var _0x2a7bc2={},_0x5ac74b={},_0x41ffe0={'count':0x0,'rows':[]};var _0x48e462=_['map'](db['SugarcrmField'][_0xd9a7('0x25')],function(_0x4c0f84){return{'name':_0x4c0f84[_0xd9a7('0x26')],'type':_0x4c0f84[_0xd9a7('0x27')][_0xd9a7('0x28')]};});_0x5ac74b[_0xd9a7('0x29')]=_[_0xd9a7('0x2a')](_0x48e462,_0xd9a7('0x22'));_0x5ac74b['query']=_[_0xd9a7('0x2b')](_0x50228d[_0xd9a7('0x2c')]);_0x5ac74b[_0xd9a7('0x2d')]=_['intersection'](_0x5ac74b[_0xd9a7('0x29')],_0x5ac74b[_0xd9a7('0x2c')]);_0x2a7bc2[_0xd9a7('0x2e')]=_[_0xd9a7('0x2f')](_0x5ac74b[_0xd9a7('0x29')],qs[_0xd9a7('0x30')](_0x50228d[_0xd9a7('0x2c')][_0xd9a7('0x30')]));_0x2a7bc2[_0xd9a7('0x2e')]=_0x2a7bc2['attributes']['length']?_0x2a7bc2['attributes']:_0x5ac74b['model'];if(!_0x50228d[_0xd9a7('0x2c')]['hasOwnProperty'](_0xd9a7('0x31'))){_0x2a7bc2[_0xd9a7('0x19')]=qs[_0xd9a7('0x19')](_0x50228d[_0xd9a7('0x2c')][_0xd9a7('0x19')]);_0x2a7bc2[_0xd9a7('0x1b')]=qs[_0xd9a7('0x1b')](_0x50228d[_0xd9a7('0x2c')][_0xd9a7('0x1b')]);}_0x2a7bc2[_0xd9a7('0x32')]=qs[_0xd9a7('0x33')](_0x50228d[_0xd9a7('0x2c')]['sort']);_0x2a7bc2[_0xd9a7('0x34')]=qs[_0xd9a7('0x2d')](_[_0xd9a7('0x35')](_0x50228d[_0xd9a7('0x2c')],_0x5ac74b[_0xd9a7('0x2d')]),_0x48e462);if(_0x50228d[_0xd9a7('0x2c')][_0xd9a7('0x36')]){_0x2a7bc2['where']=_['merge'](_0x2a7bc2[_0xd9a7('0x34')],{'$or':_[_0xd9a7('0x2a')](_0x48e462,function(_0xf3f1c0){if(_0xf3f1c0[_0xd9a7('0x27')]!==_0xd9a7('0x37')){var _0x5e6b13={};_0x5e6b13[_0xf3f1c0[_0xd9a7('0x22')]]={'$like':'%'+_0x50228d[_0xd9a7('0x2c')][_0xd9a7('0x36')]+'%'};return _0x5e6b13;}})});}_0x2a7bc2=_[_0xd9a7('0x38')]({},_0x2a7bc2,_0x50228d[_0xd9a7('0x39')]);var _0x1a1bdd={'where':_0x2a7bc2[_0xd9a7('0x34')]};return db[_0xd9a7('0x3a')][_0xd9a7('0x1a')](_0x1a1bdd)[_0xd9a7('0x1f')](function(_0x337a04){_0x41ffe0[_0xd9a7('0x1a')]=_0x337a04;if(_0x50228d['query'][_0xd9a7('0x3b')]){_0x2a7bc2[_0xd9a7('0x3c')]=[{'all':!![]}];}return db[_0xd9a7('0x3a')]['findAll'](_0x2a7bc2);})[_0xd9a7('0x1f')](function(_0x2a0a5b){_0x41ffe0[_0xd9a7('0x3d')]=_0x2a0a5b;return _0x41ffe0;})[_0xd9a7('0x1f')](respondWithFilteredResult(_0x46adaf,_0x2a7bc2))[_0xd9a7('0x3e')](handleError(_0x46adaf,null));};exports[_0xd9a7('0x3f')]=function(_0x2a9591,_0x4e913f){var _0x3cf999={'raw':!![],'where':{'id':_0x2a9591[_0xd9a7('0x40')]['id']}},_0xff87cb={};_0xff87cb[_0xd9a7('0x29')]=_['keys'](db[_0xd9a7('0x3a')][_0xd9a7('0x25')]);_0xff87cb['query']=_[_0xd9a7('0x2b')](_0x2a9591['query']);_0xff87cb[_0xd9a7('0x2d')]=_[_0xd9a7('0x2f')](_0xff87cb['model'],_0xff87cb[_0xd9a7('0x2c')]);_0x3cf999[_0xd9a7('0x2e')]=_[_0xd9a7('0x2f')](_0xff87cb[_0xd9a7('0x29')],qs[_0xd9a7('0x30')](_0x2a9591[_0xd9a7('0x2c')][_0xd9a7('0x30')]));_0x3cf999['attributes']=_0x3cf999[_0xd9a7('0x2e')][_0xd9a7('0x41')]?_0x3cf999[_0xd9a7('0x2e')]:_0xff87cb['model'];if(_0x2a9591[_0xd9a7('0x2c')][_0xd9a7('0x3b')]){_0x3cf999[_0xd9a7('0x3c')]=[{'all':!![]}];}_0x3cf999=_[_0xd9a7('0x38')]({},_0x3cf999,_0x2a9591['options']);return db[_0xd9a7('0x3a')]['find'](_0x3cf999)[_0xd9a7('0x1f')](handleEntityNotFound(_0x4e913f,null))[_0xd9a7('0x1f')](respondWithResult(_0x4e913f,null))[_0xd9a7('0x3e')](handleError(_0x4e913f,null));};exports['create']=function(_0x35ebeb,_0x1bea2d){return db['SugarcrmField'][_0xd9a7('0x42')](_0x35ebeb[_0xd9a7('0x43')],{})[_0xd9a7('0x1f')](respondWithResult(_0x1bea2d,0xc9))[_0xd9a7('0x3e')](handleError(_0x1bea2d,null));};exports[_0xd9a7('0x1e')]=function(_0x1715b7,_0x387d8a){if(_0x1715b7[_0xd9a7('0x43')]['id']){delete _0x1715b7[_0xd9a7('0x43')]['id'];}return db[_0xd9a7('0x3a')][_0xd9a7('0x44')]({'where':{'id':_0x1715b7[_0xd9a7('0x40')]['id']}})[_0xd9a7('0x1f')](handleEntityNotFound(_0x387d8a,null))['then'](saveUpdates(_0x1715b7[_0xd9a7('0x43')],null))['then'](respondWithResult(_0x387d8a,null))[_0xd9a7('0x3e')](handleError(_0x387d8a,null));};exports[_0xd9a7('0x20')]=function(_0x19355b,_0x54ed57){return db[_0xd9a7('0x3a')][_0xd9a7('0x44')]({'where':{'id':_0x19355b[_0xd9a7('0x40')]['id']}})[_0xd9a7('0x1f')](handleEntityNotFound(_0x54ed57,null))[_0xd9a7('0x1f')](removeEntity(_0x54ed57,null))['catch'](handleError(_0x54ed57,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index dc495dc..6cfd1d0 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 _0xfbd8=['path','rimraf','../../config/environment','./intSugarcrmField.attributes','exports','define','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','idField','FieldId','lodash','util','../../config/logger','api','request-promise'];(function(_0x1deee5,_0x1d4485){var _0x1d6c3a=function(_0x433abf){while(--_0x433abf){_0x1deee5['push'](_0x1deee5['shift']());}};_0x1d6c3a(++_0x1d4485);}(_0xfbd8,0xeb));var _0x8fbd=function(_0x7427dd,_0x14d109){_0x7427dd=_0x7427dd-0x0;var _0x34697b=_0xfbd8[_0x7427dd];return _0x34697b;};'use strict';var _=require(_0x8fbd('0x0'));var util=require(_0x8fbd('0x1'));var logger=require(_0x8fbd('0x2'))(_0x8fbd('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x8fbd('0x4'));var fs=require('fs');var path=require(_0x8fbd('0x5'));var rimraf=require(_0x8fbd('0x6'));var config=require(_0x8fbd('0x7'));var attributes=require(_0x8fbd('0x8'));module[_0x8fbd('0x9')]=function(_0x892c3f,_0x419546){return _0x892c3f[_0x8fbd('0xa')](_0x8fbd('0xb'),attributes,{'tableName':_0x8fbd('0xc'),'paranoid':![],'indexes':[{'name':_0x8fbd('0xd'),'fields':[_0x8fbd('0xe'),_0x8fbd('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x376e=['../../config/environment','SugarcrmField','sugarcrm_unique_index','idField','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0xc0da83,_0x593052){var _0x3e2841=function(_0x274495){while(--_0x274495){_0xc0da83['push'](_0xc0da83['shift']());}};_0x3e2841(++_0x593052);}(_0x376e,0xfb));var _0xe376=function(_0x1762b4,_0x33d836){_0x1762b4=_0x1762b4-0x0;var _0x29beda=_0x376e[_0x1762b4];return _0x29beda;};'use strict';var _=require(_0xe376('0x0'));var util=require(_0xe376('0x1'));var logger=require(_0xe376('0x2'))(_0xe376('0x3'));var moment=require(_0xe376('0x4'));var BPromise=require(_0xe376('0x5'));var rp=require(_0xe376('0x6'));var fs=require('fs');var path=require(_0xe376('0x7'));var rimraf=require(_0xe376('0x8'));var config=require(_0xe376('0x9'));var attributes=require('./intSugarcrmField.attributes');module['exports']=function(_0x435bfa,_0x32ece6){return _0x435bfa['define'](_0xe376('0xa'),attributes,{'tableName':'int_sugarcrm_fields','paranoid':![],'indexes':[{'name':_0xe376('0xb'),'fields':[_0xe376('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.rpc.js b/server/api/intSugarcrmField/intSugarcrmField.rpc.js index a5e6b43..527e4c3 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 _0x5d28=['jayson/promise','client','http','then','info','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','code','SugarcrmField,\x20%s,\x20%s','message','result','catch','lodash','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x389832,_0x10a4a9){var _0x59429e=function(_0x5f3562){while(--_0x5f3562){_0x389832['push'](_0x389832['shift']());}};_0x59429e(++_0x10a4a9);}(_0x5d28,0x19e));var _0x85d2=function(_0x2623af,_0x133623){_0x2623af=_0x2623af-0x0;var _0x37ed80=_0x5d28[_0x2623af];return _0x37ed80;};'use strict';var _=require(_0x85d2('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x85d2('0x1'));var db=require(_0x85d2('0x2'))['db'];var utils=require(_0x85d2('0x3'));var logger=require(_0x85d2('0x4'))(_0x85d2('0x5'));var config=require('../../config/environment');var jayson=require(_0x85d2('0x6'));var client=jayson[_0x85d2('0x7')][_0x85d2('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5545f0,_0x4cf098,_0x4a8afe){return new BPromise(function(_0x1871f4,_0x2a935b){return client['request'](_0x5545f0,_0x4a8afe)[_0x85d2('0x9')](function(_0x2e103d){logger[_0x85d2('0xa')]('SugarcrmField,\x20%s,\x20%s',_0x4cf098,_0x85d2('0xb'));logger[_0x85d2('0xc')](_0x85d2('0xd'),_0x4cf098,_0x85d2('0xb'),JSON[_0x85d2('0xe')](_0x2e103d));if(_0x2e103d[_0x85d2('0xf')]){if(_0x2e103d['error'][_0x85d2('0x10')]===0x1f4){logger['error'](_0x85d2('0x11'),_0x4cf098,_0x2e103d['error'][_0x85d2('0x12')]);return _0x2a935b(_0x2e103d[_0x85d2('0xf')][_0x85d2('0x12')]);}logger[_0x85d2('0xf')]('SugarcrmField,\x20%s,\x20%s',_0x4cf098,_0x2e103d['error'][_0x85d2('0x12')]);return _0x1871f4(_0x2e103d['error']['message']);}else{logger[_0x85d2('0xa')](_0x85d2('0x11'),_0x4cf098,_0x85d2('0xb'));_0x1871f4(_0x2e103d[_0x85d2('0x13')]['message']);}})[_0x85d2('0x14')](function(_0x3a5881){logger[_0x85d2('0xf')]('SugarcrmField,\x20%s,\x20%s',_0x4cf098,_0x3a5881);_0x2a935b(_0x3a5881);});});} \ No newline at end of file +var _0x620d=['ioredis','../../config/logger','../../config/environment','http','request','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','bluebird','randomstring'];(function(_0x516975,_0x5e4660){var _0x5c1b6f=function(_0x45de90){while(--_0x45de90){_0x516975['push'](_0x516975['shift']());}};_0x5c1b6f(++_0x5e4660);}(_0x620d,0x166));var _0xd620=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x620d[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0xd620('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xd620('0x1'));var rs=require(_0xd620('0x2'));var fs=require('fs');var Redis=require(_0xd620('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xd620('0x4'))('rpc');var config=require(_0xd620('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0xd620('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x1d49cd,_0x3ec72a,_0x458b11){return new BPromise(function(_0x5a6b79,_0x462840){return client[_0xd620('0x7')](_0x1d49cd,_0x458b11)['then'](function(_0x4f3082){logger[_0xd620('0x8')](_0xd620('0x9'),_0x3ec72a,_0xd620('0xa'));logger[_0xd620('0xb')](_0xd620('0xc'),_0x3ec72a,_0xd620('0xa'),JSON[_0xd620('0xd')](_0x4f3082));if(_0x4f3082[_0xd620('0xe')]){if(_0x4f3082[_0xd620('0xe')][_0xd620('0xf')]===0x1f4){logger[_0xd620('0xe')](_0xd620('0x9'),_0x3ec72a,_0x4f3082[_0xd620('0xe')][_0xd620('0x10')]);return _0x462840(_0x4f3082[_0xd620('0xe')][_0xd620('0x10')]);}logger['error'](_0xd620('0x9'),_0x3ec72a,_0x4f3082[_0xd620('0xe')]['message']);return _0x5a6b79(_0x4f3082['error']['message']);}else{logger['info']('SugarcrmField,\x20%s,\x20%s',_0x3ec72a,'request\x20sent');_0x5a6b79(_0x4f3082[_0xd620('0x11')][_0xd620('0x10')]);}})[_0xd620('0x12')](function(_0x18a68c){logger[_0xd620('0xe')](_0xd620('0x9'),_0x3ec72a,_0x18a68c);_0x462840(_0x18a68c);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index d97e0c3..4edc9c2 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 _0x30ff=['/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intVtigerAccount.controller','get','isAuthenticated','/:id','show','/:id/configurations','getConfigurations'];(function(_0x4e27cc,_0x8eca75){var _0x5e2fac=function(_0x993d76){while(--_0x993d76){_0x4e27cc['push'](_0x4e27cc['shift']());}};_0x5e2fac(++_0x8eca75);}(_0x30ff,0x6a));var _0xf30f=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x30ff[_0x3947c9];return _0x2e7871;};'use strict';var multer=require('multer');var util=require(_0xf30f('0x0'));var path=require(_0xf30f('0x1'));var timeout=require(_0xf30f('0x2'));var express=require(_0xf30f('0x3'));var router=express[_0xf30f('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xf30f('0x5'));var interaction=require(_0xf30f('0x6'));var config=require('../../config/environment');var controller=require(_0xf30f('0x7'));router[_0xf30f('0x8')]('/',auth[_0xf30f('0x9')](),controller['index']);router[_0xf30f('0x8')](_0xf30f('0xa'),auth[_0xf30f('0x9')](),controller[_0xf30f('0xb')]);router['get'](_0xf30f('0xc'),auth[_0xf30f('0x9')](),controller[_0xf30f('0xd')]);router[_0xf30f('0x8')](_0xf30f('0xe'),auth[_0xf30f('0x9')](),controller[_0xf30f('0xf')]);router[_0xf30f('0x10')]('/',auth[_0xf30f('0x9')](),controller[_0xf30f('0x11')]);router[_0xf30f('0x10')](_0xf30f('0xc'),auth['isAuthenticated'](),controller[_0xf30f('0x12')]);router[_0xf30f('0x13')](_0xf30f('0xa'),auth['isAuthenticated'](),controller[_0xf30f('0x14')]);router[_0xf30f('0x15')](_0xf30f('0xa'),auth['isAuthenticated'](),controller[_0xf30f('0x16')]);module[_0xf30f('0x17')]=router; \ No newline at end of file +var _0xa4fa=['/:id/configurations','getConfigurations','post','create','addConfiguration','/:id','delete','exports','multer','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','show'];(function(_0xb6d3c1,_0x2222bb){var _0x6ce1ff=function(_0x35ef4f){while(--_0x35ef4f){_0xb6d3c1['push'](_0xb6d3c1['shift']());}};_0x6ce1ff(++_0x2222bb);}(_0xa4fa,0x1ca));var _0xaa4f=function(_0x2fc3ee,_0x56ab8c){_0x2fc3ee=_0x2fc3ee-0x0;var _0x2ad3f4=_0xa4fa[_0x2fc3ee];return _0x2ad3f4;};'use strict';var multer=require(_0xaa4f('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xaa4f('0x1'));var express=require(_0xaa4f('0x2'));var router=express['Router']();var fs_extra=require(_0xaa4f('0x3'));var auth=require(_0xaa4f('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xaa4f('0x5'));var controller=require('./intVtigerAccount.controller');router[_0xaa4f('0x6')]('/',auth[_0xaa4f('0x7')](),controller[_0xaa4f('0x8')]);router[_0xaa4f('0x6')]('/:id',auth['isAuthenticated'](),controller[_0xaa4f('0x9')]);router[_0xaa4f('0x6')](_0xaa4f('0xa'),auth[_0xaa4f('0x7')](),controller[_0xaa4f('0xb')]);router[_0xaa4f('0x6')]('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router[_0xaa4f('0xc')]('/',auth['isAuthenticated'](),controller[_0xaa4f('0xd')]);router[_0xaa4f('0xc')](_0xaa4f('0xa'),auth[_0xaa4f('0x7')](),controller[_0xaa4f('0xe')]);router['put'](_0xaa4f('0xf'),auth['isAuthenticated'](),controller['update']);router[_0xaa4f('0x10')]('/:id',auth[_0xaa4f('0x7')](),controller['destroy']);module[_0xaa4f('0x11')]=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index 7e5f58a..d804dbe 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 _0xc61a=['STRING','HelpDesk','exports'];(function(_0x3e44fa,_0x75ed2a){var _0x2a0aba=function(_0x1db6a7){while(--_0x1db6a7){_0x3e44fa['push'](_0x3e44fa['shift']());}};_0x2a0aba(++_0x75ed2a);}(_0xc61a,0xdd));var _0xac61=function(_0x487cac,_0x492185){_0x487cac=_0x487cac-0x0;var _0x1256b0=_0xc61a[_0x487cac];return _0x1256b0;};'use strict';var Sequelize=require('sequelize');module[_0xac61('0x0')]={'name':{'type':Sequelize[_0xac61('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xac61('0x1')]},'username':{'type':Sequelize[_0xac61('0x1')],'allowNull':![]},'moduleName':{'type':Sequelize[_0xac61('0x1')],'allowNull':![],'defaultValue':_0xac61('0x2')},'remoteUri':{'type':Sequelize[_0xac61('0x1')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0xac61('0x1')],'allowNull':![]},'accessKey':{'type':Sequelize[_0xac61('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0xa4ae=['exports','STRING','HelpDesk','sequelize'];(function(_0x384470,_0x574338){var _0x383c51=function(_0x54edbb){while(--_0x54edbb){_0x384470['push'](_0x384470['shift']());}};_0x383c51(++_0x574338);}(_0xa4ae,0x1ab));var _0xea4a=function(_0x5e8c32,_0x1b1f3f){_0x5e8c32=_0x5e8c32-0x0;var _0x595f7b=_0xa4ae[_0x5e8c32];return _0x595f7b;};'use strict';var Sequelize=require(_0xea4a('0x0'));module[_0xea4a('0x1')]={'name':{'type':Sequelize[_0xea4a('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'allowNull':![]},'moduleName':{'type':Sequelize[_0xea4a('0x2')],'allowNull':![],'defaultValue':_0xea4a('0x3')},'remoteUri':{'type':Sequelize[_0xea4a('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0xea4a('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize[_0xea4a('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.controller.js b/server/api/intVtigerAccount/intVtigerAccount.controller.js index cd98488..74c0b89 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 _0x812b=['%s/webservice.php','getchallenge','success','POST','token','describe','result','sessionName','autogenerated','includes','remove','editable','label','startsWith','cf_','picklist','picklistValues','value','vTiger\x20error:\x20','test','getFields,\x20%s,\x20%s,\x20%s','stringify','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','ejs','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','VtigerAccount','fieldName','type','model','map','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','rawAttributes','length','include','merge','create','body','params','find','getConfigurations','findOne','VtigerConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','VtigerField','getFields','username','description','moduleName','accessKey','slice','substring','format'];(function(_0x211e44,_0x5bd301){var _0x26bee7=function(_0x29fcbc){while(--_0x29fcbc){_0x211e44['push'](_0x211e44['shift']());}};_0x26bee7(++_0x5bd301);}(_0x812b,0x1ea));var _0xb812=function(_0x1135b1,_0x644ab2){_0x1135b1=_0x1135b1-0x0;var _0x387f6b=_0x812b[_0x1135b1];return _0x387f6b;};'use strict';var emlformat=require(_0xb812('0x0'));var rimraf=require(_0xb812('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb812('0x2'));var rp=require(_0xb812('0x3'));var moment=require(_0xb812('0x4'));var BPromise=require(_0xb812('0x5'));var Mustache=require(_0xb812('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xb812('0x7'));var ejs=require(_0xb812('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb812('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xb812('0xa'));var toCsv=require(_0xb812('0x7'));var querystring=require(_0xb812('0xb'));var Papa=require(_0xb812('0xc'));var Redis=require('ioredis');var authService=require(_0xb812('0xd'));var qs=require(_0xb812('0xe'));var as=require(_0xb812('0xf'));var hardwareService=require(_0xb812('0x10'));var logger=require(_0xb812('0x11'))(_0xb812('0x12'));var utils=require(_0xb812('0x13'));var config=require(_0xb812('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xb812('0x15'))['db'];var integrations=require(_0xb812('0x16'));function respondWithStatusCode(_0x908a2d,_0xfed6dc){_0xfed6dc=_0xfed6dc||0xcc;return function(_0x559713){if(_0x559713){return _0x908a2d['sendStatus'](_0xfed6dc);}return _0x908a2d[_0xb812('0x17')](_0xfed6dc)[_0xb812('0x18')]();};}function respondWithResult(_0x333d01,_0x352b0e){_0x352b0e=_0x352b0e||0xc8;return function(_0x5a637e){if(_0x5a637e){return _0x333d01[_0xb812('0x17')](_0x352b0e)[_0xb812('0x19')](_0x5a637e);}};}function respondWithFilteredResult(_0x51ddf5,_0x2b25d4){return function(_0x285122){if(_0x285122){var _0x27bbe5=typeof _0x2b25d4[_0xb812('0x1a')]===_0xb812('0x1b')&&typeof _0x2b25d4[_0xb812('0x1c')]===_0xb812('0x1b');var _0x52725b=_0x285122[_0xb812('0x1d')];var _0x12da53=_0x27bbe5?0x0:_0x2b25d4[_0xb812('0x1a')];var _0x239ecd=_0x27bbe5?_0x285122[_0xb812('0x1d')]:_0x2b25d4[_0xb812('0x1a')]+_0x2b25d4[_0xb812('0x1c')];var _0x2c3783;if(_0x239ecd>=_0x52725b){_0x239ecd=_0x52725b;_0x2c3783=0xc8;}else{_0x2c3783=0xce;}_0x51ddf5[_0xb812('0x17')](_0x2c3783);return _0x51ddf5[_0xb812('0x1e')]('Content-Range',_0x12da53+'-'+_0x239ecd+'/'+_0x52725b)['json'](_0x285122);}return null;};}function patchUpdates(_0x18502e){return function(_0x322c93){try{jsonpatch[_0xb812('0x1f')](_0x322c93,_0x18502e,!![]);}catch(_0x4ecc59){return BPromise[_0xb812('0x20')](_0x4ecc59);}return _0x322c93[_0xb812('0x21')]();};}function saveUpdates(_0x24c1f2,_0x183e74){return function(_0x1cda74){if(_0x1cda74){return _0x1cda74[_0xb812('0x22')](_0x24c1f2)[_0xb812('0x23')](function(_0x2c7ac7){return _0x2c7ac7;});}return null;};}function removeEntity(_0x35bd14,_0x3bd3b6){return function(_0x3d98f7){if(_0x3d98f7){return _0x3d98f7[_0xb812('0x24')]()[_0xb812('0x23')](function(){_0x35bd14['status'](0xcc)[_0xb812('0x18')]();});}};}function handleEntityNotFound(_0x211a9f,_0x41c594){return function(_0x17ca22){if(!_0x17ca22){_0x211a9f[_0xb812('0x25')](0x194);}return _0x17ca22;};}function handleError(_0x4f95d7,_0x4f7646){_0x4f7646=_0x4f7646||0x1f4;return function(_0x109ab0){logger[_0xb812('0x26')](_0x109ab0[_0xb812('0x27')]);if(_0x109ab0[_0xb812('0x28')]){delete _0x109ab0[_0xb812('0x28')];}_0x4f95d7[_0xb812('0x17')](_0x4f7646)[_0xb812('0x29')](_0x109ab0);};}exports[_0xb812('0x2a')]=function(_0x31f085,_0x2a3cc9){var _0xb6eee2={},_0x299ba0={},_0x2738f9={'count':0x0,'rows':[]};var _0x1fbaf5=_['map'](db[_0xb812('0x2b')]['rawAttributes'],function(_0x5c99c7){return{'name':_0x5c99c7[_0xb812('0x2c')],'type':_0x5c99c7[_0xb812('0x2d')]['key']};});_0x299ba0[_0xb812('0x2e')]=_[_0xb812('0x2f')](_0x1fbaf5,_0xb812('0x28'));_0x299ba0[_0xb812('0x30')]=_[_0xb812('0x31')](_0x31f085[_0xb812('0x30')]);_0x299ba0[_0xb812('0x32')]=_[_0xb812('0x33')](_0x299ba0[_0xb812('0x2e')],_0x299ba0[_0xb812('0x30')]);_0xb6eee2['attributes']=_['intersection'](_0x299ba0['model'],qs[_0xb812('0x34')](_0x31f085['query'][_0xb812('0x34')]));_0xb6eee2[_0xb812('0x35')]=_0xb6eee2[_0xb812('0x35')]['length']?_0xb6eee2[_0xb812('0x35')]:_0x299ba0['model'];if(!_0x31f085[_0xb812('0x30')][_0xb812('0x36')](_0xb812('0x37'))){_0xb6eee2[_0xb812('0x1c')]=qs[_0xb812('0x1c')](_0x31f085[_0xb812('0x30')][_0xb812('0x1c')]);_0xb6eee2['offset']=qs[_0xb812('0x1a')](_0x31f085['query'][_0xb812('0x1a')]);}_0xb6eee2[_0xb812('0x38')]=qs['sort'](_0x31f085[_0xb812('0x30')][_0xb812('0x39')]);_0xb6eee2[_0xb812('0x3a')]=qs[_0xb812('0x32')](_[_0xb812('0x3b')](_0x31f085[_0xb812('0x30')],_0x299ba0[_0xb812('0x32')]),_0x1fbaf5);if(_0x31f085[_0xb812('0x30')]['filter']){_0xb6eee2[_0xb812('0x3a')]=_['merge'](_0xb6eee2[_0xb812('0x3a')],{'$or':_[_0xb812('0x2f')](_0x1fbaf5,function(_0x22ab7a){if(_0x22ab7a[_0xb812('0x2d')]!==_0xb812('0x3c')){var _0x3d60c2={};_0x3d60c2[_0x22ab7a[_0xb812('0x28')]]={'$like':'%'+_0x31f085[_0xb812('0x30')][_0xb812('0x3d')]+'%'};return _0x3d60c2;}})});}_0xb6eee2=_['merge']({},_0xb6eee2,_0x31f085[_0xb812('0x3e')]);var _0x899900={'where':_0xb6eee2[_0xb812('0x3a')]};return db['VtigerAccount'][_0xb812('0x1d')](_0x899900)['then'](function(_0x104d64){_0x2738f9[_0xb812('0x1d')]=_0x104d64;if(_0x31f085[_0xb812('0x30')][_0xb812('0x3f')]){_0xb6eee2['include']=[{'all':!![]}];}return db['VtigerAccount'][_0xb812('0x40')](_0xb6eee2);})[_0xb812('0x23')](function(_0x2e696e){_0x2738f9[_0xb812('0x41')]=_0x2e696e;return _0x2738f9;})['then'](respondWithFilteredResult(_0x2a3cc9,_0xb6eee2))[_0xb812('0x42')](handleError(_0x2a3cc9,null));};exports[_0xb812('0x43')]=function(_0x14190a,_0x5595eb){var _0x1c32f8={'raw':![],'where':{'id':_0x14190a['params']['id']}},_0x35c053={};_0x35c053[_0xb812('0x2e')]=_['keys'](db[_0xb812('0x2b')][_0xb812('0x44')]);_0x35c053[_0xb812('0x30')]=_[_0xb812('0x31')](_0x14190a[_0xb812('0x30')]);_0x35c053[_0xb812('0x32')]=_[_0xb812('0x33')](_0x35c053[_0xb812('0x2e')],_0x35c053[_0xb812('0x30')]);_0x1c32f8['attributes']=_[_0xb812('0x33')](_0x35c053[_0xb812('0x2e')],qs['fields'](_0x14190a[_0xb812('0x30')][_0xb812('0x34')]));_0x1c32f8[_0xb812('0x35')]=_0x1c32f8[_0xb812('0x35')][_0xb812('0x45')]?_0x1c32f8[_0xb812('0x35')]:_0x35c053[_0xb812('0x2e')];if(_0x14190a[_0xb812('0x30')][_0xb812('0x3f')]){_0x1c32f8[_0xb812('0x46')]=[{'all':!![]}];}_0x1c32f8=_[_0xb812('0x47')]({},_0x1c32f8,_0x14190a[_0xb812('0x3e')]);return db[_0xb812('0x2b')]['find'](_0x1c32f8)[_0xb812('0x23')](handleEntityNotFound(_0x5595eb,null))[_0xb812('0x23')](respondWithResult(_0x5595eb,null))[_0xb812('0x42')](handleError(_0x5595eb,null));};exports[_0xb812('0x48')]=function(_0xaf5add,_0xfc09ce){return db[_0xb812('0x2b')][_0xb812('0x48')](_0xaf5add['body'],{})[_0xb812('0x23')](respondWithResult(_0xfc09ce,0xc9))[_0xb812('0x42')](handleError(_0xfc09ce,null));};exports[_0xb812('0x22')]=function(_0x54b092,_0x5ea323){if(_0x54b092[_0xb812('0x49')]['id']){delete _0x54b092[_0xb812('0x49')]['id'];}return db['VtigerAccount']['find']({'where':{'id':_0x54b092[_0xb812('0x4a')]['id']}})[_0xb812('0x23')](handleEntityNotFound(_0x5ea323,null))['then'](saveUpdates(_0x54b092['body'],null))[_0xb812('0x23')](respondWithResult(_0x5ea323,null))['catch'](handleError(_0x5ea323,null));};exports['destroy']=function(_0x37922e,_0x5884fd){return db['VtigerAccount'][_0xb812('0x4b')]({'where':{'id':_0x37922e[_0xb812('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5884fd,null))[_0xb812('0x23')](removeEntity(_0x5884fd,null))[_0xb812('0x42')](handleError(_0x5884fd,null));};exports[_0xb812('0x4c')]=function(_0x1b940f,_0x323618,_0x3f3175){var _0x5b6f0c={};var _0x2eeda9={};var _0x1985d0;var _0x3b312c;return db[_0xb812('0x2b')][_0xb812('0x4d')]({'where':{'id':_0x1b940f[_0xb812('0x4a')]['id']}})['then'](handleEntityNotFound(_0x323618,null))[_0xb812('0x23')](function(_0x241d59){if(_0x241d59){_0x1985d0=_0x241d59;_0x2eeda9[_0xb812('0x2e')]=_['keys'](db[_0xb812('0x4e')][_0xb812('0x44')]);_0x2eeda9[_0xb812('0x30')]=_[_0xb812('0x31')](_0x1b940f[_0xb812('0x30')]);_0x2eeda9[_0xb812('0x32')]=_[_0xb812('0x33')](_0x2eeda9['model'],_0x2eeda9[_0xb812('0x30')]);_0x5b6f0c['attributes']=_[_0xb812('0x33')](_0x2eeda9['model'],qs['fields'](_0x1b940f['query'][_0xb812('0x34')]));_0x5b6f0c[_0xb812('0x35')]=_0x5b6f0c[_0xb812('0x35')]['length']?_0x5b6f0c[_0xb812('0x35')]:_0x2eeda9[_0xb812('0x2e')];_0x5b6f0c[_0xb812('0x38')]=qs[_0xb812('0x39')](_0x1b940f[_0xb812('0x30')][_0xb812('0x39')]);_0x5b6f0c[_0xb812('0x3a')]=qs['filters'](_[_0xb812('0x3b')](_0x1b940f['query'],_0x2eeda9[_0xb812('0x32')]));if(_0x1b940f['query'][_0xb812('0x3d')]){_0x5b6f0c[_0xb812('0x3a')]=_[_0xb812('0x47')](_0x5b6f0c[_0xb812('0x3a')],{'$or':_[_0xb812('0x2f')](_0x5b6f0c[_0xb812('0x35')],function(_0x411e96){var _0x2e5b28={};_0x2e5b28[_0x411e96]={'$like':'%'+_0x1b940f['query'][_0xb812('0x3d')]+'%'};return _0x2e5b28;})});}_0x5b6f0c=_[_0xb812('0x47')]({},_0x5b6f0c,_0x1b940f['options']);return _0x1985d0[_0xb812('0x4c')](_0x5b6f0c);}})[_0xb812('0x23')](function(_0x1cc800){if(_0x1cc800){_0x3b312c=_0x1cc800[_0xb812('0x45')];if(!_0x1b940f[_0xb812('0x30')][_0xb812('0x36')](_0xb812('0x37'))){_0x5b6f0c[_0xb812('0x1c')]=qs[_0xb812('0x1c')](_0x1b940f[_0xb812('0x30')][_0xb812('0x1c')]);_0x5b6f0c['offset']=qs[_0xb812('0x1a')](_0x1b940f[_0xb812('0x30')][_0xb812('0x1a')]);}return _0x1985d0[_0xb812('0x4c')](_0x5b6f0c);}})[_0xb812('0x23')](function(_0x8b2e5b){if(_0x8b2e5b){return _0x8b2e5b?{'count':_0x3b312c,'rows':_0x8b2e5b}:null;}})[_0xb812('0x23')](respondWithResult(_0x323618,null))['catch'](handleError(_0x323618,null));};exports[_0xb812('0x4f')]=function(_0xf95f8b,_0x1a5e25,_0x38201e){if(_0xf95f8b[_0xb812('0x49')]['id']){delete _0xf95f8b['body']['id'];}return db['VtigerAccount']['findOne']({'where':{'id':_0xf95f8b[_0xb812('0x4a')]['id']}})[_0xb812('0x23')](handleEntityNotFound(_0x1a5e25,null))[_0xb812('0x23')](function(_0xd48af2){if(_0xd48af2){_0xf95f8b[_0xb812('0x49')][_0xb812('0x50')]=_0xd48af2['id'];_0xf95f8b[_0xb812('0x49')][_0xb812('0x51')]=integrations[_0xb812('0x52')](_0xf95f8b[_0xb812('0x49')][_0xb812('0x53')],_0xf95f8b[_0xb812('0x49')][_0xb812('0x2d')]);_0xf95f8b['body'][_0xb812('0x54')]=integrations[_0xb812('0x55')](_0xf95f8b[_0xb812('0x49')][_0xb812('0x53')],_0xf95f8b[_0xb812('0x49')][_0xb812('0x2d')]);return db['VtigerConfiguration'][_0xb812('0x48')](_0xf95f8b[_0xb812('0x49')],{'include':[{'model':db[_0xb812('0x56')],'as':'Subjects'},{'model':db[_0xb812('0x56')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x1a5e25,null))[_0xb812('0x42')](handleError(_0x1a5e25,null));};var md5=require('md5');exports[_0xb812('0x57')]=function(_0x3ca5fb,_0x2480bd,_0x160af3){var _0x1ada10=null;var _0x27b2b0=null;var _0x23ed45=null;var _0x565454=null;var _0x1a4f7e='';return db[_0xb812('0x2b')][_0xb812('0x4d')]({'where':{'id':_0x3ca5fb[_0xb812('0x4a')]['id']},'attributes':['id',_0xb812('0x28'),_0xb812('0x58'),_0xb812('0x59'),_0xb812('0x5a'),'remoteUri','serverUrl','accessKey']})[_0xb812('0x23')](handleEntityNotFound(_0x2480bd,null))[_0xb812('0x23')](function(_0x3df00d){if(_0x3df00d){_0x1ada10=_0x3df00d[_0xb812('0x58')];_0x27b2b0=_0x3df00d[_0xb812('0x5b')];_0x23ed45=_0x3df00d[_0xb812('0x5a')];_0x1a4f7e=_0x3df00d['remoteUri'];var _0x222445=_0x1a4f7e[_0xb812('0x5c')](-0x1);if(_0x222445==='/'){_0x1a4f7e=_0x1a4f7e[_0xb812('0x5d')](0x0,_0x1a4f7e['lastIndexOf'](_0x222445));}_0x565454=util[_0xb812('0x5e')](_0xb812('0x5f'),_0x1a4f7e);var _0x1332ac={'method':'GET','uri':_0x565454,'qs':{'operation':_0xb812('0x60'),'username':_0x3df00d[_0xb812('0x58')]},'json':!![]};return rp(_0x1332ac);}})[_0xb812('0x23')](function(_0x16fd29){if(_0x16fd29[_0xb812('0x61')]){var _0xd0990a={'method':_0xb812('0x62'),'uri':_0x565454,'form':{'operation':'login','username':_0x1ada10,'accessKey':md5(_0x16fd29['result'][_0xb812('0x63')]+_0x27b2b0)},'json':!![]};return rp(_0xd0990a);}})[_0xb812('0x23')](function(_0x443474){if(_0x443474['success']){var _0x4b2612={'method':'GET','uri':_0x565454,'qs':{'operation':_0xb812('0x64'),'username':_0x1ada10,'sessionName':_0x443474[_0xb812('0x65')][_0xb812('0x66')],'elementType':_0x23ed45},'json':!![]};return rp(_0x4b2612);}})[_0xb812('0x23')](function(_0x37a5a7){if(_0x37a5a7['success']){var _0x18222b=[_0xb812('0x67'),'reference','owner'];_['remove'](_0x37a5a7[_0xb812('0x65')][_0xb812('0x34')],function(_0x4f1e8e){return _0x18222b[_0xb812('0x68')](_0x4f1e8e[_0xb812('0x2d')][_0xb812('0x28')]);});_[_0xb812('0x69')](_0x37a5a7[_0xb812('0x65')][_0xb812('0x34')],function(_0xf713a6){return _0xf713a6[_0xb812('0x6a')]==='false';});return{'count':_0x37a5a7[_0xb812('0x65')]['fields'][_0xb812('0x45')],'rows':_[_0xb812('0x2f')](_0x37a5a7[_0xb812('0x65')][_0xb812('0x34')],function(_0x5d2992){return{'id':_0x5d2992[_0xb812('0x28')],'name':_0x5d2992[_0xb812('0x6b')],'custom':_[_0xb812('0x6c')](_0x5d2992[_0xb812('0x28')],_0xb812('0x6d'))?!![]:![],'options':_0x5d2992[_0xb812('0x2d')][_0xb812('0x28')]===_0xb812('0x6e')&&_0x5d2992['type'][_0xb812('0x6f')][_0xb812('0x45')]>0x0?_[_0xb812('0x2f')](_0x5d2992[_0xb812('0x2d')]['picklistValues'],function(_0xf2cb61){return{'name':_0xf2cb61[_0xb812('0x6b')],'value':_0xf2cb61[_0xb812('0x70')]};}):[]};})};}})[_0xb812('0x23')](respondWithResult(_0x2480bd,null))[_0xb812('0x42')](function(_0x6f19){console['log'](_0xb812('0x71')+_0x6f19);var _0x1cd60b=_0x3ca5fb[_0xb812('0x30')][_0xb812('0x72')]?0x1f4:_0x6f19['statusCode']||0x1f4;logger[_0xb812('0x26')](_0xb812('0x73'),_0xb812('0x57'),_0x1cd60b,JSON[_0xb812('0x74')](_0x6f19));delete _0x6f19[_0xb812('0x28')];if(_0x1cd60b===0x191){_0x1cd60b=0x190;}_0x2480bd[_0xb812('0x17')](_0x1cd60b)[_0xb812('0x29')](_0x3ca5fb['query'][_0xb812('0x72')]?{'message':'Wrong\x20credentials','statusCode':_0x6f19['statusCode']}:_0x6f19);});}; \ No newline at end of file +var _0x4a1a=['squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','../../components/integrations/configuration','end','status','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','sendStatus','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','options','VtigerAccount','includeAll','findAll','catch','show','params','length','include','merge','create','body','find','destroy','getConfigurations','findOne','hasOwnProperty','addConfiguration','Subjects','getSubjects','channel','getDescriptions','VtigerConfiguration','VtigerField','Descriptions','md5','description','moduleName','remoteUri','serverUrl','accessKey','username','slice','substring','lastIndexOf','format','%s/webservice.php','GET','getchallenge','success','POST','login','result','describe','reference','owner','remove','includes','editable','false','label','startsWith','cf_','picklist','picklistValues','value','log','vTiger\x20error:\x20','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','util','path','sox','to-csv','fs-extra','lodash'];(function(_0xfa634c,_0x414e0e){var _0x73e478=function(_0xac2a51){while(--_0xac2a51){_0xfa634c['push'](_0xfa634c['shift']());}};_0x73e478(++_0x414e0e);}(_0x4a1a,0xe6));var _0xa4a1=function(_0x309e1e,_0x170d66){_0x309e1e=_0x309e1e-0x0;var _0x254a4a=_0x4a1a[_0x309e1e];return _0x254a4a;};'use strict';var emlformat=require(_0xa4a1('0x0'));var rimraf=require(_0xa4a1('0x1'));var zipdir=require(_0xa4a1('0x2'));var jsonpatch=require(_0xa4a1('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xa4a1('0x4'));var path=require(_0xa4a1('0x5'));var sox=require(_0xa4a1('0x6'));var csv=require(_0xa4a1('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa4a1('0x8'));var _=require(_0xa4a1('0x9'));var squel=require(_0xa4a1('0xa'));var crypto=require(_0xa4a1('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xa4a1('0x7'));var querystring=require(_0xa4a1('0xc'));var Papa=require(_0xa4a1('0xd'));var Redis=require(_0xa4a1('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xa4a1('0xf'));var as=require(_0xa4a1('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa4a1('0x11'))(_0xa4a1('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xa4a1('0x13'))['db'];var integrations=require(_0xa4a1('0x14'));function respondWithStatusCode(_0x2139b7,_0x4de78d){_0x4de78d=_0x4de78d||0xcc;return function(_0x5c5917){if(_0x5c5917){return _0x2139b7['sendStatus'](_0x4de78d);}return _0x2139b7['status'](_0x4de78d)[_0xa4a1('0x15')]();};}function respondWithResult(_0x1cb6bf,_0x213074){_0x213074=_0x213074||0xc8;return function(_0x4b8ee0){if(_0x4b8ee0){return _0x1cb6bf[_0xa4a1('0x16')](_0x213074)[_0xa4a1('0x17')](_0x4b8ee0);}};}function respondWithFilteredResult(_0x4f3a7c,_0x188045){return function(_0x2d2085){if(_0x2d2085){var _0x503281=typeof _0x188045[_0xa4a1('0x18')]==='undefined'&&typeof _0x188045[_0xa4a1('0x19')]===_0xa4a1('0x1a');var _0x35dc6a=_0x2d2085[_0xa4a1('0x1b')];var _0x42ccd3=_0x503281?0x0:_0x188045[_0xa4a1('0x18')];var _0x67848d=_0x503281?_0x2d2085[_0xa4a1('0x1b')]:_0x188045[_0xa4a1('0x18')]+_0x188045[_0xa4a1('0x19')];var _0xaa977c;if(_0x67848d>=_0x35dc6a){_0x67848d=_0x35dc6a;_0xaa977c=0xc8;}else{_0xaa977c=0xce;}_0x4f3a7c[_0xa4a1('0x16')](_0xaa977c);return _0x4f3a7c['set'](_0xa4a1('0x1c'),_0x42ccd3+'-'+_0x67848d+'/'+_0x35dc6a)['json'](_0x2d2085);}return null;};}function patchUpdates(_0x16a270){return function(_0x195ec4){try{jsonpatch[_0xa4a1('0x1d')](_0x195ec4,_0x16a270,!![]);}catch(_0x3fa32a){return BPromise[_0xa4a1('0x1e')](_0x3fa32a);}return _0x195ec4[_0xa4a1('0x1f')]();};}function saveUpdates(_0x47c295,_0x1a0c97){return function(_0x503f23){if(_0x503f23){return _0x503f23[_0xa4a1('0x20')](_0x47c295)[_0xa4a1('0x21')](function(_0x44d361){return _0x44d361;});}return null;};}function removeEntity(_0x5cabdd,_0x5ae7f1){return function(_0x29cccf){if(_0x29cccf){return _0x29cccf['destroy']()[_0xa4a1('0x21')](function(){_0x5cabdd[_0xa4a1('0x16')](0xcc)[_0xa4a1('0x15')]();});}};}function handleEntityNotFound(_0x1f80d0,_0x549bd3){return function(_0x3e79bb){if(!_0x3e79bb){_0x1f80d0[_0xa4a1('0x22')](0x194);}return _0x3e79bb;};}function handleError(_0x417c98,_0x333d2d){_0x333d2d=_0x333d2d||0x1f4;return function(_0x18a7a6){logger['error'](_0x18a7a6['stack']);if(_0x18a7a6['name']){delete _0x18a7a6[_0xa4a1('0x23')];}_0x417c98[_0xa4a1('0x16')](_0x333d2d)[_0xa4a1('0x24')](_0x18a7a6);};}exports[_0xa4a1('0x25')]=function(_0x4717f6,_0x2769bc){var _0x519e44={},_0x139fd0={},_0x4afc20={'count':0x0,'rows':[]};var _0x2494cd=_[_0xa4a1('0x26')](db['VtigerAccount'][_0xa4a1('0x27')],function(_0x192e34){return{'name':_0x192e34[_0xa4a1('0x28')],'type':_0x192e34[_0xa4a1('0x29')][_0xa4a1('0x2a')]};});_0x139fd0[_0xa4a1('0x2b')]=_[_0xa4a1('0x26')](_0x2494cd,_0xa4a1('0x23'));_0x139fd0[_0xa4a1('0x2c')]=_[_0xa4a1('0x2d')](_0x4717f6['query']);_0x139fd0[_0xa4a1('0x2e')]=_[_0xa4a1('0x2f')](_0x139fd0[_0xa4a1('0x2b')],_0x139fd0[_0xa4a1('0x2c')]);_0x519e44[_0xa4a1('0x30')]=_[_0xa4a1('0x2f')](_0x139fd0[_0xa4a1('0x2b')],qs[_0xa4a1('0x31')](_0x4717f6['query'][_0xa4a1('0x31')]));_0x519e44[_0xa4a1('0x30')]=_0x519e44[_0xa4a1('0x30')]['length']?_0x519e44[_0xa4a1('0x30')]:_0x139fd0['model'];if(!_0x4717f6[_0xa4a1('0x2c')]['hasOwnProperty'](_0xa4a1('0x32'))){_0x519e44[_0xa4a1('0x19')]=qs[_0xa4a1('0x19')](_0x4717f6[_0xa4a1('0x2c')]['limit']);_0x519e44[_0xa4a1('0x18')]=qs[_0xa4a1('0x18')](_0x4717f6['query'][_0xa4a1('0x18')]);}_0x519e44[_0xa4a1('0x33')]=qs[_0xa4a1('0x34')](_0x4717f6[_0xa4a1('0x2c')]['sort']);_0x519e44[_0xa4a1('0x35')]=qs[_0xa4a1('0x2e')](_[_0xa4a1('0x36')](_0x4717f6[_0xa4a1('0x2c')],_0x139fd0['filters']),_0x2494cd);if(_0x4717f6[_0xa4a1('0x2c')][_0xa4a1('0x37')]){_0x519e44[_0xa4a1('0x35')]=_['merge'](_0x519e44[_0xa4a1('0x35')],{'$or':_[_0xa4a1('0x26')](_0x2494cd,function(_0x196283){if(_0x196283[_0xa4a1('0x29')]!=='VIRTUAL'){var _0x3c6eb9={};_0x3c6eb9[_0x196283[_0xa4a1('0x23')]]={'$like':'%'+_0x4717f6[_0xa4a1('0x2c')][_0xa4a1('0x37')]+'%'};return _0x3c6eb9;}})});}_0x519e44=_['merge']({},_0x519e44,_0x4717f6[_0xa4a1('0x38')]);var _0x1904ed={'where':_0x519e44[_0xa4a1('0x35')]};return db[_0xa4a1('0x39')][_0xa4a1('0x1b')](_0x1904ed)[_0xa4a1('0x21')](function(_0x38710f){_0x4afc20['count']=_0x38710f;if(_0x4717f6['query'][_0xa4a1('0x3a')]){_0x519e44['include']=[{'all':!![]}];}return db[_0xa4a1('0x39')][_0xa4a1('0x3b')](_0x519e44);})[_0xa4a1('0x21')](function(_0x3db4ec){_0x4afc20['rows']=_0x3db4ec;return _0x4afc20;})[_0xa4a1('0x21')](respondWithFilteredResult(_0x2769bc,_0x519e44))[_0xa4a1('0x3c')](handleError(_0x2769bc,null));};exports[_0xa4a1('0x3d')]=function(_0x51d012,_0x139d6b){var _0x5ac9c5={'raw':![],'where':{'id':_0x51d012[_0xa4a1('0x3e')]['id']}},_0x196872={};_0x196872[_0xa4a1('0x2b')]=_[_0xa4a1('0x2d')](db[_0xa4a1('0x39')]['rawAttributes']);_0x196872[_0xa4a1('0x2c')]=_[_0xa4a1('0x2d')](_0x51d012[_0xa4a1('0x2c')]);_0x196872[_0xa4a1('0x2e')]=_['intersection'](_0x196872[_0xa4a1('0x2b')],_0x196872[_0xa4a1('0x2c')]);_0x5ac9c5[_0xa4a1('0x30')]=_[_0xa4a1('0x2f')](_0x196872[_0xa4a1('0x2b')],qs[_0xa4a1('0x31')](_0x51d012[_0xa4a1('0x2c')][_0xa4a1('0x31')]));_0x5ac9c5[_0xa4a1('0x30')]=_0x5ac9c5['attributes'][_0xa4a1('0x3f')]?_0x5ac9c5['attributes']:_0x196872[_0xa4a1('0x2b')];if(_0x51d012['query']['includeAll']){_0x5ac9c5[_0xa4a1('0x40')]=[{'all':!![]}];}_0x5ac9c5=_[_0xa4a1('0x41')]({},_0x5ac9c5,_0x51d012[_0xa4a1('0x38')]);return db[_0xa4a1('0x39')]['find'](_0x5ac9c5)['then'](handleEntityNotFound(_0x139d6b,null))[_0xa4a1('0x21')](respondWithResult(_0x139d6b,null))[_0xa4a1('0x3c')](handleError(_0x139d6b,null));};exports[_0xa4a1('0x42')]=function(_0x3baaae,_0x5ab9bf){return db[_0xa4a1('0x39')][_0xa4a1('0x42')](_0x3baaae[_0xa4a1('0x43')],{})[_0xa4a1('0x21')](respondWithResult(_0x5ab9bf,0xc9))[_0xa4a1('0x3c')](handleError(_0x5ab9bf,null));};exports[_0xa4a1('0x20')]=function(_0x14c5cf,_0x301afc){if(_0x14c5cf['body']['id']){delete _0x14c5cf[_0xa4a1('0x43')]['id'];}return db[_0xa4a1('0x39')][_0xa4a1('0x44')]({'where':{'id':_0x14c5cf['params']['id']}})[_0xa4a1('0x21')](handleEntityNotFound(_0x301afc,null))[_0xa4a1('0x21')](saveUpdates(_0x14c5cf['body'],null))['then'](respondWithResult(_0x301afc,null))['catch'](handleError(_0x301afc,null));};exports[_0xa4a1('0x45')]=function(_0x27d0f7,_0x160555){return db[_0xa4a1('0x39')][_0xa4a1('0x44')]({'where':{'id':_0x27d0f7[_0xa4a1('0x3e')]['id']}})[_0xa4a1('0x21')](handleEntityNotFound(_0x160555,null))[_0xa4a1('0x21')](removeEntity(_0x160555,null))[_0xa4a1('0x3c')](handleError(_0x160555,null));};exports[_0xa4a1('0x46')]=function(_0x497d69,_0x1d6de3,_0x5d0301){var _0x416250={};var _0x4ea0a7={};var _0x31832a;var _0x1adb69;return db['VtigerAccount'][_0xa4a1('0x47')]({'where':{'id':_0x497d69[_0xa4a1('0x3e')]['id']}})[_0xa4a1('0x21')](handleEntityNotFound(_0x1d6de3,null))[_0xa4a1('0x21')](function(_0x5b009f){if(_0x5b009f){_0x31832a=_0x5b009f;_0x4ea0a7['model']=_[_0xa4a1('0x2d')](db['VtigerConfiguration'][_0xa4a1('0x27')]);_0x4ea0a7[_0xa4a1('0x2c')]=_[_0xa4a1('0x2d')](_0x497d69[_0xa4a1('0x2c')]);_0x4ea0a7[_0xa4a1('0x2e')]=_[_0xa4a1('0x2f')](_0x4ea0a7['model'],_0x4ea0a7[_0xa4a1('0x2c')]);_0x416250[_0xa4a1('0x30')]=_['intersection'](_0x4ea0a7['model'],qs[_0xa4a1('0x31')](_0x497d69[_0xa4a1('0x2c')][_0xa4a1('0x31')]));_0x416250[_0xa4a1('0x30')]=_0x416250[_0xa4a1('0x30')][_0xa4a1('0x3f')]?_0x416250[_0xa4a1('0x30')]:_0x4ea0a7[_0xa4a1('0x2b')];_0x416250[_0xa4a1('0x33')]=qs['sort'](_0x497d69[_0xa4a1('0x2c')]['sort']);_0x416250[_0xa4a1('0x35')]=qs[_0xa4a1('0x2e')](_[_0xa4a1('0x36')](_0x497d69[_0xa4a1('0x2c')],_0x4ea0a7[_0xa4a1('0x2e')]));if(_0x497d69[_0xa4a1('0x2c')][_0xa4a1('0x37')]){_0x416250[_0xa4a1('0x35')]=_[_0xa4a1('0x41')](_0x416250[_0xa4a1('0x35')],{'$or':_['map'](_0x416250['attributes'],function(_0x4e022b){var _0x5acae5={};_0x5acae5[_0x4e022b]={'$like':'%'+_0x497d69['query'][_0xa4a1('0x37')]+'%'};return _0x5acae5;})});}_0x416250=_[_0xa4a1('0x41')]({},_0x416250,_0x497d69[_0xa4a1('0x38')]);return _0x31832a[_0xa4a1('0x46')](_0x416250);}})[_0xa4a1('0x21')](function(_0x299d6d){if(_0x299d6d){_0x1adb69=_0x299d6d[_0xa4a1('0x3f')];if(!_0x497d69[_0xa4a1('0x2c')][_0xa4a1('0x48')](_0xa4a1('0x32'))){_0x416250['limit']=qs[_0xa4a1('0x19')](_0x497d69[_0xa4a1('0x2c')][_0xa4a1('0x19')]);_0x416250[_0xa4a1('0x18')]=qs[_0xa4a1('0x18')](_0x497d69[_0xa4a1('0x2c')][_0xa4a1('0x18')]);}return _0x31832a[_0xa4a1('0x46')](_0x416250);}})[_0xa4a1('0x21')](function(_0x26a0b0){if(_0x26a0b0){return _0x26a0b0?{'count':_0x1adb69,'rows':_0x26a0b0}:null;}})[_0xa4a1('0x21')](respondWithResult(_0x1d6de3,null))['catch'](handleError(_0x1d6de3,null));};exports[_0xa4a1('0x49')]=function(_0x4e1e3c,_0x5cd766,_0xc024d){if(_0x4e1e3c[_0xa4a1('0x43')]['id']){delete _0x4e1e3c[_0xa4a1('0x43')]['id'];}return db[_0xa4a1('0x39')][_0xa4a1('0x47')]({'where':{'id':_0x4e1e3c['params']['id']}})[_0xa4a1('0x21')](handleEntityNotFound(_0x5cd766,null))[_0xa4a1('0x21')](function(_0x431b56){if(_0x431b56){_0x4e1e3c[_0xa4a1('0x43')]['AccountId']=_0x431b56['id'];_0x4e1e3c[_0xa4a1('0x43')][_0xa4a1('0x4a')]=integrations[_0xa4a1('0x4b')](_0x4e1e3c[_0xa4a1('0x43')][_0xa4a1('0x4c')],_0x4e1e3c['body'][_0xa4a1('0x29')]);_0x4e1e3c[_0xa4a1('0x43')]['Descriptions']=integrations[_0xa4a1('0x4d')](_0x4e1e3c[_0xa4a1('0x43')][_0xa4a1('0x4c')],_0x4e1e3c['body'][_0xa4a1('0x29')]);return db[_0xa4a1('0x4e')][_0xa4a1('0x42')](_0x4e1e3c[_0xa4a1('0x43')],{'include':[{'model':db[_0xa4a1('0x4f')],'as':_0xa4a1('0x4a')},{'model':db['VtigerField'],'as':_0xa4a1('0x50')}]});}return null;})[_0xa4a1('0x21')](respondWithResult(_0x5cd766,null))[_0xa4a1('0x3c')](handleError(_0x5cd766,null));};var md5=require(_0xa4a1('0x51'));exports['getFields']=function(_0x43fe6a,_0x5940b9,_0x46e2dc){var _0x6a5727=null;var _0x36306a=null;var _0x131e5f=null;var _0x4a756a=null;var _0x2c2cb1='';return db[_0xa4a1('0x39')]['findOne']({'where':{'id':_0x43fe6a[_0xa4a1('0x3e')]['id']},'attributes':['id',_0xa4a1('0x23'),'username',_0xa4a1('0x52'),_0xa4a1('0x53'),_0xa4a1('0x54'),_0xa4a1('0x55'),_0xa4a1('0x56')]})[_0xa4a1('0x21')](handleEntityNotFound(_0x5940b9,null))[_0xa4a1('0x21')](function(_0x34d5b4){if(_0x34d5b4){_0x6a5727=_0x34d5b4[_0xa4a1('0x57')];_0x36306a=_0x34d5b4['accessKey'];_0x131e5f=_0x34d5b4[_0xa4a1('0x53')];_0x2c2cb1=_0x34d5b4[_0xa4a1('0x54')];var _0x2b08db=_0x2c2cb1[_0xa4a1('0x58')](-0x1);if(_0x2b08db==='/'){_0x2c2cb1=_0x2c2cb1[_0xa4a1('0x59')](0x0,_0x2c2cb1[_0xa4a1('0x5a')](_0x2b08db));}_0x4a756a=util[_0xa4a1('0x5b')](_0xa4a1('0x5c'),_0x2c2cb1);var _0x5b357b={'method':_0xa4a1('0x5d'),'uri':_0x4a756a,'qs':{'operation':_0xa4a1('0x5e'),'username':_0x34d5b4['username']},'json':!![]};return rp(_0x5b357b);}})['then'](function(_0x38a213){if(_0x38a213[_0xa4a1('0x5f')]){var _0x27f945={'method':_0xa4a1('0x60'),'uri':_0x4a756a,'form':{'operation':_0xa4a1('0x61'),'username':_0x6a5727,'accessKey':md5(_0x38a213[_0xa4a1('0x62')]['token']+_0x36306a)},'json':!![]};return rp(_0x27f945);}})[_0xa4a1('0x21')](function(_0x67f629){if(_0x67f629['success']){var _0x56deec={'method':'GET','uri':_0x4a756a,'qs':{'operation':_0xa4a1('0x63'),'username':_0x6a5727,'sessionName':_0x67f629[_0xa4a1('0x62')]['sessionName'],'elementType':_0x131e5f},'json':!![]};return rp(_0x56deec);}})['then'](function(_0x31b4e3){if(_0x31b4e3[_0xa4a1('0x5f')]){var _0x54a634=['autogenerated',_0xa4a1('0x64'),_0xa4a1('0x65')];_[_0xa4a1('0x66')](_0x31b4e3[_0xa4a1('0x62')][_0xa4a1('0x31')],function(_0xdacf91){return _0x54a634[_0xa4a1('0x67')](_0xdacf91[_0xa4a1('0x29')][_0xa4a1('0x23')]);});_[_0xa4a1('0x66')](_0x31b4e3['result'][_0xa4a1('0x31')],function(_0x3672fe){return _0x3672fe[_0xa4a1('0x68')]===_0xa4a1('0x69');});return{'count':_0x31b4e3[_0xa4a1('0x62')][_0xa4a1('0x31')][_0xa4a1('0x3f')],'rows':_[_0xa4a1('0x26')](_0x31b4e3[_0xa4a1('0x62')][_0xa4a1('0x31')],function(_0x1dc6db){return{'id':_0x1dc6db[_0xa4a1('0x23')],'name':_0x1dc6db[_0xa4a1('0x6a')],'custom':_[_0xa4a1('0x6b')](_0x1dc6db[_0xa4a1('0x23')],_0xa4a1('0x6c'))?!![]:![],'options':_0x1dc6db['type']['name']===_0xa4a1('0x6d')&&_0x1dc6db[_0xa4a1('0x29')][_0xa4a1('0x6e')]['length']>0x0?_[_0xa4a1('0x26')](_0x1dc6db[_0xa4a1('0x29')][_0xa4a1('0x6e')],function(_0x5ef94f){return{'name':_0x5ef94f[_0xa4a1('0x6a')],'value':_0x5ef94f[_0xa4a1('0x6f')]};}):[]};})};}})[_0xa4a1('0x21')](respondWithResult(_0x5940b9,null))[_0xa4a1('0x3c')](function(_0x344106){console[_0xa4a1('0x70')](_0xa4a1('0x71')+_0x344106);var _0x1f4059=_0x43fe6a['query'][_0xa4a1('0x72')]?0x1f4:_0x344106[_0xa4a1('0x73')]||0x1f4;logger[_0xa4a1('0x74')](_0xa4a1('0x75'),'getFields',_0x1f4059,JSON[_0xa4a1('0x76')](_0x344106));delete _0x344106[_0xa4a1('0x23')];if(_0x1f4059===0x191){_0x1f4059=0x190;}_0x5940b9[_0xa4a1('0x16')](_0x1f4059)['send'](_0x43fe6a[_0xa4a1('0x2c')][_0xa4a1('0x72')]?{'message':_0xa4a1('0x77'),'statusCode':_0x344106[_0xa4a1('0x73')]}:_0x344106);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index 2131f82..40ada22 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 _0x0de7=['VtigerAccount','int_vtiger_accounts','lodash','api','request-promise','path','../../config/environment','define'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0de7,0x1a2));var _0x70de=function(_0x1222a4,_0x1e43a2){_0x1222a4=_0x1222a4-0x0;var _0x5dd787=_0x0de7[_0x1222a4];return _0x5dd787;};'use strict';var _=require(_0x70de('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x70de('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x70de('0x2'));var fs=require('fs');var path=require(_0x70de('0x3'));var rimraf=require('rimraf');var config=require(_0x70de('0x4'));var attributes=require('./intVtigerAccount.attributes');var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x46ef44,_0x1c2392){return _0x46ef44[_0x70de('0x5')](_0x70de('0x6'),attributes,{'tableName':_0x70de('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5f8e=['rimraf','../../config/environment','./intVtigerAccount.attributes','define','VtigerAccount','int_vtiger_accounts','util','../../config/logger','api','moment','bluebird','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5f8e,0x1aa));var _0xe5f8=function(_0x21cb7f,_0x48cd16){_0x21cb7f=_0x21cb7f-0x0;var _0x5a079a=_0x5f8e[_0x21cb7f];return _0x5a079a;};'use strict';var _=require('lodash');var util=require(_0xe5f8('0x0'));var logger=require(_0xe5f8('0x1'))(_0xe5f8('0x2'));var moment=require(_0xe5f8('0x3'));var BPromise=require(_0xe5f8('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe5f8('0x5'));var rimraf=require(_0xe5f8('0x6'));var config=require(_0xe5f8('0x7'));var attributes=require(_0xe5f8('0x8'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x2baa65,_0x47c08a){return _0x2baa65[_0xe5f8('0x9')](_0xe5f8('0xa'),attributes,{'tableName':_0xe5f8('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 2a9b5de..0f849d3 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 _0xda3f=['GetVtigerAccount','VtigerAccount','findAll','options','raw','attributes','limit','include','map','model','ShowVtigerAccount','find','util','moment','../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x1d3a3b,_0x49e405){var _0x59b26f=function(_0x386d32){while(--_0x386d32){_0x1d3a3b['push'](_0x1d3a3b['shift']());}};_0x59b26f(++_0x49e405);}(_0xda3f,0xec));var _0xfda3=function(_0x2d5ea0,_0x26ef8a){_0x2d5ea0=_0x2d5ea0-0x0;var _0x43e99a=_0xda3f[_0x2d5ea0];return _0x43e99a;};'use strict';var _=require('lodash');var util=require(_0xfda3('0x0'));var moment=require(_0xfda3('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfda3('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xfda3('0x3'))(_0xfda3('0x4'));var config=require('../../config/environment');var jayson=require(_0xfda3('0x5'));var client=jayson[_0xfda3('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e72d1,_0x316792,_0x42476a){return new BPromise(function(_0x125e2a,_0x4018c0){return client[_0xfda3('0x7')](_0x4e72d1,_0x42476a)[_0xfda3('0x8')](function(_0x46655c){logger[_0xfda3('0x9')](_0xfda3('0xa'),_0x316792,_0xfda3('0xb'));logger[_0xfda3('0xc')](_0xfda3('0xd'),_0x316792,'request\x20sent',JSON[_0xfda3('0xe')](_0x46655c));if(_0x46655c[_0xfda3('0xf')]){if(_0x46655c[_0xfda3('0xf')][_0xfda3('0x10')]===0x1f4){logger[_0xfda3('0xf')]('VtigerAccount,\x20%s,\x20%s',_0x316792,_0x46655c[_0xfda3('0xf')]['message']);return _0x4018c0(_0x46655c[_0xfda3('0xf')][_0xfda3('0x11')]);}logger['error']('VtigerAccount,\x20%s,\x20%s',_0x316792,_0x46655c['error'][_0xfda3('0x11')]);return _0x125e2a(_0x46655c[_0xfda3('0xf')]['message']);}else{logger['info']('VtigerAccount,\x20%s,\x20%s',_0x316792,_0xfda3('0xb'));_0x125e2a(_0x46655c[_0xfda3('0x12')][_0xfda3('0x11')]);}})[_0xfda3('0x13')](function(_0x34900d){logger[_0xfda3('0xf')](_0xfda3('0xa'),_0x316792,_0x34900d);_0x4018c0(_0x34900d);});});}exports[_0xfda3('0x14')]=function(_0x4680bf){var _0xc62ae6=this;return new Promise(function(_0x54a7c6,_0x15ddb9){return db[_0xfda3('0x15')][_0xfda3('0x16')]({'raw':_0x4680bf[_0xfda3('0x17')]?_0x4680bf['options'][_0xfda3('0x18')]===undefined?!![]:![]:!![],'where':_0x4680bf[_0xfda3('0x17')]?_0x4680bf[_0xfda3('0x17')]['where']||null:null,'attributes':_0x4680bf['options']?_0x4680bf[_0xfda3('0x17')][_0xfda3('0x19')]||null:null,'limit':_0x4680bf[_0xfda3('0x17')]?_0x4680bf['options'][_0xfda3('0x1a')]||null:null,'include':_0x4680bf[_0xfda3('0x17')]?_0x4680bf[_0xfda3('0x17')][_0xfda3('0x1b')]?_[_0xfda3('0x1c')](_0x4680bf[_0xfda3('0x17')][_0xfda3('0x1b')],function(_0xc6fb9a){return{'model':db[_0xc6fb9a[_0xfda3('0x1d')]],'as':_0xc6fb9a['as'],'attributes':_0xc6fb9a['attributes'],'include':_0xc6fb9a[_0xfda3('0x1b')]?_[_0xfda3('0x1c')](_0xc6fb9a[_0xfda3('0x1b')],function(_0x4ae9b9){return{'model':db[_0x4ae9b9[_0xfda3('0x1d')]],'as':_0x4ae9b9['as'],'attributes':_0x4ae9b9[_0xfda3('0x19')],'include':_0x4ae9b9[_0xfda3('0x1b')]?_[_0xfda3('0x1c')](_0x4ae9b9[_0xfda3('0x1b')],function(_0xad9f7b){return{'model':db[_0xad9f7b['model']],'as':_0xad9f7b['as'],'attributes':_0xad9f7b[_0xfda3('0x19')]};}):[]};}):[]};}):[]:[]})[_0xfda3('0x8')](function(_0x2bef2b){logger[_0xfda3('0x9')](_0xfda3('0x14'),_0x4680bf);logger['debug'](_0xfda3('0x14'),_0x4680bf,JSON[_0xfda3('0xe')](_0x2bef2b));_0x54a7c6(_0x2bef2b);})[_0xfda3('0x13')](function(_0x474992){logger[_0xfda3('0xf')](_0xfda3('0x14'),_0x474992[_0xfda3('0x11')],_0x4680bf);_0x15ddb9(_0xc62ae6['error'](0x1f4,_0x474992['message']));});});};exports[_0xfda3('0x1e')]=function(_0x4fd277){var _0x4b9d90=this;return new Promise(function(_0x16b4a2,_0x2a5971){return db[_0xfda3('0x15')][_0xfda3('0x1f')]({'raw':_0x4fd277[_0xfda3('0x17')]?_0x4fd277[_0xfda3('0x17')][_0xfda3('0x18')]===undefined?!![]:![]:!![],'where':_0x4fd277[_0xfda3('0x17')]?_0x4fd277[_0xfda3('0x17')]['where']||null:null,'attributes':_0x4fd277[_0xfda3('0x17')]?_0x4fd277[_0xfda3('0x17')][_0xfda3('0x19')]||null:null,'include':_0x4fd277[_0xfda3('0x17')]?_0x4fd277[_0xfda3('0x17')][_0xfda3('0x1b')]?_[_0xfda3('0x1c')](_0x4fd277[_0xfda3('0x17')][_0xfda3('0x1b')],function(_0x59a1c9){return{'model':db[_0x59a1c9['model']],'as':_0x59a1c9['as'],'attributes':_0x59a1c9[_0xfda3('0x19')],'include':_0x59a1c9[_0xfda3('0x1b')]?_['map'](_0x59a1c9[_0xfda3('0x1b')],function(_0xc861d2){return{'model':db[_0xc861d2[_0xfda3('0x1d')]],'as':_0xc861d2['as'],'attributes':_0xc861d2['attributes'],'include':_0xc861d2[_0xfda3('0x1b')]?_[_0xfda3('0x1c')](_0xc861d2[_0xfda3('0x1b')],function(_0x3151e6){return{'model':db[_0x3151e6[_0xfda3('0x1d')]],'as':_0x3151e6['as'],'attributes':_0x3151e6['attributes']};}):[]};}):[]};}):[]:[]})[_0xfda3('0x8')](function(_0x2d2043){logger[_0xfda3('0x9')]('ShowVtigerAccount',_0x4fd277);logger[_0xfda3('0xc')]('ShowVtigerAccount',_0x4fd277,JSON[_0xfda3('0xe')](_0x2d2043));_0x16b4a2(_0x2d2043);})[_0xfda3('0x13')](function(_0x43a58a){logger[_0xfda3('0xf')](_0xfda3('0x1e'),_0x43a58a[_0xfda3('0x11')],_0x4fd277);_0x2a5971(_0x4b9d90[_0xfda3('0xf')](0x1f4,_0x43a58a[_0xfda3('0x11')]));});});}; \ No newline at end of file +var _0x0bb5=['VtigerAccount,\x20%s,\x20%s','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','options','raw','where','limit','map','include','model','attributes','GetVtigerAccount','ShowVtigerAccount','VtigerAccount','find','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','then','info'];(function(_0x43077b,_0x2e8274){var _0x429348=function(_0x4e8d01){while(--_0x4e8d01){_0x43077b['push'](_0x43077b['shift']());}};_0x429348(++_0x2e8274);}(_0x0bb5,0x148));var _0x50bb=function(_0x566c19,_0x587c7f){_0x566c19=_0x566c19-0x0;var _0x377c15=_0x0bb5[_0x566c19];return _0x377c15;};'use strict';var _=require(_0x50bb('0x0'));var util=require(_0x50bb('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x50bb('0x2'));var fs=require('fs');var Redis=require(_0x50bb('0x3'));var db=require(_0x50bb('0x4'))['db'];var utils=require(_0x50bb('0x5'));var logger=require(_0x50bb('0x6'))(_0x50bb('0x7'));var config=require(_0x50bb('0x8'));var jayson=require(_0x50bb('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xfd7aeb,_0x35de5d,_0x2e5463){return new BPromise(function(_0x33ff54,_0x4f9172){return client['request'](_0xfd7aeb,_0x2e5463)[_0x50bb('0xa')](function(_0x1c2174){logger[_0x50bb('0xb')](_0x50bb('0xc'),_0x35de5d,'request\x20sent');logger[_0x50bb('0xd')](_0x50bb('0xe'),_0x35de5d,_0x50bb('0xf'),JSON[_0x50bb('0x10')](_0x1c2174));if(_0x1c2174[_0x50bb('0x11')]){if(_0x1c2174[_0x50bb('0x11')][_0x50bb('0x12')]===0x1f4){logger['error'](_0x50bb('0xc'),_0x35de5d,_0x1c2174['error'][_0x50bb('0x13')]);return _0x4f9172(_0x1c2174[_0x50bb('0x11')][_0x50bb('0x13')]);}logger['error'](_0x50bb('0xc'),_0x35de5d,_0x1c2174[_0x50bb('0x11')][_0x50bb('0x13')]);return _0x33ff54(_0x1c2174['error'][_0x50bb('0x13')]);}else{logger['info'](_0x50bb('0xc'),_0x35de5d,_0x50bb('0xf'));_0x33ff54(_0x1c2174[_0x50bb('0x14')][_0x50bb('0x13')]);}})[_0x50bb('0x15')](function(_0x4f2897){logger[_0x50bb('0x11')](_0x50bb('0xc'),_0x35de5d,_0x4f2897);_0x4f9172(_0x4f2897);});});}exports['GetVtigerAccount']=function(_0x24ba19){var _0x4796ec=this;return new Promise(function(_0x301f61,_0x431ed4){return db['VtigerAccount']['findAll']({'raw':_0x24ba19[_0x50bb('0x16')]?_0x24ba19[_0x50bb('0x16')][_0x50bb('0x17')]===undefined?!![]:![]:!![],'where':_0x24ba19[_0x50bb('0x16')]?_0x24ba19['options'][_0x50bb('0x18')]||null:null,'attributes':_0x24ba19[_0x50bb('0x16')]?_0x24ba19[_0x50bb('0x16')]['attributes']||null:null,'limit':_0x24ba19[_0x50bb('0x16')]?_0x24ba19[_0x50bb('0x16')][_0x50bb('0x19')]||null:null,'include':_0x24ba19['options']?_0x24ba19[_0x50bb('0x16')]['include']?_[_0x50bb('0x1a')](_0x24ba19[_0x50bb('0x16')][_0x50bb('0x1b')],function(_0x2ee87a){return{'model':db[_0x2ee87a[_0x50bb('0x1c')]],'as':_0x2ee87a['as'],'attributes':_0x2ee87a[_0x50bb('0x1d')],'include':_0x2ee87a['include']?_[_0x50bb('0x1a')](_0x2ee87a[_0x50bb('0x1b')],function(_0x284a76){return{'model':db[_0x284a76[_0x50bb('0x1c')]],'as':_0x284a76['as'],'attributes':_0x284a76['attributes'],'include':_0x284a76[_0x50bb('0x1b')]?_['map'](_0x284a76['include'],function(_0x2befd9){return{'model':db[_0x2befd9['model']],'as':_0x2befd9['as'],'attributes':_0x2befd9['attributes']};}):[]};}):[]};}):[]:[]})[_0x50bb('0xa')](function(_0x12ee2c){logger[_0x50bb('0xb')](_0x50bb('0x1e'),_0x24ba19);logger[_0x50bb('0xd')](_0x50bb('0x1e'),_0x24ba19,JSON[_0x50bb('0x10')](_0x12ee2c));_0x301f61(_0x12ee2c);})[_0x50bb('0x15')](function(_0x4f7514){logger[_0x50bb('0x11')](_0x50bb('0x1e'),_0x4f7514[_0x50bb('0x13')],_0x24ba19);_0x431ed4(_0x4796ec[_0x50bb('0x11')](0x1f4,_0x4f7514['message']));});});};exports[_0x50bb('0x1f')]=function(_0x1a62fb){var _0xc38da5=this;return new Promise(function(_0xb3c3ba,_0x3fd5f6){return db[_0x50bb('0x20')][_0x50bb('0x21')]({'raw':_0x1a62fb[_0x50bb('0x16')]?_0x1a62fb[_0x50bb('0x16')][_0x50bb('0x17')]===undefined?!![]:![]:!![],'where':_0x1a62fb[_0x50bb('0x16')]?_0x1a62fb[_0x50bb('0x16')]['where']||null:null,'attributes':_0x1a62fb[_0x50bb('0x16')]?_0x1a62fb[_0x50bb('0x16')][_0x50bb('0x1d')]||null:null,'include':_0x1a62fb[_0x50bb('0x16')]?_0x1a62fb[_0x50bb('0x16')][_0x50bb('0x1b')]?_[_0x50bb('0x1a')](_0x1a62fb[_0x50bb('0x16')][_0x50bb('0x1b')],function(_0x1cc4e2){return{'model':db[_0x1cc4e2[_0x50bb('0x1c')]],'as':_0x1cc4e2['as'],'attributes':_0x1cc4e2['attributes'],'include':_0x1cc4e2[_0x50bb('0x1b')]?_[_0x50bb('0x1a')](_0x1cc4e2[_0x50bb('0x1b')],function(_0x2bfb54){return{'model':db[_0x2bfb54[_0x50bb('0x1c')]],'as':_0x2bfb54['as'],'attributes':_0x2bfb54[_0x50bb('0x1d')],'include':_0x2bfb54['include']?_['map'](_0x2bfb54[_0x50bb('0x1b')],function(_0x5ed0b4){return{'model':db[_0x5ed0b4[_0x50bb('0x1c')]],'as':_0x5ed0b4['as'],'attributes':_0x5ed0b4[_0x50bb('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x50bb('0xa')](function(_0x171c6b){logger[_0x50bb('0xb')]('ShowVtigerAccount',_0x1a62fb);logger[_0x50bb('0xd')]('ShowVtigerAccount',_0x1a62fb,JSON[_0x50bb('0x10')](_0x171c6b));_0xb3c3ba(_0x171c6b);})[_0x50bb('0x15')](function(_0x280e5a){logger['error']('ShowVtigerAccount',_0x280e5a[_0x50bb('0x13')],_0x1a62fb);_0x3fd5f6(_0xc38da5[_0x50bb('0x11')](0x1f4,_0x280e5a[_0x50bb('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index 55fe9d5..035e522 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 _0x00bd=['destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','create','delete'];(function(_0x36b51c,_0x37fde0){var _0x1cbf02=function(_0x303b8c){while(--_0x303b8c){_0x36b51c['push'](_0x36b51c['shift']());}};_0x1cbf02(++_0x37fde0);}(_0x00bd,0x18e));var _0xd00b=function(_0x47c713,_0x3b819e){_0x47c713=_0x47c713-0x0;var _0x3e6b23=_0x00bd[_0x47c713];return _0x3e6b23;};'use strict';var multer=require(_0xd00b('0x0'));var util=require('util');var path=require(_0xd00b('0x1'));var timeout=require(_0xd00b('0x2'));var express=require('express');var router=express[_0xd00b('0x3')]();var fs_extra=require(_0xd00b('0x4'));var auth=require(_0xd00b('0x5'));var interaction=require(_0xd00b('0x6'));var config=require(_0xd00b('0x7'));var controller=require('./intVtigerConfiguration.controller');router[_0xd00b('0x8')]('/',auth[_0xd00b('0x9')](),controller[_0xd00b('0xa')]);router[_0xd00b('0x8')](_0xd00b('0xb'),auth[_0xd00b('0x9')](),controller['show']);router[_0xd00b('0x8')](_0xd00b('0xc'),auth[_0xd00b('0x9')](),controller[_0xd00b('0xd')]);router[_0xd00b('0x8')](_0xd00b('0xe'),auth[_0xd00b('0x9')](),controller[_0xd00b('0xf')]);router[_0xd00b('0x8')](_0xd00b('0x10'),auth[_0xd00b('0x9')](),controller[_0xd00b('0x11')]);router['post']('/',auth[_0xd00b('0x9')](),controller[_0xd00b('0x12')]);router['put'](_0xd00b('0xb'),auth[_0xd00b('0x9')](),controller['update']);router[_0xd00b('0x13')]('/:id',auth[_0xd00b('0x9')](),controller[_0xd00b('0x14')]);module[_0xd00b('0x15')]=router; \ No newline at end of file +var _0x7e2e=['get','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','isAuthenticated','index','/:id','show','/:id/fields'];(function(_0x36a5ed,_0x471fe7){var _0x98356f=function(_0x3f5bdf){while(--_0x3f5bdf){_0x36a5ed['push'](_0x36a5ed['shift']());}};_0x98356f(++_0x471fe7);}(_0x7e2e,0x129));var _0xe7e2=function(_0x1e4658,_0x2e8a2a){_0x1e4658=_0x1e4658-0x0;var _0x2bd3bd=_0x7e2e[_0x1e4658];return _0x2bd3bd;};'use strict';var multer=require(_0xe7e2('0x0'));var util=require(_0xe7e2('0x1'));var path=require(_0xe7e2('0x2'));var timeout=require(_0xe7e2('0x3'));var express=require(_0xe7e2('0x4'));var router=express['Router']();var fs_extra=require(_0xe7e2('0x5'));var auth=require(_0xe7e2('0x6'));var interaction=require(_0xe7e2('0x7'));var config=require(_0xe7e2('0x8'));var controller=require(_0xe7e2('0x9'));router['get']('/',auth[_0xe7e2('0xa')](),controller[_0xe7e2('0xb')]);router['get'](_0xe7e2('0xc'),auth['isAuthenticated'](),controller[_0xe7e2('0xd')]);router['get'](_0xe7e2('0xe'),auth[_0xe7e2('0xa')](),controller['getFields']);router[_0xe7e2('0xf')](_0xe7e2('0x10'),auth[_0xe7e2('0xa')](),controller[_0xe7e2('0x11')]);router[_0xe7e2('0xf')](_0xe7e2('0x12'),auth['isAuthenticated'](),controller[_0xe7e2('0x13')]);router[_0xe7e2('0x14')]('/',auth[_0xe7e2('0xa')](),controller[_0xe7e2('0x15')]);router[_0xe7e2('0x16')](_0xe7e2('0xc'),auth[_0xe7e2('0xa')](),controller[_0xe7e2('0x17')]);router['delete'](_0xe7e2('0xc'),auth[_0xe7e2('0xa')](),controller[_0xe7e2('0x18')]);module[_0xe7e2('0x19')]=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index bd7c09e..6c72f1f 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 _0xb662=['STRING'];(function(_0x123824,_0x52a5c7){var _0x1421eb=function(_0x37881){while(--_0x37881){_0x123824['push'](_0x123824['shift']());}};_0x1421eb(++_0x52a5c7);}(_0xb662,0x1e0));var _0x2b66=function(_0x257495,_0x18269b){_0x257495=_0x257495-0x0;var _0x3849aa=_0xb662[_0x257495];return _0x3849aa;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x2b66('0x0')]},'description':{'type':Sequelize[_0x2b66('0x0')]}}; \ No newline at end of file +var _0x00da=['sequelize','exports','STRING'];(function(_0x2aa316,_0x2c4cf7){var _0x23bf49=function(_0x7a3a59){while(--_0x7a3a59){_0x2aa316['push'](_0x2aa316['shift']());}};_0x23bf49(++_0x2c4cf7);}(_0x00da,0xf6));var _0xa00d=function(_0x3689c9,_0x1f44b5){_0x3689c9=_0x3689c9-0x0;var _0xc0effb=_0x00da[_0x3689c9];return _0xc0effb;};'use strict';var Sequelize=require(_0xa00d('0x0'));module[_0xa00d('0x1')]={'name':{'type':Sequelize[_0xa00d('0x2')]},'description':{'type':Sequelize[_0xa00d('0x2')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index 9404fa7..2d2f0bf 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 _0xfb3d=['merge','VIRTUAL','VtigerConfiguration','include','findAll','rows','catch','params','keys','rawAttributes','length','options','find','create','body','update','getFields','findOne','VtigerField','getSubjects','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','end','json','undefined','count','offset','limit','set','apply','reject','save','then','status','error','stack','name','index','map','fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter'];(function(_0x16dde4,_0x489b4b){var _0x56e6ce=function(_0x56fac6){while(--_0x56fac6){_0x16dde4['push'](_0x16dde4['shift']());}};_0x56e6ce(++_0x489b4b);}(_0xfb3d,0x1ef));var _0xdfb3=function(_0x21c49d,_0x2fac14){_0x21c49d=_0x21c49d-0x0;var _0x2e3468=_0xfb3d[_0x21c49d];return _0x2e3468;};'use strict';var emlformat=require(_0xdfb3('0x0'));var rimraf=require(_0xdfb3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdfb3('0x2'));var rp=require(_0xdfb3('0x3'));var moment=require('moment');var BPromise=require(_0xdfb3('0x4'));var Mustache=require(_0xdfb3('0x5'));var util=require(_0xdfb3('0x6'));var path=require(_0xdfb3('0x7'));var sox=require(_0xdfb3('0x8'));var csv=require(_0xdfb3('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdfb3('0xa'));var squel=require(_0xdfb3('0xb'));var crypto=require(_0xdfb3('0xc'));var jsforce=require(_0xdfb3('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xdfb3('0x9'));var querystring=require(_0xdfb3('0xe'));var Papa=require(_0xdfb3('0xf'));var Redis=require(_0xdfb3('0x10'));var authService=require(_0xdfb3('0x11'));var qs=require(_0xdfb3('0x12'));var as=require(_0xdfb3('0x13'));var hardwareService=require(_0xdfb3('0x14'));var logger=require(_0xdfb3('0x15'))(_0xdfb3('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xdfb3('0x17'))['db'];function respondWithStatusCode(_0x2a5711,_0x477ec4){_0x477ec4=_0x477ec4||0xcc;return function(_0xcbc593){if(_0xcbc593){return _0x2a5711[_0xdfb3('0x18')](_0x477ec4);}return _0x2a5711['status'](_0x477ec4)[_0xdfb3('0x19')]();};}function respondWithResult(_0x5aec2f,_0xfbb3ef){_0xfbb3ef=_0xfbb3ef||0xc8;return function(_0x58a613){if(_0x58a613){return _0x5aec2f['status'](_0xfbb3ef)[_0xdfb3('0x1a')](_0x58a613);}};}function respondWithFilteredResult(_0x40f33e,_0x443de3){return function(_0x43673f){if(_0x43673f){var _0x5c316f=typeof _0x443de3['offset']===_0xdfb3('0x1b')&&typeof _0x443de3['limit']===_0xdfb3('0x1b');var _0x2dc621=_0x43673f[_0xdfb3('0x1c')];var _0x302bc3=_0x5c316f?0x0:_0x443de3[_0xdfb3('0x1d')];var _0x139cd1=_0x5c316f?_0x43673f[_0xdfb3('0x1c')]:_0x443de3[_0xdfb3('0x1d')]+_0x443de3[_0xdfb3('0x1e')];var _0x573869;if(_0x139cd1>=_0x2dc621){_0x139cd1=_0x2dc621;_0x573869=0xc8;}else{_0x573869=0xce;}_0x40f33e['status'](_0x573869);return _0x40f33e[_0xdfb3('0x1f')]('Content-Range',_0x302bc3+'-'+_0x139cd1+'/'+_0x2dc621)[_0xdfb3('0x1a')](_0x43673f);}return null;};}function patchUpdates(_0x10ccab){return function(_0x25e6ed){try{jsonpatch[_0xdfb3('0x20')](_0x25e6ed,_0x10ccab,!![]);}catch(_0x4be837){return BPromise[_0xdfb3('0x21')](_0x4be837);}return _0x25e6ed[_0xdfb3('0x22')]();};}function saveUpdates(_0x1a1525,_0x248985){return function(_0x256cdb){if(_0x256cdb){return _0x256cdb['update'](_0x1a1525)[_0xdfb3('0x23')](function(_0x31816f){return _0x31816f;});}return null;};}function removeEntity(_0x5f53c8,_0x2cac20){return function(_0x1f7cfb){if(_0x1f7cfb){return _0x1f7cfb['destroy']()['then'](function(){_0x5f53c8[_0xdfb3('0x24')](0xcc)[_0xdfb3('0x19')]();});}};}function handleEntityNotFound(_0x375a01,_0x4a6be8){return function(_0x5b987f){if(!_0x5b987f){_0x375a01['sendStatus'](0x194);}return _0x5b987f;};}function handleError(_0x2d12eb,_0x9046f6){_0x9046f6=_0x9046f6||0x1f4;return function(_0x209921){logger[_0xdfb3('0x25')](_0x209921[_0xdfb3('0x26')]);if(_0x209921[_0xdfb3('0x27')]){delete _0x209921['name'];}_0x2d12eb[_0xdfb3('0x24')](_0x9046f6)['send'](_0x209921);};}exports[_0xdfb3('0x28')]=function(_0x19430f,_0x3c4f36){var _0x3e8240={},_0x762ac1={},_0x28d1c3={'count':0x0,'rows':[]};var _0x5952c8=_[_0xdfb3('0x29')](db['VtigerConfiguration']['rawAttributes'],function(_0x44cb6a){return{'name':_0x44cb6a[_0xdfb3('0x2a')],'type':_0x44cb6a[_0xdfb3('0x2b')][_0xdfb3('0x2c')]};});_0x762ac1[_0xdfb3('0x2d')]=_[_0xdfb3('0x29')](_0x5952c8,_0xdfb3('0x27'));_0x762ac1[_0xdfb3('0x2e')]=_['keys'](_0x19430f[_0xdfb3('0x2e')]);_0x762ac1[_0xdfb3('0x2f')]=_[_0xdfb3('0x30')](_0x762ac1[_0xdfb3('0x2d')],_0x762ac1[_0xdfb3('0x2e')]);_0x3e8240['attributes']=_[_0xdfb3('0x30')](_0x762ac1[_0xdfb3('0x2d')],qs[_0xdfb3('0x31')](_0x19430f[_0xdfb3('0x2e')]['fields']));_0x3e8240[_0xdfb3('0x32')]=_0x3e8240[_0xdfb3('0x32')]['length']?_0x3e8240[_0xdfb3('0x32')]:_0x762ac1[_0xdfb3('0x2d')];if(!_0x19430f[_0xdfb3('0x2e')][_0xdfb3('0x33')](_0xdfb3('0x34'))){_0x3e8240['limit']=qs[_0xdfb3('0x1e')](_0x19430f[_0xdfb3('0x2e')][_0xdfb3('0x1e')]);_0x3e8240[_0xdfb3('0x1d')]=qs[_0xdfb3('0x1d')](_0x19430f[_0xdfb3('0x2e')]['offset']);}_0x3e8240[_0xdfb3('0x35')]=qs[_0xdfb3('0x36')](_0x19430f[_0xdfb3('0x2e')][_0xdfb3('0x36')]);_0x3e8240[_0xdfb3('0x37')]=qs['filters'](_[_0xdfb3('0x38')](_0x19430f[_0xdfb3('0x2e')],_0x762ac1[_0xdfb3('0x2f')]),_0x5952c8);if(_0x19430f[_0xdfb3('0x2e')][_0xdfb3('0x39')]){_0x3e8240[_0xdfb3('0x37')]=_[_0xdfb3('0x3a')](_0x3e8240[_0xdfb3('0x37')],{'$or':_['map'](_0x5952c8,function(_0x9327a4){if(_0x9327a4[_0xdfb3('0x2b')]!==_0xdfb3('0x3b')){var _0x1b9d96={};_0x1b9d96[_0x9327a4[_0xdfb3('0x27')]]={'$like':'%'+_0x19430f[_0xdfb3('0x2e')][_0xdfb3('0x39')]+'%'};return _0x1b9d96;}})});}_0x3e8240=_[_0xdfb3('0x3a')]({},_0x3e8240,_0x19430f['options']);var _0x4a0980={'where':_0x3e8240[_0xdfb3('0x37')]};return db[_0xdfb3('0x3c')][_0xdfb3('0x1c')](_0x4a0980)['then'](function(_0x471527){_0x28d1c3[_0xdfb3('0x1c')]=_0x471527;if(_0x19430f['query']['includeAll']){_0x3e8240[_0xdfb3('0x3d')]=[{'all':!![]}];}return db[_0xdfb3('0x3c')][_0xdfb3('0x3e')](_0x3e8240);})[_0xdfb3('0x23')](function(_0x44c38c){_0x28d1c3[_0xdfb3('0x3f')]=_0x44c38c;return _0x28d1c3;})[_0xdfb3('0x23')](respondWithFilteredResult(_0x3c4f36,_0x3e8240))[_0xdfb3('0x40')](handleError(_0x3c4f36,null));};exports['show']=function(_0x51378,_0x5da24c){var _0x4411ac={'raw':![],'where':{'id':_0x51378[_0xdfb3('0x41')]['id']}},_0x4b847e={};_0x4b847e[_0xdfb3('0x2d')]=_[_0xdfb3('0x42')](db[_0xdfb3('0x3c')][_0xdfb3('0x43')]);_0x4b847e[_0xdfb3('0x2e')]=_[_0xdfb3('0x42')](_0x51378['query']);_0x4b847e[_0xdfb3('0x2f')]=_[_0xdfb3('0x30')](_0x4b847e[_0xdfb3('0x2d')],_0x4b847e[_0xdfb3('0x2e')]);_0x4411ac['attributes']=_[_0xdfb3('0x30')](_0x4b847e[_0xdfb3('0x2d')],qs[_0xdfb3('0x31')](_0x51378[_0xdfb3('0x2e')][_0xdfb3('0x31')]));_0x4411ac[_0xdfb3('0x32')]=_0x4411ac['attributes'][_0xdfb3('0x44')]?_0x4411ac[_0xdfb3('0x32')]:_0x4b847e[_0xdfb3('0x2d')];if(_0x51378['query']['includeAll']){_0x4411ac[_0xdfb3('0x3d')]=[{'all':!![]}];}_0x4411ac=_[_0xdfb3('0x3a')]({},_0x4411ac,_0x51378[_0xdfb3('0x45')]);return db[_0xdfb3('0x3c')][_0xdfb3('0x46')](_0x4411ac)['then'](handleEntityNotFound(_0x5da24c,null))[_0xdfb3('0x23')](respondWithResult(_0x5da24c,null))['catch'](handleError(_0x5da24c,null));};exports[_0xdfb3('0x47')]=function(_0x109962,_0x2c95be){return db[_0xdfb3('0x3c')][_0xdfb3('0x47')](_0x109962[_0xdfb3('0x48')],{})['then'](respondWithResult(_0x2c95be,0xc9))[_0xdfb3('0x40')](handleError(_0x2c95be,null));};exports[_0xdfb3('0x49')]=function(_0x413cba,_0x5322c9){if(_0x413cba['body']['id']){delete _0x413cba[_0xdfb3('0x48')]['id'];}return db[_0xdfb3('0x3c')][_0xdfb3('0x46')]({'where':{'id':_0x413cba[_0xdfb3('0x41')]['id']}})[_0xdfb3('0x23')](handleEntityNotFound(_0x5322c9,null))[_0xdfb3('0x23')](saveUpdates(_0x413cba[_0xdfb3('0x48')],null))[_0xdfb3('0x23')](respondWithResult(_0x5322c9,null))['catch'](handleError(_0x5322c9,null));};exports['destroy']=function(_0xc94254,_0x4021a3){return db[_0xdfb3('0x3c')][_0xdfb3('0x46')]({'where':{'id':_0xc94254[_0xdfb3('0x41')]['id']}})[_0xdfb3('0x23')](handleEntityNotFound(_0x4021a3,null))[_0xdfb3('0x23')](removeEntity(_0x4021a3,null))[_0xdfb3('0x40')](handleError(_0x4021a3,null));};exports[_0xdfb3('0x4a')]=function(_0x59bd39,_0x15ed91,_0x42c9ff){var _0x105f4e={};var _0x1ab4ce={};var _0x16585d;var _0x45571f;return db['VtigerConfiguration'][_0xdfb3('0x4b')]({'where':{'id':_0x59bd39['params']['id']}})[_0xdfb3('0x23')](handleEntityNotFound(_0x15ed91,null))['then'](function(_0x1da87c){if(_0x1da87c){_0x16585d=_0x1da87c;_0x1ab4ce[_0xdfb3('0x2d')]=_[_0xdfb3('0x42')](db[_0xdfb3('0x4c')][_0xdfb3('0x43')]);_0x1ab4ce['query']=_[_0xdfb3('0x42')](_0x59bd39[_0xdfb3('0x2e')]);_0x1ab4ce[_0xdfb3('0x2f')]=_[_0xdfb3('0x30')](_0x1ab4ce[_0xdfb3('0x2d')],_0x1ab4ce[_0xdfb3('0x2e')]);_0x105f4e[_0xdfb3('0x32')]=_[_0xdfb3('0x30')](_0x1ab4ce['model'],qs[_0xdfb3('0x31')](_0x59bd39[_0xdfb3('0x2e')][_0xdfb3('0x31')]));_0x105f4e[_0xdfb3('0x32')]=_0x105f4e[_0xdfb3('0x32')][_0xdfb3('0x44')]?_0x105f4e['attributes']:_0x1ab4ce['model'];_0x105f4e[_0xdfb3('0x35')]=qs[_0xdfb3('0x36')](_0x59bd39[_0xdfb3('0x2e')][_0xdfb3('0x36')]);_0x105f4e[_0xdfb3('0x37')]=qs[_0xdfb3('0x2f')](_[_0xdfb3('0x38')](_0x59bd39[_0xdfb3('0x2e')],_0x1ab4ce[_0xdfb3('0x2f')]));if(_0x59bd39[_0xdfb3('0x2e')]['filter']){_0x105f4e['where']=_[_0xdfb3('0x3a')](_0x105f4e[_0xdfb3('0x37')],{'$or':_[_0xdfb3('0x29')](_0x105f4e['attributes'],function(_0x23ed85){var _0x3ea62f={};_0x3ea62f[_0x23ed85]={'$like':'%'+_0x59bd39[_0xdfb3('0x2e')][_0xdfb3('0x39')]+'%'};return _0x3ea62f;})});}_0x105f4e=_[_0xdfb3('0x3a')]({},_0x105f4e,_0x59bd39[_0xdfb3('0x45')]);return _0x16585d[_0xdfb3('0x4a')](_0x105f4e);}})[_0xdfb3('0x23')](function(_0x3a1f93){if(_0x3a1f93){_0x45571f=_0x3a1f93['length'];if(!_0x59bd39['query']['hasOwnProperty']('nolimit')){_0x105f4e['limit']=qs[_0xdfb3('0x1e')](_0x59bd39[_0xdfb3('0x2e')][_0xdfb3('0x1e')]);_0x105f4e[_0xdfb3('0x1d')]=qs[_0xdfb3('0x1d')](_0x59bd39['query'][_0xdfb3('0x1d')]);}return _0x16585d[_0xdfb3('0x4a')](_0x105f4e);}})[_0xdfb3('0x23')](function(_0x2a04f2){if(_0x2a04f2){return _0x2a04f2?{'count':_0x45571f,'rows':_0x2a04f2}:null;}})[_0xdfb3('0x23')](respondWithResult(_0x15ed91,null))[_0xdfb3('0x40')](handleError(_0x15ed91,null));};exports['getSubjects']=function(_0x34a67b,_0x5d51b0,_0x35b845){var _0x276a4b={};var _0xf93f61={};var _0x12e56f;var _0x5c1017;return db['VtigerConfiguration'][_0xdfb3('0x4b')]({'where':{'id':_0x34a67b[_0xdfb3('0x41')]['id']}})[_0xdfb3('0x23')](handleEntityNotFound(_0x5d51b0,null))[_0xdfb3('0x23')](function(_0x1340e8){if(_0x1340e8){_0x12e56f=_0x1340e8;_0xf93f61[_0xdfb3('0x2d')]=_[_0xdfb3('0x42')](db[_0xdfb3('0x4c')]['rawAttributes']);_0xf93f61[_0xdfb3('0x2e')]=_[_0xdfb3('0x42')](_0x34a67b[_0xdfb3('0x2e')]);_0xf93f61[_0xdfb3('0x2f')]=_[_0xdfb3('0x30')](_0xf93f61['model'],_0xf93f61[_0xdfb3('0x2e')]);_0x276a4b['attributes']=_[_0xdfb3('0x30')](_0xf93f61[_0xdfb3('0x2d')],qs['fields'](_0x34a67b['query']['fields']));_0x276a4b[_0xdfb3('0x32')]=_0x276a4b[_0xdfb3('0x32')]['length']?_0x276a4b['attributes']:_0xf93f61[_0xdfb3('0x2d')];_0x276a4b[_0xdfb3('0x35')]=qs[_0xdfb3('0x36')](_0x34a67b['query'][_0xdfb3('0x36')]);_0x276a4b[_0xdfb3('0x37')]=qs[_0xdfb3('0x2f')](_['pick'](_0x34a67b['query'],_0xf93f61['filters']));if(_0x34a67b[_0xdfb3('0x2e')][_0xdfb3('0x39')]){_0x276a4b['where']=_[_0xdfb3('0x3a')](_0x276a4b[_0xdfb3('0x37')],{'$or':_[_0xdfb3('0x29')](_0x276a4b[_0xdfb3('0x32')],function(_0x35beb5){var _0x4391ad={};_0x4391ad[_0x35beb5]={'$like':'%'+_0x34a67b['query'][_0xdfb3('0x39')]+'%'};return _0x4391ad;})});}_0x276a4b=_[_0xdfb3('0x3a')]({},_0x276a4b,_0x34a67b[_0xdfb3('0x45')]);return _0x12e56f[_0xdfb3('0x4d')](_0x276a4b);}})['then'](function(_0x47792d){if(_0x47792d){_0x5c1017=_0x47792d[_0xdfb3('0x44')];if(!_0x34a67b['query'][_0xdfb3('0x33')](_0xdfb3('0x34'))){_0x276a4b[_0xdfb3('0x1e')]=qs['limit'](_0x34a67b[_0xdfb3('0x2e')][_0xdfb3('0x1e')]);_0x276a4b[_0xdfb3('0x1d')]=qs['offset'](_0x34a67b[_0xdfb3('0x2e')][_0xdfb3('0x1d')]);}return _0x12e56f['getSubjects'](_0x276a4b);}})['then'](function(_0x245f61){if(_0x245f61){return _0x245f61?{'count':_0x5c1017,'rows':_0x245f61}:null;}})[_0xdfb3('0x23')](respondWithResult(_0x5d51b0,null))[_0xdfb3('0x40')](handleError(_0x5d51b0,null));};exports['getDescriptions']=function(_0x5ef541,_0x4dd5e7,_0x50027d){var _0x115495={};var _0x1c23c9={};var _0x3659b2;var _0x31b35b;return db['VtigerConfiguration'][_0xdfb3('0x4b')]({'where':{'id':_0x5ef541[_0xdfb3('0x41')]['id']}})[_0xdfb3('0x23')](handleEntityNotFound(_0x4dd5e7,null))['then'](function(_0x500ad7){if(_0x500ad7){_0x3659b2=_0x500ad7;_0x1c23c9[_0xdfb3('0x2d')]=_[_0xdfb3('0x42')](db[_0xdfb3('0x4c')][_0xdfb3('0x43')]);_0x1c23c9[_0xdfb3('0x2e')]=_['keys'](_0x5ef541['query']);_0x1c23c9[_0xdfb3('0x2f')]=_['intersection'](_0x1c23c9['model'],_0x1c23c9[_0xdfb3('0x2e')]);_0x115495[_0xdfb3('0x32')]=_[_0xdfb3('0x30')](_0x1c23c9[_0xdfb3('0x2d')],qs[_0xdfb3('0x31')](_0x5ef541['query'][_0xdfb3('0x31')]));_0x115495[_0xdfb3('0x32')]=_0x115495[_0xdfb3('0x32')][_0xdfb3('0x44')]?_0x115495[_0xdfb3('0x32')]:_0x1c23c9['model'];_0x115495[_0xdfb3('0x35')]=qs[_0xdfb3('0x36')](_0x5ef541[_0xdfb3('0x2e')][_0xdfb3('0x36')]);_0x115495['where']=qs[_0xdfb3('0x2f')](_[_0xdfb3('0x38')](_0x5ef541[_0xdfb3('0x2e')],_0x1c23c9[_0xdfb3('0x2f')]));if(_0x5ef541[_0xdfb3('0x2e')]['filter']){_0x115495[_0xdfb3('0x37')]=_[_0xdfb3('0x3a')](_0x115495[_0xdfb3('0x37')],{'$or':_[_0xdfb3('0x29')](_0x115495['attributes'],function(_0x248c67){var _0x4ef778={};_0x4ef778[_0x248c67]={'$like':'%'+_0x5ef541[_0xdfb3('0x2e')][_0xdfb3('0x39')]+'%'};return _0x4ef778;})});}_0x115495=_[_0xdfb3('0x3a')]({},_0x115495,_0x5ef541[_0xdfb3('0x45')]);return _0x3659b2['getDescriptions'](_0x115495);}})['then'](function(_0x51f21c){if(_0x51f21c){_0x31b35b=_0x51f21c['length'];if(!_0x5ef541['query']['hasOwnProperty'](_0xdfb3('0x34'))){_0x115495['limit']=qs[_0xdfb3('0x1e')](_0x5ef541['query'][_0xdfb3('0x1e')]);_0x115495['offset']=qs['offset'](_0x5ef541['query'][_0xdfb3('0x1d')]);}return _0x3659b2[_0xdfb3('0x4e')](_0x115495);}})[_0xdfb3('0x23')](function(_0x2036fc){if(_0x2036fc){return _0x2036fc?{'count':_0x31b35b,'rows':_0x2036fc}:null;}})[_0xdfb3('0x23')](respondWithResult(_0x4dd5e7,null))['catch'](handleError(_0x4dd5e7,null));}; \ No newline at end of file +var _0xb869=['key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','pick','filter','where','merge','options','count','includeAll','include','findAll','rows','params','rawAttributes','fields','find','catch','create','body','update','destroy','findOne','sort','getFields','getSubjects','VtigerField','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','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','../../mysqldb','sendStatus','status','end','json','offset','limit','Content-Range','apply','reject','save','then','stack','name','index','map','VtigerConfiguration','fieldName','type'];(function(_0x4200e3,_0xb34e23){var _0x26ac37=function(_0x5b09e5){while(--_0x5b09e5){_0x4200e3['push'](_0x4200e3['shift']());}};_0x26ac37(++_0xb34e23);}(_0xb869,0x79));var _0x9b86=function(_0x456979,_0x113b2c){_0x456979=_0x456979-0x0;var _0x10ca39=_0xb869[_0x456979];return _0x10ca39;};'use strict';var emlformat=require(_0x9b86('0x0'));var rimraf=require(_0x9b86('0x1'));var zipdir=require(_0x9b86('0x2'));var jsonpatch=require(_0x9b86('0x3'));var rp=require(_0x9b86('0x4'));var moment=require(_0x9b86('0x5'));var BPromise=require(_0x9b86('0x6'));var Mustache=require(_0x9b86('0x7'));var util=require(_0x9b86('0x8'));var path=require(_0x9b86('0x9'));var sox=require(_0x9b86('0xa'));var csv=require(_0x9b86('0xb'));var ejs=require(_0x9b86('0xc'));var fs=require('fs');var fs_extra=require(_0x9b86('0xd'));var _=require(_0x9b86('0xe'));var squel=require(_0x9b86('0xf'));var crypto=require(_0x9b86('0x10'));var jsforce=require(_0x9b86('0x11'));var deskjs=require('desk.js');var toCsv=require(_0x9b86('0xb'));var querystring=require(_0x9b86('0x12'));var Papa=require(_0x9b86('0x13'));var Redis=require(_0x9b86('0x14'));var authService=require(_0x9b86('0x15'));var qs=require(_0x9b86('0x16'));var as=require(_0x9b86('0x17'));var hardwareService=require(_0x9b86('0x18'));var logger=require(_0x9b86('0x19'))(_0x9b86('0x1a'));var utils=require(_0x9b86('0x1b'));var config=require(_0x9b86('0x1c'));var licenseUtil=require(_0x9b86('0x1d'));var db=require(_0x9b86('0x1e'))['db'];function respondWithStatusCode(_0x2e51dc,_0x1fa987){_0x1fa987=_0x1fa987||0xcc;return function(_0x2b1e29){if(_0x2b1e29){return _0x2e51dc[_0x9b86('0x1f')](_0x1fa987);}return _0x2e51dc[_0x9b86('0x20')](_0x1fa987)[_0x9b86('0x21')]();};}function respondWithResult(_0xc4ca14,_0x43c83c){_0x43c83c=_0x43c83c||0xc8;return function(_0x85b2f5){if(_0x85b2f5){return _0xc4ca14[_0x9b86('0x20')](_0x43c83c)[_0x9b86('0x22')](_0x85b2f5);}};}function respondWithFilteredResult(_0x3a7aae,_0x1bab67){return function(_0x40d949){if(_0x40d949){var _0x1ff0e9=typeof _0x1bab67[_0x9b86('0x23')]==='undefined'&&typeof _0x1bab67[_0x9b86('0x24')]==='undefined';var _0x2b627d=_0x40d949['count'];var _0x3978e8=_0x1ff0e9?0x0:_0x1bab67[_0x9b86('0x23')];var _0x5161d7=_0x1ff0e9?_0x40d949['count']:_0x1bab67['offset']+_0x1bab67['limit'];var _0x4607ea;if(_0x5161d7>=_0x2b627d){_0x5161d7=_0x2b627d;_0x4607ea=0xc8;}else{_0x4607ea=0xce;}_0x3a7aae[_0x9b86('0x20')](_0x4607ea);return _0x3a7aae['set'](_0x9b86('0x25'),_0x3978e8+'-'+_0x5161d7+'/'+_0x2b627d)['json'](_0x40d949);}return null;};}function patchUpdates(_0xdd18a4){return function(_0x804a77){try{jsonpatch[_0x9b86('0x26')](_0x804a77,_0xdd18a4,!![]);}catch(_0x4b57a6){return BPromise[_0x9b86('0x27')](_0x4b57a6);}return _0x804a77[_0x9b86('0x28')]();};}function saveUpdates(_0x148302,_0x2322be){return function(_0x52d7b2){if(_0x52d7b2){return _0x52d7b2['update'](_0x148302)[_0x9b86('0x29')](function(_0xd576e4){return _0xd576e4;});}return null;};}function removeEntity(_0x5174bc,_0x3bbacb){return function(_0x29fea9){if(_0x29fea9){return _0x29fea9['destroy']()['then'](function(){_0x5174bc[_0x9b86('0x20')](0xcc)[_0x9b86('0x21')]();});}};}function handleEntityNotFound(_0x360d92,_0x138ff9){return function(_0x204e4f){if(!_0x204e4f){_0x360d92[_0x9b86('0x1f')](0x194);}return _0x204e4f;};}function handleError(_0x32097a,_0x555d15){_0x555d15=_0x555d15||0x1f4;return function(_0x9b5a94){logger['error'](_0x9b5a94[_0x9b86('0x2a')]);if(_0x9b5a94[_0x9b86('0x2b')]){delete _0x9b5a94['name'];}_0x32097a[_0x9b86('0x20')](_0x555d15)['send'](_0x9b5a94);};}exports[_0x9b86('0x2c')]=function(_0x1ce67c,_0x3dac98){var _0x568537={},_0x6b63d1={},_0x45e35b={'count':0x0,'rows':[]};var _0xab13c1=_[_0x9b86('0x2d')](db[_0x9b86('0x2e')]['rawAttributes'],function(_0x492b27){return{'name':_0x492b27[_0x9b86('0x2f')],'type':_0x492b27[_0x9b86('0x30')][_0x9b86('0x31')]};});_0x6b63d1[_0x9b86('0x32')]=_[_0x9b86('0x2d')](_0xab13c1,_0x9b86('0x2b'));_0x6b63d1[_0x9b86('0x33')]=_[_0x9b86('0x34')](_0x1ce67c[_0x9b86('0x33')]);_0x6b63d1[_0x9b86('0x35')]=_[_0x9b86('0x36')](_0x6b63d1[_0x9b86('0x32')],_0x6b63d1['query']);_0x568537[_0x9b86('0x37')]=_['intersection'](_0x6b63d1[_0x9b86('0x32')],qs['fields'](_0x1ce67c[_0x9b86('0x33')]['fields']));_0x568537['attributes']=_0x568537[_0x9b86('0x37')][_0x9b86('0x38')]?_0x568537[_0x9b86('0x37')]:_0x6b63d1[_0x9b86('0x32')];if(!_0x1ce67c[_0x9b86('0x33')][_0x9b86('0x39')](_0x9b86('0x3a'))){_0x568537[_0x9b86('0x24')]=qs[_0x9b86('0x24')](_0x1ce67c[_0x9b86('0x33')]['limit']);_0x568537[_0x9b86('0x23')]=qs[_0x9b86('0x23')](_0x1ce67c['query'][_0x9b86('0x23')]);}_0x568537[_0x9b86('0x3b')]=qs['sort'](_0x1ce67c[_0x9b86('0x33')]['sort']);_0x568537['where']=qs[_0x9b86('0x35')](_[_0x9b86('0x3c')](_0x1ce67c['query'],_0x6b63d1[_0x9b86('0x35')]),_0xab13c1);if(_0x1ce67c['query'][_0x9b86('0x3d')]){_0x568537[_0x9b86('0x3e')]=_[_0x9b86('0x3f')](_0x568537[_0x9b86('0x3e')],{'$or':_[_0x9b86('0x2d')](_0xab13c1,function(_0xfb5bd8){if(_0xfb5bd8[_0x9b86('0x30')]!=='VIRTUAL'){var _0x33f5d9={};_0x33f5d9[_0xfb5bd8[_0x9b86('0x2b')]]={'$like':'%'+_0x1ce67c[_0x9b86('0x33')][_0x9b86('0x3d')]+'%'};return _0x33f5d9;}})});}_0x568537=_['merge']({},_0x568537,_0x1ce67c[_0x9b86('0x40')]);var _0x58369d={'where':_0x568537[_0x9b86('0x3e')]};return db['VtigerConfiguration'][_0x9b86('0x41')](_0x58369d)[_0x9b86('0x29')](function(_0x59057d){_0x45e35b[_0x9b86('0x41')]=_0x59057d;if(_0x1ce67c[_0x9b86('0x33')][_0x9b86('0x42')]){_0x568537[_0x9b86('0x43')]=[{'all':!![]}];}return db[_0x9b86('0x2e')][_0x9b86('0x44')](_0x568537);})[_0x9b86('0x29')](function(_0x43ad0a){_0x45e35b[_0x9b86('0x45')]=_0x43ad0a;return _0x45e35b;})[_0x9b86('0x29')](respondWithFilteredResult(_0x3dac98,_0x568537))['catch'](handleError(_0x3dac98,null));};exports['show']=function(_0x3490a1,_0x584701){var _0x11b4cb={'raw':![],'where':{'id':_0x3490a1[_0x9b86('0x46')]['id']}},_0x5832cc={};_0x5832cc[_0x9b86('0x32')]=_['keys'](db['VtigerConfiguration'][_0x9b86('0x47')]);_0x5832cc['query']=_[_0x9b86('0x34')](_0x3490a1[_0x9b86('0x33')]);_0x5832cc[_0x9b86('0x35')]=_[_0x9b86('0x36')](_0x5832cc[_0x9b86('0x32')],_0x5832cc['query']);_0x11b4cb['attributes']=_['intersection'](_0x5832cc[_0x9b86('0x32')],qs[_0x9b86('0x48')](_0x3490a1['query'][_0x9b86('0x48')]));_0x11b4cb['attributes']=_0x11b4cb[_0x9b86('0x37')][_0x9b86('0x38')]?_0x11b4cb[_0x9b86('0x37')]:_0x5832cc['model'];if(_0x3490a1[_0x9b86('0x33')][_0x9b86('0x42')]){_0x11b4cb[_0x9b86('0x43')]=[{'all':!![]}];}_0x11b4cb=_[_0x9b86('0x3f')]({},_0x11b4cb,_0x3490a1[_0x9b86('0x40')]);return db[_0x9b86('0x2e')][_0x9b86('0x49')](_0x11b4cb)[_0x9b86('0x29')](handleEntityNotFound(_0x584701,null))[_0x9b86('0x29')](respondWithResult(_0x584701,null))[_0x9b86('0x4a')](handleError(_0x584701,null));};exports[_0x9b86('0x4b')]=function(_0x36c295,_0x33e84f){return db[_0x9b86('0x2e')][_0x9b86('0x4b')](_0x36c295[_0x9b86('0x4c')],{})[_0x9b86('0x29')](respondWithResult(_0x33e84f,0xc9))['catch'](handleError(_0x33e84f,null));};exports[_0x9b86('0x4d')]=function(_0x1fbd4e,_0x4f90ea){if(_0x1fbd4e[_0x9b86('0x4c')]['id']){delete _0x1fbd4e[_0x9b86('0x4c')]['id'];}return db[_0x9b86('0x2e')][_0x9b86('0x49')]({'where':{'id':_0x1fbd4e['params']['id']}})[_0x9b86('0x29')](handleEntityNotFound(_0x4f90ea,null))[_0x9b86('0x29')](saveUpdates(_0x1fbd4e[_0x9b86('0x4c')],null))['then'](respondWithResult(_0x4f90ea,null))[_0x9b86('0x4a')](handleError(_0x4f90ea,null));};exports[_0x9b86('0x4e')]=function(_0x41b3ca,_0x2d9493){return db['VtigerConfiguration'][_0x9b86('0x49')]({'where':{'id':_0x41b3ca['params']['id']}})['then'](handleEntityNotFound(_0x2d9493,null))[_0x9b86('0x29')](removeEntity(_0x2d9493,null))['catch'](handleError(_0x2d9493,null));};exports['getFields']=function(_0xba9ed4,_0xa6400b,_0x305499){var _0x3a7836={};var _0x1cdb32={};var _0x622351;var _0x5a96b3;return db[_0x9b86('0x2e')][_0x9b86('0x4f')]({'where':{'id':_0xba9ed4[_0x9b86('0x46')]['id']}})[_0x9b86('0x29')](handleEntityNotFound(_0xa6400b,null))[_0x9b86('0x29')](function(_0x2ea657){if(_0x2ea657){_0x622351=_0x2ea657;_0x1cdb32[_0x9b86('0x32')]=_['keys'](db['VtigerField'][_0x9b86('0x47')]);_0x1cdb32[_0x9b86('0x33')]=_[_0x9b86('0x34')](_0xba9ed4[_0x9b86('0x33')]);_0x1cdb32[_0x9b86('0x35')]=_[_0x9b86('0x36')](_0x1cdb32[_0x9b86('0x32')],_0x1cdb32[_0x9b86('0x33')]);_0x3a7836[_0x9b86('0x37')]=_[_0x9b86('0x36')](_0x1cdb32[_0x9b86('0x32')],qs[_0x9b86('0x48')](_0xba9ed4[_0x9b86('0x33')][_0x9b86('0x48')]));_0x3a7836['attributes']=_0x3a7836['attributes'][_0x9b86('0x38')]?_0x3a7836['attributes']:_0x1cdb32[_0x9b86('0x32')];_0x3a7836[_0x9b86('0x3b')]=qs[_0x9b86('0x50')](_0xba9ed4[_0x9b86('0x33')]['sort']);_0x3a7836[_0x9b86('0x3e')]=qs[_0x9b86('0x35')](_[_0x9b86('0x3c')](_0xba9ed4[_0x9b86('0x33')],_0x1cdb32['filters']));if(_0xba9ed4[_0x9b86('0x33')][_0x9b86('0x3d')]){_0x3a7836[_0x9b86('0x3e')]=_[_0x9b86('0x3f')](_0x3a7836[_0x9b86('0x3e')],{'$or':_[_0x9b86('0x2d')](_0x3a7836[_0x9b86('0x37')],function(_0x1df74b){var _0x503336={};_0x503336[_0x1df74b]={'$like':'%'+_0xba9ed4[_0x9b86('0x33')][_0x9b86('0x3d')]+'%'};return _0x503336;})});}_0x3a7836=_[_0x9b86('0x3f')]({},_0x3a7836,_0xba9ed4[_0x9b86('0x40')]);return _0x622351[_0x9b86('0x51')](_0x3a7836);}})['then'](function(_0x55389f){if(_0x55389f){_0x5a96b3=_0x55389f['length'];if(!_0xba9ed4[_0x9b86('0x33')][_0x9b86('0x39')]('nolimit')){_0x3a7836[_0x9b86('0x24')]=qs['limit'](_0xba9ed4[_0x9b86('0x33')][_0x9b86('0x24')]);_0x3a7836[_0x9b86('0x23')]=qs['offset'](_0xba9ed4[_0x9b86('0x33')][_0x9b86('0x23')]);}return _0x622351[_0x9b86('0x51')](_0x3a7836);}})[_0x9b86('0x29')](function(_0x487e75){if(_0x487e75){return _0x487e75?{'count':_0x5a96b3,'rows':_0x487e75}:null;}})[_0x9b86('0x29')](respondWithResult(_0xa6400b,null))[_0x9b86('0x4a')](handleError(_0xa6400b,null));};exports[_0x9b86('0x52')]=function(_0x5b76fb,_0x383b2e,_0x1984fc){var _0x244d6d={};var _0x4d05cf={};var _0x539c77;var _0x4f503c;return db[_0x9b86('0x2e')]['findOne']({'where':{'id':_0x5b76fb[_0x9b86('0x46')]['id']}})['then'](handleEntityNotFound(_0x383b2e,null))[_0x9b86('0x29')](function(_0x5bfc5c){if(_0x5bfc5c){_0x539c77=_0x5bfc5c;_0x4d05cf[_0x9b86('0x32')]=_[_0x9b86('0x34')](db[_0x9b86('0x53')][_0x9b86('0x47')]);_0x4d05cf[_0x9b86('0x33')]=_[_0x9b86('0x34')](_0x5b76fb[_0x9b86('0x33')]);_0x4d05cf[_0x9b86('0x35')]=_[_0x9b86('0x36')](_0x4d05cf['model'],_0x4d05cf[_0x9b86('0x33')]);_0x244d6d[_0x9b86('0x37')]=_[_0x9b86('0x36')](_0x4d05cf[_0x9b86('0x32')],qs[_0x9b86('0x48')](_0x5b76fb['query'][_0x9b86('0x48')]));_0x244d6d[_0x9b86('0x37')]=_0x244d6d['attributes'][_0x9b86('0x38')]?_0x244d6d[_0x9b86('0x37')]:_0x4d05cf[_0x9b86('0x32')];_0x244d6d[_0x9b86('0x3b')]=qs[_0x9b86('0x50')](_0x5b76fb[_0x9b86('0x33')][_0x9b86('0x50')]);_0x244d6d[_0x9b86('0x3e')]=qs[_0x9b86('0x35')](_['pick'](_0x5b76fb[_0x9b86('0x33')],_0x4d05cf[_0x9b86('0x35')]));if(_0x5b76fb[_0x9b86('0x33')]['filter']){_0x244d6d[_0x9b86('0x3e')]=_[_0x9b86('0x3f')](_0x244d6d[_0x9b86('0x3e')],{'$or':_['map'](_0x244d6d[_0x9b86('0x37')],function(_0x2fdd57){var _0x57a299={};_0x57a299[_0x2fdd57]={'$like':'%'+_0x5b76fb['query'][_0x9b86('0x3d')]+'%'};return _0x57a299;})});}_0x244d6d=_['merge']({},_0x244d6d,_0x5b76fb[_0x9b86('0x40')]);return _0x539c77[_0x9b86('0x52')](_0x244d6d);}})[_0x9b86('0x29')](function(_0x2bb2e4){if(_0x2bb2e4){_0x4f503c=_0x2bb2e4[_0x9b86('0x38')];if(!_0x5b76fb[_0x9b86('0x33')]['hasOwnProperty'](_0x9b86('0x3a'))){_0x244d6d[_0x9b86('0x24')]=qs[_0x9b86('0x24')](_0x5b76fb[_0x9b86('0x33')]['limit']);_0x244d6d['offset']=qs['offset'](_0x5b76fb[_0x9b86('0x33')][_0x9b86('0x23')]);}return _0x539c77[_0x9b86('0x52')](_0x244d6d);}})[_0x9b86('0x29')](function(_0x7eab2c){if(_0x7eab2c){return _0x7eab2c?{'count':_0x4f503c,'rows':_0x7eab2c}:null;}})[_0x9b86('0x29')](respondWithResult(_0x383b2e,null))[_0x9b86('0x4a')](handleError(_0x383b2e,null));};exports[_0x9b86('0x54')]=function(_0x2a71db,_0x5d1567,_0x33d48d){var _0x4e71fb={};var _0x1b92c6={};var _0x194b07;var _0xf3e77d;return db['VtigerConfiguration'][_0x9b86('0x4f')]({'where':{'id':_0x2a71db[_0x9b86('0x46')]['id']}})['then'](handleEntityNotFound(_0x5d1567,null))[_0x9b86('0x29')](function(_0x26ac65){if(_0x26ac65){_0x194b07=_0x26ac65;_0x1b92c6['model']=_[_0x9b86('0x34')](db['VtigerField'][_0x9b86('0x47')]);_0x1b92c6[_0x9b86('0x33')]=_[_0x9b86('0x34')](_0x2a71db[_0x9b86('0x33')]);_0x1b92c6[_0x9b86('0x35')]=_[_0x9b86('0x36')](_0x1b92c6[_0x9b86('0x32')],_0x1b92c6[_0x9b86('0x33')]);_0x4e71fb[_0x9b86('0x37')]=_[_0x9b86('0x36')](_0x1b92c6[_0x9b86('0x32')],qs[_0x9b86('0x48')](_0x2a71db[_0x9b86('0x33')][_0x9b86('0x48')]));_0x4e71fb[_0x9b86('0x37')]=_0x4e71fb[_0x9b86('0x37')][_0x9b86('0x38')]?_0x4e71fb[_0x9b86('0x37')]:_0x1b92c6[_0x9b86('0x32')];_0x4e71fb[_0x9b86('0x3b')]=qs['sort'](_0x2a71db[_0x9b86('0x33')][_0x9b86('0x50')]);_0x4e71fb[_0x9b86('0x3e')]=qs['filters'](_[_0x9b86('0x3c')](_0x2a71db[_0x9b86('0x33')],_0x1b92c6['filters']));if(_0x2a71db[_0x9b86('0x33')][_0x9b86('0x3d')]){_0x4e71fb['where']=_['merge'](_0x4e71fb[_0x9b86('0x3e')],{'$or':_['map'](_0x4e71fb[_0x9b86('0x37')],function(_0x4e46ab){var _0x1e6ded={};_0x1e6ded[_0x4e46ab]={'$like':'%'+_0x2a71db[_0x9b86('0x33')][_0x9b86('0x3d')]+'%'};return _0x1e6ded;})});}_0x4e71fb=_[_0x9b86('0x3f')]({},_0x4e71fb,_0x2a71db[_0x9b86('0x40')]);return _0x194b07[_0x9b86('0x54')](_0x4e71fb);}})[_0x9b86('0x29')](function(_0x393308){if(_0x393308){_0xf3e77d=_0x393308[_0x9b86('0x38')];if(!_0x2a71db['query']['hasOwnProperty'](_0x9b86('0x3a'))){_0x4e71fb['limit']=qs['limit'](_0x2a71db[_0x9b86('0x33')][_0x9b86('0x24')]);_0x4e71fb[_0x9b86('0x23')]=qs['offset'](_0x2a71db[_0x9b86('0x33')][_0x9b86('0x23')]);}return _0x194b07[_0x9b86('0x54')](_0x4e71fb);}})[_0x9b86('0x29')](function(_0x3d4b5f){if(_0x3d4b5f){return _0x3d4b5f?{'count':_0xf3e77d,'rows':_0x3d4b5f}:null;}})[_0x9b86('0x29')](respondWithResult(_0x5d1567,null))[_0x9b86('0x4a')](handleError(_0x5d1567,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index 03e0d0c..64a365c 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 _0x19ac=['util','api','moment','request-promise','path','rimraf','./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration','int_vtiger_configurations'];(function(_0x2644f8,_0x40977c){var _0x233fea=function(_0x308f49){while(--_0x308f49){_0x2644f8['push'](_0x2644f8['shift']());}};_0x233fea(++_0x40977c);}(_0x19ac,0x134));var _0xc19a=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0x19ac[_0x2c7618];return _0x5ce3f0;};'use strict';var _=require('lodash');var util=require(_0xc19a('0x0'));var logger=require('../../config/logger')(_0xc19a('0x1'));var moment=require(_0xc19a('0x2'));var BPromise=require('bluebird');var rp=require(_0xc19a('0x3'));var fs=require('fs');var path=require(_0xc19a('0x4'));var rimraf=require(_0xc19a('0x5'));var config=require('../../config/environment');var attributes=require(_0xc19a('0x6'));module[_0xc19a('0x7')]=function(_0x3fb44e,_0x4dc37e){return _0x3fb44e[_0xc19a('0x8')](_0xc19a('0x9'),attributes,{'tableName':_0xc19a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbe4b=['../../config/logger','api','moment','rimraf','./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration','int_vtiger_configurations','util'];(function(_0x517aba,_0x4814e5){var _0x246abe=function(_0x36b7a9){while(--_0x36b7a9){_0x517aba['push'](_0x517aba['shift']());}};_0x246abe(++_0x4814e5);}(_0xbe4b,0x149));var _0xbbe4=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0xbe4b[_0x51020b];return _0x371e47;};'use strict';var _=require('lodash');var util=require(_0xbbe4('0x0'));var logger=require(_0xbbe4('0x1'))(_0xbbe4('0x2'));var moment=require(_0xbbe4('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xbbe4('0x4'));var config=require('../../config/environment');var attributes=require(_0xbbe4('0x5'));module[_0xbbe4('0x6')]=function(_0x39b811,_0x5f106a){return _0x39b811[_0xbbe4('0x7')](_0xbbe4('0x8'),attributes,{'tableName':_0xbbe4('0x9'),'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 5da3d6a..9c47836 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 _0x3924=['rpc','jayson/promise','client','http','request','then','info','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','VtigerConfiguration,\x20%s,\x20%s','message','result','catch','bluebird','ioredis','../../config/utils','../../config/logger'];(function(_0x51d7a7,_0x3a1285){var _0x52dcba=function(_0x393ac2){while(--_0x393ac2){_0x51d7a7['push'](_0x51d7a7['shift']());}};_0x52dcba(++_0x3a1285);}(_0x3924,0xce));var _0x4392=function(_0x2451ff,_0x2681db){_0x2451ff=_0x2451ff-0x0;var _0x476a41=_0x3924[_0x2451ff];return _0x476a41;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x4392('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4392('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0x4392('0x2'));var logger=require(_0x4392('0x3'))(_0x4392('0x4'));var config=require('../../config/environment');var jayson=require(_0x4392('0x5'));var client=jayson[_0x4392('0x6')][_0x4392('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4dc631,_0x5f485e,_0x35b066){return new BPromise(function(_0x19f012,_0x3d6591){return client[_0x4392('0x8')](_0x4dc631,_0x35b066)[_0x4392('0x9')](function(_0x133a17){logger[_0x4392('0xa')]('VtigerConfiguration,\x20%s,\x20%s',_0x5f485e,'request\x20sent');logger[_0x4392('0xb')](_0x4392('0xc'),_0x5f485e,_0x4392('0xd'),JSON[_0x4392('0xe')](_0x133a17));if(_0x133a17[_0x4392('0xf')]){if(_0x133a17[_0x4392('0xf')][_0x4392('0x10')]===0x1f4){logger[_0x4392('0xf')](_0x4392('0x11'),_0x5f485e,_0x133a17[_0x4392('0xf')][_0x4392('0x12')]);return _0x3d6591(_0x133a17[_0x4392('0xf')][_0x4392('0x12')]);}logger[_0x4392('0xf')](_0x4392('0x11'),_0x5f485e,_0x133a17[_0x4392('0xf')][_0x4392('0x12')]);return _0x19f012(_0x133a17[_0x4392('0xf')][_0x4392('0x12')]);}else{logger['info'](_0x4392('0x11'),_0x5f485e,_0x4392('0xd'));_0x19f012(_0x133a17[_0x4392('0x13')][_0x4392('0x12')]);}})[_0x4392('0x14')](function(_0x338776){logger[_0x4392('0xf')](_0x4392('0x11'),_0x5f485e,_0x338776);_0x3d6591(_0x338776);});});} \ No newline at end of file +var _0x133c=['request','then','info','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','error','code','VtigerConfiguration,\x20%s,\x20%s','message','request\x20sent','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3022b1,_0x33bc87){var _0x11518f=function(_0x5c0de4){while(--_0x5c0de4){_0x3022b1['push'](_0x3022b1['shift']());}};_0x11518f(++_0x33bc87);}(_0x133c,0x1c2));var _0xc133=function(_0x1f7a7e,_0x3ac087){_0x1f7a7e=_0x1f7a7e-0x0;var _0x18f367=_0x133c[_0x1f7a7e];return _0x18f367;};'use strict';var _=require(_0xc133('0x0'));var util=require(_0xc133('0x1'));var moment=require(_0xc133('0x2'));var BPromise=require(_0xc133('0x3'));var rs=require(_0xc133('0x4'));var fs=require('fs');var Redis=require(_0xc133('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc133('0x6'));var logger=require(_0xc133('0x7'))(_0xc133('0x8'));var config=require(_0xc133('0x9'));var jayson=require(_0xc133('0xa'));var client=jayson['client'][_0xc133('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2923db,_0x1d0c30,_0x179f83){return new BPromise(function(_0x1565f1,_0x2f5e00){return client[_0xc133('0xc')](_0x2923db,_0x179f83)[_0xc133('0xd')](function(_0x1d7404){logger[_0xc133('0xe')]('VtigerConfiguration,\x20%s,\x20%s',_0x1d0c30,'request\x20sent');logger[_0xc133('0xf')](_0xc133('0x10'),_0x1d0c30,'request\x20sent',JSON['stringify'](_0x1d7404));if(_0x1d7404['error']){if(_0x1d7404[_0xc133('0x11')][_0xc133('0x12')]===0x1f4){logger[_0xc133('0x11')](_0xc133('0x13'),_0x1d0c30,_0x1d7404[_0xc133('0x11')][_0xc133('0x14')]);return _0x2f5e00(_0x1d7404[_0xc133('0x11')]['message']);}logger[_0xc133('0x11')](_0xc133('0x13'),_0x1d0c30,_0x1d7404['error'][_0xc133('0x14')]);return _0x1565f1(_0x1d7404[_0xc133('0x11')]['message']);}else{logger[_0xc133('0xe')](_0xc133('0x13'),_0x1d0c30,_0xc133('0x15'));_0x1565f1(_0x1d7404['result'][_0xc133('0x14')]);}})['catch'](function(_0x57e417){logger['error']('VtigerConfiguration,\x20%s,\x20%s',_0x1d0c30,_0x57e417);_0x2f5e00(_0x57e417);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index c2199ab..01e9163 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 _0xd150=['destroy','multer','util','path','connect-timeout','express','../../components/interaction/service','./intVtigerField.controller','get','isAuthenticated','/:id','show','create','put','update','delete'];(function(_0x25fc5e,_0x3e5425){var _0x300001=function(_0x33e59e){while(--_0x33e59e){_0x25fc5e['push'](_0x25fc5e['shift']());}};_0x300001(++_0x3e5425);}(_0xd150,0x1f1));var _0x0d15=function(_0x56827a,_0x34b0d3){_0x56827a=_0x56827a-0x0;var _0x1629be=_0xd150[_0x56827a];return _0x1629be;};'use strict';var multer=require(_0x0d15('0x0'));var util=require(_0x0d15('0x1'));var path=require(_0x0d15('0x2'));var timeout=require(_0x0d15('0x3'));var express=require(_0x0d15('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x0d15('0x5'));var config=require('../../config/environment');var controller=require(_0x0d15('0x6'));router[_0x0d15('0x7')]('/',auth[_0x0d15('0x8')](),controller['index']);router[_0x0d15('0x7')](_0x0d15('0x9'),auth['isAuthenticated'](),controller[_0x0d15('0xa')]);router['post']('/',auth[_0x0d15('0x8')](),controller[_0x0d15('0xb')]);router[_0x0d15('0xc')]('/:id',auth[_0x0d15('0x8')](),controller[_0x0d15('0xd')]);router[_0x0d15('0xe')]('/:id',auth[_0x0d15('0x8')](),controller[_0x0d15('0xf')]);module['exports']=router; \ No newline at end of file +var _0x6874=['../../config/environment','./intVtigerField.controller','index','get','/:id','isAuthenticated','post','create','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x396f6a,_0x804e0c){var _0x1a3a53=function(_0x352196){while(--_0x352196){_0x396f6a['push'](_0x396f6a['shift']());}};_0x1a3a53(++_0x804e0c);}(_0x6874,0x133));var _0x4687=function(_0x180fda,_0x1af14f){_0x180fda=_0x180fda-0x0;var _0x3bddc9=_0x6874[_0x180fda];return _0x3bddc9;};'use strict';var multer=require(_0x4687('0x0'));var util=require(_0x4687('0x1'));var path=require(_0x4687('0x2'));var timeout=require('connect-timeout');var express=require(_0x4687('0x3'));var router=express[_0x4687('0x4')]();var fs_extra=require(_0x4687('0x5'));var auth=require(_0x4687('0x6'));var interaction=require(_0x4687('0x7'));var config=require(_0x4687('0x8'));var controller=require(_0x4687('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x4687('0xa')]);router[_0x4687('0xb')](_0x4687('0xc'),auth[_0x4687('0xd')](),controller['show']);router[_0x4687('0xe')]('/',auth['isAuthenticated'](),controller[_0x4687('0xf')]);router[_0x4687('0x10')](_0x4687('0xc'),auth[_0x4687('0xd')](),controller[_0x4687('0x11')]);router[_0x4687('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x4687('0x13')]);module[_0x4687('0x14')]=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index 22e3aa2..6c3a80e 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 _0xe3d4=['sequelize','exports','ENUM','string','variable','keyValue','STRING','customVariable'];(function(_0x3d5cdc,_0x43ff0d){var _0x5c4aaa=function(_0x442b1a){while(--_0x442b1a){_0x3d5cdc['push'](_0x3d5cdc['shift']());}};_0x5c4aaa(++_0x43ff0d);}(_0xe3d4,0xe0));var _0x4e3d=function(_0x4f66c2,_0x47d4ed){_0x4f66c2=_0x4f66c2-0x0;var _0x447633=_0xe3d4[_0x4f66c2];return _0x447633;};'use strict';var Sequelize=require(_0x4e3d('0x0'));module[_0x4e3d('0x1')]={'type':{'type':Sequelize[_0x4e3d('0x2')](_0x4e3d('0x3'),_0x4e3d('0x4'),'customVariable',_0x4e3d('0x5'),'picklist'),'defaultValue':_0x4e3d('0x3')},'content':{'type':Sequelize[_0x4e3d('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x4e3d('0x2')](_0x4e3d('0x3'),_0x4e3d('0x4'),_0x4e3d('0x7'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x4e3d('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x4e3d('0x6')]}}; \ No newline at end of file +var _0xeb42=['exports','ENUM','string','variable','customVariable','keyValue','STRING','BOOLEAN'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xeb42,0x1e0));var _0x2eb4=function(_0xa8883,_0x1f107f){_0xa8883=_0xa8883-0x0;var _0x479426=_0xeb42[_0xa8883];return _0x479426;};'use strict';var Sequelize=require('sequelize');module[_0x2eb4('0x0')]={'type':{'type':Sequelize[_0x2eb4('0x1')](_0x2eb4('0x2'),_0x2eb4('0x3'),_0x2eb4('0x4'),_0x2eb4('0x5'),'picklist'),'defaultValue':_0x2eb4('0x2')},'content':{'type':Sequelize[_0x2eb4('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM']('string',_0x2eb4('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x2eb4('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x2eb4('0x6')]},'customField':{'type':Sequelize[_0x2eb4('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2eb4('0x6')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index d6baf3f..9a7a20c 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 _0xb20c=['ejs','fs-extra','lodash','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','offset','set','Content-Range','json','reject','save','then','destroy','name','send','index','map','VtigerField','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','VIRTUAL','filter','options','count','includeAll','include','findAll','rows','show','params','find','catch','create','body','rimraf','zip-dir','fast-json-patch','request-promise','util','path','to-csv'];(function(_0x486a0f,_0x56a6ec){var _0xe3a726=function(_0x183ce7){while(--_0x183ce7){_0x486a0f['push'](_0x486a0f['shift']());}};_0xe3a726(++_0x56a6ec);}(_0xb20c,0xce));var _0xcb20=function(_0x29fb42,_0x4fbc0c){_0x29fb42=_0x29fb42-0x0;var _0x51188e=_0xb20c[_0x29fb42];return _0x51188e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcb20('0x0'));var zipdir=require(_0xcb20('0x1'));var jsonpatch=require(_0xcb20('0x2'));var rp=require(_0xcb20('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xcb20('0x4'));var path=require(_0xcb20('0x5'));var sox=require('sox');var csv=require(_0xcb20('0x6'));var ejs=require(_0xcb20('0x7'));var fs=require('fs');var fs_extra=require(_0xcb20('0x8'));var _=require(_0xcb20('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xcb20('0xa'));var toCsv=require('to-csv');var querystring=require(_0xcb20('0xb'));var Papa=require(_0xcb20('0xc'));var Redis=require(_0xcb20('0xd'));var authService=require(_0xcb20('0xe'));var qs=require(_0xcb20('0xf'));var as=require(_0xcb20('0x10'));var hardwareService=require(_0xcb20('0x11'));var logger=require('../../config/logger')(_0xcb20('0x12'));var utils=require(_0xcb20('0x13'));var config=require(_0xcb20('0x14'));var licenseUtil=require(_0xcb20('0x15'));var db=require(_0xcb20('0x16'))['db'];function respondWithStatusCode(_0x12550c,_0x55e51b){_0x55e51b=_0x55e51b||0xcc;return function(_0x405e64){if(_0x405e64){return _0x12550c[_0xcb20('0x17')](_0x55e51b);}return _0x12550c[_0xcb20('0x18')](_0x55e51b)[_0xcb20('0x19')]();};}function respondWithResult(_0x3c33d2,_0x908516){_0x908516=_0x908516||0xc8;return function(_0x356928){if(_0x356928){return _0x3c33d2[_0xcb20('0x18')](_0x908516)['json'](_0x356928);}};}function respondWithFilteredResult(_0x17a308,_0x485ebf){return function(_0x4ad36c){if(_0x4ad36c){var _0x231686=typeof _0x485ebf['offset']===_0xcb20('0x1a')&&typeof _0x485ebf[_0xcb20('0x1b')]===_0xcb20('0x1a');var _0x139b33=_0x4ad36c['count'];var _0x43e203=_0x231686?0x0:_0x485ebf[_0xcb20('0x1c')];var _0x51fa7a=_0x231686?_0x4ad36c['count']:_0x485ebf[_0xcb20('0x1c')]+_0x485ebf['limit'];var _0x20e807;if(_0x51fa7a>=_0x139b33){_0x51fa7a=_0x139b33;_0x20e807=0xc8;}else{_0x20e807=0xce;}_0x17a308[_0xcb20('0x18')](_0x20e807);return _0x17a308[_0xcb20('0x1d')](_0xcb20('0x1e'),_0x43e203+'-'+_0x51fa7a+'/'+_0x139b33)[_0xcb20('0x1f')](_0x4ad36c);}return null;};}function patchUpdates(_0x448234){return function(_0x5f226b){try{jsonpatch['apply'](_0x5f226b,_0x448234,!![]);}catch(_0x40b6f4){return BPromise[_0xcb20('0x20')](_0x40b6f4);}return _0x5f226b[_0xcb20('0x21')]();};}function saveUpdates(_0x20a301,_0x45bde7){return function(_0x17146c){if(_0x17146c){return _0x17146c['update'](_0x20a301)[_0xcb20('0x22')](function(_0x5aec79){return _0x5aec79;});}return null;};}function removeEntity(_0x20d335,_0x33c744){return function(_0x1706b7){if(_0x1706b7){return _0x1706b7[_0xcb20('0x23')]()['then'](function(){_0x20d335['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3bb628,_0x216849){return function(_0x1fcac7){if(!_0x1fcac7){_0x3bb628[_0xcb20('0x17')](0x194);}return _0x1fcac7;};}function handleError(_0x31dcad,_0x17358f){_0x17358f=_0x17358f||0x1f4;return function(_0x26def3){logger['error'](_0x26def3['stack']);if(_0x26def3[_0xcb20('0x24')]){delete _0x26def3['name'];}_0x31dcad['status'](_0x17358f)[_0xcb20('0x25')](_0x26def3);};}exports[_0xcb20('0x26')]=function(_0x5e7725,_0x22678e){var _0x2e00cb={},_0x578423={},_0x3bc2f8={'count':0x0,'rows':[]};var _0x7b9be=_[_0xcb20('0x27')](db[_0xcb20('0x28')][_0xcb20('0x29')],function(_0x10b186){return{'name':_0x10b186[_0xcb20('0x2a')],'type':_0x10b186[_0xcb20('0x2b')][_0xcb20('0x2c')]};});_0x578423[_0xcb20('0x2d')]=_[_0xcb20('0x27')](_0x7b9be,'name');_0x578423['query']=_[_0xcb20('0x2e')](_0x5e7725[_0xcb20('0x2f')]);_0x578423[_0xcb20('0x30')]=_[_0xcb20('0x31')](_0x578423[_0xcb20('0x2d')],_0x578423['query']);_0x2e00cb[_0xcb20('0x32')]=_['intersection'](_0x578423[_0xcb20('0x2d')],qs[_0xcb20('0x33')](_0x5e7725[_0xcb20('0x2f')]['fields']));_0x2e00cb[_0xcb20('0x32')]=_0x2e00cb['attributes'][_0xcb20('0x34')]?_0x2e00cb['attributes']:_0x578423[_0xcb20('0x2d')];if(!_0x5e7725[_0xcb20('0x2f')]['hasOwnProperty'](_0xcb20('0x35'))){_0x2e00cb[_0xcb20('0x1b')]=qs[_0xcb20('0x1b')](_0x5e7725[_0xcb20('0x2f')]['limit']);_0x2e00cb[_0xcb20('0x1c')]=qs['offset'](_0x5e7725['query'][_0xcb20('0x1c')]);}_0x2e00cb['order']=qs[_0xcb20('0x36')](_0x5e7725[_0xcb20('0x2f')]['sort']);_0x2e00cb[_0xcb20('0x37')]=qs[_0xcb20('0x30')](_[_0xcb20('0x38')](_0x5e7725['query'],_0x578423[_0xcb20('0x30')]),_0x7b9be);if(_0x5e7725[_0xcb20('0x2f')]['filter']){_0x2e00cb[_0xcb20('0x37')]=_['merge'](_0x2e00cb['where'],{'$or':_[_0xcb20('0x27')](_0x7b9be,function(_0x2de426){if(_0x2de426[_0xcb20('0x2b')]!==_0xcb20('0x39')){var _0xe00b2f={};_0xe00b2f[_0x2de426[_0xcb20('0x24')]]={'$like':'%'+_0x5e7725['query'][_0xcb20('0x3a')]+'%'};return _0xe00b2f;}})});}_0x2e00cb=_['merge']({},_0x2e00cb,_0x5e7725[_0xcb20('0x3b')]);var _0x5055e3={'where':_0x2e00cb[_0xcb20('0x37')]};return db[_0xcb20('0x28')][_0xcb20('0x3c')](_0x5055e3)[_0xcb20('0x22')](function(_0x5d8357){_0x3bc2f8[_0xcb20('0x3c')]=_0x5d8357;if(_0x5e7725['query'][_0xcb20('0x3d')]){_0x2e00cb[_0xcb20('0x3e')]=[{'all':!![]}];}return db[_0xcb20('0x28')][_0xcb20('0x3f')](_0x2e00cb);})[_0xcb20('0x22')](function(_0x34b0eb){_0x3bc2f8[_0xcb20('0x40')]=_0x34b0eb;return _0x3bc2f8;})[_0xcb20('0x22')](respondWithFilteredResult(_0x22678e,_0x2e00cb))['catch'](handleError(_0x22678e,null));};exports[_0xcb20('0x41')]=function(_0x41ed83,_0x1dc093){var _0x363293={'raw':!![],'where':{'id':_0x41ed83[_0xcb20('0x42')]['id']}},_0x94b022={};_0x94b022[_0xcb20('0x2d')]=_[_0xcb20('0x2e')](db['VtigerField'][_0xcb20('0x29')]);_0x94b022[_0xcb20('0x2f')]=_[_0xcb20('0x2e')](_0x41ed83[_0xcb20('0x2f')]);_0x94b022[_0xcb20('0x30')]=_[_0xcb20('0x31')](_0x94b022[_0xcb20('0x2d')],_0x94b022[_0xcb20('0x2f')]);_0x363293[_0xcb20('0x32')]=_['intersection'](_0x94b022[_0xcb20('0x2d')],qs[_0xcb20('0x33')](_0x41ed83[_0xcb20('0x2f')][_0xcb20('0x33')]));_0x363293['attributes']=_0x363293['attributes'][_0xcb20('0x34')]?_0x363293['attributes']:_0x94b022['model'];if(_0x41ed83['query'][_0xcb20('0x3d')]){_0x363293['include']=[{'all':!![]}];}_0x363293=_['merge']({},_0x363293,_0x41ed83[_0xcb20('0x3b')]);return db['VtigerField'][_0xcb20('0x43')](_0x363293)['then'](handleEntityNotFound(_0x1dc093,null))[_0xcb20('0x22')](respondWithResult(_0x1dc093,null))[_0xcb20('0x44')](handleError(_0x1dc093,null));};exports[_0xcb20('0x45')]=function(_0x7f3761,_0x279d5d){return db[_0xcb20('0x28')][_0xcb20('0x45')](_0x7f3761['body'],{})[_0xcb20('0x22')](respondWithResult(_0x279d5d,0xc9))[_0xcb20('0x44')](handleError(_0x279d5d,null));};exports['update']=function(_0x45a434,_0x13e2d1){if(_0x45a434[_0xcb20('0x46')]['id']){delete _0x45a434[_0xcb20('0x46')]['id'];}return db[_0xcb20('0x28')][_0xcb20('0x43')]({'where':{'id':_0x45a434[_0xcb20('0x42')]['id']}})[_0xcb20('0x22')](handleEntityNotFound(_0x13e2d1,null))['then'](saveUpdates(_0x45a434['body'],null))['then'](respondWithResult(_0x13e2d1,null))[_0xcb20('0x44')](handleError(_0x13e2d1,null));};exports[_0xcb20('0x23')]=function(_0x4a169c,_0x59113d){return db[_0xcb20('0x28')][_0xcb20('0x43')]({'where':{'id':_0x4a169c[_0xcb20('0x42')]['id']}})[_0xcb20('0x22')](handleEntityNotFound(_0x59113d,null))[_0xcb20('0x22')](removeEntity(_0x59113d,null))[_0xcb20('0x44')](handleError(_0x59113d,null));}; \ No newline at end of file +var _0x18e4=['hasOwnProperty','nolimit','sort','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','create','body','find','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','lodash','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','VtigerField','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length'];(function(_0x13992d,_0x3029ea){var _0x3d15bf=function(_0x3444f7){while(--_0x3444f7){_0x13992d['push'](_0x13992d['shift']());}};_0x3d15bf(++_0x3029ea);}(_0x18e4,0x1ce));var _0x418e=function(_0x41cd34,_0x32cd0c){_0x41cd34=_0x41cd34-0x0;var _0x1273e8=_0x18e4[_0x41cd34];return _0x1273e8;};'use strict';var emlformat=require(_0x418e('0x0'));var rimraf=require(_0x418e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x418e('0x2'));var rp=require(_0x418e('0x3'));var moment=require(_0x418e('0x4'));var BPromise=require(_0x418e('0x5'));var Mustache=require('mustache');var util=require(_0x418e('0x6'));var path=require(_0x418e('0x7'));var sox=require('sox');var csv=require(_0x418e('0x8'));var ejs=require(_0x418e('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x418e('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x418e('0xb'));var toCsv=require(_0x418e('0x8'));var querystring=require(_0x418e('0xc'));var Papa=require(_0x418e('0xd'));var Redis=require(_0x418e('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x418e('0xf'));var as=require(_0x418e('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x418e('0x11'))(_0x418e('0x12'));var utils=require(_0x418e('0x13'));var config=require(_0x418e('0x14'));var licenseUtil=require(_0x418e('0x15'));var db=require(_0x418e('0x16'))['db'];function respondWithStatusCode(_0x582989,_0x546177){_0x546177=_0x546177||0xcc;return function(_0xfa642c){if(_0xfa642c){return _0x582989[_0x418e('0x17')](_0x546177);}return _0x582989['status'](_0x546177)[_0x418e('0x18')]();};}function respondWithResult(_0xdcb21d,_0x582894){_0x582894=_0x582894||0xc8;return function(_0x569ee4){if(_0x569ee4){return _0xdcb21d[_0x418e('0x19')](_0x582894)[_0x418e('0x1a')](_0x569ee4);}};}function respondWithFilteredResult(_0x4dae51,_0x2effc7){return function(_0x20bc19){if(_0x20bc19){var _0x436853=typeof _0x2effc7['offset']===_0x418e('0x1b')&&typeof _0x2effc7[_0x418e('0x1c')]==='undefined';var _0x178ed9=_0x20bc19['count'];var _0x31b892=_0x436853?0x0:_0x2effc7[_0x418e('0x1d')];var _0x31da96=_0x436853?_0x20bc19[_0x418e('0x1e')]:_0x2effc7[_0x418e('0x1d')]+_0x2effc7['limit'];var _0x5e4ebc;if(_0x31da96>=_0x178ed9){_0x31da96=_0x178ed9;_0x5e4ebc=0xc8;}else{_0x5e4ebc=0xce;}_0x4dae51['status'](_0x5e4ebc);return _0x4dae51[_0x418e('0x1f')](_0x418e('0x20'),_0x31b892+'-'+_0x31da96+'/'+_0x178ed9)[_0x418e('0x1a')](_0x20bc19);}return null;};}function patchUpdates(_0x104307){return function(_0x39dac3){try{jsonpatch[_0x418e('0x21')](_0x39dac3,_0x104307,!![]);}catch(_0x109015){return BPromise[_0x418e('0x22')](_0x109015);}return _0x39dac3[_0x418e('0x23')]();};}function saveUpdates(_0x545244,_0x3d33ef){return function(_0x36eb40){if(_0x36eb40){return _0x36eb40[_0x418e('0x24')](_0x545244)[_0x418e('0x25')](function(_0x371697){return _0x371697;});}return null;};}function removeEntity(_0x3342d3,_0x5e9baf){return function(_0x3924f2){if(_0x3924f2){return _0x3924f2[_0x418e('0x26')]()['then'](function(){_0x3342d3[_0x418e('0x19')](0xcc)[_0x418e('0x18')]();});}};}function handleEntityNotFound(_0x3e7eb3,_0xcaa91c){return function(_0x158c58){if(!_0x158c58){_0x3e7eb3[_0x418e('0x17')](0x194);}return _0x158c58;};}function handleError(_0x12d594,_0x4af1c1){_0x4af1c1=_0x4af1c1||0x1f4;return function(_0xcfa835){logger[_0x418e('0x27')](_0xcfa835[_0x418e('0x28')]);if(_0xcfa835[_0x418e('0x29')]){delete _0xcfa835[_0x418e('0x29')];}_0x12d594[_0x418e('0x19')](_0x4af1c1)[_0x418e('0x2a')](_0xcfa835);};}exports['index']=function(_0xb2ca98,_0x421b0e){var _0x30daea={},_0x4c1407={},_0x55fd05={'count':0x0,'rows':[]};var _0x3fd21b=_['map'](db[_0x418e('0x2b')][_0x418e('0x2c')],function(_0x314e1c){return{'name':_0x314e1c[_0x418e('0x2d')],'type':_0x314e1c[_0x418e('0x2e')][_0x418e('0x2f')]};});_0x4c1407[_0x418e('0x30')]=_['map'](_0x3fd21b,_0x418e('0x29'));_0x4c1407['query']=_[_0x418e('0x31')](_0xb2ca98[_0x418e('0x32')]);_0x4c1407[_0x418e('0x33')]=_[_0x418e('0x34')](_0x4c1407[_0x418e('0x30')],_0x4c1407[_0x418e('0x32')]);_0x30daea[_0x418e('0x35')]=_[_0x418e('0x34')](_0x4c1407[_0x418e('0x30')],qs[_0x418e('0x36')](_0xb2ca98['query'][_0x418e('0x36')]));_0x30daea[_0x418e('0x35')]=_0x30daea[_0x418e('0x35')][_0x418e('0x37')]?_0x30daea[_0x418e('0x35')]:_0x4c1407['model'];if(!_0xb2ca98['query'][_0x418e('0x38')](_0x418e('0x39'))){_0x30daea['limit']=qs[_0x418e('0x1c')](_0xb2ca98[_0x418e('0x32')]['limit']);_0x30daea[_0x418e('0x1d')]=qs[_0x418e('0x1d')](_0xb2ca98['query'][_0x418e('0x1d')]);}_0x30daea['order']=qs[_0x418e('0x3a')](_0xb2ca98[_0x418e('0x32')][_0x418e('0x3a')]);_0x30daea['where']=qs[_0x418e('0x33')](_['pick'](_0xb2ca98[_0x418e('0x32')],_0x4c1407['filters']),_0x3fd21b);if(_0xb2ca98[_0x418e('0x32')][_0x418e('0x3b')]){_0x30daea[_0x418e('0x3c')]=_[_0x418e('0x3d')](_0x30daea[_0x418e('0x3c')],{'$or':_['map'](_0x3fd21b,function(_0x4a8b3f){if(_0x4a8b3f[_0x418e('0x2e')]!==_0x418e('0x3e')){var _0x20ae34={};_0x20ae34[_0x4a8b3f[_0x418e('0x29')]]={'$like':'%'+_0xb2ca98['query']['filter']+'%'};return _0x20ae34;}})});}_0x30daea=_[_0x418e('0x3d')]({},_0x30daea,_0xb2ca98[_0x418e('0x3f')]);var _0x4708eb={'where':_0x30daea[_0x418e('0x3c')]};return db[_0x418e('0x2b')][_0x418e('0x1e')](_0x4708eb)['then'](function(_0xcd0c41){_0x55fd05[_0x418e('0x1e')]=_0xcd0c41;if(_0xb2ca98[_0x418e('0x32')][_0x418e('0x40')]){_0x30daea['include']=[{'all':!![]}];}return db[_0x418e('0x2b')][_0x418e('0x41')](_0x30daea);})[_0x418e('0x25')](function(_0xcea64b){_0x55fd05[_0x418e('0x42')]=_0xcea64b;return _0x55fd05;})[_0x418e('0x25')](respondWithFilteredResult(_0x421b0e,_0x30daea))[_0x418e('0x43')](handleError(_0x421b0e,null));};exports[_0x418e('0x44')]=function(_0x406dd8,_0x1d086f){var _0x2c74aa={'raw':!![],'where':{'id':_0x406dd8[_0x418e('0x45')]['id']}},_0x4ce22f={};_0x4ce22f[_0x418e('0x30')]=_[_0x418e('0x31')](db['VtigerField']['rawAttributes']);_0x4ce22f['query']=_[_0x418e('0x31')](_0x406dd8['query']);_0x4ce22f['filters']=_[_0x418e('0x34')](_0x4ce22f['model'],_0x4ce22f['query']);_0x2c74aa['attributes']=_[_0x418e('0x34')](_0x4ce22f[_0x418e('0x30')],qs[_0x418e('0x36')](_0x406dd8[_0x418e('0x32')][_0x418e('0x36')]));_0x2c74aa[_0x418e('0x35')]=_0x2c74aa[_0x418e('0x35')][_0x418e('0x37')]?_0x2c74aa['attributes']:_0x4ce22f[_0x418e('0x30')];if(_0x406dd8[_0x418e('0x32')][_0x418e('0x40')]){_0x2c74aa[_0x418e('0x46')]=[{'all':!![]}];}_0x2c74aa=_[_0x418e('0x3d')]({},_0x2c74aa,_0x406dd8[_0x418e('0x3f')]);return db['VtigerField']['find'](_0x2c74aa)[_0x418e('0x25')](handleEntityNotFound(_0x1d086f,null))[_0x418e('0x25')](respondWithResult(_0x1d086f,null))[_0x418e('0x43')](handleError(_0x1d086f,null));};exports[_0x418e('0x47')]=function(_0x754a6f,_0x261088){return db[_0x418e('0x2b')]['create'](_0x754a6f['body'],{})[_0x418e('0x25')](respondWithResult(_0x261088,0xc9))[_0x418e('0x43')](handleError(_0x261088,null));};exports[_0x418e('0x24')]=function(_0x5dc095,_0x3503b2){if(_0x5dc095['body']['id']){delete _0x5dc095[_0x418e('0x48')]['id'];}return db[_0x418e('0x2b')][_0x418e('0x49')]({'where':{'id':_0x5dc095['params']['id']}})[_0x418e('0x25')](handleEntityNotFound(_0x3503b2,null))['then'](saveUpdates(_0x5dc095['body'],null))[_0x418e('0x25')](respondWithResult(_0x3503b2,null))['catch'](handleError(_0x3503b2,null));};exports['destroy']=function(_0xad90a4,_0x2fdbad){return db['VtigerField'][_0x418e('0x49')]({'where':{'id':_0xad90a4[_0x418e('0x45')]['id']}})[_0x418e('0x25')](handleEntityNotFound(_0x2fdbad,null))[_0x418e('0x25')](removeEntity(_0x2fdbad,null))[_0x418e('0x43')](handleError(_0x2fdbad,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index 7398312..1384fe0 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 _0xe2ea=['idField','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','int_vtiger_fields','vtiger_unique_index'];(function(_0x8cc3e0,_0x5d04fc){var _0x5c7c7f=function(_0x396a06){while(--_0x396a06){_0x8cc3e0['push'](_0x8cc3e0['shift']());}};_0x5c7c7f(++_0x5d04fc);}(_0xe2ea,0xd3));var _0xae2e=function(_0x1a86f3,_0x21847a){_0x1a86f3=_0x1a86f3-0x0;var _0x399b06=_0xe2ea[_0x1a86f3];return _0x399b06;};'use strict';var _=require(_0xae2e('0x0'));var util=require(_0xae2e('0x1'));var logger=require('../../config/logger')(_0xae2e('0x2'));var moment=require(_0xae2e('0x3'));var BPromise=require(_0xae2e('0x4'));var rp=require(_0xae2e('0x5'));var fs=require('fs');var path=require(_0xae2e('0x6'));var rimraf=require(_0xae2e('0x7'));var config=require(_0xae2e('0x8'));var attributes=require('./intVtigerField.attributes');module[_0xae2e('0x9')]=function(_0x5421a9,_0xa3aa87){return _0x5421a9[_0xae2e('0xa')]('VtigerField',attributes,{'tableName':_0xae2e('0xb'),'paranoid':![],'indexes':[{'name':_0xae2e('0xc'),'fields':[_0xae2e('0xd'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf8ff=['path','rimraf','../../config/environment','./intVtigerField.attributes','exports','define','VtigerField','int_vtiger_fields','vtiger_unique_index','idField','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x315ad0,_0x163c6f){var _0x5c823c=function(_0x38f489){while(--_0x38f489){_0x315ad0['push'](_0x315ad0['shift']());}};_0x5c823c(++_0x163c6f);}(_0xf8ff,0x16a));var _0xff8f=function(_0x7feb90,_0x28e700){_0x7feb90=_0x7feb90-0x0;var _0x3c5b33=_0xf8ff[_0x7feb90];return _0x3c5b33;};'use strict';var _=require(_0xff8f('0x0'));var util=require('util');var logger=require(_0xff8f('0x1'))(_0xff8f('0x2'));var moment=require(_0xff8f('0x3'));var BPromise=require(_0xff8f('0x4'));var rp=require(_0xff8f('0x5'));var fs=require('fs');var path=require(_0xff8f('0x6'));var rimraf=require(_0xff8f('0x7'));var config=require(_0xff8f('0x8'));var attributes=require(_0xff8f('0x9'));module[_0xff8f('0xa')]=function(_0x12072a,_0x2d2a3f){return _0x12072a[_0xff8f('0xb')](_0xff8f('0xc'),attributes,{'tableName':_0xff8f('0xd'),'paranoid':![],'indexes':[{'name':_0xff8f('0xe'),'fields':[_0xff8f('0xf'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.rpc.js b/server/api/intVtigerField/intVtigerField.rpc.js index fc1ad31..b987de8 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 _0xcc6c=['error','code','message','VtigerField,\x20%s,\x20%s','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s'];(function(_0x1c3370,_0xf617e8){var _0xa9b358=function(_0x39cb44){while(--_0x39cb44){_0x1c3370['push'](_0x1c3370['shift']());}};_0xa9b358(++_0xf617e8);}(_0xcc6c,0x1bc));var _0xccc6=function(_0x29fc74,_0xcc4da1){_0x29fc74=_0x29fc74-0x0;var _0x501db8=_0xcc6c[_0x29fc74];return _0x501db8;};'use strict';var _=require(_0xccc6('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xccc6('0x1'));var rs=require(_0xccc6('0x2'));var fs=require('fs');var Redis=require(_0xccc6('0x3'));var db=require(_0xccc6('0x4'))['db'];var utils=require(_0xccc6('0x5'));var logger=require(_0xccc6('0x6'))(_0xccc6('0x7'));var config=require(_0xccc6('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xccc6('0x9')][_0xccc6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x335952,_0x29f43b,_0x33f69d){return new BPromise(function(_0x38ff1b,_0xf92d06){return client[_0xccc6('0xb')](_0x335952,_0x33f69d)['then'](function(_0x308d2b){logger[_0xccc6('0xc')]('VtigerField,\x20%s,\x20%s',_0x29f43b,_0xccc6('0xd'));logger[_0xccc6('0xe')](_0xccc6('0xf'),_0x29f43b,_0xccc6('0xd'),JSON['stringify'](_0x308d2b));if(_0x308d2b[_0xccc6('0x10')]){if(_0x308d2b['error'][_0xccc6('0x11')]===0x1f4){logger[_0xccc6('0x10')]('VtigerField,\x20%s,\x20%s',_0x29f43b,_0x308d2b[_0xccc6('0x10')][_0xccc6('0x12')]);return _0xf92d06(_0x308d2b[_0xccc6('0x10')][_0xccc6('0x12')]);}logger[_0xccc6('0x10')]('VtigerField,\x20%s,\x20%s',_0x29f43b,_0x308d2b[_0xccc6('0x10')][_0xccc6('0x12')]);return _0x38ff1b(_0x308d2b[_0xccc6('0x10')][_0xccc6('0x12')]);}else{logger[_0xccc6('0xc')]('VtigerField,\x20%s,\x20%s',_0x29f43b,'request\x20sent');_0x38ff1b(_0x308d2b['result'][_0xccc6('0x12')]);}})['catch'](function(_0x2d5972){logger[_0xccc6('0x10')](_0xccc6('0x13'),_0x29f43b,_0x2d5972);_0xf92d06(_0x2d5972);});});} \ No newline at end of file +var _0xdfdb=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VtigerField,\x20%s,\x20%s','request\x20sent','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','bluebird','randomstring','../../mysqldb'];(function(_0x1d939f,_0x2939dd){var _0x5d3f39=function(_0x317ec0){while(--_0x317ec0){_0x1d939f['push'](_0x1d939f['shift']());}};_0x5d3f39(++_0x2939dd);}(_0xdfdb,0x110));var _0xbdfd=function(_0x27604f,_0x5ae336){_0x27604f=_0x27604f-0x0;var _0x40d189=_0xdfdb[_0x27604f];return _0x40d189;};'use strict';var _=require(_0xbdfd('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xbdfd('0x1'));var rs=require(_0xbdfd('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbdfd('0x3'))['db'];var utils=require(_0xbdfd('0x4'));var logger=require(_0xbdfd('0x5'))(_0xbdfd('0x6'));var config=require(_0xbdfd('0x7'));var jayson=require(_0xbdfd('0x8'));var client=jayson[_0xbdfd('0x9')][_0xbdfd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x362b9f,_0x2b2867,_0x3d24cb){return new BPromise(function(_0x5d4ce1,_0x50bc4c){return client[_0xbdfd('0xb')](_0x362b9f,_0x3d24cb)[_0xbdfd('0xc')](function(_0x229e22){logger[_0xbdfd('0xd')](_0xbdfd('0xe'),_0x2b2867,_0xbdfd('0xf'));logger['debug'](_0xbdfd('0x10'),_0x2b2867,_0xbdfd('0xf'),JSON[_0xbdfd('0x11')](_0x229e22));if(_0x229e22[_0xbdfd('0x12')]){if(_0x229e22[_0xbdfd('0x12')][_0xbdfd('0x13')]===0x1f4){logger[_0xbdfd('0x12')]('VtigerField,\x20%s,\x20%s',_0x2b2867,_0x229e22['error']['message']);return _0x50bc4c(_0x229e22[_0xbdfd('0x12')][_0xbdfd('0x14')]);}logger['error'](_0xbdfd('0xe'),_0x2b2867,_0x229e22['error'][_0xbdfd('0x14')]);return _0x5d4ce1(_0x229e22[_0xbdfd('0x12')][_0xbdfd('0x14')]);}else{logger[_0xbdfd('0xd')](_0xbdfd('0xe'),_0x2b2867,'request\x20sent');_0x5d4ce1(_0x229e22[_0xbdfd('0x15')][_0xbdfd('0x14')]);}})[_0xbdfd('0x16')](function(_0x1e6e6d){logger[_0xbdfd('0x12')](_0xbdfd('0xe'),_0x2b2867,_0x1e6e6d);_0x50bc4c(_0x1e6e6d);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index 477a4ad..b18fc6b 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 _0x3576=['put','delete','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','/:id/configurations','addConfiguration'];(function(_0x59ebe8,_0x39c0e7){var _0x5a38f6=function(_0x48ec40){while(--_0x48ec40){_0x59ebe8['push'](_0x59ebe8['shift']());}};_0x5a38f6(++_0x39c0e7);}(_0x3576,0xe9));var _0x6357=function(_0x1ba06a,_0x5ceee2){_0x1ba06a=_0x1ba06a-0x0;var _0x5ef678=_0x3576[_0x1ba06a];return _0x5ef678;};'use strict';var multer=require('multer');var util=require(_0x6357('0x0'));var path=require(_0x6357('0x1'));var timeout=require(_0x6357('0x2'));var express=require(_0x6357('0x3'));var router=express['Router']();var fs_extra=require(_0x6357('0x4'));var auth=require(_0x6357('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x6357('0x6'));var controller=require('./intZendeskAccount.controller');router[_0x6357('0x7')]('/',auth[_0x6357('0x8')](),controller[_0x6357('0x9')]);router[_0x6357('0x7')](_0x6357('0xa'),auth[_0x6357('0x8')](),controller[_0x6357('0xb')]);router['get']('/:id/configurations',auth[_0x6357('0x8')](),controller[_0x6357('0xc')]);router[_0x6357('0x7')](_0x6357('0xd'),auth['isAuthenticated'](),controller[_0x6357('0xe')]);router[_0x6357('0xf')]('/',auth[_0x6357('0x8')](),controller[_0x6357('0x10')]);router[_0x6357('0xf')](_0x6357('0x11'),auth[_0x6357('0x8')](),controller[_0x6357('0x12')]);router[_0x6357('0x13')]('/:id',auth[_0x6357('0x8')](),controller['update']);router[_0x6357('0x14')](_0x6357('0xa'),auth[_0x6357('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x8390=['post','addConfiguration','put','/:id','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intZendeskAccount.controller','isAuthenticated','get','show','/:id/configurations','getConfigurations','/:id/fields','getFields'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0x8390,0xf8));var _0x0839=function(_0x1c3370,_0xf617e8){_0x1c3370=_0x1c3370-0x0;var _0xa9b358=_0x8390[_0x1c3370];return _0xa9b358;};'use strict';var multer=require(_0x0839('0x0'));var util=require(_0x0839('0x1'));var path=require('path');var timeout=require(_0x0839('0x2'));var express=require(_0x0839('0x3'));var router=express[_0x0839('0x4')]();var fs_extra=require(_0x0839('0x5'));var auth=require(_0x0839('0x6'));var interaction=require(_0x0839('0x7'));var config=require('../../config/environment');var controller=require(_0x0839('0x8'));router['get']('/',auth[_0x0839('0x9')](),controller['index']);router[_0x0839('0xa')]('/:id',auth[_0x0839('0x9')](),controller[_0x0839('0xb')]);router[_0x0839('0xa')](_0x0839('0xc'),auth['isAuthenticated'](),controller[_0x0839('0xd')]);router[_0x0839('0xa')](_0x0839('0xe'),auth[_0x0839('0x9')](),controller[_0x0839('0xf')]);router[_0x0839('0x10')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x0839('0xc'),auth['isAuthenticated'](),controller[_0x0839('0x11')]);router[_0x0839('0x12')](_0x0839('0x13'),auth['isAuthenticated'](),controller[_0x0839('0x14')]);router[_0x0839('0x15')](_0x0839('0x13'),auth[_0x0839('0x9')](),controller[_0x0839('0x16')]);module[_0x0839('0x17')]=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index b0b42ba..becc0ad 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 _0xfc46=['sequelize','STRING','remoteUri','password','token','ENUM','integrationTab'];(function(_0x212362,_0x3bfe87){var _0x3bdbec=function(_0x5261bc){while(--_0x5261bc){_0x212362['push'](_0x212362['shift']());}};_0x3bdbec(++_0x3bfe87);}(_0xfc46,0x9a));var _0x6fc4=function(_0x5bd4f6,_0xf4e45c){_0x5bd4f6=_0x5bd4f6-0x0;var _0x33a165=_0xfc46[_0x5bd4f6];return _0x33a165;};'use strict';var Sequelize=require(_0x6fc4('0x0'));module['exports']={'name':{'type':Sequelize[_0x6fc4('0x1')]},'description':{'type':Sequelize[_0x6fc4('0x1')]},'username':{'type':Sequelize[_0x6fc4('0x1')],'unique':'username'},'password':{'type':Sequelize[_0x6fc4('0x1')]},'token':{'type':Sequelize[_0x6fc4('0x1')]},'remoteUri':{'type':Sequelize[_0x6fc4('0x1')],'unique':_0x6fc4('0x2')},'authType':{'type':Sequelize['ENUM'](_0x6fc4('0x3'),_0x6fc4('0x4')),'defaultValue':_0x6fc4('0x3')},'serverUrl':{'type':Sequelize[_0x6fc4('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x6fc4('0x5')](_0x6fc4('0x6'),'newTab'),'defaultValue':_0x6fc4('0x6')}}; \ No newline at end of file +var _0x41d0=['ENUM','password','token','newTab','sequelize','exports','STRING','username','remoteUri'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x41d0,0x1c6));var _0x041d=function(_0x5466ab,_0x227b13){_0x5466ab=_0x5466ab-0x0;var _0x40751a=_0x41d0[_0x5466ab];return _0x40751a;};'use strict';var Sequelize=require(_0x041d('0x0'));module[_0x041d('0x1')]={'name':{'type':Sequelize[_0x041d('0x2')]},'description':{'type':Sequelize[_0x041d('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x041d('0x3')},'password':{'type':Sequelize[_0x041d('0x2')]},'token':{'type':Sequelize[_0x041d('0x2')]},'remoteUri':{'type':Sequelize[_0x041d('0x2')],'unique':_0x041d('0x4')},'authType':{'type':Sequelize[_0x041d('0x5')](_0x041d('0x6'),_0x041d('0x7')),'defaultValue':_0x041d('0x6')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x041d('0x5')]('integrationTab',_0x041d('0x8')),'defaultValue':'integrationTab'}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index 36c4a23..58c06a8 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 _0x2547=['Sequelize','ValidationError','Unknown\x20authentication\x20type','subject','group','assignee','remove','system_field_options','custom_field_options','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','stringify','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','../../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','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','ZendeskAccount','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','rows','params','create','catch','body','find','findOne','ZendeskConfiguration','getConfigurations','addConfiguration','Subjects','getSubjects','Descriptions','getDescriptions','ZendeskField','getFields','username','password','token','authType','remoteUri','slice','substring','lastIndexOf','GET','format','%s/%s','ticket_fields','headers','Basic\x20%s','toString','%s/token:%s'];(function(_0x5275b8,_0x51e5dd){var _0x568a9b=function(_0x583a71){while(--_0x583a71){_0x5275b8['push'](_0x5275b8['shift']());}};_0x568a9b(++_0x51e5dd);}(_0x2547,0x1cd));var _0x7254=function(_0x17e170,_0x16fcf6){_0x17e170=_0x17e170-0x0;var _0x31f6d1=_0x2547[_0x17e170];return _0x31f6d1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7254('0x0'));var zipdir=require(_0x7254('0x1'));var jsonpatch=require(_0x7254('0x2'));var rp=require(_0x7254('0x3'));var moment=require(_0x7254('0x4'));var BPromise=require(_0x7254('0x5'));var Mustache=require(_0x7254('0x6'));var util=require(_0x7254('0x7'));var path=require('path');var sox=require(_0x7254('0x8'));var csv=require(_0x7254('0x9'));var ejs=require(_0x7254('0xa'));var fs=require('fs');var fs_extra=require(_0x7254('0xb'));var _=require('lodash');var squel=require(_0x7254('0xc'));var crypto=require(_0x7254('0xd'));var jsforce=require(_0x7254('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x7254('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x7254('0xf'));var qs=require(_0x7254('0x10'));var as=require(_0x7254('0x11'));var hardwareService=require(_0x7254('0x12'));var logger=require(_0x7254('0x13'))(_0x7254('0x14'));var utils=require('../../config/utils');var config=require(_0x7254('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x7254('0x16'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x16c08e,_0x2bfff8){_0x2bfff8=_0x2bfff8||0xcc;return function(_0x348d4e){if(_0x348d4e){return _0x16c08e[_0x7254('0x17')](_0x2bfff8);}return _0x16c08e[_0x7254('0x18')](_0x2bfff8)[_0x7254('0x19')]();};}function respondWithResult(_0x124192,_0x21cecc){_0x21cecc=_0x21cecc||0xc8;return function(_0x1625ea){if(_0x1625ea){return _0x124192[_0x7254('0x18')](_0x21cecc)[_0x7254('0x1a')](_0x1625ea);}};}function respondWithFilteredResult(_0x1ee5cb,_0x163c8c){return function(_0x535065){if(_0x535065){var _0x265293=typeof _0x163c8c[_0x7254('0x1b')]===_0x7254('0x1c')&&typeof _0x163c8c[_0x7254('0x1d')]===_0x7254('0x1c');var _0x1e4aff=_0x535065[_0x7254('0x1e')];var _0x5dd23b=_0x265293?0x0:_0x163c8c[_0x7254('0x1b')];var _0x2283b7=_0x265293?_0x535065[_0x7254('0x1e')]:_0x163c8c[_0x7254('0x1b')]+_0x163c8c[_0x7254('0x1d')];var _0x301f00;if(_0x2283b7>=_0x1e4aff){_0x2283b7=_0x1e4aff;_0x301f00=0xc8;}else{_0x301f00=0xce;}_0x1ee5cb[_0x7254('0x18')](_0x301f00);return _0x1ee5cb[_0x7254('0x1f')](_0x7254('0x20'),_0x5dd23b+'-'+_0x2283b7+'/'+_0x1e4aff)[_0x7254('0x1a')](_0x535065);}return null;};}function patchUpdates(_0x2594b8){return function(_0x24bc73){try{jsonpatch[_0x7254('0x21')](_0x24bc73,_0x2594b8,!![]);}catch(_0x41ef72){return BPromise[_0x7254('0x22')](_0x41ef72);}return _0x24bc73[_0x7254('0x23')]();};}function saveUpdates(_0x2bb2fe,_0x46c0a2){return function(_0x195fd2){if(_0x195fd2){return _0x195fd2[_0x7254('0x24')](_0x2bb2fe)[_0x7254('0x25')](function(_0x50c34b){return _0x50c34b;});}return null;};}function removeEntity(_0x493bfd,_0x136ea3){return function(_0xd91c1f){if(_0xd91c1f){return _0xd91c1f[_0x7254('0x26')]()[_0x7254('0x25')](function(){_0x493bfd[_0x7254('0x18')](0xcc)[_0x7254('0x19')]();});}};}function handleEntityNotFound(_0x133aee,_0x5d6df5){return function(_0x133287){if(!_0x133287){_0x133aee[_0x7254('0x17')](0x194);}return _0x133287;};}function handleError(_0x2b4f46,_0x494cdb){_0x494cdb=_0x494cdb||0x1f4;return function(_0x3c22d0){logger['error'](_0x3c22d0[_0x7254('0x27')]);if(_0x3c22d0[_0x7254('0x28')]){delete _0x3c22d0['name'];}_0x2b4f46[_0x7254('0x18')](_0x494cdb)[_0x7254('0x29')](_0x3c22d0);};}exports['index']=function(_0x14cbea,_0x6c4927){var _0x37cb5c={},_0xb9198b={},_0x43bf02={'count':0x0,'rows':[]};var _0xfe02ea=_['map'](db[_0x7254('0x2a')][_0x7254('0x2b')],function(_0x5569be){return{'name':_0x5569be[_0x7254('0x2c')],'type':_0x5569be[_0x7254('0x2d')][_0x7254('0x2e')]};});_0xb9198b['model']=_[_0x7254('0x2f')](_0xfe02ea,_0x7254('0x28'));_0xb9198b[_0x7254('0x30')]=_[_0x7254('0x31')](_0x14cbea[_0x7254('0x30')]);_0xb9198b[_0x7254('0x32')]=_[_0x7254('0x33')](_0xb9198b['model'],_0xb9198b[_0x7254('0x30')]);_0x37cb5c['attributes']=_['intersection'](_0xb9198b[_0x7254('0x34')],qs[_0x7254('0x35')](_0x14cbea[_0x7254('0x30')][_0x7254('0x35')]));_0x37cb5c[_0x7254('0x36')]=_0x37cb5c[_0x7254('0x36')][_0x7254('0x37')]?_0x37cb5c[_0x7254('0x36')]:_0xb9198b[_0x7254('0x34')];if(!_0x14cbea[_0x7254('0x30')][_0x7254('0x38')](_0x7254('0x39'))){_0x37cb5c[_0x7254('0x1d')]=qs[_0x7254('0x1d')](_0x14cbea['query'][_0x7254('0x1d')]);_0x37cb5c[_0x7254('0x1b')]=qs[_0x7254('0x1b')](_0x14cbea[_0x7254('0x30')][_0x7254('0x1b')]);}_0x37cb5c['order']=qs[_0x7254('0x3a')](_0x14cbea['query'][_0x7254('0x3a')]);_0x37cb5c[_0x7254('0x3b')]=qs[_0x7254('0x32')](_[_0x7254('0x3c')](_0x14cbea[_0x7254('0x30')],_0xb9198b['filters']),_0xfe02ea);if(_0x14cbea[_0x7254('0x30')]['filter']){_0x37cb5c[_0x7254('0x3b')]=_[_0x7254('0x3d')](_0x37cb5c['where'],{'$or':_[_0x7254('0x2f')](_0xfe02ea,function(_0x3c5bf4){if(_0x3c5bf4[_0x7254('0x2d')]!==_0x7254('0x3e')){var _0x14b625={};_0x14b625[_0x3c5bf4[_0x7254('0x28')]]={'$like':'%'+_0x14cbea['query'][_0x7254('0x3f')]+'%'};return _0x14b625;}})});}_0x37cb5c=_[_0x7254('0x3d')]({},_0x37cb5c,_0x14cbea[_0x7254('0x40')]);var _0x4eca7a={'where':_0x37cb5c[_0x7254('0x3b')]};return db[_0x7254('0x2a')][_0x7254('0x1e')](_0x4eca7a)['then'](function(_0xc09711){_0x43bf02[_0x7254('0x1e')]=_0xc09711;if(_0x14cbea[_0x7254('0x30')][_0x7254('0x41')]){_0x37cb5c[_0x7254('0x42')]=[{'all':!![]}];}return db['ZendeskAccount']['findAll'](_0x37cb5c);})[_0x7254('0x25')](function(_0x17bc29){_0x43bf02[_0x7254('0x43')]=_0x17bc29;return _0x43bf02;})[_0x7254('0x25')](respondWithFilteredResult(_0x6c4927,_0x37cb5c))['catch'](handleError(_0x6c4927,null));};exports['show']=function(_0x29821a,_0x565cd8){var _0x2ae22e={'raw':![],'where':{'id':_0x29821a[_0x7254('0x44')]['id']}},_0x3187b0={};_0x3187b0[_0x7254('0x34')]=_['keys'](db['ZendeskAccount'][_0x7254('0x2b')]);_0x3187b0[_0x7254('0x30')]=_[_0x7254('0x31')](_0x29821a[_0x7254('0x30')]);_0x3187b0[_0x7254('0x32')]=_['intersection'](_0x3187b0['model'],_0x3187b0[_0x7254('0x30')]);_0x2ae22e[_0x7254('0x36')]=_[_0x7254('0x33')](_0x3187b0['model'],qs[_0x7254('0x35')](_0x29821a[_0x7254('0x30')]['fields']));_0x2ae22e[_0x7254('0x36')]=_0x2ae22e[_0x7254('0x36')][_0x7254('0x37')]?_0x2ae22e[_0x7254('0x36')]:_0x3187b0['model'];if(_0x29821a[_0x7254('0x30')][_0x7254('0x41')]){_0x2ae22e['include']=[{'all':!![]}];}_0x2ae22e=_[_0x7254('0x3d')]({},_0x2ae22e,_0x29821a[_0x7254('0x40')]);return db[_0x7254('0x2a')]['find'](_0x2ae22e)[_0x7254('0x25')](handleEntityNotFound(_0x565cd8,null))[_0x7254('0x25')](respondWithResult(_0x565cd8,null))['catch'](handleError(_0x565cd8,null));};exports['create']=function(_0x10b32f,_0x54c792){return db[_0x7254('0x2a')][_0x7254('0x45')](_0x10b32f['body'],{})['then'](respondWithResult(_0x54c792,0xc9))[_0x7254('0x46')](handleError(_0x54c792,null));};exports[_0x7254('0x24')]=function(_0x38bcd5,_0x104d98){if(_0x38bcd5[_0x7254('0x47')]['id']){delete _0x38bcd5[_0x7254('0x47')]['id'];}return db['ZendeskAccount'][_0x7254('0x48')]({'where':{'id':_0x38bcd5['params']['id']}})[_0x7254('0x25')](handleEntityNotFound(_0x104d98,null))[_0x7254('0x25')](saveUpdates(_0x38bcd5[_0x7254('0x47')],null))['then'](respondWithResult(_0x104d98,null))[_0x7254('0x46')](handleError(_0x104d98,null));};exports[_0x7254('0x26')]=function(_0x252758,_0x5b3b6e){return db[_0x7254('0x2a')][_0x7254('0x48')]({'where':{'id':_0x252758[_0x7254('0x44')]['id']}})[_0x7254('0x25')](handleEntityNotFound(_0x5b3b6e,null))[_0x7254('0x25')](removeEntity(_0x5b3b6e,null))['catch'](handleError(_0x5b3b6e,null));};exports['getConfigurations']=function(_0x24c532,_0x2cb7cd,_0x441d23){var _0x10e1cb={};var _0x3b0002={};var _0x4c6838;var _0x5a44fb;return db[_0x7254('0x2a')][_0x7254('0x49')]({'where':{'id':_0x24c532[_0x7254('0x44')]['id']}})[_0x7254('0x25')](handleEntityNotFound(_0x2cb7cd,null))['then'](function(_0xaf6d3d){if(_0xaf6d3d){_0x4c6838=_0xaf6d3d;_0x3b0002[_0x7254('0x34')]=_['keys'](db[_0x7254('0x4a')]['rawAttributes']);_0x3b0002[_0x7254('0x30')]=_['keys'](_0x24c532[_0x7254('0x30')]);_0x3b0002['filters']=_['intersection'](_0x3b0002[_0x7254('0x34')],_0x3b0002[_0x7254('0x30')]);_0x10e1cb[_0x7254('0x36')]=_[_0x7254('0x33')](_0x3b0002['model'],qs[_0x7254('0x35')](_0x24c532['query'][_0x7254('0x35')]));_0x10e1cb[_0x7254('0x36')]=_0x10e1cb[_0x7254('0x36')][_0x7254('0x37')]?_0x10e1cb[_0x7254('0x36')]:_0x3b0002[_0x7254('0x34')];_0x10e1cb['order']=qs[_0x7254('0x3a')](_0x24c532[_0x7254('0x30')][_0x7254('0x3a')]);_0x10e1cb[_0x7254('0x3b')]=qs[_0x7254('0x32')](_[_0x7254('0x3c')](_0x24c532['query'],_0x3b0002[_0x7254('0x32')]));if(_0x24c532[_0x7254('0x30')][_0x7254('0x3f')]){_0x10e1cb[_0x7254('0x3b')]=_[_0x7254('0x3d')](_0x10e1cb[_0x7254('0x3b')],{'$or':_[_0x7254('0x2f')](_0x10e1cb['attributes'],function(_0x5dd108){var _0xac4d0={};_0xac4d0[_0x5dd108]={'$like':'%'+_0x24c532['query']['filter']+'%'};return _0xac4d0;})});}_0x10e1cb=_[_0x7254('0x3d')]({},_0x10e1cb,_0x24c532[_0x7254('0x40')]);return _0x4c6838[_0x7254('0x4b')](_0x10e1cb);}})['then'](function(_0x1821f0){if(_0x1821f0){_0x5a44fb=_0x1821f0['length'];if(!_0x24c532[_0x7254('0x30')][_0x7254('0x38')](_0x7254('0x39'))){_0x10e1cb[_0x7254('0x1d')]=qs[_0x7254('0x1d')](_0x24c532['query'][_0x7254('0x1d')]);_0x10e1cb[_0x7254('0x1b')]=qs[_0x7254('0x1b')](_0x24c532[_0x7254('0x30')]['offset']);}return _0x4c6838['getConfigurations'](_0x10e1cb);}})[_0x7254('0x25')](function(_0x41355e){if(_0x41355e){return _0x41355e?{'count':_0x5a44fb,'rows':_0x41355e}:null;}})[_0x7254('0x25')](respondWithResult(_0x2cb7cd,null))[_0x7254('0x46')](handleError(_0x2cb7cd,null));};exports[_0x7254('0x4c')]=function(_0x1cf028,_0x464680,_0x38cba1){if(_0x1cf028[_0x7254('0x47')]['id']){delete _0x1cf028[_0x7254('0x47')]['id'];}return db[_0x7254('0x2a')][_0x7254('0x49')]({'where':{'id':_0x1cf028[_0x7254('0x44')]['id']}})['then'](handleEntityNotFound(_0x464680,null))[_0x7254('0x25')](function(_0x4716a2){if(_0x4716a2){_0x1cf028[_0x7254('0x47')]['AccountId']=_0x4716a2['id'];_0x1cf028[_0x7254('0x47')][_0x7254('0x4d')]=integrations[_0x7254('0x4e')](_0x1cf028[_0x7254('0x47')]['channel'],_0x1cf028[_0x7254('0x47')]['type']);_0x1cf028[_0x7254('0x47')][_0x7254('0x4f')]=integrations[_0x7254('0x50')](_0x1cf028[_0x7254('0x47')]['channel'],_0x1cf028[_0x7254('0x47')]['type']);return db[_0x7254('0x4a')]['create'](_0x1cf028[_0x7254('0x47')],{'include':[{'model':db[_0x7254('0x51')],'as':_0x7254('0x4d')},{'model':db[_0x7254('0x51')],'as':_0x7254('0x4f')}]});}return null;})[_0x7254('0x25')](respondWithResult(_0x464680,null))[_0x7254('0x46')](handleError(_0x464680,null));};exports[_0x7254('0x52')]=function(_0x4e07c6,_0x37562a,_0x57c0a0){var _0x12c36e='';return db[_0x7254('0x2a')][_0x7254('0x49')]({'where':{'id':_0x4e07c6[_0x7254('0x44')]['id']},'attributes':['id',_0x7254('0x53'),_0x7254('0x54'),_0x7254('0x55'),_0x7254('0x56'),'remoteUri']})[_0x7254('0x25')](handleEntityNotFound(_0x37562a,null))['then'](function(_0x231184){if(_0x231184){_0x12c36e=_0x231184[_0x7254('0x57')];var _0x2399ef=_0x12c36e[_0x7254('0x58')](-0x1);if(_0x2399ef==='/'){_0x12c36e=_0x12c36e[_0x7254('0x59')](0x0,_0x12c36e[_0x7254('0x5a')](_0x2399ef));}var _0xb65570={'method':_0x7254('0x5b'),'uri':util[_0x7254('0x5c')](_0x7254('0x5d'),_0x12c36e,_0x7254('0x5e')),'json':!![]};switch(_0x231184[_0x7254('0x56')]){case _0x7254('0x54'):_0xb65570[_0x7254('0x5f')]={'Authorization':util[_0x7254('0x5c')](_0x7254('0x60'),new Buffer(util[_0x7254('0x5c')]('%s:%s',_0x231184['username'],_0x231184[_0x7254('0x54')]))[_0x7254('0x61')]('base64'))};break;case'token':_0xb65570['headers']={'Authorization':util[_0x7254('0x5c')](_0x7254('0x60'),new Buffer(util[_0x7254('0x5c')](_0x7254('0x62'),_0x231184['username'],_0x231184[_0x7254('0x55')]))[_0x7254('0x61')]('base64'))};break;default:throw new db[(_0x7254('0x63'))][(_0x7254('0x64'))](_0x7254('0x65'));}return rp(_0xb65570);}})['then'](function(_0x4aa036){if(_0x4aa036){var _0x220066=[_0x7254('0x66'),'description',_0x7254('0x67'),_0x7254('0x68')];_[_0x7254('0x69')](_0x4aa036[_0x7254('0x5e')],function(_0x24fcb1){return _0x220066['includes'](_0x24fcb1[_0x7254('0x2d')]);});return{'count':_0x4aa036[_0x7254('0x5e')][_0x7254('0x37')],'rows':_['map'](_0x4aa036[_0x7254('0x5e')],function(_0x4cf18d){return{'id':_0x4cf18d['id'],'name':_0x4cf18d['position']>0x7?_0x4cf18d['title']:_0x4cf18d[_0x7254('0x2d')],'custom':_0x4cf18d['position']>0x7?!![]:![],'options':_0x4cf18d['system_field_options']?_0x4cf18d[_0x7254('0x6a')]:_0x4cf18d[_0x7254('0x6b')]?_0x4cf18d[_0x7254('0x6b')]:[]};})};}})['then'](respondWithResult(_0x37562a,null))[_0x7254('0x46')](function(_0x5a0c41){var _0x175379=_0x4e07c6[_0x7254('0x30')]['test']?0x1f4:_0x5a0c41[_0x7254('0x6c')]||0x1f4;logger[_0x7254('0x6d')](_0x7254('0x6e'),_0x7254('0x52'),_0x175379,JSON[_0x7254('0x6f')](_0x5a0c41));delete _0x5a0c41[_0x7254('0x28')];if(_0x175379===0x191){_0x175379=0x190;}_0x37562a[_0x7254('0x18')](_0x175379)['send'](_0x4e07c6[_0x7254('0x30')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x5a0c41[_0x7254('0x6c')]}:_0x5a0c41);});}; \ No newline at end of file +var _0xb58b=['headers','toString','base64','Basic\x20%s','%s/token:%s','username','Sequelize','ValidationError','Unknown\x20authentication\x20type','subject','description','assignee','remove','ticket_fields','includes','position','title','system_field_options','custom_field_options','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','test','Wrong\x20credentials','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','../../components/integrations/configuration','sendStatus','status','end','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','map','ZendeskAccount','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','includeAll','include','findAll','show','params','options','find','catch','create','update','body','getConfigurations','ZendeskConfiguration','addConfiguration','Subjects','getSubjects','channel','getDescriptions','ZendeskField','Descriptions','findOne','token','authType','remoteUri','substring','GET','format','%s/%s','password'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xb58b,0x1f1));var _0xbb58=function(_0x51662d,_0x8d4794){_0x51662d=_0x51662d-0x0;var _0x4199db=_0xb58b[_0x51662d];return _0x4199db;};'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'];var integrations=require(_0xbb58('0x18'));function respondWithStatusCode(_0x18810f,_0x4cda21){_0x4cda21=_0x4cda21||0xcc;return function(_0x132511){if(_0x132511){return _0x18810f[_0xbb58('0x19')](_0x4cda21);}return _0x18810f[_0xbb58('0x1a')](_0x4cda21)[_0xbb58('0x1b')]();};}function respondWithResult(_0x19ceda,_0x58245f){_0x58245f=_0x58245f||0xc8;return function(_0x110944){if(_0x110944){return _0x19ceda[_0xbb58('0x1a')](_0x58245f)['json'](_0x110944);}};}function respondWithFilteredResult(_0x4ba30e,_0x33c20f){return function(_0x445b1f){if(_0x445b1f){var _0x38d69a=typeof _0x33c20f['offset']==='undefined'&&typeof _0x33c20f['limit']==='undefined';var _0x28637b=_0x445b1f[_0xbb58('0x1c')];var _0x48f3e0=_0x38d69a?0x0:_0x33c20f[_0xbb58('0x1d')];var _0x497653=_0x38d69a?_0x445b1f[_0xbb58('0x1c')]:_0x33c20f[_0xbb58('0x1d')]+_0x33c20f[_0xbb58('0x1e')];var _0xb8f982;if(_0x497653>=_0x28637b){_0x497653=_0x28637b;_0xb8f982=0xc8;}else{_0xb8f982=0xce;}_0x4ba30e[_0xbb58('0x1a')](_0xb8f982);return _0x4ba30e[_0xbb58('0x1f')](_0xbb58('0x20'),_0x48f3e0+'-'+_0x497653+'/'+_0x28637b)['json'](_0x445b1f);}return null;};}function patchUpdates(_0x84f34){return function(_0x2d8c0f){try{jsonpatch[_0xbb58('0x21')](_0x2d8c0f,_0x84f34,!![]);}catch(_0x3b4dc6){return BPromise[_0xbb58('0x22')](_0x3b4dc6);}return _0x2d8c0f[_0xbb58('0x23')]();};}function saveUpdates(_0x49453a,_0x350be7){return function(_0x27bbec){if(_0x27bbec){return _0x27bbec['update'](_0x49453a)[_0xbb58('0x24')](function(_0x53b693){return _0x53b693;});}return null;};}function removeEntity(_0x21964d,_0x287822){return function(_0x152f22){if(_0x152f22){return _0x152f22[_0xbb58('0x25')]()[_0xbb58('0x24')](function(){_0x21964d[_0xbb58('0x1a')](0xcc)[_0xbb58('0x1b')]();});}};}function handleEntityNotFound(_0x15e4c5,_0x4e0303){return function(_0x283dff){if(!_0x283dff){_0x15e4c5[_0xbb58('0x19')](0x194);}return _0x283dff;};}function handleError(_0x1be0ae,_0x129094){_0x129094=_0x129094||0x1f4;return function(_0x8e9ed9){logger[_0xbb58('0x26')](_0x8e9ed9[_0xbb58('0x27')]);if(_0x8e9ed9[_0xbb58('0x28')]){delete _0x8e9ed9[_0xbb58('0x28')];}_0x1be0ae[_0xbb58('0x1a')](_0x129094)[_0xbb58('0x29')](_0x8e9ed9);};}exports[_0xbb58('0x2a')]=function(_0x2a0481,_0x4157c4){var _0x3559b6={},_0x573cca={},_0x2b0f73={'count':0x0,'rows':[]};var _0xe46bc1=_[_0xbb58('0x2b')](db[_0xbb58('0x2c')][_0xbb58('0x2d')],function(_0x9d379f){return{'name':_0x9d379f[_0xbb58('0x2e')],'type':_0x9d379f[_0xbb58('0x2f')][_0xbb58('0x30')]};});_0x573cca['model']=_[_0xbb58('0x2b')](_0xe46bc1,_0xbb58('0x28'));_0x573cca[_0xbb58('0x31')]=_[_0xbb58('0x32')](_0x2a0481[_0xbb58('0x31')]);_0x573cca[_0xbb58('0x33')]=_[_0xbb58('0x34')](_0x573cca[_0xbb58('0x35')],_0x573cca[_0xbb58('0x31')]);_0x3559b6[_0xbb58('0x36')]=_[_0xbb58('0x34')](_0x573cca[_0xbb58('0x35')],qs[_0xbb58('0x37')](_0x2a0481['query']['fields']));_0x3559b6['attributes']=_0x3559b6[_0xbb58('0x36')][_0xbb58('0x38')]?_0x3559b6[_0xbb58('0x36')]:_0x573cca[_0xbb58('0x35')];if(!_0x2a0481[_0xbb58('0x31')][_0xbb58('0x39')](_0xbb58('0x3a'))){_0x3559b6[_0xbb58('0x1e')]=qs['limit'](_0x2a0481[_0xbb58('0x31')][_0xbb58('0x1e')]);_0x3559b6['offset']=qs[_0xbb58('0x1d')](_0x2a0481['query'][_0xbb58('0x1d')]);}_0x3559b6['order']=qs[_0xbb58('0x3b')](_0x2a0481[_0xbb58('0x31')]['sort']);_0x3559b6[_0xbb58('0x3c')]=qs[_0xbb58('0x33')](_[_0xbb58('0x3d')](_0x2a0481[_0xbb58('0x31')],_0x573cca[_0xbb58('0x33')]),_0xe46bc1);if(_0x2a0481[_0xbb58('0x31')][_0xbb58('0x3e')]){_0x3559b6[_0xbb58('0x3c')]=_['merge'](_0x3559b6[_0xbb58('0x3c')],{'$or':_[_0xbb58('0x2b')](_0xe46bc1,function(_0x2da5ff){if(_0x2da5ff['type']!=='VIRTUAL'){var _0x133d56={};_0x133d56[_0x2da5ff['name']]={'$like':'%'+_0x2a0481[_0xbb58('0x31')][_0xbb58('0x3e')]+'%'};return _0x133d56;}})});}_0x3559b6=_[_0xbb58('0x3f')]({},_0x3559b6,_0x2a0481['options']);var _0x485830={'where':_0x3559b6[_0xbb58('0x3c')]};return db[_0xbb58('0x2c')][_0xbb58('0x1c')](_0x485830)[_0xbb58('0x24')](function(_0x34a745){_0x2b0f73[_0xbb58('0x1c')]=_0x34a745;if(_0x2a0481['query'][_0xbb58('0x40')]){_0x3559b6[_0xbb58('0x41')]=[{'all':!![]}];}return db[_0xbb58('0x2c')][_0xbb58('0x42')](_0x3559b6);})[_0xbb58('0x24')](function(_0x301e15){_0x2b0f73['rows']=_0x301e15;return _0x2b0f73;})[_0xbb58('0x24')](respondWithFilteredResult(_0x4157c4,_0x3559b6))['catch'](handleError(_0x4157c4,null));};exports[_0xbb58('0x43')]=function(_0x285ad4,_0x29fb1c){var _0x45817f={'raw':![],'where':{'id':_0x285ad4[_0xbb58('0x44')]['id']}},_0x54099f={};_0x54099f[_0xbb58('0x35')]=_[_0xbb58('0x32')](db[_0xbb58('0x2c')]['rawAttributes']);_0x54099f[_0xbb58('0x31')]=_['keys'](_0x285ad4[_0xbb58('0x31')]);_0x54099f[_0xbb58('0x33')]=_[_0xbb58('0x34')](_0x54099f[_0xbb58('0x35')],_0x54099f[_0xbb58('0x31')]);_0x45817f[_0xbb58('0x36')]=_[_0xbb58('0x34')](_0x54099f[_0xbb58('0x35')],qs[_0xbb58('0x37')](_0x285ad4[_0xbb58('0x31')][_0xbb58('0x37')]));_0x45817f[_0xbb58('0x36')]=_0x45817f[_0xbb58('0x36')]['length']?_0x45817f[_0xbb58('0x36')]:_0x54099f['model'];if(_0x285ad4['query'][_0xbb58('0x40')]){_0x45817f[_0xbb58('0x41')]=[{'all':!![]}];}_0x45817f=_[_0xbb58('0x3f')]({},_0x45817f,_0x285ad4[_0xbb58('0x45')]);return db[_0xbb58('0x2c')][_0xbb58('0x46')](_0x45817f)[_0xbb58('0x24')](handleEntityNotFound(_0x29fb1c,null))[_0xbb58('0x24')](respondWithResult(_0x29fb1c,null))[_0xbb58('0x47')](handleError(_0x29fb1c,null));};exports[_0xbb58('0x48')]=function(_0x440fb3,_0x59a8cf){return db[_0xbb58('0x2c')][_0xbb58('0x48')](_0x440fb3['body'],{})[_0xbb58('0x24')](respondWithResult(_0x59a8cf,0xc9))[_0xbb58('0x47')](handleError(_0x59a8cf,null));};exports[_0xbb58('0x49')]=function(_0xdb0ff7,_0x5de68e){if(_0xdb0ff7[_0xbb58('0x4a')]['id']){delete _0xdb0ff7['body']['id'];}return db[_0xbb58('0x2c')][_0xbb58('0x46')]({'where':{'id':_0xdb0ff7[_0xbb58('0x44')]['id']}})['then'](handleEntityNotFound(_0x5de68e,null))[_0xbb58('0x24')](saveUpdates(_0xdb0ff7[_0xbb58('0x4a')],null))['then'](respondWithResult(_0x5de68e,null))[_0xbb58('0x47')](handleError(_0x5de68e,null));};exports['destroy']=function(_0x28301d,_0x2d81e0){return db[_0xbb58('0x2c')][_0xbb58('0x46')]({'where':{'id':_0x28301d[_0xbb58('0x44')]['id']}})[_0xbb58('0x24')](handleEntityNotFound(_0x2d81e0,null))[_0xbb58('0x24')](removeEntity(_0x2d81e0,null))['catch'](handleError(_0x2d81e0,null));};exports[_0xbb58('0x4b')]=function(_0x1fd892,_0x592da8,_0x3efbc6){var _0x98157={};var _0x5c19b7={};var _0x22802c;var _0x44636b;return db[_0xbb58('0x2c')]['findOne']({'where':{'id':_0x1fd892[_0xbb58('0x44')]['id']}})[_0xbb58('0x24')](handleEntityNotFound(_0x592da8,null))[_0xbb58('0x24')](function(_0x592879){if(_0x592879){_0x22802c=_0x592879;_0x5c19b7[_0xbb58('0x35')]=_['keys'](db[_0xbb58('0x4c')][_0xbb58('0x2d')]);_0x5c19b7[_0xbb58('0x31')]=_['keys'](_0x1fd892['query']);_0x5c19b7[_0xbb58('0x33')]=_[_0xbb58('0x34')](_0x5c19b7[_0xbb58('0x35')],_0x5c19b7[_0xbb58('0x31')]);_0x98157[_0xbb58('0x36')]=_['intersection'](_0x5c19b7[_0xbb58('0x35')],qs[_0xbb58('0x37')](_0x1fd892[_0xbb58('0x31')]['fields']));_0x98157[_0xbb58('0x36')]=_0x98157[_0xbb58('0x36')][_0xbb58('0x38')]?_0x98157[_0xbb58('0x36')]:_0x5c19b7[_0xbb58('0x35')];_0x98157['order']=qs[_0xbb58('0x3b')](_0x1fd892[_0xbb58('0x31')][_0xbb58('0x3b')]);_0x98157[_0xbb58('0x3c')]=qs[_0xbb58('0x33')](_[_0xbb58('0x3d')](_0x1fd892[_0xbb58('0x31')],_0x5c19b7[_0xbb58('0x33')]));if(_0x1fd892['query'][_0xbb58('0x3e')]){_0x98157['where']=_[_0xbb58('0x3f')](_0x98157[_0xbb58('0x3c')],{'$or':_[_0xbb58('0x2b')](_0x98157[_0xbb58('0x36')],function(_0x3d6fba){var _0x1dbbd9={};_0x1dbbd9[_0x3d6fba]={'$like':'%'+_0x1fd892[_0xbb58('0x31')][_0xbb58('0x3e')]+'%'};return _0x1dbbd9;})});}_0x98157=_[_0xbb58('0x3f')]({},_0x98157,_0x1fd892[_0xbb58('0x45')]);return _0x22802c[_0xbb58('0x4b')](_0x98157);}})['then'](function(_0x3933f0){if(_0x3933f0){_0x44636b=_0x3933f0[_0xbb58('0x38')];if(!_0x1fd892[_0xbb58('0x31')]['hasOwnProperty'](_0xbb58('0x3a'))){_0x98157['limit']=qs[_0xbb58('0x1e')](_0x1fd892[_0xbb58('0x31')]['limit']);_0x98157[_0xbb58('0x1d')]=qs[_0xbb58('0x1d')](_0x1fd892[_0xbb58('0x31')][_0xbb58('0x1d')]);}return _0x22802c[_0xbb58('0x4b')](_0x98157);}})['then'](function(_0x54bf2e){if(_0x54bf2e){return _0x54bf2e?{'count':_0x44636b,'rows':_0x54bf2e}:null;}})[_0xbb58('0x24')](respondWithResult(_0x592da8,null))[_0xbb58('0x47')](handleError(_0x592da8,null));};exports[_0xbb58('0x4d')]=function(_0x4bbccf,_0x11d41e,_0x419215){if(_0x4bbccf['body']['id']){delete _0x4bbccf[_0xbb58('0x4a')]['id'];}return db[_0xbb58('0x2c')]['findOne']({'where':{'id':_0x4bbccf[_0xbb58('0x44')]['id']}})[_0xbb58('0x24')](handleEntityNotFound(_0x11d41e,null))[_0xbb58('0x24')](function(_0x3c932e){if(_0x3c932e){_0x4bbccf[_0xbb58('0x4a')]['AccountId']=_0x3c932e['id'];_0x4bbccf[_0xbb58('0x4a')][_0xbb58('0x4e')]=integrations[_0xbb58('0x4f')](_0x4bbccf[_0xbb58('0x4a')][_0xbb58('0x50')],_0x4bbccf['body']['type']);_0x4bbccf[_0xbb58('0x4a')]['Descriptions']=integrations[_0xbb58('0x51')](_0x4bbccf[_0xbb58('0x4a')][_0xbb58('0x50')],_0x4bbccf[_0xbb58('0x4a')][_0xbb58('0x2f')]);return db[_0xbb58('0x4c')][_0xbb58('0x48')](_0x4bbccf[_0xbb58('0x4a')],{'include':[{'model':db[_0xbb58('0x52')],'as':_0xbb58('0x4e')},{'model':db['ZendeskField'],'as':_0xbb58('0x53')}]});}return null;})[_0xbb58('0x24')](respondWithResult(_0x11d41e,null))[_0xbb58('0x47')](handleError(_0x11d41e,null));};exports['getFields']=function(_0x50bf24,_0x4bdc30,_0x5e9319){var _0x1e315e='';return db[_0xbb58('0x2c')][_0xbb58('0x54')]({'where':{'id':_0x50bf24[_0xbb58('0x44')]['id']},'attributes':['id','username','password',_0xbb58('0x55'),_0xbb58('0x56'),'remoteUri']})[_0xbb58('0x24')](handleEntityNotFound(_0x4bdc30,null))[_0xbb58('0x24')](function(_0x3cd96a){if(_0x3cd96a){_0x1e315e=_0x3cd96a[_0xbb58('0x57')];var _0x382d16=_0x1e315e['slice'](-0x1);if(_0x382d16==='/'){_0x1e315e=_0x1e315e[_0xbb58('0x58')](0x0,_0x1e315e['lastIndexOf'](_0x382d16));}var _0x52cf79={'method':_0xbb58('0x59'),'uri':util[_0xbb58('0x5a')](_0xbb58('0x5b'),_0x1e315e,'ticket_fields'),'json':!![]};switch(_0x3cd96a[_0xbb58('0x56')]){case _0xbb58('0x5c'):_0x52cf79[_0xbb58('0x5d')]={'Authorization':util[_0xbb58('0x5a')]('Basic\x20%s',new Buffer(util[_0xbb58('0x5a')]('%s:%s',_0x3cd96a['username'],_0x3cd96a[_0xbb58('0x5c')]))[_0xbb58('0x5e')](_0xbb58('0x5f')))};break;case'token':_0x52cf79['headers']={'Authorization':util[_0xbb58('0x5a')](_0xbb58('0x60'),new Buffer(util[_0xbb58('0x5a')](_0xbb58('0x61'),_0x3cd96a[_0xbb58('0x62')],_0x3cd96a[_0xbb58('0x55')]))[_0xbb58('0x5e')](_0xbb58('0x5f')))};break;default:throw new db[(_0xbb58('0x63'))][(_0xbb58('0x64'))](_0xbb58('0x65'));}return rp(_0x52cf79);}})['then'](function(_0x502f55){if(_0x502f55){var _0x36e2eb=[_0xbb58('0x66'),_0xbb58('0x67'),'group',_0xbb58('0x68')];_[_0xbb58('0x69')](_0x502f55[_0xbb58('0x6a')],function(_0x494c33){return _0x36e2eb[_0xbb58('0x6b')](_0x494c33['type']);});return{'count':_0x502f55[_0xbb58('0x6a')]['length'],'rows':_[_0xbb58('0x2b')](_0x502f55[_0xbb58('0x6a')],function(_0xaf9d6){return{'id':_0xaf9d6['id'],'name':_0xaf9d6[_0xbb58('0x6c')]>0x7?_0xaf9d6[_0xbb58('0x6d')]:_0xaf9d6[_0xbb58('0x2f')],'custom':_0xaf9d6['position']>0x7?!![]:![],'options':_0xaf9d6['system_field_options']?_0xaf9d6[_0xbb58('0x6e')]:_0xaf9d6[_0xbb58('0x6f')]?_0xaf9d6['custom_field_options']:[]};})};}})[_0xbb58('0x24')](respondWithResult(_0x4bdc30,null))[_0xbb58('0x47')](function(_0x43eb15){var _0x5604d1=_0x50bf24[_0xbb58('0x31')]['test']?0x1f4:_0x43eb15[_0xbb58('0x70')]||0x1f4;logger[_0xbb58('0x26')](_0xbb58('0x71'),_0xbb58('0x72'),_0x5604d1,JSON[_0xbb58('0x73')](_0x43eb15));delete _0x43eb15[_0xbb58('0x28')];if(_0x5604d1===0x191){_0x5604d1=0x190;}_0x4bdc30[_0xbb58('0x1a')](_0x5604d1)['send'](_0x50bf24[_0xbb58('0x31')][_0xbb58('0x74')]?{'message':_0xbb58('0x75'),'statusCode':_0x43eb15['statusCode']}:_0x43eb15);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index 7b78099..e5878fd 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 _0xe321=['../../components/integrations/configuration','exports','define','ZendeskAccount','util','../../config/logger','api','request-promise','../../config/environment','./intZendeskAccount.attributes'];(function(_0x158591,_0x702b2b){var _0x3c3edd=function(_0x451cca){while(--_0x451cca){_0x158591['push'](_0x158591['shift']());}};_0x3c3edd(++_0x702b2b);}(_0xe321,0x194));var _0x1e32=function(_0x3a45b3,_0x300baf){_0x3a45b3=_0x3a45b3-0x0;var _0x4aba5b=_0xe321[_0x3a45b3];return _0x4aba5b;};'use strict';var _=require('lodash');var util=require(_0x1e32('0x0'));var logger=require(_0x1e32('0x1'))(_0x1e32('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1e32('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1e32('0x4'));var attributes=require(_0x1e32('0x5'));var integrations=require(_0x1e32('0x6'));module[_0x1e32('0x7')]=function(_0x28c16a,_0x1cff71){return _0x28c16a[_0x1e32('0x8')](_0x1e32('0x9'),attributes,{'tableName':'int_zendesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc3c6=['./intZendeskAccount.attributes','../../components/integrations/configuration','ZendeskAccount','lodash','../../config/logger','moment','request-promise','path','rimraf'];(function(_0x5bf8be,_0x1a37ea){var _0x5c74d1=function(_0x5703ce){while(--_0x5703ce){_0x5bf8be['push'](_0x5bf8be['shift']());}};_0x5c74d1(++_0x1a37ea);}(_0xc3c6,0x198));var _0x6c3c=function(_0x887753,_0x383a3c){_0x887753=_0x887753-0x0;var _0x698734=_0xc3c6[_0x887753];return _0x698734;};'use strict';var _=require(_0x6c3c('0x0'));var util=require('util');var logger=require(_0x6c3c('0x1'))('api');var moment=require(_0x6c3c('0x2'));var BPromise=require('bluebird');var rp=require(_0x6c3c('0x3'));var fs=require('fs');var path=require(_0x6c3c('0x4'));var rimraf=require(_0x6c3c('0x5'));var config=require('../../config/environment');var attributes=require(_0x6c3c('0x6'));var integrations=require(_0x6c3c('0x7'));module['exports']=function(_0x154fa2,_0x13b983){return _0x154fa2['define'](_0x6c3c('0x8'),attributes,{'tableName':'int_zendesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.rpc.js b/server/api/intZendeskAccount/intZendeskAccount.rpc.js index 0bd6b76..7fa040e 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 _0x8d93=['then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','error','message','result','findAll','options','raw','where','attributes','include','model','map','GetZendeskAccount','stringify','ZendeskAccount','find','ShowZendeskAccount','catch','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http'];(function(_0x798ef0,_0x10e89a){var _0x5e77ee=function(_0x4700e6){while(--_0x4700e6){_0x798ef0['push'](_0x798ef0['shift']());}};_0x5e77ee(++_0x10e89a);}(_0x8d93,0x96));var _0x38d9=function(_0x45d3f0,_0x4be53f){_0x45d3f0=_0x45d3f0-0x0;var _0x314b79=_0x8d93[_0x45d3f0];return _0x314b79;};'use strict';var _=require('lodash');var util=require(_0x38d9('0x0'));var moment=require(_0x38d9('0x1'));var BPromise=require(_0x38d9('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x38d9('0x3'))['db'];var utils=require(_0x38d9('0x4'));var logger=require(_0x38d9('0x5'))(_0x38d9('0x6'));var config=require('../../config/environment');var jayson=require(_0x38d9('0x7'));var client=jayson[_0x38d9('0x8')][_0x38d9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x284f3f,_0x535ff3,_0x209235){return new BPromise(function(_0x1c4a96,_0xc23d60){return client['request'](_0x284f3f,_0x209235)[_0x38d9('0xa')](function(_0x205c85){logger[_0x38d9('0xb')](_0x38d9('0xc'),_0x535ff3,_0x38d9('0xd'));logger[_0x38d9('0xe')]('ZendeskAccount,\x20%s,\x20%s,\x20%s',_0x535ff3,_0x38d9('0xd'),JSON['stringify'](_0x205c85));if(_0x205c85['error']){if(_0x205c85['error']['code']===0x1f4){logger[_0x38d9('0xf')](_0x38d9('0xc'),_0x535ff3,_0x205c85[_0x38d9('0xf')][_0x38d9('0x10')]);return _0xc23d60(_0x205c85[_0x38d9('0xf')]['message']);}logger[_0x38d9('0xf')](_0x38d9('0xc'),_0x535ff3,_0x205c85[_0x38d9('0xf')][_0x38d9('0x10')]);return _0x1c4a96(_0x205c85[_0x38d9('0xf')][_0x38d9('0x10')]);}else{logger[_0x38d9('0xb')]('ZendeskAccount,\x20%s,\x20%s',_0x535ff3,_0x38d9('0xd'));_0x1c4a96(_0x205c85[_0x38d9('0x11')][_0x38d9('0x10')]);}})['catch'](function(_0x3c9f8d){logger[_0x38d9('0xf')](_0x38d9('0xc'),_0x535ff3,_0x3c9f8d);_0xc23d60(_0x3c9f8d);});});}exports['GetZendeskAccount']=function(_0xca6d43){var _0x48c69=this;return new Promise(function(_0x4ae582,_0x37ce35){return db['ZendeskAccount'][_0x38d9('0x12')]({'raw':_0xca6d43[_0x38d9('0x13')]?_0xca6d43[_0x38d9('0x13')][_0x38d9('0x14')]===undefined?!![]:![]:!![],'where':_0xca6d43[_0x38d9('0x13')]?_0xca6d43[_0x38d9('0x13')][_0x38d9('0x15')]||null:null,'attributes':_0xca6d43[_0x38d9('0x13')]?_0xca6d43[_0x38d9('0x13')][_0x38d9('0x16')]||null:null,'limit':_0xca6d43[_0x38d9('0x13')]?_0xca6d43[_0x38d9('0x13')]['limit']||null:null,'include':_0xca6d43['options']?_0xca6d43[_0x38d9('0x13')][_0x38d9('0x17')]?_['map'](_0xca6d43[_0x38d9('0x13')]['include'],function(_0x50729d){return{'model':db[_0x50729d[_0x38d9('0x18')]],'as':_0x50729d['as'],'attributes':_0x50729d[_0x38d9('0x16')],'include':_0x50729d[_0x38d9('0x17')]?_['map'](_0x50729d[_0x38d9('0x17')],function(_0x4c098c){return{'model':db[_0x4c098c[_0x38d9('0x18')]],'as':_0x4c098c['as'],'attributes':_0x4c098c[_0x38d9('0x16')],'include':_0x4c098c['include']?_[_0x38d9('0x19')](_0x4c098c[_0x38d9('0x17')],function(_0x5d2377){return{'model':db[_0x5d2377[_0x38d9('0x18')]],'as':_0x5d2377['as'],'attributes':_0x5d2377[_0x38d9('0x16')]};}):[]};}):[]};}):[]:[]})[_0x38d9('0xa')](function(_0xe75499){logger[_0x38d9('0xb')](_0x38d9('0x1a'),_0xca6d43);logger[_0x38d9('0xe')](_0x38d9('0x1a'),_0xca6d43,JSON[_0x38d9('0x1b')](_0xe75499));_0x4ae582(_0xe75499);})['catch'](function(_0x5398c4){logger[_0x38d9('0xf')](_0x38d9('0x1a'),_0x5398c4[_0x38d9('0x10')],_0xca6d43);_0x37ce35(_0x48c69[_0x38d9('0xf')](0x1f4,_0x5398c4[_0x38d9('0x10')]));});});};exports['ShowZendeskAccount']=function(_0x5e81f3){var _0x1c28b5=this;return new Promise(function(_0x470ced,_0x49d690){return db[_0x38d9('0x1c')][_0x38d9('0x1d')]({'raw':_0x5e81f3['options']?_0x5e81f3['options'][_0x38d9('0x14')]===undefined?!![]:![]:!![],'where':_0x5e81f3['options']?_0x5e81f3[_0x38d9('0x13')][_0x38d9('0x15')]||null:null,'attributes':_0x5e81f3[_0x38d9('0x13')]?_0x5e81f3[_0x38d9('0x13')][_0x38d9('0x16')]||null:null,'include':_0x5e81f3['options']?_0x5e81f3['options']['include']?_[_0x38d9('0x19')](_0x5e81f3[_0x38d9('0x13')][_0x38d9('0x17')],function(_0x444997){return{'model':db[_0x444997[_0x38d9('0x18')]],'as':_0x444997['as'],'attributes':_0x444997[_0x38d9('0x16')],'include':_0x444997[_0x38d9('0x17')]?_[_0x38d9('0x19')](_0x444997['include'],function(_0xebb98a){return{'model':db[_0xebb98a['model']],'as':_0xebb98a['as'],'attributes':_0xebb98a['attributes'],'include':_0xebb98a['include']?_[_0x38d9('0x19')](_0xebb98a[_0x38d9('0x17')],function(_0x585295){return{'model':db[_0x585295[_0x38d9('0x18')]],'as':_0x585295['as'],'attributes':_0x585295['attributes']};}):[]};}):[]};}):[]:[]})[_0x38d9('0xa')](function(_0x21f21b){logger[_0x38d9('0xb')](_0x38d9('0x1e'),_0x5e81f3);logger[_0x38d9('0xe')]('ShowZendeskAccount',_0x5e81f3,JSON['stringify'](_0x21f21b));_0x470ced(_0x21f21b);})[_0x38d9('0x1f')](function(_0x108b8a){logger[_0x38d9('0xf')](_0x38d9('0x1e'),_0x108b8a[_0x38d9('0x10')],_0x5e81f3);_0x49d690(_0x1c28b5[_0x38d9('0xf')](0x1f4,_0x108b8a[_0x38d9('0x10')]));});});}; \ No newline at end of file +var _0xa059=['stringify','error','message','catch','ZendeskAccount','options','raw','where','attributes','limit','include','model','map','GetZendeskAccount','find','ShowZendeskAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','http','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s'];(function(_0xa56b53,_0x53dbb7){var _0x19849f=function(_0x503946){while(--_0x503946){_0xa56b53['push'](_0xa56b53['shift']());}};_0x19849f(++_0x53dbb7);}(_0xa059,0x90));var _0x9a05=function(_0x535286,_0x4ce9d0){_0x535286=_0x535286-0x0;var _0x2726b6=_0xa059[_0x535286];return _0x2726b6;};'use strict';var _=require(_0x9a05('0x0'));var util=require(_0x9a05('0x1'));var moment=require(_0x9a05('0x2'));var BPromise=require(_0x9a05('0x3'));var rs=require(_0x9a05('0x4'));var fs=require('fs');var Redis=require(_0x9a05('0x5'));var db=require(_0x9a05('0x6'))['db'];var utils=require(_0x9a05('0x7'));var logger=require(_0x9a05('0x8'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x9a05('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x592321,_0x594279,_0x3d7937){return new BPromise(function(_0x403ed3,_0x138b24){return client['request'](_0x592321,_0x3d7937)[_0x9a05('0xa')](function(_0x3fb358){logger[_0x9a05('0xb')](_0x9a05('0xc'),_0x594279,_0x9a05('0xd'));logger[_0x9a05('0xe')](_0x9a05('0xf'),_0x594279,'request\x20sent',JSON[_0x9a05('0x10')](_0x3fb358));if(_0x3fb358[_0x9a05('0x11')]){if(_0x3fb358['error']['code']===0x1f4){logger['error']('ZendeskAccount,\x20%s,\x20%s',_0x594279,_0x3fb358['error']['message']);return _0x138b24(_0x3fb358[_0x9a05('0x11')][_0x9a05('0x12')]);}logger[_0x9a05('0x11')](_0x9a05('0xc'),_0x594279,_0x3fb358['error'][_0x9a05('0x12')]);return _0x403ed3(_0x3fb358[_0x9a05('0x11')][_0x9a05('0x12')]);}else{logger['info'](_0x9a05('0xc'),_0x594279,_0x9a05('0xd'));_0x403ed3(_0x3fb358['result']['message']);}})[_0x9a05('0x13')](function(_0x4c1697){logger[_0x9a05('0x11')](_0x9a05('0xc'),_0x594279,_0x4c1697);_0x138b24(_0x4c1697);});});}exports['GetZendeskAccount']=function(_0x52c5a6){var _0x4bf5a8=this;return new Promise(function(_0x4b01e6,_0x3ecf07){return db[_0x9a05('0x14')]['findAll']({'raw':_0x52c5a6['options']?_0x52c5a6[_0x9a05('0x15')][_0x9a05('0x16')]===undefined?!![]:![]:!![],'where':_0x52c5a6[_0x9a05('0x15')]?_0x52c5a6[_0x9a05('0x15')][_0x9a05('0x17')]||null:null,'attributes':_0x52c5a6[_0x9a05('0x15')]?_0x52c5a6[_0x9a05('0x15')][_0x9a05('0x18')]||null:null,'limit':_0x52c5a6[_0x9a05('0x15')]?_0x52c5a6['options'][_0x9a05('0x19')]||null:null,'include':_0x52c5a6['options']?_0x52c5a6[_0x9a05('0x15')][_0x9a05('0x1a')]?_['map'](_0x52c5a6[_0x9a05('0x15')][_0x9a05('0x1a')],function(_0x35217c){return{'model':db[_0x35217c[_0x9a05('0x1b')]],'as':_0x35217c['as'],'attributes':_0x35217c[_0x9a05('0x18')],'include':_0x35217c[_0x9a05('0x1a')]?_[_0x9a05('0x1c')](_0x35217c[_0x9a05('0x1a')],function(_0x25fbe4){return{'model':db[_0x25fbe4[_0x9a05('0x1b')]],'as':_0x25fbe4['as'],'attributes':_0x25fbe4['attributes'],'include':_0x25fbe4['include']?_[_0x9a05('0x1c')](_0x25fbe4[_0x9a05('0x1a')],function(_0x5916a6){return{'model':db[_0x5916a6[_0x9a05('0x1b')]],'as':_0x5916a6['as'],'attributes':_0x5916a6[_0x9a05('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5a353c){logger[_0x9a05('0xb')](_0x9a05('0x1d'),_0x52c5a6);logger[_0x9a05('0xe')](_0x9a05('0x1d'),_0x52c5a6,JSON[_0x9a05('0x10')](_0x5a353c));_0x4b01e6(_0x5a353c);})[_0x9a05('0x13')](function(_0x4ed754){logger['error'](_0x9a05('0x1d'),_0x4ed754[_0x9a05('0x12')],_0x52c5a6);_0x3ecf07(_0x4bf5a8[_0x9a05('0x11')](0x1f4,_0x4ed754[_0x9a05('0x12')]));});});};exports['ShowZendeskAccount']=function(_0x576046){var _0x3df7f1=this;return new Promise(function(_0x332fd5,_0x13b907){return db['ZendeskAccount'][_0x9a05('0x1e')]({'raw':_0x576046[_0x9a05('0x15')]?_0x576046['options'][_0x9a05('0x16')]===undefined?!![]:![]:!![],'where':_0x576046[_0x9a05('0x15')]?_0x576046['options']['where']||null:null,'attributes':_0x576046[_0x9a05('0x15')]?_0x576046[_0x9a05('0x15')][_0x9a05('0x18')]||null:null,'include':_0x576046['options']?_0x576046[_0x9a05('0x15')][_0x9a05('0x1a')]?_[_0x9a05('0x1c')](_0x576046['options'][_0x9a05('0x1a')],function(_0x2d5d20){return{'model':db[_0x2d5d20['model']],'as':_0x2d5d20['as'],'attributes':_0x2d5d20[_0x9a05('0x18')],'include':_0x2d5d20[_0x9a05('0x1a')]?_[_0x9a05('0x1c')](_0x2d5d20[_0x9a05('0x1a')],function(_0x8e862d){return{'model':db[_0x8e862d['model']],'as':_0x8e862d['as'],'attributes':_0x8e862d[_0x9a05('0x18')],'include':_0x8e862d[_0x9a05('0x1a')]?_['map'](_0x8e862d[_0x9a05('0x1a')],function(_0x173d4e){return{'model':db[_0x173d4e[_0x9a05('0x1b')]],'as':_0x173d4e['as'],'attributes':_0x173d4e[_0x9a05('0x18')]};}):[]};}):[]};}):[]:[]})[_0x9a05('0xa')](function(_0x225336){logger[_0x9a05('0xb')](_0x9a05('0x1f'),_0x576046);logger['debug'](_0x9a05('0x1f'),_0x576046,JSON['stringify'](_0x225336));_0x332fd5(_0x225336);})['catch'](function(_0x23e025){logger[_0x9a05('0x11')](_0x9a05('0x1f'),_0x23e025[_0x9a05('0x12')],_0x576046);_0x13b907(_0x3df7f1[_0x9a05('0x11')](0x1f4,_0x23e025[_0x9a05('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index 44adc43..3f99205 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 _0x153f=['/:id/descriptions','getDescriptions','/:id/tags','getTags','post','create','put','/:id','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./intZendeskConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','getFields','/:id/subjects','getSubjects'];(function(_0x13d792,_0x2679ac){var _0x14b3f7=function(_0x56fd40){while(--_0x56fd40){_0x13d792['push'](_0x13d792['shift']());}};_0x14b3f7(++_0x2679ac);}(_0x153f,0x15b));var _0xf153=function(_0x57a80f,_0x1964cc){_0x57a80f=_0x57a80f-0x0;var _0x43a6cf=_0x153f[_0x57a80f];return _0x43a6cf;};'use strict';var multer=require(_0xf153('0x0'));var util=require(_0xf153('0x1'));var path=require(_0xf153('0x2'));var timeout=require(_0xf153('0x3'));var express=require(_0xf153('0x4'));var router=express[_0xf153('0x5')]();var fs_extra=require(_0xf153('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xf153('0x7'));var config=require('../../config/environment');var controller=require(_0xf153('0x8'));router[_0xf153('0x9')]('/',auth[_0xf153('0xa')](),controller[_0xf153('0xb')]);router[_0xf153('0x9')]('/:id',auth[_0xf153('0xa')](),controller[_0xf153('0xc')]);router[_0xf153('0x9')](_0xf153('0xd'),auth[_0xf153('0xa')](),controller[_0xf153('0xe')]);router[_0xf153('0x9')](_0xf153('0xf'),auth[_0xf153('0xa')](),controller[_0xf153('0x10')]);router['get'](_0xf153('0x11'),auth[_0xf153('0xa')](),controller[_0xf153('0x12')]);router['get'](_0xf153('0x13'),auth[_0xf153('0xa')](),controller[_0xf153('0x14')]);router[_0xf153('0x15')]('/',auth[_0xf153('0xa')](),controller[_0xf153('0x16')]);router[_0xf153('0x15')](_0xf153('0x13'),auth[_0xf153('0xa')](),controller['setTags']);router[_0xf153('0x17')](_0xf153('0x18'),auth[_0xf153('0xa')](),controller[_0xf153('0x19')]);router[_0xf153('0x1a')](_0xf153('0x18'),auth[_0xf153('0xa')](),controller[_0xf153('0x1b')]);module['exports']=router; \ No newline at end of file +var _0xb688=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','index','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','create','update','exports','util'];(function(_0xaf29da,_0x117f5a){var _0x295c51=function(_0x3feaf4){while(--_0x3feaf4){_0xaf29da['push'](_0xaf29da['shift']());}};_0x295c51(++_0x117f5a);}(_0xb688,0xcf));var _0x8b68=function(_0x58c18d,_0x4c0584){_0x58c18d=_0x58c18d-0x0;var _0x20bd58=_0xb688[_0x58c18d];return _0x20bd58;};'use strict';var multer=require('multer');var util=require(_0x8b68('0x0'));var path=require(_0x8b68('0x1'));var timeout=require(_0x8b68('0x2'));var express=require(_0x8b68('0x3'));var router=express[_0x8b68('0x4')]();var fs_extra=require(_0x8b68('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x8b68('0x6'));var config=require(_0x8b68('0x7'));var controller=require(_0x8b68('0x8'));router[_0x8b68('0x9')]('/',auth['isAuthenticated'](),controller[_0x8b68('0xa')]);router['get'](_0x8b68('0xb'),auth[_0x8b68('0xc')](),controller[_0x8b68('0xd')]);router[_0x8b68('0x9')](_0x8b68('0xe'),auth[_0x8b68('0xc')](),controller[_0x8b68('0xf')]);router[_0x8b68('0x9')](_0x8b68('0x10'),auth[_0x8b68('0xc')](),controller[_0x8b68('0x11')]);router[_0x8b68('0x9')](_0x8b68('0x12'),auth['isAuthenticated'](),controller[_0x8b68('0x13')]);router[_0x8b68('0x9')](_0x8b68('0x14'),auth[_0x8b68('0xc')](),controller[_0x8b68('0x15')]);router[_0x8b68('0x16')]('/',auth[_0x8b68('0xc')](),controller[_0x8b68('0x17')]);router[_0x8b68('0x16')]('/:id/tags',auth[_0x8b68('0xc')](),controller['setTags']);router['put'](_0x8b68('0xb'),auth[_0x8b68('0xc')](),controller[_0x8b68('0x18')]);router['delete']('/:id',auth[_0x8b68('0xc')](),controller['destroy']);module[_0x8b68('0x19')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index 0235b17..389f066 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 _0xc7ba=['exports','STRING'];(function(_0x625a73,_0x50ae08){var _0x3eceb5=function(_0x9e9500){while(--_0x9e9500){_0x625a73['push'](_0x625a73['shift']());}};_0x3eceb5(++_0x50ae08);}(_0xc7ba,0xae));var _0xac7b=function(_0x228429,_0x25e53f){_0x228429=_0x228429-0x0;var _0x224852=_0xc7ba[_0x228429];return _0x224852;};'use strict';var Sequelize=require('sequelize');module[_0xac7b('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xac7b('0x1')]}}; \ No newline at end of file +var _0x5764=['STRING','exports'];(function(_0x28ac59,_0x193d3a){var _0x2c98dc=function(_0x3a351b){while(--_0x3a351b){_0x28ac59['push'](_0x28ac59['shift']());}};_0x2c98dc(++_0x193d3a);}(_0x5764,0x169));var _0x4576=function(_0xbdb106,_0x5ee065){_0xbdb106=_0xbdb106-0x0;var _0x4c844d=_0x5764[_0xbdb106];return _0x4c844d;};'use strict';var Sequelize=require('sequelize');module[_0x4576('0x0')]={'name':{'type':Sequelize[_0x4576('0x1')]},'description':{'type':Sequelize[_0x4576('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index d2673f7..64b618e 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 _0x0dd7=['count','limit','set','json','apply','reject','save','update','then','destroy','error','stack','name','send','fieldName','type','key','query','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','ZendeskConfiguration','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','find','body','getFields','findOne','ZendeskField','fields','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined'];(function(_0x46712d,_0x24e525){var _0x10c2fb=function(_0x3b78d3){while(--_0x3b78d3){_0x46712d['push'](_0x46712d['shift']());}};_0x10c2fb(++_0x24e525);}(_0x0dd7,0x140));var _0x70dd=function(_0x56e0e8,_0x16ef91){_0x56e0e8=_0x56e0e8-0x0;var _0x2dab50=_0x0dd7[_0x56e0e8];return _0x2dab50;};'use strict';var emlformat=require(_0x70dd('0x0'));var rimraf=require(_0x70dd('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x70dd('0x2'));var rp=require(_0x70dd('0x3'));var moment=require(_0x70dd('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x70dd('0x5'));var util=require(_0x70dd('0x6'));var path=require(_0x70dd('0x7'));var sox=require(_0x70dd('0x8'));var csv=require(_0x70dd('0x9'));var ejs=require(_0x70dd('0xa'));var fs=require('fs');var fs_extra=require(_0x70dd('0xb'));var _=require(_0x70dd('0xc'));var squel=require('squel');var crypto=require(_0x70dd('0xd'));var jsforce=require(_0x70dd('0xe'));var deskjs=require(_0x70dd('0xf'));var toCsv=require(_0x70dd('0x9'));var querystring=require(_0x70dd('0x10'));var Papa=require(_0x70dd('0x11'));var Redis=require(_0x70dd('0x12'));var authService=require(_0x70dd('0x13'));var qs=require(_0x70dd('0x14'));var as=require(_0x70dd('0x15'));var hardwareService=require(_0x70dd('0x16'));var logger=require(_0x70dd('0x17'))('api');var utils=require(_0x70dd('0x18'));var config=require(_0x70dd('0x19'));var licenseUtil=require(_0x70dd('0x1a'));var db=require(_0x70dd('0x1b'))['db'];function respondWithStatusCode(_0x362f51,_0x25057d){_0x25057d=_0x25057d||0xcc;return function(_0x21673a){if(_0x21673a){return _0x362f51['sendStatus'](_0x25057d);}return _0x362f51[_0x70dd('0x1c')](_0x25057d)[_0x70dd('0x1d')]();};}function respondWithResult(_0x1ca794,_0x297a3c){_0x297a3c=_0x297a3c||0xc8;return function(_0x407805){if(_0x407805){return _0x1ca794[_0x70dd('0x1c')](_0x297a3c)['json'](_0x407805);}};}function respondWithFilteredResult(_0x2fb3cf,_0x29d04a){return function(_0x4c32e6){if(_0x4c32e6){var _0x224b8f=typeof _0x29d04a[_0x70dd('0x1e')]===_0x70dd('0x1f')&&typeof _0x29d04a['limit']===_0x70dd('0x1f');var _0x3bd4ef=_0x4c32e6['count'];var _0x4b3ba0=_0x224b8f?0x0:_0x29d04a['offset'];var _0x4c0ddb=_0x224b8f?_0x4c32e6[_0x70dd('0x20')]:_0x29d04a[_0x70dd('0x1e')]+_0x29d04a[_0x70dd('0x21')];var _0x2e0d1a;if(_0x4c0ddb>=_0x3bd4ef){_0x4c0ddb=_0x3bd4ef;_0x2e0d1a=0xc8;}else{_0x2e0d1a=0xce;}_0x2fb3cf['status'](_0x2e0d1a);return _0x2fb3cf[_0x70dd('0x22')]('Content-Range',_0x4b3ba0+'-'+_0x4c0ddb+'/'+_0x3bd4ef)[_0x70dd('0x23')](_0x4c32e6);}return null;};}function patchUpdates(_0x43c284){return function(_0x55e34b){try{jsonpatch[_0x70dd('0x24')](_0x55e34b,_0x43c284,!![]);}catch(_0x36281b){return BPromise[_0x70dd('0x25')](_0x36281b);}return _0x55e34b[_0x70dd('0x26')]();};}function saveUpdates(_0x229791,_0x290487){return function(_0x1c67be){if(_0x1c67be){return _0x1c67be[_0x70dd('0x27')](_0x229791)[_0x70dd('0x28')](function(_0x4217a4){return _0x4217a4;});}return null;};}function removeEntity(_0x13c079,_0x2ef56b){return function(_0x43829b){if(_0x43829b){return _0x43829b[_0x70dd('0x29')]()['then'](function(){_0x13c079[_0x70dd('0x1c')](0xcc)[_0x70dd('0x1d')]();});}};}function handleEntityNotFound(_0x4604af,_0xc7618d){return function(_0x33c7a3){if(!_0x33c7a3){_0x4604af['sendStatus'](0x194);}return _0x33c7a3;};}function handleError(_0x532717,_0x543367){_0x543367=_0x543367||0x1f4;return function(_0x170a0f){logger[_0x70dd('0x2a')](_0x170a0f[_0x70dd('0x2b')]);if(_0x170a0f[_0x70dd('0x2c')]){delete _0x170a0f[_0x70dd('0x2c')];}_0x532717[_0x70dd('0x1c')](_0x543367)[_0x70dd('0x2d')](_0x170a0f);};}exports['index']=function(_0x4740fb,_0x210545){var _0x1125de={},_0x4d3c92={},_0x47bcbd={'count':0x0,'rows':[]};var _0xb25f3b=_['map'](db['ZendeskConfiguration']['rawAttributes'],function(_0x58bdb8){return{'name':_0x58bdb8[_0x70dd('0x2e')],'type':_0x58bdb8[_0x70dd('0x2f')][_0x70dd('0x30')]};});_0x4d3c92['model']=_['map'](_0xb25f3b,_0x70dd('0x2c'));_0x4d3c92[_0x70dd('0x31')]=_['keys'](_0x4740fb['query']);_0x4d3c92[_0x70dd('0x32')]=_[_0x70dd('0x33')](_0x4d3c92[_0x70dd('0x34')],_0x4d3c92[_0x70dd('0x31')]);_0x1125de['attributes']=_[_0x70dd('0x33')](_0x4d3c92[_0x70dd('0x34')],qs['fields'](_0x4740fb[_0x70dd('0x31')]['fields']));_0x1125de[_0x70dd('0x35')]=_0x1125de['attributes'][_0x70dd('0x36')]?_0x1125de['attributes']:_0x4d3c92[_0x70dd('0x34')];if(!_0x4740fb[_0x70dd('0x31')][_0x70dd('0x37')](_0x70dd('0x38'))){_0x1125de[_0x70dd('0x21')]=qs['limit'](_0x4740fb['query'][_0x70dd('0x21')]);_0x1125de[_0x70dd('0x1e')]=qs[_0x70dd('0x1e')](_0x4740fb[_0x70dd('0x31')]['offset']);}_0x1125de[_0x70dd('0x39')]=qs[_0x70dd('0x3a')](_0x4740fb['query']['sort']);_0x1125de[_0x70dd('0x3b')]=qs[_0x70dd('0x32')](_[_0x70dd('0x3c')](_0x4740fb[_0x70dd('0x31')],_0x4d3c92[_0x70dd('0x32')]),_0xb25f3b);if(_0x4740fb[_0x70dd('0x31')][_0x70dd('0x3d')]){_0x1125de['where']=_[_0x70dd('0x3e')](_0x1125de[_0x70dd('0x3b')],{'$or':_[_0x70dd('0x3f')](_0xb25f3b,function(_0x5e820a){if(_0x5e820a['type']!==_0x70dd('0x40')){var _0x3827a5={};_0x3827a5[_0x5e820a[_0x70dd('0x2c')]]={'$like':'%'+_0x4740fb['query'][_0x70dd('0x3d')]+'%'};return _0x3827a5;}})});}_0x1125de=_['merge']({},_0x1125de,_0x4740fb[_0x70dd('0x41')]);var _0x3ec27a={'where':_0x1125de['where']};return db[_0x70dd('0x42')][_0x70dd('0x20')](_0x3ec27a)[_0x70dd('0x28')](function(_0x37de8d){_0x47bcbd[_0x70dd('0x20')]=_0x37de8d;if(_0x4740fb[_0x70dd('0x31')][_0x70dd('0x43')]){_0x1125de[_0x70dd('0x44')]=[{'all':!![]}];}return db[_0x70dd('0x42')][_0x70dd('0x45')](_0x1125de);})[_0x70dd('0x28')](function(_0x3dcbf1){_0x47bcbd[_0x70dd('0x46')]=_0x3dcbf1;return _0x47bcbd;})[_0x70dd('0x28')](respondWithFilteredResult(_0x210545,_0x1125de))[_0x70dd('0x47')](handleError(_0x210545,null));};exports[_0x70dd('0x48')]=function(_0x40dd70,_0x53d9f1){var _0xfbe581={'raw':![],'where':{'id':_0x40dd70[_0x70dd('0x49')]['id']}},_0x1551c1={};_0x1551c1[_0x70dd('0x34')]=_[_0x70dd('0x4a')](db[_0x70dd('0x42')][_0x70dd('0x4b')]);_0x1551c1[_0x70dd('0x31')]=_[_0x70dd('0x4a')](_0x40dd70[_0x70dd('0x31')]);_0x1551c1[_0x70dd('0x32')]=_[_0x70dd('0x33')](_0x1551c1[_0x70dd('0x34')],_0x1551c1[_0x70dd('0x31')]);_0xfbe581['attributes']=_[_0x70dd('0x33')](_0x1551c1[_0x70dd('0x34')],qs['fields'](_0x40dd70[_0x70dd('0x31')]['fields']));_0xfbe581[_0x70dd('0x35')]=_0xfbe581[_0x70dd('0x35')][_0x70dd('0x36')]?_0xfbe581['attributes']:_0x1551c1[_0x70dd('0x34')];if(_0x40dd70[_0x70dd('0x31')][_0x70dd('0x43')]){_0xfbe581[_0x70dd('0x44')]=[{'all':!![]}];}_0xfbe581=_[_0x70dd('0x3e')]({},_0xfbe581,_0x40dd70[_0x70dd('0x41')]);return db['ZendeskConfiguration'][_0x70dd('0x4c')](_0xfbe581)[_0x70dd('0x28')](handleEntityNotFound(_0x53d9f1,null))[_0x70dd('0x28')](respondWithResult(_0x53d9f1,null))[_0x70dd('0x47')](handleError(_0x53d9f1,null));};exports['create']=function(_0x356ac7,_0x3f89a0){return db[_0x70dd('0x42')]['create'](_0x356ac7[_0x70dd('0x4d')],{})[_0x70dd('0x28')](respondWithResult(_0x3f89a0,0xc9))['catch'](handleError(_0x3f89a0,null));};exports[_0x70dd('0x27')]=function(_0x2a923f,_0x4df7dd){if(_0x2a923f[_0x70dd('0x4d')]['id']){delete _0x2a923f['body']['id'];}return db[_0x70dd('0x42')]['find']({'where':{'id':_0x2a923f[_0x70dd('0x49')]['id']}})['then'](handleEntityNotFound(_0x4df7dd,null))[_0x70dd('0x28')](saveUpdates(_0x2a923f['body'],null))[_0x70dd('0x28')](respondWithResult(_0x4df7dd,null))[_0x70dd('0x47')](handleError(_0x4df7dd,null));};exports[_0x70dd('0x29')]=function(_0x331a6d,_0x31bb09){return db['ZendeskConfiguration'][_0x70dd('0x4c')]({'where':{'id':_0x331a6d[_0x70dd('0x49')]['id']}})[_0x70dd('0x28')](handleEntityNotFound(_0x31bb09,null))[_0x70dd('0x28')](removeEntity(_0x31bb09,null))[_0x70dd('0x47')](handleError(_0x31bb09,null));};exports[_0x70dd('0x4e')]=function(_0x5a1c0f,_0x2ed25d,_0x1dc8eb){var _0x267a6e={};var _0x480795={};var _0x315935;var _0x5c37ce;return db['ZendeskConfiguration'][_0x70dd('0x4f')]({'where':{'id':_0x5a1c0f[_0x70dd('0x49')]['id']}})[_0x70dd('0x28')](handleEntityNotFound(_0x2ed25d,null))['then'](function(_0x22453e){if(_0x22453e){_0x315935=_0x22453e;_0x480795[_0x70dd('0x34')]=_[_0x70dd('0x4a')](db[_0x70dd('0x50')][_0x70dd('0x4b')]);_0x480795[_0x70dd('0x31')]=_[_0x70dd('0x4a')](_0x5a1c0f[_0x70dd('0x31')]);_0x480795[_0x70dd('0x32')]=_[_0x70dd('0x33')](_0x480795[_0x70dd('0x34')],_0x480795[_0x70dd('0x31')]);_0x267a6e[_0x70dd('0x35')]=_[_0x70dd('0x33')](_0x480795[_0x70dd('0x34')],qs[_0x70dd('0x51')](_0x5a1c0f[_0x70dd('0x31')][_0x70dd('0x51')]));_0x267a6e[_0x70dd('0x35')]=_0x267a6e['attributes'][_0x70dd('0x36')]?_0x267a6e[_0x70dd('0x35')]:_0x480795['model'];_0x267a6e[_0x70dd('0x39')]=qs[_0x70dd('0x3a')](_0x5a1c0f[_0x70dd('0x31')][_0x70dd('0x3a')]);_0x267a6e[_0x70dd('0x3b')]=qs[_0x70dd('0x32')](_[_0x70dd('0x3c')](_0x5a1c0f[_0x70dd('0x31')],_0x480795[_0x70dd('0x32')]));if(_0x5a1c0f[_0x70dd('0x31')]['filter']){_0x267a6e[_0x70dd('0x3b')]=_[_0x70dd('0x3e')](_0x267a6e[_0x70dd('0x3b')],{'$or':_['map'](_0x267a6e[_0x70dd('0x35')],function(_0x590194){var _0x414e49={};_0x414e49[_0x590194]={'$like':'%'+_0x5a1c0f[_0x70dd('0x31')]['filter']+'%'};return _0x414e49;})});}_0x267a6e=_[_0x70dd('0x3e')]({},_0x267a6e,_0x5a1c0f['options']);return _0x315935[_0x70dd('0x4e')](_0x267a6e);}})[_0x70dd('0x28')](function(_0x206a24){if(_0x206a24){_0x5c37ce=_0x206a24[_0x70dd('0x36')];if(!_0x5a1c0f[_0x70dd('0x31')][_0x70dd('0x37')](_0x70dd('0x38'))){_0x267a6e[_0x70dd('0x21')]=qs['limit'](_0x5a1c0f['query'][_0x70dd('0x21')]);_0x267a6e[_0x70dd('0x1e')]=qs[_0x70dd('0x1e')](_0x5a1c0f[_0x70dd('0x31')][_0x70dd('0x1e')]);}return _0x315935['getFields'](_0x267a6e);}})[_0x70dd('0x28')](function(_0xd3bf2f){if(_0xd3bf2f){return _0xd3bf2f?{'count':_0x5c37ce,'rows':_0xd3bf2f}:null;}})[_0x70dd('0x28')](respondWithResult(_0x2ed25d,null))['catch'](handleError(_0x2ed25d,null));};exports[_0x70dd('0x52')]=function(_0x27d653,_0xfbdba9,_0x177ee9){var _0x1eb31e={};var _0x5bd546={};var _0x297fc1;var _0x465ec7;return db[_0x70dd('0x42')]['findOne']({'where':{'id':_0x27d653[_0x70dd('0x49')]['id']}})[_0x70dd('0x28')](handleEntityNotFound(_0xfbdba9,null))['then'](function(_0x51f694){if(_0x51f694){_0x297fc1=_0x51f694;_0x5bd546[_0x70dd('0x34')]=_[_0x70dd('0x4a')](db[_0x70dd('0x50')][_0x70dd('0x4b')]);_0x5bd546[_0x70dd('0x31')]=_['keys'](_0x27d653[_0x70dd('0x31')]);_0x5bd546['filters']=_['intersection'](_0x5bd546['model'],_0x5bd546[_0x70dd('0x31')]);_0x1eb31e[_0x70dd('0x35')]=_[_0x70dd('0x33')](_0x5bd546[_0x70dd('0x34')],qs['fields'](_0x27d653[_0x70dd('0x31')][_0x70dd('0x51')]));_0x1eb31e['attributes']=_0x1eb31e[_0x70dd('0x35')]['length']?_0x1eb31e[_0x70dd('0x35')]:_0x5bd546[_0x70dd('0x34')];_0x1eb31e[_0x70dd('0x39')]=qs[_0x70dd('0x3a')](_0x27d653[_0x70dd('0x31')][_0x70dd('0x3a')]);_0x1eb31e['where']=qs[_0x70dd('0x32')](_['pick'](_0x27d653[_0x70dd('0x31')],_0x5bd546[_0x70dd('0x32')]));if(_0x27d653['query'][_0x70dd('0x3d')]){_0x1eb31e['where']=_[_0x70dd('0x3e')](_0x1eb31e[_0x70dd('0x3b')],{'$or':_[_0x70dd('0x3f')](_0x1eb31e[_0x70dd('0x35')],function(_0x2c018c){var _0x4071f8={};_0x4071f8[_0x2c018c]={'$like':'%'+_0x27d653[_0x70dd('0x31')][_0x70dd('0x3d')]+'%'};return _0x4071f8;})});}_0x1eb31e=_['merge']({},_0x1eb31e,_0x27d653['options']);return _0x297fc1['getSubjects'](_0x1eb31e);}})[_0x70dd('0x28')](function(_0x122f65){if(_0x122f65){_0x465ec7=_0x122f65[_0x70dd('0x36')];if(!_0x27d653['query']['hasOwnProperty']('nolimit')){_0x1eb31e['limit']=qs[_0x70dd('0x21')](_0x27d653[_0x70dd('0x31')][_0x70dd('0x21')]);_0x1eb31e[_0x70dd('0x1e')]=qs[_0x70dd('0x1e')](_0x27d653[_0x70dd('0x31')][_0x70dd('0x1e')]);}return _0x297fc1[_0x70dd('0x52')](_0x1eb31e);}})[_0x70dd('0x28')](function(_0x112547){if(_0x112547){return _0x112547?{'count':_0x465ec7,'rows':_0x112547}:null;}})[_0x70dd('0x28')](respondWithResult(_0xfbdba9,null))[_0x70dd('0x47')](handleError(_0xfbdba9,null));};exports[_0x70dd('0x53')]=function(_0x5c01f6,_0xf7310a,_0x134276){var _0xe423ad={};var _0x1488c6={};var _0x2d02bf;var _0x5d137d;return db[_0x70dd('0x42')]['findOne']({'where':{'id':_0x5c01f6[_0x70dd('0x49')]['id']}})[_0x70dd('0x28')](handleEntityNotFound(_0xf7310a,null))[_0x70dd('0x28')](function(_0x1e4256){if(_0x1e4256){_0x2d02bf=_0x1e4256;_0x1488c6[_0x70dd('0x34')]=_[_0x70dd('0x4a')](db[_0x70dd('0x50')]['rawAttributes']);_0x1488c6[_0x70dd('0x31')]=_[_0x70dd('0x4a')](_0x5c01f6[_0x70dd('0x31')]);_0x1488c6[_0x70dd('0x32')]=_['intersection'](_0x1488c6[_0x70dd('0x34')],_0x1488c6[_0x70dd('0x31')]);_0xe423ad['attributes']=_['intersection'](_0x1488c6[_0x70dd('0x34')],qs[_0x70dd('0x51')](_0x5c01f6[_0x70dd('0x31')]['fields']));_0xe423ad[_0x70dd('0x35')]=_0xe423ad[_0x70dd('0x35')][_0x70dd('0x36')]?_0xe423ad['attributes']:_0x1488c6[_0x70dd('0x34')];_0xe423ad[_0x70dd('0x39')]=qs[_0x70dd('0x3a')](_0x5c01f6[_0x70dd('0x31')]['sort']);_0xe423ad[_0x70dd('0x3b')]=qs[_0x70dd('0x32')](_[_0x70dd('0x3c')](_0x5c01f6['query'],_0x1488c6[_0x70dd('0x32')]));if(_0x5c01f6['query'][_0x70dd('0x3d')]){_0xe423ad[_0x70dd('0x3b')]=_[_0x70dd('0x3e')](_0xe423ad[_0x70dd('0x3b')],{'$or':_[_0x70dd('0x3f')](_0xe423ad['attributes'],function(_0x296ba3){var _0x15d4dc={};_0x15d4dc[_0x296ba3]={'$like':'%'+_0x5c01f6['query'][_0x70dd('0x3d')]+'%'};return _0x15d4dc;})});}_0xe423ad=_[_0x70dd('0x3e')]({},_0xe423ad,_0x5c01f6[_0x70dd('0x41')]);return _0x2d02bf[_0x70dd('0x53')](_0xe423ad);}})[_0x70dd('0x28')](function(_0x4553f4){if(_0x4553f4){_0x5d137d=_0x4553f4[_0x70dd('0x36')];if(!_0x5c01f6[_0x70dd('0x31')][_0x70dd('0x37')](_0x70dd('0x38'))){_0xe423ad[_0x70dd('0x21')]=qs[_0x70dd('0x21')](_0x5c01f6['query'][_0x70dd('0x21')]);_0xe423ad[_0x70dd('0x1e')]=qs[_0x70dd('0x1e')](_0x5c01f6[_0x70dd('0x31')]['offset']);}return _0x2d02bf[_0x70dd('0x53')](_0xe423ad);}})['then'](function(_0x5972cc){if(_0x5972cc){return _0x5972cc?{'count':_0x5d137d,'rows':_0x5972cc}:null;}})[_0x70dd('0x28')](respondWithResult(_0xf7310a,null))[_0x70dd('0x47')](handleError(_0xf7310a,null));};exports[_0x70dd('0x54')]=function(_0x3ee748,_0x2b29b3,_0x57a503){var _0x1b63b8={};var _0x163046={};var _0x212ff1;var _0x29f190;return db[_0x70dd('0x42')]['findOne']({'where':{'id':_0x3ee748['params']['id']}})['then'](handleEntityNotFound(_0x2b29b3,null))[_0x70dd('0x28')](function(_0x41acd8){if(_0x41acd8){_0x212ff1=_0x41acd8;_0x163046['model']=_[_0x70dd('0x4a')](db[_0x70dd('0x55')][_0x70dd('0x4b')]);_0x163046['query']=_[_0x70dd('0x4a')](_0x3ee748[_0x70dd('0x31')]);_0x163046[_0x70dd('0x32')]=_['intersection'](_0x163046[_0x70dd('0x34')],_0x163046[_0x70dd('0x31')]);_0x1b63b8[_0x70dd('0x35')]=_[_0x70dd('0x33')](_0x163046[_0x70dd('0x34')],qs[_0x70dd('0x51')](_0x3ee748['query']['fields']));_0x1b63b8[_0x70dd('0x35')]=_0x1b63b8['attributes'][_0x70dd('0x36')]?_0x1b63b8[_0x70dd('0x35')]:_0x163046[_0x70dd('0x34')];_0x1b63b8['order']=qs['sort'](_0x3ee748[_0x70dd('0x31')][_0x70dd('0x3a')]);_0x1b63b8[_0x70dd('0x3b')]=qs[_0x70dd('0x32')](_[_0x70dd('0x3c')](_0x3ee748[_0x70dd('0x31')],_0x163046[_0x70dd('0x32')]));if(_0x3ee748['query'][_0x70dd('0x3d')]){_0x1b63b8['where']=_['merge'](_0x1b63b8[_0x70dd('0x3b')],{'$or':_[_0x70dd('0x3f')](_0x1b63b8[_0x70dd('0x35')],function(_0x54eb94){var _0x20bd73={};_0x20bd73[_0x54eb94]={'$like':'%'+_0x3ee748[_0x70dd('0x31')][_0x70dd('0x3d')]+'%'};return _0x20bd73;})});}_0x1b63b8=_[_0x70dd('0x3e')]({},_0x1b63b8,_0x3ee748['options']);return _0x212ff1[_0x70dd('0x54')](_0x1b63b8);}})['then'](function(_0xf6a518){if(_0xf6a518){_0x29f190=_0xf6a518['length'];if(!_0x3ee748[_0x70dd('0x31')][_0x70dd('0x37')](_0x70dd('0x38'))){_0x1b63b8['limit']=qs[_0x70dd('0x21')](_0x3ee748['query'][_0x70dd('0x21')]);_0x1b63b8[_0x70dd('0x1e')]=qs[_0x70dd('0x1e')](_0x3ee748[_0x70dd('0x31')][_0x70dd('0x1e')]);}return _0x212ff1[_0x70dd('0x54')](_0x1b63b8);}})[_0x70dd('0x28')](function(_0x39a06c){if(_0x39a06c){return _0x39a06c?{'count':_0x29f190,'rows':_0x39a06c}:null;}})[_0x70dd('0x28')](respondWithResult(_0x2b29b3,null))[_0x70dd('0x47')](handleError(_0x2b29b3,null));};exports[_0x70dd('0x56')]=function(_0x279485,_0x5069f2,_0x4e4915){if(_0x279485[_0x70dd('0x4d')]['id']){delete _0x279485[_0x70dd('0x4d')]['id'];}return db[_0x70dd('0x42')]['findOne']({'where':{'id':_0x279485['params']['id']}})[_0x70dd('0x28')](handleEntityNotFound(_0x5069f2,null))[_0x70dd('0x28')](function(_0x2b0411){if(_0x2b0411){return _0x2b0411[_0x70dd('0x56')](_0x279485[_0x70dd('0x4d')][_0x70dd('0x57')]||[]);}return null;})[_0x70dd('0x28')](respondWithResult(_0x5069f2,null))['catch'](handleError(_0x5069f2,null));}; \ No newline at end of file +var _0xa6ec=['filters','pick','filter','merge','VIRTUAL','name','options','includeAll','rows','catch','params','include','find','create','body','getFields','findOne','ZendeskField','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','send','index','map','ZendeskConfiguration','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where'];(function(_0xc14056,_0x126272){var _0x2f6b98=function(_0x546f9e){while(--_0x546f9e){_0xc14056['push'](_0xc14056['shift']());}};_0x2f6b98(++_0x126272);}(_0xa6ec,0x1c1));var _0xca6e=function(_0x12fa80,_0x902b57){_0x12fa80=_0x12fa80-0x0;var _0x2b939b=_0xa6ec[_0x12fa80];return _0x2b939b;};'use strict';var emlformat=require(_0xca6e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xca6e('0x1'));var jsonpatch=require(_0xca6e('0x2'));var rp=require(_0xca6e('0x3'));var moment=require('moment');var BPromise=require(_0xca6e('0x4'));var Mustache=require(_0xca6e('0x5'));var util=require(_0xca6e('0x6'));var path=require(_0xca6e('0x7'));var sox=require(_0xca6e('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xca6e('0x9'));var _=require(_0xca6e('0xa'));var squel=require(_0xca6e('0xb'));var crypto=require('crypto');var jsforce=require(_0xca6e('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xca6e('0xd'));var Papa=require(_0xca6e('0xe'));var Redis=require(_0xca6e('0xf'));var authService=require(_0xca6e('0x10'));var qs=require(_0xca6e('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xca6e('0x12'));var logger=require('../../config/logger')(_0xca6e('0x13'));var utils=require(_0xca6e('0x14'));var config=require(_0xca6e('0x15'));var licenseUtil=require(_0xca6e('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2b3bff,_0x5d1827){_0x5d1827=_0x5d1827||0xcc;return function(_0x4e2d8e){if(_0x4e2d8e){return _0x2b3bff[_0xca6e('0x17')](_0x5d1827);}return _0x2b3bff['status'](_0x5d1827)[_0xca6e('0x18')]();};}function respondWithResult(_0x591b34,_0x1f45f8){_0x1f45f8=_0x1f45f8||0xc8;return function(_0x381a4b){if(_0x381a4b){return _0x591b34[_0xca6e('0x19')](_0x1f45f8)[_0xca6e('0x1a')](_0x381a4b);}};}function respondWithFilteredResult(_0x32ef3d,_0x26bc14){return function(_0x1fcec6){if(_0x1fcec6){var _0x3f71ae=typeof _0x26bc14[_0xca6e('0x1b')]===_0xca6e('0x1c')&&typeof _0x26bc14['limit']===_0xca6e('0x1c');var _0x395ef4=_0x1fcec6[_0xca6e('0x1d')];var _0x4d60f9=_0x3f71ae?0x0:_0x26bc14['offset'];var _0xefa332=_0x3f71ae?_0x1fcec6[_0xca6e('0x1d')]:_0x26bc14[_0xca6e('0x1b')]+_0x26bc14['limit'];var _0x3aaee8;if(_0xefa332>=_0x395ef4){_0xefa332=_0x395ef4;_0x3aaee8=0xc8;}else{_0x3aaee8=0xce;}_0x32ef3d[_0xca6e('0x19')](_0x3aaee8);return _0x32ef3d[_0xca6e('0x1e')](_0xca6e('0x1f'),_0x4d60f9+'-'+_0xefa332+'/'+_0x395ef4)[_0xca6e('0x1a')](_0x1fcec6);}return null;};}function patchUpdates(_0x17efcb){return function(_0x11df38){try{jsonpatch[_0xca6e('0x20')](_0x11df38,_0x17efcb,!![]);}catch(_0x27530a){return BPromise[_0xca6e('0x21')](_0x27530a);}return _0x11df38[_0xca6e('0x22')]();};}function saveUpdates(_0xc5cf87,_0x89bd6){return function(_0x14f01e){if(_0x14f01e){return _0x14f01e[_0xca6e('0x23')](_0xc5cf87)['then'](function(_0x456662){return _0x456662;});}return null;};}function removeEntity(_0x2cfd3f,_0x4d54ef){return function(_0x19c573){if(_0x19c573){return _0x19c573[_0xca6e('0x24')]()[_0xca6e('0x25')](function(){_0x2cfd3f['status'](0xcc)[_0xca6e('0x18')]();});}};}function handleEntityNotFound(_0x29353d,_0x443805){return function(_0x198187){if(!_0x198187){_0x29353d['sendStatus'](0x194);}return _0x198187;};}function handleError(_0x22d985,_0x136c11){_0x136c11=_0x136c11||0x1f4;return function(_0x12d1f4){logger[_0xca6e('0x26')](_0x12d1f4[_0xca6e('0x27')]);if(_0x12d1f4['name']){delete _0x12d1f4['name'];}_0x22d985[_0xca6e('0x19')](_0x136c11)[_0xca6e('0x28')](_0x12d1f4);};}exports[_0xca6e('0x29')]=function(_0x17944b,_0x3d1021){var _0x498fb6={},_0x272e90={},_0x497c73={'count':0x0,'rows':[]};var _0x253b81=_[_0xca6e('0x2a')](db[_0xca6e('0x2b')][_0xca6e('0x2c')],function(_0x40ca81){return{'name':_0x40ca81[_0xca6e('0x2d')],'type':_0x40ca81[_0xca6e('0x2e')][_0xca6e('0x2f')]};});_0x272e90[_0xca6e('0x30')]=_[_0xca6e('0x2a')](_0x253b81,'name');_0x272e90['query']=_[_0xca6e('0x31')](_0x17944b[_0xca6e('0x32')]);_0x272e90['filters']=_[_0xca6e('0x33')](_0x272e90[_0xca6e('0x30')],_0x272e90['query']);_0x498fb6[_0xca6e('0x34')]=_['intersection'](_0x272e90[_0xca6e('0x30')],qs[_0xca6e('0x35')](_0x17944b[_0xca6e('0x32')][_0xca6e('0x35')]));_0x498fb6['attributes']=_0x498fb6[_0xca6e('0x34')][_0xca6e('0x36')]?_0x498fb6[_0xca6e('0x34')]:_0x272e90['model'];if(!_0x17944b[_0xca6e('0x32')][_0xca6e('0x37')](_0xca6e('0x38'))){_0x498fb6[_0xca6e('0x39')]=qs[_0xca6e('0x39')](_0x17944b['query']['limit']);_0x498fb6[_0xca6e('0x1b')]=qs[_0xca6e('0x1b')](_0x17944b['query'][_0xca6e('0x1b')]);}_0x498fb6[_0xca6e('0x3a')]=qs[_0xca6e('0x3b')](_0x17944b[_0xca6e('0x32')][_0xca6e('0x3b')]);_0x498fb6[_0xca6e('0x3c')]=qs[_0xca6e('0x3d')](_[_0xca6e('0x3e')](_0x17944b[_0xca6e('0x32')],_0x272e90[_0xca6e('0x3d')]),_0x253b81);if(_0x17944b[_0xca6e('0x32')][_0xca6e('0x3f')]){_0x498fb6[_0xca6e('0x3c')]=_[_0xca6e('0x40')](_0x498fb6[_0xca6e('0x3c')],{'$or':_[_0xca6e('0x2a')](_0x253b81,function(_0x5aee14){if(_0x5aee14['type']!==_0xca6e('0x41')){var _0x2bf4a9={};_0x2bf4a9[_0x5aee14[_0xca6e('0x42')]]={'$like':'%'+_0x17944b[_0xca6e('0x32')][_0xca6e('0x3f')]+'%'};return _0x2bf4a9;}})});}_0x498fb6=_[_0xca6e('0x40')]({},_0x498fb6,_0x17944b[_0xca6e('0x43')]);var _0x49f5ed={'where':_0x498fb6['where']};return db['ZendeskConfiguration'][_0xca6e('0x1d')](_0x49f5ed)['then'](function(_0x2d8b81){_0x497c73[_0xca6e('0x1d')]=_0x2d8b81;if(_0x17944b[_0xca6e('0x32')][_0xca6e('0x44')]){_0x498fb6['include']=[{'all':!![]}];}return db[_0xca6e('0x2b')]['findAll'](_0x498fb6);})[_0xca6e('0x25')](function(_0x101237){_0x497c73[_0xca6e('0x45')]=_0x101237;return _0x497c73;})[_0xca6e('0x25')](respondWithFilteredResult(_0x3d1021,_0x498fb6))[_0xca6e('0x46')](handleError(_0x3d1021,null));};exports['show']=function(_0x43716c,_0x12e476){var _0x12b631={'raw':![],'where':{'id':_0x43716c[_0xca6e('0x47')]['id']}},_0x5b16f2={};_0x5b16f2[_0xca6e('0x30')]=_[_0xca6e('0x31')](db['ZendeskConfiguration']['rawAttributes']);_0x5b16f2[_0xca6e('0x32')]=_['keys'](_0x43716c[_0xca6e('0x32')]);_0x5b16f2[_0xca6e('0x3d')]=_[_0xca6e('0x33')](_0x5b16f2[_0xca6e('0x30')],_0x5b16f2['query']);_0x12b631[_0xca6e('0x34')]=_[_0xca6e('0x33')](_0x5b16f2['model'],qs[_0xca6e('0x35')](_0x43716c[_0xca6e('0x32')][_0xca6e('0x35')]));_0x12b631[_0xca6e('0x34')]=_0x12b631['attributes'][_0xca6e('0x36')]?_0x12b631[_0xca6e('0x34')]:_0x5b16f2[_0xca6e('0x30')];if(_0x43716c[_0xca6e('0x32')]['includeAll']){_0x12b631[_0xca6e('0x48')]=[{'all':!![]}];}_0x12b631=_['merge']({},_0x12b631,_0x43716c[_0xca6e('0x43')]);return db[_0xca6e('0x2b')][_0xca6e('0x49')](_0x12b631)[_0xca6e('0x25')](handleEntityNotFound(_0x12e476,null))[_0xca6e('0x25')](respondWithResult(_0x12e476,null))['catch'](handleError(_0x12e476,null));};exports[_0xca6e('0x4a')]=function(_0x38e27b,_0x157dc5){return db[_0xca6e('0x2b')][_0xca6e('0x4a')](_0x38e27b[_0xca6e('0x4b')],{})[_0xca6e('0x25')](respondWithResult(_0x157dc5,0xc9))[_0xca6e('0x46')](handleError(_0x157dc5,null));};exports['update']=function(_0x25280f,_0xcc3eb0){if(_0x25280f[_0xca6e('0x4b')]['id']){delete _0x25280f['body']['id'];}return db[_0xca6e('0x2b')]['find']({'where':{'id':_0x25280f['params']['id']}})[_0xca6e('0x25')](handleEntityNotFound(_0xcc3eb0,null))[_0xca6e('0x25')](saveUpdates(_0x25280f[_0xca6e('0x4b')],null))[_0xca6e('0x25')](respondWithResult(_0xcc3eb0,null))[_0xca6e('0x46')](handleError(_0xcc3eb0,null));};exports[_0xca6e('0x24')]=function(_0x462548,_0x5ae9a2){return db[_0xca6e('0x2b')]['find']({'where':{'id':_0x462548[_0xca6e('0x47')]['id']}})[_0xca6e('0x25')](handleEntityNotFound(_0x5ae9a2,null))[_0xca6e('0x25')](removeEntity(_0x5ae9a2,null))[_0xca6e('0x46')](handleError(_0x5ae9a2,null));};exports[_0xca6e('0x4c')]=function(_0x43872c,_0x207c76,_0x5c17ce){var _0x90171d={};var _0xdd881d={};var _0x5aea54;var _0x17b582;return db['ZendeskConfiguration'][_0xca6e('0x4d')]({'where':{'id':_0x43872c['params']['id']}})[_0xca6e('0x25')](handleEntityNotFound(_0x207c76,null))['then'](function(_0x2b46cf){if(_0x2b46cf){_0x5aea54=_0x2b46cf;_0xdd881d['model']=_[_0xca6e('0x31')](db[_0xca6e('0x4e')][_0xca6e('0x2c')]);_0xdd881d[_0xca6e('0x32')]=_[_0xca6e('0x31')](_0x43872c[_0xca6e('0x32')]);_0xdd881d['filters']=_[_0xca6e('0x33')](_0xdd881d['model'],_0xdd881d['query']);_0x90171d['attributes']=_[_0xca6e('0x33')](_0xdd881d[_0xca6e('0x30')],qs['fields'](_0x43872c[_0xca6e('0x32')]['fields']));_0x90171d[_0xca6e('0x34')]=_0x90171d[_0xca6e('0x34')]['length']?_0x90171d[_0xca6e('0x34')]:_0xdd881d[_0xca6e('0x30')];_0x90171d[_0xca6e('0x3a')]=qs['sort'](_0x43872c[_0xca6e('0x32')][_0xca6e('0x3b')]);_0x90171d['where']=qs[_0xca6e('0x3d')](_[_0xca6e('0x3e')](_0x43872c[_0xca6e('0x32')],_0xdd881d['filters']));if(_0x43872c[_0xca6e('0x32')][_0xca6e('0x3f')]){_0x90171d[_0xca6e('0x3c')]=_[_0xca6e('0x40')](_0x90171d[_0xca6e('0x3c')],{'$or':_['map'](_0x90171d['attributes'],function(_0x5aea7f){var _0x2a1c92={};_0x2a1c92[_0x5aea7f]={'$like':'%'+_0x43872c[_0xca6e('0x32')][_0xca6e('0x3f')]+'%'};return _0x2a1c92;})});}_0x90171d=_['merge']({},_0x90171d,_0x43872c[_0xca6e('0x43')]);return _0x5aea54[_0xca6e('0x4c')](_0x90171d);}})['then'](function(_0x3e6ea9){if(_0x3e6ea9){_0x17b582=_0x3e6ea9['length'];if(!_0x43872c[_0xca6e('0x32')][_0xca6e('0x37')](_0xca6e('0x38'))){_0x90171d[_0xca6e('0x39')]=qs[_0xca6e('0x39')](_0x43872c['query'][_0xca6e('0x39')]);_0x90171d[_0xca6e('0x1b')]=qs[_0xca6e('0x1b')](_0x43872c['query'][_0xca6e('0x1b')]);}return _0x5aea54[_0xca6e('0x4c')](_0x90171d);}})[_0xca6e('0x25')](function(_0x12539f){if(_0x12539f){return _0x12539f?{'count':_0x17b582,'rows':_0x12539f}:null;}})[_0xca6e('0x25')](respondWithResult(_0x207c76,null))['catch'](handleError(_0x207c76,null));};exports[_0xca6e('0x4f')]=function(_0x2ef0da,_0x358ad8,_0x3f2008){var _0x35f6c9={};var _0xbf9f5f={};var _0xc57cda;var _0x119983;return db[_0xca6e('0x2b')][_0xca6e('0x4d')]({'where':{'id':_0x2ef0da[_0xca6e('0x47')]['id']}})['then'](handleEntityNotFound(_0x358ad8,null))[_0xca6e('0x25')](function(_0x274a6c){if(_0x274a6c){_0xc57cda=_0x274a6c;_0xbf9f5f[_0xca6e('0x30')]=_[_0xca6e('0x31')](db[_0xca6e('0x4e')][_0xca6e('0x2c')]);_0xbf9f5f[_0xca6e('0x32')]=_[_0xca6e('0x31')](_0x2ef0da[_0xca6e('0x32')]);_0xbf9f5f[_0xca6e('0x3d')]=_[_0xca6e('0x33')](_0xbf9f5f[_0xca6e('0x30')],_0xbf9f5f[_0xca6e('0x32')]);_0x35f6c9[_0xca6e('0x34')]=_[_0xca6e('0x33')](_0xbf9f5f[_0xca6e('0x30')],qs[_0xca6e('0x35')](_0x2ef0da[_0xca6e('0x32')][_0xca6e('0x35')]));_0x35f6c9[_0xca6e('0x34')]=_0x35f6c9[_0xca6e('0x34')]['length']?_0x35f6c9[_0xca6e('0x34')]:_0xbf9f5f[_0xca6e('0x30')];_0x35f6c9[_0xca6e('0x3a')]=qs['sort'](_0x2ef0da['query'][_0xca6e('0x3b')]);_0x35f6c9[_0xca6e('0x3c')]=qs[_0xca6e('0x3d')](_[_0xca6e('0x3e')](_0x2ef0da['query'],_0xbf9f5f[_0xca6e('0x3d')]));if(_0x2ef0da[_0xca6e('0x32')][_0xca6e('0x3f')]){_0x35f6c9[_0xca6e('0x3c')]=_[_0xca6e('0x40')](_0x35f6c9[_0xca6e('0x3c')],{'$or':_[_0xca6e('0x2a')](_0x35f6c9[_0xca6e('0x34')],function(_0x4db6e6){var _0x4a894d={};_0x4a894d[_0x4db6e6]={'$like':'%'+_0x2ef0da[_0xca6e('0x32')][_0xca6e('0x3f')]+'%'};return _0x4a894d;})});}_0x35f6c9=_[_0xca6e('0x40')]({},_0x35f6c9,_0x2ef0da[_0xca6e('0x43')]);return _0xc57cda[_0xca6e('0x4f')](_0x35f6c9);}})[_0xca6e('0x25')](function(_0x26cef5){if(_0x26cef5){_0x119983=_0x26cef5[_0xca6e('0x36')];if(!_0x2ef0da['query'][_0xca6e('0x37')]('nolimit')){_0x35f6c9[_0xca6e('0x39')]=qs[_0xca6e('0x39')](_0x2ef0da['query'][_0xca6e('0x39')]);_0x35f6c9[_0xca6e('0x1b')]=qs[_0xca6e('0x1b')](_0x2ef0da[_0xca6e('0x32')][_0xca6e('0x1b')]);}return _0xc57cda[_0xca6e('0x4f')](_0x35f6c9);}})[_0xca6e('0x25')](function(_0x15ddf4){if(_0x15ddf4){return _0x15ddf4?{'count':_0x119983,'rows':_0x15ddf4}:null;}})[_0xca6e('0x25')](respondWithResult(_0x358ad8,null))['catch'](handleError(_0x358ad8,null));};exports[_0xca6e('0x50')]=function(_0x5cf2e7,_0x3a6936,_0xba750){var _0x1e220e={};var _0x5703ee={};var _0x4e3504;var _0x543e1d;return db[_0xca6e('0x2b')][_0xca6e('0x4d')]({'where':{'id':_0x5cf2e7[_0xca6e('0x47')]['id']}})[_0xca6e('0x25')](handleEntityNotFound(_0x3a6936,null))['then'](function(_0x2c78bb){if(_0x2c78bb){_0x4e3504=_0x2c78bb;_0x5703ee[_0xca6e('0x30')]=_['keys'](db[_0xca6e('0x4e')]['rawAttributes']);_0x5703ee[_0xca6e('0x32')]=_[_0xca6e('0x31')](_0x5cf2e7[_0xca6e('0x32')]);_0x5703ee[_0xca6e('0x3d')]=_[_0xca6e('0x33')](_0x5703ee[_0xca6e('0x30')],_0x5703ee['query']);_0x1e220e[_0xca6e('0x34')]=_['intersection'](_0x5703ee[_0xca6e('0x30')],qs[_0xca6e('0x35')](_0x5cf2e7[_0xca6e('0x32')][_0xca6e('0x35')]));_0x1e220e[_0xca6e('0x34')]=_0x1e220e[_0xca6e('0x34')][_0xca6e('0x36')]?_0x1e220e[_0xca6e('0x34')]:_0x5703ee['model'];_0x1e220e[_0xca6e('0x3a')]=qs[_0xca6e('0x3b')](_0x5cf2e7[_0xca6e('0x32')]['sort']);_0x1e220e['where']=qs[_0xca6e('0x3d')](_[_0xca6e('0x3e')](_0x5cf2e7['query'],_0x5703ee[_0xca6e('0x3d')]));if(_0x5cf2e7[_0xca6e('0x32')][_0xca6e('0x3f')]){_0x1e220e[_0xca6e('0x3c')]=_[_0xca6e('0x40')](_0x1e220e['where'],{'$or':_[_0xca6e('0x2a')](_0x1e220e['attributes'],function(_0x39bb37){var _0x86f986={};_0x86f986[_0x39bb37]={'$like':'%'+_0x5cf2e7[_0xca6e('0x32')][_0xca6e('0x3f')]+'%'};return _0x86f986;})});}_0x1e220e=_[_0xca6e('0x40')]({},_0x1e220e,_0x5cf2e7[_0xca6e('0x43')]);return _0x4e3504[_0xca6e('0x50')](_0x1e220e);}})['then'](function(_0x1400d1){if(_0x1400d1){_0x543e1d=_0x1400d1[_0xca6e('0x36')];if(!_0x5cf2e7[_0xca6e('0x32')][_0xca6e('0x37')]('nolimit')){_0x1e220e['limit']=qs['limit'](_0x5cf2e7[_0xca6e('0x32')][_0xca6e('0x39')]);_0x1e220e[_0xca6e('0x1b')]=qs[_0xca6e('0x1b')](_0x5cf2e7[_0xca6e('0x32')][_0xca6e('0x1b')]);}return _0x4e3504[_0xca6e('0x50')](_0x1e220e);}})[_0xca6e('0x25')](function(_0x12218a){if(_0x12218a){return _0x12218a?{'count':_0x543e1d,'rows':_0x12218a}:null;}})[_0xca6e('0x25')](respondWithResult(_0x3a6936,null))[_0xca6e('0x46')](handleError(_0x3a6936,null));};exports[_0xca6e('0x51')]=function(_0x2d95a7,_0x239684,_0x35c5b8){var _0x5e4039={};var _0x2928e3={};var _0xc5a799;var _0x47c4d0;return db[_0xca6e('0x2b')][_0xca6e('0x4d')]({'where':{'id':_0x2d95a7[_0xca6e('0x47')]['id']}})[_0xca6e('0x25')](handleEntityNotFound(_0x239684,null))[_0xca6e('0x25')](function(_0x283a4c){if(_0x283a4c){_0xc5a799=_0x283a4c;_0x2928e3['model']=_['keys'](db[_0xca6e('0x52')][_0xca6e('0x2c')]);_0x2928e3['query']=_[_0xca6e('0x31')](_0x2d95a7[_0xca6e('0x32')]);_0x2928e3[_0xca6e('0x3d')]=_[_0xca6e('0x33')](_0x2928e3['model'],_0x2928e3[_0xca6e('0x32')]);_0x5e4039[_0xca6e('0x34')]=_[_0xca6e('0x33')](_0x2928e3[_0xca6e('0x30')],qs[_0xca6e('0x35')](_0x2d95a7[_0xca6e('0x32')][_0xca6e('0x35')]));_0x5e4039['attributes']=_0x5e4039['attributes']['length']?_0x5e4039[_0xca6e('0x34')]:_0x2928e3['model'];_0x5e4039[_0xca6e('0x3a')]=qs[_0xca6e('0x3b')](_0x2d95a7[_0xca6e('0x32')][_0xca6e('0x3b')]);_0x5e4039[_0xca6e('0x3c')]=qs[_0xca6e('0x3d')](_[_0xca6e('0x3e')](_0x2d95a7[_0xca6e('0x32')],_0x2928e3[_0xca6e('0x3d')]));if(_0x2d95a7[_0xca6e('0x32')][_0xca6e('0x3f')]){_0x5e4039[_0xca6e('0x3c')]=_['merge'](_0x5e4039[_0xca6e('0x3c')],{'$or':_['map'](_0x5e4039[_0xca6e('0x34')],function(_0x3a8343){var _0x47a886={};_0x47a886[_0x3a8343]={'$like':'%'+_0x2d95a7[_0xca6e('0x32')][_0xca6e('0x3f')]+'%'};return _0x47a886;})});}_0x5e4039=_['merge']({},_0x5e4039,_0x2d95a7[_0xca6e('0x43')]);return _0xc5a799[_0xca6e('0x51')](_0x5e4039);}})[_0xca6e('0x25')](function(_0x4cc8a9){if(_0x4cc8a9){_0x47c4d0=_0x4cc8a9['length'];if(!_0x2d95a7[_0xca6e('0x32')][_0xca6e('0x37')](_0xca6e('0x38'))){_0x5e4039['limit']=qs[_0xca6e('0x39')](_0x2d95a7[_0xca6e('0x32')][_0xca6e('0x39')]);_0x5e4039[_0xca6e('0x1b')]=qs[_0xca6e('0x1b')](_0x2d95a7['query']['offset']);}return _0xc5a799[_0xca6e('0x51')](_0x5e4039);}})[_0xca6e('0x25')](function(_0x3d54d0){if(_0x3d54d0){return _0x3d54d0?{'count':_0x47c4d0,'rows':_0x3d54d0}:null;}})[_0xca6e('0x25')](respondWithResult(_0x239684,null))[_0xca6e('0x46')](handleError(_0x239684,null));};exports['setTags']=function(_0x3bc267,_0x5d82c4,_0xe04390){if(_0x3bc267[_0xca6e('0x4b')]['id']){delete _0x3bc267['body']['id'];}return db[_0xca6e('0x2b')][_0xca6e('0x4d')]({'where':{'id':_0x3bc267[_0xca6e('0x47')]['id']}})['then'](handleEntityNotFound(_0x5d82c4,null))[_0xca6e('0x25')](function(_0x1a91c9){if(_0x1a91c9){return _0x1a91c9[_0xca6e('0x53')](_0x3bc267[_0xca6e('0x4b')][_0xca6e('0x54')]||[]);}return null;})[_0xca6e('0x25')](respondWithResult(_0x5d82c4,null))[_0xca6e('0x46')](handleError(_0x5d82c4,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index 04cf785..2608941 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 _0x7708=['../../config/environment','exports','define','ZendeskConfiguration','int_zendesk_configurations','lodash','util','api','rimraf'];(function(_0x4d5dc7,_0x39e0d3){var _0x4aca09=function(_0x4d6d9b){while(--_0x4d6d9b){_0x4d5dc7['push'](_0x4d5dc7['shift']());}};_0x4aca09(++_0x39e0d3);}(_0x7708,0x188));var _0x8770=function(_0x1fb1c1,_0x4ebe69){_0x1fb1c1=_0x1fb1c1-0x0;var _0x1622df=_0x7708[_0x1fb1c1];return _0x1622df;};'use strict';var _=require(_0x8770('0x0'));var util=require(_0x8770('0x1'));var logger=require('../../config/logger')(_0x8770('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x8770('0x3'));var config=require(_0x8770('0x4'));var attributes=require('./intZendeskConfiguration.attributes');module[_0x8770('0x5')]=function(_0x50bab7,_0x31390d){return _0x50bab7[_0x8770('0x6')](_0x8770('0x7'),attributes,{'tableName':_0x8770('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbaf0=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration','int_zendesk_configurations','util'];(function(_0x5d8b20,_0x1d45ad){var _0x3becf4=function(_0x55af4e){while(--_0x55af4e){_0x5d8b20['push'](_0x5d8b20['shift']());}};_0x3becf4(++_0x1d45ad);}(_0xbaf0,0x12a));var _0x0baf=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xbaf0[_0x6131cd];return _0x47e916;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));module[_0x0baf('0x9')]=function(_0xe4c3c4,_0x335e24){return _0xe4c3c4[_0x0baf('0xa')](_0x0baf('0xb'),attributes,{'tableName':_0x0baf('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js index 1ea9564..7bc7841 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 _0x28d8=['message','result','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0x28d8,0x1d0));var _0x828d=function(_0x237fb7,_0x89dde7){_0x237fb7=_0x237fb7-0x0;var _0x1e69a5=_0x28d8[_0x237fb7];return _0x1e69a5;};'use strict';var _=require(_0x828d('0x0'));var util=require('util');var moment=require(_0x828d('0x1'));var BPromise=require(_0x828d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x828d('0x3'));var db=require(_0x828d('0x4'))['db'];var utils=require(_0x828d('0x5'));var logger=require('../../config/logger')(_0x828d('0x6'));var config=require(_0x828d('0x7'));var jayson=require(_0x828d('0x8'));var client=jayson['client'][_0x828d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2e148e,_0x45a063,_0x367223){return new BPromise(function(_0x57fb10,_0x17d35f){return client['request'](_0x2e148e,_0x367223)[_0x828d('0xa')](function(_0x4d46a9){logger[_0x828d('0xb')](_0x828d('0xc'),_0x45a063,_0x828d('0xd'));logger[_0x828d('0xe')](_0x828d('0xf'),_0x45a063,_0x828d('0xd'),JSON[_0x828d('0x10')](_0x4d46a9));if(_0x4d46a9[_0x828d('0x11')]){if(_0x4d46a9[_0x828d('0x11')][_0x828d('0x12')]===0x1f4){logger[_0x828d('0x11')]('ZendeskConfiguration,\x20%s,\x20%s',_0x45a063,_0x4d46a9[_0x828d('0x11')][_0x828d('0x13')]);return _0x17d35f(_0x4d46a9[_0x828d('0x11')]['message']);}logger[_0x828d('0x11')](_0x828d('0xc'),_0x45a063,_0x4d46a9[_0x828d('0x11')][_0x828d('0x13')]);return _0x57fb10(_0x4d46a9['error'][_0x828d('0x13')]);}else{logger[_0x828d('0xb')](_0x828d('0xc'),_0x45a063,_0x828d('0xd'));_0x57fb10(_0x4d46a9[_0x828d('0x14')][_0x828d('0x13')]);}})['catch'](function(_0x488138){logger['error']('ZendeskConfiguration,\x20%s,\x20%s',_0x45a063,_0x488138);_0x17d35f(_0x488138);});});} \ No newline at end of file +var _0x4992=['info','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ZendeskConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','jayson/promise','http','request'];(function(_0x3e3bee,_0x4f91fe){var _0x3ae14c=function(_0x3861a0){while(--_0x3861a0){_0x3e3bee['push'](_0x3e3bee['shift']());}};_0x3ae14c(++_0x4f91fe);}(_0x4992,0xd2));var _0x2499=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x4992[_0x13d07a];return _0x5ee0ee;};'use strict';var _=require(_0x2499('0x0'));var util=require(_0x2499('0x1'));var moment=require(_0x2499('0x2'));var BPromise=require(_0x2499('0x3'));var rs=require(_0x2499('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x2499('0x5'));var logger=require(_0x2499('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x2499('0x7'));var client=jayson['client'][_0x2499('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x58e0c4,_0x3529a1,_0x1463b1){return new BPromise(function(_0x274eaf,_0xc7c71){return client[_0x2499('0x9')](_0x58e0c4,_0x1463b1)['then'](function(_0x75e34e){logger[_0x2499('0xa')]('ZendeskConfiguration,\x20%s,\x20%s',_0x3529a1,'request\x20sent');logger['debug'](_0x2499('0xb'),_0x3529a1,_0x2499('0xc'),JSON[_0x2499('0xd')](_0x75e34e));if(_0x75e34e['error']){if(_0x75e34e[_0x2499('0xe')][_0x2499('0xf')]===0x1f4){logger[_0x2499('0xe')](_0x2499('0x10'),_0x3529a1,_0x75e34e['error'][_0x2499('0x11')]);return _0xc7c71(_0x75e34e[_0x2499('0xe')][_0x2499('0x11')]);}logger[_0x2499('0xe')](_0x2499('0x10'),_0x3529a1,_0x75e34e[_0x2499('0xe')]['message']);return _0x274eaf(_0x75e34e['error'][_0x2499('0x11')]);}else{logger['info'](_0x2499('0x10'),_0x3529a1,_0x2499('0xc'));_0x274eaf(_0x75e34e[_0x2499('0x12')]['message']);}})[_0x2499('0x13')](function(_0x3639c9){logger[_0x2499('0xe')](_0x2499('0x10'),_0x3529a1,_0x3639c9);_0xc7c71(_0x3639c9);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index 0778b5f..8d08b3a 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 _0xeb8f=['multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','post','create','put','update','delete','destroy','exports'];(function(_0x51b177,_0x545b8e){var _0x18e416=function(_0x46827d){while(--_0x46827d){_0x51b177['push'](_0x51b177['shift']());}};_0x18e416(++_0x545b8e);}(_0xeb8f,0x18f));var _0xfeb8=function(_0x554f89,_0x111bd0){_0x554f89=_0x554f89-0x0;var _0x1fa724=_0xeb8f[_0x554f89];return _0x1fa724;};'use strict';var multer=require(_0xfeb8('0x0'));var util=require(_0xfeb8('0x1'));var path=require(_0xfeb8('0x2'));var timeout=require(_0xfeb8('0x3'));var express=require(_0xfeb8('0x4'));var router=express['Router']();var fs_extra=require(_0xfeb8('0x5'));var auth=require(_0xfeb8('0x6'));var interaction=require(_0xfeb8('0x7'));var config=require(_0xfeb8('0x8'));var controller=require('./intZendeskField.controller');router[_0xfeb8('0x9')]('/',auth[_0xfeb8('0xa')](),controller['index']);router['get'](_0xfeb8('0xb'),auth[_0xfeb8('0xa')](),controller['show']);router[_0xfeb8('0xc')]('/',auth[_0xfeb8('0xa')](),controller[_0xfeb8('0xd')]);router[_0xfeb8('0xe')](_0xfeb8('0xb'),auth[_0xfeb8('0xa')](),controller[_0xfeb8('0xf')]);router[_0xfeb8('0x10')]('/:id',auth[_0xfeb8('0xa')](),controller[_0xfeb8('0x11')]);module[_0xfeb8('0x12')]=router; \ No newline at end of file +var _0x102a=['show','post','create','put','update','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','isAuthenticated','index','/:id'];(function(_0x115fb0,_0x3b93ae){var _0x119632=function(_0x1c9d9f){while(--_0x1c9d9f){_0x115fb0['push'](_0x115fb0['shift']());}};_0x119632(++_0x3b93ae);}(_0x102a,0x196));var _0xa102=function(_0x16043e,_0x2f6b9d){_0x16043e=_0x16043e-0x0;var _0x5a10c6=_0x102a[_0x16043e];return _0x5a10c6;};'use strict';var multer=require(_0xa102('0x0'));var util=require('util');var path=require(_0xa102('0x1'));var timeout=require(_0xa102('0x2'));var express=require(_0xa102('0x3'));var router=express[_0xa102('0x4')]();var fs_extra=require(_0xa102('0x5'));var auth=require(_0xa102('0x6'));var interaction=require(_0xa102('0x7'));var config=require(_0xa102('0x8'));var controller=require(_0xa102('0x9'));router[_0xa102('0xa')]('/',auth[_0xa102('0xb')](),controller[_0xa102('0xc')]);router[_0xa102('0xa')](_0xa102('0xd'),auth[_0xa102('0xb')](),controller[_0xa102('0xe')]);router[_0xa102('0xf')]('/',auth[_0xa102('0xb')](),controller[_0xa102('0x10')]);router[_0xa102('0x11')](_0xa102('0xd'),auth[_0xa102('0xb')](),controller[_0xa102('0x12')]);router['delete']('/:id',auth[_0xa102('0xb')](),controller[_0xa102('0x13')]);module[_0xa102('0x14')]=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index fe6453c..0f98dd2 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 _0xc5eb=['STRING','string','variable','customVariable','ENUM'];(function(_0x3343d6,_0x5678d9){var _0x1cc8d2=function(_0x4408ee){while(--_0x4408ee){_0x3343d6['push'](_0x3343d6['shift']());}};_0x1cc8d2(++_0x5678d9);}(_0xc5eb,0x1dc));var _0xbc5e=function(_0x19bce8,_0x2299eb){_0x19bce8=_0x19bce8-0x0;var _0x563135=_0xc5eb[_0x19bce8];return _0x563135;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize['ENUM'](_0xbc5e('0x0'),_0xbc5e('0x1'),_0xbc5e('0x2'),'keyValue','picklist'),'defaultValue':_0xbc5e('0x0')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xbc5e('0x3')]('string',_0xbc5e('0x1'),_0xbc5e('0x2'))},'keyContent':{'type':Sequelize[_0xbc5e('0x4')]},'idField':{'type':Sequelize[_0xbc5e('0x4')]},'nameField':{'type':Sequelize[_0xbc5e('0x4')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xbc5e('0x4')]}}; \ No newline at end of file +var _0xcbea=['picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','keyValue'];(function(_0x5b14df,_0x2d6d66){var _0x1285e8=function(_0xbc19ce){while(--_0xbc19ce){_0x5b14df['push'](_0x5b14df['shift']());}};_0x1285e8(++_0x2d6d66);}(_0xcbea,0x143));var _0xacbe=function(_0x71fc67,_0x431dcb){_0x71fc67=_0x71fc67-0x0;var _0x22a759=_0xcbea[_0x71fc67];return _0x22a759;};'use strict';var Sequelize=require(_0xacbe('0x0'));module[_0xacbe('0x1')]={'type':{'type':Sequelize[_0xacbe('0x2')](_0xacbe('0x3'),_0xacbe('0x4'),_0xacbe('0x5'),_0xacbe('0x6'),_0xacbe('0x7')),'defaultValue':_0xacbe('0x3')},'content':{'type':Sequelize[_0xacbe('0x8')]},'key':{'type':Sequelize[_0xacbe('0x8')]},'keyType':{'type':Sequelize[_0xacbe('0x2')](_0xacbe('0x3'),_0xacbe('0x4'),_0xacbe('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xacbe('0x8')]},'customField':{'type':Sequelize[_0xacbe('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xacbe('0x8')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index 98ad293..4c2396b 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 _0x4d56=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','count','set','Content-Range','apply','update','then','destroy','status','error','stack','name','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','ZendeskField','findAll','rows','show','options','find','catch','create','body','params','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x4d56,0x16a));var _0x64d5=function(_0x5038f7,_0x5cdb0e){_0x5038f7=_0x5038f7-0x0;var _0x436f6f=_0x4d56[_0x5038f7];return _0x436f6f;};'use strict';var emlformat=require(_0x64d5('0x0'));var rimraf=require(_0x64d5('0x1'));var zipdir=require(_0x64d5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x64d5('0x3'));var moment=require(_0x64d5('0x4'));var BPromise=require(_0x64d5('0x5'));var Mustache=require(_0x64d5('0x6'));var util=require(_0x64d5('0x7'));var path=require(_0x64d5('0x8'));var sox=require('sox');var csv=require(_0x64d5('0x9'));var ejs=require(_0x64d5('0xa'));var fs=require('fs');var fs_extra=require(_0x64d5('0xb'));var _=require('lodash');var squel=require(_0x64d5('0xc'));var crypto=require(_0x64d5('0xd'));var jsforce=require(_0x64d5('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x64d5('0x9'));var querystring=require(_0x64d5('0xf'));var Papa=require(_0x64d5('0x10'));var Redis=require(_0x64d5('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x64d5('0x12'));var as=require(_0x64d5('0x13'));var hardwareService=require(_0x64d5('0x14'));var logger=require(_0x64d5('0x15'))(_0x64d5('0x16'));var utils=require(_0x64d5('0x17'));var config=require(_0x64d5('0x18'));var licenseUtil=require(_0x64d5('0x19'));var db=require(_0x64d5('0x1a'))['db'];function respondWithStatusCode(_0x2416b3,_0x497c89){_0x497c89=_0x497c89||0xcc;return function(_0x290e5c){if(_0x290e5c){return _0x2416b3[_0x64d5('0x1b')](_0x497c89);}return _0x2416b3['status'](_0x497c89)[_0x64d5('0x1c')]();};}function respondWithResult(_0x5e3975,_0x480ee6){_0x480ee6=_0x480ee6||0xc8;return function(_0x3d1286){if(_0x3d1286){return _0x5e3975['status'](_0x480ee6)[_0x64d5('0x1d')](_0x3d1286);}};}function respondWithFilteredResult(_0x2777c5,_0x12a8be){return function(_0x5e642f){if(_0x5e642f){var _0x31c9ba=typeof _0x12a8be[_0x64d5('0x1e')]===_0x64d5('0x1f')&&typeof _0x12a8be['limit']==='undefined';var _0x2f4f8c=_0x5e642f[_0x64d5('0x20')];var _0x1aeb8b=_0x31c9ba?0x0:_0x12a8be[_0x64d5('0x1e')];var _0xa42b3a=_0x31c9ba?_0x5e642f[_0x64d5('0x20')]:_0x12a8be['offset']+_0x12a8be['limit'];var _0x2084c3;if(_0xa42b3a>=_0x2f4f8c){_0xa42b3a=_0x2f4f8c;_0x2084c3=0xc8;}else{_0x2084c3=0xce;}_0x2777c5['status'](_0x2084c3);return _0x2777c5[_0x64d5('0x21')](_0x64d5('0x22'),_0x1aeb8b+'-'+_0xa42b3a+'/'+_0x2f4f8c)[_0x64d5('0x1d')](_0x5e642f);}return null;};}function patchUpdates(_0x4477f7){return function(_0x190bf1){try{jsonpatch[_0x64d5('0x23')](_0x190bf1,_0x4477f7,!![]);}catch(_0x4961cc){return BPromise['reject'](_0x4961cc);}return _0x190bf1['save']();};}function saveUpdates(_0x58a98d,_0x18eb5b){return function(_0x1480b2){if(_0x1480b2){return _0x1480b2[_0x64d5('0x24')](_0x58a98d)[_0x64d5('0x25')](function(_0x30dcf7){return _0x30dcf7;});}return null;};}function removeEntity(_0xf93d8c,_0x1d9050){return function(_0x1444ec){if(_0x1444ec){return _0x1444ec[_0x64d5('0x26')]()[_0x64d5('0x25')](function(){_0xf93d8c[_0x64d5('0x27')](0xcc)[_0x64d5('0x1c')]();});}};}function handleEntityNotFound(_0x57f8ee,_0x312cf3){return function(_0x4f8466){if(!_0x4f8466){_0x57f8ee[_0x64d5('0x1b')](0x194);}return _0x4f8466;};}function handleError(_0x2fb4b9,_0x23d681){_0x23d681=_0x23d681||0x1f4;return function(_0x462cfc){logger[_0x64d5('0x28')](_0x462cfc[_0x64d5('0x29')]);if(_0x462cfc[_0x64d5('0x2a')]){delete _0x462cfc[_0x64d5('0x2a')];}_0x2fb4b9[_0x64d5('0x27')](_0x23d681)['send'](_0x462cfc);};}exports['index']=function(_0x389532,_0x2f6478){var _0x3ec062={},_0x1f186e={},_0x63cbcf={'count':0x0,'rows':[]};var _0x278d6e=_['map'](db['ZendeskField'][_0x64d5('0x2b')],function(_0x30a851){return{'name':_0x30a851[_0x64d5('0x2c')],'type':_0x30a851[_0x64d5('0x2d')][_0x64d5('0x2e')]};});_0x1f186e[_0x64d5('0x2f')]=_[_0x64d5('0x30')](_0x278d6e,_0x64d5('0x2a'));_0x1f186e[_0x64d5('0x31')]=_[_0x64d5('0x32')](_0x389532[_0x64d5('0x31')]);_0x1f186e[_0x64d5('0x33')]=_[_0x64d5('0x34')](_0x1f186e['model'],_0x1f186e['query']);_0x3ec062[_0x64d5('0x35')]=_['intersection'](_0x1f186e['model'],qs[_0x64d5('0x36')](_0x389532['query'][_0x64d5('0x36')]));_0x3ec062[_0x64d5('0x35')]=_0x3ec062[_0x64d5('0x35')][_0x64d5('0x37')]?_0x3ec062[_0x64d5('0x35')]:_0x1f186e['model'];if(!_0x389532[_0x64d5('0x31')][_0x64d5('0x38')](_0x64d5('0x39'))){_0x3ec062[_0x64d5('0x3a')]=qs[_0x64d5('0x3a')](_0x389532['query'][_0x64d5('0x3a')]);_0x3ec062[_0x64d5('0x1e')]=qs[_0x64d5('0x1e')](_0x389532[_0x64d5('0x31')][_0x64d5('0x1e')]);}_0x3ec062[_0x64d5('0x3b')]=qs[_0x64d5('0x3c')](_0x389532[_0x64d5('0x31')][_0x64d5('0x3c')]);_0x3ec062[_0x64d5('0x3d')]=qs['filters'](_[_0x64d5('0x3e')](_0x389532[_0x64d5('0x31')],_0x1f186e['filters']),_0x278d6e);if(_0x389532['query'][_0x64d5('0x3f')]){_0x3ec062['where']=_[_0x64d5('0x40')](_0x3ec062[_0x64d5('0x3d')],{'$or':_['map'](_0x278d6e,function(_0x50de07){if(_0x50de07[_0x64d5('0x2d')]!==_0x64d5('0x41')){var _0xca4950={};_0xca4950[_0x50de07['name']]={'$like':'%'+_0x389532[_0x64d5('0x31')][_0x64d5('0x3f')]+'%'};return _0xca4950;}})});}_0x3ec062=_[_0x64d5('0x40')]({},_0x3ec062,_0x389532['options']);var _0x35a8ae={'where':_0x3ec062[_0x64d5('0x3d')]};return db['ZendeskField'][_0x64d5('0x20')](_0x35a8ae)[_0x64d5('0x25')](function(_0x339504){_0x63cbcf[_0x64d5('0x20')]=_0x339504;if(_0x389532[_0x64d5('0x31')][_0x64d5('0x42')]){_0x3ec062['include']=[{'all':!![]}];}return db[_0x64d5('0x43')][_0x64d5('0x44')](_0x3ec062);})[_0x64d5('0x25')](function(_0xfec161){_0x63cbcf[_0x64d5('0x45')]=_0xfec161;return _0x63cbcf;})[_0x64d5('0x25')](respondWithFilteredResult(_0x2f6478,_0x3ec062))['catch'](handleError(_0x2f6478,null));};exports[_0x64d5('0x46')]=function(_0x5bfa16,_0x2c2d52){var _0x3d7e48={'raw':!![],'where':{'id':_0x5bfa16['params']['id']}},_0x233a54={};_0x233a54[_0x64d5('0x2f')]=_[_0x64d5('0x32')](db[_0x64d5('0x43')][_0x64d5('0x2b')]);_0x233a54[_0x64d5('0x31')]=_[_0x64d5('0x32')](_0x5bfa16[_0x64d5('0x31')]);_0x233a54[_0x64d5('0x33')]=_['intersection'](_0x233a54[_0x64d5('0x2f')],_0x233a54[_0x64d5('0x31')]);_0x3d7e48[_0x64d5('0x35')]=_[_0x64d5('0x34')](_0x233a54[_0x64d5('0x2f')],qs['fields'](_0x5bfa16[_0x64d5('0x31')][_0x64d5('0x36')]));_0x3d7e48[_0x64d5('0x35')]=_0x3d7e48[_0x64d5('0x35')][_0x64d5('0x37')]?_0x3d7e48[_0x64d5('0x35')]:_0x233a54[_0x64d5('0x2f')];if(_0x5bfa16[_0x64d5('0x31')][_0x64d5('0x42')]){_0x3d7e48['include']=[{'all':!![]}];}_0x3d7e48=_[_0x64d5('0x40')]({},_0x3d7e48,_0x5bfa16[_0x64d5('0x47')]);return db[_0x64d5('0x43')][_0x64d5('0x48')](_0x3d7e48)[_0x64d5('0x25')](handleEntityNotFound(_0x2c2d52,null))[_0x64d5('0x25')](respondWithResult(_0x2c2d52,null))[_0x64d5('0x49')](handleError(_0x2c2d52,null));};exports[_0x64d5('0x4a')]=function(_0x1f19f1,_0x2be82b){return db[_0x64d5('0x43')][_0x64d5('0x4a')](_0x1f19f1[_0x64d5('0x4b')],{})['then'](respondWithResult(_0x2be82b,0xc9))[_0x64d5('0x49')](handleError(_0x2be82b,null));};exports[_0x64d5('0x24')]=function(_0x2f0732,_0x36703d){if(_0x2f0732['body']['id']){delete _0x2f0732['body']['id'];}return db['ZendeskField'][_0x64d5('0x48')]({'where':{'id':_0x2f0732[_0x64d5('0x4c')]['id']}})[_0x64d5('0x25')](handleEntityNotFound(_0x36703d,null))[_0x64d5('0x25')](saveUpdates(_0x2f0732[_0x64d5('0x4b')],null))[_0x64d5('0x25')](respondWithResult(_0x36703d,null))[_0x64d5('0x49')](handleError(_0x36703d,null));};exports[_0x64d5('0x26')]=function(_0x9af4ee,_0x29a199){return db['ZendeskField'][_0x64d5('0x48')]({'where':{'id':_0x9af4ee[_0x64d5('0x4c')]['id']}})[_0x64d5('0x25')](handleEntityNotFound(_0x29a199,null))[_0x64d5('0x25')](removeEntity(_0x29a199,null))[_0x64d5('0x49')](handleError(_0x29a199,null));}; \ No newline at end of file +var _0x93a0=['create','body','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','destroy','stack','name','send','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','ZendeskField','then','includeAll','include','rows','catch','params','find'];(function(_0x2471a3,_0x87367d){var _0x163c61=function(_0x3506a7){while(--_0x3506a7){_0x2471a3['push'](_0x2471a3['shift']());}};_0x163c61(++_0x87367d);}(_0x93a0,0x1c4));var _0x093a=function(_0x3068da,_0x300c02){_0x3068da=_0x3068da-0x0;var _0x31c3f7=_0x93a0[_0x3068da];return _0x31c3f7;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x093a('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x093a('0x1'));var moment=require(_0x093a('0x2'));var BPromise=require(_0x093a('0x3'));var Mustache=require(_0x093a('0x4'));var util=require(_0x093a('0x5'));var path=require('path');var sox=require(_0x093a('0x6'));var csv=require(_0x093a('0x7'));var ejs=require(_0x093a('0x8'));var fs=require('fs');var fs_extra=require(_0x093a('0x9'));var _=require(_0x093a('0xa'));var squel=require(_0x093a('0xb'));var crypto=require(_0x093a('0xc'));var jsforce=require(_0x093a('0xd'));var deskjs=require(_0x093a('0xe'));var toCsv=require(_0x093a('0x7'));var querystring=require(_0x093a('0xf'));var Papa=require(_0x093a('0x10'));var Redis=require('ioredis');var authService=require(_0x093a('0x11'));var qs=require(_0x093a('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x093a('0x13'));var logger=require(_0x093a('0x14'))(_0x093a('0x15'));var utils=require(_0x093a('0x16'));var config=require(_0x093a('0x17'));var licenseUtil=require(_0x093a('0x18'));var db=require(_0x093a('0x19'))['db'];function respondWithStatusCode(_0x26cafd,_0x3cf6ff){_0x3cf6ff=_0x3cf6ff||0xcc;return function(_0x30b6f9){if(_0x30b6f9){return _0x26cafd[_0x093a('0x1a')](_0x3cf6ff);}return _0x26cafd['status'](_0x3cf6ff)[_0x093a('0x1b')]();};}function respondWithResult(_0x3d8125,_0x449f47){_0x449f47=_0x449f47||0xc8;return function(_0x2193ee){if(_0x2193ee){return _0x3d8125[_0x093a('0x1c')](_0x449f47)['json'](_0x2193ee);}};}function respondWithFilteredResult(_0x50d30f,_0x3e1267){return function(_0x2afa88){if(_0x2afa88){var _0xb9b3a6=typeof _0x3e1267[_0x093a('0x1d')]===_0x093a('0x1e')&&typeof _0x3e1267['limit']===_0x093a('0x1e');var _0x399059=_0x2afa88[_0x093a('0x1f')];var _0x374187=_0xb9b3a6?0x0:_0x3e1267[_0x093a('0x1d')];var _0x3f068a=_0xb9b3a6?_0x2afa88[_0x093a('0x1f')]:_0x3e1267[_0x093a('0x1d')]+_0x3e1267[_0x093a('0x20')];var _0x5c4c4c;if(_0x3f068a>=_0x399059){_0x3f068a=_0x399059;_0x5c4c4c=0xc8;}else{_0x5c4c4c=0xce;}_0x50d30f[_0x093a('0x1c')](_0x5c4c4c);return _0x50d30f[_0x093a('0x21')](_0x093a('0x22'),_0x374187+'-'+_0x3f068a+'/'+_0x399059)[_0x093a('0x23')](_0x2afa88);}return null;};}function patchUpdates(_0x33b7e6){return function(_0x5b8383){try{jsonpatch[_0x093a('0x24')](_0x5b8383,_0x33b7e6,!![]);}catch(_0x486dba){return BPromise[_0x093a('0x25')](_0x486dba);}return _0x5b8383[_0x093a('0x26')]();};}function saveUpdates(_0x218942,_0x56ed82){return function(_0x1170db){if(_0x1170db){return _0x1170db['update'](_0x218942)['then'](function(_0x54381c){return _0x54381c;});}return null;};}function removeEntity(_0x4f5324,_0x3b3a2d){return function(_0x424c09){if(_0x424c09){return _0x424c09[_0x093a('0x27')]()['then'](function(){_0x4f5324[_0x093a('0x1c')](0xcc)[_0x093a('0x1b')]();});}};}function handleEntityNotFound(_0x15fd31,_0x87e291){return function(_0x26e12a){if(!_0x26e12a){_0x15fd31[_0x093a('0x1a')](0x194);}return _0x26e12a;};}function handleError(_0x43debe,_0x879886){_0x879886=_0x879886||0x1f4;return function(_0x2c7000){logger['error'](_0x2c7000[_0x093a('0x28')]);if(_0x2c7000[_0x093a('0x29')]){delete _0x2c7000[_0x093a('0x29')];}_0x43debe[_0x093a('0x1c')](_0x879886)[_0x093a('0x2a')](_0x2c7000);};}exports['index']=function(_0x59247c,_0xb47c40){var _0x1bc2e2={},_0x1b581d={},_0x4de955={'count':0x0,'rows':[]};var _0x36e947=_['map'](db['ZendeskField'][_0x093a('0x2b')],function(_0xfb07ab){return{'name':_0xfb07ab[_0x093a('0x2c')],'type':_0xfb07ab[_0x093a('0x2d')]['key']};});_0x1b581d[_0x093a('0x2e')]=_[_0x093a('0x2f')](_0x36e947,_0x093a('0x29'));_0x1b581d[_0x093a('0x30')]=_[_0x093a('0x31')](_0x59247c[_0x093a('0x30')]);_0x1b581d[_0x093a('0x32')]=_[_0x093a('0x33')](_0x1b581d[_0x093a('0x2e')],_0x1b581d[_0x093a('0x30')]);_0x1bc2e2[_0x093a('0x34')]=_[_0x093a('0x33')](_0x1b581d['model'],qs[_0x093a('0x35')](_0x59247c[_0x093a('0x30')][_0x093a('0x35')]));_0x1bc2e2[_0x093a('0x34')]=_0x1bc2e2[_0x093a('0x34')][_0x093a('0x36')]?_0x1bc2e2[_0x093a('0x34')]:_0x1b581d[_0x093a('0x2e')];if(!_0x59247c[_0x093a('0x30')][_0x093a('0x37')](_0x093a('0x38'))){_0x1bc2e2[_0x093a('0x20')]=qs[_0x093a('0x20')](_0x59247c[_0x093a('0x30')][_0x093a('0x20')]);_0x1bc2e2[_0x093a('0x1d')]=qs['offset'](_0x59247c[_0x093a('0x30')][_0x093a('0x1d')]);}_0x1bc2e2[_0x093a('0x39')]=qs[_0x093a('0x3a')](_0x59247c[_0x093a('0x30')][_0x093a('0x3a')]);_0x1bc2e2[_0x093a('0x3b')]=qs[_0x093a('0x32')](_[_0x093a('0x3c')](_0x59247c['query'],_0x1b581d[_0x093a('0x32')]),_0x36e947);if(_0x59247c[_0x093a('0x30')][_0x093a('0x3d')]){_0x1bc2e2[_0x093a('0x3b')]=_[_0x093a('0x3e')](_0x1bc2e2[_0x093a('0x3b')],{'$or':_[_0x093a('0x2f')](_0x36e947,function(_0xb790f1){if(_0xb790f1['type']!==_0x093a('0x3f')){var _0x4375e9={};_0x4375e9[_0xb790f1[_0x093a('0x29')]]={'$like':'%'+_0x59247c['query'][_0x093a('0x3d')]+'%'};return _0x4375e9;}})});}_0x1bc2e2=_[_0x093a('0x3e')]({},_0x1bc2e2,_0x59247c[_0x093a('0x40')]);var _0x1e742b={'where':_0x1bc2e2[_0x093a('0x3b')]};return db[_0x093a('0x41')]['count'](_0x1e742b)[_0x093a('0x42')](function(_0x23e405){_0x4de955['count']=_0x23e405;if(_0x59247c['query'][_0x093a('0x43')]){_0x1bc2e2[_0x093a('0x44')]=[{'all':!![]}];}return db['ZendeskField']['findAll'](_0x1bc2e2);})[_0x093a('0x42')](function(_0x120af1){_0x4de955[_0x093a('0x45')]=_0x120af1;return _0x4de955;})[_0x093a('0x42')](respondWithFilteredResult(_0xb47c40,_0x1bc2e2))[_0x093a('0x46')](handleError(_0xb47c40,null));};exports['show']=function(_0x5a500f,_0x273e27){var _0x550a32={'raw':!![],'where':{'id':_0x5a500f[_0x093a('0x47')]['id']}},_0x497dbd={};_0x497dbd[_0x093a('0x2e')]=_[_0x093a('0x31')](db[_0x093a('0x41')][_0x093a('0x2b')]);_0x497dbd[_0x093a('0x30')]=_[_0x093a('0x31')](_0x5a500f[_0x093a('0x30')]);_0x497dbd[_0x093a('0x32')]=_['intersection'](_0x497dbd['model'],_0x497dbd[_0x093a('0x30')]);_0x550a32['attributes']=_[_0x093a('0x33')](_0x497dbd[_0x093a('0x2e')],qs[_0x093a('0x35')](_0x5a500f[_0x093a('0x30')][_0x093a('0x35')]));_0x550a32[_0x093a('0x34')]=_0x550a32[_0x093a('0x34')][_0x093a('0x36')]?_0x550a32[_0x093a('0x34')]:_0x497dbd[_0x093a('0x2e')];if(_0x5a500f[_0x093a('0x30')]['includeAll']){_0x550a32[_0x093a('0x44')]=[{'all':!![]}];}_0x550a32=_[_0x093a('0x3e')]({},_0x550a32,_0x5a500f[_0x093a('0x40')]);return db[_0x093a('0x41')][_0x093a('0x48')](_0x550a32)[_0x093a('0x42')](handleEntityNotFound(_0x273e27,null))[_0x093a('0x42')](respondWithResult(_0x273e27,null))[_0x093a('0x46')](handleError(_0x273e27,null));};exports[_0x093a('0x49')]=function(_0x2c28c3,_0x1f16ee){return db[_0x093a('0x41')][_0x093a('0x49')](_0x2c28c3['body'],{})[_0x093a('0x42')](respondWithResult(_0x1f16ee,0xc9))[_0x093a('0x46')](handleError(_0x1f16ee,null));};exports['update']=function(_0x210246,_0x59300c){if(_0x210246[_0x093a('0x4a')]['id']){delete _0x210246[_0x093a('0x4a')]['id'];}return db[_0x093a('0x41')]['find']({'where':{'id':_0x210246[_0x093a('0x47')]['id']}})['then'](handleEntityNotFound(_0x59300c,null))[_0x093a('0x42')](saveUpdates(_0x210246[_0x093a('0x4a')],null))[_0x093a('0x42')](respondWithResult(_0x59300c,null))[_0x093a('0x46')](handleError(_0x59300c,null));};exports[_0x093a('0x27')]=function(_0x28f09c,_0x3bc8ae){return db[_0x093a('0x41')][_0x093a('0x48')]({'where':{'id':_0x28f09c[_0x093a('0x47')]['id']}})[_0x093a('0x42')](handleEntityNotFound(_0x3bc8ae,null))[_0x093a('0x42')](removeEntity(_0x3bc8ae,null))[_0x093a('0x46')](handleError(_0x3bc8ae,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index 1987b5f..32db0c7 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 _0x8540=['path','rimraf','../../config/environment','./intZendeskField.attributes','exports','define','ZendeskField','int_zendesk_fields','zendesk_unique_index','idField','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x36340b,_0x3a7b5c){var _0x4fc9f6=function(_0x373992){while(--_0x373992){_0x36340b['push'](_0x36340b['shift']());}};_0x4fc9f6(++_0x3a7b5c);}(_0x8540,0x1da));var _0x0854=function(_0x2f87cd,_0xcaf299){_0x2f87cd=_0x2f87cd-0x0;var _0x5d7eda=_0x8540[_0x2f87cd];return _0x5d7eda;};'use strict';var _=require(_0x0854('0x0'));var util=require(_0x0854('0x1'));var logger=require(_0x0854('0x2'))('api');var moment=require(_0x0854('0x3'));var BPromise=require(_0x0854('0x4'));var rp=require(_0x0854('0x5'));var fs=require('fs');var path=require(_0x0854('0x6'));var rimraf=require(_0x0854('0x7'));var config=require(_0x0854('0x8'));var attributes=require(_0x0854('0x9'));module[_0x0854('0xa')]=function(_0x2d91d8,_0x490846){return _0x2d91d8[_0x0854('0xb')](_0x0854('0xc'),attributes,{'tableName':_0x0854('0xd'),'paranoid':![],'indexes':[{'name':_0x0854('0xe'),'fields':[_0x0854('0xf'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xfd85=['api','moment','request-promise','path','rimraf','../../config/environment','./intZendeskField.attributes','exports','define','ZendeskField','idField','lodash','util','../../config/logger'];(function(_0x26f7c3,_0x5865b5){var _0x804c69=function(_0x11f9a7){while(--_0x11f9a7){_0x26f7c3['push'](_0x26f7c3['shift']());}};_0x804c69(++_0x5865b5);}(_0xfd85,0x1e7));var _0x5fd8=function(_0x4bb145,_0x3e7d33){_0x4bb145=_0x4bb145-0x0;var _0x4db596=_0xfd85[_0x4bb145];return _0x4db596;};'use strict';var _=require(_0x5fd8('0x0'));var util=require(_0x5fd8('0x1'));var logger=require(_0x5fd8('0x2'))(_0x5fd8('0x3'));var moment=require(_0x5fd8('0x4'));var BPromise=require('bluebird');var rp=require(_0x5fd8('0x5'));var fs=require('fs');var path=require(_0x5fd8('0x6'));var rimraf=require(_0x5fd8('0x7'));var config=require(_0x5fd8('0x8'));var attributes=require(_0x5fd8('0x9'));module[_0x5fd8('0xa')]=function(_0x49841d,_0x2ed34e){return _0x49841d[_0x5fd8('0xb')](_0x5fd8('0xc'),attributes,{'tableName':'int_zendesk_fields','paranoid':![],'indexes':[{'name':'zendesk_unique_index','fields':[_0x5fd8('0xd'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.rpc.js b/server/api/intZendeskField/intZendeskField.rpc.js index 3e64986..80ca17d 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 _0x819c=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb'];(function(_0xc37c8,_0x182df1){var _0x77188f=function(_0xfbdddc){while(--_0xfbdddc){_0xc37c8['push'](_0xc37c8['shift']());}};_0x77188f(++_0x182df1);}(_0x819c,0x1db));var _0xc819=function(_0x49af49,_0x56494b){_0x49af49=_0x49af49-0x0;var _0x57fb76=_0x819c[_0x49af49];return _0x57fb76;};'use strict';var _=require(_0xc819('0x0'));var util=require('util');var moment=require(_0xc819('0x1'));var BPromise=require(_0xc819('0x2'));var rs=require(_0xc819('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc819('0x4'))['db'];var utils=require(_0xc819('0x5'));var logger=require(_0xc819('0x6'))('rpc');var config=require(_0xc819('0x7'));var jayson=require(_0xc819('0x8'));var client=jayson[_0xc819('0x9')][_0xc819('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1b0918,_0x1d3d59,_0x4f350d){return new BPromise(function(_0x392209,_0x2e97b8){return client[_0xc819('0xb')](_0x1b0918,_0x4f350d)[_0xc819('0xc')](function(_0x421b54){logger[_0xc819('0xd')](_0xc819('0xe'),_0x1d3d59,_0xc819('0xf'));logger[_0xc819('0x10')](_0xc819('0x11'),_0x1d3d59,'request\x20sent',JSON[_0xc819('0x12')](_0x421b54));if(_0x421b54[_0xc819('0x13')]){if(_0x421b54[_0xc819('0x13')][_0xc819('0x14')]===0x1f4){logger[_0xc819('0x13')]('ZendeskField,\x20%s,\x20%s',_0x1d3d59,_0x421b54[_0xc819('0x13')]['message']);return _0x2e97b8(_0x421b54[_0xc819('0x13')][_0xc819('0x15')]);}logger['error']('ZendeskField,\x20%s,\x20%s',_0x1d3d59,_0x421b54['error'][_0xc819('0x15')]);return _0x392209(_0x421b54[_0xc819('0x13')]['message']);}else{logger[_0xc819('0xd')]('ZendeskField,\x20%s,\x20%s',_0x1d3d59,_0xc819('0xf'));_0x392209(_0x421b54[_0xc819('0x16')][_0xc819('0x15')]);}})[_0xc819('0x17')](function(_0x2c9ca3){logger[_0xc819('0x13')](_0xc819('0xe'),_0x1d3d59,_0x2c9ca3);_0x2e97b8(_0x2c9ca3);});});} \ No newline at end of file +var _0xd994=['../../config/environment','client','http','request','then','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','ZendeskField,\x20%s,\x20%s','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x1ff575,_0xdba21f){var _0x48fc9e=function(_0x51cf97){while(--_0x51cf97){_0x1ff575['push'](_0x1ff575['shift']());}};_0x48fc9e(++_0xdba21f);}(_0xd994,0x78));var _0x4d99=function(_0x4e2afb,_0x2d0d35){_0x4e2afb=_0x4e2afb-0x0;var _0x2c54ae=_0xd994[_0x4e2afb];return _0x2c54ae;};'use strict';var _=require(_0x4d99('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x4d99('0x1'));var rs=require(_0x4d99('0x2'));var fs=require('fs');var Redis=require(_0x4d99('0x3'));var db=require(_0x4d99('0x4'))['db'];var utils=require(_0x4d99('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x4d99('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x4d99('0x7')][_0x4d99('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2fd1a4,_0x199780,_0x5de136){return new BPromise(function(_0x4bbcdd,_0x31254a){return client[_0x4d99('0x9')](_0x2fd1a4,_0x5de136)[_0x4d99('0xa')](function(_0x1d5dd2){logger['info']('ZendeskField,\x20%s,\x20%s',_0x199780,_0x4d99('0xb'));logger[_0x4d99('0xc')](_0x4d99('0xd'),_0x199780,_0x4d99('0xb'),JSON[_0x4d99('0xe')](_0x1d5dd2));if(_0x1d5dd2['error']){if(_0x1d5dd2[_0x4d99('0xf')][_0x4d99('0x10')]===0x1f4){logger['error'](_0x4d99('0x11'),_0x199780,_0x1d5dd2[_0x4d99('0xf')][_0x4d99('0x12')]);return _0x31254a(_0x1d5dd2[_0x4d99('0xf')][_0x4d99('0x12')]);}logger['error'](_0x4d99('0x11'),_0x199780,_0x1d5dd2['error']['message']);return _0x4bbcdd(_0x1d5dd2[_0x4d99('0xf')][_0x4d99('0x12')]);}else{logger['info'](_0x4d99('0x11'),_0x199780,_0x4d99('0xb'));_0x4bbcdd(_0x1d5dd2[_0x4d99('0x13')]['message']);}})[_0x4d99('0x14')](function(_0x1109e1){logger[_0x4d99('0xf')](_0x4d99('0x11'),_0x199780,_0x1109e1);_0x31254a(_0x1109e1);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index 3eaa36e..4913991 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 _0x5fb2=['isAuthenticated','index','get','/:id','/:id/configurations','getConfigurations','/:id/fields','post','addConfiguration','put','update','delete','exports','multer','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intZohoAccount.controller'];(function(_0x4aa4e6,_0x278c45){var _0x322588=function(_0x19279d){while(--_0x19279d){_0x4aa4e6['push'](_0x4aa4e6['shift']());}};_0x322588(++_0x278c45);}(_0x5fb2,0xad));var _0x25fb=function(_0x25487d,_0x2235a4){_0x25487d=_0x25487d-0x0;var _0x581ee4=_0x5fb2[_0x25487d];return _0x581ee4;};'use strict';var multer=require(_0x25fb('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x25fb('0x1'));var router=express[_0x25fb('0x2')]();var fs_extra=require(_0x25fb('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x25fb('0x4'));var config=require(_0x25fb('0x5'));var controller=require(_0x25fb('0x6'));router['get']('/',auth[_0x25fb('0x7')](),controller[_0x25fb('0x8')]);router[_0x25fb('0x9')](_0x25fb('0xa'),auth[_0x25fb('0x7')](),controller['show']);router[_0x25fb('0x9')](_0x25fb('0xb'),auth[_0x25fb('0x7')](),controller[_0x25fb('0xc')]);router[_0x25fb('0x9')](_0x25fb('0xd'),auth[_0x25fb('0x7')](),controller['getFields']);router[_0x25fb('0xe')]('/',auth[_0x25fb('0x7')](),controller['create']);router['post'](_0x25fb('0xb'),auth[_0x25fb('0x7')](),controller[_0x25fb('0xf')]);router[_0x25fb('0x10')](_0x25fb('0xa'),auth[_0x25fb('0x7')](),controller[_0x25fb('0x11')]);router[_0x25fb('0x12')](_0x25fb('0xa'),auth[_0x25fb('0x7')](),controller['destroy']);module[_0x25fb('0x13')]=router; \ No newline at end of file +var _0x179b=['create','put','update','delete','destroy','exports','express','Router','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields'];(function(_0x23ec94,_0x5537cd){var _0x2f37d6=function(_0x221ced){while(--_0x221ced){_0x23ec94['push'](_0x23ec94['shift']());}};_0x2f37d6(++_0x5537cd);}(_0x179b,0x1bb));var _0xb179=function(_0x47a349,_0x4699d9){_0x47a349=_0x47a349-0x0;var _0x18ab75=_0x179b[_0x47a349];return _0x18ab75;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb179('0x0'));var router=express[_0xb179('0x1')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xb179('0x2'));var config=require(_0xb179('0x3'));var controller=require(_0xb179('0x4'));router[_0xb179('0x5')]('/',auth[_0xb179('0x6')](),controller[_0xb179('0x7')]);router['get'](_0xb179('0x8'),auth[_0xb179('0x6')](),controller[_0xb179('0x9')]);router[_0xb179('0x5')](_0xb179('0xa'),auth[_0xb179('0x6')](),controller[_0xb179('0xb')]);router[_0xb179('0x5')](_0xb179('0xc'),auth['isAuthenticated'](),controller['getFields']);router['post']('/',auth[_0xb179('0x6')](),controller[_0xb179('0xd')]);router['post'](_0xb179('0xa'),auth[_0xb179('0x6')](),controller['addConfiguration']);router[_0xb179('0xe')](_0xb179('0x8'),auth[_0xb179('0x6')](),controller[_0xb179('0xf')]);router[_0xb179('0x10')](_0xb179('0x8'),auth[_0xb179('0x6')](),controller[_0xb179('0x11')]);module[_0xb179('0x12')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index e351ffc..3db9bae 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 _0xa9e0=['sequelize','exports','STRING'];(function(_0x772b80,_0x39b2be){var _0x30b292=function(_0x599382){while(--_0x599382){_0x772b80['push'](_0x772b80['shift']());}};_0x30b292(++_0x39b2be);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0xa9e0[_0x1ddedd];return _0xa3e1ac;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'name':{'type':Sequelize[_0x0a9e('0x2')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize[_0x0a9e('0x2')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0x0a9e('0x2')]},'serverUrl':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![]},'code':{'type':Sequelize[_0x0a9e('0x2')]},'refreshToken':{'type':Sequelize[_0x0a9e('0x2')]}}; \ No newline at end of file +var _0xe5b3=['STRING','exports'];(function(_0x5820f2,_0x8df64e){var _0x1f1ce6=function(_0x447109){while(--_0x447109){_0x5820f2['push'](_0x5820f2['shift']());}};_0x1f1ce6(++_0x8df64e);}(_0xe5b3,0x133));var _0x3e5b=function(_0x2a4692,_0x5db910){_0x2a4692=_0x2a4692-0x0;var _0x370e6b=_0xe5b3[_0x2a4692];return _0x370e6b;};'use strict';var Sequelize=require('sequelize');module[_0x3e5b('0x0')]={'name':{'type':Sequelize[_0x3e5b('0x1')]},'description':{'type':Sequelize[_0x3e5b('0x1')]},'host':{'type':Sequelize[_0x3e5b('0x1')]},'zone':{'type':Sequelize[_0x3e5b('0x1')]},'clientId':{'type':Sequelize[_0x3e5b('0x1')]},'clientSecret':{'type':Sequelize[_0x3e5b('0x1')]},'serverUrl':{'type':Sequelize[_0x3e5b('0x1')],'allowNull':![]},'code':{'type':Sequelize[_0x3e5b('0x1')]},'refreshToken':{'type':Sequelize[_0x3e5b('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index 3856f02..87bbc53 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 _0xf59f=['attributes','fields','length','model','hasOwnProperty','nolimit','order','pick','filter','merge','map','VIRTUAL','options','ZohoAccount','includeAll','include','rows','catch','show','params','keys','body','find','destroy','getConfigurations','findOne','ZohoConfiguration','sort','where','addConfiguration','AccountId','Subjects','getSubjects','channel','create','ZohoField','Descriptions','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','POST','refreshToken','clientId','clientSecret','refresh_token','access_token','getFields','serverUrl','code','host','zoho.eu','com','slice','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','error','message','Owner','Description','WhoId','Call_Start_Time','Call_Type','remove','includes','api_name','system_mandatory','push','display_label','custom_field','data_type','picklist','pick_list_values','test','statusCode','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','squel','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','then','stack','name','send','index','rawAttributes','fieldName','type','query','filters','intersection'];(function(_0x3edb6d,_0x4b0e4d){var _0x1b95f1=function(_0x2ff434){while(--_0x2ff434){_0x3edb6d['push'](_0x3edb6d['shift']());}};_0x1b95f1(++_0x4b0e4d);}(_0xf59f,0xd7));var _0xff59=function(_0x39ddab,_0x1bdf06){_0x39ddab=_0x39ddab-0x0;var _0x3dd5e9=_0xf59f[_0x39ddab];return _0x3dd5e9;};'use strict';var emlformat=require(_0xff59('0x0'));var rimraf=require(_0xff59('0x1'));var zipdir=require(_0xff59('0x2'));var jsonpatch=require(_0xff59('0x3'));var rp=require(_0xff59('0x4'));var moment=require(_0xff59('0x5'));var BPromise=require(_0xff59('0x6'));var Mustache=require(_0xff59('0x7'));var util=require(_0xff59('0x8'));var path=require(_0xff59('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xff59('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xff59('0xb'));var squel=require(_0xff59('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xff59('0xd'));var toCsv=require(_0xff59('0xe'));var querystring=require(_0xff59('0xf'));var Papa=require(_0xff59('0x10'));var Redis=require(_0xff59('0x11'));var authService=require(_0xff59('0x12'));var qs=require(_0xff59('0x13'));var as=require(_0xff59('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xff59('0x15'))(_0xff59('0x16'));var utils=require(_0xff59('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xff59('0x18'));var db=require(_0xff59('0x19'))['db'];var integrations=require(_0xff59('0x1a'));function respondWithStatusCode(_0x304c66,_0x38a974){_0x38a974=_0x38a974||0xcc;return function(_0x3be670){if(_0x3be670){return _0x304c66[_0xff59('0x1b')](_0x38a974);}return _0x304c66[_0xff59('0x1c')](_0x38a974)[_0xff59('0x1d')]();};}function respondWithResult(_0x1f9ab3,_0x45e783){_0x45e783=_0x45e783||0xc8;return function(_0x525204){if(_0x525204){return _0x1f9ab3['status'](_0x45e783)[_0xff59('0x1e')](_0x525204);}};}function respondWithFilteredResult(_0x593ae4,_0x318268){return function(_0x431995){if(_0x431995){var _0x300494=typeof _0x318268['offset']==='undefined'&&typeof _0x318268[_0xff59('0x1f')]===_0xff59('0x20');var _0x10166c=_0x431995[_0xff59('0x21')];var _0x4e2365=_0x300494?0x0:_0x318268['offset'];var _0x4f5648=_0x300494?_0x431995[_0xff59('0x21')]:_0x318268[_0xff59('0x22')]+_0x318268[_0xff59('0x1f')];var _0x41fbf2;if(_0x4f5648>=_0x10166c){_0x4f5648=_0x10166c;_0x41fbf2=0xc8;}else{_0x41fbf2=0xce;}_0x593ae4['status'](_0x41fbf2);return _0x593ae4[_0xff59('0x23')](_0xff59('0x24'),_0x4e2365+'-'+_0x4f5648+'/'+_0x10166c)[_0xff59('0x1e')](_0x431995);}return null;};}function patchUpdates(_0x1f9fe5){return function(_0x4042c8){try{jsonpatch[_0xff59('0x25')](_0x4042c8,_0x1f9fe5,!![]);}catch(_0x59980c){return BPromise[_0xff59('0x26')](_0x59980c);}return _0x4042c8[_0xff59('0x27')]();};}function saveUpdates(_0x92fdfa,_0x39ad83){return function(_0x3ba1a6){if(_0x3ba1a6){return _0x3ba1a6['update'](_0x92fdfa)[_0xff59('0x28')](function(_0x2fbc8a){return _0x2fbc8a;});}return null;};}function removeEntity(_0x2e9287,_0x39ecab){return function(_0x1fa252){if(_0x1fa252){return _0x1fa252['destroy']()['then'](function(){_0x2e9287[_0xff59('0x1c')](0xcc)[_0xff59('0x1d')]();});}};}function handleEntityNotFound(_0xccef7e,_0x475b48){return function(_0x528b55){if(!_0x528b55){_0xccef7e[_0xff59('0x1b')](0x194);}return _0x528b55;};}function handleError(_0x5ab28d,_0x8871fe){_0x8871fe=_0x8871fe||0x1f4;return function(_0x2d5438){logger['error'](_0x2d5438[_0xff59('0x29')]);if(_0x2d5438[_0xff59('0x2a')]){delete _0x2d5438[_0xff59('0x2a')];}_0x5ab28d[_0xff59('0x1c')](_0x8871fe)[_0xff59('0x2b')](_0x2d5438);};}exports[_0xff59('0x2c')]=function(_0x280654,_0x3b4486){var _0x3c9848={},_0x3f52e3={},_0x4283bc={'count':0x0,'rows':[]};var _0x1332ba=_['map'](db['ZohoAccount'][_0xff59('0x2d')],function(_0x3a2719){return{'name':_0x3a2719[_0xff59('0x2e')],'type':_0x3a2719[_0xff59('0x2f')]['key']};});_0x3f52e3['model']=_['map'](_0x1332ba,_0xff59('0x2a'));_0x3f52e3[_0xff59('0x30')]=_['keys'](_0x280654[_0xff59('0x30')]);_0x3f52e3[_0xff59('0x31')]=_[_0xff59('0x32')](_0x3f52e3['model'],_0x3f52e3[_0xff59('0x30')]);_0x3c9848[_0xff59('0x33')]=_[_0xff59('0x32')](_0x3f52e3['model'],qs[_0xff59('0x34')](_0x280654[_0xff59('0x30')][_0xff59('0x34')]));_0x3c9848[_0xff59('0x33')]=_0x3c9848[_0xff59('0x33')][_0xff59('0x35')]?_0x3c9848[_0xff59('0x33')]:_0x3f52e3[_0xff59('0x36')];if(!_0x280654['query'][_0xff59('0x37')](_0xff59('0x38'))){_0x3c9848['limit']=qs[_0xff59('0x1f')](_0x280654[_0xff59('0x30')][_0xff59('0x1f')]);_0x3c9848[_0xff59('0x22')]=qs['offset'](_0x280654[_0xff59('0x30')][_0xff59('0x22')]);}_0x3c9848[_0xff59('0x39')]=qs['sort'](_0x280654[_0xff59('0x30')]['sort']);_0x3c9848['where']=qs[_0xff59('0x31')](_[_0xff59('0x3a')](_0x280654[_0xff59('0x30')],_0x3f52e3[_0xff59('0x31')]),_0x1332ba);if(_0x280654[_0xff59('0x30')][_0xff59('0x3b')]){_0x3c9848['where']=_[_0xff59('0x3c')](_0x3c9848['where'],{'$or':_[_0xff59('0x3d')](_0x1332ba,function(_0x49a6e3){if(_0x49a6e3[_0xff59('0x2f')]!==_0xff59('0x3e')){var _0xba7b20={};_0xba7b20[_0x49a6e3[_0xff59('0x2a')]]={'$like':'%'+_0x280654[_0xff59('0x30')][_0xff59('0x3b')]+'%'};return _0xba7b20;}})});}_0x3c9848=_[_0xff59('0x3c')]({},_0x3c9848,_0x280654[_0xff59('0x3f')]);var _0x34f61f={'where':_0x3c9848['where']};return db[_0xff59('0x40')][_0xff59('0x21')](_0x34f61f)[_0xff59('0x28')](function(_0x2d0836){_0x4283bc['count']=_0x2d0836;if(_0x280654[_0xff59('0x30')][_0xff59('0x41')]){_0x3c9848[_0xff59('0x42')]=[{'all':!![]}];}return db['ZohoAccount']['findAll'](_0x3c9848);})[_0xff59('0x28')](function(_0x524bc7){_0x4283bc[_0xff59('0x43')]=_0x524bc7;return _0x4283bc;})[_0xff59('0x28')](respondWithFilteredResult(_0x3b4486,_0x3c9848))[_0xff59('0x44')](handleError(_0x3b4486,null));};exports[_0xff59('0x45')]=function(_0xfc2afb,_0x268ff0){var _0x15874f={'raw':![],'where':{'id':_0xfc2afb[_0xff59('0x46')]['id']}},_0x9a9d30={};_0x9a9d30[_0xff59('0x36')]=_[_0xff59('0x47')](db[_0xff59('0x40')][_0xff59('0x2d')]);_0x9a9d30[_0xff59('0x30')]=_[_0xff59('0x47')](_0xfc2afb[_0xff59('0x30')]);_0x9a9d30[_0xff59('0x31')]=_[_0xff59('0x32')](_0x9a9d30[_0xff59('0x36')],_0x9a9d30[_0xff59('0x30')]);_0x15874f['attributes']=_[_0xff59('0x32')](_0x9a9d30[_0xff59('0x36')],qs[_0xff59('0x34')](_0xfc2afb['query'][_0xff59('0x34')]));_0x15874f[_0xff59('0x33')]=_0x15874f[_0xff59('0x33')][_0xff59('0x35')]?_0x15874f[_0xff59('0x33')]:_0x9a9d30[_0xff59('0x36')];if(_0xfc2afb[_0xff59('0x30')][_0xff59('0x41')]){_0x15874f[_0xff59('0x42')]=[{'all':!![]}];}_0x15874f=_[_0xff59('0x3c')]({},_0x15874f,_0xfc2afb[_0xff59('0x3f')]);return db['ZohoAccount']['find'](_0x15874f)[_0xff59('0x28')](handleEntityNotFound(_0x268ff0,null))[_0xff59('0x28')](respondWithResult(_0x268ff0,null))['catch'](handleError(_0x268ff0,null));};exports['create']=function(_0x4c1647,_0x1bbaad){return db['ZohoAccount']['create'](_0x4c1647['body'],{})[_0xff59('0x28')](respondWithResult(_0x1bbaad,0xc9))['catch'](handleError(_0x1bbaad,null));};exports['update']=function(_0x827d72,_0x515478){if(_0x827d72[_0xff59('0x48')]['id']){delete _0x827d72[_0xff59('0x48')]['id'];}return db[_0xff59('0x40')][_0xff59('0x49')]({'where':{'id':_0x827d72[_0xff59('0x46')]['id']}})['then'](handleEntityNotFound(_0x515478,null))[_0xff59('0x28')](saveUpdates(_0x827d72['body'],null))[_0xff59('0x28')](respondWithResult(_0x515478,null))[_0xff59('0x44')](handleError(_0x515478,null));};exports[_0xff59('0x4a')]=function(_0x22fe56,_0xe5602f){return db[_0xff59('0x40')][_0xff59('0x49')]({'where':{'id':_0x22fe56[_0xff59('0x46')]['id']}})[_0xff59('0x28')](handleEntityNotFound(_0xe5602f,null))[_0xff59('0x28')](removeEntity(_0xe5602f,null))[_0xff59('0x44')](handleError(_0xe5602f,null));};exports[_0xff59('0x4b')]=function(_0x2a999f,_0x3c4a0,_0x49951d){var _0x145e4b={};var _0x5eed54={};var _0x37e23f;var _0x5b74e5;return db['ZohoAccount'][_0xff59('0x4c')]({'where':{'id':_0x2a999f[_0xff59('0x46')]['id']}})['then'](handleEntityNotFound(_0x3c4a0,null))[_0xff59('0x28')](function(_0x284cd1){if(_0x284cd1){_0x37e23f=_0x284cd1;_0x5eed54[_0xff59('0x36')]=_[_0xff59('0x47')](db[_0xff59('0x4d')][_0xff59('0x2d')]);_0x5eed54['query']=_[_0xff59('0x47')](_0x2a999f[_0xff59('0x30')]);_0x5eed54[_0xff59('0x31')]=_[_0xff59('0x32')](_0x5eed54[_0xff59('0x36')],_0x5eed54[_0xff59('0x30')]);_0x145e4b['attributes']=_[_0xff59('0x32')](_0x5eed54['model'],qs['fields'](_0x2a999f['query'][_0xff59('0x34')]));_0x145e4b[_0xff59('0x33')]=_0x145e4b[_0xff59('0x33')]['length']?_0x145e4b[_0xff59('0x33')]:_0x5eed54[_0xff59('0x36')];_0x145e4b['order']=qs['sort'](_0x2a999f[_0xff59('0x30')][_0xff59('0x4e')]);_0x145e4b[_0xff59('0x4f')]=qs['filters'](_[_0xff59('0x3a')](_0x2a999f[_0xff59('0x30')],_0x5eed54[_0xff59('0x31')]));if(_0x2a999f['query'][_0xff59('0x3b')]){_0x145e4b['where']=_[_0xff59('0x3c')](_0x145e4b[_0xff59('0x4f')],{'$or':_[_0xff59('0x3d')](_0x145e4b[_0xff59('0x33')],function(_0x1b8515){var _0x4b32b6={};_0x4b32b6[_0x1b8515]={'$like':'%'+_0x2a999f[_0xff59('0x30')][_0xff59('0x3b')]+'%'};return _0x4b32b6;})});}_0x145e4b=_['merge']({},_0x145e4b,_0x2a999f['options']);return _0x37e23f[_0xff59('0x4b')](_0x145e4b);}})[_0xff59('0x28')](function(_0x5c4811){if(_0x5c4811){_0x5b74e5=_0x5c4811[_0xff59('0x35')];if(!_0x2a999f['query'][_0xff59('0x37')]('nolimit')){_0x145e4b[_0xff59('0x1f')]=qs[_0xff59('0x1f')](_0x2a999f[_0xff59('0x30')][_0xff59('0x1f')]);_0x145e4b[_0xff59('0x22')]=qs['offset'](_0x2a999f[_0xff59('0x30')]['offset']);}return _0x37e23f[_0xff59('0x4b')](_0x145e4b);}})[_0xff59('0x28')](function(_0x4555e4){if(_0x4555e4){return _0x4555e4?{'count':_0x5b74e5,'rows':_0x4555e4}:null;}})['then'](respondWithResult(_0x3c4a0,null))[_0xff59('0x44')](handleError(_0x3c4a0,null));};exports[_0xff59('0x50')]=function(_0x812d9c,_0x25ad57,_0xa4129b){if(_0x812d9c[_0xff59('0x48')]['id']){delete _0x812d9c[_0xff59('0x48')]['id'];}return db['ZohoAccount']['findOne']({'where':{'id':_0x812d9c[_0xff59('0x46')]['id']}})[_0xff59('0x28')](handleEntityNotFound(_0x25ad57,null))[_0xff59('0x28')](function(_0x364475){if(_0x364475){_0x812d9c[_0xff59('0x48')][_0xff59('0x51')]=_0x364475['id'];_0x812d9c[_0xff59('0x48')][_0xff59('0x52')]=integrations[_0xff59('0x53')](_0x812d9c[_0xff59('0x48')][_0xff59('0x54')],_0x812d9c[_0xff59('0x48')]['type']);_0x812d9c[_0xff59('0x48')]['Descriptions']=integrations['getDescriptions'](_0x812d9c[_0xff59('0x48')][_0xff59('0x54')],_0x812d9c[_0xff59('0x48')][_0xff59('0x2f')]);return db['ZohoConfiguration'][_0xff59('0x55')](_0x812d9c['body'],{'include':[{'model':db[_0xff59('0x56')],'as':'Subjects'},{'model':db[_0xff59('0x56')],'as':_0xff59('0x57')}]});}return null;})[_0xff59('0x28')](respondWithResult(_0x25ad57,null))['catch'](handleError(_0x25ad57,null));};function getAccessToken(_0x4735c0){return new Promise(function(_0x1f3ea5,_0x3000cc){var _0x2c2961;switch(_0x4735c0[_0xff59('0x58')]){case'US':_0x2c2961=_0xff59('0x59');break;case'AU':_0x2c2961=_0xff59('0x5a');break;case'EU':_0x2c2961=_0xff59('0x5b');break;case'IN':_0x2c2961=_0xff59('0x5c');break;case'CN':_0x2c2961='https://accounts.zoho.com.cn';break;default:_0x2c2961=_0xff59('0x5b');break;}var _0x56bf2a={'method':_0xff59('0x5d'),'uri':_0x2c2961+'/oauth/v2/token','qs':{'refresh_token':_0x4735c0[_0xff59('0x5e')],'client_id':_0x4735c0[_0xff59('0x5f')],'client_secret':_0x4735c0[_0xff59('0x60')],'grant_type':_0xff59('0x61')},'json':!![]};return rp(_0x56bf2a)['then'](function(_0x448723){if(_0x448723['access_token']){_0x1f3ea5(_0x448723[_0xff59('0x62')]);}else{_0x3000cc('Unable\x20to\x20retrieve\x20the\x20access\x20token');}})[_0xff59('0x44')](function(_0x33c6e3){_0x3000cc(_0x33c6e3);});});}exports[_0xff59('0x63')]=function(_0xbb38a,_0x2e1f57,_0x4005a1){var _0x36d47c,_0x5483d7,_0x4d16d9,_0x5b7c55,_0x1cda69;return db[_0xff59('0x40')][_0xff59('0x4c')]({'where':{'id':_0xbb38a['params']['id']},'attributes':['id','host','zone',_0xff59('0x5f'),_0xff59('0x60'),_0xff59('0x64'),_0xff59('0x65'),_0xff59('0x5e')]})[_0xff59('0x28')](handleEntityNotFound(_0x2e1f57,null))['then'](function(_0x17d106){_0x1cda69=_0x17d106;_0x36d47c=_0x1cda69[_0xff59('0x66')];_0x5483d7=_0x36d47c===_0xff59('0x67')?'eu':_0xff59('0x68');_0x4d16d9=_0x1cda69[_0xff59('0x64')];var _0xbafbe2=_0x4d16d9[_0xff59('0x69')](-0x1);if(_0xbafbe2==='/'||_0xbafbe2==='\x5c'||_0xbafbe2===':'){_0x4d16d9=_0x4d16d9['substring'](0x0,_0x4d16d9['lastIndexOf'](_0xbafbe2));}if(!_0x1cda69[_0xff59('0x5e')]){throw new Error(_0xff59('0x6a'));}return getAccessToken(_0x1cda69);})[_0xff59('0x28')](function(_0x2ac9b1){if(_0x2ac9b1){return rp({'method':_0xff59('0x6b'),'uri':util['format'](_0xff59('0x6c'),_0x5483d7),'qs':{'module':_0xff59('0x6d')},'headers':{'Authorization':_0xff59('0x6e')+_0x2ac9b1},'json':!![]});}})[_0xff59('0x28')](function(_0xb9add0){if(_0xb9add0){if(_0xb9add0[_0xff59('0x6f')]&&_0xb9add0[_0xff59('0x6f')]['error']){throw new Error(_0xb9add0[_0xff59('0x6f')][_0xff59('0x70')][_0xff59('0x71')]);}var _0x31164b=[];var _0x4173c6=[];var _0x2a0033=[_0xff59('0x72'),'Subject',_0xff59('0x73'),_0xff59('0x74'),'Call_Duration','Call_Result',_0xff59('0x75'),_0xff59('0x76')];_0x4173c6=_[_0xff59('0x77')](_0xb9add0[_0xff59('0x34')],function(_0x312ad3){return _0x2a0033[_0xff59('0x78')](_0x312ad3[_0xff59('0x79')]);});for(var _0x1524b8=0x0;_0x1524b8<_0x4173c6['length'];_0x1524b8++){if(_0x4173c6[_0x1524b8][_0xff59('0x7a')]===![]){_0x31164b[_0xff59('0x7b')]({'id':_0x4173c6[_0x1524b8]['id'],'name':_0x4173c6[_0x1524b8][_0xff59('0x7c')],'custom':_0x4173c6[_0x1524b8][_0xff59('0x7d')],'options':_0x4173c6[_0x1524b8][_0xff59('0x7e')]===_0xff59('0x7f')&&_0x4173c6[_0x1524b8][_0xff59('0x80')][_0xff59('0x35')]>-0x1?_[_0xff59('0x3d')](_0x4173c6[_0x1524b8][_0xff59('0x80')],function(_0x2d0de9){return{'name':_0x2d0de9,'value':_0x2d0de9};}):[]});}}return{'count':_0x31164b[_0xff59('0x35')],'rows':_0x31164b};}else{return{'count':0x0,'rows':[]};}})[_0xff59('0x28')](respondWithResult(_0x2e1f57,null))[_0xff59('0x44')](function(_0x185cc5){var _0x26b2ee=_0xbb38a['query'][_0xff59('0x81')]?0x1f4:_0x185cc5[_0xff59('0x82')]||0x1f4;logger[_0xff59('0x70')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x26b2ee,JSON[_0xff59('0x83')](_0x185cc5));delete _0x185cc5[_0xff59('0x2a')];if(_0x26b2ee===0x191){_0x26b2ee=0x190;}_0x2e1f57[_0xff59('0x1c')](_0x26b2ee)[_0xff59('0x2b')](_0xbb38a[_0xff59('0x30')][_0xff59('0x81')]?{'message':_0xff59('0x84'),'statusCode':_0x185cc5[_0xff59('0x82')]}:_0x185cc5);});}; \ No newline at end of file +var _0xf8dc=['rows','catch','show','params','length','includeAll','options','find','create','body','update','getConfigurations','ZohoConfiguration','pick','hasOwnProperty','addConfiguration','findOne','AccountId','Subjects','channel','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','zone','code','host','zoho.eu','com','slice','lastIndexOf','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','error','message','Subject','WhoId','Call_Duration','Call_Result','Call_Start_Time','Call_Type','includes','api_name','system_mandatory','push','display_label','custom_field','data_type','picklist','pick_list_values','getFields,\x20%s,\x20%s,\x20%s','stringify','send','test','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','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','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','reject','save','destroy','then','stack','index','map','ZohoAccount','rawAttributes','type','key','model','name','query','keys','filters','intersection','fields','attributes','nolimit','order','sort','filter','where','merge','VIRTUAL','include','findAll'];(function(_0x17c776,_0x1b0432){var _0x5511c2=function(_0x4bb4ac){while(--_0x4bb4ac){_0x17c776['push'](_0x17c776['shift']());}};_0x5511c2(++_0x1b0432);}(_0xf8dc,0x142));var _0xcf8d=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0xf8dc[_0xea8947];return _0x2455e9;};'use strict';var emlformat=require(_0xcf8d('0x0'));var rimraf=require(_0xcf8d('0x1'));var zipdir=require(_0xcf8d('0x2'));var jsonpatch=require(_0xcf8d('0x3'));var rp=require(_0xcf8d('0x4'));var moment=require('moment');var BPromise=require(_0xcf8d('0x5'));var Mustache=require(_0xcf8d('0x6'));var util=require(_0xcf8d('0x7'));var path=require(_0xcf8d('0x8'));var sox=require(_0xcf8d('0x9'));var csv=require(_0xcf8d('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xcf8d('0xb'));var jsforce=require(_0xcf8d('0xc'));var deskjs=require(_0xcf8d('0xd'));var toCsv=require(_0xcf8d('0xa'));var querystring=require(_0xcf8d('0xe'));var Papa=require(_0xcf8d('0xf'));var Redis=require(_0xcf8d('0x10'));var authService=require(_0xcf8d('0x11'));var qs=require(_0xcf8d('0x12'));var as=require(_0xcf8d('0x13'));var hardwareService=require(_0xcf8d('0x14'));var logger=require('../../config/logger')(_0xcf8d('0x15'));var utils=require(_0xcf8d('0x16'));var config=require(_0xcf8d('0x17'));var licenseUtil=require(_0xcf8d('0x18'));var db=require('../../mysqldb')['db'];var integrations=require(_0xcf8d('0x19'));function respondWithStatusCode(_0x3e205a,_0x4d3ed7){_0x4d3ed7=_0x4d3ed7||0xcc;return function(_0x4b3d41){if(_0x4b3d41){return _0x3e205a[_0xcf8d('0x1a')](_0x4d3ed7);}return _0x3e205a[_0xcf8d('0x1b')](_0x4d3ed7)[_0xcf8d('0x1c')]();};}function respondWithResult(_0x1b0b73,_0x30a20f){_0x30a20f=_0x30a20f||0xc8;return function(_0x2d155a){if(_0x2d155a){return _0x1b0b73[_0xcf8d('0x1b')](_0x30a20f)[_0xcf8d('0x1d')](_0x2d155a);}};}function respondWithFilteredResult(_0x477ee0,_0x56ddd8){return function(_0x38bc36){if(_0x38bc36){var _0x2de9e9=typeof _0x56ddd8[_0xcf8d('0x1e')]===_0xcf8d('0x1f')&&typeof _0x56ddd8[_0xcf8d('0x20')]===_0xcf8d('0x1f');var _0x156a21=_0x38bc36[_0xcf8d('0x21')];var _0x2a07eb=_0x2de9e9?0x0:_0x56ddd8[_0xcf8d('0x1e')];var _0x3e8c67=_0x2de9e9?_0x38bc36[_0xcf8d('0x21')]:_0x56ddd8[_0xcf8d('0x1e')]+_0x56ddd8['limit'];var _0x2f09c1;if(_0x3e8c67>=_0x156a21){_0x3e8c67=_0x156a21;_0x2f09c1=0xc8;}else{_0x2f09c1=0xce;}_0x477ee0[_0xcf8d('0x1b')](_0x2f09c1);return _0x477ee0['set']('Content-Range',_0x2a07eb+'-'+_0x3e8c67+'/'+_0x156a21)['json'](_0x38bc36);}return null;};}function patchUpdates(_0x4de5ed){return function(_0x23b6d9){try{jsonpatch['apply'](_0x23b6d9,_0x4de5ed,!![]);}catch(_0x3cb7da){return BPromise[_0xcf8d('0x22')](_0x3cb7da);}return _0x23b6d9[_0xcf8d('0x23')]();};}function saveUpdates(_0x44f68e,_0x1782f2){return function(_0xbc67a4){if(_0xbc67a4){return _0xbc67a4['update'](_0x44f68e)['then'](function(_0x1736ac){return _0x1736ac;});}return null;};}function removeEntity(_0x9e7c1,_0x1fe1c7){return function(_0x2fc117){if(_0x2fc117){return _0x2fc117[_0xcf8d('0x24')]()[_0xcf8d('0x25')](function(){_0x9e7c1[_0xcf8d('0x1b')](0xcc)[_0xcf8d('0x1c')]();});}};}function handleEntityNotFound(_0x1e7c2a,_0x2182f6){return function(_0x3f16ad){if(!_0x3f16ad){_0x1e7c2a[_0xcf8d('0x1a')](0x194);}return _0x3f16ad;};}function handleError(_0x135e87,_0x527460){_0x527460=_0x527460||0x1f4;return function(_0x1243d0){logger['error'](_0x1243d0[_0xcf8d('0x26')]);if(_0x1243d0['name']){delete _0x1243d0['name'];}_0x135e87['status'](_0x527460)['send'](_0x1243d0);};}exports[_0xcf8d('0x27')]=function(_0x4f6155,_0xec85b4){var _0x1cca6f={},_0x424162={},_0x2e0163={'count':0x0,'rows':[]};var _0x1b77cc=_[_0xcf8d('0x28')](db[_0xcf8d('0x29')][_0xcf8d('0x2a')],function(_0x4679d4){return{'name':_0x4679d4['fieldName'],'type':_0x4679d4[_0xcf8d('0x2b')][_0xcf8d('0x2c')]};});_0x424162[_0xcf8d('0x2d')]=_[_0xcf8d('0x28')](_0x1b77cc,_0xcf8d('0x2e'));_0x424162[_0xcf8d('0x2f')]=_[_0xcf8d('0x30')](_0x4f6155[_0xcf8d('0x2f')]);_0x424162[_0xcf8d('0x31')]=_[_0xcf8d('0x32')](_0x424162[_0xcf8d('0x2d')],_0x424162[_0xcf8d('0x2f')]);_0x1cca6f['attributes']=_['intersection'](_0x424162[_0xcf8d('0x2d')],qs[_0xcf8d('0x33')](_0x4f6155[_0xcf8d('0x2f')]['fields']));_0x1cca6f[_0xcf8d('0x34')]=_0x1cca6f[_0xcf8d('0x34')]['length']?_0x1cca6f[_0xcf8d('0x34')]:_0x424162[_0xcf8d('0x2d')];if(!_0x4f6155[_0xcf8d('0x2f')]['hasOwnProperty'](_0xcf8d('0x35'))){_0x1cca6f[_0xcf8d('0x20')]=qs['limit'](_0x4f6155['query'][_0xcf8d('0x20')]);_0x1cca6f[_0xcf8d('0x1e')]=qs[_0xcf8d('0x1e')](_0x4f6155['query']['offset']);}_0x1cca6f[_0xcf8d('0x36')]=qs['sort'](_0x4f6155[_0xcf8d('0x2f')][_0xcf8d('0x37')]);_0x1cca6f['where']=qs['filters'](_['pick'](_0x4f6155['query'],_0x424162['filters']),_0x1b77cc);if(_0x4f6155['query'][_0xcf8d('0x38')]){_0x1cca6f[_0xcf8d('0x39')]=_[_0xcf8d('0x3a')](_0x1cca6f[_0xcf8d('0x39')],{'$or':_['map'](_0x1b77cc,function(_0x34f89f){if(_0x34f89f['type']!==_0xcf8d('0x3b')){var _0x192e08={};_0x192e08[_0x34f89f['name']]={'$like':'%'+_0x4f6155[_0xcf8d('0x2f')][_0xcf8d('0x38')]+'%'};return _0x192e08;}})});}_0x1cca6f=_[_0xcf8d('0x3a')]({},_0x1cca6f,_0x4f6155['options']);var _0x26fbd3={'where':_0x1cca6f[_0xcf8d('0x39')]};return db[_0xcf8d('0x29')][_0xcf8d('0x21')](_0x26fbd3)[_0xcf8d('0x25')](function(_0x399a9d){_0x2e0163[_0xcf8d('0x21')]=_0x399a9d;if(_0x4f6155['query']['includeAll']){_0x1cca6f[_0xcf8d('0x3c')]=[{'all':!![]}];}return db[_0xcf8d('0x29')][_0xcf8d('0x3d')](_0x1cca6f);})[_0xcf8d('0x25')](function(_0x58dde9){_0x2e0163[_0xcf8d('0x3e')]=_0x58dde9;return _0x2e0163;})[_0xcf8d('0x25')](respondWithFilteredResult(_0xec85b4,_0x1cca6f))[_0xcf8d('0x3f')](handleError(_0xec85b4,null));};exports[_0xcf8d('0x40')]=function(_0x2e37c3,_0x1dfad6){var _0x14146d={'raw':![],'where':{'id':_0x2e37c3[_0xcf8d('0x41')]['id']}},_0x16491f={};_0x16491f[_0xcf8d('0x2d')]=_['keys'](db[_0xcf8d('0x29')][_0xcf8d('0x2a')]);_0x16491f['query']=_[_0xcf8d('0x30')](_0x2e37c3[_0xcf8d('0x2f')]);_0x16491f[_0xcf8d('0x31')]=_[_0xcf8d('0x32')](_0x16491f['model'],_0x16491f[_0xcf8d('0x2f')]);_0x14146d[_0xcf8d('0x34')]=_[_0xcf8d('0x32')](_0x16491f[_0xcf8d('0x2d')],qs[_0xcf8d('0x33')](_0x2e37c3[_0xcf8d('0x2f')][_0xcf8d('0x33')]));_0x14146d[_0xcf8d('0x34')]=_0x14146d['attributes'][_0xcf8d('0x42')]?_0x14146d['attributes']:_0x16491f['model'];if(_0x2e37c3[_0xcf8d('0x2f')][_0xcf8d('0x43')]){_0x14146d[_0xcf8d('0x3c')]=[{'all':!![]}];}_0x14146d=_[_0xcf8d('0x3a')]({},_0x14146d,_0x2e37c3[_0xcf8d('0x44')]);return db[_0xcf8d('0x29')][_0xcf8d('0x45')](_0x14146d)[_0xcf8d('0x25')](handleEntityNotFound(_0x1dfad6,null))['then'](respondWithResult(_0x1dfad6,null))[_0xcf8d('0x3f')](handleError(_0x1dfad6,null));};exports['create']=function(_0x418513,_0x4f4c86){return db[_0xcf8d('0x29')][_0xcf8d('0x46')](_0x418513[_0xcf8d('0x47')],{})[_0xcf8d('0x25')](respondWithResult(_0x4f4c86,0xc9))[_0xcf8d('0x3f')](handleError(_0x4f4c86,null));};exports[_0xcf8d('0x48')]=function(_0x3730a6,_0x31a521){if(_0x3730a6['body']['id']){delete _0x3730a6[_0xcf8d('0x47')]['id'];}return db[_0xcf8d('0x29')]['find']({'where':{'id':_0x3730a6[_0xcf8d('0x41')]['id']}})[_0xcf8d('0x25')](handleEntityNotFound(_0x31a521,null))['then'](saveUpdates(_0x3730a6['body'],null))[_0xcf8d('0x25')](respondWithResult(_0x31a521,null))[_0xcf8d('0x3f')](handleError(_0x31a521,null));};exports[_0xcf8d('0x24')]=function(_0xdc47b3,_0x1f2783){return db[_0xcf8d('0x29')]['find']({'where':{'id':_0xdc47b3['params']['id']}})[_0xcf8d('0x25')](handleEntityNotFound(_0x1f2783,null))[_0xcf8d('0x25')](removeEntity(_0x1f2783,null))[_0xcf8d('0x3f')](handleError(_0x1f2783,null));};exports[_0xcf8d('0x49')]=function(_0x4722ff,_0x37df23,_0x3382df){var _0x4938b={};var _0xd0ac9b={};var _0x3e27cf;var _0xd3f370;return db[_0xcf8d('0x29')]['findOne']({'where':{'id':_0x4722ff[_0xcf8d('0x41')]['id']}})[_0xcf8d('0x25')](handleEntityNotFound(_0x37df23,null))['then'](function(_0x43680d){if(_0x43680d){_0x3e27cf=_0x43680d;_0xd0ac9b['model']=_['keys'](db[_0xcf8d('0x4a')][_0xcf8d('0x2a')]);_0xd0ac9b[_0xcf8d('0x2f')]=_[_0xcf8d('0x30')](_0x4722ff[_0xcf8d('0x2f')]);_0xd0ac9b['filters']=_[_0xcf8d('0x32')](_0xd0ac9b[_0xcf8d('0x2d')],_0xd0ac9b[_0xcf8d('0x2f')]);_0x4938b[_0xcf8d('0x34')]=_['intersection'](_0xd0ac9b['model'],qs['fields'](_0x4722ff[_0xcf8d('0x2f')][_0xcf8d('0x33')]));_0x4938b[_0xcf8d('0x34')]=_0x4938b[_0xcf8d('0x34')][_0xcf8d('0x42')]?_0x4938b['attributes']:_0xd0ac9b[_0xcf8d('0x2d')];_0x4938b[_0xcf8d('0x36')]=qs['sort'](_0x4722ff[_0xcf8d('0x2f')][_0xcf8d('0x37')]);_0x4938b[_0xcf8d('0x39')]=qs[_0xcf8d('0x31')](_[_0xcf8d('0x4b')](_0x4722ff[_0xcf8d('0x2f')],_0xd0ac9b[_0xcf8d('0x31')]));if(_0x4722ff[_0xcf8d('0x2f')][_0xcf8d('0x38')]){_0x4938b[_0xcf8d('0x39')]=_[_0xcf8d('0x3a')](_0x4938b['where'],{'$or':_[_0xcf8d('0x28')](_0x4938b[_0xcf8d('0x34')],function(_0x1048ba){var _0x31661a={};_0x31661a[_0x1048ba]={'$like':'%'+_0x4722ff[_0xcf8d('0x2f')][_0xcf8d('0x38')]+'%'};return _0x31661a;})});}_0x4938b=_[_0xcf8d('0x3a')]({},_0x4938b,_0x4722ff[_0xcf8d('0x44')]);return _0x3e27cf[_0xcf8d('0x49')](_0x4938b);}})[_0xcf8d('0x25')](function(_0xced20e){if(_0xced20e){_0xd3f370=_0xced20e[_0xcf8d('0x42')];if(!_0x4722ff[_0xcf8d('0x2f')][_0xcf8d('0x4c')]('nolimit')){_0x4938b['limit']=qs[_0xcf8d('0x20')](_0x4722ff[_0xcf8d('0x2f')][_0xcf8d('0x20')]);_0x4938b[_0xcf8d('0x1e')]=qs[_0xcf8d('0x1e')](_0x4722ff['query'][_0xcf8d('0x1e')]);}return _0x3e27cf[_0xcf8d('0x49')](_0x4938b);}})[_0xcf8d('0x25')](function(_0x1d53ea){if(_0x1d53ea){return _0x1d53ea?{'count':_0xd3f370,'rows':_0x1d53ea}:null;}})[_0xcf8d('0x25')](respondWithResult(_0x37df23,null))[_0xcf8d('0x3f')](handleError(_0x37df23,null));};exports[_0xcf8d('0x4d')]=function(_0x159a0e,_0x451262,_0x15ca10){if(_0x159a0e[_0xcf8d('0x47')]['id']){delete _0x159a0e['body']['id'];}return db[_0xcf8d('0x29')][_0xcf8d('0x4e')]({'where':{'id':_0x159a0e[_0xcf8d('0x41')]['id']}})[_0xcf8d('0x25')](handleEntityNotFound(_0x451262,null))[_0xcf8d('0x25')](function(_0x5eefdf){if(_0x5eefdf){_0x159a0e[_0xcf8d('0x47')][_0xcf8d('0x4f')]=_0x5eefdf['id'];_0x159a0e[_0xcf8d('0x47')][_0xcf8d('0x50')]=integrations['getSubjects'](_0x159a0e[_0xcf8d('0x47')][_0xcf8d('0x51')],_0x159a0e['body'][_0xcf8d('0x2b')]);_0x159a0e['body']['Descriptions']=integrations['getDescriptions'](_0x159a0e[_0xcf8d('0x47')][_0xcf8d('0x51')],_0x159a0e[_0xcf8d('0x47')][_0xcf8d('0x2b')]);return db[_0xcf8d('0x4a')][_0xcf8d('0x46')](_0x159a0e[_0xcf8d('0x47')],{'include':[{'model':db['ZohoField'],'as':_0xcf8d('0x50')},{'model':db['ZohoField'],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x451262,null))[_0xcf8d('0x3f')](handleError(_0x451262,null));};function getAccessToken(_0x42eb0f){return new Promise(function(_0x78d092,_0x2d7dec){var _0x434f7b;switch(_0x42eb0f['zone']){case'US':_0x434f7b=_0xcf8d('0x52');break;case'AU':_0x434f7b=_0xcf8d('0x53');break;case'EU':_0x434f7b=_0xcf8d('0x54');break;case'IN':_0x434f7b='https://accounts.zoho.in';break;case'CN':_0x434f7b=_0xcf8d('0x55');break;default:_0x434f7b=_0xcf8d('0x54');break;}var _0x57d525={'method':_0xcf8d('0x56'),'uri':_0x434f7b+_0xcf8d('0x57'),'qs':{'refresh_token':_0x42eb0f[_0xcf8d('0x58')],'client_id':_0x42eb0f['clientId'],'client_secret':_0x42eb0f[_0xcf8d('0x59')],'grant_type':_0xcf8d('0x5a')},'json':!![]};return rp(_0x57d525)[_0xcf8d('0x25')](function(_0x193999){if(_0x193999[_0xcf8d('0x5b')]){_0x78d092(_0x193999['access_token']);}else{_0x2d7dec(_0xcf8d('0x5c'));}})[_0xcf8d('0x3f')](function(_0x1e1df1){_0x2d7dec(_0x1e1df1);});});}exports[_0xcf8d('0x5d')]=function(_0x149f12,_0x22e99c,_0x104d9a){var _0x24d13e,_0xfd2f8c,_0x24bc5e,_0x48a058,_0xd12ce7;return db[_0xcf8d('0x29')][_0xcf8d('0x4e')]({'where':{'id':_0x149f12['params']['id']},'attributes':['id','host',_0xcf8d('0x5e'),'clientId',_0xcf8d('0x59'),'serverUrl',_0xcf8d('0x5f'),'refreshToken']})['then'](handleEntityNotFound(_0x22e99c,null))[_0xcf8d('0x25')](function(_0x5bdf68){_0xd12ce7=_0x5bdf68;_0x24d13e=_0xd12ce7[_0xcf8d('0x60')];_0xfd2f8c=_0x24d13e===_0xcf8d('0x61')?'eu':_0xcf8d('0x62');_0x24bc5e=_0xd12ce7['serverUrl'];var _0x7eeb04=_0x24bc5e[_0xcf8d('0x63')](-0x1);if(_0x7eeb04==='/'||_0x7eeb04==='\x5c'||_0x7eeb04===':'){_0x24bc5e=_0x24bc5e['substring'](0x0,_0x24bc5e[_0xcf8d('0x64')](_0x7eeb04));}if(!_0xd12ce7[_0xcf8d('0x58')]){throw new Error('Refresh\x20Token\x20not\x20available\x20for\x20the\x20account');}return getAccessToken(_0xd12ce7);})['then'](function(_0x53c45c){if(_0x53c45c){return rp({'method':'GET','uri':util[_0xcf8d('0x65')](_0xcf8d('0x66'),_0xfd2f8c),'qs':{'module':_0xcf8d('0x67')},'headers':{'Authorization':_0xcf8d('0x68')+_0x53c45c},'json':!![]});}})['then'](function(_0x4f437b){if(_0x4f437b){if(_0x4f437b['response']&&_0x4f437b[_0xcf8d('0x69')][_0xcf8d('0x6a')]){throw new Error(_0x4f437b[_0xcf8d('0x69')][_0xcf8d('0x6a')][_0xcf8d('0x6b')]);}var _0x391e77=[];var _0xe48be9=[];var _0x369884=['Owner',_0xcf8d('0x6c'),'Description',_0xcf8d('0x6d'),_0xcf8d('0x6e'),_0xcf8d('0x6f'),_0xcf8d('0x70'),_0xcf8d('0x71')];_0xe48be9=_['remove'](_0x4f437b[_0xcf8d('0x33')],function(_0x254147){return _0x369884[_0xcf8d('0x72')](_0x254147[_0xcf8d('0x73')]);});for(var _0x2b96b7=0x0;_0x2b96b7<_0xe48be9['length'];_0x2b96b7++){if(_0xe48be9[_0x2b96b7][_0xcf8d('0x74')]===![]){_0x391e77[_0xcf8d('0x75')]({'id':_0xe48be9[_0x2b96b7]['id'],'name':_0xe48be9[_0x2b96b7][_0xcf8d('0x76')],'custom':_0xe48be9[_0x2b96b7][_0xcf8d('0x77')],'options':_0xe48be9[_0x2b96b7][_0xcf8d('0x78')]===_0xcf8d('0x79')&&_0xe48be9[_0x2b96b7]['pick_list_values'][_0xcf8d('0x42')]>-0x1?_[_0xcf8d('0x28')](_0xe48be9[_0x2b96b7][_0xcf8d('0x7a')],function(_0x404730){return{'name':_0x404730,'value':_0x404730};}):[]});}}return{'count':_0x391e77['length'],'rows':_0x391e77};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithResult(_0x22e99c,null))['catch'](function(_0x111c32){var _0x281c69=_0x149f12[_0xcf8d('0x2f')]['test']?0x1f4:_0x111c32['statusCode']||0x1f4;logger[_0xcf8d('0x6a')](_0xcf8d('0x7b'),'getFields',_0x281c69,JSON[_0xcf8d('0x7c')](_0x111c32));delete _0x111c32['name'];if(_0x281c69===0x191){_0x281c69=0x190;}_0x22e99c['status'](_0x281c69)[_0xcf8d('0x7d')](_0x149f12[_0xcf8d('0x2f')][_0xcf8d('0x7e')]?{'message':'Wrong\x20credentials','statusCode':_0x111c32[_0xcf8d('0x7f')]}:_0x111c32);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index a24eafb..a9aa8da 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 _0x494a=['int_zoho_accounts','changed','clientId','clientSecret','host','serverUrl','slice','substring','zone','https://accounts.zoho.com','https://accounts.zoho.in','https://accounts.zoho.eu','POST','/oauth/v2/token','then','parse','refresh_token','refreshToken','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','format','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','catch','error','lastIndexOf','https://accounts.zoho.com.au','authorization_code','application/x-www-form-urlencoded','info','lodash','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./intZohoAccount.attributes','exports','ZohoAccount'];(function(_0x35aed4,_0x1ee2ab){var _0x5a2cc0=function(_0x1f96f8){while(--_0x1f96f8){_0x35aed4['push'](_0x35aed4['shift']());}};_0x5a2cc0(++_0x1ee2ab);}(_0x494a,0x186));var _0xa494=function(_0x9d680d,_0x295c2f){_0x9d680d=_0x9d680d-0x0;var _0x2ff74d=_0x494a[_0x9d680d];return _0x2ff74d;};'use strict';var _=require(_0xa494('0x0'));var util=require('util');var logger=require(_0xa494('0x1'))(_0xa494('0x2'));var moment=require('moment');var BPromise=require(_0xa494('0x3'));var rp=require(_0xa494('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa494('0x5'));var config=require(_0xa494('0x6'));var attributes=require(_0xa494('0x7'));var integrations=require('../../components/integrations/configuration');module[_0xa494('0x8')]=function(_0x15da0a,_0x1dc122){return _0x15da0a['define'](_0xa494('0x9'),attributes,{'tableName':_0xa494('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x2a71d5,_0x22eccc,_0x1e1faf){if(_0x2a71d5[_0xa494('0xb')]('zone')||_0x2a71d5['changed']('serverUrl')||_0x2a71d5[_0xa494('0xb')](_0xa494('0xc'))||_0x2a71d5[_0xa494('0xb')](_0xa494('0xd'))||_0x2a71d5[_0xa494('0xb')]('code')||_0x2a71d5[_0xa494('0xb')](_0xa494('0xe'))){var _0x491e2f,_0x5f1d4a;_0x491e2f=_0x2a71d5[_0xa494('0xf')];var _0x3080de=_0x491e2f[_0xa494('0x10')](-0x1);if(_0x3080de==='/'||_0x3080de==='\x5c'||_0x3080de===':'){_0x491e2f=_0x491e2f[_0xa494('0x11')](0x0,_0x491e2f['lastIndexOf'](_0x3080de));}switch(_0x2a71d5[_0xa494('0x12')]){case'US':_0x5f1d4a=_0xa494('0x13');break;case'AU':_0x5f1d4a='https://accounts.zoho.com.au';break;case'IN':_0x5f1d4a=_0xa494('0x14');break;case'CN':_0x5f1d4a='https://accounts.zoho.com.cn';break;default:_0x5f1d4a=_0xa494('0x15');break;}var _0x181b7a={'method':_0xa494('0x16'),'uri':_0x5f1d4a+_0xa494('0x17'),'form':{'grant_type':'authorization_code','client_id':_0x2a71d5[_0xa494('0xc')],'client_secret':_0x2a71d5[_0xa494('0xd')],'redirect_uri':_0x2a71d5['serverUrl'],'code':_0x2a71d5['code']},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x181b7a)[_0xa494('0x18')](function(_0x33b4e7){var _0x558d3b=JSON[_0xa494('0x19')](_0x33b4e7);if(_0x558d3b[_0xa494('0x1a')]){_0x2a71d5[_0xa494('0x1b')]=_0x558d3b[_0xa494('0x1a')];logger['info'](util['format'](_0xa494('0x1c'),_0x2a71d5[_0xa494('0x1d')],_0x2a71d5['id']));}else{logger['error'](util[_0xa494('0x1e')](_0xa494('0x1f'),_0x2a71d5[_0xa494('0x1d')],_0x2a71d5['id']),util[_0xa494('0x20')](_0x558d3b,{'showHidden':![],'depth':null}));}return _0x1e1faf(null,_0x22eccc);})[_0xa494('0x21')](function(_0xd9ec){logger[_0xa494('0x22')](util['format']('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x2a71d5[_0xa494('0x1d')],_0x2a71d5['id']),util[_0xa494('0x20')](parsedResult,{'showHidden':![],'depth':null}));return _0x1e1faf(_0xd9ec);});}else{return _0x1e1faf(null,_0x22eccc);}},'beforeUpdate':function(_0x18e1a7,_0x1eb9a3,_0x539142){if(_0x18e1a7[_0xa494('0xb')](_0xa494('0x12'))||_0x18e1a7['changed'](_0xa494('0xf'))||_0x18e1a7[_0xa494('0xb')](_0xa494('0xc'))||_0x18e1a7[_0xa494('0xb')](_0xa494('0xd'))||_0x18e1a7['changed']('code')||_0x18e1a7[_0xa494('0xb')]('host')){var _0x29eeeb,_0x12f14e;_0x29eeeb=_0x18e1a7[_0xa494('0xf')];var _0x2d1e09=_0x29eeeb[_0xa494('0x10')](-0x1);if(_0x2d1e09==='/'||_0x2d1e09==='\x5c'||_0x2d1e09===':'){_0x29eeeb=_0x29eeeb['substring'](0x0,_0x29eeeb[_0xa494('0x23')](_0x2d1e09));}switch(_0x18e1a7[_0xa494('0x12')]){case'US':_0x12f14e=_0xa494('0x13');break;case'AU':_0x12f14e=_0xa494('0x24');break;case'IN':_0x12f14e=_0xa494('0x14');break;case'CN':_0x12f14e='https://accounts.zoho.com.cn';break;default:_0x12f14e=_0xa494('0x15');break;}var _0x5c0862={'method':_0xa494('0x16'),'uri':_0x12f14e+'/oauth/v2/token','form':{'grant_type':_0xa494('0x25'),'client_id':_0x18e1a7[_0xa494('0xc')],'client_secret':_0x18e1a7[_0xa494('0xd')],'redirect_uri':_0x18e1a7[_0xa494('0xf')],'code':_0x18e1a7['code']},'headers':{'Content-Type':_0xa494('0x26')}};return rp(_0x5c0862)['then'](function(_0x1f7aff){var _0xcdf64b=JSON['parse'](_0x1f7aff);if(_0xcdf64b[_0xa494('0x1a')]){_0x18e1a7[_0xa494('0x1b')]=_0xcdf64b[_0xa494('0x1a')];logger[_0xa494('0x27')](util[_0xa494('0x1e')](_0xa494('0x1c'),_0x18e1a7[_0xa494('0x1d')],_0x18e1a7['id']));}else{logger['error'](util[_0xa494('0x1e')](_0xa494('0x1f'),_0x18e1a7['name'],_0x18e1a7['id']),util[_0xa494('0x20')](_0xcdf64b,{'showHidden':![],'depth':null}));}return _0x539142(null,_0x1eb9a3);})[_0xa494('0x21')](function(_0x405eb2){logger[_0xa494('0x22')](util[_0xa494('0x1e')](_0xa494('0x1f'),_0x18e1a7['name'],_0x18e1a7['id']),util[_0xa494('0x20')](parsedResult,{'showHidden':![],'depth':null}));return _0x539142(_0x405eb2);});}else{return _0x539142(null,_0x1eb9a3);}}}});}; \ No newline at end of file +var _0x6e08=['ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','catch','host','lastIndexOf','https://accounts.zoho.com','application/x-www-form-urlencoded','info','inspect','util','api','bluebird','request-promise','rimraf','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','ZohoAccount','changed','zone','clientId','clientSecret','code','serverUrl','slice','substring','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','authorization_code','then','parse','refreshToken','refresh_token','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','format'];(function(_0x22e513,_0x53d375){var _0x55d29b=function(_0x2ccff5){while(--_0x2ccff5){_0x22e513['push'](_0x22e513['shift']());}};_0x55d29b(++_0x53d375);}(_0x6e08,0xda));var _0x86e0=function(_0x2f85b3,_0x416a6f){_0x2f85b3=_0x2f85b3-0x0;var _0x99349d=_0x6e08[_0x2f85b3];return _0x99349d;};'use strict';var _=require('lodash');var util=require(_0x86e0('0x0'));var logger=require('../../config/logger')(_0x86e0('0x1'));var moment=require('moment');var BPromise=require(_0x86e0('0x2'));var rp=require(_0x86e0('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x86e0('0x4'));var config=require(_0x86e0('0x5'));var attributes=require(_0x86e0('0x6'));var integrations=require(_0x86e0('0x7'));module[_0x86e0('0x8')]=function(_0x36b412,_0x1b1174){return _0x36b412[_0x86e0('0x9')](_0x86e0('0xa'),attributes,{'tableName':'int_zoho_accounts','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x4a60dc,_0x4c834f,_0x461db5){if(_0x4a60dc[_0x86e0('0xb')](_0x86e0('0xc'))||_0x4a60dc[_0x86e0('0xb')]('serverUrl')||_0x4a60dc[_0x86e0('0xb')](_0x86e0('0xd'))||_0x4a60dc[_0x86e0('0xb')](_0x86e0('0xe'))||_0x4a60dc[_0x86e0('0xb')](_0x86e0('0xf'))||_0x4a60dc[_0x86e0('0xb')]('host')){var _0xd7b2dc,_0x215676;_0xd7b2dc=_0x4a60dc[_0x86e0('0x10')];var _0x4dd79f=_0xd7b2dc[_0x86e0('0x11')](-0x1);if(_0x4dd79f==='/'||_0x4dd79f==='\x5c'||_0x4dd79f===':'){_0xd7b2dc=_0xd7b2dc[_0x86e0('0x12')](0x0,_0xd7b2dc['lastIndexOf'](_0x4dd79f));}switch(_0x4a60dc[_0x86e0('0xc')]){case'US':_0x215676='https://accounts.zoho.com';break;case'AU':_0x215676=_0x86e0('0x13');break;case'IN':_0x215676=_0x86e0('0x14');break;case'CN':_0x215676=_0x86e0('0x15');break;default:_0x215676=_0x86e0('0x16');break;}var _0x28e8bb={'method':_0x86e0('0x17'),'uri':_0x215676+_0x86e0('0x18'),'form':{'grant_type':_0x86e0('0x19'),'client_id':_0x4a60dc[_0x86e0('0xd')],'client_secret':_0x4a60dc[_0x86e0('0xe')],'redirect_uri':_0x4a60dc[_0x86e0('0x10')],'code':_0x4a60dc[_0x86e0('0xf')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x28e8bb)[_0x86e0('0x1a')](function(_0x353c03){var _0x45984b=JSON[_0x86e0('0x1b')](_0x353c03);if(_0x45984b['refresh_token']){_0x4a60dc[_0x86e0('0x1c')]=_0x45984b[_0x86e0('0x1d')];logger['info'](util['format'](_0x86e0('0x1e'),_0x4a60dc[_0x86e0('0x1f')],_0x4a60dc['id']));}else{logger[_0x86e0('0x20')](util[_0x86e0('0x21')](_0x86e0('0x22'),_0x4a60dc[_0x86e0('0x1f')],_0x4a60dc['id']),util['inspect'](_0x45984b,{'showHidden':![],'depth':null}));}return _0x461db5(null,_0x4c834f);})[_0x86e0('0x23')](function(_0x4f462a){logger[_0x86e0('0x20')](util['format'](_0x86e0('0x22'),_0x4a60dc[_0x86e0('0x1f')],_0x4a60dc['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x461db5(_0x4f462a);});}else{return _0x461db5(null,_0x4c834f);}},'beforeUpdate':function(_0x10a262,_0x56d418,_0x3b88bd){if(_0x10a262[_0x86e0('0xb')](_0x86e0('0xc'))||_0x10a262[_0x86e0('0xb')](_0x86e0('0x10'))||_0x10a262['changed'](_0x86e0('0xd'))||_0x10a262['changed'](_0x86e0('0xe'))||_0x10a262[_0x86e0('0xb')]('code')||_0x10a262[_0x86e0('0xb')](_0x86e0('0x24'))){var _0x577481,_0x40a63c;_0x577481=_0x10a262['serverUrl'];var _0x4d76ba=_0x577481[_0x86e0('0x11')](-0x1);if(_0x4d76ba==='/'||_0x4d76ba==='\x5c'||_0x4d76ba===':'){_0x577481=_0x577481[_0x86e0('0x12')](0x0,_0x577481[_0x86e0('0x25')](_0x4d76ba));}switch(_0x10a262[_0x86e0('0xc')]){case'US':_0x40a63c=_0x86e0('0x26');break;case'AU':_0x40a63c='https://accounts.zoho.com.au';break;case'IN':_0x40a63c=_0x86e0('0x14');break;case'CN':_0x40a63c=_0x86e0('0x15');break;default:_0x40a63c=_0x86e0('0x16');break;}var _0x1389a8={'method':'POST','uri':_0x40a63c+_0x86e0('0x18'),'form':{'grant_type':_0x86e0('0x19'),'client_id':_0x10a262[_0x86e0('0xd')],'client_secret':_0x10a262[_0x86e0('0xe')],'redirect_uri':_0x10a262[_0x86e0('0x10')],'code':_0x10a262[_0x86e0('0xf')]},'headers':{'Content-Type':_0x86e0('0x27')}};return rp(_0x1389a8)[_0x86e0('0x1a')](function(_0x4c5687){var _0x49025a=JSON[_0x86e0('0x1b')](_0x4c5687);if(_0x49025a[_0x86e0('0x1d')]){_0x10a262[_0x86e0('0x1c')]=_0x49025a[_0x86e0('0x1d')];logger[_0x86e0('0x28')](util[_0x86e0('0x21')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x10a262['name'],_0x10a262['id']));}else{logger[_0x86e0('0x20')](util[_0x86e0('0x21')](_0x86e0('0x22'),_0x10a262[_0x86e0('0x1f')],_0x10a262['id']),util[_0x86e0('0x29')](_0x49025a,{'showHidden':![],'depth':null}));}return _0x3b88bd(null,_0x56d418);})[_0x86e0('0x23')](function(_0x2c180d){logger[_0x86e0('0x20')](util[_0x86e0('0x21')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x10a262[_0x86e0('0x1f')],_0x10a262['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x3b88bd(_0x2c180d);});}else{return _0x3b88bd(null,_0x56d418);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index f766fa6..68f62ca 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 _0xbc36=['error','code','ZohoAccount,\x20%s,\x20%s','message','result','catch','GetZohoAccount','ZohoAccount','findAll','options','raw','where','attributes','limit','include','map','model','ShowZohoAccount','find','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x488dd9,_0x27203f){var _0xa1a4a7=function(_0x224337){while(--_0x224337){_0x488dd9['push'](_0x488dd9['shift']());}};_0xa1a4a7(++_0x27203f);}(_0xbc36,0x169));var _0x6bc3=function(_0x45a28a,_0x25fef3){_0x45a28a=_0x45a28a-0x0;var _0x5c0f22=_0xbc36[_0x45a28a];return _0x5c0f22;};'use strict';var _=require(_0x6bc3('0x0'));var util=require('util');var moment=require(_0x6bc3('0x1'));var BPromise=require(_0x6bc3('0x2'));var rs=require(_0x6bc3('0x3'));var fs=require('fs');var Redis=require(_0x6bc3('0x4'));var db=require(_0x6bc3('0x5'))['db'];var utils=require(_0x6bc3('0x6'));var logger=require(_0x6bc3('0x7'))(_0x6bc3('0x8'));var config=require(_0x6bc3('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x6bc3('0xa')][_0x6bc3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5584a5,_0x33e11c,_0x1f894a){return new BPromise(function(_0xf07594,_0x4de32d){return client[_0x6bc3('0xc')](_0x5584a5,_0x1f894a)[_0x6bc3('0xd')](function(_0x33e8e0){logger[_0x6bc3('0xe')]('ZohoAccount,\x20%s,\x20%s',_0x33e11c,_0x6bc3('0xf'));logger[_0x6bc3('0x10')](_0x6bc3('0x11'),_0x33e11c,_0x6bc3('0xf'),JSON[_0x6bc3('0x12')](_0x33e8e0));if(_0x33e8e0[_0x6bc3('0x13')]){if(_0x33e8e0[_0x6bc3('0x13')][_0x6bc3('0x14')]===0x1f4){logger[_0x6bc3('0x13')]('ZohoAccount,\x20%s,\x20%s',_0x33e11c,_0x33e8e0[_0x6bc3('0x13')]['message']);return _0x4de32d(_0x33e8e0[_0x6bc3('0x13')]['message']);}logger[_0x6bc3('0x13')](_0x6bc3('0x15'),_0x33e11c,_0x33e8e0['error'][_0x6bc3('0x16')]);return _0xf07594(_0x33e8e0['error']['message']);}else{logger[_0x6bc3('0xe')](_0x6bc3('0x15'),_0x33e11c,_0x6bc3('0xf'));_0xf07594(_0x33e8e0[_0x6bc3('0x17')][_0x6bc3('0x16')]);}})[_0x6bc3('0x18')](function(_0xa1782){logger['error'](_0x6bc3('0x15'),_0x33e11c,_0xa1782);_0x4de32d(_0xa1782);});});}exports[_0x6bc3('0x19')]=function(_0x4c1894){var _0x426a16=this;return new Promise(function(_0x1d27db,_0x232496){return db[_0x6bc3('0x1a')][_0x6bc3('0x1b')]({'raw':_0x4c1894[_0x6bc3('0x1c')]?_0x4c1894[_0x6bc3('0x1c')][_0x6bc3('0x1d')]===undefined?!![]:![]:!![],'where':_0x4c1894[_0x6bc3('0x1c')]?_0x4c1894[_0x6bc3('0x1c')][_0x6bc3('0x1e')]||null:null,'attributes':_0x4c1894[_0x6bc3('0x1c')]?_0x4c1894['options'][_0x6bc3('0x1f')]||null:null,'limit':_0x4c1894[_0x6bc3('0x1c')]?_0x4c1894['options'][_0x6bc3('0x20')]||null:null,'include':_0x4c1894['options']?_0x4c1894[_0x6bc3('0x1c')][_0x6bc3('0x21')]?_[_0x6bc3('0x22')](_0x4c1894[_0x6bc3('0x1c')][_0x6bc3('0x21')],function(_0x453ada){return{'model':db[_0x453ada[_0x6bc3('0x23')]],'as':_0x453ada['as'],'attributes':_0x453ada[_0x6bc3('0x1f')],'include':_0x453ada[_0x6bc3('0x21')]?_[_0x6bc3('0x22')](_0x453ada[_0x6bc3('0x21')],function(_0x1e9a9c){return{'model':db[_0x1e9a9c[_0x6bc3('0x23')]],'as':_0x1e9a9c['as'],'attributes':_0x1e9a9c['attributes'],'include':_0x1e9a9c[_0x6bc3('0x21')]?_[_0x6bc3('0x22')](_0x1e9a9c[_0x6bc3('0x21')],function(_0x1ab236){return{'model':db[_0x1ab236[_0x6bc3('0x23')]],'as':_0x1ab236['as'],'attributes':_0x1ab236['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3e6365){logger['info'](_0x6bc3('0x19'),_0x4c1894);logger[_0x6bc3('0x10')](_0x6bc3('0x19'),_0x4c1894,JSON[_0x6bc3('0x12')](_0x3e6365));_0x1d27db(_0x3e6365);})['catch'](function(_0x66fb54){logger[_0x6bc3('0x13')](_0x6bc3('0x19'),_0x66fb54[_0x6bc3('0x16')],_0x4c1894);_0x232496(_0x426a16[_0x6bc3('0x13')](0x1f4,_0x66fb54['message']));});});};exports[_0x6bc3('0x24')]=function(_0xe5c34b){var _0x18cf51=this;return new Promise(function(_0x2815d9,_0x956c55){return db['ZohoAccount'][_0x6bc3('0x25')]({'raw':_0xe5c34b[_0x6bc3('0x1c')]?_0xe5c34b[_0x6bc3('0x1c')][_0x6bc3('0x1d')]===undefined?!![]:![]:!![],'where':_0xe5c34b[_0x6bc3('0x1c')]?_0xe5c34b[_0x6bc3('0x1c')][_0x6bc3('0x1e')]||null:null,'attributes':_0xe5c34b[_0x6bc3('0x1c')]?_0xe5c34b['options'][_0x6bc3('0x1f')]||null:null,'include':_0xe5c34b['options']?_0xe5c34b['options'][_0x6bc3('0x21')]?_[_0x6bc3('0x22')](_0xe5c34b['options'][_0x6bc3('0x21')],function(_0x675b93){return{'model':db[_0x675b93[_0x6bc3('0x23')]],'as':_0x675b93['as'],'attributes':_0x675b93[_0x6bc3('0x1f')],'include':_0x675b93[_0x6bc3('0x21')]?_[_0x6bc3('0x22')](_0x675b93[_0x6bc3('0x21')],function(_0xf0f900){return{'model':db[_0xf0f900[_0x6bc3('0x23')]],'as':_0xf0f900['as'],'attributes':_0xf0f900[_0x6bc3('0x1f')],'include':_0xf0f900[_0x6bc3('0x21')]?_[_0x6bc3('0x22')](_0xf0f900[_0x6bc3('0x21')],function(_0x104537){return{'model':db[_0x104537['model']],'as':_0x104537['as'],'attributes':_0x104537[_0x6bc3('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x6bc3('0xd')](function(_0x5d7bcd){logger[_0x6bc3('0xe')]('ShowZohoAccount',_0xe5c34b);logger[_0x6bc3('0x10')](_0x6bc3('0x24'),_0xe5c34b,JSON[_0x6bc3('0x12')](_0x5d7bcd));_0x2815d9(_0x5d7bcd);})[_0x6bc3('0x18')](function(_0x254946){logger[_0x6bc3('0x13')](_0x6bc3('0x24'),_0x254946[_0x6bc3('0x16')],_0xe5c34b);_0x956c55(_0x18cf51[_0x6bc3('0x13')](0x1f4,_0x254946[_0x6bc3('0x16')]));});});}; \ No newline at end of file +var _0xeae8=['lodash','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','error','message','result','ZohoAccount','findAll','options','raw','attributes','limit','include','model','map','then','GetZohoAccount','stringify','catch','ShowZohoAccount','find','where'];(function(_0x2fd719,_0xa1c429){var _0x3fcc83=function(_0x8e31fa){while(--_0x8e31fa){_0x2fd719['push'](_0x2fd719['shift']());}};_0x3fcc83(++_0xa1c429);}(_0xeae8,0x66));var _0x8eae=function(_0x26b29e,_0x2e0806){_0x26b29e=_0x26b29e-0x0;var _0x2e7bfc=_0xeae8[_0x26b29e];return _0x2e7bfc;};'use strict';var _=require(_0x8eae('0x0'));var util=require(_0x8eae('0x1'));var moment=require(_0x8eae('0x2'));var BPromise=require('bluebird');var rs=require(_0x8eae('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8eae('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x8eae('0x5'))(_0x8eae('0x6'));var config=require(_0x8eae('0x7'));var jayson=require(_0x8eae('0x8'));var client=jayson[_0x8eae('0x9')][_0x8eae('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x32c67f,_0xd2b0,_0x2dcd90){return new BPromise(function(_0x2ae6e7,_0x476ba1){return client['request'](_0x32c67f,_0x2dcd90)['then'](function(_0x1cd68f){logger[_0x8eae('0xb')](_0x8eae('0xc'),_0xd2b0,_0x8eae('0xd'));logger[_0x8eae('0xe')]('ZohoAccount,\x20%s,\x20%s,\x20%s',_0xd2b0,'request\x20sent',JSON['stringify'](_0x1cd68f));if(_0x1cd68f[_0x8eae('0xf')]){if(_0x1cd68f[_0x8eae('0xf')]['code']===0x1f4){logger[_0x8eae('0xf')]('ZohoAccount,\x20%s,\x20%s',_0xd2b0,_0x1cd68f[_0x8eae('0xf')][_0x8eae('0x10')]);return _0x476ba1(_0x1cd68f[_0x8eae('0xf')][_0x8eae('0x10')]);}logger[_0x8eae('0xf')]('ZohoAccount,\x20%s,\x20%s',_0xd2b0,_0x1cd68f[_0x8eae('0xf')][_0x8eae('0x10')]);return _0x2ae6e7(_0x1cd68f[_0x8eae('0xf')][_0x8eae('0x10')]);}else{logger[_0x8eae('0xb')](_0x8eae('0xc'),_0xd2b0,_0x8eae('0xd'));_0x2ae6e7(_0x1cd68f[_0x8eae('0x11')][_0x8eae('0x10')]);}})['catch'](function(_0x5e214e){logger['error'](_0x8eae('0xc'),_0xd2b0,_0x5e214e);_0x476ba1(_0x5e214e);});});}exports['GetZohoAccount']=function(_0x3db47b){var _0x3fe930=this;return new Promise(function(_0x386a97,_0x13331a){return db[_0x8eae('0x12')][_0x8eae('0x13')]({'raw':_0x3db47b[_0x8eae('0x14')]?_0x3db47b[_0x8eae('0x14')][_0x8eae('0x15')]===undefined?!![]:![]:!![],'where':_0x3db47b[_0x8eae('0x14')]?_0x3db47b['options']['where']||null:null,'attributes':_0x3db47b[_0x8eae('0x14')]?_0x3db47b[_0x8eae('0x14')][_0x8eae('0x16')]||null:null,'limit':_0x3db47b['options']?_0x3db47b[_0x8eae('0x14')][_0x8eae('0x17')]||null:null,'include':_0x3db47b['options']?_0x3db47b[_0x8eae('0x14')][_0x8eae('0x18')]?_['map'](_0x3db47b[_0x8eae('0x14')][_0x8eae('0x18')],function(_0x171710){return{'model':db[_0x171710[_0x8eae('0x19')]],'as':_0x171710['as'],'attributes':_0x171710[_0x8eae('0x16')],'include':_0x171710[_0x8eae('0x18')]?_[_0x8eae('0x1a')](_0x171710[_0x8eae('0x18')],function(_0x14c0c5){return{'model':db[_0x14c0c5[_0x8eae('0x19')]],'as':_0x14c0c5['as'],'attributes':_0x14c0c5[_0x8eae('0x16')],'include':_0x14c0c5['include']?_[_0x8eae('0x1a')](_0x14c0c5[_0x8eae('0x18')],function(_0x141940){return{'model':db[_0x141940[_0x8eae('0x19')]],'as':_0x141940['as'],'attributes':_0x141940[_0x8eae('0x16')]};}):[]};}):[]};}):[]:[]})[_0x8eae('0x1b')](function(_0x206ba3){logger['info'](_0x8eae('0x1c'),_0x3db47b);logger['debug'](_0x8eae('0x1c'),_0x3db47b,JSON[_0x8eae('0x1d')](_0x206ba3));_0x386a97(_0x206ba3);})[_0x8eae('0x1e')](function(_0x3f5d30){logger[_0x8eae('0xf')]('GetZohoAccount',_0x3f5d30['message'],_0x3db47b);_0x13331a(_0x3fe930[_0x8eae('0xf')](0x1f4,_0x3f5d30[_0x8eae('0x10')]));});});};exports[_0x8eae('0x1f')]=function(_0x307a19){var _0x547eea=this;return new Promise(function(_0x113dc7,_0x22ffeb){return db[_0x8eae('0x12')][_0x8eae('0x20')]({'raw':_0x307a19[_0x8eae('0x14')]?_0x307a19[_0x8eae('0x14')][_0x8eae('0x15')]===undefined?!![]:![]:!![],'where':_0x307a19[_0x8eae('0x14')]?_0x307a19[_0x8eae('0x14')][_0x8eae('0x21')]||null:null,'attributes':_0x307a19[_0x8eae('0x14')]?_0x307a19[_0x8eae('0x14')][_0x8eae('0x16')]||null:null,'include':_0x307a19[_0x8eae('0x14')]?_0x307a19[_0x8eae('0x14')][_0x8eae('0x18')]?_[_0x8eae('0x1a')](_0x307a19[_0x8eae('0x14')][_0x8eae('0x18')],function(_0x2fc72a){return{'model':db[_0x2fc72a[_0x8eae('0x19')]],'as':_0x2fc72a['as'],'attributes':_0x2fc72a['attributes'],'include':_0x2fc72a[_0x8eae('0x18')]?_[_0x8eae('0x1a')](_0x2fc72a[_0x8eae('0x18')],function(_0x4bf905){return{'model':db[_0x4bf905[_0x8eae('0x19')]],'as':_0x4bf905['as'],'attributes':_0x4bf905[_0x8eae('0x16')],'include':_0x4bf905[_0x8eae('0x18')]?_[_0x8eae('0x1a')](_0x4bf905['include'],function(_0xa885ad){return{'model':db[_0xa885ad['model']],'as':_0xa885ad['as'],'attributes':_0xa885ad['attributes']};}):[]};}):[]};}):[]:[]})[_0x8eae('0x1b')](function(_0x38713d){logger[_0x8eae('0xb')](_0x8eae('0x1f'),_0x307a19);logger[_0x8eae('0xe')](_0x8eae('0x1f'),_0x307a19,JSON[_0x8eae('0x1d')](_0x38713d));_0x113dc7(_0x38713d);})['catch'](function(_0x71f9be){logger[_0x8eae('0xf')]('ShowZohoAccount',_0x71f9be['message'],_0x307a19);_0x22ffeb(_0x547eea['error'](0x1f4,_0x71f9be[_0x8eae('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index e38dc7d..51520db 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 _0x7680=['get','/:id','show','/:id/fields','getFields','/:id/descriptions','getDescriptions','post','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','isAuthenticated','index'];(function(_0x3eca91,_0x37d7e5){var _0x5e79e3=function(_0x2b22d6){while(--_0x2b22d6){_0x3eca91['push'](_0x3eca91['shift']());}};_0x5e79e3(++_0x37d7e5);}(_0x7680,0x114));var _0x0768=function(_0x4a9771,_0x52429b){_0x4a9771=_0x4a9771-0x0;var _0x52e0ed=_0x7680[_0x4a9771];return _0x52e0ed;};'use strict';var multer=require(_0x0768('0x0'));var util=require(_0x0768('0x1'));var path=require(_0x0768('0x2'));var timeout=require(_0x0768('0x3'));var express=require(_0x0768('0x4'));var router=express[_0x0768('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x0768('0x6'));var interaction=require(_0x0768('0x7'));var config=require(_0x0768('0x8'));var controller=require(_0x0768('0x9'));router['get']('/',auth[_0x0768('0xa')](),controller[_0x0768('0xb')]);router[_0x0768('0xc')](_0x0768('0xd'),auth[_0x0768('0xa')](),controller[_0x0768('0xe')]);router[_0x0768('0xc')](_0x0768('0xf'),auth[_0x0768('0xa')](),controller[_0x0768('0x10')]);router[_0x0768('0xc')]('/:id/subjects',auth['isAuthenticated'](),controller['getSubjects']);router[_0x0768('0xc')](_0x0768('0x11'),auth[_0x0768('0xa')](),controller[_0x0768('0x12')]);router[_0x0768('0x13')]('/',auth[_0x0768('0xa')](),controller['create']);router[_0x0768('0x14')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x0768('0x15')]('/:id',auth[_0x0768('0xa')](),controller[_0x0768('0x16')]);module[_0x0768('0x17')]=router; \ No newline at end of file +var _0x7e3a=['../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','update','multer','util','path','express','../../components/auth/service'];(function(_0x56ebb1,_0x5309fb){var _0xebb026=function(_0xed4f63){while(--_0xed4f63){_0x56ebb1['push'](_0x56ebb1['shift']());}};_0xebb026(++_0x5309fb);}(_0x7e3a,0x14b));var _0xa7e3=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x7e3a[_0x167cc1];return _0x10bc4b;};'use strict';var multer=require(_0xa7e3('0x0'));var util=require(_0xa7e3('0x1'));var path=require(_0xa7e3('0x2'));var timeout=require('connect-timeout');var express=require(_0xa7e3('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xa7e3('0x4'));var interaction=require(_0xa7e3('0x5'));var config=require(_0xa7e3('0x6'));var controller=require('./intZohoConfiguration.controller');router[_0xa7e3('0x7')]('/',auth['isAuthenticated'](),controller[_0xa7e3('0x8')]);router[_0xa7e3('0x7')](_0xa7e3('0x9'),auth[_0xa7e3('0xa')](),controller[_0xa7e3('0xb')]);router[_0xa7e3('0x7')](_0xa7e3('0xc'),auth[_0xa7e3('0xa')](),controller[_0xa7e3('0xd')]);router[_0xa7e3('0x7')](_0xa7e3('0xe'),auth[_0xa7e3('0xa')](),controller[_0xa7e3('0xf')]);router['get'](_0xa7e3('0x10'),auth[_0xa7e3('0xa')](),controller[_0xa7e3('0x11')]);router[_0xa7e3('0x12')]('/',auth[_0xa7e3('0xa')](),controller[_0xa7e3('0x13')]);router['put']('/:id',auth[_0xa7e3('0xa')](),controller[_0xa7e3('0x14')]);router['delete'](_0xa7e3('0x9'),auth[_0xa7e3('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index 2df5dcf..224abaf 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 _0x159f=['ENUM','lead','contact','nothing','contact_lead','sequelize','exports','STRING'];(function(_0x154d79,_0x44cffc){var _0x147102=function(_0x5a1903){while(--_0x5a1903){_0x154d79['push'](_0x154d79['shift']());}};_0x147102(++_0x44cffc);}(_0x159f,0x10d));var _0xf159=function(_0x495ad4,_0x395df5){_0x495ad4=_0x495ad4-0x0;var _0x13b039=_0x159f[_0x495ad4];return _0x13b039;};'use strict';var Sequelize=require(_0xf159('0x0'));module[_0xf159('0x1')]={'name':{'type':Sequelize[_0xf159('0x2')]},'moduleCreate':{'type':Sequelize[_0xf159('0x3')](_0xf159('0x4'),_0xf159('0x5'),_0xf159('0x6')),'defaultValue':_0xf159('0x4')},'moduleSearch':{'type':Sequelize['ENUM'](_0xf159('0x7'),_0xf159('0x5'),'lead'),'defaultValue':_0xf159('0x7')},'description':{'type':Sequelize[_0xf159('0x2')]}}; \ No newline at end of file +var _0x66d6=['sequelize','STRING','ENUM','lead','nothing','contact_lead','contact'];(function(_0x236766,_0x5ab0b9){var _0x32313d=function(_0x5d60ac){while(--_0x5d60ac){_0x236766['push'](_0x236766['shift']());}};_0x32313d(++_0x5ab0b9);}(_0x66d6,0x1c7));var _0x666d=function(_0x388914,_0x3c63f9){_0x388914=_0x388914-0x0;var _0x1f9111=_0x66d6[_0x388914];return _0x1f9111;};'use strict';var Sequelize=require(_0x666d('0x0'));module['exports']={'name':{'type':Sequelize[_0x666d('0x1')]},'moduleCreate':{'type':Sequelize[_0x666d('0x2')](_0x666d('0x3'),'contact',_0x666d('0x4')),'defaultValue':_0x666d('0x3')},'moduleSearch':{'type':Sequelize[_0x666d('0x2')](_0x666d('0x5'),_0x666d('0x6'),_0x666d('0x3')),'defaultValue':'contact_lead'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index e15c74b..06377e2 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 _0x318e=['query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','ZohoConfiguration','findAll','catch','show','create','body','update','find','params','getFields','ZohoField','pick','nolimit','getSubjects','findOne','getDescriptions','eml-format','fast-json-patch','request-promise','bluebird','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','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','save','then','destroy','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type'];(function(_0x112a22,_0x39cf24){var _0x3aeb98=function(_0x3235ee){while(--_0x3235ee){_0x112a22['push'](_0x112a22['shift']());}};_0x3aeb98(++_0x39cf24);}(_0x318e,0x112));var _0xe318=function(_0x483b1a,_0x157226){_0x483b1a=_0x483b1a-0x0;var _0x30eddd=_0x318e[_0x483b1a];return _0x30eddd;};'use strict';var emlformat=require(_0xe318('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xe318('0x1'));var rp=require(_0xe318('0x2'));var moment=require('moment');var BPromise=require(_0xe318('0x3'));var Mustache=require('mustache');var util=require(_0xe318('0x4'));var path=require('path');var sox=require(_0xe318('0x5'));var csv=require(_0xe318('0x6'));var ejs=require(_0xe318('0x7'));var fs=require('fs');var fs_extra=require(_0xe318('0x8'));var _=require(_0xe318('0x9'));var squel=require(_0xe318('0xa'));var crypto=require(_0xe318('0xb'));var jsforce=require(_0xe318('0xc'));var deskjs=require(_0xe318('0xd'));var toCsv=require(_0xe318('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe318('0xe'));var qs=require(_0xe318('0xf'));var as=require(_0xe318('0x10'));var hardwareService=require(_0xe318('0x11'));var logger=require('../../config/logger')(_0xe318('0x12'));var utils=require(_0xe318('0x13'));var config=require(_0xe318('0x14'));var licenseUtil=require(_0xe318('0x15'));var db=require(_0xe318('0x16'))['db'];function respondWithStatusCode(_0x429a49,_0x3a3548){_0x3a3548=_0x3a3548||0xcc;return function(_0x48738c){if(_0x48738c){return _0x429a49['sendStatus'](_0x3a3548);}return _0x429a49[_0xe318('0x17')](_0x3a3548)[_0xe318('0x18')]();};}function respondWithResult(_0xb9c9b3,_0x354025){_0x354025=_0x354025||0xc8;return function(_0x492331){if(_0x492331){return _0xb9c9b3[_0xe318('0x17')](_0x354025)[_0xe318('0x19')](_0x492331);}};}function respondWithFilteredResult(_0x2c9f0b,_0x4df5f9){return function(_0x201b7c){if(_0x201b7c){var _0x1563f7=typeof _0x4df5f9['offset']==='undefined'&&typeof _0x4df5f9[_0xe318('0x1a')]===_0xe318('0x1b');var _0x25fe70=_0x201b7c[_0xe318('0x1c')];var _0x3a5f80=_0x1563f7?0x0:_0x4df5f9['offset'];var _0x48bab3=_0x1563f7?_0x201b7c[_0xe318('0x1c')]:_0x4df5f9[_0xe318('0x1d')]+_0x4df5f9[_0xe318('0x1a')];var _0xba21ed;if(_0x48bab3>=_0x25fe70){_0x48bab3=_0x25fe70;_0xba21ed=0xc8;}else{_0xba21ed=0xce;}_0x2c9f0b['status'](_0xba21ed);return _0x2c9f0b[_0xe318('0x1e')](_0xe318('0x1f'),_0x3a5f80+'-'+_0x48bab3+'/'+_0x25fe70)['json'](_0x201b7c);}return null;};}function patchUpdates(_0x6dbc0d){return function(_0x709910){try{jsonpatch[_0xe318('0x20')](_0x709910,_0x6dbc0d,!![]);}catch(_0x3a2ef5){return BPromise['reject'](_0x3a2ef5);}return _0x709910[_0xe318('0x21')]();};}function saveUpdates(_0x45e6bf,_0x46cb72){return function(_0x52468f){if(_0x52468f){return _0x52468f['update'](_0x45e6bf)[_0xe318('0x22')](function(_0xc16424){return _0xc16424;});}return null;};}function removeEntity(_0x4cb9af,_0x373135){return function(_0x4636b0){if(_0x4636b0){return _0x4636b0[_0xe318('0x23')]()[_0xe318('0x22')](function(){_0x4cb9af[_0xe318('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1fba53,_0x1feba0){return function(_0xc73857){if(!_0xc73857){_0x1fba53[_0xe318('0x24')](0x194);}return _0xc73857;};}function handleError(_0x3f8937,_0x167376){_0x167376=_0x167376||0x1f4;return function(_0x315179){logger[_0xe318('0x25')](_0x315179[_0xe318('0x26')]);if(_0x315179[_0xe318('0x27')]){delete _0x315179[_0xe318('0x27')];}_0x3f8937[_0xe318('0x17')](_0x167376)[_0xe318('0x28')](_0x315179);};}exports[_0xe318('0x29')]=function(_0xf0059f,_0x425ee8){var _0x3d9dd4={},_0x132e76={},_0x30de45={'count':0x0,'rows':[]};var _0x50ee8b=_[_0xe318('0x2a')](db['ZohoConfiguration'][_0xe318('0x2b')],function(_0x12ccac){return{'name':_0x12ccac[_0xe318('0x2c')],'type':_0x12ccac[_0xe318('0x2d')]['key']};});_0x132e76['model']=_[_0xe318('0x2a')](_0x50ee8b,_0xe318('0x27'));_0x132e76[_0xe318('0x2e')]=_[_0xe318('0x2f')](_0xf0059f[_0xe318('0x2e')]);_0x132e76[_0xe318('0x30')]=_[_0xe318('0x31')](_0x132e76[_0xe318('0x32')],_0x132e76[_0xe318('0x2e')]);_0x3d9dd4[_0xe318('0x33')]=_[_0xe318('0x31')](_0x132e76[_0xe318('0x32')],qs[_0xe318('0x34')](_0xf0059f['query'][_0xe318('0x34')]));_0x3d9dd4[_0xe318('0x33')]=_0x3d9dd4[_0xe318('0x33')][_0xe318('0x35')]?_0x3d9dd4[_0xe318('0x33')]:_0x132e76[_0xe318('0x32')];if(!_0xf0059f[_0xe318('0x2e')][_0xe318('0x36')]('nolimit')){_0x3d9dd4[_0xe318('0x1a')]=qs[_0xe318('0x1a')](_0xf0059f['query'][_0xe318('0x1a')]);_0x3d9dd4[_0xe318('0x1d')]=qs['offset'](_0xf0059f['query'][_0xe318('0x1d')]);}_0x3d9dd4[_0xe318('0x37')]=qs[_0xe318('0x38')](_0xf0059f['query'][_0xe318('0x38')]);_0x3d9dd4[_0xe318('0x39')]=qs['filters'](_['pick'](_0xf0059f[_0xe318('0x2e')],_0x132e76[_0xe318('0x30')]),_0x50ee8b);if(_0xf0059f[_0xe318('0x2e')]['filter']){_0x3d9dd4[_0xe318('0x39')]=_[_0xe318('0x3a')](_0x3d9dd4[_0xe318('0x39')],{'$or':_['map'](_0x50ee8b,function(_0x1848fe){if(_0x1848fe[_0xe318('0x2d')]!==_0xe318('0x3b')){var _0x2b0dc8={};_0x2b0dc8[_0x1848fe[_0xe318('0x27')]]={'$like':'%'+_0xf0059f[_0xe318('0x2e')][_0xe318('0x3c')]+'%'};return _0x2b0dc8;}})});}_0x3d9dd4=_[_0xe318('0x3a')]({},_0x3d9dd4,_0xf0059f[_0xe318('0x3d')]);var _0x1a4e77={'where':_0x3d9dd4[_0xe318('0x39')]};return db['ZohoConfiguration']['count'](_0x1a4e77)[_0xe318('0x22')](function(_0x9969a1){_0x30de45['count']=_0x9969a1;if(_0xf0059f[_0xe318('0x2e')][_0xe318('0x3e')]){_0x3d9dd4[_0xe318('0x3f')]=[{'all':!![]}];}return db[_0xe318('0x40')][_0xe318('0x41')](_0x3d9dd4);})[_0xe318('0x22')](function(_0x37b0ef){_0x30de45['rows']=_0x37b0ef;return _0x30de45;})[_0xe318('0x22')](respondWithFilteredResult(_0x425ee8,_0x3d9dd4))[_0xe318('0x42')](handleError(_0x425ee8,null));};exports[_0xe318('0x43')]=function(_0x39506a,_0x5ec5ed){var _0x5e69b6={'raw':![],'where':{'id':_0x39506a['params']['id']}},_0x429b02={};_0x429b02[_0xe318('0x32')]=_[_0xe318('0x2f')](db[_0xe318('0x40')][_0xe318('0x2b')]);_0x429b02['query']=_['keys'](_0x39506a['query']);_0x429b02[_0xe318('0x30')]=_[_0xe318('0x31')](_0x429b02[_0xe318('0x32')],_0x429b02[_0xe318('0x2e')]);_0x5e69b6['attributes']=_[_0xe318('0x31')](_0x429b02[_0xe318('0x32')],qs['fields'](_0x39506a['query'][_0xe318('0x34')]));_0x5e69b6[_0xe318('0x33')]=_0x5e69b6['attributes'][_0xe318('0x35')]?_0x5e69b6[_0xe318('0x33')]:_0x429b02[_0xe318('0x32')];if(_0x39506a[_0xe318('0x2e')][_0xe318('0x3e')]){_0x5e69b6['include']=[{'all':!![]}];}_0x5e69b6=_[_0xe318('0x3a')]({},_0x5e69b6,_0x39506a[_0xe318('0x3d')]);return db[_0xe318('0x40')]['find'](_0x5e69b6)['then'](handleEntityNotFound(_0x5ec5ed,null))[_0xe318('0x22')](respondWithResult(_0x5ec5ed,null))[_0xe318('0x42')](handleError(_0x5ec5ed,null));};exports[_0xe318('0x44')]=function(_0x403484,_0x19d9a0){return db[_0xe318('0x40')][_0xe318('0x44')](_0x403484[_0xe318('0x45')],{})['then'](respondWithResult(_0x19d9a0,0xc9))[_0xe318('0x42')](handleError(_0x19d9a0,null));};exports[_0xe318('0x46')]=function(_0x1aef12,_0x42314f){if(_0x1aef12[_0xe318('0x45')]['id']){delete _0x1aef12[_0xe318('0x45')]['id'];}return db['ZohoConfiguration'][_0xe318('0x47')]({'where':{'id':_0x1aef12[_0xe318('0x48')]['id']}})['then'](handleEntityNotFound(_0x42314f,null))['then'](saveUpdates(_0x1aef12[_0xe318('0x45')],null))[_0xe318('0x22')](respondWithResult(_0x42314f,null))[_0xe318('0x42')](handleError(_0x42314f,null));};exports['destroy']=function(_0xb273f2,_0x5ab863){return db[_0xe318('0x40')][_0xe318('0x47')]({'where':{'id':_0xb273f2[_0xe318('0x48')]['id']}})['then'](handleEntityNotFound(_0x5ab863,null))[_0xe318('0x22')](removeEntity(_0x5ab863,null))[_0xe318('0x42')](handleError(_0x5ab863,null));};exports[_0xe318('0x49')]=function(_0x11e565,_0x559646,_0x18cb7e){var _0x56a03e={};var _0x39f761={};var _0xac8da1;var _0x502e11;return db[_0xe318('0x40')]['findOne']({'where':{'id':_0x11e565['params']['id']}})[_0xe318('0x22')](handleEntityNotFound(_0x559646,null))[_0xe318('0x22')](function(_0x82c9f2){if(_0x82c9f2){_0xac8da1=_0x82c9f2;_0x39f761[_0xe318('0x32')]=_[_0xe318('0x2f')](db[_0xe318('0x4a')]['rawAttributes']);_0x39f761['query']=_[_0xe318('0x2f')](_0x11e565[_0xe318('0x2e')]);_0x39f761['filters']=_[_0xe318('0x31')](_0x39f761[_0xe318('0x32')],_0x39f761['query']);_0x56a03e[_0xe318('0x33')]=_[_0xe318('0x31')](_0x39f761[_0xe318('0x32')],qs[_0xe318('0x34')](_0x11e565[_0xe318('0x2e')][_0xe318('0x34')]));_0x56a03e['attributes']=_0x56a03e[_0xe318('0x33')][_0xe318('0x35')]?_0x56a03e['attributes']:_0x39f761['model'];_0x56a03e['order']=qs['sort'](_0x11e565['query'][_0xe318('0x38')]);_0x56a03e['where']=qs[_0xe318('0x30')](_[_0xe318('0x4b')](_0x11e565[_0xe318('0x2e')],_0x39f761[_0xe318('0x30')]));if(_0x11e565[_0xe318('0x2e')][_0xe318('0x3c')]){_0x56a03e[_0xe318('0x39')]=_[_0xe318('0x3a')](_0x56a03e[_0xe318('0x39')],{'$or':_[_0xe318('0x2a')](_0x56a03e[_0xe318('0x33')],function(_0x46de77){var _0x458fcb={};_0x458fcb[_0x46de77]={'$like':'%'+_0x11e565['query'][_0xe318('0x3c')]+'%'};return _0x458fcb;})});}_0x56a03e=_['merge']({},_0x56a03e,_0x11e565[_0xe318('0x3d')]);return _0xac8da1[_0xe318('0x49')](_0x56a03e);}})[_0xe318('0x22')](function(_0x14b19b){if(_0x14b19b){_0x502e11=_0x14b19b['length'];if(!_0x11e565[_0xe318('0x2e')]['hasOwnProperty'](_0xe318('0x4c'))){_0x56a03e[_0xe318('0x1a')]=qs[_0xe318('0x1a')](_0x11e565['query'][_0xe318('0x1a')]);_0x56a03e[_0xe318('0x1d')]=qs[_0xe318('0x1d')](_0x11e565[_0xe318('0x2e')]['offset']);}return _0xac8da1[_0xe318('0x49')](_0x56a03e);}})[_0xe318('0x22')](function(_0x1ed6c1){if(_0x1ed6c1){return _0x1ed6c1?{'count':_0x502e11,'rows':_0x1ed6c1}:null;}})[_0xe318('0x22')](respondWithResult(_0x559646,null))[_0xe318('0x42')](handleError(_0x559646,null));};exports[_0xe318('0x4d')]=function(_0x2b3c02,_0x18f92e,_0x4da71b){var _0x30a096={};var _0x5b337c={};var _0x3e7ec9;var _0x54f21e;return db[_0xe318('0x40')][_0xe318('0x4e')]({'where':{'id':_0x2b3c02[_0xe318('0x48')]['id']}})[_0xe318('0x22')](handleEntityNotFound(_0x18f92e,null))[_0xe318('0x22')](function(_0x32ec81){if(_0x32ec81){_0x3e7ec9=_0x32ec81;_0x5b337c[_0xe318('0x32')]=_[_0xe318('0x2f')](db[_0xe318('0x4a')][_0xe318('0x2b')]);_0x5b337c[_0xe318('0x2e')]=_['keys'](_0x2b3c02[_0xe318('0x2e')]);_0x5b337c[_0xe318('0x30')]=_['intersection'](_0x5b337c[_0xe318('0x32')],_0x5b337c[_0xe318('0x2e')]);_0x30a096[_0xe318('0x33')]=_[_0xe318('0x31')](_0x5b337c[_0xe318('0x32')],qs[_0xe318('0x34')](_0x2b3c02[_0xe318('0x2e')]['fields']));_0x30a096[_0xe318('0x33')]=_0x30a096[_0xe318('0x33')][_0xe318('0x35')]?_0x30a096[_0xe318('0x33')]:_0x5b337c[_0xe318('0x32')];_0x30a096[_0xe318('0x37')]=qs['sort'](_0x2b3c02[_0xe318('0x2e')][_0xe318('0x38')]);_0x30a096[_0xe318('0x39')]=qs['filters'](_[_0xe318('0x4b')](_0x2b3c02[_0xe318('0x2e')],_0x5b337c['filters']));if(_0x2b3c02[_0xe318('0x2e')][_0xe318('0x3c')]){_0x30a096[_0xe318('0x39')]=_['merge'](_0x30a096[_0xe318('0x39')],{'$or':_['map'](_0x30a096[_0xe318('0x33')],function(_0x361a5c){var _0x34d7eb={};_0x34d7eb[_0x361a5c]={'$like':'%'+_0x2b3c02[_0xe318('0x2e')][_0xe318('0x3c')]+'%'};return _0x34d7eb;})});}_0x30a096=_['merge']({},_0x30a096,_0x2b3c02[_0xe318('0x3d')]);return _0x3e7ec9[_0xe318('0x4d')](_0x30a096);}})[_0xe318('0x22')](function(_0x27fc1c){if(_0x27fc1c){_0x54f21e=_0x27fc1c['length'];if(!_0x2b3c02[_0xe318('0x2e')][_0xe318('0x36')](_0xe318('0x4c'))){_0x30a096[_0xe318('0x1a')]=qs['limit'](_0x2b3c02[_0xe318('0x2e')]['limit']);_0x30a096[_0xe318('0x1d')]=qs['offset'](_0x2b3c02[_0xe318('0x2e')][_0xe318('0x1d')]);}return _0x3e7ec9[_0xe318('0x4d')](_0x30a096);}})[_0xe318('0x22')](function(_0x174b61){if(_0x174b61){return _0x174b61?{'count':_0x54f21e,'rows':_0x174b61}:null;}})[_0xe318('0x22')](respondWithResult(_0x18f92e,null))['catch'](handleError(_0x18f92e,null));};exports[_0xe318('0x4f')]=function(_0x1f9c4b,_0x4da256,_0x16d09d){var _0x16b0a2={};var _0x280ca2={};var _0xee2289;var _0x1ad81b;return db[_0xe318('0x40')][_0xe318('0x4e')]({'where':{'id':_0x1f9c4b[_0xe318('0x48')]['id']}})[_0xe318('0x22')](handleEntityNotFound(_0x4da256,null))[_0xe318('0x22')](function(_0x49f4e6){if(_0x49f4e6){_0xee2289=_0x49f4e6;_0x280ca2[_0xe318('0x32')]=_[_0xe318('0x2f')](db[_0xe318('0x4a')][_0xe318('0x2b')]);_0x280ca2[_0xe318('0x2e')]=_[_0xe318('0x2f')](_0x1f9c4b[_0xe318('0x2e')]);_0x280ca2[_0xe318('0x30')]=_[_0xe318('0x31')](_0x280ca2[_0xe318('0x32')],_0x280ca2[_0xe318('0x2e')]);_0x16b0a2[_0xe318('0x33')]=_[_0xe318('0x31')](_0x280ca2[_0xe318('0x32')],qs[_0xe318('0x34')](_0x1f9c4b[_0xe318('0x2e')][_0xe318('0x34')]));_0x16b0a2[_0xe318('0x33')]=_0x16b0a2[_0xe318('0x33')][_0xe318('0x35')]?_0x16b0a2[_0xe318('0x33')]:_0x280ca2['model'];_0x16b0a2[_0xe318('0x37')]=qs['sort'](_0x1f9c4b[_0xe318('0x2e')][_0xe318('0x38')]);_0x16b0a2[_0xe318('0x39')]=qs[_0xe318('0x30')](_[_0xe318('0x4b')](_0x1f9c4b['query'],_0x280ca2[_0xe318('0x30')]));if(_0x1f9c4b[_0xe318('0x2e')][_0xe318('0x3c')]){_0x16b0a2['where']=_[_0xe318('0x3a')](_0x16b0a2[_0xe318('0x39')],{'$or':_[_0xe318('0x2a')](_0x16b0a2[_0xe318('0x33')],function(_0x19f8b2){var _0x67e0ea={};_0x67e0ea[_0x19f8b2]={'$like':'%'+_0x1f9c4b[_0xe318('0x2e')][_0xe318('0x3c')]+'%'};return _0x67e0ea;})});}_0x16b0a2=_[_0xe318('0x3a')]({},_0x16b0a2,_0x1f9c4b['options']);return _0xee2289[_0xe318('0x4f')](_0x16b0a2);}})['then'](function(_0x2ba23f){if(_0x2ba23f){_0x1ad81b=_0x2ba23f['length'];if(!_0x1f9c4b[_0xe318('0x2e')][_0xe318('0x36')](_0xe318('0x4c'))){_0x16b0a2[_0xe318('0x1a')]=qs['limit'](_0x1f9c4b[_0xe318('0x2e')]['limit']);_0x16b0a2['offset']=qs[_0xe318('0x1d')](_0x1f9c4b[_0xe318('0x2e')]['offset']);}return _0xee2289[_0xe318('0x4f')](_0x16b0a2);}})[_0xe318('0x22')](function(_0x178ad8){if(_0x178ad8){return _0x178ad8?{'count':_0x1ad81b,'rows':_0x178ad8}:null;}})[_0xe318('0x22')](respondWithResult(_0x4da256,null))[_0xe318('0x42')](handleError(_0x4da256,null));}; \ No newline at end of file +var _0xc80a=['util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','name','send','index','map','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','ZohoConfiguration','include','show','params','includeAll','find','catch','create','body','destroy','getFields','findOne','ZohoField','hasOwnProperty','getSubjects','getDescriptions','eml-format','fast-json-patch','request-promise','moment','mustache'];(function(_0xd02bb,_0x26e2d0){var _0x1cdf23=function(_0x18fd05){while(--_0x18fd05){_0xd02bb['push'](_0xd02bb['shift']());}};_0x1cdf23(++_0x26e2d0);}(_0xc80a,0x190));var _0xac80=function(_0x31ccca,_0x514be9){_0x31ccca=_0x31ccca-0x0;var _0x52dde1=_0xc80a[_0x31ccca];return _0x52dde1;};'use strict';var emlformat=require(_0xac80('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xac80('0x1'));var rp=require(_0xac80('0x2'));var moment=require(_0xac80('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xac80('0x4'));var util=require(_0xac80('0x5'));var path=require(_0xac80('0x6'));var sox=require(_0xac80('0x7'));var csv=require(_0xac80('0x8'));var ejs=require(_0xac80('0x9'));var fs=require('fs');var fs_extra=require(_0xac80('0xa'));var _=require('lodash');var squel=require(_0xac80('0xb'));var crypto=require(_0xac80('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xac80('0xd'));var toCsv=require(_0xac80('0x8'));var querystring=require(_0xac80('0xe'));var Papa=require('papaparse');var Redis=require(_0xac80('0xf'));var authService=require(_0xac80('0x10'));var qs=require(_0xac80('0x11'));var as=require(_0xac80('0x12'));var hardwareService=require(_0xac80('0x13'));var logger=require(_0xac80('0x14'))(_0xac80('0x15'));var utils=require(_0xac80('0x16'));var config=require(_0xac80('0x17'));var licenseUtil=require(_0xac80('0x18'));var db=require(_0xac80('0x19'))['db'];function respondWithStatusCode(_0x153812,_0x11e6a8){_0x11e6a8=_0x11e6a8||0xcc;return function(_0x3cf226){if(_0x3cf226){return _0x153812[_0xac80('0x1a')](_0x11e6a8);}return _0x153812[_0xac80('0x1b')](_0x11e6a8)[_0xac80('0x1c')]();};}function respondWithResult(_0x4af9e0,_0x28fff6){_0x28fff6=_0x28fff6||0xc8;return function(_0x7d721c){if(_0x7d721c){return _0x4af9e0[_0xac80('0x1b')](_0x28fff6)[_0xac80('0x1d')](_0x7d721c);}};}function respondWithFilteredResult(_0x261981,_0x472575){return function(_0xf709bb){if(_0xf709bb){var _0x59acbe=typeof _0x472575[_0xac80('0x1e')]===_0xac80('0x1f')&&typeof _0x472575[_0xac80('0x20')]===_0xac80('0x1f');var _0x3fba5c=_0xf709bb[_0xac80('0x21')];var _0x1366c0=_0x59acbe?0x0:_0x472575['offset'];var _0x1afea5=_0x59acbe?_0xf709bb[_0xac80('0x21')]:_0x472575[_0xac80('0x1e')]+_0x472575[_0xac80('0x20')];var _0x5a3fa6;if(_0x1afea5>=_0x3fba5c){_0x1afea5=_0x3fba5c;_0x5a3fa6=0xc8;}else{_0x5a3fa6=0xce;}_0x261981[_0xac80('0x1b')](_0x5a3fa6);return _0x261981[_0xac80('0x22')](_0xac80('0x23'),_0x1366c0+'-'+_0x1afea5+'/'+_0x3fba5c)['json'](_0xf709bb);}return null;};}function patchUpdates(_0x1c522d){return function(_0x3136e6){try{jsonpatch[_0xac80('0x24')](_0x3136e6,_0x1c522d,!![]);}catch(_0x288023){return BPromise[_0xac80('0x25')](_0x288023);}return _0x3136e6[_0xac80('0x26')]();};}function saveUpdates(_0x4315e1,_0x384979){return function(_0x5ae024){if(_0x5ae024){return _0x5ae024[_0xac80('0x27')](_0x4315e1)['then'](function(_0x5af18d){return _0x5af18d;});}return null;};}function removeEntity(_0x48dbd9,_0x485b12){return function(_0x177b6c){if(_0x177b6c){return _0x177b6c['destroy']()[_0xac80('0x28')](function(){_0x48dbd9['status'](0xcc)[_0xac80('0x1c')]();});}};}function handleEntityNotFound(_0x14ac7a,_0x11b5c6){return function(_0x4973b4){if(!_0x4973b4){_0x14ac7a[_0xac80('0x1a')](0x194);}return _0x4973b4;};}function handleError(_0x2eca1c,_0x23594){_0x23594=_0x23594||0x1f4;return function(_0x5b5c33){logger[_0xac80('0x29')](_0x5b5c33['stack']);if(_0x5b5c33[_0xac80('0x2a')]){delete _0x5b5c33[_0xac80('0x2a')];}_0x2eca1c[_0xac80('0x1b')](_0x23594)[_0xac80('0x2b')](_0x5b5c33);};}exports[_0xac80('0x2c')]=function(_0x86c84c,_0x4175b8){var _0x2821d8={},_0x561035={},_0x2866b1={'count':0x0,'rows':[]};var _0x512f4f=_[_0xac80('0x2d')](db['ZohoConfiguration'][_0xac80('0x2e')],function(_0xd96251){return{'name':_0xd96251['fieldName'],'type':_0xd96251[_0xac80('0x2f')][_0xac80('0x30')]};});_0x561035[_0xac80('0x31')]=_[_0xac80('0x2d')](_0x512f4f,_0xac80('0x2a'));_0x561035['query']=_[_0xac80('0x32')](_0x86c84c[_0xac80('0x33')]);_0x561035[_0xac80('0x34')]=_[_0xac80('0x35')](_0x561035[_0xac80('0x31')],_0x561035[_0xac80('0x33')]);_0x2821d8[_0xac80('0x36')]=_[_0xac80('0x35')](_0x561035[_0xac80('0x31')],qs[_0xac80('0x37')](_0x86c84c[_0xac80('0x33')]['fields']));_0x2821d8[_0xac80('0x36')]=_0x2821d8[_0xac80('0x36')][_0xac80('0x38')]?_0x2821d8['attributes']:_0x561035[_0xac80('0x31')];if(!_0x86c84c[_0xac80('0x33')]['hasOwnProperty'](_0xac80('0x39'))){_0x2821d8[_0xac80('0x20')]=qs[_0xac80('0x20')](_0x86c84c[_0xac80('0x33')][_0xac80('0x20')]);_0x2821d8[_0xac80('0x1e')]=qs[_0xac80('0x1e')](_0x86c84c[_0xac80('0x33')][_0xac80('0x1e')]);}_0x2821d8['order']=qs[_0xac80('0x3a')](_0x86c84c[_0xac80('0x33')][_0xac80('0x3a')]);_0x2821d8[_0xac80('0x3b')]=qs['filters'](_[_0xac80('0x3c')](_0x86c84c[_0xac80('0x33')],_0x561035[_0xac80('0x34')]),_0x512f4f);if(_0x86c84c[_0xac80('0x33')][_0xac80('0x3d')]){_0x2821d8[_0xac80('0x3b')]=_[_0xac80('0x3e')](_0x2821d8['where'],{'$or':_['map'](_0x512f4f,function(_0x13932e){if(_0x13932e['type']!==_0xac80('0x3f')){var _0x56e8ed={};_0x56e8ed[_0x13932e['name']]={'$like':'%'+_0x86c84c[_0xac80('0x33')][_0xac80('0x3d')]+'%'};return _0x56e8ed;}})});}_0x2821d8=_['merge']({},_0x2821d8,_0x86c84c[_0xac80('0x40')]);var _0x16a06d={'where':_0x2821d8['where']};return db[_0xac80('0x41')]['count'](_0x16a06d)[_0xac80('0x28')](function(_0x475c85){_0x2866b1['count']=_0x475c85;if(_0x86c84c[_0xac80('0x33')]['includeAll']){_0x2821d8[_0xac80('0x42')]=[{'all':!![]}];}return db['ZohoConfiguration']['findAll'](_0x2821d8);})[_0xac80('0x28')](function(_0x47397c){_0x2866b1['rows']=_0x47397c;return _0x2866b1;})['then'](respondWithFilteredResult(_0x4175b8,_0x2821d8))['catch'](handleError(_0x4175b8,null));};exports[_0xac80('0x43')]=function(_0x59b5c4,_0x33f207){var _0x434c2e={'raw':![],'where':{'id':_0x59b5c4[_0xac80('0x44')]['id']}},_0x4761bb={};_0x4761bb[_0xac80('0x31')]=_[_0xac80('0x32')](db[_0xac80('0x41')]['rawAttributes']);_0x4761bb[_0xac80('0x33')]=_[_0xac80('0x32')](_0x59b5c4[_0xac80('0x33')]);_0x4761bb[_0xac80('0x34')]=_[_0xac80('0x35')](_0x4761bb[_0xac80('0x31')],_0x4761bb[_0xac80('0x33')]);_0x434c2e[_0xac80('0x36')]=_[_0xac80('0x35')](_0x4761bb[_0xac80('0x31')],qs[_0xac80('0x37')](_0x59b5c4[_0xac80('0x33')]['fields']));_0x434c2e[_0xac80('0x36')]=_0x434c2e[_0xac80('0x36')]['length']?_0x434c2e[_0xac80('0x36')]:_0x4761bb[_0xac80('0x31')];if(_0x59b5c4[_0xac80('0x33')][_0xac80('0x45')]){_0x434c2e[_0xac80('0x42')]=[{'all':!![]}];}_0x434c2e=_['merge']({},_0x434c2e,_0x59b5c4[_0xac80('0x40')]);return db[_0xac80('0x41')][_0xac80('0x46')](_0x434c2e)[_0xac80('0x28')](handleEntityNotFound(_0x33f207,null))[_0xac80('0x28')](respondWithResult(_0x33f207,null))[_0xac80('0x47')](handleError(_0x33f207,null));};exports['create']=function(_0x56116d,_0x472c37){return db[_0xac80('0x41')][_0xac80('0x48')](_0x56116d[_0xac80('0x49')],{})['then'](respondWithResult(_0x472c37,0xc9))['catch'](handleError(_0x472c37,null));};exports[_0xac80('0x27')]=function(_0x2c6565,_0x31f8e3){if(_0x2c6565[_0xac80('0x49')]['id']){delete _0x2c6565[_0xac80('0x49')]['id'];}return db[_0xac80('0x41')][_0xac80('0x46')]({'where':{'id':_0x2c6565[_0xac80('0x44')]['id']}})[_0xac80('0x28')](handleEntityNotFound(_0x31f8e3,null))[_0xac80('0x28')](saveUpdates(_0x2c6565[_0xac80('0x49')],null))[_0xac80('0x28')](respondWithResult(_0x31f8e3,null))[_0xac80('0x47')](handleError(_0x31f8e3,null));};exports[_0xac80('0x4a')]=function(_0x576289,_0xd4d253){return db[_0xac80('0x41')][_0xac80('0x46')]({'where':{'id':_0x576289[_0xac80('0x44')]['id']}})['then'](handleEntityNotFound(_0xd4d253,null))[_0xac80('0x28')](removeEntity(_0xd4d253,null))[_0xac80('0x47')](handleError(_0xd4d253,null));};exports[_0xac80('0x4b')]=function(_0x3c851e,_0x5e4bfd,_0x5a4df5){var _0x2a2824={};var _0x5421dd={};var _0x59adbe;var _0x12612c;return db[_0xac80('0x41')][_0xac80('0x4c')]({'where':{'id':_0x3c851e['params']['id']}})['then'](handleEntityNotFound(_0x5e4bfd,null))[_0xac80('0x28')](function(_0x9ae505){if(_0x9ae505){_0x59adbe=_0x9ae505;_0x5421dd[_0xac80('0x31')]=_['keys'](db[_0xac80('0x4d')]['rawAttributes']);_0x5421dd[_0xac80('0x33')]=_['keys'](_0x3c851e[_0xac80('0x33')]);_0x5421dd[_0xac80('0x34')]=_[_0xac80('0x35')](_0x5421dd[_0xac80('0x31')],_0x5421dd[_0xac80('0x33')]);_0x2a2824[_0xac80('0x36')]=_[_0xac80('0x35')](_0x5421dd['model'],qs['fields'](_0x3c851e[_0xac80('0x33')][_0xac80('0x37')]));_0x2a2824[_0xac80('0x36')]=_0x2a2824[_0xac80('0x36')][_0xac80('0x38')]?_0x2a2824[_0xac80('0x36')]:_0x5421dd[_0xac80('0x31')];_0x2a2824['order']=qs['sort'](_0x3c851e[_0xac80('0x33')][_0xac80('0x3a')]);_0x2a2824['where']=qs['filters'](_[_0xac80('0x3c')](_0x3c851e['query'],_0x5421dd[_0xac80('0x34')]));if(_0x3c851e[_0xac80('0x33')]['filter']){_0x2a2824[_0xac80('0x3b')]=_[_0xac80('0x3e')](_0x2a2824[_0xac80('0x3b')],{'$or':_[_0xac80('0x2d')](_0x2a2824[_0xac80('0x36')],function(_0x344407){var _0xdaf7fa={};_0xdaf7fa[_0x344407]={'$like':'%'+_0x3c851e[_0xac80('0x33')][_0xac80('0x3d')]+'%'};return _0xdaf7fa;})});}_0x2a2824=_[_0xac80('0x3e')]({},_0x2a2824,_0x3c851e[_0xac80('0x40')]);return _0x59adbe[_0xac80('0x4b')](_0x2a2824);}})['then'](function(_0x114ee1){if(_0x114ee1){_0x12612c=_0x114ee1[_0xac80('0x38')];if(!_0x3c851e[_0xac80('0x33')][_0xac80('0x4e')](_0xac80('0x39'))){_0x2a2824[_0xac80('0x20')]=qs[_0xac80('0x20')](_0x3c851e[_0xac80('0x33')]['limit']);_0x2a2824[_0xac80('0x1e')]=qs[_0xac80('0x1e')](_0x3c851e[_0xac80('0x33')][_0xac80('0x1e')]);}return _0x59adbe[_0xac80('0x4b')](_0x2a2824);}})['then'](function(_0x8aa2ca){if(_0x8aa2ca){return _0x8aa2ca?{'count':_0x12612c,'rows':_0x8aa2ca}:null;}})[_0xac80('0x28')](respondWithResult(_0x5e4bfd,null))[_0xac80('0x47')](handleError(_0x5e4bfd,null));};exports[_0xac80('0x4f')]=function(_0x1362a3,_0x347fa5,_0x8ddd16){var _0x5eea62={};var _0x2699dc={};var _0x38b1fc;var _0x5e27e4;return db[_0xac80('0x41')][_0xac80('0x4c')]({'where':{'id':_0x1362a3[_0xac80('0x44')]['id']}})[_0xac80('0x28')](handleEntityNotFound(_0x347fa5,null))['then'](function(_0x4f6b4d){if(_0x4f6b4d){_0x38b1fc=_0x4f6b4d;_0x2699dc[_0xac80('0x31')]=_[_0xac80('0x32')](db[_0xac80('0x4d')][_0xac80('0x2e')]);_0x2699dc[_0xac80('0x33')]=_[_0xac80('0x32')](_0x1362a3[_0xac80('0x33')]);_0x2699dc[_0xac80('0x34')]=_[_0xac80('0x35')](_0x2699dc[_0xac80('0x31')],_0x2699dc[_0xac80('0x33')]);_0x5eea62[_0xac80('0x36')]=_['intersection'](_0x2699dc[_0xac80('0x31')],qs[_0xac80('0x37')](_0x1362a3['query']['fields']));_0x5eea62[_0xac80('0x36')]=_0x5eea62[_0xac80('0x36')][_0xac80('0x38')]?_0x5eea62[_0xac80('0x36')]:_0x2699dc['model'];_0x5eea62['order']=qs[_0xac80('0x3a')](_0x1362a3[_0xac80('0x33')][_0xac80('0x3a')]);_0x5eea62[_0xac80('0x3b')]=qs['filters'](_[_0xac80('0x3c')](_0x1362a3['query'],_0x2699dc['filters']));if(_0x1362a3[_0xac80('0x33')]['filter']){_0x5eea62[_0xac80('0x3b')]=_[_0xac80('0x3e')](_0x5eea62['where'],{'$or':_['map'](_0x5eea62[_0xac80('0x36')],function(_0x5288e2){var _0x42bc29={};_0x42bc29[_0x5288e2]={'$like':'%'+_0x1362a3[_0xac80('0x33')][_0xac80('0x3d')]+'%'};return _0x42bc29;})});}_0x5eea62=_[_0xac80('0x3e')]({},_0x5eea62,_0x1362a3[_0xac80('0x40')]);return _0x38b1fc[_0xac80('0x4f')](_0x5eea62);}})[_0xac80('0x28')](function(_0x22a6b2){if(_0x22a6b2){_0x5e27e4=_0x22a6b2[_0xac80('0x38')];if(!_0x1362a3[_0xac80('0x33')][_0xac80('0x4e')](_0xac80('0x39'))){_0x5eea62[_0xac80('0x20')]=qs[_0xac80('0x20')](_0x1362a3[_0xac80('0x33')][_0xac80('0x20')]);_0x5eea62[_0xac80('0x1e')]=qs[_0xac80('0x1e')](_0x1362a3[_0xac80('0x33')][_0xac80('0x1e')]);}return _0x38b1fc[_0xac80('0x4f')](_0x5eea62);}})[_0xac80('0x28')](function(_0x1af108){if(_0x1af108){return _0x1af108?{'count':_0x5e27e4,'rows':_0x1af108}:null;}})[_0xac80('0x28')](respondWithResult(_0x347fa5,null))[_0xac80('0x47')](handleError(_0x347fa5,null));};exports[_0xac80('0x50')]=function(_0x7c1f9c,_0x346224,_0x220f0d){var _0x2f770c={};var _0x13f862={};var _0x4f3c4a;var _0x5c482e;return db['ZohoConfiguration'][_0xac80('0x4c')]({'where':{'id':_0x7c1f9c[_0xac80('0x44')]['id']}})[_0xac80('0x28')](handleEntityNotFound(_0x346224,null))['then'](function(_0x4787f1){if(_0x4787f1){_0x4f3c4a=_0x4787f1;_0x13f862['model']=_[_0xac80('0x32')](db[_0xac80('0x4d')]['rawAttributes']);_0x13f862[_0xac80('0x33')]=_[_0xac80('0x32')](_0x7c1f9c[_0xac80('0x33')]);_0x13f862[_0xac80('0x34')]=_[_0xac80('0x35')](_0x13f862[_0xac80('0x31')],_0x13f862[_0xac80('0x33')]);_0x2f770c[_0xac80('0x36')]=_[_0xac80('0x35')](_0x13f862[_0xac80('0x31')],qs[_0xac80('0x37')](_0x7c1f9c[_0xac80('0x33')]['fields']));_0x2f770c[_0xac80('0x36')]=_0x2f770c[_0xac80('0x36')][_0xac80('0x38')]?_0x2f770c[_0xac80('0x36')]:_0x13f862[_0xac80('0x31')];_0x2f770c['order']=qs[_0xac80('0x3a')](_0x7c1f9c[_0xac80('0x33')]['sort']);_0x2f770c[_0xac80('0x3b')]=qs['filters'](_[_0xac80('0x3c')](_0x7c1f9c['query'],_0x13f862[_0xac80('0x34')]));if(_0x7c1f9c['query'][_0xac80('0x3d')]){_0x2f770c[_0xac80('0x3b')]=_['merge'](_0x2f770c[_0xac80('0x3b')],{'$or':_[_0xac80('0x2d')](_0x2f770c[_0xac80('0x36')],function(_0x39647c){var _0x45b22d={};_0x45b22d[_0x39647c]={'$like':'%'+_0x7c1f9c[_0xac80('0x33')][_0xac80('0x3d')]+'%'};return _0x45b22d;})});}_0x2f770c=_[_0xac80('0x3e')]({},_0x2f770c,_0x7c1f9c[_0xac80('0x40')]);return _0x4f3c4a[_0xac80('0x50')](_0x2f770c);}})[_0xac80('0x28')](function(_0x303bcf){if(_0x303bcf){_0x5c482e=_0x303bcf['length'];if(!_0x7c1f9c[_0xac80('0x33')]['hasOwnProperty'](_0xac80('0x39'))){_0x2f770c['limit']=qs['limit'](_0x7c1f9c[_0xac80('0x33')][_0xac80('0x20')]);_0x2f770c[_0xac80('0x1e')]=qs[_0xac80('0x1e')](_0x7c1f9c[_0xac80('0x33')][_0xac80('0x1e')]);}return _0x4f3c4a[_0xac80('0x50')](_0x2f770c);}})[_0xac80('0x28')](function(_0x3fd3b8){if(_0x3fd3b8){return _0x3fd3b8?{'count':_0x5c482e,'rows':_0x3fd3b8}:null;}})[_0xac80('0x28')](respondWithResult(_0x346224,null))['catch'](handleError(_0x346224,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index 659963c..f850c12 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 _0xcd47=['path','rimraf','../../config/environment','./intZohoConfiguration.attributes','exports','define','ZohoConfiguration','int_zoho_configurations','util','api','moment','bluebird','request-promise'];(function(_0x2745a7,_0x3f7774){var _0x310459=function(_0x5b875f){while(--_0x5b875f){_0x2745a7['push'](_0x2745a7['shift']());}};_0x310459(++_0x3f7774);}(_0xcd47,0x7d));var _0x7cd4=function(_0x1610a9,_0x12b812){_0x1610a9=_0x1610a9-0x0;var _0x33a66e=_0xcd47[_0x1610a9];return _0x33a66e;};'use strict';var _=require('lodash');var util=require(_0x7cd4('0x0'));var logger=require('../../config/logger')(_0x7cd4('0x1'));var moment=require(_0x7cd4('0x2'));var BPromise=require(_0x7cd4('0x3'));var rp=require(_0x7cd4('0x4'));var fs=require('fs');var path=require(_0x7cd4('0x5'));var rimraf=require(_0x7cd4('0x6'));var config=require(_0x7cd4('0x7'));var attributes=require(_0x7cd4('0x8'));module[_0x7cd4('0x9')]=function(_0xd2479d,_0x300823){return _0xd2479d[_0x7cd4('0xa')](_0x7cd4('0xb'),attributes,{'tableName':_0x7cd4('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x283f=['int_zoho_configurations','util','../../config/logger','api','bluebird','request-promise','../../config/environment','./intZohoConfiguration.attributes','exports','define'];(function(_0x570e02,_0x22ba0d){var _0x1015f9=function(_0x3027ea){while(--_0x3027ea){_0x570e02['push'](_0x570e02['shift']());}};_0x1015f9(++_0x22ba0d);}(_0x283f,0x65));var _0xf283=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x283f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xf283('0x0'));var logger=require(_0xf283('0x1'))(_0xf283('0x2'));var moment=require('moment');var BPromise=require(_0xf283('0x3'));var rp=require(_0xf283('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xf283('0x5'));var attributes=require(_0xf283('0x6'));module[_0xf283('0x7')]=function(_0x334989,_0x475f05){return _0x334989[_0xf283('0x8')]('ZohoConfiguration',attributes,{'tableName':_0xf283('0x9'),'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 8f08979..04e1f01 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 _0x68b5=['debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x68b5,0x130));var _0x568b=function(_0xe1ded3,_0x1544ad){_0xe1ded3=_0xe1ded3-0x0;var _0xd51ced=_0x68b5[_0xe1ded3];return _0xd51ced;};'use strict';var _=require(_0x568b('0x0'));var util=require(_0x568b('0x1'));var moment=require(_0x568b('0x2'));var BPromise=require('bluebird');var rs=require(_0x568b('0x3'));var fs=require('fs');var Redis=require(_0x568b('0x4'));var db=require(_0x568b('0x5'))['db'];var utils=require(_0x568b('0x6'));var logger=require(_0x568b('0x7'))(_0x568b('0x8'));var config=require(_0x568b('0x9'));var jayson=require(_0x568b('0xa'));var client=jayson[_0x568b('0xb')][_0x568b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x10bd76,_0x32e0b1,_0xcdcb6f){return new BPromise(function(_0x5108d8,_0x5da4c2){return client[_0x568b('0xd')](_0x10bd76,_0xcdcb6f)[_0x568b('0xe')](function(_0x2f5926){logger[_0x568b('0xf')](_0x568b('0x10'),_0x32e0b1,_0x568b('0x11'));logger[_0x568b('0x12')](_0x568b('0x13'),_0x32e0b1,_0x568b('0x11'),JSON['stringify'](_0x2f5926));if(_0x2f5926[_0x568b('0x14')]){if(_0x2f5926[_0x568b('0x14')]['code']===0x1f4){logger[_0x568b('0x14')](_0x568b('0x10'),_0x32e0b1,_0x2f5926[_0x568b('0x14')][_0x568b('0x15')]);return _0x5da4c2(_0x2f5926[_0x568b('0x14')][_0x568b('0x15')]);}logger[_0x568b('0x14')]('ZohoConfiguration,\x20%s,\x20%s',_0x32e0b1,_0x2f5926[_0x568b('0x14')]['message']);return _0x5108d8(_0x2f5926[_0x568b('0x14')][_0x568b('0x15')]);}else{logger[_0x568b('0xf')](_0x568b('0x10'),_0x32e0b1,_0x568b('0x11'));_0x5108d8(_0x2f5926['result']['message']);}})[_0x568b('0x16')](function(_0x476753){logger['error'](_0x568b('0x10'),_0x32e0b1,_0x476753);_0x5da4c2(_0x476753);});});} \ No newline at end of file +var _0x6bc0=['../../config/utils','../../config/logger','rpc','then','info','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','ZohoConfiguration,\x20%s,\x20%s','message','request\x20sent','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x5237b7,_0x1ec127){var _0x8e7cf5=function(_0x5f16e5){while(--_0x5f16e5){_0x5237b7['push'](_0x5237b7['shift']());}};_0x8e7cf5(++_0x1ec127);}(_0x6bc0,0x120));var _0x06bc=function(_0x128623,_0x2a0aa7){_0x128623=_0x128623-0x0;var _0x3e3be1=_0x6bc0[_0x128623];return _0x3e3be1;};'use strict';var _=require(_0x06bc('0x0'));var util=require(_0x06bc('0x1'));var moment=require(_0x06bc('0x2'));var BPromise=require(_0x06bc('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x06bc('0x4'));var db=require(_0x06bc('0x5'))['db'];var utils=require(_0x06bc('0x6'));var logger=require(_0x06bc('0x7'))(_0x06bc('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x44d96e,_0x26cb93,_0x44995e){return new BPromise(function(_0x4cd029,_0x5ae02e){return client['request'](_0x44d96e,_0x44995e)[_0x06bc('0x9')](function(_0x2dd4b2){logger[_0x06bc('0xa')]('ZohoConfiguration,\x20%s,\x20%s',_0x26cb93,'request\x20sent');logger[_0x06bc('0xb')](_0x06bc('0xc'),_0x26cb93,'request\x20sent',JSON[_0x06bc('0xd')](_0x2dd4b2));if(_0x2dd4b2[_0x06bc('0xe')]){if(_0x2dd4b2[_0x06bc('0xe')][_0x06bc('0xf')]===0x1f4){logger[_0x06bc('0xe')](_0x06bc('0x10'),_0x26cb93,_0x2dd4b2[_0x06bc('0xe')][_0x06bc('0x11')]);return _0x5ae02e(_0x2dd4b2[_0x06bc('0xe')][_0x06bc('0x11')]);}logger[_0x06bc('0xe')](_0x06bc('0x10'),_0x26cb93,_0x2dd4b2[_0x06bc('0xe')][_0x06bc('0x11')]);return _0x4cd029(_0x2dd4b2[_0x06bc('0xe')][_0x06bc('0x11')]);}else{logger[_0x06bc('0xa')]('ZohoConfiguration,\x20%s,\x20%s',_0x26cb93,_0x06bc('0x12'));_0x4cd029(_0x2dd4b2[_0x06bc('0x13')][_0x06bc('0x11')]);}})[_0x06bc('0x14')](function(_0x5657e7){logger[_0x06bc('0xe')](_0x06bc('0x10'),_0x26cb93,_0x5657e7);_0x5ae02e(_0x5657e7);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index 6aa92fe..e318aef 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 _0x6d7a=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intZohoField.controller','get','index','isAuthenticated','show','post','create','/:id','update','destroy','exports','util','path'];(function(_0x466c69,_0x3e0106){var _0x25b2c9=function(_0x2112d3){while(--_0x2112d3){_0x466c69['push'](_0x466c69['shift']());}};_0x25b2c9(++_0x3e0106);}(_0x6d7a,0x70));var _0xa6d7=function(_0x4b4756,_0x4fbd44){_0x4b4756=_0x4b4756-0x0;var _0x3bce27=_0x6d7a[_0x4b4756];return _0x3bce27;};'use strict';var multer=require('multer');var util=require(_0xa6d7('0x0'));var path=require(_0xa6d7('0x1'));var timeout=require(_0xa6d7('0x2'));var express=require(_0xa6d7('0x3'));var router=express[_0xa6d7('0x4')]();var fs_extra=require(_0xa6d7('0x5'));var auth=require(_0xa6d7('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xa6d7('0x7'));var controller=require(_0xa6d7('0x8'));router[_0xa6d7('0x9')]('/',auth['isAuthenticated'](),controller[_0xa6d7('0xa')]);router[_0xa6d7('0x9')]('/:id',auth[_0xa6d7('0xb')](),controller[_0xa6d7('0xc')]);router[_0xa6d7('0xd')]('/',auth[_0xa6d7('0xb')](),controller[_0xa6d7('0xe')]);router['put'](_0xa6d7('0xf'),auth[_0xa6d7('0xb')](),controller[_0xa6d7('0x10')]);router['delete'](_0xa6d7('0xf'),auth['isAuthenticated'](),controller[_0xa6d7('0x11')]);module[_0xa6d7('0x12')]=router; \ No newline at end of file +var _0x0c67=['put','update','delete','destroy','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./intZohoField.controller','get','isAuthenticated','index','/:id','show','post','create'];(function(_0x196e1b,_0x55fa06){var _0x5e1f18=function(_0x3bdb41){while(--_0x3bdb41){_0x196e1b['push'](_0x196e1b['shift']());}};_0x5e1f18(++_0x55fa06);}(_0x0c67,0x1ba));var _0x70c6=function(_0x11e3f1,_0x5ae68a){_0x11e3f1=_0x11e3f1-0x0;var _0x32daf0=_0x0c67[_0x11e3f1];return _0x32daf0;};'use strict';var multer=require('multer');var util=require(_0x70c6('0x0'));var path=require(_0x70c6('0x1'));var timeout=require('connect-timeout');var express=require(_0x70c6('0x2'));var router=express[_0x70c6('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x70c6('0x4'));var interaction=require(_0x70c6('0x5'));var config=require('../../config/environment');var controller=require(_0x70c6('0x6'));router[_0x70c6('0x7')]('/',auth[_0x70c6('0x8')](),controller[_0x70c6('0x9')]);router[_0x70c6('0x7')](_0x70c6('0xa'),auth['isAuthenticated'](),controller[_0x70c6('0xb')]);router[_0x70c6('0xc')]('/',auth['isAuthenticated'](),controller[_0x70c6('0xd')]);router[_0x70c6('0xe')](_0x70c6('0xa'),auth[_0x70c6('0x8')](),controller[_0x70c6('0xf')]);router[_0x70c6('0x10')](_0x70c6('0xa'),auth[_0x70c6('0x8')](),controller[_0x70c6('0x11')]);module[_0x70c6('0x12')]=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index cb53178..ce44a33 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 _0x7451=['STRING','customVariable','sequelize','ENUM','string','variable','keyValue','picklist'];(function(_0x47f072,_0x3393b2){var _0xd019b5=function(_0x3b2c90){while(--_0x3b2c90){_0x47f072['push'](_0x47f072['shift']());}};_0xd019b5(++_0x3393b2);}(_0x7451,0x14a));var _0x1745=function(_0xf4c51e,_0x2b404d){_0xf4c51e=_0xf4c51e-0x0;var _0x59c56d=_0x7451[_0xf4c51e];return _0x59c56d;};'use strict';var Sequelize=require(_0x1745('0x0'));module['exports']={'type':{'type':Sequelize[_0x1745('0x1')](_0x1745('0x2'),_0x1745('0x3'),'customVariable',_0x1745('0x4'),_0x1745('0x5')),'defaultValue':_0x1745('0x2')},'content':{'type':Sequelize[_0x1745('0x6')]},'key':{'type':Sequelize[_0x1745('0x6')]},'keyType':{'type':Sequelize[_0x1745('0x1')](_0x1745('0x2'),_0x1745('0x3'),_0x1745('0x7'))},'keyContent':{'type':Sequelize[_0x1745('0x6')]},'idField':{'type':Sequelize[_0x1745('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xd3da=['STRING','string','ENUM','variable','customVariable','keyValue'];(function(_0x9c2427,_0x17c865){var _0x51984f=function(_0x177af6){while(--_0x177af6){_0x9c2427['push'](_0x9c2427['shift']());}};_0x51984f(++_0x17c865);}(_0xd3da,0x1be));var _0xad3d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd3da[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0xad3d('0x0')]('string',_0xad3d('0x1'),_0xad3d('0x2'),_0xad3d('0x3'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0xad3d('0x4')]},'key':{'type':Sequelize[_0xad3d('0x4')]},'keyType':{'type':Sequelize['ENUM'](_0xad3d('0x5'),_0xad3d('0x1'),'customVariable')},'keyContent':{'type':Sequelize[_0xad3d('0x4')]},'idField':{'type':Sequelize[_0xad3d('0x4')]},'nameField':{'type':Sequelize[_0xad3d('0x4')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xad3d('0x4')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index 11cc8ea..44a9d6a 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 _0x6199=['to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','../../components/parsers/qs','../../config/utils','../../config/environment','../../mysqldb','status','end','json','undefined','limit','count','offset','set','apply','reject','save','update','then','destroy','sendStatus','error','name','send','index','map','fieldName','type','key','model','query','intersection','fields','length','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','VIRTUAL','options','ZohoField','includeAll','include','findAll','rows','catch','params','keys','create','body','find','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','sox'];(function(_0x418e01,_0x45d002){var _0x1af23c=function(_0x17706e){while(--_0x17706e){_0x418e01['push'](_0x418e01['shift']());}};_0x1af23c(++_0x45d002);}(_0x6199,0xc8));var _0x9619=function(_0x57d080,_0x4a3928){_0x57d080=_0x57d080-0x0;var _0x57339c=_0x6199[_0x57d080];return _0x57339c;};'use strict';var emlformat=require(_0x9619('0x0'));var rimraf=require(_0x9619('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9619('0x2'));var rp=require('request-promise');var moment=require(_0x9619('0x3'));var BPromise=require(_0x9619('0x4'));var Mustache=require(_0x9619('0x5'));var util=require('util');var path=require('path');var sox=require(_0x9619('0x6'));var csv=require(_0x9619('0x7'));var ejs=require(_0x9619('0x8'));var fs=require('fs');var fs_extra=require(_0x9619('0x9'));var _=require(_0x9619('0xa'));var squel=require(_0x9619('0xb'));var crypto=require('crypto');var jsforce=require(_0x9619('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x9619('0x7'));var querystring=require(_0x9619('0xd'));var Papa=require(_0x9619('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x9619('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x9619('0x10'));var config=require(_0x9619('0x11'));var licenseUtil=require('../../config/license/util');var db=require(_0x9619('0x12'))['db'];function respondWithStatusCode(_0x327f62,_0x25bf7e){_0x25bf7e=_0x25bf7e||0xcc;return function(_0x1f936e){if(_0x1f936e){return _0x327f62['sendStatus'](_0x25bf7e);}return _0x327f62[_0x9619('0x13')](_0x25bf7e)[_0x9619('0x14')]();};}function respondWithResult(_0x45139f,_0xbdd5fe){_0xbdd5fe=_0xbdd5fe||0xc8;return function(_0x146d70){if(_0x146d70){return _0x45139f[_0x9619('0x13')](_0xbdd5fe)[_0x9619('0x15')](_0x146d70);}};}function respondWithFilteredResult(_0x2fd258,_0x29ad87){return function(_0x672a6a){if(_0x672a6a){var _0x599a7f=typeof _0x29ad87['offset']===_0x9619('0x16')&&typeof _0x29ad87[_0x9619('0x17')]===_0x9619('0x16');var _0x41be48=_0x672a6a[_0x9619('0x18')];var _0x5b61eb=_0x599a7f?0x0:_0x29ad87[_0x9619('0x19')];var _0x1b79bb=_0x599a7f?_0x672a6a[_0x9619('0x18')]:_0x29ad87[_0x9619('0x19')]+_0x29ad87[_0x9619('0x17')];var _0xb74522;if(_0x1b79bb>=_0x41be48){_0x1b79bb=_0x41be48;_0xb74522=0xc8;}else{_0xb74522=0xce;}_0x2fd258[_0x9619('0x13')](_0xb74522);return _0x2fd258[_0x9619('0x1a')]('Content-Range',_0x5b61eb+'-'+_0x1b79bb+'/'+_0x41be48)[_0x9619('0x15')](_0x672a6a);}return null;};}function patchUpdates(_0x4256d9){return function(_0x47c26b){try{jsonpatch[_0x9619('0x1b')](_0x47c26b,_0x4256d9,!![]);}catch(_0x78917){return BPromise[_0x9619('0x1c')](_0x78917);}return _0x47c26b[_0x9619('0x1d')]();};}function saveUpdates(_0x53f235,_0x5e52e2){return function(_0xd93e75){if(_0xd93e75){return _0xd93e75[_0x9619('0x1e')](_0x53f235)[_0x9619('0x1f')](function(_0x407f65){return _0x407f65;});}return null;};}function removeEntity(_0x552eed,_0x4e4523){return function(_0x26d159){if(_0x26d159){return _0x26d159[_0x9619('0x20')]()[_0x9619('0x1f')](function(){_0x552eed[_0x9619('0x13')](0xcc)[_0x9619('0x14')]();});}};}function handleEntityNotFound(_0x9eba09,_0x2fe8a9){return function(_0x6d51c0){if(!_0x6d51c0){_0x9eba09[_0x9619('0x21')](0x194);}return _0x6d51c0;};}function handleError(_0xdb1508,_0x2b69e7){_0x2b69e7=_0x2b69e7||0x1f4;return function(_0x295203){logger[_0x9619('0x22')](_0x295203['stack']);if(_0x295203[_0x9619('0x23')]){delete _0x295203['name'];}_0xdb1508[_0x9619('0x13')](_0x2b69e7)[_0x9619('0x24')](_0x295203);};}exports[_0x9619('0x25')]=function(_0x34412e,_0x27af18){var _0x1ca2d5={},_0x496db5={},_0x4a446b={'count':0x0,'rows':[]};var _0x4d3b4e=_[_0x9619('0x26')](db['ZohoField']['rawAttributes'],function(_0x3a73bb){return{'name':_0x3a73bb[_0x9619('0x27')],'type':_0x3a73bb[_0x9619('0x28')][_0x9619('0x29')]};});_0x496db5[_0x9619('0x2a')]=_[_0x9619('0x26')](_0x4d3b4e,_0x9619('0x23'));_0x496db5['query']=_['keys'](_0x34412e[_0x9619('0x2b')]);_0x496db5['filters']=_[_0x9619('0x2c')](_0x496db5[_0x9619('0x2a')],_0x496db5[_0x9619('0x2b')]);_0x1ca2d5['attributes']=_['intersection'](_0x496db5[_0x9619('0x2a')],qs[_0x9619('0x2d')](_0x34412e[_0x9619('0x2b')][_0x9619('0x2d')]));_0x1ca2d5['attributes']=_0x1ca2d5['attributes'][_0x9619('0x2e')]?_0x1ca2d5[_0x9619('0x2f')]:_0x496db5['model'];if(!_0x34412e[_0x9619('0x2b')][_0x9619('0x30')](_0x9619('0x31'))){_0x1ca2d5[_0x9619('0x17')]=qs['limit'](_0x34412e[_0x9619('0x2b')][_0x9619('0x17')]);_0x1ca2d5[_0x9619('0x19')]=qs[_0x9619('0x19')](_0x34412e[_0x9619('0x2b')][_0x9619('0x19')]);}_0x1ca2d5[_0x9619('0x32')]=qs[_0x9619('0x33')](_0x34412e[_0x9619('0x2b')][_0x9619('0x33')]);_0x1ca2d5[_0x9619('0x34')]=qs['filters'](_[_0x9619('0x35')](_0x34412e[_0x9619('0x2b')],_0x496db5[_0x9619('0x36')]),_0x4d3b4e);if(_0x34412e['query'][_0x9619('0x37')]){_0x1ca2d5['where']=_['merge'](_0x1ca2d5[_0x9619('0x34')],{'$or':_[_0x9619('0x26')](_0x4d3b4e,function(_0x39d4c5){if(_0x39d4c5['type']!==_0x9619('0x38')){var _0x22ce98={};_0x22ce98[_0x39d4c5[_0x9619('0x23')]]={'$like':'%'+_0x34412e['query'][_0x9619('0x37')]+'%'};return _0x22ce98;}})});}_0x1ca2d5=_['merge']({},_0x1ca2d5,_0x34412e[_0x9619('0x39')]);var _0x177e7e={'where':_0x1ca2d5[_0x9619('0x34')]};return db[_0x9619('0x3a')][_0x9619('0x18')](_0x177e7e)[_0x9619('0x1f')](function(_0x531c47){_0x4a446b[_0x9619('0x18')]=_0x531c47;if(_0x34412e[_0x9619('0x2b')][_0x9619('0x3b')]){_0x1ca2d5[_0x9619('0x3c')]=[{'all':!![]}];}return db[_0x9619('0x3a')][_0x9619('0x3d')](_0x1ca2d5);})[_0x9619('0x1f')](function(_0x146bd1){_0x4a446b[_0x9619('0x3e')]=_0x146bd1;return _0x4a446b;})[_0x9619('0x1f')](respondWithFilteredResult(_0x27af18,_0x1ca2d5))[_0x9619('0x3f')](handleError(_0x27af18,null));};exports['show']=function(_0x5a0268,_0x39a3c9){var _0x1e4507={'raw':!![],'where':{'id':_0x5a0268[_0x9619('0x40')]['id']}},_0x208854={};_0x208854[_0x9619('0x2a')]=_[_0x9619('0x41')](db[_0x9619('0x3a')]['rawAttributes']);_0x208854[_0x9619('0x2b')]=_['keys'](_0x5a0268[_0x9619('0x2b')]);_0x208854[_0x9619('0x36')]=_['intersection'](_0x208854['model'],_0x208854[_0x9619('0x2b')]);_0x1e4507[_0x9619('0x2f')]=_[_0x9619('0x2c')](_0x208854[_0x9619('0x2a')],qs[_0x9619('0x2d')](_0x5a0268['query'][_0x9619('0x2d')]));_0x1e4507['attributes']=_0x1e4507[_0x9619('0x2f')][_0x9619('0x2e')]?_0x1e4507[_0x9619('0x2f')]:_0x208854[_0x9619('0x2a')];if(_0x5a0268[_0x9619('0x2b')][_0x9619('0x3b')]){_0x1e4507[_0x9619('0x3c')]=[{'all':!![]}];}_0x1e4507=_['merge']({},_0x1e4507,_0x5a0268['options']);return db[_0x9619('0x3a')]['find'](_0x1e4507)[_0x9619('0x1f')](handleEntityNotFound(_0x39a3c9,null))[_0x9619('0x1f')](respondWithResult(_0x39a3c9,null))[_0x9619('0x3f')](handleError(_0x39a3c9,null));};exports[_0x9619('0x42')]=function(_0x29ad4b,_0x11bea2){return db['ZohoField'][_0x9619('0x42')](_0x29ad4b['body'],{})[_0x9619('0x1f')](respondWithResult(_0x11bea2,0xc9))[_0x9619('0x3f')](handleError(_0x11bea2,null));};exports[_0x9619('0x1e')]=function(_0x5809c0,_0x3c9e87){if(_0x5809c0[_0x9619('0x43')]['id']){delete _0x5809c0[_0x9619('0x43')]['id'];}return db[_0x9619('0x3a')][_0x9619('0x44')]({'where':{'id':_0x5809c0[_0x9619('0x40')]['id']}})['then'](handleEntityNotFound(_0x3c9e87,null))[_0x9619('0x1f')](saveUpdates(_0x5809c0[_0x9619('0x43')],null))[_0x9619('0x1f')](respondWithResult(_0x3c9e87,null))[_0x9619('0x3f')](handleError(_0x3c9e87,null));};exports[_0x9619('0x20')]=function(_0x1af934,_0x308724){return db[_0x9619('0x3a')][_0x9619('0x44')]({'where':{'id':_0x1af934['params']['id']}})[_0x9619('0x1f')](handleEntityNotFound(_0x308724,null))[_0x9619('0x1f')](removeEntity(_0x308724,null))[_0x9619('0x3f')](handleError(_0x308724,null));}; \ No newline at end of file +var _0x20fe=['mustache','path','sox','fs-extra','lodash','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','count','limit','set','Content-Range','json','then','destroy','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','VIRTUAL','filter','options','ZohoField','includeAll','include','findAll','rows','params','merge','find','catch','create','body','eml-format','zip-dir','fast-json-patch','moment','bluebird'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x20fe,0x117));var _0xe20f=function(_0x56ed15,_0x3da79a){_0x56ed15=_0x56ed15-0x0;var _0x397fe7=_0x20fe[_0x56ed15];return _0x397fe7;};'use strict';var emlformat=require(_0xe20f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe20f('0x1'));var jsonpatch=require(_0xe20f('0x2'));var rp=require('request-promise');var moment=require(_0xe20f('0x3'));var BPromise=require(_0xe20f('0x4'));var Mustache=require(_0xe20f('0x5'));var util=require('util');var path=require(_0xe20f('0x6'));var sox=require(_0xe20f('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe20f('0x8'));var _=require(_0xe20f('0x9'));var squel=require(_0xe20f('0xa'));var crypto=require('crypto');var jsforce=require(_0xe20f('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xe20f('0xc'));var querystring=require(_0xe20f('0xd'));var Papa=require(_0xe20f('0xe'));var Redis=require(_0xe20f('0xf'));var authService=require(_0xe20f('0x10'));var qs=require(_0xe20f('0x11'));var as=require(_0xe20f('0x12'));var hardwareService=require(_0xe20f('0x13'));var logger=require(_0xe20f('0x14'))(_0xe20f('0x15'));var utils=require('../../config/utils');var config=require(_0xe20f('0x16'));var licenseUtil=require(_0xe20f('0x17'));var db=require(_0xe20f('0x18'))['db'];function respondWithStatusCode(_0x2561fa,_0xed2da8){_0xed2da8=_0xed2da8||0xcc;return function(_0x2744c7){if(_0x2744c7){return _0x2561fa['sendStatus'](_0xed2da8);}return _0x2561fa[_0xe20f('0x19')](_0xed2da8)[_0xe20f('0x1a')]();};}function respondWithResult(_0x402846,_0x2ce58a){_0x2ce58a=_0x2ce58a||0xc8;return function(_0xc8ab62){if(_0xc8ab62){return _0x402846[_0xe20f('0x19')](_0x2ce58a)['json'](_0xc8ab62);}};}function respondWithFilteredResult(_0x29ea76,_0x561ed9){return function(_0x88c9c8){if(_0x88c9c8){var _0x51a70a=typeof _0x561ed9[_0xe20f('0x1b')]===_0xe20f('0x1c')&&typeof _0x561ed9['limit']===_0xe20f('0x1c');var _0x49bdf9=_0x88c9c8[_0xe20f('0x1d')];var _0x371505=_0x51a70a?0x0:_0x561ed9[_0xe20f('0x1b')];var _0x15defd=_0x51a70a?_0x88c9c8['count']:_0x561ed9[_0xe20f('0x1b')]+_0x561ed9[_0xe20f('0x1e')];var _0x38d203;if(_0x15defd>=_0x49bdf9){_0x15defd=_0x49bdf9;_0x38d203=0xc8;}else{_0x38d203=0xce;}_0x29ea76[_0xe20f('0x19')](_0x38d203);return _0x29ea76[_0xe20f('0x1f')](_0xe20f('0x20'),_0x371505+'-'+_0x15defd+'/'+_0x49bdf9)[_0xe20f('0x21')](_0x88c9c8);}return null;};}function patchUpdates(_0xe0f099){return function(_0x3d8abe){try{jsonpatch['apply'](_0x3d8abe,_0xe0f099,!![]);}catch(_0x2ae588){return BPromise['reject'](_0x2ae588);}return _0x3d8abe['save']();};}function saveUpdates(_0x5317f0,_0x56c80d){return function(_0x435bce){if(_0x435bce){return _0x435bce['update'](_0x5317f0)[_0xe20f('0x22')](function(_0x1ae588){return _0x1ae588;});}return null;};}function removeEntity(_0x2311ff,_0x4b1509){return function(_0x3ac590){if(_0x3ac590){return _0x3ac590[_0xe20f('0x23')]()[_0xe20f('0x22')](function(){_0x2311ff[_0xe20f('0x19')](0xcc)[_0xe20f('0x1a')]();});}};}function handleEntityNotFound(_0x39bed4,_0x4b94f7){return function(_0x1a622b){if(!_0x1a622b){_0x39bed4['sendStatus'](0x194);}return _0x1a622b;};}function handleError(_0x16e7a0,_0x2c6aa3){_0x2c6aa3=_0x2c6aa3||0x1f4;return function(_0x5995c8){logger[_0xe20f('0x24')](_0x5995c8['stack']);if(_0x5995c8[_0xe20f('0x25')]){delete _0x5995c8['name'];}_0x16e7a0[_0xe20f('0x19')](_0x2c6aa3)[_0xe20f('0x26')](_0x5995c8);};}exports[_0xe20f('0x27')]=function(_0xdcb3e1,_0x40f414){var _0x52cd96={},_0x44c5ed={},_0x452e99={'count':0x0,'rows':[]};var _0x1323c3=_[_0xe20f('0x28')](db['ZohoField'][_0xe20f('0x29')],function(_0x4fc897){return{'name':_0x4fc897[_0xe20f('0x2a')],'type':_0x4fc897[_0xe20f('0x2b')][_0xe20f('0x2c')]};});_0x44c5ed[_0xe20f('0x2d')]=_[_0xe20f('0x28')](_0x1323c3,'name');_0x44c5ed[_0xe20f('0x2e')]=_[_0xe20f('0x2f')](_0xdcb3e1[_0xe20f('0x2e')]);_0x44c5ed['filters']=_[_0xe20f('0x30')](_0x44c5ed[_0xe20f('0x2d')],_0x44c5ed[_0xe20f('0x2e')]);_0x52cd96[_0xe20f('0x31')]=_[_0xe20f('0x30')](_0x44c5ed[_0xe20f('0x2d')],qs['fields'](_0xdcb3e1['query'][_0xe20f('0x32')]));_0x52cd96[_0xe20f('0x31')]=_0x52cd96[_0xe20f('0x31')][_0xe20f('0x33')]?_0x52cd96[_0xe20f('0x31')]:_0x44c5ed[_0xe20f('0x2d')];if(!_0xdcb3e1['query'][_0xe20f('0x34')]('nolimit')){_0x52cd96[_0xe20f('0x1e')]=qs[_0xe20f('0x1e')](_0xdcb3e1[_0xe20f('0x2e')][_0xe20f('0x1e')]);_0x52cd96[_0xe20f('0x1b')]=qs[_0xe20f('0x1b')](_0xdcb3e1[_0xe20f('0x2e')][_0xe20f('0x1b')]);}_0x52cd96[_0xe20f('0x35')]=qs[_0xe20f('0x36')](_0xdcb3e1['query']['sort']);_0x52cd96[_0xe20f('0x37')]=qs['filters'](_['pick'](_0xdcb3e1[_0xe20f('0x2e')],_0x44c5ed[_0xe20f('0x38')]),_0x1323c3);if(_0xdcb3e1['query']['filter']){_0x52cd96[_0xe20f('0x37')]=_['merge'](_0x52cd96[_0xe20f('0x37')],{'$or':_[_0xe20f('0x28')](_0x1323c3,function(_0x4b4b2b){if(_0x4b4b2b['type']!==_0xe20f('0x39')){var _0x1da1ff={};_0x1da1ff[_0x4b4b2b[_0xe20f('0x25')]]={'$like':'%'+_0xdcb3e1[_0xe20f('0x2e')][_0xe20f('0x3a')]+'%'};return _0x1da1ff;}})});}_0x52cd96=_['merge']({},_0x52cd96,_0xdcb3e1[_0xe20f('0x3b')]);var _0x2a0049={'where':_0x52cd96[_0xe20f('0x37')]};return db[_0xe20f('0x3c')][_0xe20f('0x1d')](_0x2a0049)[_0xe20f('0x22')](function(_0x45c442){_0x452e99[_0xe20f('0x1d')]=_0x45c442;if(_0xdcb3e1[_0xe20f('0x2e')][_0xe20f('0x3d')]){_0x52cd96[_0xe20f('0x3e')]=[{'all':!![]}];}return db[_0xe20f('0x3c')][_0xe20f('0x3f')](_0x52cd96);})[_0xe20f('0x22')](function(_0x58a06d){_0x452e99[_0xe20f('0x40')]=_0x58a06d;return _0x452e99;})[_0xe20f('0x22')](respondWithFilteredResult(_0x40f414,_0x52cd96))['catch'](handleError(_0x40f414,null));};exports['show']=function(_0x239637,_0x45c49d){var _0x35ceca={'raw':!![],'where':{'id':_0x239637[_0xe20f('0x41')]['id']}},_0x39bd69={};_0x39bd69[_0xe20f('0x2d')]=_['keys'](db['ZohoField'][_0xe20f('0x29')]);_0x39bd69[_0xe20f('0x2e')]=_[_0xe20f('0x2f')](_0x239637['query']);_0x39bd69[_0xe20f('0x38')]=_[_0xe20f('0x30')](_0x39bd69[_0xe20f('0x2d')],_0x39bd69[_0xe20f('0x2e')]);_0x35ceca[_0xe20f('0x31')]=_[_0xe20f('0x30')](_0x39bd69[_0xe20f('0x2d')],qs[_0xe20f('0x32')](_0x239637['query'][_0xe20f('0x32')]));_0x35ceca[_0xe20f('0x31')]=_0x35ceca[_0xe20f('0x31')][_0xe20f('0x33')]?_0x35ceca[_0xe20f('0x31')]:_0x39bd69[_0xe20f('0x2d')];if(_0x239637['query'][_0xe20f('0x3d')]){_0x35ceca[_0xe20f('0x3e')]=[{'all':!![]}];}_0x35ceca=_[_0xe20f('0x42')]({},_0x35ceca,_0x239637['options']);return db['ZohoField'][_0xe20f('0x43')](_0x35ceca)[_0xe20f('0x22')](handleEntityNotFound(_0x45c49d,null))['then'](respondWithResult(_0x45c49d,null))[_0xe20f('0x44')](handleError(_0x45c49d,null));};exports['create']=function(_0x434038,_0x168cb1){return db[_0xe20f('0x3c')][_0xe20f('0x45')](_0x434038[_0xe20f('0x46')],{})[_0xe20f('0x22')](respondWithResult(_0x168cb1,0xc9))[_0xe20f('0x44')](handleError(_0x168cb1,null));};exports['update']=function(_0xa652da,_0x330a56){if(_0xa652da[_0xe20f('0x46')]['id']){delete _0xa652da[_0xe20f('0x46')]['id'];}return db[_0xe20f('0x3c')]['find']({'where':{'id':_0xa652da[_0xe20f('0x41')]['id']}})[_0xe20f('0x22')](handleEntityNotFound(_0x330a56,null))[_0xe20f('0x22')](saveUpdates(_0xa652da[_0xe20f('0x46')],null))[_0xe20f('0x22')](respondWithResult(_0x330a56,null))[_0xe20f('0x44')](handleError(_0x330a56,null));};exports['destroy']=function(_0x28a05b,_0x2cb6f5){return db[_0xe20f('0x3c')][_0xe20f('0x43')]({'where':{'id':_0x28a05b[_0xe20f('0x41')]['id']}})[_0xe20f('0x22')](handleEntityNotFound(_0x2cb6f5,null))[_0xe20f('0x22')](removeEntity(_0x2cb6f5,null))['catch'](handleError(_0x2cb6f5,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index 2d7a365..0b8170c 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 _0xc1c6=['path','rimraf','exports','ZohoField','int_zoho_fields','zoho_unique_index','idField','lodash','util','../../config/logger','moment','request-promise'];(function(_0x1a75f1,_0x8737c4){var _0x1b05ef=function(_0x139e4c){while(--_0x139e4c){_0x1a75f1['push'](_0x1a75f1['shift']());}};_0x1b05ef(++_0x8737c4);}(_0xc1c6,0xf7));var _0x6c1c=function(_0x44a17b,_0x5617c9){_0x44a17b=_0x44a17b-0x0;var _0x2baca9=_0xc1c6[_0x44a17b];return _0x2baca9;};'use strict';var _=require(_0x6c1c('0x0'));var util=require(_0x6c1c('0x1'));var logger=require(_0x6c1c('0x2'))('api');var moment=require(_0x6c1c('0x3'));var BPromise=require('bluebird');var rp=require(_0x6c1c('0x4'));var fs=require('fs');var path=require(_0x6c1c('0x5'));var rimraf=require(_0x6c1c('0x6'));var config=require('../../config/environment');var attributes=require('./intZohoField.attributes');module[_0x6c1c('0x7')]=function(_0x524a6b,_0x50c1bb){return _0x524a6b['define'](_0x6c1c('0x8'),attributes,{'tableName':_0x6c1c('0x9'),'paranoid':![],'indexes':[{'name':_0x6c1c('0xa'),'fields':[_0x6c1c('0xb'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5430=['bluebird','rimraf','exports','define','ZohoField','zoho_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment'];(function(_0x187f8b,_0x3ef111){var _0x57ad93=function(_0x4479a1){while(--_0x4479a1){_0x187f8b['push'](_0x187f8b['shift']());}};_0x57ad93(++_0x3ef111);}(_0x5430,0x10c));var _0x0543=function(_0x567611,_0x491b6a){_0x567611=_0x567611-0x0;var _0x46f5af=_0x5430[_0x567611];return _0x46f5af;};'use strict';var _=require(_0x0543('0x0'));var util=require(_0x0543('0x1'));var logger=require(_0x0543('0x2'))(_0x0543('0x3'));var moment=require(_0x0543('0x4'));var BPromise=require(_0x0543('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0543('0x6'));var config=require('../../config/environment');var attributes=require('./intZohoField.attributes');module[_0x0543('0x7')]=function(_0x45b909,_0x9754ba){return _0x45b909[_0x0543('0x8')](_0x0543('0x9'),attributes,{'tableName':'int_zoho_fields','paranoid':![],'indexes':[{'name':_0x0543('0xa'),'fields':[_0x0543('0xb'),_0x0543('0xc')],'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 4a75d0b..63f3099 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 _0x67b0=['ZohoField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','ZohoField,\x20%s,\x20%s','debug'];(function(_0x1a34ec,_0x2cbf5b){var _0x496954=function(_0x12b9c5){while(--_0x12b9c5){_0x1a34ec['push'](_0x1a34ec['shift']());}};_0x496954(++_0x2cbf5b);}(_0x67b0,0x157));var _0x067b=function(_0x2daad8,_0x37d518){_0x2daad8=_0x2daad8-0x0;var _0x13d2c7=_0x67b0[_0x2daad8];return _0x13d2c7;};'use strict';var _=require(_0x067b('0x0'));var util=require(_0x067b('0x1'));var moment=require(_0x067b('0x2'));var BPromise=require(_0x067b('0x3'));var rs=require(_0x067b('0x4'));var fs=require('fs');var Redis=require(_0x067b('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x067b('0x6'));var logger=require(_0x067b('0x7'))(_0x067b('0x8'));var config=require('../../config/environment');var jayson=require(_0x067b('0x9'));var client=jayson[_0x067b('0xa')][_0x067b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5e82d9,_0x47102f,_0x4d3011){return new BPromise(function(_0x531465,_0x2ecd23){return client[_0x067b('0xc')](_0x5e82d9,_0x4d3011)[_0x067b('0xd')](function(_0x4d4bc9){logger[_0x067b('0xe')](_0x067b('0xf'),_0x47102f,'request\x20sent');logger[_0x067b('0x10')](_0x067b('0x11'),_0x47102f,_0x067b('0x12'),JSON[_0x067b('0x13')](_0x4d4bc9));if(_0x4d4bc9[_0x067b('0x14')]){if(_0x4d4bc9[_0x067b('0x14')]['code']===0x1f4){logger[_0x067b('0x14')]('ZohoField,\x20%s,\x20%s',_0x47102f,_0x4d4bc9[_0x067b('0x14')][_0x067b('0x15')]);return _0x2ecd23(_0x4d4bc9['error'][_0x067b('0x15')]);}logger['error'](_0x067b('0xf'),_0x47102f,_0x4d4bc9[_0x067b('0x14')][_0x067b('0x15')]);return _0x531465(_0x4d4bc9['error'][_0x067b('0x15')]);}else{logger[_0x067b('0xe')](_0x067b('0xf'),_0x47102f,_0x067b('0x12'));_0x531465(_0x4d4bc9[_0x067b('0x16')][_0x067b('0x15')]);}})[_0x067b('0x17')](function(_0x29c22c){logger['error'](_0x067b('0xf'),_0x47102f,_0x29c22c);_0x2ecd23(_0x29c22c);});});} \ No newline at end of file +var _0xb8f1=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','ZohoField,\x20%s,\x20%s','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash'];(function(_0x4ac260,_0x529c62){var _0x3d616d=function(_0x32aafd){while(--_0x32aafd){_0x4ac260['push'](_0x4ac260['shift']());}};_0x3d616d(++_0x529c62);}(_0xb8f1,0xa7));var _0x1b8f=function(_0x18a620,_0xf8e275){_0x18a620=_0x18a620-0x0;var _0x48391d=_0xb8f1[_0x18a620];return _0x48391d;};'use strict';var _=require(_0x1b8f('0x0'));var util=require(_0x1b8f('0x1'));var moment=require(_0x1b8f('0x2'));var BPromise=require(_0x1b8f('0x3'));var rs=require(_0x1b8f('0x4'));var fs=require('fs');var Redis=require(_0x1b8f('0x5'));var db=require(_0x1b8f('0x6'))['db'];var utils=require(_0x1b8f('0x7'));var logger=require('../../config/logger')(_0x1b8f('0x8'));var config=require('../../config/environment');var jayson=require(_0x1b8f('0x9'));var client=jayson[_0x1b8f('0xa')][_0x1b8f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4c9531,_0x3415d1,_0x3548ef){return new BPromise(function(_0x4de50b,_0x5cf461){return client[_0x1b8f('0xc')](_0x4c9531,_0x3548ef)[_0x1b8f('0xd')](function(_0x32ec91){logger[_0x1b8f('0xe')](_0x1b8f('0xf'),_0x3415d1,_0x1b8f('0x10'));logger[_0x1b8f('0x11')](_0x1b8f('0x12'),_0x3415d1,_0x1b8f('0x10'),JSON[_0x1b8f('0x13')](_0x32ec91));if(_0x32ec91['error']){if(_0x32ec91['error']['code']===0x1f4){logger[_0x1b8f('0x14')](_0x1b8f('0xf'),_0x3415d1,_0x32ec91['error'][_0x1b8f('0x15')]);return _0x5cf461(_0x32ec91['error'][_0x1b8f('0x15')]);}logger[_0x1b8f('0x14')](_0x1b8f('0xf'),_0x3415d1,_0x32ec91[_0x1b8f('0x14')][_0x1b8f('0x15')]);return _0x4de50b(_0x32ec91['error'][_0x1b8f('0x15')]);}else{logger[_0x1b8f('0xe')](_0x1b8f('0xf'),_0x3415d1,_0x1b8f('0x10'));_0x4de50b(_0x32ec91[_0x1b8f('0x16')]['message']);}})[_0x1b8f('0x17')](function(_0x333a89){logger['error'](_0x1b8f('0xf'),_0x3415d1,_0x333a89);_0x5cf461(_0x333a89);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index 7e4667a..d9efd18 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x2d0de6,_0x3a1468){var _0x49b8bf=function(_0xbb907b){while(--_0xbb907b){_0x2d0de6['push'](_0x2d0de6['shift']());}};_0x49b8bf(++_0x3a1468);}(_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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x58ac3f,_0x190d30){var _0x327bc0=function(_0x595a8c){while(--_0x595a8c){_0x58ac3f['push'](_0x58ac3f['shift']());}};_0x327bc0(++_0x190d30);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0xa9e0[_0x5037ab];return _0x512adb;};'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/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index d7db771..1b7db17 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 _0x2236=['INTEGER','BOOLEAN','sequelize','STRING'];(function(_0x1ff2ae,_0x58822b){var _0x6647d3=function(_0x2cb393){while(--_0x2cb393){_0x1ff2ae['push'](_0x1ff2ae['shift']());}};_0x6647d3(++_0x58822b);}(_0x2236,0x12e));var _0x6223=function(_0x5a2d95,_0xb362e5){_0x5a2d95=_0x5a2d95-0x0;var _0x2c3986=_0x2236[_0x5a2d95];return _0x2c3986;};'use strict';var Sequelize=require(_0x6223('0x0'));module['exports']={'name':{'type':Sequelize[_0x6223('0x1')],'allowNull':![],'unique':'unique_name_and_version'},'version':{'type':Sequelize[_0x6223('0x1')],'allowNull':![],'unique':'unique_name_and_version'},'main':{'type':Sequelize['STRING'],'defaultValue':'app.js'},'filename':{'type':Sequelize[_0x6223('0x1')]},'path':{'type':Sequelize[_0x6223('0x1')]},'type':{'type':Sequelize['STRING']},'size':{'type':Sequelize[_0x6223('0x2')]},'active':{'type':Sequelize[_0x6223('0x3')],'defaultValue':![]},'author':{'type':Sequelize[_0x6223('0x1')]},'logo':{'type':Sequelize[_0x6223('0x1')]},'state':{'type':Sequelize['STRING'],'unique':'state'},'description':{'type':Sequelize['STRING']},'title':{'type':Sequelize[_0x6223('0x1')]},'remoteUri':{'type':Sequelize[_0x6223('0x1')]},'link':{'type':Sequelize['STRING'],'defaultValue':'#'}}; \ No newline at end of file +var _0xeff5=['BOOLEAN','state','sequelize','STRING','INTEGER'];(function(_0x2179e3,_0x3f7767){var _0x3a350b=function(_0x1a4975){while(--_0x1a4975){_0x2179e3['push'](_0x2179e3['shift']());}};_0x3a350b(++_0x3f7767);}(_0xeff5,0x101));var _0x5eff=function(_0x22900e,_0x40d166){_0x22900e=_0x22900e-0x0;var _0x415324=_0xeff5[_0x22900e];return _0x415324;};'use strict';var Sequelize=require(_0x5eff('0x0'));module['exports']={'name':{'type':Sequelize[_0x5eff('0x1')],'allowNull':![],'unique':'unique_name_and_version'},'version':{'type':Sequelize[_0x5eff('0x1')],'allowNull':![],'unique':'unique_name_and_version'},'main':{'type':Sequelize['STRING'],'defaultValue':'app.js'},'filename':{'type':Sequelize[_0x5eff('0x1')]},'path':{'type':Sequelize[_0x5eff('0x1')]},'type':{'type':Sequelize[_0x5eff('0x1')]},'size':{'type':Sequelize[_0x5eff('0x2')]},'active':{'type':Sequelize[_0x5eff('0x3')],'defaultValue':![]},'author':{'type':Sequelize[_0x5eff('0x1')]},'logo':{'type':Sequelize[_0x5eff('0x1')]},'state':{'type':Sequelize[_0x5eff('0x1')],'unique':_0x5eff('0x4')},'description':{'type':Sequelize[_0x5eff('0x1')]},'title':{'type':Sequelize[_0x5eff('0x1')]},'remoteUri':{'type':Sequelize[_0x5eff('0x1')]},'link':{'type':Sequelize[_0x5eff('0x1')],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index af4636b..5efcd45 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 _0x1a37=['stack','name','send','index','map','Integration','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','VIRTUAL','merge','includeAll','include','findAll','catch','show','options','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error'];(function(_0x45783c,_0x49c56d){var _0x1161da=function(_0x3c5d41){while(--_0x3c5d41){_0x45783c['push'](_0x45783c['shift']());}};_0x1161da(++_0x49c56d);}(_0x1a37,0xb4));var _0x71a3=function(_0x494d1f,_0x3f72ff){_0x494d1f=_0x494d1f-0x0;var _0x457b6e=_0x1a37[_0x494d1f];return _0x457b6e;};'use strict';var emlformat=require(_0x71a3('0x0'));var rimraf=require(_0x71a3('0x1'));var zipdir=require(_0x71a3('0x2'));var jsonpatch=require(_0x71a3('0x3'));var rp=require(_0x71a3('0x4'));var moment=require(_0x71a3('0x5'));var BPromise=require(_0x71a3('0x6'));var Mustache=require(_0x71a3('0x7'));var util=require(_0x71a3('0x8'));var path=require(_0x71a3('0x9'));var sox=require('sox');var csv=require(_0x71a3('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x71a3('0xb'));var _=require(_0x71a3('0xc'));var squel=require(_0x71a3('0xd'));var crypto=require(_0x71a3('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x71a3('0xf'));var Redis=require(_0x71a3('0x10'));var authService=require(_0x71a3('0x11'));var qs=require(_0x71a3('0x12'));var as=require(_0x71a3('0x13'));var hardwareService=require(_0x71a3('0x14'));var logger=require(_0x71a3('0x15'))(_0x71a3('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x71a3('0x17'))['db'];function respondWithStatusCode(_0x3830cb,_0x27e46d){_0x27e46d=_0x27e46d||0xcc;return function(_0x229134){if(_0x229134){return _0x3830cb[_0x71a3('0x18')](_0x27e46d);}return _0x3830cb[_0x71a3('0x19')](_0x27e46d)[_0x71a3('0x1a')]();};}function respondWithResult(_0x3b256c,_0x4dc4ed){_0x4dc4ed=_0x4dc4ed||0xc8;return function(_0x203ee1){if(_0x203ee1){return _0x3b256c[_0x71a3('0x19')](_0x4dc4ed)['json'](_0x203ee1);}};}function respondWithFilteredResult(_0x1743d7,_0x32591a){return function(_0x59021f){if(_0x59021f){var _0x4aa918=typeof _0x32591a[_0x71a3('0x1b')]===_0x71a3('0x1c')&&typeof _0x32591a[_0x71a3('0x1d')]===_0x71a3('0x1c');var _0x1af1bc=_0x59021f[_0x71a3('0x1e')];var _0x5d4dee=_0x4aa918?0x0:_0x32591a[_0x71a3('0x1b')];var _0x27bfb4=_0x4aa918?_0x59021f['count']:_0x32591a['offset']+_0x32591a[_0x71a3('0x1d')];var _0x250db3;if(_0x27bfb4>=_0x1af1bc){_0x27bfb4=_0x1af1bc;_0x250db3=0xc8;}else{_0x250db3=0xce;}_0x1743d7[_0x71a3('0x19')](_0x250db3);return _0x1743d7[_0x71a3('0x1f')](_0x71a3('0x20'),_0x5d4dee+'-'+_0x27bfb4+'/'+_0x1af1bc)['json'](_0x59021f);}return null;};}function patchUpdates(_0x1ab947){return function(_0x4156e1){try{jsonpatch[_0x71a3('0x21')](_0x4156e1,_0x1ab947,!![]);}catch(_0x3ea036){return BPromise[_0x71a3('0x22')](_0x3ea036);}return _0x4156e1['save']();};}function saveUpdates(_0x1af24b,_0x5bbaee){return function(_0x3bf78e){if(_0x3bf78e){return _0x3bf78e[_0x71a3('0x23')](_0x1af24b)[_0x71a3('0x24')](function(_0x21899d){return _0x21899d;});}return null;};}function removeEntity(_0x452bc4,_0x2847b4){return function(_0x5f33c5){if(_0x5f33c5){return _0x5f33c5[_0x71a3('0x25')]()[_0x71a3('0x24')](function(){_0x452bc4[_0x71a3('0x19')](0xcc)[_0x71a3('0x1a')]();});}};}function handleEntityNotFound(_0xb0f3aa,_0x4fd214){return function(_0x107fbd){if(!_0x107fbd){_0xb0f3aa[_0x71a3('0x18')](0x194);}return _0x107fbd;};}function handleError(_0x4c1a3d,_0x412746){_0x412746=_0x412746||0x1f4;return function(_0x515519){logger[_0x71a3('0x26')](_0x515519[_0x71a3('0x27')]);if(_0x515519[_0x71a3('0x28')]){delete _0x515519[_0x71a3('0x28')];}_0x4c1a3d[_0x71a3('0x19')](_0x412746)[_0x71a3('0x29')](_0x515519);};}exports[_0x71a3('0x2a')]=function(_0x242b85,_0x305eb1){var _0x3fc578={},_0x3ea7aa={},_0x228afa={'count':0x0,'rows':[]};var _0x51cde3=_[_0x71a3('0x2b')](db[_0x71a3('0x2c')][_0x71a3('0x2d')],function(_0x23ae85){return{'name':_0x23ae85['fieldName'],'type':_0x23ae85[_0x71a3('0x2e')][_0x71a3('0x2f')]};});_0x3ea7aa[_0x71a3('0x30')]=_[_0x71a3('0x2b')](_0x51cde3,_0x71a3('0x28'));_0x3ea7aa[_0x71a3('0x31')]=_[_0x71a3('0x32')](_0x242b85['query']);_0x3ea7aa[_0x71a3('0x33')]=_[_0x71a3('0x34')](_0x3ea7aa[_0x71a3('0x30')],_0x3ea7aa[_0x71a3('0x31')]);_0x3fc578[_0x71a3('0x35')]=_[_0x71a3('0x34')](_0x3ea7aa[_0x71a3('0x30')],qs[_0x71a3('0x36')](_0x242b85[_0x71a3('0x31')][_0x71a3('0x36')]));_0x3fc578[_0x71a3('0x35')]=_0x3fc578[_0x71a3('0x35')][_0x71a3('0x37')]?_0x3fc578['attributes']:_0x3ea7aa['model'];if(!_0x242b85[_0x71a3('0x31')][_0x71a3('0x38')]('nolimit')){_0x3fc578[_0x71a3('0x1d')]=qs[_0x71a3('0x1d')](_0x242b85['query'][_0x71a3('0x1d')]);_0x3fc578[_0x71a3('0x1b')]=qs[_0x71a3('0x1b')](_0x242b85[_0x71a3('0x31')][_0x71a3('0x1b')]);}_0x3fc578[_0x71a3('0x39')]=qs[_0x71a3('0x3a')](_0x242b85['query'][_0x71a3('0x3a')]);_0x3fc578[_0x71a3('0x3b')]=qs[_0x71a3('0x33')](_['pick'](_0x242b85[_0x71a3('0x31')],_0x3ea7aa[_0x71a3('0x33')]),_0x51cde3);if(_0x242b85[_0x71a3('0x31')][_0x71a3('0x3c')]){_0x3fc578[_0x71a3('0x3b')]=_['merge'](_0x3fc578['where'],{'$or':_[_0x71a3('0x2b')](_0x51cde3,function(_0x2b3197){if(_0x2b3197[_0x71a3('0x2e')]!==_0x71a3('0x3d')){var _0x36ed2e={};_0x36ed2e[_0x2b3197['name']]={'$like':'%'+_0x242b85[_0x71a3('0x31')][_0x71a3('0x3c')]+'%'};return _0x36ed2e;}})});}_0x3fc578=_[_0x71a3('0x3e')]({},_0x3fc578,_0x242b85['options']);var _0x17c467={'where':_0x3fc578['where']};return db[_0x71a3('0x2c')][_0x71a3('0x1e')](_0x17c467)[_0x71a3('0x24')](function(_0x43c6d1){_0x228afa[_0x71a3('0x1e')]=_0x43c6d1;if(_0x242b85[_0x71a3('0x31')][_0x71a3('0x3f')]){_0x3fc578[_0x71a3('0x40')]=[{'all':!![]}];}return db[_0x71a3('0x2c')][_0x71a3('0x41')](_0x3fc578);})['then'](function(_0xa49846){_0x228afa['rows']=_0xa49846;return _0x228afa;})[_0x71a3('0x24')](respondWithFilteredResult(_0x305eb1,_0x3fc578))[_0x71a3('0x42')](handleError(_0x305eb1,null));};exports[_0x71a3('0x43')]=function(_0x18974c,_0x59c7c9){var _0x412bce={'raw':![],'where':{'id':_0x18974c['params']['id']}},_0x4b4fde={};_0x4b4fde[_0x71a3('0x30')]=_[_0x71a3('0x32')](db[_0x71a3('0x2c')][_0x71a3('0x2d')]);_0x4b4fde['query']=_[_0x71a3('0x32')](_0x18974c[_0x71a3('0x31')]);_0x4b4fde[_0x71a3('0x33')]=_[_0x71a3('0x34')](_0x4b4fde[_0x71a3('0x30')],_0x4b4fde[_0x71a3('0x31')]);_0x412bce[_0x71a3('0x35')]=_[_0x71a3('0x34')](_0x4b4fde[_0x71a3('0x30')],qs[_0x71a3('0x36')](_0x18974c[_0x71a3('0x31')][_0x71a3('0x36')]));_0x412bce[_0x71a3('0x35')]=_0x412bce[_0x71a3('0x35')][_0x71a3('0x37')]?_0x412bce[_0x71a3('0x35')]:_0x4b4fde['model'];if(_0x18974c[_0x71a3('0x31')][_0x71a3('0x3f')]){_0x412bce['include']=[{'all':!![]}];}_0x412bce=_[_0x71a3('0x3e')]({},_0x412bce,_0x18974c[_0x71a3('0x44')]);return db[_0x71a3('0x2c')][_0x71a3('0x45')](_0x412bce)[_0x71a3('0x24')](handleEntityNotFound(_0x59c7c9,null))['then'](respondWithResult(_0x59c7c9,null))['catch'](handleError(_0x59c7c9,null));};exports[_0x71a3('0x46')]=function(_0x4305ee,_0x51d20d){return db[_0x71a3('0x2c')][_0x71a3('0x46')](_0x4305ee[_0x71a3('0x47')],{})[_0x71a3('0x24')](respondWithResult(_0x51d20d,0xc9))[_0x71a3('0x42')](handleError(_0x51d20d,null));};exports[_0x71a3('0x23')]=function(_0x501a62,_0x1c9ba6){if(_0x501a62['body']['id']){delete _0x501a62[_0x71a3('0x47')]['id'];}return db[_0x71a3('0x2c')][_0x71a3('0x45')]({'where':{'id':_0x501a62[_0x71a3('0x48')]['id']}})[_0x71a3('0x24')](handleEntityNotFound(_0x1c9ba6,null))['then'](saveUpdates(_0x501a62[_0x71a3('0x47')],null))[_0x71a3('0x24')](respondWithResult(_0x1c9ba6,null))[_0x71a3('0x42')](handleError(_0x1c9ba6,null));};exports['destroy']=function(_0x6c34,_0x4e6423){return db[_0x71a3('0x2c')][_0x71a3('0x45')]({'where':{'id':_0x6c34['params']['id']}})[_0x71a3('0x24')](handleEntityNotFound(_0x4e6423,null))[_0x71a3('0x24')](removeEntity(_0x4e6423,null))[_0x71a3('0x42')](handleError(_0x4e6423,null));}; \ No newline at end of file +var _0x1a37=['stack','name','send','index','map','Integration','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','VIRTUAL','merge','includeAll','include','findAll','catch','show','options','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error'];(function(_0x4dc7b9,_0x319d5a){var _0x3ab114=function(_0x51a9df){while(--_0x51a9df){_0x4dc7b9['push'](_0x4dc7b9['shift']());}};_0x3ab114(++_0x319d5a);}(_0x1a37,0xb4));var _0x71a3=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0x1a37[_0x50a0c2];return _0x5ebadd;};'use strict';var emlformat=require(_0x71a3('0x0'));var rimraf=require(_0x71a3('0x1'));var zipdir=require(_0x71a3('0x2'));var jsonpatch=require(_0x71a3('0x3'));var rp=require(_0x71a3('0x4'));var moment=require(_0x71a3('0x5'));var BPromise=require(_0x71a3('0x6'));var Mustache=require(_0x71a3('0x7'));var util=require(_0x71a3('0x8'));var path=require(_0x71a3('0x9'));var sox=require('sox');var csv=require(_0x71a3('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x71a3('0xb'));var _=require(_0x71a3('0xc'));var squel=require(_0x71a3('0xd'));var crypto=require(_0x71a3('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x71a3('0xf'));var Redis=require(_0x71a3('0x10'));var authService=require(_0x71a3('0x11'));var qs=require(_0x71a3('0x12'));var as=require(_0x71a3('0x13'));var hardwareService=require(_0x71a3('0x14'));var logger=require(_0x71a3('0x15'))(_0x71a3('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x71a3('0x17'))['db'];function respondWithStatusCode(_0x3830cb,_0x27e46d){_0x27e46d=_0x27e46d||0xcc;return function(_0x229134){if(_0x229134){return _0x3830cb[_0x71a3('0x18')](_0x27e46d);}return _0x3830cb[_0x71a3('0x19')](_0x27e46d)[_0x71a3('0x1a')]();};}function respondWithResult(_0x3b256c,_0x4dc4ed){_0x4dc4ed=_0x4dc4ed||0xc8;return function(_0x203ee1){if(_0x203ee1){return _0x3b256c[_0x71a3('0x19')](_0x4dc4ed)['json'](_0x203ee1);}};}function respondWithFilteredResult(_0x1743d7,_0x32591a){return function(_0x59021f){if(_0x59021f){var _0x4aa918=typeof _0x32591a[_0x71a3('0x1b')]===_0x71a3('0x1c')&&typeof _0x32591a[_0x71a3('0x1d')]===_0x71a3('0x1c');var _0x1af1bc=_0x59021f[_0x71a3('0x1e')];var _0x5d4dee=_0x4aa918?0x0:_0x32591a[_0x71a3('0x1b')];var _0x27bfb4=_0x4aa918?_0x59021f['count']:_0x32591a['offset']+_0x32591a[_0x71a3('0x1d')];var _0x250db3;if(_0x27bfb4>=_0x1af1bc){_0x27bfb4=_0x1af1bc;_0x250db3=0xc8;}else{_0x250db3=0xce;}_0x1743d7[_0x71a3('0x19')](_0x250db3);return _0x1743d7[_0x71a3('0x1f')](_0x71a3('0x20'),_0x5d4dee+'-'+_0x27bfb4+'/'+_0x1af1bc)['json'](_0x59021f);}return null;};}function patchUpdates(_0x1ab947){return function(_0x4156e1){try{jsonpatch[_0x71a3('0x21')](_0x4156e1,_0x1ab947,!![]);}catch(_0x3ea036){return BPromise[_0x71a3('0x22')](_0x3ea036);}return _0x4156e1['save']();};}function saveUpdates(_0x1af24b,_0x5bbaee){return function(_0x3bf78e){if(_0x3bf78e){return _0x3bf78e[_0x71a3('0x23')](_0x1af24b)[_0x71a3('0x24')](function(_0x21899d){return _0x21899d;});}return null;};}function removeEntity(_0x452bc4,_0x2847b4){return function(_0x5f33c5){if(_0x5f33c5){return _0x5f33c5[_0x71a3('0x25')]()[_0x71a3('0x24')](function(){_0x452bc4[_0x71a3('0x19')](0xcc)[_0x71a3('0x1a')]();});}};}function handleEntityNotFound(_0xb0f3aa,_0x4fd214){return function(_0x107fbd){if(!_0x107fbd){_0xb0f3aa[_0x71a3('0x18')](0x194);}return _0x107fbd;};}function handleError(_0x4c1a3d,_0x412746){_0x412746=_0x412746||0x1f4;return function(_0x515519){logger[_0x71a3('0x26')](_0x515519[_0x71a3('0x27')]);if(_0x515519[_0x71a3('0x28')]){delete _0x515519[_0x71a3('0x28')];}_0x4c1a3d[_0x71a3('0x19')](_0x412746)[_0x71a3('0x29')](_0x515519);};}exports[_0x71a3('0x2a')]=function(_0x242b85,_0x305eb1){var _0x3fc578={},_0x3ea7aa={},_0x228afa={'count':0x0,'rows':[]};var _0x51cde3=_[_0x71a3('0x2b')](db[_0x71a3('0x2c')][_0x71a3('0x2d')],function(_0x23ae85){return{'name':_0x23ae85['fieldName'],'type':_0x23ae85[_0x71a3('0x2e')][_0x71a3('0x2f')]};});_0x3ea7aa[_0x71a3('0x30')]=_[_0x71a3('0x2b')](_0x51cde3,_0x71a3('0x28'));_0x3ea7aa[_0x71a3('0x31')]=_[_0x71a3('0x32')](_0x242b85['query']);_0x3ea7aa[_0x71a3('0x33')]=_[_0x71a3('0x34')](_0x3ea7aa[_0x71a3('0x30')],_0x3ea7aa[_0x71a3('0x31')]);_0x3fc578[_0x71a3('0x35')]=_[_0x71a3('0x34')](_0x3ea7aa[_0x71a3('0x30')],qs[_0x71a3('0x36')](_0x242b85[_0x71a3('0x31')][_0x71a3('0x36')]));_0x3fc578[_0x71a3('0x35')]=_0x3fc578[_0x71a3('0x35')][_0x71a3('0x37')]?_0x3fc578['attributes']:_0x3ea7aa['model'];if(!_0x242b85[_0x71a3('0x31')][_0x71a3('0x38')]('nolimit')){_0x3fc578[_0x71a3('0x1d')]=qs[_0x71a3('0x1d')](_0x242b85['query'][_0x71a3('0x1d')]);_0x3fc578[_0x71a3('0x1b')]=qs[_0x71a3('0x1b')](_0x242b85[_0x71a3('0x31')][_0x71a3('0x1b')]);}_0x3fc578[_0x71a3('0x39')]=qs[_0x71a3('0x3a')](_0x242b85['query'][_0x71a3('0x3a')]);_0x3fc578[_0x71a3('0x3b')]=qs[_0x71a3('0x33')](_['pick'](_0x242b85[_0x71a3('0x31')],_0x3ea7aa[_0x71a3('0x33')]),_0x51cde3);if(_0x242b85[_0x71a3('0x31')][_0x71a3('0x3c')]){_0x3fc578[_0x71a3('0x3b')]=_['merge'](_0x3fc578['where'],{'$or':_[_0x71a3('0x2b')](_0x51cde3,function(_0x2b3197){if(_0x2b3197[_0x71a3('0x2e')]!==_0x71a3('0x3d')){var _0x36ed2e={};_0x36ed2e[_0x2b3197['name']]={'$like':'%'+_0x242b85[_0x71a3('0x31')][_0x71a3('0x3c')]+'%'};return _0x36ed2e;}})});}_0x3fc578=_[_0x71a3('0x3e')]({},_0x3fc578,_0x242b85['options']);var _0x17c467={'where':_0x3fc578['where']};return db[_0x71a3('0x2c')][_0x71a3('0x1e')](_0x17c467)[_0x71a3('0x24')](function(_0x43c6d1){_0x228afa[_0x71a3('0x1e')]=_0x43c6d1;if(_0x242b85[_0x71a3('0x31')][_0x71a3('0x3f')]){_0x3fc578[_0x71a3('0x40')]=[{'all':!![]}];}return db[_0x71a3('0x2c')][_0x71a3('0x41')](_0x3fc578);})['then'](function(_0xa49846){_0x228afa['rows']=_0xa49846;return _0x228afa;})[_0x71a3('0x24')](respondWithFilteredResult(_0x305eb1,_0x3fc578))[_0x71a3('0x42')](handleError(_0x305eb1,null));};exports[_0x71a3('0x43')]=function(_0x18974c,_0x59c7c9){var _0x412bce={'raw':![],'where':{'id':_0x18974c['params']['id']}},_0x4b4fde={};_0x4b4fde[_0x71a3('0x30')]=_[_0x71a3('0x32')](db[_0x71a3('0x2c')][_0x71a3('0x2d')]);_0x4b4fde['query']=_[_0x71a3('0x32')](_0x18974c[_0x71a3('0x31')]);_0x4b4fde[_0x71a3('0x33')]=_[_0x71a3('0x34')](_0x4b4fde[_0x71a3('0x30')],_0x4b4fde[_0x71a3('0x31')]);_0x412bce[_0x71a3('0x35')]=_[_0x71a3('0x34')](_0x4b4fde[_0x71a3('0x30')],qs[_0x71a3('0x36')](_0x18974c[_0x71a3('0x31')][_0x71a3('0x36')]));_0x412bce[_0x71a3('0x35')]=_0x412bce[_0x71a3('0x35')][_0x71a3('0x37')]?_0x412bce[_0x71a3('0x35')]:_0x4b4fde['model'];if(_0x18974c[_0x71a3('0x31')][_0x71a3('0x3f')]){_0x412bce['include']=[{'all':!![]}];}_0x412bce=_[_0x71a3('0x3e')]({},_0x412bce,_0x18974c[_0x71a3('0x44')]);return db[_0x71a3('0x2c')][_0x71a3('0x45')](_0x412bce)[_0x71a3('0x24')](handleEntityNotFound(_0x59c7c9,null))['then'](respondWithResult(_0x59c7c9,null))['catch'](handleError(_0x59c7c9,null));};exports[_0x71a3('0x46')]=function(_0x4305ee,_0x51d20d){return db[_0x71a3('0x2c')][_0x71a3('0x46')](_0x4305ee[_0x71a3('0x47')],{})[_0x71a3('0x24')](respondWithResult(_0x51d20d,0xc9))[_0x71a3('0x42')](handleError(_0x51d20d,null));};exports[_0x71a3('0x23')]=function(_0x501a62,_0x1c9ba6){if(_0x501a62['body']['id']){delete _0x501a62[_0x71a3('0x47')]['id'];}return db[_0x71a3('0x2c')][_0x71a3('0x45')]({'where':{'id':_0x501a62[_0x71a3('0x48')]['id']}})[_0x71a3('0x24')](handleEntityNotFound(_0x1c9ba6,null))['then'](saveUpdates(_0x501a62[_0x71a3('0x47')],null))[_0x71a3('0x24')](respondWithResult(_0x1c9ba6,null))[_0x71a3('0x42')](handleError(_0x1c9ba6,null));};exports['destroy']=function(_0x6c34,_0x4e6423){return db[_0x71a3('0x2c')][_0x71a3('0x45')]({'where':{'id':_0x6c34['params']['id']}})[_0x71a3('0x24')](handleEntityNotFound(_0x4e6423,null))[_0x71a3('0x24')](removeEntity(_0x4e6423,null))[_0x71a3('0x42')](handleError(_0x4e6423,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index 03560e4..b535ab1 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 _0x15f0=['../../config/environment','./integration.attributes','exports','define','Integration','integrations','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x2b0a72,_0x32c2dc){var _0x2b18dc=function(_0xee2a04){while(--_0xee2a04){_0x2b0a72['push'](_0x2b0a72['shift']());}};_0x2b18dc(++_0x32c2dc);}(_0x15f0,0xd2));var _0x015f=function(_0x4c12a7,_0x4012ee){_0x4c12a7=_0x4c12a7-0x0;var _0x53c190=_0x15f0[_0x4c12a7];return _0x53c190;};'use strict';var _=require('lodash');var util=require(_0x015f('0x0'));var logger=require(_0x015f('0x1'))('api');var moment=require(_0x015f('0x2'));var BPromise=require(_0x015f('0x3'));var rp=require(_0x015f('0x4'));var fs=require('fs');var path=require(_0x015f('0x5'));var rimraf=require('rimraf');var config=require(_0x015f('0x6'));var attributes=require(_0x015f('0x7'));module[_0x015f('0x8')]=function(_0x5c52b7,_0x2868cc){return _0x5c52b7[_0x015f('0x9')](_0x015f('0xa'),attributes,{'tableName':_0x015f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x053a=['path','rimraf','../../config/environment','./integration.attributes','exports','define','Integration','integrations','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x4dfd10,_0x3169d5){var _0x267950=function(_0x15b4ae){while(--_0x15b4ae){_0x4dfd10['push'](_0x4dfd10['shift']());}};_0x267950(++_0x3169d5);}(_0x053a,0x80));var _0xa053=function(_0x1ff97f,_0x3060d6){_0x1ff97f=_0x1ff97f-0x0;var _0x2404db=_0x053a[_0x1ff97f];return _0x2404db;};'use strict';var _=require(_0xa053('0x0'));var util=require(_0xa053('0x1'));var logger=require(_0xa053('0x2'))(_0xa053('0x3'));var moment=require(_0xa053('0x4'));var BPromise=require(_0xa053('0x5'));var rp=require(_0xa053('0x6'));var fs=require('fs');var path=require(_0xa053('0x7'));var rimraf=require(_0xa053('0x8'));var config=require(_0xa053('0x9'));var attributes=require(_0xa053('0xa'));module[_0xa053('0xb')]=function(_0x28c507,_0x57c5b3){return _0x28c507[_0xa053('0xc')](_0xa053('0xd'),attributes,{'tableName':_0xa053('0xe'),'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 1d95e9e..ce775e1 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 _0x66fa=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','then','info','Integration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','Integration,\x20%s,\x20%s','message','catch','lodash'];(function(_0x3bcf68,_0x939aa9){var _0x3895e9=function(_0x99804b){while(--_0x99804b){_0x3bcf68['push'](_0x3bcf68['shift']());}};_0x3895e9(++_0x939aa9);}(_0x66fa,0x117));var _0xa66f=function(_0x59df14,_0x17782a){_0x59df14=_0x59df14-0x0;var _0x47dca8=_0x66fa[_0x59df14];return _0x47dca8;};'use strict';var _=require(_0xa66f('0x0'));var util=require(_0xa66f('0x1'));var moment=require('moment');var BPromise=require(_0xa66f('0x2'));var rs=require(_0xa66f('0x3'));var fs=require('fs');var Redis=require(_0xa66f('0x4'));var db=require(_0xa66f('0x5'))['db'];var utils=require(_0xa66f('0x6'));var logger=require(_0xa66f('0x7'))(_0xa66f('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa66f('0x9')][_0xa66f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2f0b78,_0x1d02fc,_0x38b58b){return new BPromise(function(_0x5096bf,_0x39c1ef){return client['request'](_0x2f0b78,_0x38b58b)[_0xa66f('0xb')](function(_0x597c7c){logger[_0xa66f('0xc')]('Integration,\x20%s,\x20%s',_0x1d02fc,'request\x20sent');logger['debug'](_0xa66f('0xd'),_0x1d02fc,_0xa66f('0xe'),JSON['stringify'](_0x597c7c));if(_0x597c7c[_0xa66f('0xf')]){if(_0x597c7c['error'][_0xa66f('0x10')]===0x1f4){logger['error'](_0xa66f('0x11'),_0x1d02fc,_0x597c7c[_0xa66f('0xf')][_0xa66f('0x12')]);return _0x39c1ef(_0x597c7c['error']['message']);}logger[_0xa66f('0xf')]('Integration,\x20%s,\x20%s',_0x1d02fc,_0x597c7c['error']['message']);return _0x5096bf(_0x597c7c[_0xa66f('0xf')][_0xa66f('0x12')]);}else{logger[_0xa66f('0xc')](_0xa66f('0x11'),_0x1d02fc,_0xa66f('0xe'));_0x5096bf(_0x597c7c['result']['message']);}})[_0xa66f('0x13')](function(_0x32d338){logger[_0xa66f('0xf')](_0xa66f('0x11'),_0x1d02fc,_0x32d338);_0x39c1ef(_0x32d338);});});} \ No newline at end of file +var _0x14a0=['../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','then','debug','request\x20sent','stringify','error','code','Integration,\x20%s,\x20%s','message','info','result','catch','util','moment','bluebird','randomstring','ioredis'];(function(_0x1d79a1,_0x1c4bac){var _0x5e5ed1=function(_0xd39dd8){while(--_0xd39dd8){_0x1d79a1['push'](_0x1d79a1['shift']());}};_0x5e5ed1(++_0x1c4bac);}(_0x14a0,0x8e));var _0x014a=function(_0x52baac,_0x5ce776){_0x52baac=_0x52baac-0x0;var _0x20a146=_0x14a0[_0x52baac];return _0x20a146;};'use strict';var _=require('lodash');var util=require(_0x014a('0x0'));var moment=require(_0x014a('0x1'));var BPromise=require(_0x014a('0x2'));var rs=require(_0x014a('0x3'));var fs=require('fs');var Redis=require(_0x014a('0x4'));var db=require(_0x014a('0x5'))['db'];var utils=require(_0x014a('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x014a('0x7'));var jayson=require(_0x014a('0x8'));var client=jayson[_0x014a('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5a61ac,_0x11b8ce,_0x6d05f2){return new BPromise(function(_0x22f17c,_0x4d943b){return client['request'](_0x5a61ac,_0x6d05f2)[_0x014a('0xa')](function(_0x4f5506){logger['info']('Integration,\x20%s,\x20%s',_0x11b8ce,'request\x20sent');logger[_0x014a('0xb')]('Integration,\x20%s,\x20%s,\x20%s',_0x11b8ce,_0x014a('0xc'),JSON[_0x014a('0xd')](_0x4f5506));if(_0x4f5506['error']){if(_0x4f5506[_0x014a('0xe')][_0x014a('0xf')]===0x1f4){logger[_0x014a('0xe')](_0x014a('0x10'),_0x11b8ce,_0x4f5506[_0x014a('0xe')][_0x014a('0x11')]);return _0x4d943b(_0x4f5506[_0x014a('0xe')][_0x014a('0x11')]);}logger[_0x014a('0xe')](_0x014a('0x10'),_0x11b8ce,_0x4f5506[_0x014a('0xe')][_0x014a('0x11')]);return _0x22f17c(_0x4f5506['error'][_0x014a('0x11')]);}else{logger[_0x014a('0x12')]('Integration,\x20%s,\x20%s',_0x11b8ce,_0x014a('0xc'));_0x22f17c(_0x4f5506[_0x014a('0x13')]['message']);}})[_0x014a('0x14')](function(_0x17e4be){logger[_0x014a('0xe')](_0x014a('0x10'),_0x11b8ce,_0x17e4be);_0x4d943b(_0x17e4be);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index 9f5f660..b09205f 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 _0x66fa=['index','get','/describe','post','/:id','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated'];(function(_0x470cdd,_0x4708cd){var _0x57fda7=function(_0x171462){while(--_0x171462){_0x470cdd['push'](_0x470cdd['shift']());}};_0x57fda7(++_0x4708cd);}(_0x66fa,0x117));var _0xa66f=function(_0x266fa7,_0x18a146){_0x266fa7=_0x266fa7-0x0;var _0x10cd97=_0x66fa[_0x266fa7];return _0x10cd97;};'use strict';var multer=require(_0xa66f('0x0'));var util=require(_0xa66f('0x1'));var path=require('path');var timeout=require(_0xa66f('0x2'));var express=require(_0xa66f('0x3'));var router=express[_0xa66f('0x4')]();var fs_extra=require(_0xa66f('0x5'));var auth=require(_0xa66f('0x6'));var interaction=require(_0xa66f('0x7'));var config=require(_0xa66f('0x8'));var controller=require('./integrationReport.controller');router['get']('/',auth[_0xa66f('0x9')](),controller[_0xa66f('0xa')]);router[_0xa66f('0xb')](_0xa66f('0xc'),auth[_0xa66f('0x9')](),controller['describe']);router[_0xa66f('0xb')]('/:id',auth[_0xa66f('0x9')](),controller['show']);router[_0xa66f('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xa66f('0xe'),auth[_0xa66f('0x9')](),controller['update']);router[_0xa66f('0xf')]('/:id',auth[_0xa66f('0x9')](),controller['destroy']);module[_0xa66f('0x10')]=router; \ No newline at end of file +var _0x6d38=['path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./integrationReport.controller','isAuthenticated','index','get','/describe','/:id','create','update','destroy','exports','util'];(function(_0x5f545a,_0x469ca9){var _0x1db569=function(_0x5bcb06){while(--_0x5bcb06){_0x5f545a['push'](_0x5f545a['shift']());}};_0x1db569(++_0x469ca9);}(_0x6d38,0x1ef));var _0x86d3=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x6d38[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require('multer');var util=require(_0x86d3('0x0'));var path=require(_0x86d3('0x1'));var timeout=require(_0x86d3('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x86d3('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x86d3('0x4'));var config=require(_0x86d3('0x5'));var controller=require(_0x86d3('0x6'));router['get']('/',auth[_0x86d3('0x7')](),controller[_0x86d3('0x8')]);router[_0x86d3('0x9')](_0x86d3('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x86d3('0x9')](_0x86d3('0xb'),auth[_0x86d3('0x7')](),controller['show']);router['post']('/',auth[_0x86d3('0x7')](),controller[_0x86d3('0xc')]);router['put']('/:id',auth[_0x86d3('0x7')](),controller[_0x86d3('0xd')]);router['delete'](_0x86d3('0xb'),auth['isAuthenticated'](),controller[_0x86d3('0xe')]);module[_0x86d3('0xf')]=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index d587dc0..8a62353 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 _0xcf7e=['exports','STRING','INTEGER','DATE','BOOLEAN','TEXT','SENT','SENDING','RECEIVED','FAILED'];(function(_0x37a79c,_0x2b19f0){var _0x561d89=function(_0x19bee3){while(--_0x19bee3){_0x37a79c['push'](_0x37a79c['shift']());}};_0x561d89(++_0x2b19f0);}(_0xcf7e,0x1e0));var _0xecf7=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xcf7e[_0x4b369d];return _0x571a98;};'use strict';var Sequelize=require('sequelize');module[_0xecf7('0x0')]={'integration':{'type':Sequelize[_0xecf7('0x1')]},'eventChannel':{'type':Sequelize[_0xecf7('0x1')]},'exitStatus':{'type':Sequelize[_0xecf7('0x1')]},'ticketId':{'type':Sequelize['STRING']},'integrationId':{'type':Sequelize[_0xecf7('0x2')]},'contacts':{'type':Sequelize[_0xecf7('0x1')]},'uniqueid':{'type':Sequelize[_0xecf7('0x1')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xecf7('0x1')]},'queue':{'type':Sequelize[_0xecf7('0x1')]},'interface':{'type':Sequelize[_0xecf7('0x1')]},'membername':{'type':Sequelize[_0xecf7('0x1')]},'agentcalledAt':{'type':Sequelize[_0xecf7('0x3')]},'agentconnectAt':{'type':Sequelize[_0xecf7('0x3')]},'holdtime':{'type':Sequelize[_0xecf7('0x2')]},'agentcomplete':{'type':Sequelize[_0xecf7('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0xecf7('0x3')]},'talktime':{'type':Sequelize[_0xecf7('0x2')]},'agentacw':{'type':Sequelize[_0xecf7('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xecf7('0x2')]},'reason':{'type':Sequelize[_0xecf7('0x1')]},'agentringnoanswer':{'type':Sequelize[_0xecf7('0x4')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdump':{'type':Sequelize[_0xecf7('0x4')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0xecf7('0x3')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xecf7('0x1')]},'channelstate':{'type':Sequelize[_0xecf7('0x2')]},'channelstatedesc':{'type':Sequelize[_0xecf7('0x1')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0xecf7('0x1')]},'language':{'type':Sequelize[_0xecf7('0x1')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xecf7('0x1')]},'exten':{'type':Sequelize[_0xecf7('0x1')]},'priority':{'type':Sequelize[_0xecf7('0x1')]},'destchannel':{'type':Sequelize[_0xecf7('0x1')]},'destchannelstate':{'type':Sequelize[_0xecf7('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0xecf7('0x1')]},'destcalleridnum':{'type':Sequelize[_0xecf7('0x1')]},'destcalleridname':{'type':Sequelize[_0xecf7('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0xecf7('0x1')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0xecf7('0x1')]},'destaccountcode':{'type':Sequelize[_0xecf7('0x1')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0xecf7('0x1')]},'destuniqueid':{'type':Sequelize[_0xecf7('0x1')]},'messageId':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0xecf7('0x1')]},'subject':{'type':Sequelize[_0xecf7('0x1')]},'from':{'type':Sequelize[_0xecf7('0x1')]},'to':{'type':Sequelize[_0xecf7('0x1')]},'cc':{'type':Sequelize[_0xecf7('0x1')]},'attachment':{'type':Sequelize[_0xecf7('0x5')]},'html':{'type':Sequelize[_0xecf7('0x5')]},'text':{'type':Sequelize[_0xecf7('0x5')]},'status':{'type':Sequelize['ENUM'](_0xecf7('0x6'),_0xecf7('0x7'),_0xecf7('0x8'),_0xecf7('0x9'))},'url':{'type':Sequelize[_0xecf7('0x1')]},'app':{'type':Sequelize[_0xecf7('0x1')]},'appdata':{'type':Sequelize['STRING']},'projectId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x9fb1=['INTEGER','DATE','BOOLEAN','TEXT','ENUM','SENT','SENDING','RECEIVED','FAILED','sequelize','exports','STRING'];(function(_0x42c5e0,_0x1b292b){var _0x5a26eb=function(_0x500306){while(--_0x500306){_0x42c5e0['push'](_0x42c5e0['shift']());}};_0x5a26eb(++_0x1b292b);}(_0x9fb1,0x11d));var _0x19fb=function(_0x47aa64,_0xfb8a07){_0x47aa64=_0x47aa64-0x0;var _0x549c7a=_0x9fb1[_0x47aa64];return _0x549c7a;};'use strict';var Sequelize=require(_0x19fb('0x0'));module[_0x19fb('0x1')]={'integration':{'type':Sequelize[_0x19fb('0x2')]},'eventChannel':{'type':Sequelize[_0x19fb('0x2')]},'exitStatus':{'type':Sequelize[_0x19fb('0x2')]},'ticketId':{'type':Sequelize[_0x19fb('0x2')]},'integrationId':{'type':Sequelize[_0x19fb('0x3')]},'contacts':{'type':Sequelize[_0x19fb('0x2')]},'uniqueid':{'type':Sequelize[_0x19fb('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x19fb('0x2')]},'interface':{'type':Sequelize[_0x19fb('0x2')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0x19fb('0x4')]},'agentconnectAt':{'type':Sequelize[_0x19fb('0x4')]},'holdtime':{'type':Sequelize[_0x19fb('0x3')]},'agentcomplete':{'type':Sequelize[_0x19fb('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x19fb('0x4')]},'talktime':{'type':Sequelize[_0x19fb('0x3')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x19fb('0x3')]},'reason':{'type':Sequelize[_0x19fb('0x2')]},'agentringnoanswer':{'type':Sequelize[_0x19fb('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x19fb('0x4')]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x19fb('0x4')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x19fb('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x19fb('0x2')]},'connectedlinenum':{'type':Sequelize[_0x19fb('0x2')]},'connectedlinename':{'type':Sequelize[_0x19fb('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x19fb('0x2')]},'exten':{'type':Sequelize[_0x19fb('0x2')]},'priority':{'type':Sequelize[_0x19fb('0x2')]},'destchannel':{'type':Sequelize[_0x19fb('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0x19fb('0x2')]},'destcalleridnum':{'type':Sequelize[_0x19fb('0x2')]},'destcalleridname':{'type':Sequelize[_0x19fb('0x2')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x19fb('0x2')]},'destaccountcode':{'type':Sequelize[_0x19fb('0x2')]},'destcontext':{'type':Sequelize[_0x19fb('0x2')]},'destexten':{'type':Sequelize[_0x19fb('0x2')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0x19fb('0x2')]},'messageId':{'type':Sequelize[_0x19fb('0x2')]},'inReplyTo':{'type':Sequelize[_0x19fb('0x2')]},'subject':{'type':Sequelize['STRING']},'from':{'type':Sequelize[_0x19fb('0x2')]},'to':{'type':Sequelize[_0x19fb('0x2')]},'cc':{'type':Sequelize[_0x19fb('0x2')]},'attachment':{'type':Sequelize[_0x19fb('0x6')]},'html':{'type':Sequelize[_0x19fb('0x6')]},'text':{'type':Sequelize[_0x19fb('0x6')]},'status':{'type':Sequelize[_0x19fb('0x7')](_0x19fb('0x8'),_0x19fb('0x9'),_0x19fb('0xa'),_0x19fb('0xb'))},'url':{'type':Sequelize['STRING']},'app':{'type':Sequelize[_0x19fb('0x2')]},'appdata':{'type':Sequelize[_0x19fb('0x2')]},'projectId':{'type':Sequelize[_0x19fb('0x3')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index 33f1a6e..431d4c7 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 _0x18e3=['index','map','IntegrationReport','rawAttributes','fieldName','model','name','keys','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','findAll','rows','catch','show','params','intersection','includeAll','include','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','undefined','limit','count','offset','Content-Range','update','then','destroy','sendStatus','stack','send'];(function(_0x383fc8,_0x47bb81){var _0x50982a=function(_0x23249e){while(--_0x23249e){_0x383fc8['push'](_0x383fc8['shift']());}};_0x50982a(++_0x47bb81);}(_0x18e3,0x6d));var _0x318e=function(_0x4c4042,_0x1ea485){_0x4c4042=_0x4c4042-0x0;var _0xbd10dc=_0x18e3[_0x4c4042];return _0xbd10dc;};'use strict';var emlformat=require(_0x318e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x318e('0x1'));var jsonpatch=require(_0x318e('0x2'));var rp=require(_0x318e('0x3'));var moment=require(_0x318e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x318e('0x5'));var util=require(_0x318e('0x6'));var path=require(_0x318e('0x7'));var sox=require(_0x318e('0x8'));var csv=require('to-csv');var ejs=require(_0x318e('0x9'));var fs=require('fs');var fs_extra=require(_0x318e('0xa'));var _=require(_0x318e('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x318e('0xc'));var deskjs=require(_0x318e('0xd'));var toCsv=require(_0x318e('0xe'));var querystring=require(_0x318e('0xf'));var Papa=require(_0x318e('0x10'));var Redis=require(_0x318e('0x11'));var authService=require(_0x318e('0x12'));var qs=require(_0x318e('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x318e('0x14'));var logger=require(_0x318e('0x15'))('api');var utils=require(_0x318e('0x16'));var config=require(_0x318e('0x17'));var licenseUtil=require(_0x318e('0x18'));var db=require(_0x318e('0x19'))['db'];function respondWithStatusCode(_0x36de7d,_0x5924ae){_0x5924ae=_0x5924ae||0xcc;return function(_0x161280){if(_0x161280){return _0x36de7d['sendStatus'](_0x5924ae);}return _0x36de7d['status'](_0x5924ae)['end']();};}function respondWithResult(_0x5b3067,_0x3c5df9){_0x3c5df9=_0x3c5df9||0xc8;return function(_0xb746b9){if(_0xb746b9){return _0x5b3067[_0x318e('0x1a')](_0x3c5df9)[_0x318e('0x1b')](_0xb746b9);}};}function respondWithFilteredResult(_0xebcfea,_0xd5c169){return function(_0x4794a6){if(_0x4794a6){var _0x25ad6e=typeof _0xd5c169['offset']===_0x318e('0x1c')&&typeof _0xd5c169[_0x318e('0x1d')]==='undefined';var _0x5e07d4=_0x4794a6[_0x318e('0x1e')];var _0x41be21=_0x25ad6e?0x0:_0xd5c169[_0x318e('0x1f')];var _0x59c5d7=_0x25ad6e?_0x4794a6[_0x318e('0x1e')]:_0xd5c169[_0x318e('0x1f')]+_0xd5c169[_0x318e('0x1d')];var _0x335319;if(_0x59c5d7>=_0x5e07d4){_0x59c5d7=_0x5e07d4;_0x335319=0xc8;}else{_0x335319=0xce;}_0xebcfea[_0x318e('0x1a')](_0x335319);return _0xebcfea['set'](_0x318e('0x20'),_0x41be21+'-'+_0x59c5d7+'/'+_0x5e07d4)['json'](_0x4794a6);}return null;};}function patchUpdates(_0x2f5b19){return function(_0x155a6a){try{jsonpatch['apply'](_0x155a6a,_0x2f5b19,!![]);}catch(_0x2358cf){return BPromise['reject'](_0x2358cf);}return _0x155a6a['save']();};}function saveUpdates(_0x16cb7e,_0x6c7079){return function(_0x447b43){if(_0x447b43){return _0x447b43[_0x318e('0x21')](_0x16cb7e)[_0x318e('0x22')](function(_0x4c72d5){return _0x4c72d5;});}return null;};}function removeEntity(_0x1a15fe,_0x147dee){return function(_0xb72c94){if(_0xb72c94){return _0xb72c94[_0x318e('0x23')]()['then'](function(){_0x1a15fe[_0x318e('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x500b5d,_0x439bbf){return function(_0x47c40f){if(!_0x47c40f){_0x500b5d[_0x318e('0x24')](0x194);}return _0x47c40f;};}function handleError(_0xceca03,_0x49be89){_0x49be89=_0x49be89||0x1f4;return function(_0x49f44a){logger['error'](_0x49f44a[_0x318e('0x25')]);if(_0x49f44a['name']){delete _0x49f44a['name'];}_0xceca03[_0x318e('0x1a')](_0x49be89)[_0x318e('0x26')](_0x49f44a);};}exports[_0x318e('0x27')]=function(_0x293b12,_0x576109){var _0xbbaa02={},_0x271ccb={},_0x33bc0c={'count':0x0,'rows':[]};var _0x48d371=_[_0x318e('0x28')](db[_0x318e('0x29')][_0x318e('0x2a')],function(_0x40c446){return{'name':_0x40c446[_0x318e('0x2b')],'type':_0x40c446['type']['key']};});_0x271ccb[_0x318e('0x2c')]=_[_0x318e('0x28')](_0x48d371,_0x318e('0x2d'));_0x271ccb['query']=_[_0x318e('0x2e')](_0x293b12[_0x318e('0x2f')]);_0x271ccb[_0x318e('0x30')]=_['intersection'](_0x271ccb[_0x318e('0x2c')],_0x271ccb[_0x318e('0x2f')]);_0xbbaa02[_0x318e('0x31')]=_['intersection'](_0x271ccb[_0x318e('0x2c')],qs[_0x318e('0x32')](_0x293b12[_0x318e('0x2f')]['fields']));_0xbbaa02[_0x318e('0x31')]=_0xbbaa02[_0x318e('0x31')][_0x318e('0x33')]?_0xbbaa02['attributes']:_0x271ccb[_0x318e('0x2c')];if(!_0x293b12[_0x318e('0x2f')][_0x318e('0x34')](_0x318e('0x35'))){_0xbbaa02[_0x318e('0x1d')]=qs['limit'](_0x293b12[_0x318e('0x2f')][_0x318e('0x1d')]);_0xbbaa02[_0x318e('0x1f')]=qs['offset'](_0x293b12[_0x318e('0x2f')][_0x318e('0x1f')]);}_0xbbaa02[_0x318e('0x36')]=qs[_0x318e('0x37')](_0x293b12['query'][_0x318e('0x37')]);_0xbbaa02[_0x318e('0x38')]=qs['filters'](_[_0x318e('0x39')](_0x293b12[_0x318e('0x2f')],_0x271ccb[_0x318e('0x30')]),_0x48d371);if(_0x293b12[_0x318e('0x2f')]['filter']){_0xbbaa02[_0x318e('0x38')]=_[_0x318e('0x3a')](_0xbbaa02[_0x318e('0x38')],{'$or':_[_0x318e('0x28')](_0x48d371,function(_0xfacc7d){if(_0xfacc7d['type']!==_0x318e('0x3b')){var _0x3a0eff={};_0x3a0eff[_0xfacc7d[_0x318e('0x2d')]]={'$like':'%'+_0x293b12[_0x318e('0x2f')][_0x318e('0x3c')]+'%'};return _0x3a0eff;}})});}_0xbbaa02=_[_0x318e('0x3a')]({},_0xbbaa02,_0x293b12[_0x318e('0x3d')]);var _0x51704c={'where':_0xbbaa02[_0x318e('0x38')]};return db[_0x318e('0x29')]['count'](_0x51704c)[_0x318e('0x22')](function(_0x29414f){_0x33bc0c[_0x318e('0x1e')]=_0x29414f;if(_0x293b12[_0x318e('0x2f')]['includeAll']){_0xbbaa02['include']=[{'all':!![]}];}return db[_0x318e('0x29')][_0x318e('0x3e')](_0xbbaa02);})[_0x318e('0x22')](function(_0xa76edc){_0x33bc0c[_0x318e('0x3f')]=_0xa76edc;return _0x33bc0c;})[_0x318e('0x22')](respondWithFilteredResult(_0x576109,_0xbbaa02))[_0x318e('0x40')](handleError(_0x576109,null));};exports[_0x318e('0x41')]=function(_0x916bb6,_0x2ca5e0){var _0x803673={'raw':![],'where':{'id':_0x916bb6[_0x318e('0x42')]['id']}},_0x14b90d={};_0x14b90d[_0x318e('0x2c')]=_[_0x318e('0x2e')](db['IntegrationReport']['rawAttributes']);_0x14b90d['query']=_['keys'](_0x916bb6['query']);_0x14b90d[_0x318e('0x30')]=_[_0x318e('0x43')](_0x14b90d[_0x318e('0x2c')],_0x14b90d[_0x318e('0x2f')]);_0x803673['attributes']=_[_0x318e('0x43')](_0x14b90d['model'],qs[_0x318e('0x32')](_0x916bb6[_0x318e('0x2f')][_0x318e('0x32')]));_0x803673[_0x318e('0x31')]=_0x803673['attributes'][_0x318e('0x33')]?_0x803673[_0x318e('0x31')]:_0x14b90d[_0x318e('0x2c')];if(_0x916bb6[_0x318e('0x2f')][_0x318e('0x44')]){_0x803673[_0x318e('0x45')]=[{'all':!![]}];}_0x803673=_['merge']({},_0x803673,_0x916bb6[_0x318e('0x3d')]);return db['IntegrationReport'][_0x318e('0x46')](_0x803673)[_0x318e('0x22')](handleEntityNotFound(_0x2ca5e0,null))['then'](respondWithResult(_0x2ca5e0,null))['catch'](handleError(_0x2ca5e0,null));};exports[_0x318e('0x47')]=function(_0x6eb3dc,_0x3b5ea7){return db[_0x318e('0x29')]['create'](_0x6eb3dc[_0x318e('0x48')],{})[_0x318e('0x22')](respondWithResult(_0x3b5ea7,0xc9))[_0x318e('0x40')](handleError(_0x3b5ea7,null));};exports[_0x318e('0x21')]=function(_0x381e57,_0x57c241){if(_0x381e57[_0x318e('0x48')]['id']){delete _0x381e57['body']['id'];}return db['IntegrationReport']['find']({'where':{'id':_0x381e57[_0x318e('0x42')]['id']}})[_0x318e('0x22')](handleEntityNotFound(_0x57c241,null))[_0x318e('0x22')](saveUpdates(_0x381e57[_0x318e('0x48')],null))[_0x318e('0x22')](respondWithResult(_0x57c241,null))[_0x318e('0x40')](handleError(_0x57c241,null));};exports[_0x318e('0x23')]=function(_0xe84249,_0x4ee692){return db[_0x318e('0x29')]['find']({'where':{'id':_0xe84249[_0x318e('0x42')]['id']}})[_0x318e('0x22')](handleEntityNotFound(_0x4ee692,null))[_0x318e('0x22')](removeEntity(_0x4ee692,null))['catch'](handleError(_0x4ee692,null));};exports[_0x318e('0x49')]=function(_0x167c89,_0x154e27){return db[_0x318e('0x29')][_0x318e('0x49')]()[_0x318e('0x22')](respondWithResult(_0x154e27,null))[_0x318e('0x40')](handleError(_0x154e27,null));}; \ No newline at end of file +var _0xcf8e=['../../config/license/util','../../mysqldb','status','end','undefined','limit','count','Content-Range','json','reject','save','update','destroy','then','error','stack','name','send','map','IntegrationReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','rows','params','fields','find','catch','create','body','describe','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment'];(function(_0x3f8df4,_0x50b2f0){var _0x240d3e=function(_0x5f182f){while(--_0x5f182f){_0x3f8df4['push'](_0x3f8df4['shift']());}};_0x240d3e(++_0x50b2f0);}(_0xcf8e,0x190));var _0xecf8=function(_0x910eae,_0x35919c){_0x910eae=_0x910eae-0x0;var _0x1c9dc9=_0xcf8e[_0x910eae];return _0x1c9dc9;};'use strict';var emlformat=require(_0xecf8('0x0'));var rimraf=require(_0xecf8('0x1'));var zipdir=require(_0xecf8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xecf8('0x3'));var BPromise=require(_0xecf8('0x4'));var Mustache=require(_0xecf8('0x5'));var util=require(_0xecf8('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xecf8('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xecf8('0x8'));var squel=require(_0xecf8('0x9'));var crypto=require(_0xecf8('0xa'));var jsforce=require(_0xecf8('0xb'));var deskjs=require(_0xecf8('0xc'));var toCsv=require(_0xecf8('0x7'));var querystring=require(_0xecf8('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xecf8('0xe'));var qs=require(_0xecf8('0xf'));var as=require(_0xecf8('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xecf8('0x11'))('api');var utils=require(_0xecf8('0x12'));var config=require(_0xecf8('0x13'));var licenseUtil=require(_0xecf8('0x14'));var db=require(_0xecf8('0x15'))['db'];function respondWithStatusCode(_0x122bf0,_0x3ce924){_0x3ce924=_0x3ce924||0xcc;return function(_0x325e2c){if(_0x325e2c){return _0x122bf0['sendStatus'](_0x3ce924);}return _0x122bf0[_0xecf8('0x16')](_0x3ce924)[_0xecf8('0x17')]();};}function respondWithResult(_0x4bf88a,_0x2cf09b){_0x2cf09b=_0x2cf09b||0xc8;return function(_0x1cc008){if(_0x1cc008){return _0x4bf88a[_0xecf8('0x16')](_0x2cf09b)['json'](_0x1cc008);}};}function respondWithFilteredResult(_0x5a0f68,_0x1849f8){return function(_0x44ba68){if(_0x44ba68){var _0x46d180=typeof _0x1849f8['offset']===_0xecf8('0x18')&&typeof _0x1849f8[_0xecf8('0x19')]===_0xecf8('0x18');var _0x5203a1=_0x44ba68['count'];var _0xbbc4e0=_0x46d180?0x0:_0x1849f8['offset'];var _0x267c96=_0x46d180?_0x44ba68[_0xecf8('0x1a')]:_0x1849f8['offset']+_0x1849f8[_0xecf8('0x19')];var _0x3805d5;if(_0x267c96>=_0x5203a1){_0x267c96=_0x5203a1;_0x3805d5=0xc8;}else{_0x3805d5=0xce;}_0x5a0f68[_0xecf8('0x16')](_0x3805d5);return _0x5a0f68['set'](_0xecf8('0x1b'),_0xbbc4e0+'-'+_0x267c96+'/'+_0x5203a1)[_0xecf8('0x1c')](_0x44ba68);}return null;};}function patchUpdates(_0x910deb){return function(_0x56411f){try{jsonpatch['apply'](_0x56411f,_0x910deb,!![]);}catch(_0x26c043){return BPromise[_0xecf8('0x1d')](_0x26c043);}return _0x56411f[_0xecf8('0x1e')]();};}function saveUpdates(_0x4aa65d,_0x54f4c9){return function(_0xae1212){if(_0xae1212){return _0xae1212[_0xecf8('0x1f')](_0x4aa65d)['then'](function(_0x6fbb87){return _0x6fbb87;});}return null;};}function removeEntity(_0x46f2c7,_0x1a1dc8){return function(_0x40bc53){if(_0x40bc53){return _0x40bc53[_0xecf8('0x20')]()[_0xecf8('0x21')](function(){_0x46f2c7['status'](0xcc)[_0xecf8('0x17')]();});}};}function handleEntityNotFound(_0x47dab6,_0x3fded0){return function(_0x3df814){if(!_0x3df814){_0x47dab6['sendStatus'](0x194);}return _0x3df814;};}function handleError(_0x45ad84,_0x4ca855){_0x4ca855=_0x4ca855||0x1f4;return function(_0x51f188){logger[_0xecf8('0x22')](_0x51f188[_0xecf8('0x23')]);if(_0x51f188[_0xecf8('0x24')]){delete _0x51f188['name'];}_0x45ad84['status'](_0x4ca855)[_0xecf8('0x25')](_0x51f188);};}exports['index']=function(_0x2179c7,_0x59c91a){var _0x3b4495={},_0x5c684c={},_0x26d11c={'count':0x0,'rows':[]};var _0x28b9c2=_[_0xecf8('0x26')](db[_0xecf8('0x27')][_0xecf8('0x28')],function(_0x427d1c){return{'name':_0x427d1c['fieldName'],'type':_0x427d1c[_0xecf8('0x29')][_0xecf8('0x2a')]};});_0x5c684c[_0xecf8('0x2b')]=_[_0xecf8('0x26')](_0x28b9c2,_0xecf8('0x24'));_0x5c684c[_0xecf8('0x2c')]=_[_0xecf8('0x2d')](_0x2179c7[_0xecf8('0x2c')]);_0x5c684c[_0xecf8('0x2e')]=_[_0xecf8('0x2f')](_0x5c684c[_0xecf8('0x2b')],_0x5c684c[_0xecf8('0x2c')]);_0x3b4495[_0xecf8('0x30')]=_[_0xecf8('0x2f')](_0x5c684c['model'],qs['fields'](_0x2179c7['query']['fields']));_0x3b4495['attributes']=_0x3b4495['attributes'][_0xecf8('0x31')]?_0x3b4495[_0xecf8('0x30')]:_0x5c684c[_0xecf8('0x2b')];if(!_0x2179c7[_0xecf8('0x2c')][_0xecf8('0x32')](_0xecf8('0x33'))){_0x3b4495['limit']=qs[_0xecf8('0x19')](_0x2179c7[_0xecf8('0x2c')]['limit']);_0x3b4495['offset']=qs['offset'](_0x2179c7[_0xecf8('0x2c')][_0xecf8('0x34')]);}_0x3b4495[_0xecf8('0x35')]=qs[_0xecf8('0x36')](_0x2179c7[_0xecf8('0x2c')]['sort']);_0x3b4495[_0xecf8('0x37')]=qs[_0xecf8('0x2e')](_[_0xecf8('0x38')](_0x2179c7[_0xecf8('0x2c')],_0x5c684c[_0xecf8('0x2e')]),_0x28b9c2);if(_0x2179c7['query']['filter']){_0x3b4495['where']=_[_0xecf8('0x39')](_0x3b4495[_0xecf8('0x37')],{'$or':_['map'](_0x28b9c2,function(_0x5ef775){if(_0x5ef775[_0xecf8('0x29')]!==_0xecf8('0x3a')){var _0x1a7fca={};_0x1a7fca[_0x5ef775[_0xecf8('0x24')]]={'$like':'%'+_0x2179c7[_0xecf8('0x2c')]['filter']+'%'};return _0x1a7fca;}})});}_0x3b4495=_['merge']({},_0x3b4495,_0x2179c7[_0xecf8('0x3b')]);var _0x3c69bf={'where':_0x3b4495['where']};return db[_0xecf8('0x27')]['count'](_0x3c69bf)[_0xecf8('0x21')](function(_0x5bdfd7){_0x26d11c['count']=_0x5bdfd7;if(_0x2179c7[_0xecf8('0x2c')][_0xecf8('0x3c')]){_0x3b4495[_0xecf8('0x3d')]=[{'all':!![]}];}return db[_0xecf8('0x27')]['findAll'](_0x3b4495);})[_0xecf8('0x21')](function(_0x1297ff){_0x26d11c[_0xecf8('0x3e')]=_0x1297ff;return _0x26d11c;})[_0xecf8('0x21')](respondWithFilteredResult(_0x59c91a,_0x3b4495))['catch'](handleError(_0x59c91a,null));};exports['show']=function(_0x5ca633,_0x3f1453){var _0x511c8b={'raw':![],'where':{'id':_0x5ca633[_0xecf8('0x3f')]['id']}},_0x53f1e1={};_0x53f1e1['model']=_[_0xecf8('0x2d')](db['IntegrationReport'][_0xecf8('0x28')]);_0x53f1e1[_0xecf8('0x2c')]=_[_0xecf8('0x2d')](_0x5ca633[_0xecf8('0x2c')]);_0x53f1e1[_0xecf8('0x2e')]=_[_0xecf8('0x2f')](_0x53f1e1['model'],_0x53f1e1[_0xecf8('0x2c')]);_0x511c8b['attributes']=_[_0xecf8('0x2f')](_0x53f1e1[_0xecf8('0x2b')],qs[_0xecf8('0x40')](_0x5ca633[_0xecf8('0x2c')][_0xecf8('0x40')]));_0x511c8b['attributes']=_0x511c8b[_0xecf8('0x30')][_0xecf8('0x31')]?_0x511c8b[_0xecf8('0x30')]:_0x53f1e1['model'];if(_0x5ca633['query'][_0xecf8('0x3c')]){_0x511c8b[_0xecf8('0x3d')]=[{'all':!![]}];}_0x511c8b=_[_0xecf8('0x39')]({},_0x511c8b,_0x5ca633['options']);return db[_0xecf8('0x27')][_0xecf8('0x41')](_0x511c8b)['then'](handleEntityNotFound(_0x3f1453,null))['then'](respondWithResult(_0x3f1453,null))[_0xecf8('0x42')](handleError(_0x3f1453,null));};exports[_0xecf8('0x43')]=function(_0x21fdda,_0x11d394){return db[_0xecf8('0x27')]['create'](_0x21fdda[_0xecf8('0x44')],{})[_0xecf8('0x21')](respondWithResult(_0x11d394,0xc9))[_0xecf8('0x42')](handleError(_0x11d394,null));};exports[_0xecf8('0x1f')]=function(_0x232ee0,_0x1f6e44){if(_0x232ee0[_0xecf8('0x44')]['id']){delete _0x232ee0[_0xecf8('0x44')]['id'];}return db['IntegrationReport']['find']({'where':{'id':_0x232ee0[_0xecf8('0x3f')]['id']}})[_0xecf8('0x21')](handleEntityNotFound(_0x1f6e44,null))['then'](saveUpdates(_0x232ee0[_0xecf8('0x44')],null))['then'](respondWithResult(_0x1f6e44,null))[_0xecf8('0x42')](handleError(_0x1f6e44,null));};exports[_0xecf8('0x20')]=function(_0x197a3f,_0x45b8a0){return db[_0xecf8('0x27')][_0xecf8('0x41')]({'where':{'id':_0x197a3f[_0xecf8('0x3f')]['id']}})['then'](handleEntityNotFound(_0x45b8a0,null))[_0xecf8('0x21')](removeEntity(_0x45b8a0,null))[_0xecf8('0x42')](handleError(_0x45b8a0,null));};exports[_0xecf8('0x45')]=function(_0x4af035,_0x9993d0){return db[_0xecf8('0x27')]['describe']()[_0xecf8('0x21')](respondWithResult(_0x9993d0,null))[_0xecf8('0x42')](handleError(_0x9993d0,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index c3b846e..d4ac033 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 _0x61d0=['exports','define','IntegrationReport','report_integration','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./integrationReport.attributes'];(function(_0x646626,_0x25218b){var _0x199795=function(_0x448aac){while(--_0x448aac){_0x646626['push'](_0x646626['shift']());}};_0x199795(++_0x25218b);}(_0x61d0,0x74));var _0x061d=function(_0x2ce9c3,_0x20a165){_0x2ce9c3=_0x2ce9c3-0x0;var _0x109b3a=_0x61d0[_0x2ce9c3];return _0x109b3a;};'use strict';var _=require(_0x061d('0x0'));var util=require(_0x061d('0x1'));var logger=require(_0x061d('0x2'))(_0x061d('0x3'));var moment=require('moment');var BPromise=require(_0x061d('0x4'));var rp=require(_0x061d('0x5'));var fs=require('fs');var path=require(_0x061d('0x6'));var rimraf=require(_0x061d('0x7'));var config=require(_0x061d('0x8'));var attributes=require(_0x061d('0x9'));module[_0x061d('0xa')]=function(_0x378c8d,_0x54047b){return _0x378c8d[_0x061d('0xb')](_0x061d('0xc'),attributes,{'tableName':_0x061d('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1a1d=['IntegrationReport','lodash','api','moment','bluebird','request-promise','path','../../config/environment','./integrationReport.attributes','exports','define'];(function(_0x312a3d,_0x1e7969){var _0x5da650=function(_0x6a86ea){while(--_0x6a86ea){_0x312a3d['push'](_0x312a3d['shift']());}};_0x5da650(++_0x1e7969);}(_0x1a1d,0x109));var _0xd1a1=function(_0x4720f5,_0x1c50bf){_0x4720f5=_0x4720f5-0x0;var _0x5d3224=_0x1a1d[_0x4720f5];return _0x5d3224;};'use strict';var _=require(_0xd1a1('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xd1a1('0x1'));var moment=require(_0xd1a1('0x2'));var BPromise=require(_0xd1a1('0x3'));var rp=require(_0xd1a1('0x4'));var fs=require('fs');var path=require(_0xd1a1('0x5'));var rimraf=require('rimraf');var config=require(_0xd1a1('0x6'));var attributes=require(_0xd1a1('0x7'));module[_0xd1a1('0x8')]=function(_0x429814,_0x413a04){return _0x429814[_0xd1a1('0x9')](_0xd1a1('0xa'),attributes,{'tableName':'report_integration','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 7f00ff5..1e9247f 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 _0x326f=['info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x8634ef,_0x21ee99){var _0x17d77e=function(_0xeaa3a7){while(--_0xeaa3a7){_0x8634ef['push'](_0x8634ef['shift']());}};_0x17d77e(++_0x21ee99);}(_0x326f,0xd1));var _0xf326=function(_0x1486cc,_0x3fadaf){_0x1486cc=_0x1486cc-0x0;var _0x53c274=_0x326f[_0x1486cc];return _0x53c274;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf326('0x1'));var rs=require(_0xf326('0x2'));var fs=require('fs');var Redis=require(_0xf326('0x3'));var db=require(_0xf326('0x4'))['db'];var utils=require(_0xf326('0x5'));var logger=require(_0xf326('0x6'))(_0xf326('0x7'));var config=require(_0xf326('0x8'));var jayson=require(_0xf326('0x9'));var client=jayson[_0xf326('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c254d,_0x3851eb,_0x165f95){return new BPromise(function(_0x1e7b8a,_0x515bfa){return client['request'](_0x3c254d,_0x165f95)['then'](function(_0x3bacf2){logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));logger[_0xf326('0xe')]('IntegrationReport,\x20%s,\x20%s,\x20%s',_0x3851eb,_0xf326('0xd'),JSON['stringify'](_0x3bacf2));if(_0x3bacf2[_0xf326('0xf')]){if(_0x3bacf2['error'][_0xf326('0x10')]===0x1f4){logger['error'](_0xf326('0xc'),_0x3851eb,_0x3bacf2[_0xf326('0xf')]['message']);return _0x515bfa(_0x3bacf2[_0xf326('0xf')][_0xf326('0x11')]);}logger[_0xf326('0xf')](_0xf326('0xc'),_0x3851eb,_0x3bacf2['error'][_0xf326('0x11')]);return _0x1e7b8a(_0x3bacf2['error']['message']);}else{logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));_0x1e7b8a(_0x3bacf2[_0xf326('0x12')][_0xf326('0x11')]);}})[_0xf326('0x13')](function(_0x34128e){logger[_0xf326('0xf')]('IntegrationReport,\x20%s,\x20%s',_0x3851eb,_0x34128e);_0x515bfa(_0x34128e);});});} \ No newline at end of file +var _0x7a54=['info','IntegrationReport,\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(_0xc1983d,_0x28fdcd){_0xc1983d=_0xc1983d-0x0;var _0x3956fb=_0x7a54[_0xc1983d];return _0x3956fb;};'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')]('IntegrationReport,\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/interval/index.js b/server/api/interval/index.js index 542cbc5..f9a661c 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 _0xb97c=['get','isAuthenticated','/:id','show','/:id/sub_intervals','getIntervals','create','addInterval','post','/:id/sub_intervals/create_many','addIntervals','update','delete','destroy','exports','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./interval.controller'];(function(_0x5a800f,_0xafc842){var _0x3ba58a=function(_0x43896b){while(--_0x43896b){_0x5a800f['push'](_0x5a800f['shift']());}};_0x3ba58a(++_0xafc842);}(_0xb97c,0x19b));var _0xcb97=function(_0x68cec5,_0x1701af){_0x68cec5=_0x68cec5-0x0;var _0x20aca8=_0xb97c[_0x68cec5];return _0x20aca8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xcb97('0x0'));var timeout=require(_0xcb97('0x1'));var express=require(_0xcb97('0x2'));var router=express[_0xcb97('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xcb97('0x4'));var config=require(_0xcb97('0x5'));var controller=require(_0xcb97('0x6'));router[_0xcb97('0x7')]('/',auth[_0xcb97('0x8')](),controller['index']);router[_0xcb97('0x7')](_0xcb97('0x9'),auth[_0xcb97('0x8')](),controller[_0xcb97('0xa')]);router[_0xcb97('0x7')](_0xcb97('0xb'),auth[_0xcb97('0x8')](),controller[_0xcb97('0xc')]);router['post']('/',auth[_0xcb97('0x8')](),controller[_0xcb97('0xd')]);router['post'](_0xcb97('0xb'),auth[_0xcb97('0x8')](),controller[_0xcb97('0xe')]);router[_0xcb97('0xf')](_0xcb97('0x10'),auth[_0xcb97('0x8')](),controller[_0xcb97('0x11')]);router['put'](_0xcb97('0x9'),auth[_0xcb97('0x8')](),controller[_0xcb97('0x12')]);router[_0xcb97('0x13')](_0xcb97('0x9'),auth['isAuthenticated'](),controller[_0xcb97('0x14')]);module[_0xcb97('0x15')]=router; \ No newline at end of file +var _0x8343=['exports','multer','util','path','express','fs-extra','./interval.controller','get','isAuthenticated','/:id','show','getIntervals','post','create','/:id/sub_intervals','/:id/sub_intervals/create_many','addIntervals','put','update','delete','destroy'];(function(_0x420951,_0x528d19){var _0x8a0fd5=function(_0x48b4af){while(--_0x48b4af){_0x420951['push'](_0x420951['shift']());}};_0x8a0fd5(++_0x528d19);}(_0x8343,0xa9));var _0x3834=function(_0x149eaa,_0x526c54){_0x149eaa=_0x149eaa-0x0;var _0x48fd5e=_0x8343[_0x149eaa];return _0x48fd5e;};'use strict';var multer=require(_0x3834('0x0'));var util=require(_0x3834('0x1'));var path=require(_0x3834('0x2'));var timeout=require('connect-timeout');var express=require(_0x3834('0x3'));var router=express['Router']();var fs_extra=require(_0x3834('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x3834('0x5'));router[_0x3834('0x6')]('/',auth[_0x3834('0x7')](),controller['index']);router[_0x3834('0x6')](_0x3834('0x8'),auth[_0x3834('0x7')](),controller[_0x3834('0x9')]);router['get']('/:id/sub_intervals',auth[_0x3834('0x7')](),controller[_0x3834('0xa')]);router[_0x3834('0xb')]('/',auth[_0x3834('0x7')](),controller[_0x3834('0xc')]);router['post'](_0x3834('0xd'),auth['isAuthenticated'](),controller['addInterval']);router['post'](_0x3834('0xe'),auth[_0x3834('0x7')](),controller[_0x3834('0xf')]);router[_0x3834('0x10')](_0x3834('0x8'),auth[_0x3834('0x7')](),controller[_0x3834('0x11')]);router[_0x3834('0x12')](_0x3834('0x8'),auth[_0x3834('0x7')](),controller[_0x3834('0x13')]);module[_0x3834('0x14')]=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index 6ea97fe..400bb07 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 _0x4a08=['sequelize','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4a08,0x6c));var _0x84a0=function(_0x10a8cd,_0x105731){_0x10a8cd=_0x10a8cd-0x0;var _0x3291e7=_0x4a08[_0x10a8cd];return _0x3291e7;};'use strict';var Sequelize=require(_0x84a0('0x0'));module[_0x84a0('0x1')]={'name':{'type':Sequelize[_0x84a0('0x2')]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x84a0('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0x56f2=['STRING','sequelize','exports'];(function(_0x1587c7,_0x5bbff4){var _0x42cc4f=function(_0x36bb87){while(--_0x36bb87){_0x1587c7['push'](_0x1587c7['shift']());}};_0x42cc4f(++_0x5bbff4);}(_0x56f2,0xc4));var _0x256f=function(_0x5b7070,_0x2ef3e9){_0x5b7070=_0x5b7070-0x0;var _0x582712=_0x56f2[_0x5b7070];return _0x582712;};'use strict';var Sequelize=require(_0x256f('0x0'));module[_0x256f('0x1')]={'name':{'type':Sequelize[_0x256f('0x2')]},'description':{'type':Sequelize[_0x256f('0x2')]},'interval':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index b8b1a3a..339981d 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 _0xc826=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','get','Intervals','UserProfileResource','stack','name','send','index','map','Interval','rawAttributes','fieldName','type','key','model','query','keys','attributes','fields','length','nolimit','sort','where','filters','merge','filter','options','include','findAll','rows','catch','params','intersection','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addInterval','IntervalId','findOne','pick','getIntervals','hasOwnProperty','sequelize','transaction','bulkCreate','eml-format'];(function(_0x4ec183,_0x7df02a){var _0x4c5595=function(_0x18e9ea){while(--_0x18e9ea){_0x4ec183['push'](_0x4ec183['shift']());}};_0x4c5595(++_0x7df02a);}(_0xc826,0x11c));var _0x6c82=function(_0x40ad96,_0x2b5151){_0x40ad96=_0x40ad96-0x0;var _0xe54d71=_0xc826[_0x40ad96];return _0xe54d71;};'use strict';var emlformat=require(_0x6c82('0x0'));var rimraf=require(_0x6c82('0x1'));var zipdir=require(_0x6c82('0x2'));var jsonpatch=require(_0x6c82('0x3'));var rp=require(_0x6c82('0x4'));var moment=require(_0x6c82('0x5'));var BPromise=require(_0x6c82('0x6'));var Mustache=require(_0x6c82('0x7'));var util=require(_0x6c82('0x8'));var path=require(_0x6c82('0x9'));var sox=require(_0x6c82('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6c82('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x6c82('0xc'));var jsforce=require(_0x6c82('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x6c82('0xe'));var querystring=require(_0x6c82('0xf'));var Papa=require(_0x6c82('0x10'));var Redis=require(_0x6c82('0x11'));var authService=require(_0x6c82('0x12'));var qs=require(_0x6c82('0x13'));var as=require(_0x6c82('0x14'));var hardwareService=require(_0x6c82('0x15'));var logger=require(_0x6c82('0x16'))(_0x6c82('0x17'));var utils=require(_0x6c82('0x18'));var config=require(_0x6c82('0x19'));var licenseUtil=require(_0x6c82('0x1a'));var db=require(_0x6c82('0x1b'))['db'];var extensions=require(_0x6c82('0x1c'));function respondWithStatusCode(_0x19ccb1,_0x407a6f){_0x407a6f=_0x407a6f||0xcc;return function(_0x53e5a4){if(_0x53e5a4){return _0x19ccb1[_0x6c82('0x1d')](_0x407a6f);}return _0x19ccb1[_0x6c82('0x1e')](_0x407a6f)[_0x6c82('0x1f')]();};}function respondWithResult(_0x549fad,_0x3664f0){_0x3664f0=_0x3664f0||0xc8;return function(_0x1489b9){if(_0x1489b9){return _0x549fad[_0x6c82('0x1e')](_0x3664f0)['json'](_0x1489b9);}};}function respondWithFilteredResult(_0x590d56,_0x46e445){return function(_0x1caa78){if(_0x1caa78){var _0x19e3de=typeof _0x46e445[_0x6c82('0x20')]===_0x6c82('0x21')&&typeof _0x46e445[_0x6c82('0x22')]==='undefined';var _0x490608=_0x1caa78['count'];var _0x3ef90b=_0x19e3de?0x0:_0x46e445['offset'];var _0x362edb=_0x19e3de?_0x1caa78[_0x6c82('0x23')]:_0x46e445[_0x6c82('0x20')]+_0x46e445['limit'];var _0x78a6f9;if(_0x362edb>=_0x490608){_0x362edb=_0x490608;_0x78a6f9=0xc8;}else{_0x78a6f9=0xce;}_0x590d56[_0x6c82('0x1e')](_0x78a6f9);return _0x590d56[_0x6c82('0x24')](_0x6c82('0x25'),_0x3ef90b+'-'+_0x362edb+'/'+_0x490608)[_0x6c82('0x26')](_0x1caa78);}return null;};}function patchUpdates(_0x109293){return function(_0x95c27e){try{jsonpatch[_0x6c82('0x27')](_0x95c27e,_0x109293,!![]);}catch(_0x5bd987){return BPromise[_0x6c82('0x28')](_0x5bd987);}return _0x95c27e[_0x6c82('0x29')]();};}function saveUpdates(_0x47fb60,_0x794400){return function(_0x2e3406){if(_0x2e3406){return _0x2e3406[_0x6c82('0x2a')](_0x47fb60)[_0x6c82('0x2b')](function(_0x3922b1){return _0x3922b1;});}return null;};}function removeEntity(_0x472831,_0x55e670){return function(_0x3272fa){if(_0x3272fa){return _0x3272fa[_0x6c82('0x2c')]()[_0x6c82('0x2b')](function(){var _0x475209=_0x3272fa[_0x6c82('0x2d')]({'plain':!![]});var _0x57fe66=_0x6c82('0x2e');return db[_0x6c82('0x2f')]['destroy']({'where':{'type':_0x57fe66,'resourceId':_0x475209['id']}})[_0x6c82('0x2b')](function(){return _0x3272fa;});})['then'](function(){_0x472831[_0x6c82('0x1e')](0xcc)[_0x6c82('0x1f')]();});}};}function handleEntityNotFound(_0x4d6783,_0xb9c408){return function(_0x2bcd39){if(!_0x2bcd39){_0x4d6783[_0x6c82('0x1d')](0x194);}return _0x2bcd39;};}function handleError(_0x8a6e8f,_0x234e6c){_0x234e6c=_0x234e6c||0x1f4;return function(_0x28ed0a){logger['error'](_0x28ed0a[_0x6c82('0x30')]);if(_0x28ed0a['name']){delete _0x28ed0a[_0x6c82('0x31')];}_0x8a6e8f[_0x6c82('0x1e')](_0x234e6c)[_0x6c82('0x32')](_0x28ed0a);};}exports[_0x6c82('0x33')]=function(_0x203137,_0x2f8e01){var _0x5660e2={},_0x20bef0={},_0x2e2d23={'count':0x0,'rows':[]};var _0x48cb1b=_[_0x6c82('0x34')](db[_0x6c82('0x35')][_0x6c82('0x36')],function(_0x529d9b){return{'name':_0x529d9b[_0x6c82('0x37')],'type':_0x529d9b[_0x6c82('0x38')][_0x6c82('0x39')]};});_0x20bef0[_0x6c82('0x3a')]=_[_0x6c82('0x34')](_0x48cb1b,_0x6c82('0x31'));_0x20bef0[_0x6c82('0x3b')]=_[_0x6c82('0x3c')](_0x203137[_0x6c82('0x3b')]);_0x20bef0['filters']=_['intersection'](_0x20bef0[_0x6c82('0x3a')],_0x20bef0['query']);_0x5660e2[_0x6c82('0x3d')]=_['intersection'](_0x20bef0[_0x6c82('0x3a')],qs[_0x6c82('0x3e')](_0x203137['query'][_0x6c82('0x3e')]));_0x5660e2['attributes']=_0x5660e2[_0x6c82('0x3d')][_0x6c82('0x3f')]?_0x5660e2[_0x6c82('0x3d')]:_0x20bef0[_0x6c82('0x3a')];if(!_0x203137[_0x6c82('0x3b')]['hasOwnProperty'](_0x6c82('0x40'))){_0x5660e2[_0x6c82('0x22')]=qs[_0x6c82('0x22')](_0x203137['query'][_0x6c82('0x22')]);_0x5660e2[_0x6c82('0x20')]=qs[_0x6c82('0x20')](_0x203137[_0x6c82('0x3b')][_0x6c82('0x20')]);}_0x5660e2['order']=qs['sort'](_0x203137[_0x6c82('0x3b')][_0x6c82('0x41')]);_0x5660e2[_0x6c82('0x42')]=qs[_0x6c82('0x43')](_['pick'](_0x203137[_0x6c82('0x3b')],_0x20bef0[_0x6c82('0x43')]),_0x48cb1b);if(_0x203137[_0x6c82('0x3b')]['filter']){_0x5660e2[_0x6c82('0x42')]=_[_0x6c82('0x44')](_0x5660e2['where'],{'$or':_['map'](_0x48cb1b,function(_0x4a51b1){if(_0x4a51b1[_0x6c82('0x38')]!=='VIRTUAL'){var _0x4b5179={};_0x4b5179[_0x4a51b1[_0x6c82('0x31')]]={'$like':'%'+_0x203137[_0x6c82('0x3b')][_0x6c82('0x45')]+'%'};return _0x4b5179;}})});}_0x5660e2=_[_0x6c82('0x44')]({},_0x5660e2,_0x203137[_0x6c82('0x46')]);var _0xebda86={'where':_0x5660e2[_0x6c82('0x42')]};return db[_0x6c82('0x35')][_0x6c82('0x23')](_0xebda86)['then'](function(_0x1ebc62){_0x2e2d23[_0x6c82('0x23')]=_0x1ebc62;if(_0x203137[_0x6c82('0x3b')]['includeAll']){_0x5660e2[_0x6c82('0x47')]=[{'all':!![]}];}return db[_0x6c82('0x35')][_0x6c82('0x48')](_0x5660e2);})[_0x6c82('0x2b')](function(_0x48ac3c){_0x2e2d23[_0x6c82('0x49')]=_0x48ac3c;return _0x2e2d23;})[_0x6c82('0x2b')](respondWithFilteredResult(_0x2f8e01,_0x5660e2))[_0x6c82('0x4a')](handleError(_0x2f8e01,null));};exports['show']=function(_0x4e653a,_0x1d1a16){var _0x4a4740={'raw':!![],'where':{'id':_0x4e653a[_0x6c82('0x4b')]['id']}},_0x2afb4d={};_0x2afb4d[_0x6c82('0x3a')]=_[_0x6c82('0x3c')](db[_0x6c82('0x35')][_0x6c82('0x36')]);_0x2afb4d[_0x6c82('0x3b')]=_['keys'](_0x4e653a['query']);_0x2afb4d['filters']=_[_0x6c82('0x4c')](_0x2afb4d[_0x6c82('0x3a')],_0x2afb4d[_0x6c82('0x3b')]);_0x4a4740[_0x6c82('0x3d')]=_[_0x6c82('0x4c')](_0x2afb4d[_0x6c82('0x3a')],qs['fields'](_0x4e653a[_0x6c82('0x3b')][_0x6c82('0x3e')]));_0x4a4740[_0x6c82('0x3d')]=_0x4a4740[_0x6c82('0x3d')][_0x6c82('0x3f')]?_0x4a4740[_0x6c82('0x3d')]:_0x2afb4d['model'];if(_0x4e653a[_0x6c82('0x3b')]['includeAll']){_0x4a4740[_0x6c82('0x47')]=[{'all':!![]}];}_0x4a4740=_[_0x6c82('0x44')]({},_0x4a4740,_0x4e653a[_0x6c82('0x46')]);return db[_0x6c82('0x35')][_0x6c82('0x4d')](_0x4a4740)[_0x6c82('0x2b')](handleEntityNotFound(_0x1d1a16,null))['then'](respondWithResult(_0x1d1a16,null))[_0x6c82('0x4a')](handleError(_0x1d1a16,null));};exports['create']=function(_0x314db0,_0x4b3d6b){return db['Interval'][_0x6c82('0x4e')](_0x314db0[_0x6c82('0x4f')],{})[_0x6c82('0x2b')](function(_0x36888){var _0x11701b=_0x314db0['user'][_0x6c82('0x2d')]({'plain':!![]});if(!_0x11701b)throw new Error(_0x6c82('0x50'));if(_0x11701b[_0x6c82('0x51')]==='user'){var _0x3ea526=_0x36888[_0x6c82('0x2d')]({'plain':!![]});var _0x321329=_0x6c82('0x2e');return db[_0x6c82('0x52')][_0x6c82('0x4d')]({'where':{'name':_0x321329,'userProfileId':_0x11701b['userProfileId']},'raw':!![]})[_0x6c82('0x2b')](function(_0x48991f){if(_0x48991f&&_0x48991f[_0x6c82('0x53')]===0x0){return db['UserProfileResource'][_0x6c82('0x4e')]({'name':_0x3ea526[_0x6c82('0x31')],'resourceId':_0x3ea526['id'],'type':_0x48991f[_0x6c82('0x31')],'sectionId':_0x48991f['id']},{})['then'](function(){return _0x36888;});}else{return _0x36888;}})['catch'](function(_0x5364b9){logger[_0x6c82('0x54')](_0x6c82('0x55'),_0x5364b9);throw _0x5364b9;});}return _0x36888;})['then'](respondWithResult(_0x4b3d6b,0xc9))[_0x6c82('0x4a')](handleError(_0x4b3d6b,null));};exports['update']=function(_0x3c40aa,_0x1c79e0){if(_0x3c40aa[_0x6c82('0x4f')]['id']){delete _0x3c40aa[_0x6c82('0x4f')]['id'];}return db['Interval'][_0x6c82('0x4d')]({'where':{'id':_0x3c40aa[_0x6c82('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1c79e0,null))[_0x6c82('0x2b')](saveUpdates(_0x3c40aa['body'],null))[_0x6c82('0x2b')](respondWithResult(_0x1c79e0,null))[_0x6c82('0x4a')](handleError(_0x1c79e0,null));};exports[_0x6c82('0x2c')]=function(_0x1a9318,_0x1ba817){return db[_0x6c82('0x35')]['find']({'where':{'id':_0x1a9318[_0x6c82('0x4b')]['id']}})[_0x6c82('0x2b')](handleEntityNotFound(_0x1ba817,null))['then'](removeEntity(_0x1ba817,null))[_0x6c82('0x4a')](handleError(_0x1ba817,null));};exports[_0x6c82('0x56')]=function(_0x26ad60,_0x315742,_0x292b97){if(_0x26ad60['body']['id']){delete _0x26ad60['body']['id'];}return db['Interval']['find']({'where':{'id':_0x26ad60[_0x6c82('0x4b')]['id']}})['then'](handleEntityNotFound(_0x315742,null))[_0x6c82('0x2b')](function(_0x32c262){if(_0x32c262){_0x26ad60[_0x6c82('0x4f')][_0x6c82('0x57')]=_0x32c262['id'];return db['Interval'][_0x6c82('0x4e')](_0x26ad60[_0x6c82('0x4f')]);}})[_0x6c82('0x2b')](respondWithResult(_0x315742,null))[_0x6c82('0x4a')](handleError(_0x315742,null));};exports['getIntervals']=function(_0x5c23e4,_0x4f2c9b,_0xf6a1a1){var _0x10eedc={};var _0x4bbeda={};var _0x5bdfda;var _0x26bbb7;return db['Interval'][_0x6c82('0x58')]({'where':{'id':_0x5c23e4[_0x6c82('0x4b')]['id']}})[_0x6c82('0x2b')](handleEntityNotFound(_0x4f2c9b,null))['then'](function(_0x24b32c){if(_0x24b32c){_0x5bdfda=_0x24b32c;_0x4bbeda['model']=_[_0x6c82('0x3c')](db[_0x6c82('0x35')]['rawAttributes']);_0x4bbeda[_0x6c82('0x3b')]=_[_0x6c82('0x3c')](_0x5c23e4[_0x6c82('0x3b')]);_0x4bbeda[_0x6c82('0x43')]=_['intersection'](_0x4bbeda[_0x6c82('0x3a')],_0x4bbeda[_0x6c82('0x3b')]);_0x10eedc[_0x6c82('0x3d')]=_[_0x6c82('0x4c')](_0x4bbeda[_0x6c82('0x3a')],qs['fields'](_0x5c23e4[_0x6c82('0x3b')]['fields']));_0x10eedc[_0x6c82('0x3d')]=_0x10eedc[_0x6c82('0x3d')][_0x6c82('0x3f')]?_0x10eedc[_0x6c82('0x3d')]:_0x4bbeda['model'];_0x10eedc['order']=qs['sort'](_0x5c23e4[_0x6c82('0x3b')][_0x6c82('0x41')]);_0x10eedc[_0x6c82('0x42')]=qs[_0x6c82('0x43')](_[_0x6c82('0x59')](_0x5c23e4[_0x6c82('0x3b')],_0x4bbeda[_0x6c82('0x43')]));if(_0x5c23e4[_0x6c82('0x3b')][_0x6c82('0x45')]){_0x10eedc[_0x6c82('0x42')]=_[_0x6c82('0x44')](_0x10eedc[_0x6c82('0x42')],{'$or':_[_0x6c82('0x34')](_0x10eedc['attributes'],function(_0x4f9a29){var _0xa72ec6={};_0xa72ec6[_0x4f9a29]={'$like':'%'+_0x5c23e4[_0x6c82('0x3b')][_0x6c82('0x45')]+'%'};return _0xa72ec6;})});}_0x10eedc=_[_0x6c82('0x44')]({},_0x10eedc,_0x5c23e4['options']);return _0x5bdfda[_0x6c82('0x5a')](_0x10eedc);}})[_0x6c82('0x2b')](function(_0x2708d4){if(_0x2708d4){_0x26bbb7=_0x2708d4[_0x6c82('0x3f')];if(!_0x5c23e4[_0x6c82('0x3b')][_0x6c82('0x5b')](_0x6c82('0x40'))){_0x10eedc[_0x6c82('0x22')]=qs['limit'](_0x5c23e4[_0x6c82('0x3b')][_0x6c82('0x22')]);_0x10eedc[_0x6c82('0x20')]=qs[_0x6c82('0x20')](_0x5c23e4['query']['offset']);}return _0x5bdfda[_0x6c82('0x5a')](_0x10eedc);}})[_0x6c82('0x2b')](function(_0x29ba0e){if(_0x29ba0e){return _0x29ba0e?{'count':_0x26bbb7,'rows':_0x29ba0e}:null;}})['then'](respondWithResult(_0x4f2c9b,null))[_0x6c82('0x4a')](handleError(_0x4f2c9b,null));};exports['addIntervals']=function(_0x4e94c7,_0x3a7180,_0x38e09b){return db[_0x6c82('0x35')]['findOne']({'where':{'id':_0x4e94c7[_0x6c82('0x4b')]['id']}})[_0x6c82('0x2b')](handleEntityNotFound(_0x3a7180,null))['then'](function(_0x3e1924){if(_0x3e1924){return db[_0x6c82('0x5c')][_0x6c82('0x5d')](function(_0x42d36f){return db['Interval']['destroy']({'where':{'IntervalId':_0x4e94c7[_0x6c82('0x4b')]['id']},'transaction':_0x42d36f})['then'](function(_0x25885a){var _0x3660c4=_[_0x6c82('0x34')](_0x4e94c7[_0x6c82('0x4f')],function(_0x324cd0){delete _0x324cd0['id'];_0x324cd0['IntervalId']=_0x4e94c7[_0x6c82('0x4b')]['id'];return _0x324cd0;});return db['Interval'][_0x6c82('0x5e')](_0x3660c4,{'transaction':_0x42d36f});});})['then'](function(){return db[_0x6c82('0x35')][_0x6c82('0x48')]({'where':{'IntervalId':_0x4e94c7[_0x6c82('0x4b')]['id']}});});}})[_0x6c82('0x2b')](respondWithResult(_0x3a7180,null))[_0x6c82('0x4a')](handleError(_0x3a7180,null));}; \ No newline at end of file +var _0x2402=['intersection','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','options','Interval','includeAll','include','findAll','rows','show','rawAttributes','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Intervals','UserProfileSection','userProfileId','UserProfileResource','catch','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','addInterval','getIntervals','order','addIntervals','sequelize','transaction','IntervalId','bulkCreate','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','../../components/extensions/rewrite','sendStatus','end','status','offset','limit','undefined','count','Content-Range','apply','reject','update','destroy','then','stack','name','index','type','key','model','map','query','keys','attributes'];(function(_0x819464,_0x46fc91){var _0x49dcc0=function(_0x36b2b2){while(--_0x36b2b2){_0x819464['push'](_0x819464['shift']());}};_0x49dcc0(++_0x46fc91);}(_0x2402,0x84));var _0x2240=function(_0xe38118,_0x2b4c34){_0xe38118=_0xe38118-0x0;var _0x2d6e91=_0x2402[_0xe38118];return _0x2d6e91;};'use strict';var emlformat=require(_0x2240('0x0'));var rimraf=require(_0x2240('0x1'));var zipdir=require(_0x2240('0x2'));var jsonpatch=require(_0x2240('0x3'));var rp=require(_0x2240('0x4'));var moment=require('moment');var BPromise=require(_0x2240('0x5'));var Mustache=require(_0x2240('0x6'));var util=require('util');var path=require(_0x2240('0x7'));var sox=require(_0x2240('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2240('0x9'));var _=require(_0x2240('0xa'));var squel=require(_0x2240('0xb'));var crypto=require('crypto');var jsforce=require(_0x2240('0xc'));var deskjs=require(_0x2240('0xd'));var toCsv=require('to-csv');var querystring=require(_0x2240('0xe'));var Papa=require(_0x2240('0xf'));var Redis=require(_0x2240('0x10'));var authService=require(_0x2240('0x11'));var qs=require(_0x2240('0x12'));var as=require(_0x2240('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2240('0x14'))('api');var utils=require(_0x2240('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x2240('0x16'));var db=require(_0x2240('0x17'))['db'];var extensions=require(_0x2240('0x18'));function respondWithStatusCode(_0x3b306a,_0x86c5f2){_0x86c5f2=_0x86c5f2||0xcc;return function(_0x478d7e){if(_0x478d7e){return _0x3b306a[_0x2240('0x19')](_0x86c5f2);}return _0x3b306a['status'](_0x86c5f2)[_0x2240('0x1a')]();};}function respondWithResult(_0x1d4e63,_0xf7b89c){_0xf7b89c=_0xf7b89c||0xc8;return function(_0x4b8462){if(_0x4b8462){return _0x1d4e63[_0x2240('0x1b')](_0xf7b89c)['json'](_0x4b8462);}};}function respondWithFilteredResult(_0xf4904,_0xa6b5b3){return function(_0x5711fc){if(_0x5711fc){var _0x2017b9=typeof _0xa6b5b3[_0x2240('0x1c')]==='undefined'&&typeof _0xa6b5b3[_0x2240('0x1d')]===_0x2240('0x1e');var _0x53ad9c=_0x5711fc[_0x2240('0x1f')];var _0x58bee8=_0x2017b9?0x0:_0xa6b5b3[_0x2240('0x1c')];var _0x3d3d3e=_0x2017b9?_0x5711fc[_0x2240('0x1f')]:_0xa6b5b3[_0x2240('0x1c')]+_0xa6b5b3[_0x2240('0x1d')];var _0x2cd6b5;if(_0x3d3d3e>=_0x53ad9c){_0x3d3d3e=_0x53ad9c;_0x2cd6b5=0xc8;}else{_0x2cd6b5=0xce;}_0xf4904[_0x2240('0x1b')](_0x2cd6b5);return _0xf4904['set'](_0x2240('0x20'),_0x58bee8+'-'+_0x3d3d3e+'/'+_0x53ad9c)['json'](_0x5711fc);}return null;};}function patchUpdates(_0xb4636c){return function(_0x5892bc){try{jsonpatch[_0x2240('0x21')](_0x5892bc,_0xb4636c,!![]);}catch(_0x1fd84a){return BPromise[_0x2240('0x22')](_0x1fd84a);}return _0x5892bc['save']();};}function saveUpdates(_0x5608ca,_0x1f8553){return function(_0x294e00){if(_0x294e00){return _0x294e00[_0x2240('0x23')](_0x5608ca)['then'](function(_0x57f026){return _0x57f026;});}return null;};}function removeEntity(_0x418304,_0x533585){return function(_0x53b222){if(_0x53b222){return _0x53b222[_0x2240('0x24')]()[_0x2240('0x25')](function(){var _0x1ed8b4=_0x53b222['get']({'plain':!![]});var _0xf662e4='Intervals';return db['UserProfileResource'][_0x2240('0x24')]({'where':{'type':_0xf662e4,'resourceId':_0x1ed8b4['id']}})[_0x2240('0x25')](function(){return _0x53b222;});})[_0x2240('0x25')](function(){_0x418304[_0x2240('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x24784a,_0x41368d){return function(_0xa7a877){if(!_0xa7a877){_0x24784a[_0x2240('0x19')](0x194);}return _0xa7a877;};}function handleError(_0x5481cc,_0x4f5eb9){_0x4f5eb9=_0x4f5eb9||0x1f4;return function(_0x40a7a5){logger['error'](_0x40a7a5[_0x2240('0x26')]);if(_0x40a7a5[_0x2240('0x27')]){delete _0x40a7a5[_0x2240('0x27')];}_0x5481cc['status'](_0x4f5eb9)['send'](_0x40a7a5);};}exports[_0x2240('0x28')]=function(_0x53c141,_0x2a0363){var _0x1affda={},_0x117543={},_0xf3e13={'count':0x0,'rows':[]};var _0x1240d2=_['map'](db['Interval']['rawAttributes'],function(_0x360f5b){return{'name':_0x360f5b['fieldName'],'type':_0x360f5b[_0x2240('0x29')][_0x2240('0x2a')]};});_0x117543[_0x2240('0x2b')]=_[_0x2240('0x2c')](_0x1240d2,_0x2240('0x27'));_0x117543[_0x2240('0x2d')]=_[_0x2240('0x2e')](_0x53c141[_0x2240('0x2d')]);_0x117543['filters']=_['intersection'](_0x117543['model'],_0x117543[_0x2240('0x2d')]);_0x1affda[_0x2240('0x2f')]=_[_0x2240('0x30')](_0x117543[_0x2240('0x2b')],qs[_0x2240('0x31')](_0x53c141['query'][_0x2240('0x31')]));_0x1affda['attributes']=_0x1affda[_0x2240('0x2f')][_0x2240('0x32')]?_0x1affda[_0x2240('0x2f')]:_0x117543[_0x2240('0x2b')];if(!_0x53c141[_0x2240('0x2d')][_0x2240('0x33')](_0x2240('0x34'))){_0x1affda[_0x2240('0x1d')]=qs[_0x2240('0x1d')](_0x53c141['query']['limit']);_0x1affda['offset']=qs[_0x2240('0x1c')](_0x53c141[_0x2240('0x2d')][_0x2240('0x1c')]);}_0x1affda['order']=qs[_0x2240('0x35')](_0x53c141[_0x2240('0x2d')][_0x2240('0x35')]);_0x1affda[_0x2240('0x36')]=qs[_0x2240('0x37')](_[_0x2240('0x38')](_0x53c141[_0x2240('0x2d')],_0x117543[_0x2240('0x37')]),_0x1240d2);if(_0x53c141['query'][_0x2240('0x39')]){_0x1affda['where']=_[_0x2240('0x3a')](_0x1affda['where'],{'$or':_[_0x2240('0x2c')](_0x1240d2,function(_0x1d485c){if(_0x1d485c['type']!=='VIRTUAL'){var _0x4f9b36={};_0x4f9b36[_0x1d485c[_0x2240('0x27')]]={'$like':'%'+_0x53c141[_0x2240('0x2d')][_0x2240('0x39')]+'%'};return _0x4f9b36;}})});}_0x1affda=_[_0x2240('0x3a')]({},_0x1affda,_0x53c141[_0x2240('0x3b')]);var _0x33a38d={'where':_0x1affda[_0x2240('0x36')]};return db[_0x2240('0x3c')]['count'](_0x33a38d)[_0x2240('0x25')](function(_0x363083){_0xf3e13[_0x2240('0x1f')]=_0x363083;if(_0x53c141[_0x2240('0x2d')][_0x2240('0x3d')]){_0x1affda[_0x2240('0x3e')]=[{'all':!![]}];}return db[_0x2240('0x3c')][_0x2240('0x3f')](_0x1affda);})[_0x2240('0x25')](function(_0x33e271){_0xf3e13[_0x2240('0x40')]=_0x33e271;return _0xf3e13;})[_0x2240('0x25')](respondWithFilteredResult(_0x2a0363,_0x1affda))['catch'](handleError(_0x2a0363,null));};exports[_0x2240('0x41')]=function(_0x3050e2,_0x52b74d){var _0x535fca={'raw':!![],'where':{'id':_0x3050e2['params']['id']}},_0x3f9e14={};_0x3f9e14[_0x2240('0x2b')]=_['keys'](db[_0x2240('0x3c')][_0x2240('0x42')]);_0x3f9e14[_0x2240('0x2d')]=_['keys'](_0x3050e2[_0x2240('0x2d')]);_0x3f9e14[_0x2240('0x37')]=_['intersection'](_0x3f9e14['model'],_0x3f9e14[_0x2240('0x2d')]);_0x535fca['attributes']=_[_0x2240('0x30')](_0x3f9e14[_0x2240('0x2b')],qs['fields'](_0x3050e2['query'][_0x2240('0x31')]));_0x535fca['attributes']=_0x535fca[_0x2240('0x2f')][_0x2240('0x32')]?_0x535fca['attributes']:_0x3f9e14[_0x2240('0x2b')];if(_0x3050e2[_0x2240('0x2d')]['includeAll']){_0x535fca[_0x2240('0x3e')]=[{'all':!![]}];}_0x535fca=_[_0x2240('0x3a')]({},_0x535fca,_0x3050e2[_0x2240('0x3b')]);return db[_0x2240('0x3c')][_0x2240('0x43')](_0x535fca)[_0x2240('0x25')](handleEntityNotFound(_0x52b74d,null))[_0x2240('0x25')](respondWithResult(_0x52b74d,null))['catch'](handleError(_0x52b74d,null));};exports[_0x2240('0x44')]=function(_0x24c0c7,_0x122177){return db[_0x2240('0x3c')][_0x2240('0x44')](_0x24c0c7['body'],{})[_0x2240('0x25')](function(_0x547822){var _0x35cc0f=_0x24c0c7[_0x2240('0x45')][_0x2240('0x46')]({'plain':!![]});if(!_0x35cc0f)throw new Error(_0x2240('0x47'));if(_0x35cc0f[_0x2240('0x48')]===_0x2240('0x45')){var _0x74d1=_0x547822['get']({'plain':!![]});var _0x55c61a=_0x2240('0x49');return db[_0x2240('0x4a')][_0x2240('0x43')]({'where':{'name':_0x55c61a,'userProfileId':_0x35cc0f[_0x2240('0x4b')]},'raw':!![]})[_0x2240('0x25')](function(_0x2fe17c){if(_0x2fe17c&&_0x2fe17c['autoAssociation']===0x0){return db[_0x2240('0x4c')][_0x2240('0x44')]({'name':_0x74d1[_0x2240('0x27')],'resourceId':_0x74d1['id'],'type':_0x2fe17c[_0x2240('0x27')],'sectionId':_0x2fe17c['id']},{})['then'](function(){return _0x547822;});}else{return _0x547822;}})[_0x2240('0x4d')](function(_0x2cad00){logger[_0x2240('0x4e')](_0x2240('0x4f'),_0x2cad00);throw _0x2cad00;});}return _0x547822;})['then'](respondWithResult(_0x122177,0xc9))[_0x2240('0x4d')](handleError(_0x122177,null));};exports[_0x2240('0x23')]=function(_0x5f2d8f,_0x3a29f6){if(_0x5f2d8f[_0x2240('0x50')]['id']){delete _0x5f2d8f[_0x2240('0x50')]['id'];}return db[_0x2240('0x3c')]['find']({'where':{'id':_0x5f2d8f[_0x2240('0x51')]['id']}})['then'](handleEntityNotFound(_0x3a29f6,null))[_0x2240('0x25')](saveUpdates(_0x5f2d8f['body'],null))[_0x2240('0x25')](respondWithResult(_0x3a29f6,null))[_0x2240('0x4d')](handleError(_0x3a29f6,null));};exports[_0x2240('0x24')]=function(_0xefc9,_0x1d50cb){return db[_0x2240('0x3c')][_0x2240('0x43')]({'where':{'id':_0xefc9[_0x2240('0x51')]['id']}})[_0x2240('0x25')](handleEntityNotFound(_0x1d50cb,null))['then'](removeEntity(_0x1d50cb,null))[_0x2240('0x4d')](handleError(_0x1d50cb,null));};exports[_0x2240('0x52')]=function(_0x40c6ad,_0x1674dc,_0x1a8f5c){if(_0x40c6ad[_0x2240('0x50')]['id']){delete _0x40c6ad['body']['id'];}return db[_0x2240('0x3c')][_0x2240('0x43')]({'where':{'id':_0x40c6ad['params']['id']}})[_0x2240('0x25')](handleEntityNotFound(_0x1674dc,null))['then'](function(_0x220039){if(_0x220039){_0x40c6ad[_0x2240('0x50')]['IntervalId']=_0x220039['id'];return db['Interval']['create'](_0x40c6ad['body']);}})[_0x2240('0x25')](respondWithResult(_0x1674dc,null))[_0x2240('0x4d')](handleError(_0x1674dc,null));};exports[_0x2240('0x53')]=function(_0x540757,_0x4a90c9,_0x35b011){var _0x3795db={};var _0x248aec={};var _0x4f305f;var _0xaae83d;return db[_0x2240('0x3c')]['findOne']({'where':{'id':_0x540757[_0x2240('0x51')]['id']}})['then'](handleEntityNotFound(_0x4a90c9,null))[_0x2240('0x25')](function(_0x2d2b9e){if(_0x2d2b9e){_0x4f305f=_0x2d2b9e;_0x248aec[_0x2240('0x2b')]=_[_0x2240('0x2e')](db[_0x2240('0x3c')]['rawAttributes']);_0x248aec[_0x2240('0x2d')]=_[_0x2240('0x2e')](_0x540757['query']);_0x248aec['filters']=_[_0x2240('0x30')](_0x248aec[_0x2240('0x2b')],_0x248aec[_0x2240('0x2d')]);_0x3795db[_0x2240('0x2f')]=_[_0x2240('0x30')](_0x248aec[_0x2240('0x2b')],qs[_0x2240('0x31')](_0x540757['query'][_0x2240('0x31')]));_0x3795db[_0x2240('0x2f')]=_0x3795db['attributes'][_0x2240('0x32')]?_0x3795db[_0x2240('0x2f')]:_0x248aec[_0x2240('0x2b')];_0x3795db[_0x2240('0x54')]=qs['sort'](_0x540757['query'][_0x2240('0x35')]);_0x3795db[_0x2240('0x36')]=qs[_0x2240('0x37')](_[_0x2240('0x38')](_0x540757[_0x2240('0x2d')],_0x248aec['filters']));if(_0x540757[_0x2240('0x2d')][_0x2240('0x39')]){_0x3795db[_0x2240('0x36')]=_[_0x2240('0x3a')](_0x3795db['where'],{'$or':_[_0x2240('0x2c')](_0x3795db[_0x2240('0x2f')],function(_0x2bdfa0){var _0x351fd7={};_0x351fd7[_0x2bdfa0]={'$like':'%'+_0x540757[_0x2240('0x2d')][_0x2240('0x39')]+'%'};return _0x351fd7;})});}_0x3795db=_[_0x2240('0x3a')]({},_0x3795db,_0x540757[_0x2240('0x3b')]);return _0x4f305f[_0x2240('0x53')](_0x3795db);}})['then'](function(_0x4e139d){if(_0x4e139d){_0xaae83d=_0x4e139d[_0x2240('0x32')];if(!_0x540757[_0x2240('0x2d')][_0x2240('0x33')](_0x2240('0x34'))){_0x3795db[_0x2240('0x1d')]=qs[_0x2240('0x1d')](_0x540757['query'][_0x2240('0x1d')]);_0x3795db[_0x2240('0x1c')]=qs[_0x2240('0x1c')](_0x540757[_0x2240('0x2d')][_0x2240('0x1c')]);}return _0x4f305f[_0x2240('0x53')](_0x3795db);}})['then'](function(_0x57b0f8){if(_0x57b0f8){return _0x57b0f8?{'count':_0xaae83d,'rows':_0x57b0f8}:null;}})[_0x2240('0x25')](respondWithResult(_0x4a90c9,null))[_0x2240('0x4d')](handleError(_0x4a90c9,null));};exports[_0x2240('0x55')]=function(_0x3399e1,_0x21b649,_0x3360d3){return db[_0x2240('0x3c')]['findOne']({'where':{'id':_0x3399e1[_0x2240('0x51')]['id']}})[_0x2240('0x25')](handleEntityNotFound(_0x21b649,null))['then'](function(_0x586af5){if(_0x586af5){return db[_0x2240('0x56')][_0x2240('0x57')](function(_0x3b0e34){return db[_0x2240('0x3c')][_0x2240('0x24')]({'where':{'IntervalId':_0x3399e1[_0x2240('0x51')]['id']},'transaction':_0x3b0e34})['then'](function(_0x416e0a){var _0x5684e3=_[_0x2240('0x2c')](_0x3399e1[_0x2240('0x50')],function(_0x1b4c07){delete _0x1b4c07['id'];_0x1b4c07[_0x2240('0x58')]=_0x3399e1['params']['id'];return _0x1b4c07;});return db[_0x2240('0x3c')][_0x2240('0x59')](_0x5684e3,{'transaction':_0x3b0e34});});})[_0x2240('0x25')](function(){return db[_0x2240('0x3c')][_0x2240('0x3f')]({'where':{'IntervalId':_0x3399e1[_0x2240('0x51')]['id']}});});}})[_0x2240('0x25')](respondWithResult(_0x21b649,null))[_0x2240('0x4d')](handleError(_0x21b649,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index 9f2db66..09dc022 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 _0x6d25=['../../utils/iftime','exports','define','Interval','tools_intervals','rewrite','interval','getIntervals','then','map','ifTime','reduce','./interval.attributes','../../components/extensions/rewrite'];(function(_0x5c8410,_0x39b891){var _0x440045=function(_0x5349db){while(--_0x5349db){_0x5c8410['push'](_0x5c8410['shift']());}};_0x440045(++_0x39b891);}(_0x6d25,0x98));var _0x56d2=function(_0x168b7e,_0x5e3322){_0x168b7e=_0x168b7e-0x0;var _0x12be52=_0x6d25[_0x168b7e];return _0x12be52;};'use strict';var attributes=require(_0x56d2('0x0'));var extensions=require(_0x56d2('0x1'));var iftime=require(_0x56d2('0x2'))['iftime'];module[_0x56d2('0x3')]=function(_0x594e8b){return _0x594e8b[_0x56d2('0x4')](_0x56d2('0x5'),attributes,{'tableName':_0x56d2('0x6'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x1c4896){extensions[_0x56d2('0x7')](_0x594e8b,_0x1c4896);},'afterBulkCreate':function(_0x16d054,_0x194b6c,_0x412e6a){_0x412e6a();extensions['rewrite'](_0x594e8b,_0x16d054[0x0]);},'afterUpdate':function(_0x29d40c){extensions['rewrite'](_0x594e8b,_0x29d40c);},'afterDestroy':function(_0x526864){extensions['rewrite'](_0x594e8b,_0x526864);}},'instanceMethods':{'ifTime':function(_0xff8f0b=undefined,_0x4390d9=new Date()){if(typeof this[_0x56d2('0x8')]==='string'){return iftime(this[_0x56d2('0x8')],_0xff8f0b,_0x4390d9);}else{return this[_0x56d2('0x9')]()[_0x56d2('0xa')](function(_0x137754){return Promise['all'](_0x137754[_0x56d2('0xb')](function(_0x1640b3){return _0x1640b3[_0x56d2('0xc')](_0xff8f0b,_0x4390d9);}));})[_0x56d2('0xa')](function(_0x4e8825){return _0x4e8825[_0x56d2('0xd')](function(_0x5f384c,_0x1377ed){return _0x5f384c||_0x1377ed;},![]);});}}}});}; \ No newline at end of file +var _0x222b=['tools_intervals','rewrite','interval','getIntervals','all','map','ifTime','then','reduce','../../utils/iftime','exports','define'];(function(_0x3ec100,_0x45b76b){var _0x5d2c7d=function(_0x543d42){while(--_0x543d42){_0x3ec100['push'](_0x3ec100['shift']());}};_0x5d2c7d(++_0x45b76b);}(_0x222b,0x171));var _0xb222=function(_0x1c3b41,_0x50f776){_0x1c3b41=_0x1c3b41-0x0;var _0x41e3fe=_0x222b[_0x1c3b41];return _0x41e3fe;};'use strict';var attributes=require('./interval.attributes');var extensions=require('../../components/extensions/rewrite');var iftime=require(_0xb222('0x0'))['iftime'];module[_0xb222('0x1')]=function(_0x473199){return _0x473199[_0xb222('0x2')]('Interval',attributes,{'tableName':_0xb222('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0xf02c25){extensions[_0xb222('0x4')](_0x473199,_0xf02c25);},'afterBulkCreate':function(_0x1aee5d,_0x13070f,_0xbf95ed){_0xbf95ed();extensions[_0xb222('0x4')](_0x473199,_0x1aee5d[0x0]);},'afterUpdate':function(_0x2a2650){extensions[_0xb222('0x4')](_0x473199,_0x2a2650);},'afterDestroy':function(_0x121ea8){extensions[_0xb222('0x4')](_0x473199,_0x121ea8);}},'instanceMethods':{'ifTime':function(_0x2c3ace=undefined,_0x4747dc=new Date()){if(typeof this[_0xb222('0x5')]==='string'){return iftime(this['interval'],_0x2c3ace,_0x4747dc);}else{return this[_0xb222('0x6')]()['then'](function(_0x904b16){return Promise[_0xb222('0x7')](_0x904b16[_0xb222('0x8')](function(_0x2be819){return _0x2be819[_0xb222('0x9')](_0x2c3ace,_0x4747dc);}));})[_0xb222('0xa')](function(_0x5bddb5){return _0x5bddb5[_0xb222('0xb')](function(_0x238593,_0x3e38e2){return _0x238593||_0x3e38e2;},![]);});}}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index d2a6eac..2160249 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 _0x2732=['error','ShowInterval','find','catch','ifTime','IntervalIftime:\x20intervals\x20=\x20%s\x20(ids\x20=\x20%s)','name','join','findById','format','IntervalIftime:\x20interval\x20=\x20%s\x20(id\x20=\x20%s)','IntervalIftime','intervalIds','isArray','intervals','timezone','length','IntervalIftime:\x20interval\x20strings\x20=\x20%s','IntervalIftime:\x20timezone\x20=\x20%s','Iftime','silly','resolve','reduce','util','../../mysqldb','../../utils/iftime','iftime','GetInterval','Interval','findAll','options','raw','where','attributes','limit','model','include','map','then','info','debug','stringify','message'];(function(_0x3212cc,_0x3bfe46){var _0x3ecd2c=function(_0x594465){while(--_0x594465){_0x3212cc['push'](_0x3212cc['shift']());}};_0x3ecd2c(++_0x3bfe46);}(_0x2732,0xee));var _0x2273=function(_0x3b2e32,_0x565c){_0x3b2e32=_0x3b2e32-0x0;var _0x5b84ee=_0x2732[_0x3b2e32];return _0x5b84ee;};'use strict';var _=require('lodash');var util=require(_0x2273('0x0'));var db=require(_0x2273('0x1'))['db'];var iftime=require(_0x2273('0x2'))[_0x2273('0x3')];var logger=require('../../config/logger')('rpc');exports[_0x2273('0x4')]=function(_0x53d991){var _0x96c6ff=this;return new Promise(function(_0x4b3a8e,_0x48d18e){return db[_0x2273('0x5')][_0x2273('0x6')]({'raw':_0x53d991['options']?_0x53d991[_0x2273('0x7')][_0x2273('0x8')]===undefined?!![]:![]:!![],'where':_0x53d991['options']?_0x53d991[_0x2273('0x7')][_0x2273('0x9')]||null:null,'attributes':_0x53d991['options']?_0x53d991[_0x2273('0x7')][_0x2273('0xa')]||null:null,'limit':_0x53d991[_0x2273('0x7')]?_0x53d991[_0x2273('0x7')][_0x2273('0xb')]||null:null,'include':_0x53d991['options']?_0x53d991[_0x2273('0x7')]['include']?_['map'](_0x53d991[_0x2273('0x7')]['include'],function(_0x3579bc){return{'model':db[_0x3579bc[_0x2273('0xc')]],'as':_0x3579bc['as'],'attributes':_0x3579bc[_0x2273('0xa')],'include':_0x3579bc[_0x2273('0xd')]?_['map'](_0x3579bc[_0x2273('0xd')],function(_0x2b467b){return{'model':db[_0x2b467b[_0x2273('0xc')]],'as':_0x2b467b['as'],'attributes':_0x2b467b['attributes'],'include':_0x2b467b[_0x2273('0xd')]?_[_0x2273('0xe')](_0x2b467b['include'],function(_0x4e9352){return{'model':db[_0x4e9352[_0x2273('0xc')]],'as':_0x4e9352['as'],'attributes':_0x4e9352['attributes']};}):[]};}):[]};}):[]:[]})[_0x2273('0xf')](function(_0x57894c){logger[_0x2273('0x10')](_0x2273('0x4'),_0x53d991);logger[_0x2273('0x11')](_0x2273('0x4'),_0x53d991,JSON[_0x2273('0x12')](_0x57894c));_0x4b3a8e(_0x57894c);})['catch'](function(_0x24546e){logger['error']('GetInterval',_0x24546e[_0x2273('0x13')],_0x53d991);_0x48d18e(_0x96c6ff[_0x2273('0x14')](0x1f4,_0x24546e[_0x2273('0x13')]));});});};exports[_0x2273('0x15')]=function(_0x5c7bf2){var _0x36b27b=this;return new Promise(function(_0x1a99ec,_0x11f1a4){return db['Interval'][_0x2273('0x16')]({'raw':_0x5c7bf2['options']?_0x5c7bf2[_0x2273('0x7')][_0x2273('0x8')]===undefined?!![]:![]:!![],'where':_0x5c7bf2['options']?_0x5c7bf2['options'][_0x2273('0x9')]||null:null,'attributes':_0x5c7bf2[_0x2273('0x7')]?_0x5c7bf2[_0x2273('0x7')][_0x2273('0xa')]||null:null,'include':_0x5c7bf2[_0x2273('0x7')]?_0x5c7bf2[_0x2273('0x7')][_0x2273('0xd')]?_['map'](_0x5c7bf2[_0x2273('0x7')]['include'],function(_0x532db3){return{'model':db[_0x532db3[_0x2273('0xc')]],'as':_0x532db3['as'],'attributes':_0x532db3['attributes'],'include':_0x532db3[_0x2273('0xd')]?_['map'](_0x532db3[_0x2273('0xd')],function(_0x2b8775){return{'model':db[_0x2b8775['model']],'as':_0x2b8775['as'],'attributes':_0x2b8775['attributes'],'include':_0x2b8775[_0x2273('0xd')]?_['map'](_0x2b8775[_0x2273('0xd')],function(_0x400614){return{'model':db[_0x400614[_0x2273('0xc')]],'as':_0x400614['as'],'attributes':_0x400614[_0x2273('0xa')]};}):[]};}):[]};}):[]:[]})[_0x2273('0xf')](function(_0x47a620){logger[_0x2273('0x10')](_0x2273('0x15'),_0x5c7bf2);logger['debug']('ShowInterval',_0x5c7bf2,JSON['stringify'](_0x47a620));_0x1a99ec(_0x47a620);})[_0x2273('0x17')](function(_0x1af52a){logger[_0x2273('0x14')](_0x2273('0x15'),_0x1af52a['message'],_0x5c7bf2);_0x11f1a4(_0x36b27b['error'](0x1f4,_0x1af52a[_0x2273('0x13')]));});});};function checkArrayOfIntervals(_0x545a01,_0x1127c4){var _0x388e9f=[];return db[_0x2273('0x5')][_0x2273('0x6')]({'where':{'id':_0x545a01}})[_0x2273('0xf')](function(_0x414614){_0x388e9f=_0x414614;return Promise['all'](_0x388e9f[_0x2273('0xe')](function(_0x4622db){return _0x4622db[_0x2273('0x18')](_0x1127c4);}));})[_0x2273('0xf')](function(_0x1e2fa6){var _0x47da4d=_0x1e2fa6['reduce'](function(_0x4cd13e,_0x3530be){return _0x4cd13e||_0x3530be;},![]);logger[_0x2273('0x10')](util['format'](_0x2273('0x19'),_0x388e9f[_0x2273('0xe')](function(_0x26eaa5){return _0x26eaa5[_0x2273('0x1a')];})[_0x2273('0x1b')](',\x20'),_0x388e9f[_0x2273('0xe')](function(_0x2708a5){return _0x2708a5['id'];})['join'](',\x20')));return _0x47da4d;});}function checkSingleInterval(_0x5607b5,_0x55284f){return db[_0x2273('0x5')][_0x2273('0x1c')](_0x5607b5)[_0x2273('0xf')](function(_0x5d6b16){if(_0x5d6b16){logger[_0x2273('0x10')](util[_0x2273('0x1d')](_0x2273('0x1e'),_0x5d6b16[_0x2273('0x1a')],_0x5d6b16['id']));return _0x5d6b16[_0x2273('0x18')](_0x55284f);}});}exports[_0x2273('0x1f')]=function(_0x218196){var _0x7f494c=_0x218196[_0x2273('0x20')];var _0x22aa17=Array[_0x2273('0x21')](_0x218196[_0x2273('0x22')])?_0x218196['intervals']:typeof _0x218196['intervals']==='string'?[_0x218196['intervals']]:[];var _0x1352ef=_0x218196[_0x2273('0x23')]||undefined;var _0x1090e5=![];if(_0x22aa17[_0x2273('0x24')]){logger[_0x2273('0x10')](util['format'](_0x2273('0x25'),_0x22aa17[_0x2273('0x1b')](';\x20')));}if(_0x1352ef){logger[_0x2273('0x10')](util['format'](_0x2273('0x26'),_0x1352ef));}logger[_0x2273('0x11')](_0x2273('0x27'),_0x1090e5);logger[_0x2273('0x28')](_0x2273('0x1f'),_0x218196);return Promise[_0x2273('0x29')]()[_0x2273('0xf')](function(){if(Array[_0x2273('0x21')](_0x7f494c)){return checkArrayOfIntervals(_0x7f494c,_0x1352ef);}else if(_0x7f494c){return checkSingleInterval(_0x7f494c,_0x1352ef);}})[_0x2273('0xf')](function(_0x1ea603){var _0x11f144=_0x22aa17[_0x2273('0x2a')](function(_0x2beca2,_0x2366db){return _0x2beca2||iftime(_0x2366db,_0x1352ef);},![]);_0x1090e5=_0x1ea603||_0x11f144;return _0x1090e5;})[_0x2273('0x17')](function(_0x4b29fb){logger['error']('IntervalIftime',_0x218196,_0x4b29fb);throw this[_0x2273('0x14')](0x1f4,_0x4b29fb[_0x2273('0x13')]);});}; \ No newline at end of file +var _0xaf70=['catch','error','message','ShowInterval','stringify','all','ifTime','reduce','format','IntervalIftime:\x20intervals\x20=\x20%s\x20(ids\x20=\x20%s)','join','findById','info','IntervalIftime:\x20interval\x20=\x20%s\x20(id\x20=\x20%s)','name','intervalIds','isArray','intervals','string','timezone','length','IntervalIftime:\x20interval\x20strings\x20=\x20%s','IntervalIftime:\x20timezone\x20=\x20%s','Iftime','silly','IntervalIftime','util','../../mysqldb','../../utils/iftime','../../config/logger','rpc','GetInterval','Interval','findAll','options','raw','where','attributes','limit','include','map','model','then','debug'];(function(_0x3186aa,_0x34c21e){var _0x2d8c36=function(_0x239e99){while(--_0x239e99){_0x3186aa['push'](_0x3186aa['shift']());}};_0x2d8c36(++_0x34c21e);}(_0xaf70,0x17a));var _0x0af7=function(_0x16a6ec,_0x552727){_0x16a6ec=_0x16a6ec-0x0;var _0x25d4e1=_0xaf70[_0x16a6ec];return _0x25d4e1;};'use strict';var _=require('lodash');var util=require(_0x0af7('0x0'));var db=require(_0x0af7('0x1'))['db'];var iftime=require(_0x0af7('0x2'))['iftime'];var logger=require(_0x0af7('0x3'))(_0x0af7('0x4'));exports[_0x0af7('0x5')]=function(_0x5f016a){var _0x34378e=this;return new Promise(function(_0x434bea,_0x30409b){return db[_0x0af7('0x6')][_0x0af7('0x7')]({'raw':_0x5f016a[_0x0af7('0x8')]?_0x5f016a[_0x0af7('0x8')][_0x0af7('0x9')]===undefined?!![]:![]:!![],'where':_0x5f016a[_0x0af7('0x8')]?_0x5f016a[_0x0af7('0x8')][_0x0af7('0xa')]||null:null,'attributes':_0x5f016a[_0x0af7('0x8')]?_0x5f016a[_0x0af7('0x8')][_0x0af7('0xb')]||null:null,'limit':_0x5f016a['options']?_0x5f016a[_0x0af7('0x8')][_0x0af7('0xc')]||null:null,'include':_0x5f016a['options']?_0x5f016a[_0x0af7('0x8')][_0x0af7('0xd')]?_[_0x0af7('0xe')](_0x5f016a[_0x0af7('0x8')][_0x0af7('0xd')],function(_0x439f62){return{'model':db[_0x439f62[_0x0af7('0xf')]],'as':_0x439f62['as'],'attributes':_0x439f62['attributes'],'include':_0x439f62[_0x0af7('0xd')]?_[_0x0af7('0xe')](_0x439f62['include'],function(_0x5b8226){return{'model':db[_0x5b8226[_0x0af7('0xf')]],'as':_0x5b8226['as'],'attributes':_0x5b8226[_0x0af7('0xb')],'include':_0x5b8226[_0x0af7('0xd')]?_['map'](_0x5b8226[_0x0af7('0xd')],function(_0x4d519a){return{'model':db[_0x4d519a['model']],'as':_0x4d519a['as'],'attributes':_0x4d519a['attributes']};}):[]};}):[]};}):[]:[]})[_0x0af7('0x10')](function(_0x393881){logger['info'](_0x0af7('0x5'),_0x5f016a);logger[_0x0af7('0x11')](_0x0af7('0x5'),_0x5f016a,JSON['stringify'](_0x393881));_0x434bea(_0x393881);})[_0x0af7('0x12')](function(_0x1e9ca7){logger[_0x0af7('0x13')](_0x0af7('0x5'),_0x1e9ca7[_0x0af7('0x14')],_0x5f016a);_0x30409b(_0x34378e['error'](0x1f4,_0x1e9ca7['message']));});});};exports[_0x0af7('0x15')]=function(_0x23029c){var _0x18c79b=this;return new Promise(function(_0x4764d0,_0x6623f2){return db[_0x0af7('0x6')]['find']({'raw':_0x23029c['options']?_0x23029c['options']['raw']===undefined?!![]:![]:!![],'where':_0x23029c[_0x0af7('0x8')]?_0x23029c[_0x0af7('0x8')][_0x0af7('0xa')]||null:null,'attributes':_0x23029c[_0x0af7('0x8')]?_0x23029c[_0x0af7('0x8')][_0x0af7('0xb')]||null:null,'include':_0x23029c['options']?_0x23029c[_0x0af7('0x8')][_0x0af7('0xd')]?_[_0x0af7('0xe')](_0x23029c[_0x0af7('0x8')][_0x0af7('0xd')],function(_0x53149d){return{'model':db[_0x53149d[_0x0af7('0xf')]],'as':_0x53149d['as'],'attributes':_0x53149d[_0x0af7('0xb')],'include':_0x53149d[_0x0af7('0xd')]?_[_0x0af7('0xe')](_0x53149d[_0x0af7('0xd')],function(_0x3d8a03){return{'model':db[_0x3d8a03[_0x0af7('0xf')]],'as':_0x3d8a03['as'],'attributes':_0x3d8a03['attributes'],'include':_0x3d8a03[_0x0af7('0xd')]?_[_0x0af7('0xe')](_0x3d8a03[_0x0af7('0xd')],function(_0xed4a05){return{'model':db[_0xed4a05['model']],'as':_0xed4a05['as'],'attributes':_0xed4a05[_0x0af7('0xb')]};}):[]};}):[]};}):[]:[]})[_0x0af7('0x10')](function(_0x4cc66){logger['info'](_0x0af7('0x15'),_0x23029c);logger[_0x0af7('0x11')]('ShowInterval',_0x23029c,JSON[_0x0af7('0x16')](_0x4cc66));_0x4764d0(_0x4cc66);})['catch'](function(_0x25f0af){logger[_0x0af7('0x13')](_0x0af7('0x15'),_0x25f0af[_0x0af7('0x14')],_0x23029c);_0x6623f2(_0x18c79b[_0x0af7('0x13')](0x1f4,_0x25f0af[_0x0af7('0x14')]));});});};function checkArrayOfIntervals(_0x2c0f0c,_0x24342d){var _0x3ec919=[];return db[_0x0af7('0x6')][_0x0af7('0x7')]({'where':{'id':_0x2c0f0c}})[_0x0af7('0x10')](function(_0x2dd092){_0x3ec919=_0x2dd092;return Promise[_0x0af7('0x17')](_0x3ec919[_0x0af7('0xe')](function(_0x5a6576){return _0x5a6576[_0x0af7('0x18')](_0x24342d);}));})[_0x0af7('0x10')](function(_0x2ef88a){var _0x3b7e55=_0x2ef88a[_0x0af7('0x19')](function(_0x11870f,_0x4abcf3){return _0x11870f||_0x4abcf3;},![]);logger['info'](util[_0x0af7('0x1a')](_0x0af7('0x1b'),_0x3ec919[_0x0af7('0xe')](function(_0x340fdd){return _0x340fdd['name'];})[_0x0af7('0x1c')](',\x20'),_0x3ec919[_0x0af7('0xe')](function(_0x436359){return _0x436359['id'];})['join'](',\x20')));return _0x3b7e55;});}function checkSingleInterval(_0x222841,_0x2fae38){return db[_0x0af7('0x6')][_0x0af7('0x1d')](_0x222841)[_0x0af7('0x10')](function(_0x467ff6){if(_0x467ff6){logger[_0x0af7('0x1e')](util[_0x0af7('0x1a')](_0x0af7('0x1f'),_0x467ff6[_0x0af7('0x20')],_0x467ff6['id']));return _0x467ff6['ifTime'](_0x2fae38);}});}exports['IntervalIftime']=function(_0x588a9d){var _0x45d69b=_0x588a9d[_0x0af7('0x21')];var _0x131f92=Array[_0x0af7('0x22')](_0x588a9d[_0x0af7('0x23')])?_0x588a9d['intervals']:typeof _0x588a9d['intervals']===_0x0af7('0x24')?[_0x588a9d[_0x0af7('0x23')]]:[];var _0x38f872=_0x588a9d[_0x0af7('0x25')]||undefined;var _0x2c8acd=![];if(_0x131f92[_0x0af7('0x26')]){logger[_0x0af7('0x1e')](util[_0x0af7('0x1a')](_0x0af7('0x27'),_0x131f92[_0x0af7('0x1c')](';\x20')));}if(_0x38f872){logger[_0x0af7('0x1e')](util[_0x0af7('0x1a')](_0x0af7('0x28'),_0x38f872));}logger[_0x0af7('0x11')](_0x0af7('0x29'),_0x2c8acd);logger[_0x0af7('0x2a')](_0x0af7('0x2b'),_0x588a9d);return Promise['resolve']()[_0x0af7('0x10')](function(){if(Array[_0x0af7('0x22')](_0x45d69b)){return checkArrayOfIntervals(_0x45d69b,_0x38f872);}else if(_0x45d69b){return checkSingleInterval(_0x45d69b,_0x38f872);}})[_0x0af7('0x10')](function(_0x1f16de){var _0x5a961e=_0x131f92[_0x0af7('0x19')](function(_0x40950c,_0x48f01e){return _0x40950c||iftime(_0x48f01e,_0x38f872);},![]);_0x2c8acd=_0x1f16de||_0x5a961e;return _0x2c8acd;})['catch'](function(_0xe9df4c){logger[_0x0af7('0x13')]('IntervalIftime',_0x588a9d,_0xe9df4c);throw this['error'](0x1f4,_0xe9df4c[_0x0af7('0x14')]);});}; \ No newline at end of file diff --git a/server/api/jira/index.js b/server/api/jira/index.js index 428c213..4bd312b 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 _0x2ef3=['./jira.controller','post','isAuthenticated','exports','express','Router','../../components/auth/service'];(function(_0x250c28,_0x1e9884){var _0x1a29be=function(_0x53500f){while(--_0x53500f){_0x250c28['push'](_0x250c28['shift']());}};_0x1a29be(++_0x1e9884);}(_0x2ef3,0xba));var _0x32ef=function(_0x1accc4,_0x3ac180){_0x1accc4=_0x1accc4-0x0;var _0x47ce7c=_0x2ef3[_0x1accc4];return _0x47ce7c;};'use strict';var express=require(_0x32ef('0x0'));var router=express[_0x32ef('0x1')]();var auth=require(_0x32ef('0x2'));var controller=require(_0x32ef('0x3'));router[_0x32ef('0x4')]('/',auth[_0x32ef('0x5')](),controller['send']);module[_0x32ef('0x6')]=router; \ No newline at end of file +var _0xb10b=['./jira.controller','post','send','exports','express','../../components/auth/service'];(function(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0xb10b,0x12a));var _0xbb10=function(_0xdf4058,_0x3d913d){_0xdf4058=_0xdf4058-0x0;var _0x141888=_0xb10b[_0xdf4058];return _0x141888;};'use strict';var express=require(_0xbb10('0x0'));var router=express['Router']();var auth=require(_0xbb10('0x1'));var controller=require(_0xbb10('0x2'));router[_0xbb10('0x3')]('/',auth['isAuthenticated'](),controller[_0xbb10('0x4')]);module[_0xbb10('0x5')]=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index 10ab940..60da2a0 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 _0x99f6=['application/json','Basic\x20','toString','base64','request','data','end','status','statusCode','json','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','openIssue','send','headers','connection','remoteAddress','socket','body','bluebird','https','../../config/logger','api','support','3eAmWpBVP0','key','Report','\x20from\x20','description','stringify','issuetype','Bug','email','fields','customfield_11501','oldToken','customfield_11503','customfield_11504','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue'];(function(_0x28533c,_0x22673d){var _0x193454=function(_0x1bf202){while(--_0x1bf202){_0x28533c['push'](_0x28533c['shift']());}};_0x193454(++_0x22673d);}(_0x99f6,0x116));var _0x699f=function(_0x56ac85,_0x3b9f06){_0x56ac85=_0x56ac85-0x0;var _0x232bf5=_0x99f6[_0x56ac85];return _0x232bf5;};'use strict';var BPromise=require(_0x699f('0x0'));var https=require(_0x699f('0x1'));var logger=require(_0x699f('0x2'))(_0x699f('0x3'));var USERNAME=_0x699f('0x4');var PASSWORD=_0x699f('0x5');function openIssue(_0x10f49e,_0x477590){var _0x2d77c1={'fields':{'project':{'key':_0x10f49e[_0x699f('0x6')]||'MOTGUI'},'summary':(_0x10f49e['summary']||_0x699f('0x7'))+_0x699f('0x8')+_0x10f49e['ip'],'description':_0x10f49e[_0x699f('0x9')]||JSON[_0x699f('0xa')](_0x10f49e),'issuetype':{'name':_0x10f49e[_0x699f('0xb')]||_0x699f('0xc')}}};_0x2d77c1['fields']['customfield_11500']=_0x10f49e[_0x699f('0xd')];_0x2d77c1[_0x699f('0xe')][_0x699f('0xf')]=_0x10f49e[_0x699f('0x10')];_0x2d77c1[_0x699f('0xe')]['customfield_11502']=_0x10f49e['newToken'];_0x2d77c1[_0x699f('0xe')][_0x699f('0x11')]=_0x10f49e['name'];_0x2d77c1[_0x699f('0xe')][_0x699f('0x12')]=_0x10f49e[_0x699f('0x13')];_0x2d77c1[_0x699f('0xe')][_0x699f('0x14')]=_0x10f49e['ip'];var _0x4f2580={'host':_0x699f('0x15'),'port':0x1bb,'path':_0x699f('0x16'),'method':'POST','timeout':0x4e20,'headers':{'Content-Type':_0x699f('0x17'),'Authorization':_0x699f('0x18')+new Buffer(USERNAME+':'+PASSWORD)[_0x699f('0x19')](_0x699f('0x1a'))}};var _0x12e66d=JSON[_0x699f('0xa')](_0x2d77c1);var _0x583a58=https[_0x699f('0x1b')](_0x4f2580,function(_0x57ab16){_0x57ab16['setEncoding']('utf8');var _0x168871='';_0x57ab16['on'](_0x699f('0x1c'),function(_0x21504e){_0x168871+=_0x21504e;});_0x57ab16['on'](_0x699f('0x1d'),function(){if(_0x477590){return _0x477590[_0x699f('0x1e')](_0x57ab16[_0x699f('0x1f')])[_0x699f('0x20')](JSON['parse'](_0x168871));}});});_0x583a58['on'](_0x699f('0x21'),function(_0x50f502){if(_0x477590){return _0x477590[_0x699f('0x1e')](0x1f4)[_0x699f('0x20')]({'errors':[{'message':_0x699f('0x22'),'type':_0x699f('0x23')}]});}});_0x583a58['write'](_0x12e66d);_0x583a58[_0x699f('0x1d')]();}exports[_0x699f('0x24')]=openIssue;exports[_0x699f('0x25')]=function(_0x32d4bf,_0x23a12b){_0x32d4bf['body']['ip']=_0x32d4bf[_0x699f('0x26')]['x-forwarded-for']||_0x32d4bf[_0x699f('0x27')]['remoteAddress']||_0x32d4bf['socket'][_0x699f('0x28')]||_0x32d4bf['connection'][_0x699f('0x29')][_0x699f('0x28')];return openIssue(_0x32d4bf[_0x699f('0x2a')],_0x23a12b);}; \ No newline at end of file +var _0xd59d=['socket','body','bluebird','https','../../config/logger','api','3eAmWpBVP0','key','MOTGUI','summary','Report','\x20from\x20','description','stringify','issuetype','Bug','fields','customfield_11500','customfield_11501','customfield_11502','newToken','name','reason','customfield_10102','/rest/api/2/issue','POST','application/json','toString','base64','request','setEncoding','utf8','data','end','json','parse','error','status','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','openIssue','send','headers','x-forwarded-for','remoteAddress'];(function(_0x3c59b5,_0x40975c){var _0x40a8a1=function(_0x2c38c8){while(--_0x2c38c8){_0x3c59b5['push'](_0x3c59b5['shift']());}};_0x40a8a1(++_0x40975c);}(_0xd59d,0xe8));var _0xdd59=function(_0x53cf8e,_0x3d290f){_0x53cf8e=_0x53cf8e-0x0;var _0x459197=_0xd59d[_0x53cf8e];return _0x459197;};'use strict';var BPromise=require(_0xdd59('0x0'));var https=require(_0xdd59('0x1'));var logger=require(_0xdd59('0x2'))(_0xdd59('0x3'));var USERNAME='support';var PASSWORD=_0xdd59('0x4');function openIssue(_0x487db5,_0x324069){var _0x38a13f={'fields':{'project':{'key':_0x487db5[_0xdd59('0x5')]||_0xdd59('0x6')},'summary':(_0x487db5[_0xdd59('0x7')]||_0xdd59('0x8'))+_0xdd59('0x9')+_0x487db5['ip'],'description':_0x487db5[_0xdd59('0xa')]||JSON[_0xdd59('0xb')](_0x487db5),'issuetype':{'name':_0x487db5[_0xdd59('0xc')]||_0xdd59('0xd')}}};_0x38a13f[_0xdd59('0xe')][_0xdd59('0xf')]=_0x487db5['email'];_0x38a13f[_0xdd59('0xe')][_0xdd59('0x10')]=_0x487db5['oldToken'];_0x38a13f[_0xdd59('0xe')][_0xdd59('0x11')]=_0x487db5[_0xdd59('0x12')];_0x38a13f['fields']['customfield_11503']=_0x487db5[_0xdd59('0x13')];_0x38a13f['fields']['customfield_11504']=_0x487db5[_0xdd59('0x14')];_0x38a13f['fields'][_0xdd59('0x15')]=_0x487db5['ip'];var _0x1b5bad={'host':'track.xcallymotion.com','port':0x1bb,'path':_0xdd59('0x16'),'method':_0xdd59('0x17'),'timeout':0x4e20,'headers':{'Content-Type':_0xdd59('0x18'),'Authorization':'Basic\x20'+new Buffer(USERNAME+':'+PASSWORD)[_0xdd59('0x19')](_0xdd59('0x1a'))}};var _0x5c519d=JSON[_0xdd59('0xb')](_0x38a13f);var _0x4bea0f=https[_0xdd59('0x1b')](_0x1b5bad,function(_0x55dcd1){_0x55dcd1[_0xdd59('0x1c')](_0xdd59('0x1d'));var _0x16c826='';_0x55dcd1['on'](_0xdd59('0x1e'),function(_0x290e88){_0x16c826+=_0x290e88;});_0x55dcd1['on'](_0xdd59('0x1f'),function(){if(_0x324069){return _0x324069['status'](_0x55dcd1['statusCode'])[_0xdd59('0x20')](JSON[_0xdd59('0x21')](_0x16c826));}});});_0x4bea0f['on'](_0xdd59('0x22'),function(_0x54a53f){if(_0x324069){return _0x324069[_0xdd59('0x23')](0x1f4)[_0xdd59('0x20')]({'errors':[{'message':_0xdd59('0x24'),'type':_0xdd59('0x25')}]});}});_0x4bea0f[_0xdd59('0x26')](_0x5c519d);_0x4bea0f[_0xdd59('0x1f')]();}exports[_0xdd59('0x27')]=openIssue;exports[_0xdd59('0x28')]=function(_0x262ffb,_0x21d9e8){_0x262ffb['body']['ip']=_0x262ffb[_0xdd59('0x29')][_0xdd59('0x2a')]||_0x262ffb['connection'][_0xdd59('0x2b')]||_0x262ffb[_0xdd59('0x2c')][_0xdd59('0x2b')]||_0x262ffb['connection']['socket'][_0xdd59('0x2b')];return openIssue(_0x262ffb[_0xdd59('0x2d')],_0x21d9e8);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index 7fd5a28..66392ce 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 _0x1339=['../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','update','delete','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x3f1068,_0x2d4f61){var _0x54c89c=function(_0x19e3aa){while(--_0x19e3aa){_0x3f1068['push'](_0x3f1068['shift']());}};_0x54c89c(++_0x2d4f61);}(_0x1339,0x1ed));var _0x9133=function(_0x9e80,_0x1104bf){_0x9e80=_0x9e80-0x0;var _0x38e562=_0x1339[_0x9e80];return _0x38e562;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9133('0x0'));var timeout=require(_0x9133('0x1'));var express=require(_0x9133('0x2'));var router=express[_0x9133('0x3')]();var fs_extra=require(_0x9133('0x4'));var auth=require(_0x9133('0x5'));var interaction=require(_0x9133('0x6'));var config=require(_0x9133('0x7'));var controller=require('./jscriptyAnswerReport.controller');router[_0x9133('0x8')]('/',auth[_0x9133('0x9')](),controller[_0x9133('0xa')]);router['get'](_0x9133('0xb'),auth[_0x9133('0x9')](),controller[_0x9133('0xc')]);router[_0x9133('0x8')](_0x9133('0xd'),auth[_0x9133('0x9')](),controller[_0x9133('0xe')]);router[_0x9133('0xf')]('/',auth[_0x9133('0x9')](),controller[_0x9133('0x10')]);router['put'](_0x9133('0xd'),auth[_0x9133('0x9')](),controller[_0x9133('0x11')]);router[_0x9133('0x12')](_0x9133('0xd'),auth[_0x9133('0x9')](),controller['destroy']);module[_0x9133('0x13')]=router; \ No newline at end of file +var _0x0bb5=['describe','show','post','put','/:id','update','delete','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get','/describe','isAuthenticated'];(function(_0xb6133b,_0x3f4777){var _0x246b3a=function(_0x2b3295){while(--_0x2b3295){_0xb6133b['push'](_0xb6133b['shift']());}};_0x246b3a(++_0x3f4777);}(_0x0bb5,0x148));var _0x50bb=function(_0x12911f,_0x4529c4){_0x12911f=_0x12911f-0x0;var _0x3e5646=_0x0bb5[_0x12911f];return _0x3e5646;};'use strict';var multer=require(_0x50bb('0x0'));var util=require(_0x50bb('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x50bb('0x2'));var router=express[_0x50bb('0x3')]();var fs_extra=require(_0x50bb('0x4'));var auth=require(_0x50bb('0x5'));var interaction=require(_0x50bb('0x6'));var config=require(_0x50bb('0x7'));var controller=require(_0x50bb('0x8'));router[_0x50bb('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x50bb('0x9')](_0x50bb('0xa'),auth[_0x50bb('0xb')](),controller[_0x50bb('0xc')]);router['get']('/:id',auth[_0x50bb('0xb')](),controller[_0x50bb('0xd')]);router[_0x50bb('0xe')]('/',auth[_0x50bb('0xb')](),controller['create']);router[_0x50bb('0xf')](_0x50bb('0x10'),auth[_0x50bb('0xb')](),controller[_0x50bb('0x11')]);router[_0x50bb('0x12')](_0x50bb('0x10'),auth[_0x50bb('0xb')](),controller['destroy']);module[_0x50bb('0x13')]=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index cc0d5c3..347e435 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(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0x7a54,0x106));var _0x47a5=function(_0x4cf53c,_0x149649){_0x4cf53c=_0x4cf53c-0x0;var _0x176261=_0x7a54[_0x4cf53c];return _0x176261;};'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(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0x7a54,0x106));var _0x47a5=function(_0x14a7fe,_0x5330d5){_0x14a7fe=_0x14a7fe-0x0;var _0x52504f=_0x7a54[_0x14a7fe];return _0x52504f;};'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 084be92..0343d77 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 _0x038b=['lodash','squel','crypto','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','reject','save','update','then','error','name','index','map','JscriptyAnswerReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','findAll','catch','show','length','include','options','create','body','find','params','destroy','describe','rimraf','zip-dir','fast-json-patch','moment','mustache','util','sox','to-csv'];(function(_0x53afe9,_0x2c9f40){var _0x396396=function(_0x1f574d){while(--_0x1f574d){_0x53afe9['push'](_0x53afe9['shift']());}};_0x396396(++_0x2c9f40);}(_0x038b,0x114));var _0xb038=function(_0x3157b9,_0x57bc6e){_0x3157b9=_0x3157b9-0x0;var _0x400405=_0x038b[_0x3157b9];return _0x400405;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb038('0x0'));var zipdir=require(_0xb038('0x1'));var jsonpatch=require(_0xb038('0x2'));var rp=require('request-promise');var moment=require(_0xb038('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xb038('0x4'));var util=require(_0xb038('0x5'));var path=require('path');var sox=require(_0xb038('0x6'));var csv=require(_0xb038('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb038('0x8'));var squel=require(_0xb038('0x9'));var crypto=require(_0xb038('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb038('0x7'));var querystring=require(_0xb038('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xb038('0xc'));var qs=require(_0xb038('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb038('0xe'));var logger=require(_0xb038('0xf'))(_0xb038('0x10'));var utils=require(_0xb038('0x11'));var config=require(_0xb038('0x12'));var licenseUtil=require(_0xb038('0x13'));var db=require(_0xb038('0x14'))['db'];function respondWithStatusCode(_0x439751,_0x16e4a3){_0x16e4a3=_0x16e4a3||0xcc;return function(_0x57acd8){if(_0x57acd8){return _0x439751[_0xb038('0x15')](_0x16e4a3);}return _0x439751[_0xb038('0x16')](_0x16e4a3)[_0xb038('0x17')]();};}function respondWithResult(_0x3cc717,_0x3a71a6){_0x3a71a6=_0x3a71a6||0xc8;return function(_0x13acc7){if(_0x13acc7){return _0x3cc717[_0xb038('0x16')](_0x3a71a6)['json'](_0x13acc7);}};}function respondWithFilteredResult(_0xe8aa7c,_0x26e4f2){return function(_0x183141){if(_0x183141){var _0x39323e=typeof _0x26e4f2[_0xb038('0x18')]===_0xb038('0x19')&&typeof _0x26e4f2['limit']===_0xb038('0x19');var _0x3039b0=_0x183141[_0xb038('0x1a')];var _0x3b095a=_0x39323e?0x0:_0x26e4f2['offset'];var _0x49b237=_0x39323e?_0x183141[_0xb038('0x1a')]:_0x26e4f2[_0xb038('0x18')]+_0x26e4f2[_0xb038('0x1b')];var _0x31c348;if(_0x49b237>=_0x3039b0){_0x49b237=_0x3039b0;_0x31c348=0xc8;}else{_0x31c348=0xce;}_0xe8aa7c['status'](_0x31c348);return _0xe8aa7c[_0xb038('0x1c')](_0xb038('0x1d'),_0x3b095a+'-'+_0x49b237+'/'+_0x3039b0)[_0xb038('0x1e')](_0x183141);}return null;};}function patchUpdates(_0x33a377){return function(_0xc6cd61){try{jsonpatch['apply'](_0xc6cd61,_0x33a377,!![]);}catch(_0x2e0369){return BPromise[_0xb038('0x1f')](_0x2e0369);}return _0xc6cd61[_0xb038('0x20')]();};}function saveUpdates(_0x87b899,_0x5f123d){return function(_0x2812c9){if(_0x2812c9){return _0x2812c9[_0xb038('0x21')](_0x87b899)['then'](function(_0x1eb9cd){return _0x1eb9cd;});}return null;};}function removeEntity(_0x43d403,_0x573f93){return function(_0x241329){if(_0x241329){return _0x241329['destroy']()[_0xb038('0x22')](function(){_0x43d403[_0xb038('0x16')](0xcc)[_0xb038('0x17')]();});}};}function handleEntityNotFound(_0x1df7c4,_0x5d4343){return function(_0xe4ceda){if(!_0xe4ceda){_0x1df7c4[_0xb038('0x15')](0x194);}return _0xe4ceda;};}function handleError(_0x576be5,_0xb6d93f){_0xb6d93f=_0xb6d93f||0x1f4;return function(_0x33cf3c){logger[_0xb038('0x23')](_0x33cf3c['stack']);if(_0x33cf3c[_0xb038('0x24')]){delete _0x33cf3c[_0xb038('0x24')];}_0x576be5[_0xb038('0x16')](_0xb6d93f)['send'](_0x33cf3c);};}exports[_0xb038('0x25')]=function(_0x2855a6,_0x28a6a9){var _0x12b3b6={},_0xc387d={},_0x551b55={'count':0x0,'rows':[]};var _0x1783d4=_[_0xb038('0x26')](db[_0xb038('0x27')][_0xb038('0x28')],function(_0x1abe23){return{'name':_0x1abe23[_0xb038('0x29')],'type':_0x1abe23[_0xb038('0x2a')][_0xb038('0x2b')]};});_0xc387d[_0xb038('0x2c')]=_[_0xb038('0x26')](_0x1783d4,_0xb038('0x24'));_0xc387d[_0xb038('0x2d')]=_[_0xb038('0x2e')](_0x2855a6['query']);_0xc387d[_0xb038('0x2f')]=_['intersection'](_0xc387d[_0xb038('0x2c')],_0xc387d[_0xb038('0x2d')]);_0x12b3b6[_0xb038('0x30')]=_[_0xb038('0x31')](_0xc387d[_0xb038('0x2c')],qs[_0xb038('0x32')](_0x2855a6[_0xb038('0x2d')][_0xb038('0x32')]));_0x12b3b6[_0xb038('0x30')]=_0x12b3b6[_0xb038('0x30')]['length']?_0x12b3b6[_0xb038('0x30')]:_0xc387d[_0xb038('0x2c')];if(!_0x2855a6[_0xb038('0x2d')]['hasOwnProperty']('nolimit')){_0x12b3b6['limit']=qs[_0xb038('0x1b')](_0x2855a6[_0xb038('0x2d')][_0xb038('0x1b')]);_0x12b3b6[_0xb038('0x18')]=qs[_0xb038('0x18')](_0x2855a6[_0xb038('0x2d')]['offset']);}_0x12b3b6[_0xb038('0x33')]=qs[_0xb038('0x34')](_0x2855a6[_0xb038('0x2d')][_0xb038('0x34')]);_0x12b3b6['where']=qs[_0xb038('0x2f')](_[_0xb038('0x35')](_0x2855a6['query'],_0xc387d['filters']),_0x1783d4);if(_0x2855a6[_0xb038('0x2d')][_0xb038('0x36')]){_0x12b3b6[_0xb038('0x37')]=_[_0xb038('0x38')](_0x12b3b6[_0xb038('0x37')],{'$or':_['map'](_0x1783d4,function(_0x404f82){if(_0x404f82[_0xb038('0x2a')]!==_0xb038('0x39')){var _0x2d1e57={};_0x2d1e57[_0x404f82['name']]={'$like':'%'+_0x2855a6[_0xb038('0x2d')][_0xb038('0x36')]+'%'};return _0x2d1e57;}})});}_0x12b3b6=_[_0xb038('0x38')]({},_0x12b3b6,_0x2855a6['options']);var _0x412d71={'where':_0x12b3b6['where']};return db[_0xb038('0x27')][_0xb038('0x1a')](_0x412d71)[_0xb038('0x22')](function(_0x5ce40c){_0x551b55[_0xb038('0x1a')]=_0x5ce40c;if(_0x2855a6[_0xb038('0x2d')][_0xb038('0x3a')]){_0x12b3b6['include']=[{'all':!![]}];}return db[_0xb038('0x27')][_0xb038('0x3b')](_0x12b3b6);})[_0xb038('0x22')](function(_0x3c291e){_0x551b55['rows']=_0x3c291e;return _0x551b55;})[_0xb038('0x22')](respondWithFilteredResult(_0x28a6a9,_0x12b3b6))[_0xb038('0x3c')](handleError(_0x28a6a9,null));};exports[_0xb038('0x3d')]=function(_0x2a0436,_0x52e1d6){var _0x19dc7b={'raw':!![],'where':{'id':_0x2a0436['params']['id']}},_0x269c7d={};_0x269c7d[_0xb038('0x2c')]=_[_0xb038('0x2e')](db[_0xb038('0x27')]['rawAttributes']);_0x269c7d[_0xb038('0x2d')]=_[_0xb038('0x2e')](_0x2a0436['query']);_0x269c7d['filters']=_[_0xb038('0x31')](_0x269c7d[_0xb038('0x2c')],_0x269c7d[_0xb038('0x2d')]);_0x19dc7b[_0xb038('0x30')]=_[_0xb038('0x31')](_0x269c7d[_0xb038('0x2c')],qs[_0xb038('0x32')](_0x2a0436[_0xb038('0x2d')]['fields']));_0x19dc7b['attributes']=_0x19dc7b['attributes'][_0xb038('0x3e')]?_0x19dc7b[_0xb038('0x30')]:_0x269c7d['model'];if(_0x2a0436[_0xb038('0x2d')][_0xb038('0x3a')]){_0x19dc7b[_0xb038('0x3f')]=[{'all':!![]}];}_0x19dc7b=_['merge']({},_0x19dc7b,_0x2a0436[_0xb038('0x40')]);return db['JscriptyAnswerReport']['find'](_0x19dc7b)[_0xb038('0x22')](handleEntityNotFound(_0x52e1d6,null))[_0xb038('0x22')](respondWithResult(_0x52e1d6,null))[_0xb038('0x3c')](handleError(_0x52e1d6,null));};exports[_0xb038('0x41')]=function(_0x304515,_0x3b09e3){return db[_0xb038('0x27')][_0xb038('0x41')](_0x304515[_0xb038('0x42')],{})[_0xb038('0x22')](respondWithResult(_0x3b09e3,0xc9))['catch'](handleError(_0x3b09e3,null));};exports[_0xb038('0x21')]=function(_0x3ed968,_0x5c11d7){if(_0x3ed968[_0xb038('0x42')]['id']){delete _0x3ed968[_0xb038('0x42')]['id'];}return db['JscriptyAnswerReport'][_0xb038('0x43')]({'where':{'id':_0x3ed968[_0xb038('0x44')]['id']}})[_0xb038('0x22')](handleEntityNotFound(_0x5c11d7,null))[_0xb038('0x22')](saveUpdates(_0x3ed968[_0xb038('0x42')],null))[_0xb038('0x22')](respondWithResult(_0x5c11d7,null))[_0xb038('0x3c')](handleError(_0x5c11d7,null));};exports[_0xb038('0x45')]=function(_0x3a291d,_0x54a826){return db[_0xb038('0x27')][_0xb038('0x43')]({'where':{'id':_0x3a291d[_0xb038('0x44')]['id']}})[_0xb038('0x22')](handleEntityNotFound(_0x54a826,null))[_0xb038('0x22')](removeEntity(_0x54a826,null))[_0xb038('0x3c')](handleError(_0x54a826,null));};exports['describe']=function(_0x1f4997,_0x2f3622){return db[_0xb038('0x27')][_0xb038('0x46')]()[_0xb038('0x22')](respondWithResult(_0x2f3622,null))[_0xb038('0x3c')](handleError(_0x2f3622,null));}; \ No newline at end of file +var _0x5fc3=['intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','filter','merge','includeAll','include','findAll','rows','catch','show','options','create','body','find','params','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','destroy','name','send','map','JscriptyAnswerReport','fieldName','type','model','query','keys','filters'];(function(_0x2f7b22,_0x1fd468){var _0x47bf72=function(_0xdca483){while(--_0xdca483){_0x2f7b22['push'](_0x2f7b22['shift']());}};_0x47bf72(++_0x1fd468);}(_0x5fc3,0xa8));var _0x35fc=function(_0x1602ef,_0x447aba){_0x1602ef=_0x1602ef-0x0;var _0x5870ee=_0x5fc3[_0x1602ef];return _0x5870ee;};'use strict';var emlformat=require(_0x35fc('0x0'));var rimraf=require(_0x35fc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x35fc('0x2'));var rp=require(_0x35fc('0x3'));var moment=require(_0x35fc('0x4'));var BPromise=require(_0x35fc('0x5'));var Mustache=require(_0x35fc('0x6'));var util=require('util');var path=require(_0x35fc('0x7'));var sox=require(_0x35fc('0x8'));var csv=require(_0x35fc('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x35fc('0xa'));var squel=require('squel');var crypto=require(_0x35fc('0xb'));var jsforce=require(_0x35fc('0xc'));var deskjs=require(_0x35fc('0xd'));var toCsv=require(_0x35fc('0x9'));var querystring=require(_0x35fc('0xe'));var Papa=require(_0x35fc('0xf'));var Redis=require(_0x35fc('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x35fc('0x11'));var as=require(_0x35fc('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x35fc('0x13'))(_0x35fc('0x14'));var utils=require('../../config/utils');var config=require(_0x35fc('0x15'));var licenseUtil=require(_0x35fc('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4cbe74,_0x409357){_0x409357=_0x409357||0xcc;return function(_0x5d462a){if(_0x5d462a){return _0x4cbe74[_0x35fc('0x17')](_0x409357);}return _0x4cbe74[_0x35fc('0x18')](_0x409357)[_0x35fc('0x19')]();};}function respondWithResult(_0x29730f,_0x38d9f2){_0x38d9f2=_0x38d9f2||0xc8;return function(_0x5cfe94){if(_0x5cfe94){return _0x29730f['status'](_0x38d9f2)['json'](_0x5cfe94);}};}function respondWithFilteredResult(_0x558364,_0x398b67){return function(_0x229d56){if(_0x229d56){var _0x53b898=typeof _0x398b67[_0x35fc('0x1a')]===_0x35fc('0x1b')&&typeof _0x398b67[_0x35fc('0x1c')]==='undefined';var _0x26ba54=_0x229d56[_0x35fc('0x1d')];var _0x553677=_0x53b898?0x0:_0x398b67[_0x35fc('0x1a')];var _0x363e47=_0x53b898?_0x229d56[_0x35fc('0x1d')]:_0x398b67['offset']+_0x398b67[_0x35fc('0x1c')];var _0x3c58ea;if(_0x363e47>=_0x26ba54){_0x363e47=_0x26ba54;_0x3c58ea=0xc8;}else{_0x3c58ea=0xce;}_0x558364[_0x35fc('0x18')](_0x3c58ea);return _0x558364['set'](_0x35fc('0x1e'),_0x553677+'-'+_0x363e47+'/'+_0x26ba54)[_0x35fc('0x1f')](_0x229d56);}return null;};}function patchUpdates(_0x3229d1){return function(_0x251a1f){try{jsonpatch[_0x35fc('0x20')](_0x251a1f,_0x3229d1,!![]);}catch(_0x21f1a9){return BPromise[_0x35fc('0x21')](_0x21f1a9);}return _0x251a1f[_0x35fc('0x22')]();};}function saveUpdates(_0x2405e8,_0x427eae){return function(_0x5bd2b8){if(_0x5bd2b8){return _0x5bd2b8[_0x35fc('0x23')](_0x2405e8)[_0x35fc('0x24')](function(_0x257719){return _0x257719;});}return null;};}function removeEntity(_0x2d8183,_0x3b4743){return function(_0x55e9e7){if(_0x55e9e7){return _0x55e9e7[_0x35fc('0x25')]()[_0x35fc('0x24')](function(){_0x2d8183['status'](0xcc)[_0x35fc('0x19')]();});}};}function handleEntityNotFound(_0x5a93df,_0x3d4a98){return function(_0x51cfec){if(!_0x51cfec){_0x5a93df[_0x35fc('0x17')](0x194);}return _0x51cfec;};}function handleError(_0x598d7a,_0x1bf180){_0x1bf180=_0x1bf180||0x1f4;return function(_0xdfab9f){logger['error'](_0xdfab9f['stack']);if(_0xdfab9f[_0x35fc('0x26')]){delete _0xdfab9f['name'];}_0x598d7a[_0x35fc('0x18')](_0x1bf180)[_0x35fc('0x27')](_0xdfab9f);};}exports['index']=function(_0x26b7cb,_0x645eac){var _0x383837={},_0x9f3c8a={},_0x3735da={'count':0x0,'rows':[]};var _0x134dfa=_[_0x35fc('0x28')](db[_0x35fc('0x29')]['rawAttributes'],function(_0x1cd1ae){return{'name':_0x1cd1ae[_0x35fc('0x2a')],'type':_0x1cd1ae[_0x35fc('0x2b')]['key']};});_0x9f3c8a[_0x35fc('0x2c')]=_[_0x35fc('0x28')](_0x134dfa,_0x35fc('0x26'));_0x9f3c8a[_0x35fc('0x2d')]=_[_0x35fc('0x2e')](_0x26b7cb[_0x35fc('0x2d')]);_0x9f3c8a[_0x35fc('0x2f')]=_[_0x35fc('0x30')](_0x9f3c8a[_0x35fc('0x2c')],_0x9f3c8a[_0x35fc('0x2d')]);_0x383837['attributes']=_['intersection'](_0x9f3c8a[_0x35fc('0x2c')],qs['fields'](_0x26b7cb[_0x35fc('0x2d')][_0x35fc('0x31')]));_0x383837[_0x35fc('0x32')]=_0x383837[_0x35fc('0x32')][_0x35fc('0x33')]?_0x383837[_0x35fc('0x32')]:_0x9f3c8a['model'];if(!_0x26b7cb[_0x35fc('0x2d')][_0x35fc('0x34')](_0x35fc('0x35'))){_0x383837[_0x35fc('0x1c')]=qs[_0x35fc('0x1c')](_0x26b7cb[_0x35fc('0x2d')]['limit']);_0x383837[_0x35fc('0x1a')]=qs[_0x35fc('0x1a')](_0x26b7cb[_0x35fc('0x2d')]['offset']);}_0x383837[_0x35fc('0x36')]=qs['sort'](_0x26b7cb[_0x35fc('0x2d')][_0x35fc('0x37')]);_0x383837[_0x35fc('0x38')]=qs[_0x35fc('0x2f')](_['pick'](_0x26b7cb['query'],_0x9f3c8a['filters']),_0x134dfa);if(_0x26b7cb[_0x35fc('0x2d')]['filter']){_0x383837[_0x35fc('0x38')]=_['merge'](_0x383837[_0x35fc('0x38')],{'$or':_[_0x35fc('0x28')](_0x134dfa,function(_0x2ca9ac){if(_0x2ca9ac[_0x35fc('0x2b')]!==_0x35fc('0x39')){var _0x3313fa={};_0x3313fa[_0x2ca9ac[_0x35fc('0x26')]]={'$like':'%'+_0x26b7cb['query'][_0x35fc('0x3a')]+'%'};return _0x3313fa;}})});}_0x383837=_[_0x35fc('0x3b')]({},_0x383837,_0x26b7cb['options']);var _0x1feda5={'where':_0x383837[_0x35fc('0x38')]};return db[_0x35fc('0x29')][_0x35fc('0x1d')](_0x1feda5)[_0x35fc('0x24')](function(_0x31d926){_0x3735da['count']=_0x31d926;if(_0x26b7cb[_0x35fc('0x2d')][_0x35fc('0x3c')]){_0x383837[_0x35fc('0x3d')]=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0x35fc('0x3e')](_0x383837);})[_0x35fc('0x24')](function(_0x596919){_0x3735da[_0x35fc('0x3f')]=_0x596919;return _0x3735da;})[_0x35fc('0x24')](respondWithFilteredResult(_0x645eac,_0x383837))[_0x35fc('0x40')](handleError(_0x645eac,null));};exports[_0x35fc('0x41')]=function(_0x331439,_0x2a1cf6){var _0x211b70={'raw':!![],'where':{'id':_0x331439['params']['id']}},_0x3ec51f={};_0x3ec51f['model']=_[_0x35fc('0x2e')](db[_0x35fc('0x29')]['rawAttributes']);_0x3ec51f['query']=_['keys'](_0x331439[_0x35fc('0x2d')]);_0x3ec51f[_0x35fc('0x2f')]=_['intersection'](_0x3ec51f[_0x35fc('0x2c')],_0x3ec51f[_0x35fc('0x2d')]);_0x211b70[_0x35fc('0x32')]=_[_0x35fc('0x30')](_0x3ec51f['model'],qs['fields'](_0x331439['query']['fields']));_0x211b70['attributes']=_0x211b70[_0x35fc('0x32')][_0x35fc('0x33')]?_0x211b70['attributes']:_0x3ec51f[_0x35fc('0x2c')];if(_0x331439['query'][_0x35fc('0x3c')]){_0x211b70[_0x35fc('0x3d')]=[{'all':!![]}];}_0x211b70=_[_0x35fc('0x3b')]({},_0x211b70,_0x331439[_0x35fc('0x42')]);return db[_0x35fc('0x29')]['find'](_0x211b70)[_0x35fc('0x24')](handleEntityNotFound(_0x2a1cf6,null))[_0x35fc('0x24')](respondWithResult(_0x2a1cf6,null))['catch'](handleError(_0x2a1cf6,null));};exports[_0x35fc('0x43')]=function(_0x298b7b,_0x2a8a09){return db[_0x35fc('0x29')]['create'](_0x298b7b[_0x35fc('0x44')],{})['then'](respondWithResult(_0x2a8a09,0xc9))['catch'](handleError(_0x2a8a09,null));};exports[_0x35fc('0x23')]=function(_0x9db7e8,_0x18dc78){if(_0x9db7e8[_0x35fc('0x44')]['id']){delete _0x9db7e8[_0x35fc('0x44')]['id'];}return db[_0x35fc('0x29')][_0x35fc('0x45')]({'where':{'id':_0x9db7e8[_0x35fc('0x46')]['id']}})['then'](handleEntityNotFound(_0x18dc78,null))[_0x35fc('0x24')](saveUpdates(_0x9db7e8[_0x35fc('0x44')],null))[_0x35fc('0x24')](respondWithResult(_0x18dc78,null))[_0x35fc('0x40')](handleError(_0x18dc78,null));};exports[_0x35fc('0x25')]=function(_0x1e3221,_0x1b8229){return db[_0x35fc('0x29')][_0x35fc('0x45')]({'where':{'id':_0x1e3221[_0x35fc('0x46')]['id']}})[_0x35fc('0x24')](handleEntityNotFound(_0x1b8229,null))[_0x35fc('0x24')](removeEntity(_0x1b8229,null))[_0x35fc('0x40')](handleError(_0x1b8229,null));};exports[_0x35fc('0x47')]=function(_0x59c666,_0x553ed6){return db[_0x35fc('0x29')][_0x35fc('0x47')]()[_0x35fc('0x24')](respondWithResult(_0x553ed6,null))[_0x35fc('0x40')](handleError(_0x553ed6,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index 79ab2d0..011438f 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 _0xcbf3=['define','JscriptyAnswerReport','report_jscripty_answers','lodash','util','api','moment','bluebird','request-promise','../../config/environment','./jscriptyAnswerReport.attributes'];(function(_0x37a4cc,_0x1531a8){var _0x4ffbbf=function(_0x5d7be5){while(--_0x5d7be5){_0x37a4cc['push'](_0x37a4cc['shift']());}};_0x4ffbbf(++_0x1531a8);}(_0xcbf3,0x18f));var _0x3cbf=function(_0x17928f,_0x4ad33f){_0x17928f=_0x17928f-0x0;var _0x500b63=_0xcbf3[_0x17928f];return _0x500b63;};'use strict';var _=require(_0x3cbf('0x0'));var util=require(_0x3cbf('0x1'));var logger=require('../../config/logger')(_0x3cbf('0x2'));var moment=require(_0x3cbf('0x3'));var BPromise=require(_0x3cbf('0x4'));var rp=require(_0x3cbf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x3cbf('0x6'));var attributes=require(_0x3cbf('0x7'));module['exports']=function(_0x23e8a7,_0x467ec6){return _0x23e8a7[_0x3cbf('0x8')](_0x3cbf('0x9'),attributes,{'tableName':_0x3cbf('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x55e9=['rimraf','../../config/environment','exports','define','JscriptyAnswerReport','lodash','util','api','moment','bluebird'];(function(_0x1f7a9b,_0x509a80){var _0x54d889=function(_0x59a32c){while(--_0x59a32c){_0x1f7a9b['push'](_0x1f7a9b['shift']());}};_0x54d889(++_0x509a80);}(_0x55e9,0x195));var _0x955e=function(_0xc55d64,_0x133f2d){_0xc55d64=_0xc55d64-0x0;var _0x4194f6=_0x55e9[_0xc55d64];return _0x4194f6;};'use strict';var _=require(_0x955e('0x0'));var util=require(_0x955e('0x1'));var logger=require('../../config/logger')(_0x955e('0x2'));var moment=require(_0x955e('0x3'));var BPromise=require(_0x955e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x955e('0x5'));var config=require(_0x955e('0x6'));var attributes=require('./jscriptyAnswerReport.attributes');module[_0x955e('0x7')]=function(_0x21f302,_0x1a0ff7){return _0x21f302[_0x955e('0x8')](_0x955e('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 27834ca..101639c 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 _0x9bc4=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','bluebird'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x9bc4,0x125));var _0x49bc=function(_0x2a6ca8,_0x34daee){_0x2a6ca8=_0x2a6ca8-0x0;var _0x76da82=_0x9bc4[_0x2a6ca8];return _0x76da82;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x49bc('0x0'));var rs=require(_0x49bc('0x1'));var fs=require('fs');var Redis=require(_0x49bc('0x2'));var db=require(_0x49bc('0x3'))['db'];var utils=require(_0x49bc('0x4'));var logger=require(_0x49bc('0x5'))(_0x49bc('0x6'));var config=require(_0x49bc('0x7'));var jayson=require(_0x49bc('0x8'));var client=jayson['client'][_0x49bc('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x475528,_0x4cdff8,_0x4912b3){return new BPromise(function(_0x31dac8,_0x152431){return client[_0x49bc('0xa')](_0x475528,_0x4912b3)[_0x49bc('0xb')](function(_0x3bd372){logger[_0x49bc('0xc')](_0x49bc('0xd'),_0x4cdff8,_0x49bc('0xe'));logger['debug']('JscriptyAnswerReport,\x20%s,\x20%s,\x20%s',_0x4cdff8,'request\x20sent',JSON[_0x49bc('0xf')](_0x3bd372));if(_0x3bd372['error']){if(_0x3bd372[_0x49bc('0x10')][_0x49bc('0x11')]===0x1f4){logger[_0x49bc('0x10')](_0x49bc('0xd'),_0x4cdff8,_0x3bd372[_0x49bc('0x10')][_0x49bc('0x12')]);return _0x152431(_0x3bd372[_0x49bc('0x10')]['message']);}logger['error'](_0x49bc('0xd'),_0x4cdff8,_0x3bd372[_0x49bc('0x10')][_0x49bc('0x12')]);return _0x31dac8(_0x3bd372['error'][_0x49bc('0x12')]);}else{logger['info'](_0x49bc('0xd'),_0x4cdff8,_0x49bc('0xe'));_0x31dac8(_0x3bd372[_0x49bc('0x13')]['message']);}})[_0x49bc('0x14')](function(_0x54ef49){logger[_0x49bc('0x10')](_0x49bc('0xd'),_0x4cdff8,_0x54ef49);_0x152431(_0x54ef49);});});} \ No newline at end of file +var _0xd318=['error','code','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x467622,_0x4ad91){var _0x35ca1a=function(_0x1cdb34){while(--_0x1cdb34){_0x467622['push'](_0x467622['shift']());}};_0x35ca1a(++_0x4ad91);}(_0xd318,0x119));var _0x8d31=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xd318[_0x17d9e3];return _0x14192d;};'use strict';var _=require('lodash');var util=require(_0x8d31('0x0'));var moment=require(_0x8d31('0x1'));var BPromise=require(_0x8d31('0x2'));var rs=require(_0x8d31('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8d31('0x4'))['db'];var utils=require(_0x8d31('0x5'));var logger=require(_0x8d31('0x6'))(_0x8d31('0x7'));var config=require(_0x8d31('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8d31('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4246e3,_0x242c95,_0x4b4b93){return new BPromise(function(_0x1998e2,_0x272fcb){return client[_0x8d31('0xa')](_0x4246e3,_0x4b4b93)[_0x8d31('0xb')](function(_0x446b24){logger[_0x8d31('0xc')](_0x8d31('0xd'),_0x242c95,'request\x20sent');logger[_0x8d31('0xe')](_0x8d31('0xf'),_0x242c95,_0x8d31('0x10'),JSON[_0x8d31('0x11')](_0x446b24));if(_0x446b24['error']){if(_0x446b24[_0x8d31('0x12')][_0x8d31('0x13')]===0x1f4){logger['error'](_0x8d31('0xd'),_0x242c95,_0x446b24[_0x8d31('0x12')]['message']);return _0x272fcb(_0x446b24[_0x8d31('0x12')][_0x8d31('0x14')]);}logger[_0x8d31('0x12')](_0x8d31('0xd'),_0x242c95,_0x446b24[_0x8d31('0x12')][_0x8d31('0x14')]);return _0x1998e2(_0x446b24['error'][_0x8d31('0x14')]);}else{logger[_0x8d31('0xc')](_0x8d31('0xd'),_0x242c95,_0x8d31('0x10'));_0x1998e2(_0x446b24[_0x8d31('0x15')]['message']);}})[_0x8d31('0x16')](function(_0x2b8cb4){logger[_0x8d31('0x12')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x242c95,_0x2b8cb4);_0x272fcb(_0x2b8cb4);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index 89d2adf..012f3b3 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 _0xb521=['create','clone','put','/:id','update','delete','destroy','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','isAuthenticated','get','show','/:id/answers','getAnswers','30s','post'];(function(_0xc831c6,_0x542b00){var _0x5063a7=function(_0x4600ee){while(--_0x4600ee){_0xc831c6['push'](_0xc831c6['shift']());}};_0x5063a7(++_0x542b00);}(_0xb521,0x91));var _0x1b52=function(_0xe5819f,_0x23d35a){_0xe5819f=_0xe5819f-0x0;var _0x4898bf=_0xb521[_0xe5819f];return _0x4898bf;};'use strict';var multer=require('multer');var util=require(_0x1b52('0x0'));var path=require('path');var timeout=require(_0x1b52('0x1'));var express=require(_0x1b52('0x2'));var router=express[_0x1b52('0x3')]();var fs_extra=require(_0x1b52('0x4'));var auth=require(_0x1b52('0x5'));var interaction=require(_0x1b52('0x6'));var config=require(_0x1b52('0x7'));var controller=require(_0x1b52('0x8'));router['get']('/',auth[_0x1b52('0x9')](),controller['index']);router[_0x1b52('0xa')]('/:id',auth[_0x1b52('0x9')](),controller[_0x1b52('0xb')]);router[_0x1b52('0xa')]('/:id/sessions',auth[_0x1b52('0x9')](),controller['getSessions']);router[_0x1b52('0xa')](_0x1b52('0xc'),auth[_0x1b52('0x9')](),controller[_0x1b52('0xd')]);router[_0x1b52('0xa')]('/:id/summary',auth[_0x1b52('0x9')](),timeout(_0x1b52('0xe')),controller['getSummary']);router[_0x1b52('0xf')]('/',auth[_0x1b52('0x9')](),controller[_0x1b52('0x10')]);router[_0x1b52('0xf')]('/:id/clone',auth['isAuthenticated'](),controller[_0x1b52('0x11')]);router[_0x1b52('0x12')](_0x1b52('0x13'),auth[_0x1b52('0x9')](),controller[_0x1b52('0x14')]);router[_0x1b52('0x15')](_0x1b52('0x13'),auth[_0x1b52('0x9')](),controller[_0x1b52('0x16')]);module['exports']=router; \ No newline at end of file +var _0x7ec4=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/:id','show','/:id/sessions','getSessions','/:id/answers','getAnswers','/:id/summary','30s','getSummary','post','/:id/clone','clone','put','update','destroy','exports'];(function(_0x2beb39,_0x1b3b07){var _0x275cea=function(_0x50648b){while(--_0x50648b){_0x2beb39['push'](_0x2beb39['shift']());}};_0x275cea(++_0x1b3b07);}(_0x7ec4,0x150));var _0x47ec=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x7ec4[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require(_0x47ec('0x0'));var util=require(_0x47ec('0x1'));var path=require(_0x47ec('0x2'));var timeout=require(_0x47ec('0x3'));var express=require(_0x47ec('0x4'));var router=express[_0x47ec('0x5')]();var fs_extra=require(_0x47ec('0x6'));var auth=require(_0x47ec('0x7'));var interaction=require(_0x47ec('0x8'));var config=require('../../config/environment');var controller=require('./jscriptyProject.controller');router['get']('/',auth[_0x47ec('0x9')](),controller[_0x47ec('0xa')]);router[_0x47ec('0xb')](_0x47ec('0xc'),auth[_0x47ec('0x9')](),controller[_0x47ec('0xd')]);router[_0x47ec('0xb')](_0x47ec('0xe'),auth['isAuthenticated'](),controller[_0x47ec('0xf')]);router[_0x47ec('0xb')](_0x47ec('0x10'),auth[_0x47ec('0x9')](),controller[_0x47ec('0x11')]);router[_0x47ec('0xb')](_0x47ec('0x12'),auth[_0x47ec('0x9')](),timeout(_0x47ec('0x13')),controller[_0x47ec('0x14')]);router[_0x47ec('0x15')]('/',auth[_0x47ec('0x9')](),controller['create']);router[_0x47ec('0x15')](_0x47ec('0x16'),auth[_0x47ec('0x9')](),controller[_0x47ec('0x17')]);router[_0x47ec('0x18')]('/:id',auth[_0x47ec('0x9')](),controller[_0x47ec('0x19')]);router['delete'](_0x47ec('0xc'),auth[_0x47ec('0x9')](),controller[_0x47ec('0x1a')]);module[_0x47ec('0x1b')]=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index 757bf52..9163d20 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 _0x3e34=['STRING','name','TEXT','long','isObjectLike','formData','stringify','isString','setDataValue','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','BOOLEAN','sequelize','util','exports'];(function(_0x9df060,_0x253d33){var _0x338dfe=function(_0x17d9a5){while(--_0x17d9a5){_0x9df060['push'](_0x9df060['shift']());}};_0x338dfe(++_0x253d33);}(_0x3e34,0x8d));var _0x43e3=function(_0x1499cf,_0x428afe){_0x1499cf=_0x1499cf-0x0;var _0x410333=_0x3e34[_0x1499cf];return _0x410333;};'use strict';var Sequelize=require(_0x43e3('0x0'));var _=require('lodash');var util=require(_0x43e3('0x1'));module[_0x43e3('0x2')]={'name':{'type':Sequelize[_0x43e3('0x3')],'unique':_0x43e3('0x4')},'description':{'type':Sequelize[_0x43e3('0x3')]},'formData':{'type':Sequelize[_0x43e3('0x5')](_0x43e3('0x6')),'set':function(_0x2c7778){if(_[_0x43e3('0x7')](_0x2c7778)){this['setDataValue'](_0x43e3('0x8'),JSON[_0x43e3('0x9')](_0x2c7778));}else if(_[_0x43e3('0xa')](_0x2c7778)){this[_0x43e3('0xb')](_0x43e3('0x8'),_0x2c7778);}else{this[_0x43e3('0xb')](_0x43e3('0x8'),util[_0x43e3('0xc')](_0x43e3('0xd'),this[_0x43e3('0xe')](_0x43e3('0x4'))||'',this[_0x43e3('0xe')]('description')||''));}}},'enableUncompleteSave':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x43e3('0xf')],'defaultValue':![]}}; \ No newline at end of file +var _0x5ca1=['util','exports','STRING','name','long','setDataValue','formData','stringify','isString','format','getDataValue','description','BOOLEAN','sequelize','lodash'];(function(_0x16e57d,_0x2cb7ba){var _0x40239c=function(_0x3cc8f0){while(--_0x3cc8f0){_0x16e57d['push'](_0x16e57d['shift']());}};_0x40239c(++_0x2cb7ba);}(_0x5ca1,0xa3));var _0x15ca=function(_0x368163,_0x1e3010){_0x368163=_0x368163-0x0;var _0x55782e=_0x5ca1[_0x368163];return _0x55782e;};'use strict';var Sequelize=require(_0x15ca('0x0'));var _=require(_0x15ca('0x1'));var util=require(_0x15ca('0x2'));module[_0x15ca('0x3')]={'name':{'type':Sequelize[_0x15ca('0x4')],'unique':_0x15ca('0x5')},'description':{'type':Sequelize['STRING']},'formData':{'type':Sequelize['TEXT'](_0x15ca('0x6')),'set':function(_0x20e434){if(_['isObjectLike'](_0x20e434)){this[_0x15ca('0x7')](_0x15ca('0x8'),JSON[_0x15ca('0x9')](_0x20e434));}else if(_[_0x15ca('0xa')](_0x20e434)){this[_0x15ca('0x7')]('formData',_0x20e434);}else{this[_0x15ca('0x7')]('formData',util[_0x15ca('0xb')]('{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}',this[_0x15ca('0xc')](_0x15ca('0x5'))||'',this[_0x15ca('0xc')](_0x15ca('0xd'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x15ca('0xe')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x15ca('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 a708519..381a8ab 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 _0xca1d=['getSummary','startTime','starttime','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','answer','isEmpty','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Content-type','text/csv','download','eml-format','rimraf','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/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','get','Projects','UserProfileResource','error','stack','name','index','map','rawAttributes','fieldName','type','key','query','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','JscriptyProject','includeAll','include','findAll','catch','params','keys','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','createdAt','updatedAt','userProfileId','JscriptySessionReport','getAnswers','findOne','JscriptyAnswerReport','rows','indexOf','toString','replace'];(function(_0x11c573,_0x9e7c6e){var _0x6b72de=function(_0x2e8a61){while(--_0x2e8a61){_0x11c573['push'](_0x11c573['shift']());}};_0x6b72de(++_0x9e7c6e);}(_0xca1d,0x1e6));var _0xdca1=function(_0x104375,_0x24a179){_0x104375=_0x104375-0x0;var _0xed44a1=_0xca1d[_0x104375];return _0xed44a1;};'use strict';var emlformat=require(_0xdca1('0x0'));var rimraf=require(_0xdca1('0x1'));var zipdir=require(_0xdca1('0x2'));var jsonpatch=require(_0xdca1('0x3'));var rp=require(_0xdca1('0x4'));var moment=require(_0xdca1('0x5'));var BPromise=require(_0xdca1('0x6'));var Mustache=require('mustache');var util=require(_0xdca1('0x7'));var path=require(_0xdca1('0x8'));var sox=require('sox');var csv=require(_0xdca1('0x9'));var ejs=require(_0xdca1('0xa'));var fs=require('fs');var fs_extra=require(_0xdca1('0xb'));var _=require('lodash');var squel=require(_0xdca1('0xc'));var crypto=require(_0xdca1('0xd'));var jsforce=require(_0xdca1('0xe'));var deskjs=require(_0xdca1('0xf'));var toCsv=require(_0xdca1('0x9'));var querystring=require('querystring');var Papa=require(_0xdca1('0x10'));var Redis=require(_0xdca1('0x11'));var authService=require(_0xdca1('0x12'));var qs=require(_0xdca1('0x13'));var as=require(_0xdca1('0x14'));var hardwareService=require(_0xdca1('0x15'));var logger=require('../../config/logger')(_0xdca1('0x16'));var utils=require(_0xdca1('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xdca1('0x18'));var db=require(_0xdca1('0x19'))['db'];function respondWithStatusCode(_0xb3c445,_0x7769ce){_0x7769ce=_0x7769ce||0xcc;return function(_0x1f0cc6){if(_0x1f0cc6){return _0xb3c445[_0xdca1('0x1a')](_0x7769ce);}return _0xb3c445['status'](_0x7769ce)[_0xdca1('0x1b')]();};}function respondWithResult(_0x5aa74c,_0x26bb58){_0x26bb58=_0x26bb58||0xc8;return function(_0x2874df){if(_0x2874df){return _0x5aa74c[_0xdca1('0x1c')](_0x26bb58)[_0xdca1('0x1d')](_0x2874df);}};}function respondWithFilteredResult(_0xd88192,_0xd65f29){return function(_0x375590){if(_0x375590){var _0x4ba1e9=typeof _0xd65f29['offset']===_0xdca1('0x1e')&&typeof _0xd65f29[_0xdca1('0x1f')]===_0xdca1('0x1e');var _0x363f75=_0x375590[_0xdca1('0x20')];var _0x1fad53=_0x4ba1e9?0x0:_0xd65f29[_0xdca1('0x21')];var _0x39aded=_0x4ba1e9?_0x375590[_0xdca1('0x20')]:_0xd65f29[_0xdca1('0x21')]+_0xd65f29[_0xdca1('0x1f')];var _0x44377f;if(_0x39aded>=_0x363f75){_0x39aded=_0x363f75;_0x44377f=0xc8;}else{_0x44377f=0xce;}_0xd88192[_0xdca1('0x1c')](_0x44377f);return _0xd88192[_0xdca1('0x22')](_0xdca1('0x23'),_0x1fad53+'-'+_0x39aded+'/'+_0x363f75)[_0xdca1('0x1d')](_0x375590);}return null;};}function patchUpdates(_0xe84014){return function(_0x52a930){try{jsonpatch[_0xdca1('0x24')](_0x52a930,_0xe84014,!![]);}catch(_0x366e00){return BPromise[_0xdca1('0x25')](_0x366e00);}return _0x52a930[_0xdca1('0x26')]();};}function saveUpdates(_0x46ec7c,_0x2f1d49){return function(_0xad5463){if(_0xad5463){return _0xad5463[_0xdca1('0x27')](_0x46ec7c)['then'](function(_0x45a2a8){return _0x45a2a8;});}return null;};}function removeEntity(_0x4068dd,_0x4a4682){return function(_0xd34c45){if(_0xd34c45){return _0xd34c45[_0xdca1('0x28')]()[_0xdca1('0x29')](function(){var _0x89cba8=_0xd34c45[_0xdca1('0x2a')]({'plain':!![]});var _0x363165=_0xdca1('0x2b');return db[_0xdca1('0x2c')][_0xdca1('0x28')]({'where':{'type':_0x363165,'resourceId':_0x89cba8['id']}})[_0xdca1('0x29')](function(){return _0xd34c45;});})['then'](function(){_0x4068dd[_0xdca1('0x1c')](0xcc)[_0xdca1('0x1b')]();});}};}function handleEntityNotFound(_0x33d8fe,_0x4a87af){return function(_0x23e342){if(!_0x23e342){_0x33d8fe[_0xdca1('0x1a')](0x194);}return _0x23e342;};}function handleError(_0x3da067,_0x202924){_0x202924=_0x202924||0x1f4;return function(_0x4c718b){logger[_0xdca1('0x2d')](_0x4c718b[_0xdca1('0x2e')]);if(_0x4c718b[_0xdca1('0x2f')]){delete _0x4c718b[_0xdca1('0x2f')];}_0x3da067[_0xdca1('0x1c')](_0x202924)['send'](_0x4c718b);};}exports[_0xdca1('0x30')]=function(_0x25bb64,_0x271e9d){var _0x2bc734={},_0x3c3b4f={},_0x156c4f={'count':0x0,'rows':[]};var _0xd7b1fd=_[_0xdca1('0x31')](db['JscriptyProject'][_0xdca1('0x32')],function(_0x4b33ed){return{'name':_0x4b33ed[_0xdca1('0x33')],'type':_0x4b33ed[_0xdca1('0x34')][_0xdca1('0x35')]};});_0x3c3b4f['model']=_['map'](_0xd7b1fd,_0xdca1('0x2f'));_0x3c3b4f[_0xdca1('0x36')]=_['keys'](_0x25bb64[_0xdca1('0x36')]);_0x3c3b4f['filters']=_[_0xdca1('0x37')](_0x3c3b4f['model'],_0x3c3b4f['query']);_0x2bc734[_0xdca1('0x38')]=_[_0xdca1('0x37')](_0x3c3b4f[_0xdca1('0x39')],qs['fields'](_0x25bb64[_0xdca1('0x36')][_0xdca1('0x3a')]));_0x2bc734['attributes']=_0x2bc734[_0xdca1('0x38')][_0xdca1('0x3b')]?_0x2bc734[_0xdca1('0x38')]:_0x3c3b4f[_0xdca1('0x39')];if(!_0x25bb64['query'][_0xdca1('0x3c')](_0xdca1('0x3d'))){_0x2bc734['limit']=qs[_0xdca1('0x1f')](_0x25bb64[_0xdca1('0x36')]['limit']);_0x2bc734[_0xdca1('0x21')]=qs['offset'](_0x25bb64[_0xdca1('0x36')][_0xdca1('0x21')]);}_0x2bc734[_0xdca1('0x3e')]=qs[_0xdca1('0x3f')](_0x25bb64[_0xdca1('0x36')][_0xdca1('0x3f')]);_0x2bc734[_0xdca1('0x40')]=qs[_0xdca1('0x41')](_[_0xdca1('0x42')](_0x25bb64['query'],_0x3c3b4f[_0xdca1('0x41')]),_0xd7b1fd);if(_0x25bb64['query'][_0xdca1('0x43')]){_0x2bc734[_0xdca1('0x40')]=_['merge'](_0x2bc734['where'],{'$or':_[_0xdca1('0x31')](_0xd7b1fd,function(_0x376458){if(_0x376458['type']!=='VIRTUAL'){var _0x32ab34={};_0x32ab34[_0x376458[_0xdca1('0x2f')]]={'$like':'%'+_0x25bb64[_0xdca1('0x36')][_0xdca1('0x43')]+'%'};return _0x32ab34;}})});}_0x2bc734=_[_0xdca1('0x44')]({},_0x2bc734,_0x25bb64[_0xdca1('0x45')]);var _0x832440={'where':_0x2bc734[_0xdca1('0x40')]};return db[_0xdca1('0x46')][_0xdca1('0x20')](_0x832440)[_0xdca1('0x29')](function(_0x4cacb2){_0x156c4f[_0xdca1('0x20')]=_0x4cacb2;if(_0x25bb64[_0xdca1('0x36')][_0xdca1('0x47')]){_0x2bc734[_0xdca1('0x48')]=[{'all':!![]}];}return db[_0xdca1('0x46')][_0xdca1('0x49')](_0x2bc734);})['then'](function(_0x1ed3d9){_0x156c4f['rows']=_0x1ed3d9;return _0x156c4f;})[_0xdca1('0x29')](respondWithFilteredResult(_0x271e9d,_0x2bc734))[_0xdca1('0x4a')](handleError(_0x271e9d,null));};exports['show']=function(_0x6120e5,_0x266b38){var _0x488c37={'raw':![],'where':{'id':_0x6120e5[_0xdca1('0x4b')]['id']}},_0x4ca8df={};_0x4ca8df[_0xdca1('0x39')]=_[_0xdca1('0x4c')](db[_0xdca1('0x46')][_0xdca1('0x32')]);_0x4ca8df[_0xdca1('0x36')]=_[_0xdca1('0x4c')](_0x6120e5[_0xdca1('0x36')]);_0x4ca8df[_0xdca1('0x41')]=_[_0xdca1('0x37')](_0x4ca8df[_0xdca1('0x39')],_0x4ca8df[_0xdca1('0x36')]);_0x488c37[_0xdca1('0x38')]=_['intersection'](_0x4ca8df[_0xdca1('0x39')],qs[_0xdca1('0x3a')](_0x6120e5[_0xdca1('0x36')][_0xdca1('0x3a')]));_0x488c37['attributes']=_0x488c37[_0xdca1('0x38')][_0xdca1('0x3b')]?_0x488c37[_0xdca1('0x38')]:_0x4ca8df['model'];if(_0x6120e5['query'][_0xdca1('0x47')]){_0x488c37[_0xdca1('0x48')]=[{'all':!![]}];}_0x488c37=_[_0xdca1('0x44')]({},_0x488c37,_0x6120e5[_0xdca1('0x45')]);return db[_0xdca1('0x46')][_0xdca1('0x4d')](_0x488c37)[_0xdca1('0x29')](handleEntityNotFound(_0x266b38,null))[_0xdca1('0x29')](respondWithResult(_0x266b38,null))[_0xdca1('0x4a')](handleError(_0x266b38,null));};exports[_0xdca1('0x4e')]=function(_0x1a6a02,_0x539ccf){return db[_0xdca1('0x46')][_0xdca1('0x4e')](_0x1a6a02[_0xdca1('0x4f')],{})['then'](function(_0xe09828){var _0x36f24f=_0x1a6a02[_0xdca1('0x50')][_0xdca1('0x2a')]({'plain':!![]});if(!_0x36f24f)throw new Error(_0xdca1('0x51'));if(_0x36f24f[_0xdca1('0x52')]===_0xdca1('0x50')){var _0x256a8a=_0xe09828[_0xdca1('0x2a')]({'plain':!![]});var _0x377cc6=_0xdca1('0x2b');return db[_0xdca1('0x53')]['find']({'where':{'name':_0x377cc6,'userProfileId':_0x36f24f['userProfileId']},'raw':!![]})[_0xdca1('0x29')](function(_0x2df360){if(_0x2df360&&_0x2df360[_0xdca1('0x54')]===0x0){return db['UserProfileResource']['create']({'name':_0x256a8a['name'],'resourceId':_0x256a8a['id'],'type':_0x2df360[_0xdca1('0x2f')],'sectionId':_0x2df360['id']},{})[_0xdca1('0x29')](function(){return _0xe09828;});}else{return _0xe09828;}})['catch'](function(_0x57778e){logger[_0xdca1('0x2d')](_0xdca1('0x55'),_0x57778e);throw _0x57778e;});}return _0xe09828;})['then'](respondWithResult(_0x539ccf,0xc9))[_0xdca1('0x4a')](handleError(_0x539ccf,null));};exports[_0xdca1('0x56')]=function(_0x5593a9,_0x31d671){var _0x5424a2={'where':{'id':_0x5593a9[_0xdca1('0x4b')]['id']}},_0x1bc5dd={};_0x1bc5dd[_0xdca1('0x39')]=_[_0xdca1('0x4c')](db[_0xdca1('0x46')][_0xdca1('0x32')]);_0x5424a2[_0xdca1('0x38')]=_['intersection'](_0x1bc5dd[_0xdca1('0x39')],qs[_0xdca1('0x3a')](_0x5593a9[_0xdca1('0x36')]['fields']));_0x5424a2[_0xdca1('0x38')]=_0x5424a2['attributes'][_0xdca1('0x3b')]?_0x5424a2['attributes']:_0x1bc5dd[_0xdca1('0x39')];if(_0x5593a9[_0xdca1('0x36')]['includeAll']){_0x5424a2[_0xdca1('0x48')]=[{'all':!![]}];}_0x5424a2=_['merge']({},_0x5424a2,_0x5593a9['options']);return db['JscriptyProject'][_0xdca1('0x4d')](_0x5424a2)[_0xdca1('0x29')](handleEntityNotFound(_0x31d671,null))[_0xdca1('0x29')](function(_0x4a27b1){if(_0x4a27b1){var _0x399dec=_0x4a27b1[_0xdca1('0x2a')]({'plain':!![]});_0x399dec=qs[_0xdca1('0x57')](_0x399dec,['id',_0xdca1('0x58'),'updatedAt']);_0x5593a9[_0xdca1('0x4f')]=_[_0xdca1('0x57')](_0x5593a9[_0xdca1('0x4f')],['id','createdAt',_0xdca1('0x59')]);return db[_0xdca1('0x46')][_0xdca1('0x4e')](_[_0xdca1('0x44')](_0x399dec,_0x5593a9['body']),{'include':_0x5593a9[_0xdca1('0x36')]['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x560039){var _0x409427=_0x5593a9[_0xdca1('0x50')][_0xdca1('0x2a')]({'plain':!![]});if(!_0x409427)throw new Error(_0xdca1('0x51'));if(_0x409427['role']==='user'){var _0x1c97d0=_0x560039['get']({'plain':!![]});var _0x5cc8fe=_0xdca1('0x2b');return db[_0xdca1('0x53')][_0xdca1('0x4d')]({'where':{'name':_0x5cc8fe,'userProfileId':_0x409427[_0xdca1('0x5a')]},'raw':!![]})[_0xdca1('0x29')](function(_0x30c660){if(_0x30c660&&_0x30c660[_0xdca1('0x54')]===0x0){return db[_0xdca1('0x2c')][_0xdca1('0x4e')]({'name':_0x1c97d0['name'],'resourceId':_0x1c97d0['id'],'type':_0x30c660[_0xdca1('0x2f')],'sectionId':_0x30c660['id']},{})[_0xdca1('0x29')](function(){return _0x560039;});}else{return _0x560039;}})[_0xdca1('0x4a')](function(_0x351b81){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x351b81);throw _0x351b81;});}return _0x560039;});}})[_0xdca1('0x29')](respondWithResult(_0x31d671,0xc9))[_0xdca1('0x4a')](handleError(_0x31d671,null));};exports[_0xdca1('0x27')]=function(_0x4bdfde,_0x462ad9){if(_0x4bdfde[_0xdca1('0x4f')]['id']){delete _0x4bdfde['body']['id'];}return db[_0xdca1('0x46')][_0xdca1('0x4d')]({'where':{'id':_0x4bdfde['params']['id']}})[_0xdca1('0x29')](handleEntityNotFound(_0x462ad9,null))['then'](saveUpdates(_0x4bdfde[_0xdca1('0x4f')],null))[_0xdca1('0x29')](respondWithResult(_0x462ad9,null))[_0xdca1('0x4a')](handleError(_0x462ad9,null));};exports[_0xdca1('0x28')]=function(_0x503fdf,_0x5da413){return db[_0xdca1('0x46')][_0xdca1('0x4d')]({'where':{'id':_0x503fdf[_0xdca1('0x4b')]['id']}})[_0xdca1('0x29')](handleEntityNotFound(_0x5da413,null))[_0xdca1('0x29')](removeEntity(_0x5da413,null))[_0xdca1('0x4a')](handleError(_0x5da413,null));};exports['getSessions']=function(_0x571efb,_0x20594c,_0x358bbd){var _0x53f96e={'raw':!![],'where':{}};var _0x48a84f={};var _0x4b6470={'count':0x0,'rows':[]};return db[_0xdca1('0x46')]['findOne']({'where':{'id':_0x571efb[_0xdca1('0x4b')]['id']}})['then'](handleEntityNotFound(_0x20594c,null))[_0xdca1('0x29')](function(_0x44fbf0){if(_0x44fbf0){_0x48a84f[_0xdca1('0x39')]=_[_0xdca1('0x4c')](db['JscriptySessionReport']['rawAttributes']);_0x48a84f[_0xdca1('0x36')]=_['keys'](_0x571efb[_0xdca1('0x36')]);_0x48a84f['filters']=_['intersection'](_0x48a84f[_0xdca1('0x39')],_0x48a84f[_0xdca1('0x36')]);_0x53f96e['attributes']=_[_0xdca1('0x37')](_0x48a84f[_0xdca1('0x39')],qs[_0xdca1('0x3a')](_0x571efb[_0xdca1('0x36')][_0xdca1('0x3a')]));_0x53f96e[_0xdca1('0x38')]=_0x53f96e['attributes'][_0xdca1('0x3b')]?_0x53f96e[_0xdca1('0x38')]:_0x48a84f['model'];if(!_0x571efb[_0xdca1('0x36')][_0xdca1('0x3c')](_0xdca1('0x3d'))){_0x53f96e['limit']=qs[_0xdca1('0x1f')](_0x571efb[_0xdca1('0x36')][_0xdca1('0x1f')]);_0x53f96e[_0xdca1('0x21')]=qs[_0xdca1('0x21')](_0x571efb[_0xdca1('0x36')][_0xdca1('0x21')]);}_0x53f96e[_0xdca1('0x3e')]=qs['sort'](_0x571efb['query'][_0xdca1('0x3f')]);_0x53f96e[_0xdca1('0x40')]=qs['filters'](_['pick'](_0x571efb[_0xdca1('0x36')],_0x48a84f[_0xdca1('0x41')]));_0x53f96e[_0xdca1('0x40')]['ProjectId']=_0x44fbf0['id'];if(_0x571efb['query'][_0xdca1('0x43')]){_0x53f96e[_0xdca1('0x40')]=_[_0xdca1('0x44')](_0x53f96e[_0xdca1('0x40')],{'$or':_[_0xdca1('0x31')](_0x53f96e[_0xdca1('0x38')],function(_0x28566a){var _0x56631b={};_0x56631b[_0x28566a]={'$like':'%'+_0x571efb['query'][_0xdca1('0x43')]+'%'};return _0x56631b;})});}_0x53f96e=_[_0xdca1('0x44')]({},_0x53f96e,_0x571efb[_0xdca1('0x45')]);return db[_0xdca1('0x5b')][_0xdca1('0x20')]({'where':_0x53f96e['where']})['then'](function(_0x5ca3b9){_0x4b6470['count']=_0x5ca3b9;if(_0x571efb[_0xdca1('0x36')][_0xdca1('0x47')]){_0x53f96e[_0xdca1('0x48')]=[{'all':!![]}];}return db[_0xdca1('0x5b')]['findAll'](_0x53f96e);})[_0xdca1('0x29')](function(_0x209f81){_0x4b6470['rows']=_0x209f81;return _0x4b6470;});}})[_0xdca1('0x29')](respondWithFilteredResult(_0x20594c,_0x53f96e))['catch'](handleError(_0x20594c,null));};exports[_0xdca1('0x5c')]=function(_0x59e56d,_0x5f2ff,_0x263825){var _0x4379e7={'raw':!![],'where':{}};var _0x1b0f7={};var _0x7e2ec6={'count':0x0,'rows':[]};return db[_0xdca1('0x46')][_0xdca1('0x5d')]({'where':{'id':_0x59e56d[_0xdca1('0x4b')]['id']}})[_0xdca1('0x29')](handleEntityNotFound(_0x5f2ff,null))[_0xdca1('0x29')](function(_0x555a42){if(_0x555a42){_0x1b0f7[_0xdca1('0x39')]=_[_0xdca1('0x4c')](db[_0xdca1('0x5e')][_0xdca1('0x32')]);_0x1b0f7['query']=_[_0xdca1('0x4c')](_0x59e56d[_0xdca1('0x36')]);_0x1b0f7[_0xdca1('0x41')]=_[_0xdca1('0x37')](_0x1b0f7[_0xdca1('0x39')],_0x1b0f7['query']);_0x4379e7[_0xdca1('0x38')]=_[_0xdca1('0x37')](_0x1b0f7[_0xdca1('0x39')],qs[_0xdca1('0x3a')](_0x59e56d['query']['fields']));_0x4379e7[_0xdca1('0x38')]=_0x4379e7[_0xdca1('0x38')]['length']?_0x4379e7['attributes']:_0x1b0f7[_0xdca1('0x39')];if(!_0x59e56d['query'][_0xdca1('0x3c')](_0xdca1('0x3d'))){_0x4379e7['limit']=qs[_0xdca1('0x1f')](_0x59e56d['query'][_0xdca1('0x1f')]);_0x4379e7['offset']=qs[_0xdca1('0x21')](_0x59e56d[_0xdca1('0x36')][_0xdca1('0x21')]);}_0x4379e7['order']=qs['sort'](_0x59e56d['query'][_0xdca1('0x3f')]);_0x4379e7[_0xdca1('0x40')]=qs[_0xdca1('0x41')](_[_0xdca1('0x42')](_0x59e56d[_0xdca1('0x36')],_0x1b0f7[_0xdca1('0x41')]));_0x4379e7['where']['ProjectId']=_0x555a42['id'];if(_0x59e56d['query']['filter']){_0x4379e7['where']=_[_0xdca1('0x44')](_0x4379e7[_0xdca1('0x40')],{'$or':_[_0xdca1('0x31')](_0x4379e7[_0xdca1('0x38')],function(_0x5ef442){var _0x3a69={};_0x3a69[_0x5ef442]={'$like':'%'+_0x59e56d['query']['filter']+'%'};return _0x3a69;})});}_0x4379e7=_[_0xdca1('0x44')]({},_0x4379e7,_0x59e56d[_0xdca1('0x45')]);return db['JscriptyAnswerReport']['count']({'where':_0x4379e7[_0xdca1('0x40')]})['then'](function(_0x7cba2){_0x7e2ec6[_0xdca1('0x20')]=_0x7cba2;if(_0x59e56d[_0xdca1('0x36')][_0xdca1('0x47')]){_0x4379e7[_0xdca1('0x48')]=[{'all':!![]}];}return db[_0xdca1('0x5e')][_0xdca1('0x49')](_0x4379e7);})[_0xdca1('0x29')](function(_0x2a04d1){_0x7e2ec6[_0xdca1('0x5f')]=_0x2a04d1;return _0x7e2ec6;});}})[_0xdca1('0x29')](respondWithFilteredResult(_0x5f2ff,_0x4379e7))[_0xdca1('0x4a')](handleError(_0x5f2ff,null));};function char(_0x1b0d4d){return'number'===typeof _0x1b0d4d?String['fromCharCode'][_0xdca1('0x24')](null,arguments):_0x1b0d4d;}function needsEncapsulation(_0x5f4b6e){return!!_0x5f4b6e&&(_0x5f4b6e['toString']()[_0xdca1('0x60')](char(0xd))>=0x0||_0x5f4b6e[_0xdca1('0x61')]()[_0xdca1('0x60')](char(0xa))>=0x0||_0x5f4b6e[_0xdca1('0x61')]()[_0xdca1('0x60')](char(0x2c))>=0x0||_0x5f4b6e[_0xdca1('0x61')]()[_0xdca1('0x60')](char(0x22))>=0x0);}function encapsulate(_0x727157){var _0x15a8a2=char(0x22),_0x14c25a='\x5c'+char(0x22),_0x4c3fda=_0x727157[_0xdca1('0x61')]()[_0xdca1('0x62')](new RegExp(_0x15a8a2,'g'),_0x14c25a);return _0x15a8a2+_0x4c3fda+_0x15a8a2;}exports[_0xdca1('0x63')]=function(_0x31af85,_0x9134c9,_0x417a24){var _0x567d29,_0x23c7f8;var _0x301875={'where':{'ProjectId':_0x31af85['params']['id']}};if(_0x31af85['query'][_0xdca1('0x64')]){_0x301875[_0xdca1('0x40')][_0xdca1('0x65')]=JSON['parse'](_0x31af85['query']['startTime']);}return db[_0xdca1('0x5b')]['findAll'](_0x301875)['then'](handleEntityNotFound(_0x9134c9,null))['then'](function(_0x5104d5){if(_0x5104d5){_0x567d29=_0x5104d5;return db['JscriptyQuestionReport'][_0xdca1('0x49')]({'where':{'SessionId':{'$in':_[_0xdca1('0x31')](_0x567d29,'id')},'ProjectId':_0x31af85['params']['id']},'order':_0xdca1('0x66')});}})[_0xdca1('0x29')](handleEntityNotFound(_0x9134c9,null))['then'](function(_0x5821ec){if(_0x5821ec){_0x23c7f8=_0x5821ec;var _0x194bbd={};for(var _0x1957d0=0x0,_0x366bc0=_0x23c7f8[_0xdca1('0x3b')];_0x1957d0<_0x366bc0;_0x1957d0++){if(!_0x194bbd[_0xdca1('0x3c')](_0x23c7f8[_0x1957d0]['questionId'])){_0x194bbd[_0x23c7f8[_0x1957d0][_0xdca1('0x67')]]=needsEncapsulation(_0x23c7f8[_0x1957d0][_0xdca1('0x68')])?encapsulate(_0x23c7f8[_0x1957d0]['question']):_0x23c7f8[_0x1957d0][_0xdca1('0x68')];}}var _0x2d187c=[],_0xc611f8={};for(var _0x2bc77e=0x0,_0x45f871=_0x567d29[_0xdca1('0x3b')];_0x2bc77e<_0x45f871;_0x2bc77e++){_0xc611f8={'ProjectId':_0x31af85[_0xdca1('0x4b')]['id'],'SessionId':_0x567d29[_0x2bc77e]['id'],'StartTime':moment(_0x567d29[_0x2bc77e]['starttime'])[_0xdca1('0x69')](_0xdca1('0x6a'))};for(var _0x557e08=0x0,_0x2bfd1c=_0x23c7f8[_0xdca1('0x3b')];_0x557e08<_0x2bfd1c;_0x557e08++){if(_0x23c7f8[_0x557e08]['SessionId']==_0x567d29[_0x2bc77e]['id']&&_0x194bbd['hasOwnProperty'](_0x23c7f8[_0x557e08][_0xdca1('0x67')])){_0xc611f8[_0x194bbd[_0x23c7f8[_0x557e08][_0xdca1('0x67')]]]=_0x23c7f8[_0x557e08][_0xdca1('0x6b')];}}for(var _0x460d51 in _0x194bbd){if(!_0xc611f8[_0xdca1('0x3c')](_0x194bbd[_0x460d51])){_0xc611f8[_0x194bbd[_0x460d51]]=null;}}_0x2d187c['push'](_0xc611f8);}return _0x2d187c;}})[_0xdca1('0x29')](function(_0x5a697c){if(!_[_0xdca1('0x6c')](_0x5a697c)){var _0x24c935=toCsv(_0x5a697c);var _0x4ba44d=Date['now']();fs[_0xdca1('0x6d')](util[_0xdca1('0x69')](_0xdca1('0x6e'),_0x31af85[_0xdca1('0x4b')]['id'],_0x4ba44d),_0x24c935);_0x9134c9[_0xdca1('0x6f')](_0xdca1('0x70'),_0xdca1('0x71')+util['format']('Jscripty_Project_%d_Summary_%s.csv',_0x31af85[_0xdca1('0x4b')]['id'],_0x4ba44d));_0x9134c9[_0xdca1('0x6f')](_0xdca1('0x72'),_0xdca1('0x73'));return _0x9134c9[_0xdca1('0x74')](util[_0xdca1('0x69')](_0xdca1('0x6e'),_0x31af85['params']['id'],_0x4ba44d));}else{return _0x9134c9['sendStatus'](0xcc);}})['catch'](handleError(_0x9134c9,null));}; \ No newline at end of file +var _0xdadf=['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','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','limit','undefined','count','offset','set','reject','update','then','destroy','get','Projects','UserProfileResource','sendStatus','error','stack','name','map','JscriptyProject','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','show','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','body','UserProfileSection','getSessions','findOne','JscriptySessionReport','ProjectId','findAll','getAnswers','JscriptyAnswerReport','number','fromCharCode','apply','toString','indexOf','replace','starttime','parse','startTime','JscriptyQuestionReport','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','Content-type','download','eml-format','rimraf','fast-json-patch','request-promise','moment'];(function(_0x32b542,_0x4512fa){var _0x554d54=function(_0x35cdfc){while(--_0x35cdfc){_0x32b542['push'](_0x32b542['shift']());}};_0x554d54(++_0x4512fa);}(_0xdadf,0x175));var _0xfdad=function(_0x2b3a9f,_0x1a13b9){_0x2b3a9f=_0x2b3a9f-0x0;var _0x4d013e=_0xdadf[_0x2b3a9f];return _0x4d013e;};'use strict';var emlformat=require(_0xfdad('0x0'));var rimraf=require(_0xfdad('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfdad('0x2'));var rp=require(_0xfdad('0x3'));var moment=require(_0xfdad('0x4'));var BPromise=require(_0xfdad('0x5'));var Mustache=require(_0xfdad('0x6'));var util=require(_0xfdad('0x7'));var path=require(_0xfdad('0x8'));var sox=require(_0xfdad('0x9'));var csv=require(_0xfdad('0xa'));var ejs=require(_0xfdad('0xb'));var fs=require('fs');var fs_extra=require(_0xfdad('0xc'));var _=require(_0xfdad('0xd'));var squel=require(_0xfdad('0xe'));var crypto=require(_0xfdad('0xf'));var jsforce=require(_0xfdad('0x10'));var deskjs=require(_0xfdad('0x11'));var toCsv=require(_0xfdad('0xa'));var querystring=require(_0xfdad('0x12'));var Papa=require(_0xfdad('0x13'));var Redis=require(_0xfdad('0x14'));var authService=require(_0xfdad('0x15'));var qs=require(_0xfdad('0x16'));var as=require(_0xfdad('0x17'));var hardwareService=require(_0xfdad('0x18'));var logger=require(_0xfdad('0x19'))(_0xfdad('0x1a'));var utils=require(_0xfdad('0x1b'));var config=require(_0xfdad('0x1c'));var licenseUtil=require(_0xfdad('0x1d'));var db=require(_0xfdad('0x1e'))['db'];function respondWithStatusCode(_0x20923a,_0x56fe68){_0x56fe68=_0x56fe68||0xcc;return function(_0x36d7a1){if(_0x36d7a1){return _0x20923a['sendStatus'](_0x56fe68);}return _0x20923a[_0xfdad('0x1f')](_0x56fe68)[_0xfdad('0x20')]();};}function respondWithResult(_0x3378b9,_0x58a90e){_0x58a90e=_0x58a90e||0xc8;return function(_0x411093){if(_0x411093){return _0x3378b9[_0xfdad('0x1f')](_0x58a90e)[_0xfdad('0x21')](_0x411093);}};}function respondWithFilteredResult(_0x2367f4,_0x560eed){return function(_0x6aa6b3){if(_0x6aa6b3){var _0x5b2b89=typeof _0x560eed['offset']==='undefined'&&typeof _0x560eed[_0xfdad('0x22')]===_0xfdad('0x23');var _0x3fa2bf=_0x6aa6b3[_0xfdad('0x24')];var _0x5a611e=_0x5b2b89?0x0:_0x560eed[_0xfdad('0x25')];var _0x9940d1=_0x5b2b89?_0x6aa6b3[_0xfdad('0x24')]:_0x560eed['offset']+_0x560eed[_0xfdad('0x22')];var _0x4da818;if(_0x9940d1>=_0x3fa2bf){_0x9940d1=_0x3fa2bf;_0x4da818=0xc8;}else{_0x4da818=0xce;}_0x2367f4[_0xfdad('0x1f')](_0x4da818);return _0x2367f4[_0xfdad('0x26')]('Content-Range',_0x5a611e+'-'+_0x9940d1+'/'+_0x3fa2bf)[_0xfdad('0x21')](_0x6aa6b3);}return null;};}function patchUpdates(_0x578c0b){return function(_0x9773e8){try{jsonpatch['apply'](_0x9773e8,_0x578c0b,!![]);}catch(_0x538020){return BPromise[_0xfdad('0x27')](_0x538020);}return _0x9773e8['save']();};}function saveUpdates(_0x31c418,_0x285fd4){return function(_0x17388a){if(_0x17388a){return _0x17388a[_0xfdad('0x28')](_0x31c418)[_0xfdad('0x29')](function(_0x2d35ea){return _0x2d35ea;});}return null;};}function removeEntity(_0xb7d452,_0x31141a){return function(_0x3b9bb7){if(_0x3b9bb7){return _0x3b9bb7[_0xfdad('0x2a')]()[_0xfdad('0x29')](function(){var _0x21249c=_0x3b9bb7[_0xfdad('0x2b')]({'plain':!![]});var _0x3f66b5=_0xfdad('0x2c');return db[_0xfdad('0x2d')][_0xfdad('0x2a')]({'where':{'type':_0x3f66b5,'resourceId':_0x21249c['id']}})[_0xfdad('0x29')](function(){return _0x3b9bb7;});})[_0xfdad('0x29')](function(){_0xb7d452[_0xfdad('0x1f')](0xcc)[_0xfdad('0x20')]();});}};}function handleEntityNotFound(_0x2da828,_0xaab57d){return function(_0x3f6c85){if(!_0x3f6c85){_0x2da828[_0xfdad('0x2e')](0x194);}return _0x3f6c85;};}function handleError(_0x428a8f,_0x22bab9){_0x22bab9=_0x22bab9||0x1f4;return function(_0x2b6fb3){logger[_0xfdad('0x2f')](_0x2b6fb3[_0xfdad('0x30')]);if(_0x2b6fb3[_0xfdad('0x31')]){delete _0x2b6fb3[_0xfdad('0x31')];}_0x428a8f[_0xfdad('0x1f')](_0x22bab9)['send'](_0x2b6fb3);};}exports['index']=function(_0x567f73,_0x248c7b){var _0x23500b={},_0x1db309={},_0x16e5bc={'count':0x0,'rows':[]};var _0x4fa07b=_[_0xfdad('0x32')](db[_0xfdad('0x33')][_0xfdad('0x34')],function(_0x1cbbfc){return{'name':_0x1cbbfc[_0xfdad('0x35')],'type':_0x1cbbfc['type'][_0xfdad('0x36')]};});_0x1db309[_0xfdad('0x37')]=_['map'](_0x4fa07b,_0xfdad('0x31'));_0x1db309[_0xfdad('0x38')]=_[_0xfdad('0x39')](_0x567f73[_0xfdad('0x38')]);_0x1db309[_0xfdad('0x3a')]=_[_0xfdad('0x3b')](_0x1db309[_0xfdad('0x37')],_0x1db309[_0xfdad('0x38')]);_0x23500b['attributes']=_['intersection'](_0x1db309[_0xfdad('0x37')],qs[_0xfdad('0x3c')](_0x567f73[_0xfdad('0x38')][_0xfdad('0x3c')]));_0x23500b[_0xfdad('0x3d')]=_0x23500b[_0xfdad('0x3d')][_0xfdad('0x3e')]?_0x23500b[_0xfdad('0x3d')]:_0x1db309[_0xfdad('0x37')];if(!_0x567f73[_0xfdad('0x38')][_0xfdad('0x3f')](_0xfdad('0x40'))){_0x23500b[_0xfdad('0x22')]=qs[_0xfdad('0x22')](_0x567f73[_0xfdad('0x38')][_0xfdad('0x22')]);_0x23500b[_0xfdad('0x25')]=qs[_0xfdad('0x25')](_0x567f73['query']['offset']);}_0x23500b[_0xfdad('0x41')]=qs[_0xfdad('0x42')](_0x567f73[_0xfdad('0x38')][_0xfdad('0x42')]);_0x23500b[_0xfdad('0x43')]=qs[_0xfdad('0x3a')](_[_0xfdad('0x44')](_0x567f73[_0xfdad('0x38')],_0x1db309[_0xfdad('0x3a')]),_0x4fa07b);if(_0x567f73[_0xfdad('0x38')]['filter']){_0x23500b['where']=_[_0xfdad('0x45')](_0x23500b['where'],{'$or':_[_0xfdad('0x32')](_0x4fa07b,function(_0x1751f9){if(_0x1751f9['type']!==_0xfdad('0x46')){var _0xa1c4e5={};_0xa1c4e5[_0x1751f9['name']]={'$like':'%'+_0x567f73['query'][_0xfdad('0x47')]+'%'};return _0xa1c4e5;}})});}_0x23500b=_[_0xfdad('0x45')]({},_0x23500b,_0x567f73[_0xfdad('0x48')]);var _0x866252={'where':_0x23500b[_0xfdad('0x43')]};return db[_0xfdad('0x33')][_0xfdad('0x24')](_0x866252)[_0xfdad('0x29')](function(_0x54d2fc){_0x16e5bc['count']=_0x54d2fc;if(_0x567f73[_0xfdad('0x38')][_0xfdad('0x49')]){_0x23500b[_0xfdad('0x4a')]=[{'all':!![]}];}return db[_0xfdad('0x33')]['findAll'](_0x23500b);})['then'](function(_0x54a04b){_0x16e5bc[_0xfdad('0x4b')]=_0x54a04b;return _0x16e5bc;})[_0xfdad('0x29')](respondWithFilteredResult(_0x248c7b,_0x23500b))[_0xfdad('0x4c')](handleError(_0x248c7b,null));};exports[_0xfdad('0x4d')]=function(_0x1edd44,_0xd84959){var _0x173201={'raw':![],'where':{'id':_0x1edd44[_0xfdad('0x4e')]['id']}},_0x90eb98={};_0x90eb98[_0xfdad('0x37')]=_['keys'](db['JscriptyProject'][_0xfdad('0x34')]);_0x90eb98[_0xfdad('0x38')]=_[_0xfdad('0x39')](_0x1edd44['query']);_0x90eb98[_0xfdad('0x3a')]=_[_0xfdad('0x3b')](_0x90eb98[_0xfdad('0x37')],_0x90eb98['query']);_0x173201['attributes']=_['intersection'](_0x90eb98[_0xfdad('0x37')],qs[_0xfdad('0x3c')](_0x1edd44[_0xfdad('0x38')][_0xfdad('0x3c')]));_0x173201[_0xfdad('0x3d')]=_0x173201[_0xfdad('0x3d')]['length']?_0x173201[_0xfdad('0x3d')]:_0x90eb98[_0xfdad('0x37')];if(_0x1edd44['query']['includeAll']){_0x173201[_0xfdad('0x4a')]=[{'all':!![]}];}_0x173201=_['merge']({},_0x173201,_0x1edd44['options']);return db[_0xfdad('0x33')][_0xfdad('0x4f')](_0x173201)['then'](handleEntityNotFound(_0xd84959,null))[_0xfdad('0x29')](respondWithResult(_0xd84959,null))[_0xfdad('0x4c')](handleError(_0xd84959,null));};exports['create']=function(_0x4a9e0e,_0x24fc2b){return db[_0xfdad('0x33')][_0xfdad('0x50')](_0x4a9e0e['body'],{})[_0xfdad('0x29')](function(_0x35f32f){var _0x365dbe=_0x4a9e0e[_0xfdad('0x51')][_0xfdad('0x2b')]({'plain':!![]});if(!_0x365dbe)throw new Error(_0xfdad('0x52'));if(_0x365dbe[_0xfdad('0x53')]===_0xfdad('0x51')){var _0x396e7f=_0x35f32f[_0xfdad('0x2b')]({'plain':!![]});var _0x5607e9='Projects';return db['UserProfileSection'][_0xfdad('0x4f')]({'where':{'name':_0x5607e9,'userProfileId':_0x365dbe[_0xfdad('0x54')]},'raw':!![]})['then'](function(_0x37fdfb){if(_0x37fdfb&&_0x37fdfb[_0xfdad('0x55')]===0x0){return db[_0xfdad('0x2d')][_0xfdad('0x50')]({'name':_0x396e7f[_0xfdad('0x31')],'resourceId':_0x396e7f['id'],'type':_0x37fdfb[_0xfdad('0x31')],'sectionId':_0x37fdfb['id']},{})[_0xfdad('0x29')](function(){return _0x35f32f;});}else{return _0x35f32f;}})[_0xfdad('0x4c')](function(_0xa3292f){logger[_0xfdad('0x2f')](_0xfdad('0x56'),_0xa3292f);throw _0xa3292f;});}return _0x35f32f;})[_0xfdad('0x29')](respondWithResult(_0x24fc2b,0xc9))[_0xfdad('0x4c')](handleError(_0x24fc2b,null));};exports[_0xfdad('0x57')]=function(_0x57b63e,_0x27a4a8){var _0x3a1a69={'where':{'id':_0x57b63e[_0xfdad('0x4e')]['id']}},_0x1c2a8e={};_0x1c2a8e[_0xfdad('0x37')]=_[_0xfdad('0x39')](db[_0xfdad('0x33')][_0xfdad('0x34')]);_0x3a1a69[_0xfdad('0x3d')]=_[_0xfdad('0x3b')](_0x1c2a8e[_0xfdad('0x37')],qs[_0xfdad('0x3c')](_0x57b63e['query'][_0xfdad('0x3c')]));_0x3a1a69[_0xfdad('0x3d')]=_0x3a1a69[_0xfdad('0x3d')]['length']?_0x3a1a69[_0xfdad('0x3d')]:_0x1c2a8e['model'];if(_0x57b63e[_0xfdad('0x38')][_0xfdad('0x49')]){_0x3a1a69[_0xfdad('0x4a')]=[{'all':!![]}];}_0x3a1a69=_[_0xfdad('0x45')]({},_0x3a1a69,_0x57b63e[_0xfdad('0x48')]);return db[_0xfdad('0x33')][_0xfdad('0x4f')](_0x3a1a69)['then'](handleEntityNotFound(_0x27a4a8,null))['then'](function(_0x4184de){if(_0x4184de){var _0x5e3852=_0x4184de[_0xfdad('0x2b')]({'plain':!![]});_0x5e3852=qs[_0xfdad('0x58')](_0x5e3852,['id',_0xfdad('0x59'),_0xfdad('0x5a')]);_0x57b63e['body']=_['omit'](_0x57b63e[_0xfdad('0x5b')],['id',_0xfdad('0x59'),_0xfdad('0x5a')]);return db[_0xfdad('0x33')][_0xfdad('0x50')](_[_0xfdad('0x45')](_0x5e3852,_0x57b63e[_0xfdad('0x5b')]),{'include':_0x57b63e[_0xfdad('0x38')][_0xfdad('0x49')]?[{'all':!![]}]:undefined})[_0xfdad('0x29')](function(_0x478d52){var _0x454e36=_0x57b63e[_0xfdad('0x51')][_0xfdad('0x2b')]({'plain':!![]});if(!_0x454e36)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x454e36[_0xfdad('0x53')]===_0xfdad('0x51')){var _0x19ebcf=_0x478d52['get']({'plain':!![]});var _0x4a31d3=_0xfdad('0x2c');return db[_0xfdad('0x5c')][_0xfdad('0x4f')]({'where':{'name':_0x4a31d3,'userProfileId':_0x454e36[_0xfdad('0x54')]},'raw':!![]})[_0xfdad('0x29')](function(_0x255f51){if(_0x255f51&&_0x255f51[_0xfdad('0x55')]===0x0){return db[_0xfdad('0x2d')][_0xfdad('0x50')]({'name':_0x19ebcf[_0xfdad('0x31')],'resourceId':_0x19ebcf['id'],'type':_0x255f51[_0xfdad('0x31')],'sectionId':_0x255f51['id']},{})[_0xfdad('0x29')](function(){return _0x478d52;});}else{return _0x478d52;}})['catch'](function(_0x482e5a){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x482e5a);throw _0x482e5a;});}return _0x478d52;});}})['then'](respondWithResult(_0x27a4a8,0xc9))[_0xfdad('0x4c')](handleError(_0x27a4a8,null));};exports[_0xfdad('0x28')]=function(_0x5440bb,_0x1270d8){if(_0x5440bb['body']['id']){delete _0x5440bb[_0xfdad('0x5b')]['id'];}return db[_0xfdad('0x33')]['find']({'where':{'id':_0x5440bb[_0xfdad('0x4e')]['id']}})[_0xfdad('0x29')](handleEntityNotFound(_0x1270d8,null))['then'](saveUpdates(_0x5440bb[_0xfdad('0x5b')],null))[_0xfdad('0x29')](respondWithResult(_0x1270d8,null))['catch'](handleError(_0x1270d8,null));};exports[_0xfdad('0x2a')]=function(_0x5030c0,_0xa52f40){return db['JscriptyProject'][_0xfdad('0x4f')]({'where':{'id':_0x5030c0[_0xfdad('0x4e')]['id']}})['then'](handleEntityNotFound(_0xa52f40,null))['then'](removeEntity(_0xa52f40,null))[_0xfdad('0x4c')](handleError(_0xa52f40,null));};exports[_0xfdad('0x5d')]=function(_0x440b63,_0x57d458,_0x16c2ad){var _0x26deac={'raw':!![],'where':{}};var _0x115d61={};var _0x25179e={'count':0x0,'rows':[]};return db[_0xfdad('0x33')][_0xfdad('0x5e')]({'where':{'id':_0x440b63[_0xfdad('0x4e')]['id']}})['then'](handleEntityNotFound(_0x57d458,null))['then'](function(_0x2a03b5){if(_0x2a03b5){_0x115d61[_0xfdad('0x37')]=_[_0xfdad('0x39')](db[_0xfdad('0x5f')][_0xfdad('0x34')]);_0x115d61[_0xfdad('0x38')]=_[_0xfdad('0x39')](_0x440b63[_0xfdad('0x38')]);_0x115d61[_0xfdad('0x3a')]=_[_0xfdad('0x3b')](_0x115d61[_0xfdad('0x37')],_0x115d61[_0xfdad('0x38')]);_0x26deac[_0xfdad('0x3d')]=_[_0xfdad('0x3b')](_0x115d61['model'],qs[_0xfdad('0x3c')](_0x440b63[_0xfdad('0x38')]['fields']));_0x26deac[_0xfdad('0x3d')]=_0x26deac[_0xfdad('0x3d')][_0xfdad('0x3e')]?_0x26deac[_0xfdad('0x3d')]:_0x115d61[_0xfdad('0x37')];if(!_0x440b63['query'][_0xfdad('0x3f')](_0xfdad('0x40'))){_0x26deac[_0xfdad('0x22')]=qs[_0xfdad('0x22')](_0x440b63['query'][_0xfdad('0x22')]);_0x26deac['offset']=qs['offset'](_0x440b63[_0xfdad('0x38')][_0xfdad('0x25')]);}_0x26deac[_0xfdad('0x41')]=qs[_0xfdad('0x42')](_0x440b63[_0xfdad('0x38')]['sort']);_0x26deac[_0xfdad('0x43')]=qs[_0xfdad('0x3a')](_[_0xfdad('0x44')](_0x440b63['query'],_0x115d61[_0xfdad('0x3a')]));_0x26deac['where'][_0xfdad('0x60')]=_0x2a03b5['id'];if(_0x440b63[_0xfdad('0x38')]['filter']){_0x26deac[_0xfdad('0x43')]=_['merge'](_0x26deac['where'],{'$or':_[_0xfdad('0x32')](_0x26deac['attributes'],function(_0x697c62){var _0x20b2df={};_0x20b2df[_0x697c62]={'$like':'%'+_0x440b63['query'][_0xfdad('0x47')]+'%'};return _0x20b2df;})});}_0x26deac=_[_0xfdad('0x45')]({},_0x26deac,_0x440b63[_0xfdad('0x48')]);return db[_0xfdad('0x5f')]['count']({'where':_0x26deac[_0xfdad('0x43')]})['then'](function(_0x2ae35d){_0x25179e[_0xfdad('0x24')]=_0x2ae35d;if(_0x440b63[_0xfdad('0x38')][_0xfdad('0x49')]){_0x26deac[_0xfdad('0x4a')]=[{'all':!![]}];}return db[_0xfdad('0x5f')][_0xfdad('0x61')](_0x26deac);})[_0xfdad('0x29')](function(_0xbd4e4a){_0x25179e[_0xfdad('0x4b')]=_0xbd4e4a;return _0x25179e;});}})[_0xfdad('0x29')](respondWithFilteredResult(_0x57d458,_0x26deac))[_0xfdad('0x4c')](handleError(_0x57d458,null));};exports[_0xfdad('0x62')]=function(_0x298a41,_0x824b4a,_0x4f0991){var _0x42b0b9={'raw':!![],'where':{}};var _0x2ad2da={};var _0x1bbd9a={'count':0x0,'rows':[]};return db[_0xfdad('0x33')][_0xfdad('0x5e')]({'where':{'id':_0x298a41[_0xfdad('0x4e')]['id']}})[_0xfdad('0x29')](handleEntityNotFound(_0x824b4a,null))[_0xfdad('0x29')](function(_0x271a57){if(_0x271a57){_0x2ad2da[_0xfdad('0x37')]=_[_0xfdad('0x39')](db[_0xfdad('0x63')][_0xfdad('0x34')]);_0x2ad2da[_0xfdad('0x38')]=_[_0xfdad('0x39')](_0x298a41[_0xfdad('0x38')]);_0x2ad2da[_0xfdad('0x3a')]=_[_0xfdad('0x3b')](_0x2ad2da[_0xfdad('0x37')],_0x2ad2da[_0xfdad('0x38')]);_0x42b0b9[_0xfdad('0x3d')]=_[_0xfdad('0x3b')](_0x2ad2da[_0xfdad('0x37')],qs[_0xfdad('0x3c')](_0x298a41[_0xfdad('0x38')][_0xfdad('0x3c')]));_0x42b0b9[_0xfdad('0x3d')]=_0x42b0b9['attributes'][_0xfdad('0x3e')]?_0x42b0b9[_0xfdad('0x3d')]:_0x2ad2da['model'];if(!_0x298a41[_0xfdad('0x38')][_0xfdad('0x3f')](_0xfdad('0x40'))){_0x42b0b9['limit']=qs['limit'](_0x298a41[_0xfdad('0x38')][_0xfdad('0x22')]);_0x42b0b9[_0xfdad('0x25')]=qs[_0xfdad('0x25')](_0x298a41[_0xfdad('0x38')][_0xfdad('0x25')]);}_0x42b0b9['order']=qs[_0xfdad('0x42')](_0x298a41[_0xfdad('0x38')][_0xfdad('0x42')]);_0x42b0b9['where']=qs[_0xfdad('0x3a')](_[_0xfdad('0x44')](_0x298a41[_0xfdad('0x38')],_0x2ad2da[_0xfdad('0x3a')]));_0x42b0b9[_0xfdad('0x43')][_0xfdad('0x60')]=_0x271a57['id'];if(_0x298a41[_0xfdad('0x38')][_0xfdad('0x47')]){_0x42b0b9[_0xfdad('0x43')]=_[_0xfdad('0x45')](_0x42b0b9[_0xfdad('0x43')],{'$or':_[_0xfdad('0x32')](_0x42b0b9[_0xfdad('0x3d')],function(_0x38189d){var _0x5acf4f={};_0x5acf4f[_0x38189d]={'$like':'%'+_0x298a41[_0xfdad('0x38')][_0xfdad('0x47')]+'%'};return _0x5acf4f;})});}_0x42b0b9=_['merge']({},_0x42b0b9,_0x298a41['options']);return db['JscriptyAnswerReport'][_0xfdad('0x24')]({'where':_0x42b0b9[_0xfdad('0x43')]})[_0xfdad('0x29')](function(_0x27278e){_0x1bbd9a[_0xfdad('0x24')]=_0x27278e;if(_0x298a41[_0xfdad('0x38')][_0xfdad('0x49')]){_0x42b0b9[_0xfdad('0x4a')]=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0xfdad('0x61')](_0x42b0b9);})['then'](function(_0x5063a2){_0x1bbd9a[_0xfdad('0x4b')]=_0x5063a2;return _0x1bbd9a;});}})[_0xfdad('0x29')](respondWithFilteredResult(_0x824b4a,_0x42b0b9))[_0xfdad('0x4c')](handleError(_0x824b4a,null));};function char(_0x565a8f){return _0xfdad('0x64')===typeof _0x565a8f?String[_0xfdad('0x65')][_0xfdad('0x66')](null,arguments):_0x565a8f;}function needsEncapsulation(_0x54c045){return!!_0x54c045&&(_0x54c045[_0xfdad('0x67')]()[_0xfdad('0x68')](char(0xd))>=0x0||_0x54c045[_0xfdad('0x67')]()['indexOf'](char(0xa))>=0x0||_0x54c045['toString']()[_0xfdad('0x68')](char(0x2c))>=0x0||_0x54c045[_0xfdad('0x67')]()[_0xfdad('0x68')](char(0x22))>=0x0);}function encapsulate(_0x497ad9){var _0x1fe2df=char(0x22),_0x9534a7='\x5c'+char(0x22),_0x55bba4=_0x497ad9['toString']()[_0xfdad('0x69')](new RegExp(_0x1fe2df,'g'),_0x9534a7);return _0x1fe2df+_0x55bba4+_0x1fe2df;}exports['getSummary']=function(_0x180815,_0x39b229,_0x5ec49f){var _0x12f1a1,_0x5018b1;var _0x17409e={'where':{'ProjectId':_0x180815[_0xfdad('0x4e')]['id']}};if(_0x180815[_0xfdad('0x38')]['startTime']){_0x17409e[_0xfdad('0x43')][_0xfdad('0x6a')]=JSON[_0xfdad('0x6b')](_0x180815['query'][_0xfdad('0x6c')]);}return db[_0xfdad('0x5f')][_0xfdad('0x61')](_0x17409e)[_0xfdad('0x29')](handleEntityNotFound(_0x39b229,null))[_0xfdad('0x29')](function(_0xe2e1ea){if(_0xe2e1ea){_0x12f1a1=_0xe2e1ea;return db[_0xfdad('0x6d')]['findAll']({'where':{'SessionId':{'$in':_[_0xfdad('0x32')](_0x12f1a1,'id')},'ProjectId':_0x180815[_0xfdad('0x4e')]['id']},'order':_0xfdad('0x6e')});}})[_0xfdad('0x29')](handleEntityNotFound(_0x39b229,null))['then'](function(_0x381856){if(_0x381856){_0x5018b1=_0x381856;var _0x16fd6b={};for(var _0x591767=0x0,_0x3dc27f=_0x5018b1[_0xfdad('0x3e')];_0x591767<_0x3dc27f;_0x591767++){if(!_0x16fd6b[_0xfdad('0x3f')](_0x5018b1[_0x591767][_0xfdad('0x6f')])){_0x16fd6b[_0x5018b1[_0x591767]['questionId']]=needsEncapsulation(_0x5018b1[_0x591767]['question'])?encapsulate(_0x5018b1[_0x591767]['question']):_0x5018b1[_0x591767][_0xfdad('0x70')];}}var _0x5b4d61=[],_0x50cf74={};for(var _0x5b05be=0x0,_0x1eb9d3=_0x12f1a1[_0xfdad('0x3e')];_0x5b05be<_0x1eb9d3;_0x5b05be++){_0x50cf74={'ProjectId':_0x180815['params']['id'],'SessionId':_0x12f1a1[_0x5b05be]['id'],'StartTime':moment(_0x12f1a1[_0x5b05be]['starttime'])[_0xfdad('0x71')](_0xfdad('0x72'))};for(var _0x4618b5=0x0,_0x2bc162=_0x5018b1[_0xfdad('0x3e')];_0x4618b5<_0x2bc162;_0x4618b5++){if(_0x5018b1[_0x4618b5][_0xfdad('0x73')]==_0x12f1a1[_0x5b05be]['id']&&_0x16fd6b['hasOwnProperty'](_0x5018b1[_0x4618b5][_0xfdad('0x6f')])){_0x50cf74[_0x16fd6b[_0x5018b1[_0x4618b5][_0xfdad('0x6f')]]]=_0x5018b1[_0x4618b5][_0xfdad('0x74')];}}for(var _0xce1acc in _0x16fd6b){if(!_0x50cf74['hasOwnProperty'](_0x16fd6b[_0xce1acc])){_0x50cf74[_0x16fd6b[_0xce1acc]]=null;}}_0x5b4d61['push'](_0x50cf74);}return _0x5b4d61;}})[_0xfdad('0x29')](function(_0x221ab8){if(!_['isEmpty'](_0x221ab8)){var _0x19ab38=toCsv(_0x221ab8);var _0x4cac4b=Date[_0xfdad('0x75')]();fs[_0xfdad('0x76')](util['format'](_0xfdad('0x77'),_0x180815[_0xfdad('0x4e')]['id'],_0x4cac4b),_0x19ab38);_0x39b229[_0xfdad('0x78')](_0xfdad('0x79'),_0xfdad('0x7a')+util[_0xfdad('0x71')](_0xfdad('0x7b'),_0x180815[_0xfdad('0x4e')]['id'],_0x4cac4b));_0x39b229[_0xfdad('0x78')](_0xfdad('0x7c'),'text/csv');return _0x39b229[_0xfdad('0x7d')](util[_0xfdad('0x71')](_0xfdad('0x77'),_0x180815[_0xfdad('0x4e')]['id'],_0x4cac4b));}else{return _0x39b229[_0xfdad('0x2e')](0xcc);}})[_0xfdad('0x4c')](handleError(_0x39b229,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index 4bb7677..518978d 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 _0xee14=['JscriptyProject','jscripty_projects','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptyProject.attributes','define'];(function(_0x50c811,_0xfe7ff3){var _0x2b679c=function(_0x26e9fc){while(--_0x26e9fc){_0x50c811['push'](_0x50c811['shift']());}};_0x2b679c(++_0xfe7ff3);}(_0xee14,0x13a));var _0x4ee1=function(_0x4c854a,_0x5f1d33){_0x4c854a=_0x4c854a-0x0;var _0x5d71da=_0xee14[_0x4c854a];return _0x5d71da;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4ee1('0x0'))(_0x4ee1('0x1'));var moment=require(_0x4ee1('0x2'));var BPromise=require(_0x4ee1('0x3'));var rp=require(_0x4ee1('0x4'));var fs=require('fs');var path=require(_0x4ee1('0x5'));var rimraf=require(_0x4ee1('0x6'));var config=require(_0x4ee1('0x7'));var attributes=require(_0x4ee1('0x8'));module['exports']=function(_0xba6d36,_0x573700){return _0xba6d36[_0x4ee1('0x9')](_0x4ee1('0xa'),attributes,{'tableName':_0x4ee1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x96f1=['./jscriptyProject.attributes','exports','define','jscripty_projects','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x4e2c9d,_0x1cc6b4){var _0x1a3102=function(_0x400a82){while(--_0x400a82){_0x4e2c9d['push'](_0x4e2c9d['shift']());}};_0x1a3102(++_0x1cc6b4);}(_0x96f1,0x19c));var _0x196f=function(_0x2e3ec4,_0x220b08){_0x2e3ec4=_0x2e3ec4-0x0;var _0x2c95d8=_0x96f1[_0x2e3ec4];return _0x2c95d8;};'use strict';var _=require(_0x196f('0x0'));var util=require(_0x196f('0x1'));var logger=require(_0x196f('0x2'))(_0x196f('0x3'));var moment=require(_0x196f('0x4'));var BPromise=require(_0x196f('0x5'));var rp=require(_0x196f('0x6'));var fs=require('fs');var path=require(_0x196f('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x196f('0x8'));module[_0x196f('0x9')]=function(_0x267906,_0x1f401c){return _0x267906[_0x196f('0xa')]('JscriptyProject',attributes,{'tableName':_0x196f('0xb'),'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 fd36101..f2f4aaf 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 _0x70e0=['code','JscriptyProject,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x769627,_0x10e1f8){var _0x5d67d2=function(_0x2c5f51){while(--_0x2c5f51){_0x769627['push'](_0x769627['shift']());}};_0x5d67d2(++_0x10e1f8);}(_0x70e0,0x17b));var _0x070e=function(_0x3157a9,_0x15b989){_0x3157a9=_0x3157a9-0x0;var _0x43457c=_0x70e0[_0x3157a9];return _0x43457c;};'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')]('JscriptyProject,\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')]('JscriptyProject,\x20%s,\x20%s',_0x5032e5,_0x68a09e['error']['message']);return _0x1e11f0(_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);}else{logger['info']('JscriptyProject,\x20%s,\x20%s',_0x5032e5,_0x070e('0xe'));_0x1e11f0(_0x68a09e[_0x070e('0x14')][_0x070e('0x13')]);}})[_0x070e('0x15')](function(_0x5bc71e){logger['error'](_0x070e('0x12'),_0x5032e5,_0x5bc71e);_0x604664(_0x5bc71e);});});} \ No newline at end of file +var _0xe706=['http','request','then','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x25a223,_0x1adf07){var _0x1691a3=function(_0x5cfe15){while(--_0x5cfe15){_0x25a223['push'](_0x25a223['shift']());}};_0x1691a3(++_0x1adf07);}(_0xe706,0xa3));var _0x6e70=function(_0x4c378e,_0x286afb){_0x4c378e=_0x4c378e-0x0;var _0xf41ce7=_0xe706[_0x4c378e];return _0xf41ce7;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var moment=require(_0x6e70('0x2'));var BPromise=require('bluebird');var rs=require(_0x6e70('0x3'));var fs=require('fs');var Redis=require(_0x6e70('0x4'));var db=require(_0x6e70('0x5'))['db'];var utils=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));var config=require(_0x6e70('0x9'));var jayson=require(_0x6e70('0xa'));var client=jayson[_0x6e70('0xb')][_0x6e70('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x36357b,_0x293ce7,_0x45a2d4){return new BPromise(function(_0x188ed3,_0x3c4843){return client[_0x6e70('0xd')](_0x36357b,_0x45a2d4)[_0x6e70('0xe')](function(_0x25e61c){logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,_0x6e70('0x11'));logger[_0x6e70('0x12')](_0x6e70('0x13'),_0x293ce7,_0x6e70('0x11'),JSON['stringify'](_0x25e61c));if(_0x25e61c['error']){if(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x15')]===0x1f4){logger[_0x6e70('0x14')](_0x6e70('0x10'),_0x293ce7,_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);return _0x3c4843(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);}logger['error']('JscriptyProject,\x20%s,\x20%s',_0x293ce7,_0x25e61c['error'][_0x6e70('0x16')]);return _0x188ed3(_0x25e61c['error']['message']);}else{logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,'request\x20sent');_0x188ed3(_0x25e61c[_0x6e70('0x17')]['message']);}})[_0x6e70('0x18')](function(_0x161f23){logger['error']('JscriptyProject,\x20%s,\x20%s',_0x293ce7,_0x161f23);_0x3c4843(_0x161f23);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index 82674dd..7acadbd 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 _0x7790=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','index','get','describe','isAuthenticated','show','post','create','put','/:id','update','delete','destroy','exports','util','path','connect-timeout','express'];(function(_0x21cb7f,_0x3a64fe){var _0x1cbe94=function(_0x469011){while(--_0x469011){_0x21cb7f['push'](_0x21cb7f['shift']());}};_0x1cbe94(++_0x3a64fe);}(_0x7790,0x110));var _0x0779=function(_0x436cfc,_0x3ee7a3){_0x436cfc=_0x436cfc-0x0;var _0x2cac0e=_0x7790[_0x436cfc];return _0x2cac0e;};'use strict';var multer=require('multer');var util=require(_0x0779('0x0'));var path=require(_0x0779('0x1'));var timeout=require(_0x0779('0x2'));var express=require(_0x0779('0x3'));var router=express[_0x0779('0x4')]();var fs_extra=require(_0x0779('0x5'));var auth=require(_0x0779('0x6'));var interaction=require(_0x0779('0x7'));var config=require(_0x0779('0x8'));var controller=require(_0x0779('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x0779('0xa')]);router[_0x0779('0xb')]('/describe',auth['isAuthenticated'](),controller[_0x0779('0xc')]);router[_0x0779('0xb')]('/:id',auth[_0x0779('0xd')](),controller[_0x0779('0xe')]);router[_0x0779('0xf')]('/',auth[_0x0779('0xd')](),controller[_0x0779('0x10')]);router[_0x0779('0x11')](_0x0779('0x12'),auth[_0x0779('0xd')](),controller[_0x0779('0x13')]);router[_0x0779('0x14')](_0x0779('0x12'),auth[_0x0779('0xd')](),controller[_0x0779('0x15')]);module[_0x0779('0x16')]=router; \ No newline at end of file +var _0x267c=['util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','get','index','/describe','describe','/:id','isAuthenticated','show','post','create','put','delete','destroy'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x267c,0xfc));var _0xc267=function(_0xcb9d19,_0xbaf70d){_0xcb9d19=_0xcb9d19-0x0;var _0x3d3c41=_0x267c[_0xcb9d19];return _0x3d3c41;};'use strict';var multer=require('multer');var util=require(_0xc267('0x0'));var path=require(_0xc267('0x1'));var timeout=require(_0xc267('0x2'));var express=require(_0xc267('0x3'));var router=express[_0xc267('0x4')]();var fs_extra=require(_0xc267('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xc267('0x6'));var config=require(_0xc267('0x7'));var controller=require(_0xc267('0x8'));router[_0xc267('0x9')]('/',auth['isAuthenticated'](),controller[_0xc267('0xa')]);router['get'](_0xc267('0xb'),auth['isAuthenticated'](),controller[_0xc267('0xc')]);router[_0xc267('0x9')](_0xc267('0xd'),auth[_0xc267('0xe')](),controller[_0xc267('0xf')]);router[_0xc267('0x10')]('/',auth[_0xc267('0xe')](),controller[_0xc267('0x11')]);router[_0xc267('0x12')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xc267('0x13')](_0xc267('0xd'),auth[_0xc267('0xe')](),controller[_0xc267('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index 5b41821..4e60f27 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(_0x4a747d,_0x3b747f){var _0x3a5b5c=function(_0x4b3e81){while(--_0x4b3e81){_0x4a747d['push'](_0x4a747d['shift']());}};_0x3a5b5c(++_0x3b747f);}(_0x7a54,0x106));var _0x47a5=function(_0x1130ec,_0x38eba3){_0x1130ec=_0x1130ec-0x0;var _0x27387c=_0x7a54[_0x1130ec];return _0x27387c;};'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(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_0x7a54,0x106));var _0x47a5=function(_0x33ed55,_0x46e699){_0x33ed55=_0x33ed55-0x0;var _0x17a50b=_0x7a54[_0x33ed55];return _0x17a50b;};'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 6687a80..90c44fd 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 _0x979a=['map','JscriptyQuestionReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','error','stack','name','index'];(function(_0x106487,_0x23de58){var _0xc1da08=function(_0x2b06db){while(--_0x2b06db){_0x106487['push'](_0x106487['shift']());}};_0xc1da08(++_0x23de58);}(_0x979a,0x6c));var _0xa979=function(_0xbcd604,_0x5c6862){_0xbcd604=_0xbcd604-0x0;var _0x16a71e=_0x979a[_0xbcd604];return _0x16a71e;};'use strict';var emlformat=require(_0xa979('0x0'));var rimraf=require(_0xa979('0x1'));var zipdir=require(_0xa979('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa979('0x3'));var BPromise=require(_0xa979('0x4'));var Mustache=require(_0xa979('0x5'));var util=require(_0xa979('0x6'));var path=require(_0xa979('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa979('0x8'));var fs=require('fs');var fs_extra=require(_0xa979('0x9'));var _=require('lodash');var squel=require(_0xa979('0xa'));var crypto=require('crypto');var jsforce=require(_0xa979('0xb'));var deskjs=require(_0xa979('0xc'));var toCsv=require('to-csv');var querystring=require(_0xa979('0xd'));var Papa=require(_0xa979('0xe'));var Redis=require('ioredis');var authService=require(_0xa979('0xf'));var qs=require(_0xa979('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa979('0x11'));var logger=require(_0xa979('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xa979('0x13'));var db=require(_0xa979('0x14'))['db'];function respondWithStatusCode(_0x1be004,_0x572d49){_0x572d49=_0x572d49||0xcc;return function(_0xe8b5a2){if(_0xe8b5a2){return _0x1be004[_0xa979('0x15')](_0x572d49);}return _0x1be004[_0xa979('0x16')](_0x572d49)[_0xa979('0x17')]();};}function respondWithResult(_0x3a9280,_0x41d775){_0x41d775=_0x41d775||0xc8;return function(_0x499780){if(_0x499780){return _0x3a9280['status'](_0x41d775)[_0xa979('0x18')](_0x499780);}};}function respondWithFilteredResult(_0x42f3c6,_0x4447f3){return function(_0x22e4a5){if(_0x22e4a5){var _0x1b5bfa=typeof _0x4447f3[_0xa979('0x19')]===_0xa979('0x1a')&&typeof _0x4447f3[_0xa979('0x1b')]===_0xa979('0x1a');var _0x1394ca=_0x22e4a5['count'];var _0x4d3df1=_0x1b5bfa?0x0:_0x4447f3[_0xa979('0x19')];var _0x4ffc3b=_0x1b5bfa?_0x22e4a5[_0xa979('0x1c')]:_0x4447f3[_0xa979('0x19')]+_0x4447f3['limit'];var _0x37c804;if(_0x4ffc3b>=_0x1394ca){_0x4ffc3b=_0x1394ca;_0x37c804=0xc8;}else{_0x37c804=0xce;}_0x42f3c6[_0xa979('0x16')](_0x37c804);return _0x42f3c6[_0xa979('0x1d')](_0xa979('0x1e'),_0x4d3df1+'-'+_0x4ffc3b+'/'+_0x1394ca)[_0xa979('0x18')](_0x22e4a5);}return null;};}function patchUpdates(_0x404055){return function(_0x21ed60){try{jsonpatch['apply'](_0x21ed60,_0x404055,!![]);}catch(_0x2f90b2){return BPromise[_0xa979('0x1f')](_0x2f90b2);}return _0x21ed60['save']();};}function saveUpdates(_0x1d682e,_0x1a5919){return function(_0x1aecc7){if(_0x1aecc7){return _0x1aecc7[_0xa979('0x20')](_0x1d682e)['then'](function(_0x59d803){return _0x59d803;});}return null;};}function removeEntity(_0x5a1092,_0x1b0688){return function(_0x4b4257){if(_0x4b4257){return _0x4b4257['destroy']()[_0xa979('0x21')](function(){_0x5a1092[_0xa979('0x16')](0xcc)[_0xa979('0x17')]();});}};}function handleEntityNotFound(_0x14b65d,_0x10476a){return function(_0x3c8346){if(!_0x3c8346){_0x14b65d[_0xa979('0x15')](0x194);}return _0x3c8346;};}function handleError(_0x4db81d,_0xbff58d){_0xbff58d=_0xbff58d||0x1f4;return function(_0x197217){logger[_0xa979('0x22')](_0x197217[_0xa979('0x23')]);if(_0x197217[_0xa979('0x24')]){delete _0x197217[_0xa979('0x24')];}_0x4db81d[_0xa979('0x16')](_0xbff58d)['send'](_0x197217);};}exports[_0xa979('0x25')]=function(_0x3ed822,_0x5e0a36){var _0x5b3a69={},_0x5ec071={},_0x4a0d8e={'count':0x0,'rows':[]};var _0x4917bd=_[_0xa979('0x26')](db[_0xa979('0x27')][_0xa979('0x28')],function(_0x3a6c70){return{'name':_0x3a6c70[_0xa979('0x29')],'type':_0x3a6c70[_0xa979('0x2a')][_0xa979('0x2b')]};});_0x5ec071[_0xa979('0x2c')]=_['map'](_0x4917bd,_0xa979('0x24'));_0x5ec071[_0xa979('0x2d')]=_[_0xa979('0x2e')](_0x3ed822[_0xa979('0x2d')]);_0x5ec071[_0xa979('0x2f')]=_[_0xa979('0x30')](_0x5ec071[_0xa979('0x2c')],_0x5ec071['query']);_0x5b3a69['attributes']=_['intersection'](_0x5ec071['model'],qs['fields'](_0x3ed822[_0xa979('0x2d')][_0xa979('0x31')]));_0x5b3a69[_0xa979('0x32')]=_0x5b3a69[_0xa979('0x32')][_0xa979('0x33')]?_0x5b3a69['attributes']:_0x5ec071[_0xa979('0x2c')];if(!_0x3ed822[_0xa979('0x2d')][_0xa979('0x34')](_0xa979('0x35'))){_0x5b3a69[_0xa979('0x1b')]=qs[_0xa979('0x1b')](_0x3ed822['query'][_0xa979('0x1b')]);_0x5b3a69[_0xa979('0x19')]=qs[_0xa979('0x19')](_0x3ed822[_0xa979('0x2d')][_0xa979('0x19')]);}_0x5b3a69[_0xa979('0x36')]=qs[_0xa979('0x37')](_0x3ed822[_0xa979('0x2d')][_0xa979('0x37')]);_0x5b3a69[_0xa979('0x38')]=qs[_0xa979('0x2f')](_[_0xa979('0x39')](_0x3ed822[_0xa979('0x2d')],_0x5ec071['filters']),_0x4917bd);if(_0x3ed822[_0xa979('0x2d')][_0xa979('0x3a')]){_0x5b3a69[_0xa979('0x38')]=_[_0xa979('0x3b')](_0x5b3a69[_0xa979('0x38')],{'$or':_[_0xa979('0x26')](_0x4917bd,function(_0xb64809){if(_0xb64809[_0xa979('0x2a')]!==_0xa979('0x3c')){var _0x3a1d16={};_0x3a1d16[_0xb64809['name']]={'$like':'%'+_0x3ed822[_0xa979('0x2d')]['filter']+'%'};return _0x3a1d16;}})});}_0x5b3a69=_[_0xa979('0x3b')]({},_0x5b3a69,_0x3ed822['options']);var _0x5cdebd={'where':_0x5b3a69[_0xa979('0x38')]};return db[_0xa979('0x27')]['count'](_0x5cdebd)['then'](function(_0x475071){_0x4a0d8e[_0xa979('0x1c')]=_0x475071;if(_0x3ed822[_0xa979('0x2d')][_0xa979('0x3d')]){_0x5b3a69[_0xa979('0x3e')]=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0xa979('0x3f')](_0x5b3a69);})[_0xa979('0x21')](function(_0x460bba){_0x4a0d8e[_0xa979('0x40')]=_0x460bba;return _0x4a0d8e;})[_0xa979('0x21')](respondWithFilteredResult(_0x5e0a36,_0x5b3a69))[_0xa979('0x41')](handleError(_0x5e0a36,null));};exports[_0xa979('0x42')]=function(_0x3751dc,_0x348974){var _0x22690c={'raw':!![],'where':{'id':_0x3751dc[_0xa979('0x43')]['id']}},_0x498be6={};_0x498be6[_0xa979('0x2c')]=_[_0xa979('0x2e')](db[_0xa979('0x27')][_0xa979('0x28')]);_0x498be6['query']=_[_0xa979('0x2e')](_0x3751dc[_0xa979('0x2d')]);_0x498be6[_0xa979('0x2f')]=_[_0xa979('0x30')](_0x498be6['model'],_0x498be6[_0xa979('0x2d')]);_0x22690c[_0xa979('0x32')]=_[_0xa979('0x30')](_0x498be6[_0xa979('0x2c')],qs[_0xa979('0x31')](_0x3751dc['query'][_0xa979('0x31')]));_0x22690c[_0xa979('0x32')]=_0x22690c[_0xa979('0x32')]['length']?_0x22690c[_0xa979('0x32')]:_0x498be6['model'];if(_0x3751dc[_0xa979('0x2d')][_0xa979('0x3d')]){_0x22690c[_0xa979('0x3e')]=[{'all':!![]}];}_0x22690c=_['merge']({},_0x22690c,_0x3751dc['options']);return db[_0xa979('0x27')][_0xa979('0x44')](_0x22690c)[_0xa979('0x21')](handleEntityNotFound(_0x348974,null))[_0xa979('0x21')](respondWithResult(_0x348974,null))[_0xa979('0x41')](handleError(_0x348974,null));};exports[_0xa979('0x45')]=function(_0x4f35bb,_0x2328f1){return db['JscriptyQuestionReport'][_0xa979('0x45')](_0x4f35bb[_0xa979('0x46')],{})[_0xa979('0x21')](respondWithResult(_0x2328f1,0xc9))[_0xa979('0x41')](handleError(_0x2328f1,null));};exports[_0xa979('0x20')]=function(_0x352d3c,_0x3d975f){if(_0x352d3c[_0xa979('0x46')]['id']){delete _0x352d3c[_0xa979('0x46')]['id'];}return db['JscriptyQuestionReport'][_0xa979('0x44')]({'where':{'id':_0x352d3c[_0xa979('0x43')]['id']}})[_0xa979('0x21')](handleEntityNotFound(_0x3d975f,null))[_0xa979('0x21')](saveUpdates(_0x352d3c[_0xa979('0x46')],null))[_0xa979('0x21')](respondWithResult(_0x3d975f,null))[_0xa979('0x41')](handleError(_0x3d975f,null));};exports[_0xa979('0x47')]=function(_0x2c2119,_0x296857){return db['JscriptyQuestionReport'][_0xa979('0x44')]({'where':{'id':_0x2c2119[_0xa979('0x43')]['id']}})['then'](handleEntityNotFound(_0x296857,null))[_0xa979('0x21')](removeEntity(_0x296857,null))[_0xa979('0x41')](handleError(_0x296857,null));};exports['describe']=function(_0x1a21d2,_0x401d33){return db[_0xa979('0x27')][_0xa979('0x48')]()['then'](respondWithResult(_0x401d33,null))['catch'](handleError(_0x401d33,null));}; \ No newline at end of file +var _0x20d6=['stack','name','send','index','map','JscriptyQuestionReport','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','rows','params','length','find','catch','create','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','save','then','destroy','error'];(function(_0x144514,_0xe2af14){var _0x4207a1=function(_0x3cb3ff){while(--_0x3cb3ff){_0x144514['push'](_0x144514['shift']());}};_0x4207a1(++_0xe2af14);}(_0x20d6,0x190));var _0x620d=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x20d6[_0x397e5f];return _0x5302b8;};'use strict';var emlformat=require(_0x620d('0x0'));var rimraf=require(_0x620d('0x1'));var zipdir=require(_0x620d('0x2'));var jsonpatch=require(_0x620d('0x3'));var rp=require('request-promise');var moment=require(_0x620d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x620d('0x5'));var util=require(_0x620d('0x6'));var path=require(_0x620d('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x620d('0x8'));var fs=require('fs');var fs_extra=require(_0x620d('0x9'));var _=require(_0x620d('0xa'));var squel=require(_0x620d('0xb'));var crypto=require(_0x620d('0xc'));var jsforce=require(_0x620d('0xd'));var deskjs=require(_0x620d('0xe'));var toCsv=require(_0x620d('0xf'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x620d('0x10'));var authService=require(_0x620d('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x620d('0x12'));var logger=require(_0x620d('0x13'))(_0x620d('0x14'));var utils=require(_0x620d('0x15'));var config=require(_0x620d('0x16'));var licenseUtil=require(_0x620d('0x17'));var db=require(_0x620d('0x18'))['db'];function respondWithStatusCode(_0xf93348,_0x5bfef2){_0x5bfef2=_0x5bfef2||0xcc;return function(_0x1c144f){if(_0x1c144f){return _0xf93348[_0x620d('0x19')](_0x5bfef2);}return _0xf93348[_0x620d('0x1a')](_0x5bfef2)['end']();};}function respondWithResult(_0xed4b63,_0x3a826c){_0x3a826c=_0x3a826c||0xc8;return function(_0x582605){if(_0x582605){return _0xed4b63['status'](_0x3a826c)[_0x620d('0x1b')](_0x582605);}};}function respondWithFilteredResult(_0x347fa7,_0x16bde1){return function(_0x2c65d8){if(_0x2c65d8){var _0x515ee=typeof _0x16bde1[_0x620d('0x1c')]===_0x620d('0x1d')&&typeof _0x16bde1[_0x620d('0x1e')]===_0x620d('0x1d');var _0x4e58ab=_0x2c65d8['count'];var _0x380693=_0x515ee?0x0:_0x16bde1[_0x620d('0x1c')];var _0x4bdca4=_0x515ee?_0x2c65d8[_0x620d('0x1f')]:_0x16bde1[_0x620d('0x1c')]+_0x16bde1[_0x620d('0x1e')];var _0x299032;if(_0x4bdca4>=_0x4e58ab){_0x4bdca4=_0x4e58ab;_0x299032=0xc8;}else{_0x299032=0xce;}_0x347fa7[_0x620d('0x1a')](_0x299032);return _0x347fa7[_0x620d('0x20')]('Content-Range',_0x380693+'-'+_0x4bdca4+'/'+_0x4e58ab)['json'](_0x2c65d8);}return null;};}function patchUpdates(_0x44d3d5){return function(_0x51b9d4){try{jsonpatch[_0x620d('0x21')](_0x51b9d4,_0x44d3d5,!![]);}catch(_0x41bbdd){return BPromise['reject'](_0x41bbdd);}return _0x51b9d4[_0x620d('0x22')]();};}function saveUpdates(_0x28f58e,_0x4b7497){return function(_0x4f11f3){if(_0x4f11f3){return _0x4f11f3['update'](_0x28f58e)[_0x620d('0x23')](function(_0x6db1fa){return _0x6db1fa;});}return null;};}function removeEntity(_0x43da59,_0x53528d){return function(_0x16ea7e){if(_0x16ea7e){return _0x16ea7e[_0x620d('0x24')]()[_0x620d('0x23')](function(){_0x43da59[_0x620d('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x20b560,_0x1e669d){return function(_0x3c7b7a){if(!_0x3c7b7a){_0x20b560[_0x620d('0x19')](0x194);}return _0x3c7b7a;};}function handleError(_0x1583ce,_0x22c946){_0x22c946=_0x22c946||0x1f4;return function(_0x46278c){logger[_0x620d('0x25')](_0x46278c[_0x620d('0x26')]);if(_0x46278c[_0x620d('0x27')]){delete _0x46278c['name'];}_0x1583ce[_0x620d('0x1a')](_0x22c946)[_0x620d('0x28')](_0x46278c);};}exports[_0x620d('0x29')]=function(_0x2ac5b0,_0x38a874){var _0x53861a={},_0x5901bb={},_0x3bed3d={'count':0x0,'rows':[]};var _0x158086=_[_0x620d('0x2a')](db[_0x620d('0x2b')][_0x620d('0x2c')],function(_0x35d076){return{'name':_0x35d076[_0x620d('0x2d')],'type':_0x35d076['type']['key']};});_0x5901bb[_0x620d('0x2e')]=_['map'](_0x158086,_0x620d('0x27'));_0x5901bb[_0x620d('0x2f')]=_[_0x620d('0x30')](_0x2ac5b0[_0x620d('0x2f')]);_0x5901bb[_0x620d('0x31')]=_[_0x620d('0x32')](_0x5901bb[_0x620d('0x2e')],_0x5901bb[_0x620d('0x2f')]);_0x53861a[_0x620d('0x33')]=_['intersection'](_0x5901bb[_0x620d('0x2e')],qs[_0x620d('0x34')](_0x2ac5b0[_0x620d('0x2f')][_0x620d('0x34')]));_0x53861a[_0x620d('0x33')]=_0x53861a[_0x620d('0x33')]['length']?_0x53861a['attributes']:_0x5901bb[_0x620d('0x2e')];if(!_0x2ac5b0['query'][_0x620d('0x35')](_0x620d('0x36'))){_0x53861a['limit']=qs[_0x620d('0x1e')](_0x2ac5b0[_0x620d('0x2f')]['limit']);_0x53861a[_0x620d('0x1c')]=qs[_0x620d('0x1c')](_0x2ac5b0[_0x620d('0x2f')][_0x620d('0x1c')]);}_0x53861a[_0x620d('0x37')]=qs['sort'](_0x2ac5b0['query'][_0x620d('0x38')]);_0x53861a[_0x620d('0x39')]=qs[_0x620d('0x31')](_[_0x620d('0x3a')](_0x2ac5b0['query'],_0x5901bb[_0x620d('0x31')]),_0x158086);if(_0x2ac5b0[_0x620d('0x2f')][_0x620d('0x3b')]){_0x53861a[_0x620d('0x39')]=_[_0x620d('0x3c')](_0x53861a[_0x620d('0x39')],{'$or':_['map'](_0x158086,function(_0x35e2a3){if(_0x35e2a3[_0x620d('0x3d')]!==_0x620d('0x3e')){var _0x147aed={};_0x147aed[_0x35e2a3['name']]={'$like':'%'+_0x2ac5b0['query']['filter']+'%'};return _0x147aed;}})});}_0x53861a=_[_0x620d('0x3c')]({},_0x53861a,_0x2ac5b0[_0x620d('0x3f')]);var _0x251331={'where':_0x53861a['where']};return db[_0x620d('0x2b')][_0x620d('0x1f')](_0x251331)[_0x620d('0x23')](function(_0x2d92b2){_0x3bed3d[_0x620d('0x1f')]=_0x2d92b2;if(_0x2ac5b0[_0x620d('0x2f')]['includeAll']){_0x53861a['include']=[{'all':!![]}];}return db['JscriptyQuestionReport']['findAll'](_0x53861a);})[_0x620d('0x23')](function(_0x254d34){_0x3bed3d[_0x620d('0x40')]=_0x254d34;return _0x3bed3d;})[_0x620d('0x23')](respondWithFilteredResult(_0x38a874,_0x53861a))['catch'](handleError(_0x38a874,null));};exports['show']=function(_0xef119c,_0x4b69bb){var _0x20a3f5={'raw':!![],'where':{'id':_0xef119c[_0x620d('0x41')]['id']}},_0x4dd788={};_0x4dd788[_0x620d('0x2e')]=_[_0x620d('0x30')](db[_0x620d('0x2b')]['rawAttributes']);_0x4dd788['query']=_[_0x620d('0x30')](_0xef119c['query']);_0x4dd788['filters']=_[_0x620d('0x32')](_0x4dd788[_0x620d('0x2e')],_0x4dd788[_0x620d('0x2f')]);_0x20a3f5['attributes']=_[_0x620d('0x32')](_0x4dd788['model'],qs[_0x620d('0x34')](_0xef119c[_0x620d('0x2f')][_0x620d('0x34')]));_0x20a3f5[_0x620d('0x33')]=_0x20a3f5['attributes'][_0x620d('0x42')]?_0x20a3f5['attributes']:_0x4dd788[_0x620d('0x2e')];if(_0xef119c['query']['includeAll']){_0x20a3f5['include']=[{'all':!![]}];}_0x20a3f5=_[_0x620d('0x3c')]({},_0x20a3f5,_0xef119c[_0x620d('0x3f')]);return db[_0x620d('0x2b')][_0x620d('0x43')](_0x20a3f5)[_0x620d('0x23')](handleEntityNotFound(_0x4b69bb,null))[_0x620d('0x23')](respondWithResult(_0x4b69bb,null))[_0x620d('0x44')](handleError(_0x4b69bb,null));};exports[_0x620d('0x45')]=function(_0x12b029,_0x1ab54e){return db[_0x620d('0x2b')][_0x620d('0x45')](_0x12b029[_0x620d('0x46')],{})[_0x620d('0x23')](respondWithResult(_0x1ab54e,0xc9))[_0x620d('0x44')](handleError(_0x1ab54e,null));};exports[_0x620d('0x47')]=function(_0x343f1d,_0x3e32fa){if(_0x343f1d[_0x620d('0x46')]['id']){delete _0x343f1d['body']['id'];}return db['JscriptyQuestionReport'][_0x620d('0x43')]({'where':{'id':_0x343f1d['params']['id']}})[_0x620d('0x23')](handleEntityNotFound(_0x3e32fa,null))[_0x620d('0x23')](saveUpdates(_0x343f1d[_0x620d('0x46')],null))[_0x620d('0x23')](respondWithResult(_0x3e32fa,null))['catch'](handleError(_0x3e32fa,null));};exports[_0x620d('0x24')]=function(_0x40fd4c,_0x1d0575){return db[_0x620d('0x2b')][_0x620d('0x43')]({'where':{'id':_0x40fd4c[_0x620d('0x41')]['id']}})['then'](handleEntityNotFound(_0x1d0575,null))[_0x620d('0x23')](removeEntity(_0x1d0575,null))[_0x620d('0x44')](handleError(_0x1d0575,null));};exports[_0x620d('0x48')]=function(_0x5e872f,_0x2440b6){return db[_0x620d('0x2b')][_0x620d('0x48')]()['then'](respondWithResult(_0x2440b6,null))['catch'](handleError(_0x2440b6,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index 029ff84..9ff934e 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 _0x0370=['rimraf','../../config/environment','./jscriptyQuestionReport.attributes','exports','define','JscriptyQuestionReport','report_jscripty_questions','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x2fe15c,_0x48713a){var _0x26ec58=function(_0x3e475a){while(--_0x3e475a){_0x2fe15c['push'](_0x2fe15c['shift']());}};_0x26ec58(++_0x48713a);}(_0x0370,0x103));var _0x0037=function(_0x52d612,_0x229bd8){_0x52d612=_0x52d612-0x0;var _0x202b54=_0x0370[_0x52d612];return _0x202b54;};'use strict';var _=require(_0x0037('0x0'));var util=require(_0x0037('0x1'));var logger=require(_0x0037('0x2'))(_0x0037('0x3'));var moment=require(_0x0037('0x4'));var BPromise=require(_0x0037('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0037('0x6'));var rimraf=require(_0x0037('0x7'));var config=require(_0x0037('0x8'));var attributes=require(_0x0037('0x9'));module[_0x0037('0xa')]=function(_0x208f71,_0x1b012a){return _0x208f71[_0x0037('0xb')](_0x0037('0xc'),attributes,{'tableName':_0x0037('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa58d=['request-promise','path','rimraf','../../config/environment','./jscriptyQuestionReport.attributes','exports','define','JscriptyQuestionReport','report_jscripty_questions','util','../../config/logger','api'];(function(_0x405af6,_0x138eca){var _0x4fe08c=function(_0x144850){while(--_0x144850){_0x405af6['push'](_0x405af6['shift']());}};_0x4fe08c(++_0x138eca);}(_0xa58d,0x105));var _0xda58=function(_0x5c611c,_0x3a942f){_0x5c611c=_0x5c611c-0x0;var _0x58c02a=_0xa58d[_0x5c611c];return _0x58c02a;};'use strict';var _=require('lodash');var util=require(_0xda58('0x0'));var logger=require(_0xda58('0x1'))(_0xda58('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xda58('0x3'));var fs=require('fs');var path=require(_0xda58('0x4'));var rimraf=require(_0xda58('0x5'));var config=require(_0xda58('0x6'));var attributes=require(_0xda58('0x7'));module[_0xda58('0x8')]=function(_0x395a8e,_0x5d3cd5){return _0x395a8e[_0xda58('0x9')](_0xda58('0xa'),attributes,{'tableName':_0xda58('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js index a24ad6e..859f5fe 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 _0xd85c=['info','JscriptyQuestionReport,\x20%s,\x20%s','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment','request','then'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0xd85c,0x114));var _0xcd85=function(_0x2e5f15,_0x5c62c0){_0x2e5f15=_0x2e5f15-0x0;var _0x4624b4=_0xd85c[_0x2e5f15];return _0x4624b4;};'use strict';var _=require(_0xcd85('0x0'));var util=require('util');var moment=require(_0xcd85('0x1'));var BPromise=require(_0xcd85('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcd85('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xcd85('0x4'))(_0xcd85('0x5'));var config=require(_0xcd85('0x6'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x9ab78b,_0x22a3b7,_0xb60fb1){return new BPromise(function(_0x2401ee,_0x22d511){return client[_0xcd85('0x7')](_0x9ab78b,_0xb60fb1)[_0xcd85('0x8')](function(_0x37c045){logger[_0xcd85('0x9')](_0xcd85('0xa'),_0x22a3b7,'request\x20sent');logger[_0xcd85('0xb')](_0xcd85('0xc'),_0x22a3b7,_0xcd85('0xd'),JSON[_0xcd85('0xe')](_0x37c045));if(_0x37c045[_0xcd85('0xf')]){if(_0x37c045[_0xcd85('0xf')][_0xcd85('0x10')]===0x1f4){logger[_0xcd85('0xf')](_0xcd85('0xa'),_0x22a3b7,_0x37c045[_0xcd85('0xf')][_0xcd85('0x11')]);return _0x22d511(_0x37c045[_0xcd85('0xf')]['message']);}logger[_0xcd85('0xf')](_0xcd85('0xa'),_0x22a3b7,_0x37c045[_0xcd85('0xf')][_0xcd85('0x11')]);return _0x2401ee(_0x37c045[_0xcd85('0xf')]['message']);}else{logger[_0xcd85('0x9')](_0xcd85('0xa'),_0x22a3b7,_0xcd85('0xd'));_0x2401ee(_0x37c045['result']['message']);}})[_0xcd85('0x12')](function(_0x500ba2){logger['error'](_0xcd85('0xa'),_0x22a3b7,_0x500ba2);_0x22d511(_0x500ba2);});});} \ No newline at end of file +var _0x91a4=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','JscriptyQuestionReport,\x20%s,\x20%s','debug','request\x20sent','code','error','message','result','catch','lodash','util','moment','randomstring'];(function(_0x4afe3b,_0x255e0d){var _0x2c22d1=function(_0x313847){while(--_0x313847){_0x4afe3b['push'](_0x4afe3b['shift']());}};_0x2c22d1(++_0x255e0d);}(_0x91a4,0x1f0));var _0x491a=function(_0x143f6c,_0x1e477f){_0x143f6c=_0x143f6c-0x0;var _0x44ae64=_0x91a4[_0x143f6c];return _0x44ae64;};'use strict';var _=require(_0x491a('0x0'));var util=require(_0x491a('0x1'));var moment=require(_0x491a('0x2'));var BPromise=require('bluebird');var rs=require(_0x491a('0x3'));var fs=require('fs');var Redis=require(_0x491a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x491a('0x5'));var logger=require(_0x491a('0x6'))(_0x491a('0x7'));var config=require(_0x491a('0x8'));var jayson=require(_0x491a('0x9'));var client=jayson['client'][_0x491a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x102234,_0x54f855,_0x3712e7){return new BPromise(function(_0x32ec5d,_0x47f87b){return client['request'](_0x102234,_0x3712e7)['then'](function(_0x44f95f){logger[_0x491a('0xb')](_0x491a('0xc'),_0x54f855,'request\x20sent');logger[_0x491a('0xd')]('JscriptyQuestionReport,\x20%s,\x20%s,\x20%s',_0x54f855,_0x491a('0xe'),JSON['stringify'](_0x44f95f));if(_0x44f95f['error']){if(_0x44f95f['error'][_0x491a('0xf')]===0x1f4){logger[_0x491a('0x10')](_0x491a('0xc'),_0x54f855,_0x44f95f['error'][_0x491a('0x11')]);return _0x47f87b(_0x44f95f['error']['message']);}logger[_0x491a('0x10')](_0x491a('0xc'),_0x54f855,_0x44f95f[_0x491a('0x10')][_0x491a('0x11')]);return _0x32ec5d(_0x44f95f[_0x491a('0x10')]['message']);}else{logger[_0x491a('0xb')](_0x491a('0xc'),_0x54f855,'request\x20sent');_0x32ec5d(_0x44f95f[_0x491a('0x12')][_0x491a('0x11')]);}})[_0x491a('0x13')](function(_0x4aedf3){logger[_0x491a('0x10')](_0x491a('0xc'),_0x54f855,_0x4aedf3);_0x47f87b(_0x4aedf3);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index a4ffbcc..2754822 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 _0xc842=['show','/:id/questions','getQuestions','post','create','put','update','delete','destroy','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get','isAuthenticated','index','/describe','/:id'];(function(_0x30cfe7,_0xe282c6){var _0x420734=function(_0x2e72ad){while(--_0x2e72ad){_0x30cfe7['push'](_0x30cfe7['shift']());}};_0x420734(++_0xe282c6);}(_0xc842,0xb9));var _0x2c84=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xc842[_0x502c7d];return _0x30b7ed;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x2c84('0x0'));var timeout=require('connect-timeout');var express=require(_0x2c84('0x1'));var router=express[_0x2c84('0x2')]();var fs_extra=require(_0x2c84('0x3'));var auth=require(_0x2c84('0x4'));var interaction=require(_0x2c84('0x5'));var config=require(_0x2c84('0x6'));var controller=require(_0x2c84('0x7'));router[_0x2c84('0x8')]('/',auth[_0x2c84('0x9')](),controller[_0x2c84('0xa')]);router[_0x2c84('0x8')](_0x2c84('0xb'),auth[_0x2c84('0x9')](),controller['describe']);router[_0x2c84('0x8')](_0x2c84('0xc'),auth['isAuthenticated'](),controller[_0x2c84('0xd')]);router[_0x2c84('0x8')](_0x2c84('0xe'),auth[_0x2c84('0x9')](),controller[_0x2c84('0xf')]);router[_0x2c84('0x10')]('/',auth['isAuthenticated'](),controller[_0x2c84('0x11')]);router[_0x2c84('0x12')](_0x2c84('0xc'),auth[_0x2c84('0x9')](),controller[_0x2c84('0x13')]);router[_0x2c84('0x14')](_0x2c84('0xc'),auth[_0x2c84('0x9')](),controller[_0x2c84('0x15')]);module['exports']=router; \ No newline at end of file +var _0xeedd=['isAuthenticated','/:id','show','/:id/questions','post','create','put','update','delete','destroy','exports','multer','util','path','express','fs-extra','../../components/interaction/service','./jscriptySessionReport.controller','get'];(function(_0xa8f24a,_0x48d7d3){var _0x3a1471=function(_0x281470){while(--_0x281470){_0xa8f24a['push'](_0xa8f24a['shift']());}};_0x3a1471(++_0x48d7d3);}(_0xeedd,0xc9));var _0xdeed=function(_0x1fe02a,_0x1c173d){_0x1fe02a=_0x1fe02a-0x0;var _0x5d32f8=_0xeedd[_0x1fe02a];return _0x5d32f8;};'use strict';var multer=require(_0xdeed('0x0'));var util=require(_0xdeed('0x1'));var path=require(_0xdeed('0x2'));var timeout=require('connect-timeout');var express=require(_0xdeed('0x3'));var router=express['Router']();var fs_extra=require(_0xdeed('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xdeed('0x5'));var config=require('../../config/environment');var controller=require(_0xdeed('0x6'));router[_0xdeed('0x7')]('/',auth[_0xdeed('0x8')](),controller['index']);router[_0xdeed('0x7')]('/describe',auth[_0xdeed('0x8')](),controller['describe']);router[_0xdeed('0x7')](_0xdeed('0x9'),auth[_0xdeed('0x8')](),controller[_0xdeed('0xa')]);router[_0xdeed('0x7')](_0xdeed('0xb'),auth[_0xdeed('0x8')](),controller['getQuestions']);router[_0xdeed('0xc')]('/',auth[_0xdeed('0x8')](),controller[_0xdeed('0xd')]);router[_0xdeed('0xe')](_0xdeed('0x9'),auth[_0xdeed('0x8')](),controller[_0xdeed('0xf')]);router[_0xdeed('0x10')](_0xdeed('0x9'),auth[_0xdeed('0x8')](),controller[_0xdeed('0x11')]);module[_0xdeed('0x12')]=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index ea94617..a79758c 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 _0x87f1=['sequelize','exports','DATE','setDataValue','starttime','format','STRING','BOOLEAN'];(function(_0x44b7c0,_0x3ea096){var _0x16d381=function(_0x36d026){while(--_0x36d026){_0x44b7c0['push'](_0x44b7c0['shift']());}};_0x16d381(++_0x3ea096);}(_0x87f1,0x170));var _0x187f=function(_0x3c729b,_0x2a4146){_0x3c729b=_0x3c729b-0x0;var _0x55894c=_0x87f1[_0x3c729b];return _0x55894c;};'use strict';var moment=require('moment');var Sequelize=require(_0x187f('0x0'));module[_0x187f('0x1')]={'starttime':{'type':Sequelize[_0x187f('0x2')],'set':function(_0xbc0de1){this[_0x187f('0x3')](_0x187f('0x4'),_0xbc0de1);this[_0x187f('0x3')]('endtime',moment()[_0x187f('0x5')]('YYYY-MM-DD\x20HH:mm:ss'));}},'endtime':{'type':Sequelize[_0x187f('0x2')]},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize[_0x187f('0x6')]},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x187f('0x6')]},'calleridname':{'type':Sequelize[_0x187f('0x6')]},'calleridnum':{'type':Sequelize[_0x187f('0x6')]},'completed':{'type':Sequelize[_0x187f('0x7')],'defaultValue':![]}}; \ No newline at end of file +var _0xa8d9=['DATE','starttime','setDataValue','format','YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN','moment','sequelize','exports'];(function(_0x25eea5,_0x161246){var _0x519286=function(_0x2ee50a){while(--_0x2ee50a){_0x25eea5['push'](_0x25eea5['shift']());}};_0x519286(++_0x161246);}(_0xa8d9,0x1f1));var _0x9a8d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa8d9[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require(_0x9a8d('0x0'));var Sequelize=require(_0x9a8d('0x1'));module[_0x9a8d('0x2')]={'starttime':{'type':Sequelize[_0x9a8d('0x3')],'set':function(_0x4343da){this['setDataValue'](_0x9a8d('0x4'),_0x4343da);this[_0x9a8d('0x5')]('endtime',moment()[_0x9a8d('0x6')](_0x9a8d('0x7')));}},'endtime':{'type':Sequelize[_0x9a8d('0x3')]},'membername':{'type':Sequelize[_0x9a8d('0x8')]},'projectname':{'type':Sequelize[_0x9a8d('0x8')]},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x9a8d('0x8')]},'calleridname':{'type':Sequelize[_0x9a8d('0x8')]},'calleridnum':{'type':Sequelize[_0x9a8d('0x8')]},'completed':{'type':Sequelize[_0x9a8d('0x9')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index 6a63473..9ffae73 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 _0x96f2=['fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','intersection','includeAll','find','create','update','body','params','describe','getQuestions','JscriptyQuestionReport','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','error','name','map','JscriptySessionReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes'];(function(_0x36b2a3,_0x51312a){var _0x291119=function(_0xeb85d5){while(--_0xeb85d5){_0x36b2a3['push'](_0x36b2a3['shift']());}};_0x291119(++_0x51312a);}(_0x96f2,0xb5));var _0x296f=function(_0x34bcee,_0x68d5e0){_0x34bcee=_0x34bcee-0x0;var _0xa3624e=_0x96f2[_0x34bcee];return _0xa3624e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x296f('0x0'));var zipdir=require(_0x296f('0x1'));var jsonpatch=require(_0x296f('0x2'));var rp=require(_0x296f('0x3'));var moment=require(_0x296f('0x4'));var BPromise=require(_0x296f('0x5'));var Mustache=require(_0x296f('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x296f('0x7'));var ejs=require(_0x296f('0x8'));var fs=require('fs');var fs_extra=require(_0x296f('0x9'));var _=require(_0x296f('0xa'));var squel=require(_0x296f('0xb'));var crypto=require('crypto');var jsforce=require(_0x296f('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x296f('0xd'));var Papa=require(_0x296f('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x296f('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x296f('0x10'));var logger=require(_0x296f('0x11'))(_0x296f('0x12'));var utils=require(_0x296f('0x13'));var config=require(_0x296f('0x14'));var licenseUtil=require(_0x296f('0x15'));var db=require(_0x296f('0x16'))['db'];function respondWithStatusCode(_0x261de6,_0x49bb54){_0x49bb54=_0x49bb54||0xcc;return function(_0x17a650){if(_0x17a650){return _0x261de6['sendStatus'](_0x49bb54);}return _0x261de6[_0x296f('0x17')](_0x49bb54)[_0x296f('0x18')]();};}function respondWithResult(_0x446048,_0x5f2376){_0x5f2376=_0x5f2376||0xc8;return function(_0x2e43bb){if(_0x2e43bb){return _0x446048[_0x296f('0x17')](_0x5f2376)[_0x296f('0x19')](_0x2e43bb);}};}function respondWithFilteredResult(_0x10da58,_0xdd8162){return function(_0x37ff32){if(_0x37ff32){var _0x3360ca=typeof _0xdd8162[_0x296f('0x1a')]===_0x296f('0x1b')&&typeof _0xdd8162['limit']===_0x296f('0x1b');var _0x2a745a=_0x37ff32[_0x296f('0x1c')];var _0x46e4e1=_0x3360ca?0x0:_0xdd8162[_0x296f('0x1a')];var _0xaa1969=_0x3360ca?_0x37ff32[_0x296f('0x1c')]:_0xdd8162[_0x296f('0x1a')]+_0xdd8162[_0x296f('0x1d')];var _0x283148;if(_0xaa1969>=_0x2a745a){_0xaa1969=_0x2a745a;_0x283148=0xc8;}else{_0x283148=0xce;}_0x10da58[_0x296f('0x17')](_0x283148);return _0x10da58[_0x296f('0x1e')](_0x296f('0x1f'),_0x46e4e1+'-'+_0xaa1969+'/'+_0x2a745a)[_0x296f('0x19')](_0x37ff32);}return null;};}function patchUpdates(_0x22bbd9){return function(_0x43f11c){try{jsonpatch[_0x296f('0x20')](_0x43f11c,_0x22bbd9,!![]);}catch(_0x446645){return BPromise[_0x296f('0x21')](_0x446645);}return _0x43f11c[_0x296f('0x22')]();};}function saveUpdates(_0x3612a5,_0x18a984){return function(_0x3fe972){if(_0x3fe972){return _0x3fe972['update'](_0x3612a5)[_0x296f('0x23')](function(_0x29c57f){return _0x29c57f;});}return null;};}function removeEntity(_0x2c96cc,_0x3f163c){return function(_0x126ebd){if(_0x126ebd){return _0x126ebd[_0x296f('0x24')]()[_0x296f('0x23')](function(){_0x2c96cc[_0x296f('0x17')](0xcc)[_0x296f('0x18')]();});}};}function handleEntityNotFound(_0x14cee9,_0x4297ce){return function(_0x5a32c3){if(!_0x5a32c3){_0x14cee9['sendStatus'](0x194);}return _0x5a32c3;};}function handleError(_0x1303b3,_0x46e475){_0x46e475=_0x46e475||0x1f4;return function(_0x116eab){logger[_0x296f('0x25')](_0x116eab['stack']);if(_0x116eab[_0x296f('0x26')]){delete _0x116eab[_0x296f('0x26')];}_0x1303b3[_0x296f('0x17')](_0x46e475)['send'](_0x116eab);};}exports['index']=function(_0x5a24f9,_0x4f1d85){var _0x3401a6={},_0x50a915={},_0x4cf419={'count':0x0,'rows':[]};var _0xe65d41=_[_0x296f('0x27')](db[_0x296f('0x28')][_0x296f('0x29')],function(_0x289bf0){return{'name':_0x289bf0[_0x296f('0x2a')],'type':_0x289bf0[_0x296f('0x2b')][_0x296f('0x2c')]};});_0x50a915[_0x296f('0x2d')]=_[_0x296f('0x27')](_0xe65d41,_0x296f('0x26'));_0x50a915[_0x296f('0x2e')]=_[_0x296f('0x2f')](_0x5a24f9[_0x296f('0x2e')]);_0x50a915[_0x296f('0x30')]=_['intersection'](_0x50a915[_0x296f('0x2d')],_0x50a915[_0x296f('0x2e')]);_0x3401a6[_0x296f('0x31')]=_['intersection'](_0x50a915[_0x296f('0x2d')],qs[_0x296f('0x32')](_0x5a24f9[_0x296f('0x2e')][_0x296f('0x32')]));_0x3401a6[_0x296f('0x31')]=_0x3401a6[_0x296f('0x31')][_0x296f('0x33')]?_0x3401a6[_0x296f('0x31')]:_0x50a915[_0x296f('0x2d')];if(!_0x5a24f9[_0x296f('0x2e')][_0x296f('0x34')](_0x296f('0x35'))){_0x3401a6['limit']=qs[_0x296f('0x1d')](_0x5a24f9[_0x296f('0x2e')][_0x296f('0x1d')]);_0x3401a6[_0x296f('0x1a')]=qs[_0x296f('0x1a')](_0x5a24f9[_0x296f('0x2e')][_0x296f('0x1a')]);}_0x3401a6[_0x296f('0x36')]=qs[_0x296f('0x37')](_0x5a24f9[_0x296f('0x2e')][_0x296f('0x37')]);_0x3401a6[_0x296f('0x38')]=qs[_0x296f('0x30')](_[_0x296f('0x39')](_0x5a24f9['query'],_0x50a915['filters']),_0xe65d41);if(_0x5a24f9[_0x296f('0x2e')][_0x296f('0x3a')]){_0x3401a6[_0x296f('0x38')]=_[_0x296f('0x3b')](_0x3401a6[_0x296f('0x38')],{'$or':_[_0x296f('0x27')](_0xe65d41,function(_0x154ef7){if(_0x154ef7[_0x296f('0x2b')]!==_0x296f('0x3c')){var _0x15942a={};_0x15942a[_0x154ef7[_0x296f('0x26')]]={'$like':'%'+_0x5a24f9['query'][_0x296f('0x3a')]+'%'};return _0x15942a;}})});}_0x3401a6=_[_0x296f('0x3b')]({},_0x3401a6,_0x5a24f9[_0x296f('0x3d')]);var _0x59b51e={'where':_0x3401a6['where']};return db[_0x296f('0x28')]['count'](_0x59b51e)[_0x296f('0x23')](function(_0x55f1e0){_0x4cf419[_0x296f('0x1c')]=_0x55f1e0;if(_0x5a24f9['query']['includeAll']){_0x3401a6[_0x296f('0x3e')]=[{'all':!![]}];}return db[_0x296f('0x28')][_0x296f('0x3f')](_0x3401a6);})['then'](function(_0x339d99){_0x4cf419[_0x296f('0x40')]=_0x339d99;return _0x4cf419;})[_0x296f('0x23')](respondWithFilteredResult(_0x4f1d85,_0x3401a6))[_0x296f('0x41')](handleError(_0x4f1d85,null));};exports[_0x296f('0x42')]=function(_0x4dc395,_0x496d58){var _0x2a1d61={'raw':!![],'where':{'id':_0x4dc395['params']['id']}},_0x1ca00a={};_0x1ca00a[_0x296f('0x2d')]=_[_0x296f('0x2f')](db[_0x296f('0x28')][_0x296f('0x29')]);_0x1ca00a[_0x296f('0x2e')]=_['keys'](_0x4dc395[_0x296f('0x2e')]);_0x1ca00a[_0x296f('0x30')]=_['intersection'](_0x1ca00a['model'],_0x1ca00a['query']);_0x2a1d61['attributes']=_[_0x296f('0x43')](_0x1ca00a[_0x296f('0x2d')],qs[_0x296f('0x32')](_0x4dc395[_0x296f('0x2e')][_0x296f('0x32')]));_0x2a1d61[_0x296f('0x31')]=_0x2a1d61['attributes'][_0x296f('0x33')]?_0x2a1d61[_0x296f('0x31')]:_0x1ca00a[_0x296f('0x2d')];if(_0x4dc395['query'][_0x296f('0x44')]){_0x2a1d61['include']=[{'all':!![]}];}_0x2a1d61=_[_0x296f('0x3b')]({},_0x2a1d61,_0x4dc395['options']);return db[_0x296f('0x28')][_0x296f('0x45')](_0x2a1d61)['then'](handleEntityNotFound(_0x496d58,null))['then'](respondWithResult(_0x496d58,null))[_0x296f('0x41')](handleError(_0x496d58,null));};exports[_0x296f('0x46')]=function(_0x4ae7f2,_0x18bed6){return db[_0x296f('0x28')][_0x296f('0x46')](_0x4ae7f2['body'],{})['then'](respondWithResult(_0x18bed6,0xc9))[_0x296f('0x41')](handleError(_0x18bed6,null));};exports[_0x296f('0x47')]=function(_0x44cb8c,_0x10a44e){if(_0x44cb8c[_0x296f('0x48')]['id']){delete _0x44cb8c[_0x296f('0x48')]['id'];}return db[_0x296f('0x28')][_0x296f('0x45')]({'where':{'id':_0x44cb8c[_0x296f('0x49')]['id']}})[_0x296f('0x23')](handleEntityNotFound(_0x10a44e,null))[_0x296f('0x23')](saveUpdates(_0x44cb8c[_0x296f('0x48')],null))[_0x296f('0x23')](respondWithResult(_0x10a44e,null))[_0x296f('0x41')](handleError(_0x10a44e,null));};exports[_0x296f('0x24')]=function(_0x164ddd,_0x1b3eac){return db['JscriptySessionReport'][_0x296f('0x45')]({'where':{'id':_0x164ddd[_0x296f('0x49')]['id']}})[_0x296f('0x23')](handleEntityNotFound(_0x1b3eac,null))[_0x296f('0x23')](removeEntity(_0x1b3eac,null))['catch'](handleError(_0x1b3eac,null));};exports[_0x296f('0x4a')]=function(_0x20fea2,_0x48e58c){return db[_0x296f('0x28')][_0x296f('0x4a')]()[_0x296f('0x23')](respondWithResult(_0x48e58c,null))['catch'](handleError(_0x48e58c,null));};exports[_0x296f('0x4b')]=function(_0x4afea8,_0x16146a,_0x20e9b0){var _0x4b8561={'raw':!![],'where':{}};var _0x608ff={};var _0x29da26={'count':0x0,'rows':[]};return db['JscriptySessionReport']['findOne']({'where':{'id':_0x4afea8[_0x296f('0x49')]['id']}})[_0x296f('0x23')](handleEntityNotFound(_0x16146a,null))[_0x296f('0x23')](function(_0x40ea90){if(_0x40ea90){_0x608ff[_0x296f('0x2d')]=_['keys'](db['JscriptyQuestionReport'][_0x296f('0x29')]);_0x608ff[_0x296f('0x2e')]=_[_0x296f('0x2f')](_0x4afea8['query']);_0x608ff['filters']=_[_0x296f('0x43')](_0x608ff['model'],_0x608ff[_0x296f('0x2e')]);_0x4b8561[_0x296f('0x31')]=_[_0x296f('0x43')](_0x608ff['model'],qs[_0x296f('0x32')](_0x4afea8['query'][_0x296f('0x32')]));_0x4b8561[_0x296f('0x31')]=_0x4b8561[_0x296f('0x31')][_0x296f('0x33')]?_0x4b8561[_0x296f('0x31')]:_0x608ff[_0x296f('0x2d')];if(!_0x4afea8[_0x296f('0x2e')][_0x296f('0x34')](_0x296f('0x35'))){_0x4b8561[_0x296f('0x1d')]=qs['limit'](_0x4afea8['query'][_0x296f('0x1d')]);_0x4b8561[_0x296f('0x1a')]=qs[_0x296f('0x1a')](_0x4afea8[_0x296f('0x2e')][_0x296f('0x1a')]);}_0x4b8561['order']=qs[_0x296f('0x37')](_0x4afea8[_0x296f('0x2e')][_0x296f('0x37')]);_0x4b8561['where']=qs['filters'](_['pick'](_0x4afea8[_0x296f('0x2e')],_0x608ff[_0x296f('0x30')]));_0x4b8561[_0x296f('0x38')]['SessionId']=_0x40ea90['id'];if(_0x4afea8[_0x296f('0x2e')][_0x296f('0x3a')]){_0x4b8561[_0x296f('0x38')]=_[_0x296f('0x3b')](_0x4b8561[_0x296f('0x38')],{'$or':_[_0x296f('0x27')](_0x4b8561[_0x296f('0x31')],function(_0x4e542a){var _0x18453b={};_0x18453b[_0x4e542a]={'$like':'%'+_0x4afea8[_0x296f('0x2e')][_0x296f('0x3a')]+'%'};return _0x18453b;})});}_0x4b8561=_[_0x296f('0x3b')]({},_0x4b8561,_0x4afea8['options']);return db['JscriptyQuestionReport'][_0x296f('0x1c')]({'where':_0x4b8561[_0x296f('0x38')]})[_0x296f('0x23')](function(_0x1eedb1){_0x29da26[_0x296f('0x1c')]=_0x1eedb1;if(_0x4afea8[_0x296f('0x2e')][_0x296f('0x44')]){_0x4b8561[_0x296f('0x3e')]=[{'all':!![]}];}return db[_0x296f('0x4c')][_0x296f('0x3f')](_0x4b8561);})[_0x296f('0x23')](function(_0x3d3fc4){_0x29da26[_0x296f('0x40')]=_0x3d3fc4;return _0x29da26;});}})[_0x296f('0x23')](respondWithFilteredResult(_0x16146a,_0x4b8561))[_0x296f('0x41')](handleError(_0x16146a,null));}; \ No newline at end of file +var _0x3efa=['model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','include','findAll','rows','show','rawAttributes','options','find','create','catch','body','params','describe','getQuestions','findOne','JscriptyQuestionReport','SessionId','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','end','error','stack','name','send','map','JscriptySessionReport','fieldName','type'];(function(_0x4b952a,_0x52809f){var _0x5a081f=function(_0x23367c){while(--_0x23367c){_0x4b952a['push'](_0x4b952a['shift']());}};_0x5a081f(++_0x52809f);}(_0x3efa,0x155));var _0xa3ef=function(_0x3bf0d4,_0x572800){_0x3bf0d4=_0x3bf0d4-0x0;var _0x10d373=_0x3efa[_0x3bf0d4];return _0x10d373;};'use strict';var emlformat=require(_0xa3ef('0x0'));var rimraf=require(_0xa3ef('0x1'));var zipdir=require(_0xa3ef('0x2'));var jsonpatch=require(_0xa3ef('0x3'));var rp=require('request-promise');var moment=require(_0xa3ef('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xa3ef('0x5'));var util=require(_0xa3ef('0x6'));var path=require(_0xa3ef('0x7'));var sox=require(_0xa3ef('0x8'));var csv=require(_0xa3ef('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa3ef('0xa'));var _=require(_0xa3ef('0xb'));var squel=require(_0xa3ef('0xc'));var crypto=require(_0xa3ef('0xd'));var jsforce=require(_0xa3ef('0xe'));var deskjs=require(_0xa3ef('0xf'));var toCsv=require(_0xa3ef('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xa3ef('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa3ef('0x11'));var logger=require('../../config/logger')(_0xa3ef('0x12'));var utils=require('../../config/utils');var config=require(_0xa3ef('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x9ca56f,_0x1527b1){_0x1527b1=_0x1527b1||0xcc;return function(_0x5c8692){if(_0x5c8692){return _0x9ca56f[_0xa3ef('0x14')](_0x1527b1);}return _0x9ca56f[_0xa3ef('0x15')](_0x1527b1)['end']();};}function respondWithResult(_0x16f41f,_0x587947){_0x587947=_0x587947||0xc8;return function(_0x26e38c){if(_0x26e38c){return _0x16f41f[_0xa3ef('0x15')](_0x587947)[_0xa3ef('0x16')](_0x26e38c);}};}function respondWithFilteredResult(_0x5d9fc8,_0x5e2963){return function(_0x2b66c2){if(_0x2b66c2){var _0x4edd90=typeof _0x5e2963[_0xa3ef('0x17')]===_0xa3ef('0x18')&&typeof _0x5e2963[_0xa3ef('0x19')]==='undefined';var _0x5569c7=_0x2b66c2['count'];var _0x335cfe=_0x4edd90?0x0:_0x5e2963['offset'];var _0x252b08=_0x4edd90?_0x2b66c2[_0xa3ef('0x1a')]:_0x5e2963[_0xa3ef('0x17')]+_0x5e2963['limit'];var _0x1a49a0;if(_0x252b08>=_0x5569c7){_0x252b08=_0x5569c7;_0x1a49a0=0xc8;}else{_0x1a49a0=0xce;}_0x5d9fc8[_0xa3ef('0x15')](_0x1a49a0);return _0x5d9fc8[_0xa3ef('0x1b')](_0xa3ef('0x1c'),_0x335cfe+'-'+_0x252b08+'/'+_0x5569c7)[_0xa3ef('0x16')](_0x2b66c2);}return null;};}function patchUpdates(_0x332af0){return function(_0xfbcf7b){try{jsonpatch[_0xa3ef('0x1d')](_0xfbcf7b,_0x332af0,!![]);}catch(_0x4432c1){return BPromise[_0xa3ef('0x1e')](_0x4432c1);}return _0xfbcf7b[_0xa3ef('0x1f')]();};}function saveUpdates(_0x1f23cf,_0x49e16b){return function(_0x27ae85){if(_0x27ae85){return _0x27ae85[_0xa3ef('0x20')](_0x1f23cf)['then'](function(_0x25d134){return _0x25d134;});}return null;};}function removeEntity(_0x14e687,_0x1e2b47){return function(_0x6fc3f2){if(_0x6fc3f2){return _0x6fc3f2[_0xa3ef('0x21')]()[_0xa3ef('0x22')](function(){_0x14e687[_0xa3ef('0x15')](0xcc)[_0xa3ef('0x23')]();});}};}function handleEntityNotFound(_0x134d7b,_0x3ed871){return function(_0x5eb63d){if(!_0x5eb63d){_0x134d7b[_0xa3ef('0x14')](0x194);}return _0x5eb63d;};}function handleError(_0x4110f9,_0x366225){_0x366225=_0x366225||0x1f4;return function(_0x5415ac){logger[_0xa3ef('0x24')](_0x5415ac[_0xa3ef('0x25')]);if(_0x5415ac[_0xa3ef('0x26')]){delete _0x5415ac[_0xa3ef('0x26')];}_0x4110f9[_0xa3ef('0x15')](_0x366225)[_0xa3ef('0x27')](_0x5415ac);};}exports['index']=function(_0x3c333b,_0x56c081){var _0x342cd7={},_0x491986={},_0x4d356c={'count':0x0,'rows':[]};var _0x4d8f8f=_[_0xa3ef('0x28')](db[_0xa3ef('0x29')]['rawAttributes'],function(_0x4959a4){return{'name':_0x4959a4[_0xa3ef('0x2a')],'type':_0x4959a4[_0xa3ef('0x2b')]['key']};});_0x491986[_0xa3ef('0x2c')]=_[_0xa3ef('0x28')](_0x4d8f8f,'name');_0x491986[_0xa3ef('0x2d')]=_[_0xa3ef('0x2e')](_0x3c333b[_0xa3ef('0x2d')]);_0x491986[_0xa3ef('0x2f')]=_[_0xa3ef('0x30')](_0x491986['model'],_0x491986[_0xa3ef('0x2d')]);_0x342cd7[_0xa3ef('0x31')]=_[_0xa3ef('0x30')](_0x491986['model'],qs['fields'](_0x3c333b[_0xa3ef('0x2d')][_0xa3ef('0x32')]));_0x342cd7[_0xa3ef('0x31')]=_0x342cd7[_0xa3ef('0x31')][_0xa3ef('0x33')]?_0x342cd7[_0xa3ef('0x31')]:_0x491986[_0xa3ef('0x2c')];if(!_0x3c333b[_0xa3ef('0x2d')][_0xa3ef('0x34')](_0xa3ef('0x35'))){_0x342cd7[_0xa3ef('0x19')]=qs['limit'](_0x3c333b['query'][_0xa3ef('0x19')]);_0x342cd7[_0xa3ef('0x17')]=qs[_0xa3ef('0x17')](_0x3c333b[_0xa3ef('0x2d')][_0xa3ef('0x17')]);}_0x342cd7[_0xa3ef('0x36')]=qs[_0xa3ef('0x37')](_0x3c333b[_0xa3ef('0x2d')][_0xa3ef('0x37')]);_0x342cd7[_0xa3ef('0x38')]=qs[_0xa3ef('0x2f')](_[_0xa3ef('0x39')](_0x3c333b[_0xa3ef('0x2d')],_0x491986[_0xa3ef('0x2f')]),_0x4d8f8f);if(_0x3c333b[_0xa3ef('0x2d')][_0xa3ef('0x3a')]){_0x342cd7[_0xa3ef('0x38')]=_[_0xa3ef('0x3b')](_0x342cd7[_0xa3ef('0x38')],{'$or':_[_0xa3ef('0x28')](_0x4d8f8f,function(_0x2d2602){if(_0x2d2602[_0xa3ef('0x2b')]!=='VIRTUAL'){var _0x1386f3={};_0x1386f3[_0x2d2602[_0xa3ef('0x26')]]={'$like':'%'+_0x3c333b[_0xa3ef('0x2d')][_0xa3ef('0x3a')]+'%'};return _0x1386f3;}})});}_0x342cd7=_['merge']({},_0x342cd7,_0x3c333b['options']);var _0x15197b={'where':_0x342cd7[_0xa3ef('0x38')]};return db[_0xa3ef('0x29')][_0xa3ef('0x1a')](_0x15197b)[_0xa3ef('0x22')](function(_0x2ac7c2){_0x4d356c['count']=_0x2ac7c2;if(_0x3c333b[_0xa3ef('0x2d')][_0xa3ef('0x3c')]){_0x342cd7[_0xa3ef('0x3d')]=[{'all':!![]}];}return db[_0xa3ef('0x29')][_0xa3ef('0x3e')](_0x342cd7);})['then'](function(_0x18ff1e){_0x4d356c[_0xa3ef('0x3f')]=_0x18ff1e;return _0x4d356c;})['then'](respondWithFilteredResult(_0x56c081,_0x342cd7))['catch'](handleError(_0x56c081,null));};exports[_0xa3ef('0x40')]=function(_0xe36cb2,_0x473f58){var _0x3c1305={'raw':!![],'where':{'id':_0xe36cb2['params']['id']}},_0x4eaafe={};_0x4eaafe[_0xa3ef('0x2c')]=_[_0xa3ef('0x2e')](db['JscriptySessionReport'][_0xa3ef('0x41')]);_0x4eaafe[_0xa3ef('0x2d')]=_[_0xa3ef('0x2e')](_0xe36cb2['query']);_0x4eaafe['filters']=_['intersection'](_0x4eaafe[_0xa3ef('0x2c')],_0x4eaafe[_0xa3ef('0x2d')]);_0x3c1305[_0xa3ef('0x31')]=_[_0xa3ef('0x30')](_0x4eaafe[_0xa3ef('0x2c')],qs[_0xa3ef('0x32')](_0xe36cb2[_0xa3ef('0x2d')][_0xa3ef('0x32')]));_0x3c1305[_0xa3ef('0x31')]=_0x3c1305['attributes']['length']?_0x3c1305['attributes']:_0x4eaafe[_0xa3ef('0x2c')];if(_0xe36cb2['query'][_0xa3ef('0x3c')]){_0x3c1305[_0xa3ef('0x3d')]=[{'all':!![]}];}_0x3c1305=_[_0xa3ef('0x3b')]({},_0x3c1305,_0xe36cb2[_0xa3ef('0x42')]);return db['JscriptySessionReport'][_0xa3ef('0x43')](_0x3c1305)[_0xa3ef('0x22')](handleEntityNotFound(_0x473f58,null))['then'](respondWithResult(_0x473f58,null))['catch'](handleError(_0x473f58,null));};exports[_0xa3ef('0x44')]=function(_0x233ece,_0x21fd71){return db[_0xa3ef('0x29')][_0xa3ef('0x44')](_0x233ece['body'],{})[_0xa3ef('0x22')](respondWithResult(_0x21fd71,0xc9))[_0xa3ef('0x45')](handleError(_0x21fd71,null));};exports[_0xa3ef('0x20')]=function(_0x38d1bc,_0x96ac1){if(_0x38d1bc[_0xa3ef('0x46')]['id']){delete _0x38d1bc[_0xa3ef('0x46')]['id'];}return db[_0xa3ef('0x29')][_0xa3ef('0x43')]({'where':{'id':_0x38d1bc['params']['id']}})[_0xa3ef('0x22')](handleEntityNotFound(_0x96ac1,null))[_0xa3ef('0x22')](saveUpdates(_0x38d1bc[_0xa3ef('0x46')],null))[_0xa3ef('0x22')](respondWithResult(_0x96ac1,null))[_0xa3ef('0x45')](handleError(_0x96ac1,null));};exports['destroy']=function(_0x28375b,_0x7ae46){return db[_0xa3ef('0x29')][_0xa3ef('0x43')]({'where':{'id':_0x28375b[_0xa3ef('0x47')]['id']}})[_0xa3ef('0x22')](handleEntityNotFound(_0x7ae46,null))[_0xa3ef('0x22')](removeEntity(_0x7ae46,null))[_0xa3ef('0x45')](handleError(_0x7ae46,null));};exports[_0xa3ef('0x48')]=function(_0x3ebf54,_0x31da3e){return db[_0xa3ef('0x29')][_0xa3ef('0x48')]()[_0xa3ef('0x22')](respondWithResult(_0x31da3e,null))[_0xa3ef('0x45')](handleError(_0x31da3e,null));};exports[_0xa3ef('0x49')]=function(_0x53b72c,_0x4f8015,_0x1c44b1){var _0x178f59={'raw':!![],'where':{}};var _0x2514fe={};var _0x1794fd={'count':0x0,'rows':[]};return db[_0xa3ef('0x29')][_0xa3ef('0x4a')]({'where':{'id':_0x53b72c[_0xa3ef('0x47')]['id']}})['then'](handleEntityNotFound(_0x4f8015,null))[_0xa3ef('0x22')](function(_0xdceb44){if(_0xdceb44){_0x2514fe[_0xa3ef('0x2c')]=_['keys'](db[_0xa3ef('0x4b')]['rawAttributes']);_0x2514fe[_0xa3ef('0x2d')]=_[_0xa3ef('0x2e')](_0x53b72c[_0xa3ef('0x2d')]);_0x2514fe[_0xa3ef('0x2f')]=_['intersection'](_0x2514fe[_0xa3ef('0x2c')],_0x2514fe[_0xa3ef('0x2d')]);_0x178f59['attributes']=_[_0xa3ef('0x30')](_0x2514fe[_0xa3ef('0x2c')],qs[_0xa3ef('0x32')](_0x53b72c['query'][_0xa3ef('0x32')]));_0x178f59[_0xa3ef('0x31')]=_0x178f59[_0xa3ef('0x31')][_0xa3ef('0x33')]?_0x178f59['attributes']:_0x2514fe['model'];if(!_0x53b72c[_0xa3ef('0x2d')][_0xa3ef('0x34')](_0xa3ef('0x35'))){_0x178f59[_0xa3ef('0x19')]=qs[_0xa3ef('0x19')](_0x53b72c[_0xa3ef('0x2d')][_0xa3ef('0x19')]);_0x178f59[_0xa3ef('0x17')]=qs[_0xa3ef('0x17')](_0x53b72c['query'][_0xa3ef('0x17')]);}_0x178f59['order']=qs['sort'](_0x53b72c[_0xa3ef('0x2d')]['sort']);_0x178f59[_0xa3ef('0x38')]=qs[_0xa3ef('0x2f')](_[_0xa3ef('0x39')](_0x53b72c[_0xa3ef('0x2d')],_0x2514fe['filters']));_0x178f59['where'][_0xa3ef('0x4c')]=_0xdceb44['id'];if(_0x53b72c['query'][_0xa3ef('0x3a')]){_0x178f59[_0xa3ef('0x38')]=_[_0xa3ef('0x3b')](_0x178f59[_0xa3ef('0x38')],{'$or':_['map'](_0x178f59[_0xa3ef('0x31')],function(_0x14d6b0){var _0x4f9e20={};_0x4f9e20[_0x14d6b0]={'$like':'%'+_0x53b72c[_0xa3ef('0x2d')]['filter']+'%'};return _0x4f9e20;})});}_0x178f59=_[_0xa3ef('0x3b')]({},_0x178f59,_0x53b72c[_0xa3ef('0x42')]);return db[_0xa3ef('0x4b')][_0xa3ef('0x1a')]({'where':_0x178f59[_0xa3ef('0x38')]})[_0xa3ef('0x22')](function(_0x420084){_0x1794fd[_0xa3ef('0x1a')]=_0x420084;if(_0x53b72c[_0xa3ef('0x2d')][_0xa3ef('0x3c')]){_0x178f59[_0xa3ef('0x3d')]=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0xa3ef('0x3e')](_0x178f59);})[_0xa3ef('0x22')](function(_0x4266c9){_0x1794fd[_0xa3ef('0x3f')]=_0x4266c9;return _0x1794fd;});}})['then'](respondWithFilteredResult(_0x4f8015,_0x178f59))['catch'](handleError(_0x4f8015,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index 4c47af5..24b4baf 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 _0x3eea=['exports','JscriptySessionReport','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptySessionReport.attributes'];(function(_0x15b36f,_0x514961){var _0x5dffdd=function(_0x5931e3){while(--_0x5931e3){_0x15b36f['push'](_0x15b36f['shift']());}};_0x5dffdd(++_0x514961);}(_0x3eea,0x1ca));var _0xa3ee=function(_0x415773,_0x64f46c){_0x415773=_0x415773-0x0;var _0x7d2998=_0x3eea[_0x415773];return _0x7d2998;};'use strict';var _=require(_0xa3ee('0x0'));var util=require('util');var logger=require(_0xa3ee('0x1'))(_0xa3ee('0x2'));var moment=require(_0xa3ee('0x3'));var BPromise=require(_0xa3ee('0x4'));var rp=require(_0xa3ee('0x5'));var fs=require('fs');var path=require(_0xa3ee('0x6'));var rimraf=require(_0xa3ee('0x7'));var config=require(_0xa3ee('0x8'));var attributes=require(_0xa3ee('0x9'));module[_0xa3ee('0xa')]=function(_0xb93cdb,_0x5776bb){return _0xb93cdb['define'](_0xa3ee('0xb'),attributes,{'tableName':'report_jscripty_sessions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4c60=['define','JscriptySessionReport','report_jscripty_sessions','lodash','util','../../config/logger','api','bluebird','./jscriptySessionReport.attributes','exports'];(function(_0x1fd19e,_0x8fed02){var _0x5afd64=function(_0x5ac798){while(--_0x5ac798){_0x1fd19e['push'](_0x1fd19e['shift']());}};_0x5afd64(++_0x8fed02);}(_0x4c60,0xc1));var _0x04c6=function(_0x162dc8,_0x380693){_0x162dc8=_0x162dc8-0x0;var _0x1052a4=_0x4c60[_0x162dc8];return _0x1052a4;};'use strict';var _=require(_0x04c6('0x0'));var util=require(_0x04c6('0x1'));var logger=require(_0x04c6('0x2'))(_0x04c6('0x3'));var moment=require('moment');var BPromise=require(_0x04c6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x04c6('0x5'));module[_0x04c6('0x6')]=function(_0x2054da,_0x12bd5d){return _0x2054da[_0x04c6('0x7')](_0x04c6('0x8'),attributes,{'tableName':_0x04c6('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js b/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js index f737190..95fbc08 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 _0xdf55=['util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','JscriptySessionReport,\x20%s,\x20%s,\x20%s','error','code','JscriptySessionReport,\x20%s,\x20%s','message','info','result','catch','lodash'];(function(_0x5d4aff,_0x4d58e9){var _0x28ef30=function(_0x3a5c03){while(--_0x3a5c03){_0x5d4aff['push'](_0x5d4aff['shift']());}};_0x28ef30(++_0x4d58e9);}(_0xdf55,0x83));var _0x5df5=function(_0x16b334,_0x58bd7f){_0x16b334=_0x16b334-0x0;var _0x54aff2=_0xdf55[_0x16b334];return _0x54aff2;};'use strict';var _=require(_0x5df5('0x0'));var util=require(_0x5df5('0x1'));var moment=require('moment');var BPromise=require(_0x5df5('0x2'));var rs=require(_0x5df5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5df5('0x4'))['db'];var utils=require(_0x5df5('0x5'));var logger=require(_0x5df5('0x6'))('rpc');var config=require(_0x5df5('0x7'));var jayson=require(_0x5df5('0x8'));var client=jayson[_0x5df5('0x9')][_0x5df5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x9b8756,_0x2b7ed9,_0x4722a2){return new BPromise(function(_0x3743f3,_0x4d43a3){return client[_0x5df5('0xb')](_0x9b8756,_0x4722a2)[_0x5df5('0xc')](function(_0x41941e){logger['info']('JscriptySessionReport,\x20%s,\x20%s',_0x2b7ed9,_0x5df5('0xd'));logger['debug'](_0x5df5('0xe'),_0x2b7ed9,_0x5df5('0xd'),JSON['stringify'](_0x41941e));if(_0x41941e['error']){if(_0x41941e[_0x5df5('0xf')][_0x5df5('0x10')]===0x1f4){logger[_0x5df5('0xf')](_0x5df5('0x11'),_0x2b7ed9,_0x41941e[_0x5df5('0xf')][_0x5df5('0x12')]);return _0x4d43a3(_0x41941e[_0x5df5('0xf')][_0x5df5('0x12')]);}logger[_0x5df5('0xf')](_0x5df5('0x11'),_0x2b7ed9,_0x41941e['error'][_0x5df5('0x12')]);return _0x3743f3(_0x41941e['error'][_0x5df5('0x12')]);}else{logger[_0x5df5('0x13')](_0x5df5('0x11'),_0x2b7ed9,_0x5df5('0xd'));_0x3743f3(_0x41941e[_0x5df5('0x14')]['message']);}})[_0x5df5('0x15')](function(_0x457205){logger['error'](_0x5df5('0x11'),_0x2b7ed9,_0x457205);_0x4d43a3(_0x457205);});});} \ No newline at end of file +var _0xe3da=['stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s'];(function(_0x2b8690,_0x352c24){var _0x49d165=function(_0x509e94){while(--_0x509e94){_0x2b8690['push'](_0x2b8690['shift']());}};_0x49d165(++_0x352c24);}(_0xe3da,0x1cd));var _0xae3d=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xe3da[_0x57b54c];return _0x59cc19;};'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);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index c19b2c1..8af5635 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 _0x9f7c=['/:id','update','get','/download_log_file','isAuthenticated','downloadLogFile','exports','multer','util','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','index','put'];(function(_0x2e12e4,_0x57ed3e){var _0x1ad7ff=function(_0x17fbdb){while(--_0x17fbdb){_0x2e12e4['push'](_0x2e12e4['shift']());}};_0x1ad7ff(++_0x57ed3e);}(_0x9f7c,0x1ba));var _0xc9f7=function(_0x25fb24,_0x432488){_0x25fb24=_0x25fb24-0x0;var _0x3f044c=_0x9f7c[_0x25fb24];return _0x3f044c;};'use strict';var multer=require(_0xc9f7('0x0'));var util=require(_0xc9f7('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xc9f7('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xc9f7('0x3'));var interaction=require(_0xc9f7('0x4'));var config=require(_0xc9f7('0x5'));var controller=require('./license.controller');router['get']('/',controller[_0xc9f7('0x6')]);router[_0xc9f7('0x7')](_0xc9f7('0x8'),auth['isAuthenticated'](),controller[_0xc9f7('0x9')]);router[_0xc9f7('0xa')](_0xc9f7('0xb'),auth[_0xc9f7('0xc')](),controller[_0xc9f7('0xd')]);module[_0xc9f7('0xe')]=router; \ No newline at end of file +var _0x6c2e=['exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./license.controller','get','put','/:id','isAuthenticated','/download_log_file','downloadLogFile'];(function(_0x12ec65,_0x5bd7c9){var _0x28502f=function(_0x3958de){while(--_0x3958de){_0x12ec65['push'](_0x12ec65['shift']());}};_0x28502f(++_0x5bd7c9);}(_0x6c2e,0x196));var _0xe6c2=function(_0x2ecfd3,_0x441216){_0x2ecfd3=_0x2ecfd3-0x0;var _0x4580ad=_0x6c2e[_0x2ecfd3];return _0x4580ad;};'use strict';var multer=require('multer');var util=require(_0xe6c2('0x0'));var path=require(_0xe6c2('0x1'));var timeout=require(_0xe6c2('0x2'));var express=require('express');var router=express[_0xe6c2('0x3')]();var fs_extra=require(_0xe6c2('0x4'));var auth=require(_0xe6c2('0x5'));var interaction=require(_0xe6c2('0x6'));var config=require('../../config/environment');var controller=require(_0xe6c2('0x7'));router[_0xe6c2('0x8')]('/',controller['index']);router[_0xe6c2('0x9')](_0xe6c2('0xa'),auth[_0xe6c2('0xb')](),controller['update']);router[_0xe6c2('0x8')](_0xe6c2('0xc'),auth[_0xe6c2('0xb')](),controller[_0xe6c2('0xd')]);module[_0xe6c2('0xe')]=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index b504f1d..fe960ed 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 _0xa669=['TEXT','STRING','INTEGER','sequelize','exports'];(function(_0x233e9e,_0xf5ce1d){var _0x1a4aba=function(_0x586e6b){while(--_0x586e6b){_0x233e9e['push'](_0x233e9e['shift']());}};_0x1a4aba(++_0xf5ce1d);}(_0xa669,0x161));var _0x9a66=function(_0x17655f,_0x4130bb){_0x17655f=_0x17655f-0x0;var _0x50330f=_0xa669[_0x17655f];return _0x50330f;};'use strict';var Sequelize=require(_0x9a66('0x0'));module[_0x9a66('0x1')]={'license':{'type':Sequelize[_0x9a66('0x2')]},'data1':{'type':Sequelize[_0x9a66('0x3')]},'data2':{'type':Sequelize['STRING']},'chatLicenseExceeded':{'type':Sequelize[_0x9a66('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0xa053=['INTEGER','sequelize','exports','TEXT','STRING'];(function(_0x281252,_0x2fced9){var _0x429731=function(_0x4e06f3){while(--_0x4e06f3){_0x281252['push'](_0x281252['shift']());}};_0x429731(++_0x2fced9);}(_0xa053,0x1a5));var _0x3a05=function(_0x165b1a,_0x3f8696){_0x165b1a=_0x165b1a-0x0;var _0x3da730=_0xa053[_0x165b1a];return _0x3da730;};'use strict';var Sequelize=require(_0x3a05('0x0'));module[_0x3a05('0x1')]={'license':{'type':Sequelize[_0x3a05('0x2')]},'data1':{'type':Sequelize[_0x3a05('0x3')]},'data2':{'type':Sequelize[_0x3a05('0x3')]},'chatLicenseExceeded':{'type':Sequelize[_0x3a05('0x4')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/license/license.controller.js b/server/api/license/license.controller.js index 8fad1ff..57df6d5 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 _0xf32d=['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','undefined','limit','count','Content-Range','reject','save','update','destroy','error','stack','name','send','index','keys','rawAttributes','query','filters','intersection','fields','attributes','length','model','merge','options','getLicense','then','body','License','params','get','checkLicense','key','demo','catch','downloadLogFile','join','/var','log','xcally','setHeader','Content-disposition','attachment;\x20filename=','set','Content-Type','text/plain','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse'];(function(_0x41462a,_0x146947){var _0xa4642a=function(_0x1f6053){while(--_0x1f6053){_0x41462a['push'](_0x41462a['shift']());}};_0xa4642a(++_0x146947);}(_0xf32d,0x8a));var _0xdf32=function(_0x4cc39c,_0x456f4b){_0x4cc39c=_0x4cc39c-0x0;var _0x7b0c05=_0xf32d[_0x4cc39c];return _0x7b0c05;};'use strict';var emlformat=require(_0xdf32('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdf32('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdf32('0x2'));var moment=require(_0xdf32('0x3'));var BPromise=require(_0xdf32('0x4'));var Mustache=require(_0xdf32('0x5'));var util=require(_0xdf32('0x6'));var path=require(_0xdf32('0x7'));var sox=require(_0xdf32('0x8'));var csv=require(_0xdf32('0x9'));var ejs=require(_0xdf32('0xa'));var fs=require('fs');var fs_extra=require(_0xdf32('0xb'));var _=require(_0xdf32('0xc'));var squel=require(_0xdf32('0xd'));var crypto=require('crypto');var jsforce=require(_0xdf32('0xe'));var deskjs=require(_0xdf32('0xf'));var toCsv=require(_0xdf32('0x9'));var querystring=require(_0xdf32('0x10'));var Papa=require(_0xdf32('0x11'));var Redis=require(_0xdf32('0x12'));var authService=require(_0xdf32('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xdf32('0x14'));var hardwareService=require(_0xdf32('0x15'));var logger=require(_0xdf32('0x16'))(_0xdf32('0x17'));var utils=require(_0xdf32('0x18'));var config=require(_0xdf32('0x19'));var licenseUtil=require(_0xdf32('0x1a'));var db=require(_0xdf32('0x1b'))['db'];function respondWithStatusCode(_0x30a579,_0x2c7895){_0x2c7895=_0x2c7895||0xcc;return function(_0x1d78b6){if(_0x1d78b6){return _0x30a579[_0xdf32('0x1c')](_0x2c7895);}return _0x30a579[_0xdf32('0x1d')](_0x2c7895)[_0xdf32('0x1e')]();};}function respondWithResult(_0x313664,_0xeecfce){_0xeecfce=_0xeecfce||0xc8;return function(_0x576c80){if(_0x576c80){return _0x313664[_0xdf32('0x1d')](_0xeecfce)[_0xdf32('0x1f')](_0x576c80);}};}function respondWithFilteredResult(_0x4ceaf1,_0x5170c8){return function(_0x1073b2){if(_0x1073b2){var _0x56a622=typeof _0x5170c8[_0xdf32('0x20')]===_0xdf32('0x21')&&typeof _0x5170c8[_0xdf32('0x22')]==='undefined';var _0x2b2577=_0x1073b2['count'];var _0x2bb33a=_0x56a622?0x0:_0x5170c8[_0xdf32('0x20')];var _0x1c9595=_0x56a622?_0x1073b2[_0xdf32('0x23')]:_0x5170c8[_0xdf32('0x20')]+_0x5170c8[_0xdf32('0x22')];var _0x1781c1;if(_0x1c9595>=_0x2b2577){_0x1c9595=_0x2b2577;_0x1781c1=0xc8;}else{_0x1781c1=0xce;}_0x4ceaf1[_0xdf32('0x1d')](_0x1781c1);return _0x4ceaf1['set'](_0xdf32('0x24'),_0x2bb33a+'-'+_0x1c9595+'/'+_0x2b2577)[_0xdf32('0x1f')](_0x1073b2);}return null;};}function patchUpdates(_0x275ccc){return function(_0x5e6f5e){try{jsonpatch['apply'](_0x5e6f5e,_0x275ccc,!![]);}catch(_0x3d7417){return BPromise[_0xdf32('0x25')](_0x3d7417);}return _0x5e6f5e[_0xdf32('0x26')]();};}function saveUpdates(_0x14b510,_0x49e483){return function(_0x575f18){if(_0x575f18){return _0x575f18[_0xdf32('0x27')](_0x14b510)['then'](function(_0x46ec6c){return _0x46ec6c;});}return null;};}function removeEntity(_0x5b4813,_0x16833e){return function(_0x1758f4){if(_0x1758f4){return _0x1758f4[_0xdf32('0x28')]()['then'](function(){_0x5b4813[_0xdf32('0x1d')](0xcc)[_0xdf32('0x1e')]();});}};}function handleEntityNotFound(_0x345843,_0xa15545){return function(_0x85c3f4){if(!_0x85c3f4){_0x345843['sendStatus'](0x194);}return _0x85c3f4;};}function handleError(_0x67c1b9,_0x174737){_0x174737=_0x174737||0x1f4;return function(_0x38fd38){logger[_0xdf32('0x29')](_0x38fd38[_0xdf32('0x2a')]);if(_0x38fd38[_0xdf32('0x2b')]){delete _0x38fd38[_0xdf32('0x2b')];}_0x67c1b9[_0xdf32('0x1d')](_0x174737)[_0xdf32('0x2c')](_0x38fd38);};}var utilLicense=require(_0xdf32('0x1a'));exports[_0xdf32('0x2d')]=function(_0x1b9dee,_0x29690b){var _0x31a402={'raw':!![],'where':{'id':0x1}},_0x5ded2d={};_0x5ded2d['model']=_[_0xdf32('0x2e')](db['License'][_0xdf32('0x2f')]);_0x5ded2d[_0xdf32('0x30')]=_[_0xdf32('0x2e')](_0x1b9dee[_0xdf32('0x30')]);_0x5ded2d[_0xdf32('0x31')]=_['intersection'](_0x5ded2d['model'],_0x5ded2d[_0xdf32('0x30')]);_0x31a402['attributes']=_[_0xdf32('0x32')](_0x5ded2d['model'],qs[_0xdf32('0x33')](_0x1b9dee[_0xdf32('0x30')][_0xdf32('0x33')]));_0x31a402[_0xdf32('0x34')]=_0x31a402[_0xdf32('0x34')][_0xdf32('0x35')]?_0x31a402[_0xdf32('0x34')]:_0x5ded2d[_0xdf32('0x36')];_0x31a402=_[_0xdf32('0x37')]({},_0x31a402,_0x1b9dee[_0xdf32('0x38')]);return utilLicense[_0xdf32('0x39')](_0x31a402)[_0xdf32('0x3a')](respondWithResult(_0x29690b,null))['catch'](handleError(_0x29690b,null));};exports[_0xdf32('0x27')]=function(_0x271000,_0x3e0cc5){if(_0x271000[_0xdf32('0x3b')]['id']){delete _0x271000[_0xdf32('0x3b')]['id'];}return db[_0xdf32('0x3c')]['find']({'where':{'id':_0x271000[_0xdf32('0x3d')]['id']}})[_0xdf32('0x3a')](handleEntityNotFound(_0x3e0cc5,null))[_0xdf32('0x3a')](function(_0x2f7803){var _0x337af9=_0x2f7803[_0xdf32('0x3e')]({'plain':!![]});return utilLicense[_0xdf32('0x3f')](_0x337af9,_0x271000[_0xdf32('0x3b')][_0xdf32('0x40')]);})[_0xdf32('0x3a')](function(_0x2ded81){if(!_0x2ded81[_0xdf32('0x41')]){return saveUpdates(_0x271000[_0xdf32('0x3b')],null);}return _0x2ded81;})[_0xdf32('0x3a')](respondWithResult(_0x3e0cc5,null))[_0xdf32('0x42')](handleError(_0x3e0cc5,null));};exports[_0xdf32('0x43')]=function(_0x3af8a1,_0x370601){var _0x47e726='license-info.log';var _0x6a3b0a=path[_0xdf32('0x44')](_0xdf32('0x45'),_0xdf32('0x46'),_0xdf32('0x47'),_0x47e726);_0x370601[_0xdf32('0x48')](_0xdf32('0x49'),_0xdf32('0x4a')+_0x47e726);_0x370601[_0xdf32('0x4b')](_0xdf32('0x4c'),_0xdf32('0x4d'));_0x370601['download'](_0x6a3b0a);}; \ No newline at end of file +var _0xa0ef=['limit','count','set','Content-Range','apply','reject','then','destroy','error','stack','name','index','model','keys','License','rawAttributes','query','attributes','intersection','fields','length','catch','update','body','params','get','checkLicense','key','demo','downloadLogFile','license-info.log','/var','log','xcally','setHeader','Content-disposition','attachment;\x20filename=','text/plain','download','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','sendStatus','end','status','json','offset','undefined'];(function(_0x500d8c,_0x1e89ef){var _0x1886e7=function(_0x1afd7c){while(--_0x1afd7c){_0x500d8c['push'](_0x500d8c['shift']());}};_0x1886e7(++_0x1e89ef);}(_0xa0ef,0xb1));var _0xfa0e=function(_0x624f98,_0x12488a){_0x624f98=_0x624f98-0x0;var _0x4e09ec=_0xa0ef[_0x624f98];return _0x4e09ec;};'use strict';var emlformat=require(_0xfa0e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfa0e('0x1'));var jsonpatch=require(_0xfa0e('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xfa0e('0x3'));var Mustache=require(_0xfa0e('0x4'));var util=require(_0xfa0e('0x5'));var path=require(_0xfa0e('0x6'));var sox=require(_0xfa0e('0x7'));var csv=require(_0xfa0e('0x8'));var ejs=require(_0xfa0e('0x9'));var fs=require('fs');var fs_extra=require(_0xfa0e('0xa'));var _=require('lodash');var squel=require(_0xfa0e('0xb'));var crypto=require(_0xfa0e('0xc'));var jsforce=require(_0xfa0e('0xd'));var deskjs=require(_0xfa0e('0xe'));var toCsv=require(_0xfa0e('0x8'));var querystring=require(_0xfa0e('0xf'));var Papa=require(_0xfa0e('0x10'));var Redis=require(_0xfa0e('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xfa0e('0x12'));var as=require(_0xfa0e('0x13'));var hardwareService=require(_0xfa0e('0x14'));var logger=require('../../config/logger')(_0xfa0e('0x15'));var utils=require(_0xfa0e('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xfa0e('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x11f77c,_0x5f5633){_0x5f5633=_0x5f5633||0xcc;return function(_0xeebc4f){if(_0xeebc4f){return _0x11f77c[_0xfa0e('0x18')](_0x5f5633);}return _0x11f77c['status'](_0x5f5633)[_0xfa0e('0x19')]();};}function respondWithResult(_0x42835b,_0x5935bc){_0x5935bc=_0x5935bc||0xc8;return function(_0xc68f16){if(_0xc68f16){return _0x42835b[_0xfa0e('0x1a')](_0x5935bc)[_0xfa0e('0x1b')](_0xc68f16);}};}function respondWithFilteredResult(_0xc4816d,_0x601ecc){return function(_0x430540){if(_0x430540){var _0x1465b7=typeof _0x601ecc[_0xfa0e('0x1c')]===_0xfa0e('0x1d')&&typeof _0x601ecc[_0xfa0e('0x1e')]===_0xfa0e('0x1d');var _0x1f1d30=_0x430540[_0xfa0e('0x1f')];var _0xa14768=_0x1465b7?0x0:_0x601ecc['offset'];var _0x1fca8b=_0x1465b7?_0x430540[_0xfa0e('0x1f')]:_0x601ecc['offset']+_0x601ecc[_0xfa0e('0x1e')];var _0x2ae863;if(_0x1fca8b>=_0x1f1d30){_0x1fca8b=_0x1f1d30;_0x2ae863=0xc8;}else{_0x2ae863=0xce;}_0xc4816d[_0xfa0e('0x1a')](_0x2ae863);return _0xc4816d[_0xfa0e('0x20')](_0xfa0e('0x21'),_0xa14768+'-'+_0x1fca8b+'/'+_0x1f1d30)['json'](_0x430540);}return null;};}function patchUpdates(_0x4ac746){return function(_0x8e7eb6){try{jsonpatch[_0xfa0e('0x22')](_0x8e7eb6,_0x4ac746,!![]);}catch(_0x2169c5){return BPromise[_0xfa0e('0x23')](_0x2169c5);}return _0x8e7eb6['save']();};}function saveUpdates(_0x2e16fe,_0x14a4df){return function(_0x1e5c85){if(_0x1e5c85){return _0x1e5c85['update'](_0x2e16fe)[_0xfa0e('0x24')](function(_0x5c87b0){return _0x5c87b0;});}return null;};}function removeEntity(_0x3a3a34,_0x38e852){return function(_0x4658af){if(_0x4658af){return _0x4658af[_0xfa0e('0x25')]()[_0xfa0e('0x24')](function(){_0x3a3a34[_0xfa0e('0x1a')](0xcc)[_0xfa0e('0x19')]();});}};}function handleEntityNotFound(_0x592766,_0x3b9609){return function(_0x5c1719){if(!_0x5c1719){_0x592766[_0xfa0e('0x18')](0x194);}return _0x5c1719;};}function handleError(_0x4af23f,_0x4721a5){_0x4721a5=_0x4721a5||0x1f4;return function(_0x432719){logger[_0xfa0e('0x26')](_0x432719[_0xfa0e('0x27')]);if(_0x432719[_0xfa0e('0x28')]){delete _0x432719[_0xfa0e('0x28')];}_0x4af23f[_0xfa0e('0x1a')](_0x4721a5)['send'](_0x432719);};}var utilLicense=require(_0xfa0e('0x17'));exports[_0xfa0e('0x29')]=function(_0x1dddf7,_0x22c474){var _0x487494={'raw':!![],'where':{'id':0x1}},_0x3de937={};_0x3de937[_0xfa0e('0x2a')]=_[_0xfa0e('0x2b')](db[_0xfa0e('0x2c')][_0xfa0e('0x2d')]);_0x3de937[_0xfa0e('0x2e')]=_[_0xfa0e('0x2b')](_0x1dddf7[_0xfa0e('0x2e')]);_0x3de937['filters']=_['intersection'](_0x3de937[_0xfa0e('0x2a')],_0x3de937['query']);_0x487494[_0xfa0e('0x2f')]=_[_0xfa0e('0x30')](_0x3de937[_0xfa0e('0x2a')],qs[_0xfa0e('0x31')](_0x1dddf7[_0xfa0e('0x2e')][_0xfa0e('0x31')]));_0x487494[_0xfa0e('0x2f')]=_0x487494[_0xfa0e('0x2f')][_0xfa0e('0x32')]?_0x487494[_0xfa0e('0x2f')]:_0x3de937[_0xfa0e('0x2a')];_0x487494=_['merge']({},_0x487494,_0x1dddf7['options']);return utilLicense['getLicense'](_0x487494)[_0xfa0e('0x24')](respondWithResult(_0x22c474,null))[_0xfa0e('0x33')](handleError(_0x22c474,null));};exports[_0xfa0e('0x34')]=function(_0x2a1e8c,_0x4adbeb){if(_0x2a1e8c[_0xfa0e('0x35')]['id']){delete _0x2a1e8c[_0xfa0e('0x35')]['id'];}return db[_0xfa0e('0x2c')]['find']({'where':{'id':_0x2a1e8c[_0xfa0e('0x36')]['id']}})[_0xfa0e('0x24')](handleEntityNotFound(_0x4adbeb,null))[_0xfa0e('0x24')](function(_0x493b77){var _0x46706c=_0x493b77[_0xfa0e('0x37')]({'plain':!![]});return utilLicense[_0xfa0e('0x38')](_0x46706c,_0x2a1e8c[_0xfa0e('0x35')][_0xfa0e('0x39')]);})[_0xfa0e('0x24')](function(_0x53a07c){if(!_0x53a07c[_0xfa0e('0x3a')]){return saveUpdates(_0x2a1e8c[_0xfa0e('0x35')],null);}return _0x53a07c;})['then'](respondWithResult(_0x4adbeb,null))[_0xfa0e('0x33')](handleError(_0x4adbeb,null));};exports[_0xfa0e('0x3b')]=function(_0x6033c5,_0x557e38){var _0x5c5fd5=_0xfa0e('0x3c');var _0x1fb784=path['join'](_0xfa0e('0x3d'),_0xfa0e('0x3e'),_0xfa0e('0x3f'),_0x5c5fd5);_0x557e38[_0xfa0e('0x40')](_0xfa0e('0x41'),_0xfa0e('0x42')+_0x5c5fd5);_0x557e38[_0xfa0e('0x20')]('Content-Type',_0xfa0e('0x43'));_0x557e38[_0xfa0e('0x44')](_0x1fb784);}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index 74d5ced..612e6cc 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 _0x7c47=['util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','exports','License','license'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7c47,0x12c));var _0x77c4=function(_0x37aefd,_0x11670c){_0x37aefd=_0x37aefd-0x0;var _0x3afb9d=_0x7c47[_0x37aefd];return _0x3afb9d;};'use strict';var _=require('lodash');var util=require(_0x77c4('0x0'));var logger=require(_0x77c4('0x1'))('api');var moment=require('moment');var BPromise=require(_0x77c4('0x2'));var rp=require(_0x77c4('0x3'));var fs=require('fs');var path=require(_0x77c4('0x4'));var rimraf=require(_0x77c4('0x5'));var config=require(_0x77c4('0x6'));var attributes=require('./license.attributes');module[_0x77c4('0x7')]=function(_0x52b0c5,_0xecb17d){return _0x52b0c5['define'](_0x77c4('0x8'),attributes,{'tableName':_0x77c4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa819=['moment','request-promise','../../config/environment','exports','define','license','lodash','../../config/logger','api'];(function(_0x382df4,_0x568209){var _0x2258d2=function(_0x51ef40){while(--_0x51ef40){_0x382df4['push'](_0x382df4['shift']());}};_0x2258d2(++_0x568209);}(_0xa819,0x114));var _0x9a81=function(_0x1a89cd,_0x44338f){_0x1a89cd=_0x1a89cd-0x0;var _0x1023d0=_0xa819[_0x1a89cd];return _0x1023d0;};'use strict';var _=require(_0x9a81('0x0'));var util=require('util');var logger=require(_0x9a81('0x1'))(_0x9a81('0x2'));var moment=require(_0x9a81('0x3'));var BPromise=require('bluebird');var rp=require(_0x9a81('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x9a81('0x5'));var attributes=require('./license.attributes');module[_0x9a81('0x6')]=function(_0x43e82e,_0x1fc43e){return _0x43e82e[_0x9a81('0x7')]('License',attributes,{'tableName':_0x9a81('0x8'),'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 f6e7b02..badde5a 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 _0x3eab=['error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','then','info','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x743701,_0x3e67bb){var _0x5a141d=function(_0x4b198d){while(--_0x4b198d){_0x743701['push'](_0x743701['shift']());}};_0x5a141d(++_0x3e67bb);}(_0x3eab,0x1bc));var _0xb3ea=function(_0x247301,_0x153f6c){_0x247301=_0x247301-0x0;var _0x3390e6=_0x3eab[_0x247301];return _0x3390e6;};'use strict';var _=require(_0xb3ea('0x0'));var util=require(_0xb3ea('0x1'));var moment=require(_0xb3ea('0x2'));var BPromise=require(_0xb3ea('0x3'));var rs=require(_0xb3ea('0x4'));var fs=require('fs');var Redis=require(_0xb3ea('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb3ea('0x6'));var logger=require('../../config/logger')(_0xb3ea('0x7'));var config=require(_0xb3ea('0x8'));var jayson=require(_0xb3ea('0x9'));var client=jayson['client'][_0xb3ea('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x191564,_0x496976,_0xaf3cbd){return new BPromise(function(_0x2ce321,_0x508703){return client['request'](_0x191564,_0xaf3cbd)[_0xb3ea('0xb')](function(_0xba5333){logger[_0xb3ea('0xc')](_0xb3ea('0xd'),_0x496976,_0xb3ea('0xe'));logger[_0xb3ea('0xf')](_0xb3ea('0x10'),_0x496976,_0xb3ea('0xe'),JSON[_0xb3ea('0x11')](_0xba5333));if(_0xba5333[_0xb3ea('0x12')]){if(_0xba5333[_0xb3ea('0x12')][_0xb3ea('0x13')]===0x1f4){logger[_0xb3ea('0x12')]('License,\x20%s,\x20%s',_0x496976,_0xba5333['error'][_0xb3ea('0x14')]);return _0x508703(_0xba5333[_0xb3ea('0x12')][_0xb3ea('0x14')]);}logger['error'](_0xb3ea('0xd'),_0x496976,_0xba5333[_0xb3ea('0x12')][_0xb3ea('0x14')]);return _0x2ce321(_0xba5333['error']['message']);}else{logger[_0xb3ea('0xc')](_0xb3ea('0xd'),_0x496976,_0xb3ea('0xe'));_0x2ce321(_0xba5333[_0xb3ea('0x15')][_0xb3ea('0x14')]);}})['catch'](function(_0x56eccd){logger[_0xb3ea('0x12')](_0xb3ea('0xd'),_0x496976,_0x56eccd);_0x508703(_0x56eccd);});});} \ No newline at end of file +var _0xdd6e=['error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','License,\x20%s,\x20%s','debug','License,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x336376,_0xe4b28d){var _0x1d2a8e=function(_0x3afe68){while(--_0x3afe68){_0x336376['push'](_0x336376['shift']());}};_0x1d2a8e(++_0xe4b28d);}(_0xdd6e,0x130));var _0xedd6=function(_0x53d051,_0x5515a0){_0x53d051=_0x53d051-0x0;var _0x8f358b=_0xdd6e[_0x53d051];return _0x8f358b;};'use strict';var _=require(_0xedd6('0x0'));var util=require(_0xedd6('0x1'));var moment=require(_0xedd6('0x2'));var BPromise=require(_0xedd6('0x3'));var rs=require(_0xedd6('0x4'));var fs=require('fs');var Redis=require(_0xedd6('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xedd6('0x6'));var logger=require(_0xedd6('0x7'))(_0xedd6('0x8'));var config=require('../../config/environment');var jayson=require(_0xedd6('0x9'));var client=jayson[_0xedd6('0xa')][_0xedd6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2cdc0a,_0x13a465,_0x56da49){return new BPromise(function(_0x3860df,_0x548317){return client[_0xedd6('0xc')](_0x2cdc0a,_0x56da49)['then'](function(_0x432606){logger[_0xedd6('0xd')](_0xedd6('0xe'),_0x13a465,'request\x20sent');logger[_0xedd6('0xf')](_0xedd6('0x10'),_0x13a465,'request\x20sent',JSON[_0xedd6('0x11')](_0x432606));if(_0x432606[_0xedd6('0x12')]){if(_0x432606[_0xedd6('0x12')][_0xedd6('0x13')]===0x1f4){logger['error'](_0xedd6('0xe'),_0x13a465,_0x432606[_0xedd6('0x12')][_0xedd6('0x14')]);return _0x548317(_0x432606['error'][_0xedd6('0x14')]);}logger[_0xedd6('0x12')](_0xedd6('0xe'),_0x13a465,_0x432606[_0xedd6('0x12')][_0xedd6('0x14')]);return _0x3860df(_0x432606[_0xedd6('0x12')][_0xedd6('0x14')]);}else{logger[_0xedd6('0xd')]('License,\x20%s,\x20%s',_0x13a465,'request\x20sent');_0x3860df(_0x432606[_0xedd6('0x15')][_0xedd6('0x14')]);}})[_0xedd6('0x16')](function(_0x38369d){logger[_0xedd6('0x12')](_0xedd6('0xe'),_0x13a465,_0x38369d);_0x548317(_0x38369d);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index e34633d..eb3ccef 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 _0xd9ec=['removeSmtp','removeAgents','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./mailAccount.controller','isAuthenticated','get','/describe','describe','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/in_servers','/:id/out_servers','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','verifySmtp','/:id/users','getAgents','post','addAnswer','create','addImap','addSmtp','/:id/interactions','addInteraction','addApplications','/:id/send','send','addAgents','put','/:id','update','delete','removeAnswers','removeImap'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xd9ec,0xee));var _0xcd9e=function(_0x5314f1,_0x2d4dc6){_0x5314f1=_0x5314f1-0x0;var _0x3d5023=_0xd9ec[_0x5314f1];return _0x3d5023;};'use strict';var multer=require(_0xcd9e('0x0'));var util=require(_0xcd9e('0x1'));var path=require(_0xcd9e('0x2'));var timeout=require(_0xcd9e('0x3'));var express=require(_0xcd9e('0x4'));var router=express['Router']();var fs_extra=require(_0xcd9e('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xcd9e('0x6'));var config=require(_0xcd9e('0x7'));var controller=require(_0xcd9e('0x8'));router['get']('/',auth[_0xcd9e('0x9')](),controller['index']);router[_0xcd9e('0xa')](_0xcd9e('0xb'),auth[_0xcd9e('0x9')](),controller[_0xcd9e('0xc')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xcd9e('0xd')]);router[_0xcd9e('0xa')](_0xcd9e('0xe'),auth[_0xcd9e('0x9')](),controller['getDispositions']);router[_0xcd9e('0xa')](_0xcd9e('0xf'),auth[_0xcd9e('0x9')](),controller[_0xcd9e('0x10')]);router[_0xcd9e('0xa')](_0xcd9e('0x11'),auth[_0xcd9e('0x9')](),controller['getImap']);router[_0xcd9e('0xa')](_0xcd9e('0x12'),auth[_0xcd9e('0x9')](),controller['getSmtp']);router[_0xcd9e('0xa')]('/:id/interactions',auth['isAuthenticated'](),controller[_0xcd9e('0x13')]);router[_0xcd9e('0xa')](_0xcd9e('0x14'),auth[_0xcd9e('0x9')](),controller[_0xcd9e('0x15')]);router[_0xcd9e('0xa')](_0xcd9e('0x16'),auth[_0xcd9e('0x9')](),controller[_0xcd9e('0x17')]);router[_0xcd9e('0xa')]('/:id/verify',auth[_0xcd9e('0x9')](),controller[_0xcd9e('0x18')]);router[_0xcd9e('0xa')](_0xcd9e('0x19'),auth[_0xcd9e('0x9')](),controller[_0xcd9e('0x1a')]);router['post'](_0xcd9e('0xe'),auth[_0xcd9e('0x9')](),controller['addDisposition']);router[_0xcd9e('0x1b')](_0xcd9e('0xf'),auth[_0xcd9e('0x9')](),controller[_0xcd9e('0x1c')]);router['post']('/',auth['isAuthenticated'](),controller[_0xcd9e('0x1d')]);router['post'](_0xcd9e('0x11'),auth[_0xcd9e('0x9')](),controller[_0xcd9e('0x1e')]);router[_0xcd9e('0x1b')](_0xcd9e('0x12'),auth[_0xcd9e('0x9')](),controller[_0xcd9e('0x1f')]);router[_0xcd9e('0x1b')](_0xcd9e('0x20'),auth['isAuthenticated'](),controller[_0xcd9e('0x21')]);router[_0xcd9e('0x1b')](_0xcd9e('0x14'),auth[_0xcd9e('0x9')](),controller[_0xcd9e('0x22')]);router[_0xcd9e('0x1b')](_0xcd9e('0x23'),auth[_0xcd9e('0x9')](),controller[_0xcd9e('0x24')]);router[_0xcd9e('0x1b')]('/:id/users',auth['isAuthenticated'](),controller[_0xcd9e('0x25')]);router[_0xcd9e('0x26')](_0xcd9e('0x27'),auth['isAuthenticated'](),controller[_0xcd9e('0x28')]);router[_0xcd9e('0x29')](_0xcd9e('0xe'),auth['isAuthenticated'](),controller['removeDispositions']);router[_0xcd9e('0x29')]('/:id/canned_answers',auth[_0xcd9e('0x9')](),controller[_0xcd9e('0x2a')]);router['delete'](_0xcd9e('0x11'),auth[_0xcd9e('0x9')](),controller[_0xcd9e('0x2b')]);router[_0xcd9e('0x29')](_0xcd9e('0x12'),auth[_0xcd9e('0x9')](),controller[_0xcd9e('0x2c')]);router[_0xcd9e('0x29')]('/:id',auth[_0xcd9e('0x9')](),controller['destroy']);router['delete'](_0xcd9e('0x19'),auth[_0xcd9e('0x9')](),controller[_0xcd9e('0x2d')]);module[_0xcd9e('0x2e')]=router; \ No newline at end of file +var _0x607b=['put','update','delete','removeImap','removeSmtp','/:id','removeAgents','exports','multer','path','connect-timeout','express','fs-extra','../../components/interaction/service','./mailAccount.controller','get','/describe','isAuthenticated','describe','show','/:id/dispositions','/:id/canned_answers','getImap','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/users','getAgents','addAnswer','post','/:id/in_servers','addImap','addInteraction','addApplications','/:id/send','send'];(function(_0x2007e6,_0x43b204){var _0x31a410=function(_0x3a0186){while(--_0x3a0186){_0x2007e6['push'](_0x2007e6['shift']());}};_0x31a410(++_0x43b204);}(_0x607b,0x127));var _0xb607=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x607b[_0xbca1b1];return _0x4e1686;};'use strict';var multer=require(_0xb607('0x0'));var util=require('util');var path=require(_0xb607('0x1'));var timeout=require(_0xb607('0x2'));var express=require(_0xb607('0x3'));var router=express['Router']();var fs_extra=require(_0xb607('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xb607('0x5'));var config=require('../../config/environment');var controller=require(_0xb607('0x6'));router[_0xb607('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xb607('0x8'),auth[_0xb607('0x9')](),controller[_0xb607('0xa')]);router[_0xb607('0x7')]('/:id',auth[_0xb607('0x9')](),controller[_0xb607('0xb')]);router[_0xb607('0x7')](_0xb607('0xc'),auth[_0xb607('0x9')](),controller['getDispositions']);router[_0xb607('0x7')](_0xb607('0xd'),auth['isAuthenticated'](),controller['getAnswers']);router[_0xb607('0x7')]('/:id/in_servers',auth[_0xb607('0x9')](),controller[_0xb607('0xe')]);router[_0xb607('0x7')](_0xb607('0xf'),auth['isAuthenticated'](),controller[_0xb607('0x10')]);router[_0xb607('0x7')](_0xb607('0x11'),auth[_0xb607('0x9')](),controller[_0xb607('0x12')]);router[_0xb607('0x7')](_0xb607('0x13'),auth[_0xb607('0x9')](),controller[_0xb607('0x14')]);router['get'](_0xb607('0x15'),auth[_0xb607('0x9')](),controller[_0xb607('0x16')]);router[_0xb607('0x7')]('/:id/verify',auth[_0xb607('0x9')](),controller['verifySmtp']);router['get'](_0xb607('0x17'),auth[_0xb607('0x9')](),controller[_0xb607('0x18')]);router['post'](_0xb607('0xc'),auth[_0xb607('0x9')](),controller['addDisposition']);router['post'](_0xb607('0xd'),auth[_0xb607('0x9')](),controller[_0xb607('0x19')]);router[_0xb607('0x1a')]('/',auth[_0xb607('0x9')](),controller['create']);router['post'](_0xb607('0x1b'),auth[_0xb607('0x9')](),controller[_0xb607('0x1c')]);router[_0xb607('0x1a')](_0xb607('0xf'),auth[_0xb607('0x9')](),controller['addSmtp']);router[_0xb607('0x1a')](_0xb607('0x11'),auth['isAuthenticated'](),controller[_0xb607('0x1d')]);router[_0xb607('0x1a')](_0xb607('0x13'),auth[_0xb607('0x9')](),controller[_0xb607('0x1e')]);router[_0xb607('0x1a')](_0xb607('0x1f'),auth[_0xb607('0x9')](),controller[_0xb607('0x20')]);router[_0xb607('0x1a')](_0xb607('0x17'),auth[_0xb607('0x9')](),controller['addAgents']);router[_0xb607('0x21')]('/:id',auth[_0xb607('0x9')](),controller[_0xb607('0x22')]);router[_0xb607('0x23')](_0xb607('0xc'),auth[_0xb607('0x9')](),controller['removeDispositions']);router[_0xb607('0x23')](_0xb607('0xd'),auth[_0xb607('0x9')](),controller['removeAnswers']);router[_0xb607('0x23')]('/:id/in_servers',auth[_0xb607('0x9')](),controller[_0xb607('0x24')]);router[_0xb607('0x23')]('/:id/out_servers',auth[_0xb607('0x9')](),controller[_0xb607('0x25')]);router['delete'](_0xb607('0x26'),auth[_0xb607('0x9')](),controller['destroy']);router[_0xb607('0x23')](_0xb607('0x17'),auth['isAuthenticated'](),controller[_0xb607('0x27')]);module[_0xb607('0x28')]=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index 04ec40a..a0022c0 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 _0xb577=['hotmail','yahoo','outlook365','getDataValue','provider','custom','sequelize','exports','STRING','BOOLEAN','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','ENUM','gmail'];(function(_0x3c1957,_0x39b1b0){var _0x25123a=function(_0x10c11e){while(--_0x10c11e){_0x3c1957['push'](_0x3c1957['shift']());}};_0x25123a(++_0x39b1b0);}(_0xb577,0x16f));var _0x7b57=function(_0x1a3bca,_0x34047c){_0x1a3bca=_0x1a3bca-0x0;var _0x3db2e6=_0xb577[_0x1a3bca];return _0x3db2e6;};'use strict';var Sequelize=require(_0x7b57('0x0'));module[_0x7b57('0x1')]={'description':{'type':Sequelize[_0x7b57('0x2')]},'name':{'type':Sequelize[_0x7b57('0x2')],'allowNull':![]},'service':{'type':Sequelize[_0x7b57('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x7b57('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'key':{'type':Sequelize[_0x7b57('0x2')],'allowNull':![]},'template':{'type':Sequelize[_0x7b57('0x4')]},'markAsUnread':{'type':Sequelize[_0x7b57('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x7b57('0x2')],'allowNull':![],'defaultValue':'Arial,Helvetica,sans-serif'},'fontSize':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x7b57('0x5');}},'notificationSound':{'type':Sequelize[_0x7b57('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x7b57('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x7b57('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x7b57('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x7b57('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x7b57('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x7b57('0x6')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x7b57('0x3')],'defaultValue':![],'comment':_0x7b57('0x7'),'set':function(_0x152fb3){if(!_0x152fb3)this[_0x7b57('0x8')](_0x7b57('0x9'),null);this[_0x7b57('0x8')](_0x7b57('0xa'),_0x152fb3);}},'provider':{'type':Sequelize[_0x7b57('0xb')](_0x7b57('0xc'),_0x7b57('0xd'),_0x7b57('0xe'),_0x7b57('0xf')),'defaultValue':null,'get':function(){if(!this[_0x7b57('0x10')]('provider'))return'custom';return this[_0x7b57('0x10')](_0x7b57('0x11'));},'set':function(_0x31c261){if(_0x31c261===_0x7b57('0x12'))_0x31c261=null;return this[_0x7b57('0x8')](_0x7b57('0x11'),_0x31c261);}}}; \ No newline at end of file +var _0xf07e=['ENUM','yahoo','outlook365','getDataValue','provider','custom','sequelize','exports','STRING','BOOLEAN','Arial,Helvetica,sans-serif','INTEGER','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition'];(function(_0x5dc733,_0x4bc05e){var _0x1e2b80=function(_0x2c8682){while(--_0x2c8682){_0x5dc733['push'](_0x5dc733['shift']());}};_0x1e2b80(++_0x4bc05e);}(_0xf07e,0x1f3));var _0xef07=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf07e[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xef07('0x0'));module[_0xef07('0x1')]={'description':{'type':Sequelize[_0xef07('0x2')]},'name':{'type':Sequelize['STRING'],'allowNull':![]},'service':{'type':Sequelize[_0xef07('0x3')],'defaultValue':![]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0xef07('0x3')],'defaultValue':!![]},'key':{'type':Sequelize[_0xef07('0x2')],'allowNull':![]},'template':{'type':Sequelize['TEXT']},'markAsUnread':{'type':Sequelize[_0xef07('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0xef07('0x2')],'allowNull':![],'defaultValue':_0xef07('0x4')},'fontSize':{'type':Sequelize[_0xef07('0x5')](0x2)['UNSIGNED'],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0xef07('0x6')],'defaultValue':function(){return _0xef07('0x7');}},'notificationSound':{'type':Sequelize[_0xef07('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xef07('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xef07('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xef07('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xef07('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xef07('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xef07('0x5')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xef07('0x3')],'defaultValue':![],'comment':_0xef07('0x8'),'set':function(_0x1af334){if(!_0x1af334)this[_0xef07('0x9')]('mandatoryDispositionPauseId',null);this[_0xef07('0x9')](_0xef07('0xa'),_0x1af334);}},'provider':{'type':Sequelize[_0xef07('0xb')]('gmail','hotmail',_0xef07('0xc'),_0xef07('0xd')),'defaultValue':null,'get':function(){if(!this[_0xef07('0xe')](_0xef07('0xf')))return _0xef07('0x10');return this[_0xef07('0xe')](_0xef07('0xf'));},'set':function(_0x44eaf8){if(_0x44eaf8==='custom')_0x44eaf8=null;return this['setDataValue'](_0xef07('0xf'),_0x44eaf8);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index bf9d91e..59285ba 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 _0xd6bc=['debug','stringify','error','message','result','catch','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','update','destroy','get','UserProfileResource','end','stack','name','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','Unknown\x20email\x20service\x20provider','smtp.gmail.com','smtp.mail.yahoo.com','user','pass','modernAuthentication','CloudProviderId','password','host','port','secure','service','authentication','Imap','Smtp','index','MailServerOut','Pause','mandatoryDispositionPause','map','rawAttributes','model','query','intersection','fields','attributes','length','nolimit','order','sort','where','filters','pick','merge','type','VIRTUAL','options','includeAll','include','MailAccount','rows','keys','find','body','custom','provider','Mail\x20Account\x20not\x20found','MailServerIn','describe','addDisposition','params','Disposition','create','getDispositions','findOne','MailAccountId','filter','findAll','removeDispositions','ids','addAnswer','CannedAnswer','hasOwnProperty','removeAnswers','email','ListId','isNil','active','description','MailAccounts','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','removeImap','getSmtp','addSmtp','setSmtp','addInteraction','MailInteraction','getInteractions','Contact','User','Owner','fullname','internal','Tag','Tags','color','tag','addApplications','sequelize','transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','findAndCountAll','send','getApplications','getMessages','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','List','CmContact','Contacts','CloudProvider','Smtp\x20configuration\x20not\x20found','from','%s\x20<%s>','attachments','join','root','server/files/attachments','basename','getSmtpOptions','SendMail','sendMail','defaults','subject','attach','out','messageId','Interaction','Messages','verifySmtp','VerifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','omit','spread','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','getAgents','bluebird','util','path','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./mailAccount.socket','register','jayson/promise','client','http','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent'];(function(_0xd1855b,_0x359007){var _0x4992a2=function(_0x5e2f7a){while(--_0x5e2f7a){_0xd1855b['push'](_0xd1855b['shift']());}};_0x4992a2(++_0x359007);}(_0xd6bc,0x16e));var _0xcd6b=function(_0xaa0309,_0x1c8008){_0xaa0309=_0xaa0309-0x0;var _0x5de7ce=_0xd6bc[_0xaa0309];return _0x5de7ce;};'use strict';var moment=require('moment');var BPromise=require(_0xcd6b('0x0'));var util=require(_0xcd6b('0x1'));var path=require(_0xcd6b('0x2'));var _=require('lodash');var juice=require('juice');var Redis=require('ioredis');var qs=require(_0xcd6b('0x3'));var logger=require('../../config/logger')(_0xcd6b('0x4'));var config=require(_0xcd6b('0x5'));var db=require(_0xcd6b('0x6'))['db'];config[_0xcd6b('0x7')]=_['defaults'](config[_0xcd6b('0x7')],{'host':_0xcd6b('0x8'),'port':0x18eb});var socket=require(_0xcd6b('0x9'))(new Redis(config[_0xcd6b('0x7')]));require(_0xcd6b('0xa'))[_0xcd6b('0xb')](socket);var jayson=require(_0xcd6b('0xc'));var client=jayson[_0xcd6b('0xd')][_0xcd6b('0xe')]({'port':0x232b});function respondWithRpcPromise(_0xf9bbfa,_0x477ddc,_0x19727c,_0x23c1bc){return new BPromise(function(_0x2c5524,_0x2ac8ea){var _0x2028e8=_0x23c1bc||client;return _0x2028e8[_0xcd6b('0xf')](_0xf9bbfa,_0x19727c)[_0xcd6b('0x10')](function(_0x42038e){logger[_0xcd6b('0x11')](_0xcd6b('0x12'),_0x477ddc,_0xcd6b('0x13'));logger[_0xcd6b('0x14')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x477ddc,_0xcd6b('0x13'),JSON[_0xcd6b('0x15')](_0x42038e));if(_0x42038e[_0xcd6b('0x16')]){if(_0x42038e['error']['code']===0x1f4){logger[_0xcd6b('0x16')](_0xcd6b('0x12'),_0x477ddc,_0x42038e['error']['message']);return _0x2ac8ea(_0x42038e['error'][_0xcd6b('0x17')]);}logger[_0xcd6b('0x16')](_0xcd6b('0x12'),_0x477ddc,_0x42038e[_0xcd6b('0x16')][_0xcd6b('0x17')]);return _0x2c5524(_0x42038e[_0xcd6b('0x16')][_0xcd6b('0x17')]);}else{logger[_0xcd6b('0x11')](_0xcd6b('0x12'),_0x477ddc,_0xcd6b('0x13'));_0x2c5524(_0x42038e[_0xcd6b('0x18')][_0xcd6b('0x17')]);}})[_0xcd6b('0x19')](function(_0x2071a6){logger[_0xcd6b('0x16')](_0xcd6b('0x12'),_0x477ddc,_0x2071a6);_0x2ac8ea(_0x2071a6);});});}function respondWithStatusCode(_0x1fd877,_0x2e8497){_0x2e8497=_0x2e8497||0xcc;return function(_0x117772){if(_0x117772){return _0x1fd877[_0xcd6b('0x1a')](_0x2e8497);}return _0x1fd877[_0xcd6b('0x1b')](_0x2e8497)['end']();};}function respondWithResult(_0x4d9bc7,_0x1a064c){_0x1a064c=_0x1a064c||0xc8;return function(_0x715293){if(_0x715293){return _0x4d9bc7[_0xcd6b('0x1b')](_0x1a064c)[_0xcd6b('0x1c')](_0x715293);}};}function respondWithFilteredResult(_0x1fce15,_0x33427c){return function(_0x4b7a1d){if(_0x4b7a1d){var _0x27d0e1=typeof _0x33427c[_0xcd6b('0x1d')]==='undefined'&&typeof _0x33427c[_0xcd6b('0x1e')]===_0xcd6b('0x1f');var _0x30470a=_0x4b7a1d[_0xcd6b('0x20')];var _0x27acaa=_0x27d0e1?0x0:_0x33427c['offset'];var _0xa2b9c5=_0x27d0e1?_0x4b7a1d[_0xcd6b('0x20')]:_0x33427c['offset']+_0x33427c['limit'];var _0x2ad6d2;if(_0xa2b9c5>=_0x30470a){_0xa2b9c5=_0x30470a;_0x2ad6d2=0xc8;}else{_0x2ad6d2=0xce;}_0x1fce15[_0xcd6b('0x1b')](_0x2ad6d2);return _0x1fce15[_0xcd6b('0x21')](_0xcd6b('0x22'),_0x27acaa+'-'+_0xa2b9c5+'/'+_0x30470a)[_0xcd6b('0x1c')](_0x4b7a1d);}return null;};}function saveUpdates(_0x37d2de){return function(_0x12de51){if(_0x12de51){return _0x12de51[_0xcd6b('0x23')](_0x37d2de)[_0xcd6b('0x10')](function(_0x32e5ca){return _0x32e5ca;});}return null;};}function removeEntity(_0x239319){return function(_0x464ba7){if(_0x464ba7){return _0x464ba7[_0xcd6b('0x24')]()[_0xcd6b('0x10')](function(){var _0x1be13c=_0x464ba7[_0xcd6b('0x25')]({'plain':!![]});var _0x435230='MailAccounts';return db[_0xcd6b('0x26')][_0xcd6b('0x24')]({'where':{'type':_0x435230,'resourceId':_0x1be13c['id']}})['then'](function(){return _0x464ba7;});})[_0xcd6b('0x10')](function(){_0x239319[_0xcd6b('0x1b')](0xcc)[_0xcd6b('0x27')]();});}};}function handleEntityNotFound(_0x16613e){return function(_0x39c8cb){if(!_0x39c8cb){_0x16613e[_0xcd6b('0x1a')](0x194);}return _0x39c8cb;};}function handleError(_0x4fb876,_0x5ab2a7){_0x5ab2a7=_0x5ab2a7||0x1f4;return function(_0x120f1d){logger[_0xcd6b('0x16')](_0x120f1d[_0xcd6b('0x28')]);if(_0x120f1d['name']){delete _0x120f1d[_0xcd6b('0x29')];}_0x4fb876['status'](_0x5ab2a7)['send'](_0x120f1d);};}function getImapHost(_0x2e3361){switch(_0x2e3361){case _0xcd6b('0x2a'):return _0xcd6b('0x2b');case _0xcd6b('0x2c'):return _0xcd6b('0x2d');case _0xcd6b('0x2e'):return _0xcd6b('0x2f');case _0xcd6b('0x30'):return _0xcd6b('0x31');}throw new Error(_0xcd6b('0x32'),_0x2e3361);}function getSmtpHost(_0x4bb2e6){switch(_0x4bb2e6){case _0xcd6b('0x2a'):return _0xcd6b('0x33');case'yahoo':return _0xcd6b('0x34');case'hotmail':return'smtp-mail.outlook.com';case'outlook365':return'smtp.office365.com';}throw new Error('Unknown\x20email\x20service\x20provider',_0x4bb2e6);}function getAuthenticationOptions(_0x2b449b,_0x423938){var _0x231e7a={};var _0x43a51c={};if(_0x2b449b){_0x231e7a[_0xcd6b('0x35')]=_0x43a51c[_0xcd6b('0x35')]=_0x423938['username'];_0x231e7a['password']=_0x43a51c[_0xcd6b('0x36')]=_0x423938['password'];if(_0x423938[_0xcd6b('0x37')]){_0x231e7a[_0xcd6b('0x37')]=_0x43a51c[_0xcd6b('0x37')]=!![];_0x231e7a[_0xcd6b('0x38')]=_0x43a51c[_0xcd6b('0x38')]=_0x423938[_0xcd6b('0x38')];_0x231e7a[_0xcd6b('0x39')]=_0x43a51c[_0xcd6b('0x36')]=null;}else{_0x231e7a[_0xcd6b('0x38')]=_0x43a51c['CloudProviderId']=null;}_0x231e7a[_0xcd6b('0x3a')]=getImapHost(_0x2b449b);_0x231e7a[_0xcd6b('0x3b')]=0x3e1;_0x43a51c['host']=getSmtpHost(_0x2b449b);_0x43a51c[_0xcd6b('0x3b')]=0x24b;_0x43a51c[_0xcd6b('0x3c')]=![];_0x231e7a[_0xcd6b('0x3d')]=_0x43a51c['service']=null;}else{if(_0x423938[_0xcd6b('0x3e')]){_0x231e7a[_0xcd6b('0x35')]=_0x43a51c[_0xcd6b('0x35')]=_0x423938['username'];_0x231e7a[_0xcd6b('0x39')]=_0x43a51c['pass']=_0x423938[_0xcd6b('0x39')];}else{_0x231e7a[_0xcd6b('0x3e')]=_0x43a51c[_0xcd6b('0x3e')]=![];_0x231e7a[_0xcd6b('0x35')]=_0x43a51c[_0xcd6b('0x35')]=null;_0x231e7a[_0xcd6b('0x39')]=_0x43a51c[_0xcd6b('0x36')]=null;}_0x231e7a[_0xcd6b('0x3a')]=_0x423938[_0xcd6b('0x3f')][_0xcd6b('0x3a')];_0x231e7a['port']=_0x423938[_0xcd6b('0x3f')][_0xcd6b('0x3b')];_0x43a51c[_0xcd6b('0x3a')]=_0x423938[_0xcd6b('0x40')][_0xcd6b('0x3a')];_0x43a51c['port']=_0x423938['Smtp'][_0xcd6b('0x3b')];}return{'Imap':_0x231e7a,'Smtp':_0x43a51c};}exports[_0xcd6b('0x41')]=function(_0x5b84fe,_0x48970b){var _0x22fb74={'include':[{'model':db['MailServerIn'],'as':_0xcd6b('0x3f')},{'model':db[_0xcd6b('0x42')],'as':_0xcd6b('0x40')},{'model':db[_0xcd6b('0x43')],'as':_0xcd6b('0x44')}]},_0x52a2e1={},_0x2e3b37={'count':0x0,'rows':[]};var _0xb0f953=_[_0xcd6b('0x45')](db['MailAccount'][_0xcd6b('0x46')],function(_0x593dc3){return{'name':_0x593dc3['fieldName'],'type':_0x593dc3['type']['key']};});_0x52a2e1[_0xcd6b('0x47')]=_[_0xcd6b('0x45')](_0xb0f953,'name');_0x52a2e1[_0xcd6b('0x48')]=_['keys'](_0x5b84fe['query']);_0x52a2e1['filters']=_[_0xcd6b('0x49')](_0x52a2e1['model'],_0x52a2e1[_0xcd6b('0x48')]);_0x22fb74['attributes']=_[_0xcd6b('0x49')](_0x52a2e1[_0xcd6b('0x47')],qs[_0xcd6b('0x4a')](_0x5b84fe[_0xcd6b('0x48')][_0xcd6b('0x4a')]));_0x22fb74[_0xcd6b('0x4b')]=_0x22fb74[_0xcd6b('0x4b')][_0xcd6b('0x4c')]?_0x22fb74[_0xcd6b('0x4b')]:_0x52a2e1[_0xcd6b('0x47')];if(!_0x5b84fe[_0xcd6b('0x48')]['hasOwnProperty'](_0xcd6b('0x4d'))){_0x22fb74[_0xcd6b('0x1e')]=qs['limit'](_0x5b84fe[_0xcd6b('0x48')][_0xcd6b('0x1e')]);_0x22fb74[_0xcd6b('0x1d')]=qs[_0xcd6b('0x1d')](_0x5b84fe[_0xcd6b('0x48')][_0xcd6b('0x1d')]);}_0x22fb74[_0xcd6b('0x4e')]=qs[_0xcd6b('0x4f')](_0x5b84fe['query'][_0xcd6b('0x4f')]);_0x22fb74[_0xcd6b('0x50')]=qs[_0xcd6b('0x51')](_[_0xcd6b('0x52')](_0x5b84fe[_0xcd6b('0x48')],_0x52a2e1[_0xcd6b('0x51')]),_0xb0f953);if(_0x5b84fe[_0xcd6b('0x48')]['filter']){_0x22fb74[_0xcd6b('0x50')]=_[_0xcd6b('0x53')](_0x22fb74['where'],{'$or':_[_0xcd6b('0x45')](_0xb0f953,function(_0xc2b45){if(_0xc2b45[_0xcd6b('0x54')]!==_0xcd6b('0x55')){var _0xa15d54={};_0xa15d54[_0xc2b45[_0xcd6b('0x29')]]={'$like':'%'+_0x5b84fe[_0xcd6b('0x48')]['filter']+'%'};return _0xa15d54;}})});}_0x22fb74=_[_0xcd6b('0x53')]({},_0x22fb74,_0x5b84fe[_0xcd6b('0x56')]);var _0x2d7a12={'where':_0x22fb74[_0xcd6b('0x50')]};return db['MailAccount'][_0xcd6b('0x20')](_0x2d7a12)[_0xcd6b('0x10')](function(_0x56bb2e){_0x2e3b37[_0xcd6b('0x20')]=_0x56bb2e;if(_0x5b84fe[_0xcd6b('0x48')][_0xcd6b('0x57')]){_0x22fb74[_0xcd6b('0x58')]=[{'all':!![]}];}return db[_0xcd6b('0x59')]['findAll'](_0x22fb74);})[_0xcd6b('0x10')](function(_0x1966c9){_0x2e3b37[_0xcd6b('0x5a')]=_0x1966c9;return _0x2e3b37;})['then'](respondWithFilteredResult(_0x48970b,_0x22fb74))[_0xcd6b('0x19')](handleError(_0x48970b,null));};exports['show']=function(_0xcd2d96,_0x5d84d2){var _0x41b62f={'raw':![],'where':{'id':_0xcd2d96['params']['id']},'include':[{'model':db['MailServerIn'],'as':_0xcd6b('0x3f')},{'model':db[_0xcd6b('0x42')],'as':_0xcd6b('0x40')},{'model':db[_0xcd6b('0x43')],'as':_0xcd6b('0x44')}]},_0x1adb88={};_0x1adb88[_0xcd6b('0x47')]=_['keys'](db[_0xcd6b('0x59')][_0xcd6b('0x46')]);_0x1adb88[_0xcd6b('0x48')]=_[_0xcd6b('0x5b')](_0xcd2d96[_0xcd6b('0x48')]);_0x1adb88[_0xcd6b('0x51')]=_['intersection'](_0x1adb88[_0xcd6b('0x47')],_0x1adb88['query']);_0x41b62f[_0xcd6b('0x4b')]=_[_0xcd6b('0x49')](_0x1adb88['model'],qs[_0xcd6b('0x4a')](_0xcd2d96[_0xcd6b('0x48')]['fields']));_0x41b62f[_0xcd6b('0x4b')]=_0x41b62f[_0xcd6b('0x4b')]['length']?_0x41b62f[_0xcd6b('0x4b')]:_0x1adb88['model'];if(_0xcd2d96['query'][_0xcd6b('0x57')]){_0x41b62f['include']=[{'all':!![]}];}_0x41b62f=_[_0xcd6b('0x53')]({},_0x41b62f,_0xcd2d96[_0xcd6b('0x56')]);return db[_0xcd6b('0x59')][_0xcd6b('0x5c')](_0x41b62f)[_0xcd6b('0x10')](handleEntityNotFound(_0x5d84d2,null))[_0xcd6b('0x10')](respondWithResult(_0x5d84d2,null))[_0xcd6b('0x19')](handleError(_0x5d84d2,null));};exports[_0xcd6b('0x23')]=function(_0x5c4a71,_0x146ffa){if(_0x5c4a71[_0xcd6b('0x5d')]['id']){delete _0x5c4a71[_0xcd6b('0x5d')]['id'];}var _0xfea49c=_0x5c4a71['body']['provider']===_0xcd6b('0x5e')?null:_0x5c4a71[_0xcd6b('0x5d')][_0xcd6b('0x5f')];var _0x552ff4=_0x5c4a71[_0xcd6b('0x5d')][_0xcd6b('0x3f')]||{};var _0x274367=_0x5c4a71['body'][_0xcd6b('0x40')]||{};if(_0xfea49c){_0x552ff4[_0xcd6b('0x3a')]=getImapHost(_0xfea49c);_0x552ff4[_0xcd6b('0x3b')]=0x3e1;_0x274367[_0xcd6b('0x3a')]=getSmtpHost(_0xfea49c);_0x274367['port']=0x24b;_0x274367[_0xcd6b('0x3c')]=![];}if(_0x274367[_0xcd6b('0x37')]){_0x274367[_0xcd6b('0x3c')]=![];}else{_0x274367['CloudProviderId']=null;}if(!_0x552ff4[_0xcd6b('0x37')])_0x552ff4[_0xcd6b('0x38')]=null;_0x5c4a71[_0xcd6b('0x5d')][_0xcd6b('0x3f')]=_0x552ff4;_0x5c4a71[_0xcd6b('0x5d')]['Smtp']=_0x274367;return db['MailAccount'][_0xcd6b('0x5c')]({'where':{'id':_0x5c4a71['params']['id']},'include':[{'model':db['MailServerIn'],'as':_0xcd6b('0x3f')},{'model':db[_0xcd6b('0x42')],'as':_0xcd6b('0x40')},{'model':db[_0xcd6b('0x43')],'as':'mandatoryDispositionPause'}]})[_0xcd6b('0x10')](handleEntityNotFound(_0x146ffa,null))[_0xcd6b('0x10')](function(_0x5a8187){if(!_0x5a8187)throw new Error(_0xcd6b('0x60'));if(_0x5a8187[_0xcd6b('0x3d')])delete _0x5c4a71[_0xcd6b('0x5d')]['Imap'];return _0x5a8187;})['then'](saveUpdates(_0x5c4a71[_0xcd6b('0x5d')],null))[_0xcd6b('0x10')](function(_0x27c046){if(!_0x5c4a71[_0xcd6b('0x5d')][_0xcd6b('0x3f')])return _0x27c046;return db[_0xcd6b('0x61')]['update'](_0x5c4a71[_0xcd6b('0x5d')][_0xcd6b('0x3f')],{'where':{'MailAccountId':_0x27c046['id']}})[_0xcd6b('0x10')](function(){return _0x27c046;});})['then'](function(_0x46bd33){if(!_0x5c4a71[_0xcd6b('0x5d')][_0xcd6b('0x40')])return _0x46bd33;return db[_0xcd6b('0x42')][_0xcd6b('0x23')](_0x5c4a71[_0xcd6b('0x5d')][_0xcd6b('0x40')],{'where':{'MailAccountId':_0x46bd33['id']}})[_0xcd6b('0x10')](function(){return _0x46bd33;});})['then'](respondWithResult(_0x146ffa,null))[_0xcd6b('0x19')](handleError(_0x146ffa,null));};exports[_0xcd6b('0x62')]=function(_0x202ec4,_0x4d3dd7){return db[_0xcd6b('0x59')][_0xcd6b('0x62')]()['then'](respondWithResult(_0x4d3dd7,null))['catch'](handleError(_0x4d3dd7,null));};exports[_0xcd6b('0x63')]=function(_0xbf5f4c,_0x2e9276){if(_0xbf5f4c['body']['id']){delete _0xbf5f4c[_0xcd6b('0x5d')]['id'];}return db[_0xcd6b('0x59')][_0xcd6b('0x5c')]({'where':{'id':_0xbf5f4c[_0xcd6b('0x64')]['id']}})[_0xcd6b('0x10')](handleEntityNotFound(_0x2e9276,null))[_0xcd6b('0x10')](function(_0x120f7f){if(_0x120f7f){_0xbf5f4c['body']['MailAccountId']=_0x120f7f['id'];return db[_0xcd6b('0x65')][_0xcd6b('0x66')](_0xbf5f4c[_0xcd6b('0x5d')]);}})[_0xcd6b('0x10')](respondWithResult(_0x2e9276,null))[_0xcd6b('0x19')](handleError(_0x2e9276,null));};exports[_0xcd6b('0x67')]=function(_0x4844e6,_0x150cc9){var _0x3453f8={'raw':![],'where':{}};var _0x2731e5={};var _0x531b35={'count':0x0,'rows':[]};return db[_0xcd6b('0x59')][_0xcd6b('0x68')]({'where':{'id':_0x4844e6[_0xcd6b('0x64')]['id']}})[_0xcd6b('0x10')](handleEntityNotFound(_0x150cc9,null))[_0xcd6b('0x10')](function(_0x1b0430){if(_0x1b0430){_0x2731e5[_0xcd6b('0x47')]=_[_0xcd6b('0x5b')](db[_0xcd6b('0x65')]['rawAttributes']);_0x2731e5[_0xcd6b('0x48')]=_['keys'](_0x4844e6[_0xcd6b('0x48')]);_0x2731e5[_0xcd6b('0x51')]=_['intersection'](_0x2731e5[_0xcd6b('0x47')],_0x2731e5[_0xcd6b('0x48')]);_0x3453f8['attributes']=_['intersection'](_0x2731e5[_0xcd6b('0x47')],qs[_0xcd6b('0x4a')](_0x4844e6['query'][_0xcd6b('0x4a')]));_0x3453f8[_0xcd6b('0x4b')]=_0x3453f8[_0xcd6b('0x4b')]['length']?_0x3453f8[_0xcd6b('0x4b')]:_0x2731e5[_0xcd6b('0x47')];if(!_0x4844e6[_0xcd6b('0x48')]['hasOwnProperty']('nolimit')){_0x3453f8[_0xcd6b('0x1e')]=qs[_0xcd6b('0x1e')](_0x4844e6[_0xcd6b('0x48')]['limit']);_0x3453f8[_0xcd6b('0x1d')]=qs[_0xcd6b('0x1d')](_0x4844e6[_0xcd6b('0x48')][_0xcd6b('0x1d')]);}_0x3453f8['order']=qs[_0xcd6b('0x4f')](_0x4844e6[_0xcd6b('0x48')][_0xcd6b('0x4f')]);_0x3453f8['where']=qs['filters'](_[_0xcd6b('0x52')](_0x4844e6[_0xcd6b('0x48')],_0x2731e5[_0xcd6b('0x51')]));_0x3453f8[_0xcd6b('0x50')][_0xcd6b('0x69')]=_0x1b0430['id'];if(_0x4844e6[_0xcd6b('0x48')][_0xcd6b('0x6a')]){_0x3453f8[_0xcd6b('0x50')]=_[_0xcd6b('0x53')](_0x3453f8['where'],{'$or':_[_0xcd6b('0x45')](_0x3453f8[_0xcd6b('0x4b')],function(_0x50d4e5){var _0x55d81c={};_0x55d81c[_0x50d4e5]={'$like':'%'+_0x4844e6[_0xcd6b('0x48')][_0xcd6b('0x6a')]+'%'};return _0x55d81c;})});}_0x3453f8=_[_0xcd6b('0x53')]({},_0x3453f8,_0x4844e6[_0xcd6b('0x56')]);return db[_0xcd6b('0x65')][_0xcd6b('0x20')]({'where':_0x3453f8[_0xcd6b('0x50')]})[_0xcd6b('0x10')](function(_0x189c4a){_0x531b35[_0xcd6b('0x20')]=_0x189c4a;if(_0x4844e6[_0xcd6b('0x48')][_0xcd6b('0x57')]){_0x3453f8[_0xcd6b('0x58')]=[{'all':!![]}];}return db[_0xcd6b('0x65')][_0xcd6b('0x6b')](_0x3453f8);})['then'](function(_0x208894){_0x531b35[_0xcd6b('0x5a')]=_0x208894;return _0x531b35;});}})[_0xcd6b('0x10')](respondWithFilteredResult(_0x150cc9,_0x3453f8))[_0xcd6b('0x19')](handleError(_0x150cc9,null));};exports[_0xcd6b('0x6c')]=function(_0x576a03,_0x1b6326){return db[_0xcd6b('0x59')]['find']({'where':{'id':_0x576a03[_0xcd6b('0x64')]['id']}})[_0xcd6b('0x10')](handleEntityNotFound(_0x1b6326,null))[_0xcd6b('0x10')](function(_0x112d5e){if(_0x112d5e){return _0x112d5e[_0xcd6b('0x6c')](_0x576a03[_0xcd6b('0x48')][_0xcd6b('0x6d')]);}})['then'](respondWithStatusCode(_0x1b6326,null))[_0xcd6b('0x19')](handleError(_0x1b6326,null));};exports[_0xcd6b('0x6e')]=function(_0x270555,_0x22aea5){if(_0x270555[_0xcd6b('0x5d')]['id']){delete _0x270555[_0xcd6b('0x5d')]['id'];}return db[_0xcd6b('0x59')][_0xcd6b('0x5c')]({'where':{'id':_0x270555[_0xcd6b('0x64')]['id']}})[_0xcd6b('0x10')](handleEntityNotFound(_0x22aea5,null))['then'](function(_0x2793fa){if(_0x2793fa){_0x270555['body'][_0xcd6b('0x69')]=_0x2793fa['id'];return db[_0xcd6b('0x6f')][_0xcd6b('0x66')](_0x270555[_0xcd6b('0x5d')]);}})['then'](respondWithResult(_0x22aea5,null))[_0xcd6b('0x19')](handleError(_0x22aea5,null));};exports['getAnswers']=function(_0x20471e,_0x5d22a1){var _0x7b0807={'raw':![],'where':{}};var _0xfae57c={};var _0x2f1336={'count':0x0,'rows':[]};return db[_0xcd6b('0x59')]['findOne']({'where':{'id':_0x20471e[_0xcd6b('0x64')]['id']}})['then'](handleEntityNotFound(_0x5d22a1,null))['then'](function(_0x216b0e){if(_0x216b0e){_0xfae57c[_0xcd6b('0x47')]=_[_0xcd6b('0x5b')](db[_0xcd6b('0x6f')][_0xcd6b('0x46')]);_0xfae57c[_0xcd6b('0x48')]=_['keys'](_0x20471e[_0xcd6b('0x48')]);_0xfae57c[_0xcd6b('0x51')]=_[_0xcd6b('0x49')](_0xfae57c['model'],_0xfae57c[_0xcd6b('0x48')]);_0x7b0807[_0xcd6b('0x4b')]=_[_0xcd6b('0x49')](_0xfae57c[_0xcd6b('0x47')],qs[_0xcd6b('0x4a')](_0x20471e[_0xcd6b('0x48')][_0xcd6b('0x4a')]));_0x7b0807[_0xcd6b('0x4b')]=_0x7b0807[_0xcd6b('0x4b')][_0xcd6b('0x4c')]?_0x7b0807[_0xcd6b('0x4b')]:_0xfae57c['model'];if(!_0x20471e[_0xcd6b('0x48')][_0xcd6b('0x70')](_0xcd6b('0x4d'))){_0x7b0807[_0xcd6b('0x1e')]=qs[_0xcd6b('0x1e')](_0x20471e['query']['limit']);_0x7b0807[_0xcd6b('0x1d')]=qs[_0xcd6b('0x1d')](_0x20471e[_0xcd6b('0x48')][_0xcd6b('0x1d')]);}_0x7b0807[_0xcd6b('0x4e')]=qs[_0xcd6b('0x4f')](_0x20471e[_0xcd6b('0x48')][_0xcd6b('0x4f')]);_0x7b0807[_0xcd6b('0x50')]=qs[_0xcd6b('0x51')](_[_0xcd6b('0x52')](_0x20471e[_0xcd6b('0x48')],_0xfae57c[_0xcd6b('0x51')]));_0x7b0807[_0xcd6b('0x50')]['MailAccountId']=_0x216b0e['id'];if(_0x20471e[_0xcd6b('0x48')]['filter']){_0x7b0807[_0xcd6b('0x50')]=_[_0xcd6b('0x53')](_0x7b0807[_0xcd6b('0x50')],{'$or':_[_0xcd6b('0x45')](_0x7b0807[_0xcd6b('0x4b')],function(_0x4003a1){var _0xfd4a0d={};_0xfd4a0d[_0x4003a1]={'$like':'%'+_0x20471e[_0xcd6b('0x48')][_0xcd6b('0x6a')]+'%'};return _0xfd4a0d;})});}_0x7b0807=_['merge']({},_0x7b0807,_0x20471e[_0xcd6b('0x56')]);return db[_0xcd6b('0x6f')][_0xcd6b('0x20')]({'where':_0x7b0807[_0xcd6b('0x50')]})[_0xcd6b('0x10')](function(_0x4b45cc){_0x2f1336[_0xcd6b('0x20')]=_0x4b45cc;if(_0x20471e[_0xcd6b('0x48')][_0xcd6b('0x57')]){_0x7b0807[_0xcd6b('0x58')]=[{'all':!![]}];}return db[_0xcd6b('0x6f')]['findAll'](_0x7b0807);})['then'](function(_0xe007ee){_0x2f1336[_0xcd6b('0x5a')]=_0xe007ee;return _0x2f1336;});}})[_0xcd6b('0x10')](respondWithFilteredResult(_0x5d22a1,_0x7b0807))[_0xcd6b('0x19')](handleError(_0x5d22a1,null));};exports[_0xcd6b('0x71')]=function(_0xb795fc,_0x3539d3){return db[_0xcd6b('0x59')][_0xcd6b('0x5c')]({'where':{'id':_0xb795fc[_0xcd6b('0x64')]['id']}})[_0xcd6b('0x10')](handleEntityNotFound(_0x3539d3,null))[_0xcd6b('0x10')](function(_0x515903){if(_0x515903){return _0x515903[_0xcd6b('0x71')](_0xb795fc[_0xcd6b('0x48')][_0xcd6b('0x6d')]);}})[_0xcd6b('0x10')](respondWithStatusCode(_0x3539d3,null))[_0xcd6b('0x19')](handleError(_0x3539d3,null));};exports[_0xcd6b('0x66')]=function(_0x4515eb,_0x31b177){var _0x226be6={'name':_0x4515eb[_0xcd6b('0x5d')][_0xcd6b('0x29')],'key':_0x4515eb[_0xcd6b('0x5d')]['key'],'provider':_0x4515eb[_0xcd6b('0x5d')][_0xcd6b('0x5f')]===_0xcd6b('0x5e')?null:_0x4515eb[_0xcd6b('0x5d')][_0xcd6b('0x5f')],'email':_0x4515eb['body'][_0xcd6b('0x72')],'ListId':_0x4515eb[_0xcd6b('0x5d')][_0xcd6b('0x73')],'active':!_[_0xcd6b('0x74')](_0x4515eb[_0xcd6b('0x5d')][_0xcd6b('0x75')])?_0x4515eb[_0xcd6b('0x5d')][_0xcd6b('0x75')]:!![],'description':_0x4515eb[_0xcd6b('0x5d')][_0xcd6b('0x76')]||null};var _0x173e95=getAuthenticationOptions(_0x226be6['provider'],_0x4515eb[_0xcd6b('0x5d')]);_0x226be6[_0xcd6b('0x3f')]=_0x173e95['Imap'];_0x226be6[_0xcd6b('0x40')]=_0x173e95[_0xcd6b('0x40')];return db[_0xcd6b('0x59')][_0xcd6b('0x66')](_0x226be6,{'include':[{'model':db[_0xcd6b('0x42')],'as':_0xcd6b('0x40')},{'model':db[_0xcd6b('0x61')],'as':_0xcd6b('0x3f')}]})[_0xcd6b('0x10')](function(_0x30f62d){var _0x54483f=_0x4515eb[_0xcd6b('0x35')][_0xcd6b('0x25')]({'plain':!![]});if(!_0x54483f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x54483f['role']==='user'){var _0x521ca7=_0x30f62d['get']({'plain':!![]});return db['UserProfileSection'][_0xcd6b('0x5c')]({'where':{'name':_0xcd6b('0x77'),'userProfileId':_0x54483f[_0xcd6b('0x78')]},'raw':!![]})[_0xcd6b('0x10')](function(_0x559db8){if(_0x559db8&&_0x559db8[_0xcd6b('0x79')]===0x0){return db['UserProfileResource'][_0xcd6b('0x66')]({'name':_0x521ca7[_0xcd6b('0x29')],'resourceId':_0x521ca7['id'],'type':_0x559db8[_0xcd6b('0x29')],'sectionId':_0x559db8['id']},{})[_0xcd6b('0x10')](function(){return _0x30f62d;});}else{return _0x30f62d;}})[_0xcd6b('0x19')](function(_0x49f6e3){logger[_0xcd6b('0x16')](_0xcd6b('0x7a'),_0x49f6e3);throw _0x49f6e3;});}return _0x30f62d;})[_0xcd6b('0x10')](respondWithResult(_0x31b177,0xc9))['catch'](handleError(_0x31b177,null));};exports[_0xcd6b('0x7b')]=function(_0x2c5e3a,_0x255acc){return db[_0xcd6b('0x59')][_0xcd6b('0x68')]({'where':{'id':_0x2c5e3a[_0xcd6b('0x64')]['id']}})[_0xcd6b('0x10')](handleEntityNotFound(_0x255acc,null))['then'](function(_0x3e9f31){if(_0x3e9f31){return _0x3e9f31[_0xcd6b('0x7b')]();}return null;})[_0xcd6b('0x10')](respondWithResult(_0x255acc,null))[_0xcd6b('0x19')](handleError(_0x255acc,null));};exports['addImap']=function(_0x5e77b4,_0x47c4df){if(_0x5e77b4[_0xcd6b('0x5d')]['id']){delete _0x5e77b4['body']['id'];}return db[_0xcd6b('0x59')][_0xcd6b('0x5c')]({'where':{'id':_0x5e77b4['params']['id']}})[_0xcd6b('0x10')](handleEntityNotFound(_0x47c4df,null))[_0xcd6b('0x10')](function(_0x1e9573){if(_0x1e9573){_0x5e77b4[_0xcd6b('0x5d')][_0xcd6b('0x69')]=_0x1e9573['id'];return db[_0xcd6b('0x61')][_0xcd6b('0x66')](_0x5e77b4['body']);}})[_0xcd6b('0x10')](respondWithResult(_0x47c4df,null))[_0xcd6b('0x19')](handleError(_0x47c4df,null));};exports[_0xcd6b('0x7c')]=function(_0x239893,_0xc20ccd){return db[_0xcd6b('0x59')][_0xcd6b('0x68')]({'where':{'id':_0x239893[_0xcd6b('0x64')]['id']}})['then'](handleEntityNotFound(_0xc20ccd,null))[_0xcd6b('0x10')](function(_0x26681a){if(_0x26681a){return _0x26681a['setImap'](null);}return null;})[_0xcd6b('0x10')](respondWithStatusCode(_0xc20ccd,null))['catch'](handleError(_0xc20ccd,null));};exports[_0xcd6b('0x7d')]=function(_0x333240,_0x25087f){return db[_0xcd6b('0x59')][_0xcd6b('0x68')]({'where':{'id':_0x333240[_0xcd6b('0x64')]['id']}})[_0xcd6b('0x10')](handleEntityNotFound(_0x25087f,null))[_0xcd6b('0x10')](function(_0x3336f8){if(_0x3336f8){return _0x3336f8[_0xcd6b('0x7d')]();}return null;})[_0xcd6b('0x10')](respondWithResult(_0x25087f,null))[_0xcd6b('0x19')](handleError(_0x25087f,null));};exports[_0xcd6b('0x7e')]=function(_0x2ebbc2,_0x102124){if(_0x2ebbc2[_0xcd6b('0x5d')]['id']){delete _0x2ebbc2[_0xcd6b('0x5d')]['id'];}return db[_0xcd6b('0x59')][_0xcd6b('0x5c')]({'where':{'id':_0x2ebbc2[_0xcd6b('0x64')]['id']}})['then'](handleEntityNotFound(_0x102124,null))[_0xcd6b('0x10')](function(_0x4da725){if(_0x4da725){_0x2ebbc2[_0xcd6b('0x5d')][_0xcd6b('0x69')]=_0x4da725['id'];return db[_0xcd6b('0x42')][_0xcd6b('0x66')](_0x2ebbc2[_0xcd6b('0x5d')]);}})['then'](respondWithResult(_0x102124,null))['catch'](handleError(_0x102124,null));};exports['removeSmtp']=function(_0x565f7b,_0x3be944){return db['MailAccount'][_0xcd6b('0x68')]({'where':{'id':_0x565f7b['params']['id']}})[_0xcd6b('0x10')](handleEntityNotFound(_0x3be944,null))['then'](function(_0x18a429){if(_0x18a429){return _0x18a429[_0xcd6b('0x7f')](null);}return null;})[_0xcd6b('0x10')](respondWithStatusCode(_0x3be944,null))[_0xcd6b('0x19')](handleError(_0x3be944,null));};exports[_0xcd6b('0x80')]=function(_0x94c5ac,_0x406fe0){return db[_0xcd6b('0x81')]['find']({'where':{'id':_0x94c5ac['params']['id']}})[_0xcd6b('0x10')](handleEntityNotFound(_0x406fe0,null))[_0xcd6b('0x10')](function(_0xbdf3e2){if(_0xbdf3e2){return _0xbdf3e2[_0xcd6b('0x80')](_0x94c5ac['body'][_0xcd6b('0x6d')],_['omit'](_0x94c5ac[_0xcd6b('0x5d')],[_0xcd6b('0x6d'),'id'])||{});}})[_0xcd6b('0x10')](respondWithResult(_0x406fe0,null))['catch'](handleError(_0x406fe0,null));};exports[_0xcd6b('0x82')]=function(_0x24ed49,_0x488068){var _0x41ae7b={'raw':![],'where':{}};var _0x5b7a4a={};var _0xbbc6ff={'count':0x0,'rows':[]};return db[_0xcd6b('0x59')]['findOne']({'where':{'id':_0x24ed49['params']['id']}})[_0xcd6b('0x10')](handleEntityNotFound(_0x488068,null))[_0xcd6b('0x10')](function(_0x16f8e7){if(_0x16f8e7){_0x5b7a4a[_0xcd6b('0x47')]=_[_0xcd6b('0x5b')](db[_0xcd6b('0x81')][_0xcd6b('0x46')]);_0x5b7a4a[_0xcd6b('0x48')]=_['keys'](_0x24ed49['query']);_0x5b7a4a[_0xcd6b('0x51')]=_['intersection'](_0x5b7a4a['model'],_0x5b7a4a[_0xcd6b('0x48')]);_0x41ae7b[_0xcd6b('0x4b')]=_['intersection'](_0x5b7a4a[_0xcd6b('0x47')],qs[_0xcd6b('0x4a')](_0x24ed49[_0xcd6b('0x48')][_0xcd6b('0x4a')]));_0x41ae7b['attributes']=_0x41ae7b[_0xcd6b('0x4b')][_0xcd6b('0x4c')]?_0x41ae7b[_0xcd6b('0x4b')]:_0x5b7a4a[_0xcd6b('0x47')];if(!_0x24ed49[_0xcd6b('0x48')][_0xcd6b('0x70')](_0xcd6b('0x4d'))){_0x41ae7b[_0xcd6b('0x1e')]=qs[_0xcd6b('0x1e')](_0x24ed49[_0xcd6b('0x48')][_0xcd6b('0x1e')]);_0x41ae7b[_0xcd6b('0x1d')]=qs[_0xcd6b('0x1d')](_0x24ed49[_0xcd6b('0x48')][_0xcd6b('0x1d')]);}_0x41ae7b[_0xcd6b('0x4e')]=qs[_0xcd6b('0x4f')](_0x24ed49[_0xcd6b('0x48')][_0xcd6b('0x4f')]);_0x41ae7b['where']=qs[_0xcd6b('0x51')](_[_0xcd6b('0x52')](_0x24ed49[_0xcd6b('0x48')],_0x5b7a4a[_0xcd6b('0x51')]));_0x41ae7b[_0xcd6b('0x50')][_0xcd6b('0x69')]=_0x16f8e7['id'];if(_0x24ed49[_0xcd6b('0x48')][_0xcd6b('0x6a')]){_0x41ae7b[_0xcd6b('0x50')]=_[_0xcd6b('0x53')](_0x41ae7b[_0xcd6b('0x50')],{'$or':_[_0xcd6b('0x45')](_0x41ae7b[_0xcd6b('0x4b')],function(_0x5e778b){var _0x1c65c9={};_0x1c65c9[_0x5e778b]={'$like':'%'+_0x24ed49['query'][_0xcd6b('0x6a')]+'%'};return _0x1c65c9;})});}_0x41ae7b=_[_0xcd6b('0x53')]({},_0x41ae7b,_0x24ed49['options']);return db[_0xcd6b('0x81')]['count']({'where':_0x41ae7b[_0xcd6b('0x50')]})[_0xcd6b('0x10')](function(_0x1fdd7d){_0xbbc6ff[_0xcd6b('0x20')]=_0x1fdd7d;if(_0x24ed49[_0xcd6b('0x48')][_0xcd6b('0x57')]){_0x41ae7b[_0xcd6b('0x58')]=[{'model':db['CmContact'],'as':_0xcd6b('0x83'),'required':![]},{'model':db[_0xcd6b('0x84')],'as':_0xcd6b('0x85'),'attributes':['name',_0xcd6b('0x86'),_0xcd6b('0x87')],'required':![]},{'model':db[_0xcd6b('0x88')],'as':_0xcd6b('0x89'),'attributes':['id','name',_0xcd6b('0x8a')],'where':_0x24ed49[_0xcd6b('0x48')]['tag']?{'id':_0x24ed49[_0xcd6b('0x48')][_0xcd6b('0x8b')]}:undefined,'required':_0x24ed49[_0xcd6b('0x48')][_0xcd6b('0x8b')]?!![]:![]}];}return db[_0xcd6b('0x81')]['findAll'](_0x41ae7b);})['then'](function(_0x4036bb){_0xbbc6ff[_0xcd6b('0x5a')]=_0x4036bb;return _0xbbc6ff;});}})[_0xcd6b('0x10')](respondWithFilteredResult(_0x488068,_0x41ae7b))[_0xcd6b('0x19')](handleError(_0x488068,null));};exports[_0xcd6b('0x8c')]=function addApplications(_0x261610,_0x3b690e){var _0x48a0e5=_0x261610[_0xcd6b('0x64')]['id'];var _0x4f498d=_0x261610[_0xcd6b('0x5d')];var _0x1a03c3=0xc8;var _0x1635ee=null;return db[_0xcd6b('0x8d')][_0xcd6b('0x8e')]({'isolationLevel':db[_0xcd6b('0x8d')]['Transaction'][_0xcd6b('0x8f')][_0xcd6b('0x90')]},function(_0x29185d){return db[_0xcd6b('0x59')][_0xcd6b('0x68')]({'where':{'id':_0x48a0e5},'transaction':_0x29185d})[_0xcd6b('0x10')](function(_0x1600fd){if(_0x1600fd){return db['MailApplication'][_0xcd6b('0x24')]({'where':{'MailAccountId':_0x48a0e5},'transaction':_0x29185d})[_0xcd6b('0x10')](function(){var _0x5631c2=_['map'](_0x4f498d,function(_0x4e2bb7){_0x4e2bb7['MailAccountId']=_0x48a0e5;return _0x4e2bb7;});return db['MailApplication']['bulkCreate'](_0x5631c2,{'transaction':_0x29185d});});}else{_0x1a03c3=0x194;_0x1635ee=[];}});})[_0xcd6b('0x10')](function(){if(_0x1a03c3!==0x194){return db[_0xcd6b('0x91')][_0xcd6b('0x92')]({'where':{'MailAccountId':_0x48a0e5},'order':'priority'})['then'](function(_0x2311f2){_0x1635ee=_0x2311f2;});}})['catch'](function(_0x337e7c){_0x1a03c3=0x1f4;logger[_0xcd6b('0x16')](_0x337e7c['stack']);if(_0x337e7c['name']){delete _0x337e7c[_0xcd6b('0x29')];}_0x1635ee=_0x337e7c;})['finally'](function(){if(_0x1635ee===null){_0x3b690e[_0xcd6b('0x1a')](_0x1a03c3);}else{if(_0x1a03c3===0x1f4){_0x3b690e['status'](_0x1a03c3)[_0xcd6b('0x93')](_0x1635ee);}else{_0x3b690e[_0xcd6b('0x1b')](_0x1a03c3)[_0xcd6b('0x1c')](_0x1635ee);}}});};exports[_0xcd6b('0x94')]=function(_0x20ff99,_0x24f400){var _0x191e72={};var _0x235f84={};var _0x230a8c;var _0x23d506;return db[_0xcd6b('0x59')][_0xcd6b('0x68')]({'where':{'id':_0x20ff99[_0xcd6b('0x64')]['id']}})[_0xcd6b('0x10')](handleEntityNotFound(_0x24f400,null))[_0xcd6b('0x10')](function(_0x44d3b9){if(_0x44d3b9){_0x230a8c=_0x44d3b9;_0x235f84[_0xcd6b('0x47')]=_['keys'](db[_0xcd6b('0x91')]['rawAttributes']);_0x235f84[_0xcd6b('0x48')]=_[_0xcd6b('0x5b')](_0x20ff99[_0xcd6b('0x48')]);_0x235f84[_0xcd6b('0x51')]=_[_0xcd6b('0x49')](_0x235f84[_0xcd6b('0x47')],_0x235f84[_0xcd6b('0x48')]);_0x191e72[_0xcd6b('0x4b')]=_['intersection'](_0x235f84[_0xcd6b('0x47')],qs['fields'](_0x20ff99['query'][_0xcd6b('0x4a')]));_0x191e72['attributes']=_0x191e72[_0xcd6b('0x4b')]['length']?_0x191e72[_0xcd6b('0x4b')]:_0x235f84[_0xcd6b('0x47')];_0x191e72[_0xcd6b('0x4e')]=qs[_0xcd6b('0x4f')](_0x20ff99[_0xcd6b('0x48')][_0xcd6b('0x4f')]);_0x191e72[_0xcd6b('0x50')]=qs['filters'](_['pick'](_0x20ff99[_0xcd6b('0x48')],_0x235f84[_0xcd6b('0x51')]));if(_0x20ff99['query']['filter']){_0x191e72['where']=_[_0xcd6b('0x53')](_0x191e72['where'],{'$or':_[_0xcd6b('0x45')](_0x191e72['attributes'],function(_0x376c09){var _0x4d0ae5={};_0x4d0ae5[_0x376c09]={'$like':'%'+_0x20ff99[_0xcd6b('0x48')][_0xcd6b('0x6a')]+'%'};return _0x4d0ae5;})});}_0x191e72=_['merge']({},_0x191e72,_0x20ff99['options']);return _0x230a8c[_0xcd6b('0x94')](_0x191e72);}})[_0xcd6b('0x10')](function(_0x434994){if(_0x434994){_0x23d506=_0x434994['length'];if(!_0x20ff99[_0xcd6b('0x48')][_0xcd6b('0x70')](_0xcd6b('0x4d'))){_0x191e72[_0xcd6b('0x1e')]=qs['limit'](_0x20ff99[_0xcd6b('0x48')][_0xcd6b('0x1e')]);_0x191e72[_0xcd6b('0x1d')]=qs[_0xcd6b('0x1d')](_0x20ff99[_0xcd6b('0x48')][_0xcd6b('0x1d')]);}return _0x230a8c['getApplications'](_0x191e72);}})[_0xcd6b('0x10')](function(_0x860a43){if(_0x860a43){return _0x860a43?{'count':_0x23d506,'rows':_0x860a43}:null;}})['then'](respondWithResult(_0x24f400,null))[_0xcd6b('0x19')](handleError(_0x24f400,null));};exports[_0xcd6b('0x95')]=function(_0x575b23,_0xfafe41){var _0x1e9682={'raw':!![],'where':{}};var _0xcfabd8={};var _0x400ee9={'count':0x0,'rows':[]};return db['MailAccount']['findOne']({'where':{'id':_0x575b23[_0xcd6b('0x64')]['id']}})[_0xcd6b('0x10')](handleEntityNotFound(_0xfafe41,null))[_0xcd6b('0x10')](function(_0x276a8b){if(_0x276a8b){_0xcfabd8[_0xcd6b('0x47')]=_[_0xcd6b('0x5b')](db[_0xcd6b('0x96')][_0xcd6b('0x46')]);_0xcfabd8[_0xcd6b('0x48')]=_[_0xcd6b('0x5b')](_0x575b23[_0xcd6b('0x48')]);_0xcfabd8[_0xcd6b('0x51')]=_[_0xcd6b('0x49')](_0xcfabd8[_0xcd6b('0x47')],_0xcfabd8['query']);_0x1e9682['attributes']=_[_0xcd6b('0x49')](_0xcfabd8[_0xcd6b('0x47')],qs['fields'](_0x575b23[_0xcd6b('0x48')][_0xcd6b('0x4a')]));_0x1e9682['attributes']=_0x1e9682[_0xcd6b('0x4b')][_0xcd6b('0x4c')]?_0x1e9682[_0xcd6b('0x4b')]:_0xcfabd8[_0xcd6b('0x47')];if(!_0x575b23[_0xcd6b('0x48')][_0xcd6b('0x70')](_0xcd6b('0x4d'))){_0x1e9682[_0xcd6b('0x1e')]=qs[_0xcd6b('0x1e')](_0x575b23[_0xcd6b('0x48')]['limit']);_0x1e9682[_0xcd6b('0x1d')]=qs[_0xcd6b('0x1d')](_0x575b23['query'][_0xcd6b('0x1d')]);}_0x1e9682[_0xcd6b('0x4e')]=qs[_0xcd6b('0x4f')](_0x575b23['query'][_0xcd6b('0x4f')]);_0x1e9682[_0xcd6b('0x50')]=qs[_0xcd6b('0x51')](_[_0xcd6b('0x52')](_0x575b23['query'],_0xcfabd8[_0xcd6b('0x51')]));_0x1e9682[_0xcd6b('0x50')][_0xcd6b('0x69')]=_0x276a8b['id'];if(_0x575b23[_0xcd6b('0x48')]['filter']){_0x1e9682[_0xcd6b('0x50')]=_['merge'](_0x1e9682[_0xcd6b('0x50')],{'$or':_['map'](_0x1e9682[_0xcd6b('0x4b')],function(_0x224750){var _0x5df72d={};_0x5df72d[_0x224750]={'$like':'%'+_0x575b23[_0xcd6b('0x48')][_0xcd6b('0x6a')]+'%'};return _0x5df72d;})});}if(_0x575b23['query'][_0xcd6b('0x97')]){var _0x1c9ab5=_0x575b23[_0xcd6b('0x48')][_0xcd6b('0x97')][_0xcd6b('0x98')](',');var _0x452506={};_0x452506[_0x1c9ab5[0x0]]={'$gte':moment(_0x1c9ab5[0x1])[_0xcd6b('0x99')](_0xcd6b('0x9a'))};_0x1e9682[_0xcd6b('0x50')]=_['merge'](_0x1e9682['where'],_0x452506);}_0x1e9682=_[_0xcd6b('0x53')]({},_0x1e9682,_0x575b23[_0xcd6b('0x56')]);return db[_0xcd6b('0x96')][_0xcd6b('0x20')]({'where':_0x1e9682[_0xcd6b('0x50')]})[_0xcd6b('0x10')](function(_0x977282){_0x400ee9[_0xcd6b('0x20')]=_0x977282;if(_0x575b23[_0xcd6b('0x48')][_0xcd6b('0x57')]){_0x1e9682['include']=[{'all':!![]}];}return db[_0xcd6b('0x96')]['findAll'](_0x1e9682);})[_0xcd6b('0x10')](function(_0x186c97){if(_0x575b23[_0xcd6b('0x48')][_0xcd6b('0x9b')]===_0xcd6b('0x9c')){for(var _0x480558=0x0;_0x480558<_0x186c97['length'];_0x480558++){_0x186c97[_0x480558][_0xcd6b('0x5d')]=juice(_0x186c97[_0x480558][_0xcd6b('0x5d')]);}}_0x400ee9[_0xcd6b('0x5a')]=_0x186c97;return _0x400ee9;});}})[_0xcd6b('0x10')](respondWithFilteredResult(_0xfafe41,_0x1e9682))['catch'](handleError(_0xfafe41,null));};exports[_0xcd6b('0x93')]=function(_0x2bfd2e,_0x2fe940){var _0x4786c8,_0x1203d9={},_0x4fc104;if(_0x2bfd2e[_0xcd6b('0x5d')]['to']){_0x4fc104=_0x2bfd2e[_0xcd6b('0x5d')]['to'][_0xcd6b('0x98')](',')[0x0];}return db['MailAccount']['find']({'where':{'id':_0x2bfd2e['params']['id']},'include':[{'model':db['CmList'],'as':_0xcd6b('0x9d'),'include':[{'model':db[_0xcd6b('0x9e')],'as':_0xcd6b('0x9f'),'where':{'email':_0x4fc104},'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db[_0xcd6b('0x42')],'as':_0xcd6b('0x40'),'raw':!![],'include':[{'model':db[_0xcd6b('0xa0')],'as':_0xcd6b('0xa0'),'raw':!![]}]}]})[_0xcd6b('0x10')](handleEntityNotFound(_0x2fe940,null))[_0xcd6b('0x10')](function(_0x5ebeb1){if(!_0x5ebeb1)return;_0x4786c8=_0x5ebeb1;if(!_0x5ebeb1[_0xcd6b('0x40')])throw new Error(_0xcd6b('0xa1'));if(_[_0xcd6b('0x74')](_0x2bfd2e['body']['from'])){_0x2bfd2e[_0xcd6b('0x5d')][_0xcd6b('0xa2')]=util[_0xcd6b('0x99')](_0xcd6b('0xa3'),_0x5ebeb1[_0xcd6b('0x29')],_0x5ebeb1[_0xcd6b('0x72')]||_0x5ebeb1[_0xcd6b('0x40')][_0xcd6b('0x35')]);}if(_0x2bfd2e[_0xcd6b('0x5d')][_0xcd6b('0xa4')]&&_0x2bfd2e['body'][_0xcd6b('0xa4')][_0xcd6b('0x4c')]){for(var _0x579538=0x0;_0x579538<_0x2bfd2e[_0xcd6b('0x5d')][_0xcd6b('0xa4')]['length'];_0x579538+=0x1){_0x2bfd2e['body']['attachments'][_0x579538]={'filename':_0x2bfd2e[_0xcd6b('0x5d')][_0xcd6b('0xa4')][_0x579538][_0xcd6b('0x29')],'path':path[_0xcd6b('0xa5')](config[_0xcd6b('0xa6')],_0xcd6b('0xa7'),_0x2bfd2e[_0xcd6b('0x5d')]['attachments'][_0x579538][_0xcd6b('0xa8')])};}}var _0x330008=_0x5ebeb1[_0xcd6b('0xa9')]();return respondWithRpcPromise(_0xcd6b('0xaa'),_0xcd6b('0xab'),{'account':_0x330008,'message':_0x2bfd2e['body']});})['then'](function(_0x15311b){if(!_0x15311b)return;_0x1203d9=_0x15311b;if(!_0x4786c8['List'])throw new Error('List\x20not\x20found');if(_0x4786c8['List'][_0xcd6b('0x9f')][_0xcd6b('0x4c')])return _0x4786c8[_0xcd6b('0x9d')][_0xcd6b('0x9f')][0x0];return db[_0xcd6b('0x9e')][_0xcd6b('0x66')](_[_0xcd6b('0xac')](_0x2bfd2e['body'],{'firstName':_0x2bfd2e['body']['to'],'email':_0x2bfd2e[_0xcd6b('0x5d')]['to'],'phone':_0x2bfd2e[_0xcd6b('0x5d')]['to'],'ListId':_0x4786c8[_0xcd6b('0x73')]}));})[_0xcd6b('0x10')](function(_0xfb4d13){if(!_0xfb4d13)return;var _0x1f96d5={'UserId':_0x2bfd2e[_0xcd6b('0x35')]['id'],'ContactId':_0xfb4d13['id'],'MailAccountId':_0x4786c8['id'],'inReplyTo':_0x1203d9['messageId'],'to':_0x2bfd2e[_0xcd6b('0x5d')][_0xcd6b('0xa2')],'cc':_0x2bfd2e['body']['cc'],'subject':_0x2bfd2e[_0xcd6b('0x5d')][_0xcd6b('0xad')],'attach':_0x2bfd2e[_0xcd6b('0x5d')][_0xcd6b('0xae')],'firstMsgDirection':_0xcd6b('0xaf'),'lastMsgAt':moment()['format'](_0xcd6b('0x9a')),'lastMsgDirection':'out','Messages':[_['merge'](_0x2bfd2e[_0xcd6b('0x5d')],{'messageId':_0x1203d9[_0xcd6b('0xb0')],'sentAt':moment()['format'](_0xcd6b('0x9a')),'read':!![],'MailAccountId':_0x4786c8['id'],'UserId':_0x2bfd2e['user']['id'],'ContactId':_0xfb4d13['id']})]};if(_0x2bfd2e[_0xcd6b('0x5d')][_0xcd6b('0xb1')]){_0x1f96d5=_[_0xcd6b('0x53')](_0x1f96d5,_0x2bfd2e[_0xcd6b('0x5d')][_0xcd6b('0xb1')]);}return db[_0xcd6b('0x81')][_0xcd6b('0x66')](_0x1f96d5,{'include':[{'model':db[_0xcd6b('0x96')],'as':_0xcd6b('0xb2')}]});})[_0xcd6b('0x10')](respondWithResult(_0x2fe940,null))['catch'](handleError(_0x2fe940,null));};exports[_0xcd6b('0xb3')]=function(_0x441bb5,_0x57f946){return db['MailAccount'][_0xcd6b('0x5c')]({'where':{'id':_0x441bb5[_0xcd6b('0x64')]['id']},'include':[{'model':db[_0xcd6b('0x42')],'as':_0xcd6b('0x40'),'raw':!![],'include':[{'model':db[_0xcd6b('0xa0')],'as':'CloudProvider','raw':!![]}]}]})[_0xcd6b('0x10')](handleEntityNotFound(_0x57f946,null))[_0xcd6b('0x10')](function(_0x4d6355){if(!_0x4d6355[_0xcd6b('0x40')])return;var _0x8b49d4=_0x4d6355[_0xcd6b('0xa9')]();return respondWithRpcPromise(_0xcd6b('0xb4'),_0xcd6b('0xb3'),{'account':_0x8b49d4});})[_0xcd6b('0x10')](respondWithResult(_0x57f946,null))[_0xcd6b('0x19')](handleError(_0x57f946,null));};exports[_0xcd6b('0x24')]=function(_0x5915b7,_0x1ff4d8){return db['MailAccount']['find']({'where':{'id':_0x5915b7[_0xcd6b('0x64')]['id']}})[_0xcd6b('0x10')](handleEntityNotFound(_0x1ff4d8,null))[_0xcd6b('0x10')](function(_0x19dc8b){if(_0x19dc8b&&_0x19dc8b[_0xcd6b('0x3d')]){throw new db[(_0xcd6b('0xb5'))][(_0xcd6b('0xb6'))](_0xcd6b('0xb7'));}return _0x19dc8b;})[_0xcd6b('0x10')](removeEntity(_0x1ff4d8,null))[_0xcd6b('0x19')](handleError(_0x1ff4d8,null));};exports[_0xcd6b('0xb8')]=function(_0x3308b5,_0x33f079){return db[_0xcd6b('0x59')][_0xcd6b('0x5c')]({'where':{'id':_0x3308b5[_0xcd6b('0x64')]['id']}})['then'](handleEntityNotFound(_0x33f079,null))[_0xcd6b('0x10')](function(_0x144c47){if(_0x144c47){return _0x144c47['addAgents'](_0x3308b5[_0xcd6b('0x5d')][_0xcd6b('0x6d')],_[_0xcd6b('0xb9')](_0x3308b5[_0xcd6b('0x5d')],[_0xcd6b('0x6d'),'id'])||{})[_0xcd6b('0xba')](function(_0x4b9410){for(var _0x383b5e=0x0;_0x383b5e<_0x3308b5[_0xcd6b('0x5d')][_0xcd6b('0x6d')][_0xcd6b('0x4c')];_0x383b5e+=0x1){socket[_0xcd6b('0xbb')](_0xcd6b('0xbc'),{'UserId':Number(_0x3308b5[_0xcd6b('0x5d')]['ids'][_0x383b5e]),'MailAccountId':Number(_0x3308b5[_0xcd6b('0x64')]['id'])});}return _0x4b9410;});}})[_0xcd6b('0x10')](respondWithResult(_0x33f079,null))['catch'](handleError(_0x33f079,null));};exports[_0xcd6b('0xbd')]=function(_0x2af82b,_0x52f641){return db[_0xcd6b('0x59')][_0xcd6b('0x5c')]({'where':{'id':_0x2af82b[_0xcd6b('0x64')]['id']}})[_0xcd6b('0x10')](handleEntityNotFound(_0x52f641,null))[_0xcd6b('0x10')](function(_0x366ea9){if(_0x366ea9){return _0x366ea9['removeAgents'](_0x2af82b[_0xcd6b('0x48')][_0xcd6b('0x6d')])[_0xcd6b('0x10')](function(){if(_[_0xcd6b('0xbe')](_0x2af82b[_0xcd6b('0x48')][_0xcd6b('0x6d')])){for(var _0x55a79b=0x0;_0x55a79b<_0x2af82b['query']['ids']['length'];_0x55a79b+=0x1){socket[_0xcd6b('0xbb')](_0xcd6b('0xbf'),{'UserId':Number(_0x2af82b[_0xcd6b('0x48')][_0xcd6b('0x6d')][_0x55a79b]),'MailAccountId':Number(_0x2af82b['params']['id'])});}}else{socket['emit'](_0xcd6b('0xbf'),{'UserId':Number(_0x2af82b[_0xcd6b('0x48')]['ids']),'MailAccountId':Number(_0x2af82b[_0xcd6b('0x64')]['id'])});}});}})[_0xcd6b('0x10')](respondWithStatusCode(_0x52f641,null))['catch'](handleError(_0x52f641,null));};exports[_0xcd6b('0xc0')]=function(_0x31ad50,_0x265eaa){var _0x3faa9e={};var _0x34f29d={};var _0x253712;var _0x222e1a;return db[_0xcd6b('0x59')]['findOne']({'where':{'id':_0x31ad50['params']['id']}})[_0xcd6b('0x10')](handleEntityNotFound(_0x265eaa,null))[_0xcd6b('0x10')](function(_0x260e54){if(_0x260e54){_0x253712=_0x260e54;_0x34f29d[_0xcd6b('0x47')]=_['keys'](db['User']['rawAttributes']);_0x34f29d[_0xcd6b('0x48')]=_[_0xcd6b('0x5b')](_0x31ad50[_0xcd6b('0x48')]);_0x34f29d[_0xcd6b('0x51')]=_[_0xcd6b('0x49')](_0x34f29d['model'],_0x34f29d['query']);_0x3faa9e[_0xcd6b('0x4b')]=_['intersection'](_0x34f29d[_0xcd6b('0x47')],qs[_0xcd6b('0x4a')](_0x31ad50['query'][_0xcd6b('0x4a')]));_0x3faa9e[_0xcd6b('0x4b')]=_0x3faa9e['attributes'][_0xcd6b('0x4c')]?_0x3faa9e[_0xcd6b('0x4b')]:_0x34f29d[_0xcd6b('0x47')];_0x3faa9e[_0xcd6b('0x4e')]=qs[_0xcd6b('0x4f')](_0x31ad50[_0xcd6b('0x48')][_0xcd6b('0x4f')]);_0x3faa9e[_0xcd6b('0x50')]=qs[_0xcd6b('0x51')](_[_0xcd6b('0x52')](_0x31ad50[_0xcd6b('0x48')],_0x34f29d['filters']));if(_0x31ad50[_0xcd6b('0x48')]['filter']){_0x3faa9e[_0xcd6b('0x50')]=_[_0xcd6b('0x53')](_0x3faa9e[_0xcd6b('0x50')],{'$or':_[_0xcd6b('0x45')](_0x3faa9e[_0xcd6b('0x4b')],function(_0xdd2e5f){var _0x17e3e9={};_0x17e3e9[_0xdd2e5f]={'$like':'%'+_0x31ad50[_0xcd6b('0x48')]['filter']+'%'};return _0x17e3e9;})});}_0x3faa9e=_[_0xcd6b('0x53')]({},_0x3faa9e,_0x31ad50[_0xcd6b('0x56')]);return _0x253712[_0xcd6b('0xc0')](_0x3faa9e);}})[_0xcd6b('0x10')](function(_0x2364b7){if(_0x2364b7){_0x222e1a=_0x2364b7[_0xcd6b('0x4c')];if(!_0x31ad50[_0xcd6b('0x48')][_0xcd6b('0x70')]('nolimit')){_0x3faa9e[_0xcd6b('0x1e')]=qs['limit'](_0x31ad50[_0xcd6b('0x48')][_0xcd6b('0x1e')]);_0x3faa9e[_0xcd6b('0x1d')]=qs[_0xcd6b('0x1d')](_0x31ad50[_0xcd6b('0x48')][_0xcd6b('0x1d')]);}return _0x253712[_0xcd6b('0xc0')](_0x3faa9e);}})['then'](function(_0x4d16b5){if(_0x4d16b5){return _0x4d16b5?{'count':_0x222e1a,'rows':_0x4d16b5}:null;}})[_0xcd6b('0x10')](respondWithResult(_0x265eaa,null))[_0xcd6b('0x19')](handleError(_0x265eaa,null));}; \ No newline at end of file +var _0xa06a=['omit','getInteractions','CmContact','Contact','internal','Tag','Tags','tag','sequelize','transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','findAndCountAll','priority','finally','getApplications','getMessages','MailMessage','$gte','split','format','inlineCss','List','Contacts','DESC','CloudProvider','Smtp\x20configuration\x20not\x20found','from','%s\x20<%s>','attachments','join','root','server/files/attachments','basename','getSmtpOptions','SendMail','List\x20not\x20found','messageId','subject','attach','out','YYYY-MM-DD\x20HH:mm:ss','Interaction','Messages','VerifySmtp','verifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','spread','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','getAgents','User','moment','util','path','lodash','juice','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./mailAccount.socket','jayson/promise','client','http','request','then','MailAccount,\x20%s,\x20%s','debug','request\x20sent','error','code','message','info','catch','sendStatus','status','json','limit','undefined','count','offset','set','Content-Range','update','destroy','get','UserProfileResource','end','stack','name','send','gmail','imap.gmail.com','yahoo','hotmail','outlook365','outlook.office365.com','smtp.gmail.com','smtp.mail.yahoo.com','smtp-mail.outlook.com','smtp.office365.com','password','pass','modernAuthentication','CloudProviderId','host','port','service','authentication','user','username','Imap','Smtp','index','MailServerOut','Pause','mandatoryDispositionPause','map','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','MailAccount','findAll','rows','show','params','MailServerIn','keys','filters','includeAll','body','provider','custom','secure','find','Mail\x20Account\x20not\x20found','describe','Disposition','create','findOne','order','MailAccountId','removeDispositions','ids','CannedAnswer','include','removeAnswers','email','ListId','isNil','active','description','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','MailAccounts','userProfileId','getImap','setImap','getSmtp','removeSmtp','MailInteraction','addInteraction'];(function(_0x5cc099,_0x3f01da){var _0x829ef0=function(_0x4ba5a4){while(--_0x4ba5a4){_0x5cc099['push'](_0x5cc099['shift']());}};_0x829ef0(++_0x3f01da);}(_0xa06a,0xf9));var _0xaa06=function(_0x1f2276,_0x83a4b5){_0x1f2276=_0x1f2276-0x0;var _0x5bd139=_0xa06a[_0x1f2276];return _0x5bd139;};'use strict';var moment=require(_0xaa06('0x0'));var BPromise=require('bluebird');var util=require(_0xaa06('0x1'));var path=require(_0xaa06('0x2'));var _=require(_0xaa06('0x3'));var juice=require(_0xaa06('0x4'));var Redis=require(_0xaa06('0x5'));var qs=require(_0xaa06('0x6'));var logger=require(_0xaa06('0x7'))(_0xaa06('0x8'));var config=require(_0xaa06('0x9'));var db=require(_0xaa06('0xa'))['db'];config[_0xaa06('0xb')]=_[_0xaa06('0xc')](config['redis'],{'host':_0xaa06('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xaa06('0xb')]));require(_0xaa06('0xe'))['register'](socket);var jayson=require(_0xaa06('0xf'));var client=jayson[_0xaa06('0x10')][_0xaa06('0x11')]({'port':0x232b});function respondWithRpcPromise(_0x222527,_0x4e83f8,_0x12370f,_0x4195ad){return new BPromise(function(_0x2c1f56,_0x48097e){var _0x515285=_0x4195ad||client;return _0x515285[_0xaa06('0x12')](_0x222527,_0x12370f)[_0xaa06('0x13')](function(_0x4e3be7){logger['info'](_0xaa06('0x14'),_0x4e83f8,'request\x20sent');logger[_0xaa06('0x15')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x4e83f8,_0xaa06('0x16'),JSON['stringify'](_0x4e3be7));if(_0x4e3be7[_0xaa06('0x17')]){if(_0x4e3be7[_0xaa06('0x17')][_0xaa06('0x18')]===0x1f4){logger[_0xaa06('0x17')](_0xaa06('0x14'),_0x4e83f8,_0x4e3be7[_0xaa06('0x17')][_0xaa06('0x19')]);return _0x48097e(_0x4e3be7[_0xaa06('0x17')][_0xaa06('0x19')]);}logger[_0xaa06('0x17')](_0xaa06('0x14'),_0x4e83f8,_0x4e3be7[_0xaa06('0x17')][_0xaa06('0x19')]);return _0x2c1f56(_0x4e3be7[_0xaa06('0x17')][_0xaa06('0x19')]);}else{logger[_0xaa06('0x1a')]('MailAccount,\x20%s,\x20%s',_0x4e83f8,_0xaa06('0x16'));_0x2c1f56(_0x4e3be7['result']['message']);}})[_0xaa06('0x1b')](function(_0x55d244){logger[_0xaa06('0x17')]('MailAccount,\x20%s,\x20%s',_0x4e83f8,_0x55d244);_0x48097e(_0x55d244);});});}function respondWithStatusCode(_0x184c8b,_0x5ef159){_0x5ef159=_0x5ef159||0xcc;return function(_0x158ff7){if(_0x158ff7){return _0x184c8b[_0xaa06('0x1c')](_0x5ef159);}return _0x184c8b['status'](_0x5ef159)['end']();};}function respondWithResult(_0x2da2b4,_0x3d4ff1){_0x3d4ff1=_0x3d4ff1||0xc8;return function(_0x207759){if(_0x207759){return _0x2da2b4[_0xaa06('0x1d')](_0x3d4ff1)[_0xaa06('0x1e')](_0x207759);}};}function respondWithFilteredResult(_0x1d0c70,_0x3cb560){return function(_0x543a7f){if(_0x543a7f){var _0x4301d9=typeof _0x3cb560['offset']==='undefined'&&typeof _0x3cb560[_0xaa06('0x1f')]===_0xaa06('0x20');var _0x2d0645=_0x543a7f[_0xaa06('0x21')];var _0x1d7aab=_0x4301d9?0x0:_0x3cb560['offset'];var _0x24d4f0=_0x4301d9?_0x543a7f['count']:_0x3cb560[_0xaa06('0x22')]+_0x3cb560[_0xaa06('0x1f')];var _0x32172f;if(_0x24d4f0>=_0x2d0645){_0x24d4f0=_0x2d0645;_0x32172f=0xc8;}else{_0x32172f=0xce;}_0x1d0c70['status'](_0x32172f);return _0x1d0c70[_0xaa06('0x23')](_0xaa06('0x24'),_0x1d7aab+'-'+_0x24d4f0+'/'+_0x2d0645)[_0xaa06('0x1e')](_0x543a7f);}return null;};}function saveUpdates(_0x31eeed){return function(_0x5a166e){if(_0x5a166e){return _0x5a166e[_0xaa06('0x25')](_0x31eeed)[_0xaa06('0x13')](function(_0x180baf){return _0x180baf;});}return null;};}function removeEntity(_0x492eeb){return function(_0x1868fe){if(_0x1868fe){return _0x1868fe[_0xaa06('0x26')]()[_0xaa06('0x13')](function(){var _0x376b77=_0x1868fe[_0xaa06('0x27')]({'plain':!![]});var _0x5c25fe='MailAccounts';return db[_0xaa06('0x28')][_0xaa06('0x26')]({'where':{'type':_0x5c25fe,'resourceId':_0x376b77['id']}})['then'](function(){return _0x1868fe;});})[_0xaa06('0x13')](function(){_0x492eeb[_0xaa06('0x1d')](0xcc)[_0xaa06('0x29')]();});}};}function handleEntityNotFound(_0x4f7d62){return function(_0x3662e7){if(!_0x3662e7){_0x4f7d62[_0xaa06('0x1c')](0x194);}return _0x3662e7;};}function handleError(_0x2dd683,_0x3a9d9f){_0x3a9d9f=_0x3a9d9f||0x1f4;return function(_0x5c4d51){logger[_0xaa06('0x17')](_0x5c4d51[_0xaa06('0x2a')]);if(_0x5c4d51['name']){delete _0x5c4d51[_0xaa06('0x2b')];}_0x2dd683[_0xaa06('0x1d')](_0x3a9d9f)[_0xaa06('0x2c')](_0x5c4d51);};}function getImapHost(_0x2bcacf){switch(_0x2bcacf){case _0xaa06('0x2d'):return _0xaa06('0x2e');case _0xaa06('0x2f'):return'imap.mail.yahoo.com';case _0xaa06('0x30'):return'imap-mail.outlook.com';case _0xaa06('0x31'):return _0xaa06('0x32');}throw new Error('Unknown\x20email\x20service\x20provider',_0x2bcacf);}function getSmtpHost(_0x1fb60b){switch(_0x1fb60b){case _0xaa06('0x2d'):return _0xaa06('0x33');case _0xaa06('0x2f'):return _0xaa06('0x34');case _0xaa06('0x30'):return _0xaa06('0x35');case _0xaa06('0x31'):return _0xaa06('0x36');}throw new Error('Unknown\x20email\x20service\x20provider',_0x1fb60b);}function getAuthenticationOptions(_0x5f16cd,_0x557613){var _0x2d3a97={};var _0x4a66e1={};if(_0x5f16cd){_0x2d3a97['user']=_0x4a66e1['user']=_0x557613['username'];_0x2d3a97[_0xaa06('0x37')]=_0x4a66e1[_0xaa06('0x38')]=_0x557613[_0xaa06('0x37')];if(_0x557613[_0xaa06('0x39')]){_0x2d3a97[_0xaa06('0x39')]=_0x4a66e1[_0xaa06('0x39')]=!![];_0x2d3a97[_0xaa06('0x3a')]=_0x4a66e1[_0xaa06('0x3a')]=_0x557613[_0xaa06('0x3a')];_0x2d3a97[_0xaa06('0x37')]=_0x4a66e1[_0xaa06('0x38')]=null;}else{_0x2d3a97[_0xaa06('0x3a')]=_0x4a66e1[_0xaa06('0x3a')]=null;}_0x2d3a97[_0xaa06('0x3b')]=getImapHost(_0x5f16cd);_0x2d3a97[_0xaa06('0x3c')]=0x3e1;_0x4a66e1[_0xaa06('0x3b')]=getSmtpHost(_0x5f16cd);_0x4a66e1['port']=0x24b;_0x4a66e1['secure']=![];_0x2d3a97[_0xaa06('0x3d')]=_0x4a66e1[_0xaa06('0x3d')]=null;}else{if(_0x557613[_0xaa06('0x3e')]){_0x2d3a97['user']=_0x4a66e1[_0xaa06('0x3f')]=_0x557613[_0xaa06('0x40')];_0x2d3a97[_0xaa06('0x37')]=_0x4a66e1[_0xaa06('0x38')]=_0x557613[_0xaa06('0x37')];}else{_0x2d3a97[_0xaa06('0x3e')]=_0x4a66e1[_0xaa06('0x3e')]=![];_0x2d3a97[_0xaa06('0x3f')]=_0x4a66e1[_0xaa06('0x3f')]=null;_0x2d3a97[_0xaa06('0x37')]=_0x4a66e1[_0xaa06('0x38')]=null;}_0x2d3a97['host']=_0x557613[_0xaa06('0x41')][_0xaa06('0x3b')];_0x2d3a97[_0xaa06('0x3c')]=_0x557613['Imap'][_0xaa06('0x3c')];_0x4a66e1['host']=_0x557613[_0xaa06('0x42')]['host'];_0x4a66e1[_0xaa06('0x3c')]=_0x557613[_0xaa06('0x42')]['port'];}return{'Imap':_0x2d3a97,'Smtp':_0x4a66e1};}exports[_0xaa06('0x43')]=function(_0x20c718,_0x27ce40){var _0x182fa6={'include':[{'model':db['MailServerIn'],'as':_0xaa06('0x41')},{'model':db[_0xaa06('0x44')],'as':_0xaa06('0x42')},{'model':db[_0xaa06('0x45')],'as':_0xaa06('0x46')}]},_0x314b05={},_0xf69e9={'count':0x0,'rows':[]};var _0x1827f4=_[_0xaa06('0x47')](db['MailAccount'][_0xaa06('0x48')],function(_0x7e9af8){return{'name':_0x7e9af8[_0xaa06('0x49')],'type':_0x7e9af8[_0xaa06('0x4a')][_0xaa06('0x4b')]};});_0x314b05[_0xaa06('0x4c')]=_[_0xaa06('0x47')](_0x1827f4,_0xaa06('0x2b'));_0x314b05['query']=_['keys'](_0x20c718[_0xaa06('0x4d')]);_0x314b05['filters']=_[_0xaa06('0x4e')](_0x314b05[_0xaa06('0x4c')],_0x314b05[_0xaa06('0x4d')]);_0x182fa6[_0xaa06('0x4f')]=_['intersection'](_0x314b05[_0xaa06('0x4c')],qs[_0xaa06('0x50')](_0x20c718['query'][_0xaa06('0x50')]));_0x182fa6[_0xaa06('0x4f')]=_0x182fa6[_0xaa06('0x4f')][_0xaa06('0x51')]?_0x182fa6[_0xaa06('0x4f')]:_0x314b05[_0xaa06('0x4c')];if(!_0x20c718[_0xaa06('0x4d')][_0xaa06('0x52')](_0xaa06('0x53'))){_0x182fa6['limit']=qs[_0xaa06('0x1f')](_0x20c718[_0xaa06('0x4d')][_0xaa06('0x1f')]);_0x182fa6[_0xaa06('0x22')]=qs[_0xaa06('0x22')](_0x20c718[_0xaa06('0x4d')][_0xaa06('0x22')]);}_0x182fa6['order']=qs[_0xaa06('0x54')](_0x20c718['query'][_0xaa06('0x54')]);_0x182fa6[_0xaa06('0x55')]=qs['filters'](_[_0xaa06('0x56')](_0x20c718[_0xaa06('0x4d')],_0x314b05['filters']),_0x1827f4);if(_0x20c718[_0xaa06('0x4d')][_0xaa06('0x57')]){_0x182fa6['where']=_[_0xaa06('0x58')](_0x182fa6[_0xaa06('0x55')],{'$or':_[_0xaa06('0x47')](_0x1827f4,function(_0x28c386){if(_0x28c386['type']!==_0xaa06('0x59')){var _0x3debf4={};_0x3debf4[_0x28c386[_0xaa06('0x2b')]]={'$like':'%'+_0x20c718[_0xaa06('0x4d')][_0xaa06('0x57')]+'%'};return _0x3debf4;}})});}_0x182fa6=_['merge']({},_0x182fa6,_0x20c718[_0xaa06('0x5a')]);var _0x47b569={'where':_0x182fa6['where']};return db['MailAccount'][_0xaa06('0x21')](_0x47b569)[_0xaa06('0x13')](function(_0x151be1){_0xf69e9['count']=_0x151be1;if(_0x20c718[_0xaa06('0x4d')]['includeAll']){_0x182fa6['include']=[{'all':!![]}];}return db[_0xaa06('0x5b')][_0xaa06('0x5c')](_0x182fa6);})[_0xaa06('0x13')](function(_0x325304){_0xf69e9[_0xaa06('0x5d')]=_0x325304;return _0xf69e9;})[_0xaa06('0x13')](respondWithFilteredResult(_0x27ce40,_0x182fa6))[_0xaa06('0x1b')](handleError(_0x27ce40,null));};exports[_0xaa06('0x5e')]=function(_0x5f5bf3,_0x11d1b5){var _0xd418f7={'raw':![],'where':{'id':_0x5f5bf3[_0xaa06('0x5f')]['id']},'include':[{'model':db[_0xaa06('0x60')],'as':_0xaa06('0x41')},{'model':db[_0xaa06('0x44')],'as':_0xaa06('0x42')},{'model':db[_0xaa06('0x45')],'as':'mandatoryDispositionPause'}]},_0xe94e90={};_0xe94e90[_0xaa06('0x4c')]=_['keys'](db[_0xaa06('0x5b')][_0xaa06('0x48')]);_0xe94e90['query']=_[_0xaa06('0x61')](_0x5f5bf3['query']);_0xe94e90[_0xaa06('0x62')]=_[_0xaa06('0x4e')](_0xe94e90[_0xaa06('0x4c')],_0xe94e90[_0xaa06('0x4d')]);_0xd418f7[_0xaa06('0x4f')]=_[_0xaa06('0x4e')](_0xe94e90[_0xaa06('0x4c')],qs['fields'](_0x5f5bf3['query'][_0xaa06('0x50')]));_0xd418f7[_0xaa06('0x4f')]=_0xd418f7[_0xaa06('0x4f')][_0xaa06('0x51')]?_0xd418f7['attributes']:_0xe94e90[_0xaa06('0x4c')];if(_0x5f5bf3[_0xaa06('0x4d')][_0xaa06('0x63')]){_0xd418f7['include']=[{'all':!![]}];}_0xd418f7=_[_0xaa06('0x58')]({},_0xd418f7,_0x5f5bf3[_0xaa06('0x5a')]);return db['MailAccount']['find'](_0xd418f7)['then'](handleEntityNotFound(_0x11d1b5,null))[_0xaa06('0x13')](respondWithResult(_0x11d1b5,null))[_0xaa06('0x1b')](handleError(_0x11d1b5,null));};exports[_0xaa06('0x25')]=function(_0x3b04ca,_0x4beebb){if(_0x3b04ca[_0xaa06('0x64')]['id']){delete _0x3b04ca[_0xaa06('0x64')]['id'];}var _0x3792c4=_0x3b04ca[_0xaa06('0x64')][_0xaa06('0x65')]===_0xaa06('0x66')?null:_0x3b04ca[_0xaa06('0x64')][_0xaa06('0x65')];var _0xb3aa27=_0x3b04ca['body'][_0xaa06('0x41')]||{};var _0xdbe2c3=_0x3b04ca['body'][_0xaa06('0x42')]||{};if(_0x3792c4){_0xb3aa27[_0xaa06('0x3b')]=getImapHost(_0x3792c4);_0xb3aa27[_0xaa06('0x3c')]=0x3e1;_0xdbe2c3['host']=getSmtpHost(_0x3792c4);_0xdbe2c3['port']=0x24b;_0xdbe2c3[_0xaa06('0x67')]=![];}if(_0xdbe2c3[_0xaa06('0x39')]){_0xdbe2c3[_0xaa06('0x67')]=![];}else{_0xdbe2c3[_0xaa06('0x3a')]=null;}if(!_0xb3aa27[_0xaa06('0x39')])_0xb3aa27[_0xaa06('0x3a')]=null;_0x3b04ca[_0xaa06('0x64')]['Imap']=_0xb3aa27;_0x3b04ca[_0xaa06('0x64')][_0xaa06('0x42')]=_0xdbe2c3;return db[_0xaa06('0x5b')][_0xaa06('0x68')]({'where':{'id':_0x3b04ca[_0xaa06('0x5f')]['id']},'include':[{'model':db[_0xaa06('0x60')],'as':_0xaa06('0x41')},{'model':db[_0xaa06('0x44')],'as':'Smtp'},{'model':db[_0xaa06('0x45')],'as':_0xaa06('0x46')}]})[_0xaa06('0x13')](handleEntityNotFound(_0x4beebb,null))[_0xaa06('0x13')](function(_0x465de1){if(!_0x465de1)throw new Error(_0xaa06('0x69'));if(_0x465de1[_0xaa06('0x3d')])delete _0x3b04ca[_0xaa06('0x64')][_0xaa06('0x41')];return _0x465de1;})['then'](saveUpdates(_0x3b04ca[_0xaa06('0x64')],null))[_0xaa06('0x13')](function(_0x1376be){if(!_0x3b04ca[_0xaa06('0x64')][_0xaa06('0x41')])return _0x1376be;return db[_0xaa06('0x60')][_0xaa06('0x25')](_0x3b04ca['body'][_0xaa06('0x41')],{'where':{'MailAccountId':_0x1376be['id']}})[_0xaa06('0x13')](function(){return _0x1376be;});})['then'](function(_0x26d7a9){if(!_0x3b04ca[_0xaa06('0x64')][_0xaa06('0x42')])return _0x26d7a9;return db[_0xaa06('0x44')][_0xaa06('0x25')](_0x3b04ca['body'][_0xaa06('0x42')],{'where':{'MailAccountId':_0x26d7a9['id']}})['then'](function(){return _0x26d7a9;});})[_0xaa06('0x13')](respondWithResult(_0x4beebb,null))[_0xaa06('0x1b')](handleError(_0x4beebb,null));};exports[_0xaa06('0x6a')]=function(_0x5b7053,_0x45a031){return db['MailAccount'][_0xaa06('0x6a')]()['then'](respondWithResult(_0x45a031,null))[_0xaa06('0x1b')](handleError(_0x45a031,null));};exports['addDisposition']=function(_0x241fac,_0x4ce250){if(_0x241fac['body']['id']){delete _0x241fac['body']['id'];}return db[_0xaa06('0x5b')][_0xaa06('0x68')]({'where':{'id':_0x241fac[_0xaa06('0x5f')]['id']}})[_0xaa06('0x13')](handleEntityNotFound(_0x4ce250,null))['then'](function(_0x3e55ad){if(_0x3e55ad){_0x241fac[_0xaa06('0x64')]['MailAccountId']=_0x3e55ad['id'];return db[_0xaa06('0x6b')][_0xaa06('0x6c')](_0x241fac[_0xaa06('0x64')]);}})[_0xaa06('0x13')](respondWithResult(_0x4ce250,null))[_0xaa06('0x1b')](handleError(_0x4ce250,null));};exports['getDispositions']=function(_0x23020e,_0xe9e290){var _0x39e0ba={'raw':![],'where':{}};var _0x5b5537={};var _0x4398e1={'count':0x0,'rows':[]};return db[_0xaa06('0x5b')][_0xaa06('0x6d')]({'where':{'id':_0x23020e['params']['id']}})[_0xaa06('0x13')](handleEntityNotFound(_0xe9e290,null))[_0xaa06('0x13')](function(_0x43f25e){if(_0x43f25e){_0x5b5537['model']=_['keys'](db['Disposition'][_0xaa06('0x48')]);_0x5b5537[_0xaa06('0x4d')]=_['keys'](_0x23020e['query']);_0x5b5537[_0xaa06('0x62')]=_['intersection'](_0x5b5537[_0xaa06('0x4c')],_0x5b5537['query']);_0x39e0ba[_0xaa06('0x4f')]=_['intersection'](_0x5b5537['model'],qs[_0xaa06('0x50')](_0x23020e[_0xaa06('0x4d')][_0xaa06('0x50')]));_0x39e0ba[_0xaa06('0x4f')]=_0x39e0ba[_0xaa06('0x4f')][_0xaa06('0x51')]?_0x39e0ba[_0xaa06('0x4f')]:_0x5b5537[_0xaa06('0x4c')];if(!_0x23020e[_0xaa06('0x4d')][_0xaa06('0x52')]('nolimit')){_0x39e0ba[_0xaa06('0x1f')]=qs['limit'](_0x23020e['query'][_0xaa06('0x1f')]);_0x39e0ba['offset']=qs[_0xaa06('0x22')](_0x23020e[_0xaa06('0x4d')][_0xaa06('0x22')]);}_0x39e0ba[_0xaa06('0x6e')]=qs[_0xaa06('0x54')](_0x23020e[_0xaa06('0x4d')][_0xaa06('0x54')]);_0x39e0ba[_0xaa06('0x55')]=qs[_0xaa06('0x62')](_['pick'](_0x23020e['query'],_0x5b5537[_0xaa06('0x62')]));_0x39e0ba[_0xaa06('0x55')][_0xaa06('0x6f')]=_0x43f25e['id'];if(_0x23020e[_0xaa06('0x4d')][_0xaa06('0x57')]){_0x39e0ba[_0xaa06('0x55')]=_['merge'](_0x39e0ba['where'],{'$or':_[_0xaa06('0x47')](_0x39e0ba[_0xaa06('0x4f')],function(_0x5d80a5){var _0x3b7bcb={};_0x3b7bcb[_0x5d80a5]={'$like':'%'+_0x23020e[_0xaa06('0x4d')][_0xaa06('0x57')]+'%'};return _0x3b7bcb;})});}_0x39e0ba=_['merge']({},_0x39e0ba,_0x23020e[_0xaa06('0x5a')]);return db[_0xaa06('0x6b')][_0xaa06('0x21')]({'where':_0x39e0ba[_0xaa06('0x55')]})[_0xaa06('0x13')](function(_0x5e0cbb){_0x4398e1[_0xaa06('0x21')]=_0x5e0cbb;if(_0x23020e['query'][_0xaa06('0x63')]){_0x39e0ba['include']=[{'all':!![]}];}return db[_0xaa06('0x6b')][_0xaa06('0x5c')](_0x39e0ba);})['then'](function(_0x4482e0){_0x4398e1[_0xaa06('0x5d')]=_0x4482e0;return _0x4398e1;});}})[_0xaa06('0x13')](respondWithFilteredResult(_0xe9e290,_0x39e0ba))['catch'](handleError(_0xe9e290,null));};exports[_0xaa06('0x70')]=function(_0x1abf7f,_0xb073e8){return db['MailAccount'][_0xaa06('0x68')]({'where':{'id':_0x1abf7f[_0xaa06('0x5f')]['id']}})[_0xaa06('0x13')](handleEntityNotFound(_0xb073e8,null))[_0xaa06('0x13')](function(_0x294c56){if(_0x294c56){return _0x294c56['removeDispositions'](_0x1abf7f[_0xaa06('0x4d')][_0xaa06('0x71')]);}})[_0xaa06('0x13')](respondWithStatusCode(_0xb073e8,null))[_0xaa06('0x1b')](handleError(_0xb073e8,null));};exports['addAnswer']=function(_0x53fb9d,_0x4d46dd){if(_0x53fb9d[_0xaa06('0x64')]['id']){delete _0x53fb9d[_0xaa06('0x64')]['id'];}return db[_0xaa06('0x5b')][_0xaa06('0x68')]({'where':{'id':_0x53fb9d['params']['id']}})[_0xaa06('0x13')](handleEntityNotFound(_0x4d46dd,null))[_0xaa06('0x13')](function(_0x5ee87d){if(_0x5ee87d){_0x53fb9d[_0xaa06('0x64')][_0xaa06('0x6f')]=_0x5ee87d['id'];return db[_0xaa06('0x72')][_0xaa06('0x6c')](_0x53fb9d['body']);}})['then'](respondWithResult(_0x4d46dd,null))[_0xaa06('0x1b')](handleError(_0x4d46dd,null));};exports['getAnswers']=function(_0x2d8d26,_0x587444){var _0xf357b3={'raw':![],'where':{}};var _0x15f784={};var _0x1ab5d4={'count':0x0,'rows':[]};return db[_0xaa06('0x5b')]['findOne']({'where':{'id':_0x2d8d26[_0xaa06('0x5f')]['id']}})[_0xaa06('0x13')](handleEntityNotFound(_0x587444,null))['then'](function(_0x4634a0){if(_0x4634a0){_0x15f784['model']=_[_0xaa06('0x61')](db[_0xaa06('0x72')][_0xaa06('0x48')]);_0x15f784[_0xaa06('0x4d')]=_[_0xaa06('0x61')](_0x2d8d26[_0xaa06('0x4d')]);_0x15f784[_0xaa06('0x62')]=_[_0xaa06('0x4e')](_0x15f784[_0xaa06('0x4c')],_0x15f784[_0xaa06('0x4d')]);_0xf357b3[_0xaa06('0x4f')]=_[_0xaa06('0x4e')](_0x15f784[_0xaa06('0x4c')],qs[_0xaa06('0x50')](_0x2d8d26['query'][_0xaa06('0x50')]));_0xf357b3[_0xaa06('0x4f')]=_0xf357b3['attributes'][_0xaa06('0x51')]?_0xf357b3[_0xaa06('0x4f')]:_0x15f784[_0xaa06('0x4c')];if(!_0x2d8d26[_0xaa06('0x4d')]['hasOwnProperty']('nolimit')){_0xf357b3[_0xaa06('0x1f')]=qs[_0xaa06('0x1f')](_0x2d8d26[_0xaa06('0x4d')][_0xaa06('0x1f')]);_0xf357b3['offset']=qs[_0xaa06('0x22')](_0x2d8d26['query'][_0xaa06('0x22')]);}_0xf357b3[_0xaa06('0x6e')]=qs[_0xaa06('0x54')](_0x2d8d26[_0xaa06('0x4d')]['sort']);_0xf357b3[_0xaa06('0x55')]=qs[_0xaa06('0x62')](_['pick'](_0x2d8d26[_0xaa06('0x4d')],_0x15f784['filters']));_0xf357b3[_0xaa06('0x55')][_0xaa06('0x6f')]=_0x4634a0['id'];if(_0x2d8d26[_0xaa06('0x4d')][_0xaa06('0x57')]){_0xf357b3[_0xaa06('0x55')]=_['merge'](_0xf357b3[_0xaa06('0x55')],{'$or':_['map'](_0xf357b3[_0xaa06('0x4f')],function(_0x33c829){var _0x1e9315={};_0x1e9315[_0x33c829]={'$like':'%'+_0x2d8d26[_0xaa06('0x4d')]['filter']+'%'};return _0x1e9315;})});}_0xf357b3=_[_0xaa06('0x58')]({},_0xf357b3,_0x2d8d26[_0xaa06('0x5a')]);return db[_0xaa06('0x72')][_0xaa06('0x21')]({'where':_0xf357b3[_0xaa06('0x55')]})[_0xaa06('0x13')](function(_0x40a23b){_0x1ab5d4[_0xaa06('0x21')]=_0x40a23b;if(_0x2d8d26[_0xaa06('0x4d')][_0xaa06('0x63')]){_0xf357b3[_0xaa06('0x73')]=[{'all':!![]}];}return db[_0xaa06('0x72')][_0xaa06('0x5c')](_0xf357b3);})[_0xaa06('0x13')](function(_0x591f8e){_0x1ab5d4[_0xaa06('0x5d')]=_0x591f8e;return _0x1ab5d4;});}})[_0xaa06('0x13')](respondWithFilteredResult(_0x587444,_0xf357b3))[_0xaa06('0x1b')](handleError(_0x587444,null));};exports[_0xaa06('0x74')]=function(_0x4844dc,_0x349782){return db['MailAccount']['find']({'where':{'id':_0x4844dc[_0xaa06('0x5f')]['id']}})['then'](handleEntityNotFound(_0x349782,null))['then'](function(_0x346320){if(_0x346320){return _0x346320[_0xaa06('0x74')](_0x4844dc[_0xaa06('0x4d')][_0xaa06('0x71')]);}})[_0xaa06('0x13')](respondWithStatusCode(_0x349782,null))[_0xaa06('0x1b')](handleError(_0x349782,null));};exports[_0xaa06('0x6c')]=function(_0x30c1bf,_0x304f66){var _0x35ae0f={'name':_0x30c1bf['body'][_0xaa06('0x2b')],'key':_0x30c1bf[_0xaa06('0x64')][_0xaa06('0x4b')],'provider':_0x30c1bf['body'][_0xaa06('0x65')]===_0xaa06('0x66')?null:_0x30c1bf['body'][_0xaa06('0x65')],'email':_0x30c1bf[_0xaa06('0x64')][_0xaa06('0x75')],'ListId':_0x30c1bf['body'][_0xaa06('0x76')],'active':!_[_0xaa06('0x77')](_0x30c1bf[_0xaa06('0x64')][_0xaa06('0x78')])?_0x30c1bf[_0xaa06('0x64')]['active']:!![],'description':_0x30c1bf[_0xaa06('0x64')][_0xaa06('0x79')]||null};var _0x437f05=getAuthenticationOptions(_0x35ae0f[_0xaa06('0x65')],_0x30c1bf['body']);_0x35ae0f['Imap']=_0x437f05['Imap'];_0x35ae0f[_0xaa06('0x42')]=_0x437f05[_0xaa06('0x42')];return db[_0xaa06('0x5b')]['create'](_0x35ae0f,{'include':[{'model':db[_0xaa06('0x44')],'as':'Smtp'},{'model':db[_0xaa06('0x60')],'as':_0xaa06('0x41')}]})[_0xaa06('0x13')](function(_0x349d99){var _0x57b807=_0x30c1bf[_0xaa06('0x3f')]['get']({'plain':!![]});if(!_0x57b807)throw new Error(_0xaa06('0x7a'));if(_0x57b807[_0xaa06('0x7b')]==='user'){var _0x21f02e=_0x349d99[_0xaa06('0x27')]({'plain':!![]});return db[_0xaa06('0x7c')]['find']({'where':{'name':_0xaa06('0x7d'),'userProfileId':_0x57b807[_0xaa06('0x7e')]},'raw':!![]})[_0xaa06('0x13')](function(_0x58330f){if(_0x58330f&&_0x58330f['autoAssociation']===0x0){return db[_0xaa06('0x28')][_0xaa06('0x6c')]({'name':_0x21f02e[_0xaa06('0x2b')],'resourceId':_0x21f02e['id'],'type':_0x58330f[_0xaa06('0x2b')],'sectionId':_0x58330f['id']},{})[_0xaa06('0x13')](function(){return _0x349d99;});}else{return _0x349d99;}})[_0xaa06('0x1b')](function(_0x5e2379){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5e2379);throw _0x5e2379;});}return _0x349d99;})[_0xaa06('0x13')](respondWithResult(_0x304f66,0xc9))[_0xaa06('0x1b')](handleError(_0x304f66,null));};exports['getImap']=function(_0x57cc6f,_0x4ad894){return db[_0xaa06('0x5b')][_0xaa06('0x6d')]({'where':{'id':_0x57cc6f[_0xaa06('0x5f')]['id']}})['then'](handleEntityNotFound(_0x4ad894,null))[_0xaa06('0x13')](function(_0x46b74b){if(_0x46b74b){return _0x46b74b[_0xaa06('0x7f')]();}return null;})[_0xaa06('0x13')](respondWithResult(_0x4ad894,null))[_0xaa06('0x1b')](handleError(_0x4ad894,null));};exports['addImap']=function(_0x4a8504,_0x44fa84){if(_0x4a8504[_0xaa06('0x64')]['id']){delete _0x4a8504[_0xaa06('0x64')]['id'];}return db[_0xaa06('0x5b')][_0xaa06('0x68')]({'where':{'id':_0x4a8504[_0xaa06('0x5f')]['id']}})['then'](handleEntityNotFound(_0x44fa84,null))['then'](function(_0x528359){if(_0x528359){_0x4a8504['body'][_0xaa06('0x6f')]=_0x528359['id'];return db[_0xaa06('0x60')][_0xaa06('0x6c')](_0x4a8504['body']);}})[_0xaa06('0x13')](respondWithResult(_0x44fa84,null))['catch'](handleError(_0x44fa84,null));};exports['removeImap']=function(_0x3a1f90,_0x1f82f8){return db[_0xaa06('0x5b')][_0xaa06('0x6d')]({'where':{'id':_0x3a1f90[_0xaa06('0x5f')]['id']}})[_0xaa06('0x13')](handleEntityNotFound(_0x1f82f8,null))[_0xaa06('0x13')](function(_0xf83ed7){if(_0xf83ed7){return _0xf83ed7[_0xaa06('0x80')](null);}return null;})[_0xaa06('0x13')](respondWithStatusCode(_0x1f82f8,null))['catch'](handleError(_0x1f82f8,null));};exports['getSmtp']=function(_0x212523,_0x5c1d9b){return db[_0xaa06('0x5b')][_0xaa06('0x6d')]({'where':{'id':_0x212523[_0xaa06('0x5f')]['id']}})[_0xaa06('0x13')](handleEntityNotFound(_0x5c1d9b,null))[_0xaa06('0x13')](function(_0x397819){if(_0x397819){return _0x397819[_0xaa06('0x81')]();}return null;})[_0xaa06('0x13')](respondWithResult(_0x5c1d9b,null))[_0xaa06('0x1b')](handleError(_0x5c1d9b,null));};exports['addSmtp']=function(_0x484d22,_0x462e08){if(_0x484d22[_0xaa06('0x64')]['id']){delete _0x484d22[_0xaa06('0x64')]['id'];}return db['MailAccount'][_0xaa06('0x68')]({'where':{'id':_0x484d22[_0xaa06('0x5f')]['id']}})[_0xaa06('0x13')](handleEntityNotFound(_0x462e08,null))['then'](function(_0xdd54a5){if(_0xdd54a5){_0x484d22[_0xaa06('0x64')][_0xaa06('0x6f')]=_0xdd54a5['id'];return db[_0xaa06('0x44')][_0xaa06('0x6c')](_0x484d22['body']);}})[_0xaa06('0x13')](respondWithResult(_0x462e08,null))[_0xaa06('0x1b')](handleError(_0x462e08,null));};exports[_0xaa06('0x82')]=function(_0x19e1a2,_0x2ee7fa){return db['MailAccount'][_0xaa06('0x6d')]({'where':{'id':_0x19e1a2[_0xaa06('0x5f')]['id']}})[_0xaa06('0x13')](handleEntityNotFound(_0x2ee7fa,null))[_0xaa06('0x13')](function(_0x1825f9){if(_0x1825f9){return _0x1825f9['setSmtp'](null);}return null;})[_0xaa06('0x13')](respondWithStatusCode(_0x2ee7fa,null))[_0xaa06('0x1b')](handleError(_0x2ee7fa,null));};exports['addInteraction']=function(_0xcc8a6e,_0x3522d5){return db[_0xaa06('0x83')][_0xaa06('0x68')]({'where':{'id':_0xcc8a6e[_0xaa06('0x5f')]['id']}})[_0xaa06('0x13')](handleEntityNotFound(_0x3522d5,null))[_0xaa06('0x13')](function(_0x36fd88){if(_0x36fd88){return _0x36fd88[_0xaa06('0x84')](_0xcc8a6e[_0xaa06('0x64')]['ids'],_[_0xaa06('0x85')](_0xcc8a6e[_0xaa06('0x64')],[_0xaa06('0x71'),'id'])||{});}})[_0xaa06('0x13')](respondWithResult(_0x3522d5,null))[_0xaa06('0x1b')](handleError(_0x3522d5,null));};exports[_0xaa06('0x86')]=function(_0x2a6b90,_0x326575){var _0x35dfcc={'raw':![],'where':{}};var _0x5c276a={};var _0x2a1947={'count':0x0,'rows':[]};return db[_0xaa06('0x5b')]['findOne']({'where':{'id':_0x2a6b90['params']['id']}})[_0xaa06('0x13')](handleEntityNotFound(_0x326575,null))['then'](function(_0x4f5b92){if(_0x4f5b92){_0x5c276a[_0xaa06('0x4c')]=_[_0xaa06('0x61')](db[_0xaa06('0x83')][_0xaa06('0x48')]);_0x5c276a[_0xaa06('0x4d')]=_[_0xaa06('0x61')](_0x2a6b90[_0xaa06('0x4d')]);_0x5c276a['filters']=_[_0xaa06('0x4e')](_0x5c276a[_0xaa06('0x4c')],_0x5c276a['query']);_0x35dfcc['attributes']=_[_0xaa06('0x4e')](_0x5c276a[_0xaa06('0x4c')],qs['fields'](_0x2a6b90[_0xaa06('0x4d')][_0xaa06('0x50')]));_0x35dfcc[_0xaa06('0x4f')]=_0x35dfcc[_0xaa06('0x4f')][_0xaa06('0x51')]?_0x35dfcc['attributes']:_0x5c276a[_0xaa06('0x4c')];if(!_0x2a6b90[_0xaa06('0x4d')][_0xaa06('0x52')](_0xaa06('0x53'))){_0x35dfcc['limit']=qs[_0xaa06('0x1f')](_0x2a6b90[_0xaa06('0x4d')][_0xaa06('0x1f')]);_0x35dfcc[_0xaa06('0x22')]=qs[_0xaa06('0x22')](_0x2a6b90[_0xaa06('0x4d')]['offset']);}_0x35dfcc[_0xaa06('0x6e')]=qs['sort'](_0x2a6b90['query'][_0xaa06('0x54')]);_0x35dfcc[_0xaa06('0x55')]=qs[_0xaa06('0x62')](_[_0xaa06('0x56')](_0x2a6b90[_0xaa06('0x4d')],_0x5c276a[_0xaa06('0x62')]));_0x35dfcc[_0xaa06('0x55')][_0xaa06('0x6f')]=_0x4f5b92['id'];if(_0x2a6b90['query'][_0xaa06('0x57')]){_0x35dfcc[_0xaa06('0x55')]=_[_0xaa06('0x58')](_0x35dfcc[_0xaa06('0x55')],{'$or':_['map'](_0x35dfcc['attributes'],function(_0x1324cf){var _0x104286={};_0x104286[_0x1324cf]={'$like':'%'+_0x2a6b90['query']['filter']+'%'};return _0x104286;})});}_0x35dfcc=_[_0xaa06('0x58')]({},_0x35dfcc,_0x2a6b90[_0xaa06('0x5a')]);return db[_0xaa06('0x83')][_0xaa06('0x21')]({'where':_0x35dfcc[_0xaa06('0x55')]})[_0xaa06('0x13')](function(_0x4aa430){_0x2a1947['count']=_0x4aa430;if(_0x2a6b90[_0xaa06('0x4d')][_0xaa06('0x63')]){_0x35dfcc['include']=[{'model':db[_0xaa06('0x87')],'as':_0xaa06('0x88'),'required':![]},{'model':db['User'],'as':'Owner','attributes':[_0xaa06('0x2b'),'fullname',_0xaa06('0x89')],'required':![]},{'model':db[_0xaa06('0x8a')],'as':_0xaa06('0x8b'),'attributes':['id',_0xaa06('0x2b'),'color'],'where':_0x2a6b90[_0xaa06('0x4d')]['tag']?{'id':_0x2a6b90[_0xaa06('0x4d')]['tag']}:undefined,'required':_0x2a6b90[_0xaa06('0x4d')][_0xaa06('0x8c')]?!![]:![]}];}return db['MailInteraction'][_0xaa06('0x5c')](_0x35dfcc);})[_0xaa06('0x13')](function(_0x809b03){_0x2a1947[_0xaa06('0x5d')]=_0x809b03;return _0x2a1947;});}})[_0xaa06('0x13')](respondWithFilteredResult(_0x326575,_0x35dfcc))['catch'](handleError(_0x326575,null));};exports['addApplications']=function addApplications(_0x2a0d9b,_0x29c3db){var _0x15908f=_0x2a0d9b['params']['id'];var _0x5a55ae=_0x2a0d9b[_0xaa06('0x64')];var _0x16f3f0=0xc8;var _0x1ae9b3=null;return db[_0xaa06('0x8d')][_0xaa06('0x8e')]({'isolationLevel':db[_0xaa06('0x8d')]['Transaction'][_0xaa06('0x8f')][_0xaa06('0x90')]},function(_0x2b013b){return db[_0xaa06('0x5b')][_0xaa06('0x6d')]({'where':{'id':_0x15908f},'transaction':_0x2b013b})[_0xaa06('0x13')](function(_0x1a3910){if(_0x1a3910){return db[_0xaa06('0x91')][_0xaa06('0x26')]({'where':{'MailAccountId':_0x15908f},'transaction':_0x2b013b})[_0xaa06('0x13')](function(){var _0x4378c0=_[_0xaa06('0x47')](_0x5a55ae,function(_0x40b507){_0x40b507[_0xaa06('0x6f')]=_0x15908f;return _0x40b507;});return db['MailApplication']['bulkCreate'](_0x4378c0,{'transaction':_0x2b013b});});}else{_0x16f3f0=0x194;_0x1ae9b3=[];}});})['then'](function(){if(_0x16f3f0!==0x194){return db['MailApplication'][_0xaa06('0x92')]({'where':{'MailAccountId':_0x15908f},'order':_0xaa06('0x93')})[_0xaa06('0x13')](function(_0x496299){_0x1ae9b3=_0x496299;});}})[_0xaa06('0x1b')](function(_0x447073){_0x16f3f0=0x1f4;logger[_0xaa06('0x17')](_0x447073[_0xaa06('0x2a')]);if(_0x447073[_0xaa06('0x2b')]){delete _0x447073[_0xaa06('0x2b')];}_0x1ae9b3=_0x447073;})[_0xaa06('0x94')](function(){if(_0x1ae9b3===null){_0x29c3db['sendStatus'](_0x16f3f0);}else{if(_0x16f3f0===0x1f4){_0x29c3db[_0xaa06('0x1d')](_0x16f3f0)['send'](_0x1ae9b3);}else{_0x29c3db['status'](_0x16f3f0)['json'](_0x1ae9b3);}}});};exports[_0xaa06('0x95')]=function(_0x2139e2,_0x23219c){var _0x2a83ef={};var _0x4f1cab={};var _0x889a22;var _0xcd753e;return db[_0xaa06('0x5b')]['findOne']({'where':{'id':_0x2139e2['params']['id']}})[_0xaa06('0x13')](handleEntityNotFound(_0x23219c,null))[_0xaa06('0x13')](function(_0x5b3843){if(_0x5b3843){_0x889a22=_0x5b3843;_0x4f1cab['model']=_[_0xaa06('0x61')](db['MailApplication'][_0xaa06('0x48')]);_0x4f1cab[_0xaa06('0x4d')]=_[_0xaa06('0x61')](_0x2139e2[_0xaa06('0x4d')]);_0x4f1cab[_0xaa06('0x62')]=_['intersection'](_0x4f1cab[_0xaa06('0x4c')],_0x4f1cab[_0xaa06('0x4d')]);_0x2a83ef['attributes']=_[_0xaa06('0x4e')](_0x4f1cab[_0xaa06('0x4c')],qs[_0xaa06('0x50')](_0x2139e2['query']['fields']));_0x2a83ef[_0xaa06('0x4f')]=_0x2a83ef[_0xaa06('0x4f')][_0xaa06('0x51')]?_0x2a83ef['attributes']:_0x4f1cab['model'];_0x2a83ef[_0xaa06('0x6e')]=qs[_0xaa06('0x54')](_0x2139e2[_0xaa06('0x4d')]['sort']);_0x2a83ef[_0xaa06('0x55')]=qs[_0xaa06('0x62')](_[_0xaa06('0x56')](_0x2139e2[_0xaa06('0x4d')],_0x4f1cab['filters']));if(_0x2139e2['query'][_0xaa06('0x57')]){_0x2a83ef[_0xaa06('0x55')]=_['merge'](_0x2a83ef[_0xaa06('0x55')],{'$or':_[_0xaa06('0x47')](_0x2a83ef['attributes'],function(_0x3fde19){var _0xd35a8d={};_0xd35a8d[_0x3fde19]={'$like':'%'+_0x2139e2[_0xaa06('0x4d')]['filter']+'%'};return _0xd35a8d;})});}_0x2a83ef=_[_0xaa06('0x58')]({},_0x2a83ef,_0x2139e2[_0xaa06('0x5a')]);return _0x889a22[_0xaa06('0x95')](_0x2a83ef);}})[_0xaa06('0x13')](function(_0x3a7cfc){if(_0x3a7cfc){_0xcd753e=_0x3a7cfc[_0xaa06('0x51')];if(!_0x2139e2[_0xaa06('0x4d')]['hasOwnProperty']('nolimit')){_0x2a83ef[_0xaa06('0x1f')]=qs[_0xaa06('0x1f')](_0x2139e2[_0xaa06('0x4d')][_0xaa06('0x1f')]);_0x2a83ef[_0xaa06('0x22')]=qs[_0xaa06('0x22')](_0x2139e2[_0xaa06('0x4d')][_0xaa06('0x22')]);}return _0x889a22[_0xaa06('0x95')](_0x2a83ef);}})[_0xaa06('0x13')](function(_0x29d66a){if(_0x29d66a){return _0x29d66a?{'count':_0xcd753e,'rows':_0x29d66a}:null;}})[_0xaa06('0x13')](respondWithResult(_0x23219c,null))['catch'](handleError(_0x23219c,null));};exports[_0xaa06('0x96')]=function(_0x3a79ea,_0x1b2152){var _0x58c13f={'raw':!![],'where':{}};var _0x314bb5={};var _0x111ed4={'count':0x0,'rows':[]};return db['MailAccount'][_0xaa06('0x6d')]({'where':{'id':_0x3a79ea[_0xaa06('0x5f')]['id']}})[_0xaa06('0x13')](handleEntityNotFound(_0x1b2152,null))['then'](function(_0x2d62f6){if(_0x2d62f6){_0x314bb5['model']=_['keys'](db[_0xaa06('0x97')]['rawAttributes']);_0x314bb5[_0xaa06('0x4d')]=_['keys'](_0x3a79ea[_0xaa06('0x4d')]);_0x314bb5[_0xaa06('0x62')]=_[_0xaa06('0x4e')](_0x314bb5['model'],_0x314bb5['query']);_0x58c13f[_0xaa06('0x4f')]=_[_0xaa06('0x4e')](_0x314bb5[_0xaa06('0x4c')],qs[_0xaa06('0x50')](_0x3a79ea['query']['fields']));_0x58c13f[_0xaa06('0x4f')]=_0x58c13f[_0xaa06('0x4f')][_0xaa06('0x51')]?_0x58c13f[_0xaa06('0x4f')]:_0x314bb5[_0xaa06('0x4c')];if(!_0x3a79ea[_0xaa06('0x4d')]['hasOwnProperty']('nolimit')){_0x58c13f[_0xaa06('0x1f')]=qs[_0xaa06('0x1f')](_0x3a79ea[_0xaa06('0x4d')][_0xaa06('0x1f')]);_0x58c13f[_0xaa06('0x22')]=qs['offset'](_0x3a79ea[_0xaa06('0x4d')]['offset']);}_0x58c13f[_0xaa06('0x6e')]=qs[_0xaa06('0x54')](_0x3a79ea[_0xaa06('0x4d')][_0xaa06('0x54')]);_0x58c13f['where']=qs['filters'](_[_0xaa06('0x56')](_0x3a79ea[_0xaa06('0x4d')],_0x314bb5[_0xaa06('0x62')]));_0x58c13f[_0xaa06('0x55')]['MailAccountId']=_0x2d62f6['id'];if(_0x3a79ea[_0xaa06('0x4d')]['filter']){_0x58c13f[_0xaa06('0x55')]=_[_0xaa06('0x58')](_0x58c13f[_0xaa06('0x55')],{'$or':_['map'](_0x58c13f['attributes'],function(_0x170535){var _0x3aa426={};_0x3aa426[_0x170535]={'$like':'%'+_0x3a79ea['query']['filter']+'%'};return _0x3aa426;})});}if(_0x3a79ea[_0xaa06('0x4d')][_0xaa06('0x98')]){var _0x1550a9=_0x3a79ea['query']['$gte'][_0xaa06('0x99')](',');var _0x1ffb23={};_0x1ffb23[_0x1550a9[0x0]]={'$gte':moment(_0x1550a9[0x1])[_0xaa06('0x9a')]('YYYY-MM-DD\x20HH:mm:ss')};_0x58c13f[_0xaa06('0x55')]=_['merge'](_0x58c13f[_0xaa06('0x55')],_0x1ffb23);}_0x58c13f=_['merge']({},_0x58c13f,_0x3a79ea[_0xaa06('0x5a')]);return db[_0xaa06('0x97')]['count']({'where':_0x58c13f[_0xaa06('0x55')]})[_0xaa06('0x13')](function(_0x24bf6c){_0x111ed4[_0xaa06('0x21')]=_0x24bf6c;if(_0x3a79ea[_0xaa06('0x4d')][_0xaa06('0x63')]){_0x58c13f[_0xaa06('0x73')]=[{'all':!![]}];}return db[_0xaa06('0x97')][_0xaa06('0x5c')](_0x58c13f);})['then'](function(_0x53302d){if(_0x3a79ea[_0xaa06('0x4d')][_0xaa06('0x9b')]==='true'){for(var _0xed9e17=0x0;_0xed9e17<_0x53302d[_0xaa06('0x51')];_0xed9e17++){_0x53302d[_0xed9e17]['body']=juice(_0x53302d[_0xed9e17][_0xaa06('0x64')]);}}_0x111ed4['rows']=_0x53302d;return _0x111ed4;});}})[_0xaa06('0x13')](respondWithFilteredResult(_0x1b2152,_0x58c13f))[_0xaa06('0x1b')](handleError(_0x1b2152,null));};exports[_0xaa06('0x2c')]=function(_0x3ca3c5,_0x304915){var _0x566a3b,_0x42ce31={},_0xb6657;if(_0x3ca3c5[_0xaa06('0x64')]['to']){_0xb6657=_0x3ca3c5[_0xaa06('0x64')]['to'][_0xaa06('0x99')](',')[0x0];}return db[_0xaa06('0x5b')]['find']({'where':{'id':_0x3ca3c5[_0xaa06('0x5f')]['id']},'include':[{'model':db['CmList'],'as':_0xaa06('0x9c'),'include':[{'model':db[_0xaa06('0x87')],'as':_0xaa06('0x9d'),'where':{'email':_0xb6657},'limit':0x1,'order':[['updatedAt',_0xaa06('0x9e')]]}]},{'model':db['MailServerOut'],'as':'Smtp','raw':!![],'include':[{'model':db['CloudProvider'],'as':_0xaa06('0x9f'),'raw':!![]}]}]})[_0xaa06('0x13')](handleEntityNotFound(_0x304915,null))[_0xaa06('0x13')](function(_0xf4beb3){if(!_0xf4beb3)return;_0x566a3b=_0xf4beb3;if(!_0xf4beb3[_0xaa06('0x42')])throw new Error(_0xaa06('0xa0'));if(_['isNil'](_0x3ca3c5[_0xaa06('0x64')][_0xaa06('0xa1')])){_0x3ca3c5[_0xaa06('0x64')][_0xaa06('0xa1')]=util[_0xaa06('0x9a')](_0xaa06('0xa2'),_0xf4beb3[_0xaa06('0x2b')],_0xf4beb3[_0xaa06('0x75')]||_0xf4beb3[_0xaa06('0x42')][_0xaa06('0x3f')]);}if(_0x3ca3c5[_0xaa06('0x64')][_0xaa06('0xa3')]&&_0x3ca3c5[_0xaa06('0x64')][_0xaa06('0xa3')][_0xaa06('0x51')]){for(var _0x452654=0x0;_0x452654<_0x3ca3c5['body'][_0xaa06('0xa3')][_0xaa06('0x51')];_0x452654+=0x1){_0x3ca3c5[_0xaa06('0x64')]['attachments'][_0x452654]={'filename':_0x3ca3c5[_0xaa06('0x64')][_0xaa06('0xa3')][_0x452654][_0xaa06('0x2b')],'path':path[_0xaa06('0xa4')](config[_0xaa06('0xa5')],_0xaa06('0xa6'),_0x3ca3c5[_0xaa06('0x64')]['attachments'][_0x452654][_0xaa06('0xa7')])};}}var _0x1531cd=_0xf4beb3[_0xaa06('0xa8')]();return respondWithRpcPromise(_0xaa06('0xa9'),'sendMail',{'account':_0x1531cd,'message':_0x3ca3c5['body']});})['then'](function(_0x161032){if(!_0x161032)return;_0x42ce31=_0x161032;if(!_0x566a3b[_0xaa06('0x9c')])throw new Error(_0xaa06('0xaa'));if(_0x566a3b['List'][_0xaa06('0x9d')][_0xaa06('0x51')])return _0x566a3b['List'][_0xaa06('0x9d')][0x0];return db[_0xaa06('0x87')][_0xaa06('0x6c')](_['defaults'](_0x3ca3c5[_0xaa06('0x64')],{'firstName':_0x3ca3c5[_0xaa06('0x64')]['to'],'email':_0x3ca3c5[_0xaa06('0x64')]['to'],'phone':_0x3ca3c5[_0xaa06('0x64')]['to'],'ListId':_0x566a3b[_0xaa06('0x76')]}));})[_0xaa06('0x13')](function(_0x2da1b7){if(!_0x2da1b7)return;var _0xe63abd={'UserId':_0x3ca3c5[_0xaa06('0x3f')]['id'],'ContactId':_0x2da1b7['id'],'MailAccountId':_0x566a3b['id'],'inReplyTo':_0x42ce31[_0xaa06('0xab')],'to':_0x3ca3c5[_0xaa06('0x64')][_0xaa06('0xa1')],'cc':_0x3ca3c5['body']['cc'],'subject':_0x3ca3c5['body'][_0xaa06('0xac')],'attach':_0x3ca3c5[_0xaa06('0x64')][_0xaa06('0xad')],'firstMsgDirection':_0xaa06('0xae'),'lastMsgAt':moment()['format'](_0xaa06('0xaf')),'lastMsgDirection':_0xaa06('0xae'),'Messages':[_[_0xaa06('0x58')](_0x3ca3c5[_0xaa06('0x64')],{'messageId':_0x42ce31[_0xaa06('0xab')],'sentAt':moment()[_0xaa06('0x9a')](_0xaa06('0xaf')),'read':!![],'MailAccountId':_0x566a3b['id'],'UserId':_0x3ca3c5['user']['id'],'ContactId':_0x2da1b7['id']})]};if(_0x3ca3c5[_0xaa06('0x64')][_0xaa06('0xb0')]){_0xe63abd=_['merge'](_0xe63abd,_0x3ca3c5[_0xaa06('0x64')]['Interaction']);}return db[_0xaa06('0x83')][_0xaa06('0x6c')](_0xe63abd,{'include':[{'model':db[_0xaa06('0x97')],'as':_0xaa06('0xb1')}]});})[_0xaa06('0x13')](respondWithResult(_0x304915,null))[_0xaa06('0x1b')](handleError(_0x304915,null));};exports['verifySmtp']=function(_0x2f4f64,_0x4b4127){return db['MailAccount']['find']({'where':{'id':_0x2f4f64[_0xaa06('0x5f')]['id']},'include':[{'model':db[_0xaa06('0x44')],'as':_0xaa06('0x42'),'raw':!![],'include':[{'model':db[_0xaa06('0x9f')],'as':'CloudProvider','raw':!![]}]}]})[_0xaa06('0x13')](handleEntityNotFound(_0x4b4127,null))[_0xaa06('0x13')](function(_0x6e6e7f){if(!_0x6e6e7f[_0xaa06('0x42')])return;var _0x90f86d=_0x6e6e7f['getSmtpOptions']();return respondWithRpcPromise(_0xaa06('0xb2'),_0xaa06('0xb3'),{'account':_0x90f86d});})['then'](respondWithResult(_0x4b4127,null))[_0xaa06('0x1b')](handleError(_0x4b4127,null));};exports[_0xaa06('0x26')]=function(_0x4f498a,_0x49959d){return db[_0xaa06('0x5b')][_0xaa06('0x68')]({'where':{'id':_0x4f498a[_0xaa06('0x5f')]['id']}})[_0xaa06('0x13')](handleEntityNotFound(_0x49959d,null))[_0xaa06('0x13')](function(_0x57c97a){if(_0x57c97a&&_0x57c97a[_0xaa06('0x3d')]){throw new db[(_0xaa06('0xb4'))][(_0xaa06('0xb5'))](_0xaa06('0xb6'));}return _0x57c97a;})['then'](removeEntity(_0x49959d,null))[_0xaa06('0x1b')](handleError(_0x49959d,null));};exports['addAgents']=function(_0x13604c,_0x515c6e){return db[_0xaa06('0x5b')][_0xaa06('0x68')]({'where':{'id':_0x13604c[_0xaa06('0x5f')]['id']}})[_0xaa06('0x13')](handleEntityNotFound(_0x515c6e,null))[_0xaa06('0x13')](function(_0x581ccd){if(_0x581ccd){return _0x581ccd['addAgents'](_0x13604c[_0xaa06('0x64')][_0xaa06('0x71')],_[_0xaa06('0x85')](_0x13604c[_0xaa06('0x64')],[_0xaa06('0x71'),'id'])||{})[_0xaa06('0xb7')](function(_0x43600b){for(var _0x326e61=0x0;_0x326e61<_0x13604c[_0xaa06('0x64')][_0xaa06('0x71')]['length'];_0x326e61+=0x1){socket[_0xaa06('0xb8')](_0xaa06('0xb9'),{'UserId':Number(_0x13604c[_0xaa06('0x64')][_0xaa06('0x71')][_0x326e61]),'MailAccountId':Number(_0x13604c[_0xaa06('0x5f')]['id'])});}return _0x43600b;});}})['then'](respondWithResult(_0x515c6e,null))[_0xaa06('0x1b')](handleError(_0x515c6e,null));};exports[_0xaa06('0xba')]=function(_0x144ac2,_0x64c3f4){return db[_0xaa06('0x5b')][_0xaa06('0x68')]({'where':{'id':_0x144ac2['params']['id']}})['then'](handleEntityNotFound(_0x64c3f4,null))[_0xaa06('0x13')](function(_0x55d69e){if(_0x55d69e){return _0x55d69e['removeAgents'](_0x144ac2['query'][_0xaa06('0x71')])[_0xaa06('0x13')](function(){if(_[_0xaa06('0xbb')](_0x144ac2[_0xaa06('0x4d')][_0xaa06('0x71')])){for(var _0x1c711d=0x0;_0x1c711d<_0x144ac2[_0xaa06('0x4d')]['ids'][_0xaa06('0x51')];_0x1c711d+=0x1){socket[_0xaa06('0xb8')]('userMailAccount:remove',{'UserId':Number(_0x144ac2[_0xaa06('0x4d')][_0xaa06('0x71')][_0x1c711d]),'MailAccountId':Number(_0x144ac2['params']['id'])});}}else{socket[_0xaa06('0xb8')](_0xaa06('0xbc'),{'UserId':Number(_0x144ac2['query']['ids']),'MailAccountId':Number(_0x144ac2['params']['id'])});}});}})['then'](respondWithStatusCode(_0x64c3f4,null))[_0xaa06('0x1b')](handleError(_0x64c3f4,null));};exports[_0xaa06('0xbd')]=function(_0x3f42ef,_0x4e5a05){var _0x2a95d6={};var _0x68d2cd={};var _0x4b7512;var _0x5ed63f;return db[_0xaa06('0x5b')]['findOne']({'where':{'id':_0x3f42ef[_0xaa06('0x5f')]['id']}})[_0xaa06('0x13')](handleEntityNotFound(_0x4e5a05,null))[_0xaa06('0x13')](function(_0x5a20a7){if(_0x5a20a7){_0x4b7512=_0x5a20a7;_0x68d2cd[_0xaa06('0x4c')]=_[_0xaa06('0x61')](db[_0xaa06('0xbe')][_0xaa06('0x48')]);_0x68d2cd[_0xaa06('0x4d')]=_[_0xaa06('0x61')](_0x3f42ef[_0xaa06('0x4d')]);_0x68d2cd[_0xaa06('0x62')]=_[_0xaa06('0x4e')](_0x68d2cd[_0xaa06('0x4c')],_0x68d2cd[_0xaa06('0x4d')]);_0x2a95d6['attributes']=_[_0xaa06('0x4e')](_0x68d2cd[_0xaa06('0x4c')],qs[_0xaa06('0x50')](_0x3f42ef[_0xaa06('0x4d')][_0xaa06('0x50')]));_0x2a95d6[_0xaa06('0x4f')]=_0x2a95d6[_0xaa06('0x4f')][_0xaa06('0x51')]?_0x2a95d6['attributes']:_0x68d2cd['model'];_0x2a95d6['order']=qs[_0xaa06('0x54')](_0x3f42ef[_0xaa06('0x4d')][_0xaa06('0x54')]);_0x2a95d6[_0xaa06('0x55')]=qs[_0xaa06('0x62')](_[_0xaa06('0x56')](_0x3f42ef[_0xaa06('0x4d')],_0x68d2cd[_0xaa06('0x62')]));if(_0x3f42ef[_0xaa06('0x4d')]['filter']){_0x2a95d6[_0xaa06('0x55')]=_['merge'](_0x2a95d6[_0xaa06('0x55')],{'$or':_[_0xaa06('0x47')](_0x2a95d6[_0xaa06('0x4f')],function(_0xe80fe5){var _0x1c0965={};_0x1c0965[_0xe80fe5]={'$like':'%'+_0x3f42ef[_0xaa06('0x4d')][_0xaa06('0x57')]+'%'};return _0x1c0965;})});}_0x2a95d6=_[_0xaa06('0x58')]({},_0x2a95d6,_0x3f42ef[_0xaa06('0x5a')]);return _0x4b7512[_0xaa06('0xbd')](_0x2a95d6);}})[_0xaa06('0x13')](function(_0x1d906f){if(_0x1d906f){_0x5ed63f=_0x1d906f['length'];if(!_0x3f42ef[_0xaa06('0x4d')]['hasOwnProperty'](_0xaa06('0x53'))){_0x2a95d6[_0xaa06('0x1f')]=qs[_0xaa06('0x1f')](_0x3f42ef[_0xaa06('0x4d')][_0xaa06('0x1f')]);_0x2a95d6['offset']=qs['offset'](_0x3f42ef[_0xaa06('0x4d')]['offset']);}return _0x4b7512[_0xaa06('0xbd')](_0x2a95d6);}})['then'](function(_0x2be2a8){if(_0x2be2a8){return _0x2be2a8?{'count':_0x5ed63f,'rows':_0x2be2a8}:null;}})['then'](respondWithResult(_0x4e5a05,null))[_0xaa06('0x1b')](handleError(_0x4e5a05,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index 0dc966e..b0d4cab 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 _0x9dfc=['update','remove','emit','hasOwnProperty','exports','events','save'];(function(_0x27f378,_0x4716d2){var _0xcf5395=function(_0x395bd5){while(--_0x395bd5){_0x27f378['push'](_0x27f378['shift']());}};_0xcf5395(++_0x4716d2);}(_0x9dfc,0x140));var _0xc9df=function(_0x4b96a1,_0x1284b6){_0x4b96a1=_0x4b96a1-0x0;var _0x1f0b0c=_0x9dfc[_0x4b96a1];return _0x1f0b0c;};'use strict';var EventEmitter=require(_0xc9df('0x0'));var MailAccount=require('../../mysqldb')['db']['MailAccount'];var MailAccountEvents=new EventEmitter();MailAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc9df('0x1'),'afterUpdate':_0xc9df('0x2'),'afterDestroy':_0xc9df('0x3')};function emitEvent(_0xf2621e){return function(_0x336c0a,_0x19b2c7,_0x147adf){MailAccountEvents[_0xc9df('0x4')](_0xf2621e+':'+_0x336c0a['id'],_0x336c0a);MailAccountEvents[_0xc9df('0x4')](_0xf2621e,_0x336c0a);_0x147adf(null);};}for(var e in events){if(events[_0xc9df('0x5')](e)){var event=events[e];MailAccount['hook'](e,emitEvent(event));}}module[_0xc9df('0x6')]=MailAccountEvents; \ No newline at end of file +var _0x0eb2=['update','remove','emit','hasOwnProperty','hook','events','MailAccount','setMaxListeners','save'];(function(_0x227ebe,_0x5e2c09){var _0x40aad2=function(_0x22756e){while(--_0x22756e){_0x227ebe['push'](_0x227ebe['shift']());}};_0x40aad2(++_0x5e2c09);}(_0x0eb2,0x11c));var _0x20eb=function(_0x56407a,_0x51ab09){_0x56407a=_0x56407a-0x0;var _0x2e7c2e=_0x0eb2[_0x56407a];return _0x2e7c2e;};'use strict';var EventEmitter=require(_0x20eb('0x0'));var MailAccount=require('../../mysqldb')['db'][_0x20eb('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x20eb('0x2')](0x0);var events={'afterCreate':_0x20eb('0x3'),'afterUpdate':_0x20eb('0x4'),'afterDestroy':_0x20eb('0x5')};function emitEvent(_0x525ecf){return function(_0x118292,_0x59e891,_0x48d831){MailAccountEvents['emit'](_0x525ecf+':'+_0x118292['id'],_0x118292);MailAccountEvents[_0x20eb('0x6')](_0x525ecf,_0x118292);_0x48d831(null);};}for(var e in events){if(events[_0x20eb('0x7')](e)){var event=events[e];MailAccount[_0x20eb('0x8')](e,emitEvent(event));}}module['exports']=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index 644d708..f3ced9b 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 _0x4033=['port','secure','CloudProvider','auth','OAuth2','user','pass','./mailAccount.attributes','exports','define','MailAccount','mail_accounts','custom','service','provider','host','Smtp'];(function(_0x4f0e62,_0x28e44f){var _0x117ab8=function(_0x1a74bb){while(--_0x1a74bb){_0x4f0e62['push'](_0x4f0e62['shift']());}};_0x117ab8(++_0x28e44f);}(_0x4033,0xb1));var _0x3403=function(_0x29dda1,_0x508e13){_0x29dda1=_0x29dda1-0x0;var _0x21b0ef=_0x4033[_0x29dda1];return _0x21b0ef;};'use strict';var attributes=require(_0x3403('0x0'));module[_0x3403('0x1')]=function(_0x45bf36){return _0x45bf36[_0x3403('0x2')](_0x3403('0x3'),attributes,{'tableName':_0x3403('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x58be13=this;var _0x531b6c={'id':_0x58be13['id'],'tls':{'rejectUnauthorized':![]}};if(_0x58be13['provider']!==_0x3403('0x5')){_0x531b6c[_0x3403('0x6')]=_0x58be13[_0x3403('0x7')];}else{_0x531b6c[_0x3403('0x8')]=_0x58be13[_0x3403('0x9')][_0x3403('0x8')];_0x531b6c[_0x3403('0xa')]=_0x58be13['Smtp']['port'];_0x531b6c[_0x3403('0xb')]=_0x58be13[_0x3403('0x9')][_0x3403('0xb')];}if(_0x58be13[_0x3403('0x9')]['authentication']){if(_0x58be13[_0x3403('0x9')]['modernAuthentication']){if(!_0x58be13['Smtp'][_0x3403('0xc')])throw new Error('Cloud\x20Provider\x20configuration\x20not\x20found');_0x531b6c[_0x3403('0xd')]={'type':_0x3403('0xe'),'user':_0x58be13[_0x3403('0x9')][_0x3403('0xf')],'accessToken':_0x58be13[_0x3403('0x9')][_0x3403('0xc')]['data5']};}else{_0x531b6c['auth']={'user':_0x58be13[_0x3403('0x9')][_0x3403('0xf')],'pass':_0x58be13[_0x3403('0x9')][_0x3403('0x10')]};}}return _0x531b6c;}}});}; \ No newline at end of file +var _0xc9bb=['mail_accounts','provider','custom','Smtp','host','port','secure','authentication','modernAuthentication','CloudProvider','Cloud\x20Provider\x20configuration\x20not\x20found','OAuth2','user','data5','pass','./mailAccount.attributes','exports','MailAccount'];(function(_0xb0db87,_0x5c8d71){var _0x4a68e1=function(_0x4a5b17){while(--_0x4a5b17){_0xb0db87['push'](_0xb0db87['shift']());}};_0x4a68e1(++_0x5c8d71);}(_0xc9bb,0x12f));var _0xbc9b=function(_0x16dced,_0x2f8d60){_0x16dced=_0x16dced-0x0;var _0x40e9d7=_0xc9bb[_0x16dced];return _0x40e9d7;};'use strict';var attributes=require(_0xbc9b('0x0'));module[_0xbc9b('0x1')]=function(_0x1c4bf8){return _0x1c4bf8['define'](_0xbc9b('0x2'),attributes,{'tableName':_0xbc9b('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x4c2d1a=this;var _0x1b8f4d={'id':_0x4c2d1a['id'],'tls':{'rejectUnauthorized':![]}};if(_0x4c2d1a[_0xbc9b('0x4')]!==_0xbc9b('0x5')){_0x1b8f4d['service']=_0x4c2d1a[_0xbc9b('0x4')];}else{_0x1b8f4d['host']=_0x4c2d1a[_0xbc9b('0x6')][_0xbc9b('0x7')];_0x1b8f4d['port']=_0x4c2d1a['Smtp'][_0xbc9b('0x8')];_0x1b8f4d[_0xbc9b('0x9')]=_0x4c2d1a[_0xbc9b('0x6')]['secure'];}if(_0x4c2d1a[_0xbc9b('0x6')][_0xbc9b('0xa')]){if(_0x4c2d1a[_0xbc9b('0x6')][_0xbc9b('0xb')]){if(!_0x4c2d1a[_0xbc9b('0x6')][_0xbc9b('0xc')])throw new Error(_0xbc9b('0xd'));_0x1b8f4d['auth']={'type':_0xbc9b('0xe'),'user':_0x4c2d1a[_0xbc9b('0x6')][_0xbc9b('0xf')],'accessToken':_0x4c2d1a[_0xbc9b('0x6')][_0xbc9b('0xc')][_0xbc9b('0x10')]};}else{_0x1b8f4d['auth']={'user':_0x4c2d1a[_0xbc9b('0x6')][_0xbc9b('0xf')],'pass':_0x4c2d1a[_0xbc9b('0x6')][_0xbc9b('0x11')]};}}return _0x1b8f4d;}}});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index 02fc8bf..25d6d0d 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 _0x9fe7=['length','List\x20not\x20found','contact','messageId','subject','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','Messages','inReplyTo','Contact\x20not\x20found','spread','update','attach','interaction','created','create','attachments','originTo','originCc','ChatWebsiteId','Email','ChatOfflineMessageId','Attachments','UserId','User','name','unshift','waitForTheAssignedAgent','MailQueue','queue','waitForTheAssignedQueue','Start','startRouting','lodash','moment','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','defaults','redis','localhost','./mailAccount.socket','register','then','info','MailAccount,\x20%s,\x20%s','debug','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetMailAccount','MailAccount','options','raw','where','include','model','attributes','map','ShowMailAccount','find','smtp','setDataValue','smtpOptions','getSmtpOptions','NotifyMailAccount','body','mail','difference','rawAttributes','createdAt','updatedAt','CompanyId','ListId','from','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','List','CmContact','Contacts','DESC','MailApplication','Applications','MailServerOut','Smtp','CloudProvider','get','account','omit','list','orderBy','applications','priority','asc','autoclose','*,*,*,*'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x9fe7,0x1df));var _0x79fe=function(_0x555102,_0x1d5e79){_0x555102=_0x555102-0x0;var _0x40ef28=_0x9fe7[_0x555102];return _0x40ef28;};'use strict';var _=require(_0x79fe('0x0'));var moment=require(_0x79fe('0x1'));var BPromise=require('bluebird');var rs=require(_0x79fe('0x2'));var Redis=require('ioredis');var db=require(_0x79fe('0x3'))['db'];var logger=require(_0x79fe('0x4'))(_0x79fe('0x5'));var config=require('../../config/environment');var jayson=require(_0x79fe('0x6'));var client=jayson[_0x79fe('0x7')][_0x79fe('0x8')]({'port':0x232c});config['redis']=_[_0x79fe('0x9')](config[_0x79fe('0xa')],{'host':_0x79fe('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x79fe('0xa')]));require(_0x79fe('0xc'))[_0x79fe('0xd')](socket);function respondWithRpcPromise(_0x26d723,_0xafc7cd,_0x5b914a){return new BPromise(function(_0x34c217,_0x253f7d){return client['request'](_0x26d723,_0x5b914a)[_0x79fe('0xe')](function(_0x3c79f8){logger[_0x79fe('0xf')](_0x79fe('0x10'),_0xafc7cd,'request\x20sent');logger[_0x79fe('0x11')](_0x79fe('0x12'),_0xafc7cd,_0x79fe('0x13'),JSON[_0x79fe('0x14')](_0x3c79f8));if(_0x3c79f8[_0x79fe('0x15')]){if(_0x3c79f8[_0x79fe('0x15')][_0x79fe('0x16')]===0x1f4){logger[_0x79fe('0x15')]('MailAccount,\x20%s,\x20%s',_0xafc7cd,_0x3c79f8[_0x79fe('0x15')][_0x79fe('0x17')]);return _0x253f7d(_0x3c79f8[_0x79fe('0x15')][_0x79fe('0x17')]);}logger[_0x79fe('0x15')](_0x79fe('0x10'),_0xafc7cd,_0x3c79f8['error'][_0x79fe('0x17')]);return _0x34c217(_0x3c79f8[_0x79fe('0x15')][_0x79fe('0x17')]);}else{logger[_0x79fe('0xf')]('MailAccount,\x20%s,\x20%s',_0xafc7cd,_0x79fe('0x13'));_0x34c217(_0x3c79f8[_0x79fe('0x18')][_0x79fe('0x17')]);}})[_0x79fe('0x19')](function(_0x536641){logger['error'](_0x79fe('0x10'),_0xafc7cd,_0x536641);_0x253f7d(_0x536641);});});}exports[_0x79fe('0x1a')]=function(_0x25e51f){var _0x4bca4d=this;return new Promise(function(_0x891611,_0x4141ec){return db[_0x79fe('0x1b')]['findAll']({'raw':_0x25e51f[_0x79fe('0x1c')]?_0x25e51f['options'][_0x79fe('0x1d')]===undefined?!![]:![]:!![],'where':_0x25e51f[_0x79fe('0x1c')]?_0x25e51f[_0x79fe('0x1c')][_0x79fe('0x1e')]||null:null,'attributes':_0x25e51f[_0x79fe('0x1c')]?_0x25e51f[_0x79fe('0x1c')]['attributes']||null:null,'limit':_0x25e51f['options']?_0x25e51f[_0x79fe('0x1c')]['limit']||null:null,'include':_0x25e51f[_0x79fe('0x1c')]?_0x25e51f[_0x79fe('0x1c')]['include']?_['map'](_0x25e51f[_0x79fe('0x1c')][_0x79fe('0x1f')],function(_0x59339b){return{'model':db[_0x59339b[_0x79fe('0x20')]],'as':_0x59339b['as'],'attributes':_0x59339b[_0x79fe('0x21')],'include':_0x59339b['include']?_['map'](_0x59339b['include'],function(_0x3720fa){return{'model':db[_0x3720fa[_0x79fe('0x20')]],'as':_0x3720fa['as'],'attributes':_0x3720fa[_0x79fe('0x21')],'include':_0x3720fa['include']?_[_0x79fe('0x22')](_0x3720fa[_0x79fe('0x1f')],function(_0x3bc5bc){return{'model':db[_0x3bc5bc['model']],'as':_0x3bc5bc['as'],'attributes':_0x3bc5bc['attributes']};}):[]};}):[]};}):[]:[]})[_0x79fe('0xe')](function(_0x51200f){logger[_0x79fe('0xf')]('GetMailAccount',_0x25e51f);logger['debug']('GetMailAccount',_0x25e51f,JSON['stringify'](_0x51200f));_0x891611(_0x51200f);})[_0x79fe('0x19')](function(_0xd2ec88){logger['error'](_0x79fe('0x1a'),_0xd2ec88['message'],_0x25e51f);_0x4141ec(_0x4bca4d[_0x79fe('0x15')](0x1f4,_0xd2ec88[_0x79fe('0x17')]));});});};exports[_0x79fe('0x23')]=function(_0x3558f2){var _0x128ca3=this;return new Promise(function(_0x5ac1c4,_0x436279){return db[_0x79fe('0x1b')][_0x79fe('0x24')]({'raw':_0x3558f2[_0x79fe('0x1c')]?_0x3558f2[_0x79fe('0x1c')][_0x79fe('0x1d')]===undefined?!![]:![]:!![],'where':_0x3558f2['options']?_0x3558f2[_0x79fe('0x1c')][_0x79fe('0x1e')]||null:null,'attributes':_0x3558f2[_0x79fe('0x1c')]?_0x3558f2[_0x79fe('0x1c')][_0x79fe('0x21')]||null:null,'include':_0x3558f2[_0x79fe('0x1c')]?_0x3558f2['options'][_0x79fe('0x1f')]?_['map'](_0x3558f2[_0x79fe('0x1c')]['include'],function(_0x2a533b){return{'model':db[_0x2a533b['model']],'as':_0x2a533b['as'],'attributes':_0x2a533b[_0x79fe('0x21')],'include':_0x2a533b[_0x79fe('0x1f')]?_[_0x79fe('0x22')](_0x2a533b['include'],function(_0x174423){return{'model':db[_0x174423[_0x79fe('0x20')]],'as':_0x174423['as'],'attributes':_0x174423[_0x79fe('0x21')],'include':_0x174423[_0x79fe('0x1f')]?_[_0x79fe('0x22')](_0x174423['include'],function(_0x53957b){return{'model':db[_0x53957b[_0x79fe('0x20')]],'as':_0x53957b['as'],'attributes':_0x53957b['attributes']};}):[]};}):[]};}):[]:[]})[_0x79fe('0xe')](function(_0x44d97e){if(_0x3558f2['options'][_0x79fe('0x25')]===!![])_0x44d97e[_0x79fe('0x26')](_0x79fe('0x27'),_0x44d97e[_0x79fe('0x28')]());logger[_0x79fe('0xf')](_0x79fe('0x23'),_0x3558f2);logger['debug'](_0x79fe('0x23'),_0x3558f2,JSON[_0x79fe('0x14')](_0x44d97e));_0x5ac1c4(_0x44d97e);})[_0x79fe('0x19')](function(_0x2d2908){logger['error'](_0x79fe('0x23'),_0x2d2908['message'],_0x3558f2);_0x436279(_0x128ca3[_0x79fe('0x15')](0x1f4,_0x2d2908['message']));});});};exports[_0x79fe('0x29')]=function(_0x4ab42e){var _0x83737e=this;return new Promise(function(_0x132662,_0x577341){var _0x5e27bc={'body':_0x4ab42e[_0x79fe('0x2a')],'channel':_0x79fe('0x2b')};var _0x69ae72=_[_0x79fe('0x2c')](_['keys'](db['CmContact'][_0x79fe('0x2d')]),[_0x79fe('0x2e'),_0x79fe('0x2f'),_0x79fe('0x30'),_0x79fe('0x31')]);var _0x3feb46=![];if(_0x4ab42e[_0x79fe('0x2a')]['id']){delete _0x4ab42e[_0x79fe('0x2a')]['id'];}if(_['isNil'](_0x4ab42e[_0x79fe('0x2a')][_0x79fe('0x32')])){return _0x577341(_0x83737e[_0x79fe('0x15')](0x1f4,_0x79fe('0x33')));}if(_[_0x79fe('0x34')](_0x4ab42e[_0x79fe('0x2a')]['body'])||_0x4ab42e[_0x79fe('0x2a')][_0x79fe('0x2a')]===''){return _0x577341(_0x83737e[_0x79fe('0x15')](0x1f4,_0x79fe('0x35')));}if(_[_0x79fe('0x34')](_0x4ab42e[_0x79fe('0x2a')]['mapKey'])){return _0x577341(_0x83737e[_0x79fe('0x15')](0x1f4,_0x79fe('0x36')+_0x69ae72));}if(!_[_0x79fe('0x37')](_0x69ae72,_0x4ab42e['body'][_0x79fe('0x38')])){return _0x577341(_0x83737e['error'](0x1f4,'mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x69ae72));}var _0x28068f={};_0x28068f[_0x4ab42e[_0x79fe('0x2a')][_0x79fe('0x38')]]=_0x4ab42e['body'][_0x79fe('0x32')];return db[_0x79fe('0x1b')][_0x79fe('0x24')]({'where':{'id':_0x4ab42e['account']['id']},'include':[{'model':db['CmList'],'as':_0x79fe('0x39'),'include':[{'model':db[_0x79fe('0x3a')],'as':_0x79fe('0x3b'),'where':_0x28068f,'limit':0x1,'order':[[_0x79fe('0x2f'),_0x79fe('0x3c')]]}]},{'model':db[_0x79fe('0x3d')],'as':_0x79fe('0x3e')},{'model':db[_0x79fe('0x3f')],'as':_0x79fe('0x40'),'include':[{'model':db['CloudProvider'],'as':_0x79fe('0x41')}]}]})[_0x79fe('0xe')](function(_0x496486){if(_0x496486&&_0x496486[_0x79fe('0x39')]){var _0x4bd648=_0x496486[_0x79fe('0x42')]({'plain':!![]});_0x5e27bc[_0x79fe('0x43')]=_[_0x79fe('0x44')](_0x4bd648,[_0x79fe('0x3e'),'List']);_0x5e27bc[_0x79fe('0x43')][_0x79fe('0x27')]=_0x496486[_0x79fe('0x28')]();_0x5e27bc['applications']=_0x4bd648['Applications'];_0x5e27bc[_0x79fe('0x45')]=_0x4bd648[_0x79fe('0x39')];_0x5e27bc['applications']=_[_0x79fe('0x46')](_0x5e27bc[_0x79fe('0x47')],[_0x79fe('0x48')],[_0x79fe('0x49')]);if(_0x5e27bc['account']&&_0x5e27bc[_0x79fe('0x43')][_0x79fe('0x4a')]){_0x5e27bc[_0x79fe('0x47')]['push']({'id':0x0,'priority':_0x5e27bc['applications']['length']+0x1,'app':'close','appdata':'autoclose','interval':_0x79fe('0x4b')});}if(_0x5e27bc[_0x79fe('0x43')]['Applications']){delete _0x5e27bc[_0x79fe('0x43')][_0x79fe('0x3e')];}if(_0x5e27bc[_0x79fe('0x43')]['List']){delete _0x5e27bc['account']['List'];}if(_0x4bd648[_0x79fe('0x39')]['Contacts'][_0x79fe('0x4c')]){return _0x4bd648[_0x79fe('0x39')][_0x79fe('0x3b')][0x0];}var _0x1ac188=_[_0x79fe('0x9')](_0x4ab42e[_0x79fe('0x2a')],{'firstName':_0x4ab42e[_0x79fe('0x2a')][_0x79fe('0x32')],'ListId':_0x4bd648[_0x79fe('0x31')]});_0x1ac188[_0x4ab42e[_0x79fe('0x2a')][_0x79fe('0x38')]]=_0x4ab42e['body'][_0x79fe('0x32')];return db[_0x79fe('0x3a')]['create'](_0x1ac188);}else{throw new Error(_0x79fe('0x4d'));}})['then'](function(_0xc1ec58){_0x5e27bc[_0x79fe('0x4e')]=_0xc1ec58;if(_0xc1ec58){if(!_0x4ab42e['body'][_0x79fe('0x17')]['messageId']){_0x4ab42e[_0x79fe('0x2a')]['message']['messageId']=rs['generate']()+'\x20'+_0x4ab42e[_0x79fe('0x2a')][_0x79fe('0x17')][_0x79fe('0x32')];}var _0x350da0={'ContactId':_0xc1ec58['id'],'MailAccountId':_0x4ab42e[_0x79fe('0x43')]['id'],'inReplyTo':_0x4ab42e[_0x79fe('0x2a')][_0x79fe('0x17')][_0x79fe('0x4f')],'to':_0x4ab42e[_0x79fe('0x2a')]['message'][_0x79fe('0x32')],'cc':_0x4ab42e[_0x79fe('0x2a')][_0x79fe('0x17')]['cc'],'subject':_0x4ab42e[_0x79fe('0x2a')]['message'][_0x79fe('0x50')],'attach':_0x4ab42e['body'][_0x79fe('0x17')]['attach'],'lastMsgAt':moment()[_0x79fe('0x51')](_0x79fe('0x52')),'lastMsgDirection':'in'};return db[_0x79fe('0x53')][_0x79fe('0x24')]({'where':{'closed':![],'MailAccountId':_0x4ab42e['account']['id']},'include':[{'model':db[_0x79fe('0x54')],'as':_0x79fe('0x55'),'attributes':[_0x79fe('0x4f')],'where':{'messageId':_0x4ab42e[_0x79fe('0x2a')]['message'][_0x79fe('0x56')]}}]})[_0x79fe('0xe')](function(_0x50ed6c){if(_0x50ed6c){return[_0x50ed6c,![]];}return db[_0x79fe('0x53')]['create'](_0x350da0)['then'](function(_0x37ccea){return[_0x37ccea,!![]];});});}else{throw new Error(_0x79fe('0x57'));}})[_0x79fe('0x58')](function(_0x49de47,_0x58adb7){if(_0x49de47){_0x3feb46=_0x58adb7;if(!_0x58adb7){return _0x49de47[_0x79fe('0x59')]({'inReplyTo':_0x4ab42e['body']['message'][_0x79fe('0x4f')],'to':_0x4ab42e[_0x79fe('0x2a')][_0x79fe('0x17')][_0x79fe('0x32')],'cc':_0x4ab42e[_0x79fe('0x2a')][_0x79fe('0x17')]['cc'],'subject':_0x4ab42e[_0x79fe('0x2a')][_0x79fe('0x17')][_0x79fe('0x50')],'attach':_0x49de47['attach']?_0x49de47[_0x79fe('0x5a')]:_0x4ab42e[_0x79fe('0x2a')]['message'][_0x79fe('0x5a')],'substatus':null,'substatusAt':moment()[_0x79fe('0x51')](_0x79fe('0x52')),'lastMsgAt':moment()[_0x79fe('0x51')](_0x79fe('0x52')),'lastMsgDirection':'in'});}else{return _0x49de47;}}})[_0x79fe('0xe')](function(_0x6cf38e){_0x5e27bc[_0x79fe('0x5b')]=_0x6cf38e[_0x79fe('0x42')]({'plain':!![]});_0x5e27bc[_0x79fe('0x5b')][_0x79fe('0x5c')]=_0x3feb46;return db['MailMessage'][_0x79fe('0x5d')]({'body':_0x4ab42e[_0x79fe('0x2a')][_0x79fe('0x2a')],'MailAccountId':_0x4ab42e[_0x79fe('0x43')]['id'],'MailInteractionId':_0x6cf38e['id'],'direction':'in','ContactId':_0x5e27bc[_0x79fe('0x4e')]['id'],'messageId':_0x4ab42e[_0x79fe('0x2a')][_0x79fe('0x17')]['messageId'],'from':_0x4ab42e[_0x79fe('0x2a')][_0x79fe('0x17')][_0x79fe('0x32')],'to':_0x4ab42e['body']['message']['to'],'cc':_0x4ab42e['body']['message']['cc'],'subject':_0x4ab42e[_0x79fe('0x2a')]['message'][_0x79fe('0x50')],'attach':_0x4ab42e[_0x79fe('0x2a')][_0x79fe('0x17')][_0x79fe('0x5a')],'Attachments':_0x4ab42e[_0x79fe('0x2a')]['message'][_0x79fe('0x5e')],'originTo':_0x4ab42e['body'][_0x79fe('0x17')][_0x79fe('0x5f')],'originCc':_0x4ab42e[_0x79fe('0x2a')][_0x79fe('0x17')][_0x79fe('0x60')],'bcc':_0x4ab42e[_0x79fe('0x2a')][_0x79fe('0x17')]['bcc'],'ChatWebsiteId':_0x4ab42e[_0x79fe('0x2a')]['message'][_0x79fe('0x61')]||null,'originChannel':_0x4ab42e[_0x79fe('0x2a')][_0x79fe('0x17')]['originChannel']||_0x79fe('0x62'),'ChatOfflineMessageId':_0x4ab42e[_0x79fe('0x2a')][_0x79fe('0x17')][_0x79fe('0x63')]||null},{'include':[{'model':db['Attachment'],'as':_0x79fe('0x64')}]});})[_0x79fe('0xe')](function(_0x2d4bfa){_0x5e27bc['message']=_0x2d4bfa;if(!_0x5e27bc[_0x79fe('0x5b')][_0x79fe('0x65')]){return;}return db[_0x79fe('0x66')][_0x79fe('0x24')]({'attributes':['id',_0x79fe('0x67')],'where':{'id':_0x5e27bc[_0x79fe('0x5b')][_0x79fe('0x65')]}});})[_0x79fe('0xe')](function(_0x25edcd){if(_0x25edcd){_0x5e27bc['applications'][_0x79fe('0x68')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x25edcd[_0x79fe('0x67')]+','+(_0x5e27bc[_0x79fe('0x43')][_0x79fe('0x69')]||0xa),'interval':_0x79fe('0x4b')});}if(!_0x5e27bc[_0x79fe('0x5b')]['queueId']){return;}return db[_0x79fe('0x6a')]['find']({'attributes':['id',_0x79fe('0x67')],'where':{'id':_0x5e27bc[_0x79fe('0x5b')]['queueId']}});})[_0x79fe('0xe')](function(_0x3d7392){if(_0x3d7392){_0x5e27bc[_0x79fe('0x47')][_0x79fe('0x68')]({'id':0x0,'priority':0x1,'app':_0x79fe('0x6b'),'appdata':_0x3d7392['name']+','+(_0x5e27bc[_0x79fe('0x43')][_0x79fe('0x6c')]||0x12c),'interval':_0x79fe('0x4b')});}return respondWithRpcPromise(_0x79fe('0x6d'),_0x79fe('0x6e'),_0x5e27bc);})[_0x79fe('0xe')](function(_0x477c6f){_0x132662(_0x477c6f);})[_0x79fe('0x19')](function(_0x38fc15){_0x577341(_0x83737e[_0x79fe('0x15')](0x1f4,_0x38fc15['message']));});});}; \ No newline at end of file +var _0x687b=['lodash','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./mailAccount.socket','request','then','info','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','error','code','MailAccount,\x20%s,\x20%s','message','result','GetMailAccount','MailAccount','findAll','options','raw','where','attributes','limit','include','map','model','stringify','catch','ShowMailAccount','find','smtp','setDataValue','getSmtpOptions','NotifyMailAccount','mail','difference','keys','CmContact','rawAttributes','createdAt','CompanyId','body','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','from','account','Contacts','updatedAt','DESC','Applications','MailServerOut','Smtp','CloudProvider','List','omit','applications','list','orderBy','asc','length','close','autoclose','*,*,*,*','ListId','List\x20not\x20found','messageId','subject','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','inReplyTo','create','spread','update','interaction','get','created','contact','originTo','originCc','ChatWebsiteId','originChannel','Attachment','Attachments','UserId','agent','name','waitForTheAssignedAgent','queueId','MailQueue','unshift','waitForTheAssignedQueue','Start','startRouting'];(function(_0x15d34a,_0x5beabf){var _0x34ec72=function(_0x1f0c8e){while(--_0x1f0c8e){_0x15d34a['push'](_0x15d34a['shift']());}};_0x34ec72(++_0x5beabf);}(_0x687b,0x14a));var _0xb687=function(_0x532112,_0x37d94b){_0x532112=_0x532112-0x0;var _0x23e5fb=_0x687b[_0x532112];return _0x23e5fb;};'use strict';var _=require(_0xb687('0x0'));var moment=require(_0xb687('0x1'));var BPromise=require(_0xb687('0x2'));var rs=require(_0xb687('0x3'));var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var logger=require(_0xb687('0x4'))(_0xb687('0x5'));var config=require(_0xb687('0x6'));var jayson=require(_0xb687('0x7'));var client=jayson[_0xb687('0x8')][_0xb687('0x9')]({'port':0x232c});config[_0xb687('0xa')]=_[_0xb687('0xb')](config[_0xb687('0xa')],{'host':_0xb687('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb687('0xa')]));require(_0xb687('0xd'))['register'](socket);function respondWithRpcPromise(_0x1a99c5,_0x21e3ab,_0x825ad){return new BPromise(function(_0x15dc9a,_0x404fdb){return client[_0xb687('0xe')](_0x1a99c5,_0x825ad)[_0xb687('0xf')](function(_0xaf4727){logger[_0xb687('0x10')]('MailAccount,\x20%s,\x20%s',_0x21e3ab,_0xb687('0x11'));logger[_0xb687('0x12')](_0xb687('0x13'),_0x21e3ab,_0xb687('0x11'),JSON['stringify'](_0xaf4727));if(_0xaf4727['error']){if(_0xaf4727[_0xb687('0x14')][_0xb687('0x15')]===0x1f4){logger['error'](_0xb687('0x16'),_0x21e3ab,_0xaf4727[_0xb687('0x14')][_0xb687('0x17')]);return _0x404fdb(_0xaf4727[_0xb687('0x14')][_0xb687('0x17')]);}logger[_0xb687('0x14')](_0xb687('0x16'),_0x21e3ab,_0xaf4727[_0xb687('0x14')][_0xb687('0x17')]);return _0x15dc9a(_0xaf4727[_0xb687('0x14')][_0xb687('0x17')]);}else{logger[_0xb687('0x10')]('MailAccount,\x20%s,\x20%s',_0x21e3ab,_0xb687('0x11'));_0x15dc9a(_0xaf4727[_0xb687('0x18')][_0xb687('0x17')]);}})['catch'](function(_0x48958d){logger[_0xb687('0x14')](_0xb687('0x16'),_0x21e3ab,_0x48958d);_0x404fdb(_0x48958d);});});}exports[_0xb687('0x19')]=function(_0x4b593b){var _0x42cdd2=this;return new Promise(function(_0x481f1d,_0x1bd2bf){return db[_0xb687('0x1a')][_0xb687('0x1b')]({'raw':_0x4b593b[_0xb687('0x1c')]?_0x4b593b['options'][_0xb687('0x1d')]===undefined?!![]:![]:!![],'where':_0x4b593b['options']?_0x4b593b[_0xb687('0x1c')][_0xb687('0x1e')]||null:null,'attributes':_0x4b593b[_0xb687('0x1c')]?_0x4b593b['options'][_0xb687('0x1f')]||null:null,'limit':_0x4b593b[_0xb687('0x1c')]?_0x4b593b[_0xb687('0x1c')][_0xb687('0x20')]||null:null,'include':_0x4b593b[_0xb687('0x1c')]?_0x4b593b[_0xb687('0x1c')][_0xb687('0x21')]?_[_0xb687('0x22')](_0x4b593b['options'][_0xb687('0x21')],function(_0x129347){return{'model':db[_0x129347[_0xb687('0x23')]],'as':_0x129347['as'],'attributes':_0x129347[_0xb687('0x1f')],'include':_0x129347[_0xb687('0x21')]?_[_0xb687('0x22')](_0x129347[_0xb687('0x21')],function(_0x3cb2f2){return{'model':db[_0x3cb2f2[_0xb687('0x23')]],'as':_0x3cb2f2['as'],'attributes':_0x3cb2f2[_0xb687('0x1f')],'include':_0x3cb2f2['include']?_[_0xb687('0x22')](_0x3cb2f2[_0xb687('0x21')],function(_0x392721){return{'model':db[_0x392721[_0xb687('0x23')]],'as':_0x392721['as'],'attributes':_0x392721[_0xb687('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xb687('0xf')](function(_0x4e9a06){logger[_0xb687('0x10')]('GetMailAccount',_0x4b593b);logger[_0xb687('0x12')](_0xb687('0x19'),_0x4b593b,JSON[_0xb687('0x24')](_0x4e9a06));_0x481f1d(_0x4e9a06);})[_0xb687('0x25')](function(_0x1ad3ef){logger[_0xb687('0x14')](_0xb687('0x19'),_0x1ad3ef['message'],_0x4b593b);_0x1bd2bf(_0x42cdd2[_0xb687('0x14')](0x1f4,_0x1ad3ef[_0xb687('0x17')]));});});};exports[_0xb687('0x26')]=function(_0x22cd1d){var _0xa18fec=this;return new Promise(function(_0x263834,_0x44be88){return db[_0xb687('0x1a')][_0xb687('0x27')]({'raw':_0x22cd1d[_0xb687('0x1c')]?_0x22cd1d[_0xb687('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x22cd1d['options']?_0x22cd1d[_0xb687('0x1c')][_0xb687('0x1e')]||null:null,'attributes':_0x22cd1d[_0xb687('0x1c')]?_0x22cd1d[_0xb687('0x1c')]['attributes']||null:null,'include':_0x22cd1d['options']?_0x22cd1d[_0xb687('0x1c')][_0xb687('0x21')]?_['map'](_0x22cd1d[_0xb687('0x1c')][_0xb687('0x21')],function(_0x548b83){return{'model':db[_0x548b83[_0xb687('0x23')]],'as':_0x548b83['as'],'attributes':_0x548b83['attributes'],'include':_0x548b83[_0xb687('0x21')]?_[_0xb687('0x22')](_0x548b83[_0xb687('0x21')],function(_0x3e146a){return{'model':db[_0x3e146a[_0xb687('0x23')]],'as':_0x3e146a['as'],'attributes':_0x3e146a[_0xb687('0x1f')],'include':_0x3e146a['include']?_[_0xb687('0x22')](_0x3e146a[_0xb687('0x21')],function(_0x2a73df){return{'model':db[_0x2a73df[_0xb687('0x23')]],'as':_0x2a73df['as'],'attributes':_0x2a73df['attributes']};}):[]};}):[]};}):[]:[]})[_0xb687('0xf')](function(_0x100f4a){if(_0x22cd1d[_0xb687('0x1c')][_0xb687('0x28')]===!![])_0x100f4a[_0xb687('0x29')]('smtpOptions',_0x100f4a[_0xb687('0x2a')]());logger[_0xb687('0x10')](_0xb687('0x26'),_0x22cd1d);logger[_0xb687('0x12')](_0xb687('0x26'),_0x22cd1d,JSON[_0xb687('0x24')](_0x100f4a));_0x263834(_0x100f4a);})['catch'](function(_0x5ad577){logger[_0xb687('0x14')]('ShowMailAccount',_0x5ad577[_0xb687('0x17')],_0x22cd1d);_0x44be88(_0xa18fec[_0xb687('0x14')](0x1f4,_0x5ad577['message']));});});};exports[_0xb687('0x2b')]=function(_0x2ce07a){var _0x57776b=this;return new Promise(function(_0x394b56,_0x28031e){var _0x127b25={'body':_0x2ce07a['body'],'channel':_0xb687('0x2c')};var _0x9cffb2=_[_0xb687('0x2d')](_[_0xb687('0x2e')](db[_0xb687('0x2f')][_0xb687('0x30')]),[_0xb687('0x31'),'updatedAt',_0xb687('0x32'),'ListId']);var _0x50fdb7=![];if(_0x2ce07a[_0xb687('0x33')]['id']){delete _0x2ce07a[_0xb687('0x33')]['id'];}if(_['isNil'](_0x2ce07a[_0xb687('0x33')]['from'])){return _0x28031e(_0x57776b[_0xb687('0x14')](0x1f4,_0xb687('0x34')));}if(_['isNil'](_0x2ce07a[_0xb687('0x33')][_0xb687('0x33')])||_0x2ce07a['body'][_0xb687('0x33')]===''){return _0x28031e(_0x57776b[_0xb687('0x14')](0x1f4,_0xb687('0x35')));}if(_[_0xb687('0x36')](_0x2ce07a[_0xb687('0x33')][_0xb687('0x37')])){return _0x28031e(_0x57776b[_0xb687('0x14')](0x1f4,_0xb687('0x38')+_0x9cffb2));}if(!_[_0xb687('0x39')](_0x9cffb2,_0x2ce07a[_0xb687('0x33')][_0xb687('0x37')])){return _0x28031e(_0x57776b[_0xb687('0x14')](0x1f4,'mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x9cffb2));}var _0x1ac373={};_0x1ac373[_0x2ce07a['body'][_0xb687('0x37')]]=_0x2ce07a[_0xb687('0x33')][_0xb687('0x3a')];return db[_0xb687('0x1a')][_0xb687('0x27')]({'where':{'id':_0x2ce07a[_0xb687('0x3b')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0xb687('0x2f')],'as':_0xb687('0x3c'),'where':_0x1ac373,'limit':0x1,'order':[[_0xb687('0x3d'),_0xb687('0x3e')]]}]},{'model':db['MailApplication'],'as':_0xb687('0x3f')},{'model':db[_0xb687('0x40')],'as':_0xb687('0x41'),'include':[{'model':db[_0xb687('0x42')],'as':'CloudProvider'}]}]})[_0xb687('0xf')](function(_0xfc4c5f){if(_0xfc4c5f&&_0xfc4c5f[_0xb687('0x43')]){var _0x401b99=_0xfc4c5f['get']({'plain':!![]});_0x127b25['account']=_[_0xb687('0x44')](_0x401b99,[_0xb687('0x3f'),_0xb687('0x43')]);_0x127b25['account']['smtpOptions']=_0xfc4c5f[_0xb687('0x2a')]();_0x127b25[_0xb687('0x45')]=_0x401b99[_0xb687('0x3f')];_0x127b25[_0xb687('0x46')]=_0x401b99[_0xb687('0x43')];_0x127b25[_0xb687('0x45')]=_[_0xb687('0x47')](_0x127b25[_0xb687('0x45')],['priority'],[_0xb687('0x48')]);if(_0x127b25[_0xb687('0x3b')]&&_0x127b25[_0xb687('0x3b')]['autoclose']){_0x127b25['applications']['push']({'id':0x0,'priority':_0x127b25['applications'][_0xb687('0x49')]+0x1,'app':_0xb687('0x4a'),'appdata':_0xb687('0x4b'),'interval':_0xb687('0x4c')});}if(_0x127b25[_0xb687('0x3b')][_0xb687('0x3f')]){delete _0x127b25[_0xb687('0x3b')][_0xb687('0x3f')];}if(_0x127b25[_0xb687('0x3b')][_0xb687('0x43')]){delete _0x127b25[_0xb687('0x3b')][_0xb687('0x43')];}if(_0x401b99[_0xb687('0x43')][_0xb687('0x3c')][_0xb687('0x49')]){return _0x401b99[_0xb687('0x43')][_0xb687('0x3c')][0x0];}var _0x4dca01=_['defaults'](_0x2ce07a[_0xb687('0x33')],{'firstName':_0x2ce07a[_0xb687('0x33')][_0xb687('0x3a')],'ListId':_0x401b99[_0xb687('0x4d')]});_0x4dca01[_0x2ce07a['body'][_0xb687('0x37')]]=_0x2ce07a[_0xb687('0x33')]['from'];return db[_0xb687('0x2f')]['create'](_0x4dca01);}else{throw new Error(_0xb687('0x4e'));}})[_0xb687('0xf')](function(_0x50fb31){_0x127b25['contact']=_0x50fb31;if(_0x50fb31){if(!_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')]['messageId']){_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')][_0xb687('0x4f')]=rs['generate']()+'\x20'+_0x2ce07a[_0xb687('0x33')]['message'][_0xb687('0x3a')];}var _0x1a31f6={'ContactId':_0x50fb31['id'],'MailAccountId':_0x2ce07a[_0xb687('0x3b')]['id'],'inReplyTo':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')]['messageId'],'to':_0x2ce07a['body'][_0xb687('0x17')]['from'],'cc':_0x2ce07a['body']['message']['cc'],'subject':_0x2ce07a['body'][_0xb687('0x17')][_0xb687('0x50')],'attach':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')][_0xb687('0x51')],'lastMsgAt':moment()[_0xb687('0x52')](_0xb687('0x53')),'lastMsgDirection':'in'};return db[_0xb687('0x54')][_0xb687('0x27')]({'where':{'closed':![],'MailAccountId':_0x2ce07a[_0xb687('0x3b')]['id']},'include':[{'model':db[_0xb687('0x55')],'as':'Messages','attributes':['messageId'],'where':{'messageId':_0x2ce07a[_0xb687('0x33')]['message'][_0xb687('0x56')]}}]})[_0xb687('0xf')](function(_0x1c031f){if(_0x1c031f){return[_0x1c031f,![]];}return db[_0xb687('0x54')][_0xb687('0x57')](_0x1a31f6)['then'](function(_0x22da49){return[_0x22da49,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0xb687('0x58')](function(_0x293281,_0x18993a){if(_0x293281){_0x50fdb7=_0x18993a;if(!_0x18993a){return _0x293281[_0xb687('0x59')]({'inReplyTo':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')][_0xb687('0x4f')],'to':_0x2ce07a['body'][_0xb687('0x17')][_0xb687('0x3a')],'cc':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')]['cc'],'subject':_0x2ce07a[_0xb687('0x33')]['message'][_0xb687('0x50')],'attach':_0x293281[_0xb687('0x51')]?_0x293281[_0xb687('0x51')]:_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')][_0xb687('0x51')],'substatus':null,'substatusAt':moment()[_0xb687('0x52')](_0xb687('0x53')),'lastMsgAt':moment()[_0xb687('0x52')](_0xb687('0x53')),'lastMsgDirection':'in'});}else{return _0x293281;}}})[_0xb687('0xf')](function(_0x48838a){_0x127b25[_0xb687('0x5a')]=_0x48838a[_0xb687('0x5b')]({'plain':!![]});_0x127b25[_0xb687('0x5a')][_0xb687('0x5c')]=_0x50fdb7;return db['MailMessage'][_0xb687('0x57')]({'body':_0x2ce07a[_0xb687('0x33')]['body'],'MailAccountId':_0x2ce07a[_0xb687('0x3b')]['id'],'MailInteractionId':_0x48838a['id'],'direction':'in','ContactId':_0x127b25[_0xb687('0x5d')]['id'],'messageId':_0x2ce07a[_0xb687('0x33')]['message'][_0xb687('0x4f')],'from':_0x2ce07a[_0xb687('0x33')]['message'][_0xb687('0x3a')],'to':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')]['to'],'cc':_0x2ce07a[_0xb687('0x33')]['message']['cc'],'subject':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')]['subject'],'attach':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')]['attach'],'Attachments':_0x2ce07a['body'][_0xb687('0x17')]['attachments'],'originTo':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')][_0xb687('0x5e')],'originCc':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')][_0xb687('0x5f')],'bcc':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')]['bcc'],'ChatWebsiteId':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')][_0xb687('0x60')]||null,'originChannel':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')][_0xb687('0x61')]||'Email','ChatOfflineMessageId':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')]['ChatOfflineMessageId']||null},{'include':[{'model':db[_0xb687('0x62')],'as':_0xb687('0x63')}]});})[_0xb687('0xf')](function(_0x1227fe){_0x127b25['message']=_0x1227fe;if(!_0x127b25[_0xb687('0x5a')]['UserId']){return;}return db['User'][_0xb687('0x27')]({'attributes':['id','name'],'where':{'id':_0x127b25['interaction'][_0xb687('0x64')]}});})['then'](function(_0x137631){if(_0x137631){_0x127b25[_0xb687('0x45')]['unshift']({'id':0x0,'priority':0x0,'app':_0xb687('0x65'),'appdata':_0x137631[_0xb687('0x66')]+','+(_0x127b25['account'][_0xb687('0x67')]||0xa),'interval':_0xb687('0x4c')});}if(!_0x127b25[_0xb687('0x5a')][_0xb687('0x68')]){return;}return db[_0xb687('0x69')][_0xb687('0x27')]({'attributes':['id',_0xb687('0x66')],'where':{'id':_0x127b25[_0xb687('0x5a')][_0xb687('0x68')]}});})[_0xb687('0xf')](function(_0x3a7a4a){if(_0x3a7a4a){_0x127b25['applications'][_0xb687('0x6a')]({'id':0x0,'priority':0x1,'app':'queue','appdata':_0x3a7a4a['name']+','+(_0x127b25[_0xb687('0x3b')][_0xb687('0x6b')]||0x12c),'interval':_0xb687('0x4c')});}return respondWithRpcPromise(_0xb687('0x6c'),_0xb687('0x6d'),_0x127b25);})['then'](function(_0x59c94b){_0x394b56(_0x59c94b);})[_0xb687('0x25')](function(_0x316abd){_0x28031e(_0x57776b[_0xb687('0x14')](0x1f4,_0x316abd[_0xb687('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index f8d49fe..f451203 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 _0x689b=['./mailAccount.events','remove','emit','removeListener','register','length','mailAccount:'];(function(_0x2d994a,_0x503797){var _0x15ec24=function(_0xa98bea){while(--_0xa98bea){_0x2d994a['push'](_0x2d994a['shift']());}};_0x15ec24(++_0x503797);}(_0x689b,0x142));var _0xb689=function(_0x5aa163,_0x28cc1a){_0x5aa163=_0x5aa163-0x0;var _0x55ca1d=_0x689b[_0x5aa163];return _0x55ca1d;};'use strict';var MailAccountEvents=require(_0xb689('0x0'));var events=['save',_0xb689('0x1'),'update'];function createListener(_0x5e98bb,_0x213562){return function(_0x2530a1){_0x213562[_0xb689('0x2')](_0x5e98bb,_0x2530a1);};}function removeListener(_0x4378a8,_0x2bcd76){return function(){MailAccountEvents[_0xb689('0x3')](_0x4378a8,_0x2bcd76);};}exports[_0xb689('0x4')]=function(_0x4bb98f){for(var _0x1b9fed=0x0,_0x5ee263=events[_0xb689('0x5')];_0x1b9fed<_0x5ee263;_0x1b9fed++){var _0x56c6ba=events[_0x1b9fed];var _0x6eaf58=createListener(_0xb689('0x6')+_0x56c6ba,_0x4bb98f);MailAccountEvents['on'](_0x56c6ba,_0x6eaf58);}}; \ No newline at end of file +var _0x1b3c=['removeListener','register','length','mailAccount:','./mailAccount.events','save','remove','update','emit'];(function(_0x4afa2f,_0x4c3b4b){var _0x5967df=function(_0x427ba5){while(--_0x427ba5){_0x4afa2f['push'](_0x4afa2f['shift']());}};_0x5967df(++_0x4c3b4b);}(_0x1b3c,0x1ea));var _0xc1b3=function(_0x34b13d,_0x296e46){_0x34b13d=_0x34b13d-0x0;var _0x36cb7b=_0x1b3c[_0x34b13d];return _0x36cb7b;};'use strict';var MailAccountEvents=require(_0xc1b3('0x0'));var events=[_0xc1b3('0x1'),_0xc1b3('0x2'),_0xc1b3('0x3')];function createListener(_0x1b8c71,_0x1667bc){return function(_0x2fb2d3){_0x1667bc[_0xc1b3('0x4')](_0x1b8c71,_0x2fb2d3);};}function removeListener(_0x22f58b,_0x1f8fcf){return function(){MailAccountEvents[_0xc1b3('0x5')](_0x22f58b,_0x1f8fcf);};}exports[_0xc1b3('0x6')]=function(_0x15cc63){for(var _0x3cce90=0x0,_0x127115=events[_0xc1b3('0x7')];_0x3cce90<_0x127115;_0x3cce90++){var _0x211b0a=events[_0x3cce90];var _0x210d14=createListener(_0xc1b3('0x8')+_0x211b0a,_0x15cc63);MailAccountEvents['on'](_0x211b0a,_0x210d14);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index 5b844bd..ceafdec 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 _0xecb5=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./mailApplication.controller','get','/:id','show','put','isAuthenticated','update','destroy','exports','multer','util','path'];(function(_0x3d6011,_0x21f920){var _0x1bb655=function(_0x409c96){while(--_0x409c96){_0x3d6011['push'](_0x3d6011['shift']());}};_0x1bb655(++_0x21f920);}(_0xecb5,0x12f));var _0x5ecb=function(_0xda96,_0x35b043){_0xda96=_0xda96-0x0;var _0x394b20=_0xecb5[_0xda96];return _0x394b20;};'use strict';var multer=require(_0x5ecb('0x0'));var util=require(_0x5ecb('0x1'));var path=require(_0x5ecb('0x2'));var timeout=require(_0x5ecb('0x3'));var express=require(_0x5ecb('0x4'));var router=express[_0x5ecb('0x5')]();var fs_extra=require(_0x5ecb('0x6'));var auth=require(_0x5ecb('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x5ecb('0x8'));var controller=require(_0x5ecb('0x9'));router[_0x5ecb('0xa')](_0x5ecb('0xb'),auth['isAuthenticated'](),controller[_0x5ecb('0xc')]);router[_0x5ecb('0xd')](_0x5ecb('0xb'),auth[_0x5ecb('0xe')](),controller[_0x5ecb('0xf')]);router['delete'](_0x5ecb('0xb'),auth[_0x5ecb('0xe')](),controller[_0x5ecb('0x10')]);module[_0x5ecb('0x11')]=router; \ No newline at end of file +var _0xb7a8=['util','express','fs-extra','../../components/interaction/service','../../config/environment','./mailApplication.controller','isAuthenticated','show','put','update','delete','/:id','destroy','exports'];(function(_0x57b7a4,_0x13a82e){var _0x2f3278=function(_0x503e67){while(--_0x503e67){_0x57b7a4['push'](_0x57b7a4['shift']());}};_0x2f3278(++_0x13a82e);}(_0xb7a8,0x1b2));var _0x8b7a=function(_0x301082,_0x541737){_0x301082=_0x301082-0x0;var _0x110e70=_0xb7a8[_0x301082];return _0x110e70;};'use strict';var multer=require('multer');var util=require(_0x8b7a('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x8b7a('0x1'));var router=express['Router']();var fs_extra=require(_0x8b7a('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x8b7a('0x3'));var config=require(_0x8b7a('0x4'));var controller=require(_0x8b7a('0x5'));router['get']('/:id',auth[_0x8b7a('0x6')](),controller[_0x8b7a('0x7')]);router[_0x8b7a('0x8')]('/:id',auth[_0x8b7a('0x6')](),controller[_0x8b7a('0x9')]);router[_0x8b7a('0xa')](_0x8b7a('0xb'),auth['isAuthenticated'](),controller[_0x8b7a('0xc')]);module[_0x8b7a('0xd')]=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index aa21b76..0fb3014 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 _0xae53=['sequelize','exports','INTEGER','STRING','noop','TEXT'];(function(_0x544f38,_0x1be834){var _0x25165b=function(_0x300b3d){while(--_0x300b3d){_0x544f38['push'](_0x544f38['shift']());}};_0x25165b(++_0x1be834);}(_0xae53,0x1e6));var _0x3ae5=function(_0x5c2e3e,_0x26ecd3){_0x5c2e3e=_0x5c2e3e-0x0;var _0x53f64a=_0xae53[_0x5c2e3e];return _0x53f64a;};'use strict';var Sequelize=require(_0x3ae5('0x0'));module[_0x3ae5('0x1')]={'priority':{'type':Sequelize[_0x3ae5('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x3ae5('0x3')],'allowNull':![],'defaultValue':_0x3ae5('0x4')},'appdata':{'type':Sequelize[_0x3ae5('0x5')]()},'description':{'type':Sequelize[_0x3ae5('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x094d=['sequelize','exports','INTEGER','TEXT','STRING','*,*,*,*'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x094d,0x66));var _0xd094=function(_0x5a5943,_0x57d3ef){_0x5a5943=_0x5a5943-0x0;var _0x29ef63=_0x094d[_0x5a5943];return _0x29ef63;};'use strict';var Sequelize=require(_0xd094('0x0'));module[_0xd094('0x1')]={'priority':{'type':Sequelize[_0xd094('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xd094('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xd094('0x4')],'defaultValue':_0xd094('0x5')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index cf5bf02..2f16e93 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 _0xcb91=['send','show','params','keys','rawAttributes','query','intersection','attributes','fields','length','model','includeAll','include','merge','options','MailApplication','find','catch','body','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','fs-extra','lodash','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','error','stack','name'];(function(_0x27ec21,_0x562e52){var _0x1513b6=function(_0x3557a0){while(--_0x3557a0){_0x27ec21['push'](_0x27ec21['shift']());}};_0x1513b6(++_0x562e52);}(_0xcb91,0x1a9));var _0x1cb9=function(_0xe6e78c,_0x582369){_0xe6e78c=_0xe6e78c-0x0;var _0x2a09c8=_0xcb91[_0xe6e78c];return _0x2a09c8;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1cb9('0x0'));var jsonpatch=require(_0x1cb9('0x1'));var rp=require(_0x1cb9('0x2'));var moment=require(_0x1cb9('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x1cb9('0x4'));var util=require(_0x1cb9('0x5'));var path=require('path');var sox=require(_0x1cb9('0x6'));var csv=require(_0x1cb9('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1cb9('0x8'));var _=require(_0x1cb9('0x9'));var squel=require('squel');var crypto=require(_0x1cb9('0xa'));var jsforce=require(_0x1cb9('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x1cb9('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1cb9('0xc'));var authService=require(_0x1cb9('0xd'));var qs=require(_0x1cb9('0xe'));var as=require(_0x1cb9('0xf'));var hardwareService=require(_0x1cb9('0x10'));var logger=require('../../config/logger')(_0x1cb9('0x11'));var utils=require(_0x1cb9('0x12'));var config=require(_0x1cb9('0x13'));var licenseUtil=require(_0x1cb9('0x14'));var db=require(_0x1cb9('0x15'))['db'];function respondWithStatusCode(_0x5445e1,_0x5e3c19){_0x5e3c19=_0x5e3c19||0xcc;return function(_0x59dec3){if(_0x59dec3){return _0x5445e1[_0x1cb9('0x16')](_0x5e3c19);}return _0x5445e1[_0x1cb9('0x17')](_0x5e3c19)[_0x1cb9('0x18')]();};}function respondWithResult(_0x1c714f,_0x56884d){_0x56884d=_0x56884d||0xc8;return function(_0x397727){if(_0x397727){return _0x1c714f[_0x1cb9('0x17')](_0x56884d)[_0x1cb9('0x19')](_0x397727);}};}function respondWithFilteredResult(_0x8dfa55,_0x3e2d11){return function(_0x5806d8){if(_0x5806d8){var _0x5572cb=typeof _0x3e2d11[_0x1cb9('0x1a')]===_0x1cb9('0x1b')&&typeof _0x3e2d11[_0x1cb9('0x1c')]===_0x1cb9('0x1b');var _0x3e21e0=_0x5806d8[_0x1cb9('0x1d')];var _0x23d3a9=_0x5572cb?0x0:_0x3e2d11['offset'];var _0x479d43=_0x5572cb?_0x5806d8[_0x1cb9('0x1d')]:_0x3e2d11[_0x1cb9('0x1a')]+_0x3e2d11[_0x1cb9('0x1c')];var _0x31481a;if(_0x479d43>=_0x3e21e0){_0x479d43=_0x3e21e0;_0x31481a=0xc8;}else{_0x31481a=0xce;}_0x8dfa55[_0x1cb9('0x17')](_0x31481a);return _0x8dfa55[_0x1cb9('0x1e')](_0x1cb9('0x1f'),_0x23d3a9+'-'+_0x479d43+'/'+_0x3e21e0)['json'](_0x5806d8);}return null;};}function patchUpdates(_0x559bcc){return function(_0x1a5a72){try{jsonpatch['apply'](_0x1a5a72,_0x559bcc,!![]);}catch(_0x4750b1){return BPromise[_0x1cb9('0x20')](_0x4750b1);}return _0x1a5a72['save']();};}function saveUpdates(_0x599275,_0x2e3854){return function(_0x325637){if(_0x325637){return _0x325637[_0x1cb9('0x21')](_0x599275)[_0x1cb9('0x22')](function(_0x45b8d3){return _0x45b8d3;});}return null;};}function removeEntity(_0x27db16,_0x59ebea){return function(_0x55b232){if(_0x55b232){return _0x55b232[_0x1cb9('0x23')]()['then'](function(){_0x27db16[_0x1cb9('0x17')](0xcc)[_0x1cb9('0x18')]();});}};}function handleEntityNotFound(_0x69b4c8,_0x44d3c4){return function(_0x43a100){if(!_0x43a100){_0x69b4c8['sendStatus'](0x194);}return _0x43a100;};}function handleError(_0x195f16,_0x9df250){_0x9df250=_0x9df250||0x1f4;return function(_0x4c8d76){logger[_0x1cb9('0x24')](_0x4c8d76[_0x1cb9('0x25')]);if(_0x4c8d76[_0x1cb9('0x26')]){delete _0x4c8d76[_0x1cb9('0x26')];}_0x195f16[_0x1cb9('0x17')](_0x9df250)[_0x1cb9('0x27')](_0x4c8d76);};}exports[_0x1cb9('0x28')]=function(_0xb644b3,_0x41e5c2){var _0x9de64b={'raw':!![],'where':{'id':_0xb644b3[_0x1cb9('0x29')]['id']}},_0x48888d={};_0x48888d['model']=_[_0x1cb9('0x2a')](db['MailApplication'][_0x1cb9('0x2b')]);_0x48888d[_0x1cb9('0x2c')]=_[_0x1cb9('0x2a')](_0xb644b3[_0x1cb9('0x2c')]);_0x48888d['filters']=_[_0x1cb9('0x2d')](_0x48888d['model'],_0x48888d[_0x1cb9('0x2c')]);_0x9de64b[_0x1cb9('0x2e')]=_[_0x1cb9('0x2d')](_0x48888d['model'],qs[_0x1cb9('0x2f')](_0xb644b3['query'][_0x1cb9('0x2f')]));_0x9de64b['attributes']=_0x9de64b[_0x1cb9('0x2e')][_0x1cb9('0x30')]?_0x9de64b[_0x1cb9('0x2e')]:_0x48888d[_0x1cb9('0x31')];if(_0xb644b3['query'][_0x1cb9('0x32')]){_0x9de64b[_0x1cb9('0x33')]=[{'all':!![]}];}_0x9de64b=_[_0x1cb9('0x34')]({},_0x9de64b,_0xb644b3[_0x1cb9('0x35')]);return db[_0x1cb9('0x36')][_0x1cb9('0x37')](_0x9de64b)[_0x1cb9('0x22')](handleEntityNotFound(_0x41e5c2,null))[_0x1cb9('0x22')](respondWithResult(_0x41e5c2,null))[_0x1cb9('0x38')](handleError(_0x41e5c2,null));};exports[_0x1cb9('0x21')]=function(_0x294eec,_0x26b950){if(_0x294eec[_0x1cb9('0x39')]['id']){delete _0x294eec['body']['id'];}return db['MailApplication'][_0x1cb9('0x37')]({'where':{'id':_0x294eec[_0x1cb9('0x29')]['id']}})[_0x1cb9('0x22')](handleEntityNotFound(_0x26b950,null))[_0x1cb9('0x22')](saveUpdates(_0x294eec[_0x1cb9('0x39')],null))[_0x1cb9('0x22')](respondWithResult(_0x26b950,null))[_0x1cb9('0x38')](handleError(_0x26b950,null));};exports[_0x1cb9('0x23')]=function(_0x4d3e39,_0x2aa59b){return db[_0x1cb9('0x36')][_0x1cb9('0x37')]({'where':{'id':_0x4d3e39['params']['id']}})[_0x1cb9('0x22')](handleEntityNotFound(_0x2aa59b,null))['then'](removeEntity(_0x2aa59b,null))[_0x1cb9('0x38')](handleError(_0x2aa59b,null));}; \ No newline at end of file +var _0xda3f=['includeAll','include','merge','find','catch','body','MailApplication','destroy','rimraf','zip-dir','bluebird','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','end','stack','name','send','params','model','keys','query','filters','intersection','attributes','fields','length'];(function(_0x1d3168,_0x35d048){var _0x5c7c97=function(_0x4cbb43){while(--_0x4cbb43){_0x1d3168['push'](_0x1d3168['shift']());}};_0x5c7c97(++_0x35d048);}(_0xda3f,0xec));var _0xfda3=function(_0x4ad99f,_0x1de4ec){_0x4ad99f=_0x4ad99f-0x0;var _0x2183dd=_0xda3f[_0x4ad99f];return _0x2183dd;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfda3('0x0'));var zipdir=require(_0xfda3('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xfda3('0x2'));var Mustache=require('mustache');var util=require(_0xfda3('0x3'));var path=require(_0xfda3('0x4'));var sox=require('sox');var csv=require(_0xfda3('0x5'));var ejs=require(_0xfda3('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xfda3('0x7'));var crypto=require(_0xfda3('0x8'));var jsforce=require(_0xfda3('0x9'));var deskjs=require(_0xfda3('0xa'));var toCsv=require(_0xfda3('0x5'));var querystring=require(_0xfda3('0xb'));var Papa=require(_0xfda3('0xc'));var Redis=require(_0xfda3('0xd'));var authService=require(_0xfda3('0xe'));var qs=require(_0xfda3('0xf'));var as=require(_0xfda3('0x10'));var hardwareService=require(_0xfda3('0x11'));var logger=require('../../config/logger')(_0xfda3('0x12'));var utils=require(_0xfda3('0x13'));var config=require(_0xfda3('0x14'));var licenseUtil=require(_0xfda3('0x15'));var db=require(_0xfda3('0x16'))['db'];function respondWithStatusCode(_0x4b77ea,_0x583125){_0x583125=_0x583125||0xcc;return function(_0x5d7d5b){if(_0x5d7d5b){return _0x4b77ea[_0xfda3('0x17')](_0x583125);}return _0x4b77ea[_0xfda3('0x18')](_0x583125)['end']();};}function respondWithResult(_0x501588,_0x587e9b){_0x587e9b=_0x587e9b||0xc8;return function(_0x227d72){if(_0x227d72){return _0x501588[_0xfda3('0x18')](_0x587e9b)['json'](_0x227d72);}};}function respondWithFilteredResult(_0x57a229,_0x533365){return function(_0x80ea80){if(_0x80ea80){var _0x474707=typeof _0x533365[_0xfda3('0x19')]===_0xfda3('0x1a')&&typeof _0x533365[_0xfda3('0x1b')]===_0xfda3('0x1a');var _0x2aadcb=_0x80ea80[_0xfda3('0x1c')];var _0x4680bf=_0x474707?0x0:_0x533365[_0xfda3('0x19')];var _0x54a7c6=_0x474707?_0x80ea80[_0xfda3('0x1c')]:_0x533365[_0xfda3('0x19')]+_0x533365[_0xfda3('0x1b')];var _0x32855a;if(_0x54a7c6>=_0x2aadcb){_0x54a7c6=_0x2aadcb;_0x32855a=0xc8;}else{_0x32855a=0xce;}_0x57a229['status'](_0x32855a);return _0x57a229[_0xfda3('0x1d')](_0xfda3('0x1e'),_0x4680bf+'-'+_0x54a7c6+'/'+_0x2aadcb)[_0xfda3('0x1f')](_0x80ea80);}return null;};}function patchUpdates(_0x51e731){return function(_0x5ad52a){try{jsonpatch[_0xfda3('0x20')](_0x5ad52a,_0x51e731,!![]);}catch(_0x38d428){return BPromise[_0xfda3('0x21')](_0x38d428);}return _0x5ad52a['save']();};}function saveUpdates(_0x3cf5a9,_0xef2535){return function(_0x1e15a8){if(_0x1e15a8){return _0x1e15a8[_0xfda3('0x22')](_0x3cf5a9)[_0xfda3('0x23')](function(_0x2b84b7){return _0x2b84b7;});}return null;};}function removeEntity(_0x2677f6,_0xc6fb9a){return function(_0x16eaa6){if(_0x16eaa6){return _0x16eaa6['destroy']()[_0xfda3('0x23')](function(){_0x2677f6[_0xfda3('0x18')](0xcc)[_0xfda3('0x24')]();});}};}function handleEntityNotFound(_0x4ae9b9,_0x45a977){return function(_0x39e246){if(!_0x39e246){_0x4ae9b9[_0xfda3('0x17')](0x194);}return _0x39e246;};}function handleError(_0x38946d,_0x1cb831){_0x1cb831=_0x1cb831||0x1f4;return function(_0xad9f7b){logger['error'](_0xad9f7b[_0xfda3('0x25')]);if(_0xad9f7b[_0xfda3('0x26')]){delete _0xad9f7b[_0xfda3('0x26')];}_0x38946d[_0xfda3('0x18')](_0x1cb831)[_0xfda3('0x27')](_0xad9f7b);};}exports['show']=function(_0x3c1549,_0x4101b1){var _0x301509={'raw':!![],'where':{'id':_0x3c1549[_0xfda3('0x28')]['id']}},_0x474992={};_0x474992[_0xfda3('0x29')]=_[_0xfda3('0x2a')](db['MailApplication']['rawAttributes']);_0x474992[_0xfda3('0x2b')]=_['keys'](_0x3c1549['query']);_0x474992[_0xfda3('0x2c')]=_[_0xfda3('0x2d')](_0x474992[_0xfda3('0x29')],_0x474992[_0xfda3('0x2b')]);_0x301509[_0xfda3('0x2e')]=_[_0xfda3('0x2d')](_0x474992[_0xfda3('0x29')],qs[_0xfda3('0x2f')](_0x3c1549[_0xfda3('0x2b')]['fields']));_0x301509[_0xfda3('0x2e')]=_0x301509[_0xfda3('0x2e')][_0xfda3('0x30')]?_0x301509[_0xfda3('0x2e')]:_0x474992[_0xfda3('0x29')];if(_0x3c1549[_0xfda3('0x2b')][_0xfda3('0x31')]){_0x301509[_0xfda3('0x32')]=[{'all':!![]}];}_0x301509=_[_0xfda3('0x33')]({},_0x301509,_0x3c1549['options']);return db['MailApplication'][_0xfda3('0x34')](_0x301509)[_0xfda3('0x23')](handleEntityNotFound(_0x4101b1,null))['then'](respondWithResult(_0x4101b1,null))[_0xfda3('0x35')](handleError(_0x4101b1,null));};exports[_0xfda3('0x22')]=function(_0x28ca96,_0x52ee98){if(_0x28ca96[_0xfda3('0x36')]['id']){delete _0x28ca96[_0xfda3('0x36')]['id'];}return db[_0xfda3('0x37')][_0xfda3('0x34')]({'where':{'id':_0x28ca96[_0xfda3('0x28')]['id']}})['then'](handleEntityNotFound(_0x52ee98,null))[_0xfda3('0x23')](saveUpdates(_0x28ca96[_0xfda3('0x36')],null))[_0xfda3('0x23')](respondWithResult(_0x52ee98,null))['catch'](handleError(_0x52ee98,null));};exports[_0xfda3('0x38')]=function(_0x4854b1,_0x2d9a3f){return db[_0xfda3('0x37')][_0xfda3('0x34')]({'where':{'id':_0x4854b1[_0xfda3('0x28')]['id']}})[_0xfda3('0x23')](handleEntityNotFound(_0x2d9a3f,null))[_0xfda3('0x23')](removeEntity(_0x2d9a3f,null))[_0xfda3('0x35')](handleError(_0x2d9a3f,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index 5e9a9d7..7ced16c 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 _0x6ad7=['../../config/logger','api','moment','path','rimraf','../../config/environment','./mailApplication.attributes','exports','MailApplication','mail_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0x6ad7,0xb4));var _0x76ad=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6ad7[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x76ad('0x0'));var util=require(_0x76ad('0x1'));var logger=require(_0x76ad('0x2'))(_0x76ad('0x3'));var moment=require(_0x76ad('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x76ad('0x5'));var rimraf=require(_0x76ad('0x6'));var config=require(_0x76ad('0x7'));var attributes=require(_0x76ad('0x8'));module[_0x76ad('0x9')]=function(_0x59ca8a,_0x5c7bb3){return _0x59ca8a['define'](_0x76ad('0xa'),attributes,{'tableName':_0x76ad('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x76ad('0xc'),'collate':_0x76ad('0xd')});}; \ No newline at end of file +var _0x371b=['MailApplication','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','request-promise','rimraf','../../config/environment','./mailApplication.attributes','exports','define'];(function(_0x11d3ad,_0x3925f2){var _0x43f97e=function(_0x1bb485){while(--_0x1bb485){_0x11d3ad['push'](_0x11d3ad['shift']());}};_0x43f97e(++_0x3925f2);}(_0x371b,0x114));var _0xb371=function(_0x3b56c0,_0xe100d8){_0x3b56c0=_0x3b56c0-0x0;var _0x377efe=_0x371b[_0x3b56c0];return _0x377efe;};'use strict';var _=require(_0xb371('0x0'));var util=require(_0xb371('0x1'));var logger=require(_0xb371('0x2'))(_0xb371('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb371('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb371('0x5'));var config=require(_0xb371('0x6'));var attributes=require(_0xb371('0x7'));module[_0xb371('0x8')]=function(_0x2fe6d3,_0x1df5ec){return _0x2fe6d3[_0xb371('0x9')](_0xb371('0xa'),attributes,{'tableName':'mail_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb371('0xb'),'collate':_0xb371('0xc')});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index fc5fa62..51baf2b 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 _0x80c9=['request','MailApplication,\x20%s,\x20%s','request\x20sent','MailApplication,\x20%s,\x20%s,\x20%s','error','code','message','info','result','UpdateMailApplication','body','options','where','limit','then','stringify','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http'];(function(_0x5454e2,_0x576f66){var _0x5b9409=function(_0x52b3dd){while(--_0x52b3dd){_0x5454e2['push'](_0x5454e2['shift']());}};_0x5b9409(++_0x576f66);}(_0x80c9,0x1d1));var _0x980c=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x80c9[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x980c('0x0'));var util=require(_0x980c('0x1'));var moment=require(_0x980c('0x2'));var BPromise=require(_0x980c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x980c('0x4'))['db'];var utils=require(_0x980c('0x5'));var logger=require(_0x980c('0x6'))(_0x980c('0x7'));var config=require('../../config/environment');var jayson=require(_0x980c('0x8'));var client=jayson[_0x980c('0x9')][_0x980c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3e405a,_0xa8fbb5,_0x133fbd){return new BPromise(function(_0x2a66a5,_0x237b07){return client[_0x980c('0xb')](_0x3e405a,_0x133fbd)['then'](function(_0x3f5175){logger['info'](_0x980c('0xc'),_0xa8fbb5,_0x980c('0xd'));logger['debug'](_0x980c('0xe'),_0xa8fbb5,_0x980c('0xd'),JSON['stringify'](_0x3f5175));if(_0x3f5175[_0x980c('0xf')]){if(_0x3f5175['error'][_0x980c('0x10')]===0x1f4){logger[_0x980c('0xf')](_0x980c('0xc'),_0xa8fbb5,_0x3f5175[_0x980c('0xf')]['message']);return _0x237b07(_0x3f5175[_0x980c('0xf')][_0x980c('0x11')]);}logger[_0x980c('0xf')]('MailApplication,\x20%s,\x20%s',_0xa8fbb5,_0x3f5175[_0x980c('0xf')][_0x980c('0x11')]);return _0x2a66a5(_0x3f5175[_0x980c('0xf')]['message']);}else{logger[_0x980c('0x12')](_0x980c('0xc'),_0xa8fbb5,_0x980c('0xd'));_0x2a66a5(_0x3f5175[_0x980c('0x13')]['message']);}})['catch'](function(_0x359b05){logger['error'](_0x980c('0xc'),_0xa8fbb5,_0x359b05);_0x237b07(_0x359b05);});});}exports[_0x980c('0x14')]=function(_0x5759b0){var _0x248d92=this;return new Promise(function(_0x4db599,_0x31ad67){return db['MailApplication']['update'](_0x5759b0[_0x980c('0x15')],{'raw':_0x5759b0['options']?_0x5759b0[_0x980c('0x16')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5759b0[_0x980c('0x16')]?_0x5759b0[_0x980c('0x16')][_0x980c('0x17')]||null:null,'attributes':_0x5759b0[_0x980c('0x16')]?_0x5759b0[_0x980c('0x16')]['attributes']||null:null,'limit':_0x5759b0['options']?_0x5759b0[_0x980c('0x16')][_0x980c('0x18')]||null:null})[_0x980c('0x19')](function(_0x16e5e3){logger[_0x980c('0x12')]('UpdateMailApplication',_0x5759b0);logger['debug'](_0x980c('0x14'),_0x5759b0,JSON[_0x980c('0x1a')](_0x16e5e3));_0x4db599(_0x16e5e3);})[_0x980c('0x1b')](function(_0x2e5b14){logger['error'](_0x980c('0x14'),_0x2e5b14[_0x980c('0x11')],_0x5759b0);_0x31ad67(_0x248d92[_0x980c('0xf')](0x1f4,_0x2e5b14[_0x980c('0x11')]));});});}; \ No newline at end of file +var _0x3448=['limit','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','MailApplication,\x20%s,\x20%s','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','result','UpdateMailApplication','MailApplication','update','options','raw','where','attributes'];(function(_0x159b6b,_0x52d23f){var _0x2dceb3=function(_0x221fec){while(--_0x221fec){_0x159b6b['push'](_0x159b6b['shift']());}};_0x2dceb3(++_0x52d23f);}(_0x3448,0xb6));var _0x8344=function(_0x5239b0,_0x1007cb){_0x5239b0=_0x5239b0-0x0;var _0xea0c90=_0x3448[_0x5239b0];return _0xea0c90;};'use strict';var _=require(_0x8344('0x0'));var util=require(_0x8344('0x1'));var moment=require(_0x8344('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8344('0x3'));var db=require(_0x8344('0x4'))['db'];var utils=require(_0x8344('0x5'));var logger=require('../../config/logger')(_0x8344('0x6'));var config=require('../../config/environment');var jayson=require(_0x8344('0x7'));var client=jayson[_0x8344('0x8')][_0x8344('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2a50da,_0x31f1bf,_0x3ff9cd){return new BPromise(function(_0x11086f,_0x5c148b){return client[_0x8344('0xa')](_0x2a50da,_0x3ff9cd)[_0x8344('0xb')](function(_0x4984fb){logger[_0x8344('0xc')](_0x8344('0xd'),_0x31f1bf,_0x8344('0xe'));logger[_0x8344('0xf')](_0x8344('0x10'),_0x31f1bf,'request\x20sent',JSON[_0x8344('0x11')](_0x4984fb));if(_0x4984fb[_0x8344('0x12')]){if(_0x4984fb[_0x8344('0x12')]['code']===0x1f4){logger[_0x8344('0x12')](_0x8344('0xd'),_0x31f1bf,_0x4984fb[_0x8344('0x12')][_0x8344('0x13')]);return _0x5c148b(_0x4984fb[_0x8344('0x12')][_0x8344('0x13')]);}logger[_0x8344('0x12')](_0x8344('0xd'),_0x31f1bf,_0x4984fb[_0x8344('0x12')][_0x8344('0x13')]);return _0x11086f(_0x4984fb[_0x8344('0x12')]['message']);}else{logger['info'](_0x8344('0xd'),_0x31f1bf,_0x8344('0xe'));_0x11086f(_0x4984fb[_0x8344('0x14')][_0x8344('0x13')]);}})['catch'](function(_0x18e632){logger[_0x8344('0x12')](_0x8344('0xd'),_0x31f1bf,_0x18e632);_0x5c148b(_0x18e632);});});}exports[_0x8344('0x15')]=function(_0x238da2){var _0x3cc391=this;return new Promise(function(_0xdac825,_0x4ec3ab){return db[_0x8344('0x16')][_0x8344('0x17')](_0x238da2['body'],{'raw':_0x238da2[_0x8344('0x18')]?_0x238da2[_0x8344('0x18')][_0x8344('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x238da2[_0x8344('0x18')]?_0x238da2['options'][_0x8344('0x1a')]||null:null,'attributes':_0x238da2['options']?_0x238da2['options'][_0x8344('0x1b')]||null:null,'limit':_0x238da2[_0x8344('0x18')]?_0x238da2[_0x8344('0x18')][_0x8344('0x1c')]||null:null})[_0x8344('0xb')](function(_0x4b2b53){logger[_0x8344('0xc')]('UpdateMailApplication',_0x238da2);logger[_0x8344('0xf')](_0x8344('0x15'),_0x238da2,JSON[_0x8344('0x11')](_0x4b2b53));_0xdac825(_0x4b2b53);})[_0x8344('0x1d')](function(_0xc89340){logger[_0x8344('0x12')]('UpdateMailApplication',_0xc89340['message'],_0x238da2);_0x4ec3ab(_0x3cc391[_0x8344('0x12')](0x1f4,_0xc89340[_0x8344('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index b2bf681..1239e09 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 _0x3f11=['addMessage','/:id/tags','tracked','mail','mailinteraction:addtags','put','mailinteraction:update','update','mailinteraction:destroy','destroy','exports','express','Router','../../components/auth/service','../../components/interaction/service','./mailInteraction.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create'];(function(_0x52684f,_0xff73fc){var _0x4a55f0=function(_0x8ce37c){while(--_0x8ce37c){_0x52684f['push'](_0x52684f['shift']());}};_0x4a55f0(++_0xff73fc);}(_0x3f11,0x184));var _0x13f1=function(_0x11f15e,_0x2cc181){_0x11f15e=_0x11f15e-0x0;var _0x27dad5=_0x3f11[_0x11f15e];return _0x27dad5;};'use strict';var express=require(_0x13f1('0x0'));var router=express[_0x13f1('0x1')]();var auth=require(_0x13f1('0x2'));var interaction=require(_0x13f1('0x3'));var controller=require(_0x13f1('0x4'));router['get']('/',auth[_0x13f1('0x5')](),controller[_0x13f1('0x6')]);router[_0x13f1('0x7')](_0x13f1('0x8'),auth['isAuthenticated'](),controller[_0x13f1('0x9')]);router[_0x13f1('0x7')](_0x13f1('0xa'),auth[_0x13f1('0x5')](),controller[_0x13f1('0xb')]);router['get'](_0x13f1('0xc'),auth[_0x13f1('0x5')](),controller[_0x13f1('0xd')]);router[_0x13f1('0x7')](_0x13f1('0xe'),auth[_0x13f1('0x5')](),controller[_0x13f1('0xf')]);router[_0x13f1('0x10')]('/',auth[_0x13f1('0x5')](),controller[_0x13f1('0x11')]);router['post'](_0x13f1('0xc'),auth['isAuthenticated'](),controller[_0x13f1('0x12')]);router[_0x13f1('0x10')](_0x13f1('0x13'),auth[_0x13f1('0x5')](),interaction[_0x13f1('0x14')](_0x13f1('0x15'),_0x13f1('0x16')),controller['addTags']);router[_0x13f1('0x17')](_0x13f1('0xa'),auth[_0x13f1('0x5')](),interaction[_0x13f1('0x14')](_0x13f1('0x15'),_0x13f1('0x18')),controller[_0x13f1('0x19')]);router['delete'](_0x13f1('0xa'),auth[_0x13f1('0x5')](),interaction[_0x13f1('0x14')](_0x13f1('0x15'),_0x13f1('0x1a')),controller[_0x13f1('0x1b')]);router['delete'](_0x13f1('0x13'),auth['isAuthenticated'](),controller['removeTags']);module[_0x13f1('0x1c')]=router; \ No newline at end of file +var _0xcb68=['delete','mailinteraction:destroy','destroy','removeTags','exports','express','Router','../../components/auth/service','../../components/interaction/service','./mailInteraction.controller','get','isAuthenticated','index','describe','/:id','show','/:id/messages','getMessages','/:id/download','post','/:id/tags','mail','mailinteraction:addtags','addTags','put','tracked','update'];(function(_0x2642cb,_0x4b917f){var _0xe6e41=function(_0x281676){while(--_0x281676){_0x2642cb['push'](_0x2642cb['shift']());}};_0xe6e41(++_0x4b917f);}(_0xcb68,0xdd));var _0x8cb6=function(_0x144863,_0x1dfd9d){_0x144863=_0x144863-0x0;var _0x588b12=_0xcb68[_0x144863];return _0x588b12;};'use strict';var express=require(_0x8cb6('0x0'));var router=express[_0x8cb6('0x1')]();var auth=require(_0x8cb6('0x2'));var interaction=require(_0x8cb6('0x3'));var controller=require(_0x8cb6('0x4'));router[_0x8cb6('0x5')]('/',auth[_0x8cb6('0x6')](),controller[_0x8cb6('0x7')]);router[_0x8cb6('0x5')]('/describe',auth['isAuthenticated'](),controller[_0x8cb6('0x8')]);router[_0x8cb6('0x5')](_0x8cb6('0x9'),auth['isAuthenticated'](),controller[_0x8cb6('0xa')]);router['get'](_0x8cb6('0xb'),auth[_0x8cb6('0x6')](),controller[_0x8cb6('0xc')]);router['get'](_0x8cb6('0xd'),auth[_0x8cb6('0x6')](),controller['download']);router[_0x8cb6('0xe')]('/',auth[_0x8cb6('0x6')](),controller['create']);router[_0x8cb6('0xe')](_0x8cb6('0xb'),auth[_0x8cb6('0x6')](),controller['addMessage']);router[_0x8cb6('0xe')](_0x8cb6('0xf'),auth[_0x8cb6('0x6')](),interaction['tracked'](_0x8cb6('0x10'),_0x8cb6('0x11')),controller[_0x8cb6('0x12')]);router[_0x8cb6('0x13')](_0x8cb6('0x9'),auth['isAuthenticated'](),interaction[_0x8cb6('0x14')](_0x8cb6('0x10'),'mailinteraction:update'),controller[_0x8cb6('0x15')]);router[_0x8cb6('0x16')](_0x8cb6('0x9'),auth[_0x8cb6('0x6')](),interaction[_0x8cb6('0x14')](_0x8cb6('0x10'),_0x8cb6('0x17')),controller[_0x8cb6('0x18')]);router['delete'](_0x8cb6('0xf'),auth[_0x8cb6('0x6')](),controller[_0x8cb6('0x19')]);module[_0x8cb6('0x1a')]=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index a68844c..492a9c8 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 _0xe5b9=['ENUM','out','INTEGER','sequelize','iconv','BOOLEAN','STRING','TEXT','DATE'];(function(_0xc7c028,_0x50607f){var _0x462ba3=function(_0x15586b){while(--_0x15586b){_0xc7c028['push'](_0xc7c028['shift']());}};_0x462ba3(++_0x50607f);}(_0xe5b9,0x78));var _0x9e5b=function(_0x21dc5c,_0x1beb44){_0x21dc5c=_0x21dc5c-0x0;var _0x409501=_0xe5b9[_0x21dc5c];return _0x409501;};'use strict';var Sequelize=require(_0x9e5b('0x0'));var iconv=require(_0x9e5b('0x1'));module['exports']={'closed':{'type':Sequelize[_0x9e5b('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x9e5b('0x3')]},'note':{'type':Sequelize[_0x9e5b('0x3')]},'inReplyTo':{'type':Sequelize[_0x9e5b('0x3')](0x1fe)},'to':{'type':Sequelize[_0x9e5b('0x3')]},'cc':{'type':Sequelize[_0x9e5b('0x4')]('long')},'subject':{'type':Sequelize[_0x9e5b('0x4')]()},'attach':{'type':Sequelize[_0x9e5b('0x2')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x9e5b('0x5')]},'substatus':{'type':Sequelize['STRING'](0x3c)},'substatusAt':{'type':Sequelize[_0x9e5b('0x5')]},'firstMsgDirection':{'type':Sequelize[_0x9e5b('0x6')]('in',_0x9e5b('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x9e5b('0x5')]},'lastMsgDirection':{'type':Sequelize[_0x9e5b('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x9e5b('0x2')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x9e5b('0x8')]}}; \ No newline at end of file +var _0xaf09=['iconv','exports','BOOLEAN','DATE','STRING','TEXT','long','out','ENUM','INTEGER','sequelize'];(function(_0x57ca64,_0x21c778){var _0xc8c958=function(_0x24485d){while(--_0x24485d){_0x57ca64['push'](_0x57ca64['shift']());}};_0xc8c958(++_0x21c778);}(_0xaf09,0xdb));var _0x9af0=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0xaf09[_0x28947d];return _0x12d2ee;};'use strict';var Sequelize=require(_0x9af0('0x0'));var iconv=require(_0x9af0('0x1'));module[_0x9af0('0x2')]={'closed':{'type':Sequelize[_0x9af0('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x9af0('0x4')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x9af0('0x5')]},'thirdDisposition':{'type':Sequelize[_0x9af0('0x5')]},'note':{'type':Sequelize[_0x9af0('0x5')]},'inReplyTo':{'type':Sequelize[_0x9af0('0x5')](0x1fe)},'to':{'type':Sequelize[_0x9af0('0x5')]},'cc':{'type':Sequelize[_0x9af0('0x6')](_0x9af0('0x7'))},'subject':{'type':Sequelize[_0x9af0('0x6')]()},'attach':{'type':Sequelize[_0x9af0('0x3')],'defaultValue':![]},'read1stAt':{'type':Sequelize['DATE']},'substatus':{'type':Sequelize['STRING'](0x3c)},'substatusAt':{'type':Sequelize[_0x9af0('0x4')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x9af0('0x8')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x9af0('0x9')]('in',_0x9af0('0x8')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueId':{'type':Sequelize[_0x9af0('0xa')]}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index f0ad736..c6fae9e 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 _0xd44b=['filters','intersection','attributes','fields','length','includeAll','include','merge','create','body','find','params','describe','ids','getMessages','findOne','MailMessage','hasOwnProperty','nolimit','sort','pick','where','filter','$gte','format','YYYY-MM-DD\x20HH:mm:ss','options','count','true','rows','addTags','setTags','omit','spread','color','removeTags','unix','toString','join','server','tmp','files','attachments','push','Attachment','Messages','bcc','createdAt','mkdirSync','each','from','missing.recipient@your.company.com','subject','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','Attachments','basename','existsSync','readFileSync','build','message%d.eml','download','unlinkSync','eml-format','zip-dir','moment','bluebird','util','path','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register','sendStatus','status','end','json','offset','limit','undefined','set','Content-Range','update','then','destroy','error','stack','name','index','map','rawAttributes','fieldName','type','key','getOptions','findAll','mail','user','catch','model','keys','MailInteraction','query'];(function(_0x19dcd6,_0x3880fb){var _0x111bc3=function(_0x214840){while(--_0x214840){_0x19dcd6['push'](_0x19dcd6['shift']());}};_0x111bc3(++_0x3880fb);}(_0xd44b,0x125));var _0xbd44=function(_0x19054f,_0x1bb86c){_0x19054f=_0x19054f-0x0;var _0x2ecd9d=_0xd44b[_0x19054f];return _0x2ecd9d;};'use strict';var emlformat=require(_0xbd44('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbd44('0x1'));var moment=require(_0xbd44('0x2'));var BPromise=require(_0xbd44('0x3'));var util=require(_0xbd44('0x4'));var path=require(_0xbd44('0x5'));var fs=require('fs');var _=require('lodash');var juice=require('juice');var Redis=require(_0xbd44('0x6'));var interaction=require(_0xbd44('0x7'));var qs=require(_0xbd44('0x8'));var logger=require(_0xbd44('0x9'))(_0xbd44('0xa'));var config=require(_0xbd44('0xb'));var db=require(_0xbd44('0xc'))['db'];var htmlEntities=require('html-entities');config[_0xbd44('0xd')]=_[_0xbd44('0xe')](config['redis'],{'host':_0xbd44('0xf'),'port':0x18eb});var socket=require(_0xbd44('0x10'))(new Redis(config[_0xbd44('0xd')]));require(_0xbd44('0x11'))[_0xbd44('0x12')](socket);function respondWithStatusCode(_0x3c5438,_0x328654){_0x328654=_0x328654||0xcc;return function(_0x354334){if(_0x354334){return _0x3c5438[_0xbd44('0x13')](_0x328654);}return _0x3c5438[_0xbd44('0x14')](_0x328654)[_0xbd44('0x15')]();};}function respondWithResult(_0x3ae631,_0x5962b8){_0x5962b8=_0x5962b8||0xc8;return function(_0xfe6266){if(_0xfe6266){return _0x3ae631['status'](_0x5962b8)[_0xbd44('0x16')](_0xfe6266);}};}function respondWithFilteredResult(_0x19b318,_0x3c1491){return function(_0x19994b){if(_0x19994b){var _0x5ecf80=typeof _0x3c1491[_0xbd44('0x17')]==='undefined'&&typeof _0x3c1491[_0xbd44('0x18')]===_0xbd44('0x19');var _0x2e9f94=_0x19994b['count'];var _0x46c68d=_0x5ecf80?0x0:_0x3c1491[_0xbd44('0x17')];var _0x369c4d=_0x5ecf80?_0x19994b['count']:_0x3c1491[_0xbd44('0x17')]+_0x3c1491[_0xbd44('0x18')];var _0x49dae9;if(_0x369c4d>=_0x2e9f94){_0x369c4d=_0x2e9f94;_0x49dae9=0xc8;}else{_0x49dae9=0xce;}_0x19b318['status'](_0x49dae9);return _0x19b318[_0xbd44('0x1a')](_0xbd44('0x1b'),_0x46c68d+'-'+_0x369c4d+'/'+_0x2e9f94)[_0xbd44('0x16')](_0x19994b);}return null;};}function saveUpdates(_0x2a0c9f){return function(_0x4e2f55){if(_0x4e2f55){return _0x4e2f55[_0xbd44('0x1c')](_0x2a0c9f)[_0xbd44('0x1d')](function(_0x4f8447){return _0x4f8447;});}return null;};}function removeEntity(_0x58ce84){return function(_0x5aee6f){if(_0x5aee6f){return _0x5aee6f[_0xbd44('0x1e')]()[_0xbd44('0x1d')](function(){_0x58ce84['status'](0xcc)[_0xbd44('0x15')]();});}};}function handleEntityNotFound(_0x53a448){return function(_0x40bc35){if(!_0x40bc35){_0x53a448['sendStatus'](0x194);}return _0x40bc35;};}function handleError(_0x360161,_0x973f5){_0x973f5=_0x973f5||0x1f4;return function(_0x352991){logger[_0xbd44('0x1f')](_0x352991[_0xbd44('0x20')]);if(_0x352991[_0xbd44('0x21')]){delete _0x352991[_0xbd44('0x21')];}_0x360161[_0xbd44('0x14')](_0x973f5)['send'](_0x352991);};}exports[_0xbd44('0x22')]=function(_0x3e81ed,_0x3a196f){var _0x523045={};var _0x2c3c3d=_[_0xbd44('0x23')](db['MailInteraction'][_0xbd44('0x24')],function(_0x3099a9){return{'name':_0x3099a9[_0xbd44('0x25')],'type':_0x3099a9[_0xbd44('0x26')][_0xbd44('0x27')]};});_0x523045=qs[_0xbd44('0x28')](_0x2c3c3d,_0x3e81ed);return interaction[_0xbd44('0x29')](_0xbd44('0x2a'),_0x3e81ed['query'],_0x3e81ed[_0xbd44('0x2b')],_0x523045,_0x2c3c3d)[_0xbd44('0x1d')](respondWithFilteredResult(_0x3a196f,_0x523045))[_0xbd44('0x2c')](handleError(_0x3a196f,null));};exports['show']=function(_0x3019d8,_0x3bc311){var _0x3cf3d6={'raw':![],'where':{'id':_0x3019d8['params']['id']}},_0xfc4dd7={};_0xfc4dd7[_0xbd44('0x2d')]=_[_0xbd44('0x2e')](db[_0xbd44('0x2f')]['rawAttributes']);_0xfc4dd7[_0xbd44('0x30')]=_[_0xbd44('0x2e')](_0x3019d8[_0xbd44('0x30')]);_0xfc4dd7[_0xbd44('0x31')]=_[_0xbd44('0x32')](_0xfc4dd7[_0xbd44('0x2d')],_0xfc4dd7['query']);_0x3cf3d6[_0xbd44('0x33')]=_['intersection'](_0xfc4dd7['model'],qs[_0xbd44('0x34')](_0x3019d8[_0xbd44('0x30')]['fields']));_0x3cf3d6[_0xbd44('0x33')]=_0x3cf3d6[_0xbd44('0x33')][_0xbd44('0x35')]?_0x3cf3d6['attributes']:_0xfc4dd7[_0xbd44('0x2d')];if(_0x3019d8[_0xbd44('0x30')][_0xbd44('0x36')]){_0x3cf3d6[_0xbd44('0x37')]=[{'all':!![]}];}_0x3cf3d6=_[_0xbd44('0x38')]({},_0x3cf3d6,_0x3019d8['options']);return db[_0xbd44('0x2f')]['find'](_0x3cf3d6)[_0xbd44('0x1d')](handleEntityNotFound(_0x3bc311,null))[_0xbd44('0x1d')](respondWithResult(_0x3bc311,null))['catch'](handleError(_0x3bc311,null));};exports[_0xbd44('0x39')]=function(_0x1ec553,_0x1b8b4a){return db[_0xbd44('0x2f')]['create'](_0x1ec553[_0xbd44('0x3a')],{})[_0xbd44('0x1d')](respondWithResult(_0x1b8b4a,0xc9))[_0xbd44('0x2c')](handleError(_0x1b8b4a,null));};exports[_0xbd44('0x1c')]=function(_0x264207,_0x3b15bb){if(_0x264207[_0xbd44('0x3a')]['id']){delete _0x264207[_0xbd44('0x3a')]['id'];}return db[_0xbd44('0x2f')][_0xbd44('0x3b')]({'where':{'id':_0x264207[_0xbd44('0x3c')]['id']}})[_0xbd44('0x1d')](handleEntityNotFound(_0x3b15bb,null))[_0xbd44('0x1d')](saveUpdates(_0x264207[_0xbd44('0x3a')],null))[_0xbd44('0x1d')](respondWithResult(_0x3b15bb,null))['catch'](handleError(_0x3b15bb,null));};exports[_0xbd44('0x1e')]=function(_0x1bfdb7,_0x41699b){return db['MailInteraction']['find']({'where':{'id':_0x1bfdb7[_0xbd44('0x3c')]['id']}})[_0xbd44('0x1d')](handleEntityNotFound(_0x41699b,null))[_0xbd44('0x1d')](removeEntity(_0x41699b,null))['catch'](handleError(_0x41699b,null));};exports['describe']=function(_0x39355a,_0x26d730){return db[_0xbd44('0x2f')][_0xbd44('0x3d')]()[_0xbd44('0x1d')](respondWithResult(_0x26d730,null))[_0xbd44('0x2c')](handleError(_0x26d730,null));};exports['addMessage']=function(_0x2ef671,_0x465ea4){return db['MailMessage'][_0xbd44('0x3b')]({'where':{'id':_0x2ef671[_0xbd44('0x3c')]['id']}})[_0xbd44('0x1d')](handleEntityNotFound(_0x465ea4,null))[_0xbd44('0x1d')](function(_0x213ddc){if(_0x213ddc){return _0x213ddc['addMessage'](_0x2ef671[_0xbd44('0x3a')][_0xbd44('0x3e')],_['omit'](_0x2ef671[_0xbd44('0x3a')],[_0xbd44('0x3e'),'id'])||{});}})[_0xbd44('0x1d')](respondWithResult(_0x465ea4,null))[_0xbd44('0x2c')](handleError(_0x465ea4,null));};exports[_0xbd44('0x3f')]=function(_0x5edaff,_0x1c7eaf){var _0x517cab={'raw':![],'where':{}};var _0x8904ef={};var _0x4ab2fd={'count':0x0,'rows':[]};return db['MailInteraction'][_0xbd44('0x40')]({'where':{'id':_0x5edaff['params']['id']}})[_0xbd44('0x1d')](handleEntityNotFound(_0x1c7eaf,null))[_0xbd44('0x1d')](function(_0x23caee){if(_0x23caee){_0x8904ef['model']=_[_0xbd44('0x2e')](db[_0xbd44('0x41')]['rawAttributes']);_0x8904ef['query']=_[_0xbd44('0x2e')](_0x5edaff['query']);_0x8904ef[_0xbd44('0x31')]=_['intersection'](_0x8904ef['model'],_0x8904ef[_0xbd44('0x30')]);_0x517cab[_0xbd44('0x33')]=_[_0xbd44('0x32')](_0x8904ef[_0xbd44('0x2d')],qs['fields'](_0x5edaff['query'][_0xbd44('0x34')]));_0x517cab['attributes']=_0x517cab[_0xbd44('0x33')][_0xbd44('0x35')]?_0x517cab[_0xbd44('0x33')]:_0x8904ef[_0xbd44('0x2d')];if(!_0x5edaff[_0xbd44('0x30')][_0xbd44('0x42')](_0xbd44('0x43'))){_0x517cab[_0xbd44('0x18')]=qs[_0xbd44('0x18')](_0x5edaff[_0xbd44('0x30')][_0xbd44('0x18')]);_0x517cab['offset']=qs['offset'](_0x5edaff['query'][_0xbd44('0x17')]);}_0x517cab['order']=qs[_0xbd44('0x44')](_0x5edaff[_0xbd44('0x30')][_0xbd44('0x44')]);_0x517cab['where']=qs['filters'](_[_0xbd44('0x45')](_0x5edaff['query'],_0x8904ef['filters']));_0x517cab[_0xbd44('0x46')]['MailInteractionId']=_0x23caee['id'];if(_0x5edaff[_0xbd44('0x30')]['filter']){_0x517cab[_0xbd44('0x46')]=_[_0xbd44('0x38')](_0x517cab[_0xbd44('0x46')],{'$or':_[_0xbd44('0x23')](_0x517cab[_0xbd44('0x33')],function(_0x386225){var _0x1f3118={};_0x1f3118[_0x386225]={'$like':'%'+_0x5edaff[_0xbd44('0x30')][_0xbd44('0x47')]+'%'};return _0x1f3118;})});}if(_0x5edaff[_0xbd44('0x30')][_0xbd44('0x48')]){var _0x367ab4=_0x5edaff['query'][_0xbd44('0x48')]['split'](',');var _0x4fc6ec={};_0x4fc6ec[_0x367ab4[0x0]]={'$gte':moment(_0x367ab4[0x1])[_0xbd44('0x49')](_0xbd44('0x4a'))};_0x517cab[_0xbd44('0x46')]=_[_0xbd44('0x38')](_0x517cab[_0xbd44('0x46')],_0x4fc6ec);}_0x517cab=_[_0xbd44('0x38')]({},_0x517cab,_0x5edaff[_0xbd44('0x4b')]);return db[_0xbd44('0x41')][_0xbd44('0x4c')]({'where':_0x517cab[_0xbd44('0x46')]})[_0xbd44('0x1d')](function(_0x45fac2){_0x4ab2fd[_0xbd44('0x4c')]=_0x45fac2;if(_0x5edaff[_0xbd44('0x30')]['includeAll']){_0x517cab[_0xbd44('0x37')]=[{'all':!![]}];}return db[_0xbd44('0x41')][_0xbd44('0x29')](_0x517cab);})['then'](function(_0x563fef){if(_0x5edaff['query']['inlineCss']===_0xbd44('0x4d')){for(var _0x583f28=0x0;_0x583f28<_0x563fef[_0xbd44('0x35')];_0x583f28++){_0x563fef[_0x583f28][_0xbd44('0x3a')]=juice(_0x563fef[_0x583f28][_0xbd44('0x3a')]);}}_0x4ab2fd[_0xbd44('0x4e')]=_0x563fef;return _0x4ab2fd;});}})[_0xbd44('0x1d')](respondWithFilteredResult(_0x1c7eaf,_0x517cab))[_0xbd44('0x2c')](handleError(_0x1c7eaf,null));};exports[_0xbd44('0x4f')]=function(_0x59eb3d,_0x4fa259){return db[_0xbd44('0x2f')][_0xbd44('0x3b')]({'where':{'id':_0x59eb3d[_0xbd44('0x3c')]['id']}})[_0xbd44('0x1d')](handleEntityNotFound(_0x4fa259,null))[_0xbd44('0x1d')](function(_0xea3cef){if(_0xea3cef){return _0xea3cef[_0xbd44('0x50')](_0x59eb3d[_0xbd44('0x3a')][_0xbd44('0x3e')],_[_0xbd44('0x51')](_0x59eb3d[_0xbd44('0x3a')],[_0xbd44('0x3e'),'id'])||{})[_0xbd44('0x52')](function(){return db['Tag']['findAll']({'attributes':['id',_0xbd44('0x21'),_0xbd44('0x53')],'where':{'id':_0x59eb3d[_0xbd44('0x3a')][_0xbd44('0x3e')]}});})[_0xbd44('0x1d')](function(_0x340880){socket['emit']('mailInteractionTags:save',{'id':Number(_0x59eb3d[_0xbd44('0x3c')]['id']),'tags':_0x340880||[]});return{'id':Number(_0x59eb3d[_0xbd44('0x3c')]['id']),'tags':_0x340880||[]};});}})[_0xbd44('0x1d')](respondWithResult(_0x4fa259,null))[_0xbd44('0x2c')](handleError(_0x4fa259,null));};exports[_0xbd44('0x54')]=function(_0x50005b,_0x48cd61){return db['MailInteraction']['find']({'where':{'id':_0x50005b[_0xbd44('0x3c')]['id']}})[_0xbd44('0x1d')](handleEntityNotFound(_0x48cd61,null))['then'](function(_0x294f85){if(_0x294f85){return _0x294f85['removeTags'](_0x50005b[_0xbd44('0x30')][_0xbd44('0x3e')]);}})['then'](respondWithStatusCode(_0x48cd61,null))[_0xbd44('0x2c')](handleError(_0x48cd61,null));};exports['download']=function(_0x216551,_0x2d2fee){var _0xde254f=moment()[_0xbd44('0x55')]()[_0xbd44('0x56')]();var _0x5d5ec2=path[_0xbd44('0x57')](config['root'],_0xbd44('0x58'),'files',_0xbd44('0x59'));var _0x34a90d=path[_0xbd44('0x57')](config['root'],_0xbd44('0x58'),_0xbd44('0x5a'),_0xbd44('0x5b'));var _0x1b76e5=path[_0xbd44('0x57')](_0x5d5ec2,_0xde254f);var _0x8c7b9b=util[_0xbd44('0x49')]('transcript-%d-%s.zip',_0x216551[_0xbd44('0x3c')]['id'],_0xde254f);var _0x338920=path[_0xbd44('0x57')](_0x5d5ec2,_0x8c7b9b);var _0x301286=[];if(_0x216551['query'][_0xbd44('0x5b')]){_0x301286[_0xbd44('0x5c')]({'model':db[_0xbd44('0x5d')],'as':'Attachments','raw':!![]});}var _0x3f2983=[{'model':db['MailMessage'],'as':_0xbd44('0x5e'),'attributes':['id',_0xbd44('0x3a'),'from','to','cc',_0xbd44('0x5f'),'subject',_0xbd44('0x60')],'where':{'secret':![]},'order':qs[_0xbd44('0x44')]('id'),'include':_0x301286}];return db[_0xbd44('0x2f')]['find']({'where':{'id':_0x216551[_0xbd44('0x3c')]['id']},'include':_0x3f2983})[_0xbd44('0x1d')](handleEntityNotFound(_0x2d2fee,null))[_0xbd44('0x1d')](function(_0x2af629){if(_0x2af629&&_0x2af629[_0xbd44('0x5e')]){var _0x2d42ab=_0x2af629['get']({'plain':!![]});fs[_0xbd44('0x61')](_0x1b76e5);return BPromise[_0xbd44('0x62')](_0x2d42ab[_0xbd44('0x5e')],function(_0x1f75a2,_0x45a8ee){var _0x29e9b0={'from':_0x1f75a2[_0xbd44('0x63')],'to':_0x1f75a2['to']||_0xbd44('0x64'),'subject':_0x1f75a2[_0xbd44('0x65')],'html':htmlEntities[_0xbd44('0x66')](_0x1f75a2[_0xbd44('0x3a')]),'headers':{'Date':moment(_0x1f75a2['createdAt'])['format'](_0xbd44('0x67'))},'attachments':[]};if(_0x1f75a2['cc']){_0x29e9b0[_0xbd44('0x68')]['Cc']=_0x1f75a2['cc'];}if(_0x1f75a2[_0xbd44('0x5f')]){_0x29e9b0[_0xbd44('0x68')][_0xbd44('0x69')]=_0x1f75a2['bcc'];}return new BPromise(function(_0x46370d,_0x224b66){if(_0x1f75a2['Attachments']){for(var _0x4cf71a=0x0;_0x4cf71a<_0x1f75a2[_0xbd44('0x6a')][_0xbd44('0x35')];_0x4cf71a++){var _0x3bb957=_0x1f75a2[_0xbd44('0x6a')][_0x4cf71a];var _0x108ebc=path[_0xbd44('0x57')](_0x34a90d,_0x3bb957[_0xbd44('0x6b')]);if(fs[_0xbd44('0x6c')](_0x108ebc)){_0x29e9b0[_0xbd44('0x5b')]['push']({'name':_0x3bb957[_0xbd44('0x21')],'contentType':_0x3bb957['type'],'data':fs[_0xbd44('0x6d')](_0x108ebc)});}}}emlformat[_0xbd44('0x6e')](_0x29e9b0,function(_0x37b347,_0x4cc7a5){if(_0x37b347)return _0x224b66(_0x37b347);fs['writeFileSync'](path[_0xbd44('0x57')](_0x1b76e5,util['format'](_0xbd44('0x6f'),_0x45a8ee)),_0x4cc7a5);return _0x46370d(_0x4cc7a5);});});})[_0xbd44('0x1d')](function(){return new BPromise(function(_0x2af13b,_0x414530){zipdir(_0x1b76e5,{'saveTo':_0x338920},function(_0x353142,_0x102db6){if(_0x353142)return _0x414530(_0x353142);return _0x2af13b(_0x102db6);});})['then'](function(){return new BPromise(function(_0x295b4b,_0x37b9f5){rimraf(_0x1b76e5,function(_0x15a177){if(_0x15a177)_0x37b9f5(_0x15a177);return _0x295b4b();});});})[_0xbd44('0x1d')](function(){return _0x2d2fee[_0xbd44('0x70')](_0x338920,_0x8c7b9b,function(_0x5a7b37){if(!_0x5a7b37)fs[_0xbd44('0x71')](_0x338920);});});});}else{return _0x2d2fee[_0xbd44('0x13')](0xc8);}})[_0xbd44('0x2c')](handleError(_0x2d2fee,null));}; \ No newline at end of file +var _0xf481=['juice','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','html-entities','redis','localhost','socket.io-emitter','./mailInteraction.socket','register','status','end','json','undefined','limit','offset','count','set','Content-Range','then','destroy','sendStatus','error','stack','fieldName','type','key','findAll','mail','query','user','catch','show','params','keys','MailInteraction','rawAttributes','filters','intersection','model','attributes','fields','includeAll','include','merge','options','find','create','body','update','describe','addMessage','ids','omit','getMessages','MailMessage','hasOwnProperty','nolimit','sort','where','pick','MailInteractionId','filter','map','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','length','rows','spread','name','emit','mailInteractionTags:save','removeTags','download','unix','toString','root','server','files','tmp','join','attachments','transcript-%d-%s.zip','push','Messages','from','bcc','subject','mkdirSync','each','createdAt','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Attachments','basename','existsSync','readFileSync','build','unlinkSync','rimraf','moment','util','path','lodash'];(function(_0x35885a,_0x42fed7){var _0xe86249=function(_0x98edb3){while(--_0x98edb3){_0x35885a['push'](_0x35885a['shift']());}};_0xe86249(++_0x42fed7);}(_0xf481,0xd9));var _0x1f48=function(_0x11e1ab,_0x4bb093){_0x11e1ab=_0x11e1ab-0x0;var _0x530ca0=_0xf481[_0x11e1ab];return _0x530ca0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1f48('0x0'));var zipdir=require('zip-dir');var moment=require(_0x1f48('0x1'));var BPromise=require('bluebird');var util=require(_0x1f48('0x2'));var path=require(_0x1f48('0x3'));var fs=require('fs');var _=require(_0x1f48('0x4'));var juice=require(_0x1f48('0x5'));var Redis=require(_0x1f48('0x6'));var interaction=require(_0x1f48('0x7'));var qs=require(_0x1f48('0x8'));var logger=require(_0x1f48('0x9'))(_0x1f48('0xa'));var config=require(_0x1f48('0xb'));var db=require(_0x1f48('0xc'))['db'];var htmlEntities=require(_0x1f48('0xd'));config[_0x1f48('0xe')]=_['defaults'](config[_0x1f48('0xe')],{'host':_0x1f48('0xf'),'port':0x18eb});var socket=require(_0x1f48('0x10'))(new Redis(config[_0x1f48('0xe')]));require(_0x1f48('0x11'))[_0x1f48('0x12')](socket);function respondWithStatusCode(_0x21b4d9,_0x128ec8){_0x128ec8=_0x128ec8||0xcc;return function(_0x40b3da){if(_0x40b3da){return _0x21b4d9['sendStatus'](_0x128ec8);}return _0x21b4d9[_0x1f48('0x13')](_0x128ec8)[_0x1f48('0x14')]();};}function respondWithResult(_0x559bc2,_0x1d1ffe){_0x1d1ffe=_0x1d1ffe||0xc8;return function(_0x49fcd7){if(_0x49fcd7){return _0x559bc2[_0x1f48('0x13')](_0x1d1ffe)[_0x1f48('0x15')](_0x49fcd7);}};}function respondWithFilteredResult(_0x297525,_0x4c2a58){return function(_0x2aa37c){if(_0x2aa37c){var _0x173cc8=typeof _0x4c2a58['offset']===_0x1f48('0x16')&&typeof _0x4c2a58[_0x1f48('0x17')]===_0x1f48('0x16');var _0xbb4939=_0x2aa37c['count'];var _0x5aa82e=_0x173cc8?0x0:_0x4c2a58[_0x1f48('0x18')];var _0x59aa7c=_0x173cc8?_0x2aa37c[_0x1f48('0x19')]:_0x4c2a58['offset']+_0x4c2a58[_0x1f48('0x17')];var _0x2a62ce;if(_0x59aa7c>=_0xbb4939){_0x59aa7c=_0xbb4939;_0x2a62ce=0xc8;}else{_0x2a62ce=0xce;}_0x297525[_0x1f48('0x13')](_0x2a62ce);return _0x297525[_0x1f48('0x1a')](_0x1f48('0x1b'),_0x5aa82e+'-'+_0x59aa7c+'/'+_0xbb4939)[_0x1f48('0x15')](_0x2aa37c);}return null;};}function saveUpdates(_0x4ced91){return function(_0x4dc13b){if(_0x4dc13b){return _0x4dc13b['update'](_0x4ced91)[_0x1f48('0x1c')](function(_0x3c3fa8){return _0x3c3fa8;});}return null;};}function removeEntity(_0x45c897){return function(_0x33d983){if(_0x33d983){return _0x33d983[_0x1f48('0x1d')]()[_0x1f48('0x1c')](function(){_0x45c897[_0x1f48('0x13')](0xcc)[_0x1f48('0x14')]();});}};}function handleEntityNotFound(_0x1b17f8){return function(_0x476cb2){if(!_0x476cb2){_0x1b17f8[_0x1f48('0x1e')](0x194);}return _0x476cb2;};}function handleError(_0xfef0c0,_0x4faad0){_0x4faad0=_0x4faad0||0x1f4;return function(_0x270879){logger[_0x1f48('0x1f')](_0x270879[_0x1f48('0x20')]);if(_0x270879['name']){delete _0x270879['name'];}_0xfef0c0[_0x1f48('0x13')](_0x4faad0)['send'](_0x270879);};}exports['index']=function(_0x4a4146,_0x46ea56){var _0x564d31={};var _0x1a5fda=_['map'](db['MailInteraction']['rawAttributes'],function(_0x4401d6){return{'name':_0x4401d6[_0x1f48('0x21')],'type':_0x4401d6[_0x1f48('0x22')][_0x1f48('0x23')]};});_0x564d31=qs['getOptions'](_0x1a5fda,_0x4a4146);return interaction[_0x1f48('0x24')](_0x1f48('0x25'),_0x4a4146[_0x1f48('0x26')],_0x4a4146[_0x1f48('0x27')],_0x564d31,_0x1a5fda)[_0x1f48('0x1c')](respondWithFilteredResult(_0x46ea56,_0x564d31))[_0x1f48('0x28')](handleError(_0x46ea56,null));};exports[_0x1f48('0x29')]=function(_0x39c75e,_0x393bba){var _0x1fea2e={'raw':![],'where':{'id':_0x39c75e[_0x1f48('0x2a')]['id']}},_0x19848b={};_0x19848b['model']=_[_0x1f48('0x2b')](db[_0x1f48('0x2c')][_0x1f48('0x2d')]);_0x19848b[_0x1f48('0x26')]=_[_0x1f48('0x2b')](_0x39c75e[_0x1f48('0x26')]);_0x19848b[_0x1f48('0x2e')]=_[_0x1f48('0x2f')](_0x19848b[_0x1f48('0x30')],_0x19848b[_0x1f48('0x26')]);_0x1fea2e[_0x1f48('0x31')]=_[_0x1f48('0x2f')](_0x19848b[_0x1f48('0x30')],qs['fields'](_0x39c75e[_0x1f48('0x26')][_0x1f48('0x32')]));_0x1fea2e[_0x1f48('0x31')]=_0x1fea2e[_0x1f48('0x31')]['length']?_0x1fea2e['attributes']:_0x19848b[_0x1f48('0x30')];if(_0x39c75e['query'][_0x1f48('0x33')]){_0x1fea2e[_0x1f48('0x34')]=[{'all':!![]}];}_0x1fea2e=_[_0x1f48('0x35')]({},_0x1fea2e,_0x39c75e[_0x1f48('0x36')]);return db['MailInteraction'][_0x1f48('0x37')](_0x1fea2e)[_0x1f48('0x1c')](handleEntityNotFound(_0x393bba,null))['then'](respondWithResult(_0x393bba,null))[_0x1f48('0x28')](handleError(_0x393bba,null));};exports['create']=function(_0xe7b96f,_0x4a7ac2){return db[_0x1f48('0x2c')][_0x1f48('0x38')](_0xe7b96f[_0x1f48('0x39')],{})[_0x1f48('0x1c')](respondWithResult(_0x4a7ac2,0xc9))['catch'](handleError(_0x4a7ac2,null));};exports[_0x1f48('0x3a')]=function(_0x32cca9,_0x488b2d){if(_0x32cca9[_0x1f48('0x39')]['id']){delete _0x32cca9[_0x1f48('0x39')]['id'];}return db['MailInteraction']['find']({'where':{'id':_0x32cca9['params']['id']}})[_0x1f48('0x1c')](handleEntityNotFound(_0x488b2d,null))[_0x1f48('0x1c')](saveUpdates(_0x32cca9[_0x1f48('0x39')],null))[_0x1f48('0x1c')](respondWithResult(_0x488b2d,null))[_0x1f48('0x28')](handleError(_0x488b2d,null));};exports[_0x1f48('0x1d')]=function(_0x979732,_0x48732e){return db[_0x1f48('0x2c')][_0x1f48('0x37')]({'where':{'id':_0x979732[_0x1f48('0x2a')]['id']}})[_0x1f48('0x1c')](handleEntityNotFound(_0x48732e,null))['then'](removeEntity(_0x48732e,null))['catch'](handleError(_0x48732e,null));};exports[_0x1f48('0x3b')]=function(_0x1ff7e4,_0x4770b5){return db[_0x1f48('0x2c')][_0x1f48('0x3b')]()[_0x1f48('0x1c')](respondWithResult(_0x4770b5,null))[_0x1f48('0x28')](handleError(_0x4770b5,null));};exports[_0x1f48('0x3c')]=function(_0x37c0a1,_0x534e4c){return db['MailMessage'][_0x1f48('0x37')]({'where':{'id':_0x37c0a1['params']['id']}})[_0x1f48('0x1c')](handleEntityNotFound(_0x534e4c,null))[_0x1f48('0x1c')](function(_0x2dd349){if(_0x2dd349){return _0x2dd349[_0x1f48('0x3c')](_0x37c0a1['body'][_0x1f48('0x3d')],_[_0x1f48('0x3e')](_0x37c0a1[_0x1f48('0x39')],['ids','id'])||{});}})[_0x1f48('0x1c')](respondWithResult(_0x534e4c,null))['catch'](handleError(_0x534e4c,null));};exports[_0x1f48('0x3f')]=function(_0x507c0c,_0x20c06e){var _0x38058e={'raw':![],'where':{}};var _0x3606fe={};var _0x4db7f8={'count':0x0,'rows':[]};return db['MailInteraction']['findOne']({'where':{'id':_0x507c0c['params']['id']}})[_0x1f48('0x1c')](handleEntityNotFound(_0x20c06e,null))[_0x1f48('0x1c')](function(_0xfae078){if(_0xfae078){_0x3606fe[_0x1f48('0x30')]=_[_0x1f48('0x2b')](db[_0x1f48('0x40')]['rawAttributes']);_0x3606fe[_0x1f48('0x26')]=_[_0x1f48('0x2b')](_0x507c0c[_0x1f48('0x26')]);_0x3606fe['filters']=_[_0x1f48('0x2f')](_0x3606fe[_0x1f48('0x30')],_0x3606fe[_0x1f48('0x26')]);_0x38058e[_0x1f48('0x31')]=_[_0x1f48('0x2f')](_0x3606fe[_0x1f48('0x30')],qs[_0x1f48('0x32')](_0x507c0c[_0x1f48('0x26')]['fields']));_0x38058e['attributes']=_0x38058e[_0x1f48('0x31')]['length']?_0x38058e[_0x1f48('0x31')]:_0x3606fe[_0x1f48('0x30')];if(!_0x507c0c[_0x1f48('0x26')][_0x1f48('0x41')](_0x1f48('0x42'))){_0x38058e[_0x1f48('0x17')]=qs[_0x1f48('0x17')](_0x507c0c[_0x1f48('0x26')][_0x1f48('0x17')]);_0x38058e[_0x1f48('0x18')]=qs[_0x1f48('0x18')](_0x507c0c['query'][_0x1f48('0x18')]);}_0x38058e['order']=qs[_0x1f48('0x43')](_0x507c0c[_0x1f48('0x26')]['sort']);_0x38058e[_0x1f48('0x44')]=qs[_0x1f48('0x2e')](_[_0x1f48('0x45')](_0x507c0c['query'],_0x3606fe['filters']));_0x38058e[_0x1f48('0x44')][_0x1f48('0x46')]=_0xfae078['id'];if(_0x507c0c[_0x1f48('0x26')][_0x1f48('0x47')]){_0x38058e[_0x1f48('0x44')]=_[_0x1f48('0x35')](_0x38058e[_0x1f48('0x44')],{'$or':_[_0x1f48('0x48')](_0x38058e[_0x1f48('0x31')],function(_0x217556){var _0x12bfd={};_0x12bfd[_0x217556]={'$like':'%'+_0x507c0c[_0x1f48('0x26')][_0x1f48('0x47')]+'%'};return _0x12bfd;})});}if(_0x507c0c[_0x1f48('0x26')][_0x1f48('0x49')]){var _0x2a9ed5=_0x507c0c[_0x1f48('0x26')]['$gte'][_0x1f48('0x4a')](',');var _0x3e5454={};_0x3e5454[_0x2a9ed5[0x0]]={'$gte':moment(_0x2a9ed5[0x1])[_0x1f48('0x4b')](_0x1f48('0x4c'))};_0x38058e[_0x1f48('0x44')]=_['merge'](_0x38058e[_0x1f48('0x44')],_0x3e5454);}_0x38058e=_[_0x1f48('0x35')]({},_0x38058e,_0x507c0c[_0x1f48('0x36')]);return db['MailMessage'][_0x1f48('0x19')]({'where':_0x38058e['where']})[_0x1f48('0x1c')](function(_0x4b9965){_0x4db7f8[_0x1f48('0x19')]=_0x4b9965;if(_0x507c0c[_0x1f48('0x26')][_0x1f48('0x33')]){_0x38058e[_0x1f48('0x34')]=[{'all':!![]}];}return db['MailMessage'][_0x1f48('0x24')](_0x38058e);})['then'](function(_0x4b21aa){if(_0x507c0c['query'][_0x1f48('0x4d')]==='true'){for(var _0x1700f5=0x0;_0x1700f5<_0x4b21aa[_0x1f48('0x4e')];_0x1700f5++){_0x4b21aa[_0x1700f5][_0x1f48('0x39')]=juice(_0x4b21aa[_0x1700f5][_0x1f48('0x39')]);}}_0x4db7f8[_0x1f48('0x4f')]=_0x4b21aa;return _0x4db7f8;});}})[_0x1f48('0x1c')](respondWithFilteredResult(_0x20c06e,_0x38058e))[_0x1f48('0x28')](handleError(_0x20c06e,null));};exports['addTags']=function(_0x5ec395,_0x4d9f00){return db['MailInteraction'][_0x1f48('0x37')]({'where':{'id':_0x5ec395[_0x1f48('0x2a')]['id']}})[_0x1f48('0x1c')](handleEntityNotFound(_0x4d9f00,null))[_0x1f48('0x1c')](function(_0x484f4f){if(_0x484f4f){return _0x484f4f['setTags'](_0x5ec395[_0x1f48('0x39')][_0x1f48('0x3d')],_[_0x1f48('0x3e')](_0x5ec395[_0x1f48('0x39')],[_0x1f48('0x3d'),'id'])||{})[_0x1f48('0x50')](function(){return db['Tag']['findAll']({'attributes':['id',_0x1f48('0x51'),'color'],'where':{'id':_0x5ec395['body'][_0x1f48('0x3d')]}});})[_0x1f48('0x1c')](function(_0x21e861){socket[_0x1f48('0x52')](_0x1f48('0x53'),{'id':Number(_0x5ec395[_0x1f48('0x2a')]['id']),'tags':_0x21e861||[]});return{'id':Number(_0x5ec395['params']['id']),'tags':_0x21e861||[]};});}})[_0x1f48('0x1c')](respondWithResult(_0x4d9f00,null))['catch'](handleError(_0x4d9f00,null));};exports[_0x1f48('0x54')]=function(_0x51961f,_0x3a5796){return db[_0x1f48('0x2c')]['find']({'where':{'id':_0x51961f[_0x1f48('0x2a')]['id']}})[_0x1f48('0x1c')](handleEntityNotFound(_0x3a5796,null))[_0x1f48('0x1c')](function(_0x56fdc0){if(_0x56fdc0){return _0x56fdc0[_0x1f48('0x54')](_0x51961f[_0x1f48('0x26')][_0x1f48('0x3d')]);}})[_0x1f48('0x1c')](respondWithStatusCode(_0x3a5796,null))[_0x1f48('0x28')](handleError(_0x3a5796,null));};exports[_0x1f48('0x55')]=function(_0x394ecf,_0x28c37e){var _0x5df473=moment()[_0x1f48('0x56')]()[_0x1f48('0x57')]();var _0x570b8d=path['join'](config[_0x1f48('0x58')],_0x1f48('0x59'),_0x1f48('0x5a'),_0x1f48('0x5b'));var _0x578133=path[_0x1f48('0x5c')](config['root'],'server',_0x1f48('0x5a'),_0x1f48('0x5d'));var _0x718ff=path[_0x1f48('0x5c')](_0x570b8d,_0x5df473);var _0x44e8e2=util[_0x1f48('0x4b')](_0x1f48('0x5e'),_0x394ecf[_0x1f48('0x2a')]['id'],_0x5df473);var _0x35ff8a=path['join'](_0x570b8d,_0x44e8e2);var _0x38f138=[];if(_0x394ecf[_0x1f48('0x26')]['attachments']){_0x38f138[_0x1f48('0x5f')]({'model':db['Attachment'],'as':'Attachments','raw':!![]});}var _0x257127=[{'model':db[_0x1f48('0x40')],'as':_0x1f48('0x60'),'attributes':['id',_0x1f48('0x39'),_0x1f48('0x61'),'to','cc',_0x1f48('0x62'),_0x1f48('0x63'),'createdAt'],'where':{'secret':![]},'order':qs[_0x1f48('0x43')]('id'),'include':_0x38f138}];return db['MailInteraction'][_0x1f48('0x37')]({'where':{'id':_0x394ecf[_0x1f48('0x2a')]['id']},'include':_0x257127})['then'](handleEntityNotFound(_0x28c37e,null))[_0x1f48('0x1c')](function(_0x49a506){if(_0x49a506&&_0x49a506['Messages']){var _0x499180=_0x49a506['get']({'plain':!![]});fs[_0x1f48('0x64')](_0x718ff);return BPromise[_0x1f48('0x65')](_0x499180[_0x1f48('0x60')],function(_0x147382,_0x33c19b){var _0x5943db={'from':_0x147382[_0x1f48('0x61')],'to':_0x147382['to']||'missing.recipient@your.company.com','subject':_0x147382[_0x1f48('0x63')],'html':htmlEntities['decode'](_0x147382[_0x1f48('0x39')]),'headers':{'Date':moment(_0x147382[_0x1f48('0x66')])['format'](_0x1f48('0x67'))},'attachments':[]};if(_0x147382['cc']){_0x5943db[_0x1f48('0x68')]['Cc']=_0x147382['cc'];}if(_0x147382[_0x1f48('0x62')]){_0x5943db['headers']['Bcc']=_0x147382[_0x1f48('0x62')];}return new BPromise(function(_0x1773c3,_0x286058){if(_0x147382['Attachments']){for(var _0x53ec53=0x0;_0x53ec53<_0x147382[_0x1f48('0x69')]['length'];_0x53ec53++){var _0x4a9957=_0x147382[_0x1f48('0x69')][_0x53ec53];var _0x4de9b7=path['join'](_0x578133,_0x4a9957[_0x1f48('0x6a')]);if(fs[_0x1f48('0x6b')](_0x4de9b7)){_0x5943db['attachments'][_0x1f48('0x5f')]({'name':_0x4a9957[_0x1f48('0x51')],'contentType':_0x4a9957[_0x1f48('0x22')],'data':fs[_0x1f48('0x6c')](_0x4de9b7)});}}}emlformat[_0x1f48('0x6d')](_0x5943db,function(_0x209125,_0x32e397){if(_0x209125)return _0x286058(_0x209125);fs['writeFileSync'](path[_0x1f48('0x5c')](_0x718ff,util[_0x1f48('0x4b')]('message%d.eml',_0x33c19b)),_0x32e397);return _0x1773c3(_0x32e397);});});})['then'](function(){return new BPromise(function(_0x2cfb5b,_0x228a7d){zipdir(_0x718ff,{'saveTo':_0x35ff8a},function(_0x3a00fb,_0x4fed4f){if(_0x3a00fb)return _0x228a7d(_0x3a00fb);return _0x2cfb5b(_0x4fed4f);});})['then'](function(){return new BPromise(function(_0x106b80,_0x2fe869){rimraf(_0x718ff,function(_0x477813){if(_0x477813)_0x2fe869(_0x477813);return _0x106b80();});});})['then'](function(){return _0x28c37e[_0x1f48('0x55')](_0x35ff8a,_0x44e8e2,function(_0x55ed79){if(!_0x55ed79)fs[_0x1f48('0x6e')](_0x35ff8a);});});});}else{return _0x28c37e['sendStatus'](0xc8);}})[_0x1f48('0x28')](handleError(_0x28c37e,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index 3ce7aef..22eca12 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 _0x5225=['hasOwnProperty','hook','exports','events','MailInteraction','MailMessage','update','remove','getUsers','then','Users','map','findAll','setDataValue','unreadMessages','emit','catch'];(function(_0x38b4b8,_0xafa866){var _0x5aee3b=function(_0x548b35){while(--_0x548b35){_0x38b4b8['push'](_0x38b4b8['shift']());}};_0x5aee3b(++_0xafa866);}(_0x5225,0x19b));var _0x5522=function(_0x4c825d,_0x10ec2b){_0x4c825d=_0x4c825d-0x0;var _0x43de87=_0x5225[_0x4c825d];return _0x43de87;};'use strict';var EventEmitter=require(_0x5522('0x0'));var MailInteraction=require('../../mysqldb')['db'][_0x5522('0x1')];var MailMessage=require('../../mysqldb')['db'][_0x5522('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x5522('0x3'),'afterDestroy':_0x5522('0x4')};function emitEvent(_0x2ea259){return function(_0x38583a,_0x1dc2b8,_0x40442c){_0x38583a[_0x5522('0x5')]({'attributes':['id'],'raw':!![]})[_0x5522('0x6')](function(_0x4afaeb){_0x38583a['setDataValue'](_0x5522('0x7'),_0x4afaeb[_0x5522('0x8')](function(_0x49fed8){return{'id':_0x49fed8['id']};}));return MailMessage[_0x5522('0x9')]({'where':{'MailInteractionId':_0x38583a['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x2865ed){_0x38583a[_0x5522('0xa')](_0x5522('0xb'),_0x2865ed['length']);MailInteractionEvents[_0x5522('0xc')](_0x2ea259+':'+_0x38583a['id'],_0x38583a);MailInteractionEvents['emit'](_0x2ea259,_0x38583a);_0x40442c(null);})[_0x5522('0xd')](_0x40442c(null));};}for(var e in events){if(events[_0x5522('0xe')](e)){var event=events[e];MailInteraction[_0x5522('0xf')](e,emitEvent(event));}}module[_0x5522('0x10')]=MailInteractionEvents; \ No newline at end of file +var _0x1d86=['length','emit','catch','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners','save','remove','setDataValue','map','findAll','then','unreadMessages'];(function(_0x4b4fc6,_0x127b45){var _0x33172a=function(_0x1ab4d0){while(--_0x1ab4d0){_0x4b4fc6['push'](_0x4b4fc6['shift']());}};_0x33172a(++_0x127b45);}(_0x1d86,0x7e));var _0x61d8=function(_0x1ea962,_0x3c5f40){_0x1ea962=_0x1ea962-0x0;var _0x4bd31e=_0x1d86[_0x1ea962];return _0x4bd31e;};'use strict';var EventEmitter=require('events');var MailInteraction=require('../../mysqldb')['db']['MailInteraction'];var MailMessage=require(_0x61d8('0x0'))['db']['MailMessage'];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x61d8('0x1')](0x0);var events={'afterCreate':_0x61d8('0x2'),'afterUpdate':'update','afterDestroy':_0x61d8('0x3')};function emitEvent(_0x1d170a){return function(_0x2e4ab8,_0x4ee0d4,_0x18b56f){_0x2e4ab8['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x1e1f22){_0x2e4ab8[_0x61d8('0x4')]('Users',_0x1e1f22[_0x61d8('0x5')](function(_0x44753b){return{'id':_0x44753b['id']};}));return MailMessage[_0x61d8('0x6')]({'where':{'MailInteractionId':_0x2e4ab8['id'],'direction':'in','read':![]},'raw':!![]});})[_0x61d8('0x7')](function(_0xa35e78){_0x2e4ab8[_0x61d8('0x4')](_0x61d8('0x8'),_0xa35e78[_0x61d8('0x9')]);MailInteractionEvents[_0x61d8('0xa')](_0x1d170a+':'+_0x2e4ab8['id'],_0x2e4ab8);MailInteractionEvents['emit'](_0x1d170a,_0x2e4ab8);_0x18b56f(null);})[_0x61d8('0xb')](_0x18b56f(null));};}for(var e in events){if(events[_0x61d8('0xc')](e)){var event=events[e];MailInteraction[_0x61d8('0xd')](e,emitEvent(event));}}module[_0x61d8('0xe')]=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index 7b2803d..55d29c8 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 _0x47df=['./mailInteraction.attributes','define','MailInteraction','mail_interactions','fti_mail_interactions','subject','FULLTEXT','format','closed','YYYY-MM-DD\x20HH:mm:ss','changed','substatus','substatusAt','closedAt','models','get','MailMessage','update','then','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0xd9707c,_0x5dfc41){var _0x2e1593=function(_0x34b4b5){while(--_0x34b4b5){_0xd9707c['push'](_0xd9707c['shift']());}};_0x2e1593(++_0x5dfc41);}(_0x47df,0x70));var _0xf47d=function(_0x4587e6,_0x13c375){_0x4587e6=_0x4587e6-0x0;var _0x28fe8c=_0x47df[_0x4587e6];return _0x28fe8c;};'use strict';var _=require(_0xf47d('0x0'));var util=require(_0xf47d('0x1'));var logger=require('../../config/logger')(_0xf47d('0x2'));var moment=require(_0xf47d('0x3'));var BPromise=require(_0xf47d('0x4'));var rp=require(_0xf47d('0x5'));var fs=require('fs');var path=require(_0xf47d('0x6'));var rimraf=require(_0xf47d('0x7'));var config=require('../../config/environment');var attributes=require(_0xf47d('0x8'));module['exports']=function(_0xbd5b1,_0x1ae1ac){return _0xbd5b1[_0xf47d('0x9')](_0xf47d('0xa'),attributes,{'tableName':_0xf47d('0xb'),'paranoid':![],'indexes':[{'name':_0xf47d('0xc'),'fields':[_0xf47d('0xd'),'to'],'type':_0xf47d('0xe')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x2b3949,_0x30f2b3,_0x5d72ea){if(_0x2b3949['substatus']){_0x2b3949['substatusAt']=moment()[_0xf47d('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x2b3949[_0xf47d('0x10')]){_0x2b3949['closedAt']=moment()[_0xf47d('0xf')](_0xf47d('0x11'));}_0x5d72ea(null,_0x30f2b3);},'beforeUpdate':function(_0x247dab,_0x471451,_0x2c35bd){if(_0x247dab[_0xf47d('0x12')](_0xf47d('0x13'))){_0x247dab[_0xf47d('0x14')]=_0x247dab['substatus']?moment()[_0xf47d('0xf')](_0xf47d('0x11')):null;}if(_0x247dab[_0xf47d('0x12')](_0xf47d('0x10'))){_0x247dab[_0xf47d('0x15')]=moment()[_0xf47d('0xf')](_0xf47d('0x11'));_0x247dab[_0xf47d('0x13')]=null;_0x247dab[_0xf47d('0x14')]=null;}_0x2c35bd(null,_0x247dab);},'afterUpdate':function(_0x3123e3,_0x10378f,_0xbb76b2){var _0x420a0e=_0xbd5b1[_0xf47d('0x16')];var _0x63deed=_0x3123e3[_0xf47d('0x17')]({'plain':!![]});if(_0x63deed[_0xf47d('0x10')]){return _0x420a0e[_0xf47d('0x18')][_0xf47d('0x19')]({'read':!![]},{'where':{'MailInteractionId':_0x63deed['id']}})[_0xf47d('0x1a')](function(){_0xbb76b2();})[_0xf47d('0x1b')](function(_0x563328){_0xbb76b2(_0x563328);});}else{_0xbb76b2();}}},'charset':_0xf47d('0x1c'),'collate':_0xf47d('0x1d')});}; \ No newline at end of file +var _0xa661=['utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path','rimraf','./mailInteraction.attributes','define','MailInteraction','mail_interactions','subject','substatus','YYYY-MM-DD\x20HH:mm:ss','closedAt','format','changed','closed','substatusAt','models','get','then','utf8mb4'];(function(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0xa661,0xfb));var _0x1a66=function(_0x107f10,_0x5529f2){_0x107f10=_0x107f10-0x0;var _0x811cab=_0xa661[_0x107f10];return _0x811cab;};'use strict';var _=require(_0x1a66('0x0'));var util=require(_0x1a66('0x1'));var logger=require('../../config/logger')(_0x1a66('0x2'));var moment=require(_0x1a66('0x3'));var BPromise=require(_0x1a66('0x4'));var rp=require(_0x1a66('0x5'));var fs=require('fs');var path=require(_0x1a66('0x6'));var rimraf=require(_0x1a66('0x7'));var config=require('../../config/environment');var attributes=require(_0x1a66('0x8'));module['exports']=function(_0x30eea9,_0x2605db){return _0x30eea9[_0x1a66('0x9')](_0x1a66('0xa'),attributes,{'tableName':_0x1a66('0xb'),'paranoid':![],'indexes':[{'name':'fti_mail_interactions','fields':[_0x1a66('0xc'),'to'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x4e2892,_0x4e321d,_0x2a7716){if(_0x4e2892[_0x1a66('0xd')]){_0x4e2892['substatusAt']=moment()['format'](_0x1a66('0xe'));}if(_0x4e2892['closed']){_0x4e2892[_0x1a66('0xf')]=moment()[_0x1a66('0x10')](_0x1a66('0xe'));}_0x2a7716(null,_0x4e321d);},'beforeUpdate':function(_0x4f7d13,_0x410fb7,_0xc0ceba){if(_0x4f7d13['changed'](_0x1a66('0xd'))){_0x4f7d13['substatusAt']=_0x4f7d13[_0x1a66('0xd')]?moment()[_0x1a66('0x10')](_0x1a66('0xe')):null;}if(_0x4f7d13[_0x1a66('0x11')](_0x1a66('0x12'))){_0x4f7d13[_0x1a66('0xf')]=moment()[_0x1a66('0x10')](_0x1a66('0xe'));_0x4f7d13[_0x1a66('0xd')]=null;_0x4f7d13[_0x1a66('0x13')]=null;}_0xc0ceba(null,_0x4f7d13);},'afterUpdate':function(_0x1fda9e,_0x3d41e3,_0xb67934){var _0x32d75a=_0x30eea9[_0x1a66('0x14')];var _0x241b84=_0x1fda9e[_0x1a66('0x15')]({'plain':!![]});if(_0x241b84[_0x1a66('0x12')]){return _0x32d75a['MailMessage']['update']({'read':!![]},{'where':{'MailInteractionId':_0x241b84['id']}})[_0x1a66('0x16')](function(){_0xb67934();})['catch'](function(_0x3adae5){_0xb67934(_0x3adae5);});}else{_0xb67934();}}},'charset':_0x1a66('0x17'),'collate':_0x1a66('0x18')});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index 4bffdc4..b046328 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 _0x91a7=['redis','localhost','socket.io-emitter','./mailInteraction.socket','register','request','then','info','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','UpdateMailInteraction','MailInteraction','update','body','options','where','addTags','omit','ids','spread','AddTags','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','defaults'];(function(_0x227320,_0x4131cd){var _0x14ad6c=function(_0x501c47){while(--_0x501c47){_0x227320['push'](_0x227320['shift']());}};_0x14ad6c(++_0x4131cd);}(_0x91a7,0x6c));var _0x791a=function(_0x50f305,_0x4f7db8){_0x50f305=_0x50f305-0x0;var _0x1435df=_0x91a7[_0x50f305];return _0x1435df;};'use strict';var _=require(_0x791a('0x0'));var util=require(_0x791a('0x1'));var moment=require(_0x791a('0x2'));var BPromise=require('bluebird');var rs=require(_0x791a('0x3'));var fs=require('fs');var Redis=require(_0x791a('0x4'));var db=require(_0x791a('0x5'))['db'];var utils=require(_0x791a('0x6'));var logger=require(_0x791a('0x7'))('rpc');var config=require(_0x791a('0x8'));var jayson=require(_0x791a('0x9'));var client=jayson['client'][_0x791a('0xa')]({'port':0x232a});config['redis']=_[_0x791a('0xb')](config[_0x791a('0xc')],{'host':_0x791a('0xd'),'port':0x18eb});var socket=require(_0x791a('0xe'))(new Redis(config[_0x791a('0xc')]));require(_0x791a('0xf'))[_0x791a('0x10')](socket);function respondWithRpcPromise(_0x5e6535,_0x1b895d,_0x21c133){return new BPromise(function(_0x69bf71,_0x5428b3){return client[_0x791a('0x11')](_0x5e6535,_0x21c133)[_0x791a('0x12')](function(_0x3dbb54){logger[_0x791a('0x13')](_0x791a('0x14'),_0x1b895d,_0x791a('0x15'));logger[_0x791a('0x16')](_0x791a('0x17'),_0x1b895d,_0x791a('0x15'),JSON[_0x791a('0x18')](_0x3dbb54));if(_0x3dbb54['error']){if(_0x3dbb54[_0x791a('0x19')][_0x791a('0x1a')]===0x1f4){logger[_0x791a('0x19')](_0x791a('0x14'),_0x1b895d,_0x3dbb54[_0x791a('0x19')][_0x791a('0x1b')]);return _0x5428b3(_0x3dbb54['error'][_0x791a('0x1b')]);}logger[_0x791a('0x19')]('MailInteraction,\x20%s,\x20%s',_0x1b895d,_0x3dbb54['error'][_0x791a('0x1b')]);return _0x69bf71(_0x3dbb54[_0x791a('0x19')][_0x791a('0x1b')]);}else{logger[_0x791a('0x13')](_0x791a('0x14'),_0x1b895d,'request\x20sent');_0x69bf71(_0x3dbb54['result'][_0x791a('0x1b')]);}})[_0x791a('0x1c')](function(_0x35f463){logger[_0x791a('0x19')]('MailInteraction,\x20%s,\x20%s',_0x1b895d,_0x35f463);_0x5428b3(_0x35f463);});});}exports[_0x791a('0x1d')]=function(_0x3bbde2){var _0x223352=this;return new Promise(function(_0x1a4741,_0x4c6ea2){return db[_0x791a('0x1e')][_0x791a('0x1f')](_0x3bbde2[_0x791a('0x20')],{'raw':_0x3bbde2[_0x791a('0x21')]?_0x3bbde2[_0x791a('0x21')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3bbde2[_0x791a('0x21')]?_0x3bbde2['options'][_0x791a('0x22')]||null:null,'attributes':_0x3bbde2[_0x791a('0x21')]?_0x3bbde2[_0x791a('0x21')]['attributes']||null:null,'limit':_0x3bbde2[_0x791a('0x21')]?_0x3bbde2['options']['limit']||null:null})[_0x791a('0x12')](function(_0x46ca44){logger['info'](_0x791a('0x1d'),_0x3bbde2);logger[_0x791a('0x16')](_0x791a('0x1d'),_0x3bbde2,JSON[_0x791a('0x18')](_0x46ca44));_0x1a4741(_0x46ca44);})['catch'](function(_0x3e4690){logger[_0x791a('0x19')](_0x791a('0x1d'),_0x3e4690[_0x791a('0x1b')],_0x3bbde2);_0x4c6ea2(_0x223352['error'](0x1f4,_0x3e4690['message']));});});};exports['AddTagsToMailInteraction']=function(_0x338649){return new Promise(function(_0x328352,_0x12234c){return db[_0x791a('0x1e')]['find']({'where':_0x338649['options']?_0x338649[_0x791a('0x21')][_0x791a('0x22')]||null:null})[_0x791a('0x12')](function(_0x7a5aa9){if(_0x7a5aa9){return _0x7a5aa9[_0x791a('0x23')](_0x338649[_0x791a('0x20')]['ids'],_[_0x791a('0x24')](_0x338649[_0x791a('0x20')],[_0x791a('0x25'),'id'])||{});}})[_0x791a('0x26')](function(_0x58d00d){logger['info'](_0x791a('0x27'),_0x338649);logger[_0x791a('0x16')](_0x791a('0x27'),_0x338649,JSON[_0x791a('0x18')](_0x58d00d));_0x328352(_0x58d00d);})[_0x791a('0x1c')](function(_0x5df12b){logger[_0x791a('0x19')](_0x791a('0x27'),_0x5df12b['message'],_0x338649);_0x12234c(_this[_0x791a('0x19')](0x1f4,_0x5df12b[_0x791a('0x1b')]));});});}; \ No newline at end of file +var _0x4932=['redis','localhost','socket.io-emitter','./mailInteraction.socket','register','request','then','info','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','error','code','MailInteraction,\x20%s,\x20%s','message','result','catch','UpdateMailInteraction','update','body','options','raw','where','attributes','limit','stringify','AddTagsToMailInteraction','MailInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x5f382f,_0x3f1432){var _0x3bb11b=function(_0x4daf9b){while(--_0x4daf9b){_0x5f382f['push'](_0x5f382f['shift']());}};_0x3bb11b(++_0x3f1432);}(_0x4932,0x164));var _0x2493=function(_0x58b5d7,_0x79ca8a){_0x58b5d7=_0x58b5d7-0x0;var _0x817269=_0x4932[_0x58b5d7];return _0x817269;};'use strict';var _=require(_0x2493('0x0'));var util=require(_0x2493('0x1'));var moment=require(_0x2493('0x2'));var BPromise=require(_0x2493('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2493('0x4'));var db=require(_0x2493('0x5'))['db'];var utils=require(_0x2493('0x6'));var logger=require(_0x2493('0x7'))(_0x2493('0x8'));var config=require(_0x2493('0x9'));var jayson=require(_0x2493('0xa'));var client=jayson[_0x2493('0xb')]['http']({'port':0x232a});config[_0x2493('0xc')]=_['defaults'](config[_0x2493('0xc')],{'host':_0x2493('0xd'),'port':0x18eb});var socket=require(_0x2493('0xe'))(new Redis(config[_0x2493('0xc')]));require(_0x2493('0xf'))[_0x2493('0x10')](socket);function respondWithRpcPromise(_0xc522cf,_0x4caf35,_0x102984){return new BPromise(function(_0x306be1,_0x1f5d97){return client[_0x2493('0x11')](_0xc522cf,_0x102984)[_0x2493('0x12')](function(_0x43c5b1){logger[_0x2493('0x13')]('MailInteraction,\x20%s,\x20%s',_0x4caf35,_0x2493('0x14'));logger[_0x2493('0x15')](_0x2493('0x16'),_0x4caf35,_0x2493('0x14'),JSON['stringify'](_0x43c5b1));if(_0x43c5b1[_0x2493('0x17')]){if(_0x43c5b1[_0x2493('0x17')][_0x2493('0x18')]===0x1f4){logger['error'](_0x2493('0x19'),_0x4caf35,_0x43c5b1[_0x2493('0x17')][_0x2493('0x1a')]);return _0x1f5d97(_0x43c5b1['error'][_0x2493('0x1a')]);}logger[_0x2493('0x17')](_0x2493('0x19'),_0x4caf35,_0x43c5b1['error'][_0x2493('0x1a')]);return _0x306be1(_0x43c5b1[_0x2493('0x17')][_0x2493('0x1a')]);}else{logger[_0x2493('0x13')](_0x2493('0x19'),_0x4caf35,'request\x20sent');_0x306be1(_0x43c5b1[_0x2493('0x1b')]['message']);}})[_0x2493('0x1c')](function(_0x4903fa){logger['error'](_0x2493('0x19'),_0x4caf35,_0x4903fa);_0x1f5d97(_0x4903fa);});});}exports[_0x2493('0x1d')]=function(_0x5c028a){var _0x73aa56=this;return new Promise(function(_0x547825,_0x409ddd){return db['MailInteraction'][_0x2493('0x1e')](_0x5c028a[_0x2493('0x1f')],{'raw':_0x5c028a[_0x2493('0x20')]?_0x5c028a['options'][_0x2493('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5c028a['options']?_0x5c028a[_0x2493('0x20')][_0x2493('0x22')]||null:null,'attributes':_0x5c028a['options']?_0x5c028a['options'][_0x2493('0x23')]||null:null,'limit':_0x5c028a[_0x2493('0x20')]?_0x5c028a[_0x2493('0x20')][_0x2493('0x24')]||null:null})[_0x2493('0x12')](function(_0x4c4094){logger['info'](_0x2493('0x1d'),_0x5c028a);logger[_0x2493('0x15')]('UpdateMailInteraction',_0x5c028a,JSON[_0x2493('0x25')](_0x4c4094));_0x547825(_0x4c4094);})[_0x2493('0x1c')](function(_0x1e5a24){logger['error']('UpdateMailInteraction',_0x1e5a24[_0x2493('0x1a')],_0x5c028a);_0x409ddd(_0x73aa56[_0x2493('0x17')](0x1f4,_0x1e5a24['message']));});});};exports[_0x2493('0x26')]=function(_0x2687b5){return new Promise(function(_0x1c47af,_0x1f1095){return db[_0x2493('0x27')][_0x2493('0x28')]({'where':_0x2687b5[_0x2493('0x20')]?_0x2687b5['options'][_0x2493('0x22')]||null:null})[_0x2493('0x12')](function(_0x2bbe9b){if(_0x2bbe9b){return _0x2bbe9b[_0x2493('0x29')](_0x2687b5[_0x2493('0x1f')][_0x2493('0x2a')],_[_0x2493('0x2b')](_0x2687b5[_0x2493('0x1f')],[_0x2493('0x2a'),'id'])||{});}})[_0x2493('0x2c')](function(_0x2fd281){logger['info'](_0x2493('0x2d'),_0x2687b5);logger[_0x2493('0x15')](_0x2493('0x2d'),_0x2687b5,JSON[_0x2493('0x25')](_0x2fd281));_0x1c47af(_0x2fd281);})[_0x2493('0x1c')](function(_0x5a80a8){logger[_0x2493('0x17')]('AddTags',_0x5a80a8[_0x2493('0x1a')],_0x2687b5);_0x1f1095(_this[_0x2493('0x17')](0x1f4,_0x5a80a8[_0x2493('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index a6153ad..c374957 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 _0x8ee5=['remove','emit','removeListener','register','length','mailInteraction:','./mailInteraction.events','save'];(function(_0x148f2c,_0x2e0048){var _0x5be853=function(_0x476ceb){while(--_0x476ceb){_0x148f2c['push'](_0x148f2c['shift']());}};_0x5be853(++_0x2e0048);}(_0x8ee5,0x17e));var _0x58ee=function(_0x47d695,_0x599edd){_0x47d695=_0x47d695-0x0;var _0x354a27=_0x8ee5[_0x47d695];return _0x354a27;};'use strict';var MailInteractionEvents=require(_0x58ee('0x0'));var events=[_0x58ee('0x1'),_0x58ee('0x2'),'update'];function createListener(_0x641e44,_0x5721cf){return function(_0x201584){_0x5721cf[_0x58ee('0x3')](_0x641e44,_0x201584);};}function removeListener(_0x3ca058,_0x3ba4c0){return function(){MailInteractionEvents[_0x58ee('0x4')](_0x3ca058,_0x3ba4c0);};}exports[_0x58ee('0x5')]=function(_0x521bab){for(var _0x2b4849=0x0,_0x5f1ea8=events[_0x58ee('0x6')];_0x2b4849<_0x5f1ea8;_0x2b4849++){var _0x2910be=events[_0x2b4849];var _0x41d21e=createListener(_0x58ee('0x7')+_0x2910be,_0x521bab);MailInteractionEvents['on'](_0x2910be,_0x41d21e);}}; \ No newline at end of file +var _0x6b25=['remove','update','emit','removeListener','register','length','mailInteraction:','./mailInteraction.events','save'];(function(_0x1a25da,_0x4910cb){var _0x251459=function(_0x52b1a9){while(--_0x52b1a9){_0x1a25da['push'](_0x1a25da['shift']());}};_0x251459(++_0x4910cb);}(_0x6b25,0x139));var _0x56b2=function(_0x3a1775,_0x267a48){_0x3a1775=_0x3a1775-0x0;var _0x2c2f43=_0x6b25[_0x3a1775];return _0x2c2f43;};'use strict';var MailInteractionEvents=require(_0x56b2('0x0'));var events=[_0x56b2('0x1'),_0x56b2('0x2'),_0x56b2('0x3')];function createListener(_0x218b88,_0x37a410){return function(_0x2eef15){_0x37a410[_0x56b2('0x4')](_0x218b88,_0x2eef15);};}function removeListener(_0x4ac563,_0x25e73c){return function(){MailInteractionEvents[_0x56b2('0x5')](_0x4ac563,_0x25e73c);};}exports[_0x56b2('0x6')]=function(_0x2dbedd){for(var _0x40e373=0x0,_0x2f1726=events[_0x56b2('0x7')];_0x40e373<_0x2f1726;_0x40e373++){var _0x15de19=events[_0x40e373];var _0x30cbdd=createListener(_0x56b2('0x8')+_0x15de19,_0x2dbedd);MailInteractionEvents['on'](_0x15de19,_0x30cbdd);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index 3de3455..abfe16e 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 _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(_0x31ce94,_0x18189d){var _0x3d5bc9=function(_0x1a0022){while(--_0x1a0022){_0x31ce94['push'](_0x31ce94['shift']());}};_0x3d5bc9(++_0x18189d);}(_0xc48e,0xd7));var _0xec48=function(_0x5236eb,_0x3e1f44){_0x5236eb=_0x5236eb-0x0;var _0x1a47ec=_0xc48e[_0x5236eb];return _0x1a47ec;};'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 +var _0xb240=['./mailMessage.controller','get','isAuthenticated','index','describe','show','download','post','tracked','mail','mailmessage:create','create','/:id','put','/:id/accept','accept','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x3e2435,_0xc531a1){var _0x5d49e7=function(_0x214b4f){while(--_0x214b4f){_0x3e2435['push'](_0x3e2435['shift']());}};_0x5d49e7(++_0xc531a1);}(_0xb240,0x7e));var _0x0b24=function(_0x41944e,_0x133278){_0x41944e=_0x41944e-0x0;var _0x442308=_0xb240[_0x41944e];return _0x442308;};'use strict';var multer=require(_0x0b24('0x0'));var util=require(_0x0b24('0x1'));var path=require(_0x0b24('0x2'));var timeout=require(_0x0b24('0x3'));var express=require(_0x0b24('0x4'));var router=express[_0x0b24('0x5')]();var fs_extra=require(_0x0b24('0x6'));var auth=require(_0x0b24('0x7'));var interaction=require(_0x0b24('0x8'));var config=require('../../config/environment');var controller=require(_0x0b24('0x9'));router[_0x0b24('0xa')]('/',auth[_0x0b24('0xb')](),controller[_0x0b24('0xc')]);router[_0x0b24('0xa')]('/describe',auth[_0x0b24('0xb')](),controller[_0x0b24('0xd')]);router[_0x0b24('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x0b24('0xe')]);router['get']('/:id/download',auth[_0x0b24('0xb')](),controller[_0x0b24('0xf')]);router[_0x0b24('0x10')]('/',auth[_0x0b24('0xb')](),interaction[_0x0b24('0x11')](_0x0b24('0x12'),_0x0b24('0x13')),controller[_0x0b24('0x14')]);router['put'](_0x0b24('0x15'),auth[_0x0b24('0xb')](),controller['update']);router[_0x0b24('0x16')](_0x0b24('0x17'),auth[_0x0b24('0xb')](),controller[_0x0b24('0x18')]);router['put']('/:id/reject',auth['isAuthenticated'](),controller['reject']);router[_0x0b24('0x19')](_0x0b24('0x15'),auth[_0x0b24('0xb')](),controller['destroy']);module[_0x0b24('0x1a')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index 4329628..9fdc24c 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 _0x4890=['out','STRING','DATE','INTEGER','Email','sequelize','lodash','exports','long','TEXT','medium','BOOLEAN','ENUM'];(function(_0x29e849,_0x24cbdf){var _0xae86ee=function(_0x47a1db){while(--_0x47a1db){_0x29e849['push'](_0x29e849['shift']());}};_0xae86ee(++_0x24cbdf);}(_0x4890,0x87));var _0x0489=function(_0x3a78a0,_0x44985f){_0x3a78a0=_0x3a78a0-0x0;var _0x48e917=_0x4890[_0x3a78a0];return _0x48e917;};'use strict';var Sequelize=require(_0x0489('0x0'));var _=require(_0x0489('0x1'));module[_0x0489('0x2')]={'body':{'type':Sequelize['TEXT'](_0x0489('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x0489('0x4')](_0x0489('0x5'))},'read':{'type':Sequelize[_0x0489('0x6')],'defaultValue':![]},'direction':{'type':Sequelize[_0x0489('0x7')]('in','out'),'defaultValue':_0x0489('0x8'),'allowNull':![]},'messageId':{'type':Sequelize[_0x0489('0x9')](0x1fe)},'from':{'type':Sequelize[_0x0489('0x9')]},'to':{'type':Sequelize[_0x0489('0x4')](_0x0489('0x3'))},'cc':{'type':Sequelize[_0x0489('0x4')]('long')},'bcc':{'type':Sequelize[_0x0489('0x4')](_0x0489('0x3'))},'subject':{'type':Sequelize[_0x0489('0x4')]},'sentAt':{'type':Sequelize[_0x0489('0xa')]},'attach':{'type':Sequelize[_0x0489('0xb')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x0489('0x6')],'defaultValue':![]},'readAt':{'type':Sequelize['DATE']},'originTo':{'type':Sequelize[_0x0489('0x4')](_0x0489('0x3'))},'originCc':{'type':Sequelize[_0x0489('0x4')](_0x0489('0x3'))},'originChannel':{'type':Sequelize[_0x0489('0x7')]('Email','Chat'),'defaultValue':_0x0489('0xc'),'allowNull':![]}}; \ No newline at end of file +var _0x21ab=['INTEGER','Email','Chat','sequelize','TEXT','long','BOOLEAN','ENUM','out','STRING','DATE'];(function(_0x5323e8,_0x1e38a8){var _0x1b1c32=function(_0xda9bdc){while(--_0xda9bdc){_0x5323e8['push'](_0x5323e8['shift']());}};_0x1b1c32(++_0x1e38a8);}(_0x21ab,0x7c));var _0xb21a=function(_0x1e03e4,_0x362f76){_0x1e03e4=_0x1e03e4-0x0;var _0x4a887e=_0x21ab[_0x1e03e4];return _0x4a887e;};'use strict';var Sequelize=require(_0xb21a('0x0'));var _=require('lodash');module['exports']={'body':{'type':Sequelize[_0xb21a('0x1')](_0xb21a('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xb21a('0x1')]('medium')},'read':{'type':Sequelize[_0xb21a('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xb21a('0x4')]('in','out'),'defaultValue':_0xb21a('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0xb21a('0x6')](0x1fe)},'from':{'type':Sequelize[_0xb21a('0x6')]},'to':{'type':Sequelize[_0xb21a('0x1')](_0xb21a('0x2'))},'cc':{'type':Sequelize[_0xb21a('0x1')]('long')},'bcc':{'type':Sequelize['TEXT'](_0xb21a('0x2'))},'subject':{'type':Sequelize['TEXT']},'sentAt':{'type':Sequelize[_0xb21a('0x7')]},'attach':{'type':Sequelize[_0xb21a('0x8')],'defaultValue':0x0},'secret':{'type':Sequelize[_0xb21a('0x3')],'defaultValue':![]},'readAt':{'type':Sequelize[_0xb21a('0x7')]},'originTo':{'type':Sequelize['TEXT']('long')},'originCc':{'type':Sequelize[_0xb21a('0x1')]('long')},'originChannel':{'type':Sequelize['ENUM'](_0xb21a('0x9'),_0xb21a('0xa')),'defaultValue':_0xb21a('0x9'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index acde5bc..f2ddef3 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 _0xb7a4=['jayson/promise','client','http','then','info','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','error','message','MailMessage,\x20%s,\x20%s','result','json','offset','undefined','limit','count','status','set','Content-Range','update','destroy','end','sendStatus','stack','name','index','map','MailMessage','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','include','findAll','rows','catch','show','params','includeAll','options','find','body','describe','create','direction','out','secret','split','MailAccount','findOne','CmContact','Contacts','updatedAt','DESC','MailServerOut','Smtp','CloudProvider','attachments','root','basename','List','ListId','List\x20not\x20found','sendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','accept','read','readAt','UserId','user','agent','MailInteraction','MailInteractionId','isNil','read1stAt','interaction','get','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','SELECT','contact','User','fullname','email','internal','interface','channel','motionChannel','event','fromString','EventManager','acceptmessage','role','null','RejectMessage','rejectMessage','QueryTypes','reject','rejectmessage','download','unix','toString','server','join','files','from','bcc','subject','createdAt','Attachments','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','existsSync','push','build','writeFileSync','unlinkSync','moment','bluebird','path','lodash','ioredis','html-to-text','../../components/parsers/qs','../../config/logger','api','mail-interactions','../../config/environment','../../mysqldb','redis','defaults','localhost','html-entities','register'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xb7a4,0x12f));var _0x4b7a=function(_0x17a15f,_0x2e2b24){_0x17a15f=_0x17a15f-0x0;var _0x1207c2=_0xb7a4[_0x17a15f];return _0x1207c2;};'use strict';var emlformat=require('eml-format');var moment=require(_0x4b7a('0x0'));var BPromise=require(_0x4b7a('0x1'));var util=require('util');var path=require(_0x4b7a('0x2'));var fs=require('fs');var _=require(_0x4b7a('0x3'));var Redis=require(_0x4b7a('0x4'));var htmlToText=require(_0x4b7a('0x5'));var qs=require(_0x4b7a('0x6'));var logger=require(_0x4b7a('0x7'))(_0x4b7a('0x8'));var interaction_log=require(_0x4b7a('0x7'))(_0x4b7a('0x9'));var config=require(_0x4b7a('0xa'));var db=require(_0x4b7a('0xb'))['db'];config[_0x4b7a('0xc')]=_[_0x4b7a('0xd')](config['redis'],{'host':_0x4b7a('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4b7a('0xc')]));var htmlEntities=require(_0x4b7a('0xf'));require('./mailMessage.socket')[_0x4b7a('0x10')](socket);var jayson=require(_0x4b7a('0x11'));var client=jayson[_0x4b7a('0x12')][_0x4b7a('0x13')]({'port':0x232c});var client9003=jayson[_0x4b7a('0x12')][_0x4b7a('0x13')]({'port':0x232b});var client9002=jayson[_0x4b7a('0x12')][_0x4b7a('0x13')]({'port':0x232a});function respondWithRpcPromise(_0x475dd0,_0x3b1fdd,_0x532536,_0x4a4016){return new BPromise(function(_0x25f542,_0x554f1c){var _0x354120=_0x4a4016||client;return _0x354120['request'](_0x475dd0,_0x532536)[_0x4b7a('0x14')](function(_0x3182c7){logger[_0x4b7a('0x15')]('MailMessage,\x20%s,\x20%s',_0x3b1fdd,_0x4b7a('0x16'));logger[_0x4b7a('0x17')](_0x4b7a('0x18'),_0x3b1fdd,'request\x20sent',JSON['stringify'](_0x3182c7));if(_0x3182c7[_0x4b7a('0x19')]){if(_0x3182c7[_0x4b7a('0x19')]['code']===0x1f4){logger[_0x4b7a('0x19')]('MailMessage,\x20%s,\x20%s',_0x3b1fdd,_0x3182c7['error'][_0x4b7a('0x1a')]);return _0x554f1c(_0x3182c7[_0x4b7a('0x19')][_0x4b7a('0x1a')]);}logger['error'](_0x4b7a('0x1b'),_0x3b1fdd,_0x3182c7['error'][_0x4b7a('0x1a')]);return _0x25f542(_0x3182c7[_0x4b7a('0x19')][_0x4b7a('0x1a')]);}else{logger['info'](_0x4b7a('0x1b'),_0x3b1fdd,_0x4b7a('0x16'));_0x25f542(_0x3182c7[_0x4b7a('0x1c')][_0x4b7a('0x1a')]);}})['catch'](function(_0x1409a5){logger['error']('MailMessage,\x20%s,\x20%s',_0x3b1fdd,_0x1409a5);_0x554f1c(_0x1409a5);});});}function respondWithResult(_0x5249d2,_0x40459d){_0x40459d=_0x40459d||0xc8;return function(_0xa26323){if(_0xa26323){return _0x5249d2['status'](_0x40459d)[_0x4b7a('0x1d')](_0xa26323);}};}function respondWithFilteredResult(_0x5ec56e,_0x52ad51){return function(_0x27a08e){if(_0x27a08e){var _0x30a97a=typeof _0x52ad51[_0x4b7a('0x1e')]===_0x4b7a('0x1f')&&typeof _0x52ad51[_0x4b7a('0x20')]===_0x4b7a('0x1f');var _0x4c9e08=_0x27a08e['count'];var _0x61c8fb=_0x30a97a?0x0:_0x52ad51['offset'];var _0x12afca=_0x30a97a?_0x27a08e[_0x4b7a('0x21')]:_0x52ad51['offset']+_0x52ad51[_0x4b7a('0x20')];var _0x3e8868;if(_0x12afca>=_0x4c9e08){_0x12afca=_0x4c9e08;_0x3e8868=0xc8;}else{_0x3e8868=0xce;}_0x5ec56e[_0x4b7a('0x22')](_0x3e8868);return _0x5ec56e[_0x4b7a('0x23')](_0x4b7a('0x24'),_0x61c8fb+'-'+_0x12afca+'/'+_0x4c9e08)[_0x4b7a('0x1d')](_0x27a08e);}return null;};}function saveUpdates(_0x2f2075){return function(_0x848be9){if(_0x848be9){return _0x848be9[_0x4b7a('0x25')](_0x2f2075)[_0x4b7a('0x14')](function(_0x420b39){return _0x420b39;});}return null;};}function removeEntity(_0x1f1d9d){return function(_0x44351f){if(_0x44351f){return _0x44351f[_0x4b7a('0x26')]()[_0x4b7a('0x14')](function(){_0x1f1d9d[_0x4b7a('0x22')](0xcc)[_0x4b7a('0x27')]();});}};}function handleEntityNotFound(_0x25d677){return function(_0x101f3e){if(!_0x101f3e){_0x25d677[_0x4b7a('0x28')](0x194);}return _0x101f3e;};}function handleError(_0x5f25ee,_0x56d686){_0x56d686=_0x56d686||0x1f4;return function(_0x40f646){logger[_0x4b7a('0x19')](_0x40f646[_0x4b7a('0x29')]);if(_0x40f646[_0x4b7a('0x2a')]){delete _0x40f646['name'];}_0x5f25ee[_0x4b7a('0x22')](_0x56d686)['send'](_0x40f646);};}exports[_0x4b7a('0x2b')]=function(_0xf43709,_0x44ef99){var _0x1b8fd7={},_0x1af7be={},_0x55b136={'count':0x0,'rows':[]};var _0x3f4a85=_[_0x4b7a('0x2c')](db[_0x4b7a('0x2d')][_0x4b7a('0x2e')],function(_0x4ba546){return{'name':_0x4ba546[_0x4b7a('0x2f')],'type':_0x4ba546[_0x4b7a('0x30')][_0x4b7a('0x31')]};});_0x1af7be[_0x4b7a('0x32')]=_[_0x4b7a('0x2c')](_0x3f4a85,_0x4b7a('0x2a'));_0x1af7be['query']=_[_0x4b7a('0x33')](_0xf43709[_0x4b7a('0x34')]);_0x1af7be[_0x4b7a('0x35')]=_[_0x4b7a('0x36')](_0x1af7be['model'],_0x1af7be[_0x4b7a('0x34')]);_0x1b8fd7['attributes']=_['intersection'](_0x1af7be[_0x4b7a('0x32')],qs[_0x4b7a('0x37')](_0xf43709[_0x4b7a('0x34')][_0x4b7a('0x37')]));_0x1b8fd7[_0x4b7a('0x38')]=_0x1b8fd7['attributes'][_0x4b7a('0x39')]?_0x1b8fd7[_0x4b7a('0x38')]:_0x1af7be['model'];if(!_0xf43709[_0x4b7a('0x34')]['hasOwnProperty'](_0x4b7a('0x3a'))){_0x1b8fd7[_0x4b7a('0x20')]=qs['limit'](_0xf43709['query'][_0x4b7a('0x20')]);_0x1b8fd7[_0x4b7a('0x1e')]=qs[_0x4b7a('0x1e')](_0xf43709[_0x4b7a('0x34')]['offset']);}_0x1b8fd7[_0x4b7a('0x3b')]=qs[_0x4b7a('0x3c')](_0xf43709[_0x4b7a('0x34')][_0x4b7a('0x3c')]);_0x1b8fd7[_0x4b7a('0x3d')]=qs[_0x4b7a('0x35')](_[_0x4b7a('0x3e')](_0xf43709[_0x4b7a('0x34')],_0x1af7be[_0x4b7a('0x35')]),_0x3f4a85);if(_0xf43709[_0x4b7a('0x34')][_0x4b7a('0x3f')]){_0x1b8fd7[_0x4b7a('0x3d')]=_[_0x4b7a('0x40')](_0x1b8fd7[_0x4b7a('0x3d')],{'$or':_[_0x4b7a('0x2c')](_0x3f4a85,function(_0x44d94f){if(_0x44d94f[_0x4b7a('0x30')]!=='VIRTUAL'){var _0x4d99c4={};_0x4d99c4[_0x44d94f[_0x4b7a('0x2a')]]={'$like':'%'+_0xf43709[_0x4b7a('0x34')][_0x4b7a('0x3f')]+'%'};return _0x4d99c4;}})});}_0x1b8fd7=_[_0x4b7a('0x40')]({},_0x1b8fd7,_0xf43709['options']);var _0x6c1ad={'where':_0x1b8fd7[_0x4b7a('0x3d')]};return db[_0x4b7a('0x2d')][_0x4b7a('0x21')](_0x6c1ad)['then'](function(_0x5431aa){_0x55b136['count']=_0x5431aa;if(_0xf43709[_0x4b7a('0x34')]['includeAll']){_0x1b8fd7[_0x4b7a('0x41')]=[{'all':!![]}];}return db[_0x4b7a('0x2d')][_0x4b7a('0x42')](_0x1b8fd7);})[_0x4b7a('0x14')](function(_0x280c5e){_0x55b136[_0x4b7a('0x43')]=_0x280c5e;return _0x55b136;})[_0x4b7a('0x14')](respondWithFilteredResult(_0x44ef99,_0x1b8fd7))[_0x4b7a('0x44')](handleError(_0x44ef99,null));};exports[_0x4b7a('0x45')]=function(_0x4c167e,_0x49bb62){var _0x4b28e2={'raw':!![],'where':{'id':_0x4c167e[_0x4b7a('0x46')]['id']}},_0x3421c6={};_0x3421c6[_0x4b7a('0x32')]=_[_0x4b7a('0x33')](db[_0x4b7a('0x2d')][_0x4b7a('0x2e')]);_0x3421c6['query']=_[_0x4b7a('0x33')](_0x4c167e[_0x4b7a('0x34')]);_0x3421c6['filters']=_[_0x4b7a('0x36')](_0x3421c6[_0x4b7a('0x32')],_0x3421c6[_0x4b7a('0x34')]);_0x4b28e2['attributes']=_[_0x4b7a('0x36')](_0x3421c6['model'],qs[_0x4b7a('0x37')](_0x4c167e[_0x4b7a('0x34')][_0x4b7a('0x37')]));_0x4b28e2[_0x4b7a('0x38')]=_0x4b28e2['attributes'][_0x4b7a('0x39')]?_0x4b28e2[_0x4b7a('0x38')]:_0x3421c6[_0x4b7a('0x32')];if(_0x4c167e['query'][_0x4b7a('0x47')]){_0x4b28e2[_0x4b7a('0x41')]=[{'all':!![]}];}_0x4b28e2=_['merge']({},_0x4b28e2,_0x4c167e[_0x4b7a('0x48')]);return db[_0x4b7a('0x2d')][_0x4b7a('0x49')](_0x4b28e2)[_0x4b7a('0x14')](handleEntityNotFound(_0x49bb62,null))[_0x4b7a('0x14')](respondWithResult(_0x49bb62,null))[_0x4b7a('0x44')](handleError(_0x49bb62,null));};exports[_0x4b7a('0x25')]=function(_0x31f9fe,_0xb6c8f6){if(_0x31f9fe['body']['id']){delete _0x31f9fe[_0x4b7a('0x4a')]['id'];}return db[_0x4b7a('0x2d')][_0x4b7a('0x49')]({'where':{'id':_0x31f9fe[_0x4b7a('0x46')]['id']}})[_0x4b7a('0x14')](handleEntityNotFound(_0xb6c8f6,null))[_0x4b7a('0x14')](saveUpdates(_0x31f9fe[_0x4b7a('0x4a')],null))[_0x4b7a('0x14')](respondWithResult(_0xb6c8f6,null))[_0x4b7a('0x44')](handleError(_0xb6c8f6,null));};exports[_0x4b7a('0x26')]=function(_0x3ec25b,_0x5e0ff4){return db[_0x4b7a('0x2d')][_0x4b7a('0x49')]({'where':{'id':_0x3ec25b['params']['id']}})[_0x4b7a('0x14')](handleEntityNotFound(_0x5e0ff4,null))[_0x4b7a('0x14')](removeEntity(_0x5e0ff4,null))[_0x4b7a('0x44')](handleError(_0x5e0ff4,null));};exports[_0x4b7a('0x4b')]=function(_0x6d429,_0x1473a2){return db['MailMessage'][_0x4b7a('0x4b')]()[_0x4b7a('0x14')](respondWithResult(_0x1473a2,null))[_0x4b7a('0x44')](handleError(_0x1473a2,null));};exports[_0x4b7a('0x4c')]=function(_0x353d25,_0x1f9a61){return db[_0x4b7a('0x2d')][_0x4b7a('0x4c')](_0x353d25[_0x4b7a('0x4a')])['then'](function(_0x2e5e0b){if(_0x2e5e0b){if(_0x2e5e0b[_0x4b7a('0x4d')]===_0x4b7a('0x4e')&&!_0x2e5e0b[_0x4b7a('0x4f')]){var _0x534a43,_0x1d8224,_0x16fbc6;if(_0x353d25[_0x4b7a('0x4a')]['to']){_0x1d8224=_0x353d25[_0x4b7a('0x4a')]['to'][_0x4b7a('0x50')](',')[0x0];}return db[_0x4b7a('0x51')][_0x4b7a('0x52')]({'where':{'id':_0x2e5e0b['MailAccountId']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x4b7a('0x53')],'as':_0x4b7a('0x54'),'where':{'email':_0x1d8224},'limit':0x1,'order':[[_0x4b7a('0x55'),_0x4b7a('0x56')]]}]},{'model':db[_0x4b7a('0x57')],'as':_0x4b7a('0x58'),'raw':!![],'include':[{'model':db[_0x4b7a('0x59')],'as':'CloudProvider','raw':!![]}]}]})[_0x4b7a('0x14')](function(_0x2c7e6c){_0x534a43=_0x2c7e6c;if(!_0x534a43||!_0x534a43[_0x4b7a('0x58')])return;var _0x3ae438=_0x534a43['getSmtpOptions']();if(_0x353d25[_0x4b7a('0x4a')]['attachments']&&_0x353d25[_0x4b7a('0x4a')][_0x4b7a('0x5a')][_0x4b7a('0x39')]){for(var _0x3c14a3=0x0;_0x3c14a3<_0x353d25[_0x4b7a('0x4a')][_0x4b7a('0x5a')]['length'];_0x3c14a3+=0x1){_0x353d25[_0x4b7a('0x4a')]['attachments'][_0x3c14a3]={'filename':_0x353d25[_0x4b7a('0x4a')][_0x4b7a('0x5a')][_0x3c14a3][_0x4b7a('0x2a')],'path':path['join'](config[_0x4b7a('0x5b')],'server/files/attachments',_0x353d25['body'][_0x4b7a('0x5a')][_0x3c14a3][_0x4b7a('0x5c')])};}}_0x16fbc6={'account':_0x3ae438,'message':_0x353d25[_0x4b7a('0x4a')]};return;})[_0x4b7a('0x14')](function(){if(_0x534a43[_0x4b7a('0x5d')]){if(_0x534a43[_0x4b7a('0x5d')][_0x4b7a('0x54')][_0x4b7a('0x39')]){return _0x534a43[_0x4b7a('0x5d')]['Contacts'][0x0];}else{return db[_0x4b7a('0x53')][_0x4b7a('0x4c')](_['defaults'](_0x353d25[_0x4b7a('0x4a')],{'firstName':_0x353d25[_0x4b7a('0x4a')]['to'],'email':_0x353d25[_0x4b7a('0x4a')]['to'],'phone':_0x353d25[_0x4b7a('0x4a')]['to'],'ListId':_0x534a43[_0x4b7a('0x5e')]}));}}else{throw new Error(_0x4b7a('0x5f'));}})[_0x4b7a('0x14')](function(){if(_0x16fbc6){return respondWithRpcPromise('SendMail',_0x4b7a('0x60'),_0x16fbc6,client9003)[_0x4b7a('0x14')](function(_0x1da51c){return _0x2e5e0b[_0x4b7a('0x25')]({'read':!![],'messageId':_0x1da51c[_0x4b7a('0x61')],'sentAt':moment()[_0x4b7a('0x62')](_0x4b7a('0x63'))});})['catch'](function(_0x1a5728){logger[_0x4b7a('0x19')]('%s',JSON['stringify'](_0x1a5728));return _0x2e5e0b;});}return _0x2e5e0b;});}return _0x2e5e0b;}})[_0x4b7a('0x14')](respondWithResult(_0x1f9a61,0xc9))[_0x4b7a('0x44')](handleError(_0x1f9a61,null));};exports[_0x4b7a('0x64')]=function(_0x324d51,_0x4fdebb){var _0x25b73b={'agent':{},'channel':'mail'};if(_0x324d51['body']['id']){delete _0x324d51['body']['id'];}_0x324d51[_0x4b7a('0x4a')][_0x4b7a('0x65')]=!![];_0x324d51[_0x4b7a('0x4a')][_0x4b7a('0x66')]=moment()[_0x4b7a('0x62')](_0x4b7a('0x63'));_0x324d51[_0x4b7a('0x4a')]['UserId']=_0x324d51['body'][_0x4b7a('0x67')]||_0x324d51[_0x4b7a('0x68')]['id'];_0x25b73b[_0x4b7a('0x69')]['id']=_0x324d51['body'][_0x4b7a('0x67')];return db[_0x4b7a('0x2d')]['find']({'where':{'id':_0x324d51[_0x4b7a('0x46')]['id'],'UserId':null}})[_0x4b7a('0x14')](handleEntityNotFound(_0x4fdebb,null))[_0x4b7a('0x14')](saveUpdates(_0x324d51['body'],null))[_0x4b7a('0x14')](function(_0xbba0dd){if(_0xbba0dd){_0x25b73b[_0x4b7a('0x1a')]=_0xbba0dd['get']({'plain':!![]});return db[_0x4b7a('0x6a')][_0x4b7a('0x49')]({'where':{'id':_0xbba0dd[_0x4b7a('0x6b')]}});}return null;})['then'](handleEntityNotFound(_0x4fdebb,null))[_0x4b7a('0x14')](function(_0x567efe){if(_0x567efe){return _0x567efe['update']({'UserId':_0x324d51[_0x4b7a('0x4a')][_0x4b7a('0x67')],'read1stAt':_[_0x4b7a('0x6c')](_0x567efe[_0x4b7a('0x6d')])?moment()[_0x4b7a('0x62')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x4b7a('0x14')](function(_0x5f56f3){if(_0x5f56f3){_0x25b73b[_0x4b7a('0x6e')]=_0x5f56f3[_0x4b7a('0x6f')]({'plain':!![]});interaction_log['info'](_0x4b7a('0x70'),_0x324d51[_0x4b7a('0x68')]['id'],_0x324d51[_0x4b7a('0x68')][_0x4b7a('0x2a')],_0x324d51[_0x4b7a('0x68')]['role'],_0x25b73b[_0x4b7a('0x6e')]['id'],_0x324d51[_0x4b7a('0x4a')]?JSON[_0x4b7a('0x71')](_0x324d51[_0x4b7a('0x4a')]):'null');return respondWithRpcPromise(_0x4b7a('0x72'),_0x4b7a('0x73'),_0x25b73b);}return null;})[_0x4b7a('0x14')](function(_0x3c3535){var _0x3c0a7a=_0x4b7a('0x74')+_0x3c3535[_0x4b7a('0x1a')][_0x4b7a('0x75')];return db[_0x4b7a('0x76')]['query'](_0x3c0a7a,{'type':db[_0x4b7a('0x77')]['QueryTypes'][_0x4b7a('0x78')],'raw':!![]})[_0x4b7a('0x14')](function(_0xf1504){return _0xf1504;});})[_0x4b7a('0x14')](function(_0x5a88ed){if(_0x5a88ed){_0x25b73b['message'][_0x4b7a('0x79')]=_0x5a88ed[0x0];if(!_0x324d51[_0x4b7a('0x4a')][_0x4b7a('0x67')])return;return db[_0x4b7a('0x7a')][_0x4b7a('0x49')]({'where':{'id':_0x324d51[_0x4b7a('0x4a')][_0x4b7a('0x67')],'role':_0x4b7a('0x69')},'attributes':['id',_0x4b7a('0x2a'),_0x4b7a('0x7b'),_0x4b7a('0x7c'),_0x4b7a('0x7d')],'raw':!![]});}return null;})[_0x4b7a('0x14')](function(_0x130029){if(!_0x130029)return null;_0x25b73b['message'][_0x4b7a('0x69')]=_0x130029;return _0x25b73b;})['then'](function(_0x30903f){if(_0x30903f){if(_0x324d51[_0x4b7a('0x4a')]['manual']){_0x25b73b[_0x4b7a('0x1a')][_0x4b7a('0x7e')]=util[_0x4b7a('0x62')]('SIP/%s',_0x324d51[_0x4b7a('0x68')][_0x4b7a('0x2a')]);_0x25b73b[_0x4b7a('0x1a')][_0x4b7a('0x7f')]=_0x25b73b[_0x4b7a('0x7f')];_0x25b73b[_0x4b7a('0x1a')][_0x4b7a('0x80')]=_0x25b73b[_0x4b7a('0x7f')];_0x25b73b[_0x4b7a('0x1a')][_0x4b7a('0x81')]=_0x4b7a('0x64');_0x25b73b[_0x4b7a('0x1a')][_0x4b7a('0x4a')]=htmlToText[_0x4b7a('0x82')](_0x25b73b['message']['body']);return respondWithRpcPromise('EventManager',_0x4b7a('0x83'),{'event':_0x4b7a('0x84'),'message':_0x25b73b['message']},client9002)['then'](function(){return _0x25b73b;});}return _0x25b73b;}return null;})['then'](respondWithResult(_0x4fdebb,null))[_0x4b7a('0x44')](handleError(_0x4fdebb,null));};exports['reject']=function(_0x29e0a0,_0x16679d){var _0x407713={'agent':{},'channel':'mail'};if(_0x29e0a0[_0x4b7a('0x4a')]['id']){delete _0x29e0a0[_0x4b7a('0x4a')]['id'];}_0x29e0a0[_0x4b7a('0x4a')][_0x4b7a('0x67')]=_0x29e0a0[_0x4b7a('0x4a')][_0x4b7a('0x67')]||_0x29e0a0[_0x4b7a('0x68')]['id'];_0x407713['agent']['id']=_0x29e0a0[_0x4b7a('0x4a')][_0x4b7a('0x67')];return db['MailMessage'][_0x4b7a('0x49')]({'where':{'id':_0x29e0a0['params']['id'],'UserId':null}})[_0x4b7a('0x14')](handleEntityNotFound(_0x16679d,null))[_0x4b7a('0x14')](function(_0x4f662b){if(_0x4f662b){_0x407713[_0x4b7a('0x1a')]=_0x4f662b[_0x4b7a('0x6f')]({'plain':!![]});return db[_0x4b7a('0x6a')][_0x4b7a('0x49')]({'where':{'id':_0x4f662b[_0x4b7a('0x6b')]}});}return null;})[_0x4b7a('0x14')](handleEntityNotFound(_0x16679d,null))[_0x4b7a('0x14')](function(_0x3aabe6){if(_0x3aabe6){_0x407713[_0x4b7a('0x6e')]=_0x3aabe6[_0x4b7a('0x6f')]({'plain':!![]});interaction_log[_0x4b7a('0x15')]('[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x29e0a0[_0x4b7a('0x68')]['id'],_0x29e0a0[_0x4b7a('0x68')][_0x4b7a('0x2a')],_0x29e0a0[_0x4b7a('0x68')][_0x4b7a('0x85')],_0x407713['interaction']['id'],_0x29e0a0['body']?JSON[_0x4b7a('0x71')](_0x29e0a0[_0x4b7a('0x4a')]):_0x4b7a('0x86'));return respondWithRpcPromise(_0x4b7a('0x87'),_0x4b7a('0x88'),_0x407713);}return null;})[_0x4b7a('0x14')](function(_0x16fc0f){var _0x5714f2=_0x4b7a('0x74')+_0x16fc0f[_0x4b7a('0x1a')][_0x4b7a('0x75')];return db[_0x4b7a('0x76')][_0x4b7a('0x34')](_0x5714f2,{'type':db['Sequelize'][_0x4b7a('0x89')][_0x4b7a('0x78')],'raw':!![]})[_0x4b7a('0x14')](function(_0x45f0ae){return _0x45f0ae;});})[_0x4b7a('0x14')](function(_0x20c52c){if(_0x20c52c){_0x407713['message'][_0x4b7a('0x79')]=_0x20c52c[0x0];if(!_0x29e0a0[_0x4b7a('0x4a')]['UserId'])return;return db[_0x4b7a('0x7a')][_0x4b7a('0x49')]({'where':{'id':_0x29e0a0[_0x4b7a('0x4a')][_0x4b7a('0x67')],'role':_0x4b7a('0x69')},'attributes':['id',_0x4b7a('0x2a'),'fullname','email',_0x4b7a('0x7d')],'raw':!![]});}return null;})[_0x4b7a('0x14')](function(_0x1d4fc5){if(!_0x1d4fc5)return null;_0x407713['message'][_0x4b7a('0x69')]=_0x1d4fc5;return _0x407713;})['then'](function(_0x4b078a){if(_0x4b078a){_0x4b078a[_0x4b7a('0x1a')][_0x4b7a('0x7e')]=util[_0x4b7a('0x62')]('SIP/%s',_0x29e0a0['user'][_0x4b7a('0x2a')]);_0x4b078a[_0x4b7a('0x1a')][_0x4b7a('0x7f')]=_0x407713['channel'];_0x4b078a['message'][_0x4b7a('0x80')]=_0x407713[_0x4b7a('0x7f')];_0x4b078a[_0x4b7a('0x1a')][_0x4b7a('0x81')]=_0x4b7a('0x8a');_0x4b078a['message'][_0x4b7a('0x4a')]=htmlToText[_0x4b7a('0x82')](_0x407713[_0x4b7a('0x1a')][_0x4b7a('0x4a')]);respondWithRpcPromise(_0x4b7a('0x83'),'EventManager',{'event':_0x4b7a('0x8b'),'message':_0x4b078a[_0x4b7a('0x1a')]},client9002);return _0x407713;}return null;})[_0x4b7a('0x14')](respondWithResult(_0x16679d,null))[_0x4b7a('0x44')](handleError(_0x16679d,null));};exports[_0x4b7a('0x8c')]=function(_0x5bee55,_0xd609ce){var _0x5dc670=moment()[_0x4b7a('0x8d')]()[_0x4b7a('0x8e')]();var _0x1c6e92=path['join'](config['root'],_0x4b7a('0x8f'),'files','tmp');var _0x29fa4b=path[_0x4b7a('0x90')](config[_0x4b7a('0x5b')],'server',_0x4b7a('0x91'),_0x4b7a('0x5a'));var _0x656be3=util[_0x4b7a('0x62')]('message-%s.eml',_0x5dc670);return db['MailMessage'][_0x4b7a('0x49')]({'where':{'id':_0x5bee55[_0x4b7a('0x46')]['id']},'attributes':['id',_0x4b7a('0x4a'),_0x4b7a('0x92'),'to','cc',_0x4b7a('0x93'),_0x4b7a('0x94'),_0x4b7a('0x95')],'include':_0x5bee55[_0x4b7a('0x34')][_0x4b7a('0x5a')]?[{'model':db['Attachment'],'as':_0x4b7a('0x96')}]:undefined})['then'](handleEntityNotFound(_0xd609ce,null))[_0x4b7a('0x14')](function(_0xd4f178){if(_0xd4f178){var _0x25c4bc=_0xd4f178;var _0x2dce0d={'from':_0x25c4bc[_0x4b7a('0x92')],'to':_0x25c4bc['to'],'subject':_0x25c4bc[_0x4b7a('0x94')],'html':htmlEntities[_0x4b7a('0x97')](_0x25c4bc[_0x4b7a('0x4a')]),'headers':{'Date':moment(_0x25c4bc[_0x4b7a('0x95')])[_0x4b7a('0x62')](_0x4b7a('0x98'))},'attachments':[]};if(_0xd4f178['cc']){_0x2dce0d[_0x4b7a('0x99')]['Cc']=_0xd4f178['cc'];}if(_0xd4f178[_0x4b7a('0x93')]){_0x2dce0d[_0x4b7a('0x99')][_0x4b7a('0x9a')]=_0xd4f178[_0x4b7a('0x93')];}return new BPromise(function(_0x45a0af,_0x4d8d4d){if(_0xd4f178[_0x4b7a('0x96')]){for(var _0xead8c7=0x0;_0xead8c7<_0xd4f178[_0x4b7a('0x96')]['length'];_0xead8c7++){var _0xd7f9a7=_0xd4f178[_0x4b7a('0x96')][_0xead8c7];var _0x4ff959=path[_0x4b7a('0x90')](_0x29fa4b,_0xd7f9a7[_0x4b7a('0x5c')]);if(fs[_0x4b7a('0x9b')](_0x4ff959)){_0x2dce0d[_0x4b7a('0x5a')][_0x4b7a('0x9c')]({'name':_0xd7f9a7[_0x4b7a('0x2a')],'contentType':_0xd7f9a7[_0x4b7a('0x30')],'data':fs['readFileSync'](_0x4ff959)});}}}emlformat[_0x4b7a('0x9d')](_0x2dce0d,function(_0x1b2a40,_0x59e757){if(_0x1b2a40)return _0x4d8d4d(_0x1b2a40);fs[_0x4b7a('0x9e')](path[_0x4b7a('0x90')](_0x1c6e92,_0x656be3),_0x59e757);return _0x45a0af(_0x59e757);});});}})['then'](function(_0x23e973){if(_0x23e973){return _0xd609ce['download'](path[_0x4b7a('0x90')](_0x1c6e92,_0x656be3),_0x656be3,function(_0x35540f){if(!_0x35540f)fs[_0x4b7a('0x9f')](path['join'](_0x1c6e92,_0x656be3));});}})[_0x4b7a('0x44')](handleError(_0xd609ce,null));}; \ No newline at end of file +var _0x0134=['name','index','MailMessage','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','merge','map','filter','options','includeAll','include','length','find','update','body','params','describe','create','out','secret','split','MailAccount','findOne','MailAccountId','CmList','List','CmContact','Contacts','updatedAt','DESC','MailServerOut','Smtp','CloudProvider','getSmtpOptions','attachments','join','root','server/files/attachments','ListId','List\x20not\x20found','sendMail','format','YYYY-MM-DD\x20HH:mm:ss','accept','read','readAt','UserId','user','agent','get','MailInteraction','MailInteractionId','isNil','read1stAt','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','contact','email','internal','manual','interface','SIP/%s','channel','motionChannel','fromString','EventManager','reject','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT','User','fullname','event','rejectmessage','unix','toString','server','tmp','files','message-%s.eml','from','bcc','subject','Attachment','createdAt','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','Attachments','basename','existsSync','type','build','writeFileSync','download','eml-format','moment','bluebird','util','path','lodash','ioredis','html-to-text','api','mail-interactions','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','html-entities','register','jayson/promise','http','client','request','then','info','MailMessage,\x20%s,\x20%s','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','status','offset','limit','undefined','count','set','Content-Range','destroy','end','sendStatus','stack'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0x0134,0x74));var _0x4013=function(_0x233b2a,_0x440cd1){_0x233b2a=_0x233b2a-0x0;var _0x4e828a=_0x0134[_0x233b2a];return _0x4e828a;};'use strict';var emlformat=require(_0x4013('0x0'));var moment=require(_0x4013('0x1'));var BPromise=require(_0x4013('0x2'));var util=require(_0x4013('0x3'));var path=require(_0x4013('0x4'));var fs=require('fs');var _=require(_0x4013('0x5'));var Redis=require(_0x4013('0x6'));var htmlToText=require(_0x4013('0x7'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x4013('0x8'));var interaction_log=require('../../config/logger')(_0x4013('0x9'));var config=require(_0x4013('0xa'));var db=require(_0x4013('0xb'))['db'];config[_0x4013('0xc')]=_[_0x4013('0xd')](config[_0x4013('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x4013('0xe'))(new Redis(config[_0x4013('0xc')]));var htmlEntities=require(_0x4013('0xf'));require('./mailMessage.socket')[_0x4013('0x10')](socket);var jayson=require(_0x4013('0x11'));var client=jayson['client'][_0x4013('0x12')]({'port':0x232c});var client9003=jayson['client']['http']({'port':0x232b});var client9002=jayson[_0x4013('0x13')][_0x4013('0x12')]({'port':0x232a});function respondWithRpcPromise(_0x3fb05f,_0x6acc5d,_0x508612,_0xa558f1){return new BPromise(function(_0x31ce4d,_0x449273){var _0x455912=_0xa558f1||client;return _0x455912[_0x4013('0x14')](_0x3fb05f,_0x508612)[_0x4013('0x15')](function(_0x306bac){logger[_0x4013('0x16')](_0x4013('0x17'),_0x6acc5d,'request\x20sent');logger['debug'](_0x4013('0x18'),_0x6acc5d,_0x4013('0x19'),JSON[_0x4013('0x1a')](_0x306bac));if(_0x306bac[_0x4013('0x1b')]){if(_0x306bac[_0x4013('0x1b')]['code']===0x1f4){logger[_0x4013('0x1b')]('MailMessage,\x20%s,\x20%s',_0x6acc5d,_0x306bac[_0x4013('0x1b')][_0x4013('0x1c')]);return _0x449273(_0x306bac[_0x4013('0x1b')][_0x4013('0x1c')]);}logger['error'](_0x4013('0x17'),_0x6acc5d,_0x306bac['error']['message']);return _0x31ce4d(_0x306bac[_0x4013('0x1b')][_0x4013('0x1c')]);}else{logger[_0x4013('0x16')]('MailMessage,\x20%s,\x20%s',_0x6acc5d,_0x4013('0x19'));_0x31ce4d(_0x306bac[_0x4013('0x1d')][_0x4013('0x1c')]);}})[_0x4013('0x1e')](function(_0x333858){logger[_0x4013('0x1b')]('MailMessage,\x20%s,\x20%s',_0x6acc5d,_0x333858);_0x449273(_0x333858);});});}function respondWithResult(_0x3d044e,_0x260066){_0x260066=_0x260066||0xc8;return function(_0x424696){if(_0x424696){return _0x3d044e[_0x4013('0x1f')](_0x260066)['json'](_0x424696);}};}function respondWithFilteredResult(_0x262db5,_0x2befb2){return function(_0x22ad2e){if(_0x22ad2e){var _0x579dc6=typeof _0x2befb2[_0x4013('0x20')]==='undefined'&&typeof _0x2befb2[_0x4013('0x21')]===_0x4013('0x22');var _0x15e397=_0x22ad2e[_0x4013('0x23')];var _0x380bf2=_0x579dc6?0x0:_0x2befb2[_0x4013('0x20')];var _0x4c314d=_0x579dc6?_0x22ad2e['count']:_0x2befb2[_0x4013('0x20')]+_0x2befb2[_0x4013('0x21')];var _0x2eff72;if(_0x4c314d>=_0x15e397){_0x4c314d=_0x15e397;_0x2eff72=0xc8;}else{_0x2eff72=0xce;}_0x262db5[_0x4013('0x1f')](_0x2eff72);return _0x262db5[_0x4013('0x24')](_0x4013('0x25'),_0x380bf2+'-'+_0x4c314d+'/'+_0x15e397)['json'](_0x22ad2e);}return null;};}function saveUpdates(_0x3d6ded){return function(_0x450ef2){if(_0x450ef2){return _0x450ef2['update'](_0x3d6ded)[_0x4013('0x15')](function(_0x3416ec){return _0x3416ec;});}return null;};}function removeEntity(_0x12e064){return function(_0x5121e8){if(_0x5121e8){return _0x5121e8[_0x4013('0x26')]()[_0x4013('0x15')](function(){_0x12e064[_0x4013('0x1f')](0xcc)[_0x4013('0x27')]();});}};}function handleEntityNotFound(_0x315c55){return function(_0x5087ce){if(!_0x5087ce){_0x315c55[_0x4013('0x28')](0x194);}return _0x5087ce;};}function handleError(_0x5c154b,_0x48e3b3){_0x48e3b3=_0x48e3b3||0x1f4;return function(_0x5ba23c){logger['error'](_0x5ba23c[_0x4013('0x29')]);if(_0x5ba23c[_0x4013('0x2a')]){delete _0x5ba23c[_0x4013('0x2a')];}_0x5c154b[_0x4013('0x1f')](_0x48e3b3)['send'](_0x5ba23c);};}exports[_0x4013('0x2b')]=function(_0x4a5148,_0x54a94d){var _0x4ab56c={},_0x555beb={},_0x143b40={'count':0x0,'rows':[]};var _0x4e1251=_['map'](db[_0x4013('0x2c')][_0x4013('0x2d')],function(_0x163cee){return{'name':_0x163cee[_0x4013('0x2e')],'type':_0x163cee['type'][_0x4013('0x2f')]};});_0x555beb[_0x4013('0x30')]=_['map'](_0x4e1251,'name');_0x555beb[_0x4013('0x31')]=_[_0x4013('0x32')](_0x4a5148[_0x4013('0x31')]);_0x555beb[_0x4013('0x33')]=_[_0x4013('0x34')](_0x555beb[_0x4013('0x30')],_0x555beb['query']);_0x4ab56c[_0x4013('0x35')]=_[_0x4013('0x34')](_0x555beb[_0x4013('0x30')],qs['fields'](_0x4a5148['query'][_0x4013('0x36')]));_0x4ab56c[_0x4013('0x35')]=_0x4ab56c[_0x4013('0x35')]['length']?_0x4ab56c['attributes']:_0x555beb[_0x4013('0x30')];if(!_0x4a5148[_0x4013('0x31')]['hasOwnProperty'](_0x4013('0x37'))){_0x4ab56c[_0x4013('0x21')]=qs[_0x4013('0x21')](_0x4a5148[_0x4013('0x31')][_0x4013('0x21')]);_0x4ab56c['offset']=qs[_0x4013('0x20')](_0x4a5148['query'][_0x4013('0x20')]);}_0x4ab56c[_0x4013('0x38')]=qs[_0x4013('0x39')](_0x4a5148[_0x4013('0x31')]['sort']);_0x4ab56c[_0x4013('0x3a')]=qs[_0x4013('0x33')](_[_0x4013('0x3b')](_0x4a5148['query'],_0x555beb['filters']),_0x4e1251);if(_0x4a5148[_0x4013('0x31')]['filter']){_0x4ab56c[_0x4013('0x3a')]=_[_0x4013('0x3c')](_0x4ab56c['where'],{'$or':_[_0x4013('0x3d')](_0x4e1251,function(_0x1827be){if(_0x1827be['type']!=='VIRTUAL'){var _0x5321c2={};_0x5321c2[_0x1827be['name']]={'$like':'%'+_0x4a5148['query'][_0x4013('0x3e')]+'%'};return _0x5321c2;}})});}_0x4ab56c=_[_0x4013('0x3c')]({},_0x4ab56c,_0x4a5148[_0x4013('0x3f')]);var _0x3f8c15={'where':_0x4ab56c[_0x4013('0x3a')]};return db[_0x4013('0x2c')][_0x4013('0x23')](_0x3f8c15)[_0x4013('0x15')](function(_0x3b3230){_0x143b40['count']=_0x3b3230;if(_0x4a5148[_0x4013('0x31')][_0x4013('0x40')]){_0x4ab56c[_0x4013('0x41')]=[{'all':!![]}];}return db[_0x4013('0x2c')]['findAll'](_0x4ab56c);})[_0x4013('0x15')](function(_0x4754ea){_0x143b40['rows']=_0x4754ea;return _0x143b40;})['then'](respondWithFilteredResult(_0x54a94d,_0x4ab56c))[_0x4013('0x1e')](handleError(_0x54a94d,null));};exports['show']=function(_0x428c32,_0x5ad07f){var _0x12138d={'raw':!![],'where':{'id':_0x428c32['params']['id']}},_0x1bb90e={};_0x1bb90e[_0x4013('0x30')]=_[_0x4013('0x32')](db['MailMessage']['rawAttributes']);_0x1bb90e[_0x4013('0x31')]=_[_0x4013('0x32')](_0x428c32[_0x4013('0x31')]);_0x1bb90e[_0x4013('0x33')]=_[_0x4013('0x34')](_0x1bb90e[_0x4013('0x30')],_0x1bb90e[_0x4013('0x31')]);_0x12138d[_0x4013('0x35')]=_[_0x4013('0x34')](_0x1bb90e['model'],qs[_0x4013('0x36')](_0x428c32['query'][_0x4013('0x36')]));_0x12138d[_0x4013('0x35')]=_0x12138d['attributes'][_0x4013('0x42')]?_0x12138d['attributes']:_0x1bb90e[_0x4013('0x30')];if(_0x428c32[_0x4013('0x31')][_0x4013('0x40')]){_0x12138d['include']=[{'all':!![]}];}_0x12138d=_[_0x4013('0x3c')]({},_0x12138d,_0x428c32['options']);return db[_0x4013('0x2c')][_0x4013('0x43')](_0x12138d)[_0x4013('0x15')](handleEntityNotFound(_0x5ad07f,null))[_0x4013('0x15')](respondWithResult(_0x5ad07f,null))[_0x4013('0x1e')](handleError(_0x5ad07f,null));};exports[_0x4013('0x44')]=function(_0x366af1,_0x4c5f50){if(_0x366af1[_0x4013('0x45')]['id']){delete _0x366af1[_0x4013('0x45')]['id'];}return db[_0x4013('0x2c')]['find']({'where':{'id':_0x366af1[_0x4013('0x46')]['id']}})[_0x4013('0x15')](handleEntityNotFound(_0x4c5f50,null))[_0x4013('0x15')](saveUpdates(_0x366af1[_0x4013('0x45')],null))['then'](respondWithResult(_0x4c5f50,null))[_0x4013('0x1e')](handleError(_0x4c5f50,null));};exports[_0x4013('0x26')]=function(_0x3b1555,_0x3ca6ba){return db['MailMessage']['find']({'where':{'id':_0x3b1555[_0x4013('0x46')]['id']}})['then'](handleEntityNotFound(_0x3ca6ba,null))[_0x4013('0x15')](removeEntity(_0x3ca6ba,null))[_0x4013('0x1e')](handleError(_0x3ca6ba,null));};exports[_0x4013('0x47')]=function(_0x5671c3,_0x16e4d0){return db[_0x4013('0x2c')][_0x4013('0x47')]()[_0x4013('0x15')](respondWithResult(_0x16e4d0,null))[_0x4013('0x1e')](handleError(_0x16e4d0,null));};exports[_0x4013('0x48')]=function(_0x332e31,_0x47cbc1){return db[_0x4013('0x2c')][_0x4013('0x48')](_0x332e31[_0x4013('0x45')])[_0x4013('0x15')](function(_0x3d3c34){if(_0x3d3c34){if(_0x3d3c34['direction']===_0x4013('0x49')&&!_0x3d3c34[_0x4013('0x4a')]){var _0x47899b,_0x4de3da,_0x21d4a8;if(_0x332e31[_0x4013('0x45')]['to']){_0x4de3da=_0x332e31[_0x4013('0x45')]['to'][_0x4013('0x4b')](',')[0x0];}return db[_0x4013('0x4c')][_0x4013('0x4d')]({'where':{'id':_0x3d3c34[_0x4013('0x4e')]},'include':[{'model':db[_0x4013('0x4f')],'as':_0x4013('0x50'),'include':[{'model':db[_0x4013('0x51')],'as':_0x4013('0x52'),'where':{'email':_0x4de3da},'limit':0x1,'order':[[_0x4013('0x53'),_0x4013('0x54')]]}]},{'model':db[_0x4013('0x55')],'as':_0x4013('0x56'),'raw':!![],'include':[{'model':db[_0x4013('0x57')],'as':_0x4013('0x57'),'raw':!![]}]}]})[_0x4013('0x15')](function(_0x3057d6){_0x47899b=_0x3057d6;if(!_0x47899b||!_0x47899b[_0x4013('0x56')])return;var _0x3fc29a=_0x47899b[_0x4013('0x58')]();if(_0x332e31[_0x4013('0x45')][_0x4013('0x59')]&&_0x332e31[_0x4013('0x45')][_0x4013('0x59')][_0x4013('0x42')]){for(var _0x139913=0x0;_0x139913<_0x332e31[_0x4013('0x45')][_0x4013('0x59')][_0x4013('0x42')];_0x139913+=0x1){_0x332e31[_0x4013('0x45')]['attachments'][_0x139913]={'filename':_0x332e31[_0x4013('0x45')]['attachments'][_0x139913][_0x4013('0x2a')],'path':path[_0x4013('0x5a')](config[_0x4013('0x5b')],_0x4013('0x5c'),_0x332e31[_0x4013('0x45')]['attachments'][_0x139913]['basename'])};}}_0x21d4a8={'account':_0x3fc29a,'message':_0x332e31[_0x4013('0x45')]};return;})[_0x4013('0x15')](function(){if(_0x47899b[_0x4013('0x50')]){if(_0x47899b[_0x4013('0x50')][_0x4013('0x52')][_0x4013('0x42')]){return _0x47899b['List'][_0x4013('0x52')][0x0];}else{return db[_0x4013('0x51')][_0x4013('0x48')](_['defaults'](_0x332e31['body'],{'firstName':_0x332e31['body']['to'],'email':_0x332e31['body']['to'],'phone':_0x332e31[_0x4013('0x45')]['to'],'ListId':_0x47899b[_0x4013('0x5d')]}));}}else{throw new Error(_0x4013('0x5e'));}})[_0x4013('0x15')](function(){if(_0x21d4a8){return respondWithRpcPromise('SendMail',_0x4013('0x5f'),_0x21d4a8,client9003)[_0x4013('0x15')](function(_0xf0de1e){return _0x3d3c34['update']({'read':!![],'messageId':_0xf0de1e['messageId'],'sentAt':moment()[_0x4013('0x60')](_0x4013('0x61'))});})[_0x4013('0x1e')](function(_0x2bc48e){logger[_0x4013('0x1b')]('%s',JSON[_0x4013('0x1a')](_0x2bc48e));return _0x3d3c34;});}return _0x3d3c34;});}return _0x3d3c34;}})[_0x4013('0x15')](respondWithResult(_0x47cbc1,0xc9))[_0x4013('0x1e')](handleError(_0x47cbc1,null));};exports[_0x4013('0x62')]=function(_0x135dd2,_0x4d25f4){var _0x143eaf={'agent':{},'channel':'mail'};if(_0x135dd2[_0x4013('0x45')]['id']){delete _0x135dd2[_0x4013('0x45')]['id'];}_0x135dd2['body'][_0x4013('0x63')]=!![];_0x135dd2['body'][_0x4013('0x64')]=moment()[_0x4013('0x60')](_0x4013('0x61'));_0x135dd2[_0x4013('0x45')][_0x4013('0x65')]=_0x135dd2[_0x4013('0x45')][_0x4013('0x65')]||_0x135dd2[_0x4013('0x66')]['id'];_0x143eaf[_0x4013('0x67')]['id']=_0x135dd2[_0x4013('0x45')][_0x4013('0x65')];return db['MailMessage'][_0x4013('0x43')]({'where':{'id':_0x135dd2['params']['id'],'UserId':null}})[_0x4013('0x15')](handleEntityNotFound(_0x4d25f4,null))['then'](saveUpdates(_0x135dd2[_0x4013('0x45')],null))[_0x4013('0x15')](function(_0x48b7f9){if(_0x48b7f9){_0x143eaf[_0x4013('0x1c')]=_0x48b7f9[_0x4013('0x68')]({'plain':!![]});return db[_0x4013('0x69')][_0x4013('0x43')]({'where':{'id':_0x48b7f9[_0x4013('0x6a')]}});}return null;})[_0x4013('0x15')](handleEntityNotFound(_0x4d25f4,null))[_0x4013('0x15')](function(_0xfa5519){if(_0xfa5519){return _0xfa5519[_0x4013('0x44')]({'UserId':_0x135dd2[_0x4013('0x45')]['UserId'],'read1stAt':_[_0x4013('0x6b')](_0xfa5519[_0x4013('0x6c')])?moment()[_0x4013('0x60')](_0x4013('0x61')):undefined});}return null;})[_0x4013('0x15')](function(_0x31c39b){if(_0x31c39b){_0x143eaf[_0x4013('0x6d')]=_0x31c39b[_0x4013('0x68')]({'plain':!![]});interaction_log[_0x4013('0x16')](_0x4013('0x6e'),_0x135dd2[_0x4013('0x66')]['id'],_0x135dd2[_0x4013('0x66')][_0x4013('0x2a')],_0x135dd2[_0x4013('0x66')]['role'],_0x143eaf[_0x4013('0x6d')]['id'],_0x135dd2[_0x4013('0x45')]?JSON[_0x4013('0x1a')](_0x135dd2[_0x4013('0x45')]):'null');return respondWithRpcPromise(_0x4013('0x6f'),_0x4013('0x70'),_0x143eaf);}return null;})[_0x4013('0x15')](function(_0x29ce25){var _0x3792fc=_0x4013('0x71')+_0x29ce25[_0x4013('0x1c')][_0x4013('0x72')];return db[_0x4013('0x73')][_0x4013('0x31')](_0x3792fc,{'type':db[_0x4013('0x74')][_0x4013('0x75')]['SELECT'],'raw':!![]})[_0x4013('0x15')](function(_0x1183ff){return _0x1183ff;});})[_0x4013('0x15')](function(_0x4b8387){if(_0x4b8387){_0x143eaf['message'][_0x4013('0x76')]=_0x4b8387[0x0];if(!_0x135dd2[_0x4013('0x45')]['UserId'])return;return db['User'][_0x4013('0x43')]({'where':{'id':_0x135dd2[_0x4013('0x45')][_0x4013('0x65')],'role':'agent'},'attributes':['id',_0x4013('0x2a'),'fullname',_0x4013('0x77'),_0x4013('0x78')],'raw':!![]});}return null;})[_0x4013('0x15')](function(_0x341c48){if(!_0x341c48)return null;_0x143eaf[_0x4013('0x1c')][_0x4013('0x67')]=_0x341c48;return _0x143eaf;})[_0x4013('0x15')](function(_0x69fdc6){if(_0x69fdc6){if(_0x135dd2[_0x4013('0x45')][_0x4013('0x79')]){_0x143eaf[_0x4013('0x1c')][_0x4013('0x7a')]=util['format'](_0x4013('0x7b'),_0x135dd2[_0x4013('0x66')][_0x4013('0x2a')]);_0x143eaf[_0x4013('0x1c')][_0x4013('0x7c')]=_0x143eaf['channel'];_0x143eaf[_0x4013('0x1c')][_0x4013('0x7d')]=_0x143eaf[_0x4013('0x7c')];_0x143eaf[_0x4013('0x1c')]['event']='accept';_0x143eaf[_0x4013('0x1c')][_0x4013('0x45')]=htmlToText[_0x4013('0x7e')](_0x143eaf[_0x4013('0x1c')]['body']);return respondWithRpcPromise(_0x4013('0x7f'),'EventManager',{'event':'acceptmessage','message':_0x143eaf['message']},client9002)[_0x4013('0x15')](function(){return _0x143eaf;});}return _0x143eaf;}return null;})[_0x4013('0x15')](respondWithResult(_0x4d25f4,null))[_0x4013('0x1e')](handleError(_0x4d25f4,null));};exports[_0x4013('0x80')]=function(_0x87aeb5,_0x38c2f7){var _0x36365b={'agent':{},'channel':'mail'};if(_0x87aeb5[_0x4013('0x45')]['id']){delete _0x87aeb5['body']['id'];}_0x87aeb5[_0x4013('0x45')]['UserId']=_0x87aeb5['body']['UserId']||_0x87aeb5[_0x4013('0x66')]['id'];_0x36365b[_0x4013('0x67')]['id']=_0x87aeb5[_0x4013('0x45')][_0x4013('0x65')];return db[_0x4013('0x2c')]['find']({'where':{'id':_0x87aeb5[_0x4013('0x46')]['id'],'UserId':null}})[_0x4013('0x15')](handleEntityNotFound(_0x38c2f7,null))[_0x4013('0x15')](function(_0x351f60){if(_0x351f60){_0x36365b[_0x4013('0x1c')]=_0x351f60['get']({'plain':!![]});return db[_0x4013('0x69')][_0x4013('0x43')]({'where':{'id':_0x351f60[_0x4013('0x6a')]}});}return null;})[_0x4013('0x15')](handleEntityNotFound(_0x38c2f7,null))[_0x4013('0x15')](function(_0x165a38){if(_0x165a38){_0x36365b[_0x4013('0x6d')]=_0x165a38[_0x4013('0x68')]({'plain':!![]});interaction_log[_0x4013('0x16')](_0x4013('0x81'),_0x87aeb5['user']['id'],_0x87aeb5['user'][_0x4013('0x2a')],_0x87aeb5[_0x4013('0x66')]['role'],_0x36365b[_0x4013('0x6d')]['id'],_0x87aeb5[_0x4013('0x45')]?JSON['stringify'](_0x87aeb5[_0x4013('0x45')]):'null');return respondWithRpcPromise(_0x4013('0x82'),_0x4013('0x83'),_0x36365b);}return null;})['then'](function(_0x398568){var _0x4717a8='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x398568[_0x4013('0x1c')][_0x4013('0x72')];return db[_0x4013('0x73')]['query'](_0x4717a8,{'type':db[_0x4013('0x74')]['QueryTypes'][_0x4013('0x84')],'raw':!![]})[_0x4013('0x15')](function(_0x11c1e7){return _0x11c1e7;});})[_0x4013('0x15')](function(_0x5523c5){if(_0x5523c5){_0x36365b[_0x4013('0x1c')]['contact']=_0x5523c5[0x0];if(!_0x87aeb5[_0x4013('0x45')]['UserId'])return;return db[_0x4013('0x85')][_0x4013('0x43')]({'where':{'id':_0x87aeb5['body']['UserId'],'role':_0x4013('0x67')},'attributes':['id',_0x4013('0x2a'),_0x4013('0x86'),'email',_0x4013('0x78')],'raw':!![]});}return null;})['then'](function(_0x2ffafc){if(!_0x2ffafc)return null;_0x36365b[_0x4013('0x1c')][_0x4013('0x67')]=_0x2ffafc;return _0x36365b;})['then'](function(_0x342df5){if(_0x342df5){_0x342df5[_0x4013('0x1c')][_0x4013('0x7a')]=util['format']('SIP/%s',_0x87aeb5[_0x4013('0x66')][_0x4013('0x2a')]);_0x342df5[_0x4013('0x1c')][_0x4013('0x7c')]=_0x36365b[_0x4013('0x7c')];_0x342df5[_0x4013('0x1c')][_0x4013('0x7d')]=_0x36365b[_0x4013('0x7c')];_0x342df5[_0x4013('0x1c')][_0x4013('0x87')]='reject';_0x342df5[_0x4013('0x1c')][_0x4013('0x45')]=htmlToText[_0x4013('0x7e')](_0x36365b[_0x4013('0x1c')][_0x4013('0x45')]);respondWithRpcPromise(_0x4013('0x7f'),_0x4013('0x7f'),{'event':_0x4013('0x88'),'message':_0x342df5[_0x4013('0x1c')]},client9002);return _0x36365b;}return null;})['then'](respondWithResult(_0x38c2f7,null))['catch'](handleError(_0x38c2f7,null));};exports['download']=function(_0x3e2afc,_0x2c4be7){var _0x4b6957=moment()[_0x4013('0x89')]()[_0x4013('0x8a')]();var _0x706104=path[_0x4013('0x5a')](config[_0x4013('0x5b')],_0x4013('0x8b'),'files',_0x4013('0x8c'));var _0x4f672e=path[_0x4013('0x5a')](config[_0x4013('0x5b')],_0x4013('0x8b'),_0x4013('0x8d'),_0x4013('0x59'));var _0x3efc2d=util[_0x4013('0x60')](_0x4013('0x8e'),_0x4b6957);return db[_0x4013('0x2c')][_0x4013('0x43')]({'where':{'id':_0x3e2afc[_0x4013('0x46')]['id']},'attributes':['id',_0x4013('0x45'),_0x4013('0x8f'),'to','cc',_0x4013('0x90'),_0x4013('0x91'),'createdAt'],'include':_0x3e2afc[_0x4013('0x31')][_0x4013('0x59')]?[{'model':db[_0x4013('0x92')],'as':'Attachments'}]:undefined})[_0x4013('0x15')](handleEntityNotFound(_0x2c4be7,null))['then'](function(_0xf6a125){if(_0xf6a125){var _0x4c87cc=_0xf6a125;var _0x3839d7={'from':_0x4c87cc[_0x4013('0x8f')],'to':_0x4c87cc['to'],'subject':_0x4c87cc[_0x4013('0x91')],'html':htmlEntities['decode'](_0x4c87cc[_0x4013('0x45')]),'headers':{'Date':moment(_0x4c87cc[_0x4013('0x93')])[_0x4013('0x60')](_0x4013('0x94'))},'attachments':[]};if(_0xf6a125['cc']){_0x3839d7[_0x4013('0x95')]['Cc']=_0xf6a125['cc'];}if(_0xf6a125[_0x4013('0x90')]){_0x3839d7[_0x4013('0x95')][_0x4013('0x96')]=_0xf6a125['bcc'];}return new BPromise(function(_0x2bc210,_0x1ea160){if(_0xf6a125[_0x4013('0x97')]){for(var _0x5e83e3=0x0;_0x5e83e3<_0xf6a125[_0x4013('0x97')][_0x4013('0x42')];_0x5e83e3++){var _0x20aa11=_0xf6a125[_0x4013('0x97')][_0x5e83e3];var _0x427bb2=path['join'](_0x4f672e,_0x20aa11[_0x4013('0x98')]);if(fs[_0x4013('0x99')](_0x427bb2)){_0x3839d7[_0x4013('0x59')]['push']({'name':_0x20aa11[_0x4013('0x2a')],'contentType':_0x20aa11[_0x4013('0x9a')],'data':fs['readFileSync'](_0x427bb2)});}}}emlformat[_0x4013('0x9b')](_0x3839d7,function(_0x464a36,_0x3f8a3a){if(_0x464a36)return _0x1ea160(_0x464a36);fs[_0x4013('0x9c')](path[_0x4013('0x5a')](_0x706104,_0x3efc2d),_0x3f8a3a);return _0x2bc210(_0x3f8a3a);});});}})['then'](function(_0x13bfca){if(_0x13bfca){return _0x2c4be7[_0x4013('0x9d')](path[_0x4013('0x5a')](_0x706104,_0x3efc2d),_0x3efc2d,function(_0x4a75ab){if(!_0x4a75ab)fs['unlinkSync'](path[_0x4013('0x5a')](_0x706104,_0x3efc2d));});}})[_0x4013('0x1e')](handleError(_0x2c4be7,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index 25744cc..a8be92e 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 _0xec72=['update','remove','emit','hasOwnProperty','hook','../../mysqldb','save'];(function(_0x84a238,_0x462910){var _0x22bee0=function(_0x26195b){while(--_0x26195b){_0x84a238['push'](_0x84a238['shift']());}};_0x22bee0(++_0x462910);}(_0xec72,0xd7));var _0x2ec7=function(_0x47181a,_0x59e13b){_0x47181a=_0x47181a-0x0;var _0x4fdc45=_0xec72[_0x47181a];return _0x4fdc45;};'use strict';var EventEmitter=require('events');var MailMessage=require(_0x2ec7('0x0'))['db']['MailMessage'];var MailMessageEvents=new EventEmitter();MailMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x2ec7('0x1'),'afterUpdate':_0x2ec7('0x2'),'afterDestroy':_0x2ec7('0x3')};function emitEvent(_0x8ef466){return function(_0x40489f,_0xaec10b,_0xab1e8d){MailMessageEvents[_0x2ec7('0x4')](_0x8ef466+':'+_0x40489f['id'],_0x40489f);MailMessageEvents[_0x2ec7('0x4')](_0x8ef466,_0x40489f);_0xab1e8d(null);};}for(var e in events){if(events[_0x2ec7('0x5')](e)){var event=events[e];MailMessage[_0x2ec7('0x6')](e,emitEvent(event));}}module['exports']=MailMessageEvents; \ No newline at end of file +var _0x3857=['update','remove','emit','exports','events','save'];(function(_0x14f5e9,_0x394602){var _0x5afb1b=function(_0x5ba8f9){while(--_0x5ba8f9){_0x14f5e9['push'](_0x14f5e9['shift']());}};_0x5afb1b(++_0x394602);}(_0x3857,0x172));var _0x7385=function(_0x2cad69,_0x467679){_0x2cad69=_0x2cad69-0x0;var _0x286fbd=_0x3857[_0x2cad69];return _0x286fbd;};'use strict';var EventEmitter=require(_0x7385('0x0'));var MailMessage=require('../../mysqldb')['db']['MailMessage'];var MailMessageEvents=new EventEmitter();MailMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7385('0x1'),'afterUpdate':_0x7385('0x2'),'afterDestroy':_0x7385('0x3')};function emitEvent(_0x5b1c08){return function(_0x239a26,_0xd214e3,_0x6a02c5){MailMessageEvents['emit'](_0x5b1c08+':'+_0x239a26['id'],_0x239a26);MailMessageEvents[_0x7385('0x4')](_0x5b1c08,_0x239a26);_0x6a02c5(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailMessage['hook'](e,emitEvent(event));}}module[_0x7385('0x5')]=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index 3049a45..c5edb5e 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 _0x2e23=['utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','exports','define','MailMessage','mail_messages','plainBody','FULLTEXT','body','models','get','direction','toLowerCase','out','secret','isNil','UserId','findOne','MailInteractionId','then','update','createdAt','catch','error','utf8mb4'];(function(_0x1857d0,_0x6eade0){var _0x3e3c46=function(_0x3915b8){while(--_0x3915b8){_0x1857d0['push'](_0x1857d0['shift']());}};_0x3e3c46(++_0x6eade0);}(_0x2e23,0x1b3));var _0x32e2=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0x2e23[_0x411add];return _0x238242;};'use strict';var _=require(_0x32e2('0x0'));var util=require('util');var logger=require(_0x32e2('0x1'))(_0x32e2('0x2'));var moment=require(_0x32e2('0x3'));var BPromise=require('bluebird');var rp=require(_0x32e2('0x4'));var htmlToText=require('html-to-text');var fs=require('fs');var path=require('path');var rimraf=require(_0x32e2('0x5'));var config=require(_0x32e2('0x6'));var attributes=require('./mailMessage.attributes');module[_0x32e2('0x7')]=function(_0x520338,_0x1259e3){return _0x520338[_0x32e2('0x8')](_0x32e2('0x9'),attributes,{'tableName':_0x32e2('0xa'),'paranoid':![],'indexes':[{'name':'messageId','fields':['messageId']},{'name':'fti_mail_messages','fields':[_0x32e2('0xb'),'subject'],'type':_0x32e2('0xc')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x1eb72f,_0x3358db,_0x1311ca){if(_0x1eb72f[_0x32e2('0xd')]){_0x1eb72f[_0x32e2('0xb')]=htmlToText['fromString'](_0x1eb72f[_0x32e2('0xd')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x1311ca(null,_0x3358db);},'afterCreate':function(_0xbd8144,_0x9267aa,_0x295244){var _0x273ee5=_0x520338[_0x32e2('0xe')];var _0x1619de=_0xbd8144[_0x32e2('0xf')]({'plain':!![]});if(_0x1619de[_0x32e2('0x10')]['toLowerCase']()==='in'||_0x1619de[_0x32e2('0x10')][_0x32e2('0x11')]()===_0x32e2('0x12')&&!_0x1619de[_0x32e2('0x13')]&&!_[_0x32e2('0x14')](_0x1619de[_0x32e2('0x15')])){_0x273ee5['MailInteraction'][_0x32e2('0x16')]({'where':{'id':_0x1619de[_0x32e2('0x17')]}})[_0x32e2('0x18')](function(_0x20888a){if(_0x20888a){_0x20888a[_0x32e2('0x19')]({'lastMsgAt':_0x1619de[_0x32e2('0x1a')],'lastMsgDirection':_0x1619de[_0x32e2('0x10')]['toLowerCase']()});}})[_0x32e2('0x1b')](function(_0x5bae8c){console[_0x32e2('0x1c')](_0x5bae8c);});}_0x295244();}},'charset':_0x32e2('0x1d'),'collate':_0x32e2('0x1e')});}; \ No newline at end of file +var _0xf3aa=['subject','body','get','direction','toLowerCase','out','isNil','MailInteraction','findOne','MailInteractionId','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','define','mail_messages','messageId','plainBody'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf3aa,0xcb));var _0xaf3a=function(_0x13248d,_0x35184a){_0x13248d=_0x13248d-0x0;var _0x564f27=_0xf3aa[_0x13248d];return _0x564f27;};'use strict';var _=require(_0xaf3a('0x0'));var util=require(_0xaf3a('0x1'));var logger=require(_0xaf3a('0x2'))(_0xaf3a('0x3'));var moment=require(_0xaf3a('0x4'));var BPromise=require(_0xaf3a('0x5'));var rp=require(_0xaf3a('0x6'));var htmlToText=require('html-to-text');var fs=require('fs');var path=require(_0xaf3a('0x7'));var rimraf=require('rimraf');var config=require(_0xaf3a('0x8'));var attributes=require('./mailMessage.attributes');module[_0xaf3a('0x9')]=function(_0x2d4855,_0xbbaf16){return _0x2d4855[_0xaf3a('0xa')]('MailMessage',attributes,{'tableName':_0xaf3a('0xb'),'paranoid':![],'indexes':[{'name':_0xaf3a('0xc'),'fields':[_0xaf3a('0xc')]},{'name':'fti_mail_messages','fields':[_0xaf3a('0xd'),_0xaf3a('0xe')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x3ad7ec,_0x1f0680,_0x1e6f3e){if(_0x3ad7ec[_0xaf3a('0xf')]){_0x3ad7ec[_0xaf3a('0xd')]=htmlToText['fromString'](_0x3ad7ec[_0xaf3a('0xf')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x1e6f3e(null,_0x1f0680);},'afterCreate':function(_0x3fcc5f,_0xe172ee,_0x2c8219){var _0x17f532=_0x2d4855['models'];var _0x497dbf=_0x3fcc5f[_0xaf3a('0x10')]({'plain':!![]});if(_0x497dbf[_0xaf3a('0x11')][_0xaf3a('0x12')]()==='in'||_0x497dbf[_0xaf3a('0x11')][_0xaf3a('0x12')]()===_0xaf3a('0x13')&&!_0x497dbf['secret']&&!_[_0xaf3a('0x14')](_0x497dbf['UserId'])){_0x17f532[_0xaf3a('0x15')][_0xaf3a('0x16')]({'where':{'id':_0x497dbf[_0xaf3a('0x17')]}})[_0xaf3a('0x18')](function(_0x26aa8d){if(_0x26aa8d){_0x26aa8d[_0xaf3a('0x19')]({'lastMsgAt':_0x497dbf[_0xaf3a('0x1a')],'lastMsgDirection':_0x497dbf[_0xaf3a('0x11')][_0xaf3a('0x12')]()});}})[_0xaf3a('0x1b')](function(_0x8df5c9){console[_0xaf3a('0x1c')](_0x8df5c9);});}_0x2c8219();}},'charset':_0xaf3a('0x1d'),'collate':_0xaf3a('0x1e')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index db877b1..58a2d13 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 _0xb9be=['redis','localhost','socket.io-emitter','./mailMessage.socket','register','then','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','CreateMailMessage','MailMessage','create','options','raw','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','defaults'];(function(_0x2ca616,_0x384ec8){var _0x53155f=function(_0x108627){while(--_0x108627){_0x2ca616['push'](_0x2ca616['shift']());}};_0x53155f(++_0x384ec8);}(_0xb9be,0xc5));var _0xeb9b=function(_0x4b4f24,_0x5654a8){_0x4b4f24=_0x4b4f24-0x0;var _0x1c13d4=_0xb9be[_0x4b4f24];return _0x1c13d4;};'use strict';var _=require(_0xeb9b('0x0'));var util=require(_0xeb9b('0x1'));var moment=require(_0xeb9b('0x2'));var BPromise=require(_0xeb9b('0x3'));var rs=require(_0xeb9b('0x4'));var fs=require('fs');var Redis=require(_0xeb9b('0x5'));var db=require(_0xeb9b('0x6'))['db'];var utils=require(_0xeb9b('0x7'));var logger=require(_0xeb9b('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0xeb9b('0x9'));var client=jayson[_0xeb9b('0xa')][_0xeb9b('0xb')]({'port':0x232a});config['redis']=_[_0xeb9b('0xc')](config[_0xeb9b('0xd')],{'host':_0xeb9b('0xe'),'port':0x18eb});var socket=require(_0xeb9b('0xf'))(new Redis(config[_0xeb9b('0xd')]));require(_0xeb9b('0x10'))[_0xeb9b('0x11')](socket);function respondWithRpcPromise(_0x16761a,_0x32f0c4,_0x4f4952){return new BPromise(function(_0x20c855,_0x58d6a4){return client['request'](_0x16761a,_0x4f4952)[_0xeb9b('0x12')](function(_0x4236c0){logger['info'](_0xeb9b('0x13'),_0x32f0c4,_0xeb9b('0x14'));logger[_0xeb9b('0x15')](_0xeb9b('0x16'),_0x32f0c4,'request\x20sent',JSON['stringify'](_0x4236c0));if(_0x4236c0['error']){if(_0x4236c0[_0xeb9b('0x17')][_0xeb9b('0x18')]===0x1f4){logger[_0xeb9b('0x17')]('MailMessage,\x20%s,\x20%s',_0x32f0c4,_0x4236c0['error']['message']);return _0x58d6a4(_0x4236c0[_0xeb9b('0x17')][_0xeb9b('0x19')]);}logger[_0xeb9b('0x17')](_0xeb9b('0x13'),_0x32f0c4,_0x4236c0[_0xeb9b('0x17')][_0xeb9b('0x19')]);return _0x20c855(_0x4236c0[_0xeb9b('0x17')]['message']);}else{logger[_0xeb9b('0x1a')](_0xeb9b('0x13'),_0x32f0c4,_0xeb9b('0x14'));_0x20c855(_0x4236c0[_0xeb9b('0x1b')][_0xeb9b('0x19')]);}})[_0xeb9b('0x1c')](function(_0x21010e){logger[_0xeb9b('0x17')](_0xeb9b('0x13'),_0x32f0c4,_0x21010e);_0x58d6a4(_0x21010e);});});}exports[_0xeb9b('0x1d')]=function(_0x4f436e){var _0x43dc48=this;return new Promise(function(_0x5a7ffd,_0x5d5f54){return db[_0xeb9b('0x1e')][_0xeb9b('0x1f')](_0x4f436e['body'],{'raw':_0x4f436e[_0xeb9b('0x20')]?_0x4f436e[_0xeb9b('0x20')][_0xeb9b('0x21')]===undefined?!![]:![]:!![]})[_0xeb9b('0x12')](function(_0x3c8be7){logger[_0xeb9b('0x1a')](_0xeb9b('0x1d'),_0x4f436e);logger[_0xeb9b('0x15')](_0xeb9b('0x1d'),_0x4f436e,JSON[_0xeb9b('0x22')](_0x3c8be7));_0x5a7ffd(_0x3c8be7);})[_0xeb9b('0x1c')](function(_0x296f95){logger[_0xeb9b('0x17')](_0xeb9b('0x1d'),_0x296f95[_0xeb9b('0x19')],_0x4f436e);_0x5d5f54(_0x43dc48[_0xeb9b('0x17')](0x1f4,_0x296f95['message']));});});}; \ No newline at end of file +var _0xfff0=['rpc','../../config/environment','client','http','redis','socket.io-emitter','./mailMessage.socket','register','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','create','body','options','CreateMailMessage','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x439892,_0x452c91){var _0x2d9cfb=function(_0x3c3286){while(--_0x3c3286){_0x439892['push'](_0x439892['shift']());}};_0x2d9cfb(++_0x452c91);}(_0xfff0,0x139));var _0x0fff=function(_0xba36b6,_0x1f52c3){_0xba36b6=_0xba36b6-0x0;var _0x46b63e=_0xfff0[_0xba36b6];return _0x46b63e;};'use strict';var _=require('lodash');var util=require(_0x0fff('0x0'));var moment=require(_0x0fff('0x1'));var BPromise=require(_0x0fff('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0fff('0x3'));var db=require(_0x0fff('0x4'))['db'];var utils=require(_0x0fff('0x5'));var logger=require('../../config/logger')(_0x0fff('0x6'));var config=require(_0x0fff('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x0fff('0x8')][_0x0fff('0x9')]({'port':0x232a});config[_0x0fff('0xa')]=_['defaults'](config[_0x0fff('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x0fff('0xb'))(new Redis(config['redis']));require(_0x0fff('0xc'))[_0x0fff('0xd')](socket);function respondWithRpcPromise(_0x4cc3f3,_0x227d28,_0x377b2f){return new BPromise(function(_0x1de923,_0x289e01){return client[_0x0fff('0xe')](_0x4cc3f3,_0x377b2f)[_0x0fff('0xf')](function(_0x363c0d){logger[_0x0fff('0x10')](_0x0fff('0x11'),_0x227d28,_0x0fff('0x12'));logger[_0x0fff('0x13')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x227d28,_0x0fff('0x12'),JSON['stringify'](_0x363c0d));if(_0x363c0d[_0x0fff('0x14')]){if(_0x363c0d[_0x0fff('0x14')][_0x0fff('0x15')]===0x1f4){logger[_0x0fff('0x14')]('MailMessage,\x20%s,\x20%s',_0x227d28,_0x363c0d['error'][_0x0fff('0x16')]);return _0x289e01(_0x363c0d['error']['message']);}logger['error'](_0x0fff('0x11'),_0x227d28,_0x363c0d[_0x0fff('0x14')]['message']);return _0x1de923(_0x363c0d[_0x0fff('0x14')][_0x0fff('0x16')]);}else{logger['info']('MailMessage,\x20%s,\x20%s',_0x227d28,'request\x20sent');_0x1de923(_0x363c0d[_0x0fff('0x17')][_0x0fff('0x16')]);}})[_0x0fff('0x18')](function(_0x3762dc){logger[_0x0fff('0x14')](_0x0fff('0x11'),_0x227d28,_0x3762dc);_0x289e01(_0x3762dc);});});}exports['CreateMailMessage']=function(_0x44a54a){var _0x136520=this;return new Promise(function(_0x48e6f9,_0x49d211){return db['MailMessage'][_0x0fff('0x19')](_0x44a54a[_0x0fff('0x1a')],{'raw':_0x44a54a[_0x0fff('0x1b')]?_0x44a54a[_0x0fff('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0x0fff('0xf')](function(_0x2f8665){logger[_0x0fff('0x10')](_0x0fff('0x1c'),_0x44a54a);logger[_0x0fff('0x13')](_0x0fff('0x1c'),_0x44a54a,JSON['stringify'](_0x2f8665));_0x48e6f9(_0x2f8665);})[_0x0fff('0x18')](function(_0x29f702){logger[_0x0fff('0x14')](_0x0fff('0x1c'),_0x29f702[_0x0fff('0x16')],_0x44a54a);_0x49d211(_0x136520[_0x0fff('0x14')](0x1f4,_0x29f702['message']));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index 1134483..deb8e10 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 _0x5b56=['remove','update','emit','removeListener','./mailMessage.events','save'];(function(_0xb415fc,_0x5f4555){var _0x5d05ba=function(_0xab932e){while(--_0xab932e){_0xb415fc['push'](_0xb415fc['shift']());}};_0x5d05ba(++_0x5f4555);}(_0x5b56,0x9a));var _0x65b5=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x5b56[_0x2c91e9];return _0x13f0ff;};'use strict';var MailMessageEvents=require(_0x65b5('0x0'));var events=[_0x65b5('0x1'),_0x65b5('0x2'),_0x65b5('0x3')];function createListener(_0x5e8635,_0x225b26){return function(_0x100711){_0x225b26[_0x65b5('0x4')](_0x5e8635,_0x100711);};}function removeListener(_0x1cf1dc,_0x4eebee){return function(){MailMessageEvents[_0x65b5('0x5')](_0x1cf1dc,_0x4eebee);};}exports['register']=function(_0x274ed5){for(var _0x4560fb=0x0,_0x5d3621=events['length'];_0x4560fb<_0x5d3621;_0x4560fb++){var _0x2dcf47=events[_0x4560fb];var _0x11fdec=createListener('mailMessage:'+_0x2dcf47,_0x274ed5);MailMessageEvents['on'](_0x2dcf47,_0x11fdec);}}; \ No newline at end of file +var _0x5c86=['mailMessage:','remove','update','emit','removeListener','length'];(function(_0x40dfc1,_0x3c68d6){var _0x5f0cef=function(_0x413392){while(--_0x413392){_0x40dfc1['push'](_0x40dfc1['shift']());}};_0x5f0cef(++_0x3c68d6);}(_0x5c86,0x73));var _0x65c8=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x5c86[_0x501510];return _0x1e6ee5;};'use strict';var MailMessageEvents=require('./mailMessage.events');var events=['save',_0x65c8('0x0'),_0x65c8('0x1')];function createListener(_0x354b44,_0x50bf4c){return function(_0x1b13a7){_0x50bf4c[_0x65c8('0x2')](_0x354b44,_0x1b13a7);};}function removeListener(_0x3ceee9,_0x5cbde0){return function(){MailMessageEvents[_0x65c8('0x3')](_0x3ceee9,_0x5cbde0);};}exports['register']=function(_0x3b5a2f){for(var _0x17916a=0x0,_0x18ffe6=events[_0x65c8('0x4')];_0x17916a<_0x18ffe6;_0x17916a++){var _0x4d6582=events[_0x17916a];var _0x3dd4cc=createListener(_0x65c8('0x5')+_0x4d6582,_0x3b5a2f);MailMessageEvents['on'](_0x4d6582,_0x3dd4cc);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index 336093f..304181b 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 _0x9d36=['index','/describe','/:id','show','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addAgents','put','update','delete','destroy','removeTeams','removeAgents','exports','multer','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueue.controller','get','isAuthenticated'];(function(_0x5edf0b,_0x7c0738){var _0x1e1da9=function(_0x170bc7){while(--_0x170bc7){_0x5edf0b['push'](_0x5edf0b['shift']());}};_0x1e1da9(++_0x7c0738);}(_0x9d36,0xa4));var _0x69d3=function(_0x53648e,_0x591e8d){_0x53648e=_0x53648e-0x0;var _0x5a747e=_0x9d36[_0x53648e];return _0x5a747e;};'use strict';var multer=require(_0x69d3('0x0'));var util=require('util');var path=require(_0x69d3('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x69d3('0x2')]();var fs_extra=require(_0x69d3('0x3'));var auth=require(_0x69d3('0x4'));var interaction=require(_0x69d3('0x5'));var config=require(_0x69d3('0x6'));var controller=require(_0x69d3('0x7'));router[_0x69d3('0x8')]('/',auth[_0x69d3('0x9')](),controller[_0x69d3('0xa')]);router[_0x69d3('0x8')](_0x69d3('0xb'),auth[_0x69d3('0x9')](),controller['describe']);router[_0x69d3('0x8')](_0x69d3('0xc'),auth[_0x69d3('0x9')](),controller[_0x69d3('0xd')]);router[_0x69d3('0x8')]('/:id/members',auth[_0x69d3('0x9')](),controller[_0x69d3('0xe')]);router[_0x69d3('0x8')](_0x69d3('0xf'),auth[_0x69d3('0x9')](),controller[_0x69d3('0x10')]);router[_0x69d3('0x8')](_0x69d3('0x11'),auth[_0x69d3('0x9')](),controller[_0x69d3('0x12')]);router[_0x69d3('0x13')]('/',auth['isAuthenticated'](),controller[_0x69d3('0x14')]);router['post'](_0x69d3('0xf'),auth[_0x69d3('0x9')](),controller['addTeams']);router[_0x69d3('0x13')](_0x69d3('0x11'),auth[_0x69d3('0x9')](),controller[_0x69d3('0x15')]);router[_0x69d3('0x16')]('/:id',auth[_0x69d3('0x9')](),controller[_0x69d3('0x17')]);router[_0x69d3('0x18')]('/:id',auth[_0x69d3('0x9')](),controller[_0x69d3('0x19')]);router[_0x69d3('0x18')](_0x69d3('0xf'),auth[_0x69d3('0x9')](),controller[_0x69d3('0x1a')]);router[_0x69d3('0x18')](_0x69d3('0x11'),auth[_0x69d3('0x9')](),controller[_0x69d3('0x1b')]);module[_0x69d3('0x1c')]=router; \ No newline at end of file +var _0x5876=['Router','fs-extra','../../components/auth/service','../../config/environment','./mailQueue.controller','get','index','isAuthenticated','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','getAgents','post','create','/:id/users','addAgents','update','delete','removeTeams','removeAgents','exports','util','path','connect-timeout'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x5876,0xdd));var _0x6587=function(_0x5b33ad,_0x2a7d55){_0x5b33ad=_0x5b33ad-0x0;var _0x16ec00=_0x5876[_0x5b33ad];return _0x16ec00;};'use strict';var multer=require('multer');var util=require(_0x6587('0x0'));var path=require(_0x6587('0x1'));var timeout=require(_0x6587('0x2'));var express=require('express');var router=express[_0x6587('0x3')]();var fs_extra=require(_0x6587('0x4'));var auth=require(_0x6587('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x6587('0x6'));var controller=require(_0x6587('0x7'));router[_0x6587('0x8')]('/',auth['isAuthenticated'](),controller[_0x6587('0x9')]);router[_0x6587('0x8')]('/describe',auth[_0x6587('0xa')](),controller[_0x6587('0xb')]);router[_0x6587('0x8')](_0x6587('0xc'),auth['isAuthenticated'](),controller[_0x6587('0xd')]);router[_0x6587('0x8')](_0x6587('0xe'),auth[_0x6587('0xa')](),controller[_0x6587('0xf')]);router[_0x6587('0x8')](_0x6587('0x10'),auth[_0x6587('0xa')](),controller[_0x6587('0x11')]);router[_0x6587('0x8')]('/:id/users',auth[_0x6587('0xa')](),controller[_0x6587('0x12')]);router[_0x6587('0x13')]('/',auth[_0x6587('0xa')](),controller[_0x6587('0x14')]);router[_0x6587('0x13')](_0x6587('0x10'),auth['isAuthenticated'](),controller['addTeams']);router[_0x6587('0x13')](_0x6587('0x15'),auth[_0x6587('0xa')](),controller[_0x6587('0x16')]);router['put'](_0x6587('0xc'),auth[_0x6587('0xa')](),controller[_0x6587('0x17')]);router[_0x6587('0x18')]('/:id',auth[_0x6587('0xa')](),controller['destroy']);router[_0x6587('0x18')](_0x6587('0x10'),auth[_0x6587('0xa')](),controller[_0x6587('0x19')]);router[_0x6587('0x18')](_0x6587('0x15'),auth[_0x6587('0xa')](),controller[_0x6587('0x1a')]);module[_0x6587('0x1b')]=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index e0104fb..b3b09f3 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 _0x9d0c=['rrmemory','beepall','sequelize','exports','INTEGER','ENUM'];(function(_0x2a2693,_0x114b3d){var _0x4e1084=function(_0x2bbd18){while(--_0x2bbd18){_0x2a2693['push'](_0x2a2693['shift']());}};_0x4e1084(++_0x114b3d);}(_0x9d0c,0x19a));var _0xc9d0=function(_0x708c47,_0x6eaa1f){_0x708c47=_0x708c47-0x0;var _0x52a470=_0x9d0c[_0x708c47];return _0x52a470;};'use strict';var Sequelize=require(_0xc9d0('0x0'));module[_0xc9d0('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xc9d0('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xc9d0('0x3')](_0xc9d0('0x4'),_0xc9d0('0x5'),'roundrobin')}}; \ No newline at end of file +var _0x6f64=['INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','exports'];(function(_0x1678c8,_0x1c32f4){var _0x387aa9=function(_0x2803bd){while(--_0x2803bd){_0x1678c8['push'](_0x1678c8['shift']());}};_0x387aa9(++_0x1c32f4);}(_0x6f64,0xc9));var _0x46f6=function(_0x128d75,_0x7ef83c){_0x128d75=_0x128d75-0x0;var _0x2034e3=_0x6f64[_0x128d75];return _0x2034e3;};'use strict';var Sequelize=require(_0x46f6('0x0'));module[_0x46f6('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x46f6('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x46f6('0x3')](_0x46f6('0x4'),_0x46f6('0x5'),_0x46f6('0x6'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index 835271e..3b0afd3 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 _0x2f4c=['userMailQueue:save','removeTeams','ids','select','field','tq.TeamId','from','team_has_mail_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','every','TeamId','includes','value','isEmpty','removeAgents','userMailQueue:remove','omit','spread','getAgents','util','squel','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','./mailQueue.socket','register','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','update','then','destroy','MailQueues','UserProfileResource','error','stack','name','send','MailQueue','type','key','getOptions','where','include','query','findAll','rows','catch','show','model','rawAttributes','keys','filters','intersection','attributes','fields','length','merge','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','getMembers','hasOwnProperty','limit','order','sort','MailQueueId','filter','map','options','User','findAndCountAll','UserId','mailPause','updatedAt','createdAt','format','%s/%s','SIP','findOne','Team','pick','nolimit','getTeams','addTeams','online','voicePause','interface','flatMap','Agents','transaction','each','UserMailQueue','findOrCreate','forEach','emit'];(function(_0x4e9628,_0x250573){var _0x27bc8c=function(_0xb3b7ae){while(--_0xb3b7ae){_0x4e9628['push'](_0x4e9628['shift']());}};_0x27bc8c(++_0x250573);}(_0x2f4c,0x117));var _0xc2f4=function(_0x23b172,_0x18d3eb){_0x23b172=_0x23b172-0x0;var _0x5b2323=_0x2f4c[_0x23b172];return _0x5b2323;};'use strict';var BPromise=require('bluebird');var util=require(_0xc2f4('0x0'));var _=require('lodash');var squel=require(_0xc2f4('0x1'));var Redis=require(_0xc2f4('0x2'));var qs=require(_0xc2f4('0x3'));var logger=require(_0xc2f4('0x4'))('api');var config=require(_0xc2f4('0x5'));var db=require(_0xc2f4('0x6'))['db'];config[_0xc2f4('0x7')]=_[_0xc2f4('0x8')](config[_0xc2f4('0x7')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc2f4('0x7')]));require(_0xc2f4('0x9'))[_0xc2f4('0xa')](socket);function respondWithStatusCode(_0xd98c8c,_0x3fd11f){_0x3fd11f=_0x3fd11f||0xcc;return function(_0x9fcb80){if(_0x9fcb80){return _0xd98c8c[_0xc2f4('0xb')](_0x3fd11f);}return _0xd98c8c[_0xc2f4('0xc')](_0x3fd11f)[_0xc2f4('0xd')]();};}function respondWithResult(_0x49d5f6,_0x46aad9){_0x46aad9=_0x46aad9||0xc8;return function(_0x1c881f){if(_0x1c881f){return _0x49d5f6[_0xc2f4('0xc')](_0x46aad9)[_0xc2f4('0xe')](_0x1c881f);}};}function respondWithFilteredResult(_0x4232c8,_0x53b223){return function(_0x200938){if(_0x200938){var _0x21a784=typeof _0x53b223[_0xc2f4('0xf')]===_0xc2f4('0x10')&&typeof _0x53b223['limit']===_0xc2f4('0x10');var _0x13e694=_0x200938[_0xc2f4('0x11')];var _0x21efe5=_0x21a784?0x0:_0x53b223[_0xc2f4('0xf')];var _0xb6a620=_0x21a784?_0x200938[_0xc2f4('0x11')]:_0x53b223[_0xc2f4('0xf')]+_0x53b223['limit'];var _0x3f3a97;if(_0xb6a620>=_0x13e694){_0xb6a620=_0x13e694;_0x3f3a97=0xc8;}else{_0x3f3a97=0xce;}_0x4232c8[_0xc2f4('0xc')](_0x3f3a97);return _0x4232c8[_0xc2f4('0x12')](_0xc2f4('0x13'),_0x21efe5+'-'+_0xb6a620+'/'+_0x13e694)[_0xc2f4('0xe')](_0x200938);}return null;};}function saveUpdates(_0x5923ef){return function(_0x26071e){if(_0x26071e){return _0x26071e[_0xc2f4('0x14')](_0x5923ef)[_0xc2f4('0x15')](function(_0x38e2ed){return _0x38e2ed;});}return null;};}function removeEntity(_0x43e1e7){return function(_0x33c0b6){if(_0x33c0b6){return _0x33c0b6[_0xc2f4('0x16')]()[_0xc2f4('0x15')](function(){var _0x45fa28=_0x33c0b6['get']({'plain':!![]});var _0x277da6=_0xc2f4('0x17');return db[_0xc2f4('0x18')][_0xc2f4('0x16')]({'where':{'type':_0x277da6,'resourceId':_0x45fa28['id']}})[_0xc2f4('0x15')](function(){return _0x33c0b6;});})[_0xc2f4('0x15')](function(){_0x43e1e7[_0xc2f4('0xc')](0xcc)[_0xc2f4('0xd')]();});}};}function handleEntityNotFound(_0x2a58b2){return function(_0x1ebf6e){if(!_0x1ebf6e){_0x2a58b2[_0xc2f4('0xb')](0x194);}return _0x1ebf6e;};}function handleError(_0x25f6c4,_0xf4ca4f){_0xf4ca4f=_0xf4ca4f||0x1f4;return function(_0x256403){logger[_0xc2f4('0x19')](_0x256403[_0xc2f4('0x1a')]);if(_0x256403[_0xc2f4('0x1b')]){delete _0x256403[_0xc2f4('0x1b')];}_0x25f6c4[_0xc2f4('0xc')](_0xf4ca4f)[_0xc2f4('0x1c')](_0x256403);};}exports['index']=function(_0x5cd22c,_0x2d1e2a){var _0x1753a6={};var _0x1bc26a={'count':0x0,'rows':[]};var _0x4fdd29=_['map'](db[_0xc2f4('0x1d')]['rawAttributes'],function(_0x2357e9){return{'name':_0x2357e9['fieldName'],'type':_0x2357e9[_0xc2f4('0x1e')][_0xc2f4('0x1f')]};});_0x1753a6=qs[_0xc2f4('0x20')](_0x4fdd29,_0x5cd22c);var _0x538644={'where':_0x1753a6[_0xc2f4('0x21')]};return db[_0xc2f4('0x1d')][_0xc2f4('0x11')](_0x538644)[_0xc2f4('0x15')](function(_0x3a3890){_0x1bc26a[_0xc2f4('0x11')]=_0x3a3890;_0x1753a6[_0xc2f4('0x22')]=qs[_0xc2f4('0x22')](_0x5cd22c[_0xc2f4('0x23')]);return db[_0xc2f4('0x1d')][_0xc2f4('0x24')](_0x1753a6);})[_0xc2f4('0x15')](function(_0x27eac1){_0x1bc26a[_0xc2f4('0x25')]=_0x27eac1;return _0x1bc26a;})['then'](respondWithFilteredResult(_0x2d1e2a,_0x1753a6))[_0xc2f4('0x26')](handleError(_0x2d1e2a,null));};exports[_0xc2f4('0x27')]=function(_0x394b6d,_0xe14364){var _0x502d22={'raw':!![],'where':{'id':_0x394b6d['params']['id']}},_0x2bb6ab={};_0x2bb6ab[_0xc2f4('0x28')]=_['keys'](db[_0xc2f4('0x1d')][_0xc2f4('0x29')]);_0x2bb6ab[_0xc2f4('0x23')]=_[_0xc2f4('0x2a')](_0x394b6d[_0xc2f4('0x23')]);_0x2bb6ab[_0xc2f4('0x2b')]=_[_0xc2f4('0x2c')](_0x2bb6ab[_0xc2f4('0x28')],_0x2bb6ab['query']);_0x502d22[_0xc2f4('0x2d')]=_[_0xc2f4('0x2c')](_0x2bb6ab[_0xc2f4('0x28')],qs[_0xc2f4('0x2e')](_0x394b6d['query'][_0xc2f4('0x2e')]));_0x502d22[_0xc2f4('0x2d')]=_0x502d22[_0xc2f4('0x2d')][_0xc2f4('0x2f')]?_0x502d22[_0xc2f4('0x2d')]:_0x2bb6ab[_0xc2f4('0x28')];if(_0x394b6d['query']['includeAll']){_0x502d22[_0xc2f4('0x22')]=[{'all':!![]}];}_0x502d22=_[_0xc2f4('0x30')]({},_0x502d22,_0x394b6d['options']);return db[_0xc2f4('0x1d')]['find'](_0x502d22)[_0xc2f4('0x15')](handleEntityNotFound(_0xe14364,null))[_0xc2f4('0x15')](respondWithResult(_0xe14364,null))[_0xc2f4('0x26')](handleError(_0xe14364,null));};exports['create']=function(_0x1bda72,_0x40915d){return db[_0xc2f4('0x1d')][_0xc2f4('0x31')](_0x1bda72['body'],{})[_0xc2f4('0x15')](function(_0x249d03){var _0x316a14=_0x1bda72[_0xc2f4('0x32')][_0xc2f4('0x33')]({'plain':!![]});if(!_0x316a14)throw new Error(_0xc2f4('0x34'));if(_0x316a14[_0xc2f4('0x35')]===_0xc2f4('0x32')){var _0x51c64c=_0x249d03['get']({'plain':!![]});var _0x1ef148=_0xc2f4('0x17');return db[_0xc2f4('0x36')][_0xc2f4('0x37')]({'where':{'name':_0x1ef148,'userProfileId':_0x316a14[_0xc2f4('0x38')]},'raw':!![]})['then'](function(_0xc7d79f){if(_0xc7d79f&&_0xc7d79f[_0xc2f4('0x39')]===0x0){return db[_0xc2f4('0x18')][_0xc2f4('0x31')]({'name':_0x51c64c['name'],'resourceId':_0x51c64c['id'],'type':_0xc7d79f[_0xc2f4('0x1b')],'sectionId':_0xc7d79f['id']},{})['then'](function(){return _0x249d03;});}else{return _0x249d03;}})[_0xc2f4('0x26')](function(_0x5f4bf1){logger[_0xc2f4('0x19')](_0xc2f4('0x3a'),_0x5f4bf1);throw _0x5f4bf1;});}return _0x249d03;})[_0xc2f4('0x15')](respondWithResult(_0x40915d,0xc9))[_0xc2f4('0x26')](handleError(_0x40915d,null));};exports[_0xc2f4('0x14')]=function(_0x25fef6,_0x4c1c99){if(_0x25fef6[_0xc2f4('0x3b')]['id']){delete _0x25fef6[_0xc2f4('0x3b')]['id'];}return db[_0xc2f4('0x1d')][_0xc2f4('0x37')]({'where':{'id':_0x25fef6[_0xc2f4('0x3c')]['id']}})['then'](handleEntityNotFound(_0x4c1c99,null))[_0xc2f4('0x15')](saveUpdates(_0x25fef6['body'],null))[_0xc2f4('0x15')](respondWithResult(_0x4c1c99,null))[_0xc2f4('0x26')](handleError(_0x4c1c99,null));};exports[_0xc2f4('0x16')]=function(_0x19b548,_0x5c9940){return db['MailQueue']['find']({'where':{'id':_0x19b548[_0xc2f4('0x3c')]['id']}})[_0xc2f4('0x15')](handleEntityNotFound(_0x5c9940,null))[_0xc2f4('0x15')](removeEntity(_0x5c9940,null))[_0xc2f4('0x26')](handleError(_0x5c9940,null));};exports['describe']=function(_0x5bb123,_0x57c5fc){return db[_0xc2f4('0x1d')]['describe']()[_0xc2f4('0x15')](respondWithResult(_0x57c5fc,null))[_0xc2f4('0x26')](handleError(_0x57c5fc,null));};exports[_0xc2f4('0x3d')]=function(_0x172279,_0x598a79){var _0x260537={'raw':!![],'where':{}},_0x111b15={},_0xf32714;return db[_0xc2f4('0x1d')]['findOne']({'where':{'id':_0x172279[_0xc2f4('0x3c')]['id']}})[_0xc2f4('0x15')](handleEntityNotFound(_0x598a79,null))[_0xc2f4('0x15')](function(_0x76fbe){if(_0x76fbe){_0xf32714=_0x76fbe['get']({'plain':!![]});_0x111b15[_0xc2f4('0x28')]=_[_0xc2f4('0x2a')](db['UserMailQueue'][_0xc2f4('0x29')]);_0x111b15[_0xc2f4('0x23')]=_[_0xc2f4('0x2a')](_0x172279[_0xc2f4('0x23')]);_0x111b15['filters']=_[_0xc2f4('0x2c')](_0x111b15[_0xc2f4('0x28')],_0x111b15[_0xc2f4('0x23')]);_0x260537[_0xc2f4('0x2d')]=_['intersection'](_0x111b15[_0xc2f4('0x28')],qs['fields'](_0x172279[_0xc2f4('0x23')][_0xc2f4('0x2e')]));_0x260537[_0xc2f4('0x2d')]=_0x260537[_0xc2f4('0x2d')][_0xc2f4('0x2f')]?_0x260537[_0xc2f4('0x2d')]:_0x111b15[_0xc2f4('0x28')];if(!_0x172279['query'][_0xc2f4('0x3e')]('nolimit')){_0x260537[_0xc2f4('0x3f')]=qs['limit'](_0x172279[_0xc2f4('0x23')]['limit']);_0x260537['offset']=qs[_0xc2f4('0xf')](_0x172279[_0xc2f4('0x23')][_0xc2f4('0xf')]);}_0x260537[_0xc2f4('0x40')]=qs[_0xc2f4('0x41')](_0x172279[_0xc2f4('0x23')][_0xc2f4('0x41')]);_0x260537['where']=qs[_0xc2f4('0x2b')](_['pick'](_0x172279[_0xc2f4('0x23')],_0x111b15[_0xc2f4('0x2b')]));_0x260537[_0xc2f4('0x21')][_0xc2f4('0x42')]=_0x76fbe['id'];if(_0x172279[_0xc2f4('0x23')][_0xc2f4('0x43')]){_0x260537['where']=_[_0xc2f4('0x30')](_0x260537[_0xc2f4('0x21')],{'$or':_[_0xc2f4('0x44')](_0x260537[_0xc2f4('0x2d')],function(_0x2d221f){var _0x5155a9={};_0x5155a9[_0x2d221f]={'$like':'%'+_0x172279['query'][_0xc2f4('0x43')]+'%'};return _0x5155a9;})});}_0x260537=_[_0xc2f4('0x30')]({},_0x260537,_0x172279[_0xc2f4('0x45')]);return db['UserMailQueue'][_0xc2f4('0x24')](_0x260537);}})['then'](function(_0x34f720){if(_0x34f720){return db[_0xc2f4('0x46')][_0xc2f4('0x47')]({'where':{'id':_[_0xc2f4('0x44')](_0x34f720,_0xc2f4('0x48')),'role':'agent'},'attributes':['id','name',_0xc2f4('0x49'),_0xc2f4('0x4a'),_0xc2f4('0x4b')]});}})[_0xc2f4('0x15')](function(_0x5c921c){if(_0x5c921c){return{'count':_0x5c921c[_0xc2f4('0x11')],'rows':_[_0xc2f4('0x44')](_0x5c921c[_0xc2f4('0x25')],function(_0x43de15){return{'membername':_0x43de15[_0xc2f4('0x1b')],'UserId':_0x43de15['id'],'queue_name':_0xf32714[_0xc2f4('0x1b')],'MailQueueId':_0xf32714['id'],'interface':util[_0xc2f4('0x4c')](_0xc2f4('0x4d'),_0xc2f4('0x4e'),_0x43de15[_0xc2f4('0x1b')]),'penalty':0x0,'paused':_0x43de15[_0xc2f4('0x49')],'createdAt':_0x43de15[_0xc2f4('0x4b')],'updatedAt':_0x43de15[_0xc2f4('0x4a')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xc2f4('0x15')](respondWithFilteredResult(_0x598a79,_0x260537))[_0xc2f4('0x26')](handleError(_0x598a79,null));};exports['getTeams']=function(_0x34de7b,_0x5037ba){var _0x528c21={};var _0x17fd65={};var _0x2e2651;var _0x2b1622;return db['MailQueue'][_0xc2f4('0x4f')]({'where':{'id':_0x34de7b['params']['id']}})['then'](handleEntityNotFound(_0x5037ba,null))[_0xc2f4('0x15')](function(_0x4f6bb6){if(_0x4f6bb6){_0x2e2651=_0x4f6bb6;_0x17fd65[_0xc2f4('0x28')]=_[_0xc2f4('0x2a')](db[_0xc2f4('0x50')]['rawAttributes']);_0x17fd65[_0xc2f4('0x23')]=_[_0xc2f4('0x2a')](_0x34de7b[_0xc2f4('0x23')]);_0x17fd65[_0xc2f4('0x2b')]=_[_0xc2f4('0x2c')](_0x17fd65[_0xc2f4('0x28')],_0x17fd65[_0xc2f4('0x23')]);_0x528c21[_0xc2f4('0x2d')]=_['intersection'](_0x17fd65[_0xc2f4('0x28')],qs[_0xc2f4('0x2e')](_0x34de7b[_0xc2f4('0x23')][_0xc2f4('0x2e')]));_0x528c21[_0xc2f4('0x2d')]=_0x528c21[_0xc2f4('0x2d')][_0xc2f4('0x2f')]?_0x528c21[_0xc2f4('0x2d')]:_0x17fd65[_0xc2f4('0x28')];_0x528c21[_0xc2f4('0x40')]=qs[_0xc2f4('0x41')](_0x34de7b[_0xc2f4('0x23')][_0xc2f4('0x41')]);_0x528c21[_0xc2f4('0x21')]=qs[_0xc2f4('0x2b')](_[_0xc2f4('0x51')](_0x34de7b[_0xc2f4('0x23')],_0x17fd65[_0xc2f4('0x2b')]));if(_0x34de7b['query'][_0xc2f4('0x43')]){_0x528c21[_0xc2f4('0x21')]=_['merge'](_0x528c21[_0xc2f4('0x21')],{'$or':_[_0xc2f4('0x44')](_0x528c21[_0xc2f4('0x2d')],function(_0x4972d6){var _0x36dc75={};_0x36dc75[_0x4972d6]={'$like':'%'+_0x34de7b[_0xc2f4('0x23')][_0xc2f4('0x43')]+'%'};return _0x36dc75;})});}_0x528c21=_[_0xc2f4('0x30')]({},_0x528c21,_0x34de7b['options']);return _0x2e2651['getTeams'](_0x528c21);}})['then'](function(_0x2f0f59){if(_0x2f0f59){_0x2b1622=_0x2f0f59[_0xc2f4('0x2f')];if(!_0x34de7b[_0xc2f4('0x23')][_0xc2f4('0x3e')](_0xc2f4('0x52'))){_0x528c21[_0xc2f4('0x3f')]=qs[_0xc2f4('0x3f')](_0x34de7b[_0xc2f4('0x23')][_0xc2f4('0x3f')]);_0x528c21['offset']=qs['offset'](_0x34de7b[_0xc2f4('0x23')][_0xc2f4('0xf')]);}return _0x2e2651[_0xc2f4('0x53')](_0x528c21);}})[_0xc2f4('0x15')](function(_0x271cfb){if(_0x271cfb){return _0x271cfb?{'count':_0x2b1622,'rows':_0x271cfb}:null;}})[_0xc2f4('0x15')](respondWithResult(_0x5037ba,null))[_0xc2f4('0x26')](handleError(_0x5037ba,null));};exports[_0xc2f4('0x54')]=function(_0x32a7d8,_0x375dc7){var _0x23b378=_0x32a7d8[_0xc2f4('0x3b')]['ids'];return db['Team'][_0xc2f4('0x24')]({'where':{'id':_0x23b378},'attributes':['id'],'include':[{'model':db[_0xc2f4('0x46')],'as':'Agents','attributes':['id','name',_0xc2f4('0x55'),_0xc2f4('0x56'),_0xc2f4('0x57')],'raw':!![]}]})[_0xc2f4('0x15')](function(_0x411e18){if(_0x411e18){var _0x5590cc=_[_0xc2f4('0x58')](_0x411e18,function(_0x5068ef){var _0x119280=_0x5068ef['get']({'plain':!![]});return _0x119280[_0xc2f4('0x59')];});return db[_0xc2f4('0x1d')][_0xc2f4('0x37')]({'where':{'id':_0x32a7d8[_0xc2f4('0x3c')]['id']}})[_0xc2f4('0x15')](function(_0x593934){return db['sequelize'][_0xc2f4('0x5a')](function(_0x287d40){return _0x593934[_0xc2f4('0x54')](_0x23b378,{'transaction':_0x287d40})[_0xc2f4('0x15')](function(){return BPromise[_0xc2f4('0x5b')](_0x5590cc,function(_0x10686e){return db[_0xc2f4('0x5c')][_0xc2f4('0x5d')]({'where':{'UserId':_0x10686e['id'],'MailQueueId':_0x32a7d8[_0xc2f4('0x3c')]['id']},'transaction':_0x287d40});});})[_0xc2f4('0x15')](function(){_0x5590cc[_0xc2f4('0x5e')](function(_0x3a8c85){socket[_0xc2f4('0x5f')](_0xc2f4('0x60'),{'UserId':_0x3a8c85['id'],'MailQueueId':_0x593934['id']});});});});});}})[_0xc2f4('0x15')](respondWithStatusCode(_0x375dc7,null))[_0xc2f4('0x26')](handleError(_0x375dc7,null));};exports[_0xc2f4('0x61')]=function(_0x3459f2,_0x709cff){return db[_0xc2f4('0x50')]['findAll']({'where':{'id':_0x3459f2[_0xc2f4('0x23')][_0xc2f4('0x62')]},'attributes':['id'],'include':[{'model':db[_0xc2f4('0x46')],'as':_0xc2f4('0x59'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x709cff,null))[_0xc2f4('0x15')](function(_0x56a6ed){var _0xbf36c0=_[_0xc2f4('0x44')](_0x56a6ed,'id');var _0x1e4704=[];var _0x5aa7a4=[];var _0x51a297=squel[_0xc2f4('0x63')]();_0x51a297[_0xc2f4('0x64')](_0xc2f4('0x65'))[_0xc2f4('0x66')](_0xc2f4('0x67'),'tq')[_0xc2f4('0x68')](_0xc2f4('0x69'),'ut',_0xc2f4('0x6a'))['where'](_0xc2f4('0x6b'),_0x3459f2[_0xc2f4('0x3c')]['id']);for(var _0x515169=0x0;_0x515169<_0x56a6ed['length'];_0x515169+=0x1){let _0x23e60e=_0x56a6ed[_0x515169];for(var _0x4df9c4=0x0;_0x4df9c4<_0x23e60e['Agents']['length'];_0x4df9c4+=0x1){let _0x55da03=_0x23e60e[_0xc2f4('0x59')][_0x4df9c4];var _0x44911d=_0x51a297[_0xc2f4('0x6c')]();_0x44911d[_0xc2f4('0x21')](_0xc2f4('0x6d'),_0x55da03['id']);_0x5aa7a4[_0xc2f4('0x6e')](db[_0xc2f4('0x6f')][_0xc2f4('0x23')](_0x44911d[_0xc2f4('0x70')](),{'type':db[_0xc2f4('0x6f')][_0xc2f4('0x71')][_0xc2f4('0x72')]})[_0xc2f4('0x15')](function(_0x33005d){if(_0x33005d[_0xc2f4('0x2f')]===0x1){return _0x55da03['id'];}else{var _0x59c6e0=_[_0xc2f4('0x73')](_['map'](_0x33005d,_0xc2f4('0x74')),function(_0x5478e6){return _[_0xc2f4('0x75')](_0xbf36c0,_0x5478e6);});if(_0x59c6e0){return _0x55da03['id'];}}}));}}return BPromise['all'](_0x5aa7a4)[_0xc2f4('0x15')](function(_0x506cb7){_0x1e4704=_(_0x1e4704)['union'](_0x506cb7)['compact']()[_0xc2f4('0x76')]();return db['MailQueue']['find']({'where':{'id':_0x3459f2['params']['id']}})[_0xc2f4('0x15')](function(_0x2419fb){return db[_0xc2f4('0x6f')][_0xc2f4('0x5a')](function(_0x55ee3e){return _0x2419fb[_0xc2f4('0x61')](_0x3459f2['query'][_0xc2f4('0x62')],{'transaction':_0x55ee3e})[_0xc2f4('0x15')](function(){if(!_[_0xc2f4('0x77')](_0x1e4704)){return _0x2419fb[_0xc2f4('0x78')](_0x1e4704,{'transaction':_0x55ee3e});}})[_0xc2f4('0x15')](function(){_0x1e4704['forEach'](function(_0x2bb49a){socket[_0xc2f4('0x5f')](_0xc2f4('0x79'),{'UserId':_0x2bb49a,'MailQueueId':_0x2419fb['id']});});});});});});})[_0xc2f4('0x15')](respondWithStatusCode(_0x709cff,null))[_0xc2f4('0x26')](handleError(_0x709cff,null));};exports['addAgents']=function(_0x860370,_0x166352){return db[_0xc2f4('0x1d')][_0xc2f4('0x37')]({'where':{'id':_0x860370[_0xc2f4('0x3c')]['id']}})[_0xc2f4('0x15')](handleEntityNotFound(_0x166352,null))[_0xc2f4('0x15')](function(_0x3a3fbf){if(_0x3a3fbf){return _0x3a3fbf['addAgents'](_0x860370[_0xc2f4('0x3b')][_0xc2f4('0x62')],_[_0xc2f4('0x7a')](_0x860370[_0xc2f4('0x3b')],['ids','id'])||{})[_0xc2f4('0x7b')](function(_0x48d944){for(var _0x20f434=0x0;_0x20f434<_0x860370[_0xc2f4('0x3b')][_0xc2f4('0x62')]['length'];_0x20f434+=0x1){socket[_0xc2f4('0x5f')](_0xc2f4('0x60'),{'UserId':Number(_0x860370[_0xc2f4('0x3b')]['ids'][_0x20f434]),'MailQueueId':Number(_0x860370[_0xc2f4('0x3c')]['id'])});}return _0x48d944;});}})['then'](respondWithResult(_0x166352,null))[_0xc2f4('0x26')](handleError(_0x166352,null));};exports[_0xc2f4('0x78')]=function(_0x3ec75b,_0x4fef41){return db['MailQueue']['find']({'where':{'id':_0x3ec75b[_0xc2f4('0x3c')]['id']}})[_0xc2f4('0x15')](handleEntityNotFound(_0x4fef41,null))[_0xc2f4('0x15')](function(_0x18ac99){if(_0x18ac99){return _0x18ac99[_0xc2f4('0x78')](_0x3ec75b[_0xc2f4('0x23')]['ids'])[_0xc2f4('0x15')](function(){if(_['isArray'](_0x3ec75b[_0xc2f4('0x23')][_0xc2f4('0x62')])){for(var _0x100dc7=0x0;_0x100dc7<_0x3ec75b[_0xc2f4('0x23')][_0xc2f4('0x62')][_0xc2f4('0x2f')];_0x100dc7+=0x1){socket[_0xc2f4('0x5f')]('userMailQueue:remove',{'UserId':Number(_0x3ec75b[_0xc2f4('0x23')][_0xc2f4('0x62')][_0x100dc7]),'MailQueueId':Number(_0x3ec75b['params']['id'])});}}else{socket[_0xc2f4('0x5f')](_0xc2f4('0x79'),{'UserId':Number(_0x3ec75b[_0xc2f4('0x23')]['ids']),'MailQueueId':Number(_0x3ec75b[_0xc2f4('0x3c')]['id'])});}});}})[_0xc2f4('0x15')](respondWithStatusCode(_0x4fef41,null))[_0xc2f4('0x26')](handleError(_0x4fef41,null));};exports[_0xc2f4('0x7c')]=function(_0x2c8a8b,_0x41e451){var _0x2a178c={};var _0xb96c89={};var _0x20550d;var _0x21e8de;return db[_0xc2f4('0x1d')][_0xc2f4('0x4f')]({'where':{'id':_0x2c8a8b[_0xc2f4('0x3c')]['id']}})[_0xc2f4('0x15')](handleEntityNotFound(_0x41e451,null))[_0xc2f4('0x15')](function(_0x2a48a6){if(_0x2a48a6){_0x20550d=_0x2a48a6;_0xb96c89[_0xc2f4('0x28')]=_[_0xc2f4('0x2a')](db[_0xc2f4('0x46')][_0xc2f4('0x29')]);_0xb96c89[_0xc2f4('0x23')]=_['keys'](_0x2c8a8b[_0xc2f4('0x23')]);_0xb96c89['filters']=_[_0xc2f4('0x2c')](_0xb96c89[_0xc2f4('0x28')],_0xb96c89[_0xc2f4('0x23')]);_0x2a178c['attributes']=_['intersection'](_0xb96c89['model'],qs[_0xc2f4('0x2e')](_0x2c8a8b[_0xc2f4('0x23')][_0xc2f4('0x2e')]));_0x2a178c[_0xc2f4('0x2d')]=_0x2a178c[_0xc2f4('0x2d')]['length']?_0x2a178c[_0xc2f4('0x2d')]:_0xb96c89[_0xc2f4('0x28')];_0x2a178c[_0xc2f4('0x40')]=qs[_0xc2f4('0x41')](_0x2c8a8b[_0xc2f4('0x23')][_0xc2f4('0x41')]);_0x2a178c[_0xc2f4('0x21')]=qs[_0xc2f4('0x2b')](_['pick'](_0x2c8a8b[_0xc2f4('0x23')],_0xb96c89[_0xc2f4('0x2b')]));if(_0x2c8a8b[_0xc2f4('0x23')]['filter']){_0x2a178c[_0xc2f4('0x21')]=_[_0xc2f4('0x30')](_0x2a178c[_0xc2f4('0x21')],{'$or':_['map'](_0x2a178c[_0xc2f4('0x2d')],function(_0x4711a2){var _0x57f5fb={};_0x57f5fb[_0x4711a2]={'$like':'%'+_0x2c8a8b['query'][_0xc2f4('0x43')]+'%'};return _0x57f5fb;})});}_0x2a178c=_['merge']({},_0x2a178c,_0x2c8a8b['options']);return _0x20550d['getAgents'](_0x2a178c);}})[_0xc2f4('0x15')](function(_0x22b2a1){if(_0x22b2a1){_0x21e8de=_0x22b2a1[_0xc2f4('0x2f')];if(!_0x2c8a8b['query'][_0xc2f4('0x3e')]('nolimit')){_0x2a178c[_0xc2f4('0x3f')]=qs[_0xc2f4('0x3f')](_0x2c8a8b[_0xc2f4('0x23')][_0xc2f4('0x3f')]);_0x2a178c[_0xc2f4('0xf')]=qs['offset'](_0x2c8a8b[_0xc2f4('0x23')][_0xc2f4('0xf')]);}return _0x20550d['getAgents'](_0x2a178c);}})['then'](function(_0x3155f3){if(_0x3155f3){return _0x3155f3?{'count':_0x21e8de,'rows':_0x3155f3}:null;}})['then'](respondWithResult(_0x41e451,null))[_0xc2f4('0x26')](handleError(_0x41e451,null));}; \ No newline at end of file +var _0x8d31=['role','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','getMembers','UserMailQueue','hasOwnProperty','sort','MailQueueId','filter','map','UserId','mailPause','updatedAt','createdAt','getTeams','findOne','order','pick','nolimit','addTeams','ids','Team','User','Agents','online','flatMap','sequelize','transaction','findOrCreate','emit','userMailQueue:save','field','tq.TeamId','from','team_has_mail_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','includes','all','union','value','isEmpty','forEach','userMailQueue:remove','addAgents','omit','spread','removeAgents','getAgents','bluebird','util','../../components/parsers/qs','api','../../config/environment','../../mysqldb','localhost','socket.io-emitter','redis','./mailQueue.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','then','destroy','get','MailQueues','UserProfileResource','stack','name','send','index','MailQueue','rawAttributes','fieldName','type','key','getOptions','where','include','findAll','rows','catch','show','params','model','keys','query','filters','intersection','attributes','fields','length','merge','options','find','create','body','user'];(function(_0x282f0c,_0x29771a){var _0x3d9b6a=function(_0x4c465f){while(--_0x4c465f){_0x282f0c['push'](_0x282f0c['shift']());}};_0x3d9b6a(++_0x29771a);}(_0x8d31,0x11f));var _0x18d3=function(_0x46789d,_0x39ceb0){_0x46789d=_0x46789d-0x0;var _0xaa735c=_0x8d31[_0x46789d];return _0xaa735c;};'use strict';var BPromise=require(_0x18d3('0x0'));var util=require(_0x18d3('0x1'));var _=require('lodash');var squel=require('squel');var Redis=require('ioredis');var qs=require(_0x18d3('0x2'));var logger=require('../../config/logger')(_0x18d3('0x3'));var config=require(_0x18d3('0x4'));var db=require(_0x18d3('0x5'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x18d3('0x6'),'port':0x18eb});var socket=require(_0x18d3('0x7'))(new Redis(config[_0x18d3('0x8')]));require(_0x18d3('0x9'))[_0x18d3('0xa')](socket);function respondWithStatusCode(_0x430657,_0x36a5ad){_0x36a5ad=_0x36a5ad||0xcc;return function(_0x377a0c){if(_0x377a0c){return _0x430657[_0x18d3('0xb')](_0x36a5ad);}return _0x430657[_0x18d3('0xc')](_0x36a5ad)[_0x18d3('0xd')]();};}function respondWithResult(_0x1abf93,_0x3b39d5){_0x3b39d5=_0x3b39d5||0xc8;return function(_0x4748a3){if(_0x4748a3){return _0x1abf93[_0x18d3('0xc')](_0x3b39d5)['json'](_0x4748a3);}};}function respondWithFilteredResult(_0x4bceef,_0x1fedbb){return function(_0x4230ae){if(_0x4230ae){var _0x4d53f4=typeof _0x1fedbb[_0x18d3('0xe')]===_0x18d3('0xf')&&typeof _0x1fedbb[_0x18d3('0x10')]==='undefined';var _0x42c512=_0x4230ae['count'];var _0x4f4230=_0x4d53f4?0x0:_0x1fedbb['offset'];var _0x4fb961=_0x4d53f4?_0x4230ae[_0x18d3('0x11')]:_0x1fedbb[_0x18d3('0xe')]+_0x1fedbb['limit'];var _0x2113c3;if(_0x4fb961>=_0x42c512){_0x4fb961=_0x42c512;_0x2113c3=0xc8;}else{_0x2113c3=0xce;}_0x4bceef[_0x18d3('0xc')](_0x2113c3);return _0x4bceef[_0x18d3('0x12')]('Content-Range',_0x4f4230+'-'+_0x4fb961+'/'+_0x42c512)['json'](_0x4230ae);}return null;};}function saveUpdates(_0x2675ae){return function(_0x29e409){if(_0x29e409){return _0x29e409['update'](_0x2675ae)[_0x18d3('0x13')](function(_0x7be984){return _0x7be984;});}return null;};}function removeEntity(_0x29f74a){return function(_0x413e65){if(_0x413e65){return _0x413e65[_0x18d3('0x14')]()['then'](function(){var _0x18a61f=_0x413e65[_0x18d3('0x15')]({'plain':!![]});var _0x4822fa=_0x18d3('0x16');return db[_0x18d3('0x17')]['destroy']({'where':{'type':_0x4822fa,'resourceId':_0x18a61f['id']}})[_0x18d3('0x13')](function(){return _0x413e65;});})[_0x18d3('0x13')](function(){_0x29f74a[_0x18d3('0xc')](0xcc)[_0x18d3('0xd')]();});}};}function handleEntityNotFound(_0x173d3f){return function(_0x2f63af){if(!_0x2f63af){_0x173d3f[_0x18d3('0xb')](0x194);}return _0x2f63af;};}function handleError(_0x5f0fdd,_0x52a794){_0x52a794=_0x52a794||0x1f4;return function(_0x5d27d6){logger['error'](_0x5d27d6[_0x18d3('0x18')]);if(_0x5d27d6[_0x18d3('0x19')]){delete _0x5d27d6[_0x18d3('0x19')];}_0x5f0fdd[_0x18d3('0xc')](_0x52a794)[_0x18d3('0x1a')](_0x5d27d6);};}exports[_0x18d3('0x1b')]=function(_0x123588,_0x3fb9a0){var _0x2e6dd5={};var _0x4a4626={'count':0x0,'rows':[]};var _0x2bf3fa=_['map'](db[_0x18d3('0x1c')][_0x18d3('0x1d')],function(_0x38707c){return{'name':_0x38707c[_0x18d3('0x1e')],'type':_0x38707c[_0x18d3('0x1f')][_0x18d3('0x20')]};});_0x2e6dd5=qs[_0x18d3('0x21')](_0x2bf3fa,_0x123588);var _0x46d89d={'where':_0x2e6dd5[_0x18d3('0x22')]};return db[_0x18d3('0x1c')][_0x18d3('0x11')](_0x46d89d)[_0x18d3('0x13')](function(_0x385a68){_0x4a4626['count']=_0x385a68;_0x2e6dd5[_0x18d3('0x23')]=qs[_0x18d3('0x23')](_0x123588['query']);return db[_0x18d3('0x1c')][_0x18d3('0x24')](_0x2e6dd5);})[_0x18d3('0x13')](function(_0x18f157){_0x4a4626[_0x18d3('0x25')]=_0x18f157;return _0x4a4626;})[_0x18d3('0x13')](respondWithFilteredResult(_0x3fb9a0,_0x2e6dd5))[_0x18d3('0x26')](handleError(_0x3fb9a0,null));};exports[_0x18d3('0x27')]=function(_0x5de620,_0x57b9d1){var _0x2eab97={'raw':!![],'where':{'id':_0x5de620[_0x18d3('0x28')]['id']}},_0x4504a9={};_0x4504a9[_0x18d3('0x29')]=_[_0x18d3('0x2a')](db[_0x18d3('0x1c')][_0x18d3('0x1d')]);_0x4504a9[_0x18d3('0x2b')]=_[_0x18d3('0x2a')](_0x5de620[_0x18d3('0x2b')]);_0x4504a9[_0x18d3('0x2c')]=_[_0x18d3('0x2d')](_0x4504a9[_0x18d3('0x29')],_0x4504a9['query']);_0x2eab97[_0x18d3('0x2e')]=_['intersection'](_0x4504a9['model'],qs[_0x18d3('0x2f')](_0x5de620['query'][_0x18d3('0x2f')]));_0x2eab97[_0x18d3('0x2e')]=_0x2eab97['attributes'][_0x18d3('0x30')]?_0x2eab97[_0x18d3('0x2e')]:_0x4504a9[_0x18d3('0x29')];if(_0x5de620['query']['includeAll']){_0x2eab97[_0x18d3('0x23')]=[{'all':!![]}];}_0x2eab97=_[_0x18d3('0x31')]({},_0x2eab97,_0x5de620[_0x18d3('0x32')]);return db[_0x18d3('0x1c')][_0x18d3('0x33')](_0x2eab97)['then'](handleEntityNotFound(_0x57b9d1,null))[_0x18d3('0x13')](respondWithResult(_0x57b9d1,null))[_0x18d3('0x26')](handleError(_0x57b9d1,null));};exports[_0x18d3('0x34')]=function(_0x424d8b,_0xcc5061){return db[_0x18d3('0x1c')][_0x18d3('0x34')](_0x424d8b[_0x18d3('0x35')],{})[_0x18d3('0x13')](function(_0x12457e){var _0x2adb99=_0x424d8b[_0x18d3('0x36')][_0x18d3('0x15')]({'plain':!![]});if(!_0x2adb99)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2adb99[_0x18d3('0x37')]===_0x18d3('0x36')){var _0x13001b=_0x12457e[_0x18d3('0x15')]({'plain':!![]});var _0x13866b=_0x18d3('0x16');return db['UserProfileSection'][_0x18d3('0x33')]({'where':{'name':_0x13866b,'userProfileId':_0x2adb99[_0x18d3('0x38')]},'raw':!![]})[_0x18d3('0x13')](function(_0x1928ca){if(_0x1928ca&&_0x1928ca['autoAssociation']===0x0){return db[_0x18d3('0x17')][_0x18d3('0x34')]({'name':_0x13001b['name'],'resourceId':_0x13001b['id'],'type':_0x1928ca['name'],'sectionId':_0x1928ca['id']},{})['then'](function(){return _0x12457e;});}else{return _0x12457e;}})[_0x18d3('0x26')](function(_0x3f0f9f){logger[_0x18d3('0x39')](_0x18d3('0x3a'),_0x3f0f9f);throw _0x3f0f9f;});}return _0x12457e;})[_0x18d3('0x13')](respondWithResult(_0xcc5061,0xc9))[_0x18d3('0x26')](handleError(_0xcc5061,null));};exports[_0x18d3('0x3b')]=function(_0x327c5e,_0x4ac3d2){if(_0x327c5e[_0x18d3('0x35')]['id']){delete _0x327c5e[_0x18d3('0x35')]['id'];}return db[_0x18d3('0x1c')]['find']({'where':{'id':_0x327c5e[_0x18d3('0x28')]['id']}})[_0x18d3('0x13')](handleEntityNotFound(_0x4ac3d2,null))[_0x18d3('0x13')](saveUpdates(_0x327c5e[_0x18d3('0x35')],null))[_0x18d3('0x13')](respondWithResult(_0x4ac3d2,null))['catch'](handleError(_0x4ac3d2,null));};exports[_0x18d3('0x14')]=function(_0x81b762,_0x316045){return db['MailQueue'][_0x18d3('0x33')]({'where':{'id':_0x81b762[_0x18d3('0x28')]['id']}})[_0x18d3('0x13')](handleEntityNotFound(_0x316045,null))[_0x18d3('0x13')](removeEntity(_0x316045,null))[_0x18d3('0x26')](handleError(_0x316045,null));};exports['describe']=function(_0xbf1cc0,_0x1c69e7){return db['MailQueue']['describe']()[_0x18d3('0x13')](respondWithResult(_0x1c69e7,null))[_0x18d3('0x26')](handleError(_0x1c69e7,null));};exports[_0x18d3('0x3c')]=function(_0x3ee369,_0x134bfd){var _0x563935={'raw':!![],'where':{}},_0x113707={},_0x383469;return db[_0x18d3('0x1c')]['findOne']({'where':{'id':_0x3ee369[_0x18d3('0x28')]['id']}})['then'](handleEntityNotFound(_0x134bfd,null))[_0x18d3('0x13')](function(_0xe50243){if(_0xe50243){_0x383469=_0xe50243[_0x18d3('0x15')]({'plain':!![]});_0x113707[_0x18d3('0x29')]=_[_0x18d3('0x2a')](db[_0x18d3('0x3d')]['rawAttributes']);_0x113707[_0x18d3('0x2b')]=_[_0x18d3('0x2a')](_0x3ee369[_0x18d3('0x2b')]);_0x113707[_0x18d3('0x2c')]=_['intersection'](_0x113707[_0x18d3('0x29')],_0x113707[_0x18d3('0x2b')]);_0x563935[_0x18d3('0x2e')]=_[_0x18d3('0x2d')](_0x113707[_0x18d3('0x29')],qs['fields'](_0x3ee369[_0x18d3('0x2b')][_0x18d3('0x2f')]));_0x563935[_0x18d3('0x2e')]=_0x563935['attributes'][_0x18d3('0x30')]?_0x563935['attributes']:_0x113707[_0x18d3('0x29')];if(!_0x3ee369['query'][_0x18d3('0x3e')]('nolimit')){_0x563935[_0x18d3('0x10')]=qs[_0x18d3('0x10')](_0x3ee369[_0x18d3('0x2b')][_0x18d3('0x10')]);_0x563935[_0x18d3('0xe')]=qs['offset'](_0x3ee369[_0x18d3('0x2b')][_0x18d3('0xe')]);}_0x563935['order']=qs['sort'](_0x3ee369[_0x18d3('0x2b')][_0x18d3('0x3f')]);_0x563935[_0x18d3('0x22')]=qs[_0x18d3('0x2c')](_['pick'](_0x3ee369[_0x18d3('0x2b')],_0x113707[_0x18d3('0x2c')]));_0x563935['where'][_0x18d3('0x40')]=_0xe50243['id'];if(_0x3ee369['query'][_0x18d3('0x41')]){_0x563935[_0x18d3('0x22')]=_[_0x18d3('0x31')](_0x563935[_0x18d3('0x22')],{'$or':_[_0x18d3('0x42')](_0x563935[_0x18d3('0x2e')],function(_0x251e8e){var _0x2b94ba={};_0x2b94ba[_0x251e8e]={'$like':'%'+_0x3ee369['query'][_0x18d3('0x41')]+'%'};return _0x2b94ba;})});}_0x563935=_[_0x18d3('0x31')]({},_0x563935,_0x3ee369[_0x18d3('0x32')]);return db[_0x18d3('0x3d')][_0x18d3('0x24')](_0x563935);}})[_0x18d3('0x13')](function(_0x2e2e6d){if(_0x2e2e6d){return db['User']['findAndCountAll']({'where':{'id':_[_0x18d3('0x42')](_0x2e2e6d,_0x18d3('0x43')),'role':'agent'},'attributes':['id',_0x18d3('0x19'),_0x18d3('0x44'),_0x18d3('0x45'),'createdAt']});}})[_0x18d3('0x13')](function(_0x3ae0e0){if(_0x3ae0e0){return{'count':_0x3ae0e0['count'],'rows':_[_0x18d3('0x42')](_0x3ae0e0[_0x18d3('0x25')],function(_0x28d0d5){return{'membername':_0x28d0d5[_0x18d3('0x19')],'UserId':_0x28d0d5['id'],'queue_name':_0x383469[_0x18d3('0x19')],'MailQueueId':_0x383469['id'],'interface':util['format']('%s/%s','SIP',_0x28d0d5[_0x18d3('0x19')]),'penalty':0x0,'paused':_0x28d0d5['mailPause'],'createdAt':_0x28d0d5[_0x18d3('0x46')],'updatedAt':_0x28d0d5[_0x18d3('0x45')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x18d3('0x13')](respondWithFilteredResult(_0x134bfd,_0x563935))[_0x18d3('0x26')](handleError(_0x134bfd,null));};exports[_0x18d3('0x47')]=function(_0x296249,_0x1550e9){var _0x79cff2={};var _0x56d581={};var _0x463a00;var _0x7d1ecd;return db[_0x18d3('0x1c')][_0x18d3('0x48')]({'where':{'id':_0x296249[_0x18d3('0x28')]['id']}})[_0x18d3('0x13')](handleEntityNotFound(_0x1550e9,null))[_0x18d3('0x13')](function(_0x13b667){if(_0x13b667){_0x463a00=_0x13b667;_0x56d581[_0x18d3('0x29')]=_[_0x18d3('0x2a')](db['Team'][_0x18d3('0x1d')]);_0x56d581[_0x18d3('0x2b')]=_[_0x18d3('0x2a')](_0x296249['query']);_0x56d581['filters']=_[_0x18d3('0x2d')](_0x56d581['model'],_0x56d581[_0x18d3('0x2b')]);_0x79cff2[_0x18d3('0x2e')]=_['intersection'](_0x56d581[_0x18d3('0x29')],qs[_0x18d3('0x2f')](_0x296249[_0x18d3('0x2b')][_0x18d3('0x2f')]));_0x79cff2[_0x18d3('0x2e')]=_0x79cff2[_0x18d3('0x2e')][_0x18d3('0x30')]?_0x79cff2['attributes']:_0x56d581['model'];_0x79cff2[_0x18d3('0x49')]=qs[_0x18d3('0x3f')](_0x296249[_0x18d3('0x2b')]['sort']);_0x79cff2[_0x18d3('0x22')]=qs[_0x18d3('0x2c')](_[_0x18d3('0x4a')](_0x296249['query'],_0x56d581['filters']));if(_0x296249[_0x18d3('0x2b')][_0x18d3('0x41')]){_0x79cff2['where']=_[_0x18d3('0x31')](_0x79cff2[_0x18d3('0x22')],{'$or':_['map'](_0x79cff2[_0x18d3('0x2e')],function(_0xb06aa9){var _0x442f7f={};_0x442f7f[_0xb06aa9]={'$like':'%'+_0x296249['query']['filter']+'%'};return _0x442f7f;})});}_0x79cff2=_[_0x18d3('0x31')]({},_0x79cff2,_0x296249[_0x18d3('0x32')]);return _0x463a00[_0x18d3('0x47')](_0x79cff2);}})[_0x18d3('0x13')](function(_0x59ca92){if(_0x59ca92){_0x7d1ecd=_0x59ca92['length'];if(!_0x296249[_0x18d3('0x2b')][_0x18d3('0x3e')](_0x18d3('0x4b'))){_0x79cff2[_0x18d3('0x10')]=qs['limit'](_0x296249[_0x18d3('0x2b')][_0x18d3('0x10')]);_0x79cff2[_0x18d3('0xe')]=qs[_0x18d3('0xe')](_0x296249[_0x18d3('0x2b')][_0x18d3('0xe')]);}return _0x463a00['getTeams'](_0x79cff2);}})['then'](function(_0x1fc92b){if(_0x1fc92b){return _0x1fc92b?{'count':_0x7d1ecd,'rows':_0x1fc92b}:null;}})[_0x18d3('0x13')](respondWithResult(_0x1550e9,null))[_0x18d3('0x26')](handleError(_0x1550e9,null));};exports[_0x18d3('0x4c')]=function(_0x1df22a,_0x5eee45){var _0x6d9a39=_0x1df22a[_0x18d3('0x35')][_0x18d3('0x4d')];return db[_0x18d3('0x4e')]['findAll']({'where':{'id':_0x6d9a39},'attributes':['id'],'include':[{'model':db[_0x18d3('0x4f')],'as':_0x18d3('0x50'),'attributes':['id','name',_0x18d3('0x51'),'voicePause','interface'],'raw':!![]}]})[_0x18d3('0x13')](function(_0x1069c8){if(_0x1069c8){var _0x31e4ea=_[_0x18d3('0x52')](_0x1069c8,function(_0xd5606e){var _0x45ddc0=_0xd5606e['get']({'plain':!![]});return _0x45ddc0[_0x18d3('0x50')];});return db[_0x18d3('0x1c')]['find']({'where':{'id':_0x1df22a[_0x18d3('0x28')]['id']}})[_0x18d3('0x13')](function(_0x400a2c){return db[_0x18d3('0x53')][_0x18d3('0x54')](function(_0x25a23a){return _0x400a2c[_0x18d3('0x4c')](_0x6d9a39,{'transaction':_0x25a23a})[_0x18d3('0x13')](function(){return BPromise['each'](_0x31e4ea,function(_0x1e81d5){return db['UserMailQueue'][_0x18d3('0x55')]({'where':{'UserId':_0x1e81d5['id'],'MailQueueId':_0x1df22a['params']['id']},'transaction':_0x25a23a});});})[_0x18d3('0x13')](function(){_0x31e4ea['forEach'](function(_0xaafea2){socket[_0x18d3('0x56')](_0x18d3('0x57'),{'UserId':_0xaafea2['id'],'MailQueueId':_0x400a2c['id']});});});});});}})[_0x18d3('0x13')](respondWithStatusCode(_0x5eee45,null))[_0x18d3('0x26')](handleError(_0x5eee45,null));};exports['removeTeams']=function(_0x2dc086,_0x30241d){return db[_0x18d3('0x4e')][_0x18d3('0x24')]({'where':{'id':_0x2dc086[_0x18d3('0x2b')][_0x18d3('0x4d')]},'attributes':['id'],'include':[{'model':db[_0x18d3('0x4f')],'as':_0x18d3('0x50'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x30241d,null))[_0x18d3('0x13')](function(_0x10e2a9){var _0x241f7b=_[_0x18d3('0x42')](_0x10e2a9,'id');var _0x1970bc=[];var _0x263d71=[];var _0x29af63=squel['select']();_0x29af63[_0x18d3('0x58')](_0x18d3('0x59'))[_0x18d3('0x5a')](_0x18d3('0x5b'),'tq')[_0x18d3('0x5c')](_0x18d3('0x5d'),'ut',_0x18d3('0x5e'))[_0x18d3('0x22')](_0x18d3('0x5f'),_0x2dc086[_0x18d3('0x28')]['id']);for(var _0x4d9ebe=0x0;_0x4d9ebe<_0x10e2a9[_0x18d3('0x30')];_0x4d9ebe+=0x1){let _0x2a4833=_0x10e2a9[_0x4d9ebe];for(var _0x867db4=0x0;_0x867db4<_0x2a4833[_0x18d3('0x50')]['length'];_0x867db4+=0x1){let _0x1f0c43=_0x2a4833[_0x18d3('0x50')][_0x867db4];var _0xa7cf3c=_0x29af63[_0x18d3('0x60')]();_0xa7cf3c[_0x18d3('0x22')](_0x18d3('0x61'),_0x1f0c43['id']);_0x263d71[_0x18d3('0x62')](db[_0x18d3('0x53')]['query'](_0xa7cf3c[_0x18d3('0x63')](),{'type':db[_0x18d3('0x53')][_0x18d3('0x64')]['SELECT']})[_0x18d3('0x13')](function(_0x4ceff2){if(_0x4ceff2['length']===0x1){return _0x1f0c43['id'];}else{var _0x27228e=_[_0x18d3('0x65')](_['map'](_0x4ceff2,'TeamId'),function(_0x49ccb2){return _[_0x18d3('0x66')](_0x241f7b,_0x49ccb2);});if(_0x27228e){return _0x1f0c43['id'];}}}));}}return BPromise[_0x18d3('0x67')](_0x263d71)[_0x18d3('0x13')](function(_0x4e2ee3){_0x1970bc=_(_0x1970bc)[_0x18d3('0x68')](_0x4e2ee3)['compact']()[_0x18d3('0x69')]();return db[_0x18d3('0x1c')][_0x18d3('0x33')]({'where':{'id':_0x2dc086[_0x18d3('0x28')]['id']}})[_0x18d3('0x13')](function(_0x17745b){return db[_0x18d3('0x53')]['transaction'](function(_0x57a379){return _0x17745b['removeTeams'](_0x2dc086[_0x18d3('0x2b')][_0x18d3('0x4d')],{'transaction':_0x57a379})[_0x18d3('0x13')](function(){if(!_[_0x18d3('0x6a')](_0x1970bc)){return _0x17745b['removeAgents'](_0x1970bc,{'transaction':_0x57a379});}})[_0x18d3('0x13')](function(){_0x1970bc[_0x18d3('0x6b')](function(_0x3f19eb){socket[_0x18d3('0x56')](_0x18d3('0x6c'),{'UserId':_0x3f19eb,'MailQueueId':_0x17745b['id']});});});});});});})[_0x18d3('0x13')](respondWithStatusCode(_0x30241d,null))[_0x18d3('0x26')](handleError(_0x30241d,null));};exports[_0x18d3('0x6d')]=function(_0x418442,_0x2c1024){return db[_0x18d3('0x1c')][_0x18d3('0x33')]({'where':{'id':_0x418442[_0x18d3('0x28')]['id']}})['then'](handleEntityNotFound(_0x2c1024,null))['then'](function(_0x511887){if(_0x511887){return _0x511887[_0x18d3('0x6d')](_0x418442['body'][_0x18d3('0x4d')],_[_0x18d3('0x6e')](_0x418442[_0x18d3('0x35')],[_0x18d3('0x4d'),'id'])||{})[_0x18d3('0x6f')](function(_0x297e6d){for(var _0x59f2cb=0x0;_0x59f2cb<_0x418442[_0x18d3('0x35')][_0x18d3('0x4d')][_0x18d3('0x30')];_0x59f2cb+=0x1){socket[_0x18d3('0x56')](_0x18d3('0x57'),{'UserId':Number(_0x418442[_0x18d3('0x35')][_0x18d3('0x4d')][_0x59f2cb]),'MailQueueId':Number(_0x418442['params']['id'])});}return _0x297e6d;});}})[_0x18d3('0x13')](respondWithResult(_0x2c1024,null))[_0x18d3('0x26')](handleError(_0x2c1024,null));};exports[_0x18d3('0x70')]=function(_0x42a6ad,_0x19e7ce){return db[_0x18d3('0x1c')][_0x18d3('0x33')]({'where':{'id':_0x42a6ad[_0x18d3('0x28')]['id']}})[_0x18d3('0x13')](handleEntityNotFound(_0x19e7ce,null))[_0x18d3('0x13')](function(_0x11650e){if(_0x11650e){return _0x11650e[_0x18d3('0x70')](_0x42a6ad['query'][_0x18d3('0x4d')])[_0x18d3('0x13')](function(){if(_['isArray'](_0x42a6ad[_0x18d3('0x2b')]['ids'])){for(var _0x1923ec=0x0;_0x1923ec<_0x42a6ad[_0x18d3('0x2b')][_0x18d3('0x4d')]['length'];_0x1923ec+=0x1){socket[_0x18d3('0x56')](_0x18d3('0x6c'),{'UserId':Number(_0x42a6ad[_0x18d3('0x2b')][_0x18d3('0x4d')][_0x1923ec]),'MailQueueId':Number(_0x42a6ad[_0x18d3('0x28')]['id'])});}}else{socket['emit'](_0x18d3('0x6c'),{'UserId':Number(_0x42a6ad[_0x18d3('0x2b')][_0x18d3('0x4d')]),'MailQueueId':Number(_0x42a6ad[_0x18d3('0x28')]['id'])});}});}})['then'](respondWithStatusCode(_0x19e7ce,null))[_0x18d3('0x26')](handleError(_0x19e7ce,null));};exports['getAgents']=function(_0x2f65ba,_0x8c74){var _0x42c957={};var _0x2b155c={};var _0x4934a3;var _0x419890;return db[_0x18d3('0x1c')][_0x18d3('0x48')]({'where':{'id':_0x2f65ba['params']['id']}})[_0x18d3('0x13')](handleEntityNotFound(_0x8c74,null))[_0x18d3('0x13')](function(_0x88020){if(_0x88020){_0x4934a3=_0x88020;_0x2b155c[_0x18d3('0x29')]=_['keys'](db[_0x18d3('0x4f')][_0x18d3('0x1d')]);_0x2b155c[_0x18d3('0x2b')]=_[_0x18d3('0x2a')](_0x2f65ba[_0x18d3('0x2b')]);_0x2b155c[_0x18d3('0x2c')]=_[_0x18d3('0x2d')](_0x2b155c['model'],_0x2b155c[_0x18d3('0x2b')]);_0x42c957['attributes']=_['intersection'](_0x2b155c[_0x18d3('0x29')],qs['fields'](_0x2f65ba[_0x18d3('0x2b')][_0x18d3('0x2f')]));_0x42c957[_0x18d3('0x2e')]=_0x42c957[_0x18d3('0x2e')]['length']?_0x42c957[_0x18d3('0x2e')]:_0x2b155c[_0x18d3('0x29')];_0x42c957[_0x18d3('0x49')]=qs[_0x18d3('0x3f')](_0x2f65ba['query']['sort']);_0x42c957[_0x18d3('0x22')]=qs['filters'](_[_0x18d3('0x4a')](_0x2f65ba[_0x18d3('0x2b')],_0x2b155c[_0x18d3('0x2c')]));if(_0x2f65ba[_0x18d3('0x2b')][_0x18d3('0x41')]){_0x42c957[_0x18d3('0x22')]=_[_0x18d3('0x31')](_0x42c957[_0x18d3('0x22')],{'$or':_[_0x18d3('0x42')](_0x42c957[_0x18d3('0x2e')],function(_0x5bca4f){var _0x35bef1={};_0x35bef1[_0x5bca4f]={'$like':'%'+_0x2f65ba[_0x18d3('0x2b')][_0x18d3('0x41')]+'%'};return _0x35bef1;})});}_0x42c957=_['merge']({},_0x42c957,_0x2f65ba[_0x18d3('0x32')]);return _0x4934a3[_0x18d3('0x71')](_0x42c957);}})[_0x18d3('0x13')](function(_0x2e21de){if(_0x2e21de){_0x419890=_0x2e21de['length'];if(!_0x2f65ba[_0x18d3('0x2b')][_0x18d3('0x3e')]('nolimit')){_0x42c957['limit']=qs[_0x18d3('0x10')](_0x2f65ba[_0x18d3('0x2b')][_0x18d3('0x10')]);_0x42c957[_0x18d3('0xe')]=qs['offset'](_0x2f65ba['query'][_0x18d3('0xe')]);}return _0x4934a3[_0x18d3('0x71')](_0x42c957);}})[_0x18d3('0x13')](function(_0x33d105){if(_0x33d105){return _0x33d105?{'count':_0x419890,'rows':_0x33d105}:null;}})[_0x18d3('0x13')](respondWithResult(_0x8c74,null))[_0x18d3('0x26')](handleError(_0x8c74,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index dde4046..a71d3f5 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 _0xf637=['emit','hasOwnProperty','hook','exports','../../mysqldb','MailQueue','setMaxListeners','save','remove'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xf637,0x187));var _0x7f63=function(_0x38e1a4,_0x41fc3a){_0x38e1a4=_0x38e1a4-0x0;var _0x5504ec=_0xf637[_0x38e1a4];return _0x5504ec;};'use strict';var EventEmitter=require('events');var MailQueue=require(_0x7f63('0x0'))['db'][_0x7f63('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x7f63('0x2')](0x0);var events={'afterCreate':_0x7f63('0x3'),'afterUpdate':'update','afterDestroy':_0x7f63('0x4')};function emitEvent(_0x42ef8e){return function(_0x1743c5,_0x2644c7,_0x4b1bc1){MailQueueEvents[_0x7f63('0x5')](_0x42ef8e+':'+_0x1743c5['id'],_0x1743c5);MailQueueEvents[_0x7f63('0x5')](_0x42ef8e,_0x1743c5);_0x4b1bc1(null);};}for(var e in events){if(events[_0x7f63('0x6')](e)){var event=events[e];MailQueue[_0x7f63('0x7')](e,emitEvent(event));}}module[_0x7f63('0x8')]=MailQueueEvents; \ No newline at end of file +var _0xb532=['hasOwnProperty','hook','exports','../../mysqldb','MailQueue','save','update','remove','emit'];(function(_0x374a7e,_0x47afcc){var _0x479891=function(_0x54def9){while(--_0x54def9){_0x374a7e['push'](_0x374a7e['shift']());}};_0x479891(++_0x47afcc);}(_0xb532,0x13e));var _0x2b53=function(_0x5f5164,_0xa128be){_0x5f5164=_0x5f5164-0x0;var _0x3ec41d=_0xb532[_0x5f5164];return _0x3ec41d;};'use strict';var EventEmitter=require('events');var MailQueue=require(_0x2b53('0x0'))['db'][_0x2b53('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x2b53('0x2'),'afterUpdate':_0x2b53('0x3'),'afterDestroy':_0x2b53('0x4')};function emitEvent(_0x5d6e93){return function(_0x5c17b8,_0x47fa10,_0x42b073){MailQueueEvents[_0x2b53('0x5')](_0x5d6e93+':'+_0x5c17b8['id'],_0x5c17b8);MailQueueEvents['emit'](_0x5d6e93,_0x5c17b8);_0x42b073(null);};}for(var e in events){if(events[_0x2b53('0x6')](e)){var event=events[e];MailQueue[_0x2b53('0x7')](e,emitEvent(event));}}module[_0x2b53('0x8')]=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index b0a6fa9..e12f5e3 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 _0xf6c6=['path','../../config/environment','./mailQueue.attributes','exports','define','MailQueue','mail_queues','lodash','../../config/logger','api','bluebird'];(function(_0x4a2718,_0x2b8edb){var _0x41cddf=function(_0x2924d7){while(--_0x2924d7){_0x4a2718['push'](_0x4a2718['shift']());}};_0x41cddf(++_0x2b8edb);}(_0xf6c6,0xd8));var _0x6f6c=function(_0xb24a3e,_0x4a3594){_0xb24a3e=_0xb24a3e-0x0;var _0x4038d7=_0xf6c6[_0xb24a3e];return _0x4038d7;};'use strict';var _=require(_0x6f6c('0x0'));var util=require('util');var logger=require(_0x6f6c('0x1'))(_0x6f6c('0x2'));var moment=require('moment');var BPromise=require(_0x6f6c('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6f6c('0x4'));var rimraf=require('rimraf');var config=require(_0x6f6c('0x5'));var attributes=require(_0x6f6c('0x6'));module[_0x6f6c('0x7')]=function(_0x1be931,_0x570230){return _0x1be931[_0x6f6c('0x8')](_0x6f6c('0x9'),attributes,{'tableName':_0x6f6c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7ed1=['exports','MailQueue','mail_queues','lodash','util','api','moment','bluebird','request-promise','path','rimraf','./mailQueue.attributes'];(function(_0x28492b,_0x1cd247){var _0x1fa7b5=function(_0x57e17c){while(--_0x57e17c){_0x28492b['push'](_0x28492b['shift']());}};_0x1fa7b5(++_0x1cd247);}(_0x7ed1,0x93));var _0x17ed=function(_0x58afd5,_0x534a48){_0x58afd5=_0x58afd5-0x0;var _0x3e503b=_0x7ed1[_0x58afd5];return _0x3e503b;};'use strict';var _=require(_0x17ed('0x0'));var util=require(_0x17ed('0x1'));var logger=require('../../config/logger')(_0x17ed('0x2'));var moment=require(_0x17ed('0x3'));var BPromise=require(_0x17ed('0x4'));var rp=require(_0x17ed('0x5'));var fs=require('fs');var path=require(_0x17ed('0x6'));var rimraf=require(_0x17ed('0x7'));var config=require('../../config/environment');var attributes=require(_0x17ed('0x8'));module[_0x17ed('0x9')]=function(_0x58af9a,_0x54a68d){return _0x58af9a['define'](_0x17ed('0xa'),attributes,{'tableName':_0x17ed('0xb'),'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 3ea594e..785f3bd 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 _0xd4c9=['result','GetMailQueue','findAll','options','raw','where','attributes','limit','include','model','map','then','debug','catch','ShowMailQueue','find','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','request','MailQueue,\x20%s,\x20%s','request\x20sent','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info'];(function(_0x5bbf6a,_0x29460a){var _0x5d051a=function(_0x2c76a7){while(--_0x2c76a7){_0x5bbf6a['push'](_0x5bbf6a['shift']());}};_0x5d051a(++_0x29460a);}(_0xd4c9,0x1bd));var _0x9d4c=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0xd4c9[_0xbb091];return _0x467a04;};'use strict';var _=require(_0x9d4c('0x0'));var util=require(_0x9d4c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x9d4c('0x2'));var fs=require('fs');var Redis=require(_0x9d4c('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x9d4c('0x4'));var logger=require(_0x9d4c('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x9d4c('0x6'));var client=jayson[_0x9d4c('0x7')]['http']({'port':0x232a});config[_0x9d4c('0x8')]=_[_0x9d4c('0x9')](config[_0x9d4c('0x8')],{'host':_0x9d4c('0xa'),'port':0x18eb});var socket=require(_0x9d4c('0xb'))(new Redis(config[_0x9d4c('0x8')]));require(_0x9d4c('0xc'))[_0x9d4c('0xd')](socket);function respondWithRpcPromise(_0x59cd41,_0x16a890,_0x19b159){return new BPromise(function(_0x4f2da4,_0xf211e4){return client[_0x9d4c('0xe')](_0x59cd41,_0x19b159)['then'](function(_0x591920){logger['info'](_0x9d4c('0xf'),_0x16a890,_0x9d4c('0x10'));logger['debug'](_0x9d4c('0x11'),_0x16a890,_0x9d4c('0x10'),JSON[_0x9d4c('0x12')](_0x591920));if(_0x591920[_0x9d4c('0x13')]){if(_0x591920['error'][_0x9d4c('0x14')]===0x1f4){logger[_0x9d4c('0x13')](_0x9d4c('0xf'),_0x16a890,_0x591920['error'][_0x9d4c('0x15')]);return _0xf211e4(_0x591920[_0x9d4c('0x13')][_0x9d4c('0x15')]);}logger[_0x9d4c('0x13')](_0x9d4c('0xf'),_0x16a890,_0x591920[_0x9d4c('0x13')]['message']);return _0x4f2da4(_0x591920[_0x9d4c('0x13')][_0x9d4c('0x15')]);}else{logger[_0x9d4c('0x16')](_0x9d4c('0xf'),_0x16a890,_0x9d4c('0x10'));_0x4f2da4(_0x591920[_0x9d4c('0x17')][_0x9d4c('0x15')]);}})['catch'](function(_0x7abb02){logger[_0x9d4c('0x13')](_0x9d4c('0xf'),_0x16a890,_0x7abb02);_0xf211e4(_0x7abb02);});});}exports[_0x9d4c('0x18')]=function(_0x32dac7){var _0x468b16=this;return new Promise(function(_0x248339,_0x4bbbf0){return db['MailQueue'][_0x9d4c('0x19')]({'raw':_0x32dac7[_0x9d4c('0x1a')]?_0x32dac7[_0x9d4c('0x1a')][_0x9d4c('0x1b')]===undefined?!![]:![]:!![],'where':_0x32dac7[_0x9d4c('0x1a')]?_0x32dac7['options'][_0x9d4c('0x1c')]||null:null,'attributes':_0x32dac7[_0x9d4c('0x1a')]?_0x32dac7['options'][_0x9d4c('0x1d')]||null:null,'limit':_0x32dac7[_0x9d4c('0x1a')]?_0x32dac7[_0x9d4c('0x1a')][_0x9d4c('0x1e')]||null:null,'include':_0x32dac7['options']?_0x32dac7['options'][_0x9d4c('0x1f')]?_['map'](_0x32dac7[_0x9d4c('0x1a')][_0x9d4c('0x1f')],function(_0x173c83){return{'model':db[_0x173c83[_0x9d4c('0x20')]],'as':_0x173c83['as'],'attributes':_0x173c83[_0x9d4c('0x1d')],'include':_0x173c83[_0x9d4c('0x1f')]?_[_0x9d4c('0x21')](_0x173c83['include'],function(_0x3c0ea4){return{'model':db[_0x3c0ea4[_0x9d4c('0x20')]],'as':_0x3c0ea4['as'],'attributes':_0x3c0ea4[_0x9d4c('0x1d')],'include':_0x3c0ea4['include']?_[_0x9d4c('0x21')](_0x3c0ea4['include'],function(_0x5f26a1){return{'model':db[_0x5f26a1[_0x9d4c('0x20')]],'as':_0x5f26a1['as'],'attributes':_0x5f26a1[_0x9d4c('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x9d4c('0x22')](function(_0x202e48){logger['info']('GetMailQueue',_0x32dac7);logger[_0x9d4c('0x23')]('GetMailQueue',_0x32dac7,JSON['stringify'](_0x202e48));_0x248339(_0x202e48);})[_0x9d4c('0x24')](function(_0x2a3bc3){logger['error'](_0x9d4c('0x18'),_0x2a3bc3[_0x9d4c('0x15')],_0x32dac7);_0x4bbbf0(_0x468b16[_0x9d4c('0x13')](0x1f4,_0x2a3bc3[_0x9d4c('0x15')]));});});};exports[_0x9d4c('0x25')]=function(_0x2c930d){var _0x171637=this;return new Promise(function(_0x12ccb7,_0x5972a4){return db['MailQueue'][_0x9d4c('0x26')]({'raw':_0x2c930d[_0x9d4c('0x1a')]?_0x2c930d[_0x9d4c('0x1a')][_0x9d4c('0x1b')]===undefined?!![]:![]:!![],'where':_0x2c930d['options']?_0x2c930d[_0x9d4c('0x1a')][_0x9d4c('0x1c')]||null:null,'attributes':_0x2c930d[_0x9d4c('0x1a')]?_0x2c930d[_0x9d4c('0x1a')][_0x9d4c('0x1d')]||null:null,'include':_0x2c930d['options']?_0x2c930d[_0x9d4c('0x1a')]['include']?_[_0x9d4c('0x21')](_0x2c930d[_0x9d4c('0x1a')]['include'],function(_0x268b15){return{'model':db[_0x268b15[_0x9d4c('0x20')]],'as':_0x268b15['as'],'attributes':_0x268b15[_0x9d4c('0x1d')],'include':_0x268b15[_0x9d4c('0x1f')]?_['map'](_0x268b15[_0x9d4c('0x1f')],function(_0x17738b){return{'model':db[_0x17738b['model']],'as':_0x17738b['as'],'attributes':_0x17738b['attributes'],'include':_0x17738b[_0x9d4c('0x1f')]?_[_0x9d4c('0x21')](_0x17738b[_0x9d4c('0x1f')],function(_0x3fce81){return{'model':db[_0x3fce81[_0x9d4c('0x20')]],'as':_0x3fce81['as'],'attributes':_0x3fce81[_0x9d4c('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x9d4c('0x22')](function(_0x2ea799){logger['info']('ShowMailQueue',_0x2c930d);logger['debug'](_0x9d4c('0x25'),_0x2c930d,JSON[_0x9d4c('0x12')](_0x2ea799));_0x12ccb7(_0x2ea799);})[_0x9d4c('0x24')](function(_0x2e2984){logger['error'](_0x9d4c('0x25'),_0x2e2984[_0x9d4c('0x15')],_0x2c930d);_0x5972a4(_0x171637[_0x9d4c('0x13')](0x1f4,_0x2e2984[_0x9d4c('0x15')]));});});}; \ No newline at end of file +var _0x6675=['result','GetMailQueue','MailQueue','options','where','attributes','limit','include','model','map','stringify','catch','find','raw','ShowMailQueue','lodash','moment','bluebird','../../mysqldb','../../config/logger','rpc','client','http','redis','localhost','socket.io-emitter','./mailQueue.socket','request','then','info','MailQueue,\x20%s,\x20%s','debug','MailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message'];(function(_0x410fda,_0x3a5a6f){var _0x3bfb38=function(_0x187d11){while(--_0x187d11){_0x410fda['push'](_0x410fda['shift']());}};_0x3bfb38(++_0x3a5a6f);}(_0x6675,0x15c));var _0x5667=function(_0x4f5ee8,_0x1d8506){_0x4f5ee8=_0x4f5ee8-0x0;var _0x41285f=_0x6675[_0x4f5ee8];return _0x41285f;};'use strict';var _=require(_0x5667('0x0'));var util=require('util');var moment=require(_0x5667('0x1'));var BPromise=require(_0x5667('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5667('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x5667('0x4'))(_0x5667('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x5667('0x6')][_0x5667('0x7')]({'port':0x232a});config[_0x5667('0x8')]=_['defaults'](config[_0x5667('0x8')],{'host':_0x5667('0x9'),'port':0x18eb});var socket=require(_0x5667('0xa'))(new Redis(config['redis']));require(_0x5667('0xb'))['register'](socket);function respondWithRpcPromise(_0x239ea9,_0x3aa78a,_0x424914){return new BPromise(function(_0x568c79,_0x545acc){return client[_0x5667('0xc')](_0x239ea9,_0x424914)[_0x5667('0xd')](function(_0x334e85){logger[_0x5667('0xe')](_0x5667('0xf'),_0x3aa78a,'request\x20sent');logger[_0x5667('0x10')](_0x5667('0x11'),_0x3aa78a,_0x5667('0x12'),JSON['stringify'](_0x334e85));if(_0x334e85[_0x5667('0x13')]){if(_0x334e85[_0x5667('0x13')][_0x5667('0x14')]===0x1f4){logger['error'](_0x5667('0xf'),_0x3aa78a,_0x334e85[_0x5667('0x13')][_0x5667('0x15')]);return _0x545acc(_0x334e85[_0x5667('0x13')][_0x5667('0x15')]);}logger['error'](_0x5667('0xf'),_0x3aa78a,_0x334e85[_0x5667('0x13')][_0x5667('0x15')]);return _0x568c79(_0x334e85['error'][_0x5667('0x15')]);}else{logger[_0x5667('0xe')]('MailQueue,\x20%s,\x20%s',_0x3aa78a,_0x5667('0x12'));_0x568c79(_0x334e85[_0x5667('0x16')][_0x5667('0x15')]);}})['catch'](function(_0x4e81be){logger['error'](_0x5667('0xf'),_0x3aa78a,_0x4e81be);_0x545acc(_0x4e81be);});});}exports[_0x5667('0x17')]=function(_0x66fc77){var _0x2a4ee0=this;return new Promise(function(_0x2998fc,_0xfef39a){return db[_0x5667('0x18')]['findAll']({'raw':_0x66fc77[_0x5667('0x19')]?_0x66fc77[_0x5667('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x66fc77[_0x5667('0x19')]?_0x66fc77[_0x5667('0x19')][_0x5667('0x1a')]||null:null,'attributes':_0x66fc77[_0x5667('0x19')]?_0x66fc77[_0x5667('0x19')][_0x5667('0x1b')]||null:null,'limit':_0x66fc77[_0x5667('0x19')]?_0x66fc77[_0x5667('0x19')][_0x5667('0x1c')]||null:null,'include':_0x66fc77['options']?_0x66fc77[_0x5667('0x19')][_0x5667('0x1d')]?_['map'](_0x66fc77[_0x5667('0x19')][_0x5667('0x1d')],function(_0x505c1b){return{'model':db[_0x505c1b[_0x5667('0x1e')]],'as':_0x505c1b['as'],'attributes':_0x505c1b[_0x5667('0x1b')],'include':_0x505c1b['include']?_['map'](_0x505c1b[_0x5667('0x1d')],function(_0x376e26){return{'model':db[_0x376e26['model']],'as':_0x376e26['as'],'attributes':_0x376e26[_0x5667('0x1b')],'include':_0x376e26['include']?_[_0x5667('0x1f')](_0x376e26[_0x5667('0x1d')],function(_0x45a454){return{'model':db[_0x45a454[_0x5667('0x1e')]],'as':_0x45a454['as'],'attributes':_0x45a454[_0x5667('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x5667('0xd')](function(_0xfa811c){logger[_0x5667('0xe')]('GetMailQueue',_0x66fc77);logger[_0x5667('0x10')](_0x5667('0x17'),_0x66fc77,JSON[_0x5667('0x20')](_0xfa811c));_0x2998fc(_0xfa811c);})[_0x5667('0x21')](function(_0x547054){logger[_0x5667('0x13')](_0x5667('0x17'),_0x547054[_0x5667('0x15')],_0x66fc77);_0xfef39a(_0x2a4ee0[_0x5667('0x13')](0x1f4,_0x547054[_0x5667('0x15')]));});});};exports['ShowMailQueue']=function(_0x19edf8){var _0x137b9c=this;return new Promise(function(_0x59658c,_0x357b89){return db['MailQueue'][_0x5667('0x22')]({'raw':_0x19edf8[_0x5667('0x19')]?_0x19edf8[_0x5667('0x19')][_0x5667('0x23')]===undefined?!![]:![]:!![],'where':_0x19edf8[_0x5667('0x19')]?_0x19edf8[_0x5667('0x19')][_0x5667('0x1a')]||null:null,'attributes':_0x19edf8[_0x5667('0x19')]?_0x19edf8[_0x5667('0x19')]['attributes']||null:null,'include':_0x19edf8['options']?_0x19edf8[_0x5667('0x19')][_0x5667('0x1d')]?_[_0x5667('0x1f')](_0x19edf8[_0x5667('0x19')][_0x5667('0x1d')],function(_0x474e17){return{'model':db[_0x474e17[_0x5667('0x1e')]],'as':_0x474e17['as'],'attributes':_0x474e17[_0x5667('0x1b')],'include':_0x474e17[_0x5667('0x1d')]?_[_0x5667('0x1f')](_0x474e17['include'],function(_0x4e7ea1){return{'model':db[_0x4e7ea1[_0x5667('0x1e')]],'as':_0x4e7ea1['as'],'attributes':_0x4e7ea1[_0x5667('0x1b')],'include':_0x4e7ea1[_0x5667('0x1d')]?_[_0x5667('0x1f')](_0x4e7ea1[_0x5667('0x1d')],function(_0x100f14){return{'model':db[_0x100f14['model']],'as':_0x100f14['as'],'attributes':_0x100f14[_0x5667('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x5667('0xd')](function(_0x4f7db9){logger[_0x5667('0xe')](_0x5667('0x24'),_0x19edf8);logger['debug']('ShowMailQueue',_0x19edf8,JSON[_0x5667('0x20')](_0x4f7db9));_0x59658c(_0x4f7db9);})[_0x5667('0x21')](function(_0x1fd8cd){logger[_0x5667('0x13')](_0x5667('0x24'),_0x1fd8cd[_0x5667('0x15')],_0x19edf8);_0x357b89(_0x137b9c[_0x5667('0x13')](0x1f4,_0x1fd8cd[_0x5667('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index eac0190..ae47ec3 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 _0x537a=['length','save','remove','update','emit','removeListener','register'];(function(_0x70373b,_0x1acf73){var _0x2a9ca7=function(_0x13d67e){while(--_0x13d67e){_0x70373b['push'](_0x70373b['shift']());}};_0x2a9ca7(++_0x1acf73);}(_0x537a,0x1ac));var _0xa537=function(_0x2b6644,_0x24706e){_0x2b6644=_0x2b6644-0x0;var _0x2f9e8b=_0x537a[_0x2b6644];return _0x2f9e8b;};'use strict';var MailQueueEvents=require('./mailQueue.events');var events=[_0xa537('0x0'),_0xa537('0x1'),_0xa537('0x2')];function createListener(_0x42e462,_0xd5939f){return function(_0xf5edda){_0xd5939f[_0xa537('0x3')](_0x42e462,_0xf5edda);};}function removeListener(_0x2d83c4,_0x88b9ba){return function(){MailQueueEvents[_0xa537('0x4')](_0x2d83c4,_0x88b9ba);};}exports[_0xa537('0x5')]=function(_0x5e7487){for(var _0x1f8c26=0x0,_0x4ba363=events[_0xa537('0x6')];_0x1f8c26<_0x4ba363;_0x1f8c26++){var _0x12fd7f=events[_0x1f8c26];var _0x542260=createListener('mailQueue:'+_0x12fd7f,_0x5e7487);MailQueueEvents['on'](_0x12fd7f,_0x542260);}}; \ No newline at end of file +var _0x4a56=['register','length','./mailQueue.events','save','update','removeListener'];(function(_0x4f01d9,_0x5976c2){var _0x230dc7=function(_0x199a63){while(--_0x199a63){_0x4f01d9['push'](_0x4f01d9['shift']());}};_0x230dc7(++_0x5976c2);}(_0x4a56,0x17c));var _0x64a5=function(_0x104f49,_0x1568ab){_0x104f49=_0x104f49-0x0;var _0x2d8b84=_0x4a56[_0x104f49];return _0x2d8b84;};'use strict';var MailQueueEvents=require(_0x64a5('0x0'));var events=[_0x64a5('0x1'),'remove',_0x64a5('0x2')];function createListener(_0x4d37b,_0x4254db){return function(_0x3d98f5){_0x4254db['emit'](_0x4d37b,_0x3d98f5);};}function removeListener(_0x3b478a,_0x3930c2){return function(){MailQueueEvents[_0x64a5('0x3')](_0x3b478a,_0x3930c2);};}exports[_0x64a5('0x4')]=function(_0x4d7361){for(var _0x17317b=0x0,_0x512273=events[_0x64a5('0x5')];_0x17317b<_0x512273;_0x17317b++){var _0x356e4a=events[_0x17317b];var _0x360b72=createListener('mailQueue:'+_0x356e4a,_0x4d7361);MailQueueEvents['on'](_0x356e4a,_0x360b72);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index 729e989..a15d0f2 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 _0x3466=['/describe','isAuthenticated','describe','get','show','create','put','/:id','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailQueueReport.controller'];(function(_0x3da3aa,_0xfbfa1f){var _0x1950ee=function(_0x302360){while(--_0x302360){_0x3da3aa['push'](_0x3da3aa['shift']());}};_0x1950ee(++_0xfbfa1f);}(_0x3466,0x11d));var _0x6346=function(_0x5b9cd1,_0x5338f2){_0x5b9cd1=_0x5b9cd1-0x0;var _0x108a3e=_0x3466[_0x5b9cd1];return _0x108a3e;};'use strict';var multer=require(_0x6346('0x0'));var util=require('util');var path=require(_0x6346('0x1'));var timeout=require(_0x6346('0x2'));var express=require(_0x6346('0x3'));var router=express[_0x6346('0x4')]();var fs_extra=require(_0x6346('0x5'));var auth=require(_0x6346('0x6'));var interaction=require(_0x6346('0x7'));var config=require('../../config/environment');var controller=require(_0x6346('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x6346('0x9'),auth[_0x6346('0xa')](),controller[_0x6346('0xb')]);router[_0x6346('0xc')]('/:id',auth['isAuthenticated'](),controller[_0x6346('0xd')]);router['post']('/',auth[_0x6346('0xa')](),controller[_0x6346('0xe')]);router[_0x6346('0xf')](_0x6346('0x10'),auth['isAuthenticated'](),controller[_0x6346('0x11')]);router[_0x6346('0x12')](_0x6346('0x10'),auth[_0x6346('0xa')](),controller[_0x6346('0x13')]);module[_0x6346('0x14')]=router; \ No newline at end of file +var _0x6827=['util','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./mailQueueReport.controller','get','/describe','isAuthenticated','describe','/:id','create','put','delete','destroy','multer'];(function(_0x1fd441,_0x2629bf){var _0x411a91=function(_0x5d14e3){while(--_0x5d14e3){_0x1fd441['push'](_0x1fd441['shift']());}};_0x411a91(++_0x2629bf);}(_0x6827,0x153));var _0x7682=function(_0x298ce4,_0x4a49a7){_0x298ce4=_0x298ce4-0x0;var _0x5d236f=_0x6827[_0x298ce4];return _0x5d236f;};'use strict';var multer=require(_0x7682('0x0'));var util=require(_0x7682('0x1'));var path=require('path');var timeout=require(_0x7682('0x2'));var express=require('express');var router=express[_0x7682('0x3')]();var fs_extra=require(_0x7682('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x7682('0x5'));var config=require(_0x7682('0x6'));var controller=require(_0x7682('0x7'));router[_0x7682('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x7682('0x8')](_0x7682('0x9'),auth[_0x7682('0xa')](),controller[_0x7682('0xb')]);router[_0x7682('0x8')](_0x7682('0xc'),auth[_0x7682('0xa')](),controller['show']);router['post']('/',auth[_0x7682('0xa')](),controller[_0x7682('0xd')]);router[_0x7682('0xe')](_0x7682('0xc'),auth[_0x7682('0xa')](),controller['update']);router[_0x7682('0xf')]('/:id',auth[_0x7682('0xa')](),controller[_0x7682('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index c7f7344..261b322 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 _0x8802=['STRING','DATE','moment','exports'];(function(_0x56c3ef,_0x3a7a3e){var _0x1bb5cb=function(_0x341013){while(--_0x341013){_0x56c3ef['push'](_0x56c3ef['shift']());}};_0x1bb5cb(++_0x3a7a3e);}(_0x8802,0x7e));var _0x2880=function(_0x59b533,_0x59fdcc){_0x59b533=_0x59b533-0x0;var _0x2beced=_0x8802[_0x59b533];return _0x2beced;};'use strict';var moment=require(_0x2880('0x0'));var Sequelize=require('sequelize');module[_0x2880('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x2880('0x2')]},'joinAt':{'type':Sequelize[_0x2880('0x3')]},'leaveAt':{'type':Sequelize[_0x2880('0x3')]},'acceptAt':{'type':Sequelize[_0x2880('0x3')]},'exitAt':{'type':Sequelize[_0x2880('0x3')]},'reason':{'type':Sequelize[_0x2880('0x2')]}}; \ No newline at end of file +var _0xf4bd=['exports','STRING','DATE','sequelize'];(function(_0xaae678,_0x501815){var _0x43c439=function(_0x4d5a62){while(--_0x4d5a62){_0xaae678['push'](_0xaae678['shift']());}};_0x43c439(++_0x501815);}(_0xf4bd,0xe7));var _0xdf4b=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0xf4bd[_0x21aec3];return _0x288bbc;};'use strict';var moment=require('moment');var Sequelize=require(_0xdf4b('0x0'));module[_0xdf4b('0x1')]={'uniqueid':{'type':Sequelize[_0xdf4b('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xdf4b('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xdf4b('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index da8019e..3b2c6dc 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 _0x524e=['end','json','offset','limit','count','set','apply','reject','save','update','destroy','name','send','index','map','rawAttributes','key','model','keys','filters','intersection','attributes','fields','query','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','MailQueueReport','then','includeAll','include','findAll','rows','catch','show','length','find','create','body','params','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x5613ae,_0x405aea){var _0x41dd51=function(_0x3a096e){while(--_0x3a096e){_0x5613ae['push'](_0x5613ae['shift']());}};_0x41dd51(++_0x405aea);}(_0x524e,0x15e));var _0xe524=function(_0x11ea94,_0x547cc0){_0x11ea94=_0x11ea94-0x0;var _0x195915=_0x524e[_0x11ea94];return _0x195915;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe524('0x0'));var jsonpatch=require(_0xe524('0x1'));var rp=require(_0xe524('0x2'));var moment=require(_0xe524('0x3'));var BPromise=require(_0xe524('0x4'));var Mustache=require(_0xe524('0x5'));var util=require(_0xe524('0x6'));var path=require(_0xe524('0x7'));var sox=require(_0xe524('0x8'));var csv=require(_0xe524('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe524('0xa'));var _=require(_0xe524('0xb'));var squel=require(_0xe524('0xc'));var crypto=require('crypto');var jsforce=require(_0xe524('0xd'));var deskjs=require(_0xe524('0xe'));var toCsv=require(_0xe524('0x9'));var querystring=require(_0xe524('0xf'));var Papa=require(_0xe524('0x10'));var Redis=require(_0xe524('0x11'));var authService=require(_0xe524('0x12'));var qs=require(_0xe524('0x13'));var as=require(_0xe524('0x14'));var hardwareService=require(_0xe524('0x15'));var logger=require(_0xe524('0x16'))(_0xe524('0x17'));var utils=require(_0xe524('0x18'));var config=require(_0xe524('0x19'));var licenseUtil=require(_0xe524('0x1a'));var db=require(_0xe524('0x1b'))['db'];function respondWithStatusCode(_0x5077c1,_0x4b0f51){_0x4b0f51=_0x4b0f51||0xcc;return function(_0xfdc2a5){if(_0xfdc2a5){return _0x5077c1[_0xe524('0x1c')](_0x4b0f51);}return _0x5077c1[_0xe524('0x1d')](_0x4b0f51)[_0xe524('0x1e')]();};}function respondWithResult(_0x20a852,_0x57c1b6){_0x57c1b6=_0x57c1b6||0xc8;return function(_0x12ff75){if(_0x12ff75){return _0x20a852['status'](_0x57c1b6)[_0xe524('0x1f')](_0x12ff75);}};}function respondWithFilteredResult(_0x1b0af6,_0x48165e){return function(_0x569660){if(_0x569660){var _0x488fce=typeof _0x48165e[_0xe524('0x20')]==='undefined'&&typeof _0x48165e[_0xe524('0x21')]==='undefined';var _0x5c8736=_0x569660['count'];var _0x3a4027=_0x488fce?0x0:_0x48165e['offset'];var _0x11b2a1=_0x488fce?_0x569660[_0xe524('0x22')]:_0x48165e[_0xe524('0x20')]+_0x48165e[_0xe524('0x21')];var _0x5d7b17;if(_0x11b2a1>=_0x5c8736){_0x11b2a1=_0x5c8736;_0x5d7b17=0xc8;}else{_0x5d7b17=0xce;}_0x1b0af6[_0xe524('0x1d')](_0x5d7b17);return _0x1b0af6[_0xe524('0x23')]('Content-Range',_0x3a4027+'-'+_0x11b2a1+'/'+_0x5c8736)[_0xe524('0x1f')](_0x569660);}return null;};}function patchUpdates(_0x309f85){return function(_0x43a4f9){try{jsonpatch[_0xe524('0x24')](_0x43a4f9,_0x309f85,!![]);}catch(_0x1c4194){return BPromise[_0xe524('0x25')](_0x1c4194);}return _0x43a4f9[_0xe524('0x26')]();};}function saveUpdates(_0x375219,_0x7dfe97){return function(_0x5c4d21){if(_0x5c4d21){return _0x5c4d21[_0xe524('0x27')](_0x375219)['then'](function(_0x577d1f){return _0x577d1f;});}return null;};}function removeEntity(_0x2d2f83,_0x23df5e){return function(_0x1ad106){if(_0x1ad106){return _0x1ad106[_0xe524('0x28')]()['then'](function(){_0x2d2f83[_0xe524('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x17e245,_0xcf5db){return function(_0xd62772){if(!_0xd62772){_0x17e245[_0xe524('0x1c')](0x194);}return _0xd62772;};}function handleError(_0x4102d9,_0xfd5965){_0xfd5965=_0xfd5965||0x1f4;return function(_0x2141db){logger['error'](_0x2141db['stack']);if(_0x2141db[_0xe524('0x29')]){delete _0x2141db[_0xe524('0x29')];}_0x4102d9[_0xe524('0x1d')](_0xfd5965)[_0xe524('0x2a')](_0x2141db);};}exports[_0xe524('0x2b')]=function(_0x5405e4,_0x52f140){var _0x4b1ff={},_0x25e7a7={},_0x3aedd9={'count':0x0,'rows':[]};var _0x8070e4=_[_0xe524('0x2c')](db['MailQueueReport'][_0xe524('0x2d')],function(_0x9a7e98){return{'name':_0x9a7e98['fieldName'],'type':_0x9a7e98['type'][_0xe524('0x2e')]};});_0x25e7a7[_0xe524('0x2f')]=_['map'](_0x8070e4,_0xe524('0x29'));_0x25e7a7['query']=_[_0xe524('0x30')](_0x5405e4['query']);_0x25e7a7[_0xe524('0x31')]=_[_0xe524('0x32')](_0x25e7a7[_0xe524('0x2f')],_0x25e7a7['query']);_0x4b1ff[_0xe524('0x33')]=_['intersection'](_0x25e7a7[_0xe524('0x2f')],qs[_0xe524('0x34')](_0x5405e4[_0xe524('0x35')]['fields']));_0x4b1ff[_0xe524('0x33')]=_0x4b1ff[_0xe524('0x33')]['length']?_0x4b1ff[_0xe524('0x33')]:_0x25e7a7[_0xe524('0x2f')];if(!_0x5405e4[_0xe524('0x35')][_0xe524('0x36')]('nolimit')){_0x4b1ff[_0xe524('0x21')]=qs[_0xe524('0x21')](_0x5405e4[_0xe524('0x35')][_0xe524('0x21')]);_0x4b1ff[_0xe524('0x20')]=qs[_0xe524('0x20')](_0x5405e4[_0xe524('0x35')][_0xe524('0x20')]);}_0x4b1ff['order']=qs[_0xe524('0x37')](_0x5405e4['query'][_0xe524('0x37')]);_0x4b1ff[_0xe524('0x38')]=qs['filters'](_[_0xe524('0x39')](_0x5405e4['query'],_0x25e7a7[_0xe524('0x31')]),_0x8070e4);if(_0x5405e4[_0xe524('0x35')][_0xe524('0x3a')]){_0x4b1ff[_0xe524('0x38')]=_[_0xe524('0x3b')](_0x4b1ff[_0xe524('0x38')],{'$or':_[_0xe524('0x2c')](_0x8070e4,function(_0x13762c){if(_0x13762c['type']!==_0xe524('0x3c')){var _0x940c05={};_0x940c05[_0x13762c[_0xe524('0x29')]]={'$like':'%'+_0x5405e4[_0xe524('0x35')][_0xe524('0x3a')]+'%'};return _0x940c05;}})});}_0x4b1ff=_[_0xe524('0x3b')]({},_0x4b1ff,_0x5405e4[_0xe524('0x3d')]);var _0x158d45={'where':_0x4b1ff['where']};return db[_0xe524('0x3e')][_0xe524('0x22')](_0x158d45)[_0xe524('0x3f')](function(_0x59781b){_0x3aedd9[_0xe524('0x22')]=_0x59781b;if(_0x5405e4['query'][_0xe524('0x40')]){_0x4b1ff[_0xe524('0x41')]=[{'all':!![]}];}return db[_0xe524('0x3e')][_0xe524('0x42')](_0x4b1ff);})[_0xe524('0x3f')](function(_0x4746cd){_0x3aedd9[_0xe524('0x43')]=_0x4746cd;return _0x3aedd9;})['then'](respondWithFilteredResult(_0x52f140,_0x4b1ff))[_0xe524('0x44')](handleError(_0x52f140,null));};exports[_0xe524('0x45')]=function(_0x13c54c,_0x376505){var _0x438962={'raw':!![],'where':{'id':_0x13c54c['params']['id']}},_0x1ae283={};_0x1ae283[_0xe524('0x2f')]=_[_0xe524('0x30')](db[_0xe524('0x3e')]['rawAttributes']);_0x1ae283[_0xe524('0x35')]=_['keys'](_0x13c54c['query']);_0x1ae283[_0xe524('0x31')]=_[_0xe524('0x32')](_0x1ae283['model'],_0x1ae283[_0xe524('0x35')]);_0x438962[_0xe524('0x33')]=_[_0xe524('0x32')](_0x1ae283[_0xe524('0x2f')],qs['fields'](_0x13c54c['query'][_0xe524('0x34')]));_0x438962[_0xe524('0x33')]=_0x438962['attributes'][_0xe524('0x46')]?_0x438962['attributes']:_0x1ae283[_0xe524('0x2f')];if(_0x13c54c[_0xe524('0x35')][_0xe524('0x40')]){_0x438962[_0xe524('0x41')]=[{'all':!![]}];}_0x438962=_[_0xe524('0x3b')]({},_0x438962,_0x13c54c[_0xe524('0x3d')]);return db[_0xe524('0x3e')][_0xe524('0x47')](_0x438962)[_0xe524('0x3f')](handleEntityNotFound(_0x376505,null))[_0xe524('0x3f')](respondWithResult(_0x376505,null))[_0xe524('0x44')](handleError(_0x376505,null));};exports[_0xe524('0x48')]=function(_0x3d7ab7,_0x33b1c8){return db[_0xe524('0x3e')]['create'](_0x3d7ab7[_0xe524('0x49')],{})['then'](respondWithResult(_0x33b1c8,0xc9))['catch'](handleError(_0x33b1c8,null));};exports[_0xe524('0x27')]=function(_0x59fe6b,_0x232cf0){if(_0x59fe6b[_0xe524('0x49')]['id']){delete _0x59fe6b['body']['id'];}return db[_0xe524('0x3e')]['find']({'where':{'id':_0x59fe6b['params']['id']}})[_0xe524('0x3f')](handleEntityNotFound(_0x232cf0,null))[_0xe524('0x3f')](saveUpdates(_0x59fe6b[_0xe524('0x49')],null))['then'](respondWithResult(_0x232cf0,null))['catch'](handleError(_0x232cf0,null));};exports['destroy']=function(_0x4e9c3b,_0x4f7a64){return db['MailQueueReport'][_0xe524('0x47')]({'where':{'id':_0x4e9c3b[_0xe524('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4f7a64,null))[_0xe524('0x3f')](removeEntity(_0x4f7a64,null))[_0xe524('0x44')](handleError(_0x4f7a64,null));};exports[_0xe524('0x4b')]=function(_0x208aa8,_0x2fa143){return db['MailQueueReport'][_0xe524('0x4b')]()[_0xe524('0x3f')](respondWithResult(_0x2fa143,null))[_0xe524('0x44')](handleError(_0x2fa143,null));}; \ No newline at end of file +var _0x0120=['name','send','index','map','MailQueueReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','limit','undefined','count','offset','set','Content-Range','json','reject','save','update','then','destroy','end','sendStatus','error','stack'];(function(_0x479aae,_0x20c464){var _0x53840d=function(_0x48aaf4){while(--_0x48aaf4){_0x479aae['push'](_0x479aae['shift']());}};_0x53840d(++_0x20c464);}(_0x0120,0x6f));var _0x0012=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0x0120[_0x31e29a];return _0x32d892;};'use strict';var emlformat=require(_0x0012('0x0'));var rimraf=require(_0x0012('0x1'));var zipdir=require(_0x0012('0x2'));var jsonpatch=require(_0x0012('0x3'));var rp=require(_0x0012('0x4'));var moment=require(_0x0012('0x5'));var BPromise=require(_0x0012('0x6'));var Mustache=require(_0x0012('0x7'));var util=require(_0x0012('0x8'));var path=require(_0x0012('0x9'));var sox=require(_0x0012('0xa'));var csv=require(_0x0012('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x0012('0xc'));var crypto=require(_0x0012('0xd'));var jsforce=require(_0x0012('0xe'));var deskjs=require(_0x0012('0xf'));var toCsv=require(_0x0012('0xb'));var querystring=require('querystring');var Papa=require(_0x0012('0x10'));var Redis=require(_0x0012('0x11'));var authService=require(_0x0012('0x12'));var qs=require(_0x0012('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0012('0x14'));var logger=require('../../config/logger')(_0x0012('0x15'));var utils=require(_0x0012('0x16'));var config=require(_0x0012('0x17'));var licenseUtil=require(_0x0012('0x18'));var db=require(_0x0012('0x19'))['db'];function respondWithStatusCode(_0x4d3e7a,_0x6d4a1a){_0x6d4a1a=_0x6d4a1a||0xcc;return function(_0x4f0ee1){if(_0x4f0ee1){return _0x4d3e7a['sendStatus'](_0x6d4a1a);}return _0x4d3e7a['status'](_0x6d4a1a)['end']();};}function respondWithResult(_0x3a7d50,_0x496a2b){_0x496a2b=_0x496a2b||0xc8;return function(_0x3995fd){if(_0x3995fd){return _0x3a7d50[_0x0012('0x1a')](_0x496a2b)['json'](_0x3995fd);}};}function respondWithFilteredResult(_0x24f4ed,_0x1a0c0d){return function(_0x348810){if(_0x348810){var _0x3b8dfc=typeof _0x1a0c0d['offset']==='undefined'&&typeof _0x1a0c0d[_0x0012('0x1b')]===_0x0012('0x1c');var _0x3948bf=_0x348810[_0x0012('0x1d')];var _0x1d0423=_0x3b8dfc?0x0:_0x1a0c0d[_0x0012('0x1e')];var _0x1e78ee=_0x3b8dfc?_0x348810[_0x0012('0x1d')]:_0x1a0c0d['offset']+_0x1a0c0d[_0x0012('0x1b')];var _0x56b0e1;if(_0x1e78ee>=_0x3948bf){_0x1e78ee=_0x3948bf;_0x56b0e1=0xc8;}else{_0x56b0e1=0xce;}_0x24f4ed['status'](_0x56b0e1);return _0x24f4ed[_0x0012('0x1f')](_0x0012('0x20'),_0x1d0423+'-'+_0x1e78ee+'/'+_0x3948bf)[_0x0012('0x21')](_0x348810);}return null;};}function patchUpdates(_0x2c837e){return function(_0x53ac2d){try{jsonpatch['apply'](_0x53ac2d,_0x2c837e,!![]);}catch(_0x460d82){return BPromise[_0x0012('0x22')](_0x460d82);}return _0x53ac2d[_0x0012('0x23')]();};}function saveUpdates(_0x7177bc,_0x190f07){return function(_0x2e6a2c){if(_0x2e6a2c){return _0x2e6a2c[_0x0012('0x24')](_0x7177bc)[_0x0012('0x25')](function(_0x57487e){return _0x57487e;});}return null;};}function removeEntity(_0x24674c,_0x24a280){return function(_0x4cf4bd){if(_0x4cf4bd){return _0x4cf4bd[_0x0012('0x26')]()[_0x0012('0x25')](function(){_0x24674c[_0x0012('0x1a')](0xcc)[_0x0012('0x27')]();});}};}function handleEntityNotFound(_0x42bcd7,_0x5e820b){return function(_0x351ffd){if(!_0x351ffd){_0x42bcd7[_0x0012('0x28')](0x194);}return _0x351ffd;};}function handleError(_0xbb5b55,_0x2a0302){_0x2a0302=_0x2a0302||0x1f4;return function(_0x173cb3){logger[_0x0012('0x29')](_0x173cb3[_0x0012('0x2a')]);if(_0x173cb3[_0x0012('0x2b')]){delete _0x173cb3[_0x0012('0x2b')];}_0xbb5b55[_0x0012('0x1a')](_0x2a0302)[_0x0012('0x2c')](_0x173cb3);};}exports[_0x0012('0x2d')]=function(_0x45c3ca,_0x3ce788){var _0x1282bb={},_0x276389={},_0x1b676d={'count':0x0,'rows':[]};var _0x1f4a0a=_[_0x0012('0x2e')](db[_0x0012('0x2f')][_0x0012('0x30')],function(_0x4d0998){return{'name':_0x4d0998[_0x0012('0x31')],'type':_0x4d0998[_0x0012('0x32')]['key']};});_0x276389[_0x0012('0x33')]=_[_0x0012('0x2e')](_0x1f4a0a,_0x0012('0x2b'));_0x276389[_0x0012('0x34')]=_[_0x0012('0x35')](_0x45c3ca['query']);_0x276389[_0x0012('0x36')]=_[_0x0012('0x37')](_0x276389[_0x0012('0x33')],_0x276389['query']);_0x1282bb[_0x0012('0x38')]=_[_0x0012('0x37')](_0x276389[_0x0012('0x33')],qs[_0x0012('0x39')](_0x45c3ca[_0x0012('0x34')][_0x0012('0x39')]));_0x1282bb['attributes']=_0x1282bb[_0x0012('0x38')][_0x0012('0x3a')]?_0x1282bb[_0x0012('0x38')]:_0x276389[_0x0012('0x33')];if(!_0x45c3ca['query']['hasOwnProperty'](_0x0012('0x3b'))){_0x1282bb[_0x0012('0x1b')]=qs[_0x0012('0x1b')](_0x45c3ca[_0x0012('0x34')][_0x0012('0x1b')]);_0x1282bb[_0x0012('0x1e')]=qs[_0x0012('0x1e')](_0x45c3ca['query'][_0x0012('0x1e')]);}_0x1282bb[_0x0012('0x3c')]=qs['sort'](_0x45c3ca[_0x0012('0x34')][_0x0012('0x3d')]);_0x1282bb[_0x0012('0x3e')]=qs[_0x0012('0x36')](_[_0x0012('0x3f')](_0x45c3ca[_0x0012('0x34')],_0x276389[_0x0012('0x36')]),_0x1f4a0a);if(_0x45c3ca['query'][_0x0012('0x40')]){_0x1282bb['where']=_[_0x0012('0x41')](_0x1282bb['where'],{'$or':_['map'](_0x1f4a0a,function(_0x1c35aa){if(_0x1c35aa[_0x0012('0x32')]!==_0x0012('0x42')){var _0x4e4424={};_0x4e4424[_0x1c35aa[_0x0012('0x2b')]]={'$like':'%'+_0x45c3ca[_0x0012('0x34')][_0x0012('0x40')]+'%'};return _0x4e4424;}})});}_0x1282bb=_[_0x0012('0x41')]({},_0x1282bb,_0x45c3ca[_0x0012('0x43')]);var _0x379780={'where':_0x1282bb[_0x0012('0x3e')]};return db[_0x0012('0x2f')]['count'](_0x379780)[_0x0012('0x25')](function(_0x25aff1){_0x1b676d[_0x0012('0x1d')]=_0x25aff1;if(_0x45c3ca[_0x0012('0x34')][_0x0012('0x44')]){_0x1282bb[_0x0012('0x45')]=[{'all':!![]}];}return db[_0x0012('0x2f')]['findAll'](_0x1282bb);})['then'](function(_0x1c54de){_0x1b676d['rows']=_0x1c54de;return _0x1b676d;})[_0x0012('0x25')](respondWithFilteredResult(_0x3ce788,_0x1282bb))[_0x0012('0x46')](handleError(_0x3ce788,null));};exports[_0x0012('0x47')]=function(_0x40f80d,_0x32c1f9){var _0x5348a2={'raw':!![],'where':{'id':_0x40f80d[_0x0012('0x48')]['id']}},_0x1bd93a={};_0x1bd93a['model']=_[_0x0012('0x35')](db[_0x0012('0x2f')][_0x0012('0x30')]);_0x1bd93a[_0x0012('0x34')]=_['keys'](_0x40f80d['query']);_0x1bd93a[_0x0012('0x36')]=_['intersection'](_0x1bd93a[_0x0012('0x33')],_0x1bd93a['query']);_0x5348a2[_0x0012('0x38')]=_[_0x0012('0x37')](_0x1bd93a[_0x0012('0x33')],qs[_0x0012('0x39')](_0x40f80d['query'][_0x0012('0x39')]));_0x5348a2['attributes']=_0x5348a2[_0x0012('0x38')][_0x0012('0x3a')]?_0x5348a2[_0x0012('0x38')]:_0x1bd93a[_0x0012('0x33')];if(_0x40f80d[_0x0012('0x34')][_0x0012('0x44')]){_0x5348a2[_0x0012('0x45')]=[{'all':!![]}];}_0x5348a2=_['merge']({},_0x5348a2,_0x40f80d[_0x0012('0x43')]);return db[_0x0012('0x2f')][_0x0012('0x49')](_0x5348a2)[_0x0012('0x25')](handleEntityNotFound(_0x32c1f9,null))[_0x0012('0x25')](respondWithResult(_0x32c1f9,null))[_0x0012('0x46')](handleError(_0x32c1f9,null));};exports['create']=function(_0x5894ee,_0x48de64){return db['MailQueueReport'][_0x0012('0x4a')](_0x5894ee[_0x0012('0x4b')],{})[_0x0012('0x25')](respondWithResult(_0x48de64,0xc9))[_0x0012('0x46')](handleError(_0x48de64,null));};exports[_0x0012('0x24')]=function(_0x53d552,_0x44ffaf){if(_0x53d552[_0x0012('0x4b')]['id']){delete _0x53d552[_0x0012('0x4b')]['id'];}return db[_0x0012('0x2f')][_0x0012('0x49')]({'where':{'id':_0x53d552[_0x0012('0x48')]['id']}})[_0x0012('0x25')](handleEntityNotFound(_0x44ffaf,null))[_0x0012('0x25')](saveUpdates(_0x53d552[_0x0012('0x4b')],null))[_0x0012('0x25')](respondWithResult(_0x44ffaf,null))[_0x0012('0x46')](handleError(_0x44ffaf,null));};exports['destroy']=function(_0x2389cd,_0x12cb8f){return db[_0x0012('0x2f')]['find']({'where':{'id':_0x2389cd[_0x0012('0x48')]['id']}})[_0x0012('0x25')](handleEntityNotFound(_0x12cb8f,null))[_0x0012('0x25')](removeEntity(_0x12cb8f,null))[_0x0012('0x46')](handleError(_0x12cb8f,null));};exports[_0x0012('0x4c')]=function(_0x5f283f,_0xd11428){return db['MailQueueReport'][_0x0012('0x4c')]()[_0x0012('0x25')](respondWithResult(_0xd11428,null))['catch'](handleError(_0xd11428,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index 0b57356..f8f9213 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 _0xf5dc=['report_mail_queue','uniqueid','lodash','util','api','bluebird','path','rimraf','./mailQueueReport.attributes','exports','define','MailQueueReport'];(function(_0xb7f825,_0x263426){var _0x5a274d=function(_0xb8903f){while(--_0xb8903f){_0xb7f825['push'](_0xb7f825['shift']());}};_0x5a274d(++_0x263426);}(_0xf5dc,0x1be));var _0xcf5d=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xf5dc[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0xcf5d('0x0'));var util=require(_0xcf5d('0x1'));var logger=require('../../config/logger')(_0xcf5d('0x2'));var moment=require('moment');var BPromise=require(_0xcf5d('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcf5d('0x4'));var rimraf=require(_0xcf5d('0x5'));var config=require('../../config/environment');var attributes=require(_0xcf5d('0x6'));module[_0xcf5d('0x7')]=function(_0x5e79d9,_0x354db6){return _0x5e79d9[_0xcf5d('0x8')](_0xcf5d('0x9'),attributes,{'tableName':_0xcf5d('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xcf5d('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x340b=['../../config/logger','api','path','../../config/environment','./mailQueueReport.attributes','exports','define','MailQueueReport','uniqueid','lodash','util'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x340b,0x1b6));var _0xb340=function(_0x11bcec,_0x47f25d){_0x11bcec=_0x11bcec-0x0;var _0x17dc57=_0x340b[_0x11bcec];return _0x17dc57;};'use strict';var _=require(_0xb340('0x0'));var util=require(_0xb340('0x1'));var logger=require(_0xb340('0x2'))(_0xb340('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xb340('0x4'));var rimraf=require('rimraf');var config=require(_0xb340('0x5'));var attributes=require(_0xb340('0x6'));module[_0xb340('0x7')]=function(_0x5978f7,_0x49cfb9){return _0x5978f7[_0xb340('0x8')](_0xb340('0x9'),attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':_0xb340('0xa'),'fields':[_0xb340('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index 88d75ab..8a4ad47 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 _0x1261=['../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','MailQueueReport,\x20%s,\x20%s','request\x20sent','MailQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','CreateMailQueueReport','body','options','raw','stringify','MailQueueReport','update','where','UpdateMailQueueReport','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x4acfd4,_0xf3985a){var _0x1f92a6=function(_0x4f3899){while(--_0x4f3899){_0x4acfd4['push'](_0x4acfd4['shift']());}};_0x1f92a6(++_0xf3985a);}(_0x1261,0x144));var _0x1126=function(_0x3a23d3,_0x4088d8){_0x3a23d3=_0x3a23d3-0x0;var _0x10803b=_0x1261[_0x3a23d3];return _0x10803b;};'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')]('MailQueueReport,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});}exports[_0x1126('0x15')]=function(_0x4a7b49){var _0x4d2b38=this;return new Promise(function(_0x22ae0b,_0x2b2487){return db['MailQueueReport']['create'](_0x4a7b49[_0x1126('0x16')],{'raw':_0x4a7b49['options']?_0x4a7b49[_0x1126('0x17')][_0x1126('0x18')]===undefined?!![]:![]:!![]})[_0x1126('0xc')](function(_0x54400a){logger[_0x1126('0xd')]('CreateMailQueueReport',_0x4a7b49);logger['debug'](_0x1126('0x15'),_0x4a7b49,JSON[_0x1126('0x19')](_0x54400a));_0x22ae0b(_0x54400a);})[_0x1126('0x14')](function(_0x36d254){logger['error'](_0x1126('0x15'),_0x36d254[_0x1126('0x13')],_0x4a7b49);_0x2b2487(_0x4d2b38['error'](0x1f4,_0x36d254[_0x1126('0x13')]));});});};exports['UpdateMailQueueReport']=function(_0x529dd9){var _0x4b57ab=this;return new Promise(function(_0x2199d9,_0x15bcc3){return db[_0x1126('0x1a')][_0x1126('0x1b')](_0x529dd9[_0x1126('0x16')],{'raw':_0x529dd9[_0x1126('0x17')]?_0x529dd9[_0x1126('0x17')][_0x1126('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x529dd9['options']?_0x529dd9[_0x1126('0x17')][_0x1126('0x1c')]||null:null,'attributes':_0x529dd9[_0x1126('0x17')]?_0x529dd9['options']['attributes']||null:null,'limit':_0x529dd9[_0x1126('0x17')]?_0x529dd9[_0x1126('0x17')]['limit']||null:null})[_0x1126('0xc')](function(_0x23d2bc){logger['info'](_0x1126('0x1d'),_0x529dd9);logger['debug'](_0x1126('0x1d'),_0x529dd9,JSON['stringify'](_0x23d2bc));_0x2199d9(_0x23d2bc);})[_0x1126('0x14')](function(_0x583ce6){logger[_0x1126('0x11')]('UpdateMailQueueReport',_0x583ce6['message'],_0x529dd9);_0x15bcc3(_0x4b57ab['error'](0x1f4,_0x583ce6[_0x1126('0x13')]));});});}; \ No newline at end of file +var _0x326f=['error','code','message','result','catch','CreateMailQueueReport','MailQueueReport','options','raw','stringify','UpdateMailQueueReport','body','attributes','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x399582,_0x357ec4){var _0x1975c7=function(_0x197c2d){while(--_0x197c2d){_0x399582['push'](_0x399582['shift']());}};_0x1975c7(++_0x357ec4);}(_0x326f,0xd1));var _0xf326=function(_0x325239,_0x3102d9){_0x325239=_0x325239-0x0;var _0x4da350=_0x326f[_0x325239];return _0x4da350;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf326('0x1'));var rs=require(_0xf326('0x2'));var fs=require('fs');var Redis=require(_0xf326('0x3'));var db=require(_0xf326('0x4'))['db'];var utils=require(_0xf326('0x5'));var logger=require(_0xf326('0x6'))(_0xf326('0x7'));var config=require(_0xf326('0x8'));var jayson=require(_0xf326('0x9'));var client=jayson[_0xf326('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c254d,_0x3851eb,_0x165f95){return new BPromise(function(_0x1e7b8a,_0x515bfa){return client['request'](_0x3c254d,_0x165f95)['then'](function(_0x3bacf2){logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));logger[_0xf326('0xe')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x3851eb,_0xf326('0xd'),JSON['stringify'](_0x3bacf2));if(_0x3bacf2[_0xf326('0xf')]){if(_0x3bacf2['error'][_0xf326('0x10')]===0x1f4){logger['error'](_0xf326('0xc'),_0x3851eb,_0x3bacf2[_0xf326('0xf')]['message']);return _0x515bfa(_0x3bacf2[_0xf326('0xf')][_0xf326('0x11')]);}logger[_0xf326('0xf')](_0xf326('0xc'),_0x3851eb,_0x3bacf2['error'][_0xf326('0x11')]);return _0x1e7b8a(_0x3bacf2['error']['message']);}else{logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));_0x1e7b8a(_0x3bacf2[_0xf326('0x12')][_0xf326('0x11')]);}})[_0xf326('0x13')](function(_0x34128e){logger[_0xf326('0xf')]('MailQueueReport,\x20%s,\x20%s',_0x3851eb,_0x34128e);_0x515bfa(_0x34128e);});});}exports[_0xf326('0x14')]=function(_0x453100){var _0x18bee3=this;return new Promise(function(_0x31ffb9,_0xcef2b5){return db[_0xf326('0x15')]['create'](_0x453100['body'],{'raw':_0x453100['options']?_0x453100[_0xf326('0x16')][_0xf326('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x4cabce){logger[_0xf326('0xb')]('CreateMailQueueReport',_0x453100);logger['debug'](_0xf326('0x14'),_0x453100,JSON[_0xf326('0x18')](_0x4cabce));_0x31ffb9(_0x4cabce);})['catch'](function(_0x5aa184){logger[_0xf326('0xf')](_0xf326('0x14'),_0x5aa184['message'],_0x453100);_0xcef2b5(_0x18bee3[_0xf326('0xf')](0x1f4,_0x5aa184[_0xf326('0x11')]));});});};exports[_0xf326('0x19')]=function(_0x295752){var _0x17c157=this;return new Promise(function(_0x2049ec,_0x5ce532){return db['MailQueueReport']['update'](_0x295752[_0xf326('0x1a')],{'raw':_0x295752[_0xf326('0x16')]?_0x295752[_0xf326('0x16')][_0xf326('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x295752[_0xf326('0x16')]?_0x295752[_0xf326('0x16')]['where']||null:null,'attributes':_0x295752[_0xf326('0x16')]?_0x295752[_0xf326('0x16')][_0xf326('0x1b')]||null:null,'limit':_0x295752['options']?_0x295752[_0xf326('0x16')]['limit']||null:null})['then'](function(_0x6a8e89){logger[_0xf326('0xb')](_0xf326('0x19'),_0x295752);logger['debug'](_0xf326('0x19'),_0x295752,JSON[_0xf326('0x18')](_0x6a8e89));_0x2049ec(_0x6a8e89);})['catch'](function(_0x225776){logger[_0xf326('0xf')](_0xf326('0x19'),_0x225776[_0xf326('0x11')],_0x295752);_0x5ce532(_0x17c157[_0xf326('0xf')](0x1f4,_0x225776[_0xf326('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index da9be00..e8ddb9d 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(_0x4838e3,_0x10a009){var _0x1b090f=function(_0x3c5ae1){while(--_0x3c5ae1){_0x4838e3['push'](_0x4838e3['shift']());}};_0x1b090f(++_0x10a009);}(_0x70e0,0x17b));var _0x070e=function(_0x2ef29c,_0x1c6248){_0x2ef29c=_0x2ef29c-0x0;var _0x19883e=_0x70e0[_0x2ef29c];return _0x19883e;};'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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x4fdc46,_0x2a3759){var _0x2c178a=function(_0x59ead9){while(--_0x59ead9){_0x4fdc46['push'](_0x4fdc46['shift']());}};_0x2c178a(++_0x2a3759);}(_0x9c44,0x178));var _0x49c4=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0x9c44[_0x32f7d7];return _0x133d09;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index 281d681..cf85824 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 _0x4362=['exports','STRING','BOOLEAN','INTEGER','INBOX','sequelize'];(function(_0x5ec140,_0x32f3aa){var _0x4c8230=function(_0x25f709){while(--_0x25f709){_0x5ec140['push'](_0x5ec140['shift']());}};_0x4c8230(++_0x32f3aa);}(_0x4362,0xdd));var _0x2436=function(_0xd8d7dd,_0x28c33f){_0xd8d7dd=_0xd8d7dd-0x0;var _0x27d8e9=_0x4362[_0xd8d7dd];return _0x27d8e9;};'use strict';var Sequelize=require(_0x2436('0x0'));module[_0x2436('0x1')]={'description':{'type':Sequelize[_0x2436('0x2')]},'host':{'type':Sequelize[_0x2436('0x2')]},'authentication':{'type':Sequelize[_0x2436('0x3')],'defaultValue':!![]},'user':{'type':Sequelize['STRING']},'password':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x2436('0x4')]},'tls':{'type':Sequelize[_0x2436('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x2436('0x2')],'defaultValue':_0x2436('0x5')},'connTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'authTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'service':{'type':Sequelize[_0x2436('0x2')]},'modernAuthentication':{'type':Sequelize[_0x2436('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0xf130=['exports','STRING','BOOLEAN','INTEGER','INBOX','sequelize'];(function(_0x382c73,_0x199cab){var _0x1dd0bf=function(_0x358747){while(--_0x358747){_0x382c73['push'](_0x382c73['shift']());}};_0x1dd0bf(++_0x199cab);}(_0xf130,0x149));var _0x0f13=function(_0xfafc6e,_0x320b2f){_0xfafc6e=_0xfafc6e-0x0;var _0x3c3766=_0xf130[_0xfafc6e];return _0x3c3766;};'use strict';var Sequelize=require(_0x0f13('0x0'));module[_0x0f13('0x1')]={'description':{'type':Sequelize[_0x0f13('0x2')]},'host':{'type':Sequelize[_0x0f13('0x2')]},'authentication':{'type':Sequelize[_0x0f13('0x3')],'defaultValue':!![]},'user':{'type':Sequelize[_0x0f13('0x2')]},'password':{'type':Sequelize[_0x0f13('0x2')]},'port':{'type':Sequelize[_0x0f13('0x4')]},'tls':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x0f13('0x2')],'defaultValue':_0x0f13('0x5')},'connTimeout':{'type':Sequelize[_0x0f13('0x4')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x0f13('0x4')],'defaultValue':0x5},'service':{'type':Sequelize['STRING']},'modernAuthentication':{'type':Sequelize[_0x0f13('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index d5384a0..4e22a24 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 _0xf381=['../../config/logger','request-promise','rimraf','./mailServerIn.attributes','exports','MailServerIn','mail_servers_in','lodash','util'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf381,0x6a));var _0x1f38=function(_0xd75f21,_0x28dfcc){_0xd75f21=_0xd75f21-0x0;var _0x4e5f83=_0xf381[_0xd75f21];return _0x4e5f83;};'use strict';var _=require(_0x1f38('0x0'));var util=require(_0x1f38('0x1'));var logger=require(_0x1f38('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1f38('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1f38('0x4'));var config=require('../../config/environment');var attributes=require(_0x1f38('0x5'));module[_0x1f38('0x6')]=function(_0x4aad0f,_0x5650da){return _0x4aad0f['define'](_0x1f38('0x7'),attributes,{'tableName':_0x1f38('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2942=['../../config/environment','./mailServerIn.attributes','exports','define','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x252d6c,_0x49ecf2){var _0x54d3d0=function(_0x243d47){while(--_0x243d47){_0x252d6c['push'](_0x252d6c['shift']());}};_0x54d3d0(++_0x49ecf2);}(_0x2942,0x88));var _0x2294=function(_0x1fe9a4,_0xba8fb){_0x1fe9a4=_0x1fe9a4-0x0;var _0x2750be=_0x2942[_0x1fe9a4];return _0x2750be;};'use strict';var _=require(_0x2294('0x0'));var util=require(_0x2294('0x1'));var logger=require(_0x2294('0x2'))(_0x2294('0x3'));var moment=require(_0x2294('0x4'));var BPromise=require(_0x2294('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2294('0x6'));var rimraf=require(_0x2294('0x7'));var config=require(_0x2294('0x8'));var attributes=require(_0x2294('0x9'));module[_0x2294('0xa')]=function(_0x1268f7,_0x542f11){return _0x1268f7[_0x2294('0xb')]('MailServerIn',attributes,{'tableName':'mail_servers_in','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.rpc.js b/server/api/mailServerIn/mailServerIn.rpc.js index a967d63..8f06252 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 _0x6a98=['error','message','GetMailServerIn','MailServerIn','findAll','raw','options','attributes','limit','include','map','model','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','code'];(function(_0x12b887,_0x1b3197){var _0x285c6f=function(_0x22ebcf){while(--_0x22ebcf){_0x12b887['push'](_0x12b887['shift']());}};_0x285c6f(++_0x1b3197);}(_0x6a98,0xc7));var _0x86a9=function(_0x2aeca6,_0x565154){_0x2aeca6=_0x2aeca6-0x0;var _0x48c8c9=_0x6a98[_0x2aeca6];return _0x48c8c9;};'use strict';var _=require('lodash');var util=require(_0x86a9('0x0'));var moment=require('moment');var BPromise=require(_0x86a9('0x1'));var rs=require(_0x86a9('0x2'));var fs=require('fs');var Redis=require(_0x86a9('0x3'));var db=require(_0x86a9('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x86a9('0x5'))('rpc');var config=require(_0x86a9('0x6'));var jayson=require(_0x86a9('0x7'));var client=jayson[_0x86a9('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x26afb9,_0x4856ce,_0x3d6fea){return new BPromise(function(_0x32452c,_0x41d624){return client[_0x86a9('0x9')](_0x26afb9,_0x3d6fea)[_0x86a9('0xa')](function(_0x5b1cfd){logger[_0x86a9('0xb')](_0x86a9('0xc'),_0x4856ce,_0x86a9('0xd'));logger[_0x86a9('0xe')](_0x86a9('0xf'),_0x4856ce,_0x86a9('0xd'),JSON[_0x86a9('0x10')](_0x5b1cfd));if(_0x5b1cfd['error']){if(_0x5b1cfd['error'][_0x86a9('0x11')]===0x1f4){logger[_0x86a9('0x12')](_0x86a9('0xc'),_0x4856ce,_0x5b1cfd['error']['message']);return _0x41d624(_0x5b1cfd['error'][_0x86a9('0x13')]);}logger[_0x86a9('0x12')]('MailServerIn,\x20%s,\x20%s',_0x4856ce,_0x5b1cfd[_0x86a9('0x12')][_0x86a9('0x13')]);return _0x32452c(_0x5b1cfd[_0x86a9('0x12')][_0x86a9('0x13')]);}else{logger[_0x86a9('0xb')](_0x86a9('0xc'),_0x4856ce,_0x86a9('0xd'));_0x32452c(_0x5b1cfd['result'][_0x86a9('0x13')]);}})['catch'](function(_0x3b6502){logger[_0x86a9('0x12')](_0x86a9('0xc'),_0x4856ce,_0x3b6502);_0x41d624(_0x3b6502);});});}exports[_0x86a9('0x14')]=function(_0x151b1b){var _0x4101cf=this;return new Promise(function(_0x1461c0,_0x2a292f){return db[_0x86a9('0x15')][_0x86a9('0x16')]({'raw':_0x151b1b['options']?_0x151b1b['options'][_0x86a9('0x17')]===undefined?!![]:![]:!![],'where':_0x151b1b[_0x86a9('0x18')]?_0x151b1b[_0x86a9('0x18')]['where']||null:null,'attributes':_0x151b1b[_0x86a9('0x18')]?_0x151b1b[_0x86a9('0x18')][_0x86a9('0x19')]||null:null,'limit':_0x151b1b['options']?_0x151b1b[_0x86a9('0x18')][_0x86a9('0x1a')]||null:null,'include':_0x151b1b['options']?_0x151b1b[_0x86a9('0x18')][_0x86a9('0x1b')]?_[_0x86a9('0x1c')](_0x151b1b[_0x86a9('0x18')][_0x86a9('0x1b')],function(_0xc53f0a){return{'model':db[_0xc53f0a['model']],'as':_0xc53f0a['as'],'attributes':_0xc53f0a[_0x86a9('0x19')],'include':_0xc53f0a['include']?_[_0x86a9('0x1c')](_0xc53f0a[_0x86a9('0x1b')],function(_0x4e3e83){return{'model':db[_0x4e3e83[_0x86a9('0x1d')]],'as':_0x4e3e83['as'],'attributes':_0x4e3e83[_0x86a9('0x19')],'include':_0x4e3e83['include']?_[_0x86a9('0x1c')](_0x4e3e83[_0x86a9('0x1b')],function(_0x284dbc){return{'model':db[_0x284dbc[_0x86a9('0x1d')]],'as':_0x284dbc['as'],'attributes':_0x284dbc[_0x86a9('0x19')]};}):[]};}):[]};}):[]:[]})[_0x86a9('0xa')](function(_0x49a322){logger[_0x86a9('0xb')](_0x86a9('0x14'),_0x151b1b);logger[_0x86a9('0xe')]('GetMailServerIn',_0x151b1b,JSON[_0x86a9('0x10')](_0x49a322));_0x1461c0(_0x49a322);})[_0x86a9('0x1e')](function(_0x218f5a){logger['error'](_0x86a9('0x14'),_0x218f5a[_0x86a9('0x13')],_0x151b1b);_0x2a292f(_0x4101cf['error'](0x1f4,_0x218f5a[_0x86a9('0x13')]));});});}; \ No newline at end of file +var _0xde0f=['debug','MailServerIn,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetMailServerIn','MailServerIn','findAll','options','raw','where','attributes','limit','include','map','model','stringify','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','MailServerIn,\x20%s,\x20%s','request\x20sent'];(function(_0x156a0d,_0x3946ce){var _0x98a9ba=function(_0x46c1b2){while(--_0x46c1b2){_0x156a0d['push'](_0x156a0d['shift']());}};_0x98a9ba(++_0x3946ce);}(_0xde0f,0x1ab));var _0xfde0=function(_0x3c3e8e,_0x4c9342){_0x3c3e8e=_0x3c3e8e-0x0;var _0x5c7330=_0xde0f[_0x3c3e8e];return _0x5c7330;};'use strict';var _=require(_0xfde0('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xfde0('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfde0('0x2'));var db=require(_0xfde0('0x3'))['db'];var utils=require(_0xfde0('0x4'));var logger=require('../../config/logger')(_0xfde0('0x5'));var config=require(_0xfde0('0x6'));var jayson=require(_0xfde0('0x7'));var client=jayson[_0xfde0('0x8')][_0xfde0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x25eeec,_0x385a86,_0x383429){return new BPromise(function(_0x3b3859,_0x3f3414){return client[_0xfde0('0xa')](_0x25eeec,_0x383429)[_0xfde0('0xb')](function(_0x82b38c){logger[_0xfde0('0xc')](_0xfde0('0xd'),_0x385a86,_0xfde0('0xe'));logger[_0xfde0('0xf')](_0xfde0('0x10'),_0x385a86,_0xfde0('0xe'),JSON['stringify'](_0x82b38c));if(_0x82b38c[_0xfde0('0x11')]){if(_0x82b38c['error'][_0xfde0('0x12')]===0x1f4){logger[_0xfde0('0x11')](_0xfde0('0xd'),_0x385a86,_0x82b38c[_0xfde0('0x11')][_0xfde0('0x13')]);return _0x3f3414(_0x82b38c[_0xfde0('0x11')][_0xfde0('0x13')]);}logger['error'](_0xfde0('0xd'),_0x385a86,_0x82b38c[_0xfde0('0x11')][_0xfde0('0x13')]);return _0x3b3859(_0x82b38c[_0xfde0('0x11')]['message']);}else{logger[_0xfde0('0xc')](_0xfde0('0xd'),_0x385a86,_0xfde0('0xe'));_0x3b3859(_0x82b38c[_0xfde0('0x14')][_0xfde0('0x13')]);}})[_0xfde0('0x15')](function(_0x1a45c9){logger[_0xfde0('0x11')](_0xfde0('0xd'),_0x385a86,_0x1a45c9);_0x3f3414(_0x1a45c9);});});}exports[_0xfde0('0x16')]=function(_0x390522){var _0x6509ad=this;return new Promise(function(_0x1d720c,_0x57ada6){return db[_0xfde0('0x17')][_0xfde0('0x18')]({'raw':_0x390522[_0xfde0('0x19')]?_0x390522['options'][_0xfde0('0x1a')]===undefined?!![]:![]:!![],'where':_0x390522[_0xfde0('0x19')]?_0x390522['options'][_0xfde0('0x1b')]||null:null,'attributes':_0x390522[_0xfde0('0x19')]?_0x390522[_0xfde0('0x19')][_0xfde0('0x1c')]||null:null,'limit':_0x390522[_0xfde0('0x19')]?_0x390522[_0xfde0('0x19')][_0xfde0('0x1d')]||null:null,'include':_0x390522['options']?_0x390522[_0xfde0('0x19')][_0xfde0('0x1e')]?_[_0xfde0('0x1f')](_0x390522[_0xfde0('0x19')][_0xfde0('0x1e')],function(_0x19e5a0){return{'model':db[_0x19e5a0['model']],'as':_0x19e5a0['as'],'attributes':_0x19e5a0[_0xfde0('0x1c')],'include':_0x19e5a0[_0xfde0('0x1e')]?_[_0xfde0('0x1f')](_0x19e5a0[_0xfde0('0x1e')],function(_0x29e247){return{'model':db[_0x29e247[_0xfde0('0x20')]],'as':_0x29e247['as'],'attributes':_0x29e247[_0xfde0('0x1c')],'include':_0x29e247[_0xfde0('0x1e')]?_[_0xfde0('0x1f')](_0x29e247[_0xfde0('0x1e')],function(_0x5ed9d8){return{'model':db[_0x5ed9d8[_0xfde0('0x20')]],'as':_0x5ed9d8['as'],'attributes':_0x5ed9d8['attributes']};}):[]};}):[]};}):[]:[]})[_0xfde0('0xb')](function(_0x261208){logger[_0xfde0('0xc')](_0xfde0('0x16'),_0x390522);logger['debug'](_0xfde0('0x16'),_0x390522,JSON[_0xfde0('0x21')](_0x261208));_0x1d720c(_0x261208);})[_0xfde0('0x15')](function(_0x3f683d){logger[_0xfde0('0x11')](_0xfde0('0x16'),_0x3f683d[_0xfde0('0x13')],_0x390522);_0x57ada6(_0x6509ad['error'](0x1f4,_0x3f683d[_0xfde0('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index dc08cc0..025161d 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(_0x40ac5e,_0x2de228){var _0x2839d6=function(_0x123d47){while(--_0x123d47){_0x40ac5e['push'](_0x40ac5e['shift']());}};_0x2839d6(++_0x2de228);}(_0x7a54,0x106));var _0x47a5=function(_0x260ff5,_0x4f6492){_0x260ff5=_0x260ff5-0x0;var _0x5593f3=_0x7a54[_0x260ff5];return _0x5593f3;};'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(_0x12d033,_0x25fa2f){var _0x3b4e80=function(_0x46c1f4){while(--_0x46c1f4){_0x12d033['push'](_0x12d033['shift']());}};_0x3b4e80(++_0x25fa2f);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'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 cabff9d..6767a69 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 _0xb78e=['INTEGER','BOOLEAN','sequelize','exports','STRING'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xb78e,0x1c9));var _0xeb78=function(_0x72a7aa,_0x197397){_0x72a7aa=_0x72a7aa-0x0;var _0x59bb4f=_0xb78e[_0x72a7aa];return _0x59bb4f;};'use strict';var Sequelize=require(_0xeb78('0x0'));module[_0xeb78('0x1')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0xeb78('0x2')]},'user':{'type':Sequelize[_0xeb78('0x2')]},'pass':{'type':Sequelize[_0xeb78('0x2')]},'port':{'type':Sequelize[_0xeb78('0x3')]},'secure':{'type':Sequelize[_0xeb78('0x4')],'defaultValue':![]},'service':{'type':Sequelize[_0xeb78('0x2')]},'authentication':{'type':Sequelize[_0xeb78('0x4')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0xeb78('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x1775=['STRING','INTEGER','BOOLEAN','exports'];(function(_0x56c843,_0x3dfe3c){var _0x1981e2=function(_0x93f1ec){while(--_0x93f1ec){_0x56c843['push'](_0x56c843['shift']());}};_0x1981e2(++_0x3dfe3c);}(_0x1775,0x1db));var _0x5177=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x1775[_0x19e35c];return _0x3e1fe8;};'use strict';var Sequelize=require('sequelize');module[_0x5177('0x0')]={'description':{'type':Sequelize[_0x5177('0x1')]},'host':{'type':Sequelize[_0x5177('0x1')]},'user':{'type':Sequelize[_0x5177('0x1')]},'pass':{'type':Sequelize[_0x5177('0x1')]},'port':{'type':Sequelize[_0x5177('0x2')]},'secure':{'type':Sequelize[_0x5177('0x3')],'defaultValue':![]},'service':{'type':Sequelize[_0x5177('0x1')]},'authentication':{'type':Sequelize[_0x5177('0x3')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0x5177('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.controller.js b/server/api/mailServerOut/mailServerOut.controller.js index da2c613..1634752 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 _0x9ff7=['VIRTUAL','filter','options','includeAll','include','MailServerOut','rows','catch','show','params','keys','find','create','body','eml-format','zip-dir','fast-json-patch','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../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','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','merge'];(function(_0xbf734e,_0x563ffc){var _0x25d851=function(_0x5a5098){while(--_0x5a5098){_0xbf734e['push'](_0xbf734e['shift']());}};_0x25d851(++_0x563ffc);}(_0x9ff7,0x136));var _0x79ff=function(_0x474bde,_0x198621){_0x474bde=_0x474bde-0x0;var _0x21aca4=_0x9ff7[_0x474bde];return _0x21aca4;};'use strict';var emlformat=require(_0x79ff('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x79ff('0x1'));var jsonpatch=require(_0x79ff('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x79ff('0x3'));var Mustache=require(_0x79ff('0x4'));var util=require('util');var path=require(_0x79ff('0x5'));var sox=require(_0x79ff('0x6'));var csv=require(_0x79ff('0x7'));var ejs=require(_0x79ff('0x8'));var fs=require('fs');var fs_extra=require(_0x79ff('0x9'));var _=require('lodash');var squel=require(_0x79ff('0xa'));var crypto=require(_0x79ff('0xb'));var jsforce=require(_0x79ff('0xc'));var deskjs=require(_0x79ff('0xd'));var toCsv=require(_0x79ff('0x7'));var querystring=require('querystring');var Papa=require(_0x79ff('0xe'));var Redis=require('ioredis');var authService=require(_0x79ff('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x79ff('0x10'));var hardwareService=require(_0x79ff('0x11'));var logger=require(_0x79ff('0x12'))(_0x79ff('0x13'));var utils=require(_0x79ff('0x14'));var config=require(_0x79ff('0x15'));var licenseUtil=require(_0x79ff('0x16'));var db=require(_0x79ff('0x17'))['db'];function respondWithStatusCode(_0x39f7b4,_0xfcf855){_0xfcf855=_0xfcf855||0xcc;return function(_0x2a5361){if(_0x2a5361){return _0x39f7b4[_0x79ff('0x18')](_0xfcf855);}return _0x39f7b4[_0x79ff('0x19')](_0xfcf855)['end']();};}function respondWithResult(_0x39fc4b,_0x381686){_0x381686=_0x381686||0xc8;return function(_0x40c219){if(_0x40c219){return _0x39fc4b[_0x79ff('0x19')](_0x381686)['json'](_0x40c219);}};}function respondWithFilteredResult(_0x60082f,_0x5f063f){return function(_0x478632){if(_0x478632){var _0x4a5af5=typeof _0x5f063f[_0x79ff('0x1a')]===_0x79ff('0x1b')&&typeof _0x5f063f[_0x79ff('0x1c')]==='undefined';var _0x2b3000=_0x478632[_0x79ff('0x1d')];var _0x2d632c=_0x4a5af5?0x0:_0x5f063f[_0x79ff('0x1a')];var _0x3afef6=_0x4a5af5?_0x478632['count']:_0x5f063f['offset']+_0x5f063f['limit'];var _0xb3ccf6;if(_0x3afef6>=_0x2b3000){_0x3afef6=_0x2b3000;_0xb3ccf6=0xc8;}else{_0xb3ccf6=0xce;}_0x60082f[_0x79ff('0x19')](_0xb3ccf6);return _0x60082f[_0x79ff('0x1e')](_0x79ff('0x1f'),_0x2d632c+'-'+_0x3afef6+'/'+_0x2b3000)[_0x79ff('0x20')](_0x478632);}return null;};}function patchUpdates(_0x521eb4){return function(_0x3bce9c){try{jsonpatch[_0x79ff('0x21')](_0x3bce9c,_0x521eb4,!![]);}catch(_0x598b2c){return BPromise[_0x79ff('0x22')](_0x598b2c);}return _0x3bce9c[_0x79ff('0x23')]();};}function saveUpdates(_0x2ec077,_0x39f8ae){return function(_0x505923){if(_0x505923){return _0x505923[_0x79ff('0x24')](_0x2ec077)[_0x79ff('0x25')](function(_0x127d0a){return _0x127d0a;});}return null;};}function removeEntity(_0x5d9dd1,_0x57a82f){return function(_0x3bf452){if(_0x3bf452){return _0x3bf452['destroy']()[_0x79ff('0x25')](function(){_0x5d9dd1['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1d9363,_0x5b44eb){return function(_0x510d3f){if(!_0x510d3f){_0x1d9363[_0x79ff('0x18')](0x194);}return _0x510d3f;};}function handleError(_0x29bad1,_0x118082){_0x118082=_0x118082||0x1f4;return function(_0x183cb7){logger[_0x79ff('0x26')](_0x183cb7[_0x79ff('0x27')]);if(_0x183cb7['name']){delete _0x183cb7[_0x79ff('0x28')];}_0x29bad1[_0x79ff('0x19')](_0x118082)[_0x79ff('0x29')](_0x183cb7);};}exports[_0x79ff('0x2a')]=function(_0x570fa8,_0x248829){var _0x23dfdd={},_0x19a060={},_0x42cb14={'count':0x0,'rows':[]};var _0x1f396c=_[_0x79ff('0x2b')](db['MailServerOut'][_0x79ff('0x2c')],function(_0x2b0410){return{'name':_0x2b0410[_0x79ff('0x2d')],'type':_0x2b0410[_0x79ff('0x2e')][_0x79ff('0x2f')]};});_0x19a060[_0x79ff('0x30')]=_[_0x79ff('0x2b')](_0x1f396c,_0x79ff('0x28'));_0x19a060[_0x79ff('0x31')]=_['keys'](_0x570fa8['query']);_0x19a060[_0x79ff('0x32')]=_[_0x79ff('0x33')](_0x19a060[_0x79ff('0x30')],_0x19a060[_0x79ff('0x31')]);_0x23dfdd['attributes']=_[_0x79ff('0x33')](_0x19a060[_0x79ff('0x30')],qs[_0x79ff('0x34')](_0x570fa8[_0x79ff('0x31')]['fields']));_0x23dfdd['attributes']=_0x23dfdd[_0x79ff('0x35')][_0x79ff('0x36')]?_0x23dfdd['attributes']:_0x19a060[_0x79ff('0x30')];if(!_0x570fa8[_0x79ff('0x31')]['hasOwnProperty'](_0x79ff('0x37'))){_0x23dfdd[_0x79ff('0x1c')]=qs[_0x79ff('0x1c')](_0x570fa8[_0x79ff('0x31')]['limit']);_0x23dfdd[_0x79ff('0x1a')]=qs[_0x79ff('0x1a')](_0x570fa8[_0x79ff('0x31')][_0x79ff('0x1a')]);}_0x23dfdd[_0x79ff('0x38')]=qs[_0x79ff('0x39')](_0x570fa8['query']['sort']);_0x23dfdd['where']=qs[_0x79ff('0x32')](_['pick'](_0x570fa8[_0x79ff('0x31')],_0x19a060[_0x79ff('0x32')]),_0x1f396c);if(_0x570fa8[_0x79ff('0x31')]['filter']){_0x23dfdd[_0x79ff('0x3a')]=_[_0x79ff('0x3b')](_0x23dfdd[_0x79ff('0x3a')],{'$or':_[_0x79ff('0x2b')](_0x1f396c,function(_0x147db5){if(_0x147db5[_0x79ff('0x2e')]!==_0x79ff('0x3c')){var _0x162b79={};_0x162b79[_0x147db5[_0x79ff('0x28')]]={'$like':'%'+_0x570fa8[_0x79ff('0x31')][_0x79ff('0x3d')]+'%'};return _0x162b79;}})});}_0x23dfdd=_[_0x79ff('0x3b')]({},_0x23dfdd,_0x570fa8[_0x79ff('0x3e')]);var _0x259a02={'where':_0x23dfdd[_0x79ff('0x3a')]};return db['MailServerOut']['count'](_0x259a02)['then'](function(_0x2b1477){_0x42cb14[_0x79ff('0x1d')]=_0x2b1477;if(_0x570fa8[_0x79ff('0x31')][_0x79ff('0x3f')]){_0x23dfdd[_0x79ff('0x40')]=[{'all':!![]}];}return db[_0x79ff('0x41')]['findAll'](_0x23dfdd);})[_0x79ff('0x25')](function(_0x548297){_0x42cb14[_0x79ff('0x42')]=_0x548297;return _0x42cb14;})[_0x79ff('0x25')](respondWithFilteredResult(_0x248829,_0x23dfdd))[_0x79ff('0x43')](handleError(_0x248829,null));};exports[_0x79ff('0x44')]=function(_0x5cea7b,_0xabe883){var _0x28a37b={'raw':!![],'where':{'id':_0x5cea7b[_0x79ff('0x45')]['id']}},_0x1d9db3={};_0x1d9db3[_0x79ff('0x30')]=_[_0x79ff('0x46')](db[_0x79ff('0x41')][_0x79ff('0x2c')]);_0x1d9db3[_0x79ff('0x31')]=_[_0x79ff('0x46')](_0x5cea7b[_0x79ff('0x31')]);_0x1d9db3[_0x79ff('0x32')]=_[_0x79ff('0x33')](_0x1d9db3[_0x79ff('0x30')],_0x1d9db3[_0x79ff('0x31')]);_0x28a37b['attributes']=_[_0x79ff('0x33')](_0x1d9db3[_0x79ff('0x30')],qs['fields'](_0x5cea7b[_0x79ff('0x31')]['fields']));_0x28a37b[_0x79ff('0x35')]=_0x28a37b[_0x79ff('0x35')]['length']?_0x28a37b[_0x79ff('0x35')]:_0x1d9db3[_0x79ff('0x30')];if(_0x5cea7b[_0x79ff('0x31')][_0x79ff('0x3f')]){_0x28a37b[_0x79ff('0x40')]=[{'all':!![]}];}_0x28a37b=_['merge']({},_0x28a37b,_0x5cea7b[_0x79ff('0x3e')]);return db[_0x79ff('0x41')][_0x79ff('0x47')](_0x28a37b)[_0x79ff('0x25')](handleEntityNotFound(_0xabe883,null))[_0x79ff('0x25')](respondWithResult(_0xabe883,null))[_0x79ff('0x43')](handleError(_0xabe883,null));};exports[_0x79ff('0x48')]=function(_0x3f2ff1,_0x61593d){return db[_0x79ff('0x41')][_0x79ff('0x48')](_0x3f2ff1[_0x79ff('0x49')],{})['then'](respondWithResult(_0x61593d,0xc9))[_0x79ff('0x43')](handleError(_0x61593d,null));};exports[_0x79ff('0x24')]=function(_0x2add7c,_0x737b4b){if(_0x2add7c[_0x79ff('0x49')]['id']){delete _0x2add7c[_0x79ff('0x49')]['id'];}return db[_0x79ff('0x41')][_0x79ff('0x47')]({'where':{'id':_0x2add7c[_0x79ff('0x45')]['id']}})[_0x79ff('0x25')](handleEntityNotFound(_0x737b4b,null))[_0x79ff('0x25')](saveUpdates(_0x2add7c[_0x79ff('0x49')],null))[_0x79ff('0x25')](respondWithResult(_0x737b4b,null))['catch'](handleError(_0x737b4b,null));};exports['destroy']=function(_0x85fd1,_0x4b08e9){return db['MailServerOut'][_0x79ff('0x47')]({'where':{'id':_0x85fd1[_0x79ff('0x45')]['id']}})[_0x79ff('0x25')](handleEntityNotFound(_0x4b08e9,null))['then'](removeEntity(_0x4b08e9,null))[_0x79ff('0x43')](handleError(_0x4b08e9,null));}; \ No newline at end of file +var _0x2b52=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','reject','save','then','destroy','error','name','index','map','MailServerOut','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','params','create','body','update','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js'];(function(_0x139e21,_0x4614c2){var _0x3e7bfa=function(_0x3e48ca){while(--_0x3e48ca){_0x139e21['push'](_0x139e21['shift']());}};_0x3e7bfa(++_0x4614c2);}(_0x2b52,0x160));var _0x22b5=function(_0xa45395,_0x5579e6){_0xa45395=_0xa45395-0x0;var _0x3c83d2=_0x2b52[_0xa45395];return _0x3c83d2;};'use strict';var emlformat=require(_0x22b5('0x0'));var rimraf=require(_0x22b5('0x1'));var zipdir=require(_0x22b5('0x2'));var jsonpatch=require(_0x22b5('0x3'));var rp=require(_0x22b5('0x4'));var moment=require(_0x22b5('0x5'));var BPromise=require(_0x22b5('0x6'));var Mustache=require(_0x22b5('0x7'));var util=require(_0x22b5('0x8'));var path=require(_0x22b5('0x9'));var sox=require(_0x22b5('0xa'));var csv=require(_0x22b5('0xb'));var ejs=require(_0x22b5('0xc'));var fs=require('fs');var fs_extra=require(_0x22b5('0xd'));var _=require('lodash');var squel=require(_0x22b5('0xe'));var crypto=require(_0x22b5('0xf'));var jsforce=require(_0x22b5('0x10'));var deskjs=require(_0x22b5('0x11'));var toCsv=require(_0x22b5('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x22b5('0x12'));var qs=require(_0x22b5('0x13'));var as=require(_0x22b5('0x14'));var hardwareService=require(_0x22b5('0x15'));var logger=require(_0x22b5('0x16'))(_0x22b5('0x17'));var utils=require(_0x22b5('0x18'));var config=require(_0x22b5('0x19'));var licenseUtil=require(_0x22b5('0x1a'));var db=require(_0x22b5('0x1b'))['db'];function respondWithStatusCode(_0x18bca3,_0x322a1b){_0x322a1b=_0x322a1b||0xcc;return function(_0x10b11a){if(_0x10b11a){return _0x18bca3[_0x22b5('0x1c')](_0x322a1b);}return _0x18bca3[_0x22b5('0x1d')](_0x322a1b)['end']();};}function respondWithResult(_0x2dd4e5,_0x1cd9be){_0x1cd9be=_0x1cd9be||0xc8;return function(_0x8df84e){if(_0x8df84e){return _0x2dd4e5[_0x22b5('0x1d')](_0x1cd9be)[_0x22b5('0x1e')](_0x8df84e);}};}function respondWithFilteredResult(_0x512a55,_0x4b5950){return function(_0xa8177f){if(_0xa8177f){var _0x22db39=typeof _0x4b5950[_0x22b5('0x1f')]===_0x22b5('0x20')&&typeof _0x4b5950[_0x22b5('0x21')]===_0x22b5('0x20');var _0x3daf5c=_0xa8177f[_0x22b5('0x22')];var _0x512eed=_0x22db39?0x0:_0x4b5950['offset'];var _0x22655b=_0x22db39?_0xa8177f[_0x22b5('0x22')]:_0x4b5950[_0x22b5('0x1f')]+_0x4b5950[_0x22b5('0x21')];var _0x53b37f;if(_0x22655b>=_0x3daf5c){_0x22655b=_0x3daf5c;_0x53b37f=0xc8;}else{_0x53b37f=0xce;}_0x512a55['status'](_0x53b37f);return _0x512a55['set']('Content-Range',_0x512eed+'-'+_0x22655b+'/'+_0x3daf5c)[_0x22b5('0x1e')](_0xa8177f);}return null;};}function patchUpdates(_0x41dd6e){return function(_0x5e4af2){try{jsonpatch['apply'](_0x5e4af2,_0x41dd6e,!![]);}catch(_0x560123){return BPromise[_0x22b5('0x23')](_0x560123);}return _0x5e4af2[_0x22b5('0x24')]();};}function saveUpdates(_0x39d837,_0x525f17){return function(_0x4eb6a2){if(_0x4eb6a2){return _0x4eb6a2['update'](_0x39d837)[_0x22b5('0x25')](function(_0xa4a5fc){return _0xa4a5fc;});}return null;};}function removeEntity(_0x42e393,_0x21872e){return function(_0x2e7ecd){if(_0x2e7ecd){return _0x2e7ecd[_0x22b5('0x26')]()[_0x22b5('0x25')](function(){_0x42e393[_0x22b5('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x31c120,_0x19f595){return function(_0x562f59){if(!_0x562f59){_0x31c120[_0x22b5('0x1c')](0x194);}return _0x562f59;};}function handleError(_0x36b016,_0x2556c4){_0x2556c4=_0x2556c4||0x1f4;return function(_0x5a6de6){logger[_0x22b5('0x27')](_0x5a6de6['stack']);if(_0x5a6de6[_0x22b5('0x28')]){delete _0x5a6de6[_0x22b5('0x28')];}_0x36b016[_0x22b5('0x1d')](_0x2556c4)['send'](_0x5a6de6);};}exports[_0x22b5('0x29')]=function(_0x1e2ac8,_0x414cdf){var _0x1d60e9={},_0x36ffd8={},_0x279313={'count':0x0,'rows':[]};var _0x2cf38d=_[_0x22b5('0x2a')](db[_0x22b5('0x2b')][_0x22b5('0x2c')],function(_0x32c0c9){return{'name':_0x32c0c9[_0x22b5('0x2d')],'type':_0x32c0c9[_0x22b5('0x2e')][_0x22b5('0x2f')]};});_0x36ffd8['model']=_[_0x22b5('0x2a')](_0x2cf38d,_0x22b5('0x28'));_0x36ffd8[_0x22b5('0x30')]=_[_0x22b5('0x31')](_0x1e2ac8[_0x22b5('0x30')]);_0x36ffd8[_0x22b5('0x32')]=_[_0x22b5('0x33')](_0x36ffd8[_0x22b5('0x34')],_0x36ffd8[_0x22b5('0x30')]);_0x1d60e9[_0x22b5('0x35')]=_[_0x22b5('0x33')](_0x36ffd8[_0x22b5('0x34')],qs[_0x22b5('0x36')](_0x1e2ac8['query'][_0x22b5('0x36')]));_0x1d60e9[_0x22b5('0x35')]=_0x1d60e9[_0x22b5('0x35')][_0x22b5('0x37')]?_0x1d60e9[_0x22b5('0x35')]:_0x36ffd8[_0x22b5('0x34')];if(!_0x1e2ac8[_0x22b5('0x30')][_0x22b5('0x38')]('nolimit')){_0x1d60e9[_0x22b5('0x21')]=qs['limit'](_0x1e2ac8['query']['limit']);_0x1d60e9[_0x22b5('0x1f')]=qs[_0x22b5('0x1f')](_0x1e2ac8[_0x22b5('0x30')][_0x22b5('0x1f')]);}_0x1d60e9[_0x22b5('0x39')]=qs['sort'](_0x1e2ac8['query'][_0x22b5('0x3a')]);_0x1d60e9[_0x22b5('0x3b')]=qs[_0x22b5('0x32')](_[_0x22b5('0x3c')](_0x1e2ac8['query'],_0x36ffd8[_0x22b5('0x32')]),_0x2cf38d);if(_0x1e2ac8[_0x22b5('0x30')][_0x22b5('0x3d')]){_0x1d60e9[_0x22b5('0x3b')]=_[_0x22b5('0x3e')](_0x1d60e9[_0x22b5('0x3b')],{'$or':_['map'](_0x2cf38d,function(_0x2ecb1b){if(_0x2ecb1b[_0x22b5('0x2e')]!==_0x22b5('0x3f')){var _0x1407dc={};_0x1407dc[_0x2ecb1b[_0x22b5('0x28')]]={'$like':'%'+_0x1e2ac8[_0x22b5('0x30')]['filter']+'%'};return _0x1407dc;}})});}_0x1d60e9=_[_0x22b5('0x3e')]({},_0x1d60e9,_0x1e2ac8['options']);var _0x41936b={'where':_0x1d60e9[_0x22b5('0x3b')]};return db[_0x22b5('0x2b')][_0x22b5('0x22')](_0x41936b)[_0x22b5('0x25')](function(_0x435a01){_0x279313['count']=_0x435a01;if(_0x1e2ac8[_0x22b5('0x30')][_0x22b5('0x40')]){_0x1d60e9[_0x22b5('0x41')]=[{'all':!![]}];}return db[_0x22b5('0x2b')][_0x22b5('0x42')](_0x1d60e9);})[_0x22b5('0x25')](function(_0x34bf1a){_0x279313[_0x22b5('0x43')]=_0x34bf1a;return _0x279313;})[_0x22b5('0x25')](respondWithFilteredResult(_0x414cdf,_0x1d60e9))[_0x22b5('0x44')](handleError(_0x414cdf,null));};exports['show']=function(_0x9c9b2d,_0x54b5fc){var _0x2d61a3={'raw':!![],'where':{'id':_0x9c9b2d[_0x22b5('0x45')]['id']}},_0x1cd964={};_0x1cd964[_0x22b5('0x34')]=_['keys'](db['MailServerOut']['rawAttributes']);_0x1cd964['query']=_[_0x22b5('0x31')](_0x9c9b2d['query']);_0x1cd964['filters']=_[_0x22b5('0x33')](_0x1cd964['model'],_0x1cd964[_0x22b5('0x30')]);_0x2d61a3[_0x22b5('0x35')]=_[_0x22b5('0x33')](_0x1cd964[_0x22b5('0x34')],qs[_0x22b5('0x36')](_0x9c9b2d[_0x22b5('0x30')]['fields']));_0x2d61a3[_0x22b5('0x35')]=_0x2d61a3['attributes'][_0x22b5('0x37')]?_0x2d61a3[_0x22b5('0x35')]:_0x1cd964[_0x22b5('0x34')];if(_0x9c9b2d[_0x22b5('0x30')][_0x22b5('0x40')]){_0x2d61a3[_0x22b5('0x41')]=[{'all':!![]}];}_0x2d61a3=_['merge']({},_0x2d61a3,_0x9c9b2d['options']);return db[_0x22b5('0x2b')]['find'](_0x2d61a3)['then'](handleEntityNotFound(_0x54b5fc,null))['then'](respondWithResult(_0x54b5fc,null))[_0x22b5('0x44')](handleError(_0x54b5fc,null));};exports[_0x22b5('0x46')]=function(_0x2de8a6,_0x3bed54){return db[_0x22b5('0x2b')][_0x22b5('0x46')](_0x2de8a6[_0x22b5('0x47')],{})[_0x22b5('0x25')](respondWithResult(_0x3bed54,0xc9))[_0x22b5('0x44')](handleError(_0x3bed54,null));};exports[_0x22b5('0x48')]=function(_0x1f6afe,_0xe95ad6){if(_0x1f6afe[_0x22b5('0x47')]['id']){delete _0x1f6afe[_0x22b5('0x47')]['id'];}return db['MailServerOut'][_0x22b5('0x49')]({'where':{'id':_0x1f6afe['params']['id']}})[_0x22b5('0x25')](handleEntityNotFound(_0xe95ad6,null))[_0x22b5('0x25')](saveUpdates(_0x1f6afe[_0x22b5('0x47')],null))[_0x22b5('0x25')](respondWithResult(_0xe95ad6,null))['catch'](handleError(_0xe95ad6,null));};exports['destroy']=function(_0x516627,_0x36979d){return db['MailServerOut']['find']({'where':{'id':_0x516627[_0x22b5('0x45')]['id']}})[_0x22b5('0x25')](handleEntityNotFound(_0x36979d,null))[_0x22b5('0x25')](removeEntity(_0x36979d,null))[_0x22b5('0x44')](handleError(_0x36979d,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index 823c221..2f68c78 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 _0x5244=['define','mail_servers_out','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailServerOut.attributes','exports'];(function(_0x571a17,_0x63fb3d){var _0x3ef337=function(_0x12096b){while(--_0x12096b){_0x571a17['push'](_0x571a17['shift']());}};_0x3ef337(++_0x63fb3d);}(_0x5244,0xe2));var _0x4524=function(_0x1df591,_0x216efc){_0x1df591=_0x1df591-0x0;var _0x5bedc7=_0x5244[_0x1df591];return _0x5bedc7;};'use strict';var _=require(_0x4524('0x0'));var util=require(_0x4524('0x1'));var logger=require(_0x4524('0x2'))(_0x4524('0x3'));var moment=require(_0x4524('0x4'));var BPromise=require(_0x4524('0x5'));var rp=require(_0x4524('0x6'));var fs=require('fs');var path=require(_0x4524('0x7'));var rimraf=require(_0x4524('0x8'));var config=require(_0x4524('0x9'));var attributes=require(_0x4524('0xa'));module[_0x4524('0xb')]=function(_0x15139e,_0x113283){return _0x15139e[_0x4524('0xc')]('MailServerOut',attributes,{'tableName':_0x4524('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x93ee=['rimraf','./mailServerOut.attributes','exports','define','MailServerOut','lodash','../../config/logger','api','bluebird','path'];(function(_0x3c4a4d,_0x1e2b93){var _0x2b6d0d=function(_0x56ba6f){while(--_0x56ba6f){_0x3c4a4d['push'](_0x3c4a4d['shift']());}};_0x2b6d0d(++_0x1e2b93);}(_0x93ee,0x1d1));var _0xe93e=function(_0x13f980,_0x1e1c56){_0x13f980=_0x13f980-0x0;var _0x27153c=_0x93ee[_0x13f980];return _0x27153c;};'use strict';var _=require(_0xe93e('0x0'));var util=require('util');var logger=require(_0xe93e('0x1'))(_0xe93e('0x2'));var moment=require('moment');var BPromise=require(_0xe93e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe93e('0x4'));var rimraf=require(_0xe93e('0x5'));var config=require('../../config/environment');var attributes=require(_0xe93e('0x6'));module[_0xe93e('0x7')]=function(_0x688edb,_0xdcbbfc){return _0x688edb[_0xe93e('0x8')](_0xe93e('0x9'),attributes,{'tableName':'mail_servers_out','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 066a2e9..295704f 100644 --- a/server/api/mailServerOut/mailServerOut.rpc.js +++ b/server/api/mailServerOut/mailServerOut.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1261=['then','info','MailServerOut,\x20%s,\x20%s','request\x20sent','MailServerOut,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x11b7b3,_0x197a85){var _0x2e5e5f=function(_0x26becd){while(--_0x26becd){_0x11b7b3['push'](_0x11b7b3['shift']());}};_0x2e5e5f(++_0x197a85);}(_0x1261,0x144));var _0x1126=function(_0x3bc82d,_0x59187f){_0x3bc82d=_0x3bc82d-0x0;var _0x2cfb3d=_0x1261[_0x3bc82d];return _0x2cfb3d;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('MailServerOut,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});} \ No newline at end of file +var _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(_0x58fe86,_0x19655f){var _0x3f0732=function(_0x1d0b4a){while(--_0x1d0b4a){_0x58fe86['push'](_0x58fe86['shift']());}};_0x3f0732(++_0x19655f);}(_0xadb5,0xad));var _0x5adb=function(_0xb17dce,_0x19e1a0){_0xb17dce=_0xb17dce-0x0;var _0x3fc1e9=_0xadb5[_0xb17dce];return _0x3fc1e9;};'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 diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index 8d347eb..79b9b35 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 _0xe296=['get','isAuthenticated','/describe','show','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x1cb7ee,_0x521c98){var _0x5764c1=function(_0x197731){while(--_0x197731){_0x1cb7ee['push'](_0x1cb7ee['shift']());}};_0x5764c1(++_0x521c98);}(_0xe296,0x186));var _0x6e29=function(_0x801bdb,_0x261b61){_0x801bdb=_0x801bdb-0x0;var _0xfe915c=_0xe296[_0x801bdb];return _0xfe915c;};'use strict';var multer=require(_0x6e29('0x0'));var util=require(_0x6e29('0x1'));var path=require(_0x6e29('0x2'));var timeout=require(_0x6e29('0x3'));var express=require('express');var router=express[_0x6e29('0x4')]();var fs_extra=require(_0x6e29('0x5'));var auth=require(_0x6e29('0x6'));var interaction=require(_0x6e29('0x7'));var config=require(_0x6e29('0x8'));var controller=require('./mailSubstatus.controller');router[_0x6e29('0x9')]('/',auth[_0x6e29('0xa')](),controller['index']);router[_0x6e29('0x9')](_0x6e29('0xb'),auth[_0x6e29('0xa')](),controller['describe']);router[_0x6e29('0x9')]('/:id',auth[_0x6e29('0xa')](),controller[_0x6e29('0xc')]);router[_0x6e29('0xd')]('/',auth[_0x6e29('0xa')](),controller[_0x6e29('0xe')]);router[_0x6e29('0xf')](_0x6e29('0x10'),auth[_0x6e29('0xa')](),controller[_0x6e29('0x11')]);router[_0x6e29('0x12')](_0x6e29('0x10'),auth['isAuthenticated'](),controller[_0x6e29('0x13')]);module[_0x6e29('0x14')]=router; \ No newline at end of file +var _0x3d2d=['../../config/environment','./mailSubstatus.controller','isAuthenticated','index','/describe','describe','get','/:id','post','create','put','update','delete','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x25eca9,_0x357208){var _0x423c06=function(_0x422edf){while(--_0x422edf){_0x25eca9['push'](_0x25eca9['shift']());}};_0x423c06(++_0x357208);}(_0x3d2d,0x143));var _0xd3d2=function(_0x179e11,_0xf65436){_0x179e11=_0x179e11-0x0;var _0x549f04=_0x3d2d[_0x179e11];return _0x549f04;};'use strict';var multer=require(_0xd3d2('0x0'));var util=require(_0xd3d2('0x1'));var path=require(_0xd3d2('0x2'));var timeout=require('connect-timeout');var express=require(_0xd3d2('0x3'));var router=express['Router']();var fs_extra=require(_0xd3d2('0x4'));var auth=require(_0xd3d2('0x5'));var interaction=require(_0xd3d2('0x6'));var config=require(_0xd3d2('0x7'));var controller=require(_0xd3d2('0x8'));router['get']('/',auth[_0xd3d2('0x9')](),controller[_0xd3d2('0xa')]);router['get'](_0xd3d2('0xb'),auth[_0xd3d2('0x9')](),controller[_0xd3d2('0xc')]);router[_0xd3d2('0xd')](_0xd3d2('0xe'),auth[_0xd3d2('0x9')](),controller['show']);router[_0xd3d2('0xf')]('/',auth[_0xd3d2('0x9')](),controller[_0xd3d2('0x10')]);router[_0xd3d2('0x11')](_0xd3d2('0xe'),auth[_0xd3d2('0x9')](),controller[_0xd3d2('0x12')]);router[_0xd3d2('0x13')]('/:id',auth[_0xd3d2('0x9')](),controller[_0xd3d2('0x14')]);module[_0xd3d2('0x15')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index dd43d4a..71d4d22 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 _0xafdd=['STRING','name','sequelize','exports'];(function(_0x5abde5,_0x13be16){var _0x2933fd=function(_0x684e38){while(--_0x684e38){_0x5abde5['push'](_0x5abde5['shift']());}};_0x2933fd(++_0x13be16);}(_0xafdd,0x19a));var _0xdafd=function(_0x1ed28b,_0x51376f){_0x1ed28b=_0x1ed28b-0x0;var _0x2d7746=_0xafdd[_0x1ed28b];return _0x2d7746;};'use strict';var Sequelize=require(_0xdafd('0x0'));module[_0xdafd('0x1')]={'name':{'type':Sequelize[_0xdafd('0x2')],'unique':_0xdafd('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xdafd('0x2')]}}; \ No newline at end of file +var _0xda19=['STRING','exports'];(function(_0x22a6e6,_0xac09f9){var _0x1a8b56=function(_0x142a8c){while(--_0x142a8c){_0x22a6e6['push'](_0x22a6e6['shift']());}};_0x1a8b56(++_0xac09f9);}(_0xda19,0xd5));var _0x9da1=function(_0x4670b1,_0x25b27f){_0x4670b1=_0x4670b1-0x0;var _0x49a73a=_0xda19[_0x4670b1];return _0x49a73a;};'use strict';var Sequelize=require('sequelize');module[_0x9da1('0x0')]={'name':{'type':Sequelize[_0x9da1('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x9da1('0x1')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index fde3886..db261a2 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 _0xea1b=['where','merge','VIRTUAL','options','includeAll','include','rows','show','params','catch','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','status','end','offset','undefined','count','set','Content-Range','json','apply','reject','update','then','destroy','sendStatus','error','stack','name','send','index','map','MailSubstatus','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','limit','order','sort','pick','filter'];(function(_0x2a8e1f,_0x53d9dd){var _0x3a965d=function(_0x5aab1a){while(--_0x5aab1a){_0x2a8e1f['push'](_0x2a8e1f['shift']());}};_0x3a965d(++_0x53d9dd);}(_0xea1b,0x144));var _0xbea1=function(_0xb38bae,_0x5d93a7){_0xb38bae=_0xb38bae-0x0;var _0x562e92=_0xea1b[_0xb38bae];return _0x562e92;};'use strict';var emlformat=require(_0xbea1('0x0'));var rimraf=require(_0xbea1('0x1'));var zipdir=require(_0xbea1('0x2'));var jsonpatch=require(_0xbea1('0x3'));var rp=require(_0xbea1('0x4'));var moment=require(_0xbea1('0x5'));var BPromise=require(_0xbea1('0x6'));var Mustache=require(_0xbea1('0x7'));var util=require(_0xbea1('0x8'));var path=require(_0xbea1('0x9'));var sox=require('sox');var csv=require(_0xbea1('0xa'));var ejs=require(_0xbea1('0xb'));var fs=require('fs');var fs_extra=require(_0xbea1('0xc'));var _=require(_0xbea1('0xd'));var squel=require(_0xbea1('0xe'));var crypto=require(_0xbea1('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xbea1('0x10'));var toCsv=require(_0xbea1('0xa'));var querystring=require(_0xbea1('0x11'));var Papa=require(_0xbea1('0x12'));var Redis=require(_0xbea1('0x13'));var authService=require(_0xbea1('0x14'));var qs=require(_0xbea1('0x15'));var as=require(_0xbea1('0x16'));var hardwareService=require(_0xbea1('0x17'));var logger=require('../../config/logger')(_0xbea1('0x18'));var utils=require('../../config/utils');var config=require(_0xbea1('0x19'));var licenseUtil=require(_0xbea1('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5c7638,_0x4d8058){_0x4d8058=_0x4d8058||0xcc;return function(_0x2cece8){if(_0x2cece8){return _0x5c7638['sendStatus'](_0x4d8058);}return _0x5c7638[_0xbea1('0x1b')](_0x4d8058)[_0xbea1('0x1c')]();};}function respondWithResult(_0x5650ec,_0x340da9){_0x340da9=_0x340da9||0xc8;return function(_0x2420d0){if(_0x2420d0){return _0x5650ec[_0xbea1('0x1b')](_0x340da9)['json'](_0x2420d0);}};}function respondWithFilteredResult(_0x2a9e38,_0x4225f8){return function(_0x14a4fd){if(_0x14a4fd){var _0x3c4d20=typeof _0x4225f8[_0xbea1('0x1d')]===_0xbea1('0x1e')&&typeof _0x4225f8['limit']===_0xbea1('0x1e');var _0x3e3c70=_0x14a4fd[_0xbea1('0x1f')];var _0x332b86=_0x3c4d20?0x0:_0x4225f8[_0xbea1('0x1d')];var _0x51bdea=_0x3c4d20?_0x14a4fd[_0xbea1('0x1f')]:_0x4225f8[_0xbea1('0x1d')]+_0x4225f8['limit'];var _0x4a5595;if(_0x51bdea>=_0x3e3c70){_0x51bdea=_0x3e3c70;_0x4a5595=0xc8;}else{_0x4a5595=0xce;}_0x2a9e38['status'](_0x4a5595);return _0x2a9e38[_0xbea1('0x20')](_0xbea1('0x21'),_0x332b86+'-'+_0x51bdea+'/'+_0x3e3c70)[_0xbea1('0x22')](_0x14a4fd);}return null;};}function patchUpdates(_0x2826c1){return function(_0x447fb6){try{jsonpatch[_0xbea1('0x23')](_0x447fb6,_0x2826c1,!![]);}catch(_0x333cd4){return BPromise[_0xbea1('0x24')](_0x333cd4);}return _0x447fb6['save']();};}function saveUpdates(_0x447a03,_0x1b6b03){return function(_0x441200){if(_0x441200){return _0x441200[_0xbea1('0x25')](_0x447a03)[_0xbea1('0x26')](function(_0x504602){return _0x504602;});}return null;};}function removeEntity(_0x339d98,_0x57ae6b){return function(_0xea8c8f){if(_0xea8c8f){return _0xea8c8f[_0xbea1('0x27')]()['then'](function(){_0x339d98[_0xbea1('0x1b')](0xcc)[_0xbea1('0x1c')]();});}};}function handleEntityNotFound(_0xbd2ad9,_0x198642){return function(_0xb3e4ff){if(!_0xb3e4ff){_0xbd2ad9[_0xbea1('0x28')](0x194);}return _0xb3e4ff;};}function handleError(_0x2c689b,_0x4955f7){_0x4955f7=_0x4955f7||0x1f4;return function(_0xa832fe){logger[_0xbea1('0x29')](_0xa832fe[_0xbea1('0x2a')]);if(_0xa832fe[_0xbea1('0x2b')]){delete _0xa832fe['name'];}_0x2c689b['status'](_0x4955f7)[_0xbea1('0x2c')](_0xa832fe);};}exports[_0xbea1('0x2d')]=function(_0x165155,_0x4716f8){var _0x1cf817={},_0x9c584b={},_0x2b25b2={'count':0x0,'rows':[]};var _0xe3aab2=_[_0xbea1('0x2e')](db[_0xbea1('0x2f')][_0xbea1('0x30')],function(_0x343b4e){return{'name':_0x343b4e[_0xbea1('0x31')],'type':_0x343b4e[_0xbea1('0x32')][_0xbea1('0x33')]};});_0x9c584b[_0xbea1('0x34')]=_['map'](_0xe3aab2,'name');_0x9c584b[_0xbea1('0x35')]=_[_0xbea1('0x36')](_0x165155[_0xbea1('0x35')]);_0x9c584b[_0xbea1('0x37')]=_[_0xbea1('0x38')](_0x9c584b[_0xbea1('0x34')],_0x9c584b[_0xbea1('0x35')]);_0x1cf817['attributes']=_['intersection'](_0x9c584b[_0xbea1('0x34')],qs[_0xbea1('0x39')](_0x165155[_0xbea1('0x35')][_0xbea1('0x39')]));_0x1cf817[_0xbea1('0x3a')]=_0x1cf817[_0xbea1('0x3a')][_0xbea1('0x3b')]?_0x1cf817['attributes']:_0x9c584b['model'];if(!_0x165155[_0xbea1('0x35')]['hasOwnProperty'](_0xbea1('0x3c'))){_0x1cf817[_0xbea1('0x3d')]=qs[_0xbea1('0x3d')](_0x165155['query'][_0xbea1('0x3d')]);_0x1cf817[_0xbea1('0x1d')]=qs['offset'](_0x165155[_0xbea1('0x35')]['offset']);}_0x1cf817[_0xbea1('0x3e')]=qs[_0xbea1('0x3f')](_0x165155['query'][_0xbea1('0x3f')]);_0x1cf817['where']=qs[_0xbea1('0x37')](_[_0xbea1('0x40')](_0x165155[_0xbea1('0x35')],_0x9c584b[_0xbea1('0x37')]),_0xe3aab2);if(_0x165155[_0xbea1('0x35')][_0xbea1('0x41')]){_0x1cf817[_0xbea1('0x42')]=_[_0xbea1('0x43')](_0x1cf817['where'],{'$or':_['map'](_0xe3aab2,function(_0x77e0bc){if(_0x77e0bc['type']!==_0xbea1('0x44')){var _0x19d5e3={};_0x19d5e3[_0x77e0bc['name']]={'$like':'%'+_0x165155[_0xbea1('0x35')][_0xbea1('0x41')]+'%'};return _0x19d5e3;}})});}_0x1cf817=_[_0xbea1('0x43')]({},_0x1cf817,_0x165155[_0xbea1('0x45')]);var _0x11e5dc={'where':_0x1cf817['where']};return db['MailSubstatus']['count'](_0x11e5dc)[_0xbea1('0x26')](function(_0xd64f38){_0x2b25b2['count']=_0xd64f38;if(_0x165155['query'][_0xbea1('0x46')]){_0x1cf817[_0xbea1('0x47')]=[{'all':!![]}];}return db['MailSubstatus']['findAll'](_0x1cf817);})['then'](function(_0x243619){_0x2b25b2[_0xbea1('0x48')]=_0x243619;return _0x2b25b2;})[_0xbea1('0x26')](respondWithFilteredResult(_0x4716f8,_0x1cf817))['catch'](handleError(_0x4716f8,null));};exports[_0xbea1('0x49')]=function(_0x2a2aef,_0x220bf4){var _0x941cf0={'raw':!![],'where':{'id':_0x2a2aef[_0xbea1('0x4a')]['id']}},_0x2935f2={};_0x2935f2[_0xbea1('0x34')]=_['keys'](db[_0xbea1('0x2f')][_0xbea1('0x30')]);_0x2935f2['query']=_['keys'](_0x2a2aef[_0xbea1('0x35')]);_0x2935f2['filters']=_['intersection'](_0x2935f2[_0xbea1('0x34')],_0x2935f2[_0xbea1('0x35')]);_0x941cf0['attributes']=_['intersection'](_0x2935f2[_0xbea1('0x34')],qs[_0xbea1('0x39')](_0x2a2aef[_0xbea1('0x35')][_0xbea1('0x39')]));_0x941cf0[_0xbea1('0x3a')]=_0x941cf0[_0xbea1('0x3a')]['length']?_0x941cf0[_0xbea1('0x3a')]:_0x2935f2['model'];if(_0x2a2aef[_0xbea1('0x35')]['includeAll']){_0x941cf0[_0xbea1('0x47')]=[{'all':!![]}];}_0x941cf0=_['merge']({},_0x941cf0,_0x2a2aef['options']);return db[_0xbea1('0x2f')]['find'](_0x941cf0)['then'](handleEntityNotFound(_0x220bf4,null))[_0xbea1('0x26')](respondWithResult(_0x220bf4,null))[_0xbea1('0x4b')](handleError(_0x220bf4,null));};exports['create']=function(_0x3c12e0,_0x372d30){return db['MailSubstatus']['create'](_0x3c12e0[_0xbea1('0x4c')],{})[_0xbea1('0x26')](respondWithResult(_0x372d30,0xc9))[_0xbea1('0x4b')](handleError(_0x372d30,null));};exports[_0xbea1('0x25')]=function(_0x4c1d34,_0x37daac){if(_0x4c1d34[_0xbea1('0x4c')]['id']){delete _0x4c1d34[_0xbea1('0x4c')]['id'];}return db[_0xbea1('0x2f')]['find']({'where':{'id':_0x4c1d34[_0xbea1('0x4a')]['id']}})['then'](handleEntityNotFound(_0x37daac,null))[_0xbea1('0x26')](saveUpdates(_0x4c1d34['body'],null))[_0xbea1('0x26')](respondWithResult(_0x37daac,null))[_0xbea1('0x4b')](handleError(_0x37daac,null));};exports['destroy']=function(_0x114077,_0xda2374){return db[_0xbea1('0x2f')]['find']({'where':{'id':_0x114077['params']['id']}})['then'](handleEntityNotFound(_0xda2374,null))[_0xbea1('0x26')](removeEntity(_0xda2374,null))[_0xbea1('0x4b')](handleError(_0xda2374,null));};exports[_0xbea1('0x4d')]=function(_0x149f08,_0x290f30){return db[_0xbea1('0x2f')][_0xbea1('0x4d')]()[_0xbea1('0x26')](respondWithResult(_0x290f30,null))[_0xbea1('0x4b')](handleError(_0x290f30,null));}; \ No newline at end of file +var _0x0269=['bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','Content-Range','apply','reject','save','destroy','then','error','stack','name','send','index','map','MailSubstatus','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','keys','length','find','create','body','update','params','describe','eml-format','zip-dir','request-promise'];(function(_0x38ae35,_0x16c078){var _0x4b3e8f=function(_0x1d182a){while(--_0x1d182a){_0x38ae35['push'](_0x38ae35['shift']());}};_0x4b3e8f(++_0x16c078);}(_0x0269,0x135));var _0x9026=function(_0xcd60be,_0x28dcfa){_0xcd60be=_0xcd60be-0x0;var _0x51bec0=_0x0269[_0xcd60be];return _0x51bec0;};'use strict';var emlformat=require(_0x9026('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9026('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9026('0x2'));var moment=require('moment');var BPromise=require(_0x9026('0x3'));var Mustache=require(_0x9026('0x4'));var util=require(_0x9026('0x5'));var path=require(_0x9026('0x6'));var sox=require('sox');var csv=require(_0x9026('0x7'));var ejs=require(_0x9026('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x9026('0x9'));var crypto=require(_0x9026('0xa'));var jsforce=require(_0x9026('0xb'));var deskjs=require(_0x9026('0xc'));var toCsv=require('to-csv');var querystring=require(_0x9026('0xd'));var Papa=require(_0x9026('0xe'));var Redis=require(_0x9026('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x9026('0x10'));var as=require(_0x9026('0x11'));var hardwareService=require(_0x9026('0x12'));var logger=require('../../config/logger')(_0x9026('0x13'));var utils=require('../../config/utils');var config=require(_0x9026('0x14'));var licenseUtil=require(_0x9026('0x15'));var db=require(_0x9026('0x16'))['db'];function respondWithStatusCode(_0x2148f0,_0x40f526){_0x40f526=_0x40f526||0xcc;return function(_0x40b5dd){if(_0x40b5dd){return _0x2148f0[_0x9026('0x17')](_0x40f526);}return _0x2148f0['status'](_0x40f526)[_0x9026('0x18')]();};}function respondWithResult(_0x4ee699,_0x385afc){_0x385afc=_0x385afc||0xc8;return function(_0x2612cd){if(_0x2612cd){return _0x4ee699[_0x9026('0x19')](_0x385afc)[_0x9026('0x1a')](_0x2612cd);}};}function respondWithFilteredResult(_0x11c0d1,_0x421ee2){return function(_0x142465){if(_0x142465){var _0x1eb679=typeof _0x421ee2['offset']===_0x9026('0x1b')&&typeof _0x421ee2[_0x9026('0x1c')]==='undefined';var _0xc68011=_0x142465[_0x9026('0x1d')];var _0x15b3ab=_0x1eb679?0x0:_0x421ee2[_0x9026('0x1e')];var _0x1d1613=_0x1eb679?_0x142465[_0x9026('0x1d')]:_0x421ee2[_0x9026('0x1e')]+_0x421ee2[_0x9026('0x1c')];var _0x52edf1;if(_0x1d1613>=_0xc68011){_0x1d1613=_0xc68011;_0x52edf1=0xc8;}else{_0x52edf1=0xce;}_0x11c0d1[_0x9026('0x19')](_0x52edf1);return _0x11c0d1['set'](_0x9026('0x1f'),_0x15b3ab+'-'+_0x1d1613+'/'+_0xc68011)['json'](_0x142465);}return null;};}function patchUpdates(_0x2a9bf0){return function(_0x1b03af){try{jsonpatch[_0x9026('0x20')](_0x1b03af,_0x2a9bf0,!![]);}catch(_0x22a77c){return BPromise[_0x9026('0x21')](_0x22a77c);}return _0x1b03af[_0x9026('0x22')]();};}function saveUpdates(_0x71a263,_0x39f515){return function(_0x12e0b3){if(_0x12e0b3){return _0x12e0b3['update'](_0x71a263)['then'](function(_0x7b962){return _0x7b962;});}return null;};}function removeEntity(_0x134221,_0x2968fb){return function(_0x82a8e0){if(_0x82a8e0){return _0x82a8e0[_0x9026('0x23')]()[_0x9026('0x24')](function(){_0x134221[_0x9026('0x19')](0xcc)[_0x9026('0x18')]();});}};}function handleEntityNotFound(_0x775596,_0x4293df){return function(_0xde5c83){if(!_0xde5c83){_0x775596[_0x9026('0x17')](0x194);}return _0xde5c83;};}function handleError(_0x38fd9c,_0x2ace13){_0x2ace13=_0x2ace13||0x1f4;return function(_0x28dba4){logger[_0x9026('0x25')](_0x28dba4[_0x9026('0x26')]);if(_0x28dba4[_0x9026('0x27')]){delete _0x28dba4[_0x9026('0x27')];}_0x38fd9c['status'](_0x2ace13)[_0x9026('0x28')](_0x28dba4);};}exports[_0x9026('0x29')]=function(_0x30c988,_0x103ce7){var _0x17dc25={},_0x3cead8={},_0x23cf05={'count':0x0,'rows':[]};var _0xedb8bb=_[_0x9026('0x2a')](db[_0x9026('0x2b')][_0x9026('0x2c')],function(_0x5d2672){return{'name':_0x5d2672[_0x9026('0x2d')],'type':_0x5d2672[_0x9026('0x2e')][_0x9026('0x2f')]};});_0x3cead8[_0x9026('0x30')]=_[_0x9026('0x2a')](_0xedb8bb,_0x9026('0x27'));_0x3cead8[_0x9026('0x31')]=_['keys'](_0x30c988[_0x9026('0x31')]);_0x3cead8['filters']=_[_0x9026('0x32')](_0x3cead8[_0x9026('0x30')],_0x3cead8[_0x9026('0x31')]);_0x17dc25[_0x9026('0x33')]=_[_0x9026('0x32')](_0x3cead8[_0x9026('0x30')],qs['fields'](_0x30c988[_0x9026('0x31')][_0x9026('0x34')]));_0x17dc25[_0x9026('0x33')]=_0x17dc25[_0x9026('0x33')]['length']?_0x17dc25[_0x9026('0x33')]:_0x3cead8[_0x9026('0x30')];if(!_0x30c988['query'][_0x9026('0x35')](_0x9026('0x36'))){_0x17dc25[_0x9026('0x1c')]=qs[_0x9026('0x1c')](_0x30c988[_0x9026('0x31')][_0x9026('0x1c')]);_0x17dc25[_0x9026('0x1e')]=qs[_0x9026('0x1e')](_0x30c988['query'][_0x9026('0x1e')]);}_0x17dc25[_0x9026('0x37')]=qs['sort'](_0x30c988[_0x9026('0x31')][_0x9026('0x38')]);_0x17dc25[_0x9026('0x39')]=qs[_0x9026('0x3a')](_[_0x9026('0x3b')](_0x30c988[_0x9026('0x31')],_0x3cead8[_0x9026('0x3a')]),_0xedb8bb);if(_0x30c988[_0x9026('0x31')]['filter']){_0x17dc25[_0x9026('0x39')]=_[_0x9026('0x3c')](_0x17dc25[_0x9026('0x39')],{'$or':_[_0x9026('0x2a')](_0xedb8bb,function(_0x1fc5cc){if(_0x1fc5cc[_0x9026('0x2e')]!==_0x9026('0x3d')){var _0x4c950e={};_0x4c950e[_0x1fc5cc[_0x9026('0x27')]]={'$like':'%'+_0x30c988['query'][_0x9026('0x3e')]+'%'};return _0x4c950e;}})});}_0x17dc25=_[_0x9026('0x3c')]({},_0x17dc25,_0x30c988[_0x9026('0x3f')]);var _0x3e106a={'where':_0x17dc25['where']};return db['MailSubstatus'][_0x9026('0x1d')](_0x3e106a)[_0x9026('0x24')](function(_0x51e719){_0x23cf05['count']=_0x51e719;if(_0x30c988['query'][_0x9026('0x40')]){_0x17dc25[_0x9026('0x41')]=[{'all':!![]}];}return db['MailSubstatus'][_0x9026('0x42')](_0x17dc25);})[_0x9026('0x24')](function(_0x1a77bd){_0x23cf05[_0x9026('0x43')]=_0x1a77bd;return _0x23cf05;})[_0x9026('0x24')](respondWithFilteredResult(_0x103ce7,_0x17dc25))[_0x9026('0x44')](handleError(_0x103ce7,null));};exports[_0x9026('0x45')]=function(_0x2c24f4,_0x5e18cf){var _0x2d6801={'raw':!![],'where':{'id':_0x2c24f4['params']['id']}},_0x2ece36={};_0x2ece36['model']=_['keys'](db[_0x9026('0x2b')][_0x9026('0x2c')]);_0x2ece36[_0x9026('0x31')]=_[_0x9026('0x46')](_0x2c24f4[_0x9026('0x31')]);_0x2ece36['filters']=_[_0x9026('0x32')](_0x2ece36['model'],_0x2ece36[_0x9026('0x31')]);_0x2d6801[_0x9026('0x33')]=_[_0x9026('0x32')](_0x2ece36[_0x9026('0x30')],qs['fields'](_0x2c24f4['query'][_0x9026('0x34')]));_0x2d6801[_0x9026('0x33')]=_0x2d6801[_0x9026('0x33')][_0x9026('0x47')]?_0x2d6801[_0x9026('0x33')]:_0x2ece36[_0x9026('0x30')];if(_0x2c24f4['query'][_0x9026('0x40')]){_0x2d6801['include']=[{'all':!![]}];}_0x2d6801=_[_0x9026('0x3c')]({},_0x2d6801,_0x2c24f4[_0x9026('0x3f')]);return db['MailSubstatus'][_0x9026('0x48')](_0x2d6801)['then'](handleEntityNotFound(_0x5e18cf,null))[_0x9026('0x24')](respondWithResult(_0x5e18cf,null))['catch'](handleError(_0x5e18cf,null));};exports[_0x9026('0x49')]=function(_0x48ceb1,_0x530244){return db[_0x9026('0x2b')][_0x9026('0x49')](_0x48ceb1[_0x9026('0x4a')],{})['then'](respondWithResult(_0x530244,0xc9))[_0x9026('0x44')](handleError(_0x530244,null));};exports[_0x9026('0x4b')]=function(_0x446cd0,_0x442e5a){if(_0x446cd0[_0x9026('0x4a')]['id']){delete _0x446cd0['body']['id'];}return db[_0x9026('0x2b')][_0x9026('0x48')]({'where':{'id':_0x446cd0[_0x9026('0x4c')]['id']}})[_0x9026('0x24')](handleEntityNotFound(_0x442e5a,null))[_0x9026('0x24')](saveUpdates(_0x446cd0[_0x9026('0x4a')],null))['then'](respondWithResult(_0x442e5a,null))[_0x9026('0x44')](handleError(_0x442e5a,null));};exports['destroy']=function(_0x2e3025,_0xf0a02e){return db['MailSubstatus'][_0x9026('0x48')]({'where':{'id':_0x2e3025[_0x9026('0x4c')]['id']}})[_0x9026('0x24')](handleEntityNotFound(_0xf0a02e,null))[_0x9026('0x24')](removeEntity(_0xf0a02e,null))[_0x9026('0x44')](handleError(_0xf0a02e,null));};exports[_0x9026('0x4d')]=function(_0x2d038c,_0x3c338e){return db[_0x9026('0x2b')][_0x9026('0x4d')]()['then'](respondWithResult(_0x3c338e,null))[_0x9026('0x44')](handleError(_0x3c338e,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.events.js b/server/api/mailSubstatus/mailSubstatus.events.js index ab4c092..3f8a765 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 _0xa2a5=['update','hasOwnProperty','exports','events','MailSubstatus','setMaxListeners'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xa2a5,0xa5));var _0x5a2a=function(_0x40c208,_0x3db7d8){_0x40c208=_0x40c208-0x0;var _0x38904e=_0xa2a5[_0x40c208];return _0x38904e;};'use strict';var EventEmitter=require(_0x5a2a('0x0'));var MailSubstatus=require('../../mysqldb')['db'][_0x5a2a('0x1')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0x5a2a('0x2')](0x0);var events={'afterUpdate':_0x5a2a('0x3')};function emitEvent(_0x5b4ac5){return function(_0x500641,_0x1ac05b,_0x3baff2){MailSubstatusEvents['emit'](_0x5b4ac5+':'+_0x500641['id'],_0x500641);MailSubstatusEvents['emit'](_0x5b4ac5,_0x500641);_0x3baff2(null);};}for(var e in events){if(events[_0x5a2a('0x4')](e)){var event=events[e];MailSubstatus['hook'](e,emitEvent(event));}}module[_0x5a2a('0x5')]=MailSubstatusEvents; \ No newline at end of file +var _0x7761=['hasOwnProperty','hook','../../mysqldb','setMaxListeners','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7761,0xd4));var _0x1776=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7761[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require('events');var MailSubstatus=require(_0x1776('0x0'))['db']['MailSubstatus'];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0x1776('0x1')](0x0);var events={'afterUpdate':_0x1776('0x2')};function emitEvent(_0x3ec950){return function(_0x54fed5,_0x5a7171,_0x35cb8f){MailSubstatusEvents['emit'](_0x3ec950+':'+_0x54fed5['id'],_0x54fed5);MailSubstatusEvents['emit'](_0x3ec950,_0x54fed5);_0x35cb8f(null);};}for(var e in events){if(events[_0x1776('0x3')](e)){var event=events[e];MailSubstatus[_0x1776('0x4')](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 1aa1db9..28f5001 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 _0xe8fd=['MailSubstatus','mail_substatuses','name','mailSubstatus','then','catch','./mailSubstatus.attributes','exports','models'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xe8fd,0xd5));var _0xde8f=function(_0x47fd36,_0x41535d){_0x47fd36=_0x47fd36-0x0;var _0x21a0fc=_0xe8fd[_0x47fd36];return _0x21a0fc;};'use strict';var attributes=require(_0xde8f('0x0'));module[_0xde8f('0x1')]=function(_0xcaf80){var _0x30ce8d=_0xcaf80[_0xde8f('0x2')];return _0xcaf80['define'](_0xde8f('0x3'),attributes,{'tableName':_0xde8f('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x24bf67,_0x1b11e2,_0x21b219){return _0x30ce8d['Condition']['update']({'value':_0x24bf67[_0xde8f('0x5')]},{'where':{'field':_0xde8f('0x6'),'value':_0x24bf67['_previousDataValues']['name']}})[_0xde8f('0x7')](function(){_0x21b219();})[_0xde8f('0x8')](function(_0x319d67){_0x21b219(_0x319d67);});}}});}; \ No newline at end of file +var _0xb249=['then','catch','./mailSubstatus.attributes','exports','models','define','MailSubstatus','mail_substatuses','Condition','update','name','_previousDataValues'];(function(_0x154f75,_0xd2b043){var _0x219e66=function(_0x4cb4d6){while(--_0x4cb4d6){_0x154f75['push'](_0x154f75['shift']());}};_0x219e66(++_0xd2b043);}(_0xb249,0x18e));var _0x9b24=function(_0x14fcdf,_0x581032){_0x14fcdf=_0x14fcdf-0x0;var _0x85f8d4=_0xb249[_0x14fcdf];return _0x85f8d4;};'use strict';var attributes=require(_0x9b24('0x0'));module[_0x9b24('0x1')]=function(_0x5e673a){var _0x1b5c9e=_0x5e673a[_0x9b24('0x2')];return _0x5e673a[_0x9b24('0x3')](_0x9b24('0x4'),attributes,{'tableName':_0x9b24('0x5'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x49d40c,_0xe18543,_0x4cff73){return _0x1b5c9e[_0x9b24('0x6')][_0x9b24('0x7')]({'value':_0x49d40c[_0x9b24('0x8')]},{'where':{'field':'mailSubstatus','value':_0x49d40c[_0x9b24('0x9')]['name']}})[_0x9b24('0xa')](function(){_0x4cff73();})[_0x9b24('0xb')](function(_0x31ec11){_0x4cff73(_0x31ec11);});}}});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index 10a5793..951b4cc 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 _0x1b76=['stringify','error','code','message','result','catch','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','http','request','then','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s'];(function(_0x4e9d3c,_0x1f4b98){var _0x2d0825=function(_0x384676){while(--_0x384676){_0x4e9d3c['push'](_0x4e9d3c['shift']());}};_0x2d0825(++_0x1f4b98);}(_0x1b76,0x1be));var _0x61b7=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x1b76[_0x2b4411];return _0x8e41ef;};'use strict';var _=require('lodash');var util=require(_0x61b7('0x0'));var moment=require(_0x61b7('0x1'));var BPromise=require('bluebird');var rs=require(_0x61b7('0x2'));var fs=require('fs');var Redis=require(_0x61b7('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x61b7('0x4'));var logger=require(_0x61b7('0x5'))(_0x61b7('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x61b7('0x7')][_0x61b7('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x49de42,_0x4e128e,_0x490572){return new BPromise(function(_0x10c1d9,_0x60fff6){return client[_0x61b7('0x9')](_0x49de42,_0x490572)[_0x61b7('0xa')](function(_0x26d83c){logger[_0x61b7('0xb')](_0x61b7('0xc'),_0x4e128e,_0x61b7('0xd'));logger[_0x61b7('0xe')](_0x61b7('0xf'),_0x4e128e,'request\x20sent',JSON[_0x61b7('0x10')](_0x26d83c));if(_0x26d83c[_0x61b7('0x11')]){if(_0x26d83c[_0x61b7('0x11')][_0x61b7('0x12')]===0x1f4){logger[_0x61b7('0x11')](_0x61b7('0xc'),_0x4e128e,_0x26d83c[_0x61b7('0x11')]['message']);return _0x60fff6(_0x26d83c[_0x61b7('0x11')][_0x61b7('0x13')]);}logger[_0x61b7('0x11')](_0x61b7('0xc'),_0x4e128e,_0x26d83c[_0x61b7('0x11')][_0x61b7('0x13')]);return _0x10c1d9(_0x26d83c['error'][_0x61b7('0x13')]);}else{logger[_0x61b7('0xb')]('MailSubstatus,\x20%s,\x20%s',_0x4e128e,_0x61b7('0xd'));_0x10c1d9(_0x26d83c[_0x61b7('0x14')][_0x61b7('0x13')]);}})[_0x61b7('0x15')](function(_0x28d955){logger[_0x61b7('0x11')](_0x61b7('0xc'),_0x4e128e,_0x28d955);_0x60fff6(_0x28d955);});});} \ No newline at end of file +var _0x9fe9=['info','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','request'];(function(_0x36ed3c,_0x44a00a){var _0x52a2e0=function(_0x3f7af9){while(--_0x3f7af9){_0x36ed3c['push'](_0x36ed3c['shift']());}};_0x52a2e0(++_0x44a00a);}(_0x9fe9,0x184));var _0x99fe=function(_0x229112,_0x4c445a){_0x229112=_0x229112-0x0;var _0x400a9d=_0x9fe9[_0x229112];return _0x400a9d;};'use strict';var _=require(_0x99fe('0x0'));var util=require(_0x99fe('0x1'));var moment=require(_0x99fe('0x2'));var BPromise=require('bluebird');var rs=require(_0x99fe('0x3'));var fs=require('fs');var Redis=require(_0x99fe('0x4'));var db=require(_0x99fe('0x5'))['db'];var utils=require(_0x99fe('0x6'));var logger=require(_0x99fe('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x99fe('0x8'));var client=jayson['client'][_0x99fe('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5de96d,_0x30837c,_0x4fbd52){return new BPromise(function(_0x158ffd,_0x8f9053){return client[_0x99fe('0xa')](_0x5de96d,_0x4fbd52)['then'](function(_0x5efbde){logger[_0x99fe('0xb')](_0x99fe('0xc'),_0x30837c,_0x99fe('0xd'));logger[_0x99fe('0xe')](_0x99fe('0xf'),_0x30837c,_0x99fe('0xd'),JSON[_0x99fe('0x10')](_0x5efbde));if(_0x5efbde['error']){if(_0x5efbde[_0x99fe('0x11')]['code']===0x1f4){logger[_0x99fe('0x11')](_0x99fe('0xc'),_0x30837c,_0x5efbde[_0x99fe('0x11')]['message']);return _0x8f9053(_0x5efbde['error'][_0x99fe('0x12')]);}logger[_0x99fe('0x11')](_0x99fe('0xc'),_0x30837c,_0x5efbde['error'][_0x99fe('0x12')]);return _0x158ffd(_0x5efbde[_0x99fe('0x11')]['message']);}else{logger[_0x99fe('0xb')]('MailSubstatus,\x20%s,\x20%s',_0x30837c,_0x99fe('0xd'));_0x158ffd(_0x5efbde[_0x99fe('0x13')][_0x99fe('0x12')]);}})[_0x99fe('0x14')](function(_0x3f86c8){logger[_0x99fe('0x11')]('MailSubstatus,\x20%s,\x20%s',_0x30837c,_0x3f86c8);_0x8f9053(_0x3f86c8);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index 89a52b6..40ec84a 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 _0x6afd=['/:id','show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailTransferReport.controller','get','/describe','isAuthenticated','describe'];(function(_0x2332d3,_0x4db5a4){var _0x565848=function(_0x8a0adf){while(--_0x8a0adf){_0x2332d3['push'](_0x2332d3['shift']());}};_0x565848(++_0x4db5a4);}(_0x6afd,0x1d6));var _0xd6af=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0x6afd[_0x3635ce];return _0x97ecd0;};'use strict';var multer=require(_0xd6af('0x0'));var util=require(_0xd6af('0x1'));var path=require(_0xd6af('0x2'));var timeout=require(_0xd6af('0x3'));var express=require(_0xd6af('0x4'));var router=express[_0xd6af('0x5')]();var fs_extra=require(_0xd6af('0x6'));var auth=require(_0xd6af('0x7'));var interaction=require(_0xd6af('0x8'));var config=require('../../config/environment');var controller=require(_0xd6af('0x9'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xd6af('0xa')](_0xd6af('0xb'),auth[_0xd6af('0xc')](),controller[_0xd6af('0xd')]);router['get'](_0xd6af('0xe'),auth[_0xd6af('0xc')](),controller[_0xd6af('0xf')]);router[_0xd6af('0x10')]('/',auth['isAuthenticated'](),controller[_0xd6af('0x11')]);router['put'](_0xd6af('0xe'),auth[_0xd6af('0xc')](),controller[_0xd6af('0x12')]);router[_0xd6af('0x13')]('/:id',auth['isAuthenticated'](),controller[_0xd6af('0x14')]);module[_0xd6af('0x15')]=router; \ No newline at end of file +var _0xe98a=['describe','show','post','create','put','/:id','delete','path','express','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','get','index','/describe','isAuthenticated'];(function(_0x467aca,_0x38cb17){var _0x435d68=function(_0x5c41cd){while(--_0x5c41cd){_0x467aca['push'](_0x467aca['shift']());}};_0x435d68(++_0x38cb17);}(_0xe98a,0x87));var _0xae98=function(_0x49ad79,_0x48ee93){_0x49ad79=_0x49ad79-0x0;var _0xa4e38a=_0xe98a[_0x49ad79];return _0xa4e38a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xae98('0x0'));var timeout=require('connect-timeout');var express=require(_0xae98('0x1'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xae98('0x2'));var config=require(_0xae98('0x3'));var controller=require(_0xae98('0x4'));router[_0xae98('0x5')]('/',auth['isAuthenticated'](),controller[_0xae98('0x6')]);router[_0xae98('0x5')](_0xae98('0x7'),auth[_0xae98('0x8')](),controller[_0xae98('0x9')]);router[_0xae98('0x5')]('/:id',auth[_0xae98('0x8')](),controller[_0xae98('0xa')]);router[_0xae98('0xb')]('/',auth['isAuthenticated'](),controller[_0xae98('0xc')]);router[_0xae98('0xd')](_0xae98('0xe'),auth[_0xae98('0x8')](),controller['update']);router[_0xae98('0xf')](_0xae98('0xe'),auth[_0xae98('0x8')](),controller['destroy']);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 f0a85ab..f816bf6 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 _0x9c44=['ENUM','account','agent','queue','NOW','exports','STRING'];(function(_0x2c1841,_0x505204){var _0x28d148=function(_0x5be79f){while(--_0x5be79f){_0x2c1841['push'](_0x2c1841['shift']());}};_0x28d148(++_0x505204);}(_0x9c44,0x178));var _0x49c4=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x9c44[_0xfae23b];return _0x200640;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x49c4('0x0')]={'uniqueid':{'type':Sequelize[_0x49c4('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x49c4('0x2')](_0x49c4('0x3'),_0x49c4('0x4'),_0x49c4('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x49c4('0x6')]}}; \ No newline at end of file +var _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x2510e3,_0x3c9772){var _0x5d9e48=function(_0x517638){while(--_0x517638){_0x2510e3['push'](_0x2510e3['shift']());}};_0x5d9e48(++_0x3c9772);}(_0xf4eb,0xec));var _0xbf4e=function(_0x58ac15,_0x5921f7){_0x58ac15=_0x58ac15-0x0;var _0x58b6da=_0xf4eb[_0x58ac15];return _0x58b6da;};'use strict';var moment=require(_0xbf4e('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xbf4e('0x1'),'agent','queue'),'allowNull':![],'defaultValue':_0xbf4e('0x2')},'transferredAt':{'type':Sequelize[_0xbf4e('0x3')],'allowNull':![],'defaultValue':Sequelize[_0xbf4e('0x4')]}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index a43b506..cbbb1b4 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 _0x5e5d=['send','MailTransferReport','rawAttributes','fieldName','type','key','model','map','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','include','findAll','catch','params','keys','includeAll','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','Content-Range','reject','update','then','destroy','end','error','stack','name'];(function(_0x4d5c2e,_0x46e44d){var _0x2b1e49=function(_0x47e549){while(--_0x47e549){_0x4d5c2e['push'](_0x4d5c2e['shift']());}};_0x2b1e49(++_0x46e44d);}(_0x5e5d,0x19d));var _0xd5e5=function(_0x42d857,_0x3f0f87){_0x42d857=_0x42d857-0x0;var _0x2899ba=_0x5e5d[_0x42d857];return _0x2899ba;};'use strict';var emlformat=require(_0xd5e5('0x0'));var rimraf=require(_0xd5e5('0x1'));var zipdir=require(_0xd5e5('0x2'));var jsonpatch=require(_0xd5e5('0x3'));var rp=require(_0xd5e5('0x4'));var moment=require(_0xd5e5('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xd5e5('0x6'));var util=require(_0xd5e5('0x7'));var path=require('path');var sox=require(_0xd5e5('0x8'));var csv=require(_0xd5e5('0x9'));var ejs=require(_0xd5e5('0xa'));var fs=require('fs');var fs_extra=require(_0xd5e5('0xb'));var _=require(_0xd5e5('0xc'));var squel=require(_0xd5e5('0xd'));var crypto=require(_0xd5e5('0xe'));var jsforce=require(_0xd5e5('0xf'));var deskjs=require(_0xd5e5('0x10'));var toCsv=require('to-csv');var querystring=require(_0xd5e5('0x11'));var Papa=require(_0xd5e5('0x12'));var Redis=require(_0xd5e5('0x13'));var authService=require(_0xd5e5('0x14'));var qs=require(_0xd5e5('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd5e5('0x16'));var logger=require(_0xd5e5('0x17'))(_0xd5e5('0x18'));var utils=require('../../config/utils');var config=require(_0xd5e5('0x19'));var licenseUtil=require(_0xd5e5('0x1a'));var db=require(_0xd5e5('0x1b'))['db'];function respondWithStatusCode(_0x4f17a6,_0x5c304c){_0x5c304c=_0x5c304c||0xcc;return function(_0x4db035){if(_0x4db035){return _0x4f17a6['sendStatus'](_0x5c304c);}return _0x4f17a6[_0xd5e5('0x1c')](_0x5c304c)['end']();};}function respondWithResult(_0x5ce989,_0x19ac16){_0x19ac16=_0x19ac16||0xc8;return function(_0x5cc01d){if(_0x5cc01d){return _0x5ce989[_0xd5e5('0x1c')](_0x19ac16)[_0xd5e5('0x1d')](_0x5cc01d);}};}function respondWithFilteredResult(_0x48e57f,_0x4b5197){return function(_0x3947f2){if(_0x3947f2){var _0x54a36b=typeof _0x4b5197[_0xd5e5('0x1e')]===_0xd5e5('0x1f')&&typeof _0x4b5197[_0xd5e5('0x20')]===_0xd5e5('0x1f');var _0x5445b9=_0x3947f2[_0xd5e5('0x21')];var _0x22102e=_0x54a36b?0x0:_0x4b5197[_0xd5e5('0x1e')];var _0x4ffc3b=_0x54a36b?_0x3947f2[_0xd5e5('0x21')]:_0x4b5197[_0xd5e5('0x1e')]+_0x4b5197[_0xd5e5('0x20')];var _0x4e981a;if(_0x4ffc3b>=_0x5445b9){_0x4ffc3b=_0x5445b9;_0x4e981a=0xc8;}else{_0x4e981a=0xce;}_0x48e57f[_0xd5e5('0x1c')](_0x4e981a);return _0x48e57f['set'](_0xd5e5('0x22'),_0x22102e+'-'+_0x4ffc3b+'/'+_0x5445b9)['json'](_0x3947f2);}return null;};}function patchUpdates(_0x1d605a){return function(_0x2b08a){try{jsonpatch['apply'](_0x2b08a,_0x1d605a,!![]);}catch(_0x7da814){return BPromise[_0xd5e5('0x23')](_0x7da814);}return _0x2b08a['save']();};}function saveUpdates(_0x412023,_0x3ea003){return function(_0x5bda97){if(_0x5bda97){return _0x5bda97[_0xd5e5('0x24')](_0x412023)[_0xd5e5('0x25')](function(_0x301284){return _0x301284;});}return null;};}function removeEntity(_0x5729cb,_0x3b40bb){return function(_0x1e2ade){if(_0x1e2ade){return _0x1e2ade[_0xd5e5('0x26')]()['then'](function(){_0x5729cb[_0xd5e5('0x1c')](0xcc)[_0xd5e5('0x27')]();});}};}function handleEntityNotFound(_0x5aa7c1,_0x3b52d7){return function(_0x109929){if(!_0x109929){_0x5aa7c1['sendStatus'](0x194);}return _0x109929;};}function handleError(_0x57b984,_0x5090b2){_0x5090b2=_0x5090b2||0x1f4;return function(_0x49ec53){logger[_0xd5e5('0x28')](_0x49ec53[_0xd5e5('0x29')]);if(_0x49ec53['name']){delete _0x49ec53[_0xd5e5('0x2a')];}_0x57b984['status'](_0x5090b2)[_0xd5e5('0x2b')](_0x49ec53);};}exports['index']=function(_0x2e607e,_0x4ae860){var _0x77f601={},_0x1586bf={},_0x566bd7={'count':0x0,'rows':[]};var _0xa7c21c=_['map'](db[_0xd5e5('0x2c')][_0xd5e5('0x2d')],function(_0x28628a){return{'name':_0x28628a[_0xd5e5('0x2e')],'type':_0x28628a[_0xd5e5('0x2f')][_0xd5e5('0x30')]};});_0x1586bf[_0xd5e5('0x31')]=_[_0xd5e5('0x32')](_0xa7c21c,'name');_0x1586bf[_0xd5e5('0x33')]=_['keys'](_0x2e607e[_0xd5e5('0x33')]);_0x1586bf[_0xd5e5('0x34')]=_['intersection'](_0x1586bf['model'],_0x1586bf[_0xd5e5('0x33')]);_0x77f601[_0xd5e5('0x35')]=_[_0xd5e5('0x36')](_0x1586bf[_0xd5e5('0x31')],qs['fields'](_0x2e607e['query'][_0xd5e5('0x37')]));_0x77f601[_0xd5e5('0x35')]=_0x77f601[_0xd5e5('0x35')][_0xd5e5('0x38')]?_0x77f601[_0xd5e5('0x35')]:_0x1586bf[_0xd5e5('0x31')];if(!_0x2e607e[_0xd5e5('0x33')][_0xd5e5('0x39')](_0xd5e5('0x3a'))){_0x77f601['limit']=qs['limit'](_0x2e607e[_0xd5e5('0x33')][_0xd5e5('0x20')]);_0x77f601['offset']=qs[_0xd5e5('0x1e')](_0x2e607e[_0xd5e5('0x33')][_0xd5e5('0x1e')]);}_0x77f601[_0xd5e5('0x3b')]=qs[_0xd5e5('0x3c')](_0x2e607e[_0xd5e5('0x33')][_0xd5e5('0x3c')]);_0x77f601[_0xd5e5('0x3d')]=qs[_0xd5e5('0x34')](_['pick'](_0x2e607e['query'],_0x1586bf[_0xd5e5('0x34')]),_0xa7c21c);if(_0x2e607e[_0xd5e5('0x33')][_0xd5e5('0x3e')]){_0x77f601['where']=_['merge'](_0x77f601[_0xd5e5('0x3d')],{'$or':_[_0xd5e5('0x32')](_0xa7c21c,function(_0x419cb8){if(_0x419cb8[_0xd5e5('0x2f')]!==_0xd5e5('0x3f')){var _0x5c0da1={};_0x5c0da1[_0x419cb8['name']]={'$like':'%'+_0x2e607e[_0xd5e5('0x33')][_0xd5e5('0x3e')]+'%'};return _0x5c0da1;}})});}_0x77f601=_[_0xd5e5('0x40')]({},_0x77f601,_0x2e607e[_0xd5e5('0x41')]);var _0x4a428e={'where':_0x77f601['where']};return db['MailTransferReport'][_0xd5e5('0x21')](_0x4a428e)[_0xd5e5('0x25')](function(_0x36eff7){_0x566bd7[_0xd5e5('0x21')]=_0x36eff7;if(_0x2e607e[_0xd5e5('0x33')]['includeAll']){_0x77f601[_0xd5e5('0x42')]=[{'all':!![]}];}return db['MailTransferReport'][_0xd5e5('0x43')](_0x77f601);})[_0xd5e5('0x25')](function(_0x5c155f){_0x566bd7['rows']=_0x5c155f;return _0x566bd7;})[_0xd5e5('0x25')](respondWithFilteredResult(_0x4ae860,_0x77f601))[_0xd5e5('0x44')](handleError(_0x4ae860,null));};exports['show']=function(_0x2ebb74,_0x4bb703){var _0x35a5f2={'raw':!![],'where':{'id':_0x2ebb74[_0xd5e5('0x45')]['id']}},_0x584ff1={};_0x584ff1[_0xd5e5('0x31')]=_[_0xd5e5('0x46')](db['MailTransferReport']['rawAttributes']);_0x584ff1['query']=_[_0xd5e5('0x46')](_0x2ebb74[_0xd5e5('0x33')]);_0x584ff1[_0xd5e5('0x34')]=_[_0xd5e5('0x36')](_0x584ff1[_0xd5e5('0x31')],_0x584ff1['query']);_0x35a5f2[_0xd5e5('0x35')]=_[_0xd5e5('0x36')](_0x584ff1[_0xd5e5('0x31')],qs['fields'](_0x2ebb74[_0xd5e5('0x33')][_0xd5e5('0x37')]));_0x35a5f2[_0xd5e5('0x35')]=_0x35a5f2[_0xd5e5('0x35')][_0xd5e5('0x38')]?_0x35a5f2[_0xd5e5('0x35')]:_0x584ff1[_0xd5e5('0x31')];if(_0x2ebb74['query'][_0xd5e5('0x47')]){_0x35a5f2[_0xd5e5('0x42')]=[{'all':!![]}];}_0x35a5f2=_[_0xd5e5('0x40')]({},_0x35a5f2,_0x2ebb74['options']);return db[_0xd5e5('0x2c')][_0xd5e5('0x48')](_0x35a5f2)[_0xd5e5('0x25')](handleEntityNotFound(_0x4bb703,null))['then'](respondWithResult(_0x4bb703,null))[_0xd5e5('0x44')](handleError(_0x4bb703,null));};exports[_0xd5e5('0x49')]=function(_0x23c962,_0x3ab60c){return db['MailTransferReport']['create'](_0x23c962[_0xd5e5('0x4a')],{})[_0xd5e5('0x25')](respondWithResult(_0x3ab60c,0xc9))[_0xd5e5('0x44')](handleError(_0x3ab60c,null));};exports[_0xd5e5('0x24')]=function(_0x18d22f,_0x33ed9c){if(_0x18d22f[_0xd5e5('0x4a')]['id']){delete _0x18d22f[_0xd5e5('0x4a')]['id'];}return db[_0xd5e5('0x2c')]['find']({'where':{'id':_0x18d22f[_0xd5e5('0x45')]['id']}})[_0xd5e5('0x25')](handleEntityNotFound(_0x33ed9c,null))[_0xd5e5('0x25')](saveUpdates(_0x18d22f[_0xd5e5('0x4a')],null))[_0xd5e5('0x25')](respondWithResult(_0x33ed9c,null))[_0xd5e5('0x44')](handleError(_0x33ed9c,null));};exports[_0xd5e5('0x26')]=function(_0x2ace54,_0x2c1c5b){return db[_0xd5e5('0x2c')][_0xd5e5('0x48')]({'where':{'id':_0x2ace54[_0xd5e5('0x45')]['id']}})[_0xd5e5('0x25')](handleEntityNotFound(_0x2c1c5b,null))[_0xd5e5('0x25')](removeEntity(_0x2c1c5b,null))[_0xd5e5('0x44')](handleError(_0x2c1c5b,null));};exports[_0xd5e5('0x4b')]=function(_0x30d78f,_0x59b06b){return db[_0xd5e5('0x2c')][_0xd5e5('0x4b')]()[_0xd5e5('0x25')](respondWithResult(_0x59b06b,null))[_0xd5e5('0x44')](handleError(_0x59b06b,null));}; \ No newline at end of file +var _0xd60a=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','offset','limit','count','Content-Range','apply','reject','save','then','sendStatus','error','stack','name','send','index','map','rawAttributes','type','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','MailTransferReport','findAll','rows','catch','show','include','options','find','create','body','update','params','destroy','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','desk.js','ioredis'];(function(_0x2e01aa,_0x6ded9b){var _0x1766e2=function(_0x27b479){while(--_0x27b479){_0x2e01aa['push'](_0x2e01aa['shift']());}};_0x1766e2(++_0x6ded9b);}(_0xd60a,0xd4));var _0xad60=function(_0x5156ab,_0xbc1cb){_0x5156ab=_0x5156ab-0x0;var _0x4d16b0=_0xd60a[_0x5156ab];return _0x4d16b0;};'use strict';var emlformat=require(_0xad60('0x0'));var rimraf=require(_0xad60('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xad60('0x2'));var rp=require(_0xad60('0x3'));var moment=require(_0xad60('0x4'));var BPromise=require(_0xad60('0x5'));var Mustache=require(_0xad60('0x6'));var util=require(_0xad60('0x7'));var path=require(_0xad60('0x8'));var sox=require('sox');var csv=require(_0xad60('0x9'));var ejs=require(_0xad60('0xa'));var fs=require('fs');var fs_extra=require(_0xad60('0xb'));var _=require(_0xad60('0xc'));var squel=require('squel');var crypto=require(_0xad60('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xad60('0xe'));var toCsv=require(_0xad60('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xad60('0xf'));var authService=require(_0xad60('0x10'));var qs=require(_0xad60('0x11'));var as=require(_0xad60('0x12'));var hardwareService=require(_0xad60('0x13'));var logger=require(_0xad60('0x14'))(_0xad60('0x15'));var utils=require(_0xad60('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xad60('0x17'));var db=require(_0xad60('0x18'))['db'];function respondWithStatusCode(_0x3c5d8f,_0x1e3acb){_0x1e3acb=_0x1e3acb||0xcc;return function(_0x57203a){if(_0x57203a){return _0x3c5d8f['sendStatus'](_0x1e3acb);}return _0x3c5d8f['status'](_0x1e3acb)[_0xad60('0x19')]();};}function respondWithResult(_0x26feba,_0x2f6442){_0x2f6442=_0x2f6442||0xc8;return function(_0x8c3c5a){if(_0x8c3c5a){return _0x26feba[_0xad60('0x1a')](_0x2f6442)[_0xad60('0x1b')](_0x8c3c5a);}};}function respondWithFilteredResult(_0x145735,_0x5efce9){return function(_0x2bc771){if(_0x2bc771){var _0x3e5374=typeof _0x5efce9[_0xad60('0x1c')]==='undefined'&&typeof _0x5efce9[_0xad60('0x1d')]==='undefined';var _0x46cb79=_0x2bc771['count'];var _0x4f158a=_0x3e5374?0x0:_0x5efce9['offset'];var _0x5508e3=_0x3e5374?_0x2bc771[_0xad60('0x1e')]:_0x5efce9['offset']+_0x5efce9['limit'];var _0x315ab6;if(_0x5508e3>=_0x46cb79){_0x5508e3=_0x46cb79;_0x315ab6=0xc8;}else{_0x315ab6=0xce;}_0x145735[_0xad60('0x1a')](_0x315ab6);return _0x145735['set'](_0xad60('0x1f'),_0x4f158a+'-'+_0x5508e3+'/'+_0x46cb79)[_0xad60('0x1b')](_0x2bc771);}return null;};}function patchUpdates(_0xabdd95){return function(_0x200adb){try{jsonpatch[_0xad60('0x20')](_0x200adb,_0xabdd95,!![]);}catch(_0x288dea){return BPromise[_0xad60('0x21')](_0x288dea);}return _0x200adb[_0xad60('0x22')]();};}function saveUpdates(_0xb66bc8,_0xe60b04){return function(_0x19173c){if(_0x19173c){return _0x19173c['update'](_0xb66bc8)[_0xad60('0x23')](function(_0x3844f1){return _0x3844f1;});}return null;};}function removeEntity(_0x3e9046,_0x3ecef4){return function(_0x15d2dc){if(_0x15d2dc){return _0x15d2dc['destroy']()['then'](function(){_0x3e9046[_0xad60('0x1a')](0xcc)[_0xad60('0x19')]();});}};}function handleEntityNotFound(_0x405dc7,_0x121598){return function(_0x436a68){if(!_0x436a68){_0x405dc7[_0xad60('0x24')](0x194);}return _0x436a68;};}function handleError(_0x5173e3,_0x2d6c45){_0x2d6c45=_0x2d6c45||0x1f4;return function(_0x7dffab){logger[_0xad60('0x25')](_0x7dffab[_0xad60('0x26')]);if(_0x7dffab[_0xad60('0x27')]){delete _0x7dffab['name'];}_0x5173e3[_0xad60('0x1a')](_0x2d6c45)[_0xad60('0x28')](_0x7dffab);};}exports[_0xad60('0x29')]=function(_0x268ef2,_0x327fd2){var _0x24a39f={},_0xd491d9={},_0x40800e={'count':0x0,'rows':[]};var _0x389151=_[_0xad60('0x2a')](db['MailTransferReport'][_0xad60('0x2b')],function(_0x157086){return{'name':_0x157086['fieldName'],'type':_0x157086[_0xad60('0x2c')]['key']};});_0xd491d9[_0xad60('0x2d')]=_[_0xad60('0x2a')](_0x389151,_0xad60('0x27'));_0xd491d9[_0xad60('0x2e')]=_[_0xad60('0x2f')](_0x268ef2[_0xad60('0x2e')]);_0xd491d9[_0xad60('0x30')]=_['intersection'](_0xd491d9['model'],_0xd491d9[_0xad60('0x2e')]);_0x24a39f[_0xad60('0x31')]=_[_0xad60('0x32')](_0xd491d9[_0xad60('0x2d')],qs[_0xad60('0x33')](_0x268ef2[_0xad60('0x2e')][_0xad60('0x33')]));_0x24a39f[_0xad60('0x31')]=_0x24a39f[_0xad60('0x31')][_0xad60('0x34')]?_0x24a39f['attributes']:_0xd491d9[_0xad60('0x2d')];if(!_0x268ef2[_0xad60('0x2e')]['hasOwnProperty'](_0xad60('0x35'))){_0x24a39f[_0xad60('0x1d')]=qs['limit'](_0x268ef2[_0xad60('0x2e')][_0xad60('0x1d')]);_0x24a39f['offset']=qs['offset'](_0x268ef2[_0xad60('0x2e')][_0xad60('0x1c')]);}_0x24a39f[_0xad60('0x36')]=qs['sort'](_0x268ef2[_0xad60('0x2e')][_0xad60('0x37')]);_0x24a39f[_0xad60('0x38')]=qs[_0xad60('0x30')](_[_0xad60('0x39')](_0x268ef2[_0xad60('0x2e')],_0xd491d9[_0xad60('0x30')]),_0x389151);if(_0x268ef2['query'][_0xad60('0x3a')]){_0x24a39f['where']=_[_0xad60('0x3b')](_0x24a39f['where'],{'$or':_[_0xad60('0x2a')](_0x389151,function(_0x2baea5){if(_0x2baea5['type']!==_0xad60('0x3c')){var _0x471a50={};_0x471a50[_0x2baea5['name']]={'$like':'%'+_0x268ef2['query'][_0xad60('0x3a')]+'%'};return _0x471a50;}})});}_0x24a39f=_['merge']({},_0x24a39f,_0x268ef2['options']);var _0x1de59c={'where':_0x24a39f[_0xad60('0x38')]};return db['MailTransferReport']['count'](_0x1de59c)[_0xad60('0x23')](function(_0x3cd86b){_0x40800e[_0xad60('0x1e')]=_0x3cd86b;if(_0x268ef2[_0xad60('0x2e')][_0xad60('0x3d')]){_0x24a39f['include']=[{'all':!![]}];}return db[_0xad60('0x3e')][_0xad60('0x3f')](_0x24a39f);})[_0xad60('0x23')](function(_0x219496){_0x40800e[_0xad60('0x40')]=_0x219496;return _0x40800e;})[_0xad60('0x23')](respondWithFilteredResult(_0x327fd2,_0x24a39f))[_0xad60('0x41')](handleError(_0x327fd2,null));};exports[_0xad60('0x42')]=function(_0x271462,_0x354222){var _0x2aa7bc={'raw':!![],'where':{'id':_0x271462['params']['id']}},_0x299683={};_0x299683[_0xad60('0x2d')]=_[_0xad60('0x2f')](db[_0xad60('0x3e')][_0xad60('0x2b')]);_0x299683[_0xad60('0x2e')]=_[_0xad60('0x2f')](_0x271462[_0xad60('0x2e')]);_0x299683[_0xad60('0x30')]=_[_0xad60('0x32')](_0x299683[_0xad60('0x2d')],_0x299683[_0xad60('0x2e')]);_0x2aa7bc['attributes']=_[_0xad60('0x32')](_0x299683[_0xad60('0x2d')],qs[_0xad60('0x33')](_0x271462[_0xad60('0x2e')][_0xad60('0x33')]));_0x2aa7bc['attributes']=_0x2aa7bc[_0xad60('0x31')][_0xad60('0x34')]?_0x2aa7bc[_0xad60('0x31')]:_0x299683['model'];if(_0x271462['query']['includeAll']){_0x2aa7bc[_0xad60('0x43')]=[{'all':!![]}];}_0x2aa7bc=_[_0xad60('0x3b')]({},_0x2aa7bc,_0x271462[_0xad60('0x44')]);return db[_0xad60('0x3e')][_0xad60('0x45')](_0x2aa7bc)[_0xad60('0x23')](handleEntityNotFound(_0x354222,null))['then'](respondWithResult(_0x354222,null))['catch'](handleError(_0x354222,null));};exports[_0xad60('0x46')]=function(_0x5939dc,_0x3dc3cf){return db[_0xad60('0x3e')][_0xad60('0x46')](_0x5939dc[_0xad60('0x47')],{})[_0xad60('0x23')](respondWithResult(_0x3dc3cf,0xc9))['catch'](handleError(_0x3dc3cf,null));};exports[_0xad60('0x48')]=function(_0x4c2614,_0x8d1740){if(_0x4c2614[_0xad60('0x47')]['id']){delete _0x4c2614[_0xad60('0x47')]['id'];}return db[_0xad60('0x3e')][_0xad60('0x45')]({'where':{'id':_0x4c2614[_0xad60('0x49')]['id']}})['then'](handleEntityNotFound(_0x8d1740,null))[_0xad60('0x23')](saveUpdates(_0x4c2614['body'],null))['then'](respondWithResult(_0x8d1740,null))['catch'](handleError(_0x8d1740,null));};exports[_0xad60('0x4a')]=function(_0x459ed5,_0x15d47a){return db[_0xad60('0x3e')][_0xad60('0x45')]({'where':{'id':_0x459ed5[_0xad60('0x49')]['id']}})[_0xad60('0x23')](handleEntityNotFound(_0x15d47a,null))[_0xad60('0x23')](removeEntity(_0x15d47a,null))[_0xad60('0x41')](handleError(_0x15d47a,null));};exports[_0xad60('0x4b')]=function(_0x4c1047,_0x212c80){return db[_0xad60('0x3e')][_0xad60('0x4b')]()['then'](respondWithResult(_0x212c80,null))[_0xad60('0x41')](handleError(_0x212c80,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index bea5fef..7cb9c1d 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 _0x5fd1=['lodash','../../config/logger','api','moment','path','rimraf','../../config/environment','exports','define','MailTransferReport','uniqueid'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x5fd1,0x155));var _0x15fd=function(_0x120aac,_0x36ee4f){_0x120aac=_0x120aac-0x0;var _0x10cd58=_0x5fd1[_0x120aac];return _0x10cd58;};'use strict';var _=require(_0x15fd('0x0'));var util=require('util');var logger=require(_0x15fd('0x1'))(_0x15fd('0x2'));var moment=require(_0x15fd('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x15fd('0x4'));var rimraf=require(_0x15fd('0x5'));var config=require(_0x15fd('0x6'));var attributes=require('./mailTransferReport.attributes');module[_0x15fd('0x7')]=function(_0x386441,_0x18450c){return _0x386441[_0x15fd('0x8')](_0x15fd('0x9'),attributes,{'tableName':'report_mail_transfer','paranoid':![],'indexes':[{'name':_0x15fd('0xa'),'fields':[_0x15fd('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0a25=['./mailTransferReport.attributes','exports','define','MailTransferReport','report_mail_transfer','uniqueid','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x0a25,0x68));var _0x50a2=function(_0xb71c35,_0x129343){_0xb71c35=_0xb71c35-0x0;var _0x39224f=_0x0a25[_0xb71c35];return _0x39224f;};'use strict';var _=require(_0x50a2('0x0'));var util=require(_0x50a2('0x1'));var logger=require('../../config/logger')(_0x50a2('0x2'));var moment=require(_0x50a2('0x3'));var BPromise=require('bluebird');var rp=require(_0x50a2('0x4'));var fs=require('fs');var path=require(_0x50a2('0x5'));var rimraf=require(_0x50a2('0x6'));var config=require(_0x50a2('0x7'));var attributes=require(_0x50a2('0x8'));module[_0x50a2('0x9')]=function(_0x33fef7,_0x8b6ba4){return _0x33fef7[_0x50a2('0xa')](_0x50a2('0xb'),attributes,{'tableName':_0x50a2('0xc'),'paranoid':![],'indexes':[{'name':_0x50a2('0xd'),'fields':[_0x50a2('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 b2f75a7..ac73f2a 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 _0x6649=['result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','MailTransferReport,\x20%s,\x20%s','stringify','error','message','info','request\x20sent'];(function(_0x3e2569,_0xb5c0d9){var _0x310f79=function(_0xcbe38e){while(--_0xcbe38e){_0x3e2569['push'](_0x3e2569['shift']());}};_0x310f79(++_0xb5c0d9);}(_0x6649,0x6a));var _0x9664=function(_0x33dd75,_0x3d1a40){_0x33dd75=_0x33dd75-0x0;var _0x37ee4e=_0x6649[_0x33dd75];return _0x37ee4e;};'use strict';var _=require(_0x9664('0x0'));var util=require(_0x9664('0x1'));var moment=require(_0x9664('0x2'));var BPromise=require(_0x9664('0x3'));var rs=require(_0x9664('0x4'));var fs=require('fs');var Redis=require(_0x9664('0x5'));var db=require(_0x9664('0x6'))['db'];var utils=require(_0x9664('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x9664('0x8'));var jayson=require(_0x9664('0x9'));var client=jayson[_0x9664('0xa')][_0x9664('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x275394,_0xe418d7,_0x106f86){return new BPromise(function(_0x444374,_0x3ad680){return client[_0x9664('0xc')](_0x275394,_0x106f86)[_0x9664('0xd')](function(_0x556379){logger['info'](_0x9664('0xe'),_0xe418d7,'request\x20sent');logger['debug']('MailTransferReport,\x20%s,\x20%s,\x20%s',_0xe418d7,'request\x20sent',JSON[_0x9664('0xf')](_0x556379));if(_0x556379[_0x9664('0x10')]){if(_0x556379[_0x9664('0x10')]['code']===0x1f4){logger[_0x9664('0x10')](_0x9664('0xe'),_0xe418d7,_0x556379['error'][_0x9664('0x11')]);return _0x3ad680(_0x556379[_0x9664('0x10')][_0x9664('0x11')]);}logger['error'](_0x9664('0xe'),_0xe418d7,_0x556379[_0x9664('0x10')]['message']);return _0x444374(_0x556379[_0x9664('0x10')][_0x9664('0x11')]);}else{logger[_0x9664('0x12')](_0x9664('0xe'),_0xe418d7,_0x9664('0x13'));_0x444374(_0x556379[_0x9664('0x14')][_0x9664('0x11')]);}})['catch'](function(_0x210b5b){logger[_0x9664('0x10')](_0x9664('0xe'),_0xe418d7,_0x210b5b);_0x3ad680(_0x210b5b);});});} \ No newline at end of file +var _0x9003=['request','then','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x6fecc6,_0x422338){var _0x374846=function(_0x1308f7){while(--_0x1308f7){_0x6fecc6['push'](_0x6fecc6['shift']());}};_0x374846(++_0x422338);}(_0x9003,0xe4));var _0x3900=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x9003[_0x465028];return _0xb783d4;};'use strict';var _=require(_0x3900('0x0'));var util=require(_0x3900('0x1'));var moment=require(_0x3900('0x2'));var BPromise=require(_0x3900('0x3'));var rs=require(_0x3900('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3900('0x5'))['db'];var utils=require(_0x3900('0x6'));var logger=require(_0x3900('0x7'))(_0x3900('0x8'));var config=require(_0x3900('0x9'));var jayson=require(_0x3900('0xa'));var client=jayson[_0x3900('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x325036,_0x24a608,_0x400b7d){return new BPromise(function(_0x340529,_0x57171b){return client[_0x3900('0xc')](_0x325036,_0x400b7d)[_0x3900('0xd')](function(_0x33bdff){logger[_0x3900('0xe')](_0x3900('0xf'),_0x24a608,_0x3900('0x10'));logger[_0x3900('0x11')](_0x3900('0x12'),_0x24a608,_0x3900('0x10'),JSON[_0x3900('0x13')](_0x33bdff));if(_0x33bdff[_0x3900('0x14')]){if(_0x33bdff[_0x3900('0x14')][_0x3900('0x15')]===0x1f4){logger[_0x3900('0x14')]('MailTransferReport,\x20%s,\x20%s',_0x24a608,_0x33bdff[_0x3900('0x14')][_0x3900('0x16')]);return _0x57171b(_0x33bdff[_0x3900('0x14')][_0x3900('0x16')]);}logger[_0x3900('0x14')](_0x3900('0xf'),_0x24a608,_0x33bdff[_0x3900('0x14')][_0x3900('0x16')]);return _0x340529(_0x33bdff['error'][_0x3900('0x16')]);}else{logger[_0x3900('0xe')](_0x3900('0xf'),_0x24a608,_0x3900('0x10'));_0x340529(_0x33bdff['result'][_0x3900('0x16')]);}})[_0x3900('0x17')](function(_0xd42978){logger[_0x3900('0x14')]('MailTransferReport,\x20%s,\x20%s',_0x24a608,_0xd42978);_0x57171b(_0xd42978);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index f83fc05..0c1b549 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 _0xad5c=['multer','util','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./memberReport.controller','get','isAuthenticated','/describe','show','post','put','update','delete','/:id','destroy','exports'];(function(_0x368bba,_0x1f625b){var _0x409f8f=function(_0x463373){while(--_0x463373){_0x368bba['push'](_0x368bba['shift']());}};_0x409f8f(++_0x1f625b);}(_0xad5c,0xa2));var _0xcad5=function(_0x45e8dc,_0x4247ee){_0x45e8dc=_0x45e8dc-0x0;var _0x1f7a0d=_0xad5c[_0x45e8dc];return _0x1f7a0d;};'use strict';var multer=require(_0xcad5('0x0'));var util=require(_0xcad5('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xcad5('0x2'));var auth=require(_0xcad5('0x3'));var interaction=require(_0xcad5('0x4'));var config=require(_0xcad5('0x5'));var controller=require(_0xcad5('0x6'));router[_0xcad5('0x7')]('/',auth[_0xcad5('0x8')](),controller['index']);router[_0xcad5('0x7')](_0xcad5('0x9'),auth[_0xcad5('0x8')](),controller['describe']);router[_0xcad5('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xcad5('0xa')]);router[_0xcad5('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0xcad5('0xc')]('/:id',auth['isAuthenticated'](),controller[_0xcad5('0xd')]);router[_0xcad5('0xe')](_0xcad5('0xf'),auth['isAuthenticated'](),controller[_0xcad5('0x10')]);module[_0xcad5('0x11')]=router; \ No newline at end of file +var _0x27d1=['Router','fs-extra','../../components/interaction/service','get','index','/describe','isAuthenticated','describe','post','create','put','delete','destroy','exports','multer','util','path','express'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x27d1,0x7a));var _0x127d=function(_0x389376,_0x10a8eb){_0x389376=_0x389376-0x0;var _0x1303a6=_0x27d1[_0x389376];return _0x1303a6;};'use strict';var multer=require(_0x127d('0x0'));var util=require(_0x127d('0x1'));var path=require(_0x127d('0x2'));var timeout=require('connect-timeout');var express=require(_0x127d('0x3'));var router=express[_0x127d('0x4')]();var fs_extra=require(_0x127d('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x127d('0x6'));var config=require('../../config/environment');var controller=require('./memberReport.controller');router[_0x127d('0x7')]('/',auth['isAuthenticated'](),controller[_0x127d('0x8')]);router[_0x127d('0x7')](_0x127d('0x9'),auth[_0x127d('0xa')](),controller[_0x127d('0xb')]);router[_0x127d('0x7')]('/:id',auth[_0x127d('0xa')](),controller['show']);router[_0x127d('0xc')]('/',auth[_0x127d('0xa')](),controller[_0x127d('0xd')]);router[_0x127d('0xe')]('/:id',auth[_0x127d('0xa')](),controller['update']);router[_0x127d('0xf')]('/:id',auth[_0x127d('0xa')](),controller[_0x127d('0x10')]);module[_0x127d('0x11')]=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index 3ef4799..a658843 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 _0x3814=['getDataValue','enterAt','diff','seconds','setDataValue','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','sequelize','exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE'];(function(_0x46e47b,_0x5cf0ff){var _0x5dc772=function(_0x295532){while(--_0x295532){_0x46e47b['push'](_0x46e47b['shift']());}};_0x5dc772(++_0x5cf0ff);}(_0x3814,0xb7));var _0x4381=function(_0x41580a,_0x5b52a2){_0x41580a=_0x41580a-0x0;var _0x3989ac=_0x3814[_0x41580a];return _0x3989ac;};'use strict';var Sequelize=require(_0x4381('0x0'));var moment=require('moment');module[_0x4381('0x1')]={'channel':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x4381('0x2')]},'interface':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x4381('0x2')],'defaultValue':_0x4381('0x3'),'comment':_0x4381('0x4')},'duration':{'type':Sequelize[_0x4381('0x5')]},'enterAt':{'type':Sequelize[_0x4381('0x6')]},'exitAt':{'type':Sequelize[_0x4381('0x6')],'set':function(_0x535e9e){var _0x3aa1e6=moment(_0x535e9e);var _0x2416d1=moment(this[_0x4381('0x7')](_0x4381('0x8')));var _0x4be075=_0x3aa1e6[_0x4381('0x9')](_0x2416d1,_0x4381('0xa'));this[_0x4381('0xb')](_0x4381('0xc'),_0x535e9e);this[_0x4381('0xb')](_0x4381('0xd'),_0x4be075>=0x0?_0x4be075:null);}},'data1':{'type':Sequelize[_0x4381('0x2')],'comment':_0x4381('0xe')},'data2':{'type':Sequelize[_0x4381('0x2')],'comment':_0x4381('0xf')},'data3':{'type':Sequelize[_0x4381('0x2')],'comment':_0x4381('0x10')},'data4':{'type':Sequelize[_0x4381('0x2')],'comment':_0x4381('0x11')},'data5':{'type':Sequelize[_0x4381('0x2')],'comment':_0x4381('0x12')},'role':{'type':Sequelize[_0x4381('0x2')]},'internal':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0x4381('0x2')]}}; \ No newline at end of file +var _0x4499=['seconds','setDataValue','exitAt','duration','talk:[start]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','moment','exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','getDataValue','enterAt','diff'];(function(_0x924c29,_0x309120){var _0x24ddd6=function(_0x1c8a9e){while(--_0x1c8a9e){_0x924c29['push'](_0x924c29['shift']());}};_0x24ddd6(++_0x309120);}(_0x4499,0x98));var _0x9449=function(_0x4283e1,_0x80344){_0x4283e1=_0x4283e1-0x0;var _0x201855=_0x4499[_0x4283e1];return _0x201855;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x9449('0x0'));module[_0x9449('0x1')]={'channel':{'type':Sequelize[_0x9449('0x2')]},'membername':{'type':Sequelize[_0x9449('0x2')]},'interface':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING'],'defaultValue':_0x9449('0x3'),'comment':_0x9449('0x4')},'duration':{'type':Sequelize[_0x9449('0x5')]},'enterAt':{'type':Sequelize[_0x9449('0x6')]},'exitAt':{'type':Sequelize[_0x9449('0x6')],'set':function(_0x13a06c){var _0x2993ba=moment(_0x13a06c);var _0xed2941=moment(this[_0x9449('0x7')](_0x9449('0x8')));var _0x370480=_0x2993ba[_0x9449('0x9')](_0xed2941,_0x9449('0xa'));this[_0x9449('0xb')](_0x9449('0xc'),_0x13a06c);this['setDataValue'](_0x9449('0xd'),_0x370480>=0x0?_0x370480:null);}},'data1':{'type':Sequelize['STRING'],'comment':'talk:[inbound,\x20outbound],\x20pause:[reason]'},'data2':{'type':Sequelize[_0x9449('0x2')],'comment':_0x9449('0xe')},'data3':{'type':Sequelize[_0x9449('0x2')],'comment':_0x9449('0xf')},'data4':{'type':Sequelize[_0x9449('0x2')],'comment':_0x9449('0x10')},'data5':{'type':Sequelize[_0x9449('0x2')],'comment':_0x9449('0x11')},'role':{'type':Sequelize[_0x9449('0x2')]},'internal':{'type':Sequelize[_0x9449('0x5')]},'uniqueid':{'type':Sequelize[_0x9449('0x2')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index 68d3268..48333d5 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 _0x55ca=['merge','filter','includeAll','include','findAll','rawAttributes','options','create','body','find','params','catch','destroy','describe','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','status','json','offset','undefined','limit','count','reject','update','then','end','sendStatus','error','stack','name','send','index','map','MemberReport','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x55ca,0x126));var _0xa55c=function(_0x2abd13,_0x501317){_0x2abd13=_0x2abd13-0x0;var _0x5ad645=_0x55ca[_0x2abd13];return _0x5ad645;};'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'];function respondWithStatusCode(_0x5d47ff,_0x59d84a){_0x59d84a=_0x59d84a||0xcc;return function(_0x2a35be){if(_0x2a35be){return _0x5d47ff['sendStatus'](_0x59d84a);}return _0x5d47ff['status'](_0x59d84a)['end']();};}function respondWithResult(_0x18ee85,_0x3930e4){_0x3930e4=_0x3930e4||0xc8;return function(_0x462cd6){if(_0x462cd6){return _0x18ee85[_0xa55c('0x18')](_0x3930e4)[_0xa55c('0x19')](_0x462cd6);}};}function respondWithFilteredResult(_0x247e77,_0x4e0b2f){return function(_0x3ccf65){if(_0x3ccf65){var _0x3dcf4f=typeof _0x4e0b2f[_0xa55c('0x1a')]===_0xa55c('0x1b')&&typeof _0x4e0b2f[_0xa55c('0x1c')]===_0xa55c('0x1b');var _0x51590e=_0x3ccf65[_0xa55c('0x1d')];var _0x24783b=_0x3dcf4f?0x0:_0x4e0b2f['offset'];var _0x3d4c9e=_0x3dcf4f?_0x3ccf65[_0xa55c('0x1d')]:_0x4e0b2f[_0xa55c('0x1a')]+_0x4e0b2f[_0xa55c('0x1c')];var _0x23a1ae;if(_0x3d4c9e>=_0x51590e){_0x3d4c9e=_0x51590e;_0x23a1ae=0xc8;}else{_0x23a1ae=0xce;}_0x247e77[_0xa55c('0x18')](_0x23a1ae);return _0x247e77['set']('Content-Range',_0x24783b+'-'+_0x3d4c9e+'/'+_0x51590e)[_0xa55c('0x19')](_0x3ccf65);}return null;};}function patchUpdates(_0x3776ac){return function(_0xade4c4){try{jsonpatch['apply'](_0xade4c4,_0x3776ac,!![]);}catch(_0x383d92){return BPromise[_0xa55c('0x1e')](_0x383d92);}return _0xade4c4['save']();};}function saveUpdates(_0x187a87,_0x133096){return function(_0x940f28){if(_0x940f28){return _0x940f28[_0xa55c('0x1f')](_0x187a87)[_0xa55c('0x20')](function(_0x49ed04){return _0x49ed04;});}return null;};}function removeEntity(_0x1fc828,_0x504c24){return function(_0x5ba836){if(_0x5ba836){return _0x5ba836['destroy']()[_0xa55c('0x20')](function(){_0x1fc828['status'](0xcc)[_0xa55c('0x21')]();});}};}function handleEntityNotFound(_0x190757,_0x3f64de){return function(_0xf0e574){if(!_0xf0e574){_0x190757[_0xa55c('0x22')](0x194);}return _0xf0e574;};}function handleError(_0x170ba4,_0x1da633){_0x1da633=_0x1da633||0x1f4;return function(_0x11e7f7){logger[_0xa55c('0x23')](_0x11e7f7[_0xa55c('0x24')]);if(_0x11e7f7[_0xa55c('0x25')]){delete _0x11e7f7['name'];}_0x170ba4[_0xa55c('0x18')](_0x1da633)[_0xa55c('0x26')](_0x11e7f7);};}exports[_0xa55c('0x27')]=function(_0x906caa,_0x5d940d){var _0x1377b0={},_0x22f6b6={},_0x1b8388={'count':0x0,'rows':[]};var _0x201941=_[_0xa55c('0x28')](db[_0xa55c('0x29')]['rawAttributes'],function(_0x23e698){return{'name':_0x23e698['fieldName'],'type':_0x23e698[_0xa55c('0x2a')][_0xa55c('0x2b')]};});_0x22f6b6[_0xa55c('0x2c')]=_[_0xa55c('0x28')](_0x201941,'name');_0x22f6b6[_0xa55c('0x2d')]=_[_0xa55c('0x2e')](_0x906caa[_0xa55c('0x2d')]);_0x22f6b6[_0xa55c('0x2f')]=_[_0xa55c('0x30')](_0x22f6b6[_0xa55c('0x2c')],_0x22f6b6[_0xa55c('0x2d')]);_0x1377b0[_0xa55c('0x31')]=_[_0xa55c('0x30')](_0x22f6b6[_0xa55c('0x2c')],qs[_0xa55c('0x32')](_0x906caa['query']['fields']));_0x1377b0[_0xa55c('0x31')]=_0x1377b0[_0xa55c('0x31')]['length']?_0x1377b0[_0xa55c('0x31')]:_0x22f6b6[_0xa55c('0x2c')];if(!_0x906caa[_0xa55c('0x2d')][_0xa55c('0x33')](_0xa55c('0x34'))){_0x1377b0[_0xa55c('0x1c')]=qs[_0xa55c('0x1c')](_0x906caa[_0xa55c('0x2d')][_0xa55c('0x1c')]);_0x1377b0['offset']=qs['offset'](_0x906caa['query'][_0xa55c('0x1a')]);}_0x1377b0[_0xa55c('0x35')]=qs[_0xa55c('0x36')](_0x906caa['query'][_0xa55c('0x36')]);_0x1377b0['where']=qs[_0xa55c('0x2f')](_['pick'](_0x906caa[_0xa55c('0x2d')],_0x22f6b6[_0xa55c('0x2f')]),_0x201941);if(_0x906caa[_0xa55c('0x2d')]['filter']){_0x1377b0[_0xa55c('0x37')]=_[_0xa55c('0x38')](_0x1377b0['where'],{'$or':_[_0xa55c('0x28')](_0x201941,function(_0x194e78){if(_0x194e78['type']!=='VIRTUAL'){var _0x235f6b={};_0x235f6b[_0x194e78['name']]={'$like':'%'+_0x906caa[_0xa55c('0x2d')][_0xa55c('0x39')]+'%'};return _0x235f6b;}})});}_0x1377b0=_['merge']({},_0x1377b0,_0x906caa['options']);var _0x5e50b6={'where':_0x1377b0['where']};return db[_0xa55c('0x29')][_0xa55c('0x1d')](_0x5e50b6)[_0xa55c('0x20')](function(_0x99c4f8){_0x1b8388[_0xa55c('0x1d')]=_0x99c4f8;if(_0x906caa['query'][_0xa55c('0x3a')]){_0x1377b0[_0xa55c('0x3b')]=[{'all':!![]}];}return db[_0xa55c('0x29')][_0xa55c('0x3c')](_0x1377b0);})[_0xa55c('0x20')](function(_0x23cef5){_0x1b8388['rows']=_0x23cef5;return _0x1b8388;})[_0xa55c('0x20')](respondWithFilteredResult(_0x5d940d,_0x1377b0))['catch'](handleError(_0x5d940d,null));};exports['show']=function(_0x404e7f,_0x1f63d8){var _0x496920={'raw':!![],'where':{'id':_0x404e7f['params']['id']}},_0x2bd98b={};_0x2bd98b['model']=_[_0xa55c('0x2e')](db[_0xa55c('0x29')][_0xa55c('0x3d')]);_0x2bd98b['query']=_[_0xa55c('0x2e')](_0x404e7f[_0xa55c('0x2d')]);_0x2bd98b['filters']=_[_0xa55c('0x30')](_0x2bd98b['model'],_0x2bd98b[_0xa55c('0x2d')]);_0x496920[_0xa55c('0x31')]=_['intersection'](_0x2bd98b[_0xa55c('0x2c')],qs[_0xa55c('0x32')](_0x404e7f['query'][_0xa55c('0x32')]));_0x496920[_0xa55c('0x31')]=_0x496920[_0xa55c('0x31')]['length']?_0x496920[_0xa55c('0x31')]:_0x2bd98b['model'];if(_0x404e7f[_0xa55c('0x2d')][_0xa55c('0x3a')]){_0x496920[_0xa55c('0x3b')]=[{'all':!![]}];}_0x496920=_['merge']({},_0x496920,_0x404e7f[_0xa55c('0x3e')]);return db[_0xa55c('0x29')]['find'](_0x496920)[_0xa55c('0x20')](handleEntityNotFound(_0x1f63d8,null))[_0xa55c('0x20')](respondWithResult(_0x1f63d8,null))['catch'](handleError(_0x1f63d8,null));};exports[_0xa55c('0x3f')]=function(_0xd3fe78,_0x52f9a7){return db[_0xa55c('0x29')][_0xa55c('0x3f')](_0xd3fe78[_0xa55c('0x40')],{})[_0xa55c('0x20')](respondWithResult(_0x52f9a7,0xc9))['catch'](handleError(_0x52f9a7,null));};exports[_0xa55c('0x1f')]=function(_0x58a7ea,_0x2157d6){if(_0x58a7ea[_0xa55c('0x40')]['id']){delete _0x58a7ea[_0xa55c('0x40')]['id'];}return db['MemberReport'][_0xa55c('0x41')]({'where':{'id':_0x58a7ea[_0xa55c('0x42')]['id']}})['then'](handleEntityNotFound(_0x2157d6,null))[_0xa55c('0x20')](saveUpdates(_0x58a7ea[_0xa55c('0x40')],null))[_0xa55c('0x20')](respondWithResult(_0x2157d6,null))[_0xa55c('0x43')](handleError(_0x2157d6,null));};exports[_0xa55c('0x44')]=function(_0x1c84d9,_0x1e1293){return db[_0xa55c('0x29')][_0xa55c('0x41')]({'where':{'id':_0x1c84d9[_0xa55c('0x42')]['id']}})['then'](handleEntityNotFound(_0x1e1293,null))[_0xa55c('0x20')](removeEntity(_0x1e1293,null))[_0xa55c('0x43')](handleError(_0x1e1293,null));};exports[_0xa55c('0x45')]=function(_0x4f73b6,_0x4c3095){return db[_0xa55c('0x29')]['describe']()[_0xa55c('0x20')](respondWithResult(_0x4c3095,null))['catch'](handleError(_0x4c3095,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(_0x12d033,_0x25fa2f){var _0x3b4e80=function(_0x46c1f4){while(--_0x46c1f4){_0x12d033['push'](_0x12d033['shift']());}};_0x3b4e80(++_0x25fa2f);}(_0x34e8,0x12c));var _0x834e=function(_0x58671e,_0x40a498){_0x58671e=_0x58671e-0x0;var _0x5a3391=_0x34e8[_0x58671e];return _0x5a3391;};'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 17184f9..2cfb37b 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 _0x2e57=['./memberReport.attributes','define','MemberReport','membername_interface','interface','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment'];(function(_0x445fa0,_0x18c7e6){var _0x450b6d=function(_0x2802e3){while(--_0x2802e3){_0x445fa0['push'](_0x445fa0['shift']());}};_0x450b6d(++_0x18c7e6);}(_0x2e57,0x1cc));var _0x72e5=function(_0x305bcc,_0x202993){_0x305bcc=_0x305bcc-0x0;var _0x1aac97=_0x2e57[_0x305bcc];return _0x1aac97;};'use strict';var _=require(_0x72e5('0x0'));var util=require(_0x72e5('0x1'));var logger=require(_0x72e5('0x2'))(_0x72e5('0x3'));var moment=require(_0x72e5('0x4'));var BPromise=require(_0x72e5('0x5'));var rp=require(_0x72e5('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x72e5('0x7'));var attributes=require(_0x72e5('0x8'));module['exports']=function(_0x319691,_0x42682d){return _0x319691[_0x72e5('0x9')](_0x72e5('0xa'),attributes,{'tableName':'report_member','paranoid':![],'indexes':[{'name':_0x72e5('0xb'),'fields':['membername',_0x72e5('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6e0a=['interface','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./memberReport.attributes','define','report_member','membername_interface','membername'];(function(_0x2cb58b,_0x5a879d){var _0xe9dd9c=function(_0x11e835){while(--_0x11e835){_0x2cb58b['push'](_0x2cb58b['shift']());}};_0xe9dd9c(++_0x5a879d);}(_0x6e0a,0xa1));var _0xa6e0=function(_0x395bfe,_0x4db521){_0x395bfe=_0x395bfe-0x0;var _0x35c81c=_0x6e0a[_0x395bfe];return _0x35c81c;};'use strict';var _=require(_0xa6e0('0x0'));var util=require(_0xa6e0('0x1'));var logger=require(_0xa6e0('0x2'))(_0xa6e0('0x3'));var moment=require(_0xa6e0('0x4'));var BPromise=require(_0xa6e0('0x5'));var rp=require(_0xa6e0('0x6'));var fs=require('fs');var path=require(_0xa6e0('0x7'));var rimraf=require(_0xa6e0('0x8'));var config=require(_0xa6e0('0x9'));var attributes=require(_0xa6e0('0xa'));module['exports']=function(_0x256be3,_0x373ffe){return _0x256be3[_0xa6e0('0xb')]('MemberReport',attributes,{'tableName':_0xa6e0('0xc'),'paranoid':![],'indexes':[{'name':_0xa6e0('0xd'),'fields':[_0xa6e0('0xe'),_0xa6e0('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index 461ed8f..2fe8606 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 _0x05bc=['request','info','MemberReport,\x20%s,\x20%s','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetMemberReport','MemberReport','options','raw','attributes','limit','include','map','model','CreateMemberReport','create','body','where','then','UpdateMemberReport','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x26791f,_0x320046){var _0x5628cc=function(_0x2a4d78){while(--_0x2a4d78){_0x26791f['push'](_0x26791f['shift']());}};_0x5628cc(++_0x320046);}(_0x05bc,0xae));var _0xc05b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x05bc[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xc05b('0x0'));var moment=require('moment');var BPromise=require(_0xc05b('0x1'));var rs=require(_0xc05b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc05b('0x3'))['db'];var utils=require(_0xc05b('0x4'));var logger=require(_0xc05b('0x5'))(_0xc05b('0x6'));var config=require(_0xc05b('0x7'));var jayson=require(_0xc05b('0x8'));var client=jayson[_0xc05b('0x9')][_0xc05b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x9c6c57,_0x1b501a,_0x275f0f){return new BPromise(function(_0x143ba4,_0x45245b){return client[_0xc05b('0xb')](_0x9c6c57,_0x275f0f)['then'](function(_0x5d72b9){logger[_0xc05b('0xc')](_0xc05b('0xd'),_0x1b501a,_0xc05b('0xe'));logger[_0xc05b('0xf')](_0xc05b('0x10'),_0x1b501a,_0xc05b('0xe'),JSON[_0xc05b('0x11')](_0x5d72b9));if(_0x5d72b9[_0xc05b('0x12')]){if(_0x5d72b9[_0xc05b('0x12')]['code']===0x1f4){logger[_0xc05b('0x12')](_0xc05b('0xd'),_0x1b501a,_0x5d72b9[_0xc05b('0x12')][_0xc05b('0x13')]);return _0x45245b(_0x5d72b9[_0xc05b('0x12')][_0xc05b('0x13')]);}logger['error'](_0xc05b('0xd'),_0x1b501a,_0x5d72b9[_0xc05b('0x12')]['message']);return _0x143ba4(_0x5d72b9['error'][_0xc05b('0x13')]);}else{logger[_0xc05b('0xc')](_0xc05b('0xd'),_0x1b501a,_0xc05b('0xe'));_0x143ba4(_0x5d72b9[_0xc05b('0x14')][_0xc05b('0x13')]);}})[_0xc05b('0x15')](function(_0x5a33c1){logger[_0xc05b('0x12')](_0xc05b('0xd'),_0x1b501a,_0x5a33c1);_0x45245b(_0x5a33c1);});});}exports[_0xc05b('0x16')]=function(_0x421cb){var _0x1cba94=this;return new Promise(function(_0x403290,_0x58224d){return db[_0xc05b('0x17')]['findAll']({'raw':_0x421cb[_0xc05b('0x18')]?_0x421cb[_0xc05b('0x18')][_0xc05b('0x19')]===undefined?!![]:![]:!![],'where':_0x421cb[_0xc05b('0x18')]?_0x421cb[_0xc05b('0x18')]['where']||null:null,'attributes':_0x421cb[_0xc05b('0x18')]?_0x421cb[_0xc05b('0x18')][_0xc05b('0x1a')]||null:null,'limit':_0x421cb[_0xc05b('0x18')]?_0x421cb['options'][_0xc05b('0x1b')]||null:null,'include':_0x421cb[_0xc05b('0x18')]?_0x421cb[_0xc05b('0x18')][_0xc05b('0x1c')]?_[_0xc05b('0x1d')](_0x421cb[_0xc05b('0x18')]['include'],function(_0x585447){return{'model':db[_0x585447[_0xc05b('0x1e')]],'as':_0x585447['as'],'attributes':_0x585447[_0xc05b('0x1a')],'include':_0x585447['include']?_[_0xc05b('0x1d')](_0x585447['include'],function(_0x54b3a9){return{'model':db[_0x54b3a9[_0xc05b('0x1e')]],'as':_0x54b3a9['as'],'attributes':_0x54b3a9['attributes'],'include':_0x54b3a9['include']?_['map'](_0x54b3a9[_0xc05b('0x1c')],function(_0x4c133c){return{'model':db[_0x4c133c[_0xc05b('0x1e')]],'as':_0x4c133c['as'],'attributes':_0x4c133c[_0xc05b('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x337cc1){logger[_0xc05b('0xc')](_0xc05b('0x16'),_0x421cb);logger[_0xc05b('0xf')](_0xc05b('0x16'),_0x421cb,JSON[_0xc05b('0x11')](_0x337cc1));_0x403290(_0x337cc1);})[_0xc05b('0x15')](function(_0x2ba6b4){logger[_0xc05b('0x12')](_0xc05b('0x16'),_0x2ba6b4[_0xc05b('0x13')],_0x421cb);_0x58224d(_0x1cba94[_0xc05b('0x12')](0x1f4,_0x2ba6b4['message']));});});};exports[_0xc05b('0x1f')]=function(_0x56cc4a){var _0x370d05=this;return new Promise(function(_0x54286a,_0x580d43){return db[_0xc05b('0x17')][_0xc05b('0x20')](_0x56cc4a[_0xc05b('0x21')],{'raw':_0x56cc4a['options']?_0x56cc4a[_0xc05b('0x18')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x4f9c53){logger[_0xc05b('0xc')](_0xc05b('0x1f'),_0x56cc4a);logger[_0xc05b('0xf')]('CreateMemberReport',_0x56cc4a,JSON[_0xc05b('0x11')](_0x4f9c53));_0x54286a(_0x4f9c53);})[_0xc05b('0x15')](function(_0x3ca671){logger[_0xc05b('0x12')]('CreateMemberReport',_0x3ca671[_0xc05b('0x13')],_0x56cc4a);_0x580d43(_0x370d05[_0xc05b('0x12')](0x1f4,_0x3ca671[_0xc05b('0x13')]));});});};exports['UpdateMemberReport']=function(_0x3e3309){var _0x1b2e4d=this;return new Promise(function(_0x5b57d7,_0x185c98){return db[_0xc05b('0x17')]['update'](_0x3e3309['body'],{'raw':_0x3e3309[_0xc05b('0x18')]?_0x3e3309[_0xc05b('0x18')][_0xc05b('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3e3309[_0xc05b('0x18')]?_0x3e3309['options'][_0xc05b('0x22')]||null:null,'attributes':_0x3e3309['options']?_0x3e3309[_0xc05b('0x18')][_0xc05b('0x1a')]||null:null,'limit':_0x3e3309[_0xc05b('0x18')]?_0x3e3309[_0xc05b('0x18')]['limit']||null:null})[_0xc05b('0x23')](function(_0x37a454){logger['info']('UpdateMemberReport',_0x3e3309);logger[_0xc05b('0xf')](_0xc05b('0x24'),_0x3e3309,JSON[_0xc05b('0x11')](_0x37a454));_0x5b57d7(_0x37a454);})[_0xc05b('0x15')](function(_0x35ae2e){logger['error'](_0xc05b('0x24'),_0x35ae2e[_0xc05b('0x13')],_0x3e3309);_0x185c98(_0x1b2e4d[_0xc05b('0x12')](0x1f4,_0x35ae2e[_0xc05b('0x13')]));});});}; \ No newline at end of file +var _0x5655=['http','request','then','MemberReport,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','catch','GetMemberReport','MemberReport','options','raw','where','attributes','limit','map','include','info','debug','CreateMemberReport','body','UpdateMemberReport','update','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x121fd2,_0x2164e7){var _0xea1043=function(_0x1ccdfa){while(--_0x1ccdfa){_0x121fd2['push'](_0x121fd2['shift']());}};_0xea1043(++_0x2164e7);}(_0x5655,0x15e));var _0x5565=function(_0x505c51,_0x18a9af){_0x505c51=_0x505c51-0x0;var _0xa01d5f=_0x5655[_0x505c51];return _0xa01d5f;};'use strict';var _=require(_0x5565('0x0'));var util=require(_0x5565('0x1'));var moment=require(_0x5565('0x2'));var BPromise=require(_0x5565('0x3'));var rs=require(_0x5565('0x4'));var fs=require('fs');var Redis=require(_0x5565('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x5565('0x6'))('rpc');var config=require(_0x5565('0x7'));var jayson=require(_0x5565('0x8'));var client=jayson[_0x5565('0x9')][_0x5565('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x106d59,_0x5427a3,_0xc88d42){return new BPromise(function(_0x2980c9,_0x1a47c8){return client[_0x5565('0xb')](_0x106d59,_0xc88d42)[_0x5565('0xc')](function(_0x15fbe5){logger['info'](_0x5565('0xd'),_0x5427a3,_0x5565('0xe'));logger['debug']('MemberReport,\x20%s,\x20%s,\x20%s',_0x5427a3,_0x5565('0xe'),JSON[_0x5565('0xf')](_0x15fbe5));if(_0x15fbe5['error']){if(_0x15fbe5['error'][_0x5565('0x10')]===0x1f4){logger[_0x5565('0x11')](_0x5565('0xd'),_0x5427a3,_0x15fbe5[_0x5565('0x11')][_0x5565('0x12')]);return _0x1a47c8(_0x15fbe5[_0x5565('0x11')][_0x5565('0x12')]);}logger[_0x5565('0x11')]('MemberReport,\x20%s,\x20%s',_0x5427a3,_0x15fbe5[_0x5565('0x11')][_0x5565('0x12')]);return _0x2980c9(_0x15fbe5[_0x5565('0x11')][_0x5565('0x12')]);}else{logger['info'](_0x5565('0xd'),_0x5427a3,_0x5565('0xe'));_0x2980c9(_0x15fbe5[_0x5565('0x13')][_0x5565('0x12')]);}})[_0x5565('0x14')](function(_0x592af2){logger['error'](_0x5565('0xd'),_0x5427a3,_0x592af2);_0x1a47c8(_0x592af2);});});}exports[_0x5565('0x15')]=function(_0x4f56df){var _0x36d189=this;return new Promise(function(_0x42002c,_0x339e87){return db[_0x5565('0x16')]['findAll']({'raw':_0x4f56df['options']?_0x4f56df[_0x5565('0x17')][_0x5565('0x18')]===undefined?!![]:![]:!![],'where':_0x4f56df[_0x5565('0x17')]?_0x4f56df[_0x5565('0x17')][_0x5565('0x19')]||null:null,'attributes':_0x4f56df[_0x5565('0x17')]?_0x4f56df['options'][_0x5565('0x1a')]||null:null,'limit':_0x4f56df[_0x5565('0x17')]?_0x4f56df['options'][_0x5565('0x1b')]||null:null,'include':_0x4f56df[_0x5565('0x17')]?_0x4f56df[_0x5565('0x17')]['include']?_[_0x5565('0x1c')](_0x4f56df['options'][_0x5565('0x1d')],function(_0x1ab95b){return{'model':db[_0x1ab95b['model']],'as':_0x1ab95b['as'],'attributes':_0x1ab95b['attributes'],'include':_0x1ab95b[_0x5565('0x1d')]?_[_0x5565('0x1c')](_0x1ab95b[_0x5565('0x1d')],function(_0x53fe47){return{'model':db[_0x53fe47['model']],'as':_0x53fe47['as'],'attributes':_0x53fe47[_0x5565('0x1a')],'include':_0x53fe47[_0x5565('0x1d')]?_['map'](_0x53fe47[_0x5565('0x1d')],function(_0x2eead1){return{'model':db[_0x2eead1['model']],'as':_0x2eead1['as'],'attributes':_0x2eead1[_0x5565('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3d0171){logger[_0x5565('0x1e')](_0x5565('0x15'),_0x4f56df);logger[_0x5565('0x1f')](_0x5565('0x15'),_0x4f56df,JSON[_0x5565('0xf')](_0x3d0171));_0x42002c(_0x3d0171);})[_0x5565('0x14')](function(_0x33bcb6){logger[_0x5565('0x11')]('GetMemberReport',_0x33bcb6[_0x5565('0x12')],_0x4f56df);_0x339e87(_0x36d189['error'](0x1f4,_0x33bcb6['message']));});});};exports[_0x5565('0x20')]=function(_0x5b032c){var _0x37925a=this;return new Promise(function(_0x392579,_0x1bd5aa){return db['MemberReport']['create'](_0x5b032c[_0x5565('0x21')],{'raw':_0x5b032c[_0x5565('0x17')]?_0x5b032c[_0x5565('0x17')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x2ac2b3){logger['info'](_0x5565('0x20'),_0x5b032c);logger['debug'](_0x5565('0x20'),_0x5b032c,JSON['stringify'](_0x2ac2b3));_0x392579(_0x2ac2b3);})['catch'](function(_0xc04467){logger[_0x5565('0x11')]('CreateMemberReport',_0xc04467[_0x5565('0x12')],_0x5b032c);_0x1bd5aa(_0x37925a[_0x5565('0x11')](0x1f4,_0xc04467[_0x5565('0x12')]));});});};exports[_0x5565('0x22')]=function(_0x140718){var _0x265e56=this;return new Promise(function(_0x215f59,_0x1a7399){return db[_0x5565('0x16')][_0x5565('0x23')](_0x140718['body'],{'raw':_0x140718[_0x5565('0x17')]?_0x140718[_0x5565('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x140718[_0x5565('0x17')]?_0x140718[_0x5565('0x17')]['where']||null:null,'attributes':_0x140718[_0x5565('0x17')]?_0x140718[_0x5565('0x17')]['attributes']||null:null,'limit':_0x140718['options']?_0x140718[_0x5565('0x17')][_0x5565('0x1b')]||null:null})[_0x5565('0xc')](function(_0x4e909b){logger[_0x5565('0x1e')](_0x5565('0x22'),_0x140718);logger[_0x5565('0x1f')](_0x5565('0x22'),_0x140718,JSON['stringify'](_0x4e909b));_0x215f59(_0x4e909b);})['catch'](function(_0x4c1254){logger[_0x5565('0x11')](_0x5565('0x22'),_0x4c1254['message'],_0x140718);_0x1a7399(_0x265e56[_0x5565('0x11')](0x1f4,_0x4c1254['message']));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index 07f8298..09979b8 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 _0xb6af=['../../components/auth/service','../../components/interaction/service','../../config/environment','./migration.controller','get','index','multer','util','path','express','Router','fs-extra'];(function(_0x264a70,_0x57194a){var _0x3c8638=function(_0x2cc1ae){while(--_0x2cc1ae){_0x264a70['push'](_0x264a70['shift']());}};_0x3c8638(++_0x57194a);}(_0xb6af,0x1ce));var _0xfb6a=function(_0x144c0c,_0x113cfe){_0x144c0c=_0x144c0c-0x0;var _0x436221=_0xb6af[_0x144c0c];return _0x436221;};'use strict';var multer=require(_0xfb6a('0x0'));var util=require(_0xfb6a('0x1'));var path=require(_0xfb6a('0x2'));var timeout=require('connect-timeout');var express=require(_0xfb6a('0x3'));var router=express[_0xfb6a('0x4')]();var fs_extra=require(_0xfb6a('0x5'));var auth=require(_0xfb6a('0x6'));var interaction=require(_0xfb6a('0x7'));var config=require(_0xfb6a('0x8'));var controller=require(_0xfb6a('0x9'));router[_0xfb6a('0xa')]('/',controller[_0xfb6a('0xb')]);module['exports']=router; \ No newline at end of file +var _0x86db=['exports','multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./migration.controller'];(function(_0x5d5661,_0x33773e){var _0x5dbd14=function(_0x2abe7a){while(--_0x2abe7a){_0x5d5661['push'](_0x5d5661['shift']());}};_0x5dbd14(++_0x33773e);}(_0x86db,0xf4));var _0xb86d=function(_0x27efcf,_0x320952){_0x27efcf=_0x27efcf-0x0;var _0xdb0237=_0x86db[_0x27efcf];return _0xdb0237;};'use strict';var multer=require(_0xb86d('0x0'));var util=require(_0xb86d('0x1'));var path=require('path');var timeout=require(_0xb86d('0x2'));var express=require(_0xb86d('0x3'));var router=express[_0xb86d('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xb86d('0x5'));var config=require(_0xb86d('0x6'));var controller=require(_0xb86d('0x7'));router['get']('/',controller['index']);module[_0xb86d('0x8')]=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index 6d2dcdb..d506a4a 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 _0xe204=['version','sequelize','exports','STRING'];(function(_0xc79956,_0x1f5698){var _0x1b29dc=function(_0x5cffc3){while(--_0x5cffc3){_0xc79956['push'](_0xc79956['shift']());}};_0x1b29dc(++_0x1f5698);}(_0xe204,0xad));var _0x4e20=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xe204[_0x4a9fb1];return _0x348672;};'use strict';var Sequelize=require(_0x4e20('0x0'));module[_0x4e20('0x1')]={'version':{'type':Sequelize[_0x4e20('0x2')],'unique':_0x4e20('0x3')}}; \ No newline at end of file +var _0xe1ae=['exports','STRING'];(function(_0x5f298d,_0x589f94){var _0x93496c=function(_0x5a1408){while(--_0x5a1408){_0x5f298d['push'](_0x5f298d['shift']());}};_0x93496c(++_0x589f94);}(_0xe1ae,0x1a2));var _0xee1a=function(_0x3d6d80,_0x1689b7){_0x3d6d80=_0x3d6d80-0x0;var _0x30712a=_0xe1ae[_0x3d6d80];return _0x30712a;};'use strict';var Sequelize=require('sequelize');module[_0xee1a('0x0')]={'version':{'type':Sequelize[_0xee1a('0x1')],'unique':'version'}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index 9c09ce8..72af737 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 _0x6426=['path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','end','error','stack','name','send','index','map','Migration','rawAttributes','fieldName','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','includeAll','include','catch','rimraf','fast-json-patch','moment','bluebird','mustache','util'];(function(_0x434758,_0x59e4de){var _0x2203ef=function(_0x518998){while(--_0x518998){_0x434758['push'](_0x434758['shift']());}};_0x2203ef(++_0x59e4de);}(_0x6426,0x1eb));var _0x6642=function(_0x1cfc09,_0x33a5b5){_0x1cfc09=_0x1cfc09-0x0;var _0x2642ca=_0x6426[_0x1cfc09];return _0x2642ca;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6642('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6642('0x1'));var rp=require('request-promise');var moment=require(_0x6642('0x2'));var BPromise=require(_0x6642('0x3'));var Mustache=require(_0x6642('0x4'));var util=require(_0x6642('0x5'));var path=require(_0x6642('0x6'));var sox=require(_0x6642('0x7'));var csv=require(_0x6642('0x8'));var ejs=require(_0x6642('0x9'));var fs=require('fs');var fs_extra=require(_0x6642('0xa'));var _=require(_0x6642('0xb'));var squel=require('squel');var crypto=require(_0x6642('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x6642('0xd'));var toCsv=require(_0x6642('0x8'));var querystring=require(_0x6642('0xe'));var Papa=require(_0x6642('0xf'));var Redis=require(_0x6642('0x10'));var authService=require(_0x6642('0x11'));var qs=require(_0x6642('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6642('0x13'));var logger=require(_0x6642('0x14'))(_0x6642('0x15'));var utils=require('../../config/utils');var config=require(_0x6642('0x16'));var licenseUtil=require(_0x6642('0x17'));var db=require(_0x6642('0x18'))['db'];function respondWithStatusCode(_0x5b4d88,_0x33ebc8){_0x33ebc8=_0x33ebc8||0xcc;return function(_0x53d83f){if(_0x53d83f){return _0x5b4d88[_0x6642('0x19')](_0x33ebc8);}return _0x5b4d88[_0x6642('0x1a')](_0x33ebc8)['end']();};}function respondWithResult(_0x4d1ee7,_0x5f4a58){_0x5f4a58=_0x5f4a58||0xc8;return function(_0x4dc136){if(_0x4dc136){return _0x4d1ee7[_0x6642('0x1a')](_0x5f4a58)[_0x6642('0x1b')](_0x4dc136);}};}function respondWithFilteredResult(_0x52a1e2,_0xa7ee7e){return function(_0x4e570f){if(_0x4e570f){var _0x4b41c1=typeof _0xa7ee7e[_0x6642('0x1c')]===_0x6642('0x1d')&&typeof _0xa7ee7e[_0x6642('0x1e')]==='undefined';var _0xd76ed1=_0x4e570f[_0x6642('0x1f')];var _0x50d2c1=_0x4b41c1?0x0:_0xa7ee7e[_0x6642('0x1c')];var _0x3844f8=_0x4b41c1?_0x4e570f[_0x6642('0x1f')]:_0xa7ee7e[_0x6642('0x1c')]+_0xa7ee7e[_0x6642('0x1e')];var _0x2cf34e;if(_0x3844f8>=_0xd76ed1){_0x3844f8=_0xd76ed1;_0x2cf34e=0xc8;}else{_0x2cf34e=0xce;}_0x52a1e2[_0x6642('0x1a')](_0x2cf34e);return _0x52a1e2[_0x6642('0x20')](_0x6642('0x21'),_0x50d2c1+'-'+_0x3844f8+'/'+_0xd76ed1)[_0x6642('0x1b')](_0x4e570f);}return null;};}function patchUpdates(_0x28d53a){return function(_0x399b0){try{jsonpatch[_0x6642('0x22')](_0x399b0,_0x28d53a,!![]);}catch(_0x58061f){return BPromise[_0x6642('0x23')](_0x58061f);}return _0x399b0[_0x6642('0x24')]();};}function saveUpdates(_0xdc7fbe,_0xee21e){return function(_0x1cbd26){if(_0x1cbd26){return _0x1cbd26['update'](_0xdc7fbe)[_0x6642('0x25')](function(_0x321722){return _0x321722;});}return null;};}function removeEntity(_0x168599,_0x4bbca0){return function(_0x384739){if(_0x384739){return _0x384739[_0x6642('0x26')]()[_0x6642('0x25')](function(){_0x168599[_0x6642('0x1a')](0xcc)[_0x6642('0x27')]();});}};}function handleEntityNotFound(_0x43f77f,_0x4d92c9){return function(_0x522490){if(!_0x522490){_0x43f77f[_0x6642('0x19')](0x194);}return _0x522490;};}function handleError(_0xe27271,_0x2b8510){_0x2b8510=_0x2b8510||0x1f4;return function(_0x1ca323){logger[_0x6642('0x28')](_0x1ca323[_0x6642('0x29')]);if(_0x1ca323[_0x6642('0x2a')]){delete _0x1ca323['name'];}_0xe27271['status'](_0x2b8510)[_0x6642('0x2b')](_0x1ca323);};}exports[_0x6642('0x2c')]=function(_0x562ecc,_0x2b76cc){var _0x10ccf6={},_0x412cdb={},_0x519d7d={'count':0x0,'rows':[]};var _0x2cbe2a=_[_0x6642('0x2d')](db[_0x6642('0x2e')][_0x6642('0x2f')],function(_0x5e24e5){return{'name':_0x5e24e5[_0x6642('0x30')],'type':_0x5e24e5['type'][_0x6642('0x31')]};});_0x412cdb['model']=_[_0x6642('0x2d')](_0x2cbe2a,_0x6642('0x2a'));_0x412cdb[_0x6642('0x32')]=_[_0x6642('0x33')](_0x562ecc[_0x6642('0x32')]);_0x412cdb[_0x6642('0x34')]=_[_0x6642('0x35')](_0x412cdb['model'],_0x412cdb[_0x6642('0x32')]);_0x10ccf6[_0x6642('0x36')]=_['intersection'](_0x412cdb[_0x6642('0x37')],qs[_0x6642('0x38')](_0x562ecc[_0x6642('0x32')][_0x6642('0x38')]));_0x10ccf6[_0x6642('0x36')]=_0x10ccf6[_0x6642('0x36')][_0x6642('0x39')]?_0x10ccf6[_0x6642('0x36')]:_0x412cdb[_0x6642('0x37')];if(!_0x562ecc['query'][_0x6642('0x3a')](_0x6642('0x3b'))){_0x10ccf6[_0x6642('0x1e')]=qs[_0x6642('0x1e')](_0x562ecc['query']['limit']);_0x10ccf6[_0x6642('0x1c')]=qs[_0x6642('0x1c')](_0x562ecc[_0x6642('0x32')][_0x6642('0x1c')]);}_0x10ccf6[_0x6642('0x3c')]=qs[_0x6642('0x3d')](_0x562ecc[_0x6642('0x32')][_0x6642('0x3d')]);_0x10ccf6[_0x6642('0x3e')]=qs['filters'](_[_0x6642('0x3f')](_0x562ecc['query'],_0x412cdb[_0x6642('0x34')]),_0x2cbe2a);if(_0x562ecc['query'][_0x6642('0x40')]){_0x10ccf6[_0x6642('0x3e')]=_[_0x6642('0x41')](_0x10ccf6['where'],{'$or':_[_0x6642('0x2d')](_0x2cbe2a,function(_0x4042de){if(_0x4042de[_0x6642('0x42')]!=='VIRTUAL'){var _0x89643f={};_0x89643f[_0x4042de[_0x6642('0x2a')]]={'$like':'%'+_0x562ecc['query'][_0x6642('0x40')]+'%'};return _0x89643f;}})});}_0x10ccf6=_['merge']({},_0x10ccf6,_0x562ecc[_0x6642('0x43')]);var _0x15a77a={'where':_0x10ccf6['where']};return db[_0x6642('0x2e')][_0x6642('0x1f')](_0x15a77a)['then'](function(_0x4f3191){_0x519d7d[_0x6642('0x1f')]=_0x4f3191;if(_0x562ecc[_0x6642('0x32')][_0x6642('0x44')]){_0x10ccf6[_0x6642('0x45')]=[{'all':!![]}];}return db[_0x6642('0x2e')]['findAll'](_0x10ccf6);})[_0x6642('0x25')](function(_0x57fffa){_0x519d7d['rows']=_0x57fffa;return _0x519d7d;})['then'](respondWithFilteredResult(_0x2b76cc,_0x10ccf6))[_0x6642('0x46')](handleError(_0x2b76cc,null));}; \ No newline at end of file +var _0x83bd=['keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','merge','where','type','VIRTUAL','options','Migration','includeAll','include','findAll','catch','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','destroy','sendStatus','error','stack','name','send','index','map','fieldName','key','model','query'];(function(_0x37abca,_0x11f1b5){var _0x253800=function(_0xa88e9f){while(--_0xa88e9f){_0x37abca['push'](_0x37abca['shift']());}};_0x253800(++_0x11f1b5);}(_0x83bd,0xed));var _0xd83b=function(_0x18cd5b,_0x10240b){_0x18cd5b=_0x18cd5b-0x0;var _0x5eaa52=_0x83bd[_0x18cd5b];return _0x5eaa52;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd83b('0x0'));var zipdir=require(_0xd83b('0x1'));var jsonpatch=require(_0xd83b('0x2'));var rp=require(_0xd83b('0x3'));var moment=require(_0xd83b('0x4'));var BPromise=require(_0xd83b('0x5'));var Mustache=require(_0xd83b('0x6'));var util=require('util');var path=require(_0xd83b('0x7'));var sox=require(_0xd83b('0x8'));var csv=require(_0xd83b('0x9'));var ejs=require(_0xd83b('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd83b('0xb'));var squel=require(_0xd83b('0xc'));var crypto=require(_0xd83b('0xd'));var jsforce=require(_0xd83b('0xe'));var deskjs=require(_0xd83b('0xf'));var toCsv=require(_0xd83b('0x9'));var querystring=require(_0xd83b('0x10'));var Papa=require(_0xd83b('0x11'));var Redis=require(_0xd83b('0x12'));var authService=require(_0xd83b('0x13'));var qs=require(_0xd83b('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd83b('0x15'));var logger=require('../../config/logger')(_0xd83b('0x16'));var utils=require('../../config/utils');var config=require(_0xd83b('0x17'));var licenseUtil=require(_0xd83b('0x18'));var db=require(_0xd83b('0x19'))['db'];function respondWithStatusCode(_0x1270b6,_0x370b95){_0x370b95=_0x370b95||0xcc;return function(_0x407069){if(_0x407069){return _0x1270b6['sendStatus'](_0x370b95);}return _0x1270b6[_0xd83b('0x1a')](_0x370b95)[_0xd83b('0x1b')]();};}function respondWithResult(_0x7b2d8c,_0x5aa2e3){_0x5aa2e3=_0x5aa2e3||0xc8;return function(_0x832ad7){if(_0x832ad7){return _0x7b2d8c[_0xd83b('0x1a')](_0x5aa2e3)[_0xd83b('0x1c')](_0x832ad7);}};}function respondWithFilteredResult(_0x187018,_0x232fc7){return function(_0x5e2ef3){if(_0x5e2ef3){var _0x5aca8c=typeof _0x232fc7[_0xd83b('0x1d')]==='undefined'&&typeof _0x232fc7[_0xd83b('0x1e')]===_0xd83b('0x1f');var _0x1ed760=_0x5e2ef3[_0xd83b('0x20')];var _0x28d7b5=_0x5aca8c?0x0:_0x232fc7['offset'];var _0x3d85d1=_0x5aca8c?_0x5e2ef3[_0xd83b('0x20')]:_0x232fc7[_0xd83b('0x1d')]+_0x232fc7[_0xd83b('0x1e')];var _0x470317;if(_0x3d85d1>=_0x1ed760){_0x3d85d1=_0x1ed760;_0x470317=0xc8;}else{_0x470317=0xce;}_0x187018[_0xd83b('0x1a')](_0x470317);return _0x187018[_0xd83b('0x21')](_0xd83b('0x22'),_0x28d7b5+'-'+_0x3d85d1+'/'+_0x1ed760)[_0xd83b('0x1c')](_0x5e2ef3);}return null;};}function patchUpdates(_0x33b0dc){return function(_0x926380){try{jsonpatch[_0xd83b('0x23')](_0x926380,_0x33b0dc,!![]);}catch(_0xb91b56){return BPromise[_0xd83b('0x24')](_0xb91b56);}return _0x926380[_0xd83b('0x25')]();};}function saveUpdates(_0x9a9dde,_0x21bcfd){return function(_0x369563){if(_0x369563){return _0x369563['update'](_0x9a9dde)[_0xd83b('0x26')](function(_0x1e0d66){return _0x1e0d66;});}return null;};}function removeEntity(_0x5d0619,_0x4747d4){return function(_0x358a4d){if(_0x358a4d){return _0x358a4d[_0xd83b('0x27')]()[_0xd83b('0x26')](function(){_0x5d0619[_0xd83b('0x1a')](0xcc)[_0xd83b('0x1b')]();});}};}function handleEntityNotFound(_0x13cb28,_0x5629e7){return function(_0x2b462b){if(!_0x2b462b){_0x13cb28[_0xd83b('0x28')](0x194);}return _0x2b462b;};}function handleError(_0x45cf56,_0x2e04e5){_0x2e04e5=_0x2e04e5||0x1f4;return function(_0xec00c2){logger[_0xd83b('0x29')](_0xec00c2[_0xd83b('0x2a')]);if(_0xec00c2[_0xd83b('0x2b')]){delete _0xec00c2[_0xd83b('0x2b')];}_0x45cf56['status'](_0x2e04e5)[_0xd83b('0x2c')](_0xec00c2);};}exports[_0xd83b('0x2d')]=function(_0x3639e1,_0x2394e2){var _0x38d6c3={},_0xcf3c78={},_0x56686c={'count':0x0,'rows':[]};var _0x8002bd=_[_0xd83b('0x2e')](db['Migration']['rawAttributes'],function(_0xd89065){return{'name':_0xd89065[_0xd83b('0x2f')],'type':_0xd89065['type'][_0xd83b('0x30')]};});_0xcf3c78[_0xd83b('0x31')]=_['map'](_0x8002bd,_0xd83b('0x2b'));_0xcf3c78[_0xd83b('0x32')]=_[_0xd83b('0x33')](_0x3639e1[_0xd83b('0x32')]);_0xcf3c78[_0xd83b('0x34')]=_[_0xd83b('0x35')](_0xcf3c78[_0xd83b('0x31')],_0xcf3c78[_0xd83b('0x32')]);_0x38d6c3[_0xd83b('0x36')]=_[_0xd83b('0x35')](_0xcf3c78[_0xd83b('0x31')],qs[_0xd83b('0x37')](_0x3639e1[_0xd83b('0x32')][_0xd83b('0x37')]));_0x38d6c3['attributes']=_0x38d6c3['attributes'][_0xd83b('0x38')]?_0x38d6c3[_0xd83b('0x36')]:_0xcf3c78[_0xd83b('0x31')];if(!_0x3639e1[_0xd83b('0x32')][_0xd83b('0x39')](_0xd83b('0x3a'))){_0x38d6c3[_0xd83b('0x1e')]=qs[_0xd83b('0x1e')](_0x3639e1[_0xd83b('0x32')][_0xd83b('0x1e')]);_0x38d6c3[_0xd83b('0x1d')]=qs[_0xd83b('0x1d')](_0x3639e1['query'][_0xd83b('0x1d')]);}_0x38d6c3[_0xd83b('0x3b')]=qs[_0xd83b('0x3c')](_0x3639e1[_0xd83b('0x32')]['sort']);_0x38d6c3['where']=qs['filters'](_['pick'](_0x3639e1[_0xd83b('0x32')],_0xcf3c78[_0xd83b('0x34')]),_0x8002bd);if(_0x3639e1[_0xd83b('0x32')][_0xd83b('0x3d')]){_0x38d6c3['where']=_[_0xd83b('0x3e')](_0x38d6c3[_0xd83b('0x3f')],{'$or':_['map'](_0x8002bd,function(_0x462ba5){if(_0x462ba5[_0xd83b('0x40')]!==_0xd83b('0x41')){var _0x44ca2a={};_0x44ca2a[_0x462ba5[_0xd83b('0x2b')]]={'$like':'%'+_0x3639e1[_0xd83b('0x32')]['filter']+'%'};return _0x44ca2a;}})});}_0x38d6c3=_[_0xd83b('0x3e')]({},_0x38d6c3,_0x3639e1[_0xd83b('0x42')]);var _0x1ed93e={'where':_0x38d6c3['where']};return db[_0xd83b('0x43')][_0xd83b('0x20')](_0x1ed93e)['then'](function(_0x269004){_0x56686c[_0xd83b('0x20')]=_0x269004;if(_0x3639e1['query'][_0xd83b('0x44')]){_0x38d6c3[_0xd83b('0x45')]=[{'all':!![]}];}return db['Migration'][_0xd83b('0x46')](_0x38d6c3);})['then'](function(_0x367632){_0x56686c['rows']=_0x367632;return _0x56686c;})[_0xd83b('0x26')](respondWithFilteredResult(_0x2394e2,_0x38d6c3))[_0xd83b('0x47')](handleError(_0x2394e2,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index f4f1561..46e4050 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 _0x88b4=['migrations','lodash','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./migration.attributes','exports','Migration'];(function(_0x496819,_0x2e3e5f){var _0x5d8095=function(_0x55afa3){while(--_0x55afa3){_0x496819['push'](_0x496819['shift']());}};_0x5d8095(++_0x2e3e5f);}(_0x88b4,0x7a));var _0x488b=function(_0xfbe06e,_0x2fb7ab){_0xfbe06e=_0xfbe06e-0x0;var _0x24e5b6=_0x88b4[_0xfbe06e];return _0x24e5b6;};'use strict';var _=require(_0x488b('0x0'));var util=require('util');var logger=require(_0x488b('0x1'))('api');var moment=require(_0x488b('0x2'));var BPromise=require(_0x488b('0x3'));var rp=require(_0x488b('0x4'));var fs=require('fs');var path=require(_0x488b('0x5'));var rimraf=require('rimraf');var config=require(_0x488b('0x6'));var attributes=require(_0x488b('0x7'));module[_0x488b('0x8')]=function(_0xb67bd2,_0x2256fa){return _0xb67bd2['define'](_0x488b('0x9'),attributes,{'tableName':_0x488b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5510=['exports','migrations','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./migration.attributes'];(function(_0x104d23,_0x39fb6c){var _0x1988c5=function(_0x1c839f){while(--_0x1c839f){_0x104d23['push'](_0x104d23['shift']());}};_0x1988c5(++_0x39fb6c);}(_0x5510,0x9c));var _0x0551=function(_0x40015a,_0x415db5){_0x40015a=_0x40015a-0x0;var _0x42f8a4=_0x5510[_0x40015a];return _0x42f8a4;};'use strict';var _=require(_0x0551('0x0'));var util=require(_0x0551('0x1'));var logger=require(_0x0551('0x2'))(_0x0551('0x3'));var moment=require('moment');var BPromise=require(_0x0551('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0551('0x5'));var rimraf=require(_0x0551('0x6'));var config=require(_0x0551('0x7'));var attributes=require(_0x0551('0x8'));module[_0x0551('0x9')]=function(_0x5a379e,_0x5264da){return _0x5a379e['define']('Migration',attributes,{'tableName':_0x0551('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/migration/migration.rpc.js b/server/api/migration/migration.rpc.js index cde780c..23cf562 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 _0xd139=['../../config/logger','rpc','../../config/environment','client','http','info','Migration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x119e57,_0x49a453){var _0xa89dc7=function(_0x2c6709){while(--_0x2c6709){_0x119e57['push'](_0x119e57['shift']());}};_0xa89dc7(++_0x49a453);}(_0xd139,0x14e));var _0x9d13=function(_0x210d57,_0x280153){_0x210d57=_0x210d57-0x0;var _0x32a96a=_0xd139[_0x210d57];return _0x32a96a;};'use strict';var _=require(_0x9d13('0x0'));var util=require(_0x9d13('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x9d13('0x2'));var fs=require('fs');var Redis=require(_0x9d13('0x3'));var db=require(_0x9d13('0x4'))['db'];var utils=require(_0x9d13('0x5'));var logger=require(_0x9d13('0x6'))(_0x9d13('0x7'));var config=require(_0x9d13('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x9d13('0x9')][_0x9d13('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x50294b,_0x198d7d,_0x4b3db0){return new BPromise(function(_0x434ef6,_0x524947){return client['request'](_0x50294b,_0x4b3db0)['then'](function(_0x3ccdf9){logger[_0x9d13('0xb')](_0x9d13('0xc'),_0x198d7d,_0x9d13('0xd'));logger[_0x9d13('0xe')]('Migration,\x20%s,\x20%s,\x20%s',_0x198d7d,_0x9d13('0xd'),JSON[_0x9d13('0xf')](_0x3ccdf9));if(_0x3ccdf9[_0x9d13('0x10')]){if(_0x3ccdf9['error']['code']===0x1f4){logger[_0x9d13('0x10')](_0x9d13('0xc'),_0x198d7d,_0x3ccdf9[_0x9d13('0x10')][_0x9d13('0x11')]);return _0x524947(_0x3ccdf9[_0x9d13('0x10')]['message']);}logger['error'](_0x9d13('0xc'),_0x198d7d,_0x3ccdf9[_0x9d13('0x10')][_0x9d13('0x11')]);return _0x434ef6(_0x3ccdf9[_0x9d13('0x10')][_0x9d13('0x11')]);}else{logger[_0x9d13('0xb')](_0x9d13('0xc'),_0x198d7d,'request\x20sent');_0x434ef6(_0x3ccdf9[_0x9d13('0x12')][_0x9d13('0x11')]);}})[_0x9d13('0x13')](function(_0x250234){logger[_0x9d13('0x10')](_0x9d13('0xc'),_0x198d7d,_0x250234);_0x524947(_0x250234);});});} \ No newline at end of file +var _0xb458=['info','Migration,\x20%s,\x20%s','request\x20sent','Migration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x4619f6,_0x47902d){var _0x2a0bc2=function(_0x427aa0){while(--_0x427aa0){_0x4619f6['push'](_0x4619f6['shift']());}};_0x2a0bc2(++_0x47902d);}(_0xb458,0xca));var _0x8b45=function(_0x1bcac2,_0x2f2084){_0x1bcac2=_0x1bcac2-0x0;var _0x3f813a=_0xb458[_0x1bcac2];return _0x3f813a;};'use strict';var _=require(_0x8b45('0x0'));var util=require(_0x8b45('0x1'));var moment=require(_0x8b45('0x2'));var BPromise=require(_0x8b45('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8b45('0x4'));var db=require(_0x8b45('0x5'))['db'];var utils=require(_0x8b45('0x6'));var logger=require(_0x8b45('0x7'))(_0x8b45('0x8'));var config=require(_0x8b45('0x9'));var jayson=require(_0x8b45('0xa'));var client=jayson[_0x8b45('0xb')][_0x8b45('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x114de0,_0x15dcf4,_0x2f0c9e){return new BPromise(function(_0x1386a4,_0x54f299){return client[_0x8b45('0xd')](_0x114de0,_0x2f0c9e)['then'](function(_0x4a1617){logger[_0x8b45('0xe')](_0x8b45('0xf'),_0x15dcf4,_0x8b45('0x10'));logger['debug'](_0x8b45('0x11'),_0x15dcf4,'request\x20sent',JSON[_0x8b45('0x12')](_0x4a1617));if(_0x4a1617[_0x8b45('0x13')]){if(_0x4a1617[_0x8b45('0x13')][_0x8b45('0x14')]===0x1f4){logger[_0x8b45('0x13')]('Migration,\x20%s,\x20%s',_0x15dcf4,_0x4a1617['error'][_0x8b45('0x15')]);return _0x54f299(_0x4a1617[_0x8b45('0x13')][_0x8b45('0x15')]);}logger[_0x8b45('0x13')](_0x8b45('0xf'),_0x15dcf4,_0x4a1617[_0x8b45('0x13')][_0x8b45('0x15')]);return _0x1386a4(_0x4a1617[_0x8b45('0x13')][_0x8b45('0x15')]);}else{logger[_0x8b45('0xe')](_0x8b45('0xf'),_0x15dcf4,_0x8b45('0x10'));_0x1386a4(_0x4a1617[_0x8b45('0x16')][_0x8b45('0x15')]);}})[_0x8b45('0x17')](function(_0x59547e){logger['error'](_0x8b45('0xf'),_0x15dcf4,_0x59547e);_0x54f299(_0x59547e);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index 4bc9fb2..36efa3b 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 _0x6a58=['update','delete','destroy','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./network.controller','get','index','isAuthenticated','show','post','create','put','/:id'];(function(_0x3d7bab,_0x439da7){var _0x209859=function(_0x132190){while(--_0x132190){_0x3d7bab['push'](_0x3d7bab['shift']());}};_0x209859(++_0x439da7);}(_0x6a58,0x120));var _0x86a5=function(_0x368e09,_0x2c1517){_0x368e09=_0x368e09-0x0;var _0x14b7df=_0x6a58[_0x368e09];return _0x14b7df;};'use strict';var multer=require(_0x86a5('0x0'));var util=require(_0x86a5('0x1'));var path=require('path');var timeout=require(_0x86a5('0x2'));var express=require('express');var router=express[_0x86a5('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x86a5('0x4'));var interaction=require(_0x86a5('0x5'));var config=require(_0x86a5('0x6'));var controller=require(_0x86a5('0x7'));router[_0x86a5('0x8')]('/',auth['isAuthenticated'](),controller[_0x86a5('0x9')]);router[_0x86a5('0x8')]('/:id',auth[_0x86a5('0xa')](),controller[_0x86a5('0xb')]);router[_0x86a5('0xc')]('/',auth[_0x86a5('0xa')](),controller[_0x86a5('0xd')]);router[_0x86a5('0xe')](_0x86a5('0xf'),auth[_0x86a5('0xa')](),controller[_0x86a5('0x10')]);router[_0x86a5('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x86a5('0x12')]);module['exports']=router; \ No newline at end of file +var _0xcde7=['connect-timeout','express','../../components/auth/service','../../config/environment','./network.controller','get','isAuthenticated','index','post','create','put','update','delete','/:id','destroy','exports','path'];(function(_0x1b6e5d,_0x52c24f){var _0x1251b=function(_0xe25a3b){while(--_0xe25a3b){_0x1b6e5d['push'](_0x1b6e5d['shift']());}};_0x1251b(++_0x52c24f);}(_0xcde7,0x65));var _0x7cde=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xcde7[_0x122ef9];return _0x42fba0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x7cde('0x0'));var timeout=require(_0x7cde('0x1'));var express=require(_0x7cde('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x7cde('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x7cde('0x4'));var controller=require(_0x7cde('0x5'));router[_0x7cde('0x6')]('/',auth[_0x7cde('0x7')](),controller[_0x7cde('0x8')]);router[_0x7cde('0x6')]('/:id',auth[_0x7cde('0x7')](),controller['show']);router[_0x7cde('0x9')]('/',auth[_0x7cde('0x7')](),controller[_0x7cde('0xa')]);router[_0x7cde('0xb')]('/:id',auth[_0x7cde('0x7')](),controller[_0x7cde('0xc')]);router[_0x7cde('0xd')](_0x7cde('0xe'),auth[_0x7cde('0x7')](),controller[_0x7cde('0xf')]);module[_0x7cde('0x10')]=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index 3315f39..e2a4f86 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 _0x543f=['externip','stun','turn','STRING','ENUM'];(function(_0x69050,_0x4a5981){var _0x231d0b=function(_0x53837b){while(--_0x53837b){_0x69050['push'](_0x69050['shift']());}};_0x231d0b(++_0x4a5981);}(_0x543f,0x126));var _0xf543=function(_0x375421,_0x5b57fe){_0x375421=_0x375421-0x0;var _0x2da1a6=_0x543f[_0x375421];return _0x2da1a6;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0xf543('0x0')]('localnet',_0xf543('0x1'),_0xf543('0x2'),_0xf543('0x3'))},'value':{'type':Sequelize[_0xf543('0x4')]},'username':{'type':Sequelize[_0xf543('0x4')]},'password':{'type':Sequelize[_0xf543('0x4')]}}; \ No newline at end of file +var _0x4f94=['STRING','sequelize','exports','ENUM','localnet','externip','stun','turn'];(function(_0x38eb23,_0x196e8b){var _0x48506a=function(_0x36edb0){while(--_0x36edb0){_0x38eb23['push'](_0x38eb23['shift']());}};_0x48506a(++_0x196e8b);}(_0x4f94,0x1a9));var _0x44f9=function(_0x10a185,_0x554999){_0x10a185=_0x10a185-0x0;var _0x17e4c7=_0x4f94[_0x10a185];return _0x17e4c7;};'use strict';var Sequelize=require(_0x44f9('0x0'));module[_0x44f9('0x1')]={'type':{'type':Sequelize[_0x44f9('0x2')](_0x44f9('0x3'),_0x44f9('0x4'),_0x44f9('0x5'),_0x44f9('0x6'))},'value':{'type':Sequelize[_0x44f9('0x7')]},'username':{'type':Sequelize[_0x44f9('0x7')]},'password':{'type':Sequelize[_0x44f9('0x7')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index 741bb83..7bed3d7 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 _0x2255=['catch','body','type','STUN','readFileSync','join','root','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','create','TURN','server/files/templates/turn_multiple.ejs','/etc/asterisk/turn_xcally.conf','res_stun_monitor.so','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','find','toUpperCase','destroy','util','path','ejs','lodash','../../components/parsers/qs','api','../../config/environment','jayson/promise','http','info','Network,\x20%s,\x20%s','debug','Network,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','status','json','offset','undefined','limit','count','set','Content-Range','update','then','sendStatus','stack','name','index','Network','rawAttributes','key','model','map','keys','intersection','query','fields','attributes','hasOwnProperty','order','sort','filters','filter','merge','VIRTUAL','options','where','include','findAll','rows','show','params','length'];(function(_0x4a6a8e,_0xd1dee2){var _0x198cb0=function(_0x3ba86f){while(--_0x3ba86f){_0x4a6a8e['push'](_0x4a6a8e['shift']());}};_0x198cb0(++_0xd1dee2);}(_0x2255,0xc0));var _0x5225=function(_0x292b68,_0x459471){_0x292b68=_0x292b68-0x0;var _0x4e92d7=_0x2255[_0x292b68];return _0x4e92d7;};'use strict';var util=require(_0x5225('0x0'));var path=require(_0x5225('0x1'));var ejs=require(_0x5225('0x2'));var fs=require('fs');var _=require(_0x5225('0x3'));var qs=require(_0x5225('0x4'));var logger=require('../../config/logger')(_0x5225('0x5'));var config=require(_0x5225('0x6'));var db=require('../../mysqldb')['db'];var jayson=require(_0x5225('0x7'));var client=jayson['client'][_0x5225('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3738ee,_0x5dc094,_0x11778b,_0x2818f1){return new Promise(function(_0x428df7,_0x109fc6){var _0x7c7b4d=_0x2818f1||client;return _0x7c7b4d['request'](_0x3738ee,_0x11778b)['then'](function(_0x266800){logger[_0x5225('0x9')](_0x5225('0xa'),_0x5dc094,'request\x20sent');logger[_0x5225('0xb')](_0x5225('0xc'),_0x5dc094,_0x5225('0xd'),JSON[_0x5225('0xe')](_0x266800));if(_0x266800['error']){if(_0x266800[_0x5225('0xf')][_0x5225('0x10')]===0x1f4){logger['error'](_0x5225('0xa'),_0x5dc094,_0x266800[_0x5225('0xf')]['message']);return _0x109fc6(_0x266800[_0x5225('0xf')][_0x5225('0x11')]);}logger[_0x5225('0xf')](_0x5225('0xa'),_0x5dc094,_0x266800[_0x5225('0xf')][_0x5225('0x11')]);return _0x428df7(_0x266800[_0x5225('0xf')]['message']);}else{logger[_0x5225('0x9')]('Network,\x20%s,\x20%s',_0x5dc094,_0x5225('0xd'));_0x428df7(_0x266800['result'][_0x5225('0x11')]);}})['catch'](function(_0x24bce0){logger['error'](_0x5225('0xa'),_0x5dc094,_0x24bce0);_0x109fc6(_0x24bce0);});});}function respondWithResult(_0x371efe,_0x79033){_0x79033=_0x79033||0xc8;return function(_0x263ae0){if(_0x263ae0){return _0x371efe[_0x5225('0x12')](_0x79033)[_0x5225('0x13')](_0x263ae0);}};}function respondWithFilteredResult(_0x4831ea,_0x4454b3){return function(_0x300581){if(_0x300581){var _0x1f1a7a=typeof _0x4454b3[_0x5225('0x14')]===_0x5225('0x15')&&typeof _0x4454b3[_0x5225('0x16')]==='undefined';var _0x3627d2=_0x300581[_0x5225('0x17')];var _0x2f5712=_0x1f1a7a?0x0:_0x4454b3[_0x5225('0x14')];var _0x199e64=_0x1f1a7a?_0x300581[_0x5225('0x17')]:_0x4454b3[_0x5225('0x14')]+_0x4454b3['limit'];var _0x31a12e;if(_0x199e64>=_0x3627d2){_0x199e64=_0x3627d2;_0x31a12e=0xc8;}else{_0x31a12e=0xce;}_0x4831ea[_0x5225('0x12')](_0x31a12e);return _0x4831ea[_0x5225('0x18')](_0x5225('0x19'),_0x2f5712+'-'+_0x199e64+'/'+_0x3627d2)['json'](_0x300581);}return null;};}function saveUpdates(_0x15db9f){return function(_0x545def){if(_0x545def){return _0x545def[_0x5225('0x1a')](_0x15db9f)[_0x5225('0x1b')](function(_0x5034c4){return _0x5034c4;});}return null;};}function removeEntity(_0x1034b4){return function(_0x1667c9){if(_0x1667c9){return _0x1667c9['destroy']()[_0x5225('0x1b')](function(){_0x1034b4[_0x5225('0x12')](0xcc)['end']();});}};}function handleEntityNotFound(_0x540c6a){return function(_0x2ec7e3){if(!_0x2ec7e3){_0x540c6a[_0x5225('0x1c')](0x194);}return _0x2ec7e3;};}function handleError(_0x3f641b,_0x5742b3){_0x5742b3=_0x5742b3||0x1f4;return function(_0x2486f0){logger[_0x5225('0xf')](_0x2486f0[_0x5225('0x1d')]);if(_0x2486f0[_0x5225('0x1e')]){delete _0x2486f0[_0x5225('0x1e')];}_0x3f641b['status'](_0x5742b3)['send'](_0x2486f0);};}exports[_0x5225('0x1f')]=function(_0x530c39,_0x3db620){var _0x268aa1={},_0x3eb476={},_0x286c37={'count':0x0,'rows':[]};var _0x58565d=_['map'](db[_0x5225('0x20')][_0x5225('0x21')],function(_0x1e8d4c){return{'name':_0x1e8d4c['fieldName'],'type':_0x1e8d4c['type'][_0x5225('0x22')]};});_0x3eb476[_0x5225('0x23')]=_[_0x5225('0x24')](_0x58565d,_0x5225('0x1e'));_0x3eb476['query']=_[_0x5225('0x25')](_0x530c39['query']);_0x3eb476['filters']=_[_0x5225('0x26')](_0x3eb476['model'],_0x3eb476[_0x5225('0x27')]);_0x268aa1['attributes']=_[_0x5225('0x26')](_0x3eb476[_0x5225('0x23')],qs[_0x5225('0x28')](_0x530c39[_0x5225('0x27')][_0x5225('0x28')]));_0x268aa1[_0x5225('0x29')]=_0x268aa1['attributes']['length']?_0x268aa1['attributes']:_0x3eb476[_0x5225('0x23')];if(!_0x530c39[_0x5225('0x27')][_0x5225('0x2a')]('nolimit')){_0x268aa1[_0x5225('0x16')]=qs[_0x5225('0x16')](_0x530c39[_0x5225('0x27')]['limit']);_0x268aa1[_0x5225('0x14')]=qs[_0x5225('0x14')](_0x530c39[_0x5225('0x27')][_0x5225('0x14')]);}_0x268aa1[_0x5225('0x2b')]=qs['sort'](_0x530c39[_0x5225('0x27')][_0x5225('0x2c')]);_0x268aa1['where']=qs[_0x5225('0x2d')](_['pick'](_0x530c39[_0x5225('0x27')],_0x3eb476[_0x5225('0x2d')]),_0x58565d);if(_0x530c39[_0x5225('0x27')][_0x5225('0x2e')]){_0x268aa1['where']=_[_0x5225('0x2f')](_0x268aa1['where'],{'$or':_[_0x5225('0x24')](_0x58565d,function(_0x27e259){if(_0x27e259['type']!==_0x5225('0x30')){var _0x4d963a={};_0x4d963a[_0x27e259[_0x5225('0x1e')]]={'$like':'%'+_0x530c39[_0x5225('0x27')]['filter']+'%'};return _0x4d963a;}})});}_0x268aa1=_[_0x5225('0x2f')]({},_0x268aa1,_0x530c39[_0x5225('0x31')]);var _0x10f1e2={'where':_0x268aa1[_0x5225('0x32')]};return db[_0x5225('0x20')][_0x5225('0x17')](_0x10f1e2)[_0x5225('0x1b')](function(_0x2090e1){_0x286c37[_0x5225('0x17')]=_0x2090e1;if(_0x530c39[_0x5225('0x27')]['includeAll']){_0x268aa1[_0x5225('0x33')]=[{'all':!![]}];}return db[_0x5225('0x20')][_0x5225('0x34')](_0x268aa1);})[_0x5225('0x1b')](function(_0x41226a){_0x286c37[_0x5225('0x35')]=_0x41226a;return _0x286c37;})['then'](respondWithFilteredResult(_0x3db620,_0x268aa1))['catch'](handleError(_0x3db620,null));};exports[_0x5225('0x36')]=function(_0x3e402e,_0x5c83dd){var _0x25ba25={'raw':!![],'where':{'id':_0x3e402e[_0x5225('0x37')]['id']}},_0x23f7c0={};_0x23f7c0[_0x5225('0x23')]=_[_0x5225('0x25')](db[_0x5225('0x20')][_0x5225('0x21')]);_0x23f7c0['query']=_[_0x5225('0x25')](_0x3e402e['query']);_0x23f7c0['filters']=_[_0x5225('0x26')](_0x23f7c0['model'],_0x23f7c0[_0x5225('0x27')]);_0x25ba25[_0x5225('0x29')]=_[_0x5225('0x26')](_0x23f7c0[_0x5225('0x23')],qs[_0x5225('0x28')](_0x3e402e[_0x5225('0x27')][_0x5225('0x28')]));_0x25ba25[_0x5225('0x29')]=_0x25ba25['attributes'][_0x5225('0x38')]?_0x25ba25[_0x5225('0x29')]:_0x23f7c0[_0x5225('0x23')];if(_0x3e402e[_0x5225('0x27')]['includeAll']){_0x25ba25[_0x5225('0x33')]=[{'all':!![]}];}_0x25ba25=_[_0x5225('0x2f')]({},_0x25ba25,_0x3e402e[_0x5225('0x31')]);return db[_0x5225('0x20')]['find'](_0x25ba25)[_0x5225('0x1b')](handleEntityNotFound(_0x5c83dd,null))[_0x5225('0x1b')](respondWithResult(_0x5c83dd,null))[_0x5225('0x39')](handleError(_0x5c83dd,null));};exports['create']=function(_0x2bcadb,_0x3578f6){var _0x1f2763;return db['Network']['create'](_0x2bcadb[_0x5225('0x3a')],{'raw':!![]})[_0x5225('0x1b')](function(_0xbdc4f7){_0x1f2763=_0xbdc4f7;return db[_0x5225('0x20')][_0x5225('0x34')]({'where':{'type':_0x2bcadb[_0x5225('0x3a')][_0x5225('0x3b')]},'raw':!![]});})['then'](function(_0x232edf){if(_0x1f2763[_0x5225('0x3b')]['toUpperCase']()==_0x5225('0x3c')){var _0x1de345=fs[_0x5225('0x3d')](path[_0x5225('0x3e')](config[_0x5225('0x3f')],_0x5225('0x40')),_0x5225('0x41'));var _0x19128e=ejs[_0x5225('0x42')](_0x1de345,{'networks':_0x232edf||[]});fs[_0x5225('0x43')](_0x5225('0x44'),_0x19128e);return respondWithRpcPromise(_0x5225('0x45'),_0x5225('0x46'),{'module':'res_stun_monitor.so'});}else if(_0x1f2763[_0x5225('0x3b')]['toUpperCase']()==_0x5225('0x47')){var _0x53ed26=fs[_0x5225('0x3d')](path['join'](config['root'],_0x5225('0x48')),_0x5225('0x41'));var _0xe72932=ejs['render'](_0x53ed26,{'networks':_0x232edf||[]});fs[_0x5225('0x43')](_0x5225('0x49'),_0xe72932);return respondWithRpcPromise('Reload',_0x5225('0x46'),{'module':_0x5225('0x4a')});}else{var _0x46d9ab=fs[_0x5225('0x3d')](path[_0x5225('0x3e')](config[_0x5225('0x3f')],_0x5225('0x4b')),_0x5225('0x41'));var _0x4b6e7f=ejs[_0x5225('0x42')](_0x46d9ab,{'networks':_0x232edf||[]});fs['writeFileSync'](util[_0x5225('0x4c')](_0x5225('0x4d'),_0x2bcadb[_0x5225('0x3a')][_0x5225('0x3b')][_0x5225('0x4e')]()),_0x4b6e7f);return respondWithRpcPromise('Reload',_0x5225('0x46'),{'module':_0x5225('0x4f')});}})[_0x5225('0x1b')](function(){return _0x1f2763;})[_0x5225('0x1b')](respondWithResult(_0x3578f6,0xc9))['catch'](handleError(_0x3578f6,null));};exports['update']=function(_0x4dad73,_0x4523c2){var _0x29d5f4;return db[_0x5225('0x20')][_0x5225('0x50')]({'where':{'id':_0x4dad73[_0x5225('0x37')]['id']}})[_0x5225('0x1b')](handleEntityNotFound(_0x4523c2,null))[_0x5225('0x1b')](saveUpdates(_0x4dad73[_0x5225('0x3a')],null))[_0x5225('0x1b')](function(_0x348368){if(_0x348368){_0x29d5f4=_0x348368;return db[_0x5225('0x20')][_0x5225('0x34')]({'where':{'type':_0x29d5f4[_0x5225('0x3b')]},'raw':!![]});}return null;})[_0x5225('0x1b')](function(_0x463eef){if(_0x29d5f4['type'][_0x5225('0x51')]()==_0x5225('0x3c')){var _0x385056=fs[_0x5225('0x3d')](path['join'](config['root'],_0x5225('0x40')),'utf8');var _0x3b2a4b=ejs[_0x5225('0x42')](_0x385056,{'networks':_0x463eef||[]});fs[_0x5225('0x43')](_0x5225('0x44'),_0x3b2a4b);return respondWithRpcPromise(_0x5225('0x45'),_0x5225('0x1a'),{'module':'res_stun_monitor.so'});}else if(_0x29d5f4[_0x5225('0x3b')][_0x5225('0x51')]()=='TURN'){var _0x4cf5b6=fs[_0x5225('0x3d')](path['join'](config['root'],_0x5225('0x48')),'utf8');var _0x19fb2b=ejs[_0x5225('0x42')](_0x4cf5b6,{'networks':_0x463eef||[]});fs[_0x5225('0x43')](_0x5225('0x49'),_0x19fb2b);return respondWithRpcPromise(_0x5225('0x45'),_0x5225('0x1a'),{'module':_0x5225('0x4a')});}else{var _0x101353=fs['readFileSync'](path['join'](config[_0x5225('0x3f')],_0x5225('0x4b')),_0x5225('0x41'));var _0x1e4b65=ejs[_0x5225('0x42')](_0x101353,{'networks':_0x463eef||[]});fs[_0x5225('0x43')](util[_0x5225('0x4c')](_0x5225('0x4d'),_0x4dad73[_0x5225('0x3a')][_0x5225('0x3b')][_0x5225('0x4e')]()),_0x1e4b65);return respondWithRpcPromise('Reload','update',{'module':'chan_sip.so'});}})[_0x5225('0x1b')](function(_0x30086d){if(_0x30086d){return _0x29d5f4;}return null;})[_0x5225('0x1b')](respondWithResult(_0x4523c2,null))[_0x5225('0x39')](handleError(_0x4523c2,null));};exports[_0x5225('0x52')]=function(_0xcca5ef,_0x2ab704){var _0x28483d;return db['Network'][_0x5225('0x50')]({'where':{'id':_0xcca5ef['params']['id']}})['then'](function(_0x3e2974){_0x28483d=_0x3e2974;return _0x3e2974;})[_0x5225('0x1b')](handleEntityNotFound(_0x2ab704,null))['then'](removeEntity(_0x2ab704,null))['then'](function(){if(_0x28483d){return db['Network'][_0x5225('0x34')]({'where':{'type':_0x28483d[_0x5225('0x3b')]},'raw':!![]});}})[_0x5225('0x1b')](function(_0xe90eff){if(_0x28483d[_0x5225('0x3b')][_0x5225('0x51')]()=='STUN'){var _0x4f392b=fs[_0x5225('0x3d')](path['join'](config[_0x5225('0x3f')],'server/files/templates/stun_multiple.ejs'),'utf8');var _0x147a9d=ejs['render'](_0x4f392b,{'networks':_0xe90eff||[]});fs[_0x5225('0x43')]('/etc/asterisk/stun_xcally.conf',_0x147a9d);return respondWithRpcPromise(_0x5225('0x45'),_0x5225('0x52'),{'module':_0x5225('0x4a')});}else if(_0x28483d[_0x5225('0x3b')][_0x5225('0x51')]()==_0x5225('0x47')){var _0x3aa6fa=fs[_0x5225('0x3d')](path[_0x5225('0x3e')](config[_0x5225('0x3f')],_0x5225('0x48')),_0x5225('0x41'));var _0x43b79a=ejs[_0x5225('0x42')](_0x3aa6fa,{'networks':_0xe90eff||[]});fs[_0x5225('0x43')](_0x5225('0x49'),_0x43b79a);return respondWithRpcPromise(_0x5225('0x45'),_0x5225('0x52'),{'module':_0x5225('0x4a')});}else{var _0x195320=fs[_0x5225('0x3d')](path[_0x5225('0x3e')](config[_0x5225('0x3f')],_0x5225('0x4b')),'utf8');var _0x3dd3f6=ejs[_0x5225('0x42')](_0x195320,{'networks':_0xe90eff||[]});fs[_0x5225('0x43')](util[_0x5225('0x4c')](_0x5225('0x4d'),_0x28483d['type']['toLowerCase']()),_0x3dd3f6);return respondWithRpcPromise('Reload',_0x5225('0x52'),{'module':_0x5225('0x4f')});}})['catch'](handleError(_0x2ab704,null));}; \ No newline at end of file +var _0x3175=['then','info','request\x20sent','debug','stringify','error','Network,\x20%s,\x20%s','message','result','catch','offset','undefined','limit','count','set','Content-Range','json','update','destroy','status','end','stack','name','send','index','map','Network','rawAttributes','type','key','query','keys','intersection','model','fields','attributes','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','findAll','show','params','length','includeAll','include','create','body','toUpperCase','STUN','join','root','server/files/templates/stun_multiple.ejs','utf8','writeFileSync','/etc/asterisk/stun_xcally.conf','res_stun_monitor.so','TURN','readFileSync','server/files/templates/turn_multiple.ejs','render','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','format','toLowerCase','Reload','find','chan_sip.so','/etc/asterisk/sip_xcally_%s.conf','util','path','lodash','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','http','request'];(function(_0x56d7c5,_0x531819){var _0x59cda1=function(_0x320d06){while(--_0x320d06){_0x56d7c5['push'](_0x56d7c5['shift']());}};_0x59cda1(++_0x531819);}(_0x3175,0x9e));var _0x5317=function(_0x3f88bc,_0xe38cf5){_0x3f88bc=_0x3f88bc-0x0;var _0x4df1c4=_0x3175[_0x3f88bc];return _0x4df1c4;};'use strict';var util=require(_0x5317('0x0'));var path=require(_0x5317('0x1'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x5317('0x2'));var qs=require(_0x5317('0x3'));var logger=require(_0x5317('0x4'))(_0x5317('0x5'));var config=require(_0x5317('0x6'));var db=require(_0x5317('0x7'))['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0x5317('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x32e402,_0x1ec5f7,_0x259a0c,_0xcedf9c){return new Promise(function(_0x536175,_0x2dbcd3){var _0x382659=_0xcedf9c||client;return _0x382659[_0x5317('0x9')](_0x32e402,_0x259a0c)[_0x5317('0xa')](function(_0x4248df){logger[_0x5317('0xb')]('Network,\x20%s,\x20%s',_0x1ec5f7,_0x5317('0xc'));logger[_0x5317('0xd')]('Network,\x20%s,\x20%s,\x20%s',_0x1ec5f7,'request\x20sent',JSON[_0x5317('0xe')](_0x4248df));if(_0x4248df[_0x5317('0xf')]){if(_0x4248df[_0x5317('0xf')]['code']===0x1f4){logger[_0x5317('0xf')](_0x5317('0x10'),_0x1ec5f7,_0x4248df[_0x5317('0xf')][_0x5317('0x11')]);return _0x2dbcd3(_0x4248df['error'][_0x5317('0x11')]);}logger[_0x5317('0xf')]('Network,\x20%s,\x20%s',_0x1ec5f7,_0x4248df[_0x5317('0xf')][_0x5317('0x11')]);return _0x536175(_0x4248df[_0x5317('0xf')]['message']);}else{logger[_0x5317('0xb')](_0x5317('0x10'),_0x1ec5f7,_0x5317('0xc'));_0x536175(_0x4248df[_0x5317('0x12')][_0x5317('0x11')]);}})[_0x5317('0x13')](function(_0x40d9d8){logger[_0x5317('0xf')](_0x5317('0x10'),_0x1ec5f7,_0x40d9d8);_0x2dbcd3(_0x40d9d8);});});}function respondWithResult(_0xaf74fd,_0xbc0078){_0xbc0078=_0xbc0078||0xc8;return function(_0x1db69d){if(_0x1db69d){return _0xaf74fd['status'](_0xbc0078)['json'](_0x1db69d);}};}function respondWithFilteredResult(_0xb4deac,_0x546c45){return function(_0x2cca10){if(_0x2cca10){var _0x25786b=typeof _0x546c45[_0x5317('0x14')]===_0x5317('0x15')&&typeof _0x546c45[_0x5317('0x16')]==='undefined';var _0x4cc377=_0x2cca10[_0x5317('0x17')];var _0x5dde5a=_0x25786b?0x0:_0x546c45[_0x5317('0x14')];var _0x226f64=_0x25786b?_0x2cca10[_0x5317('0x17')]:_0x546c45[_0x5317('0x14')]+_0x546c45[_0x5317('0x16')];var _0xeb71ec;if(_0x226f64>=_0x4cc377){_0x226f64=_0x4cc377;_0xeb71ec=0xc8;}else{_0xeb71ec=0xce;}_0xb4deac['status'](_0xeb71ec);return _0xb4deac[_0x5317('0x18')](_0x5317('0x19'),_0x5dde5a+'-'+_0x226f64+'/'+_0x4cc377)[_0x5317('0x1a')](_0x2cca10);}return null;};}function saveUpdates(_0x5e0b9b){return function(_0x3b0006){if(_0x3b0006){return _0x3b0006[_0x5317('0x1b')](_0x5e0b9b)[_0x5317('0xa')](function(_0x537a4e){return _0x537a4e;});}return null;};}function removeEntity(_0x45d76d){return function(_0x5b8a77){if(_0x5b8a77){return _0x5b8a77[_0x5317('0x1c')]()[_0x5317('0xa')](function(){_0x45d76d[_0x5317('0x1d')](0xcc)[_0x5317('0x1e')]();});}};}function handleEntityNotFound(_0x424173){return function(_0xd3eafe){if(!_0xd3eafe){_0x424173['sendStatus'](0x194);}return _0xd3eafe;};}function handleError(_0x5b5ed6,_0x5bf988){_0x5bf988=_0x5bf988||0x1f4;return function(_0x47439e){logger[_0x5317('0xf')](_0x47439e[_0x5317('0x1f')]);if(_0x47439e[_0x5317('0x20')]){delete _0x47439e[_0x5317('0x20')];}_0x5b5ed6[_0x5317('0x1d')](_0x5bf988)[_0x5317('0x21')](_0x47439e);};}exports[_0x5317('0x22')]=function(_0x1a8d13,_0x446f55){var _0x2d4e32={},_0x50e4b6={},_0x12a689={'count':0x0,'rows':[]};var _0x5adcfa=_[_0x5317('0x23')](db[_0x5317('0x24')][_0x5317('0x25')],function(_0x6f45d2){return{'name':_0x6f45d2['fieldName'],'type':_0x6f45d2[_0x5317('0x26')][_0x5317('0x27')]};});_0x50e4b6['model']=_[_0x5317('0x23')](_0x5adcfa,_0x5317('0x20'));_0x50e4b6[_0x5317('0x28')]=_[_0x5317('0x29')](_0x1a8d13[_0x5317('0x28')]);_0x50e4b6['filters']=_[_0x5317('0x2a')](_0x50e4b6[_0x5317('0x2b')],_0x50e4b6[_0x5317('0x28')]);_0x2d4e32['attributes']=_[_0x5317('0x2a')](_0x50e4b6[_0x5317('0x2b')],qs[_0x5317('0x2c')](_0x1a8d13[_0x5317('0x28')][_0x5317('0x2c')]));_0x2d4e32[_0x5317('0x2d')]=_0x2d4e32[_0x5317('0x2d')]['length']?_0x2d4e32[_0x5317('0x2d')]:_0x50e4b6[_0x5317('0x2b')];if(!_0x1a8d13[_0x5317('0x28')]['hasOwnProperty']('nolimit')){_0x2d4e32[_0x5317('0x16')]=qs[_0x5317('0x16')](_0x1a8d13[_0x5317('0x28')][_0x5317('0x16')]);_0x2d4e32[_0x5317('0x14')]=qs[_0x5317('0x14')](_0x1a8d13['query'][_0x5317('0x14')]);}_0x2d4e32[_0x5317('0x2e')]=qs[_0x5317('0x2f')](_0x1a8d13[_0x5317('0x28')][_0x5317('0x2f')]);_0x2d4e32[_0x5317('0x30')]=qs[_0x5317('0x31')](_[_0x5317('0x32')](_0x1a8d13['query'],_0x50e4b6[_0x5317('0x31')]),_0x5adcfa);if(_0x1a8d13[_0x5317('0x28')]['filter']){_0x2d4e32[_0x5317('0x30')]=_[_0x5317('0x33')](_0x2d4e32[_0x5317('0x30')],{'$or':_[_0x5317('0x23')](_0x5adcfa,function(_0x994f8){if(_0x994f8[_0x5317('0x26')]!==_0x5317('0x34')){var _0x583dce={};_0x583dce[_0x994f8[_0x5317('0x20')]]={'$like':'%'+_0x1a8d13[_0x5317('0x28')][_0x5317('0x35')]+'%'};return _0x583dce;}})});}_0x2d4e32=_[_0x5317('0x33')]({},_0x2d4e32,_0x1a8d13[_0x5317('0x36')]);var _0x92ce18={'where':_0x2d4e32[_0x5317('0x30')]};return db[_0x5317('0x24')][_0x5317('0x17')](_0x92ce18)['then'](function(_0x37a40d){_0x12a689[_0x5317('0x17')]=_0x37a40d;if(_0x1a8d13[_0x5317('0x28')]['includeAll']){_0x2d4e32['include']=[{'all':!![]}];}return db[_0x5317('0x24')][_0x5317('0x37')](_0x2d4e32);})[_0x5317('0xa')](function(_0x5a9a8c){_0x12a689['rows']=_0x5a9a8c;return _0x12a689;})[_0x5317('0xa')](respondWithFilteredResult(_0x446f55,_0x2d4e32))[_0x5317('0x13')](handleError(_0x446f55,null));};exports[_0x5317('0x38')]=function(_0x219c99,_0x49b031){var _0x3be6ec={'raw':!![],'where':{'id':_0x219c99[_0x5317('0x39')]['id']}},_0x572c53={};_0x572c53[_0x5317('0x2b')]=_[_0x5317('0x29')](db[_0x5317('0x24')][_0x5317('0x25')]);_0x572c53[_0x5317('0x28')]=_[_0x5317('0x29')](_0x219c99[_0x5317('0x28')]);_0x572c53[_0x5317('0x31')]=_[_0x5317('0x2a')](_0x572c53[_0x5317('0x2b')],_0x572c53[_0x5317('0x28')]);_0x3be6ec['attributes']=_[_0x5317('0x2a')](_0x572c53['model'],qs[_0x5317('0x2c')](_0x219c99[_0x5317('0x28')][_0x5317('0x2c')]));_0x3be6ec[_0x5317('0x2d')]=_0x3be6ec[_0x5317('0x2d')][_0x5317('0x3a')]?_0x3be6ec[_0x5317('0x2d')]:_0x572c53[_0x5317('0x2b')];if(_0x219c99[_0x5317('0x28')][_0x5317('0x3b')]){_0x3be6ec[_0x5317('0x3c')]=[{'all':!![]}];}_0x3be6ec=_[_0x5317('0x33')]({},_0x3be6ec,_0x219c99[_0x5317('0x36')]);return db[_0x5317('0x24')]['find'](_0x3be6ec)[_0x5317('0xa')](handleEntityNotFound(_0x49b031,null))[_0x5317('0xa')](respondWithResult(_0x49b031,null))[_0x5317('0x13')](handleError(_0x49b031,null));};exports['create']=function(_0x1a4db6,_0x5ea1e3){var _0x37b28c;return db['Network'][_0x5317('0x3d')](_0x1a4db6[_0x5317('0x3e')],{'raw':!![]})[_0x5317('0xa')](function(_0x2c6ba7){_0x37b28c=_0x2c6ba7;return db[_0x5317('0x24')][_0x5317('0x37')]({'where':{'type':_0x1a4db6[_0x5317('0x3e')]['type']},'raw':!![]});})[_0x5317('0xa')](function(_0xfd7b83){if(_0x37b28c['type'][_0x5317('0x3f')]()==_0x5317('0x40')){var _0xff0eea=fs['readFileSync'](path[_0x5317('0x41')](config[_0x5317('0x42')],_0x5317('0x43')),_0x5317('0x44'));var _0x166ca2=ejs['render'](_0xff0eea,{'networks':_0xfd7b83||[]});fs[_0x5317('0x45')](_0x5317('0x46'),_0x166ca2);return respondWithRpcPromise('Reload','create',{'module':_0x5317('0x47')});}else if(_0x37b28c[_0x5317('0x26')][_0x5317('0x3f')]()==_0x5317('0x48')){var _0x1225df=fs[_0x5317('0x49')](path[_0x5317('0x41')](config[_0x5317('0x42')],_0x5317('0x4a')),_0x5317('0x44'));var _0x13f816=ejs[_0x5317('0x4b')](_0x1225df,{'networks':_0xfd7b83||[]});fs[_0x5317('0x45')](_0x5317('0x4c'),_0x13f816);return respondWithRpcPromise('Reload','create',{'module':_0x5317('0x47')});}else{var _0x3b8282=fs['readFileSync'](path[_0x5317('0x41')](config[_0x5317('0x42')],_0x5317('0x4d')),'utf8');var _0x141e22=ejs[_0x5317('0x4b')](_0x3b8282,{'networks':_0xfd7b83||[]});fs[_0x5317('0x45')](util[_0x5317('0x4e')]('/etc/asterisk/sip_xcally_%s.conf',_0x1a4db6['body']['type'][_0x5317('0x4f')]()),_0x141e22);return respondWithRpcPromise(_0x5317('0x50'),_0x5317('0x3d'),{'module':'chan_sip.so'});}})[_0x5317('0xa')](function(){return _0x37b28c;})['then'](respondWithResult(_0x5ea1e3,0xc9))['catch'](handleError(_0x5ea1e3,null));};exports[_0x5317('0x1b')]=function(_0x392afa,_0x1e88b6){var _0x19a356;return db[_0x5317('0x24')][_0x5317('0x51')]({'where':{'id':_0x392afa['params']['id']}})['then'](handleEntityNotFound(_0x1e88b6,null))[_0x5317('0xa')](saveUpdates(_0x392afa['body'],null))['then'](function(_0x2b919c){if(_0x2b919c){_0x19a356=_0x2b919c;return db[_0x5317('0x24')][_0x5317('0x37')]({'where':{'type':_0x19a356[_0x5317('0x26')]},'raw':!![]});}return null;})[_0x5317('0xa')](function(_0x47978e){if(_0x19a356[_0x5317('0x26')][_0x5317('0x3f')]()==_0x5317('0x40')){var _0x2da686=fs[_0x5317('0x49')](path[_0x5317('0x41')](config[_0x5317('0x42')],'server/files/templates/stun_multiple.ejs'),'utf8');var _0x33235a=ejs['render'](_0x2da686,{'networks':_0x47978e||[]});fs[_0x5317('0x45')](_0x5317('0x46'),_0x33235a);return respondWithRpcPromise(_0x5317('0x50'),_0x5317('0x1b'),{'module':_0x5317('0x47')});}else if(_0x19a356[_0x5317('0x26')]['toUpperCase']()=='TURN'){var _0xc5aa43=fs[_0x5317('0x49')](path[_0x5317('0x41')](config[_0x5317('0x42')],_0x5317('0x4a')),'utf8');var _0x2adc75=ejs[_0x5317('0x4b')](_0xc5aa43,{'networks':_0x47978e||[]});fs['writeFileSync'](_0x5317('0x4c'),_0x2adc75);return respondWithRpcPromise(_0x5317('0x50'),'update',{'module':_0x5317('0x47')});}else{var _0x4d0961=fs[_0x5317('0x49')](path['join'](config[_0x5317('0x42')],'server/files/templates/network.ejs'),_0x5317('0x44'));var _0x27924b=ejs['render'](_0x4d0961,{'networks':_0x47978e||[]});fs[_0x5317('0x45')](util['format']('/etc/asterisk/sip_xcally_%s.conf',_0x392afa[_0x5317('0x3e')]['type'][_0x5317('0x4f')]()),_0x27924b);return respondWithRpcPromise(_0x5317('0x50'),_0x5317('0x1b'),{'module':_0x5317('0x52')});}})[_0x5317('0xa')](function(_0x327aab){if(_0x327aab){return _0x19a356;}return null;})[_0x5317('0xa')](respondWithResult(_0x1e88b6,null))['catch'](handleError(_0x1e88b6,null));};exports[_0x5317('0x1c')]=function(_0x30169e,_0x521d3b){var _0x3f6691;return db[_0x5317('0x24')][_0x5317('0x51')]({'where':{'id':_0x30169e[_0x5317('0x39')]['id']}})[_0x5317('0xa')](function(_0x1b397a){_0x3f6691=_0x1b397a;return _0x1b397a;})['then'](handleEntityNotFound(_0x521d3b,null))[_0x5317('0xa')](removeEntity(_0x521d3b,null))[_0x5317('0xa')](function(){if(_0x3f6691){return db[_0x5317('0x24')]['findAll']({'where':{'type':_0x3f6691['type']},'raw':!![]});}})[_0x5317('0xa')](function(_0x5ce473){if(_0x3f6691[_0x5317('0x26')][_0x5317('0x3f')]()==_0x5317('0x40')){var _0x1c659d=fs['readFileSync'](path['join'](config['root'],_0x5317('0x43')),_0x5317('0x44'));var _0x1ff7ce=ejs['render'](_0x1c659d,{'networks':_0x5ce473||[]});fs[_0x5317('0x45')](_0x5317('0x46'),_0x1ff7ce);return respondWithRpcPromise('Reload',_0x5317('0x1c'),{'module':_0x5317('0x47')});}else if(_0x3f6691[_0x5317('0x26')][_0x5317('0x3f')]()==_0x5317('0x48')){var _0x1dd825=fs['readFileSync'](path['join'](config['root'],_0x5317('0x4a')),_0x5317('0x44'));var _0x3074e7=ejs['render'](_0x1dd825,{'networks':_0x5ce473||[]});fs['writeFileSync']('/etc/asterisk/turn_xcally.conf',_0x3074e7);return respondWithRpcPromise('Reload',_0x5317('0x1c'),{'module':_0x5317('0x47')});}else{var _0x3481c5=fs[_0x5317('0x49')](path['join'](config['root'],_0x5317('0x4d')),_0x5317('0x44'));var _0x41f9d7=ejs[_0x5317('0x4b')](_0x3481c5,{'networks':_0x5ce473||[]});fs[_0x5317('0x45')](util[_0x5317('0x4e')](_0x5317('0x53'),_0x3f6691[_0x5317('0x26')][_0x5317('0x4f')]()),_0x41f9d7);return respondWithRpcPromise(_0x5317('0x50'),_0x5317('0x1c'),{'module':_0x5317('0x52')});}})[_0x5317('0x13')](handleError(_0x521d3b,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index df7fbff..cb227fd 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 _0xe205=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./network.attributes','exports','network','lodash'];(function(_0x1d8b10,_0x9603a6){var _0x123f31=function(_0x675fd8){while(--_0x675fd8){_0x1d8b10['push'](_0x1d8b10['shift']());}};_0x123f31(++_0x9603a6);}(_0xe205,0xa7));var _0x5e20=function(_0x181707,_0x47d753){_0x181707=_0x181707-0x0;var _0x1d2b7a=_0xe205[_0x181707];return _0x1d2b7a;};'use strict';var _=require(_0x5e20('0x0'));var util=require(_0x5e20('0x1'));var logger=require(_0x5e20('0x2'))(_0x5e20('0x3'));var moment=require(_0x5e20('0x4'));var BPromise=require(_0x5e20('0x5'));var rp=require(_0x5e20('0x6'));var fs=require('fs');var path=require(_0x5e20('0x7'));var rimraf=require(_0x5e20('0x8'));var config=require('../../config/environment');var attributes=require(_0x5e20('0x9'));module[_0x5e20('0xa')]=function(_0x44dbb3,_0x3c4203){return _0x44dbb3['define']('Network',attributes,{'tableName':_0x5e20('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaf93=['bluebird','path','rimraf','../../config/environment','./network.attributes','exports','Network','lodash','util','moment'];(function(_0x1d002d,_0x909245){var _0xefc4e9=function(_0x515c4d){while(--_0x515c4d){_0x1d002d['push'](_0x1d002d['shift']());}};_0xefc4e9(++_0x909245);}(_0xaf93,0x151));var _0x3af9=function(_0x3550d4,_0xa10bca){_0x3550d4=_0x3550d4-0x0;var _0x1c8ba1=_0xaf93[_0x3550d4];return _0x1c8ba1;};'use strict';var _=require(_0x3af9('0x0'));var util=require(_0x3af9('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x3af9('0x2'));var BPromise=require(_0x3af9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3af9('0x4'));var rimraf=require(_0x3af9('0x5'));var config=require(_0x3af9('0x6'));var attributes=require(_0x3af9('0x7'));module[_0x3af9('0x8')]=function(_0x1ad446,_0x333abb){return _0x1ad446['define'](_0x3af9('0x9'),attributes,{'tableName':'network','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/network/network.rpc.js b/server/api/network/network.rpc.js index 3c14835..890bf94 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(_0x2870f9,_0x306749){var _0x4c1855=function(_0x5b9741){while(--_0x5b9741){_0x2870f9['push'](_0x2870f9['shift']());}};_0x4c1855(++_0x306749);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('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(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x7a54,0x106));var _0x47a5=function(_0x1902bc,_0x254d36){_0x1902bc=_0x1902bc-0x0;var _0x42b8df=_0x7a54[_0x1902bc];return _0x42b8df;};'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 b6cc617..2fcfebf 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 _0x2cca=['post','create','/:id/notify','/:id/applications','/:id/users','/:id/send','put','update','delete','removeDispositions','removeAgents','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','/:id/dispositions','/:id/canned_answers','getAnswers','getApplications','getInteractions','getAgents'];(function(_0x1688f6,_0x41dfb2){var _0x15bca2=function(_0x4651bb){while(--_0x4651bb){_0x1688f6['push'](_0x1688f6['shift']());}};_0x15bca2(++_0x41dfb2);}(_0x2cca,0x198));var _0xa2cc=function(_0x2017b5,_0x1f3e71){_0x2017b5=_0x2017b5-0x0;var _0x33319c=_0x2cca[_0x2017b5];return _0x33319c;};'use strict';var multer=require(_0xa2cc('0x0'));var util=require('util');var path=require(_0xa2cc('0x1'));var timeout=require(_0xa2cc('0x2'));var express=require(_0xa2cc('0x3'));var router=express[_0xa2cc('0x4')]();var fs_extra=require(_0xa2cc('0x5'));var auth=require(_0xa2cc('0x6'));var interaction=require(_0xa2cc('0x7'));var config=require(_0xa2cc('0x8'));var controller=require('./openchannelAccount.controller');router[_0xa2cc('0x9')]('/',auth[_0xa2cc('0xa')](),controller[_0xa2cc('0xb')]);router[_0xa2cc('0x9')](_0xa2cc('0xc'),auth[_0xa2cc('0xa')](),controller['describe']);router[_0xa2cc('0x9')](_0xa2cc('0xd'),auth['isAuthenticated'](),controller[_0xa2cc('0xe')]);router[_0xa2cc('0x9')](_0xa2cc('0xf'),auth[_0xa2cc('0xa')](),controller['getDispositions']);router[_0xa2cc('0x9')](_0xa2cc('0x10'),auth[_0xa2cc('0xa')](),controller[_0xa2cc('0x11')]);router['get']('/:id/applications',auth[_0xa2cc('0xa')](),controller[_0xa2cc('0x12')]);router[_0xa2cc('0x9')]('/:id/interactions',auth[_0xa2cc('0xa')](),controller[_0xa2cc('0x13')]);router['get']('/:id/users',auth[_0xa2cc('0xa')](),controller[_0xa2cc('0x14')]);router[_0xa2cc('0x15')]('/',auth[_0xa2cc('0xa')](),controller[_0xa2cc('0x16')]);router[_0xa2cc('0x15')]('/:id/dispositions',auth[_0xa2cc('0xa')](),controller['addDisposition']);router[_0xa2cc('0x15')](_0xa2cc('0x10'),auth[_0xa2cc('0xa')](),controller['addAnswer']);router['post'](_0xa2cc('0x17'),controller['notify']);router[_0xa2cc('0x15')](_0xa2cc('0x18'),auth['isAuthenticated'](),controller['addApplications']);router[_0xa2cc('0x15')](_0xa2cc('0x19'),auth['isAuthenticated'](),controller['addAgents']);router['post'](_0xa2cc('0x1a'),auth['isAuthenticated'](),controller['send']);router[_0xa2cc('0x1b')](_0xa2cc('0xd'),auth[_0xa2cc('0xa')](),controller[_0xa2cc('0x1c')]);router[_0xa2cc('0x1d')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0xa2cc('0x1d')](_0xa2cc('0xf'),auth[_0xa2cc('0xa')](),controller[_0xa2cc('0x1e')]);router[_0xa2cc('0x1d')](_0xa2cc('0x10'),auth[_0xa2cc('0xa')](),controller['removeAnswers']);router[_0xa2cc('0x1d')](_0xa2cc('0x19'),auth[_0xa2cc('0xa')](),controller[_0xa2cc('0x1f')]);module[_0xa2cc('0x20')]=router; \ No newline at end of file +var _0x3d7a=['getAgents','post','create','notify','addApplications','send','put','update','delete','/:id','removeDispositions','removeAnswers','removeAgents','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./openchannelAccount.controller','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/applications','getApplications','/:id/interactions','/:id/users'];(function(_0x3d42cc,_0x20c1d5){var _0x43780c=function(_0x22b70e){while(--_0x22b70e){_0x3d42cc['push'](_0x3d42cc['shift']());}};_0x43780c(++_0x20c1d5);}(_0x3d7a,0x11e));var _0xa3d7=function(_0x366388,_0x4595a6){_0x366388=_0x366388-0x0;var _0x41c97e=_0x3d7a[_0x366388];return _0x41c97e;};'use strict';var multer=require(_0xa3d7('0x0'));var util=require('util');var path=require(_0xa3d7('0x1'));var timeout=require(_0xa3d7('0x2'));var express=require('express');var router=express[_0xa3d7('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xa3d7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xa3d7('0x5'));var controller=require(_0xa3d7('0x6'));router[_0xa3d7('0x7')]('/',auth[_0xa3d7('0x8')](),controller[_0xa3d7('0x9')]);router['get'](_0xa3d7('0xa'),auth['isAuthenticated'](),controller[_0xa3d7('0xb')]);router[_0xa3d7('0x7')]('/:id',auth[_0xa3d7('0x8')](),controller[_0xa3d7('0xc')]);router[_0xa3d7('0x7')](_0xa3d7('0xd'),auth[_0xa3d7('0x8')](),controller[_0xa3d7('0xe')]);router[_0xa3d7('0x7')](_0xa3d7('0xf'),auth[_0xa3d7('0x8')](),controller['getAnswers']);router[_0xa3d7('0x7')](_0xa3d7('0x10'),auth[_0xa3d7('0x8')](),controller[_0xa3d7('0x11')]);router[_0xa3d7('0x7')](_0xa3d7('0x12'),auth[_0xa3d7('0x8')](),controller['getInteractions']);router['get'](_0xa3d7('0x13'),auth[_0xa3d7('0x8')](),controller[_0xa3d7('0x14')]);router[_0xa3d7('0x15')]('/',auth['isAuthenticated'](),controller[_0xa3d7('0x16')]);router[_0xa3d7('0x15')](_0xa3d7('0xd'),auth[_0xa3d7('0x8')](),controller['addDisposition']);router[_0xa3d7('0x15')](_0xa3d7('0xf'),auth[_0xa3d7('0x8')](),controller['addAnswer']);router[_0xa3d7('0x15')]('/:id/notify',controller[_0xa3d7('0x17')]);router['post'](_0xa3d7('0x10'),auth[_0xa3d7('0x8')](),controller[_0xa3d7('0x18')]);router[_0xa3d7('0x15')]('/:id/users',auth[_0xa3d7('0x8')](),controller['addAgents']);router[_0xa3d7('0x15')]('/:id/send',auth[_0xa3d7('0x8')](),controller[_0xa3d7('0x19')]);router[_0xa3d7('0x1a')]('/:id',auth[_0xa3d7('0x8')](),controller[_0xa3d7('0x1b')]);router[_0xa3d7('0x1c')](_0xa3d7('0x1d'),auth[_0xa3d7('0x8')](),controller['destroy']);router[_0xa3d7('0x1c')](_0xa3d7('0xd'),auth[_0xa3d7('0x8')](),controller[_0xa3d7('0x1e')]);router[_0xa3d7('0x1c')](_0xa3d7('0xf'),auth['isAuthenticated'](),controller[_0xa3d7('0x1f')]);router[_0xa3d7('0x1c')](_0xa3d7('0x13'),auth[_0xa3d7('0x8')](),controller[_0xa3d7('0x20')]);module[_0xa3d7('0x21')]=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index 303310a..b364702 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 _0xe413=['randomstring','STRING','generate','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize'];(function(_0x189cbc,_0x18aa5a){var _0x31d0db=function(_0x2d4280){while(--_0x2d4280){_0x189cbc['push'](_0x189cbc['shift']());}};_0x31d0db(++_0x18aa5a);}(_0xe413,0xdb));var _0x3e41=function(_0x5cd82f,_0x57cfcc){_0x5cd82f=_0x5cd82f-0x0;var _0x5b659e=_0xe413[_0x5cd82f];return _0x5b659e;};'use strict';var Sequelize=require(_0x3e41('0x0'));var rs=require(_0x3e41('0x1'));module['exports']={'name':{'type':Sequelize[_0x3e41('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x3e41('0x2')]},'token':{'type':Sequelize[_0x3e41('0x2')],'defaultValue':function(){return rs[_0x3e41('0x3')]();}},'replyUri':{'type':Sequelize[_0x3e41('0x2')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x3e41('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x3e41('0x4')],'defaultValue':function(){return _0x3e41('0x5');}},'notificationSound':{'type':Sequelize[_0x3e41('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x3e41('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x3e41('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x3e41('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize['STRING']},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x3e41('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x3e41('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x3e41('0x7')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x4acdaf){if(!_0x4acdaf)this[_0x3e41('0x8')](_0x3e41('0x9'),null);this['setDataValue'](_0x3e41('0xa'),_0x4acdaf);}}}; \ No newline at end of file +var _0xd322=['exports','STRING','name','generate','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize'];(function(_0x4be3ec,_0x218441){var _0x44b79f=function(_0x56d3c1){while(--_0x56d3c1){_0x4be3ec['push'](_0x4be3ec['shift']());}};_0x44b79f(++_0x218441);}(_0xd322,0x125));var _0x2d32=function(_0x201ece,_0x31c91e){_0x201ece=_0x201ece-0x0;var _0x5724ae=_0xd322[_0x201ece];return _0x5724ae;};'use strict';var Sequelize=require(_0x2d32('0x0'));var rs=require('randomstring');module[_0x2d32('0x1')]={'name':{'type':Sequelize[_0x2d32('0x2')],'unique':_0x2d32('0x3'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x2d32('0x2')],'defaultValue':function(){return rs[_0x2d32('0x4')]();}},'replyUri':{'type':Sequelize[_0x2d32('0x2')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x2d32('0x5')],'defaultValue':function(){return _0x2d32('0x6');}},'notificationSound':{'type':Sequelize[_0x2d32('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x2d32('0x7')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x2d32('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x2d32('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x2d32('0x2')]},'queueTransfer':{'type':Sequelize[_0x2d32('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x2d32('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x2d32('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x2d32('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x2d32('0x8')],'allowNull':!![],'defaultValue':null,'comment':_0x2d32('0x9')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x2d32('0xa'),'set':function(_0x4227aa){if(!_0x4227aa)this[_0x2d32('0xb')](_0x2d32('0xc'),null);this[_0x2d32('0xb')](_0x2d32('0xd'),_0x4227aa);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index c8b3f99..a37a065 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 _0x5a63=['UserId','User','unshift','agent','waitForTheAssignedAgent','*,*,*,*','queueId','queue','waitForTheAssignedQueue','EventManager','addApplications','sequelize','transaction','READ_COMMITTED','bulkCreate','finally','getApplications','getInteractions','Contact','fullname','internal','Tag','Tags','color','tag','addAgents','omit','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','DESC','out','dataValues','Messages','eml-format','rimraf','request-promise','mustache','util','path','sox','to-csv','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./openchannelAccount.socket','register','jayson/promise','client','http','request','then','info','OpenchannelAccount,\x20%s,\x20%s','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','update','destroy','get','sendStatus','stack','name','send','Pause','map','OpenchannelAccount','rawAttributes','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','mandatoryDispositionPause','create','body','user','role','OpenchannelAccounts','UserProfileSection','find','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','OpenchannelAccountId','getDispositions','findOne','Disposition','removeDispositions','CannedAnswer','removeAnswers','ids','notify','openchannel','CmContact','ValidationError','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId','ListId','isNil','from','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','OpenchannelApplication','Applications','account','applications','list','orderBy','priority','asc','firstName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','contact','lastName','messageId','interaction','created','autoclose','push','close','unmanaged','OpenchannelMessage','AttachmentId'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x5a63,0xe3));var _0x35a6=function(_0x5f2cc2,_0x104c52){_0x5f2cc2=_0x5f2cc2-0x0;var _0x30560b=_0x5a63[_0x5f2cc2];return _0x30560b;};'use strict';var emlformat=require(_0x35a6('0x0'));var rimraf=require(_0x35a6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x35a6('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x35a6('0x3'));var util=require(_0x35a6('0x4'));var path=require(_0x35a6('0x5'));var sox=require(_0x35a6('0x6'));var csv=require(_0x35a6('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x35a6('0x8'));var _=require('lodash');var squel=require(_0x35a6('0x9'));var crypto=require('crypto');var jsforce=require(_0x35a6('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x35a6('0x7'));var querystring=require(_0x35a6('0xb'));var Papa=require(_0x35a6('0xc'));var Redis=require(_0x35a6('0xd'));var authService=require(_0x35a6('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x35a6('0xf'));var hardwareService=require(_0x35a6('0x10'));var logger=require(_0x35a6('0x11'))('api');var utils=require(_0x35a6('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x35a6('0x13'));var db=require(_0x35a6('0x14'))['db'];config[_0x35a6('0x15')]=_[_0x35a6('0x16')](config[_0x35a6('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0x35a6('0x17'))(new Redis(config[_0x35a6('0x15')]));require(_0x35a6('0x18'))[_0x35a6('0x19')](socket);var jayson=require(_0x35a6('0x1a'));var client=jayson[_0x35a6('0x1b')]['http']({'port':0x232c});var client9002=jayson[_0x35a6('0x1b')][_0x35a6('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x313380,_0x474e34,_0x167245,_0x3f0da7){return new BPromise(function(_0x502b5e,_0x29c6d0){var _0x4047d2=_0x3f0da7||client;return _0x4047d2[_0x35a6('0x1d')](_0x313380,_0x167245)[_0x35a6('0x1e')](function(_0x20cbf9){logger[_0x35a6('0x1f')](_0x35a6('0x20'),_0x474e34,'request\x20sent');logger[_0x35a6('0x21')](_0x35a6('0x22'),_0x474e34,_0x35a6('0x23'),JSON['stringify'](_0x20cbf9));if(_0x20cbf9[_0x35a6('0x24')]){if(_0x20cbf9[_0x35a6('0x24')][_0x35a6('0x25')]===0x1f4){logger['error'](_0x35a6('0x20'),_0x474e34,_0x20cbf9[_0x35a6('0x24')]['message']);return _0x29c6d0(_0x20cbf9[_0x35a6('0x24')][_0x35a6('0x26')]);}logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x474e34,_0x20cbf9[_0x35a6('0x24')][_0x35a6('0x26')]);return _0x502b5e(_0x20cbf9[_0x35a6('0x24')][_0x35a6('0x26')]);}else{logger[_0x35a6('0x1f')](_0x35a6('0x20'),_0x474e34,_0x35a6('0x23'));_0x502b5e(_0x20cbf9[_0x35a6('0x27')][_0x35a6('0x26')]);}})[_0x35a6('0x28')](function(_0x32553e){logger[_0x35a6('0x24')](_0x35a6('0x20'),_0x474e34,_0x32553e);_0x29c6d0(_0x32553e);});});}function respondWithStatusCode(_0x361e8b,_0x3634f5){_0x3634f5=_0x3634f5||0xcc;return function(_0x4dbf73){if(_0x4dbf73){return _0x361e8b['sendStatus'](_0x3634f5);}return _0x361e8b[_0x35a6('0x29')](_0x3634f5)[_0x35a6('0x2a')]();};}function respondWithResult(_0x2680ef,_0x4d68cd){_0x4d68cd=_0x4d68cd||0xc8;return function(_0x3767c8){if(_0x3767c8){return _0x2680ef[_0x35a6('0x29')](_0x4d68cd)[_0x35a6('0x2b')](_0x3767c8);}};}function respondWithFilteredResult(_0x422ca0,_0x503648){return function(_0x12f2ec){if(_0x12f2ec){var _0x386235=typeof _0x503648[_0x35a6('0x2c')]===_0x35a6('0x2d')&&typeof _0x503648['limit']==='undefined';var _0x19bd13=_0x12f2ec[_0x35a6('0x2e')];var _0x47aa11=_0x386235?0x0:_0x503648[_0x35a6('0x2c')];var _0x88953f=_0x386235?_0x12f2ec[_0x35a6('0x2e')]:_0x503648[_0x35a6('0x2c')]+_0x503648[_0x35a6('0x2f')];var _0x202b52;if(_0x88953f>=_0x19bd13){_0x88953f=_0x19bd13;_0x202b52=0xc8;}else{_0x202b52=0xce;}_0x422ca0['status'](_0x202b52);return _0x422ca0[_0x35a6('0x30')](_0x35a6('0x31'),_0x47aa11+'-'+_0x88953f+'/'+_0x19bd13)[_0x35a6('0x2b')](_0x12f2ec);}return null;};}function patchUpdates(_0xf8f654){return function(_0x1d378b){try{jsonpatch['apply'](_0x1d378b,_0xf8f654,!![]);}catch(_0xf8ca3a){return BPromise[_0x35a6('0x32')](_0xf8ca3a);}return _0x1d378b['save']();};}function saveUpdates(_0xda028d,_0x1211d6){return function(_0x3a7270){if(_0x3a7270){return _0x3a7270[_0x35a6('0x33')](_0xda028d)[_0x35a6('0x1e')](function(_0x3a6d1b){return _0x3a6d1b;});}return null;};}function removeEntity(_0x1075ad,_0x4619d8){return function(_0x1eeb9e){if(_0x1eeb9e){return _0x1eeb9e[_0x35a6('0x34')]()[_0x35a6('0x1e')](function(){var _0x421847=_0x1eeb9e[_0x35a6('0x35')]({'plain':!![]});var _0x272c21='OpenchannelAccounts';return db['UserProfileResource'][_0x35a6('0x34')]({'where':{'type':_0x272c21,'resourceId':_0x421847['id']}})['then'](function(){return _0x1eeb9e;});})[_0x35a6('0x1e')](function(){_0x1075ad[_0x35a6('0x29')](0xcc)[_0x35a6('0x2a')]();});}};}function handleEntityNotFound(_0x5a1e4c,_0x4a9b9a){return function(_0x139b72){if(!_0x139b72){_0x5a1e4c[_0x35a6('0x36')](0x194);}return _0x139b72;};}function handleError(_0x458302,_0x206d19){_0x206d19=_0x206d19||0x1f4;return function(_0x217a42){logger[_0x35a6('0x24')](_0x217a42[_0x35a6('0x37')]);if(_0x217a42[_0x35a6('0x38')]){delete _0x217a42['name'];}_0x458302[_0x35a6('0x29')](_0x206d19)[_0x35a6('0x39')](_0x217a42);};}exports['index']=function(_0x5c431e,_0x266240){var _0x555884={'include':[{'model':db[_0x35a6('0x3a')],'as':'mandatoryDispositionPause'}]},_0x3c3e7d={},_0xd7e4db={'count':0x0,'rows':[]};var _0x3d62d7=_[_0x35a6('0x3b')](db[_0x35a6('0x3c')][_0x35a6('0x3d')],function(_0x208f90){return{'name':_0x208f90['fieldName'],'type':_0x208f90['type']['key']};});_0x3c3e7d['model']=_['map'](_0x3d62d7,_0x35a6('0x38'));_0x3c3e7d[_0x35a6('0x3e')]=_[_0x35a6('0x3f')](_0x5c431e[_0x35a6('0x3e')]);_0x3c3e7d[_0x35a6('0x40')]=_[_0x35a6('0x41')](_0x3c3e7d['model'],_0x3c3e7d[_0x35a6('0x3e')]);_0x555884['attributes']=_[_0x35a6('0x41')](_0x3c3e7d[_0x35a6('0x42')],qs[_0x35a6('0x43')](_0x5c431e[_0x35a6('0x3e')][_0x35a6('0x43')]));_0x555884[_0x35a6('0x44')]=_0x555884[_0x35a6('0x44')][_0x35a6('0x45')]?_0x555884[_0x35a6('0x44')]:_0x3c3e7d['model'];if(!_0x5c431e[_0x35a6('0x3e')][_0x35a6('0x46')](_0x35a6('0x47'))){_0x555884[_0x35a6('0x2f')]=qs[_0x35a6('0x2f')](_0x5c431e[_0x35a6('0x3e')][_0x35a6('0x2f')]);_0x555884[_0x35a6('0x2c')]=qs[_0x35a6('0x2c')](_0x5c431e['query'][_0x35a6('0x2c')]);}_0x555884[_0x35a6('0x48')]=qs[_0x35a6('0x49')](_0x5c431e[_0x35a6('0x3e')][_0x35a6('0x49')]);_0x555884[_0x35a6('0x4a')]=qs[_0x35a6('0x40')](_[_0x35a6('0x4b')](_0x5c431e[_0x35a6('0x3e')],_0x3c3e7d[_0x35a6('0x40')]),_0x3d62d7);if(_0x5c431e[_0x35a6('0x3e')][_0x35a6('0x4c')]){_0x555884[_0x35a6('0x4a')]=_[_0x35a6('0x4d')](_0x555884[_0x35a6('0x4a')],{'$or':_[_0x35a6('0x3b')](_0x3d62d7,function(_0xaf4028){if(_0xaf4028[_0x35a6('0x4e')]!==_0x35a6('0x4f')){var _0x3c36da={};_0x3c36da[_0xaf4028[_0x35a6('0x38')]]={'$like':'%'+_0x5c431e[_0x35a6('0x3e')]['filter']+'%'};return _0x3c36da;}})});}_0x555884=_[_0x35a6('0x4d')]({},_0x555884,_0x5c431e[_0x35a6('0x50')]);var _0x1ac050={'where':_0x555884[_0x35a6('0x4a')]};return db[_0x35a6('0x3c')][_0x35a6('0x2e')](_0x1ac050)[_0x35a6('0x1e')](function(_0x23bf9c){_0xd7e4db[_0x35a6('0x2e')]=_0x23bf9c;if(_0x5c431e[_0x35a6('0x3e')][_0x35a6('0x51')]){_0x555884[_0x35a6('0x52')]=[{'all':!![]}];}return db['OpenchannelAccount'][_0x35a6('0x53')](_0x555884);})['then'](function(_0x10dff){_0xd7e4db[_0x35a6('0x54')]=_0x10dff;return _0xd7e4db;})[_0x35a6('0x1e')](respondWithFilteredResult(_0x266240,_0x555884))[_0x35a6('0x28')](handleError(_0x266240,null));};exports['show']=function(_0x5e0941,_0x55753d){var _0x307c36={'raw':![],'where':{'id':_0x5e0941['params']['id']},'include':[{'model':db[_0x35a6('0x3a')],'as':_0x35a6('0x55')}]},_0x5820a5={};_0x5820a5[_0x35a6('0x42')]=_['keys'](db[_0x35a6('0x3c')][_0x35a6('0x3d')]);_0x5820a5[_0x35a6('0x3e')]=_['keys'](_0x5e0941['query']);_0x5820a5[_0x35a6('0x40')]=_[_0x35a6('0x41')](_0x5820a5[_0x35a6('0x42')],_0x5820a5[_0x35a6('0x3e')]);_0x307c36['attributes']=_[_0x35a6('0x41')](_0x5820a5[_0x35a6('0x42')],qs[_0x35a6('0x43')](_0x5e0941[_0x35a6('0x3e')]['fields']));_0x307c36[_0x35a6('0x44')]=_0x307c36['attributes']['length']?_0x307c36['attributes']:_0x5820a5['model'];if(_0x5e0941[_0x35a6('0x3e')][_0x35a6('0x51')]){_0x307c36[_0x35a6('0x52')]=[{'all':!![]}];}_0x307c36=_['merge']({},_0x307c36,_0x5e0941[_0x35a6('0x50')]);return db[_0x35a6('0x3c')]['find'](_0x307c36)[_0x35a6('0x1e')](handleEntityNotFound(_0x55753d,null))['then'](respondWithResult(_0x55753d,null))[_0x35a6('0x28')](handleError(_0x55753d,null));};exports['create']=function(_0x2e6c,_0x2ba409){return db[_0x35a6('0x3c')][_0x35a6('0x56')](_0x2e6c[_0x35a6('0x57')],{})[_0x35a6('0x1e')](function(_0x392eb9){var _0x4a7319=_0x2e6c[_0x35a6('0x58')][_0x35a6('0x35')]({'plain':!![]});if(!_0x4a7319)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4a7319[_0x35a6('0x59')]===_0x35a6('0x58')){var _0x17a9f8=_0x392eb9[_0x35a6('0x35')]({'plain':!![]});var _0x25735d=_0x35a6('0x5a');return db[_0x35a6('0x5b')][_0x35a6('0x5c')]({'where':{'name':_0x25735d,'userProfileId':_0x4a7319['userProfileId']},'raw':!![]})[_0x35a6('0x1e')](function(_0x52f898){if(_0x52f898&&_0x52f898[_0x35a6('0x5d')]===0x0){return db[_0x35a6('0x5e')][_0x35a6('0x56')]({'name':_0x17a9f8[_0x35a6('0x38')],'resourceId':_0x17a9f8['id'],'type':_0x52f898[_0x35a6('0x38')],'sectionId':_0x52f898['id']},{})[_0x35a6('0x1e')](function(){return _0x392eb9;});}else{return _0x392eb9;}})[_0x35a6('0x28')](function(_0x1750e7){logger[_0x35a6('0x24')](_0x35a6('0x5f'),_0x1750e7);throw _0x1750e7;});}return _0x392eb9;})[_0x35a6('0x1e')](respondWithResult(_0x2ba409,0xc9))[_0x35a6('0x28')](handleError(_0x2ba409,null));};exports[_0x35a6('0x33')]=function(_0x5299fc,_0x5b029d){if(_0x5299fc[_0x35a6('0x57')]['id']){delete _0x5299fc[_0x35a6('0x57')]['id'];}return db[_0x35a6('0x3c')][_0x35a6('0x5c')]({'where':{'id':_0x5299fc[_0x35a6('0x60')]['id']},'include':[{'model':db[_0x35a6('0x3a')],'as':_0x35a6('0x55')}]})[_0x35a6('0x1e')](handleEntityNotFound(_0x5b029d,null))[_0x35a6('0x1e')](saveUpdates(_0x5299fc['body'],null))[_0x35a6('0x1e')](respondWithResult(_0x5b029d,null))[_0x35a6('0x28')](handleError(_0x5b029d,null));};exports['destroy']=function(_0x6ff7da,_0x31e664){return db[_0x35a6('0x3c')][_0x35a6('0x5c')]({'where':{'id':_0x6ff7da[_0x35a6('0x60')]['id']}})[_0x35a6('0x1e')](handleEntityNotFound(_0x31e664,null))['then'](removeEntity(_0x31e664,null))[_0x35a6('0x28')](handleError(_0x31e664,null));};exports[_0x35a6('0x61')]=function(_0x73d521,_0x2a2729){return db['OpenchannelAccount'][_0x35a6('0x61')]()[_0x35a6('0x1e')](respondWithResult(_0x2a2729,null))[_0x35a6('0x28')](handleError(_0x2a2729,null));};exports[_0x35a6('0x62')]=function(_0xcce5f4,_0x26d405,_0x282069){if(_0xcce5f4[_0x35a6('0x57')]['id']){delete _0xcce5f4['body']['id'];}return db[_0x35a6('0x3c')][_0x35a6('0x5c')]({'where':{'id':_0xcce5f4[_0x35a6('0x60')]['id']}})[_0x35a6('0x1e')](handleEntityNotFound(_0x26d405,null))[_0x35a6('0x1e')](function(_0x45acc0){if(_0x45acc0){_0xcce5f4[_0x35a6('0x57')][_0x35a6('0x63')]=_0x45acc0['id'];return db['Disposition'][_0x35a6('0x56')](_0xcce5f4[_0x35a6('0x57')]);}})[_0x35a6('0x1e')](respondWithResult(_0x26d405,null))['catch'](handleError(_0x26d405,null));};exports[_0x35a6('0x64')]=function(_0x3a9844,_0x12e978,_0x1276d7){var _0x2b9993={'raw':![],'where':{}};var _0x485f06={};var _0x479a5f={'count':0x0,'rows':[]};return db[_0x35a6('0x3c')][_0x35a6('0x65')]({'where':{'id':_0x3a9844[_0x35a6('0x60')]['id']}})[_0x35a6('0x1e')](handleEntityNotFound(_0x12e978,null))[_0x35a6('0x1e')](function(_0x27912d){if(_0x27912d){_0x485f06[_0x35a6('0x42')]=_[_0x35a6('0x3f')](db[_0x35a6('0x66')][_0x35a6('0x3d')]);_0x485f06[_0x35a6('0x3e')]=_[_0x35a6('0x3f')](_0x3a9844[_0x35a6('0x3e')]);_0x485f06[_0x35a6('0x40')]=_[_0x35a6('0x41')](_0x485f06[_0x35a6('0x42')],_0x485f06[_0x35a6('0x3e')]);_0x2b9993[_0x35a6('0x44')]=_['intersection'](_0x485f06[_0x35a6('0x42')],qs[_0x35a6('0x43')](_0x3a9844[_0x35a6('0x3e')][_0x35a6('0x43')]));_0x2b9993['attributes']=_0x2b9993['attributes'][_0x35a6('0x45')]?_0x2b9993[_0x35a6('0x44')]:_0x485f06[_0x35a6('0x42')];if(!_0x3a9844[_0x35a6('0x3e')][_0x35a6('0x46')](_0x35a6('0x47'))){_0x2b9993['limit']=qs['limit'](_0x3a9844[_0x35a6('0x3e')][_0x35a6('0x2f')]);_0x2b9993[_0x35a6('0x2c')]=qs[_0x35a6('0x2c')](_0x3a9844[_0x35a6('0x3e')][_0x35a6('0x2c')]);}_0x2b9993[_0x35a6('0x48')]=qs[_0x35a6('0x49')](_0x3a9844['query']['sort']);_0x2b9993[_0x35a6('0x4a')]=qs[_0x35a6('0x40')](_[_0x35a6('0x4b')](_0x3a9844['query'],_0x485f06[_0x35a6('0x40')]));_0x2b9993['where'][_0x35a6('0x63')]=_0x27912d['id'];if(_0x3a9844['query'][_0x35a6('0x4c')]){_0x2b9993[_0x35a6('0x4a')]=_['merge'](_0x2b9993[_0x35a6('0x4a')],{'$or':_[_0x35a6('0x3b')](_0x2b9993[_0x35a6('0x44')],function(_0x363ee2){var _0x38763c={};_0x38763c[_0x363ee2]={'$like':'%'+_0x3a9844[_0x35a6('0x3e')]['filter']+'%'};return _0x38763c;})});}_0x2b9993=_[_0x35a6('0x4d')]({},_0x2b9993,_0x3a9844[_0x35a6('0x50')]);return db[_0x35a6('0x66')]['count']({'where':_0x2b9993['where']})[_0x35a6('0x1e')](function(_0x6029ff){_0x479a5f[_0x35a6('0x2e')]=_0x6029ff;if(_0x3a9844['query'][_0x35a6('0x51')]){_0x2b9993['include']=[{'all':!![]}];}return db[_0x35a6('0x66')][_0x35a6('0x53')](_0x2b9993);})[_0x35a6('0x1e')](function(_0x439b06){_0x479a5f[_0x35a6('0x54')]=_0x439b06;return _0x479a5f;});}})['then'](respondWithFilteredResult(_0x12e978,_0x2b9993))[_0x35a6('0x28')](handleError(_0x12e978,null));};exports['removeDispositions']=function(_0x522a91,_0x45e77a,_0x3d25fb){return db[_0x35a6('0x3c')][_0x35a6('0x5c')]({'where':{'id':_0x522a91['params']['id']}})['then'](handleEntityNotFound(_0x45e77a,null))[_0x35a6('0x1e')](function(_0x2275de){if(_0x2275de){return _0x2275de[_0x35a6('0x67')](_0x522a91['query']['ids']);}})[_0x35a6('0x1e')](respondWithStatusCode(_0x45e77a,null))[_0x35a6('0x28')](handleError(_0x45e77a,null));};exports['addAnswer']=function(_0x179a22,_0x49614e,_0x19bba5){if(_0x179a22[_0x35a6('0x57')]['id']){delete _0x179a22[_0x35a6('0x57')]['id'];}return db[_0x35a6('0x3c')][_0x35a6('0x5c')]({'where':{'id':_0x179a22[_0x35a6('0x60')]['id']}})['then'](handleEntityNotFound(_0x49614e,null))[_0x35a6('0x1e')](function(_0x2d8406){if(_0x2d8406){_0x179a22[_0x35a6('0x57')][_0x35a6('0x63')]=_0x2d8406['id'];return db[_0x35a6('0x68')][_0x35a6('0x56')](_0x179a22[_0x35a6('0x57')]);}})[_0x35a6('0x1e')](respondWithResult(_0x49614e,null))[_0x35a6('0x28')](handleError(_0x49614e,null));};exports['getAnswers']=function(_0x5868c5,_0x309153,_0x2c6fdf){var _0x46eed3={'raw':![],'where':{}};var _0x1f33fe={};var _0x5c37e8={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x35a6('0x65')]({'where':{'id':_0x5868c5[_0x35a6('0x60')]['id']}})[_0x35a6('0x1e')](handleEntityNotFound(_0x309153,null))[_0x35a6('0x1e')](function(_0x55c1dd){if(_0x55c1dd){_0x1f33fe['model']=_[_0x35a6('0x3f')](db[_0x35a6('0x68')][_0x35a6('0x3d')]);_0x1f33fe[_0x35a6('0x3e')]=_[_0x35a6('0x3f')](_0x5868c5['query']);_0x1f33fe[_0x35a6('0x40')]=_[_0x35a6('0x41')](_0x1f33fe['model'],_0x1f33fe[_0x35a6('0x3e')]);_0x46eed3['attributes']=_[_0x35a6('0x41')](_0x1f33fe['model'],qs[_0x35a6('0x43')](_0x5868c5[_0x35a6('0x3e')][_0x35a6('0x43')]));_0x46eed3['attributes']=_0x46eed3[_0x35a6('0x44')]['length']?_0x46eed3[_0x35a6('0x44')]:_0x1f33fe[_0x35a6('0x42')];if(!_0x5868c5[_0x35a6('0x3e')][_0x35a6('0x46')](_0x35a6('0x47'))){_0x46eed3['limit']=qs[_0x35a6('0x2f')](_0x5868c5[_0x35a6('0x3e')]['limit']);_0x46eed3[_0x35a6('0x2c')]=qs[_0x35a6('0x2c')](_0x5868c5[_0x35a6('0x3e')][_0x35a6('0x2c')]);}_0x46eed3[_0x35a6('0x48')]=qs[_0x35a6('0x49')](_0x5868c5[_0x35a6('0x3e')][_0x35a6('0x49')]);_0x46eed3['where']=qs[_0x35a6('0x40')](_[_0x35a6('0x4b')](_0x5868c5[_0x35a6('0x3e')],_0x1f33fe['filters']));_0x46eed3[_0x35a6('0x4a')][_0x35a6('0x63')]=_0x55c1dd['id'];if(_0x5868c5[_0x35a6('0x3e')][_0x35a6('0x4c')]){_0x46eed3[_0x35a6('0x4a')]=_[_0x35a6('0x4d')](_0x46eed3[_0x35a6('0x4a')],{'$or':_[_0x35a6('0x3b')](_0x46eed3[_0x35a6('0x44')],function(_0x3dee4b){var _0x5c4639={};_0x5c4639[_0x3dee4b]={'$like':'%'+_0x5868c5[_0x35a6('0x3e')][_0x35a6('0x4c')]+'%'};return _0x5c4639;})});}_0x46eed3=_[_0x35a6('0x4d')]({},_0x46eed3,_0x5868c5['options']);return db[_0x35a6('0x68')][_0x35a6('0x2e')]({'where':_0x46eed3[_0x35a6('0x4a')]})[_0x35a6('0x1e')](function(_0x46a24f){_0x5c37e8[_0x35a6('0x2e')]=_0x46a24f;if(_0x5868c5[_0x35a6('0x3e')][_0x35a6('0x51')]){_0x46eed3['include']=[{'all':!![]}];}return db[_0x35a6('0x68')][_0x35a6('0x53')](_0x46eed3);})[_0x35a6('0x1e')](function(_0x5cf7a1){_0x5c37e8[_0x35a6('0x54')]=_0x5cf7a1;return _0x5c37e8;});}})['then'](respondWithFilteredResult(_0x309153,_0x46eed3))[_0x35a6('0x28')](handleError(_0x309153,null));};exports['removeAnswers']=function(_0x5b8855,_0x57dcac,_0x4c1234){return db[_0x35a6('0x3c')][_0x35a6('0x5c')]({'where':{'id':_0x5b8855['params']['id']}})[_0x35a6('0x1e')](handleEntityNotFound(_0x57dcac,null))[_0x35a6('0x1e')](function(_0x384f90){if(_0x384f90){return _0x384f90[_0x35a6('0x69')](_0x5b8855[_0x35a6('0x3e')][_0x35a6('0x6a')]);}})[_0x35a6('0x1e')](respondWithStatusCode(_0x57dcac,null))['catch'](handleError(_0x57dcac,null));};exports[_0x35a6('0x6b')]=function(_0x2b3a54,_0x22b697,_0x50deee){var _0x3484ad={'body':_0x2b3a54[_0x35a6('0x57')],'channel':_0x35a6('0x6c')};var _0x3a73a6=[];var _0xe4d01d=[];var _0x4c0202={};var _0x15b60d=![];return db[_0x35a6('0x6d')][_0x35a6('0x61')]()[_0x35a6('0x1e')](function(_0x142e39){if(!_0x142e39){throw new db['Sequelize'][(_0x35a6('0x6e'))](_0x35a6('0x6f'));}_0x3a73a6=_[_0x35a6('0x70')](_[_0x35a6('0x3f')](_0x142e39),['createdAt',_0x35a6('0x71')]);_0xe4d01d=_['difference'](_[_0x35a6('0x3f')](_0x142e39),[_0x35a6('0x72'),_0x35a6('0x71'),_0x35a6('0x73'),_0x35a6('0x74')]);if(_0x2b3a54['body']['id']){delete _0x2b3a54['body']['id'];}if(_[_0x35a6('0x75')](_0x2b3a54[_0x35a6('0x57')][_0x35a6('0x76')])){throw new db[(_0x35a6('0x77'))][(_0x35a6('0x6e'))](_0x35a6('0x78'));}if(_['isNil'](_0x2b3a54['body'][_0x35a6('0x57')])||_0x2b3a54[_0x35a6('0x57')][_0x35a6('0x57')]===''){throw new db[(_0x35a6('0x77'))][(_0x35a6('0x6e'))](_0x35a6('0x79'));}if(_[_0x35a6('0x75')](_0x2b3a54[_0x35a6('0x57')][_0x35a6('0x7a')])){throw new db[(_0x35a6('0x77'))][(_0x35a6('0x6e'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0xe4d01d);}if(!_[_0x35a6('0x7b')](_0xe4d01d,_0x2b3a54[_0x35a6('0x57')][_0x35a6('0x7a')])){throw new db[(_0x35a6('0x77'))][(_0x35a6('0x6e'))](_0x35a6('0x7c')+_0xe4d01d);}_0x4c0202[_0x2b3a54[_0x35a6('0x57')]['mapKey']]=_0x2b3a54[_0x35a6('0x57')][_0x35a6('0x76')];})['then'](function(){return db[_0x35a6('0x3c')][_0x35a6('0x5c')]({'where':{'id':_0x2b3a54['params']['id']},'include':[{'model':db[_0x35a6('0x7d')],'as':_0x35a6('0x7e'),'include':[{'model':db[_0x35a6('0x6d')],'as':_0x35a6('0x7f'),'where':_0x4c0202,'limit':0x1,'order':[[_0x35a6('0x71'),'DESC']]}]},{'model':db[_0x35a6('0x80')],'as':_0x35a6('0x81')}]});})[_0x35a6('0x1e')](handleEntityNotFound(_0x22b697,null))['then'](function(_0x40d239){if(_0x40d239&&_0x40d239[_0x35a6('0x7e')]){_0x3484ad[_0x35a6('0x82')]=_0x40d239;_0x3484ad[_0x35a6('0x83')]=_0x40d239['Applications'];_0x3484ad[_0x35a6('0x84')]=_0x40d239['List'];_0x3484ad[_0x35a6('0x83')]=_[_0x35a6('0x85')](_0x3484ad[_0x35a6('0x83')],[_0x35a6('0x86')],[_0x35a6('0x87')]);if(_0x3484ad[_0x35a6('0x82')][_0x35a6('0x81')]){delete _0x3484ad[_0x35a6('0x82')][_0x35a6('0x81')];}if(_0x3484ad[_0x35a6('0x82')][_0x35a6('0x7e')]&&_0x3484ad['account'][_0x35a6('0x7e')]['Contacts'][_0x35a6('0x45')]){return _0x3484ad[_0x35a6('0x82')][_0x35a6('0x7e')][_0x35a6('0x7f')][0x0];}var _0x1e81b4=_[_0x35a6('0x16')](_0x2b3a54[_0x35a6('0x57')],{'firstName':_0x2b3a54[_0x35a6('0x57')][_0x35a6('0x76')],'ListId':_0x40d239['ListId']});_0x1e81b4[_0x2b3a54[_0x35a6('0x57')]['mapKey']]=_0x2b3a54[_0x35a6('0x57')][_0x35a6('0x76')];return db['CmContact'][_0x35a6('0x56')](_0x1e81b4,{'fields':_0x3a73a6,'raw':!![]});}})[_0x35a6('0x1e')](handleEntityNotFound(_0x22b697,null))[_0x35a6('0x1e')](function(_0x1c8040){_0x3484ad['contact']=_0x1c8040;if(_0x1c8040){var _0x4e4aea={'ContactId':_0x1c8040['id'],'OpenchannelAccountId':_0x2b3a54['params']['id'],'from':(_0x1c8040[_0x35a6('0x88')]||'')+'\x20'+(_0x1c8040['lastName']||'')};var _0x33d4e4={'OpenchannelAccountId':_0x2b3a54[_0x35a6('0x60')]['id'],'closed':![]};if(_0x2b3a54['body'][_0x35a6('0x89')]){_0x33d4e4['threadId']=_0x2b3a54[_0x35a6('0x57')][_0x35a6('0x89')];return db[_0x35a6('0x8a')][_0x35a6('0x5c')]({'where':_0x33d4e4})[_0x35a6('0x1e')](function(_0xbe34dc){if(_0xbe34dc){return[_0xbe34dc,![]];}_0x4e4aea['threadId']=_0x2b3a54[_0x35a6('0x57')]['threadId'];_0x4e4aea['externalUrl']=_0x2b3a54[_0x35a6('0x57')][_0x35a6('0x8b')];return db[_0x35a6('0x8a')][_0x35a6('0x56')](_0x4e4aea)[_0x35a6('0x1e')](function(_0x5ac478){return[_0x5ac478,!![]];});});}else{_0x33d4e4['threadId']=null;}_0x33d4e4[_0x35a6('0x8c')]=_0x1c8040['id'];return db[_0x35a6('0x8a')][_0x35a6('0x5c')]({'where':_0x33d4e4})[_0x35a6('0x1e')](function(_0x100f22){if(_0x100f22){return[_0x100f22,![]];}return db[_0x35a6('0x8a')]['create'](_0x4e4aea)[_0x35a6('0x1e')](function(_0x27e19a){return[_0x27e19a,!![]];});});}})[_0x35a6('0x8d')](function(_0x2bdc7e,_0xce3fef){if(_0x2bdc7e){_0x15b60d=_0xce3fef;if(!_0xce3fef){var _0x2af1d0={'from':(_0x3484ad[_0x35a6('0x8e')][_0x35a6('0x88')]||'')+'\x20'+(_0x3484ad['contact'][_0x35a6('0x8f')]||'')};if(_0x2b3a54[_0x35a6('0x57')]['threadId']&&_0x2b3a54[_0x35a6('0x57')][_0x35a6('0x90')]&&_0x2b3a54['body'][_0x35a6('0x89')]!=_0x2b3a54[_0x35a6('0x57')]['messageId']){_0x2af1d0['threadId']=_0x2b3a54[_0x35a6('0x57')][_0x35a6('0x90')];}return _0x2bdc7e[_0x35a6('0x33')](_0x2af1d0);}else{return _0x2bdc7e;}}})[_0x35a6('0x1e')](function(_0x528462){_0x3484ad[_0x35a6('0x91')]=_0x528462[_0x35a6('0x35')]({'plain':!![]});_0x3484ad[_0x35a6('0x91')][_0x35a6('0x92')]=_0x15b60d;if(_0x3484ad['interaction']['created']){if(_0x3484ad[_0x35a6('0x82')][_0x35a6('0x93')]){_0x3484ad[_0x35a6('0x83')][_0x35a6('0x94')]({'id':0x0,'priority':_0x3484ad['applications'][_0x35a6('0x45')]+0x1,'app':_0x35a6('0x95'),'appdata':_0x35a6('0x96'),'interval':'*,*,*,*'});}}return db[_0x35a6('0x97')][_0x35a6('0x56')]({'body':_0x2b3a54['body'][_0x35a6('0x57')],'OpenchannelAccountId':_0x2b3a54[_0x35a6('0x60')]['id'],'OpenchannelInteractionId':_0x528462['id'],'direction':'in','ContactId':_0x3484ad[_0x35a6('0x8e')]['id'],'AttachmentId':_0x2b3a54[_0x35a6('0x57')][_0x35a6('0x98')]});})[_0x35a6('0x1e')](function(_0x4ed2e3){_0x3484ad[_0x35a6('0x26')]=_0x4ed2e3;if(!_0x3484ad[_0x35a6('0x91')][_0x35a6('0x99')])return;return db[_0x35a6('0x9a')]['find']({'attributes':['id','name'],'where':{'id':_0x3484ad[_0x35a6('0x91')]['UserId']}});})[_0x35a6('0x1e')](function(_0x4407f9){if(_0x4407f9){_0x3484ad[_0x35a6('0x83')][_0x35a6('0x9b')]({'id':0x0,'priority':0x0,'app':_0x35a6('0x9c'),'appdata':_0x4407f9[_0x35a6('0x38')]+','+(_0x3484ad[_0x35a6('0x82')][_0x35a6('0x9d')]||0xa),'interval':_0x35a6('0x9e')});}if(!_0x3484ad[_0x35a6('0x91')][_0x35a6('0x9f')])return;return db['OpenchannelQueue']['find']({'attributes':['id','name'],'where':{'id':_0x3484ad[_0x35a6('0x91')][_0x35a6('0x9f')]}});})[_0x35a6('0x1e')](function(_0x58bddc){if(_0x58bddc){_0x3484ad[_0x35a6('0x83')][_0x35a6('0x9b')]({'id':0x0,'priority':0x1,'app':_0x35a6('0xa0'),'appdata':_0x58bddc[_0x35a6('0x38')]+','+(_0x3484ad[_0x35a6('0x82')][_0x35a6('0xa1')]||0x12c),'interval':_0x35a6('0x9e')});}return respondWithRpcPromise('Start','startRouting',_0x3484ad);})[_0x35a6('0x1e')](function(_0x52bbe4){respondWithRpcPromise(_0x35a6('0xa2'),_0x35a6('0xa2'),{'event':_0x35a6('0x6b'),'message':_0x52bbe4},client9002);return _0x52bbe4;})['then'](respondWithResult(_0x22b697,null))['catch'](handleError(_0x22b697,null));};exports[_0x35a6('0xa3')]=function(_0xd4120e,_0x27ec71){var _0x237251=_0xd4120e[_0x35a6('0x60')]['id'];var _0x44d9b1=_0xd4120e[_0x35a6('0x57')];var _0x24e74d=0xc8;var _0x1b926d=null;return db[_0x35a6('0xa4')][_0x35a6('0xa5')]({'isolationLevel':db['sequelize']['Transaction']['ISOLATION_LEVELS'][_0x35a6('0xa6')]},function(_0x48469f){return db[_0x35a6('0x3c')][_0x35a6('0x65')]({'where':{'id':_0x237251},'transaction':_0x48469f})[_0x35a6('0x1e')](function(_0x5229ad){if(_0x5229ad){return db['OpenchannelApplication'][_0x35a6('0x34')]({'where':{'OpenchannelAccountId':_0x237251},'transaction':_0x48469f})['then'](function(){var _0x265a9e=_[_0x35a6('0x3b')](_0x44d9b1,function(_0xa46c63){_0xa46c63[_0x35a6('0x63')]=_0x237251;return _0xa46c63;});return db['OpenchannelApplication'][_0x35a6('0xa7')](_0x265a9e,{'transaction':_0x48469f});});}else{_0x24e74d=0x194;_0x1b926d=[];}});})[_0x35a6('0x1e')](function(){if(_0x24e74d!==0x194){return db[_0x35a6('0x80')]['findAndCountAll']({'where':{'OpenchannelAccountId':_0x237251},'order':'priority'})[_0x35a6('0x1e')](function(_0x450058){_0x1b926d=_0x450058;});}})[_0x35a6('0x28')](function(_0x535dca){_0x24e74d=0x1f4;logger[_0x35a6('0x24')](_0x535dca[_0x35a6('0x37')]);if(_0x535dca[_0x35a6('0x38')]){delete _0x535dca[_0x35a6('0x38')];}_0x1b926d=_0x535dca;})[_0x35a6('0xa8')](function(){if(_0x1b926d===null){_0x27ec71[_0x35a6('0x36')](_0x24e74d);}else{if(_0x24e74d===0x1f4){_0x27ec71[_0x35a6('0x29')](_0x24e74d)['send'](_0x1b926d);}else{_0x27ec71[_0x35a6('0x29')](_0x24e74d)[_0x35a6('0x2b')](_0x1b926d);}}});};exports[_0x35a6('0xa9')]=function(_0x161a35,_0x2899c8,_0x5efb74){var _0x34101b={};var _0x43cd64={};var _0x2a0e22;var _0x5805ac;return db[_0x35a6('0x3c')][_0x35a6('0x65')]({'where':{'id':_0x161a35[_0x35a6('0x60')]['id']}})[_0x35a6('0x1e')](handleEntityNotFound(_0x2899c8,null))['then'](function(_0x103425){if(_0x103425){_0x2a0e22=_0x103425;_0x43cd64[_0x35a6('0x42')]=_['keys'](db[_0x35a6('0x80')]['rawAttributes']);_0x43cd64['query']=_[_0x35a6('0x3f')](_0x161a35['query']);_0x43cd64[_0x35a6('0x40')]=_[_0x35a6('0x41')](_0x43cd64[_0x35a6('0x42')],_0x43cd64['query']);_0x34101b[_0x35a6('0x44')]=_[_0x35a6('0x41')](_0x43cd64[_0x35a6('0x42')],qs[_0x35a6('0x43')](_0x161a35['query'][_0x35a6('0x43')]));_0x34101b[_0x35a6('0x44')]=_0x34101b[_0x35a6('0x44')][_0x35a6('0x45')]?_0x34101b['attributes']:_0x43cd64[_0x35a6('0x42')];_0x34101b['order']=qs['sort'](_0x161a35[_0x35a6('0x3e')][_0x35a6('0x49')]);_0x34101b['where']=qs['filters'](_[_0x35a6('0x4b')](_0x161a35[_0x35a6('0x3e')],_0x43cd64[_0x35a6('0x40')]));if(_0x161a35[_0x35a6('0x3e')]['filter']){_0x34101b['where']=_['merge'](_0x34101b[_0x35a6('0x4a')],{'$or':_['map'](_0x34101b[_0x35a6('0x44')],function(_0x17cfd7){var _0x523445={};_0x523445[_0x17cfd7]={'$like':'%'+_0x161a35[_0x35a6('0x3e')][_0x35a6('0x4c')]+'%'};return _0x523445;})});}_0x34101b=_[_0x35a6('0x4d')]({},_0x34101b,_0x161a35[_0x35a6('0x50')]);return _0x2a0e22['getApplications'](_0x34101b);}})[_0x35a6('0x1e')](function(_0x2c64f3){if(_0x2c64f3){_0x5805ac=_0x2c64f3[_0x35a6('0x45')];if(!_0x161a35[_0x35a6('0x3e')][_0x35a6('0x46')](_0x35a6('0x47'))){_0x34101b[_0x35a6('0x2f')]=qs[_0x35a6('0x2f')](_0x161a35[_0x35a6('0x3e')][_0x35a6('0x2f')]);_0x34101b['offset']=qs[_0x35a6('0x2c')](_0x161a35[_0x35a6('0x3e')][_0x35a6('0x2c')]);}return _0x2a0e22[_0x35a6('0xa9')](_0x34101b);}})[_0x35a6('0x1e')](function(_0x22cabd){if(_0x22cabd){return _0x22cabd?{'count':_0x5805ac,'rows':_0x22cabd}:null;}})[_0x35a6('0x1e')](respondWithResult(_0x2899c8,null))['catch'](handleError(_0x2899c8,null));};exports[_0x35a6('0xaa')]=function(_0x4eccff,_0x17532f,_0x398c23){var _0x3f9b69={'raw':![],'where':{}};var _0x27f821={};var _0x5e87db={'count':0x0,'rows':[]};return db[_0x35a6('0x3c')][_0x35a6('0x65')]({'where':{'id':_0x4eccff[_0x35a6('0x60')]['id']}})[_0x35a6('0x1e')](handleEntityNotFound(_0x17532f,null))[_0x35a6('0x1e')](function(_0x22f99c){if(_0x22f99c){_0x27f821[_0x35a6('0x42')]=_[_0x35a6('0x3f')](db[_0x35a6('0x8a')]['rawAttributes']);_0x27f821[_0x35a6('0x3e')]=_[_0x35a6('0x3f')](_0x4eccff[_0x35a6('0x3e')]);_0x27f821[_0x35a6('0x40')]=_[_0x35a6('0x41')](_0x27f821[_0x35a6('0x42')],_0x27f821[_0x35a6('0x3e')]);_0x3f9b69[_0x35a6('0x44')]=_['intersection'](_0x27f821[_0x35a6('0x42')],qs[_0x35a6('0x43')](_0x4eccff[_0x35a6('0x3e')][_0x35a6('0x43')]));_0x3f9b69[_0x35a6('0x44')]=_0x3f9b69['attributes'][_0x35a6('0x45')]?_0x3f9b69['attributes']:_0x27f821[_0x35a6('0x42')];if(!_0x4eccff['query'][_0x35a6('0x46')]('nolimit')){_0x3f9b69[_0x35a6('0x2f')]=qs['limit'](_0x4eccff[_0x35a6('0x3e')][_0x35a6('0x2f')]);_0x3f9b69[_0x35a6('0x2c')]=qs[_0x35a6('0x2c')](_0x4eccff[_0x35a6('0x3e')]['offset']);}_0x3f9b69['order']=qs[_0x35a6('0x49')](_0x4eccff['query'][_0x35a6('0x49')]);_0x3f9b69[_0x35a6('0x4a')]=qs[_0x35a6('0x40')](_[_0x35a6('0x4b')](_0x4eccff['query'],_0x27f821[_0x35a6('0x40')]));_0x3f9b69[_0x35a6('0x4a')][_0x35a6('0x63')]=_0x22f99c['id'];if(_0x4eccff['query'][_0x35a6('0x4c')]){_0x3f9b69['where']=_[_0x35a6('0x4d')](_0x3f9b69['where'],{'$or':_[_0x35a6('0x3b')](_0x3f9b69['attributes'],function(_0x967d29){var _0x39fb0e={};_0x39fb0e[_0x967d29]={'$like':'%'+_0x4eccff[_0x35a6('0x3e')][_0x35a6('0x4c')]+'%'};return _0x39fb0e;})});}_0x3f9b69=_['merge']({},_0x3f9b69,_0x4eccff[_0x35a6('0x50')]);return db[_0x35a6('0x8a')]['count']({'where':_0x3f9b69[_0x35a6('0x4a')]})[_0x35a6('0x1e')](function(_0x38f056){_0x5e87db['count']=_0x38f056;if(_0x4eccff['query'][_0x35a6('0x51')]){_0x3f9b69[_0x35a6('0x52')]=[{'model':db['CmContact'],'as':_0x35a6('0xab'),'required':![]},{'model':db[_0x35a6('0x9a')],'as':'Owner','attributes':[_0x35a6('0x38'),_0x35a6('0xac'),_0x35a6('0xad')],'required':![]},{'model':db[_0x35a6('0xae')],'as':_0x35a6('0xaf'),'attributes':['id',_0x35a6('0x38'),_0x35a6('0xb0')],'where':_0x4eccff['query'][_0x35a6('0xb1')]?{'id':_0x4eccff['query']['tag']}:undefined,'required':_0x4eccff[_0x35a6('0x3e')][_0x35a6('0xb1')]?!![]:![]}];}return db[_0x35a6('0x8a')]['findAll'](_0x3f9b69);})[_0x35a6('0x1e')](function(_0x4b86ba){_0x5e87db[_0x35a6('0x54')]=_0x4b86ba;return _0x5e87db;});}})[_0x35a6('0x1e')](respondWithFilteredResult(_0x17532f,_0x3f9b69))['catch'](handleError(_0x17532f,null));};exports[_0x35a6('0xb2')]=function(_0x52d60e,_0x27a54a,_0x2bd405){return db[_0x35a6('0x3c')][_0x35a6('0x5c')]({'where':{'id':_0x52d60e[_0x35a6('0x60')]['id']}})['then'](handleEntityNotFound(_0x27a54a,null))[_0x35a6('0x1e')](function(_0x176b56){if(_0x176b56){return _0x176b56[_0x35a6('0xb2')](_0x52d60e[_0x35a6('0x57')][_0x35a6('0x6a')],_[_0x35a6('0xb3')](_0x52d60e[_0x35a6('0x57')],[_0x35a6('0x6a'),'id'])||{})[_0x35a6('0x8d')](function(_0x2f44c4){for(var _0x2fca54=0x0;_0x2fca54<_0x52d60e[_0x35a6('0x57')][_0x35a6('0x6a')][_0x35a6('0x45')];_0x2fca54+=0x1){socket[_0x35a6('0xb4')](_0x35a6('0xb5'),{'UserId':Number(_0x52d60e['body'][_0x35a6('0x6a')][_0x2fca54]),'OpenchannelAccountId':Number(_0x52d60e[_0x35a6('0x60')]['id'])});}return _0x2f44c4;});}})['then'](respondWithResult(_0x27a54a,null))['catch'](handleError(_0x27a54a,null));};exports[_0x35a6('0xb6')]=function(_0x96b420,_0x4b18b8,_0x76006c){return db['OpenchannelAccount']['find']({'where':{'id':_0x96b420[_0x35a6('0x60')]['id']}})['then'](handleEntityNotFound(_0x4b18b8,null))[_0x35a6('0x1e')](function(_0x4c7829){if(_0x4c7829){return _0x4c7829[_0x35a6('0xb6')](_0x96b420['query']['ids'])[_0x35a6('0x1e')](function(){if(_[_0x35a6('0xb7')](_0x96b420['query'][_0x35a6('0x6a')])){for(var _0x432dcc=0x0;_0x432dcc<_0x96b420[_0x35a6('0x3e')][_0x35a6('0x6a')]['length'];_0x432dcc+=0x1){socket[_0x35a6('0xb4')](_0x35a6('0xb8'),{'UserId':Number(_0x96b420[_0x35a6('0x3e')][_0x35a6('0x6a')][_0x432dcc]),'OpenchannelAccountId':Number(_0x96b420[_0x35a6('0x60')]['id'])});}}else{socket['emit'](_0x35a6('0xb8'),{'UserId':Number(_0x96b420['query'][_0x35a6('0x6a')]),'OpenchannelAccountId':Number(_0x96b420[_0x35a6('0x60')]['id'])});}});}})[_0x35a6('0x1e')](respondWithStatusCode(_0x4b18b8,null))[_0x35a6('0x28')](handleError(_0x4b18b8,null));};exports[_0x35a6('0xb9')]=function(_0x2eb149,_0x3f1001,_0x5e7c2b){var _0x5b3819={};var _0x4c4738={};var _0x5069b6;var _0x5357a9;return db[_0x35a6('0x3c')][_0x35a6('0x65')]({'where':{'id':_0x2eb149[_0x35a6('0x60')]['id']}})[_0x35a6('0x1e')](handleEntityNotFound(_0x3f1001,null))[_0x35a6('0x1e')](function(_0x47834f){if(_0x47834f){_0x5069b6=_0x47834f;_0x4c4738['model']=_[_0x35a6('0x3f')](db['User'][_0x35a6('0x3d')]);_0x4c4738[_0x35a6('0x3e')]=_[_0x35a6('0x3f')](_0x2eb149[_0x35a6('0x3e')]);_0x4c4738[_0x35a6('0x40')]=_[_0x35a6('0x41')](_0x4c4738[_0x35a6('0x42')],_0x4c4738[_0x35a6('0x3e')]);_0x5b3819[_0x35a6('0x44')]=_[_0x35a6('0x41')](_0x4c4738[_0x35a6('0x42')],qs[_0x35a6('0x43')](_0x2eb149[_0x35a6('0x3e')][_0x35a6('0x43')]));_0x5b3819[_0x35a6('0x44')]=_0x5b3819[_0x35a6('0x44')][_0x35a6('0x45')]?_0x5b3819[_0x35a6('0x44')]:_0x4c4738[_0x35a6('0x42')];_0x5b3819[_0x35a6('0x48')]=qs['sort'](_0x2eb149[_0x35a6('0x3e')][_0x35a6('0x49')]);_0x5b3819[_0x35a6('0x4a')]=qs[_0x35a6('0x40')](_[_0x35a6('0x4b')](_0x2eb149[_0x35a6('0x3e')],_0x4c4738['filters']));if(_0x2eb149[_0x35a6('0x3e')][_0x35a6('0x4c')]){_0x5b3819['where']=_['merge'](_0x5b3819[_0x35a6('0x4a')],{'$or':_[_0x35a6('0x3b')](_0x5b3819[_0x35a6('0x44')],function(_0x588414){var _0x1870ab={};_0x1870ab[_0x588414]={'$like':'%'+_0x2eb149[_0x35a6('0x3e')][_0x35a6('0x4c')]+'%'};return _0x1870ab;})});}_0x5b3819=_['merge']({},_0x5b3819,_0x2eb149[_0x35a6('0x50')]);return _0x5069b6[_0x35a6('0xb9')](_0x5b3819);}})[_0x35a6('0x1e')](function(_0x2b487a){if(_0x2b487a){_0x5357a9=_0x2b487a[_0x35a6('0x45')];if(!_0x2eb149[_0x35a6('0x3e')][_0x35a6('0x46')](_0x35a6('0x47'))){_0x5b3819['limit']=qs[_0x35a6('0x2f')](_0x2eb149[_0x35a6('0x3e')][_0x35a6('0x2f')]);_0x5b3819['offset']=qs[_0x35a6('0x2c')](_0x2eb149[_0x35a6('0x3e')][_0x35a6('0x2c')]);}return _0x5069b6['getAgents'](_0x5b3819);}})[_0x35a6('0x1e')](function(_0xbd3122){if(_0xbd3122){return _0xbd3122?{'count':_0x5357a9,'rows':_0xbd3122}:null;}})[_0x35a6('0x1e')](respondWithResult(_0x3f1001,null))[_0x35a6('0x28')](handleError(_0x3f1001,null));};exports[_0x35a6('0x39')]=function(_0x127378,_0x43ceb0,_0x389e3f){var _0x3caf1e,_0x25c731,_0x562a23;if(_[_0x35a6('0x75')](_0x127378[_0x35a6('0x57')][_0x35a6('0x57')])||_0x127378['body'][_0x35a6('0x57')]===''){throw new db[(_0x35a6('0x77'))][(_0x35a6('0x6e'))](_0x35a6('0x79'));}if(_[_0x35a6('0x75')](_0x127378[_0x35a6('0x57')]['to'])){}_0x3caf1e=_0x127378[_0x35a6('0x57')]['to'];return db[_0x35a6('0x3c')][_0x35a6('0x65')]({'where':{'id':_0x127378[_0x35a6('0x60')]['id']}})['then'](handleEntityNotFound(_0x43ceb0,null))[_0x35a6('0x1e')](function(_0x2957b9){if(_0x2957b9){return db[_0x35a6('0x3c')]['find']({'where':{'id':_0x2957b9['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db['CmContact'],'as':_0x35a6('0x7f'),'where':{[_0x2957b9[_0x35a6('0x7a')]]:_0x3caf1e},'limit':0x1,'order':[[_0x35a6('0x71'),_0x35a6('0xba')]]}]}]})[_0x35a6('0x1e')](handleEntityNotFound(_0x43ceb0,null))['then'](function(_0x2f5b9f){if(_0x2f5b9f&&_0x2f5b9f[_0x35a6('0x7e')]){_0x25c731=_0x2f5b9f[_0x35a6('0x35')]({'plain':!![]});if(_0x25c731[_0x35a6('0x7e')]&&_0x25c731['List'][_0x35a6('0x7f')]['length']){return _0x25c731[_0x35a6('0x7e')]['Contacts'][0x0];}return db[_0x35a6('0x6d')][_0x35a6('0x56')](_[_0x35a6('0x16')](_0x127378[_0x35a6('0x57')],{'firstName':_0x3caf1e,[_0x2f5b9f[_0x35a6('0x7a')]]:_0x3caf1e,'phone':_0x3caf1e,'ListId':_0x25c731['ListId']}));}})[_0x35a6('0x1e')](handleEntityNotFound(_0x43ceb0,null))[_0x35a6('0x1e')](function(_0x2d1ecf){if(_0x2d1ecf){_0x562a23=_0x2d1ecf;return db[_0x35a6('0x8a')]['find']({'where':{'ContactId':_0x562a23['id'],'closed':![],'OpenchannelAccountId':_0x25c731['id']}})['then'](function(_0x5eaf5c){if(_0x5eaf5c){return[_0x5eaf5c,![]];}return db[_0x35a6('0x8a')][_0x35a6('0x56')]({'UserId':_0x127378[_0x35a6('0x58')]['id'],'ContactId':_0x562a23['id'],'OpenchannelAccountId':_0x25c731['id'],'lastMsgDirection':_0x35a6('0xbb'),'firstMsgDirection':_0x35a6('0xbb'),'Messages':[_[_0x35a6('0x4d')](_0x127378[_0x35a6('0x57')],{'read':![],'body':_0x127378[_0x35a6('0x57')][_0x35a6('0x57')],'OpenchannelAccountId':_0x25c731['id'],'UserId':_0x127378[_0x35a6('0x58')]['id'],'ContactId':_0x562a23['id']})]},{'include':[{'model':db[_0x35a6('0x97')],'as':'Messages'}]})[_0x35a6('0x1e')](function(_0x250b94){return[_0x250b94,!![]];});});}})[_0x35a6('0x8d')](function(_0x1278be,_0x1a510f){if(_0x1a510f){return _0x1278be;}return db['OpenchannelMessage']['create'](_[_0x35a6('0x4d')](_0x127378[_0x35a6('0x57')],{'read':![],'body':_0x127378[_0x35a6('0x57')][_0x35a6('0x57')],'OpenchannelAccountId':_0x25c731['id'],'OpenchannelInteractionId':_0x1278be['id'],'UserId':_0x127378['user']['id'],'ContactId':_0x562a23['id']}))[_0x35a6('0x1e')](function(_0x479988){_0x1278be[_0x35a6('0xbc')][_0x35a6('0xbd')]=[];_0x1278be['dataValues'][_0x35a6('0xbd')]['push'](_0x479988[_0x35a6('0xbc')]);return _0x1278be;});});}})[_0x35a6('0x1e')](respondWithResult(_0x43ceb0,null))[_0x35a6('0x28')](handleError(_0x43ceb0,null));}; \ No newline at end of file +var _0xb1aa=['save','get','OpenchannelAccounts','UserProfileResource','destroy','stack','name','send','index','Pause','mandatoryDispositionPause','map','OpenchannelAccount','rawAttributes','key','query','keys','filters','intersection','model','attributes','length','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','fields','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','describe','addDisposition','OpenchannelAccountId','Disposition','create','getDispositions','hasOwnProperty','removeDispositions','addAnswer','CannedAnswer','getAnswers','findOne','removeAnswers','notify','openchannel','Sequelize','no\x20available\x20attributes','createdAt','updatedAt','difference','ListId','isNil','from','ValidationError','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','List','CmContact','DESC','OpenchannelApplication','Applications','account','applications','list','priority','asc','Contacts','firstName','threadId','OpenchannelInteraction','externalUrl','contact','lastName','messageId','created','interaction','autoclose','push','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','queueId','OpenchannelQueue','queue','waitForTheAssignedQueue','Start','EventManager','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','finally','getApplications','getInteractions','Contact','Owner','fullname','internal','color','tag','addAgents','ids','omit','removeAgents','isArray','userOpenchannelAccount:remove','emit','getAgents','body\x20is\x20mandatory\x20and\x20not\x20empty','out','Messages','dataValues','eml-format','rimraf','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/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./openchannelAccount.socket','register','jayson/promise','client','http','request','then','info','OpenchannelAccount,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','sendStatus','end','status','json','offset','undefined','limit','count','set','reject'];(function(_0x139a3c,_0x4fc883){var _0x2b375b=function(_0x525dbf){while(--_0x525dbf){_0x139a3c['push'](_0x139a3c['shift']());}};_0x2b375b(++_0x4fc883);}(_0xb1aa,0x159));var _0xab1a=function(_0x2eeb4b,_0x3585ad){_0x2eeb4b=_0x2eeb4b-0x0;var _0x245dff=_0xb1aa[_0x2eeb4b];return _0x245dff;};'use strict';var emlformat=require(_0xab1a('0x0'));var rimraf=require(_0xab1a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xab1a('0x2'));var rp=require('request-promise');var moment=require(_0xab1a('0x3'));var BPromise=require(_0xab1a('0x4'));var Mustache=require(_0xab1a('0x5'));var util=require(_0xab1a('0x6'));var path=require(_0xab1a('0x7'));var sox=require(_0xab1a('0x8'));var csv=require(_0xab1a('0x9'));var ejs=require(_0xab1a('0xa'));var fs=require('fs');var fs_extra=require(_0xab1a('0xb'));var _=require(_0xab1a('0xc'));var squel=require('squel');var crypto=require(_0xab1a('0xd'));var jsforce=require(_0xab1a('0xe'));var deskjs=require(_0xab1a('0xf'));var toCsv=require(_0xab1a('0x9'));var querystring=require(_0xab1a('0x10'));var Papa=require(_0xab1a('0x11'));var Redis=require(_0xab1a('0x12'));var authService=require(_0xab1a('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xab1a('0x14'));var hardwareService=require(_0xab1a('0x15'));var logger=require(_0xab1a('0x16'))(_0xab1a('0x17'));var utils=require(_0xab1a('0x18'));var config=require(_0xab1a('0x19'));var licenseUtil=require(_0xab1a('0x1a'));var db=require(_0xab1a('0x1b'))['db'];config[_0xab1a('0x1c')]=_[_0xab1a('0x1d')](config[_0xab1a('0x1c')],{'host':'localhost','port':0x18eb});var socket=require(_0xab1a('0x1e'))(new Redis(config['redis']));require(_0xab1a('0x1f'))[_0xab1a('0x20')](socket);var jayson=require(_0xab1a('0x21'));var client=jayson[_0xab1a('0x22')][_0xab1a('0x23')]({'port':0x232c});var client9002=jayson[_0xab1a('0x22')][_0xab1a('0x23')]({'port':0x232a});function respondWithRpcPromise(_0x318dd7,_0x1329d9,_0x661aa8,_0x468d20){return new BPromise(function(_0x4b5fe6,_0x22b910){var _0x23fb1f=_0x468d20||client;return _0x23fb1f[_0xab1a('0x24')](_0x318dd7,_0x661aa8)[_0xab1a('0x25')](function(_0x24a612){logger[_0xab1a('0x26')](_0xab1a('0x27'),_0x1329d9,'request\x20sent');logger['debug']('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x1329d9,'request\x20sent',JSON[_0xab1a('0x28')](_0x24a612));if(_0x24a612[_0xab1a('0x29')]){if(_0x24a612[_0xab1a('0x29')][_0xab1a('0x2a')]===0x1f4){logger[_0xab1a('0x29')](_0xab1a('0x27'),_0x1329d9,_0x24a612[_0xab1a('0x29')]['message']);return _0x22b910(_0x24a612[_0xab1a('0x29')][_0xab1a('0x2b')]);}logger[_0xab1a('0x29')](_0xab1a('0x27'),_0x1329d9,_0x24a612[_0xab1a('0x29')]['message']);return _0x4b5fe6(_0x24a612[_0xab1a('0x29')][_0xab1a('0x2b')]);}else{logger[_0xab1a('0x26')](_0xab1a('0x27'),_0x1329d9,_0xab1a('0x2c'));_0x4b5fe6(_0x24a612[_0xab1a('0x2d')]['message']);}})[_0xab1a('0x2e')](function(_0x41d4e6){logger[_0xab1a('0x29')]('OpenchannelAccount,\x20%s,\x20%s',_0x1329d9,_0x41d4e6);_0x22b910(_0x41d4e6);});});}function respondWithStatusCode(_0x5c7a37,_0x10c4a8){_0x10c4a8=_0x10c4a8||0xcc;return function(_0x62e6bb){if(_0x62e6bb){return _0x5c7a37[_0xab1a('0x2f')](_0x10c4a8);}return _0x5c7a37['status'](_0x10c4a8)[_0xab1a('0x30')]();};}function respondWithResult(_0x35ae5f,_0x140483){_0x140483=_0x140483||0xc8;return function(_0x473720){if(_0x473720){return _0x35ae5f[_0xab1a('0x31')](_0x140483)[_0xab1a('0x32')](_0x473720);}};}function respondWithFilteredResult(_0x1853c8,_0x411707){return function(_0x122b94){if(_0x122b94){var _0x2fba42=typeof _0x411707[_0xab1a('0x33')]===_0xab1a('0x34')&&typeof _0x411707[_0xab1a('0x35')]===_0xab1a('0x34');var _0x49ce09=_0x122b94[_0xab1a('0x36')];var _0x13d163=_0x2fba42?0x0:_0x411707['offset'];var _0x110650=_0x2fba42?_0x122b94[_0xab1a('0x36')]:_0x411707[_0xab1a('0x33')]+_0x411707[_0xab1a('0x35')];var _0x3ffded;if(_0x110650>=_0x49ce09){_0x110650=_0x49ce09;_0x3ffded=0xc8;}else{_0x3ffded=0xce;}_0x1853c8[_0xab1a('0x31')](_0x3ffded);return _0x1853c8[_0xab1a('0x37')]('Content-Range',_0x13d163+'-'+_0x110650+'/'+_0x49ce09)[_0xab1a('0x32')](_0x122b94);}return null;};}function patchUpdates(_0x571141){return function(_0x207194){try{jsonpatch['apply'](_0x207194,_0x571141,!![]);}catch(_0xfa2eaa){return BPromise[_0xab1a('0x38')](_0xfa2eaa);}return _0x207194[_0xab1a('0x39')]();};}function saveUpdates(_0x2e8afd,_0x1b5523){return function(_0x1fcff6){if(_0x1fcff6){return _0x1fcff6['update'](_0x2e8afd)[_0xab1a('0x25')](function(_0x1d1fc4){return _0x1d1fc4;});}return null;};}function removeEntity(_0x410683,_0x30f1c2){return function(_0x2c5064){if(_0x2c5064){return _0x2c5064['destroy']()['then'](function(){var _0x1ce017=_0x2c5064[_0xab1a('0x3a')]({'plain':!![]});var _0x12a47a=_0xab1a('0x3b');return db[_0xab1a('0x3c')][_0xab1a('0x3d')]({'where':{'type':_0x12a47a,'resourceId':_0x1ce017['id']}})['then'](function(){return _0x2c5064;});})[_0xab1a('0x25')](function(){_0x410683[_0xab1a('0x31')](0xcc)[_0xab1a('0x30')]();});}};}function handleEntityNotFound(_0x824456,_0x29cf35){return function(_0x405dc3){if(!_0x405dc3){_0x824456[_0xab1a('0x2f')](0x194);}return _0x405dc3;};}function handleError(_0x452d81,_0x4f5dc7){_0x4f5dc7=_0x4f5dc7||0x1f4;return function(_0xed30c9){logger[_0xab1a('0x29')](_0xed30c9[_0xab1a('0x3e')]);if(_0xed30c9[_0xab1a('0x3f')]){delete _0xed30c9[_0xab1a('0x3f')];}_0x452d81[_0xab1a('0x31')](_0x4f5dc7)[_0xab1a('0x40')](_0xed30c9);};}exports[_0xab1a('0x41')]=function(_0x31e9b6,_0x1a0128){var _0x139e4e={'include':[{'model':db[_0xab1a('0x42')],'as':_0xab1a('0x43')}]},_0x3e9244={},_0x5e1ab4={'count':0x0,'rows':[]};var _0x37e946=_[_0xab1a('0x44')](db[_0xab1a('0x45')][_0xab1a('0x46')],function(_0x5784c3){return{'name':_0x5784c3['fieldName'],'type':_0x5784c3['type'][_0xab1a('0x47')]};});_0x3e9244['model']=_['map'](_0x37e946,'name');_0x3e9244[_0xab1a('0x48')]=_[_0xab1a('0x49')](_0x31e9b6['query']);_0x3e9244[_0xab1a('0x4a')]=_[_0xab1a('0x4b')](_0x3e9244[_0xab1a('0x4c')],_0x3e9244[_0xab1a('0x48')]);_0x139e4e[_0xab1a('0x4d')]=_['intersection'](_0x3e9244[_0xab1a('0x4c')],qs['fields'](_0x31e9b6[_0xab1a('0x48')]['fields']));_0x139e4e[_0xab1a('0x4d')]=_0x139e4e[_0xab1a('0x4d')][_0xab1a('0x4e')]?_0x139e4e[_0xab1a('0x4d')]:_0x3e9244['model'];if(!_0x31e9b6['query']['hasOwnProperty'](_0xab1a('0x4f'))){_0x139e4e[_0xab1a('0x35')]=qs[_0xab1a('0x35')](_0x31e9b6['query'][_0xab1a('0x35')]);_0x139e4e[_0xab1a('0x33')]=qs[_0xab1a('0x33')](_0x31e9b6[_0xab1a('0x48')][_0xab1a('0x33')]);}_0x139e4e[_0xab1a('0x50')]=qs[_0xab1a('0x51')](_0x31e9b6[_0xab1a('0x48')][_0xab1a('0x51')]);_0x139e4e[_0xab1a('0x52')]=qs['filters'](_[_0xab1a('0x53')](_0x31e9b6['query'],_0x3e9244[_0xab1a('0x4a')]),_0x37e946);if(_0x31e9b6[_0xab1a('0x48')][_0xab1a('0x54')]){_0x139e4e[_0xab1a('0x52')]=_['merge'](_0x139e4e[_0xab1a('0x52')],{'$or':_[_0xab1a('0x44')](_0x37e946,function(_0x1e594c){if(_0x1e594c[_0xab1a('0x55')]!==_0xab1a('0x56')){var _0x1a3255={};_0x1a3255[_0x1e594c[_0xab1a('0x3f')]]={'$like':'%'+_0x31e9b6['query']['filter']+'%'};return _0x1a3255;}})});}_0x139e4e=_[_0xab1a('0x57')]({},_0x139e4e,_0x31e9b6[_0xab1a('0x58')]);var _0x264657={'where':_0x139e4e[_0xab1a('0x52')]};return db[_0xab1a('0x45')][_0xab1a('0x36')](_0x264657)[_0xab1a('0x25')](function(_0x4444ef){_0x5e1ab4[_0xab1a('0x36')]=_0x4444ef;if(_0x31e9b6[_0xab1a('0x48')][_0xab1a('0x59')]){_0x139e4e[_0xab1a('0x5a')]=[{'all':!![]}];}return db[_0xab1a('0x45')][_0xab1a('0x5b')](_0x139e4e);})['then'](function(_0x885884){_0x5e1ab4[_0xab1a('0x5c')]=_0x885884;return _0x5e1ab4;})[_0xab1a('0x25')](respondWithFilteredResult(_0x1a0128,_0x139e4e))[_0xab1a('0x2e')](handleError(_0x1a0128,null));};exports[_0xab1a('0x5d')]=function(_0x549f49,_0x58c869){var _0x3e18ba={'raw':![],'where':{'id':_0x549f49[_0xab1a('0x5e')]['id']},'include':[{'model':db['Pause'],'as':_0xab1a('0x43')}]},_0x7496e2={};_0x7496e2[_0xab1a('0x4c')]=_[_0xab1a('0x49')](db['OpenchannelAccount'][_0xab1a('0x46')]);_0x7496e2[_0xab1a('0x48')]=_['keys'](_0x549f49[_0xab1a('0x48')]);_0x7496e2[_0xab1a('0x4a')]=_['intersection'](_0x7496e2[_0xab1a('0x4c')],_0x7496e2['query']);_0x3e18ba[_0xab1a('0x4d')]=_[_0xab1a('0x4b')](_0x7496e2['model'],qs[_0xab1a('0x5f')](_0x549f49[_0xab1a('0x48')]['fields']));_0x3e18ba[_0xab1a('0x4d')]=_0x3e18ba['attributes'][_0xab1a('0x4e')]?_0x3e18ba[_0xab1a('0x4d')]:_0x7496e2[_0xab1a('0x4c')];if(_0x549f49[_0xab1a('0x48')][_0xab1a('0x59')]){_0x3e18ba[_0xab1a('0x5a')]=[{'all':!![]}];}_0x3e18ba=_[_0xab1a('0x57')]({},_0x3e18ba,_0x549f49[_0xab1a('0x58')]);return db['OpenchannelAccount']['find'](_0x3e18ba)[_0xab1a('0x25')](handleEntityNotFound(_0x58c869,null))[_0xab1a('0x25')](respondWithResult(_0x58c869,null))[_0xab1a('0x2e')](handleError(_0x58c869,null));};exports['create']=function(_0x281d6e,_0x4483bb){return db[_0xab1a('0x45')]['create'](_0x281d6e['body'],{})['then'](function(_0x34d796){var _0xcef056=_0x281d6e[_0xab1a('0x60')]['get']({'plain':!![]});if(!_0xcef056)throw new Error(_0xab1a('0x61'));if(_0xcef056[_0xab1a('0x62')]===_0xab1a('0x60')){var _0xd6cb53=_0x34d796[_0xab1a('0x3a')]({'plain':!![]});var _0x3e94ae='OpenchannelAccounts';return db[_0xab1a('0x63')][_0xab1a('0x64')]({'where':{'name':_0x3e94ae,'userProfileId':_0xcef056[_0xab1a('0x65')]},'raw':!![]})[_0xab1a('0x25')](function(_0x1adeff){if(_0x1adeff&&_0x1adeff[_0xab1a('0x66')]===0x0){return db['UserProfileResource']['create']({'name':_0xd6cb53[_0xab1a('0x3f')],'resourceId':_0xd6cb53['id'],'type':_0x1adeff[_0xab1a('0x3f')],'sectionId':_0x1adeff['id']},{})[_0xab1a('0x25')](function(){return _0x34d796;});}else{return _0x34d796;}})['catch'](function(_0x3eae02){logger[_0xab1a('0x29')](_0xab1a('0x67'),_0x3eae02);throw _0x3eae02;});}return _0x34d796;})[_0xab1a('0x25')](respondWithResult(_0x4483bb,0xc9))['catch'](handleError(_0x4483bb,null));};exports[_0xab1a('0x68')]=function(_0x3a1d1c,_0x2be743){if(_0x3a1d1c[_0xab1a('0x69')]['id']){delete _0x3a1d1c[_0xab1a('0x69')]['id'];}return db['OpenchannelAccount'][_0xab1a('0x64')]({'where':{'id':_0x3a1d1c[_0xab1a('0x5e')]['id']},'include':[{'model':db[_0xab1a('0x42')],'as':_0xab1a('0x43')}]})['then'](handleEntityNotFound(_0x2be743,null))['then'](saveUpdates(_0x3a1d1c['body'],null))[_0xab1a('0x25')](respondWithResult(_0x2be743,null))[_0xab1a('0x2e')](handleError(_0x2be743,null));};exports[_0xab1a('0x3d')]=function(_0x11f3bf,_0x11e2da){return db[_0xab1a('0x45')][_0xab1a('0x64')]({'where':{'id':_0x11f3bf['params']['id']}})[_0xab1a('0x25')](handleEntityNotFound(_0x11e2da,null))[_0xab1a('0x25')](removeEntity(_0x11e2da,null))[_0xab1a('0x2e')](handleError(_0x11e2da,null));};exports[_0xab1a('0x6a')]=function(_0xaa15fd,_0x33ee01){return db['OpenchannelAccount'][_0xab1a('0x6a')]()[_0xab1a('0x25')](respondWithResult(_0x33ee01,null))[_0xab1a('0x2e')](handleError(_0x33ee01,null));};exports[_0xab1a('0x6b')]=function(_0x552d0c,_0x56276d,_0x133bb5){if(_0x552d0c[_0xab1a('0x69')]['id']){delete _0x552d0c[_0xab1a('0x69')]['id'];}return db[_0xab1a('0x45')][_0xab1a('0x64')]({'where':{'id':_0x552d0c[_0xab1a('0x5e')]['id']}})[_0xab1a('0x25')](handleEntityNotFound(_0x56276d,null))[_0xab1a('0x25')](function(_0x5ee9d3){if(_0x5ee9d3){_0x552d0c[_0xab1a('0x69')][_0xab1a('0x6c')]=_0x5ee9d3['id'];return db[_0xab1a('0x6d')][_0xab1a('0x6e')](_0x552d0c['body']);}})[_0xab1a('0x25')](respondWithResult(_0x56276d,null))[_0xab1a('0x2e')](handleError(_0x56276d,null));};exports[_0xab1a('0x6f')]=function(_0x2eeeba,_0x1e8f14,_0x4c302d){var _0x16be31={'raw':![],'where':{}};var _0x1a8431={};var _0x348c83={'count':0x0,'rows':[]};return db[_0xab1a('0x45')]['findOne']({'where':{'id':_0x2eeeba[_0xab1a('0x5e')]['id']}})[_0xab1a('0x25')](handleEntityNotFound(_0x1e8f14,null))[_0xab1a('0x25')](function(_0x2e777c){if(_0x2e777c){_0x1a8431[_0xab1a('0x4c')]=_[_0xab1a('0x49')](db['Disposition']['rawAttributes']);_0x1a8431[_0xab1a('0x48')]=_[_0xab1a('0x49')](_0x2eeeba['query']);_0x1a8431[_0xab1a('0x4a')]=_[_0xab1a('0x4b')](_0x1a8431[_0xab1a('0x4c')],_0x1a8431[_0xab1a('0x48')]);_0x16be31['attributes']=_['intersection'](_0x1a8431[_0xab1a('0x4c')],qs[_0xab1a('0x5f')](_0x2eeeba[_0xab1a('0x48')][_0xab1a('0x5f')]));_0x16be31[_0xab1a('0x4d')]=_0x16be31['attributes']['length']?_0x16be31[_0xab1a('0x4d')]:_0x1a8431[_0xab1a('0x4c')];if(!_0x2eeeba[_0xab1a('0x48')][_0xab1a('0x70')]('nolimit')){_0x16be31[_0xab1a('0x35')]=qs[_0xab1a('0x35')](_0x2eeeba[_0xab1a('0x48')][_0xab1a('0x35')]);_0x16be31[_0xab1a('0x33')]=qs[_0xab1a('0x33')](_0x2eeeba[_0xab1a('0x48')][_0xab1a('0x33')]);}_0x16be31[_0xab1a('0x50')]=qs['sort'](_0x2eeeba[_0xab1a('0x48')]['sort']);_0x16be31['where']=qs[_0xab1a('0x4a')](_[_0xab1a('0x53')](_0x2eeeba[_0xab1a('0x48')],_0x1a8431[_0xab1a('0x4a')]));_0x16be31[_0xab1a('0x52')][_0xab1a('0x6c')]=_0x2e777c['id'];if(_0x2eeeba[_0xab1a('0x48')][_0xab1a('0x54')]){_0x16be31[_0xab1a('0x52')]=_[_0xab1a('0x57')](_0x16be31[_0xab1a('0x52')],{'$or':_[_0xab1a('0x44')](_0x16be31[_0xab1a('0x4d')],function(_0x32b5f5){var _0x601b1b={};_0x601b1b[_0x32b5f5]={'$like':'%'+_0x2eeeba['query'][_0xab1a('0x54')]+'%'};return _0x601b1b;})});}_0x16be31=_[_0xab1a('0x57')]({},_0x16be31,_0x2eeeba['options']);return db[_0xab1a('0x6d')][_0xab1a('0x36')]({'where':_0x16be31[_0xab1a('0x52')]})[_0xab1a('0x25')](function(_0x50c06e){_0x348c83['count']=_0x50c06e;if(_0x2eeeba[_0xab1a('0x48')][_0xab1a('0x59')]){_0x16be31['include']=[{'all':!![]}];}return db[_0xab1a('0x6d')]['findAll'](_0x16be31);})[_0xab1a('0x25')](function(_0x19cb48){_0x348c83[_0xab1a('0x5c')]=_0x19cb48;return _0x348c83;});}})[_0xab1a('0x25')](respondWithFilteredResult(_0x1e8f14,_0x16be31))[_0xab1a('0x2e')](handleError(_0x1e8f14,null));};exports['removeDispositions']=function(_0x2a92e3,_0x1613f4,_0x343cb0){return db[_0xab1a('0x45')][_0xab1a('0x64')]({'where':{'id':_0x2a92e3[_0xab1a('0x5e')]['id']}})[_0xab1a('0x25')](handleEntityNotFound(_0x1613f4,null))[_0xab1a('0x25')](function(_0x121ae1){if(_0x121ae1){return _0x121ae1[_0xab1a('0x71')](_0x2a92e3[_0xab1a('0x48')]['ids']);}})[_0xab1a('0x25')](respondWithStatusCode(_0x1613f4,null))[_0xab1a('0x2e')](handleError(_0x1613f4,null));};exports[_0xab1a('0x72')]=function(_0x3e94f2,_0x416426,_0x3763f3){if(_0x3e94f2[_0xab1a('0x69')]['id']){delete _0x3e94f2['body']['id'];}return db[_0xab1a('0x45')][_0xab1a('0x64')]({'where':{'id':_0x3e94f2['params']['id']}})[_0xab1a('0x25')](handleEntityNotFound(_0x416426,null))['then'](function(_0x3a43b6){if(_0x3a43b6){_0x3e94f2[_0xab1a('0x69')][_0xab1a('0x6c')]=_0x3a43b6['id'];return db[_0xab1a('0x73')][_0xab1a('0x6e')](_0x3e94f2[_0xab1a('0x69')]);}})['then'](respondWithResult(_0x416426,null))['catch'](handleError(_0x416426,null));};exports[_0xab1a('0x74')]=function(_0xa6fd69,_0x59658a,_0x314927){var _0x10c4cc={'raw':![],'where':{}};var _0x2e7900={};var _0x1a1f29={'count':0x0,'rows':[]};return db[_0xab1a('0x45')][_0xab1a('0x75')]({'where':{'id':_0xa6fd69[_0xab1a('0x5e')]['id']}})[_0xab1a('0x25')](handleEntityNotFound(_0x59658a,null))[_0xab1a('0x25')](function(_0xa06972){if(_0xa06972){_0x2e7900[_0xab1a('0x4c')]=_[_0xab1a('0x49')](db['CannedAnswer'][_0xab1a('0x46')]);_0x2e7900['query']=_[_0xab1a('0x49')](_0xa6fd69[_0xab1a('0x48')]);_0x2e7900[_0xab1a('0x4a')]=_[_0xab1a('0x4b')](_0x2e7900[_0xab1a('0x4c')],_0x2e7900[_0xab1a('0x48')]);_0x10c4cc['attributes']=_['intersection'](_0x2e7900[_0xab1a('0x4c')],qs[_0xab1a('0x5f')](_0xa6fd69[_0xab1a('0x48')][_0xab1a('0x5f')]));_0x10c4cc['attributes']=_0x10c4cc[_0xab1a('0x4d')][_0xab1a('0x4e')]?_0x10c4cc[_0xab1a('0x4d')]:_0x2e7900[_0xab1a('0x4c')];if(!_0xa6fd69[_0xab1a('0x48')][_0xab1a('0x70')](_0xab1a('0x4f'))){_0x10c4cc[_0xab1a('0x35')]=qs[_0xab1a('0x35')](_0xa6fd69[_0xab1a('0x48')][_0xab1a('0x35')]);_0x10c4cc[_0xab1a('0x33')]=qs['offset'](_0xa6fd69['query'][_0xab1a('0x33')]);}_0x10c4cc[_0xab1a('0x50')]=qs[_0xab1a('0x51')](_0xa6fd69[_0xab1a('0x48')][_0xab1a('0x51')]);_0x10c4cc[_0xab1a('0x52')]=qs['filters'](_['pick'](_0xa6fd69[_0xab1a('0x48')],_0x2e7900[_0xab1a('0x4a')]));_0x10c4cc[_0xab1a('0x52')][_0xab1a('0x6c')]=_0xa06972['id'];if(_0xa6fd69['query']['filter']){_0x10c4cc[_0xab1a('0x52')]=_['merge'](_0x10c4cc[_0xab1a('0x52')],{'$or':_[_0xab1a('0x44')](_0x10c4cc[_0xab1a('0x4d')],function(_0x5a372a){var _0x5f02f5={};_0x5f02f5[_0x5a372a]={'$like':'%'+_0xa6fd69['query'][_0xab1a('0x54')]+'%'};return _0x5f02f5;})});}_0x10c4cc=_[_0xab1a('0x57')]({},_0x10c4cc,_0xa6fd69[_0xab1a('0x58')]);return db[_0xab1a('0x73')]['count']({'where':_0x10c4cc[_0xab1a('0x52')]})['then'](function(_0x1f0b1e){_0x1a1f29[_0xab1a('0x36')]=_0x1f0b1e;if(_0xa6fd69[_0xab1a('0x48')][_0xab1a('0x59')]){_0x10c4cc[_0xab1a('0x5a')]=[{'all':!![]}];}return db[_0xab1a('0x73')]['findAll'](_0x10c4cc);})['then'](function(_0x2dbd44){_0x1a1f29['rows']=_0x2dbd44;return _0x1a1f29;});}})[_0xab1a('0x25')](respondWithFilteredResult(_0x59658a,_0x10c4cc))[_0xab1a('0x2e')](handleError(_0x59658a,null));};exports['removeAnswers']=function(_0x4b45d2,_0x313b99,_0x29ba17){return db[_0xab1a('0x45')][_0xab1a('0x64')]({'where':{'id':_0x4b45d2[_0xab1a('0x5e')]['id']}})['then'](handleEntityNotFound(_0x313b99,null))[_0xab1a('0x25')](function(_0xef2e8a){if(_0xef2e8a){return _0xef2e8a[_0xab1a('0x76')](_0x4b45d2[_0xab1a('0x48')]['ids']);}})[_0xab1a('0x25')](respondWithStatusCode(_0x313b99,null))['catch'](handleError(_0x313b99,null));};exports[_0xab1a('0x77')]=function(_0x11218e,_0x3c33a0,_0x3e37e6){var _0x55df24={'body':_0x11218e[_0xab1a('0x69')],'channel':_0xab1a('0x78')};var _0x1827f7=[];var _0x10fa87=[];var _0x334a4c={};var _0x272d46=![];return db['CmContact'][_0xab1a('0x6a')]()[_0xab1a('0x25')](function(_0x373b33){if(!_0x373b33){throw new db[(_0xab1a('0x79'))]['ValidationError'](_0xab1a('0x7a'));}_0x1827f7=_['difference'](_[_0xab1a('0x49')](_0x373b33),[_0xab1a('0x7b'),_0xab1a('0x7c')]);_0x10fa87=_[_0xab1a('0x7d')](_[_0xab1a('0x49')](_0x373b33),['createdAt','updatedAt','CompanyId',_0xab1a('0x7e')]);if(_0x11218e[_0xab1a('0x69')]['id']){delete _0x11218e[_0xab1a('0x69')]['id'];}if(_[_0xab1a('0x7f')](_0x11218e[_0xab1a('0x69')][_0xab1a('0x80')])){throw new db[(_0xab1a('0x79'))][(_0xab1a('0x81'))](_0xab1a('0x82'));}if(_[_0xab1a('0x7f')](_0x11218e[_0xab1a('0x69')][_0xab1a('0x69')])||_0x11218e['body']['body']===''){throw new db[(_0xab1a('0x79'))][(_0xab1a('0x81'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xab1a('0x7f')](_0x11218e[_0xab1a('0x69')][_0xab1a('0x83')])){throw new db['Sequelize'][(_0xab1a('0x81'))](_0xab1a('0x84')+_0x10fa87);}if(!_[_0xab1a('0x85')](_0x10fa87,_0x11218e[_0xab1a('0x69')][_0xab1a('0x83')])){throw new db[(_0xab1a('0x79'))]['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x10fa87);}_0x334a4c[_0x11218e['body'][_0xab1a('0x83')]]=_0x11218e[_0xab1a('0x69')][_0xab1a('0x80')];})[_0xab1a('0x25')](function(){return db['OpenchannelAccount'][_0xab1a('0x64')]({'where':{'id':_0x11218e[_0xab1a('0x5e')]['id']},'include':[{'model':db[_0xab1a('0x86')],'as':_0xab1a('0x87'),'include':[{'model':db[_0xab1a('0x88')],'as':'Contacts','where':_0x334a4c,'limit':0x1,'order':[['updatedAt',_0xab1a('0x89')]]}]},{'model':db[_0xab1a('0x8a')],'as':_0xab1a('0x8b')}]});})[_0xab1a('0x25')](handleEntityNotFound(_0x3c33a0,null))[_0xab1a('0x25')](function(_0x68960b){if(_0x68960b&&_0x68960b['List']){_0x55df24[_0xab1a('0x8c')]=_0x68960b;_0x55df24[_0xab1a('0x8d')]=_0x68960b['Applications'];_0x55df24[_0xab1a('0x8e')]=_0x68960b['List'];_0x55df24['applications']=_['orderBy'](_0x55df24[_0xab1a('0x8d')],[_0xab1a('0x8f')],[_0xab1a('0x90')]);if(_0x55df24[_0xab1a('0x8c')][_0xab1a('0x8b')]){delete _0x55df24[_0xab1a('0x8c')][_0xab1a('0x8b')];}if(_0x55df24[_0xab1a('0x8c')][_0xab1a('0x87')]&&_0x55df24['account'][_0xab1a('0x87')]['Contacts'][_0xab1a('0x4e')]){return _0x55df24[_0xab1a('0x8c')][_0xab1a('0x87')][_0xab1a('0x91')][0x0];}var _0x55bbd8=_['defaults'](_0x11218e[_0xab1a('0x69')],{'firstName':_0x11218e['body'][_0xab1a('0x80')],'ListId':_0x68960b[_0xab1a('0x7e')]});_0x55bbd8[_0x11218e[_0xab1a('0x69')][_0xab1a('0x83')]]=_0x11218e['body']['from'];return db[_0xab1a('0x88')]['create'](_0x55bbd8,{'fields':_0x1827f7,'raw':!![]});}})[_0xab1a('0x25')](handleEntityNotFound(_0x3c33a0,null))[_0xab1a('0x25')](function(_0xb6000e){_0x55df24['contact']=_0xb6000e;if(_0xb6000e){var _0x3c8cb3={'ContactId':_0xb6000e['id'],'OpenchannelAccountId':_0x11218e[_0xab1a('0x5e')]['id'],'from':(_0xb6000e[_0xab1a('0x92')]||'')+'\x20'+(_0xb6000e['lastName']||'')};var _0x18e519={'OpenchannelAccountId':_0x11218e[_0xab1a('0x5e')]['id'],'closed':![]};if(_0x11218e['body']['threadId']){_0x18e519[_0xab1a('0x93')]=_0x11218e[_0xab1a('0x69')]['threadId'];return db[_0xab1a('0x94')][_0xab1a('0x64')]({'where':_0x18e519})[_0xab1a('0x25')](function(_0x4e370a){if(_0x4e370a){return[_0x4e370a,![]];}_0x3c8cb3[_0xab1a('0x93')]=_0x11218e['body'][_0xab1a('0x93')];_0x3c8cb3[_0xab1a('0x95')]=_0x11218e[_0xab1a('0x69')][_0xab1a('0x95')];return db['OpenchannelInteraction']['create'](_0x3c8cb3)[_0xab1a('0x25')](function(_0x2a8ad6){return[_0x2a8ad6,!![]];});});}else{_0x18e519['threadId']=null;}_0x18e519['ContactId']=_0xb6000e['id'];return db['OpenchannelInteraction']['find']({'where':_0x18e519})[_0xab1a('0x25')](function(_0x7fcea6){if(_0x7fcea6){return[_0x7fcea6,![]];}return db['OpenchannelInteraction'][_0xab1a('0x6e')](_0x3c8cb3)[_0xab1a('0x25')](function(_0x1057b0){return[_0x1057b0,!![]];});});}})['spread'](function(_0x5bd724,_0x4d73b3){if(_0x5bd724){_0x272d46=_0x4d73b3;if(!_0x4d73b3){var _0x2b2bf9={'from':(_0x55df24['contact'][_0xab1a('0x92')]||'')+'\x20'+(_0x55df24[_0xab1a('0x96')][_0xab1a('0x97')]||'')};if(_0x11218e[_0xab1a('0x69')][_0xab1a('0x93')]&&_0x11218e[_0xab1a('0x69')][_0xab1a('0x98')]&&_0x11218e[_0xab1a('0x69')][_0xab1a('0x93')]!=_0x11218e[_0xab1a('0x69')][_0xab1a('0x98')]){_0x2b2bf9[_0xab1a('0x93')]=_0x11218e[_0xab1a('0x69')][_0xab1a('0x98')];}return _0x5bd724['update'](_0x2b2bf9);}else{return _0x5bd724;}}})['then'](function(_0x57f974){_0x55df24['interaction']=_0x57f974[_0xab1a('0x3a')]({'plain':!![]});_0x55df24['interaction'][_0xab1a('0x99')]=_0x272d46;if(_0x55df24[_0xab1a('0x9a')][_0xab1a('0x99')]){if(_0x55df24[_0xab1a('0x8c')][_0xab1a('0x9b')]){_0x55df24[_0xab1a('0x8d')][_0xab1a('0x9c')]({'id':0x0,'priority':_0x55df24[_0xab1a('0x8d')][_0xab1a('0x4e')]+0x1,'app':'close','appdata':_0xab1a('0x9d'),'interval':_0xab1a('0x9e')});}}return db[_0xab1a('0x9f')][_0xab1a('0x6e')]({'body':_0x11218e[_0xab1a('0x69')]['body'],'OpenchannelAccountId':_0x11218e[_0xab1a('0x5e')]['id'],'OpenchannelInteractionId':_0x57f974['id'],'direction':'in','ContactId':_0x55df24[_0xab1a('0x96')]['id'],'AttachmentId':_0x11218e[_0xab1a('0x69')][_0xab1a('0xa0')]});})['then'](function(_0x44acb2){_0x55df24['message']=_0x44acb2;if(!_0x55df24[_0xab1a('0x9a')][_0xab1a('0xa1')])return;return db[_0xab1a('0xa2')][_0xab1a('0x64')]({'attributes':['id',_0xab1a('0x3f')],'where':{'id':_0x55df24[_0xab1a('0x9a')][_0xab1a('0xa1')]}});})[_0xab1a('0x25')](function(_0x253cb0){if(_0x253cb0){_0x55df24[_0xab1a('0x8d')][_0xab1a('0xa3')]({'id':0x0,'priority':0x0,'app':_0xab1a('0xa4'),'appdata':_0x253cb0[_0xab1a('0x3f')]+','+(_0x55df24['account'][_0xab1a('0xa5')]||0xa),'interval':_0xab1a('0x9e')});}if(!_0x55df24[_0xab1a('0x9a')][_0xab1a('0xa6')])return;return db[_0xab1a('0xa7')]['find']({'attributes':['id',_0xab1a('0x3f')],'where':{'id':_0x55df24[_0xab1a('0x9a')][_0xab1a('0xa6')]}});})['then'](function(_0x106f72){if(_0x106f72){_0x55df24[_0xab1a('0x8d')][_0xab1a('0xa3')]({'id':0x0,'priority':0x1,'app':_0xab1a('0xa8'),'appdata':_0x106f72[_0xab1a('0x3f')]+','+(_0x55df24[_0xab1a('0x8c')][_0xab1a('0xa9')]||0x12c),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0xab1a('0xaa'),'startRouting',_0x55df24);})[_0xab1a('0x25')](function(_0x5a831a){respondWithRpcPromise(_0xab1a('0xab'),'EventManager',{'event':'notify','message':_0x5a831a},client9002);return _0x5a831a;})[_0xab1a('0x25')](respondWithResult(_0x3c33a0,null))[_0xab1a('0x2e')](handleError(_0x3c33a0,null));};exports[_0xab1a('0xac')]=function(_0x59a426,_0xb8bb96){var _0x3170ba=_0x59a426['params']['id'];var _0x36ceb9=_0x59a426[_0xab1a('0x69')];var _0xae3f58=0xc8;var _0x36c081=null;return db[_0xab1a('0xad')][_0xab1a('0xae')]({'isolationLevel':db[_0xab1a('0xad')][_0xab1a('0xaf')][_0xab1a('0xb0')][_0xab1a('0xb1')]},function(_0x2646eb){return db[_0xab1a('0x45')][_0xab1a('0x75')]({'where':{'id':_0x3170ba},'transaction':_0x2646eb})['then'](function(_0x3c21b9){if(_0x3c21b9){return db[_0xab1a('0x8a')][_0xab1a('0x3d')]({'where':{'OpenchannelAccountId':_0x3170ba},'transaction':_0x2646eb})['then'](function(){var _0x57bed6=_[_0xab1a('0x44')](_0x36ceb9,function(_0x4f7e78){_0x4f7e78['OpenchannelAccountId']=_0x3170ba;return _0x4f7e78;});return db[_0xab1a('0x8a')][_0xab1a('0xb2')](_0x57bed6,{'transaction':_0x2646eb});});}else{_0xae3f58=0x194;_0x36c081=[];}});})[_0xab1a('0x25')](function(){if(_0xae3f58!==0x194){return db[_0xab1a('0x8a')][_0xab1a('0xb3')]({'where':{'OpenchannelAccountId':_0x3170ba},'order':_0xab1a('0x8f')})[_0xab1a('0x25')](function(_0x574b49){_0x36c081=_0x574b49;});}})['catch'](function(_0x476b7a){_0xae3f58=0x1f4;logger[_0xab1a('0x29')](_0x476b7a['stack']);if(_0x476b7a['name']){delete _0x476b7a[_0xab1a('0x3f')];}_0x36c081=_0x476b7a;})[_0xab1a('0xb4')](function(){if(_0x36c081===null){_0xb8bb96['sendStatus'](_0xae3f58);}else{if(_0xae3f58===0x1f4){_0xb8bb96['status'](_0xae3f58)['send'](_0x36c081);}else{_0xb8bb96[_0xab1a('0x31')](_0xae3f58)['json'](_0x36c081);}}});};exports[_0xab1a('0xb5')]=function(_0x33c7a6,_0x3a6121,_0x3a2c24){var _0x3ef7be={};var _0x5cd17e={};var _0x35d837;var _0x3632d4;return db[_0xab1a('0x45')][_0xab1a('0x75')]({'where':{'id':_0x33c7a6['params']['id']}})[_0xab1a('0x25')](handleEntityNotFound(_0x3a6121,null))[_0xab1a('0x25')](function(_0x1cd6aa){if(_0x1cd6aa){_0x35d837=_0x1cd6aa;_0x5cd17e[_0xab1a('0x4c')]=_[_0xab1a('0x49')](db[_0xab1a('0x8a')][_0xab1a('0x46')]);_0x5cd17e[_0xab1a('0x48')]=_[_0xab1a('0x49')](_0x33c7a6[_0xab1a('0x48')]);_0x5cd17e[_0xab1a('0x4a')]=_['intersection'](_0x5cd17e[_0xab1a('0x4c')],_0x5cd17e[_0xab1a('0x48')]);_0x3ef7be[_0xab1a('0x4d')]=_['intersection'](_0x5cd17e['model'],qs[_0xab1a('0x5f')](_0x33c7a6['query']['fields']));_0x3ef7be[_0xab1a('0x4d')]=_0x3ef7be[_0xab1a('0x4d')][_0xab1a('0x4e')]?_0x3ef7be[_0xab1a('0x4d')]:_0x5cd17e[_0xab1a('0x4c')];_0x3ef7be[_0xab1a('0x50')]=qs[_0xab1a('0x51')](_0x33c7a6[_0xab1a('0x48')][_0xab1a('0x51')]);_0x3ef7be[_0xab1a('0x52')]=qs['filters'](_[_0xab1a('0x53')](_0x33c7a6[_0xab1a('0x48')],_0x5cd17e[_0xab1a('0x4a')]));if(_0x33c7a6[_0xab1a('0x48')][_0xab1a('0x54')]){_0x3ef7be[_0xab1a('0x52')]=_['merge'](_0x3ef7be[_0xab1a('0x52')],{'$or':_['map'](_0x3ef7be[_0xab1a('0x4d')],function(_0x3a4edb){var _0x312609={};_0x312609[_0x3a4edb]={'$like':'%'+_0x33c7a6[_0xab1a('0x48')][_0xab1a('0x54')]+'%'};return _0x312609;})});}_0x3ef7be=_[_0xab1a('0x57')]({},_0x3ef7be,_0x33c7a6[_0xab1a('0x58')]);return _0x35d837[_0xab1a('0xb5')](_0x3ef7be);}})[_0xab1a('0x25')](function(_0x3ed6cf){if(_0x3ed6cf){_0x3632d4=_0x3ed6cf[_0xab1a('0x4e')];if(!_0x33c7a6[_0xab1a('0x48')]['hasOwnProperty'](_0xab1a('0x4f'))){_0x3ef7be[_0xab1a('0x35')]=qs[_0xab1a('0x35')](_0x33c7a6[_0xab1a('0x48')][_0xab1a('0x35')]);_0x3ef7be[_0xab1a('0x33')]=qs[_0xab1a('0x33')](_0x33c7a6[_0xab1a('0x48')][_0xab1a('0x33')]);}return _0x35d837[_0xab1a('0xb5')](_0x3ef7be);}})[_0xab1a('0x25')](function(_0x50cb19){if(_0x50cb19){return _0x50cb19?{'count':_0x3632d4,'rows':_0x50cb19}:null;}})['then'](respondWithResult(_0x3a6121,null))['catch'](handleError(_0x3a6121,null));};exports[_0xab1a('0xb6')]=function(_0x2a4a16,_0x5b5d25,_0xfc6b3){var _0x2b8df4={'raw':![],'where':{}};var _0x133a0a={};var _0x4aca80={'count':0x0,'rows':[]};return db['OpenchannelAccount']['findOne']({'where':{'id':_0x2a4a16[_0xab1a('0x5e')]['id']}})[_0xab1a('0x25')](handleEntityNotFound(_0x5b5d25,null))['then'](function(_0x3d17f1){if(_0x3d17f1){_0x133a0a['model']=_['keys'](db['OpenchannelInteraction'][_0xab1a('0x46')]);_0x133a0a[_0xab1a('0x48')]=_[_0xab1a('0x49')](_0x2a4a16[_0xab1a('0x48')]);_0x133a0a[_0xab1a('0x4a')]=_[_0xab1a('0x4b')](_0x133a0a[_0xab1a('0x4c')],_0x133a0a[_0xab1a('0x48')]);_0x2b8df4['attributes']=_[_0xab1a('0x4b')](_0x133a0a[_0xab1a('0x4c')],qs[_0xab1a('0x5f')](_0x2a4a16['query'][_0xab1a('0x5f')]));_0x2b8df4['attributes']=_0x2b8df4[_0xab1a('0x4d')][_0xab1a('0x4e')]?_0x2b8df4[_0xab1a('0x4d')]:_0x133a0a[_0xab1a('0x4c')];if(!_0x2a4a16[_0xab1a('0x48')][_0xab1a('0x70')](_0xab1a('0x4f'))){_0x2b8df4[_0xab1a('0x35')]=qs[_0xab1a('0x35')](_0x2a4a16[_0xab1a('0x48')][_0xab1a('0x35')]);_0x2b8df4[_0xab1a('0x33')]=qs['offset'](_0x2a4a16['query'][_0xab1a('0x33')]);}_0x2b8df4[_0xab1a('0x50')]=qs['sort'](_0x2a4a16[_0xab1a('0x48')][_0xab1a('0x51')]);_0x2b8df4['where']=qs[_0xab1a('0x4a')](_['pick'](_0x2a4a16['query'],_0x133a0a[_0xab1a('0x4a')]));_0x2b8df4[_0xab1a('0x52')][_0xab1a('0x6c')]=_0x3d17f1['id'];if(_0x2a4a16['query']['filter']){_0x2b8df4['where']=_[_0xab1a('0x57')](_0x2b8df4['where'],{'$or':_[_0xab1a('0x44')](_0x2b8df4[_0xab1a('0x4d')],function(_0x36d5a0){var _0x559a47={};_0x559a47[_0x36d5a0]={'$like':'%'+_0x2a4a16['query'][_0xab1a('0x54')]+'%'};return _0x559a47;})});}_0x2b8df4=_['merge']({},_0x2b8df4,_0x2a4a16['options']);return db[_0xab1a('0x94')][_0xab1a('0x36')]({'where':_0x2b8df4['where']})[_0xab1a('0x25')](function(_0x1bc106){_0x4aca80[_0xab1a('0x36')]=_0x1bc106;if(_0x2a4a16[_0xab1a('0x48')][_0xab1a('0x59')]){_0x2b8df4['include']=[{'model':db[_0xab1a('0x88')],'as':_0xab1a('0xb7'),'required':![]},{'model':db['User'],'as':_0xab1a('0xb8'),'attributes':['name',_0xab1a('0xb9'),_0xab1a('0xba')],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0xab1a('0x3f'),_0xab1a('0xbb')],'where':_0x2a4a16[_0xab1a('0x48')][_0xab1a('0xbc')]?{'id':_0x2a4a16['query'][_0xab1a('0xbc')]}:undefined,'required':_0x2a4a16[_0xab1a('0x48')][_0xab1a('0xbc')]?!![]:![]}];}return db['OpenchannelInteraction'][_0xab1a('0x5b')](_0x2b8df4);})['then'](function(_0x573e07){_0x4aca80[_0xab1a('0x5c')]=_0x573e07;return _0x4aca80;});}})[_0xab1a('0x25')](respondWithFilteredResult(_0x5b5d25,_0x2b8df4))['catch'](handleError(_0x5b5d25,null));};exports['addAgents']=function(_0x1bdf67,_0x1cdf78,_0x10908b){return db[_0xab1a('0x45')][_0xab1a('0x64')]({'where':{'id':_0x1bdf67[_0xab1a('0x5e')]['id']}})['then'](handleEntityNotFound(_0x1cdf78,null))[_0xab1a('0x25')](function(_0xd421b7){if(_0xd421b7){return _0xd421b7[_0xab1a('0xbd')](_0x1bdf67[_0xab1a('0x69')][_0xab1a('0xbe')],_[_0xab1a('0xbf')](_0x1bdf67[_0xab1a('0x69')],[_0xab1a('0xbe'),'id'])||{})['spread'](function(_0x53f417){for(var _0x121c05=0x0;_0x121c05<_0x1bdf67[_0xab1a('0x69')][_0xab1a('0xbe')][_0xab1a('0x4e')];_0x121c05+=0x1){socket['emit']('userOpenchannelAccount:save',{'UserId':Number(_0x1bdf67[_0xab1a('0x69')][_0xab1a('0xbe')][_0x121c05]),'OpenchannelAccountId':Number(_0x1bdf67[_0xab1a('0x5e')]['id'])});}return _0x53f417;});}})[_0xab1a('0x25')](respondWithResult(_0x1cdf78,null))[_0xab1a('0x2e')](handleError(_0x1cdf78,null));};exports[_0xab1a('0xc0')]=function(_0x5b8467,_0x3313b7,_0x560b8c){return db[_0xab1a('0x45')][_0xab1a('0x64')]({'where':{'id':_0x5b8467[_0xab1a('0x5e')]['id']}})[_0xab1a('0x25')](handleEntityNotFound(_0x3313b7,null))[_0xab1a('0x25')](function(_0x1dfacf){if(_0x1dfacf){return _0x1dfacf[_0xab1a('0xc0')](_0x5b8467[_0xab1a('0x48')][_0xab1a('0xbe')])[_0xab1a('0x25')](function(){if(_[_0xab1a('0xc1')](_0x5b8467[_0xab1a('0x48')]['ids'])){for(var _0x297ac0=0x0;_0x297ac0<_0x5b8467[_0xab1a('0x48')][_0xab1a('0xbe')]['length'];_0x297ac0+=0x1){socket['emit'](_0xab1a('0xc2'),{'UserId':Number(_0x5b8467[_0xab1a('0x48')][_0xab1a('0xbe')][_0x297ac0]),'OpenchannelAccountId':Number(_0x5b8467['params']['id'])});}}else{socket[_0xab1a('0xc3')](_0xab1a('0xc2'),{'UserId':Number(_0x5b8467[_0xab1a('0x48')]['ids']),'OpenchannelAccountId':Number(_0x5b8467[_0xab1a('0x5e')]['id'])});}});}})['then'](respondWithStatusCode(_0x3313b7,null))['catch'](handleError(_0x3313b7,null));};exports[_0xab1a('0xc4')]=function(_0x5a3d48,_0x5780cc,_0x369321){var _0xb8f8e8={};var _0x481846={};var _0x37eb5d;var _0x3976cc;return db['OpenchannelAccount'][_0xab1a('0x75')]({'where':{'id':_0x5a3d48[_0xab1a('0x5e')]['id']}})['then'](handleEntityNotFound(_0x5780cc,null))['then'](function(_0x45b5ec){if(_0x45b5ec){_0x37eb5d=_0x45b5ec;_0x481846['model']=_['keys'](db[_0xab1a('0xa2')][_0xab1a('0x46')]);_0x481846[_0xab1a('0x48')]=_['keys'](_0x5a3d48[_0xab1a('0x48')]);_0x481846[_0xab1a('0x4a')]=_[_0xab1a('0x4b')](_0x481846[_0xab1a('0x4c')],_0x481846[_0xab1a('0x48')]);_0xb8f8e8['attributes']=_['intersection'](_0x481846[_0xab1a('0x4c')],qs[_0xab1a('0x5f')](_0x5a3d48['query'][_0xab1a('0x5f')]));_0xb8f8e8[_0xab1a('0x4d')]=_0xb8f8e8[_0xab1a('0x4d')]['length']?_0xb8f8e8[_0xab1a('0x4d')]:_0x481846[_0xab1a('0x4c')];_0xb8f8e8[_0xab1a('0x50')]=qs[_0xab1a('0x51')](_0x5a3d48[_0xab1a('0x48')]['sort']);_0xb8f8e8[_0xab1a('0x52')]=qs[_0xab1a('0x4a')](_[_0xab1a('0x53')](_0x5a3d48[_0xab1a('0x48')],_0x481846['filters']));if(_0x5a3d48['query'][_0xab1a('0x54')]){_0xb8f8e8['where']=_[_0xab1a('0x57')](_0xb8f8e8[_0xab1a('0x52')],{'$or':_[_0xab1a('0x44')](_0xb8f8e8['attributes'],function(_0x5d62cd){var _0x1ce44c={};_0x1ce44c[_0x5d62cd]={'$like':'%'+_0x5a3d48[_0xab1a('0x48')]['filter']+'%'};return _0x1ce44c;})});}_0xb8f8e8=_[_0xab1a('0x57')]({},_0xb8f8e8,_0x5a3d48['options']);return _0x37eb5d[_0xab1a('0xc4')](_0xb8f8e8);}})[_0xab1a('0x25')](function(_0x3614a7){if(_0x3614a7){_0x3976cc=_0x3614a7[_0xab1a('0x4e')];if(!_0x5a3d48['query'][_0xab1a('0x70')]('nolimit')){_0xb8f8e8[_0xab1a('0x35')]=qs[_0xab1a('0x35')](_0x5a3d48[_0xab1a('0x48')]['limit']);_0xb8f8e8[_0xab1a('0x33')]=qs[_0xab1a('0x33')](_0x5a3d48['query'][_0xab1a('0x33')]);}return _0x37eb5d['getAgents'](_0xb8f8e8);}})['then'](function(_0x395471){if(_0x395471){return _0x395471?{'count':_0x3976cc,'rows':_0x395471}:null;}})[_0xab1a('0x25')](respondWithResult(_0x5780cc,null))[_0xab1a('0x2e')](handleError(_0x5780cc,null));};exports[_0xab1a('0x40')]=function(_0x1be31d,_0x5cd05f,_0x4623ca){var _0x50a295,_0x28dc10,_0x54899f;if(_[_0xab1a('0x7f')](_0x1be31d['body']['body'])||_0x1be31d[_0xab1a('0x69')]['body']===''){throw new db[(_0xab1a('0x79'))][(_0xab1a('0x81'))](_0xab1a('0xc5'));}if(_['isNil'](_0x1be31d[_0xab1a('0x69')]['to'])){}_0x50a295=_0x1be31d[_0xab1a('0x69')]['to'];return db[_0xab1a('0x45')]['findOne']({'where':{'id':_0x1be31d[_0xab1a('0x5e')]['id']}})[_0xab1a('0x25')](handleEntityNotFound(_0x5cd05f,null))['then'](function(_0x202b4a){if(_0x202b4a){return db[_0xab1a('0x45')][_0xab1a('0x64')]({'where':{'id':_0x202b4a['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0xab1a('0x88')],'as':_0xab1a('0x91'),'where':{[_0x202b4a[_0xab1a('0x83')]]:_0x50a295},'limit':0x1,'order':[['updatedAt',_0xab1a('0x89')]]}]}]})[_0xab1a('0x25')](handleEntityNotFound(_0x5cd05f,null))[_0xab1a('0x25')](function(_0x3da0ae){if(_0x3da0ae&&_0x3da0ae[_0xab1a('0x87')]){_0x28dc10=_0x3da0ae[_0xab1a('0x3a')]({'plain':!![]});if(_0x28dc10[_0xab1a('0x87')]&&_0x28dc10[_0xab1a('0x87')][_0xab1a('0x91')][_0xab1a('0x4e')]){return _0x28dc10[_0xab1a('0x87')][_0xab1a('0x91')][0x0];}return db[_0xab1a('0x88')]['create'](_[_0xab1a('0x1d')](_0x1be31d[_0xab1a('0x69')],{'firstName':_0x50a295,[_0x3da0ae[_0xab1a('0x83')]]:_0x50a295,'phone':_0x50a295,'ListId':_0x28dc10[_0xab1a('0x7e')]}));}})['then'](handleEntityNotFound(_0x5cd05f,null))[_0xab1a('0x25')](function(_0xf0239b){if(_0xf0239b){_0x54899f=_0xf0239b;return db['OpenchannelInteraction']['find']({'where':{'ContactId':_0x54899f['id'],'closed':![],'OpenchannelAccountId':_0x28dc10['id']}})[_0xab1a('0x25')](function(_0x1e94f6){if(_0x1e94f6){return[_0x1e94f6,![]];}return db[_0xab1a('0x94')][_0xab1a('0x6e')]({'UserId':_0x1be31d['user']['id'],'ContactId':_0x54899f['id'],'OpenchannelAccountId':_0x28dc10['id'],'lastMsgDirection':'out','firstMsgDirection':_0xab1a('0xc6'),'Messages':[_[_0xab1a('0x57')](_0x1be31d[_0xab1a('0x69')],{'read':![],'body':_0x1be31d[_0xab1a('0x69')]['body'],'OpenchannelAccountId':_0x28dc10['id'],'UserId':_0x1be31d['user']['id'],'ContactId':_0x54899f['id']})]},{'include':[{'model':db[_0xab1a('0x9f')],'as':'Messages'}]})[_0xab1a('0x25')](function(_0x5d214a){return[_0x5d214a,!![]];});});}})['spread'](function(_0x19a03d,_0x4de65e){if(_0x4de65e){return _0x19a03d;}return db[_0xab1a('0x9f')]['create'](_['merge'](_0x1be31d[_0xab1a('0x69')],{'read':![],'body':_0x1be31d[_0xab1a('0x69')][_0xab1a('0x69')],'OpenchannelAccountId':_0x28dc10['id'],'OpenchannelInteractionId':_0x19a03d['id'],'UserId':_0x1be31d[_0xab1a('0x60')]['id'],'ContactId':_0x54899f['id']}))[_0xab1a('0x25')](function(_0xa980d8){_0x19a03d['dataValues'][_0xab1a('0xc7')]=[];_0x19a03d[_0xab1a('0xc8')]['Messages'][_0xab1a('0x9c')](_0xa980d8['dataValues']);return _0x19a03d;});});}})[_0xab1a('0x25')](respondWithResult(_0x5cd05f,null))[_0xab1a('0x2e')](handleError(_0x5cd05f,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index 32d216f..8af4fb4 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 _0x0713=['exports','OpenchannelAccount','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x3cba93,_0x5c2fd8){var _0x4a2991=function(_0x3cf95b){while(--_0x3cf95b){_0x3cba93['push'](_0x3cba93['shift']());}};_0x4a2991(++_0x5c2fd8);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var OpenchannelAccount=require('../../mysqldb')['db'][_0x3071('0x0')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x3071('0x1')](0x0);var events={'afterCreate':_0x3071('0x2'),'afterUpdate':_0x3071('0x3'),'afterDestroy':_0x3071('0x4')};function emitEvent(_0x52b5fb){return function(_0x2c547f,_0x7b18a4,_0x33a70c){OpenchannelAccountEvents[_0x3071('0x5')](_0x52b5fb+':'+_0x2c547f['id'],_0x2c547f);OpenchannelAccountEvents[_0x3071('0x5')](_0x52b5fb,_0x2c547f);_0x33a70c(null);};}for(var e in events){if(events[_0x3071('0x6')](e)){var event=events[e];OpenchannelAccount[_0x3071('0x7')](e,emitEvent(event));}}module[_0x3071('0x8')]=OpenchannelAccountEvents; \ No newline at end of file +var _0x99e9=['../../mysqldb','OpenchannelAccount','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports'];(function(_0x4334b6,_0xa69ea8){var _0x31bcb0=function(_0x2c385b){while(--_0x2c385b){_0x4334b6['push'](_0x4334b6['shift']());}};_0x31bcb0(++_0xa69ea8);}(_0x99e9,0xb4));var _0x999e=function(_0x1d80be,_0x3a60ff){_0x1d80be=_0x1d80be-0x0;var _0xf9a4f3=_0x99e9[_0x1d80be];return _0xf9a4f3;};'use strict';var EventEmitter=require('events');var OpenchannelAccount=require(_0x999e('0x0'))['db'][_0x999e('0x1')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x999e('0x2')](0x0);var events={'afterCreate':_0x999e('0x3'),'afterUpdate':'update','afterDestroy':_0x999e('0x4')};function emitEvent(_0x2f803e){return function(_0x3aac27,_0x4e2112,_0x296411){OpenchannelAccountEvents['emit'](_0x2f803e+':'+_0x3aac27['id'],_0x3aac27);OpenchannelAccountEvents[_0x999e('0x5')](_0x2f803e,_0x3aac27);_0x296411(null);};}for(var e in events){if(events[_0x999e('0x6')](e)){var event=events[e];OpenchannelAccount[_0x999e('0x7')](e,emitEvent(event));}}module[_0x999e('0x8')]=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index 7358f0e..92600db 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(_0x4889fa,_0x377c8a){var _0x3a91ac=function(_0x507f7a){while(--_0x507f7a){_0x4889fa['push'](_0x4889fa['shift']());}};_0x3a91ac(++_0x377c8a);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0xa9e0[_0xf71120];return _0xbe2fd3;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'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(_0x7bf248,_0x138154){var _0x3f0a55=function(_0x1e707e){while(--_0x1e707e){_0x7bf248['push'](_0x7bf248['shift']());}};_0x3f0a55(++_0x138154);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0xa9e0[_0xf50820];return _0x2a9b10;};'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 5a8fda0..f58b31a 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 _0xb9a7=['catch','util','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','OpenchannelAccount,\x20%s,\x20%s,\x20%s','error','message','result'];(function(_0x233675,_0xc6f7e0){var _0x15d123=function(_0x293327){while(--_0x293327){_0x233675['push'](_0x233675['shift']());}};_0x15d123(++_0xc6f7e0);}(_0xb9a7,0x112));var _0x7b9a=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0xb9a7[_0x4f9b18];return _0x29f20c;};'use strict';var _=require('lodash');var util=require(_0x7b9a('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7b9a('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0x7b9a('0x2'));var logger=require(_0x7b9a('0x3'))(_0x7b9a('0x4'));var config=require(_0x7b9a('0x5'));var jayson=require(_0x7b9a('0x6'));var client=jayson[_0x7b9a('0x7')][_0x7b9a('0x8')]({'port':0x232a});config[_0x7b9a('0x9')]=_[_0x7b9a('0xa')](config[_0x7b9a('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x7b9a('0xb'))(new Redis(config[_0x7b9a('0x9')]));require('./openchannelAccount.socket')['register'](socket);function respondWithRpcPromise(_0x47e220,_0x15bc5b,_0x31f3b7){return new BPromise(function(_0x4cf090,_0x32c85d){return client['request'](_0x47e220,_0x31f3b7)[_0x7b9a('0xc')](function(_0x597732){logger[_0x7b9a('0xd')](_0x7b9a('0xe'),_0x15bc5b,_0x7b9a('0xf'));logger['debug'](_0x7b9a('0x10'),_0x15bc5b,_0x7b9a('0xf'),JSON['stringify'](_0x597732));if(_0x597732[_0x7b9a('0x11')]){if(_0x597732[_0x7b9a('0x11')]['code']===0x1f4){logger[_0x7b9a('0x11')](_0x7b9a('0xe'),_0x15bc5b,_0x597732[_0x7b9a('0x11')][_0x7b9a('0x12')]);return _0x32c85d(_0x597732[_0x7b9a('0x11')][_0x7b9a('0x12')]);}logger[_0x7b9a('0x11')](_0x7b9a('0xe'),_0x15bc5b,_0x597732[_0x7b9a('0x11')]['message']);return _0x4cf090(_0x597732[_0x7b9a('0x11')]['message']);}else{logger[_0x7b9a('0xd')](_0x7b9a('0xe'),_0x15bc5b,_0x7b9a('0xf'));_0x4cf090(_0x597732[_0x7b9a('0x13')][_0x7b9a('0x12')]);}})[_0x7b9a('0x14')](function(_0x27ad55){logger[_0x7b9a('0x11')](_0x7b9a('0xe'),_0x15bc5b,_0x27ad55);_0x32c85d(_0x27ad55);});});} \ No newline at end of file +var _0xe205=['request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','./openchannelAccount.socket'];(function(_0x381256,_0x1a1d8d){var _0x52ff69=function(_0x380fae){while(--_0x380fae){_0x381256['push'](_0x381256['shift']());}};_0x52ff69(++_0x1a1d8d);}(_0xe205,0xa7));var _0x5e20=function(_0x41ea1f,_0x59f342){_0x41ea1f=_0x41ea1f-0x0;var _0x1132e7=_0xe205[_0x41ea1f];return _0x1132e7;};'use strict';var _=require(_0x5e20('0x0'));var util=require(_0x5e20('0x1'));var moment=require(_0x5e20('0x2'));var BPromise=require(_0x5e20('0x3'));var rs=require(_0x5e20('0x4'));var fs=require('fs');var Redis=require(_0x5e20('0x5'));var db=require(_0x5e20('0x6'))['db'];var utils=require(_0x5e20('0x7'));var logger=require(_0x5e20('0x8'))('rpc');var config=require(_0x5e20('0x9'));var jayson=require(_0x5e20('0xa'));var client=jayson[_0x5e20('0xb')][_0x5e20('0xc')]({'port':0x232a});config['redis']=_['defaults'](config[_0x5e20('0xd')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5e20('0xd')]));require(_0x5e20('0xe'))['register'](socket);function respondWithRpcPromise(_0x91dca7,_0x3855dd,_0x13e7c2){return new BPromise(function(_0x24c9aa,_0x5cb51d){return client[_0x5e20('0xf')](_0x91dca7,_0x13e7c2)[_0x5e20('0x10')](function(_0x270689){logger[_0x5e20('0x11')](_0x5e20('0x12'),_0x3855dd,_0x5e20('0x13'));logger['debug'](_0x5e20('0x14'),_0x3855dd,_0x5e20('0x13'),JSON[_0x5e20('0x15')](_0x270689));if(_0x270689['error']){if(_0x270689[_0x5e20('0x16')]['code']===0x1f4){logger[_0x5e20('0x16')]('OpenchannelAccount,\x20%s,\x20%s',_0x3855dd,_0x270689[_0x5e20('0x16')][_0x5e20('0x17')]);return _0x5cb51d(_0x270689[_0x5e20('0x16')][_0x5e20('0x17')]);}logger[_0x5e20('0x16')]('OpenchannelAccount,\x20%s,\x20%s',_0x3855dd,_0x270689[_0x5e20('0x16')][_0x5e20('0x17')]);return _0x24c9aa(_0x270689[_0x5e20('0x16')][_0x5e20('0x17')]);}else{logger[_0x5e20('0x11')](_0x5e20('0x12'),_0x3855dd,_0x5e20('0x13'));_0x24c9aa(_0x270689[_0x5e20('0x18')]['message']);}})[_0x5e20('0x19')](function(_0xd38d1f){logger['error'](_0x5e20('0x12'),_0x3855dd,_0xd38d1f);_0x5cb51d(_0xd38d1f);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index 195a058..c4f4731 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 _0x750a=['save','emit','removeListener','register','length'];(function(_0x1f65c2,_0x17cac2){var _0xfe68e1=function(_0x20e9a1){while(--_0x20e9a1){_0x1f65c2['push'](_0x1f65c2['shift']());}};_0xfe68e1(++_0x17cac2);}(_0x750a,0x140));var _0xa750=function(_0x4ba8f0,_0x4ea1ff){_0x4ba8f0=_0x4ba8f0-0x0;var _0x4f08ad=_0x750a[_0x4ba8f0];return _0x4f08ad;};'use strict';var OpenchannelAccountEvents=require('./openchannelAccount.events');var events=[_0xa750('0x0'),'remove','update'];function createListener(_0x139fa5,_0xeb020d){return function(_0x1b459c){_0xeb020d[_0xa750('0x1')](_0x139fa5,_0x1b459c);};}function removeListener(_0x457cae,_0x43d704){return function(){OpenchannelAccountEvents[_0xa750('0x2')](_0x457cae,_0x43d704);};}exports[_0xa750('0x3')]=function(_0x10b4d9){for(var _0x2497df=0x0,_0x197299=events[_0xa750('0x4')];_0x2497df<_0x197299;_0x2497df++){var _0x3d7c43=events[_0x2497df];var _0x47a4dd=createListener('openchannelAccount:'+_0x3d7c43,_0x10b4d9);OpenchannelAccountEvents['on'](_0x3d7c43,_0x47a4dd);}}; \ No newline at end of file +var _0xd957=['register','length','openchannelAccount:','./openchannelAccount.events','save','update','emit','removeListener'];(function(_0x2fdce0,_0x496242){var _0x36f07e=function(_0x44c8c6){while(--_0x44c8c6){_0x2fdce0['push'](_0x2fdce0['shift']());}};_0x36f07e(++_0x496242);}(_0xd957,0x153));var _0x7d95=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd957[_0xa464c9];return _0x3d73c4;};'use strict';var OpenchannelAccountEvents=require(_0x7d95('0x0'));var events=[_0x7d95('0x1'),'remove',_0x7d95('0x2')];function createListener(_0x2035b7,_0x5d0023){return function(_0xf7608a){_0x5d0023[_0x7d95('0x3')](_0x2035b7,_0xf7608a);};}function removeListener(_0x291309,_0x9750e1){return function(){OpenchannelAccountEvents[_0x7d95('0x4')](_0x291309,_0x9750e1);};}exports[_0x7d95('0x5')]=function(_0x2de581){for(var _0x514355=0x0,_0x181ca5=events[_0x7d95('0x6')];_0x514355<_0x181ca5;_0x514355++){var _0x4f10ec=events[_0x514355];var _0xfd14f6=createListener(_0x7d95('0x7')+_0x4f10ec,_0x2de581);OpenchannelAccountEvents['on'](_0x4f10ec,_0xfd14f6);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index b1a81d1..81cd573 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 _0x1584=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','index','show','post','create','put','update','/:id','exports','multer','express'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x1584,0xfa));var _0x4158=function(_0x29d94e,_0xf386d6){_0x29d94e=_0x29d94e-0x0;var _0x106237=_0x1584[_0x29d94e];return _0x106237;};'use strict';var multer=require(_0x4158('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x4158('0x1'));var router=express[_0x4158('0x2')]();var fs_extra=require(_0x4158('0x3'));var auth=require(_0x4158('0x4'));var interaction=require(_0x4158('0x5'));var config=require(_0x4158('0x6'));var controller=require(_0x4158('0x7'));router[_0x4158('0x8')]('/',auth[_0x4158('0x9')](),controller[_0x4158('0xa')]);router[_0x4158('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x4158('0xb')]);router[_0x4158('0xc')]('/',auth[_0x4158('0x9')](),controller[_0x4158('0xd')]);router[_0x4158('0xe')]('/:id',auth[_0x4158('0x9')](),controller[_0x4158('0xf')]);router['delete'](_0x4158('0x10'),auth['isAuthenticated'](),controller['destroy']);module[_0x4158('0x11')]=router; \ No newline at end of file +var _0xc081=['multer','connect-timeout','express','Router','../../components/auth/service','get','index','/:id','isAuthenticated','show','destroy'];(function(_0x455150,_0x274121){var _0x12ca9c=function(_0x47eb22){while(--_0x47eb22){_0x455150['push'](_0x455150['shift']());}};_0x12ca9c(++_0x274121);}(_0xc081,0x1e4));var _0x1c08=function(_0x499210,_0x325b29){_0x499210=_0x499210-0x0;var _0x2e153d=_0xc081[_0x499210];return _0x2e153d;};'use strict';var multer=require(_0x1c08('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x1c08('0x1'));var express=require(_0x1c08('0x2'));var router=express[_0x1c08('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1c08('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./openchannelApplication.controller');router[_0x1c08('0x5')]('/',auth['isAuthenticated'](),controller[_0x1c08('0x6')]);router[_0x1c08('0x5')](_0x1c08('0x7'),auth[_0x1c08('0x8')](),controller[_0x1c08('0x9')]);router['post']('/',auth[_0x1c08('0x8')](),controller['create']);router['put']('/:id',auth[_0x1c08('0x8')](),controller['update']);router['delete'](_0x1c08('0x7'),auth[_0x1c08('0x8')](),controller[_0x1c08('0xa')]);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 c2ddfbc..300a4ef 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 _0xcd68=['STRING','noop','TEXT','*,*,*,*','sequelize','exports'];(function(_0x1a5db6,_0x122d1f){var _0x46534b=function(_0x274b4e){while(--_0x274b4e){_0x1a5db6['push'](_0x1a5db6['shift']());}};_0x46534b(++_0x122d1f);}(_0xcd68,0x1ea));var _0x8cd6=function(_0x389832,_0x10a4a9){_0x389832=_0x389832-0x0;var _0x59429e=_0xcd68[_0x389832];return _0x59429e;};'use strict';var Sequelize=require(_0x8cd6('0x0'));module[_0x8cd6('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x8cd6('0x2')],'allowNull':![],'defaultValue':_0x8cd6('0x3')},'appdata':{'type':Sequelize[_0x8cd6('0x4')]()},'description':{'type':Sequelize[_0x8cd6('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x8cd6('0x5')}}; \ No newline at end of file +var _0x26dd=['STRING','noop','TEXT','exports','INTEGER'];(function(_0x46d7b0,_0x45bc2e){var _0x4935d0=function(_0x344f7e){while(--_0x344f7e){_0x46d7b0['push'](_0x46d7b0['shift']());}};_0x4935d0(++_0x45bc2e);}(_0x26dd,0xdf));var _0xd26d=function(_0x4a129a,_0x267674){_0x4a129a=_0x4a129a-0x0;var _0x49919f=_0x26dd[_0x4a129a];return _0x49919f;};'use strict';var Sequelize=require('sequelize');module[_0xd26d('0x0')]={'priority':{'type':Sequelize[_0xd26d('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xd26d('0x2')],'allowNull':![],'defaultValue':_0xd26d('0x3')},'appdata':{'type':Sequelize[_0xd26d('0x4')]()},'description':{'type':Sequelize[_0xd26d('0x2')]},'interval':{'type':Sequelize[_0xd26d('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index aaaec49..4fef9a5 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 _0x6fc8=['set','Content-Range','apply','update','destroy','then','error','stack','name','send','index','OpenchannelApplication','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','VIRTUAL','options','includeAll','include','findAll','params','length','merge','find','catch','create','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count'];(function(_0x2fb37b,_0x5c1a95){var _0x4d5040=function(_0x356e9f){while(--_0x356e9f){_0x2fb37b['push'](_0x2fb37b['shift']());}};_0x4d5040(++_0x5c1a95);}(_0x6fc8,0xc9));var _0x86fc=function(_0x75615e,_0xad9d15){_0x75615e=_0x75615e-0x0;var _0x3c086d=_0x6fc8[_0x75615e];return _0x3c086d;};'use strict';var emlformat=require(_0x86fc('0x0'));var rimraf=require(_0x86fc('0x1'));var zipdir=require(_0x86fc('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x86fc('0x3'));var moment=require(_0x86fc('0x4'));var BPromise=require(_0x86fc('0x5'));var Mustache=require(_0x86fc('0x6'));var util=require(_0x86fc('0x7'));var path=require(_0x86fc('0x8'));var sox=require(_0x86fc('0x9'));var csv=require(_0x86fc('0xa'));var ejs=require(_0x86fc('0xb'));var fs=require('fs');var fs_extra=require(_0x86fc('0xc'));var _=require('lodash');var squel=require(_0x86fc('0xd'));var crypto=require(_0x86fc('0xe'));var jsforce=require(_0x86fc('0xf'));var deskjs=require(_0x86fc('0x10'));var toCsv=require(_0x86fc('0xa'));var querystring=require(_0x86fc('0x11'));var Papa=require(_0x86fc('0x12'));var Redis=require(_0x86fc('0x13'));var authService=require(_0x86fc('0x14'));var qs=require(_0x86fc('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x86fc('0x16'));var logger=require(_0x86fc('0x17'))(_0x86fc('0x18'));var utils=require('../../config/utils');var config=require(_0x86fc('0x19'));var licenseUtil=require(_0x86fc('0x1a'));var db=require(_0x86fc('0x1b'))['db'];function respondWithStatusCode(_0x16f3f0,_0x29b975){_0x29b975=_0x29b975||0xcc;return function(_0x497367){if(_0x497367){return _0x16f3f0[_0x86fc('0x1c')](_0x29b975);}return _0x16f3f0['status'](_0x29b975)[_0x86fc('0x1d')]();};}function respondWithResult(_0x20ab50,_0x4ff971){_0x4ff971=_0x4ff971||0xc8;return function(_0x530c02){if(_0x530c02){return _0x20ab50[_0x86fc('0x1e')](_0x4ff971)[_0x86fc('0x1f')](_0x530c02);}};}function respondWithFilteredResult(_0x141156,_0x5698a4){return function(_0x3c4112){if(_0x3c4112){var _0x3f1a9c=typeof _0x5698a4[_0x86fc('0x20')]==='undefined'&&typeof _0x5698a4[_0x86fc('0x21')]===_0x86fc('0x22');var _0x451d65=_0x3c4112[_0x86fc('0x23')];var _0x28b4c4=_0x3f1a9c?0x0:_0x5698a4[_0x86fc('0x20')];var _0x35fc8b=_0x3f1a9c?_0x3c4112['count']:_0x5698a4[_0x86fc('0x20')]+_0x5698a4[_0x86fc('0x21')];var _0x54e3aa;if(_0x35fc8b>=_0x451d65){_0x35fc8b=_0x451d65;_0x54e3aa=0xc8;}else{_0x54e3aa=0xce;}_0x141156[_0x86fc('0x1e')](_0x54e3aa);return _0x141156[_0x86fc('0x24')](_0x86fc('0x25'),_0x28b4c4+'-'+_0x35fc8b+'/'+_0x451d65)['json'](_0x3c4112);}return null;};}function patchUpdates(_0x2d0b76){return function(_0x56a2db){try{jsonpatch[_0x86fc('0x26')](_0x56a2db,_0x2d0b76,!![]);}catch(_0x48a502){return BPromise['reject'](_0x48a502);}return _0x56a2db['save']();};}function saveUpdates(_0x3a9bc1,_0x2c24d3){return function(_0x114b90){if(_0x114b90){return _0x114b90[_0x86fc('0x27')](_0x3a9bc1)['then'](function(_0xddc6bd){return _0xddc6bd;});}return null;};}function removeEntity(_0x26f24d,_0x534694){return function(_0xd538d2){if(_0xd538d2){return _0xd538d2[_0x86fc('0x28')]()[_0x86fc('0x29')](function(){_0x26f24d[_0x86fc('0x1e')](0xcc)[_0x86fc('0x1d')]();});}};}function handleEntityNotFound(_0x3090e3,_0x4a199f){return function(_0x15ed89){if(!_0x15ed89){_0x3090e3[_0x86fc('0x1c')](0x194);}return _0x15ed89;};}function handleError(_0x1dd02a,_0x4670b3){_0x4670b3=_0x4670b3||0x1f4;return function(_0x51fb46){logger[_0x86fc('0x2a')](_0x51fb46[_0x86fc('0x2b')]);if(_0x51fb46['name']){delete _0x51fb46[_0x86fc('0x2c')];}_0x1dd02a['status'](_0x4670b3)[_0x86fc('0x2d')](_0x51fb46);};}exports[_0x86fc('0x2e')]=function(_0x401a93,_0x4fa564){var _0x3bd871={},_0x3abc22={},_0x4341c7={'count':0x0,'rows':[]};var _0xe6d336=_['map'](db[_0x86fc('0x2f')][_0x86fc('0x30')],function(_0xf3df93){return{'name':_0xf3df93[_0x86fc('0x31')],'type':_0xf3df93[_0x86fc('0x32')][_0x86fc('0x33')]};});_0x3abc22[_0x86fc('0x34')]=_[_0x86fc('0x35')](_0xe6d336,_0x86fc('0x2c'));_0x3abc22[_0x86fc('0x36')]=_[_0x86fc('0x37')](_0x401a93[_0x86fc('0x36')]);_0x3abc22['filters']=_[_0x86fc('0x38')](_0x3abc22[_0x86fc('0x34')],_0x3abc22[_0x86fc('0x36')]);_0x3bd871['attributes']=_['intersection'](_0x3abc22['model'],qs['fields'](_0x401a93[_0x86fc('0x36')][_0x86fc('0x39')]));_0x3bd871[_0x86fc('0x3a')]=_0x3bd871[_0x86fc('0x3a')]['length']?_0x3bd871[_0x86fc('0x3a')]:_0x3abc22[_0x86fc('0x34')];if(!_0x401a93[_0x86fc('0x36')][_0x86fc('0x3b')](_0x86fc('0x3c'))){_0x3bd871['limit']=qs[_0x86fc('0x21')](_0x401a93[_0x86fc('0x36')][_0x86fc('0x21')]);_0x3bd871[_0x86fc('0x20')]=qs[_0x86fc('0x20')](_0x401a93['query'][_0x86fc('0x20')]);}_0x3bd871[_0x86fc('0x3d')]=qs[_0x86fc('0x3e')](_0x401a93[_0x86fc('0x36')][_0x86fc('0x3e')]);_0x3bd871[_0x86fc('0x3f')]=qs['filters'](_[_0x86fc('0x40')](_0x401a93[_0x86fc('0x36')],_0x3abc22[_0x86fc('0x41')]),_0xe6d336);if(_0x401a93[_0x86fc('0x36')][_0x86fc('0x42')]){_0x3bd871[_0x86fc('0x3f')]=_['merge'](_0x3bd871['where'],{'$or':_[_0x86fc('0x35')](_0xe6d336,function(_0xce9054){if(_0xce9054[_0x86fc('0x32')]!==_0x86fc('0x43')){var _0x185ddf={};_0x185ddf[_0xce9054[_0x86fc('0x2c')]]={'$like':'%'+_0x401a93[_0x86fc('0x36')]['filter']+'%'};return _0x185ddf;}})});}_0x3bd871=_['merge']({},_0x3bd871,_0x401a93[_0x86fc('0x44')]);var _0x592f51={'where':_0x3bd871[_0x86fc('0x3f')]};return db['OpenchannelApplication'][_0x86fc('0x23')](_0x592f51)[_0x86fc('0x29')](function(_0x5adc87){_0x4341c7[_0x86fc('0x23')]=_0x5adc87;if(_0x401a93[_0x86fc('0x36')][_0x86fc('0x45')]){_0x3bd871[_0x86fc('0x46')]=[{'all':!![]}];}return db['OpenchannelApplication'][_0x86fc('0x47')](_0x3bd871);})[_0x86fc('0x29')](function(_0xa2969){_0x4341c7['rows']=_0xa2969;return _0x4341c7;})['then'](respondWithFilteredResult(_0x4fa564,_0x3bd871))['catch'](handleError(_0x4fa564,null));};exports['show']=function(_0x20e303,_0x50b28f){var _0x3f6c1e={'raw':!![],'where':{'id':_0x20e303[_0x86fc('0x48')]['id']}},_0x980958={};_0x980958[_0x86fc('0x34')]=_['keys'](db['OpenchannelApplication'][_0x86fc('0x30')]);_0x980958[_0x86fc('0x36')]=_[_0x86fc('0x37')](_0x20e303['query']);_0x980958['filters']=_[_0x86fc('0x38')](_0x980958['model'],_0x980958[_0x86fc('0x36')]);_0x3f6c1e['attributes']=_['intersection'](_0x980958[_0x86fc('0x34')],qs[_0x86fc('0x39')](_0x20e303['query'][_0x86fc('0x39')]));_0x3f6c1e['attributes']=_0x3f6c1e[_0x86fc('0x3a')][_0x86fc('0x49')]?_0x3f6c1e[_0x86fc('0x3a')]:_0x980958[_0x86fc('0x34')];if(_0x20e303['query'][_0x86fc('0x45')]){_0x3f6c1e[_0x86fc('0x46')]=[{'all':!![]}];}_0x3f6c1e=_[_0x86fc('0x4a')]({},_0x3f6c1e,_0x20e303[_0x86fc('0x44')]);return db[_0x86fc('0x2f')][_0x86fc('0x4b')](_0x3f6c1e)[_0x86fc('0x29')](handleEntityNotFound(_0x50b28f,null))[_0x86fc('0x29')](respondWithResult(_0x50b28f,null))[_0x86fc('0x4c')](handleError(_0x50b28f,null));};exports[_0x86fc('0x4d')]=function(_0x5c50c8,_0x1c6591){return db[_0x86fc('0x2f')][_0x86fc('0x4d')](_0x5c50c8[_0x86fc('0x4e')],{})[_0x86fc('0x29')](respondWithResult(_0x1c6591,0xc9))['catch'](handleError(_0x1c6591,null));};exports['update']=function(_0x5ab926,_0x494d9b){if(_0x5ab926[_0x86fc('0x4e')]['id']){delete _0x5ab926['body']['id'];}return db['OpenchannelApplication']['find']({'where':{'id':_0x5ab926[_0x86fc('0x48')]['id']}})['then'](handleEntityNotFound(_0x494d9b,null))['then'](saveUpdates(_0x5ab926[_0x86fc('0x4e')],null))['then'](respondWithResult(_0x494d9b,null))['catch'](handleError(_0x494d9b,null));};exports[_0x86fc('0x28')]=function(_0x68cd28,_0x476e4f){return db['OpenchannelApplication'][_0x86fc('0x4b')]({'where':{'id':_0x68cd28['params']['id']}})[_0x86fc('0x29')](handleEntityNotFound(_0x476e4f,null))[_0x86fc('0x29')](removeEntity(_0x476e4f,null))[_0x86fc('0x4c')](handleError(_0x476e4f,null));}; \ No newline at end of file +var _0x3df4=['reject','save','update','destroy','then','error','stack','name','send','map','OpenchannelApplication','fieldName','type','query','keys','intersection','attributes','model','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','mustache','to-csv','ejs','fs-extra','squel','crypto','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply'];(function(_0x3ef7f1,_0x341d2c){var _0x296bdd=function(_0x3eb09a){while(--_0x3eb09a){_0x3ef7f1['push'](_0x3ef7f1['shift']());}};_0x296bdd(++_0x341d2c);}(_0x3df4,0xff));var _0x43df=function(_0x2c5dcd,_0x10a72c){_0x2c5dcd=_0x2c5dcd-0x0;var _0x19688d=_0x3df4[_0x2c5dcd];return _0x19688d;};'use strict';var emlformat=require(_0x43df('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x43df('0x1'));var jsonpatch=require(_0x43df('0x2'));var rp=require(_0x43df('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x43df('0x4'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x43df('0x5'));var ejs=require(_0x43df('0x6'));var fs=require('fs');var fs_extra=require(_0x43df('0x7'));var _=require('lodash');var squel=require(_0x43df('0x8'));var crypto=require(_0x43df('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x43df('0x5'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x43df('0xa'));var authService=require(_0x43df('0xb'));var qs=require(_0x43df('0xc'));var as=require(_0x43df('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x43df('0xe'));var utils=require(_0x43df('0xf'));var config=require(_0x43df('0x10'));var licenseUtil=require(_0x43df('0x11'));var db=require(_0x43df('0x12'))['db'];function respondWithStatusCode(_0x134ad9,_0x156633){_0x156633=_0x156633||0xcc;return function(_0x242a95){if(_0x242a95){return _0x134ad9[_0x43df('0x13')](_0x156633);}return _0x134ad9[_0x43df('0x14')](_0x156633)[_0x43df('0x15')]();};}function respondWithResult(_0x1e1667,_0x474406){_0x474406=_0x474406||0xc8;return function(_0x2b72ab){if(_0x2b72ab){return _0x1e1667['status'](_0x474406)[_0x43df('0x16')](_0x2b72ab);}};}function respondWithFilteredResult(_0x96d1c6,_0x597db4){return function(_0x1ca12f){if(_0x1ca12f){var _0xcecf81=typeof _0x597db4[_0x43df('0x17')]===_0x43df('0x18')&&typeof _0x597db4['limit']===_0x43df('0x18');var _0x217d20=_0x1ca12f[_0x43df('0x19')];var _0x5cd4a0=_0xcecf81?0x0:_0x597db4[_0x43df('0x17')];var _0x337d0c=_0xcecf81?_0x1ca12f[_0x43df('0x19')]:_0x597db4[_0x43df('0x17')]+_0x597db4[_0x43df('0x1a')];var _0xafee69;if(_0x337d0c>=_0x217d20){_0x337d0c=_0x217d20;_0xafee69=0xc8;}else{_0xafee69=0xce;}_0x96d1c6[_0x43df('0x14')](_0xafee69);return _0x96d1c6['set'](_0x43df('0x1b'),_0x5cd4a0+'-'+_0x337d0c+'/'+_0x217d20)[_0x43df('0x16')](_0x1ca12f);}return null;};}function patchUpdates(_0x31fa26){return function(_0x3a28a3){try{jsonpatch[_0x43df('0x1c')](_0x3a28a3,_0x31fa26,!![]);}catch(_0x4c2078){return BPromise[_0x43df('0x1d')](_0x4c2078);}return _0x3a28a3[_0x43df('0x1e')]();};}function saveUpdates(_0x479bc6,_0x5458ad){return function(_0x48ac3e){if(_0x48ac3e){return _0x48ac3e[_0x43df('0x1f')](_0x479bc6)['then'](function(_0x45a254){return _0x45a254;});}return null;};}function removeEntity(_0x447cb1,_0x4885fd){return function(_0x56979c){if(_0x56979c){return _0x56979c[_0x43df('0x20')]()[_0x43df('0x21')](function(){_0x447cb1[_0x43df('0x14')](0xcc)[_0x43df('0x15')]();});}};}function handleEntityNotFound(_0x1556f4,_0x17416){return function(_0x374b4e){if(!_0x374b4e){_0x1556f4['sendStatus'](0x194);}return _0x374b4e;};}function handleError(_0x2ad5dd,_0x4c2d10){_0x4c2d10=_0x4c2d10||0x1f4;return function(_0x24ba19){logger[_0x43df('0x22')](_0x24ba19[_0x43df('0x23')]);if(_0x24ba19[_0x43df('0x24')]){delete _0x24ba19[_0x43df('0x24')];}_0x2ad5dd[_0x43df('0x14')](_0x4c2d10)[_0x43df('0x25')](_0x24ba19);};}exports['index']=function(_0x28ae3e,_0x559fcd){var _0x36ab6b={},_0x3a5cfc={},_0x55e6a1={'count':0x0,'rows':[]};var _0x29d7a7=_[_0x43df('0x26')](db[_0x43df('0x27')]['rawAttributes'],function(_0x57d5ad){return{'name':_0x57d5ad[_0x43df('0x28')],'type':_0x57d5ad[_0x43df('0x29')]['key']};});_0x3a5cfc['model']=_[_0x43df('0x26')](_0x29d7a7,_0x43df('0x24'));_0x3a5cfc[_0x43df('0x2a')]=_[_0x43df('0x2b')](_0x28ae3e['query']);_0x3a5cfc['filters']=_[_0x43df('0x2c')](_0x3a5cfc['model'],_0x3a5cfc['query']);_0x36ab6b[_0x43df('0x2d')]=_[_0x43df('0x2c')](_0x3a5cfc[_0x43df('0x2e')],qs['fields'](_0x28ae3e[_0x43df('0x2a')][_0x43df('0x2f')]));_0x36ab6b[_0x43df('0x2d')]=_0x36ab6b[_0x43df('0x2d')]['length']?_0x36ab6b['attributes']:_0x3a5cfc[_0x43df('0x2e')];if(!_0x28ae3e[_0x43df('0x2a')][_0x43df('0x30')](_0x43df('0x31'))){_0x36ab6b[_0x43df('0x1a')]=qs[_0x43df('0x1a')](_0x28ae3e[_0x43df('0x2a')][_0x43df('0x1a')]);_0x36ab6b[_0x43df('0x17')]=qs['offset'](_0x28ae3e[_0x43df('0x2a')][_0x43df('0x17')]);}_0x36ab6b[_0x43df('0x32')]=qs[_0x43df('0x33')](_0x28ae3e[_0x43df('0x2a')]['sort']);_0x36ab6b[_0x43df('0x34')]=qs[_0x43df('0x35')](_[_0x43df('0x36')](_0x28ae3e[_0x43df('0x2a')],_0x3a5cfc[_0x43df('0x35')]),_0x29d7a7);if(_0x28ae3e[_0x43df('0x2a')][_0x43df('0x37')]){_0x36ab6b[_0x43df('0x34')]=_[_0x43df('0x38')](_0x36ab6b[_0x43df('0x34')],{'$or':_['map'](_0x29d7a7,function(_0x5e74ed){if(_0x5e74ed[_0x43df('0x29')]!==_0x43df('0x39')){var _0x58eb2a={};_0x58eb2a[_0x5e74ed[_0x43df('0x24')]]={'$like':'%'+_0x28ae3e[_0x43df('0x2a')][_0x43df('0x37')]+'%'};return _0x58eb2a;}})});}_0x36ab6b=_[_0x43df('0x38')]({},_0x36ab6b,_0x28ae3e[_0x43df('0x3a')]);var _0x35fbaa={'where':_0x36ab6b[_0x43df('0x34')]};return db[_0x43df('0x27')][_0x43df('0x19')](_0x35fbaa)[_0x43df('0x21')](function(_0xa26942){_0x55e6a1[_0x43df('0x19')]=_0xa26942;if(_0x28ae3e['query'][_0x43df('0x3b')]){_0x36ab6b[_0x43df('0x3c')]=[{'all':!![]}];}return db[_0x43df('0x27')][_0x43df('0x3d')](_0x36ab6b);})[_0x43df('0x21')](function(_0x306387){_0x55e6a1[_0x43df('0x3e')]=_0x306387;return _0x55e6a1;})[_0x43df('0x21')](respondWithFilteredResult(_0x559fcd,_0x36ab6b))[_0x43df('0x3f')](handleError(_0x559fcd,null));};exports[_0x43df('0x40')]=function(_0x4d8276,_0x19d0e9){var _0x4039de={'raw':!![],'where':{'id':_0x4d8276[_0x43df('0x41')]['id']}},_0x47e3ea={};_0x47e3ea[_0x43df('0x2e')]=_[_0x43df('0x2b')](db[_0x43df('0x27')][_0x43df('0x42')]);_0x47e3ea[_0x43df('0x2a')]=_['keys'](_0x4d8276[_0x43df('0x2a')]);_0x47e3ea[_0x43df('0x35')]=_[_0x43df('0x2c')](_0x47e3ea['model'],_0x47e3ea['query']);_0x4039de[_0x43df('0x2d')]=_[_0x43df('0x2c')](_0x47e3ea[_0x43df('0x2e')],qs['fields'](_0x4d8276[_0x43df('0x2a')][_0x43df('0x2f')]));_0x4039de[_0x43df('0x2d')]=_0x4039de[_0x43df('0x2d')][_0x43df('0x43')]?_0x4039de[_0x43df('0x2d')]:_0x47e3ea[_0x43df('0x2e')];if(_0x4d8276[_0x43df('0x2a')][_0x43df('0x3b')]){_0x4039de['include']=[{'all':!![]}];}_0x4039de=_[_0x43df('0x38')]({},_0x4039de,_0x4d8276[_0x43df('0x3a')]);return db['OpenchannelApplication'][_0x43df('0x44')](_0x4039de)['then'](handleEntityNotFound(_0x19d0e9,null))['then'](respondWithResult(_0x19d0e9,null))[_0x43df('0x3f')](handleError(_0x19d0e9,null));};exports[_0x43df('0x45')]=function(_0x2b3590,_0x4f0385){return db[_0x43df('0x27')]['create'](_0x2b3590[_0x43df('0x46')],{})['then'](respondWithResult(_0x4f0385,0xc9))[_0x43df('0x3f')](handleError(_0x4f0385,null));};exports[_0x43df('0x1f')]=function(_0x2bf6e6,_0x7a96c6){if(_0x2bf6e6[_0x43df('0x46')]['id']){delete _0x2bf6e6[_0x43df('0x46')]['id'];}return db[_0x43df('0x27')]['find']({'where':{'id':_0x2bf6e6['params']['id']}})[_0x43df('0x21')](handleEntityNotFound(_0x7a96c6,null))[_0x43df('0x21')](saveUpdates(_0x2bf6e6[_0x43df('0x46')],null))[_0x43df('0x21')](respondWithResult(_0x7a96c6,null))[_0x43df('0x3f')](handleError(_0x7a96c6,null));};exports['destroy']=function(_0x58a4f2,_0x3be4f7){return db['OpenchannelApplication'][_0x43df('0x44')]({'where':{'id':_0x58a4f2[_0x43df('0x41')]['id']}})[_0x43df('0x21')](handleEntityNotFound(_0x3be4f7,null))['then'](removeEntity(_0x3be4f7,null))[_0x43df('0x3f')](handleError(_0x3be4f7,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index 2fee598..938bfbe 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 _0x3571=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./openchannelApplication.attributes','exports','define','OpenchannelApplication','openchannel_applications','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0x3571,0x13a));var _0x1357=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x3571[_0x3e5086];return _0xfeb102;};'use strict';var _=require(_0x1357('0x0'));var util=require('util');var logger=require(_0x1357('0x1'))(_0x1357('0x2'));var moment=require(_0x1357('0x3'));var BPromise=require(_0x1357('0x4'));var rp=require(_0x1357('0x5'));var fs=require('fs');var path=require(_0x1357('0x6'));var rimraf=require('rimraf');var config=require(_0x1357('0x7'));var attributes=require(_0x1357('0x8'));module[_0x1357('0x9')]=function(_0x5e605e,_0x3c1322){return _0x5e605e[_0x1357('0xa')](_0x1357('0xb'),attributes,{'tableName':_0x1357('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1357('0xd'),'collate':_0x1357('0xe')});}; \ No newline at end of file +var _0xa8d7=['define','openchannel_applications','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x3753e8,_0x3bfdd3){var _0x4ffb3b=function(_0x3eb91e){while(--_0x3eb91e){_0x3753e8['push'](_0x3753e8['shift']());}};_0x4ffb3b(++_0x3bfdd3);}(_0xa8d7,0x154));var _0x7a8d=function(_0x258b93,_0x188ccc){_0x258b93=_0x258b93-0x0;var _0x35484b=_0xa8d7[_0x258b93];return _0x35484b;};'use strict';var _=require(_0x7a8d('0x0'));var util=require('util');var logger=require(_0x7a8d('0x1'))('api');var moment=require(_0x7a8d('0x2'));var BPromise=require('bluebird');var rp=require(_0x7a8d('0x3'));var fs=require('fs');var path=require(_0x7a8d('0x4'));var rimraf=require(_0x7a8d('0x5'));var config=require(_0x7a8d('0x6'));var attributes=require('./openchannelApplication.attributes');module[_0x7a8d('0x7')]=function(_0x19f684,_0x55dfdf){return _0x19f684[_0x7a8d('0x8')]('OpenchannelApplication',attributes,{'tableName':_0x7a8d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7a8d('0xa'),'collate':_0x7a8d('0xb')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index 532270d..31a6749 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 _0xd6aa=['error','code','message','result','catch','update','body','raw','options','where','limit','UpdateOpenchannelApplication','lodash','util','bluebird','randomstring','rpc','../../config/environment','client','http','request','then','OpenchannelApplication,\x20%s,\x20%s','debug','stringify'];(function(_0x31b829,_0x6c11d9){var _0xf5fe25=function(_0x509ecd){while(--_0x509ecd){_0x31b829['push'](_0x31b829['shift']());}};_0xf5fe25(++_0x6c11d9);}(_0xd6aa,0x183));var _0xad6a=function(_0x577683,_0x36165f){_0x577683=_0x577683-0x0;var _0x59119c=_0xd6aa[_0x577683];return _0x59119c;};'use strict';var _=require(_0xad6a('0x0'));var util=require(_0xad6a('0x1'));var moment=require('moment');var BPromise=require(_0xad6a('0x2'));var rs=require(_0xad6a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xad6a('0x4'));var config=require(_0xad6a('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xad6a('0x6')][_0xad6a('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xdc1113,_0x3e3393,_0x153cf6){return new BPromise(function(_0x4b1567,_0x14788e){return client[_0xad6a('0x8')](_0xdc1113,_0x153cf6)[_0xad6a('0x9')](function(_0x52f6aa){logger['info'](_0xad6a('0xa'),_0x3e3393,'request\x20sent');logger[_0xad6a('0xb')]('OpenchannelApplication,\x20%s,\x20%s,\x20%s',_0x3e3393,'request\x20sent',JSON[_0xad6a('0xc')](_0x52f6aa));if(_0x52f6aa[_0xad6a('0xd')]){if(_0x52f6aa['error'][_0xad6a('0xe')]===0x1f4){logger['error'](_0xad6a('0xa'),_0x3e3393,_0x52f6aa[_0xad6a('0xd')][_0xad6a('0xf')]);return _0x14788e(_0x52f6aa[_0xad6a('0xd')][_0xad6a('0xf')]);}logger[_0xad6a('0xd')]('OpenchannelApplication,\x20%s,\x20%s',_0x3e3393,_0x52f6aa[_0xad6a('0xd')][_0xad6a('0xf')]);return _0x4b1567(_0x52f6aa['error'][_0xad6a('0xf')]);}else{logger['info'](_0xad6a('0xa'),_0x3e3393,'request\x20sent');_0x4b1567(_0x52f6aa[_0xad6a('0x10')][_0xad6a('0xf')]);}})[_0xad6a('0x11')](function(_0x50cb69){logger[_0xad6a('0xd')](_0xad6a('0xa'),_0x3e3393,_0x50cb69);_0x14788e(_0x50cb69);});});}exports['UpdateOpenchannelApplication']=function(_0x231e43){var _0x3ed070=this;return new Promise(function(_0x26e160,_0x422f30){return db['OpenchannelApplication'][_0xad6a('0x12')](_0x231e43[_0xad6a('0x13')],{'raw':_0x231e43['options']?_0x231e43['options'][_0xad6a('0x14')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x231e43[_0xad6a('0x15')]?_0x231e43[_0xad6a('0x15')][_0xad6a('0x16')]||null:null,'attributes':_0x231e43[_0xad6a('0x15')]?_0x231e43[_0xad6a('0x15')]['attributes']||null:null,'limit':_0x231e43[_0xad6a('0x15')]?_0x231e43['options'][_0xad6a('0x17')]||null:null})[_0xad6a('0x9')](function(_0x2792f6){logger['info'](_0xad6a('0x18'),_0x231e43);logger[_0xad6a('0xb')]('UpdateOpenchannelApplication',_0x231e43,JSON[_0xad6a('0xc')](_0x2792f6));_0x26e160(_0x2792f6);})[_0xad6a('0x11')](function(_0x5c949f){logger[_0xad6a('0xd')]('UpdateOpenchannelApplication',_0x5c949f[_0xad6a('0xf')],_0x231e43);_0x422f30(_0x3ed070['error'](0x1f4,_0x5c949f[_0xad6a('0xf')]));});});}; \ No newline at end of file +var _0xc381=['../../config/logger','../../config/environment','jayson/promise','http','then','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','OpenchannelApplication,\x20%s,\x20%s,\x20%s','error','message','UpdateOpenchannelApplication','OpenchannelApplication','update','raw','options','where','attributes','limit','debug','catch','lodash','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x3afd09,_0x496caa){var _0x5c6d35=function(_0x4682a2){while(--_0x4682a2){_0x3afd09['push'](_0x3afd09['shift']());}};_0x5c6d35(++_0x496caa);}(_0xc381,0xcb));var _0x1c38=function(_0x508276,_0x56c804){_0x508276=_0x508276-0x0;var _0xfc4c3=_0xc381[_0x508276];return _0xfc4c3;};'use strict';var _=require(_0x1c38('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x1c38('0x1'));var rs=require(_0x1c38('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1c38('0x3'))['db'];var utils=require(_0x1c38('0x4'));var logger=require(_0x1c38('0x5'))('rpc');var config=require(_0x1c38('0x6'));var jayson=require(_0x1c38('0x7'));var client=jayson['client'][_0x1c38('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x33d618,_0xb1c887,_0x1012d0){return new BPromise(function(_0x107b09,_0x15766b){return client['request'](_0x33d618,_0x1012d0)[_0x1c38('0x9')](function(_0x5c8917){logger[_0x1c38('0xa')](_0x1c38('0xb'),_0xb1c887,_0x1c38('0xc'));logger['debug'](_0x1c38('0xd'),_0xb1c887,_0x1c38('0xc'),JSON['stringify'](_0x5c8917));if(_0x5c8917[_0x1c38('0xe')]){if(_0x5c8917[_0x1c38('0xe')]['code']===0x1f4){logger[_0x1c38('0xe')](_0x1c38('0xb'),_0xb1c887,_0x5c8917['error'][_0x1c38('0xf')]);return _0x15766b(_0x5c8917[_0x1c38('0xe')][_0x1c38('0xf')]);}logger['error'](_0x1c38('0xb'),_0xb1c887,_0x5c8917[_0x1c38('0xe')][_0x1c38('0xf')]);return _0x107b09(_0x5c8917[_0x1c38('0xe')][_0x1c38('0xf')]);}else{logger[_0x1c38('0xa')](_0x1c38('0xb'),_0xb1c887,_0x1c38('0xc'));_0x107b09(_0x5c8917['result'][_0x1c38('0xf')]);}})['catch'](function(_0x3d20f1){logger[_0x1c38('0xe')]('OpenchannelApplication,\x20%s,\x20%s',_0xb1c887,_0x3d20f1);_0x15766b(_0x3d20f1);});});}exports[_0x1c38('0x10')]=function(_0x14d623){var _0x3b295c=this;return new Promise(function(_0x59a584,_0x3c1122){return db[_0x1c38('0x11')][_0x1c38('0x12')](_0x14d623['body'],{'raw':_0x14d623['options']?_0x14d623['options'][_0x1c38('0x13')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x14d623['options']?_0x14d623[_0x1c38('0x14')][_0x1c38('0x15')]||null:null,'attributes':_0x14d623['options']?_0x14d623[_0x1c38('0x14')][_0x1c38('0x16')]||null:null,'limit':_0x14d623[_0x1c38('0x14')]?_0x14d623[_0x1c38('0x14')][_0x1c38('0x17')]||null:null})[_0x1c38('0x9')](function(_0x214f4c){logger[_0x1c38('0xa')](_0x1c38('0x10'),_0x14d623);logger[_0x1c38('0x18')]('UpdateOpenchannelApplication',_0x14d623,JSON['stringify'](_0x214f4c));_0x59a584(_0x214f4c);})[_0x1c38('0x19')](function(_0x14d59b){logger['error'](_0x1c38('0x10'),_0x14d59b[_0x1c38('0xf')],_0x14d623);_0x3c1122(_0x3b295c[_0x1c38('0xe')](0x1f4,_0x14d59b['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index 289062d..a8691db 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 _0x4cd1=['destroy','/:id/tags','removeTags','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelInteraction.controller','get','index','/describe','isAuthenticated','/:id','/:id/messages','/:id/download','download','post','create','addMessage','tracked','openchannelinteraction:addtags','put','openchannelinteraction:update','delete','openchannel','openchannelinteraction:destroy'];(function(_0x5093e9,_0x5154d0){var _0x4c9a22=function(_0x15176d){while(--_0x15176d){_0x5093e9['push'](_0x5093e9['shift']());}};_0x4c9a22(++_0x5154d0);}(_0x4cd1,0x197));var _0x14cd=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0x4cd1[_0x173d7e];return _0x2220d6;};'use strict';var multer=require(_0x14cd('0x0'));var util=require(_0x14cd('0x1'));var path=require('path');var timeout=require(_0x14cd('0x2'));var express=require(_0x14cd('0x3'));var router=express[_0x14cd('0x4')]();var fs_extra=require(_0x14cd('0x5'));var auth=require(_0x14cd('0x6'));var interaction=require(_0x14cd('0x7'));var config=require('../../config/environment');var controller=require(_0x14cd('0x8'));router[_0x14cd('0x9')]('/',auth['isAuthenticated'](),controller[_0x14cd('0xa')]);router[_0x14cd('0x9')](_0x14cd('0xb'),auth[_0x14cd('0xc')](),controller['describe']);router['get'](_0x14cd('0xd'),auth[_0x14cd('0xc')](),controller['show']);router[_0x14cd('0x9')](_0x14cd('0xe'),auth[_0x14cd('0xc')](),controller['getMessages']);router[_0x14cd('0x9')](_0x14cd('0xf'),auth[_0x14cd('0xc')](),controller[_0x14cd('0x10')]);router[_0x14cd('0x11')]('/',auth[_0x14cd('0xc')](),controller[_0x14cd('0x12')]);router[_0x14cd('0x11')](_0x14cd('0xe'),auth[_0x14cd('0xc')](),controller[_0x14cd('0x13')]);router[_0x14cd('0x11')]('/:id/tags',auth[_0x14cd('0xc')](),interaction[_0x14cd('0x14')]('openchannel',_0x14cd('0x15')),controller['addTags']);router[_0x14cd('0x16')](_0x14cd('0xd'),auth[_0x14cd('0xc')](),interaction[_0x14cd('0x14')]('openchannel',_0x14cd('0x17')),controller['update']);router[_0x14cd('0x18')]('/:id',auth[_0x14cd('0xc')](),interaction[_0x14cd('0x14')](_0x14cd('0x19'),_0x14cd('0x1a')),controller[_0x14cd('0x1b')]);router[_0x14cd('0x18')](_0x14cd('0x1c'),auth[_0x14cd('0xc')](),controller[_0x14cd('0x1d')]);module[_0x14cd('0x1e')]=router; \ No newline at end of file +var _0x9bbc=['connect-timeout','Router','fs-extra','../../components/interaction/service','./openchannelInteraction.controller','get','isAuthenticated','/describe','describe','/:id','getMessages','post','create','/:id/messages','/:id/tags','openchannel','openchannelinteraction:addtags','addTags','put','openchannelinteraction:update','delete','openchannelinteraction:destroy','destroy','removeTags','exports','multer','util','path'];(function(_0x1f83ac,_0x8016fc){var _0x1985de=function(_0x1d5947){while(--_0x1d5947){_0x1f83ac['push'](_0x1f83ac['shift']());}};_0x1985de(++_0x8016fc);}(_0x9bbc,0x1a1));var _0xc9bb=function(_0x5ddcdc,_0x47b288){_0x5ddcdc=_0x5ddcdc-0x0;var _0x19639f=_0x9bbc[_0x5ddcdc];return _0x19639f;};'use strict';var multer=require(_0xc9bb('0x0'));var util=require(_0xc9bb('0x1'));var path=require(_0xc9bb('0x2'));var timeout=require(_0xc9bb('0x3'));var express=require('express');var router=express[_0xc9bb('0x4')]();var fs_extra=require(_0xc9bb('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xc9bb('0x6'));var config=require('../../config/environment');var controller=require(_0xc9bb('0x7'));router[_0xc9bb('0x8')]('/',auth[_0xc9bb('0x9')](),controller['index']);router[_0xc9bb('0x8')](_0xc9bb('0xa'),auth[_0xc9bb('0x9')](),controller[_0xc9bb('0xb')]);router['get'](_0xc9bb('0xc'),auth[_0xc9bb('0x9')](),controller['show']);router[_0xc9bb('0x8')]('/:id/messages',auth[_0xc9bb('0x9')](),controller[_0xc9bb('0xd')]);router[_0xc9bb('0x8')]('/:id/download',auth[_0xc9bb('0x9')](),controller['download']);router[_0xc9bb('0xe')]('/',auth[_0xc9bb('0x9')](),controller[_0xc9bb('0xf')]);router['post'](_0xc9bb('0x10'),auth[_0xc9bb('0x9')](),controller['addMessage']);router[_0xc9bb('0xe')](_0xc9bb('0x11'),auth[_0xc9bb('0x9')](),interaction['tracked'](_0xc9bb('0x12'),_0xc9bb('0x13')),controller[_0xc9bb('0x14')]);router[_0xc9bb('0x15')](_0xc9bb('0xc'),auth[_0xc9bb('0x9')](),interaction['tracked'](_0xc9bb('0x12'),_0xc9bb('0x16')),controller['update']);router[_0xc9bb('0x17')](_0xc9bb('0xc'),auth['isAuthenticated'](),interaction['tracked'](_0xc9bb('0x12'),_0xc9bb('0x18')),controller[_0xc9bb('0x19')]);router[_0xc9bb('0x17')]('/:id/tags',auth[_0xc9bb('0x9')](),controller[_0xc9bb('0x1a')]);module[_0xc9bb('0x1b')]=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index 029c5e8..c485964 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 _0x24e9=['sequelize','BOOLEAN','DATE','STRING','ENUM','out','INTEGER'];(function(_0x45aa0c,_0x3b1092){var _0x51b6a5=function(_0x54b824){while(--_0x54b824){_0x45aa0c['push'](_0x45aa0c['shift']());}};_0x51b6a5(++_0x3b1092);}(_0x24e9,0x85));var _0x924e=function(_0x24061a,_0x1c9f4d){_0x24061a=_0x24061a-0x0;var _0x82054e=_0x24e9[_0x24061a];return _0x82054e;};'use strict';var Sequelize=require(_0x924e('0x0'));module['exports']={'closed':{'type':Sequelize[_0x924e('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x924e('0x2')]},'disposition':{'type':Sequelize[_0x924e('0x3')]},'secondDisposition':{'type':Sequelize[_0x924e('0x3')]},'thirdDisposition':{'type':Sequelize[_0x924e('0x3')]},'note':{'type':Sequelize[_0x924e('0x3')]},'read1stAt':{'type':Sequelize[_0x924e('0x2')]},'threadId':{'type':Sequelize[_0x924e('0x3')]},'externalUrl':{'type':Sequelize['STRING']},'lastMsgAt':{'type':Sequelize[_0x924e('0x2')]},'firstMsgDirection':{'type':Sequelize[_0x924e('0x4')]('in',_0x924e('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0x924e('0x4')]('in',_0x924e('0x5')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize['STRING']},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueId':{'type':Sequelize[_0x924e('0x6')]}}; \ No newline at end of file +var _0x5566=['BOOLEAN','DATE','STRING','ENUM','out','sequelize'];(function(_0x30b5e6,_0x4655e2){var _0x20ec32=function(_0x4891f8){while(--_0x4891f8){_0x30b5e6['push'](_0x30b5e6['shift']());}};_0x20ec32(++_0x4655e2);}(_0x5566,0x179));var _0x6556=function(_0x2924e6,_0x4694aa){_0x2924e6=_0x2924e6-0x0;var _0x57a53b=_0x5566[_0x2924e6];return _0x57a53b;};'use strict';var Sequelize=require(_0x6556('0x0'));module['exports']={'closed':{'type':Sequelize[_0x6556('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x6556('0x2')]},'disposition':{'type':Sequelize[_0x6556('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x6556('0x3')]},'note':{'type':Sequelize[_0x6556('0x3')]},'read1stAt':{'type':Sequelize['DATE']},'threadId':{'type':Sequelize[_0x6556('0x3')]},'externalUrl':{'type':Sequelize[_0x6556('0x3')]},'lastMsgAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x6556('0x4')]('in',_0x6556('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0x6556('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x6556('0x3')]},'autoreplyExecuted':{'type':Sequelize[_0x6556('0x1')],'defaultValue':![]},'queueId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index ef5802e..b85cb9d 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 _0x5106=['moment','ejs','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','error','stack','name','index','map','OpenchannelInteraction','rawAttributes','fieldName','getOptions','findAll','openchannel','query','user','catch','show','type','from','params','model','keys','filters','intersection','attributes','fields','includeAll','include','merge','options','find','create','body','describe','OpenchannelMessage','addMessage','ids','omit','getMessages','findOne','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','rows','addTags','spread','Tag','color','emit','openchannelInteractionTags:save','removeTags','unix','toString','join','root','server','tmp','files','attachments','push','User','fullname','CmContact','firstName','lastName','Attachment','Messages','createdAt','direction','read','OpenchannelAccount','Account','Owner','mkdirSync','Openchannel','N.A.','closed','closedAt','disposition','threadId','Public','basename','existsSync','pipe','createWriteStream','out','System','Contact','value','renderFile','views','transcript-','.pdf','createPdfFromHTML','Unable\x20to\x20delete\x20zip\x20file','rimraf','zip-dir'];(function(_0x386525,_0xefae6){var _0x14d015=function(_0x4a45c1){while(--_0x4a45c1){_0x386525['push'](_0x386525['shift']());}};_0x14d015(++_0xefae6);}(_0x5106,0x184));var _0x6510=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x5106[_0x40a045];return _0x1a687c;};'use strict';var rimraf=require(_0x6510('0x0'));var zipdir=require(_0x6510('0x1'));var moment=require(_0x6510('0x2'));var util=require('util');var path=require('path');var ejs=require(_0x6510('0x3'));var fs=require('fs');var _=require('lodash');var Redis=require(_0x6510('0x4'));var interaction=require(_0x6510('0x5'));var qs=require(_0x6510('0x6'));var pdf=require('../../components/export/pdf');var logger=require(_0x6510('0x7'))(_0x6510('0x8'));var config=require(_0x6510('0x9'));var db=require(_0x6510('0xa'))['db'];config['redis']=_['defaults'](config[_0x6510('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x6510('0xc'))(new Redis(config['redis']));require(_0x6510('0xd'))[_0x6510('0xe')](socket);function respondWithStatusCode(_0x346190,_0x3a8a1b){_0x3a8a1b=_0x3a8a1b||0xcc;return function(_0x3faa56){if(_0x3faa56){return _0x346190[_0x6510('0xf')](_0x3a8a1b);}return _0x346190['status'](_0x3a8a1b)['end']();};}function respondWithResult(_0x5e5bdd,_0x464620){_0x464620=_0x464620||0xc8;return function(_0x4456ad){if(_0x4456ad){return _0x5e5bdd[_0x6510('0x10')](_0x464620)[_0x6510('0x11')](_0x4456ad);}};}function respondWithFilteredResult(_0x3deaf8,_0x31bec3){return function(_0x9daa71){if(_0x9daa71){var _0x5124eb=typeof _0x31bec3[_0x6510('0x12')]===_0x6510('0x13')&&typeof _0x31bec3[_0x6510('0x14')]===_0x6510('0x13');var _0x2e6380=_0x9daa71['count'];var _0x1ca41=_0x5124eb?0x0:_0x31bec3[_0x6510('0x12')];var _0x5cae88=_0x5124eb?_0x9daa71[_0x6510('0x15')]:_0x31bec3[_0x6510('0x12')]+_0x31bec3['limit'];var _0x9c8e5f;if(_0x5cae88>=_0x2e6380){_0x5cae88=_0x2e6380;_0x9c8e5f=0xc8;}else{_0x9c8e5f=0xce;}_0x3deaf8[_0x6510('0x10')](_0x9c8e5f);return _0x3deaf8[_0x6510('0x16')](_0x6510('0x17'),_0x1ca41+'-'+_0x5cae88+'/'+_0x2e6380)[_0x6510('0x11')](_0x9daa71);}return null;};}function saveUpdates(_0x327608){return function(_0x4bd5a8){if(_0x4bd5a8){return _0x4bd5a8[_0x6510('0x18')](_0x327608)[_0x6510('0x19')](function(_0x1b4e14){return _0x1b4e14;});}return null;};}function removeEntity(_0x57536d){return function(_0x322fca){if(_0x322fca){return _0x322fca[_0x6510('0x1a')]()['then'](function(){_0x57536d[_0x6510('0x10')](0xcc)[_0x6510('0x1b')]();});}};}function handleEntityNotFound(_0x217ab3){return function(_0x386915){if(!_0x386915){_0x217ab3[_0x6510('0xf')](0x194);}return _0x386915;};}function handleError(_0x17cc87,_0x112693){_0x112693=_0x112693||0x1f4;return function(_0x2b5b67){logger[_0x6510('0x1c')](_0x2b5b67[_0x6510('0x1d')]);if(_0x2b5b67[_0x6510('0x1e')]){delete _0x2b5b67[_0x6510('0x1e')];}_0x17cc87[_0x6510('0x10')](_0x112693)['send'](_0x2b5b67);};}exports[_0x6510('0x1f')]=function(_0x510229,_0x1a075c){var _0x5e8261={};var _0x464673=_[_0x6510('0x20')](db[_0x6510('0x21')][_0x6510('0x22')],function(_0x28f30d){return{'name':_0x28f30d[_0x6510('0x23')],'type':_0x28f30d['type']['key']};});_0x5e8261=qs[_0x6510('0x24')](_0x464673,_0x510229);return interaction[_0x6510('0x25')](_0x6510('0x26'),_0x510229[_0x6510('0x27')],_0x510229[_0x6510('0x28')],_0x5e8261,_0x464673)[_0x6510('0x19')](respondWithFilteredResult(_0x1a075c,_0x5e8261))[_0x6510('0x29')](handleError(_0x1a075c,null));};exports[_0x6510('0x2a')]=function(_0x50a3fc,_0x3c8b0b){var _0x1f9f4f={};if(_0x50a3fc[_0x6510('0x27')][_0x6510('0x2b')]&&_0x50a3fc[_0x6510('0x27')][_0x6510('0x2b')]===_0x6510('0x2c')){_0x1f9f4f['from']=_0x50a3fc[_0x6510('0x2d')]['id'];}else{_0x1f9f4f['id']=_0x50a3fc['params']['id'];}var _0x4221a0={'raw':![],'where':_0x1f9f4f},_0xf9f1b8={};_0xf9f1b8[_0x6510('0x2e')]=_[_0x6510('0x2f')](db[_0x6510('0x21')][_0x6510('0x22')]);_0xf9f1b8[_0x6510('0x27')]=_[_0x6510('0x2f')](_0x50a3fc[_0x6510('0x27')]);_0xf9f1b8[_0x6510('0x30')]=_[_0x6510('0x31')](_0xf9f1b8[_0x6510('0x2e')],_0xf9f1b8[_0x6510('0x27')]);_0x4221a0[_0x6510('0x32')]=_[_0x6510('0x31')](_0xf9f1b8[_0x6510('0x2e')],qs[_0x6510('0x33')](_0x50a3fc['query'][_0x6510('0x33')]));_0x4221a0[_0x6510('0x32')]=_0x4221a0[_0x6510('0x32')]['length']?_0x4221a0[_0x6510('0x32')]:_0xf9f1b8[_0x6510('0x2e')];if(_0x50a3fc[_0x6510('0x27')][_0x6510('0x34')]){_0x4221a0[_0x6510('0x35')]=[{'all':!![]}];}_0x4221a0=_[_0x6510('0x36')]({},_0x4221a0,_0x50a3fc[_0x6510('0x37')]);return db[_0x6510('0x21')][_0x6510('0x38')](_0x4221a0)[_0x6510('0x19')](handleEntityNotFound(_0x3c8b0b,null))[_0x6510('0x19')](respondWithResult(_0x3c8b0b,null))[_0x6510('0x29')](handleError(_0x3c8b0b,null));};exports[_0x6510('0x39')]=function(_0x541a8f,_0x3d845c){return db[_0x6510('0x21')]['create'](_0x541a8f[_0x6510('0x3a')],{})[_0x6510('0x19')](respondWithResult(_0x3d845c,0xc9))[_0x6510('0x29')](handleError(_0x3d845c,null));};exports[_0x6510('0x18')]=function(_0x27e3f3,_0x54f3a2){if(_0x27e3f3[_0x6510('0x3a')]['id']){delete _0x27e3f3['body']['id'];}return db['OpenchannelInteraction']['find']({'where':{'id':_0x27e3f3[_0x6510('0x2d')]['id']}})[_0x6510('0x19')](handleEntityNotFound(_0x54f3a2,null))[_0x6510('0x19')](saveUpdates(_0x27e3f3['body'],null))[_0x6510('0x19')](respondWithResult(_0x54f3a2,null))['catch'](handleError(_0x54f3a2,null));};exports['destroy']=function(_0x1253be,_0x4ade0d){return db[_0x6510('0x21')][_0x6510('0x38')]({'where':{'id':_0x1253be[_0x6510('0x2d')]['id']}})[_0x6510('0x19')](handleEntityNotFound(_0x4ade0d,null))[_0x6510('0x19')](removeEntity(_0x4ade0d,null))[_0x6510('0x29')](handleError(_0x4ade0d,null));};exports[_0x6510('0x3b')]=function(_0x17e64b,_0x9cea9b){return db['OpenchannelInteraction']['describe']()[_0x6510('0x19')](respondWithResult(_0x9cea9b,null))[_0x6510('0x29')](handleError(_0x9cea9b,null));};exports['addMessage']=function(_0x2bd017,_0x4f0920){return db[_0x6510('0x3c')][_0x6510('0x38')]({'where':{'id':_0x2bd017['params']['id']}})['then'](handleEntityNotFound(_0x4f0920,null))[_0x6510('0x19')](function(_0x4a2240){if(_0x4a2240){return _0x4a2240[_0x6510('0x3d')](_0x2bd017[_0x6510('0x3a')][_0x6510('0x3e')],_[_0x6510('0x3f')](_0x2bd017['body'],[_0x6510('0x3e'),'id'])||{});}})['then'](respondWithResult(_0x4f0920,null))[_0x6510('0x29')](handleError(_0x4f0920,null));};exports[_0x6510('0x40')]=function(_0x326caf,_0x4269f7){var _0x3eef76={'raw':![],'where':{}};var _0x29673f={};var _0x4b9a4f={'count':0x0,'rows':[]};return db[_0x6510('0x21')][_0x6510('0x41')]({'where':{'id':_0x326caf['params']['id']}})[_0x6510('0x19')](handleEntityNotFound(_0x4269f7,null))[_0x6510('0x19')](function(_0x1bde85){if(_0x1bde85){_0x29673f[_0x6510('0x2e')]=_[_0x6510('0x2f')](db[_0x6510('0x3c')][_0x6510('0x22')]);_0x29673f[_0x6510('0x27')]=_[_0x6510('0x2f')](_0x326caf[_0x6510('0x27')]);_0x29673f[_0x6510('0x30')]=_[_0x6510('0x31')](_0x29673f[_0x6510('0x2e')],_0x29673f[_0x6510('0x27')]);_0x3eef76[_0x6510('0x32')]=_[_0x6510('0x31')](_0x29673f[_0x6510('0x2e')],qs[_0x6510('0x33')](_0x326caf[_0x6510('0x27')][_0x6510('0x33')]));_0x3eef76[_0x6510('0x32')]=_0x3eef76[_0x6510('0x32')][_0x6510('0x42')]?_0x3eef76[_0x6510('0x32')]:_0x29673f[_0x6510('0x2e')];if(!_0x326caf[_0x6510('0x27')][_0x6510('0x43')](_0x6510('0x44'))){_0x3eef76[_0x6510('0x14')]=qs[_0x6510('0x14')](_0x326caf[_0x6510('0x27')][_0x6510('0x14')]);_0x3eef76[_0x6510('0x12')]=qs[_0x6510('0x12')](_0x326caf['query'][_0x6510('0x12')]);}_0x3eef76[_0x6510('0x45')]=qs[_0x6510('0x46')](_0x326caf[_0x6510('0x27')][_0x6510('0x46')]);_0x3eef76[_0x6510('0x47')]=qs[_0x6510('0x30')](_[_0x6510('0x48')](_0x326caf[_0x6510('0x27')],_0x29673f[_0x6510('0x30')]));_0x3eef76[_0x6510('0x47')]['OpenchannelInteractionId']=_0x1bde85['id'];if(_0x326caf[_0x6510('0x27')]['filter']){_0x3eef76[_0x6510('0x47')]=_[_0x6510('0x36')](_0x3eef76[_0x6510('0x47')],{'$or':_[_0x6510('0x20')](_0x3eef76['attributes'],function(_0x3837d2){var _0x4a926b={};_0x4a926b[_0x3837d2]={'$like':'%'+_0x326caf['query'][_0x6510('0x49')]+'%'};return _0x4a926b;})});}if(_0x326caf[_0x6510('0x27')]['$gte']){var _0x58ad5a=_0x326caf[_0x6510('0x27')][_0x6510('0x4a')][_0x6510('0x4b')](',');var _0xcdae9e={};_0xcdae9e[_0x58ad5a[0x0]]={'$gte':moment(_0x58ad5a[0x1])[_0x6510('0x4c')](_0x6510('0x4d'))};_0x3eef76['where']=_['merge'](_0x3eef76['where'],_0xcdae9e);}_0x3eef76=_['merge']({},_0x3eef76,_0x326caf['options']);return db[_0x6510('0x3c')]['count']({'where':_0x3eef76['where']})['then'](function(_0x488a87){_0x4b9a4f[_0x6510('0x15')]=_0x488a87;if(_0x326caf[_0x6510('0x27')][_0x6510('0x34')]){_0x3eef76[_0x6510('0x35')]=[{'all':!![]}];}return db[_0x6510('0x3c')]['findAll'](_0x3eef76);})[_0x6510('0x19')](function(_0x479316){_0x4b9a4f[_0x6510('0x4e')]=_0x479316;return _0x4b9a4f;});}})[_0x6510('0x19')](respondWithFilteredResult(_0x4269f7,_0x3eef76))[_0x6510('0x29')](handleError(_0x4269f7,null));};exports[_0x6510('0x4f')]=function(_0x1bd919,_0x447d73){return db[_0x6510('0x21')]['find']({'where':{'id':_0x1bd919[_0x6510('0x2d')]['id']}})['then'](handleEntityNotFound(_0x447d73,null))[_0x6510('0x19')](function(_0x693185){if(_0x693185){return _0x693185['setTags'](_0x1bd919['body'][_0x6510('0x3e')],_[_0x6510('0x3f')](_0x1bd919[_0x6510('0x3a')],[_0x6510('0x3e'),'id'])||{})[_0x6510('0x50')](function(){return db[_0x6510('0x51')]['findAll']({'attributes':['id',_0x6510('0x1e'),_0x6510('0x52')],'where':{'id':_0x1bd919[_0x6510('0x3a')][_0x6510('0x3e')]}});})[_0x6510('0x19')](function(_0x418c0e){socket[_0x6510('0x53')](_0x6510('0x54'),{'id':Number(_0x1bd919[_0x6510('0x2d')]['id']),'tags':_0x418c0e||[]});return{'id':Number(_0x1bd919['params']['id']),'tags':_0x418c0e||[]};});}})[_0x6510('0x19')](respondWithResult(_0x447d73,null))['catch'](handleError(_0x447d73,null));};exports[_0x6510('0x55')]=function(_0x2facdf,_0x2ee0f9){return db[_0x6510('0x21')][_0x6510('0x38')]({'where':{'id':_0x2facdf['params']['id']}})[_0x6510('0x19')](handleEntityNotFound(_0x2ee0f9,null))[_0x6510('0x19')](function(_0x4a7a8a){if(_0x4a7a8a){return _0x4a7a8a[_0x6510('0x55')](_0x2facdf[_0x6510('0x27')][_0x6510('0x3e')]);}})[_0x6510('0x19')](respondWithStatusCode(_0x2ee0f9,null))['catch'](handleError(_0x2ee0f9,null));};exports['download']=function(_0x45ae23,_0x236706){var _0x5acadd=moment()[_0x6510('0x56')]()[_0x6510('0x57')]();var _0x3067a3=path[_0x6510('0x58')](config[_0x6510('0x59')],_0x6510('0x5a'),'files',_0x6510('0x5b'));var _0x3673f7=path[_0x6510('0x58')](config[_0x6510('0x59')],_0x6510('0x5a'),_0x6510('0x5c'),_0x6510('0x5d'));var _0x4eadd0=path[_0x6510('0x58')](_0x3067a3,_0x5acadd);var _0x3d619f=util['format']('transcript-%d-%s.zip',_0x45ae23[_0x6510('0x2d')]['id'],_0x5acadd);var _0x3a8838=path['join'](_0x3067a3,_0x3d619f);var _0x207ead=[];_0x207ead[_0x6510('0x5e')]({'model':db[_0x6510('0x5f')],'as':_0x6510('0x5f'),'attributes':['id',_0x6510('0x60')],'raw':!![]});_0x207ead[_0x6510('0x5e')]({'model':db[_0x6510('0x61')],'as':'Contact','attributes':['id',_0x6510('0x62'),_0x6510('0x63')],'raw':!![]});if(_0x45ae23[_0x6510('0x27')][_0x6510('0x5d')]){_0x207ead[_0x6510('0x5e')]({'model':db['Attachment'],'as':_0x6510('0x64'),'raw':!![]});}var _0x3a35ec=[{'model':db['OpenchannelMessage'],'as':_0x6510('0x65'),'attributes':['id',_0x6510('0x3a'),_0x6510('0x66'),_0x6510('0x67'),'secret',_0x6510('0x68')],'include':_0x207ead}];_0x3a35ec[_0x6510('0x5e')]({'model':db[_0x6510('0x69')],'as':_0x6510('0x6a'),'attributes':['id',_0x6510('0x1e')]});_0x3a35ec['push']({'model':db['User'],'as':_0x6510('0x6b'),'attributes':['id','fullname']});return db[_0x6510('0x21')][_0x6510('0x38')]({'where':{'id':_0x45ae23[_0x6510('0x2d')]['id']},'include':_0x3a35ec})[_0x6510('0x19')](handleEntityNotFound(_0x236706,null))['then'](function(_0xa6d3a7){if(_0xa6d3a7){var _0x1f075e=_0xa6d3a7['get']({'plain':!![]});fs[_0x6510('0x6c')](_0x4eadd0);var _0x32686c={'channel':_0x6510('0x6d'),'account':_0x1f075e[_0x6510('0x6a')][_0x6510('0x1e')],'agent':_0x1f075e[_0x6510('0x6b')]?_0x1f075e[_0x6510('0x6b')][_0x6510('0x60')]:_0x6510('0x6e'),'createdAt':moment(_0x1f075e[_0x6510('0x66')])[_0x6510('0x4c')](_0x6510('0x4d'))[_0x6510('0x57')](),'closedAt':_0x1f075e[_0x6510('0x6f')]?moment(_0x1f075e[_0x6510('0x70')])[_0x6510('0x4c')](_0x6510('0x4d'))[_0x6510('0x57')]():'','disposition':_0x1f075e[_0x6510('0x71')],'visibility':_0x1f075e[_0x6510('0x72')]?_0x6510('0x73'):'Private','messages':_(_0x1f075e[_0x6510('0x65')])[_0x6510('0x49')]({'secret':![]})['map'](function(_0x223536){if(_0x223536[_0x6510('0x64')]){var _0x642da4=path[_0x6510('0x58')](_0x3673f7,_0x223536[_0x6510('0x64')][_0x6510('0x74')]);if(fs[_0x6510('0x75')](_0x642da4)){fs['createReadStream'](_0x642da4)[_0x6510('0x76')](fs[_0x6510('0x77')](path[_0x6510('0x58')](_0x4eadd0,_0x223536[_0x6510('0x64')][_0x6510('0x74')])));}}return{'date':moment(_0x223536[_0x6510('0x66')])['format'](_0x6510('0x4d'))[_0x6510('0x57')](),'sender':_0x223536[_0x6510('0x67')]===_0x6510('0x78')?_0x223536[_0x6510('0x5f')]?_0x223536['User'][_0x6510('0x60')]:_0x6510('0x79'):_0x223536[_0x6510('0x7a')][_0x6510('0x62')]+(_0x223536[_0x6510('0x7a')][_0x6510('0x63')]?'\x20'+_0x223536[_0x6510('0x7a')][_0x6510('0x63')]:''),'body':_0x223536[_0x6510('0x64')]?_0x223536[_0x6510('0x64')]['basename']:_0x223536[_0x6510('0x3a')],'direction':_0x223536[_0x6510('0x67')]===_0x6510('0x78')?'A':'C','secret':_0x223536['secret'],'read':_0x223536[_0x6510('0x68')],'attachment':_0x223536[_0x6510('0x64')]};})[_0x6510('0x7b')]()};return ejs[_0x6510('0x7c')](path[_0x6510('0x58')](config[_0x6510('0x59')],_0x6510('0x5a'),_0x6510('0x7d'),'downloadInteraction.ejs'),{'interaction':_0x32686c})[_0x6510('0x19')](function(_0x301500){var _0x673d71=path[_0x6510('0x58')](_0x4eadd0,_0x6510('0x7e')+_0x1f075e['id']+'-'+_0x5acadd+_0x6510('0x7f'));var _0x3f1eb8={'path':_0x673d71,'channel':_0x6510('0x6d'),'interactionId':_0x1f075e['id']};return pdf[_0x6510('0x80')](_0x301500,_0x3f1eb8);})[_0x6510('0x19')](function(){return new Promise(function(_0x3606a5,_0x281a05){zipdir(_0x4eadd0,{'saveTo':_0x3a8838},function(_0x478e6c,_0x19423a){if(_0x478e6c)return _0x281a05(_0x478e6c);return _0x3606a5(_0x19423a);});})[_0x6510('0x19')](function(){return new Promise(function(_0x230917,_0x49172c){rimraf(_0x4eadd0,function(_0x3de07b){if(_0x3de07b)_0x49172c(_0x3de07b);return _0x230917();});});})[_0x6510('0x19')](function(){return _0x236706['download'](_0x3a8838,_0x3d619f,function(_0x30729f){if(_0x30729f){logger[_0x6510('0x1c')](_0x6510('0x81'),_0x30729f);}else{fs['unlinkSync'](_0x3a8838);}});});});}else{return _0x236706['sendStatus'](0xc8);}})[_0x6510('0x29')](handleError(_0x236706,null));}; \ No newline at end of file +var _0x3fbf=['OpenchannelAccount','Account','Owner','fullname','get','mkdirSync','Openchannel','N.A.','closed','threadId','Public','basename','createReadStream','createWriteStream','direction','out','Contact','value','renderFile','downloadInteraction.ejs','transcript-','createPdfFromHTML','download','Unable\x20to\x20delete\x20zip\x20file','unlinkSync','rimraf','moment','util','path','lodash','ioredis','../../components/parsers/qs','../../components/export/pdf','api','../../config/environment','redis','localhost','socket.io-emitter','./openchannelInteraction.socket','sendStatus','status','json','offset','undefined','limit','count','set','update','then','destroy','end','error','stack','name','send','index','map','OpenchannelInteraction','fieldName','type','key','getOptions','findAll','openchannel','query','user','catch','show','from','params','model','rawAttributes','filters','intersection','fields','attributes','includeAll','merge','find','create','body','describe','addMessage','OpenchannelMessage','ids','findOne','keys','hasOwnProperty','nolimit','sort','where','OpenchannelInteractionId','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','options','include','rows','addTags','setTags','Tag','emit','openchannelInteractionTags:save','removeTags','unix','toString','join','root','server','files','transcript-%d-%s.zip','push','User','firstName','lastName','Attachment','Messages','createdAt','secret','read'];(function(_0x1ce0ac,_0xc4b457){var _0x516fbf=function(_0x20ed51){while(--_0x20ed51){_0x1ce0ac['push'](_0x1ce0ac['shift']());}};_0x516fbf(++_0xc4b457);}(_0x3fbf,0x187));var _0xf3fb=function(_0x4fe19c,_0x45d0fe){_0x4fe19c=_0x4fe19c-0x0;var _0x952ac7=_0x3fbf[_0x4fe19c];return _0x952ac7;};'use strict';var rimraf=require(_0xf3fb('0x0'));var zipdir=require('zip-dir');var moment=require(_0xf3fb('0x1'));var util=require(_0xf3fb('0x2'));var path=require(_0xf3fb('0x3'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xf3fb('0x4'));var Redis=require(_0xf3fb('0x5'));var interaction=require('../../components/interaction/service');var qs=require(_0xf3fb('0x6'));var pdf=require(_0xf3fb('0x7'));var logger=require('../../config/logger')(_0xf3fb('0x8'));var config=require(_0xf3fb('0x9'));var db=require('../../mysqldb')['db'];config[_0xf3fb('0xa')]=_['defaults'](config[_0xf3fb('0xa')],{'host':_0xf3fb('0xb'),'port':0x18eb});var socket=require(_0xf3fb('0xc'))(new Redis(config[_0xf3fb('0xa')]));require(_0xf3fb('0xd'))['register'](socket);function respondWithStatusCode(_0x270cb7,_0x2fb52f){_0x2fb52f=_0x2fb52f||0xcc;return function(_0x4a563f){if(_0x4a563f){return _0x270cb7[_0xf3fb('0xe')](_0x2fb52f);}return _0x270cb7[_0xf3fb('0xf')](_0x2fb52f)['end']();};}function respondWithResult(_0xcc0fdd,_0x23c594){_0x23c594=_0x23c594||0xc8;return function(_0x29c129){if(_0x29c129){return _0xcc0fdd[_0xf3fb('0xf')](_0x23c594)[_0xf3fb('0x10')](_0x29c129);}};}function respondWithFilteredResult(_0x1b7ff2,_0x266480){return function(_0x3362ca){if(_0x3362ca){var _0x2c2bc6=typeof _0x266480[_0xf3fb('0x11')]===_0xf3fb('0x12')&&typeof _0x266480[_0xf3fb('0x13')]===_0xf3fb('0x12');var _0x465072=_0x3362ca[_0xf3fb('0x14')];var _0x1a731d=_0x2c2bc6?0x0:_0x266480[_0xf3fb('0x11')];var _0xd93e30=_0x2c2bc6?_0x3362ca['count']:_0x266480[_0xf3fb('0x11')]+_0x266480['limit'];var _0x5bed6d;if(_0xd93e30>=_0x465072){_0xd93e30=_0x465072;_0x5bed6d=0xc8;}else{_0x5bed6d=0xce;}_0x1b7ff2['status'](_0x5bed6d);return _0x1b7ff2[_0xf3fb('0x15')]('Content-Range',_0x1a731d+'-'+_0xd93e30+'/'+_0x465072)[_0xf3fb('0x10')](_0x3362ca);}return null;};}function saveUpdates(_0x58e592){return function(_0x39b3c8){if(_0x39b3c8){return _0x39b3c8[_0xf3fb('0x16')](_0x58e592)[_0xf3fb('0x17')](function(_0x26bfc3){return _0x26bfc3;});}return null;};}function removeEntity(_0x19c554){return function(_0x5b8d63){if(_0x5b8d63){return _0x5b8d63[_0xf3fb('0x18')]()[_0xf3fb('0x17')](function(){_0x19c554[_0xf3fb('0xf')](0xcc)[_0xf3fb('0x19')]();});}};}function handleEntityNotFound(_0x56a7ea){return function(_0x533f09){if(!_0x533f09){_0x56a7ea[_0xf3fb('0xe')](0x194);}return _0x533f09;};}function handleError(_0x5d5afc,_0x387293){_0x387293=_0x387293||0x1f4;return function(_0x15a6f5){logger[_0xf3fb('0x1a')](_0x15a6f5[_0xf3fb('0x1b')]);if(_0x15a6f5[_0xf3fb('0x1c')]){delete _0x15a6f5['name'];}_0x5d5afc[_0xf3fb('0xf')](_0x387293)[_0xf3fb('0x1d')](_0x15a6f5);};}exports[_0xf3fb('0x1e')]=function(_0x10b899,_0x338059){var _0x29ce0c={};var _0x28ec5e=_[_0xf3fb('0x1f')](db[_0xf3fb('0x20')]['rawAttributes'],function(_0x4774db){return{'name':_0x4774db[_0xf3fb('0x21')],'type':_0x4774db[_0xf3fb('0x22')][_0xf3fb('0x23')]};});_0x29ce0c=qs[_0xf3fb('0x24')](_0x28ec5e,_0x10b899);return interaction[_0xf3fb('0x25')](_0xf3fb('0x26'),_0x10b899[_0xf3fb('0x27')],_0x10b899[_0xf3fb('0x28')],_0x29ce0c,_0x28ec5e)[_0xf3fb('0x17')](respondWithFilteredResult(_0x338059,_0x29ce0c))[_0xf3fb('0x29')](handleError(_0x338059,null));};exports[_0xf3fb('0x2a')]=function(_0x4326d4,_0x4b329d){var _0x1f9773={};if(_0x4326d4['query'][_0xf3fb('0x22')]&&_0x4326d4[_0xf3fb('0x27')][_0xf3fb('0x22')]===_0xf3fb('0x2b')){_0x1f9773[_0xf3fb('0x2b')]=_0x4326d4[_0xf3fb('0x2c')]['id'];}else{_0x1f9773['id']=_0x4326d4[_0xf3fb('0x2c')]['id'];}var _0x38377c={'raw':![],'where':_0x1f9773},_0x31cb6f={};_0x31cb6f[_0xf3fb('0x2d')]=_['keys'](db['OpenchannelInteraction'][_0xf3fb('0x2e')]);_0x31cb6f[_0xf3fb('0x27')]=_['keys'](_0x4326d4[_0xf3fb('0x27')]);_0x31cb6f[_0xf3fb('0x2f')]=_[_0xf3fb('0x30')](_0x31cb6f['model'],_0x31cb6f[_0xf3fb('0x27')]);_0x38377c['attributes']=_[_0xf3fb('0x30')](_0x31cb6f['model'],qs['fields'](_0x4326d4[_0xf3fb('0x27')][_0xf3fb('0x31')]));_0x38377c[_0xf3fb('0x32')]=_0x38377c[_0xf3fb('0x32')]['length']?_0x38377c['attributes']:_0x31cb6f[_0xf3fb('0x2d')];if(_0x4326d4[_0xf3fb('0x27')][_0xf3fb('0x33')]){_0x38377c['include']=[{'all':!![]}];}_0x38377c=_[_0xf3fb('0x34')]({},_0x38377c,_0x4326d4['options']);return db[_0xf3fb('0x20')][_0xf3fb('0x35')](_0x38377c)[_0xf3fb('0x17')](handleEntityNotFound(_0x4b329d,null))[_0xf3fb('0x17')](respondWithResult(_0x4b329d,null))[_0xf3fb('0x29')](handleError(_0x4b329d,null));};exports[_0xf3fb('0x36')]=function(_0xe6f8f9,_0x2ecb28){return db[_0xf3fb('0x20')][_0xf3fb('0x36')](_0xe6f8f9['body'],{})[_0xf3fb('0x17')](respondWithResult(_0x2ecb28,0xc9))['catch'](handleError(_0x2ecb28,null));};exports[_0xf3fb('0x16')]=function(_0x50a09c,_0x1e41ac){if(_0x50a09c[_0xf3fb('0x37')]['id']){delete _0x50a09c[_0xf3fb('0x37')]['id'];}return db['OpenchannelInteraction']['find']({'where':{'id':_0x50a09c['params']['id']}})[_0xf3fb('0x17')](handleEntityNotFound(_0x1e41ac,null))['then'](saveUpdates(_0x50a09c[_0xf3fb('0x37')],null))[_0xf3fb('0x17')](respondWithResult(_0x1e41ac,null))['catch'](handleError(_0x1e41ac,null));};exports['destroy']=function(_0x3dd669,_0x39e7e0){return db[_0xf3fb('0x20')][_0xf3fb('0x35')]({'where':{'id':_0x3dd669[_0xf3fb('0x2c')]['id']}})[_0xf3fb('0x17')](handleEntityNotFound(_0x39e7e0,null))[_0xf3fb('0x17')](removeEntity(_0x39e7e0,null))[_0xf3fb('0x29')](handleError(_0x39e7e0,null));};exports['describe']=function(_0x877f19,_0x512d2f){return db[_0xf3fb('0x20')][_0xf3fb('0x38')]()[_0xf3fb('0x17')](respondWithResult(_0x512d2f,null))[_0xf3fb('0x29')](handleError(_0x512d2f,null));};exports[_0xf3fb('0x39')]=function(_0x4718d1,_0x371211){return db[_0xf3fb('0x3a')]['find']({'where':{'id':_0x4718d1[_0xf3fb('0x2c')]['id']}})[_0xf3fb('0x17')](handleEntityNotFound(_0x371211,null))['then'](function(_0xb944b8){if(_0xb944b8){return _0xb944b8[_0xf3fb('0x39')](_0x4718d1[_0xf3fb('0x37')][_0xf3fb('0x3b')],_['omit'](_0x4718d1[_0xf3fb('0x37')],[_0xf3fb('0x3b'),'id'])||{});}})['then'](respondWithResult(_0x371211,null))[_0xf3fb('0x29')](handleError(_0x371211,null));};exports['getMessages']=function(_0x2c9271,_0x2161d1){var _0x315707={'raw':![],'where':{}};var _0x4aed4e={};var _0x1196c0={'count':0x0,'rows':[]};return db[_0xf3fb('0x20')][_0xf3fb('0x3c')]({'where':{'id':_0x2c9271['params']['id']}})[_0xf3fb('0x17')](handleEntityNotFound(_0x2161d1,null))['then'](function(_0x38eada){if(_0x38eada){_0x4aed4e[_0xf3fb('0x2d')]=_['keys'](db['OpenchannelMessage'][_0xf3fb('0x2e')]);_0x4aed4e[_0xf3fb('0x27')]=_[_0xf3fb('0x3d')](_0x2c9271['query']);_0x4aed4e['filters']=_['intersection'](_0x4aed4e[_0xf3fb('0x2d')],_0x4aed4e[_0xf3fb('0x27')]);_0x315707['attributes']=_[_0xf3fb('0x30')](_0x4aed4e[_0xf3fb('0x2d')],qs[_0xf3fb('0x31')](_0x2c9271['query'][_0xf3fb('0x31')]));_0x315707[_0xf3fb('0x32')]=_0x315707[_0xf3fb('0x32')]['length']?_0x315707['attributes']:_0x4aed4e[_0xf3fb('0x2d')];if(!_0x2c9271[_0xf3fb('0x27')][_0xf3fb('0x3e')](_0xf3fb('0x3f'))){_0x315707[_0xf3fb('0x13')]=qs[_0xf3fb('0x13')](_0x2c9271['query'][_0xf3fb('0x13')]);_0x315707[_0xf3fb('0x11')]=qs[_0xf3fb('0x11')](_0x2c9271[_0xf3fb('0x27')][_0xf3fb('0x11')]);}_0x315707['order']=qs[_0xf3fb('0x40')](_0x2c9271[_0xf3fb('0x27')]['sort']);_0x315707[_0xf3fb('0x41')]=qs['filters'](_['pick'](_0x2c9271[_0xf3fb('0x27')],_0x4aed4e[_0xf3fb('0x2f')]));_0x315707[_0xf3fb('0x41')][_0xf3fb('0x42')]=_0x38eada['id'];if(_0x2c9271['query'][_0xf3fb('0x43')]){_0x315707['where']=_[_0xf3fb('0x34')](_0x315707[_0xf3fb('0x41')],{'$or':_[_0xf3fb('0x1f')](_0x315707[_0xf3fb('0x32')],function(_0x260e6a){var _0x24615d={};_0x24615d[_0x260e6a]={'$like':'%'+_0x2c9271[_0xf3fb('0x27')][_0xf3fb('0x43')]+'%'};return _0x24615d;})});}if(_0x2c9271[_0xf3fb('0x27')][_0xf3fb('0x44')]){var _0x68ff8=_0x2c9271[_0xf3fb('0x27')][_0xf3fb('0x44')][_0xf3fb('0x45')](',');var _0x2d7e2d={};_0x2d7e2d[_0x68ff8[0x0]]={'$gte':moment(_0x68ff8[0x1])[_0xf3fb('0x46')](_0xf3fb('0x47'))};_0x315707[_0xf3fb('0x41')]=_[_0xf3fb('0x34')](_0x315707['where'],_0x2d7e2d);}_0x315707=_[_0xf3fb('0x34')]({},_0x315707,_0x2c9271[_0xf3fb('0x48')]);return db[_0xf3fb('0x3a')]['count']({'where':_0x315707[_0xf3fb('0x41')]})[_0xf3fb('0x17')](function(_0x4e2a65){_0x1196c0[_0xf3fb('0x14')]=_0x4e2a65;if(_0x2c9271[_0xf3fb('0x27')][_0xf3fb('0x33')]){_0x315707[_0xf3fb('0x49')]=[{'all':!![]}];}return db[_0xf3fb('0x3a')][_0xf3fb('0x25')](_0x315707);})['then'](function(_0x3eec4d){_0x1196c0[_0xf3fb('0x4a')]=_0x3eec4d;return _0x1196c0;});}})['then'](respondWithFilteredResult(_0x2161d1,_0x315707))[_0xf3fb('0x29')](handleError(_0x2161d1,null));};exports[_0xf3fb('0x4b')]=function(_0x339e74,_0x20308a){return db['OpenchannelInteraction'][_0xf3fb('0x35')]({'where':{'id':_0x339e74[_0xf3fb('0x2c')]['id']}})[_0xf3fb('0x17')](handleEntityNotFound(_0x20308a,null))[_0xf3fb('0x17')](function(_0x16e750){if(_0x16e750){return _0x16e750[_0xf3fb('0x4c')](_0x339e74['body'][_0xf3fb('0x3b')],_['omit'](_0x339e74['body'],['ids','id'])||{})['spread'](function(){return db[_0xf3fb('0x4d')][_0xf3fb('0x25')]({'attributes':['id',_0xf3fb('0x1c'),'color'],'where':{'id':_0x339e74[_0xf3fb('0x37')][_0xf3fb('0x3b')]}});})[_0xf3fb('0x17')](function(_0x456b40){socket[_0xf3fb('0x4e')](_0xf3fb('0x4f'),{'id':Number(_0x339e74[_0xf3fb('0x2c')]['id']),'tags':_0x456b40||[]});return{'id':Number(_0x339e74['params']['id']),'tags':_0x456b40||[]};});}})[_0xf3fb('0x17')](respondWithResult(_0x20308a,null))[_0xf3fb('0x29')](handleError(_0x20308a,null));};exports[_0xf3fb('0x50')]=function(_0x3ec6a5,_0x4fc979){return db[_0xf3fb('0x20')]['find']({'where':{'id':_0x3ec6a5[_0xf3fb('0x2c')]['id']}})[_0xf3fb('0x17')](handleEntityNotFound(_0x4fc979,null))['then'](function(_0xd63905){if(_0xd63905){return _0xd63905[_0xf3fb('0x50')](_0x3ec6a5['query'][_0xf3fb('0x3b')]);}})[_0xf3fb('0x17')](respondWithStatusCode(_0x4fc979,null))['catch'](handleError(_0x4fc979,null));};exports['download']=function(_0x15036d,_0x50d67d){var _0x4240f4=moment()[_0xf3fb('0x51')]()[_0xf3fb('0x52')]();var _0x12b61b=path[_0xf3fb('0x53')](config[_0xf3fb('0x54')],_0xf3fb('0x55'),_0xf3fb('0x56'),'tmp');var _0x19752c=path[_0xf3fb('0x53')](config['root'],_0xf3fb('0x55'),_0xf3fb('0x56'),'attachments');var _0x2d0a51=path['join'](_0x12b61b,_0x4240f4);var _0x1f71fb=util['format'](_0xf3fb('0x57'),_0x15036d[_0xf3fb('0x2c')]['id'],_0x4240f4);var _0x141185=path[_0xf3fb('0x53')](_0x12b61b,_0x1f71fb);var _0x50ca63=[];_0x50ca63[_0xf3fb('0x58')]({'model':db[_0xf3fb('0x59')],'as':'User','attributes':['id','fullname'],'raw':!![]});_0x50ca63[_0xf3fb('0x58')]({'model':db['CmContact'],'as':'Contact','attributes':['id',_0xf3fb('0x5a'),_0xf3fb('0x5b')],'raw':!![]});if(_0x15036d[_0xf3fb('0x27')]['attachments']){_0x50ca63['push']({'model':db[_0xf3fb('0x5c')],'as':_0xf3fb('0x5c'),'raw':!![]});}var _0x2d5872=[{'model':db[_0xf3fb('0x3a')],'as':_0xf3fb('0x5d'),'attributes':['id',_0xf3fb('0x37'),_0xf3fb('0x5e'),'direction',_0xf3fb('0x5f'),_0xf3fb('0x60')],'include':_0x50ca63}];_0x2d5872[_0xf3fb('0x58')]({'model':db[_0xf3fb('0x61')],'as':_0xf3fb('0x62'),'attributes':['id',_0xf3fb('0x1c')]});_0x2d5872[_0xf3fb('0x58')]({'model':db['User'],'as':_0xf3fb('0x63'),'attributes':['id',_0xf3fb('0x64')]});return db[_0xf3fb('0x20')]['find']({'where':{'id':_0x15036d[_0xf3fb('0x2c')]['id']},'include':_0x2d5872})[_0xf3fb('0x17')](handleEntityNotFound(_0x50d67d,null))[_0xf3fb('0x17')](function(_0x42b247){if(_0x42b247){var _0x19930b=_0x42b247[_0xf3fb('0x65')]({'plain':!![]});fs[_0xf3fb('0x66')](_0x2d0a51);var _0x1d0a38={'channel':_0xf3fb('0x67'),'account':_0x19930b[_0xf3fb('0x62')][_0xf3fb('0x1c')],'agent':_0x19930b[_0xf3fb('0x63')]?_0x19930b[_0xf3fb('0x63')][_0xf3fb('0x64')]:_0xf3fb('0x68'),'createdAt':moment(_0x19930b[_0xf3fb('0x5e')])[_0xf3fb('0x46')](_0xf3fb('0x47'))[_0xf3fb('0x52')](),'closedAt':_0x19930b[_0xf3fb('0x69')]?moment(_0x19930b['closedAt'])[_0xf3fb('0x46')](_0xf3fb('0x47'))[_0xf3fb('0x52')]():'','disposition':_0x19930b['disposition'],'visibility':_0x19930b[_0xf3fb('0x6a')]?_0xf3fb('0x6b'):'Private','messages':_(_0x19930b[_0xf3fb('0x5d')])[_0xf3fb('0x43')]({'secret':![]})[_0xf3fb('0x1f')](function(_0x53b540){if(_0x53b540[_0xf3fb('0x5c')]){var _0x5f2527=path[_0xf3fb('0x53')](_0x19752c,_0x53b540[_0xf3fb('0x5c')][_0xf3fb('0x6c')]);if(fs['existsSync'](_0x5f2527)){fs[_0xf3fb('0x6d')](_0x5f2527)['pipe'](fs[_0xf3fb('0x6e')](path[_0xf3fb('0x53')](_0x2d0a51,_0x53b540[_0xf3fb('0x5c')][_0xf3fb('0x6c')])));}}return{'date':moment(_0x53b540[_0xf3fb('0x5e')])['format'](_0xf3fb('0x47'))['toString'](),'sender':_0x53b540[_0xf3fb('0x6f')]===_0xf3fb('0x70')?_0x53b540[_0xf3fb('0x59')]?_0x53b540[_0xf3fb('0x59')][_0xf3fb('0x64')]:'System':_0x53b540['Contact'][_0xf3fb('0x5a')]+(_0x53b540[_0xf3fb('0x71')][_0xf3fb('0x5b')]?'\x20'+_0x53b540[_0xf3fb('0x71')][_0xf3fb('0x5b')]:''),'body':_0x53b540[_0xf3fb('0x5c')]?_0x53b540[_0xf3fb('0x5c')][_0xf3fb('0x6c')]:_0x53b540[_0xf3fb('0x37')],'direction':_0x53b540[_0xf3fb('0x6f')]===_0xf3fb('0x70')?'A':'C','secret':_0x53b540['secret'],'read':_0x53b540['read'],'attachment':_0x53b540[_0xf3fb('0x5c')]};})[_0xf3fb('0x72')]()};return ejs[_0xf3fb('0x73')](path[_0xf3fb('0x53')](config['root'],_0xf3fb('0x55'),'views',_0xf3fb('0x74')),{'interaction':_0x1d0a38})[_0xf3fb('0x17')](function(_0x55bde7){var _0x557765=path[_0xf3fb('0x53')](_0x2d0a51,_0xf3fb('0x75')+_0x19930b['id']+'-'+_0x4240f4+'.pdf');var _0x428ba9={'path':_0x557765,'channel':_0xf3fb('0x67'),'interactionId':_0x19930b['id']};return pdf[_0xf3fb('0x76')](_0x55bde7,_0x428ba9);})[_0xf3fb('0x17')](function(){return new Promise(function(_0x418faf,_0x4b4efe){zipdir(_0x2d0a51,{'saveTo':_0x141185},function(_0x772d9e,_0x1c8f50){if(_0x772d9e)return _0x4b4efe(_0x772d9e);return _0x418faf(_0x1c8f50);});})[_0xf3fb('0x17')](function(){return new Promise(function(_0x5471a1,_0x367679){rimraf(_0x2d0a51,function(_0x2834be){if(_0x2834be)_0x367679(_0x2834be);return _0x5471a1();});});})[_0xf3fb('0x17')](function(){return _0x50d67d[_0xf3fb('0x77')](_0x141185,_0x1f71fb,function(_0x5bf26c){if(_0x5bf26c){logger[_0xf3fb('0x1a')](_0xf3fb('0x78'),_0x5bf26c);}else{fs[_0xf3fb('0x79')](_0x141185);}});});});}else{return _0x50d67d['sendStatus'](0xc8);}})[_0xf3fb('0x29')](handleError(_0x50d67d,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index a1a9d7e..29dff8d 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 _0x56a3=['exports','events','OpenchannelInteraction','OpenchannelMessage','update','remove','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook'];(function(_0x3b12bf,_0x16d6b4){var _0x320dfd=function(_0x57c7f2){while(--_0x57c7f2){_0x3b12bf['push'](_0x3b12bf['shift']());}};_0x320dfd(++_0x16d6b4);}(_0x56a3,0xef));var _0x356a=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x56a3[_0x14add3];return _0x4a174f;};'use strict';var EventEmitter=require(_0x356a('0x0'));var OpenchannelInteraction=require('../../mysqldb')['db'][_0x356a('0x1')];var OpenchannelMessage=require('../../mysqldb')['db'][_0x356a('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x356a('0x3'),'afterDestroy':_0x356a('0x4')};function emitEvent(_0x1dca1e){return function(_0x23cd18,_0x23fb13,_0x5d065b){_0x23cd18['getUsers']({'attributes':['id'],'raw':!![]})[_0x356a('0x5')](function(_0x239f4e){_0x23cd18[_0x356a('0x6')](_0x356a('0x7'),_0x239f4e[_0x356a('0x8')](function(_0xb64824){return{'id':_0xb64824['id']};}));return OpenchannelMessage[_0x356a('0x9')]({'where':{'OpenchannelInteractionId':_0x23cd18['id'],'direction':'in','read':![]},'raw':!![]});})[_0x356a('0x5')](function(_0x291c1b){_0x23cd18[_0x356a('0x6')](_0x356a('0xa'),_0x291c1b[_0x356a('0xb')]);OpenchannelInteractionEvents['emit'](_0x1dca1e+':'+_0x23cd18['id'],_0x23cd18);OpenchannelInteractionEvents[_0x356a('0xc')](_0x1dca1e,_0x23cd18);_0x5d065b(null);})[_0x356a('0xd')](_0x5d065b(null));};}for(var e in events){if(events[_0x356a('0xe')](e)){var event=events[e];OpenchannelInteraction[_0x356a('0xf')](e,emitEvent(event));}}module[_0x356a('0x10')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0x6e51=['map','findAll','unreadMessages','emit','catch','hook','exports','events','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','setMaxListeners','save','remove','getUsers','then','setDataValue','Users'];(function(_0x3e1758,_0x101ccf){var _0x5b555c=function(_0x239d1b){while(--_0x239d1b){_0x3e1758['push'](_0x3e1758['shift']());}};_0x5b555c(++_0x101ccf);}(_0x6e51,0x97));var _0x16e5=function(_0x57715c,_0x263df0){_0x57715c=_0x57715c-0x0;var _0x422e1f=_0x6e51[_0x57715c];return _0x422e1f;};'use strict';var EventEmitter=require(_0x16e5('0x0'));var OpenchannelInteraction=require(_0x16e5('0x1'))['db'][_0x16e5('0x2')];var OpenchannelMessage=require(_0x16e5('0x1'))['db'][_0x16e5('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x16e5('0x4')](0x0);var events={'afterCreate':_0x16e5('0x5'),'afterUpdate':'update','afterDestroy':_0x16e5('0x6')};function emitEvent(_0x1ecf75){return function(_0x1e3bd5,_0x48603d,_0xf82da9){_0x1e3bd5[_0x16e5('0x7')]({'attributes':['id'],'raw':!![]})[_0x16e5('0x8')](function(_0x502886){_0x1e3bd5[_0x16e5('0x9')](_0x16e5('0xa'),_0x502886[_0x16e5('0xb')](function(_0xb9d7d4){return{'id':_0xb9d7d4['id']};}));return OpenchannelMessage[_0x16e5('0xc')]({'where':{'OpenchannelInteractionId':_0x1e3bd5['id'],'direction':'in','read':![]},'raw':!![]});})[_0x16e5('0x8')](function(_0x1accd5){_0x1e3bd5[_0x16e5('0x9')](_0x16e5('0xd'),_0x1accd5['length']);OpenchannelInteractionEvents[_0x16e5('0xe')](_0x1ecf75+':'+_0x1e3bd5['id'],_0x1e3bd5);OpenchannelInteractionEvents[_0x16e5('0xe')](_0x1ecf75,_0x1e3bd5);_0xf82da9(null);})[_0x16e5('0xf')](_0xf82da9(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelInteraction[_0x16e5('0x10')](e,emitEvent(event));}}module[_0x16e5('0x11')]=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index 65adcc0..7f46f51 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 _0x0880=['utf8mb4_unicode_ci','closed','closedAt','lodash','../../config/logger','moment','rimraf','define','OpenchannelInteraction','openchannel_interactions','utf8mb4'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0880,0x7c));var _0x0088=function(_0x53fe97,_0x544271){_0x53fe97=_0x53fe97-0x0;var _0x5c49a2=_0x0880[_0x53fe97];return _0x5c49a2;};'use strict';var _=require(_0x0088('0x0'));var util=require('util');var logger=require(_0x0088('0x1'))('api');var moment=require(_0x0088('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0088('0x3'));var config=require('../../config/environment');var attributes=require('./openchannelInteraction.attributes');module['exports']=function(_0x57f679,_0x53bf5d){return _0x57f679[_0x0088('0x4')](_0x0088('0x5'),attributes,{'tableName':_0x0088('0x6'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x0088('0x7'),'collate':_0x0088('0x8'),'hooks':{'beforeUpdate':function(_0x5ccfb8,_0xe44674,_0x30201b){if(_0x5ccfb8['changed'](_0x0088('0x9'))){_0x5ccfb8[_0x0088('0xa')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x30201b(null,_0x5ccfb8);}}});}; \ No newline at end of file +var _0x468a=['OpenchannelInteraction','openchannel_interactions','utf8mb4','utf8mb4_unicode_ci','changed','format','YYYY-MM-DD\x20HH:mm:ss','util','api','bluebird','path','rimraf','./openchannelInteraction.attributes','define'];(function(_0x44c374,_0x3bcfc3){var _0x2ffe21=function(_0x52e275){while(--_0x52e275){_0x44c374['push'](_0x44c374['shift']());}};_0x2ffe21(++_0x3bcfc3);}(_0x468a,0x13b));var _0xa468=function(_0x33bd08,_0x341570){_0x33bd08=_0x33bd08-0x0;var _0x5e8d7b=_0x468a[_0x33bd08];return _0x5e8d7b;};'use strict';var _=require('lodash');var util=require(_0xa468('0x0'));var logger=require('../../config/logger')(_0xa468('0x1'));var moment=require('moment');var BPromise=require(_0xa468('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa468('0x3'));var rimraf=require(_0xa468('0x4'));var config=require('../../config/environment');var attributes=require(_0xa468('0x5'));module['exports']=function(_0x5c7646,_0x3220f3){return _0x5c7646[_0xa468('0x6')](_0xa468('0x7'),attributes,{'tableName':_0xa468('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa468('0x9'),'collate':_0xa468('0xa'),'hooks':{'beforeUpdate':function(_0x2b6b58,_0x2cd2ea,_0x3f40b0){if(_0x2b6b58[_0xa468('0xb')]('closed')){_0x2b6b58['closedAt']=moment()[_0xa468('0xc')](_0xa468('0xd'));}_0x3f40b0(null,_0x2b6b58);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index 0cc5950..4cf970b 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 _0x5fe0=['omit','spread','AddTags','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','redis','defaults','socket.io-emitter','./openchannelInteraction.socket','register','then','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','OpenchannelInteraction','update','body','options','raw','where','limit','UpdateOpenchannelInteraction','catch','find','addTags','ids'];(function(_0x20f877,_0x5c32af){var _0x5de151=function(_0x4d44de){while(--_0x4d44de){_0x20f877['push'](_0x20f877['shift']());}};_0x5de151(++_0x5c32af);}(_0x5fe0,0x133));var _0x05fe=function(_0x5d792d,_0x52d15d){_0x5d792d=_0x5d792d-0x0;var _0x10a206=_0x5fe0[_0x5d792d];return _0x10a206;};'use strict';var _=require(_0x05fe('0x0'));var util=require(_0x05fe('0x1'));var moment=require('moment');var BPromise=require(_0x05fe('0x2'));var rs=require(_0x05fe('0x3'));var fs=require('fs');var Redis=require(_0x05fe('0x4'));var db=require(_0x05fe('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x05fe('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x05fe('0x7'));var client=jayson[_0x05fe('0x8')]['http']({'port':0x232a});config[_0x05fe('0x9')]=_[_0x05fe('0xa')](config[_0x05fe('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x05fe('0xb'))(new Redis(config[_0x05fe('0x9')]));require(_0x05fe('0xc'))[_0x05fe('0xd')](socket);function respondWithRpcPromise(_0x1f9bad,_0x465f1a,_0x5b65a6){return new BPromise(function(_0xdd99bb,_0x505417){return client['request'](_0x1f9bad,_0x5b65a6)[_0x05fe('0xe')](function(_0x140676){logger['info'](_0x05fe('0xf'),_0x465f1a,_0x05fe('0x10'));logger[_0x05fe('0x11')]('OpenchannelInteraction,\x20%s,\x20%s,\x20%s',_0x465f1a,_0x05fe('0x10'),JSON[_0x05fe('0x12')](_0x140676));if(_0x140676[_0x05fe('0x13')]){if(_0x140676['error']['code']===0x1f4){logger[_0x05fe('0x13')](_0x05fe('0xf'),_0x465f1a,_0x140676[_0x05fe('0x13')][_0x05fe('0x14')]);return _0x505417(_0x140676[_0x05fe('0x13')][_0x05fe('0x14')]);}logger[_0x05fe('0x13')](_0x05fe('0xf'),_0x465f1a,_0x140676['error']['message']);return _0xdd99bb(_0x140676[_0x05fe('0x13')][_0x05fe('0x14')]);}else{logger[_0x05fe('0x15')](_0x05fe('0xf'),_0x465f1a,_0x05fe('0x10'));_0xdd99bb(_0x140676[_0x05fe('0x16')][_0x05fe('0x14')]);}})['catch'](function(_0xf8d7ac){logger[_0x05fe('0x13')](_0x05fe('0xf'),_0x465f1a,_0xf8d7ac);_0x505417(_0xf8d7ac);});});}exports['UpdateOpenchannelInteraction']=function(_0x317ebc){var _0x2d8d7b=this;return new Promise(function(_0x4dbf5e,_0x50ba2c){return db[_0x05fe('0x17')][_0x05fe('0x18')](_0x317ebc[_0x05fe('0x19')],{'raw':_0x317ebc[_0x05fe('0x1a')]?_0x317ebc['options'][_0x05fe('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x317ebc[_0x05fe('0x1a')]?_0x317ebc[_0x05fe('0x1a')][_0x05fe('0x1c')]||null:null,'attributes':_0x317ebc[_0x05fe('0x1a')]?_0x317ebc[_0x05fe('0x1a')]['attributes']||null:null,'limit':_0x317ebc['options']?_0x317ebc[_0x05fe('0x1a')][_0x05fe('0x1d')]||null:null})[_0x05fe('0xe')](function(_0x19bf60){logger[_0x05fe('0x15')]('UpdateOpenchannelInteraction',_0x317ebc);logger[_0x05fe('0x11')](_0x05fe('0x1e'),_0x317ebc,JSON[_0x05fe('0x12')](_0x19bf60));_0x4dbf5e(_0x19bf60);})[_0x05fe('0x1f')](function(_0x2b1410){logger[_0x05fe('0x13')](_0x05fe('0x1e'),_0x2b1410[_0x05fe('0x14')],_0x317ebc);_0x50ba2c(_0x2d8d7b[_0x05fe('0x13')](0x1f4,_0x2b1410[_0x05fe('0x14')]));});});};exports['AddTagsToOpenchannelInteraction']=function(_0x130156){return new Promise(function(_0x3940e8,_0x390c03){return db[_0x05fe('0x17')][_0x05fe('0x20')]({'where':_0x130156[_0x05fe('0x1a')]?_0x130156[_0x05fe('0x1a')][_0x05fe('0x1c')]||null:null})[_0x05fe('0xe')](function(_0x4c5876){if(_0x4c5876){return _0x4c5876[_0x05fe('0x21')](_0x130156['body'][_0x05fe('0x22')],_[_0x05fe('0x23')](_0x130156[_0x05fe('0x19')],[_0x05fe('0x22'),'id'])||{});}})[_0x05fe('0x24')](function(_0x5ddbc0){logger[_0x05fe('0x15')](_0x05fe('0x25'),_0x130156);logger[_0x05fe('0x11')](_0x05fe('0x25'),_0x130156,JSON['stringify'](_0x5ddbc0));_0x3940e8(_0x5ddbc0);})[_0x05fe('0x1f')](function(_0x15e53e){logger[_0x05fe('0x13')](_0x05fe('0x25'),_0x15e53e[_0x05fe('0x14')],_0x130156);_0x390c03(_this[_0x05fe('0x13')](0x1f4,_0x15e53e['message']));});});}; \ No newline at end of file +var _0xc0e9=['debug','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./openchannelInteraction.socket','register','request','OpenchannelInteraction,\x20%s,\x20%s','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','catch','update','options','raw','where','attributes','limit','UpdateOpenchannelInteraction','stringify','OpenchannelInteraction','find','then','body','ids','spread','AddTags'];(function(_0x429fda,_0x4ee60b){var _0x43b7d8=function(_0xa214f1){while(--_0xa214f1){_0x429fda['push'](_0x429fda['shift']());}};_0x43b7d8(++_0x4ee60b);}(_0xc0e9,0x7f));var _0x9c0e=function(_0x3232c0,_0x266df2){_0x3232c0=_0x3232c0-0x0;var _0x579f76=_0xc0e9[_0x3232c0];return _0x579f76;};'use strict';var _=require(_0x9c0e('0x0'));var util=require(_0x9c0e('0x1'));var moment=require(_0x9c0e('0x2'));var BPromise=require(_0x9c0e('0x3'));var rs=require(_0x9c0e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9c0e('0x5'))['db'];var utils=require(_0x9c0e('0x6'));var logger=require(_0x9c0e('0x7'))('rpc');var config=require(_0x9c0e('0x8'));var jayson=require(_0x9c0e('0x9'));var client=jayson[_0x9c0e('0xa')][_0x9c0e('0xb')]({'port':0x232a});config[_0x9c0e('0xc')]=_[_0x9c0e('0xd')](config[_0x9c0e('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x9c0e('0xe'))(new Redis(config[_0x9c0e('0xc')]));require(_0x9c0e('0xf'))[_0x9c0e('0x10')](socket);function respondWithRpcPromise(_0x1f1510,_0x4cffad,_0x5e7b1f){return new BPromise(function(_0x362218,_0x432e4c){return client[_0x9c0e('0x11')](_0x1f1510,_0x5e7b1f)['then'](function(_0x2cb374){logger['info'](_0x9c0e('0x12'),_0x4cffad,'request\x20sent');logger['debug'](_0x9c0e('0x13'),_0x4cffad,_0x9c0e('0x14'),JSON['stringify'](_0x2cb374));if(_0x2cb374['error']){if(_0x2cb374[_0x9c0e('0x15')][_0x9c0e('0x16')]===0x1f4){logger[_0x9c0e('0x15')](_0x9c0e('0x12'),_0x4cffad,_0x2cb374[_0x9c0e('0x15')][_0x9c0e('0x17')]);return _0x432e4c(_0x2cb374[_0x9c0e('0x15')][_0x9c0e('0x17')]);}logger[_0x9c0e('0x15')]('OpenchannelInteraction,\x20%s,\x20%s',_0x4cffad,_0x2cb374['error']['message']);return _0x362218(_0x2cb374[_0x9c0e('0x15')]['message']);}else{logger[_0x9c0e('0x18')](_0x9c0e('0x12'),_0x4cffad,_0x9c0e('0x14'));_0x362218(_0x2cb374['result']['message']);}})[_0x9c0e('0x19')](function(_0x39cf4){logger[_0x9c0e('0x15')](_0x9c0e('0x12'),_0x4cffad,_0x39cf4);_0x432e4c(_0x39cf4);});});}exports['UpdateOpenchannelInteraction']=function(_0x4470c1){var _0x55571b=this;return new Promise(function(_0x470251,_0x1c3f5f){return db['OpenchannelInteraction'][_0x9c0e('0x1a')](_0x4470c1['body'],{'raw':_0x4470c1[_0x9c0e('0x1b')]?_0x4470c1[_0x9c0e('0x1b')][_0x9c0e('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4470c1['options']?_0x4470c1[_0x9c0e('0x1b')][_0x9c0e('0x1d')]||null:null,'attributes':_0x4470c1['options']?_0x4470c1['options'][_0x9c0e('0x1e')]||null:null,'limit':_0x4470c1[_0x9c0e('0x1b')]?_0x4470c1[_0x9c0e('0x1b')][_0x9c0e('0x1f')]||null:null})['then'](function(_0x1f56a3){logger['info'](_0x9c0e('0x20'),_0x4470c1);logger['debug'](_0x9c0e('0x20'),_0x4470c1,JSON[_0x9c0e('0x21')](_0x1f56a3));_0x470251(_0x1f56a3);})[_0x9c0e('0x19')](function(_0x2ccc0a){logger[_0x9c0e('0x15')](_0x9c0e('0x20'),_0x2ccc0a[_0x9c0e('0x17')],_0x4470c1);_0x1c3f5f(_0x55571b[_0x9c0e('0x15')](0x1f4,_0x2ccc0a[_0x9c0e('0x17')]));});});};exports['AddTagsToOpenchannelInteraction']=function(_0x3522f3){return new Promise(function(_0x284fda,_0x4c0d0c){return db[_0x9c0e('0x22')][_0x9c0e('0x23')]({'where':_0x3522f3[_0x9c0e('0x1b')]?_0x3522f3[_0x9c0e('0x1b')][_0x9c0e('0x1d')]||null:null})[_0x9c0e('0x24')](function(_0x182d3f){if(_0x182d3f){return _0x182d3f['addTags'](_0x3522f3[_0x9c0e('0x25')][_0x9c0e('0x26')],_['omit'](_0x3522f3[_0x9c0e('0x25')],[_0x9c0e('0x26'),'id'])||{});}})[_0x9c0e('0x27')](function(_0x262be1){logger[_0x9c0e('0x18')](_0x9c0e('0x28'),_0x3522f3);logger[_0x9c0e('0x29')](_0x9c0e('0x28'),_0x3522f3,JSON[_0x9c0e('0x21')](_0x262be1));_0x284fda(_0x262be1);})[_0x9c0e('0x19')](function(_0x137109){logger[_0x9c0e('0x15')](_0x9c0e('0x28'),_0x137109[_0x9c0e('0x17')],_0x3522f3);_0x4c0d0c(_this['error'](0x1f4,_0x137109['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index 6fe0886..a927ae1 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 _0x44b7=['update','emit','removeListener','register','length','openchannelInteraction:','./openchannelInteraction.events','save','remove'];(function(_0x5a4400,_0xfae3b6){var _0xf9b532=function(_0x39804e){while(--_0x39804e){_0x5a4400['push'](_0x5a4400['shift']());}};_0xf9b532(++_0xfae3b6);}(_0x44b7,0x1d1));var _0x744b=function(_0x5c586b,_0x5b8b3b){_0x5c586b=_0x5c586b-0x0;var _0x518867=_0x44b7[_0x5c586b];return _0x518867;};'use strict';var OpenchannelInteractionEvents=require(_0x744b('0x0'));var events=[_0x744b('0x1'),_0x744b('0x2'),_0x744b('0x3')];function createListener(_0x2164a1,_0x25595e){return function(_0x4a62b0){_0x25595e[_0x744b('0x4')](_0x2164a1,_0x4a62b0);};}function removeListener(_0x40ee1f,_0x3af4a){return function(){OpenchannelInteractionEvents[_0x744b('0x5')](_0x40ee1f,_0x3af4a);};}exports[_0x744b('0x6')]=function(_0x226b49){for(var _0x5da967=0x0,_0x3d2af3=events[_0x744b('0x7')];_0x5da967<_0x3d2af3;_0x5da967++){var _0x4f9512=events[_0x5da967];var _0x560554=createListener(_0x744b('0x8')+_0x4f9512,_0x226b49);OpenchannelInteractionEvents['on'](_0x4f9512,_0x560554);}}; \ No newline at end of file +var _0xcfc8=['remove','update','emit','removeListener','register','length','openchannelInteraction:','save'];(function(_0x3fed4c,_0x359eff){var _0x2a63fb=function(_0x3c556b){while(--_0x3c556b){_0x3fed4c['push'](_0x3fed4c['shift']());}};_0x2a63fb(++_0x359eff);}(_0xcfc8,0xdf));var _0x8cfc=function(_0x332a06,_0x30ecea){_0x332a06=_0x332a06-0x0;var _0x1f7d9e=_0xcfc8[_0x332a06];return _0x1f7d9e;};'use strict';var OpenchannelInteractionEvents=require('./openchannelInteraction.events');var events=[_0x8cfc('0x0'),_0x8cfc('0x1'),_0x8cfc('0x2')];function createListener(_0x9cdbb6,_0x480bf8){return function(_0x241ba0){_0x480bf8[_0x8cfc('0x3')](_0x9cdbb6,_0x241ba0);};}function removeListener(_0x55aa31,_0x526723){return function(){OpenchannelInteractionEvents[_0x8cfc('0x4')](_0x55aa31,_0x526723);};}exports[_0x8cfc('0x5')]=function(_0x419f99){for(var _0x5e98f1=0x0,_0x345fc8=events[_0x8cfc('0x6')];_0x5e98f1<_0x345fc8;_0x5e98f1++){var _0x172b17=events[_0x5e98f1];var _0x522be9=createListener(_0x8cfc('0x7')+_0x172b17,_0x419f99);OpenchannelInteractionEvents['on'](_0x172b17,_0x522be9);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index e7a7e83..ac2de2b 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 _0x70e0=['put','update','/:id/accept','accept','destroy','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelMessage.controller','isAuthenticated','describe','get','/:id','show','post','openchannel','openchannelmessage:create','create'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x70e0,0x17b));var _0x070e=function(_0x41614c,_0xd072c0){_0x41614c=_0x41614c-0x0;var _0x253308=_0x70e0[_0x41614c];return _0x253308;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');var controller=require(_0x070e('0x7'));router['get']('/',auth[_0x070e('0x8')](),controller['index']);router['get']('/describe',auth[_0x070e('0x8')](),controller[_0x070e('0x9')]);router[_0x070e('0xa')](_0x070e('0xb'),auth[_0x070e('0x8')](),controller[_0x070e('0xc')]);router[_0x070e('0xd')]('/',auth['isAuthenticated'](),interaction['tracked'](_0x070e('0xe'),_0x070e('0xf')),controller[_0x070e('0x10')]);router[_0x070e('0x11')](_0x070e('0xb'),auth[_0x070e('0x8')](),controller[_0x070e('0x12')]);router[_0x070e('0x11')](_0x070e('0x13'),auth[_0x070e('0x8')](),controller[_0x070e('0x14')]);router['put']('/:id/reject',auth[_0x070e('0x8')](),controller['reject']);router['delete']('/:id',auth[_0x070e('0x8')](),controller[_0x070e('0x15')]);module['exports']=router; \ No newline at end of file +var _0xa9e0=['index','/describe','show','post','isAuthenticated','tracked','openchannel','openchannelmessage:create','update','put','/:id/accept','accept','reject','delete','/:id','destroy','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelMessage.controller','get'];(function(_0x585ea6,_0x1f16c8){var _0x687b52=function(_0x341a1a){while(--_0x341a1a){_0x585ea6['push'](_0x585ea6['shift']());}};_0x687b52(++_0x1f16c8);}(_0xa9e0,0x123));var _0x0a9e=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xa9e0[_0xc6be3a];return _0x56a310;};'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')](),interaction[_0x0a9e('0xe')](_0x0a9e('0xf'),_0x0a9e('0x10')),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0x11')]);router[_0x0a9e('0x12')](_0x0a9e('0x13'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);router[_0x0a9e('0x12')]('/:id/reject',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x15')]);router[_0x0a9e('0x16')](_0x0a9e('0x17'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x18')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index e72659b..131bf79 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 _0x8130=['BOOLEAN','ENUM','out','STRING','sequelize','exports','medium'];(function(_0x5ac137,_0xcfe00a){var _0x58e835=function(_0x389aed){while(--_0x389aed){_0x5ac137['push'](_0x5ac137['shift']());}};_0x58e835(++_0xcfe00a);}(_0x8130,0x146));var _0x0813=function(_0x37e319,_0x62c8c3){_0x37e319=_0x37e319-0x0;var _0x48a785=_0x8130[_0x37e319];return _0x48a785;};'use strict';var Sequelize=require(_0x0813('0x0'));module[_0x0813('0x1')]={'body':{'type':Sequelize['TEXT'](_0x0813('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x0813('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x0813('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x0813('0x4')]('in',_0x0813('0x5')),'defaultValue':_0x0813('0x5'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x0813('0x6')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x2ca5=['medium','BOOLEAN','out','DATE','STRING','exports','TEXT'];(function(_0x148411,_0x21527a){var _0x2bee9e=function(_0x2daa7a){while(--_0x2daa7a){_0x148411['push'](_0x148411['shift']());}};_0x2bee9e(++_0x21527a);}(_0x2ca5,0x108));var _0x52ca=function(_0x367054,_0x1debc3){_0x367054=_0x367054-0x0;var _0x472454=_0x2ca5[_0x367054];return _0x472454;};'use strict';var Sequelize=require('sequelize');module[_0x52ca('0x0')]={'body':{'type':Sequelize[_0x52ca('0x1')](_0x52ca('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x52ca('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0x52ca('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0x52ca('0x5')]},'providerName':{'type':Sequelize[_0x52ca('0x6')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index a2e60fb..6e00919 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 _0xbe25=['agent','get','OpenchannelInteractionId','isNil','read1stAt','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','fullname','manual','interface','format','SIP/%s','channel','event','openchannel-interactions','reject','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','User','email','internal','EventManager','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','redis','localhost','socket.io-emitter','./openchannelMessage.socket','register','jayson/promise','http','client','request','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','end','undefined','limit','offset','set','Content-Range','apply','save','destroy','stack','name','send','index','map','OpenchannelMessage','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','where','VIRTUAL','merge','options','count','includeAll','include','rows','show','params','keys','rawAttributes','create','body','update','find','accept','openchannel','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user'];(function(_0x550e4f,_0x17adb7){var _0x2c18e5=function(_0xed6cd3){while(--_0xed6cd3){_0x550e4f['push'](_0x550e4f['shift']());}};_0x2c18e5(++_0x17adb7);}(_0xbe25,0x1ab));var _0x5be2=function(_0x42bdad,_0x12836c){_0x42bdad=_0x42bdad-0x0;var _0x122626=_0xbe25[_0x42bdad];return _0x122626;};'use strict';var emlformat=require(_0x5be2('0x0'));var rimraf=require(_0x5be2('0x1'));var zipdir=require(_0x5be2('0x2'));var jsonpatch=require(_0x5be2('0x3'));var rp=require(_0x5be2('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x5be2('0x5'));var sox=require(_0x5be2('0x6'));var csv=require(_0x5be2('0x7'));var ejs=require(_0x5be2('0x8'));var fs=require('fs');var fs_extra=require(_0x5be2('0x9'));var _=require(_0x5be2('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x5be2('0xb'));var deskjs=require(_0x5be2('0xc'));var toCsv=require(_0x5be2('0x7'));var querystring=require(_0x5be2('0xd'));var Papa=require(_0x5be2('0xe'));var Redis=require(_0x5be2('0xf'));var authService=require(_0x5be2('0x10'));var qs=require(_0x5be2('0x11'));var as=require(_0x5be2('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5be2('0x13'))(_0x5be2('0x14'));var utils=require(_0x5be2('0x15'));var config=require(_0x5be2('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x5be2('0x17')]=_['defaults'](config[_0x5be2('0x17')],{'host':_0x5be2('0x18'),'port':0x18eb});var socket=require(_0x5be2('0x19'))(new Redis(config['redis']));require(_0x5be2('0x1a'))[_0x5be2('0x1b')](socket);var jayson=require(_0x5be2('0x1c'));var client=jayson['client'][_0x5be2('0x1d')]({'port':0x232c});var client9002=jayson[_0x5be2('0x1e')][_0x5be2('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x2e1367,_0x4f24bc,_0x14b52d,_0x2560d5){return new BPromise(function(_0x13ce13,_0x3d130a){var _0xc6e1cb=_0x2560d5||client;return _0xc6e1cb[_0x5be2('0x1f')](_0x2e1367,_0x14b52d)[_0x5be2('0x20')](function(_0x44e8aa){logger[_0x5be2('0x21')](_0x5be2('0x22'),_0x4f24bc,_0x5be2('0x23'));logger[_0x5be2('0x24')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x4f24bc,_0x5be2('0x23'),JSON[_0x5be2('0x25')](_0x44e8aa));if(_0x44e8aa['error']){if(_0x44e8aa[_0x5be2('0x26')][_0x5be2('0x27')]===0x1f4){logger[_0x5be2('0x26')]('OpenchannelMessage,\x20%s,\x20%s',_0x4f24bc,_0x44e8aa[_0x5be2('0x26')][_0x5be2('0x28')]);return _0x3d130a(_0x44e8aa[_0x5be2('0x26')][_0x5be2('0x28')]);}logger[_0x5be2('0x26')](_0x5be2('0x22'),_0x4f24bc,_0x44e8aa[_0x5be2('0x26')][_0x5be2('0x28')]);return _0x13ce13(_0x44e8aa['error'][_0x5be2('0x28')]);}else{logger[_0x5be2('0x21')](_0x5be2('0x22'),_0x4f24bc,_0x5be2('0x23'));_0x13ce13(_0x44e8aa[_0x5be2('0x29')][_0x5be2('0x28')]);}})[_0x5be2('0x2a')](function(_0x1bac18){logger[_0x5be2('0x26')]('OpenchannelMessage,\x20%s,\x20%s',_0x4f24bc,_0x1bac18);_0x3d130a(_0x1bac18);});});}function respondWithStatusCode(_0x570a42,_0x25c727){_0x25c727=_0x25c727||0xcc;return function(_0x556c42){if(_0x556c42){return _0x570a42[_0x5be2('0x2b')](_0x25c727);}return _0x570a42[_0x5be2('0x2c')](_0x25c727)[_0x5be2('0x2d')]();};}function respondWithResult(_0x13afa8,_0x44d4e7){_0x44d4e7=_0x44d4e7||0xc8;return function(_0x574de3){if(_0x574de3){return _0x13afa8[_0x5be2('0x2c')](_0x44d4e7)['json'](_0x574de3);}};}function respondWithFilteredResult(_0x2b0f27,_0x4712cb){return function(_0xefbe02){if(_0xefbe02){var _0x4c3016=typeof _0x4712cb['offset']===_0x5be2('0x2e')&&typeof _0x4712cb[_0x5be2('0x2f')]===_0x5be2('0x2e');var _0x34a022=_0xefbe02['count'];var _0x410a13=_0x4c3016?0x0:_0x4712cb[_0x5be2('0x30')];var _0xd120a5=_0x4c3016?_0xefbe02['count']:_0x4712cb[_0x5be2('0x30')]+_0x4712cb[_0x5be2('0x2f')];var _0x4cd8a1;if(_0xd120a5>=_0x34a022){_0xd120a5=_0x34a022;_0x4cd8a1=0xc8;}else{_0x4cd8a1=0xce;}_0x2b0f27['status'](_0x4cd8a1);return _0x2b0f27[_0x5be2('0x31')](_0x5be2('0x32'),_0x410a13+'-'+_0xd120a5+'/'+_0x34a022)['json'](_0xefbe02);}return null;};}function patchUpdates(_0x1d5864){return function(_0x2061b4){try{jsonpatch[_0x5be2('0x33')](_0x2061b4,_0x1d5864,!![]);}catch(_0x21c2a2){return BPromise['reject'](_0x21c2a2);}return _0x2061b4[_0x5be2('0x34')]();};}function saveUpdates(_0x5761b9,_0x1f2e9c){return function(_0x152f17){if(_0x152f17){return _0x152f17['update'](_0x5761b9)['then'](function(_0x5ca899){return _0x5ca899;});}return null;};}function removeEntity(_0x295eb9,_0x105a67){return function(_0x2e4aec){if(_0x2e4aec){return _0x2e4aec[_0x5be2('0x35')]()[_0x5be2('0x20')](function(){_0x295eb9[_0x5be2('0x2c')](0xcc)[_0x5be2('0x2d')]();});}};}function handleEntityNotFound(_0x5d07c7,_0x6f6b93){return function(_0x18fc7a){if(!_0x18fc7a){_0x5d07c7['sendStatus'](0x194);}return _0x18fc7a;};}function handleError(_0xffe3a8,_0x3369d3){_0x3369d3=_0x3369d3||0x1f4;return function(_0x3d8cb9){logger[_0x5be2('0x26')](_0x3d8cb9[_0x5be2('0x36')]);if(_0x3d8cb9['name']){delete _0x3d8cb9[_0x5be2('0x37')];}_0xffe3a8[_0x5be2('0x2c')](_0x3369d3)[_0x5be2('0x38')](_0x3d8cb9);};}exports[_0x5be2('0x39')]=function(_0x3518a1,_0x49dcef){var _0x392ce9={},_0xd3168={},_0x364cbd={'count':0x0,'rows':[]};var _0x29d76a=_[_0x5be2('0x3a')](db[_0x5be2('0x3b')]['rawAttributes'],function(_0x368a21){return{'name':_0x368a21[_0x5be2('0x3c')],'type':_0x368a21[_0x5be2('0x3d')][_0x5be2('0x3e')]};});_0xd3168[_0x5be2('0x3f')]=_[_0x5be2('0x3a')](_0x29d76a,'name');_0xd3168[_0x5be2('0x40')]=_['keys'](_0x3518a1[_0x5be2('0x40')]);_0xd3168[_0x5be2('0x41')]=_[_0x5be2('0x42')](_0xd3168[_0x5be2('0x3f')],_0xd3168[_0x5be2('0x40')]);_0x392ce9[_0x5be2('0x43')]=_[_0x5be2('0x42')](_0xd3168['model'],qs[_0x5be2('0x44')](_0x3518a1[_0x5be2('0x40')]['fields']));_0x392ce9[_0x5be2('0x43')]=_0x392ce9['attributes'][_0x5be2('0x45')]?_0x392ce9[_0x5be2('0x43')]:_0xd3168[_0x5be2('0x3f')];if(!_0x3518a1[_0x5be2('0x40')][_0x5be2('0x46')](_0x5be2('0x47'))){_0x392ce9[_0x5be2('0x2f')]=qs['limit'](_0x3518a1[_0x5be2('0x40')][_0x5be2('0x2f')]);_0x392ce9[_0x5be2('0x30')]=qs[_0x5be2('0x30')](_0x3518a1[_0x5be2('0x40')][_0x5be2('0x30')]);}_0x392ce9['order']=qs[_0x5be2('0x48')](_0x3518a1[_0x5be2('0x40')][_0x5be2('0x48')]);_0x392ce9['where']=qs['filters'](_['pick'](_0x3518a1[_0x5be2('0x40')],_0xd3168[_0x5be2('0x41')]),_0x29d76a);if(_0x3518a1[_0x5be2('0x40')][_0x5be2('0x49')]){_0x392ce9[_0x5be2('0x4a')]=_['merge'](_0x392ce9['where'],{'$or':_[_0x5be2('0x3a')](_0x29d76a,function(_0x13aa85){if(_0x13aa85[_0x5be2('0x3d')]!==_0x5be2('0x4b')){var _0x49a538={};_0x49a538[_0x13aa85[_0x5be2('0x37')]]={'$like':'%'+_0x3518a1[_0x5be2('0x40')][_0x5be2('0x49')]+'%'};return _0x49a538;}})});}_0x392ce9=_[_0x5be2('0x4c')]({},_0x392ce9,_0x3518a1[_0x5be2('0x4d')]);var _0x1cef72={'where':_0x392ce9[_0x5be2('0x4a')]};return db[_0x5be2('0x3b')][_0x5be2('0x4e')](_0x1cef72)[_0x5be2('0x20')](function(_0x8b159f){_0x364cbd[_0x5be2('0x4e')]=_0x8b159f;if(_0x3518a1[_0x5be2('0x40')][_0x5be2('0x4f')]){_0x392ce9[_0x5be2('0x50')]=[{'all':!![]}];}return db[_0x5be2('0x3b')]['findAll'](_0x392ce9);})['then'](function(_0x10bfd3){_0x364cbd[_0x5be2('0x51')]=_0x10bfd3;return _0x364cbd;})[_0x5be2('0x20')](respondWithFilteredResult(_0x49dcef,_0x392ce9))[_0x5be2('0x2a')](handleError(_0x49dcef,null));};exports[_0x5be2('0x52')]=function(_0x325733,_0x198959){var _0x379164={'raw':!![],'where':{'id':_0x325733[_0x5be2('0x53')]['id']}},_0x4ab1f7={};_0x4ab1f7['model']=_[_0x5be2('0x54')](db[_0x5be2('0x3b')][_0x5be2('0x55')]);_0x4ab1f7[_0x5be2('0x40')]=_['keys'](_0x325733[_0x5be2('0x40')]);_0x4ab1f7[_0x5be2('0x41')]=_[_0x5be2('0x42')](_0x4ab1f7['model'],_0x4ab1f7[_0x5be2('0x40')]);_0x379164[_0x5be2('0x43')]=_[_0x5be2('0x42')](_0x4ab1f7[_0x5be2('0x3f')],qs[_0x5be2('0x44')](_0x325733[_0x5be2('0x40')][_0x5be2('0x44')]));_0x379164['attributes']=_0x379164['attributes']['length']?_0x379164[_0x5be2('0x43')]:_0x4ab1f7[_0x5be2('0x3f')];if(_0x325733['query'][_0x5be2('0x4f')]){_0x379164[_0x5be2('0x50')]=[{'all':!![]}];}_0x379164=_[_0x5be2('0x4c')]({},_0x379164,_0x325733['options']);return db[_0x5be2('0x3b')]['find'](_0x379164)['then'](handleEntityNotFound(_0x198959,null))[_0x5be2('0x20')](respondWithResult(_0x198959,null))[_0x5be2('0x2a')](handleError(_0x198959,null));};exports['create']=function(_0x51396e,_0x488786){return db[_0x5be2('0x3b')][_0x5be2('0x56')](_0x51396e[_0x5be2('0x57')],{})[_0x5be2('0x20')](respondWithResult(_0x488786,0xc9))['catch'](handleError(_0x488786,null));};exports[_0x5be2('0x58')]=function(_0x3f5754,_0x3d491d){if(_0x3f5754[_0x5be2('0x57')]['id']){delete _0x3f5754[_0x5be2('0x57')]['id'];}return db[_0x5be2('0x3b')][_0x5be2('0x59')]({'where':{'id':_0x3f5754[_0x5be2('0x53')]['id']}})[_0x5be2('0x20')](handleEntityNotFound(_0x3d491d,null))[_0x5be2('0x20')](saveUpdates(_0x3f5754[_0x5be2('0x57')],null))[_0x5be2('0x20')](respondWithResult(_0x3d491d,null))['catch'](handleError(_0x3d491d,null));};exports['destroy']=function(_0x28fec7,_0x2729b5){return db[_0x5be2('0x3b')][_0x5be2('0x59')]({'where':{'id':_0x28fec7[_0x5be2('0x53')]['id']}})[_0x5be2('0x20')](handleEntityNotFound(_0x2729b5,null))[_0x5be2('0x20')](removeEntity(_0x2729b5,null))[_0x5be2('0x2a')](handleError(_0x2729b5,null));};exports['describe']=function(_0x3c583,_0x2e962c){return db['OpenchannelMessage']['describe']()['then'](respondWithResult(_0x2e962c,null))[_0x5be2('0x2a')](handleError(_0x2e962c,null));};var interaction_log=require(_0x5be2('0x13'))('openchannel-interactions');exports[_0x5be2('0x5a')]=function(_0x37c734,_0x456640,_0x5c4266){var _0x2a54ef={'agent':{},'channel':_0x5be2('0x5b')};if(_0x37c734['body']['id']){delete _0x37c734[_0x5be2('0x57')]['id'];}_0x37c734[_0x5be2('0x57')][_0x5be2('0x5c')]=!![];_0x37c734[_0x5be2('0x57')][_0x5be2('0x5d')]=moment()['format'](_0x5be2('0x5e'));_0x37c734[_0x5be2('0x57')][_0x5be2('0x5f')]=_0x37c734[_0x5be2('0x57')][_0x5be2('0x5f')]||_0x37c734[_0x5be2('0x60')]['id'];_0x2a54ef[_0x5be2('0x61')]['id']=_0x37c734['body'][_0x5be2('0x5f')];return db['OpenchannelMessage'][_0x5be2('0x59')]({'where':{'id':_0x37c734['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x456640,null))[_0x5be2('0x20')](saveUpdates(_0x37c734[_0x5be2('0x57')],null))[_0x5be2('0x20')](function(_0xcd8756){if(_0xcd8756){_0x2a54ef[_0x5be2('0x28')]=_0xcd8756[_0x5be2('0x62')]({'plain':!![]});return db['OpenchannelInteraction'][_0x5be2('0x59')]({'where':{'id':_0xcd8756[_0x5be2('0x63')]}});}return null;})[_0x5be2('0x20')](handleEntityNotFound(_0x456640,null))[_0x5be2('0x20')](function(_0x30265d){if(_0x30265d){return _0x30265d[_0x5be2('0x58')]({'UserId':_0x37c734[_0x5be2('0x57')][_0x5be2('0x5f')],'read1stAt':_[_0x5be2('0x64')](_0x30265d[_0x5be2('0x65')])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x5be2('0x20')](function(_0x50748e){if(_0x50748e){_0x2a54ef[_0x5be2('0x66')]=_0x50748e['get']({'plain':!![]});interaction_log['info'](_0x5be2('0x67'),_0x37c734[_0x5be2('0x60')]['id'],_0x37c734['user'][_0x5be2('0x37')],_0x37c734[_0x5be2('0x60')][_0x5be2('0x68')],_0x2a54ef[_0x5be2('0x66')]['id'],_0x37c734[_0x5be2('0x57')]?JSON['stringify'](_0x37c734[_0x5be2('0x57')]):_0x5be2('0x69'));return respondWithRpcPromise(_0x5be2('0x6a'),'acceptMessage',_0x2a54ef);}return null;})[_0x5be2('0x20')](function(_0x18ae93){var _0x5a2950=_0x5be2('0x6b')+_0x18ae93['message'][_0x5be2('0x6c')];return db[_0x5be2('0x6d')][_0x5be2('0x40')](_0x5a2950,{'type':db[_0x5be2('0x6e')][_0x5be2('0x6f')][_0x5be2('0x70')],'raw':!![]})[_0x5be2('0x20')](function(_0x561600){return _0x561600;});})[_0x5be2('0x20')](function(_0x5197a7){if(_0x5197a7){_0x2a54ef['message'][_0x5be2('0x71')]=_0x5197a7[0x0];if(!_0x37c734[_0x5be2('0x57')][_0x5be2('0x5f')])return;return db['User'][_0x5be2('0x59')]({'where':{'id':_0x37c734[_0x5be2('0x57')]['UserId'],'role':_0x5be2('0x61')},'attributes':['id',_0x5be2('0x37'),_0x5be2('0x72'),'email','internal'],'raw':!![]});}return null;})['then'](function(_0x2f0ec2){if(!_0x2f0ec2)return null;_0x2a54ef[_0x5be2('0x28')][_0x5be2('0x61')]=_0x2f0ec2;return _0x2a54ef;})[_0x5be2('0x20')](function(_0x493999){if(_0x493999){if(_0x37c734[_0x5be2('0x57')][_0x5be2('0x73')]){_0x2a54ef[_0x5be2('0x28')][_0x5be2('0x74')]=util[_0x5be2('0x75')](_0x5be2('0x76'),_0x37c734[_0x5be2('0x60')][_0x5be2('0x37')]);_0x2a54ef[_0x5be2('0x28')]['channel']=_0x2a54ef[_0x5be2('0x77')];_0x2a54ef[_0x5be2('0x28')]['motionChannel']=_0x2a54ef['channel'];_0x2a54ef[_0x5be2('0x28')][_0x5be2('0x78')]=_0x5be2('0x5a');return respondWithRpcPromise('EventManager','EventManager',{'event':'acceptmessage','message':_0x2a54ef[_0x5be2('0x28')]},client9002)[_0x5be2('0x20')](function(){return _0x2a54ef;});}return _0x2a54ef;}return null;})[_0x5be2('0x20')](respondWithResult(_0x456640,null))[_0x5be2('0x2a')](handleError(_0x456640,null));};var interaction_log=require(_0x5be2('0x13'))(_0x5be2('0x79'));exports[_0x5be2('0x7a')]=function(_0x18cf6c,_0x15c221,_0x1610ef){var _0xfc1585={'agent':{},'channel':'openchannel'};if(_0x18cf6c[_0x5be2('0x57')]['id']){delete _0x18cf6c[_0x5be2('0x57')]['id'];}_0x18cf6c[_0x5be2('0x57')][_0x5be2('0x5f')]=_0x18cf6c['body'][_0x5be2('0x5f')]||_0x18cf6c[_0x5be2('0x60')]['id'];_0xfc1585[_0x5be2('0x61')]['id']=_0x18cf6c[_0x5be2('0x57')][_0x5be2('0x5f')];return db['OpenchannelMessage'][_0x5be2('0x59')]({'where':{'id':_0x18cf6c['params']['id'],'UserId':null}})[_0x5be2('0x20')](handleEntityNotFound(_0x15c221,null))[_0x5be2('0x20')](function(_0x4bc69c){if(_0x4bc69c){_0xfc1585['message']=_0x4bc69c[_0x5be2('0x62')]({'plain':!![]});return db['OpenchannelInteraction'][_0x5be2('0x59')]({'where':{'id':_0x4bc69c[_0x5be2('0x63')]}});}return null;})['then'](handleEntityNotFound(_0x15c221,null))['then'](function(_0x31e79f){if(_0x31e79f){_0xfc1585[_0x5be2('0x66')]=_0x31e79f['get']({'plain':!![]});interaction_log[_0x5be2('0x21')](_0x5be2('0x7b'),_0x18cf6c[_0x5be2('0x60')]['id'],_0x18cf6c[_0x5be2('0x60')][_0x5be2('0x37')],_0x18cf6c[_0x5be2('0x60')]['role'],_0xfc1585[_0x5be2('0x66')]['id'],_0x18cf6c[_0x5be2('0x57')]?JSON['stringify'](_0x18cf6c['body']):_0x5be2('0x69'));return respondWithRpcPromise(_0x5be2('0x7c'),_0x5be2('0x7d'),_0xfc1585);}return null;})[_0x5be2('0x20')](function(_0x28c541){var _0x51ad36=_0x5be2('0x6b')+_0x28c541[_0x5be2('0x28')][_0x5be2('0x6c')];return db['sequelize'][_0x5be2('0x40')](_0x51ad36,{'type':db['Sequelize'][_0x5be2('0x6f')]['SELECT'],'raw':!![]})['then'](function(_0x1aed4f){return _0x1aed4f;});})[_0x5be2('0x20')](function(_0x1cdf70){if(_0x1cdf70){_0xfc1585['message']['contact']=_0x1cdf70[0x0];if(!_0x18cf6c[_0x5be2('0x57')][_0x5be2('0x5f')])return;return db[_0x5be2('0x7e')][_0x5be2('0x59')]({'where':{'id':_0x18cf6c[_0x5be2('0x57')]['UserId'],'role':_0x5be2('0x61')},'attributes':['id',_0x5be2('0x37'),_0x5be2('0x72'),_0x5be2('0x7f'),_0x5be2('0x80')],'raw':!![]});}return null;})[_0x5be2('0x20')](function(_0x2cc3a1){if(!_0x2cc3a1)return null;_0xfc1585[_0x5be2('0x28')][_0x5be2('0x61')]=_0x2cc3a1;return _0xfc1585;})[_0x5be2('0x20')](function(_0x2e8c80){if(_0x2e8c80){_0x2e8c80[_0x5be2('0x28')][_0x5be2('0x74')]=util[_0x5be2('0x75')](_0x5be2('0x76'),_0x18cf6c['user'][_0x5be2('0x37')]);_0x2e8c80['message'][_0x5be2('0x77')]=_0xfc1585[_0x5be2('0x77')];_0x2e8c80[_0x5be2('0x28')]['motionChannel']=_0xfc1585['channel'];_0x2e8c80['message']['event']=_0x5be2('0x7a');respondWithRpcPromise('EventManager',_0x5be2('0x81'),{'event':_0x5be2('0x82'),'message':_0x2e8c80[_0x5be2('0x28')]},client9002);return _0xfc1585;}return null;})['then'](respondWithResult(_0x15c221,null))[_0x5be2('0x2a')](handleError(_0x15c221,null));}; \ No newline at end of file +var _0x1751=['ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','status','end','limit','undefined','offset','set','Content-Range','apply','save','update','then','name','map','OpenchannelMessage','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','VIRTUAL','filter','options','count','include','findAll','rows','show','params','find','create','describe','accept','openchannel','body','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','OpenchannelInteraction','OpenchannelInteractionId','isNil','interaction','role','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','openchannel-interactions','reject','RejectMessage','email','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv'];(function(_0x273033,_0x24f181){var _0x1e6b54=function(_0x48750e){while(--_0x48750e){_0x273033['push'](_0x273033['shift']());}};_0x1e6b54(++_0x24f181);}(_0x1751,0x76));var _0x1175=function(_0x5c0f28,_0x5b7fb1){_0x5c0f28=_0x5c0f28-0x0;var _0x26747c=_0x1751[_0x5c0f28];return _0x26747c;};'use strict';var emlformat=require(_0x1175('0x0'));var rimraf=require(_0x1175('0x1'));var zipdir=require(_0x1175('0x2'));var jsonpatch=require(_0x1175('0x3'));var rp=require('request-promise');var moment=require(_0x1175('0x4'));var BPromise=require(_0x1175('0x5'));var Mustache=require(_0x1175('0x6'));var util=require(_0x1175('0x7'));var path=require(_0x1175('0x8'));var sox=require(_0x1175('0x9'));var csv=require(_0x1175('0xa'));var ejs=require(_0x1175('0xb'));var fs=require('fs');var fs_extra=require(_0x1175('0xc'));var _=require(_0x1175('0xd'));var squel=require(_0x1175('0xe'));var crypto=require(_0x1175('0xf'));var jsforce=require(_0x1175('0x10'));var deskjs=require(_0x1175('0x11'));var toCsv=require(_0x1175('0xa'));var querystring=require(_0x1175('0x12'));var Papa=require(_0x1175('0x13'));var Redis=require(_0x1175('0x14'));var authService=require(_0x1175('0x15'));var qs=require(_0x1175('0x16'));var as=require(_0x1175('0x17'));var hardwareService=require(_0x1175('0x18'));var logger=require(_0x1175('0x19'))(_0x1175('0x1a'));var utils=require(_0x1175('0x1b'));var config=require(_0x1175('0x1c'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x1175('0x1d')]=_[_0x1175('0x1e')](config['redis'],{'host':_0x1175('0x1f'),'port':0x18eb});var socket=require(_0x1175('0x20'))(new Redis(config[_0x1175('0x1d')]));require('./openchannelMessage.socket')[_0x1175('0x21')](socket);var jayson=require(_0x1175('0x22'));var client=jayson[_0x1175('0x23')]['http']({'port':0x232c});var client9002=jayson[_0x1175('0x23')]['http']({'port':0x232a});function respondWithRpcPromise(_0x14be3c,_0x43b6b1,_0x2a9bc4,_0x2585be){return new BPromise(function(_0x5c1a14,_0x18119f){var _0xaa45d=_0x2585be||client;return _0xaa45d['request'](_0x14be3c,_0x2a9bc4)['then'](function(_0x40b685){logger[_0x1175('0x24')](_0x1175('0x25'),_0x43b6b1,_0x1175('0x26'));logger[_0x1175('0x27')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x43b6b1,_0x1175('0x26'),JSON[_0x1175('0x28')](_0x40b685));if(_0x40b685[_0x1175('0x29')]){if(_0x40b685[_0x1175('0x29')][_0x1175('0x2a')]===0x1f4){logger[_0x1175('0x29')]('OpenchannelMessage,\x20%s,\x20%s',_0x43b6b1,_0x40b685['error'][_0x1175('0x2b')]);return _0x18119f(_0x40b685[_0x1175('0x29')][_0x1175('0x2b')]);}logger[_0x1175('0x29')](_0x1175('0x25'),_0x43b6b1,_0x40b685[_0x1175('0x29')][_0x1175('0x2b')]);return _0x5c1a14(_0x40b685['error'][_0x1175('0x2b')]);}else{logger[_0x1175('0x24')](_0x1175('0x25'),_0x43b6b1,_0x1175('0x26'));_0x5c1a14(_0x40b685[_0x1175('0x2c')][_0x1175('0x2b')]);}})[_0x1175('0x2d')](function(_0x5a3dc9){logger[_0x1175('0x29')](_0x1175('0x25'),_0x43b6b1,_0x5a3dc9);_0x18119f(_0x5a3dc9);});});}function respondWithStatusCode(_0x38cf17,_0x5ad9b5){_0x5ad9b5=_0x5ad9b5||0xcc;return function(_0x491901){if(_0x491901){return _0x38cf17['sendStatus'](_0x5ad9b5);}return _0x38cf17[_0x1175('0x2e')](_0x5ad9b5)[_0x1175('0x2f')]();};}function respondWithResult(_0x3fd476,_0x5e4ac6){_0x5e4ac6=_0x5e4ac6||0xc8;return function(_0x5884a3){if(_0x5884a3){return _0x3fd476['status'](_0x5e4ac6)['json'](_0x5884a3);}};}function respondWithFilteredResult(_0x3abc9c,_0x3db0f7){return function(_0x1fabfb){if(_0x1fabfb){var _0x1e29d0=typeof _0x3db0f7['offset']==='undefined'&&typeof _0x3db0f7[_0x1175('0x30')]===_0x1175('0x31');var _0x57f7a8=_0x1fabfb['count'];var _0x5b6bfb=_0x1e29d0?0x0:_0x3db0f7[_0x1175('0x32')];var _0x305939=_0x1e29d0?_0x1fabfb['count']:_0x3db0f7[_0x1175('0x32')]+_0x3db0f7[_0x1175('0x30')];var _0x135d1b;if(_0x305939>=_0x57f7a8){_0x305939=_0x57f7a8;_0x135d1b=0xc8;}else{_0x135d1b=0xce;}_0x3abc9c[_0x1175('0x2e')](_0x135d1b);return _0x3abc9c[_0x1175('0x33')](_0x1175('0x34'),_0x5b6bfb+'-'+_0x305939+'/'+_0x57f7a8)['json'](_0x1fabfb);}return null;};}function patchUpdates(_0x3a32ec){return function(_0x399f53){try{jsonpatch[_0x1175('0x35')](_0x399f53,_0x3a32ec,!![]);}catch(_0x35929e){return BPromise['reject'](_0x35929e);}return _0x399f53[_0x1175('0x36')]();};}function saveUpdates(_0x5c0b9f,_0x476822){return function(_0x115e62){if(_0x115e62){return _0x115e62[_0x1175('0x37')](_0x5c0b9f)[_0x1175('0x38')](function(_0x6ec44b){return _0x6ec44b;});}return null;};}function removeEntity(_0x28bbb7,_0x574d77){return function(_0x49ed96){if(_0x49ed96){return _0x49ed96['destroy']()[_0x1175('0x38')](function(){_0x28bbb7[_0x1175('0x2e')](0xcc)[_0x1175('0x2f')]();});}};}function handleEntityNotFound(_0x40d809,_0x1661ae){return function(_0x2beda3){if(!_0x2beda3){_0x40d809['sendStatus'](0x194);}return _0x2beda3;};}function handleError(_0x4a10cd,_0x3862f4){_0x3862f4=_0x3862f4||0x1f4;return function(_0x325cb7){logger[_0x1175('0x29')](_0x325cb7['stack']);if(_0x325cb7[_0x1175('0x39')]){delete _0x325cb7[_0x1175('0x39')];}_0x4a10cd[_0x1175('0x2e')](_0x3862f4)['send'](_0x325cb7);};}exports['index']=function(_0x57650d,_0x177715){var _0x561023={},_0x20e9b1={},_0x23c0fc={'count':0x0,'rows':[]};var _0x43bb01=_[_0x1175('0x3a')](db[_0x1175('0x3b')][_0x1175('0x3c')],function(_0x2240d2){return{'name':_0x2240d2[_0x1175('0x3d')],'type':_0x2240d2[_0x1175('0x3e')][_0x1175('0x3f')]};});_0x20e9b1[_0x1175('0x40')]=_[_0x1175('0x3a')](_0x43bb01,_0x1175('0x39'));_0x20e9b1[_0x1175('0x41')]=_[_0x1175('0x42')](_0x57650d[_0x1175('0x41')]);_0x20e9b1['filters']=_[_0x1175('0x43')](_0x20e9b1[_0x1175('0x40')],_0x20e9b1[_0x1175('0x41')]);_0x561023['attributes']=_[_0x1175('0x43')](_0x20e9b1[_0x1175('0x40')],qs[_0x1175('0x44')](_0x57650d[_0x1175('0x41')][_0x1175('0x44')]));_0x561023['attributes']=_0x561023[_0x1175('0x45')][_0x1175('0x46')]?_0x561023[_0x1175('0x45')]:_0x20e9b1[_0x1175('0x40')];if(!_0x57650d['query'][_0x1175('0x47')](_0x1175('0x48'))){_0x561023[_0x1175('0x30')]=qs['limit'](_0x57650d[_0x1175('0x41')]['limit']);_0x561023[_0x1175('0x32')]=qs[_0x1175('0x32')](_0x57650d[_0x1175('0x41')][_0x1175('0x32')]);}_0x561023[_0x1175('0x49')]=qs[_0x1175('0x4a')](_0x57650d[_0x1175('0x41')][_0x1175('0x4a')]);_0x561023[_0x1175('0x4b')]=qs[_0x1175('0x4c')](_['pick'](_0x57650d['query'],_0x20e9b1[_0x1175('0x4c')]),_0x43bb01);if(_0x57650d[_0x1175('0x41')]['filter']){_0x561023[_0x1175('0x4b')]=_[_0x1175('0x4d')](_0x561023['where'],{'$or':_[_0x1175('0x3a')](_0x43bb01,function(_0x1ed96f){if(_0x1ed96f[_0x1175('0x3e')]!==_0x1175('0x4e')){var _0x18e8d5={};_0x18e8d5[_0x1ed96f[_0x1175('0x39')]]={'$like':'%'+_0x57650d[_0x1175('0x41')][_0x1175('0x4f')]+'%'};return _0x18e8d5;}})});}_0x561023=_[_0x1175('0x4d')]({},_0x561023,_0x57650d[_0x1175('0x50')]);var _0x2e49d9={'where':_0x561023[_0x1175('0x4b')]};return db[_0x1175('0x3b')][_0x1175('0x51')](_0x2e49d9)[_0x1175('0x38')](function(_0x33f2c1){_0x23c0fc[_0x1175('0x51')]=_0x33f2c1;if(_0x57650d['query']['includeAll']){_0x561023[_0x1175('0x52')]=[{'all':!![]}];}return db[_0x1175('0x3b')][_0x1175('0x53')](_0x561023);})['then'](function(_0x2f69f5){_0x23c0fc[_0x1175('0x54')]=_0x2f69f5;return _0x23c0fc;})[_0x1175('0x38')](respondWithFilteredResult(_0x177715,_0x561023))[_0x1175('0x2d')](handleError(_0x177715,null));};exports[_0x1175('0x55')]=function(_0x92cca9,_0x49b6c6){var _0x71c6bc={'raw':!![],'where':{'id':_0x92cca9[_0x1175('0x56')]['id']}},_0x3a44a6={};_0x3a44a6[_0x1175('0x40')]=_[_0x1175('0x42')](db[_0x1175('0x3b')][_0x1175('0x3c')]);_0x3a44a6[_0x1175('0x41')]=_[_0x1175('0x42')](_0x92cca9['query']);_0x3a44a6['filters']=_[_0x1175('0x43')](_0x3a44a6[_0x1175('0x40')],_0x3a44a6[_0x1175('0x41')]);_0x71c6bc[_0x1175('0x45')]=_['intersection'](_0x3a44a6[_0x1175('0x40')],qs['fields'](_0x92cca9['query'][_0x1175('0x44')]));_0x71c6bc[_0x1175('0x45')]=_0x71c6bc[_0x1175('0x45')]['length']?_0x71c6bc[_0x1175('0x45')]:_0x3a44a6[_0x1175('0x40')];if(_0x92cca9[_0x1175('0x41')]['includeAll']){_0x71c6bc['include']=[{'all':!![]}];}_0x71c6bc=_[_0x1175('0x4d')]({},_0x71c6bc,_0x92cca9[_0x1175('0x50')]);return db[_0x1175('0x3b')][_0x1175('0x57')](_0x71c6bc)[_0x1175('0x38')](handleEntityNotFound(_0x49b6c6,null))[_0x1175('0x38')](respondWithResult(_0x49b6c6,null))[_0x1175('0x2d')](handleError(_0x49b6c6,null));};exports[_0x1175('0x58')]=function(_0x213b7c,_0x191b44){return db[_0x1175('0x3b')][_0x1175('0x58')](_0x213b7c['body'],{})['then'](respondWithResult(_0x191b44,0xc9))[_0x1175('0x2d')](handleError(_0x191b44,null));};exports[_0x1175('0x37')]=function(_0x527c58,_0x306160){if(_0x527c58['body']['id']){delete _0x527c58['body']['id'];}return db[_0x1175('0x3b')][_0x1175('0x57')]({'where':{'id':_0x527c58[_0x1175('0x56')]['id']}})[_0x1175('0x38')](handleEntityNotFound(_0x306160,null))[_0x1175('0x38')](saveUpdates(_0x527c58['body'],null))['then'](respondWithResult(_0x306160,null))['catch'](handleError(_0x306160,null));};exports['destroy']=function(_0x3070b7,_0x2e2654){return db['OpenchannelMessage'][_0x1175('0x57')]({'where':{'id':_0x3070b7[_0x1175('0x56')]['id']}})[_0x1175('0x38')](handleEntityNotFound(_0x2e2654,null))[_0x1175('0x38')](removeEntity(_0x2e2654,null))[_0x1175('0x2d')](handleError(_0x2e2654,null));};exports[_0x1175('0x59')]=function(_0x12d02d,_0x23316e){return db[_0x1175('0x3b')][_0x1175('0x59')]()['then'](respondWithResult(_0x23316e,null))[_0x1175('0x2d')](handleError(_0x23316e,null));};var interaction_log=require(_0x1175('0x19'))('openchannel-interactions');exports[_0x1175('0x5a')]=function(_0x2e03be,_0x4606c8,_0xcab9c4){var _0x470f8b={'agent':{},'channel':_0x1175('0x5b')};if(_0x2e03be[_0x1175('0x5c')]['id']){delete _0x2e03be['body']['id'];}_0x2e03be[_0x1175('0x5c')][_0x1175('0x5d')]=!![];_0x2e03be['body'][_0x1175('0x5e')]=moment()[_0x1175('0x5f')](_0x1175('0x60'));_0x2e03be[_0x1175('0x5c')][_0x1175('0x61')]=_0x2e03be['body']['UserId']||_0x2e03be[_0x1175('0x62')]['id'];_0x470f8b[_0x1175('0x63')]['id']=_0x2e03be['body'][_0x1175('0x61')];return db['OpenchannelMessage']['find']({'where':{'id':_0x2e03be[_0x1175('0x56')]['id'],'UserId':null}})[_0x1175('0x38')](handleEntityNotFound(_0x4606c8,null))['then'](saveUpdates(_0x2e03be[_0x1175('0x5c')],null))[_0x1175('0x38')](function(_0xa3f39f){if(_0xa3f39f){_0x470f8b[_0x1175('0x2b')]=_0xa3f39f[_0x1175('0x64')]({'plain':!![]});return db[_0x1175('0x65')][_0x1175('0x57')]({'where':{'id':_0xa3f39f[_0x1175('0x66')]}});}return null;})['then'](handleEntityNotFound(_0x4606c8,null))['then'](function(_0x2bc197){if(_0x2bc197){return _0x2bc197['update']({'UserId':_0x2e03be[_0x1175('0x5c')][_0x1175('0x61')],'read1stAt':_[_0x1175('0x67')](_0x2bc197['read1stAt'])?moment()[_0x1175('0x5f')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x1c912a){if(_0x1c912a){_0x470f8b[_0x1175('0x68')]=_0x1c912a[_0x1175('0x64')]({'plain':!![]});interaction_log[_0x1175('0x24')]('[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2e03be['user']['id'],_0x2e03be[_0x1175('0x62')][_0x1175('0x39')],_0x2e03be['user'][_0x1175('0x69')],_0x470f8b['interaction']['id'],_0x2e03be[_0x1175('0x5c')]?JSON[_0x1175('0x28')](_0x2e03be['body']):'null');return respondWithRpcPromise(_0x1175('0x6a'),'acceptMessage',_0x470f8b);}return null;})[_0x1175('0x38')](function(_0x27ab44){var _0x3f7b68=_0x1175('0x6b')+_0x27ab44[_0x1175('0x2b')][_0x1175('0x6c')];return db[_0x1175('0x6d')][_0x1175('0x41')](_0x3f7b68,{'type':db[_0x1175('0x6e')][_0x1175('0x6f')][_0x1175('0x70')],'raw':!![]})[_0x1175('0x38')](function(_0x47ca2e){return _0x47ca2e;});})['then'](function(_0x1c3d8d){if(_0x1c3d8d){_0x470f8b['message'][_0x1175('0x71')]=_0x1c3d8d[0x0];if(!_0x2e03be['body'][_0x1175('0x61')])return;return db[_0x1175('0x72')][_0x1175('0x57')]({'where':{'id':_0x2e03be[_0x1175('0x5c')][_0x1175('0x61')],'role':_0x1175('0x63')},'attributes':['id',_0x1175('0x39'),_0x1175('0x73'),'email',_0x1175('0x74')],'raw':!![]});}return null;})[_0x1175('0x38')](function(_0x56b312){if(!_0x56b312)return null;_0x470f8b[_0x1175('0x2b')][_0x1175('0x63')]=_0x56b312;return _0x470f8b;})['then'](function(_0x477bee){if(_0x477bee){if(_0x2e03be[_0x1175('0x5c')][_0x1175('0x75')]){_0x470f8b[_0x1175('0x2b')][_0x1175('0x76')]=util[_0x1175('0x5f')](_0x1175('0x77'),_0x2e03be[_0x1175('0x62')]['name']);_0x470f8b['message'][_0x1175('0x78')]=_0x470f8b[_0x1175('0x78')];_0x470f8b[_0x1175('0x2b')][_0x1175('0x79')]=_0x470f8b[_0x1175('0x78')];_0x470f8b[_0x1175('0x2b')][_0x1175('0x7a')]=_0x1175('0x5a');return respondWithRpcPromise(_0x1175('0x7b'),'EventManager',{'event':'acceptmessage','message':_0x470f8b[_0x1175('0x2b')]},client9002)[_0x1175('0x38')](function(){return _0x470f8b;});}return _0x470f8b;}return null;})['then'](respondWithResult(_0x4606c8,null))[_0x1175('0x2d')](handleError(_0x4606c8,null));};var interaction_log=require(_0x1175('0x19'))(_0x1175('0x7c'));exports[_0x1175('0x7d')]=function(_0x4251f9,_0x593109,_0x2ac4e2){var _0x30e4a7={'agent':{},'channel':_0x1175('0x5b')};if(_0x4251f9[_0x1175('0x5c')]['id']){delete _0x4251f9[_0x1175('0x5c')]['id'];}_0x4251f9[_0x1175('0x5c')][_0x1175('0x61')]=_0x4251f9[_0x1175('0x5c')][_0x1175('0x61')]||_0x4251f9[_0x1175('0x62')]['id'];_0x30e4a7['agent']['id']=_0x4251f9['body']['UserId'];return db[_0x1175('0x3b')][_0x1175('0x57')]({'where':{'id':_0x4251f9[_0x1175('0x56')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x593109,null))[_0x1175('0x38')](function(_0x1f9722){if(_0x1f9722){_0x30e4a7[_0x1175('0x2b')]=_0x1f9722[_0x1175('0x64')]({'plain':!![]});return db['OpenchannelInteraction'][_0x1175('0x57')]({'where':{'id':_0x1f9722[_0x1175('0x66')]}});}return null;})[_0x1175('0x38')](handleEntityNotFound(_0x593109,null))[_0x1175('0x38')](function(_0x4a1311){if(_0x4a1311){_0x30e4a7[_0x1175('0x68')]=_0x4a1311[_0x1175('0x64')]({'plain':!![]});interaction_log['info']('[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x4251f9['user']['id'],_0x4251f9[_0x1175('0x62')][_0x1175('0x39')],_0x4251f9['user']['role'],_0x30e4a7['interaction']['id'],_0x4251f9[_0x1175('0x5c')]?JSON['stringify'](_0x4251f9['body']):'null');return respondWithRpcPromise(_0x1175('0x7e'),'rejectMessage',_0x30e4a7);}return null;})[_0x1175('0x38')](function(_0xf28135){var _0x365dc9=_0x1175('0x6b')+_0xf28135[_0x1175('0x2b')][_0x1175('0x6c')];return db[_0x1175('0x6d')]['query'](_0x365dc9,{'type':db['Sequelize'][_0x1175('0x6f')]['SELECT'],'raw':!![]})[_0x1175('0x38')](function(_0x1bb019){return _0x1bb019;});})[_0x1175('0x38')](function(_0x196f82){if(_0x196f82){_0x30e4a7['message'][_0x1175('0x71')]=_0x196f82[0x0];if(!_0x4251f9[_0x1175('0x5c')]['UserId'])return;return db[_0x1175('0x72')]['find']({'where':{'id':_0x4251f9[_0x1175('0x5c')][_0x1175('0x61')],'role':'agent'},'attributes':['id',_0x1175('0x39'),_0x1175('0x73'),_0x1175('0x7f'),_0x1175('0x74')],'raw':!![]});}return null;})[_0x1175('0x38')](function(_0x1820d5){if(!_0x1820d5)return null;_0x30e4a7[_0x1175('0x2b')]['agent']=_0x1820d5;return _0x30e4a7;})[_0x1175('0x38')](function(_0x2d533d){if(_0x2d533d){_0x2d533d[_0x1175('0x2b')]['interface']=util[_0x1175('0x5f')]('SIP/%s',_0x4251f9[_0x1175('0x62')][_0x1175('0x39')]);_0x2d533d[_0x1175('0x2b')][_0x1175('0x78')]=_0x30e4a7[_0x1175('0x78')];_0x2d533d[_0x1175('0x2b')][_0x1175('0x79')]=_0x30e4a7[_0x1175('0x78')];_0x2d533d[_0x1175('0x2b')]['event']=_0x1175('0x7d');respondWithRpcPromise(_0x1175('0x7b'),_0x1175('0x7b'),{'event':_0x1175('0x80'),'message':_0x2d533d['message']},client9002);return _0x30e4a7;}return null;})[_0x1175('0x38')](respondWithResult(_0x593109,null))['catch'](handleError(_0x593109,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index d4e9799..7755b70 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 _0x6c02=['remove','emit','../../mysqldb','setMaxListeners','save','update'];(function(_0x4ae191,_0x3f68a2){var _0x2e0158=function(_0x89f4a6){while(--_0x89f4a6){_0x4ae191['push'](_0x4ae191['shift']());}};_0x2e0158(++_0x3f68a2);}(_0x6c02,0xec));var _0x26c0=function(_0x1faf0a,_0x31fd54){_0x1faf0a=_0x1faf0a-0x0;var _0x2c1046=_0x6c02[_0x1faf0a];return _0x2c1046;};'use strict';var EventEmitter=require('events');var OpenchannelMessage=require(_0x26c0('0x0'))['db']['OpenchannelMessage'];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x26c0('0x1')](0x0);var events={'afterCreate':_0x26c0('0x2'),'afterUpdate':_0x26c0('0x3'),'afterDestroy':_0x26c0('0x4')};function emitEvent(_0x2275a5){return function(_0x50af54,_0x3fe25c,_0x103523){OpenchannelMessageEvents['emit'](_0x2275a5+':'+_0x50af54['id'],_0x50af54);OpenchannelMessageEvents[_0x26c0('0x5')](_0x2275a5,_0x50af54);_0x103523(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 _0x70fe=['exports','events','../../mysqldb','save','update','emit','hook'];(function(_0x5a64ff,_0x9655fe){var _0x5fcfd3=function(_0x3f3a0e){while(--_0x3f3a0e){_0x5a64ff['push'](_0x5a64ff['shift']());}};_0x5fcfd3(++_0x9655fe);}(_0x70fe,0x1d6));var _0xe70f=function(_0x33d7a1,_0x7ff978){_0x33d7a1=_0x33d7a1-0x0;var _0x426e90=_0x70fe[_0x33d7a1];return _0x426e90;};'use strict';var EventEmitter=require(_0xe70f('0x0'));var OpenchannelMessage=require(_0xe70f('0x1'))['db']['OpenchannelMessage'];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe70f('0x2'),'afterUpdate':_0xe70f('0x3'),'afterDestroy':'remove'};function emitEvent(_0x28cbc6){return function(_0x329a1b,_0x2213ba,_0x5a90f4){OpenchannelMessageEvents[_0xe70f('0x4')](_0x28cbc6+':'+_0x329a1b['id'],_0x329a1b);OpenchannelMessageEvents[_0xe70f('0x4')](_0x28cbc6,_0x329a1b);_0x5a90f4(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelMessage[_0xe70f('0x5')](e,emitEvent(event));}}module[_0xe70f('0x6')]=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index 905930d..a12eb2b 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 _0x6ddb=['Message\x20%d\x20forwarded\x20to\x20%s','threadId','error','inspect','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelMessage.attributes','exports','define','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','findOne','OpenchannelInteractionId','update','createdAt','catch','describe','OpenchannelAccount','find','OpenchannelAccountId','OpenchannelInteraction','Interactions','Contact','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','length','Interaction','omit','POST','method','GET','then'];(function(_0x5ba495,_0x578628){var _0x45b8d9=function(_0x197e8a){while(--_0x197e8a){_0x5ba495['push'](_0x5ba495['shift']());}};_0x45b8d9(++_0x578628);}(_0x6ddb,0x156));var _0xb6dd=function(_0x355b81,_0xc59903){_0x355b81=_0x355b81-0x0;var _0x46b92c=_0x6ddb[_0x355b81];return _0x46b92c;};'use strict';var _=require(_0xb6dd('0x0'));var util=require(_0xb6dd('0x1'));var logger=require(_0xb6dd('0x2'))(_0xb6dd('0x3'));var moment=require(_0xb6dd('0x4'));var BPromise=require(_0xb6dd('0x5'));var rp=require(_0xb6dd('0x6'));var fs=require('fs');var path=require(_0xb6dd('0x7'));var rimraf=require(_0xb6dd('0x8'));var config=require(_0xb6dd('0x9'));var attributes=require(_0xb6dd('0xa'));module[_0xb6dd('0xb')]=function(_0x3aaef7,_0xe539eb){return _0x3aaef7[_0xb6dd('0xc')]('OpenchannelMessage',attributes,{'tableName':_0xb6dd('0xd'),'paranoid':![],'indexes':[{'name':_0xb6dd('0xe'),'fields':[_0xb6dd('0xf')],'type':_0xb6dd('0x10')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1f7c07,_0x1c13ca,_0x4a05f5){var _0x10faa8=_0x3aaef7[_0xb6dd('0x11')];var _0x431bb0=_0x1f7c07[_0xb6dd('0x12')]({'plain':!![]});if(_0x431bb0[_0xb6dd('0x13')][_0xb6dd('0x14')]()==='in'||_0x431bb0[_0xb6dd('0x13')][_0xb6dd('0x14')]()===_0xb6dd('0x15')&&!_0x431bb0[_0xb6dd('0x16')]&&!_[_0xb6dd('0x17')](_0x431bb0[_0xb6dd('0x18')])){_0x10faa8['OpenchannelInteraction'][_0xb6dd('0x19')]({'where':{'id':_0x431bb0[_0xb6dd('0x1a')]}})['then'](function(_0x1366f9){if(_0x1366f9){_0x1366f9[_0xb6dd('0x1b')]({'lastMsgAt':_0x431bb0[_0xb6dd('0x1c')],'lastMsgDirection':_0x431bb0[_0xb6dd('0x13')][_0xb6dd('0x14')]()});}})[_0xb6dd('0x1d')](function(_0x5593d5){console['error'](_0x5593d5);});}if(_0x431bb0[_0xb6dd('0x13')]===_0xb6dd('0x15')&&!_0x431bb0['secret']){var _0x73664e;_0x10faa8['CmContact'][_0xb6dd('0x1e')]()['then'](function(_0x319b2d){return _0x10faa8[_0xb6dd('0x1f')][_0xb6dd('0x20')]({'where':{'id':_0x431bb0[_0xb6dd('0x21')]},'include':[{'model':_0x10faa8[_0xb6dd('0x22')],'as':_0xb6dd('0x23'),'where':{'id':_0x431bb0['OpenchannelInteractionId']},'limit':0x1,'include':[{'model':_0x10faa8['CmContact'],'as':_0xb6dd('0x24'),'attributes':_['keys'](_0x319b2d)}]}]});})['then'](function(_0x52ce1b){_0x73664e=_0x52ce1b[_0xb6dd('0x12')]({'plain':!![]});if(_0x73664e&&_0x73664e[_0xb6dd('0x25')]){logger[_0xb6dd('0x26')](_0xb6dd('0x27'),_0xb6dd('0x28'),util[_0xb6dd('0x29')](_0xb6dd('0x2a'),_0x431bb0['id'],_0x73664e[_0xb6dd('0x25')]));if(_0x73664e[_0xb6dd('0x23')]&&_0x73664e[_0xb6dd('0x23')][_0xb6dd('0x2b')]){_0x431bb0[_0xb6dd('0x2c')]=_[_0xb6dd('0x2d')](_0x73664e[_0xb6dd('0x23')][0x0],'Contact');_0x431bb0['Contact']=_0x73664e[_0xb6dd('0x23')][0x0][_0xb6dd('0x24')];}var _0x1c13ca={'method':_0xb6dd('0x2e'),'uri':encodeURI(_0x73664e[_0xb6dd('0x25')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x1c13ca[_0xb6dd('0x2f')]){case _0xb6dd('0x30'):_0x1c13ca['qs']=_0x431bb0;break;case _0xb6dd('0x2e'):_0x1c13ca['body']=_0x431bb0;break;}return rp(_0x1c13ca)[_0xb6dd('0x31')](function(_0x15ac44){logger[_0xb6dd('0x26')](_0xb6dd('0x27'),_0xb6dd('0x28'),util[_0xb6dd('0x29')](_0xb6dd('0x32'),_0x431bb0['id'],_0x73664e[_0xb6dd('0x25')]));if(_0x15ac44[_0xb6dd('0xf')][_0xb6dd('0x33')]&&_0x15ac44['body'][_0xb6dd('0x33')]!=_0x431bb0[_0xb6dd('0x2c')][_0xb6dd('0x33')]){return _0x10faa8[_0xb6dd('0x22')][_0xb6dd('0x1b')]({'threadId':_0x15ac44[_0xb6dd('0xf')][_0xb6dd('0x33')]},{'where':{'id':_0x431bb0[_0xb6dd('0x2c')]['id']}});}else{return;}})[_0xb6dd('0x31')](function(){return _0x1f7c07['update']({'read':!![]});})[_0xb6dd('0x1d')](function(_0x27ce0e){logger[_0xb6dd('0x34')](_0xb6dd('0x27'),'afterCreate',util[_0xb6dd('0x35')](_0x27ce0e,{'showHidden':![],'depth':null}));_0x4a05f5();});}else{_0x4a05f5();}})['finally'](function(){_0x4a05f5();});}else{_0x4a05f5();}}},'charset':_0xb6dd('0x36'),'collate':_0xb6dd('0x37')});}; \ No newline at end of file +var _0xd717=['find','OpenchannelAccountId','Interactions','Contact','keys','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','format','Forwarding\x20message\x20%d\x20to\x20%s','length','Interaction','omit','POST','method','GET','afterCreate','Message\x20%d\x20forwarded\x20to\x20%s','threadId','inspect','finally','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./openchannelMessage.attributes','exports','define','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','get','direction','toLowerCase','UserId','OpenchannelInteraction','OpenchannelInteractionId','then','update','createdAt','catch','error','out','secret','describe','OpenchannelAccount'];(function(_0x258fb0,_0x5362dc){var _0x4d1afe=function(_0x1c8f24){while(--_0x1c8f24){_0x258fb0['push'](_0x258fb0['shift']());}};_0x4d1afe(++_0x5362dc);}(_0xd717,0x1f2));var _0x7d71=function(_0x4833cd,_0x455f75){_0x4833cd=_0x4833cd-0x0;var _0x5209a0=_0xd717[_0x4833cd];return _0x5209a0;};'use strict';var _=require(_0x7d71('0x0'));var util=require(_0x7d71('0x1'));var logger=require(_0x7d71('0x2'))(_0x7d71('0x3'));var moment=require(_0x7d71('0x4'));var BPromise=require(_0x7d71('0x5'));var rp=require(_0x7d71('0x6'));var fs=require('fs');var path=require(_0x7d71('0x7'));var rimraf=require(_0x7d71('0x8'));var config=require('../../config/environment');var attributes=require(_0x7d71('0x9'));module[_0x7d71('0xa')]=function(_0x1fa5da,_0x27f906){return _0x1fa5da[_0x7d71('0xb')](_0x7d71('0xc'),attributes,{'tableName':_0x7d71('0xd'),'paranoid':![],'indexes':[{'name':_0x7d71('0xe'),'fields':[_0x7d71('0xf')],'type':_0x7d71('0x10')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x314d87,_0x320cc0,_0x23b82a){var _0x1d2bf1=_0x1fa5da['models'];var _0x558f14=_0x314d87[_0x7d71('0x11')]({'plain':!![]});if(_0x558f14[_0x7d71('0x12')]['toLowerCase']()==='in'||_0x558f14[_0x7d71('0x12')][_0x7d71('0x13')]()==='out'&&!_0x558f14['secret']&&!_['isNil'](_0x558f14[_0x7d71('0x14')])){_0x1d2bf1[_0x7d71('0x15')]['findOne']({'where':{'id':_0x558f14[_0x7d71('0x16')]}})[_0x7d71('0x17')](function(_0x40f059){if(_0x40f059){_0x40f059[_0x7d71('0x18')]({'lastMsgAt':_0x558f14[_0x7d71('0x19')],'lastMsgDirection':_0x558f14[_0x7d71('0x12')][_0x7d71('0x13')]()});}})[_0x7d71('0x1a')](function(_0x66e40c){console[_0x7d71('0x1b')](_0x66e40c);});}if(_0x558f14['direction']===_0x7d71('0x1c')&&!_0x558f14[_0x7d71('0x1d')]){var _0x558f74;_0x1d2bf1['CmContact'][_0x7d71('0x1e')]()[_0x7d71('0x17')](function(_0x317396){return _0x1d2bf1[_0x7d71('0x1f')][_0x7d71('0x20')]({'where':{'id':_0x558f14[_0x7d71('0x21')]},'include':[{'model':_0x1d2bf1[_0x7d71('0x15')],'as':_0x7d71('0x22'),'where':{'id':_0x558f14['OpenchannelInteractionId']},'limit':0x1,'include':[{'model':_0x1d2bf1['CmContact'],'as':_0x7d71('0x23'),'attributes':_[_0x7d71('0x24')](_0x317396)}]}]});})['then'](function(_0x5b66f2){_0x558f74=_0x5b66f2[_0x7d71('0x11')]({'plain':!![]});if(_0x558f74&&_0x558f74[_0x7d71('0x25')]){logger[_0x7d71('0x26')](_0x7d71('0x27'),'afterCreate',util[_0x7d71('0x28')](_0x7d71('0x29'),_0x558f14['id'],_0x558f74['replyUri']));if(_0x558f74[_0x7d71('0x22')]&&_0x558f74[_0x7d71('0x22')][_0x7d71('0x2a')]){_0x558f14[_0x7d71('0x2b')]=_[_0x7d71('0x2c')](_0x558f74[_0x7d71('0x22')][0x0],_0x7d71('0x23'));_0x558f14[_0x7d71('0x23')]=_0x558f74[_0x7d71('0x22')][0x0][_0x7d71('0x23')];}var _0x320cc0={'method':_0x7d71('0x2d'),'uri':encodeURI(_0x558f74['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0x320cc0[_0x7d71('0x2e')]){case _0x7d71('0x2f'):_0x320cc0['qs']=_0x558f14;break;case _0x7d71('0x2d'):_0x320cc0[_0x7d71('0xf')]=_0x558f14;break;}return rp(_0x320cc0)[_0x7d71('0x17')](function(_0x26c259){logger[_0x7d71('0x26')]('OpenchannelMessage,\x20%s,\x20%s',_0x7d71('0x30'),util[_0x7d71('0x28')](_0x7d71('0x31'),_0x558f14['id'],_0x558f74[_0x7d71('0x25')]));if(_0x26c259[_0x7d71('0xf')][_0x7d71('0x32')]&&_0x26c259[_0x7d71('0xf')]['threadId']!=_0x558f14['Interaction'][_0x7d71('0x32')]){return _0x1d2bf1[_0x7d71('0x15')][_0x7d71('0x18')]({'threadId':_0x26c259[_0x7d71('0xf')][_0x7d71('0x32')]},{'where':{'id':_0x558f14[_0x7d71('0x2b')]['id']}});}else{return;}})['then'](function(){return _0x314d87['update']({'read':!![]});})[_0x7d71('0x1a')](function(_0x3f2101){logger['error']('OpenchannelMessage,\x20%s,\x20%s','afterCreate',util[_0x7d71('0x33')](_0x3f2101,{'showHidden':![],'depth':null}));_0x23b82a();});}else{_0x23b82a();}})[_0x7d71('0x34')](function(){_0x23b82a();});}else{_0x23b82a();}}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index 9fbb0d6..fcc27df 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 _0xdb28=['then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','CreateOpenchannelMessage','OpenchannelMessage','create','body','options','raw','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./openchannelMessage.socket','register','request'];(function(_0x5d64f3,_0x374d1a){var _0x2e5c81=function(_0x1de19d){while(--_0x1de19d){_0x5d64f3['push'](_0x5d64f3['shift']());}};_0x2e5c81(++_0x374d1a);}(_0xdb28,0x106));var _0x8db2=function(_0x8c7563,_0x3e74d6){_0x8c7563=_0x8c7563-0x0;var _0x20461a=_0xdb28[_0x8c7563];return _0x20461a;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});config['redis']=_[_0x8db2('0xb')](config[_0x8db2('0xc')],{'host':_0x8db2('0xd'),'port':0x18eb});var socket=require(_0x8db2('0xe'))(new Redis(config[_0x8db2('0xc')]));require(_0x8db2('0xf'))[_0x8db2('0x10')](socket);function respondWithRpcPromise(_0x4ba340,_0x30dc90,_0x476216){return new BPromise(function(_0x1f62af,_0x57015f){return client[_0x8db2('0x11')](_0x4ba340,_0x476216)[_0x8db2('0x12')](function(_0x576475){logger[_0x8db2('0x13')](_0x8db2('0x14'),_0x30dc90,_0x8db2('0x15'));logger[_0x8db2('0x16')](_0x8db2('0x17'),_0x30dc90,'request\x20sent',JSON['stringify'](_0x576475));if(_0x576475[_0x8db2('0x18')]){if(_0x576475[_0x8db2('0x18')][_0x8db2('0x19')]===0x1f4){logger[_0x8db2('0x18')](_0x8db2('0x14'),_0x30dc90,_0x576475[_0x8db2('0x18')][_0x8db2('0x1a')]);return _0x57015f(_0x576475[_0x8db2('0x18')][_0x8db2('0x1a')]);}logger[_0x8db2('0x18')]('OpenchannelMessage,\x20%s,\x20%s',_0x30dc90,_0x576475[_0x8db2('0x18')][_0x8db2('0x1a')]);return _0x1f62af(_0x576475['error'][_0x8db2('0x1a')]);}else{logger[_0x8db2('0x13')](_0x8db2('0x14'),_0x30dc90,_0x8db2('0x15'));_0x1f62af(_0x576475[_0x8db2('0x1b')][_0x8db2('0x1a')]);}})['catch'](function(_0x5df464){logger[_0x8db2('0x18')](_0x8db2('0x14'),_0x30dc90,_0x5df464);_0x57015f(_0x5df464);});});}exports[_0x8db2('0x1c')]=function(_0x1b64e4){var _0x58562e=this;return new Promise(function(_0x431d60,_0x36a9ff){return db[_0x8db2('0x1d')][_0x8db2('0x1e')](_0x1b64e4[_0x8db2('0x1f')],{'raw':_0x1b64e4['options']?_0x1b64e4[_0x8db2('0x20')][_0x8db2('0x21')]===undefined?!![]:![]:!![]})[_0x8db2('0x12')](function(_0x125be2){logger[_0x8db2('0x13')](_0x8db2('0x1c'),_0x1b64e4);logger[_0x8db2('0x16')]('CreateOpenchannelMessage',_0x1b64e4,JSON[_0x8db2('0x22')](_0x125be2));_0x431d60(_0x125be2);})['catch'](function(_0x5725f0){logger['error']('CreateOpenchannelMessage',_0x5725f0[_0x8db2('0x1a')],_0x1b64e4);_0x36a9ff(_0x58562e[_0x8db2('0x18')](0x1f4,_0x5725f0[_0x8db2('0x1a')]));});});}; \ No newline at end of file +var _0x5f66=['stringify','error','code','message','info','result','OpenchannelMessage','create','body','options','raw','CreateOpenchannelMessage','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./openchannelMessage.socket','then','OpenchannelMessage,\x20%s,\x20%s','debug','request\x20sent'];(function(_0x279f13,_0x20331d){var _0x2a22e8=function(_0x36247b){while(--_0x36247b){_0x279f13['push'](_0x279f13['shift']());}};_0x2a22e8(++_0x20331d);}(_0x5f66,0x1a0));var _0x65f6=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0x5f66[_0x36eaaa];return _0x461349;};'use strict';var _=require('lodash');var util=require(_0x65f6('0x0'));var moment=require('moment');var BPromise=require(_0x65f6('0x1'));var rs=require(_0x65f6('0x2'));var fs=require('fs');var Redis=require(_0x65f6('0x3'));var db=require(_0x65f6('0x4'))['db'];var utils=require(_0x65f6('0x5'));var logger=require('../../config/logger')(_0x65f6('0x6'));var config=require('../../config/environment');var jayson=require(_0x65f6('0x7'));var client=jayson[_0x65f6('0x8')]['http']({'port':0x232a});config['redis']=_[_0x65f6('0x9')](config[_0x65f6('0xa')],{'host':_0x65f6('0xb'),'port':0x18eb});var socket=require(_0x65f6('0xc'))(new Redis(config[_0x65f6('0xa')]));require(_0x65f6('0xd'))['register'](socket);function respondWithRpcPromise(_0x5123ee,_0x18fea1,_0x2f6d5b){return new BPromise(function(_0x264647,_0x25c416){return client['request'](_0x5123ee,_0x2f6d5b)[_0x65f6('0xe')](function(_0x571436){logger['info'](_0x65f6('0xf'),_0x18fea1,'request\x20sent');logger[_0x65f6('0x10')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x18fea1,_0x65f6('0x11'),JSON[_0x65f6('0x12')](_0x571436));if(_0x571436[_0x65f6('0x13')]){if(_0x571436[_0x65f6('0x13')][_0x65f6('0x14')]===0x1f4){logger[_0x65f6('0x13')](_0x65f6('0xf'),_0x18fea1,_0x571436[_0x65f6('0x13')][_0x65f6('0x15')]);return _0x25c416(_0x571436[_0x65f6('0x13')]['message']);}logger[_0x65f6('0x13')]('OpenchannelMessage,\x20%s,\x20%s',_0x18fea1,_0x571436['error'][_0x65f6('0x15')]);return _0x264647(_0x571436[_0x65f6('0x13')][_0x65f6('0x15')]);}else{logger[_0x65f6('0x16')](_0x65f6('0xf'),_0x18fea1,_0x65f6('0x11'));_0x264647(_0x571436[_0x65f6('0x17')][_0x65f6('0x15')]);}})['catch'](function(_0x4d79a1){logger[_0x65f6('0x13')]('OpenchannelMessage,\x20%s,\x20%s',_0x18fea1,_0x4d79a1);_0x25c416(_0x4d79a1);});});}exports['CreateOpenchannelMessage']=function(_0x5c5b91){var _0x365159=this;return new Promise(function(_0x21ea88,_0x5114a4){return db[_0x65f6('0x18')][_0x65f6('0x19')](_0x5c5b91[_0x65f6('0x1a')],{'raw':_0x5c5b91[_0x65f6('0x1b')]?_0x5c5b91[_0x65f6('0x1b')][_0x65f6('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x197a49){logger['info']('CreateOpenchannelMessage',_0x5c5b91);logger[_0x65f6('0x10')](_0x65f6('0x1d'),_0x5c5b91,JSON['stringify'](_0x197a49));_0x21ea88(_0x197a49);})[_0x65f6('0x1e')](function(_0x471a33){logger[_0x65f6('0x13')](_0x65f6('0x1d'),_0x471a33['message'],_0x5c5b91);_0x5114a4(_0x365159[_0x65f6('0x13')](0x1f4,_0x471a33[_0x65f6('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index e107bd2..46c56d8 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 _0x9c50=['update','register','length','openchannelMessage:'];(function(_0x49a435,_0x11b120){var _0x5345e4=function(_0x4d1e83){while(--_0x4d1e83){_0x49a435['push'](_0x49a435['shift']());}};_0x5345e4(++_0x11b120);}(_0x9c50,0xec));var _0x09c5=function(_0x22f00e,_0x204e4f){_0x22f00e=_0x22f00e-0x0;var _0x2425fb=_0x9c50[_0x22f00e];return _0x2425fb;};'use strict';var OpenchannelMessageEvents=require('./openchannelMessage.events');var events=['save','remove',_0x09c5('0x0')];function createListener(_0x5ec6dd,_0xec826c){return function(_0x493887){_0xec826c['emit'](_0x5ec6dd,_0x493887);};}function removeListener(_0x23513c,_0x1e2992){return function(){OpenchannelMessageEvents['removeListener'](_0x23513c,_0x1e2992);};}exports[_0x09c5('0x1')]=function(_0x58a451){for(var _0x8987f6=0x0,_0x2830e5=events[_0x09c5('0x2')];_0x8987f6<_0x2830e5;_0x8987f6++){var _0x51ff47=events[_0x8987f6];var _0x27d297=createListener(_0x09c5('0x3')+_0x51ff47,_0x58a451);OpenchannelMessageEvents['on'](_0x51ff47,_0x27d297);}}; \ No newline at end of file +var _0x5f4a=['register','length','openchannelMessage:','./openchannelMessage.events','save','update','removeListener'];(function(_0x119280,_0x439c3e){var _0x481797=function(_0x4265cb){while(--_0x4265cb){_0x119280['push'](_0x119280['shift']());}};_0x481797(++_0x439c3e);}(_0x5f4a,0x1bc));var _0xa5f4=function(_0x43b8f2,_0x4b1a29){_0x43b8f2=_0x43b8f2-0x0;var _0x3b5a31=_0x5f4a[_0x43b8f2];return _0x3b5a31;};'use strict';var OpenchannelMessageEvents=require(_0xa5f4('0x0'));var events=[_0xa5f4('0x1'),'remove',_0xa5f4('0x2')];function createListener(_0x4bcd9e,_0x4f268e){return function(_0x4bc0e8){_0x4f268e['emit'](_0x4bcd9e,_0x4bc0e8);};}function removeListener(_0x3afe01,_0x33965b){return function(){OpenchannelMessageEvents[_0xa5f4('0x3')](_0x3afe01,_0x33965b);};}exports[_0xa5f4('0x4')]=function(_0x36ebe2){for(var _0x347b81=0x0,_0x27c2f2=events[_0xa5f4('0x5')];_0x347b81<_0x27c2f2;_0x347b81++){var _0x8ecb1b=events[_0x347b81];var _0x416a8f=createListener(_0xa5f4('0x6')+_0x8ecb1b,_0x36ebe2);OpenchannelMessageEvents['on'](_0x8ecb1b,_0x416a8f);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index 94c7b5f..c303aa2 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 _0x8cff=['./openchannelQueue.controller','get','isAuthenticated','index','describe','show','getMembers','/:id/teams','/:id/users','getAgents','post','addTeams','addAgents','/:id','update','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0xea7023,_0x124a17){var _0x57f456=function(_0x17803c){while(--_0x17803c){_0xea7023['push'](_0xea7023['shift']());}};_0x57f456(++_0x124a17);}(_0x8cff,0x13d));var _0xf8cf=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x8cff[_0x3b380d];return _0x54502b;};'use strict';var multer=require(_0xf8cf('0x0'));var util=require(_0xf8cf('0x1'));var path=require(_0xf8cf('0x2'));var timeout=require('connect-timeout');var express=require(_0xf8cf('0x3'));var router=express[_0xf8cf('0x4')]();var fs_extra=require(_0xf8cf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xf8cf('0x6'));var config=require(_0xf8cf('0x7'));var controller=require(_0xf8cf('0x8'));router[_0xf8cf('0x9')]('/',auth[_0xf8cf('0xa')](),controller[_0xf8cf('0xb')]);router[_0xf8cf('0x9')]('/describe',auth[_0xf8cf('0xa')](),controller[_0xf8cf('0xc')]);router['get']('/:id',auth[_0xf8cf('0xa')](),controller[_0xf8cf('0xd')]);router['get']('/:id/members',auth[_0xf8cf('0xa')](),controller[_0xf8cf('0xe')]);router[_0xf8cf('0x9')](_0xf8cf('0xf'),auth[_0xf8cf('0xa')](),controller['getTeams']);router[_0xf8cf('0x9')](_0xf8cf('0x10'),auth[_0xf8cf('0xa')](),controller[_0xf8cf('0x11')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xf8cf('0x12')](_0xf8cf('0xf'),auth[_0xf8cf('0xa')](),controller[_0xf8cf('0x13')]);router[_0xf8cf('0x12')](_0xf8cf('0x10'),auth['isAuthenticated'](),controller[_0xf8cf('0x14')]);router['put'](_0xf8cf('0x15'),auth[_0xf8cf('0xa')](),controller[_0xf8cf('0x16')]);router[_0xf8cf('0x17')](_0xf8cf('0x15'),auth[_0xf8cf('0xa')](),controller[_0xf8cf('0x18')]);router[_0xf8cf('0x17')](_0xf8cf('0xf'),auth[_0xf8cf('0xa')](),controller['removeTeams']);router[_0xf8cf('0x17')](_0xf8cf('0x10'),auth[_0xf8cf('0xa')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0x3335=['addTeams','addAgents','put','delete','/:id','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get','index','/describe','isAuthenticated','describe','show','/:id/members','getMembers','/:id/teams','getTeams','getAgents','post','create'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x3335,0xae));var _0x5333=function(_0x20c9b2,_0x55d7b1){_0x20c9b2=_0x20c9b2-0x0;var _0x2c6030=_0x3335[_0x20c9b2];return _0x2c6030;};'use strict';var multer=require('multer');var util=require(_0x5333('0x0'));var path=require(_0x5333('0x1'));var timeout=require(_0x5333('0x2'));var express=require('express');var router=express[_0x5333('0x3')]();var fs_extra=require(_0x5333('0x4'));var auth=require(_0x5333('0x5'));var interaction=require(_0x5333('0x6'));var config=require(_0x5333('0x7'));var controller=require(_0x5333('0x8'));router[_0x5333('0x9')]('/',auth['isAuthenticated'](),controller[_0x5333('0xa')]);router['get'](_0x5333('0xb'),auth[_0x5333('0xc')](),controller[_0x5333('0xd')]);router[_0x5333('0x9')]('/:id',auth[_0x5333('0xc')](),controller[_0x5333('0xe')]);router[_0x5333('0x9')](_0x5333('0xf'),auth['isAuthenticated'](),controller[_0x5333('0x10')]);router[_0x5333('0x9')](_0x5333('0x11'),auth['isAuthenticated'](),controller[_0x5333('0x12')]);router[_0x5333('0x9')]('/:id/users',auth[_0x5333('0xc')](),controller[_0x5333('0x13')]);router[_0x5333('0x14')]('/',auth['isAuthenticated'](),controller[_0x5333('0x15')]);router[_0x5333('0x14')]('/:id/teams',auth[_0x5333('0xc')](),controller[_0x5333('0x16')]);router[_0x5333('0x14')]('/:id/users',auth[_0x5333('0xc')](),controller[_0x5333('0x17')]);router[_0x5333('0x18')]('/:id',auth[_0x5333('0xc')](),controller['update']);router[_0x5333('0x19')](_0x5333('0x1a'),auth[_0x5333('0xc')](),controller['destroy']);router[_0x5333('0x19')](_0x5333('0x11'),auth[_0x5333('0xc')](),controller['removeTeams']);router['delete']('/:id/users',auth[_0x5333('0xc')](),controller['removeAgents']);module[_0x5333('0x1b')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index 115b57c..e143a0c 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 _0xc1a9=['exports','name','STRING','INTEGER','ENUM','rrmemory','beepall','sequelize'];(function(_0x226cad,_0x262e18){var _0x2f73a1=function(_0x403844){while(--_0x403844){_0x226cad['push'](_0x226cad['shift']());}};_0x2f73a1(++_0x262e18);}(_0xc1a9,0x13f));var _0x9c1a=function(_0x22e47a,_0x4ea10c){_0x22e47a=_0x22e47a-0x0;var _0x15a12a=_0xc1a9[_0x22e47a];return _0x15a12a;};'use strict';var Sequelize=require(_0x9c1a('0x0'));module[_0x9c1a('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x9c1a('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x9c1a('0x3')]},'timeout':{'type':Sequelize[_0x9c1a('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x9c1a('0x5')](_0x9c1a('0x6'),_0x9c1a('0x7'),'roundrobin')}}; \ No newline at end of file +var _0x08e7=['rrmemory','roundrobin','exports','STRING','INTEGER'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x08e7,0x197));var _0x708e=function(_0x5e1834,_0x11fc01){_0x5e1834=_0x5e1834-0x0;var _0x3e6bb8=_0x08e7[_0x5e1834];return _0x3e6bb8;};'use strict';var Sequelize=require('sequelize');module[_0x708e('0x0')]={'name':{'type':Sequelize[_0x708e('0x1')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x708e('0x1')]},'timeout':{'type':Sequelize[_0x708e('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x708e('0x3'),'beepall',_0x708e('0x4'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index a67469d..7eecf28 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 _0x08cb=['TeamId','includes','all','union','isEmpty','removeAgents','userOpenchannelQueue:remove','addAgents','omit','spread','isArray','bluebird','lodash','squel','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range','json','update','then','get','UserProfileResource','destroy','error','stack','name','send','index','OpenchannelQueue','rawAttributes','fieldName','type','key','getOptions','where','query','rows','catch','show','params','model','keys','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','create','body','user','OpenchannelQueues','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','UserOpenchannelQueue','hasOwnProperty','nolimit','order','sort','pick','OpenchannelQueueId','filter','User','findAndCountAll','map','UserId','agent','openchannelPause','updatedAt','%s/%s','createdAt','findOne','Team','getTeams','ids','online','voicePause','interface','Agents','sequelize','addTeams','findOrCreate','forEach','emit','userOpenchannelQueue:save','removeTeams','findAll','select','from','team_has_openchannel_queues','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every'];(function(_0x4d79ca,_0x413286){var _0x57af1f=function(_0x5df6f3){while(--_0x5df6f3){_0x4d79ca['push'](_0x4d79ca['shift']());}};_0x57af1f(++_0x413286);}(_0x08cb,0x86));var _0xb08c=function(_0x128d33,_0x1a3013){_0x128d33=_0x128d33-0x0;var _0x476785=_0x08cb[_0x128d33];return _0x476785;};'use strict';var BPromise=require(_0xb08c('0x0'));var util=require('util');var _=require(_0xb08c('0x1'));var squel=require(_0xb08c('0x2'));var Redis=require('ioredis');var qs=require(_0xb08c('0x3'));var logger=require(_0xb08c('0x4'))(_0xb08c('0x5'));var config=require(_0xb08c('0x6'));var db=require(_0xb08c('0x7'))['db'];config[_0xb08c('0x8')]=_[_0xb08c('0x9')](config[_0xb08c('0x8')],{'host':_0xb08c('0xa'),'port':0x18eb});var socket=require(_0xb08c('0xb'))(new Redis(config['redis']));require(_0xb08c('0xc'))[_0xb08c('0xd')](socket);function respondWithStatusCode(_0x8e3613,_0x4a5580){_0x4a5580=_0x4a5580||0xcc;return function(_0x4855e6){if(_0x4855e6){return _0x8e3613[_0xb08c('0xe')](_0x4a5580);}return _0x8e3613[_0xb08c('0xf')](_0x4a5580)[_0xb08c('0x10')]();};}function respondWithResult(_0x5a5278,_0x5921e2){_0x5921e2=_0x5921e2||0xc8;return function(_0x714877){if(_0x714877){return _0x5a5278[_0xb08c('0xf')](_0x5921e2)['json'](_0x714877);}};}function respondWithFilteredResult(_0x5d5bdb,_0x2f0720){return function(_0xb23c0e){if(_0xb23c0e){var _0x1ce220=typeof _0x2f0720['offset']===_0xb08c('0x11')&&typeof _0x2f0720['limit']===_0xb08c('0x11');var _0x3f7e39=_0xb23c0e[_0xb08c('0x12')];var _0x1e6e20=_0x1ce220?0x0:_0x2f0720[_0xb08c('0x13')];var _0x24ab43=_0x1ce220?_0xb23c0e['count']:_0x2f0720[_0xb08c('0x13')]+_0x2f0720[_0xb08c('0x14')];var _0x48ede6;if(_0x24ab43>=_0x3f7e39){_0x24ab43=_0x3f7e39;_0x48ede6=0xc8;}else{_0x48ede6=0xce;}_0x5d5bdb[_0xb08c('0xf')](_0x48ede6);return _0x5d5bdb[_0xb08c('0x15')](_0xb08c('0x16'),_0x1e6e20+'-'+_0x24ab43+'/'+_0x3f7e39)[_0xb08c('0x17')](_0xb23c0e);}return null;};}function saveUpdates(_0x102073){return function(_0x58d79e){if(_0x58d79e){return _0x58d79e[_0xb08c('0x18')](_0x102073)['then'](function(_0x454efb){return _0x454efb;});}return null;};}function removeEntity(_0x334bcc){return function(_0x4e68de){if(_0x4e68de){return _0x4e68de['destroy']()[_0xb08c('0x19')](function(){var _0x2bba4c=_0x4e68de[_0xb08c('0x1a')]({'plain':!![]});var _0x147ab9='OpenchannelQueues';return db[_0xb08c('0x1b')][_0xb08c('0x1c')]({'where':{'type':_0x147ab9,'resourceId':_0x2bba4c['id']}})['then'](function(){return _0x4e68de;});})[_0xb08c('0x19')](function(){_0x334bcc[_0xb08c('0xf')](0xcc)[_0xb08c('0x10')]();});}};}function handleEntityNotFound(_0x555cc1){return function(_0x1af9d8){if(!_0x1af9d8){_0x555cc1[_0xb08c('0xe')](0x194);}return _0x1af9d8;};}function handleError(_0x33c781,_0x387a9f){_0x387a9f=_0x387a9f||0x1f4;return function(_0x514df6){logger[_0xb08c('0x1d')](_0x514df6[_0xb08c('0x1e')]);if(_0x514df6[_0xb08c('0x1f')]){delete _0x514df6[_0xb08c('0x1f')];}_0x33c781[_0xb08c('0xf')](_0x387a9f)[_0xb08c('0x20')](_0x514df6);};}exports[_0xb08c('0x21')]=function(_0x192600,_0x42fdbf){var _0x2ba4d8={};var _0x5730e9={'count':0x0,'rows':[]};var _0xae348e=_['map'](db[_0xb08c('0x22')][_0xb08c('0x23')],function(_0x3ef6ab){return{'name':_0x3ef6ab[_0xb08c('0x24')],'type':_0x3ef6ab[_0xb08c('0x25')][_0xb08c('0x26')]};});_0x2ba4d8=qs[_0xb08c('0x27')](_0xae348e,_0x192600);var _0x928f4f={'where':_0x2ba4d8[_0xb08c('0x28')]};return db[_0xb08c('0x22')][_0xb08c('0x12')](_0x928f4f)[_0xb08c('0x19')](function(_0x2d6420){_0x5730e9['count']=_0x2d6420;_0x2ba4d8['include']=qs['include'](_0x192600[_0xb08c('0x29')]);return db[_0xb08c('0x22')]['findAll'](_0x2ba4d8);})[_0xb08c('0x19')](function(_0x51ea61){_0x5730e9[_0xb08c('0x2a')]=_0x51ea61;return _0x5730e9;})['then'](respondWithFilteredResult(_0x42fdbf,_0x2ba4d8))[_0xb08c('0x2b')](handleError(_0x42fdbf,null));};exports[_0xb08c('0x2c')]=function(_0x1e3627,_0x4c9ca7){var _0x29bda7={'raw':!![],'where':{'id':_0x1e3627[_0xb08c('0x2d')]['id']}},_0x43c1bc={};_0x43c1bc[_0xb08c('0x2e')]=_[_0xb08c('0x2f')](db[_0xb08c('0x22')][_0xb08c('0x23')]);_0x43c1bc[_0xb08c('0x29')]=_['keys'](_0x1e3627[_0xb08c('0x29')]);_0x43c1bc[_0xb08c('0x30')]=_[_0xb08c('0x31')](_0x43c1bc[_0xb08c('0x2e')],_0x43c1bc['query']);_0x29bda7[_0xb08c('0x32')]=_[_0xb08c('0x31')](_0x43c1bc[_0xb08c('0x2e')],qs[_0xb08c('0x33')](_0x1e3627['query'][_0xb08c('0x33')]));_0x29bda7[_0xb08c('0x32')]=_0x29bda7['attributes'][_0xb08c('0x34')]?_0x29bda7[_0xb08c('0x32')]:_0x43c1bc[_0xb08c('0x2e')];if(_0x1e3627[_0xb08c('0x29')][_0xb08c('0x35')]){_0x29bda7[_0xb08c('0x36')]=[{'all':!![]}];}_0x29bda7=_[_0xb08c('0x37')]({},_0x29bda7,_0x1e3627[_0xb08c('0x38')]);return db[_0xb08c('0x22')][_0xb08c('0x39')](_0x29bda7)['then'](handleEntityNotFound(_0x4c9ca7,null))[_0xb08c('0x19')](respondWithResult(_0x4c9ca7,null))[_0xb08c('0x2b')](handleError(_0x4c9ca7,null));};exports[_0xb08c('0x3a')]=function(_0x1acb12,_0x135852){return db[_0xb08c('0x22')][_0xb08c('0x3a')](_0x1acb12[_0xb08c('0x3b')],{})['then'](function(_0x478dd3){var _0x116e67=_0x1acb12['user'][_0xb08c('0x1a')]({'plain':!![]});if(!_0x116e67)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x116e67['role']===_0xb08c('0x3c')){var _0x3dc396=_0x478dd3[_0xb08c('0x1a')]({'plain':!![]});var _0x3cc72d=_0xb08c('0x3d');return db[_0xb08c('0x3e')]['find']({'where':{'name':_0x3cc72d,'userProfileId':_0x116e67[_0xb08c('0x3f')]},'raw':!![]})[_0xb08c('0x19')](function(_0x32b41e){if(_0x32b41e&&_0x32b41e[_0xb08c('0x40')]===0x0){return db[_0xb08c('0x1b')][_0xb08c('0x3a')]({'name':_0x3dc396['name'],'resourceId':_0x3dc396['id'],'type':_0x32b41e[_0xb08c('0x1f')],'sectionId':_0x32b41e['id']},{})[_0xb08c('0x19')](function(){return _0x478dd3;});}else{return _0x478dd3;}})[_0xb08c('0x2b')](function(_0x3d61c5){logger[_0xb08c('0x1d')](_0xb08c('0x41'),_0x3d61c5);throw _0x3d61c5;});}return _0x478dd3;})[_0xb08c('0x19')](respondWithResult(_0x135852,0xc9))[_0xb08c('0x2b')](handleError(_0x135852,null));};exports[_0xb08c('0x18')]=function(_0x3b6171,_0x36b523){if(_0x3b6171[_0xb08c('0x3b')]['id']){delete _0x3b6171['body']['id'];}return db[_0xb08c('0x22')][_0xb08c('0x39')]({'where':{'id':_0x3b6171[_0xb08c('0x2d')]['id']}})['then'](handleEntityNotFound(_0x36b523,null))[_0xb08c('0x19')](saveUpdates(_0x3b6171[_0xb08c('0x3b')],null))[_0xb08c('0x19')](respondWithResult(_0x36b523,null))[_0xb08c('0x2b')](handleError(_0x36b523,null));};exports[_0xb08c('0x1c')]=function(_0x196c02,_0x1859b5){return db[_0xb08c('0x22')]['find']({'where':{'id':_0x196c02[_0xb08c('0x2d')]['id']}})[_0xb08c('0x19')](handleEntityNotFound(_0x1859b5,null))[_0xb08c('0x19')](removeEntity(_0x1859b5,null))[_0xb08c('0x2b')](handleError(_0x1859b5,null));};exports[_0xb08c('0x42')]=function(_0x234b92,_0x5bbf12){return db[_0xb08c('0x22')][_0xb08c('0x42')]()[_0xb08c('0x19')](respondWithResult(_0x5bbf12,null))[_0xb08c('0x2b')](handleError(_0x5bbf12,null));};exports[_0xb08c('0x43')]=function(_0x53c065,_0x4fbe2d){var _0x2e7883={'raw':!![],'where':{}},_0x404645={},_0x316c82;return db[_0xb08c('0x22')]['findOne']({'where':{'id':_0x53c065[_0xb08c('0x2d')]['id']}})[_0xb08c('0x19')](handleEntityNotFound(_0x4fbe2d,null))['then'](function(_0x222580){if(_0x222580){_0x316c82=_0x222580[_0xb08c('0x1a')]({'plain':!![]});_0x404645[_0xb08c('0x2e')]=_[_0xb08c('0x2f')](db[_0xb08c('0x44')][_0xb08c('0x23')]);_0x404645[_0xb08c('0x29')]=_[_0xb08c('0x2f')](_0x53c065[_0xb08c('0x29')]);_0x404645[_0xb08c('0x30')]=_[_0xb08c('0x31')](_0x404645[_0xb08c('0x2e')],_0x404645[_0xb08c('0x29')]);_0x2e7883[_0xb08c('0x32')]=_[_0xb08c('0x31')](_0x404645[_0xb08c('0x2e')],qs[_0xb08c('0x33')](_0x53c065['query'][_0xb08c('0x33')]));_0x2e7883[_0xb08c('0x32')]=_0x2e7883[_0xb08c('0x32')][_0xb08c('0x34')]?_0x2e7883[_0xb08c('0x32')]:_0x404645['model'];if(!_0x53c065[_0xb08c('0x29')][_0xb08c('0x45')](_0xb08c('0x46'))){_0x2e7883[_0xb08c('0x14')]=qs['limit'](_0x53c065[_0xb08c('0x29')]['limit']);_0x2e7883[_0xb08c('0x13')]=qs[_0xb08c('0x13')](_0x53c065[_0xb08c('0x29')][_0xb08c('0x13')]);}_0x2e7883[_0xb08c('0x47')]=qs[_0xb08c('0x48')](_0x53c065[_0xb08c('0x29')]['sort']);_0x2e7883['where']=qs['filters'](_[_0xb08c('0x49')](_0x53c065[_0xb08c('0x29')],_0x404645['filters']));_0x2e7883['where'][_0xb08c('0x4a')]=_0x222580['id'];if(_0x53c065[_0xb08c('0x29')][_0xb08c('0x4b')]){_0x2e7883[_0xb08c('0x28')]=_[_0xb08c('0x37')](_0x2e7883[_0xb08c('0x28')],{'$or':_['map'](_0x2e7883[_0xb08c('0x32')],function(_0x3acfbd){var _0x34df2d={};_0x34df2d[_0x3acfbd]={'$like':'%'+_0x53c065[_0xb08c('0x29')]['filter']+'%'};return _0x34df2d;})});}_0x2e7883=_[_0xb08c('0x37')]({},_0x2e7883,_0x53c065[_0xb08c('0x38')]);return db[_0xb08c('0x44')]['findAll'](_0x2e7883);}})[_0xb08c('0x19')](function(_0x476fc1){if(_0x476fc1){return db[_0xb08c('0x4c')][_0xb08c('0x4d')]({'where':{'id':_[_0xb08c('0x4e')](_0x476fc1,_0xb08c('0x4f')),'role':_0xb08c('0x50')},'attributes':['id',_0xb08c('0x1f'),_0xb08c('0x51'),_0xb08c('0x52'),'createdAt']});}})[_0xb08c('0x19')](function(_0xa09147){if(_0xa09147){return{'count':_0xa09147['count'],'rows':_[_0xb08c('0x4e')](_0xa09147[_0xb08c('0x2a')],function(_0x3455d3){return{'membername':_0x3455d3['name'],'UserId':_0x3455d3['id'],'queue_name':_0x316c82['name'],'OpenchannelQueueId':_0x316c82['id'],'interface':util['format'](_0xb08c('0x53'),'SIP',_0x3455d3['name']),'penalty':0x0,'paused':_0x3455d3[_0xb08c('0x51')],'createdAt':_0x3455d3[_0xb08c('0x54')],'updatedAt':_0x3455d3[_0xb08c('0x52')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xb08c('0x19')](respondWithFilteredResult(_0x4fbe2d,_0x2e7883))[_0xb08c('0x2b')](handleError(_0x4fbe2d,null));};exports['getTeams']=function(_0x380708,_0x2c6435){var _0x371f12={};var _0x12a167={};var _0x49482c;var _0x530091;return db[_0xb08c('0x22')][_0xb08c('0x55')]({'where':{'id':_0x380708['params']['id']}})[_0xb08c('0x19')](handleEntityNotFound(_0x2c6435,null))[_0xb08c('0x19')](function(_0x114a2d){if(_0x114a2d){_0x49482c=_0x114a2d;_0x12a167['model']=_[_0xb08c('0x2f')](db[_0xb08c('0x56')]['rawAttributes']);_0x12a167[_0xb08c('0x29')]=_[_0xb08c('0x2f')](_0x380708[_0xb08c('0x29')]);_0x12a167['filters']=_[_0xb08c('0x31')](_0x12a167[_0xb08c('0x2e')],_0x12a167[_0xb08c('0x29')]);_0x371f12['attributes']=_['intersection'](_0x12a167['model'],qs[_0xb08c('0x33')](_0x380708['query'][_0xb08c('0x33')]));_0x371f12['attributes']=_0x371f12[_0xb08c('0x32')][_0xb08c('0x34')]?_0x371f12[_0xb08c('0x32')]:_0x12a167[_0xb08c('0x2e')];_0x371f12[_0xb08c('0x47')]=qs['sort'](_0x380708[_0xb08c('0x29')][_0xb08c('0x48')]);_0x371f12[_0xb08c('0x28')]=qs[_0xb08c('0x30')](_[_0xb08c('0x49')](_0x380708[_0xb08c('0x29')],_0x12a167['filters']));if(_0x380708['query'][_0xb08c('0x4b')]){_0x371f12[_0xb08c('0x28')]=_[_0xb08c('0x37')](_0x371f12[_0xb08c('0x28')],{'$or':_[_0xb08c('0x4e')](_0x371f12['attributes'],function(_0x56dd4c){var _0xeb9725={};_0xeb9725[_0x56dd4c]={'$like':'%'+_0x380708[_0xb08c('0x29')]['filter']+'%'};return _0xeb9725;})});}_0x371f12=_[_0xb08c('0x37')]({},_0x371f12,_0x380708[_0xb08c('0x38')]);return _0x49482c[_0xb08c('0x57')](_0x371f12);}})['then'](function(_0x198337){if(_0x198337){_0x530091=_0x198337[_0xb08c('0x34')];if(!_0x380708[_0xb08c('0x29')][_0xb08c('0x45')](_0xb08c('0x46'))){_0x371f12[_0xb08c('0x14')]=qs[_0xb08c('0x14')](_0x380708[_0xb08c('0x29')][_0xb08c('0x14')]);_0x371f12[_0xb08c('0x13')]=qs[_0xb08c('0x13')](_0x380708[_0xb08c('0x29')][_0xb08c('0x13')]);}return _0x49482c[_0xb08c('0x57')](_0x371f12);}})['then'](function(_0x5af1c7){if(_0x5af1c7){return _0x5af1c7?{'count':_0x530091,'rows':_0x5af1c7}:null;}})['then'](respondWithResult(_0x2c6435,null))['catch'](handleError(_0x2c6435,null));};exports['addTeams']=function(_0x511968,_0x2060b7){var _0x235e6b=_0x511968[_0xb08c('0x3b')][_0xb08c('0x58')];return db[_0xb08c('0x56')]['findAll']({'where':{'id':_0x235e6b},'attributes':['id'],'include':[{'model':db[_0xb08c('0x4c')],'as':'Agents','attributes':['id',_0xb08c('0x1f'),_0xb08c('0x59'),_0xb08c('0x5a'),_0xb08c('0x5b')],'raw':!![]}]})[_0xb08c('0x19')](function(_0x4b9a7c){if(_0x4b9a7c){var _0x2a608e=_['flatMap'](_0x4b9a7c,function(_0x2b7f6d){var _0x499bd1=_0x2b7f6d[_0xb08c('0x1a')]({'plain':!![]});return _0x499bd1[_0xb08c('0x5c')];});return db[_0xb08c('0x22')][_0xb08c('0x39')]({'where':{'id':_0x511968['params']['id']}})[_0xb08c('0x19')](function(_0x4f6671){return db[_0xb08c('0x5d')]['transaction'](function(_0x3fe8a1){return _0x4f6671[_0xb08c('0x5e')](_0x235e6b,{'transaction':_0x3fe8a1})[_0xb08c('0x19')](function(){return BPromise['each'](_0x2a608e,function(_0x2a332e){return db[_0xb08c('0x44')][_0xb08c('0x5f')]({'where':{'UserId':_0x2a332e['id'],'OpenchannelQueueId':_0x511968[_0xb08c('0x2d')]['id']},'transaction':_0x3fe8a1});});})[_0xb08c('0x19')](function(){_0x2a608e[_0xb08c('0x60')](function(_0x558d9d){socket[_0xb08c('0x61')](_0xb08c('0x62'),{'UserId':_0x558d9d['id'],'OpenchannelQueueId':_0x4f6671['id']});});});});});}})[_0xb08c('0x19')](respondWithStatusCode(_0x2060b7,null))[_0xb08c('0x2b')](handleError(_0x2060b7,null));};exports[_0xb08c('0x63')]=function(_0x14fb9e,_0xc09715){return db[_0xb08c('0x56')][_0xb08c('0x64')]({'where':{'id':_0x14fb9e['query'][_0xb08c('0x58')]},'attributes':['id'],'include':[{'model':db[_0xb08c('0x4c')],'as':_0xb08c('0x5c'),'attributes':['id'],'raw':!![]}]})[_0xb08c('0x19')](handleEntityNotFound(_0xc09715,null))[_0xb08c('0x19')](function(_0x1ea0de){var _0x143b5a=_[_0xb08c('0x4e')](_0x1ea0de,'id');var _0x2d27ed=[];var _0xedc512=[];var _0x1d0b41=squel[_0xb08c('0x65')]();_0x1d0b41['field']('tq.TeamId')[_0xb08c('0x66')](_0xb08c('0x67'),'tq')['join']('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0xb08c('0x28')](_0xb08c('0x68'),_0x14fb9e[_0xb08c('0x2d')]['id']);for(var _0x4e260b=0x0;_0x4e260b<_0x1ea0de[_0xb08c('0x34')];_0x4e260b+=0x1){let _0x5a69a2=_0x1ea0de[_0x4e260b];for(var _0x3956ca=0x0;_0x3956ca<_0x5a69a2[_0xb08c('0x5c')]['length'];_0x3956ca+=0x1){let _0xc2ac65=_0x5a69a2['Agents'][_0x3956ca];var _0x20cc6b=_0x1d0b41[_0xb08c('0x69')]();_0x20cc6b[_0xb08c('0x28')](_0xb08c('0x6a'),_0xc2ac65['id']);_0xedc512[_0xb08c('0x6b')](db[_0xb08c('0x5d')]['query'](_0x20cc6b[_0xb08c('0x6c')](),{'type':db[_0xb08c('0x5d')][_0xb08c('0x6d')][_0xb08c('0x6e')]})[_0xb08c('0x19')](function(_0x576e8e){if(_0x576e8e['length']===0x1){return _0xc2ac65['id'];}else{var _0xa3b78b=_[_0xb08c('0x6f')](_[_0xb08c('0x4e')](_0x576e8e,_0xb08c('0x70')),function(_0x5ab8b9){return _[_0xb08c('0x71')](_0x143b5a,_0x5ab8b9);});if(_0xa3b78b){return _0xc2ac65['id'];}}}));}}return BPromise[_0xb08c('0x72')](_0xedc512)[_0xb08c('0x19')](function(_0x3cd965){_0x2d27ed=_(_0x2d27ed)[_0xb08c('0x73')](_0x3cd965)['compact']()['value']();return db[_0xb08c('0x22')][_0xb08c('0x39')]({'where':{'id':_0x14fb9e[_0xb08c('0x2d')]['id']}})[_0xb08c('0x19')](function(_0x3df374){return db['sequelize']['transaction'](function(_0x49cc59){return _0x3df374['removeTeams'](_0x14fb9e[_0xb08c('0x29')][_0xb08c('0x58')],{'transaction':_0x49cc59})[_0xb08c('0x19')](function(){if(!_[_0xb08c('0x74')](_0x2d27ed)){return _0x3df374[_0xb08c('0x75')](_0x2d27ed,{'transaction':_0x49cc59});}})[_0xb08c('0x19')](function(){_0x2d27ed[_0xb08c('0x60')](function(_0xa33f50){socket[_0xb08c('0x61')](_0xb08c('0x76'),{'UserId':_0xa33f50,'OpenchannelQueueId':_0x3df374['id']});});});});});});})[_0xb08c('0x19')](respondWithStatusCode(_0xc09715,null))[_0xb08c('0x2b')](handleError(_0xc09715,null));};exports[_0xb08c('0x77')]=function(_0x1868fa,_0x153c85){return db[_0xb08c('0x22')]['find']({'where':{'id':_0x1868fa[_0xb08c('0x2d')]['id']}})[_0xb08c('0x19')](handleEntityNotFound(_0x153c85,null))[_0xb08c('0x19')](function(_0x4309f2){if(_0x4309f2){return _0x4309f2[_0xb08c('0x77')](_0x1868fa['body'][_0xb08c('0x58')],_[_0xb08c('0x78')](_0x1868fa[_0xb08c('0x3b')],['ids','id'])||{})[_0xb08c('0x79')](function(_0x1318e1){for(var _0x2dbe68=0x0;_0x2dbe68<_0x1868fa[_0xb08c('0x3b')]['ids'][_0xb08c('0x34')];_0x2dbe68+=0x1){socket['emit'](_0xb08c('0x62'),{'UserId':Number(_0x1868fa[_0xb08c('0x3b')][_0xb08c('0x58')][_0x2dbe68]),'OpenchannelQueueId':Number(_0x1868fa[_0xb08c('0x2d')]['id'])});}return _0x1318e1;});}})[_0xb08c('0x19')](respondWithResult(_0x153c85,null))[_0xb08c('0x2b')](handleError(_0x153c85,null));};exports[_0xb08c('0x75')]=function(_0x2661ef,_0x50b3b7){return db['OpenchannelQueue']['find']({'where':{'id':_0x2661ef['params']['id']}})[_0xb08c('0x19')](handleEntityNotFound(_0x50b3b7,null))[_0xb08c('0x19')](function(_0x3b8425){if(_0x3b8425){return _0x3b8425[_0xb08c('0x75')](_0x2661ef['query'][_0xb08c('0x58')])[_0xb08c('0x19')](function(){if(_[_0xb08c('0x7a')](_0x2661ef[_0xb08c('0x29')]['ids'])){for(var _0x44156b=0x0;_0x44156b<_0x2661ef[_0xb08c('0x29')][_0xb08c('0x58')][_0xb08c('0x34')];_0x44156b+=0x1){socket[_0xb08c('0x61')](_0xb08c('0x76'),{'UserId':Number(_0x2661ef[_0xb08c('0x29')][_0xb08c('0x58')][_0x44156b]),'OpenchannelQueueId':Number(_0x2661ef[_0xb08c('0x2d')]['id'])});}}else{socket[_0xb08c('0x61')]('userOpenchannelQueue:remove',{'UserId':Number(_0x2661ef[_0xb08c('0x29')][_0xb08c('0x58')]),'OpenchannelQueueId':Number(_0x2661ef['params']['id'])});}});}})[_0xb08c('0x19')](respondWithStatusCode(_0x50b3b7,null))[_0xb08c('0x2b')](handleError(_0x50b3b7,null));};exports['getAgents']=function(_0x921707,_0xd65b40){var _0x27149c={};var _0x16205d={};var _0x4ab374;var _0x434e69;return db['OpenchannelQueue'][_0xb08c('0x55')]({'where':{'id':_0x921707[_0xb08c('0x2d')]['id']}})[_0xb08c('0x19')](handleEntityNotFound(_0xd65b40,null))[_0xb08c('0x19')](function(_0x1f1c38){if(_0x1f1c38){_0x4ab374=_0x1f1c38;_0x16205d[_0xb08c('0x2e')]=_[_0xb08c('0x2f')](db['User'][_0xb08c('0x23')]);_0x16205d[_0xb08c('0x29')]=_[_0xb08c('0x2f')](_0x921707['query']);_0x16205d[_0xb08c('0x30')]=_['intersection'](_0x16205d[_0xb08c('0x2e')],_0x16205d['query']);_0x27149c['attributes']=_[_0xb08c('0x31')](_0x16205d[_0xb08c('0x2e')],qs[_0xb08c('0x33')](_0x921707['query'][_0xb08c('0x33')]));_0x27149c[_0xb08c('0x32')]=_0x27149c[_0xb08c('0x32')]['length']?_0x27149c[_0xb08c('0x32')]:_0x16205d['model'];_0x27149c[_0xb08c('0x47')]=qs[_0xb08c('0x48')](_0x921707['query']['sort']);_0x27149c[_0xb08c('0x28')]=qs['filters'](_[_0xb08c('0x49')](_0x921707[_0xb08c('0x29')],_0x16205d[_0xb08c('0x30')]));if(_0x921707[_0xb08c('0x29')]['filter']){_0x27149c[_0xb08c('0x28')]=_[_0xb08c('0x37')](_0x27149c[_0xb08c('0x28')],{'$or':_[_0xb08c('0x4e')](_0x27149c[_0xb08c('0x32')],function(_0x281959){var _0xb5f700={};_0xb5f700[_0x281959]={'$like':'%'+_0x921707[_0xb08c('0x29')][_0xb08c('0x4b')]+'%'};return _0xb5f700;})});}_0x27149c=_['merge']({},_0x27149c,_0x921707[_0xb08c('0x38')]);return _0x4ab374['getAgents'](_0x27149c);}})[_0xb08c('0x19')](function(_0x29270e){if(_0x29270e){_0x434e69=_0x29270e[_0xb08c('0x34')];if(!_0x921707[_0xb08c('0x29')]['hasOwnProperty']('nolimit')){_0x27149c[_0xb08c('0x14')]=qs[_0xb08c('0x14')](_0x921707[_0xb08c('0x29')][_0xb08c('0x14')]);_0x27149c[_0xb08c('0x13')]=qs[_0xb08c('0x13')](_0x921707[_0xb08c('0x29')][_0xb08c('0x13')]);}return _0x4ab374['getAgents'](_0x27149c);}})[_0xb08c('0x19')](function(_0x76f68e){if(_0x76f68e){return _0x76f68e?{'count':_0x434e69,'rows':_0x76f68e}:null;}})[_0xb08c('0x19')](respondWithResult(_0xd65b40,null))[_0xb08c('0x2b')](handleError(_0xd65b40,null));}; \ No newline at end of file +var _0x4b77=['includes','all','union','value','removeAgents','emit','userOpenchannelQueue:remove','addAgents','omit','spread','isArray','getAgents','bluebird','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','localhost','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','status','end','json','offset','undefined','count','set','update','then','get','destroy','error','stack','name','send','index','map','OpenchannelQueue','rawAttributes','type','key','getOptions','where','include','query','rows','catch','show','params','keys','model','attributes','intersection','fields','length','includeAll','merge','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','OpenchannelQueues','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserOpenchannelQueue','filters','nolimit','limit','order','sort','pick','OpenchannelQueueId','filter','findAll','User','findAndCountAll','UserId','openchannelPause','updatedAt','format','SIP','Team','getTeams','hasOwnProperty','addTeams','Agents','online','voicePause','interface','sequelize','transaction','findOrCreate','userOpenchannelQueue:save','removeTeams','ids','select','field','tq.TeamId','team_has_openchannel_queues','join','user_has_teams','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x4b77,0x180));var _0x74b7=function(_0x5c422f,_0x40274a){_0x5c422f=_0x5c422f-0x0;var _0x193768=_0x4b77[_0x5c422f];return _0x193768;};'use strict';var BPromise=require(_0x74b7('0x0'));var util=require('util');var _=require(_0x74b7('0x1'));var squel=require('squel');var Redis=require(_0x74b7('0x2'));var qs=require(_0x74b7('0x3'));var logger=require(_0x74b7('0x4'))(_0x74b7('0x5'));var config=require('../../config/environment');var db=require(_0x74b7('0x6'))['db'];config['redis']=_['defaults'](config[_0x74b7('0x7')],{'host':_0x74b7('0x8'),'port':0x18eb});var socket=require(_0x74b7('0x9'))(new Redis(config[_0x74b7('0x7')]));require(_0x74b7('0xa'))[_0x74b7('0xb')](socket);function respondWithStatusCode(_0x27403d,_0x28a950){_0x28a950=_0x28a950||0xcc;return function(_0x20520f){if(_0x20520f){return _0x27403d[_0x74b7('0xc')](_0x28a950);}return _0x27403d[_0x74b7('0xd')](_0x28a950)[_0x74b7('0xe')]();};}function respondWithResult(_0x12fb8f,_0xb75a40){_0xb75a40=_0xb75a40||0xc8;return function(_0x52861d){if(_0x52861d){return _0x12fb8f[_0x74b7('0xd')](_0xb75a40)[_0x74b7('0xf')](_0x52861d);}};}function respondWithFilteredResult(_0x3673bf,_0x471c6b){return function(_0x359eb5){if(_0x359eb5){var _0x3bf779=typeof _0x471c6b[_0x74b7('0x10')]==='undefined'&&typeof _0x471c6b['limit']===_0x74b7('0x11');var _0x270ffc=_0x359eb5[_0x74b7('0x12')];var _0x136a62=_0x3bf779?0x0:_0x471c6b[_0x74b7('0x10')];var _0x5a2734=_0x3bf779?_0x359eb5['count']:_0x471c6b[_0x74b7('0x10')]+_0x471c6b['limit'];var _0x5650cb;if(_0x5a2734>=_0x270ffc){_0x5a2734=_0x270ffc;_0x5650cb=0xc8;}else{_0x5650cb=0xce;}_0x3673bf[_0x74b7('0xd')](_0x5650cb);return _0x3673bf[_0x74b7('0x13')]('Content-Range',_0x136a62+'-'+_0x5a2734+'/'+_0x270ffc)[_0x74b7('0xf')](_0x359eb5);}return null;};}function saveUpdates(_0x10832e){return function(_0x3b79a5){if(_0x3b79a5){return _0x3b79a5[_0x74b7('0x14')](_0x10832e)[_0x74b7('0x15')](function(_0xce15ea){return _0xce15ea;});}return null;};}function removeEntity(_0x174a35){return function(_0x550144){if(_0x550144){return _0x550144['destroy']()[_0x74b7('0x15')](function(){var _0x124b79=_0x550144[_0x74b7('0x16')]({'plain':!![]});var _0x189d29='OpenchannelQueues';return db['UserProfileResource'][_0x74b7('0x17')]({'where':{'type':_0x189d29,'resourceId':_0x124b79['id']}})['then'](function(){return _0x550144;});})[_0x74b7('0x15')](function(){_0x174a35[_0x74b7('0xd')](0xcc)[_0x74b7('0xe')]();});}};}function handleEntityNotFound(_0x4515b7){return function(_0x32c58b){if(!_0x32c58b){_0x4515b7[_0x74b7('0xc')](0x194);}return _0x32c58b;};}function handleError(_0x4337ec,_0x75a7c7){_0x75a7c7=_0x75a7c7||0x1f4;return function(_0x5b5cd9){logger[_0x74b7('0x18')](_0x5b5cd9[_0x74b7('0x19')]);if(_0x5b5cd9[_0x74b7('0x1a')]){delete _0x5b5cd9[_0x74b7('0x1a')];}_0x4337ec[_0x74b7('0xd')](_0x75a7c7)[_0x74b7('0x1b')](_0x5b5cd9);};}exports[_0x74b7('0x1c')]=function(_0x54f771,_0x5969b7){var _0x55224c={};var _0x43b167={'count':0x0,'rows':[]};var _0x13e1c8=_[_0x74b7('0x1d')](db[_0x74b7('0x1e')][_0x74b7('0x1f')],function(_0x3c44ce){return{'name':_0x3c44ce['fieldName'],'type':_0x3c44ce[_0x74b7('0x20')][_0x74b7('0x21')]};});_0x55224c=qs[_0x74b7('0x22')](_0x13e1c8,_0x54f771);var _0x2e4b47={'where':_0x55224c[_0x74b7('0x23')]};return db['OpenchannelQueue'][_0x74b7('0x12')](_0x2e4b47)[_0x74b7('0x15')](function(_0xaba3da){_0x43b167[_0x74b7('0x12')]=_0xaba3da;_0x55224c[_0x74b7('0x24')]=qs[_0x74b7('0x24')](_0x54f771[_0x74b7('0x25')]);return db[_0x74b7('0x1e')]['findAll'](_0x55224c);})[_0x74b7('0x15')](function(_0x31e8a2){_0x43b167[_0x74b7('0x26')]=_0x31e8a2;return _0x43b167;})[_0x74b7('0x15')](respondWithFilteredResult(_0x5969b7,_0x55224c))[_0x74b7('0x27')](handleError(_0x5969b7,null));};exports[_0x74b7('0x28')]=function(_0x1c69ed,_0x46f113){var _0x124ce1={'raw':!![],'where':{'id':_0x1c69ed[_0x74b7('0x29')]['id']}},_0x2c92ab={};_0x2c92ab['model']=_[_0x74b7('0x2a')](db[_0x74b7('0x1e')]['rawAttributes']);_0x2c92ab[_0x74b7('0x25')]=_[_0x74b7('0x2a')](_0x1c69ed[_0x74b7('0x25')]);_0x2c92ab['filters']=_['intersection'](_0x2c92ab[_0x74b7('0x2b')],_0x2c92ab[_0x74b7('0x25')]);_0x124ce1[_0x74b7('0x2c')]=_[_0x74b7('0x2d')](_0x2c92ab[_0x74b7('0x2b')],qs[_0x74b7('0x2e')](_0x1c69ed[_0x74b7('0x25')][_0x74b7('0x2e')]));_0x124ce1[_0x74b7('0x2c')]=_0x124ce1['attributes'][_0x74b7('0x2f')]?_0x124ce1['attributes']:_0x2c92ab[_0x74b7('0x2b')];if(_0x1c69ed[_0x74b7('0x25')][_0x74b7('0x30')]){_0x124ce1[_0x74b7('0x24')]=[{'all':!![]}];}_0x124ce1=_[_0x74b7('0x31')]({},_0x124ce1,_0x1c69ed[_0x74b7('0x32')]);return db[_0x74b7('0x1e')][_0x74b7('0x33')](_0x124ce1)['then'](handleEntityNotFound(_0x46f113,null))[_0x74b7('0x15')](respondWithResult(_0x46f113,null))[_0x74b7('0x27')](handleError(_0x46f113,null));};exports[_0x74b7('0x34')]=function(_0x2d338d,_0x3c39c7){return db[_0x74b7('0x1e')][_0x74b7('0x34')](_0x2d338d[_0x74b7('0x35')],{})[_0x74b7('0x15')](function(_0x5971c7){var _0x4558e4=_0x2d338d[_0x74b7('0x36')]['get']({'plain':!![]});if(!_0x4558e4)throw new Error(_0x74b7('0x37'));if(_0x4558e4[_0x74b7('0x38')]===_0x74b7('0x36')){var _0x16ad2b=_0x5971c7[_0x74b7('0x16')]({'plain':!![]});var _0x20bfe9=_0x74b7('0x39');return db[_0x74b7('0x3a')][_0x74b7('0x33')]({'where':{'name':_0x20bfe9,'userProfileId':_0x4558e4[_0x74b7('0x3b')]},'raw':!![]})[_0x74b7('0x15')](function(_0x2770b6){if(_0x2770b6&&_0x2770b6[_0x74b7('0x3c')]===0x0){return db[_0x74b7('0x3d')]['create']({'name':_0x16ad2b['name'],'resourceId':_0x16ad2b['id'],'type':_0x2770b6[_0x74b7('0x1a')],'sectionId':_0x2770b6['id']},{})[_0x74b7('0x15')](function(){return _0x5971c7;});}else{return _0x5971c7;}})[_0x74b7('0x27')](function(_0x15e9b9){logger[_0x74b7('0x18')](_0x74b7('0x3e'),_0x15e9b9);throw _0x15e9b9;});}return _0x5971c7;})[_0x74b7('0x15')](respondWithResult(_0x3c39c7,0xc9))[_0x74b7('0x27')](handleError(_0x3c39c7,null));};exports[_0x74b7('0x14')]=function(_0x2b4aa0,_0x4d8800){if(_0x2b4aa0[_0x74b7('0x35')]['id']){delete _0x2b4aa0[_0x74b7('0x35')]['id'];}return db[_0x74b7('0x1e')]['find']({'where':{'id':_0x2b4aa0['params']['id']}})['then'](handleEntityNotFound(_0x4d8800,null))['then'](saveUpdates(_0x2b4aa0[_0x74b7('0x35')],null))[_0x74b7('0x15')](respondWithResult(_0x4d8800,null))['catch'](handleError(_0x4d8800,null));};exports['destroy']=function(_0x2528ad,_0x1e7b50){return db['OpenchannelQueue'][_0x74b7('0x33')]({'where':{'id':_0x2528ad[_0x74b7('0x29')]['id']}})['then'](handleEntityNotFound(_0x1e7b50,null))[_0x74b7('0x15')](removeEntity(_0x1e7b50,null))[_0x74b7('0x27')](handleError(_0x1e7b50,null));};exports[_0x74b7('0x3f')]=function(_0xa39e95,_0x505f85){return db[_0x74b7('0x1e')][_0x74b7('0x3f')]()[_0x74b7('0x15')](respondWithResult(_0x505f85,null))[_0x74b7('0x27')](handleError(_0x505f85,null));};exports[_0x74b7('0x40')]=function(_0x5f1ff6,_0x643d56){var _0x28a5c9={'raw':!![],'where':{}},_0x2eff92={},_0x16d69f;return db[_0x74b7('0x1e')][_0x74b7('0x41')]({'where':{'id':_0x5f1ff6['params']['id']}})[_0x74b7('0x15')](handleEntityNotFound(_0x643d56,null))[_0x74b7('0x15')](function(_0xa4c6fe){if(_0xa4c6fe){_0x16d69f=_0xa4c6fe[_0x74b7('0x16')]({'plain':!![]});_0x2eff92['model']=_[_0x74b7('0x2a')](db[_0x74b7('0x42')]['rawAttributes']);_0x2eff92[_0x74b7('0x25')]=_[_0x74b7('0x2a')](_0x5f1ff6[_0x74b7('0x25')]);_0x2eff92[_0x74b7('0x43')]=_[_0x74b7('0x2d')](_0x2eff92['model'],_0x2eff92['query']);_0x28a5c9[_0x74b7('0x2c')]=_['intersection'](_0x2eff92[_0x74b7('0x2b')],qs[_0x74b7('0x2e')](_0x5f1ff6[_0x74b7('0x25')][_0x74b7('0x2e')]));_0x28a5c9[_0x74b7('0x2c')]=_0x28a5c9['attributes'][_0x74b7('0x2f')]?_0x28a5c9[_0x74b7('0x2c')]:_0x2eff92[_0x74b7('0x2b')];if(!_0x5f1ff6[_0x74b7('0x25')]['hasOwnProperty'](_0x74b7('0x44'))){_0x28a5c9['limit']=qs[_0x74b7('0x45')](_0x5f1ff6[_0x74b7('0x25')][_0x74b7('0x45')]);_0x28a5c9[_0x74b7('0x10')]=qs['offset'](_0x5f1ff6['query']['offset']);}_0x28a5c9[_0x74b7('0x46')]=qs[_0x74b7('0x47')](_0x5f1ff6[_0x74b7('0x25')][_0x74b7('0x47')]);_0x28a5c9[_0x74b7('0x23')]=qs['filters'](_[_0x74b7('0x48')](_0x5f1ff6[_0x74b7('0x25')],_0x2eff92['filters']));_0x28a5c9['where'][_0x74b7('0x49')]=_0xa4c6fe['id'];if(_0x5f1ff6['query'][_0x74b7('0x4a')]){_0x28a5c9[_0x74b7('0x23')]=_['merge'](_0x28a5c9[_0x74b7('0x23')],{'$or':_[_0x74b7('0x1d')](_0x28a5c9[_0x74b7('0x2c')],function(_0x4e7bd2){var _0x30c842={};_0x30c842[_0x4e7bd2]={'$like':'%'+_0x5f1ff6[_0x74b7('0x25')][_0x74b7('0x4a')]+'%'};return _0x30c842;})});}_0x28a5c9=_[_0x74b7('0x31')]({},_0x28a5c9,_0x5f1ff6[_0x74b7('0x32')]);return db[_0x74b7('0x42')][_0x74b7('0x4b')](_0x28a5c9);}})[_0x74b7('0x15')](function(_0x2a53c0){if(_0x2a53c0){return db[_0x74b7('0x4c')][_0x74b7('0x4d')]({'where':{'id':_['map'](_0x2a53c0,_0x74b7('0x4e')),'role':'agent'},'attributes':['id',_0x74b7('0x1a'),_0x74b7('0x4f'),_0x74b7('0x50'),'createdAt']});}})[_0x74b7('0x15')](function(_0x34ab80){if(_0x34ab80){return{'count':_0x34ab80['count'],'rows':_['map'](_0x34ab80['rows'],function(_0x4362a0){return{'membername':_0x4362a0[_0x74b7('0x1a')],'UserId':_0x4362a0['id'],'queue_name':_0x16d69f[_0x74b7('0x1a')],'OpenchannelQueueId':_0x16d69f['id'],'interface':util[_0x74b7('0x51')]('%s/%s',_0x74b7('0x52'),_0x4362a0[_0x74b7('0x1a')]),'penalty':0x0,'paused':_0x4362a0[_0x74b7('0x4f')],'createdAt':_0x4362a0['createdAt'],'updatedAt':_0x4362a0[_0x74b7('0x50')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x74b7('0x15')](respondWithFilteredResult(_0x643d56,_0x28a5c9))[_0x74b7('0x27')](handleError(_0x643d56,null));};exports['getTeams']=function(_0x1e4bf5,_0x491e4e){var _0x3057f0={};var _0x2500d3={};var _0xf88379;var _0x56ffbd;return db[_0x74b7('0x1e')][_0x74b7('0x41')]({'where':{'id':_0x1e4bf5[_0x74b7('0x29')]['id']}})[_0x74b7('0x15')](handleEntityNotFound(_0x491e4e,null))['then'](function(_0x2d59a6){if(_0x2d59a6){_0xf88379=_0x2d59a6;_0x2500d3[_0x74b7('0x2b')]=_['keys'](db[_0x74b7('0x53')][_0x74b7('0x1f')]);_0x2500d3[_0x74b7('0x25')]=_['keys'](_0x1e4bf5['query']);_0x2500d3[_0x74b7('0x43')]=_['intersection'](_0x2500d3['model'],_0x2500d3[_0x74b7('0x25')]);_0x3057f0[_0x74b7('0x2c')]=_[_0x74b7('0x2d')](_0x2500d3[_0x74b7('0x2b')],qs[_0x74b7('0x2e')](_0x1e4bf5[_0x74b7('0x25')]['fields']));_0x3057f0[_0x74b7('0x2c')]=_0x3057f0[_0x74b7('0x2c')]['length']?_0x3057f0[_0x74b7('0x2c')]:_0x2500d3[_0x74b7('0x2b')];_0x3057f0[_0x74b7('0x46')]=qs[_0x74b7('0x47')](_0x1e4bf5[_0x74b7('0x25')][_0x74b7('0x47')]);_0x3057f0[_0x74b7('0x23')]=qs[_0x74b7('0x43')](_[_0x74b7('0x48')](_0x1e4bf5[_0x74b7('0x25')],_0x2500d3[_0x74b7('0x43')]));if(_0x1e4bf5['query'][_0x74b7('0x4a')]){_0x3057f0[_0x74b7('0x23')]=_[_0x74b7('0x31')](_0x3057f0['where'],{'$or':_[_0x74b7('0x1d')](_0x3057f0[_0x74b7('0x2c')],function(_0x57e24f){var _0x4c2f05={};_0x4c2f05[_0x57e24f]={'$like':'%'+_0x1e4bf5[_0x74b7('0x25')][_0x74b7('0x4a')]+'%'};return _0x4c2f05;})});}_0x3057f0=_[_0x74b7('0x31')]({},_0x3057f0,_0x1e4bf5[_0x74b7('0x32')]);return _0xf88379[_0x74b7('0x54')](_0x3057f0);}})['then'](function(_0x220123){if(_0x220123){_0x56ffbd=_0x220123[_0x74b7('0x2f')];if(!_0x1e4bf5[_0x74b7('0x25')][_0x74b7('0x55')](_0x74b7('0x44'))){_0x3057f0[_0x74b7('0x45')]=qs[_0x74b7('0x45')](_0x1e4bf5[_0x74b7('0x25')][_0x74b7('0x45')]);_0x3057f0[_0x74b7('0x10')]=qs['offset'](_0x1e4bf5[_0x74b7('0x25')][_0x74b7('0x10')]);}return _0xf88379[_0x74b7('0x54')](_0x3057f0);}})[_0x74b7('0x15')](function(_0x36076d){if(_0x36076d){return _0x36076d?{'count':_0x56ffbd,'rows':_0x36076d}:null;}})['then'](respondWithResult(_0x491e4e,null))[_0x74b7('0x27')](handleError(_0x491e4e,null));};exports[_0x74b7('0x56')]=function(_0x1685ec,_0x59ab4f){var _0x28417a=_0x1685ec[_0x74b7('0x35')]['ids'];return db['Team'][_0x74b7('0x4b')]({'where':{'id':_0x28417a},'attributes':['id'],'include':[{'model':db['User'],'as':_0x74b7('0x57'),'attributes':['id',_0x74b7('0x1a'),_0x74b7('0x58'),_0x74b7('0x59'),_0x74b7('0x5a')],'raw':!![]}]})[_0x74b7('0x15')](function(_0xa2b8b3){if(_0xa2b8b3){var _0x1b588f=_['flatMap'](_0xa2b8b3,function(_0x172d96){var _0x45b781=_0x172d96[_0x74b7('0x16')]({'plain':!![]});return _0x45b781[_0x74b7('0x57')];});return db[_0x74b7('0x1e')]['find']({'where':{'id':_0x1685ec[_0x74b7('0x29')]['id']}})['then'](function(_0x41aafd){return db[_0x74b7('0x5b')][_0x74b7('0x5c')](function(_0x15b304){return _0x41aafd[_0x74b7('0x56')](_0x28417a,{'transaction':_0x15b304})[_0x74b7('0x15')](function(){return BPromise['each'](_0x1b588f,function(_0x4ed761){return db[_0x74b7('0x42')][_0x74b7('0x5d')]({'where':{'UserId':_0x4ed761['id'],'OpenchannelQueueId':_0x1685ec[_0x74b7('0x29')]['id']},'transaction':_0x15b304});});})[_0x74b7('0x15')](function(){_0x1b588f['forEach'](function(_0x56eb57){socket['emit'](_0x74b7('0x5e'),{'UserId':_0x56eb57['id'],'OpenchannelQueueId':_0x41aafd['id']});});});});});}})[_0x74b7('0x15')](respondWithStatusCode(_0x59ab4f,null))[_0x74b7('0x27')](handleError(_0x59ab4f,null));};exports[_0x74b7('0x5f')]=function(_0x123b59,_0x5ed691){return db['Team'][_0x74b7('0x4b')]({'where':{'id':_0x123b59[_0x74b7('0x25')][_0x74b7('0x60')]},'attributes':['id'],'include':[{'model':db[_0x74b7('0x4c')],'as':_0x74b7('0x57'),'attributes':['id'],'raw':!![]}]})[_0x74b7('0x15')](handleEntityNotFound(_0x5ed691,null))['then'](function(_0x193edc){var _0x116da1=_[_0x74b7('0x1d')](_0x193edc,'id');var _0x5236a3=[];var _0x29ccae=[];var _0x1ed041=squel[_0x74b7('0x61')]();_0x1ed041[_0x74b7('0x62')](_0x74b7('0x63'))['from'](_0x74b7('0x64'),'tq')[_0x74b7('0x65')](_0x74b7('0x66'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x74b7('0x23')](_0x74b7('0x67'),_0x123b59[_0x74b7('0x29')]['id']);for(var _0x598f24=0x0;_0x598f24<_0x193edc[_0x74b7('0x2f')];_0x598f24+=0x1){let _0x475be9=_0x193edc[_0x598f24];for(var _0x3c82c4=0x0;_0x3c82c4<_0x475be9[_0x74b7('0x57')]['length'];_0x3c82c4+=0x1){let _0x1719f6=_0x475be9[_0x74b7('0x57')][_0x3c82c4];var _0xfc06ea=_0x1ed041[_0x74b7('0x68')]();_0xfc06ea['where'](_0x74b7('0x69'),_0x1719f6['id']);_0x29ccae[_0x74b7('0x6a')](db[_0x74b7('0x5b')][_0x74b7('0x25')](_0xfc06ea[_0x74b7('0x6b')](),{'type':db[_0x74b7('0x5b')][_0x74b7('0x6c')][_0x74b7('0x6d')]})[_0x74b7('0x15')](function(_0x243057){if(_0x243057[_0x74b7('0x2f')]===0x1){return _0x1719f6['id'];}else{var _0x720dfe=_[_0x74b7('0x6e')](_['map'](_0x243057,_0x74b7('0x6f')),function(_0x871f70){return _[_0x74b7('0x70')](_0x116da1,_0x871f70);});if(_0x720dfe){return _0x1719f6['id'];}}}));}}return BPromise[_0x74b7('0x71')](_0x29ccae)[_0x74b7('0x15')](function(_0x4f02e0){_0x5236a3=_(_0x5236a3)[_0x74b7('0x72')](_0x4f02e0)['compact']()[_0x74b7('0x73')]();return db[_0x74b7('0x1e')]['find']({'where':{'id':_0x123b59[_0x74b7('0x29')]['id']}})[_0x74b7('0x15')](function(_0x5aec46){return db[_0x74b7('0x5b')][_0x74b7('0x5c')](function(_0x4ae2e3){return _0x5aec46[_0x74b7('0x5f')](_0x123b59[_0x74b7('0x25')][_0x74b7('0x60')],{'transaction':_0x4ae2e3})[_0x74b7('0x15')](function(){if(!_['isEmpty'](_0x5236a3)){return _0x5aec46[_0x74b7('0x74')](_0x5236a3,{'transaction':_0x4ae2e3});}})[_0x74b7('0x15')](function(){_0x5236a3['forEach'](function(_0x2ca789){socket[_0x74b7('0x75')](_0x74b7('0x76'),{'UserId':_0x2ca789,'OpenchannelQueueId':_0x5aec46['id']});});});});});});})[_0x74b7('0x15')](respondWithStatusCode(_0x5ed691,null))[_0x74b7('0x27')](handleError(_0x5ed691,null));};exports[_0x74b7('0x77')]=function(_0x495e6a,_0x519848){return db[_0x74b7('0x1e')][_0x74b7('0x33')]({'where':{'id':_0x495e6a['params']['id']}})[_0x74b7('0x15')](handleEntityNotFound(_0x519848,null))[_0x74b7('0x15')](function(_0x267d6d){if(_0x267d6d){return _0x267d6d[_0x74b7('0x77')](_0x495e6a[_0x74b7('0x35')][_0x74b7('0x60')],_[_0x74b7('0x78')](_0x495e6a[_0x74b7('0x35')],[_0x74b7('0x60'),'id'])||{})[_0x74b7('0x79')](function(_0x283f1f){for(var _0x450379=0x0;_0x450379<_0x495e6a[_0x74b7('0x35')]['ids'][_0x74b7('0x2f')];_0x450379+=0x1){socket[_0x74b7('0x75')](_0x74b7('0x5e'),{'UserId':Number(_0x495e6a['body'][_0x74b7('0x60')][_0x450379]),'OpenchannelQueueId':Number(_0x495e6a[_0x74b7('0x29')]['id'])});}return _0x283f1f;});}})['then'](respondWithResult(_0x519848,null))[_0x74b7('0x27')](handleError(_0x519848,null));};exports[_0x74b7('0x74')]=function(_0x91f00d,_0x10ed3e){return db[_0x74b7('0x1e')][_0x74b7('0x33')]({'where':{'id':_0x91f00d['params']['id']}})[_0x74b7('0x15')](handleEntityNotFound(_0x10ed3e,null))[_0x74b7('0x15')](function(_0x63134d){if(_0x63134d){return _0x63134d[_0x74b7('0x74')](_0x91f00d['query']['ids'])[_0x74b7('0x15')](function(){if(_[_0x74b7('0x7a')](_0x91f00d[_0x74b7('0x25')][_0x74b7('0x60')])){for(var _0x41ad96=0x0;_0x41ad96<_0x91f00d[_0x74b7('0x25')][_0x74b7('0x60')][_0x74b7('0x2f')];_0x41ad96+=0x1){socket[_0x74b7('0x75')](_0x74b7('0x76'),{'UserId':Number(_0x91f00d['query']['ids'][_0x41ad96]),'OpenchannelQueueId':Number(_0x91f00d[_0x74b7('0x29')]['id'])});}}else{socket[_0x74b7('0x75')]('userOpenchannelQueue:remove',{'UserId':Number(_0x91f00d[_0x74b7('0x25')][_0x74b7('0x60')]),'OpenchannelQueueId':Number(_0x91f00d[_0x74b7('0x29')]['id'])});}});}})['then'](respondWithStatusCode(_0x10ed3e,null))[_0x74b7('0x27')](handleError(_0x10ed3e,null));};exports['getAgents']=function(_0x25c8c2,_0x11759c){var _0x2a7490={};var _0x57a204={};var _0x2f3517;var _0x585ae8;return db[_0x74b7('0x1e')][_0x74b7('0x41')]({'where':{'id':_0x25c8c2[_0x74b7('0x29')]['id']}})['then'](handleEntityNotFound(_0x11759c,null))['then'](function(_0x60a313){if(_0x60a313){_0x2f3517=_0x60a313;_0x57a204['model']=_['keys'](db[_0x74b7('0x4c')][_0x74b7('0x1f')]);_0x57a204[_0x74b7('0x25')]=_[_0x74b7('0x2a')](_0x25c8c2['query']);_0x57a204['filters']=_['intersection'](_0x57a204[_0x74b7('0x2b')],_0x57a204['query']);_0x2a7490['attributes']=_[_0x74b7('0x2d')](_0x57a204[_0x74b7('0x2b')],qs[_0x74b7('0x2e')](_0x25c8c2[_0x74b7('0x25')][_0x74b7('0x2e')]));_0x2a7490[_0x74b7('0x2c')]=_0x2a7490['attributes']['length']?_0x2a7490['attributes']:_0x57a204[_0x74b7('0x2b')];_0x2a7490[_0x74b7('0x46')]=qs[_0x74b7('0x47')](_0x25c8c2[_0x74b7('0x25')][_0x74b7('0x47')]);_0x2a7490[_0x74b7('0x23')]=qs[_0x74b7('0x43')](_[_0x74b7('0x48')](_0x25c8c2[_0x74b7('0x25')],_0x57a204['filters']));if(_0x25c8c2[_0x74b7('0x25')][_0x74b7('0x4a')]){_0x2a7490[_0x74b7('0x23')]=_[_0x74b7('0x31')](_0x2a7490[_0x74b7('0x23')],{'$or':_[_0x74b7('0x1d')](_0x2a7490[_0x74b7('0x2c')],function(_0x365f8c){var _0x29e948={};_0x29e948[_0x365f8c]={'$like':'%'+_0x25c8c2['query'][_0x74b7('0x4a')]+'%'};return _0x29e948;})});}_0x2a7490=_['merge']({},_0x2a7490,_0x25c8c2[_0x74b7('0x32')]);return _0x2f3517[_0x74b7('0x7b')](_0x2a7490);}})[_0x74b7('0x15')](function(_0x1c7c47){if(_0x1c7c47){_0x585ae8=_0x1c7c47[_0x74b7('0x2f')];if(!_0x25c8c2['query'][_0x74b7('0x55')](_0x74b7('0x44'))){_0x2a7490[_0x74b7('0x45')]=qs[_0x74b7('0x45')](_0x25c8c2['query'][_0x74b7('0x45')]);_0x2a7490[_0x74b7('0x10')]=qs[_0x74b7('0x10')](_0x25c8c2[_0x74b7('0x25')][_0x74b7('0x10')]);}return _0x2f3517[_0x74b7('0x7b')](_0x2a7490);}})['then'](function(_0x19f9f6){if(_0x19f9f6){return _0x19f9f6?{'count':_0x585ae8,'rows':_0x19f9f6}:null;}})[_0x74b7('0x15')](respondWithResult(_0x11759c,null))[_0x74b7('0x27')](handleError(_0x11759c,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index e373ce0..63acfe5 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 _0x9a0e=['update','remove','emit','hook','events','../../mysqldb','OpenchannelQueue','save'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x9a0e,0x15c));var _0xe9a0=function(_0x577f12,_0x4449b0){_0x577f12=_0x577f12-0x0;var _0x370083=_0x9a0e[_0x577f12];return _0x370083;};'use strict';var EventEmitter=require(_0xe9a0('0x0'));var OpenchannelQueue=require(_0xe9a0('0x1'))['db'][_0xe9a0('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe9a0('0x3'),'afterUpdate':_0xe9a0('0x4'),'afterDestroy':_0xe9a0('0x5')};function emitEvent(_0x3c47ca){return function(_0x41af93,_0x36b977,_0x41c5c3){OpenchannelQueueEvents['emit'](_0x3c47ca+':'+_0x41af93['id'],_0x41af93);OpenchannelQueueEvents[_0xe9a0('0x6')](_0x3c47ca,_0x41af93);_0x41c5c3(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelQueue[_0xe9a0('0x7')](e,emitEvent(event));}}module['exports']=OpenchannelQueueEvents; \ No newline at end of file +var _0x33b9=['setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x4c58ef,_0x4984a4){var _0x3db58d=function(_0x2c0ab0){while(--_0x2c0ab0){_0x4c58ef['push'](_0x4c58ef['shift']());}};_0x3db58d(++_0x4984a4);}(_0x33b9,0x1ed));var _0x933b=function(_0x16b3b6,_0x21990e){_0x16b3b6=_0x16b3b6-0x0;var _0x1b00cf=_0x33b9[_0x16b3b6];return _0x1b00cf;};'use strict';var EventEmitter=require(_0x933b('0x0'));var OpenchannelQueue=require(_0x933b('0x1'))['db']['OpenchannelQueue'];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x933b('0x2')](0x0);var events={'afterCreate':_0x933b('0x3'),'afterUpdate':'update','afterDestroy':_0x933b('0x4')};function emitEvent(_0x35aaa6){return function(_0x43077d,_0x2b6c22,_0x36edb7){OpenchannelQueueEvents[_0x933b('0x5')](_0x35aaa6+':'+_0x43077d['id'],_0x43077d);OpenchannelQueueEvents['emit'](_0x35aaa6,_0x43077d);_0x36edb7(null);};}for(var e in events){if(events[_0x933b('0x6')](e)){var event=events[e];OpenchannelQueue[_0x933b('0x7')](e,emitEvent(event));}}module[_0x933b('0x8')]=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index f9b555a..8318e71 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 _0x7f0f=['rimraf','./openchannelQueue.attributes','exports','define','OpenchannelQueue','openchannel_queues','../../config/logger','api','moment','bluebird'];(function(_0x11a89e,_0x166edb){var _0x56b94b=function(_0x49946d){while(--_0x49946d){_0x11a89e['push'](_0x11a89e['shift']());}};_0x56b94b(++_0x166edb);}(_0x7f0f,0x1e6));var _0xf7f0=function(_0x8d5838,_0x3261c4){_0x8d5838=_0x8d5838-0x0;var _0x5c036a=_0x7f0f[_0x8d5838];return _0x5c036a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf7f0('0x0'))(_0xf7f0('0x1'));var moment=require(_0xf7f0('0x2'));var BPromise=require(_0xf7f0('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xf7f0('0x4'));var config=require('../../config/environment');var attributes=require(_0xf7f0('0x5'));module[_0xf7f0('0x6')]=function(_0x14aa6c,_0x1907a3){return _0x14aa6c[_0xf7f0('0x7')](_0xf7f0('0x8'),attributes,{'tableName':_0xf7f0('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x995d=['api','request-promise','rimraf','../../config/environment','./openchannelQueue.attributes','exports','define','OpenchannelQueue','openchannel_queues','lodash','util','../../config/logger'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x995d,0xe1));var _0xd995=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0x995d[_0x273c39];return _0x46d6b5;};'use strict';var _=require(_0xd995('0x0'));var util=require(_0xd995('0x1'));var logger=require(_0xd995('0x2'))(_0xd995('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xd995('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd995('0x5'));var config=require(_0xd995('0x6'));var attributes=require(_0xd995('0x7'));module[_0xd995('0x8')]=function(_0x9f125a,_0x4cf4fb){return _0x9f125a[_0xd995('0x9')](_0xd995('0xa'),attributes,{'tableName':_0xd995('0xb'),'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 2614424..9cac837 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 _0x3cb4=['limit','include','map','model','GetOpenchannelQueue','find','raw','ShowOpenchannelQueue','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./openchannelQueue.socket','register','request','then','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','OpenchannelQueue','findAll','options','where','attributes'];(function(_0x22a16e,_0x2ca090){var _0x4acc97=function(_0x375b55){while(--_0x375b55){_0x22a16e['push'](_0x22a16e['shift']());}};_0x4acc97(++_0x2ca090);}(_0x3cb4,0x1f4));var _0x43cb=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x3cb4[_0x501510];return _0x1e6ee5;};'use strict';var _=require('lodash');var util=require(_0x43cb('0x0'));var moment=require(_0x43cb('0x1'));var BPromise=require(_0x43cb('0x2'));var rs=require(_0x43cb('0x3'));var fs=require('fs');var Redis=require(_0x43cb('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x43cb('0x5'))(_0x43cb('0x6'));var config=require(_0x43cb('0x7'));var jayson=require(_0x43cb('0x8'));var client=jayson[_0x43cb('0x9')][_0x43cb('0xa')]({'port':0x232a});config[_0x43cb('0xb')]=_['defaults'](config[_0x43cb('0xb')],{'host':_0x43cb('0xc'),'port':0x18eb});var socket=require(_0x43cb('0xd'))(new Redis(config['redis']));require(_0x43cb('0xe'))[_0x43cb('0xf')](socket);function respondWithRpcPromise(_0xf7841b,_0x5e34e9,_0x48ddb3){return new BPromise(function(_0x2f277e,_0x4d8625){return client[_0x43cb('0x10')](_0xf7841b,_0x48ddb3)[_0x43cb('0x11')](function(_0xaf6cac){logger[_0x43cb('0x12')](_0x43cb('0x13'),_0x5e34e9,_0x43cb('0x14'));logger[_0x43cb('0x15')]('OpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x5e34e9,_0x43cb('0x14'),JSON[_0x43cb('0x16')](_0xaf6cac));if(_0xaf6cac[_0x43cb('0x17')]){if(_0xaf6cac[_0x43cb('0x17')][_0x43cb('0x18')]===0x1f4){logger[_0x43cb('0x17')](_0x43cb('0x13'),_0x5e34e9,_0xaf6cac[_0x43cb('0x17')][_0x43cb('0x19')]);return _0x4d8625(_0xaf6cac[_0x43cb('0x17')][_0x43cb('0x19')]);}logger[_0x43cb('0x17')](_0x43cb('0x13'),_0x5e34e9,_0xaf6cac['error']['message']);return _0x2f277e(_0xaf6cac[_0x43cb('0x17')][_0x43cb('0x19')]);}else{logger[_0x43cb('0x12')](_0x43cb('0x13'),_0x5e34e9,_0x43cb('0x14'));_0x2f277e(_0xaf6cac[_0x43cb('0x1a')][_0x43cb('0x19')]);}})[_0x43cb('0x1b')](function(_0x320cef){logger['error'](_0x43cb('0x13'),_0x5e34e9,_0x320cef);_0x4d8625(_0x320cef);});});}exports['GetOpenchannelQueue']=function(_0x519b6f){var _0x54545f=this;return new Promise(function(_0x2b4d3d,_0x1c956c){return db[_0x43cb('0x1c')][_0x43cb('0x1d')]({'raw':_0x519b6f[_0x43cb('0x1e')]?_0x519b6f[_0x43cb('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x519b6f[_0x43cb('0x1e')]?_0x519b6f[_0x43cb('0x1e')][_0x43cb('0x1f')]||null:null,'attributes':_0x519b6f[_0x43cb('0x1e')]?_0x519b6f[_0x43cb('0x1e')][_0x43cb('0x20')]||null:null,'limit':_0x519b6f['options']?_0x519b6f['options'][_0x43cb('0x21')]||null:null,'include':_0x519b6f[_0x43cb('0x1e')]?_0x519b6f['options'][_0x43cb('0x22')]?_[_0x43cb('0x23')](_0x519b6f['options']['include'],function(_0x593688){return{'model':db[_0x593688['model']],'as':_0x593688['as'],'attributes':_0x593688[_0x43cb('0x20')],'include':_0x593688[_0x43cb('0x22')]?_[_0x43cb('0x23')](_0x593688[_0x43cb('0x22')],function(_0x145b59){return{'model':db[_0x145b59[_0x43cb('0x24')]],'as':_0x145b59['as'],'attributes':_0x145b59['attributes'],'include':_0x145b59[_0x43cb('0x22')]?_[_0x43cb('0x23')](_0x145b59['include'],function(_0x187550){return{'model':db[_0x187550['model']],'as':_0x187550['as'],'attributes':_0x187550['attributes']};}):[]};}):[]};}):[]:[]})[_0x43cb('0x11')](function(_0x2ef3e4){logger[_0x43cb('0x12')](_0x43cb('0x25'),_0x519b6f);logger[_0x43cb('0x15')]('GetOpenchannelQueue',_0x519b6f,JSON[_0x43cb('0x16')](_0x2ef3e4));_0x2b4d3d(_0x2ef3e4);})[_0x43cb('0x1b')](function(_0x5f02c8){logger[_0x43cb('0x17')]('GetOpenchannelQueue',_0x5f02c8[_0x43cb('0x19')],_0x519b6f);_0x1c956c(_0x54545f[_0x43cb('0x17')](0x1f4,_0x5f02c8[_0x43cb('0x19')]));});});};exports['ShowOpenchannelQueue']=function(_0x1d0ed0){var _0x520cdf=this;return new Promise(function(_0x44529f,_0x35cd70){return db[_0x43cb('0x1c')][_0x43cb('0x26')]({'raw':_0x1d0ed0[_0x43cb('0x1e')]?_0x1d0ed0['options'][_0x43cb('0x27')]===undefined?!![]:![]:!![],'where':_0x1d0ed0['options']?_0x1d0ed0[_0x43cb('0x1e')]['where']||null:null,'attributes':_0x1d0ed0[_0x43cb('0x1e')]?_0x1d0ed0[_0x43cb('0x1e')][_0x43cb('0x20')]||null:null,'include':_0x1d0ed0[_0x43cb('0x1e')]?_0x1d0ed0[_0x43cb('0x1e')][_0x43cb('0x22')]?_[_0x43cb('0x23')](_0x1d0ed0['options'][_0x43cb('0x22')],function(_0x51695f){return{'model':db[_0x51695f[_0x43cb('0x24')]],'as':_0x51695f['as'],'attributes':_0x51695f[_0x43cb('0x20')],'include':_0x51695f[_0x43cb('0x22')]?_['map'](_0x51695f[_0x43cb('0x22')],function(_0x21ca87){return{'model':db[_0x21ca87[_0x43cb('0x24')]],'as':_0x21ca87['as'],'attributes':_0x21ca87[_0x43cb('0x20')],'include':_0x21ca87[_0x43cb('0x22')]?_[_0x43cb('0x23')](_0x21ca87['include'],function(_0x12a995){return{'model':db[_0x12a995[_0x43cb('0x24')]],'as':_0x12a995['as'],'attributes':_0x12a995[_0x43cb('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x931d3b){logger[_0x43cb('0x12')](_0x43cb('0x28'),_0x1d0ed0);logger['debug'](_0x43cb('0x28'),_0x1d0ed0,JSON[_0x43cb('0x16')](_0x931d3b));_0x44529f(_0x931d3b);})[_0x43cb('0x1b')](function(_0x544692){logger[_0x43cb('0x17')](_0x43cb('0x28'),_0x544692['message'],_0x1d0ed0);_0x35cd70(_0x520cdf[_0x43cb('0x17')](0x1f4,_0x544692[_0x43cb('0x19')]));});});}; \ No newline at end of file +var _0x0f31=['request','then','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetOpenchannelQueue','findAll','options','raw','where','attributes','include','map','model','OpenchannelQueue','find','ShowOpenchannelQueue','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','register'];(function(_0x26c88d,_0x1d6df4){var _0x2835a2=function(_0x95b284){while(--_0x95b284){_0x26c88d['push'](_0x26c88d['shift']());}};_0x2835a2(++_0x1d6df4);}(_0x0f31,0x10f));var _0x10f3=function(_0x101373,_0x2ff37a){_0x101373=_0x101373-0x0;var _0x3b4550=_0x0f31[_0x101373];return _0x3b4550;};'use strict';var _=require(_0x10f3('0x0'));var util=require(_0x10f3('0x1'));var moment=require('moment');var BPromise=require(_0x10f3('0x2'));var rs=require(_0x10f3('0x3'));var fs=require('fs');var Redis=require(_0x10f3('0x4'));var db=require(_0x10f3('0x5'))['db'];var utils=require(_0x10f3('0x6'));var logger=require(_0x10f3('0x7'))(_0x10f3('0x8'));var config=require(_0x10f3('0x9'));var jayson=require(_0x10f3('0xa'));var client=jayson['client'][_0x10f3('0xb')]({'port':0x232a});config[_0x10f3('0xc')]=_[_0x10f3('0xd')](config[_0x10f3('0xc')],{'host':_0x10f3('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x10f3('0xc')]));require('./openchannelQueue.socket')[_0x10f3('0xf')](socket);function respondWithRpcPromise(_0x4315fd,_0x260609,_0x31652a){return new BPromise(function(_0x3b412e,_0x3e393e){return client[_0x10f3('0x10')](_0x4315fd,_0x31652a)[_0x10f3('0x11')](function(_0x5e5cdf){logger[_0x10f3('0x12')](_0x10f3('0x13'),_0x260609,_0x10f3('0x14'));logger[_0x10f3('0x15')](_0x10f3('0x16'),_0x260609,_0x10f3('0x14'),JSON[_0x10f3('0x17')](_0x5e5cdf));if(_0x5e5cdf[_0x10f3('0x18')]){if(_0x5e5cdf[_0x10f3('0x18')][_0x10f3('0x19')]===0x1f4){logger[_0x10f3('0x18')](_0x10f3('0x13'),_0x260609,_0x5e5cdf[_0x10f3('0x18')][_0x10f3('0x1a')]);return _0x3e393e(_0x5e5cdf[_0x10f3('0x18')][_0x10f3('0x1a')]);}logger[_0x10f3('0x18')](_0x10f3('0x13'),_0x260609,_0x5e5cdf['error'][_0x10f3('0x1a')]);return _0x3b412e(_0x5e5cdf['error']['message']);}else{logger['info']('OpenchannelQueue,\x20%s,\x20%s',_0x260609,'request\x20sent');_0x3b412e(_0x5e5cdf[_0x10f3('0x1b')][_0x10f3('0x1a')]);}})[_0x10f3('0x1c')](function(_0x4fe08d){logger[_0x10f3('0x18')](_0x10f3('0x13'),_0x260609,_0x4fe08d);_0x3e393e(_0x4fe08d);});});}exports[_0x10f3('0x1d')]=function(_0x47efbf){var _0x223d94=this;return new Promise(function(_0x277398,_0x3a11c1){return db['OpenchannelQueue'][_0x10f3('0x1e')]({'raw':_0x47efbf['options']?_0x47efbf[_0x10f3('0x1f')][_0x10f3('0x20')]===undefined?!![]:![]:!![],'where':_0x47efbf[_0x10f3('0x1f')]?_0x47efbf['options'][_0x10f3('0x21')]||null:null,'attributes':_0x47efbf[_0x10f3('0x1f')]?_0x47efbf[_0x10f3('0x1f')][_0x10f3('0x22')]||null:null,'limit':_0x47efbf[_0x10f3('0x1f')]?_0x47efbf['options']['limit']||null:null,'include':_0x47efbf['options']?_0x47efbf[_0x10f3('0x1f')][_0x10f3('0x23')]?_[_0x10f3('0x24')](_0x47efbf[_0x10f3('0x1f')][_0x10f3('0x23')],function(_0x3386d7){return{'model':db[_0x3386d7[_0x10f3('0x25')]],'as':_0x3386d7['as'],'attributes':_0x3386d7['attributes'],'include':_0x3386d7[_0x10f3('0x23')]?_[_0x10f3('0x24')](_0x3386d7[_0x10f3('0x23')],function(_0x2d3b46){return{'model':db[_0x2d3b46[_0x10f3('0x25')]],'as':_0x2d3b46['as'],'attributes':_0x2d3b46[_0x10f3('0x22')],'include':_0x2d3b46['include']?_[_0x10f3('0x24')](_0x2d3b46[_0x10f3('0x23')],function(_0x31e187){return{'model':db[_0x31e187['model']],'as':_0x31e187['as'],'attributes':_0x31e187[_0x10f3('0x22')]};}):[]};}):[]};}):[]:[]})[_0x10f3('0x11')](function(_0x59d065){logger['info'](_0x10f3('0x1d'),_0x47efbf);logger[_0x10f3('0x15')](_0x10f3('0x1d'),_0x47efbf,JSON[_0x10f3('0x17')](_0x59d065));_0x277398(_0x59d065);})[_0x10f3('0x1c')](function(_0x3d3b2b){logger[_0x10f3('0x18')]('GetOpenchannelQueue',_0x3d3b2b[_0x10f3('0x1a')],_0x47efbf);_0x3a11c1(_0x223d94[_0x10f3('0x18')](0x1f4,_0x3d3b2b[_0x10f3('0x1a')]));});});};exports['ShowOpenchannelQueue']=function(_0x69d1b1){var _0x2fd599=this;return new Promise(function(_0x4cb6a0,_0x25d6bf){return db[_0x10f3('0x26')][_0x10f3('0x27')]({'raw':_0x69d1b1[_0x10f3('0x1f')]?_0x69d1b1['options'][_0x10f3('0x20')]===undefined?!![]:![]:!![],'where':_0x69d1b1[_0x10f3('0x1f')]?_0x69d1b1[_0x10f3('0x1f')][_0x10f3('0x21')]||null:null,'attributes':_0x69d1b1[_0x10f3('0x1f')]?_0x69d1b1[_0x10f3('0x1f')][_0x10f3('0x22')]||null:null,'include':_0x69d1b1['options']?_0x69d1b1[_0x10f3('0x1f')][_0x10f3('0x23')]?_[_0x10f3('0x24')](_0x69d1b1[_0x10f3('0x1f')]['include'],function(_0x569a13){return{'model':db[_0x569a13[_0x10f3('0x25')]],'as':_0x569a13['as'],'attributes':_0x569a13[_0x10f3('0x22')],'include':_0x569a13['include']?_[_0x10f3('0x24')](_0x569a13[_0x10f3('0x23')],function(_0xf2ddca){return{'model':db[_0xf2ddca[_0x10f3('0x25')]],'as':_0xf2ddca['as'],'attributes':_0xf2ddca['attributes'],'include':_0xf2ddca[_0x10f3('0x23')]?_['map'](_0xf2ddca[_0x10f3('0x23')],function(_0x3f6366){return{'model':db[_0x3f6366[_0x10f3('0x25')]],'as':_0x3f6366['as'],'attributes':_0x3f6366[_0x10f3('0x22')]};}):[]};}):[]};}):[]:[]})[_0x10f3('0x11')](function(_0x2c8559){logger[_0x10f3('0x12')](_0x10f3('0x28'),_0x69d1b1);logger[_0x10f3('0x15')](_0x10f3('0x28'),_0x69d1b1,JSON['stringify'](_0x2c8559));_0x4cb6a0(_0x2c8559);})[_0x10f3('0x1c')](function(_0x2384a4){logger[_0x10f3('0x18')](_0x10f3('0x28'),_0x2384a4[_0x10f3('0x1a')],_0x69d1b1);_0x25d6bf(_0x2fd599[_0x10f3('0x18')](0x1f4,_0x2384a4[_0x10f3('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index bf5944a..b7c3aa1 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 _0xa5a4=['update','emit','removeListener','register','openchannelQueue:','./openchannelQueue.events','remove'];(function(_0x4b6ff4,_0x54815c){var _0x34321e=function(_0x579cb3){while(--_0x579cb3){_0x4b6ff4['push'](_0x4b6ff4['shift']());}};_0x34321e(++_0x54815c);}(_0xa5a4,0x14e));var _0x4a5a=function(_0x1a89a1,_0x56d889){_0x1a89a1=_0x1a89a1-0x0;var _0x3d5b46=_0xa5a4[_0x1a89a1];return _0x3d5b46;};'use strict';var OpenchannelQueueEvents=require(_0x4a5a('0x0'));var events=['save',_0x4a5a('0x1'),_0x4a5a('0x2')];function createListener(_0x2d9ccd,_0x2fba4e){return function(_0x718ab){_0x2fba4e[_0x4a5a('0x3')](_0x2d9ccd,_0x718ab);};}function removeListener(_0x102a7a,_0x4a3124){return function(){OpenchannelQueueEvents[_0x4a5a('0x4')](_0x102a7a,_0x4a3124);};}exports[_0x4a5a('0x5')]=function(_0x3b9961){for(var _0x52f505=0x0,_0x3cb869=events['length'];_0x52f505<_0x3cb869;_0x52f505++){var _0x1f20d0=events[_0x52f505];var _0x44914b=createListener(_0x4a5a('0x6')+_0x1f20d0,_0x3b9961);OpenchannelQueueEvents['on'](_0x1f20d0,_0x44914b);}}; \ No newline at end of file +var _0xb279=['emit','./openchannelQueue.events','save','remove'];(function(_0x21353c,_0x2ea587){var _0xa99120=function(_0x557f33){while(--_0x557f33){_0x21353c['push'](_0x21353c['shift']());}};_0xa99120(++_0x2ea587);}(_0xb279,0xb5));var _0x9b27=function(_0x449a7e,_0xd69ef4){_0x449a7e=_0x449a7e-0x0;var _0x4d3ee5=_0xb279[_0x449a7e];return _0x4d3ee5;};'use strict';var OpenchannelQueueEvents=require(_0x9b27('0x0'));var events=[_0x9b27('0x1'),_0x9b27('0x2'),'update'];function createListener(_0x5e4260,_0x2c1c3a){return function(_0x4687f4){_0x2c1c3a[_0x9b27('0x3')](_0x5e4260,_0x4687f4);};}function removeListener(_0x19bc9e,_0x180f0e){return function(){OpenchannelQueueEvents['removeListener'](_0x19bc9e,_0x180f0e);};}exports['register']=function(_0x36d59f){for(var _0x531d2b=0x0,_0x3c8df9=events['length'];_0x531d2b<_0x3c8df9;_0x531d2b++){var _0x35123a=events[_0x531d2b];var _0x1b258b=createListener('openchannelQueue:'+_0x35123a,_0x36d59f);OpenchannelQueueEvents['on'](_0x35123a,_0x1b258b);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index edc9285..d953aad 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 _0x76a8=['update','delete','destroy','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','get','index','/describe','describe','/:id','isAuthenticated','show','post','create','put'];(function(_0x342baa,_0x4a110f){var _0x1208f3=function(_0x56a645){while(--_0x56a645){_0x342baa['push'](_0x342baa['shift']());}};_0x1208f3(++_0x4a110f);}(_0x76a8,0x1e7));var _0x876a=function(_0x2071bf,_0x4f6ef8){_0x2071bf=_0x2071bf-0x0;var _0x1f416d=_0x76a8[_0x2071bf];return _0x1f416d;};'use strict';var multer=require(_0x876a('0x0'));var util=require(_0x876a('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x876a('0x2'));var router=express[_0x876a('0x3')]();var fs_extra=require(_0x876a('0x4'));var auth=require(_0x876a('0x5'));var interaction=require(_0x876a('0x6'));var config=require(_0x876a('0x7'));var controller=require(_0x876a('0x8'));router[_0x876a('0x9')]('/',auth['isAuthenticated'](),controller[_0x876a('0xa')]);router[_0x876a('0x9')](_0x876a('0xb'),auth['isAuthenticated'](),controller[_0x876a('0xc')]);router[_0x876a('0x9')](_0x876a('0xd'),auth[_0x876a('0xe')](),controller[_0x876a('0xf')]);router[_0x876a('0x10')]('/',auth[_0x876a('0xe')](),controller[_0x876a('0x11')]);router[_0x876a('0x12')]('/:id',auth[_0x876a('0xe')](),controller[_0x876a('0x13')]);router[_0x876a('0x14')](_0x876a('0xd'),auth[_0x876a('0xe')](),controller[_0x876a('0x15')]);module['exports']=router; \ No newline at end of file +var _0x39e1=['../../config/environment','./openchannelQueueReport.controller','get','index','/describe','isAuthenticated','describe','/:id','post','create','delete','destroy','exports','path','connect-timeout','Router','../../components/auth/service'];(function(_0x2217ec,_0x1bd3ce){var _0x2a3863=function(_0x4fdb81){while(--_0x4fdb81){_0x2217ec['push'](_0x2217ec['shift']());}};_0x2a3863(++_0x1bd3ce);}(_0x39e1,0xb7));var _0x139e=function(_0x1bf8cc,_0x118778){_0x1bf8cc=_0x1bf8cc-0x0;var _0x322d20=_0x39e1[_0x1bf8cc];return _0x322d20;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x139e('0x0'));var timeout=require(_0x139e('0x1'));var express=require('express');var router=express[_0x139e('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x139e('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x139e('0x4'));var controller=require(_0x139e('0x5'));router[_0x139e('0x6')]('/',auth['isAuthenticated'](),controller[_0x139e('0x7')]);router[_0x139e('0x6')](_0x139e('0x8'),auth[_0x139e('0x9')](),controller[_0x139e('0xa')]);router[_0x139e('0x6')](_0x139e('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x139e('0xc')]('/',auth[_0x139e('0x9')](),controller[_0x139e('0xd')]);router['put'](_0x139e('0xb'),auth[_0x139e('0x9')](),controller['update']);router[_0x139e('0xe')](_0x139e('0xb'),auth[_0x139e('0x9')](),controller[_0x139e('0xf')]);module[_0x139e('0x10')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index c6dcde4..c4eb418 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 _0x2c2b=['DATE','moment','STRING'];(function(_0x2bc4a6,_0x5550e7){var _0x4e3019=function(_0x533aab){while(--_0x533aab){_0x2bc4a6['push'](_0x2bc4a6['shift']());}};_0x4e3019(++_0x5550e7);}(_0x2c2b,0x11b));var _0xb2c2=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0x2c2b[_0x122096];return _0x3d1966;};'use strict';var moment=require(_0xb2c2('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xb2c2('0x1')]},'joinAt':{'type':Sequelize[_0xb2c2('0x2')]},'leaveAt':{'type':Sequelize[_0xb2c2('0x2')]},'acceptAt':{'type':Sequelize[_0xb2c2('0x2')]},'exitAt':{'type':Sequelize[_0xb2c2('0x2')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xa61a=['moment','sequelize','exports','STRING','DATE'];(function(_0x162674,_0xe81d6c){var _0x3c802e=function(_0x3faf76){while(--_0x3faf76){_0x162674['push'](_0x162674['shift']());}};_0x3c802e(++_0xe81d6c);}(_0xa61a,0xc8));var _0xaa61=function(_0x592e40,_0x2ed011){_0x592e40=_0x592e40-0x0;var _0x5d4288=_0xa61a[_0x592e40];return _0x5d4288;};'use strict';var moment=require(_0xaa61('0x0'));var Sequelize=require(_0xaa61('0x1'));module[_0xaa61('0x2')]={'uniqueid':{'type':Sequelize[_0xaa61('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xaa61('0x4')]},'leaveAt':{'type':Sequelize[_0xaa61('0x4')]},'acceptAt':{'type':Sequelize[_0xaa61('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xaa61('0x3')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index 5ee115b..254284f 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 _0x1b45=['OpenchannelQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','filter','where','VIRTUAL','merge','options','includeAll','include','rows','catch','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','destroy','error','stack','name','send','index','map'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0x1b45,0x6c));var _0x51b4=function(_0x279f6d,_0x122316){_0x279f6d=_0x279f6d-0x0;var _0x5874a5=_0x1b45[_0x279f6d];return _0x5874a5;};'use strict';var emlformat=require(_0x51b4('0x0'));var rimraf=require(_0x51b4('0x1'));var zipdir=require(_0x51b4('0x2'));var jsonpatch=require(_0x51b4('0x3'));var rp=require('request-promise');var moment=require(_0x51b4('0x4'));var BPromise=require(_0x51b4('0x5'));var Mustache=require(_0x51b4('0x6'));var util=require(_0x51b4('0x7'));var path=require(_0x51b4('0x8'));var sox=require(_0x51b4('0x9'));var csv=require(_0x51b4('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x51b4('0xb'));var _=require(_0x51b4('0xc'));var squel=require(_0x51b4('0xd'));var crypto=require(_0x51b4('0xe'));var jsforce=require(_0x51b4('0xf'));var deskjs=require(_0x51b4('0x10'));var toCsv=require(_0x51b4('0xa'));var querystring=require(_0x51b4('0x11'));var Papa=require(_0x51b4('0x12'));var Redis=require('ioredis');var authService=require(_0x51b4('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x51b4('0x14'));var hardwareService=require(_0x51b4('0x15'));var logger=require('../../config/logger')(_0x51b4('0x16'));var utils=require(_0x51b4('0x17'));var config=require(_0x51b4('0x18'));var licenseUtil=require(_0x51b4('0x19'));var db=require(_0x51b4('0x1a'))['db'];function respondWithStatusCode(_0x1403da,_0x319cd8){_0x319cd8=_0x319cd8||0xcc;return function(_0x259b8e){if(_0x259b8e){return _0x1403da[_0x51b4('0x1b')](_0x319cd8);}return _0x1403da[_0x51b4('0x1c')](_0x319cd8)[_0x51b4('0x1d')]();};}function respondWithResult(_0x503309,_0x3647c2){_0x3647c2=_0x3647c2||0xc8;return function(_0x4b7e58){if(_0x4b7e58){return _0x503309[_0x51b4('0x1c')](_0x3647c2)['json'](_0x4b7e58);}};}function respondWithFilteredResult(_0x5dd713,_0xd9aea6){return function(_0x172aea){if(_0x172aea){var _0x395ad8=typeof _0xd9aea6[_0x51b4('0x1e')]===_0x51b4('0x1f')&&typeof _0xd9aea6[_0x51b4('0x20')]==='undefined';var _0x331c4d=_0x172aea[_0x51b4('0x21')];var _0x210638=_0x395ad8?0x0:_0xd9aea6[_0x51b4('0x1e')];var _0x13a284=_0x395ad8?_0x172aea[_0x51b4('0x21')]:_0xd9aea6[_0x51b4('0x1e')]+_0xd9aea6['limit'];var _0x50c570;if(_0x13a284>=_0x331c4d){_0x13a284=_0x331c4d;_0x50c570=0xc8;}else{_0x50c570=0xce;}_0x5dd713['status'](_0x50c570);return _0x5dd713[_0x51b4('0x22')](_0x51b4('0x23'),_0x210638+'-'+_0x13a284+'/'+_0x331c4d)[_0x51b4('0x24')](_0x172aea);}return null;};}function patchUpdates(_0x31f13d){return function(_0x262c88){try{jsonpatch[_0x51b4('0x25')](_0x262c88,_0x31f13d,!![]);}catch(_0x767a46){return BPromise['reject'](_0x767a46);}return _0x262c88[_0x51b4('0x26')]();};}function saveUpdates(_0x16f3e2,_0x39d2f6){return function(_0xaa425f){if(_0xaa425f){return _0xaa425f[_0x51b4('0x27')](_0x16f3e2)[_0x51b4('0x28')](function(_0x2aae04){return _0x2aae04;});}return null;};}function removeEntity(_0x12a8fc,_0x30a715){return function(_0x5c5069){if(_0x5c5069){return _0x5c5069[_0x51b4('0x29')]()['then'](function(){_0x12a8fc[_0x51b4('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4eb011,_0x5e87a7){return function(_0x433523){if(!_0x433523){_0x4eb011[_0x51b4('0x1b')](0x194);}return _0x433523;};}function handleError(_0x37bf9d,_0x5cec54){_0x5cec54=_0x5cec54||0x1f4;return function(_0x49ccbd){logger[_0x51b4('0x2a')](_0x49ccbd[_0x51b4('0x2b')]);if(_0x49ccbd[_0x51b4('0x2c')]){delete _0x49ccbd[_0x51b4('0x2c')];}_0x37bf9d['status'](_0x5cec54)[_0x51b4('0x2d')](_0x49ccbd);};}exports[_0x51b4('0x2e')]=function(_0x5f5338,_0x167809){var _0x197bb5={},_0x46a631={},_0x26b2b1={'count':0x0,'rows':[]};var _0x267e3d=_[_0x51b4('0x2f')](db[_0x51b4('0x30')][_0x51b4('0x31')],function(_0x1641e7){return{'name':_0x1641e7[_0x51b4('0x32')],'type':_0x1641e7[_0x51b4('0x33')][_0x51b4('0x34')]};});_0x46a631[_0x51b4('0x35')]=_[_0x51b4('0x2f')](_0x267e3d,'name');_0x46a631[_0x51b4('0x36')]=_[_0x51b4('0x37')](_0x5f5338['query']);_0x46a631[_0x51b4('0x38')]=_[_0x51b4('0x39')](_0x46a631['model'],_0x46a631[_0x51b4('0x36')]);_0x197bb5[_0x51b4('0x3a')]=_[_0x51b4('0x39')](_0x46a631[_0x51b4('0x35')],qs['fields'](_0x5f5338[_0x51b4('0x36')][_0x51b4('0x3b')]));_0x197bb5[_0x51b4('0x3a')]=_0x197bb5['attributes'][_0x51b4('0x3c')]?_0x197bb5['attributes']:_0x46a631[_0x51b4('0x35')];if(!_0x5f5338[_0x51b4('0x36')][_0x51b4('0x3d')](_0x51b4('0x3e'))){_0x197bb5[_0x51b4('0x20')]=qs[_0x51b4('0x20')](_0x5f5338[_0x51b4('0x36')][_0x51b4('0x20')]);_0x197bb5[_0x51b4('0x1e')]=qs[_0x51b4('0x1e')](_0x5f5338[_0x51b4('0x36')][_0x51b4('0x1e')]);}_0x197bb5[_0x51b4('0x3f')]=qs['sort'](_0x5f5338[_0x51b4('0x36')]['sort']);_0x197bb5['where']=qs[_0x51b4('0x38')](_['pick'](_0x5f5338[_0x51b4('0x36')],_0x46a631['filters']),_0x267e3d);if(_0x5f5338[_0x51b4('0x36')][_0x51b4('0x40')]){_0x197bb5[_0x51b4('0x41')]=_['merge'](_0x197bb5['where'],{'$or':_['map'](_0x267e3d,function(_0x1f9bf4){if(_0x1f9bf4[_0x51b4('0x33')]!==_0x51b4('0x42')){var _0x36fba0={};_0x36fba0[_0x1f9bf4[_0x51b4('0x2c')]]={'$like':'%'+_0x5f5338[_0x51b4('0x36')]['filter']+'%'};return _0x36fba0;}})});}_0x197bb5=_[_0x51b4('0x43')]({},_0x197bb5,_0x5f5338[_0x51b4('0x44')]);var _0x5da81e={'where':_0x197bb5['where']};return db[_0x51b4('0x30')][_0x51b4('0x21')](_0x5da81e)['then'](function(_0x1225de){_0x26b2b1[_0x51b4('0x21')]=_0x1225de;if(_0x5f5338[_0x51b4('0x36')][_0x51b4('0x45')]){_0x197bb5[_0x51b4('0x46')]=[{'all':!![]}];}return db['OpenchannelQueueReport']['findAll'](_0x197bb5);})[_0x51b4('0x28')](function(_0x3e936e){_0x26b2b1[_0x51b4('0x47')]=_0x3e936e;return _0x26b2b1;})[_0x51b4('0x28')](respondWithFilteredResult(_0x167809,_0x197bb5))[_0x51b4('0x48')](handleError(_0x167809,null));};exports['show']=function(_0x3c99ad,_0x206347){var _0x38d229={'raw':!![],'where':{'id':_0x3c99ad[_0x51b4('0x49')]['id']}},_0x502375={};_0x502375[_0x51b4('0x35')]=_[_0x51b4('0x37')](db[_0x51b4('0x30')][_0x51b4('0x31')]);_0x502375['query']=_[_0x51b4('0x37')](_0x3c99ad[_0x51b4('0x36')]);_0x502375[_0x51b4('0x38')]=_[_0x51b4('0x39')](_0x502375['model'],_0x502375['query']);_0x38d229['attributes']=_[_0x51b4('0x39')](_0x502375['model'],qs[_0x51b4('0x3b')](_0x3c99ad[_0x51b4('0x36')][_0x51b4('0x3b')]));_0x38d229['attributes']=_0x38d229[_0x51b4('0x3a')][_0x51b4('0x3c')]?_0x38d229['attributes']:_0x502375[_0x51b4('0x35')];if(_0x3c99ad[_0x51b4('0x36')]['includeAll']){_0x38d229[_0x51b4('0x46')]=[{'all':!![]}];}_0x38d229=_[_0x51b4('0x43')]({},_0x38d229,_0x3c99ad[_0x51b4('0x44')]);return db[_0x51b4('0x30')][_0x51b4('0x4a')](_0x38d229)[_0x51b4('0x28')](handleEntityNotFound(_0x206347,null))[_0x51b4('0x28')](respondWithResult(_0x206347,null))['catch'](handleError(_0x206347,null));};exports[_0x51b4('0x4b')]=function(_0x1d9b67,_0x4b7e4c){return db[_0x51b4('0x30')]['create'](_0x1d9b67['body'],{})[_0x51b4('0x28')](respondWithResult(_0x4b7e4c,0xc9))[_0x51b4('0x48')](handleError(_0x4b7e4c,null));};exports[_0x51b4('0x27')]=function(_0xcd4dc,_0x5aba72){if(_0xcd4dc[_0x51b4('0x4c')]['id']){delete _0xcd4dc['body']['id'];}return db[_0x51b4('0x30')][_0x51b4('0x4a')]({'where':{'id':_0xcd4dc[_0x51b4('0x49')]['id']}})[_0x51b4('0x28')](handleEntityNotFound(_0x5aba72,null))[_0x51b4('0x28')](saveUpdates(_0xcd4dc[_0x51b4('0x4c')],null))[_0x51b4('0x28')](respondWithResult(_0x5aba72,null))[_0x51b4('0x48')](handleError(_0x5aba72,null));};exports['destroy']=function(_0x8f9399,_0x578e26){return db[_0x51b4('0x30')][_0x51b4('0x4a')]({'where':{'id':_0x8f9399[_0x51b4('0x49')]['id']}})[_0x51b4('0x28')](handleEntityNotFound(_0x578e26,null))[_0x51b4('0x28')](removeEntity(_0x578e26,null))[_0x51b4('0x48')](handleError(_0x578e26,null));};exports['describe']=function(_0x2a2aa9,_0x5f4f42){return db[_0x51b4('0x30')][_0x51b4('0x4d')]()['then'](respondWithResult(_0x5f4f42,null))[_0x51b4('0x48')](handleError(_0x5f4f42,null));}; \ No newline at end of file +var _0x492c=['describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','undefined','limit','offset','count','set','Content-Range','json','apply','then','destroy','error','stack','name','send','index','map','OpenchannelQueueReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','options','includeAll','include','findAll','rows','show','params','keys','find','catch','create','body','update'];(function(_0x5c8d4f,_0x371f74){var _0x54e3d6=function(_0x503b97){while(--_0x503b97){_0x5c8d4f['push'](_0x5c8d4f['shift']());}};_0x54e3d6(++_0x371f74);}(_0x492c,0x1c3));var _0xc492=function(_0x31548c,_0x42dc58){_0x31548c=_0x31548c-0x0;var _0x4c79b9=_0x492c[_0x31548c];return _0x4c79b9;};'use strict';var emlformat=require(_0xc492('0x0'));var rimraf=require(_0xc492('0x1'));var zipdir=require(_0xc492('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc492('0x3'));var moment=require(_0xc492('0x4'));var BPromise=require(_0xc492('0x5'));var Mustache=require('mustache');var util=require(_0xc492('0x6'));var path=require(_0xc492('0x7'));var sox=require(_0xc492('0x8'));var csv=require(_0xc492('0x9'));var ejs=require(_0xc492('0xa'));var fs=require('fs');var fs_extra=require(_0xc492('0xb'));var _=require('lodash');var squel=require(_0xc492('0xc'));var crypto=require('crypto');var jsforce=require(_0xc492('0xd'));var deskjs=require(_0xc492('0xe'));var toCsv=require(_0xc492('0x9'));var querystring=require(_0xc492('0xf'));var Papa=require(_0xc492('0x10'));var Redis=require(_0xc492('0x11'));var authService=require(_0xc492('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xc492('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc492('0x14'));var utils=require(_0xc492('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xc492('0x16'));var db=require(_0xc492('0x17'))['db'];function respondWithStatusCode(_0x58f490,_0x70fa13){_0x70fa13=_0x70fa13||0xcc;return function(_0x2c8da8){if(_0x2c8da8){return _0x58f490[_0xc492('0x18')](_0x70fa13);}return _0x58f490['status'](_0x70fa13)[_0xc492('0x19')]();};}function respondWithResult(_0x3f5969,_0x5d8ff9){_0x5d8ff9=_0x5d8ff9||0xc8;return function(_0x17eecf){if(_0x17eecf){return _0x3f5969[_0xc492('0x1a')](_0x5d8ff9)['json'](_0x17eecf);}};}function respondWithFilteredResult(_0x29c386,_0x9fc656){return function(_0x7cb59a){if(_0x7cb59a){var _0x12d081=typeof _0x9fc656['offset']===_0xc492('0x1b')&&typeof _0x9fc656[_0xc492('0x1c')]==='undefined';var _0x51fc70=_0x7cb59a['count'];var _0x236347=_0x12d081?0x0:_0x9fc656[_0xc492('0x1d')];var _0x416e3e=_0x12d081?_0x7cb59a[_0xc492('0x1e')]:_0x9fc656[_0xc492('0x1d')]+_0x9fc656[_0xc492('0x1c')];var _0x162101;if(_0x416e3e>=_0x51fc70){_0x416e3e=_0x51fc70;_0x162101=0xc8;}else{_0x162101=0xce;}_0x29c386[_0xc492('0x1a')](_0x162101);return _0x29c386[_0xc492('0x1f')](_0xc492('0x20'),_0x236347+'-'+_0x416e3e+'/'+_0x51fc70)[_0xc492('0x21')](_0x7cb59a);}return null;};}function patchUpdates(_0x3768f8){return function(_0x3e62ce){try{jsonpatch[_0xc492('0x22')](_0x3e62ce,_0x3768f8,!![]);}catch(_0x4b29e6){return BPromise['reject'](_0x4b29e6);}return _0x3e62ce['save']();};}function saveUpdates(_0x195ea7,_0x5ac6eb){return function(_0x154ac7){if(_0x154ac7){return _0x154ac7['update'](_0x195ea7)[_0xc492('0x23')](function(_0x2936b8){return _0x2936b8;});}return null;};}function removeEntity(_0x3bec4b,_0x590107){return function(_0x328fe6){if(_0x328fe6){return _0x328fe6[_0xc492('0x24')]()['then'](function(){_0x3bec4b[_0xc492('0x1a')](0xcc)[_0xc492('0x19')]();});}};}function handleEntityNotFound(_0x3684ef,_0x598abd){return function(_0x37db96){if(!_0x37db96){_0x3684ef[_0xc492('0x18')](0x194);}return _0x37db96;};}function handleError(_0xccbc3f,_0x109452){_0x109452=_0x109452||0x1f4;return function(_0xc1a69f){logger[_0xc492('0x25')](_0xc1a69f[_0xc492('0x26')]);if(_0xc1a69f[_0xc492('0x27')]){delete _0xc1a69f[_0xc492('0x27')];}_0xccbc3f[_0xc492('0x1a')](_0x109452)[_0xc492('0x28')](_0xc1a69f);};}exports[_0xc492('0x29')]=function(_0x5b210d,_0x177506){var _0x5b5cf8={},_0x439a2a={},_0x3e0f19={'count':0x0,'rows':[]};var _0x43a892=_[_0xc492('0x2a')](db[_0xc492('0x2b')][_0xc492('0x2c')],function(_0x14e982){return{'name':_0x14e982[_0xc492('0x2d')],'type':_0x14e982[_0xc492('0x2e')][_0xc492('0x2f')]};});_0x439a2a[_0xc492('0x30')]=_['map'](_0x43a892,_0xc492('0x27'));_0x439a2a[_0xc492('0x31')]=_['keys'](_0x5b210d['query']);_0x439a2a[_0xc492('0x32')]=_[_0xc492('0x33')](_0x439a2a[_0xc492('0x30')],_0x439a2a[_0xc492('0x31')]);_0x5b5cf8[_0xc492('0x34')]=_['intersection'](_0x439a2a[_0xc492('0x30')],qs['fields'](_0x5b210d[_0xc492('0x31')][_0xc492('0x35')]));_0x5b5cf8[_0xc492('0x34')]=_0x5b5cf8[_0xc492('0x34')][_0xc492('0x36')]?_0x5b5cf8[_0xc492('0x34')]:_0x439a2a['model'];if(!_0x5b210d['query']['hasOwnProperty'](_0xc492('0x37'))){_0x5b5cf8[_0xc492('0x1c')]=qs[_0xc492('0x1c')](_0x5b210d['query'][_0xc492('0x1c')]);_0x5b5cf8[_0xc492('0x1d')]=qs[_0xc492('0x1d')](_0x5b210d[_0xc492('0x31')][_0xc492('0x1d')]);}_0x5b5cf8[_0xc492('0x38')]=qs[_0xc492('0x39')](_0x5b210d[_0xc492('0x31')][_0xc492('0x39')]);_0x5b5cf8[_0xc492('0x3a')]=qs[_0xc492('0x32')](_['pick'](_0x5b210d['query'],_0x439a2a[_0xc492('0x32')]),_0x43a892);if(_0x5b210d[_0xc492('0x31')]['filter']){_0x5b5cf8[_0xc492('0x3a')]=_['merge'](_0x5b5cf8[_0xc492('0x3a')],{'$or':_[_0xc492('0x2a')](_0x43a892,function(_0x139464){if(_0x139464[_0xc492('0x2e')]!=='VIRTUAL'){var _0xf7750c={};_0xf7750c[_0x139464[_0xc492('0x27')]]={'$like':'%'+_0x5b210d['query'][_0xc492('0x3b')]+'%'};return _0xf7750c;}})});}_0x5b5cf8=_[_0xc492('0x3c')]({},_0x5b5cf8,_0x5b210d[_0xc492('0x3d')]);var _0x45a0f6={'where':_0x5b5cf8[_0xc492('0x3a')]};return db[_0xc492('0x2b')][_0xc492('0x1e')](_0x45a0f6)[_0xc492('0x23')](function(_0x38e835){_0x3e0f19[_0xc492('0x1e')]=_0x38e835;if(_0x5b210d[_0xc492('0x31')][_0xc492('0x3e')]){_0x5b5cf8[_0xc492('0x3f')]=[{'all':!![]}];}return db[_0xc492('0x2b')][_0xc492('0x40')](_0x5b5cf8);})[_0xc492('0x23')](function(_0x346617){_0x3e0f19[_0xc492('0x41')]=_0x346617;return _0x3e0f19;})['then'](respondWithFilteredResult(_0x177506,_0x5b5cf8))['catch'](handleError(_0x177506,null));};exports[_0xc492('0x42')]=function(_0x1361f1,_0x4e63c5){var _0x5c3e53={'raw':!![],'where':{'id':_0x1361f1[_0xc492('0x43')]['id']}},_0x3d02f5={};_0x3d02f5[_0xc492('0x30')]=_[_0xc492('0x44')](db[_0xc492('0x2b')][_0xc492('0x2c')]);_0x3d02f5['query']=_[_0xc492('0x44')](_0x1361f1[_0xc492('0x31')]);_0x3d02f5[_0xc492('0x32')]=_[_0xc492('0x33')](_0x3d02f5[_0xc492('0x30')],_0x3d02f5[_0xc492('0x31')]);_0x5c3e53[_0xc492('0x34')]=_[_0xc492('0x33')](_0x3d02f5[_0xc492('0x30')],qs[_0xc492('0x35')](_0x1361f1[_0xc492('0x31')][_0xc492('0x35')]));_0x5c3e53['attributes']=_0x5c3e53['attributes'][_0xc492('0x36')]?_0x5c3e53[_0xc492('0x34')]:_0x3d02f5[_0xc492('0x30')];if(_0x1361f1['query'][_0xc492('0x3e')]){_0x5c3e53['include']=[{'all':!![]}];}_0x5c3e53=_['merge']({},_0x5c3e53,_0x1361f1['options']);return db['OpenchannelQueueReport'][_0xc492('0x45')](_0x5c3e53)[_0xc492('0x23')](handleEntityNotFound(_0x4e63c5,null))['then'](respondWithResult(_0x4e63c5,null))[_0xc492('0x46')](handleError(_0x4e63c5,null));};exports['create']=function(_0x30d0c7,_0x5209d1){return db[_0xc492('0x2b')][_0xc492('0x47')](_0x30d0c7[_0xc492('0x48')],{})['then'](respondWithResult(_0x5209d1,0xc9))['catch'](handleError(_0x5209d1,null));};exports[_0xc492('0x49')]=function(_0x4a54cd,_0x47074c){if(_0x4a54cd[_0xc492('0x48')]['id']){delete _0x4a54cd[_0xc492('0x48')]['id'];}return db[_0xc492('0x2b')][_0xc492('0x45')]({'where':{'id':_0x4a54cd[_0xc492('0x43')]['id']}})[_0xc492('0x23')](handleEntityNotFound(_0x47074c,null))['then'](saveUpdates(_0x4a54cd[_0xc492('0x48')],null))['then'](respondWithResult(_0x47074c,null))[_0xc492('0x46')](handleError(_0x47074c,null));};exports['destroy']=function(_0x1e39b2,_0x42842e){return db[_0xc492('0x2b')][_0xc492('0x45')]({'where':{'id':_0x1e39b2[_0xc492('0x43')]['id']}})[_0xc492('0x23')](handleEntityNotFound(_0x42842e,null))['then'](removeEntity(_0x42842e,null))['catch'](handleError(_0x42842e,null));};exports[_0xc492('0x4a')]=function(_0x767848,_0x38379d){return db[_0xc492('0x2b')][_0xc492('0x4a')]()[_0xc492('0x23')](respondWithResult(_0x38379d,null))[_0xc492('0x46')](handleError(_0x38379d,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index 62a0816..8003791 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 _0x7a54=['report_openchannel_queue','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','OpenchannelQueueReport'];(function(_0x36e89f,_0x111165){var _0x465dc3=function(_0x59b136){while(--_0x59b136){_0x36e89f['push'](_0x36e89f['shift']());}};_0x465dc3(++_0x111165);}(_0x7a54,0x106));var _0x47a5=function(_0x5bb9cf,_0xe96120){_0x5bb9cf=_0x5bb9cf-0x0;var _0x1652a2=_0x7a54[_0x5bb9cf];return _0x1652a2;};'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':'uniqueid','fields':[_0x47a5('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x814b=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','uniqueid','lodash','util'];(function(_0x4d67b8,_0x565134){var _0x55af3b=function(_0x145904){while(--_0x145904){_0x4d67b8['push'](_0x4d67b8['shift']());}};_0x55af3b(++_0x565134);}(_0x814b,0x1a2));var _0xb814=function(_0x4e6eac,_0x3f4365){_0x4e6eac=_0x4e6eac-0x0;var _0x79f963=_0x814b[_0x4e6eac];return _0x79f963;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var logger=require(_0xb814('0x2'))(_0xb814('0x3'));var moment=require(_0xb814('0x4'));var BPromise=require(_0xb814('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb814('0x6'));var rimraf=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var attributes=require(_0xb814('0x9'));module[_0xb814('0xa')]=function(_0x322a70,_0x53e507){return _0x322a70[_0xb814('0xb')](_0xb814('0xc'),attributes,{'tableName':'report_openchannel_queue','paranoid':![],'indexes':[{'name':_0xb814('0xd'),'fields':[_0xb814('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index c165a07..c1db6bb 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 _0xeb3b=['OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','body','raw','debug','stringify','UpdateOpenchannelQueueReport','update','options','where','attributes','lodash','util','moment','bluebird','randomstring','../../config/utils','rpc','jayson/promise','client','http','request','then','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xeb3b,0x19e));var _0xbeb3=function(_0x3eff21,_0x5bf36c){_0x3eff21=_0x3eff21-0x0;var _0x1945bb=_0xeb3b[_0x3eff21];return _0x1945bb;};'use strict';var _=require(_0xbeb3('0x0'));var util=require(_0xbeb3('0x1'));var moment=require(_0xbeb3('0x2'));var BPromise=require(_0xbeb3('0x3'));var rs=require(_0xbeb3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xbeb3('0x5'));var logger=require('../../config/logger')(_0xbeb3('0x6'));var config=require('../../config/environment');var jayson=require(_0xbeb3('0x7'));var client=jayson[_0xbeb3('0x8')][_0xbeb3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x294cc9,_0x406927,_0x143255){return new BPromise(function(_0x5a6a06,_0x241dbb){return client[_0xbeb3('0xa')](_0x294cc9,_0x143255)[_0xbeb3('0xb')](function(_0x3b61ac){logger[_0xbeb3('0xc')](_0xbeb3('0xd'),_0x406927,_0xbeb3('0xe'));logger['debug'](_0xbeb3('0xf'),_0x406927,_0xbeb3('0xe'),JSON['stringify'](_0x3b61ac));if(_0x3b61ac[_0xbeb3('0x10')]){if(_0x3b61ac[_0xbeb3('0x10')][_0xbeb3('0x11')]===0x1f4){logger[_0xbeb3('0x10')](_0xbeb3('0xd'),_0x406927,_0x3b61ac[_0xbeb3('0x10')]['message']);return _0x241dbb(_0x3b61ac['error'][_0xbeb3('0x12')]);}logger[_0xbeb3('0x10')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x406927,_0x3b61ac['error'][_0xbeb3('0x12')]);return _0x5a6a06(_0x3b61ac[_0xbeb3('0x10')][_0xbeb3('0x12')]);}else{logger[_0xbeb3('0xc')](_0xbeb3('0xd'),_0x406927,'request\x20sent');_0x5a6a06(_0x3b61ac[_0xbeb3('0x13')]['message']);}})[_0xbeb3('0x14')](function(_0x4e7d99){logger['error']('OpenchannelQueueReport,\x20%s,\x20%s',_0x406927,_0x4e7d99);_0x241dbb(_0x4e7d99);});});}exports[_0xbeb3('0x15')]=function(_0x44a4bb){var _0x32275b=this;return new Promise(function(_0x10b15d,_0x5d0689){return db[_0xbeb3('0x16')][_0xbeb3('0x17')](_0x44a4bb[_0xbeb3('0x18')],{'raw':_0x44a4bb['options']?_0x44a4bb['options'][_0xbeb3('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1d917b){logger['info']('CreateOpenchannelQueueReport',_0x44a4bb);logger[_0xbeb3('0x1a')](_0xbeb3('0x15'),_0x44a4bb,JSON[_0xbeb3('0x1b')](_0x1d917b));_0x10b15d(_0x1d917b);})['catch'](function(_0x301899){logger[_0xbeb3('0x10')]('CreateOpenchannelQueueReport',_0x301899[_0xbeb3('0x12')],_0x44a4bb);_0x5d0689(_0x32275b[_0xbeb3('0x10')](0x1f4,_0x301899['message']));});});};exports[_0xbeb3('0x1c')]=function(_0x278fe4){var _0x16b079=this;return new Promise(function(_0x42c6c3,_0x2bc188){return db[_0xbeb3('0x16')][_0xbeb3('0x1d')](_0x278fe4[_0xbeb3('0x18')],{'raw':_0x278fe4[_0xbeb3('0x1e')]?_0x278fe4['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x278fe4[_0xbeb3('0x1e')]?_0x278fe4['options'][_0xbeb3('0x1f')]||null:null,'attributes':_0x278fe4[_0xbeb3('0x1e')]?_0x278fe4[_0xbeb3('0x1e')][_0xbeb3('0x20')]||null:null,'limit':_0x278fe4['options']?_0x278fe4[_0xbeb3('0x1e')]['limit']||null:null})[_0xbeb3('0xb')](function(_0xab301c){logger['info']('UpdateOpenchannelQueueReport',_0x278fe4);logger[_0xbeb3('0x1a')]('UpdateOpenchannelQueueReport',_0x278fe4,JSON['stringify'](_0xab301c));_0x42c6c3(_0xab301c);})['catch'](function(_0x5bfef7){logger[_0xbeb3('0x10')]('UpdateOpenchannelQueueReport',_0x5bfef7[_0xbeb3('0x12')],_0x278fe4);_0x2bc188(_0x16b079[_0xbeb3('0x10')](0x1f4,_0x5bfef7[_0xbeb3('0x12')]));});});}; \ No newline at end of file +var _0x0b7f=['CreateOpenchannelQueueReport','OpenchannelQueueReport','create','options','raw','debug','stringify','catch','UpdateOpenchannelQueueReport','update','body','attributes','limit','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','error','code','OpenchannelQueueReport,\x20%s,\x20%s','message','request\x20sent','result'];(function(_0x4eb875,_0x331999){var _0x2c2c0d=function(_0x10efcf){while(--_0x10efcf){_0x4eb875['push'](_0x4eb875['shift']());}};_0x2c2c0d(++_0x331999);}(_0x0b7f,0x115));var _0xf0b7=function(_0x5e630e,_0x105b73){_0x5e630e=_0x5e630e-0x0;var _0x20405b=_0x0b7f[_0x5e630e];return _0x20405b;};'use strict';var _=require(_0xf0b7('0x0'));var util=require(_0xf0b7('0x1'));var moment=require('moment');var BPromise=require(_0xf0b7('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf0b7('0x3'));var db=require(_0xf0b7('0x4'))['db'];var utils=require(_0xf0b7('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xf0b7('0x6'));var jayson=require(_0xf0b7('0x7'));var client=jayson[_0xf0b7('0x8')][_0xf0b7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2b2de8,_0x5e449a,_0x1408ee){return new BPromise(function(_0x276f09,_0x275a13){return client[_0xf0b7('0xa')](_0x2b2de8,_0x1408ee)[_0xf0b7('0xb')](function(_0x588b46){logger[_0xf0b7('0xc')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x5e449a,'request\x20sent');logger['debug'](_0xf0b7('0xd'),_0x5e449a,'request\x20sent',JSON['stringify'](_0x588b46));if(_0x588b46[_0xf0b7('0xe')]){if(_0x588b46[_0xf0b7('0xe')][_0xf0b7('0xf')]===0x1f4){logger[_0xf0b7('0xe')](_0xf0b7('0x10'),_0x5e449a,_0x588b46[_0xf0b7('0xe')][_0xf0b7('0x11')]);return _0x275a13(_0x588b46[_0xf0b7('0xe')]['message']);}logger['error'](_0xf0b7('0x10'),_0x5e449a,_0x588b46[_0xf0b7('0xe')][_0xf0b7('0x11')]);return _0x276f09(_0x588b46[_0xf0b7('0xe')][_0xf0b7('0x11')]);}else{logger['info'](_0xf0b7('0x10'),_0x5e449a,_0xf0b7('0x12'));_0x276f09(_0x588b46[_0xf0b7('0x13')][_0xf0b7('0x11')]);}})['catch'](function(_0x303db6){logger[_0xf0b7('0xe')](_0xf0b7('0x10'),_0x5e449a,_0x303db6);_0x275a13(_0x303db6);});});}exports[_0xf0b7('0x14')]=function(_0x52b27e){var _0x1e5fc9=this;return new Promise(function(_0x153d23,_0x28fd36){return db[_0xf0b7('0x15')][_0xf0b7('0x16')](_0x52b27e['body'],{'raw':_0x52b27e[_0xf0b7('0x17')]?_0x52b27e['options'][_0xf0b7('0x18')]===undefined?!![]:![]:!![]})[_0xf0b7('0xb')](function(_0x374496){logger['info']('CreateOpenchannelQueueReport',_0x52b27e);logger[_0xf0b7('0x19')](_0xf0b7('0x14'),_0x52b27e,JSON[_0xf0b7('0x1a')](_0x374496));_0x153d23(_0x374496);})[_0xf0b7('0x1b')](function(_0xb90b3c){logger[_0xf0b7('0xe')](_0xf0b7('0x14'),_0xb90b3c[_0xf0b7('0x11')],_0x52b27e);_0x28fd36(_0x1e5fc9[_0xf0b7('0xe')](0x1f4,_0xb90b3c['message']));});});};exports[_0xf0b7('0x1c')]=function(_0x2cfb7b){var _0x14782a=this;return new Promise(function(_0x210afa,_0x2ba0da){return db[_0xf0b7('0x15')][_0xf0b7('0x1d')](_0x2cfb7b[_0xf0b7('0x1e')],{'raw':_0x2cfb7b[_0xf0b7('0x17')]?_0x2cfb7b[_0xf0b7('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2cfb7b[_0xf0b7('0x17')]?_0x2cfb7b[_0xf0b7('0x17')]['where']||null:null,'attributes':_0x2cfb7b[_0xf0b7('0x17')]?_0x2cfb7b[_0xf0b7('0x17')][_0xf0b7('0x1f')]||null:null,'limit':_0x2cfb7b['options']?_0x2cfb7b[_0xf0b7('0x17')][_0xf0b7('0x20')]||null:null})[_0xf0b7('0xb')](function(_0x4fda93){logger[_0xf0b7('0xc')](_0xf0b7('0x1c'),_0x2cfb7b);logger[_0xf0b7('0x19')](_0xf0b7('0x1c'),_0x2cfb7b,JSON[_0xf0b7('0x1a')](_0x4fda93));_0x210afa(_0x4fda93);})[_0xf0b7('0x1b')](function(_0x10643f){logger[_0xf0b7('0xe')](_0xf0b7('0x1c'),_0x10643f[_0xf0b7('0x11')],_0x2cfb7b);_0x2ba0da(_0x14782a['error'](0x1f4,_0x10643f[_0xf0b7('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index 5e1a3fd..ed8abb9 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 _0x7e84=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','post','create','put','update','delete','multer','util','path','connect-timeout','Router'];(function(_0x5ae0cb,_0x4e2965){var _0x405664=function(_0x5e4b8d){while(--_0x5e4b8d){_0x5ae0cb['push'](_0x5ae0cb['shift']());}};_0x405664(++_0x4e2965);}(_0x7e84,0xeb));var _0x47e8=function(_0x4936fe,_0x36693a){_0x4936fe=_0x4936fe-0x0;var _0x4238c8=_0x7e84[_0x4936fe];return _0x4238c8;};'use strict';var multer=require(_0x47e8('0x0'));var util=require(_0x47e8('0x1'));var path=require(_0x47e8('0x2'));var timeout=require(_0x47e8('0x3'));var express=require('express');var router=express[_0x47e8('0x4')]();var fs_extra=require(_0x47e8('0x5'));var auth=require(_0x47e8('0x6'));var interaction=require(_0x47e8('0x7'));var config=require(_0x47e8('0x8'));var controller=require('./openchannelTransferReport.controller');router[_0x47e8('0x9')]('/',auth[_0x47e8('0xa')](),controller['index']);router[_0x47e8('0x9')](_0x47e8('0xb'),auth[_0x47e8('0xa')](),controller[_0x47e8('0xc')]);router['get'](_0x47e8('0xd'),auth[_0x47e8('0xa')](),controller[_0x47e8('0xe')]);router[_0x47e8('0xf')]('/',auth[_0x47e8('0xa')](),controller[_0x47e8('0x10')]);router[_0x47e8('0x11')](_0x47e8('0xd'),auth['isAuthenticated'](),controller[_0x47e8('0x12')]);router[_0x47e8('0x13')](_0x47e8('0xd'),auth[_0x47e8('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x8662=['get','isAuthenticated','index','describe','/:id','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','./openchannelTransferReport.controller'];(function(_0x6f1a87,_0x5d5bcf){var _0x2495c7=function(_0x1c6733){while(--_0x1c6733){_0x6f1a87['push'](_0x6f1a87['shift']());}};_0x2495c7(++_0x5d5bcf);}(_0x8662,0x1bd));var _0x2866=function(_0x14473f,_0x1b93ea){_0x14473f=_0x14473f-0x0;var _0x7b682e=_0x8662[_0x14473f];return _0x7b682e;};'use strict';var multer=require(_0x2866('0x0'));var util=require(_0x2866('0x1'));var path=require(_0x2866('0x2'));var timeout=require(_0x2866('0x3'));var express=require(_0x2866('0x4'));var router=express[_0x2866('0x5')]();var fs_extra=require(_0x2866('0x6'));var auth=require(_0x2866('0x7'));var interaction=require(_0x2866('0x8'));var config=require(_0x2866('0x9'));var controller=require(_0x2866('0xa'));router[_0x2866('0xb')]('/',auth[_0x2866('0xc')](),controller[_0x2866('0xd')]);router[_0x2866('0xb')]('/describe',auth[_0x2866('0xc')](),controller[_0x2866('0xe')]);router['get'](_0x2866('0xf'),auth[_0x2866('0xc')](),controller[_0x2866('0x10')]);router[_0x2866('0x11')]('/',auth[_0x2866('0xc')](),controller[_0x2866('0x12')]);router[_0x2866('0x13')](_0x2866('0xf'),auth[_0x2866('0xc')](),controller[_0x2866('0x14')]);router[_0x2866('0x15')](_0x2866('0xf'),auth['isAuthenticated'](),controller[_0x2866('0x16')]);module[_0x2866('0x17')]=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index cd52f3e..0d3f19d 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 _0x9c44=['ENUM','account','agent','queue','NOW','exports','STRING'];(function(_0xfad1a7,_0x2e3b8d){var _0x571012=function(_0x33255d){while(--_0x33255d){_0xfad1a7['push'](_0xfad1a7['shift']());}};_0x571012(++_0x2e3b8d);}(_0x9c44,0x178));var _0x49c4=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0x9c44[_0x209941];return _0x1e8729;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x49c4('0x0')]={'uniqueid':{'type':Sequelize[_0x49c4('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x49c4('0x2')](_0x49c4('0x3'),_0x49c4('0x4'),_0x49c4('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x49c4('0x6')]}}; \ No newline at end of file +var _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0x396101,_0x2d5b6c){var _0x4006c0=function(_0x365cec){while(--_0x365cec){_0x396101['push'](_0x396101['shift']());}};_0x4006c0(++_0x2d5b6c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0xa9e0[_0x38a7ac];return _0x53061a;};'use strict';var moment=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x3'),'agent',_0x0a9e('0x4')),'allowNull':![],'defaultValue':_0x0a9e('0x4')},'transferredAt':{'type':Sequelize[_0x0a9e('0x5')],'allowNull':![],'defaultValue':Sequelize[_0x0a9e('0x6')]}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index f2ce11e..4c6b68c 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 _0x35c1=['OpenchannelTransferReport','rawAttributes','fieldName','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','rows','show','params','length','catch','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','reject','save','update','then','destroy','error','stack','name','send','map'];(function(_0x51c819,_0xd812db){var _0x15c5d2=function(_0x2977f0){while(--_0x2977f0){_0x51c819['push'](_0x51c819['shift']());}};_0x15c5d2(++_0xd812db);}(_0x35c1,0x104));var _0x135c=function(_0x26f499,_0x2359ef){_0x26f499=_0x26f499-0x0;var _0xccb39=_0x35c1[_0x26f499];return _0xccb39;};'use strict';var emlformat=require(_0x135c('0x0'));var rimraf=require(_0x135c('0x1'));var zipdir=require(_0x135c('0x2'));var jsonpatch=require(_0x135c('0x3'));var rp=require(_0x135c('0x4'));var moment=require(_0x135c('0x5'));var BPromise=require(_0x135c('0x6'));var Mustache=require(_0x135c('0x7'));var util=require(_0x135c('0x8'));var path=require(_0x135c('0x9'));var sox=require(_0x135c('0xa'));var csv=require(_0x135c('0xb'));var ejs=require(_0x135c('0xc'));var fs=require('fs');var fs_extra=require(_0x135c('0xd'));var _=require('lodash');var squel=require(_0x135c('0xe'));var crypto=require('crypto');var jsforce=require(_0x135c('0xf'));var deskjs=require(_0x135c('0x10'));var toCsv=require(_0x135c('0xb'));var querystring=require(_0x135c('0x11'));var Papa=require('papaparse');var Redis=require(_0x135c('0x12'));var authService=require(_0x135c('0x13'));var qs=require(_0x135c('0x14'));var as=require(_0x135c('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x135c('0x16'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x135c('0x17'));var db=require(_0x135c('0x18'))['db'];function respondWithStatusCode(_0x2e1fd9,_0x175d3b){_0x175d3b=_0x175d3b||0xcc;return function(_0x168dff){if(_0x168dff){return _0x2e1fd9[_0x135c('0x19')](_0x175d3b);}return _0x2e1fd9['status'](_0x175d3b)[_0x135c('0x1a')]();};}function respondWithResult(_0x4ef49a,_0x436f3e){_0x436f3e=_0x436f3e||0xc8;return function(_0x4baaff){if(_0x4baaff){return _0x4ef49a[_0x135c('0x1b')](_0x436f3e)[_0x135c('0x1c')](_0x4baaff);}};}function respondWithFilteredResult(_0x512819,_0x151fdf){return function(_0x3c3bb7){if(_0x3c3bb7){var _0x5057a5=typeof _0x151fdf[_0x135c('0x1d')]===_0x135c('0x1e')&&typeof _0x151fdf[_0x135c('0x1f')]===_0x135c('0x1e');var _0x3de602=_0x3c3bb7[_0x135c('0x20')];var _0x24b4d6=_0x5057a5?0x0:_0x151fdf[_0x135c('0x1d')];var _0x3235f2=_0x5057a5?_0x3c3bb7[_0x135c('0x20')]:_0x151fdf[_0x135c('0x1d')]+_0x151fdf['limit'];var _0x73d252;if(_0x3235f2>=_0x3de602){_0x3235f2=_0x3de602;_0x73d252=0xc8;}else{_0x73d252=0xce;}_0x512819[_0x135c('0x1b')](_0x73d252);return _0x512819[_0x135c('0x21')]('Content-Range',_0x24b4d6+'-'+_0x3235f2+'/'+_0x3de602)[_0x135c('0x1c')](_0x3c3bb7);}return null;};}function patchUpdates(_0x8b2e81){return function(_0x1107a3){try{jsonpatch['apply'](_0x1107a3,_0x8b2e81,!![]);}catch(_0x5e92e3){return BPromise[_0x135c('0x22')](_0x5e92e3);}return _0x1107a3[_0x135c('0x23')]();};}function saveUpdates(_0x2799d2,_0x130e65){return function(_0xbe1306){if(_0xbe1306){return _0xbe1306[_0x135c('0x24')](_0x2799d2)[_0x135c('0x25')](function(_0x57dd5c){return _0x57dd5c;});}return null;};}function removeEntity(_0x3de1be,_0x4786f6){return function(_0x37c4d3){if(_0x37c4d3){return _0x37c4d3[_0x135c('0x26')]()['then'](function(){_0x3de1be[_0x135c('0x1b')](0xcc)[_0x135c('0x1a')]();});}};}function handleEntityNotFound(_0x10d1c1,_0x8bff40){return function(_0x459a10){if(!_0x459a10){_0x10d1c1[_0x135c('0x19')](0x194);}return _0x459a10;};}function handleError(_0x51acbd,_0x2593d0){_0x2593d0=_0x2593d0||0x1f4;return function(_0x464174){logger[_0x135c('0x27')](_0x464174[_0x135c('0x28')]);if(_0x464174[_0x135c('0x29')]){delete _0x464174[_0x135c('0x29')];}_0x51acbd[_0x135c('0x1b')](_0x2593d0)[_0x135c('0x2a')](_0x464174);};}exports['index']=function(_0xc1e62b,_0x45857e){var _0x12da92={},_0x5e0f83={},_0x44e81={'count':0x0,'rows':[]};var _0x1adb6b=_[_0x135c('0x2b')](db[_0x135c('0x2c')][_0x135c('0x2d')],function(_0x6fb83e){return{'name':_0x6fb83e[_0x135c('0x2e')],'type':_0x6fb83e['type']['key']};});_0x5e0f83[_0x135c('0x2f')]=_['map'](_0x1adb6b,_0x135c('0x29'));_0x5e0f83['query']=_[_0x135c('0x30')](_0xc1e62b[_0x135c('0x31')]);_0x5e0f83[_0x135c('0x32')]=_['intersection'](_0x5e0f83[_0x135c('0x2f')],_0x5e0f83[_0x135c('0x31')]);_0x12da92['attributes']=_[_0x135c('0x33')](_0x5e0f83['model'],qs[_0x135c('0x34')](_0xc1e62b[_0x135c('0x31')][_0x135c('0x34')]));_0x12da92['attributes']=_0x12da92['attributes']['length']?_0x12da92[_0x135c('0x35')]:_0x5e0f83['model'];if(!_0xc1e62b['query'][_0x135c('0x36')](_0x135c('0x37'))){_0x12da92[_0x135c('0x1f')]=qs['limit'](_0xc1e62b[_0x135c('0x31')][_0x135c('0x1f')]);_0x12da92[_0x135c('0x1d')]=qs[_0x135c('0x1d')](_0xc1e62b[_0x135c('0x31')]['offset']);}_0x12da92[_0x135c('0x38')]=qs[_0x135c('0x39')](_0xc1e62b['query'][_0x135c('0x39')]);_0x12da92[_0x135c('0x3a')]=qs[_0x135c('0x32')](_[_0x135c('0x3b')](_0xc1e62b['query'],_0x5e0f83[_0x135c('0x32')]),_0x1adb6b);if(_0xc1e62b[_0x135c('0x31')][_0x135c('0x3c')]){_0x12da92['where']=_[_0x135c('0x3d')](_0x12da92[_0x135c('0x3a')],{'$or':_[_0x135c('0x2b')](_0x1adb6b,function(_0x2937f3){if(_0x2937f3[_0x135c('0x3e')]!==_0x135c('0x3f')){var _0x4a8a56={};_0x4a8a56[_0x2937f3[_0x135c('0x29')]]={'$like':'%'+_0xc1e62b[_0x135c('0x31')][_0x135c('0x3c')]+'%'};return _0x4a8a56;}})});}_0x12da92=_[_0x135c('0x3d')]({},_0x12da92,_0xc1e62b[_0x135c('0x40')]);var _0x3f0aa8={'where':_0x12da92[_0x135c('0x3a')]};return db[_0x135c('0x2c')][_0x135c('0x20')](_0x3f0aa8)['then'](function(_0x470486){_0x44e81[_0x135c('0x20')]=_0x470486;if(_0xc1e62b['query'][_0x135c('0x41')]){_0x12da92[_0x135c('0x42')]=[{'all':!![]}];}return db[_0x135c('0x2c')]['findAll'](_0x12da92);})[_0x135c('0x25')](function(_0x2c0500){_0x44e81[_0x135c('0x43')]=_0x2c0500;return _0x44e81;})[_0x135c('0x25')](respondWithFilteredResult(_0x45857e,_0x12da92))['catch'](handleError(_0x45857e,null));};exports[_0x135c('0x44')]=function(_0x47bcb6,_0x309d68){var _0x27ccf7={'raw':!![],'where':{'id':_0x47bcb6[_0x135c('0x45')]['id']}},_0x4e878a={};_0x4e878a[_0x135c('0x2f')]=_[_0x135c('0x30')](db[_0x135c('0x2c')]['rawAttributes']);_0x4e878a[_0x135c('0x31')]=_[_0x135c('0x30')](_0x47bcb6[_0x135c('0x31')]);_0x4e878a[_0x135c('0x32')]=_[_0x135c('0x33')](_0x4e878a[_0x135c('0x2f')],_0x4e878a[_0x135c('0x31')]);_0x27ccf7['attributes']=_[_0x135c('0x33')](_0x4e878a['model'],qs[_0x135c('0x34')](_0x47bcb6[_0x135c('0x31')][_0x135c('0x34')]));_0x27ccf7[_0x135c('0x35')]=_0x27ccf7['attributes'][_0x135c('0x46')]?_0x27ccf7[_0x135c('0x35')]:_0x4e878a['model'];if(_0x47bcb6[_0x135c('0x31')]['includeAll']){_0x27ccf7[_0x135c('0x42')]=[{'all':!![]}];}_0x27ccf7=_[_0x135c('0x3d')]({},_0x27ccf7,_0x47bcb6[_0x135c('0x40')]);return db[_0x135c('0x2c')]['find'](_0x27ccf7)['then'](handleEntityNotFound(_0x309d68,null))[_0x135c('0x25')](respondWithResult(_0x309d68,null))[_0x135c('0x47')](handleError(_0x309d68,null));};exports['create']=function(_0x4aedc4,_0x25d9a2){return db[_0x135c('0x2c')][_0x135c('0x48')](_0x4aedc4[_0x135c('0x49')],{})['then'](respondWithResult(_0x25d9a2,0xc9))[_0x135c('0x47')](handleError(_0x25d9a2,null));};exports[_0x135c('0x24')]=function(_0x5a5a82,_0x3a2e3f){if(_0x5a5a82[_0x135c('0x49')]['id']){delete _0x5a5a82['body']['id'];}return db['OpenchannelTransferReport'][_0x135c('0x4a')]({'where':{'id':_0x5a5a82[_0x135c('0x45')]['id']}})[_0x135c('0x25')](handleEntityNotFound(_0x3a2e3f,null))[_0x135c('0x25')](saveUpdates(_0x5a5a82[_0x135c('0x49')],null))[_0x135c('0x25')](respondWithResult(_0x3a2e3f,null))[_0x135c('0x47')](handleError(_0x3a2e3f,null));};exports['destroy']=function(_0x16950a,_0x34818e){return db[_0x135c('0x2c')][_0x135c('0x4a')]({'where':{'id':_0x16950a[_0x135c('0x45')]['id']}})[_0x135c('0x25')](handleEntityNotFound(_0x34818e,null))[_0x135c('0x25')](removeEntity(_0x34818e,null))[_0x135c('0x47')](handleError(_0x34818e,null));};exports[_0x135c('0x4b')]=function(_0x7a188f,_0x298b15){return db[_0x135c('0x2c')][_0x135c('0x4b')]()[_0x135c('0x25')](respondWithResult(_0x298b15,null))[_0x135c('0x47')](handleError(_0x298b15,null));}; \ No newline at end of file +var _0x1f7c=['crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','count','offset','limit','set','Content-Range','reject','save','update','then','end','sendStatus','error','name','index','map','OpenchannelTransferReport','rawAttributes','fieldName','type','key','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','params','model','keys','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash'];(function(_0x9fdb4b,_0x3b9ae9){var _0x36a1ed=function(_0x6c8c5e){while(--_0x6c8c5e){_0x9fdb4b['push'](_0x9fdb4b['shift']());}};_0x36a1ed(++_0x3b9ae9);}(_0x1f7c,0x122));var _0xc1f7=function(_0x15c421,_0x6366f7){_0x15c421=_0x15c421-0x0;var _0x5e5ed5=_0x1f7c[_0x15c421];return _0x5e5ed5;};'use strict';var emlformat=require(_0xc1f7('0x0'));var rimraf=require(_0xc1f7('0x1'));var zipdir=require(_0xc1f7('0x2'));var jsonpatch=require(_0xc1f7('0x3'));var rp=require(_0xc1f7('0x4'));var moment=require(_0xc1f7('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc1f7('0x6'));var util=require(_0xc1f7('0x7'));var path=require(_0xc1f7('0x8'));var sox=require(_0xc1f7('0x9'));var csv=require(_0xc1f7('0xa'));var ejs=require(_0xc1f7('0xb'));var fs=require('fs');var fs_extra=require(_0xc1f7('0xc'));var _=require(_0xc1f7('0xd'));var squel=require('squel');var crypto=require(_0xc1f7('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc1f7('0xf'));var toCsv=require(_0xc1f7('0xa'));var querystring=require(_0xc1f7('0x10'));var Papa=require('papaparse');var Redis=require(_0xc1f7('0x11'));var authService=require(_0xc1f7('0x12'));var qs=require(_0xc1f7('0x13'));var as=require(_0xc1f7('0x14'));var hardwareService=require(_0xc1f7('0x15'));var logger=require('../../config/logger')(_0xc1f7('0x16'));var utils=require(_0xc1f7('0x17'));var config=require(_0xc1f7('0x18'));var licenseUtil=require(_0xc1f7('0x19'));var db=require(_0xc1f7('0x1a'))['db'];function respondWithStatusCode(_0x1d03c6,_0x5cfd84){_0x5cfd84=_0x5cfd84||0xcc;return function(_0x5b3c7e){if(_0x5b3c7e){return _0x1d03c6['sendStatus'](_0x5cfd84);}return _0x1d03c6[_0xc1f7('0x1b')](_0x5cfd84)['end']();};}function respondWithResult(_0x1521cf,_0x3673f4){_0x3673f4=_0x3673f4||0xc8;return function(_0x1f5438){if(_0x1f5438){return _0x1521cf['status'](_0x3673f4)[_0xc1f7('0x1c')](_0x1f5438);}};}function respondWithFilteredResult(_0x561519,_0x2a0a37){return function(_0x4c7da1){if(_0x4c7da1){var _0x3da31f=typeof _0x2a0a37['offset']==='undefined'&&typeof _0x2a0a37['limit']==='undefined';var _0x416429=_0x4c7da1[_0xc1f7('0x1d')];var _0x137771=_0x3da31f?0x0:_0x2a0a37[_0xc1f7('0x1e')];var _0x3a0233=_0x3da31f?_0x4c7da1[_0xc1f7('0x1d')]:_0x2a0a37['offset']+_0x2a0a37[_0xc1f7('0x1f')];var _0x289ece;if(_0x3a0233>=_0x416429){_0x3a0233=_0x416429;_0x289ece=0xc8;}else{_0x289ece=0xce;}_0x561519['status'](_0x289ece);return _0x561519[_0xc1f7('0x20')](_0xc1f7('0x21'),_0x137771+'-'+_0x3a0233+'/'+_0x416429)[_0xc1f7('0x1c')](_0x4c7da1);}return null;};}function patchUpdates(_0x3aeb60){return function(_0x37eded){try{jsonpatch['apply'](_0x37eded,_0x3aeb60,!![]);}catch(_0x5d8fce){return BPromise[_0xc1f7('0x22')](_0x5d8fce);}return _0x37eded[_0xc1f7('0x23')]();};}function saveUpdates(_0x465d6d,_0x330693){return function(_0x564fa9){if(_0x564fa9){return _0x564fa9[_0xc1f7('0x24')](_0x465d6d)[_0xc1f7('0x25')](function(_0x4c0ff7){return _0x4c0ff7;});}return null;};}function removeEntity(_0x3f8cd2,_0x11b8c6){return function(_0xfc7f89){if(_0xfc7f89){return _0xfc7f89['destroy']()['then'](function(){_0x3f8cd2[_0xc1f7('0x1b')](0xcc)[_0xc1f7('0x26')]();});}};}function handleEntityNotFound(_0x2e1ff7,_0x160e31){return function(_0x3ce638){if(!_0x3ce638){_0x2e1ff7[_0xc1f7('0x27')](0x194);}return _0x3ce638;};}function handleError(_0x51264f,_0x223d56){_0x223d56=_0x223d56||0x1f4;return function(_0x43352b){logger[_0xc1f7('0x28')](_0x43352b['stack']);if(_0x43352b[_0xc1f7('0x29')]){delete _0x43352b[_0xc1f7('0x29')];}_0x51264f[_0xc1f7('0x1b')](_0x223d56)['send'](_0x43352b);};}exports[_0xc1f7('0x2a')]=function(_0x38109f,_0x6c3d63){var _0x406885={},_0x29df75={},_0x4c4823={'count':0x0,'rows':[]};var _0x4200ac=_[_0xc1f7('0x2b')](db[_0xc1f7('0x2c')][_0xc1f7('0x2d')],function(_0x90f2a8){return{'name':_0x90f2a8[_0xc1f7('0x2e')],'type':_0x90f2a8[_0xc1f7('0x2f')][_0xc1f7('0x30')]};});_0x29df75['model']=_[_0xc1f7('0x2b')](_0x4200ac,_0xc1f7('0x29'));_0x29df75[_0xc1f7('0x31')]=_['keys'](_0x38109f[_0xc1f7('0x31')]);_0x29df75[_0xc1f7('0x32')]=_[_0xc1f7('0x33')](_0x29df75['model'],_0x29df75[_0xc1f7('0x31')]);_0x406885[_0xc1f7('0x34')]=_[_0xc1f7('0x33')](_0x29df75['model'],qs[_0xc1f7('0x35')](_0x38109f['query'][_0xc1f7('0x35')]));_0x406885[_0xc1f7('0x34')]=_0x406885[_0xc1f7('0x34')][_0xc1f7('0x36')]?_0x406885[_0xc1f7('0x34')]:_0x29df75['model'];if(!_0x38109f[_0xc1f7('0x31')][_0xc1f7('0x37')](_0xc1f7('0x38'))){_0x406885[_0xc1f7('0x1f')]=qs[_0xc1f7('0x1f')](_0x38109f[_0xc1f7('0x31')][_0xc1f7('0x1f')]);_0x406885[_0xc1f7('0x1e')]=qs[_0xc1f7('0x1e')](_0x38109f['query']['offset']);}_0x406885[_0xc1f7('0x39')]=qs[_0xc1f7('0x3a')](_0x38109f['query'][_0xc1f7('0x3a')]);_0x406885[_0xc1f7('0x3b')]=qs[_0xc1f7('0x32')](_[_0xc1f7('0x3c')](_0x38109f[_0xc1f7('0x31')],_0x29df75['filters']),_0x4200ac);if(_0x38109f[_0xc1f7('0x31')][_0xc1f7('0x3d')]){_0x406885[_0xc1f7('0x3b')]=_[_0xc1f7('0x3e')](_0x406885[_0xc1f7('0x3b')],{'$or':_[_0xc1f7('0x2b')](_0x4200ac,function(_0x386d86){if(_0x386d86[_0xc1f7('0x2f')]!==_0xc1f7('0x3f')){var _0xc527a8={};_0xc527a8[_0x386d86[_0xc1f7('0x29')]]={'$like':'%'+_0x38109f[_0xc1f7('0x31')][_0xc1f7('0x3d')]+'%'};return _0xc527a8;}})});}_0x406885=_[_0xc1f7('0x3e')]({},_0x406885,_0x38109f[_0xc1f7('0x40')]);var _0x302c59={'where':_0x406885[_0xc1f7('0x3b')]};return db['OpenchannelTransferReport']['count'](_0x302c59)[_0xc1f7('0x25')](function(_0xf065d8){_0x4c4823[_0xc1f7('0x1d')]=_0xf065d8;if(_0x38109f[_0xc1f7('0x31')][_0xc1f7('0x41')]){_0x406885[_0xc1f7('0x42')]=[{'all':!![]}];}return db[_0xc1f7('0x2c')]['findAll'](_0x406885);})['then'](function(_0x34fba4){_0x4c4823[_0xc1f7('0x43')]=_0x34fba4;return _0x4c4823;})['then'](respondWithFilteredResult(_0x6c3d63,_0x406885))[_0xc1f7('0x44')](handleError(_0x6c3d63,null));};exports['show']=function(_0xc77af5,_0x495cf3){var _0xa42df1={'raw':!![],'where':{'id':_0xc77af5[_0xc1f7('0x45')]['id']}},_0x14612d={};_0x14612d[_0xc1f7('0x46')]=_['keys'](db['OpenchannelTransferReport']['rawAttributes']);_0x14612d[_0xc1f7('0x31')]=_[_0xc1f7('0x47')](_0xc77af5[_0xc1f7('0x31')]);_0x14612d['filters']=_[_0xc1f7('0x33')](_0x14612d[_0xc1f7('0x46')],_0x14612d[_0xc1f7('0x31')]);_0xa42df1[_0xc1f7('0x34')]=_[_0xc1f7('0x33')](_0x14612d[_0xc1f7('0x46')],qs[_0xc1f7('0x35')](_0xc77af5['query']['fields']));_0xa42df1[_0xc1f7('0x34')]=_0xa42df1['attributes'][_0xc1f7('0x36')]?_0xa42df1[_0xc1f7('0x34')]:_0x14612d[_0xc1f7('0x46')];if(_0xc77af5[_0xc1f7('0x31')][_0xc1f7('0x41')]){_0xa42df1['include']=[{'all':!![]}];}_0xa42df1=_['merge']({},_0xa42df1,_0xc77af5[_0xc1f7('0x40')]);return db[_0xc1f7('0x2c')][_0xc1f7('0x48')](_0xa42df1)[_0xc1f7('0x25')](handleEntityNotFound(_0x495cf3,null))[_0xc1f7('0x25')](respondWithResult(_0x495cf3,null))[_0xc1f7('0x44')](handleError(_0x495cf3,null));};exports[_0xc1f7('0x49')]=function(_0x3f702a,_0x30d478){return db[_0xc1f7('0x2c')][_0xc1f7('0x49')](_0x3f702a[_0xc1f7('0x4a')],{})['then'](respondWithResult(_0x30d478,0xc9))[_0xc1f7('0x44')](handleError(_0x30d478,null));};exports[_0xc1f7('0x24')]=function(_0x5865a1,_0x5e7d81){if(_0x5865a1['body']['id']){delete _0x5865a1[_0xc1f7('0x4a')]['id'];}return db[_0xc1f7('0x2c')][_0xc1f7('0x48')]({'where':{'id':_0x5865a1[_0xc1f7('0x45')]['id']}})[_0xc1f7('0x25')](handleEntityNotFound(_0x5e7d81,null))['then'](saveUpdates(_0x5865a1['body'],null))[_0xc1f7('0x25')](respondWithResult(_0x5e7d81,null))['catch'](handleError(_0x5e7d81,null));};exports[_0xc1f7('0x4b')]=function(_0x51f421,_0x33da82){return db[_0xc1f7('0x2c')][_0xc1f7('0x48')]({'where':{'id':_0x51f421[_0xc1f7('0x45')]['id']}})[_0xc1f7('0x25')](handleEntityNotFound(_0x33da82,null))[_0xc1f7('0x25')](removeEntity(_0x33da82,null))[_0xc1f7('0x44')](handleError(_0x33da82,null));};exports['describe']=function(_0x293faa,_0x35504f){return db[_0xc1f7('0x2c')]['describe']()[_0xc1f7('0x25')](respondWithResult(_0x35504f,null))[_0xc1f7('0x44')](handleError(_0x35504f,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index a05409c..254d128 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 _0x09e0=['../../config/logger','moment','request-promise','path','exports','define','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','lodash','util'];(function(_0xd5bab0,_0x39fc72){var _0x434e42=function(_0x22fc4f){while(--_0x22fc4f){_0xd5bab0['push'](_0xd5bab0['shift']());}};_0x434e42(++_0x39fc72);}(_0x09e0,0x1ab));var _0x009e=function(_0x395928,_0x51afb0){_0x395928=_0x395928-0x0;var _0x4efda4=_0x09e0[_0x395928];return _0x4efda4;};'use strict';var _=require(_0x009e('0x0'));var util=require(_0x009e('0x1'));var logger=require(_0x009e('0x2'))('api');var moment=require(_0x009e('0x3'));var BPromise=require('bluebird');var rp=require(_0x009e('0x4'));var fs=require('fs');var path=require(_0x009e('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./openchannelTransferReport.attributes');module[_0x009e('0x6')]=function(_0xd2fcf6,_0x1337ca){return _0xd2fcf6[_0x009e('0x7')](_0x009e('0x8'),attributes,{'tableName':_0x009e('0x9'),'paranoid':![],'indexes':[{'name':_0x009e('0xa'),'fields':[_0x009e('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb2e6=['exports','define','OpenchannelTransferReport','uniqueid','lodash','util','../../config/logger','moment','request-promise','rimraf','../../config/environment'];(function(_0x1089c3,_0x340bb6){var _0x3f07c4=function(_0x34141c){while(--_0x34141c){_0x1089c3['push'](_0x1089c3['shift']());}};_0x3f07c4(++_0x340bb6);}(_0xb2e6,0x16f));var _0x6b2e=function(_0x29271c,_0x4735c9){_0x29271c=_0x29271c-0x0;var _0x19848a=_0xb2e6[_0x29271c];return _0x19848a;};'use strict';var _=require(_0x6b2e('0x0'));var util=require(_0x6b2e('0x1'));var logger=require(_0x6b2e('0x2'))('api');var moment=require(_0x6b2e('0x3'));var BPromise=require('bluebird');var rp=require(_0x6b2e('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6b2e('0x5'));var config=require(_0x6b2e('0x6'));var attributes=require('./openchannelTransferReport.attributes');module[_0x6b2e('0x7')]=function(_0x2f15e2,_0x384c5b){return _0x2f15e2[_0x6b2e('0x8')](_0x6b2e('0x9'),attributes,{'tableName':'report_openchannel_transfer','paranoid':![],'indexes':[{'name':_0x6b2e('0xa'),'fields':[_0x6b2e('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 d943dc5..5671557 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 _0x04f9=['../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x04f9,0xb3));var _0x904f=function(_0x5c46f4,_0x57c7e9){_0x5c46f4=_0x5c46f4-0x0;var _0x53b19c=_0x04f9[_0x5c46f4];return _0x53b19c;};'use strict';var _=require('lodash');var util=require(_0x904f('0x0'));var moment=require(_0x904f('0x1'));var BPromise=require(_0x904f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x904f('0x3'));var db=require(_0x904f('0x4'))['db'];var utils=require(_0x904f('0x5'));var logger=require(_0x904f('0x6'))(_0x904f('0x7'));var config=require(_0x904f('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x904f('0x9')][_0x904f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x175c38,_0x21dce4,_0x34cbd7){return new BPromise(function(_0x506239,_0xa90c3f){return client[_0x904f('0xb')](_0x175c38,_0x34cbd7)[_0x904f('0xc')](function(_0x4f8d32){logger[_0x904f('0xd')](_0x904f('0xe'),_0x21dce4,_0x904f('0xf'));logger[_0x904f('0x10')](_0x904f('0x11'),_0x21dce4,_0x904f('0xf'),JSON[_0x904f('0x12')](_0x4f8d32));if(_0x4f8d32[_0x904f('0x13')]){if(_0x4f8d32[_0x904f('0x13')][_0x904f('0x14')]===0x1f4){logger[_0x904f('0x13')](_0x904f('0xe'),_0x21dce4,_0x4f8d32[_0x904f('0x13')][_0x904f('0x15')]);return _0xa90c3f(_0x4f8d32[_0x904f('0x13')][_0x904f('0x15')]);}logger[_0x904f('0x13')](_0x904f('0xe'),_0x21dce4,_0x4f8d32[_0x904f('0x13')][_0x904f('0x15')]);return _0x506239(_0x4f8d32[_0x904f('0x13')][_0x904f('0x15')]);}else{logger[_0x904f('0xd')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x21dce4,'request\x20sent');_0x506239(_0x4f8d32[_0x904f('0x16')][_0x904f('0x15')]);}})['catch'](function(_0x58c4d6){logger['error'](_0x904f('0xe'),_0x21dce4,_0x58c4d6);_0xa90c3f(_0x58c4d6);});});} \ No newline at end of file +var _0xa9b1=['http','request','then','info','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','code','error','OpenchannelTransferReport,\x20%s,\x20%s','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client'];(function(_0x393376,_0x1951fa){var _0x15980c=function(_0x1240fa){while(--_0x1240fa){_0x393376['push'](_0x393376['shift']());}};_0x15980c(++_0x1951fa);}(_0xa9b1,0x133));var _0x1a9b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa9b1[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1a9b('0x0'));var BPromise=require(_0x1a9b('0x1'));var rs=require(_0x1a9b('0x2'));var fs=require('fs');var Redis=require(_0x1a9b('0x3'));var db=require(_0x1a9b('0x4'))['db'];var utils=require(_0x1a9b('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x1a9b('0x6'));var client=jayson[_0x1a9b('0x7')][_0x1a9b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xc55657,_0x32cff5,_0x16c344){return new BPromise(function(_0x263b84,_0x16e01a){return client[_0x1a9b('0x9')](_0xc55657,_0x16c344)[_0x1a9b('0xa')](function(_0x162d6a){logger[_0x1a9b('0xb')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x32cff5,'request\x20sent');logger[_0x1a9b('0xc')](_0x1a9b('0xd'),_0x32cff5,_0x1a9b('0xe'),JSON['stringify'](_0x162d6a));if(_0x162d6a['error']){if(_0x162d6a['error'][_0x1a9b('0xf')]===0x1f4){logger[_0x1a9b('0x10')](_0x1a9b('0x11'),_0x32cff5,_0x162d6a[_0x1a9b('0x10')][_0x1a9b('0x12')]);return _0x16e01a(_0x162d6a[_0x1a9b('0x10')]['message']);}logger[_0x1a9b('0x10')](_0x1a9b('0x11'),_0x32cff5,_0x162d6a[_0x1a9b('0x10')]['message']);return _0x263b84(_0x162d6a[_0x1a9b('0x10')][_0x1a9b('0x12')]);}else{logger['info'](_0x1a9b('0x11'),_0x32cff5,'request\x20sent');_0x263b84(_0x162d6a[_0x1a9b('0x13')][_0x1a9b('0x12')]);}})[_0x1a9b('0x14')](function(_0x3903b7){logger[_0x1a9b('0x10')](_0x1a9b('0x11'),_0x32cff5,_0x3903b7);_0x16e01a(_0x3903b7);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index c24fc84..0799695 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 _0xa5ca=['./pause.controller','get','isAuthenticated','/:id','show','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service'];(function(_0x46a6f9,_0x50203c){var _0x17084a=function(_0xef87e2){while(--_0xef87e2){_0x46a6f9['push'](_0x46a6f9['shift']());}};_0x17084a(++_0x50203c);}(_0xa5ca,0x173));var _0xaa5c=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0xa5ca[_0x199572];return _0x13cfa3;};'use strict';var multer=require(_0xaa5c('0x0'));var util=require(_0xaa5c('0x1'));var path=require(_0xaa5c('0x2'));var timeout=require(_0xaa5c('0x3'));var express=require(_0xaa5c('0x4'));var router=express['Router']();var fs_extra=require(_0xaa5c('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xaa5c('0x6'));var config=require('../../config/environment');var controller=require(_0xaa5c('0x7'));router[_0xaa5c('0x8')]('/',auth[_0xaa5c('0x9')](),controller['index']);router[_0xaa5c('0x8')](_0xaa5c('0xa'),auth[_0xaa5c('0x9')](),controller[_0xaa5c('0xb')]);router['post']('/',auth[_0xaa5c('0x9')](),controller[_0xaa5c('0xc')]);router[_0xaa5c('0xd')](_0xaa5c('0xa'),auth[_0xaa5c('0x9')](),controller[_0xaa5c('0xe')]);router[_0xaa5c('0xf')](_0xaa5c('0xa'),auth[_0xaa5c('0x9')](),controller[_0xaa5c('0x10')]);module[_0xaa5c('0x11')]=router; \ No newline at end of file +var _0xae1d=['index','show','create','put','/:id','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x28509b,_0x5831ff){var _0x1e0b6=function(_0x37d8a2){while(--_0x37d8a2){_0x28509b['push'](_0x28509b['shift']());}};_0x1e0b6(++_0x5831ff);}(_0xae1d,0x80));var _0xdae1=function(_0x165082,_0x207ae8){_0x165082=_0x165082-0x0;var _0x21989b=_0xae1d[_0x165082];return _0x21989b;};'use strict';var multer=require(_0xdae1('0x0'));var util=require(_0xdae1('0x1'));var path=require(_0xdae1('0x2'));var timeout=require(_0xdae1('0x3'));var express=require(_0xdae1('0x4'));var router=express[_0xdae1('0x5')]();var fs_extra=require(_0xdae1('0x6'));var auth=require(_0xdae1('0x7'));var interaction=require(_0xdae1('0x8'));var config=require(_0xdae1('0x9'));var controller=require('./pause.controller');router[_0xdae1('0xa')]('/',auth[_0xdae1('0xb')](),controller[_0xdae1('0xc')]);router[_0xdae1('0xa')]('/:id',auth[_0xdae1('0xb')](),controller[_0xdae1('0xd')]);router['post']('/',auth[_0xdae1('0xb')](),controller[_0xdae1('0xe')]);router[_0xdae1('0xf')](_0xdae1('0x10'),auth[_0xdae1('0xb')](),controller[_0xdae1('0x11')]);router[_0xdae1('0x12')](_0xdae1('0x10'),auth['isAuthenticated'](),controller[_0xdae1('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index 2be0f2f..cfb4e55 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 _0xf51d=['STRING'];(function(_0x4538a1,_0x480129){var _0x2aa015=function(_0x87b472){while(--_0x87b472){_0x4538a1['push'](_0x4538a1['shift']());}};_0x2aa015(++_0x480129);}(_0xf51d,0x1ab));var _0xdf51=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf51d[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0xdf51('0x0')]}}; \ No newline at end of file +var _0xf804=['name','exports','STRING'];(function(_0x40913e,_0x1935a7){var _0x13042b=function(_0x5a742e){while(--_0x5a742e){_0x40913e['push'](_0x40913e['shift']());}};_0x13042b(++_0x1935a7);}(_0xf804,0x1c3));var _0x4f80=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf804[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require('sequelize');module[_0x4f80('0x0')]={'name':{'type':Sequelize[_0x4f80('0x1')],'unique':_0x4f80('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x4f80('0x1')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index f680d86..53d2cf8 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 _0x40f0=['reject','then','destroy','Pauses','UserProfileResource','stack','name','send','map','Pause','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','merge','VIRTUAL','options','where','includeAll','include','rows','catch','show','params','length','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','create','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply'];(function(_0xec3061,_0x27185a){var _0x316161=function(_0x23db6a){while(--_0x23db6a){_0xec3061['push'](_0xec3061['shift']());}};_0x316161(++_0x27185a);}(_0x40f0,0xd5));var _0x040f=function(_0x4d1dcb,_0x4dfe54){_0x4d1dcb=_0x4d1dcb-0x0;var _0x6d1d89=_0x40f0[_0x4d1dcb];return _0x6d1d89;};'use strict';var emlformat=require(_0x040f('0x0'));var rimraf=require(_0x040f('0x1'));var zipdir=require(_0x040f('0x2'));var jsonpatch=require(_0x040f('0x3'));var rp=require(_0x040f('0x4'));var moment=require(_0x040f('0x5'));var BPromise=require(_0x040f('0x6'));var Mustache=require(_0x040f('0x7'));var util=require(_0x040f('0x8'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x040f('0x9'));var fs=require('fs');var fs_extra=require(_0x040f('0xa'));var _=require(_0x040f('0xb'));var squel=require(_0x040f('0xc'));var crypto=require(_0x040f('0xd'));var jsforce=require(_0x040f('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x040f('0xf'));var querystring=require(_0x040f('0x10'));var Papa=require(_0x040f('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x040f('0x12'));var as=require(_0x040f('0x13'));var hardwareService=require(_0x040f('0x14'));var logger=require(_0x040f('0x15'))('api');var utils=require(_0x040f('0x16'));var config=require(_0x040f('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x040f('0x18'))['db'];function respondWithStatusCode(_0x51f756,_0x5eef0e){_0x5eef0e=_0x5eef0e||0xcc;return function(_0x766f22){if(_0x766f22){return _0x51f756[_0x040f('0x19')](_0x5eef0e);}return _0x51f756[_0x040f('0x1a')](_0x5eef0e)[_0x040f('0x1b')]();};}function respondWithResult(_0xdf5df0,_0x5d8ed0){_0x5d8ed0=_0x5d8ed0||0xc8;return function(_0x7ae041){if(_0x7ae041){return _0xdf5df0[_0x040f('0x1a')](_0x5d8ed0)['json'](_0x7ae041);}};}function respondWithFilteredResult(_0x30ba07,_0xc23f8c){return function(_0x3de70b){if(_0x3de70b){var _0x35303f=typeof _0xc23f8c[_0x040f('0x1c')]==='undefined'&&typeof _0xc23f8c[_0x040f('0x1d')]===_0x040f('0x1e');var _0x1bf1d0=_0x3de70b[_0x040f('0x1f')];var _0x4892a5=_0x35303f?0x0:_0xc23f8c['offset'];var _0x4b0e7d=_0x35303f?_0x3de70b[_0x040f('0x1f')]:_0xc23f8c[_0x040f('0x1c')]+_0xc23f8c['limit'];var _0x468500;if(_0x4b0e7d>=_0x1bf1d0){_0x4b0e7d=_0x1bf1d0;_0x468500=0xc8;}else{_0x468500=0xce;}_0x30ba07[_0x040f('0x1a')](_0x468500);return _0x30ba07[_0x040f('0x20')](_0x040f('0x21'),_0x4892a5+'-'+_0x4b0e7d+'/'+_0x1bf1d0)[_0x040f('0x22')](_0x3de70b);}return null;};}function patchUpdates(_0x3b22fa){return function(_0x3801e3){try{jsonpatch[_0x040f('0x23')](_0x3801e3,_0x3b22fa,!![]);}catch(_0x3d07a5){return BPromise[_0x040f('0x24')](_0x3d07a5);}return _0x3801e3['save']();};}function saveUpdates(_0x1e6357,_0x2e3d40){return function(_0x362b2d){if(_0x362b2d){return _0x362b2d['update'](_0x1e6357)[_0x040f('0x25')](function(_0x54451d){return _0x54451d;});}return null;};}function removeEntity(_0x48e01c,_0x1b59c6){return function(_0x1ee380){if(_0x1ee380){return _0x1ee380[_0x040f('0x26')]()['then'](function(){var _0xaff36a=_0x1ee380['get']({'plain':!![]});var _0x44e20a=_0x040f('0x27');return db[_0x040f('0x28')][_0x040f('0x26')]({'where':{'type':_0x44e20a,'resourceId':_0xaff36a['id']}})[_0x040f('0x25')](function(){return _0x1ee380;});})[_0x040f('0x25')](function(){_0x48e01c[_0x040f('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1447ff,_0x1ff45d){return function(_0x5bf9ba){if(!_0x5bf9ba){_0x1447ff[_0x040f('0x19')](0x194);}return _0x5bf9ba;};}function handleError(_0x71bf10,_0x2c2474){_0x2c2474=_0x2c2474||0x1f4;return function(_0x43e7fa){logger['error'](_0x43e7fa[_0x040f('0x29')]);if(_0x43e7fa['name']){delete _0x43e7fa[_0x040f('0x2a')];}_0x71bf10['status'](_0x2c2474)[_0x040f('0x2b')](_0x43e7fa);};}exports['index']=function(_0x291265,_0x26a219){var _0x569c72={},_0x5b52ca={},_0x26990f={'count':0x0,'rows':[]};var _0x235941=_[_0x040f('0x2c')](db[_0x040f('0x2d')][_0x040f('0x2e')],function(_0x3bc3cf){return{'name':_0x3bc3cf[_0x040f('0x2f')],'type':_0x3bc3cf[_0x040f('0x30')]['key']};});_0x5b52ca['model']=_[_0x040f('0x2c')](_0x235941,_0x040f('0x2a'));_0x5b52ca[_0x040f('0x31')]=_[_0x040f('0x32')](_0x291265[_0x040f('0x31')]);_0x5b52ca[_0x040f('0x33')]=_[_0x040f('0x34')](_0x5b52ca[_0x040f('0x35')],_0x5b52ca[_0x040f('0x31')]);_0x569c72[_0x040f('0x36')]=_[_0x040f('0x34')](_0x5b52ca['model'],qs[_0x040f('0x37')](_0x291265[_0x040f('0x31')][_0x040f('0x37')]));_0x569c72['attributes']=_0x569c72[_0x040f('0x36')]['length']?_0x569c72[_0x040f('0x36')]:_0x5b52ca[_0x040f('0x35')];if(!_0x291265['query'][_0x040f('0x38')](_0x040f('0x39'))){_0x569c72['limit']=qs[_0x040f('0x1d')](_0x291265['query'][_0x040f('0x1d')]);_0x569c72['offset']=qs[_0x040f('0x1c')](_0x291265[_0x040f('0x31')][_0x040f('0x1c')]);}_0x569c72[_0x040f('0x3a')]=qs[_0x040f('0x3b')](_0x291265['query'][_0x040f('0x3b')]);_0x569c72['where']=qs[_0x040f('0x33')](_[_0x040f('0x3c')](_0x291265['query'],_0x5b52ca[_0x040f('0x33')]),_0x235941);if(_0x291265[_0x040f('0x31')]['filter']){_0x569c72['where']=_[_0x040f('0x3d')](_0x569c72['where'],{'$or':_[_0x040f('0x2c')](_0x235941,function(_0x1fdf72){if(_0x1fdf72[_0x040f('0x30')]!==_0x040f('0x3e')){var _0xfd26ed={};_0xfd26ed[_0x1fdf72[_0x040f('0x2a')]]={'$like':'%'+_0x291265[_0x040f('0x31')]['filter']+'%'};return _0xfd26ed;}})});}_0x569c72=_[_0x040f('0x3d')]({},_0x569c72,_0x291265[_0x040f('0x3f')]);var _0x212346={'where':_0x569c72[_0x040f('0x40')]};return db[_0x040f('0x2d')][_0x040f('0x1f')](_0x212346)[_0x040f('0x25')](function(_0x5a06d0){_0x26990f['count']=_0x5a06d0;if(_0x291265[_0x040f('0x31')][_0x040f('0x41')]){_0x569c72[_0x040f('0x42')]=[{'all':!![]}];}return db[_0x040f('0x2d')]['findAll'](_0x569c72);})['then'](function(_0x22f9dd){_0x26990f[_0x040f('0x43')]=_0x22f9dd;return _0x26990f;})[_0x040f('0x25')](respondWithFilteredResult(_0x26a219,_0x569c72))[_0x040f('0x44')](handleError(_0x26a219,null));};exports[_0x040f('0x45')]=function(_0x213279,_0x101cb4){var _0x8fb224={'raw':!![],'where':{'id':_0x213279[_0x040f('0x46')]['id']}},_0x5cc0db={};_0x5cc0db[_0x040f('0x35')]=_['keys'](db[_0x040f('0x2d')][_0x040f('0x2e')]);_0x5cc0db[_0x040f('0x31')]=_[_0x040f('0x32')](_0x213279[_0x040f('0x31')]);_0x5cc0db[_0x040f('0x33')]=_[_0x040f('0x34')](_0x5cc0db[_0x040f('0x35')],_0x5cc0db[_0x040f('0x31')]);_0x8fb224[_0x040f('0x36')]=_[_0x040f('0x34')](_0x5cc0db[_0x040f('0x35')],qs[_0x040f('0x37')](_0x213279[_0x040f('0x31')]['fields']));_0x8fb224[_0x040f('0x36')]=_0x8fb224[_0x040f('0x36')][_0x040f('0x47')]?_0x8fb224['attributes']:_0x5cc0db['model'];if(_0x213279[_0x040f('0x31')]['includeAll']){_0x8fb224[_0x040f('0x42')]=[{'all':!![]}];}_0x8fb224=_[_0x040f('0x3d')]({},_0x8fb224,_0x213279[_0x040f('0x3f')]);return db[_0x040f('0x2d')][_0x040f('0x48')](_0x8fb224)[_0x040f('0x25')](handleEntityNotFound(_0x101cb4,null))['then'](respondWithResult(_0x101cb4,null))['catch'](handleError(_0x101cb4,null));};exports['create']=function(_0x1d26d1,_0x4312a5){return db['Pause']['create'](_0x1d26d1[_0x040f('0x49')],{})[_0x040f('0x25')](function(_0x5e94f6){var _0x33d6d4=_0x1d26d1[_0x040f('0x4a')]['get']({'plain':!![]});if(!_0x33d6d4)throw new Error(_0x040f('0x4b'));if(_0x33d6d4[_0x040f('0x4c')]===_0x040f('0x4a')){var _0x5152bb=_0x5e94f6['get']({'plain':!![]});var _0x14e2b5=_0x040f('0x27');return db[_0x040f('0x4d')]['find']({'where':{'name':_0x14e2b5,'userProfileId':_0x33d6d4[_0x040f('0x4e')]},'raw':!![]})['then'](function(_0x1dc575){if(_0x1dc575&&_0x1dc575[_0x040f('0x4f')]===0x0){return db[_0x040f('0x28')][_0x040f('0x50')]({'name':_0x5152bb['name'],'resourceId':_0x5152bb['id'],'type':_0x1dc575['name'],'sectionId':_0x1dc575['id']},{})[_0x040f('0x25')](function(){return _0x5e94f6;});}else{return _0x5e94f6;}})[_0x040f('0x44')](function(_0x9df3d3){logger[_0x040f('0x51')](_0x040f('0x52'),_0x9df3d3);throw _0x9df3d3;});}return _0x5e94f6;})[_0x040f('0x25')](respondWithResult(_0x4312a5,0xc9))[_0x040f('0x44')](handleError(_0x4312a5,null));};exports['update']=function(_0x3b56f9,_0x578089){if(_0x3b56f9['body']['id']){delete _0x3b56f9[_0x040f('0x49')]['id'];}return db[_0x040f('0x2d')][_0x040f('0x48')]({'where':{'id':_0x3b56f9[_0x040f('0x46')]['id']}})['then'](handleEntityNotFound(_0x578089,null))['then'](saveUpdates(_0x3b56f9['body'],null))[_0x040f('0x25')](respondWithResult(_0x578089,null))[_0x040f('0x44')](handleError(_0x578089,null));};exports[_0x040f('0x26')]=function(_0x12c491,_0x229062){return db['Pause'][_0x040f('0x48')]({'where':{'id':_0x12c491[_0x040f('0x46')]['id']}})[_0x040f('0x25')](handleEntityNotFound(_0x229062,null))['then'](removeEntity(_0x229062,null))[_0x040f('0x44')](handleError(_0x229062,null));}; \ No newline at end of file +var _0x508e=['find','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','get','name','send','index','map','Pause','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Pauses','UserProfileSection'];(function(_0x1a9204,_0x1c9e00){var _0x17ca68=function(_0x1f4399){while(--_0x1f4399){_0x1a9204['push'](_0x1a9204['shift']());}};_0x17ca68(++_0x1c9e00);}(_0x508e,0xab));var _0xe508=function(_0x5e64bf,_0x151e17){_0x5e64bf=_0x5e64bf-0x0;var _0x3e5419=_0x508e[_0x5e64bf];return _0x3e5419;};'use strict';var emlformat=require(_0xe508('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe508('0x1'));var jsonpatch=require(_0xe508('0x2'));var rp=require(_0xe508('0x3'));var moment=require(_0xe508('0x4'));var BPromise=require(_0xe508('0x5'));var Mustache=require(_0xe508('0x6'));var util=require(_0xe508('0x7'));var path=require(_0xe508('0x8'));var sox=require(_0xe508('0x9'));var csv=require(_0xe508('0xa'));var ejs=require(_0xe508('0xb'));var fs=require('fs');var fs_extra=require(_0xe508('0xc'));var _=require(_0xe508('0xd'));var squel=require(_0xe508('0xe'));var crypto=require(_0xe508('0xf'));var jsforce=require(_0xe508('0x10'));var deskjs=require(_0xe508('0x11'));var toCsv=require(_0xe508('0xa'));var querystring=require(_0xe508('0x12'));var Papa=require(_0xe508('0x13'));var Redis=require(_0xe508('0x14'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe508('0x15'));var hardwareService=require(_0xe508('0x16'));var logger=require('../../config/logger')(_0xe508('0x17'));var utils=require(_0xe508('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xe508('0x19'));var db=require(_0xe508('0x1a'))['db'];function respondWithStatusCode(_0x2df9a9,_0x3b6a30){_0x3b6a30=_0x3b6a30||0xcc;return function(_0x59ffbf){if(_0x59ffbf){return _0x2df9a9['sendStatus'](_0x3b6a30);}return _0x2df9a9[_0xe508('0x1b')](_0x3b6a30)[_0xe508('0x1c')]();};}function respondWithResult(_0x512d42,_0x17a261){_0x17a261=_0x17a261||0xc8;return function(_0x4c7c24){if(_0x4c7c24){return _0x512d42['status'](_0x17a261)[_0xe508('0x1d')](_0x4c7c24);}};}function respondWithFilteredResult(_0x1f9217,_0x4a896c){return function(_0x2007f5){if(_0x2007f5){var _0x106eb6=typeof _0x4a896c['offset']===_0xe508('0x1e')&&typeof _0x4a896c['limit']===_0xe508('0x1e');var _0x188e3e=_0x2007f5[_0xe508('0x1f')];var _0xe457=_0x106eb6?0x0:_0x4a896c[_0xe508('0x20')];var _0x197620=_0x106eb6?_0x2007f5[_0xe508('0x1f')]:_0x4a896c[_0xe508('0x20')]+_0x4a896c[_0xe508('0x21')];var _0x33fff4;if(_0x197620>=_0x188e3e){_0x197620=_0x188e3e;_0x33fff4=0xc8;}else{_0x33fff4=0xce;}_0x1f9217[_0xe508('0x1b')](_0x33fff4);return _0x1f9217[_0xe508('0x22')](_0xe508('0x23'),_0xe457+'-'+_0x197620+'/'+_0x188e3e)[_0xe508('0x1d')](_0x2007f5);}return null;};}function patchUpdates(_0x6fac0e){return function(_0x3892f1){try{jsonpatch[_0xe508('0x24')](_0x3892f1,_0x6fac0e,!![]);}catch(_0x3230d0){return BPromise[_0xe508('0x25')](_0x3230d0);}return _0x3892f1[_0xe508('0x26')]();};}function saveUpdates(_0x189c8d,_0x4bb958){return function(_0x5270bc){if(_0x5270bc){return _0x5270bc['update'](_0x189c8d)[_0xe508('0x27')](function(_0x1801bf){return _0x1801bf;});}return null;};}function removeEntity(_0x4eec11,_0x5f1374){return function(_0x1fffee){if(_0x1fffee){return _0x1fffee[_0xe508('0x28')]()[_0xe508('0x27')](function(){var _0x396a2d=_0x1fffee[_0xe508('0x29')]({'plain':!![]});var _0x41d098='Pauses';return db['UserProfileResource']['destroy']({'where':{'type':_0x41d098,'resourceId':_0x396a2d['id']}})[_0xe508('0x27')](function(){return _0x1fffee;});})[_0xe508('0x27')](function(){_0x4eec11[_0xe508('0x1b')](0xcc)[_0xe508('0x1c')]();});}};}function handleEntityNotFound(_0x2cf9b0,_0x2bd980){return function(_0x1f326d){if(!_0x1f326d){_0x2cf9b0['sendStatus'](0x194);}return _0x1f326d;};}function handleError(_0x4cccfc,_0x501682){_0x501682=_0x501682||0x1f4;return function(_0x4b806){logger['error'](_0x4b806['stack']);if(_0x4b806[_0xe508('0x2a')]){delete _0x4b806[_0xe508('0x2a')];}_0x4cccfc[_0xe508('0x1b')](_0x501682)[_0xe508('0x2b')](_0x4b806);};}exports[_0xe508('0x2c')]=function(_0x76729f,_0x49431d){var _0x5308dc={},_0x163e0a={},_0x252aa9={'count':0x0,'rows':[]};var _0x4559f5=_[_0xe508('0x2d')](db[_0xe508('0x2e')][_0xe508('0x2f')],function(_0x21de0e){return{'name':_0x21de0e[_0xe508('0x30')],'type':_0x21de0e[_0xe508('0x31')][_0xe508('0x32')]};});_0x163e0a[_0xe508('0x33')]=_[_0xe508('0x2d')](_0x4559f5,'name');_0x163e0a[_0xe508('0x34')]=_[_0xe508('0x35')](_0x76729f[_0xe508('0x34')]);_0x163e0a[_0xe508('0x36')]=_[_0xe508('0x37')](_0x163e0a[_0xe508('0x33')],_0x163e0a[_0xe508('0x34')]);_0x5308dc[_0xe508('0x38')]=_[_0xe508('0x37')](_0x163e0a[_0xe508('0x33')],qs['fields'](_0x76729f[_0xe508('0x34')][_0xe508('0x39')]));_0x5308dc['attributes']=_0x5308dc['attributes']['length']?_0x5308dc[_0xe508('0x38')]:_0x163e0a['model'];if(!_0x76729f[_0xe508('0x34')][_0xe508('0x3a')](_0xe508('0x3b'))){_0x5308dc[_0xe508('0x21')]=qs[_0xe508('0x21')](_0x76729f['query'][_0xe508('0x21')]);_0x5308dc[_0xe508('0x20')]=qs[_0xe508('0x20')](_0x76729f['query'][_0xe508('0x20')]);}_0x5308dc['order']=qs[_0xe508('0x3c')](_0x76729f[_0xe508('0x34')][_0xe508('0x3c')]);_0x5308dc['where']=qs[_0xe508('0x36')](_['pick'](_0x76729f[_0xe508('0x34')],_0x163e0a['filters']),_0x4559f5);if(_0x76729f[_0xe508('0x34')][_0xe508('0x3d')]){_0x5308dc['where']=_['merge'](_0x5308dc[_0xe508('0x3e')],{'$or':_[_0xe508('0x2d')](_0x4559f5,function(_0x248923){if(_0x248923[_0xe508('0x31')]!==_0xe508('0x3f')){var _0x148eb0={};_0x148eb0[_0x248923[_0xe508('0x2a')]]={'$like':'%'+_0x76729f[_0xe508('0x34')]['filter']+'%'};return _0x148eb0;}})});}_0x5308dc=_[_0xe508('0x40')]({},_0x5308dc,_0x76729f[_0xe508('0x41')]);var _0x57fd65={'where':_0x5308dc['where']};return db[_0xe508('0x2e')][_0xe508('0x1f')](_0x57fd65)['then'](function(_0x514190){_0x252aa9[_0xe508('0x1f')]=_0x514190;if(_0x76729f[_0xe508('0x34')][_0xe508('0x42')]){_0x5308dc[_0xe508('0x43')]=[{'all':!![]}];}return db['Pause'][_0xe508('0x44')](_0x5308dc);})[_0xe508('0x27')](function(_0x218c26){_0x252aa9['rows']=_0x218c26;return _0x252aa9;})[_0xe508('0x27')](respondWithFilteredResult(_0x49431d,_0x5308dc))[_0xe508('0x45')](handleError(_0x49431d,null));};exports[_0xe508('0x46')]=function(_0x109284,_0x27cf87){var _0x3ea995={'raw':!![],'where':{'id':_0x109284[_0xe508('0x47')]['id']}},_0xa7c2a={};_0xa7c2a[_0xe508('0x33')]=_[_0xe508('0x35')](db[_0xe508('0x2e')][_0xe508('0x2f')]);_0xa7c2a[_0xe508('0x34')]=_[_0xe508('0x35')](_0x109284[_0xe508('0x34')]);_0xa7c2a['filters']=_[_0xe508('0x37')](_0xa7c2a[_0xe508('0x33')],_0xa7c2a[_0xe508('0x34')]);_0x3ea995[_0xe508('0x38')]=_[_0xe508('0x37')](_0xa7c2a[_0xe508('0x33')],qs[_0xe508('0x39')](_0x109284[_0xe508('0x34')][_0xe508('0x39')]));_0x3ea995['attributes']=_0x3ea995[_0xe508('0x38')]['length']?_0x3ea995['attributes']:_0xa7c2a[_0xe508('0x33')];if(_0x109284['query'][_0xe508('0x42')]){_0x3ea995[_0xe508('0x43')]=[{'all':!![]}];}_0x3ea995=_[_0xe508('0x40')]({},_0x3ea995,_0x109284[_0xe508('0x41')]);return db['Pause']['find'](_0x3ea995)[_0xe508('0x27')](handleEntityNotFound(_0x27cf87,null))[_0xe508('0x27')](respondWithResult(_0x27cf87,null))[_0xe508('0x45')](handleError(_0x27cf87,null));};exports[_0xe508('0x48')]=function(_0x2e36fe,_0x54d3f6){return db['Pause'][_0xe508('0x48')](_0x2e36fe[_0xe508('0x49')],{})[_0xe508('0x27')](function(_0x18014c){var _0x4e79d3=_0x2e36fe[_0xe508('0x4a')][_0xe508('0x29')]({'plain':!![]});if(!_0x4e79d3)throw new Error(_0xe508('0x4b'));if(_0x4e79d3['role']==='user'){var _0x6bb0ae=_0x18014c[_0xe508('0x29')]({'plain':!![]});var _0x10e8dd=_0xe508('0x4c');return db[_0xe508('0x4d')][_0xe508('0x4e')]({'where':{'name':_0x10e8dd,'userProfileId':_0x4e79d3[_0xe508('0x4f')]},'raw':!![]})['then'](function(_0x34c90a){if(_0x34c90a&&_0x34c90a['autoAssociation']===0x0){return db[_0xe508('0x50')][_0xe508('0x48')]({'name':_0x6bb0ae[_0xe508('0x2a')],'resourceId':_0x6bb0ae['id'],'type':_0x34c90a[_0xe508('0x2a')],'sectionId':_0x34c90a['id']},{})['then'](function(){return _0x18014c;});}else{return _0x18014c;}})[_0xe508('0x45')](function(_0x2de7c2){logger['error'](_0xe508('0x51'),_0x2de7c2);throw _0x2de7c2;});}return _0x18014c;})[_0xe508('0x27')](respondWithResult(_0x54d3f6,0xc9))[_0xe508('0x45')](handleError(_0x54d3f6,null));};exports[_0xe508('0x52')]=function(_0x1e529e,_0x485071){if(_0x1e529e[_0xe508('0x49')]['id']){delete _0x1e529e['body']['id'];}return db['Pause']['find']({'where':{'id':_0x1e529e['params']['id']}})[_0xe508('0x27')](handleEntityNotFound(_0x485071,null))[_0xe508('0x27')](saveUpdates(_0x1e529e[_0xe508('0x49')],null))[_0xe508('0x27')](respondWithResult(_0x485071,null))[_0xe508('0x45')](handleError(_0x485071,null));};exports['destroy']=function(_0x2ce051,_0x18c187){return db[_0xe508('0x2e')][_0xe508('0x4e')]({'where':{'id':_0x2ce051[_0xe508('0x47')]['id']}})[_0xe508('0x27')](handleEntityNotFound(_0x18c187,null))[_0xe508('0x27')](removeEntity(_0x18c187,null))[_0xe508('0x45')](handleError(_0x18c187,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index 1361305..5ff3fc5 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 _0x5fc3=['lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./pause.attributes','exports','define','tools_pauses'];(function(_0x476062,_0xc7488){var _0x5518a8=function(_0x245715){while(--_0x245715){_0x476062['push'](_0x476062['shift']());}};_0x5518a8(++_0xc7488);}(_0x5fc3,0xa8));var _0x35fc=function(_0x55c00d,_0x520cb6){_0x55c00d=_0x55c00d-0x0;var _0x254a8f=_0x5fc3[_0x55c00d];return _0x254a8f;};'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')]('Pause',attributes,{'tableName':_0x35fc('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xabce=['util','../../config/logger','api','moment','path','rimraf','../../config/environment','define','tools_pauses','lodash'];(function(_0x6270f7,_0x3e1d17){var _0x597003=function(_0x549ea8){while(--_0x549ea8){_0x6270f7['push'](_0x6270f7['shift']());}};_0x597003(++_0x3e1d17);}(_0xabce,0x103));var _0xeabc=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xabce[_0x397e5f];return _0x5302b8;};'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('./pause.attributes');module['exports']=function(_0x1b07a8,_0x52a4d7){return _0x1b07a8[_0xeabc('0x8')]('Pause',attributes,{'tableName':_0xeabc('0x9'),'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 dc6be0a..1f150c1 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(_0x4e7b71,_0x127af9){var _0x2efd99=function(_0x9345c9){while(--_0x9345c9){_0x4e7b71['push'](_0x4e7b71['shift']());}};_0x2efd99(++_0x127af9);}(_0xb10b,0x12a));var _0xbb10=function(_0x1833cd,_0x369128){_0x1833cd=_0x1833cd-0x0;var _0x4360ac=_0xb10b[_0x1833cd];return _0x4360ac;};'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 _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(_0x23b960,_0x3fedb1){var _0x38d635=function(_0x26c82d){while(--_0x26c82d){_0x23b960['push'](_0x23b960['shift']());}};_0x38d635(++_0x3fedb1);}(_0xb10b,0x12a));var _0xbb10=function(_0x8ec6b4,_0x31ef52){_0x8ec6b4=_0x8ec6b4-0x0;var _0x52c0d0=_0xb10b[_0x8ec6b4];return _0x52c0d0;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')]({'raw':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8[_0xbb10('0x18')]?_0x378da8['options'][_0xbb10('0x1b')]||null:null,'include':_0x378da8[_0xbb10('0x18')]?_0x378da8['options']['include']?_[_0xbb10('0x1c')](_0x378da8[_0xbb10('0x18')][_0xbb10('0x1d')],function(_0x317da4){return{'model':db[_0x317da4[_0xbb10('0x1e')]],'as':_0x317da4['as'],'attributes':_0x317da4[_0xbb10('0x1b')],'include':_0x317da4[_0xbb10('0x1d')]?_[_0xbb10('0x1c')](_0x317da4[_0xbb10('0x1d')],function(_0x395404){return{'model':db[_0x395404[_0xbb10('0x1e')]],'as':_0x395404['as'],'attributes':_0x395404[_0xbb10('0x1b')],'include':_0x395404['include']?_['map'](_0x395404['include'],function(_0xc93a04){return{'model':db[_0xc93a04[_0xbb10('0x1e')]],'as':_0xc93a04['as'],'attributes':_0xc93a04[_0xbb10('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fdde9){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1f')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2fdde9));_0x575cca(_0x2fdde9);})[_0xbb10('0x20')](function(_0x4aabb9){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x4aabb9[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x4aabb9[_0xbb10('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/index.js b/server/api/plugin/index.js index 6ca350c..6146bc5 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 _0x00bb=['upload','post','put','delete','multer','util','path','express','fs-extra','../../components/auth/service','../../config/environment','./plugin.controller','get','/webhook','webhookGet','/:id','isAuthenticated','/:id/download','download','diskStorage','originalname','replace','%s-%s%s','basename','extname','file'];(function(_0x8eddab,_0x542a0a){var _0x55231a=function(_0x492bee){while(--_0x492bee){_0x8eddab['push'](_0x8eddab['shift']());}};_0x55231a(++_0x542a0a);}(_0x00bb,0x1d8));var _0xb00b=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x00bb[_0x1ac595];return _0x455fff;};'use strict';var multer=require(_0xb00b('0x0'));var util=require(_0xb00b('0x1'));var path=require(_0xb00b('0x2'));var timeout=require('connect-timeout');var express=require(_0xb00b('0x3'));var router=express['Router']();var fs_extra=require(_0xb00b('0x4'));var auth=require(_0xb00b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xb00b('0x6'));var controller=require(_0xb00b('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xb00b('0x8')](_0xb00b('0x9'),controller[_0xb00b('0xa')]);router[_0xb00b('0x8')](_0xb00b('0xb'),auth[_0xb00b('0xc')](),controller['show']);router['get'](_0xb00b('0xd'),auth[_0xb00b('0xc')](),controller[_0xb00b('0xe')]);var upload=multer({'storage':multer[_0xb00b('0xf')]({'destination':function(_0x28d3cc,_0x48e125,_0x3182db){_0x3182db(null,path['join'](config['root'],'server/files/plugins'));},'filename':function(_0x4ff792,_0x2d8ddf,_0x1be8aa){_0x2d8ddf[_0xb00b('0x10')]=_0x2d8ddf[_0xb00b('0x10')][_0xb00b('0x11')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x1be8aa(null,util['format'](_0xb00b('0x12'),path[_0xb00b('0x13')](_0x2d8ddf['originalname'],path[_0xb00b('0x14')](_0x2d8ddf[_0xb00b('0x10')])),Date['now'](),path['extname'](_0x2d8ddf[_0xb00b('0x10')])));}})});router['post']('/',upload['single'](_0xb00b('0x15')),controller[_0xb00b('0x16')]);router[_0xb00b('0x17')](_0xb00b('0x9'),controller['webhookPost']);router[_0xb00b('0x18')]('/:id',auth[_0xb00b('0xc')](),controller['update']);router[_0xb00b('0x19')]('/:id',auth[_0xb00b('0xc')](),controller[_0xb00b('0x19')]);module['exports']=router; \ No newline at end of file +var _0xe107=['get','/webhook','webhookGet','show','isAuthenticated','download','diskStorage','join','server/files/plugins','originalname','replace','format','%s-%s%s','basename','extname','now','single','upload','post','webhookPost','/:id','update','delete','exports','multer','path','connect-timeout','express','fs-extra','../../config/environment','./plugin.controller'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xe107,0xb3));var _0x7e10=function(_0x523a81,_0x537812){_0x523a81=_0x523a81-0x0;var _0x2f5e13=_0xe107[_0x523a81];return _0x2f5e13;};'use strict';var multer=require(_0x7e10('0x0'));var util=require('util');var path=require(_0x7e10('0x1'));var timeout=require(_0x7e10('0x2'));var express=require(_0x7e10('0x3'));var router=express['Router']();var fs_extra=require(_0x7e10('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7e10('0x5'));var controller=require(_0x7e10('0x6'));router[_0x7e10('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x7e10('0x7')](_0x7e10('0x8'),controller[_0x7e10('0x9')]);router[_0x7e10('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x7e10('0xa')]);router['get']('/:id/download',auth[_0x7e10('0xb')](),controller[_0x7e10('0xc')]);var upload=multer({'storage':multer[_0x7e10('0xd')]({'destination':function(_0x2bd58a,_0x256cb1,_0x52ba74){_0x52ba74(null,path[_0x7e10('0xe')](config['root'],_0x7e10('0xf')));},'filename':function(_0x2ca84c,_0x2f4d72,_0x5434dd){_0x2f4d72[_0x7e10('0x10')]=_0x2f4d72[_0x7e10('0x10')][_0x7e10('0x11')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x5434dd(null,util[_0x7e10('0x12')](_0x7e10('0x13'),path[_0x7e10('0x14')](_0x2f4d72[_0x7e10('0x10')],path[_0x7e10('0x15')](_0x2f4d72['originalname'])),Date[_0x7e10('0x16')](),path[_0x7e10('0x15')](_0x2f4d72['originalname'])));}})});router['post']('/',upload[_0x7e10('0x17')]('file'),controller[_0x7e10('0x18')]);router[_0x7e10('0x19')](_0x7e10('0x8'),controller[_0x7e10('0x1a')]);router['put'](_0x7e10('0x1b'),auth[_0x7e10('0xb')](),controller[_0x7e10('0x1c')]);router['delete'](_0x7e10('0x1b'),auth[_0x7e10('0xb')](),controller[_0x7e10('0x1d')]);module[_0x7e10('0x1e')]=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index e19c0c2..fb2faf8 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 _0x2292=['never','always','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','ENUM','html','TEXT','STRING','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','agentOnly'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x2292,0xdb));var _0x2229=function(_0x30a457,_0x2aa6b5){_0x30a457=_0x30a457-0x0;var _0x2ae5cd=_0x2292[_0x30a457];return _0x2ae5cd;};'use strict';var Sequelize=require(_0x2229('0x0'));module[_0x2229('0x1')]={'name':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x2229('0x2')](_0x2229('0x3'),'script')},'description':{'type':Sequelize[_0x2229('0x4')]},'version':{'type':Sequelize[_0x2229('0x4')]},'path':{'type':Sequelize[_0x2229('0x5')],'comment':'The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x2229('0x6')},'sidebar':{'type':Sequelize[_0x2229('0x2')](_0x2229('0x7'),_0x2229('0x8'),'always',_0x2229('0x9')),'defaultValue':_0x2229('0xa'),'comment':_0x2229('0xb')},'icon':{'type':Sequelize['STRING']},'adminUrl':{'type':Sequelize[_0x2229('0x5')]},'agentUrl':{'type':Sequelize[_0x2229('0x5')]},'scriptName':{'type':Sequelize[_0x2229('0x5')]},'scriptPath':{'type':Sequelize[_0x2229('0x5')]}}; \ No newline at end of file +var _0x8133=['STRING','ENUM','html','script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','agentOnly','always','never','sequelize','exports'];(function(_0x1157d3,_0x153f19){var _0x220a6a=function(_0x299e6b){while(--_0x299e6b){_0x1157d3['push'](_0x1157d3['shift']());}};_0x220a6a(++_0x153f19);}(_0x8133,0x1b0));var _0x3813=function(_0x16a25a,_0x337688){_0x16a25a=_0x16a25a-0x0;var _0x2db8c4=_0x8133[_0x16a25a];return _0x2db8c4;};'use strict';var Sequelize=require(_0x3813('0x0'));module[_0x3813('0x1')]={'name':{'type':Sequelize[_0x3813('0x2')]},'type':{'type':Sequelize[_0x3813('0x3')](_0x3813('0x4'),_0x3813('0x5'))},'description':{'type':Sequelize[_0x3813('0x6')]},'version':{'type':Sequelize[_0x3813('0x6')]},'path':{'type':Sequelize[_0x3813('0x2')],'comment':_0x3813('0x7')},'active':{'type':Sequelize[_0x3813('0x8')],'defaultValue':0x0,'comment':_0x3813('0x9')},'sidebar':{'type':Sequelize['ENUM'](_0x3813('0xa'),_0x3813('0xb'),_0x3813('0xc'),_0x3813('0xd')),'defaultValue':_0x3813('0xc'),'comment':'Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.'},'icon':{'type':Sequelize[_0x3813('0x2')]},'adminUrl':{'type':Sequelize[_0x3813('0x2')]},'agentUrl':{'type':Sequelize[_0x3813('0x2')]},'scriptName':{'type':Sequelize[_0x3813('0x2')]},'scriptPath':{'type':Sequelize[_0x3813('0x2')]}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index a2306b7..a33db0b 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 _0xe10d=['send','index','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','type','VIRTUAL','merge','options','Plugin','findAll','rows','catch','show','includeAll','include','find','download','params','join','root','format','%s.zip','createWriteStream','zip','warning','code','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','glob','**/*','server/files/plugins','dirname','basename','attachments/**/*','finalize','close','existsSync','unlinkSync','info','Temporary\x20file\x20removed','file','filename','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','some','manifest.json','Plugin\x20manifest\x20missing','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','Invalid\x20manifest:\x20views\x20missing','admin','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','Invalid\x20manifest:\x20script\x20path\x20missing','description','sidebar','always','icon','icon-apps','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','Warning:\x20agent\x20view\x20not\x20specified','agent','body','role','userProfileId','user','UserProfileSection','Plugins','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','webhookGet','\x27PATH\x27\x20parameter\x20not\x20specified','port','http://localhost:','encoding','method','headers','content-length','content-type','endsWith','statusCode','webhookPost','resolve','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','querystring','papaparse','rimraf','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./plugin.socket','register','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','end','error','stack','name'];(function(_0x582104,_0x1b9cce){var _0x293968=function(_0x599fa9){while(--_0x599fa9){_0x582104['push'](_0x582104['shift']());}};_0x293968(++_0x1b9cce);}(_0xe10d,0x12b));var _0xde10=function(_0xcb48ca,_0x540ecb){_0xcb48ca=_0xcb48ca-0x0;var _0x37be10=_0xe10d[_0xcb48ca];return _0x37be10;};'use strict';var emlformat=require(_0xde10('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xde10('0x1'));var jsonpatch=require(_0xde10('0x2'));var rp=require(_0xde10('0x3'));var moment=require(_0xde10('0x4'));var BPromise=require(_0xde10('0x5'));var Mustache=require(_0xde10('0x6'));var util=require(_0xde10('0x7'));var path=require(_0xde10('0x8'));var sox=require(_0xde10('0x9'));var csv=require(_0xde10('0xa'));var ejs=require(_0xde10('0xb'));var fs=require('fs');var fs_extra=require(_0xde10('0xc'));var _=require('lodash');var squel=require(_0xde10('0xd'));var crypto=require('crypto');var jsforce=require(_0xde10('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xde10('0xa'));var querystring=require(_0xde10('0xf'));var Papa=require(_0xde10('0x10'));var extract=require('extract-zip');var rimraf=require(_0xde10('0x11'));var archiver=require('archiver');var Redis=require(_0xde10('0x12'));var authService=require(_0xde10('0x13'));var qs=require(_0xde10('0x14'));var as=require(_0xde10('0x15'));var hardwareService=require(_0xde10('0x16'));var logger=require('../../config/logger')(_0xde10('0x17'));var utils=require(_0xde10('0x18'));var config=require(_0xde10('0x19'));var licenseUtil=require(_0xde10('0x1a'));var db=require(_0xde10('0x1b'))['db'];config['redis']=_[_0xde10('0x1c')](config[_0xde10('0x1d')],{'host':_0xde10('0x1e'),'port':0x18eb});var socket=require(_0xde10('0x1f'))(new Redis(config[_0xde10('0x1d')]));require(_0xde10('0x20'))[_0xde10('0x21')](socket);function respondWithStatusCode(_0xfc2efd,_0x601ad0){_0x601ad0=_0x601ad0||0xcc;return function(_0x29d2f2){if(_0x29d2f2){return _0xfc2efd[_0xde10('0x22')](_0x601ad0);}return _0xfc2efd[_0xde10('0x23')](_0x601ad0)['end']();};}function respondWithResult(_0xb9777f,_0x6028ee){_0x6028ee=_0x6028ee||0xc8;return function(_0x1cdc0a){if(_0x1cdc0a){return _0xb9777f[_0xde10('0x23')](_0x6028ee)[_0xde10('0x24')](_0x1cdc0a);}};}function respondWithFilteredResult(_0x321c1e,_0x515c16){return function(_0x341c1e){if(_0x341c1e){var _0x1ce307=typeof _0x515c16[_0xde10('0x25')]===_0xde10('0x26')&&typeof _0x515c16['limit']==='undefined';var _0x1370d9=_0x341c1e[_0xde10('0x27')];var _0x3cceba=_0x1ce307?0x0:_0x515c16[_0xde10('0x25')];var _0x1cd176=_0x1ce307?_0x341c1e[_0xde10('0x27')]:_0x515c16[_0xde10('0x25')]+_0x515c16[_0xde10('0x28')];var _0x502635;if(_0x1cd176>=_0x1370d9){_0x1cd176=_0x1370d9;_0x502635=0xc8;}else{_0x502635=0xce;}_0x321c1e[_0xde10('0x23')](_0x502635);return _0x321c1e[_0xde10('0x29')](_0xde10('0x2a'),_0x3cceba+'-'+_0x1cd176+'/'+_0x1370d9)[_0xde10('0x24')](_0x341c1e);}return null;};}function patchUpdates(_0x7a026d){return function(_0x41a61f){try{jsonpatch[_0xde10('0x2b')](_0x41a61f,_0x7a026d,!![]);}catch(_0x3c06d7){return BPromise[_0xde10('0x2c')](_0x3c06d7);}return _0x41a61f[_0xde10('0x2d')]();};}function saveUpdates(_0x298d38,_0x2fcef1){return function(_0x321132){if(_0x321132){return _0x321132[_0xde10('0x2e')](_0x298d38)[_0xde10('0x2f')](function(_0x367d26){return _0x367d26;});}return null;};}function removeEntity(_0x1e0373,_0x2a2f50){return function(_0x2fa1b6){if(_0x2fa1b6){return _0x2fa1b6[_0xde10('0x30')]()['then'](function(){var _0x15d704=_0x2fa1b6[_0xde10('0x31')]({'plain':!![]});var _0x3553f5='Plugins';return db[_0xde10('0x32')][_0xde10('0x30')]({'where':{'type':_0x3553f5,'resourceId':_0x15d704['id']}})[_0xde10('0x2f')](function(){return _0x2fa1b6;});})[_0xde10('0x2f')](function(){_0x1e0373[_0xde10('0x23')](0xcc)[_0xde10('0x33')]();});}};}function handleEntityNotFound(_0xdb7486,_0x3ea3de){return function(_0x40e9f1){if(!_0x40e9f1){_0xdb7486[_0xde10('0x22')](0x194);}return _0x40e9f1;};}function handleError(_0x9adcc6,_0x9e745f){_0x9e745f=_0x9e745f||0x1f4;return function(_0x54a4e5){logger[_0xde10('0x34')](_0x54a4e5[_0xde10('0x35')]);if(_0x54a4e5[_0xde10('0x36')]){delete _0x54a4e5['name'];}_0x9adcc6[_0xde10('0x23')](_0x9e745f)[_0xde10('0x37')](_0x54a4e5);};}exports[_0xde10('0x38')]=function(_0x22f271,_0x43e7bf){var _0x2aabd1={},_0x52ac7c={},_0x38bb4f={'count':0x0,'rows':[]};var _0x4b3133=_['map'](db['Plugin'][_0xde10('0x39')],function(_0x2f59e8){return{'name':_0x2f59e8[_0xde10('0x3a')],'type':_0x2f59e8['type'][_0xde10('0x3b')]};});_0x52ac7c[_0xde10('0x3c')]=_[_0xde10('0x3d')](_0x4b3133,'name');_0x52ac7c[_0xde10('0x3e')]=_[_0xde10('0x3f')](_0x22f271['query']);_0x52ac7c[_0xde10('0x40')]=_[_0xde10('0x41')](_0x52ac7c['model'],_0x52ac7c[_0xde10('0x3e')]);_0x2aabd1[_0xde10('0x42')]=_[_0xde10('0x41')](_0x52ac7c['model'],qs[_0xde10('0x43')](_0x22f271[_0xde10('0x3e')]['fields']));_0x2aabd1['attributes']=_0x2aabd1[_0xde10('0x42')][_0xde10('0x44')]?_0x2aabd1[_0xde10('0x42')]:_0x52ac7c[_0xde10('0x3c')];if(!_0x22f271[_0xde10('0x3e')][_0xde10('0x45')](_0xde10('0x46'))){_0x2aabd1[_0xde10('0x28')]=qs[_0xde10('0x28')](_0x22f271[_0xde10('0x3e')][_0xde10('0x28')]);_0x2aabd1[_0xde10('0x25')]=qs[_0xde10('0x25')](_0x22f271[_0xde10('0x3e')][_0xde10('0x25')]);}_0x2aabd1['order']=qs[_0xde10('0x47')](_0x22f271[_0xde10('0x3e')][_0xde10('0x47')]);_0x2aabd1['where']=qs[_0xde10('0x40')](_[_0xde10('0x48')](_0x22f271[_0xde10('0x3e')],_0x52ac7c[_0xde10('0x40')]),_0x4b3133);if(_0x22f271[_0xde10('0x3e')][_0xde10('0x49')]){_0x2aabd1[_0xde10('0x4a')]=_['merge'](_0x2aabd1[_0xde10('0x4a')],{'$or':_[_0xde10('0x3d')](_0x4b3133,function(_0x3f0590){if(_0x3f0590[_0xde10('0x4b')]!==_0xde10('0x4c')){var _0x5c07dd={};_0x5c07dd[_0x3f0590[_0xde10('0x36')]]={'$like':'%'+_0x22f271[_0xde10('0x3e')][_0xde10('0x49')]+'%'};return _0x5c07dd;}})});}_0x2aabd1=_[_0xde10('0x4d')]({},_0x2aabd1,_0x22f271[_0xde10('0x4e')]);var _0x390e6c={'where':_0x2aabd1[_0xde10('0x4a')]};return db['Plugin'][_0xde10('0x27')](_0x390e6c)[_0xde10('0x2f')](function(_0x330a73){_0x38bb4f[_0xde10('0x27')]=_0x330a73;if(_0x22f271[_0xde10('0x3e')]['includeAll']){_0x2aabd1['include']=[{'all':!![]}];}return db[_0xde10('0x4f')][_0xde10('0x50')](_0x2aabd1);})[_0xde10('0x2f')](function(_0x2be109){_0x38bb4f[_0xde10('0x51')]=_0x2be109;return _0x38bb4f;})[_0xde10('0x2f')](respondWithFilteredResult(_0x43e7bf,_0x2aabd1))[_0xde10('0x52')](handleError(_0x43e7bf,null));};exports[_0xde10('0x53')]=function(_0xb3711c,_0x83e0b4){var _0x1e09af={'raw':!![],'where':{'id':_0xb3711c['params']['id']}},_0x5b18e2={};_0x5b18e2[_0xde10('0x3c')]=_['keys'](db[_0xde10('0x4f')][_0xde10('0x39')]);_0x5b18e2['query']=_[_0xde10('0x3f')](_0xb3711c[_0xde10('0x3e')]);_0x5b18e2[_0xde10('0x40')]=_[_0xde10('0x41')](_0x5b18e2[_0xde10('0x3c')],_0x5b18e2['query']);_0x1e09af[_0xde10('0x42')]=_[_0xde10('0x41')](_0x5b18e2[_0xde10('0x3c')],qs[_0xde10('0x43')](_0xb3711c['query'][_0xde10('0x43')]));_0x1e09af[_0xde10('0x42')]=_0x1e09af[_0xde10('0x42')][_0xde10('0x44')]?_0x1e09af[_0xde10('0x42')]:_0x5b18e2[_0xde10('0x3c')];if(_0xb3711c[_0xde10('0x3e')][_0xde10('0x54')]){_0x1e09af[_0xde10('0x55')]=[{'all':!![]}];}_0x1e09af=_[_0xde10('0x4d')]({},_0x1e09af,_0xb3711c[_0xde10('0x4e')]);return db[_0xde10('0x4f')][_0xde10('0x56')](_0x1e09af)['then'](handleEntityNotFound(_0x83e0b4,null))[_0xde10('0x2f')](respondWithResult(_0x83e0b4,null))[_0xde10('0x52')](handleError(_0x83e0b4,null));};exports[_0xde10('0x57')]=function(_0x28807,_0x195d82,_0x3870fa){return db['Plugin'][_0xde10('0x56')]({'where':{'id':_0x28807[_0xde10('0x58')]['id']},'attributes':[_0xde10('0x36'),_0xde10('0x8')],'raw':!![]})[_0xde10('0x2f')](handleEntityNotFound(_0x195d82,null))['then'](function(_0x4b30fa){if(_0x4b30fa){var _0x2d4bdd=path[_0xde10('0x59')](config[_0xde10('0x5a')],'server/files/plugins',util[_0xde10('0x5b')](_0xde10('0x5c'),path['basename'](_0x4b30fa[_0xde10('0x8')])));var _0x287293=fs[_0xde10('0x5d')](_0x2d4bdd);var _0x181961=archiver(_0xde10('0x5e'),{'zlib':{'level':0x9}});_0x181961['on'](_0xde10('0x5f'),function(_0xf87705){if(_0xf87705[_0xde10('0x60')]===_0xde10('0x61')){logger['error'](_0xf87705);}else{throw new db[(_0xde10('0x62'))][(_0xde10('0x63'))](_0xde10('0x64'));}});_0x181961['on'](_0xde10('0x34'),function(_0x340d86){throw new db[(_0xde10('0x62'))][(_0xde10('0x63'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');});_0x181961['pipe'](_0x287293);_0x181961[_0xde10('0x65')](_0xde10('0x66'),{'cwd':path[_0xde10('0x59')](config[_0xde10('0x5a')],_0xde10('0x67'),path[_0xde10('0x68')](_0x4b30fa[_0xde10('0x8')])),'ignore':[path['join'](path[_0xde10('0x69')](_0x4b30fa['path']),'node_modules/**/*'),path[_0xde10('0x59')](path[_0xde10('0x69')](_0x4b30fa[_0xde10('0x8')]),_0xde10('0x6a'))],'nodir':!![]})[_0xde10('0x6b')]();_0x287293['on'](_0xde10('0x6c'),function(){if(!fs[_0xde10('0x6d')](_0x2d4bdd)){throw new db[(_0xde10('0x62'))][(_0xde10('0x63'))]('Plugin\x20not\x20found');}return _0x195d82['download'](_0x2d4bdd,util[_0xde10('0x5b')]('%s.zip',path[_0xde10('0x69')](_0x4b30fa[_0xde10('0x8')])),function(_0x3e5232){if(_0x3e5232){throw new db[(_0xde10('0x62'))][(_0xde10('0x63'))]('Error\x20while\x20downloading\x20the\x20plugin');}fs[_0xde10('0x6e')](_0x2d4bdd);logger[_0xde10('0x6f')]('Download\x20completed');logger['info'](_0xde10('0x70'));});});}return null;})[_0xde10('0x52')](handleError(_0x195d82,null));};exports['upload']=function(_0x293825,_0x78fbaf,_0x56249d){var _0xd201e4=path[_0xde10('0x69')](_0x293825['file']['filename'],path['extname'](_0x293825[_0xde10('0x71')][_0xde10('0x72')]));var _0x1c9f85=path['join'](config[_0xde10('0x5a')],'server/files/plugins',_0x293825[_0xde10('0x71')][_0xde10('0x72')]);var _0x565f2a=path[_0xde10('0x59')](config['root'],_0xde10('0x67'),_0xd201e4);logger[_0xde10('0x6f')](_0xde10('0x73'),_0x1c9f85);logger[_0xde10('0x6f')](_0xde10('0x74'),_0x565f2a);try{fs[_0xde10('0x75')](_0x1c9f85,parseInt('0777',0x8));extract(_0x1c9f85,{'dir':_0x565f2a},function(_0xc9d79f){if(_0xc9d79f){logger[_0xde10('0x34')](_0xc9d79f);handleError(_0xc9d79f,!![]);};var _0xa5348c=fs[_0xde10('0x76')](_0x565f2a);if(_0xa5348c[_0xde10('0x44')]>0x1){removeReferences(_0x1c9f85,_0x565f2a);logger[_0xde10('0x34')](_0xde10('0x77'));return _0x56249d(new Error(_0xde10('0x77')));}var _0xae45dd=fs[_0xde10('0x78')](path['join'](_0x565f2a,_0xa5348c[0x0]));if(_0xae45dd[_0xde10('0x79')]()){removeReferences(_0x1c9f85,_0x565f2a);logger[_0xde10('0x34')](_0xde10('0x77'));return _0x56249d(new Error(_0xde10('0x77')));}if(_0xae45dd[_0xde10('0x7a')]()){var _0x5089fb=fs[_0xde10('0x76')](path[_0xde10('0x59')](_0x565f2a,_0xa5348c[0x0]));if(_0x5089fb[_0xde10('0x44')]===0x0){removeReferences(_0x1c9f85,_0x565f2a);logger[_0xde10('0x34')](_0xde10('0x77'));return _0x56249d(new Error('Invalid\x20plugin\x20structure'));}var _0x39166e=_0x5089fb[_0xde10('0x7b')](function(_0x4ece3d){return _0x4ece3d===_0xde10('0x7c');});if(!_0x39166e){return _0x56249d(new Error(_0xde10('0x7d')));}var _0x592af9=fs['readFileSync'](path[_0xde10('0x59')](_0x565f2a,_0xa5348c[0x0],_0xde10('0x7c')));var _0x477b5e=JSON[_0xde10('0x7e')](_0x592af9);if('undefined'==typeof _0x477b5e[_0xde10('0x36')]){return _0x56249d(new Error(_0xde10('0x7f')));}if(_0xde10('0x26')==typeof _0x477b5e[_0xde10('0x4b')]){return _0x56249d(new Error(_0xde10('0x80')));}if('undefined'==typeof _0x477b5e[_0xde10('0x81')]){return _0x56249d(new Error(_0xde10('0x82')));}if('undefined'==typeof _0x477b5e[_0xde10('0x83')]){return _0x56249d(new Error(_0xde10('0x84')));}if(_0x477b5e[_0xde10('0x4b')]===_0xde10('0x85')){if(_0xde10('0x26')==typeof _0x477b5e[_0xde10('0x83')][_0xde10('0x86')]){return _0x56249d(new Error(_0xde10('0x87')));}if(_0xde10('0x26')==typeof _0x477b5e[_0xde10('0x83')]['views'][_0xde10('0x88')]&&_0xde10('0x26')==typeof _0x477b5e[_0xde10('0x83')][_0xde10('0x86')]['agent']){return _0x56249d(new Error('Invalid\x20manifest:\x20no\x20view\x20specified'));}}else if(_0x477b5e[_0xde10('0x4b')]===_0xde10('0x89')){if(_0xde10('0x26')==typeof _0x477b5e[_0xde10('0x83')][_0xde10('0x8a')]){return _0x56249d(new Error(_0xde10('0x8b')));}if(_0xde10('0x26')==typeof _0x477b5e[_0xde10('0x83')]['scriptPath']){return _0x56249d(new Error(_0xde10('0x8c')));}}else{return _0x56249d(new Error('Invalid\x20manifest:\x20invalid\x20type'));}var _0x24c8c2=_0x477b5e[_0xde10('0x36')];var _0x413396=_0x477b5e[_0xde10('0x8d')];var _0x21ece6=_0x477b5e['type'];var _0x25c166=_0x477b5e[_0xde10('0x8e')]?_0x477b5e[_0xde10('0x8e')]:_0xde10('0x8f');var _0x79b54c=_0x477b5e['icon']?_0x477b5e[_0xde10('0x90')]:_0xde10('0x91');var _0x1a5bab='';var _0x5d32a5='';var _0xc8a997='';var _0x1fb03e='';var _0x353bec=_0x477b5e[_0xde10('0x81')];if(_0x21ece6==='html'){if(_0xde10('0x26')!=typeof _0x477b5e[_0xde10('0x83')][_0xde10('0x86')]['admin']){var _0x4664f0=_0x477b5e['parameters'][_0xde10('0x86')][_0xde10('0x88')];if(!/^(f|ht)tps?:\/\//i[_0xde10('0x92')](_0x4664f0)){_0x1a5bab=path[_0xde10('0x59')](_0xde10('0x93'),_0xd201e4,_0xa5348c[0x0],_0x4664f0);}else{_0x1a5bab=_0x4664f0;}}else{logger[_0xde10('0x6f')](_0xde10('0x94'));}if('undefined'!=typeof _0x477b5e['parameters']['views']['agent']){var _0xc7a055=_0x477b5e['parameters'][_0xde10('0x86')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0xde10('0x92')](_0xc7a055)){_0x5d32a5=path['join']('plugins',_0xd201e4,_0xa5348c[0x0],_0xc7a055);}else{_0x5d32a5=_0xc7a055;}}else{logger[_0xde10('0x6f')](_0xde10('0x95'));}}else if(_0x21ece6===_0xde10('0x89')){_0xc8a997=_0x477b5e[_0xde10('0x83')][_0xde10('0x8a')];_0x1fb03e=_0x477b5e[_0xde10('0x83')]['scriptPath'];if(_0xde10('0x26')!=typeof _0x477b5e[_0xde10('0x83')][_0xde10('0x86')]){if(_0xde10('0x26')!=typeof _0x477b5e['parameters'][_0xde10('0x86')][_0xde10('0x88')]){var _0x4664f0=_0x477b5e[_0xde10('0x83')][_0xde10('0x86')][_0xde10('0x88')];if(!/^(f|ht)tps?:\/\//i[_0xde10('0x92')](_0x4664f0)){_0x1a5bab=path['join'](_0xde10('0x93'),_0xd201e4,_0xa5348c[0x0],_0x4664f0);}else{_0x1a5bab=_0x4664f0;}}if(_0xde10('0x26')!=typeof _0x477b5e[_0xde10('0x83')][_0xde10('0x86')][_0xde10('0x96')]){var _0xc7a055=_0x477b5e[_0xde10('0x83')]['views'][_0xde10('0x96')];if(!/^(f|ht)tps?:\/\//i[_0xde10('0x92')](_0xc7a055)){_0x5d32a5=path[_0xde10('0x59')](_0xde10('0x93'),_0xd201e4,_0xa5348c[0x0],_0xc7a055);}else{_0x5d32a5=_0xc7a055;}}}}var _0x20b13c={'name':_0x24c8c2,'description':_0x413396,'path':path[_0xde10('0x59')](_0xd201e4,_0xa5348c[0x0]),'type':_0x21ece6,'sidebar':_0x25c166,'icon':_0x79b54c,'adminUrl':_0x1a5bab,'agentUrl':_0x5d32a5,'scriptName':_0xc8a997,'scriptPath':_0x1fb03e,'version':_0x353bec};removeReferences(_0x1c9f85,null);return db[_0xde10('0x4f')]['create'](_0x20b13c)[_0xde10('0x2f')](function(_0x2f9d28){var _0xd5624d={'role':_0x293825[_0xde10('0x97')][_0xde10('0x98')],'userProfileId':_0x293825[_0xde10('0x97')][_0xde10('0x99')]};if(!_0xd5624d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xd5624d[_0xde10('0x98')]===_0xde10('0x9a')){var _0x382bde=_0x2f9d28['get']({'plain':!![]});return db[_0xde10('0x9b')][_0xde10('0x56')]({'where':{'name':_0xde10('0x9c'),'userProfileId':_0xd5624d[_0xde10('0x99')]},'raw':!![]})['then'](function(_0x504d9a){if(_0x504d9a&&_0x504d9a[_0xde10('0x9d')]===0x0){return db[_0xde10('0x32')][_0xde10('0x9e')]({'name':_0x382bde[_0xde10('0x36')],'resourceId':_0x382bde['id'],'type':_0x504d9a[_0xde10('0x36')],'sectionId':_0x504d9a['id']},{})[_0xde10('0x2f')](function(){return _0x2f9d28;});}else{return _0x2f9d28;}})[_0xde10('0x52')](function(_0x55f579){logger[_0xde10('0x34')](_0xde10('0x9f'),_0x55f579);throw _0x55f579;});}return _0x2f9d28;})[_0xde10('0x2f')](respondWithResult(_0x78fbaf,null))[_0xde10('0x52')](handleError(_0x78fbaf,null));}});}catch(_0x100667){_0x78fbaf['status'](0x1f4)[_0xde10('0x37')](_0x100667);}};function removeReferences(_0x41869e,_0x42f4dd){try{if(_0x41869e){fs[_0xde10('0x6e')](_0x41869e);logger[_0xde10('0x6f')](_0xde10('0xa0'));}if(_0x42f4dd){rimraf(_0x42f4dd,function(){});logger[_0xde10('0x6f')](_0xde10('0xa1'));}}catch(_0x1a01d4){logger[_0xde10('0x34')](_0x1a01d4);}}exports[_0xde10('0x2e')]=function(_0x451bc0,_0x377e78,_0x3795ff){return db['Plugin'][_0xde10('0x56')]({'where':{'id':_0x451bc0['params']['id']}})[_0xde10('0x2f')](handleEntityNotFound(_0x377e78,null))[_0xde10('0x2f')](saveUpdates(_0x451bc0[_0xde10('0x97')],null))[_0xde10('0x2f')](respondWithResult(_0x377e78,null))[_0xde10('0x52')](handleError(_0x377e78,null));};exports['delete']=function(_0x254338,_0x4c8442,_0x569106){return db[_0xde10('0x4f')][_0xde10('0x56')]({'where':{'id':_0x254338[_0xde10('0x58')]['id']}})[_0xde10('0x2f')](function(_0x857052){if(_0x857052){return _0x857052[_0xde10('0x30')]();}})[_0xde10('0x2f')](function(_0x4966e0){rimraf(path['join'](config[_0xde10('0x5a')],_0xde10('0x67'),path[_0xde10('0x68')](_0x4966e0[_0xde10('0x8')])),function(){});return _0x4966e0;})['then'](handleEntityNotFound(_0x4c8442,null))[_0xde10('0x2f')](respondWithStatusCode(_0x4c8442,null))[_0xde10('0x52')](handleError(_0x4c8442,null));};exports[_0xde10('0xa2')]=function(_0x108df6,_0xd8e1da,_0x2fcdd7){return BPromise['resolve']()['then'](function(){if(!_0x108df6[_0xde10('0x3e')][_0xde10('0x8')]){throw new Error(_0xde10('0xa3'));}if(!_0x108df6['query'][_0xde10('0xa4')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x25ce77=_0x108df6['query']['hostname']?_0x108df6[_0xde10('0x3e')]['hostname']+':'+_0x108df6[_0xde10('0x3e')][_0xde10('0xa4')]:_0xde10('0xa5')+_0x108df6['query'][_0xde10('0xa4')];var _0x11c437=_0x108df6['query'][_0xde10('0x24')]?_0x108df6[_0xde10('0x3e')][_0xde10('0x24')]:!![];var _0x23bdb7=_0x108df6[_0xde10('0x3e')][_0xde10('0xa6')]?_0x108df6[_0xde10('0x3e')][_0xde10('0xa6')]:null;var _0xd0ef22={'method':_0x108df6[_0xde10('0xa7')],'uri':util[_0xde10('0x5b')]('%s%s',_0x25ce77,_0x108df6[_0xde10('0x3e')][_0xde10('0x8')]),'json':_0x11c437,'resolveWithFullResponse':!![],'encoding':_0x23bdb7,'qs':_0x108df6['query']};if(_0x108df6['headers']){_0xd0ef22[_0xde10('0xa8')]=_0x108df6['headers'];if(_0xd0ef22['headers'][_0xde10('0xa9')]){delete _0xd0ef22[_0xde10('0xa8')][_0xde10('0xa9')];}}if(_0xd0ef22[_0xde10('0xa8')][_0xde10('0xaa')]){delete _0xd0ef22[_0xde10('0xa8')][_0xde10('0xaa')];}return rp(_0xd0ef22);})[_0xde10('0x2f')](function(_0x206f91){if(_0x206f91){_0xd8e1da[_0xde10('0x29')](_0x206f91[_0xde10('0xa8')]);logger[_0xde10('0x6f')](_0x206f91[_0xde10('0x97')]);if(_[_0xde10('0xab')](_0x108df6['query'][_0xde10('0x8')],_0xde10('0x57'))&&_0x206f91[_0xde10('0xac')]==0x1f4){return _0xd8e1da[_0xde10('0x22')](_0x206f91[_0xde10('0xac')]);}else{return _0xd8e1da[_0xde10('0x23')](_0x206f91[_0xde10('0xac')])[_0xde10('0x37')](_0x206f91[_0xde10('0x97')]);}}else{return _0xd8e1da['sendStatus'](0xc8);}})[_0xde10('0x52')](handleError(_0xd8e1da,null));};exports[_0xde10('0xad')]=function(_0x8f2774,_0x20c9ee,_0x367501){return BPromise[_0xde10('0xae')]()[_0xde10('0x2f')](function(){if(!_0x8f2774[_0xde10('0x3e')]['path']){throw new Error(_0xde10('0xa3'));}if(!_0x8f2774['query'][_0xde10('0xa4')]){throw new Error(_0xde10('0xaf'));}var _0x34fa71=_0x8f2774[_0xde10('0x3e')][_0xde10('0xb0')]?_0x8f2774['query'][_0xde10('0xb0')]+':'+_0x8f2774['query']['port']:_0xde10('0xa5')+_0x8f2774['query'][_0xde10('0xa4')];var _0x363c3e=_0x8f2774[_0xde10('0x3e')][_0xde10('0x24')]?_0x8f2774[_0xde10('0x3e')][_0xde10('0x24')]:!![];var _0x4605a7=_0x8f2774[_0xde10('0x3e')]['encoding']?_0x8f2774[_0xde10('0x3e')][_0xde10('0xa6')]:null;var _0x388e9={'method':_0x8f2774['method'],'uri':util['format']('%s%s',_0x34fa71,_0x8f2774[_0xde10('0x3e')][_0xde10('0x8')]),'json':_0x363c3e,'resolveWithFullResponse':!![],'encoding':_0x4605a7,'body':_0x8f2774[_0xde10('0x97')]};if(_0x8f2774[_0xde10('0xa8')]){_0x388e9[_0xde10('0xa8')]=_0x8f2774[_0xde10('0xa8')];if(_0x388e9[_0xde10('0xa8')][_0xde10('0xa9')]){delete _0x388e9[_0xde10('0xa8')][_0xde10('0xa9')];}}if(_0x388e9[_0xde10('0xa8')][_0xde10('0xaa')]){delete _0x388e9['headers'][_0xde10('0xaa')];}return rp(_0x388e9);})[_0xde10('0x2f')](function(_0x37ff27){if(_0x37ff27){_0x20c9ee[_0xde10('0x29')](_0x37ff27[_0xde10('0xa8')]);logger[_0xde10('0x6f')](_0x37ff27[_0xde10('0x97')]);return _0x20c9ee[_0xde10('0x23')](_0x37ff27['statusCode'])[_0xde10('0x37')](_0x37ff27[_0xde10('0x97')]);}else{return _0x20c9ee['sendStatus'](0xc8);}})[_0xde10('0x52')](handleError(_0x20c9ee,null));}; \ No newline at end of file +var _0x53cf=['format','headers','content-length','content-type','set','endsWith','statusCode','webhookPost','\x27PATH\x27\x20parameter\x20not\x20specified','method','%s%s','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','extract-zip','archiver','ioredis','../../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','./plugin.socket','register','sendStatus','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy','get','Plugins','UserProfileResource','error','stack','name','send','Plugin','rawAttributes','fieldName','type','model','map','query','keys','attributes','fields','hasOwnProperty','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','params','intersection','length','include','find','download','%s.zip','basename','createWriteStream','code','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','**/*','join','root','dirname','node_modules/**/*','attachments/**/*','finalize','close','Plugin\x20not\x20found','Error\x20while\x20downloading\x20the\x20plugin','info','Download\x20completed','Temporary\x20file\x20removed','upload','file','extname','server/files/plugins','Plugin\x20upload\x20destination:\x20%s','chmodSync','readdirSync','Invalid\x20plugin\x20structure','lstatSync','some','readFileSync','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','views','Invalid\x20manifest:\x20views\x20missing','agent','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','icon-apps','version','html','admin','test','plugins','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','unlinkSync','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','webhookGet','resolve','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','port','encoding'];(function(_0x389fb5,_0x2d34e1){var _0x37731a=function(_0x23bfde){while(--_0x23bfde){_0x389fb5['push'](_0x389fb5['shift']());}};_0x37731a(++_0x2d34e1);}(_0x53cf,0x167));var _0xf53c=function(_0x5985b8,_0x3aa9b7){_0x5985b8=_0x5985b8-0x0;var _0x19c894=_0x53cf[_0x5985b8];return _0x19c894;};'use strict';var emlformat=require(_0xf53c('0x0'));var rimraf=require(_0xf53c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xf53c('0x2'));var moment=require(_0xf53c('0x3'));var BPromise=require(_0xf53c('0x4'));var Mustache=require(_0xf53c('0x5'));var util=require(_0xf53c('0x6'));var path=require(_0xf53c('0x7'));var sox=require(_0xf53c('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf53c('0x9'));var _=require(_0xf53c('0xa'));var squel=require('squel');var crypto=require(_0xf53c('0xb'));var jsforce=require(_0xf53c('0xc'));var deskjs=require(_0xf53c('0xd'));var toCsv=require(_0xf53c('0xe'));var querystring=require(_0xf53c('0xf'));var Papa=require(_0xf53c('0x10'));var extract=require(_0xf53c('0x11'));var rimraf=require(_0xf53c('0x1'));var archiver=require(_0xf53c('0x12'));var Redis=require(_0xf53c('0x13'));var authService=require(_0xf53c('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xf53c('0x15'));var hardwareService=require(_0xf53c('0x16'));var logger=require(_0xf53c('0x17'))(_0xf53c('0x18'));var utils=require(_0xf53c('0x19'));var config=require(_0xf53c('0x1a'));var licenseUtil=require(_0xf53c('0x1b'));var db=require('../../mysqldb')['db'];config[_0xf53c('0x1c')]=_[_0xf53c('0x1d')](config[_0xf53c('0x1c')],{'host':_0xf53c('0x1e'),'port':0x18eb});var socket=require(_0xf53c('0x1f'))(new Redis(config[_0xf53c('0x1c')]));require(_0xf53c('0x20'))[_0xf53c('0x21')](socket);function respondWithStatusCode(_0x2028d1,_0x318868){_0x318868=_0x318868||0xcc;return function(_0x3065db){if(_0x3065db){return _0x2028d1[_0xf53c('0x22')](_0x318868);}return _0x2028d1[_0xf53c('0x23')](_0x318868)['end']();};}function respondWithResult(_0x1927d7,_0x35d221){_0x35d221=_0x35d221||0xc8;return function(_0xc0e742){if(_0xc0e742){return _0x1927d7[_0xf53c('0x23')](_0x35d221)[_0xf53c('0x24')](_0xc0e742);}};}function respondWithFilteredResult(_0x1738cc,_0x9c0f50){return function(_0x9af0ed){if(_0x9af0ed){var _0x24349d=typeof _0x9c0f50[_0xf53c('0x25')]===_0xf53c('0x26')&&typeof _0x9c0f50['limit']===_0xf53c('0x26');var _0x2fba42=_0x9af0ed[_0xf53c('0x27')];var _0x32a007=_0x24349d?0x0:_0x9c0f50['offset'];var _0x4043a4=_0x24349d?_0x9af0ed['count']:_0x9c0f50['offset']+_0x9c0f50[_0xf53c('0x28')];var _0x5a4947;if(_0x4043a4>=_0x2fba42){_0x4043a4=_0x2fba42;_0x5a4947=0xc8;}else{_0x5a4947=0xce;}_0x1738cc[_0xf53c('0x23')](_0x5a4947);return _0x1738cc['set'](_0xf53c('0x29'),_0x32a007+'-'+_0x4043a4+'/'+_0x2fba42)['json'](_0x9af0ed);}return null;};}function patchUpdates(_0x5d3edc){return function(_0x3e3976){try{jsonpatch[_0xf53c('0x2a')](_0x3e3976,_0x5d3edc,!![]);}catch(_0x3a01ff){return BPromise[_0xf53c('0x2b')](_0x3a01ff);}return _0x3e3976[_0xf53c('0x2c')]();};}function saveUpdates(_0x2b447a,_0x5bdf8b){return function(_0x311683){if(_0x311683){return _0x311683[_0xf53c('0x2d')](_0x2b447a)[_0xf53c('0x2e')](function(_0x41829b){return _0x41829b;});}return null;};}function removeEntity(_0x2b7543,_0x3f97dd){return function(_0xa7b0a7){if(_0xa7b0a7){return _0xa7b0a7[_0xf53c('0x2f')]()[_0xf53c('0x2e')](function(){var _0x2a8acb=_0xa7b0a7[_0xf53c('0x30')]({'plain':!![]});var _0x2e2078=_0xf53c('0x31');return db[_0xf53c('0x32')][_0xf53c('0x2f')]({'where':{'type':_0x2e2078,'resourceId':_0x2a8acb['id']}})['then'](function(){return _0xa7b0a7;});})['then'](function(){_0x2b7543[_0xf53c('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x589ac7,_0x5cd3e8){return function(_0x226fa4){if(!_0x226fa4){_0x589ac7[_0xf53c('0x22')](0x194);}return _0x226fa4;};}function handleError(_0x260da1,_0xe06fe8){_0xe06fe8=_0xe06fe8||0x1f4;return function(_0x4fe563){logger[_0xf53c('0x33')](_0x4fe563[_0xf53c('0x34')]);if(_0x4fe563[_0xf53c('0x35')]){delete _0x4fe563[_0xf53c('0x35')];}_0x260da1[_0xf53c('0x23')](_0xe06fe8)[_0xf53c('0x36')](_0x4fe563);};}exports['index']=function(_0x571fb0,_0x2f42f1){var _0x240a73={},_0x3ae5a9={},_0xb02a71={'count':0x0,'rows':[]};var _0x6dc7c5=_['map'](db[_0xf53c('0x37')][_0xf53c('0x38')],function(_0x427c88){return{'name':_0x427c88[_0xf53c('0x39')],'type':_0x427c88[_0xf53c('0x3a')]['key']};});_0x3ae5a9[_0xf53c('0x3b')]=_[_0xf53c('0x3c')](_0x6dc7c5,'name');_0x3ae5a9[_0xf53c('0x3d')]=_[_0xf53c('0x3e')](_0x571fb0[_0xf53c('0x3d')]);_0x3ae5a9['filters']=_['intersection'](_0x3ae5a9[_0xf53c('0x3b')],_0x3ae5a9[_0xf53c('0x3d')]);_0x240a73[_0xf53c('0x3f')]=_['intersection'](_0x3ae5a9[_0xf53c('0x3b')],qs[_0xf53c('0x40')](_0x571fb0['query'][_0xf53c('0x40')]));_0x240a73[_0xf53c('0x3f')]=_0x240a73['attributes']['length']?_0x240a73[_0xf53c('0x3f')]:_0x3ae5a9[_0xf53c('0x3b')];if(!_0x571fb0[_0xf53c('0x3d')][_0xf53c('0x41')]('nolimit')){_0x240a73[_0xf53c('0x28')]=qs[_0xf53c('0x28')](_0x571fb0['query'][_0xf53c('0x28')]);_0x240a73[_0xf53c('0x25')]=qs['offset'](_0x571fb0[_0xf53c('0x3d')][_0xf53c('0x25')]);}_0x240a73[_0xf53c('0x42')]=qs[_0xf53c('0x43')](_0x571fb0[_0xf53c('0x3d')][_0xf53c('0x43')]);_0x240a73[_0xf53c('0x44')]=qs[_0xf53c('0x45')](_[_0xf53c('0x46')](_0x571fb0[_0xf53c('0x3d')],_0x3ae5a9[_0xf53c('0x45')]),_0x6dc7c5);if(_0x571fb0[_0xf53c('0x3d')][_0xf53c('0x47')]){_0x240a73[_0xf53c('0x44')]=_['merge'](_0x240a73[_0xf53c('0x44')],{'$or':_[_0xf53c('0x3c')](_0x6dc7c5,function(_0x1ce976){if(_0x1ce976[_0xf53c('0x3a')]!==_0xf53c('0x48')){var _0x2a1c1f={};_0x2a1c1f[_0x1ce976['name']]={'$like':'%'+_0x571fb0['query']['filter']+'%'};return _0x2a1c1f;}})});}_0x240a73=_[_0xf53c('0x49')]({},_0x240a73,_0x571fb0[_0xf53c('0x4a')]);var _0x5ec8de={'where':_0x240a73['where']};return db['Plugin'][_0xf53c('0x27')](_0x5ec8de)[_0xf53c('0x2e')](function(_0x4d2235){_0xb02a71[_0xf53c('0x27')]=_0x4d2235;if(_0x571fb0[_0xf53c('0x3d')][_0xf53c('0x4b')]){_0x240a73['include']=[{'all':!![]}];}return db[_0xf53c('0x37')][_0xf53c('0x4c')](_0x240a73);})[_0xf53c('0x2e')](function(_0x3ce02f){_0xb02a71[_0xf53c('0x4d')]=_0x3ce02f;return _0xb02a71;})[_0xf53c('0x2e')](respondWithFilteredResult(_0x2f42f1,_0x240a73))[_0xf53c('0x4e')](handleError(_0x2f42f1,null));};exports[_0xf53c('0x4f')]=function(_0x554e6b,_0x503e42){var _0x37c680={'raw':!![],'where':{'id':_0x554e6b[_0xf53c('0x50')]['id']}},_0x570414={};_0x570414[_0xf53c('0x3b')]=_['keys'](db[_0xf53c('0x37')][_0xf53c('0x38')]);_0x570414[_0xf53c('0x3d')]=_[_0xf53c('0x3e')](_0x554e6b['query']);_0x570414['filters']=_[_0xf53c('0x51')](_0x570414[_0xf53c('0x3b')],_0x570414[_0xf53c('0x3d')]);_0x37c680[_0xf53c('0x3f')]=_['intersection'](_0x570414[_0xf53c('0x3b')],qs['fields'](_0x554e6b[_0xf53c('0x3d')][_0xf53c('0x40')]));_0x37c680[_0xf53c('0x3f')]=_0x37c680[_0xf53c('0x3f')][_0xf53c('0x52')]?_0x37c680['attributes']:_0x570414[_0xf53c('0x3b')];if(_0x554e6b[_0xf53c('0x3d')][_0xf53c('0x4b')]){_0x37c680[_0xf53c('0x53')]=[{'all':!![]}];}_0x37c680=_[_0xf53c('0x49')]({},_0x37c680,_0x554e6b['options']);return db[_0xf53c('0x37')][_0xf53c('0x54')](_0x37c680)[_0xf53c('0x2e')](handleEntityNotFound(_0x503e42,null))['then'](respondWithResult(_0x503e42,null))[_0xf53c('0x4e')](handleError(_0x503e42,null));};exports[_0xf53c('0x55')]=function(_0x12dd33,_0xd5f343,_0x2af73a){return db[_0xf53c('0x37')]['find']({'where':{'id':_0x12dd33[_0xf53c('0x50')]['id']},'attributes':[_0xf53c('0x35'),_0xf53c('0x7')],'raw':!![]})[_0xf53c('0x2e')](handleEntityNotFound(_0xd5f343,null))['then'](function(_0x3f43c9){if(_0x3f43c9){var _0x26144f=path['join'](config['root'],'server/files/plugins',util['format'](_0xf53c('0x56'),path[_0xf53c('0x57')](_0x3f43c9[_0xf53c('0x7')])));var _0x3a71df=fs[_0xf53c('0x58')](_0x26144f);var _0x1caf3a=archiver('zip',{'zlib':{'level':0x9}});_0x1caf3a['on']('warning',function(_0x458196){if(_0x458196[_0xf53c('0x59')]===_0xf53c('0x5a')){logger[_0xf53c('0x33')](_0x458196);}else{throw new db[(_0xf53c('0x5b'))][(_0xf53c('0x5c'))](_0xf53c('0x5d'));}});_0x1caf3a['on'](_0xf53c('0x33'),function(_0x12f4a6){throw new db['Sequelize'][(_0xf53c('0x5c'))](_0xf53c('0x5d'));});_0x1caf3a[_0xf53c('0x5e')](_0x3a71df);_0x1caf3a[_0xf53c('0x5f')](_0xf53c('0x60'),{'cwd':path[_0xf53c('0x61')](config[_0xf53c('0x62')],'server/files/plugins',path[_0xf53c('0x63')](_0x3f43c9['path'])),'ignore':[path['join'](path[_0xf53c('0x57')](_0x3f43c9[_0xf53c('0x7')]),_0xf53c('0x64')),path[_0xf53c('0x61')](path[_0xf53c('0x57')](_0x3f43c9['path']),_0xf53c('0x65'))],'nodir':!![]})[_0xf53c('0x66')]();_0x3a71df['on'](_0xf53c('0x67'),function(){if(!fs['existsSync'](_0x26144f)){throw new db[(_0xf53c('0x5b'))][(_0xf53c('0x5c'))](_0xf53c('0x68'));}return _0xd5f343[_0xf53c('0x55')](_0x26144f,util['format'](_0xf53c('0x56'),path[_0xf53c('0x57')](_0x3f43c9['path'])),function(_0x46439b){if(_0x46439b){throw new db[(_0xf53c('0x5b'))][(_0xf53c('0x5c'))](_0xf53c('0x69'));}fs['unlinkSync'](_0x26144f);logger[_0xf53c('0x6a')](_0xf53c('0x6b'));logger[_0xf53c('0x6a')](_0xf53c('0x6c'));});});}return null;})[_0xf53c('0x4e')](handleError(_0xd5f343,null));};exports[_0xf53c('0x6d')]=function(_0x30a67d,_0x163f76,_0x4c2d4d){var _0x47c2cb=path[_0xf53c('0x57')](_0x30a67d[_0xf53c('0x6e')]['filename'],path[_0xf53c('0x6f')](_0x30a67d[_0xf53c('0x6e')]['filename']));var _0x2f2d77=path[_0xf53c('0x61')](config[_0xf53c('0x62')],_0xf53c('0x70'),_0x30a67d[_0xf53c('0x6e')]['filename']);var _0x489e80=path['join'](config[_0xf53c('0x62')],_0xf53c('0x70'),_0x47c2cb);logger[_0xf53c('0x6a')]('Plugin\x20upload\x20filepath:\x20%s',_0x2f2d77);logger[_0xf53c('0x6a')](_0xf53c('0x71'),_0x489e80);try{fs[_0xf53c('0x72')](_0x2f2d77,parseInt('0777',0x8));extract(_0x2f2d77,{'dir':_0x489e80},function(_0x1ac07c){if(_0x1ac07c){logger[_0xf53c('0x33')](_0x1ac07c);handleError(_0x1ac07c,!![]);};var _0x59b716=fs[_0xf53c('0x73')](_0x489e80);if(_0x59b716[_0xf53c('0x52')]>0x1){removeReferences(_0x2f2d77,_0x489e80);logger[_0xf53c('0x33')](_0xf53c('0x74'));return _0x4c2d4d(new Error(_0xf53c('0x74')));}var _0x299c9a=fs[_0xf53c('0x75')](path[_0xf53c('0x61')](_0x489e80,_0x59b716[0x0]));if(_0x299c9a['isFile']()){removeReferences(_0x2f2d77,_0x489e80);logger['error'](_0xf53c('0x74'));return _0x4c2d4d(new Error(_0xf53c('0x74')));}if(_0x299c9a['isDirectory']()){var _0xf1f5d0=fs[_0xf53c('0x73')](path['join'](_0x489e80,_0x59b716[0x0]));if(_0xf1f5d0[_0xf53c('0x52')]===0x0){removeReferences(_0x2f2d77,_0x489e80);logger[_0xf53c('0x33')]('Invalid\x20plugin\x20structure');return _0x4c2d4d(new Error(_0xf53c('0x74')));}var _0x112fe3=_0xf1f5d0[_0xf53c('0x76')](function(_0x50c39c){return _0x50c39c==='manifest.json';});if(!_0x112fe3){return _0x4c2d4d(new Error('Plugin\x20manifest\x20missing'));}var _0x476f3b=fs[_0xf53c('0x77')](path[_0xf53c('0x61')](_0x489e80,_0x59b716[0x0],'manifest.json'));var _0x3e9736=JSON[_0xf53c('0x78')](_0x476f3b);if(_0xf53c('0x26')==typeof _0x3e9736['name']){return _0x4c2d4d(new Error(_0xf53c('0x79')));}if(_0xf53c('0x26')==typeof _0x3e9736['type']){return _0x4c2d4d(new Error(_0xf53c('0x7a')));}if('undefined'==typeof _0x3e9736['version']){return _0x4c2d4d(new Error(_0xf53c('0x7b')));}if(_0xf53c('0x26')==typeof _0x3e9736[_0xf53c('0x7c')]){return _0x4c2d4d(new Error('Invalid\x20manifest:\x20parameters\x20missing'));}if(_0x3e9736['type']==='html'){if(_0xf53c('0x26')==typeof _0x3e9736[_0xf53c('0x7c')][_0xf53c('0x7d')]){return _0x4c2d4d(new Error(_0xf53c('0x7e')));}if('undefined'==typeof _0x3e9736['parameters'][_0xf53c('0x7d')]['admin']&&_0xf53c('0x26')==typeof _0x3e9736[_0xf53c('0x7c')]['views'][_0xf53c('0x7f')]){return _0x4c2d4d(new Error('Invalid\x20manifest:\x20no\x20view\x20specified'));}}else if(_0x3e9736[_0xf53c('0x3a')]===_0xf53c('0x80')){if(_0xf53c('0x26')==typeof _0x3e9736['parameters'][_0xf53c('0x81')]){return _0x4c2d4d(new Error(_0xf53c('0x82')));}if(_0xf53c('0x26')==typeof _0x3e9736[_0xf53c('0x7c')][_0xf53c('0x83')]){return _0x4c2d4d(new Error(_0xf53c('0x84')));}}else{return _0x4c2d4d(new Error(_0xf53c('0x85')));}var _0x45ac7d=_0x3e9736['name'];var _0x3a2d70=_0x3e9736[_0xf53c('0x86')];var _0x3df10f=_0x3e9736[_0xf53c('0x3a')];var _0x1af228=_0x3e9736[_0xf53c('0x87')]?_0x3e9736[_0xf53c('0x87')]:_0xf53c('0x88');var _0x500bfa=_0x3e9736[_0xf53c('0x89')]?_0x3e9736[_0xf53c('0x89')]:_0xf53c('0x8a');var _0x22bee3='';var _0xe6fc8b='';var _0x5db3c8='';var _0x3b19b0='';var _0x4dff5e=_0x3e9736[_0xf53c('0x8b')];if(_0x3df10f===_0xf53c('0x8c')){if(_0xf53c('0x26')!=typeof _0x3e9736['parameters'][_0xf53c('0x7d')][_0xf53c('0x8d')]){var _0x387f4c=_0x3e9736['parameters'][_0xf53c('0x7d')]['admin'];if(!/^(f|ht)tps?:\/\//i[_0xf53c('0x8e')](_0x387f4c)){_0x22bee3=path[_0xf53c('0x61')]('plugins',_0x47c2cb,_0x59b716[0x0],_0x387f4c);}else{_0x22bee3=_0x387f4c;}}else{logger[_0xf53c('0x6a')]('Warning:\x20admin\x20view\x20not\x20specified');}if('undefined'!=typeof _0x3e9736[_0xf53c('0x7c')][_0xf53c('0x7d')][_0xf53c('0x7f')]){var _0x273735=_0x3e9736[_0xf53c('0x7c')]['views'][_0xf53c('0x7f')];if(!/^(f|ht)tps?:\/\//i[_0xf53c('0x8e')](_0x273735)){_0xe6fc8b=path[_0xf53c('0x61')](_0xf53c('0x8f'),_0x47c2cb,_0x59b716[0x0],_0x273735);}else{_0xe6fc8b=_0x273735;}}else{logger[_0xf53c('0x6a')]('Warning:\x20agent\x20view\x20not\x20specified');}}else if(_0x3df10f===_0xf53c('0x80')){_0x5db3c8=_0x3e9736[_0xf53c('0x7c')][_0xf53c('0x81')];_0x3b19b0=_0x3e9736['parameters']['scriptPath'];if(_0xf53c('0x26')!=typeof _0x3e9736[_0xf53c('0x7c')][_0xf53c('0x7d')]){if(_0xf53c('0x26')!=typeof _0x3e9736[_0xf53c('0x7c')][_0xf53c('0x7d')]['admin']){var _0x387f4c=_0x3e9736['parameters'][_0xf53c('0x7d')][_0xf53c('0x8d')];if(!/^(f|ht)tps?:\/\//i[_0xf53c('0x8e')](_0x387f4c)){_0x22bee3=path[_0xf53c('0x61')](_0xf53c('0x8f'),_0x47c2cb,_0x59b716[0x0],_0x387f4c);}else{_0x22bee3=_0x387f4c;}}if(_0xf53c('0x26')!=typeof _0x3e9736[_0xf53c('0x7c')][_0xf53c('0x7d')][_0xf53c('0x7f')]){var _0x273735=_0x3e9736[_0xf53c('0x7c')][_0xf53c('0x7d')][_0xf53c('0x7f')];if(!/^(f|ht)tps?:\/\//i[_0xf53c('0x8e')](_0x273735)){_0xe6fc8b=path[_0xf53c('0x61')](_0xf53c('0x8f'),_0x47c2cb,_0x59b716[0x0],_0x273735);}else{_0xe6fc8b=_0x273735;}}}}var _0x369117={'name':_0x45ac7d,'description':_0x3a2d70,'path':path[_0xf53c('0x61')](_0x47c2cb,_0x59b716[0x0]),'type':_0x3df10f,'sidebar':_0x1af228,'icon':_0x500bfa,'adminUrl':_0x22bee3,'agentUrl':_0xe6fc8b,'scriptName':_0x5db3c8,'scriptPath':_0x3b19b0,'version':_0x4dff5e};removeReferences(_0x2f2d77,null);return db[_0xf53c('0x37')]['create'](_0x369117)['then'](function(_0x3afcaa){var _0x4e6aea={'role':_0x30a67d[_0xf53c('0x90')]['role'],'userProfileId':_0x30a67d[_0xf53c('0x90')][_0xf53c('0x91')]};if(!_0x4e6aea)throw new Error(_0xf53c('0x92'));if(_0x4e6aea['role']===_0xf53c('0x93')){var _0xb67897=_0x3afcaa[_0xf53c('0x30')]({'plain':!![]});return db[_0xf53c('0x94')][_0xf53c('0x54')]({'where':{'name':_0xf53c('0x31'),'userProfileId':_0x4e6aea[_0xf53c('0x91')]},'raw':!![]})['then'](function(_0x4693e3){if(_0x4693e3&&_0x4693e3[_0xf53c('0x95')]===0x0){return db[_0xf53c('0x32')][_0xf53c('0x96')]({'name':_0xb67897['name'],'resourceId':_0xb67897['id'],'type':_0x4693e3[_0xf53c('0x35')],'sectionId':_0x4693e3['id']},{})[_0xf53c('0x2e')](function(){return _0x3afcaa;});}else{return _0x3afcaa;}})[_0xf53c('0x4e')](function(_0x48a233){logger[_0xf53c('0x33')](_0xf53c('0x97'),_0x48a233);throw _0x48a233;});}return _0x3afcaa;})[_0xf53c('0x2e')](respondWithResult(_0x163f76,null))[_0xf53c('0x4e')](handleError(_0x163f76,null));}});}catch(_0xbe19a8){_0x163f76['status'](0x1f4)[_0xf53c('0x36')](_0xbe19a8);}};function removeReferences(_0x57638f,_0x5680d4){try{if(_0x57638f){fs[_0xf53c('0x98')](_0x57638f);logger[_0xf53c('0x6a')](_0xf53c('0x99'));}if(_0x5680d4){rimraf(_0x5680d4,function(){});logger[_0xf53c('0x6a')](_0xf53c('0x9a'));}}catch(_0x41159c){logger[_0xf53c('0x33')](_0x41159c);}}exports[_0xf53c('0x2d')]=function(_0x33a3e3,_0x3e75a8,_0x2760d1){return db[_0xf53c('0x37')][_0xf53c('0x54')]({'where':{'id':_0x33a3e3[_0xf53c('0x50')]['id']}})[_0xf53c('0x2e')](handleEntityNotFound(_0x3e75a8,null))['then'](saveUpdates(_0x33a3e3['body'],null))['then'](respondWithResult(_0x3e75a8,null))['catch'](handleError(_0x3e75a8,null));};exports[_0xf53c('0x9b')]=function(_0x251790,_0x27110d,_0x46bd9b){return db['Plugin']['find']({'where':{'id':_0x251790[_0xf53c('0x50')]['id']}})[_0xf53c('0x2e')](function(_0x191352){if(_0x191352){return _0x191352['destroy']();}})[_0xf53c('0x2e')](function(_0x1911eb){rimraf(path[_0xf53c('0x61')](config[_0xf53c('0x62')],'server/files/plugins',path[_0xf53c('0x63')](_0x1911eb['path'])),function(){});return _0x1911eb;})[_0xf53c('0x2e')](handleEntityNotFound(_0x27110d,null))[_0xf53c('0x2e')](respondWithStatusCode(_0x27110d,null))[_0xf53c('0x4e')](handleError(_0x27110d,null));};exports[_0xf53c('0x9c')]=function(_0x19b687,_0x21c0a1,_0x2141d8){return BPromise[_0xf53c('0x9d')]()[_0xf53c('0x2e')](function(){if(!_0x19b687[_0xf53c('0x3d')][_0xf53c('0x7')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x19b687[_0xf53c('0x3d')]['port']){throw new Error(_0xf53c('0x9e'));}var _0x3a34ca=_0x19b687[_0xf53c('0x3d')][_0xf53c('0x9f')]?_0x19b687['query'][_0xf53c('0x9f')]+':'+_0x19b687[_0xf53c('0x3d')]['port']:_0xf53c('0xa0')+_0x19b687['query'][_0xf53c('0xa1')];var _0x55695b=_0x19b687[_0xf53c('0x3d')][_0xf53c('0x24')]?_0x19b687[_0xf53c('0x3d')][_0xf53c('0x24')]:!![];var _0x188da2=_0x19b687[_0xf53c('0x3d')][_0xf53c('0xa2')]?_0x19b687[_0xf53c('0x3d')][_0xf53c('0xa2')]:null;var _0x38190e={'method':_0x19b687['method'],'uri':util[_0xf53c('0xa3')]('%s%s',_0x3a34ca,_0x19b687[_0xf53c('0x3d')][_0xf53c('0x7')]),'json':_0x55695b,'resolveWithFullResponse':!![],'encoding':_0x188da2,'qs':_0x19b687[_0xf53c('0x3d')]};if(_0x19b687['headers']){_0x38190e['headers']=_0x19b687[_0xf53c('0xa4')];if(_0x38190e[_0xf53c('0xa4')][_0xf53c('0xa5')]){delete _0x38190e[_0xf53c('0xa4')][_0xf53c('0xa5')];}}if(_0x38190e[_0xf53c('0xa4')]['content-type']){delete _0x38190e[_0xf53c('0xa4')][_0xf53c('0xa6')];}return rp(_0x38190e);})['then'](function(_0x620759){if(_0x620759){_0x21c0a1[_0xf53c('0xa7')](_0x620759[_0xf53c('0xa4')]);logger['info'](_0x620759[_0xf53c('0x90')]);if(_[_0xf53c('0xa8')](_0x19b687[_0xf53c('0x3d')]['path'],'download')&&_0x620759[_0xf53c('0xa9')]==0x1f4){return _0x21c0a1[_0xf53c('0x22')](_0x620759['statusCode']);}else{return _0x21c0a1['status'](_0x620759[_0xf53c('0xa9')])[_0xf53c('0x36')](_0x620759['body']);}}else{return _0x21c0a1[_0xf53c('0x22')](0xc8);}})[_0xf53c('0x4e')](handleError(_0x21c0a1,null));};exports[_0xf53c('0xaa')]=function(_0x155013,_0x5a6e30,_0x1ba72b){return BPromise[_0xf53c('0x9d')]()[_0xf53c('0x2e')](function(){if(!_0x155013[_0xf53c('0x3d')][_0xf53c('0x7')]){throw new Error(_0xf53c('0xab'));}if(!_0x155013[_0xf53c('0x3d')][_0xf53c('0xa1')]){throw new Error(_0xf53c('0x9e'));}var _0x4d6775=_0x155013[_0xf53c('0x3d')][_0xf53c('0x9f')]?_0x155013[_0xf53c('0x3d')]['hostname']+':'+_0x155013[_0xf53c('0x3d')][_0xf53c('0xa1')]:_0xf53c('0xa0')+_0x155013[_0xf53c('0x3d')]['port'];var _0x415113=_0x155013[_0xf53c('0x3d')][_0xf53c('0x24')]?_0x155013['query'][_0xf53c('0x24')]:!![];var _0x189647=_0x155013[_0xf53c('0x3d')][_0xf53c('0xa2')]?_0x155013[_0xf53c('0x3d')][_0xf53c('0xa2')]:null;var _0x5cf458={'method':_0x155013[_0xf53c('0xac')],'uri':util[_0xf53c('0xa3')](_0xf53c('0xad'),_0x4d6775,_0x155013['query'][_0xf53c('0x7')]),'json':_0x415113,'resolveWithFullResponse':!![],'encoding':_0x189647,'body':_0x155013[_0xf53c('0x90')]};if(_0x155013['headers']){_0x5cf458['headers']=_0x155013[_0xf53c('0xa4')];if(_0x5cf458['headers'][_0xf53c('0xa5')]){delete _0x5cf458[_0xf53c('0xa4')][_0xf53c('0xa5')];}}if(_0x5cf458[_0xf53c('0xa4')][_0xf53c('0xa6')]){delete _0x5cf458[_0xf53c('0xa4')]['content-type'];}return rp(_0x5cf458);})[_0xf53c('0x2e')](function(_0x116462){if(_0x116462){_0x5a6e30[_0xf53c('0xa7')](_0x116462[_0xf53c('0xa4')]);logger[_0xf53c('0x6a')](_0x116462[_0xf53c('0x90')]);return _0x5a6e30['status'](_0x116462[_0xf53c('0xa9')])[_0xf53c('0x36')](_0x116462[_0xf53c('0x90')]);}else{return _0x5a6e30['sendStatus'](0xc8);}})[_0xf53c('0x4e')](handleError(_0x5a6e30,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index 0c3ab38..6932f79 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 _0xf446=['setMaxListeners','update','hook','events','Plugin'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0xf446,0x1c0));var _0x6f44=function(_0xefd80e,_0x488ebd){_0xefd80e=_0xefd80e-0x0;var _0x48d2e8=_0xf446[_0xefd80e];return _0x48d2e8;};'use strict';var EventEmitter=require(_0x6f44('0x0'));var Plugin=require('../../mysqldb')['db'][_0x6f44('0x1')];var PluginEvents=new EventEmitter();PluginEvents[_0x6f44('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x6f44('0x3'),'afterDestroy':'remove'};function emitEvent(_0x13b43d){return function(_0x477db7,_0x5b59aa,_0x41bcac){PluginEvents['emit'](_0x13b43d+':'+_0x477db7['id'],_0x477db7);PluginEvents['emit'](_0x13b43d,_0x477db7);_0x41bcac(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Plugin[_0x6f44('0x4')](e,emitEvent(event));}}module['exports']=PluginEvents; \ No newline at end of file +var _0xae30=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','Plugin','save'];(function(_0x4103a6,_0x5bed97){var _0x1be2b3=function(_0x414f49){while(--_0x414f49){_0x4103a6['push'](_0x4103a6['shift']());}};_0x1be2b3(++_0x5bed97);}(_0xae30,0x10a));var _0x0ae3=function(_0x532b8b,_0x4d0cb0){_0x532b8b=_0x532b8b-0x0;var _0x3e2607=_0xae30[_0x532b8b];return _0x3e2607;};'use strict';var EventEmitter=require(_0x0ae3('0x0'));var Plugin=require(_0x0ae3('0x1'))['db'][_0x0ae3('0x2')];var PluginEvents=new EventEmitter();PluginEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x0ae3('0x3'),'afterUpdate':_0x0ae3('0x4'),'afterDestroy':_0x0ae3('0x5')};function emitEvent(_0x1e3bed){return function(_0x51f481,_0x23a7a1,_0xcf497c){PluginEvents[_0x0ae3('0x6')](_0x1e3bed+':'+_0x51f481['id'],_0x51f481);PluginEvents[_0x0ae3('0x6')](_0x1e3bed,_0x51f481);_0xcf497c(null);};}for(var e in events){if(events[_0x0ae3('0x7')](e)){var event=events[e];Plugin[_0x0ae3('0x8')](e,emitEvent(event));}}module[_0x0ae3('0x9')]=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index 85c5526..0850ce3 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 _0x4974=['api','moment','request-promise','path','../../config/environment','./plugin.attributes','exports','define','plugins','lodash','../../config/logger'];(function(_0x127778,_0x2547f0){var _0x473529=function(_0xe83d51){while(--_0xe83d51){_0x127778['push'](_0x127778['shift']());}};_0x473529(++_0x2547f0);}(_0x4974,0x127));var _0x4497=function(_0x165a48,_0x44bc9d){_0x165a48=_0x165a48-0x0;var _0x6f6735=_0x4974[_0x165a48];return _0x6f6735;};'use strict';var _=require(_0x4497('0x0'));var util=require('util');var logger=require(_0x4497('0x1'))(_0x4497('0x2'));var moment=require(_0x4497('0x3'));var BPromise=require('bluebird');var rp=require(_0x4497('0x4'));var fs=require('fs');var path=require(_0x4497('0x5'));var rimraf=require('rimraf');var config=require(_0x4497('0x6'));var attributes=require(_0x4497('0x7'));module[_0x4497('0x8')]=function(_0x4bc5e7,_0x16880a){return _0x4bc5e7[_0x4497('0x9')]('Plugin',attributes,{'tableName':_0x4497('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5957=['bluebird','request-promise','path','rimraf','../../config/environment','define','plugins','lodash','../../config/logger','api','moment'];(function(_0x393f7b,_0xcc1c3e){var _0x382665=function(_0x54cb02){while(--_0x54cb02){_0x393f7b['push'](_0x393f7b['shift']());}};_0x382665(++_0xcc1c3e);}(_0x5957,0x193));var _0x7595=function(_0x455e59,_0x55ca09){_0x455e59=_0x455e59-0x0;var _0x407c6a=_0x5957[_0x455e59];return _0x407c6a;};'use strict';var _=require(_0x7595('0x0'));var util=require('util');var logger=require(_0x7595('0x1'))(_0x7595('0x2'));var moment=require(_0x7595('0x3'));var BPromise=require(_0x7595('0x4'));var rp=require(_0x7595('0x5'));var fs=require('fs');var path=require(_0x7595('0x6'));var rimraf=require(_0x7595('0x7'));var config=require(_0x7595('0x8'));var attributes=require('./plugin.attributes');module['exports']=function(_0xb781b8,_0x21c600){return _0xb781b8[_0x7595('0x9')]('Plugin',attributes,{'tableName':_0x7595('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.rpc.js b/server/api/plugin/plugin.rpc.js index 64f89ee..8909f3d 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 _0xd751=['then','info','Plugin,\x20%s,\x20%s','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreatePlugin','Plugin','create','body','options','raw','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','socket.io-emitter','./plugin.socket','register'];(function(_0x43b3e5,_0x29bd76){var _0x9cbaa5=function(_0x497350){while(--_0x497350){_0x43b3e5['push'](_0x43b3e5['shift']());}};_0x9cbaa5(++_0x29bd76);}(_0xd751,0x13b));var _0x1d75=function(_0x17777a,_0x31b31d){_0x17777a=_0x17777a-0x0;var _0x2c89f6=_0xd751[_0x17777a];return _0x2c89f6;};'use strict';var _=require(_0x1d75('0x0'));var util=require('util');var moment=require(_0x1d75('0x1'));var BPromise=require(_0x1d75('0x2'));var rs=require(_0x1d75('0x3'));var fs=require('fs');var Redis=require(_0x1d75('0x4'));var db=require(_0x1d75('0x5'))['db'];var utils=require(_0x1d75('0x6'));var logger=require(_0x1d75('0x7'))(_0x1d75('0x8'));var config=require(_0x1d75('0x9'));var jayson=require(_0x1d75('0xa'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_['defaults'](config[_0x1d75('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x1d75('0xc'))(new Redis(config['redis']));require(_0x1d75('0xd'))[_0x1d75('0xe')](socket);function respondWithRpcPromise(_0x636bac,_0x113f10,_0xac1930){return new BPromise(function(_0x337a66,_0x187383){return client['request'](_0x636bac,_0xac1930)[_0x1d75('0xf')](function(_0x191f69){logger[_0x1d75('0x10')](_0x1d75('0x11'),_0x113f10,_0x1d75('0x12'));logger[_0x1d75('0x13')](_0x1d75('0x14'),_0x113f10,'request\x20sent',JSON[_0x1d75('0x15')](_0x191f69));if(_0x191f69[_0x1d75('0x16')]){if(_0x191f69[_0x1d75('0x16')][_0x1d75('0x17')]===0x1f4){logger[_0x1d75('0x16')](_0x1d75('0x11'),_0x113f10,_0x191f69[_0x1d75('0x16')]['message']);return _0x187383(_0x191f69['error']['message']);}logger[_0x1d75('0x16')](_0x1d75('0x11'),_0x113f10,_0x191f69[_0x1d75('0x16')]['message']);return _0x337a66(_0x191f69[_0x1d75('0x16')][_0x1d75('0x18')]);}else{logger[_0x1d75('0x10')](_0x1d75('0x11'),_0x113f10,'request\x20sent');_0x337a66(_0x191f69[_0x1d75('0x19')][_0x1d75('0x18')]);}})[_0x1d75('0x1a')](function(_0x458765){logger['error']('Plugin,\x20%s,\x20%s',_0x113f10,_0x458765);_0x187383(_0x458765);});});}exports[_0x1d75('0x1b')]=function(_0x5dc583){var _0x3e1b78=this;return new Promise(function(_0x259641,_0x10a86c){return db[_0x1d75('0x1c')][_0x1d75('0x1d')](_0x5dc583[_0x1d75('0x1e')],{'raw':_0x5dc583[_0x1d75('0x1f')]?_0x5dc583[_0x1d75('0x1f')][_0x1d75('0x20')]===undefined?!![]:![]:!![]})[_0x1d75('0xf')](function(_0x2afe93){logger['info']('CreatePlugin',_0x5dc583);logger[_0x1d75('0x13')](_0x1d75('0x1b'),_0x5dc583,JSON['stringify'](_0x2afe93));_0x259641(_0x2afe93);})[_0x1d75('0x1a')](function(_0x55e4c7){logger[_0x1d75('0x16')](_0x1d75('0x1b'),_0x55e4c7['message'],_0x5dc583);_0x10a86c(_0x3e1b78['error'](0x1f4,_0x55e4c7['message']));});});}; \ No newline at end of file +var _0xec41=['then','info','Plugin,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','CreatePlugin','Plugin','create','body','options','raw','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./plugin.socket','register','request'];(function(_0x101116,_0xe71b75){var _0x25d117=function(_0x37b252){while(--_0x37b252){_0x101116['push'](_0x101116['shift']());}};_0x25d117(++_0xe71b75);}(_0xec41,0x19c));var _0x1ec4=function(_0xd26a98,_0xefcf03){_0xd26a98=_0xd26a98-0x0;var _0x49be9f=_0xec41[_0xd26a98];return _0x49be9f;};'use strict';var _=require('lodash');var util=require(_0x1ec4('0x0'));var moment=require(_0x1ec4('0x1'));var BPromise=require('bluebird');var rs=require(_0x1ec4('0x2'));var fs=require('fs');var Redis=require(_0x1ec4('0x3'));var db=require(_0x1ec4('0x4'))['db'];var utils=require(_0x1ec4('0x5'));var logger=require(_0x1ec4('0x6'))('rpc');var config=require(_0x1ec4('0x7'));var jayson=require(_0x1ec4('0x8'));var client=jayson[_0x1ec4('0x9')][_0x1ec4('0xa')]({'port':0x232a});config[_0x1ec4('0xb')]=_[_0x1ec4('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x1ec4('0xd'))(new Redis(config[_0x1ec4('0xb')]));require(_0x1ec4('0xe'))[_0x1ec4('0xf')](socket);function respondWithRpcPromise(_0x44a816,_0x9ae73d,_0x4f3b42){return new BPromise(function(_0x3a8dbb,_0x33e107){return client[_0x1ec4('0x10')](_0x44a816,_0x4f3b42)[_0x1ec4('0x11')](function(_0x5974d9){logger[_0x1ec4('0x12')](_0x1ec4('0x13'),_0x9ae73d,_0x1ec4('0x14'));logger[_0x1ec4('0x15')]('Plugin,\x20%s,\x20%s,\x20%s',_0x9ae73d,_0x1ec4('0x14'),JSON['stringify'](_0x5974d9));if(_0x5974d9[_0x1ec4('0x16')]){if(_0x5974d9[_0x1ec4('0x16')][_0x1ec4('0x17')]===0x1f4){logger['error']('Plugin,\x20%s,\x20%s',_0x9ae73d,_0x5974d9[_0x1ec4('0x16')]['message']);return _0x33e107(_0x5974d9[_0x1ec4('0x16')][_0x1ec4('0x18')]);}logger[_0x1ec4('0x16')]('Plugin,\x20%s,\x20%s',_0x9ae73d,_0x5974d9[_0x1ec4('0x16')]['message']);return _0x3a8dbb(_0x5974d9[_0x1ec4('0x16')]['message']);}else{logger[_0x1ec4('0x12')](_0x1ec4('0x13'),_0x9ae73d,'request\x20sent');_0x3a8dbb(_0x5974d9[_0x1ec4('0x19')][_0x1ec4('0x18')]);}})[_0x1ec4('0x1a')](function(_0x14be54){logger[_0x1ec4('0x16')](_0x1ec4('0x13'),_0x9ae73d,_0x14be54);_0x33e107(_0x14be54);});});}exports[_0x1ec4('0x1b')]=function(_0x30e911){var _0x42fde1=this;return new Promise(function(_0x233113,_0xd75897){return db[_0x1ec4('0x1c')][_0x1ec4('0x1d')](_0x30e911[_0x1ec4('0x1e')],{'raw':_0x30e911[_0x1ec4('0x1f')]?_0x30e911['options'][_0x1ec4('0x20')]===undefined?!![]:![]:!![]})[_0x1ec4('0x11')](function(_0x366548){logger[_0x1ec4('0x12')]('CreatePlugin',_0x30e911);logger['debug'](_0x1ec4('0x1b'),_0x30e911,JSON['stringify'](_0x366548));_0x233113(_0x366548);})[_0x1ec4('0x1a')](function(_0x3aa704){logger[_0x1ec4('0x16')](_0x1ec4('0x1b'),_0x3aa704[_0x1ec4('0x18')],_0x30e911);_0xd75897(_0x42fde1[_0x1ec4('0x16')](0x1f4,_0x3aa704['message']));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index c28c422..dd3d76e 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 _0xe78c=['emit','removeListener','register','length','plugin:','./plugin.events','save','remove','update'];(function(_0x434743,_0x396d7f){var _0x48128e=function(_0x9e7fd7){while(--_0x9e7fd7){_0x434743['push'](_0x434743['shift']());}};_0x48128e(++_0x396d7f);}(_0xe78c,0xdd));var _0xce78=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xe78c[_0x57b54c];return _0x59cc19;};'use strict';var PluginEvents=require(_0xce78('0x0'));var events=[_0xce78('0x1'),_0xce78('0x2'),_0xce78('0x3')];function createListener(_0x204064,_0xb46ac6){return function(_0x4c07be){_0xb46ac6[_0xce78('0x4')](_0x204064,_0x4c07be);};}function removeListener(_0x156dca,_0x1bc7f1){return function(){PluginEvents[_0xce78('0x5')](_0x156dca,_0x1bc7f1);};}exports[_0xce78('0x6')]=function(_0x4c4799){for(var _0x3fbd72=0x0,_0xf60927=events[_0xce78('0x7')];_0x3fbd72<_0xf60927;_0x3fbd72++){var _0x39ef7b=events[_0x3fbd72];var _0x47c466=createListener(_0xce78('0x8')+_0x39ef7b,_0x4c4799);PluginEvents['on'](_0x39ef7b,_0x47c466);}}; \ No newline at end of file +var _0x4be5=['remove','emit','removeListener','length','plugin:','./plugin.events','save'];(function(_0x39c734,_0x2f3e06){var _0xb2a2f9=function(_0x502f3f){while(--_0x502f3f){_0x39c734['push'](_0x39c734['shift']());}};_0xb2a2f9(++_0x2f3e06);}(_0x4be5,0x7c));var _0x54be=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0x4be5[_0x5783f4];return _0x28e380;};'use strict';var PluginEvents=require(_0x54be('0x0'));var events=[_0x54be('0x1'),_0x54be('0x2'),'update'];function createListener(_0x468373,_0x2701f){return function(_0x54c8e4){_0x2701f[_0x54be('0x3')](_0x468373,_0x54c8e4);};}function removeListener(_0xe5809b,_0x26e03c){return function(){PluginEvents[_0x54be('0x4')](_0xe5809b,_0x26e03c);};}exports['register']=function(_0x548537){for(var _0x293b07=0x0,_0x3605b6=events[_0x54be('0x5')];_0x293b07<_0x3605b6;_0x293b07++){var _0x29071e=events[_0x293b07];var _0x2de0eb=createListener(_0x54be('0x6')+_0x29071e,_0x548537);PluginEvents['on'](_0x29071e,_0x2de0eb);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index 88aa984..bf2e506 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(_0x2117c5,_0x4c0e99){var _0x4a8746=function(_0x1b5a18){while(--_0x1b5a18){_0x2117c5['push'](_0x2117c5['shift']());}};_0x4a8746(++_0x4c0e99);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xa9e0[_0x4fc9e6];return _0x551d28;};'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(_0x431a0f,_0x4f4022){var _0xa8344e=function(_0x329c88){while(--_0x329c88){_0x431a0f['push'](_0x431a0f['shift']());}};_0xa8344e(++_0x4f4022);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0xa9e0[_0x2160a9];return _0xa88cf7;};'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 f552aaa..ab2a6b5 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 _0xcb91=['describe','create','body','../../files/plugins','cwd','chdir','dirname','dump','Missing\x20name\x20and/or\x20path','update','restart','stop','hasOwnProperty','params','Unknown\x20status','destroy','delete','Unknown\x20id','../../config/logger','api','path','child_process','bluebird','sendStatus','json','name','status','send','npm\x20install','info','list','then','reject','express','length','catch','show'];(function(_0x28ef79,_0x4f77e1){var _0x2d15ab=function(_0x311ccf){while(--_0x311ccf){_0x28ef79['push'](_0x28ef79['shift']());}};_0x2d15ab(++_0x4f77e1);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x3c4e4c,_0x36ff70){_0x3c4e4c=_0x3c4e4c-0x0;var _0x144a87=_0xcb91[_0x3c4e4c];return _0x144a87;};'use strict';var _=require('lodash');var pm2=require('../../config/pm2');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var path=require(_0x1cb9('0x2'));var exec=require(_0x1cb9('0x3'))['exec'];var BPromise=require(_0x1cb9('0x4'));function handleEntityNotFound(_0x2c17b8,_0x545a34){return function(_0x13d5fd){if(!_0x13d5fd){_0x2c17b8[_0x1cb9('0x5')](0x194);;}return _0x13d5fd;};}function respondWithResult(_0x53ffbd,_0x226b69){_0x226b69=_0x226b69||0xc8;return function(_0x3f7deb){if(_0x3f7deb){return _0x53ffbd['status'](_0x226b69)[_0x1cb9('0x6')](_0x3f7deb);}return null;};}function handleError(_0x12567c,_0x59d1be){_0x59d1be=_0x59d1be||0x1f4;return function(_0x3ae0f1){logger['error'](_0x3ae0f1['stack']);if(_0x3ae0f1[_0x1cb9('0x7')]){delete _0x3ae0f1[_0x1cb9('0x7')];}_0x12567c[_0x1cb9('0x8')](_0x59d1be)[_0x1cb9('0x9')](_0x3ae0f1);};}function execChildProcess(){return new BPromise(function(_0x2fc627,_0x50ce71){exec(_0x1cb9('0xa'),function(_0x44a6b4,_0x3af35f,_0x3fdd83){logger[_0x1cb9('0xb')](_0x3af35f);logger['info'](_0x3fdd83);if(_0x44a6b4){logger['error'](_0x44a6b4);return _0x50ce71(_0x44a6b4);}return _0x2fc627(_0x3af35f);});});}exports['index']=function(_0x358866,_0x282bc6){return pm2[_0x1cb9('0xc')]()[_0x1cb9('0xd')](function(_0x56884d){if(_0x56884d){var _0x397727=_[_0x1cb9('0xe')](_0x56884d,function(_0x1b3cd7){return _0x1b3cd7[_0x1cb9('0x7')]===_0x1cb9('0xf')||_0x1b3cd7['name']==='motion2';});return{'rows':_0x397727,'count':_0x397727[_0x1cb9('0x10')]};}return null;})[_0x1cb9('0xd')](respondWithResult(_0x282bc6,null))[_0x1cb9('0x11')](handleError(_0x282bc6,null));};exports[_0x1cb9('0x12')]=function(_0x3e21e0,_0xf22920){return pm2[_0x1cb9('0x13')](_0x3e21e0['params']['id'])['then'](respondWithResult(_0xf22920,null))[_0x1cb9('0xd')](handleEntityNotFound(_0xf22920,null))[_0x1cb9('0x11')](handleError(_0xf22920,null));};exports[_0x1cb9('0x14')]=function(_0x31481a,_0x280a84){if(_0x31481a[_0x1cb9('0x15')][_0x1cb9('0x7')]&&_0x31481a['body']['script']){var _0x1a5a72=path['join'](__dirname,_0x1cb9('0x16'),_0x31481a[_0x1cb9('0x15')]['script']);var _0x599275=process[_0x1cb9('0x17')]();process[_0x1cb9('0x18')](path[_0x1cb9('0x19')](_0x1a5a72));return execChildProcess()[_0x1cb9('0xd')](function(_0x45b8d3){process[_0x1cb9('0x18')](_0x599275);return pm2['start']({'name':_0x31481a['body'][_0x1cb9('0x7')],'script':_0x1a5a72});})['then'](function(_0x10a419){pm2[_0x1cb9('0x1a')]();return _0x10a419[0x0];})[_0x1cb9('0xd')](respondWithResult(_0x280a84,0xc9))[_0x1cb9('0x11')](handleError(_0x280a84,null));}else{return _0x280a84[_0x1cb9('0x8')](0x1f4)['send']({'message':_0x1cb9('0x1b')});}};exports[_0x1cb9('0x1c')]=function(_0x4c8d76,_0xd6891c){if(_0x4c8d76[_0x1cb9('0x15')]['id']){delete _0x4c8d76[_0x1cb9('0x15')]['id'];}var _0x1804fd={'online':_0x1cb9('0x1d'),'stopped':_0x1cb9('0x1e')};if(_0x1804fd[_0x1cb9('0x1f')](_0x4c8d76[_0x1cb9('0x15')][_0x1cb9('0x8')])){return pm2[_0x1804fd[_0x4c8d76[_0x1cb9('0x15')]['status']]](_0x4c8d76[_0x1cb9('0x20')]['id'])['then'](respondWithResult(_0xd6891c,0xc8))[_0x1cb9('0x11')](handleError(_0xd6891c,null));}else{return _0xd6891c['status'](0x1f4)[_0x1cb9('0x9')]({'message':_0x1cb9('0x21')});}};exports[_0x1cb9('0x22')]=function(_0x2038aa,_0x561d89){if(_0x2038aa[_0x1cb9('0x15')]['id']){delete _0x2038aa['body']['id'];}if(_0x2038aa[_0x1cb9('0x20')]['id']){return pm2[_0x1cb9('0x23')](_0x2038aa[_0x1cb9('0x20')]['id'])['then'](function(_0xae4c7a){pm2['dump']();return _0xae4c7a[0x0];})[_0x1cb9('0xd')](respondWithResult(_0x561d89,null))['catch'](handleError(_0x561d89,null));}else{return _0x561d89[_0x1cb9('0x8')](0x1f4)[_0x1cb9('0x9')]({'message':_0x1cb9('0x24')});}}; \ No newline at end of file +var _0xf45e=['name','send','npm\x20install','info','index','list','reject','express','motion2','length','then','catch','describe','params','create','body','script','join','../../files/plugins','chdir','start','update','hasOwnProperty','dump','Unknown\x20id','lodash','../../config/logger','path','child_process','exec','bluebird','sendStatus','status','json','error','stack'];(function(_0x23f578,_0x1694f6){var _0xf31dc1=function(_0x325f3e){while(--_0x325f3e){_0x23f578['push'](_0x23f578['shift']());}};_0xf31dc1(++_0x1694f6);}(_0xf45e,0x115));var _0xef45=function(_0x5ef32e,_0x307684){_0x5ef32e=_0x5ef32e-0x0;var _0x59b3dd=_0xf45e[_0x5ef32e];return _0x59b3dd;};'use strict';var _=require(_0xef45('0x0'));var pm2=require('../../config/pm2');var logger=require(_0xef45('0x1'))('api');var path=require(_0xef45('0x2'));var exec=require(_0xef45('0x3'))[_0xef45('0x4')];var BPromise=require(_0xef45('0x5'));function handleEntityNotFound(_0x37772f,_0x8b048c){return function(_0x3cd579){if(!_0x3cd579){_0x37772f[_0xef45('0x6')](0x194);;}return _0x3cd579;};}function respondWithResult(_0x338960,_0x315b84){_0x315b84=_0x315b84||0xc8;return function(_0x2f2e92){if(_0x2f2e92){return _0x338960[_0xef45('0x7')](_0x315b84)[_0xef45('0x8')](_0x2f2e92);}return null;};}function handleError(_0x1e0def,_0x268ef6){_0x268ef6=_0x268ef6||0x1f4;return function(_0x143523){logger[_0xef45('0x9')](_0x143523[_0xef45('0xa')]);if(_0x143523[_0xef45('0xb')]){delete _0x143523['name'];}_0x1e0def[_0xef45('0x7')](_0x268ef6)[_0xef45('0xc')](_0x143523);};}function execChildProcess(){return new BPromise(function(_0x46cfeb,_0x3fba8b){exec(_0xef45('0xd'),function(_0x2b429f,_0x48eaf3,_0x14d870){logger[_0xef45('0xe')](_0x48eaf3);logger[_0xef45('0xe')](_0x14d870);if(_0x2b429f){logger[_0xef45('0x9')](_0x2b429f);return _0x3fba8b(_0x2b429f);}return _0x46cfeb(_0x48eaf3);});});}exports[_0xef45('0xf')]=function(_0x4a6e5c,_0x5215fb){return pm2[_0xef45('0x10')]()['then'](function(_0x2ae89a){if(_0x2ae89a){var _0xb0fc43=_[_0xef45('0x11')](_0x2ae89a,function(_0x536e46){return _0x536e46['name']===_0xef45('0x12')||_0x536e46['name']===_0xef45('0x13');});return{'rows':_0xb0fc43,'count':_0xb0fc43[_0xef45('0x14')]};}return null;})[_0xef45('0x15')](respondWithResult(_0x5215fb,null))[_0xef45('0x16')](handleError(_0x5215fb,null));};exports['show']=function(_0x560b2f,_0x45ee70){return pm2[_0xef45('0x17')](_0x560b2f[_0xef45('0x18')]['id'])[_0xef45('0x15')](respondWithResult(_0x45ee70,null))['then'](handleEntityNotFound(_0x45ee70,null))['catch'](handleError(_0x45ee70,null));};exports[_0xef45('0x19')]=function(_0x20ef26,_0xba941b){if(_0x20ef26[_0xef45('0x1a')][_0xef45('0xb')]&&_0x20ef26[_0xef45('0x1a')][_0xef45('0x1b')]){var _0x4a6217=path[_0xef45('0x1c')](__dirname,_0xef45('0x1d'),_0x20ef26[_0xef45('0x1a')][_0xef45('0x1b')]);var _0x27322f=process['cwd']();process[_0xef45('0x1e')](path['dirname'](_0x4a6217));return execChildProcess()['then'](function(_0x7707a1){process[_0xef45('0x1e')](_0x27322f);return pm2[_0xef45('0x1f')]({'name':_0x20ef26[_0xef45('0x1a')][_0xef45('0xb')],'script':_0x4a6217});})[_0xef45('0x15')](function(_0x315777){pm2['dump']();return _0x315777[0x0];})[_0xef45('0x15')](respondWithResult(_0xba941b,0xc9))['catch'](handleError(_0xba941b,null));}else{return _0xba941b[_0xef45('0x7')](0x1f4)[_0xef45('0xc')]({'message':'Missing\x20name\x20and/or\x20path'});}};exports[_0xef45('0x20')]=function(_0x2c356d,_0x479e3c){if(_0x2c356d[_0xef45('0x1a')]['id']){delete _0x2c356d['body']['id'];}var _0x550e18={'online':'restart','stopped':'stop'};if(_0x550e18[_0xef45('0x21')](_0x2c356d[_0xef45('0x1a')][_0xef45('0x7')])){return pm2[_0x550e18[_0x2c356d[_0xef45('0x1a')]['status']]](_0x2c356d[_0xef45('0x18')]['id'])['then'](respondWithResult(_0x479e3c,0xc8))[_0xef45('0x16')](handleError(_0x479e3c,null));}else{return _0x479e3c['status'](0x1f4)[_0xef45('0xc')]({'message':'Unknown\x20status'});}};exports['destroy']=function(_0x14ce5a,_0x3e45de){if(_0x14ce5a[_0xef45('0x1a')]['id']){delete _0x14ce5a[_0xef45('0x1a')]['id'];}if(_0x14ce5a[_0xef45('0x18')]['id']){return pm2['delete'](_0x14ce5a['params']['id'])['then'](function(_0x164429){pm2[_0xef45('0x22')]();return _0x164429[0x0];})[_0xef45('0x15')](respondWithResult(_0x3e45de,null))[_0xef45('0x16')](handleError(_0x3e45de,null));}else{return _0x3e45de[_0xef45('0x7')](0x1f4)[_0xef45('0xc')]({'message':_0xef45('0x23')});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index 2e3ac5a..8dc7516 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 _0x6213=['../../components/auth/service','./realtime.controller','get','/agents','isAuthenticated','getAgents','/queues','exports','Router'];(function(_0x3c8071,_0x1495f9){var _0x1e0932=function(_0x101b9d){while(--_0x101b9d){_0x3c8071['push'](_0x3c8071['shift']());}};_0x1e0932(++_0x1495f9);}(_0x6213,0x179));var _0x3621=function(_0x47fbba,_0x579870){_0x47fbba=_0x47fbba-0x0;var _0x1d766e=_0x6213[_0x47fbba];return _0x1d766e;};'use strict';var express=require('express');var router=express[_0x3621('0x0')]();var auth=require(_0x3621('0x1'));var controller=require(_0x3621('0x2'));router[_0x3621('0x3')](_0x3621('0x4'),auth[_0x3621('0x5')](),controller[_0x3621('0x6')]);router[_0x3621('0x3')](_0x3621('0x7'),auth[_0x3621('0x5')](),controller['getQueues']);module[_0x3621('0x8')]=router; \ No newline at end of file +var _0x674c=['/agents','isAuthenticated','get','/queues','Router','../../components/auth/service','./realtime.controller'];(function(_0x26274a,_0x5a3826){var _0x450ce3=function(_0x3f3ff1){while(--_0x3f3ff1){_0x26274a['push'](_0x26274a['shift']());}};_0x450ce3(++_0x5a3826);}(_0x674c,0x1e7));var _0xc674=function(_0x3df0a0,_0x2e12b5){_0x3df0a0=_0x3df0a0-0x0;var _0x8b9c27=_0x674c[_0x3df0a0];return _0x8b9c27;};'use strict';var express=require('express');var router=express[_0xc674('0x0')]();var auth=require(_0xc674('0x1'));var controller=require(_0xc674('0x2'));router['get'](_0xc674('0x3'),auth[_0xc674('0x4')](),controller['getAgents']);router[_0xc674('0x5')](_0xc674('0x6'),auth['isAuthenticated'](),controller['getQueues']);module['exports']=router; \ No newline at end of file diff --git a/server/api/realtime/realtime.controller.js b/server/api/realtime/realtime.controller.js index e9f7d89..289b701 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 _0xa9e0=['pause','resolve','then','channel','isValidChannel','format','Channel\x20parameter\x20%s\x20is\x20invalid','toLowerCase','sort','includes','globalStatus','validateSortParameter','getUpdatedSortOptions','fields','join','order','getAgentIdsByQueues','rows','getSortedAgentsIdsByStatus','getAgentIdsByStatus','map','User','rawAttributes','fieldName','type','key','role','agent','getOptions','raw','push','literal','FIELD(id,','forEach','*pause','Pause','merge','user','userProfileId','Agents','extraQueryConditions','assign','getResources','findAndCountAll','filterAgentAttributes','voice','talking','voiceStatus','Status','sortAgentsByStatus','pick','catch','getQueues','startCase','Queue','name','outbound','Queues','filter','UserProfile','lodash','util','../../components/realtime/agents','../../config/utils','../../errors/api','APIBadRequestError','handleError','offset','undefined','count','limit','json','getAgents','getChannels','query','globalStatusFilter','pauseTypeFilter'];(function(_0x10791c,_0x48adef){var _0x19432c=function(_0x225b0f){while(--_0x225b0f){_0x10791c['push'](_0x10791c['shift']());}};_0x19432c(++_0x48adef);}(_0xa9e0,0x123));var _0x0a9e=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0xa9e0[_0x387777];return _0x3f84c0;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var rta=require(_0x0a9e('0x2'));var rtq=require('../../components/realtime/queues');var qs=require('../../components/parsers/qs');var utils=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var APIBadRequestError=require(_0x0a9e('0x4'))[_0x0a9e('0x5')];var APIHandleError=require(_0x0a9e('0x4'))[_0x0a9e('0x6')];function respondWithFilteredResult(_0x981158,_0x57b080){return function(_0x219af0){if(_0x219af0){var _0x441e3a=typeof _0x57b080[_0x0a9e('0x7')]==='undefined'&&typeof _0x57b080['limit']===_0x0a9e('0x8');var _0x56465b=_0x219af0['count'];var _0x39753a=_0x441e3a?0x0:_0x57b080[_0x0a9e('0x7')];var _0x307b3e=_0x441e3a?_0x219af0[_0x0a9e('0x9')]:_0x57b080[_0x0a9e('0x7')]+_0x57b080[_0x0a9e('0xa')];var _0x4a4c56;if(_0x307b3e>=_0x56465b){_0x307b3e=_0x56465b;_0x4a4c56=0xc8;}else{_0x4a4c56=0xce;}_0x981158['status'](_0x4a4c56);return _0x981158['set']('Content-Range',_0x39753a+'-'+_0x307b3e+'/'+_0x56465b)[_0x0a9e('0xb')](_0x219af0);}return null;};}exports[_0x0a9e('0xc')]=function(_0xd5b662,_0x26d672){var _0x32d742={'count':0x0,'rows':[]};var _0x69aeb7={};var _0x5db4b0;var _0x4283ce=utils[_0x0a9e('0xd')]();var _0x2b4227;var _0x281129;var _0x44dcfd=_0xd5b662[_0x0a9e('0xe')]['globalQueueFilter'];var _0x22dccb=_0xd5b662['query'][_0x0a9e('0xf')];var _0x519dfd=_0xd5b662[_0x0a9e('0xe')][_0x0a9e('0x10')];var _0x48f32d=_0x22dccb===_0x0a9e('0x11')||_0x22dccb==='*pause'?!![]:![];var _0x459eb1=[];var _0x478723;var _0x106033;Promise[_0x0a9e('0x12')]()[_0x0a9e('0x13')](function(){if(_0xd5b662[_0x0a9e('0xe')][_0x0a9e('0x14')]){if(!utils[_0x0a9e('0x15')](_0xd5b662[_0x0a9e('0xe')][_0x0a9e('0x14')])){throw new APIBadRequestError(util[_0x0a9e('0x16')](_0x0a9e('0x17'),_0xd5b662['query'][_0x0a9e('0x14')]));}_0x5db4b0=_0xd5b662[_0x0a9e('0xe')]['channel'][_0x0a9e('0x18')]();}if(!_0xd5b662['query']['sort']||!_0xd5b662[_0x0a9e('0xe')][_0x0a9e('0x19')][_0x0a9e('0x1a')](_0x0a9e('0x1b'))){_0xd5b662['query'][_0x0a9e('0x19')]=rta[_0x0a9e('0x1c')](_0xd5b662[_0x0a9e('0xe')][_0x0a9e('0x19')]);return;}var _0x370d86=rta[_0x0a9e('0x1d')](_0xd5b662[_0x0a9e('0xe')]['sort']);_0xd5b662['query'][_0x0a9e('0x19')]=_0x370d86[_0x0a9e('0x1e')][_0x0a9e('0x1f')](',');_0x478723=_0x370d86[_0x0a9e('0x20')];})['then'](function(){if(!_0x44dcfd){return[];}return rta[_0x0a9e('0x21')](_0x44dcfd,_0x5db4b0);})['then'](function(_0x45a1e7){_0x459eb1=_0x45a1e7;return rta['getRealtimeAgents']();})[_0x0a9e('0x13')](function(_0x34dc65){_0x281129=_0x34dc65[_0x0a9e('0x22')];if((!_0x22dccb||_0x48f32d)&&!_0x478723){return _0x459eb1;}if(_0x478723&&!_0x22dccb){return rta[_0x0a9e('0x23')](_0x281129,_0x459eb1,_0x478723);}else{return rta[_0x0a9e('0x24')](_0x281129,_0x459eb1,_0x22dccb);}})[_0x0a9e('0x13')](function(_0x11c3b6){_0x459eb1=_0x11c3b6;var _0x14de77=![];if(_0x459eb1['length']===0x0){if(_0x44dcfd||_0x22dccb){_0x14de77=!![];}if(_0x48f32d){_0x14de77=![];}}if(_0x14de77){return _0x32d742;}var _0x3652a7=_[_0x0a9e('0x25')](db[_0x0a9e('0x26')][_0x0a9e('0x27')],function(_0x5c877d){return{'name':_0x5c877d[_0x0a9e('0x28')],'type':_0x5c877d[_0x0a9e('0x29')][_0x0a9e('0x2a')]};});_0xd5b662[_0x0a9e('0xe')][_0x0a9e('0x2b')]=_0x0a9e('0x2c');_0x69aeb7=qs[_0x0a9e('0x2d')](_0x3652a7,_0xd5b662);_0x69aeb7[_0x0a9e('0x2e')]=!![];var _0x1dbde2=[];if(_0x459eb1['length']>0x0){_0x1dbde2[_0x0a9e('0x2f')]({'id':{'$in':_0x459eb1}});if(_0x478723&&!_0x22dccb){_0x106033=[db['sequelize'][_0x0a9e('0x30')](_0x0a9e('0x31')+_0x459eb1+')')];_0x69aeb7[_0x0a9e('0x20')]=_0x106033;}}if(_0x48f32d){_0x4283ce[_0x0a9e('0x32')](function(_0x25ce3a){var _0x5180f1=!![];if(_0x22dccb===_0x0a9e('0x33')&&_0x5db4b0!==_0x25ce3a){_0x5180f1=![];}_0x1dbde2[_0x0a9e('0x2f')]({[_0x25ce3a+_0x0a9e('0x34')]:_0x5180f1});});if(_0x519dfd){_0x1dbde2[_0x0a9e('0x2f')]({'pauseType':_0x519dfd});}}else if(_0x22dccb){_0x4283ce[_0x0a9e('0x32')](function(_0x409319){_0x1dbde2[_0x0a9e('0x2f')]({[_0x409319+_0x0a9e('0x34')]:![]});});}_0x69aeb7['where']=_[_0x0a9e('0x35')](_0x69aeb7['where'],{'$and':_0x1dbde2});if(_0xd5b662[_0x0a9e('0x36')][_0x0a9e('0x2b')]===_0x0a9e('0x36')){var _0x3f3d41={'params':{'id':_0xd5b662['user'][_0x0a9e('0x37')]},'query':{'section':_0x0a9e('0x38'),'role':_0x0a9e('0x2c'),'online':_0xd5b662[_0x0a9e('0xe')]['online']===!![]?!![]:![],'raw':!![],'ids':_0x459eb1,'customSorting':_0x106033}};if(_0x48f32d){_0x3f3d41['query'][_0x0a9e('0x39')]=_0x1dbde2;}_0x3f3d41['query']=Object[_0x0a9e('0x3a')](_0x3f3d41[_0x0a9e('0xe')],_0xd5b662[_0x0a9e('0xe')]);delete _0x3f3d41[_0x0a9e('0xe')]['id'];return db['UserProfile'][_0x0a9e('0x3b')](_0x3f3d41);}return db[_0x0a9e('0x26')][_0x0a9e('0x3c')](_0x69aeb7);})['then'](function(_0x1dbf74){_0x32d742[_0x0a9e('0x9')]=_0x1dbf74[_0x0a9e('0x9')];_0x2b4227=_0x1dbf74['rows'];return _0x2b4227['map'](function(_0x11b61d){var _0x40d766=_['find'](_0x281129,['id',_0x11b61d['id']]);if(_0x40d766){var _0x2b814e=rta[_0x0a9e('0x3d')](_0x40d766);_[_0x0a9e('0x35')](_0x11b61d,_0x2b814e);}_0x11b61d[_0x0a9e('0x1b')]=rta['getAgentStatus'](_0x11b61d);if(_0x11b61d['globalStatus'][_0x0a9e('0x1a')](_0x0a9e('0x11'))){_0x4283ce['forEach'](function(_0x183991){if(_0x11b61d[_0x183991+_0x0a9e('0x34')]){if(_0x183991===_0x0a9e('0x3e')){if(_0x11b61d['voiceStatus']!==_0x0a9e('0x3f')){_0x11b61d[_0x0a9e('0x40')]=_0x0a9e('0x11');}}else{_0x11b61d[_0x183991+_0x0a9e('0x41')]=_0x0a9e('0x11');}}});}return _0x11b61d;});})[_0x0a9e('0x13')](function(_0x2881b3){if(!_0x478723||_0x106033){return _0x2881b3;}return rta[_0x0a9e('0x42')](_0x2881b3,_0x478723);})[_0x0a9e('0x13')](function(_0x3da2cd){var _0x2c3711=null;if(_0xd5b662[_0x0a9e('0xe')][_0x0a9e('0x1e')]){var _0x11ca30=_0xd5b662[_0x0a9e('0xe')]['fields']['split'](',');_0x2c3711=_0x3da2cd[_0x0a9e('0x25')](function(_0xb3795a){return _[_0x0a9e('0x43')](_0xb3795a,_0x11ca30);});}_0x32d742[_0x0a9e('0x22')]=_0x2c3711||_0x3da2cd;return _0x32d742;})[_0x0a9e('0x13')](respondWithFilteredResult(_0x26d672,_0x69aeb7))[_0x0a9e('0x44')](APIHandleError(_0x26d672));};exports[_0x0a9e('0x45')]=function(_0x445e25,_0x432fcc){var _0x25c6e6={'count':0x0,'rows':[]};var _0x2c2cb0={};var _0x35ed4a;var _0x5026aa;var _0x117c99;Promise[_0x0a9e('0x12')]()[_0x0a9e('0x13')](function(){if(_0x445e25[_0x0a9e('0xe')][_0x0a9e('0x14')]){if(!utils[_0x0a9e('0x15')](_0x445e25[_0x0a9e('0xe')][_0x0a9e('0x14')])){throw new APIBadRequestError(util['format'](_0x0a9e('0x17'),_0x445e25['query'][_0x0a9e('0x14')]));}_0x35ed4a=_0x445e25[_0x0a9e('0xe')][_0x0a9e('0x14')]['toLowerCase']();}var _0x14bec2=_[_0x0a9e('0x46')](_0x35ed4a)+_0x0a9e('0x47');var _0x34aa5a=_[_0x0a9e('0x25')](db[_0x14bec2][_0x0a9e('0x27')],function(_0x45bf7f){return{'name':_0x45bf7f['fieldName'],'type':_0x45bf7f[_0x0a9e('0x29')][_0x0a9e('0x2a')]};});if(!_0x445e25[_0x0a9e('0xe')][_0x0a9e('0x1e')]){var _0x409789=['id',_0x0a9e('0x48')];if(_0x35ed4a===_0x0a9e('0x3e')){_0x409789[_0x0a9e('0x2f')](_0x0a9e('0x29'));if(_0x445e25['query'][_0x0a9e('0x29')]===_0x0a9e('0x49')){_0x409789['push'](['dialActive','dialMethod']);}}_0x445e25[_0x0a9e('0xe')][_0x0a9e('0x1e')]=_0x409789[_0x0a9e('0x1f')](',');}_0x2c2cb0=qs[_0x0a9e('0x2d')](_0x34aa5a,_0x445e25);if(_0x445e25[_0x0a9e('0x36')][_0x0a9e('0x2b')]===_0x0a9e('0x36')){var _0x375c18={'params':{'id':_0x445e25['user']['userProfileId']},'query':{'section':_0x35ed4a==='voice'&&_0x445e25[_0x0a9e('0xe')][_0x0a9e('0x29')]===_0x0a9e('0x49')?'QueueCampaigns':_[_0x0a9e('0x46')](_0x35ed4a)+_0x0a9e('0x4a'),'type':_0x445e25['query']['type'],'nolimit':!![],'sort':_0x0a9e('0x48'),'filter':_0x445e25['query'][_0x0a9e('0x4b')]}};_0x375c18['query']=Object[_0x0a9e('0x3a')](_0x375c18[_0x0a9e('0xe')],_0x445e25[_0x0a9e('0xe')]);delete _0x375c18['query']['id'];return db[_0x0a9e('0x4c')][_0x0a9e('0x3b')](_0x375c18);}return db[_0x14bec2]['findAndCountAll'](_0x2c2cb0);})['then'](function(_0x128aa6){_0x25c6e6[_0x0a9e('0x9')]=_0x128aa6['count'];_0x5026aa=_0x128aa6[_0x0a9e('0x22')];return rtq['getRealtimeQueues'](_0x445e25,_0x35ed4a);})[_0x0a9e('0x13')](function(_0x523cd2){_0x117c99=_0x523cd2[_0x0a9e('0x22')];return rtq['initializeQueues'](_0x5026aa,_0x117c99,_0x35ed4a,_0x445e25['query']['type']);})[_0x0a9e('0x13')](function(_0x47de4c){_0x25c6e6[_0x0a9e('0x22')]=_0x47de4c;return _0x25c6e6;})[_0x0a9e('0x13')](respondWithFilteredResult(_0x432fcc,_0x2c2cb0))[_0x0a9e('0x44')](APIHandleError(_0x432fcc));}; \ No newline at end of file +var _0xa9e0=['pause','resolve','then','channel','isValidChannel','format','Channel\x20parameter\x20%s\x20is\x20invalid','toLowerCase','sort','includes','globalStatus','validateSortParameter','getUpdatedSortOptions','fields','join','order','getAgentIdsByQueues','rows','getSortedAgentsIdsByStatus','getAgentIdsByStatus','map','User','rawAttributes','fieldName','type','key','role','agent','getOptions','raw','push','literal','FIELD(id,','forEach','*pause','Pause','merge','user','userProfileId','Agents','extraQueryConditions','assign','getResources','findAndCountAll','filterAgentAttributes','voice','talking','voiceStatus','Status','sortAgentsByStatus','pick','catch','getQueues','startCase','Queue','name','outbound','Queues','filter','UserProfile','lodash','util','../../components/realtime/agents','../../config/utils','../../errors/api','APIBadRequestError','handleError','offset','undefined','count','limit','json','getAgents','getChannels','query','globalStatusFilter','pauseTypeFilter'];(function(_0x4f09b9,_0x32ba8e){var _0x264056=function(_0x2b63e0){while(--_0x2b63e0){_0x4f09b9['push'](_0x4f09b9['shift']());}};_0x264056(++_0x32ba8e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xa9e0[_0x2b10c6];return _0x3789d2;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var rta=require(_0x0a9e('0x2'));var rtq=require('../../components/realtime/queues');var qs=require('../../components/parsers/qs');var utils=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var APIBadRequestError=require(_0x0a9e('0x4'))[_0x0a9e('0x5')];var APIHandleError=require(_0x0a9e('0x4'))[_0x0a9e('0x6')];function respondWithFilteredResult(_0x981158,_0x57b080){return function(_0x219af0){if(_0x219af0){var _0x441e3a=typeof _0x57b080[_0x0a9e('0x7')]==='undefined'&&typeof _0x57b080['limit']===_0x0a9e('0x8');var _0x56465b=_0x219af0['count'];var _0x39753a=_0x441e3a?0x0:_0x57b080[_0x0a9e('0x7')];var _0x307b3e=_0x441e3a?_0x219af0[_0x0a9e('0x9')]:_0x57b080[_0x0a9e('0x7')]+_0x57b080[_0x0a9e('0xa')];var _0x4a4c56;if(_0x307b3e>=_0x56465b){_0x307b3e=_0x56465b;_0x4a4c56=0xc8;}else{_0x4a4c56=0xce;}_0x981158['status'](_0x4a4c56);return _0x981158['set']('Content-Range',_0x39753a+'-'+_0x307b3e+'/'+_0x56465b)[_0x0a9e('0xb')](_0x219af0);}return null;};}exports[_0x0a9e('0xc')]=function(_0xd5b662,_0x26d672){var _0x32d742={'count':0x0,'rows':[]};var _0x69aeb7={};var _0x5db4b0;var _0x4283ce=utils[_0x0a9e('0xd')]();var _0x2b4227;var _0x281129;var _0x44dcfd=_0xd5b662[_0x0a9e('0xe')]['globalQueueFilter'];var _0x22dccb=_0xd5b662['query'][_0x0a9e('0xf')];var _0x519dfd=_0xd5b662[_0x0a9e('0xe')][_0x0a9e('0x10')];var _0x48f32d=_0x22dccb===_0x0a9e('0x11')||_0x22dccb==='*pause'?!![]:![];var _0x459eb1=[];var _0x478723;var _0x106033;Promise[_0x0a9e('0x12')]()[_0x0a9e('0x13')](function(){if(_0xd5b662[_0x0a9e('0xe')][_0x0a9e('0x14')]){if(!utils[_0x0a9e('0x15')](_0xd5b662[_0x0a9e('0xe')][_0x0a9e('0x14')])){throw new APIBadRequestError(util[_0x0a9e('0x16')](_0x0a9e('0x17'),_0xd5b662['query'][_0x0a9e('0x14')]));}_0x5db4b0=_0xd5b662[_0x0a9e('0xe')]['channel'][_0x0a9e('0x18')]();}if(!_0xd5b662['query']['sort']||!_0xd5b662[_0x0a9e('0xe')][_0x0a9e('0x19')][_0x0a9e('0x1a')](_0x0a9e('0x1b'))){_0xd5b662['query'][_0x0a9e('0x19')]=rta[_0x0a9e('0x1c')](_0xd5b662[_0x0a9e('0xe')][_0x0a9e('0x19')]);return;}var _0x370d86=rta[_0x0a9e('0x1d')](_0xd5b662[_0x0a9e('0xe')]['sort']);_0xd5b662['query'][_0x0a9e('0x19')]=_0x370d86[_0x0a9e('0x1e')][_0x0a9e('0x1f')](',');_0x478723=_0x370d86[_0x0a9e('0x20')];})['then'](function(){if(!_0x44dcfd){return[];}return rta[_0x0a9e('0x21')](_0x44dcfd,_0x5db4b0);})['then'](function(_0x45a1e7){_0x459eb1=_0x45a1e7;return rta['getRealtimeAgents']();})[_0x0a9e('0x13')](function(_0x34dc65){_0x281129=_0x34dc65[_0x0a9e('0x22')];if((!_0x22dccb||_0x48f32d)&&!_0x478723){return _0x459eb1;}if(_0x478723&&!_0x22dccb){return rta[_0x0a9e('0x23')](_0x281129,_0x459eb1,_0x478723);}else{return rta[_0x0a9e('0x24')](_0x281129,_0x459eb1,_0x22dccb);}})[_0x0a9e('0x13')](function(_0x11c3b6){_0x459eb1=_0x11c3b6;var _0x14de77=![];if(_0x459eb1['length']===0x0){if(_0x44dcfd||_0x22dccb){_0x14de77=!![];}if(_0x48f32d){_0x14de77=![];}}if(_0x14de77){return _0x32d742;}var _0x3652a7=_[_0x0a9e('0x25')](db[_0x0a9e('0x26')][_0x0a9e('0x27')],function(_0x5c877d){return{'name':_0x5c877d[_0x0a9e('0x28')],'type':_0x5c877d[_0x0a9e('0x29')][_0x0a9e('0x2a')]};});_0xd5b662[_0x0a9e('0xe')][_0x0a9e('0x2b')]=_0x0a9e('0x2c');_0x69aeb7=qs[_0x0a9e('0x2d')](_0x3652a7,_0xd5b662);_0x69aeb7[_0x0a9e('0x2e')]=!![];var _0x1dbde2=[];if(_0x459eb1['length']>0x0){_0x1dbde2[_0x0a9e('0x2f')]({'id':{'$in':_0x459eb1}});if(_0x478723&&!_0x22dccb){_0x106033=[db['sequelize'][_0x0a9e('0x30')](_0x0a9e('0x31')+_0x459eb1+')')];_0x69aeb7[_0x0a9e('0x20')]=_0x106033;}}if(_0x48f32d){_0x4283ce[_0x0a9e('0x32')](function(_0x25ce3a){var _0x5180f1=!![];if(_0x22dccb===_0x0a9e('0x33')&&_0x5db4b0!==_0x25ce3a){_0x5180f1=![];}_0x1dbde2[_0x0a9e('0x2f')]({[_0x25ce3a+_0x0a9e('0x34')]:_0x5180f1});});if(_0x519dfd){_0x1dbde2[_0x0a9e('0x2f')]({'pauseType':_0x519dfd});}}else if(_0x22dccb){_0x4283ce[_0x0a9e('0x32')](function(_0x409319){_0x1dbde2[_0x0a9e('0x2f')]({[_0x409319+_0x0a9e('0x34')]:![]});});}_0x69aeb7['where']=_[_0x0a9e('0x35')](_0x69aeb7['where'],{'$and':_0x1dbde2});if(_0xd5b662[_0x0a9e('0x36')][_0x0a9e('0x2b')]===_0x0a9e('0x36')){var _0x3f3d41={'params':{'id':_0xd5b662['user'][_0x0a9e('0x37')]},'query':{'section':_0x0a9e('0x38'),'role':_0x0a9e('0x2c'),'online':_0xd5b662[_0x0a9e('0xe')]['online']===!![]?!![]:![],'raw':!![],'ids':_0x459eb1,'customSorting':_0x106033}};if(_0x48f32d){_0x3f3d41['query'][_0x0a9e('0x39')]=_0x1dbde2;}_0x3f3d41['query']=Object[_0x0a9e('0x3a')](_0x3f3d41[_0x0a9e('0xe')],_0xd5b662[_0x0a9e('0xe')]);delete _0x3f3d41[_0x0a9e('0xe')]['id'];return db['UserProfile'][_0x0a9e('0x3b')](_0x3f3d41);}return db[_0x0a9e('0x26')][_0x0a9e('0x3c')](_0x69aeb7);})['then'](function(_0x1dbf74){_0x32d742[_0x0a9e('0x9')]=_0x1dbf74[_0x0a9e('0x9')];_0x2b4227=_0x1dbf74['rows'];return _0x2b4227['map'](function(_0x11b61d){var _0x40d766=_['find'](_0x281129,['id',_0x11b61d['id']]);if(_0x40d766){var _0x2b814e=rta[_0x0a9e('0x3d')](_0x40d766);_[_0x0a9e('0x35')](_0x11b61d,_0x2b814e);}_0x11b61d[_0x0a9e('0x1b')]=rta['getAgentStatus'](_0x11b61d);if(_0x11b61d['globalStatus'][_0x0a9e('0x1a')](_0x0a9e('0x11'))){_0x4283ce['forEach'](function(_0x183991){if(_0x11b61d[_0x183991+_0x0a9e('0x34')]){if(_0x183991===_0x0a9e('0x3e')){if(_0x11b61d['voiceStatus']!==_0x0a9e('0x3f')){_0x11b61d[_0x0a9e('0x40')]=_0x0a9e('0x11');}}else{_0x11b61d[_0x183991+_0x0a9e('0x41')]=_0x0a9e('0x11');}}});}return _0x11b61d;});})[_0x0a9e('0x13')](function(_0x2881b3){if(!_0x478723||_0x106033){return _0x2881b3;}return rta[_0x0a9e('0x42')](_0x2881b3,_0x478723);})[_0x0a9e('0x13')](function(_0x3da2cd){var _0x2c3711=null;if(_0xd5b662[_0x0a9e('0xe')][_0x0a9e('0x1e')]){var _0x11ca30=_0xd5b662[_0x0a9e('0xe')]['fields']['split'](',');_0x2c3711=_0x3da2cd[_0x0a9e('0x25')](function(_0xb3795a){return _[_0x0a9e('0x43')](_0xb3795a,_0x11ca30);});}_0x32d742[_0x0a9e('0x22')]=_0x2c3711||_0x3da2cd;return _0x32d742;})[_0x0a9e('0x13')](respondWithFilteredResult(_0x26d672,_0x69aeb7))[_0x0a9e('0x44')](APIHandleError(_0x26d672));};exports[_0x0a9e('0x45')]=function(_0x445e25,_0x432fcc){var _0x25c6e6={'count':0x0,'rows':[]};var _0x2c2cb0={};var _0x35ed4a;var _0x5026aa;var _0x117c99;Promise[_0x0a9e('0x12')]()[_0x0a9e('0x13')](function(){if(_0x445e25[_0x0a9e('0xe')][_0x0a9e('0x14')]){if(!utils[_0x0a9e('0x15')](_0x445e25[_0x0a9e('0xe')][_0x0a9e('0x14')])){throw new APIBadRequestError(util['format'](_0x0a9e('0x17'),_0x445e25['query'][_0x0a9e('0x14')]));}_0x35ed4a=_0x445e25[_0x0a9e('0xe')][_0x0a9e('0x14')]['toLowerCase']();}var _0x14bec2=_[_0x0a9e('0x46')](_0x35ed4a)+_0x0a9e('0x47');var _0x34aa5a=_[_0x0a9e('0x25')](db[_0x14bec2][_0x0a9e('0x27')],function(_0x45bf7f){return{'name':_0x45bf7f['fieldName'],'type':_0x45bf7f[_0x0a9e('0x29')][_0x0a9e('0x2a')]};});if(!_0x445e25[_0x0a9e('0xe')][_0x0a9e('0x1e')]){var _0x409789=['id',_0x0a9e('0x48')];if(_0x35ed4a===_0x0a9e('0x3e')){_0x409789[_0x0a9e('0x2f')](_0x0a9e('0x29'));if(_0x445e25['query'][_0x0a9e('0x29')]===_0x0a9e('0x49')){_0x409789['push'](['dialActive','dialMethod']);}}_0x445e25[_0x0a9e('0xe')][_0x0a9e('0x1e')]=_0x409789[_0x0a9e('0x1f')](',');}_0x2c2cb0=qs[_0x0a9e('0x2d')](_0x34aa5a,_0x445e25);if(_0x445e25[_0x0a9e('0x36')][_0x0a9e('0x2b')]===_0x0a9e('0x36')){var _0x375c18={'params':{'id':_0x445e25['user']['userProfileId']},'query':{'section':_0x35ed4a==='voice'&&_0x445e25[_0x0a9e('0xe')][_0x0a9e('0x29')]===_0x0a9e('0x49')?'QueueCampaigns':_[_0x0a9e('0x46')](_0x35ed4a)+_0x0a9e('0x4a'),'type':_0x445e25['query']['type'],'nolimit':!![],'sort':_0x0a9e('0x48'),'filter':_0x445e25['query'][_0x0a9e('0x4b')]}};_0x375c18['query']=Object[_0x0a9e('0x3a')](_0x375c18[_0x0a9e('0xe')],_0x445e25[_0x0a9e('0xe')]);delete _0x375c18['query']['id'];return db[_0x0a9e('0x4c')][_0x0a9e('0x3b')](_0x375c18);}return db[_0x14bec2]['findAndCountAll'](_0x2c2cb0);})['then'](function(_0x128aa6){_0x25c6e6[_0x0a9e('0x9')]=_0x128aa6['count'];_0x5026aa=_0x128aa6[_0x0a9e('0x22')];return rtq['getRealtimeQueues'](_0x445e25,_0x35ed4a);})[_0x0a9e('0x13')](function(_0x523cd2){_0x117c99=_0x523cd2[_0x0a9e('0x22')];return rtq['initializeQueues'](_0x5026aa,_0x117c99,_0x35ed4a,_0x445e25['query']['type']);})[_0x0a9e('0x13')](function(_0x47de4c){_0x25c6e6[_0x0a9e('0x22')]=_0x47de4c;return _0x25c6e6;})[_0x0a9e('0x13')](respondWithFilteredResult(_0x432fcc,_0x2c2cb0))[_0x0a9e('0x44')](APIHandleError(_0x432fcc));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index e99ea36..326b559 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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x25201e,_0xc781ec){var _0x4b2d85=function(_0x23da2a){while(--_0x23da2a){_0x25201e['push'](_0x25201e['shift']());}};_0x4b2d85(++_0xc781ec);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x5cb1af,_0x4bdc8c){_0x5cb1af=_0x5cb1af-0x0;var _0x8d7940=_0xcb91[_0x5cb1af];return _0x8d7940;};'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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0xebcb9c,_0x41295b){var _0x13563f=function(_0x39b2d4){while(--_0x39b2d4){_0xebcb9c['push'](_0xebcb9c['shift']());}};_0x13563f(++_0x41295b);}(_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 a114657..907ba39 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 _0x0650=['DATE','sequelize','INTEGER','STRING'];(function(_0x422a55,_0x178bb){var _0x5a7921=function(_0x46c0a6){while(--_0x46c0a6){_0x422a55['push'](_0x422a55['shift']());}};_0x5a7921(++_0x178bb);}(_0x0650,0xed));var _0x0065=function(_0x8b885,_0x31740b){_0x8b885=_0x8b885-0x0;var _0x122eb8=_0x0650[_0x8b885];return _0x122eb8;};'use strict';var Sequelize=require(_0x0065('0x0'));module['exports']={'state':{'type':Sequelize[_0x0065('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x0065('0x2')]},'scheduledat':{'type':Sequelize['DATE']},'uniqueid':{'type':Sequelize[_0x0065('0x2')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x0065('0x3')]},'ringtime':{'type':Sequelize[_0x0065('0x1')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x0065('0x2')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x0065('0x2')]}}; \ No newline at end of file +var _0xdded=['INTEGER','STRING','DATE','sequelize','exports'];(function(_0x2b5acd,_0x26efa3){var _0x140d0b=function(_0x552366){while(--_0x552366){_0x2b5acd['push'](_0x2b5acd['shift']());}};_0x140d0b(++_0x26efa3);}(_0xdded,0x17a));var _0xddde=function(_0x2e4016,_0x5f1030){_0x2e4016=_0x2e4016-0x0;var _0x2398af=_0xdded[_0x2e4016];return _0x2398af;};'use strict';var Sequelize=require(_0xddde('0x0'));module[_0xddde('0x1')]={'state':{'type':Sequelize[_0xddde('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xddde('0x3')]},'scheduledat':{'type':Sequelize[_0xddde('0x4')]},'uniqueid':{'type':Sequelize[_0xddde('0x3')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0xddde('0x4')]},'ringtime':{'type':Sequelize[_0xddde('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xddde('0x3')]},'campaigntype':{'type':Sequelize[_0xddde('0x3')]},'membername':{'type':Sequelize[_0xddde('0x3')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index 96ef498..c8a52c7 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 _0x5cdb=['request-promise','path','rimraf','../../config/environment','./reportAgentPreview.attributes','exports','define','ReportAgentPreview','report_agent_preview','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0x5cdb,0x162));var _0xb5cd=function(_0x2fcd14,_0x18e41e){_0x2fcd14=_0x2fcd14-0x0;var _0x115a04=_0x5cdb[_0x2fcd14];return _0x115a04;};'use strict';var _=require(_0xb5cd('0x0'));var util=require(_0xb5cd('0x1'));var logger=require(_0xb5cd('0x2'))(_0xb5cd('0x3'));var moment=require(_0xb5cd('0x4'));var BPromise=require(_0xb5cd('0x5'));var rp=require(_0xb5cd('0x6'));var fs=require('fs');var path=require(_0xb5cd('0x7'));var rimraf=require(_0xb5cd('0x8'));var config=require(_0xb5cd('0x9'));var attributes=require(_0xb5cd('0xa'));module[_0xb5cd('0xb')]=function(_0x339efb,_0x278f73){return _0x339efb[_0xb5cd('0xc')](_0xb5cd('0xd'),attributes,{'tableName':_0xb5cd('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9d86=['ReportAgentPreview','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./reportAgentPreview.attributes','define'];(function(_0x546ba7,_0x110b6c){var _0x485adb=function(_0x461956){while(--_0x461956){_0x546ba7['push'](_0x546ba7['shift']());}};_0x485adb(++_0x110b6c);}(_0x9d86,0x85));var _0x69d8=function(_0x32a53c,_0x5cfdcd){_0x32a53c=_0x32a53c-0x0;var _0xd2438a=_0x9d86[_0x32a53c];return _0xd2438a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x69d8('0x0'))(_0x69d8('0x1'));var moment=require(_0x69d8('0x2'));var BPromise=require(_0x69d8('0x3'));var rp=require(_0x69d8('0x4'));var fs=require('fs');var path=require(_0x69d8('0x5'));var rimraf=require(_0x69d8('0x6'));var config=require(_0x69d8('0x7'));var attributes=require(_0x69d8('0x8'));module['exports']=function(_0x76ea94,_0x537144){return _0x76ea94[_0x69d8('0x9')](_0x69d8('0xa'),attributes,{'tableName':'report_agent_preview','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.rpc.js b/server/api/reportAgentPreview/reportAgentPreview.rpc.js index b088e24..0d3c253 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 _0x83e1=['http','then','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','CreateReportAgentPreview','ReportAgentPreview','create','body','options','raw','bluebird','randomstring','../../config/utils','../../config/environment','jayson/promise','client'];(function(_0x5d8ad5,_0x2e0fd6){var _0x27ca1e=function(_0x5ccde5){while(--_0x5ccde5){_0x5d8ad5['push'](_0x5d8ad5['shift']());}};_0x27ca1e(++_0x2e0fd6);}(_0x83e1,0x1da));var _0x183e=function(_0x5591df,_0x98bf25){_0x5591df=_0x5591df-0x0;var _0x3b4fc6=_0x83e1[_0x5591df];return _0x3b4fc6;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x183e('0x0'));var rs=require(_0x183e('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x183e('0x2'));var logger=require('../../config/logger')('rpc');var config=require(_0x183e('0x3'));var jayson=require(_0x183e('0x4'));var client=jayson[_0x183e('0x5')][_0x183e('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x528068,_0x5f4aaf,_0x36b4c0){return new BPromise(function(_0x8c0814,_0x56c08a){return client['request'](_0x528068,_0x36b4c0)[_0x183e('0x7')](function(_0x22aff7){logger['info'](_0x183e('0x8'),_0x5f4aaf,_0x183e('0x9'));logger[_0x183e('0xa')]('ReportAgentPreview,\x20%s,\x20%s,\x20%s',_0x5f4aaf,'request\x20sent',JSON[_0x183e('0xb')](_0x22aff7));if(_0x22aff7[_0x183e('0xc')]){if(_0x22aff7[_0x183e('0xc')][_0x183e('0xd')]===0x1f4){logger[_0x183e('0xc')](_0x183e('0x8'),_0x5f4aaf,_0x22aff7['error'][_0x183e('0xe')]);return _0x56c08a(_0x22aff7[_0x183e('0xc')][_0x183e('0xe')]);}logger[_0x183e('0xc')](_0x183e('0x8'),_0x5f4aaf,_0x22aff7[_0x183e('0xc')][_0x183e('0xe')]);return _0x8c0814(_0x22aff7[_0x183e('0xc')][_0x183e('0xe')]);}else{logger[_0x183e('0xf')](_0x183e('0x8'),_0x5f4aaf,_0x183e('0x9'));_0x8c0814(_0x22aff7[_0x183e('0x10')][_0x183e('0xe')]);}})[_0x183e('0x11')](function(_0x3f6a97){logger[_0x183e('0xc')](_0x183e('0x8'),_0x5f4aaf,_0x3f6a97);_0x56c08a(_0x3f6a97);});});}exports[_0x183e('0x12')]=function(_0x4b4fdf){var _0x152207=this;return new Promise(function(_0x3bac8d,_0x189473){return db[_0x183e('0x13')][_0x183e('0x14')](_0x4b4fdf[_0x183e('0x15')],{'raw':_0x4b4fdf['options']?_0x4b4fdf[_0x183e('0x16')][_0x183e('0x17')]===undefined?!![]:![]:!![]})[_0x183e('0x7')](function(_0xbb8f45){logger['info'](_0x183e('0x12'),_0x4b4fdf);logger['debug']('CreateReportAgentPreview',_0x4b4fdf,JSON[_0x183e('0xb')](_0xbb8f45));_0x3bac8d(_0xbb8f45);})['catch'](function(_0x415e0e){logger[_0x183e('0xc')](_0x183e('0x12'),_0x415e0e['message'],_0x4b4fdf);_0x189473(_0x152207[_0x183e('0xc')](0x1f4,_0x415e0e[_0x183e('0xe')]));});});}; \ No newline at end of file +var _0x4824=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateReportAgentPreview','ReportAgentPreview','create','options','raw','lodash','moment','bluebird','randomstring','../../mysqldb'];(function(_0x2164da,_0x16cd0b){var _0x12da0d=function(_0x5e5160){while(--_0x5e5160){_0x2164da['push'](_0x2164da['shift']());}};_0x12da0d(++_0x16cd0b);}(_0x4824,0xc6));var _0x4482=function(_0x1438eb,_0x41a799){_0x1438eb=_0x1438eb-0x0;var _0x4716ab=_0x4824[_0x1438eb];return _0x4716ab;};'use strict';var _=require(_0x4482('0x0'));var util=require('util');var moment=require(_0x4482('0x1'));var BPromise=require(_0x4482('0x2'));var rs=require(_0x4482('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4482('0x4'))['db'];var utils=require(_0x4482('0x5'));var logger=require(_0x4482('0x6'))(_0x4482('0x7'));var config=require(_0x4482('0x8'));var jayson=require(_0x4482('0x9'));var client=jayson[_0x4482('0xa')][_0x4482('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3c7bc2,_0x54c666,_0x558b74){return new BPromise(function(_0x1de7f2,_0xbe9a0c){return client[_0x4482('0xc')](_0x3c7bc2,_0x558b74)[_0x4482('0xd')](function(_0x4781c7){logger['info'](_0x4482('0xe'),_0x54c666,_0x4482('0xf'));logger['debug'](_0x4482('0x10'),_0x54c666,_0x4482('0xf'),JSON[_0x4482('0x11')](_0x4781c7));if(_0x4781c7[_0x4482('0x12')]){if(_0x4781c7[_0x4482('0x12')][_0x4482('0x13')]===0x1f4){logger['error']('ReportAgentPreview,\x20%s,\x20%s',_0x54c666,_0x4781c7[_0x4482('0x12')]['message']);return _0xbe9a0c(_0x4781c7[_0x4482('0x12')][_0x4482('0x14')]);}logger[_0x4482('0x12')](_0x4482('0xe'),_0x54c666,_0x4781c7[_0x4482('0x12')][_0x4482('0x14')]);return _0x1de7f2(_0x4781c7[_0x4482('0x12')]['message']);}else{logger[_0x4482('0x15')](_0x4482('0xe'),_0x54c666,_0x4482('0xf'));_0x1de7f2(_0x4781c7[_0x4482('0x16')]['message']);}})[_0x4482('0x17')](function(_0x153e22){logger[_0x4482('0x12')](_0x4482('0xe'),_0x54c666,_0x153e22);_0xbe9a0c(_0x153e22);});});}exports[_0x4482('0x18')]=function(_0x554e4d){var _0x594ee0=this;return new Promise(function(_0x58fa26,_0x3a66a8){return db[_0x4482('0x19')][_0x4482('0x1a')](_0x554e4d['body'],{'raw':_0x554e4d[_0x4482('0x1b')]?_0x554e4d['options'][_0x4482('0x1c')]===undefined?!![]:![]:!![]})[_0x4482('0xd')](function(_0x3bcf3d){logger[_0x4482('0x15')](_0x4482('0x18'),_0x554e4d);logger['debug'](_0x4482('0x18'),_0x554e4d,JSON[_0x4482('0x11')](_0x3bcf3d));_0x58fa26(_0x3bcf3d);})[_0x4482('0x17')](function(_0x49668b){logger[_0x4482('0x12')](_0x4482('0x18'),_0x49668b['message'],_0x554e4d);_0x3a66a8(_0x594ee0['error'](0x1f4,_0x49668b[_0x4482('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index 9c91cdb..c9dbc35 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 _0x9eb1=['/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','/chat/queues/:id/notify','chat','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','fax','/fax/queues/:id','/openchannel/queues/:id/notify','openchannel','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','whatsapp','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','exports','multer','express','Router','get','/voice/channels','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','chatQueues','/mail/accounts','mailAccounts','/openchannel/queues','openchannelQueues','/sms/queues','smsQueues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','/voice/queues/channels/:uniqueid/redirect/:exten','/voice/queues/:id','showVoiceQueues','put','updateVoiceQueue','/outbound','outbound','/outbound/channels','outboundChannels','/agents','agents','/telephones','telephones','/trunks','/campaigns','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions'];(function(_0x392ccc,_0x444e1e){var _0x2df583=function(_0x3d2b52){while(--_0x3d2b52){_0x392ccc['push'](_0x392ccc['shift']());}};_0x2df583(++_0x444e1e);}(_0x9eb1,0x65));var _0x19eb=function(_0x49dba5,_0x1086fd){_0x49dba5=_0x49dba5-0x0;var _0x495fc6=_0x9eb1[_0x49dba5];return _0x495fc6;};'use strict';var multer=require(_0x19eb('0x0'));var util=require('util');var path=require('path');var express=require(_0x19eb('0x1'));var router=express[_0x19eb('0x2')]();var auth=require('../../components/auth/service');var controller=require('./rpc.controller');router[_0x19eb('0x3')](_0x19eb('0x4'),auth[_0x19eb('0x5')](),controller[_0x19eb('0x6')]);router[_0x19eb('0x3')](_0x19eb('0x7'),auth[_0x19eb('0x5')](),controller['voiceChannelMixMonitor']);router[_0x19eb('0x3')]('/voice/channels/:uniqueid/stopmixmonitor',auth[_0x19eb('0x5')](),controller[_0x19eb('0x8')]);router['get'](_0x19eb('0x9'),auth[_0x19eb('0x5')](),controller[_0x19eb('0xa')]);router[_0x19eb('0x3')](_0x19eb('0xb'),auth[_0x19eb('0x5')](),controller[_0x19eb('0xc')]);router[_0x19eb('0x3')]('/mail/queues',auth[_0x19eb('0x5')](),controller['mailQueues']);router[_0x19eb('0x3')](_0x19eb('0xd'),auth[_0x19eb('0x5')](),controller[_0x19eb('0xe')]);router['get'](_0x19eb('0xf'),auth[_0x19eb('0x5')](),controller[_0x19eb('0x10')]);router[_0x19eb('0x3')](_0x19eb('0x11'),auth[_0x19eb('0x5')](),controller[_0x19eb('0x12')]);router[_0x19eb('0x3')]('/whatsapp/queues',auth[_0x19eb('0x5')](),controller['whatsappQueues']);router[_0x19eb('0x3')](_0x19eb('0x13'),auth[_0x19eb('0x5')](),controller[_0x19eb('0x14')]);router['get'](_0x19eb('0x15'),auth[_0x19eb('0x5')](),controller[_0x19eb('0x16')]);router['get'](_0x19eb('0x17'),auth[_0x19eb('0x5')](),controller[_0x19eb('0x18')]);router[_0x19eb('0x3')](_0x19eb('0x19'),auth[_0x19eb('0x5')](),controller[_0x19eb('0x1a')]);router[_0x19eb('0x3')](_0x19eb('0x1b'),auth['isAuthenticated'](),controller['voiceQueuesChannelHangup']);router[_0x19eb('0x3')](_0x19eb('0x1c'),auth[_0x19eb('0x5')](),controller['voiceQueuesChannelRedirect']);router[_0x19eb('0x3')](_0x19eb('0x1d'),auth[_0x19eb('0x5')](),controller[_0x19eb('0x1e')]);router[_0x19eb('0x1f')](_0x19eb('0x1d'),auth[_0x19eb('0x5')](),controller[_0x19eb('0x20')]);router[_0x19eb('0x3')](_0x19eb('0x21'),auth[_0x19eb('0x5')](),controller[_0x19eb('0x22')]);router[_0x19eb('0x3')](_0x19eb('0x23'),auth['isAuthenticated'](),controller[_0x19eb('0x24')]);router[_0x19eb('0x3')](_0x19eb('0x25'),auth['isAuthenticated'](),controller[_0x19eb('0x26')]);router[_0x19eb('0x1f')]('/agents/:id/capacity',auth[_0x19eb('0x5')](),controller['agentCapacity']);router[_0x19eb('0x3')](_0x19eb('0x27'),auth[_0x19eb('0x5')](),controller[_0x19eb('0x28')]);router[_0x19eb('0x3')](_0x19eb('0x29'),auth[_0x19eb('0x5')](),controller['trunks']);router[_0x19eb('0x3')](_0x19eb('0x2a'),auth[_0x19eb('0x5')](),controller[_0x19eb('0x2b')]);router[_0x19eb('0x3')](_0x19eb('0x2c'),auth['isAuthenticated'](),controller[_0x19eb('0x2d')]);router[_0x19eb('0x3')](_0x19eb('0x2e'),auth['isAuthenticated'](),controller[_0x19eb('0x2f')]);router[_0x19eb('0x3')]('/mail/queues/waitinginteractions',auth[_0x19eb('0x5')](),controller[_0x19eb('0x30')]);router[_0x19eb('0x3')]('/openchannel/queues/waitinginteractions',auth[_0x19eb('0x5')](),controller[_0x19eb('0x31')]);router['get'](_0x19eb('0x32'),auth[_0x19eb('0x5')](),controller['openchannelQueuesIdWaitingInteractions']);router[_0x19eb('0x3')]('/sms/queues/waitinginteractions',auth[_0x19eb('0x5')](),controller[_0x19eb('0x33')]);router['get']('/whatsapp/queues/waitinginteractions',auth[_0x19eb('0x5')](),controller[_0x19eb('0x34')]);router[_0x19eb('0x3')](_0x19eb('0x35'),auth[_0x19eb('0x5')](),controller[_0x19eb('0x36')]);router[_0x19eb('0x37')](_0x19eb('0x38'),auth['isAuthenticated'](),controller[_0x19eb('0x39')](_0x19eb('0x3a')));router['get'](_0x19eb('0x3b'),auth[_0x19eb('0x5')](),controller['showMailQueues']);router[_0x19eb('0x37')](_0x19eb('0x3c'),auth[_0x19eb('0x5')](),controller[_0x19eb('0x39')](_0x19eb('0x3d')));router[_0x19eb('0x3')](_0x19eb('0x3e'),auth[_0x19eb('0x5')](),controller[_0x19eb('0x3f')]);router[_0x19eb('0x37')](_0x19eb('0x40'),auth[_0x19eb('0x5')](),controller[_0x19eb('0x39')](_0x19eb('0x41')));router[_0x19eb('0x3')](_0x19eb('0x42'),auth['isAuthenticated'](),controller['showFaxQueues']);router[_0x19eb('0x37')](_0x19eb('0x43'),auth[_0x19eb('0x5')](),controller[_0x19eb('0x39')](_0x19eb('0x44')));router[_0x19eb('0x3')]('/openchannel/queues/:id',auth[_0x19eb('0x5')](),controller['showOpenchannelQueues']);router[_0x19eb('0x37')](_0x19eb('0x45'),auth[_0x19eb('0x5')](),controller[_0x19eb('0x39')](_0x19eb('0x46')));router[_0x19eb('0x37')](_0x19eb('0x47'),auth[_0x19eb('0x5')](),controller[_0x19eb('0x39')](_0x19eb('0x48')));router[_0x19eb('0x3')]('/sms/queues/:id',auth[_0x19eb('0x5')](),controller['showSmsQueues']);router[_0x19eb('0x3')](_0x19eb('0x49'),auth['isAuthenticated'](),controller[_0x19eb('0x4a')]);router[_0x19eb('0x37')](_0x19eb('0x4b'),auth['isAuthenticated'](),controller['agentNotify']);module[_0x19eb('0x4c')]=router; \ No newline at end of file +var _0x42c0=['smsQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','/chat/queues/:id/notify','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','fax','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','agentNotify','exports','multer','../../components/auth/service','get','isAuthenticated','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','/voice/queues','chatQueues','mailQueues','/mail/accounts','mailAccounts','/openchannel/queues','openchannelQueues','smsQueues','/whatsapp/queues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','/voice/queues/channels/:uniqueid/redirect/:exten','/voice/queues/:id','showVoiceQueues','put','updateVoiceQueue','/outbound','outbound','/outbound/channels','outboundChannels','/agents','agents','/agents/:id/capacity','agentCapacity','/telephones','telephones','trunks','/campaigns','campaigns','faxAccounts','/chat/queues/waitinginteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions'];(function(_0x2cefd2,_0x3eed48){var _0x528537=function(_0x4a529b){while(--_0x4a529b){_0x2cefd2['push'](_0x2cefd2['shift']());}};_0x528537(++_0x3eed48);}(_0x42c0,0x1cf));var _0x042c=function(_0x819464,_0x46fc91){_0x819464=_0x819464-0x0;var _0x49dcc0=_0x42c0[_0x819464];return _0x49dcc0;};'use strict';var multer=require(_0x042c('0x0'));var util=require('util');var path=require('path');var express=require('express');var router=express['Router']();var auth=require(_0x042c('0x1'));var controller=require('./rpc.controller');router[_0x042c('0x2')]('/voice/channels',auth[_0x042c('0x3')](),controller['voiceChannels']);router[_0x042c('0x2')](_0x042c('0x4'),auth[_0x042c('0x3')](),controller[_0x042c('0x5')]);router['get'](_0x042c('0x6'),auth[_0x042c('0x3')](),controller['voiceChannelStopMixMonitor']);router[_0x042c('0x2')](_0x042c('0x7'),auth['isAuthenticated'](),controller['voiceQueues']);router['get']('/chat/queues',auth['isAuthenticated'](),controller[_0x042c('0x8')]);router['get']('/mail/queues',auth['isAuthenticated'](),controller[_0x042c('0x9')]);router[_0x042c('0x2')](_0x042c('0xa'),auth['isAuthenticated'](),controller[_0x042c('0xb')]);router['get'](_0x042c('0xc'),auth[_0x042c('0x3')](),controller[_0x042c('0xd')]);router[_0x042c('0x2')]('/sms/queues',auth[_0x042c('0x3')](),controller[_0x042c('0xe')]);router[_0x042c('0x2')](_0x042c('0xf'),auth['isAuthenticated'](),controller['whatsappQueues']);router[_0x042c('0x2')]('/fax/queues',auth[_0x042c('0x3')](),controller['faxQueues']);router['get'](_0x042c('0x10'),auth[_0x042c('0x3')](),controller[_0x042c('0x11')]);router[_0x042c('0x2')](_0x042c('0x12'),auth[_0x042c('0x3')](),controller[_0x042c('0x13')]);router[_0x042c('0x2')](_0x042c('0x14'),auth[_0x042c('0x3')](),controller[_0x042c('0x15')]);router[_0x042c('0x2')](_0x042c('0x16'),auth['isAuthenticated'](),controller['voiceQueuesChannelHangup']);router[_0x042c('0x2')](_0x042c('0x17'),auth[_0x042c('0x3')](),controller['voiceQueuesChannelRedirect']);router[_0x042c('0x2')](_0x042c('0x18'),auth[_0x042c('0x3')](),controller[_0x042c('0x19')]);router[_0x042c('0x1a')](_0x042c('0x18'),auth[_0x042c('0x3')](),controller[_0x042c('0x1b')]);router[_0x042c('0x2')](_0x042c('0x1c'),auth['isAuthenticated'](),controller[_0x042c('0x1d')]);router['get'](_0x042c('0x1e'),auth[_0x042c('0x3')](),controller[_0x042c('0x1f')]);router['get'](_0x042c('0x20'),auth[_0x042c('0x3')](),controller[_0x042c('0x21')]);router[_0x042c('0x1a')](_0x042c('0x22'),auth[_0x042c('0x3')](),controller[_0x042c('0x23')]);router[_0x042c('0x2')](_0x042c('0x24'),auth[_0x042c('0x3')](),controller[_0x042c('0x25')]);router[_0x042c('0x2')]('/trunks',auth['isAuthenticated'](),controller[_0x042c('0x26')]);router[_0x042c('0x2')](_0x042c('0x27'),auth['isAuthenticated'](),controller[_0x042c('0x28')]);router[_0x042c('0x2')]('/fax/accounts',auth[_0x042c('0x3')](),controller[_0x042c('0x29')]);router[_0x042c('0x2')](_0x042c('0x2a'),auth['isAuthenticated'](),controller['chatQueuesWaitingInteractions']);router[_0x042c('0x2')](_0x042c('0x2b'),auth[_0x042c('0x3')](),controller[_0x042c('0x2c')]);router[_0x042c('0x2')]('/openchannel/queues/waitinginteractions',auth[_0x042c('0x3')](),controller[_0x042c('0x2d')]);router['get'](_0x042c('0x2e'),auth[_0x042c('0x3')](),controller[_0x042c('0x2f')]);router[_0x042c('0x2')]('/sms/queues/waitinginteractions',auth[_0x042c('0x3')](),controller[_0x042c('0x30')]);router['get']('/whatsapp/queues/waitinginteractions',auth[_0x042c('0x3')](),controller['whatsappQueuesWaitingInteractions']);router[_0x042c('0x2')]('/fax/queues/waitinginteractions',auth[_0x042c('0x3')](),controller['faxQueuesWaitingInteractions']);router[_0x042c('0x31')](_0x042c('0x32'),auth[_0x042c('0x3')](),controller[_0x042c('0x33')](_0x042c('0x34')));router['get'](_0x042c('0x35'),auth['isAuthenticated'](),controller['showMailQueues']);router[_0x042c('0x31')](_0x042c('0x36'),auth[_0x042c('0x3')](),controller['queueNotify']('chat'));router[_0x042c('0x2')](_0x042c('0x37'),auth[_0x042c('0x3')](),controller[_0x042c('0x38')]);router[_0x042c('0x31')](_0x042c('0x39'),auth[_0x042c('0x3')](),controller['queueNotify'](_0x042c('0x3a')));router[_0x042c('0x2')](_0x042c('0x3b'),auth[_0x042c('0x3')](),controller[_0x042c('0x3c')]);router[_0x042c('0x31')](_0x042c('0x3d'),auth[_0x042c('0x3')](),controller[_0x042c('0x33')]('openchannel'));router['get'](_0x042c('0x3e'),auth[_0x042c('0x3')](),controller[_0x042c('0x3f')]);router[_0x042c('0x31')](_0x042c('0x40'),auth['isAuthenticated'](),controller[_0x042c('0x33')](_0x042c('0x41')));router[_0x042c('0x31')](_0x042c('0x42'),auth['isAuthenticated'](),controller['queueNotify']('whatsapp'));router[_0x042c('0x2')](_0x042c('0x43'),auth[_0x042c('0x3')](),controller[_0x042c('0x44')]);router['get'](_0x042c('0x45'),auth[_0x042c('0x3')](),controller[_0x042c('0x46')]);router['post']('/agents/:id/notify',auth[_0x042c('0x3')](),controller[_0x042c('0x47')]);module[_0x042c('0x48')]=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index 4c245aa..80b61c8 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 _0x5c0b=['mailAccounts','MailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','SmsQueues','showSmsQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','filter','map','uniq','value','queue_id','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','chat','Website','findOne','Message','Interaction','Account','\x20Message\x20not\x20found','update','MessageId','InteractionId','TransferReport','create','Start','queue','queueTransferTimeout','*,*,*,*','channel','Channel\x20field\x20is\x20mandatory','capitalize','User','Agent\x20not\x20found','messageId','From','agentTransferTimeout','bluebird','lodash','util','../../mysqldb','jayson/promise','client','http','request','then','error','code','message','catch','sendStatus','stack','name','status','send','isNil','rows','voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','merge','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','params','voiceQueues','VoiceQueues','showVoiceQueues','updateVoiceQueue','UpdateVoiceQueue','body','VoiceQueuesPreview','voiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','outbound','Outbound','OutboundChannels','agents','Agents','agentCapacity','interaction','user','findAll','INTERACTION','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','MemberReport','findOrCreate','interface','SIP/%s','agent','internal','capacity','telephones','Trunks','Campaigns','chatQueues','ChatQueues','mailQueues','MailQueues','showMailQueues'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x5c0b,0x12a));var _0xb5c0=function(_0xf6ea6f,_0x2afef5){_0xf6ea6f=_0xf6ea6f-0x0;var _0x5c2515=_0x5c0b[_0xf6ea6f];return _0x5c2515;};'use strict';var BPromise=require(_0xb5c0('0x0'));var moment=require('moment');var _=require(_0xb5c0('0x1'));var util=require(_0xb5c0('0x2'));var db=require(_0xb5c0('0x3'))['db'];var logger=require('../../config/logger')('api');var jayson=require(_0xb5c0('0x4'));var amiClient=jayson[_0xb5c0('0x5')]['http']({'port':0x232a});var mailClient=jayson[_0xb5c0('0x5')][_0xb5c0('0x6')]({'port':0x232b});var routingClient=jayson[_0xb5c0('0x5')][_0xb5c0('0x6')]({'port':0x232c});function respondWithRpcPromise(_0x5391c4,_0x3341ac,_0x10071d){return new BPromise(function(_0x1e89f5,_0x2edf38){var _0x1a51e3=_0x10071d?_0x10071d:amiClient;return _0x1a51e3[_0xb5c0('0x7')](_0x5391c4,_0x3341ac)[_0xb5c0('0x8')](function(_0x97a2c9){if(_0x97a2c9[_0xb5c0('0x9')]){if(_0x97a2c9[_0xb5c0('0x9')][_0xb5c0('0xa')]===0x1f4){return _0x2edf38(_0x97a2c9[_0xb5c0('0x9')][_0xb5c0('0xb')]);}return _0x1e89f5(_0x97a2c9['error'][_0xb5c0('0xb')]);}else{_0x1e89f5(_0x97a2c9['result']);}})[_0xb5c0('0xc')](function(_0x18ade1){_0x2edf38(_0x18ade1);});});}function respondWithResult(_0x565d62,_0x5a2319){_0x5a2319=_0x5a2319||0xc8;return function(_0x337c61){if(_0x337c61){return _0x565d62['status'](_0x5a2319)['json'](_0x337c61);}return _0x565d62[_0xb5c0('0xd')](0x194);};}function handleError(_0x1f3334,_0x8ab22b){_0x8ab22b=_0x8ab22b||0x1f4;return function(_0x20d3f6){logger['error'](_0x20d3f6[_0xb5c0('0xe')]);if(_0x20d3f6[_0xb5c0('0xf')]){delete _0x20d3f6[_0xb5c0('0xf')];}_0x1f3334[_0xb5c0('0x10')](_0x8ab22b)[_0xb5c0('0x11')](_0x20d3f6);};}function findById(_0x413eef){return function(_0x1c404b){if(!_[_0xb5c0('0x12')](_0x413eef)&&!_[_0xb5c0('0x12')](_0x1c404b)&&!_[_0xb5c0('0x12')](_0x1c404b[_0xb5c0('0x13')])){return _['find'](_0x1c404b[_0xb5c0('0x13')],function(_0x5c5951){return _0x5c5951['id']==_0x413eef;});}return null;};}exports[_0xb5c0('0x14')]=function(_0x465325,_0x5cd8d0){return respondWithRpcPromise(_0xb5c0('0x15'),_0x465325[_0xb5c0('0x16')])['then'](respondWithResult(_0x5cd8d0,null))['catch'](handleError(_0x5cd8d0,null));};exports[_0xb5c0('0x17')]=function(_0x8e8aef,_0x101821){return respondWithRpcPromise('VoiceChannelMixMonitor',_[_0xb5c0('0x18')](_0x8e8aef[_0xb5c0('0x16')],_0x8e8aef['params']))[_0xb5c0('0x8')](respondWithResult(_0x101821,null))[_0xb5c0('0xc')](handleError(_0x101821,null));};exports[_0xb5c0('0x19')]=function(_0x32a07d,_0x3c5c00){return respondWithRpcPromise(_0xb5c0('0x1a'),_[_0xb5c0('0x18')](_0x32a07d[_0xb5c0('0x16')],_0x32a07d[_0xb5c0('0x1b')]))[_0xb5c0('0x8')](respondWithResult(_0x3c5c00,null))['catch'](handleError(_0x3c5c00,null));};exports[_0xb5c0('0x1c')]=function(_0x5679c0,_0x56f62a){return respondWithRpcPromise(_0xb5c0('0x1d'),_0x5679c0[_0xb5c0('0x16')])['then'](respondWithResult(_0x56f62a,null))[_0xb5c0('0xc')](handleError(_0x56f62a,null));};exports[_0xb5c0('0x1e')]=function(_0x2f8924,_0x39c8b2){return respondWithRpcPromise('VoiceQueues',_0x2f8924['query'])[_0xb5c0('0x8')](findById(_0x2f8924[_0xb5c0('0x1b')]['id']))[_0xb5c0('0x8')](respondWithResult(_0x39c8b2,null))[_0xb5c0('0xc')](handleError(_0x39c8b2,null));};exports[_0xb5c0('0x1f')]=function(_0x5efab5,_0x5249ca){return respondWithRpcPromise(_0xb5c0('0x20'),_[_0xb5c0('0x18')](_0x5efab5[_0xb5c0('0x21')],_0x5efab5[_0xb5c0('0x1b')]))[_0xb5c0('0x8')](respondWithResult(_0x5249ca,null))[_0xb5c0('0xc')](handleError(_0x5249ca,null));};exports['voiceQueuesPreview']=function(_0x4eba1b,_0x44a54e){return respondWithRpcPromise(_0xb5c0('0x22'),_[_0xb5c0('0x18')](_0x4eba1b[_0xb5c0('0x16')],_0x4eba1b[_0xb5c0('0x1b')]))[_0xb5c0('0x8')](respondWithResult(_0x44a54e,null))[_0xb5c0('0xc')](handleError(_0x44a54e,null));};exports['voiceQueuesChannels']=function(_0x46c511,_0xa2e4d4){return respondWithRpcPromise('VoiceQueuesChannels',_0x46c511[_0xb5c0('0x16')])[_0xb5c0('0x8')](respondWithResult(_0xa2e4d4,null))[_0xb5c0('0xc')](handleError(_0xa2e4d4,null));};exports[_0xb5c0('0x23')]=function(_0x2938b1,_0xafbe47){return respondWithRpcPromise('VoiceQueuesChannel',_['merge'](_0x2938b1[_0xb5c0('0x16')],_0x2938b1[_0xb5c0('0x1b')]))[_0xb5c0('0x8')](respondWithResult(_0xafbe47,null))[_0xb5c0('0xc')](handleError(_0xafbe47,null));};exports[_0xb5c0('0x24')]=function(_0x1a1aab,_0x98a2f){return respondWithRpcPromise(_0xb5c0('0x25'),_[_0xb5c0('0x18')](_0x1a1aab[_0xb5c0('0x16')],_0x1a1aab['params']))[_0xb5c0('0x8')](respondWithResult(_0x98a2f,null))[_0xb5c0('0xc')](handleError(_0x98a2f,null));};exports[_0xb5c0('0x26')]=function(_0x4dbe77,_0xa86f7a){return respondWithRpcPromise('VoiceQueuesChannelRedirect',_[_0xb5c0('0x18')](_0x4dbe77['query'],_0x4dbe77[_0xb5c0('0x1b')]))['then'](respondWithResult(_0xa86f7a,null))['catch'](handleError(_0xa86f7a,null));};exports[_0xb5c0('0x27')]=function(_0x2c39a4,_0xa8a01e){return respondWithRpcPromise(_0xb5c0('0x28'),_0x2c39a4[_0xb5c0('0x16')])[_0xb5c0('0x8')](respondWithResult(_0xa8a01e,null))[_0xb5c0('0xc')](handleError(_0xa8a01e,null));};exports['outboundChannels']=function(_0x5f1cec,_0x553f25){return respondWithRpcPromise(_0xb5c0('0x29'),_0x5f1cec[_0xb5c0('0x16')])['then'](respondWithResult(_0x553f25,null))['catch'](handleError(_0x553f25,null));};exports[_0xb5c0('0x2a')]=function(_0x11873e,_0x45456b){var _0x8a7e92;return respondWithRpcPromise(_0xb5c0('0x2b'),_0x11873e[_0xb5c0('0x16')])[_0xb5c0('0x8')](function(_0x468d9f){_0x8a7e92=_0x468d9f;return respondWithRpcPromise(_0xb5c0('0x2b'),_0x11873e[_0xb5c0('0x16')],routingClient);})[_0xb5c0('0x8')](function(_0x529cdc){return _['merge']({},_0x529cdc,_0x8a7e92);})['then'](respondWithResult(_0x45456b,null))[_0xb5c0('0xc')](handleError(_0x45456b,null));};exports[_0xb5c0('0x2c')]=function(_0x12aa0a,_0x586ac0){if(_0x12aa0a[_0xb5c0('0x21')]&&_0x12aa0a[_0xb5c0('0x21')][_0xb5c0('0x2d')]&&_0x12aa0a[_0xb5c0('0x2e')]&&_0x12aa0a['user'][_0xb5c0('0xf')]){for(var _0x4a94e3 in _0x12aa0a['body']['interaction']){if(_0x12aa0a[_0xb5c0('0x21')][_0xb5c0('0x2d')]['hasOwnProperty'](_0x4a94e3)){db['MemberReport'][_0xb5c0('0x2f')]({'where':{'channel':_0x4a94e3,'membername':_0x12aa0a['user'][_0xb5c0('0xf')],'type':_0xb5c0('0x30'),'exitAt':null,'uniqueid':_0x12aa0a[_0xb5c0('0x21')]['interaction'][_0x4a94e3]&&_0x12aa0a[_0xb5c0('0x21')]['interaction'][_0x4a94e3][_0xb5c0('0x31')]?{'$notIn':_0x12aa0a[_0xb5c0('0x21')][_0xb5c0('0x2d')][_0x4a94e3]}:{'$ne':null}}})[_0xb5c0('0x8')](function(_0x380a90){var _0x19fdb9=moment()[_0xb5c0('0x32')](_0xb5c0('0x33'));for(var _0x42dc25=0x0,_0x26263e=_0x380a90[_0xb5c0('0x31')];_0x42dc25<_0x26263e;_0x42dc25+=0x1){_0x380a90[_0x42dc25][_0xb5c0('0x34')]({'exitAt':_0x19fdb9});}});for(var _0x17d334=0x0;_0x17d334<_0x12aa0a[_0xb5c0('0x21')][_0xb5c0('0x2d')][_0x4a94e3]['length'];_0x17d334+=0x1){db[_0xb5c0('0x35')][_0xb5c0('0x36')]({'where':{'channel':_0x4a94e3,'membername':_0x12aa0a[_0xb5c0('0x2e')][_0xb5c0('0xf')],'type':'INTERACTION','uniqueid':_0x12aa0a[_0xb5c0('0x21')][_0xb5c0('0x2d')][_0x4a94e3][_0x17d334],'exitAt':null},'defaults':{'channel':_0x4a94e3,'membername':_0x12aa0a[_0xb5c0('0x2e')][_0xb5c0('0xf')],'interface':_[_0xb5c0('0x12')](_0x12aa0a[_0xb5c0('0x2e')][_0xb5c0('0x37')])?util[_0xb5c0('0x32')](_0xb5c0('0x38'),_0x12aa0a['user'][_0xb5c0('0xf')]):_0x12aa0a[_0xb5c0('0x2e')][_0xb5c0('0x37')],'type':_0xb5c0('0x30'),'enterAt':moment()['format'](_0xb5c0('0x33')),'role':_0xb5c0('0x39'),'internal':_0x12aa0a[_0xb5c0('0x2e')][_0xb5c0('0x3a')],'uniqueid':_0x12aa0a['body'][_0xb5c0('0x2d')][_0x4a94e3][_0x17d334]}});}}}}return respondWithRpcPromise('AgentCapacity',{'id':_0x12aa0a['params']['id'],'capacity':_0x12aa0a[_0xb5c0('0x21')][_0xb5c0('0x3b')]},routingClient)['then'](respondWithResult(_0x586ac0,null))['catch'](handleError(_0x586ac0,null));};exports[_0xb5c0('0x3c')]=function(_0x4733ef,_0x1f37c5){return respondWithRpcPromise('Telephones',_0x4733ef[_0xb5c0('0x16')])[_0xb5c0('0x8')](respondWithResult(_0x1f37c5,null))['catch'](handleError(_0x1f37c5,null));};exports['trunks']=function(_0x2a1796,_0x13f021){return respondWithRpcPromise(_0xb5c0('0x3d'),_0x2a1796['query'])[_0xb5c0('0x8')](respondWithResult(_0x13f021,null))['catch'](handleError(_0x13f021,null));};exports['campaigns']=function(_0x3e226e,_0x3eaef6){return respondWithRpcPromise(_0xb5c0('0x3e'),_0x3e226e['query'])[_0xb5c0('0x8')](respondWithResult(_0x3eaef6,null))[_0xb5c0('0xc')](handleError(_0x3eaef6,null));};exports[_0xb5c0('0x3f')]=function(_0x2faeee,_0x5b3b15){return respondWithRpcPromise(_0xb5c0('0x40'),_0x2faeee[_0xb5c0('0x16')],routingClient)[_0xb5c0('0x8')](respondWithResult(_0x5b3b15,null))[_0xb5c0('0xc')](handleError(_0x5b3b15,null));};exports['showChatQueues']=function(_0x3212d5,_0x4cc9b3){return respondWithRpcPromise(_0xb5c0('0x40'),_0x3212d5['query'],routingClient)[_0xb5c0('0x8')](findById(_0x3212d5[_0xb5c0('0x1b')]['id']))[_0xb5c0('0x8')](respondWithResult(_0x4cc9b3,null))[_0xb5c0('0xc')](handleError(_0x4cc9b3,null));};exports[_0xb5c0('0x41')]=function(_0x37b0ad,_0x153566){return respondWithRpcPromise(_0xb5c0('0x42'),_0x37b0ad[_0xb5c0('0x16')],routingClient)[_0xb5c0('0x8')](respondWithResult(_0x153566,null))['catch'](handleError(_0x153566,null));};exports[_0xb5c0('0x43')]=function(_0x10ba77,_0xcee7fd){return respondWithRpcPromise('MailQueues',_0x10ba77[_0xb5c0('0x16')],routingClient)[_0xb5c0('0x8')](findById(_0x10ba77[_0xb5c0('0x1b')]['id']))[_0xb5c0('0x8')](respondWithResult(_0xcee7fd,null))[_0xb5c0('0xc')](handleError(_0xcee7fd,null));};exports[_0xb5c0('0x44')]=function(_0x3a8d32,_0x1cba56){return respondWithRpcPromise(_0xb5c0('0x45'),_0x3a8d32[_0xb5c0('0x16')],mailClient)[_0xb5c0('0x8')](respondWithResult(_0x1cba56,null))[_0xb5c0('0xc')](handleError(_0x1cba56,null));};exports[_0xb5c0('0x46')]=function(_0x19086b,_0x2df3f3){return respondWithRpcPromise(_0xb5c0('0x47'),_0x19086b['query'],routingClient)[_0xb5c0('0x8')](respondWithResult(_0x2df3f3,null))['catch'](handleError(_0x2df3f3,null));};exports[_0xb5c0('0x48')]=function(_0x50b8d5,_0x1da3c7){return respondWithRpcPromise('OpenchannelQueues',_0x50b8d5[_0xb5c0('0x16')],routingClient)[_0xb5c0('0x8')](findById(_0x50b8d5['params']['id']))[_0xb5c0('0x8')](respondWithResult(_0x1da3c7,null))[_0xb5c0('0xc')](handleError(_0x1da3c7,null));};exports['smsQueues']=function(_0x29017c,_0x5c5ca3){return respondWithRpcPromise(_0xb5c0('0x49'),_0x29017c[_0xb5c0('0x16')],routingClient)[_0xb5c0('0x8')](respondWithResult(_0x5c5ca3,null))[_0xb5c0('0xc')](handleError(_0x5c5ca3,null));};exports[_0xb5c0('0x4a')]=function(_0x46d852,_0xde46a9){return respondWithRpcPromise('SmsQueues',_0x46d852[_0xb5c0('0x16')],routingClient)['then'](findById(_0x46d852[_0xb5c0('0x1b')]['id']))[_0xb5c0('0x8')](respondWithResult(_0xde46a9,null))[_0xb5c0('0xc')](handleError(_0xde46a9,null));};exports['whatsappQueues']=function(_0x5887eb,_0x5000e4){return respondWithRpcPromise(_0xb5c0('0x4b'),_0x5887eb[_0xb5c0('0x16')],routingClient)[_0xb5c0('0x8')](respondWithResult(_0x5000e4,null))['catch'](handleError(_0x5000e4,null));};exports[_0xb5c0('0x4c')]=function(_0x30d578,_0x564239){return respondWithRpcPromise(_0xb5c0('0x4b'),_0x30d578[_0xb5c0('0x16')],routingClient)[_0xb5c0('0x8')](findById(_0x30d578[_0xb5c0('0x1b')]['id']))[_0xb5c0('0x8')](respondWithResult(_0x564239,null))[_0xb5c0('0xc')](handleError(_0x564239,null));};exports[_0xb5c0('0x4d')]=function(_0x48166a,_0x181d53){return respondWithRpcPromise('FaxQueues',_0x48166a[_0xb5c0('0x16')],routingClient)[_0xb5c0('0x8')](respondWithResult(_0x181d53,null))[_0xb5c0('0xc')](handleError(_0x181d53,null));};exports['showFaxQueues']=function(_0x2e176d,_0x5eda26){return respondWithRpcPromise(_0xb5c0('0x4e'),_0x2e176d[_0xb5c0('0x16')],routingClient)['then'](findById(_0x2e176d[_0xb5c0('0x1b')]['id']))['then'](respondWithResult(_0x5eda26,null))[_0xb5c0('0xc')](handleError(_0x5eda26,null));};exports[_0xb5c0('0x4f')]=function(_0xdda242,_0x53a045){return respondWithRpcPromise(_0xb5c0('0x50'),_0xdda242[_0xb5c0('0x16')])[_0xb5c0('0x8')](respondWithResult(_0x53a045,null))[_0xb5c0('0xc')](handleError(_0x53a045,null));};exports[_0xb5c0('0x51')]=function(_0x56dd55,_0x5f175a){return respondWithRpcPromise(_0xb5c0('0x52'),_0x56dd55[_0xb5c0('0x16')],routingClient)[_0xb5c0('0x8')](respondWithResult(_0x5f175a,null))[_0xb5c0('0xc')](handleError(_0x5f175a,null));};exports[_0xb5c0('0x53')]=function(_0x56d830,_0x535eda){return respondWithRpcPromise(_0xb5c0('0x54'),_0x56d830[_0xb5c0('0x16')],routingClient)[_0xb5c0('0x8')](respondWithResult(_0x535eda,null))[_0xb5c0('0xc')](handleError(_0x535eda,null));};exports[_0xb5c0('0x55')]=function(_0x123efa,_0x15bda6){return respondWithRpcPromise(_0xb5c0('0x56'),_0x123efa[_0xb5c0('0x16')],routingClient)[_0xb5c0('0x8')](respondWithResult(_0x15bda6,null))[_0xb5c0('0xc')](handleError(_0x15bda6,null));};exports[_0xb5c0('0x57')]=function(_0x32a50e,_0x19134d){return respondWithRpcPromise(_0xb5c0('0x56'),_0x32a50e[_0xb5c0('0x16')],routingClient)[_0xb5c0('0x8')](function(_0x5899d7){if(_0x32a50e['query'][_0xb5c0('0x58')]!==undefined){var _0x410740=_(_0x5899d7['rows'])[_0xb5c0('0x59')]([_0x32a50e['query'][_0xb5c0('0x58')],_0x32a50e[_0xb5c0('0x1b')]['id']])[_0xb5c0('0x5a')]('queue_id')[_0xb5c0('0x5b')]()[_0xb5c0('0x5c')]();return _0x5899d7['rows']['filter'](function(_0x2c17f4){return _0x410740['indexOf'](_0x2c17f4[_0xb5c0('0x5d')])>-0x1;});}else{return _0x5899d7['rows'][_0xb5c0('0x59')](function(_0x4893c6){return _0x4893c6[_0xb5c0('0x5d')]===parseInt(_0x32a50e[_0xb5c0('0x1b')]['id']);});}})['then'](respondWithResult(_0x19134d,null))[_0xb5c0('0xc')](handleError(_0x19134d,null));};exports[_0xb5c0('0x5e')]=function(_0x306b7d,_0x52ff9d){return respondWithRpcPromise(_0xb5c0('0x5f'),_0x306b7d[_0xb5c0('0x16')],routingClient)[_0xb5c0('0x8')](respondWithResult(_0x52ff9d,null))['catch'](handleError(_0x52ff9d,null));};exports['whatsappQueuesWaitingInteractions']=function(_0x28e68d,_0xb57608){return respondWithRpcPromise('WhatsappQueuesWaitingInteractions',_0x28e68d['query'],routingClient)[_0xb5c0('0x8')](respondWithResult(_0xb57608,null))[_0xb5c0('0xc')](handleError(_0xb57608,null));};exports['faxQueuesWaitingInteractions']=function(_0x31f19f,_0xda18d3){return respondWithRpcPromise(_0xb5c0('0x60'),_0x31f19f[_0xb5c0('0x16')],routingClient)[_0xb5c0('0x8')](respondWithResult(_0xda18d3,null))['catch'](handleError(_0xda18d3,null));};exports[_0xb5c0('0x61')]=function(_0x2a543c){return function(_0x173efa,_0x5694e6){var _0xbf64e4,_0x57eedf;var _0x406ff6=_['capitalize'](_0x2a543c);var _0x186fc0=_0x2a543c===_0xb5c0('0x62')?_0xb5c0('0x63'):'Account';return db[_0x406ff6+'Queue'][_0xb5c0('0x64')]({'raw':!![],'where':{'id':_0x173efa['params']['id']}})['then'](function(_0x494c2e){if(_['isNil'](_0x494c2e)){throw new Error(_0x406ff6+'\x20Queue\x20not\x20found');}_0xbf64e4=_0x494c2e;return db[_0x406ff6+_0xb5c0('0x65')][_0xb5c0('0x64')]({'where':{'id':_0x173efa[_0xb5c0('0x21')]['messageId']},'include':[{'model':db[_0x406ff6+_0xb5c0('0x66')],'as':_0xb5c0('0x66')},{'model':db[_0x406ff6+_0x186fc0],'as':_0xb5c0('0x67')}]});})[_0xb5c0('0x8')](function(_0x17e31e){if(_['isNil'](_0x17e31e)){throw new Error(_0x406ff6+_0xb5c0('0x68'));}_0x57eedf=_0x17e31e;return _0x17e31e[_0xb5c0('0x69')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0xd0be81={'uniqueid':_0x2a543c+'.'+_0x57eedf['id']+'.'+_0x57eedf[_0xb5c0('0x66')]['id'],'FromUserId':_0x173efa[_0xb5c0('0x2e')]['id'],'type':'queue'};_0xd0be81[_0x406ff6+_0xb5c0('0x6a')]=_0x57eedf['id'];_0xd0be81[_0x406ff6+_0xb5c0('0x6b')]=_0x57eedf[_0xb5c0('0x66')]['id'];_0xd0be81['From'+_0x406ff6+_0x186fc0+'Id']=_0x57eedf[_0xb5c0('0x67')]['id'];_0xd0be81['To'+_0x406ff6+'QueueId']=_0xbf64e4['id'];return db[_0x406ff6+_0xb5c0('0x6c')][_0xb5c0('0x6d')](_0xd0be81);})['then'](function(){return respondWithRpcPromise(_0xb5c0('0x6e'),{'channel':_0x2a543c,'interaction':_0x57eedf['Interaction'],'message':_0x57eedf,'account':_0x57eedf[_0xb5c0('0x67')],'applications':[{'id':0x0,'priority':0x1,'app':_0xb5c0('0x6f'),'appdata':_0xbf64e4[_0xb5c0('0xf')]+','+(_0x57eedf[_0xb5c0('0x67')][_0xb5c0('0x70')]||0x12c),'interval':_0xb5c0('0x71')}]},routingClient);})[_0xb5c0('0x8')](respondWithResult(_0x5694e6,null))[_0xb5c0('0xc')](handleError(_0x5694e6,null));};};exports['agentNotify']=function(_0x549f28,_0x46d68a){var _0x2873b7,_0x3d8dea;if(_[_0xb5c0('0x12')](_0x549f28[_0xb5c0('0x21')][_0xb5c0('0x72')])){throw new Error(_0xb5c0('0x73'));}var _0x36d6c0=_0x549f28[_0xb5c0('0x21')][_0xb5c0('0x72')];var _0x538184=_[_0xb5c0('0x74')](_0x36d6c0);var _0x211913=_0x36d6c0===_0xb5c0('0x62')?_0xb5c0('0x63'):_0xb5c0('0x67');return db[_0xb5c0('0x75')][_0xb5c0('0x64')]({'raw':!![],'where':{'id':_0x549f28[_0xb5c0('0x1b')]['id'],'role':'agent'}})[_0xb5c0('0x8')](function(_0x25848c){if(_['isNil'](_0x25848c)){throw new Error(_0xb5c0('0x76'));}_0x2873b7=_0x25848c;return db[_0x538184+_0xb5c0('0x65')][_0xb5c0('0x64')]({'where':{'id':_0x549f28[_0xb5c0('0x21')][_0xb5c0('0x77')]},'include':[{'model':db[_0x538184+_0xb5c0('0x66')],'as':_0xb5c0('0x66')},{'model':db[_0x538184+_0x211913],'as':_0xb5c0('0x67')}]});})[_0xb5c0('0x8')](function(_0x5e71a6){if(_[_0xb5c0('0x12')](_0x5e71a6)){throw new Error(_0x538184+'\x20Message\x20not\x20found');}_0x3d8dea=_0x5e71a6;return _0x5e71a6['update']({'read':0x0,'readAt':null,'UserId':null});})[_0xb5c0('0x8')](function(){var _0x354994={'uniqueid':_0x36d6c0+'.'+_0x3d8dea['id']+'.'+_0x3d8dea[_0xb5c0('0x66')]['id'],'FromUserId':_0x549f28['user']['id'],'type':_0xb5c0('0x39'),'ToUserId':_0x2873b7['id']};_0x354994[_0x538184+_0xb5c0('0x6a')]=_0x3d8dea['id'];_0x354994[_0x538184+_0xb5c0('0x6b')]=_0x3d8dea[_0xb5c0('0x66')]['id'];_0x354994[_0xb5c0('0x78')+_0x538184+_0x211913+'Id']=_0x3d8dea['Account']['id'];return db[_0x538184+'TransferReport']['create'](_0x354994);})[_0xb5c0('0x8')](function(){return respondWithRpcPromise(_0xb5c0('0x6e'),{'channel':_0x36d6c0,'interaction':_0x3d8dea[_0xb5c0('0x66')],'message':_0x3d8dea,'account':_0x3d8dea[_0xb5c0('0x67')],'applications':[{'id':0x0,'priority':0x1,'app':_0xb5c0('0x39'),'appdata':_0x2873b7[_0xb5c0('0xf')]+','+(_0x3d8dea['Account'][_0xb5c0('0x79')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0xb5c0('0x8')](respondWithResult(_0x46d68a,null))[_0xb5c0('0xc')](handleError(_0x46d68a,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(_0x1a2fd2,_0x3904df){var _0x476ad5=function(_0x5681a5){while(--_0x5681a5){_0x1a2fd2['push'](_0x1a2fd2['shift']());}};_0x476ad5(++_0x3904df);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'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 7cc76df..09373c1 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 _0xd637=['get','run','post','create','update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./schedule.controller','/:id','isAuthenticated','show'];(function(_0x990d10,_0x1256fe){var _0x5602bb=function(_0x1f758a){while(--_0x1f758a){_0x990d10['push'](_0x990d10['shift']());}};_0x5602bb(++_0x1256fe);}(_0xd637,0x111));var _0x7d63=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xd637[_0x3ab51d];return _0x29a04e;};'use strict';var multer=require(_0x7d63('0x0'));var util=require(_0x7d63('0x1'));var path=require('path');var timeout=require(_0x7d63('0x2'));var express=require(_0x7d63('0x3'));var router=express[_0x7d63('0x4')]();var fs_extra=require(_0x7d63('0x5'));var auth=require(_0x7d63('0x6'));var interaction=require(_0x7d63('0x7'));var config=require('../../config/environment');var controller=require(_0x7d63('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x7d63('0x9'),auth[_0x7d63('0xa')](),controller[_0x7d63('0xb')]);router[_0x7d63('0xc')]('/:id/run',auth['isAuthenticated'](),controller[_0x7d63('0xd')]);router[_0x7d63('0xe')]('/',auth[_0x7d63('0xa')](),controller[_0x7d63('0xf')]);router['put'](_0x7d63('0x9'),auth['isAuthenticated'](),controller[_0x7d63('0x10')]);router[_0x7d63('0x11')]('/:id',auth[_0x7d63('0xa')](),controller['destroy']);module[_0x7d63('0x12')]=router; \ No newline at end of file +var _0x3436=['delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./schedule.controller','get','isAuthenticated','index','/:id','show','/:id/run','run','post','put','update'];(function(_0x2de020,_0x252df0){var _0x182b7c=function(_0xcbcdaa){while(--_0xcbcdaa){_0x2de020['push'](_0x2de020['shift']());}};_0x182b7c(++_0x252df0);}(_0x3436,0x9d));var _0x6343=function(_0x1ff13d,_0x4d60fd){_0x1ff13d=_0x1ff13d-0x0;var _0x1c7b2b=_0x3436[_0x1ff13d];return _0x1c7b2b;};'use strict';var multer=require(_0x6343('0x0'));var util=require(_0x6343('0x1'));var path=require('path');var timeout=require(_0x6343('0x2'));var express=require(_0x6343('0x3'));var router=express[_0x6343('0x4')]();var fs_extra=require(_0x6343('0x5'));var auth=require(_0x6343('0x6'));var interaction=require(_0x6343('0x7'));var config=require('../../config/environment');var controller=require(_0x6343('0x8'));router[_0x6343('0x9')]('/',auth[_0x6343('0xa')](),controller[_0x6343('0xb')]);router['get'](_0x6343('0xc'),auth[_0x6343('0xa')](),controller[_0x6343('0xd')]);router[_0x6343('0x9')](_0x6343('0xe'),auth['isAuthenticated'](),controller[_0x6343('0xf')]);router[_0x6343('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0x6343('0x11')](_0x6343('0xc'),auth[_0x6343('0xa')](),controller[_0x6343('0x12')]);router[_0x6343('0x13')](_0x6343('0xc'),auth['isAuthenticated'](),controller[_0x6343('0x14')]);module[_0x6343('0x15')]=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index 41c8cf8..f9780e9 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 _0x5fd7=['default','TEXT','sequelize','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','INTEGER','years','months','weeks','minutes','days','xlsx','csv','ENUM','custom'];(function(_0x4a0e68,_0x45c08c){var _0x4fb274=function(_0x5f36b1){while(--_0x5f36b1){_0x4a0e68['push'](_0x4a0e68['shift']());}};_0x4fb274(++_0x45c08c);}(_0x5fd7,0x18e));var _0x75fd=function(_0x13f409,_0x34ec12){_0x13f409=_0x13f409-0x0;var _0x4560da=_0x5fd7[_0x13f409];return _0x4560da;};'use strict';var Sequelize=require(_0x75fd('0x0'));module[_0x75fd('0x1')]={'name':{'type':Sequelize[_0x75fd('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x75fd('0x2')]},'active':{'type':Sequelize[_0x75fd('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x75fd('0x2')],'allowNull':![],'defaultValue':_0x75fd('0x4')},'startAt':{'type':Sequelize['DATE'],'allowNull':![]},'endAt':{'type':Sequelize[_0x75fd('0x5')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x75fd('0x6')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize['ENUM'](_0x75fd('0x7'),'quarters',_0x75fd('0x8'),_0x75fd('0x9'),'days','hours',_0x75fd('0xa')),'allowNull':![],'defaultValue':_0x75fd('0xb')},'output':{'type':Sequelize['ENUM']('csv','pdf',_0x75fd('0xc')),'allowNull':![],'defaultValue':_0x75fd('0xd')},'type':{'type':Sequelize[_0x75fd('0xe')](_0x75fd('0xf'),_0x75fd('0x10')),'allowNull':![],'defaultValue':_0x75fd('0xf')},'sendMail':{'type':Sequelize[_0x75fd('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x75fd('0x2')]},'cc':{'type':Sequelize[_0x75fd('0x11')]},'bcc':{'type':Sequelize['TEXT']},'sendIfEmpty':{'type':Sequelize[_0x75fd('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0xbfc4=['default','TEXT','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','years','months','weeks','days','hours','minutes','csv','pdf','xlsx','ENUM','custom'];(function(_0x2b42e5,_0x4e3dbf){var _0x2c4fb5=function(_0x4aa621){while(--_0x4aa621){_0x2b42e5['push'](_0x2b42e5['shift']());}};_0x2c4fb5(++_0x4e3dbf);}(_0xbfc4,0x1de));var _0x4bfc=function(_0x363390,_0x14dc6d){_0x363390=_0x363390-0x0;var _0x5a94b4=_0xbfc4[_0x363390];return _0x5a94b4;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x4bfc('0x0')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x4bfc('0x1')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x4bfc('0x2')},'startAt':{'type':Sequelize[_0x4bfc('0x3')],'allowNull':![]},'endAt':{'type':Sequelize[_0x4bfc('0x3')],'allowNull':![]},'subtractNumber':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize['ENUM'](_0x4bfc('0x4'),'quarters',_0x4bfc('0x5'),_0x4bfc('0x6'),_0x4bfc('0x7'),_0x4bfc('0x8'),_0x4bfc('0x9')),'allowNull':![],'defaultValue':_0x4bfc('0x7')},'output':{'type':Sequelize['ENUM'](_0x4bfc('0xa'),_0x4bfc('0xb'),_0x4bfc('0xc')),'allowNull':![],'defaultValue':'csv'},'type':{'type':Sequelize[_0x4bfc('0xd')](_0x4bfc('0xe'),_0x4bfc('0xf')),'allowNull':![],'defaultValue':_0x4bfc('0xe')},'sendMail':{'type':Sequelize[_0x4bfc('0x1')],'defaultValue':![]},'email':{'type':Sequelize[_0x4bfc('0x0')]},'cc':{'type':Sequelize[_0x4bfc('0x10')]},'bcc':{'type':Sequelize[_0x4bfc('0x10')]},'sendIfEmpty':{'type':Sequelize[_0x4bfc('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 3760a00..df04e96 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 _0x512f=['ioredis','../../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','reject','then','get','UserProfileResource','end','error','stack','name','send','index','map','Schedule','fieldName','model','query','keys','filters','attributes','intersection','fields','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','rawAttributes','find','body','role','user','Scheduler','userProfileId','autoAssociation','create','update','params','destroy','run','../../config/schedule','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x5ed4e5,_0x1ee795){var _0x58ca33=function(_0x20a47b){while(--_0x20a47b){_0x5ed4e5['push'](_0x5ed4e5['shift']());}};_0x58ca33(++_0x1ee795);}(_0x512f,0x134));var _0xf512=function(_0x4f75b5,_0x4db76d){_0x4f75b5=_0x4f75b5-0x0;var _0x5c263b=_0x512f[_0x4f75b5];return _0x5c263b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf512('0x0'));var zipdir=require(_0xf512('0x1'));var jsonpatch=require(_0xf512('0x2'));var rp=require(_0xf512('0x3'));var moment=require('moment');var BPromise=require(_0xf512('0x4'));var Mustache=require(_0xf512('0x5'));var util=require(_0xf512('0x6'));var path=require('path');var sox=require(_0xf512('0x7'));var csv=require(_0xf512('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf512('0x9'));var _=require(_0xf512('0xa'));var squel=require('squel');var crypto=require(_0xf512('0xb'));var jsforce=require(_0xf512('0xc'));var deskjs=require(_0xf512('0xd'));var toCsv=require(_0xf512('0x8'));var querystring=require(_0xf512('0xe'));var Papa=require(_0xf512('0xf'));var Redis=require(_0xf512('0x10'));var authService=require(_0xf512('0x11'));var qs=require(_0xf512('0x12'));var as=require(_0xf512('0x13'));var hardwareService=require(_0xf512('0x14'));var logger=require('../../config/logger')(_0xf512('0x15'));var utils=require('../../config/utils');var config=require(_0xf512('0x16'));var licenseUtil=require(_0xf512('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3fba2f,_0x3f6d75){_0x3f6d75=_0x3f6d75||0xcc;return function(_0xf2be4){if(_0xf2be4){return _0x3fba2f[_0xf512('0x18')](_0x3f6d75);}return _0x3fba2f[_0xf512('0x19')](_0x3f6d75)['end']();};}function respondWithResult(_0x4fb2af,_0x20973f){_0x20973f=_0x20973f||0xc8;return function(_0xef66a2){if(_0xef66a2){return _0x4fb2af[_0xf512('0x19')](_0x20973f)[_0xf512('0x1a')](_0xef66a2);}};}function respondWithFilteredResult(_0x39b858,_0x3f204d){return function(_0x7fd413){if(_0x7fd413){var _0x33e9a5=typeof _0x3f204d[_0xf512('0x1b')]===_0xf512('0x1c')&&typeof _0x3f204d[_0xf512('0x1d')]===_0xf512('0x1c');var _0x3e06e4=_0x7fd413['count'];var _0x5ee41e=_0x33e9a5?0x0:_0x3f204d['offset'];var _0x503e4b=_0x33e9a5?_0x7fd413[_0xf512('0x1e')]:_0x3f204d[_0xf512('0x1b')]+_0x3f204d['limit'];var _0x3de6df;if(_0x503e4b>=_0x3e06e4){_0x503e4b=_0x3e06e4;_0x3de6df=0xc8;}else{_0x3de6df=0xce;}_0x39b858[_0xf512('0x19')](_0x3de6df);return _0x39b858[_0xf512('0x1f')]('Content-Range',_0x5ee41e+'-'+_0x503e4b+'/'+_0x3e06e4)['json'](_0x7fd413);}return null;};}function patchUpdates(_0x33a5e2){return function(_0xa5ec7a){try{jsonpatch[_0xf512('0x20')](_0xa5ec7a,_0x33a5e2,!![]);}catch(_0x27c63c){return BPromise[_0xf512('0x21')](_0x27c63c);}return _0xa5ec7a['save']();};}function saveUpdates(_0xc74a61,_0x25f989){return function(_0x280e48){if(_0x280e48){return _0x280e48['update'](_0xc74a61)[_0xf512('0x22')](function(_0x13d057){return _0x13d057;});}return null;};}function removeEntity(_0x39d7c9,_0x2f0ba4){return function(_0x354a11){if(_0x354a11){return _0x354a11['destroy']()[_0xf512('0x22')](function(){var _0x25052e=_0x354a11[_0xf512('0x23')]({'plain':!![]});var _0x501fda='Scheduler';return db[_0xf512('0x24')]['destroy']({'where':{'type':_0x501fda,'resourceId':_0x25052e['id']}})[_0xf512('0x22')](function(){return _0x354a11;});})[_0xf512('0x22')](function(){_0x39d7c9[_0xf512('0x19')](0xcc)[_0xf512('0x25')]();});}};}function handleEntityNotFound(_0x30c4f8,_0x470478){return function(_0x6f25cc){if(!_0x6f25cc){_0x30c4f8[_0xf512('0x18')](0x194);}return _0x6f25cc;};}function handleError(_0x1c7059,_0x3e34b3){_0x3e34b3=_0x3e34b3||0x1f4;return function(_0x530c7a){logger[_0xf512('0x26')](_0x530c7a[_0xf512('0x27')]);if(_0x530c7a['name']){delete _0x530c7a[_0xf512('0x28')];}_0x1c7059[_0xf512('0x19')](_0x3e34b3)[_0xf512('0x29')](_0x530c7a);};}exports[_0xf512('0x2a')]=function(_0x2bdca4,_0x3c3d88){var _0x57e300={},_0x11ff69={},_0x4f038e={'count':0x0,'rows':[]};var _0x55cb0e=_[_0xf512('0x2b')](db[_0xf512('0x2c')]['rawAttributes'],function(_0x111eb7){return{'name':_0x111eb7[_0xf512('0x2d')],'type':_0x111eb7['type']['key']};});_0x11ff69[_0xf512('0x2e')]=_[_0xf512('0x2b')](_0x55cb0e,_0xf512('0x28'));_0x11ff69[_0xf512('0x2f')]=_[_0xf512('0x30')](_0x2bdca4[_0xf512('0x2f')]);_0x11ff69[_0xf512('0x31')]=_['intersection'](_0x11ff69[_0xf512('0x2e')],_0x11ff69[_0xf512('0x2f')]);_0x57e300[_0xf512('0x32')]=_[_0xf512('0x33')](_0x11ff69[_0xf512('0x2e')],qs[_0xf512('0x34')](_0x2bdca4[_0xf512('0x2f')][_0xf512('0x34')]));_0x57e300[_0xf512('0x32')]=_0x57e300[_0xf512('0x32')]['length']?_0x57e300['attributes']:_0x11ff69['model'];if(!_0x2bdca4['query']['hasOwnProperty']('nolimit')){_0x57e300['limit']=qs[_0xf512('0x1d')](_0x2bdca4['query'][_0xf512('0x1d')]);_0x57e300[_0xf512('0x1b')]=qs[_0xf512('0x1b')](_0x2bdca4[_0xf512('0x2f')][_0xf512('0x1b')]);}_0x57e300[_0xf512('0x35')]=qs['sort'](_0x2bdca4[_0xf512('0x2f')][_0xf512('0x36')]);_0x57e300[_0xf512('0x37')]=qs[_0xf512('0x31')](_['pick'](_0x2bdca4[_0xf512('0x2f')],_0x11ff69[_0xf512('0x31')]),_0x55cb0e);if(_0x2bdca4[_0xf512('0x2f')][_0xf512('0x38')]){_0x57e300['where']=_[_0xf512('0x39')](_0x57e300[_0xf512('0x37')],{'$or':_[_0xf512('0x2b')](_0x55cb0e,function(_0x31cc0b){if(_0x31cc0b[_0xf512('0x3a')]!==_0xf512('0x3b')){var _0x549d26={};_0x549d26[_0x31cc0b['name']]={'$like':'%'+_0x2bdca4[_0xf512('0x2f')]['filter']+'%'};return _0x549d26;}})});}_0x57e300=_[_0xf512('0x39')]({},_0x57e300,_0x2bdca4[_0xf512('0x3c')]);var _0x104f48={'where':_0x57e300[_0xf512('0x37')]};return db['Schedule'][_0xf512('0x1e')](_0x104f48)[_0xf512('0x22')](function(_0x277be4){_0x4f038e['count']=_0x277be4;if(_0x2bdca4[_0xf512('0x2f')][_0xf512('0x3d')]){_0x57e300[_0xf512('0x3e')]=[{'all':!![]}];}return db[_0xf512('0x2c')][_0xf512('0x3f')](_0x57e300);})[_0xf512('0x22')](function(_0xc13fab){_0x4f038e[_0xf512('0x40')]=_0xc13fab;return _0x4f038e;})[_0xf512('0x22')](respondWithFilteredResult(_0x3c3d88,_0x57e300))[_0xf512('0x41')](handleError(_0x3c3d88,null));};exports[_0xf512('0x42')]=function(_0xf595b7,_0x48376b){var _0x1ad310={'raw':![],'where':{'id':_0xf595b7['params']['id']}},_0x5225aa={};_0x5225aa['model']=_[_0xf512('0x30')](db[_0xf512('0x2c')][_0xf512('0x43')]);_0x5225aa['query']=_[_0xf512('0x30')](_0xf595b7[_0xf512('0x2f')]);_0x5225aa[_0xf512('0x31')]=_[_0xf512('0x33')](_0x5225aa[_0xf512('0x2e')],_0x5225aa[_0xf512('0x2f')]);_0x1ad310['attributes']=_[_0xf512('0x33')](_0x5225aa[_0xf512('0x2e')],qs[_0xf512('0x34')](_0xf595b7['query']['fields']));_0x1ad310[_0xf512('0x32')]=_0x1ad310['attributes']['length']?_0x1ad310[_0xf512('0x32')]:_0x5225aa[_0xf512('0x2e')];if(_0xf595b7[_0xf512('0x2f')][_0xf512('0x3d')]){_0x1ad310[_0xf512('0x3e')]=[{'all':!![]}];}_0x1ad310=_[_0xf512('0x39')]({},_0x1ad310,_0xf595b7[_0xf512('0x3c')]);return db[_0xf512('0x2c')][_0xf512('0x44')](_0x1ad310)[_0xf512('0x22')](handleEntityNotFound(_0x48376b,null))[_0xf512('0x22')](respondWithResult(_0x48376b,null))['catch'](handleError(_0x48376b,null));};exports['create']=function(_0x9593dc,_0x16aea2){return db[_0xf512('0x2c')]['create'](_0x9593dc[_0xf512('0x45')],{})['then'](function(_0x3377c7){var _0x94267e=_0x9593dc['user'][_0xf512('0x23')]({'plain':!![]});if(!_0x94267e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x94267e[_0xf512('0x46')]===_0xf512('0x47')){var _0x3baf9e=_0x3377c7[_0xf512('0x23')]({'plain':!![]});var _0x95c95a=_0xf512('0x48');return db['UserProfileSection'][_0xf512('0x44')]({'where':{'name':_0x95c95a,'userProfileId':_0x94267e[_0xf512('0x49')]},'raw':!![]})[_0xf512('0x22')](function(_0x14a82a){if(_0x14a82a&&_0x14a82a[_0xf512('0x4a')]===0x0){return db[_0xf512('0x24')][_0xf512('0x4b')]({'name':_0x3baf9e[_0xf512('0x28')],'resourceId':_0x3baf9e['id'],'type':_0x14a82a[_0xf512('0x28')],'sectionId':_0x14a82a['id']},{})['then'](function(){return _0x3377c7;});}else{return _0x3377c7;}})[_0xf512('0x41')](function(_0x1f0ef7){logger[_0xf512('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1f0ef7);throw _0x1f0ef7;});}return _0x3377c7;})[_0xf512('0x22')](respondWithResult(_0x16aea2,0xc9))[_0xf512('0x41')](handleError(_0x16aea2,null));};exports[_0xf512('0x4c')]=function(_0x754628,_0x5a9082){if(_0x754628[_0xf512('0x45')]['id']){delete _0x754628[_0xf512('0x45')]['id'];}return db[_0xf512('0x2c')][_0xf512('0x44')]({'where':{'id':_0x754628[_0xf512('0x4d')]['id']}})[_0xf512('0x22')](handleEntityNotFound(_0x5a9082,null))[_0xf512('0x22')](saveUpdates(_0x754628[_0xf512('0x45')],null))['then'](respondWithResult(_0x5a9082,null))['catch'](handleError(_0x5a9082,null));};exports[_0xf512('0x4e')]=function(_0x262a36,_0x20f985){return db[_0xf512('0x2c')][_0xf512('0x44')]({'where':{'id':_0x262a36['params']['id']}})[_0xf512('0x22')](handleEntityNotFound(_0x20f985,null))[_0xf512('0x22')](removeEntity(_0x20f985,null))[_0xf512('0x41')](handleError(_0x20f985,null));};exports[_0xf512('0x4f')]=function(_0x12ecc3,_0x52d45e,_0x1c4a23){var _0x30ffaf=require(_0xf512('0x50'));return db['Schedule'][_0xf512('0x44')]({'where':{'id':_0x12ecc3[_0xf512('0x4d')]['id']},'raw':!![]})[_0xf512('0x22')](handleEntityNotFound(_0x52d45e,null))[_0xf512('0x22')](function(){_0x30ffaf[_0xf512('0x4f')](_0x12ecc3['params']['id']);})[_0xf512('0x22')](respondWithStatusCode(_0x52d45e,null))[_0xf512('0x41')](handleError(_0x52d45e,null));}; \ No newline at end of file +var _0x3ac9=['rows','show','params','keys','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','../../config/schedule','run','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','Content-Range','apply','reject','save','then','get','UserProfileResource','stack','name','index','map','Schedule','rawAttributes','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll'];(function(_0x462fe4,_0x394d3e){var _0x82b23a=function(_0x2c071f){while(--_0x2c071f){_0x462fe4['push'](_0x462fe4['shift']());}};_0x82b23a(++_0x394d3e);}(_0x3ac9,0x110));var _0x93ac=function(_0x4eee9e,_0x57aa9f){_0x4eee9e=_0x4eee9e-0x0;var _0x37bc2b=_0x3ac9[_0x4eee9e];return _0x37bc2b;};'use strict';var emlformat=require(_0x93ac('0x0'));var rimraf=require(_0x93ac('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x93ac('0x2'));var rp=require(_0x93ac('0x3'));var moment=require(_0x93ac('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x93ac('0x5'));var util=require(_0x93ac('0x6'));var path=require(_0x93ac('0x7'));var sox=require(_0x93ac('0x8'));var csv=require(_0x93ac('0x9'));var ejs=require(_0x93ac('0xa'));var fs=require('fs');var fs_extra=require(_0x93ac('0xb'));var _=require(_0x93ac('0xc'));var squel=require(_0x93ac('0xd'));var crypto=require(_0x93ac('0xe'));var jsforce=require(_0x93ac('0xf'));var deskjs=require(_0x93ac('0x10'));var toCsv=require(_0x93ac('0x9'));var querystring=require(_0x93ac('0x11'));var Papa=require(_0x93ac('0x12'));var Redis=require(_0x93ac('0x13'));var authService=require(_0x93ac('0x14'));var qs=require(_0x93ac('0x15'));var as=require(_0x93ac('0x16'));var hardwareService=require(_0x93ac('0x17'));var logger=require('../../config/logger')(_0x93ac('0x18'));var utils=require(_0x93ac('0x19'));var config=require(_0x93ac('0x1a'));var licenseUtil=require(_0x93ac('0x1b'));var db=require(_0x93ac('0x1c'))['db'];function respondWithStatusCode(_0x350415,_0x3e4349){_0x3e4349=_0x3e4349||0xcc;return function(_0x12e7a1){if(_0x12e7a1){return _0x350415[_0x93ac('0x1d')](_0x3e4349);}return _0x350415[_0x93ac('0x1e')](_0x3e4349)[_0x93ac('0x1f')]();};}function respondWithResult(_0x4b8801,_0x10fd4d){_0x10fd4d=_0x10fd4d||0xc8;return function(_0x78ba70){if(_0x78ba70){return _0x4b8801['status'](_0x10fd4d)[_0x93ac('0x20')](_0x78ba70);}};}function respondWithFilteredResult(_0x3c304a,_0x3546c8){return function(_0x864201){if(_0x864201){var _0x3e1bd4=typeof _0x3546c8[_0x93ac('0x21')]===_0x93ac('0x22')&&typeof _0x3546c8['limit']===_0x93ac('0x22');var _0x38232d=_0x864201[_0x93ac('0x23')];var _0x34c807=_0x3e1bd4?0x0:_0x3546c8[_0x93ac('0x21')];var _0x4e7272=_0x3e1bd4?_0x864201['count']:_0x3546c8[_0x93ac('0x21')]+_0x3546c8['limit'];var _0x20ac8a;if(_0x4e7272>=_0x38232d){_0x4e7272=_0x38232d;_0x20ac8a=0xc8;}else{_0x20ac8a=0xce;}_0x3c304a[_0x93ac('0x1e')](_0x20ac8a);return _0x3c304a['set'](_0x93ac('0x24'),_0x34c807+'-'+_0x4e7272+'/'+_0x38232d)[_0x93ac('0x20')](_0x864201);}return null;};}function patchUpdates(_0x52fbd7){return function(_0x43cc2c){try{jsonpatch[_0x93ac('0x25')](_0x43cc2c,_0x52fbd7,!![]);}catch(_0x225736){return BPromise[_0x93ac('0x26')](_0x225736);}return _0x43cc2c[_0x93ac('0x27')]();};}function saveUpdates(_0x37100f,_0x1fe179){return function(_0xe95fd6){if(_0xe95fd6){return _0xe95fd6['update'](_0x37100f)[_0x93ac('0x28')](function(_0x4d018a){return _0x4d018a;});}return null;};}function removeEntity(_0x58d191,_0x1cc368){return function(_0x5090a9){if(_0x5090a9){return _0x5090a9['destroy']()[_0x93ac('0x28')](function(){var _0x500096=_0x5090a9[_0x93ac('0x29')]({'plain':!![]});var _0x4b7792='Scheduler';return db[_0x93ac('0x2a')]['destroy']({'where':{'type':_0x4b7792,'resourceId':_0x500096['id']}})[_0x93ac('0x28')](function(){return _0x5090a9;});})['then'](function(){_0x58d191[_0x93ac('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x343a12,_0x3018f7){return function(_0x1f60c2){if(!_0x1f60c2){_0x343a12[_0x93ac('0x1d')](0x194);}return _0x1f60c2;};}function handleError(_0x5d01bc,_0x32705f){_0x32705f=_0x32705f||0x1f4;return function(_0x33dc56){logger['error'](_0x33dc56[_0x93ac('0x2b')]);if(_0x33dc56[_0x93ac('0x2c')]){delete _0x33dc56['name'];}_0x5d01bc[_0x93ac('0x1e')](_0x32705f)['send'](_0x33dc56);};}exports[_0x93ac('0x2d')]=function(_0x4b0adf,_0x4563e9){var _0x5a8268={},_0x28310a={},_0x18ce1e={'count':0x0,'rows':[]};var _0x3ca4e0=_[_0x93ac('0x2e')](db[_0x93ac('0x2f')][_0x93ac('0x30')],function(_0x185d9f){return{'name':_0x185d9f['fieldName'],'type':_0x185d9f[_0x93ac('0x31')]['key']};});_0x28310a[_0x93ac('0x32')]=_[_0x93ac('0x2e')](_0x3ca4e0,_0x93ac('0x2c'));_0x28310a[_0x93ac('0x33')]=_['keys'](_0x4b0adf[_0x93ac('0x33')]);_0x28310a[_0x93ac('0x34')]=_[_0x93ac('0x35')](_0x28310a[_0x93ac('0x32')],_0x28310a[_0x93ac('0x33')]);_0x5a8268[_0x93ac('0x36')]=_['intersection'](_0x28310a[_0x93ac('0x32')],qs['fields'](_0x4b0adf[_0x93ac('0x33')][_0x93ac('0x37')]));_0x5a8268[_0x93ac('0x36')]=_0x5a8268[_0x93ac('0x36')][_0x93ac('0x38')]?_0x5a8268[_0x93ac('0x36')]:_0x28310a[_0x93ac('0x32')];if(!_0x4b0adf[_0x93ac('0x33')][_0x93ac('0x39')](_0x93ac('0x3a'))){_0x5a8268['limit']=qs['limit'](_0x4b0adf[_0x93ac('0x33')]['limit']);_0x5a8268['offset']=qs[_0x93ac('0x21')](_0x4b0adf[_0x93ac('0x33')][_0x93ac('0x21')]);}_0x5a8268['order']=qs[_0x93ac('0x3b')](_0x4b0adf[_0x93ac('0x33')][_0x93ac('0x3b')]);_0x5a8268[_0x93ac('0x3c')]=qs['filters'](_['pick'](_0x4b0adf[_0x93ac('0x33')],_0x28310a[_0x93ac('0x34')]),_0x3ca4e0);if(_0x4b0adf[_0x93ac('0x33')]['filter']){_0x5a8268[_0x93ac('0x3c')]=_[_0x93ac('0x3d')](_0x5a8268[_0x93ac('0x3c')],{'$or':_[_0x93ac('0x2e')](_0x3ca4e0,function(_0x33f053){if(_0x33f053[_0x93ac('0x31')]!==_0x93ac('0x3e')){var _0x23066e={};_0x23066e[_0x33f053[_0x93ac('0x2c')]]={'$like':'%'+_0x4b0adf[_0x93ac('0x33')][_0x93ac('0x3f')]+'%'};return _0x23066e;}})});}_0x5a8268=_['merge']({},_0x5a8268,_0x4b0adf[_0x93ac('0x40')]);var _0x3f82fe={'where':_0x5a8268[_0x93ac('0x3c')]};return db[_0x93ac('0x2f')][_0x93ac('0x23')](_0x3f82fe)[_0x93ac('0x28')](function(_0x24d693){_0x18ce1e[_0x93ac('0x23')]=_0x24d693;if(_0x4b0adf[_0x93ac('0x33')][_0x93ac('0x41')]){_0x5a8268[_0x93ac('0x42')]=[{'all':!![]}];}return db['Schedule'][_0x93ac('0x43')](_0x5a8268);})[_0x93ac('0x28')](function(_0x52e7e5){_0x18ce1e[_0x93ac('0x44')]=_0x52e7e5;return _0x18ce1e;})['then'](respondWithFilteredResult(_0x4563e9,_0x5a8268))['catch'](handleError(_0x4563e9,null));};exports[_0x93ac('0x45')]=function(_0x56671d,_0x495cd5){var _0x2e6859={'raw':![],'where':{'id':_0x56671d[_0x93ac('0x46')]['id']}},_0x58ff50={};_0x58ff50['model']=_['keys'](db['Schedule']['rawAttributes']);_0x58ff50[_0x93ac('0x33')]=_[_0x93ac('0x47')](_0x56671d[_0x93ac('0x33')]);_0x58ff50[_0x93ac('0x34')]=_[_0x93ac('0x35')](_0x58ff50[_0x93ac('0x32')],_0x58ff50[_0x93ac('0x33')]);_0x2e6859[_0x93ac('0x36')]=_[_0x93ac('0x35')](_0x58ff50['model'],qs[_0x93ac('0x37')](_0x56671d[_0x93ac('0x33')][_0x93ac('0x37')]));_0x2e6859[_0x93ac('0x36')]=_0x2e6859[_0x93ac('0x36')]['length']?_0x2e6859[_0x93ac('0x36')]:_0x58ff50[_0x93ac('0x32')];if(_0x56671d['query'][_0x93ac('0x41')]){_0x2e6859['include']=[{'all':!![]}];}_0x2e6859=_[_0x93ac('0x3d')]({},_0x2e6859,_0x56671d[_0x93ac('0x40')]);return db['Schedule'][_0x93ac('0x48')](_0x2e6859)[_0x93ac('0x28')](handleEntityNotFound(_0x495cd5,null))[_0x93ac('0x28')](respondWithResult(_0x495cd5,null))[_0x93ac('0x49')](handleError(_0x495cd5,null));};exports['create']=function(_0x2f7716,_0x1b359a){return db['Schedule'][_0x93ac('0x4a')](_0x2f7716[_0x93ac('0x4b')],{})['then'](function(_0x1b74ff){var _0x35ccbb=_0x2f7716['user'][_0x93ac('0x29')]({'plain':!![]});if(!_0x35ccbb)throw new Error(_0x93ac('0x4c'));if(_0x35ccbb['role']===_0x93ac('0x4d')){var _0x58a71a=_0x1b74ff[_0x93ac('0x29')]({'plain':!![]});var _0x4a5820='Scheduler';return db[_0x93ac('0x4e')]['find']({'where':{'name':_0x4a5820,'userProfileId':_0x35ccbb[_0x93ac('0x4f')]},'raw':!![]})[_0x93ac('0x28')](function(_0x373053){if(_0x373053&&_0x373053[_0x93ac('0x50')]===0x0){return db[_0x93ac('0x2a')][_0x93ac('0x4a')]({'name':_0x58a71a[_0x93ac('0x2c')],'resourceId':_0x58a71a['id'],'type':_0x373053['name'],'sectionId':_0x373053['id']},{})[_0x93ac('0x28')](function(){return _0x1b74ff;});}else{return _0x1b74ff;}})[_0x93ac('0x49')](function(_0x51f4cd){logger[_0x93ac('0x51')](_0x93ac('0x52'),_0x51f4cd);throw _0x51f4cd;});}return _0x1b74ff;})['then'](respondWithResult(_0x1b359a,0xc9))['catch'](handleError(_0x1b359a,null));};exports['update']=function(_0x135dbb,_0x4b709e){if(_0x135dbb[_0x93ac('0x4b')]['id']){delete _0x135dbb[_0x93ac('0x4b')]['id'];}return db[_0x93ac('0x2f')][_0x93ac('0x48')]({'where':{'id':_0x135dbb[_0x93ac('0x46')]['id']}})[_0x93ac('0x28')](handleEntityNotFound(_0x4b709e,null))[_0x93ac('0x28')](saveUpdates(_0x135dbb['body'],null))['then'](respondWithResult(_0x4b709e,null))[_0x93ac('0x49')](handleError(_0x4b709e,null));};exports['destroy']=function(_0x41cbf9,_0x3fbe57){return db['Schedule'][_0x93ac('0x48')]({'where':{'id':_0x41cbf9[_0x93ac('0x46')]['id']}})['then'](handleEntityNotFound(_0x3fbe57,null))[_0x93ac('0x28')](removeEntity(_0x3fbe57,null))[_0x93ac('0x49')](handleError(_0x3fbe57,null));};exports['run']=function(_0x23093c,_0x210bb0,_0x140fe7){var _0x286863=require(_0x93ac('0x53'));return db[_0x93ac('0x2f')][_0x93ac('0x48')]({'where':{'id':_0x23093c[_0x93ac('0x46')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x210bb0,null))[_0x93ac('0x28')](function(){_0x286863[_0x93ac('0x54')](_0x23093c[_0x93ac('0x46')]['id']);})['then'](respondWithStatusCode(_0x210bb0,null))[_0x93ac('0x49')](handleError(_0x210bb0,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index 3709671..f75a9d5 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 _0x7614=['tools_schedules','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./schedule.attributes','exports','Schedule'];(function(_0x2e52f3,_0x1121f0){var _0x424537=function(_0x1482dd){while(--_0x1482dd){_0x2e52f3['push'](_0x2e52f3['shift']());}};_0x424537(++_0x1121f0);}(_0x7614,0x119));var _0x4761=function(_0x2265da,_0xfbbd2e){_0x2265da=_0x2265da-0x0;var _0x430c2b=_0x7614[_0x2265da];return _0x430c2b;};'use strict';var _=require(_0x4761('0x0'));var util=require(_0x4761('0x1'));var logger=require(_0x4761('0x2'))(_0x4761('0x3'));var moment=require(_0x4761('0x4'));var BPromise=require(_0x4761('0x5'));var rp=require(_0x4761('0x6'));var fs=require('fs');var path=require(_0x4761('0x7'));var rimraf=require(_0x4761('0x8'));var config=require(_0x4761('0x9'));var attributes=require(_0x4761('0xa'));module[_0x4761('0xb')]=function(_0x2ab00f,_0xc636ac){return _0x2ab00f['define'](_0x4761('0xc'),attributes,{'tableName':_0x4761('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x35c7=['./schedule.attributes','tools_schedules','util','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x312d8f,_0x7c37bf){var _0x5a093f=function(_0x2cc88f){while(--_0x2cc88f){_0x312d8f['push'](_0x312d8f['shift']());}};_0x5a093f(++_0x7c37bf);}(_0x35c7,0x1cd));var _0x735c=function(_0x398f0d,_0x5150f8){_0x398f0d=_0x398f0d-0x0;var _0x1c9e8f=_0x35c7[_0x398f0d];return _0x1c9e8f;};'use strict';var _=require('lodash');var util=require(_0x735c('0x0'));var logger=require('../../config/logger')(_0x735c('0x1'));var moment=require('moment');var BPromise=require(_0x735c('0x2'));var rp=require(_0x735c('0x3'));var fs=require('fs');var path=require(_0x735c('0x4'));var rimraf=require(_0x735c('0x5'));var config=require(_0x735c('0x6'));var attributes=require(_0x735c('0x7'));module['exports']=function(_0x2d9907,_0x12e383){return _0x2d9907['define']('Schedule',attributes,{'tableName':_0x735c('0x8'),'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 db0b7b9..3d54004 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 _0xe6bb=['error','message','result','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','Schedule,\x20%s,\x20%s','debug','request\x20sent','stringify'];(function(_0x3899d1,_0x4aa04c){var _0xeb4a7d=function(_0x3ea5ee){while(--_0x3ea5ee){_0x3899d1['push'](_0x3899d1['shift']());}};_0xeb4a7d(++_0x4aa04c);}(_0xe6bb,0x159));var _0xbe6b=function(_0x2d734c,_0x3d7bc6){_0x2d734c=_0x2d734c-0x0;var _0x573617=_0xe6bb[_0x2d734c];return _0x573617;};'use strict';var _=require(_0xbe6b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xbe6b('0x1'));var rs=require(_0xbe6b('0x2'));var fs=require('fs');var Redis=require(_0xbe6b('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbe6b('0x4'));var logger=require(_0xbe6b('0x5'))('rpc');var config=require(_0xbe6b('0x6'));var jayson=require(_0xbe6b('0x7'));var client=jayson[_0xbe6b('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5a6834,_0x116bb9,_0xaeab80){return new BPromise(function(_0x47bdc7,_0x396654){return client[_0xbe6b('0x9')](_0x5a6834,_0xaeab80)[_0xbe6b('0xa')](function(_0x2438bb){logger[_0xbe6b('0xb')](_0xbe6b('0xc'),_0x116bb9,'request\x20sent');logger[_0xbe6b('0xd')]('Schedule,\x20%s,\x20%s,\x20%s',_0x116bb9,_0xbe6b('0xe'),JSON[_0xbe6b('0xf')](_0x2438bb));if(_0x2438bb[_0xbe6b('0x10')]){if(_0x2438bb[_0xbe6b('0x10')]['code']===0x1f4){logger[_0xbe6b('0x10')](_0xbe6b('0xc'),_0x116bb9,_0x2438bb['error'][_0xbe6b('0x11')]);return _0x396654(_0x2438bb['error']['message']);}logger[_0xbe6b('0x10')](_0xbe6b('0xc'),_0x116bb9,_0x2438bb[_0xbe6b('0x10')][_0xbe6b('0x11')]);return _0x47bdc7(_0x2438bb[_0xbe6b('0x10')]['message']);}else{logger[_0xbe6b('0xb')](_0xbe6b('0xc'),_0x116bb9,_0xbe6b('0xe'));_0x47bdc7(_0x2438bb[_0xbe6b('0x12')][_0xbe6b('0x11')]);}})['catch'](function(_0x32735f){logger[_0xbe6b('0x10')](_0xbe6b('0xc'),_0x116bb9,_0x32735f);_0x396654(_0x32735f);});});} \ No newline at end of file +var _0xf8b8=['error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Schedule,\x20%s,\x20%s','debug','Schedule,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0xf8b8,0xc5));var _0x8f8b=function(_0x2f5960,_0x5f4ea9){_0x2f5960=_0x2f5960-0x0;var _0x43c84f=_0xf8b8[_0x2f5960];return _0x43c84f;};'use strict';var _=require(_0x8f8b('0x0'));var util=require(_0x8f8b('0x1'));var moment=require(_0x8f8b('0x2'));var BPromise=require('bluebird');var rs=require(_0x8f8b('0x3'));var fs=require('fs');var Redis=require(_0x8f8b('0x4'));var db=require(_0x8f8b('0x5'))['db'];var utils=require(_0x8f8b('0x6'));var logger=require(_0x8f8b('0x7'))('rpc');var config=require(_0x8f8b('0x8'));var jayson=require(_0x8f8b('0x9'));var client=jayson[_0x8f8b('0xa')][_0x8f8b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x14671c,_0x2ff781,_0x34a45d){return new BPromise(function(_0x5f1745,_0x21efce){return client[_0x8f8b('0xc')](_0x14671c,_0x34a45d)[_0x8f8b('0xd')](function(_0xc9e2d1){logger[_0x8f8b('0xe')](_0x8f8b('0xf'),_0x2ff781,'request\x20sent');logger[_0x8f8b('0x10')](_0x8f8b('0x11'),_0x2ff781,_0x8f8b('0x12'),JSON['stringify'](_0xc9e2d1));if(_0xc9e2d1[_0x8f8b('0x13')]){if(_0xc9e2d1[_0x8f8b('0x13')][_0x8f8b('0x14')]===0x1f4){logger['error']('Schedule,\x20%s,\x20%s',_0x2ff781,_0xc9e2d1[_0x8f8b('0x13')][_0x8f8b('0x15')]);return _0x21efce(_0xc9e2d1[_0x8f8b('0x13')]['message']);}logger[_0x8f8b('0x13')](_0x8f8b('0xf'),_0x2ff781,_0xc9e2d1[_0x8f8b('0x13')][_0x8f8b('0x15')]);return _0x5f1745(_0xc9e2d1['error']['message']);}else{logger[_0x8f8b('0xe')](_0x8f8b('0xf'),_0x2ff781,_0x8f8b('0x12'));_0x5f1745(_0xc9e2d1[_0x8f8b('0x16')][_0x8f8b('0x15')]);}})[_0x8f8b('0x17')](function(_0x3a29af){logger['error']('Schedule,\x20%s,\x20%s',_0x2ff781,_0x3a29af);_0x21efce(_0x3a29af);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index 13c046d..ca3a929 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 _0xa3e8=['index','describe','/:id','show','/:id/download','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','./screenRecording.controller','get','isAuthenticated'];(function(_0x1d9a63,_0x4a368f){var _0x5ccccf=function(_0x115dee){while(--_0x115dee){_0x1d9a63['push'](_0x1d9a63['shift']());}};_0x5ccccf(++_0x4a368f);}(_0xa3e8,0x1f0));var _0x8a3e=function(_0x2fc105,_0x4fdde7){_0x2fc105=_0x2fc105-0x0;var _0x1ce3ea=_0xa3e8[_0x2fc105];return _0x1ce3ea;};'use strict';var multer=require(_0x8a3e('0x0'));var util=require(_0x8a3e('0x1'));var path=require(_0x8a3e('0x2'));var timeout=require(_0x8a3e('0x3'));var express=require(_0x8a3e('0x4'));var router=express[_0x8a3e('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x8a3e('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x8a3e('0x7'));router[_0x8a3e('0x8')]('/',auth[_0x8a3e('0x9')](),controller[_0x8a3e('0xa')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x8a3e('0xb')]);router[_0x8a3e('0x8')](_0x8a3e('0xc'),auth['isAuthenticated'](),controller[_0x8a3e('0xd')]);router[_0x8a3e('0x8')](_0x8a3e('0xe'),auth['isAuthenticated'](),controller['download']);router[_0x8a3e('0xf')]('/',auth['isAuthenticated'](),controller[_0x8a3e('0x10')]);router[_0x8a3e('0x11')](_0x8a3e('0xc'),auth[_0x8a3e('0x9')](),controller[_0x8a3e('0x12')]);router[_0x8a3e('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x8a3e('0x14')]);module[_0x8a3e('0x15')]=router; \ No newline at end of file +var _0x77cf=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','download','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x333f78,_0x39a9cf){var _0x169189=function(_0x1fcddd){while(--_0x1fcddd){_0x333f78['push'](_0x333f78['shift']());}};_0x169189(++_0x39a9cf);}(_0x77cf,0x1a9));var _0xf77c=function(_0x5da0a9,_0x153fdd){_0x5da0a9=_0x5da0a9-0x0;var _0x1d7009=_0x77cf[_0x5da0a9];return _0x1d7009;};'use strict';var multer=require(_0xf77c('0x0'));var util=require(_0xf77c('0x1'));var path=require(_0xf77c('0x2'));var timeout=require(_0xf77c('0x3'));var express=require('express');var router=express[_0xf77c('0x4')]();var fs_extra=require(_0xf77c('0x5'));var auth=require(_0xf77c('0x6'));var interaction=require(_0xf77c('0x7'));var config=require(_0xf77c('0x8'));var controller=require('./screenRecording.controller');router[_0xf77c('0x9')]('/',auth[_0xf77c('0xa')](),controller[_0xf77c('0xb')]);router[_0xf77c('0x9')](_0xf77c('0xc'),auth[_0xf77c('0xa')](),controller[_0xf77c('0xd')]);router[_0xf77c('0x9')](_0xf77c('0xe'),auth['isAuthenticated'](),controller[_0xf77c('0xf')]);router[_0xf77c('0x9')](_0xf77c('0x10'),auth[_0xf77c('0xa')](),controller[_0xf77c('0x11')]);router['post']('/',auth[_0xf77c('0xa')](),controller[_0xf77c('0x12')]);router[_0xf77c('0x13')](_0xf77c('0xe'),auth[_0xf77c('0xa')](),controller[_0xf77c('0x14')]);router[_0xf77c('0x15')]('/:id',auth[_0xf77c('0xa')](),controller[_0xf77c('0x16')]);module[_0xf77c('0x17')]=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index 4b96f0d..8f935ed 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 _0x3da6=['MM-DD-YYYY\x20HH:mm','toString','format','createdAt','sequelize','moment','path','../../config/environment','exports','VIRTUAL','getDataValue','extname','STRING','replace','setDataValue','value','INTEGER','startedAt','closedAt','duration','DATE'];(function(_0x1af0e5,_0x152990){var _0x3c444a=function(_0x3b3d13){while(--_0x3b3d13){_0x1af0e5['push'](_0x1af0e5['shift']());}};_0x3c444a(++_0x152990);}(_0x3da6,0xc1));var _0x63da=function(_0xec4dc7,_0x345c4c){_0xec4dc7=_0xec4dc7-0x0;var _0x5e8142=_0x3da6[_0xec4dc7];return _0x5e8142;};'use strict';var Sequelize=require(_0x63da('0x0'));var moment=require(_0x63da('0x1'));var path=require(_0x63da('0x2'));var config=require(_0x63da('0x3'));module[_0x63da('0x4')]={'format':{'type':Sequelize[_0x63da('0x5')],'get':function(){return this[_0x63da('0x6')]('value')?path[_0x63da('0x7')](this[_0x63da('0x6')]('value')):undefined;}},'interactionid':{'type':Sequelize[_0x63da('0x8')]},'channel':{'type':Sequelize['STRING']},'value':{'type':Sequelize[_0x63da('0x8')],'set':function(_0x519714){var _0x1e6160=_0x519714[_0x63da('0x9')](/\\/g,'/');this[_0x63da('0xa')](_0x63da('0xb'),_0x1e6160);}},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x63da('0xc')],'set':function(_0xdc10c4){this['setDataValue'](_0x63da('0xd'),moment()['subtract'](_0xdc10c4,'ms'));this[_0x63da('0xa')](_0x63da('0xe'),moment());this[_0x63da('0xa')](_0x63da('0xf'),_0xdc10c4);}},'startedAt':{'type':Sequelize[_0x63da('0x10')],'get':function(){return moment(this['getDataValue'](_0x63da('0xd')))['format'](_0x63da('0x11'))[_0x63da('0x12')]();}},'closedAt':{'type':Sequelize[_0x63da('0x10')],'get':function(){return moment(this[_0x63da('0x6')](_0x63da('0xe')))[_0x63da('0x13')](_0x63da('0x11'))[_0x63da('0x12')]();}},'createdAt':{'type':Sequelize[_0x63da('0x10')],'get':function(){return moment(this[_0x63da('0x6')](_0x63da('0x14')))[_0x63da('0x13')](_0x63da('0x11'))['toString']();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x63da('0x6')]('updatedAt'))[_0x63da('0x13')](_0x63da('0x11'))[_0x63da('0x12')]();}}}; \ No newline at end of file +var _0x082a=['toString','DATE','createdAt','updatedAt','moment','path','../../config/environment','VIRTUAL','getDataValue','value','extname','STRING','replace','setDataValue','INTEGER','startedAt','subtract','closedAt','duration','format','MM-DD-YYYY\x20HH:mm'];(function(_0x286544,_0x3e0d36){var _0x564aa4=function(_0x203930){while(--_0x203930){_0x286544['push'](_0x286544['shift']());}};_0x564aa4(++_0x3e0d36);}(_0x082a,0x154));var _0xa082=function(_0x374120,_0x7feb64){_0x374120=_0x374120-0x0;var _0x2e26b9=_0x082a[_0x374120];return _0x2e26b9;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xa082('0x0'));var path=require(_0xa082('0x1'));var config=require(_0xa082('0x2'));module['exports']={'format':{'type':Sequelize[_0xa082('0x3')],'get':function(){return this[_0xa082('0x4')](_0xa082('0x5'))?path[_0xa082('0x6')](this[_0xa082('0x4')]('value')):undefined;}},'interactionid':{'type':Sequelize[_0xa082('0x7')]},'channel':{'type':Sequelize['STRING']},'value':{'type':Sequelize[_0xa082('0x7')],'set':function(_0x41030c){var _0x5ae561=_0x41030c[_0xa082('0x8')](/\\/g,'/');this[_0xa082('0x9')](_0xa082('0x5'),_0x5ae561);}},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xa082('0xa')],'set':function(_0xafc3c1){this[_0xa082('0x9')](_0xa082('0xb'),moment()[_0xa082('0xc')](_0xafc3c1,'ms'));this['setDataValue'](_0xa082('0xd'),moment());this[_0xa082('0x9')](_0xa082('0xe'),_0xafc3c1);}},'startedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this['getDataValue'](_0xa082('0xb')))[_0xa082('0xf')](_0xa082('0x10'))[_0xa082('0x11')]();}},'closedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xa082('0x4')](_0xa082('0xd')))[_0xa082('0xf')](_0xa082('0x10'))[_0xa082('0x11')]();}},'createdAt':{'type':Sequelize[_0xa082('0x12')],'get':function(){return moment(this['getDataValue'](_0xa082('0x13')))[_0xa082('0xf')]('MM-DD-YYYY\x20HH:mm')[_0xa082('0x11')]();}},'updatedAt':{'type':Sequelize[_0xa082('0x12')],'get':function(){return moment(this[_0xa082('0x4')](_0xa082('0x14')))['format']('MM-DD-YYYY\x20HH:mm')[_0xa082('0x11')]();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index 9c20db8..4ac4bed 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 _0x9c5a=['ScreenRecording','includeAll','findAll','rows','catch','params','include','find','create','body','duration','createdAt','closedAt','value','describe','download','uniqueid','join','root','server/files/screen_recordings','%s.cypher','decryptFile','recording','existsSync','Sequelize','ScreenRecording\x20not\x20found','filename','unlink','message','Not\x20found','destroy','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','stack','name','send','map','rawAttributes','fieldName','key','model','format','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','options'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0x181935,_0xf18548){_0x181935=_0x181935-0x0;var _0xfe276d=_0x9c5a[_0x181935];return _0xfe276d;};'use strict';var emlformat=require(_0xa9c5('0x0'));var rimraf=require(_0xa9c5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa9c5('0x2'));var rp=require(_0xa9c5('0x3'));var moment=require(_0xa9c5('0x4'));var BPromise=require(_0xa9c5('0x5'));var Mustache=require('mustache');var util=require(_0xa9c5('0x6'));var path=require(_0xa9c5('0x7'));var sox=require('sox');var csv=require(_0xa9c5('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa9c5('0x9'));var _=require(_0xa9c5('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa9c5('0xb'));var deskjs=require(_0xa9c5('0xc'));var toCsv=require('to-csv');var querystring=require(_0xa9c5('0xd'));var Papa=require(_0xa9c5('0xe'));var Redis=require('ioredis');var authService=require(_0xa9c5('0xf'));var qs=require(_0xa9c5('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa9c5('0x11'))(_0xa9c5('0x12'));var utils=require(_0xa9c5('0x13'));var config=require(_0xa9c5('0x14'));var licenseUtil=require(_0xa9c5('0x15'));var db=require(_0xa9c5('0x16'))['db'];function respondWithStatusCode(_0x51c8d,_0x42d5cf){_0x42d5cf=_0x42d5cf||0xcc;return function(_0x3c5ac7){if(_0x3c5ac7){return _0x51c8d[_0xa9c5('0x17')](_0x42d5cf);}return _0x51c8d['status'](_0x42d5cf)[_0xa9c5('0x18')]();};}function respondWithResult(_0x1276d2,_0x7df76d){_0x7df76d=_0x7df76d||0xc8;return function(_0x3806c4){if(_0x3806c4){return _0x1276d2[_0xa9c5('0x19')](_0x7df76d)[_0xa9c5('0x1a')](_0x3806c4);}};}function respondWithFilteredResult(_0x251099,_0x40b001){return function(_0x19a43e){if(_0x19a43e){var _0xcf13f2=typeof _0x40b001['offset']===_0xa9c5('0x1b')&&typeof _0x40b001[_0xa9c5('0x1c')]===_0xa9c5('0x1b');var _0x55cce5=_0x19a43e[_0xa9c5('0x1d')];var _0x1142d9=_0xcf13f2?0x0:_0x40b001[_0xa9c5('0x1e')];var _0x3b8cf7=_0xcf13f2?_0x19a43e[_0xa9c5('0x1d')]:_0x40b001[_0xa9c5('0x1e')]+_0x40b001[_0xa9c5('0x1c')];var _0x1e5ce6;if(_0x3b8cf7>=_0x55cce5){_0x3b8cf7=_0x55cce5;_0x1e5ce6=0xc8;}else{_0x1e5ce6=0xce;}_0x251099[_0xa9c5('0x19')](_0x1e5ce6);return _0x251099[_0xa9c5('0x1f')](_0xa9c5('0x20'),_0x1142d9+'-'+_0x3b8cf7+'/'+_0x55cce5)[_0xa9c5('0x1a')](_0x19a43e);}return null;};}function patchUpdates(_0x54f8b9){return function(_0x1115ad){try{jsonpatch[_0xa9c5('0x21')](_0x1115ad,_0x54f8b9,!![]);}catch(_0x541c77){return BPromise['reject'](_0x541c77);}return _0x1115ad[_0xa9c5('0x22')]();};}function saveUpdates(_0x366f5c,_0x10b208){return function(_0x3b497a){if(_0x3b497a){return _0x3b497a[_0xa9c5('0x23')](_0x366f5c)[_0xa9c5('0x24')](function(_0x48e2cb){return _0x48e2cb;});}return null;};}function removeEntity(_0x4fa280,_0x3d4e1b){return function(_0x11d395){if(_0x11d395){return _0x11d395['destroy']()[_0xa9c5('0x24')](function(){_0x4fa280[_0xa9c5('0x19')](0xcc)[_0xa9c5('0x18')]();});}};}function handleEntityNotFound(_0x32fc7d,_0x4cbba1){return function(_0x40f08b){if(!_0x40f08b){_0x32fc7d[_0xa9c5('0x17')](0x194);}return _0x40f08b;};}function handleError(_0x51b64a,_0x4e8a7f){_0x4e8a7f=_0x4e8a7f||0x1f4;return function(_0x242771){logger['error'](_0x242771[_0xa9c5('0x25')]);if(_0x242771[_0xa9c5('0x26')]){delete _0x242771['name'];}_0x51b64a[_0xa9c5('0x19')](_0x4e8a7f)[_0xa9c5('0x27')](_0x242771);};}exports['index']=function(_0x413edf,_0x32baf9){var _0x198cdf={},_0x185eb8={},_0x325c65={'count':0x0,'rows':[]};var _0x4f6e70=_[_0xa9c5('0x28')](db['ScreenRecording'][_0xa9c5('0x29')],function(_0x1ef388){return{'name':_0x1ef388[_0xa9c5('0x2a')],'type':_0x1ef388['type'][_0xa9c5('0x2b')]};});_0x185eb8[_0xa9c5('0x2c')]=_['differenceBy'](_[_0xa9c5('0x28')](_0x4f6e70,_0xa9c5('0x26')),[_0xa9c5('0x2d')]);_0x185eb8[_0xa9c5('0x2e')]=_[_0xa9c5('0x2f')](_0x413edf[_0xa9c5('0x2e')]);_0x185eb8[_0xa9c5('0x30')]=_['intersection'](_0x185eb8[_0xa9c5('0x2c')],_0x185eb8[_0xa9c5('0x2e')]);_0x198cdf[_0xa9c5('0x31')]=_[_0xa9c5('0x32')](_0x185eb8[_0xa9c5('0x2c')],qs[_0xa9c5('0x33')](_0x413edf[_0xa9c5('0x2e')][_0xa9c5('0x33')]));_0x198cdf['attributes']=_0x198cdf['attributes'][_0xa9c5('0x34')]?_0x198cdf[_0xa9c5('0x31')]:_0x185eb8[_0xa9c5('0x2c')];if(!_0x413edf[_0xa9c5('0x2e')][_0xa9c5('0x35')](_0xa9c5('0x36'))){_0x198cdf['limit']=qs['limit'](_0x413edf['query'][_0xa9c5('0x1c')]);_0x198cdf[_0xa9c5('0x1e')]=qs['offset'](_0x413edf[_0xa9c5('0x2e')]['offset']);}_0x198cdf[_0xa9c5('0x37')]=qs[_0xa9c5('0x38')](_0x413edf[_0xa9c5('0x2e')][_0xa9c5('0x38')]);_0x198cdf['where']=qs[_0xa9c5('0x30')](_[_0xa9c5('0x39')](_0x413edf[_0xa9c5('0x2e')],_0x185eb8[_0xa9c5('0x30')]),_0x4f6e70);if(_0x413edf[_0xa9c5('0x2e')][_0xa9c5('0x3a')]){_0x198cdf[_0xa9c5('0x3b')]=_[_0xa9c5('0x3c')](_0x198cdf['where'],{'$or':_[_0xa9c5('0x28')](_0x4f6e70,function(_0x46e5d2){if(_0x46e5d2[_0xa9c5('0x3d')]!==_0xa9c5('0x3e')){var _0x1132e0={};_0x1132e0[_0x46e5d2[_0xa9c5('0x26')]]={'$like':'%'+_0x413edf['query'][_0xa9c5('0x3a')]+'%'};return _0x1132e0;}})});}_0x198cdf=_['merge']({},_0x198cdf,_0x413edf[_0xa9c5('0x3f')]);var _0x5c89e7={'where':_0x198cdf[_0xa9c5('0x3b')]};return db[_0xa9c5('0x40')][_0xa9c5('0x1d')](_0x5c89e7)['then'](function(_0x12e19c){_0x325c65[_0xa9c5('0x1d')]=_0x12e19c;if(_0x413edf[_0xa9c5('0x2e')][_0xa9c5('0x41')]){_0x198cdf['include']=[{'all':!![]}];}return db[_0xa9c5('0x40')][_0xa9c5('0x42')](_0x198cdf);})[_0xa9c5('0x24')](function(_0x45668e){_0x325c65[_0xa9c5('0x43')]=_0x45668e;return _0x325c65;})['then'](respondWithFilteredResult(_0x32baf9,_0x198cdf))[_0xa9c5('0x44')](handleError(_0x32baf9,null));};exports['show']=function(_0x1de605,_0x397614){var _0x2998ad={'raw':![],'where':{'id':_0x1de605[_0xa9c5('0x45')]['id']}},_0xc8fca4={};_0xc8fca4[_0xa9c5('0x2c')]=_[_0xa9c5('0x2f')](db[_0xa9c5('0x40')][_0xa9c5('0x29')]);_0xc8fca4[_0xa9c5('0x2e')]=_['keys'](_0x1de605[_0xa9c5('0x2e')]);_0xc8fca4[_0xa9c5('0x30')]=_[_0xa9c5('0x32')](_0xc8fca4[_0xa9c5('0x2c')],_0xc8fca4[_0xa9c5('0x2e')]);_0x2998ad[_0xa9c5('0x31')]=_['intersection'](_0xc8fca4[_0xa9c5('0x2c')],qs[_0xa9c5('0x33')](_0x1de605['query']['fields']));_0x2998ad['attributes']=_0x2998ad['attributes']['length']?_0x2998ad[_0xa9c5('0x31')]:_0xc8fca4[_0xa9c5('0x2c')];if(_0x1de605[_0xa9c5('0x2e')][_0xa9c5('0x41')]){_0x2998ad[_0xa9c5('0x46')]=[{'all':!![]}];}_0x2998ad=_[_0xa9c5('0x3c')]({},_0x2998ad,_0x1de605[_0xa9c5('0x3f')]);return db[_0xa9c5('0x40')][_0xa9c5('0x47')](_0x2998ad)[_0xa9c5('0x24')](handleEntityNotFound(_0x397614,null))[_0xa9c5('0x24')](respondWithResult(_0x397614,null))[_0xa9c5('0x44')](handleError(_0x397614,null));};exports[_0xa9c5('0x48')]=function(_0x4bf8b4,_0x1108f0){return db['ScreenRecording'][_0xa9c5('0x48')](_0x4bf8b4[_0xa9c5('0x49')],{})['then'](respondWithResult(_0x1108f0,0xc9))['catch'](handleError(_0x1108f0,null));};exports[_0xa9c5('0x23')]=function(_0x32e64a,_0xeb0720){if(_0x32e64a['body']['id']){delete _0x32e64a['body']['id'];}delete _0x32e64a[_0xa9c5('0x49')][_0xa9c5('0x4a')];delete _0x32e64a['body'][_0xa9c5('0x4b')];delete _0x32e64a[_0xa9c5('0x49')][_0xa9c5('0x4c')];delete _0x32e64a[_0xa9c5('0x49')][_0xa9c5('0x4d')];return db[_0xa9c5('0x40')]['find']({'where':{'id':_0x32e64a['params']['id']}})['then'](handleEntityNotFound(_0xeb0720,null))[_0xa9c5('0x24')](saveUpdates(_0x32e64a[_0xa9c5('0x49')],null))[_0xa9c5('0x24')](respondWithResult(_0xeb0720,null))[_0xa9c5('0x44')](handleError(_0xeb0720,null));};exports[_0xa9c5('0x4e')]=function(_0x15d044,_0x56bc1d){return db[_0xa9c5('0x40')][_0xa9c5('0x4e')]()[_0xa9c5('0x24')](respondWithResult(_0x56bc1d,null))[_0xa9c5('0x44')](handleError(_0x56bc1d,null));};exports[_0xa9c5('0x4f')]=function(_0x242e8a,_0x547654,_0x4fcc44){var _0x10ff6b=require('../../components/encryptor');var _0x1b158f=![];var _0x5ea9b0={};if(_0x242e8a[_0xa9c5('0x2e')][_0xa9c5('0x3d')]&&_0x242e8a[_0xa9c5('0x2e')]['type']===_0xa9c5('0x50')){_0x5ea9b0[_0xa9c5('0x50')]=_0x242e8a[_0xa9c5('0x45')]['id'];}else{_0x5ea9b0['id']=_0x242e8a[_0xa9c5('0x45')]['id'];}return db['ScreenRecording']['find']({'where':_0x5ea9b0,'attributes':['id',_0xa9c5('0x4d')],'raw':!![]})[_0xa9c5('0x24')](handleEntityNotFound(_0x547654,null))[_0xa9c5('0x24')](function(_0x5b4323){if(_0x5b4323){var _0x31e12e=path[_0xa9c5('0x51')](config[_0xa9c5('0x52')],_0xa9c5('0x53'),_0x5b4323[_0xa9c5('0x4d')]);var _0x29b198=util[_0xa9c5('0x2d')](_0xa9c5('0x54'),_0x31e12e);if(fs['existsSync'](_0x29b198)){_0x1b158f=!![];return _0x10ff6b[_0xa9c5('0x55')](_0x29b198,_0x31e12e,config['secrets'][_0xa9c5('0x56')])[_0xa9c5('0x24')](function(){return _0x5b4323;});}return _0x5b4323;}})[_0xa9c5('0x24')](function(_0x4dfe3a){if(_0x4dfe3a){var _0x4d475a=path[_0xa9c5('0x51')](config['root'],_0xa9c5('0x53'),_0x4dfe3a[_0xa9c5('0x4d')]);if(!fs[_0xa9c5('0x57')](_0x4d475a)){throw new db[(_0xa9c5('0x58'))]['ValidationError'](_0xa9c5('0x59'));}if(_0x4dfe3a[_0xa9c5('0x5a')]){return _0x547654[_0xa9c5('0x4f')](_0x4d475a,_0x4dfe3a[_0xa9c5('0x5a')]+path['extname'](_0x4d475a),function(){if(_0x1b158f){fs['unlink'](_0x4d475a);}});}else{return _0x547654[_0xa9c5('0x4f')](_0x4d475a,function(_0x3deb64){if(_0x1b158f){fs[_0xa9c5('0x5b')](_0x4d475a);}});}}})[_0xa9c5('0x44')](function(_0x279a26){if(_0x279a26[_0xa9c5('0x5c')]==='ScreenRecording\x20not\x20found'){_0x547654[_0xa9c5('0x19')](0x194)[_0xa9c5('0x27')](_0xa9c5('0x5d'));}else{return handleError(_0x547654,null);}});};exports[_0xa9c5('0x5e')]=function(_0x2b8575,_0x372ab9){return db[_0xa9c5('0x40')][_0xa9c5('0x47')]({'where':{'id':_0x2b8575[_0xa9c5('0x45')]['id']}})[_0xa9c5('0x24')](function(_0x50d438){if(_['isNil'](_0x50d438)){throw new ReferenceError(_0xa9c5('0x5f'));}return _0x50d438;})[_0xa9c5('0x24')](function(_0x3322cc){var _0x47afaa=path['join'](config[_0xa9c5('0x52')],'server/files/screen_recordings',_0x3322cc[_0xa9c5('0x4d')]);logger[_0xa9c5('0x60')](_0xa9c5('0x61'),_0x47afaa);if(!_[_0xa9c5('0x62')](_0x3322cc[_0xa9c5('0x4d')])&&fs[_0xa9c5('0x57')](_0x47afaa)){logger[_0xa9c5('0x60')](_0xa9c5('0x63')+_0x47afaa+_0xa9c5('0x64'));fs[_0xa9c5('0x65')](_0x47afaa);}_0x47afaa=_0x47afaa+_0xa9c5('0x66');if(!_[_0xa9c5('0x62')](_0x3322cc['value'])&&fs[_0xa9c5('0x57')](_0x47afaa)){logger[_0xa9c5('0x60')](_0xa9c5('0x63')+_0x47afaa+_0xa9c5('0x64'));fs[_0xa9c5('0x65')](_0x47afaa);}return _0x3322cc;})[_0xa9c5('0x24')](function(_0x28ba54){if(!_0x28ba54)throw new InternalError();return _0x28ba54['destroy']();})['then'](function(){_0x372ab9[_0xa9c5('0x19')](0xcc)['end']();})[_0xa9c5('0x44')](handleError(_0x372ab9,null));}; \ No newline at end of file +var _0x33c5=['download','uniqueid','join','root','server/files/screen_recordings','%s.cypher','existsSync','decryptFile','secrets','recording','ScreenRecording\x20not\x20found','filename','unlink','message','Not\x20found','cancellazione\x20fisica\x20documento\x20%s','isNil','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','unlinkSync','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','map','ScreenRecording','type','key','model','differenceBy','format','query','keys','filters','intersection','attributes','fields','length','order','sort','where','merge','VIRTUAL','filter','options','includeAll','findAll','show','params','include','find','catch','create','body','duration','createdAt','closedAt','value','describe'];(function(_0x41472b,_0x58f477){var _0x17cdc8=function(_0x2de5ef){while(--_0x2de5ef){_0x41472b['push'](_0x41472b['shift']());}};_0x17cdc8(++_0x58f477);}(_0x33c5,0xe6));var _0x533c=function(_0x1deee5,_0x1d4485){_0x1deee5=_0x1deee5-0x0;var _0x1d6c3a=_0x33c5[_0x1deee5];return _0x1d6c3a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x533c('0x0'));var zipdir=require(_0x533c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x533c('0x2'));var moment=require(_0x533c('0x3'));var BPromise=require(_0x533c('0x4'));var Mustache=require(_0x533c('0x5'));var util=require(_0x533c('0x6'));var path=require('path');var sox=require(_0x533c('0x7'));var csv=require(_0x533c('0x8'));var ejs=require(_0x533c('0x9'));var fs=require('fs');var fs_extra=require(_0x533c('0xa'));var _=require(_0x533c('0xb'));var squel=require(_0x533c('0xc'));var crypto=require(_0x533c('0xd'));var jsforce=require(_0x533c('0xe'));var deskjs=require(_0x533c('0xf'));var toCsv=require(_0x533c('0x8'));var querystring=require(_0x533c('0x10'));var Papa=require(_0x533c('0x11'));var Redis=require(_0x533c('0x12'));var authService=require(_0x533c('0x13'));var qs=require(_0x533c('0x14'));var as=require(_0x533c('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x533c('0x16'))(_0x533c('0x17'));var utils=require(_0x533c('0x18'));var config=require(_0x533c('0x19'));var licenseUtil=require(_0x533c('0x1a'));var db=require(_0x533c('0x1b'))['db'];function respondWithStatusCode(_0x530e10,_0x5c9462){_0x5c9462=_0x5c9462||0xcc;return function(_0xf93007){if(_0xf93007){return _0x530e10[_0x533c('0x1c')](_0x5c9462);}return _0x530e10[_0x533c('0x1d')](_0x5c9462)[_0x533c('0x1e')]();};}function respondWithResult(_0x1a2a83,_0x8d7c66){_0x8d7c66=_0x8d7c66||0xc8;return function(_0xa616ca){if(_0xa616ca){return _0x1a2a83['status'](_0x8d7c66)[_0x533c('0x1f')](_0xa616ca);}};}function respondWithFilteredResult(_0x7c1d33,_0x3f4a5c){return function(_0x3e544f){if(_0x3e544f){var _0x56dfb7=typeof _0x3f4a5c[_0x533c('0x20')]===_0x533c('0x21')&&typeof _0x3f4a5c[_0x533c('0x22')]===_0x533c('0x21');var _0x2854ab=_0x3e544f[_0x533c('0x23')];var _0x1f0a72=_0x56dfb7?0x0:_0x3f4a5c[_0x533c('0x20')];var _0x1f9f85=_0x56dfb7?_0x3e544f[_0x533c('0x23')]:_0x3f4a5c[_0x533c('0x20')]+_0x3f4a5c[_0x533c('0x22')];var _0x78dd72;if(_0x1f9f85>=_0x2854ab){_0x1f9f85=_0x2854ab;_0x78dd72=0xc8;}else{_0x78dd72=0xce;}_0x7c1d33[_0x533c('0x1d')](_0x78dd72);return _0x7c1d33[_0x533c('0x24')](_0x533c('0x25'),_0x1f0a72+'-'+_0x1f9f85+'/'+_0x2854ab)[_0x533c('0x1f')](_0x3e544f);}return null;};}function patchUpdates(_0x2bc58f){return function(_0x4ba0bd){try{jsonpatch[_0x533c('0x26')](_0x4ba0bd,_0x2bc58f,!![]);}catch(_0x51785c){return BPromise['reject'](_0x51785c);}return _0x4ba0bd[_0x533c('0x27')]();};}function saveUpdates(_0x36d4e4,_0x5f5090){return function(_0x21dfd3){if(_0x21dfd3){return _0x21dfd3[_0x533c('0x28')](_0x36d4e4)[_0x533c('0x29')](function(_0x3dd249){return _0x3dd249;});}return null;};}function removeEntity(_0x5ebbe0,_0x3762f7){return function(_0x42c87b){if(_0x42c87b){return _0x42c87b[_0x533c('0x2a')]()[_0x533c('0x29')](function(){_0x5ebbe0[_0x533c('0x1d')](0xcc)[_0x533c('0x1e')]();});}};}function handleEntityNotFound(_0xb51a5,_0x43f669){return function(_0xb1c937){if(!_0xb1c937){_0xb51a5[_0x533c('0x1c')](0x194);}return _0xb1c937;};}function handleError(_0x4d47d0,_0x11d775){_0x11d775=_0x11d775||0x1f4;return function(_0xfab4da){logger['error'](_0xfab4da[_0x533c('0x2b')]);if(_0xfab4da['name']){delete _0xfab4da[_0x533c('0x2c')];}_0x4d47d0[_0x533c('0x1d')](_0x11d775)[_0x533c('0x2d')](_0xfab4da);};}exports[_0x533c('0x2e')]=function(_0x425f60,_0x146a8e){var _0x212d1b={},_0x38d886={},_0x3c559b={'count':0x0,'rows':[]};var _0x2fc7fa=_[_0x533c('0x2f')](db[_0x533c('0x30')]['rawAttributes'],function(_0x370263){return{'name':_0x370263['fieldName'],'type':_0x370263[_0x533c('0x31')][_0x533c('0x32')]};});_0x38d886[_0x533c('0x33')]=_[_0x533c('0x34')](_[_0x533c('0x2f')](_0x2fc7fa,_0x533c('0x2c')),[_0x533c('0x35')]);_0x38d886[_0x533c('0x36')]=_[_0x533c('0x37')](_0x425f60[_0x533c('0x36')]);_0x38d886[_0x533c('0x38')]=_[_0x533c('0x39')](_0x38d886[_0x533c('0x33')],_0x38d886[_0x533c('0x36')]);_0x212d1b[_0x533c('0x3a')]=_['intersection'](_0x38d886[_0x533c('0x33')],qs[_0x533c('0x3b')](_0x425f60[_0x533c('0x36')][_0x533c('0x3b')]));_0x212d1b['attributes']=_0x212d1b[_0x533c('0x3a')][_0x533c('0x3c')]?_0x212d1b[_0x533c('0x3a')]:_0x38d886[_0x533c('0x33')];if(!_0x425f60[_0x533c('0x36')]['hasOwnProperty']('nolimit')){_0x212d1b['limit']=qs['limit'](_0x425f60['query'][_0x533c('0x22')]);_0x212d1b['offset']=qs[_0x533c('0x20')](_0x425f60['query'][_0x533c('0x20')]);}_0x212d1b[_0x533c('0x3d')]=qs[_0x533c('0x3e')](_0x425f60['query'][_0x533c('0x3e')]);_0x212d1b[_0x533c('0x3f')]=qs[_0x533c('0x38')](_['pick'](_0x425f60[_0x533c('0x36')],_0x38d886[_0x533c('0x38')]),_0x2fc7fa);if(_0x425f60[_0x533c('0x36')]['filter']){_0x212d1b[_0x533c('0x3f')]=_[_0x533c('0x40')](_0x212d1b[_0x533c('0x3f')],{'$or':_[_0x533c('0x2f')](_0x2fc7fa,function(_0x454dbc){if(_0x454dbc[_0x533c('0x31')]!==_0x533c('0x41')){var _0x2dbd81={};_0x2dbd81[_0x454dbc[_0x533c('0x2c')]]={'$like':'%'+_0x425f60[_0x533c('0x36')][_0x533c('0x42')]+'%'};return _0x2dbd81;}})});}_0x212d1b=_['merge']({},_0x212d1b,_0x425f60[_0x533c('0x43')]);var _0x784493={'where':_0x212d1b[_0x533c('0x3f')]};return db[_0x533c('0x30')][_0x533c('0x23')](_0x784493)[_0x533c('0x29')](function(_0x5d2bf9){_0x3c559b[_0x533c('0x23')]=_0x5d2bf9;if(_0x425f60[_0x533c('0x36')][_0x533c('0x44')]){_0x212d1b['include']=[{'all':!![]}];}return db[_0x533c('0x30')][_0x533c('0x45')](_0x212d1b);})[_0x533c('0x29')](function(_0x1abd47){_0x3c559b['rows']=_0x1abd47;return _0x3c559b;})[_0x533c('0x29')](respondWithFilteredResult(_0x146a8e,_0x212d1b))['catch'](handleError(_0x146a8e,null));};exports[_0x533c('0x46')]=function(_0x39034e,_0x55a372){var _0x3f4015={'raw':![],'where':{'id':_0x39034e[_0x533c('0x47')]['id']}},_0x3f1e47={};_0x3f1e47['model']=_['keys'](db['ScreenRecording']['rawAttributes']);_0x3f1e47[_0x533c('0x36')]=_['keys'](_0x39034e[_0x533c('0x36')]);_0x3f1e47['filters']=_[_0x533c('0x39')](_0x3f1e47['model'],_0x3f1e47[_0x533c('0x36')]);_0x3f4015[_0x533c('0x3a')]=_['intersection'](_0x3f1e47[_0x533c('0x33')],qs[_0x533c('0x3b')](_0x39034e[_0x533c('0x36')][_0x533c('0x3b')]));_0x3f4015[_0x533c('0x3a')]=_0x3f4015['attributes'][_0x533c('0x3c')]?_0x3f4015[_0x533c('0x3a')]:_0x3f1e47[_0x533c('0x33')];if(_0x39034e[_0x533c('0x36')]['includeAll']){_0x3f4015[_0x533c('0x48')]=[{'all':!![]}];}_0x3f4015=_[_0x533c('0x40')]({},_0x3f4015,_0x39034e['options']);return db['ScreenRecording'][_0x533c('0x49')](_0x3f4015)['then'](handleEntityNotFound(_0x55a372,null))[_0x533c('0x29')](respondWithResult(_0x55a372,null))[_0x533c('0x4a')](handleError(_0x55a372,null));};exports[_0x533c('0x4b')]=function(_0x471c59,_0xe9354a){return db[_0x533c('0x30')][_0x533c('0x4b')](_0x471c59[_0x533c('0x4c')],{})['then'](respondWithResult(_0xe9354a,0xc9))[_0x533c('0x4a')](handleError(_0xe9354a,null));};exports[_0x533c('0x28')]=function(_0xaaf682,_0x57c6c6){if(_0xaaf682[_0x533c('0x4c')]['id']){delete _0xaaf682[_0x533c('0x4c')]['id'];}delete _0xaaf682['body'][_0x533c('0x4d')];delete _0xaaf682['body'][_0x533c('0x4e')];delete _0xaaf682[_0x533c('0x4c')][_0x533c('0x4f')];delete _0xaaf682[_0x533c('0x4c')][_0x533c('0x50')];return db[_0x533c('0x30')][_0x533c('0x49')]({'where':{'id':_0xaaf682['params']['id']}})[_0x533c('0x29')](handleEntityNotFound(_0x57c6c6,null))[_0x533c('0x29')](saveUpdates(_0xaaf682[_0x533c('0x4c')],null))[_0x533c('0x29')](respondWithResult(_0x57c6c6,null))[_0x533c('0x4a')](handleError(_0x57c6c6,null));};exports[_0x533c('0x51')]=function(_0x3eb174,_0x50d5a2){return db['ScreenRecording']['describe']()['then'](respondWithResult(_0x50d5a2,null))[_0x533c('0x4a')](handleError(_0x50d5a2,null));};exports[_0x533c('0x52')]=function(_0x5c5dd0,_0xac086b,_0x1da579){var _0x2f6794=require('../../components/encryptor');var _0x1de19e=![];var _0x564a31={};if(_0x5c5dd0['query'][_0x533c('0x31')]&&_0x5c5dd0[_0x533c('0x36')][_0x533c('0x31')]===_0x533c('0x53')){_0x564a31[_0x533c('0x53')]=_0x5c5dd0[_0x533c('0x47')]['id'];}else{_0x564a31['id']=_0x5c5dd0[_0x533c('0x47')]['id'];}return db['ScreenRecording'][_0x533c('0x49')]({'where':_0x564a31,'attributes':['id','value'],'raw':!![]})[_0x533c('0x29')](handleEntityNotFound(_0xac086b,null))[_0x533c('0x29')](function(_0x274686){if(_0x274686){var _0x2c7600=path[_0x533c('0x54')](config[_0x533c('0x55')],_0x533c('0x56'),_0x274686[_0x533c('0x50')]);var _0x58f528=util[_0x533c('0x35')](_0x533c('0x57'),_0x2c7600);if(fs[_0x533c('0x58')](_0x58f528)){_0x1de19e=!![];return _0x2f6794[_0x533c('0x59')](_0x58f528,_0x2c7600,config[_0x533c('0x5a')][_0x533c('0x5b')])['then'](function(){return _0x274686;});}return _0x274686;}})[_0x533c('0x29')](function(_0x554a9f){if(_0x554a9f){var _0x43383e=path[_0x533c('0x54')](config[_0x533c('0x55')],_0x533c('0x56'),_0x554a9f[_0x533c('0x50')]);if(!fs[_0x533c('0x58')](_0x43383e)){throw new db['Sequelize']['ValidationError'](_0x533c('0x5c'));}if(_0x554a9f[_0x533c('0x5d')]){return _0xac086b[_0x533c('0x52')](_0x43383e,_0x554a9f[_0x533c('0x5d')]+path['extname'](_0x43383e),function(){if(_0x1de19e){fs[_0x533c('0x5e')](_0x43383e);}});}else{return _0xac086b[_0x533c('0x52')](_0x43383e,function(_0x8e04c7){if(_0x1de19e){fs[_0x533c('0x5e')](_0x43383e);}});}}})[_0x533c('0x4a')](function(_0x2f2863){if(_0x2f2863[_0x533c('0x5f')]===_0x533c('0x5c')){_0xac086b[_0x533c('0x1d')](0x194)[_0x533c('0x2d')](_0x533c('0x60'));}else{return handleError(_0xac086b,null);}});};exports[_0x533c('0x2a')]=function(_0x13a7f2,_0xea6ea2){return db[_0x533c('0x30')][_0x533c('0x49')]({'where':{'id':_0x13a7f2[_0x533c('0x47')]['id']}})['then'](function(_0x31bba1){if(_['isNil'](_0x31bba1)){throw new ReferenceError('Entity\x20not\x20found');}return _0x31bba1;})[_0x533c('0x29')](function(_0xb23f94){var _0x965b85=path[_0x533c('0x54')](config[_0x533c('0x55')],_0x533c('0x56'),_0xb23f94[_0x533c('0x50')]);logger['info'](_0x533c('0x61'),_0x965b85);if(!_[_0x533c('0x62')](_0xb23f94['value'])&&fs[_0x533c('0x58')](_0x965b85)){logger[_0x533c('0x63')](_0x533c('0x64')+_0x965b85+_0x533c('0x65'));fs['unlinkSync'](_0x965b85);}_0x965b85=_0x965b85+_0x533c('0x66');if(!_[_0x533c('0x62')](_0xb23f94['value'])&&fs[_0x533c('0x58')](_0x965b85)){logger[_0x533c('0x63')]('File:\x20\x22'+_0x965b85+_0x533c('0x65'));fs[_0x533c('0x67')](_0x965b85);}return _0xb23f94;})['then'](function(_0x444f46){if(!_0x444f46)throw new InternalError();return _0x444f46['destroy']();})['then'](function(){_0xea6ea2[_0x533c('0x1d')](0xcc)[_0x533c('0x1e')]();})[_0x533c('0x4a')](handleError(_0xea6ea2,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index 71b1b1c..7353838 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 _0xf86c=['define','ScreenRecording','screen_recordings','interactionid','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./screenRecording.attributes','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf86c,0x146));var _0xcf86=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf86c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xcf86('0x0'));var util=require(_0xcf86('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xcf86('0x2'));var BPromise=require(_0xcf86('0x3'));var rp=require(_0xcf86('0x4'));var fs=require('fs');var path=require(_0xcf86('0x5'));var rimraf=require(_0xcf86('0x6'));var config=require(_0xcf86('0x7'));var attributes=require(_0xcf86('0x8'));module[_0xcf86('0x9')]=function(_0x16e2c1,_0x1f3e66){return _0x16e2c1[_0xcf86('0xa')](_0xcf86('0xb'),attributes,{'tableName':_0xcf86('0xc'),'paranoid':![],'indexes':[{'name':_0xcf86('0xd'),'fields':['interactionid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xc711=['api','bluebird','request-promise','rimraf','./screenRecording.attributes','define','ScreenRecording','screen_recordings','interactionid','../../config/logger'];(function(_0x73b93,_0x4a25ac){var _0xbda8da=function(_0x15d251){while(--_0x15d251){_0x73b93['push'](_0x73b93['shift']());}};_0xbda8da(++_0x4a25ac);}(_0xc711,0x1a3));var _0x1c71=function(_0x3861f7,_0x995b22){_0x3861f7=_0x3861f7-0x0;var _0x50879f=_0xc711[_0x3861f7];return _0x50879f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1c71('0x0'))(_0x1c71('0x1'));var moment=require('moment');var BPromise=require(_0x1c71('0x2'));var rp=require(_0x1c71('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1c71('0x4'));var config=require('../../config/environment');var attributes=require(_0x1c71('0x5'));module['exports']=function(_0x2446e1,_0x2a7b44){return _0x2446e1[_0x1c71('0x6')](_0x1c71('0x7'),attributes,{'tableName':_0x1c71('0x8'),'paranoid':![],'indexes':[{'name':_0x1c71('0x9'),'fields':[_0x1c71('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index 4367b76..0e7bb7d 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 _0x6c2d=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','then','info','ScreenRecording,\x20%s,\x20%s','ScreenRecording,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','lodash'];(function(_0x148c09,_0x4fd39f){var _0x18e613=function(_0xfaa810){while(--_0xfaa810){_0x148c09['push'](_0x148c09['shift']());}};_0x18e613(++_0x4fd39f);}(_0x6c2d,0x1cd));var _0xd6c2=function(_0x1d5400,_0x567e3c){_0x1d5400=_0x1d5400-0x0;var _0x21d9fe=_0x6c2d[_0x1d5400];return _0x21d9fe;};'use strict';var _=require(_0xd6c2('0x0'));var util=require(_0xd6c2('0x1'));var moment=require(_0xd6c2('0x2'));var BPromise=require(_0xd6c2('0x3'));var rs=require(_0xd6c2('0x4'));var fs=require('fs');var Redis=require(_0xd6c2('0x5'));var db=require(_0xd6c2('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xd6c2('0x7'))(_0xd6c2('0x8'));var config=require('../../config/environment');var jayson=require(_0xd6c2('0x9'));var client=jayson[_0xd6c2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c43a7,_0x38357b,_0x431161){return new BPromise(function(_0xce2b59,_0x3143f7){return client[_0xd6c2('0xb')](_0x3c43a7,_0x431161)[_0xd6c2('0xc')](function(_0x3ff7c6){logger[_0xd6c2('0xd')](_0xd6c2('0xe'),_0x38357b,'request\x20sent');logger['debug'](_0xd6c2('0xf'),_0x38357b,_0xd6c2('0x10'),JSON[_0xd6c2('0x11')](_0x3ff7c6));if(_0x3ff7c6[_0xd6c2('0x12')]){if(_0x3ff7c6[_0xd6c2('0x12')]['code']===0x1f4){logger[_0xd6c2('0x12')]('ScreenRecording,\x20%s,\x20%s',_0x38357b,_0x3ff7c6[_0xd6c2('0x12')]['message']);return _0x3143f7(_0x3ff7c6[_0xd6c2('0x12')]['message']);}logger[_0xd6c2('0x12')](_0xd6c2('0xe'),_0x38357b,_0x3ff7c6[_0xd6c2('0x12')]['message']);return _0xce2b59(_0x3ff7c6[_0xd6c2('0x12')][_0xd6c2('0x13')]);}else{logger[_0xd6c2('0xd')](_0xd6c2('0xe'),_0x38357b,_0xd6c2('0x10'));_0xce2b59(_0x3ff7c6[_0xd6c2('0x14')][_0xd6c2('0x13')]);}})['catch'](function(_0x3b6556){logger['error']('ScreenRecording,\x20%s,\x20%s',_0x38357b,_0x3b6556);_0x3143f7(_0x3b6556);});});} \ No newline at end of file +var _0xd248=['ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','then','info'];(function(_0x5e293d,_0xe9faea){var _0x8a0f61=function(_0x1185ef){while(--_0x1185ef){_0x5e293d['push'](_0x5e293d['shift']());}};_0x8a0f61(++_0xe9faea);}(_0xd248,0x95));var _0x8d24=function(_0x3e7b3b,_0x14d240){_0x3e7b3b=_0x3e7b3b-0x0;var _0x2aa720=_0xd248[_0x3e7b3b];return _0x2aa720;};'use strict';var _=require(_0x8d24('0x0'));var util=require(_0x8d24('0x1'));var moment=require('moment');var BPromise=require(_0x8d24('0x2'));var rs=require(_0x8d24('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8d24('0x4'));var logger=require(_0x8d24('0x5'))(_0x8d24('0x6'));var config=require(_0x8d24('0x7'));var jayson=require(_0x8d24('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4a9132,_0x71ebb7,_0x26775c){return new BPromise(function(_0x5eee5f,_0x574368){return client['request'](_0x4a9132,_0x26775c)[_0x8d24('0x9')](function(_0x4ae0af){logger[_0x8d24('0xa')](_0x8d24('0xb'),_0x71ebb7,_0x8d24('0xc'));logger[_0x8d24('0xd')](_0x8d24('0xe'),_0x71ebb7,_0x8d24('0xc'),JSON[_0x8d24('0xf')](_0x4ae0af));if(_0x4ae0af['error']){if(_0x4ae0af[_0x8d24('0x10')]['code']===0x1f4){logger[_0x8d24('0x10')]('ScreenRecording,\x20%s,\x20%s',_0x71ebb7,_0x4ae0af[_0x8d24('0x10')][_0x8d24('0x11')]);return _0x574368(_0x4ae0af[_0x8d24('0x10')][_0x8d24('0x11')]);}logger[_0x8d24('0x10')](_0x8d24('0xb'),_0x71ebb7,_0x4ae0af[_0x8d24('0x10')][_0x8d24('0x11')]);return _0x5eee5f(_0x4ae0af[_0x8d24('0x10')][_0x8d24('0x11')]);}else{logger['info']('ScreenRecording,\x20%s,\x20%s',_0x71ebb7,_0x8d24('0xc'));_0x5eee5f(_0x4ae0af[_0x8d24('0x12')][_0x8d24('0x11')]);}})[_0x8d24('0x13')](function(_0x1b4dd0){logger['error'](_0x8d24('0xb'),_0x71ebb7,_0x1b4dd0);_0x574368(_0x1b4dd0);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index dd4b0fb..11b2b31 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 _0x62de=['Router','fs-extra','../../components/interaction/service','../../config/environment','./setting.controller','isAuthenticated','index','get','getDate','/:id','show','/:id/logo','getLogo','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','getPreferred','/:id/favicon','diskStorage','server/files/images/logos/','%s%s','logo','extname','originalname','single','file','addLogo','root','format','logologin','addLogoLogin','join','preferred','post','addPreferred','favicon','addFavicon','put','update','exports','util','path','express'];(function(_0x390aad,_0xc3bad2){var _0x5e8dfb=function(_0x32b315){while(--_0x32b315){_0x390aad['push'](_0x390aad['shift']());}};_0x5e8dfb(++_0xc3bad2);}(_0x62de,0x10b));var _0xe62d=function(_0xf18701,_0x5c68d6){_0xf18701=_0xf18701-0x0;var _0x1e4498=_0x62de[_0xf18701];return _0x1e4498;};'use strict';var multer=require('multer');var util=require(_0xe62d('0x0'));var path=require(_0xe62d('0x1'));var timeout=require('connect-timeout');var express=require(_0xe62d('0x2'));var router=express[_0xe62d('0x3')]();var fs_extra=require(_0xe62d('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xe62d('0x5'));var config=require(_0xe62d('0x6'));var controller=require(_0xe62d('0x7'));router['get']('/',auth[_0xe62d('0x8')](),controller[_0xe62d('0x9')]);router[_0xe62d('0xa')]('/now',controller[_0xe62d('0xb')]);router[_0xe62d('0xa')](_0xe62d('0xc'),controller[_0xe62d('0xd')]);router[_0xe62d('0xa')](_0xe62d('0xe'),controller[_0xe62d('0xf')]);router['get'](_0xe62d('0x10'),controller[_0xe62d('0x11')]);router[_0xe62d('0xa')](_0xe62d('0x12'),controller[_0xe62d('0x13')]);router[_0xe62d('0xa')](_0xe62d('0x14'),controller[_0xe62d('0x15')]);router[_0xe62d('0xa')](_0xe62d('0x16'),controller['getFavicon']);var upload=multer({'storage':multer[_0xe62d('0x17')]({'destination':function(_0x3d21d4,_0x5dcbf9,_0x435cf0){_0x435cf0(null,path['join'](config['root'],_0xe62d('0x18')));},'filename':function(_0x1fd793,_0x23ac2a,_0x31636e){_0x31636e(null,util['format'](_0xe62d('0x19'),_0xe62d('0x1a'),path[_0xe62d('0x1b')](_0x23ac2a[_0xe62d('0x1c')])));}})});router['post'](_0xe62d('0xe'),upload[_0xe62d('0x1d')](_0xe62d('0x1e')),controller[_0xe62d('0x1f')]);var upload=multer({'storage':multer[_0xe62d('0x17')]({'destination':function(_0x325f8b,_0x5df1be,_0x397486){_0x397486(null,path['join'](config[_0xe62d('0x20')],_0xe62d('0x18')));},'filename':function(_0x331c1b,_0x567ee0,_0x4f91a9){_0x4f91a9(null,util[_0xe62d('0x21')]('%s%s',_0xe62d('0x22'),path[_0xe62d('0x1b')](_0x567ee0[_0xe62d('0x1c')])));}})});router['post'](_0xe62d('0x10'),upload[_0xe62d('0x1d')](_0xe62d('0x1e')),controller[_0xe62d('0x23')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x9ac94c,_0x3140c4,_0xd618bd){_0xd618bd(null,path[_0xe62d('0x24')](config[_0xe62d('0x20')],_0xe62d('0x18')));},'filename':function(_0xb1122d,_0x2a5161,_0x1f7e30){_0x1f7e30(null,util[_0xe62d('0x21')]('%s%s',_0xe62d('0x25'),path[_0xe62d('0x1b')](_0x2a5161[_0xe62d('0x1c')])));}})});router[_0xe62d('0x26')](_0xe62d('0x14'),upload[_0xe62d('0x1d')](_0xe62d('0x1e')),controller[_0xe62d('0x27')]);var upload=multer({'storage':multer[_0xe62d('0x17')]({'destination':function(_0x5848bb,_0x1e0013,_0x17e6a2){_0x17e6a2(null,path['join'](config['root'],_0xe62d('0x18')));},'filename':function(_0x2e99f1,_0x2db5ec,_0x38fdb7){_0x38fdb7(null,util[_0xe62d('0x21')]('%s%s',_0xe62d('0x28'),path[_0xe62d('0x1b')](_0x2db5ec['originalname'])));}})});router['post'](_0xe62d('0x16'),upload[_0xe62d('0x1d')]('file'),controller[_0xe62d('0x29')]);router[_0xe62d('0x2a')](_0xe62d('0xc'),auth[_0xe62d('0x8')](),controller[_0xe62d('0x2b')]);module[_0xe62d('0x2c')]=router; \ No newline at end of file +var _0xa16e=['/:id/logo_login','/:id/gdpr','getFavicon','diskStorage','join','root','format','%s%s','logo','extname','originalname','post','single','file','addLogo','server/files/images/logos/','addLogoLogin','preferred','/:id/preferred','favicon','/:id/favicon','addFavicon','put','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/now','getDate','/:id','/:id/logo','getLogo'];(function(_0xa6cb09,_0x39410f){var _0x12b437=function(_0x1813cc){while(--_0x1813cc){_0xa6cb09['push'](_0xa6cb09['shift']());}};_0x12b437(++_0x39410f);}(_0xa16e,0xdf));var _0xea16=function(_0x2093e3,_0x8eb650){_0x2093e3=_0x2093e3-0x0;var _0x841d6=_0xa16e[_0x2093e3];return _0x841d6;};'use strict';var multer=require(_0xea16('0x0'));var util=require(_0xea16('0x1'));var path=require(_0xea16('0x2'));var timeout=require(_0xea16('0x3'));var express=require(_0xea16('0x4'));var router=express[_0xea16('0x5')]();var fs_extra=require(_0xea16('0x6'));var auth=require(_0xea16('0x7'));var interaction=require(_0xea16('0x8'));var config=require('../../config/environment');var controller=require('./setting.controller');router[_0xea16('0x9')]('/',auth[_0xea16('0xa')](),controller[_0xea16('0xb')]);router[_0xea16('0x9')](_0xea16('0xc'),controller[_0xea16('0xd')]);router[_0xea16('0x9')](_0xea16('0xe'),controller['show']);router[_0xea16('0x9')](_0xea16('0xf'),controller[_0xea16('0x10')]);router[_0xea16('0x9')](_0xea16('0x11'),controller['getLogoLogin']);router[_0xea16('0x9')](_0xea16('0x12'),controller['gdpr']);router[_0xea16('0x9')]('/:id/preferred',controller['getPreferred']);router[_0xea16('0x9')]('/:id/favicon',controller[_0xea16('0x13')]);var upload=multer({'storage':multer[_0xea16('0x14')]({'destination':function(_0x2f0d8b,_0x35c798,_0x432bef){_0x432bef(null,path[_0xea16('0x15')](config[_0xea16('0x16')],'server/files/images/logos/'));},'filename':function(_0x11ac06,_0x11ee13,_0x12bcdd){_0x12bcdd(null,util[_0xea16('0x17')](_0xea16('0x18'),_0xea16('0x19'),path[_0xea16('0x1a')](_0x11ee13[_0xea16('0x1b')])));}})});router[_0xea16('0x1c')]('/:id/logo',upload[_0xea16('0x1d')](_0xea16('0x1e')),controller[_0xea16('0x1f')]);var upload=multer({'storage':multer[_0xea16('0x14')]({'destination':function(_0x545ee1,_0x4cb727,_0x20f15d){_0x20f15d(null,path[_0xea16('0x15')](config['root'],_0xea16('0x20')));},'filename':function(_0x1ce3eb,_0x1a9019,_0x43b8cb){_0x43b8cb(null,util[_0xea16('0x17')](_0xea16('0x18'),'logologin',path['extname'](_0x1a9019[_0xea16('0x1b')])));}})});router[_0xea16('0x1c')]('/:id/logo_login',upload[_0xea16('0x1d')](_0xea16('0x1e')),controller[_0xea16('0x21')]);var upload=multer({'storage':multer[_0xea16('0x14')]({'destination':function(_0x246df3,_0x4425b0,_0x20db88){_0x20db88(null,path[_0xea16('0x15')](config['root'],_0xea16('0x20')));},'filename':function(_0x2c1f85,_0x272b7f,_0x29d66a){_0x29d66a(null,util[_0xea16('0x17')](_0xea16('0x18'),_0xea16('0x22'),path[_0xea16('0x1a')](_0x272b7f[_0xea16('0x1b')])));}})});router[_0xea16('0x1c')](_0xea16('0x23'),upload[_0xea16('0x1d')](_0xea16('0x1e')),controller['addPreferred']);var upload=multer({'storage':multer[_0xea16('0x14')]({'destination':function(_0x4ac8a3,_0x5d584a,_0x39cadd){_0x39cadd(null,path[_0xea16('0x15')](config[_0xea16('0x16')],_0xea16('0x20')));},'filename':function(_0x4125c0,_0x21545b,_0xbc28a6){_0xbc28a6(null,util[_0xea16('0x17')](_0xea16('0x18'),_0xea16('0x24'),path[_0xea16('0x1a')](_0x21545b['originalname'])));}})});router[_0xea16('0x1c')](_0xea16('0x25'),upload['single'](_0xea16('0x1e')),controller[_0xea16('0x26')]);router[_0xea16('0x27')](_0xea16('0xe'),auth['isAuthenticated'](),controller['update']);module['exports']=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index a02c98f..9ee7d5c 100644 --- a/server/api/setting/setting.attributes.js +++ b/server/api/setting/setting.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['BOOLEAN','alternate','UNSIGNED','sequelize','exports','INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted'];(function(_0x4bda2f,_0x1a3dd1){var _0x418568=function(_0x2bf08d){while(--_0x2bf08d){_0x4bda2f['push'](_0x4bda2f['shift']());}};_0x418568(++_0x1a3dd1);}(_0xa9e0,0x123));var _0x0a9e=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0xa9e0[_0xae7c2f];return _0x5d7001;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'min_internal':{'type':Sequelize[_0x0a9e('0x2')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0x0a9e('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x5')},'logo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLogo':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x0a9e('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0x0a9e('0x4')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0x0a9e('0x4')]},'defaultPageTitle':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x0a9e('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x7')},'chatTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x0a9e('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x0a9e('0x4')]},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0x0a9e('0x4')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x0a9e('0x2')]},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x0a9e('0x4')]},'bucket':{'type':Sequelize[_0x0a9e('0x4')]},'googleSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x0a9e('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5,'validate':{'min':0x1}},'disabledCookie':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x14}}; \ No newline at end of file +var _0xa9e0=['BOOLEAN','alternate','UNSIGNED','sequelize','exports','INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted'];(function(_0x5040a2,_0x1f6263){var _0x95e3b2=function(_0x49bc7c){while(--_0x49bc7c){_0x5040a2['push'](_0x5040a2['shift']());}};_0x95e3b2(++_0x1f6263);}(_0xa9e0,0x123));var _0x0a9e=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0xa9e0[_0x173d7e];return _0x2220d6;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'min_internal':{'type':Sequelize[_0x0a9e('0x2')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0x0a9e('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x5')},'logo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLogo':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x0a9e('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0x0a9e('0x4')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0x0a9e('0x4')]},'defaultPageTitle':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x0a9e('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x7')},'chatTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x0a9e('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x0a9e('0x4')]},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0x0a9e('0x4')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x0a9e('0x2')]},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x0a9e('0x4')]},'bucket':{'type':Sequelize[_0x0a9e('0x4')]},'googleSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x0a9e('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5,'validate':{'min':0x1}},'disabledCookie':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x14}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index dac37c6..b4bd42f 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 _0xa27b=['offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','name','index','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','merge','where','VIRTUAL','filter','options','includeAll','include','Setting','findAll','find','body','params','file','filename','logo','addLogoLogin','loginLogo','server/files/images/logos','getLicense','preferred','favicon','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','join','root','toLower','default_logo.svg','default','upperFirst','custom','Sequelize','\x20not\x20found','download','getLogoLogin','defaultLogo','default_loginLogo.svg','ValidationError','gdpr','securePassword','addPreferred','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','getDate','now','format','YYYY-MM-DD\x20HH:mm:ss:SSS','send','zip-dir','request-promise','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','request','then','info','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','error','Setting,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json'];(function(_0x1992f1,_0x5c61f0){var _0x413dfe=function(_0x2136e5){while(--_0x2136e5){_0x1992f1['push'](_0x1992f1['shift']());}};_0x413dfe(++_0x5c61f0);}(_0xa27b,0x1b5));var _0xba27=function(_0x5af903,_0x258d63){_0x5af903=_0x5af903-0x0;var _0x6b0e75=_0xa27b[_0x5af903];return _0x6b0e75;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xba27('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xba27('0x1'));var moment=require('moment');var BPromise=require(_0xba27('0x2'));var Mustache=require(_0xba27('0x3'));var util=require('util');var path=require(_0xba27('0x4'));var sox=require('sox');var csv=require(_0xba27('0x5'));var ejs=require(_0xba27('0x6'));var fs=require('fs');var fs_extra=require(_0xba27('0x7'));var _=require(_0xba27('0x8'));var squel=require(_0xba27('0x9'));var crypto=require(_0xba27('0xa'));var jsforce=require(_0xba27('0xb'));var deskjs=require(_0xba27('0xc'));var toCsv=require(_0xba27('0x5'));var querystring=require(_0xba27('0xd'));var Papa=require('papaparse');var Redis=require(_0xba27('0xe'));var authService=require(_0xba27('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xba27('0x10'));var hardwareService=require(_0xba27('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0xba27('0x12'));var config=require(_0xba27('0x13'));var licenseUtil=require(_0xba27('0x14'));var db=require(_0xba27('0x15'))['db'];var jayson=require(_0xba27('0x16'));var client=jayson[_0xba27('0x17')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2b71e0,_0x443022,_0x24afbf,_0x23cf61){return new BPromise(function(_0x142f52,_0x2859f8){var _0xc0936b=_0x23cf61||client;return _0xc0936b[_0xba27('0x18')](_0x2b71e0,_0x24afbf)[_0xba27('0x19')](function(_0x124f17){logger[_0xba27('0x1a')]('Setting,\x20%s,\x20%s',_0x443022,_0xba27('0x1b'));logger[_0xba27('0x1c')](_0xba27('0x1d'),_0x443022,'request\x20sent',JSON['stringify'](_0x124f17));if(_0x124f17['error']){if(_0x124f17[_0xba27('0x1e')]['code']===0x1f4){logger['error'](_0xba27('0x1f'),_0x443022,_0x124f17[_0xba27('0x1e')][_0xba27('0x20')]);return _0x2859f8(_0x124f17[_0xba27('0x1e')][_0xba27('0x20')]);}logger['error']('Setting,\x20%s,\x20%s',_0x443022,_0x124f17['error'][_0xba27('0x20')]);return _0x142f52(_0x124f17[_0xba27('0x1e')][_0xba27('0x20')]);}else{logger['info'](_0xba27('0x1f'),_0x443022,_0xba27('0x1b'));_0x142f52(_0x124f17[_0xba27('0x21')]['message']);}})[_0xba27('0x22')](function(_0x41a5ce){logger['error'](_0xba27('0x1f'),_0x443022,_0x41a5ce);_0x2859f8(_0x41a5ce);});});}function respondWithStatusCode(_0x36f838,_0x54c2b9){_0x54c2b9=_0x54c2b9||0xcc;return function(_0x548bba){if(_0x548bba){return _0x36f838[_0xba27('0x23')](_0x54c2b9);}return _0x36f838[_0xba27('0x24')](_0x54c2b9)[_0xba27('0x25')]();};}function respondWithResult(_0x259ec3,_0xf29a2a){_0xf29a2a=_0xf29a2a||0xc8;return function(_0x44cb98){if(_0x44cb98){return _0x259ec3[_0xba27('0x24')](_0xf29a2a)[_0xba27('0x26')](_0x44cb98);}};}function respondWithFilteredResult(_0x5ea3bd,_0x5d80dc){return function(_0x29d1c1){if(_0x29d1c1){var _0x5c8393=typeof _0x5d80dc[_0xba27('0x27')]===_0xba27('0x28')&&typeof _0x5d80dc[_0xba27('0x29')]===_0xba27('0x28');var _0x10066a=_0x29d1c1[_0xba27('0x2a')];var _0x505a63=_0x5c8393?0x0:_0x5d80dc[_0xba27('0x27')];var _0x53c9d3=_0x5c8393?_0x29d1c1['count']:_0x5d80dc[_0xba27('0x27')]+_0x5d80dc[_0xba27('0x29')];var _0x15ca41;if(_0x53c9d3>=_0x10066a){_0x53c9d3=_0x10066a;_0x15ca41=0xc8;}else{_0x15ca41=0xce;}_0x5ea3bd[_0xba27('0x24')](_0x15ca41);return _0x5ea3bd[_0xba27('0x2b')](_0xba27('0x2c'),_0x505a63+'-'+_0x53c9d3+'/'+_0x10066a)[_0xba27('0x26')](_0x29d1c1);}return null;};}function patchUpdates(_0x51e97c){return function(_0x3118ab){try{jsonpatch[_0xba27('0x2d')](_0x3118ab,_0x51e97c,!![]);}catch(_0x936589){return BPromise[_0xba27('0x2e')](_0x936589);}return _0x3118ab[_0xba27('0x2f')]();};}function saveUpdates(_0xde5b8c,_0x4bb18b){return function(_0x2dc7a0){if(_0x2dc7a0){return _0x2dc7a0[_0xba27('0x30')](_0xde5b8c)['then'](function(_0x3ffc0c){return _0x3ffc0c;});}return null;};}function removeEntity(_0x58a68e,_0x19b835){return function(_0x1d4ca2){if(_0x1d4ca2){return _0x1d4ca2[_0xba27('0x31')]()['then'](function(){_0x58a68e[_0xba27('0x24')](0xcc)[_0xba27('0x25')]();});}};}function handleEntityNotFound(_0x33273d,_0x29397a){return function(_0x19d37a){if(!_0x19d37a){_0x33273d[_0xba27('0x23')](0x194);}return _0x19d37a;};}function handleError(_0x2b8752,_0x188fcd){_0x188fcd=_0x188fcd||0x1f4;return function(_0x22cb76){logger[_0xba27('0x1e')](_0x22cb76['stack']);if(_0x22cb76[_0xba27('0x32')]){delete _0x22cb76[_0xba27('0x32')];}_0x2b8752[_0xba27('0x24')](_0x188fcd)['send'](_0x22cb76);};}exports[_0xba27('0x33')]=function(_0x16da6c,_0x1e2ffb){var _0x169382={},_0x2a4447={},_0x58da2b={'count':0x0,'rows':[]};var _0x326bd9=_['map'](db['Setting'][_0xba27('0x34')],function(_0x2faf31){return{'name':_0x2faf31[_0xba27('0x35')],'type':_0x2faf31[_0xba27('0x36')]['key']};});_0x2a4447[_0xba27('0x37')]=_[_0xba27('0x38')](_0x326bd9,_0xba27('0x32'));_0x2a4447[_0xba27('0x39')]=_[_0xba27('0x3a')](_0x16da6c[_0xba27('0x39')]);_0x2a4447[_0xba27('0x3b')]=_[_0xba27('0x3c')](_0x2a4447[_0xba27('0x37')],_0x2a4447[_0xba27('0x39')]);_0x169382[_0xba27('0x3d')]=_[_0xba27('0x3c')](_0x2a4447[_0xba27('0x37')],qs[_0xba27('0x3e')](_0x16da6c[_0xba27('0x39')][_0xba27('0x3e')]));_0x169382['attributes']=_0x169382[_0xba27('0x3d')][_0xba27('0x3f')]?_0x169382[_0xba27('0x3d')]:_0x2a4447[_0xba27('0x37')];if(!_0x16da6c[_0xba27('0x39')]['hasOwnProperty'](_0xba27('0x40'))){_0x169382['limit']=qs[_0xba27('0x29')](_0x16da6c[_0xba27('0x39')]['limit']);_0x169382[_0xba27('0x27')]=qs[_0xba27('0x27')](_0x16da6c[_0xba27('0x39')][_0xba27('0x27')]);}_0x169382[_0xba27('0x41')]=qs[_0xba27('0x42')](_0x16da6c[_0xba27('0x39')][_0xba27('0x42')]);_0x169382['where']=qs[_0xba27('0x3b')](_[_0xba27('0x43')](_0x16da6c[_0xba27('0x39')],_0x2a4447[_0xba27('0x3b')]),_0x326bd9);if(_0x16da6c[_0xba27('0x39')]['filter']){_0x169382['where']=_[_0xba27('0x44')](_0x169382[_0xba27('0x45')],{'$or':_[_0xba27('0x38')](_0x326bd9,function(_0x4fd97e){if(_0x4fd97e[_0xba27('0x36')]!==_0xba27('0x46')){var _0x168101={};_0x168101[_0x4fd97e['name']]={'$like':'%'+_0x16da6c[_0xba27('0x39')][_0xba27('0x47')]+'%'};return _0x168101;}})});}_0x169382=_[_0xba27('0x44')]({},_0x169382,_0x16da6c[_0xba27('0x48')]);var _0x55375d={'where':_0x169382[_0xba27('0x45')]};return db['Setting'][_0xba27('0x2a')](_0x55375d)['then'](function(_0xbe7c23){_0x58da2b[_0xba27('0x2a')]=_0xbe7c23;if(_0x16da6c[_0xba27('0x39')][_0xba27('0x49')]){_0x169382[_0xba27('0x4a')]=[{'all':!![]}];}return db[_0xba27('0x4b')][_0xba27('0x4c')](_0x169382);})[_0xba27('0x19')](function(_0x3c896c){_0x58da2b['rows']=_0x3c896c;return _0x58da2b;})[_0xba27('0x19')](respondWithFilteredResult(_0x1e2ffb,_0x169382))[_0xba27('0x22')](handleError(_0x1e2ffb,null));};exports['show']=function(_0x41078a,_0x50a2d3){var _0xee30a2={'raw':![],'where':{'id':_0x41078a['params']['id']}},_0x5e902d={};_0x5e902d[_0xba27('0x37')]=_[_0xba27('0x3a')](db[_0xba27('0x4b')][_0xba27('0x34')]);_0x5e902d['query']=_[_0xba27('0x3a')](_0x41078a['query']);_0x5e902d[_0xba27('0x3b')]=_[_0xba27('0x3c')](_0x5e902d[_0xba27('0x37')],_0x5e902d[_0xba27('0x39')]);_0xee30a2['attributes']=_['intersection'](_0x5e902d[_0xba27('0x37')],qs[_0xba27('0x3e')](_0x41078a['query'][_0xba27('0x3e')]));_0xee30a2['attributes']=_0xee30a2[_0xba27('0x3d')][_0xba27('0x3f')]?_0xee30a2[_0xba27('0x3d')]:_0x5e902d[_0xba27('0x37')];if(_0x41078a[_0xba27('0x39')][_0xba27('0x49')]){_0xee30a2[_0xba27('0x4a')]=[{'all':!![]}];}_0xee30a2=_[_0xba27('0x44')]({},_0xee30a2,_0x41078a[_0xba27('0x48')]);return db[_0xba27('0x4b')][_0xba27('0x4d')](_0xee30a2)[_0xba27('0x19')](handleEntityNotFound(_0x50a2d3,null))[_0xba27('0x19')](respondWithResult(_0x50a2d3,null))[_0xba27('0x22')](handleError(_0x50a2d3,null));};exports[_0xba27('0x30')]=function(_0x443fa7,_0x344f97){if(_0x443fa7[_0xba27('0x4e')]['id']){delete _0x443fa7[_0xba27('0x4e')]['id'];}return db[_0xba27('0x4b')]['find']({'where':{'id':_0x443fa7[_0xba27('0x4f')]['id']}})[_0xba27('0x19')](handleEntityNotFound(_0x344f97,null))['then'](saveUpdates(_0x443fa7[_0xba27('0x4e')],null))[_0xba27('0x19')](respondWithResult(_0x344f97,null))[_0xba27('0x22')](handleError(_0x344f97,null));};exports['addLogo']=function(_0x557003,_0x162eef,_0x20d695){if(_0x557003[_0xba27('0x50')]&&_0x557003['file'][_0xba27('0x51')]){_0x557003[_0xba27('0x4e')][_0xba27('0x52')]=_0x557003['file'][_0xba27('0x51')];}return db['Setting'][_0xba27('0x4d')]({'where':{'id':_0x557003[_0xba27('0x4f')]['id']}})[_0xba27('0x19')](handleEntityNotFound(_0x162eef,null))[_0xba27('0x19')](saveUpdates(_0x557003['body'],null))['then'](respondWithResult(_0x162eef,null))[_0xba27('0x22')](handleError(_0x162eef,null));};exports[_0xba27('0x53')]=function(_0x241028,_0x361b45,_0x2136ed){if(_0x241028[_0xba27('0x50')]&&_0x241028[_0xba27('0x50')][_0xba27('0x51')]){_0x241028[_0xba27('0x4e')][_0xba27('0x54')]=_0x241028[_0xba27('0x50')]['filename'];}return db['Setting']['find']({'where':{'id':_0x241028[_0xba27('0x4f')]['id']}})[_0xba27('0x19')](handleEntityNotFound(_0x361b45,null))['then'](saveUpdates(_0x241028[_0xba27('0x4e')],null))[_0xba27('0x19')](respondWithResult(_0x361b45,null))['catch'](handleError(_0x361b45,null));};var utilLicense=require(_0xba27('0x14'));exports['getLogo']=function(_0x311dec,_0x20395c,_0x3346b6){var _0x36f185=_0xba27('0x55');var _0x35dc03={'custom':![]};return utilLicense[_0xba27('0x56')]()['then'](function(_0x3b9b3c){if(_0x3b9b3c){_0x35dc03=_0x3b9b3c;}return db[_0xba27('0x4b')]['find']({'where':{'id':_0x311dec[_0xba27('0x4f')]['id']},'attributes':['logo',_0xba27('0x54'),_0xba27('0x57'),_0xba27('0x58'),'defaultLogo',_0xba27('0x59'),_0xba27('0x5a'),_0xba27('0x5b')],'raw':!![]});})[_0xba27('0x19')](handleEntityNotFound(_0x20395c,null))[_0xba27('0x19')](function(_0x229ec1){if(_0x229ec1){var _0xa2c527=_0x229ec1[_0xba27('0x52')]&&fs[_0xba27('0x5c')](path[_0xba27('0x5d')](config[_0xba27('0x5e')],_0x36f185,_[_0xba27('0x5f')](_0x229ec1[_0xba27('0x52')])))?path[_0xba27('0x5d')](config['root'],_0x36f185,_[_0xba27('0x5f')](_0x229ec1['logo'])):path[_0xba27('0x5d')](config[_0xba27('0x5e')],_0x36f185,_['toLower'](_0xba27('0x60')));var _0x2cc768=_0xba27('0x61')+_[_0xba27('0x62')](_0xba27('0x52'));if(_0x229ec1[_0x2cc768]||!_0x35dc03[_0xba27('0x63')]){_0xa2c527=path[_0xba27('0x5d')](config[_0xba27('0x5e')],_0x36f185,_[_0xba27('0x5f')]('default_logo.svg'));}if(!fs[_0xba27('0x5c')](_0xa2c527)){throw new db[(_0xba27('0x64'))]['ValidationError'](_[_0xba27('0x62')](_0xba27('0x52'))+_0xba27('0x65'));}return _0x20395c[_0xba27('0x66')](_0xa2c527);}})[_0xba27('0x22')](handleError(_0x20395c,null));};var utilLicense=require(_0xba27('0x14'));exports[_0xba27('0x67')]=function(_0x14c4ab,_0x2c9802,_0xb5840c){var _0x946a3f=_0xba27('0x55');var _0x5ebddd={'custom':![]};return utilLicense[_0xba27('0x56')]()[_0xba27('0x19')](function(_0x5cdaf6){if(_0x5cdaf6){_0x5ebddd=_0x5cdaf6;}return db[_0xba27('0x4b')]['find']({'where':{'id':_0x14c4ab[_0xba27('0x4f')]['id']},'attributes':[_0xba27('0x52'),'loginLogo',_0xba27('0x57'),_0xba27('0x58'),_0xba27('0x68'),_0xba27('0x59'),_0xba27('0x5a'),_0xba27('0x5b')],'raw':!![]});})[_0xba27('0x19')](handleEntityNotFound(_0x2c9802,null))[_0xba27('0x19')](function(_0xe6ba13){if(_0xe6ba13){var _0x598ded=_0xe6ba13[_0xba27('0x54')]&&fs[_0xba27('0x5c')](path[_0xba27('0x5d')](config[_0xba27('0x5e')],_0x946a3f,_[_0xba27('0x5f')](_0xe6ba13[_0xba27('0x54')])))?path['join'](config['root'],_0x946a3f,_['toLower'](_0xe6ba13[_0xba27('0x54')])):path[_0xba27('0x5d')](config[_0xba27('0x5e')],_0x946a3f,_[_0xba27('0x5f')]('default_loginLogo.svg'));var _0x610963=_0xba27('0x61')+_[_0xba27('0x62')](_0xba27('0x54'));if(_0xe6ba13[_0x610963]||!_0x5ebddd[_0xba27('0x63')]){_0x598ded=path[_0xba27('0x5d')](config[_0xba27('0x5e')],_0x946a3f,_['toLower'](_0xba27('0x69')));}if(!fs['existsSync'](_0x598ded)){throw new db[(_0xba27('0x64'))][(_0xba27('0x6a'))](_['upperFirst']('loginLogo')+'\x20not\x20found');}return _0x2c9802[_0xba27('0x66')](_0x598ded);}})[_0xba27('0x22')](handleError(_0x2c9802,null));};exports[_0xba27('0x6b')]=function(_0x1c78a9,_0x40fbb7){return db['Setting'][_0xba27('0x4d')]({'where':{'id':_0x1c78a9[_0xba27('0x4f')]['id']},'attributes':[_0xba27('0x6c')]})[_0xba27('0x19')](respondWithResult(_0x40fbb7,null))['catch'](handleError(_0x40fbb7,null));};exports[_0xba27('0x6d')]=function(_0x46a00e,_0x4c7003,_0x41767d){if(_0x46a00e[_0xba27('0x50')]&&_0x46a00e[_0xba27('0x50')][_0xba27('0x51')]){_0x46a00e['body'][_0xba27('0x57')]=_0x46a00e[_0xba27('0x50')]['filename'];}return db[_0xba27('0x4b')][_0xba27('0x4d')]({'where':{'id':_0x46a00e[_0xba27('0x4f')]['id']}})[_0xba27('0x19')](handleEntityNotFound(_0x4c7003,null))[_0xba27('0x19')](saveUpdates(_0x46a00e[_0xba27('0x4e')],null))[_0xba27('0x19')](respondWithResult(_0x4c7003,null))[_0xba27('0x22')](handleError(_0x4c7003,null));};var utilLicense=require(_0xba27('0x14'));exports['getPreferred']=function(_0x36bebf,_0x475a24,_0x11d4cb){var _0x26879f='server/files/images/logos';var _0x57b56f={'custom':![]};return utilLicense['getLicense']()['then'](function(_0x14ddfa){if(_0x14ddfa){_0x57b56f=_0x14ddfa;}return db[_0xba27('0x4b')]['find']({'where':{'id':_0x36bebf[_0xba27('0x4f')]['id']},'attributes':[_0xba27('0x52'),_0xba27('0x54'),_0xba27('0x57'),_0xba27('0x58'),_0xba27('0x68'),_0xba27('0x59'),_0xba27('0x5a'),_0xba27('0x5b')],'raw':!![]});})[_0xba27('0x19')](handleEntityNotFound(_0x475a24,null))[_0xba27('0x19')](function(_0x5cb939){if(_0x5cb939){var _0x50ade6=_0x5cb939['preferred']&&fs['existsSync'](path[_0xba27('0x5d')](config[_0xba27('0x5e')],_0x26879f,_[_0xba27('0x5f')](_0x5cb939[_0xba27('0x57')])))?path[_0xba27('0x5d')](config[_0xba27('0x5e')],_0x26879f,_[_0xba27('0x5f')](_0x5cb939[_0xba27('0x57')])):path['join'](config[_0xba27('0x5e')],_0x26879f,_[_0xba27('0x5f')](_0xba27('0x6e')));var _0x197bde='default'+_[_0xba27('0x62')](_0xba27('0x57'));if(_0x5cb939[_0x197bde]||!_0x57b56f[_0xba27('0x63')]||!_0x57b56f['preferred']){_0x50ade6=path[_0xba27('0x5d')](config[_0xba27('0x5e')],_0x26879f,_[_0xba27('0x5f')]('default_preferred.png'));}if(!fs[_0xba27('0x5c')](_0x50ade6)){throw new db[(_0xba27('0x64'))][(_0xba27('0x6a'))](_[_0xba27('0x62')](_0xba27('0x57'))+_0xba27('0x65'));}return _0x475a24[_0xba27('0x66')](_0x50ade6);}})[_0xba27('0x22')](handleError(_0x475a24,null));};exports[_0xba27('0x6f')]=function(_0x55d053,_0xa01c3e,_0x9f2711){if(_0x55d053[_0xba27('0x50')]&&_0x55d053[_0xba27('0x50')][_0xba27('0x51')]){_0x55d053[_0xba27('0x4e')][_0xba27('0x58')]=_0x55d053[_0xba27('0x50')][_0xba27('0x51')];}return db[_0xba27('0x4b')][_0xba27('0x4d')]({'where':{'id':_0x55d053[_0xba27('0x4f')]['id']}})['then'](handleEntityNotFound(_0xa01c3e,null))[_0xba27('0x19')](saveUpdates(_0x55d053[_0xba27('0x4e')],null))['then'](respondWithResult(_0xa01c3e,null))[_0xba27('0x22')](handleError(_0xa01c3e,null));};var utilLicense=require(_0xba27('0x14'));exports[_0xba27('0x70')]=function(_0x723f27,_0x473a0e,_0x3ade7c){var _0x469f89='server/files/images/logos';var _0x474647={'custom':![]};return utilLicense[_0xba27('0x56')]()[_0xba27('0x19')](function(_0x386373){if(_0x386373){_0x474647=_0x386373;}return db['Setting'][_0xba27('0x4d')]({'where':{'id':_0x723f27['params']['id']},'attributes':[_0xba27('0x52'),_0xba27('0x54'),_0xba27('0x57'),_0xba27('0x58'),'defaultLogo',_0xba27('0x59'),_0xba27('0x5a'),_0xba27('0x5b')],'raw':!![]});})['then'](handleEntityNotFound(_0x473a0e,null))[_0xba27('0x19')](function(_0x4a4358){if(_0x4a4358){var _0xf33acd=_0x4a4358['favicon']&&fs[_0xba27('0x5c')](path[_0xba27('0x5d')](config[_0xba27('0x5e')],_0x469f89,_[_0xba27('0x5f')](_0x4a4358[_0xba27('0x58')])))?path[_0xba27('0x5d')](config[_0xba27('0x5e')],_0x469f89,_[_0xba27('0x5f')](_0x4a4358[_0xba27('0x58')])):path['join'](config[_0xba27('0x5e')],_0x469f89,_[_0xba27('0x5f')](_0xba27('0x71')));var _0x1952fa=_0xba27('0x61')+_[_0xba27('0x62')](_0xba27('0x58'));if(_0x4a4358[_0x1952fa]||!_0x474647['custom']){_0xf33acd=path[_0xba27('0x5d')](config[_0xba27('0x5e')],_0x469f89,_['toLower'](_0xba27('0x71')));}if(!fs[_0xba27('0x5c')](_0xf33acd)){throw new db['Sequelize']['ValidationError'](_[_0xba27('0x62')](_0xba27('0x58'))+_0xba27('0x65'));}return _0x473a0e['download'](_0xf33acd);}})['catch'](handleError(_0x473a0e,null));};exports[_0xba27('0x72')]=function(_0x8bac4c,_0x5a6386){var _0x4885ce={'offset':moment()['utcOffset']()};_0x4885ce[_0xba27('0x73')]=moment()['utcOffset'](_0x4885ce[_0xba27('0x27')])[_0xba27('0x74')](_0xba27('0x75'));return _0x5a6386[_0xba27('0x24')](0xc8)[_0xba27('0x76')](_0x4885ce);}; \ No newline at end of file +var _0x075e=['root','toLower','default_logo.svg','default','upperFirst','custom','Sequelize','\x20not\x20found','../../config/license/util','getLogoLogin','favicon','default_loginLogo.svg','download','gdpr','securePassword','addPreferred','default_preferred.png','ValidationError','getFavicon','default_favicon.ico','getDate','format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','client','http','request','then','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','Setting,\x20%s,\x20%s','message','result','catch','sendStatus','end','status','undefined','count','offset','limit','Content-Range','json','apply','reject','save','update','destroy','stack','name','send','index','map','Setting','rawAttributes','fieldName','key','model','keys','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','merge','where','options','includeAll','findAll','rows','show','params','include','find','body','addLogo','file','logo','filename','addLogoLogin','getLogo','server/files/images/logos','getLicense','loginLogo','preferred','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','join'];(function(_0x50aea5,_0x5dd077){var _0x4657f1=function(_0x57fb40){while(--_0x57fb40){_0x50aea5['push'](_0x50aea5['shift']());}};_0x4657f1(++_0x5dd077);}(_0x075e,0x92));var _0xe075=function(_0x24e934,_0x4b63aa){_0x24e934=_0x24e934-0x0;var _0x1dea46=_0x075e[_0x24e934];return _0x1dea46;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe075('0x0'));var zipdir=require(_0xe075('0x1'));var jsonpatch=require(_0xe075('0x2'));var rp=require(_0xe075('0x3'));var moment=require(_0xe075('0x4'));var BPromise=require(_0xe075('0x5'));var Mustache=require(_0xe075('0x6'));var util=require(_0xe075('0x7'));var path=require('path');var sox=require(_0xe075('0x8'));var csv=require(_0xe075('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe075('0xa'));var _=require(_0xe075('0xb'));var squel=require(_0xe075('0xc'));var crypto=require(_0xe075('0xd'));var jsforce=require(_0xe075('0xe'));var deskjs=require(_0xe075('0xf'));var toCsv=require('to-csv');var querystring=require(_0xe075('0x10'));var Papa=require(_0xe075('0x11'));var Redis=require('ioredis');var authService=require(_0xe075('0x12'));var qs=require(_0xe075('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe075('0x14'));var logger=require(_0xe075('0x15'))(_0xe075('0x16'));var utils=require(_0xe075('0x17'));var config=require(_0xe075('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson[_0xe075('0x19')][_0xe075('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x3dbea6,_0x41aaf5,_0x4d0182,_0x21aa92){return new BPromise(function(_0x4fbf61,_0x239f7a){var _0x892655=_0x21aa92||client;return _0x892655[_0xe075('0x1b')](_0x3dbea6,_0x4d0182)[_0xe075('0x1c')](function(_0x1d283a){logger['info']('Setting,\x20%s,\x20%s',_0x41aaf5,_0xe075('0x1d'));logger[_0xe075('0x1e')](_0xe075('0x1f'),_0x41aaf5,_0xe075('0x1d'),JSON[_0xe075('0x20')](_0x1d283a));if(_0x1d283a[_0xe075('0x21')]){if(_0x1d283a[_0xe075('0x21')]['code']===0x1f4){logger[_0xe075('0x21')](_0xe075('0x22'),_0x41aaf5,_0x1d283a[_0xe075('0x21')][_0xe075('0x23')]);return _0x239f7a(_0x1d283a['error'][_0xe075('0x23')]);}logger[_0xe075('0x21')](_0xe075('0x22'),_0x41aaf5,_0x1d283a[_0xe075('0x21')][_0xe075('0x23')]);return _0x4fbf61(_0x1d283a[_0xe075('0x21')][_0xe075('0x23')]);}else{logger['info']('Setting,\x20%s,\x20%s',_0x41aaf5,_0xe075('0x1d'));_0x4fbf61(_0x1d283a[_0xe075('0x24')][_0xe075('0x23')]);}})[_0xe075('0x25')](function(_0x590352){logger['error'](_0xe075('0x22'),_0x41aaf5,_0x590352);_0x239f7a(_0x590352);});});}function respondWithStatusCode(_0x125042,_0x1120e2){_0x1120e2=_0x1120e2||0xcc;return function(_0x532e63){if(_0x532e63){return _0x125042[_0xe075('0x26')](_0x1120e2);}return _0x125042['status'](_0x1120e2)[_0xe075('0x27')]();};}function respondWithResult(_0x31b1bd,_0x4113d8){_0x4113d8=_0x4113d8||0xc8;return function(_0x5c7e89){if(_0x5c7e89){return _0x31b1bd[_0xe075('0x28')](_0x4113d8)['json'](_0x5c7e89);}};}function respondWithFilteredResult(_0x3a4e10,_0x4d4ae8){return function(_0x598776){if(_0x598776){var _0x54838c=typeof _0x4d4ae8['offset']===_0xe075('0x29')&&typeof _0x4d4ae8['limit']===_0xe075('0x29');var _0x1901c1=_0x598776[_0xe075('0x2a')];var _0x1e8da5=_0x54838c?0x0:_0x4d4ae8[_0xe075('0x2b')];var _0x43570b=_0x54838c?_0x598776['count']:_0x4d4ae8[_0xe075('0x2b')]+_0x4d4ae8[_0xe075('0x2c')];var _0x1d7b93;if(_0x43570b>=_0x1901c1){_0x43570b=_0x1901c1;_0x1d7b93=0xc8;}else{_0x1d7b93=0xce;}_0x3a4e10['status'](_0x1d7b93);return _0x3a4e10['set'](_0xe075('0x2d'),_0x1e8da5+'-'+_0x43570b+'/'+_0x1901c1)[_0xe075('0x2e')](_0x598776);}return null;};}function patchUpdates(_0x1aaf08){return function(_0xb376b9){try{jsonpatch[_0xe075('0x2f')](_0xb376b9,_0x1aaf08,!![]);}catch(_0x6672a1){return BPromise[_0xe075('0x30')](_0x6672a1);}return _0xb376b9[_0xe075('0x31')]();};}function saveUpdates(_0x4bcb58,_0x19868b){return function(_0x4c99a4){if(_0x4c99a4){return _0x4c99a4[_0xe075('0x32')](_0x4bcb58)[_0xe075('0x1c')](function(_0x112d80){return _0x112d80;});}return null;};}function removeEntity(_0x47a895,_0x539c75){return function(_0x603a55){if(_0x603a55){return _0x603a55[_0xe075('0x33')]()[_0xe075('0x1c')](function(){_0x47a895[_0xe075('0x28')](0xcc)[_0xe075('0x27')]();});}};}function handleEntityNotFound(_0x3a1ede,_0x53ed9c){return function(_0xf957de){if(!_0xf957de){_0x3a1ede[_0xe075('0x26')](0x194);}return _0xf957de;};}function handleError(_0x37e247,_0x326b0){_0x326b0=_0x326b0||0x1f4;return function(_0x5d0937){logger[_0xe075('0x21')](_0x5d0937[_0xe075('0x34')]);if(_0x5d0937[_0xe075('0x35')]){delete _0x5d0937[_0xe075('0x35')];}_0x37e247[_0xe075('0x28')](_0x326b0)[_0xe075('0x36')](_0x5d0937);};}exports[_0xe075('0x37')]=function(_0xa7f3cf,_0x2cbf5c){var _0x1a6521={},_0x13e8d8={},_0x1f7a1f={'count':0x0,'rows':[]};var _0x263f60=_[_0xe075('0x38')](db[_0xe075('0x39')][_0xe075('0x3a')],function(_0x5ad672){return{'name':_0x5ad672[_0xe075('0x3b')],'type':_0x5ad672['type'][_0xe075('0x3c')]};});_0x13e8d8[_0xe075('0x3d')]=_[_0xe075('0x38')](_0x263f60,_0xe075('0x35'));_0x13e8d8['query']=_[_0xe075('0x3e')](_0xa7f3cf['query']);_0x13e8d8['filters']=_[_0xe075('0x3f')](_0x13e8d8[_0xe075('0x3d')],_0x13e8d8[_0xe075('0x40')]);_0x1a6521[_0xe075('0x41')]=_[_0xe075('0x3f')](_0x13e8d8[_0xe075('0x3d')],qs['fields'](_0xa7f3cf[_0xe075('0x40')][_0xe075('0x42')]));_0x1a6521[_0xe075('0x41')]=_0x1a6521[_0xe075('0x41')][_0xe075('0x43')]?_0x1a6521['attributes']:_0x13e8d8[_0xe075('0x3d')];if(!_0xa7f3cf[_0xe075('0x40')][_0xe075('0x44')](_0xe075('0x45'))){_0x1a6521[_0xe075('0x2c')]=qs[_0xe075('0x2c')](_0xa7f3cf[_0xe075('0x40')][_0xe075('0x2c')]);_0x1a6521['offset']=qs['offset'](_0xa7f3cf[_0xe075('0x40')][_0xe075('0x2b')]);}_0x1a6521[_0xe075('0x46')]=qs[_0xe075('0x47')](_0xa7f3cf[_0xe075('0x40')][_0xe075('0x47')]);_0x1a6521['where']=qs[_0xe075('0x48')](_[_0xe075('0x49')](_0xa7f3cf[_0xe075('0x40')],_0x13e8d8['filters']),_0x263f60);if(_0xa7f3cf[_0xe075('0x40')][_0xe075('0x4a')]){_0x1a6521['where']=_[_0xe075('0x4b')](_0x1a6521[_0xe075('0x4c')],{'$or':_['map'](_0x263f60,function(_0xd7fb8e){if(_0xd7fb8e['type']!=='VIRTUAL'){var _0x4feac6={};_0x4feac6[_0xd7fb8e[_0xe075('0x35')]]={'$like':'%'+_0xa7f3cf[_0xe075('0x40')][_0xe075('0x4a')]+'%'};return _0x4feac6;}})});}_0x1a6521=_[_0xe075('0x4b')]({},_0x1a6521,_0xa7f3cf[_0xe075('0x4d')]);var _0x45cc40={'where':_0x1a6521[_0xe075('0x4c')]};return db[_0xe075('0x39')][_0xe075('0x2a')](_0x45cc40)[_0xe075('0x1c')](function(_0x35f7c4){_0x1f7a1f[_0xe075('0x2a')]=_0x35f7c4;if(_0xa7f3cf[_0xe075('0x40')][_0xe075('0x4e')]){_0x1a6521['include']=[{'all':!![]}];}return db[_0xe075('0x39')][_0xe075('0x4f')](_0x1a6521);})[_0xe075('0x1c')](function(_0x15f6d0){_0x1f7a1f[_0xe075('0x50')]=_0x15f6d0;return _0x1f7a1f;})[_0xe075('0x1c')](respondWithFilteredResult(_0x2cbf5c,_0x1a6521))[_0xe075('0x25')](handleError(_0x2cbf5c,null));};exports[_0xe075('0x51')]=function(_0x35c834,_0x5aa965){var _0x45b9e0={'raw':![],'where':{'id':_0x35c834[_0xe075('0x52')]['id']}},_0x53a628={};_0x53a628[_0xe075('0x3d')]=_[_0xe075('0x3e')](db[_0xe075('0x39')]['rawAttributes']);_0x53a628['query']=_['keys'](_0x35c834[_0xe075('0x40')]);_0x53a628['filters']=_[_0xe075('0x3f')](_0x53a628[_0xe075('0x3d')],_0x53a628[_0xe075('0x40')]);_0x45b9e0['attributes']=_[_0xe075('0x3f')](_0x53a628[_0xe075('0x3d')],qs[_0xe075('0x42')](_0x35c834[_0xe075('0x40')][_0xe075('0x42')]));_0x45b9e0[_0xe075('0x41')]=_0x45b9e0[_0xe075('0x41')][_0xe075('0x43')]?_0x45b9e0[_0xe075('0x41')]:_0x53a628[_0xe075('0x3d')];if(_0x35c834[_0xe075('0x40')][_0xe075('0x4e')]){_0x45b9e0[_0xe075('0x53')]=[{'all':!![]}];}_0x45b9e0=_[_0xe075('0x4b')]({},_0x45b9e0,_0x35c834['options']);return db[_0xe075('0x39')][_0xe075('0x54')](_0x45b9e0)[_0xe075('0x1c')](handleEntityNotFound(_0x5aa965,null))['then'](respondWithResult(_0x5aa965,null))[_0xe075('0x25')](handleError(_0x5aa965,null));};exports['update']=function(_0x3f52e1,_0x3a6999){if(_0x3f52e1[_0xe075('0x55')]['id']){delete _0x3f52e1[_0xe075('0x55')]['id'];}return db[_0xe075('0x39')][_0xe075('0x54')]({'where':{'id':_0x3f52e1['params']['id']}})['then'](handleEntityNotFound(_0x3a6999,null))['then'](saveUpdates(_0x3f52e1['body'],null))[_0xe075('0x1c')](respondWithResult(_0x3a6999,null))[_0xe075('0x25')](handleError(_0x3a6999,null));};exports[_0xe075('0x56')]=function(_0x5c9240,_0x598a72,_0x4bfeb6){if(_0x5c9240[_0xe075('0x57')]&&_0x5c9240['file']['filename']){_0x5c9240[_0xe075('0x55')][_0xe075('0x58')]=_0x5c9240[_0xe075('0x57')][_0xe075('0x59')];}return db[_0xe075('0x39')][_0xe075('0x54')]({'where':{'id':_0x5c9240[_0xe075('0x52')]['id']}})[_0xe075('0x1c')](handleEntityNotFound(_0x598a72,null))['then'](saveUpdates(_0x5c9240[_0xe075('0x55')],null))[_0xe075('0x1c')](respondWithResult(_0x598a72,null))['catch'](handleError(_0x598a72,null));};exports[_0xe075('0x5a')]=function(_0x1334fc,_0x1f3291,_0x1de5d6){if(_0x1334fc[_0xe075('0x57')]&&_0x1334fc[_0xe075('0x57')]['filename']){_0x1334fc[_0xe075('0x55')]['loginLogo']=_0x1334fc[_0xe075('0x57')][_0xe075('0x59')];}return db[_0xe075('0x39')][_0xe075('0x54')]({'where':{'id':_0x1334fc['params']['id']}})['then'](handleEntityNotFound(_0x1f3291,null))[_0xe075('0x1c')](saveUpdates(_0x1334fc[_0xe075('0x55')],null))['then'](respondWithResult(_0x1f3291,null))[_0xe075('0x25')](handleError(_0x1f3291,null));};var utilLicense=require('../../config/license/util');exports[_0xe075('0x5b')]=function(_0xa8906f,_0x3eba02,_0x44701b){var _0x4023c9=_0xe075('0x5c');var _0x35ce1d={'custom':![]};return utilLicense[_0xe075('0x5d')]()['then'](function(_0x2e02c9){if(_0x2e02c9){_0x35ce1d=_0x2e02c9;}return db[_0xe075('0x39')]['find']({'where':{'id':_0xa8906f[_0xe075('0x52')]['id']},'attributes':[_0xe075('0x58'),_0xe075('0x5e'),_0xe075('0x5f'),'favicon',_0xe075('0x60'),_0xe075('0x61'),_0xe075('0x62'),_0xe075('0x63')],'raw':!![]});})['then'](handleEntityNotFound(_0x3eba02,null))['then'](function(_0x341f3c){if(_0x341f3c){var _0x5547ef=_0x341f3c[_0xe075('0x58')]&&fs[_0xe075('0x64')](path[_0xe075('0x65')](config[_0xe075('0x66')],_0x4023c9,_[_0xe075('0x67')](_0x341f3c['logo'])))?path[_0xe075('0x65')](config['root'],_0x4023c9,_['toLower'](_0x341f3c[_0xe075('0x58')])):path[_0xe075('0x65')](config[_0xe075('0x66')],_0x4023c9,_[_0xe075('0x67')](_0xe075('0x68')));var _0x2a64a0=_0xe075('0x69')+_[_0xe075('0x6a')](_0xe075('0x58'));if(_0x341f3c[_0x2a64a0]||!_0x35ce1d[_0xe075('0x6b')]){_0x5547ef=path[_0xe075('0x65')](config[_0xe075('0x66')],_0x4023c9,_[_0xe075('0x67')](_0xe075('0x68')));}if(!fs['existsSync'](_0x5547ef)){throw new db[(_0xe075('0x6c'))]['ValidationError'](_[_0xe075('0x6a')](_0xe075('0x58'))+_0xe075('0x6d'));}return _0x3eba02['download'](_0x5547ef);}})[_0xe075('0x25')](handleError(_0x3eba02,null));};var utilLicense=require(_0xe075('0x6e'));exports[_0xe075('0x6f')]=function(_0x10a4c6,_0x5b6fa0,_0x5910e5){var _0x455656=_0xe075('0x5c');var _0x36b5a0={'custom':![]};return utilLicense['getLicense']()['then'](function(_0x33ebe4){if(_0x33ebe4){_0x36b5a0=_0x33ebe4;}return db[_0xe075('0x39')][_0xe075('0x54')]({'where':{'id':_0x10a4c6[_0xe075('0x52')]['id']},'attributes':[_0xe075('0x58'),_0xe075('0x5e'),_0xe075('0x5f'),_0xe075('0x70'),_0xe075('0x60'),'defaultLoginLogo',_0xe075('0x62'),'defaultFavicon'],'raw':!![]});})['then'](handleEntityNotFound(_0x5b6fa0,null))[_0xe075('0x1c')](function(_0x8c190c){if(_0x8c190c){var _0xeebc6f=_0x8c190c['loginLogo']&&fs[_0xe075('0x64')](path[_0xe075('0x65')](config[_0xe075('0x66')],_0x455656,_[_0xe075('0x67')](_0x8c190c['loginLogo'])))?path[_0xe075('0x65')](config[_0xe075('0x66')],_0x455656,_[_0xe075('0x67')](_0x8c190c[_0xe075('0x5e')])):path[_0xe075('0x65')](config[_0xe075('0x66')],_0x455656,_[_0xe075('0x67')](_0xe075('0x71')));var _0x4f6764=_0xe075('0x69')+_[_0xe075('0x6a')](_0xe075('0x5e'));if(_0x8c190c[_0x4f6764]||!_0x36b5a0['custom']){_0xeebc6f=path['join'](config[_0xe075('0x66')],_0x455656,_[_0xe075('0x67')](_0xe075('0x71')));}if(!fs['existsSync'](_0xeebc6f)){throw new db[(_0xe075('0x6c'))]['ValidationError'](_[_0xe075('0x6a')](_0xe075('0x5e'))+_0xe075('0x6d'));}return _0x5b6fa0[_0xe075('0x72')](_0xeebc6f);}})[_0xe075('0x25')](handleError(_0x5b6fa0,null));};exports[_0xe075('0x73')]=function(_0x53ad05,_0x57c27a){return db[_0xe075('0x39')][_0xe075('0x54')]({'where':{'id':_0x53ad05[_0xe075('0x52')]['id']},'attributes':[_0xe075('0x74')]})[_0xe075('0x1c')](respondWithResult(_0x57c27a,null))[_0xe075('0x25')](handleError(_0x57c27a,null));};exports[_0xe075('0x75')]=function(_0x3cbd36,_0x1bd131,_0x47a5b3){if(_0x3cbd36[_0xe075('0x57')]&&_0x3cbd36[_0xe075('0x57')][_0xe075('0x59')]){_0x3cbd36[_0xe075('0x55')]['preferred']=_0x3cbd36[_0xe075('0x57')][_0xe075('0x59')];}return db[_0xe075('0x39')]['find']({'where':{'id':_0x3cbd36[_0xe075('0x52')]['id']}})['then'](handleEntityNotFound(_0x1bd131,null))['then'](saveUpdates(_0x3cbd36[_0xe075('0x55')],null))[_0xe075('0x1c')](respondWithResult(_0x1bd131,null))[_0xe075('0x25')](handleError(_0x1bd131,null));};var utilLicense=require(_0xe075('0x6e'));exports['getPreferred']=function(_0x491f30,_0x185c6e,_0x51ed2e){var _0x42fe13=_0xe075('0x5c');var _0x38dbfe={'custom':![]};return utilLicense[_0xe075('0x5d')]()[_0xe075('0x1c')](function(_0x37e853){if(_0x37e853){_0x38dbfe=_0x37e853;}return db[_0xe075('0x39')][_0xe075('0x54')]({'where':{'id':_0x491f30[_0xe075('0x52')]['id']},'attributes':[_0xe075('0x58'),'loginLogo',_0xe075('0x5f'),_0xe075('0x70'),'defaultLogo',_0xe075('0x61'),_0xe075('0x62'),_0xe075('0x63')],'raw':!![]});})[_0xe075('0x1c')](handleEntityNotFound(_0x185c6e,null))['then'](function(_0x5304e8){if(_0x5304e8){var _0x109ffd=_0x5304e8['preferred']&&fs[_0xe075('0x64')](path[_0xe075('0x65')](config[_0xe075('0x66')],_0x42fe13,_[_0xe075('0x67')](_0x5304e8[_0xe075('0x5f')])))?path[_0xe075('0x65')](config[_0xe075('0x66')],_0x42fe13,_['toLower'](_0x5304e8[_0xe075('0x5f')])):path[_0xe075('0x65')](config[_0xe075('0x66')],_0x42fe13,_['toLower'](_0xe075('0x76')));var _0x379a3a=_0xe075('0x69')+_[_0xe075('0x6a')](_0xe075('0x5f'));if(_0x5304e8[_0x379a3a]||!_0x38dbfe[_0xe075('0x6b')]||!_0x38dbfe[_0xe075('0x5f')]){_0x109ffd=path['join'](config[_0xe075('0x66')],_0x42fe13,_[_0xe075('0x67')](_0xe075('0x76')));}if(!fs[_0xe075('0x64')](_0x109ffd)){throw new db[(_0xe075('0x6c'))][(_0xe075('0x77'))](_[_0xe075('0x6a')](_0xe075('0x5f'))+_0xe075('0x6d'));}return _0x185c6e[_0xe075('0x72')](_0x109ffd);}})[_0xe075('0x25')](handleError(_0x185c6e,null));};exports['addFavicon']=function(_0x5a6b7a,_0x58244b,_0x1cb213){if(_0x5a6b7a[_0xe075('0x57')]&&_0x5a6b7a[_0xe075('0x57')][_0xe075('0x59')]){_0x5a6b7a[_0xe075('0x55')][_0xe075('0x70')]=_0x5a6b7a[_0xe075('0x57')][_0xe075('0x59')];}return db[_0xe075('0x39')][_0xe075('0x54')]({'where':{'id':_0x5a6b7a[_0xe075('0x52')]['id']}})['then'](handleEntityNotFound(_0x58244b,null))[_0xe075('0x1c')](saveUpdates(_0x5a6b7a[_0xe075('0x55')],null))[_0xe075('0x1c')](respondWithResult(_0x58244b,null))[_0xe075('0x25')](handleError(_0x58244b,null));};var utilLicense=require(_0xe075('0x6e'));exports[_0xe075('0x78')]=function(_0x478f5b,_0xec445d,_0x4c67a2){var _0x404470='server/files/images/logos';var _0x4d8bc0={'custom':![]};return utilLicense[_0xe075('0x5d')]()[_0xe075('0x1c')](function(_0x148154){if(_0x148154){_0x4d8bc0=_0x148154;}return db[_0xe075('0x39')][_0xe075('0x54')]({'where':{'id':_0x478f5b[_0xe075('0x52')]['id']},'attributes':['logo','loginLogo',_0xe075('0x5f'),_0xe075('0x70'),_0xe075('0x60'),_0xe075('0x61'),_0xe075('0x62'),_0xe075('0x63')],'raw':!![]});})[_0xe075('0x1c')](handleEntityNotFound(_0xec445d,null))[_0xe075('0x1c')](function(_0x34bfcb){if(_0x34bfcb){var _0x180bc1=_0x34bfcb['favicon']&&fs[_0xe075('0x64')](path[_0xe075('0x65')](config[_0xe075('0x66')],_0x404470,_[_0xe075('0x67')](_0x34bfcb[_0xe075('0x70')])))?path['join'](config[_0xe075('0x66')],_0x404470,_[_0xe075('0x67')](_0x34bfcb[_0xe075('0x70')])):path[_0xe075('0x65')](config[_0xe075('0x66')],_0x404470,_['toLower'](_0xe075('0x79')));var _0x430dfe='default'+_[_0xe075('0x6a')](_0xe075('0x70'));if(_0x34bfcb[_0x430dfe]||!_0x4d8bc0[_0xe075('0x6b')]){_0x180bc1=path[_0xe075('0x65')](config[_0xe075('0x66')],_0x404470,_[_0xe075('0x67')]('default_favicon.ico'));}if(!fs[_0xe075('0x64')](_0x180bc1)){throw new db[(_0xe075('0x6c'))][(_0xe075('0x77'))](_['upperFirst'](_0xe075('0x70'))+_0xe075('0x6d'));}return _0xec445d['download'](_0x180bc1);}})[_0xe075('0x25')](handleError(_0xec445d,null));};exports[_0xe075('0x7a')]=function(_0x5f18bc,_0x1bfc0b){var _0x3806ea={'offset':moment()['utcOffset']()};_0x3806ea['now']=moment()['utcOffset'](_0x3806ea[_0xe075('0x2b')])[_0xe075('0x7b')]('YYYY-MM-DD\x20HH:mm:ss:SSS');return _0x1bfc0b['status'](0xc8)[_0xe075('0x36')](_0x3806ea);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index a0f8acc..0a8ca67 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 _0x3e74=['exports','Setting','settings','lodash','../../config/logger','api','moment','path','../../config/environment','./setting.attributes'];(function(_0x2ef8c1,_0x2f72f4){var _0x288305=function(_0x56244b){while(--_0x56244b){_0x2ef8c1['push'](_0x2ef8c1['shift']());}};_0x288305(++_0x2f72f4);}(_0x3e74,0x175));var _0x43e7=function(_0x564270,_0x315e44){_0x564270=_0x564270-0x0;var _0x5c3ee=_0x3e74[_0x564270];return _0x5c3ee;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var logger=require(_0x43e7('0x1'))(_0x43e7('0x2'));var moment=require(_0x43e7('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x43e7('0x4'));var rimraf=require('rimraf');var config=require(_0x43e7('0x5'));var attributes=require(_0x43e7('0x6'));module[_0x43e7('0x7')]=function(_0x1c503b,_0xc98b9c){return _0x1c503b['define'](_0x43e7('0x8'),attributes,{'tableName':_0x43e7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3e74=['exports','Setting','settings','lodash','../../config/logger','api','moment','path','../../config/environment','./setting.attributes'];(function(_0x2aa87d,_0x1aa073){var _0x3a1812=function(_0x51ffc0){while(--_0x51ffc0){_0x2aa87d['push'](_0x2aa87d['shift']());}};_0x3a1812(++_0x1aa073);}(_0x3e74,0x175));var _0x43e7=function(_0x3cd5bb,_0x7afb75){_0x3cd5bb=_0x3cd5bb-0x0;var _0x2f8250=_0x3e74[_0x3cd5bb];return _0x2f8250;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var logger=require(_0x43e7('0x1'))(_0x43e7('0x2'));var moment=require(_0x43e7('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x43e7('0x4'));var rimraf=require('rimraf');var config=require(_0x43e7('0x5'));var attributes=require(_0x43e7('0x6'));module[_0x43e7('0x7')]=function(_0x1c503b,_0xc98b9c){return _0x1c503b['define'](_0x43e7('0x8'),attributes,{'tableName':_0x43e7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/setting/setting.rpc.js b/server/api/setting/setting.rpc.js index 63d62b1..a2943a2 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 _0x3d97=['error','code','message','result','catch','ShowSetting','Setting','find','options','raw','attributes','map','include','model','info','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x429e53,_0x1571a){var _0x1e8736=function(_0x3fd009){while(--_0x3fd009){_0x429e53['push'](_0x429e53['shift']());}};_0x1e8736(++_0x1571a);}(_0x3d97,0x19b));var _0x73d9=function(_0x6a8660,_0xdee20f){_0x6a8660=_0x6a8660-0x0;var _0x25eef7=_0x3d97[_0x6a8660];return _0x25eef7;};'use strict';var _=require(_0x73d9('0x0'));var util=require('util');var moment=require(_0x73d9('0x1'));var BPromise=require(_0x73d9('0x2'));var rs=require(_0x73d9('0x3'));var fs=require('fs');var Redis=require(_0x73d9('0x4'));var db=require(_0x73d9('0x5'))['db'];var utils=require(_0x73d9('0x6'));var logger=require('../../config/logger')(_0x73d9('0x7'));var config=require('../../config/environment');var jayson=require(_0x73d9('0x8'));var client=jayson[_0x73d9('0x9')][_0x73d9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x468b3e,_0x4f465e,_0x518d53){return new BPromise(function(_0x427278,_0x25d37e){return client[_0x73d9('0xb')](_0x468b3e,_0x518d53)[_0x73d9('0xc')](function(_0x3aff53){logger['info'](_0x73d9('0xd'),_0x4f465e,_0x73d9('0xe'));logger[_0x73d9('0xf')](_0x73d9('0x10'),_0x4f465e,_0x73d9('0xe'),JSON[_0x73d9('0x11')](_0x3aff53));if(_0x3aff53[_0x73d9('0x12')]){if(_0x3aff53[_0x73d9('0x12')][_0x73d9('0x13')]===0x1f4){logger[_0x73d9('0x12')](_0x73d9('0xd'),_0x4f465e,_0x3aff53['error'][_0x73d9('0x14')]);return _0x25d37e(_0x3aff53[_0x73d9('0x12')][_0x73d9('0x14')]);}logger['error'](_0x73d9('0xd'),_0x4f465e,_0x3aff53[_0x73d9('0x12')][_0x73d9('0x14')]);return _0x427278(_0x3aff53['error']['message']);}else{logger['info'](_0x73d9('0xd'),_0x4f465e,_0x73d9('0xe'));_0x427278(_0x3aff53[_0x73d9('0x15')][_0x73d9('0x14')]);}})[_0x73d9('0x16')](function(_0x3ac2c0){logger[_0x73d9('0x12')]('Setting,\x20%s,\x20%s',_0x4f465e,_0x3ac2c0);_0x25d37e(_0x3ac2c0);});});}exports[_0x73d9('0x17')]=function(_0x1b7290){var _0x30fe2c=this;return new Promise(function(_0x36913f,_0x583a11){return db[_0x73d9('0x18')][_0x73d9('0x19')]({'raw':_0x1b7290[_0x73d9('0x1a')]?_0x1b7290[_0x73d9('0x1a')][_0x73d9('0x1b')]===undefined?!![]:![]:!![],'where':_0x1b7290[_0x73d9('0x1a')]?_0x1b7290['options']['where']||null:null,'attributes':_0x1b7290[_0x73d9('0x1a')]?_0x1b7290[_0x73d9('0x1a')][_0x73d9('0x1c')]||null:null,'include':_0x1b7290['options']?_0x1b7290[_0x73d9('0x1a')]['include']?_[_0x73d9('0x1d')](_0x1b7290[_0x73d9('0x1a')][_0x73d9('0x1e')],function(_0x320ca8){return{'model':db[_0x320ca8[_0x73d9('0x1f')]],'as':_0x320ca8['as'],'attributes':_0x320ca8[_0x73d9('0x1c')],'include':_0x320ca8[_0x73d9('0x1e')]?_['map'](_0x320ca8[_0x73d9('0x1e')],function(_0x426dd8){return{'model':db[_0x426dd8['model']],'as':_0x426dd8['as'],'attributes':_0x426dd8[_0x73d9('0x1c')],'include':_0x426dd8[_0x73d9('0x1e')]?_[_0x73d9('0x1d')](_0x426dd8[_0x73d9('0x1e')],function(_0x30867d){return{'model':db[_0x30867d[_0x73d9('0x1f')]],'as':_0x30867d['as'],'attributes':_0x30867d[_0x73d9('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x73d9('0xc')](function(_0x5b4026){logger[_0x73d9('0x20')](_0x73d9('0x17'),_0x1b7290);logger[_0x73d9('0xf')](_0x73d9('0x17'),_0x1b7290,JSON[_0x73d9('0x11')](_0x5b4026));_0x36913f(_0x5b4026);})[_0x73d9('0x16')](function(_0x4eb906){logger['error'](_0x73d9('0x17'),_0x4eb906[_0x73d9('0x14')],_0x1b7290);_0x583a11(_0x30fe2c[_0x73d9('0x12')](0x1f4,_0x4eb906[_0x73d9('0x14')]));});});}; \ No newline at end of file +var _0x53f9=['jayson/promise','client','request','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSetting','find','raw','options','map','include','attributes','model','then','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x11deb0,_0x134734){var _0x3f63e1=function(_0x4c9a49){while(--_0x4c9a49){_0x11deb0['push'](_0x11deb0['shift']());}};_0x3f63e1(++_0x134734);}(_0x53f9,0x12e));var _0x953f=function(_0x888385,_0x9cdc66){_0x888385=_0x888385-0x0;var _0x22d5c2=_0x53f9[_0x888385];return _0x22d5c2;};'use strict';var _=require('lodash');var util=require(_0x953f('0x0'));var moment=require(_0x953f('0x1'));var BPromise=require('bluebird');var rs=require(_0x953f('0x2'));var fs=require('fs');var Redis=require(_0x953f('0x3'));var db=require(_0x953f('0x4'))['db'];var utils=require(_0x953f('0x5'));var logger=require('../../config/logger')(_0x953f('0x6'));var config=require(_0x953f('0x7'));var jayson=require(_0x953f('0x8'));var client=jayson[_0x953f('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x264844,_0x2e529d,_0x11de33){return new BPromise(function(_0x2a10b2,_0x20bddb){return client[_0x953f('0xa')](_0x264844,_0x11de33)['then'](function(_0x33a9c1){logger[_0x953f('0xb')](_0x953f('0xc'),_0x2e529d,_0x953f('0xd'));logger[_0x953f('0xe')](_0x953f('0xf'),_0x2e529d,_0x953f('0xd'),JSON[_0x953f('0x10')](_0x33a9c1));if(_0x33a9c1['error']){if(_0x33a9c1[_0x953f('0x11')][_0x953f('0x12')]===0x1f4){logger[_0x953f('0x11')](_0x953f('0xc'),_0x2e529d,_0x33a9c1[_0x953f('0x11')][_0x953f('0x13')]);return _0x20bddb(_0x33a9c1[_0x953f('0x11')][_0x953f('0x13')]);}logger[_0x953f('0x11')](_0x953f('0xc'),_0x2e529d,_0x33a9c1[_0x953f('0x11')]['message']);return _0x2a10b2(_0x33a9c1[_0x953f('0x11')][_0x953f('0x13')]);}else{logger[_0x953f('0xb')]('Setting,\x20%s,\x20%s',_0x2e529d,'request\x20sent');_0x2a10b2(_0x33a9c1[_0x953f('0x14')][_0x953f('0x13')]);}})[_0x953f('0x15')](function(_0x40da69){logger['error'](_0x953f('0xc'),_0x2e529d,_0x40da69);_0x20bddb(_0x40da69);});});}exports[_0x953f('0x16')]=function(_0x2bb7b5){var _0x3082b9=this;return new Promise(function(_0x3abfaa,_0x295950){return db['Setting'][_0x953f('0x17')]({'raw':_0x2bb7b5['options']?_0x2bb7b5['options'][_0x953f('0x18')]===undefined?!![]:![]:!![],'where':_0x2bb7b5[_0x953f('0x19')]?_0x2bb7b5[_0x953f('0x19')]['where']||null:null,'attributes':_0x2bb7b5[_0x953f('0x19')]?_0x2bb7b5[_0x953f('0x19')]['attributes']||null:null,'include':_0x2bb7b5[_0x953f('0x19')]?_0x2bb7b5[_0x953f('0x19')]['include']?_[_0x953f('0x1a')](_0x2bb7b5['options'][_0x953f('0x1b')],function(_0x27192e){return{'model':db[_0x27192e['model']],'as':_0x27192e['as'],'attributes':_0x27192e[_0x953f('0x1c')],'include':_0x27192e['include']?_['map'](_0x27192e[_0x953f('0x1b')],function(_0x5da945){return{'model':db[_0x5da945['model']],'as':_0x5da945['as'],'attributes':_0x5da945[_0x953f('0x1c')],'include':_0x5da945[_0x953f('0x1b')]?_[_0x953f('0x1a')](_0x5da945[_0x953f('0x1b')],function(_0x4656dd){return{'model':db[_0x4656dd[_0x953f('0x1d')]],'as':_0x4656dd['as'],'attributes':_0x4656dd['attributes']};}):[]};}):[]};}):[]:[]})[_0x953f('0x1e')](function(_0x12119d){logger[_0x953f('0xb')](_0x953f('0x16'),_0x2bb7b5);logger[_0x953f('0xe')](_0x953f('0x16'),_0x2bb7b5,JSON[_0x953f('0x10')](_0x12119d));_0x3abfaa(_0x12119d);})[_0x953f('0x15')](function(_0x4bd139){logger['error'](_0x953f('0x16'),_0x4bd139[_0x953f('0x13')],_0x2bb7b5);_0x295950(_0x3082b9['error'](0x1f4,_0x4bd139[_0x953f('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index 15e4a33..24d7af5 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 _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(_0x13620b,_0x18fbef){var _0x7b097a=function(_0x168bd8){while(--_0x168bd8){_0x13620b['push'](_0x13620b['shift']());}};_0x7b097a(++_0x18fbef);}(_0x7a54,0x106));var _0x47a5=function(_0x46fab1,_0x1c1b62){_0x46fab1=_0x46fab1-0x0;var _0x283797=_0x7a54[_0x46fab1];return _0x283797;};'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 +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(_0x346107,_0x296b20){var _0x361e34=function(_0x20a924){while(--_0x20a924){_0x346107['push'](_0x346107['shift']());}};_0x361e34(++_0x296b20);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var 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 diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index 7326254..39e0872 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 _0x7439=['clicksend','plivo','clickatell','csc','infobip','BOOLEAN','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','randomstring','exports','STRING','name','generate','ENUM','skebby','connectel'];(function(_0x123e70,_0x11d93d){var _0x323900=function(_0x5a959f){while(--_0x5a959f){_0x123e70['push'](_0x123e70['shift']());}};_0x323900(++_0x11d93d);}(_0x7439,0x8b));var _0x9743=function(_0xc10208,_0x4e9203){_0xc10208=_0xc10208-0x0;var _0x288a10=_0x7439[_0xc10208];return _0x288a10;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x9743('0x0'));module[_0x9743('0x1')]={'name':{'type':Sequelize[_0x9743('0x2')],'unique':_0x9743('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0x9743('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0x9743('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0x9743('0x2')],'defaultValue':function(){return rs[_0x9743('0x4')]();}},'phone':{'type':Sequelize[_0x9743('0x2')]},'type':{'type':Sequelize[_0x9743('0x5')]('twilio',_0x9743('0x6'),_0x9743('0x7'),_0x9743('0x8'),_0x9743('0x9'),_0x9743('0xa'),'bandwidth',_0x9743('0xb'),_0x9743('0xc'),'intelepeer')},'accountSid':{'type':Sequelize[_0x9743('0x2')]},'authId':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0x9743('0x2')]},'smsMethod':{'type':Sequelize[_0x9743('0x5')]('SI','TI','GP')},'username':{'type':Sequelize[_0x9743('0x2')]},'password':{'type':Sequelize['STRING']},'apiKey':{'type':Sequelize[_0x9743('0x2')]},'applicationId':{'type':Sequelize[_0x9743('0x2')]},'accountId':{'type':Sequelize[_0x9743('0x2')]},'senderString':{'type':Sequelize[_0x9743('0x2')]},'deliveryReport':{'type':Sequelize[_0x9743('0xd')],'defaultValue':![]},'description':{'type':Sequelize[_0x9743('0x2')]},'notificationTemplate':{'type':Sequelize[_0x9743('0xe')],'defaultValue':function(){return _0x9743('0xf');}},'notificationSound':{'type':Sequelize[_0x9743('0xd')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x9743('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x9743('0xd')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x9743('0xd')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x9743('0x2')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x9743('0x10')],'comment':_0x9743('0x11')},'mandatoryDisposition':{'type':Sequelize[_0x9743('0xd')],'defaultValue':![],'comment':_0x9743('0x12'),'set':function(_0x34f32a){if(!_0x34f32a)this[_0x9743('0x13')]('mandatoryDispositionPauseId',null);this[_0x9743('0x13')](_0x9743('0x14'),_0x34f32a);}}}; \ No newline at end of file +var _0x5982=['Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','randomstring','exports','STRING','name','generate','twilio','skebby','connectel','clicksend','clickatell','bandwidth','csc','intelepeer','ENUM','BOOLEAN','TEXT','INTEGER'];(function(_0x54594c,_0x4f8c45){var _0xe23e8f=function(_0x2999b9){while(--_0x2999b9){_0x54594c['push'](_0x54594c['shift']());}};_0xe23e8f(++_0x4f8c45);}(_0x5982,0x154));var _0x2598=function(_0x4d1bfb,_0x31d432){_0x4d1bfb=_0x4d1bfb-0x0;var _0x24ea3b=_0x5982[_0x4d1bfb];return _0x24ea3b;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x2598('0x0'));module[_0x2598('0x1')]={'name':{'type':Sequelize[_0x2598('0x2')],'unique':_0x2598('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0x2598('0x2')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0x2598('0x2')],'defaultValue':function(){return rs[_0x2598('0x4')]();}},'phone':{'type':Sequelize[_0x2598('0x2')]},'type':{'type':Sequelize['ENUM'](_0x2598('0x5'),_0x2598('0x6'),_0x2598('0x7'),_0x2598('0x8'),'plivo',_0x2598('0x9'),_0x2598('0xa'),_0x2598('0xb'),'infobip',_0x2598('0xc'))},'accountSid':{'type':Sequelize[_0x2598('0x2')]},'authId':{'type':Sequelize[_0x2598('0x2')]},'authToken':{'type':Sequelize[_0x2598('0x2')]},'smsMethod':{'type':Sequelize[_0x2598('0xd')]('SI','TI','GP')},'username':{'type':Sequelize[_0x2598('0x2')]},'password':{'type':Sequelize['STRING']},'apiKey':{'type':Sequelize[_0x2598('0x2')]},'applicationId':{'type':Sequelize[_0x2598('0x2')]},'accountId':{'type':Sequelize['STRING']},'senderString':{'type':Sequelize[_0x2598('0x2')]},'deliveryReport':{'type':Sequelize[_0x2598('0xe')],'defaultValue':![]},'description':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x2598('0xf')],'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[_0x2598('0xe')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x2598('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x2598('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x2598('0xe')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x2598('0xe')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x2598('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x2598('0x2')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x2598('0x10')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x2598('0xe')],'defaultValue':![],'comment':_0x2598('0x11'),'set':function(_0x455fab){if(!_0x455fab)this[_0x2598('0x12')](_0x2598('0x13'),null);this['setDataValue'](_0x2598('0x14'),_0x455fab);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index f50332a..0d1d8e1 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 _0x3745=['waitForTheAssignedQueue','Start','startRouting','SmsAccount,\x20%s,\x20%s,\x20%s','entity\x20found','debug','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','\x0a','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','priority','finally','getApplications','getInteractions','Contact','Owner','fullname','internal','Tags','color','tag','to\x20is\x20mandatory','List','out','dataValues','Messages','inspect','skebby_dispatch_id','requestid','statusInt','status_code','groupName','DELIVERED','intelepeer','redif','error_code','DELIVERED_TO_GATEWAY','message-delivered','DELIVRD','ACCEPTD','message-id','state','addAgents','omit','emit','removeAgents','userSmsAccount:remove','getAgents','eml-format','zip-dir','request-promise','bluebird','path','sox','to-csv','fs-extra','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','client','http','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','end','status','offset','undefined','limit','count','set','json','apply','reject','update','destroy','get','SmsAccounts','UserProfileResource','sendStatus','stack','name','send','index','Pause','map','SmsAccount','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','includeAll','include','findAll','rows','show','params','mandatoryDispositionPause','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','describe','addDisposition','SmsAccountId','Disposition','getDispositions','findOne','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','notify','sms','SmsApplication','Applications','account','applications','asc','CmContact','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','from','messageId','skebby','sender','text','connectel','clicksend','message_id','From','Text','MessageUUID','infobip','results','csc','originatingAddress','segmentedMessage','clickatell','fromNumber','replyMessageId','bandwidth','isNil','Sequelize','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','DESC','list','Contacts','contact','SmsInteraction','interaction','created','autoclose','push','*,*,*,*','SmsMessage','ContactId','AttachmentId','UserId','User','unshift','agent','queueId','SmsQueue','queue'];(function(_0x85d56d,_0x37f5c1){var _0x51f613=function(_0x4927df){while(--_0x4927df){_0x85d56d['push'](_0x85d56d['shift']());}};_0x51f613(++_0x37f5c1);}(_0x3745,0x115));var _0x5374=function(_0x381dbb,_0x4a1419){_0x381dbb=_0x381dbb-0x0;var _0x301378=_0x3745[_0x381dbb];return _0x301378;};'use strict';var emlformat=require(_0x5374('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5374('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5374('0x2'));var moment=require('moment');var BPromise=require(_0x5374('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x5374('0x4'));var sox=require(_0x5374('0x5'));var csv=require(_0x5374('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5374('0x7'));var _=require('lodash');var squel=require(_0x5374('0x8'));var crypto=require(_0x5374('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5374('0xa'));var Papa=require(_0x5374('0xb'));var Redis=require(_0x5374('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x5374('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5374('0xe'));var logger=require(_0x5374('0xf'))('api');var utils=require(_0x5374('0x10'));var config=require(_0x5374('0x11'));var licenseUtil=require('../../config/license/util');var db=require(_0x5374('0x12'))['db'];config[_0x5374('0x13')]=_[_0x5374('0x14')](config[_0x5374('0x13')],{'host':_0x5374('0x15'),'port':0x18eb});var socket=require(_0x5374('0x16'))(new Redis(config['redis']));require('./smsAccount.socket')[_0x5374('0x17')](socket);var jayson=require('jayson/promise');var client=jayson[_0x5374('0x18')][_0x5374('0x19')]({'port':0x232c});function respondWithRpcPromise(_0xa323,_0x7c4e,_0x3a9006,_0x4a5674){return new BPromise(function(_0xc36d8a,_0x30a0ff){var _0x2be2e6=_0x4a5674||client;return _0x2be2e6[_0x5374('0x1a')](_0xa323,_0x3a9006)[_0x5374('0x1b')](function(_0x11e19c){logger[_0x5374('0x1c')](_0x5374('0x1d'),_0x7c4e,_0x5374('0x1e'));logger['debug']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x7c4e,_0x5374('0x1e'),JSON[_0x5374('0x1f')](_0x11e19c));if(_0x11e19c[_0x5374('0x20')]){if(_0x11e19c[_0x5374('0x20')][_0x5374('0x21')]===0x1f4){logger[_0x5374('0x20')](_0x5374('0x1d'),_0x7c4e,_0x11e19c['error'][_0x5374('0x22')]);return _0x30a0ff(_0x11e19c['error'][_0x5374('0x22')]);}logger['error'](_0x5374('0x1d'),_0x7c4e,_0x11e19c[_0x5374('0x20')][_0x5374('0x22')]);return _0xc36d8a(_0x11e19c['error'][_0x5374('0x22')]);}else{logger[_0x5374('0x1c')](_0x5374('0x1d'),_0x7c4e,'request\x20sent');_0xc36d8a(_0x11e19c[_0x5374('0x23')][_0x5374('0x22')]);}})[_0x5374('0x24')](function(_0x1351e7){logger[_0x5374('0x20')]('SmsAccount,\x20%s,\x20%s',_0x7c4e,_0x1351e7);_0x30a0ff(_0x1351e7);});});}function respondWithStatusCode(_0x206635,_0x143661){_0x143661=_0x143661||0xcc;return function(_0xbdb250){if(_0xbdb250){return _0x206635['sendStatus'](_0x143661);}return _0x206635['status'](_0x143661)[_0x5374('0x25')]();};}function respondWithResult(_0x2cadf5,_0x208aec){_0x208aec=_0x208aec||0xc8;return function(_0x16b31a){if(_0x16b31a){return _0x2cadf5[_0x5374('0x26')](_0x208aec)['json'](_0x16b31a);}};}function respondWithFilteredResult(_0x1c05b4,_0x42dc72){return function(_0x4eeda6){if(_0x4eeda6){var _0x2fdf36=typeof _0x42dc72[_0x5374('0x27')]===_0x5374('0x28')&&typeof _0x42dc72[_0x5374('0x29')]===_0x5374('0x28');var _0x479216=_0x4eeda6[_0x5374('0x2a')];var _0x4543e6=_0x2fdf36?0x0:_0x42dc72[_0x5374('0x27')];var _0x1917e8=_0x2fdf36?_0x4eeda6[_0x5374('0x2a')]:_0x42dc72[_0x5374('0x27')]+_0x42dc72['limit'];var _0x72a26a;if(_0x1917e8>=_0x479216){_0x1917e8=_0x479216;_0x72a26a=0xc8;}else{_0x72a26a=0xce;}_0x1c05b4['status'](_0x72a26a);return _0x1c05b4[_0x5374('0x2b')]('Content-Range',_0x4543e6+'-'+_0x1917e8+'/'+_0x479216)[_0x5374('0x2c')](_0x4eeda6);}return null;};}function patchUpdates(_0x31c00f){return function(_0x1e8702){try{jsonpatch[_0x5374('0x2d')](_0x1e8702,_0x31c00f,!![]);}catch(_0x227ed4){return BPromise[_0x5374('0x2e')](_0x227ed4);}return _0x1e8702['save']();};}function saveUpdates(_0x2bee70,_0x55a5a7){return function(_0x2ce8cc){if(_0x2ce8cc){return _0x2ce8cc[_0x5374('0x2f')](_0x2bee70)['then'](function(_0x599ecb){return _0x599ecb;});}return null;};}function removeEntity(_0xbeaa2,_0xa6f1cc){return function(_0xc4f80){if(_0xc4f80){return _0xc4f80[_0x5374('0x30')]()[_0x5374('0x1b')](function(){var _0x39568f=_0xc4f80[_0x5374('0x31')]({'plain':!![]});var _0x4da3d2=_0x5374('0x32');return db[_0x5374('0x33')][_0x5374('0x30')]({'where':{'type':_0x4da3d2,'resourceId':_0x39568f['id']}})['then'](function(){return _0xc4f80;});})[_0x5374('0x1b')](function(){_0xbeaa2['status'](0xcc)[_0x5374('0x25')]();});}};}function handleEntityNotFound(_0x882d9e,_0x2310d2){return function(_0x5e9bab){if(!_0x5e9bab){_0x882d9e[_0x5374('0x34')](0x194);}return _0x5e9bab;};}function handleError(_0x51fb66,_0x1dfdd7){_0x1dfdd7=_0x1dfdd7||0x1f4;return function(_0x248cce){logger[_0x5374('0x20')](_0x248cce[_0x5374('0x35')]);if(_0x248cce[_0x5374('0x36')]){delete _0x248cce['name'];}_0x51fb66['status'](_0x1dfdd7)[_0x5374('0x37')](_0x248cce);};}exports[_0x5374('0x38')]=function(_0x45afaf,_0x81213d){var _0x1acc3f={'include':[{'model':db[_0x5374('0x39')],'as':'mandatoryDispositionPause'}]},_0x8857a={},_0xfe4fd6={'count':0x0,'rows':[]};var _0x4dc055=_[_0x5374('0x3a')](db[_0x5374('0x3b')][_0x5374('0x3c')],function(_0x2f815e){return{'name':_0x2f815e['fieldName'],'type':_0x2f815e[_0x5374('0x3d')]['key']};});_0x8857a[_0x5374('0x3e')]=_[_0x5374('0x3a')](_0x4dc055,'name');_0x8857a[_0x5374('0x3f')]=_[_0x5374('0x40')](_0x45afaf[_0x5374('0x3f')]);_0x8857a[_0x5374('0x41')]=_[_0x5374('0x42')](_0x8857a[_0x5374('0x3e')],_0x8857a['query']);_0x1acc3f[_0x5374('0x43')]=_[_0x5374('0x42')](_0x8857a[_0x5374('0x3e')],qs['fields'](_0x45afaf[_0x5374('0x3f')][_0x5374('0x44')]));_0x1acc3f[_0x5374('0x43')]=_0x1acc3f['attributes'][_0x5374('0x45')]?_0x1acc3f[_0x5374('0x43')]:_0x8857a[_0x5374('0x3e')];if(!_0x45afaf['query'][_0x5374('0x46')](_0x5374('0x47'))){_0x1acc3f[_0x5374('0x29')]=qs[_0x5374('0x29')](_0x45afaf[_0x5374('0x3f')]['limit']);_0x1acc3f[_0x5374('0x27')]=qs['offset'](_0x45afaf[_0x5374('0x3f')][_0x5374('0x27')]);}_0x1acc3f[_0x5374('0x48')]=qs[_0x5374('0x49')](_0x45afaf[_0x5374('0x3f')][_0x5374('0x49')]);_0x1acc3f['where']=qs[_0x5374('0x41')](_[_0x5374('0x4a')](_0x45afaf['query'],_0x8857a['filters']),_0x4dc055);if(_0x45afaf[_0x5374('0x3f')][_0x5374('0x4b')]){_0x1acc3f[_0x5374('0x4c')]=_[_0x5374('0x4d')](_0x1acc3f[_0x5374('0x4c')],{'$or':_[_0x5374('0x3a')](_0x4dc055,function(_0x54939c){if(_0x54939c['type']!=='VIRTUAL'){var _0x13f69a={};_0x13f69a[_0x54939c[_0x5374('0x36')]]={'$like':'%'+_0x45afaf[_0x5374('0x3f')][_0x5374('0x4b')]+'%'};return _0x13f69a;}})});}_0x1acc3f=_[_0x5374('0x4d')]({},_0x1acc3f,_0x45afaf[_0x5374('0x4e')]);var _0x25f568={'where':_0x1acc3f[_0x5374('0x4c')]};return db[_0x5374('0x3b')][_0x5374('0x2a')](_0x25f568)[_0x5374('0x1b')](function(_0x56fd10){_0xfe4fd6[_0x5374('0x2a')]=_0x56fd10;if(_0x45afaf[_0x5374('0x3f')][_0x5374('0x4f')]){_0x1acc3f[_0x5374('0x50')]=[{'all':!![]}];}return db['SmsAccount'][_0x5374('0x51')](_0x1acc3f);})[_0x5374('0x1b')](function(_0x98ed60){_0xfe4fd6[_0x5374('0x52')]=_0x98ed60;return _0xfe4fd6;})[_0x5374('0x1b')](respondWithFilteredResult(_0x81213d,_0x1acc3f))[_0x5374('0x24')](handleError(_0x81213d,null));};exports[_0x5374('0x53')]=function(_0x48f040,_0x4fb0de){var _0x10335e={'raw':![],'where':{'id':_0x48f040[_0x5374('0x54')]['id']},'include':[{'model':db['Pause'],'as':_0x5374('0x55')}]},_0x17de74={};_0x17de74[_0x5374('0x3e')]=_[_0x5374('0x40')](db[_0x5374('0x3b')][_0x5374('0x3c')]);_0x17de74[_0x5374('0x3f')]=_[_0x5374('0x40')](_0x48f040[_0x5374('0x3f')]);_0x17de74[_0x5374('0x41')]=_[_0x5374('0x42')](_0x17de74['model'],_0x17de74[_0x5374('0x3f')]);_0x10335e[_0x5374('0x43')]=_[_0x5374('0x42')](_0x17de74['model'],qs[_0x5374('0x44')](_0x48f040[_0x5374('0x3f')]['fields']));_0x10335e[_0x5374('0x43')]=_0x10335e[_0x5374('0x43')][_0x5374('0x45')]?_0x10335e[_0x5374('0x43')]:_0x17de74[_0x5374('0x3e')];if(_0x48f040[_0x5374('0x3f')][_0x5374('0x4f')]){_0x10335e[_0x5374('0x50')]=[{'all':!![]}];}_0x10335e=_[_0x5374('0x4d')]({},_0x10335e,_0x48f040[_0x5374('0x4e')]);return db['SmsAccount'][_0x5374('0x56')](_0x10335e)[_0x5374('0x1b')](handleEntityNotFound(_0x4fb0de,null))['then'](respondWithResult(_0x4fb0de,null))[_0x5374('0x24')](handleError(_0x4fb0de,null));};exports[_0x5374('0x57')]=function(_0x3d6de3,_0x51c4e3){return db[_0x5374('0x3b')][_0x5374('0x57')](_0x3d6de3[_0x5374('0x58')],{})[_0x5374('0x1b')](function(_0x548fa6){var _0x18444a=_0x3d6de3[_0x5374('0x59')]['get']({'plain':!![]});if(!_0x18444a)throw new Error(_0x5374('0x5a'));if(_0x18444a[_0x5374('0x5b')]==='user'){var _0x58ba7d=_0x548fa6[_0x5374('0x31')]({'plain':!![]});var _0x215409='SmsAccounts';return db[_0x5374('0x5c')][_0x5374('0x56')]({'where':{'name':_0x215409,'userProfileId':_0x18444a[_0x5374('0x5d')]},'raw':!![]})[_0x5374('0x1b')](function(_0x2f134a){if(_0x2f134a&&_0x2f134a[_0x5374('0x5e')]===0x0){return db[_0x5374('0x33')]['create']({'name':_0x58ba7d[_0x5374('0x36')],'resourceId':_0x58ba7d['id'],'type':_0x2f134a['name'],'sectionId':_0x2f134a['id']},{})['then'](function(){return _0x548fa6;});}else{return _0x548fa6;}})[_0x5374('0x24')](function(_0x3b7211){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3b7211);throw _0x3b7211;});}return _0x548fa6;})[_0x5374('0x1b')](respondWithResult(_0x51c4e3,0xc9))[_0x5374('0x24')](handleError(_0x51c4e3,null));};exports[_0x5374('0x2f')]=function(_0x1bf39d,_0x27aefa){if(_0x1bf39d['body']['id']){delete _0x1bf39d[_0x5374('0x58')]['id'];}return db[_0x5374('0x3b')][_0x5374('0x56')]({'where':{'id':_0x1bf39d[_0x5374('0x54')]['id']},'include':[{'model':db[_0x5374('0x39')],'as':_0x5374('0x55')}]})[_0x5374('0x1b')](handleEntityNotFound(_0x27aefa,null))[_0x5374('0x1b')](saveUpdates(_0x1bf39d['body'],null))['then'](respondWithResult(_0x27aefa,null))[_0x5374('0x24')](handleError(_0x27aefa,null));};exports['destroy']=function(_0x468482,_0x4e137c){return db[_0x5374('0x3b')][_0x5374('0x56')]({'where':{'id':_0x468482[_0x5374('0x54')]['id']}})['then'](handleEntityNotFound(_0x4e137c,null))[_0x5374('0x1b')](removeEntity(_0x4e137c,null))[_0x5374('0x24')](handleError(_0x4e137c,null));};exports[_0x5374('0x5f')]=function(_0x81b489,_0x2b1104){return db['SmsAccount'][_0x5374('0x5f')]()[_0x5374('0x1b')](respondWithResult(_0x2b1104,null))[_0x5374('0x24')](handleError(_0x2b1104,null));};exports[_0x5374('0x60')]=function(_0x4672cf,_0x24b735,_0x3756f3){if(_0x4672cf[_0x5374('0x58')]['id']){delete _0x4672cf[_0x5374('0x58')]['id'];}return db[_0x5374('0x3b')][_0x5374('0x56')]({'where':{'id':_0x4672cf[_0x5374('0x54')]['id']}})[_0x5374('0x1b')](handleEntityNotFound(_0x24b735,null))['then'](function(_0x37deda){if(_0x37deda){_0x4672cf['body'][_0x5374('0x61')]=_0x37deda['id'];return db[_0x5374('0x62')][_0x5374('0x57')](_0x4672cf[_0x5374('0x58')]);}})[_0x5374('0x1b')](respondWithResult(_0x24b735,null))[_0x5374('0x24')](handleError(_0x24b735,null));};exports[_0x5374('0x63')]=function(_0x2ddf13,_0x2f9138,_0x4d5a7f){var _0xfa9cfb={'raw':![],'where':{}};var _0x561787={};var _0x5030a2={'count':0x0,'rows':[]};return db[_0x5374('0x3b')][_0x5374('0x64')]({'where':{'id':_0x2ddf13[_0x5374('0x54')]['id']}})[_0x5374('0x1b')](handleEntityNotFound(_0x2f9138,null))[_0x5374('0x1b')](function(_0x42f1bd){if(_0x42f1bd){_0x561787[_0x5374('0x3e')]=_['keys'](db['Disposition']['rawAttributes']);_0x561787[_0x5374('0x3f')]=_[_0x5374('0x40')](_0x2ddf13[_0x5374('0x3f')]);_0x561787['filters']=_['intersection'](_0x561787[_0x5374('0x3e')],_0x561787[_0x5374('0x3f')]);_0xfa9cfb['attributes']=_['intersection'](_0x561787[_0x5374('0x3e')],qs[_0x5374('0x44')](_0x2ddf13[_0x5374('0x3f')]['fields']));_0xfa9cfb[_0x5374('0x43')]=_0xfa9cfb['attributes'][_0x5374('0x45')]?_0xfa9cfb[_0x5374('0x43')]:_0x561787['model'];if(!_0x2ddf13[_0x5374('0x3f')]['hasOwnProperty']('nolimit')){_0xfa9cfb[_0x5374('0x29')]=qs['limit'](_0x2ddf13[_0x5374('0x3f')][_0x5374('0x29')]);_0xfa9cfb['offset']=qs['offset'](_0x2ddf13[_0x5374('0x3f')]['offset']);}_0xfa9cfb[_0x5374('0x48')]=qs[_0x5374('0x49')](_0x2ddf13[_0x5374('0x3f')][_0x5374('0x49')]);_0xfa9cfb['where']=qs[_0x5374('0x41')](_[_0x5374('0x4a')](_0x2ddf13['query'],_0x561787[_0x5374('0x41')]));_0xfa9cfb[_0x5374('0x4c')][_0x5374('0x61')]=_0x42f1bd['id'];if(_0x2ddf13['query'][_0x5374('0x4b')]){_0xfa9cfb['where']=_['merge'](_0xfa9cfb[_0x5374('0x4c')],{'$or':_[_0x5374('0x3a')](_0xfa9cfb['attributes'],function(_0x3be89d){var _0x2c5ec3={};_0x2c5ec3[_0x3be89d]={'$like':'%'+_0x2ddf13[_0x5374('0x3f')][_0x5374('0x4b')]+'%'};return _0x2c5ec3;})});}_0xfa9cfb=_['merge']({},_0xfa9cfb,_0x2ddf13[_0x5374('0x4e')]);return db[_0x5374('0x62')][_0x5374('0x2a')]({'where':_0xfa9cfb[_0x5374('0x4c')]})[_0x5374('0x1b')](function(_0x4e6d60){_0x5030a2[_0x5374('0x2a')]=_0x4e6d60;if(_0x2ddf13[_0x5374('0x3f')]['includeAll']){_0xfa9cfb[_0x5374('0x50')]=[{'all':!![]}];}return db[_0x5374('0x62')][_0x5374('0x51')](_0xfa9cfb);})[_0x5374('0x1b')](function(_0x4f98fc){_0x5030a2['rows']=_0x4f98fc;return _0x5030a2;});}})['then'](respondWithFilteredResult(_0x2f9138,_0xfa9cfb))[_0x5374('0x24')](handleError(_0x2f9138,null));};exports[_0x5374('0x65')]=function(_0x2e00e3,_0x55b308,_0x3ae408){return db['SmsAccount'][_0x5374('0x56')]({'where':{'id':_0x2e00e3[_0x5374('0x54')]['id']}})[_0x5374('0x1b')](handleEntityNotFound(_0x55b308,null))[_0x5374('0x1b')](function(_0x34c217){if(_0x34c217){return _0x34c217['removeDispositions'](_0x2e00e3[_0x5374('0x3f')][_0x5374('0x66')]);}})[_0x5374('0x1b')](respondWithStatusCode(_0x55b308,null))[_0x5374('0x24')](handleError(_0x55b308,null));};exports[_0x5374('0x67')]=function(_0xd22938,_0x50df91,_0x1958a2){if(_0xd22938[_0x5374('0x58')]['id']){delete _0xd22938['body']['id'];}return db[_0x5374('0x3b')][_0x5374('0x56')]({'where':{'id':_0xd22938[_0x5374('0x54')]['id']}})[_0x5374('0x1b')](handleEntityNotFound(_0x50df91,null))['then'](function(_0x45d1f2){if(_0x45d1f2){_0xd22938[_0x5374('0x58')][_0x5374('0x61')]=_0x45d1f2['id'];return db[_0x5374('0x68')][_0x5374('0x57')](_0xd22938['body']);}})['then'](respondWithResult(_0x50df91,null))[_0x5374('0x24')](handleError(_0x50df91,null));};exports[_0x5374('0x69')]=function(_0x2cc657,_0x25b607,_0x4f2c26){var _0xe9e114={'raw':![],'where':{}};var _0x119764={};var _0x114e24={'count':0x0,'rows':[]};return db[_0x5374('0x3b')][_0x5374('0x64')]({'where':{'id':_0x2cc657[_0x5374('0x54')]['id']}})['then'](handleEntityNotFound(_0x25b607,null))[_0x5374('0x1b')](function(_0x5ac071){if(_0x5ac071){_0x119764[_0x5374('0x3e')]=_['keys'](db['CannedAnswer'][_0x5374('0x3c')]);_0x119764['query']=_['keys'](_0x2cc657[_0x5374('0x3f')]);_0x119764[_0x5374('0x41')]=_['intersection'](_0x119764[_0x5374('0x3e')],_0x119764[_0x5374('0x3f')]);_0xe9e114[_0x5374('0x43')]=_[_0x5374('0x42')](_0x119764['model'],qs[_0x5374('0x44')](_0x2cc657[_0x5374('0x3f')]['fields']));_0xe9e114[_0x5374('0x43')]=_0xe9e114['attributes']['length']?_0xe9e114[_0x5374('0x43')]:_0x119764[_0x5374('0x3e')];if(!_0x2cc657['query'][_0x5374('0x46')](_0x5374('0x47'))){_0xe9e114[_0x5374('0x29')]=qs[_0x5374('0x29')](_0x2cc657[_0x5374('0x3f')][_0x5374('0x29')]);_0xe9e114[_0x5374('0x27')]=qs[_0x5374('0x27')](_0x2cc657[_0x5374('0x3f')]['offset']);}_0xe9e114[_0x5374('0x48')]=qs['sort'](_0x2cc657[_0x5374('0x3f')][_0x5374('0x49')]);_0xe9e114[_0x5374('0x4c')]=qs['filters'](_['pick'](_0x2cc657[_0x5374('0x3f')],_0x119764[_0x5374('0x41')]));_0xe9e114['where']['SmsAccountId']=_0x5ac071['id'];if(_0x2cc657['query'][_0x5374('0x4b')]){_0xe9e114[_0x5374('0x4c')]=_[_0x5374('0x4d')](_0xe9e114[_0x5374('0x4c')],{'$or':_[_0x5374('0x3a')](_0xe9e114[_0x5374('0x43')],function(_0x4b109d){var _0x1eaf95={};_0x1eaf95[_0x4b109d]={'$like':'%'+_0x2cc657[_0x5374('0x3f')][_0x5374('0x4b')]+'%'};return _0x1eaf95;})});}_0xe9e114=_[_0x5374('0x4d')]({},_0xe9e114,_0x2cc657[_0x5374('0x4e')]);return db[_0x5374('0x68')][_0x5374('0x2a')]({'where':_0xe9e114[_0x5374('0x4c')]})[_0x5374('0x1b')](function(_0x53e2af){_0x114e24[_0x5374('0x2a')]=_0x53e2af;if(_0x2cc657[_0x5374('0x3f')][_0x5374('0x4f')]){_0xe9e114[_0x5374('0x50')]=[{'all':!![]}];}return db['CannedAnswer'][_0x5374('0x51')](_0xe9e114);})[_0x5374('0x1b')](function(_0x137645){_0x114e24['rows']=_0x137645;return _0x114e24;});}})['then'](respondWithFilteredResult(_0x25b607,_0xe9e114))['catch'](handleError(_0x25b607,null));};exports[_0x5374('0x6a')]=function(_0xc36543,_0x553082,_0x4ebd4e){return db[_0x5374('0x3b')][_0x5374('0x56')]({'where':{'id':_0xc36543[_0x5374('0x54')]['id']}})[_0x5374('0x1b')](handleEntityNotFound(_0x553082,null))['then'](function(_0x1b10f5){if(_0x1b10f5){return _0x1b10f5[_0x5374('0x6a')](_0xc36543['query'][_0x5374('0x66')]);}})[_0x5374('0x1b')](respondWithStatusCode(_0x553082,null))[_0x5374('0x24')](handleError(_0x553082,null));};exports[_0x5374('0x6b')]=function(_0x43739c,_0xd3adef,_0x179326){var _0x5c6f16={'channel':_0x5374('0x6c')};var _0xaad36=[];var _0x3d0e24=[];var _0x4e54d8={};return db['SmsAccount'][_0x5374('0x56')]({'where':{'id':_0x43739c[_0x5374('0x54')]['id']},'include':[{'model':db[_0x5374('0x6d')],'as':_0x5374('0x6e')}]})[_0x5374('0x1b')](handleEntityNotFound(_0xd3adef,null))[_0x5374('0x1b')](function(_0xf49f9a){_0x5c6f16[_0x5374('0x6f')]=_0xf49f9a;_0x5c6f16[_0x5374('0x70')]=_['orderBy'](_0xf49f9a[_0x5374('0x6e')],['priority'],[_0x5374('0x71')]);if(_0x5c6f16[_0x5374('0x6f')][_0x5374('0x6e')]){delete _0x5c6f16['account'][_0x5374('0x6e')];}return db[_0x5374('0x72')]['describe']();})[_0x5374('0x1b')](function(_0x3e5bac){if(!_0x3e5bac){throw new db['Sequelize'][(_0x5374('0x73'))](_0x5374('0x74'));}_0xaad36=_[_0x5374('0x75')](_[_0x5374('0x40')](_0x3e5bac),[_0x5374('0x76'),'updatedAt']);_0x3d0e24=_[_0x5374('0x75')](_[_0x5374('0x40')](_0x3e5bac),[_0x5374('0x76'),_0x5374('0x77'),_0x5374('0x78'),_0x5374('0x79')]);_0x5c6f16[_0x5374('0x58')]={'mapKey':_0x5374('0x7a')};if(_0x5c6f16[_0x5374('0x6f')][_0x5374('0x3d')]){switch(_0x5c6f16[_0x5374('0x6f')][_0x5374('0x3d')]){case _0x5374('0x7b'):_0x5c6f16[_0x5374('0x58')][_0x5374('0x7c')]=_0x43739c[_0x5374('0x58')]['From'];_0x5c6f16[_0x5374('0x58')][_0x5374('0x58')]=_0x43739c['body']['Body'];_0x5c6f16[_0x5374('0x58')][_0x5374('0x7d')]=_0x43739c[_0x5374('0x58')]['MessageSid'];break;case _0x5374('0x7e'):_0x5c6f16[_0x5374('0x58')]['from']='+'+_0x43739c[_0x5374('0x58')][_0x5374('0x7f')];_0x5c6f16[_0x5374('0x58')]['body']=_0x43739c[_0x5374('0x58')][_0x5374('0x80')];break;case _0x5374('0x81'):_0x5c6f16[_0x5374('0x58')][_0x5374('0x7c')]=_0x43739c[_0x5374('0x58')]['from'];_0x5c6f16['body']['body']=_0x43739c[_0x5374('0x58')][_0x5374('0x22')];break;case _0x5374('0x82'):_0x5c6f16[_0x5374('0x58')]['from']=_0x43739c['body'][_0x5374('0x7c')];_0x5c6f16[_0x5374('0x58')][_0x5374('0x58')]=_0x43739c[_0x5374('0x58')][_0x5374('0x58')];_0x5c6f16[_0x5374('0x58')]['messageId']=_0x43739c['body'][_0x5374('0x83')];break;case'plivo':_0x5c6f16[_0x5374('0x58')][_0x5374('0x7c')]=_0x43739c[_0x5374('0x58')][_0x5374('0x84')];_0x5c6f16[_0x5374('0x58')][_0x5374('0x58')]=_0x43739c[_0x5374('0x58')][_0x5374('0x85')];_0x5c6f16[_0x5374('0x58')]['messageId']=_0x43739c[_0x5374('0x58')][_0x5374('0x86')];break;case _0x5374('0x87'):_0x5c6f16[_0x5374('0x58')][_0x5374('0x7c')]='+'+_0x43739c['body'][_0x5374('0x88')][0x0][_0x5374('0x7c')];_0x5c6f16[_0x5374('0x58')][_0x5374('0x58')]=_0x43739c[_0x5374('0x58')]['results'][0x0]['text'];_0x5c6f16[_0x5374('0x58')][_0x5374('0x7d')]=_0x43739c[_0x5374('0x58')][_0x5374('0x88')][0x0][_0x5374('0x7d')];break;case _0x5374('0x89'):_0x5c6f16[_0x5374('0x58')][_0x5374('0x7c')]=_0x43739c['body'][_0x5374('0x8a')];_0x5c6f16[_0x5374('0x58')][_0x5374('0x58')]=_0x43739c[_0x5374('0x58')][_0x5374('0x8b')][_0x5374('0x22')];break;case _0x5374('0x8c'):_0x5c6f16[_0x5374('0x58')][_0x5374('0x7c')]=_0x43739c[_0x5374('0x58')][_0x5374('0x8d')];_0x5c6f16[_0x5374('0x58')][_0x5374('0x58')]=_0x43739c[_0x5374('0x58')]['text'];_0x5c6f16[_0x5374('0x58')][_0x5374('0x7d')]=_0x43739c[_0x5374('0x58')][_0x5374('0x8e')];break;case _0x5374('0x8f'):_0x5c6f16[_0x5374('0x58')][_0x5374('0x7d')]=_0x43739c[_0x5374('0x58')][0x0][_0x5374('0x22')]['id'];_0x5c6f16[_0x5374('0x58')]['from']=_0x43739c[_0x5374('0x58')][0x0][_0x5374('0x22')]['from'];_0x5c6f16[_0x5374('0x58')][_0x5374('0x58')]=_0x43739c[_0x5374('0x58')][0x0][_0x5374('0x22')]['text'];break;case'intelepeer':_0x5c6f16[_0x5374('0x58')][_0x5374('0x7c')]=_0x43739c[_0x5374('0x58')][_0x5374('0x7c')];_0x5c6f16[_0x5374('0x58')]['body']=_0x43739c['body'][_0x5374('0x22')];_0x5c6f16[_0x5374('0x58')][_0x5374('0x7d')]=_0x43739c[_0x5374('0x58')]['refid'];break;}}if(_0x5c6f16[_0x5374('0x58')]['id']){delete _0x5c6f16[_0x5374('0x58')]['id'];}if(_[_0x5374('0x90')](_0x5c6f16[_0x5374('0x58')][_0x5374('0x7c')])){throw new db[(_0x5374('0x91'))]['ValidationError']('from\x20is\x20mandatory');}if(_[_0x5374('0x90')](_0x5c6f16['body'][_0x5374('0x58')])||_0x5c6f16[_0x5374('0x58')][_0x5374('0x58')]===''){throw new db[(_0x5374('0x91'))][(_0x5374('0x73'))](_0x5374('0x92'));}if(_[_0x5374('0x90')](_0x5c6f16['body'][_0x5374('0x93')])){throw new db['Sequelize'][(_0x5374('0x73'))](_0x5374('0x94')+_0x3d0e24);}if(!_['includes'](_0x3d0e24,_0x5c6f16[_0x5374('0x58')][_0x5374('0x93')])){throw new db[(_0x5374('0x91'))][(_0x5374('0x73'))](_0x5374('0x95')+_0x3d0e24);}_0x4e54d8[_0x5c6f16[_0x5374('0x58')][_0x5374('0x93')]]=_0x5c6f16[_0x5374('0x58')][_0x5374('0x7c')];return db[_0x5374('0x96')][_0x5374('0x56')]({'where':{'id':_0x5c6f16['account'][_0x5374('0x79')]},'include':[{'model':db[_0x5374('0x72')],'as':'Contacts','where':_0x4e54d8,'limit':0x1,'order':[['updatedAt',_0x5374('0x97')]]}]});})[_0x5374('0x1b')](handleEntityNotFound(_0xd3adef,null))[_0x5374('0x1b')](function(_0xa474d0){if(_0xa474d0){_0x5c6f16[_0x5374('0x98')]=_['omit'](_0xa474d0,[_0x5374('0x99')]);if(_0xa474d0[_0x5374('0x99')][_0x5374('0x45')]){return _0xa474d0['Contacts'][0x0];}var _0x2d1698=_['defaults'](_0x5c6f16['body'],{'firstName':_0x5c6f16[_0x5374('0x58')][_0x5374('0x7c')],'ListId':_0xa474d0['id']});_0x2d1698[_0x5c6f16['body'][_0x5374('0x93')]]=_0x5c6f16[_0x5374('0x58')][_0x5374('0x7c')];return db['CmContact']['create'](_0x2d1698,{'fields':_0xaad36,'raw':!![]});}})[_0x5374('0x1b')](handleEntityNotFound(_0xd3adef,null))['then'](function(_0x32eb7a){if(_0x32eb7a){_0x5c6f16[_0x5374('0x9a')]=_0x32eb7a;var _0x566606={'ContactId':_0x32eb7a['id'],'phone':_0x5c6f16[_0x5374('0x58')][_0x5374('0x7c')],'SmsAccountId':_0x43739c[_0x5374('0x54')]['id']};var _0x2c01a6={'ContactId':_0x32eb7a['id'],'SmsAccountId':_0x43739c[_0x5374('0x54')]['id'],'closed':![]};return db[_0x5374('0x9b')][_0x5374('0x56')]({'where':_0x2c01a6})[_0x5374('0x1b')](function(_0x50c8b4){if(_0x50c8b4){return[_0x50c8b4,![]];}return db['SmsInteraction'][_0x5374('0x57')](_0x566606)[_0x5374('0x1b')](function(_0x78fb84){return[_0x78fb84,!![]];});});}})['spread'](function(_0x24e66a,_0x2e0f3d){_0x5c6f16['interaction']=_0x24e66a['get']({'plain':!![]});_0x5c6f16[_0x5374('0x9c')][_0x5374('0x9d')]=![];if(_0x2e0f3d){if(_0x5c6f16[_0x5374('0x6f')][_0x5374('0x9e')]){_0x5c6f16[_0x5374('0x70')][_0x5374('0x9f')]({'id':0x0,'priority':_0x5c6f16['applications']['length']+0x1,'app':'close','appdata':'unmanaged','interval':_0x5374('0xa0')});}_0x5c6f16[_0x5374('0x9c')][_0x5374('0x9d')]=!![];}return db[_0x5374('0xa1')][_0x5374('0x57')]({'phone':_0x5c6f16['body']['from'],'messageId':_0x5c6f16['body'][_0x5374('0x7d')],'body':_0x5c6f16[_0x5374('0x58')][_0x5374('0x58')],'SmsAccountId':_0x43739c[_0x5374('0x54')]['id'],'SmsInteractionId':_0x24e66a['id'],'direction':'in','ContactId':_0x24e66a[_0x5374('0xa2')],'AttachmentId':_0x5c6f16[_0x5374('0x58')][_0x5374('0xa3')]});})[_0x5374('0x1b')](function(_0x24f4d7){_0x5c6f16[_0x5374('0x22')]=_0x24f4d7;if(!_0x5c6f16[_0x5374('0x9c')][_0x5374('0xa4')])return;return db[_0x5374('0xa5')][_0x5374('0x56')]({'attributes':['id',_0x5374('0x36')],'where':{'id':_0x5c6f16['interaction']['UserId']}});})['then'](function(_0x16324c){if(_0x16324c){_0x5c6f16[_0x5374('0x70')][_0x5374('0xa6')]({'id':0x0,'priority':0x0,'app':_0x5374('0xa7'),'appdata':_0x16324c['name']+','+(_0x5c6f16[_0x5374('0x6f')]['waitForTheAssignedAgent']||0xa),'interval':_0x5374('0xa0')});}if(!_0x5c6f16[_0x5374('0x9c')][_0x5374('0xa8')])return;return db[_0x5374('0xa9')]['find']({'attributes':['id',_0x5374('0x36')],'where':{'id':_0x5c6f16[_0x5374('0x9c')]['queueId']}});})[_0x5374('0x1b')](function(_0x30e28a){if(_0x30e28a){_0x5c6f16['applications']['unshift']({'id':0x0,'priority':0x1,'app':_0x5374('0xaa'),'appdata':_0x30e28a['name']+','+(_0x5c6f16[_0x5374('0x6f')][_0x5374('0xab')]||0x12c),'interval':_0x5374('0xa0')});}return respondWithRpcPromise(_0x5374('0xac'),_0x5374('0xad'),_0x5c6f16);})['then'](function(_0x1c28a1){if(_0x1c28a1){var _0x3cb999=0xc8;var _0x458285='receiveMessage';logger[_0x5374('0x1c')](_0x5374('0xae'),_0x458285,_0x3cb999,_0x5374('0xaf'));logger[_0x5374('0xb0')](_0x5374('0xb1'),_0x458285,_0x3cb999,_0x5374('0xaf'),JSON[_0x5374('0x1f')](_0x1c28a1));if(_0x5c6f16[_0x5374('0x6f')]['type']===_0x5374('0x7b')){return _0xd3adef[_0x5374('0x26')](_0x3cb999)['set'](_0x5374('0xb2'),'text/xml')[_0x5374('0x37')](_0x5374('0xb3'));}else{return _0xd3adef[_0x5374('0x26')](_0x3cb999)[_0x5374('0x2c')](_0x1c28a1);}}})['catch'](handleError(_0xd3adef,null));};exports[_0x5374('0xb4')]=function(_0x2d6d64,_0x40e436){var _0x512fd8=_0x2d6d64[_0x5374('0x54')]['id'];var _0x4e8014=_0x2d6d64[_0x5374('0x58')];var _0xd6549e=0xc8;var _0x15de0f=null;return db['sequelize']['transaction']({'isolationLevel':db[_0x5374('0xb5')][_0x5374('0xb6')][_0x5374('0xb7')][_0x5374('0xb8')]},function(_0x1de7bd){return db[_0x5374('0x3b')][_0x5374('0x64')]({'where':{'id':_0x512fd8},'transaction':_0x1de7bd})[_0x5374('0x1b')](function(_0x28c31a){if(_0x28c31a){return db[_0x5374('0x6d')]['destroy']({'where':{'SmsAccountId':_0x512fd8},'transaction':_0x1de7bd})[_0x5374('0x1b')](function(){var _0x2a46ba=_[_0x5374('0x3a')](_0x4e8014,function(_0x1fdbc7){_0x1fdbc7[_0x5374('0x61')]=_0x512fd8;return _0x1fdbc7;});return db[_0x5374('0x6d')][_0x5374('0xb9')](_0x2a46ba,{'transaction':_0x1de7bd});});}else{_0xd6549e=0x194;_0x15de0f=[];}});})[_0x5374('0x1b')](function(){if(_0xd6549e!==0x194){return db[_0x5374('0x6d')]['findAndCountAll']({'where':{'SmsAccountId':_0x512fd8},'order':_0x5374('0xba')})[_0x5374('0x1b')](function(_0x1dceed){_0x15de0f=_0x1dceed;});}})[_0x5374('0x24')](function(_0x1eca51){_0xd6549e=0x1f4;logger[_0x5374('0x20')](_0x1eca51[_0x5374('0x35')]);if(_0x1eca51[_0x5374('0x36')]){delete _0x1eca51['name'];}_0x15de0f=_0x1eca51;})[_0x5374('0xbb')](function(){if(_0x15de0f===null){_0x40e436[_0x5374('0x34')](_0xd6549e);}else{if(_0xd6549e===0x1f4){_0x40e436[_0x5374('0x26')](_0xd6549e)['send'](_0x15de0f);}else{_0x40e436[_0x5374('0x26')](_0xd6549e)[_0x5374('0x2c')](_0x15de0f);}}});};exports[_0x5374('0xbc')]=function(_0x95c2c5,_0x154cc9,_0x4f2f00){var _0x1bb569={};var _0x311f86={};var _0x4b62c0;var _0x12bcbe;return db['SmsAccount'][_0x5374('0x64')]({'where':{'id':_0x95c2c5[_0x5374('0x54')]['id']}})[_0x5374('0x1b')](handleEntityNotFound(_0x154cc9,null))[_0x5374('0x1b')](function(_0x10bc49){if(_0x10bc49){_0x4b62c0=_0x10bc49;_0x311f86[_0x5374('0x3e')]=_[_0x5374('0x40')](db[_0x5374('0x6d')]['rawAttributes']);_0x311f86[_0x5374('0x3f')]=_[_0x5374('0x40')](_0x95c2c5['query']);_0x311f86[_0x5374('0x41')]=_[_0x5374('0x42')](_0x311f86[_0x5374('0x3e')],_0x311f86['query']);_0x1bb569[_0x5374('0x43')]=_[_0x5374('0x42')](_0x311f86[_0x5374('0x3e')],qs[_0x5374('0x44')](_0x95c2c5[_0x5374('0x3f')][_0x5374('0x44')]));_0x1bb569[_0x5374('0x43')]=_0x1bb569['attributes'][_0x5374('0x45')]?_0x1bb569['attributes']:_0x311f86[_0x5374('0x3e')];_0x1bb569['order']=qs['sort'](_0x95c2c5['query'][_0x5374('0x49')]);_0x1bb569[_0x5374('0x4c')]=qs[_0x5374('0x41')](_[_0x5374('0x4a')](_0x95c2c5[_0x5374('0x3f')],_0x311f86[_0x5374('0x41')]));if(_0x95c2c5[_0x5374('0x3f')][_0x5374('0x4b')]){_0x1bb569[_0x5374('0x4c')]=_[_0x5374('0x4d')](_0x1bb569[_0x5374('0x4c')],{'$or':_['map'](_0x1bb569[_0x5374('0x43')],function(_0x261aae){var _0x27517f={};_0x27517f[_0x261aae]={'$like':'%'+_0x95c2c5['query'][_0x5374('0x4b')]+'%'};return _0x27517f;})});}_0x1bb569=_[_0x5374('0x4d')]({},_0x1bb569,_0x95c2c5['options']);return _0x4b62c0[_0x5374('0xbc')](_0x1bb569);}})[_0x5374('0x1b')](function(_0x1fc344){if(_0x1fc344){_0x12bcbe=_0x1fc344[_0x5374('0x45')];if(!_0x95c2c5[_0x5374('0x3f')][_0x5374('0x46')]('nolimit')){_0x1bb569['limit']=qs[_0x5374('0x29')](_0x95c2c5[_0x5374('0x3f')]['limit']);_0x1bb569['offset']=qs[_0x5374('0x27')](_0x95c2c5[_0x5374('0x3f')]['offset']);}return _0x4b62c0['getApplications'](_0x1bb569);}})[_0x5374('0x1b')](function(_0x378a77){if(_0x378a77){return _0x378a77?{'count':_0x12bcbe,'rows':_0x378a77}:null;}})[_0x5374('0x1b')](respondWithResult(_0x154cc9,null))[_0x5374('0x24')](handleError(_0x154cc9,null));};exports[_0x5374('0xbd')]=function(_0x501e8c,_0x1628e3,_0x31a2d8){var _0x9ccd34={'raw':![],'where':{}};var _0x45d503={};var _0x159f4d={'count':0x0,'rows':[]};return db[_0x5374('0x3b')]['findOne']({'where':{'id':_0x501e8c['params']['id']}})[_0x5374('0x1b')](handleEntityNotFound(_0x1628e3,null))[_0x5374('0x1b')](function(_0x1be57f){if(_0x1be57f){_0x45d503[_0x5374('0x3e')]=_[_0x5374('0x40')](db[_0x5374('0x9b')]['rawAttributes']);_0x45d503['query']=_[_0x5374('0x40')](_0x501e8c['query']);_0x45d503[_0x5374('0x41')]=_['intersection'](_0x45d503[_0x5374('0x3e')],_0x45d503['query']);_0x9ccd34[_0x5374('0x43')]=_[_0x5374('0x42')](_0x45d503[_0x5374('0x3e')],qs[_0x5374('0x44')](_0x501e8c[_0x5374('0x3f')][_0x5374('0x44')]));_0x9ccd34[_0x5374('0x43')]=_0x9ccd34[_0x5374('0x43')][_0x5374('0x45')]?_0x9ccd34[_0x5374('0x43')]:_0x45d503['model'];if(!_0x501e8c[_0x5374('0x3f')][_0x5374('0x46')]('nolimit')){_0x9ccd34[_0x5374('0x29')]=qs[_0x5374('0x29')](_0x501e8c[_0x5374('0x3f')][_0x5374('0x29')]);_0x9ccd34[_0x5374('0x27')]=qs[_0x5374('0x27')](_0x501e8c[_0x5374('0x3f')][_0x5374('0x27')]);}_0x9ccd34[_0x5374('0x48')]=qs[_0x5374('0x49')](_0x501e8c[_0x5374('0x3f')][_0x5374('0x49')]);_0x9ccd34[_0x5374('0x4c')]=qs['filters'](_[_0x5374('0x4a')](_0x501e8c['query'],_0x45d503[_0x5374('0x41')]));_0x9ccd34[_0x5374('0x4c')][_0x5374('0x61')]=_0x1be57f['id'];if(_0x501e8c['query'][_0x5374('0x4b')]){_0x9ccd34['where']=_[_0x5374('0x4d')](_0x9ccd34[_0x5374('0x4c')],{'$or':_[_0x5374('0x3a')](_0x9ccd34[_0x5374('0x43')],function(_0x1f3db8){var _0x4eaea7={};_0x4eaea7[_0x1f3db8]={'$like':'%'+_0x501e8c[_0x5374('0x3f')][_0x5374('0x4b')]+'%'};return _0x4eaea7;})});}_0x9ccd34=_[_0x5374('0x4d')]({},_0x9ccd34,_0x501e8c['options']);return db[_0x5374('0x9b')]['count']({'where':_0x9ccd34[_0x5374('0x4c')]})[_0x5374('0x1b')](function(_0x38cf6f){_0x159f4d[_0x5374('0x2a')]=_0x38cf6f;if(_0x501e8c['query'][_0x5374('0x4f')]){_0x9ccd34[_0x5374('0x50')]=[{'model':db[_0x5374('0x72')],'as':_0x5374('0xbe'),'required':![]},{'model':db['User'],'as':_0x5374('0xbf'),'attributes':[_0x5374('0x36'),_0x5374('0xc0'),_0x5374('0xc1')],'required':![]},{'model':db['Tag'],'as':_0x5374('0xc2'),'attributes':['id','name',_0x5374('0xc3')],'where':_0x501e8c[_0x5374('0x3f')][_0x5374('0xc4')]?{'id':_0x501e8c[_0x5374('0x3f')]['tag']}:undefined,'required':_0x501e8c[_0x5374('0x3f')][_0x5374('0xc4')]?!![]:![]}];}return db['SmsInteraction'][_0x5374('0x51')](_0x9ccd34);})[_0x5374('0x1b')](function(_0x57338d){_0x159f4d[_0x5374('0x52')]=_0x57338d;return _0x159f4d;});}})[_0x5374('0x1b')](respondWithFilteredResult(_0x1628e3,_0x9ccd34))['catch'](handleError(_0x1628e3,null));};exports['send']=function(_0x1c819d,_0xc05c13,_0x552657){var _0x4a734d,_0x4014f8,_0x3ebddc;if(_[_0x5374('0x90')](_0x1c819d[_0x5374('0x58')]['body'])||_0x1c819d[_0x5374('0x58')][_0x5374('0x58')]===''){throw new db[(_0x5374('0x91'))][(_0x5374('0x73'))](_0x5374('0x92'));}if(_[_0x5374('0x90')](_0x1c819d['body']['to'])){throw new db[(_0x5374('0x91'))]['ValidationError'](_0x5374('0xc5'));}_0x4a734d=_0x1c819d[_0x5374('0x58')]['to'];return db[_0x5374('0x3b')][_0x5374('0x56')]({'where':{'id':_0x1c819d[_0x5374('0x54')]['id']},'include':[{'model':db[_0x5374('0x96')],'as':'List','include':[{'model':db[_0x5374('0x72')],'as':'Contacts','where':{'mobile':_0x4a734d},'limit':0x1,'order':[['updatedAt','DESC']]}]}]})['then'](handleEntityNotFound(_0xc05c13,null))['then'](function(_0x1a7738){if(_0x1a7738&&_0x1a7738['List']){_0x4014f8=_0x1a7738[_0x5374('0x31')]({'plain':!![]});if(_0x4014f8[_0x5374('0xc6')]&&_0x4014f8[_0x5374('0xc6')][_0x5374('0x99')][_0x5374('0x45')]){return _0x4014f8['List']['Contacts'][0x0];}return db[_0x5374('0x72')]['create'](_[_0x5374('0x14')](_0x1c819d[_0x5374('0x58')],{'firstName':_0x4a734d,'mobile':_0x4a734d,'phone':_0x4a734d,'ListId':_0x4014f8[_0x5374('0x79')]}));}})['then'](handleEntityNotFound(_0xc05c13,null))['then'](function(_0x29b9af){if(_0x29b9af){_0x3ebddc=_0x29b9af;return db['SmsInteraction']['find']({'where':{'ContactId':_0x3ebddc['id'],'closed':![],'SmsAccountId':_0x4014f8['id']}})['then'](function(_0x4dbc58){if(_0x4dbc58){return[_0x4dbc58,![]];}return db[_0x5374('0x9b')][_0x5374('0x57')]({'UserId':_0x1c819d[_0x5374('0x59')]['id'],'ContactId':_0x3ebddc['id'],'SmsAccountId':_0x4014f8['id'],'phone':_0x4a734d,'firstMsgDirection':_0x5374('0xc7'),'Messages':[_[_0x5374('0x4d')](_0x1c819d[_0x5374('0x58')],{'read':![],'body':_0x1c819d[_0x5374('0x58')][_0x5374('0x58')],'phone':_0x4a734d,'SmsAccountId':_0x4014f8['id'],'UserId':_0x1c819d['user']['id'],'ContactId':_0x3ebddc['id']})]},{'include':[{'model':db[_0x5374('0xa1')],'as':'Messages'}]})['then'](function(_0x2be4ae){return[_0x2be4ae,!![]];});});}})['spread'](function(_0x1d7f8e,_0x10d5a3){if(_0x10d5a3){return _0x1d7f8e;}return db['SmsMessage'][_0x5374('0x57')](_['merge'](_0x1c819d[_0x5374('0x58')],{'read':![],'body':_0x1c819d[_0x5374('0x58')][_0x5374('0x58')],'phone':_0x4a734d,'SmsAccountId':_0x4014f8['id'],'SmsInteractionId':_0x1d7f8e['id'],'UserId':_0x1c819d['user']['id'],'ContactId':_0x3ebddc['id']}))[_0x5374('0x1b')](function(_0x4abef5){_0x1d7f8e[_0x5374('0xc8')][_0x5374('0xc9')]=[];_0x1d7f8e[_0x5374('0xc8')][_0x5374('0xc9')][_0x5374('0x9f')](_0x4abef5['dataValues']);return _0x1d7f8e;});})[_0x5374('0x1b')](respondWithResult(_0xc05c13,null))[_0x5374('0x24')](handleError(_0xc05c13,null));};exports[_0x5374('0x26')]=function(_0x4a8891,_0x5c03f5,_0x17afaf){if(_0x4a8891[_0x5374('0x58')]['id']){delete _0x4a8891[_0x5374('0x58')]['id'];}var _0x3dc6bc,_0x37663e,_0x462ce0;return db['SmsAccount']['find']({'where':{'id':_0x4a8891[_0x5374('0x54')]['id']}})['then'](handleEntityNotFound(_0x5c03f5,null))[_0x5374('0x1b')](function(_0x37c046){if(_0x37c046){_0x462ce0=_0x37c046;logger[_0x5374('0xb0')](_0x5374('0xae'),_0x5374('0x26'),'received\x20delivery\x20report\x20from',_0x37c046[_0x5374('0x3d')],util[_0x5374('0xca')](_0x4a8891[_0x5374('0x58')],{'showHidden':![],'depth':null}));switch(_0x37c046[_0x5374('0x3d')]){case _0x5374('0x7e'):if(_0x4a8891[_0x5374('0x58')]['skebby_dispatch_id']&&_0x4a8891[_0x5374('0x58')][_0x5374('0x26')]){_0x37663e=_0x4a8891[_0x5374('0x58')][_0x5374('0x26')];return db[_0x5374('0xa1')][_0x5374('0x56')]({'where':{'messageId':_0x4a8891[_0x5374('0x58')][_0x5374('0xcb')]}});}break;case'connectel':if(_0x4a8891[_0x5374('0x58')][_0x5374('0xcc')]&&_0x4a8891['body'][_0x5374('0xcd')]){_0x37663e=_0x4a8891['body'][_0x5374('0xcd')];return db[_0x5374('0xa1')][_0x5374('0x56')]({'where':{'messageId':_0x4a8891[_0x5374('0x58')][_0x5374('0xcc')]}});}break;case _0x5374('0x82'):if(_0x4a8891['body'][_0x5374('0x83')]&&_0x4a8891[_0x5374('0x58')][_0x5374('0xce')]){_0x37663e=_0x4a8891[_0x5374('0x58')][_0x5374('0xce')];return db[_0x5374('0xa1')][_0x5374('0x56')]({'where':{'messageId':_0x4a8891[_0x5374('0x58')][_0x5374('0x83')]}});}break;case'infobip':var _0x1743ad=_0x4a8891[_0x5374('0x58')][_0x5374('0x88')][0x0];if(_0x1743ad[_0x5374('0x7d')]&&_0x1743ad[_0x5374('0x26')][_0x5374('0xcf')]===_0x5374('0xd0')){_0x37663e=_0x1743ad[_0x5374('0x26')][_0x5374('0xcf')];return db[_0x5374('0xa1')]['find']({'where':{'messageId':_0x1743ad[_0x5374('0x7d')]}});}break;case _0x5374('0x8c'):if(_0x4a8891[_0x5374('0x58')][_0x5374('0x7d')]&&_0x4a8891[_0x5374('0x58')][_0x5374('0x26')]){_0x37663e=_0x4a8891[_0x5374('0x58')][_0x5374('0x26')];return db[_0x5374('0xa1')][_0x5374('0x56')]({'where':{'messageId':_0x4a8891[_0x5374('0x58')][_0x5374('0x7d')]}});}break;case _0x5374('0x8f'):if(_0x4a8891[_0x5374('0x58')][0x0][_0x5374('0x22')]['id']){_0x37663e=_0x4a8891[_0x5374('0x58')][0x0][_0x5374('0x3d')];return db[_0x5374('0xa1')][_0x5374('0x56')]({'where':{'messageId':_0x4a8891[_0x5374('0x58')][0x0]['message']['id']}});}break;case _0x5374('0xd1'):if(_0x4a8891[_0x5374('0x58')][_0x5374('0xd2')]&&_0x4a8891[_0x5374('0x58')][_0x5374('0x26')]){_0x37663e=_0x4a8891['body'][_0x5374('0x26')];return db['SmsMessage']['find']({'where':{'messageId':_0x4a8891[_0x5374('0x58')][_0x5374('0xd2')]}});}break;}}})[_0x5374('0x1b')](handleEntityNotFound(_0x5c03f5,null))[_0x5374('0x1b')](function(_0x2a4cba){if(_0x2a4cba){_0x3dc6bc=_0x2a4cba;switch(_0x462ce0['type']){case _0x5374('0x7e'):if(_0x37663e===_0x5374('0xd0')){return _0x3dc6bc[_0x5374('0x2f')]({'read':!![]});}else{logger[_0x5374('0x20')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x5374('0x26'),_0x5374('0x7e'),util[_0x5374('0xca')](_0x4a8891[_0x5374('0x58')],{'showHidden':![],'depth':null}));}break;case'connectel':if(_0x37663e==='1'){return _0x3dc6bc['update']({'read':!![]});}else{logger[_0x5374('0x20')](_0x5374('0xae'),_0x5374('0x26'),_0x5374('0x7e'),util['inspect'](_0x4a8891[_0x5374('0x58')],{'showHidden':![],'depth':null}));}break;case'clicksend':if(!_0x4a8891['body'][_0x5374('0xd3')]&&_0x37663e>=0xc8&&_0x37663e<=0xce){return _0x3dc6bc[_0x5374('0x2f')]({'read':!![]});}else{logger[_0x5374('0x20')](_0x5374('0xae'),'status',_0x5374('0x82'),util[_0x5374('0xca')](_0x4a8891[_0x5374('0x58')],{'showHidden':![],'depth':null}));}break;case _0x5374('0x87'):var _0x7c6616=_0x4a8891['body'][_0x5374('0x88')][0x0];if(_0x7c6616['status'][_0x5374('0xcf')]==='DELIVERED'){return _0x3dc6bc[_0x5374('0x2f')]({'read':!![]});}else{logger[_0x5374('0x20')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x5374('0x26'),_0x5374('0x87'),util[_0x5374('0xca')](_0x4a8891['body'],{'showHidden':![],'depth':null}));}break;case _0x5374('0x8c'):if(_0x37663e==_0x5374('0xd4')||_0x37663e=='RECEIVED_BY_RECIPIENT'){return _0x3dc6bc['update']({'read':!![]});}else{logger[_0x5374('0x20')](_0x5374('0xae'),_0x5374('0x26'),_0x5374('0x8c'),util[_0x5374('0xca')](_0x4a8891['body'],{'showHidden':![],'depth':null}));}break;case _0x5374('0x8f'):if(_0x37663e==_0x5374('0xd5')){return _0x3dc6bc['update']({'read':!![]});}else{logger[_0x5374('0x20')](_0x5374('0xae'),_0x5374('0x26'),_0x5374('0x8f'),util[_0x5374('0xca')](_0x4a8891[_0x5374('0x58')],{'showHidden':![],'depth':null}));}break;case _0x5374('0xd1'):if(_0x37663e===_0x5374('0xd6')||_0x37663e===_0x5374('0xd7')){return _0x3dc6bc[_0x5374('0x2f')]({'read':!![]});}else{logger[_0x5374('0x20')](_0x5374('0xae'),_0x5374('0x26'),'intelepeer',util[_0x5374('0xca')](_0x4a8891[_0x5374('0x58')],{'showHidden':![],'depth':null}));}break;}return _0x3dc6bc;}})[_0x5374('0x1b')](respondWithResult(_0x5c03f5,null))['catch'](handleError(_0x5c03f5,null));};exports['statusGet']=function(_0xd574e8,_0x4de23b,_0xb4fd93){var _0x2e09d4,_0x333664,_0x4263e8;return db['SmsAccount']['find']({'where':{'id':_0xd574e8[_0x5374('0x54')]['id']}})[_0x5374('0x1b')](handleEntityNotFound(_0x4de23b,null))[_0x5374('0x1b')](function(_0xf43ad0){if(_0xf43ad0){_0x4263e8=_0xf43ad0;logger[_0x5374('0xb0')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x5374('0x26'),'received\x20delivery\x20report\x20from',_0xf43ad0[_0x5374('0x3d')],util['inspect'](_0xd574e8[_0x5374('0x3f')],{'showHidden':![],'depth':null}));switch(_0xf43ad0[_0x5374('0x3d')]){case _0x5374('0x89'):if(_0xd574e8['query'][_0x5374('0xd8')]&&_0xd574e8[_0x5374('0x3f')][_0x5374('0xd9')]){_0x333664=_0xd574e8[_0x5374('0x3f')][_0x5374('0xd9')];return db[_0x5374('0xa1')][_0x5374('0x56')]({'where':{'messageId':_0xd574e8[_0x5374('0x3f')][_0x5374('0xd8')]}});}break;}}})[_0x5374('0x1b')](handleEntityNotFound(_0x4de23b,null))['then'](function(_0x3ec245){if(_0x3ec245){_0x2e09d4=_0x3ec245;switch(_0x4263e8[_0x5374('0x3d')]){case _0x5374('0x89'):if(_0x333664==='2'||_0x333664==='6'){return _0x2e09d4[_0x5374('0x2f')]({'read':!![]});}else{logger[_0x5374('0x20')](_0x5374('0xae'),_0x5374('0x26'),_0x5374('0x89'),util['inspect'](_0xd574e8['query'],{'showHidden':![],'depth':null}));};break;}return _0x2e09d4;}})[_0x5374('0x1b')](respondWithResult(_0x4de23b,null))['catch'](handleError(_0x4de23b,null));};exports[_0x5374('0xda')]=function(_0x1b02bc,_0x44e63b,_0x33d73d){return db[_0x5374('0x3b')][_0x5374('0x56')]({'where':{'id':_0x1b02bc[_0x5374('0x54')]['id']}})[_0x5374('0x1b')](handleEntityNotFound(_0x44e63b,null))['then'](function(_0x546c68){if(_0x546c68){return _0x546c68[_0x5374('0xda')](_0x1b02bc[_0x5374('0x58')][_0x5374('0x66')],_[_0x5374('0xdb')](_0x1b02bc[_0x5374('0x58')],[_0x5374('0x66'),'id'])||{})['spread'](function(_0x3b22a1){for(var _0x419e57=0x0;_0x419e57<_0x1b02bc[_0x5374('0x58')][_0x5374('0x66')]['length'];_0x419e57+=0x1){socket[_0x5374('0xdc')]('userSmsAccount:save',{'UserId':Number(_0x1b02bc[_0x5374('0x58')]['ids'][_0x419e57]),'SmsAccountId':Number(_0x1b02bc[_0x5374('0x54')]['id'])});}return _0x3b22a1;});}})[_0x5374('0x1b')](respondWithResult(_0x44e63b,null))[_0x5374('0x24')](handleError(_0x44e63b,null));};exports[_0x5374('0xdd')]=function(_0x517013,_0x2b6ab2,_0x2ed5ac){return db[_0x5374('0x3b')][_0x5374('0x56')]({'where':{'id':_0x517013[_0x5374('0x54')]['id']}})[_0x5374('0x1b')](handleEntityNotFound(_0x2b6ab2,null))[_0x5374('0x1b')](function(_0xac3736){if(_0xac3736){return _0xac3736[_0x5374('0xdd')](_0x517013[_0x5374('0x3f')][_0x5374('0x66')])[_0x5374('0x1b')](function(){if(_['isArray'](_0x517013[_0x5374('0x3f')][_0x5374('0x66')])){for(var _0x1a42de=0x0;_0x1a42de<_0x517013['query'][_0x5374('0x66')]['length'];_0x1a42de+=0x1){socket[_0x5374('0xdc')]('userSmsAccount:remove',{'UserId':Number(_0x517013['query']['ids'][_0x1a42de]),'SmsAccountId':Number(_0x517013[_0x5374('0x54')]['id'])});}}else{socket[_0x5374('0xdc')](_0x5374('0xde'),{'UserId':Number(_0x517013['query'][_0x5374('0x66')]),'SmsAccountId':Number(_0x517013[_0x5374('0x54')]['id'])});}});}})['then'](respondWithStatusCode(_0x2b6ab2,null))['catch'](handleError(_0x2b6ab2,null));};exports[_0x5374('0xdf')]=function(_0x341b3a,_0x48a5de,_0x5409a9){var _0x435a5e={};var _0x5bc63f={};var _0x5d8141;var _0x28ba4c;return db[_0x5374('0x3b')][_0x5374('0x64')]({'where':{'id':_0x341b3a['params']['id']}})['then'](handleEntityNotFound(_0x48a5de,null))[_0x5374('0x1b')](function(_0x32955b){if(_0x32955b){_0x5d8141=_0x32955b;_0x5bc63f[_0x5374('0x3e')]=_['keys'](db[_0x5374('0xa5')][_0x5374('0x3c')]);_0x5bc63f[_0x5374('0x3f')]=_[_0x5374('0x40')](_0x341b3a[_0x5374('0x3f')]);_0x5bc63f['filters']=_[_0x5374('0x42')](_0x5bc63f['model'],_0x5bc63f['query']);_0x435a5e[_0x5374('0x43')]=_[_0x5374('0x42')](_0x5bc63f[_0x5374('0x3e')],qs[_0x5374('0x44')](_0x341b3a[_0x5374('0x3f')][_0x5374('0x44')]));_0x435a5e[_0x5374('0x43')]=_0x435a5e[_0x5374('0x43')][_0x5374('0x45')]?_0x435a5e['attributes']:_0x5bc63f[_0x5374('0x3e')];_0x435a5e[_0x5374('0x48')]=qs[_0x5374('0x49')](_0x341b3a['query'][_0x5374('0x49')]);_0x435a5e[_0x5374('0x4c')]=qs[_0x5374('0x41')](_['pick'](_0x341b3a[_0x5374('0x3f')],_0x5bc63f[_0x5374('0x41')]));if(_0x341b3a['query'][_0x5374('0x4b')]){_0x435a5e[_0x5374('0x4c')]=_[_0x5374('0x4d')](_0x435a5e['where'],{'$or':_['map'](_0x435a5e[_0x5374('0x43')],function(_0x33a37c){var _0x42ac4b={};_0x42ac4b[_0x33a37c]={'$like':'%'+_0x341b3a[_0x5374('0x3f')]['filter']+'%'};return _0x42ac4b;})});}_0x435a5e=_[_0x5374('0x4d')]({},_0x435a5e,_0x341b3a['options']);return _0x5d8141['getAgents'](_0x435a5e);}})[_0x5374('0x1b')](function(_0x88563e){if(_0x88563e){_0x28ba4c=_0x88563e[_0x5374('0x45')];if(!_0x341b3a['query']['hasOwnProperty'](_0x5374('0x47'))){_0x435a5e[_0x5374('0x29')]=qs[_0x5374('0x29')](_0x341b3a[_0x5374('0x3f')][_0x5374('0x29')]);_0x435a5e[_0x5374('0x27')]=qs[_0x5374('0x27')](_0x341b3a['query'][_0x5374('0x27')]);}return _0x5d8141[_0x5374('0xdf')](_0x435a5e);}})[_0x5374('0x1b')](function(_0x1c2798){if(_0x1c2798){return _0x1c2798?{'count':_0x28ba4c,'rows':_0x1c2798}:null;}})[_0x5374('0x1b')](respondWithResult(_0x48a5de,null))[_0x5374('0x24')](handleError(_0x48a5de,null));}; \ No newline at end of file +var _0xb52d=['messageId','MessageSid','skebby','sender','connectel','message_id','plivo','Text','MessageUUID','infobip','results','text','originatingAddress','segmentedMessage','clickatell','fromNumber','replyMessageId','bandwidth','intelepeer','Sequelize','from\x20is\x20mandatory','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','DESC','list','omit','Contacts','contact','SmsInteraction','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','AttachmentId','UserId','User','unshift','waitForTheAssignedAgent','queueId','SmsQueue','queue','waitForTheAssignedQueue','Start','receiveMessage','debug','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','entity\x20found','text/xml','\x0a','addApplications','transaction','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','stack','finally','getApplications','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','color','tag','body\x20is\x20mandatory\x20and\x20not\x20empty','to\x20is\x20mandatory','List','user','out','SmsMessage','Messages','spread','dataValues','requestid','statusInt','clicksend','status_code','groupName','DELIVERED','redif','inspect','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','message-delivered','ACCEPTD','received\x20delivery\x20report\x20from','csc','message-id','state','addAgents','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','./smsAccount.socket','register','jayson/promise','client','request','then','info','SmsAccount,\x20%s,\x20%s','SmsAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','end','status','json','count','offset','set','apply','reject','update','destroy','get','SmsAccounts','UserProfileResource','name','send','index','map','SmsAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','where','filter','merge','VIRTUAL','includeAll','include','rows','show','params','Pause','mandatoryDispositionPause','options','role','UserProfileSection','find','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','getDispositions','findOne','Disposition','sort','SmsAccountId','findAll','removeDispositions','addAnswer','CannedAnswer','pick','removeAnswers','ids','notify','sms','SmsApplication','Applications','applications','orderBy','priority','asc','account','CmContact','ValidationError','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId','ListId','mobile','twilio','from','Body'];(function(_0x3943fd,_0x1a2ea9){var _0x513499=function(_0x3d5f57){while(--_0x3d5f57){_0x3943fd['push'](_0x3943fd['shift']());}};_0x513499(++_0x1a2ea9);}(_0xb52d,0x6b));var _0xdb52=function(_0x15bc81,_0x4d4f77){_0x15bc81=_0x15bc81-0x0;var _0x59440e=_0xb52d[_0x15bc81];return _0x59440e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdb52('0x0'));var zipdir=require(_0xdb52('0x1'));var jsonpatch=require(_0xdb52('0x2'));var rp=require('request-promise');var moment=require(_0xdb52('0x3'));var BPromise=require(_0xdb52('0x4'));var Mustache=require(_0xdb52('0x5'));var util=require(_0xdb52('0x6'));var path=require(_0xdb52('0x7'));var sox=require(_0xdb52('0x8'));var csv=require(_0xdb52('0x9'));var ejs=require(_0xdb52('0xa'));var fs=require('fs');var fs_extra=require(_0xdb52('0xb'));var _=require(_0xdb52('0xc'));var squel=require(_0xdb52('0xd'));var crypto=require('crypto');var jsforce=require(_0xdb52('0xe'));var deskjs=require(_0xdb52('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xdb52('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdb52('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0xdb52('0x12'));var config=require(_0xdb52('0x13'));var licenseUtil=require(_0xdb52('0x14'));var db=require(_0xdb52('0x15'))['db'];config['redis']=_[_0xdb52('0x16')](config[_0xdb52('0x17')],{'host':_0xdb52('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xdb52('0x17')]));require(_0xdb52('0x19'))[_0xdb52('0x1a')](socket);var jayson=require(_0xdb52('0x1b'));var client=jayson[_0xdb52('0x1c')]['http']({'port':0x232c});function respondWithRpcPromise(_0x179a57,_0x452fd0,_0x7d5016,_0x34aff2){return new BPromise(function(_0x36c8ad,_0x54123d){var _0x2abc42=_0x34aff2||client;return _0x2abc42[_0xdb52('0x1d')](_0x179a57,_0x7d5016)[_0xdb52('0x1e')](function(_0x45bd0e){logger[_0xdb52('0x1f')](_0xdb52('0x20'),_0x452fd0,'request\x20sent');logger['debug'](_0xdb52('0x21'),_0x452fd0,_0xdb52('0x22'),JSON[_0xdb52('0x23')](_0x45bd0e));if(_0x45bd0e['error']){if(_0x45bd0e[_0xdb52('0x24')][_0xdb52('0x25')]===0x1f4){logger[_0xdb52('0x24')]('SmsAccount,\x20%s,\x20%s',_0x452fd0,_0x45bd0e[_0xdb52('0x24')][_0xdb52('0x26')]);return _0x54123d(_0x45bd0e['error'][_0xdb52('0x26')]);}logger[_0xdb52('0x24')](_0xdb52('0x20'),_0x452fd0,_0x45bd0e[_0xdb52('0x24')][_0xdb52('0x26')]);return _0x36c8ad(_0x45bd0e[_0xdb52('0x24')][_0xdb52('0x26')]);}else{logger['info'](_0xdb52('0x20'),_0x452fd0,_0xdb52('0x22'));_0x36c8ad(_0x45bd0e[_0xdb52('0x27')][_0xdb52('0x26')]);}})[_0xdb52('0x28')](function(_0x442a65){logger[_0xdb52('0x24')]('SmsAccount,\x20%s,\x20%s',_0x452fd0,_0x442a65);_0x54123d(_0x442a65);});});}function respondWithStatusCode(_0x5e7b48,_0x5209f0){_0x5209f0=_0x5209f0||0xcc;return function(_0x14710c){if(_0x14710c){return _0x5e7b48[_0xdb52('0x29')](_0x5209f0);}return _0x5e7b48['status'](_0x5209f0)[_0xdb52('0x2a')]();};}function respondWithResult(_0x1d2f55,_0x40847f){_0x40847f=_0x40847f||0xc8;return function(_0x397571){if(_0x397571){return _0x1d2f55[_0xdb52('0x2b')](_0x40847f)[_0xdb52('0x2c')](_0x397571);}};}function respondWithFilteredResult(_0x250d54,_0x56598a){return function(_0x5e8533){if(_0x5e8533){var _0x3a216f=typeof _0x56598a['offset']==='undefined'&&typeof _0x56598a['limit']==='undefined';var _0x341e5c=_0x5e8533[_0xdb52('0x2d')];var _0x2b7de3=_0x3a216f?0x0:_0x56598a[_0xdb52('0x2e')];var _0x10da48=_0x3a216f?_0x5e8533[_0xdb52('0x2d')]:_0x56598a[_0xdb52('0x2e')]+_0x56598a['limit'];var _0x2f7314;if(_0x10da48>=_0x341e5c){_0x10da48=_0x341e5c;_0x2f7314=0xc8;}else{_0x2f7314=0xce;}_0x250d54[_0xdb52('0x2b')](_0x2f7314);return _0x250d54[_0xdb52('0x2f')]('Content-Range',_0x2b7de3+'-'+_0x10da48+'/'+_0x341e5c)[_0xdb52('0x2c')](_0x5e8533);}return null;};}function patchUpdates(_0x2b7f47){return function(_0x1b9daf){try{jsonpatch[_0xdb52('0x30')](_0x1b9daf,_0x2b7f47,!![]);}catch(_0x4cf5af){return BPromise[_0xdb52('0x31')](_0x4cf5af);}return _0x1b9daf['save']();};}function saveUpdates(_0x42ad67,_0x5213c9){return function(_0x490bf1){if(_0x490bf1){return _0x490bf1[_0xdb52('0x32')](_0x42ad67)[_0xdb52('0x1e')](function(_0x5142dd){return _0x5142dd;});}return null;};}function removeEntity(_0x5b99ed,_0x3f9294){return function(_0x5cf72e){if(_0x5cf72e){return _0x5cf72e[_0xdb52('0x33')]()['then'](function(){var _0x18b994=_0x5cf72e[_0xdb52('0x34')]({'plain':!![]});var _0x63def6=_0xdb52('0x35');return db[_0xdb52('0x36')]['destroy']({'where':{'type':_0x63def6,'resourceId':_0x18b994['id']}})[_0xdb52('0x1e')](function(){return _0x5cf72e;});})[_0xdb52('0x1e')](function(){_0x5b99ed['status'](0xcc)[_0xdb52('0x2a')]();});}};}function handleEntityNotFound(_0x58f114,_0x50e97c){return function(_0x3fa60d){if(!_0x3fa60d){_0x58f114[_0xdb52('0x29')](0x194);}return _0x3fa60d;};}function handleError(_0x47c554,_0xed3e26){_0xed3e26=_0xed3e26||0x1f4;return function(_0xb3e075){logger[_0xdb52('0x24')](_0xb3e075['stack']);if(_0xb3e075[_0xdb52('0x37')]){delete _0xb3e075[_0xdb52('0x37')];}_0x47c554['status'](_0xed3e26)[_0xdb52('0x38')](_0xb3e075);};}exports[_0xdb52('0x39')]=function(_0x35640d,_0x4d599f){var _0x2a942d={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x4e7f30={},_0x30c765={'count':0x0,'rows':[]};var _0x5d79d6=_[_0xdb52('0x3a')](db[_0xdb52('0x3b')][_0xdb52('0x3c')],function(_0x9255cd){return{'name':_0x9255cd[_0xdb52('0x3d')],'type':_0x9255cd[_0xdb52('0x3e')][_0xdb52('0x3f')]};});_0x4e7f30[_0xdb52('0x40')]=_[_0xdb52('0x3a')](_0x5d79d6,_0xdb52('0x37'));_0x4e7f30[_0xdb52('0x41')]=_[_0xdb52('0x42')](_0x35640d['query']);_0x4e7f30[_0xdb52('0x43')]=_[_0xdb52('0x44')](_0x4e7f30[_0xdb52('0x40')],_0x4e7f30['query']);_0x2a942d[_0xdb52('0x45')]=_[_0xdb52('0x44')](_0x4e7f30['model'],qs['fields'](_0x35640d['query'][_0xdb52('0x46')]));_0x2a942d[_0xdb52('0x45')]=_0x2a942d[_0xdb52('0x45')][_0xdb52('0x47')]?_0x2a942d[_0xdb52('0x45')]:_0x4e7f30[_0xdb52('0x40')];if(!_0x35640d[_0xdb52('0x41')][_0xdb52('0x48')](_0xdb52('0x49'))){_0x2a942d[_0xdb52('0x4a')]=qs['limit'](_0x35640d[_0xdb52('0x41')][_0xdb52('0x4a')]);_0x2a942d[_0xdb52('0x2e')]=qs['offset'](_0x35640d['query']['offset']);}_0x2a942d[_0xdb52('0x4b')]=qs['sort'](_0x35640d[_0xdb52('0x41')]['sort']);_0x2a942d[_0xdb52('0x4c')]=qs[_0xdb52('0x43')](_['pick'](_0x35640d['query'],_0x4e7f30['filters']),_0x5d79d6);if(_0x35640d[_0xdb52('0x41')][_0xdb52('0x4d')]){_0x2a942d['where']=_[_0xdb52('0x4e')](_0x2a942d['where'],{'$or':_[_0xdb52('0x3a')](_0x5d79d6,function(_0x56e9a7){if(_0x56e9a7['type']!==_0xdb52('0x4f')){var _0x1af302={};_0x1af302[_0x56e9a7[_0xdb52('0x37')]]={'$like':'%'+_0x35640d[_0xdb52('0x41')][_0xdb52('0x4d')]+'%'};return _0x1af302;}})});}_0x2a942d=_[_0xdb52('0x4e')]({},_0x2a942d,_0x35640d['options']);var _0x1e2088={'where':_0x2a942d[_0xdb52('0x4c')]};return db[_0xdb52('0x3b')]['count'](_0x1e2088)['then'](function(_0x4f738e){_0x30c765[_0xdb52('0x2d')]=_0x4f738e;if(_0x35640d[_0xdb52('0x41')][_0xdb52('0x50')]){_0x2a942d[_0xdb52('0x51')]=[{'all':!![]}];}return db[_0xdb52('0x3b')]['findAll'](_0x2a942d);})[_0xdb52('0x1e')](function(_0x3514b9){_0x30c765[_0xdb52('0x52')]=_0x3514b9;return _0x30c765;})[_0xdb52('0x1e')](respondWithFilteredResult(_0x4d599f,_0x2a942d))[_0xdb52('0x28')](handleError(_0x4d599f,null));};exports[_0xdb52('0x53')]=function(_0x32edce,_0x326d7b){var _0x489889={'raw':![],'where':{'id':_0x32edce[_0xdb52('0x54')]['id']},'include':[{'model':db[_0xdb52('0x55')],'as':_0xdb52('0x56')}]},_0x27a502={};_0x27a502['model']=_['keys'](db['SmsAccount'][_0xdb52('0x3c')]);_0x27a502[_0xdb52('0x41')]=_[_0xdb52('0x42')](_0x32edce[_0xdb52('0x41')]);_0x27a502['filters']=_[_0xdb52('0x44')](_0x27a502[_0xdb52('0x40')],_0x27a502['query']);_0x489889[_0xdb52('0x45')]=_['intersection'](_0x27a502[_0xdb52('0x40')],qs[_0xdb52('0x46')](_0x32edce[_0xdb52('0x41')][_0xdb52('0x46')]));_0x489889[_0xdb52('0x45')]=_0x489889[_0xdb52('0x45')]['length']?_0x489889[_0xdb52('0x45')]:_0x27a502[_0xdb52('0x40')];if(_0x32edce['query'][_0xdb52('0x50')]){_0x489889['include']=[{'all':!![]}];}_0x489889=_[_0xdb52('0x4e')]({},_0x489889,_0x32edce[_0xdb52('0x57')]);return db[_0xdb52('0x3b')]['find'](_0x489889)[_0xdb52('0x1e')](handleEntityNotFound(_0x326d7b,null))[_0xdb52('0x1e')](respondWithResult(_0x326d7b,null))[_0xdb52('0x28')](handleError(_0x326d7b,null));};exports['create']=function(_0x5161cf,_0x5a4b9b){return db[_0xdb52('0x3b')]['create'](_0x5161cf['body'],{})[_0xdb52('0x1e')](function(_0x10025b){var _0x43f410=_0x5161cf['user']['get']({'plain':!![]});if(!_0x43f410)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x43f410[_0xdb52('0x58')]==='user'){var _0x2fe676=_0x10025b[_0xdb52('0x34')]({'plain':!![]});var _0x25cfe5=_0xdb52('0x35');return db[_0xdb52('0x59')][_0xdb52('0x5a')]({'where':{'name':_0x25cfe5,'userProfileId':_0x43f410[_0xdb52('0x5b')]},'raw':!![]})[_0xdb52('0x1e')](function(_0x1a57e1){if(_0x1a57e1&&_0x1a57e1[_0xdb52('0x5c')]===0x0){return db['UserProfileResource'][_0xdb52('0x5d')]({'name':_0x2fe676[_0xdb52('0x37')],'resourceId':_0x2fe676['id'],'type':_0x1a57e1[_0xdb52('0x37')],'sectionId':_0x1a57e1['id']},{})['then'](function(){return _0x10025b;});}else{return _0x10025b;}})[_0xdb52('0x28')](function(_0x139686){logger[_0xdb52('0x24')](_0xdb52('0x5e'),_0x139686);throw _0x139686;});}return _0x10025b;})[_0xdb52('0x1e')](respondWithResult(_0x5a4b9b,0xc9))[_0xdb52('0x28')](handleError(_0x5a4b9b,null));};exports['update']=function(_0x4d4aab,_0xe65c9d){if(_0x4d4aab[_0xdb52('0x5f')]['id']){delete _0x4d4aab[_0xdb52('0x5f')]['id'];}return db[_0xdb52('0x3b')][_0xdb52('0x5a')]({'where':{'id':_0x4d4aab[_0xdb52('0x54')]['id']},'include':[{'model':db['Pause'],'as':_0xdb52('0x56')}]})[_0xdb52('0x1e')](handleEntityNotFound(_0xe65c9d,null))[_0xdb52('0x1e')](saveUpdates(_0x4d4aab[_0xdb52('0x5f')],null))[_0xdb52('0x1e')](respondWithResult(_0xe65c9d,null))[_0xdb52('0x28')](handleError(_0xe65c9d,null));};exports[_0xdb52('0x33')]=function(_0x134325,_0xd9ed42){return db[_0xdb52('0x3b')]['find']({'where':{'id':_0x134325[_0xdb52('0x54')]['id']}})[_0xdb52('0x1e')](handleEntityNotFound(_0xd9ed42,null))[_0xdb52('0x1e')](removeEntity(_0xd9ed42,null))[_0xdb52('0x28')](handleError(_0xd9ed42,null));};exports[_0xdb52('0x60')]=function(_0x3a2c13,_0x318d44){return db[_0xdb52('0x3b')][_0xdb52('0x60')]()[_0xdb52('0x1e')](respondWithResult(_0x318d44,null))[_0xdb52('0x28')](handleError(_0x318d44,null));};exports[_0xdb52('0x61')]=function(_0x2b0721,_0x807f02,_0x3cdfef){if(_0x2b0721['body']['id']){delete _0x2b0721[_0xdb52('0x5f')]['id'];}return db[_0xdb52('0x3b')][_0xdb52('0x5a')]({'where':{'id':_0x2b0721[_0xdb52('0x54')]['id']}})[_0xdb52('0x1e')](handleEntityNotFound(_0x807f02,null))['then'](function(_0x58f34f){if(_0x58f34f){_0x2b0721[_0xdb52('0x5f')]['SmsAccountId']=_0x58f34f['id'];return db['Disposition'][_0xdb52('0x5d')](_0x2b0721['body']);}})[_0xdb52('0x1e')](respondWithResult(_0x807f02,null))[_0xdb52('0x28')](handleError(_0x807f02,null));};exports[_0xdb52('0x62')]=function(_0x65b50d,_0x9919cd,_0x1e8e78){var _0xa7c678={'raw':![],'where':{}};var _0xd16bef={};var _0x523089={'count':0x0,'rows':[]};return db['SmsAccount'][_0xdb52('0x63')]({'where':{'id':_0x65b50d[_0xdb52('0x54')]['id']}})['then'](handleEntityNotFound(_0x9919cd,null))[_0xdb52('0x1e')](function(_0x46db4d){if(_0x46db4d){_0xd16bef[_0xdb52('0x40')]=_[_0xdb52('0x42')](db[_0xdb52('0x64')][_0xdb52('0x3c')]);_0xd16bef[_0xdb52('0x41')]=_['keys'](_0x65b50d[_0xdb52('0x41')]);_0xd16bef[_0xdb52('0x43')]=_[_0xdb52('0x44')](_0xd16bef['model'],_0xd16bef[_0xdb52('0x41')]);_0xa7c678['attributes']=_[_0xdb52('0x44')](_0xd16bef['model'],qs[_0xdb52('0x46')](_0x65b50d[_0xdb52('0x41')]['fields']));_0xa7c678[_0xdb52('0x45')]=_0xa7c678[_0xdb52('0x45')][_0xdb52('0x47')]?_0xa7c678[_0xdb52('0x45')]:_0xd16bef[_0xdb52('0x40')];if(!_0x65b50d['query'][_0xdb52('0x48')](_0xdb52('0x49'))){_0xa7c678['limit']=qs[_0xdb52('0x4a')](_0x65b50d[_0xdb52('0x41')][_0xdb52('0x4a')]);_0xa7c678[_0xdb52('0x2e')]=qs[_0xdb52('0x2e')](_0x65b50d[_0xdb52('0x41')]['offset']);}_0xa7c678[_0xdb52('0x4b')]=qs[_0xdb52('0x65')](_0x65b50d[_0xdb52('0x41')][_0xdb52('0x65')]);_0xa7c678[_0xdb52('0x4c')]=qs['filters'](_['pick'](_0x65b50d[_0xdb52('0x41')],_0xd16bef[_0xdb52('0x43')]));_0xa7c678[_0xdb52('0x4c')][_0xdb52('0x66')]=_0x46db4d['id'];if(_0x65b50d[_0xdb52('0x41')]['filter']){_0xa7c678['where']=_[_0xdb52('0x4e')](_0xa7c678[_0xdb52('0x4c')],{'$or':_[_0xdb52('0x3a')](_0xa7c678[_0xdb52('0x45')],function(_0x7bcdc7){var _0x4c7b66={};_0x4c7b66[_0x7bcdc7]={'$like':'%'+_0x65b50d[_0xdb52('0x41')][_0xdb52('0x4d')]+'%'};return _0x4c7b66;})});}_0xa7c678=_[_0xdb52('0x4e')]({},_0xa7c678,_0x65b50d[_0xdb52('0x57')]);return db[_0xdb52('0x64')]['count']({'where':_0xa7c678[_0xdb52('0x4c')]})[_0xdb52('0x1e')](function(_0x8dd5f){_0x523089['count']=_0x8dd5f;if(_0x65b50d[_0xdb52('0x41')][_0xdb52('0x50')]){_0xa7c678[_0xdb52('0x51')]=[{'all':!![]}];}return db['Disposition'][_0xdb52('0x67')](_0xa7c678);})[_0xdb52('0x1e')](function(_0x26a1dd){_0x523089[_0xdb52('0x52')]=_0x26a1dd;return _0x523089;});}})['then'](respondWithFilteredResult(_0x9919cd,_0xa7c678))[_0xdb52('0x28')](handleError(_0x9919cd,null));};exports[_0xdb52('0x68')]=function(_0x82d814,_0x1d70d6,_0x53d4e7){return db['SmsAccount'][_0xdb52('0x5a')]({'where':{'id':_0x82d814['params']['id']}})[_0xdb52('0x1e')](handleEntityNotFound(_0x1d70d6,null))[_0xdb52('0x1e')](function(_0x96d0fc){if(_0x96d0fc){return _0x96d0fc[_0xdb52('0x68')](_0x82d814['query']['ids']);}})['then'](respondWithStatusCode(_0x1d70d6,null))['catch'](handleError(_0x1d70d6,null));};exports[_0xdb52('0x69')]=function(_0x3f03b7,_0x1a0558,_0x26ffd6){if(_0x3f03b7[_0xdb52('0x5f')]['id']){delete _0x3f03b7[_0xdb52('0x5f')]['id'];}return db[_0xdb52('0x3b')]['find']({'where':{'id':_0x3f03b7[_0xdb52('0x54')]['id']}})[_0xdb52('0x1e')](handleEntityNotFound(_0x1a0558,null))[_0xdb52('0x1e')](function(_0x3ca491){if(_0x3ca491){_0x3f03b7['body'][_0xdb52('0x66')]=_0x3ca491['id'];return db['CannedAnswer']['create'](_0x3f03b7['body']);}})['then'](respondWithResult(_0x1a0558,null))['catch'](handleError(_0x1a0558,null));};exports['getAnswers']=function(_0x4c08b5,_0x40f818,_0x239c2f){var _0xd1684a={'raw':![],'where':{}};var _0x22cc06={};var _0x3727ac={'count':0x0,'rows':[]};return db[_0xdb52('0x3b')]['findOne']({'where':{'id':_0x4c08b5['params']['id']}})[_0xdb52('0x1e')](handleEntityNotFound(_0x40f818,null))['then'](function(_0x5d7fcb){if(_0x5d7fcb){_0x22cc06[_0xdb52('0x40')]=_[_0xdb52('0x42')](db[_0xdb52('0x6a')]['rawAttributes']);_0x22cc06[_0xdb52('0x41')]=_['keys'](_0x4c08b5['query']);_0x22cc06['filters']=_[_0xdb52('0x44')](_0x22cc06[_0xdb52('0x40')],_0x22cc06[_0xdb52('0x41')]);_0xd1684a[_0xdb52('0x45')]=_[_0xdb52('0x44')](_0x22cc06[_0xdb52('0x40')],qs[_0xdb52('0x46')](_0x4c08b5['query'][_0xdb52('0x46')]));_0xd1684a['attributes']=_0xd1684a[_0xdb52('0x45')][_0xdb52('0x47')]?_0xd1684a['attributes']:_0x22cc06['model'];if(!_0x4c08b5[_0xdb52('0x41')][_0xdb52('0x48')](_0xdb52('0x49'))){_0xd1684a[_0xdb52('0x4a')]=qs[_0xdb52('0x4a')](_0x4c08b5[_0xdb52('0x41')][_0xdb52('0x4a')]);_0xd1684a['offset']=qs[_0xdb52('0x2e')](_0x4c08b5[_0xdb52('0x41')]['offset']);}_0xd1684a[_0xdb52('0x4b')]=qs[_0xdb52('0x65')](_0x4c08b5[_0xdb52('0x41')][_0xdb52('0x65')]);_0xd1684a[_0xdb52('0x4c')]=qs[_0xdb52('0x43')](_[_0xdb52('0x6b')](_0x4c08b5['query'],_0x22cc06[_0xdb52('0x43')]));_0xd1684a[_0xdb52('0x4c')][_0xdb52('0x66')]=_0x5d7fcb['id'];if(_0x4c08b5[_0xdb52('0x41')]['filter']){_0xd1684a[_0xdb52('0x4c')]=_[_0xdb52('0x4e')](_0xd1684a[_0xdb52('0x4c')],{'$or':_[_0xdb52('0x3a')](_0xd1684a[_0xdb52('0x45')],function(_0x4160f5){var _0x593bfa={};_0x593bfa[_0x4160f5]={'$like':'%'+_0x4c08b5[_0xdb52('0x41')]['filter']+'%'};return _0x593bfa;})});}_0xd1684a=_[_0xdb52('0x4e')]({},_0xd1684a,_0x4c08b5['options']);return db['CannedAnswer'][_0xdb52('0x2d')]({'where':_0xd1684a[_0xdb52('0x4c')]})[_0xdb52('0x1e')](function(_0x33c038){_0x3727ac[_0xdb52('0x2d')]=_0x33c038;if(_0x4c08b5[_0xdb52('0x41')][_0xdb52('0x50')]){_0xd1684a[_0xdb52('0x51')]=[{'all':!![]}];}return db[_0xdb52('0x6a')][_0xdb52('0x67')](_0xd1684a);})[_0xdb52('0x1e')](function(_0x48887d){_0x3727ac['rows']=_0x48887d;return _0x3727ac;});}})[_0xdb52('0x1e')](respondWithFilteredResult(_0x40f818,_0xd1684a))[_0xdb52('0x28')](handleError(_0x40f818,null));};exports[_0xdb52('0x6c')]=function(_0x1fdea4,_0x4c1fe8,_0x32e9cf){return db[_0xdb52('0x3b')][_0xdb52('0x5a')]({'where':{'id':_0x1fdea4[_0xdb52('0x54')]['id']}})[_0xdb52('0x1e')](handleEntityNotFound(_0x4c1fe8,null))[_0xdb52('0x1e')](function(_0x3afebe){if(_0x3afebe){return _0x3afebe['removeAnswers'](_0x1fdea4['query'][_0xdb52('0x6d')]);}})['then'](respondWithStatusCode(_0x4c1fe8,null))[_0xdb52('0x28')](handleError(_0x4c1fe8,null));};exports[_0xdb52('0x6e')]=function(_0x5b535a,_0x631f0b,_0x1283f6){var _0x8ad938={'channel':_0xdb52('0x6f')};var _0x3f7d99=[];var _0x555f14=[];var _0x2b726d={};return db[_0xdb52('0x3b')][_0xdb52('0x5a')]({'where':{'id':_0x5b535a['params']['id']},'include':[{'model':db[_0xdb52('0x70')],'as':_0xdb52('0x71')}]})[_0xdb52('0x1e')](handleEntityNotFound(_0x631f0b,null))[_0xdb52('0x1e')](function(_0x2cb904){_0x8ad938['account']=_0x2cb904;_0x8ad938[_0xdb52('0x72')]=_[_0xdb52('0x73')](_0x2cb904[_0xdb52('0x71')],[_0xdb52('0x74')],[_0xdb52('0x75')]);if(_0x8ad938[_0xdb52('0x76')][_0xdb52('0x71')]){delete _0x8ad938['account']['Applications'];}return db[_0xdb52('0x77')][_0xdb52('0x60')]();})[_0xdb52('0x1e')](function(_0x55b9cd){if(!_0x55b9cd){throw new db['Sequelize'][(_0xdb52('0x78'))](_0xdb52('0x79'));}_0x3f7d99=_[_0xdb52('0x7a')](_[_0xdb52('0x42')](_0x55b9cd),['createdAt',_0xdb52('0x7b')]);_0x555f14=_[_0xdb52('0x7a')](_['keys'](_0x55b9cd),[_0xdb52('0x7c'),_0xdb52('0x7b'),_0xdb52('0x7d'),_0xdb52('0x7e')]);_0x8ad938[_0xdb52('0x5f')]={'mapKey':_0xdb52('0x7f')};if(_0x8ad938['account']['type']){switch(_0x8ad938[_0xdb52('0x76')][_0xdb52('0x3e')]){case _0xdb52('0x80'):_0x8ad938['body'][_0xdb52('0x81')]=_0x5b535a['body']['From'];_0x8ad938[_0xdb52('0x5f')][_0xdb52('0x5f')]=_0x5b535a[_0xdb52('0x5f')][_0xdb52('0x82')];_0x8ad938[_0xdb52('0x5f')][_0xdb52('0x83')]=_0x5b535a[_0xdb52('0x5f')][_0xdb52('0x84')];break;case _0xdb52('0x85'):_0x8ad938[_0xdb52('0x5f')][_0xdb52('0x81')]='+'+_0x5b535a[_0xdb52('0x5f')][_0xdb52('0x86')];_0x8ad938[_0xdb52('0x5f')][_0xdb52('0x5f')]=_0x5b535a[_0xdb52('0x5f')]['text'];break;case _0xdb52('0x87'):_0x8ad938['body'][_0xdb52('0x81')]=_0x5b535a[_0xdb52('0x5f')][_0xdb52('0x81')];_0x8ad938[_0xdb52('0x5f')][_0xdb52('0x5f')]=_0x5b535a[_0xdb52('0x5f')][_0xdb52('0x26')];break;case'clicksend':_0x8ad938[_0xdb52('0x5f')][_0xdb52('0x81')]=_0x5b535a['body'][_0xdb52('0x81')];_0x8ad938['body'][_0xdb52('0x5f')]=_0x5b535a[_0xdb52('0x5f')][_0xdb52('0x5f')];_0x8ad938[_0xdb52('0x5f')][_0xdb52('0x83')]=_0x5b535a['body'][_0xdb52('0x88')];break;case _0xdb52('0x89'):_0x8ad938[_0xdb52('0x5f')][_0xdb52('0x81')]=_0x5b535a[_0xdb52('0x5f')]['From'];_0x8ad938[_0xdb52('0x5f')][_0xdb52('0x5f')]=_0x5b535a['body'][_0xdb52('0x8a')];_0x8ad938[_0xdb52('0x5f')][_0xdb52('0x83')]=_0x5b535a[_0xdb52('0x5f')][_0xdb52('0x8b')];break;case _0xdb52('0x8c'):_0x8ad938[_0xdb52('0x5f')][_0xdb52('0x81')]='+'+_0x5b535a[_0xdb52('0x5f')][_0xdb52('0x8d')][0x0][_0xdb52('0x81')];_0x8ad938[_0xdb52('0x5f')][_0xdb52('0x5f')]=_0x5b535a[_0xdb52('0x5f')][_0xdb52('0x8d')][0x0][_0xdb52('0x8e')];_0x8ad938['body'][_0xdb52('0x83')]=_0x5b535a[_0xdb52('0x5f')][_0xdb52('0x8d')][0x0]['messageId'];break;case'csc':_0x8ad938[_0xdb52('0x5f')]['from']=_0x5b535a['body'][_0xdb52('0x8f')];_0x8ad938['body'][_0xdb52('0x5f')]=_0x5b535a[_0xdb52('0x5f')][_0xdb52('0x90')][_0xdb52('0x26')];break;case _0xdb52('0x91'):_0x8ad938[_0xdb52('0x5f')][_0xdb52('0x81')]=_0x5b535a[_0xdb52('0x5f')][_0xdb52('0x92')];_0x8ad938[_0xdb52('0x5f')][_0xdb52('0x5f')]=_0x5b535a['body'][_0xdb52('0x8e')];_0x8ad938[_0xdb52('0x5f')][_0xdb52('0x83')]=_0x5b535a[_0xdb52('0x5f')][_0xdb52('0x93')];break;case _0xdb52('0x94'):_0x8ad938[_0xdb52('0x5f')][_0xdb52('0x83')]=_0x5b535a['body'][0x0][_0xdb52('0x26')]['id'];_0x8ad938[_0xdb52('0x5f')][_0xdb52('0x81')]=_0x5b535a[_0xdb52('0x5f')][0x0][_0xdb52('0x26')]['from'];_0x8ad938[_0xdb52('0x5f')][_0xdb52('0x5f')]=_0x5b535a[_0xdb52('0x5f')][0x0][_0xdb52('0x26')][_0xdb52('0x8e')];break;case _0xdb52('0x95'):_0x8ad938['body'][_0xdb52('0x81')]=_0x5b535a[_0xdb52('0x5f')][_0xdb52('0x81')];_0x8ad938[_0xdb52('0x5f')][_0xdb52('0x5f')]=_0x5b535a[_0xdb52('0x5f')][_0xdb52('0x26')];_0x8ad938[_0xdb52('0x5f')][_0xdb52('0x83')]=_0x5b535a['body']['refid'];break;}}if(_0x8ad938[_0xdb52('0x5f')]['id']){delete _0x8ad938[_0xdb52('0x5f')]['id'];}if(_['isNil'](_0x8ad938['body']['from'])){throw new db[(_0xdb52('0x96'))]['ValidationError'](_0xdb52('0x97'));}if(_[_0xdb52('0x98')](_0x8ad938['body'][_0xdb52('0x5f')])||_0x8ad938[_0xdb52('0x5f')][_0xdb52('0x5f')]===''){throw new db['Sequelize'][(_0xdb52('0x78'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xdb52('0x98')](_0x8ad938['body'][_0xdb52('0x99')])){throw new db[(_0xdb52('0x96'))]['ValidationError'](_0xdb52('0x9a')+_0x555f14);}if(!_[_0xdb52('0x9b')](_0x555f14,_0x8ad938['body'][_0xdb52('0x99')])){throw new db['Sequelize'][(_0xdb52('0x78'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x555f14);}_0x2b726d[_0x8ad938[_0xdb52('0x5f')][_0xdb52('0x99')]]=_0x8ad938[_0xdb52('0x5f')]['from'];return db[_0xdb52('0x9c')][_0xdb52('0x5a')]({'where':{'id':_0x8ad938['account'][_0xdb52('0x7e')]},'include':[{'model':db[_0xdb52('0x77')],'as':'Contacts','where':_0x2b726d,'limit':0x1,'order':[[_0xdb52('0x7b'),_0xdb52('0x9d')]]}]});})[_0xdb52('0x1e')](handleEntityNotFound(_0x631f0b,null))[_0xdb52('0x1e')](function(_0x3e205f){if(_0x3e205f){_0x8ad938[_0xdb52('0x9e')]=_[_0xdb52('0x9f')](_0x3e205f,[_0xdb52('0xa0')]);if(_0x3e205f['Contacts']['length']){return _0x3e205f[_0xdb52('0xa0')][0x0];}var _0x291fd3=_['defaults'](_0x8ad938['body'],{'firstName':_0x8ad938['body']['from'],'ListId':_0x3e205f['id']});_0x291fd3[_0x8ad938[_0xdb52('0x5f')][_0xdb52('0x99')]]=_0x8ad938[_0xdb52('0x5f')]['from'];return db[_0xdb52('0x77')][_0xdb52('0x5d')](_0x291fd3,{'fields':_0x3f7d99,'raw':!![]});}})[_0xdb52('0x1e')](handleEntityNotFound(_0x631f0b,null))[_0xdb52('0x1e')](function(_0x23913f){if(_0x23913f){_0x8ad938[_0xdb52('0xa1')]=_0x23913f;var _0x807b4d={'ContactId':_0x23913f['id'],'phone':_0x8ad938[_0xdb52('0x5f')]['from'],'SmsAccountId':_0x5b535a['params']['id']};var _0x2a3b97={'ContactId':_0x23913f['id'],'SmsAccountId':_0x5b535a['params']['id'],'closed':![]};return db[_0xdb52('0xa2')][_0xdb52('0x5a')]({'where':_0x2a3b97})[_0xdb52('0x1e')](function(_0x8a6af){if(_0x8a6af){return[_0x8a6af,![]];}return db[_0xdb52('0xa2')][_0xdb52('0x5d')](_0x807b4d)[_0xdb52('0x1e')](function(_0x498e63){return[_0x498e63,!![]];});});}})['spread'](function(_0x493ffc,_0x8f0075){_0x8ad938['interaction']=_0x493ffc[_0xdb52('0x34')]({'plain':!![]});_0x8ad938[_0xdb52('0xa3')][_0xdb52('0xa4')]=![];if(_0x8f0075){if(_0x8ad938[_0xdb52('0x76')][_0xdb52('0xa5')]){_0x8ad938[_0xdb52('0x72')][_0xdb52('0xa6')]({'id':0x0,'priority':_0x8ad938['applications'][_0xdb52('0x47')]+0x1,'app':_0xdb52('0xa7'),'appdata':_0xdb52('0xa8'),'interval':_0xdb52('0xa9')});}_0x8ad938[_0xdb52('0xa3')][_0xdb52('0xa4')]=!![];}return db['SmsMessage'][_0xdb52('0x5d')]({'phone':_0x8ad938[_0xdb52('0x5f')][_0xdb52('0x81')],'messageId':_0x8ad938[_0xdb52('0x5f')]['messageId'],'body':_0x8ad938[_0xdb52('0x5f')][_0xdb52('0x5f')],'SmsAccountId':_0x5b535a['params']['id'],'SmsInteractionId':_0x493ffc['id'],'direction':'in','ContactId':_0x493ffc['ContactId'],'AttachmentId':_0x8ad938[_0xdb52('0x5f')][_0xdb52('0xaa')]});})[_0xdb52('0x1e')](function(_0x3b89c2){_0x8ad938[_0xdb52('0x26')]=_0x3b89c2;if(!_0x8ad938['interaction'][_0xdb52('0xab')])return;return db[_0xdb52('0xac')][_0xdb52('0x5a')]({'attributes':['id',_0xdb52('0x37')],'where':{'id':_0x8ad938[_0xdb52('0xa3')][_0xdb52('0xab')]}});})[_0xdb52('0x1e')](function(_0x50372f){if(_0x50372f){_0x8ad938[_0xdb52('0x72')][_0xdb52('0xad')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x50372f[_0xdb52('0x37')]+','+(_0x8ad938['account'][_0xdb52('0xae')]||0xa),'interval':_0xdb52('0xa9')});}if(!_0x8ad938[_0xdb52('0xa3')][_0xdb52('0xaf')])return;return db[_0xdb52('0xb0')][_0xdb52('0x5a')]({'attributes':['id',_0xdb52('0x37')],'where':{'id':_0x8ad938[_0xdb52('0xa3')][_0xdb52('0xaf')]}});})[_0xdb52('0x1e')](function(_0x481b2f){if(_0x481b2f){_0x8ad938[_0xdb52('0x72')][_0xdb52('0xad')]({'id':0x0,'priority':0x1,'app':_0xdb52('0xb1'),'appdata':_0x481b2f['name']+','+(_0x8ad938['account'][_0xdb52('0xb2')]||0x12c),'interval':_0xdb52('0xa9')});}return respondWithRpcPromise(_0xdb52('0xb3'),'startRouting',_0x8ad938);})[_0xdb52('0x1e')](function(_0x311b40){if(_0x311b40){var _0x7ede74=0xc8;var _0x4ba42c=_0xdb52('0xb4');logger[_0xdb52('0x1f')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x4ba42c,_0x7ede74,'entity\x20found');logger[_0xdb52('0xb5')](_0xdb52('0xb6'),_0x4ba42c,_0x7ede74,_0xdb52('0xb7'),JSON[_0xdb52('0x23')](_0x311b40));if(_0x8ad938[_0xdb52('0x76')][_0xdb52('0x3e')]===_0xdb52('0x80')){return _0x631f0b[_0xdb52('0x2b')](_0x7ede74)[_0xdb52('0x2f')]('Content-Type',_0xdb52('0xb8'))[_0xdb52('0x38')](_0xdb52('0xb9'));}else{return _0x631f0b['status'](_0x7ede74)[_0xdb52('0x2c')](_0x311b40);}}})['catch'](handleError(_0x631f0b,null));};exports[_0xdb52('0xba')]=function(_0x234b7e,_0x3629ca){var _0x850697=_0x234b7e[_0xdb52('0x54')]['id'];var _0x20d191=_0x234b7e[_0xdb52('0x5f')];var _0x498a03=0xc8;var _0x3751c1=null;return db['sequelize'][_0xdb52('0xbb')]({'isolationLevel':db[_0xdb52('0xbc')][_0xdb52('0xbd')][_0xdb52('0xbe')][_0xdb52('0xbf')]},function(_0x152c1c){return db[_0xdb52('0x3b')][_0xdb52('0x63')]({'where':{'id':_0x850697},'transaction':_0x152c1c})['then'](function(_0x291004){if(_0x291004){return db[_0xdb52('0x70')][_0xdb52('0x33')]({'where':{'SmsAccountId':_0x850697},'transaction':_0x152c1c})[_0xdb52('0x1e')](function(){var _0x3c9096=_[_0xdb52('0x3a')](_0x20d191,function(_0x4598c1){_0x4598c1['SmsAccountId']=_0x850697;return _0x4598c1;});return db[_0xdb52('0x70')][_0xdb52('0xc0')](_0x3c9096,{'transaction':_0x152c1c});});}else{_0x498a03=0x194;_0x3751c1=[];}});})['then'](function(){if(_0x498a03!==0x194){return db['SmsApplication']['findAndCountAll']({'where':{'SmsAccountId':_0x850697},'order':_0xdb52('0x74')})[_0xdb52('0x1e')](function(_0x3e53e3){_0x3751c1=_0x3e53e3;});}})[_0xdb52('0x28')](function(_0x2b7d96){_0x498a03=0x1f4;logger['error'](_0x2b7d96[_0xdb52('0xc1')]);if(_0x2b7d96[_0xdb52('0x37')]){delete _0x2b7d96[_0xdb52('0x37')];}_0x3751c1=_0x2b7d96;})[_0xdb52('0xc2')](function(){if(_0x3751c1===null){_0x3629ca[_0xdb52('0x29')](_0x498a03);}else{if(_0x498a03===0x1f4){_0x3629ca[_0xdb52('0x2b')](_0x498a03)[_0xdb52('0x38')](_0x3751c1);}else{_0x3629ca['status'](_0x498a03)[_0xdb52('0x2c')](_0x3751c1);}}});};exports[_0xdb52('0xc3')]=function(_0x14c83f,_0x350546,_0x1299e3){var _0x41449f={};var _0x5a3d52={};var _0x32931d;var _0x2e0598;return db[_0xdb52('0x3b')]['findOne']({'where':{'id':_0x14c83f[_0xdb52('0x54')]['id']}})[_0xdb52('0x1e')](handleEntityNotFound(_0x350546,null))[_0xdb52('0x1e')](function(_0x2ee226){if(_0x2ee226){_0x32931d=_0x2ee226;_0x5a3d52[_0xdb52('0x40')]=_['keys'](db[_0xdb52('0x70')][_0xdb52('0x3c')]);_0x5a3d52['query']=_['keys'](_0x14c83f[_0xdb52('0x41')]);_0x5a3d52['filters']=_[_0xdb52('0x44')](_0x5a3d52['model'],_0x5a3d52[_0xdb52('0x41')]);_0x41449f[_0xdb52('0x45')]=_[_0xdb52('0x44')](_0x5a3d52[_0xdb52('0x40')],qs[_0xdb52('0x46')](_0x14c83f['query']['fields']));_0x41449f[_0xdb52('0x45')]=_0x41449f['attributes']['length']?_0x41449f[_0xdb52('0x45')]:_0x5a3d52[_0xdb52('0x40')];_0x41449f[_0xdb52('0x4b')]=qs[_0xdb52('0x65')](_0x14c83f[_0xdb52('0x41')][_0xdb52('0x65')]);_0x41449f[_0xdb52('0x4c')]=qs[_0xdb52('0x43')](_[_0xdb52('0x6b')](_0x14c83f['query'],_0x5a3d52[_0xdb52('0x43')]));if(_0x14c83f['query'][_0xdb52('0x4d')]){_0x41449f[_0xdb52('0x4c')]=_[_0xdb52('0x4e')](_0x41449f[_0xdb52('0x4c')],{'$or':_[_0xdb52('0x3a')](_0x41449f[_0xdb52('0x45')],function(_0x1e6a5){var _0x289b85={};_0x289b85[_0x1e6a5]={'$like':'%'+_0x14c83f[_0xdb52('0x41')][_0xdb52('0x4d')]+'%'};return _0x289b85;})});}_0x41449f=_['merge']({},_0x41449f,_0x14c83f[_0xdb52('0x57')]);return _0x32931d[_0xdb52('0xc3')](_0x41449f);}})[_0xdb52('0x1e')](function(_0xc2187b){if(_0xc2187b){_0x2e0598=_0xc2187b[_0xdb52('0x47')];if(!_0x14c83f[_0xdb52('0x41')][_0xdb52('0x48')](_0xdb52('0x49'))){_0x41449f[_0xdb52('0x4a')]=qs[_0xdb52('0x4a')](_0x14c83f[_0xdb52('0x41')]['limit']);_0x41449f[_0xdb52('0x2e')]=qs[_0xdb52('0x2e')](_0x14c83f[_0xdb52('0x41')][_0xdb52('0x2e')]);}return _0x32931d[_0xdb52('0xc3')](_0x41449f);}})[_0xdb52('0x1e')](function(_0xce029b){if(_0xce029b){return _0xce029b?{'count':_0x2e0598,'rows':_0xce029b}:null;}})[_0xdb52('0x1e')](respondWithResult(_0x350546,null))[_0xdb52('0x28')](handleError(_0x350546,null));};exports[_0xdb52('0xc4')]=function(_0x464080,_0x234be7,_0x5870db){var _0x585bf6={'raw':![],'where':{}};var _0x1b4b68={};var _0x3507bb={'count':0x0,'rows':[]};return db[_0xdb52('0x3b')][_0xdb52('0x63')]({'where':{'id':_0x464080[_0xdb52('0x54')]['id']}})[_0xdb52('0x1e')](handleEntityNotFound(_0x234be7,null))[_0xdb52('0x1e')](function(_0x55b8ee){if(_0x55b8ee){_0x1b4b68['model']=_[_0xdb52('0x42')](db[_0xdb52('0xa2')][_0xdb52('0x3c')]);_0x1b4b68['query']=_[_0xdb52('0x42')](_0x464080[_0xdb52('0x41')]);_0x1b4b68[_0xdb52('0x43')]=_[_0xdb52('0x44')](_0x1b4b68['model'],_0x1b4b68[_0xdb52('0x41')]);_0x585bf6[_0xdb52('0x45')]=_['intersection'](_0x1b4b68[_0xdb52('0x40')],qs[_0xdb52('0x46')](_0x464080[_0xdb52('0x41')][_0xdb52('0x46')]));_0x585bf6[_0xdb52('0x45')]=_0x585bf6['attributes'][_0xdb52('0x47')]?_0x585bf6[_0xdb52('0x45')]:_0x1b4b68[_0xdb52('0x40')];if(!_0x464080[_0xdb52('0x41')][_0xdb52('0x48')](_0xdb52('0x49'))){_0x585bf6[_0xdb52('0x4a')]=qs['limit'](_0x464080['query'][_0xdb52('0x4a')]);_0x585bf6['offset']=qs[_0xdb52('0x2e')](_0x464080['query'][_0xdb52('0x2e')]);}_0x585bf6[_0xdb52('0x4b')]=qs[_0xdb52('0x65')](_0x464080[_0xdb52('0x41')]['sort']);_0x585bf6[_0xdb52('0x4c')]=qs['filters'](_[_0xdb52('0x6b')](_0x464080[_0xdb52('0x41')],_0x1b4b68[_0xdb52('0x43')]));_0x585bf6[_0xdb52('0x4c')]['SmsAccountId']=_0x55b8ee['id'];if(_0x464080['query'][_0xdb52('0x4d')]){_0x585bf6[_0xdb52('0x4c')]=_[_0xdb52('0x4e')](_0x585bf6[_0xdb52('0x4c')],{'$or':_['map'](_0x585bf6[_0xdb52('0x45')],function(_0x545a84){var _0x507bbc={};_0x507bbc[_0x545a84]={'$like':'%'+_0x464080[_0xdb52('0x41')][_0xdb52('0x4d')]+'%'};return _0x507bbc;})});}_0x585bf6=_['merge']({},_0x585bf6,_0x464080['options']);return db[_0xdb52('0xa2')][_0xdb52('0x2d')]({'where':_0x585bf6['where']})['then'](function(_0x41cfdf){_0x3507bb[_0xdb52('0x2d')]=_0x41cfdf;if(_0x464080[_0xdb52('0x41')][_0xdb52('0x50')]){_0x585bf6[_0xdb52('0x51')]=[{'model':db[_0xdb52('0x77')],'as':_0xdb52('0xc5'),'required':![]},{'model':db[_0xdb52('0xac')],'as':_0xdb52('0xc6'),'attributes':[_0xdb52('0x37'),_0xdb52('0xc7'),_0xdb52('0xc8')],'required':![]},{'model':db[_0xdb52('0xc9')],'as':_0xdb52('0xca'),'attributes':['id',_0xdb52('0x37'),_0xdb52('0xcb')],'where':_0x464080[_0xdb52('0x41')]['tag']?{'id':_0x464080[_0xdb52('0x41')][_0xdb52('0xcc')]}:undefined,'required':_0x464080[_0xdb52('0x41')][_0xdb52('0xcc')]?!![]:![]}];}return db[_0xdb52('0xa2')]['findAll'](_0x585bf6);})['then'](function(_0x3b0681){_0x3507bb['rows']=_0x3b0681;return _0x3507bb;});}})['then'](respondWithFilteredResult(_0x234be7,_0x585bf6))[_0xdb52('0x28')](handleError(_0x234be7,null));};exports[_0xdb52('0x38')]=function(_0x5a051b,_0x4a8791,_0x9edb93){var _0x90c9cb,_0x167e14,_0x2c7b99;if(_[_0xdb52('0x98')](_0x5a051b['body'][_0xdb52('0x5f')])||_0x5a051b[_0xdb52('0x5f')][_0xdb52('0x5f')]===''){throw new db[(_0xdb52('0x96'))][(_0xdb52('0x78'))](_0xdb52('0xcd'));}if(_[_0xdb52('0x98')](_0x5a051b[_0xdb52('0x5f')]['to'])){throw new db[(_0xdb52('0x96'))][(_0xdb52('0x78'))](_0xdb52('0xce'));}_0x90c9cb=_0x5a051b[_0xdb52('0x5f')]['to'];return db['SmsAccount'][_0xdb52('0x5a')]({'where':{'id':_0x5a051b[_0xdb52('0x54')]['id']},'include':[{'model':db[_0xdb52('0x9c')],'as':'List','include':[{'model':db[_0xdb52('0x77')],'as':_0xdb52('0xa0'),'where':{'mobile':_0x90c9cb},'limit':0x1,'order':[[_0xdb52('0x7b'),_0xdb52('0x9d')]]}]}]})['then'](handleEntityNotFound(_0x4a8791,null))[_0xdb52('0x1e')](function(_0x35051b){if(_0x35051b&&_0x35051b[_0xdb52('0xcf')]){_0x167e14=_0x35051b[_0xdb52('0x34')]({'plain':!![]});if(_0x167e14[_0xdb52('0xcf')]&&_0x167e14[_0xdb52('0xcf')][_0xdb52('0xa0')]['length']){return _0x167e14[_0xdb52('0xcf')][_0xdb52('0xa0')][0x0];}return db['CmContact'][_0xdb52('0x5d')](_[_0xdb52('0x16')](_0x5a051b['body'],{'firstName':_0x90c9cb,'mobile':_0x90c9cb,'phone':_0x90c9cb,'ListId':_0x167e14[_0xdb52('0x7e')]}));}})[_0xdb52('0x1e')](handleEntityNotFound(_0x4a8791,null))[_0xdb52('0x1e')](function(_0x1aa9c1){if(_0x1aa9c1){_0x2c7b99=_0x1aa9c1;return db['SmsInteraction']['find']({'where':{'ContactId':_0x2c7b99['id'],'closed':![],'SmsAccountId':_0x167e14['id']}})['then'](function(_0x24d67e){if(_0x24d67e){return[_0x24d67e,![]];}return db['SmsInteraction']['create']({'UserId':_0x5a051b[_0xdb52('0xd0')]['id'],'ContactId':_0x2c7b99['id'],'SmsAccountId':_0x167e14['id'],'phone':_0x90c9cb,'firstMsgDirection':_0xdb52('0xd1'),'Messages':[_['merge'](_0x5a051b[_0xdb52('0x5f')],{'read':![],'body':_0x5a051b[_0xdb52('0x5f')][_0xdb52('0x5f')],'phone':_0x90c9cb,'SmsAccountId':_0x167e14['id'],'UserId':_0x5a051b[_0xdb52('0xd0')]['id'],'ContactId':_0x2c7b99['id']})]},{'include':[{'model':db[_0xdb52('0xd2')],'as':_0xdb52('0xd3')}]})[_0xdb52('0x1e')](function(_0x52cc37){return[_0x52cc37,!![]];});});}})[_0xdb52('0xd4')](function(_0x2b6e13,_0x1aeff3){if(_0x1aeff3){return _0x2b6e13;}return db[_0xdb52('0xd2')][_0xdb52('0x5d')](_[_0xdb52('0x4e')](_0x5a051b[_0xdb52('0x5f')],{'read':![],'body':_0x5a051b[_0xdb52('0x5f')][_0xdb52('0x5f')],'phone':_0x90c9cb,'SmsAccountId':_0x167e14['id'],'SmsInteractionId':_0x2b6e13['id'],'UserId':_0x5a051b['user']['id'],'ContactId':_0x2c7b99['id']}))[_0xdb52('0x1e')](function(_0x53e4e4){_0x2b6e13[_0xdb52('0xd5')][_0xdb52('0xd3')]=[];_0x2b6e13[_0xdb52('0xd5')]['Messages'][_0xdb52('0xa6')](_0x53e4e4[_0xdb52('0xd5')]);return _0x2b6e13;});})[_0xdb52('0x1e')](respondWithResult(_0x4a8791,null))[_0xdb52('0x28')](handleError(_0x4a8791,null));};exports[_0xdb52('0x2b')]=function(_0x41797b,_0x1af9ee,_0x2db5b3){if(_0x41797b[_0xdb52('0x5f')]['id']){delete _0x41797b[_0xdb52('0x5f')]['id'];}var _0x5a31bc,_0x4e64f4,_0xdf6f31;return db['SmsAccount'][_0xdb52('0x5a')]({'where':{'id':_0x41797b[_0xdb52('0x54')]['id']}})[_0xdb52('0x1e')](handleEntityNotFound(_0x1af9ee,null))[_0xdb52('0x1e')](function(_0x20ad12){if(_0x20ad12){_0xdf6f31=_0x20ad12;logger[_0xdb52('0xb5')](_0xdb52('0x21'),_0xdb52('0x2b'),'received\x20delivery\x20report\x20from',_0x20ad12[_0xdb52('0x3e')],util['inspect'](_0x41797b[_0xdb52('0x5f')],{'showHidden':![],'depth':null}));switch(_0x20ad12[_0xdb52('0x3e')]){case _0xdb52('0x85'):if(_0x41797b[_0xdb52('0x5f')]['skebby_dispatch_id']&&_0x41797b['body'][_0xdb52('0x2b')]){_0x4e64f4=_0x41797b['body'][_0xdb52('0x2b')];return db['SmsMessage'][_0xdb52('0x5a')]({'where':{'messageId':_0x41797b[_0xdb52('0x5f')]['skebby_dispatch_id']}});}break;case'connectel':if(_0x41797b[_0xdb52('0x5f')][_0xdb52('0xd6')]&&_0x41797b['body'][_0xdb52('0xd7')]){_0x4e64f4=_0x41797b['body']['statusInt'];return db['SmsMessage'][_0xdb52('0x5a')]({'where':{'messageId':_0x41797b[_0xdb52('0x5f')]['requestid']}});}break;case _0xdb52('0xd8'):if(_0x41797b[_0xdb52('0x5f')][_0xdb52('0x88')]&&_0x41797b['body']['status_code']){_0x4e64f4=_0x41797b[_0xdb52('0x5f')][_0xdb52('0xd9')];return db[_0xdb52('0xd2')]['find']({'where':{'messageId':_0x41797b[_0xdb52('0x5f')][_0xdb52('0x88')]}});}break;case _0xdb52('0x8c'):var _0x5d062f=_0x41797b[_0xdb52('0x5f')][_0xdb52('0x8d')][0x0];if(_0x5d062f[_0xdb52('0x83')]&&_0x5d062f[_0xdb52('0x2b')][_0xdb52('0xda')]===_0xdb52('0xdb')){_0x4e64f4=_0x5d062f[_0xdb52('0x2b')][_0xdb52('0xda')];return db[_0xdb52('0xd2')][_0xdb52('0x5a')]({'where':{'messageId':_0x5d062f['messageId']}});}break;case'clickatell':if(_0x41797b['body']['messageId']&&_0x41797b[_0xdb52('0x5f')][_0xdb52('0x2b')]){_0x4e64f4=_0x41797b[_0xdb52('0x5f')][_0xdb52('0x2b')];return db[_0xdb52('0xd2')][_0xdb52('0x5a')]({'where':{'messageId':_0x41797b[_0xdb52('0x5f')][_0xdb52('0x83')]}});}break;case _0xdb52('0x94'):if(_0x41797b['body'][0x0][_0xdb52('0x26')]['id']){_0x4e64f4=_0x41797b['body'][0x0][_0xdb52('0x3e')];return db['SmsMessage'][_0xdb52('0x5a')]({'where':{'messageId':_0x41797b['body'][0x0][_0xdb52('0x26')]['id']}});}break;case _0xdb52('0x95'):if(_0x41797b[_0xdb52('0x5f')][_0xdb52('0xdc')]&&_0x41797b[_0xdb52('0x5f')]['status']){_0x4e64f4=_0x41797b['body'][_0xdb52('0x2b')];return db[_0xdb52('0xd2')][_0xdb52('0x5a')]({'where':{'messageId':_0x41797b[_0xdb52('0x5f')][_0xdb52('0xdc')]}});}break;}}})[_0xdb52('0x1e')](handleEntityNotFound(_0x1af9ee,null))['then'](function(_0x12bd90){if(_0x12bd90){_0x5a31bc=_0x12bd90;switch(_0xdf6f31[_0xdb52('0x3e')]){case _0xdb52('0x85'):if(_0x4e64f4===_0xdb52('0xdb')){return _0x5a31bc['update']({'read':!![]});}else{logger[_0xdb52('0x24')](_0xdb52('0x21'),_0xdb52('0x2b'),'skebby',util[_0xdb52('0xdd')](_0x41797b[_0xdb52('0x5f')],{'showHidden':![],'depth':null}));}break;case _0xdb52('0x87'):if(_0x4e64f4==='1'){return _0x5a31bc[_0xdb52('0x32')]({'read':!![]});}else{logger[_0xdb52('0x24')](_0xdb52('0x21'),_0xdb52('0x2b'),'skebby',util[_0xdb52('0xdd')](_0x41797b[_0xdb52('0x5f')],{'showHidden':![],'depth':null}));}break;case _0xdb52('0xd8'):if(!_0x41797b[_0xdb52('0x5f')][_0xdb52('0xde')]&&_0x4e64f4>=0xc8&&_0x4e64f4<=0xce){return _0x5a31bc[_0xdb52('0x32')]({'read':!![]});}else{logger[_0xdb52('0x24')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xdb52('0x2b'),_0xdb52('0xd8'),util[_0xdb52('0xdd')](_0x41797b[_0xdb52('0x5f')],{'showHidden':![],'depth':null}));}break;case _0xdb52('0x8c'):var _0x379dc7=_0x41797b[_0xdb52('0x5f')][_0xdb52('0x8d')][0x0];if(_0x379dc7[_0xdb52('0x2b')][_0xdb52('0xda')]===_0xdb52('0xdb')){return _0x5a31bc[_0xdb52('0x32')]({'read':!![]});}else{logger[_0xdb52('0x24')](_0xdb52('0x21'),_0xdb52('0x2b'),_0xdb52('0x8c'),util[_0xdb52('0xdd')](_0x41797b[_0xdb52('0x5f')],{'showHidden':![],'depth':null}));}break;case _0xdb52('0x91'):if(_0x4e64f4==_0xdb52('0xdf')||_0x4e64f4==_0xdb52('0xe0')){return _0x5a31bc[_0xdb52('0x32')]({'read':!![]});}else{logger['error'](_0xdb52('0x21'),_0xdb52('0x2b'),'clickatell',util[_0xdb52('0xdd')](_0x41797b[_0xdb52('0x5f')],{'showHidden':![],'depth':null}));}break;case _0xdb52('0x94'):if(_0x4e64f4==_0xdb52('0xe1')){return _0x5a31bc[_0xdb52('0x32')]({'read':!![]});}else{logger[_0xdb52('0x24')](_0xdb52('0x21'),'status',_0xdb52('0x94'),util[_0xdb52('0xdd')](_0x41797b[_0xdb52('0x5f')],{'showHidden':![],'depth':null}));}break;case _0xdb52('0x95'):if(_0x4e64f4==='DELIVRD'||_0x4e64f4===_0xdb52('0xe2')){return _0x5a31bc[_0xdb52('0x32')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0xdb52('0x2b'),_0xdb52('0x95'),util[_0xdb52('0xdd')](_0x41797b[_0xdb52('0x5f')],{'showHidden':![],'depth':null}));}break;}return _0x5a31bc;}})[_0xdb52('0x1e')](respondWithResult(_0x1af9ee,null))[_0xdb52('0x28')](handleError(_0x1af9ee,null));};exports['statusGet']=function(_0x37542b,_0x5191f4,_0x414ac0){var _0x6d16ae,_0xe5ad43,_0x10c295;return db[_0xdb52('0x3b')][_0xdb52('0x5a')]({'where':{'id':_0x37542b[_0xdb52('0x54')]['id']}})['then'](handleEntityNotFound(_0x5191f4,null))['then'](function(_0x5bc2e1){if(_0x5bc2e1){_0x10c295=_0x5bc2e1;logger[_0xdb52('0xb5')](_0xdb52('0x21'),_0xdb52('0x2b'),_0xdb52('0xe3'),_0x5bc2e1[_0xdb52('0x3e')],util[_0xdb52('0xdd')](_0x37542b[_0xdb52('0x41')],{'showHidden':![],'depth':null}));switch(_0x5bc2e1[_0xdb52('0x3e')]){case _0xdb52('0xe4'):if(_0x37542b[_0xdb52('0x41')][_0xdb52('0xe5')]&&_0x37542b[_0xdb52('0x41')][_0xdb52('0xe6')]){_0xe5ad43=_0x37542b['query'][_0xdb52('0xe6')];return db['SmsMessage'][_0xdb52('0x5a')]({'where':{'messageId':_0x37542b[_0xdb52('0x41')][_0xdb52('0xe5')]}});}break;}}})['then'](handleEntityNotFound(_0x5191f4,null))[_0xdb52('0x1e')](function(_0x10c798){if(_0x10c798){_0x6d16ae=_0x10c798;switch(_0x10c295[_0xdb52('0x3e')]){case _0xdb52('0xe4'):if(_0xe5ad43==='2'||_0xe5ad43==='6'){return _0x6d16ae[_0xdb52('0x32')]({'read':!![]});}else{logger[_0xdb52('0x24')](_0xdb52('0x21'),_0xdb52('0x2b'),'csc',util[_0xdb52('0xdd')](_0x37542b[_0xdb52('0x41')],{'showHidden':![],'depth':null}));};break;}return _0x6d16ae;}})[_0xdb52('0x1e')](respondWithResult(_0x5191f4,null))[_0xdb52('0x28')](handleError(_0x5191f4,null));};exports[_0xdb52('0xe7')]=function(_0x532d40,_0x2fed1a,_0x33bf24){return db[_0xdb52('0x3b')]['find']({'where':{'id':_0x532d40['params']['id']}})[_0xdb52('0x1e')](handleEntityNotFound(_0x2fed1a,null))[_0xdb52('0x1e')](function(_0x438228){if(_0x438228){return _0x438228['addAgents'](_0x532d40[_0xdb52('0x5f')][_0xdb52('0x6d')],_[_0xdb52('0x9f')](_0x532d40[_0xdb52('0x5f')],['ids','id'])||{})[_0xdb52('0xd4')](function(_0x43c27f){for(var _0x5ca1ff=0x0;_0x5ca1ff<_0x532d40[_0xdb52('0x5f')][_0xdb52('0x6d')][_0xdb52('0x47')];_0x5ca1ff+=0x1){socket[_0xdb52('0xe8')](_0xdb52('0xe9'),{'UserId':Number(_0x532d40[_0xdb52('0x5f')][_0xdb52('0x6d')][_0x5ca1ff]),'SmsAccountId':Number(_0x532d40[_0xdb52('0x54')]['id'])});}return _0x43c27f;});}})[_0xdb52('0x1e')](respondWithResult(_0x2fed1a,null))[_0xdb52('0x28')](handleError(_0x2fed1a,null));};exports[_0xdb52('0xea')]=function(_0x396658,_0x55bc89,_0x3e2b42){return db['SmsAccount'][_0xdb52('0x5a')]({'where':{'id':_0x396658['params']['id']}})[_0xdb52('0x1e')](handleEntityNotFound(_0x55bc89,null))['then'](function(_0x3e9add){if(_0x3e9add){return _0x3e9add[_0xdb52('0xea')](_0x396658[_0xdb52('0x41')][_0xdb52('0x6d')])['then'](function(){if(_[_0xdb52('0xeb')](_0x396658[_0xdb52('0x41')][_0xdb52('0x6d')])){for(var _0x1b5e7c=0x0;_0x1b5e7c<_0x396658[_0xdb52('0x41')][_0xdb52('0x6d')][_0xdb52('0x47')];_0x1b5e7c+=0x1){socket[_0xdb52('0xe8')]('userSmsAccount:remove',{'UserId':Number(_0x396658['query'][_0xdb52('0x6d')][_0x1b5e7c]),'SmsAccountId':Number(_0x396658['params']['id'])});}}else{socket[_0xdb52('0xe8')](_0xdb52('0xec'),{'UserId':Number(_0x396658[_0xdb52('0x41')]['ids']),'SmsAccountId':Number(_0x396658['params']['id'])});}});}})[_0xdb52('0x1e')](respondWithStatusCode(_0x55bc89,null))[_0xdb52('0x28')](handleError(_0x55bc89,null));};exports[_0xdb52('0xed')]=function(_0x3f130d,_0x69d85f,_0x3b9e3c){var _0x3ac267={};var _0x52865b={};var _0x446067;var _0x5b247a;return db[_0xdb52('0x3b')][_0xdb52('0x63')]({'where':{'id':_0x3f130d[_0xdb52('0x54')]['id']}})[_0xdb52('0x1e')](handleEntityNotFound(_0x69d85f,null))['then'](function(_0x1350d9){if(_0x1350d9){_0x446067=_0x1350d9;_0x52865b[_0xdb52('0x40')]=_[_0xdb52('0x42')](db['User']['rawAttributes']);_0x52865b[_0xdb52('0x41')]=_[_0xdb52('0x42')](_0x3f130d['query']);_0x52865b['filters']=_[_0xdb52('0x44')](_0x52865b[_0xdb52('0x40')],_0x52865b[_0xdb52('0x41')]);_0x3ac267[_0xdb52('0x45')]=_[_0xdb52('0x44')](_0x52865b['model'],qs[_0xdb52('0x46')](_0x3f130d['query']['fields']));_0x3ac267['attributes']=_0x3ac267[_0xdb52('0x45')][_0xdb52('0x47')]?_0x3ac267[_0xdb52('0x45')]:_0x52865b['model'];_0x3ac267[_0xdb52('0x4b')]=qs[_0xdb52('0x65')](_0x3f130d[_0xdb52('0x41')][_0xdb52('0x65')]);_0x3ac267[_0xdb52('0x4c')]=qs[_0xdb52('0x43')](_['pick'](_0x3f130d[_0xdb52('0x41')],_0x52865b[_0xdb52('0x43')]));if(_0x3f130d['query']['filter']){_0x3ac267['where']=_[_0xdb52('0x4e')](_0x3ac267[_0xdb52('0x4c')],{'$or':_['map'](_0x3ac267[_0xdb52('0x45')],function(_0x5b59c4){var _0x4c2f12={};_0x4c2f12[_0x5b59c4]={'$like':'%'+_0x3f130d[_0xdb52('0x41')][_0xdb52('0x4d')]+'%'};return _0x4c2f12;})});}_0x3ac267=_[_0xdb52('0x4e')]({},_0x3ac267,_0x3f130d['options']);return _0x446067[_0xdb52('0xed')](_0x3ac267);}})[_0xdb52('0x1e')](function(_0x4f9c2f){if(_0x4f9c2f){_0x5b247a=_0x4f9c2f['length'];if(!_0x3f130d[_0xdb52('0x41')]['hasOwnProperty'](_0xdb52('0x49'))){_0x3ac267['limit']=qs[_0xdb52('0x4a')](_0x3f130d[_0xdb52('0x41')][_0xdb52('0x4a')]);_0x3ac267[_0xdb52('0x2e')]=qs[_0xdb52('0x2e')](_0x3f130d[_0xdb52('0x41')]['offset']);}return _0x446067[_0xdb52('0xed')](_0x3ac267);}})[_0xdb52('0x1e')](function(_0x20c730){if(_0x20c730){return _0x20c730?{'count':_0x5b247a,'rows':_0x20c730}:null;}})[_0xdb52('0x1e')](respondWithResult(_0x69d85f,null))['catch'](handleError(_0x69d85f,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index 6a57637..4c52c33 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 _0xba21=['exports','events','../../mysqldb','SmsAccount','save','update','remove','emit','hook'];(function(_0x40c5f0,_0x3ccd28){var _0x215d61=function(_0x48defe){while(--_0x48defe){_0x40c5f0['push'](_0x40c5f0['shift']());}};_0x215d61(++_0x3ccd28);}(_0xba21,0xf4));var _0x1ba2=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xba21[_0x40a045];return _0x1a687c;};'use strict';var EventEmitter=require(_0x1ba2('0x0'));var SmsAccount=require(_0x1ba2('0x1'))['db'][_0x1ba2('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x1ba2('0x3'),'afterUpdate':_0x1ba2('0x4'),'afterDestroy':_0x1ba2('0x5')};function emitEvent(_0x54209d){return function(_0x279054,_0x588adb,_0x572993){SmsAccountEvents['emit'](_0x54209d+':'+_0x279054['id'],_0x279054);SmsAccountEvents[_0x1ba2('0x6')](_0x54209d,_0x279054);_0x572993(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsAccount[_0x1ba2('0x7')](e,emitEvent(event));}}module[_0x1ba2('0x8')]=SmsAccountEvents; \ No newline at end of file +var _0xd288=['SmsAccount','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x28517d,_0x4f31fc){var _0x343b90=function(_0x46d397){while(--_0x46d397){_0x28517d['push'](_0x28517d['shift']());}};_0x343b90(++_0x4f31fc);}(_0xd288,0x1af));var _0x8d28=function(_0x4789e7,_0x989575){_0x4789e7=_0x4789e7-0x0;var _0x58c1e3=_0xd288[_0x4789e7];return _0x58c1e3;};'use strict';var EventEmitter=require(_0x8d28('0x0'));var SmsAccount=require('../../mysqldb')['db'][_0x8d28('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x8d28('0x2'),'afterUpdate':_0x8d28('0x3'),'afterDestroy':_0x8d28('0x4')};function emitEvent(_0x38ac15){return function(_0x120a51,_0x5d08bf,_0x467260){SmsAccountEvents[_0x8d28('0x5')](_0x38ac15+':'+_0x120a51['id'],_0x120a51);SmsAccountEvents['emit'](_0x38ac15,_0x120a51);_0x467260(null);};}for(var e in events){if(events[_0x8d28('0x6')](e)){var event=events[e];SmsAccount[_0x8d28('0x7')](e,emitEvent(event));}}module[_0x8d28('0x8')]=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index 57cc87c..61b2746 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 _0x5c52=['./smsAccount.attributes','exports','SmsAccount','sms_accounts','lodash','api','moment','bluebird','path','../../config/environment'];(function(_0x465e46,_0x325a55){var _0x210296=function(_0x1080e7){while(--_0x1080e7){_0x465e46['push'](_0x465e46['shift']());}};_0x210296(++_0x325a55);}(_0x5c52,0x1d0));var _0x25c5=function(_0x231c4d,_0x514bfe){_0x231c4d=_0x231c4d-0x0;var _0x1458fe=_0x5c52[_0x231c4d];return _0x1458fe;};'use strict';var _=require(_0x25c5('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x25c5('0x1'));var moment=require(_0x25c5('0x2'));var BPromise=require(_0x25c5('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x25c5('0x4'));var rimraf=require('rimraf');var config=require(_0x25c5('0x5'));var attributes=require(_0x25c5('0x6'));module[_0x25c5('0x7')]=function(_0x57eb72,_0x4b4a9d){return _0x57eb72['define'](_0x25c5('0x8'),attributes,{'tableName':_0x25c5('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7f7d=['moment','bluebird','path','rimraf','../../config/environment','./smsAccount.attributes','define','SmsAccount','sms_accounts','util','../../config/logger','api'];(function(_0x1536c2,_0x17968a){var _0x5cdfaa=function(_0x5273ea){while(--_0x5273ea){_0x1536c2['push'](_0x1536c2['shift']());}};_0x5cdfaa(++_0x17968a);}(_0x7f7d,0xed));var _0xd7f7=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0x7f7d[_0x376b45];return _0x2341b3;};'use strict';var _=require('lodash');var util=require(_0xd7f7('0x0'));var logger=require(_0xd7f7('0x1'))(_0xd7f7('0x2'));var moment=require(_0xd7f7('0x3'));var BPromise=require(_0xd7f7('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd7f7('0x5'));var rimraf=require(_0xd7f7('0x6'));var config=require(_0xd7f7('0x7'));var attributes=require(_0xd7f7('0x8'));module['exports']=function(_0x24d6e2,_0x929af){return _0x24d6e2[_0xd7f7('0x9')](_0xd7f7('0xa'),attributes,{'tableName':_0xd7f7('0xb'),'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 49724d8..ac829ca 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 _0x82d0=['http','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','register','request','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','ShowSmsAccount','SmsAccount','find','options','raw','where','attributes','map','include','model','then','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x82d0,0x1a3));var _0x082d=function(_0x4abab9,_0xde21a4){_0x4abab9=_0x4abab9-0x0;var _0x374eba=_0x82d0[_0x4abab9];return _0x374eba;};'use strict';var _=require(_0x082d('0x0'));var util=require(_0x082d('0x1'));var moment=require(_0x082d('0x2'));var BPromise=require('bluebird');var rs=require(_0x082d('0x3'));var fs=require('fs');var Redis=require(_0x082d('0x4'));var db=require(_0x082d('0x5'))['db'];var utils=require(_0x082d('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x082d('0x7'));var jayson=require(_0x082d('0x8'));var client=jayson[_0x082d('0x9')][_0x082d('0xa')]({'port':0x232a});config[_0x082d('0xb')]=_[_0x082d('0xc')](config[_0x082d('0xb')],{'host':_0x082d('0xd'),'port':0x18eb});var socket=require(_0x082d('0xe'))(new Redis(config[_0x082d('0xb')]));require(_0x082d('0xf'))[_0x082d('0x10')](socket);function respondWithRpcPromise(_0x580e5b,_0xc8abfd,_0x919a2c){return new BPromise(function(_0x106fdf,_0x3e58bb){return client[_0x082d('0x11')](_0x580e5b,_0x919a2c)['then'](function(_0x3ea504){logger[_0x082d('0x12')](_0x082d('0x13'),_0xc8abfd,_0x082d('0x14'));logger[_0x082d('0x15')](_0x082d('0x16'),_0xc8abfd,_0x082d('0x14'),JSON[_0x082d('0x17')](_0x3ea504));if(_0x3ea504[_0x082d('0x18')]){if(_0x3ea504[_0x082d('0x18')]['code']===0x1f4){logger[_0x082d('0x18')](_0x082d('0x13'),_0xc8abfd,_0x3ea504[_0x082d('0x18')][_0x082d('0x19')]);return _0x3e58bb(_0x3ea504['error'][_0x082d('0x19')]);}logger[_0x082d('0x18')](_0x082d('0x13'),_0xc8abfd,_0x3ea504[_0x082d('0x18')][_0x082d('0x19')]);return _0x106fdf(_0x3ea504['error'][_0x082d('0x19')]);}else{logger[_0x082d('0x12')](_0x082d('0x13'),_0xc8abfd,_0x082d('0x14'));_0x106fdf(_0x3ea504[_0x082d('0x1a')][_0x082d('0x19')]);}})[_0x082d('0x1b')](function(_0x29cb08){logger['error']('SmsAccount,\x20%s,\x20%s',_0xc8abfd,_0x29cb08);_0x3e58bb(_0x29cb08);});});}exports[_0x082d('0x1c')]=function(_0x4c68f3){var _0x23ac59=this;return new Promise(function(_0x3146f8,_0x43fdfc){return db[_0x082d('0x1d')][_0x082d('0x1e')]({'raw':_0x4c68f3[_0x082d('0x1f')]?_0x4c68f3[_0x082d('0x1f')][_0x082d('0x20')]===undefined?!![]:![]:!![],'where':_0x4c68f3[_0x082d('0x1f')]?_0x4c68f3[_0x082d('0x1f')][_0x082d('0x21')]||null:null,'attributes':_0x4c68f3[_0x082d('0x1f')]?_0x4c68f3[_0x082d('0x1f')][_0x082d('0x22')]||null:null,'include':_0x4c68f3['options']?_0x4c68f3[_0x082d('0x1f')]['include']?_[_0x082d('0x23')](_0x4c68f3[_0x082d('0x1f')][_0x082d('0x24')],function(_0x18dd7f){return{'model':db[_0x18dd7f[_0x082d('0x25')]],'as':_0x18dd7f['as'],'attributes':_0x18dd7f['attributes'],'include':_0x18dd7f[_0x082d('0x24')]?_[_0x082d('0x23')](_0x18dd7f[_0x082d('0x24')],function(_0x3f87d7){return{'model':db[_0x3f87d7[_0x082d('0x25')]],'as':_0x3f87d7['as'],'attributes':_0x3f87d7[_0x082d('0x22')],'include':_0x3f87d7[_0x082d('0x24')]?_[_0x082d('0x23')](_0x3f87d7[_0x082d('0x24')],function(_0x41ff04){return{'model':db[_0x41ff04[_0x082d('0x25')]],'as':_0x41ff04['as'],'attributes':_0x41ff04[_0x082d('0x22')]};}):[]};}):[]};}):[]:[]})[_0x082d('0x26')](function(_0x452f93){logger['info'](_0x082d('0x1c'),_0x4c68f3);logger[_0x082d('0x15')](_0x082d('0x1c'),_0x4c68f3,JSON[_0x082d('0x17')](_0x452f93));_0x3146f8(_0x452f93);})[_0x082d('0x1b')](function(_0x1b3104){logger[_0x082d('0x18')](_0x082d('0x1c'),_0x1b3104[_0x082d('0x19')],_0x4c68f3);_0x43fdfc(_0x23ac59[_0x082d('0x18')](0x1f4,_0x1b3104['message']));});});}; \ No newline at end of file +var _0x935d=['http','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','request','then','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','SmsAccount','find','options','where','include','map','attributes','model','ShowSmsAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client'];(function(_0x43f38a,_0x44c537){var _0x112284=function(_0x12568c){while(--_0x12568c){_0x43f38a['push'](_0x43f38a['shift']());}};_0x112284(++_0x44c537);}(_0x935d,0x1be));var _0xd935=function(_0x28d18d,_0x55896b){_0x28d18d=_0x28d18d-0x0;var _0x470640=_0x935d[_0x28d18d];return _0x470640;};'use strict';var _=require(_0xd935('0x0'));var util=require(_0xd935('0x1'));var moment=require(_0xd935('0x2'));var BPromise=require(_0xd935('0x3'));var rs=require(_0xd935('0x4'));var fs=require('fs');var Redis=require(_0xd935('0x5'));var db=require(_0xd935('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xd935('0x7'));var config=require('../../config/environment');var jayson=require(_0xd935('0x8'));var client=jayson[_0xd935('0x9')][_0xd935('0xa')]({'port':0x232a});config[_0xd935('0xb')]=_[_0xd935('0xc')](config['redis'],{'host':_0xd935('0xd'),'port':0x18eb});var socket=require(_0xd935('0xe'))(new Redis(config['redis']));require(_0xd935('0xf'))['register'](socket);function respondWithRpcPromise(_0x5f3e07,_0x2f356e,_0x235fa9){return new BPromise(function(_0x1d50e1,_0x4640fa){return client[_0xd935('0x10')](_0x5f3e07,_0x235fa9)[_0xd935('0x11')](function(_0x2a5194){logger['info'](_0xd935('0x12'),_0x2f356e,_0xd935('0x13'));logger[_0xd935('0x14')](_0xd935('0x15'),_0x2f356e,_0xd935('0x13'),JSON[_0xd935('0x16')](_0x2a5194));if(_0x2a5194[_0xd935('0x17')]){if(_0x2a5194[_0xd935('0x17')][_0xd935('0x18')]===0x1f4){logger[_0xd935('0x17')](_0xd935('0x12'),_0x2f356e,_0x2a5194['error'][_0xd935('0x19')]);return _0x4640fa(_0x2a5194[_0xd935('0x17')]['message']);}logger[_0xd935('0x17')](_0xd935('0x12'),_0x2f356e,_0x2a5194['error'][_0xd935('0x19')]);return _0x1d50e1(_0x2a5194[_0xd935('0x17')][_0xd935('0x19')]);}else{logger[_0xd935('0x1a')](_0xd935('0x12'),_0x2f356e,'request\x20sent');_0x1d50e1(_0x2a5194[_0xd935('0x1b')][_0xd935('0x19')]);}})[_0xd935('0x1c')](function(_0x2fa105){logger[_0xd935('0x17')](_0xd935('0x12'),_0x2f356e,_0x2fa105);_0x4640fa(_0x2fa105);});});}exports['ShowSmsAccount']=function(_0x177329){var _0x51c77b=this;return new Promise(function(_0x2fff78,_0x2ceb95){return db[_0xd935('0x1d')][_0xd935('0x1e')]({'raw':_0x177329[_0xd935('0x1f')]?_0x177329['options']['raw']===undefined?!![]:![]:!![],'where':_0x177329['options']?_0x177329[_0xd935('0x1f')][_0xd935('0x20')]||null:null,'attributes':_0x177329['options']?_0x177329['options']['attributes']||null:null,'include':_0x177329['options']?_0x177329['options'][_0xd935('0x21')]?_[_0xd935('0x22')](_0x177329[_0xd935('0x1f')][_0xd935('0x21')],function(_0x21e285){return{'model':db[_0x21e285['model']],'as':_0x21e285['as'],'attributes':_0x21e285['attributes'],'include':_0x21e285[_0xd935('0x21')]?_[_0xd935('0x22')](_0x21e285['include'],function(_0x16d74c){return{'model':db[_0x16d74c['model']],'as':_0x16d74c['as'],'attributes':_0x16d74c[_0xd935('0x23')],'include':_0x16d74c[_0xd935('0x21')]?_[_0xd935('0x22')](_0x16d74c['include'],function(_0x241d09){return{'model':db[_0x241d09[_0xd935('0x24')]],'as':_0x241d09['as'],'attributes':_0x241d09[_0xd935('0x23')]};}):[]};}):[]};}):[]:[]})[_0xd935('0x11')](function(_0x12ab07){logger[_0xd935('0x1a')]('ShowSmsAccount',_0x177329);logger[_0xd935('0x14')](_0xd935('0x25'),_0x177329,JSON['stringify'](_0x12ab07));_0x2fff78(_0x12ab07);})['catch'](function(_0x3f3a0b){logger[_0xd935('0x17')](_0xd935('0x25'),_0x3f3a0b[_0xd935('0x19')],_0x177329);_0x2ceb95(_0x51c77b['error'](0x1f4,_0x3f3a0b[_0xd935('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index f144aa0..83834ed 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(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0xa9e0[_0x2d8fc2];return _0x3a9e53;};'use strict';var SmsAccountEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){SmsAccountEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);SmsAccountEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file +var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xa9e0[_0x4cf98e];return _0x1623ac;};'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 11de8b6..9ec3638 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(_0x5394a2,_0x1e22df){var _0x46a796=function(_0x22ac1d){while(--_0x22ac1d){_0x5394a2['push'](_0x5394a2['shift']());}};_0x46a796(++_0x1e22df);}(_0x7217,0x19e));var _0x7721=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x7217[_0x3947c9];return _0x2e7871;};'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 _0xe14b=['/:id','create','put','exports','multer','util','express','Router','../../components/auth/service','./smsApplication.controller','get','isAuthenticated','index'];(function(_0x377462,_0x100a9d){var _0xf03b87=function(_0x3aad73){while(--_0x3aad73){_0x377462['push'](_0x377462['shift']());}};_0xf03b87(++_0x100a9d);}(_0xe14b,0x93));var _0xbe14=function(_0x42523d,_0x271eed){_0x42523d=_0x42523d-0x0;var _0x54d9c2=_0xe14b[_0x42523d];return _0x54d9c2;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbe14('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbe14('0x5'));router[_0xbe14('0x6')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x8')]);router[_0xbe14('0x6')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xbe14('0xa')]);router[_0xbe14('0xb')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['update']);router['delete'](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['destroy']);module[_0xbe14('0xc')]=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index 34da401..c0644cc 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 _0x67d7=['*,*,*,*','sequelize','exports','STRING','noop','TEXT'];(function(_0x9e74d5,_0x56b037){var _0x4374ed=function(_0x16b023){while(--_0x16b023){_0x9e74d5['push'](_0x9e74d5['shift']());}};_0x4374ed(++_0x56b037);}(_0x67d7,0xf7));var _0x767d=function(_0x896786,_0x11995d){_0x896786=_0x896786-0x0;var _0x41b274=_0x67d7[_0x896786];return _0x41b274;};'use strict';var Sequelize=require(_0x767d('0x0'));module[_0x767d('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x767d('0x2')],'allowNull':![],'defaultValue':_0x767d('0x3')},'appdata':{'type':Sequelize[_0x767d('0x4')]()},'description':{'type':Sequelize[_0x767d('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x767d('0x5')}}; \ No newline at end of file +var _0xb2a4=['TEXT','sequelize','exports','INTEGER','noop'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xb2a4,0x169));var _0x4b2a=function(_0x33831d,_0x6be5e9){_0x33831d=_0x33831d-0x0;var _0x138ef1=_0xb2a4[_0x33831d];return _0x138ef1;};'use strict';var Sequelize=require(_0x4b2a('0x0'));module[_0x4b2a('0x1')]={'priority':{'type':Sequelize[_0x4b2a('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x4b2a('0x3')},'appdata':{'type':Sequelize[_0x4b2a('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index 31e8268..997aa9b 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 _0x191b=['../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','SmsApplication','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','order','sort','where','pick','filter','merge','options','count','include','findAll','rows','show','includeAll','find','catch','create','body','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x28d7fe,_0x3813d2){var _0x61e5ea=function(_0x3d8028){while(--_0x3d8028){_0x28d7fe['push'](_0x28d7fe['shift']());}};_0x61e5ea(++_0x3813d2);}(_0x191b,0x118));var _0xb191=function(_0x5652b0,_0x541b65){_0x5652b0=_0x5652b0-0x0;var _0x85b649=_0x191b[_0x5652b0];return _0x85b649;};'use strict';var emlformat=require(_0xb191('0x0'));var rimraf=require(_0xb191('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb191('0x2'));var rp=require(_0xb191('0x3'));var moment=require(_0xb191('0x4'));var BPromise=require(_0xb191('0x5'));var Mustache=require(_0xb191('0x6'));var util=require('util');var path=require(_0xb191('0x7'));var sox=require(_0xb191('0x8'));var csv=require(_0xb191('0x9'));var ejs=require(_0xb191('0xa'));var fs=require('fs');var fs_extra=require(_0xb191('0xb'));var _=require(_0xb191('0xc'));var squel=require(_0xb191('0xd'));var crypto=require(_0xb191('0xe'));var jsforce=require(_0xb191('0xf'));var deskjs=require(_0xb191('0x10'));var toCsv=require(_0xb191('0x9'));var querystring=require(_0xb191('0x11'));var Papa=require('papaparse');var Redis=require(_0xb191('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xb191('0x13'));var hardwareService=require(_0xb191('0x14'));var logger=require(_0xb191('0x15'))(_0xb191('0x16'));var utils=require(_0xb191('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xb191('0x18'));var db=require(_0xb191('0x19'))['db'];function respondWithStatusCode(_0x370e5b,_0x1bd6a9){_0x1bd6a9=_0x1bd6a9||0xcc;return function(_0x739fcd){if(_0x739fcd){return _0x370e5b[_0xb191('0x1a')](_0x1bd6a9);}return _0x370e5b[_0xb191('0x1b')](_0x1bd6a9)['end']();};}function respondWithResult(_0x5e8e15,_0x38da52){_0x38da52=_0x38da52||0xc8;return function(_0x1dd458){if(_0x1dd458){return _0x5e8e15[_0xb191('0x1b')](_0x38da52)[_0xb191('0x1c')](_0x1dd458);}};}function respondWithFilteredResult(_0x32a538,_0x30c30d){return function(_0x4cb9ea){if(_0x4cb9ea){var _0x14f667=typeof _0x30c30d[_0xb191('0x1d')]==='undefined'&&typeof _0x30c30d[_0xb191('0x1e')]==='undefined';var _0x1008e6=_0x4cb9ea['count'];var _0x537db1=_0x14f667?0x0:_0x30c30d['offset'];var _0x725a85=_0x14f667?_0x4cb9ea['count']:_0x30c30d[_0xb191('0x1d')]+_0x30c30d[_0xb191('0x1e')];var _0x10d7ed;if(_0x725a85>=_0x1008e6){_0x725a85=_0x1008e6;_0x10d7ed=0xc8;}else{_0x10d7ed=0xce;}_0x32a538[_0xb191('0x1b')](_0x10d7ed);return _0x32a538[_0xb191('0x1f')](_0xb191('0x20'),_0x537db1+'-'+_0x725a85+'/'+_0x1008e6)[_0xb191('0x1c')](_0x4cb9ea);}return null;};}function patchUpdates(_0x1a7a49){return function(_0x2459cd){try{jsonpatch[_0xb191('0x21')](_0x2459cd,_0x1a7a49,!![]);}catch(_0x2aab09){return BPromise[_0xb191('0x22')](_0x2aab09);}return _0x2459cd[_0xb191('0x23')]();};}function saveUpdates(_0x8863ed,_0x5c227c){return function(_0x4b5cb2){if(_0x4b5cb2){return _0x4b5cb2[_0xb191('0x24')](_0x8863ed)[_0xb191('0x25')](function(_0x4256ee){return _0x4256ee;});}return null;};}function removeEntity(_0x4b24ef,_0x1170ee){return function(_0x4ded0b){if(_0x4ded0b){return _0x4ded0b[_0xb191('0x26')]()['then'](function(){_0x4b24ef[_0xb191('0x1b')](0xcc)[_0xb191('0x27')]();});}};}function handleEntityNotFound(_0x5834f1,_0x3ef42a){return function(_0x249171){if(!_0x249171){_0x5834f1[_0xb191('0x1a')](0x194);}return _0x249171;};}function handleError(_0x380c65,_0x2d3aaa){_0x2d3aaa=_0x2d3aaa||0x1f4;return function(_0xbc3c0f){logger[_0xb191('0x28')](_0xbc3c0f[_0xb191('0x29')]);if(_0xbc3c0f[_0xb191('0x2a')]){delete _0xbc3c0f[_0xb191('0x2a')];}_0x380c65['status'](_0x2d3aaa)[_0xb191('0x2b')](_0xbc3c0f);};}exports[_0xb191('0x2c')]=function(_0x152f69,_0x36beb1){var _0x583e7f={},_0x491ed7={},_0x55f6c4={'count':0x0,'rows':[]};var _0x37f647=_[_0xb191('0x2d')](db[_0xb191('0x2e')][_0xb191('0x2f')],function(_0x296d26){return{'name':_0x296d26[_0xb191('0x30')],'type':_0x296d26[_0xb191('0x31')]['key']};});_0x491ed7[_0xb191('0x32')]=_[_0xb191('0x2d')](_0x37f647,_0xb191('0x2a'));_0x491ed7[_0xb191('0x33')]=_[_0xb191('0x34')](_0x152f69[_0xb191('0x33')]);_0x491ed7[_0xb191('0x35')]=_['intersection'](_0x491ed7[_0xb191('0x32')],_0x491ed7['query']);_0x583e7f[_0xb191('0x36')]=_[_0xb191('0x37')](_0x491ed7[_0xb191('0x32')],qs[_0xb191('0x38')](_0x152f69[_0xb191('0x33')]['fields']));_0x583e7f[_0xb191('0x36')]=_0x583e7f['attributes'][_0xb191('0x39')]?_0x583e7f[_0xb191('0x36')]:_0x491ed7[_0xb191('0x32')];if(!_0x152f69[_0xb191('0x33')]['hasOwnProperty']('nolimit')){_0x583e7f[_0xb191('0x1e')]=qs[_0xb191('0x1e')](_0x152f69[_0xb191('0x33')][_0xb191('0x1e')]);_0x583e7f[_0xb191('0x1d')]=qs['offset'](_0x152f69[_0xb191('0x33')][_0xb191('0x1d')]);}_0x583e7f[_0xb191('0x3a')]=qs[_0xb191('0x3b')](_0x152f69['query'][_0xb191('0x3b')]);_0x583e7f[_0xb191('0x3c')]=qs[_0xb191('0x35')](_[_0xb191('0x3d')](_0x152f69['query'],_0x491ed7[_0xb191('0x35')]),_0x37f647);if(_0x152f69[_0xb191('0x33')][_0xb191('0x3e')]){_0x583e7f[_0xb191('0x3c')]=_[_0xb191('0x3f')](_0x583e7f[_0xb191('0x3c')],{'$or':_[_0xb191('0x2d')](_0x37f647,function(_0x6a641a){if(_0x6a641a[_0xb191('0x31')]!=='VIRTUAL'){var _0x1687df={};_0x1687df[_0x6a641a[_0xb191('0x2a')]]={'$like':'%'+_0x152f69[_0xb191('0x33')]['filter']+'%'};return _0x1687df;}})});}_0x583e7f=_[_0xb191('0x3f')]({},_0x583e7f,_0x152f69[_0xb191('0x40')]);var _0x2f1805={'where':_0x583e7f['where']};return db[_0xb191('0x2e')][_0xb191('0x41')](_0x2f1805)[_0xb191('0x25')](function(_0x16c773){_0x55f6c4[_0xb191('0x41')]=_0x16c773;if(_0x152f69[_0xb191('0x33')]['includeAll']){_0x583e7f[_0xb191('0x42')]=[{'all':!![]}];}return db[_0xb191('0x2e')][_0xb191('0x43')](_0x583e7f);})[_0xb191('0x25')](function(_0x250925){_0x55f6c4[_0xb191('0x44')]=_0x250925;return _0x55f6c4;})[_0xb191('0x25')](respondWithFilteredResult(_0x36beb1,_0x583e7f))['catch'](handleError(_0x36beb1,null));};exports[_0xb191('0x45')]=function(_0x7c8231,_0xc976e5){var _0x5a4b93={'raw':!![],'where':{'id':_0x7c8231['params']['id']}},_0xe42c96={};_0xe42c96[_0xb191('0x32')]=_[_0xb191('0x34')](db[_0xb191('0x2e')]['rawAttributes']);_0xe42c96[_0xb191('0x33')]=_[_0xb191('0x34')](_0x7c8231[_0xb191('0x33')]);_0xe42c96[_0xb191('0x35')]=_[_0xb191('0x37')](_0xe42c96[_0xb191('0x32')],_0xe42c96[_0xb191('0x33')]);_0x5a4b93[_0xb191('0x36')]=_['intersection'](_0xe42c96[_0xb191('0x32')],qs[_0xb191('0x38')](_0x7c8231[_0xb191('0x33')][_0xb191('0x38')]));_0x5a4b93['attributes']=_0x5a4b93[_0xb191('0x36')][_0xb191('0x39')]?_0x5a4b93['attributes']:_0xe42c96[_0xb191('0x32')];if(_0x7c8231[_0xb191('0x33')][_0xb191('0x46')]){_0x5a4b93[_0xb191('0x42')]=[{'all':!![]}];}_0x5a4b93=_['merge']({},_0x5a4b93,_0x7c8231['options']);return db['SmsApplication'][_0xb191('0x47')](_0x5a4b93)[_0xb191('0x25')](handleEntityNotFound(_0xc976e5,null))[_0xb191('0x25')](respondWithResult(_0xc976e5,null))[_0xb191('0x48')](handleError(_0xc976e5,null));};exports['create']=function(_0x5268f4,_0x22d721){return db['SmsApplication'][_0xb191('0x49')](_0x5268f4[_0xb191('0x4a')],{})[_0xb191('0x25')](respondWithResult(_0x22d721,0xc9))[_0xb191('0x48')](handleError(_0x22d721,null));};exports['update']=function(_0x5013f5,_0x342cbd){if(_0x5013f5[_0xb191('0x4a')]['id']){delete _0x5013f5['body']['id'];}return db['SmsApplication'][_0xb191('0x47')]({'where':{'id':_0x5013f5[_0xb191('0x4b')]['id']}})[_0xb191('0x25')](handleEntityNotFound(_0x342cbd,null))[_0xb191('0x25')](saveUpdates(_0x5013f5['body'],null))[_0xb191('0x25')](respondWithResult(_0x342cbd,null))['catch'](handleError(_0x342cbd,null));};exports['destroy']=function(_0x577890,_0x3d9ab7){return db['SmsApplication']['find']({'where':{'id':_0x577890[_0xb191('0x4b')]['id']}})[_0xb191('0x25')](handleEntityNotFound(_0x3d9ab7,null))[_0xb191('0x25')](removeEntity(_0x3d9ab7,null))[_0xb191('0x48')](handleError(_0x3d9ab7,null));}; \ No newline at end of file +var _0x809b=['end','offset','undefined','count','limit','status','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','SmsApplication','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','include','findAll','rows','show','params','rawAttributes','includeAll','find','create','body','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x3c177c,_0x5ed860){var _0x53501c=function(_0x4b89c8){while(--_0x4b89c8){_0x3c177c['push'](_0x3c177c['shift']());}};_0x53501c(++_0x5ed860);}(_0x809b,0x83));var _0xb809=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x809b[_0x46698a];return _0x356db0;};'use strict';var emlformat=require(_0xb809('0x0'));var rimraf=require(_0xb809('0x1'));var zipdir=require(_0xb809('0x2'));var jsonpatch=require(_0xb809('0x3'));var rp=require(_0xb809('0x4'));var moment=require(_0xb809('0x5'));var BPromise=require(_0xb809('0x6'));var Mustache=require(_0xb809('0x7'));var util=require('util');var path=require(_0xb809('0x8'));var sox=require(_0xb809('0x9'));var csv=require(_0xb809('0xa'));var ejs=require(_0xb809('0xb'));var fs=require('fs');var fs_extra=require(_0xb809('0xc'));var _=require(_0xb809('0xd'));var squel=require(_0xb809('0xe'));var crypto=require(_0xb809('0xf'));var jsforce=require(_0xb809('0x10'));var deskjs=require(_0xb809('0x11'));var toCsv=require('to-csv');var querystring=require(_0xb809('0x12'));var Papa=require(_0xb809('0x13'));var Redis=require(_0xb809('0x14'));var authService=require(_0xb809('0x15'));var qs=require(_0xb809('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb809('0x17'));var logger=require(_0xb809('0x18'))(_0xb809('0x19'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xb809('0x1a'));var db=require(_0xb809('0x1b'))['db'];function respondWithStatusCode(_0x1fc94b,_0x466bf6){_0x466bf6=_0x466bf6||0xcc;return function(_0x27b54a){if(_0x27b54a){return _0x1fc94b[_0xb809('0x1c')](_0x466bf6);}return _0x1fc94b['status'](_0x466bf6)[_0xb809('0x1d')]();};}function respondWithResult(_0x5872f6,_0x17dd63){_0x17dd63=_0x17dd63||0xc8;return function(_0x3f60ce){if(_0x3f60ce){return _0x5872f6['status'](_0x17dd63)['json'](_0x3f60ce);}};}function respondWithFilteredResult(_0x2da302,_0xec3e2){return function(_0x1bdb4c){if(_0x1bdb4c){var _0x443bf1=typeof _0xec3e2[_0xb809('0x1e')]===_0xb809('0x1f')&&typeof _0xec3e2['limit']===_0xb809('0x1f');var _0x122afb=_0x1bdb4c['count'];var _0x45f348=_0x443bf1?0x0:_0xec3e2[_0xb809('0x1e')];var _0x103a8e=_0x443bf1?_0x1bdb4c[_0xb809('0x20')]:_0xec3e2[_0xb809('0x1e')]+_0xec3e2[_0xb809('0x21')];var _0x4f0455;if(_0x103a8e>=_0x122afb){_0x103a8e=_0x122afb;_0x4f0455=0xc8;}else{_0x4f0455=0xce;}_0x2da302[_0xb809('0x22')](_0x4f0455);return _0x2da302[_0xb809('0x23')](_0xb809('0x24'),_0x45f348+'-'+_0x103a8e+'/'+_0x122afb)['json'](_0x1bdb4c);}return null;};}function patchUpdates(_0x42caad){return function(_0x2db5d9){try{jsonpatch[_0xb809('0x25')](_0x2db5d9,_0x42caad,!![]);}catch(_0x48a7f3){return BPromise[_0xb809('0x26')](_0x48a7f3);}return _0x2db5d9[_0xb809('0x27')]();};}function saveUpdates(_0x537135,_0x4e452d){return function(_0x19f354){if(_0x19f354){return _0x19f354[_0xb809('0x28')](_0x537135)['then'](function(_0x50217a){return _0x50217a;});}return null;};}function removeEntity(_0x4e7aa2,_0x4b792b){return function(_0x2a3f7f){if(_0x2a3f7f){return _0x2a3f7f[_0xb809('0x29')]()[_0xb809('0x2a')](function(){_0x4e7aa2[_0xb809('0x22')](0xcc)[_0xb809('0x1d')]();});}};}function handleEntityNotFound(_0x4bbc77,_0x4c0f26){return function(_0x494b78){if(!_0x494b78){_0x4bbc77[_0xb809('0x1c')](0x194);}return _0x494b78;};}function handleError(_0x41fb9f,_0x5051f8){_0x5051f8=_0x5051f8||0x1f4;return function(_0x24b492){logger[_0xb809('0x2b')](_0x24b492[_0xb809('0x2c')]);if(_0x24b492[_0xb809('0x2d')]){delete _0x24b492['name'];}_0x41fb9f['status'](_0x5051f8)[_0xb809('0x2e')](_0x24b492);};}exports[_0xb809('0x2f')]=function(_0xe515a8,_0x1dd256){var _0x24cd13={},_0x4fc8a9={},_0x1ed851={'count':0x0,'rows':[]};var _0x36ee2b=_[_0xb809('0x30')](db[_0xb809('0x31')]['rawAttributes'],function(_0x5aa0d4){return{'name':_0x5aa0d4[_0xb809('0x32')],'type':_0x5aa0d4[_0xb809('0x33')]['key']};});_0x4fc8a9[_0xb809('0x34')]=_['map'](_0x36ee2b,'name');_0x4fc8a9[_0xb809('0x35')]=_[_0xb809('0x36')](_0xe515a8[_0xb809('0x35')]);_0x4fc8a9[_0xb809('0x37')]=_[_0xb809('0x38')](_0x4fc8a9[_0xb809('0x34')],_0x4fc8a9[_0xb809('0x35')]);_0x24cd13[_0xb809('0x39')]=_[_0xb809('0x38')](_0x4fc8a9[_0xb809('0x34')],qs[_0xb809('0x3a')](_0xe515a8[_0xb809('0x35')]['fields']));_0x24cd13[_0xb809('0x39')]=_0x24cd13['attributes'][_0xb809('0x3b')]?_0x24cd13['attributes']:_0x4fc8a9['model'];if(!_0xe515a8[_0xb809('0x35')][_0xb809('0x3c')]('nolimit')){_0x24cd13['limit']=qs[_0xb809('0x21')](_0xe515a8[_0xb809('0x35')]['limit']);_0x24cd13[_0xb809('0x1e')]=qs[_0xb809('0x1e')](_0xe515a8[_0xb809('0x35')]['offset']);}_0x24cd13[_0xb809('0x3d')]=qs['sort'](_0xe515a8[_0xb809('0x35')][_0xb809('0x3e')]);_0x24cd13[_0xb809('0x3f')]=qs['filters'](_[_0xb809('0x40')](_0xe515a8['query'],_0x4fc8a9[_0xb809('0x37')]),_0x36ee2b);if(_0xe515a8[_0xb809('0x35')]['filter']){_0x24cd13[_0xb809('0x3f')]=_[_0xb809('0x41')](_0x24cd13['where'],{'$or':_['map'](_0x36ee2b,function(_0x2ec431){if(_0x2ec431['type']!==_0xb809('0x42')){var _0x3beea0={};_0x3beea0[_0x2ec431[_0xb809('0x2d')]]={'$like':'%'+_0xe515a8[_0xb809('0x35')][_0xb809('0x43')]+'%'};return _0x3beea0;}})});}_0x24cd13=_['merge']({},_0x24cd13,_0xe515a8[_0xb809('0x44')]);var _0x239c65={'where':_0x24cd13[_0xb809('0x3f')]};return db['SmsApplication']['count'](_0x239c65)['then'](function(_0x5a1dff){_0x1ed851[_0xb809('0x20')]=_0x5a1dff;if(_0xe515a8['query']['includeAll']){_0x24cd13[_0xb809('0x45')]=[{'all':!![]}];}return db[_0xb809('0x31')][_0xb809('0x46')](_0x24cd13);})[_0xb809('0x2a')](function(_0x29152a){_0x1ed851[_0xb809('0x47')]=_0x29152a;return _0x1ed851;})[_0xb809('0x2a')](respondWithFilteredResult(_0x1dd256,_0x24cd13))['catch'](handleError(_0x1dd256,null));};exports[_0xb809('0x48')]=function(_0x83d7de,_0x2a817a){var _0x4587c0={'raw':!![],'where':{'id':_0x83d7de[_0xb809('0x49')]['id']}},_0x15ccc4={};_0x15ccc4['model']=_[_0xb809('0x36')](db[_0xb809('0x31')][_0xb809('0x4a')]);_0x15ccc4[_0xb809('0x35')]=_['keys'](_0x83d7de['query']);_0x15ccc4[_0xb809('0x37')]=_[_0xb809('0x38')](_0x15ccc4['model'],_0x15ccc4[_0xb809('0x35')]);_0x4587c0[_0xb809('0x39')]=_[_0xb809('0x38')](_0x15ccc4[_0xb809('0x34')],qs['fields'](_0x83d7de['query']['fields']));_0x4587c0[_0xb809('0x39')]=_0x4587c0[_0xb809('0x39')][_0xb809('0x3b')]?_0x4587c0[_0xb809('0x39')]:_0x15ccc4[_0xb809('0x34')];if(_0x83d7de[_0xb809('0x35')][_0xb809('0x4b')]){_0x4587c0[_0xb809('0x45')]=[{'all':!![]}];}_0x4587c0=_[_0xb809('0x41')]({},_0x4587c0,_0x83d7de['options']);return db[_0xb809('0x31')][_0xb809('0x4c')](_0x4587c0)[_0xb809('0x2a')](handleEntityNotFound(_0x2a817a,null))[_0xb809('0x2a')](respondWithResult(_0x2a817a,null))['catch'](handleError(_0x2a817a,null));};exports[_0xb809('0x4d')]=function(_0x702e66,_0xb6fede){return db[_0xb809('0x31')][_0xb809('0x4d')](_0x702e66[_0xb809('0x4e')],{})['then'](respondWithResult(_0xb6fede,0xc9))[_0xb809('0x4f')](handleError(_0xb6fede,null));};exports[_0xb809('0x28')]=function(_0x3dcfae,_0x8f90d4){if(_0x3dcfae['body']['id']){delete _0x3dcfae['body']['id'];}return db[_0xb809('0x31')][_0xb809('0x4c')]({'where':{'id':_0x3dcfae[_0xb809('0x49')]['id']}})[_0xb809('0x2a')](handleEntityNotFound(_0x8f90d4,null))[_0xb809('0x2a')](saveUpdates(_0x3dcfae[_0xb809('0x4e')],null))['then'](respondWithResult(_0x8f90d4,null))[_0xb809('0x4f')](handleError(_0x8f90d4,null));};exports[_0xb809('0x29')]=function(_0xd112cb,_0x5df0f){return db['SmsApplication']['find']({'where':{'id':_0xd112cb['params']['id']}})[_0xb809('0x2a')](handleEntityNotFound(_0x5df0f,null))[_0xb809('0x2a')](removeEntity(_0x5df0f,null))[_0xb809('0x4f')](handleError(_0x5df0f,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index 03a4215..0fb669a 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 _0x049e=['../../config/environment','./smsApplication.attributes','exports','define','utf8mb4','utf8mb4_unicode_ci','lodash','api','moment','request-promise','path','rimraf'];(function(_0x298064,_0x1d2bfb){var _0x2512ea=function(_0x3e5b28){while(--_0x3e5b28){_0x298064['push'](_0x298064['shift']());}};_0x2512ea(++_0x1d2bfb);}(_0x049e,0x72));var _0xe049=function(_0x3c04ef,_0x9d110c){_0x3c04ef=_0x3c04ef-0x0;var _0x6a3a69=_0x049e[_0x3c04ef];return _0x6a3a69;};'use strict';var _=require(_0xe049('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xe049('0x1'));var moment=require(_0xe049('0x2'));var BPromise=require('bluebird');var rp=require(_0xe049('0x3'));var fs=require('fs');var path=require(_0xe049('0x4'));var rimraf=require(_0xe049('0x5'));var config=require(_0xe049('0x6'));var attributes=require(_0xe049('0x7'));module[_0xe049('0x8')]=function(_0x318f75,_0x3f7fc2){return _0x318f75[_0xe049('0x9')]('SmsApplication',attributes,{'tableName':'sms_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe049('0xa'),'collate':_0xe049('0xb')});}; \ No newline at end of file +var _0x08ab=['sms_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsApplication.attributes','exports','define','SmsApplication'];(function(_0x4a0e21,_0x2f99b5){var _0x571cfe=function(_0xafd3f9){while(--_0xafd3f9){_0x4a0e21['push'](_0x4a0e21['shift']());}};_0x571cfe(++_0x2f99b5);}(_0x08ab,0x173));var _0xb08a=function(_0xd4477e,_0xe29d1d){_0xd4477e=_0xd4477e-0x0;var _0x1f992c=_0x08ab[_0xd4477e];return _0x1f992c;};'use strict';var _=require(_0xb08a('0x0'));var util=require(_0xb08a('0x1'));var logger=require(_0xb08a('0x2'))('api');var moment=require(_0xb08a('0x3'));var BPromise=require(_0xb08a('0x4'));var rp=require(_0xb08a('0x5'));var fs=require('fs');var path=require(_0xb08a('0x6'));var rimraf=require(_0xb08a('0x7'));var config=require(_0xb08a('0x8'));var attributes=require(_0xb08a('0x9'));module[_0xb08a('0xa')]=function(_0x45b97f,_0x1a60f3){return _0x45b97f[_0xb08a('0xb')](_0xb08a('0xc'),attributes,{'tableName':_0xb08a('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb08a('0xe'),'collate':_0xb08a('0xf')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index da413c9..4c9ed2f 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 _0x16a2=['error','message','info','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','SmsApplication,\x20%s,\x20%s','request\x20sent','SmsApplication,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x412f14,_0x33a6ec){var _0x5f2e57=function(_0x456f4a){while(--_0x456f4a){_0x412f14['push'](_0x412f14['shift']());}};_0x5f2e57(++_0x33a6ec);}(_0x16a2,0x1d0));var _0x216a=function(_0x3de8a4,_0x289a5c){_0x3de8a4=_0x3de8a4-0x0;var _0x4635cf=_0x16a2[_0x3de8a4];return _0x4635cf;};'use strict';var _=require(_0x216a('0x0'));var util=require(_0x216a('0x1'));var moment=require(_0x216a('0x2'));var BPromise=require(_0x216a('0x3'));var rs=require(_0x216a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x216a('0x5'));var logger=require(_0x216a('0x6'))(_0x216a('0x7'));var config=require(_0x216a('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x216a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x6dbac7,_0x2dd88c,_0x55f347){return new BPromise(function(_0xf619f8,_0x20e3f7){return client[_0x216a('0xa')](_0x6dbac7,_0x55f347)[_0x216a('0xb')](function(_0x4ce00d){logger['info'](_0x216a('0xc'),_0x2dd88c,_0x216a('0xd'));logger['debug'](_0x216a('0xe'),_0x2dd88c,_0x216a('0xd'),JSON[_0x216a('0xf')](_0x4ce00d));if(_0x4ce00d[_0x216a('0x10')]){if(_0x4ce00d[_0x216a('0x10')]['code']===0x1f4){logger[_0x216a('0x10')](_0x216a('0xc'),_0x2dd88c,_0x4ce00d['error'][_0x216a('0x11')]);return _0x20e3f7(_0x4ce00d[_0x216a('0x10')]['message']);}logger[_0x216a('0x10')](_0x216a('0xc'),_0x2dd88c,_0x4ce00d['error'][_0x216a('0x11')]);return _0xf619f8(_0x4ce00d['error'][_0x216a('0x11')]);}else{logger[_0x216a('0x12')](_0x216a('0xc'),_0x2dd88c,_0x216a('0xd'));_0xf619f8(_0x4ce00d['result'][_0x216a('0x11')]);}})[_0x216a('0x13')](function(_0x4c1a4d){logger[_0x216a('0x10')]('SmsApplication,\x20%s,\x20%s',_0x2dd88c,_0x4c1a4d);_0x20e3f7(_0x4c1a4d);});});} \ No newline at end of file +var _0xeba2=['result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','request','then','info','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0xd336fa,_0x39d1b2){var _0x3370b1=function(_0x41c5cc){while(--_0x41c5cc){_0xd336fa['push'](_0xd336fa['shift']());}};_0x3370b1(++_0x39d1b2);}(_0xeba2,0x70));var _0x2eba=function(_0x421263,_0x18187d){_0x421263=_0x421263-0x0;var _0x34e4b5=_0xeba2[_0x421263];return _0x34e4b5;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x2eba('0x0'));var BPromise=require(_0x2eba('0x1'));var rs=require(_0x2eba('0x2'));var fs=require('fs');var Redis=require(_0x2eba('0x3'));var db=require(_0x2eba('0x4'))['db'];var utils=require(_0x2eba('0x5'));var logger=require(_0x2eba('0x6'))(_0x2eba('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x2eba('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1b4d9a,_0x14c40a,_0x4e7a50){return new BPromise(function(_0x279806,_0x1fed79){return client[_0x2eba('0x9')](_0x1b4d9a,_0x4e7a50)[_0x2eba('0xa')](function(_0x1cc4e){logger[_0x2eba('0xb')](_0x2eba('0xc'),_0x14c40a,_0x2eba('0xd'));logger[_0x2eba('0xe')](_0x2eba('0xf'),_0x14c40a,'request\x20sent',JSON[_0x2eba('0x10')](_0x1cc4e));if(_0x1cc4e[_0x2eba('0x11')]){if(_0x1cc4e['error'][_0x2eba('0x12')]===0x1f4){logger[_0x2eba('0x11')](_0x2eba('0xc'),_0x14c40a,_0x1cc4e[_0x2eba('0x11')][_0x2eba('0x13')]);return _0x1fed79(_0x1cc4e[_0x2eba('0x11')][_0x2eba('0x13')]);}logger['error']('SmsApplication,\x20%s,\x20%s',_0x14c40a,_0x1cc4e[_0x2eba('0x11')][_0x2eba('0x13')]);return _0x279806(_0x1cc4e[_0x2eba('0x11')][_0x2eba('0x13')]);}else{logger[_0x2eba('0xb')]('SmsApplication,\x20%s,\x20%s',_0x14c40a,_0x2eba('0xd'));_0x279806(_0x1cc4e[_0x2eba('0x14')][_0x2eba('0x13')]);}})[_0x2eba('0x15')](function(_0x2de66e){logger['error'](_0x2eba('0xc'),_0x14c40a,_0x2de66e);_0x1fed79(_0x2de66e);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index 13deb11..7809c9a 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 _0x0972=['tracked','sms','addTags','put','update','delete','smsinteraction:destroy','destroy','removeTags','exports','util','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','isAuthenticated','index','describe','/:id','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags'];(function(_0x588685,_0x4ef83b){var _0x1aff13=function(_0x14271f){while(--_0x14271f){_0x588685['push'](_0x588685['shift']());}};_0x1aff13(++_0x4ef83b);}(_0x0972,0x64));var _0x2097=function(_0x13413b,_0x438ef7){_0x13413b=_0x13413b-0x0;var _0x19bd5f=_0x0972[_0x13413b];return _0x19bd5f;};'use strict';var multer=require('multer');var util=require(_0x2097('0x0'));var path=require('path');var timeout=require(_0x2097('0x1'));var express=require('express');var router=express[_0x2097('0x2')]();var fs_extra=require(_0x2097('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x2097('0x4'));var config=require(_0x2097('0x5'));var controller=require(_0x2097('0x6'));router[_0x2097('0x7')]('/',auth[_0x2097('0x8')](),controller[_0x2097('0x9')]);router[_0x2097('0x7')]('/describe',auth[_0x2097('0x8')](),controller[_0x2097('0xa')]);router[_0x2097('0x7')](_0x2097('0xb'),auth[_0x2097('0x8')](),controller['show']);router[_0x2097('0x7')](_0x2097('0xc'),auth[_0x2097('0x8')](),controller[_0x2097('0xd')]);router[_0x2097('0x7')](_0x2097('0xe'),auth[_0x2097('0x8')](),controller[_0x2097('0xf')]);router[_0x2097('0x10')]('/',auth[_0x2097('0x8')](),controller[_0x2097('0x11')]);router[_0x2097('0x10')](_0x2097('0xc'),auth[_0x2097('0x8')](),controller[_0x2097('0x12')]);router[_0x2097('0x10')](_0x2097('0x13'),auth[_0x2097('0x8')](),interaction[_0x2097('0x14')](_0x2097('0x15'),'smsinteraction:addtags'),controller[_0x2097('0x16')]);router[_0x2097('0x17')]('/:id',auth['isAuthenticated'](),interaction['tracked'](_0x2097('0x15'),'smsinteraction:update'),controller[_0x2097('0x18')]);router[_0x2097('0x19')](_0x2097('0xb'),auth[_0x2097('0x8')](),interaction[_0x2097('0x14')]('sms',_0x2097('0x1a')),controller[_0x2097('0x1b')]);router[_0x2097('0x19')](_0x2097('0x13'),auth[_0x2097('0x8')](),controller[_0x2097('0x1c')]);module[_0x2097('0x1d')]=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(_0x266618,_0x18f637){var _0x54dbf5=function(_0x1f7985){while(--_0x1f7985){_0x266618['push'](_0x266618['shift']());}};_0x54dbf5(++_0x18f637);}(_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 ab4a757..68155db 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 _0x3070=['DATE','STRING','ENUM','out','INTEGER','moment','BOOLEAN'];(function(_0x36ffee,_0xf8e8f7){var _0x43a33a=function(_0x18b1f6){while(--_0x18b1f6){_0x36ffee['push'](_0x36ffee['shift']());}};_0x43a33a(++_0xf8e8f7);}(_0x3070,0x75));var _0x0307=function(_0x3cd34b,_0x16e91a){_0x3cd34b=_0x3cd34b-0x0;var _0x2b7a72=_0x3070[_0x3cd34b];return _0x2b7a72;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x0307('0x0'));module['exports']={'closed':{'type':Sequelize[_0x0307('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x0307('0x2')]},'disposition':{'type':Sequelize[_0x0307('0x3')]},'secondDisposition':{'type':Sequelize[_0x0307('0x3')]},'thirdDisposition':{'type':Sequelize[_0x0307('0x3')]},'note':{'type':Sequelize[_0x0307('0x3')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x0307('0x4')]('in',_0x0307('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x0307('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x0307('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x0307('0x1')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x0307('0x6')]}}; \ No newline at end of file +var _0xc2c7=['STRING','ENUM','out','INTEGER','moment','exports','BOOLEAN','DATE'];(function(_0x5eb22e,_0x27cbac){var _0x27fed5=function(_0x565467){while(--_0x565467){_0x5eb22e['push'](_0x5eb22e['shift']());}};_0x27fed5(++_0x27cbac);}(_0xc2c7,0x134));var _0x7c2c=function(_0x367dc3,_0x52ec80){_0x367dc3=_0x367dc3-0x0;var _0x8e315=_0xc2c7[_0x367dc3];return _0x8e315;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x7c2c('0x0'));module[_0x7c2c('0x1')]={'closed':{'type':Sequelize[_0x7c2c('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x7c2c('0x3')]},'disposition':{'type':Sequelize[_0x7c2c('0x4')]},'secondDisposition':{'type':Sequelize[_0x7c2c('0x4')]},'thirdDisposition':{'type':Sequelize[_0x7c2c('0x4')]},'note':{'type':Sequelize[_0x7c2c('0x4')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x7c2c('0x5')]('in',_0x7c2c('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x7c2c('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueId':{'type':Sequelize[_0x7c2c('0x7')]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index 094f9dc..ef82b6e 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 _0x5423=['ids','omit','getMessages','hasOwnProperty','nolimit','sort','where','pick','SmsInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','SmsMessage','setTags','spread','color','emit','smsInteractionTags:save','removeTags','download','unix','toString','join','root','server','files','format','push','User','fullname','firstName','lastName','createdAt','direction','secret','read','SmsAccount','Account','Owner','mkdirSync','N.A.','closed','closedAt','disposition','out','System','Contact','value','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','err','rimraf','moment','bluebird','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','then','destroy','error','stack','name','index','map','SmsInteraction','rawAttributes','fieldName','key','findAll','sms','catch','show','params','model','keys','query','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','create','update','body','describe','addMessage'];(function(_0x26d219,_0x595708){var _0x3128f2=function(_0x537834){while(--_0x537834){_0x26d219['push'](_0x26d219['shift']());}};_0x3128f2(++_0x595708);}(_0x5423,0x19c));var _0x3542=function(_0x35ef4c,_0x561012){_0x35ef4c=_0x35ef4c-0x0;var _0x46998b=_0x5423[_0x35ef4c];return _0x46998b;};'use strict';var rimraf=require(_0x3542('0x0'));var zipdir=require('zip-dir');var moment=require(_0x3542('0x1'));var BPromise=require(_0x3542('0x2'));var util=require(_0x3542('0x3'));var path=require(_0x3542('0x4'));var ejs=require(_0x3542('0x5'));var fs=require('fs');var _=require(_0x3542('0x6'));var Redis=require(_0x3542('0x7'));var interaction=require(_0x3542('0x8'));var qs=require(_0x3542('0x9'));var pdf=require(_0x3542('0xa'));var logger=require('../../config/logger')(_0x3542('0xb'));var config=require(_0x3542('0xc'));var db=require(_0x3542('0xd'))['db'];config[_0x3542('0xe')]=_[_0x3542('0xf')](config[_0x3542('0xe')],{'host':_0x3542('0x10'),'port':0x18eb});var socket=require(_0x3542('0x11'))(new Redis(config[_0x3542('0xe')]));require(_0x3542('0x12'))[_0x3542('0x13')](socket);function respondWithStatusCode(_0x3e0f4c,_0x4cdfe7){_0x4cdfe7=_0x4cdfe7||0xcc;return function(_0x417190){if(_0x417190){return _0x3e0f4c[_0x3542('0x14')](_0x4cdfe7);}return _0x3e0f4c[_0x3542('0x15')](_0x4cdfe7)[_0x3542('0x16')]();};}function respondWithResult(_0xb42657,_0x1ad16d){_0x1ad16d=_0x1ad16d||0xc8;return function(_0x29efa1){if(_0x29efa1){return _0xb42657[_0x3542('0x15')](_0x1ad16d)[_0x3542('0x17')](_0x29efa1);}};}function respondWithFilteredResult(_0x283d7d,_0x1819a8){return function(_0x244642){if(_0x244642){var _0x2fe399=typeof _0x1819a8[_0x3542('0x18')]===_0x3542('0x19')&&typeof _0x1819a8[_0x3542('0x1a')]===_0x3542('0x19');var _0x3c6835=_0x244642[_0x3542('0x1b')];var _0xcae25e=_0x2fe399?0x0:_0x1819a8['offset'];var _0x349d4b=_0x2fe399?_0x244642[_0x3542('0x1b')]:_0x1819a8['offset']+_0x1819a8['limit'];var _0x3dae83;if(_0x349d4b>=_0x3c6835){_0x349d4b=_0x3c6835;_0x3dae83=0xc8;}else{_0x3dae83=0xce;}_0x283d7d[_0x3542('0x15')](_0x3dae83);return _0x283d7d[_0x3542('0x1c')](_0x3542('0x1d'),_0xcae25e+'-'+_0x349d4b+'/'+_0x3c6835)[_0x3542('0x17')](_0x244642);}return null;};}function saveUpdates(_0x1e59b3){return function(_0x1555e6){if(_0x1555e6){return _0x1555e6['update'](_0x1e59b3)[_0x3542('0x1e')](function(_0x449cf0){return _0x449cf0;});}return null;};}function removeEntity(_0x31aac7){return function(_0x2dd095){if(_0x2dd095){return _0x2dd095[_0x3542('0x1f')]()[_0x3542('0x1e')](function(){_0x31aac7[_0x3542('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5ed858){return function(_0x5f4ab0){if(!_0x5f4ab0){_0x5ed858['sendStatus'](0x194);}return _0x5f4ab0;};}function handleError(_0x5253e1,_0x30fbf7){_0x30fbf7=_0x30fbf7||0x1f4;return function(_0x405599){logger[_0x3542('0x20')](_0x405599[_0x3542('0x21')]);if(_0x405599['name']){delete _0x405599[_0x3542('0x22')];}_0x5253e1[_0x3542('0x15')](_0x30fbf7)['send'](_0x405599);};}exports[_0x3542('0x23')]=function(_0x47035c,_0x1dcb43){var _0x589aa1={};var _0x4ca952=_[_0x3542('0x24')](db[_0x3542('0x25')][_0x3542('0x26')],function(_0x59c12f){return{'name':_0x59c12f[_0x3542('0x27')],'type':_0x59c12f['type'][_0x3542('0x28')]};});_0x589aa1=qs['getOptions'](_0x4ca952,_0x47035c);return interaction[_0x3542('0x29')](_0x3542('0x2a'),_0x47035c['query'],_0x47035c['user'],_0x589aa1,_0x4ca952)['then'](respondWithFilteredResult(_0x1dcb43,_0x589aa1))[_0x3542('0x2b')](handleError(_0x1dcb43,null));};exports[_0x3542('0x2c')]=function(_0x4abaa9,_0x3694db){var _0x278477={'raw':![],'where':{'id':_0x4abaa9[_0x3542('0x2d')]['id']}},_0x3b47ed={};_0x3b47ed[_0x3542('0x2e')]=_[_0x3542('0x2f')](db['SmsInteraction']['rawAttributes']);_0x3b47ed[_0x3542('0x30')]=_['keys'](_0x4abaa9[_0x3542('0x30')]);_0x3b47ed[_0x3542('0x31')]=_[_0x3542('0x32')](_0x3b47ed[_0x3542('0x2e')],_0x3b47ed[_0x3542('0x30')]);_0x278477[_0x3542('0x33')]=_[_0x3542('0x32')](_0x3b47ed[_0x3542('0x2e')],qs['fields'](_0x4abaa9[_0x3542('0x30')][_0x3542('0x34')]));_0x278477[_0x3542('0x33')]=_0x278477[_0x3542('0x33')][_0x3542('0x35')]?_0x278477['attributes']:_0x3b47ed[_0x3542('0x2e')];if(_0x4abaa9['query'][_0x3542('0x36')]){_0x278477[_0x3542('0x37')]=[{'all':!![]}];}_0x278477=_[_0x3542('0x38')]({},_0x278477,_0x4abaa9[_0x3542('0x39')]);return db[_0x3542('0x25')][_0x3542('0x3a')](_0x278477)[_0x3542('0x1e')](handleEntityNotFound(_0x3694db,null))[_0x3542('0x1e')](respondWithResult(_0x3694db,null))[_0x3542('0x2b')](handleError(_0x3694db,null));};exports[_0x3542('0x3b')]=function(_0x522e14,_0x15d404){return db[_0x3542('0x25')]['create'](_0x522e14['body'],{})[_0x3542('0x1e')](respondWithResult(_0x15d404,0xc9))[_0x3542('0x2b')](handleError(_0x15d404,null));};exports[_0x3542('0x3c')]=function(_0x440f07,_0x48920c){if(_0x440f07['body']['id']){delete _0x440f07[_0x3542('0x3d')]['id'];}return db['SmsInteraction']['find']({'where':{'id':_0x440f07['params']['id']}})[_0x3542('0x1e')](handleEntityNotFound(_0x48920c,null))[_0x3542('0x1e')](saveUpdates(_0x440f07[_0x3542('0x3d')],null))[_0x3542('0x1e')](respondWithResult(_0x48920c,null))['catch'](handleError(_0x48920c,null));};exports[_0x3542('0x1f')]=function(_0x1ef6b7,_0x3c13d5){return db['SmsInteraction'][_0x3542('0x3a')]({'where':{'id':_0x1ef6b7['params']['id']}})[_0x3542('0x1e')](handleEntityNotFound(_0x3c13d5,null))[_0x3542('0x1e')](removeEntity(_0x3c13d5,null))[_0x3542('0x2b')](handleError(_0x3c13d5,null));};exports[_0x3542('0x3e')]=function(_0x472c0b,_0xa83995){return db['SmsInteraction']['describe']()['then'](respondWithResult(_0xa83995,null))['catch'](handleError(_0xa83995,null));};exports[_0x3542('0x3f')]=function(_0x24a2a0,_0x5df376){return db['SmsMessage']['find']({'where':{'id':_0x24a2a0['params']['id']}})[_0x3542('0x1e')](handleEntityNotFound(_0x5df376,null))[_0x3542('0x1e')](function(_0x191d5a){if(_0x191d5a){return _0x191d5a[_0x3542('0x3f')](_0x24a2a0['body'][_0x3542('0x40')],_[_0x3542('0x41')](_0x24a2a0[_0x3542('0x3d')],['ids','id'])||{});}})[_0x3542('0x1e')](respondWithResult(_0x5df376,null))[_0x3542('0x2b')](handleError(_0x5df376,null));};exports[_0x3542('0x42')]=function(_0x51dae3,_0x1e5bf9){var _0x3835ca={'raw':![],'where':{}};var _0x1599a1={};var _0x51a807={'count':0x0,'rows':[]};return db[_0x3542('0x25')]['findOne']({'where':{'id':_0x51dae3[_0x3542('0x2d')]['id']}})['then'](handleEntityNotFound(_0x1e5bf9,null))[_0x3542('0x1e')](function(_0x39f4b1){if(_0x39f4b1){_0x1599a1['model']=_['keys'](db['SmsMessage'][_0x3542('0x26')]);_0x1599a1[_0x3542('0x30')]=_[_0x3542('0x2f')](_0x51dae3[_0x3542('0x30')]);_0x1599a1[_0x3542('0x31')]=_['intersection'](_0x1599a1[_0x3542('0x2e')],_0x1599a1['query']);_0x3835ca[_0x3542('0x33')]=_[_0x3542('0x32')](_0x1599a1[_0x3542('0x2e')],qs[_0x3542('0x34')](_0x51dae3['query'][_0x3542('0x34')]));_0x3835ca[_0x3542('0x33')]=_0x3835ca[_0x3542('0x33')][_0x3542('0x35')]?_0x3835ca[_0x3542('0x33')]:_0x1599a1[_0x3542('0x2e')];if(!_0x51dae3[_0x3542('0x30')][_0x3542('0x43')](_0x3542('0x44'))){_0x3835ca[_0x3542('0x1a')]=qs[_0x3542('0x1a')](_0x51dae3['query']['limit']);_0x3835ca['offset']=qs[_0x3542('0x18')](_0x51dae3['query'][_0x3542('0x18')]);}_0x3835ca['order']=qs['sort'](_0x51dae3[_0x3542('0x30')][_0x3542('0x45')]);_0x3835ca[_0x3542('0x46')]=qs['filters'](_[_0x3542('0x47')](_0x51dae3[_0x3542('0x30')],_0x1599a1[_0x3542('0x31')]));_0x3835ca[_0x3542('0x46')][_0x3542('0x48')]=_0x39f4b1['id'];if(_0x51dae3[_0x3542('0x30')][_0x3542('0x49')]){_0x3835ca[_0x3542('0x46')]=_[_0x3542('0x38')](_0x3835ca[_0x3542('0x46')],{'$or':_[_0x3542('0x24')](_0x3835ca[_0x3542('0x33')],function(_0xd9aded){var _0x37c172={};_0x37c172[_0xd9aded]={'$like':'%'+_0x51dae3[_0x3542('0x30')][_0x3542('0x49')]+'%'};return _0x37c172;})});}if(_0x51dae3[_0x3542('0x30')]['$gte']){var _0x1951a0=_0x51dae3[_0x3542('0x30')][_0x3542('0x4a')][_0x3542('0x4b')](',');var _0x2b6bdc={};_0x2b6bdc[_0x1951a0[0x0]]={'$gte':moment(_0x1951a0[0x1])['format'](_0x3542('0x4c'))};_0x3835ca[_0x3542('0x46')]=_['merge'](_0x3835ca['where'],_0x2b6bdc);}_0x3835ca=_['merge']({},_0x3835ca,_0x51dae3[_0x3542('0x39')]);return db['SmsMessage'][_0x3542('0x1b')]({'where':_0x3835ca[_0x3542('0x46')]})['then'](function(_0x27c79e){_0x51a807[_0x3542('0x1b')]=_0x27c79e;if(_0x51dae3[_0x3542('0x30')][_0x3542('0x36')]){_0x3835ca[_0x3542('0x37')]=[{'all':!![]}];}return db[_0x3542('0x4d')]['findAll'](_0x3835ca);})[_0x3542('0x1e')](function(_0x4519b8){_0x51a807['rows']=_0x4519b8;return _0x51a807;});}})[_0x3542('0x1e')](respondWithFilteredResult(_0x1e5bf9,_0x3835ca))[_0x3542('0x2b')](handleError(_0x1e5bf9,null));};exports['addTags']=function(_0x30104e,_0xb071ee){return db[_0x3542('0x25')][_0x3542('0x3a')]({'where':{'id':_0x30104e[_0x3542('0x2d')]['id']}})[_0x3542('0x1e')](handleEntityNotFound(_0xb071ee,null))[_0x3542('0x1e')](function(_0x432801){if(_0x432801){return _0x432801[_0x3542('0x4e')](_0x30104e[_0x3542('0x3d')]['ids'],_[_0x3542('0x41')](_0x30104e[_0x3542('0x3d')],[_0x3542('0x40'),'id'])||{})[_0x3542('0x4f')](function(){return db['Tag'][_0x3542('0x29')]({'attributes':['id',_0x3542('0x22'),_0x3542('0x50')],'where':{'id':_0x30104e[_0x3542('0x3d')][_0x3542('0x40')]}});})[_0x3542('0x1e')](function(_0x5252d2){socket[_0x3542('0x51')](_0x3542('0x52'),{'id':Number(_0x30104e['params']['id']),'tags':_0x5252d2||[]});return{'id':Number(_0x30104e[_0x3542('0x2d')]['id']),'tags':_0x5252d2||[]};});}})[_0x3542('0x1e')](respondWithResult(_0xb071ee,null))[_0x3542('0x2b')](handleError(_0xb071ee,null));};exports[_0x3542('0x53')]=function(_0x3eadfc,_0x405640){return db[_0x3542('0x25')]['find']({'where':{'id':_0x3eadfc[_0x3542('0x2d')]['id']}})['then'](handleEntityNotFound(_0x405640,null))[_0x3542('0x1e')](function(_0xae4cf){if(_0xae4cf){return _0xae4cf[_0x3542('0x53')](_0x3eadfc[_0x3542('0x30')][_0x3542('0x40')]);}})[_0x3542('0x1e')](respondWithStatusCode(_0x405640,null))['catch'](handleError(_0x405640,null));};exports[_0x3542('0x54')]=function(_0x5f1cec,_0x4285cd){var _0x3088af=moment()[_0x3542('0x55')]()[_0x3542('0x56')]();var _0x1563ed=path[_0x3542('0x57')](config[_0x3542('0x58')],_0x3542('0x59'),_0x3542('0x5a'),'tmp');var _0x274819=path['join'](_0x1563ed,_0x3088af);var _0x27abca=util[_0x3542('0x5b')]('transcript-%d-%s.zip',_0x5f1cec['params']['id'],_0x3088af);var _0x6b71db=path['join'](_0x1563ed,_0x27abca);var _0x8e9ac8=[];_0x8e9ac8[_0x3542('0x5c')]({'model':db[_0x3542('0x5d')],'as':_0x3542('0x5d'),'attributes':['id',_0x3542('0x5e')],'raw':!![]});_0x8e9ac8[_0x3542('0x5c')]({'model':db['CmContact'],'as':'Contact','attributes':['id',_0x3542('0x5f'),_0x3542('0x60')],'raw':!![]});var _0x2933f0=[{'model':db[_0x3542('0x4d')],'as':'Messages','attributes':['id','body',_0x3542('0x61'),_0x3542('0x62'),_0x3542('0x63'),_0x3542('0x64')],'include':_0x8e9ac8}];_0x2933f0[_0x3542('0x5c')]({'model':db[_0x3542('0x65')],'as':_0x3542('0x66'),'attributes':['id',_0x3542('0x22')]});_0x2933f0[_0x3542('0x5c')]({'model':db['User'],'as':_0x3542('0x67'),'attributes':['id',_0x3542('0x5e')]});return db[_0x3542('0x25')][_0x3542('0x3a')]({'where':{'id':_0x5f1cec[_0x3542('0x2d')]['id']},'include':_0x2933f0})[_0x3542('0x1e')](handleEntityNotFound(_0x4285cd,null))[_0x3542('0x1e')](function(_0x3cc484){if(_0x3cc484){var _0x25bc19=_0x3cc484['get']({'plain':!![]});fs[_0x3542('0x68')](_0x274819);var _0x2f06e4={'channel':'Sms','account':_0x25bc19[_0x3542('0x66')][_0x3542('0x22')],'agent':_0x25bc19[_0x3542('0x67')]?_0x25bc19[_0x3542('0x67')][_0x3542('0x5e')]:_0x3542('0x69'),'createdAt':moment(_0x25bc19['createdAt'])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x3542('0x56')](),'closedAt':_0x25bc19[_0x3542('0x6a')]?moment(_0x25bc19[_0x3542('0x6b')])[_0x3542('0x5b')](_0x3542('0x4c'))[_0x3542('0x56')]():'','disposition':_0x25bc19[_0x3542('0x6c')],'messages':_(_0x25bc19['Messages'])[_0x3542('0x49')]({'secret':![]})['map'](function(_0x26b92d){return{'date':moment(_0x26b92d[_0x3542('0x61')])[_0x3542('0x5b')](_0x3542('0x4c'))[_0x3542('0x56')](),'sender':_0x26b92d['direction']===_0x3542('0x6d')?_0x26b92d[_0x3542('0x5d')]?_0x26b92d[_0x3542('0x5d')][_0x3542('0x5e')]:_0x3542('0x6e'):_0x26b92d[_0x3542('0x6f')]['firstName']+(_0x26b92d[_0x3542('0x6f')][_0x3542('0x60')]?'\x20'+_0x26b92d[_0x3542('0x6f')]['lastName']:''),'body':_0x26b92d[_0x3542('0x3d')],'direction':_0x26b92d[_0x3542('0x62')]==='out'?'A':'C','secret':_0x26b92d[_0x3542('0x63')],'read':_0x26b92d[_0x3542('0x64')]};})[_0x3542('0x70')]()};return ejs[_0x3542('0x71')](path[_0x3542('0x57')](config[_0x3542('0x58')],_0x3542('0x59'),_0x3542('0x72'),_0x3542('0x73')),{'interaction':_0x2f06e4})['then'](function(_0x3b8776){var _0x377bce=path['join'](_0x274819,_0x3542('0x74')+_0x25bc19['id']+'-'+_0x3088af+_0x3542('0x75'));var _0x501277={'path':_0x377bce,'channel':'Sms','interactionId':_0x25bc19['id']};return pdf['createPdfFromHTML'](_0x3b8776,_0x501277);})['then'](function(){return new BPromise(function(_0x36119b,_0x148575){zipdir(_0x274819,{'saveTo':_0x6b71db},function(_0x51c9eb,_0x530aa5){if(_0x51c9eb)return _0x148575(_0x51c9eb);return _0x36119b(_0x530aa5);});})[_0x3542('0x1e')](function(){return new BPromise(function(_0x4e24dc,_0x29246e){rimraf(_0x274819,function(_0x442777){if(_0x442777)_0x29246e(_0x442777);return _0x4e24dc();});});})['then'](function(){return _0x4285cd[_0x3542('0x54')](_0x6b71db,_0x27abca,function(_0x8803d1){if(_0x8803d1){console['log'](_0x3542('0x76'),_0x8803d1);}else{fs['unlinkSync'](_0x6b71db);}});});});}else{return _0x4285cd[_0x3542('0x14')](0xc8);}})[_0x3542('0x2b')](handleError(_0x4285cd,null));}; \ No newline at end of file +var _0xc2fc=['sms','query','user','catch','show','params','model','keys','filters','attributes','intersection','fields','includeAll','include','options','SmsInteraction','find','create','update','body','describe','addMessage','SmsMessage','ids','omit','getMessages','length','hasOwnProperty','limit','order','where','pick','SmsInteractionId','filter','merge','split','format','YYYY-MM-DD\x20HH:mm:ss','rows','setTags','spread','Tag','color','emit','smsInteractionTags:save','removeTags','download','unix','toString','root','server','files','tmp','join','transcript-%d-%s.zip','push','fullname','CmContact','Contact','lastName','Messages','createdAt','secret','read','Account','User','get','mkdirSync','Sms','Owner','N.A.','closed','disposition','out','System','renderFile','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','unlinkSync','rimraf','zip-dir','moment','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./smsInteraction.socket','register','sendStatus','end','status','undefined','count','offset','set','json','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','key','getOptions','findAll'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0xc2fc,0x1b3));var _0xcc2f=function(_0xb0b95a,_0x3ca3b3){_0xb0b95a=_0xb0b95a-0x0;var _0x4fcfd0=_0xc2fc[_0xb0b95a];return _0x4fcfd0;};'use strict';var rimraf=require(_0xcc2f('0x0'));var zipdir=require(_0xcc2f('0x1'));var moment=require(_0xcc2f('0x2'));var BPromise=require('bluebird');var util=require('util');var path=require(_0xcc2f('0x3'));var ejs=require(_0xcc2f('0x4'));var fs=require('fs');var _=require(_0xcc2f('0x5'));var Redis=require(_0xcc2f('0x6'));var interaction=require(_0xcc2f('0x7'));var qs=require(_0xcc2f('0x8'));var pdf=require('../../components/export/pdf');var logger=require(_0xcc2f('0x9'))('api');var config=require(_0xcc2f('0xa'));var db=require(_0xcc2f('0xb'))['db'];config[_0xcc2f('0xc')]=_['defaults'](config[_0xcc2f('0xc')],{'host':_0xcc2f('0xd'),'port':0x18eb});var socket=require(_0xcc2f('0xe'))(new Redis(config[_0xcc2f('0xc')]));require(_0xcc2f('0xf'))[_0xcc2f('0x10')](socket);function respondWithStatusCode(_0x199da9,_0x495533){_0x495533=_0x495533||0xcc;return function(_0x38b2ec){if(_0x38b2ec){return _0x199da9[_0xcc2f('0x11')](_0x495533);}return _0x199da9['status'](_0x495533)[_0xcc2f('0x12')]();};}function respondWithResult(_0x386cee,_0x2481ec){_0x2481ec=_0x2481ec||0xc8;return function(_0x204354){if(_0x204354){return _0x386cee[_0xcc2f('0x13')](_0x2481ec)['json'](_0x204354);}};}function respondWithFilteredResult(_0x4d7610,_0x2e1993){return function(_0x201201){if(_0x201201){var _0x360c16=typeof _0x2e1993['offset']===_0xcc2f('0x14')&&typeof _0x2e1993['limit']==='undefined';var _0x1d246c=_0x201201[_0xcc2f('0x15')];var _0x3ae86a=_0x360c16?0x0:_0x2e1993[_0xcc2f('0x16')];var _0xb060c9=_0x360c16?_0x201201[_0xcc2f('0x15')]:_0x2e1993[_0xcc2f('0x16')]+_0x2e1993['limit'];var _0x264d4c;if(_0xb060c9>=_0x1d246c){_0xb060c9=_0x1d246c;_0x264d4c=0xc8;}else{_0x264d4c=0xce;}_0x4d7610[_0xcc2f('0x13')](_0x264d4c);return _0x4d7610[_0xcc2f('0x17')]('Content-Range',_0x3ae86a+'-'+_0xb060c9+'/'+_0x1d246c)[_0xcc2f('0x18')](_0x201201);}return null;};}function saveUpdates(_0x36db35){return function(_0x4d3317){if(_0x4d3317){return _0x4d3317['update'](_0x36db35)[_0xcc2f('0x19')](function(_0x43c9a6){return _0x43c9a6;});}return null;};}function removeEntity(_0x378ec1){return function(_0x1b882f){if(_0x1b882f){return _0x1b882f[_0xcc2f('0x1a')]()[_0xcc2f('0x19')](function(){_0x378ec1[_0xcc2f('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c71f6){return function(_0x213bf6){if(!_0x213bf6){_0x3c71f6['sendStatus'](0x194);}return _0x213bf6;};}function handleError(_0x1c355d,_0x37766b){_0x37766b=_0x37766b||0x1f4;return function(_0x21fc66){logger['error'](_0x21fc66[_0xcc2f('0x1b')]);if(_0x21fc66[_0xcc2f('0x1c')]){delete _0x21fc66[_0xcc2f('0x1c')];}_0x1c355d['status'](_0x37766b)[_0xcc2f('0x1d')](_0x21fc66);};}exports[_0xcc2f('0x1e')]=function(_0x1c668b,_0x15c6ae){var _0xc0f43f={};var _0x215880=_[_0xcc2f('0x1f')](db['SmsInteraction'][_0xcc2f('0x20')],function(_0x46d4c7){return{'name':_0x46d4c7[_0xcc2f('0x21')],'type':_0x46d4c7['type'][_0xcc2f('0x22')]};});_0xc0f43f=qs[_0xcc2f('0x23')](_0x215880,_0x1c668b);return interaction[_0xcc2f('0x24')](_0xcc2f('0x25'),_0x1c668b[_0xcc2f('0x26')],_0x1c668b[_0xcc2f('0x27')],_0xc0f43f,_0x215880)['then'](respondWithFilteredResult(_0x15c6ae,_0xc0f43f))[_0xcc2f('0x28')](handleError(_0x15c6ae,null));};exports[_0xcc2f('0x29')]=function(_0x214f9c,_0x4bbe24){var _0xb56ed7={'raw':![],'where':{'id':_0x214f9c[_0xcc2f('0x2a')]['id']}},_0x393189={};_0x393189[_0xcc2f('0x2b')]=_[_0xcc2f('0x2c')](db['SmsInteraction'][_0xcc2f('0x20')]);_0x393189['query']=_[_0xcc2f('0x2c')](_0x214f9c[_0xcc2f('0x26')]);_0x393189[_0xcc2f('0x2d')]=_['intersection'](_0x393189['model'],_0x393189['query']);_0xb56ed7[_0xcc2f('0x2e')]=_[_0xcc2f('0x2f')](_0x393189[_0xcc2f('0x2b')],qs[_0xcc2f('0x30')](_0x214f9c[_0xcc2f('0x26')]['fields']));_0xb56ed7[_0xcc2f('0x2e')]=_0xb56ed7['attributes']['length']?_0xb56ed7[_0xcc2f('0x2e')]:_0x393189['model'];if(_0x214f9c[_0xcc2f('0x26')][_0xcc2f('0x31')]){_0xb56ed7[_0xcc2f('0x32')]=[{'all':!![]}];}_0xb56ed7=_['merge']({},_0xb56ed7,_0x214f9c[_0xcc2f('0x33')]);return db[_0xcc2f('0x34')][_0xcc2f('0x35')](_0xb56ed7)['then'](handleEntityNotFound(_0x4bbe24,null))[_0xcc2f('0x19')](respondWithResult(_0x4bbe24,null))[_0xcc2f('0x28')](handleError(_0x4bbe24,null));};exports[_0xcc2f('0x36')]=function(_0x3b6e0f,_0x5bfd26){return db[_0xcc2f('0x34')][_0xcc2f('0x36')](_0x3b6e0f['body'],{})[_0xcc2f('0x19')](respondWithResult(_0x5bfd26,0xc9))[_0xcc2f('0x28')](handleError(_0x5bfd26,null));};exports[_0xcc2f('0x37')]=function(_0x1291da,_0x55e51a){if(_0x1291da[_0xcc2f('0x38')]['id']){delete _0x1291da['body']['id'];}return db[_0xcc2f('0x34')]['find']({'where':{'id':_0x1291da[_0xcc2f('0x2a')]['id']}})['then'](handleEntityNotFound(_0x55e51a,null))[_0xcc2f('0x19')](saveUpdates(_0x1291da[_0xcc2f('0x38')],null))[_0xcc2f('0x19')](respondWithResult(_0x55e51a,null))['catch'](handleError(_0x55e51a,null));};exports[_0xcc2f('0x1a')]=function(_0x23590e,_0x1abc5e){return db[_0xcc2f('0x34')][_0xcc2f('0x35')]({'where':{'id':_0x23590e[_0xcc2f('0x2a')]['id']}})[_0xcc2f('0x19')](handleEntityNotFound(_0x1abc5e,null))[_0xcc2f('0x19')](removeEntity(_0x1abc5e,null))[_0xcc2f('0x28')](handleError(_0x1abc5e,null));};exports[_0xcc2f('0x39')]=function(_0x30c1d0,_0x22db0f){return db[_0xcc2f('0x34')]['describe']()['then'](respondWithResult(_0x22db0f,null))[_0xcc2f('0x28')](handleError(_0x22db0f,null));};exports[_0xcc2f('0x3a')]=function(_0x5888f2,_0x543310){return db[_0xcc2f('0x3b')][_0xcc2f('0x35')]({'where':{'id':_0x5888f2[_0xcc2f('0x2a')]['id']}})['then'](handleEntityNotFound(_0x543310,null))[_0xcc2f('0x19')](function(_0x2ca8cd){if(_0x2ca8cd){return _0x2ca8cd[_0xcc2f('0x3a')](_0x5888f2[_0xcc2f('0x38')][_0xcc2f('0x3c')],_[_0xcc2f('0x3d')](_0x5888f2[_0xcc2f('0x38')],['ids','id'])||{});}})[_0xcc2f('0x19')](respondWithResult(_0x543310,null))[_0xcc2f('0x28')](handleError(_0x543310,null));};exports[_0xcc2f('0x3e')]=function(_0x209858,_0x49eb83){var _0x39f581={'raw':![],'where':{}};var _0xd666d0={};var _0x43d576={'count':0x0,'rows':[]};return db[_0xcc2f('0x34')]['findOne']({'where':{'id':_0x209858[_0xcc2f('0x2a')]['id']}})[_0xcc2f('0x19')](handleEntityNotFound(_0x49eb83,null))['then'](function(_0x2b6956){if(_0x2b6956){_0xd666d0[_0xcc2f('0x2b')]=_[_0xcc2f('0x2c')](db['SmsMessage'][_0xcc2f('0x20')]);_0xd666d0['query']=_[_0xcc2f('0x2c')](_0x209858['query']);_0xd666d0[_0xcc2f('0x2d')]=_[_0xcc2f('0x2f')](_0xd666d0[_0xcc2f('0x2b')],_0xd666d0[_0xcc2f('0x26')]);_0x39f581['attributes']=_[_0xcc2f('0x2f')](_0xd666d0['model'],qs[_0xcc2f('0x30')](_0x209858[_0xcc2f('0x26')][_0xcc2f('0x30')]));_0x39f581['attributes']=_0x39f581[_0xcc2f('0x2e')][_0xcc2f('0x3f')]?_0x39f581[_0xcc2f('0x2e')]:_0xd666d0[_0xcc2f('0x2b')];if(!_0x209858[_0xcc2f('0x26')][_0xcc2f('0x40')]('nolimit')){_0x39f581['limit']=qs[_0xcc2f('0x41')](_0x209858[_0xcc2f('0x26')][_0xcc2f('0x41')]);_0x39f581['offset']=qs[_0xcc2f('0x16')](_0x209858[_0xcc2f('0x26')]['offset']);}_0x39f581[_0xcc2f('0x42')]=qs['sort'](_0x209858[_0xcc2f('0x26')]['sort']);_0x39f581[_0xcc2f('0x43')]=qs['filters'](_[_0xcc2f('0x44')](_0x209858[_0xcc2f('0x26')],_0xd666d0[_0xcc2f('0x2d')]));_0x39f581[_0xcc2f('0x43')][_0xcc2f('0x45')]=_0x2b6956['id'];if(_0x209858[_0xcc2f('0x26')][_0xcc2f('0x46')]){_0x39f581['where']=_[_0xcc2f('0x47')](_0x39f581['where'],{'$or':_[_0xcc2f('0x1f')](_0x39f581[_0xcc2f('0x2e')],function(_0x1197f1){var _0x5442bd={};_0x5442bd[_0x1197f1]={'$like':'%'+_0x209858[_0xcc2f('0x26')]['filter']+'%'};return _0x5442bd;})});}if(_0x209858[_0xcc2f('0x26')]['$gte']){var _0x5ca308=_0x209858[_0xcc2f('0x26')]['$gte'][_0xcc2f('0x48')](',');var _0x204ffa={};_0x204ffa[_0x5ca308[0x0]]={'$gte':moment(_0x5ca308[0x1])[_0xcc2f('0x49')](_0xcc2f('0x4a'))};_0x39f581[_0xcc2f('0x43')]=_[_0xcc2f('0x47')](_0x39f581[_0xcc2f('0x43')],_0x204ffa);}_0x39f581=_[_0xcc2f('0x47')]({},_0x39f581,_0x209858[_0xcc2f('0x33')]);return db[_0xcc2f('0x3b')][_0xcc2f('0x15')]({'where':_0x39f581['where']})[_0xcc2f('0x19')](function(_0x3b83a0){_0x43d576['count']=_0x3b83a0;if(_0x209858['query']['includeAll']){_0x39f581[_0xcc2f('0x32')]=[{'all':!![]}];}return db['SmsMessage'][_0xcc2f('0x24')](_0x39f581);})[_0xcc2f('0x19')](function(_0x16c178){_0x43d576[_0xcc2f('0x4b')]=_0x16c178;return _0x43d576;});}})['then'](respondWithFilteredResult(_0x49eb83,_0x39f581))[_0xcc2f('0x28')](handleError(_0x49eb83,null));};exports['addTags']=function(_0x1799b4,_0x325e33){return db[_0xcc2f('0x34')]['find']({'where':{'id':_0x1799b4[_0xcc2f('0x2a')]['id']}})[_0xcc2f('0x19')](handleEntityNotFound(_0x325e33,null))[_0xcc2f('0x19')](function(_0x39b2d8){if(_0x39b2d8){return _0x39b2d8[_0xcc2f('0x4c')](_0x1799b4['body'][_0xcc2f('0x3c')],_[_0xcc2f('0x3d')](_0x1799b4[_0xcc2f('0x38')],['ids','id'])||{})[_0xcc2f('0x4d')](function(){return db[_0xcc2f('0x4e')][_0xcc2f('0x24')]({'attributes':['id',_0xcc2f('0x1c'),_0xcc2f('0x4f')],'where':{'id':_0x1799b4['body'][_0xcc2f('0x3c')]}});})[_0xcc2f('0x19')](function(_0x3e56cf){socket[_0xcc2f('0x50')](_0xcc2f('0x51'),{'id':Number(_0x1799b4['params']['id']),'tags':_0x3e56cf||[]});return{'id':Number(_0x1799b4['params']['id']),'tags':_0x3e56cf||[]};});}})[_0xcc2f('0x19')](respondWithResult(_0x325e33,null))['catch'](handleError(_0x325e33,null));};exports[_0xcc2f('0x52')]=function(_0x5efb8c,_0x4a9008){return db[_0xcc2f('0x34')][_0xcc2f('0x35')]({'where':{'id':_0x5efb8c[_0xcc2f('0x2a')]['id']}})[_0xcc2f('0x19')](handleEntityNotFound(_0x4a9008,null))[_0xcc2f('0x19')](function(_0x4f2884){if(_0x4f2884){return _0x4f2884[_0xcc2f('0x52')](_0x5efb8c[_0xcc2f('0x26')][_0xcc2f('0x3c')]);}})['then'](respondWithStatusCode(_0x4a9008,null))[_0xcc2f('0x28')](handleError(_0x4a9008,null));};exports[_0xcc2f('0x53')]=function(_0x8c02e2,_0x25af0c){var _0x293366=moment()[_0xcc2f('0x54')]()[_0xcc2f('0x55')]();var _0x2bfefe=path['join'](config[_0xcc2f('0x56')],_0xcc2f('0x57'),_0xcc2f('0x58'),_0xcc2f('0x59'));var _0x569745=path[_0xcc2f('0x5a')](_0x2bfefe,_0x293366);var _0x200bc6=util[_0xcc2f('0x49')](_0xcc2f('0x5b'),_0x8c02e2[_0xcc2f('0x2a')]['id'],_0x293366);var _0x16383e=path[_0xcc2f('0x5a')](_0x2bfefe,_0x200bc6);var _0x7bd1dc=[];_0x7bd1dc[_0xcc2f('0x5c')]({'model':db['User'],'as':'User','attributes':['id',_0xcc2f('0x5d')],'raw':!![]});_0x7bd1dc['push']({'model':db[_0xcc2f('0x5e')],'as':_0xcc2f('0x5f'),'attributes':['id','firstName',_0xcc2f('0x60')],'raw':!![]});var _0x5d79f9=[{'model':db[_0xcc2f('0x3b')],'as':_0xcc2f('0x61'),'attributes':['id',_0xcc2f('0x38'),_0xcc2f('0x62'),'direction',_0xcc2f('0x63'),_0xcc2f('0x64')],'include':_0x7bd1dc}];_0x5d79f9[_0xcc2f('0x5c')]({'model':db['SmsAccount'],'as':_0xcc2f('0x65'),'attributes':['id',_0xcc2f('0x1c')]});_0x5d79f9[_0xcc2f('0x5c')]({'model':db[_0xcc2f('0x66')],'as':'Owner','attributes':['id',_0xcc2f('0x5d')]});return db['SmsInteraction'][_0xcc2f('0x35')]({'where':{'id':_0x8c02e2[_0xcc2f('0x2a')]['id']},'include':_0x5d79f9})['then'](handleEntityNotFound(_0x25af0c,null))[_0xcc2f('0x19')](function(_0x4e0c8d){if(_0x4e0c8d){var _0x280090=_0x4e0c8d[_0xcc2f('0x67')]({'plain':!![]});fs[_0xcc2f('0x68')](_0x569745);var _0x5d6da6={'channel':_0xcc2f('0x69'),'account':_0x280090[_0xcc2f('0x65')][_0xcc2f('0x1c')],'agent':_0x280090[_0xcc2f('0x6a')]?_0x280090[_0xcc2f('0x6a')][_0xcc2f('0x5d')]:_0xcc2f('0x6b'),'createdAt':moment(_0x280090[_0xcc2f('0x62')])[_0xcc2f('0x49')](_0xcc2f('0x4a'))[_0xcc2f('0x55')](),'closedAt':_0x280090[_0xcc2f('0x6c')]?moment(_0x280090['closedAt'])[_0xcc2f('0x49')](_0xcc2f('0x4a'))['toString']():'','disposition':_0x280090[_0xcc2f('0x6d')],'messages':_(_0x280090[_0xcc2f('0x61')])['filter']({'secret':![]})[_0xcc2f('0x1f')](function(_0x105736){return{'date':moment(_0x105736[_0xcc2f('0x62')])[_0xcc2f('0x49')](_0xcc2f('0x4a'))[_0xcc2f('0x55')](),'sender':_0x105736['direction']===_0xcc2f('0x6e')?_0x105736[_0xcc2f('0x66')]?_0x105736[_0xcc2f('0x66')][_0xcc2f('0x5d')]:_0xcc2f('0x6f'):_0x105736[_0xcc2f('0x5f')]['firstName']+(_0x105736[_0xcc2f('0x5f')]['lastName']?'\x20'+_0x105736[_0xcc2f('0x5f')][_0xcc2f('0x60')]:''),'body':_0x105736['body'],'direction':_0x105736['direction']===_0xcc2f('0x6e')?'A':'C','secret':_0x105736[_0xcc2f('0x63')],'read':_0x105736[_0xcc2f('0x64')]};})['value']()};return ejs[_0xcc2f('0x70')](path[_0xcc2f('0x5a')](config[_0xcc2f('0x56')],_0xcc2f('0x57'),'views',_0xcc2f('0x71')),{'interaction':_0x5d6da6})['then'](function(_0x544dce){var _0x25b3aa=path[_0xcc2f('0x5a')](_0x569745,_0xcc2f('0x72')+_0x280090['id']+'-'+_0x293366+_0xcc2f('0x73'));var _0xc74985={'path':_0x25b3aa,'channel':_0xcc2f('0x69'),'interactionId':_0x280090['id']};return pdf[_0xcc2f('0x74')](_0x544dce,_0xc74985);})['then'](function(){return new BPromise(function(_0x5d4447,_0x469bef){zipdir(_0x569745,{'saveTo':_0x16383e},function(_0x3ed974,_0x395307){if(_0x3ed974)return _0x469bef(_0x3ed974);return _0x5d4447(_0x395307);});})['then'](function(){return new BPromise(function(_0x57313a,_0x59000e){rimraf(_0x569745,function(_0xa545be){if(_0xa545be)_0x59000e(_0xa545be);return _0x57313a();});});})[_0xcc2f('0x19')](function(){return _0x25af0c[_0xcc2f('0x53')](_0x16383e,_0x200bc6,function(_0x132b1f){if(_0x132b1f){console['log']('err',_0x132b1f);}else{fs[_0xcc2f('0x75')](_0x16383e);}});});});}else{return _0x25af0c[_0xcc2f('0x11')](0xc8);}})['catch'](handleError(_0x25af0c,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index d579e27..7452a08 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 _0x47c5=['setMaxListeners','update','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','exports','events','../../mysqldb','SmsInteraction','SmsMessage'];(function(_0x424bd3,_0x8760d8){var _0x1fdade=function(_0x510862){while(--_0x510862){_0x424bd3['push'](_0x424bd3['shift']());}};_0x1fdade(++_0x8760d8);}(_0x47c5,0x165));var _0x547c=function(_0xf3807a,_0x29e20e){_0xf3807a=_0xf3807a-0x0;var _0x562bf6=_0x47c5[_0xf3807a];return _0x562bf6;};'use strict';var EventEmitter=require(_0x547c('0x0'));var SmsInteraction=require(_0x547c('0x1'))['db'][_0x547c('0x2')];var SmsMessage=require(_0x547c('0x1'))['db'][_0x547c('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x547c('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0x547c('0x5'),'afterDestroy':_0x547c('0x6')};function emitEvent(_0x5b48c9){return function(_0x3e827e,_0x468220,_0x51ab7f){_0x3e827e[_0x547c('0x7')]({'attributes':['id'],'raw':!![]})[_0x547c('0x8')](function(_0x381f2e){_0x3e827e[_0x547c('0x9')](_0x547c('0xa'),_0x381f2e[_0x547c('0xb')](function(_0x3e2279){return{'id':_0x3e2279['id']};}));return SmsMessage[_0x547c('0xc')]({'where':{'SmsInteractionId':_0x3e827e['id'],'direction':'in','read':![]},'raw':!![]});})[_0x547c('0x8')](function(_0x44a581){_0x3e827e[_0x547c('0x9')](_0x547c('0xd'),_0x44a581[_0x547c('0xe')]);SmsInteractionEvents[_0x547c('0xf')](_0x5b48c9+':'+_0x3e827e['id'],_0x3e827e);SmsInteractionEvents[_0x547c('0xf')](_0x5b48c9,_0x3e827e);_0x51ab7f(null);})[_0x547c('0x10')](_0x51ab7f(null));};}for(var e in events){if(events[_0x547c('0x11')](e)){var event=events[e];SmsInteraction['hook'](e,emitEvent(event));}}module[_0x547c('0x12')]=SmsInteractionEvents; \ No newline at end of file +var _0x5204=['hook','exports','events','../../mysqldb','SmsMessage','setMaxListeners','save','update','getUsers','then','setDataValue','Users','unreadMessages','length','emit','catch','hasOwnProperty'];(function(_0x419032,_0x3e95dc){var _0x54b9f3=function(_0x3014a9){while(--_0x3014a9){_0x419032['push'](_0x419032['shift']());}};_0x54b9f3(++_0x3e95dc);}(_0x5204,0xdf));var _0x4520=function(_0xa60623,_0x2d4e4f){_0xa60623=_0xa60623-0x0;var _0x4a6487=_0x5204[_0xa60623];return _0x4a6487;};'use strict';var EventEmitter=require(_0x4520('0x0'));var SmsInteraction=require(_0x4520('0x1'))['db']['SmsInteraction'];var SmsMessage=require(_0x4520('0x1'))['db'][_0x4520('0x2')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x4520('0x3')](0x0);var events={'afterCreate':_0x4520('0x4'),'afterUpdate':_0x4520('0x5'),'afterDestroy':'remove'};function emitEvent(_0x41d89c){return function(_0x58b8a8,_0x180174,_0x209381){_0x58b8a8[_0x4520('0x6')]({'attributes':['id'],'raw':!![]})[_0x4520('0x7')](function(_0x396d29){_0x58b8a8[_0x4520('0x8')](_0x4520('0x9'),_0x396d29['map'](function(_0x297f0a){return{'id':_0x297f0a['id']};}));return SmsMessage['findAll']({'where':{'SmsInteractionId':_0x58b8a8['id'],'direction':'in','read':![]},'raw':!![]});})[_0x4520('0x7')](function(_0x37a617){_0x58b8a8[_0x4520('0x8')](_0x4520('0xa'),_0x37a617[_0x4520('0xb')]);SmsInteractionEvents[_0x4520('0xc')](_0x41d89c+':'+_0x58b8a8['id'],_0x58b8a8);SmsInteractionEvents[_0x4520('0xc')](_0x41d89c,_0x58b8a8);_0x209381(null);})[_0x4520('0xd')](_0x209381(null));};}for(var e in events){if(events[_0x4520('0xe')](e)){var event=events[e];SmsInteraction[_0x4520('0xf')](e,emitEvent(event));}}module[_0x4520('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 591177d..21feb7e 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 _0x373b=['path','rimraf','./smsInteraction.attributes','define','SmsInteraction','sms_interactions','changed','closed','closedAt','format','lodash','util','moment','bluebird','request-promise'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x373b,0x154));var _0xb373=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x373b[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0xb373('0x0'));var util=require(_0xb373('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xb373('0x2'));var BPromise=require(_0xb373('0x3'));var rp=require(_0xb373('0x4'));var fs=require('fs');var path=require(_0xb373('0x5'));var rimraf=require(_0xb373('0x6'));var config=require('../../config/environment');var attributes=require(_0xb373('0x7'));module['exports']=function(_0x2f232e,_0x241d8e){return _0x2f232e[_0xb373('0x8')](_0xb373('0x9'),attributes,{'tableName':_0xb373('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x262d93,_0x1a3dff,_0xcc7d37){if(_0x262d93[_0xb373('0xb')](_0xb373('0xc'))){_0x262d93[_0xb373('0xd')]=moment()[_0xb373('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}_0xcc7d37(null,_0x262d93);}}});}; \ No newline at end of file +var _0x33a6=['define','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','path','./smsInteraction.attributes','exports'];(function(_0x10a30e,_0xa0a0ed){var _0x56d163=function(_0x41a53c){while(--_0x41a53c){_0x10a30e['push'](_0x10a30e['shift']());}};_0x56d163(++_0xa0a0ed);}(_0x33a6,0xbb));var _0x633a=function(_0x18e7ab,_0x2822d6){_0x18e7ab=_0x18e7ab-0x0;var _0x187b58=_0x33a6[_0x18e7ab];return _0x187b58;};'use strict';var _=require(_0x633a('0x0'));var util=require(_0x633a('0x1'));var logger=require(_0x633a('0x2'))(_0x633a('0x3'));var moment=require(_0x633a('0x4'));var BPromise=require(_0x633a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x633a('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x633a('0x7'));module[_0x633a('0x8')]=function(_0x1786dd,_0x420518){return _0x1786dd[_0x633a('0x9')]('SmsInteraction',attributes,{'tableName':'sms_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1449a6,_0x18cebe,_0x3cdab3){if(_0x1449a6['changed'](_0x633a('0xa'))){_0x1449a6[_0x633a('0xb')]=moment()[_0x633a('0xc')](_0x633a('0xd'));}_0x3cdab3(null,_0x1449a6);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index 90c4973..2de13ad 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 _0x4c0d=['UpdateSmsInteraction','catch','AddTagsToSmsInteraction','find','body','ids','spread','AddTags','stringify','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','request','info','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','SmsInteraction,\x20%s,\x20%s','result','SmsInteraction','update','options','raw','where','attributes','then'];(function(_0x47f7ec,_0x369f9d){var _0x415101=function(_0x41317a){while(--_0x41317a){_0x47f7ec['push'](_0x47f7ec['shift']());}};_0x415101(++_0x369f9d);}(_0x4c0d,0x87));var _0xd4c0=function(_0x279a7a,_0x5dcfcc){_0x279a7a=_0x279a7a-0x0;var _0x276b65=_0x4c0d[_0x279a7a];return _0x276b65;};'use strict';var _=require(_0xd4c0('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xd4c0('0x1'));var rs=require(_0xd4c0('0x2'));var fs=require('fs');var Redis=require(_0xd4c0('0x3'));var db=require(_0xd4c0('0x4'))['db'];var utils=require(_0xd4c0('0x5'));var logger=require(_0xd4c0('0x6'))(_0xd4c0('0x7'));var config=require(_0xd4c0('0x8'));var jayson=require(_0xd4c0('0x9'));var client=jayson['client'][_0xd4c0('0xa')]({'port':0x232a});config[_0xd4c0('0xb')]=_[_0xd4c0('0xc')](config[_0xd4c0('0xb')],{'host':_0xd4c0('0xd'),'port':0x18eb});var socket=require(_0xd4c0('0xe'))(new Redis(config[_0xd4c0('0xb')]));require(_0xd4c0('0xf'))['register'](socket);function respondWithRpcPromise(_0x43cc4f,_0x617eb5,_0x477ff3){return new BPromise(function(_0x1218db,_0x221301){return client[_0xd4c0('0x10')](_0x43cc4f,_0x477ff3)['then'](function(_0x531f47){logger[_0xd4c0('0x11')]('SmsInteraction,\x20%s,\x20%s',_0x617eb5,'request\x20sent');logger[_0xd4c0('0x12')](_0xd4c0('0x13'),_0x617eb5,_0xd4c0('0x14'),JSON['stringify'](_0x531f47));if(_0x531f47[_0xd4c0('0x15')]){if(_0x531f47['error'][_0xd4c0('0x16')]===0x1f4){logger[_0xd4c0('0x15')]('SmsInteraction,\x20%s,\x20%s',_0x617eb5,_0x531f47[_0xd4c0('0x15')]['message']);return _0x221301(_0x531f47[_0xd4c0('0x15')][_0xd4c0('0x17')]);}logger[_0xd4c0('0x15')]('SmsInteraction,\x20%s,\x20%s',_0x617eb5,_0x531f47[_0xd4c0('0x15')][_0xd4c0('0x17')]);return _0x1218db(_0x531f47[_0xd4c0('0x15')][_0xd4c0('0x17')]);}else{logger['info'](_0xd4c0('0x18'),_0x617eb5,_0xd4c0('0x14'));_0x1218db(_0x531f47[_0xd4c0('0x19')][_0xd4c0('0x17')]);}})['catch'](function(_0x2ed9f2){logger[_0xd4c0('0x15')](_0xd4c0('0x18'),_0x617eb5,_0x2ed9f2);_0x221301(_0x2ed9f2);});});}exports['UpdateSmsInteraction']=function(_0x54fbf8){var _0x4ddf34=this;return new Promise(function(_0x1487fb,_0x55f00a){return db[_0xd4c0('0x1a')][_0xd4c0('0x1b')](_0x54fbf8['body'],{'raw':_0x54fbf8[_0xd4c0('0x1c')]?_0x54fbf8[_0xd4c0('0x1c')][_0xd4c0('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x54fbf8[_0xd4c0('0x1c')]?_0x54fbf8[_0xd4c0('0x1c')][_0xd4c0('0x1e')]||null:null,'attributes':_0x54fbf8[_0xd4c0('0x1c')]?_0x54fbf8[_0xd4c0('0x1c')][_0xd4c0('0x1f')]||null:null,'limit':_0x54fbf8['options']?_0x54fbf8[_0xd4c0('0x1c')]['limit']||null:null})[_0xd4c0('0x20')](function(_0x23a741){logger['info'](_0xd4c0('0x21'),_0x54fbf8);logger[_0xd4c0('0x12')](_0xd4c0('0x21'),_0x54fbf8,JSON['stringify'](_0x23a741));_0x1487fb(_0x23a741);})[_0xd4c0('0x22')](function(_0x13ba48){logger[_0xd4c0('0x15')](_0xd4c0('0x21'),_0x13ba48['message'],_0x54fbf8);_0x55f00a(_0x4ddf34[_0xd4c0('0x15')](0x1f4,_0x13ba48[_0xd4c0('0x17')]));});});};exports[_0xd4c0('0x23')]=function(_0x41362e){return new Promise(function(_0x1076cf,_0x89c4a3){return db[_0xd4c0('0x1a')][_0xd4c0('0x24')]({'where':_0x41362e[_0xd4c0('0x1c')]?_0x41362e[_0xd4c0('0x1c')][_0xd4c0('0x1e')]||null:null})[_0xd4c0('0x20')](function(_0x53f858){if(_0x53f858){return _0x53f858['addTags'](_0x41362e[_0xd4c0('0x25')]['ids'],_['omit'](_0x41362e[_0xd4c0('0x25')],[_0xd4c0('0x26'),'id'])||{});}})[_0xd4c0('0x27')](function(_0x48b311){logger[_0xd4c0('0x11')](_0xd4c0('0x28'),_0x41362e);logger['debug'](_0xd4c0('0x28'),_0x41362e,JSON[_0xd4c0('0x29')](_0x48b311));_0x1076cf(_0x48b311);})[_0xd4c0('0x22')](function(_0x41f398){logger[_0xd4c0('0x15')](_0xd4c0('0x28'),_0x41f398[_0xd4c0('0x17')],_0x41362e);_0x89c4a3(_this['error'](0x1f4,_0x41f398[_0xd4c0('0x17')]));});});}; \ No newline at end of file +var _0x1ed2=['localhost','socket.io-emitter','then','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','SmsInteraction,\x20%s,\x20%s','UpdateSmsInteraction','SmsInteraction','update','body','options','raw','where','limit','info','AddTagsToSmsInteraction','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults'];(function(_0x2ae493,_0x5b50ac){var _0x4a5000=function(_0x342010){while(--_0x342010){_0x2ae493['push'](_0x2ae493['shift']());}};_0x4a5000(++_0x5b50ac);}(_0x1ed2,0xed));var _0x21ed=function(_0x47b017,_0x52942d){_0x47b017=_0x47b017-0x0;var _0x485638=_0x1ed2[_0x47b017];return _0x485638;};'use strict';var _=require(_0x21ed('0x0'));var util=require(_0x21ed('0x1'));var moment=require(_0x21ed('0x2'));var BPromise=require(_0x21ed('0x3'));var rs=require(_0x21ed('0x4'));var fs=require('fs');var Redis=require(_0x21ed('0x5'));var db=require(_0x21ed('0x6'))['db'];var utils=require(_0x21ed('0x7'));var logger=require('../../config/logger')(_0x21ed('0x8'));var config=require(_0x21ed('0x9'));var jayson=require(_0x21ed('0xa'));var client=jayson[_0x21ed('0xb')][_0x21ed('0xc')]({'port':0x232a});config[_0x21ed('0xd')]=_[_0x21ed('0xe')](config[_0x21ed('0xd')],{'host':_0x21ed('0xf'),'port':0x18eb});var socket=require(_0x21ed('0x10'))(new Redis(config['redis']));require('./smsInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x4845e4,_0x3dfd61,_0x3fea6b){return new BPromise(function(_0x35e3ea,_0x2a488e){return client['request'](_0x4845e4,_0x3fea6b)[_0x21ed('0x11')](function(_0x563de0){logger['info']('SmsInteraction,\x20%s,\x20%s',_0x3dfd61,_0x21ed('0x12'));logger[_0x21ed('0x13')](_0x21ed('0x14'),_0x3dfd61,_0x21ed('0x12'),JSON[_0x21ed('0x15')](_0x563de0));if(_0x563de0[_0x21ed('0x16')]){if(_0x563de0['error'][_0x21ed('0x17')]===0x1f4){logger[_0x21ed('0x16')]('SmsInteraction,\x20%s,\x20%s',_0x3dfd61,_0x563de0[_0x21ed('0x16')][_0x21ed('0x18')]);return _0x2a488e(_0x563de0['error'][_0x21ed('0x18')]);}logger[_0x21ed('0x16')]('SmsInteraction,\x20%s,\x20%s',_0x3dfd61,_0x563de0[_0x21ed('0x16')][_0x21ed('0x18')]);return _0x35e3ea(_0x563de0[_0x21ed('0x16')][_0x21ed('0x18')]);}else{logger['info']('SmsInteraction,\x20%s,\x20%s',_0x3dfd61,_0x21ed('0x12'));_0x35e3ea(_0x563de0[_0x21ed('0x19')]['message']);}})[_0x21ed('0x1a')](function(_0x522398){logger[_0x21ed('0x16')](_0x21ed('0x1b'),_0x3dfd61,_0x522398);_0x2a488e(_0x522398);});});}exports[_0x21ed('0x1c')]=function(_0x339916){var _0x1d8aef=this;return new Promise(function(_0x40f2d1,_0x24b4f5){return db[_0x21ed('0x1d')][_0x21ed('0x1e')](_0x339916[_0x21ed('0x1f')],{'raw':_0x339916[_0x21ed('0x20')]?_0x339916[_0x21ed('0x20')][_0x21ed('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x339916['options']?_0x339916[_0x21ed('0x20')][_0x21ed('0x22')]||null:null,'attributes':_0x339916[_0x21ed('0x20')]?_0x339916[_0x21ed('0x20')]['attributes']||null:null,'limit':_0x339916[_0x21ed('0x20')]?_0x339916[_0x21ed('0x20')][_0x21ed('0x23')]||null:null})[_0x21ed('0x11')](function(_0x2afbe4){logger[_0x21ed('0x24')](_0x21ed('0x1c'),_0x339916);logger[_0x21ed('0x13')]('UpdateSmsInteraction',_0x339916,JSON['stringify'](_0x2afbe4));_0x40f2d1(_0x2afbe4);})['catch'](function(_0x2837d){logger['error'](_0x21ed('0x1c'),_0x2837d[_0x21ed('0x18')],_0x339916);_0x24b4f5(_0x1d8aef['error'](0x1f4,_0x2837d[_0x21ed('0x18')]));});});};exports[_0x21ed('0x25')]=function(_0x5ec565){return new Promise(function(_0x50ed47,_0x52a4dd){return db['SmsInteraction']['find']({'where':_0x5ec565[_0x21ed('0x20')]?_0x5ec565['options'][_0x21ed('0x22')]||null:null})[_0x21ed('0x11')](function(_0x1908d4){if(_0x1908d4){return _0x1908d4['addTags'](_0x5ec565[_0x21ed('0x1f')][_0x21ed('0x26')],_[_0x21ed('0x27')](_0x5ec565[_0x21ed('0x1f')],['ids','id'])||{});}})[_0x21ed('0x28')](function(_0x1a7f08){logger[_0x21ed('0x24')](_0x21ed('0x29'),_0x5ec565);logger['debug'](_0x21ed('0x29'),_0x5ec565,JSON[_0x21ed('0x15')](_0x1a7f08));_0x50ed47(_0x1a7f08);})[_0x21ed('0x1a')](function(_0x4f0af5){logger[_0x21ed('0x16')](_0x21ed('0x29'),_0x4f0af5[_0x21ed('0x18')],_0x5ec565);_0x52a4dd(_this[_0x21ed('0x16')](0x1f4,_0x4f0af5[_0x21ed('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index 8610f50..e8085d4 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 _0x172d=['smsInteraction:','./smsInteraction.events','save','remove','removeListener','register'];(function(_0x43ed38,_0x507af1){var _0x181497=function(_0x153d8e){while(--_0x153d8e){_0x43ed38['push'](_0x43ed38['shift']());}};_0x181497(++_0x507af1);}(_0x172d,0xfd));var _0xd172=function(_0x35e25c,_0x301f23){_0x35e25c=_0x35e25c-0x0;var _0x5266c6=_0x172d[_0x35e25c];return _0x5266c6;};'use strict';var SmsInteractionEvents=require(_0xd172('0x0'));var events=[_0xd172('0x1'),_0xd172('0x2'),'update'];function createListener(_0x2c1c2c,_0x3cce5a){return function(_0x489197){_0x3cce5a['emit'](_0x2c1c2c,_0x489197);};}function removeListener(_0x5883b6,_0x5f3f47){return function(){SmsInteractionEvents[_0xd172('0x3')](_0x5883b6,_0x5f3f47);};}exports[_0xd172('0x4')]=function(_0x20fcf6){for(var _0x50747c=0x0,_0x2eedb4=events['length'];_0x50747c<_0x2eedb4;_0x50747c++){var _0x5ec820=events[_0x50747c];var _0x29ccd7=createListener(_0xd172('0x5')+_0x5ec820,_0x20fcf6);SmsInteractionEvents['on'](_0x5ec820,_0x29ccd7);}}; \ No newline at end of file +var _0xe882=['emit','length','./smsInteraction.events','save','remove','update'];(function(_0x2b9b7f,_0x4d47df){var _0x4ed19a=function(_0x72b5ff){while(--_0x72b5ff){_0x2b9b7f['push'](_0x2b9b7f['shift']());}};_0x4ed19a(++_0x4d47df);}(_0xe882,0x7a));var _0x2e88=function(_0x95ca57,_0x3908f9){_0x95ca57=_0x95ca57-0x0;var _0x70015e=_0xe882[_0x95ca57];return _0x70015e;};'use strict';var SmsInteractionEvents=require(_0x2e88('0x0'));var events=[_0x2e88('0x1'),_0x2e88('0x2'),_0x2e88('0x3')];function createListener(_0x5ab6ad,_0x4e18bd){return function(_0x4a49a7){_0x4e18bd[_0x2e88('0x4')](_0x5ab6ad,_0x4a49a7);};}function removeListener(_0x448200,_0x2b5556){return function(){SmsInteractionEvents['removeListener'](_0x448200,_0x2b5556);};}exports['register']=function(_0x363b6a){for(var _0x2889c8=0x0,_0x1203f4=events[_0x2e88('0x5')];_0x2889c8<_0x1203f4;_0x2889c8++){var _0x4b909d=events[_0x2889c8];var _0x294e0d=createListener('smsInteraction:'+_0x4b909d,_0x363b6a);SmsInteractionEvents['on'](_0x4b909d,_0x294e0d);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index 939f304..4a251bf 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 _0x8bf1=['../../components/interaction/service','get','isAuthenticated','/describe','describe','/:id','post','tracked','create','/:id/status','put','update','/:id/reject','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x72faab,_0x1007a1){var _0x383f3b=function(_0x13d927){while(--_0x13d927){_0x72faab['push'](_0x72faab['shift']());}};_0x383f3b(++_0x1007a1);}(_0x8bf1,0xd5));var _0x18bf=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8bf1[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x18bf('0x0'));var util=require(_0x18bf('0x1'));var path=require(_0x18bf('0x2'));var timeout=require(_0x18bf('0x3'));var express=require(_0x18bf('0x4'));var router=express[_0x18bf('0x5')]();var fs_extra=require(_0x18bf('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x18bf('0x7'));var config=require('../../config/environment');var controller=require('./smsMessage.controller');router[_0x18bf('0x8')]('/',auth[_0x18bf('0x9')](),controller['index']);router[_0x18bf('0x8')](_0x18bf('0xa'),auth[_0x18bf('0x9')](),controller[_0x18bf('0xb')]);router['get'](_0x18bf('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x18bf('0xd')]('/',auth['isAuthenticated'](),interaction[_0x18bf('0xe')]('sms','smsmessage:create'),controller[_0x18bf('0xf')]);router[_0x18bf('0xd')](_0x18bf('0x10'),controller['status']);router[_0x18bf('0x11')](_0x18bf('0xc'),auth['isAuthenticated'](),controller[_0x18bf('0x12')]);router['put']('/:id/accept',auth[_0x18bf('0x9')](),controller['accept']);router[_0x18bf('0x11')](_0x18bf('0x13'),auth[_0x18bf('0x9')](),controller['reject']);router[_0x18bf('0x14')](_0x18bf('0xc'),auth[_0x18bf('0x9')](),controller[_0x18bf('0x15')]);module['exports']=router; \ No newline at end of file +var _0xecbc=['../../components/interaction/service','./smsMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','tracked','sms','smsmessage:create','create','status','put','update','/:id/accept','accept','/:id/reject','reject','delete','multer','util','path','connect-timeout','fs-extra','../../components/auth/service'];(function(_0x25fc41,_0x250864){var _0x1371d1=function(_0x8ab2e3){while(--_0x8ab2e3){_0x25fc41['push'](_0x25fc41['shift']());}};_0x1371d1(++_0x250864);}(_0xecbc,0x86));var _0xcecb=function(_0x344a3f,_0x579a22){_0x344a3f=_0x344a3f-0x0;var _0x264712=_0xecbc[_0x344a3f];return _0x264712;};'use strict';var multer=require(_0xcecb('0x0'));var util=require(_0xcecb('0x1'));var path=require(_0xcecb('0x2'));var timeout=require(_0xcecb('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xcecb('0x4'));var auth=require(_0xcecb('0x5'));var interaction=require(_0xcecb('0x6'));var config=require('../../config/environment');var controller=require(_0xcecb('0x7'));router[_0xcecb('0x8')]('/',auth[_0xcecb('0x9')](),controller[_0xcecb('0xa')]);router['get'](_0xcecb('0xb'),auth['isAuthenticated'](),controller[_0xcecb('0xc')]);router[_0xcecb('0x8')](_0xcecb('0xd'),auth[_0xcecb('0x9')](),controller[_0xcecb('0xe')]);router[_0xcecb('0xf')]('/',auth[_0xcecb('0x9')](),interaction[_0xcecb('0x10')](_0xcecb('0x11'),_0xcecb('0x12')),controller[_0xcecb('0x13')]);router[_0xcecb('0xf')]('/:id/status',controller[_0xcecb('0x14')]);router[_0xcecb('0x15')](_0xcecb('0xd'),auth[_0xcecb('0x9')](),controller[_0xcecb('0x16')]);router[_0xcecb('0x15')](_0xcecb('0x17'),auth[_0xcecb('0x9')](),controller[_0xcecb('0x18')]);router[_0xcecb('0x15')](_0xcecb('0x19'),auth[_0xcecb('0x9')](),controller[_0xcecb('0x1a')]);router[_0xcecb('0x1b')](_0xcecb('0xd'),auth[_0xcecb('0x9')](),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 e77505a..02674bc 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 _0x71af=['out','STRING','DATE','sequelize','exports','TEXT','medium','BOOLEAN','ENUM'];(function(_0x11761b,_0x887202){var _0x55057e=function(_0x2955dd){while(--_0x2955dd){_0x11761b['push'](_0x11761b['shift']());}};_0x55057e(++_0x887202);}(_0x71af,0x17d));var _0xf71a=function(_0x4fb166,_0x7ffc6a){_0x4fb166=_0x4fb166-0x0;var _0xb757cf=_0x71af[_0x4fb166];return _0xb757cf;};'use strict';var Sequelize=require(_0xf71a('0x0'));module[_0xf71a('0x1')]={'body':{'type':Sequelize[_0xf71a('0x2')](_0xf71a('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xf71a('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xf71a('0x5')]('in',_0xf71a('0x6')),'defaultValue':_0xf71a('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0xf71a('0x7')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0xf71a('0x8')]},'secret':{'type':Sequelize[_0xf71a('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xf71a('0x7')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x5827=['DATE','BOOLEAN','sequelize','exports','TEXT','out'];(function(_0x40a992,_0x1fb4b4){var _0x19c98d=function(_0x5df076){while(--_0x5df076){_0x40a992['push'](_0x40a992['shift']());}};_0x19c98d(++_0x1fb4b4);}(_0x5827,0xb0));var _0x7582=function(_0x146b8d,_0x3d4467){_0x146b8d=_0x146b8d-0x0;var _0x2fe335=_0x5827[_0x146b8d];return _0x2fe335;};'use strict';var Sequelize=require(_0x7582('0x0'));module[_0x7582('0x1')]={'body':{'type':Sequelize[_0x7582('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x7582('0x3')),'defaultValue':_0x7582('0x3'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0x7582('0x4')]},'secret':{'type':Sequelize[_0x7582('0x5')],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x7582('0x2')]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index a6300fd..42d40c0 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 _0x2678=['desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','jayson/promise','http','client','then','info','SmsMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','stack','name','send','index','map','SmsMessage','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','show','params','rawAttributes','find','create','body','describe','sms-interactions','accept','sms','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','SmsInteractionId','isNil','read1stAt','user','role','interaction','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','SmsInteraction','null','RejectMessage','QueryTypes','rejectmessage','SmsAccountId','SmsMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','twilio','plivo','MessageUUID','sent','Status','plivio','infobip','results','groupName','DELIVERED','rimraf','zip-dir','fast-json-patch','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce'];(function(_0xf98581,_0x41a58c){var _0x4a16a9=function(_0x30867e){while(--_0x30867e){_0xf98581['push'](_0xf98581['shift']());}};_0x4a16a9(++_0x41a58c);}(_0x2678,0x1bb));var _0x8267=function(_0x3096fd,_0x541ccd){_0x3096fd=_0x3096fd-0x0;var _0x159725=_0x2678[_0x3096fd];return _0x159725;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8267('0x0'));var zipdir=require(_0x8267('0x1'));var jsonpatch=require(_0x8267('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x8267('0x3'));var util=require(_0x8267('0x4'));var path=require(_0x8267('0x5'));var sox=require('sox');var csv=require(_0x8267('0x6'));var ejs=require(_0x8267('0x7'));var fs=require('fs');var fs_extra=require(_0x8267('0x8'));var _=require(_0x8267('0x9'));var squel=require(_0x8267('0xa'));var crypto=require(_0x8267('0xb'));var jsforce=require(_0x8267('0xc'));var deskjs=require(_0x8267('0xd'));var toCsv=require('to-csv');var querystring=require(_0x8267('0xe'));var Papa=require(_0x8267('0xf'));var Redis=require('ioredis');var authService=require(_0x8267('0x10'));var qs=require(_0x8267('0x11'));var as=require(_0x8267('0x12'));var hardwareService=require(_0x8267('0x13'));var logger=require(_0x8267('0x14'))('api');var utils=require(_0x8267('0x15'));var config=require(_0x8267('0x16'));var licenseUtil=require(_0x8267('0x17'));var db=require(_0x8267('0x18'))['db'];config[_0x8267('0x19')]=_[_0x8267('0x1a')](config[_0x8267('0x19')],{'host':_0x8267('0x1b'),'port':0x18eb});var socket=require(_0x8267('0x1c'))(new Redis(config[_0x8267('0x19')]));require(_0x8267('0x1d'))['register'](socket);var jayson=require(_0x8267('0x1e'));var client=jayson['client'][_0x8267('0x1f')]({'port':0x232c});var client9002=jayson[_0x8267('0x20')][_0x8267('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x3cdf01,_0x5b182b,_0x583817,_0x59967e){return new BPromise(function(_0x3d2c1e,_0x455d26){var _0x55b9f9=_0x59967e||client;return _0x55b9f9['request'](_0x3cdf01,_0x583817)[_0x8267('0x21')](function(_0x39f8c8){logger[_0x8267('0x22')](_0x8267('0x23'),_0x5b182b,'request\x20sent');logger[_0x8267('0x24')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x5b182b,_0x8267('0x25'),JSON[_0x8267('0x26')](_0x39f8c8));if(_0x39f8c8[_0x8267('0x27')]){if(_0x39f8c8['error'][_0x8267('0x28')]===0x1f4){logger[_0x8267('0x27')](_0x8267('0x23'),_0x5b182b,_0x39f8c8[_0x8267('0x27')][_0x8267('0x29')]);return _0x455d26(_0x39f8c8[_0x8267('0x27')][_0x8267('0x29')]);}logger['error']('SmsMessage,\x20%s,\x20%s',_0x5b182b,_0x39f8c8[_0x8267('0x27')][_0x8267('0x29')]);return _0x3d2c1e(_0x39f8c8[_0x8267('0x27')][_0x8267('0x29')]);}else{logger[_0x8267('0x22')](_0x8267('0x23'),_0x5b182b,'request\x20sent');_0x3d2c1e(_0x39f8c8[_0x8267('0x2a')][_0x8267('0x29')]);}})[_0x8267('0x2b')](function(_0x2903bb){logger[_0x8267('0x27')]('SmsMessage,\x20%s,\x20%s',_0x5b182b,_0x2903bb);_0x455d26(_0x2903bb);});});}function respondWithStatusCode(_0x2e8e7e,_0x4171f7){_0x4171f7=_0x4171f7||0xcc;return function(_0x458d06){if(_0x458d06){return _0x2e8e7e[_0x8267('0x2c')](_0x4171f7);}return _0x2e8e7e[_0x8267('0x2d')](_0x4171f7)[_0x8267('0x2e')]();};}function respondWithResult(_0x11fef5,_0x59cee3){_0x59cee3=_0x59cee3||0xc8;return function(_0x1b5133){if(_0x1b5133){return _0x11fef5[_0x8267('0x2d')](_0x59cee3)[_0x8267('0x2f')](_0x1b5133);}};}function respondWithFilteredResult(_0x3f2fbe,_0x398ebd){return function(_0x21fbe4){if(_0x21fbe4){var _0x2d75e1=typeof _0x398ebd[_0x8267('0x30')]===_0x8267('0x31')&&typeof _0x398ebd[_0x8267('0x32')]===_0x8267('0x31');var _0x5f5b0f=_0x21fbe4[_0x8267('0x33')];var _0x4f7377=_0x2d75e1?0x0:_0x398ebd[_0x8267('0x30')];var _0x4f4501=_0x2d75e1?_0x21fbe4['count']:_0x398ebd['offset']+_0x398ebd['limit'];var _0x4d43cd;if(_0x4f4501>=_0x5f5b0f){_0x4f4501=_0x5f5b0f;_0x4d43cd=0xc8;}else{_0x4d43cd=0xce;}_0x3f2fbe[_0x8267('0x2d')](_0x4d43cd);return _0x3f2fbe[_0x8267('0x34')]('Content-Range',_0x4f7377+'-'+_0x4f4501+'/'+_0x5f5b0f)[_0x8267('0x2f')](_0x21fbe4);}return null;};}function patchUpdates(_0x257787){return function(_0x54eb27){try{jsonpatch[_0x8267('0x35')](_0x54eb27,_0x257787,!![]);}catch(_0x459530){return BPromise[_0x8267('0x36')](_0x459530);}return _0x54eb27[_0x8267('0x37')]();};}function saveUpdates(_0x4efc8e,_0x116440){return function(_0x12a838){if(_0x12a838){return _0x12a838[_0x8267('0x38')](_0x4efc8e)['then'](function(_0x1bf027){return _0x1bf027;});}return null;};}function removeEntity(_0x253ff6,_0x3a6935){return function(_0x2323de){if(_0x2323de){return _0x2323de[_0x8267('0x39')]()[_0x8267('0x21')](function(){_0x253ff6['status'](0xcc)[_0x8267('0x2e')]();});}};}function handleEntityNotFound(_0x132092,_0x2cd525){return function(_0x31bd62){if(!_0x31bd62){_0x132092['sendStatus'](0x194);}return _0x31bd62;};}function handleError(_0x4ca6aa,_0x148120){_0x148120=_0x148120||0x1f4;return function(_0x3f8db6){logger[_0x8267('0x27')](_0x3f8db6[_0x8267('0x3a')]);if(_0x3f8db6[_0x8267('0x3b')]){delete _0x3f8db6[_0x8267('0x3b')];}_0x4ca6aa['status'](_0x148120)[_0x8267('0x3c')](_0x3f8db6);};}exports[_0x8267('0x3d')]=function(_0xa87476,_0x47d963){var _0x3df5f9={},_0x34b4e0={},_0x3bdb1c={'count':0x0,'rows':[]};var _0x4759e7=_[_0x8267('0x3e')](db[_0x8267('0x3f')]['rawAttributes'],function(_0x34335a){return{'name':_0x34335a[_0x8267('0x40')],'type':_0x34335a[_0x8267('0x41')][_0x8267('0x42')]};});_0x34b4e0[_0x8267('0x43')]=_['map'](_0x4759e7,_0x8267('0x3b'));_0x34b4e0[_0x8267('0x44')]=_[_0x8267('0x45')](_0xa87476[_0x8267('0x44')]);_0x34b4e0[_0x8267('0x46')]=_[_0x8267('0x47')](_0x34b4e0[_0x8267('0x43')],_0x34b4e0[_0x8267('0x44')]);_0x3df5f9[_0x8267('0x48')]=_[_0x8267('0x47')](_0x34b4e0['model'],qs[_0x8267('0x49')](_0xa87476[_0x8267('0x44')][_0x8267('0x49')]));_0x3df5f9['attributes']=_0x3df5f9[_0x8267('0x48')][_0x8267('0x4a')]?_0x3df5f9[_0x8267('0x48')]:_0x34b4e0[_0x8267('0x43')];if(!_0xa87476[_0x8267('0x44')][_0x8267('0x4b')](_0x8267('0x4c'))){_0x3df5f9[_0x8267('0x32')]=qs[_0x8267('0x32')](_0xa87476[_0x8267('0x44')]['limit']);_0x3df5f9[_0x8267('0x30')]=qs[_0x8267('0x30')](_0xa87476[_0x8267('0x44')][_0x8267('0x30')]);}_0x3df5f9['order']=qs[_0x8267('0x4d')](_0xa87476[_0x8267('0x44')][_0x8267('0x4d')]);_0x3df5f9[_0x8267('0x4e')]=qs[_0x8267('0x46')](_[_0x8267('0x4f')](_0xa87476[_0x8267('0x44')],_0x34b4e0[_0x8267('0x46')]),_0x4759e7);if(_0xa87476[_0x8267('0x44')][_0x8267('0x50')]){_0x3df5f9[_0x8267('0x4e')]=_[_0x8267('0x51')](_0x3df5f9['where'],{'$or':_['map'](_0x4759e7,function(_0xaa78af){if(_0xaa78af['type']!=='VIRTUAL'){var _0x167777={};_0x167777[_0xaa78af[_0x8267('0x3b')]]={'$like':'%'+_0xa87476[_0x8267('0x44')][_0x8267('0x50')]+'%'};return _0x167777;}})});}_0x3df5f9=_[_0x8267('0x51')]({},_0x3df5f9,_0xa87476[_0x8267('0x52')]);var _0x2fe927={'where':_0x3df5f9[_0x8267('0x4e')]};return db[_0x8267('0x3f')][_0x8267('0x33')](_0x2fe927)['then'](function(_0x4d47a4){_0x3bdb1c[_0x8267('0x33')]=_0x4d47a4;if(_0xa87476['query'][_0x8267('0x53')]){_0x3df5f9[_0x8267('0x54')]=[{'all':!![]}];}return db[_0x8267('0x3f')][_0x8267('0x55')](_0x3df5f9);})['then'](function(_0x3aabbd){_0x3bdb1c[_0x8267('0x56')]=_0x3aabbd;return _0x3bdb1c;})[_0x8267('0x21')](respondWithFilteredResult(_0x47d963,_0x3df5f9))[_0x8267('0x2b')](handleError(_0x47d963,null));};exports[_0x8267('0x57')]=function(_0xb0a41d,_0x3be4ed){var _0x272fe9={'raw':!![],'where':{'id':_0xb0a41d[_0x8267('0x58')]['id']}},_0x226079={};_0x226079[_0x8267('0x43')]=_[_0x8267('0x45')](db[_0x8267('0x3f')][_0x8267('0x59')]);_0x226079[_0x8267('0x44')]=_['keys'](_0xb0a41d[_0x8267('0x44')]);_0x226079[_0x8267('0x46')]=_[_0x8267('0x47')](_0x226079[_0x8267('0x43')],_0x226079[_0x8267('0x44')]);_0x272fe9['attributes']=_[_0x8267('0x47')](_0x226079['model'],qs[_0x8267('0x49')](_0xb0a41d[_0x8267('0x44')][_0x8267('0x49')]));_0x272fe9['attributes']=_0x272fe9[_0x8267('0x48')][_0x8267('0x4a')]?_0x272fe9[_0x8267('0x48')]:_0x226079[_0x8267('0x43')];if(_0xb0a41d[_0x8267('0x44')]['includeAll']){_0x272fe9['include']=[{'all':!![]}];}_0x272fe9=_[_0x8267('0x51')]({},_0x272fe9,_0xb0a41d[_0x8267('0x52')]);return db['SmsMessage'][_0x8267('0x5a')](_0x272fe9)['then'](handleEntityNotFound(_0x3be4ed,null))[_0x8267('0x21')](respondWithResult(_0x3be4ed,null))[_0x8267('0x2b')](handleError(_0x3be4ed,null));};exports[_0x8267('0x5b')]=function(_0x200272,_0x1de69f){return db[_0x8267('0x3f')][_0x8267('0x5b')](_0x200272[_0x8267('0x5c')],{})[_0x8267('0x21')](respondWithResult(_0x1de69f,0xc9))[_0x8267('0x2b')](handleError(_0x1de69f,null));};exports[_0x8267('0x38')]=function(_0x344d61,_0x314328){if(_0x344d61[_0x8267('0x5c')]['id']){delete _0x344d61[_0x8267('0x5c')]['id'];}return db[_0x8267('0x3f')]['find']({'where':{'id':_0x344d61[_0x8267('0x58')]['id']}})[_0x8267('0x21')](handleEntityNotFound(_0x314328,null))[_0x8267('0x21')](saveUpdates(_0x344d61['body'],null))[_0x8267('0x21')](respondWithResult(_0x314328,null))[_0x8267('0x2b')](handleError(_0x314328,null));};exports['destroy']=function(_0x12c084,_0x56c57b){return db[_0x8267('0x3f')][_0x8267('0x5a')]({'where':{'id':_0x12c084['params']['id']}})[_0x8267('0x21')](handleEntityNotFound(_0x56c57b,null))[_0x8267('0x21')](removeEntity(_0x56c57b,null))[_0x8267('0x2b')](handleError(_0x56c57b,null));};exports[_0x8267('0x5d')]=function(_0x231b54,_0x46b001){return db[_0x8267('0x3f')]['describe']()[_0x8267('0x21')](respondWithResult(_0x46b001,null))[_0x8267('0x2b')](handleError(_0x46b001,null));};var interaction_log=require(_0x8267('0x14'))(_0x8267('0x5e'));exports[_0x8267('0x5f')]=function(_0x3ed226,_0x1a41ca,_0x1426b8){var _0x9aa005={'agent':{},'channel':_0x8267('0x60')};if(_0x3ed226['body']['id']){delete _0x3ed226[_0x8267('0x5c')]['id'];}_0x3ed226[_0x8267('0x5c')][_0x8267('0x61')]=!![];_0x3ed226[_0x8267('0x5c')][_0x8267('0x62')]=moment()[_0x8267('0x63')](_0x8267('0x64'));_0x3ed226[_0x8267('0x5c')][_0x8267('0x65')]=_0x3ed226[_0x8267('0x5c')][_0x8267('0x65')]||_0x3ed226['user']['id'];_0x9aa005[_0x8267('0x66')]['id']=_0x3ed226[_0x8267('0x5c')]['UserId'];return db[_0x8267('0x3f')][_0x8267('0x5a')]({'where':{'id':_0x3ed226[_0x8267('0x58')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x1a41ca,null))[_0x8267('0x21')](saveUpdates(_0x3ed226[_0x8267('0x5c')],null))[_0x8267('0x21')](function(_0x43b63e){if(_0x43b63e){_0x9aa005[_0x8267('0x29')]=_0x43b63e[_0x8267('0x67')]({'plain':!![]});return db['SmsInteraction'][_0x8267('0x5a')]({'where':{'id':_0x43b63e[_0x8267('0x68')]}});}return null;})[_0x8267('0x21')](handleEntityNotFound(_0x1a41ca,null))[_0x8267('0x21')](function(_0x3be2ba){if(_0x3be2ba){return _0x3be2ba['update']({'UserId':_0x3ed226[_0x8267('0x5c')]['UserId'],'read1stAt':_[_0x8267('0x69')](_0x3be2ba[_0x8267('0x6a')])?moment()[_0x8267('0x63')](_0x8267('0x64')):undefined});}return null;})[_0x8267('0x21')](function(_0x35f5d){if(_0x35f5d){_0x9aa005['interaction']=_0x35f5d[_0x8267('0x67')]({'plain':!![]});interaction_log[_0x8267('0x22')]('[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x3ed226['user']['id'],_0x3ed226[_0x8267('0x6b')]['name'],_0x3ed226['user'][_0x8267('0x6c')],_0x9aa005[_0x8267('0x6d')]['id'],_0x3ed226[_0x8267('0x5c')]?JSON[_0x8267('0x26')](_0x3ed226[_0x8267('0x5c')]):'null');return respondWithRpcPromise(_0x8267('0x6e'),_0x8267('0x6f'),_0x9aa005);}return null;})[_0x8267('0x21')](function(_0x5e8bb4){var _0x230482=_0x8267('0x70')+_0x5e8bb4['message'][_0x8267('0x71')];return db[_0x8267('0x72')][_0x8267('0x44')](_0x230482,{'type':db[_0x8267('0x73')]['QueryTypes'][_0x8267('0x74')],'raw':!![]})[_0x8267('0x21')](function(_0x13cb34){return _0x13cb34;});})[_0x8267('0x21')](function(_0x4944e4){if(_0x4944e4){_0x9aa005[_0x8267('0x29')][_0x8267('0x75')]=_0x4944e4[0x0];if(!_0x3ed226[_0x8267('0x5c')][_0x8267('0x65')])return;return db[_0x8267('0x76')][_0x8267('0x5a')]({'where':{'id':_0x3ed226[_0x8267('0x5c')]['UserId'],'role':_0x8267('0x66')},'attributes':['id',_0x8267('0x3b'),_0x8267('0x77'),_0x8267('0x78'),_0x8267('0x79')],'raw':!![]});}return null;})['then'](function(_0x3e8342){if(!_0x3e8342)return null;_0x9aa005[_0x8267('0x29')][_0x8267('0x66')]=_0x3e8342;return _0x9aa005;})[_0x8267('0x21')](function(_0x2ee051){if(_0x2ee051){if(_0x3ed226[_0x8267('0x5c')][_0x8267('0x7a')]){_0x9aa005['message'][_0x8267('0x7b')]=util[_0x8267('0x63')](_0x8267('0x7c'),_0x3ed226['user']['name']);_0x9aa005[_0x8267('0x29')]['channel']=_0x9aa005[_0x8267('0x7d')];_0x9aa005[_0x8267('0x29')][_0x8267('0x7e')]=_0x9aa005[_0x8267('0x7d')];_0x9aa005[_0x8267('0x29')][_0x8267('0x7f')]='accept';return respondWithRpcPromise(_0x8267('0x80'),_0x8267('0x80'),{'event':_0x8267('0x81'),'message':_0x9aa005[_0x8267('0x29')]},client9002)['then'](function(){return _0x9aa005;});}return _0x9aa005;}return null;})[_0x8267('0x21')](respondWithResult(_0x1a41ca,null))[_0x8267('0x2b')](handleError(_0x1a41ca,null));};var interaction_log=require(_0x8267('0x14'))(_0x8267('0x5e'));exports[_0x8267('0x36')]=function(_0x51d294,_0xb580a6,_0x11373a){var _0x2b6407={'agent':{},'channel':_0x8267('0x60')};if(_0x51d294[_0x8267('0x5c')]['id']){delete _0x51d294[_0x8267('0x5c')]['id'];}_0x51d294['body'][_0x8267('0x65')]=_0x51d294[_0x8267('0x5c')][_0x8267('0x65')]||_0x51d294[_0x8267('0x6b')]['id'];_0x2b6407[_0x8267('0x66')]['id']=_0x51d294[_0x8267('0x5c')]['UserId'];return db[_0x8267('0x3f')]['find']({'where':{'id':_0x51d294[_0x8267('0x58')]['id'],'UserId':null}})[_0x8267('0x21')](handleEntityNotFound(_0xb580a6,null))[_0x8267('0x21')](function(_0x53bb62){if(_0x53bb62){_0x2b6407[_0x8267('0x29')]=_0x53bb62[_0x8267('0x67')]({'plain':!![]});return db[_0x8267('0x82')]['find']({'where':{'id':_0x53bb62[_0x8267('0x68')]}});}return null;})[_0x8267('0x21')](handleEntityNotFound(_0xb580a6,null))[_0x8267('0x21')](function(_0x378a45){if(_0x378a45){_0x2b6407['interaction']=_0x378a45[_0x8267('0x67')]({'plain':!![]});interaction_log[_0x8267('0x22')]('[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x51d294[_0x8267('0x6b')]['id'],_0x51d294[_0x8267('0x6b')][_0x8267('0x3b')],_0x51d294[_0x8267('0x6b')][_0x8267('0x6c')],_0x2b6407[_0x8267('0x6d')]['id'],_0x51d294[_0x8267('0x5c')]?JSON['stringify'](_0x51d294[_0x8267('0x5c')]):_0x8267('0x83'));return respondWithRpcPromise(_0x8267('0x84'),'rejectMessage',_0x2b6407);}return null;})[_0x8267('0x21')](function(_0x3a6d77){var _0x25b03c='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x3a6d77[_0x8267('0x29')][_0x8267('0x71')];return db['sequelize'][_0x8267('0x44')](_0x25b03c,{'type':db[_0x8267('0x73')][_0x8267('0x85')][_0x8267('0x74')],'raw':!![]})[_0x8267('0x21')](function(_0x2c00fa){return _0x2c00fa;});})[_0x8267('0x21')](function(_0x3521dd){if(_0x3521dd){_0x2b6407['message']['contact']=_0x3521dd[0x0];if(!_0x51d294[_0x8267('0x5c')][_0x8267('0x65')])return;return db[_0x8267('0x76')][_0x8267('0x5a')]({'where':{'id':_0x51d294['body'][_0x8267('0x65')],'role':_0x8267('0x66')},'attributes':['id',_0x8267('0x3b'),_0x8267('0x77'),_0x8267('0x78'),_0x8267('0x79')],'raw':!![]});}return null;})[_0x8267('0x21')](function(_0x85e1a6){if(!_0x85e1a6)return null;_0x2b6407['message'][_0x8267('0x66')]=_0x85e1a6;return _0x2b6407;})[_0x8267('0x21')](function(_0xfe43e5){if(_0xfe43e5){_0xfe43e5['message'][_0x8267('0x7b')]=util[_0x8267('0x63')](_0x8267('0x7c'),_0x51d294[_0x8267('0x6b')][_0x8267('0x3b')]);_0xfe43e5[_0x8267('0x29')][_0x8267('0x7d')]=_0x2b6407[_0x8267('0x7d')];_0xfe43e5[_0x8267('0x29')][_0x8267('0x7e')]=_0x2b6407[_0x8267('0x7d')];_0xfe43e5[_0x8267('0x29')][_0x8267('0x7f')]=_0x8267('0x36');respondWithRpcPromise(_0x8267('0x80'),_0x8267('0x80'),{'event':_0x8267('0x86'),'message':_0xfe43e5[_0x8267('0x29')]},client9002);return _0x2b6407;}return null;})['then'](respondWithResult(_0xb580a6,null))[_0x8267('0x2b')](handleError(_0xb580a6,null));};exports[_0x8267('0x2d')]=function(_0x5b82e9,_0x1dcea2,_0x30bc78){if(_0x5b82e9['body']['id']){delete _0x5b82e9[_0x8267('0x5c')]['id'];}var _0x1f8499;return db[_0x8267('0x3f')]['find']({'where':{'id':_0x5b82e9[_0x8267('0x58')]['id']}})['then'](handleEntityNotFound(_0x1dcea2,null))[_0x8267('0x21')](function(_0x135b88){if(_0x135b88){_0x1f8499=_0x135b88;return db['SmsAccount'][_0x8267('0x5a')]({'where':{'id':_0x135b88[_0x8267('0x87')]}});}})['then'](handleEntityNotFound(_0x1dcea2,null))[_0x8267('0x21')](function(_0x859e7){if(_0x859e7){logger[_0x8267('0x24')](_0x8267('0x88'),_0x8267('0x2d'),_0x8267('0x89'),_0x859e7[_0x8267('0x41')],util[_0x8267('0x8a')](_0x5b82e9[_0x8267('0x5c')],{'showHidden':![],'depth':null}));switch(_0x859e7[_0x8267('0x41')]){case'twilio':if(_0x5b82e9[_0x8267('0x5c')][_0x8267('0x8b')]&&_0x5b82e9[_0x8267('0x5c')]['MessageSid']===_0x1f8499[_0x8267('0x8c')]){return _0x1f8499[_0x8267('0x38')]({'read':!![]});}else{logger['error'](_0x8267('0x8d'),_0x8267('0x2d'),_0x8267('0x8e'),util[_0x8267('0x8a')](_0x5b82e9[_0x8267('0x5c')],{'showHidden':![],'depth':null}));}break;case _0x8267('0x8f'):if(_0x5b82e9[_0x8267('0x5c')]['MessageUUID']&&_0x5b82e9[_0x8267('0x5c')][_0x8267('0x90')]===_0x1f8499[_0x8267('0x8c')]&&_['indexOf']([_0x8267('0x91'),'delivered'],_0x5b82e9[_0x8267('0x5c')][_0x8267('0x92')])>=0x0){return _0x1f8499[_0x8267('0x38')]({'read':!![]});}else{logger[_0x8267('0x27')](_0x8267('0x8d'),'status',_0x8267('0x93'),util[_0x8267('0x8a')](_0x5b82e9[_0x8267('0x5c')],{'showHidden':![],'depth':null}));}break;case _0x8267('0x94'):var _0x33c93c=_0x5b82e9[_0x8267('0x5c')][_0x8267('0x95')][0x0];if(_0x33c93c[_0x8267('0x2d')][_0x8267('0x96')]===_0x8267('0x97')){return _0x1f8499[_0x8267('0x38')]({'read':!![]});}else{logger['error'](_0x8267('0x8d'),_0x8267('0x2d'),_0x8267('0x94'),util[_0x8267('0x8a')](_0x5b82e9[_0x8267('0x5c')],{'showHidden':![],'depth':null}));}break;}return _0x1f8499;}})[_0x8267('0x21')](respondWithResult(_0x1dcea2,null))[_0x8267('0x2b')](handleError(_0x1dcea2,null));}; \ No newline at end of file +var _0xfdad=['user','agent','get','SmsInteraction','SmsInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','SELECT','User','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','RejectMessage','rejectMessage','contact','rejectmessage','SmsAccount','SmsAccountId','SmsMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','twilio','plivo','MessageUUID','indexOf','sent','delivered','Status','results','groupName','DELIVERED','infobip','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./smsMessage.socket','register','jayson/promise','http','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','destroy','stack','name','index','map','SmsMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','find','create','body','sms-interactions','accept','sms','read','readAt','format','UserId'];(function(_0x119ded,_0x497e72){var _0x22108b=function(_0x3da0cf){while(--_0x3da0cf){_0x119ded['push'](_0x119ded['shift']());}};_0x22108b(++_0x497e72);}(_0xfdad,0x164));var _0xdfda=function(_0x3d187f,_0x5177af){_0x3d187f=_0x3d187f-0x0;var _0x3ccce7=_0xfdad[_0x3d187f];return _0x3ccce7;};'use strict';var emlformat=require(_0xdfda('0x0'));var rimraf=require(_0xdfda('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdfda('0x2'));var rp=require(_0xdfda('0x3'));var moment=require('moment');var BPromise=require(_0xdfda('0x4'));var Mustache=require(_0xdfda('0x5'));var util=require(_0xdfda('0x6'));var path=require('path');var sox=require(_0xdfda('0x7'));var csv=require(_0xdfda('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdfda('0x9'));var _=require(_0xdfda('0xa'));var squel=require(_0xdfda('0xb'));var crypto=require(_0xdfda('0xc'));var jsforce=require(_0xdfda('0xd'));var deskjs=require(_0xdfda('0xe'));var toCsv=require(_0xdfda('0x8'));var querystring=require(_0xdfda('0xf'));var Papa=require(_0xdfda('0x10'));var Redis=require(_0xdfda('0x11'));var authService=require(_0xdfda('0x12'));var qs=require(_0xdfda('0x13'));var as=require(_0xdfda('0x14'));var hardwareService=require(_0xdfda('0x15'));var logger=require(_0xdfda('0x16'))(_0xdfda('0x17'));var utils=require('../../config/utils');var config=require(_0xdfda('0x18'));var licenseUtil=require(_0xdfda('0x19'));var db=require(_0xdfda('0x1a'))['db'];config[_0xdfda('0x1b')]=_[_0xdfda('0x1c')](config['redis'],{'host':_0xdfda('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xdfda('0x1e'))[_0xdfda('0x1f')](socket);var jayson=require(_0xdfda('0x20'));var client=jayson['client'][_0xdfda('0x21')]({'port':0x232c});var client9002=jayson['client'][_0xdfda('0x21')]({'port':0x232a});function respondWithRpcPromise(_0xf250d0,_0x19d124,_0x3fe8ff,_0x55b626){return new BPromise(function(_0x5baf98,_0x1a791e){var _0x2f3d09=_0x55b626||client;return _0x2f3d09[_0xdfda('0x22')](_0xf250d0,_0x3fe8ff)[_0xdfda('0x23')](function(_0x4ecc87){logger[_0xdfda('0x24')](_0xdfda('0x25'),_0x19d124,_0xdfda('0x26'));logger[_0xdfda('0x27')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x19d124,_0xdfda('0x26'),JSON[_0xdfda('0x28')](_0x4ecc87));if(_0x4ecc87[_0xdfda('0x29')]){if(_0x4ecc87['error']['code']===0x1f4){logger['error'](_0xdfda('0x25'),_0x19d124,_0x4ecc87['error'][_0xdfda('0x2a')]);return _0x1a791e(_0x4ecc87[_0xdfda('0x29')][_0xdfda('0x2a')]);}logger[_0xdfda('0x29')](_0xdfda('0x25'),_0x19d124,_0x4ecc87['error'][_0xdfda('0x2a')]);return _0x5baf98(_0x4ecc87[_0xdfda('0x29')]['message']);}else{logger[_0xdfda('0x24')]('SmsMessage,\x20%s,\x20%s',_0x19d124,'request\x20sent');_0x5baf98(_0x4ecc87['result'][_0xdfda('0x2a')]);}})[_0xdfda('0x2b')](function(_0x24f892){logger['error'](_0xdfda('0x25'),_0x19d124,_0x24f892);_0x1a791e(_0x24f892);});});}function respondWithStatusCode(_0x55b0e6,_0x3dc264){_0x3dc264=_0x3dc264||0xcc;return function(_0x2e70c0){if(_0x2e70c0){return _0x55b0e6[_0xdfda('0x2c')](_0x3dc264);}return _0x55b0e6[_0xdfda('0x2d')](_0x3dc264)[_0xdfda('0x2e')]();};}function respondWithResult(_0xb4eac1,_0x9f5aff){_0x9f5aff=_0x9f5aff||0xc8;return function(_0x36727d){if(_0x36727d){return _0xb4eac1['status'](_0x9f5aff)[_0xdfda('0x2f')](_0x36727d);}};}function respondWithFilteredResult(_0x57331a,_0x1e0f8f){return function(_0x594822){if(_0x594822){var _0x12a057=typeof _0x1e0f8f[_0xdfda('0x30')]==='undefined'&&typeof _0x1e0f8f[_0xdfda('0x31')]===_0xdfda('0x32');var _0x4351f6=_0x594822['count'];var _0x29e8ac=_0x12a057?0x0:_0x1e0f8f[_0xdfda('0x30')];var _0x5d3673=_0x12a057?_0x594822[_0xdfda('0x33')]:_0x1e0f8f['offset']+_0x1e0f8f[_0xdfda('0x31')];var _0x20d136;if(_0x5d3673>=_0x4351f6){_0x5d3673=_0x4351f6;_0x20d136=0xc8;}else{_0x20d136=0xce;}_0x57331a[_0xdfda('0x2d')](_0x20d136);return _0x57331a[_0xdfda('0x34')](_0xdfda('0x35'),_0x29e8ac+'-'+_0x5d3673+'/'+_0x4351f6)[_0xdfda('0x2f')](_0x594822);}return null;};}function patchUpdates(_0x4a7e41){return function(_0x1addf5){try{jsonpatch['apply'](_0x1addf5,_0x4a7e41,!![]);}catch(_0x4b9383){return BPromise[_0xdfda('0x36')](_0x4b9383);}return _0x1addf5[_0xdfda('0x37')]();};}function saveUpdates(_0x137031,_0x47ee58){return function(_0x52cc67){if(_0x52cc67){return _0x52cc67[_0xdfda('0x38')](_0x137031)['then'](function(_0xcc78f1){return _0xcc78f1;});}return null;};}function removeEntity(_0x378890,_0x135b70){return function(_0x1ecd0e){if(_0x1ecd0e){return _0x1ecd0e[_0xdfda('0x39')]()[_0xdfda('0x23')](function(){_0x378890[_0xdfda('0x2d')](0xcc)[_0xdfda('0x2e')]();});}};}function handleEntityNotFound(_0x1c30da,_0x5e02a5){return function(_0x593d76){if(!_0x593d76){_0x1c30da[_0xdfda('0x2c')](0x194);}return _0x593d76;};}function handleError(_0x2e0b94,_0x326833){_0x326833=_0x326833||0x1f4;return function(_0x189523){logger[_0xdfda('0x29')](_0x189523[_0xdfda('0x3a')]);if(_0x189523[_0xdfda('0x3b')]){delete _0x189523[_0xdfda('0x3b')];}_0x2e0b94['status'](_0x326833)['send'](_0x189523);};}exports[_0xdfda('0x3c')]=function(_0xa5077f,_0x24176b){var _0xc47138={},_0x5908a3={},_0xd27cc5={'count':0x0,'rows':[]};var _0x46bd17=_[_0xdfda('0x3d')](db[_0xdfda('0x3e')][_0xdfda('0x3f')],function(_0x52dcbf){return{'name':_0x52dcbf[_0xdfda('0x40')],'type':_0x52dcbf[_0xdfda('0x41')][_0xdfda('0x42')]};});_0x5908a3[_0xdfda('0x43')]=_[_0xdfda('0x3d')](_0x46bd17,_0xdfda('0x3b'));_0x5908a3[_0xdfda('0x44')]=_[_0xdfda('0x45')](_0xa5077f[_0xdfda('0x44')]);_0x5908a3[_0xdfda('0x46')]=_[_0xdfda('0x47')](_0x5908a3[_0xdfda('0x43')],_0x5908a3[_0xdfda('0x44')]);_0xc47138['attributes']=_[_0xdfda('0x47')](_0x5908a3[_0xdfda('0x43')],qs[_0xdfda('0x48')](_0xa5077f[_0xdfda('0x44')][_0xdfda('0x48')]));_0xc47138[_0xdfda('0x49')]=_0xc47138['attributes'][_0xdfda('0x4a')]?_0xc47138[_0xdfda('0x49')]:_0x5908a3[_0xdfda('0x43')];if(!_0xa5077f[_0xdfda('0x44')][_0xdfda('0x4b')](_0xdfda('0x4c'))){_0xc47138[_0xdfda('0x31')]=qs[_0xdfda('0x31')](_0xa5077f[_0xdfda('0x44')][_0xdfda('0x31')]);_0xc47138[_0xdfda('0x30')]=qs[_0xdfda('0x30')](_0xa5077f['query'][_0xdfda('0x30')]);}_0xc47138[_0xdfda('0x4d')]=qs[_0xdfda('0x4e')](_0xa5077f[_0xdfda('0x44')][_0xdfda('0x4e')]);_0xc47138['where']=qs['filters'](_[_0xdfda('0x4f')](_0xa5077f[_0xdfda('0x44')],_0x5908a3['filters']),_0x46bd17);if(_0xa5077f['query'][_0xdfda('0x50')]){_0xc47138[_0xdfda('0x51')]=_[_0xdfda('0x52')](_0xc47138['where'],{'$or':_[_0xdfda('0x3d')](_0x46bd17,function(_0x44c46e){if(_0x44c46e[_0xdfda('0x41')]!==_0xdfda('0x53')){var _0x600f68={};_0x600f68[_0x44c46e['name']]={'$like':'%'+_0xa5077f['query'][_0xdfda('0x50')]+'%'};return _0x600f68;}})});}_0xc47138=_[_0xdfda('0x52')]({},_0xc47138,_0xa5077f[_0xdfda('0x54')]);var _0x30d443={'where':_0xc47138[_0xdfda('0x51')]};return db[_0xdfda('0x3e')][_0xdfda('0x33')](_0x30d443)['then'](function(_0x41e9f1){_0xd27cc5['count']=_0x41e9f1;if(_0xa5077f[_0xdfda('0x44')][_0xdfda('0x55')]){_0xc47138[_0xdfda('0x56')]=[{'all':!![]}];}return db[_0xdfda('0x3e')][_0xdfda('0x57')](_0xc47138);})['then'](function(_0x3dc88c){_0xd27cc5[_0xdfda('0x58')]=_0x3dc88c;return _0xd27cc5;})[_0xdfda('0x23')](respondWithFilteredResult(_0x24176b,_0xc47138))[_0xdfda('0x2b')](handleError(_0x24176b,null));};exports['show']=function(_0x2db515,_0x2fb758){var _0x292d84={'raw':!![],'where':{'id':_0x2db515[_0xdfda('0x59')]['id']}},_0x5351fb={};_0x5351fb[_0xdfda('0x43')]=_['keys'](db[_0xdfda('0x3e')][_0xdfda('0x3f')]);_0x5351fb[_0xdfda('0x44')]=_[_0xdfda('0x45')](_0x2db515['query']);_0x5351fb[_0xdfda('0x46')]=_['intersection'](_0x5351fb['model'],_0x5351fb[_0xdfda('0x44')]);_0x292d84[_0xdfda('0x49')]=_[_0xdfda('0x47')](_0x5351fb[_0xdfda('0x43')],qs[_0xdfda('0x48')](_0x2db515[_0xdfda('0x44')]['fields']));_0x292d84['attributes']=_0x292d84[_0xdfda('0x49')]['length']?_0x292d84[_0xdfda('0x49')]:_0x5351fb['model'];if(_0x2db515[_0xdfda('0x44')][_0xdfda('0x55')]){_0x292d84[_0xdfda('0x56')]=[{'all':!![]}];}_0x292d84=_[_0xdfda('0x52')]({},_0x292d84,_0x2db515['options']);return db[_0xdfda('0x3e')][_0xdfda('0x5a')](_0x292d84)[_0xdfda('0x23')](handleEntityNotFound(_0x2fb758,null))[_0xdfda('0x23')](respondWithResult(_0x2fb758,null))[_0xdfda('0x2b')](handleError(_0x2fb758,null));};exports['create']=function(_0xe58ef8,_0x179e87){return db['SmsMessage'][_0xdfda('0x5b')](_0xe58ef8['body'],{})[_0xdfda('0x23')](respondWithResult(_0x179e87,0xc9))['catch'](handleError(_0x179e87,null));};exports[_0xdfda('0x38')]=function(_0xf19b5e,_0x467e50){if(_0xf19b5e[_0xdfda('0x5c')]['id']){delete _0xf19b5e[_0xdfda('0x5c')]['id'];}return db[_0xdfda('0x3e')]['find']({'where':{'id':_0xf19b5e[_0xdfda('0x59')]['id']}})[_0xdfda('0x23')](handleEntityNotFound(_0x467e50,null))[_0xdfda('0x23')](saveUpdates(_0xf19b5e['body'],null))[_0xdfda('0x23')](respondWithResult(_0x467e50,null))[_0xdfda('0x2b')](handleError(_0x467e50,null));};exports[_0xdfda('0x39')]=function(_0x5e9c60,_0x180d2f){return db[_0xdfda('0x3e')][_0xdfda('0x5a')]({'where':{'id':_0x5e9c60[_0xdfda('0x59')]['id']}})[_0xdfda('0x23')](handleEntityNotFound(_0x180d2f,null))[_0xdfda('0x23')](removeEntity(_0x180d2f,null))['catch'](handleError(_0x180d2f,null));};exports['describe']=function(_0x40ebf2,_0x59d895){return db[_0xdfda('0x3e')]['describe']()['then'](respondWithResult(_0x59d895,null))['catch'](handleError(_0x59d895,null));};var interaction_log=require('../../config/logger')(_0xdfda('0x5d'));exports[_0xdfda('0x5e')]=function(_0x4d5c8e,_0x3a7562,_0x5c4c8f){var _0x51974c={'agent':{},'channel':_0xdfda('0x5f')};if(_0x4d5c8e[_0xdfda('0x5c')]['id']){delete _0x4d5c8e[_0xdfda('0x5c')]['id'];}_0x4d5c8e[_0xdfda('0x5c')][_0xdfda('0x60')]=!![];_0x4d5c8e[_0xdfda('0x5c')][_0xdfda('0x61')]=moment()[_0xdfda('0x62')]('YYYY-MM-DD\x20HH:mm:ss');_0x4d5c8e[_0xdfda('0x5c')][_0xdfda('0x63')]=_0x4d5c8e['body']['UserId']||_0x4d5c8e[_0xdfda('0x64')]['id'];_0x51974c[_0xdfda('0x65')]['id']=_0x4d5c8e[_0xdfda('0x5c')]['UserId'];return db[_0xdfda('0x3e')][_0xdfda('0x5a')]({'where':{'id':_0x4d5c8e[_0xdfda('0x59')]['id'],'UserId':null}})[_0xdfda('0x23')](handleEntityNotFound(_0x3a7562,null))[_0xdfda('0x23')](saveUpdates(_0x4d5c8e['body'],null))[_0xdfda('0x23')](function(_0x59c2a8){if(_0x59c2a8){_0x51974c[_0xdfda('0x2a')]=_0x59c2a8[_0xdfda('0x66')]({'plain':!![]});return db[_0xdfda('0x67')]['find']({'where':{'id':_0x59c2a8[_0xdfda('0x68')]}});}return null;})[_0xdfda('0x23')](handleEntityNotFound(_0x3a7562,null))[_0xdfda('0x23')](function(_0x3fb84d){if(_0x3fb84d){return _0x3fb84d['update']({'UserId':_0x4d5c8e[_0xdfda('0x5c')][_0xdfda('0x63')],'read1stAt':_[_0xdfda('0x69')](_0x3fb84d[_0xdfda('0x6a')])?moment()['format'](_0xdfda('0x6b')):undefined});}return null;})[_0xdfda('0x23')](function(_0x5f33b3){if(_0x5f33b3){_0x51974c[_0xdfda('0x6c')]=_0x5f33b3[_0xdfda('0x66')]({'plain':!![]});interaction_log[_0xdfda('0x24')](_0xdfda('0x6d'),_0x4d5c8e[_0xdfda('0x64')]['id'],_0x4d5c8e[_0xdfda('0x64')][_0xdfda('0x3b')],_0x4d5c8e[_0xdfda('0x64')][_0xdfda('0x6e')],_0x51974c['interaction']['id'],_0x4d5c8e[_0xdfda('0x5c')]?JSON['stringify'](_0x4d5c8e[_0xdfda('0x5c')]):_0xdfda('0x6f'));return respondWithRpcPromise('AcceptMessage',_0xdfda('0x70'),_0x51974c);}return null;})[_0xdfda('0x23')](function(_0x2b842d){var _0x2e5822=_0xdfda('0x71')+_0x2b842d['message'][_0xdfda('0x72')];return db[_0xdfda('0x73')][_0xdfda('0x44')](_0x2e5822,{'type':db[_0xdfda('0x74')]['QueryTypes'][_0xdfda('0x75')],'raw':!![]})['then'](function(_0x29c775){return _0x29c775;});})[_0xdfda('0x23')](function(_0x954753){if(_0x954753){_0x51974c[_0xdfda('0x2a')]['contact']=_0x954753[0x0];if(!_0x4d5c8e['body']['UserId'])return;return db[_0xdfda('0x76')][_0xdfda('0x5a')]({'where':{'id':_0x4d5c8e['body'][_0xdfda('0x63')],'role':'agent'},'attributes':['id',_0xdfda('0x3b'),'fullname',_0xdfda('0x77'),_0xdfda('0x78')],'raw':!![]});}return null;})['then'](function(_0x437971){if(!_0x437971)return null;_0x51974c[_0xdfda('0x2a')][_0xdfda('0x65')]=_0x437971;return _0x51974c;})['then'](function(_0x34b6cc){if(_0x34b6cc){if(_0x4d5c8e[_0xdfda('0x5c')][_0xdfda('0x79')]){_0x51974c[_0xdfda('0x2a')][_0xdfda('0x7a')]=util[_0xdfda('0x62')](_0xdfda('0x7b'),_0x4d5c8e[_0xdfda('0x64')]['name']);_0x51974c[_0xdfda('0x2a')][_0xdfda('0x7c')]=_0x51974c[_0xdfda('0x7c')];_0x51974c[_0xdfda('0x2a')][_0xdfda('0x7d')]=_0x51974c[_0xdfda('0x7c')];_0x51974c[_0xdfda('0x2a')][_0xdfda('0x7e')]=_0xdfda('0x5e');return respondWithRpcPromise(_0xdfda('0x7f'),'EventManager',{'event':_0xdfda('0x80'),'message':_0x51974c[_0xdfda('0x2a')]},client9002)[_0xdfda('0x23')](function(){return _0x51974c;});}return _0x51974c;}return null;})[_0xdfda('0x23')](respondWithResult(_0x3a7562,null))[_0xdfda('0x2b')](handleError(_0x3a7562,null));};var interaction_log=require(_0xdfda('0x16'))(_0xdfda('0x5d'));exports[_0xdfda('0x36')]=function(_0x827989,_0x4894e1,_0x23b705){var _0x393a70={'agent':{},'channel':_0xdfda('0x5f')};if(_0x827989[_0xdfda('0x5c')]['id']){delete _0x827989[_0xdfda('0x5c')]['id'];}_0x827989['body'][_0xdfda('0x63')]=_0x827989[_0xdfda('0x5c')][_0xdfda('0x63')]||_0x827989['user']['id'];_0x393a70[_0xdfda('0x65')]['id']=_0x827989[_0xdfda('0x5c')][_0xdfda('0x63')];return db[_0xdfda('0x3e')]['find']({'where':{'id':_0x827989[_0xdfda('0x59')]['id'],'UserId':null}})[_0xdfda('0x23')](handleEntityNotFound(_0x4894e1,null))[_0xdfda('0x23')](function(_0x318b13){if(_0x318b13){_0x393a70[_0xdfda('0x2a')]=_0x318b13[_0xdfda('0x66')]({'plain':!![]});return db[_0xdfda('0x67')][_0xdfda('0x5a')]({'where':{'id':_0x318b13[_0xdfda('0x68')]}});}return null;})[_0xdfda('0x23')](handleEntityNotFound(_0x4894e1,null))[_0xdfda('0x23')](function(_0x2618bc){if(_0x2618bc){_0x393a70[_0xdfda('0x6c')]=_0x2618bc['get']({'plain':!![]});interaction_log[_0xdfda('0x24')]('[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x827989['user']['id'],_0x827989[_0xdfda('0x64')]['name'],_0x827989['user']['role'],_0x393a70[_0xdfda('0x6c')]['id'],_0x827989[_0xdfda('0x5c')]?JSON['stringify'](_0x827989[_0xdfda('0x5c')]):_0xdfda('0x6f'));return respondWithRpcPromise(_0xdfda('0x81'),_0xdfda('0x82'),_0x393a70);}return null;})[_0xdfda('0x23')](function(_0x3e426f){var _0x4bd1b4=_0xdfda('0x71')+_0x3e426f['message']['ContactId'];return db[_0xdfda('0x73')]['query'](_0x4bd1b4,{'type':db[_0xdfda('0x74')]['QueryTypes'][_0xdfda('0x75')],'raw':!![]})[_0xdfda('0x23')](function(_0xbc7a6d){return _0xbc7a6d;});})[_0xdfda('0x23')](function(_0x20ebfa){if(_0x20ebfa){_0x393a70[_0xdfda('0x2a')][_0xdfda('0x83')]=_0x20ebfa[0x0];if(!_0x827989['body']['UserId'])return;return db['User'][_0xdfda('0x5a')]({'where':{'id':_0x827989['body'][_0xdfda('0x63')],'role':_0xdfda('0x65')},'attributes':['id',_0xdfda('0x3b'),'fullname',_0xdfda('0x77'),_0xdfda('0x78')],'raw':!![]});}return null;})[_0xdfda('0x23')](function(_0x79426){if(!_0x79426)return null;_0x393a70[_0xdfda('0x2a')][_0xdfda('0x65')]=_0x79426;return _0x393a70;})[_0xdfda('0x23')](function(_0x14261c){if(_0x14261c){_0x14261c['message']['interface']=util[_0xdfda('0x62')](_0xdfda('0x7b'),_0x827989[_0xdfda('0x64')][_0xdfda('0x3b')]);_0x14261c[_0xdfda('0x2a')][_0xdfda('0x7c')]=_0x393a70[_0xdfda('0x7c')];_0x14261c[_0xdfda('0x2a')]['motionChannel']=_0x393a70[_0xdfda('0x7c')];_0x14261c['message']['event']=_0xdfda('0x36');respondWithRpcPromise(_0xdfda('0x7f'),'EventManager',{'event':_0xdfda('0x84'),'message':_0x14261c[_0xdfda('0x2a')]},client9002);return _0x393a70;}return null;})['then'](respondWithResult(_0x4894e1,null))['catch'](handleError(_0x4894e1,null));};exports[_0xdfda('0x2d')]=function(_0x2b9a5d,_0x216e05,_0x2e2b95){if(_0x2b9a5d[_0xdfda('0x5c')]['id']){delete _0x2b9a5d[_0xdfda('0x5c')]['id'];}var _0x58cf47;return db[_0xdfda('0x3e')][_0xdfda('0x5a')]({'where':{'id':_0x2b9a5d[_0xdfda('0x59')]['id']}})[_0xdfda('0x23')](handleEntityNotFound(_0x216e05,null))[_0xdfda('0x23')](function(_0x45ba14){if(_0x45ba14){_0x58cf47=_0x45ba14;return db[_0xdfda('0x85')][_0xdfda('0x5a')]({'where':{'id':_0x45ba14[_0xdfda('0x86')]}});}})[_0xdfda('0x23')](handleEntityNotFound(_0x216e05,null))[_0xdfda('0x23')](function(_0x414e70){if(_0x414e70){logger[_0xdfda('0x27')](_0xdfda('0x87'),_0xdfda('0x2d'),_0xdfda('0x88'),_0x414e70[_0xdfda('0x41')],util[_0xdfda('0x89')](_0x2b9a5d[_0xdfda('0x5c')],{'showHidden':![],'depth':null}));switch(_0x414e70[_0xdfda('0x41')]){case'twilio':if(_0x2b9a5d['body'][_0xdfda('0x8a')]&&_0x2b9a5d['body'][_0xdfda('0x8a')]===_0x58cf47[_0xdfda('0x8b')]){return _0x58cf47[_0xdfda('0x38')]({'read':!![]});}else{logger[_0xdfda('0x29')](_0xdfda('0x8c'),_0xdfda('0x2d'),_0xdfda('0x8d'),util[_0xdfda('0x89')](_0x2b9a5d[_0xdfda('0x5c')],{'showHidden':![],'depth':null}));}break;case _0xdfda('0x8e'):if(_0x2b9a5d['body'][_0xdfda('0x8f')]&&_0x2b9a5d[_0xdfda('0x5c')][_0xdfda('0x8f')]===_0x58cf47['messageId']&&_[_0xdfda('0x90')]([_0xdfda('0x91'),_0xdfda('0x92')],_0x2b9a5d[_0xdfda('0x5c')][_0xdfda('0x93')])>=0x0){return _0x58cf47['update']({'read':!![]});}else{logger[_0xdfda('0x29')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xdfda('0x2d'),'plivio',util[_0xdfda('0x89')](_0x2b9a5d[_0xdfda('0x5c')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x4954be=_0x2b9a5d[_0xdfda('0x5c')][_0xdfda('0x94')][0x0];if(_0x4954be[_0xdfda('0x2d')][_0xdfda('0x95')]===_0xdfda('0x96')){return _0x58cf47['update']({'read':!![]});}else{logger[_0xdfda('0x29')](_0xdfda('0x8c'),_0xdfda('0x2d'),_0xdfda('0x97'),util[_0xdfda('0x89')](_0x2b9a5d[_0xdfda('0x5c')],{'showHidden':![],'depth':null}));}break;}return _0x58cf47;}})[_0xdfda('0x23')](respondWithResult(_0x216e05,null))[_0xdfda('0x2b')](handleError(_0x216e05,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index 86e826e..a411a7a 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 _0xd492=['exports','events','../../mysqldb','setMaxListeners','save','update','remove','emit','hook'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd492,0x18d));var _0x2d49=function(_0x57e47a,_0x5257f8){_0x57e47a=_0x57e47a-0x0;var _0x56a66f=_0xd492[_0x57e47a];return _0x56a66f;};'use strict';var EventEmitter=require(_0x2d49('0x0'));var SmsMessage=require(_0x2d49('0x1'))['db']['SmsMessage'];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x2d49('0x2')](0x0);var events={'afterCreate':_0x2d49('0x3'),'afterUpdate':_0x2d49('0x4'),'afterDestroy':_0x2d49('0x5')};function emitEvent(_0x291682){return function(_0x23d415,_0x441072,_0x231dd8){SmsMessageEvents[_0x2d49('0x6')](_0x291682+':'+_0x23d415['id'],_0x23d415);SmsMessageEvents[_0x2d49('0x6')](_0x291682,_0x23d415);_0x231dd8(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsMessage[_0x2d49('0x7')](e,emitEvent(event));}}module[_0x2d49('0x8')]=SmsMessageEvents; \ No newline at end of file +var _0x93f0=['exports','events','../../mysqldb','SmsMessage','update','remove','emit','hook'];(function(_0x5d6f0a,_0x54fe5e){var _0x108f44=function(_0x16b66c){while(--_0x16b66c){_0x5d6f0a['push'](_0x5d6f0a['shift']());}};_0x108f44(++_0x54fe5e);}(_0x93f0,0x1b9));var _0x093f=function(_0x386b27,_0x51c316){_0x386b27=_0x386b27-0x0;var _0x8c021b=_0x93f0[_0x386b27];return _0x8c021b;};'use strict';var EventEmitter=require(_0x093f('0x0'));var SmsMessage=require(_0x093f('0x1'))['db'][_0x093f('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x093f('0x3'),'afterDestroy':_0x093f('0x4')};function emitEvent(_0x46412a){return function(_0x3074cf,_0x5de046,_0x504eeb){SmsMessageEvents[_0x093f('0x5')](_0x46412a+':'+_0x3074cf['id'],_0x3074cf);SmsMessageEvents[_0x093f('0x5')](_0x46412a,_0x3074cf);_0x504eeb(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsMessage[_0x093f('0x6')](e,emitEvent(event));}}module[_0x093f('0x7')]=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index 33c4544..ed43c27 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 _0x04a5=['id_sms','https://platform.clickatell.com/messages','uuid','UTF-8','apiMessageId','clickatell','/messages','applicationId','base64','bandwidth','https://api.intelepeer.com/_rest/v4/app/sms/send','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','intelepeer','Token\x20not\x20received','utf8mb4','lodash','moment','bluebird','request-promise','path','rimraf','./smsMessage.attributes','define','SmsMessage','sms_messages','messageId','body','FULLTEXT','models','get','toLowerCase','out','secret','isNil','UserId','SmsInteraction','findOne','SmsInteractionId','then','update','createdAt','direction','catch','SmsAccount','find','SmsAccountId','type','twilio','accountSid','authToken','messages','create','phone','remote','/status?token=','token','error','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','password','smsMethod','sender','username','&password=','GET','split','sms','user_key','session_key','internal_order_id','deliveryReport','read','senderString','POST','https://smsapi.connectel.se/api/v2/send/','requestid','connectel','xCALLY\x20Motion','https://rest.clicksend.com/v3/sms/send','format','http_code','data','queued_count','head','message_id','clickSend','Missing\x20parameters:\x20username,\x20password','plivo','authId','/api/sms/messages/','%s:%s','https://api.plivo.com/v1/Account/%s/Message/','Basic\x20%s','toString','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','application/json','IBSSO\x20','Missing\x20parameters:\x20base_url','csc','crypto','apiKey','timestamp','keys','createHash','md5','digest','hex','signature=','/external/get/send.php?'];(function(_0x4f38a4,_0x3ed3a1){var _0x49e13d=function(_0x13fa96){while(--_0x13fa96){_0x4f38a4['push'](_0x4f38a4['shift']());}};_0x49e13d(++_0x3ed3a1);}(_0x04a5,0xfd));var _0x504a=function(_0x2dce9f,_0x1d1880){_0x2dce9f=_0x2dce9f-0x0;var _0x1cd454=_0x04a5[_0x2dce9f];return _0x1cd454;};'use strict';var _=require(_0x504a('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x504a('0x1'));var BPromise=require(_0x504a('0x2'));var rp=require(_0x504a('0x3'));var fs=require('fs');var path=require(_0x504a('0x4'));var rimraf=require(_0x504a('0x5'));var config=require('../../config/environment');var attributes=require(_0x504a('0x6'));module['exports']=function(_0x1879d5,_0x3f10e0){return _0x1879d5[_0x504a('0x7')](_0x504a('0x8'),attributes,{'tableName':_0x504a('0x9'),'paranoid':![],'indexes':[{'name':_0x504a('0xa'),'fields':[_0x504a('0xa')]},{'name':'fti_sms_messages','fields':[_0x504a('0xb')],'type':_0x504a('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x8239b2,_0x1e8309,_0x2e71bf){var _0x1735e1=_0x1879d5[_0x504a('0xd')];var _0x1ab621=_0x8239b2[_0x504a('0xe')]({'plain':!![]});if(_0x1ab621['direction'][_0x504a('0xf')]()==='in'||_0x1ab621['direction'][_0x504a('0xf')]()===_0x504a('0x10')&&!_0x1ab621[_0x504a('0x11')]&&!_[_0x504a('0x12')](_0x1ab621[_0x504a('0x13')])&&!_[_0x504a('0x12')](_0x1ab621['SmsInteractionId'])){_0x1735e1[_0x504a('0x14')][_0x504a('0x15')]({'where':{'id':_0x1ab621[_0x504a('0x16')]}})[_0x504a('0x17')](function(_0xa8e473){if(_0xa8e473){_0xa8e473[_0x504a('0x18')]({'lastMsgAt':_0x1ab621[_0x504a('0x19')],'lastMsgDirection':_0x1ab621[_0x504a('0x1a')]['toLowerCase']()});}})[_0x504a('0x1b')](function(_0x46fc32){console['error'](_0x46fc32);});}if(_0x1ab621['direction']===_0x504a('0x10')&&!_0x1ab621[_0x504a('0x11')]){var _0x29b6f6;_0x1735e1[_0x504a('0x1c')][_0x504a('0x1d')]({'where':{'id':_0x1ab621[_0x504a('0x1e')]},'raw':!![]})[_0x504a('0x17')](function(_0x5026c7){_0x29b6f6=_0x5026c7;if(_0x29b6f6&&_0x29b6f6['type']){switch(_0x29b6f6[_0x504a('0x1f')]){case _0x504a('0x20'):var _0x1fe632=require(_0x504a('0x20'));if(_0x29b6f6[_0x504a('0x21')]&&_0x29b6f6[_0x504a('0x22')]&&_0x29b6f6['phone']){var _0x382dbc=new _0x1fe632(_0x29b6f6['accountSid'],_0x29b6f6[_0x504a('0x22')]);_0x382dbc[_0x504a('0x23')][_0x504a('0x24')]({'body':_0x1ab621[_0x504a('0xb')],'to':_0x1ab621[_0x504a('0x25')],'from':_0x29b6f6['phone'],'statusCallback':_0x29b6f6[_0x504a('0x26')]+'/api/sms/messages/'+_0x1ab621['id']+_0x504a('0x27')+_0x29b6f6[_0x504a('0x28')]})[_0x504a('0x17')](function(_0x42beb9){if(_0x42beb9['sid']){return _0x8239b2[_0x504a('0x18')]({'messageId':_0x42beb9['sid']});}})[_0x504a('0x1b')](function(_0x322b0f){logger[_0x504a('0x29')](_0x504a('0x2a'),_0x504a('0x2b'),'twilio',util[_0x504a('0x2c')](_0x322b0f,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x504a('0x20'),_0x504a('0x2d'));}break;case _0x504a('0x2e'):var _0xf0da68='https://api.skebby.it/API/v1.0/REST/';if(_0x29b6f6['username']&&_0x29b6f6[_0x504a('0x2f')]){var _0x248b50={'recipient':[_0x1ab621[_0x504a('0x25')]],'message':_0x1ab621[_0x504a('0xb')],'message_type':_0x29b6f6[_0x504a('0x30')]};if(_0x29b6f6[_0x504a('0x30')]&&_0x29b6f6[_0x504a('0x30')]!=='SI'){_0x248b50[_0x504a('0x31')]=_0x29b6f6[_0x504a('0x25')];}var _0x105430={'url':_0xf0da68+'login?username='+_0x29b6f6[_0x504a('0x32')]+_0x504a('0x33')+_0x29b6f6[_0x504a('0x2f')],'method':_0x504a('0x34')};rp(_0x105430)[_0x504a('0x17')](function(_0x3b7d3a){var _0x452a9b=_0x3b7d3a[_0x504a('0x35')](';');var _0x40258d={'user_key':_0x452a9b[0x0],'session_key':_0x452a9b[0x1]};_0x105430={'url':_0xf0da68+_0x504a('0x36'),'method':'POST','headers':{'user_key':_0x40258d[_0x504a('0x37')],'Session_key':_0x40258d[_0x504a('0x38')]},'json':!![],'body':_0x248b50};return rp(_0x105430);})[_0x504a('0x17')](function(_0xe391b1){if(_0xe391b1['total_sent']>=0x1){var _0xbe7a1f={'messageId':_0xe391b1[_0x504a('0x39')]};if(_0x29b6f6[_0x504a('0x30')]!=='GP'||!_0x29b6f6[_0x504a('0x3a')]){_0xbe7a1f[_0x504a('0x3b')]=!![];}return _0x8239b2[_0x504a('0x18')](_0xbe7a1f);}else{return logger[_0x504a('0x29')](_0x504a('0x2a'),_0x504a('0x2b'),_0x504a('0x2e'),util[_0x504a('0x2c')](_0xe391b1,{'showHidden':![],'depth':null}));}})[_0x504a('0x1b')](function(_0x4f5a5f){return logger[_0x504a('0x29')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x504a('0x2b'),'skebby',util[_0x504a('0x2c')](_0x4f5a5f,{'showHidden':![],'depth':null}));});}else{logger[_0x504a('0x29')](_0x504a('0x2a'),_0x504a('0x2b'),_0x504a('0x2e'),'Missing\x20parameters:\x20username,\x20password');}break;case'connectel':if(_0x29b6f6[_0x504a('0x22')]){var _0x1d15b4={'recipient':_0x1ab621['phone'],'message':_0x1ab621[_0x504a('0xb')],'sender':_0x29b6f6[_0x504a('0x3c')]||_0x29b6f6[_0x504a('0x25')],'authorization':_0x29b6f6[_0x504a('0x22')]};var _0x1e8309={'method':_0x504a('0x3d'),'uri':_0x504a('0x3e'),'body':_0x1d15b4,'json':!![]};rp(_0x1e8309)[_0x504a('0x17')](function(_0x3943ad){var _0x2d9044={'messageId':_0x3943ad[_0x504a('0x3f')]};if(!_0x29b6f6['deliveryReport']){_0x2d9044[_0x504a('0x3b')]=!![];}return _0x8239b2[_0x504a('0x18')](_0x2d9044);})[_0x504a('0x1b')](function(_0x590462){logger['error'](_0x504a('0x2a'),_0x504a('0x2b'),'connectel',util[_0x504a('0x2c')](_0x590462,{'showHidden':![],'depth':null}));});}else{logger[_0x504a('0x29')](_0x504a('0x2a'),_0x504a('0x2b'),_0x504a('0x40'),'Missing\x20parameters:\x20authToken');}break;case'clicksend':if(_0x29b6f6[_0x504a('0x32')]&&_0x29b6f6['password']){var _0x1d15b4={'messages':[{'source':_0x504a('0x41'),'to':_0x1ab621[_0x504a('0x25')],'body':_0x1ab621[_0x504a('0xb')],'from':_0x29b6f6[_0x504a('0x3c')]||_0x29b6f6['phone']}]};var _0x22b21a=util['format']('%s:%s',_0x29b6f6[_0x504a('0x32')],_0x29b6f6[_0x504a('0x2f')]);var _0x1e8309={'method':_0x504a('0x3d'),'uri':_0x504a('0x42'),'body':_0x1d15b4,'headers':{'Authorization':util[_0x504a('0x43')]('Basic\x20%s',new Buffer(_0x22b21a)['toString']('base64'))},'json':!![]};rp(_0x1e8309)[_0x504a('0x17')](function(_0x32d5bd){if(_0x32d5bd['http_code']>=0xc8&&_0x32d5bd[_0x504a('0x44')]<=0xce){if(_0x32d5bd[_0x504a('0x45')]&&_0x32d5bd[_0x504a('0x45')][_0x504a('0x46')]>0x0){var _0x13aca6=_[_0x504a('0x47')](_0x32d5bd[_0x504a('0x45')]['messages']);var _0xdb6d84={'messageId':_0x13aca6[_0x504a('0x48')]};if(!_0x29b6f6[_0x504a('0x3a')]){_0xdb6d84[_0x504a('0x3b')]=!![];}return _0x8239b2[_0x504a('0x18')](_0xdb6d84);}else{logger['error'](_0x504a('0x2a'),'afterCreate',_0x504a('0x49'),util[_0x504a('0x2c')](_0x32d5bd,{'showHidden':![],'depth':null}));}}else{logger[_0x504a('0x29')](_0x504a('0x2a'),_0x504a('0x2b'),'clickSend',util[_0x504a('0x2c')](_0x32d5bd,{'showHidden':![],'depth':null}));}})['catch'](function(_0x1a87f0){logger[_0x504a('0x29')](_0x504a('0x2a'),_0x504a('0x2b'),_0x504a('0x49'),util['inspect'](_0x1a87f0,{'showHidden':![],'depth':null}));});}else{logger[_0x504a('0x29')](_0x504a('0x2a'),'afterCreate',_0x504a('0x49'),_0x504a('0x4a'));}break;case _0x504a('0x4b'):if(_0x29b6f6[_0x504a('0x4c')]&&_0x29b6f6[_0x504a('0x22')]){var _0x1d15b4={'dst':_0x1ab621[_0x504a('0x25')],'text':_0x1ab621['body'],'src':_0x29b6f6[_0x504a('0x3c')]||_0x29b6f6[_0x504a('0x25')],'url':_0x29b6f6[_0x504a('0x26')]+_0x504a('0x4d')+_0x1ab621['id']+_0x504a('0x27')+_0x29b6f6['token']};var _0x22b21a=util[_0x504a('0x43')](_0x504a('0x4e'),_0x29b6f6[_0x504a('0x4c')],_0x29b6f6['authToken']);var _0x1e8309={'method':_0x504a('0x3d'),'uri':util['format'](_0x504a('0x4f'),_0x29b6f6[_0x504a('0x4c')]),'body':_0x1d15b4,'headers':{'Authorization':util[_0x504a('0x43')](_0x504a('0x50'),new Buffer(_0x22b21a)[_0x504a('0x51')]('base64'))},'json':!![]};rp(_0x1e8309)[_0x504a('0x17')](function(_0x5c99b0){var _0x49ca7e={'messageId':_0x5c99b0[_0x504a('0x52')][0x0]};return _0x8239b2[_0x504a('0x18')](_0x49ca7e);})[_0x504a('0x1b')](function(_0x512307){logger[_0x504a('0x29')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','plivo',util['inspect'](_0x512307,{'showHidden':![],'depth':null}));});}else{logger[_0x504a('0x29')](_0x504a('0x2a'),_0x504a('0x2b'),_0x504a('0x4b'),_0x504a('0x53'));}break;case _0x504a('0x54'):if(_0x29b6f6[_0x504a('0x32')]&&_0x29b6f6[_0x504a('0x2f')]){if(_0x29b6f6[_0x504a('0x55')]){var _0x1852da={'method':_0x504a('0x3d'),'uri':_0x29b6f6[_0x504a('0x55')]+_0x504a('0x56'),'body':{'username':_0x29b6f6[_0x504a('0x32')],'password':_0x29b6f6['password']},'json':!![]};return rp(_0x1852da)[_0x504a('0x17')](function(_0x5bfa67){var _0x219102={'method':'POST','uri':_0x29b6f6[_0x504a('0x55')]+'/sms/2/text/advanced','body':{'messages':[{'from':_0x29b6f6['phone'],'destinations':[{'to':_0x1ab621[_0x504a('0x25')]}],'text':_0x1ab621['body'],'notifyUrl':_0x29b6f6[_0x504a('0x26')]+_0x504a('0x4d')+_0x1ab621['id']+'/status?token='+_0x29b6f6[_0x504a('0x28')],'notifyContentType':_0x504a('0x57'),'callbackData':_0x29b6f6[_0x504a('0x25')]+';'+_0x1ab621['body']}]},'headers':{'Authorization':_0x504a('0x58')+_0x5bfa67[_0x504a('0x28')]},'json':!![]};return rp(_0x219102)['then'](function(_0xcc1d07){if(_0xcc1d07[_0x504a('0x23')]){var _0x5e39d0={'messageId':_0xcc1d07[_0x504a('0x23')][0x0][_0x504a('0xa')]};if(!_0x29b6f6[_0x504a('0x3a')]){_0x5e39d0[_0x504a('0x3b')]=!![];}return _0x8239b2[_0x504a('0x18')](_0x5e39d0);}else{return logger['error'](_0x504a('0x2a'),'afterCreate',_0x504a('0x54'),util['inspect'](_0xcc1d07,{'showHidden':![],'depth':null}));}});})[_0x504a('0x1b')](function(_0x155caa){return logger[_0x504a('0x29')](_0x504a('0x2a'),_0x504a('0x2b'),'infobip',util['inspect'](_0x155caa,{'showHidden':![],'depth':null}));});}else{logger[_0x504a('0x29')](_0x504a('0x2a'),_0x504a('0x2b'),_0x504a('0x54'),_0x504a('0x59'));}}else{logger[_0x504a('0x29')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x504a('0x54'),_0x504a('0x4a'));}break;case _0x504a('0x5a'):var _0x3d789b=require(_0x504a('0x5b'));if(_0x29b6f6[_0x504a('0x5c')]){var _0x49b67b={};_0x49b67b['login']=_0x29b6f6[_0x504a('0x32')];_0x49b67b[_0x504a('0x25')]=_0x1ab621['phone'];_0x49b67b[_0x504a('0x31')]=_0x29b6f6['phone'];_0x49b67b['text']=_0x1ab621[_0x504a('0xb')];_0x49b67b[_0x504a('0x5d')]=+new Date();var _0x16785c='';var _0x1939cb='';var _0x567108=Object[_0x504a('0x5e')](_0x49b67b);_0x567108['sort']();for(var _0x5402bd=0x0;_0x5402bd<_0x567108['length'];_0x5402bd++){if(_0x16785c!=''){_0x16785c+='&';}_0x16785c+=_0x567108[_0x5402bd]+'='+encodeURIComponent(_0x49b67b[_0x567108[_0x5402bd]]);_0x1939cb+=_0x49b67b[_0x567108[_0x5402bd]];}_0x1939cb+=_0x29b6f6[_0x504a('0x5c')];_0x1939cb=_0x3d789b[_0x504a('0x5f')](_0x504a('0x60'))['update'](_0x1939cb)[_0x504a('0x61')](_0x504a('0x62'));if(_0x16785c!==''){_0x16785c+='&';}_0x16785c+=_0x504a('0x63')+_0x1939cb;var _0x105430={'method':_0x504a('0x34'),'uri':_0x29b6f6[_0x504a('0x55')]+_0x504a('0x64')+_0x16785c,'json':!![]};return rp(_0x105430)[_0x504a('0x17')](function(_0x226e48){var _0x1e9d6a=Object[_0x504a('0x5e')](_0x226e48);if(_0x226e48[_0x1e9d6a[0x0]][_0x504a('0x29')]&&parseInt(_0x226e48[_0x1e9d6a[0x0]][_0x504a('0x29')])===0x0){var _0x1ea14e={'messageId':_0x226e48[_0x1e9d6a[0x0]][_0x504a('0x65')]};if(!_0x29b6f6[_0x504a('0x3a')]){_0x1ea14e[_0x504a('0x3b')]=!![];}return _0x8239b2[_0x504a('0x18')](_0x1ea14e);}else{return logger[_0x504a('0x29')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x504a('0x2b'),_0x504a('0x5a'),util[_0x504a('0x2c')](_0x226e48[_0x504a('0x29')],{'showHidden':![],'depth':null}));}})[_0x504a('0x1b')](function(_0x372c89){return logger[_0x504a('0x29')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x504a('0x2b'),_0x504a('0x5a'),util['inspect'](_0x372c89,{'showHidden':![],'depth':null}));});}else{logger[_0x504a('0x29')](_0x504a('0x2a'),_0x504a('0x2b'),'csc','Missing\x20parameters:\x20apiKey');}break;case'clickatell':if(_0x29b6f6[_0x504a('0x5c')]){var _0x15ce21={'method':'POST','uri':_0x504a('0x66'),'headers':{'Authorization':_0x29b6f6['apiKey']},'body':{'content':_0x1ab621[_0x504a('0xb')],'to':[_0x1ab621[_0x504a('0x25')]],'from':_0x29b6f6[_0x504a('0x25')],'binary':![],'clientMessageId':_0x504a('0x67'),'charset':_0x504a('0x68')},'json':!![]};rp(_0x15ce21)[_0x504a('0x17')](function(_0x1d8dd9){if(!_0x1d8dd9[_0x504a('0x29')]){var _0x5da00e={'messageId':_0x1d8dd9['messages'][0x0][_0x504a('0x69')]};if(!_0x29b6f6[_0x504a('0x3a')]){_0x5da00e[_0x504a('0x3b')]=!![];}return _0x8239b2[_0x504a('0x18')](_0x5da00e);}else{return logger[_0x504a('0x29')](_0x504a('0x2a'),'afterCreate','clickatell',util[_0x504a('0x2c')](_0x1d8dd9[_0x504a('0x29')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x4a1b7a){return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x504a('0x2b'),'clickatell',util['inspect'](_0x4a1b7a,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x504a('0x2a'),_0x504a('0x2b'),_0x504a('0x6a'),'Missing\x20parameters:\x20apiKey');}break;case'bandwidth':if(_0x29b6f6['username']&&_0x29b6f6[_0x504a('0x2f')]){var _0x22b21a=util[_0x504a('0x43')]('%s:%s',_0x29b6f6[_0x504a('0x32')],_0x29b6f6[_0x504a('0x2f')]);var _0x1e8309={'method':'POST','uri':'https://messaging.bandwidth.com/api/v2/users/'+_0x29b6f6['accountId']+_0x504a('0x6b'),'body':{'to':[_0x1ab621[_0x504a('0x25')]],'text':_0x1ab621[_0x504a('0xb')],'from':_0x29b6f6['phone'],'applicationId':_0x29b6f6[_0x504a('0x6c')]},'headers':{'Authorization':util['format']('Basic\x20%s',new Buffer(_0x22b21a)[_0x504a('0x51')](_0x504a('0x6d')))},'json':!![]};rp(_0x1e8309)[_0x504a('0x17')](function(_0x3341b4){if(_0x3341b4['id']){var _0x22198d={'messageId':_0x3341b4['id']};return _0x8239b2[_0x504a('0x18')](_0x22198d);}else{logger[_0x504a('0x29')](_0x504a('0x2a'),_0x504a('0x2b'),'bandwidth',util[_0x504a('0x2c')](_0x3341b4,{'showHidden':![],'depth':null}));}})[_0x504a('0x1b')](function(_0x118b95){logger['error'](_0x504a('0x2a'),_0x504a('0x2b'),_0x504a('0x6e'),util['inspect'](_0x118b95,{'showHidden':![],'depth':null}));});}else{logger[_0x504a('0x29')](_0x504a('0x2a'),_0x504a('0x2b'),_0x504a('0x6e'),_0x504a('0x4a'));}break;case'intelepeer':if(_0x29b6f6[_0x504a('0x5c')]){var _0x33430c={};var _0x105430={'method':_0x504a('0x3d'),'uri':_0x504a('0x6f'),'headers':{'Authorization':'Bearer\x20'+_0x29b6f6[_0x504a('0x5c')],'Content-Type':_0x504a('0x57')},'body':{'from':_0x29b6f6[_0x504a('0x25')],'to':_0x1ab621[_0x504a('0x25')],'text':_0x1ab621[_0x504a('0xb')]},'json':!![]};return rp(_0x105430)['then'](function(_0x43f641){if(_0x43f641[_0x504a('0x70')]==0xca){_0x33430c[_0x504a('0x71')]=_0x43f641;var _0x4715b1={'method':'POST','uri':_0x504a('0x72'),'headers':{'Authorization':'Bearer\x20'+_0x29b6f6['apiKey'],'Content-Type':'application/json'},'body':{'refid':_0x33430c['message']['refid']},'json':!![]};return rp(_0x4715b1)['then'](function(_0x50381c){_0x33430c['status']=_0x50381c;var _0x98da7f={'messageId':_0x33430c[_0x504a('0x71')]['refid'],'read':!![]};return _0x8239b2[_0x504a('0x18')](_0x98da7f);});}else{return logger[_0x504a('0x29')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','intelepeer',util[_0x504a('0x2c')](_0x43f641,{'showHidden':![],'depth':null}));}})[_0x504a('0x1b')](function(_0x409f73){return logger['error'](_0x504a('0x2a'),_0x504a('0x2b'),'intelepeer',util[_0x504a('0x2c')](_0x409f73,{'showHidden':![],'depth':null}));});}else{return logger['error'](_0x504a('0x2a'),'afterCreate',_0x504a('0x73'),_0x504a('0x74'));}break;}}})['finally'](function(){_0x2e71bf();});}else{_0x2e71bf();}}},'charset':_0x504a('0x75'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x4b06=['Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','body','smsMethod','sender','phone','login?username=','&password=','GET','split','POST','user_key','session_key','total_sent','internal_order_id','deliveryReport','read','Missing\x20parameters:\x20username,\x20password','connectel','senderString','https://smsapi.connectel.se/api/v2/send/','Missing\x20parameters:\x20authToken','format','%s:%s','https://rest.clicksend.com/v3/sms/send','toString','base64','http_code','data','queued_count','messages','clickSend','authId','Basic\x20%s','message_uuid','plivo','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','token','application/json','Missing\x20parameters:\x20base_url','crypto','apiKey','login','timestamp','sort','length','md5','digest','hex','signature=','keys','id_sms','csc','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','uuid','UTF-8','apiMessageId','bandwidth','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','https://api.intelepeer.com/_rest/v4/app/sms/mdr','message','refid','status','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./smsMessage.attributes','exports','define','SmsMessage','sms_messages','messageId','fti_sms_messages','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','SmsInteractionId','SmsInteraction','findOne','then','update','error','SmsAccount','find','SmsAccountId','twilio','accountSid','authToken','create','remote','/api/sms/messages/','/status?token=','sid','catch','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect'];(function(_0x5ec90b,_0x933837){var _0x2dfefe=function(_0x167a53){while(--_0x167a53){_0x5ec90b['push'](_0x5ec90b['shift']());}};_0x2dfefe(++_0x933837);}(_0x4b06,0x1ce));var _0x64b0=function(_0x5624cc,_0x3a998a){_0x5624cc=_0x5624cc-0x0;var _0x108277=_0x4b06[_0x5624cc];return _0x108277;};'use strict';var _=require(_0x64b0('0x0'));var util=require(_0x64b0('0x1'));var logger=require(_0x64b0('0x2'))(_0x64b0('0x3'));var moment=require(_0x64b0('0x4'));var BPromise=require(_0x64b0('0x5'));var rp=require(_0x64b0('0x6'));var fs=require('fs');var path=require(_0x64b0('0x7'));var rimraf=require('rimraf');var config=require(_0x64b0('0x8'));var attributes=require(_0x64b0('0x9'));module[_0x64b0('0xa')]=function(_0x3c1b3b,_0x143804){return _0x3c1b3b[_0x64b0('0xb')](_0x64b0('0xc'),attributes,{'tableName':_0x64b0('0xd'),'paranoid':![],'indexes':[{'name':_0x64b0('0xe'),'fields':[_0x64b0('0xe')]},{'name':_0x64b0('0xf'),'fields':['body'],'type':_0x64b0('0x10')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3a3926,_0x4973e4,_0x501aac){var _0x65314f=_0x3c1b3b[_0x64b0('0x11')];var _0x252b35=_0x3a3926[_0x64b0('0x12')]({'plain':!![]});if(_0x252b35[_0x64b0('0x13')]['toLowerCase']()==='in'||_0x252b35['direction'][_0x64b0('0x14')]()===_0x64b0('0x15')&&!_0x252b35[_0x64b0('0x16')]&&!_[_0x64b0('0x17')](_0x252b35[_0x64b0('0x18')])&&!_[_0x64b0('0x17')](_0x252b35[_0x64b0('0x19')])){_0x65314f[_0x64b0('0x1a')][_0x64b0('0x1b')]({'where':{'id':_0x252b35[_0x64b0('0x19')]}})[_0x64b0('0x1c')](function(_0x19a384){if(_0x19a384){_0x19a384[_0x64b0('0x1d')]({'lastMsgAt':_0x252b35['createdAt'],'lastMsgDirection':_0x252b35[_0x64b0('0x13')][_0x64b0('0x14')]()});}})['catch'](function(_0x1f6839){console[_0x64b0('0x1e')](_0x1f6839);});}if(_0x252b35['direction']===_0x64b0('0x15')&&!_0x252b35[_0x64b0('0x16')]){var _0x23c5f8;_0x65314f[_0x64b0('0x1f')][_0x64b0('0x20')]({'where':{'id':_0x252b35[_0x64b0('0x21')]},'raw':!![]})[_0x64b0('0x1c')](function(_0xb67342){_0x23c5f8=_0xb67342;if(_0x23c5f8&&_0x23c5f8['type']){switch(_0x23c5f8['type']){case _0x64b0('0x22'):var _0x54adbd=require(_0x64b0('0x22'));if(_0x23c5f8[_0x64b0('0x23')]&&_0x23c5f8['authToken']&&_0x23c5f8['phone']){var _0x11c205=new _0x54adbd(_0x23c5f8['accountSid'],_0x23c5f8[_0x64b0('0x24')]);_0x11c205['messages'][_0x64b0('0x25')]({'body':_0x252b35['body'],'to':_0x252b35['phone'],'from':_0x23c5f8['phone'],'statusCallback':_0x23c5f8[_0x64b0('0x26')]+_0x64b0('0x27')+_0x252b35['id']+_0x64b0('0x28')+_0x23c5f8['token']})[_0x64b0('0x1c')](function(_0x267a37){if(_0x267a37[_0x64b0('0x29')]){return _0x3a3926['update']({'messageId':_0x267a37['sid']});}})[_0x64b0('0x2a')](function(_0xbd6595){logger['error'](_0x64b0('0x2b'),_0x64b0('0x2c'),'twilio',util[_0x64b0('0x2d')](_0xbd6595,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x64b0('0x2b'),_0x64b0('0x2c'),'twilio',_0x64b0('0x2e'));}break;case _0x64b0('0x2f'):var _0x54b342=_0x64b0('0x30');if(_0x23c5f8[_0x64b0('0x31')]&&_0x23c5f8[_0x64b0('0x32')]){var _0x40a8aa={'recipient':[_0x252b35['phone']],'message':_0x252b35[_0x64b0('0x33')],'message_type':_0x23c5f8[_0x64b0('0x34')]};if(_0x23c5f8[_0x64b0('0x34')]&&_0x23c5f8[_0x64b0('0x34')]!=='SI'){_0x40a8aa[_0x64b0('0x35')]=_0x23c5f8[_0x64b0('0x36')];}var _0x5b30ac={'url':_0x54b342+_0x64b0('0x37')+_0x23c5f8[_0x64b0('0x31')]+_0x64b0('0x38')+_0x23c5f8['password'],'method':_0x64b0('0x39')};rp(_0x5b30ac)[_0x64b0('0x1c')](function(_0x571cbd){var _0x50b5e5=_0x571cbd[_0x64b0('0x3a')](';');var _0x54d7cd={'user_key':_0x50b5e5[0x0],'session_key':_0x50b5e5[0x1]};_0x5b30ac={'url':_0x54b342+'sms','method':_0x64b0('0x3b'),'headers':{'user_key':_0x54d7cd[_0x64b0('0x3c')],'Session_key':_0x54d7cd[_0x64b0('0x3d')]},'json':!![],'body':_0x40a8aa};return rp(_0x5b30ac);})[_0x64b0('0x1c')](function(_0x24ea93){if(_0x24ea93[_0x64b0('0x3e')]>=0x1){var _0x52cc3b={'messageId':_0x24ea93[_0x64b0('0x3f')]};if(_0x23c5f8[_0x64b0('0x34')]!=='GP'||!_0x23c5f8[_0x64b0('0x40')]){_0x52cc3b[_0x64b0('0x41')]=!![];}return _0x3a3926[_0x64b0('0x1d')](_0x52cc3b);}else{return logger[_0x64b0('0x1e')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x64b0('0x2c'),_0x64b0('0x2f'),util['inspect'](_0x24ea93,{'showHidden':![],'depth':null}));}})[_0x64b0('0x2a')](function(_0x4b054d){return logger[_0x64b0('0x1e')](_0x64b0('0x2b'),_0x64b0('0x2c'),_0x64b0('0x2f'),util[_0x64b0('0x2d')](_0x4b054d,{'showHidden':![],'depth':null}));});}else{logger[_0x64b0('0x1e')](_0x64b0('0x2b'),_0x64b0('0x2c'),_0x64b0('0x2f'),_0x64b0('0x42'));}break;case _0x64b0('0x43'):if(_0x23c5f8[_0x64b0('0x24')]){var _0x1d1518={'recipient':_0x252b35[_0x64b0('0x36')],'message':_0x252b35[_0x64b0('0x33')],'sender':_0x23c5f8[_0x64b0('0x44')]||_0x23c5f8[_0x64b0('0x36')],'authorization':_0x23c5f8[_0x64b0('0x24')]};var _0x4973e4={'method':'POST','uri':_0x64b0('0x45'),'body':_0x1d1518,'json':!![]};rp(_0x4973e4)['then'](function(_0x38853c){var _0x25531c={'messageId':_0x38853c['requestid']};if(!_0x23c5f8[_0x64b0('0x40')]){_0x25531c[_0x64b0('0x41')]=!![];}return _0x3a3926['update'](_0x25531c);})[_0x64b0('0x2a')](function(_0xf6e6ad){logger['error'](_0x64b0('0x2b'),_0x64b0('0x2c'),_0x64b0('0x43'),util[_0x64b0('0x2d')](_0xf6e6ad,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x64b0('0x2b'),_0x64b0('0x2c'),'connectel',_0x64b0('0x46'));}break;case'clicksend':if(_0x23c5f8[_0x64b0('0x31')]&&_0x23c5f8[_0x64b0('0x32')]){var _0x1d1518={'messages':[{'source':'xCALLY\x20Motion','to':_0x252b35['phone'],'body':_0x252b35[_0x64b0('0x33')],'from':_0x23c5f8[_0x64b0('0x44')]||_0x23c5f8['phone']}]};var _0x3051ae=util[_0x64b0('0x47')](_0x64b0('0x48'),_0x23c5f8[_0x64b0('0x31')],_0x23c5f8[_0x64b0('0x32')]);var _0x4973e4={'method':'POST','uri':_0x64b0('0x49'),'body':_0x1d1518,'headers':{'Authorization':util[_0x64b0('0x47')]('Basic\x20%s',new Buffer(_0x3051ae)[_0x64b0('0x4a')](_0x64b0('0x4b')))},'json':!![]};rp(_0x4973e4)[_0x64b0('0x1c')](function(_0x349977){if(_0x349977[_0x64b0('0x4c')]>=0xc8&&_0x349977['http_code']<=0xce){if(_0x349977['data']&&_0x349977[_0x64b0('0x4d')][_0x64b0('0x4e')]>0x0){var _0x58a54b=_['head'](_0x349977[_0x64b0('0x4d')][_0x64b0('0x4f')]);var _0x2115b5={'messageId':_0x58a54b['message_id']};if(!_0x23c5f8[_0x64b0('0x40')]){_0x2115b5[_0x64b0('0x41')]=!![];}return _0x3a3926[_0x64b0('0x1d')](_0x2115b5);}else{logger[_0x64b0('0x1e')](_0x64b0('0x2b'),_0x64b0('0x2c'),_0x64b0('0x50'),util[_0x64b0('0x2d')](_0x349977,{'showHidden':![],'depth':null}));}}else{logger[_0x64b0('0x1e')](_0x64b0('0x2b'),_0x64b0('0x2c'),_0x64b0('0x50'),util['inspect'](_0x349977,{'showHidden':![],'depth':null}));}})['catch'](function(_0x2a45b9){logger[_0x64b0('0x1e')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x64b0('0x50'),util[_0x64b0('0x2d')](_0x2a45b9,{'showHidden':![],'depth':null}));});}else{logger[_0x64b0('0x1e')](_0x64b0('0x2b'),_0x64b0('0x2c'),'clickSend',_0x64b0('0x42'));}break;case'plivo':if(_0x23c5f8[_0x64b0('0x51')]&&_0x23c5f8[_0x64b0('0x24')]){var _0x1d1518={'dst':_0x252b35[_0x64b0('0x36')],'text':_0x252b35[_0x64b0('0x33')],'src':_0x23c5f8[_0x64b0('0x44')]||_0x23c5f8[_0x64b0('0x36')],'url':_0x23c5f8[_0x64b0('0x26')]+_0x64b0('0x27')+_0x252b35['id']+_0x64b0('0x28')+_0x23c5f8['token']};var _0x3051ae=util[_0x64b0('0x47')](_0x64b0('0x48'),_0x23c5f8[_0x64b0('0x51')],_0x23c5f8[_0x64b0('0x24')]);var _0x4973e4={'method':'POST','uri':util[_0x64b0('0x47')]('https://api.plivo.com/v1/Account/%s/Message/',_0x23c5f8[_0x64b0('0x51')]),'body':_0x1d1518,'headers':{'Authorization':util[_0x64b0('0x47')](_0x64b0('0x52'),new Buffer(_0x3051ae)['toString'](_0x64b0('0x4b')))},'json':!![]};rp(_0x4973e4)[_0x64b0('0x1c')](function(_0x3cf0d8){var _0x2db34d={'messageId':_0x3cf0d8[_0x64b0('0x53')][0x0]};return _0x3a3926['update'](_0x2db34d);})[_0x64b0('0x2a')](function(_0xc28780){logger[_0x64b0('0x1e')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x64b0('0x2c'),_0x64b0('0x54'),util['inspect'](_0xc28780,{'showHidden':![],'depth':null}));});}else{logger[_0x64b0('0x1e')](_0x64b0('0x2b'),_0x64b0('0x2c'),_0x64b0('0x54'),_0x64b0('0x55'));}break;case _0x64b0('0x56'):if(_0x23c5f8[_0x64b0('0x31')]&&_0x23c5f8[_0x64b0('0x32')]){if(_0x23c5f8[_0x64b0('0x57')]){var _0x42cf41={'method':_0x64b0('0x3b'),'uri':_0x23c5f8[_0x64b0('0x57')]+_0x64b0('0x58'),'body':{'username':_0x23c5f8[_0x64b0('0x31')],'password':_0x23c5f8['password']},'json':!![]};return rp(_0x42cf41)[_0x64b0('0x1c')](function(_0x5853fa){var _0x29886b={'method':_0x64b0('0x3b'),'uri':_0x23c5f8[_0x64b0('0x57')]+_0x64b0('0x59'),'body':{'messages':[{'from':_0x23c5f8[_0x64b0('0x36')],'destinations':[{'to':_0x252b35[_0x64b0('0x36')]}],'text':_0x252b35['body'],'notifyUrl':_0x23c5f8[_0x64b0('0x26')]+_0x64b0('0x27')+_0x252b35['id']+_0x64b0('0x28')+_0x23c5f8[_0x64b0('0x5a')],'notifyContentType':_0x64b0('0x5b'),'callbackData':_0x23c5f8[_0x64b0('0x36')]+';'+_0x252b35['body']}]},'headers':{'Authorization':'IBSSO\x20'+_0x5853fa[_0x64b0('0x5a')]},'json':!![]};return rp(_0x29886b)[_0x64b0('0x1c')](function(_0x3b6174){if(_0x3b6174[_0x64b0('0x4f')]){var _0xe61858={'messageId':_0x3b6174[_0x64b0('0x4f')][0x0][_0x64b0('0xe')]};if(!_0x23c5f8[_0x64b0('0x40')]){_0xe61858['read']=!![];}return _0x3a3926[_0x64b0('0x1d')](_0xe61858);}else{return logger['error'](_0x64b0('0x2b'),'afterCreate',_0x64b0('0x56'),util[_0x64b0('0x2d')](_0x3b6174,{'showHidden':![],'depth':null}));}});})[_0x64b0('0x2a')](function(_0x3feb9e){return logger[_0x64b0('0x1e')](_0x64b0('0x2b'),'afterCreate',_0x64b0('0x56'),util[_0x64b0('0x2d')](_0x3feb9e,{'showHidden':![],'depth':null}));});}else{logger[_0x64b0('0x1e')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x64b0('0x56'),_0x64b0('0x5c'));}}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x64b0('0x2c'),_0x64b0('0x56'),_0x64b0('0x42'));}break;case'csc':var _0x3f20a4=require(_0x64b0('0x5d'));if(_0x23c5f8[_0x64b0('0x5e')]){var _0x2f2602={};_0x2f2602[_0x64b0('0x5f')]=_0x23c5f8[_0x64b0('0x31')];_0x2f2602[_0x64b0('0x36')]=_0x252b35[_0x64b0('0x36')];_0x2f2602['sender']=_0x23c5f8[_0x64b0('0x36')];_0x2f2602['text']=_0x252b35['body'];_0x2f2602[_0x64b0('0x60')]=+new Date();var _0x34329e='';var _0x55615b='';var _0x5399c9=Object['keys'](_0x2f2602);_0x5399c9[_0x64b0('0x61')]();for(var _0x37f44e=0x0;_0x37f44e<_0x5399c9[_0x64b0('0x62')];_0x37f44e++){if(_0x34329e!=''){_0x34329e+='&';}_0x34329e+=_0x5399c9[_0x37f44e]+'='+encodeURIComponent(_0x2f2602[_0x5399c9[_0x37f44e]]);_0x55615b+=_0x2f2602[_0x5399c9[_0x37f44e]];}_0x55615b+=_0x23c5f8[_0x64b0('0x5e')];_0x55615b=_0x3f20a4['createHash'](_0x64b0('0x63'))[_0x64b0('0x1d')](_0x55615b)[_0x64b0('0x64')](_0x64b0('0x65'));if(_0x34329e!==''){_0x34329e+='&';}_0x34329e+=_0x64b0('0x66')+_0x55615b;var _0x5b30ac={'method':_0x64b0('0x39'),'uri':_0x23c5f8['baseUrl']+'/external/get/send.php?'+_0x34329e,'json':!![]};return rp(_0x5b30ac)['then'](function(_0x26c974){var _0x171624=Object[_0x64b0('0x67')](_0x26c974);if(_0x26c974[_0x171624[0x0]]['error']&&parseInt(_0x26c974[_0x171624[0x0]][_0x64b0('0x1e')])===0x0){var _0x5b05e1={'messageId':_0x26c974[_0x171624[0x0]][_0x64b0('0x68')]};if(!_0x23c5f8[_0x64b0('0x40')]){_0x5b05e1['read']=!![];}return _0x3a3926[_0x64b0('0x1d')](_0x5b05e1);}else{return logger['error'](_0x64b0('0x2b'),_0x64b0('0x2c'),'csc',util['inspect'](_0x26c974[_0x64b0('0x1e')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x3651fc){return logger[_0x64b0('0x1e')](_0x64b0('0x2b'),_0x64b0('0x2c'),'csc',util[_0x64b0('0x2d')](_0x3651fc,{'showHidden':![],'depth':null}));});}else{logger[_0x64b0('0x1e')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x64b0('0x2c'),_0x64b0('0x69'),_0x64b0('0x6a'));}break;case _0x64b0('0x6b'):if(_0x23c5f8[_0x64b0('0x5e')]){var _0x5dd5fe={'method':'POST','uri':_0x64b0('0x6c'),'headers':{'Authorization':_0x23c5f8[_0x64b0('0x5e')]},'body':{'content':_0x252b35[_0x64b0('0x33')],'to':[_0x252b35[_0x64b0('0x36')]],'from':_0x23c5f8[_0x64b0('0x36')],'binary':![],'clientMessageId':_0x64b0('0x6d'),'charset':_0x64b0('0x6e')},'json':!![]};rp(_0x5dd5fe)[_0x64b0('0x1c')](function(_0x49ba2e){if(!_0x49ba2e[_0x64b0('0x1e')]){var _0x59904d={'messageId':_0x49ba2e['messages'][0x0][_0x64b0('0x6f')]};if(!_0x23c5f8['deliveryReport']){_0x59904d['read']=!![];}return _0x3a3926[_0x64b0('0x1d')](_0x59904d);}else{return logger['error'](_0x64b0('0x2b'),'afterCreate','clickatell',util[_0x64b0('0x2d')](_0x49ba2e[_0x64b0('0x1e')],{'showHidden':![],'depth':null}));}})[_0x64b0('0x2a')](function(_0x470885){return logger[_0x64b0('0x1e')](_0x64b0('0x2b'),_0x64b0('0x2c'),_0x64b0('0x6b'),util[_0x64b0('0x2d')](_0x470885,{'showHidden':![],'depth':null}));});}else{logger[_0x64b0('0x1e')](_0x64b0('0x2b'),'afterCreate','clickatell',_0x64b0('0x6a'));}break;case _0x64b0('0x70'):if(_0x23c5f8['username']&&_0x23c5f8[_0x64b0('0x32')]){var _0x3051ae=util[_0x64b0('0x47')](_0x64b0('0x48'),_0x23c5f8['username'],_0x23c5f8[_0x64b0('0x32')]);var _0x4973e4={'method':_0x64b0('0x3b'),'uri':_0x64b0('0x71')+_0x23c5f8[_0x64b0('0x72')]+_0x64b0('0x73'),'body':{'to':[_0x252b35[_0x64b0('0x36')]],'text':_0x252b35['body'],'from':_0x23c5f8['phone'],'applicationId':_0x23c5f8['applicationId']},'headers':{'Authorization':util[_0x64b0('0x47')](_0x64b0('0x52'),new Buffer(_0x3051ae)['toString']('base64'))},'json':!![]};rp(_0x4973e4)[_0x64b0('0x1c')](function(_0x2eecfb){if(_0x2eecfb['id']){var _0xe6605c={'messageId':_0x2eecfb['id']};return _0x3a3926['update'](_0xe6605c);}else{logger[_0x64b0('0x1e')](_0x64b0('0x2b'),'afterCreate',_0x64b0('0x70'),util['inspect'](_0x2eecfb,{'showHidden':![],'depth':null}));}})[_0x64b0('0x2a')](function(_0x359e73){logger[_0x64b0('0x1e')](_0x64b0('0x2b'),_0x64b0('0x2c'),_0x64b0('0x70'),util['inspect'](_0x359e73,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x64b0('0x2b'),'afterCreate',_0x64b0('0x70'),_0x64b0('0x42'));}break;case _0x64b0('0x74'):if(_0x23c5f8[_0x64b0('0x5e')]){var _0x4379b4={};var _0x5b30ac={'method':_0x64b0('0x3b'),'uri':_0x64b0('0x75'),'headers':{'Authorization':_0x64b0('0x76')+_0x23c5f8['apiKey'],'Content-Type':'application/json'},'body':{'from':_0x23c5f8[_0x64b0('0x36')],'to':_0x252b35['phone'],'text':_0x252b35['body']},'json':!![]};return rp(_0x5b30ac)[_0x64b0('0x1c')](function(_0x317920){if(_0x317920[_0x64b0('0x77')]==0xca){_0x4379b4['message']=_0x317920;var _0x3212bd={'method':_0x64b0('0x3b'),'uri':_0x64b0('0x78'),'headers':{'Authorization':_0x64b0('0x76')+_0x23c5f8[_0x64b0('0x5e')],'Content-Type':'application/json'},'body':{'refid':_0x4379b4[_0x64b0('0x79')][_0x64b0('0x7a')]},'json':!![]};return rp(_0x3212bd)[_0x64b0('0x1c')](function(_0x3ced56){_0x4379b4[_0x64b0('0x7b')]=_0x3ced56;var _0x4e6ff8={'messageId':_0x4379b4['message']['refid'],'read':!![]};return _0x3a3926[_0x64b0('0x1d')](_0x4e6ff8);});}else{return logger[_0x64b0('0x1e')](_0x64b0('0x2b'),_0x64b0('0x2c'),_0x64b0('0x74'),util[_0x64b0('0x2d')](_0x317920,{'showHidden':![],'depth':null}));}})[_0x64b0('0x2a')](function(_0x32bd30){return logger['error'](_0x64b0('0x2b'),_0x64b0('0x2c'),'intelepeer',util[_0x64b0('0x2d')](_0x32bd30,{'showHidden':![],'depth':null}));});}else{return logger[_0x64b0('0x1e')](_0x64b0('0x2b'),_0x64b0('0x2c'),_0x64b0('0x74'),'Token\x20not\x20received');}break;}}})[_0x64b0('0x7c')](function(){_0x501aac();});}else{_0x501aac();}}},'charset':_0x64b0('0x7d'),'collate':_0x64b0('0x7e')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index 1b1d0e3..ba3ae4d 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 _0x87ab=['defaults','localhost','socket.io-emitter','./smsMessage.socket','register','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CreateSmsMessage','SmsMessage','create','options','raw','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','client','http','redis'];(function(_0x191f0a,_0x2dc673){var _0x45aa85=function(_0x4022ab){while(--_0x4022ab){_0x191f0a['push'](_0x191f0a['shift']());}};_0x45aa85(++_0x2dc673);}(_0x87ab,0xf5));var _0xb87a=function(_0x416919,_0x350275){_0x416919=_0x416919-0x0;var _0xa6ba1a=_0x87ab[_0x416919];return _0xa6ba1a;};'use strict';var _=require(_0xb87a('0x0'));var util=require(_0xb87a('0x1'));var moment=require(_0xb87a('0x2'));var BPromise=require(_0xb87a('0x3'));var rs=require(_0xb87a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb87a('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb87a('0x6'));var config=require(_0xb87a('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xb87a('0x8')][_0xb87a('0x9')]({'port':0x232a});config[_0xb87a('0xa')]=_[_0xb87a('0xb')](config[_0xb87a('0xa')],{'host':_0xb87a('0xc'),'port':0x18eb});var socket=require(_0xb87a('0xd'))(new Redis(config[_0xb87a('0xa')]));require(_0xb87a('0xe'))[_0xb87a('0xf')](socket);function respondWithRpcPromise(_0x11b151,_0x5111ff,_0x4f50a9){return new BPromise(function(_0x462d94,_0x108b33){return client['request'](_0x11b151,_0x4f50a9)[_0xb87a('0x10')](function(_0x2902d8){logger[_0xb87a('0x11')](_0xb87a('0x12'),_0x5111ff,_0xb87a('0x13'));logger[_0xb87a('0x14')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x5111ff,_0xb87a('0x13'),JSON[_0xb87a('0x15')](_0x2902d8));if(_0x2902d8[_0xb87a('0x16')]){if(_0x2902d8[_0xb87a('0x16')][_0xb87a('0x17')]===0x1f4){logger[_0xb87a('0x16')]('SmsMessage,\x20%s,\x20%s',_0x5111ff,_0x2902d8[_0xb87a('0x16')][_0xb87a('0x18')]);return _0x108b33(_0x2902d8['error']['message']);}logger[_0xb87a('0x16')](_0xb87a('0x12'),_0x5111ff,_0x2902d8[_0xb87a('0x16')][_0xb87a('0x18')]);return _0x462d94(_0x2902d8[_0xb87a('0x16')][_0xb87a('0x18')]);}else{logger['info'](_0xb87a('0x12'),_0x5111ff,_0xb87a('0x13'));_0x462d94(_0x2902d8[_0xb87a('0x19')][_0xb87a('0x18')]);}})[_0xb87a('0x1a')](function(_0x59d902){logger[_0xb87a('0x16')](_0xb87a('0x12'),_0x5111ff,_0x59d902);_0x108b33(_0x59d902);});});}exports[_0xb87a('0x1b')]=function(_0xf3dcd1){var _0x22d1b3=this;return new Promise(function(_0x428f26,_0x472427){return db[_0xb87a('0x1c')][_0xb87a('0x1d')](_0xf3dcd1['body'],{'raw':_0xf3dcd1[_0xb87a('0x1e')]?_0xf3dcd1[_0xb87a('0x1e')][_0xb87a('0x1f')]===undefined?!![]:![]:!![]})[_0xb87a('0x10')](function(_0x50b78f){logger[_0xb87a('0x11')]('CreateSmsMessage',_0xf3dcd1);logger[_0xb87a('0x14')](_0xb87a('0x1b'),_0xf3dcd1,JSON[_0xb87a('0x15')](_0x50b78f));_0x428f26(_0x50b78f);})[_0xb87a('0x1a')](function(_0x58f32b){logger[_0xb87a('0x16')](_0xb87a('0x1b'),_0x58f32b[_0xb87a('0x18')],_0xf3dcd1);_0x472427(_0x22d1b3[_0xb87a('0x16')](0x1f4,_0x58f32b[_0xb87a('0x18')]));});});}; \ No newline at end of file +var _0x23cd=['stringify','error','message','result','catch','CreateSmsMessage','SmsMessage','body','options','raw','then','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','./smsMessage.socket','request','info','SmsMessage,\x20%s,\x20%s','request\x20sent','SmsMessage,\x20%s,\x20%s,\x20%s'];(function(_0x41813b,_0x46638f){var _0x6b8547=function(_0xcea722){while(--_0xcea722){_0x41813b['push'](_0x41813b['shift']());}};_0x6b8547(++_0x46638f);}(_0x23cd,0xab));var _0xd23c=function(_0x11d8e5,_0x33e563){_0x11d8e5=_0x11d8e5-0x0;var _0x1f5477=_0x23cd[_0x11d8e5];return _0x1f5477;};'use strict';var _=require('lodash');var util=require(_0xd23c('0x0'));var moment=require(_0xd23c('0x1'));var BPromise=require(_0xd23c('0x2'));var rs=require(_0xd23c('0x3'));var fs=require('fs');var Redis=require(_0xd23c('0x4'));var db=require(_0xd23c('0x5'))['db'];var utils=require(_0xd23c('0x6'));var logger=require(_0xd23c('0x7'))(_0xd23c('0x8'));var config=require('../../config/environment');var jayson=require(_0xd23c('0x9'));var client=jayson['client'][_0xd23c('0xa')]({'port':0x232a});config['redis']=_[_0xd23c('0xb')](config[_0xd23c('0xc')],{'host':_0xd23c('0xd'),'port':0x18eb});var socket=require(_0xd23c('0xe'))(new Redis(config['redis']));require(_0xd23c('0xf'))['register'](socket);function respondWithRpcPromise(_0x486861,_0x1acdc9,_0x1bf6d1){return new BPromise(function(_0x31f763,_0x4e1e34){return client[_0xd23c('0x10')](_0x486861,_0x1bf6d1)['then'](function(_0x3d0af0){logger[_0xd23c('0x11')](_0xd23c('0x12'),_0x1acdc9,_0xd23c('0x13'));logger['debug'](_0xd23c('0x14'),_0x1acdc9,'request\x20sent',JSON[_0xd23c('0x15')](_0x3d0af0));if(_0x3d0af0['error']){if(_0x3d0af0[_0xd23c('0x16')]['code']===0x1f4){logger['error'](_0xd23c('0x12'),_0x1acdc9,_0x3d0af0[_0xd23c('0x16')][_0xd23c('0x17')]);return _0x4e1e34(_0x3d0af0[_0xd23c('0x16')][_0xd23c('0x17')]);}logger['error'](_0xd23c('0x12'),_0x1acdc9,_0x3d0af0[_0xd23c('0x16')][_0xd23c('0x17')]);return _0x31f763(_0x3d0af0['error'][_0xd23c('0x17')]);}else{logger[_0xd23c('0x11')](_0xd23c('0x12'),_0x1acdc9,'request\x20sent');_0x31f763(_0x3d0af0[_0xd23c('0x18')][_0xd23c('0x17')]);}})[_0xd23c('0x19')](function(_0xf60e91){logger[_0xd23c('0x16')]('SmsMessage,\x20%s,\x20%s',_0x1acdc9,_0xf60e91);_0x4e1e34(_0xf60e91);});});}exports[_0xd23c('0x1a')]=function(_0x3ca97a){var _0xcdfb8e=this;return new Promise(function(_0x4a4100,_0x20e58d){return db[_0xd23c('0x1b')]['create'](_0x3ca97a[_0xd23c('0x1c')],{'raw':_0x3ca97a[_0xd23c('0x1d')]?_0x3ca97a['options'][_0xd23c('0x1e')]===undefined?!![]:![]:!![]})[_0xd23c('0x1f')](function(_0x729681){logger[_0xd23c('0x11')](_0xd23c('0x1a'),_0x3ca97a);logger['debug'](_0xd23c('0x1a'),_0x3ca97a,JSON[_0xd23c('0x15')](_0x729681));_0x4a4100(_0x729681);})[_0xd23c('0x19')](function(_0x4f59aa){logger[_0xd23c('0x16')](_0xd23c('0x1a'),_0x4f59aa['message'],_0x3ca97a);_0x20e58d(_0xcdfb8e[_0xd23c('0x16')](0x1f4,_0x4f59aa[_0xd23c('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index e8a3399..a20f394 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 _0xb6a9=['register','length','smsMessage:','./smsMessage.events','remove','update','removeListener'];(function(_0x5ec6b5,_0x4b8e00){var _0x21324e=function(_0x389bf9){while(--_0x389bf9){_0x5ec6b5['push'](_0x5ec6b5['shift']());}};_0x21324e(++_0x4b8e00);}(_0xb6a9,0x184));var _0x9b6a=function(_0xc67528,_0x24e2fb){_0xc67528=_0xc67528-0x0;var _0x38e26d=_0xb6a9[_0xc67528];return _0x38e26d;};'use strict';var SmsMessageEvents=require(_0x9b6a('0x0'));var events=['save',_0x9b6a('0x1'),_0x9b6a('0x2')];function createListener(_0x460fcf,_0x24800c){return function(_0x52034b){_0x24800c['emit'](_0x460fcf,_0x52034b);};}function removeListener(_0x3904c0,_0x5a31fb){return function(){SmsMessageEvents[_0x9b6a('0x3')](_0x3904c0,_0x5a31fb);};}exports[_0x9b6a('0x4')]=function(_0x3425f0){for(var _0x5bb4b7=0x0,_0x56f3a3=events[_0x9b6a('0x5')];_0x5bb4b7<_0x56f3a3;_0x5bb4b7++){var _0x347b9c=events[_0x5bb4b7];var _0x467323=createListener(_0x9b6a('0x6')+_0x347b9c,_0x3425f0);SmsMessageEvents['on'](_0x347b9c,_0x467323);}}; \ No newline at end of file +var _0x7e77=['./smsMessage.events','save','remove','update','emit','removeListener','register','length','smsMessage:'];(function(_0x580b15,_0x28afa4){var _0x1adb1b=function(_0x47a01f){while(--_0x47a01f){_0x580b15['push'](_0x580b15['shift']());}};_0x1adb1b(++_0x28afa4);}(_0x7e77,0x1e6));var _0x77e7=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0x7e77[_0x4792c8];return _0x35edb1;};'use strict';var SmsMessageEvents=require(_0x77e7('0x0'));var events=[_0x77e7('0x1'),_0x77e7('0x2'),_0x77e7('0x3')];function createListener(_0x625a8d,_0x305d49){return function(_0x15b4ed){_0x305d49[_0x77e7('0x4')](_0x625a8d,_0x15b4ed);};}function removeListener(_0x4aefd3,_0x30c1c2){return function(){SmsMessageEvents[_0x77e7('0x5')](_0x4aefd3,_0x30c1c2);};}exports[_0x77e7('0x6')]=function(_0xf348d5){for(var _0x407e3f=0x0,_0x27563e=events[_0x77e7('0x7')];_0x407e3f<_0x27563e;_0x407e3f++){var _0x5160ca=events[_0x407e3f];var _0x3f4131=createListener(_0x77e7('0x8')+_0x5160ca,_0xf348d5);SmsMessageEvents['on'](_0x5160ca,_0x3f4131);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index 62d96f5..a936c59 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 _0x88ac=['post','create','addTeams','addAgents','put','update','delete','removeTeams','removeAgents','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/members','/:id/teams','getTeams','/:id/users'];(function(_0x57cb27,_0x2d53f0){var _0x4e73af=function(_0x4a6f3c){while(--_0x4a6f3c){_0x57cb27['push'](_0x57cb27['shift']());}};_0x4e73af(++_0x2d53f0);}(_0x88ac,0x1bd));var _0xc88a=function(_0x54f36e,_0x4e2f98){_0x54f36e=_0x54f36e-0x0;var _0x4c1d8e=_0x88ac[_0x54f36e];return _0x4c1d8e;};'use strict';var multer=require('multer');var util=require(_0xc88a('0x0'));var path=require(_0xc88a('0x1'));var timeout=require(_0xc88a('0x2'));var express=require(_0xc88a('0x3'));var router=express[_0xc88a('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xc88a('0x5'));var interaction=require(_0xc88a('0x6'));var config=require(_0xc88a('0x7'));var controller=require(_0xc88a('0x8'));router[_0xc88a('0x9')]('/',auth[_0xc88a('0xa')](),controller[_0xc88a('0xb')]);router[_0xc88a('0x9')](_0xc88a('0xc'),auth['isAuthenticated'](),controller[_0xc88a('0xd')]);router[_0xc88a('0x9')](_0xc88a('0xe'),auth[_0xc88a('0xa')](),controller['show']);router[_0xc88a('0x9')](_0xc88a('0xf'),auth[_0xc88a('0xa')](),controller['getMembers']);router[_0xc88a('0x9')](_0xc88a('0x10'),auth[_0xc88a('0xa')](),controller[_0xc88a('0x11')]);router['get'](_0xc88a('0x12'),auth[_0xc88a('0xa')](),controller['getAgents']);router[_0xc88a('0x13')]('/',auth['isAuthenticated'](),controller[_0xc88a('0x14')]);router[_0xc88a('0x13')](_0xc88a('0x10'),auth[_0xc88a('0xa')](),controller[_0xc88a('0x15')]);router[_0xc88a('0x13')]('/:id/users',auth[_0xc88a('0xa')](),controller[_0xc88a('0x16')]);router[_0xc88a('0x17')](_0xc88a('0xe'),auth[_0xc88a('0xa')](),controller[_0xc88a('0x18')]);router[_0xc88a('0x19')](_0xc88a('0xe'),auth[_0xc88a('0xa')](),controller['destroy']);router[_0xc88a('0x19')](_0xc88a('0x10'),auth[_0xc88a('0xa')](),controller[_0xc88a('0x1a')]);router[_0xc88a('0x19')](_0xc88a('0x12'),auth[_0xc88a('0xa')](),controller[_0xc88a('0x1b')]);module[_0xc88a('0x1c')]=router; \ No newline at end of file +var _0xbaa7=['/:id/users','addAgents','put','update','delete','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./smsQueue.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/members','getMembers','/:id/teams','getAgents','post','addTeams'];(function(_0x388e6a,_0x57a323){var _0xc60b64=function(_0x110e36){while(--_0x110e36){_0x388e6a['push'](_0x388e6a['shift']());}};_0xc60b64(++_0x57a323);}(_0xbaa7,0x158));var _0x7baa=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0xbaa7[_0x5f09c5];return _0x426ad9;};'use strict';var multer=require(_0x7baa('0x0'));var util=require(_0x7baa('0x1'));var path=require('path');var timeout=require(_0x7baa('0x2'));var express=require(_0x7baa('0x3'));var router=express[_0x7baa('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x7baa('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x7baa('0x6'));var controller=require(_0x7baa('0x7'));router[_0x7baa('0x8')]('/',auth[_0x7baa('0x9')](),controller[_0x7baa('0xa')]);router[_0x7baa('0x8')](_0x7baa('0xb'),auth[_0x7baa('0x9')](),controller['describe']);router['get'](_0x7baa('0xc'),auth[_0x7baa('0x9')](),controller[_0x7baa('0xd')]);router[_0x7baa('0x8')](_0x7baa('0xe'),auth['isAuthenticated'](),controller[_0x7baa('0xf')]);router[_0x7baa('0x8')](_0x7baa('0x10'),auth[_0x7baa('0x9')](),controller['getTeams']);router[_0x7baa('0x8')]('/:id/users',auth[_0x7baa('0x9')](),controller[_0x7baa('0x11')]);router[_0x7baa('0x12')]('/',auth['isAuthenticated'](),controller['create']);router[_0x7baa('0x12')](_0x7baa('0x10'),auth[_0x7baa('0x9')](),controller[_0x7baa('0x13')]);router[_0x7baa('0x12')](_0x7baa('0x14'),auth['isAuthenticated'](),controller[_0x7baa('0x15')]);router[_0x7baa('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7baa('0x17')]);router[_0x7baa('0x18')](_0x7baa('0xc'),auth['isAuthenticated'](),controller['destroy']);router[_0x7baa('0x18')](_0x7baa('0x10'),auth['isAuthenticated'](),controller[_0x7baa('0x19')]);router['delete'](_0x7baa('0x14'),auth['isAuthenticated'](),controller[_0x7baa('0x1a')]);module[_0x7baa('0x1b')]=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index e0cc2a2..eb3cba9 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 _0xe195=['name','STRING','INTEGER','ENUM','rrmemory','roundrobin','sequelize','exports'];(function(_0x176b19,_0x4cbac4){var _0x6353f4=function(_0x1d9eae){while(--_0x1d9eae){_0x176b19['push'](_0x176b19['shift']());}};_0x6353f4(++_0x4cbac4);}(_0xe195,0x11e));var _0x5e19=function(_0x4df78f,_0x3356b0){_0x4df78f=_0x4df78f-0x0;var _0xa47118=_0xe195[_0x4df78f];return _0xa47118;};'use strict';var Sequelize=require(_0x5e19('0x0'));module[_0x5e19('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x5e19('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x5e19('0x3')]},'timeout':{'type':Sequelize[_0x5e19('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x5e19('0x5')](_0x5e19('0x6'),'beepall',_0x5e19('0x7'))}}; \ No newline at end of file +var _0x013f=['sequelize','exports','STRING','name','INTEGER','ENUM','beepall','roundrobin'];(function(_0x1c1f1f,_0x4addd5){var _0x19b499=function(_0x5d47c1){while(--_0x5d47c1){_0x1c1f1f['push'](_0x1c1f1f['shift']());}};_0x19b499(++_0x4addd5);}(_0x013f,0x70));var _0xf013=function(_0x28ddf8,_0x3228e6){_0x28ddf8=_0x28ddf8-0x0;var _0x4edf3e=_0x013f[_0x28ddf8];return _0x4edf3e;};'use strict';var Sequelize=require(_0xf013('0x0'));module[_0xf013('0x1')]={'name':{'type':Sequelize[_0xf013('0x2')],'unique':_0xf013('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xf013('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xf013('0x5')]('rrmemory',_0xf013('0x6'),_0xf013('0x7'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index d4746b4..eccfa16 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 _0x5f2f=['redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','get','SmsQueues','UserProfileResource','error','stack','name','map','SmsQueue','rawAttributes','type','key','getOptions','where','include','findAll','rows','show','params','model','keys','query','filters','intersection','attributes','fields','includeAll','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserSmsQueue','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','findAndCountAll','UserId','agent','smsPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','addTeams','ids','User','Agents','online','voicePause','interface','flatMap','findOrCreate','forEach','emit','userSmsQueue:save','removeTeams','field','SmsQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','sequelize','transaction','isEmpty','removeAgents','addAgents','omit','spread','isArray','userSmsQueue:remove','getAgents','bluebird','util','lodash','squel','ioredis','../../components/parsers/qs','../../config/logger','api'];(function(_0x531f56,_0x334fcc){var _0x2cd1d4=function(_0x12a368){while(--_0x12a368){_0x531f56['push'](_0x531f56['shift']());}};_0x2cd1d4(++_0x334fcc);}(_0x5f2f,0x73));var _0xf5f2=function(_0x35781e,_0x4db7e8){_0x35781e=_0x35781e-0x0;var _0x5d24a2=_0x5f2f[_0x35781e];return _0x5d24a2;};'use strict';var BPromise=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var _=require(_0xf5f2('0x2'));var squel=require(_0xf5f2('0x3'));var Redis=require(_0xf5f2('0x4'));var qs=require(_0xf5f2('0x5'));var logger=require(_0xf5f2('0x6'))(_0xf5f2('0x7'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0xf5f2('0x8')]=_[_0xf5f2('0x9')](config[_0xf5f2('0x8')],{'host':_0xf5f2('0xa'),'port':0x18eb});var socket=require(_0xf5f2('0xb'))(new Redis(config[_0xf5f2('0x8')]));require('./smsQueue.socket')[_0xf5f2('0xc')](socket);function respondWithStatusCode(_0x46cd9c,_0x2ec345){_0x2ec345=_0x2ec345||0xcc;return function(_0x56a69f){if(_0x56a69f){return _0x46cd9c[_0xf5f2('0xd')](_0x2ec345);}return _0x46cd9c[_0xf5f2('0xe')](_0x2ec345)[_0xf5f2('0xf')]();};}function respondWithResult(_0x4e0e6b,_0x977a59){_0x977a59=_0x977a59||0xc8;return function(_0x4ebbbe){if(_0x4ebbbe){return _0x4e0e6b['status'](_0x977a59)[_0xf5f2('0x10')](_0x4ebbbe);}};}function respondWithFilteredResult(_0x151aba,_0x4b78cd){return function(_0x336f6b){if(_0x336f6b){var _0x14b51f=typeof _0x4b78cd[_0xf5f2('0x11')]===_0xf5f2('0x12')&&typeof _0x4b78cd[_0xf5f2('0x13')]===_0xf5f2('0x12');var _0x5c01b8=_0x336f6b[_0xf5f2('0x14')];var _0xea612c=_0x14b51f?0x0:_0x4b78cd[_0xf5f2('0x11')];var _0x1c1a5c=_0x14b51f?_0x336f6b[_0xf5f2('0x14')]:_0x4b78cd['offset']+_0x4b78cd[_0xf5f2('0x13')];var _0x286197;if(_0x1c1a5c>=_0x5c01b8){_0x1c1a5c=_0x5c01b8;_0x286197=0xc8;}else{_0x286197=0xce;}_0x151aba[_0xf5f2('0xe')](_0x286197);return _0x151aba[_0xf5f2('0x15')](_0xf5f2('0x16'),_0xea612c+'-'+_0x1c1a5c+'/'+_0x5c01b8)[_0xf5f2('0x10')](_0x336f6b);}return null;};}function saveUpdates(_0xdb61b3){return function(_0x395a5a){if(_0x395a5a){return _0x395a5a[_0xf5f2('0x17')](_0xdb61b3)[_0xf5f2('0x18')](function(_0x20fccd){return _0x20fccd;});}return null;};}function removeEntity(_0x28e097){return function(_0x4ff59b){if(_0x4ff59b){return _0x4ff59b[_0xf5f2('0x19')]()[_0xf5f2('0x18')](function(){var _0x626999=_0x4ff59b[_0xf5f2('0x1a')]({'plain':!![]});var _0x56acc5=_0xf5f2('0x1b');return db[_0xf5f2('0x1c')]['destroy']({'where':{'type':_0x56acc5,'resourceId':_0x626999['id']}})['then'](function(){return _0x4ff59b;});})[_0xf5f2('0x18')](function(){_0x28e097[_0xf5f2('0xe')](0xcc)['end']();});}};}function handleEntityNotFound(_0x45b74f){return function(_0x170042){if(!_0x170042){_0x45b74f[_0xf5f2('0xd')](0x194);}return _0x170042;};}function handleError(_0x39c024,_0x36f1cb){_0x36f1cb=_0x36f1cb||0x1f4;return function(_0x4c691a){logger[_0xf5f2('0x1d')](_0x4c691a[_0xf5f2('0x1e')]);if(_0x4c691a[_0xf5f2('0x1f')]){delete _0x4c691a[_0xf5f2('0x1f')];}_0x39c024[_0xf5f2('0xe')](_0x36f1cb)['send'](_0x4c691a);};}exports['index']=function(_0x5f1124,_0x3f79d5){var _0x13da6f={};var _0x1a5bb3={'count':0x0,'rows':[]};var _0xf6c58d=_[_0xf5f2('0x20')](db[_0xf5f2('0x21')][_0xf5f2('0x22')],function(_0x294414){return{'name':_0x294414['fieldName'],'type':_0x294414[_0xf5f2('0x23')][_0xf5f2('0x24')]};});_0x13da6f=qs[_0xf5f2('0x25')](_0xf6c58d,_0x5f1124);var _0x31bfcb={'where':_0x13da6f[_0xf5f2('0x26')]};return db[_0xf5f2('0x21')]['count'](_0x31bfcb)['then'](function(_0x22c826){_0x1a5bb3[_0xf5f2('0x14')]=_0x22c826;_0x13da6f[_0xf5f2('0x27')]=qs['include'](_0x5f1124['query']);return db[_0xf5f2('0x21')][_0xf5f2('0x28')](_0x13da6f);})[_0xf5f2('0x18')](function(_0x153924){_0x1a5bb3[_0xf5f2('0x29')]=_0x153924;return _0x1a5bb3;})['then'](respondWithFilteredResult(_0x3f79d5,_0x13da6f))['catch'](handleError(_0x3f79d5,null));};exports[_0xf5f2('0x2a')]=function(_0x4e19cb,_0xb744b9){var _0x58a4df={'raw':!![],'where':{'id':_0x4e19cb[_0xf5f2('0x2b')]['id']}},_0x45b643={};_0x45b643[_0xf5f2('0x2c')]=_[_0xf5f2('0x2d')](db[_0xf5f2('0x21')][_0xf5f2('0x22')]);_0x45b643[_0xf5f2('0x2e')]=_[_0xf5f2('0x2d')](_0x4e19cb['query']);_0x45b643[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x45b643[_0xf5f2('0x2c')],_0x45b643[_0xf5f2('0x2e')]);_0x58a4df[_0xf5f2('0x31')]=_[_0xf5f2('0x30')](_0x45b643[_0xf5f2('0x2c')],qs['fields'](_0x4e19cb[_0xf5f2('0x2e')][_0xf5f2('0x32')]));_0x58a4df['attributes']=_0x58a4df[_0xf5f2('0x31')]['length']?_0x58a4df[_0xf5f2('0x31')]:_0x45b643[_0xf5f2('0x2c')];if(_0x4e19cb[_0xf5f2('0x2e')][_0xf5f2('0x33')]){_0x58a4df['include']=[{'all':!![]}];}_0x58a4df=_['merge']({},_0x58a4df,_0x4e19cb[_0xf5f2('0x34')]);return db[_0xf5f2('0x21')][_0xf5f2('0x35')](_0x58a4df)['then'](handleEntityNotFound(_0xb744b9,null))[_0xf5f2('0x18')](respondWithResult(_0xb744b9,null))['catch'](handleError(_0xb744b9,null));};exports[_0xf5f2('0x36')]=function(_0x566c47,_0x46f464){return db[_0xf5f2('0x21')]['create'](_0x566c47[_0xf5f2('0x37')],{})[_0xf5f2('0x18')](function(_0x5a4441){var _0x35f738=_0x566c47['user']['get']({'plain':!![]});if(!_0x35f738)throw new Error(_0xf5f2('0x38'));if(_0x35f738[_0xf5f2('0x39')]===_0xf5f2('0x3a')){var _0x2d4400=_0x5a4441[_0xf5f2('0x1a')]({'plain':!![]});var _0xe62b57=_0xf5f2('0x1b');return db['UserProfileSection'][_0xf5f2('0x35')]({'where':{'name':_0xe62b57,'userProfileId':_0x35f738[_0xf5f2('0x3b')]},'raw':!![]})['then'](function(_0xc6a1ae){if(_0xc6a1ae&&_0xc6a1ae[_0xf5f2('0x3c')]===0x0){return db[_0xf5f2('0x1c')][_0xf5f2('0x36')]({'name':_0x2d4400[_0xf5f2('0x1f')],'resourceId':_0x2d4400['id'],'type':_0xc6a1ae[_0xf5f2('0x1f')],'sectionId':_0xc6a1ae['id']},{})[_0xf5f2('0x18')](function(){return _0x5a4441;});}else{return _0x5a4441;}})[_0xf5f2('0x3d')](function(_0x574f24){logger[_0xf5f2('0x1d')](_0xf5f2('0x3e'),_0x574f24);throw _0x574f24;});}return _0x5a4441;})[_0xf5f2('0x18')](respondWithResult(_0x46f464,0xc9))['catch'](handleError(_0x46f464,null));};exports['update']=function(_0x59eb00,_0x76d21b){if(_0x59eb00[_0xf5f2('0x37')]['id']){delete _0x59eb00['body']['id'];}return db[_0xf5f2('0x21')][_0xf5f2('0x35')]({'where':{'id':_0x59eb00[_0xf5f2('0x2b')]['id']}})[_0xf5f2('0x18')](handleEntityNotFound(_0x76d21b,null))[_0xf5f2('0x18')](saveUpdates(_0x59eb00[_0xf5f2('0x37')],null))[_0xf5f2('0x18')](respondWithResult(_0x76d21b,null))[_0xf5f2('0x3d')](handleError(_0x76d21b,null));};exports[_0xf5f2('0x19')]=function(_0x106062,_0x444317){return db[_0xf5f2('0x21')][_0xf5f2('0x35')]({'where':{'id':_0x106062[_0xf5f2('0x2b')]['id']}})['then'](handleEntityNotFound(_0x444317,null))[_0xf5f2('0x18')](removeEntity(_0x444317,null))['catch'](handleError(_0x444317,null));};exports[_0xf5f2('0x3f')]=function(_0xc04f44,_0x218def){return db[_0xf5f2('0x21')][_0xf5f2('0x3f')]()[_0xf5f2('0x18')](respondWithResult(_0x218def,null))['catch'](handleError(_0x218def,null));};exports[_0xf5f2('0x40')]=function(_0x2e7193,_0x1c1497){var _0x29b108={'raw':!![],'where':{}},_0x12124d={},_0x10753a;return db[_0xf5f2('0x21')][_0xf5f2('0x41')]({'where':{'id':_0x2e7193['params']['id']}})[_0xf5f2('0x18')](handleEntityNotFound(_0x1c1497,null))[_0xf5f2('0x18')](function(_0x45db9a){if(_0x45db9a){_0x10753a=_0x45db9a['get']({'plain':!![]});_0x12124d[_0xf5f2('0x2c')]=_[_0xf5f2('0x2d')](db[_0xf5f2('0x42')]['rawAttributes']);_0x12124d['query']=_[_0xf5f2('0x2d')](_0x2e7193[_0xf5f2('0x2e')]);_0x12124d['filters']=_[_0xf5f2('0x30')](_0x12124d['model'],_0x12124d[_0xf5f2('0x2e')]);_0x29b108['attributes']=_[_0xf5f2('0x30')](_0x12124d['model'],qs[_0xf5f2('0x32')](_0x2e7193[_0xf5f2('0x2e')][_0xf5f2('0x32')]));_0x29b108[_0xf5f2('0x31')]=_0x29b108['attributes'][_0xf5f2('0x43')]?_0x29b108[_0xf5f2('0x31')]:_0x12124d['model'];if(!_0x2e7193['query'][_0xf5f2('0x44')](_0xf5f2('0x45'))){_0x29b108['limit']=qs[_0xf5f2('0x13')](_0x2e7193[_0xf5f2('0x2e')][_0xf5f2('0x13')]);_0x29b108[_0xf5f2('0x11')]=qs['offset'](_0x2e7193['query'][_0xf5f2('0x11')]);}_0x29b108[_0xf5f2('0x46')]=qs['sort'](_0x2e7193[_0xf5f2('0x2e')][_0xf5f2('0x47')]);_0x29b108[_0xf5f2('0x26')]=qs[_0xf5f2('0x2f')](_[_0xf5f2('0x48')](_0x2e7193[_0xf5f2('0x2e')],_0x12124d[_0xf5f2('0x2f')]));_0x29b108['where']['SmsQueueId']=_0x45db9a['id'];if(_0x2e7193[_0xf5f2('0x2e')][_0xf5f2('0x49')]){_0x29b108[_0xf5f2('0x26')]=_[_0xf5f2('0x4a')](_0x29b108[_0xf5f2('0x26')],{'$or':_['map'](_0x29b108[_0xf5f2('0x31')],function(_0x20ba91){var _0x18b124={};_0x18b124[_0x20ba91]={'$like':'%'+_0x2e7193['query'][_0xf5f2('0x49')]+'%'};return _0x18b124;})});}_0x29b108=_['merge']({},_0x29b108,_0x2e7193[_0xf5f2('0x34')]);return db[_0xf5f2('0x42')][_0xf5f2('0x28')](_0x29b108);}})[_0xf5f2('0x18')](function(_0x4afa4d){if(_0x4afa4d){return db['User'][_0xf5f2('0x4b')]({'where':{'id':_['map'](_0x4afa4d,_0xf5f2('0x4c')),'role':_0xf5f2('0x4d')},'attributes':['id','name',_0xf5f2('0x4e'),_0xf5f2('0x4f'),_0xf5f2('0x50')]});}})['then'](function(_0x397b99){if(_0x397b99){return{'count':_0x397b99[_0xf5f2('0x14')],'rows':_[_0xf5f2('0x20')](_0x397b99[_0xf5f2('0x29')],function(_0x51fa7e){return{'membername':_0x51fa7e[_0xf5f2('0x1f')],'UserId':_0x51fa7e['id'],'queue_name':_0x10753a['name'],'SmsQueueId':_0x10753a['id'],'interface':util[_0xf5f2('0x51')](_0xf5f2('0x52'),_0xf5f2('0x53'),_0x51fa7e[_0xf5f2('0x1f')]),'penalty':0x0,'paused':_0x51fa7e[_0xf5f2('0x4e')],'createdAt':_0x51fa7e['createdAt'],'updatedAt':_0x51fa7e[_0xf5f2('0x4f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xf5f2('0x18')](respondWithFilteredResult(_0x1c1497,_0x29b108))[_0xf5f2('0x3d')](handleError(_0x1c1497,null));};exports[_0xf5f2('0x54')]=function(_0x2c5733,_0x5359b5){var _0x31e16b={};var _0x5ee6bc={};var _0x4c96ee;var _0xd4f6ef;return db['SmsQueue'][_0xf5f2('0x41')]({'where':{'id':_0x2c5733[_0xf5f2('0x2b')]['id']}})[_0xf5f2('0x18')](handleEntityNotFound(_0x5359b5,null))[_0xf5f2('0x18')](function(_0x5767fc){if(_0x5767fc){_0x4c96ee=_0x5767fc;_0x5ee6bc[_0xf5f2('0x2c')]=_[_0xf5f2('0x2d')](db[_0xf5f2('0x55')][_0xf5f2('0x22')]);_0x5ee6bc[_0xf5f2('0x2e')]=_[_0xf5f2('0x2d')](_0x2c5733[_0xf5f2('0x2e')]);_0x5ee6bc['filters']=_[_0xf5f2('0x30')](_0x5ee6bc[_0xf5f2('0x2c')],_0x5ee6bc[_0xf5f2('0x2e')]);_0x31e16b[_0xf5f2('0x31')]=_['intersection'](_0x5ee6bc[_0xf5f2('0x2c')],qs['fields'](_0x2c5733[_0xf5f2('0x2e')][_0xf5f2('0x32')]));_0x31e16b['attributes']=_0x31e16b[_0xf5f2('0x31')][_0xf5f2('0x43')]?_0x31e16b[_0xf5f2('0x31')]:_0x5ee6bc[_0xf5f2('0x2c')];_0x31e16b[_0xf5f2('0x46')]=qs['sort'](_0x2c5733[_0xf5f2('0x2e')][_0xf5f2('0x47')]);_0x31e16b[_0xf5f2('0x26')]=qs[_0xf5f2('0x2f')](_[_0xf5f2('0x48')](_0x2c5733[_0xf5f2('0x2e')],_0x5ee6bc['filters']));if(_0x2c5733[_0xf5f2('0x2e')][_0xf5f2('0x49')]){_0x31e16b['where']=_[_0xf5f2('0x4a')](_0x31e16b[_0xf5f2('0x26')],{'$or':_[_0xf5f2('0x20')](_0x31e16b['attributes'],function(_0x551cc9){var _0x4f3df6={};_0x4f3df6[_0x551cc9]={'$like':'%'+_0x2c5733[_0xf5f2('0x2e')][_0xf5f2('0x49')]+'%'};return _0x4f3df6;})});}_0x31e16b=_[_0xf5f2('0x4a')]({},_0x31e16b,_0x2c5733[_0xf5f2('0x34')]);return _0x4c96ee[_0xf5f2('0x54')](_0x31e16b);}})['then'](function(_0x278b76){if(_0x278b76){_0xd4f6ef=_0x278b76[_0xf5f2('0x43')];if(!_0x2c5733[_0xf5f2('0x2e')][_0xf5f2('0x44')](_0xf5f2('0x45'))){_0x31e16b[_0xf5f2('0x13')]=qs[_0xf5f2('0x13')](_0x2c5733[_0xf5f2('0x2e')][_0xf5f2('0x13')]);_0x31e16b[_0xf5f2('0x11')]=qs[_0xf5f2('0x11')](_0x2c5733['query']['offset']);}return _0x4c96ee['getTeams'](_0x31e16b);}})[_0xf5f2('0x18')](function(_0xafba8e){if(_0xafba8e){return _0xafba8e?{'count':_0xd4f6ef,'rows':_0xafba8e}:null;}})[_0xf5f2('0x18')](respondWithResult(_0x5359b5,null))[_0xf5f2('0x3d')](handleError(_0x5359b5,null));};exports[_0xf5f2('0x56')]=function(_0x5c6959,_0x9d943f){var _0x43c732=_0x5c6959[_0xf5f2('0x37')][_0xf5f2('0x57')];return db[_0xf5f2('0x55')]['findAll']({'where':{'id':_0x43c732},'attributes':['id'],'include':[{'model':db[_0xf5f2('0x58')],'as':_0xf5f2('0x59'),'attributes':['id','name',_0xf5f2('0x5a'),_0xf5f2('0x5b'),_0xf5f2('0x5c')],'raw':!![]}]})[_0xf5f2('0x18')](function(_0x588434){if(_0x588434){var _0x40b36e=_[_0xf5f2('0x5d')](_0x588434,function(_0x19602d){var _0x2adeb4=_0x19602d[_0xf5f2('0x1a')]({'plain':!![]});return _0x2adeb4['Agents'];});return db['SmsQueue'][_0xf5f2('0x35')]({'where':{'id':_0x5c6959[_0xf5f2('0x2b')]['id']}})[_0xf5f2('0x18')](function(_0xe3ea1e){return db['sequelize']['transaction'](function(_0x16048e){return _0xe3ea1e['addTeams'](_0x43c732,{'transaction':_0x16048e})['then'](function(){return BPromise['each'](_0x40b36e,function(_0x57cb18){return db[_0xf5f2('0x42')][_0xf5f2('0x5e')]({'where':{'UserId':_0x57cb18['id'],'SmsQueueId':_0x5c6959[_0xf5f2('0x2b')]['id']},'transaction':_0x16048e});});})[_0xf5f2('0x18')](function(){_0x40b36e[_0xf5f2('0x5f')](function(_0x9f941e){socket[_0xf5f2('0x60')](_0xf5f2('0x61'),{'UserId':_0x9f941e['id'],'SmsQueueId':_0xe3ea1e['id']});});});});});}})[_0xf5f2('0x18')](respondWithStatusCode(_0x9d943f,null))[_0xf5f2('0x3d')](handleError(_0x9d943f,null));};exports[_0xf5f2('0x62')]=function(_0x2afeac,_0x1ba503){return db[_0xf5f2('0x55')][_0xf5f2('0x28')]({'where':{'id':_0x2afeac[_0xf5f2('0x2e')][_0xf5f2('0x57')]},'attributes':['id'],'include':[{'model':db[_0xf5f2('0x58')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xf5f2('0x18')](handleEntityNotFound(_0x1ba503,null))[_0xf5f2('0x18')](function(_0x21043b){var _0x2811ad=_[_0xf5f2('0x20')](_0x21043b,'id');var _0x308220=[];var _0x16491c=[];var _0xcf48eb=squel['select']();_0xcf48eb[_0xf5f2('0x63')]('tq.TeamId')['from']('team_has_sms_queues','tq')['join']('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0xf5f2('0x26')](_0xf5f2('0x64'),_0x2afeac[_0xf5f2('0x2b')]['id']);for(var _0x375bc9=0x0;_0x375bc9<_0x21043b[_0xf5f2('0x43')];_0x375bc9+=0x1){let _0x3cf857=_0x21043b[_0x375bc9];for(var _0x5dc63f=0x0;_0x5dc63f<_0x3cf857['Agents'][_0xf5f2('0x43')];_0x5dc63f+=0x1){let _0x578a22=_0x3cf857[_0xf5f2('0x59')][_0x5dc63f];var _0x186fdd=_0xcf48eb['clone']();_0x186fdd['where'](_0xf5f2('0x65'),_0x578a22['id']);_0x16491c[_0xf5f2('0x66')](db['sequelize'][_0xf5f2('0x2e')](_0x186fdd[_0xf5f2('0x67')](),{'type':db['sequelize'][_0xf5f2('0x68')][_0xf5f2('0x69')]})[_0xf5f2('0x18')](function(_0x4c1678){if(_0x4c1678[_0xf5f2('0x43')]===0x1){return _0x578a22['id'];}else{var _0xc28adc=_[_0xf5f2('0x6a')](_[_0xf5f2('0x20')](_0x4c1678,_0xf5f2('0x6b')),function(_0x3e0288){return _[_0xf5f2('0x6c')](_0x2811ad,_0x3e0288);});if(_0xc28adc){return _0x578a22['id'];}}}));}}return BPromise[_0xf5f2('0x6d')](_0x16491c)[_0xf5f2('0x18')](function(_0x3a6f60){_0x308220=_(_0x308220)[_0xf5f2('0x6e')](_0x3a6f60)[_0xf5f2('0x6f')]()[_0xf5f2('0x70')]();return db[_0xf5f2('0x21')][_0xf5f2('0x35')]({'where':{'id':_0x2afeac[_0xf5f2('0x2b')]['id']}})[_0xf5f2('0x18')](function(_0x29a9d4){return db[_0xf5f2('0x71')][_0xf5f2('0x72')](function(_0x800f42){return _0x29a9d4['removeTeams'](_0x2afeac[_0xf5f2('0x2e')][_0xf5f2('0x57')],{'transaction':_0x800f42})['then'](function(){if(!_[_0xf5f2('0x73')](_0x308220)){return _0x29a9d4[_0xf5f2('0x74')](_0x308220,{'transaction':_0x800f42});}})['then'](function(){_0x308220[_0xf5f2('0x5f')](function(_0x2f54eb){socket[_0xf5f2('0x60')]('userSmsQueue:remove',{'UserId':_0x2f54eb,'SmsQueueId':_0x29a9d4['id']});});});});});});})['then'](respondWithStatusCode(_0x1ba503,null))[_0xf5f2('0x3d')](handleError(_0x1ba503,null));};exports[_0xf5f2('0x75')]=function(_0x213ade,_0x5ba275){return db['SmsQueue'][_0xf5f2('0x35')]({'where':{'id':_0x213ade[_0xf5f2('0x2b')]['id']}})[_0xf5f2('0x18')](handleEntityNotFound(_0x5ba275,null))['then'](function(_0x4cde64){if(_0x4cde64){return _0x4cde64['addAgents'](_0x213ade['body']['ids'],_[_0xf5f2('0x76')](_0x213ade['body'],[_0xf5f2('0x57'),'id'])||{})[_0xf5f2('0x77')](function(_0xec3c35){for(var _0x43a167=0x0;_0x43a167<_0x213ade[_0xf5f2('0x37')][_0xf5f2('0x57')][_0xf5f2('0x43')];_0x43a167+=0x1){socket[_0xf5f2('0x60')](_0xf5f2('0x61'),{'UserId':Number(_0x213ade[_0xf5f2('0x37')][_0xf5f2('0x57')][_0x43a167]),'SmsQueueId':Number(_0x213ade[_0xf5f2('0x2b')]['id'])});}return _0xec3c35;});}})[_0xf5f2('0x18')](respondWithResult(_0x5ba275,null))['catch'](handleError(_0x5ba275,null));};exports[_0xf5f2('0x74')]=function(_0x2a4fed,_0x5783e2){return db[_0xf5f2('0x21')][_0xf5f2('0x35')]({'where':{'id':_0x2a4fed['params']['id']}})[_0xf5f2('0x18')](handleEntityNotFound(_0x5783e2,null))[_0xf5f2('0x18')](function(_0x281f61){if(_0x281f61){return _0x281f61['removeAgents'](_0x2a4fed[_0xf5f2('0x2e')][_0xf5f2('0x57')])['then'](function(){if(_[_0xf5f2('0x78')](_0x2a4fed[_0xf5f2('0x2e')][_0xf5f2('0x57')])){for(var _0x517aa8=0x0;_0x517aa8<_0x2a4fed[_0xf5f2('0x2e')]['ids'][_0xf5f2('0x43')];_0x517aa8+=0x1){socket['emit'](_0xf5f2('0x79'),{'UserId':Number(_0x2a4fed[_0xf5f2('0x2e')][_0xf5f2('0x57')][_0x517aa8]),'SmsQueueId':Number(_0x2a4fed[_0xf5f2('0x2b')]['id'])});}}else{socket['emit'](_0xf5f2('0x79'),{'UserId':Number(_0x2a4fed['query']['ids']),'SmsQueueId':Number(_0x2a4fed['params']['id'])});}});}})[_0xf5f2('0x18')](respondWithStatusCode(_0x5783e2,null))[_0xf5f2('0x3d')](handleError(_0x5783e2,null));};exports['getAgents']=function(_0x3c8a1b,_0x15025d){var _0x35790b={};var _0x3962b2={};var _0x28873e;var _0x1fc5ae;return db['SmsQueue'][_0xf5f2('0x41')]({'where':{'id':_0x3c8a1b[_0xf5f2('0x2b')]['id']}})['then'](handleEntityNotFound(_0x15025d,null))[_0xf5f2('0x18')](function(_0x19cbff){if(_0x19cbff){_0x28873e=_0x19cbff;_0x3962b2['model']=_[_0xf5f2('0x2d')](db[_0xf5f2('0x58')][_0xf5f2('0x22')]);_0x3962b2[_0xf5f2('0x2e')]=_[_0xf5f2('0x2d')](_0x3c8a1b[_0xf5f2('0x2e')]);_0x3962b2['filters']=_[_0xf5f2('0x30')](_0x3962b2[_0xf5f2('0x2c')],_0x3962b2[_0xf5f2('0x2e')]);_0x35790b[_0xf5f2('0x31')]=_[_0xf5f2('0x30')](_0x3962b2[_0xf5f2('0x2c')],qs[_0xf5f2('0x32')](_0x3c8a1b[_0xf5f2('0x2e')][_0xf5f2('0x32')]));_0x35790b['attributes']=_0x35790b[_0xf5f2('0x31')][_0xf5f2('0x43')]?_0x35790b[_0xf5f2('0x31')]:_0x3962b2[_0xf5f2('0x2c')];_0x35790b[_0xf5f2('0x46')]=qs[_0xf5f2('0x47')](_0x3c8a1b[_0xf5f2('0x2e')][_0xf5f2('0x47')]);_0x35790b[_0xf5f2('0x26')]=qs[_0xf5f2('0x2f')](_['pick'](_0x3c8a1b['query'],_0x3962b2[_0xf5f2('0x2f')]));if(_0x3c8a1b[_0xf5f2('0x2e')][_0xf5f2('0x49')]){_0x35790b[_0xf5f2('0x26')]=_['merge'](_0x35790b[_0xf5f2('0x26')],{'$or':_[_0xf5f2('0x20')](_0x35790b[_0xf5f2('0x31')],function(_0x3d7f53){var _0x456a1e={};_0x456a1e[_0x3d7f53]={'$like':'%'+_0x3c8a1b['query'][_0xf5f2('0x49')]+'%'};return _0x456a1e;})});}_0x35790b=_[_0xf5f2('0x4a')]({},_0x35790b,_0x3c8a1b['options']);return _0x28873e[_0xf5f2('0x7a')](_0x35790b);}})[_0xf5f2('0x18')](function(_0x2563fa){if(_0x2563fa){_0x1fc5ae=_0x2563fa[_0xf5f2('0x43')];if(!_0x3c8a1b['query'][_0xf5f2('0x44')](_0xf5f2('0x45'))){_0x35790b[_0xf5f2('0x13')]=qs['limit'](_0x3c8a1b['query'][_0xf5f2('0x13')]);_0x35790b[_0xf5f2('0x11')]=qs[_0xf5f2('0x11')](_0x3c8a1b[_0xf5f2('0x2e')][_0xf5f2('0x11')]);}return _0x28873e[_0xf5f2('0x7a')](_0x35790b);}})['then'](function(_0x39dee8){if(_0x39dee8){return _0x39dee8?{'count':_0x1fc5ae,'rows':_0x39dee8}:null;}})['then'](respondWithResult(_0x15025d,null))[_0xf5f2('0x3d')](handleError(_0x15025d,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(_0x484e36,_0x4482d8){var _0xafc85d=function(_0xaba9c8){while(--_0xaba9c8){_0x484e36['push'](_0x484e36['shift']());}};_0xafc85d(++_0x4482d8);}(_0x0b0e,0x187));var _0xe0b0=function(_0x356e8d,_0x24c719){_0x356e8d=_0x356e8d-0x0;var _0x39e65a=_0x0b0e[_0x356e8d];return _0x39e65a;};'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 ff94133..1fed3d6 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 _0xabe6=['hasOwnProperty','hook','exports','events','../../mysqldb','SmsQueue','setMaxListeners','save','update','remove','emit'];(function(_0x3e6647,_0x2c0d09){var _0x46bddd=function(_0xad96c0){while(--_0xad96c0){_0x3e6647['push'](_0x3e6647['shift']());}};_0x46bddd(++_0x2c0d09);}(_0xabe6,0x163));var _0x6abe=function(_0x3d3845,_0x198036){_0x3d3845=_0x3d3845-0x0;var _0x27c984=_0xabe6[_0x3d3845];return _0x27c984;};'use strict';var EventEmitter=require(_0x6abe('0x0'));var SmsQueue=require(_0x6abe('0x1'))['db'][_0x6abe('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x6abe('0x3')](0x0);var events={'afterCreate':_0x6abe('0x4'),'afterUpdate':_0x6abe('0x5'),'afterDestroy':_0x6abe('0x6')};function emitEvent(_0x494390){return function(_0x6481e2,_0x47fd1d,_0x3bab72){SmsQueueEvents['emit'](_0x494390+':'+_0x6481e2['id'],_0x6481e2);SmsQueueEvents[_0x6abe('0x7')](_0x494390,_0x6481e2);_0x3bab72(null);};}for(var e in events){if(events[_0x6abe('0x8')](e)){var event=events[e];SmsQueue[_0x6abe('0x9')](e,emitEvent(event));}}module[_0x6abe('0xa')]=SmsQueueEvents; \ No newline at end of file +var _0xf288=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove'];(function(_0xfde6b3,_0x1334f9){var _0x326049=function(_0x2a25fe){while(--_0x2a25fe){_0xfde6b3['push'](_0xfde6b3['shift']());}};_0x326049(++_0x1334f9);}(_0xf288,0xd6));var _0x8f28=function(_0x19aa84,_0x549537){_0x19aa84=_0x19aa84-0x0;var _0x536146=_0xf288[_0x19aa84];return _0x536146;};'use strict';var EventEmitter=require(_0x8f28('0x0'));var SmsQueue=require(_0x8f28('0x1'))['db']['SmsQueue'];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x8f28('0x2')](0x0);var events={'afterCreate':_0x8f28('0x3'),'afterUpdate':_0x8f28('0x4'),'afterDestroy':_0x8f28('0x5')};function emitEvent(_0x4a9ed3){return function(_0x1d2256,_0x1fa0bc,_0x230054){SmsQueueEvents[_0x8f28('0x6')](_0x4a9ed3+':'+_0x1d2256['id'],_0x1d2256);SmsQueueEvents['emit'](_0x4a9ed3,_0x1d2256);_0x230054(null);};}for(var e in events){if(events[_0x8f28('0x7')](e)){var event=events[e];SmsQueue[_0x8f28('0x8')](e,emitEvent(event));}}module[_0x8f28('0x9')]=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index 7df5041..8b213c5 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 _0x0532=['define','SmsQueue','sms_queues','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsQueue.attributes','exports'];(function(_0x213283,_0x40ae6c){var _0x26ee9e=function(_0x3d7364){while(--_0x3d7364){_0x213283['push'](_0x213283['shift']());}};_0x26ee9e(++_0x40ae6c);}(_0x0532,0x107));var _0x2053=function(_0x30a869,_0xbc8362){_0x30a869=_0x30a869-0x0;var _0x364f75=_0x0532[_0x30a869];return _0x364f75;};'use strict';var _=require('lodash');var util=require(_0x2053('0x0'));var logger=require('../../config/logger')(_0x2053('0x1'));var moment=require(_0x2053('0x2'));var BPromise=require(_0x2053('0x3'));var rp=require(_0x2053('0x4'));var fs=require('fs');var path=require(_0x2053('0x5'));var rimraf=require(_0x2053('0x6'));var config=require(_0x2053('0x7'));var attributes=require(_0x2053('0x8'));module[_0x2053('0x9')]=function(_0x39d246,_0x8e73a4){return _0x39d246[_0x2053('0xa')](_0x2053('0xb'),attributes,{'tableName':_0x2053('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3e9c=['./smsQueue.attributes','define','SmsQueue','sms_queues','lodash','../../config/logger','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x3ee44c,_0x292fc2){var _0x15971a=function(_0x9aced8){while(--_0x9aced8){_0x3ee44c['push'](_0x3ee44c['shift']());}};_0x15971a(++_0x292fc2);}(_0x3e9c,0xf6));var _0xc3e9=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x3e9c[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0xc3e9('0x0'));var util=require('util');var logger=require(_0xc3e9('0x1'))('api');var moment=require(_0xc3e9('0x2'));var BPromise=require(_0xc3e9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc3e9('0x4'));var rimraf=require(_0xc3e9('0x5'));var config=require(_0xc3e9('0x6'));var attributes=require(_0xc3e9('0x7'));module['exports']=function(_0x4726a6,_0x302a06){return _0x4726a6[_0xc3e9('0x8')](_0xc3e9('0x9'),attributes,{'tableName':_0xc3e9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.rpc.js b/server/api/smsQueue/smsQueue.rpc.js index 5c88f38..dc0118d 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 _0x0578=['info','result','catch','GetSmsQueue','SmsQueue','options','raw','where','attributes','limit','include','model','map','then','ShowSmsQueue','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','register','request','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x27261b,_0x65ba9f){var _0xcd16f9=function(_0x418fa2){while(--_0x418fa2){_0x27261b['push'](_0x27261b['shift']());}};_0xcd16f9(++_0x65ba9f);}(_0x0578,0x7e));var _0x8057=function(_0x51ff86,_0x54da33){_0x51ff86=_0x51ff86-0x0;var _0x1abbd9=_0x0578[_0x51ff86];return _0x1abbd9;};'use strict';var _=require('lodash');var util=require(_0x8057('0x0'));var moment=require(_0x8057('0x1'));var BPromise=require(_0x8057('0x2'));var rs=require(_0x8057('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8057('0x4'))['db'];var utils=require(_0x8057('0x5'));var logger=require(_0x8057('0x6'))(_0x8057('0x7'));var config=require('../../config/environment');var jayson=require(_0x8057('0x8'));var client=jayson[_0x8057('0x9')][_0x8057('0xa')]({'port':0x232a});config[_0x8057('0xb')]=_['defaults'](config['redis'],{'host':_0x8057('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8057('0xb')]));require('./smsQueue.socket')[_0x8057('0xd')](socket);function respondWithRpcPromise(_0x38d264,_0xd4d05b,_0x4dff6f){return new BPromise(function(_0x1cf626,_0x8011eb){return client[_0x8057('0xe')](_0x38d264,_0x4dff6f)['then'](function(_0x4a0d00){logger['info'](_0x8057('0xf'),_0xd4d05b,_0x8057('0x10'));logger[_0x8057('0x11')]('SmsQueue,\x20%s,\x20%s,\x20%s',_0xd4d05b,_0x8057('0x10'),JSON[_0x8057('0x12')](_0x4a0d00));if(_0x4a0d00[_0x8057('0x13')]){if(_0x4a0d00[_0x8057('0x13')][_0x8057('0x14')]===0x1f4){logger[_0x8057('0x13')]('SmsQueue,\x20%s,\x20%s',_0xd4d05b,_0x4a0d00[_0x8057('0x13')][_0x8057('0x15')]);return _0x8011eb(_0x4a0d00[_0x8057('0x13')][_0x8057('0x15')]);}logger['error'](_0x8057('0xf'),_0xd4d05b,_0x4a0d00[_0x8057('0x13')][_0x8057('0x15')]);return _0x1cf626(_0x4a0d00['error'][_0x8057('0x15')]);}else{logger[_0x8057('0x16')](_0x8057('0xf'),_0xd4d05b,_0x8057('0x10'));_0x1cf626(_0x4a0d00[_0x8057('0x17')][_0x8057('0x15')]);}})[_0x8057('0x18')](function(_0x4e0b41){logger['error'](_0x8057('0xf'),_0xd4d05b,_0x4e0b41);_0x8011eb(_0x4e0b41);});});}exports[_0x8057('0x19')]=function(_0x2ff5c7){var _0x9b94f3=this;return new Promise(function(_0xb4b680,_0x1d9b5f){return db[_0x8057('0x1a')]['findAll']({'raw':_0x2ff5c7[_0x8057('0x1b')]?_0x2ff5c7['options'][_0x8057('0x1c')]===undefined?!![]:![]:!![],'where':_0x2ff5c7[_0x8057('0x1b')]?_0x2ff5c7['options'][_0x8057('0x1d')]||null:null,'attributes':_0x2ff5c7[_0x8057('0x1b')]?_0x2ff5c7[_0x8057('0x1b')][_0x8057('0x1e')]||null:null,'limit':_0x2ff5c7[_0x8057('0x1b')]?_0x2ff5c7[_0x8057('0x1b')][_0x8057('0x1f')]||null:null,'include':_0x2ff5c7[_0x8057('0x1b')]?_0x2ff5c7[_0x8057('0x1b')][_0x8057('0x20')]?_['map'](_0x2ff5c7[_0x8057('0x1b')][_0x8057('0x20')],function(_0x5a51cd){return{'model':db[_0x5a51cd[_0x8057('0x21')]],'as':_0x5a51cd['as'],'attributes':_0x5a51cd[_0x8057('0x1e')],'include':_0x5a51cd[_0x8057('0x20')]?_['map'](_0x5a51cd[_0x8057('0x20')],function(_0x4f9381){return{'model':db[_0x4f9381[_0x8057('0x21')]],'as':_0x4f9381['as'],'attributes':_0x4f9381[_0x8057('0x1e')],'include':_0x4f9381['include']?_[_0x8057('0x22')](_0x4f9381[_0x8057('0x20')],function(_0x4b212c){return{'model':db[_0x4b212c[_0x8057('0x21')]],'as':_0x4b212c['as'],'attributes':_0x4b212c['attributes']};}):[]};}):[]};}):[]:[]})[_0x8057('0x23')](function(_0x141c12){logger[_0x8057('0x16')](_0x8057('0x19'),_0x2ff5c7);logger[_0x8057('0x11')](_0x8057('0x19'),_0x2ff5c7,JSON[_0x8057('0x12')](_0x141c12));_0xb4b680(_0x141c12);})[_0x8057('0x18')](function(_0x285d6a){logger[_0x8057('0x13')](_0x8057('0x19'),_0x285d6a[_0x8057('0x15')],_0x2ff5c7);_0x1d9b5f(_0x9b94f3[_0x8057('0x13')](0x1f4,_0x285d6a[_0x8057('0x15')]));});});};exports[_0x8057('0x24')]=function(_0x1b9e7b){var _0x19c587=this;return new Promise(function(_0x126f3e,_0x1c8dbb){return db['SmsQueue']['find']({'raw':_0x1b9e7b[_0x8057('0x1b')]?_0x1b9e7b[_0x8057('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x1b9e7b[_0x8057('0x1b')]?_0x1b9e7b[_0x8057('0x1b')][_0x8057('0x1d')]||null:null,'attributes':_0x1b9e7b[_0x8057('0x1b')]?_0x1b9e7b['options'][_0x8057('0x1e')]||null:null,'include':_0x1b9e7b[_0x8057('0x1b')]?_0x1b9e7b[_0x8057('0x1b')][_0x8057('0x20')]?_[_0x8057('0x22')](_0x1b9e7b['options'][_0x8057('0x20')],function(_0x201800){return{'model':db[_0x201800['model']],'as':_0x201800['as'],'attributes':_0x201800[_0x8057('0x1e')],'include':_0x201800['include']?_[_0x8057('0x22')](_0x201800[_0x8057('0x20')],function(_0x30401b){return{'model':db[_0x30401b['model']],'as':_0x30401b['as'],'attributes':_0x30401b[_0x8057('0x1e')],'include':_0x30401b['include']?_[_0x8057('0x22')](_0x30401b[_0x8057('0x20')],function(_0x50eb64){return{'model':db[_0x50eb64[_0x8057('0x21')]],'as':_0x50eb64['as'],'attributes':_0x50eb64['attributes']};}):[]};}):[]};}):[]:[]})[_0x8057('0x23')](function(_0x44a13e){logger[_0x8057('0x16')]('ShowSmsQueue',_0x1b9e7b);logger[_0x8057('0x11')](_0x8057('0x24'),_0x1b9e7b,JSON[_0x8057('0x12')](_0x44a13e));_0x126f3e(_0x44a13e);})[_0x8057('0x18')](function(_0x4b31a1){logger[_0x8057('0x13')](_0x8057('0x24'),_0x4b31a1['message'],_0x1b9e7b);_0x1c8dbb(_0x19c587[_0x8057('0x13')](0x1f4,_0x4b31a1[_0x8057('0x15')]));});});}; \ No newline at end of file +var _0x186e=['jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','request','then','info','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetSmsQueue','findAll','options','where','limit','include','model','attributes','map','ShowSmsQueue','SmsQueue','find','raw','stringify','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x186e,0xca));var _0xe186=function(_0x4b9a59,_0x4a9a23){_0x4b9a59=_0x4b9a59-0x0;var _0x5c7927=_0x186e[_0x4b9a59];return _0x5c7927;};'use strict';var _=require(_0xe186('0x0'));var util=require(_0xe186('0x1'));var moment=require(_0xe186('0x2'));var BPromise=require('bluebird');var rs=require(_0xe186('0x3'));var fs=require('fs');var Redis=require(_0xe186('0x4'));var db=require(_0xe186('0x5'))['db'];var utils=require(_0xe186('0x6'));var logger=require('../../config/logger')(_0xe186('0x7'));var config=require('../../config/environment');var jayson=require(_0xe186('0x8'));var client=jayson[_0xe186('0x9')][_0xe186('0xa')]({'port':0x232a});config[_0xe186('0xb')]=_[_0xe186('0xc')](config['redis'],{'host':_0xe186('0xd'),'port':0x18eb});var socket=require(_0xe186('0xe'))(new Redis(config[_0xe186('0xb')]));require(_0xe186('0xf'))['register'](socket);function respondWithRpcPromise(_0x4eeb5b,_0x3fa371,_0x2c083){return new BPromise(function(_0x6a60eb,_0xe2f574){return client[_0xe186('0x10')](_0x4eeb5b,_0x2c083)[_0xe186('0x11')](function(_0xa6d88e){logger[_0xe186('0x12')](_0xe186('0x13'),_0x3fa371,_0xe186('0x14'));logger[_0xe186('0x15')](_0xe186('0x16'),_0x3fa371,_0xe186('0x14'),JSON['stringify'](_0xa6d88e));if(_0xa6d88e['error']){if(_0xa6d88e[_0xe186('0x17')][_0xe186('0x18')]===0x1f4){logger['error'](_0xe186('0x13'),_0x3fa371,_0xa6d88e[_0xe186('0x17')][_0xe186('0x19')]);return _0xe2f574(_0xa6d88e[_0xe186('0x17')][_0xe186('0x19')]);}logger[_0xe186('0x17')](_0xe186('0x13'),_0x3fa371,_0xa6d88e['error'][_0xe186('0x19')]);return _0x6a60eb(_0xa6d88e[_0xe186('0x17')]['message']);}else{logger[_0xe186('0x12')]('SmsQueue,\x20%s,\x20%s',_0x3fa371,_0xe186('0x14'));_0x6a60eb(_0xa6d88e[_0xe186('0x1a')][_0xe186('0x19')]);}})[_0xe186('0x1b')](function(_0x49066a){logger[_0xe186('0x17')](_0xe186('0x13'),_0x3fa371,_0x49066a);_0xe2f574(_0x49066a);});});}exports[_0xe186('0x1c')]=function(_0x58200e){var _0x1da3eb=this;return new Promise(function(_0x40a8d3,_0x21882c){return db['SmsQueue'][_0xe186('0x1d')]({'raw':_0x58200e[_0xe186('0x1e')]?_0x58200e[_0xe186('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x58200e[_0xe186('0x1e')]?_0x58200e[_0xe186('0x1e')][_0xe186('0x1f')]||null:null,'attributes':_0x58200e[_0xe186('0x1e')]?_0x58200e[_0xe186('0x1e')]['attributes']||null:null,'limit':_0x58200e[_0xe186('0x1e')]?_0x58200e[_0xe186('0x1e')][_0xe186('0x20')]||null:null,'include':_0x58200e['options']?_0x58200e[_0xe186('0x1e')][_0xe186('0x21')]?_['map'](_0x58200e[_0xe186('0x1e')][_0xe186('0x21')],function(_0x63af94){return{'model':db[_0x63af94[_0xe186('0x22')]],'as':_0x63af94['as'],'attributes':_0x63af94[_0xe186('0x23')],'include':_0x63af94[_0xe186('0x21')]?_[_0xe186('0x24')](_0x63af94['include'],function(_0x4e2ed8){return{'model':db[_0x4e2ed8[_0xe186('0x22')]],'as':_0x4e2ed8['as'],'attributes':_0x4e2ed8[_0xe186('0x23')],'include':_0x4e2ed8[_0xe186('0x21')]?_[_0xe186('0x24')](_0x4e2ed8[_0xe186('0x21')],function(_0x44de02){return{'model':db[_0x44de02[_0xe186('0x22')]],'as':_0x44de02['as'],'attributes':_0x44de02[_0xe186('0x23')]};}):[]};}):[]};}):[]:[]})[_0xe186('0x11')](function(_0x2a6582){logger[_0xe186('0x12')](_0xe186('0x1c'),_0x58200e);logger[_0xe186('0x15')](_0xe186('0x1c'),_0x58200e,JSON['stringify'](_0x2a6582));_0x40a8d3(_0x2a6582);})[_0xe186('0x1b')](function(_0x3941ef){logger[_0xe186('0x17')](_0xe186('0x1c'),_0x3941ef['message'],_0x58200e);_0x21882c(_0x1da3eb[_0xe186('0x17')](0x1f4,_0x3941ef[_0xe186('0x19')]));});});};exports[_0xe186('0x25')]=function(_0x775e1){var _0x5bec36=this;return new Promise(function(_0x5cead1,_0x46f81d){return db[_0xe186('0x26')][_0xe186('0x27')]({'raw':_0x775e1[_0xe186('0x1e')]?_0x775e1[_0xe186('0x1e')][_0xe186('0x28')]===undefined?!![]:![]:!![],'where':_0x775e1[_0xe186('0x1e')]?_0x775e1['options'][_0xe186('0x1f')]||null:null,'attributes':_0x775e1[_0xe186('0x1e')]?_0x775e1[_0xe186('0x1e')][_0xe186('0x23')]||null:null,'include':_0x775e1[_0xe186('0x1e')]?_0x775e1[_0xe186('0x1e')]['include']?_['map'](_0x775e1[_0xe186('0x1e')][_0xe186('0x21')],function(_0x259468){return{'model':db[_0x259468[_0xe186('0x22')]],'as':_0x259468['as'],'attributes':_0x259468['attributes'],'include':_0x259468[_0xe186('0x21')]?_['map'](_0x259468[_0xe186('0x21')],function(_0x3918b5){return{'model':db[_0x3918b5[_0xe186('0x22')]],'as':_0x3918b5['as'],'attributes':_0x3918b5[_0xe186('0x23')],'include':_0x3918b5[_0xe186('0x21')]?_[_0xe186('0x24')](_0x3918b5[_0xe186('0x21')],function(_0x5b04b1){return{'model':db[_0x5b04b1[_0xe186('0x22')]],'as':_0x5b04b1['as'],'attributes':_0x5b04b1[_0xe186('0x23')]};}):[]};}):[]};}):[]:[]})[_0xe186('0x11')](function(_0x1d7495){logger[_0xe186('0x12')](_0xe186('0x25'),_0x775e1);logger['debug']('ShowSmsQueue',_0x775e1,JSON[_0xe186('0x29')](_0x1d7495));_0x5cead1(_0x1d7495);})[_0xe186('0x1b')](function(_0x46bd98){logger['error'](_0xe186('0x25'),_0x46bd98[_0xe186('0x19')],_0x775e1);_0x46f81d(_0x5bec36[_0xe186('0x17')](0x1f4,_0x46bd98[_0xe186('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index 5535aeb..14bc676 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 _0x3797=['save','remove','emit','removeListener','length','smsQueue:','./smsQueue.events'];(function(_0xc447ae,_0x53d691){var _0x10c2a7=function(_0x26ccc0){while(--_0x26ccc0){_0xc447ae['push'](_0xc447ae['shift']());}};_0x10c2a7(++_0x53d691);}(_0x3797,0x1db));var _0x7379=function(_0xffbc0b,_0x2e5f2d){_0xffbc0b=_0xffbc0b-0x0;var _0x44cfe8=_0x3797[_0xffbc0b];return _0x44cfe8;};'use strict';var SmsQueueEvents=require(_0x7379('0x0'));var events=[_0x7379('0x1'),_0x7379('0x2'),'update'];function createListener(_0x37bb80,_0x3ea648){return function(_0x34bc80){_0x3ea648[_0x7379('0x3')](_0x37bb80,_0x34bc80);};}function removeListener(_0x3372c1,_0x346f96){return function(){SmsQueueEvents[_0x7379('0x4')](_0x3372c1,_0x346f96);};}exports['register']=function(_0x5a9030){for(var _0x28730f=0x0,_0x4b7092=events[_0x7379('0x5')];_0x28730f<_0x4b7092;_0x28730f++){var _0x17bd5d=events[_0x28730f];var _0x162e2f=createListener(_0x7379('0x6')+_0x17bd5d,_0x5a9030);SmsQueueEvents['on'](_0x17bd5d,_0x162e2f);}}; \ No newline at end of file +var _0xa817=['emit','removeListener','register','length','./smsQueue.events','save','remove','update'];(function(_0x1446c2,_0x3d355c){var _0x38b278=function(_0x36d38d){while(--_0x36d38d){_0x1446c2['push'](_0x1446c2['shift']());}};_0x38b278(++_0x3d355c);}(_0xa817,0xf4));var _0x7a81=function(_0xd9b1e1,_0x58c9e7){_0xd9b1e1=_0xd9b1e1-0x0;var _0xc765d9=_0xa817[_0xd9b1e1];return _0xc765d9;};'use strict';var SmsQueueEvents=require(_0x7a81('0x0'));var events=[_0x7a81('0x1'),_0x7a81('0x2'),_0x7a81('0x3')];function createListener(_0x8a502f,_0x21980e){return function(_0x20203b){_0x21980e[_0x7a81('0x4')](_0x8a502f,_0x20203b);};}function removeListener(_0x27cbf0,_0x4be924){return function(){SmsQueueEvents[_0x7a81('0x5')](_0x27cbf0,_0x4be924);};}exports[_0x7a81('0x6')]=function(_0x5d92af){for(var _0x52e605=0x0,_0x4be2fa=events[_0x7a81('0x7')];_0x52e605<_0x4be2fa;_0x52e605++){var _0x40319b=events[_0x52e605];var _0x3b2751=createListener('smsQueue:'+_0x40319b,_0x5d92af);SmsQueueEvents['on'](_0x40319b,_0x3b2751);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index 879197c..b65f0c6 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 _0x8d7d=['put','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','isAuthenticated','get','/:id','show'];(function(_0x379226,_0x40d8b1){var _0x414963=function(_0x5541c2){while(--_0x5541c2){_0x379226['push'](_0x379226['shift']());}};_0x414963(++_0x40d8b1);}(_0x8d7d,0xae));var _0xd8d7=function(_0x30e11f,_0x2eb0ce){_0x30e11f=_0x30e11f-0x0;var _0x89f857=_0x8d7d[_0x30e11f];return _0x89f857;};'use strict';var multer=require('multer');var util=require(_0xd8d7('0x0'));var path=require(_0xd8d7('0x1'));var timeout=require(_0xd8d7('0x2'));var express=require('express');var router=express[_0xd8d7('0x3')]();var fs_extra=require(_0xd8d7('0x4'));var auth=require(_0xd8d7('0x5'));var interaction=require(_0xd8d7('0x6'));var config=require(_0xd8d7('0x7'));var controller=require(_0xd8d7('0x8'));router['get']('/',auth[_0xd8d7('0x9')](),controller['index']);router[_0xd8d7('0xa')]('/describe',auth[_0xd8d7('0x9')](),controller['describe']);router[_0xd8d7('0xa')](_0xd8d7('0xb'),auth[_0xd8d7('0x9')](),controller[_0xd8d7('0xc')]);router['post']('/',auth[_0xd8d7('0x9')](),controller['create']);router[_0xd8d7('0xd')](_0xd8d7('0xb'),auth['isAuthenticated'](),controller['update']);router[_0xd8d7('0xe')]('/:id',auth[_0xd8d7('0x9')](),controller[_0xd8d7('0xf')]);module[_0xd8d7('0x10')]=router; \ No newline at end of file +var _0x8d59=['post','create','put','update','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./smsQueueReport.controller','isAuthenticated','index','get','/describe','describe','/:id'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x8d59,0xb9));var _0x98d5=function(_0x5281fb,_0x51d61a){_0x5281fb=_0x5281fb-0x0;var _0x2be1aa=_0x8d59[_0x5281fb];return _0x2be1aa;};'use strict';var multer=require(_0x98d5('0x0'));var util=require(_0x98d5('0x1'));var path=require(_0x98d5('0x2'));var timeout=require(_0x98d5('0x3'));var express=require(_0x98d5('0x4'));var router=express['Router']();var fs_extra=require(_0x98d5('0x5'));var auth=require(_0x98d5('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x98d5('0x7'));var controller=require(_0x98d5('0x8'));router['get']('/',auth[_0x98d5('0x9')](),controller[_0x98d5('0xa')]);router[_0x98d5('0xb')](_0x98d5('0xc'),auth[_0x98d5('0x9')](),controller[_0x98d5('0xd')]);router[_0x98d5('0xb')](_0x98d5('0xe'),auth[_0x98d5('0x9')](),controller['show']);router[_0x98d5('0xf')]('/',auth['isAuthenticated'](),controller[_0x98d5('0x10')]);router[_0x98d5('0x11')](_0x98d5('0xe'),auth[_0x98d5('0x9')](),controller[_0x98d5('0x12')]);router['delete'](_0x98d5('0xe'),auth[_0x98d5('0x9')](),controller[_0x98d5('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 0669888..27fce9c 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 _0xa234=['exports','STRING','DATE','moment','sequelize'];(function(_0x2453fa,_0x147254){var _0x4bc8d8=function(_0x294049){while(--_0x294049){_0x2453fa['push'](_0x2453fa['shift']());}};_0x4bc8d8(++_0x147254);}(_0xa234,0x99));var _0x4a23=function(_0x3ae2a3,_0x32f4e7){_0x3ae2a3=_0x3ae2a3-0x0;var _0x253a71=_0xa234[_0x3ae2a3];return _0x253a71;};'use strict';var moment=require(_0x4a23('0x0'));var Sequelize=require(_0x4a23('0x1'));module[_0x4a23('0x2')]={'uniqueid':{'type':Sequelize[_0x4a23('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x4a23('0x3')]},'joinAt':{'type':Sequelize[_0x4a23('0x4')]},'leaveAt':{'type':Sequelize[_0x4a23('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xb673=['DATE','moment','sequelize','STRING'];(function(_0x44cb68,_0x3ca3f2){var _0x4a42c2=function(_0x45c49d){while(--_0x45c49d){_0x44cb68['push'](_0x44cb68['shift']());}};_0x4a42c2(++_0x3ca3f2);}(_0xb673,0xa5));var _0x3b67=function(_0x2b083f,_0xaf1d7e){_0x2b083f=_0x2b083f-0x0;var _0x821aa9=_0xb673[_0x2b083f];return _0x821aa9;};'use strict';var moment=require(_0x3b67('0x0'));var Sequelize=require(_0x3b67('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x3b67('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x3b67('0x2')]},'joinAt':{'type':Sequelize[_0x3b67('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x3b67('0x3')]},'exitAt':{'type':Sequelize[_0x3b67('0x3')]},'reason':{'type':Sequelize[_0x3b67('0x2')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index 361bb6c..b9b2622 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 _0xe9cb=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','Content-Range','apply','reject','save','update','destroy','stack','index','SmsQueueReport','rawAttributes','type','model','name','query','keys','filters','fields','attributes','length','order','sort','where','pick','merge','map','VIRTUAL','options','then','includeAll','include','rows','catch','show','params','intersection','create','body','find','describe','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware'];(function(_0x553877,_0x237b00){var _0x2b0660=function(_0x46fd19){while(--_0x46fd19){_0x553877['push'](_0x553877['shift']());}};_0x2b0660(++_0x237b00);}(_0xe9cb,0x197));var _0xbe9c=function(_0x389722,_0x2cb8ac){_0x389722=_0x389722-0x0;var _0x2c41f5=_0xe9cb[_0x389722];return _0x2c41f5;};'use strict';var emlformat=require(_0xbe9c('0x0'));var rimraf=require(_0xbe9c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbe9c('0x2'));var rp=require(_0xbe9c('0x3'));var moment=require('moment');var BPromise=require(_0xbe9c('0x4'));var Mustache=require(_0xbe9c('0x5'));var util=require(_0xbe9c('0x6'));var path=require('path');var sox=require(_0xbe9c('0x7'));var csv=require(_0xbe9c('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbe9c('0x9'));var squel=require(_0xbe9c('0xa'));var crypto=require(_0xbe9c('0xb'));var jsforce=require(_0xbe9c('0xc'));var deskjs=require(_0xbe9c('0xd'));var toCsv=require(_0xbe9c('0x8'));var querystring=require('querystring');var Papa=require(_0xbe9c('0xe'));var Redis=require(_0xbe9c('0xf'));var authService=require(_0xbe9c('0x10'));var qs=require(_0xbe9c('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbe9c('0x12'));var logger=require(_0xbe9c('0x13'))(_0xbe9c('0x14'));var utils=require(_0xbe9c('0x15'));var config=require(_0xbe9c('0x16'));var licenseUtil=require(_0xbe9c('0x17'));var db=require(_0xbe9c('0x18'))['db'];function respondWithStatusCode(_0x2e9266,_0x43d45f){_0x43d45f=_0x43d45f||0xcc;return function(_0x5f0da6){if(_0x5f0da6){return _0x2e9266[_0xbe9c('0x19')](_0x43d45f);}return _0x2e9266[_0xbe9c('0x1a')](_0x43d45f)[_0xbe9c('0x1b')]();};}function respondWithResult(_0x418f40,_0x4e5bb7){_0x4e5bb7=_0x4e5bb7||0xc8;return function(_0x134f55){if(_0x134f55){return _0x418f40['status'](_0x4e5bb7)[_0xbe9c('0x1c')](_0x134f55);}};}function respondWithFilteredResult(_0x4935b8,_0x22e2fd){return function(_0x5d75fb){if(_0x5d75fb){var _0xa7783b=typeof _0x22e2fd[_0xbe9c('0x1d')]==='undefined'&&typeof _0x22e2fd[_0xbe9c('0x1e')]==='undefined';var _0x52e088=_0x5d75fb[_0xbe9c('0x1f')];var _0x4c5f22=_0xa7783b?0x0:_0x22e2fd[_0xbe9c('0x1d')];var _0x5c1bca=_0xa7783b?_0x5d75fb[_0xbe9c('0x1f')]:_0x22e2fd['offset']+_0x22e2fd[_0xbe9c('0x1e')];var _0x494ac3;if(_0x5c1bca>=_0x52e088){_0x5c1bca=_0x52e088;_0x494ac3=0xc8;}else{_0x494ac3=0xce;}_0x4935b8['status'](_0x494ac3);return _0x4935b8['set'](_0xbe9c('0x20'),_0x4c5f22+'-'+_0x5c1bca+'/'+_0x52e088)['json'](_0x5d75fb);}return null;};}function patchUpdates(_0x418c54){return function(_0x194118){try{jsonpatch[_0xbe9c('0x21')](_0x194118,_0x418c54,!![]);}catch(_0xa6add9){return BPromise[_0xbe9c('0x22')](_0xa6add9);}return _0x194118[_0xbe9c('0x23')]();};}function saveUpdates(_0x3238ee,_0x1040b7){return function(_0x4a409d){if(_0x4a409d){return _0x4a409d[_0xbe9c('0x24')](_0x3238ee)['then'](function(_0x10092e){return _0x10092e;});}return null;};}function removeEntity(_0x5dee22,_0x19cd20){return function(_0x563135){if(_0x563135){return _0x563135[_0xbe9c('0x25')]()['then'](function(){_0x5dee22[_0xbe9c('0x1a')](0xcc)[_0xbe9c('0x1b')]();});}};}function handleEntityNotFound(_0x1a1312,_0x98e00a){return function(_0x338192){if(!_0x338192){_0x1a1312[_0xbe9c('0x19')](0x194);}return _0x338192;};}function handleError(_0x22d7ce,_0x27d4fb){_0x27d4fb=_0x27d4fb||0x1f4;return function(_0x2e774a){logger['error'](_0x2e774a[_0xbe9c('0x26')]);if(_0x2e774a['name']){delete _0x2e774a['name'];}_0x22d7ce['status'](_0x27d4fb)['send'](_0x2e774a);};}exports[_0xbe9c('0x27')]=function(_0x3301b3,_0x53be89){var _0xb4147c={},_0x294fdf={},_0x39e5c8={'count':0x0,'rows':[]};var _0x3b9dff=_['map'](db[_0xbe9c('0x28')][_0xbe9c('0x29')],function(_0x39b522){return{'name':_0x39b522['fieldName'],'type':_0x39b522[_0xbe9c('0x2a')]['key']};});_0x294fdf[_0xbe9c('0x2b')]=_['map'](_0x3b9dff,_0xbe9c('0x2c'));_0x294fdf[_0xbe9c('0x2d')]=_[_0xbe9c('0x2e')](_0x3301b3[_0xbe9c('0x2d')]);_0x294fdf[_0xbe9c('0x2f')]=_['intersection'](_0x294fdf['model'],_0x294fdf['query']);_0xb4147c['attributes']=_['intersection'](_0x294fdf[_0xbe9c('0x2b')],qs[_0xbe9c('0x30')](_0x3301b3['query'][_0xbe9c('0x30')]));_0xb4147c['attributes']=_0xb4147c[_0xbe9c('0x31')][_0xbe9c('0x32')]?_0xb4147c[_0xbe9c('0x31')]:_0x294fdf[_0xbe9c('0x2b')];if(!_0x3301b3[_0xbe9c('0x2d')]['hasOwnProperty']('nolimit')){_0xb4147c[_0xbe9c('0x1e')]=qs[_0xbe9c('0x1e')](_0x3301b3[_0xbe9c('0x2d')]['limit']);_0xb4147c[_0xbe9c('0x1d')]=qs[_0xbe9c('0x1d')](_0x3301b3[_0xbe9c('0x2d')][_0xbe9c('0x1d')]);}_0xb4147c[_0xbe9c('0x33')]=qs['sort'](_0x3301b3[_0xbe9c('0x2d')][_0xbe9c('0x34')]);_0xb4147c[_0xbe9c('0x35')]=qs[_0xbe9c('0x2f')](_[_0xbe9c('0x36')](_0x3301b3[_0xbe9c('0x2d')],_0x294fdf[_0xbe9c('0x2f')]),_0x3b9dff);if(_0x3301b3[_0xbe9c('0x2d')]['filter']){_0xb4147c[_0xbe9c('0x35')]=_[_0xbe9c('0x37')](_0xb4147c[_0xbe9c('0x35')],{'$or':_[_0xbe9c('0x38')](_0x3b9dff,function(_0x14782d){if(_0x14782d[_0xbe9c('0x2a')]!==_0xbe9c('0x39')){var _0x38bd9c={};_0x38bd9c[_0x14782d[_0xbe9c('0x2c')]]={'$like':'%'+_0x3301b3[_0xbe9c('0x2d')]['filter']+'%'};return _0x38bd9c;}})});}_0xb4147c=_[_0xbe9c('0x37')]({},_0xb4147c,_0x3301b3[_0xbe9c('0x3a')]);var _0x2875c7={'where':_0xb4147c[_0xbe9c('0x35')]};return db['SmsQueueReport'][_0xbe9c('0x1f')](_0x2875c7)[_0xbe9c('0x3b')](function(_0x1e6fbb){_0x39e5c8[_0xbe9c('0x1f')]=_0x1e6fbb;if(_0x3301b3[_0xbe9c('0x2d')][_0xbe9c('0x3c')]){_0xb4147c[_0xbe9c('0x3d')]=[{'all':!![]}];}return db[_0xbe9c('0x28')]['findAll'](_0xb4147c);})[_0xbe9c('0x3b')](function(_0xf48043){_0x39e5c8[_0xbe9c('0x3e')]=_0xf48043;return _0x39e5c8;})[_0xbe9c('0x3b')](respondWithFilteredResult(_0x53be89,_0xb4147c))[_0xbe9c('0x3f')](handleError(_0x53be89,null));};exports[_0xbe9c('0x40')]=function(_0x19ff70,_0x92bafc){var _0xe47e87={'raw':!![],'where':{'id':_0x19ff70[_0xbe9c('0x41')]['id']}},_0x565d4c={};_0x565d4c[_0xbe9c('0x2b')]=_['keys'](db[_0xbe9c('0x28')][_0xbe9c('0x29')]);_0x565d4c['query']=_[_0xbe9c('0x2e')](_0x19ff70['query']);_0x565d4c[_0xbe9c('0x2f')]=_[_0xbe9c('0x42')](_0x565d4c[_0xbe9c('0x2b')],_0x565d4c['query']);_0xe47e87[_0xbe9c('0x31')]=_[_0xbe9c('0x42')](_0x565d4c[_0xbe9c('0x2b')],qs[_0xbe9c('0x30')](_0x19ff70[_0xbe9c('0x2d')][_0xbe9c('0x30')]));_0xe47e87[_0xbe9c('0x31')]=_0xe47e87[_0xbe9c('0x31')][_0xbe9c('0x32')]?_0xe47e87[_0xbe9c('0x31')]:_0x565d4c[_0xbe9c('0x2b')];if(_0x19ff70[_0xbe9c('0x2d')][_0xbe9c('0x3c')]){_0xe47e87[_0xbe9c('0x3d')]=[{'all':!![]}];}_0xe47e87=_['merge']({},_0xe47e87,_0x19ff70['options']);return db[_0xbe9c('0x28')]['find'](_0xe47e87)['then'](handleEntityNotFound(_0x92bafc,null))['then'](respondWithResult(_0x92bafc,null))[_0xbe9c('0x3f')](handleError(_0x92bafc,null));};exports[_0xbe9c('0x43')]=function(_0x350a53,_0x5c1381){return db[_0xbe9c('0x28')][_0xbe9c('0x43')](_0x350a53[_0xbe9c('0x44')],{})[_0xbe9c('0x3b')](respondWithResult(_0x5c1381,0xc9))[_0xbe9c('0x3f')](handleError(_0x5c1381,null));};exports[_0xbe9c('0x24')]=function(_0x4a6d3d,_0x113c78){if(_0x4a6d3d['body']['id']){delete _0x4a6d3d['body']['id'];}return db[_0xbe9c('0x28')][_0xbe9c('0x45')]({'where':{'id':_0x4a6d3d[_0xbe9c('0x41')]['id']}})[_0xbe9c('0x3b')](handleEntityNotFound(_0x113c78,null))[_0xbe9c('0x3b')](saveUpdates(_0x4a6d3d[_0xbe9c('0x44')],null))[_0xbe9c('0x3b')](respondWithResult(_0x113c78,null))['catch'](handleError(_0x113c78,null));};exports[_0xbe9c('0x25')]=function(_0xbdddc6,_0x48eed0){return db[_0xbe9c('0x28')][_0xbe9c('0x45')]({'where':{'id':_0xbdddc6[_0xbe9c('0x41')]['id']}})[_0xbe9c('0x3b')](handleEntityNotFound(_0x48eed0,null))[_0xbe9c('0x3b')](removeEntity(_0x48eed0,null))[_0xbe9c('0x3f')](handleError(_0x48eed0,null));};exports[_0xbe9c('0x46')]=function(_0x415972,_0x3d0965){return db[_0xbe9c('0x28')][_0xbe9c('0x46')]()['then'](respondWithResult(_0x3d0965,null))[_0xbe9c('0x3f')](handleError(_0x3d0965,null));}; \ No newline at end of file +var _0xe408=['update','error','stack','name','index','key','map','query','keys','filters','attributes','intersection','model','fields','length','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','SmsQueueReport','then','include','rows','catch','show','params','includeAll','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save'];(function(_0x3b72cb,_0x112f26){var _0x202da6=function(_0x9b6ba2){while(--_0x9b6ba2){_0x3b72cb['push'](_0x3b72cb['shift']());}};_0x202da6(++_0x112f26);}(_0xe408,0x69));var _0x8e40=function(_0x3718b7,_0x2da677){_0x3718b7=_0x3718b7-0x0;var _0xf8c91e=_0xe408[_0x3718b7];return _0xf8c91e;};'use strict';var emlformat=require(_0x8e40('0x0'));var rimraf=require(_0x8e40('0x1'));var zipdir=require(_0x8e40('0x2'));var jsonpatch=require(_0x8e40('0x3'));var rp=require(_0x8e40('0x4'));var moment=require(_0x8e40('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x8e40('0x6'));var path=require(_0x8e40('0x7'));var sox=require(_0x8e40('0x8'));var csv=require(_0x8e40('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8e40('0xa'));var _=require(_0x8e40('0xb'));var squel=require('squel');var crypto=require(_0x8e40('0xc'));var jsforce=require(_0x8e40('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x8e40('0x9'));var querystring=require(_0x8e40('0xe'));var Papa=require(_0x8e40('0xf'));var Redis=require(_0x8e40('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8e40('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x8e40('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x8e40('0x13'));var db=require(_0x8e40('0x14'))['db'];function respondWithStatusCode(_0x58c4f8,_0x2657dd){_0x2657dd=_0x2657dd||0xcc;return function(_0x7b0c99){if(_0x7b0c99){return _0x58c4f8[_0x8e40('0x15')](_0x2657dd);}return _0x58c4f8[_0x8e40('0x16')](_0x2657dd)[_0x8e40('0x17')]();};}function respondWithResult(_0x335486,_0x4a6038){_0x4a6038=_0x4a6038||0xc8;return function(_0x5069f3){if(_0x5069f3){return _0x335486[_0x8e40('0x16')](_0x4a6038)['json'](_0x5069f3);}};}function respondWithFilteredResult(_0x167a06,_0x46756b){return function(_0x1df521){if(_0x1df521){var _0x439506=typeof _0x46756b[_0x8e40('0x18')]===_0x8e40('0x19')&&typeof _0x46756b[_0x8e40('0x1a')]===_0x8e40('0x19');var _0x2a6270=_0x1df521[_0x8e40('0x1b')];var _0x4eb09b=_0x439506?0x0:_0x46756b[_0x8e40('0x18')];var _0x45f15b=_0x439506?_0x1df521['count']:_0x46756b[_0x8e40('0x18')]+_0x46756b[_0x8e40('0x1a')];var _0x4d7f30;if(_0x45f15b>=_0x2a6270){_0x45f15b=_0x2a6270;_0x4d7f30=0xc8;}else{_0x4d7f30=0xce;}_0x167a06[_0x8e40('0x16')](_0x4d7f30);return _0x167a06[_0x8e40('0x1c')](_0x8e40('0x1d'),_0x4eb09b+'-'+_0x45f15b+'/'+_0x2a6270)[_0x8e40('0x1e')](_0x1df521);}return null;};}function patchUpdates(_0xe5ff2a){return function(_0x30dfbe){try{jsonpatch['apply'](_0x30dfbe,_0xe5ff2a,!![]);}catch(_0x14ed55){return BPromise[_0x8e40('0x1f')](_0x14ed55);}return _0x30dfbe[_0x8e40('0x20')]();};}function saveUpdates(_0x3edc87,_0x3ec0ee){return function(_0x1dbc18){if(_0x1dbc18){return _0x1dbc18[_0x8e40('0x21')](_0x3edc87)['then'](function(_0x14696b){return _0x14696b;});}return null;};}function removeEntity(_0xb896f1,_0x5a5215){return function(_0x2e8f60){if(_0x2e8f60){return _0x2e8f60['destroy']()['then'](function(){_0xb896f1[_0x8e40('0x16')](0xcc)[_0x8e40('0x17')]();});}};}function handleEntityNotFound(_0x3b992b,_0x32d222){return function(_0x5b2b48){if(!_0x5b2b48){_0x3b992b[_0x8e40('0x15')](0x194);}return _0x5b2b48;};}function handleError(_0x290baa,_0x451951){_0x451951=_0x451951||0x1f4;return function(_0x5efe04){logger[_0x8e40('0x22')](_0x5efe04[_0x8e40('0x23')]);if(_0x5efe04[_0x8e40('0x24')]){delete _0x5efe04[_0x8e40('0x24')];}_0x290baa[_0x8e40('0x16')](_0x451951)['send'](_0x5efe04);};}exports[_0x8e40('0x25')]=function(_0x532c7e,_0x2c5a97){var _0x67be10={},_0x3fb6fe={},_0x2837e3={'count':0x0,'rows':[]};var _0x38b1d1=_['map'](db['SmsQueueReport']['rawAttributes'],function(_0x11405b){return{'name':_0x11405b['fieldName'],'type':_0x11405b['type'][_0x8e40('0x26')]};});_0x3fb6fe['model']=_[_0x8e40('0x27')](_0x38b1d1,_0x8e40('0x24'));_0x3fb6fe[_0x8e40('0x28')]=_[_0x8e40('0x29')](_0x532c7e[_0x8e40('0x28')]);_0x3fb6fe[_0x8e40('0x2a')]=_['intersection'](_0x3fb6fe['model'],_0x3fb6fe[_0x8e40('0x28')]);_0x67be10[_0x8e40('0x2b')]=_[_0x8e40('0x2c')](_0x3fb6fe[_0x8e40('0x2d')],qs[_0x8e40('0x2e')](_0x532c7e[_0x8e40('0x28')][_0x8e40('0x2e')]));_0x67be10['attributes']=_0x67be10[_0x8e40('0x2b')][_0x8e40('0x2f')]?_0x67be10[_0x8e40('0x2b')]:_0x3fb6fe[_0x8e40('0x2d')];if(!_0x532c7e['query']['hasOwnProperty'](_0x8e40('0x30'))){_0x67be10['limit']=qs[_0x8e40('0x1a')](_0x532c7e[_0x8e40('0x28')][_0x8e40('0x1a')]);_0x67be10[_0x8e40('0x18')]=qs['offset'](_0x532c7e[_0x8e40('0x28')][_0x8e40('0x18')]);}_0x67be10[_0x8e40('0x31')]=qs['sort'](_0x532c7e[_0x8e40('0x28')][_0x8e40('0x32')]);_0x67be10[_0x8e40('0x33')]=qs[_0x8e40('0x2a')](_['pick'](_0x532c7e[_0x8e40('0x28')],_0x3fb6fe['filters']),_0x38b1d1);if(_0x532c7e[_0x8e40('0x28')][_0x8e40('0x34')]){_0x67be10[_0x8e40('0x33')]=_[_0x8e40('0x35')](_0x67be10[_0x8e40('0x33')],{'$or':_[_0x8e40('0x27')](_0x38b1d1,function(_0x49504a){if(_0x49504a[_0x8e40('0x36')]!==_0x8e40('0x37')){var _0x57f278={};_0x57f278[_0x49504a[_0x8e40('0x24')]]={'$like':'%'+_0x532c7e['query']['filter']+'%'};return _0x57f278;}})});}_0x67be10=_[_0x8e40('0x35')]({},_0x67be10,_0x532c7e[_0x8e40('0x38')]);var _0x23800d={'where':_0x67be10[_0x8e40('0x33')]};return db[_0x8e40('0x39')][_0x8e40('0x1b')](_0x23800d)[_0x8e40('0x3a')](function(_0x4b5865){_0x2837e3[_0x8e40('0x1b')]=_0x4b5865;if(_0x532c7e['query']['includeAll']){_0x67be10[_0x8e40('0x3b')]=[{'all':!![]}];}return db['SmsQueueReport']['findAll'](_0x67be10);})[_0x8e40('0x3a')](function(_0x203fd1){_0x2837e3[_0x8e40('0x3c')]=_0x203fd1;return _0x2837e3;})['then'](respondWithFilteredResult(_0x2c5a97,_0x67be10))[_0x8e40('0x3d')](handleError(_0x2c5a97,null));};exports[_0x8e40('0x3e')]=function(_0x3bea6a,_0x299af7){var _0x26510f={'raw':!![],'where':{'id':_0x3bea6a[_0x8e40('0x3f')]['id']}},_0x3b118a={};_0x3b118a[_0x8e40('0x2d')]=_['keys'](db[_0x8e40('0x39')]['rawAttributes']);_0x3b118a['query']=_[_0x8e40('0x29')](_0x3bea6a[_0x8e40('0x28')]);_0x3b118a[_0x8e40('0x2a')]=_[_0x8e40('0x2c')](_0x3b118a['model'],_0x3b118a[_0x8e40('0x28')]);_0x26510f[_0x8e40('0x2b')]=_[_0x8e40('0x2c')](_0x3b118a['model'],qs[_0x8e40('0x2e')](_0x3bea6a[_0x8e40('0x28')][_0x8e40('0x2e')]));_0x26510f['attributes']=_0x26510f[_0x8e40('0x2b')]['length']?_0x26510f[_0x8e40('0x2b')]:_0x3b118a[_0x8e40('0x2d')];if(_0x3bea6a[_0x8e40('0x28')][_0x8e40('0x40')]){_0x26510f[_0x8e40('0x3b')]=[{'all':!![]}];}_0x26510f=_[_0x8e40('0x35')]({},_0x26510f,_0x3bea6a['options']);return db[_0x8e40('0x39')][_0x8e40('0x41')](_0x26510f)[_0x8e40('0x3a')](handleEntityNotFound(_0x299af7,null))['then'](respondWithResult(_0x299af7,null))[_0x8e40('0x3d')](handleError(_0x299af7,null));};exports[_0x8e40('0x42')]=function(_0x57c8f8,_0x555a76){return db[_0x8e40('0x39')]['create'](_0x57c8f8[_0x8e40('0x43')],{})['then'](respondWithResult(_0x555a76,0xc9))['catch'](handleError(_0x555a76,null));};exports['update']=function(_0x3e018f,_0x4a8928){if(_0x3e018f[_0x8e40('0x43')]['id']){delete _0x3e018f[_0x8e40('0x43')]['id'];}return db[_0x8e40('0x39')][_0x8e40('0x41')]({'where':{'id':_0x3e018f[_0x8e40('0x3f')]['id']}})['then'](handleEntityNotFound(_0x4a8928,null))[_0x8e40('0x3a')](saveUpdates(_0x3e018f[_0x8e40('0x43')],null))[_0x8e40('0x3a')](respondWithResult(_0x4a8928,null))[_0x8e40('0x3d')](handleError(_0x4a8928,null));};exports[_0x8e40('0x44')]=function(_0x494efd,_0x3e557e){return db['SmsQueueReport'][_0x8e40('0x41')]({'where':{'id':_0x494efd['params']['id']}})[_0x8e40('0x3a')](handleEntityNotFound(_0x3e557e,null))[_0x8e40('0x3a')](removeEntity(_0x3e557e,null))[_0x8e40('0x3d')](handleError(_0x3e557e,null));};exports['describe']=function(_0x40ce6f,_0x20e9d3){return db[_0x8e40('0x39')]['describe']()[_0x8e40('0x3a')](respondWithResult(_0x20e9d3,null))[_0x8e40('0x3d')](handleError(_0x20e9d3,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index 1867c2d..29d564f 100644 --- a/server/api/smsQueueReport/smsQueueReport.model.js +++ b/server/api/smsQueueReport/smsQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['define','SmsQueueReport','uniqueid','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./smsQueueReport.attributes','exports'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0xa9e0[_0x3c2a69];return _0x596bc8;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'report_sms_queue','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0a9e('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa9e0=['define','SmsQueueReport','uniqueid','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./smsQueueReport.attributes','exports'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0xa9e0[_0x3e112d];return _0x531c31;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'report_sms_queue','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0a9e('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index 72cab8f..eb614d7 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 _0x8395=['client','request','then','info','request\x20sent','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsQueueReport,\x20%s,\x20%s','message','SmsQueueReport','create','body','options','raw','CreateSmsQueueReport','debug','catch','attributes','limit','UpdateSmsQueueReport','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x8395,0x160));var _0x5839=function(_0x11ca63,_0xea9f9c){_0x11ca63=_0x11ca63-0x0;var _0x41f1f6=_0x8395[_0x11ca63];return _0x41f1f6;};'use strict';var _=require(_0x5839('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x5839('0x1'));var rs=require(_0x5839('0x2'));var fs=require('fs');var Redis=require(_0x5839('0x3'));var db=require(_0x5839('0x4'))['db'];var utils=require(_0x5839('0x5'));var logger=require(_0x5839('0x6'))('rpc');var config=require(_0x5839('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5839('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3f4966,_0x36636f,_0x3fc3b8){return new BPromise(function(_0x266f54,_0x4e145e){return client[_0x5839('0x9')](_0x3f4966,_0x3fc3b8)[_0x5839('0xa')](function(_0x14192f){logger[_0x5839('0xb')]('SmsQueueReport,\x20%s,\x20%s',_0x36636f,_0x5839('0xc'));logger['debug'](_0x5839('0xd'),_0x36636f,_0x5839('0xc'),JSON[_0x5839('0xe')](_0x14192f));if(_0x14192f['error']){if(_0x14192f[_0x5839('0xf')][_0x5839('0x10')]===0x1f4){logger[_0x5839('0xf')](_0x5839('0x11'),_0x36636f,_0x14192f[_0x5839('0xf')][_0x5839('0x12')]);return _0x4e145e(_0x14192f[_0x5839('0xf')][_0x5839('0x12')]);}logger[_0x5839('0xf')](_0x5839('0x11'),_0x36636f,_0x14192f[_0x5839('0xf')]['message']);return _0x266f54(_0x14192f[_0x5839('0xf')][_0x5839('0x12')]);}else{logger['info'](_0x5839('0x11'),_0x36636f,_0x5839('0xc'));_0x266f54(_0x14192f['result'][_0x5839('0x12')]);}})['catch'](function(_0x4316df){logger[_0x5839('0xf')](_0x5839('0x11'),_0x36636f,_0x4316df);_0x4e145e(_0x4316df);});});}exports['CreateSmsQueueReport']=function(_0x472c56){var _0x2627ba=this;return new Promise(function(_0x17972a,_0x36227a){return db[_0x5839('0x13')][_0x5839('0x14')](_0x472c56[_0x5839('0x15')],{'raw':_0x472c56[_0x5839('0x16')]?_0x472c56[_0x5839('0x16')][_0x5839('0x17')]===undefined?!![]:![]:!![]})[_0x5839('0xa')](function(_0x2da529){logger[_0x5839('0xb')](_0x5839('0x18'),_0x472c56);logger[_0x5839('0x19')](_0x5839('0x18'),_0x472c56,JSON[_0x5839('0xe')](_0x2da529));_0x17972a(_0x2da529);})[_0x5839('0x1a')](function(_0x289332){logger[_0x5839('0xf')](_0x5839('0x18'),_0x289332['message'],_0x472c56);_0x36227a(_0x2627ba['error'](0x1f4,_0x289332['message']));});});};exports['UpdateSmsQueueReport']=function(_0x2616a0){var _0x3e7afb=this;return new Promise(function(_0x45123d,_0x48864e){return db[_0x5839('0x13')]['update'](_0x2616a0[_0x5839('0x15')],{'raw':_0x2616a0[_0x5839('0x16')]?_0x2616a0[_0x5839('0x16')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2616a0[_0x5839('0x16')]?_0x2616a0[_0x5839('0x16')]['where']||null:null,'attributes':_0x2616a0[_0x5839('0x16')]?_0x2616a0['options'][_0x5839('0x1b')]||null:null,'limit':_0x2616a0['options']?_0x2616a0[_0x5839('0x16')][_0x5839('0x1c')]||null:null})[_0x5839('0xa')](function(_0x2b3e95){logger['info'](_0x5839('0x1d'),_0x2616a0);logger['debug'](_0x5839('0x1d'),_0x2616a0,JSON[_0x5839('0xe')](_0x2b3e95));_0x45123d(_0x2b3e95);})['catch'](function(_0x5dce0d){logger[_0x5839('0xf')](_0x5839('0x1d'),_0x5dce0d['message'],_0x2616a0);_0x48864e(_0x3e7afb[_0x5839('0xf')](0x1f4,_0x5dce0d[_0x5839('0x12')]));});});}; \ No newline at end of file +var _0x7999=['SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','code','error','message','info','result','catch','CreateSmsQueueReport','SmsQueueReport','body','options','stringify','UpdateSmsQueueReport','raw','where','attributes','limit','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then'];(function(_0x6663b0,_0x31ce17){var _0x5e61ac=function(_0x58db77){while(--_0x58db77){_0x6663b0['push'](_0x6663b0['shift']());}};_0x5e61ac(++_0x31ce17);}(_0x7999,0x17f));var _0x9799=function(_0x272fa4,_0xf712d1){_0x272fa4=_0x272fa4-0x0;var _0x25ec85=_0x7999[_0x272fa4];return _0x25ec85;};'use strict';var _=require(_0x9799('0x0'));var util=require('util');var moment=require(_0x9799('0x1'));var BPromise=require(_0x9799('0x2'));var rs=require(_0x9799('0x3'));var fs=require('fs');var Redis=require(_0x9799('0x4'));var db=require(_0x9799('0x5'))['db'];var utils=require(_0x9799('0x6'));var logger=require(_0x9799('0x7'))('rpc');var config=require(_0x9799('0x8'));var jayson=require(_0x9799('0x9'));var client=jayson['client'][_0x9799('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x213e0e,_0x25f9da,_0x190bd1){return new BPromise(function(_0x17d7a1,_0x22a748){return client[_0x9799('0xb')](_0x213e0e,_0x190bd1)[_0x9799('0xc')](function(_0x50e035){logger['info'](_0x9799('0xd'),_0x25f9da,_0x9799('0xe'));logger[_0x9799('0xf')](_0x9799('0x10'),_0x25f9da,_0x9799('0xe'),JSON['stringify'](_0x50e035));if(_0x50e035['error']){if(_0x50e035['error'][_0x9799('0x11')]===0x1f4){logger[_0x9799('0x12')](_0x9799('0xd'),_0x25f9da,_0x50e035[_0x9799('0x12')][_0x9799('0x13')]);return _0x22a748(_0x50e035['error'][_0x9799('0x13')]);}logger[_0x9799('0x12')](_0x9799('0xd'),_0x25f9da,_0x50e035[_0x9799('0x12')][_0x9799('0x13')]);return _0x17d7a1(_0x50e035['error'][_0x9799('0x13')]);}else{logger[_0x9799('0x14')](_0x9799('0xd'),_0x25f9da,_0x9799('0xe'));_0x17d7a1(_0x50e035[_0x9799('0x15')][_0x9799('0x13')]);}})[_0x9799('0x16')](function(_0x88bdaa){logger[_0x9799('0x12')]('SmsQueueReport,\x20%s,\x20%s',_0x25f9da,_0x88bdaa);_0x22a748(_0x88bdaa);});});}exports[_0x9799('0x17')]=function(_0x16ddfe){var _0x419817=this;return new Promise(function(_0x3d61e4,_0x3ce48e){return db[_0x9799('0x18')]['create'](_0x16ddfe[_0x9799('0x19')],{'raw':_0x16ddfe['options']?_0x16ddfe[_0x9799('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x9799('0xc')](function(_0x157ebb){logger[_0x9799('0x14')](_0x9799('0x17'),_0x16ddfe);logger['debug'](_0x9799('0x17'),_0x16ddfe,JSON[_0x9799('0x1b')](_0x157ebb));_0x3d61e4(_0x157ebb);})['catch'](function(_0x206169){logger[_0x9799('0x12')]('CreateSmsQueueReport',_0x206169[_0x9799('0x13')],_0x16ddfe);_0x3ce48e(_0x419817[_0x9799('0x12')](0x1f4,_0x206169[_0x9799('0x13')]));});});};exports[_0x9799('0x1c')]=function(_0x55ac74){var _0x44d68d=this;return new Promise(function(_0x20f94d,_0x5a7537){return db[_0x9799('0x18')]['update'](_0x55ac74[_0x9799('0x19')],{'raw':_0x55ac74[_0x9799('0x1a')]?_0x55ac74[_0x9799('0x1a')][_0x9799('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x55ac74[_0x9799('0x1a')]?_0x55ac74[_0x9799('0x1a')][_0x9799('0x1e')]||null:null,'attributes':_0x55ac74[_0x9799('0x1a')]?_0x55ac74[_0x9799('0x1a')][_0x9799('0x1f')]||null:null,'limit':_0x55ac74[_0x9799('0x1a')]?_0x55ac74[_0x9799('0x1a')][_0x9799('0x20')]||null:null})[_0x9799('0xc')](function(_0x417571){logger[_0x9799('0x14')]('UpdateSmsQueueReport',_0x55ac74);logger['debug']('UpdateSmsQueueReport',_0x55ac74,JSON[_0x9799('0x1b')](_0x417571));_0x20f94d(_0x417571);})[_0x9799('0x16')](function(_0x5447f5){logger[_0x9799('0x12')]('UpdateSmsQueueReport',_0x5447f5[_0x9799('0x13')],_0x55ac74);_0x5a7537(_0x44d68d[_0x9799('0x12')](0x1f4,_0x5447f5[_0x9799('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index a5e6451..230c8f4 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 _0x8ce1=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post','create','put','update','delete','destroy','multer','util','path','connect-timeout'];(function(_0x450c23,_0x3bc2de){var _0x32ec52=function(_0x4eaeca){while(--_0x4eaeca){_0x450c23['push'](_0x450c23['shift']());}};_0x32ec52(++_0x3bc2de);}(_0x8ce1,0x183));var _0x18ce=function(_0x2077b9,_0x144f00){_0x2077b9=_0x2077b9-0x0;var _0x838fda=_0x8ce1[_0x2077b9];return _0x838fda;};'use strict';var multer=require(_0x18ce('0x0'));var util=require(_0x18ce('0x1'));var path=require(_0x18ce('0x2'));var timeout=require(_0x18ce('0x3'));var express=require(_0x18ce('0x4'));var router=express[_0x18ce('0x5')]();var fs_extra=require(_0x18ce('0x6'));var auth=require(_0x18ce('0x7'));var interaction=require(_0x18ce('0x8'));var config=require(_0x18ce('0x9'));var controller=require(_0x18ce('0xa'));router[_0x18ce('0xb')]('/',auth[_0x18ce('0xc')](),controller[_0x18ce('0xd')]);router[_0x18ce('0xb')](_0x18ce('0xe'),auth['isAuthenticated'](),controller[_0x18ce('0xf')]);router[_0x18ce('0xb')](_0x18ce('0x10'),auth[_0x18ce('0xc')](),controller['show']);router[_0x18ce('0x11')]('/',auth[_0x18ce('0xc')](),controller[_0x18ce('0x12')]);router[_0x18ce('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x18ce('0x14')]);router[_0x18ce('0x15')](_0x18ce('0x10'),auth[_0x18ce('0xc')](),controller[_0x18ce('0x16')]);module['exports']=router; \ No newline at end of file +var _0xfd20=['get','isAuthenticated','index','describe','/:id','show','post','create','put','delete','destroy','exports','util','express','Router','../../components/auth/service','../../config/environment','./smsTransferReport.controller'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xfd20,0x66));var _0x0fd2=function(_0x136e17,_0x4cc300){_0x136e17=_0x136e17-0x0;var _0x5099c9=_0xfd20[_0x136e17];return _0x5099c9;};'use strict';var multer=require('multer');var util=require(_0x0fd2('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x0fd2('0x1'));var router=express[_0x0fd2('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x0fd2('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x0fd2('0x4'));var controller=require(_0x0fd2('0x5'));router[_0x0fd2('0x6')]('/',auth[_0x0fd2('0x7')](),controller[_0x0fd2('0x8')]);router['get']('/describe',auth[_0x0fd2('0x7')](),controller[_0x0fd2('0x9')]);router[_0x0fd2('0x6')](_0x0fd2('0xa'),auth[_0x0fd2('0x7')](),controller[_0x0fd2('0xb')]);router[_0x0fd2('0xc')]('/',auth['isAuthenticated'](),controller[_0x0fd2('0xd')]);router[_0x0fd2('0xe')]('/:id',auth[_0x0fd2('0x7')](),controller['update']);router[_0x0fd2('0xf')](_0x0fd2('0xa'),auth[_0x0fd2('0x7')](),controller[_0x0fd2('0x10')]);module[_0x0fd2('0x11')]=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index 2b4ae9b..5a74791 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 _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0x12d6c1,_0x8edeb8){var _0x416631=function(_0xf80ca3){while(--_0xf80ca3){_0x12d6c1['push'](_0x12d6c1['shift']());}};_0x416631(++_0x8edeb8);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x5cdacf,_0x7c82b1){_0x5cdacf=_0x5cdacf-0x0;var _0xa68a8b=_0xf3cd[_0x5cdacf];return _0xa68a8b;};'use strict';var moment=require(_0xdf3c('0x0'));var Sequelize=require(_0xdf3c('0x1'));module[_0xdf3c('0x2')]={'uniqueid':{'type':Sequelize[_0xdf3c('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xdf3c('0x4')](_0xdf3c('0x5'),'agent',_0xdf3c('0x6')),'allowNull':![],'defaultValue':_0xdf3c('0x6')},'transferredAt':{'type':Sequelize[_0xdf3c('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file +var _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x49eaba,_0x2bd164){var _0x826c11=function(_0xf23d84){while(--_0xf23d84){_0x49eaba['push'](_0x49eaba['shift']());}};_0x826c11(++_0x2bd164);}(_0x70e0,0x17b));var _0x070e=function(_0x4592da,_0x1d41ad){_0x4592da=_0x4592da-0x0;var _0x56f2d2=_0x70e0[_0x4592da];return _0x56f2d2;};'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 diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index f64263f..41ad177 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 _0xaee9=['zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','offset','count','limit','Content-Range','json','apply','reject','save','then','destroy','end','stack','name','send','index','SmsTransferReport','rawAttributes','fieldName','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','show','params','keys','options','find','create','body','update','catch','describe'];(function(_0x27604f,_0x5ae336){var _0x40d189=function(_0xebacde){while(--_0xebacde){_0x27604f['push'](_0x27604f['shift']());}};_0x40d189(++_0x5ae336);}(_0xaee9,0x128));var _0x9aee=function(_0x1f91d0,_0x3b7077){_0x1f91d0=_0x1f91d0-0x0;var _0x152ccf=_0xaee9[_0x1f91d0];return _0x152ccf;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9aee('0x0'));var jsonpatch=require(_0x9aee('0x1'));var rp=require(_0x9aee('0x2'));var moment=require('moment');var BPromise=require(_0x9aee('0x3'));var Mustache=require(_0x9aee('0x4'));var util=require(_0x9aee('0x5'));var path=require(_0x9aee('0x6'));var sox=require(_0x9aee('0x7'));var csv=require(_0x9aee('0x8'));var ejs=require(_0x9aee('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9aee('0xa'));var squel=require('squel');var crypto=require(_0x9aee('0xb'));var jsforce=require(_0x9aee('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9aee('0xd'));var Redis=require('ioredis');var authService=require(_0x9aee('0xe'));var qs=require(_0x9aee('0xf'));var as=require(_0x9aee('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9aee('0x11'))(_0x9aee('0x12'));var utils=require(_0x9aee('0x13'));var config=require(_0x9aee('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x45d94f,_0x2df79a){_0x2df79a=_0x2df79a||0xcc;return function(_0x3f4c5a){if(_0x3f4c5a){return _0x45d94f[_0x9aee('0x15')](_0x2df79a);}return _0x45d94f['status'](_0x2df79a)['end']();};}function respondWithResult(_0x2b97fc,_0x54a45e){_0x54a45e=_0x54a45e||0xc8;return function(_0x59276b){if(_0x59276b){return _0x2b97fc[_0x9aee('0x16')](_0x54a45e)['json'](_0x59276b);}};}function respondWithFilteredResult(_0x50b3b2,_0x30db72){return function(_0x557915){if(_0x557915){var _0x1254c9=typeof _0x30db72[_0x9aee('0x17')]==='undefined'&&typeof _0x30db72['limit']==='undefined';var _0x15d31e=_0x557915['count'];var _0x1969a9=_0x1254c9?0x0:_0x30db72[_0x9aee('0x17')];var _0x1aaab6=_0x1254c9?_0x557915[_0x9aee('0x18')]:_0x30db72['offset']+_0x30db72[_0x9aee('0x19')];var _0x2113b5;if(_0x1aaab6>=_0x15d31e){_0x1aaab6=_0x15d31e;_0x2113b5=0xc8;}else{_0x2113b5=0xce;}_0x50b3b2[_0x9aee('0x16')](_0x2113b5);return _0x50b3b2['set'](_0x9aee('0x1a'),_0x1969a9+'-'+_0x1aaab6+'/'+_0x15d31e)[_0x9aee('0x1b')](_0x557915);}return null;};}function patchUpdates(_0xd23935){return function(_0x35f032){try{jsonpatch[_0x9aee('0x1c')](_0x35f032,_0xd23935,!![]);}catch(_0x286883){return BPromise[_0x9aee('0x1d')](_0x286883);}return _0x35f032[_0x9aee('0x1e')]();};}function saveUpdates(_0x1a80eb,_0x2d9928){return function(_0x110e63){if(_0x110e63){return _0x110e63['update'](_0x1a80eb)[_0x9aee('0x1f')](function(_0x180bbc){return _0x180bbc;});}return null;};}function removeEntity(_0x30a16b,_0x56d42f){return function(_0x2924cc){if(_0x2924cc){return _0x2924cc[_0x9aee('0x20')]()[_0x9aee('0x1f')](function(){_0x30a16b[_0x9aee('0x16')](0xcc)[_0x9aee('0x21')]();});}};}function handleEntityNotFound(_0x2a9f7f,_0x518770){return function(_0x57396d){if(!_0x57396d){_0x2a9f7f[_0x9aee('0x15')](0x194);}return _0x57396d;};}function handleError(_0x2e59ac,_0x145e25){_0x145e25=_0x145e25||0x1f4;return function(_0x594770){logger['error'](_0x594770[_0x9aee('0x22')]);if(_0x594770['name']){delete _0x594770[_0x9aee('0x23')];}_0x2e59ac['status'](_0x145e25)[_0x9aee('0x24')](_0x594770);};}exports[_0x9aee('0x25')]=function(_0x317f81,_0x174b40){var _0x410407={},_0x5f4d77={},_0x4a0a25={'count':0x0,'rows':[]};var _0x16fcb0=_['map'](db[_0x9aee('0x26')][_0x9aee('0x27')],function(_0x12e2b3){return{'name':_0x12e2b3[_0x9aee('0x28')],'type':_0x12e2b3['type'][_0x9aee('0x29')]};});_0x5f4d77[_0x9aee('0x2a')]=_[_0x9aee('0x2b')](_0x16fcb0,_0x9aee('0x23'));_0x5f4d77['query']=_['keys'](_0x317f81[_0x9aee('0x2c')]);_0x5f4d77[_0x9aee('0x2d')]=_[_0x9aee('0x2e')](_0x5f4d77[_0x9aee('0x2a')],_0x5f4d77[_0x9aee('0x2c')]);_0x410407[_0x9aee('0x2f')]=_[_0x9aee('0x2e')](_0x5f4d77[_0x9aee('0x2a')],qs[_0x9aee('0x30')](_0x317f81[_0x9aee('0x2c')]['fields']));_0x410407[_0x9aee('0x2f')]=_0x410407[_0x9aee('0x2f')][_0x9aee('0x31')]?_0x410407['attributes']:_0x5f4d77[_0x9aee('0x2a')];if(!_0x317f81[_0x9aee('0x2c')][_0x9aee('0x32')](_0x9aee('0x33'))){_0x410407['limit']=qs[_0x9aee('0x19')](_0x317f81[_0x9aee('0x2c')]['limit']);_0x410407[_0x9aee('0x17')]=qs[_0x9aee('0x17')](_0x317f81['query'][_0x9aee('0x17')]);}_0x410407[_0x9aee('0x34')]=qs['sort'](_0x317f81[_0x9aee('0x2c')][_0x9aee('0x35')]);_0x410407[_0x9aee('0x36')]=qs[_0x9aee('0x2d')](_[_0x9aee('0x37')](_0x317f81[_0x9aee('0x2c')],_0x5f4d77[_0x9aee('0x2d')]),_0x16fcb0);if(_0x317f81[_0x9aee('0x2c')][_0x9aee('0x38')]){_0x410407['where']=_[_0x9aee('0x39')](_0x410407['where'],{'$or':_[_0x9aee('0x2b')](_0x16fcb0,function(_0x525590){if(_0x525590[_0x9aee('0x3a')]!==_0x9aee('0x3b')){var _0x4f4d38={};_0x4f4d38[_0x525590[_0x9aee('0x23')]]={'$like':'%'+_0x317f81[_0x9aee('0x2c')][_0x9aee('0x38')]+'%'};return _0x4f4d38;}})});}_0x410407=_[_0x9aee('0x39')]({},_0x410407,_0x317f81['options']);var _0x388933={'where':_0x410407['where']};return db[_0x9aee('0x26')][_0x9aee('0x18')](_0x388933)[_0x9aee('0x1f')](function(_0x37587c){_0x4a0a25[_0x9aee('0x18')]=_0x37587c;if(_0x317f81[_0x9aee('0x2c')][_0x9aee('0x3c')]){_0x410407[_0x9aee('0x3d')]=[{'all':!![]}];}return db[_0x9aee('0x26')][_0x9aee('0x3e')](_0x410407);})[_0x9aee('0x1f')](function(_0x11fbff){_0x4a0a25[_0x9aee('0x3f')]=_0x11fbff;return _0x4a0a25;})[_0x9aee('0x1f')](respondWithFilteredResult(_0x174b40,_0x410407))['catch'](handleError(_0x174b40,null));};exports[_0x9aee('0x40')]=function(_0x5a5844,_0x47764b){var _0x4cd331={'raw':!![],'where':{'id':_0x5a5844[_0x9aee('0x41')]['id']}},_0x359498={};_0x359498[_0x9aee('0x2a')]=_['keys'](db[_0x9aee('0x26')]['rawAttributes']);_0x359498['query']=_[_0x9aee('0x42')](_0x5a5844[_0x9aee('0x2c')]);_0x359498[_0x9aee('0x2d')]=_[_0x9aee('0x2e')](_0x359498['model'],_0x359498[_0x9aee('0x2c')]);_0x4cd331['attributes']=_[_0x9aee('0x2e')](_0x359498['model'],qs[_0x9aee('0x30')](_0x5a5844[_0x9aee('0x2c')][_0x9aee('0x30')]));_0x4cd331[_0x9aee('0x2f')]=_0x4cd331[_0x9aee('0x2f')][_0x9aee('0x31')]?_0x4cd331['attributes']:_0x359498[_0x9aee('0x2a')];if(_0x5a5844[_0x9aee('0x2c')]['includeAll']){_0x4cd331[_0x9aee('0x3d')]=[{'all':!![]}];}_0x4cd331=_[_0x9aee('0x39')]({},_0x4cd331,_0x5a5844[_0x9aee('0x43')]);return db['SmsTransferReport'][_0x9aee('0x44')](_0x4cd331)[_0x9aee('0x1f')](handleEntityNotFound(_0x47764b,null))[_0x9aee('0x1f')](respondWithResult(_0x47764b,null))['catch'](handleError(_0x47764b,null));};exports[_0x9aee('0x45')]=function(_0x5c6272,_0xd9618b){return db[_0x9aee('0x26')][_0x9aee('0x45')](_0x5c6272[_0x9aee('0x46')],{})[_0x9aee('0x1f')](respondWithResult(_0xd9618b,0xc9))['catch'](handleError(_0xd9618b,null));};exports[_0x9aee('0x47')]=function(_0x359d30,_0x2f54b8){if(_0x359d30[_0x9aee('0x46')]['id']){delete _0x359d30[_0x9aee('0x46')]['id'];}return db[_0x9aee('0x26')][_0x9aee('0x44')]({'where':{'id':_0x359d30[_0x9aee('0x41')]['id']}})[_0x9aee('0x1f')](handleEntityNotFound(_0x2f54b8,null))[_0x9aee('0x1f')](saveUpdates(_0x359d30[_0x9aee('0x46')],null))[_0x9aee('0x1f')](respondWithResult(_0x2f54b8,null))[_0x9aee('0x48')](handleError(_0x2f54b8,null));};exports['destroy']=function(_0x5202a5,_0x492382){return db[_0x9aee('0x26')]['find']({'where':{'id':_0x5202a5[_0x9aee('0x41')]['id']}})[_0x9aee('0x1f')](handleEntityNotFound(_0x492382,null))[_0x9aee('0x1f')](removeEntity(_0x492382,null))[_0x9aee('0x48')](handleError(_0x492382,null));};exports[_0x9aee('0x49')]=function(_0x5dbd3d,_0x11b77a){return db[_0x9aee('0x26')]['describe']()[_0x9aee('0x1f')](respondWithResult(_0x11b77a,null))['catch'](handleError(_0x11b77a,null));}; \ No newline at end of file +var _0x5aac=['name','send','map','SmsTransferReport','rawAttributes','model','query','intersection','fields','attributes','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','params','keys','length','find','catch','create','update','body','destroy','describe','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','error','stack'];(function(_0x11908c,_0x547af6){var _0x10cd4e=function(_0x2c0d66){while(--_0x2c0d66){_0x11908c['push'](_0x11908c['shift']());}};_0x10cd4e(++_0x547af6);}(_0x5aac,0x1ea));var _0xc5aa=function(_0xe2a56d,_0x45b025){_0xe2a56d=_0xe2a56d-0x0;var _0x529238=_0x5aac[_0xe2a56d];return _0x529238;};'use strict';var emlformat=require(_0xc5aa('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc5aa('0x1'));var jsonpatch=require(_0xc5aa('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xc5aa('0x3'));var Mustache=require(_0xc5aa('0x4'));var util=require(_0xc5aa('0x5'));var path=require(_0xc5aa('0x6'));var sox=require(_0xc5aa('0x7'));var csv=require(_0xc5aa('0x8'));var ejs=require(_0xc5aa('0x9'));var fs=require('fs');var fs_extra=require(_0xc5aa('0xa'));var _=require(_0xc5aa('0xb'));var squel=require(_0xc5aa('0xc'));var crypto=require(_0xc5aa('0xd'));var jsforce=require(_0xc5aa('0xe'));var deskjs=require(_0xc5aa('0xf'));var toCsv=require('to-csv');var querystring=require(_0xc5aa('0x10'));var Papa=require(_0xc5aa('0x11'));var Redis=require(_0xc5aa('0x12'));var authService=require(_0xc5aa('0x13'));var qs=require(_0xc5aa('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc5aa('0x15'));var logger=require('../../config/logger')(_0xc5aa('0x16'));var utils=require('../../config/utils');var config=require(_0xc5aa('0x17'));var licenseUtil=require(_0xc5aa('0x18'));var db=require(_0xc5aa('0x19'))['db'];function respondWithStatusCode(_0x485222,_0x229c2a){_0x229c2a=_0x229c2a||0xcc;return function(_0x4162fc){if(_0x4162fc){return _0x485222[_0xc5aa('0x1a')](_0x229c2a);}return _0x485222[_0xc5aa('0x1b')](_0x229c2a)[_0xc5aa('0x1c')]();};}function respondWithResult(_0x295869,_0x39d569){_0x39d569=_0x39d569||0xc8;return function(_0x38b12e){if(_0x38b12e){return _0x295869['status'](_0x39d569)[_0xc5aa('0x1d')](_0x38b12e);}};}function respondWithFilteredResult(_0x5114f9,_0x5557be){return function(_0x20e535){if(_0x20e535){var _0x4385ae=typeof _0x5557be['offset']===_0xc5aa('0x1e')&&typeof _0x5557be[_0xc5aa('0x1f')]==='undefined';var _0x1c6905=_0x20e535[_0xc5aa('0x20')];var _0xd88cba=_0x4385ae?0x0:_0x5557be['offset'];var _0x310f05=_0x4385ae?_0x20e535['count']:_0x5557be[_0xc5aa('0x21')]+_0x5557be[_0xc5aa('0x1f')];var _0xed3481;if(_0x310f05>=_0x1c6905){_0x310f05=_0x1c6905;_0xed3481=0xc8;}else{_0xed3481=0xce;}_0x5114f9[_0xc5aa('0x1b')](_0xed3481);return _0x5114f9[_0xc5aa('0x22')](_0xc5aa('0x23'),_0xd88cba+'-'+_0x310f05+'/'+_0x1c6905)['json'](_0x20e535);}return null;};}function patchUpdates(_0x5ceb2a){return function(_0x2439bb){try{jsonpatch[_0xc5aa('0x24')](_0x2439bb,_0x5ceb2a,!![]);}catch(_0x1251ad){return BPromise[_0xc5aa('0x25')](_0x1251ad);}return _0x2439bb[_0xc5aa('0x26')]();};}function saveUpdates(_0x4a3756,_0x2a787f){return function(_0x57e4db){if(_0x57e4db){return _0x57e4db['update'](_0x4a3756)[_0xc5aa('0x27')](function(_0x54c1a2){return _0x54c1a2;});}return null;};}function removeEntity(_0x6f6bbe,_0x46a38b){return function(_0x51598e){if(_0x51598e){return _0x51598e['destroy']()[_0xc5aa('0x27')](function(){_0x6f6bbe[_0xc5aa('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x45342b,_0x452f56){return function(_0x267936){if(!_0x267936){_0x45342b['sendStatus'](0x194);}return _0x267936;};}function handleError(_0x98068,_0x4b658b){_0x4b658b=_0x4b658b||0x1f4;return function(_0x31a09){logger[_0xc5aa('0x28')](_0x31a09[_0xc5aa('0x29')]);if(_0x31a09[_0xc5aa('0x2a')]){delete _0x31a09[_0xc5aa('0x2a')];}_0x98068[_0xc5aa('0x1b')](_0x4b658b)[_0xc5aa('0x2b')](_0x31a09);};}exports['index']=function(_0x3382d2,_0x59b49c){var _0x39d9fc={},_0x43d48f={},_0x20f1c0={'count':0x0,'rows':[]};var _0x53a9d5=_[_0xc5aa('0x2c')](db[_0xc5aa('0x2d')][_0xc5aa('0x2e')],function(_0x24035a){return{'name':_0x24035a['fieldName'],'type':_0x24035a['type']['key']};});_0x43d48f[_0xc5aa('0x2f')]=_[_0xc5aa('0x2c')](_0x53a9d5,_0xc5aa('0x2a'));_0x43d48f[_0xc5aa('0x30')]=_['keys'](_0x3382d2['query']);_0x43d48f['filters']=_[_0xc5aa('0x31')](_0x43d48f[_0xc5aa('0x2f')],_0x43d48f[_0xc5aa('0x30')]);_0x39d9fc['attributes']=_[_0xc5aa('0x31')](_0x43d48f[_0xc5aa('0x2f')],qs['fields'](_0x3382d2[_0xc5aa('0x30')][_0xc5aa('0x32')]));_0x39d9fc[_0xc5aa('0x33')]=_0x39d9fc[_0xc5aa('0x33')]['length']?_0x39d9fc[_0xc5aa('0x33')]:_0x43d48f['model'];if(!_0x3382d2[_0xc5aa('0x30')]['hasOwnProperty'](_0xc5aa('0x34'))){_0x39d9fc[_0xc5aa('0x1f')]=qs[_0xc5aa('0x1f')](_0x3382d2[_0xc5aa('0x30')][_0xc5aa('0x1f')]);_0x39d9fc[_0xc5aa('0x21')]=qs[_0xc5aa('0x21')](_0x3382d2[_0xc5aa('0x30')][_0xc5aa('0x21')]);}_0x39d9fc[_0xc5aa('0x35')]=qs[_0xc5aa('0x36')](_0x3382d2[_0xc5aa('0x30')]['sort']);_0x39d9fc[_0xc5aa('0x37')]=qs[_0xc5aa('0x38')](_[_0xc5aa('0x39')](_0x3382d2[_0xc5aa('0x30')],_0x43d48f['filters']),_0x53a9d5);if(_0x3382d2[_0xc5aa('0x30')][_0xc5aa('0x3a')]){_0x39d9fc['where']=_[_0xc5aa('0x3b')](_0x39d9fc[_0xc5aa('0x37')],{'$or':_['map'](_0x53a9d5,function(_0x5f4444){if(_0x5f4444[_0xc5aa('0x3c')]!==_0xc5aa('0x3d')){var _0x50a1f0={};_0x50a1f0[_0x5f4444[_0xc5aa('0x2a')]]={'$like':'%'+_0x3382d2[_0xc5aa('0x30')]['filter']+'%'};return _0x50a1f0;}})});}_0x39d9fc=_[_0xc5aa('0x3b')]({},_0x39d9fc,_0x3382d2[_0xc5aa('0x3e')]);var _0x483d7f={'where':_0x39d9fc[_0xc5aa('0x37')]};return db['SmsTransferReport'][_0xc5aa('0x20')](_0x483d7f)[_0xc5aa('0x27')](function(_0x393606){_0x20f1c0[_0xc5aa('0x20')]=_0x393606;if(_0x3382d2[_0xc5aa('0x30')][_0xc5aa('0x3f')]){_0x39d9fc[_0xc5aa('0x40')]=[{'all':!![]}];}return db['SmsTransferReport'][_0xc5aa('0x41')](_0x39d9fc);})[_0xc5aa('0x27')](function(_0x30e3a8){_0x20f1c0['rows']=_0x30e3a8;return _0x20f1c0;})[_0xc5aa('0x27')](respondWithFilteredResult(_0x59b49c,_0x39d9fc))['catch'](handleError(_0x59b49c,null));};exports['show']=function(_0x41044b,_0x2eaf4){var _0x4224a2={'raw':!![],'where':{'id':_0x41044b[_0xc5aa('0x42')]['id']}},_0x1eade5={};_0x1eade5[_0xc5aa('0x2f')]=_['keys'](db[_0xc5aa('0x2d')]['rawAttributes']);_0x1eade5[_0xc5aa('0x30')]=_[_0xc5aa('0x43')](_0x41044b[_0xc5aa('0x30')]);_0x1eade5['filters']=_[_0xc5aa('0x31')](_0x1eade5[_0xc5aa('0x2f')],_0x1eade5[_0xc5aa('0x30')]);_0x4224a2[_0xc5aa('0x33')]=_[_0xc5aa('0x31')](_0x1eade5[_0xc5aa('0x2f')],qs[_0xc5aa('0x32')](_0x41044b[_0xc5aa('0x30')]['fields']));_0x4224a2['attributes']=_0x4224a2[_0xc5aa('0x33')][_0xc5aa('0x44')]?_0x4224a2[_0xc5aa('0x33')]:_0x1eade5[_0xc5aa('0x2f')];if(_0x41044b['query']['includeAll']){_0x4224a2[_0xc5aa('0x40')]=[{'all':!![]}];}_0x4224a2=_[_0xc5aa('0x3b')]({},_0x4224a2,_0x41044b[_0xc5aa('0x3e')]);return db[_0xc5aa('0x2d')][_0xc5aa('0x45')](_0x4224a2)[_0xc5aa('0x27')](handleEntityNotFound(_0x2eaf4,null))[_0xc5aa('0x27')](respondWithResult(_0x2eaf4,null))[_0xc5aa('0x46')](handleError(_0x2eaf4,null));};exports[_0xc5aa('0x47')]=function(_0x5cd18f,_0x3cab37){return db['SmsTransferReport'][_0xc5aa('0x47')](_0x5cd18f['body'],{})[_0xc5aa('0x27')](respondWithResult(_0x3cab37,0xc9))[_0xc5aa('0x46')](handleError(_0x3cab37,null));};exports[_0xc5aa('0x48')]=function(_0x274e7f,_0x16ca56){if(_0x274e7f[_0xc5aa('0x49')]['id']){delete _0x274e7f[_0xc5aa('0x49')]['id'];}return db[_0xc5aa('0x2d')][_0xc5aa('0x45')]({'where':{'id':_0x274e7f[_0xc5aa('0x42')]['id']}})[_0xc5aa('0x27')](handleEntityNotFound(_0x16ca56,null))['then'](saveUpdates(_0x274e7f[_0xc5aa('0x49')],null))['then'](respondWithResult(_0x16ca56,null))[_0xc5aa('0x46')](handleError(_0x16ca56,null));};exports[_0xc5aa('0x4a')]=function(_0xe32777,_0xfa047b){return db[_0xc5aa('0x2d')][_0xc5aa('0x45')]({'where':{'id':_0xe32777[_0xc5aa('0x42')]['id']}})[_0xc5aa('0x27')](handleEntityNotFound(_0xfa047b,null))[_0xc5aa('0x27')](removeEntity(_0xfa047b,null))[_0xc5aa('0x46')](handleError(_0xfa047b,null));};exports[_0xc5aa('0x4b')]=function(_0x3caa4d,_0x1757b3){return db[_0xc5aa('0x2d')][_0xc5aa('0x4b')]()[_0xc5aa('0x27')](respondWithResult(_0x1757b3,null))['catch'](handleError(_0x1757b3,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index 6717af5..f6552e0 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 _0xf767=['uniqueid','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./smsTransferReport.attributes','define','SmsTransferReport','report_sms_transfer'];(function(_0x4acfd2,_0x5b9374){var _0x12afbe=function(_0x5bc178){while(--_0x5bc178){_0x4acfd2['push'](_0x4acfd2['shift']());}};_0x12afbe(++_0x5b9374);}(_0xf767,0x76));var _0x7f76=function(_0x2f227c,_0x360c3a){_0x2f227c=_0x2f227c-0x0;var _0x5032bc=_0xf767[_0x2f227c];return _0x5032bc;};'use strict';var _=require('lodash');var util=require(_0x7f76('0x0'));var logger=require(_0x7f76('0x1'))(_0x7f76('0x2'));var moment=require(_0x7f76('0x3'));var BPromise=require(_0x7f76('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7f76('0x5'));var rimraf=require(_0x7f76('0x6'));var config=require(_0x7f76('0x7'));var attributes=require(_0x7f76('0x8'));module['exports']=function(_0x23c243,_0x2f2588){return _0x23c243[_0x7f76('0x9')](_0x7f76('0xa'),attributes,{'tableName':_0x7f76('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x7f76('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8b97=['../../config/environment','./smsTransferReport.attributes','SmsTransferReport','report_sms_transfer','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x55205d,_0x1d5cae){var _0x946766=function(_0x5c569d){while(--_0x5c569d){_0x55205d['push'](_0x55205d['shift']());}};_0x946766(++_0x1d5cae);}(_0x8b97,0x1d9));var _0x78b9=function(_0x41b132,_0x1e096c){_0x41b132=_0x41b132-0x0;var _0x2ad393=_0x8b97[_0x41b132];return _0x2ad393;};'use strict';var _=require(_0x78b9('0x0'));var util=require('util');var logger=require(_0x78b9('0x1'))(_0x78b9('0x2'));var moment=require(_0x78b9('0x3'));var BPromise=require(_0x78b9('0x4'));var rp=require(_0x78b9('0x5'));var fs=require('fs');var path=require(_0x78b9('0x6'));var rimraf=require('rimraf');var config=require(_0x78b9('0x7'));var attributes=require(_0x78b9('0x8'));module['exports']=function(_0x194bb3,_0x1de137){return _0x194bb3['define'](_0x78b9('0x9'),attributes,{'tableName':_0x78b9('0xa'),'paranoid':![],'indexes':[{'name':_0x78b9('0xb'),'fields':[_0x78b9('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index 6031ffb..fa5c048 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 _0xaa48=['then','SmsTransferReport,\x20%s,\x20%s','request\x20sent','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x47fd36,_0x41535d){var _0x21a0fc=function(_0x44c07c){while(--_0x44c07c){_0x47fd36['push'](_0x47fd36['shift']());}};_0x21a0fc(++_0x41535d);}(_0xaa48,0x15a));var _0x8aa4=function(_0x1c25d3,_0x4a39ea){_0x1c25d3=_0x1c25d3-0x0;var _0x39b0c0=_0xaa48[_0x1c25d3];return _0x39b0c0;};'use strict';var _=require(_0x8aa4('0x0'));var util=require(_0x8aa4('0x1'));var moment=require(_0x8aa4('0x2'));var BPromise=require(_0x8aa4('0x3'));var rs=require(_0x8aa4('0x4'));var fs=require('fs');var Redis=require(_0x8aa4('0x5'));var db=require(_0x8aa4('0x6'))['db'];var utils=require(_0x8aa4('0x7'));var logger=require(_0x8aa4('0x8'))(_0x8aa4('0x9'));var config=require(_0x8aa4('0xa'));var jayson=require(_0x8aa4('0xb'));var client=jayson[_0x8aa4('0xc')][_0x8aa4('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x17bf06,_0x111c1d,_0x37498b){return new BPromise(function(_0xa5c92e,_0x17b04d){return client['request'](_0x17bf06,_0x37498b)[_0x8aa4('0xe')](function(_0x1e7e28){logger['info'](_0x8aa4('0xf'),_0x111c1d,_0x8aa4('0x10'));logger['debug'](_0x8aa4('0x11'),_0x111c1d,_0x8aa4('0x10'),JSON[_0x8aa4('0x12')](_0x1e7e28));if(_0x1e7e28[_0x8aa4('0x13')]){if(_0x1e7e28[_0x8aa4('0x13')][_0x8aa4('0x14')]===0x1f4){logger[_0x8aa4('0x13')](_0x8aa4('0xf'),_0x111c1d,_0x1e7e28[_0x8aa4('0x13')][_0x8aa4('0x15')]);return _0x17b04d(_0x1e7e28['error']['message']);}logger[_0x8aa4('0x13')](_0x8aa4('0xf'),_0x111c1d,_0x1e7e28[_0x8aa4('0x13')][_0x8aa4('0x15')]);return _0xa5c92e(_0x1e7e28[_0x8aa4('0x13')][_0x8aa4('0x15')]);}else{logger[_0x8aa4('0x16')](_0x8aa4('0xf'),_0x111c1d,_0x8aa4('0x10'));_0xa5c92e(_0x1e7e28[_0x8aa4('0x17')]['message']);}})['catch'](function(_0x5d1819){logger[_0x8aa4('0x13')](_0x8aa4('0xf'),_0x111c1d,_0x5d1819);_0x17b04d(_0x5d1819);});});} \ No newline at end of file +var _0x692c=['../../config/environment','jayson/promise','client','request','then','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x283070,_0x8542df){var _0x3584d2=function(_0x102637){while(--_0x102637){_0x283070['push'](_0x283070['shift']());}};_0x3584d2(++_0x8542df);}(_0x692c,0x6a));var _0xc692=function(_0x3de416,_0x3abc77){_0x3de416=_0x3de416-0x0;var _0x17c7ae=_0x692c[_0x3de416];return _0x17c7ae;};'use strict';var _=require(_0xc692('0x0'));var util=require(_0xc692('0x1'));var moment=require(_0xc692('0x2'));var BPromise=require(_0xc692('0x3'));var rs=require(_0xc692('0x4'));var fs=require('fs');var Redis=require(_0xc692('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc692('0x6'));var logger=require(_0xc692('0x7'))(_0xc692('0x8'));var config=require(_0xc692('0x9'));var jayson=require(_0xc692('0xa'));var client=jayson[_0xc692('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4c1229,_0x3a0bb4,_0x170b93){return new BPromise(function(_0x25e291,_0x38d716){return client[_0xc692('0xc')](_0x4c1229,_0x170b93)[_0xc692('0xd')](function(_0x2ad982){logger['info'](_0xc692('0xe'),_0x3a0bb4,_0xc692('0xf'));logger[_0xc692('0x10')](_0xc692('0x11'),_0x3a0bb4,_0xc692('0xf'),JSON['stringify'](_0x2ad982));if(_0x2ad982[_0xc692('0x12')]){if(_0x2ad982[_0xc692('0x12')][_0xc692('0x13')]===0x1f4){logger['error'](_0xc692('0xe'),_0x3a0bb4,_0x2ad982['error'][_0xc692('0x14')]);return _0x38d716(_0x2ad982[_0xc692('0x12')]['message']);}logger[_0xc692('0x12')](_0xc692('0xe'),_0x3a0bb4,_0x2ad982[_0xc692('0x12')][_0xc692('0x14')]);return _0x25e291(_0x2ad982[_0xc692('0x12')][_0xc692('0x14')]);}else{logger[_0xc692('0x15')](_0xc692('0xe'),_0x3a0bb4,_0xc692('0xf'));_0x25e291(_0x2ad982['result'][_0xc692('0x14')]);}})[_0xc692('0x16')](function(_0x523919){logger[_0xc692('0x12')](_0xc692('0xe'),_0x3a0bb4,_0x523919);_0x38d716(_0x523919);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index 7a19891..c1caf6e 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 _0x7728=['isAuthenticated','index','/:id/download','join','root','server/files/sounds/original/','originalname','replace','format','%s-%s%s','basename','extname','now','post','single','file','create','/:id','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get'];(function(_0x3bbb92,_0x2f5d21){var _0x308f98=function(_0x5cec19){while(--_0x5cec19){_0x3bbb92['push'](_0x3bbb92['shift']());}};_0x308f98(++_0x2f5d21);}(_0x7728,0xc8));var _0x8772=function(_0x442f5b,_0x39d79d){_0x442f5b=_0x442f5b-0x0;var _0x19fd96=_0x7728[_0x442f5b];return _0x19fd96;};'use strict';var multer=require(_0x8772('0x0'));var util=require(_0x8772('0x1'));var path=require(_0x8772('0x2'));var timeout=require(_0x8772('0x3'));var express=require(_0x8772('0x4'));var router=express[_0x8772('0x5')]();var fs_extra=require(_0x8772('0x6'));var auth=require(_0x8772('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x8772('0x8'));var controller=require('./sound.controller');router[_0x8772('0x9')]('/',auth[_0x8772('0xa')](),controller[_0x8772('0xb')]);router[_0x8772('0x9')]('/:id',auth[_0x8772('0xa')](),controller['show']);router[_0x8772('0x9')](_0x8772('0xc'),auth['isAuthenticated'](),controller['download']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1159aa,_0x31f942,_0x5aca26){_0x5aca26(null,path[_0x8772('0xd')](config[_0x8772('0xe')],_0x8772('0xf')));},'filename':function(_0x484d45,_0x5c0c36,_0x256900){_0x5c0c36['originalname']=_0x5c0c36[_0x8772('0x10')][_0x8772('0x11')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x256900(null,util[_0x8772('0x12')](_0x8772('0x13'),path[_0x8772('0x14')](_0x5c0c36[_0x8772('0x10')],path[_0x8772('0x15')](_0x5c0c36[_0x8772('0x10')])),Date[_0x8772('0x16')](),path[_0x8772('0x15')](_0x5c0c36[_0x8772('0x10')])));}})});router[_0x8772('0x17')]('/',upload[_0x8772('0x18')](_0x8772('0x19')),controller[_0x8772('0x1a')]);router['put'](_0x8772('0x1b'),auth[_0x8772('0xa')](),controller['update']);router[_0x8772('0x1c')]('/:id',auth[_0x8772('0xa')](),controller[_0x8772('0x1c')]);module[_0x8772('0x1d')]=router; \ No newline at end of file +var _0xbe70=['put','update','delete','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','download','server/files/sounds/original/','replace','format','%s-%s%s','basename','originalname','extname','post','single','create'];(function(_0x2ccf75,_0x38ea08){var _0x144af2=function(_0xb1b36e){while(--_0xb1b36e){_0x2ccf75['push'](_0x2ccf75['shift']());}};_0x144af2(++_0x38ea08);}(_0xbe70,0xd3));var _0x0be7=function(_0x45d948,_0x1f7d49){_0x45d948=_0x45d948-0x0;var _0x57bf83=_0xbe70[_0x45d948];return _0x57bf83;};'use strict';var multer=require('multer');var util=require(_0x0be7('0x0'));var path=require(_0x0be7('0x1'));var timeout=require(_0x0be7('0x2'));var express=require('express');var router=express[_0x0be7('0x3')]();var fs_extra=require(_0x0be7('0x4'));var auth=require(_0x0be7('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0be7('0x6'));var controller=require('./sound.controller');router[_0x0be7('0x7')]('/',auth[_0x0be7('0x8')](),controller['index']);router[_0x0be7('0x7')](_0x0be7('0x9'),auth['isAuthenticated'](),controller[_0x0be7('0xa')]);router[_0x0be7('0x7')](_0x0be7('0xb'),auth['isAuthenticated'](),controller[_0x0be7('0xc')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x88434a,_0xc82c63,_0x1ae3d5){_0x1ae3d5(null,path['join'](config['root'],_0x0be7('0xd')));},'filename':function(_0x2ab138,_0x4a2719,_0x225953){_0x4a2719['originalname']=_0x4a2719['originalname'][_0x0be7('0xe')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x225953(null,util[_0x0be7('0xf')](_0x0be7('0x10'),path[_0x0be7('0x11')](_0x4a2719[_0x0be7('0x12')],path[_0x0be7('0x13')](_0x4a2719[_0x0be7('0x12')])),Date['now'](),path[_0x0be7('0x13')](_0x4a2719['originalname'])));}})});router[_0x0be7('0x14')]('/',upload[_0x0be7('0x15')]('file'),controller[_0x0be7('0x16')]);router[_0x0be7('0x17')]('/:id',auth[_0x0be7('0x8')](),controller[_0x0be7('0x18')]);router[_0x0be7('0x19')](_0x0be7('0x9'),auth[_0x0be7('0x8')](),controller[_0x0be7('0x19')]);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 f55ac7b..b378eb2 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 _0x4972=['INTEGER','sequelize','exports','name','STRING','FLOAT','BIGINT'];(function(_0x342baa,_0x4a110f){var _0x1208f3=function(_0x56a645){while(--_0x56a645){_0x342baa['push'](_0x342baa['shift']());}};_0x1208f3(++_0x4a110f);}(_0x4972,0x1dd));var _0x2497=function(_0x1ce214,_0x2709ff){_0x1ce214=_0x1ce214-0x0;var _0x44814b=_0x4972[_0x1ce214];return _0x44814b;};'use strict';var Sequelize=require(_0x2497('0x0'));module[_0x2497('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x2497('0x2'),'allowNull':![]},'save_name':{'type':Sequelize[_0x2497('0x3')]},'display_name':{'type':Sequelize[_0x2497('0x3')],'defaultValue':''},'description':{'type':Sequelize[_0x2497('0x3')]},'original_format':{'type':Sequelize[_0x2497('0x3')]},'original_duration':{'type':Sequelize[_0x2497('0x4')]},'original_sampleCount':{'type':Sequelize[_0x2497('0x5')]},'original_channelCount':{'type':Sequelize[_0x2497('0x6')]},'original_bitRate':{'type':Sequelize[_0x2497('0x5')]},'original_sampleRate':{'type':Sequelize[_0x2497('0x6')]},'converted_format':{'type':Sequelize[_0x2497('0x3')]},'converted_duration':{'type':Sequelize[_0x2497('0x4')]},'converted_sampleCount':{'type':Sequelize['BIGINT']},'converted_channelCount':{'type':Sequelize[_0x2497('0x6')]},'converted_bitRate':{'type':Sequelize[_0x2497('0x5')]},'converted_sampleRate':{'type':Sequelize[_0x2497('0x6')]}}; \ No newline at end of file +var _0x66a1=['exports','STRING','FLOAT','BIGINT','INTEGER','sequelize'];(function(_0x5e3efd,_0x42e5d8){var _0x30ef89=function(_0x225999){while(--_0x225999){_0x5e3efd['push'](_0x5e3efd['shift']());}};_0x30ef89(++_0x42e5d8);}(_0x66a1,0x9b));var _0x166a=function(_0x483f0f,_0x129cca){_0x483f0f=_0x483f0f-0x0;var _0x127824=_0x66a1[_0x483f0f];return _0x127824;};'use strict';var Sequelize=require(_0x166a('0x0'));module[_0x166a('0x1')]={'name':{'type':Sequelize[_0x166a('0x2')],'unique':'name','allowNull':![]},'save_name':{'type':Sequelize['STRING']},'display_name':{'type':Sequelize['STRING'],'defaultValue':''},'description':{'type':Sequelize['STRING']},'original_format':{'type':Sequelize[_0x166a('0x2')]},'original_duration':{'type':Sequelize[_0x166a('0x3')]},'original_sampleCount':{'type':Sequelize[_0x166a('0x4')]},'original_channelCount':{'type':Sequelize[_0x166a('0x5')]},'original_bitRate':{'type':Sequelize[_0x166a('0x4')]},'original_sampleRate':{'type':Sequelize[_0x166a('0x5')]},'converted_format':{'type':Sequelize[_0x166a('0x2')]},'converted_duration':{'type':Sequelize['FLOAT']},'converted_sampleCount':{'type':Sequelize[_0x166a('0x4')]},'converted_channelCount':{'type':Sequelize[_0x166a('0x5')]},'converted_bitRate':{'type':Sequelize[_0x166a('0x4')]},'converted_sampleRate':{'type':Sequelize[_0x166a('0x5')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index 54f0cff..9289cf9 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 _0xba77=['attributes','fields','length','nolimit','order','sort','pick','filter','where','type','VIRTUAL','merge','options','includeAll','rows','catch','find','download','params','save_name','converted_format','existsSync','join','root','server/files/sounds/converted','Sequelize','ValidationError','Sound\x20not\x20found','format','%s.%s','create','basename','file','extname','originalname','filename','substring','wav','server/files/sounds/original','info','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','error','unlinkSync','send','original_duration','duration','original_sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_sampleCount','sampleCount','converted_channelCount','converted_bitRate','converted_sampleRate','role','body','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','description','delete','original_format','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Sounds','name','map','Sound','rawAttributes','fieldName','key','model','keys','query','filters','intersection'];(function(_0x43a37c,_0x25a567){var _0x5d1d40=function(_0x3ec673){while(--_0x3ec673){_0x43a37c['push'](_0x43a37c['shift']());}};_0x5d1d40(++_0x25a567);}(_0xba77,0x1cc));var _0x7ba7=function(_0x2d34d6,_0x397ff9){_0x2d34d6=_0x2d34d6-0x0;var _0x1d3d12=_0xba77[_0x2d34d6];return _0x1d3d12;};'use strict';var emlformat=require(_0x7ba7('0x0'));var rimraf=require(_0x7ba7('0x1'));var zipdir=require(_0x7ba7('0x2'));var jsonpatch=require(_0x7ba7('0x3'));var rp=require(_0x7ba7('0x4'));var moment=require('moment');var BPromise=require(_0x7ba7('0x5'));var Mustache=require(_0x7ba7('0x6'));var util=require('util');var path=require('path');var sox=require(_0x7ba7('0x7'));var csv=require(_0x7ba7('0x8'));var ejs=require(_0x7ba7('0x9'));var fs=require('fs');var fs_extra=require(_0x7ba7('0xa'));var _=require(_0x7ba7('0xb'));var squel=require(_0x7ba7('0xc'));var crypto=require(_0x7ba7('0xd'));var jsforce=require(_0x7ba7('0xe'));var deskjs=require(_0x7ba7('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7ba7('0x10'));var Redis=require('ioredis');var authService=require(_0x7ba7('0x11'));var qs=require(_0x7ba7('0x12'));var as=require(_0x7ba7('0x13'));var hardwareService=require(_0x7ba7('0x14'));var logger=require(_0x7ba7('0x15'))(_0x7ba7('0x16'));var utils=require(_0x7ba7('0x17'));var config=require(_0x7ba7('0x18'));var licenseUtil=require(_0x7ba7('0x19'));var db=require(_0x7ba7('0x1a'))['db'];function respondWithStatusCode(_0x58e268,_0x439fd3){_0x439fd3=_0x439fd3||0xcc;return function(_0x2b7e48){if(_0x2b7e48){return _0x58e268[_0x7ba7('0x1b')](_0x439fd3);}return _0x58e268[_0x7ba7('0x1c')](_0x439fd3)[_0x7ba7('0x1d')]();};}function respondWithResult(_0x51d201,_0x4996d1){_0x4996d1=_0x4996d1||0xc8;return function(_0x4464df){if(_0x4464df){return _0x51d201[_0x7ba7('0x1c')](_0x4996d1)[_0x7ba7('0x1e')](_0x4464df);}};}function respondWithFilteredResult(_0x50afe9,_0x1fe7ef){return function(_0x35b356){if(_0x35b356){var _0x5c21c0=typeof _0x1fe7ef[_0x7ba7('0x1f')]===_0x7ba7('0x20')&&typeof _0x1fe7ef[_0x7ba7('0x21')]===_0x7ba7('0x20');var _0x431a49=_0x35b356[_0x7ba7('0x22')];var _0x2c7176=_0x5c21c0?0x0:_0x1fe7ef[_0x7ba7('0x1f')];var _0x43ae68=_0x5c21c0?_0x35b356[_0x7ba7('0x22')]:_0x1fe7ef['offset']+_0x1fe7ef[_0x7ba7('0x21')];var _0x374649;if(_0x43ae68>=_0x431a49){_0x43ae68=_0x431a49;_0x374649=0xc8;}else{_0x374649=0xce;}_0x50afe9[_0x7ba7('0x1c')](_0x374649);return _0x50afe9[_0x7ba7('0x23')](_0x7ba7('0x24'),_0x2c7176+'-'+_0x43ae68+'/'+_0x431a49)['json'](_0x35b356);}return null;};}function patchUpdates(_0x2f3352){return function(_0x215da4){try{jsonpatch[_0x7ba7('0x25')](_0x215da4,_0x2f3352,!![]);}catch(_0x18c092){return BPromise[_0x7ba7('0x26')](_0x18c092);}return _0x215da4[_0x7ba7('0x27')]();};}function saveUpdates(_0x313f52,_0x13aa2f){return function(_0x3d26e0){if(_0x3d26e0){return _0x3d26e0[_0x7ba7('0x28')](_0x313f52)[_0x7ba7('0x29')](function(_0x1c99df){return _0x1c99df;});}return null;};}function removeEntity(_0x47750b,_0x5ecb3e){return function(_0x390e2a){if(_0x390e2a){return _0x390e2a[_0x7ba7('0x2a')]()[_0x7ba7('0x29')](function(){var _0x37640a=_0x390e2a[_0x7ba7('0x2b')]({'plain':!![]});var _0x26872d=_0x7ba7('0x2c');return db['UserProfileResource'][_0x7ba7('0x2a')]({'where':{'type':_0x26872d,'resourceId':_0x37640a['id']}})[_0x7ba7('0x29')](function(){return _0x390e2a;});})[_0x7ba7('0x29')](function(){_0x47750b['status'](0xcc)[_0x7ba7('0x1d')]();});}};}function handleEntityNotFound(_0x279e38,_0x45e6fb){return function(_0x43690e){if(!_0x43690e){_0x279e38[_0x7ba7('0x1b')](0x194);}return _0x43690e;};}function handleError(_0x1bb376,_0x422250){_0x422250=_0x422250||0x1f4;return function(_0x5f4674){logger['error'](_0x5f4674['stack']);if(_0x5f4674[_0x7ba7('0x2d')]){delete _0x5f4674[_0x7ba7('0x2d')];}_0x1bb376[_0x7ba7('0x1c')](_0x422250)['send'](_0x5f4674);};}exports['index']=function(_0x55e3cc,_0x463a78){var _0x76c7d5={},_0x2f3125={},_0xd8452e={'count':0x0,'rows':[]};var _0x1a4740=_[_0x7ba7('0x2e')](db[_0x7ba7('0x2f')][_0x7ba7('0x30')],function(_0x38273a){return{'name':_0x38273a[_0x7ba7('0x31')],'type':_0x38273a['type'][_0x7ba7('0x32')]};});_0x2f3125[_0x7ba7('0x33')]=_[_0x7ba7('0x2e')](_0x1a4740,_0x7ba7('0x2d'));_0x2f3125['query']=_[_0x7ba7('0x34')](_0x55e3cc[_0x7ba7('0x35')]);_0x2f3125[_0x7ba7('0x36')]=_[_0x7ba7('0x37')](_0x2f3125['model'],_0x2f3125[_0x7ba7('0x35')]);_0x76c7d5[_0x7ba7('0x38')]=_['intersection'](_0x2f3125['model'],qs['fields'](_0x55e3cc[_0x7ba7('0x35')][_0x7ba7('0x39')]));_0x76c7d5[_0x7ba7('0x38')]=_0x76c7d5[_0x7ba7('0x38')][_0x7ba7('0x3a')]?_0x76c7d5[_0x7ba7('0x38')]:_0x2f3125[_0x7ba7('0x33')];if(!_0x55e3cc[_0x7ba7('0x35')]['hasOwnProperty'](_0x7ba7('0x3b'))){_0x76c7d5[_0x7ba7('0x21')]=qs[_0x7ba7('0x21')](_0x55e3cc[_0x7ba7('0x35')]['limit']);_0x76c7d5[_0x7ba7('0x1f')]=qs[_0x7ba7('0x1f')](_0x55e3cc['query'][_0x7ba7('0x1f')]);}_0x76c7d5[_0x7ba7('0x3c')]=qs[_0x7ba7('0x3d')](_0x55e3cc[_0x7ba7('0x35')]['sort']);_0x76c7d5['where']=qs['filters'](_[_0x7ba7('0x3e')](_0x55e3cc[_0x7ba7('0x35')],_0x2f3125[_0x7ba7('0x36')]),_0x1a4740);if(_0x55e3cc[_0x7ba7('0x35')][_0x7ba7('0x3f')]){_0x76c7d5[_0x7ba7('0x40')]=_['merge'](_0x76c7d5[_0x7ba7('0x40')],{'$or':_[_0x7ba7('0x2e')](_0x1a4740,function(_0x3f6da3){if(_0x3f6da3[_0x7ba7('0x41')]!==_0x7ba7('0x42')){var _0x1e2d77={};_0x1e2d77[_0x3f6da3[_0x7ba7('0x2d')]]={'$like':'%'+_0x55e3cc['query']['filter']+'%'};return _0x1e2d77;}})});}_0x76c7d5=_[_0x7ba7('0x43')]({},_0x76c7d5,_0x55e3cc[_0x7ba7('0x44')]);var _0x3df77f={'where':_0x76c7d5[_0x7ba7('0x40')]};return db[_0x7ba7('0x2f')][_0x7ba7('0x22')](_0x3df77f)['then'](function(_0xbddbe2){_0xd8452e[_0x7ba7('0x22')]=_0xbddbe2;if(_0x55e3cc['query'][_0x7ba7('0x45')]){_0x76c7d5['include']=[{'all':!![]}];}return db['Sound']['findAll'](_0x76c7d5);})[_0x7ba7('0x29')](function(_0x5f584a){_0xd8452e[_0x7ba7('0x46')]=_0x5f584a;return _0xd8452e;})['then'](respondWithFilteredResult(_0x463a78,_0x76c7d5))[_0x7ba7('0x47')](handleError(_0x463a78,null));};exports['show']=function(_0x3143cf,_0x3d9410){var _0x23d3bb={'raw':!![],'where':{'id':_0x3143cf['params']['id']}},_0x58f092={};_0x58f092[_0x7ba7('0x33')]=_[_0x7ba7('0x34')](db['Sound'][_0x7ba7('0x30')]);_0x58f092['query']=_[_0x7ba7('0x34')](_0x3143cf[_0x7ba7('0x35')]);_0x58f092[_0x7ba7('0x36')]=_[_0x7ba7('0x37')](_0x58f092[_0x7ba7('0x33')],_0x58f092[_0x7ba7('0x35')]);_0x23d3bb['attributes']=_[_0x7ba7('0x37')](_0x58f092[_0x7ba7('0x33')],qs[_0x7ba7('0x39')](_0x3143cf[_0x7ba7('0x35')][_0x7ba7('0x39')]));_0x23d3bb[_0x7ba7('0x38')]=_0x23d3bb['attributes']['length']?_0x23d3bb[_0x7ba7('0x38')]:_0x58f092['model'];if(_0x3143cf['query'][_0x7ba7('0x45')]){_0x23d3bb['include']=[{'all':!![]}];}_0x23d3bb=_[_0x7ba7('0x43')]({},_0x23d3bb,_0x3143cf['options']);return db['Sound'][_0x7ba7('0x48')](_0x23d3bb)[_0x7ba7('0x29')](handleEntityNotFound(_0x3d9410,null))[_0x7ba7('0x29')](respondWithResult(_0x3d9410,null))['catch'](handleError(_0x3d9410,null));};exports[_0x7ba7('0x49')]=function(_0x594df2,_0x416b84,_0x4a07e5){return db[_0x7ba7('0x2f')]['find']({'where':{'id':_0x594df2[_0x7ba7('0x4a')]['id']},'attributes':[_0x7ba7('0x2d'),_0x7ba7('0x4b'),_0x7ba7('0x4c')],'raw':!![]})['then'](handleEntityNotFound(_0x416b84,null))[_0x7ba7('0x29')](function(_0x5b12ee){if(_0x5b12ee){if(!fs[_0x7ba7('0x4d')](path[_0x7ba7('0x4e')](config[_0x7ba7('0x4f')],_0x7ba7('0x50'),_0x5b12ee[_0x7ba7('0x4b')]+'.'+_0x5b12ee[_0x7ba7('0x4c')]))){throw new db[(_0x7ba7('0x51'))][(_0x7ba7('0x52'))](_0x7ba7('0x53'));}return _0x416b84[_0x7ba7('0x49')](path['join'](config[_0x7ba7('0x4f')],'server/files/sounds/converted',util[_0x7ba7('0x54')](_0x7ba7('0x55'),_0x5b12ee[_0x7ba7('0x4b')],_0x5b12ee[_0x7ba7('0x4c')])),util[_0x7ba7('0x54')]('%s.%s',_0x5b12ee[_0x7ba7('0x2d')],_0x5b12ee[_0x7ba7('0x4c')]));}return null;})[_0x7ba7('0x47')](handleError(_0x416b84,null));};exports[_0x7ba7('0x56')]=function(_0x514d77,_0x1f681e,_0x2b36b5){var _0x3190c8={'name':path[_0x7ba7('0x57')](_0x514d77[_0x7ba7('0x58')]['originalname'],path[_0x7ba7('0x59')](_0x514d77[_0x7ba7('0x58')][_0x7ba7('0x5a')])),'save_name':path['basename'](_0x514d77['file'][_0x7ba7('0x5b')],path['extname'](_0x514d77[_0x7ba7('0x58')][_0x7ba7('0x5b')])),'original_format':path['extname'](_0x514d77['file'][_0x7ba7('0x5a')])[_0x7ba7('0x5c')](0x1),'converted_format':_0x7ba7('0x5d')};var _0x1412d4=path[_0x7ba7('0x4e')](config['root'],_0x7ba7('0x5e'),_0x514d77[_0x7ba7('0x58')][_0x7ba7('0x5b')]);var _0x3b2a77=path[_0x7ba7('0x4e')](config['root'],'server/files/sounds/converted',util[_0x7ba7('0x54')](_0x7ba7('0x55'),path[_0x7ba7('0x57')](_0x514d77['file'][_0x7ba7('0x5b')],path['extname'](_0x514d77['file'][_0x7ba7('0x5b')])),_0x3190c8['converted_format']));logger[_0x7ba7('0x5f')]('Sound\x20upload\x20filepath:\x20%s',_0x1412d4);logger['info'](_0x7ba7('0x60'),_0x3b2a77);try{fs[_0x7ba7('0x61')](_0x1412d4,parseInt(_0x7ba7('0x62'),0x8));var _0x5cda3c=sox[_0x7ba7('0x63')](_0x1412d4,_0x3b2a77,{'sampleRate':0x1f40,'format':_0x7ba7('0x5d'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x5cda3c['on'](_0x7ba7('0x64'),function(_0x10b9b0){fs[_0x7ba7('0x65')](_0x1412d4);_0x1f681e[_0x7ba7('0x1c')](0x1f4)[_0x7ba7('0x66')](_0x10b9b0);});_0x5cda3c['on']('src',function(_0x54c0e9){_0x3190c8[_0x7ba7('0x67')]=isNaN(_0x54c0e9[_0x7ba7('0x68')])?null:_0x54c0e9[_0x7ba7('0x68')]*0x3e8;_0x3190c8[_0x7ba7('0x69')]=isNaN(_0x54c0e9['sampleCount'])?null:_0x54c0e9['sampleCount'];_0x3190c8[_0x7ba7('0x6a')]=isNaN(_0x54c0e9['channelCount'])?null:_0x54c0e9[_0x7ba7('0x6b')];_0x3190c8[_0x7ba7('0x6c')]=isNaN(_0x54c0e9['bitRate'])?null:_0x54c0e9[_0x7ba7('0x6d')];_0x3190c8[_0x7ba7('0x6e')]=isNaN(_0x54c0e9[_0x7ba7('0x6f')])?null:_0x54c0e9[_0x7ba7('0x6f')];});_0x5cda3c['on'](_0x7ba7('0x70'),function(_0xddbd87){_0x3190c8[_0x7ba7('0x71')]=isNaN(_0xddbd87['duration'])?null:_0xddbd87[_0x7ba7('0x68')]*0x3e8;_0x3190c8[_0x7ba7('0x72')]=isNaN(_0xddbd87[_0x7ba7('0x73')])?null:_0xddbd87[_0x7ba7('0x73')];_0x3190c8[_0x7ba7('0x74')]=isNaN(_0xddbd87['channelCount'])?null:_0xddbd87[_0x7ba7('0x6b')];_0x3190c8[_0x7ba7('0x75')]=isNaN(_0xddbd87[_0x7ba7('0x6d')])?null:_0xddbd87[_0x7ba7('0x6d')];_0x3190c8[_0x7ba7('0x76')]=isNaN(_0xddbd87[_0x7ba7('0x6f')])?null:_0xddbd87['sampleRate'];});_0x5cda3c['on'](_0x7ba7('0x1d'),function(){fs[_0x7ba7('0x61')](_0x3b2a77,parseInt(_0x7ba7('0x62'),0x8));return db[_0x7ba7('0x2f')][_0x7ba7('0x56')](_0x3190c8)[_0x7ba7('0x29')](function(_0x4aa839){var _0x54c916={'role':_0x514d77['body'][_0x7ba7('0x77')],'userProfileId':_0x514d77[_0x7ba7('0x78')]['userProfileId']};if(!_0x54c916)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x54c916[_0x7ba7('0x77')]===_0x7ba7('0x79')){var _0x4652fd=_0x4aa839[_0x7ba7('0x2b')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0x7ba7('0x2c'),'userProfileId':_0x54c916[_0x7ba7('0x7a')]},'raw':!![]})[_0x7ba7('0x29')](function(_0x32ccbc){if(_0x32ccbc&&_0x32ccbc[_0x7ba7('0x7b')]===0x0){return db['UserProfileResource'][_0x7ba7('0x56')]({'name':_0x4652fd[_0x7ba7('0x2d')],'resourceId':_0x4652fd['id'],'type':_0x32ccbc[_0x7ba7('0x2d')],'sectionId':_0x32ccbc['id']},{})[_0x7ba7('0x29')](function(){return _0x4aa839;});}else{return _0x4aa839;}})[_0x7ba7('0x47')](function(_0x10dfd7){logger[_0x7ba7('0x64')](_0x7ba7('0x7c'),_0x10dfd7);throw _0x10dfd7;});}return _0x4aa839;})[_0x7ba7('0x29')](respondWithResult(_0x1f681e,null))[_0x7ba7('0x47')](handleError(_0x1f681e,null));});_0x5cda3c[_0x7ba7('0x7d')]();}catch(_0x156499){_0x1f681e[_0x7ba7('0x1c')](0x1f4)['send'](_0x156499);}};exports[_0x7ba7('0x28')]=function(_0x1323a3,_0x25aff4,_0x1f2b3f){return db[_0x7ba7('0x2f')][_0x7ba7('0x48')]({'where':{'id':_0x1323a3[_0x7ba7('0x4a')]['id']}})['then'](handleEntityNotFound(_0x25aff4,null))['then'](saveUpdates(_[_0x7ba7('0x3e')](_0x1323a3[_0x7ba7('0x78')],['name',_0x7ba7('0x7e')]),null))[_0x7ba7('0x29')](respondWithResult(_0x25aff4,null))['catch'](handleError(_0x25aff4,null));};exports[_0x7ba7('0x7f')]=function(_0x5115bb,_0x23ac1e,_0x3523be){return db['Sound'][_0x7ba7('0x48')]({'where':{'id':_0x5115bb[_0x7ba7('0x4a')]['id']}})[_0x7ba7('0x29')](function(_0xd7c80c){if(_0xd7c80c){return _0xd7c80c[_0x7ba7('0x2a')]();}})['then'](function(_0x544043){var _0x4ec4ce=path[_0x7ba7('0x4e')](config[_0x7ba7('0x4f')],_0x7ba7('0x5e'),util[_0x7ba7('0x54')](_0x7ba7('0x55'),_0x544043['save_name'],_0x544043[_0x7ba7('0x80')]));var _0x5c1d1d=path['join'](config[_0x7ba7('0x4f')],_0x7ba7('0x50'),util[_0x7ba7('0x54')](_0x7ba7('0x55'),_0x544043[_0x7ba7('0x4b')],_0x544043[_0x7ba7('0x4c')]));fs['unlinkSync'](_0x4ec4ce);fs[_0x7ba7('0x65')](_0x5c1d1d);return _0x544043;})[_0x7ba7('0x29')](function(_0x53af87){if(_0x53af87){return _0x23ac1e['status'](0xcc)[_0x7ba7('0x1d')]();}})[_0x7ba7('0x29')](handleEntityNotFound(_0x23ac1e,null))[_0x7ba7('0x47')](handleError(_0x23ac1e,null));}; \ No newline at end of file +var _0x6db2=['../../config/license/util','../../mysqldb','status','json','offset','undefined','count','limit','set','apply','reject','save','destroy','then','get','Sounds','UserProfileResource','sendStatus','error','stack','name','send','index','map','Sound','rawAttributes','fieldName','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','find','download','params','save_name','existsSync','join','root','server/files/sounds/converted','converted_format','ValidationError','Sound\x20not\x20found','format','%s.%s','catch','create','basename','originalname','extname','file','filename','substring','wav','server/files/sounds/original','info','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','unlinkSync','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_channelCount','converted_bitRate','end','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','pick','description','delete','original_format','eml-format','fast-json-patch','moment','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x4d3052,_0x7e31a2){var _0x2b2004=function(_0x4a1efd){while(--_0x4a1efd){_0x4d3052['push'](_0x4d3052['shift']());}};_0x2b2004(++_0x7e31a2);}(_0x6db2,0x172));var _0x26db=function(_0x4207a6,_0x3a3110){_0x4207a6=_0x4207a6-0x0;var _0x42b37a=_0x6db2[_0x4207a6];return _0x42b37a;};'use strict';var emlformat=require(_0x26db('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x26db('0x1'));var rp=require('request-promise');var moment=require(_0x26db('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x26db('0x3'));var util=require(_0x26db('0x4'));var path=require(_0x26db('0x5'));var sox=require(_0x26db('0x6'));var csv=require('to-csv');var ejs=require(_0x26db('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x26db('0x8'));var squel=require(_0x26db('0x9'));var crypto=require(_0x26db('0xa'));var jsforce=require(_0x26db('0xb'));var deskjs=require(_0x26db('0xc'));var toCsv=require(_0x26db('0xd'));var querystring=require('querystring');var Papa=require(_0x26db('0xe'));var Redis=require(_0x26db('0xf'));var authService=require(_0x26db('0x10'));var qs=require(_0x26db('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x26db('0x12'));var logger=require(_0x26db('0x13'))(_0x26db('0x14'));var utils=require(_0x26db('0x15'));var config=require(_0x26db('0x16'));var licenseUtil=require(_0x26db('0x17'));var db=require(_0x26db('0x18'))['db'];function respondWithStatusCode(_0x18d390,_0x349bcb){_0x349bcb=_0x349bcb||0xcc;return function(_0x393aba){if(_0x393aba){return _0x18d390['sendStatus'](_0x349bcb);}return _0x18d390[_0x26db('0x19')](_0x349bcb)['end']();};}function respondWithResult(_0x4d5588,_0x48b1f0){_0x48b1f0=_0x48b1f0||0xc8;return function(_0x2d2832){if(_0x2d2832){return _0x4d5588[_0x26db('0x19')](_0x48b1f0)[_0x26db('0x1a')](_0x2d2832);}};}function respondWithFilteredResult(_0x429d72,_0x30f703){return function(_0x4ac645){if(_0x4ac645){var _0x2bc155=typeof _0x30f703[_0x26db('0x1b')]==='undefined'&&typeof _0x30f703['limit']===_0x26db('0x1c');var _0x471d64=_0x4ac645[_0x26db('0x1d')];var _0x26de38=_0x2bc155?0x0:_0x30f703['offset'];var _0x5a453d=_0x2bc155?_0x4ac645['count']:_0x30f703[_0x26db('0x1b')]+_0x30f703[_0x26db('0x1e')];var _0x15366b;if(_0x5a453d>=_0x471d64){_0x5a453d=_0x471d64;_0x15366b=0xc8;}else{_0x15366b=0xce;}_0x429d72['status'](_0x15366b);return _0x429d72[_0x26db('0x1f')]('Content-Range',_0x26de38+'-'+_0x5a453d+'/'+_0x471d64)[_0x26db('0x1a')](_0x4ac645);}return null;};}function patchUpdates(_0x3b817a){return function(_0x2333d7){try{jsonpatch[_0x26db('0x20')](_0x2333d7,_0x3b817a,!![]);}catch(_0x47ab47){return BPromise[_0x26db('0x21')](_0x47ab47);}return _0x2333d7[_0x26db('0x22')]();};}function saveUpdates(_0x115840,_0x321a4b){return function(_0xd88fb6){if(_0xd88fb6){return _0xd88fb6['update'](_0x115840)['then'](function(_0x363046){return _0x363046;});}return null;};}function removeEntity(_0x124546,_0x55ea41){return function(_0x3930ee){if(_0x3930ee){return _0x3930ee[_0x26db('0x23')]()[_0x26db('0x24')](function(){var _0x3d10d1=_0x3930ee[_0x26db('0x25')]({'plain':!![]});var _0xe88a0=_0x26db('0x26');return db[_0x26db('0x27')][_0x26db('0x23')]({'where':{'type':_0xe88a0,'resourceId':_0x3d10d1['id']}})[_0x26db('0x24')](function(){return _0x3930ee;});})[_0x26db('0x24')](function(){_0x124546['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x257936,_0xf98ea1){return function(_0x59abbe){if(!_0x59abbe){_0x257936[_0x26db('0x28')](0x194);}return _0x59abbe;};}function handleError(_0xd62a7d,_0x4bb12b){_0x4bb12b=_0x4bb12b||0x1f4;return function(_0x4763bb){logger[_0x26db('0x29')](_0x4763bb[_0x26db('0x2a')]);if(_0x4763bb[_0x26db('0x2b')]){delete _0x4763bb[_0x26db('0x2b')];}_0xd62a7d[_0x26db('0x19')](_0x4bb12b)[_0x26db('0x2c')](_0x4763bb);};}exports[_0x26db('0x2d')]=function(_0x5478e7,_0x52130e){var _0xc28404={},_0x1e8a4c={},_0x165e2e={'count':0x0,'rows':[]};var _0x2ca20a=_[_0x26db('0x2e')](db[_0x26db('0x2f')][_0x26db('0x30')],function(_0x32ed54){return{'name':_0x32ed54[_0x26db('0x31')],'type':_0x32ed54['type'][_0x26db('0x32')]};});_0x1e8a4c['model']=_[_0x26db('0x2e')](_0x2ca20a,_0x26db('0x2b'));_0x1e8a4c[_0x26db('0x33')]=_[_0x26db('0x34')](_0x5478e7[_0x26db('0x33')]);_0x1e8a4c[_0x26db('0x35')]=_['intersection'](_0x1e8a4c[_0x26db('0x36')],_0x1e8a4c[_0x26db('0x33')]);_0xc28404[_0x26db('0x37')]=_[_0x26db('0x38')](_0x1e8a4c[_0x26db('0x36')],qs['fields'](_0x5478e7['query'][_0x26db('0x39')]));_0xc28404[_0x26db('0x37')]=_0xc28404[_0x26db('0x37')][_0x26db('0x3a')]?_0xc28404[_0x26db('0x37')]:_0x1e8a4c[_0x26db('0x36')];if(!_0x5478e7[_0x26db('0x33')][_0x26db('0x3b')](_0x26db('0x3c'))){_0xc28404['limit']=qs['limit'](_0x5478e7['query']['limit']);_0xc28404[_0x26db('0x1b')]=qs[_0x26db('0x1b')](_0x5478e7['query'][_0x26db('0x1b')]);}_0xc28404[_0x26db('0x3d')]=qs[_0x26db('0x3e')](_0x5478e7['query'][_0x26db('0x3e')]);_0xc28404[_0x26db('0x3f')]=qs[_0x26db('0x35')](_['pick'](_0x5478e7[_0x26db('0x33')],_0x1e8a4c['filters']),_0x2ca20a);if(_0x5478e7[_0x26db('0x33')][_0x26db('0x40')]){_0xc28404[_0x26db('0x3f')]=_[_0x26db('0x41')](_0xc28404[_0x26db('0x3f')],{'$or':_[_0x26db('0x2e')](_0x2ca20a,function(_0x59b28d){if(_0x59b28d[_0x26db('0x42')]!==_0x26db('0x43')){var _0x424809={};_0x424809[_0x59b28d[_0x26db('0x2b')]]={'$like':'%'+_0x5478e7['query'][_0x26db('0x40')]+'%'};return _0x424809;}})});}_0xc28404=_[_0x26db('0x41')]({},_0xc28404,_0x5478e7[_0x26db('0x44')]);var _0xed030b={'where':_0xc28404[_0x26db('0x3f')]};return db[_0x26db('0x2f')]['count'](_0xed030b)[_0x26db('0x24')](function(_0x1238d9){_0x165e2e[_0x26db('0x1d')]=_0x1238d9;if(_0x5478e7[_0x26db('0x33')][_0x26db('0x45')]){_0xc28404[_0x26db('0x46')]=[{'all':!![]}];}return db[_0x26db('0x2f')][_0x26db('0x47')](_0xc28404);})[_0x26db('0x24')](function(_0x43b5e4){_0x165e2e[_0x26db('0x48')]=_0x43b5e4;return _0x165e2e;})[_0x26db('0x24')](respondWithFilteredResult(_0x52130e,_0xc28404))['catch'](handleError(_0x52130e,null));};exports[_0x26db('0x49')]=function(_0x1435c5,_0x1e0ddd){var _0x4eab9a={'raw':!![],'where':{'id':_0x1435c5['params']['id']}},_0x26b275={};_0x26b275[_0x26db('0x36')]=_[_0x26db('0x34')](db[_0x26db('0x2f')][_0x26db('0x30')]);_0x26b275[_0x26db('0x33')]=_['keys'](_0x1435c5[_0x26db('0x33')]);_0x26b275['filters']=_[_0x26db('0x38')](_0x26b275[_0x26db('0x36')],_0x26b275[_0x26db('0x33')]);_0x4eab9a[_0x26db('0x37')]=_[_0x26db('0x38')](_0x26b275[_0x26db('0x36')],qs[_0x26db('0x39')](_0x1435c5[_0x26db('0x33')]['fields']));_0x4eab9a['attributes']=_0x4eab9a['attributes']['length']?_0x4eab9a[_0x26db('0x37')]:_0x26b275[_0x26db('0x36')];if(_0x1435c5[_0x26db('0x33')][_0x26db('0x45')]){_0x4eab9a[_0x26db('0x46')]=[{'all':!![]}];}_0x4eab9a=_[_0x26db('0x41')]({},_0x4eab9a,_0x1435c5[_0x26db('0x44')]);return db[_0x26db('0x2f')][_0x26db('0x4a')](_0x4eab9a)[_0x26db('0x24')](handleEntityNotFound(_0x1e0ddd,null))['then'](respondWithResult(_0x1e0ddd,null))['catch'](handleError(_0x1e0ddd,null));};exports[_0x26db('0x4b')]=function(_0xc33702,_0x5e0a55,_0x494509){return db[_0x26db('0x2f')][_0x26db('0x4a')]({'where':{'id':_0xc33702[_0x26db('0x4c')]['id']},'attributes':['name',_0x26db('0x4d'),'converted_format'],'raw':!![]})[_0x26db('0x24')](handleEntityNotFound(_0x5e0a55,null))['then'](function(_0x1d916a){if(_0x1d916a){if(!fs[_0x26db('0x4e')](path[_0x26db('0x4f')](config[_0x26db('0x50')],_0x26db('0x51'),_0x1d916a[_0x26db('0x4d')]+'.'+_0x1d916a[_0x26db('0x52')]))){throw new db['Sequelize'][(_0x26db('0x53'))](_0x26db('0x54'));}return _0x5e0a55[_0x26db('0x4b')](path[_0x26db('0x4f')](config['root'],_0x26db('0x51'),util[_0x26db('0x55')](_0x26db('0x56'),_0x1d916a['save_name'],_0x1d916a[_0x26db('0x52')])),util[_0x26db('0x55')](_0x26db('0x56'),_0x1d916a['name'],_0x1d916a['converted_format']));}return null;})[_0x26db('0x57')](handleError(_0x5e0a55,null));};exports[_0x26db('0x58')]=function(_0x3a92a7,_0x115410,_0x1a86f2){var _0x2b01ac={'name':path[_0x26db('0x59')](_0x3a92a7['file'][_0x26db('0x5a')],path[_0x26db('0x5b')](_0x3a92a7[_0x26db('0x5c')][_0x26db('0x5a')])),'save_name':path[_0x26db('0x59')](_0x3a92a7[_0x26db('0x5c')][_0x26db('0x5d')],path[_0x26db('0x5b')](_0x3a92a7[_0x26db('0x5c')][_0x26db('0x5d')])),'original_format':path[_0x26db('0x5b')](_0x3a92a7[_0x26db('0x5c')][_0x26db('0x5a')])[_0x26db('0x5e')](0x1),'converted_format':_0x26db('0x5f')};var _0x37c727=path[_0x26db('0x4f')](config[_0x26db('0x50')],_0x26db('0x60'),_0x3a92a7[_0x26db('0x5c')][_0x26db('0x5d')]);var _0x5805c7=path['join'](config[_0x26db('0x50')],'server/files/sounds/converted',util[_0x26db('0x55')](_0x26db('0x56'),path[_0x26db('0x59')](_0x3a92a7[_0x26db('0x5c')]['filename'],path[_0x26db('0x5b')](_0x3a92a7[_0x26db('0x5c')][_0x26db('0x5d')])),_0x2b01ac[_0x26db('0x52')]));logger['info']('Sound\x20upload\x20filepath:\x20%s',_0x37c727);logger[_0x26db('0x61')](_0x26db('0x62'),_0x5805c7);try{fs[_0x26db('0x63')](_0x37c727,parseInt(_0x26db('0x64'),0x8));var _0x92d65e=sox[_0x26db('0x65')](_0x37c727,_0x5805c7,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x92d65e['on'](_0x26db('0x29'),function(_0x1071da){fs[_0x26db('0x66')](_0x37c727);_0x115410['status'](0x1f4)[_0x26db('0x2c')](_0x1071da);});_0x92d65e['on']('src',function(_0x1e5900){_0x2b01ac[_0x26db('0x67')]=isNaN(_0x1e5900[_0x26db('0x68')])?null:_0x1e5900[_0x26db('0x68')]*0x3e8;_0x2b01ac[_0x26db('0x69')]=isNaN(_0x1e5900['sampleCount'])?null:_0x1e5900[_0x26db('0x6a')];_0x2b01ac[_0x26db('0x6b')]=isNaN(_0x1e5900[_0x26db('0x6c')])?null:_0x1e5900['channelCount'];_0x2b01ac[_0x26db('0x6d')]=isNaN(_0x1e5900[_0x26db('0x6e')])?null:_0x1e5900[_0x26db('0x6e')];_0x2b01ac[_0x26db('0x6f')]=isNaN(_0x1e5900[_0x26db('0x70')])?null:_0x1e5900[_0x26db('0x70')];});_0x92d65e['on'](_0x26db('0x71'),function(_0x599563){_0x2b01ac[_0x26db('0x72')]=isNaN(_0x599563[_0x26db('0x68')])?null:_0x599563[_0x26db('0x68')]*0x3e8;_0x2b01ac[_0x26db('0x73')]=isNaN(_0x599563['sampleCount'])?null:_0x599563[_0x26db('0x6a')];_0x2b01ac[_0x26db('0x74')]=isNaN(_0x599563[_0x26db('0x6c')])?null:_0x599563['channelCount'];_0x2b01ac[_0x26db('0x75')]=isNaN(_0x599563['bitRate'])?null:_0x599563['bitRate'];_0x2b01ac['converted_sampleRate']=isNaN(_0x599563[_0x26db('0x70')])?null:_0x599563[_0x26db('0x70')];});_0x92d65e['on'](_0x26db('0x76'),function(){fs['chmodSync'](_0x5805c7,parseInt(_0x26db('0x64'),0x8));return db[_0x26db('0x2f')]['create'](_0x2b01ac)[_0x26db('0x24')](function(_0x7b208){var _0x2f40f2={'role':_0x3a92a7[_0x26db('0x77')]['role'],'userProfileId':_0x3a92a7[_0x26db('0x77')][_0x26db('0x78')]};if(!_0x2f40f2)throw new Error(_0x26db('0x79'));if(_0x2f40f2[_0x26db('0x7a')]===_0x26db('0x7b')){var _0x1c6616=_0x7b208[_0x26db('0x25')]({'plain':!![]});return db[_0x26db('0x7c')][_0x26db('0x4a')]({'where':{'name':_0x26db('0x26'),'userProfileId':_0x2f40f2[_0x26db('0x78')]},'raw':!![]})[_0x26db('0x24')](function(_0x2fd27c){if(_0x2fd27c&&_0x2fd27c['autoAssociation']===0x0){return db[_0x26db('0x27')]['create']({'name':_0x1c6616[_0x26db('0x2b')],'resourceId':_0x1c6616['id'],'type':_0x2fd27c[_0x26db('0x2b')],'sectionId':_0x2fd27c['id']},{})[_0x26db('0x24')](function(){return _0x7b208;});}else{return _0x7b208;}})[_0x26db('0x57')](function(_0x5e0f0b){logger[_0x26db('0x29')](_0x26db('0x7d'),_0x5e0f0b);throw _0x5e0f0b;});}return _0x7b208;})['then'](respondWithResult(_0x115410,null))[_0x26db('0x57')](handleError(_0x115410,null));});_0x92d65e['start']();}catch(_0x23d453){_0x115410['status'](0x1f4)[_0x26db('0x2c')](_0x23d453);}};exports[_0x26db('0x7e')]=function(_0x1b7888,_0x1f3c57,_0x52de89){return db[_0x26db('0x2f')][_0x26db('0x4a')]({'where':{'id':_0x1b7888[_0x26db('0x4c')]['id']}})[_0x26db('0x24')](handleEntityNotFound(_0x1f3c57,null))['then'](saveUpdates(_[_0x26db('0x7f')](_0x1b7888[_0x26db('0x77')],[_0x26db('0x2b'),_0x26db('0x80')]),null))[_0x26db('0x24')](respondWithResult(_0x1f3c57,null))[_0x26db('0x57')](handleError(_0x1f3c57,null));};exports[_0x26db('0x81')]=function(_0x3cf70f,_0x558285,_0x1fe0c7){return db[_0x26db('0x2f')][_0x26db('0x4a')]({'where':{'id':_0x3cf70f['params']['id']}})[_0x26db('0x24')](function(_0x2a6985){if(_0x2a6985){return _0x2a6985[_0x26db('0x23')]();}})[_0x26db('0x24')](function(_0x4efe1f){var _0x1a21ba=path[_0x26db('0x4f')](config[_0x26db('0x50')],_0x26db('0x60'),util[_0x26db('0x55')](_0x26db('0x56'),_0x4efe1f[_0x26db('0x4d')],_0x4efe1f[_0x26db('0x82')]));var _0x444530=path[_0x26db('0x4f')](config[_0x26db('0x50')],'server/files/sounds/converted',util[_0x26db('0x55')]('%s.%s',_0x4efe1f[_0x26db('0x4d')],_0x4efe1f[_0x26db('0x52')]));fs[_0x26db('0x66')](_0x1a21ba);fs[_0x26db('0x66')](_0x444530);return _0x4efe1f;})['then'](function(_0x557728){if(_0x557728){return _0x558285[_0x26db('0x19')](0xcc)['end']();}})['then'](handleEntityNotFound(_0x558285,null))[_0x26db('0x57')](handleError(_0x558285,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index 12eb5ee..c456769 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 _0xeb47=['path','rimraf','../../config/environment','./sound.attributes','exports','define','Sound','lodash','api','bluebird'];(function(_0x1ab180,_0x382b2c){var _0xfb2c2d=function(_0x1c5fd3){while(--_0x1c5fd3){_0x1ab180['push'](_0x1ab180['shift']());}};_0xfb2c2d(++_0x382b2c);}(_0xeb47,0x7f));var _0x7eb4=function(_0x7aa7f7,_0x152acb){_0x7aa7f7=_0x7aa7f7-0x0;var _0x418266=_0xeb47[_0x7aa7f7];return _0x418266;};'use strict';var _=require(_0x7eb4('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x7eb4('0x1'));var moment=require('moment');var BPromise=require(_0x7eb4('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7eb4('0x3'));var rimraf=require(_0x7eb4('0x4'));var config=require(_0x7eb4('0x5'));var attributes=require(_0x7eb4('0x6'));module[_0x7eb4('0x7')]=function(_0x2479cf,_0x467594){return _0x2479cf[_0x7eb4('0x8')](_0x7eb4('0x9'),attributes,{'tableName':'tools_sounds','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7f46=['../../config/logger','api','moment','bluebird','path','rimraf','./sound.attributes','exports','define','Sound','lodash','util'];(function(_0x1ca61b,_0x115c5b){var _0xb533de=function(_0x2b32e6){while(--_0x2b32e6){_0x1ca61b['push'](_0x1ca61b['shift']());}};_0xb533de(++_0x115c5b);}(_0x7f46,0x8e));var _0x67f4=function(_0x5c7d4b,_0x305110){_0x5c7d4b=_0x5c7d4b-0x0;var _0x422e90=_0x7f46[_0x5c7d4b];return _0x422e90;};'use strict';var _=require(_0x67f4('0x0'));var util=require(_0x67f4('0x1'));var logger=require(_0x67f4('0x2'))(_0x67f4('0x3'));var moment=require(_0x67f4('0x4'));var BPromise=require(_0x67f4('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x67f4('0x6'));var rimraf=require(_0x67f4('0x7'));var config=require('../../config/environment');var attributes=require(_0x67f4('0x8'));module[_0x67f4('0x9')]=function(_0x12e05f,_0xca995){return _0x12e05f[_0x67f4('0xa')](_0x67f4('0xb'),attributes,{'tableName':'tools_sounds','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/sound/sound.rpc.js b/server/api/sound/sound.rpc.js index 65e6af4..24d96a9 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 _0xc8f2=['jayson/promise','client','http','request','info','Sound,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','ShowSound','find','options','raw','where','attributes','map','include','model','then','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0xab0515,_0x4b8ab2){var _0x443d59=function(_0xfd6c59){while(--_0xfd6c59){_0xab0515['push'](_0xab0515['shift']());}};_0x443d59(++_0x4b8ab2);}(_0xc8f2,0x1b7));var _0x2c8f=function(_0x282f1d,_0x3795b1){_0x282f1d=_0x282f1d-0x0;var _0x5ab27b=_0xc8f2[_0x282f1d];return _0x5ab27b;};'use strict';var _=require('lodash');var util=require(_0x2c8f('0x0'));var moment=require('moment');var BPromise=require(_0x2c8f('0x1'));var rs=require(_0x2c8f('0x2'));var fs=require('fs');var Redis=require(_0x2c8f('0x3'));var db=require(_0x2c8f('0x4'))['db'];var utils=require(_0x2c8f('0x5'));var logger=require(_0x2c8f('0x6'))(_0x2c8f('0x7'));var config=require(_0x2c8f('0x8'));var jayson=require(_0x2c8f('0x9'));var client=jayson[_0x2c8f('0xa')][_0x2c8f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x23602f,_0x2aa563,_0x1e77f6){return new BPromise(function(_0x3ac7ce,_0x5bc885){return client[_0x2c8f('0xc')](_0x23602f,_0x1e77f6)['then'](function(_0x25b81a){logger[_0x2c8f('0xd')](_0x2c8f('0xe'),_0x2aa563,_0x2c8f('0xf'));logger[_0x2c8f('0x10')]('Sound,\x20%s,\x20%s,\x20%s',_0x2aa563,_0x2c8f('0xf'),JSON[_0x2c8f('0x11')](_0x25b81a));if(_0x25b81a[_0x2c8f('0x12')]){if(_0x25b81a['error']['code']===0x1f4){logger[_0x2c8f('0x12')](_0x2c8f('0xe'),_0x2aa563,_0x25b81a[_0x2c8f('0x12')]['message']);return _0x5bc885(_0x25b81a[_0x2c8f('0x12')]['message']);}logger['error'](_0x2c8f('0xe'),_0x2aa563,_0x25b81a['error'][_0x2c8f('0x13')]);return _0x3ac7ce(_0x25b81a['error'][_0x2c8f('0x13')]);}else{logger[_0x2c8f('0xd')](_0x2c8f('0xe'),_0x2aa563,'request\x20sent');_0x3ac7ce(_0x25b81a[_0x2c8f('0x14')]['message']);}})[_0x2c8f('0x15')](function(_0xbbbb4c){logger[_0x2c8f('0x12')](_0x2c8f('0xe'),_0x2aa563,_0xbbbb4c);_0x5bc885(_0xbbbb4c);});});}exports[_0x2c8f('0x16')]=function(_0x3c4907){var _0x37dd2e=this;return new Promise(function(_0x4d84a4,_0x5122d3){return db['Sound'][_0x2c8f('0x17')]({'raw':_0x3c4907[_0x2c8f('0x18')]?_0x3c4907[_0x2c8f('0x18')][_0x2c8f('0x19')]===undefined?!![]:![]:!![],'where':_0x3c4907[_0x2c8f('0x18')]?_0x3c4907[_0x2c8f('0x18')][_0x2c8f('0x1a')]||null:null,'attributes':_0x3c4907[_0x2c8f('0x18')]?_0x3c4907[_0x2c8f('0x18')][_0x2c8f('0x1b')]||null:null,'include':_0x3c4907['options']?_0x3c4907[_0x2c8f('0x18')]['include']?_[_0x2c8f('0x1c')](_0x3c4907[_0x2c8f('0x18')][_0x2c8f('0x1d')],function(_0x13ef3b){return{'model':db[_0x13ef3b['model']],'as':_0x13ef3b['as'],'attributes':_0x13ef3b['attributes'],'include':_0x13ef3b[_0x2c8f('0x1d')]?_[_0x2c8f('0x1c')](_0x13ef3b[_0x2c8f('0x1d')],function(_0x3a1454){return{'model':db[_0x3a1454['model']],'as':_0x3a1454['as'],'attributes':_0x3a1454[_0x2c8f('0x1b')],'include':_0x3a1454[_0x2c8f('0x1d')]?_[_0x2c8f('0x1c')](_0x3a1454[_0x2c8f('0x1d')],function(_0x397188){return{'model':db[_0x397188[_0x2c8f('0x1e')]],'as':_0x397188['as'],'attributes':_0x397188['attributes']};}):[]};}):[]};}):[]:[]})[_0x2c8f('0x1f')](function(_0x36300b){logger[_0x2c8f('0xd')]('ShowSound',_0x3c4907);logger['debug']('ShowSound',_0x3c4907,JSON[_0x2c8f('0x11')](_0x36300b));_0x4d84a4(_0x36300b);})[_0x2c8f('0x15')](function(_0x3ca49f){logger[_0x2c8f('0x12')]('ShowSound',_0x3ca49f[_0x2c8f('0x13')],_0x3c4907);_0x5122d3(_0x37dd2e['error'](0x1f4,_0x3ca49f[_0x2c8f('0x13')]));});});}; \ No newline at end of file +var _0xff43=['find','options','raw','attributes','include','model','map','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','request\x20sent','debug','stringify','error','code','Sound,\x20%s,\x20%s','message','result','catch','ShowSound','Sound'];(function(_0x1ad886,_0x1cd92b){var _0xf4d862=function(_0x234425){while(--_0x234425){_0x1ad886['push'](_0x1ad886['shift']());}};_0xf4d862(++_0x1cd92b);}(_0xff43,0x9d));var _0x3ff4=function(_0x4354d4,_0x2063bc){_0x4354d4=_0x4354d4-0x0;var _0x17e862=_0xff43[_0x4354d4];return _0x17e862;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x3ff4('0x0'));var rs=require(_0x3ff4('0x1'));var fs=require('fs');var Redis=require(_0x3ff4('0x2'));var db=require(_0x3ff4('0x3'))['db'];var utils=require(_0x3ff4('0x4'));var logger=require(_0x3ff4('0x5'))(_0x3ff4('0x6'));var config=require(_0x3ff4('0x7'));var jayson=require(_0x3ff4('0x8'));var client=jayson['client'][_0x3ff4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x50b5fc,_0x966035,_0xe7bbbb){return new BPromise(function(_0x1d7791,_0x3134da){return client['request'](_0x50b5fc,_0xe7bbbb)[_0x3ff4('0xa')](function(_0x1be750){logger[_0x3ff4('0xb')]('Sound,\x20%s,\x20%s',_0x966035,_0x3ff4('0xc'));logger[_0x3ff4('0xd')]('Sound,\x20%s,\x20%s,\x20%s',_0x966035,_0x3ff4('0xc'),JSON[_0x3ff4('0xe')](_0x1be750));if(_0x1be750[_0x3ff4('0xf')]){if(_0x1be750['error'][_0x3ff4('0x10')]===0x1f4){logger[_0x3ff4('0xf')](_0x3ff4('0x11'),_0x966035,_0x1be750['error'][_0x3ff4('0x12')]);return _0x3134da(_0x1be750[_0x3ff4('0xf')][_0x3ff4('0x12')]);}logger['error'](_0x3ff4('0x11'),_0x966035,_0x1be750[_0x3ff4('0xf')][_0x3ff4('0x12')]);return _0x1d7791(_0x1be750['error'][_0x3ff4('0x12')]);}else{logger['info'](_0x3ff4('0x11'),_0x966035,_0x3ff4('0xc'));_0x1d7791(_0x1be750[_0x3ff4('0x13')][_0x3ff4('0x12')]);}})[_0x3ff4('0x14')](function(_0x378dcf){logger[_0x3ff4('0xf')](_0x3ff4('0x11'),_0x966035,_0x378dcf);_0x3134da(_0x378dcf);});});}exports[_0x3ff4('0x15')]=function(_0x4e0cb6){var _0x1b81eb=this;return new Promise(function(_0x1ea538,_0x4164bd){return db[_0x3ff4('0x16')][_0x3ff4('0x17')]({'raw':_0x4e0cb6[_0x3ff4('0x18')]?_0x4e0cb6[_0x3ff4('0x18')][_0x3ff4('0x19')]===undefined?!![]:![]:!![],'where':_0x4e0cb6[_0x3ff4('0x18')]?_0x4e0cb6[_0x3ff4('0x18')]['where']||null:null,'attributes':_0x4e0cb6[_0x3ff4('0x18')]?_0x4e0cb6['options'][_0x3ff4('0x1a')]||null:null,'include':_0x4e0cb6[_0x3ff4('0x18')]?_0x4e0cb6[_0x3ff4('0x18')][_0x3ff4('0x1b')]?_['map'](_0x4e0cb6[_0x3ff4('0x18')][_0x3ff4('0x1b')],function(_0x21e8ce){return{'model':db[_0x21e8ce[_0x3ff4('0x1c')]],'as':_0x21e8ce['as'],'attributes':_0x21e8ce[_0x3ff4('0x1a')],'include':_0x21e8ce[_0x3ff4('0x1b')]?_[_0x3ff4('0x1d')](_0x21e8ce['include'],function(_0x2b063a){return{'model':db[_0x2b063a[_0x3ff4('0x1c')]],'as':_0x2b063a['as'],'attributes':_0x2b063a['attributes'],'include':_0x2b063a[_0x3ff4('0x1b')]?_['map'](_0x2b063a[_0x3ff4('0x1b')],function(_0x430158){return{'model':db[_0x430158[_0x3ff4('0x1c')]],'as':_0x430158['as'],'attributes':_0x430158[_0x3ff4('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2ee8ae){logger[_0x3ff4('0xb')](_0x3ff4('0x15'),_0x4e0cb6);logger[_0x3ff4('0xd')](_0x3ff4('0x15'),_0x4e0cb6,JSON[_0x3ff4('0xe')](_0x2ee8ae));_0x1ea538(_0x2ee8ae);})[_0x3ff4('0x14')](function(_0x22e24a){logger[_0x3ff4('0xf')](_0x3ff4('0x15'),_0x22e24a[_0x3ff4('0x12')],_0x4e0cb6);_0x4164bd(_0x1b81eb[_0x3ff4('0xf')](0x1f4,_0x22e24a['message']));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index 32ae5a8..b22d682 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(_0x2633c7,_0x4db8b3){var _0xbb644=function(_0x3b63e0){while(--_0x3b63e0){_0x2633c7['push'](_0x2633c7['shift']());}};_0xbb644(++_0x4db8b3);}(_0x0b0e,0x187));var _0xe0b0=function(_0x38c652,_0x1ea1b7){_0x38c652=_0x38c652-0x0;var _0x218a37=_0x0b0e[_0x38c652];return _0x218a37;};'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 _0xb7e7=['exports','multer','path','express','fs-extra','../../components/interaction/service','../../config/environment','./squareMessage.controller','index','get','/:id','show','post','isAuthenticated','create','put','delete','destroy'];(function(_0x25a655,_0x1ba5b6){var _0x3da605=function(_0xb31e2e){while(--_0xb31e2e){_0x25a655['push'](_0x25a655['shift']());}};_0x3da605(++_0x1ba5b6);}(_0xb7e7,0x121));var _0x7b7e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xb7e7[_0x19e35c];return _0x3e1fe8;};'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('0xb')]('/',auth[_0x7b7e('0xc')](),controller[_0x7b7e('0xd')]);router[_0x7b7e('0xe')](_0x7b7e('0x9'),auth[_0x7b7e('0xc')](),controller['update']);router[_0x7b7e('0xf')](_0x7b7e('0x9'),auth[_0x7b7e('0xc')](),controller[_0x7b7e('0x10')]);module[_0x7b7e('0x11')]=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index 6a1c756..87379e6 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 _0x23c9=['TEXT','medium','ENUM','out','STRING','sequelize','exports'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x23c9,0x1da));var _0x923c=function(_0x578a80,_0x412698){_0x578a80=_0x578a80-0x0;var _0x4b4ba8=_0x23c9[_0x578a80];return _0x4b4ba8;};'use strict';var Sequelize=require(_0x923c('0x0'));module[_0x923c('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'body':{'type':Sequelize[_0x923c('0x2')](_0x923c('0x3')),'allowNull':![]},'direction':{'type':Sequelize[_0x923c('0x4')]('in',_0x923c('0x5')),'defaultValue':_0x923c('0x5'),'allowNull':![]},'providerName':{'type':Sequelize[_0x923c('0x6')]},'providerResponse':{'type':Sequelize[_0x923c('0x2')]}}; \ No newline at end of file +var _0xea35=['out','TEXT','sequelize','exports','STRING','medium','ENUM'];(function(_0x1b6311,_0x42ec20){var _0x25aab6=function(_0x139a77){while(--_0x139a77){_0x1b6311['push'](_0x1b6311['shift']());}};_0x25aab6(++_0x42ec20);}(_0xea35,0x19f));var _0x5ea3=function(_0x3f13fd,_0x1c3910){_0x3f13fd=_0x3f13fd-0x0;var _0x456cf9=_0xea35[_0x3f13fd];return _0x456cf9;};'use strict';var Sequelize=require(_0x5ea3('0x0'));module[_0x5ea3('0x1')]={'uniqueid':{'type':Sequelize[_0x5ea3('0x2')]},'body':{'type':Sequelize['TEXT'](_0x5ea3('0x3')),'allowNull':![]},'direction':{'type':Sequelize[_0x5ea3('0x4')]('in',_0x5ea3('0x5')),'defaultValue':'out','allowNull':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x5ea3('0x6')]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index 61e34d7..8cf303d 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 _0x556a=['model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','rows','catch','params','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','reject','update','then','destroy','stack','name','send','index','map','SquareMessage','rawAttributes','fieldName','key'];(function(_0x2f1762,_0xab43df){var _0x8ab21=function(_0xf6c1f5){while(--_0xf6c1f5){_0x2f1762['push'](_0x2f1762['shift']());}};_0x8ab21(++_0xab43df);}(_0x556a,0x1dd));var _0xa556=function(_0x36be68,_0xf85191){_0x36be68=_0x36be68-0x0;var _0xbfe50c=_0x556a[_0x36be68];return _0xbfe50c;};'use strict';var emlformat=require(_0xa556('0x0'));var rimraf=require(_0xa556('0x1'));var zipdir=require(_0xa556('0x2'));var jsonpatch=require(_0xa556('0x3'));var rp=require(_0xa556('0x4'));var moment=require(_0xa556('0x5'));var BPromise=require(_0xa556('0x6'));var Mustache=require(_0xa556('0x7'));var util=require(_0xa556('0x8'));var path=require('path');var sox=require(_0xa556('0x9'));var csv=require(_0xa556('0xa'));var ejs=require(_0xa556('0xb'));var fs=require('fs');var fs_extra=require(_0xa556('0xc'));var _=require(_0xa556('0xd'));var squel=require('squel');var crypto=require(_0xa556('0xe'));var jsforce=require(_0xa556('0xf'));var deskjs=require(_0xa556('0x10'));var toCsv=require(_0xa556('0xa'));var querystring=require('querystring');var Papa=require(_0xa556('0x11'));var Redis=require(_0xa556('0x12'));var authService=require(_0xa556('0x13'));var qs=require(_0xa556('0x14'));var as=require(_0xa556('0x15'));var hardwareService=require(_0xa556('0x16'));var logger=require(_0xa556('0x17'))(_0xa556('0x18'));var utils=require('../../config/utils');var config=require(_0xa556('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xa556('0x1a'))['db'];function respondWithStatusCode(_0x552788,_0x562211){_0x562211=_0x562211||0xcc;return function(_0x2de803){if(_0x2de803){return _0x552788[_0xa556('0x1b')](_0x562211);}return _0x552788[_0xa556('0x1c')](_0x562211)[_0xa556('0x1d')]();};}function respondWithResult(_0x59b04e,_0x2f20cb){_0x2f20cb=_0x2f20cb||0xc8;return function(_0x10f9bc){if(_0x10f9bc){return _0x59b04e[_0xa556('0x1c')](_0x2f20cb)[_0xa556('0x1e')](_0x10f9bc);}};}function respondWithFilteredResult(_0x1f8b7c,_0x570ed0){return function(_0x5cee6c){if(_0x5cee6c){var _0xbdb988=typeof _0x570ed0[_0xa556('0x1f')]==='undefined'&&typeof _0x570ed0[_0xa556('0x20')]==='undefined';var _0x47b96a=_0x5cee6c[_0xa556('0x21')];var _0x529879=_0xbdb988?0x0:_0x570ed0[_0xa556('0x1f')];var _0x46b205=_0xbdb988?_0x5cee6c[_0xa556('0x21')]:_0x570ed0[_0xa556('0x1f')]+_0x570ed0['limit'];var _0x452e6f;if(_0x46b205>=_0x47b96a){_0x46b205=_0x47b96a;_0x452e6f=0xc8;}else{_0x452e6f=0xce;}_0x1f8b7c[_0xa556('0x1c')](_0x452e6f);return _0x1f8b7c[_0xa556('0x22')]('Content-Range',_0x529879+'-'+_0x46b205+'/'+_0x47b96a)[_0xa556('0x1e')](_0x5cee6c);}return null;};}function patchUpdates(_0x11ab73){return function(_0x5bfa4d){try{jsonpatch['apply'](_0x5bfa4d,_0x11ab73,!![]);}catch(_0x31c8c6){return BPromise[_0xa556('0x23')](_0x31c8c6);}return _0x5bfa4d['save']();};}function saveUpdates(_0x22e9d0,_0x50bc16){return function(_0x22718a){if(_0x22718a){return _0x22718a[_0xa556('0x24')](_0x22e9d0)[_0xa556('0x25')](function(_0x39cae2){return _0x39cae2;});}return null;};}function removeEntity(_0x3e8628,_0xfb4dda){return function(_0x1bcecb){if(_0x1bcecb){return _0x1bcecb[_0xa556('0x26')]()[_0xa556('0x25')](function(){_0x3e8628[_0xa556('0x1c')](0xcc)[_0xa556('0x1d')]();});}};}function handleEntityNotFound(_0xec6fbb,_0x4bf442){return function(_0x2ca8b6){if(!_0x2ca8b6){_0xec6fbb[_0xa556('0x1b')](0x194);}return _0x2ca8b6;};}function handleError(_0x518557,_0x20ec86){_0x20ec86=_0x20ec86||0x1f4;return function(_0x169d01){logger['error'](_0x169d01[_0xa556('0x27')]);if(_0x169d01[_0xa556('0x28')]){delete _0x169d01[_0xa556('0x28')];}_0x518557['status'](_0x20ec86)[_0xa556('0x29')](_0x169d01);};}exports[_0xa556('0x2a')]=function(_0x19f1b8,_0x57da1a){var _0x25dab6={},_0x1f5ce4={},_0x20accc={'count':0x0,'rows':[]};var _0x385fb1=_[_0xa556('0x2b')](db[_0xa556('0x2c')][_0xa556('0x2d')],function(_0x4d0a30){return{'name':_0x4d0a30[_0xa556('0x2e')],'type':_0x4d0a30['type'][_0xa556('0x2f')]};});_0x1f5ce4[_0xa556('0x30')]=_[_0xa556('0x2b')](_0x385fb1,_0xa556('0x28'));_0x1f5ce4[_0xa556('0x31')]=_[_0xa556('0x32')](_0x19f1b8[_0xa556('0x31')]);_0x1f5ce4['filters']=_[_0xa556('0x33')](_0x1f5ce4[_0xa556('0x30')],_0x1f5ce4[_0xa556('0x31')]);_0x25dab6[_0xa556('0x34')]=_[_0xa556('0x33')](_0x1f5ce4[_0xa556('0x30')],qs[_0xa556('0x35')](_0x19f1b8[_0xa556('0x31')][_0xa556('0x35')]));_0x25dab6['attributes']=_0x25dab6[_0xa556('0x34')][_0xa556('0x36')]?_0x25dab6[_0xa556('0x34')]:_0x1f5ce4['model'];if(!_0x19f1b8[_0xa556('0x31')][_0xa556('0x37')](_0xa556('0x38'))){_0x25dab6[_0xa556('0x20')]=qs['limit'](_0x19f1b8[_0xa556('0x31')]['limit']);_0x25dab6[_0xa556('0x1f')]=qs['offset'](_0x19f1b8[_0xa556('0x31')][_0xa556('0x1f')]);}_0x25dab6[_0xa556('0x39')]=qs[_0xa556('0x3a')](_0x19f1b8[_0xa556('0x31')]['sort']);_0x25dab6['where']=qs[_0xa556('0x3b')](_[_0xa556('0x3c')](_0x19f1b8[_0xa556('0x31')],_0x1f5ce4[_0xa556('0x3b')]),_0x385fb1);if(_0x19f1b8[_0xa556('0x31')][_0xa556('0x3d')]){_0x25dab6[_0xa556('0x3e')]=_[_0xa556('0x3f')](_0x25dab6[_0xa556('0x3e')],{'$or':_[_0xa556('0x2b')](_0x385fb1,function(_0x1cd7e0){if(_0x1cd7e0[_0xa556('0x40')]!==_0xa556('0x41')){var _0x3a4d27={};_0x3a4d27[_0x1cd7e0[_0xa556('0x28')]]={'$like':'%'+_0x19f1b8['query'][_0xa556('0x3d')]+'%'};return _0x3a4d27;}})});}_0x25dab6=_[_0xa556('0x3f')]({},_0x25dab6,_0x19f1b8[_0xa556('0x42')]);var _0x2fc959={'where':_0x25dab6['where']};return db[_0xa556('0x2c')][_0xa556('0x21')](_0x2fc959)[_0xa556('0x25')](function(_0x41bc2e){_0x20accc[_0xa556('0x21')]=_0x41bc2e;if(_0x19f1b8['query'][_0xa556('0x43')]){_0x25dab6[_0xa556('0x44')]=[{'all':!![]}];}return db['SquareMessage']['findAll'](_0x25dab6);})[_0xa556('0x25')](function(_0x544579){_0x20accc[_0xa556('0x45')]=_0x544579;return _0x20accc;})['then'](respondWithFilteredResult(_0x57da1a,_0x25dab6))[_0xa556('0x46')](handleError(_0x57da1a,null));};exports['show']=function(_0x483475,_0x48f2dc){var _0x5b405c={'raw':!![],'where':{'id':_0x483475[_0xa556('0x47')]['id']}},_0x3c700e={};_0x3c700e['model']=_[_0xa556('0x32')](db[_0xa556('0x2c')]['rawAttributes']);_0x3c700e['query']=_[_0xa556('0x32')](_0x483475['query']);_0x3c700e['filters']=_['intersection'](_0x3c700e[_0xa556('0x30')],_0x3c700e[_0xa556('0x31')]);_0x5b405c['attributes']=_[_0xa556('0x33')](_0x3c700e[_0xa556('0x30')],qs[_0xa556('0x35')](_0x483475['query']['fields']));_0x5b405c[_0xa556('0x34')]=_0x5b405c[_0xa556('0x34')][_0xa556('0x36')]?_0x5b405c[_0xa556('0x34')]:_0x3c700e[_0xa556('0x30')];if(_0x483475[_0xa556('0x31')]['includeAll']){_0x5b405c['include']=[{'all':!![]}];}_0x5b405c=_['merge']({},_0x5b405c,_0x483475[_0xa556('0x42')]);return db[_0xa556('0x2c')]['find'](_0x5b405c)[_0xa556('0x25')](handleEntityNotFound(_0x48f2dc,null))['then'](respondWithResult(_0x48f2dc,null))[_0xa556('0x46')](handleError(_0x48f2dc,null));};exports[_0xa556('0x48')]=function(_0x213c4d,_0x3cd157){return db['SquareMessage'][_0xa556('0x48')](_0x213c4d[_0xa556('0x49')],{})[_0xa556('0x25')](respondWithResult(_0x3cd157,0xc9))[_0xa556('0x46')](handleError(_0x3cd157,null));};exports[_0xa556('0x24')]=function(_0x64781a,_0x41171c){if(_0x64781a['body']['id']){delete _0x64781a[_0xa556('0x49')]['id'];}return db[_0xa556('0x2c')]['find']({'where':{'id':_0x64781a[_0xa556('0x47')]['id']}})[_0xa556('0x25')](handleEntityNotFound(_0x41171c,null))[_0xa556('0x25')](saveUpdates(_0x64781a['body'],null))[_0xa556('0x25')](respondWithResult(_0x41171c,null))[_0xa556('0x46')](handleError(_0x41171c,null));};exports[_0xa556('0x26')]=function(_0x1256a6,_0x1536eb){return db[_0xa556('0x2c')][_0xa556('0x4a')]({'where':{'id':_0x1256a6[_0xa556('0x47')]['id']}})[_0xa556('0x25')](handleEntityNotFound(_0x1536eb,null))[_0xa556('0x25')](removeEntity(_0x1536eb,null))['catch'](handleError(_0x1536eb,null));}; \ No newline at end of file +var _0x5ab9=['create','body','params','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','fs-extra','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','end','status','offset','limit','undefined','count','Content-Range','json','reject','update','destroy','then','name','index','map','SquareMessage','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','rawAttributes','options','find'];(function(_0x399095,_0x133dae){var _0x40a046=function(_0x1e6803){while(--_0x1e6803){_0x399095['push'](_0x399095['shift']());}};_0x40a046(++_0x133dae);}(_0x5ab9,0x117));var _0x95ab=function(_0x4f3e33,_0x5704a8){_0x4f3e33=_0x4f3e33-0x0;var _0x1a070c=_0x5ab9[_0x4f3e33];return _0x1a070c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x95ab('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x95ab('0x1'));var rp=require(_0x95ab('0x2'));var moment=require(_0x95ab('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x95ab('0x4'));var util=require(_0x95ab('0x5'));var path=require('path');var sox=require(_0x95ab('0x6'));var csv=require('to-csv');var ejs=require(_0x95ab('0x7'));var fs=require('fs');var fs_extra=require(_0x95ab('0x8'));var _=require('lodash');var squel=require(_0x95ab('0x9'));var crypto=require('crypto');var jsforce=require(_0x95ab('0xa'));var deskjs=require(_0x95ab('0xb'));var toCsv=require(_0x95ab('0xc'));var querystring=require(_0x95ab('0xd'));var Papa=require(_0x95ab('0xe'));var Redis=require(_0x95ab('0xf'));var authService=require(_0x95ab('0x10'));var qs=require(_0x95ab('0x11'));var as=require(_0x95ab('0x12'));var hardwareService=require(_0x95ab('0x13'));var logger=require(_0x95ab('0x14'))(_0x95ab('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x95ab('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1053d3,_0x35515a){_0x35515a=_0x35515a||0xcc;return function(_0x2e2e99){if(_0x2e2e99){return _0x1053d3['sendStatus'](_0x35515a);}return _0x1053d3['status'](_0x35515a)[_0x95ab('0x17')]();};}function respondWithResult(_0x3bbd05,_0x427889){_0x427889=_0x427889||0xc8;return function(_0x2b1d19){if(_0x2b1d19){return _0x3bbd05[_0x95ab('0x18')](_0x427889)['json'](_0x2b1d19);}};}function respondWithFilteredResult(_0x308cdf,_0x8743ad){return function(_0x27e1a3){if(_0x27e1a3){var _0x3fd3d2=typeof _0x8743ad[_0x95ab('0x19')]==='undefined'&&typeof _0x8743ad[_0x95ab('0x1a')]===_0x95ab('0x1b');var _0x4b7ffd=_0x27e1a3[_0x95ab('0x1c')];var _0x1889da=_0x3fd3d2?0x0:_0x8743ad[_0x95ab('0x19')];var _0x137646=_0x3fd3d2?_0x27e1a3[_0x95ab('0x1c')]:_0x8743ad[_0x95ab('0x19')]+_0x8743ad[_0x95ab('0x1a')];var _0x2ce167;if(_0x137646>=_0x4b7ffd){_0x137646=_0x4b7ffd;_0x2ce167=0xc8;}else{_0x2ce167=0xce;}_0x308cdf['status'](_0x2ce167);return _0x308cdf['set'](_0x95ab('0x1d'),_0x1889da+'-'+_0x137646+'/'+_0x4b7ffd)[_0x95ab('0x1e')](_0x27e1a3);}return null;};}function patchUpdates(_0x3446b4){return function(_0xb1885e){try{jsonpatch['apply'](_0xb1885e,_0x3446b4,!![]);}catch(_0x4e5b9b){return BPromise[_0x95ab('0x1f')](_0x4e5b9b);}return _0xb1885e['save']();};}function saveUpdates(_0x50e6ce,_0x3cd351){return function(_0x3eb073){if(_0x3eb073){return _0x3eb073[_0x95ab('0x20')](_0x50e6ce)['then'](function(_0x5ebcc8){return _0x5ebcc8;});}return null;};}function removeEntity(_0x2d71f8,_0x11e92d){return function(_0x37aaea){if(_0x37aaea){return _0x37aaea[_0x95ab('0x21')]()[_0x95ab('0x22')](function(){_0x2d71f8[_0x95ab('0x18')](0xcc)[_0x95ab('0x17')]();});}};}function handleEntityNotFound(_0x46309d,_0x31f4c1){return function(_0x5cb9be){if(!_0x5cb9be){_0x46309d['sendStatus'](0x194);}return _0x5cb9be;};}function handleError(_0xd28b4f,_0x2cdc52){_0x2cdc52=_0x2cdc52||0x1f4;return function(_0x58231c){logger['error'](_0x58231c['stack']);if(_0x58231c[_0x95ab('0x23')]){delete _0x58231c[_0x95ab('0x23')];}_0xd28b4f[_0x95ab('0x18')](_0x2cdc52)['send'](_0x58231c);};}exports[_0x95ab('0x24')]=function(_0x395516,_0x1fcd49){var _0x9e7f4d={},_0x1f5ee8={},_0xd0bc7={'count':0x0,'rows':[]};var _0x56b4e3=_[_0x95ab('0x25')](db[_0x95ab('0x26')]['rawAttributes'],function(_0x9965d3){return{'name':_0x9965d3[_0x95ab('0x27')],'type':_0x9965d3[_0x95ab('0x28')]['key']};});_0x1f5ee8[_0x95ab('0x29')]=_[_0x95ab('0x25')](_0x56b4e3,_0x95ab('0x23'));_0x1f5ee8[_0x95ab('0x2a')]=_[_0x95ab('0x2b')](_0x395516[_0x95ab('0x2a')]);_0x1f5ee8['filters']=_[_0x95ab('0x2c')](_0x1f5ee8[_0x95ab('0x29')],_0x1f5ee8[_0x95ab('0x2a')]);_0x9e7f4d[_0x95ab('0x2d')]=_[_0x95ab('0x2c')](_0x1f5ee8[_0x95ab('0x29')],qs[_0x95ab('0x2e')](_0x395516[_0x95ab('0x2a')][_0x95ab('0x2e')]));_0x9e7f4d[_0x95ab('0x2d')]=_0x9e7f4d[_0x95ab('0x2d')][_0x95ab('0x2f')]?_0x9e7f4d[_0x95ab('0x2d')]:_0x1f5ee8[_0x95ab('0x29')];if(!_0x395516[_0x95ab('0x2a')][_0x95ab('0x30')](_0x95ab('0x31'))){_0x9e7f4d[_0x95ab('0x1a')]=qs[_0x95ab('0x1a')](_0x395516['query'][_0x95ab('0x1a')]);_0x9e7f4d[_0x95ab('0x19')]=qs[_0x95ab('0x19')](_0x395516[_0x95ab('0x2a')][_0x95ab('0x19')]);}_0x9e7f4d[_0x95ab('0x32')]=qs[_0x95ab('0x33')](_0x395516[_0x95ab('0x2a')][_0x95ab('0x33')]);_0x9e7f4d[_0x95ab('0x34')]=qs[_0x95ab('0x35')](_[_0x95ab('0x36')](_0x395516[_0x95ab('0x2a')],_0x1f5ee8[_0x95ab('0x35')]),_0x56b4e3);if(_0x395516[_0x95ab('0x2a')][_0x95ab('0x37')]){_0x9e7f4d['where']=_['merge'](_0x9e7f4d['where'],{'$or':_[_0x95ab('0x25')](_0x56b4e3,function(_0x18eda3){if(_0x18eda3[_0x95ab('0x28')]!==_0x95ab('0x38')){var _0x285696={};_0x285696[_0x18eda3['name']]={'$like':'%'+_0x395516[_0x95ab('0x2a')][_0x95ab('0x37')]+'%'};return _0x285696;}})});}_0x9e7f4d=_[_0x95ab('0x39')]({},_0x9e7f4d,_0x395516['options']);var _0xba40f9={'where':_0x9e7f4d['where']};return db[_0x95ab('0x26')][_0x95ab('0x1c')](_0xba40f9)[_0x95ab('0x22')](function(_0x13612b){_0xd0bc7[_0x95ab('0x1c')]=_0x13612b;if(_0x395516[_0x95ab('0x2a')][_0x95ab('0x3a')]){_0x9e7f4d[_0x95ab('0x3b')]=[{'all':!![]}];}return db['SquareMessage'][_0x95ab('0x3c')](_0x9e7f4d);})[_0x95ab('0x22')](function(_0x18af01){_0xd0bc7[_0x95ab('0x3d')]=_0x18af01;return _0xd0bc7;})[_0x95ab('0x22')](respondWithFilteredResult(_0x1fcd49,_0x9e7f4d))[_0x95ab('0x3e')](handleError(_0x1fcd49,null));};exports['show']=function(_0x26c872,_0x3198e1){var _0x996f5={'raw':!![],'where':{'id':_0x26c872['params']['id']}},_0x2b9d8e={};_0x2b9d8e[_0x95ab('0x29')]=_[_0x95ab('0x2b')](db[_0x95ab('0x26')][_0x95ab('0x3f')]);_0x2b9d8e[_0x95ab('0x2a')]=_['keys'](_0x26c872['query']);_0x2b9d8e[_0x95ab('0x35')]=_['intersection'](_0x2b9d8e['model'],_0x2b9d8e[_0x95ab('0x2a')]);_0x996f5[_0x95ab('0x2d')]=_[_0x95ab('0x2c')](_0x2b9d8e[_0x95ab('0x29')],qs['fields'](_0x26c872[_0x95ab('0x2a')][_0x95ab('0x2e')]));_0x996f5[_0x95ab('0x2d')]=_0x996f5[_0x95ab('0x2d')]['length']?_0x996f5[_0x95ab('0x2d')]:_0x2b9d8e['model'];if(_0x26c872[_0x95ab('0x2a')][_0x95ab('0x3a')]){_0x996f5['include']=[{'all':!![]}];}_0x996f5=_[_0x95ab('0x39')]({},_0x996f5,_0x26c872[_0x95ab('0x40')]);return db[_0x95ab('0x26')][_0x95ab('0x41')](_0x996f5)[_0x95ab('0x22')](handleEntityNotFound(_0x3198e1,null))[_0x95ab('0x22')](respondWithResult(_0x3198e1,null))[_0x95ab('0x3e')](handleError(_0x3198e1,null));};exports[_0x95ab('0x42')]=function(_0x2238ee,_0x254d16){return db[_0x95ab('0x26')][_0x95ab('0x42')](_0x2238ee[_0x95ab('0x43')],{})[_0x95ab('0x22')](respondWithResult(_0x254d16,0xc9))['catch'](handleError(_0x254d16,null));};exports[_0x95ab('0x20')]=function(_0x5296a3,_0x38e3f5){if(_0x5296a3[_0x95ab('0x43')]['id']){delete _0x5296a3[_0x95ab('0x43')]['id'];}return db[_0x95ab('0x26')][_0x95ab('0x41')]({'where':{'id':_0x5296a3[_0x95ab('0x44')]['id']}})[_0x95ab('0x22')](handleEntityNotFound(_0x38e3f5,null))[_0x95ab('0x22')](saveUpdates(_0x5296a3['body'],null))['then'](respondWithResult(_0x38e3f5,null))['catch'](handleError(_0x38e3f5,null));};exports[_0x95ab('0x21')]=function(_0x21b0c6,_0x1c0aa8){return db[_0x95ab('0x26')]['find']({'where':{'id':_0x21b0c6[_0x95ab('0x44')]['id']}})[_0x95ab('0x22')](handleEntityNotFound(_0x1c0aa8,null))['then'](removeEntity(_0x1c0aa8,null))['catch'](handleError(_0x1c0aa8,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index 29be95f..a7b6819 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 _0x8f9b=['bluebird','path','rimraf','./squareMessage.attributes','exports','define','SquareMessage','lodash','util','api','moment'];(function(_0x137f8a,_0x3ac8f8){var _0x35baa8=function(_0x28ef45){while(--_0x28ef45){_0x137f8a['push'](_0x137f8a['shift']());}};_0x35baa8(++_0x3ac8f8);}(_0x8f9b,0xac));var _0xb8f9=function(_0x524461,_0x575f9d){_0x524461=_0x524461-0x0;var _0x1a1d91=_0x8f9b[_0x524461];return _0x1a1d91;};'use strict';var _=require(_0xb8f9('0x0'));var util=require(_0xb8f9('0x1'));var logger=require('../../config/logger')(_0xb8f9('0x2'));var moment=require(_0xb8f9('0x3'));var BPromise=require(_0xb8f9('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb8f9('0x5'));var rimraf=require(_0xb8f9('0x6'));var config=require('../../config/environment');var attributes=require(_0xb8f9('0x7'));module[_0xb8f9('0x8')]=function(_0x179a71,_0x2d5b48){return _0x179a71[_0xb8f9('0x9')](_0xb8f9('0xa'),attributes,{'tableName':'square_messages','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x42c0=['moment','rimraf','../../config/environment','define','SquareMessage','square_messages','lodash','util','../../config/logger'];(function(_0x34f456,_0x271849){var _0x589f55=function(_0x32e03d){while(--_0x32e03d){_0x34f456['push'](_0x34f456['shift']());}};_0x589f55(++_0x271849);}(_0x42c0,0x72));var _0x042c=function(_0x3070dc,_0x40cf11){_0x3070dc=_0x3070dc-0x0;var _0x431489=_0x42c0[_0x3070dc];return _0x431489;};'use strict';var _=require(_0x042c('0x0'));var util=require(_0x042c('0x1'));var logger=require(_0x042c('0x2'))('api');var moment=require(_0x042c('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x042c('0x4'));var config=require(_0x042c('0x5'));var attributes=require('./squareMessage.attributes');module['exports']=function(_0x563d9e,_0x457ec9){return _0x563d9e[_0x042c('0x6')](_0x042c('0x7'),attributes,{'tableName':_0x042c('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.rpc.js b/server/api/squareMessage/squareMessage.rpc.js index c0d306f..5d94eb2 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 _0x41f1=['result','CreateSquareMessage','SquareMessage','raw','then','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request','info','SquareMessage,\x20%s,\x20%s','SquareMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message'];(function(_0x49d41c,_0x2bdc35){var _0xb64c5f=function(_0x28f535){while(--_0x28f535){_0x49d41c['push'](_0x49d41c['shift']());}};_0xb64c5f(++_0x2bdc35);}(_0x41f1,0x126));var _0x141f=function(_0x73c130,_0x5f532f){_0x73c130=_0x73c130-0x0;var _0x3bd9b4=_0x41f1[_0x73c130];return _0x3bd9b4;};'use strict';var _=require(_0x141f('0x0'));var util=require(_0x141f('0x1'));var moment=require(_0x141f('0x2'));var BPromise=require(_0x141f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x141f('0x4'));var db=require(_0x141f('0x5'))['db'];var utils=require(_0x141f('0x6'));var logger=require('../../config/logger')(_0x141f('0x7'));var config=require(_0x141f('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x141f('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xba4c62,_0x2746f2,_0x3b44ef){return new BPromise(function(_0x461ca8,_0x5dc415){return client[_0x141f('0xa')](_0xba4c62,_0x3b44ef)['then'](function(_0x2b856f){logger[_0x141f('0xb')](_0x141f('0xc'),_0x2746f2,'request\x20sent');logger['debug'](_0x141f('0xd'),_0x2746f2,_0x141f('0xe'),JSON[_0x141f('0xf')](_0x2b856f));if(_0x2b856f['error']){if(_0x2b856f['error']['code']===0x1f4){logger['error'](_0x141f('0xc'),_0x2746f2,_0x2b856f[_0x141f('0x10')][_0x141f('0x11')]);return _0x5dc415(_0x2b856f['error'][_0x141f('0x11')]);}logger[_0x141f('0x10')](_0x141f('0xc'),_0x2746f2,_0x2b856f[_0x141f('0x10')][_0x141f('0x11')]);return _0x461ca8(_0x2b856f[_0x141f('0x10')][_0x141f('0x11')]);}else{logger[_0x141f('0xb')](_0x141f('0xc'),_0x2746f2,_0x141f('0xe'));_0x461ca8(_0x2b856f[_0x141f('0x12')][_0x141f('0x11')]);}})['catch'](function(_0x51b335){logger[_0x141f('0x10')](_0x141f('0xc'),_0x2746f2,_0x51b335);_0x5dc415(_0x51b335);});});}exports[_0x141f('0x13')]=function(_0x5df63f){var _0x431e8a=this;return new Promise(function(_0x583932,_0x293fc9){return db[_0x141f('0x14')]['create'](_0x5df63f['body'],{'raw':_0x5df63f['options']?_0x5df63f['options'][_0x141f('0x15')]===undefined?!![]:![]:!![]})[_0x141f('0x16')](function(_0x4b31d9){logger['info'](_0x141f('0x13'),_0x5df63f);logger['debug'](_0x141f('0x13'),_0x5df63f,JSON[_0x141f('0xf')](_0x4b31d9));_0x583932(_0x4b31d9);})[_0x141f('0x17')](function(_0x9e9ab1){logger[_0x141f('0x10')](_0x141f('0x13'),_0x9e9ab1[_0x141f('0x11')],_0x5df63f);_0x293fc9(_0x431e8a['error'](0x1f4,_0x9e9ab1['message']));});});}; \ No newline at end of file +var _0x1e97=['result','catch','create','body','options','raw','CreateSquareMessage','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','then','info','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x363816,_0xc20c5a){var _0x368201=function(_0x57dae1){while(--_0x57dae1){_0x363816['push'](_0x363816['shift']());}};_0x368201(++_0xc20c5a);}(_0x1e97,0x1b7));var _0x71e9=function(_0x2f073b,_0x20d7fb){_0x2f073b=_0x2f073b-0x0;var _0x50e646=_0x1e97[_0x2f073b];return _0x50e646;};'use strict';var _=require(_0x71e9('0x0'));var util=require('util');var moment=require(_0x71e9('0x1'));var BPromise=require('bluebird');var rs=require(_0x71e9('0x2'));var fs=require('fs');var Redis=require(_0x71e9('0x3'));var db=require(_0x71e9('0x4'))['db'];var utils=require(_0x71e9('0x5'));var logger=require(_0x71e9('0x6'))(_0x71e9('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x71e9('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1cfb0a,_0x29671f,_0x51a1cc){return new BPromise(function(_0x36e35c,_0x2c7823){return client[_0x71e9('0x9')](_0x1cfb0a,_0x51a1cc)[_0x71e9('0xa')](function(_0x42fe20){logger[_0x71e9('0xb')](_0x71e9('0xc'),_0x29671f,_0x71e9('0xd'));logger[_0x71e9('0xe')](_0x71e9('0xf'),_0x29671f,_0x71e9('0xd'),JSON[_0x71e9('0x10')](_0x42fe20));if(_0x42fe20[_0x71e9('0x11')]){if(_0x42fe20[_0x71e9('0x11')][_0x71e9('0x12')]===0x1f4){logger[_0x71e9('0x11')](_0x71e9('0xc'),_0x29671f,_0x42fe20[_0x71e9('0x11')][_0x71e9('0x13')]);return _0x2c7823(_0x42fe20[_0x71e9('0x11')][_0x71e9('0x13')]);}logger['error'](_0x71e9('0xc'),_0x29671f,_0x42fe20['error'][_0x71e9('0x13')]);return _0x36e35c(_0x42fe20[_0x71e9('0x11')][_0x71e9('0x13')]);}else{logger[_0x71e9('0xb')]('SquareMessage,\x20%s,\x20%s',_0x29671f,_0x71e9('0xd'));_0x36e35c(_0x42fe20[_0x71e9('0x14')][_0x71e9('0x13')]);}})[_0x71e9('0x15')](function(_0x4b44fd){logger[_0x71e9('0x11')](_0x71e9('0xc'),_0x29671f,_0x4b44fd);_0x2c7823(_0x4b44fd);});});}exports['CreateSquareMessage']=function(_0xe7e69c){var _0x1d15e4=this;return new Promise(function(_0x1539c9,_0x3cada8){return db['SquareMessage'][_0x71e9('0x16')](_0xe7e69c[_0x71e9('0x17')],{'raw':_0xe7e69c['options']?_0xe7e69c[_0x71e9('0x18')][_0x71e9('0x19')]===undefined?!![]:![]:!![]})[_0x71e9('0xa')](function(_0x5c52cd){logger[_0x71e9('0xb')]('CreateSquareMessage',_0xe7e69c);logger[_0x71e9('0xe')](_0x71e9('0x1a'),_0xe7e69c,JSON['stringify'](_0x5c52cd));_0x1539c9(_0x5c52cd);})[_0x71e9('0x15')](function(_0x56c019){logger[_0x71e9('0x11')]('CreateSquareMessage',_0x56c019[_0x71e9('0x13')],_0xe7e69c);_0x3cada8(_0x1d15e4[_0x71e9('0x11')](0x1f4,_0x56c019[_0x71e9('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index 186ddc6..52294a2 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 _0xe64c=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller','isAuthenticated','/:id','show','get','/:id/test','15s','test','post','create','put','update','delete','destroy','exports','multer'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe64c,0x167));var _0xce64=function(_0x41b3b9,_0x3b1b25){_0x41b3b9=_0x41b3b9-0x0;var _0x132313=_0xe64c[_0x41b3b9];return _0x132313;};'use strict';var multer=require(_0xce64('0x0'));var util=require(_0xce64('0x1'));var path=require('path');var timeout=require(_0xce64('0x2'));var express=require(_0xce64('0x3'));var router=express[_0xce64('0x4')]();var fs_extra=require(_0xce64('0x5'));var auth=require(_0xce64('0x6'));var interaction=require(_0xce64('0x7'));var config=require(_0xce64('0x8'));var controller=require(_0xce64('0x9'));router['get']('/',auth[_0xce64('0xa')](),controller['index']);router['get'](_0xce64('0xb'),auth[_0xce64('0xa')](),controller[_0xce64('0xc')]);router[_0xce64('0xd')](_0xce64('0xe'),auth[_0xce64('0xa')](),timeout(_0xce64('0xf')),controller[_0xce64('0x10')]);router[_0xce64('0x11')]('/',auth[_0xce64('0xa')](),controller[_0xce64('0x12')]);router[_0xce64('0x13')](_0xce64('0xb'),auth[_0xce64('0xa')](),controller[_0xce64('0x14')]);router[_0xce64('0x15')](_0xce64('0xb'),auth['isAuthenticated'](),controller[_0xce64('0x16')]);module[_0xce64('0x17')]=router; \ No newline at end of file +var _0x1586=['/:id','isAuthenticated','show','15s','test','post','put','update','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','index'];(function(_0xc0bc7f,_0x51678d){var _0x5a5597=function(_0x3c05a3){while(--_0x3c05a3){_0xc0bc7f['push'](_0xc0bc7f['shift']());}};_0x5a5597(++_0x51678d);}(_0x1586,0x1ae));var _0x6158=function(_0x179039,_0x1fb713){_0x179039=_0x179039-0x0;var _0xeb427=_0x1586[_0x179039];return _0xeb427;};'use strict';var multer=require('multer');var util=require(_0x6158('0x0'));var path=require(_0x6158('0x1'));var timeout=require(_0x6158('0x2'));var express=require(_0x6158('0x3'));var router=express['Router']();var fs_extra=require(_0x6158('0x4'));var auth=require(_0x6158('0x5'));var interaction=require(_0x6158('0x6'));var config=require(_0x6158('0x7'));var controller=require(_0x6158('0x8'));router[_0x6158('0x9')]('/',auth['isAuthenticated'](),controller[_0x6158('0xa')]);router['get'](_0x6158('0xb'),auth[_0x6158('0xc')](),controller[_0x6158('0xd')]);router[_0x6158('0x9')]('/:id/test',auth[_0x6158('0xc')](),timeout(_0x6158('0xe')),controller[_0x6158('0xf')]);router[_0x6158('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0x6158('0x11')](_0x6158('0xb'),auth['isAuthenticated'](),controller[_0x6158('0x12')]);router['delete'](_0x6158('0xb'),auth['isAuthenticated'](),controller[_0x6158('0x13')]);module[_0x6158('0x14')]=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index 1e83960..e17c4c8 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 _0xc5af=['STRING','exports','name'];(function(_0x2378b3,_0x53dc09){var _0x2e2fcc=function(_0xf3d2e9){while(--_0xf3d2e9){_0x2378b3['push'](_0x2378b3['shift']());}};_0x2e2fcc(++_0x53dc09);}(_0xc5af,0x190));var _0xfc5a=function(_0x4c9ad2,_0x3bb687){_0x4c9ad2=_0x4c9ad2-0x0;var _0x507886=_0xc5af[_0x4c9ad2];return _0x507886;};'use strict';var Sequelize=require('sequelize');module[_0xfc5a('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0xfc5a('0x1'),'allowNull':![]},'dsn':{'type':Sequelize[_0xfc5a('0x2')]},'description':{'type':Sequelize[_0xfc5a('0x2')]}}; \ No newline at end of file +var _0xc771=['name','sequelize','exports','STRING'];(function(_0x2b8096,_0x2e5c5d){var _0xd8449e=function(_0x1d3f23){while(--_0x1d3f23){_0x2b8096['push'](_0x2b8096['shift']());}};_0xd8449e(++_0x2e5c5d);}(_0xc771,0xd1));var _0x1c77=function(_0x21f7bc,_0x36d038){_0x21f7bc=_0x21f7bc-0x0;var _0x55d33d=_0xc771[_0x21f7bc];return _0x55d33d;};'use strict';var Sequelize=require(_0x1c77('0x0'));module[_0x1c77('0x1')]={'name':{'type':Sequelize[_0x1c77('0x2')],'unique':_0x1c77('0x3'),'allowNull':![]},'dsn':{'type':Sequelize[_0x1c77('0x2')]},'description':{'type':Sequelize[_0x1c77('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index efda422..786eef2 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 _0xf5ab=['query','keys','intersection','fields','attributes','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','test','openSync','dsn','closeSync','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','save','update','then','destroy','get','ODBC','UserProfileResource','error','stack','send','index','map','SquareOdbc','rawAttributes','fieldName','type','key','model','name'];(function(_0x1f9460,_0x12ac77){var _0x37d2f0=function(_0x2c016b){while(--_0x2c016b){_0x1f9460['push'](_0x1f9460['shift']());}};_0x37d2f0(++_0x12ac77);}(_0xf5ab,0xd7));var _0xbf5a=function(_0x76bfba,_0xa1469b){_0x76bfba=_0x76bfba-0x0;var _0x508ec2=_0xf5ab[_0x76bfba];return _0x508ec2;};'use strict';var emlformat=require(_0xbf5a('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xbf5a('0x1'));var rp=require(_0xbf5a('0x2'));var moment=require(_0xbf5a('0x3'));var BPromise=require(_0xbf5a('0x4'));var Mustache=require(_0xbf5a('0x5'));var util=require(_0xbf5a('0x6'));var path=require(_0xbf5a('0x7'));var sox=require(_0xbf5a('0x8'));var csv=require(_0xbf5a('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbf5a('0xa'));var _=require(_0xbf5a('0xb'));var squel=require(_0xbf5a('0xc'));var crypto=require(_0xbf5a('0xd'));var jsforce=require(_0xbf5a('0xe'));var deskjs=require(_0xbf5a('0xf'));var toCsv=require(_0xbf5a('0x9'));var querystring=require('querystring');var Papa=require(_0xbf5a('0x10'));var Redis=require(_0xbf5a('0x11'));var authService=require(_0xbf5a('0x12'));var qs=require(_0xbf5a('0x13'));var as=require(_0xbf5a('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbf5a('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xbf5a('0x16'));var licenseUtil=require(_0xbf5a('0x17'));var db=require(_0xbf5a('0x18'))['db'];function respondWithStatusCode(_0x168149,_0x272e8a){_0x272e8a=_0x272e8a||0xcc;return function(_0x3a3d88){if(_0x3a3d88){return _0x168149[_0xbf5a('0x19')](_0x272e8a);}return _0x168149[_0xbf5a('0x1a')](_0x272e8a)[_0xbf5a('0x1b')]();};}function respondWithResult(_0x10261d,_0x353d54){_0x353d54=_0x353d54||0xc8;return function(_0x4b0138){if(_0x4b0138){return _0x10261d[_0xbf5a('0x1a')](_0x353d54)[_0xbf5a('0x1c')](_0x4b0138);}};}function respondWithFilteredResult(_0x35de67,_0x3c12c2){return function(_0x21330e){if(_0x21330e){var _0x1d320b=typeof _0x3c12c2[_0xbf5a('0x1d')]==='undefined'&&typeof _0x3c12c2['limit']===_0xbf5a('0x1e');var _0x46720c=_0x21330e[_0xbf5a('0x1f')];var _0x68d064=_0x1d320b?0x0:_0x3c12c2['offset'];var _0x234740=_0x1d320b?_0x21330e[_0xbf5a('0x1f')]:_0x3c12c2[_0xbf5a('0x1d')]+_0x3c12c2[_0xbf5a('0x20')];var _0x4ad789;if(_0x234740>=_0x46720c){_0x234740=_0x46720c;_0x4ad789=0xc8;}else{_0x4ad789=0xce;}_0x35de67['status'](_0x4ad789);return _0x35de67[_0xbf5a('0x21')]('Content-Range',_0x68d064+'-'+_0x234740+'/'+_0x46720c)[_0xbf5a('0x1c')](_0x21330e);}return null;};}function patchUpdates(_0x54f809){return function(_0x4ba7d6){try{jsonpatch[_0xbf5a('0x22')](_0x4ba7d6,_0x54f809,!![]);}catch(_0x14297c){return BPromise[_0xbf5a('0x23')](_0x14297c);}return _0x4ba7d6[_0xbf5a('0x24')]();};}function saveUpdates(_0x415cb3,_0x3eaa46){return function(_0x47aa24){if(_0x47aa24){return _0x47aa24[_0xbf5a('0x25')](_0x415cb3)[_0xbf5a('0x26')](function(_0x35995b){return _0x35995b;});}return null;};}function removeEntity(_0x2426a6,_0x2ae135){return function(_0x2d5fbd){if(_0x2d5fbd){return _0x2d5fbd[_0xbf5a('0x27')]()['then'](function(){var _0x525ec5=_0x2d5fbd[_0xbf5a('0x28')]({'plain':!![]});var _0x3be280=_0xbf5a('0x29');return db[_0xbf5a('0x2a')][_0xbf5a('0x27')]({'where':{'type':_0x3be280,'resourceId':_0x525ec5['id']}})[_0xbf5a('0x26')](function(){return _0x2d5fbd;});})['then'](function(){_0x2426a6[_0xbf5a('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0xffb555,_0x406a64){return function(_0x24960c){if(!_0x24960c){_0xffb555[_0xbf5a('0x19')](0x194);}return _0x24960c;};}function handleError(_0x983150,_0x48fa95){_0x48fa95=_0x48fa95||0x1f4;return function(_0x49d42a){logger[_0xbf5a('0x2b')](_0x49d42a[_0xbf5a('0x2c')]);if(_0x49d42a['name']){delete _0x49d42a['name'];}_0x983150['status'](_0x48fa95)[_0xbf5a('0x2d')](_0x49d42a);};}exports[_0xbf5a('0x2e')]=function(_0x1c60cf,_0xc8c2c3){var _0x27e69b={},_0x430375={},_0x445fb4={'count':0x0,'rows':[]};var _0x2e0108=_[_0xbf5a('0x2f')](db[_0xbf5a('0x30')][_0xbf5a('0x31')],function(_0x437616){return{'name':_0x437616[_0xbf5a('0x32')],'type':_0x437616[_0xbf5a('0x33')][_0xbf5a('0x34')]};});_0x430375[_0xbf5a('0x35')]=_[_0xbf5a('0x2f')](_0x2e0108,_0xbf5a('0x36'));_0x430375[_0xbf5a('0x37')]=_[_0xbf5a('0x38')](_0x1c60cf[_0xbf5a('0x37')]);_0x430375['filters']=_[_0xbf5a('0x39')](_0x430375[_0xbf5a('0x35')],_0x430375[_0xbf5a('0x37')]);_0x27e69b['attributes']=_[_0xbf5a('0x39')](_0x430375[_0xbf5a('0x35')],qs['fields'](_0x1c60cf[_0xbf5a('0x37')][_0xbf5a('0x3a')]));_0x27e69b[_0xbf5a('0x3b')]=_0x27e69b[_0xbf5a('0x3b')][_0xbf5a('0x3c')]?_0x27e69b[_0xbf5a('0x3b')]:_0x430375[_0xbf5a('0x35')];if(!_0x1c60cf[_0xbf5a('0x37')]['hasOwnProperty'](_0xbf5a('0x3d'))){_0x27e69b['limit']=qs[_0xbf5a('0x20')](_0x1c60cf[_0xbf5a('0x37')][_0xbf5a('0x20')]);_0x27e69b[_0xbf5a('0x1d')]=qs[_0xbf5a('0x1d')](_0x1c60cf[_0xbf5a('0x37')][_0xbf5a('0x1d')]);}_0x27e69b[_0xbf5a('0x3e')]=qs[_0xbf5a('0x3f')](_0x1c60cf[_0xbf5a('0x37')]['sort']);_0x27e69b[_0xbf5a('0x40')]=qs[_0xbf5a('0x41')](_[_0xbf5a('0x42')](_0x1c60cf[_0xbf5a('0x37')],_0x430375[_0xbf5a('0x41')]),_0x2e0108);if(_0x1c60cf['query'][_0xbf5a('0x43')]){_0x27e69b[_0xbf5a('0x40')]=_[_0xbf5a('0x44')](_0x27e69b[_0xbf5a('0x40')],{'$or':_[_0xbf5a('0x2f')](_0x2e0108,function(_0x41c798){if(_0x41c798[_0xbf5a('0x33')]!==_0xbf5a('0x45')){var _0x306afd={};_0x306afd[_0x41c798['name']]={'$like':'%'+_0x1c60cf[_0xbf5a('0x37')][_0xbf5a('0x43')]+'%'};return _0x306afd;}})});}_0x27e69b=_['merge']({},_0x27e69b,_0x1c60cf[_0xbf5a('0x46')]);var _0x148acb={'where':_0x27e69b[_0xbf5a('0x40')]};return db[_0xbf5a('0x30')][_0xbf5a('0x1f')](_0x148acb)[_0xbf5a('0x26')](function(_0x5e9a84){_0x445fb4[_0xbf5a('0x1f')]=_0x5e9a84;if(_0x1c60cf[_0xbf5a('0x37')][_0xbf5a('0x47')]){_0x27e69b[_0xbf5a('0x48')]=[{'all':!![]}];}return db['SquareOdbc'][_0xbf5a('0x49')](_0x27e69b);})['then'](function(_0xb1302b){_0x445fb4[_0xbf5a('0x4a')]=_0xb1302b;return _0x445fb4;})[_0xbf5a('0x26')](respondWithFilteredResult(_0xc8c2c3,_0x27e69b))['catch'](handleError(_0xc8c2c3,null));};exports['show']=function(_0x118792,_0x53e161){var _0x199f49={'raw':!![],'where':{'id':_0x118792['params']['id']}},_0x5ef445={};_0x5ef445['model']=_[_0xbf5a('0x38')](db[_0xbf5a('0x30')][_0xbf5a('0x31')]);_0x5ef445[_0xbf5a('0x37')]=_['keys'](_0x118792['query']);_0x5ef445['filters']=_[_0xbf5a('0x39')](_0x5ef445['model'],_0x5ef445[_0xbf5a('0x37')]);_0x199f49[_0xbf5a('0x3b')]=_[_0xbf5a('0x39')](_0x5ef445['model'],qs[_0xbf5a('0x3a')](_0x118792[_0xbf5a('0x37')][_0xbf5a('0x3a')]));_0x199f49[_0xbf5a('0x3b')]=_0x199f49[_0xbf5a('0x3b')][_0xbf5a('0x3c')]?_0x199f49[_0xbf5a('0x3b')]:_0x5ef445[_0xbf5a('0x35')];if(_0x118792[_0xbf5a('0x37')]['includeAll']){_0x199f49[_0xbf5a('0x48')]=[{'all':!![]}];}_0x199f49=_[_0xbf5a('0x44')]({},_0x199f49,_0x118792[_0xbf5a('0x46')]);return db[_0xbf5a('0x30')][_0xbf5a('0x4b')](_0x199f49)[_0xbf5a('0x26')](handleEntityNotFound(_0x53e161,null))['then'](respondWithResult(_0x53e161,null))[_0xbf5a('0x4c')](handleError(_0x53e161,null));};exports[_0xbf5a('0x4d')]=function(_0xaf7252,_0x5b102d){return db[_0xbf5a('0x30')][_0xbf5a('0x4d')](_0xaf7252[_0xbf5a('0x4e')],{})[_0xbf5a('0x26')](function(_0x1d36fa){var _0x185346=_0xaf7252['user']['get']({'plain':!![]});if(!_0x185346)throw new Error(_0xbf5a('0x4f'));if(_0x185346[_0xbf5a('0x50')]==='user'){var _0x1c3dae=_0x1d36fa[_0xbf5a('0x28')]({'plain':!![]});var _0x15bee6=_0xbf5a('0x29');return db[_0xbf5a('0x51')][_0xbf5a('0x4b')]({'where':{'name':_0x15bee6,'userProfileId':_0x185346[_0xbf5a('0x52')]},'raw':!![]})[_0xbf5a('0x26')](function(_0x303ff7){if(_0x303ff7&&_0x303ff7[_0xbf5a('0x53')]===0x0){return db[_0xbf5a('0x2a')]['create']({'name':_0x1c3dae[_0xbf5a('0x36')],'resourceId':_0x1c3dae['id'],'type':_0x303ff7[_0xbf5a('0x36')],'sectionId':_0x303ff7['id']},{})[_0xbf5a('0x26')](function(){return _0x1d36fa;});}else{return _0x1d36fa;}})[_0xbf5a('0x4c')](function(_0x5ca636){logger[_0xbf5a('0x2b')](_0xbf5a('0x54'),_0x5ca636);throw _0x5ca636;});}return _0x1d36fa;})['then'](respondWithResult(_0x5b102d,0xc9))['catch'](handleError(_0x5b102d,null));};exports['update']=function(_0x54e1e6,_0x27800f){if(_0x54e1e6[_0xbf5a('0x4e')]['id']){delete _0x54e1e6[_0xbf5a('0x4e')]['id'];}return db[_0xbf5a('0x30')][_0xbf5a('0x4b')]({'where':{'id':_0x54e1e6[_0xbf5a('0x55')]['id']}})[_0xbf5a('0x26')](handleEntityNotFound(_0x27800f,null))[_0xbf5a('0x26')](saveUpdates(_0x54e1e6['body'],null))[_0xbf5a('0x26')](respondWithResult(_0x27800f,null))['catch'](handleError(_0x27800f,null));};exports[_0xbf5a('0x27')]=function(_0xb971c4,_0x34ef7f){return db[_0xbf5a('0x30')][_0xbf5a('0x4b')]({'where':{'id':_0xb971c4['params']['id']}})[_0xbf5a('0x26')](handleEntityNotFound(_0x34ef7f,null))['then'](removeEntity(_0x34ef7f,null))[_0xbf5a('0x4c')](handleError(_0x34ef7f,null));};exports[_0xbf5a('0x56')]=function(_0x3320ae,_0x5b2a8a,_0x16436e){var _0x33a993;return db[_0xbf5a('0x30')][_0xbf5a('0x4b')]({'where':{'id':_0x3320ae[_0xbf5a('0x55')]['id']},'attributes':['id','dsn']})['then'](handleEntityNotFound(_0x5b2a8a,null))[_0xbf5a('0x26')](function(_0x516318){if(_0x516318){var _0x2f979f=require('odbc')();_0x2f979f[_0xbf5a('0x57')](_0x516318[_0xbf5a('0x58')]);_0x2f979f[_0xbf5a('0x59')]();return _0x516318;}})[_0xbf5a('0x26')](respondWithResult(_0x5b2a8a,null))['catch'](handleError(_0x5b2a8a,null));}; \ No newline at end of file +var _0x2145=['order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','params','keys','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','test','dsn','odbc','closeSync','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','to-csv','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','count','limit','set','Content-Range','json','reject','save','update','then','ODBC','UserProfileResource','destroy','error','stack','send','index','map','SquareOdbc','rawAttributes','fieldName','type','key','model','name','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit'];(function(_0x47d18a,_0xd53074){var _0x130c43=function(_0x380f11){while(--_0x380f11){_0x47d18a['push'](_0x47d18a['shift']());}};_0x130c43(++_0xd53074);}(_0x2145,0x125));var _0x5214=function(_0x5ebeb7,_0x21e17a){_0x5ebeb7=_0x5ebeb7-0x0;var _0x58bf10=_0x2145[_0x5ebeb7];return _0x58bf10;};'use strict';var emlformat=require(_0x5214('0x0'));var rimraf=require(_0x5214('0x1'));var zipdir=require(_0x5214('0x2'));var jsonpatch=require(_0x5214('0x3'));var rp=require('request-promise');var moment=require(_0x5214('0x4'));var BPromise=require(_0x5214('0x5'));var Mustache=require(_0x5214('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x5214('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5214('0x8'));var _=require('lodash');var squel=require(_0x5214('0x9'));var crypto=require(_0x5214('0xa'));var jsforce=require(_0x5214('0xb'));var deskjs=require(_0x5214('0xc'));var toCsv=require(_0x5214('0x7'));var querystring=require('querystring');var Papa=require(_0x5214('0xd'));var Redis=require(_0x5214('0xe'));var authService=require(_0x5214('0xf'));var qs=require(_0x5214('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5214('0x11'))(_0x5214('0x12'));var utils=require('../../config/utils');var config=require(_0x5214('0x13'));var licenseUtil=require(_0x5214('0x14'));var db=require(_0x5214('0x15'))['db'];function respondWithStatusCode(_0x3927e2,_0x2f11c2){_0x2f11c2=_0x2f11c2||0xcc;return function(_0x37556b){if(_0x37556b){return _0x3927e2[_0x5214('0x16')](_0x2f11c2);}return _0x3927e2['status'](_0x2f11c2)[_0x5214('0x17')]();};}function respondWithResult(_0x3a414b,_0x36250d){_0x36250d=_0x36250d||0xc8;return function(_0x30278c){if(_0x30278c){return _0x3a414b[_0x5214('0x18')](_0x36250d)['json'](_0x30278c);}};}function respondWithFilteredResult(_0x46ff84,_0x337990){return function(_0x2e6235){if(_0x2e6235){var _0x179852=typeof _0x337990[_0x5214('0x19')]===_0x5214('0x1a')&&typeof _0x337990['limit']===_0x5214('0x1a');var _0x40b7cd=_0x2e6235[_0x5214('0x1b')];var _0xd736e8=_0x179852?0x0:_0x337990['offset'];var _0x249526=_0x179852?_0x2e6235[_0x5214('0x1b')]:_0x337990['offset']+_0x337990[_0x5214('0x1c')];var _0x13a685;if(_0x249526>=_0x40b7cd){_0x249526=_0x40b7cd;_0x13a685=0xc8;}else{_0x13a685=0xce;}_0x46ff84[_0x5214('0x18')](_0x13a685);return _0x46ff84[_0x5214('0x1d')](_0x5214('0x1e'),_0xd736e8+'-'+_0x249526+'/'+_0x40b7cd)[_0x5214('0x1f')](_0x2e6235);}return null;};}function patchUpdates(_0x301522){return function(_0x186d58){try{jsonpatch['apply'](_0x186d58,_0x301522,!![]);}catch(_0x4fa7de){return BPromise[_0x5214('0x20')](_0x4fa7de);}return _0x186d58[_0x5214('0x21')]();};}function saveUpdates(_0x96be71,_0x5873d8){return function(_0x18d3c2){if(_0x18d3c2){return _0x18d3c2[_0x5214('0x22')](_0x96be71)[_0x5214('0x23')](function(_0x55fa0a){return _0x55fa0a;});}return null;};}function removeEntity(_0x494058,_0x5892e3){return function(_0x2d17a1){if(_0x2d17a1){return _0x2d17a1['destroy']()[_0x5214('0x23')](function(){var _0x54fc8c=_0x2d17a1['get']({'plain':!![]});var _0x3d18e1=_0x5214('0x24');return db[_0x5214('0x25')][_0x5214('0x26')]({'where':{'type':_0x3d18e1,'resourceId':_0x54fc8c['id']}})[_0x5214('0x23')](function(){return _0x2d17a1;});})[_0x5214('0x23')](function(){_0x494058[_0x5214('0x18')](0xcc)[_0x5214('0x17')]();});}};}function handleEntityNotFound(_0x489bb1,_0x43b6e1){return function(_0x4cb0d1){if(!_0x4cb0d1){_0x489bb1[_0x5214('0x16')](0x194);}return _0x4cb0d1;};}function handleError(_0x4da181,_0x8c4ee){_0x8c4ee=_0x8c4ee||0x1f4;return function(_0x2ed3b7){logger[_0x5214('0x27')](_0x2ed3b7[_0x5214('0x28')]);if(_0x2ed3b7['name']){delete _0x2ed3b7['name'];}_0x4da181[_0x5214('0x18')](_0x8c4ee)[_0x5214('0x29')](_0x2ed3b7);};}exports[_0x5214('0x2a')]=function(_0x5bf7ac,_0x30830f){var _0x332902={},_0x4dfc84={},_0x396a6d={'count':0x0,'rows':[]};var _0x4a7a19=_[_0x5214('0x2b')](db[_0x5214('0x2c')][_0x5214('0x2d')],function(_0x51d249){return{'name':_0x51d249[_0x5214('0x2e')],'type':_0x51d249[_0x5214('0x2f')][_0x5214('0x30')]};});_0x4dfc84[_0x5214('0x31')]=_[_0x5214('0x2b')](_0x4a7a19,_0x5214('0x32'));_0x4dfc84[_0x5214('0x33')]=_['keys'](_0x5bf7ac[_0x5214('0x33')]);_0x4dfc84[_0x5214('0x34')]=_['intersection'](_0x4dfc84[_0x5214('0x31')],_0x4dfc84['query']);_0x332902[_0x5214('0x35')]=_[_0x5214('0x36')](_0x4dfc84[_0x5214('0x31')],qs['fields'](_0x5bf7ac[_0x5214('0x33')][_0x5214('0x37')]));_0x332902[_0x5214('0x35')]=_0x332902[_0x5214('0x35')][_0x5214('0x38')]?_0x332902[_0x5214('0x35')]:_0x4dfc84[_0x5214('0x31')];if(!_0x5bf7ac['query'][_0x5214('0x39')](_0x5214('0x3a'))){_0x332902[_0x5214('0x1c')]=qs[_0x5214('0x1c')](_0x5bf7ac[_0x5214('0x33')][_0x5214('0x1c')]);_0x332902[_0x5214('0x19')]=qs['offset'](_0x5bf7ac[_0x5214('0x33')]['offset']);}_0x332902[_0x5214('0x3b')]=qs[_0x5214('0x3c')](_0x5bf7ac[_0x5214('0x33')][_0x5214('0x3c')]);_0x332902[_0x5214('0x3d')]=qs[_0x5214('0x34')](_[_0x5214('0x3e')](_0x5bf7ac['query'],_0x4dfc84[_0x5214('0x34')]),_0x4a7a19);if(_0x5bf7ac[_0x5214('0x33')][_0x5214('0x3f')]){_0x332902[_0x5214('0x3d')]=_['merge'](_0x332902[_0x5214('0x3d')],{'$or':_[_0x5214('0x2b')](_0x4a7a19,function(_0x40ce2a){if(_0x40ce2a['type']!==_0x5214('0x40')){var _0x129241={};_0x129241[_0x40ce2a[_0x5214('0x32')]]={'$like':'%'+_0x5bf7ac['query'][_0x5214('0x3f')]+'%'};return _0x129241;}})});}_0x332902=_[_0x5214('0x41')]({},_0x332902,_0x5bf7ac[_0x5214('0x42')]);var _0x40976d={'where':_0x332902[_0x5214('0x3d')]};return db['SquareOdbc'][_0x5214('0x1b')](_0x40976d)['then'](function(_0x5ae66a){_0x396a6d[_0x5214('0x1b')]=_0x5ae66a;if(_0x5bf7ac[_0x5214('0x33')][_0x5214('0x43')]){_0x332902[_0x5214('0x44')]=[{'all':!![]}];}return db['SquareOdbc'][_0x5214('0x45')](_0x332902);})[_0x5214('0x23')](function(_0x37d82d){_0x396a6d['rows']=_0x37d82d;return _0x396a6d;})[_0x5214('0x23')](respondWithFilteredResult(_0x30830f,_0x332902))[_0x5214('0x46')](handleError(_0x30830f,null));};exports[_0x5214('0x47')]=function(_0xd60498,_0x2309df){var _0x5413cd={'raw':!![],'where':{'id':_0xd60498[_0x5214('0x48')]['id']}},_0x384200={};_0x384200['model']=_['keys'](db[_0x5214('0x2c')]['rawAttributes']);_0x384200[_0x5214('0x33')]=_[_0x5214('0x49')](_0xd60498[_0x5214('0x33')]);_0x384200[_0x5214('0x34')]=_[_0x5214('0x36')](_0x384200[_0x5214('0x31')],_0x384200[_0x5214('0x33')]);_0x5413cd['attributes']=_[_0x5214('0x36')](_0x384200[_0x5214('0x31')],qs[_0x5214('0x37')](_0xd60498['query'][_0x5214('0x37')]));_0x5413cd[_0x5214('0x35')]=_0x5413cd[_0x5214('0x35')][_0x5214('0x38')]?_0x5413cd[_0x5214('0x35')]:_0x384200[_0x5214('0x31')];if(_0xd60498[_0x5214('0x33')][_0x5214('0x43')]){_0x5413cd[_0x5214('0x44')]=[{'all':!![]}];}_0x5413cd=_[_0x5214('0x41')]({},_0x5413cd,_0xd60498['options']);return db[_0x5214('0x2c')][_0x5214('0x4a')](_0x5413cd)[_0x5214('0x23')](handleEntityNotFound(_0x2309df,null))[_0x5214('0x23')](respondWithResult(_0x2309df,null))['catch'](handleError(_0x2309df,null));};exports[_0x5214('0x4b')]=function(_0x2e8d53,_0x2e96f6){return db[_0x5214('0x2c')][_0x5214('0x4b')](_0x2e8d53[_0x5214('0x4c')],{})[_0x5214('0x23')](function(_0x596b30){var _0x534318=_0x2e8d53[_0x5214('0x4d')][_0x5214('0x4e')]({'plain':!![]});if(!_0x534318)throw new Error(_0x5214('0x4f'));if(_0x534318[_0x5214('0x50')]===_0x5214('0x4d')){var _0x58874f=_0x596b30[_0x5214('0x4e')]({'plain':!![]});var _0x3d0831=_0x5214('0x24');return db[_0x5214('0x51')][_0x5214('0x4a')]({'where':{'name':_0x3d0831,'userProfileId':_0x534318[_0x5214('0x52')]},'raw':!![]})['then'](function(_0x56dace){if(_0x56dace&&_0x56dace['autoAssociation']===0x0){return db[_0x5214('0x25')][_0x5214('0x4b')]({'name':_0x58874f['name'],'resourceId':_0x58874f['id'],'type':_0x56dace[_0x5214('0x32')],'sectionId':_0x56dace['id']},{})['then'](function(){return _0x596b30;});}else{return _0x596b30;}})[_0x5214('0x46')](function(_0x40f541){logger['error'](_0x5214('0x53'),_0x40f541);throw _0x40f541;});}return _0x596b30;})[_0x5214('0x23')](respondWithResult(_0x2e96f6,0xc9))['catch'](handleError(_0x2e96f6,null));};exports[_0x5214('0x22')]=function(_0xeacfd3,_0x4004c2){if(_0xeacfd3[_0x5214('0x4c')]['id']){delete _0xeacfd3[_0x5214('0x4c')]['id'];}return db[_0x5214('0x2c')]['find']({'where':{'id':_0xeacfd3[_0x5214('0x48')]['id']}})[_0x5214('0x23')](handleEntityNotFound(_0x4004c2,null))['then'](saveUpdates(_0xeacfd3[_0x5214('0x4c')],null))[_0x5214('0x23')](respondWithResult(_0x4004c2,null))[_0x5214('0x46')](handleError(_0x4004c2,null));};exports[_0x5214('0x26')]=function(_0x3fd05f,_0x5c18e7){return db[_0x5214('0x2c')][_0x5214('0x4a')]({'where':{'id':_0x3fd05f[_0x5214('0x48')]['id']}})[_0x5214('0x23')](handleEntityNotFound(_0x5c18e7,null))['then'](removeEntity(_0x5c18e7,null))[_0x5214('0x46')](handleError(_0x5c18e7,null));};exports[_0x5214('0x54')]=function(_0x4a868b,_0x319e12,_0x4367d9){var _0x19beaf;return db[_0x5214('0x2c')]['find']({'where':{'id':_0x4a868b[_0x5214('0x48')]['id']},'attributes':['id',_0x5214('0x55')]})['then'](handleEntityNotFound(_0x319e12,null))[_0x5214('0x23')](function(_0x35ef12){if(_0x35ef12){var _0x266f42=require(_0x5214('0x56'))();_0x266f42['openSync'](_0x35ef12[_0x5214('0x55')]);_0x266f42[_0x5214('0x57')]();return _0x35ef12;}})['then'](respondWithResult(_0x319e12,null))['catch'](handleError(_0x319e12,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index f8852a0..33b4e9e 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 _0x3486=['define','square_odbc','../../config/logger','moment','bluebird','path','./squareOdbc.attributes','exports'];(function(_0x41885c,_0x594374){var _0x3ac698=function(_0x2e00b9){while(--_0x2e00b9){_0x41885c['push'](_0x41885c['shift']());}};_0x3ac698(++_0x594374);}(_0x3486,0xa2));var _0x6348=function(_0x22ed4b,_0x20609c){_0x22ed4b=_0x22ed4b-0x0;var _0x4e9cf6=_0x3486[_0x22ed4b];return _0x4e9cf6;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6348('0x0'))('api');var moment=require(_0x6348('0x1'));var BPromise=require(_0x6348('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6348('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6348('0x4'));module[_0x6348('0x5')]=function(_0x13c666,_0x1b923b){return _0x13c666[_0x6348('0x6')]('SquareOdbc',attributes,{'tableName':_0x6348('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x573d=['bluebird','request-promise','path','rimraf','../../config/environment','define','SquareOdbc','square_odbc','util','../../config/logger','api'];(function(_0x3beb04,_0x2e6c4f){var _0x188a35=function(_0x191c6e){while(--_0x191c6e){_0x3beb04['push'](_0x3beb04['shift']());}};_0x188a35(++_0x2e6c4f);}(_0x573d,0x189));var _0xd573=function(_0x4777ee,_0x42674d){_0x4777ee=_0x4777ee-0x0;var _0x1b637f=_0x573d[_0x4777ee];return _0x1b637f;};'use strict';var _=require('lodash');var util=require(_0xd573('0x0'));var logger=require(_0xd573('0x1'))(_0xd573('0x2'));var moment=require('moment');var BPromise=require(_0xd573('0x3'));var rp=require(_0xd573('0x4'));var fs=require('fs');var path=require(_0xd573('0x5'));var rimraf=require(_0xd573('0x6'));var config=require(_0xd573('0x7'));var attributes=require('./squareOdbc.attributes');module['exports']=function(_0x440d66,_0x315afc){return _0x440d66[_0xd573('0x8')](_0xd573('0x9'),attributes,{'tableName':_0xd573('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.rpc.js b/server/api/squareOdbc/squareOdbc.rpc.js index 50e231e..bff17de 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 _0xb12a=['code','message','result','ShowSquareOdbc','SquareOdbc','find','options','where','attributes','map','include','model','debug','stringify','catch','lodash','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','error'];(function(_0x5000b1,_0x71fbbc){var _0x4205e9=function(_0x800e95){while(--_0x800e95){_0x5000b1['push'](_0x5000b1['shift']());}};_0x4205e9(++_0x71fbbc);}(_0xb12a,0x14e));var _0xab12=function(_0x4c65c0,_0xc33bb0){_0x4c65c0=_0x4c65c0-0x0;var _0x1eb0a0=_0xb12a[_0x4c65c0];return _0x1eb0a0;};'use strict';var _=require(_0xab12('0x0'));var util=require('util');var moment=require(_0xab12('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xab12('0x2'))['db'];var utils=require(_0xab12('0x3'));var logger=require(_0xab12('0x4'))(_0xab12('0x5'));var config=require(_0xab12('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xab12('0x7')][_0xab12('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2b8dcb,_0x2a80ed,_0x4b8160){return new BPromise(function(_0x4cc517,_0x234654){return client['request'](_0x2b8dcb,_0x4b8160)[_0xab12('0x9')](function(_0x58eea8){logger[_0xab12('0xa')](_0xab12('0xb'),_0x2a80ed,_0xab12('0xc'));logger['debug']('SquareOdbc,\x20%s,\x20%s,\x20%s',_0x2a80ed,'request\x20sent',JSON['stringify'](_0x58eea8));if(_0x58eea8[_0xab12('0xd')]){if(_0x58eea8[_0xab12('0xd')][_0xab12('0xe')]===0x1f4){logger[_0xab12('0xd')]('SquareOdbc,\x20%s,\x20%s',_0x2a80ed,_0x58eea8[_0xab12('0xd')]['message']);return _0x234654(_0x58eea8['error'][_0xab12('0xf')]);}logger[_0xab12('0xd')](_0xab12('0xb'),_0x2a80ed,_0x58eea8[_0xab12('0xd')][_0xab12('0xf')]);return _0x4cc517(_0x58eea8['error'][_0xab12('0xf')]);}else{logger['info'](_0xab12('0xb'),_0x2a80ed,_0xab12('0xc'));_0x4cc517(_0x58eea8[_0xab12('0x10')][_0xab12('0xf')]);}})['catch'](function(_0x51fbe4){logger['error'](_0xab12('0xb'),_0x2a80ed,_0x51fbe4);_0x234654(_0x51fbe4);});});}exports[_0xab12('0x11')]=function(_0x167dd6){var _0x55a08e=this;return new Promise(function(_0x3915e4,_0x255600){return db[_0xab12('0x12')][_0xab12('0x13')]({'raw':_0x167dd6[_0xab12('0x14')]?_0x167dd6['options']['raw']===undefined?!![]:![]:!![],'where':_0x167dd6[_0xab12('0x14')]?_0x167dd6[_0xab12('0x14')][_0xab12('0x15')]||null:null,'attributes':_0x167dd6[_0xab12('0x14')]?_0x167dd6[_0xab12('0x14')][_0xab12('0x16')]||null:null,'include':_0x167dd6[_0xab12('0x14')]?_0x167dd6['options']['include']?_[_0xab12('0x17')](_0x167dd6[_0xab12('0x14')][_0xab12('0x18')],function(_0x444abf){return{'model':db[_0x444abf['model']],'as':_0x444abf['as'],'attributes':_0x444abf[_0xab12('0x16')],'include':_0x444abf[_0xab12('0x18')]?_[_0xab12('0x17')](_0x444abf[_0xab12('0x18')],function(_0x32082a){return{'model':db[_0x32082a['model']],'as':_0x32082a['as'],'attributes':_0x32082a['attributes'],'include':_0x32082a[_0xab12('0x18')]?_[_0xab12('0x17')](_0x32082a[_0xab12('0x18')],function(_0x40680e){return{'model':db[_0x40680e[_0xab12('0x19')]],'as':_0x40680e['as'],'attributes':_0x40680e['attributes']};}):[]};}):[]};}):[]:[]})[_0xab12('0x9')](function(_0x343d6f){logger['info'](_0xab12('0x11'),_0x167dd6);logger[_0xab12('0x1a')](_0xab12('0x11'),_0x167dd6,JSON[_0xab12('0x1b')](_0x343d6f));_0x3915e4(_0x343d6f);})[_0xab12('0x1c')](function(_0x1cd5cc){logger['error'](_0xab12('0x11'),_0x1cd5cc['message'],_0x167dd6);_0x255600(_0x55a08e['error'](0x1f4,_0x1cd5cc['message']));});});}; \ No newline at end of file +var _0x016a=['model','ShowSquareOdbc','debug','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','SquareOdbc,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','SquareOdbc,\x20%s,\x20%s','message','result','catch','SquareOdbc','options','raw','where','include','map','attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x016a,0x196));var _0xa016=function(_0x581af1,_0x4f02c5){_0x581af1=_0x581af1-0x0;var _0x54c22e=_0x016a[_0x581af1];return _0x54c22e;};'use strict';var _=require(_0xa016('0x0'));var util=require(_0xa016('0x1'));var moment=require(_0xa016('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa016('0x3'));var db=require(_0xa016('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa016('0x5'))(_0xa016('0x6'));var config=require(_0xa016('0x7'));var jayson=require(_0xa016('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xed3e90,_0x59f2ca,_0x5b0ffa){return new BPromise(function(_0x55e76d,_0x526eab){return client[_0xa016('0x9')](_0xed3e90,_0x5b0ffa)[_0xa016('0xa')](function(_0x431fff){logger[_0xa016('0xb')]('SquareOdbc,\x20%s,\x20%s',_0x59f2ca,'request\x20sent');logger['debug'](_0xa016('0xc'),_0x59f2ca,_0xa016('0xd'),JSON[_0xa016('0xe')](_0x431fff));if(_0x431fff['error']){if(_0x431fff['error'][_0xa016('0xf')]===0x1f4){logger[_0xa016('0x10')](_0xa016('0x11'),_0x59f2ca,_0x431fff[_0xa016('0x10')][_0xa016('0x12')]);return _0x526eab(_0x431fff['error'][_0xa016('0x12')]);}logger['error']('SquareOdbc,\x20%s,\x20%s',_0x59f2ca,_0x431fff[_0xa016('0x10')][_0xa016('0x12')]);return _0x55e76d(_0x431fff[_0xa016('0x10')][_0xa016('0x12')]);}else{logger[_0xa016('0xb')](_0xa016('0x11'),_0x59f2ca,_0xa016('0xd'));_0x55e76d(_0x431fff[_0xa016('0x13')][_0xa016('0x12')]);}})[_0xa016('0x14')](function(_0x24d2fd){logger[_0xa016('0x10')](_0xa016('0x11'),_0x59f2ca,_0x24d2fd);_0x526eab(_0x24d2fd);});});}exports['ShowSquareOdbc']=function(_0x3a700c){var _0x3f8945=this;return new Promise(function(_0x398914,_0x49c25e){return db[_0xa016('0x15')]['find']({'raw':_0x3a700c['options']?_0x3a700c[_0xa016('0x16')][_0xa016('0x17')]===undefined?!![]:![]:!![],'where':_0x3a700c[_0xa016('0x16')]?_0x3a700c[_0xa016('0x16')][_0xa016('0x18')]||null:null,'attributes':_0x3a700c[_0xa016('0x16')]?_0x3a700c[_0xa016('0x16')]['attributes']||null:null,'include':_0x3a700c[_0xa016('0x16')]?_0x3a700c[_0xa016('0x16')][_0xa016('0x19')]?_[_0xa016('0x1a')](_0x3a700c[_0xa016('0x16')]['include'],function(_0x42d4ca){return{'model':db[_0x42d4ca['model']],'as':_0x42d4ca['as'],'attributes':_0x42d4ca[_0xa016('0x1b')],'include':_0x42d4ca[_0xa016('0x19')]?_['map'](_0x42d4ca[_0xa016('0x19')],function(_0x2958bc){return{'model':db[_0x2958bc[_0xa016('0x1c')]],'as':_0x2958bc['as'],'attributes':_0x2958bc[_0xa016('0x1b')],'include':_0x2958bc[_0xa016('0x19')]?_[_0xa016('0x1a')](_0x2958bc['include'],function(_0x1dd87a){return{'model':db[_0x1dd87a[_0xa016('0x1c')]],'as':_0x1dd87a['as'],'attributes':_0x1dd87a[_0xa016('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xa016('0xa')](function(_0x283442){logger[_0xa016('0xb')](_0xa016('0x1d'),_0x3a700c);logger[_0xa016('0x1e')]('ShowSquareOdbc',_0x3a700c,JSON['stringify'](_0x283442));_0x398914(_0x283442);})[_0xa016('0x14')](function(_0x1ae54f){logger['error']('ShowSquareOdbc',_0x1ae54f[_0xa016('0x12')],_0x3a700c);_0x49c25e(_0x3f8945[_0xa016('0x10')](0x1f4,_0x1ae54f[_0xa016('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index 0e4d7f7..55b774f 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 _0x9ebe=['path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','show','put','/:id','update','destroy','exports','multer','util'];(function(_0x2e4aa2,_0x11956a){var _0x5e6092=function(_0x4c12c2){while(--_0x4c12c2){_0x2e4aa2['push'](_0x2e4aa2['shift']());}};_0x5e6092(++_0x11956a);}(_0x9ebe,0xfd));var _0xe9eb=function(_0x2646a0,_0x360c2d){_0x2646a0=_0x2646a0-0x0;var _0x374392=_0x9ebe[_0x2646a0];return _0x374392;};'use strict';var multer=require(_0xe9eb('0x0'));var util=require(_0xe9eb('0x1'));var path=require(_0xe9eb('0x2'));var timeout=require('connect-timeout');var express=require(_0xe9eb('0x3'));var router=express[_0xe9eb('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xe9eb('0x5'));var interaction=require(_0xe9eb('0x6'));var config=require(_0xe9eb('0x7'));var controller=require('./squareProject.controller');router[_0xe9eb('0x8')]('/',auth['isAuthenticated'](),controller[_0xe9eb('0x9')]);router['get']('/:id',auth[_0xe9eb('0xa')](),controller[_0xe9eb('0xb')]);router['post']('/',auth[_0xe9eb('0xa')](),controller['create']);router[_0xe9eb('0xc')](_0xe9eb('0xd'),auth[_0xe9eb('0xa')](),controller[_0xe9eb('0xe')]);router['delete'](_0xe9eb('0xd'),auth[_0xe9eb('0xa')](),controller[_0xe9eb('0xf')]);module[_0xe9eb('0x10')]=router; \ No newline at end of file +var _0xcd1a=['create','/:id','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./squareProject.controller','get','isAuthenticated','index','show','post'];(function(_0x4e2198,_0x399d54){var _0x22fdd7=function(_0x2fc7d0){while(--_0x2fc7d0){_0x4e2198['push'](_0x4e2198['shift']());}};_0x22fdd7(++_0x399d54);}(_0xcd1a,0x131));var _0xacd1=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0xcd1a[_0x82129b];return _0x2ae5dc;};'use strict';var multer=require(_0xacd1('0x0'));var util=require(_0xacd1('0x1'));var path=require(_0xacd1('0x2'));var timeout=require(_0xacd1('0x3'));var express=require(_0xacd1('0x4'));var router=express[_0xacd1('0x5')]();var fs_extra=require(_0xacd1('0x6'));var auth=require(_0xacd1('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xacd1('0x8'));var controller=require(_0xacd1('0x9'));router[_0xacd1('0xa')]('/',auth[_0xacd1('0xb')](),controller[_0xacd1('0xc')]);router[_0xacd1('0xa')]('/:id',auth[_0xacd1('0xb')](),controller[_0xacd1('0xd')]);router[_0xacd1('0xe')]('/',auth[_0xacd1('0xb')](),controller[_0xacd1('0xf')]);router['put'](_0xacd1('0x10'),auth['isAuthenticated'](),controller['update']);router[_0xacd1('0x11')]('/:id',auth[_0xacd1('0xb')](),controller[_0xacd1('0x12')]);module[_0xacd1('0x13')]=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index d4b238f..73c82ec 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 _0xcc5f=['getDataValue','preproduction','toString','utf8','production','DATE','sequelize','exports','STRING','BLOB','long'];(function(_0x5235a6,_0x680b76){var _0x1cf37e=function(_0x31c173){while(--_0x31c173){_0x5235a6['push'](_0x5235a6['shift']());}};_0x1cf37e(++_0x680b76);}(_0xcc5f,0x12f));var _0xfcc5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcc5f[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xfcc5('0x0'));module[_0xfcc5('0x1')]={'name':{'type':Sequelize[_0xfcc5('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0xfcc5('0x2')]},'notes':{'type':Sequelize['TEXT']},'preproduction':{'type':Sequelize[_0xfcc5('0x3')](_0xfcc5('0x4')),'get':function(){if(this[_0xfcc5('0x5')](_0xfcc5('0x6'))){return this['getDataValue']('preproduction')[_0xfcc5('0x7')](_0xfcc5('0x8'));}}},'production':{'type':Sequelize[_0xfcc5('0x3')]('long'),'get':function(){if(this[_0xfcc5('0x5')]('production')){return this[_0xfcc5('0x5')](_0xfcc5('0x9'))['toString'](_0xfcc5('0x8'));}}},'savedAt':{'type':Sequelize[_0xfcc5('0xa')]},'publishedAt':{'type':Sequelize[_0xfcc5('0xa')]}}; \ No newline at end of file +var _0xe1d7=['getDataValue','toString','utf8','production','DATE','exports','TEXT','BLOB','long','preproduction'];(function(_0x2af377,_0x1c8430){var _0x5d120a=function(_0x1a644c){while(--_0x1a644c){_0x2af377['push'](_0x2af377['shift']());}};_0x5d120a(++_0x1c8430);}(_0xe1d7,0x1a9));var _0x7e1d=function(_0x580cee,_0x189c97){_0x580cee=_0x580cee-0x0;var _0x47dfe9=_0xe1d7[_0x580cee];return _0x47dfe9;};'use strict';var Sequelize=require('sequelize');module[_0x7e1d('0x0')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'description':{'type':Sequelize['STRING']},'notes':{'type':Sequelize[_0x7e1d('0x1')]},'preproduction':{'type':Sequelize[_0x7e1d('0x2')](_0x7e1d('0x3')),'get':function(){if(this['getDataValue'](_0x7e1d('0x4'))){return this[_0x7e1d('0x5')](_0x7e1d('0x4'))[_0x7e1d('0x6')](_0x7e1d('0x7'));}}},'production':{'type':Sequelize['BLOB'](_0x7e1d('0x3')),'get':function(){if(this[_0x7e1d('0x5')]('production')){return this[_0x7e1d('0x5')](_0x7e1d('0x8'))['toString']('utf8');}}},'savedAt':{'type':Sequelize[_0x7e1d('0x9')]},'publishedAt':{'type':Sequelize[_0x7e1d('0x9')]}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index 77e45e4..d77732e 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 _0xc8e9=['VIRTUAL','filter','options','findAll','rows','show','params','keys','length','includeAll','find','catch','create','body','get','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','production','lodash','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','undefined','limit','count','offset','status','Content-Range','json','update','destroy','then','SquareProjects','UserProfileResource','publish','agi','stringify','end','sendStatus','error','stack','name','send','index','map','SquareProject','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','merge'];(function(_0x57ffc0,_0x50cc19){var _0x39342a=function(_0x5cbed1){while(--_0x5cbed1){_0x57ffc0['push'](_0x57ffc0['shift']());}};_0x39342a(++_0x50cc19);}(_0xc8e9,0x178));var _0x9c8e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xc8e9[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x9c8e('0x0'));var Redis=require('ioredis');var qs=require(_0x9c8e('0x1'));var logger=require(_0x9c8e('0x2'))(_0x9c8e('0x3'));var config=require(_0x9c8e('0x4'));var db=require(_0x9c8e('0x5'))['db'];config[_0x9c8e('0x6')]=_[_0x9c8e('0x7')](config[_0x9c8e('0x6')],{'host':_0x9c8e('0x8'),'port':0x18eb});var socket=require(_0x9c8e('0x9'))(new Redis(config[_0x9c8e('0x6')]));require('./squareProject.socket')[_0x9c8e('0xa')](socket);function respondWithResult(_0x4749a1,_0x531219){_0x531219=_0x531219||0xc8;return function(_0x48cf57){if(_0x48cf57){return _0x4749a1['status'](_0x531219)['json'](_0x48cf57);}};}function respondWithFilteredResult(_0x12ea2a,_0x105eca){return function(_0x14d61f){if(_0x14d61f){var _0x12b310=typeof _0x105eca['offset']===_0x9c8e('0xb')&&typeof _0x105eca[_0x9c8e('0xc')]==='undefined';var _0x473257=_0x14d61f[_0x9c8e('0xd')];var _0x155e22=_0x12b310?0x0:_0x105eca[_0x9c8e('0xe')];var _0x12c39f=_0x12b310?_0x14d61f[_0x9c8e('0xd')]:_0x105eca['offset']+_0x105eca[_0x9c8e('0xc')];var _0x151e44;if(_0x12c39f>=_0x473257){_0x12c39f=_0x473257;_0x151e44=0xc8;}else{_0x151e44=0xce;}_0x12ea2a[_0x9c8e('0xf')](_0x151e44);return _0x12ea2a['set'](_0x9c8e('0x10'),_0x155e22+'-'+_0x12c39f+'/'+_0x473257)[_0x9c8e('0x11')](_0x14d61f);}return null;};}function saveUpdates(_0x5a51c4){return function(_0x19351f){if(_0x19351f){return _0x19351f[_0x9c8e('0x12')](_0x5a51c4)['then'](function(_0x5eb178){return _0x5eb178;});}return null;};}function removeEntity(_0x4d26f4){return function(_0xc8e879){if(_0xc8e879){return _0xc8e879[_0x9c8e('0x13')]()[_0x9c8e('0x14')](function(){var _0x1394e3=_0xc8e879['get']({'plain':!![]});var _0x29983d=_0x9c8e('0x15');return db[_0x9c8e('0x16')][_0x9c8e('0x13')]({'where':{'type':_0x29983d,'resourceId':_0x1394e3['id']}})[_0x9c8e('0x14')](function(){return _0xc8e879;});})['then'](function(){var _0x48686d=new Redis(config[_0x9c8e('0x6')]);_0x48686d[_0x9c8e('0x17')](_0x9c8e('0x18'),JSON[_0x9c8e('0x19')]({'id':_0xc8e879['id'],'deleted':!![]}));})[_0x9c8e('0x14')](function(){_0x4d26f4[_0x9c8e('0xf')](0xcc)[_0x9c8e('0x1a')]();});}};}function handleEntityNotFound(_0x1fb07d){return function(_0x23f7ce){if(!_0x23f7ce){_0x1fb07d[_0x9c8e('0x1b')](0x194);}return _0x23f7ce;};}function handleError(_0x589b91,_0xff7a4b){_0xff7a4b=_0xff7a4b||0x1f4;return function(_0xe244ad){logger[_0x9c8e('0x1c')](_0xe244ad[_0x9c8e('0x1d')]);if(_0xe244ad[_0x9c8e('0x1e')]){delete _0xe244ad['name'];}_0x589b91[_0x9c8e('0xf')](_0xff7a4b)[_0x9c8e('0x1f')](_0xe244ad);};}exports[_0x9c8e('0x20')]=function(_0x4920e2,_0x388945){var _0x4f1b73={},_0x222318={},_0x53ee31={'count':0x0,'rows':[]};var _0x2c199d=_[_0x9c8e('0x21')](db[_0x9c8e('0x22')][_0x9c8e('0x23')],function(_0x3b399f){return{'name':_0x3b399f[_0x9c8e('0x24')],'type':_0x3b399f[_0x9c8e('0x25')][_0x9c8e('0x26')]};});_0x222318[_0x9c8e('0x27')]=_[_0x9c8e('0x21')](_0x2c199d,'name');_0x222318[_0x9c8e('0x28')]=_['keys'](_0x4920e2[_0x9c8e('0x28')]);_0x222318[_0x9c8e('0x29')]=_['intersection'](_0x222318[_0x9c8e('0x27')],_0x222318[_0x9c8e('0x28')]);_0x4f1b73['attributes']=_[_0x9c8e('0x2a')](_0x222318[_0x9c8e('0x27')],qs[_0x9c8e('0x2b')](_0x4920e2[_0x9c8e('0x28')][_0x9c8e('0x2b')]));_0x4f1b73[_0x9c8e('0x2c')]=_0x4f1b73[_0x9c8e('0x2c')]['length']?_0x4f1b73['attributes']:_0x222318[_0x9c8e('0x27')];if(!_0x4920e2[_0x9c8e('0x28')][_0x9c8e('0x2d')]('nolimit')){_0x4f1b73[_0x9c8e('0xc')]=qs[_0x9c8e('0xc')](_0x4920e2[_0x9c8e('0x28')][_0x9c8e('0xc')]);_0x4f1b73[_0x9c8e('0xe')]=qs[_0x9c8e('0xe')](_0x4920e2[_0x9c8e('0x28')][_0x9c8e('0xe')]);}_0x4f1b73[_0x9c8e('0x2e')]=qs[_0x9c8e('0x2f')](_0x4920e2['query']['sort']);_0x4f1b73[_0x9c8e('0x30')]=qs[_0x9c8e('0x29')](_['pick'](_0x4920e2[_0x9c8e('0x28')],_0x222318[_0x9c8e('0x29')]),_0x2c199d);if(_0x4920e2[_0x9c8e('0x28')]['filter']){_0x4f1b73[_0x9c8e('0x30')]=_[_0x9c8e('0x31')](_0x4f1b73[_0x9c8e('0x30')],{'$or':_[_0x9c8e('0x21')](_0x2c199d,function(_0xff5f5){if(_0xff5f5[_0x9c8e('0x25')]!==_0x9c8e('0x32')){var _0x23302b={};_0x23302b[_0xff5f5[_0x9c8e('0x1e')]]={'$like':'%'+_0x4920e2[_0x9c8e('0x28')][_0x9c8e('0x33')]+'%'};return _0x23302b;}})});}_0x4f1b73=_[_0x9c8e('0x31')]({},_0x4f1b73,_0x4920e2[_0x9c8e('0x34')]);var _0x43d25b={'where':_0x4f1b73[_0x9c8e('0x30')]};return db[_0x9c8e('0x22')][_0x9c8e('0xd')](_0x43d25b)[_0x9c8e('0x14')](function(_0x3be6de){_0x53ee31[_0x9c8e('0xd')]=_0x3be6de;if(_0x4920e2[_0x9c8e('0x28')]['includeAll']){_0x4f1b73['include']=[{'all':!![]}];}return db[_0x9c8e('0x22')][_0x9c8e('0x35')](_0x4f1b73);})[_0x9c8e('0x14')](function(_0x40379d){_0x53ee31[_0x9c8e('0x36')]=_0x40379d;return _0x53ee31;})[_0x9c8e('0x14')](respondWithFilteredResult(_0x388945,_0x4f1b73))['catch'](handleError(_0x388945,null));};exports[_0x9c8e('0x37')]=function(_0x31168e,_0x37a9a1){var _0x4aaec1={'raw':![],'where':{'id':_0x31168e[_0x9c8e('0x38')]['id']}},_0x1df53={};_0x1df53['model']=_[_0x9c8e('0x39')](db[_0x9c8e('0x22')][_0x9c8e('0x23')]);_0x1df53[_0x9c8e('0x28')]=_[_0x9c8e('0x39')](_0x31168e[_0x9c8e('0x28')]);_0x1df53[_0x9c8e('0x29')]=_['intersection'](_0x1df53[_0x9c8e('0x27')],_0x1df53[_0x9c8e('0x28')]);_0x4aaec1[_0x9c8e('0x2c')]=_[_0x9c8e('0x2a')](_0x1df53[_0x9c8e('0x27')],qs[_0x9c8e('0x2b')](_0x31168e['query'][_0x9c8e('0x2b')]));_0x4aaec1[_0x9c8e('0x2c')]=_0x4aaec1[_0x9c8e('0x2c')][_0x9c8e('0x3a')]?_0x4aaec1[_0x9c8e('0x2c')]:_0x1df53[_0x9c8e('0x27')];if(_0x31168e[_0x9c8e('0x28')][_0x9c8e('0x3b')]){_0x4aaec1['include']=[{'all':!![]}];}_0x4aaec1=_[_0x9c8e('0x31')]({},_0x4aaec1,_0x31168e[_0x9c8e('0x34')]);return db['SquareProject'][_0x9c8e('0x3c')](_0x4aaec1)[_0x9c8e('0x14')](handleEntityNotFound(_0x37a9a1,null))[_0x9c8e('0x14')](respondWithResult(_0x37a9a1,null))[_0x9c8e('0x3d')](handleError(_0x37a9a1,null));};exports[_0x9c8e('0x3e')]=function(_0x30ed79,_0x36c5c7){return db['SquareProject'][_0x9c8e('0x3e')](_0x30ed79[_0x9c8e('0x3f')],{})[_0x9c8e('0x14')](function(_0x335525){var _0x159eb0=_0x30ed79['user'][_0x9c8e('0x40')]({'plain':!![]});if(!_0x159eb0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x159eb0['role']===_0x9c8e('0x41')){var _0x2e7dd5=_0x335525[_0x9c8e('0x40')]({'plain':!![]});var _0x1c131e=_0x9c8e('0x15');return db[_0x9c8e('0x42')][_0x9c8e('0x3c')]({'where':{'name':_0x1c131e,'userProfileId':_0x159eb0[_0x9c8e('0x43')]},'raw':!![]})[_0x9c8e('0x14')](function(_0x2109b1){if(_0x2109b1&&_0x2109b1[_0x9c8e('0x44')]===0x0){return db[_0x9c8e('0x16')]['create']({'name':_0x2e7dd5[_0x9c8e('0x1e')],'resourceId':_0x2e7dd5['id'],'type':_0x2109b1['name'],'sectionId':_0x2109b1['id']},{})[_0x9c8e('0x14')](function(){return _0x335525;});}else{return _0x335525;}})[_0x9c8e('0x3d')](function(_0x26b445){logger[_0x9c8e('0x1c')](_0x9c8e('0x45'),_0x26b445);throw _0x26b445;});}return _0x335525;})[_0x9c8e('0x14')](respondWithResult(_0x36c5c7,0xc9))[_0x9c8e('0x3d')](handleError(_0x36c5c7,null));};exports['update']=function(_0x13b7cc,_0x3b6666){if(_0x13b7cc[_0x9c8e('0x3f')]['id']){delete _0x13b7cc[_0x9c8e('0x3f')]['id'];}return db[_0x9c8e('0x22')]['find']({'where':{'id':_0x13b7cc[_0x9c8e('0x38')]['id']}})[_0x9c8e('0x14')](handleEntityNotFound(_0x3b6666,null))['then'](saveUpdates(_0x13b7cc[_0x9c8e('0x3f')],null))['then'](function(_0x212468){if(!_0x212468)return;var _0x44556d=_0x212468[_0x9c8e('0x40')]({'plain':!![]});return _0x44556d;})[_0x9c8e('0x14')](function(_0x853e71){var _0x1d6feb=new Redis(config[_0x9c8e('0x6')]);_0x1d6feb[_0x9c8e('0x17')](_0x9c8e('0x18'),JSON['stringify'](_['pick'](_0x853e71,['id','name',_0x9c8e('0x46')])));return _0x853e71;})['then'](respondWithResult(_0x3b6666,null))[_0x9c8e('0x3d')](handleError(_0x3b6666,null));};exports['destroy']=function(_0x3b00f6,_0x2f4b7a){return db['SquareProject']['find']({'where':{'id':_0x3b00f6[_0x9c8e('0x38')]['id']}})[_0x9c8e('0x14')](handleEntityNotFound(_0x2f4b7a,null))['then'](removeEntity(_0x2f4b7a,null))[_0x9c8e('0x3d')](handleError(_0x2f4b7a,null));}; \ No newline at end of file +var _0x3e70=['fields','length','order','sort','where','filter','merge','options','count','includeAll','findAll','catch','show','params','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','SquareProjects','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','pick','production','lodash','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','./squareProject.socket','register','status','json','undefined','limit','offset','set','Content-Range','destroy','then','get','UserProfileResource','publish','agi','stringify','end','sendStatus','error','stack','name','send','map','SquareProject','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model'];(function(_0x1293b8,_0x5361cd){var _0x150324=function(_0x1085ad){while(--_0x1085ad){_0x1293b8['push'](_0x1293b8['shift']());}};_0x150324(++_0x5361cd);}(_0x3e70,0x164));var _0x03e7=function(_0x56de88,_0x1ced39){_0x56de88=_0x56de88-0x0;var _0x2d079a=_0x3e70[_0x56de88];return _0x2d079a;};'use strict';var _=require(_0x03e7('0x0'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0x03e7('0x1'))('api');var config=require(_0x03e7('0x2'));var db=require(_0x03e7('0x3'))['db'];config[_0x03e7('0x4')]=_[_0x03e7('0x5')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x03e7('0x6'))[_0x03e7('0x7')](socket);function respondWithResult(_0x1b9faa,_0x5d2876){_0x5d2876=_0x5d2876||0xc8;return function(_0x1f27d0){if(_0x1f27d0){return _0x1b9faa[_0x03e7('0x8')](_0x5d2876)[_0x03e7('0x9')](_0x1f27d0);}};}function respondWithFilteredResult(_0xad78b6,_0x2e0419){return function(_0x850542){if(_0x850542){var _0xc34160=typeof _0x2e0419['offset']===_0x03e7('0xa')&&typeof _0x2e0419[_0x03e7('0xb')]===_0x03e7('0xa');var _0xffcd4c=_0x850542['count'];var _0x1ef1fe=_0xc34160?0x0:_0x2e0419[_0x03e7('0xc')];var _0x20f56f=_0xc34160?_0x850542['count']:_0x2e0419['offset']+_0x2e0419[_0x03e7('0xb')];var _0x10b987;if(_0x20f56f>=_0xffcd4c){_0x20f56f=_0xffcd4c;_0x10b987=0xc8;}else{_0x10b987=0xce;}_0xad78b6[_0x03e7('0x8')](_0x10b987);return _0xad78b6[_0x03e7('0xd')](_0x03e7('0xe'),_0x1ef1fe+'-'+_0x20f56f+'/'+_0xffcd4c)[_0x03e7('0x9')](_0x850542);}return null;};}function saveUpdates(_0x5e31e4){return function(_0x362f20){if(_0x362f20){return _0x362f20['update'](_0x5e31e4)['then'](function(_0x43ee53){return _0x43ee53;});}return null;};}function removeEntity(_0x57bf43){return function(_0x3996a8){if(_0x3996a8){return _0x3996a8[_0x03e7('0xf')]()[_0x03e7('0x10')](function(){var _0x1e0d3a=_0x3996a8[_0x03e7('0x11')]({'plain':!![]});var _0x1b0e2a='SquareProjects';return db[_0x03e7('0x12')][_0x03e7('0xf')]({'where':{'type':_0x1b0e2a,'resourceId':_0x1e0d3a['id']}})[_0x03e7('0x10')](function(){return _0x3996a8;});})[_0x03e7('0x10')](function(){var _0x2662f5=new Redis(config[_0x03e7('0x4')]);_0x2662f5[_0x03e7('0x13')](_0x03e7('0x14'),JSON[_0x03e7('0x15')]({'id':_0x3996a8['id'],'deleted':!![]}));})[_0x03e7('0x10')](function(){_0x57bf43['status'](0xcc)[_0x03e7('0x16')]();});}};}function handleEntityNotFound(_0x186fed){return function(_0x5c5753){if(!_0x5c5753){_0x186fed[_0x03e7('0x17')](0x194);}return _0x5c5753;};}function handleError(_0x596517,_0x16024e){_0x16024e=_0x16024e||0x1f4;return function(_0x259e88){logger[_0x03e7('0x18')](_0x259e88[_0x03e7('0x19')]);if(_0x259e88[_0x03e7('0x1a')]){delete _0x259e88[_0x03e7('0x1a')];}_0x596517['status'](_0x16024e)[_0x03e7('0x1b')](_0x259e88);};}exports['index']=function(_0x238f42,_0x2977e3){var _0x6df0f7={},_0x5f076f={},_0xf09938={'count':0x0,'rows':[]};var _0x42e163=_[_0x03e7('0x1c')](db[_0x03e7('0x1d')][_0x03e7('0x1e')],function(_0xf92d88){return{'name':_0xf92d88[_0x03e7('0x1f')],'type':_0xf92d88[_0x03e7('0x20')][_0x03e7('0x21')]};});_0x5f076f['model']=_[_0x03e7('0x1c')](_0x42e163,_0x03e7('0x1a'));_0x5f076f[_0x03e7('0x22')]=_[_0x03e7('0x23')](_0x238f42['query']);_0x5f076f[_0x03e7('0x24')]=_[_0x03e7('0x25')](_0x5f076f['model'],_0x5f076f[_0x03e7('0x22')]);_0x6df0f7[_0x03e7('0x26')]=_[_0x03e7('0x25')](_0x5f076f[_0x03e7('0x27')],qs['fields'](_0x238f42[_0x03e7('0x22')][_0x03e7('0x28')]));_0x6df0f7[_0x03e7('0x26')]=_0x6df0f7[_0x03e7('0x26')][_0x03e7('0x29')]?_0x6df0f7[_0x03e7('0x26')]:_0x5f076f[_0x03e7('0x27')];if(!_0x238f42['query']['hasOwnProperty']('nolimit')){_0x6df0f7[_0x03e7('0xb')]=qs[_0x03e7('0xb')](_0x238f42[_0x03e7('0x22')][_0x03e7('0xb')]);_0x6df0f7[_0x03e7('0xc')]=qs['offset'](_0x238f42[_0x03e7('0x22')][_0x03e7('0xc')]);}_0x6df0f7[_0x03e7('0x2a')]=qs[_0x03e7('0x2b')](_0x238f42[_0x03e7('0x22')]['sort']);_0x6df0f7[_0x03e7('0x2c')]=qs[_0x03e7('0x24')](_['pick'](_0x238f42[_0x03e7('0x22')],_0x5f076f[_0x03e7('0x24')]),_0x42e163);if(_0x238f42[_0x03e7('0x22')][_0x03e7('0x2d')]){_0x6df0f7[_0x03e7('0x2c')]=_['merge'](_0x6df0f7[_0x03e7('0x2c')],{'$or':_['map'](_0x42e163,function(_0x240d2a){if(_0x240d2a[_0x03e7('0x20')]!=='VIRTUAL'){var _0x203015={};_0x203015[_0x240d2a[_0x03e7('0x1a')]]={'$like':'%'+_0x238f42[_0x03e7('0x22')][_0x03e7('0x2d')]+'%'};return _0x203015;}})});}_0x6df0f7=_[_0x03e7('0x2e')]({},_0x6df0f7,_0x238f42[_0x03e7('0x2f')]);var _0x3d1c70={'where':_0x6df0f7[_0x03e7('0x2c')]};return db['SquareProject'][_0x03e7('0x30')](_0x3d1c70)['then'](function(_0x76ee3d){_0xf09938['count']=_0x76ee3d;if(_0x238f42[_0x03e7('0x22')][_0x03e7('0x31')]){_0x6df0f7['include']=[{'all':!![]}];}return db['SquareProject'][_0x03e7('0x32')](_0x6df0f7);})['then'](function(_0x1664c8){_0xf09938['rows']=_0x1664c8;return _0xf09938;})[_0x03e7('0x10')](respondWithFilteredResult(_0x2977e3,_0x6df0f7))[_0x03e7('0x33')](handleError(_0x2977e3,null));};exports[_0x03e7('0x34')]=function(_0x882cb5,_0x405401){var _0x29294e={'raw':![],'where':{'id':_0x882cb5[_0x03e7('0x35')]['id']}},_0x139c4f={};_0x139c4f[_0x03e7('0x27')]=_[_0x03e7('0x23')](db[_0x03e7('0x1d')]['rawAttributes']);_0x139c4f[_0x03e7('0x22')]=_['keys'](_0x882cb5[_0x03e7('0x22')]);_0x139c4f[_0x03e7('0x24')]=_[_0x03e7('0x25')](_0x139c4f['model'],_0x139c4f[_0x03e7('0x22')]);_0x29294e[_0x03e7('0x26')]=_[_0x03e7('0x25')](_0x139c4f[_0x03e7('0x27')],qs['fields'](_0x882cb5[_0x03e7('0x22')]['fields']));_0x29294e['attributes']=_0x29294e[_0x03e7('0x26')][_0x03e7('0x29')]?_0x29294e[_0x03e7('0x26')]:_0x139c4f[_0x03e7('0x27')];if(_0x882cb5['query'][_0x03e7('0x31')]){_0x29294e[_0x03e7('0x36')]=[{'all':!![]}];}_0x29294e=_[_0x03e7('0x2e')]({},_0x29294e,_0x882cb5[_0x03e7('0x2f')]);return db[_0x03e7('0x1d')][_0x03e7('0x37')](_0x29294e)[_0x03e7('0x10')](handleEntityNotFound(_0x405401,null))[_0x03e7('0x10')](respondWithResult(_0x405401,null))[_0x03e7('0x33')](handleError(_0x405401,null));};exports['create']=function(_0x3e536b,_0x892362){return db[_0x03e7('0x1d')][_0x03e7('0x38')](_0x3e536b['body'],{})['then'](function(_0x2e3a4c){var _0x33d568=_0x3e536b[_0x03e7('0x39')][_0x03e7('0x11')]({'plain':!![]});if(!_0x33d568)throw new Error(_0x03e7('0x3a'));if(_0x33d568[_0x03e7('0x3b')]===_0x03e7('0x39')){var _0x49b94a=_0x2e3a4c[_0x03e7('0x11')]({'plain':!![]});var _0xdc2391=_0x03e7('0x3c');return db['UserProfileSection']['find']({'where':{'name':_0xdc2391,'userProfileId':_0x33d568['userProfileId']},'raw':!![]})[_0x03e7('0x10')](function(_0x424845){if(_0x424845&&_0x424845['autoAssociation']===0x0){return db[_0x03e7('0x12')][_0x03e7('0x38')]({'name':_0x49b94a[_0x03e7('0x1a')],'resourceId':_0x49b94a['id'],'type':_0x424845[_0x03e7('0x1a')],'sectionId':_0x424845['id']},{})[_0x03e7('0x10')](function(){return _0x2e3a4c;});}else{return _0x2e3a4c;}})['catch'](function(_0x4e0cf9){logger[_0x03e7('0x18')](_0x03e7('0x3d'),_0x4e0cf9);throw _0x4e0cf9;});}return _0x2e3a4c;})[_0x03e7('0x10')](respondWithResult(_0x892362,0xc9))[_0x03e7('0x33')](handleError(_0x892362,null));};exports[_0x03e7('0x3e')]=function(_0x429640,_0x19b31d){if(_0x429640[_0x03e7('0x3f')]['id']){delete _0x429640[_0x03e7('0x3f')]['id'];}return db[_0x03e7('0x1d')]['find']({'where':{'id':_0x429640['params']['id']}})['then'](handleEntityNotFound(_0x19b31d,null))[_0x03e7('0x10')](saveUpdates(_0x429640['body'],null))[_0x03e7('0x10')](function(_0x7d1bb6){if(!_0x7d1bb6)return;var _0x43e55c=_0x7d1bb6[_0x03e7('0x11')]({'plain':!![]});return _0x43e55c;})[_0x03e7('0x10')](function(_0x6e68ea){var _0x9545ff=new Redis(config[_0x03e7('0x4')]);_0x9545ff[_0x03e7('0x13')](_0x03e7('0x14'),JSON[_0x03e7('0x15')](_[_0x03e7('0x40')](_0x6e68ea,['id',_0x03e7('0x1a'),_0x03e7('0x41')])));return _0x6e68ea;})[_0x03e7('0x10')](respondWithResult(_0x19b31d,null))[_0x03e7('0x33')](handleError(_0x19b31d,null));};exports['destroy']=function(_0x150e8a,_0x43d838){return db[_0x03e7('0x1d')][_0x03e7('0x37')]({'where':{'id':_0x150e8a[_0x03e7('0x35')]['id']}})['then'](handleEntityNotFound(_0x43d838,null))[_0x03e7('0x10')](removeEntity(_0x43d838,null))[_0x03e7('0x33')](handleError(_0x43d838,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index 8bcb65d..b501b71 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 _0x90a9=['hook','exports','events','SquareProject','save','update','remove','emit','hasOwnProperty'];(function(_0x3dea47,_0x512e8d){var _0x18d67b=function(_0xf95344){while(--_0xf95344){_0x3dea47['push'](_0x3dea47['shift']());}};_0x18d67b(++_0x512e8d);}(_0x90a9,0xb6));var _0x990a=function(_0x12dad2,_0x25d7ea){_0x12dad2=_0x12dad2-0x0;var _0x3699f3=_0x90a9[_0x12dad2];return _0x3699f3;};'use strict';var EventEmitter=require(_0x990a('0x0'));var SquareProject=require('../../mysqldb')['db'][_0x990a('0x1')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x990a('0x2'),'afterUpdate':_0x990a('0x3'),'afterDestroy':_0x990a('0x4')};function emitEvent(_0x3195db){return function(_0x15bcf2,_0x22d7f9,_0x2be368){SquareProjectEvents[_0x990a('0x5')](_0x3195db+':'+_0x15bcf2['id'],_0x15bcf2);SquareProjectEvents[_0x990a('0x5')](_0x3195db,_0x15bcf2);_0x2be368(null);};}for(var e in events){if(events[_0x990a('0x6')](e)){var event=events[e];SquareProject[_0x990a('0x7')](e,emitEvent(event));}}module[_0x990a('0x8')]=SquareProjectEvents; \ No newline at end of file +var _0x9411=['save','remove','emit','hasOwnProperty','hook','exports','events','SquareProject','setMaxListeners'];(function(_0xe5a050,_0x3ae6b6){var _0x5a9c62=function(_0x5d966b){while(--_0x5d966b){_0xe5a050['push'](_0xe5a050['shift']());}};_0x5a9c62(++_0x3ae6b6);}(_0x9411,0x1a4));var _0x1941=function(_0x2f4d6d,_0x383e9a){_0x2f4d6d=_0x2f4d6d-0x0;var _0x244efa=_0x9411[_0x2f4d6d];return _0x244efa;};'use strict';var EventEmitter=require(_0x1941('0x0'));var SquareProject=require('../../mysqldb')['db'][_0x1941('0x1')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x1941('0x2')](0x0);var events={'afterCreate':_0x1941('0x3'),'afterUpdate':'update','afterDestroy':_0x1941('0x4')};function emitEvent(_0x19bed1){return function(_0xbe4df9,_0x6f9c60,_0x152308){SquareProjectEvents['emit'](_0x19bed1+':'+_0xbe4df9['id'],_0xbe4df9);SquareProjectEvents[_0x1941('0x5')](_0x19bed1,_0xbe4df9);_0x152308(null);};}for(var e in events){if(events[_0x1941('0x6')](e)){var event=events[e];SquareProject[_0x1941('0x7')](e,emitEvent(event));}}module[_0x1941('0x8')]=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index 3f2b4b2..2c5cb47 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 _0x626b=['../../config/environment','./squareProject.attributes','exports','define','square_projects','changed','preproduction','savedAt','publishedAt','format','YYYY-MM-DD\x20HH:mm:ss','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x626b,0x12c));var _0xb626=function(_0xa05f4f,_0x2f3ebe){_0xa05f4f=_0xa05f4f-0x0;var _0x3a3d3b=_0x626b[_0xa05f4f];return _0x3a3d3b;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xb626('0x0'));var moment=require(_0xb626('0x1'));var BPromise=require(_0xb626('0x2'));var rp=require(_0xb626('0x3'));var fs=require('fs');var path=require(_0xb626('0x4'));var rimraf=require(_0xb626('0x5'));var config=require(_0xb626('0x6'));var attributes=require(_0xb626('0x7'));module[_0xb626('0x8')]=function(_0x1b0417,_0x4ff967){return _0x1b0417[_0xb626('0x9')]('SquareProject',attributes,{'tableName':_0xb626('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x194dab,_0x58ef5f,_0x2ba9bf){if(_0x194dab[_0xb626('0xb')](_0xb626('0xc'))){_0x194dab[_0xb626('0xd')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}if(_0x194dab[_0xb626('0xb')]('production')){_0x194dab[_0xb626('0xe')]=moment()[_0xb626('0xf')](_0xb626('0x10'));}_0x2ba9bf(null,_0x194dab);}}});}; \ No newline at end of file +var _0xaf89=['changed','preproduction','savedAt','YYYY-MM-DD\x20HH:mm:ss','production','publishedAt','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','exports','define','SquareProject','square_projects'];(function(_0x2aec52,_0x59d962){var _0x3b8835=function(_0x3e2604){while(--_0x3e2604){_0x2aec52['push'](_0x2aec52['shift']());}};_0x3b8835(++_0x59d962);}(_0xaf89,0xb6));var _0x9af8=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0xaf89[_0x2bf141];return _0x48277b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9af8('0x0'))(_0x9af8('0x1'));var moment=require(_0x9af8('0x2'));var BPromise=require(_0x9af8('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x9af8('0x4'));var config=require(_0x9af8('0x5'));var attributes=require('./squareProject.attributes');module[_0x9af8('0x6')]=function(_0xa9aaa2,_0x3a05bb){return _0xa9aaa2[_0x9af8('0x7')](_0x9af8('0x8'),attributes,{'tableName':_0x9af8('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x53fcb0,_0x8aed62,_0x475128){if(_0x53fcb0[_0x9af8('0xa')](_0x9af8('0xb'))){_0x53fcb0[_0x9af8('0xc')]=moment()['format'](_0x9af8('0xd'));}if(_0x53fcb0['changed'](_0x9af8('0xe'))){_0x53fcb0[_0x9af8('0xf')]=moment()['format'](_0x9af8('0xd'));}_0x475128(null,_0x53fcb0);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index 9ce90a7..b48162a 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 _0xc3a4=['../../mysqldb','../../config/logger','rpc','../../config/environment','redis','defaults','localhost','socket.io-emitter','register','GetSquareProjects','options','raw','attributes','include','map','model','info','stringify','catch','error','message','ShowSquareProject','where','then','debug','lodash','ioredis'];(function(_0x471427,_0x230414){var _0x5a5bf7=function(_0x4576f3){while(--_0x4576f3){_0x471427['push'](_0x471427['shift']());}};_0x5a5bf7(++_0x230414);}(_0xc3a4,0x1e4));var _0x4c3a=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xc3a4[_0x167cc1];return _0x10bc4b;};'use strict';var _=require(_0x4c3a('0x0'));var Redis=require(_0x4c3a('0x1'));var db=require(_0x4c3a('0x2'))['db'];var logger=require(_0x4c3a('0x3'))(_0x4c3a('0x4'));var config=require(_0x4c3a('0x5'));config[_0x4c3a('0x6')]=_[_0x4c3a('0x7')](config['redis'],{'host':_0x4c3a('0x8'),'port':0x18eb});var socket=require(_0x4c3a('0x9'))(new Redis(config['redis']));require('./squareProject.socket')[_0x4c3a('0xa')](socket);exports[_0x4c3a('0xb')]=function(_0x596327){var _0xbdca47=this;return new Promise(function(_0x3459b8,_0x1136a5){return db['SquareProject']['findAll']({'raw':_0x596327['options']?_0x596327[_0x4c3a('0xc')][_0x4c3a('0xd')]===undefined?!![]:![]:!![],'where':_0x596327['options']?_0x596327['options']['where']||null:null,'attributes':_0x596327[_0x4c3a('0xc')]?_0x596327[_0x4c3a('0xc')][_0x4c3a('0xe')]||null:null,'limit':_0x596327[_0x4c3a('0xc')]?_0x596327[_0x4c3a('0xc')]['limit']||null:null,'include':_0x596327['options']?_0x596327['options'][_0x4c3a('0xf')]?_[_0x4c3a('0x10')](_0x596327['options'][_0x4c3a('0xf')],function(_0x3f8399){return{'model':db[_0x3f8399[_0x4c3a('0x11')]],'as':_0x3f8399['as'],'attributes':_0x3f8399[_0x4c3a('0xe')],'include':_0x3f8399[_0x4c3a('0xf')]?_['map'](_0x3f8399['include'],function(_0x303914){return{'model':db[_0x303914[_0x4c3a('0x11')]],'as':_0x303914['as'],'attributes':_0x303914[_0x4c3a('0xe')],'include':_0x303914[_0x4c3a('0xf')]?_[_0x4c3a('0x10')](_0x303914[_0x4c3a('0xf')],function(_0xda7f23){return{'model':db[_0xda7f23[_0x4c3a('0x11')]],'as':_0xda7f23['as'],'attributes':_0xda7f23['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x519cab){logger[_0x4c3a('0x12')](_0x4c3a('0xb'),_0x596327);logger['debug'](_0x4c3a('0xb'),_0x596327,JSON[_0x4c3a('0x13')](_0x519cab));_0x3459b8(_0x519cab);})[_0x4c3a('0x14')](function(_0x50508a){logger[_0x4c3a('0x15')]('GetSquareProjects',_0x50508a[_0x4c3a('0x16')],_0x596327);_0x1136a5(_0xbdca47['error'](0x1f4,_0x50508a[_0x4c3a('0x16')]));});});};exports[_0x4c3a('0x17')]=function(_0x5154ff){var _0x5a8af1=this;return new Promise(function(_0x45e009,_0x47a4d2){return db['SquareProject']['find']({'raw':_0x5154ff[_0x4c3a('0xc')]?_0x5154ff[_0x4c3a('0xc')]['raw']===undefined?!![]:![]:!![],'where':_0x5154ff[_0x4c3a('0xc')]?_0x5154ff[_0x4c3a('0xc')][_0x4c3a('0x18')]||null:null,'attributes':_0x5154ff['options']?_0x5154ff['options']['attributes']||null:null,'include':_0x5154ff[_0x4c3a('0xc')]?_0x5154ff[_0x4c3a('0xc')][_0x4c3a('0xf')]?_[_0x4c3a('0x10')](_0x5154ff[_0x4c3a('0xc')][_0x4c3a('0xf')],function(_0x496439){return{'model':db[_0x496439[_0x4c3a('0x11')]],'as':_0x496439['as'],'attributes':_0x496439[_0x4c3a('0xe')],'include':_0x496439['include']?_[_0x4c3a('0x10')](_0x496439[_0x4c3a('0xf')],function(_0x176884){return{'model':db[_0x176884[_0x4c3a('0x11')]],'as':_0x176884['as'],'attributes':_0x176884[_0x4c3a('0xe')],'include':_0x176884[_0x4c3a('0xf')]?_[_0x4c3a('0x10')](_0x176884['include'],function(_0x5aed1a){return{'model':db[_0x5aed1a[_0x4c3a('0x11')]],'as':_0x5aed1a['as'],'attributes':_0x5aed1a[_0x4c3a('0xe')]};}):[]};}):[]};}):[]:[]})[_0x4c3a('0x19')](function(_0x22542d){logger[_0x4c3a('0x12')](_0x4c3a('0x17'),_0x5154ff);logger[_0x4c3a('0x1a')](_0x4c3a('0x17'),_0x5154ff,JSON['stringify'](_0x22542d));_0x45e009(_0x22542d);})[_0x4c3a('0x14')](function(_0x332a4f){logger[_0x4c3a('0x15')](_0x4c3a('0x17'),_0x332a4f[_0x4c3a('0x16')],_0x5154ff);_0x47a4d2(_0x5a8af1['error'](0x1f4,_0x332a4f[_0x4c3a('0x16')]));});});}; \ No newline at end of file +var _0x82cd=['SquareProject','findAll','options','raw','where','attributes','limit','include','map','model','then','info','debug','catch','message','error','find','ShowSquareProject','stringify','lodash','ioredis','../../mysqldb','../../config/logger','../../config/environment','redis','localhost','socket.io-emitter','./squareProject.socket','register','GetSquareProjects'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x82cd,0x1f3));var _0xd82c=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0x82cd[_0x55e08b];return _0xd1a7ff;};'use strict';var _=require(_0xd82c('0x0'));var Redis=require(_0xd82c('0x1'));var db=require(_0xd82c('0x2'))['db'];var logger=require(_0xd82c('0x3'))('rpc');var config=require(_0xd82c('0x4'));config[_0xd82c('0x5')]=_['defaults'](config[_0xd82c('0x5')],{'host':_0xd82c('0x6'),'port':0x18eb});var socket=require(_0xd82c('0x7'))(new Redis(config[_0xd82c('0x5')]));require(_0xd82c('0x8'))[_0xd82c('0x9')](socket);exports[_0xd82c('0xa')]=function(_0x1703ef){var _0x465076=this;return new Promise(function(_0x54aa61,_0x2f1cd1){return db[_0xd82c('0xb')][_0xd82c('0xc')]({'raw':_0x1703ef[_0xd82c('0xd')]?_0x1703ef[_0xd82c('0xd')][_0xd82c('0xe')]===undefined?!![]:![]:!![],'where':_0x1703ef[_0xd82c('0xd')]?_0x1703ef[_0xd82c('0xd')][_0xd82c('0xf')]||null:null,'attributes':_0x1703ef[_0xd82c('0xd')]?_0x1703ef[_0xd82c('0xd')][_0xd82c('0x10')]||null:null,'limit':_0x1703ef[_0xd82c('0xd')]?_0x1703ef['options'][_0xd82c('0x11')]||null:null,'include':_0x1703ef[_0xd82c('0xd')]?_0x1703ef[_0xd82c('0xd')][_0xd82c('0x12')]?_[_0xd82c('0x13')](_0x1703ef['options'][_0xd82c('0x12')],function(_0x4b037a){return{'model':db[_0x4b037a['model']],'as':_0x4b037a['as'],'attributes':_0x4b037a[_0xd82c('0x10')],'include':_0x4b037a[_0xd82c('0x12')]?_[_0xd82c('0x13')](_0x4b037a[_0xd82c('0x12')],function(_0x152d09){return{'model':db[_0x152d09['model']],'as':_0x152d09['as'],'attributes':_0x152d09[_0xd82c('0x10')],'include':_0x152d09[_0xd82c('0x12')]?_[_0xd82c('0x13')](_0x152d09[_0xd82c('0x12')],function(_0x16cfd1){return{'model':db[_0x16cfd1[_0xd82c('0x14')]],'as':_0x16cfd1['as'],'attributes':_0x16cfd1[_0xd82c('0x10')]};}):[]};}):[]};}):[]:[]})[_0xd82c('0x15')](function(_0x3f99db){logger[_0xd82c('0x16')](_0xd82c('0xa'),_0x1703ef);logger[_0xd82c('0x17')](_0xd82c('0xa'),_0x1703ef,JSON['stringify'](_0x3f99db));_0x54aa61(_0x3f99db);})[_0xd82c('0x18')](function(_0x529514){logger['error'](_0xd82c('0xa'),_0x529514[_0xd82c('0x19')],_0x1703ef);_0x2f1cd1(_0x465076[_0xd82c('0x1a')](0x1f4,_0x529514[_0xd82c('0x19')]));});});};exports['ShowSquareProject']=function(_0x34b431){var _0x37912e=this;return new Promise(function(_0x44502a,_0x37627b){return db['SquareProject'][_0xd82c('0x1b')]({'raw':_0x34b431[_0xd82c('0xd')]?_0x34b431[_0xd82c('0xd')]['raw']===undefined?!![]:![]:!![],'where':_0x34b431[_0xd82c('0xd')]?_0x34b431['options'][_0xd82c('0xf')]||null:null,'attributes':_0x34b431[_0xd82c('0xd')]?_0x34b431[_0xd82c('0xd')][_0xd82c('0x10')]||null:null,'include':_0x34b431[_0xd82c('0xd')]?_0x34b431['options'][_0xd82c('0x12')]?_['map'](_0x34b431[_0xd82c('0xd')][_0xd82c('0x12')],function(_0x2e15c4){return{'model':db[_0x2e15c4[_0xd82c('0x14')]],'as':_0x2e15c4['as'],'attributes':_0x2e15c4['attributes'],'include':_0x2e15c4[_0xd82c('0x12')]?_[_0xd82c('0x13')](_0x2e15c4[_0xd82c('0x12')],function(_0x1a977f){return{'model':db[_0x1a977f[_0xd82c('0x14')]],'as':_0x1a977f['as'],'attributes':_0x1a977f[_0xd82c('0x10')],'include':_0x1a977f['include']?_[_0xd82c('0x13')](_0x1a977f[_0xd82c('0x12')],function(_0x26265b){return{'model':db[_0x26265b[_0xd82c('0x14')]],'as':_0x26265b['as'],'attributes':_0x26265b[_0xd82c('0x10')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x17f07){logger[_0xd82c('0x16')](_0xd82c('0x1c'),_0x34b431);logger[_0xd82c('0x17')](_0xd82c('0x1c'),_0x34b431,JSON[_0xd82c('0x1d')](_0x17f07));_0x44502a(_0x17f07);})[_0xd82c('0x18')](function(_0x1a2f5c){logger[_0xd82c('0x1a')](_0xd82c('0x1c'),_0x1a2f5c[_0xd82c('0x19')],_0x34b431);_0x37627b(_0x37912e[_0xd82c('0x1a')](0x1f4,_0x1a2f5c[_0xd82c('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index 0561897..fadad38 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 _0x90e8=['remove','update','emit','removeListener','register','length','squareProject:','./squareProject.events'];(function(_0x189429,_0x57f267){var _0x374239=function(_0x560c84){while(--_0x560c84){_0x189429['push'](_0x189429['shift']());}};_0x374239(++_0x57f267);}(_0x90e8,0xdf));var _0x890e=function(_0x1fc18c,_0x52248e){_0x1fc18c=_0x1fc18c-0x0;var _0x3c3504=_0x90e8[_0x1fc18c];return _0x3c3504;};'use strict';var SquareProjectEvents=require(_0x890e('0x0'));var events=['save',_0x890e('0x1'),_0x890e('0x2')];function createListener(_0x173c6a,_0x4d74e0){return function(_0x5a0f96){_0x4d74e0[_0x890e('0x3')](_0x173c6a,_0x5a0f96);};}function removeListener(_0x3a83c2,_0x36c15a){return function(){SquareProjectEvents[_0x890e('0x4')](_0x3a83c2,_0x36c15a);};}exports[_0x890e('0x5')]=function(_0x18c49d){for(var _0x4b1377=0x0,_0x18625e=events[_0x890e('0x6')];_0x4b1377<_0x18625e;_0x4b1377++){var _0x529a96=events[_0x4b1377];var _0x5a2767=createListener(_0x890e('0x7')+_0x529a96,_0x18c49d);SquareProjectEvents['on'](_0x529a96,_0x5a2767);}}; \ No newline at end of file +var _0xb74b=['update','emit','removeListener','squareProject:','remove'];(function(_0x7fa68c,_0x15b930){var _0x5d3be2=function(_0x1fbc26){while(--_0x1fbc26){_0x7fa68c['push'](_0x7fa68c['shift']());}};_0x5d3be2(++_0x15b930);}(_0xb74b,0x171));var _0xbb74=function(_0x2e8b77,_0x5d473c){_0x2e8b77=_0x2e8b77-0x0;var _0xe01d2b=_0xb74b[_0x2e8b77];return _0xe01d2b;};'use strict';var SquareProjectEvents=require('./squareProject.events');var events=['save',_0xbb74('0x0'),_0xbb74('0x1')];function createListener(_0x20ba3f,_0x5616db){return function(_0x24d83c){_0x5616db[_0xbb74('0x2')](_0x20ba3f,_0x24d83c);};}function removeListener(_0x5aa71b,_0xdb94f3){return function(){SquareProjectEvents[_0xbb74('0x3')](_0x5aa71b,_0xdb94f3);};}exports['register']=function(_0x24848f){for(var _0x695e12=0x0,_0x2906b6=events['length'];_0x695e12<_0x2906b6;_0x695e12++){var _0x40ec06=events[_0x695e12];var _0x3351f5=createListener(_0xbb74('0x4')+_0x40ec06,_0x24848f);SquareProjectEvents['on'](_0x40ec06,_0x3351f5);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index 509f336..69fd3c3 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 _0x53ec=['update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./squareRecording.controller','isAuthenticated','get','/:id','show','/:id/download','download','post','create','put'];(function(_0x467256,_0x5b895b){var _0x3f9e46=function(_0x4b54e7){while(--_0x4b54e7){_0x467256['push'](_0x467256['shift']());}};_0x3f9e46(++_0x5b895b);}(_0x53ec,0x192));var _0xc53e=function(_0x15ec4e,_0x40b7e0){_0x15ec4e=_0x15ec4e-0x0;var _0xb5e5dd=_0x53ec[_0x15ec4e];return _0xb5e5dd;};'use strict';var multer=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var path=require(_0xc53e('0x2'));var timeout=require(_0xc53e('0x3'));var express=require(_0xc53e('0x4'));var router=express[_0xc53e('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xc53e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc53e('0x7'));var controller=require(_0xc53e('0x8'));router['get']('/',auth[_0xc53e('0x9')](),controller['index']);router[_0xc53e('0xa')](_0xc53e('0xb'),auth['isAuthenticated'](),controller[_0xc53e('0xc')]);router[_0xc53e('0xa')](_0xc53e('0xd'),auth[_0xc53e('0x9')](),controller[_0xc53e('0xe')]);router[_0xc53e('0xf')]('/',auth[_0xc53e('0x9')](),controller[_0xc53e('0x10')]);router[_0xc53e('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xc53e('0x12')]);router['delete']('/:id',auth[_0xc53e('0x9')](),controller[_0xc53e('0x13')]);module[_0xc53e('0x14')]=router; \ No newline at end of file +var _0x7fbe=['/:id','show','/:id/download','create','put','update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','index'];(function(_0x3be6b9,_0xdcccf3){var _0x565915=function(_0x3eafce){while(--_0x3eafce){_0x3be6b9['push'](_0x3be6b9['shift']());}};_0x565915(++_0xdcccf3);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x5d7eda,_0x5f737b){_0x5d7eda=_0x5d7eda-0x0;var _0x527626=_0x7fbe[_0x5d7eda];return _0x527626;};'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['download']);router['post']('/',auth[_0xe7fb('0xa')](),controller[_0xe7fb('0xf')]);router[_0xe7fb('0x10')](_0xe7fb('0xc'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x11')]);router[_0xe7fb('0x12')](_0xe7fb('0xc'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x13')]);module[_0xe7fb('0x14')]=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index 8efe7b6..02a52c7 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 _0x2d17=['VIRTUAL','getDataValue','savePath','lastIndexOf','sequelize','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2d17,0x17e));var _0x72d1=function(_0xdf9b95,_0x56a193){_0xdf9b95=_0xdf9b95-0x0;var _0x3d2845=_0x2d17[_0xdf9b95];return _0x3d2845;};'use strict';var Sequelize=require(_0x72d1('0x0'));module[_0x72d1('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x72d1('0x2')]},'calleridname':{'type':Sequelize[_0x72d1('0x2')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x72d1('0x2')]},'priority':{'type':Sequelize[_0x72d1('0x2')]},'accountcode':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0x72d1('0x2')]},'projectName':{'type':Sequelize['STRING']},'saveName':{'type':Sequelize[_0x72d1('0x2')]},'filename':{'type':Sequelize['STRING']},'savePath':{'type':Sequelize[_0x72d1('0x2')]},'format':{'type':Sequelize[_0x72d1('0x3')],'get':function(){var _0x5b40a9='';var _0x477264=this[_0x72d1('0x4')](_0x72d1('0x5'));if(_0x477264){_0x5b40a9=_0x477264['substring'](_0x477264[_0x72d1('0x6')]('.'));}return _0x5b40a9;}}}; \ No newline at end of file +var _0xabce=['sequelize','exports','STRING','VIRTUAL','getDataValue','savePath','lastIndexOf'];(function(_0x220f3f,_0x11c540){var _0x1f170e=function(_0x2c0ec9){while(--_0x2c0ec9){_0x220f3f['push'](_0x220f3f['shift']());}};_0x1f170e(++_0x11c540);}(_0xabce,0x103));var _0xeabc=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xabce[_0x397e5f];return _0x5302b8;};'use strict';var Sequelize=require(_0xeabc('0x0'));module[_0xeabc('0x1')]={'uniqueid':{'type':Sequelize[_0xeabc('0x2')]},'callerid':{'type':Sequelize[_0xeabc('0x2')]},'calleridname':{'type':Sequelize[_0xeabc('0x2')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xeabc('0x2')]},'accountcode':{'type':Sequelize[_0xeabc('0x2')]},'dnid':{'type':Sequelize[_0xeabc('0x2')]},'projectName':{'type':Sequelize['STRING']},'saveName':{'type':Sequelize['STRING']},'filename':{'type':Sequelize[_0xeabc('0x2')]},'savePath':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0xeabc('0x3')],'get':function(){var _0x52ede8='';var _0x3bdc29=this[_0xeabc('0x4')](_0xeabc('0x5'));if(_0x3bdc29){_0x52ede8=_0x3bdc29['substring'](_0x3bdc29[_0xeabc('0x6')]('.'));}return _0x52ede8;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index f498a70..8c9abfd 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 _0xfc46=['status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','end','stack','name','send','index','map','SquareRecording','rawAttributes','fieldName','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','includeAll','findAll','catch','show','params','include','options','find','create','body','uniqueid','savePath','filename','existsSync','secrets','recording','Sequelize','ValidationError','download','extname','unlink','message','SquareRecording\x20not\x20found','Not\x20found','destroy','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','eml-format','rimraf','zip-dir','request-promise','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../mysqldb','sendStatus'];(function(_0x3dedad,_0x435b1f){var _0x5470ba=function(_0x9268c4){while(--_0x9268c4){_0x3dedad['push'](_0x3dedad['shift']());}};_0x5470ba(++_0x435b1f);}(_0xfc46,0x109));var _0x6fc4=function(_0x12aaee,_0x5bf50c){_0x12aaee=_0x12aaee-0x0;var _0x37c350=_0xfc46[_0x12aaee];return _0x37c350;};'use strict';var emlformat=require(_0x6fc4('0x0'));var rimraf=require(_0x6fc4('0x1'));var zipdir=require(_0x6fc4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6fc4('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6fc4('0x4'));var path=require(_0x6fc4('0x5'));var sox=require(_0x6fc4('0x6'));var csv=require(_0x6fc4('0x7'));var ejs=require(_0x6fc4('0x8'));var fs=require('fs');var fs_extra=require(_0x6fc4('0x9'));var _=require(_0x6fc4('0xa'));var squel=require(_0x6fc4('0xb'));var crypto=require(_0x6fc4('0xc'));var jsforce=require(_0x6fc4('0xd'));var deskjs=require(_0x6fc4('0xe'));var toCsv=require(_0x6fc4('0x7'));var querystring=require(_0x6fc4('0xf'));var Papa=require(_0x6fc4('0x10'));var Redis=require(_0x6fc4('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x6fc4('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x6fc4('0x13'));var config=require(_0x6fc4('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x6fc4('0x15'))['db'];function respondWithStatusCode(_0x3fece7,_0x3c1f34){_0x3c1f34=_0x3c1f34||0xcc;return function(_0x106616){if(_0x106616){return _0x3fece7[_0x6fc4('0x16')](_0x3c1f34);}return _0x3fece7[_0x6fc4('0x17')](_0x3c1f34)['end']();};}function respondWithResult(_0xf382f2,_0x23e3e3){_0x23e3e3=_0x23e3e3||0xc8;return function(_0x10e068){if(_0x10e068){return _0xf382f2[_0x6fc4('0x17')](_0x23e3e3)[_0x6fc4('0x18')](_0x10e068);}};}function respondWithFilteredResult(_0x3368a6,_0x4b66dc){return function(_0x91b400){if(_0x91b400){var _0x437339=typeof _0x4b66dc[_0x6fc4('0x19')]===_0x6fc4('0x1a')&&typeof _0x4b66dc[_0x6fc4('0x1b')]===_0x6fc4('0x1a');var _0x198629=_0x91b400[_0x6fc4('0x1c')];var _0xa7fcc8=_0x437339?0x0:_0x4b66dc[_0x6fc4('0x19')];var _0x4c6a74=_0x437339?_0x91b400[_0x6fc4('0x1c')]:_0x4b66dc[_0x6fc4('0x19')]+_0x4b66dc[_0x6fc4('0x1b')];var _0x185e69;if(_0x4c6a74>=_0x198629){_0x4c6a74=_0x198629;_0x185e69=0xc8;}else{_0x185e69=0xce;}_0x3368a6[_0x6fc4('0x17')](_0x185e69);return _0x3368a6[_0x6fc4('0x1d')](_0x6fc4('0x1e'),_0xa7fcc8+'-'+_0x4c6a74+'/'+_0x198629)[_0x6fc4('0x18')](_0x91b400);}return null;};}function patchUpdates(_0x520671){return function(_0x2dcaa9){try{jsonpatch[_0x6fc4('0x1f')](_0x2dcaa9,_0x520671,!![]);}catch(_0x275f3d){return BPromise['reject'](_0x275f3d);}return _0x2dcaa9[_0x6fc4('0x20')]();};}function saveUpdates(_0x5e19c9,_0x2a77fc){return function(_0x49119f){if(_0x49119f){return _0x49119f[_0x6fc4('0x21')](_0x5e19c9)[_0x6fc4('0x22')](function(_0x37e76d){return _0x37e76d;});}return null;};}function removeEntity(_0x4563c5,_0x558557){return function(_0x576753){if(_0x576753){return _0x576753['destroy']()[_0x6fc4('0x22')](function(){_0x4563c5[_0x6fc4('0x17')](0xcc)[_0x6fc4('0x23')]();});}};}function handleEntityNotFound(_0x1776d5,_0x5ee61a){return function(_0x3619fc){if(!_0x3619fc){_0x1776d5[_0x6fc4('0x16')](0x194);}return _0x3619fc;};}function handleError(_0x4b21e4,_0x81d8a2){_0x81d8a2=_0x81d8a2||0x1f4;return function(_0x337a63){logger['error'](_0x337a63[_0x6fc4('0x24')]);if(_0x337a63[_0x6fc4('0x25')]){delete _0x337a63[_0x6fc4('0x25')];}_0x4b21e4[_0x6fc4('0x17')](_0x81d8a2)[_0x6fc4('0x26')](_0x337a63);};}exports[_0x6fc4('0x27')]=function(_0x5cb1c8,_0x20bf0f){var _0x2f1938={},_0x352ae7={},_0x12957d={'count':0x0,'rows':[]};var _0xf8e71f=_[_0x6fc4('0x28')](db[_0x6fc4('0x29')][_0x6fc4('0x2a')],function(_0x33b289){return{'name':_0x33b289[_0x6fc4('0x2b')],'type':_0x33b289['type'][_0x6fc4('0x2c')]};});_0x352ae7[_0x6fc4('0x2d')]=_[_0x6fc4('0x28')](_0xf8e71f,_0x6fc4('0x25'));_0x352ae7['query']=_[_0x6fc4('0x2e')](_0x5cb1c8[_0x6fc4('0x2f')]);_0x352ae7['filters']=_[_0x6fc4('0x30')](_0x352ae7[_0x6fc4('0x2d')],_0x352ae7['query']);_0x2f1938[_0x6fc4('0x31')]=_['intersection'](_0x352ae7[_0x6fc4('0x2d')],qs[_0x6fc4('0x32')](_0x5cb1c8[_0x6fc4('0x2f')]['fields']));_0x2f1938['attributes']=_0x2f1938[_0x6fc4('0x31')][_0x6fc4('0x33')]?_0x2f1938['attributes']:_0x352ae7['model'];if(!_0x5cb1c8[_0x6fc4('0x2f')][_0x6fc4('0x34')](_0x6fc4('0x35'))){_0x2f1938['limit']=qs[_0x6fc4('0x1b')](_0x5cb1c8[_0x6fc4('0x2f')][_0x6fc4('0x1b')]);_0x2f1938[_0x6fc4('0x19')]=qs[_0x6fc4('0x19')](_0x5cb1c8[_0x6fc4('0x2f')][_0x6fc4('0x19')]);}_0x2f1938[_0x6fc4('0x36')]=qs[_0x6fc4('0x37')](_0x5cb1c8[_0x6fc4('0x2f')][_0x6fc4('0x37')]);_0x2f1938[_0x6fc4('0x38')]=qs[_0x6fc4('0x39')](_[_0x6fc4('0x3a')](_0x5cb1c8[_0x6fc4('0x2f')],_0x352ae7[_0x6fc4('0x39')]),_0xf8e71f);if(_0x5cb1c8[_0x6fc4('0x2f')][_0x6fc4('0x3b')]){_0x2f1938['where']=_[_0x6fc4('0x3c')](_0x2f1938['where'],{'$or':_[_0x6fc4('0x28')](_0xf8e71f,function(_0x1c83ba){if(_0x1c83ba[_0x6fc4('0x3d')]!==_0x6fc4('0x3e')){var _0x3add48={};_0x3add48[_0x1c83ba['name']]={'$like':'%'+_0x5cb1c8[_0x6fc4('0x2f')]['filter']+'%'};return _0x3add48;}})});}_0x2f1938=_[_0x6fc4('0x3c')]({},_0x2f1938,_0x5cb1c8['options']);var _0x245f99={'where':_0x2f1938[_0x6fc4('0x38')]};return db[_0x6fc4('0x29')][_0x6fc4('0x1c')](_0x245f99)[_0x6fc4('0x22')](function(_0x26e41c){_0x12957d[_0x6fc4('0x1c')]=_0x26e41c;if(_0x5cb1c8['query'][_0x6fc4('0x3f')]){_0x2f1938['include']=[{'all':!![]}];}return db['SquareRecording'][_0x6fc4('0x40')](_0x2f1938);})[_0x6fc4('0x22')](function(_0x5148c2){_0x12957d['rows']=_0x5148c2;return _0x12957d;})[_0x6fc4('0x22')](respondWithFilteredResult(_0x20bf0f,_0x2f1938))[_0x6fc4('0x41')](handleError(_0x20bf0f,null));};exports[_0x6fc4('0x42')]=function(_0x26bd6e,_0x3bb285){var _0x44a6ba={'raw':!![],'where':{'id':_0x26bd6e[_0x6fc4('0x43')]['id']}},_0x53d18c={};_0x53d18c['model']=_[_0x6fc4('0x2e')](db[_0x6fc4('0x29')][_0x6fc4('0x2a')]);_0x53d18c[_0x6fc4('0x2f')]=_[_0x6fc4('0x2e')](_0x26bd6e[_0x6fc4('0x2f')]);_0x53d18c['filters']=_[_0x6fc4('0x30')](_0x53d18c[_0x6fc4('0x2d')],_0x53d18c[_0x6fc4('0x2f')]);_0x44a6ba[_0x6fc4('0x31')]=_['intersection'](_0x53d18c['model'],qs[_0x6fc4('0x32')](_0x26bd6e['query'][_0x6fc4('0x32')]));_0x44a6ba[_0x6fc4('0x31')]=_0x44a6ba[_0x6fc4('0x31')]['length']?_0x44a6ba['attributes']:_0x53d18c[_0x6fc4('0x2d')];if(_0x26bd6e[_0x6fc4('0x2f')][_0x6fc4('0x3f')]){_0x44a6ba[_0x6fc4('0x44')]=[{'all':!![]}];}_0x44a6ba=_[_0x6fc4('0x3c')]({},_0x44a6ba,_0x26bd6e[_0x6fc4('0x45')]);return db[_0x6fc4('0x29')][_0x6fc4('0x46')](_0x44a6ba)[_0x6fc4('0x22')](handleEntityNotFound(_0x3bb285,null))['then'](respondWithResult(_0x3bb285,null))[_0x6fc4('0x41')](handleError(_0x3bb285,null));};exports[_0x6fc4('0x47')]=function(_0x1b20be,_0x2de4dc){return db[_0x6fc4('0x29')]['create'](_0x1b20be['body'],{})[_0x6fc4('0x22')](respondWithResult(_0x2de4dc,0xc9))[_0x6fc4('0x41')](handleError(_0x2de4dc,null));};exports[_0x6fc4('0x21')]=function(_0x2a1d94,_0x5a3623){if(_0x2a1d94['body']['id']){delete _0x2a1d94['body']['id'];}return db['SquareRecording']['find']({'where':{'id':_0x2a1d94[_0x6fc4('0x43')]['id']}})[_0x6fc4('0x22')](handleEntityNotFound(_0x5a3623,null))['then'](saveUpdates(_0x2a1d94[_0x6fc4('0x48')],null))[_0x6fc4('0x22')](respondWithResult(_0x5a3623,null))[_0x6fc4('0x41')](handleError(_0x5a3623,null));};exports['download']=function(_0x1462e6,_0x13cbd4,_0x18c2b5){var _0x1980e9=require('../../components/encryptor');var _0x4fbd1d=![];var _0x594d7d={};if(_0x1462e6[_0x6fc4('0x2f')][_0x6fc4('0x3d')]&&_0x1462e6['query'][_0x6fc4('0x3d')]===_0x6fc4('0x49')){_0x594d7d[_0x6fc4('0x49')]=_0x1462e6[_0x6fc4('0x43')]['id'];}else{_0x594d7d['id']=_0x1462e6[_0x6fc4('0x43')]['id'];}return db[_0x6fc4('0x29')][_0x6fc4('0x46')]({'where':_0x594d7d,'attributes':['id',_0x6fc4('0x4a'),_0x6fc4('0x4b')],'raw':!![]})[_0x6fc4('0x22')](handleEntityNotFound(_0x13cbd4,null))[_0x6fc4('0x22')](function(_0xce348e){if(_0xce348e){var _0x381420=_0xce348e[_0x6fc4('0x4a')];var _0x5b7538=util['format']('%s.cypher',_0x381420);if(fs[_0x6fc4('0x4c')](_0x5b7538)){_0x4fbd1d=!![];return _0x1980e9['decryptFile'](_0x5b7538,_0x381420,config[_0x6fc4('0x4d')][_0x6fc4('0x4e')])[_0x6fc4('0x22')](function(){return _0xce348e;});}return _0xce348e;}})[_0x6fc4('0x22')](function(_0x1acd2c){if(_0x1acd2c){var _0x4cd234=_0x1acd2c[_0x6fc4('0x4a')];if(!fs[_0x6fc4('0x4c')](_0x4cd234)){throw new db[(_0x6fc4('0x4f'))][(_0x6fc4('0x50'))]('SquareRecording\x20not\x20found');}if(_0x1acd2c[_0x6fc4('0x4b')]){return _0x13cbd4[_0x6fc4('0x51')](_0x4cd234,_0x1acd2c['filename']+path[_0x6fc4('0x52')](_0x4cd234),function(){if(_0x4fbd1d){fs['unlink'](_0x4cd234);}});}else{return _0x13cbd4['download'](_0x4cd234,function(_0x5178a2){if(_0x4fbd1d){fs[_0x6fc4('0x53')](_0x4cd234);}});}}})[_0x6fc4('0x41')](function(_0x5a1072){if(_0x5a1072[_0x6fc4('0x54')]===_0x6fc4('0x55')){_0x13cbd4[_0x6fc4('0x17')](0x194)['send'](_0x6fc4('0x56'));}else{return handleError(_0x13cbd4,null);}});};exports[_0x6fc4('0x57')]=function(_0x23ad33,_0x4d021c){return db[_0x6fc4('0x29')]['find']({'where':{'id':_0x23ad33[_0x6fc4('0x43')]['id']}})['then'](function(_0x1d166c){if(_[_0x6fc4('0x58')](_0x1d166c)){throw new ReferenceError(_0x6fc4('0x59'));}return _0x1d166c;})[_0x6fc4('0x22')](function(_0x45e881){var _0x16d3c4=_0x45e881[_0x6fc4('0x4a')];logger[_0x6fc4('0x5a')](_0x6fc4('0x5b'),_0x16d3c4);if(!_[_0x6fc4('0x58')](_0x45e881[_0x6fc4('0x4a')])&&fs[_0x6fc4('0x4c')](_0x16d3c4)){logger[_0x6fc4('0x5a')](_0x6fc4('0x5c')+_0x16d3c4+_0x6fc4('0x5d'));fs[_0x6fc4('0x5e')](_0x16d3c4);}_0x16d3c4=_0x16d3c4+_0x6fc4('0x5f');if(!_[_0x6fc4('0x58')](_0x45e881[_0x6fc4('0x4a')])&&fs[_0x6fc4('0x4c')](_0x16d3c4)){logger[_0x6fc4('0x5a')](_0x6fc4('0x5c')+_0x16d3c4+_0x6fc4('0x5d'));fs[_0x6fc4('0x5e')](_0x16d3c4);}return _0x45e881;})[_0x6fc4('0x22')](function(_0x4b3226){if(!_0x4b3226)throw new InternalError();return _0x4b3226['destroy']();})['then'](function(){_0x4d021c[_0x6fc4('0x17')](0xcc)[_0x6fc4('0x23')]();})[_0x6fc4('0x41')](handleError(_0x4d021c,null));}; \ No newline at end of file +var _0x1a39=['../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','reject','save','then','error','name','send','index','rawAttributes','fieldName','key','map','query','filters','intersection','model','attributes','fields','nolimit','sort','where','filter','merge','type','options','includeAll','include','SquareRecording','findAll','rows','show','keys','length','find','catch','create','body','update','params','download','../../components/encryptor','uniqueid','savePath','filename','format','%s.cypher','existsSync','recording','Sequelize','ValidationError','SquareRecording\x20not\x20found','unlink','message','Not\x20found','destroy','isNil','info','cancellazione\x20fisica\x20documento\x20%s','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','File:\x20\x22','unlinkSync','eml-format','rimraf','fast-json-patch','moment','util','path','sox','ejs','fs-extra','squel','crypto','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils'];(function(_0x2b0bc2,_0x4331f5){var _0x56e5b9=function(_0x4c1b06){while(--_0x4c1b06){_0x2b0bc2['push'](_0x2b0bc2['shift']());}};_0x56e5b9(++_0x4331f5);}(_0x1a39,0x15d));var _0x91a3=function(_0x2a6803,_0x5ab808){_0x2a6803=_0x2a6803-0x0;var _0x5291e7=_0x1a39[_0x2a6803];return _0x5291e7;};'use strict';var emlformat=require(_0x91a3('0x0'));var rimraf=require(_0x91a3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x91a3('0x2'));var rp=require('request-promise');var moment=require(_0x91a3('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x91a3('0x4'));var path=require(_0x91a3('0x5'));var sox=require(_0x91a3('0x6'));var csv=require('to-csv');var ejs=require(_0x91a3('0x7'));var fs=require('fs');var fs_extra=require(_0x91a3('0x8'));var _=require('lodash');var squel=require(_0x91a3('0x9'));var crypto=require(_0x91a3('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x91a3('0xb'));var querystring=require(_0x91a3('0xc'));var Papa=require(_0x91a3('0xd'));var Redis=require('ioredis');var authService=require(_0x91a3('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x91a3('0xf'));var hardwareService=require(_0x91a3('0x10'));var logger=require('../../config/logger')(_0x91a3('0x11'));var utils=require(_0x91a3('0x12'));var config=require(_0x91a3('0x13'));var licenseUtil=require(_0x91a3('0x14'));var db=require(_0x91a3('0x15'))['db'];function respondWithStatusCode(_0x4d1070,_0x2b35f9){_0x2b35f9=_0x2b35f9||0xcc;return function(_0xf05c5c){if(_0xf05c5c){return _0x4d1070['sendStatus'](_0x2b35f9);}return _0x4d1070[_0x91a3('0x16')](_0x2b35f9)[_0x91a3('0x17')]();};}function respondWithResult(_0x3fc7f6,_0x4f636f){_0x4f636f=_0x4f636f||0xc8;return function(_0x4bc2fe){if(_0x4bc2fe){return _0x3fc7f6[_0x91a3('0x16')](_0x4f636f)[_0x91a3('0x18')](_0x4bc2fe);}};}function respondWithFilteredResult(_0x3d7ff9,_0xecb582){return function(_0x37fcc1){if(_0x37fcc1){var _0x284a3a=typeof _0xecb582[_0x91a3('0x19')]===_0x91a3('0x1a')&&typeof _0xecb582[_0x91a3('0x1b')]===_0x91a3('0x1a');var _0x156cea=_0x37fcc1[_0x91a3('0x1c')];var _0x28e7a1=_0x284a3a?0x0:_0xecb582[_0x91a3('0x19')];var _0x38b452=_0x284a3a?_0x37fcc1['count']:_0xecb582['offset']+_0xecb582[_0x91a3('0x1b')];var _0x486ac2;if(_0x38b452>=_0x156cea){_0x38b452=_0x156cea;_0x486ac2=0xc8;}else{_0x486ac2=0xce;}_0x3d7ff9[_0x91a3('0x16')](_0x486ac2);return _0x3d7ff9[_0x91a3('0x1d')]('Content-Range',_0x28e7a1+'-'+_0x38b452+'/'+_0x156cea)[_0x91a3('0x18')](_0x37fcc1);}return null;};}function patchUpdates(_0x1f7ee5){return function(_0x3e2cad){try{jsonpatch[_0x91a3('0x1e')](_0x3e2cad,_0x1f7ee5,!![]);}catch(_0x5307f6){return BPromise[_0x91a3('0x1f')](_0x5307f6);}return _0x3e2cad[_0x91a3('0x20')]();};}function saveUpdates(_0x559ce2,_0x52b425){return function(_0x2b241e){if(_0x2b241e){return _0x2b241e['update'](_0x559ce2)[_0x91a3('0x21')](function(_0x371423){return _0x371423;});}return null;};}function removeEntity(_0x43bdb5,_0xcd7e36){return function(_0x433e04){if(_0x433e04){return _0x433e04['destroy']()[_0x91a3('0x21')](function(){_0x43bdb5[_0x91a3('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x414dcf,_0x1e438a){return function(_0x48ccf7){if(!_0x48ccf7){_0x414dcf['sendStatus'](0x194);}return _0x48ccf7;};}function handleError(_0x1a3f76,_0x341d23){_0x341d23=_0x341d23||0x1f4;return function(_0x5d5ee1){logger[_0x91a3('0x22')](_0x5d5ee1['stack']);if(_0x5d5ee1[_0x91a3('0x23')]){delete _0x5d5ee1[_0x91a3('0x23')];}_0x1a3f76[_0x91a3('0x16')](_0x341d23)[_0x91a3('0x24')](_0x5d5ee1);};}exports[_0x91a3('0x25')]=function(_0x344192,_0x153aeb){var _0x31c73b={},_0x2ea11a={},_0x53bf1d={'count':0x0,'rows':[]};var _0x39edcb=_['map'](db['SquareRecording'][_0x91a3('0x26')],function(_0x2a6662){return{'name':_0x2a6662[_0x91a3('0x27')],'type':_0x2a6662['type'][_0x91a3('0x28')]};});_0x2ea11a['model']=_[_0x91a3('0x29')](_0x39edcb,'name');_0x2ea11a[_0x91a3('0x2a')]=_['keys'](_0x344192['query']);_0x2ea11a[_0x91a3('0x2b')]=_[_0x91a3('0x2c')](_0x2ea11a[_0x91a3('0x2d')],_0x2ea11a['query']);_0x31c73b[_0x91a3('0x2e')]=_[_0x91a3('0x2c')](_0x2ea11a[_0x91a3('0x2d')],qs[_0x91a3('0x2f')](_0x344192['query'][_0x91a3('0x2f')]));_0x31c73b[_0x91a3('0x2e')]=_0x31c73b[_0x91a3('0x2e')]['length']?_0x31c73b[_0x91a3('0x2e')]:_0x2ea11a[_0x91a3('0x2d')];if(!_0x344192[_0x91a3('0x2a')]['hasOwnProperty'](_0x91a3('0x30'))){_0x31c73b[_0x91a3('0x1b')]=qs[_0x91a3('0x1b')](_0x344192['query'][_0x91a3('0x1b')]);_0x31c73b['offset']=qs[_0x91a3('0x19')](_0x344192[_0x91a3('0x2a')][_0x91a3('0x19')]);}_0x31c73b['order']=qs[_0x91a3('0x31')](_0x344192[_0x91a3('0x2a')][_0x91a3('0x31')]);_0x31c73b[_0x91a3('0x32')]=qs[_0x91a3('0x2b')](_['pick'](_0x344192[_0x91a3('0x2a')],_0x2ea11a[_0x91a3('0x2b')]),_0x39edcb);if(_0x344192[_0x91a3('0x2a')][_0x91a3('0x33')]){_0x31c73b[_0x91a3('0x32')]=_[_0x91a3('0x34')](_0x31c73b[_0x91a3('0x32')],{'$or':_[_0x91a3('0x29')](_0x39edcb,function(_0x4c4383){if(_0x4c4383[_0x91a3('0x35')]!=='VIRTUAL'){var _0x280c84={};_0x280c84[_0x4c4383[_0x91a3('0x23')]]={'$like':'%'+_0x344192[_0x91a3('0x2a')][_0x91a3('0x33')]+'%'};return _0x280c84;}})});}_0x31c73b=_['merge']({},_0x31c73b,_0x344192[_0x91a3('0x36')]);var _0x3074d8={'where':_0x31c73b['where']};return db['SquareRecording'][_0x91a3('0x1c')](_0x3074d8)[_0x91a3('0x21')](function(_0x45abeb){_0x53bf1d[_0x91a3('0x1c')]=_0x45abeb;if(_0x344192[_0x91a3('0x2a')][_0x91a3('0x37')]){_0x31c73b[_0x91a3('0x38')]=[{'all':!![]}];}return db[_0x91a3('0x39')][_0x91a3('0x3a')](_0x31c73b);})[_0x91a3('0x21')](function(_0x3d82ab){_0x53bf1d[_0x91a3('0x3b')]=_0x3d82ab;return _0x53bf1d;})[_0x91a3('0x21')](respondWithFilteredResult(_0x153aeb,_0x31c73b))['catch'](handleError(_0x153aeb,null));};exports[_0x91a3('0x3c')]=function(_0x983713,_0x55ebc6){var _0x49442b={'raw':!![],'where':{'id':_0x983713['params']['id']}},_0xc3f072={};_0xc3f072[_0x91a3('0x2d')]=_[_0x91a3('0x3d')](db[_0x91a3('0x39')][_0x91a3('0x26')]);_0xc3f072['query']=_[_0x91a3('0x3d')](_0x983713[_0x91a3('0x2a')]);_0xc3f072[_0x91a3('0x2b')]=_[_0x91a3('0x2c')](_0xc3f072[_0x91a3('0x2d')],_0xc3f072['query']);_0x49442b[_0x91a3('0x2e')]=_[_0x91a3('0x2c')](_0xc3f072['model'],qs[_0x91a3('0x2f')](_0x983713[_0x91a3('0x2a')][_0x91a3('0x2f')]));_0x49442b[_0x91a3('0x2e')]=_0x49442b[_0x91a3('0x2e')][_0x91a3('0x3e')]?_0x49442b[_0x91a3('0x2e')]:_0xc3f072[_0x91a3('0x2d')];if(_0x983713[_0x91a3('0x2a')][_0x91a3('0x37')]){_0x49442b[_0x91a3('0x38')]=[{'all':!![]}];}_0x49442b=_['merge']({},_0x49442b,_0x983713[_0x91a3('0x36')]);return db['SquareRecording'][_0x91a3('0x3f')](_0x49442b)[_0x91a3('0x21')](handleEntityNotFound(_0x55ebc6,null))[_0x91a3('0x21')](respondWithResult(_0x55ebc6,null))[_0x91a3('0x40')](handleError(_0x55ebc6,null));};exports[_0x91a3('0x41')]=function(_0x4f2d88,_0x4681c1){return db[_0x91a3('0x39')][_0x91a3('0x41')](_0x4f2d88[_0x91a3('0x42')],{})[_0x91a3('0x21')](respondWithResult(_0x4681c1,0xc9))[_0x91a3('0x40')](handleError(_0x4681c1,null));};exports[_0x91a3('0x43')]=function(_0x30c5b1,_0x31197e){if(_0x30c5b1[_0x91a3('0x42')]['id']){delete _0x30c5b1[_0x91a3('0x42')]['id'];}return db[_0x91a3('0x39')]['find']({'where':{'id':_0x30c5b1[_0x91a3('0x44')]['id']}})['then'](handleEntityNotFound(_0x31197e,null))[_0x91a3('0x21')](saveUpdates(_0x30c5b1['body'],null))[_0x91a3('0x21')](respondWithResult(_0x31197e,null))[_0x91a3('0x40')](handleError(_0x31197e,null));};exports[_0x91a3('0x45')]=function(_0x3fe9da,_0x367f19,_0x58f9c7){var _0x11ce1a=require(_0x91a3('0x46'));var _0x302407=![];var _0x3d27c0={};if(_0x3fe9da[_0x91a3('0x2a')][_0x91a3('0x35')]&&_0x3fe9da[_0x91a3('0x2a')]['type']===_0x91a3('0x47')){_0x3d27c0['uniqueid']=_0x3fe9da[_0x91a3('0x44')]['id'];}else{_0x3d27c0['id']=_0x3fe9da[_0x91a3('0x44')]['id'];}return db[_0x91a3('0x39')][_0x91a3('0x3f')]({'where':_0x3d27c0,'attributes':['id',_0x91a3('0x48'),_0x91a3('0x49')],'raw':!![]})[_0x91a3('0x21')](handleEntityNotFound(_0x367f19,null))[_0x91a3('0x21')](function(_0x4c6906){if(_0x4c6906){var _0x16a393=_0x4c6906[_0x91a3('0x48')];var _0x1fad5a=util[_0x91a3('0x4a')](_0x91a3('0x4b'),_0x16a393);if(fs[_0x91a3('0x4c')](_0x1fad5a)){_0x302407=!![];return _0x11ce1a['decryptFile'](_0x1fad5a,_0x16a393,config['secrets'][_0x91a3('0x4d')])[_0x91a3('0x21')](function(){return _0x4c6906;});}return _0x4c6906;}})[_0x91a3('0x21')](function(_0x43161b){if(_0x43161b){var _0x4287df=_0x43161b[_0x91a3('0x48')];if(!fs['existsSync'](_0x4287df)){throw new db[(_0x91a3('0x4e'))][(_0x91a3('0x4f'))](_0x91a3('0x50'));}if(_0x43161b['filename']){return _0x367f19[_0x91a3('0x45')](_0x4287df,_0x43161b['filename']+path['extname'](_0x4287df),function(){if(_0x302407){fs[_0x91a3('0x51')](_0x4287df);}});}else{return _0x367f19[_0x91a3('0x45')](_0x4287df,function(_0x17311d){if(_0x302407){fs[_0x91a3('0x51')](_0x4287df);}});}}})['catch'](function(_0x45a0d3){if(_0x45a0d3[_0x91a3('0x52')]===_0x91a3('0x50')){_0x367f19[_0x91a3('0x16')](0x194)['send'](_0x91a3('0x53'));}else{return handleError(_0x367f19,null);}});};exports[_0x91a3('0x54')]=function(_0x1e22a8,_0x2c341f){return db[_0x91a3('0x39')][_0x91a3('0x3f')]({'where':{'id':_0x1e22a8[_0x91a3('0x44')]['id']}})[_0x91a3('0x21')](function(_0xa2df3a){if(_[_0x91a3('0x55')](_0xa2df3a)){throw new ReferenceError('Entity\x20not\x20found');}return _0xa2df3a;})[_0x91a3('0x21')](function(_0x1ca8fc){var _0x51bf0c=_0x1ca8fc[_0x91a3('0x48')];logger[_0x91a3('0x56')](_0x91a3('0x57'),_0x51bf0c);if(!_[_0x91a3('0x55')](_0x1ca8fc[_0x91a3('0x48')])&&fs[_0x91a3('0x4c')](_0x51bf0c)){logger['info']('File:\x20\x22'+_0x51bf0c+_0x91a3('0x58'));fs['unlinkSync'](_0x51bf0c);}_0x51bf0c=_0x51bf0c+_0x91a3('0x59');if(!_[_0x91a3('0x55')](_0x1ca8fc[_0x91a3('0x48')])&&fs['existsSync'](_0x51bf0c)){logger['info'](_0x91a3('0x5a')+_0x51bf0c+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x91a3('0x5b')](_0x51bf0c);}return _0x1ca8fc;})[_0x91a3('0x21')](function(_0x46918b){if(!_0x46918b)throw new InternalError();return _0x46918b[_0x91a3('0x54')]();})[_0x91a3('0x21')](function(){_0x2c341f['status'](0xcc)[_0x91a3('0x17')]();})[_0x91a3('0x40')](handleError(_0x2c341f,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index 7252ad6..3fc3b92 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 _0xd2f5=['../../config/environment','./squareRecording.attributes','exports','SquareRecording','square_recordings','lodash','../../config/logger','moment','request-promise','path','rimraf'];(function(_0x227316,_0x11e02a){var _0x10dca6=function(_0x451b17){while(--_0x451b17){_0x227316['push'](_0x227316['shift']());}};_0x10dca6(++_0x11e02a);}(_0xd2f5,0x144));var _0x5d2f=function(_0x57feb2,_0x531e10){_0x57feb2=_0x57feb2-0x0;var _0x55fa97=_0xd2f5[_0x57feb2];return _0x55fa97;};'use strict';var _=require(_0x5d2f('0x0'));var util=require('util');var logger=require(_0x5d2f('0x1'))('api');var moment=require(_0x5d2f('0x2'));var BPromise=require('bluebird');var rp=require(_0x5d2f('0x3'));var fs=require('fs');var path=require(_0x5d2f('0x4'));var rimraf=require(_0x5d2f('0x5'));var config=require(_0x5d2f('0x6'));var attributes=require(_0x5d2f('0x7'));module[_0x5d2f('0x8')]=function(_0x2392df,_0x16e9fa){return _0x2392df['define'](_0x5d2f('0x9'),attributes,{'tableName':_0x5d2f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc74c=['exports','SquareRecording','square_recordings','lodash','util','moment','bluebird','path','rimraf','../../config/environment','./squareRecording.attributes'];(function(_0x2068d0,_0x3f28de){var _0x42f026=function(_0x45eefb){while(--_0x45eefb){_0x2068d0['push'](_0x2068d0['shift']());}};_0x42f026(++_0x3f28de);}(_0xc74c,0x163));var _0xcc74=function(_0x51ee2c,_0x491d3a){_0x51ee2c=_0x51ee2c-0x0;var _0x2d83d6=_0xc74c[_0x51ee2c];return _0x2d83d6;};'use strict';var _=require(_0xcc74('0x0'));var util=require(_0xcc74('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xcc74('0x2'));var BPromise=require(_0xcc74('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcc74('0x4'));var rimraf=require(_0xcc74('0x5'));var config=require(_0xcc74('0x6'));var attributes=require(_0xcc74('0x7'));module[_0xcc74('0x8')]=function(_0x23c249,_0x425b73){return _0x23c249['define'](_0xcc74('0x9'),attributes,{'tableName':_0xcc74('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.rpc.js b/server/api/squareRecording/squareRecording.rpc.js index b3afe4a..73d9a69 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 _0x6b4c=['then','info','request\x20sent','SquareRecording,\x20%s,\x20%s,\x20%s','error','message','SquareRecording,\x20%s,\x20%s','result','catch','SquareRecording','create','body','options','CreateSquareRecording','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x2b05e7,_0x17c224){var _0x1ef921=function(_0x55edda){while(--_0x55edda){_0x2b05e7['push'](_0x2b05e7['shift']());}};_0x1ef921(++_0x17c224);}(_0x6b4c,0xb0));var _0xc6b4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6b4c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc6b4('0x0'));var util=require('util');var moment=require(_0xc6b4('0x1'));var BPromise=require(_0xc6b4('0x2'));var rs=require(_0xc6b4('0x3'));var fs=require('fs');var Redis=require(_0xc6b4('0x4'));var db=require(_0xc6b4('0x5'))['db'];var utils=require(_0xc6b4('0x6'));var logger=require(_0xc6b4('0x7'))(_0xc6b4('0x8'));var config=require(_0xc6b4('0x9'));var jayson=require(_0xc6b4('0xa'));var client=jayson[_0xc6b4('0xb')][_0xc6b4('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x142861,_0x30516d,_0x52dd34){return new BPromise(function(_0x420c38,_0x368e7c){return client['request'](_0x142861,_0x52dd34)[_0xc6b4('0xd')](function(_0x2a59a9){logger[_0xc6b4('0xe')]('SquareRecording,\x20%s,\x20%s',_0x30516d,_0xc6b4('0xf'));logger['debug'](_0xc6b4('0x10'),_0x30516d,'request\x20sent',JSON['stringify'](_0x2a59a9));if(_0x2a59a9['error']){if(_0x2a59a9[_0xc6b4('0x11')]['code']===0x1f4){logger[_0xc6b4('0x11')]('SquareRecording,\x20%s,\x20%s',_0x30516d,_0x2a59a9[_0xc6b4('0x11')][_0xc6b4('0x12')]);return _0x368e7c(_0x2a59a9[_0xc6b4('0x11')][_0xc6b4('0x12')]);}logger[_0xc6b4('0x11')](_0xc6b4('0x13'),_0x30516d,_0x2a59a9[_0xc6b4('0x11')][_0xc6b4('0x12')]);return _0x420c38(_0x2a59a9[_0xc6b4('0x11')][_0xc6b4('0x12')]);}else{logger[_0xc6b4('0xe')]('SquareRecording,\x20%s,\x20%s',_0x30516d,_0xc6b4('0xf'));_0x420c38(_0x2a59a9[_0xc6b4('0x14')]['message']);}})[_0xc6b4('0x15')](function(_0x293bfd){logger['error']('SquareRecording,\x20%s,\x20%s',_0x30516d,_0x293bfd);_0x368e7c(_0x293bfd);});});}exports['CreateSquareRecording']=function(_0x49f121){var _0x22f1f7=this;return new Promise(function(_0x2a1761,_0x2a3ae3){return db[_0xc6b4('0x16')][_0xc6b4('0x17')](_0x49f121[_0xc6b4('0x18')],{'raw':_0x49f121[_0xc6b4('0x19')]?_0x49f121['options']['raw']===undefined?!![]:![]:!![]})[_0xc6b4('0xd')](function(_0x242777){logger[_0xc6b4('0xe')](_0xc6b4('0x1a'),_0x49f121);logger['debug']('CreateSquareRecording',_0x49f121,JSON['stringify'](_0x242777));_0x2a1761(_0x242777);})[_0xc6b4('0x15')](function(_0x23b69d){logger[_0xc6b4('0x11')]('CreateSquareRecording',_0x23b69d[_0xc6b4('0x12')],_0x49f121);_0x2a3ae3(_0x22f1f7[_0xc6b4('0x11')](0x1f4,_0x23b69d[_0xc6b4('0x12')]));});});}; \ No newline at end of file +var _0x5c94=['body','options','raw','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','CreateSquareRecording','create'];(function(_0x4e93a9,_0x413f30){var _0x43013c=function(_0x3a0cf3){while(--_0x3a0cf3){_0x4e93a9['push'](_0x4e93a9['shift']());}};_0x43013c(++_0x413f30);}(_0x5c94,0xdb));var _0x45c9=function(_0x1bc6c8,_0x5d5b63){_0x1bc6c8=_0x1bc6c8-0x0;var _0x22fc6b=_0x5c94[_0x1bc6c8];return _0x22fc6b;};'use strict';var _=require(_0x45c9('0x0'));var util=require(_0x45c9('0x1'));var moment=require(_0x45c9('0x2'));var BPromise=require('bluebird');var rs=require(_0x45c9('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x45c9('0x4'))['db'];var utils=require(_0x45c9('0x5'));var logger=require(_0x45c9('0x6'))(_0x45c9('0x7'));var config=require(_0x45c9('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x45c9('0x9')][_0x45c9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x518e59,_0x4fc1f8,_0x40bebf){return new BPromise(function(_0x2c589f,_0x5ee3d2){return client[_0x45c9('0xb')](_0x518e59,_0x40bebf)[_0x45c9('0xc')](function(_0x275ee3){logger[_0x45c9('0xd')](_0x45c9('0xe'),_0x4fc1f8,_0x45c9('0xf'));logger[_0x45c9('0x10')](_0x45c9('0x11'),_0x4fc1f8,_0x45c9('0xf'),JSON[_0x45c9('0x12')](_0x275ee3));if(_0x275ee3[_0x45c9('0x13')]){if(_0x275ee3[_0x45c9('0x13')]['code']===0x1f4){logger[_0x45c9('0x13')]('SquareRecording,\x20%s,\x20%s',_0x4fc1f8,_0x275ee3[_0x45c9('0x13')][_0x45c9('0x14')]);return _0x5ee3d2(_0x275ee3[_0x45c9('0x13')]['message']);}logger['error'](_0x45c9('0xe'),_0x4fc1f8,_0x275ee3[_0x45c9('0x13')][_0x45c9('0x14')]);return _0x2c589f(_0x275ee3['error'][_0x45c9('0x14')]);}else{logger[_0x45c9('0xd')](_0x45c9('0xe'),_0x4fc1f8,_0x45c9('0xf'));_0x2c589f(_0x275ee3['result']['message']);}})[_0x45c9('0x15')](function(_0x7d315b){logger[_0x45c9('0x13')]('SquareRecording,\x20%s,\x20%s',_0x4fc1f8,_0x7d315b);_0x5ee3d2(_0x7d315b);});});}exports[_0x45c9('0x16')]=function(_0x453286){var _0x146b75=this;return new Promise(function(_0x579386,_0x401bee){return db['SquareRecording'][_0x45c9('0x17')](_0x453286[_0x45c9('0x18')],{'raw':_0x453286[_0x45c9('0x19')]?_0x453286['options'][_0x45c9('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x7496d1){logger[_0x45c9('0xd')]('CreateSquareRecording',_0x453286);logger[_0x45c9('0x10')](_0x45c9('0x16'),_0x453286,JSON[_0x45c9('0x12')](_0x7496d1));_0x579386(_0x7496d1);})['catch'](function(_0x442a8b){logger[_0x45c9('0x13')](_0x45c9('0x16'),_0x442a8b[_0x45c9('0x14')],_0x453286);_0x401bee(_0x146b75[_0x45c9('0x13')](0x1f4,_0x442a8b[_0x45c9('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index 77d6c71..e2f13c0 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(_0xe1bdfa,_0x5371ce){var _0x28daee=function(_0x3d0cbb){while(--_0x3d0cbb){_0xe1bdfa['push'](_0xe1bdfa['shift']());}};_0x28daee(++_0x5371ce);}(_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 _0xbaf0=['/:id','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index','/describe','show','post','create','put'];(function(_0x376c1a,_0x2414d6){var _0x3b63f7=function(_0x1234b6){while(--_0x1234b6){_0x376c1a['push'](_0x376c1a['shift']());}};_0x3b63f7(++_0x2414d6);}(_0xbaf0,0x12a));var _0x0baf=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xbaf0[_0x126558];return _0x1f6d14;};'use strict';var multer=require('multer');var util=require(_0x0baf('0x0'));var path=require(_0x0baf('0x1'));var timeout=require(_0x0baf('0x2'));var express=require(_0x0baf('0x3'));var router=express[_0x0baf('0x4')]();var fs_extra=require(_0x0baf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var controller=require(_0x0baf('0x8'));router[_0x0baf('0x9')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xb')]);router[_0x0baf('0x9')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller['describe']);router[_0x0baf('0x9')]('/:id',auth[_0x0baf('0xa')](),controller[_0x0baf('0xd')]);router[_0x0baf('0xe')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xf')]);router[_0x0baf('0x10')](_0x0baf('0x11'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x12')]);router[_0x0baf('0x13')](_0x0baf('0x11'),auth['isAuthenticated'](),controller['destroy']);module[_0x0baf('0x14')]=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index 40dc2d9..291e81b 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 _0x6313=['BOOLEAN','exports','STRING','DATE'];(function(_0x2249db,_0x42ccd8){var _0x56adba=function(_0x5b85d9){while(--_0x5b85d9){_0x2249db['push'](_0x2249db['shift']());}};_0x56adba(++_0x42ccd8);}(_0x6313,0x89));var _0x3631=function(_0x20c3c2,_0x1b45e1){_0x20c3c2=_0x20c3c2-0x0;var _0x527149=_0x6313[_0x20c3c2];return _0x527149;};'use strict';var Sequelize=require('sequelize');module[_0x3631('0x0')]={'network':{'type':Sequelize[_0x3631('0x1')]},'network_script':{'type':Sequelize[_0x3631('0x1')]},'request':{'type':Sequelize[_0x3631('0x1')]},'channel':{'type':Sequelize[_0x3631('0x1')]},'language':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x3631('0x1')]},'uniqueid':{'type':Sequelize[_0x3631('0x1')]},'version':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'callingpres':{'type':Sequelize[_0x3631('0x1')]},'callingani2':{'type':Sequelize[_0x3631('0x1')]},'callington':{'type':Sequelize[_0x3631('0x1')]},'callingtns':{'type':Sequelize[_0x3631('0x1')]},'dnid':{'type':Sequelize[_0x3631('0x1')]},'rdnis':{'type':Sequelize[_0x3631('0x1')]},'context':{'type':Sequelize[_0x3631('0x1')]},'extension':{'type':Sequelize[_0x3631('0x1')]},'priority':{'type':Sequelize[_0x3631('0x1')]},'enhanced':{'type':Sequelize[_0x3631('0x1')]},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize[_0x3631('0x1')]},'project_name':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x3631('0x2')]},'leaveAt':{'type':Sequelize[_0x3631('0x2')]},'bot':{'type':Sequelize[_0x3631('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x88e3=['DATE','BOOLEAN','sequelize','exports','STRING'];(function(_0x3ba056,_0x3f420a){var _0x329d07=function(_0x4fb353){while(--_0x4fb353){_0x3ba056['push'](_0x3ba056['shift']());}};_0x329d07(++_0x3f420a);}(_0x88e3,0x183));var _0x388e=function(_0x1aa3fe,_0x27c5fa){_0x1aa3fe=_0x1aa3fe-0x0;var _0x163cee=_0x88e3[_0x1aa3fe];return _0x163cee;};'use strict';var Sequelize=require(_0x388e('0x0'));module[_0x388e('0x1')]={'network':{'type':Sequelize[_0x388e('0x2')]},'network_script':{'type':Sequelize[_0x388e('0x2')]},'request':{'type':Sequelize[_0x388e('0x2')]},'channel':{'type':Sequelize[_0x388e('0x2')]},'language':{'type':Sequelize[_0x388e('0x2')]},'type':{'type':Sequelize[_0x388e('0x2')]},'uniqueid':{'type':Sequelize[_0x388e('0x2')]},'version':{'type':Sequelize[_0x388e('0x2')]},'callerid':{'type':Sequelize[_0x388e('0x2')]},'calleridname':{'type':Sequelize[_0x388e('0x2')]},'callingpres':{'type':Sequelize[_0x388e('0x2')]},'callingani2':{'type':Sequelize[_0x388e('0x2')]},'callington':{'type':Sequelize[_0x388e('0x2')]},'callingtns':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0x388e('0x2')]},'rdnis':{'type':Sequelize[_0x388e('0x2')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x388e('0x2')]},'enhanced':{'type':Sequelize[_0x388e('0x2')]},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize[_0x388e('0x2')]},'project_name':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x388e('0x3')]},'leaveAt':{'type':Sequelize[_0x388e('0x3')]},'bot':{'type':Sequelize[_0x388e('0x4')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.controller.js b/server/api/squareReport/squareReport.controller.js index c7da3f4..8e3225c 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 _0x4506=['query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','keys','find','create','body','update','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','count','offset','set','Content-Range','apply','reject','save','destroy','then','stack','name','send','index','map','SquareReport','rawAttributes','fieldName','type','key','model'];(function(_0x22d19b,_0x2ae63c){var _0x220d85=function(_0x268f8e){while(--_0x268f8e){_0x22d19b['push'](_0x22d19b['shift']());}};_0x220d85(++_0x2ae63c);}(_0x4506,0x1a6));var _0x6450=function(_0x375ea1,_0x17aab9){_0x375ea1=_0x375ea1-0x0;var _0x4fbc24=_0x4506[_0x375ea1];return _0x4fbc24;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6450('0x0'));var zipdir=require(_0x6450('0x1'));var jsonpatch=require(_0x6450('0x2'));var rp=require(_0x6450('0x3'));var moment=require(_0x6450('0x4'));var BPromise=require(_0x6450('0x5'));var Mustache=require(_0x6450('0x6'));var util=require(_0x6450('0x7'));var path=require(_0x6450('0x8'));var sox=require(_0x6450('0x9'));var csv=require('to-csv');var ejs=require(_0x6450('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6450('0xb'));var squel=require(_0x6450('0xc'));var crypto=require('crypto');var jsforce=require(_0x6450('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x6450('0xe'));var querystring=require(_0x6450('0xf'));var Papa=require(_0x6450('0x10'));var Redis=require(_0x6450('0x11'));var authService=require(_0x6450('0x12'));var qs=require(_0x6450('0x13'));var as=require(_0x6450('0x14'));var hardwareService=require(_0x6450('0x15'));var logger=require(_0x6450('0x16'))(_0x6450('0x17'));var utils=require('../../config/utils');var config=require(_0x6450('0x18'));var licenseUtil=require(_0x6450('0x19'));var db=require(_0x6450('0x1a'))['db'];function respondWithStatusCode(_0x29baa9,_0x359613){_0x359613=_0x359613||0xcc;return function(_0x2f42c1){if(_0x2f42c1){return _0x29baa9[_0x6450('0x1b')](_0x359613);}return _0x29baa9[_0x6450('0x1c')](_0x359613)[_0x6450('0x1d')]();};}function respondWithResult(_0x2a77ff,_0x2e8e8a){_0x2e8e8a=_0x2e8e8a||0xc8;return function(_0xc2abff){if(_0xc2abff){return _0x2a77ff[_0x6450('0x1c')](_0x2e8e8a)[_0x6450('0x1e')](_0xc2abff);}};}function respondWithFilteredResult(_0x38af47,_0x263acf){return function(_0x46d575){if(_0x46d575){var _0x26de96=typeof _0x263acf['offset']==='undefined'&&typeof _0x263acf[_0x6450('0x1f')]==='undefined';var _0x45eb42=_0x46d575[_0x6450('0x20')];var _0x3814c8=_0x26de96?0x0:_0x263acf['offset'];var _0x147074=_0x26de96?_0x46d575['count']:_0x263acf[_0x6450('0x21')]+_0x263acf[_0x6450('0x1f')];var _0x49ab76;if(_0x147074>=_0x45eb42){_0x147074=_0x45eb42;_0x49ab76=0xc8;}else{_0x49ab76=0xce;}_0x38af47[_0x6450('0x1c')](_0x49ab76);return _0x38af47[_0x6450('0x22')](_0x6450('0x23'),_0x3814c8+'-'+_0x147074+'/'+_0x45eb42)[_0x6450('0x1e')](_0x46d575);}return null;};}function patchUpdates(_0x41fc8d){return function(_0x5595f7){try{jsonpatch[_0x6450('0x24')](_0x5595f7,_0x41fc8d,!![]);}catch(_0x257008){return BPromise[_0x6450('0x25')](_0x257008);}return _0x5595f7[_0x6450('0x26')]();};}function saveUpdates(_0x1bc12e,_0x4bd3b6){return function(_0x424531){if(_0x424531){return _0x424531['update'](_0x1bc12e)['then'](function(_0x1bae7f){return _0x1bae7f;});}return null;};}function removeEntity(_0x330b48,_0x473576){return function(_0x2d3c3e){if(_0x2d3c3e){return _0x2d3c3e[_0x6450('0x27')]()[_0x6450('0x28')](function(){_0x330b48[_0x6450('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0xb773c6,_0x113eaf){return function(_0x17e0cd){if(!_0x17e0cd){_0xb773c6[_0x6450('0x1b')](0x194);}return _0x17e0cd;};}function handleError(_0xf9aacf,_0x36c6d6){_0x36c6d6=_0x36c6d6||0x1f4;return function(_0x428641){logger['error'](_0x428641[_0x6450('0x29')]);if(_0x428641[_0x6450('0x2a')]){delete _0x428641[_0x6450('0x2a')];}_0xf9aacf[_0x6450('0x1c')](_0x36c6d6)[_0x6450('0x2b')](_0x428641);};}exports[_0x6450('0x2c')]=function(_0x44b7a8,_0x58daa3){var _0x493513={},_0x9cbd9={},_0x5070aa={'count':0x0,'rows':[]};var _0x35b071=_[_0x6450('0x2d')](db[_0x6450('0x2e')][_0x6450('0x2f')],function(_0x319db5){return{'name':_0x319db5[_0x6450('0x30')],'type':_0x319db5[_0x6450('0x31')][_0x6450('0x32')]};});_0x9cbd9[_0x6450('0x33')]=_[_0x6450('0x2d')](_0x35b071,_0x6450('0x2a'));_0x9cbd9[_0x6450('0x34')]=_['keys'](_0x44b7a8[_0x6450('0x34')]);_0x9cbd9[_0x6450('0x35')]=_['intersection'](_0x9cbd9['model'],_0x9cbd9[_0x6450('0x34')]);_0x493513[_0x6450('0x36')]=_[_0x6450('0x37')](_0x9cbd9['model'],qs['fields'](_0x44b7a8['query'][_0x6450('0x38')]));_0x493513[_0x6450('0x36')]=_0x493513[_0x6450('0x36')][_0x6450('0x39')]?_0x493513['attributes']:_0x9cbd9[_0x6450('0x33')];if(!_0x44b7a8[_0x6450('0x34')][_0x6450('0x3a')]('nolimit')){_0x493513['limit']=qs[_0x6450('0x1f')](_0x44b7a8[_0x6450('0x34')][_0x6450('0x1f')]);_0x493513[_0x6450('0x21')]=qs[_0x6450('0x21')](_0x44b7a8[_0x6450('0x34')][_0x6450('0x21')]);}_0x493513[_0x6450('0x3b')]=qs[_0x6450('0x3c')](_0x44b7a8[_0x6450('0x34')]['sort']);_0x493513[_0x6450('0x3d')]=qs[_0x6450('0x35')](_[_0x6450('0x3e')](_0x44b7a8[_0x6450('0x34')],_0x9cbd9[_0x6450('0x35')]),_0x35b071);if(_0x44b7a8['query'][_0x6450('0x3f')]){_0x493513[_0x6450('0x3d')]=_[_0x6450('0x40')](_0x493513['where'],{'$or':_['map'](_0x35b071,function(_0x493637){if(_0x493637[_0x6450('0x31')]!==_0x6450('0x41')){var _0x6adae0={};_0x6adae0[_0x493637['name']]={'$like':'%'+_0x44b7a8[_0x6450('0x34')][_0x6450('0x3f')]+'%'};return _0x6adae0;}})});}_0x493513=_[_0x6450('0x40')]({},_0x493513,_0x44b7a8[_0x6450('0x42')]);var _0x14be10={'where':_0x493513[_0x6450('0x3d')]};return db[_0x6450('0x2e')][_0x6450('0x20')](_0x14be10)[_0x6450('0x28')](function(_0xe027c5){_0x5070aa[_0x6450('0x20')]=_0xe027c5;if(_0x44b7a8[_0x6450('0x34')]['includeAll']){_0x493513[_0x6450('0x43')]=[{'all':!![]}];}return db[_0x6450('0x2e')][_0x6450('0x44')](_0x493513);})[_0x6450('0x28')](function(_0x5dd54b){_0x5070aa[_0x6450('0x45')]=_0x5dd54b;return _0x5070aa;})[_0x6450('0x28')](respondWithFilteredResult(_0x58daa3,_0x493513))[_0x6450('0x46')](handleError(_0x58daa3,null));};exports[_0x6450('0x47')]=function(_0x1fdb6b,_0x2a94ca){var _0x2aaafb={'raw':!![],'where':{'id':_0x1fdb6b[_0x6450('0x48')]['id']}},_0x142cc9={};_0x142cc9['model']=_[_0x6450('0x49')](db[_0x6450('0x2e')]['rawAttributes']);_0x142cc9['query']=_[_0x6450('0x49')](_0x1fdb6b[_0x6450('0x34')]);_0x142cc9['filters']=_[_0x6450('0x37')](_0x142cc9[_0x6450('0x33')],_0x142cc9[_0x6450('0x34')]);_0x2aaafb[_0x6450('0x36')]=_[_0x6450('0x37')](_0x142cc9[_0x6450('0x33')],qs['fields'](_0x1fdb6b[_0x6450('0x34')]['fields']));_0x2aaafb[_0x6450('0x36')]=_0x2aaafb[_0x6450('0x36')][_0x6450('0x39')]?_0x2aaafb[_0x6450('0x36')]:_0x142cc9[_0x6450('0x33')];if(_0x1fdb6b[_0x6450('0x34')]['includeAll']){_0x2aaafb[_0x6450('0x43')]=[{'all':!![]}];}_0x2aaafb=_[_0x6450('0x40')]({},_0x2aaafb,_0x1fdb6b[_0x6450('0x42')]);return db[_0x6450('0x2e')][_0x6450('0x4a')](_0x2aaafb)[_0x6450('0x28')](handleEntityNotFound(_0x2a94ca,null))[_0x6450('0x28')](respondWithResult(_0x2a94ca,null))[_0x6450('0x46')](handleError(_0x2a94ca,null));};exports[_0x6450('0x4b')]=function(_0xa3e5af,_0xdfc664){return db[_0x6450('0x2e')][_0x6450('0x4b')](_0xa3e5af[_0x6450('0x4c')],{})['then'](respondWithResult(_0xdfc664,0xc9))[_0x6450('0x46')](handleError(_0xdfc664,null));};exports[_0x6450('0x4d')]=function(_0x1f736b,_0x4ebcff){if(_0x1f736b['body']['id']){delete _0x1f736b[_0x6450('0x4c')]['id'];}return db[_0x6450('0x2e')][_0x6450('0x4a')]({'where':{'id':_0x1f736b['params']['id']}})[_0x6450('0x28')](handleEntityNotFound(_0x4ebcff,null))[_0x6450('0x28')](saveUpdates(_0x1f736b[_0x6450('0x4c')],null))[_0x6450('0x28')](respondWithResult(_0x4ebcff,null))[_0x6450('0x46')](handleError(_0x4ebcff,null));};exports[_0x6450('0x27')]=function(_0x2e9f41,_0x8066db){return db[_0x6450('0x2e')]['find']({'where':{'id':_0x2e9f41['params']['id']}})[_0x6450('0x28')](handleEntityNotFound(_0x8066db,null))[_0x6450('0x28')](removeEntity(_0x8066db,null))[_0x6450('0x46')](handleError(_0x8066db,null));};exports[_0x6450('0x4e')]=function(_0x15bb5f,_0x25880e){return db['SquareReport'][_0x6450('0x4e')]()['then'](respondWithResult(_0x25880e,null))[_0x6450('0x46')](handleError(_0x25880e,null));}; \ No newline at end of file +var _0x3c18=['then','destroy','error','stack','name','send','map','SquareReport','rawAttributes','fieldName','type','model','keys','query','filters','intersection','fields','attributes','nolimit','order','sort','where','filter','merge','VIRTUAL','include','rows','catch','show','params','length','options','find','create','body','describe','zip-dir','fast-json-patch','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update'];(function(_0xb63c5b,_0x2d4a23){var _0x15479f=function(_0x33eb05){while(--_0x33eb05){_0xb63c5b['push'](_0xb63c5b['shift']());}};_0x15479f(++_0x2d4a23);}(_0x3c18,0x182));var _0x83c1=function(_0x4e01f8,_0xcec95e){_0x4e01f8=_0x4e01f8-0x0;var _0x22114d=_0x3c18[_0x4e01f8];return _0x22114d;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x83c1('0x0'));var jsonpatch=require(_0x83c1('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x83c1('0x2'));var Mustache=require(_0x83c1('0x3'));var util=require(_0x83c1('0x4'));var path=require(_0x83c1('0x5'));var sox=require('sox');var csv=require(_0x83c1('0x6'));var ejs=require(_0x83c1('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x83c1('0x8'));var squel=require(_0x83c1('0x9'));var crypto=require(_0x83c1('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x83c1('0xb'));var toCsv=require(_0x83c1('0x6'));var querystring=require('querystring');var Papa=require(_0x83c1('0xc'));var Redis=require(_0x83c1('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x83c1('0xe'));var hardwareService=require(_0x83c1('0xf'));var logger=require(_0x83c1('0x10'))('api');var utils=require(_0x83c1('0x11'));var config=require(_0x83c1('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x83c1('0x13'))['db'];function respondWithStatusCode(_0x5f31cd,_0x16b745){_0x16b745=_0x16b745||0xcc;return function(_0x61b167){if(_0x61b167){return _0x5f31cd[_0x83c1('0x14')](_0x16b745);}return _0x5f31cd[_0x83c1('0x15')](_0x16b745)[_0x83c1('0x16')]();};}function respondWithResult(_0x222b57,_0x4a8a67){_0x4a8a67=_0x4a8a67||0xc8;return function(_0x8f77f9){if(_0x8f77f9){return _0x222b57[_0x83c1('0x15')](_0x4a8a67)[_0x83c1('0x17')](_0x8f77f9);}};}function respondWithFilteredResult(_0x2f32de,_0x3e777d){return function(_0x36b311){if(_0x36b311){var _0x6adb97=typeof _0x3e777d[_0x83c1('0x18')]===_0x83c1('0x19')&&typeof _0x3e777d[_0x83c1('0x1a')]==='undefined';var _0x4ee92b=_0x36b311[_0x83c1('0x1b')];var _0x28baf8=_0x6adb97?0x0:_0x3e777d[_0x83c1('0x18')];var _0x5581f1=_0x6adb97?_0x36b311[_0x83c1('0x1b')]:_0x3e777d[_0x83c1('0x18')]+_0x3e777d['limit'];var _0x4502b8;if(_0x5581f1>=_0x4ee92b){_0x5581f1=_0x4ee92b;_0x4502b8=0xc8;}else{_0x4502b8=0xce;}_0x2f32de[_0x83c1('0x15')](_0x4502b8);return _0x2f32de[_0x83c1('0x1c')](_0x83c1('0x1d'),_0x28baf8+'-'+_0x5581f1+'/'+_0x4ee92b)[_0x83c1('0x17')](_0x36b311);}return null;};}function patchUpdates(_0x25611d){return function(_0x1d8546){try{jsonpatch[_0x83c1('0x1e')](_0x1d8546,_0x25611d,!![]);}catch(_0x50b689){return BPromise[_0x83c1('0x1f')](_0x50b689);}return _0x1d8546[_0x83c1('0x20')]();};}function saveUpdates(_0x8e182b,_0x565850){return function(_0x19db12){if(_0x19db12){return _0x19db12[_0x83c1('0x21')](_0x8e182b)[_0x83c1('0x22')](function(_0x219ead){return _0x219ead;});}return null;};}function removeEntity(_0x19754e,_0x5340a0){return function(_0x16743e){if(_0x16743e){return _0x16743e[_0x83c1('0x23')]()[_0x83c1('0x22')](function(){_0x19754e[_0x83c1('0x15')](0xcc)[_0x83c1('0x16')]();});}};}function handleEntityNotFound(_0x503206,_0x1ff19e){return function(_0x4a1548){if(!_0x4a1548){_0x503206[_0x83c1('0x14')](0x194);}return _0x4a1548;};}function handleError(_0x2cdede,_0x530af9){_0x530af9=_0x530af9||0x1f4;return function(_0x37e084){logger[_0x83c1('0x24')](_0x37e084[_0x83c1('0x25')]);if(_0x37e084[_0x83c1('0x26')]){delete _0x37e084[_0x83c1('0x26')];}_0x2cdede[_0x83c1('0x15')](_0x530af9)[_0x83c1('0x27')](_0x37e084);};}exports['index']=function(_0x4389cb,_0x55456d){var _0x206dcf={},_0x4fa435={},_0x1a2b84={'count':0x0,'rows':[]};var _0x59450d=_[_0x83c1('0x28')](db[_0x83c1('0x29')][_0x83c1('0x2a')],function(_0x26219b){return{'name':_0x26219b[_0x83c1('0x2b')],'type':_0x26219b[_0x83c1('0x2c')]['key']};});_0x4fa435[_0x83c1('0x2d')]=_['map'](_0x59450d,_0x83c1('0x26'));_0x4fa435['query']=_[_0x83c1('0x2e')](_0x4389cb[_0x83c1('0x2f')]);_0x4fa435[_0x83c1('0x30')]=_[_0x83c1('0x31')](_0x4fa435['model'],_0x4fa435[_0x83c1('0x2f')]);_0x206dcf['attributes']=_['intersection'](_0x4fa435[_0x83c1('0x2d')],qs[_0x83c1('0x32')](_0x4389cb['query']['fields']));_0x206dcf[_0x83c1('0x33')]=_0x206dcf['attributes']['length']?_0x206dcf['attributes']:_0x4fa435[_0x83c1('0x2d')];if(!_0x4389cb['query']['hasOwnProperty'](_0x83c1('0x34'))){_0x206dcf[_0x83c1('0x1a')]=qs[_0x83c1('0x1a')](_0x4389cb[_0x83c1('0x2f')][_0x83c1('0x1a')]);_0x206dcf[_0x83c1('0x18')]=qs[_0x83c1('0x18')](_0x4389cb['query'][_0x83c1('0x18')]);}_0x206dcf[_0x83c1('0x35')]=qs[_0x83c1('0x36')](_0x4389cb[_0x83c1('0x2f')][_0x83c1('0x36')]);_0x206dcf[_0x83c1('0x37')]=qs['filters'](_['pick'](_0x4389cb[_0x83c1('0x2f')],_0x4fa435[_0x83c1('0x30')]),_0x59450d);if(_0x4389cb[_0x83c1('0x2f')][_0x83c1('0x38')]){_0x206dcf[_0x83c1('0x37')]=_[_0x83c1('0x39')](_0x206dcf[_0x83c1('0x37')],{'$or':_[_0x83c1('0x28')](_0x59450d,function(_0x1ef5be){if(_0x1ef5be['type']!==_0x83c1('0x3a')){var _0x2f700a={};_0x2f700a[_0x1ef5be['name']]={'$like':'%'+_0x4389cb[_0x83c1('0x2f')][_0x83c1('0x38')]+'%'};return _0x2f700a;}})});}_0x206dcf=_[_0x83c1('0x39')]({},_0x206dcf,_0x4389cb['options']);var _0x2efcbd={'where':_0x206dcf[_0x83c1('0x37')]};return db[_0x83c1('0x29')][_0x83c1('0x1b')](_0x2efcbd)[_0x83c1('0x22')](function(_0x1a86ac){_0x1a2b84[_0x83c1('0x1b')]=_0x1a86ac;if(_0x4389cb[_0x83c1('0x2f')]['includeAll']){_0x206dcf[_0x83c1('0x3b')]=[{'all':!![]}];}return db[_0x83c1('0x29')]['findAll'](_0x206dcf);})[_0x83c1('0x22')](function(_0x4c4f45){_0x1a2b84[_0x83c1('0x3c')]=_0x4c4f45;return _0x1a2b84;})[_0x83c1('0x22')](respondWithFilteredResult(_0x55456d,_0x206dcf))[_0x83c1('0x3d')](handleError(_0x55456d,null));};exports[_0x83c1('0x3e')]=function(_0x4c91fe,_0x17df87){var _0x2b3e0c={'raw':!![],'where':{'id':_0x4c91fe[_0x83c1('0x3f')]['id']}},_0x35a28a={};_0x35a28a[_0x83c1('0x2d')]=_[_0x83c1('0x2e')](db['SquareReport'][_0x83c1('0x2a')]);_0x35a28a[_0x83c1('0x2f')]=_['keys'](_0x4c91fe[_0x83c1('0x2f')]);_0x35a28a[_0x83c1('0x30')]=_[_0x83c1('0x31')](_0x35a28a[_0x83c1('0x2d')],_0x35a28a['query']);_0x2b3e0c[_0x83c1('0x33')]=_[_0x83c1('0x31')](_0x35a28a['model'],qs['fields'](_0x4c91fe['query'][_0x83c1('0x32')]));_0x2b3e0c[_0x83c1('0x33')]=_0x2b3e0c[_0x83c1('0x33')][_0x83c1('0x40')]?_0x2b3e0c['attributes']:_0x35a28a[_0x83c1('0x2d')];if(_0x4c91fe['query']['includeAll']){_0x2b3e0c[_0x83c1('0x3b')]=[{'all':!![]}];}_0x2b3e0c=_[_0x83c1('0x39')]({},_0x2b3e0c,_0x4c91fe[_0x83c1('0x41')]);return db[_0x83c1('0x29')][_0x83c1('0x42')](_0x2b3e0c)[_0x83c1('0x22')](handleEntityNotFound(_0x17df87,null))[_0x83c1('0x22')](respondWithResult(_0x17df87,null))[_0x83c1('0x3d')](handleError(_0x17df87,null));};exports[_0x83c1('0x43')]=function(_0x570e69,_0x29a914){return db[_0x83c1('0x29')][_0x83c1('0x43')](_0x570e69[_0x83c1('0x44')],{})[_0x83c1('0x22')](respondWithResult(_0x29a914,0xc9))[_0x83c1('0x3d')](handleError(_0x29a914,null));};exports['update']=function(_0x156978,_0x4e81fb){if(_0x156978[_0x83c1('0x44')]['id']){delete _0x156978[_0x83c1('0x44')]['id'];}return db[_0x83c1('0x29')][_0x83c1('0x42')]({'where':{'id':_0x156978['params']['id']}})[_0x83c1('0x22')](handleEntityNotFound(_0x4e81fb,null))[_0x83c1('0x22')](saveUpdates(_0x156978[_0x83c1('0x44')],null))[_0x83c1('0x22')](respondWithResult(_0x4e81fb,null))['catch'](handleError(_0x4e81fb,null));};exports['destroy']=function(_0x5e15aa,_0x515f86){return db[_0x83c1('0x29')][_0x83c1('0x42')]({'where':{'id':_0x5e15aa[_0x83c1('0x3f')]['id']}})[_0x83c1('0x22')](handleEntityNotFound(_0x515f86,null))[_0x83c1('0x22')](removeEntity(_0x515f86,null))[_0x83c1('0x3d')](handleError(_0x515f86,null));};exports['describe']=function(_0x1b9cd8,_0x371a46){return db[_0x83c1('0x29')][_0x83c1('0x45')]()[_0x83c1('0x22')](respondWithResult(_0x371a46,null))[_0x83c1('0x3d')](handleError(_0x371a46,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index 9a5b000..b4ccb6a 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 _0xb8d6=['report_square','uid_pname','uniqueid','project_name','leaveAt','util','../../config/logger','api','bluebird','path','rimraf','./squareReport.attributes','exports','SquareReport'];(function(_0xddf1a6,_0x37ffb4){var _0x20ba4e=function(_0xfe4048){while(--_0xfe4048){_0xddf1a6['push'](_0xddf1a6['shift']());}};_0x20ba4e(++_0x37ffb4);}(_0xb8d6,0x1ef));var _0x6b8d=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0xb8d6[_0x2cfb58];return _0xd99951;};'use strict';var _=require('lodash');var util=require(_0x6b8d('0x0'));var logger=require(_0x6b8d('0x1'))(_0x6b8d('0x2'));var moment=require('moment');var BPromise=require(_0x6b8d('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6b8d('0x4'));var rimraf=require(_0x6b8d('0x5'));var config=require('../../config/environment');var attributes=require(_0x6b8d('0x6'));module[_0x6b8d('0x7')]=function(_0x5490f3,_0x3589b1){return _0x5490f3['define'](_0x6b8d('0x8'),attributes,{'tableName':_0x6b8d('0x9'),'paranoid':![],'indexes':[{'name':_0x6b8d('0xa'),'fields':[_0x6b8d('0xb'),_0x6b8d('0xc')]},{'name':'leaveAt','fields':[_0x6b8d('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1b79=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./squareReport.attributes','exports','define','SquareReport','uid_pname','uniqueid','project_name','leaveAt','lodash','util'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x1b79,0xa8));var _0x91b7=function(_0x58e768,_0x4de6e0){_0x58e768=_0x58e768-0x0;var _0x52b07d=_0x1b79[_0x58e768];return _0x52b07d;};'use strict';var _=require(_0x91b7('0x0'));var util=require(_0x91b7('0x1'));var logger=require(_0x91b7('0x2'))(_0x91b7('0x3'));var moment=require(_0x91b7('0x4'));var BPromise=require(_0x91b7('0x5'));var rp=require(_0x91b7('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x91b7('0x7'));var config=require(_0x91b7('0x8'));var attributes=require(_0x91b7('0x9'));module[_0x91b7('0xa')]=function(_0x539624,_0x7473ba){return _0x539624[_0x91b7('0xb')](_0x91b7('0xc'),attributes,{'tableName':'report_square','paranoid':![],'indexes':[{'name':_0x91b7('0xd'),'fields':[_0x91b7('0xe'),_0x91b7('0xf')]},{'name':_0x91b7('0x10'),'fields':[_0x91b7('0x10')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index 8be42ef..6a47fa2 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 _0x074d=['stringify','error','code','message','result','catch','CreateSquareReport','SquareReport','create','options','raw','UpdateSquareReport','where','limit','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','client','http','request','then','info','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s'];(function(_0x4b73a2,_0x40b5fe){var _0x383c66=function(_0x3917ae){while(--_0x3917ae){_0x4b73a2['push'](_0x4b73a2['shift']());}};_0x383c66(++_0x40b5fe);}(_0x074d,0x1a1));var _0xd074=function(_0x368e58,_0x202095){_0x368e58=_0x368e58-0x0;var _0xa52412=_0x074d[_0x368e58];return _0xa52412;};'use strict';var _=require(_0xd074('0x0'));var util=require(_0xd074('0x1'));var moment=require('moment');var BPromise=require(_0xd074('0x2'));var rs=require(_0xd074('0x3'));var fs=require('fs');var Redis=require(_0xd074('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd074('0x5'));var logger=require('../../config/logger')(_0xd074('0x6'));var config=require('../../config/environment');var jayson=require(_0xd074('0x7'));var client=jayson[_0xd074('0x8')][_0xd074('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x141d32,_0x2fc187,_0x18350a){return new BPromise(function(_0x20241d,_0x2201e0){return client[_0xd074('0xa')](_0x141d32,_0x18350a)[_0xd074('0xb')](function(_0x2f13dd){logger[_0xd074('0xc')](_0xd074('0xd'),_0x2fc187,_0xd074('0xe'));logger[_0xd074('0xf')](_0xd074('0x10'),_0x2fc187,'request\x20sent',JSON[_0xd074('0x11')](_0x2f13dd));if(_0x2f13dd[_0xd074('0x12')]){if(_0x2f13dd[_0xd074('0x12')][_0xd074('0x13')]===0x1f4){logger[_0xd074('0x12')](_0xd074('0xd'),_0x2fc187,_0x2f13dd[_0xd074('0x12')]['message']);return _0x2201e0(_0x2f13dd[_0xd074('0x12')][_0xd074('0x14')]);}logger[_0xd074('0x12')](_0xd074('0xd'),_0x2fc187,_0x2f13dd[_0xd074('0x12')][_0xd074('0x14')]);return _0x20241d(_0x2f13dd[_0xd074('0x12')]['message']);}else{logger[_0xd074('0xc')](_0xd074('0xd'),_0x2fc187,'request\x20sent');_0x20241d(_0x2f13dd[_0xd074('0x15')][_0xd074('0x14')]);}})[_0xd074('0x16')](function(_0x34ebf3){logger['error']('SquareReport,\x20%s,\x20%s',_0x2fc187,_0x34ebf3);_0x2201e0(_0x34ebf3);});});}exports[_0xd074('0x17')]=function(_0x57ccf5){var _0x170b7e=this;return new Promise(function(_0x226bcd,_0x49dbd9){return db[_0xd074('0x18')][_0xd074('0x19')](_0x57ccf5['body'],{'raw':_0x57ccf5[_0xd074('0x1a')]?_0x57ccf5[_0xd074('0x1a')][_0xd074('0x1b')]===undefined?!![]:![]:!![]})[_0xd074('0xb')](function(_0x2c88a0){logger[_0xd074('0xc')](_0xd074('0x17'),_0x57ccf5);logger['debug'](_0xd074('0x17'),_0x57ccf5,JSON[_0xd074('0x11')](_0x2c88a0));_0x226bcd(_0x2c88a0);})['catch'](function(_0x40c713){logger[_0xd074('0x12')](_0xd074('0x17'),_0x40c713[_0xd074('0x14')],_0x57ccf5);_0x49dbd9(_0x170b7e[_0xd074('0x12')](0x1f4,_0x40c713[_0xd074('0x14')]));});});};exports[_0xd074('0x1c')]=function(_0x272e71){var _0x52f7d7=this;return new Promise(function(_0x12d5c5,_0x72e131){return db[_0xd074('0x18')]['update'](_0x272e71['body'],{'raw':_0x272e71[_0xd074('0x1a')]?_0x272e71['options'][_0xd074('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x272e71[_0xd074('0x1a')]?_0x272e71['options'][_0xd074('0x1d')]||null:null,'attributes':_0x272e71[_0xd074('0x1a')]?_0x272e71[_0xd074('0x1a')]['attributes']||null:null,'limit':_0x272e71['options']?_0x272e71[_0xd074('0x1a')][_0xd074('0x1e')]||null:null})[_0xd074('0xb')](function(_0x5ad661){logger[_0xd074('0xc')](_0xd074('0x1c'),_0x272e71);logger[_0xd074('0xf')]('UpdateSquareReport',_0x272e71,JSON['stringify'](_0x5ad661));_0x12d5c5(_0x5ad661);})[_0xd074('0x16')](function(_0x4670fb){logger[_0xd074('0x12')](_0xd074('0x1c'),_0x4670fb[_0xd074('0x14')],_0x272e71);_0x72e131(_0x52f7d7[_0xd074('0x12')](0x1f4,_0x4670fb[_0xd074('0x14')]));});});}; \ No newline at end of file +var _0xb700=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateSquareReport','SquareReport','create','body','options','raw','UpdateSquareReport','update','attributes','limit','lodash','util','bluebird','ioredis','../../mysqldb'];(function(_0x314db7,_0x23c9b5){var _0x4cce50=function(_0x555bcb){while(--_0x555bcb){_0x314db7['push'](_0x314db7['shift']());}};_0x4cce50(++_0x23c9b5);}(_0xb700,0x83));var _0x0b70=function(_0x272d90,_0x5e70ff){_0x272d90=_0x272d90-0x0;var _0x2bf4a2=_0xb700[_0x272d90];return _0x2bf4a2;};'use strict';var _=require(_0x0b70('0x0'));var util=require(_0x0b70('0x1'));var moment=require('moment');var BPromise=require(_0x0b70('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0b70('0x3'));var db=require(_0x0b70('0x4'))['db'];var utils=require(_0x0b70('0x5'));var logger=require(_0x0b70('0x6'))(_0x0b70('0x7'));var config=require(_0x0b70('0x8'));var jayson=require(_0x0b70('0x9'));var client=jayson[_0x0b70('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2ef960,_0x401400,_0x7dc882){return new BPromise(function(_0x4533b9,_0x1437e6){return client[_0x0b70('0xb')](_0x2ef960,_0x7dc882)[_0x0b70('0xc')](function(_0x49cbdd){logger['info'](_0x0b70('0xd'),_0x401400,_0x0b70('0xe'));logger[_0x0b70('0xf')](_0x0b70('0x10'),_0x401400,_0x0b70('0xe'),JSON[_0x0b70('0x11')](_0x49cbdd));if(_0x49cbdd[_0x0b70('0x12')]){if(_0x49cbdd['error'][_0x0b70('0x13')]===0x1f4){logger['error'](_0x0b70('0xd'),_0x401400,_0x49cbdd[_0x0b70('0x12')][_0x0b70('0x14')]);return _0x1437e6(_0x49cbdd[_0x0b70('0x12')][_0x0b70('0x14')]);}logger[_0x0b70('0x12')](_0x0b70('0xd'),_0x401400,_0x49cbdd[_0x0b70('0x12')][_0x0b70('0x14')]);return _0x4533b9(_0x49cbdd[_0x0b70('0x12')]['message']);}else{logger[_0x0b70('0x15')](_0x0b70('0xd'),_0x401400,_0x0b70('0xe'));_0x4533b9(_0x49cbdd[_0x0b70('0x16')][_0x0b70('0x14')]);}})[_0x0b70('0x17')](function(_0x15fc3f){logger[_0x0b70('0x12')]('SquareReport,\x20%s,\x20%s',_0x401400,_0x15fc3f);_0x1437e6(_0x15fc3f);});});}exports[_0x0b70('0x18')]=function(_0xb4679){var _0x437e05=this;return new Promise(function(_0x1d2c2a,_0x4bac4c){return db[_0x0b70('0x19')][_0x0b70('0x1a')](_0xb4679[_0x0b70('0x1b')],{'raw':_0xb4679[_0x0b70('0x1c')]?_0xb4679[_0x0b70('0x1c')][_0x0b70('0x1d')]===undefined?!![]:![]:!![]})[_0x0b70('0xc')](function(_0x26202f){logger['info'](_0x0b70('0x18'),_0xb4679);logger[_0x0b70('0xf')](_0x0b70('0x18'),_0xb4679,JSON[_0x0b70('0x11')](_0x26202f));_0x1d2c2a(_0x26202f);})[_0x0b70('0x17')](function(_0x390a7e){logger[_0x0b70('0x12')](_0x0b70('0x18'),_0x390a7e['message'],_0xb4679);_0x4bac4c(_0x437e05[_0x0b70('0x12')](0x1f4,_0x390a7e[_0x0b70('0x14')]));});});};exports[_0x0b70('0x1e')]=function(_0x92a636){var _0x1e740a=this;return new Promise(function(_0x57385e,_0x5ecd5a){return db['SquareReport'][_0x0b70('0x1f')](_0x92a636['body'],{'raw':_0x92a636[_0x0b70('0x1c')]?_0x92a636[_0x0b70('0x1c')][_0x0b70('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x92a636['options']?_0x92a636[_0x0b70('0x1c')]['where']||null:null,'attributes':_0x92a636[_0x0b70('0x1c')]?_0x92a636[_0x0b70('0x1c')][_0x0b70('0x20')]||null:null,'limit':_0x92a636[_0x0b70('0x1c')]?_0x92a636[_0x0b70('0x1c')][_0x0b70('0x21')]||null:null})[_0x0b70('0xc')](function(_0x447c80){logger[_0x0b70('0x15')](_0x0b70('0x1e'),_0x92a636);logger[_0x0b70('0xf')](_0x0b70('0x1e'),_0x92a636,JSON[_0x0b70('0x11')](_0x447c80));_0x57385e(_0x447c80);})[_0x0b70('0x17')](function(_0x181744){logger[_0x0b70('0x12')]('UpdateSquareReport',_0x181744['message'],_0x92a636);_0x5ecd5a(_0x1e740a['error'](0x1f4,_0x181744[_0x0b70('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index 0c08309..4246a0b 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 _0x48d7=['show','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id'];(function(_0x5bc8ca,_0x2d4a88){var _0x5a8fa1=function(_0x40bb74){while(--_0x40bb74){_0x5bc8ca['push'](_0x5bc8ca['shift']());}};_0x5a8fa1(++_0x2d4a88);}(_0x48d7,0xa6));var _0x748d=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x48d7[_0x13d07a];return _0x5ee0ee;};'use strict';var multer=require(_0x748d('0x0'));var util=require(_0x748d('0x1'));var path=require(_0x748d('0x2'));var timeout=require(_0x748d('0x3'));var express=require('express');var router=express[_0x748d('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x748d('0x5'));var interaction=require(_0x748d('0x6'));var config=require(_0x748d('0x7'));var controller=require('./squareReportDetail.controller');router[_0x748d('0x8')]('/',auth['isAuthenticated'](),controller[_0x748d('0x9')]);router[_0x748d('0x8')](_0x748d('0xa'),auth[_0x748d('0xb')](),controller[_0x748d('0xc')]);router[_0x748d('0x8')](_0x748d('0xd'),auth[_0x748d('0xb')](),controller[_0x748d('0xe')]);router['post']('/',auth[_0x748d('0xb')](),controller['create']);router[_0x748d('0xf')](_0x748d('0xd'),auth[_0x748d('0xb')](),controller[_0x748d('0x10')]);router[_0x748d('0x11')](_0x748d('0xd'),auth[_0x748d('0xb')](),controller[_0x748d('0x12')]);module[_0x748d('0x13')]=router; \ No newline at end of file +var _0x7087=['isAuthenticated','index','/describe','/:id','show','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get'];(function(_0x2049a8,_0x5e8c8b){var _0x169758=function(_0x1e5ad2){while(--_0x1e5ad2){_0x2049a8['push'](_0x2049a8['shift']());}};_0x169758(++_0x5e8c8b);}(_0x7087,0x16e));var _0x7708=function(_0x1f1a4d,_0x456b0f){_0x1f1a4d=_0x1f1a4d-0x0;var _0x52b8d7=_0x7087[_0x1f1a4d];return _0x52b8d7;};'use strict';var multer=require(_0x7708('0x0'));var util=require(_0x7708('0x1'));var path=require(_0x7708('0x2'));var timeout=require(_0x7708('0x3'));var express=require(_0x7708('0x4'));var router=express[_0x7708('0x5')]();var fs_extra=require(_0x7708('0x6'));var auth=require(_0x7708('0x7'));var interaction=require(_0x7708('0x8'));var config=require(_0x7708('0x9'));var controller=require(_0x7708('0xa'));router[_0x7708('0xb')]('/',auth[_0x7708('0xc')](),controller[_0x7708('0xd')]);router['get'](_0x7708('0xe'),auth[_0x7708('0xc')](),controller['describe']);router['get'](_0x7708('0xf'),auth[_0x7708('0xc')](),controller[_0x7708('0x10')]);router['post']('/',auth[_0x7708('0xc')](),controller['create']);router[_0x7708('0x11')](_0x7708('0xf'),auth[_0x7708('0xc')](),controller['update']);router[_0x7708('0x12')]('/:id',auth[_0x7708('0xc')](),controller[_0x7708('0x13')]);module[_0x7708('0x14')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index d0602ce..755f35e 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 _0x0794=['exports','STRING','TEXT','sequelize'];(function(_0x1cd439,_0x4154ad){var _0x413696=function(_0x190bfc){while(--_0x190bfc){_0x1cd439['push'](_0x1cd439['shift']());}};_0x413696(++_0x4154ad);}(_0x0794,0x73));var _0x4079=function(_0x712575,_0x1cc897){_0x712575=_0x712575-0x0;var _0x40b83b=_0x0794[_0x712575];return _0x40b83b;};'use strict';var Sequelize=require(_0x4079('0x0'));module[_0x4079('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'node':{'type':Sequelize[_0x4079('0x2')]},'application':{'type':Sequelize[_0x4079('0x2')]},'data':{'type':Sequelize[_0x4079('0x3')]},'project_name':{'type':Sequelize[_0x4079('0x2')]},'callerid':{'type':Sequelize[_0x4079('0x2')]}}; \ No newline at end of file +var _0xb462=['exports','STRING'];(function(_0x41e32c,_0x3760dc){var _0x15da71=function(_0x30b29c){while(--_0x30b29c){_0x41e32c['push'](_0x41e32c['shift']());}};_0x15da71(++_0x3760dc);}(_0xb462,0xa2));var _0x2b46=function(_0x28f9a2,_0x5db009){_0x28f9a2=_0x28f9a2-0x0;var _0x4129dd=_0xb462[_0x28f9a2];return _0x4129dd;};'use strict';var Sequelize=require('sequelize');module[_0x2b46('0x0')]={'uniqueid':{'type':Sequelize['STRING']},'node':{'type':Sequelize[_0x2b46('0x1')]},'application':{'type':Sequelize[_0x2b46('0x1')]},'data':{'type':Sequelize['TEXT']},'project_name':{'type':Sequelize[_0x2b46('0x1')]},'callerid':{'type':Sequelize[_0x2b46('0x1')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index fa9c175..1c2f5f3 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 _0x8ee6=['fast-json-patch','request-promise','moment','mustache','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','then','destroy','end','error','index','map','rawAttributes','type','key','model','name','query','keys','filters','intersection','attributes','fields','length','order','sort','where','filter','options','SquareDetailsReport','include','findAll','rows','catch','show','params','includeAll','merge','create','body','find','describe','eml-format','rimraf','zip-dir'];(function(_0x2c93d8,_0x3c2566){var _0x8bd0f2=function(_0x14cd36){while(--_0x14cd36){_0x2c93d8['push'](_0x2c93d8['shift']());}};_0x8bd0f2(++_0x3c2566);}(_0x8ee6,0x16f));var _0x68ee=function(_0x15ff8c,_0x7e9ef7){_0x15ff8c=_0x15ff8c-0x0;var _0x4292e3=_0x8ee6[_0x15ff8c];return _0x4292e3;};'use strict';var emlformat=require(_0x68ee('0x0'));var rimraf=require(_0x68ee('0x1'));var zipdir=require(_0x68ee('0x2'));var jsonpatch=require(_0x68ee('0x3'));var rp=require(_0x68ee('0x4'));var moment=require(_0x68ee('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x68ee('0x6'));var util=require('util');var path=require(_0x68ee('0x7'));var sox=require('sox');var csv=require(_0x68ee('0x8'));var ejs=require(_0x68ee('0x9'));var fs=require('fs');var fs_extra=require(_0x68ee('0xa'));var _=require(_0x68ee('0xb'));var squel=require(_0x68ee('0xc'));var crypto=require('crypto');var jsforce=require(_0x68ee('0xd'));var deskjs=require(_0x68ee('0xe'));var toCsv=require(_0x68ee('0x8'));var querystring=require(_0x68ee('0xf'));var Papa=require(_0x68ee('0x10'));var Redis=require(_0x68ee('0x11'));var authService=require(_0x68ee('0x12'));var qs=require(_0x68ee('0x13'));var as=require(_0x68ee('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x68ee('0x15'))(_0x68ee('0x16'));var utils=require(_0x68ee('0x17'));var config=require(_0x68ee('0x18'));var licenseUtil=require(_0x68ee('0x19'));var db=require(_0x68ee('0x1a'))['db'];function respondWithStatusCode(_0x552137,_0x54757c){_0x54757c=_0x54757c||0xcc;return function(_0x370f96){if(_0x370f96){return _0x552137[_0x68ee('0x1b')](_0x54757c);}return _0x552137[_0x68ee('0x1c')](_0x54757c)['end']();};}function respondWithResult(_0x37c5df,_0x392ab4){_0x392ab4=_0x392ab4||0xc8;return function(_0x4f3b6f){if(_0x4f3b6f){return _0x37c5df[_0x68ee('0x1c')](_0x392ab4)[_0x68ee('0x1d')](_0x4f3b6f);}};}function respondWithFilteredResult(_0x218ef6,_0x5a5fe6){return function(_0x48aa3c){if(_0x48aa3c){var _0x373e9e=typeof _0x5a5fe6[_0x68ee('0x1e')]===_0x68ee('0x1f')&&typeof _0x5a5fe6['limit']===_0x68ee('0x1f');var _0x25d6b6=_0x48aa3c[_0x68ee('0x20')];var _0x326cfa=_0x373e9e?0x0:_0x5a5fe6['offset'];var _0x5ddf93=_0x373e9e?_0x48aa3c['count']:_0x5a5fe6['offset']+_0x5a5fe6[_0x68ee('0x21')];var _0x39c931;if(_0x5ddf93>=_0x25d6b6){_0x5ddf93=_0x25d6b6;_0x39c931=0xc8;}else{_0x39c931=0xce;}_0x218ef6[_0x68ee('0x1c')](_0x39c931);return _0x218ef6[_0x68ee('0x22')](_0x68ee('0x23'),_0x326cfa+'-'+_0x5ddf93+'/'+_0x25d6b6)[_0x68ee('0x1d')](_0x48aa3c);}return null;};}function patchUpdates(_0x358182){return function(_0x703bd9){try{jsonpatch['apply'](_0x703bd9,_0x358182,!![]);}catch(_0x477358){return BPromise[_0x68ee('0x24')](_0x477358);}return _0x703bd9[_0x68ee('0x25')]();};}function saveUpdates(_0x5a8093,_0xa6545c){return function(_0x230021){if(_0x230021){return _0x230021['update'](_0x5a8093)[_0x68ee('0x26')](function(_0x31911b){return _0x31911b;});}return null;};}function removeEntity(_0x5545eb,_0x10e51){return function(_0x555de0){if(_0x555de0){return _0x555de0[_0x68ee('0x27')]()[_0x68ee('0x26')](function(){_0x5545eb[_0x68ee('0x1c')](0xcc)[_0x68ee('0x28')]();});}};}function handleEntityNotFound(_0x1f6006,_0xc5c9b6){return function(_0x2bf398){if(!_0x2bf398){_0x1f6006[_0x68ee('0x1b')](0x194);}return _0x2bf398;};}function handleError(_0x48390f,_0x5d34a3){_0x5d34a3=_0x5d34a3||0x1f4;return function(_0x56abe8){logger[_0x68ee('0x29')](_0x56abe8['stack']);if(_0x56abe8['name']){delete _0x56abe8['name'];}_0x48390f['status'](_0x5d34a3)['send'](_0x56abe8);};}exports[_0x68ee('0x2a')]=function(_0x5144f6,_0x293012){var _0x456751={},_0xc1b67e={},_0x285f03={'count':0x0,'rows':[]};var _0x57dd5f=_[_0x68ee('0x2b')](db['SquareDetailsReport'][_0x68ee('0x2c')],function(_0x2bda36){return{'name':_0x2bda36['fieldName'],'type':_0x2bda36[_0x68ee('0x2d')][_0x68ee('0x2e')]};});_0xc1b67e[_0x68ee('0x2f')]=_[_0x68ee('0x2b')](_0x57dd5f,_0x68ee('0x30'));_0xc1b67e[_0x68ee('0x31')]=_[_0x68ee('0x32')](_0x5144f6[_0x68ee('0x31')]);_0xc1b67e[_0x68ee('0x33')]=_[_0x68ee('0x34')](_0xc1b67e['model'],_0xc1b67e[_0x68ee('0x31')]);_0x456751[_0x68ee('0x35')]=_[_0x68ee('0x34')](_0xc1b67e[_0x68ee('0x2f')],qs['fields'](_0x5144f6['query'][_0x68ee('0x36')]));_0x456751['attributes']=_0x456751['attributes'][_0x68ee('0x37')]?_0x456751['attributes']:_0xc1b67e['model'];if(!_0x5144f6['query']['hasOwnProperty']('nolimit')){_0x456751[_0x68ee('0x21')]=qs[_0x68ee('0x21')](_0x5144f6[_0x68ee('0x31')][_0x68ee('0x21')]);_0x456751['offset']=qs[_0x68ee('0x1e')](_0x5144f6[_0x68ee('0x31')][_0x68ee('0x1e')]);}_0x456751[_0x68ee('0x38')]=qs[_0x68ee('0x39')](_0x5144f6['query'][_0x68ee('0x39')]);_0x456751[_0x68ee('0x3a')]=qs[_0x68ee('0x33')](_['pick'](_0x5144f6[_0x68ee('0x31')],_0xc1b67e['filters']),_0x57dd5f);if(_0x5144f6[_0x68ee('0x31')][_0x68ee('0x3b')]){_0x456751['where']=_['merge'](_0x456751[_0x68ee('0x3a')],{'$or':_['map'](_0x57dd5f,function(_0xda1c90){if(_0xda1c90[_0x68ee('0x2d')]!=='VIRTUAL'){var _0x566ff1={};_0x566ff1[_0xda1c90['name']]={'$like':'%'+_0x5144f6['query'][_0x68ee('0x3b')]+'%'};return _0x566ff1;}})});}_0x456751=_['merge']({},_0x456751,_0x5144f6[_0x68ee('0x3c')]);var _0x11ef2d={'where':_0x456751[_0x68ee('0x3a')]};return db[_0x68ee('0x3d')][_0x68ee('0x20')](_0x11ef2d)['then'](function(_0x1f5e93){_0x285f03[_0x68ee('0x20')]=_0x1f5e93;if(_0x5144f6[_0x68ee('0x31')]['includeAll']){_0x456751[_0x68ee('0x3e')]=[{'all':!![]}];}return db[_0x68ee('0x3d')][_0x68ee('0x3f')](_0x456751);})[_0x68ee('0x26')](function(_0x1b5b0b){_0x285f03[_0x68ee('0x40')]=_0x1b5b0b;return _0x285f03;})[_0x68ee('0x26')](respondWithFilteredResult(_0x293012,_0x456751))[_0x68ee('0x41')](handleError(_0x293012,null));};exports[_0x68ee('0x42')]=function(_0x4dd2fd,_0x510d79){var _0x148a9b={'raw':!![],'where':{'id':_0x4dd2fd[_0x68ee('0x43')]['id']}},_0x17468f={};_0x17468f[_0x68ee('0x2f')]=_[_0x68ee('0x32')](db['SquareDetailsReport'][_0x68ee('0x2c')]);_0x17468f[_0x68ee('0x31')]=_[_0x68ee('0x32')](_0x4dd2fd[_0x68ee('0x31')]);_0x17468f['filters']=_[_0x68ee('0x34')](_0x17468f[_0x68ee('0x2f')],_0x17468f[_0x68ee('0x31')]);_0x148a9b[_0x68ee('0x35')]=_[_0x68ee('0x34')](_0x17468f['model'],qs[_0x68ee('0x36')](_0x4dd2fd['query'][_0x68ee('0x36')]));_0x148a9b['attributes']=_0x148a9b[_0x68ee('0x35')][_0x68ee('0x37')]?_0x148a9b['attributes']:_0x17468f[_0x68ee('0x2f')];if(_0x4dd2fd[_0x68ee('0x31')][_0x68ee('0x44')]){_0x148a9b[_0x68ee('0x3e')]=[{'all':!![]}];}_0x148a9b=_[_0x68ee('0x45')]({},_0x148a9b,_0x4dd2fd[_0x68ee('0x3c')]);return db[_0x68ee('0x3d')]['find'](_0x148a9b)['then'](handleEntityNotFound(_0x510d79,null))['then'](respondWithResult(_0x510d79,null))['catch'](handleError(_0x510d79,null));};exports[_0x68ee('0x46')]=function(_0x38a5d3,_0x41014a){return db['SquareDetailsReport'][_0x68ee('0x46')](_0x38a5d3[_0x68ee('0x47')],{})[_0x68ee('0x26')](respondWithResult(_0x41014a,0xc9))[_0x68ee('0x41')](handleError(_0x41014a,null));};exports['update']=function(_0x371cd5,_0x2313b3){if(_0x371cd5[_0x68ee('0x47')]['id']){delete _0x371cd5[_0x68ee('0x47')]['id'];}return db[_0x68ee('0x3d')][_0x68ee('0x48')]({'where':{'id':_0x371cd5['params']['id']}})[_0x68ee('0x26')](handleEntityNotFound(_0x2313b3,null))[_0x68ee('0x26')](saveUpdates(_0x371cd5['body'],null))['then'](respondWithResult(_0x2313b3,null))[_0x68ee('0x41')](handleError(_0x2313b3,null));};exports[_0x68ee('0x27')]=function(_0x218f2f,_0x3cfd29){return db[_0x68ee('0x3d')][_0x68ee('0x48')]({'where':{'id':_0x218f2f[_0x68ee('0x43')]['id']}})[_0x68ee('0x26')](handleEntityNotFound(_0x3cfd29,null))[_0x68ee('0x26')](removeEntity(_0x3cfd29,null))[_0x68ee('0x41')](handleError(_0x3cfd29,null));};exports[_0x68ee('0x49')]=function(_0x4b0155,_0xc8c888){return db[_0x68ee('0x3d')][_0x68ee('0x49')]()[_0x68ee('0x26')](respondWithResult(_0xc8c888,null))[_0x68ee('0x41')](handleError(_0xc8c888,null));}; \ No newline at end of file +var _0x1f25=['eml-format','rimraf','request-promise','moment','bluebird','mustache','path','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','stack','send','index','map','SquareDetailsReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','VIRTUAL','name','merge','includeAll','findAll','rows','catch','show','options','find','create','body','params','describe'];(function(_0x59ee10,_0x509db3){var _0x292693=function(_0x5413a3){while(--_0x5413a3){_0x59ee10['push'](_0x59ee10['shift']());}};_0x292693(++_0x509db3);}(_0x1f25,0x12c));var _0x51f2=function(_0x3b4e3b,_0x26f070){_0x3b4e3b=_0x3b4e3b-0x0;var _0x45531b=_0x1f25[_0x3b4e3b];return _0x45531b;};'use strict';var emlformat=require(_0x51f2('0x0'));var rimraf=require(_0x51f2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x51f2('0x2'));var moment=require(_0x51f2('0x3'));var BPromise=require(_0x51f2('0x4'));var Mustache=require(_0x51f2('0x5'));var util=require('util');var path=require(_0x51f2('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x51f2('0x7'));var _=require(_0x51f2('0x8'));var squel=require(_0x51f2('0x9'));var crypto=require(_0x51f2('0xa'));var jsforce=require(_0x51f2('0xb'));var deskjs=require(_0x51f2('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x51f2('0xd'));var Redis=require(_0x51f2('0xe'));var authService=require(_0x51f2('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x51f2('0x10'));var hardwareService=require(_0x51f2('0x11'));var logger=require(_0x51f2('0x12'))(_0x51f2('0x13'));var utils=require(_0x51f2('0x14'));var config=require(_0x51f2('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x265ab2,_0x51e5ea){_0x51e5ea=_0x51e5ea||0xcc;return function(_0x273b88){if(_0x273b88){return _0x265ab2[_0x51f2('0x16')](_0x51e5ea);}return _0x265ab2[_0x51f2('0x17')](_0x51e5ea)[_0x51f2('0x18')]();};}function respondWithResult(_0x5d5ae3,_0x27a7b7){_0x27a7b7=_0x27a7b7||0xc8;return function(_0x2ae0b2){if(_0x2ae0b2){return _0x5d5ae3['status'](_0x27a7b7)[_0x51f2('0x19')](_0x2ae0b2);}};}function respondWithFilteredResult(_0x305e47,_0x3b88a4){return function(_0x185e15){if(_0x185e15){var _0x3b9e8f=typeof _0x3b88a4[_0x51f2('0x1a')]===_0x51f2('0x1b')&&typeof _0x3b88a4[_0x51f2('0x1c')]===_0x51f2('0x1b');var _0xa2b7ec=_0x185e15['count'];var _0x4acd82=_0x3b9e8f?0x0:_0x3b88a4['offset'];var _0x326ec8=_0x3b9e8f?_0x185e15[_0x51f2('0x1d')]:_0x3b88a4[_0x51f2('0x1a')]+_0x3b88a4['limit'];var _0x2a5f82;if(_0x326ec8>=_0xa2b7ec){_0x326ec8=_0xa2b7ec;_0x2a5f82=0xc8;}else{_0x2a5f82=0xce;}_0x305e47[_0x51f2('0x17')](_0x2a5f82);return _0x305e47[_0x51f2('0x1e')](_0x51f2('0x1f'),_0x4acd82+'-'+_0x326ec8+'/'+_0xa2b7ec)[_0x51f2('0x19')](_0x185e15);}return null;};}function patchUpdates(_0x1dec06){return function(_0x32a7c8){try{jsonpatch[_0x51f2('0x20')](_0x32a7c8,_0x1dec06,!![]);}catch(_0x559cb0){return BPromise[_0x51f2('0x21')](_0x559cb0);}return _0x32a7c8[_0x51f2('0x22')]();};}function saveUpdates(_0x3a93bd,_0x4f13fe){return function(_0x4688e6){if(_0x4688e6){return _0x4688e6[_0x51f2('0x23')](_0x3a93bd)[_0x51f2('0x24')](function(_0x5910a9){return _0x5910a9;});}return null;};}function removeEntity(_0x21fea2,_0x445c7b){return function(_0x20e8e9){if(_0x20e8e9){return _0x20e8e9['destroy']()[_0x51f2('0x24')](function(){_0x21fea2[_0x51f2('0x17')](0xcc)[_0x51f2('0x18')]();});}};}function handleEntityNotFound(_0x1b9a93,_0x26f233){return function(_0x54e073){if(!_0x54e073){_0x1b9a93[_0x51f2('0x16')](0x194);}return _0x54e073;};}function handleError(_0x535990,_0x296f0c){_0x296f0c=_0x296f0c||0x1f4;return function(_0x632805){logger[_0x51f2('0x25')](_0x632805[_0x51f2('0x26')]);if(_0x632805['name']){delete _0x632805['name'];}_0x535990[_0x51f2('0x17')](_0x296f0c)[_0x51f2('0x27')](_0x632805);};}exports[_0x51f2('0x28')]=function(_0x45d0ee,_0x5cdb38){var _0x2e4cae={},_0x5c6613={},_0x14362b={'count':0x0,'rows':[]};var _0x1cdf09=_[_0x51f2('0x29')](db[_0x51f2('0x2a')][_0x51f2('0x2b')],function(_0x3f8f3c){return{'name':_0x3f8f3c[_0x51f2('0x2c')],'type':_0x3f8f3c[_0x51f2('0x2d')][_0x51f2('0x2e')]};});_0x5c6613[_0x51f2('0x2f')]=_[_0x51f2('0x29')](_0x1cdf09,'name');_0x5c6613[_0x51f2('0x30')]=_[_0x51f2('0x31')](_0x45d0ee[_0x51f2('0x30')]);_0x5c6613[_0x51f2('0x32')]=_[_0x51f2('0x33')](_0x5c6613['model'],_0x5c6613[_0x51f2('0x30')]);_0x2e4cae[_0x51f2('0x34')]=_[_0x51f2('0x33')](_0x5c6613['model'],qs['fields'](_0x45d0ee[_0x51f2('0x30')][_0x51f2('0x35')]));_0x2e4cae[_0x51f2('0x34')]=_0x2e4cae[_0x51f2('0x34')][_0x51f2('0x36')]?_0x2e4cae['attributes']:_0x5c6613[_0x51f2('0x2f')];if(!_0x45d0ee[_0x51f2('0x30')]['hasOwnProperty'](_0x51f2('0x37'))){_0x2e4cae[_0x51f2('0x1c')]=qs[_0x51f2('0x1c')](_0x45d0ee['query'][_0x51f2('0x1c')]);_0x2e4cae[_0x51f2('0x1a')]=qs[_0x51f2('0x1a')](_0x45d0ee[_0x51f2('0x30')][_0x51f2('0x1a')]);}_0x2e4cae[_0x51f2('0x38')]=qs[_0x51f2('0x39')](_0x45d0ee[_0x51f2('0x30')][_0x51f2('0x39')]);_0x2e4cae['where']=qs[_0x51f2('0x32')](_[_0x51f2('0x3a')](_0x45d0ee[_0x51f2('0x30')],_0x5c6613[_0x51f2('0x32')]),_0x1cdf09);if(_0x45d0ee['query'][_0x51f2('0x3b')]){_0x2e4cae[_0x51f2('0x3c')]=_['merge'](_0x2e4cae[_0x51f2('0x3c')],{'$or':_['map'](_0x1cdf09,function(_0x4a190a){if(_0x4a190a[_0x51f2('0x2d')]!==_0x51f2('0x3d')){var _0x3191f1={};_0x3191f1[_0x4a190a[_0x51f2('0x3e')]]={'$like':'%'+_0x45d0ee[_0x51f2('0x30')][_0x51f2('0x3b')]+'%'};return _0x3191f1;}})});}_0x2e4cae=_[_0x51f2('0x3f')]({},_0x2e4cae,_0x45d0ee['options']);var _0x24cd8e={'where':_0x2e4cae['where']};return db[_0x51f2('0x2a')][_0x51f2('0x1d')](_0x24cd8e)[_0x51f2('0x24')](function(_0x5257ea){_0x14362b[_0x51f2('0x1d')]=_0x5257ea;if(_0x45d0ee[_0x51f2('0x30')][_0x51f2('0x40')]){_0x2e4cae['include']=[{'all':!![]}];}return db[_0x51f2('0x2a')][_0x51f2('0x41')](_0x2e4cae);})['then'](function(_0x201b14){_0x14362b[_0x51f2('0x42')]=_0x201b14;return _0x14362b;})[_0x51f2('0x24')](respondWithFilteredResult(_0x5cdb38,_0x2e4cae))[_0x51f2('0x43')](handleError(_0x5cdb38,null));};exports[_0x51f2('0x44')]=function(_0x17a269,_0x4de314){var _0x3fcadc={'raw':!![],'where':{'id':_0x17a269['params']['id']}},_0x4b2fbd={};_0x4b2fbd[_0x51f2('0x2f')]=_['keys'](db['SquareDetailsReport'][_0x51f2('0x2b')]);_0x4b2fbd[_0x51f2('0x30')]=_[_0x51f2('0x31')](_0x17a269[_0x51f2('0x30')]);_0x4b2fbd['filters']=_[_0x51f2('0x33')](_0x4b2fbd[_0x51f2('0x2f')],_0x4b2fbd['query']);_0x3fcadc[_0x51f2('0x34')]=_['intersection'](_0x4b2fbd[_0x51f2('0x2f')],qs['fields'](_0x17a269[_0x51f2('0x30')][_0x51f2('0x35')]));_0x3fcadc[_0x51f2('0x34')]=_0x3fcadc[_0x51f2('0x34')]['length']?_0x3fcadc[_0x51f2('0x34')]:_0x4b2fbd[_0x51f2('0x2f')];if(_0x17a269[_0x51f2('0x30')][_0x51f2('0x40')]){_0x3fcadc['include']=[{'all':!![]}];}_0x3fcadc=_[_0x51f2('0x3f')]({},_0x3fcadc,_0x17a269[_0x51f2('0x45')]);return db['SquareDetailsReport'][_0x51f2('0x46')](_0x3fcadc)['then'](handleEntityNotFound(_0x4de314,null))[_0x51f2('0x24')](respondWithResult(_0x4de314,null))[_0x51f2('0x43')](handleError(_0x4de314,null));};exports[_0x51f2('0x47')]=function(_0x3a6084,_0x1c00cc){return db[_0x51f2('0x2a')][_0x51f2('0x47')](_0x3a6084[_0x51f2('0x48')],{})[_0x51f2('0x24')](respondWithResult(_0x1c00cc,0xc9))['catch'](handleError(_0x1c00cc,null));};exports[_0x51f2('0x23')]=function(_0x8257b9,_0x53f4f0){if(_0x8257b9[_0x51f2('0x48')]['id']){delete _0x8257b9[_0x51f2('0x48')]['id'];}return db[_0x51f2('0x2a')][_0x51f2('0x46')]({'where':{'id':_0x8257b9[_0x51f2('0x49')]['id']}})['then'](handleEntityNotFound(_0x53f4f0,null))['then'](saveUpdates(_0x8257b9[_0x51f2('0x48')],null))[_0x51f2('0x24')](respondWithResult(_0x53f4f0,null))[_0x51f2('0x43')](handleError(_0x53f4f0,null));};exports['destroy']=function(_0x542c57,_0x52e9c5){return db[_0x51f2('0x2a')][_0x51f2('0x46')]({'where':{'id':_0x542c57['params']['id']}})['then'](handleEntityNotFound(_0x52e9c5,null))[_0x51f2('0x24')](removeEntity(_0x52e9c5,null))['catch'](handleError(_0x52e9c5,null));};exports[_0x51f2('0x4a')]=function(_0x3872be,_0x50448c){return db[_0x51f2('0x2a')][_0x51f2('0x4a')]()[_0x51f2('0x24')](respondWithResult(_0x50448c,null))[_0x51f2('0x43')](handleError(_0x50448c,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index a08d5a6..7077a2b 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 _0x5193=['request-promise','path','./squareReportDetail.attributes','exports','report_square_details','lodash','../../config/logger','api','bluebird'];(function(_0x985128,_0x291e5c){var _0x3eea66=function(_0xa9a27c){while(--_0xa9a27c){_0x985128['push'](_0x985128['shift']());}};_0x3eea66(++_0x291e5c);}(_0x5193,0xb9));var _0x3519=function(_0x4ae66,_0x29dd16){_0x4ae66=_0x4ae66-0x0;var _0xe5156a=_0x5193[_0x4ae66];return _0xe5156a;};'use strict';var _=require(_0x3519('0x0'));var util=require('util');var logger=require(_0x3519('0x1'))(_0x3519('0x2'));var moment=require('moment');var BPromise=require(_0x3519('0x3'));var rp=require(_0x3519('0x4'));var fs=require('fs');var path=require(_0x3519('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3519('0x6'));module[_0x3519('0x7')]=function(_0x4264a1,_0x1cea85){return _0x4264a1['define']('SquareDetailsReport',attributes,{'tableName':_0x3519('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x20f3=['../../config/environment','./squareReportDetail.attributes','exports','define','SquareDetailsReport','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x2c23ab,_0x3da84b){var _0x5320d6=function(_0x27a085){while(--_0x27a085){_0x2c23ab['push'](_0x2c23ab['shift']());}};_0x5320d6(++_0x3da84b);}(_0x20f3,0x157));var _0x320f=function(_0x37a79c,_0x2b19f0){_0x37a79c=_0x37a79c-0x0;var _0x561d89=_0x20f3[_0x37a79c];return _0x561d89;};'use strict';var _=require(_0x320f('0x0'));var util=require(_0x320f('0x1'));var logger=require(_0x320f('0x2'))(_0x320f('0x3'));var moment=require(_0x320f('0x4'));var BPromise=require('bluebird');var rp=require(_0x320f('0x5'));var fs=require('fs');var path=require(_0x320f('0x6'));var rimraf=require(_0x320f('0x7'));var config=require(_0x320f('0x8'));var attributes=require(_0x320f('0x9'));module[_0x320f('0xa')]=function(_0x4254f4,_0x2631d4){return _0x4254f4[_0x320f('0xb')](_0x320f('0xc'),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 0d14f00..99fff9c 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 _0x02ce=['message','catch','SquareDetailsReport','create','body','options','raw','CreateSquareDetailsReport','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x4a7d5d,_0x13f98f){var _0x5d38e3=function(_0x3d765a){while(--_0x3d765a){_0x4a7d5d['push'](_0x4a7d5d['shift']());}};_0x5d38e3(++_0x13f98f);}(_0x02ce,0x1ac));var _0xe02c=function(_0xad21f6,_0x3dd8b5){_0xad21f6=_0xad21f6-0x0;var _0x15c9c4=_0x02ce[_0xad21f6];return _0x15c9c4;};'use strict';var _=require(_0xe02c('0x0'));var util=require(_0xe02c('0x1'));var moment=require(_0xe02c('0x2'));var BPromise=require('bluebird');var rs=require(_0xe02c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe02c('0x4'))['db'];var utils=require(_0xe02c('0x5'));var logger=require(_0xe02c('0x6'))(_0xe02c('0x7'));var config=require(_0xe02c('0x8'));var jayson=require(_0xe02c('0x9'));var client=jayson[_0xe02c('0xa')][_0xe02c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x36a87f,_0x4fecb3,_0x5eabb0){return new BPromise(function(_0x3c757e,_0x2d85d7){return client[_0xe02c('0xc')](_0x36a87f,_0x5eabb0)[_0xe02c('0xd')](function(_0x2afbf5){logger[_0xe02c('0xe')](_0xe02c('0xf'),_0x4fecb3,_0xe02c('0x10'));logger[_0xe02c('0x11')](_0xe02c('0x12'),_0x4fecb3,_0xe02c('0x10'),JSON[_0xe02c('0x13')](_0x2afbf5));if(_0x2afbf5[_0xe02c('0x14')]){if(_0x2afbf5[_0xe02c('0x14')][_0xe02c('0x15')]===0x1f4){logger[_0xe02c('0x14')](_0xe02c('0xf'),_0x4fecb3,_0x2afbf5[_0xe02c('0x14')]['message']);return _0x2d85d7(_0x2afbf5[_0xe02c('0x14')]['message']);}logger['error'](_0xe02c('0xf'),_0x4fecb3,_0x2afbf5['error'][_0xe02c('0x16')]);return _0x3c757e(_0x2afbf5['error'][_0xe02c('0x16')]);}else{logger['info'](_0xe02c('0xf'),_0x4fecb3,_0xe02c('0x10'));_0x3c757e(_0x2afbf5['result'][_0xe02c('0x16')]);}})[_0xe02c('0x17')](function(_0x51676c){logger[_0xe02c('0x14')](_0xe02c('0xf'),_0x4fecb3,_0x51676c);_0x2d85d7(_0x51676c);});});}exports['CreateSquareDetailsReport']=function(_0x52917f){var _0x3e37bf=this;return new Promise(function(_0x49604a,_0x1f8f37){return db[_0xe02c('0x18')][_0xe02c('0x19')](_0x52917f[_0xe02c('0x1a')],{'raw':_0x52917f[_0xe02c('0x1b')]?_0x52917f['options'][_0xe02c('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x4ea9b5){logger[_0xe02c('0xe')](_0xe02c('0x1d'),_0x52917f);logger['debug'](_0xe02c('0x1d'),_0x52917f,JSON[_0xe02c('0x13')](_0x4ea9b5));_0x49604a(_0x4ea9b5);})['catch'](function(_0x38dce2){logger[_0xe02c('0x14')](_0xe02c('0x1d'),_0x38dce2[_0xe02c('0x16')],_0x52917f);_0x1f8f37(_0x3e37bf[_0xe02c('0x14')](0x1f4,_0x38dce2[_0xe02c('0x16')]));});});}; \ No newline at end of file +var _0x7382=['message','result','catch','CreateSquareDetailsReport','SquareDetailsReport','body','options','raw','stringify','util','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','SquareDetailsReport,\x20%s,\x20%s','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code'];(function(_0x2d982d,_0x121028){var _0x4f36b0=function(_0x11f3a9){while(--_0x11f3a9){_0x2d982d['push'](_0x2d982d['shift']());}};_0x4f36b0(++_0x121028);}(_0x7382,0x111));var _0x2738=function(_0x3839f4,_0x1ef286){_0x3839f4=_0x3839f4-0x0;var _0x3888d9=_0x7382[_0x3839f4];return _0x3888d9;};'use strict';var _=require('lodash');var util=require(_0x2738('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x2738('0x1'));var logger=require(_0x2738('0x2'))(_0x2738('0x3'));var config=require(_0x2738('0x4'));var jayson=require(_0x2738('0x5'));var client=jayson['client'][_0x2738('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x2bc38a,_0xd74b07,_0x523aef){return new BPromise(function(_0x4235e7,_0x487d14){return client[_0x2738('0x7')](_0x2bc38a,_0x523aef)['then'](function(_0x476864){logger[_0x2738('0x8')](_0x2738('0x9'),_0xd74b07,'request\x20sent');logger[_0x2738('0xa')](_0x2738('0xb'),_0xd74b07,_0x2738('0xc'),JSON['stringify'](_0x476864));if(_0x476864['error']){if(_0x476864[_0x2738('0xd')][_0x2738('0xe')]===0x1f4){logger[_0x2738('0xd')](_0x2738('0x9'),_0xd74b07,_0x476864[_0x2738('0xd')][_0x2738('0xf')]);return _0x487d14(_0x476864[_0x2738('0xd')][_0x2738('0xf')]);}logger[_0x2738('0xd')](_0x2738('0x9'),_0xd74b07,_0x476864[_0x2738('0xd')]['message']);return _0x4235e7(_0x476864[_0x2738('0xd')][_0x2738('0xf')]);}else{logger['info'](_0x2738('0x9'),_0xd74b07,'request\x20sent');_0x4235e7(_0x476864[_0x2738('0x10')]['message']);}})[_0x2738('0x11')](function(_0x568065){logger[_0x2738('0xd')](_0x2738('0x9'),_0xd74b07,_0x568065);_0x487d14(_0x568065);});});}exports[_0x2738('0x12')]=function(_0x3c6810){var _0x1d0aca=this;return new Promise(function(_0x1e0f57,_0x42685a){return db[_0x2738('0x13')]['create'](_0x3c6810[_0x2738('0x14')],{'raw':_0x3c6810['options']?_0x3c6810[_0x2738('0x15')][_0x2738('0x16')]===undefined?!![]:![]:!![]})['then'](function(_0x5a1d61){logger[_0x2738('0x8')](_0x2738('0x12'),_0x3c6810);logger[_0x2738('0xa')](_0x2738('0x12'),_0x3c6810,JSON[_0x2738('0x17')](_0x5a1d61));_0x1e0f57(_0x5a1d61);})[_0x2738('0x11')](function(_0x18e1d8){logger[_0x2738('0xd')](_0x2738('0x12'),_0x18e1d8[_0x2738('0xf')],_0x3c6810);_0x42685a(_0x1d0aca[_0x2738('0xd')](0x1f4,_0x18e1d8['message']));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index 057ca3f..7fad40c 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 _0x8126=['express','Router','../../components/auth/service','./system.controller','get','index','/process/:pid/kill','isAuthenticated','exports'];(function(_0x2bf40f,_0x36c9da){var _0x57c391=function(_0x1be4da){while(--_0x1be4da){_0x2bf40f['push'](_0x2bf40f['shift']());}};_0x57c391(++_0x36c9da);}(_0x8126,0xea));var _0x6812=function(_0x48da45,_0x259bea){_0x48da45=_0x48da45-0x0;var _0x5d5687=_0x8126[_0x48da45];return _0x5d5687;};'use strict';var express=require(_0x6812('0x0'));var router=express[_0x6812('0x1')]();var auth=require(_0x6812('0x2'));var controller=require(_0x6812('0x3'));router[_0x6812('0x4')]('/',auth['isAuthenticated'](),controller[_0x6812('0x5')]);router[_0x6812('0x4')](_0x6812('0x6'),auth[_0x6812('0x7')](),controller['killProcess']);module[_0x6812('0x8')]=router; \ No newline at end of file +var _0xdfd0=['/process/:pid/kill','exports','express','Router','../../components/auth/service','./system.controller','isAuthenticated','get'];(function(_0x5f2105,_0x47a4ca){var _0x7758d7=function(_0x3c57fd){while(--_0x3c57fd){_0x5f2105['push'](_0x5f2105['shift']());}};_0x7758d7(++_0x47a4ca);}(_0xdfd0,0x19a));var _0x0dfd=function(_0x31159f,_0x474997){_0x31159f=_0x31159f-0x0;var _0x120da2=_0xdfd0[_0x31159f];return _0x120da2;};'use strict';var express=require(_0x0dfd('0x0'));var router=express[_0x0dfd('0x1')]();var auth=require(_0x0dfd('0x2'));var controller=require(_0x0dfd('0x3'));router['get']('/',auth[_0x0dfd('0x4')](),controller['index']);router[_0x0dfd('0x5')](_0x0dfd('0x6'),auth['isAuthenticated'](),controller['killProcess']);module[_0x0dfd('0x7')]=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index f1f02a6..5f3c135 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 _0x7fc7=['catch','killProcess','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','split','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','exec','../../config/logger','bluebird','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status','index','then','json'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x7fc7,0x16d));var _0x77fc=function(_0x2af772,_0x3fd540){_0x2af772=_0x2af772-0x0;var _0x5eeb58=_0x7fc7[_0x2af772];return _0x5eeb58;};'use strict';var info=require(_0x77fc('0x0'));var exec=require('child_process')[_0x77fc('0x1')];var logger=require(_0x77fc('0x2'))('api');var util=require('util');var BPromise=require(_0x77fc('0x3'));var _=require(_0x77fc('0x4'));function handleError(_0xdfe67a,_0x5173dd,_0x51cb4){_0x5173dd=_0x5173dd||0x1f4;return function(_0x3b71f4){logger[_0x77fc('0x5')](_0x77fc('0x6'),_0x51cb4,_0x5173dd,util[_0x77fc('0x7')](_0x3b71f4,{'showHidden':![],'depth':null}));delete _0x3b71f4[_0x77fc('0x8')];_0xdfe67a[_0x77fc('0x9')](_0x5173dd)['send'](_0x3b71f4);};}exports[_0x77fc('0xa')]=function(_0x5e0401,_0x4bcabd){return info['getAllData']()[_0x77fc('0xb')](function(_0x493fbf){return _0x4bcabd[_0x77fc('0x9')](0xc8)[_0x77fc('0xc')](_0x493fbf);})[_0x77fc('0xd')](function(_0x551a8e){return _0x4bcabd[_0x77fc('0x9')](0x1f4)[_0x77fc('0xc')](_0x551a8e);});};exports[_0x77fc('0xe')]=function(_0x11dc98,_0x4ff64b){var _0x2e3312=[_0x77fc('0xf')];return new BPromise(function(_0x1dbf25,_0x278e5f){return exec(util[_0x77fc('0x10')](_0x77fc('0x11'),_0x11dc98[_0x77fc('0x12')][_0x77fc('0x13')]),function(_0x33bb87,_0x15f97f,_0x439352){if(_0x33bb87){return _0x278e5f(_0x33bb87);}return _0x1dbf25(_0x15f97f);});})[_0x77fc('0xb')](function(_0x155a78){var _0x3f9874=![];var _0x5db184=_0x155a78[_0x77fc('0x14')](/\n/);for(var _0x31595c=0x0,_0x3af8cf=_0x2e3312[_0x77fc('0x15')];_0x31595c<_0x3af8cf,_0x3f9874===![];_0x31595c+=0x1){if(_0x155a78[_0x77fc('0x16')](_0x2e3312[_0x31595c])>=0x0){_0x3f9874=!![];}}if(!_0x3f9874){throw new Error(util['format'](_0x77fc('0x17'),_0x11dc98[_0x77fc('0x12')][_0x77fc('0x13')]));}process[_0x77fc('0x18')](_0x11dc98[_0x77fc('0x12')][_0x77fc('0x13')],_0x77fc('0x19'));return _0x4ff64b['status'](0xc8)[_0x77fc('0xc')]({'message':util[_0x77fc('0x10')](_0x77fc('0x1a'),_0x11dc98[_0x77fc('0x12')][_0x77fc('0x13')])});})[_0x77fc('0xd')](handleError(_0x4ff64b,null,'killProcess'));}; \ No newline at end of file +var _0xe4aa=['length','Process\x20with\x20pid\x20%s\x20not\x20found!','SIGINT','format','catch','child_process','exec','../../config/logger','api','util','bluebird','lodash','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','name','status','send','index','getAllData','then','json','killProcess','components/import/cm','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','split'];(function(_0x112fe3,_0x16b642){var _0x1ec903=function(_0x1539eb){while(--_0x1539eb){_0x112fe3['push'](_0x112fe3['shift']());}};_0x1ec903(++_0x16b642);}(_0xe4aa,0xef));var _0xae4a=function(_0x2d27d5,_0x36ee88){_0x2d27d5=_0x2d27d5-0x0;var _0x510d35=_0xe4aa[_0x2d27d5];return _0x510d35;};'use strict';var info=require('systeminformation');var exec=require(_0xae4a('0x0'))[_0xae4a('0x1')];var logger=require(_0xae4a('0x2'))(_0xae4a('0x3'));var util=require(_0xae4a('0x4'));var BPromise=require(_0xae4a('0x5'));var _=require(_0xae4a('0x6'));function handleError(_0x2bce4f,_0x188199,_0x263aa4){_0x188199=_0x188199||0x1f4;return function(_0x23ec7b){logger['error'](_0xae4a('0x7'),_0x263aa4,_0x188199,util['inspect'](_0x23ec7b,{'showHidden':![],'depth':null}));delete _0x23ec7b[_0xae4a('0x8')];_0x2bce4f[_0xae4a('0x9')](_0x188199)[_0xae4a('0xa')](_0x23ec7b);};}exports[_0xae4a('0xb')]=function(_0x39c4b8,_0x3096df){return info[_0xae4a('0xc')]()[_0xae4a('0xd')](function(_0xa1271d){return _0x3096df['status'](0xc8)['json'](_0xa1271d);})['catch'](function(_0x12bbaf){return _0x3096df['status'](0x1f4)[_0xae4a('0xe')](_0x12bbaf);});};exports[_0xae4a('0xf')]=function(_0x36a0c0,_0x4c70d5){var _0x5157d7=[_0xae4a('0x10')];return new BPromise(function(_0x1fd9da,_0x3050b6){return exec(util['format'](_0xae4a('0x11'),_0x36a0c0[_0xae4a('0x12')][_0xae4a('0x13')]),function(_0x25bcdd,_0x150249,_0x4733e9){if(_0x25bcdd){return _0x3050b6(_0x25bcdd);}return _0x1fd9da(_0x150249);});})[_0xae4a('0xd')](function(_0x17cca7){var _0x2082f5=![];var _0x57f4ec=_0x17cca7[_0xae4a('0x14')](/\n/);for(var _0x28c91e=0x0,_0x2c3632=_0x5157d7[_0xae4a('0x15')];_0x28c91e<_0x2c3632,_0x2082f5===![];_0x28c91e+=0x1){if(_0x17cca7['indexOf'](_0x5157d7[_0x28c91e])>=0x0){_0x2082f5=!![];}}if(!_0x2082f5){throw new Error(util['format'](_0xae4a('0x16'),_0x36a0c0['params'][_0xae4a('0x13')]));}process['kill'](_0x36a0c0['params'][_0xae4a('0x13')],_0xae4a('0x17'));return _0x4c70d5[_0xae4a('0x9')](0xc8)['json']({'message':util[_0xae4a('0x18')]('Process\x20with\x20pid\x20%s\x20killed\x20correctly',_0x36a0c0[_0xae4a('0x12')][_0xae4a('0x13')])});})[_0xae4a('0x19')](handleError(_0x4c70d5,null,'killProcess'));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index 6d9403b..90cf80f 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 _0xdc15=['create','put','exports','multer','path','connect-timeout','express','Router','fs-extra','./tag.controller','index','get','/:id','isAuthenticated','show','post'];(function(_0x1ca3dc,_0x1f4035){var _0x3f7364=function(_0x408420){while(--_0x408420){_0x1ca3dc['push'](_0x1ca3dc['shift']());}};_0x3f7364(++_0x1f4035);}(_0xdc15,0x1f3));var _0x5dc1=function(_0x4191bc,_0x3096c5){_0x4191bc=_0x4191bc-0x0;var _0x1ffd4e=_0xdc15[_0x4191bc];return _0x1ffd4e;};'use strict';var multer=require(_0x5dc1('0x0'));var util=require('util');var path=require(_0x5dc1('0x1'));var timeout=require(_0x5dc1('0x2'));var express=require(_0x5dc1('0x3'));var router=express[_0x5dc1('0x4')]();var fs_extra=require(_0x5dc1('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x5dc1('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x5dc1('0x7')]);router[_0x5dc1('0x8')](_0x5dc1('0x9'),auth[_0x5dc1('0xa')](),controller[_0x5dc1('0xb')]);router[_0x5dc1('0xc')]('/',auth[_0x5dc1('0xa')](),controller[_0x5dc1('0xd')]);router[_0x5dc1('0xe')](_0x5dc1('0x9'),auth[_0x5dc1('0xa')](),controller['update']);router['delete'](_0x5dc1('0x9'),auth[_0x5dc1('0xa')](),controller['destroy']);module[_0x5dc1('0xf')]=router; \ No newline at end of file +var _0xce62=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./tag.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','exports','multer','util'];(function(_0x5c2bef,_0x16806e){var _0xd60cc1=function(_0x40e74a){while(--_0x40e74a){_0x5c2bef['push'](_0x5c2bef['shift']());}};_0xd60cc1(++_0x16806e);}(_0xce62,0x83));var _0x2ce6=function(_0x3ea055,_0x417051){_0x3ea055=_0x3ea055-0x0;var _0x49f289=_0xce62[_0x3ea055];return _0x49f289;};'use strict';var multer=require(_0x2ce6('0x0'));var util=require(_0x2ce6('0x1'));var path=require('path');var timeout=require(_0x2ce6('0x2'));var express=require(_0x2ce6('0x3'));var router=express[_0x2ce6('0x4')]();var fs_extra=require(_0x2ce6('0x5'));var auth=require(_0x2ce6('0x6'));var interaction=require(_0x2ce6('0x7'));var config=require('../../config/environment');var controller=require(_0x2ce6('0x8'));router[_0x2ce6('0x9')]('/',auth[_0x2ce6('0xa')](),controller[_0x2ce6('0xb')]);router[_0x2ce6('0x9')](_0x2ce6('0xc'),auth['isAuthenticated'](),controller[_0x2ce6('0xd')]);router[_0x2ce6('0xe')]('/',auth['isAuthenticated'](),controller[_0x2ce6('0xf')]);router[_0x2ce6('0x10')](_0x2ce6('0xc'),auth['isAuthenticated'](),controller[_0x2ce6('0x11')]);router['delete']('/:id',auth[_0x2ce6('0xa')](),controller['destroy']);module[_0x2ce6('0x12')]=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index 005d545..b8d0d25 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 _0xd84c=['STRING','name','#0091EA','sequelize','exports'];(function(_0x2dcaad,_0x11b802){var _0x4f339b=function(_0x160ac4){while(--_0x160ac4){_0x2dcaad['push'](_0x2dcaad['shift']());}};_0x4f339b(++_0x11b802);}(_0xd84c,0x102));var _0xcd84=function(_0x5d50f6,_0x2a0612){_0x5d50f6=_0x5d50f6-0x0;var _0x2c7088=_0xd84c[_0x5d50f6];return _0x2c7088;};'use strict';var Sequelize=require(_0xcd84('0x0'));module[_0xcd84('0x1')]={'name':{'type':Sequelize[_0xcd84('0x2')],'unique':_0xcd84('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xcd84('0x2')],'defaultValue':_0xcd84('0x4')},'description':{'type':Sequelize[_0xcd84('0x2')]}}; \ No newline at end of file +var _0xee4e=['STRING','#0091EA','sequelize','exports'];(function(_0x53d8df,_0x514c07){var _0x2a714e=function(_0x44d181){while(--_0x44d181){_0x53d8df['push'](_0x53d8df['shift']());}};_0x2a714e(++_0x514c07);}(_0xee4e,0x122));var _0xeee4=function(_0x513aa5,_0x1fba79){_0x513aa5=_0x513aa5-0x0;var _0x1a1a7c=_0xee4e[_0x513aa5];return _0x1a1a7c;};'use strict';var Sequelize=require(_0xeee4('0x0'));module[_0xeee4('0x1')]={'name':{'type':Sequelize[_0xeee4('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xeee4('0x2')],'defaultValue':_0xeee4('0x3')},'description':{'type':Sequelize[_0xeee4('0x2')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index 3eb39b4..b60586a 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 _0xb43b=['length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','params','keys','include','options','find','catch','create','body','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','get','sendStatus','stack','name','send','index','map','Tag','rawAttributes','fieldName','type','key','model','filters','intersection','query','attributes','fields'];(function(_0x15fcff,_0x1f261d){var _0x523532=function(_0x4d3cc5){while(--_0x4d3cc5){_0x15fcff['push'](_0x15fcff['shift']());}};_0x523532(++_0x1f261d);}(_0xb43b,0xbf));var _0xbb43=function(_0x26be9d,_0x2b441d){_0x26be9d=_0x26be9d-0x0;var _0x5068c0=_0xb43b[_0x26be9d];return _0x5068c0;};'use strict';var emlformat=require(_0xbb43('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbb43('0x1'));var jsonpatch=require(_0xbb43('0x2'));var rp=require(_0xbb43('0x3'));var moment=require(_0xbb43('0x4'));var BPromise=require(_0xbb43('0x5'));var Mustache=require(_0xbb43('0x6'));var util=require(_0xbb43('0x7'));var path=require(_0xbb43('0x8'));var sox=require(_0xbb43('0x9'));var csv=require(_0xbb43('0xa'));var ejs=require(_0xbb43('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbb43('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xbb43('0xd'));var deskjs=require(_0xbb43('0xe'));var toCsv=require(_0xbb43('0xa'));var querystring=require(_0xbb43('0xf'));var Papa=require(_0xbb43('0x10'));var Redis=require('ioredis');var authService=require(_0xbb43('0x11'));var qs=require(_0xbb43('0x12'));var as=require(_0xbb43('0x13'));var hardwareService=require(_0xbb43('0x14'));var logger=require('../../config/logger')(_0xbb43('0x15'));var utils=require(_0xbb43('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2867fb,_0x5d0ccc){_0x5d0ccc=_0x5d0ccc||0xcc;return function(_0x6be368){if(_0x6be368){return _0x2867fb['sendStatus'](_0x5d0ccc);}return _0x2867fb[_0xbb43('0x17')](_0x5d0ccc)[_0xbb43('0x18')]();};}function respondWithResult(_0x3ce968,_0x3327bc){_0x3327bc=_0x3327bc||0xc8;return function(_0x2e2517){if(_0x2e2517){return _0x3ce968['status'](_0x3327bc)[_0xbb43('0x19')](_0x2e2517);}};}function respondWithFilteredResult(_0x4ac25c,_0x199726){return function(_0x32425c){if(_0x32425c){var _0x15182b=typeof _0x199726[_0xbb43('0x1a')]===_0xbb43('0x1b')&&typeof _0x199726[_0xbb43('0x1c')]===_0xbb43('0x1b');var _0x209c9c=_0x32425c[_0xbb43('0x1d')];var _0x4c223b=_0x15182b?0x0:_0x199726[_0xbb43('0x1a')];var _0x4cb0b2=_0x15182b?_0x32425c[_0xbb43('0x1d')]:_0x199726['offset']+_0x199726[_0xbb43('0x1c')];var _0x5f4b4f;if(_0x4cb0b2>=_0x209c9c){_0x4cb0b2=_0x209c9c;_0x5f4b4f=0xc8;}else{_0x5f4b4f=0xce;}_0x4ac25c[_0xbb43('0x17')](_0x5f4b4f);return _0x4ac25c[_0xbb43('0x1e')]('Content-Range',_0x4c223b+'-'+_0x4cb0b2+'/'+_0x209c9c)[_0xbb43('0x19')](_0x32425c);}return null;};}function patchUpdates(_0x6cdc26){return function(_0x398ce5){try{jsonpatch[_0xbb43('0x1f')](_0x398ce5,_0x6cdc26,!![]);}catch(_0x22c5d1){return BPromise[_0xbb43('0x20')](_0x22c5d1);}return _0x398ce5[_0xbb43('0x21')]();};}function saveUpdates(_0x1e83cd,_0x3409d0){return function(_0x3cb6d1){if(_0x3cb6d1){return _0x3cb6d1[_0xbb43('0x22')](_0x1e83cd)[_0xbb43('0x23')](function(_0x36992f){return _0x36992f;});}return null;};}function removeEntity(_0x37beb0,_0x500af4){return function(_0x28b3e4){if(_0x28b3e4){return _0x28b3e4[_0xbb43('0x24')]()['then'](function(){var _0x464b4a=_0x28b3e4[_0xbb43('0x25')]({'plain':!![]});var _0x25279b='Tags';return db['UserProfileResource'][_0xbb43('0x24')]({'where':{'type':_0x25279b,'resourceId':_0x464b4a['id']}})[_0xbb43('0x23')](function(){return _0x28b3e4;});})['then'](function(){_0x37beb0['status'](0xcc)[_0xbb43('0x18')]();});}};}function handleEntityNotFound(_0xb9fe3b,_0x268fb5){return function(_0x4bb859){if(!_0x4bb859){_0xb9fe3b[_0xbb43('0x26')](0x194);}return _0x4bb859;};}function handleError(_0x426cec,_0x2dcc60){_0x2dcc60=_0x2dcc60||0x1f4;return function(_0x1a6e2b){logger['error'](_0x1a6e2b[_0xbb43('0x27')]);if(_0x1a6e2b[_0xbb43('0x28')]){delete _0x1a6e2b[_0xbb43('0x28')];}_0x426cec[_0xbb43('0x17')](_0x2dcc60)[_0xbb43('0x29')](_0x1a6e2b);};}exports[_0xbb43('0x2a')]=function(_0x2860d8,_0x48986d){var _0x3b2290={},_0x209244={},_0x3c46c6={'count':0x0,'rows':[]};var _0x5b8a7d=_[_0xbb43('0x2b')](db[_0xbb43('0x2c')][_0xbb43('0x2d')],function(_0x168374){return{'name':_0x168374[_0xbb43('0x2e')],'type':_0x168374[_0xbb43('0x2f')][_0xbb43('0x30')]};});_0x209244[_0xbb43('0x31')]=_[_0xbb43('0x2b')](_0x5b8a7d,'name');_0x209244['query']=_['keys'](_0x2860d8['query']);_0x209244[_0xbb43('0x32')]=_[_0xbb43('0x33')](_0x209244[_0xbb43('0x31')],_0x209244[_0xbb43('0x34')]);_0x3b2290[_0xbb43('0x35')]=_[_0xbb43('0x33')](_0x209244[_0xbb43('0x31')],qs[_0xbb43('0x36')](_0x2860d8['query'][_0xbb43('0x36')]));_0x3b2290[_0xbb43('0x35')]=_0x3b2290[_0xbb43('0x35')][_0xbb43('0x37')]?_0x3b2290['attributes']:_0x209244[_0xbb43('0x31')];if(!_0x2860d8[_0xbb43('0x34')][_0xbb43('0x38')](_0xbb43('0x39'))){_0x3b2290['limit']=qs[_0xbb43('0x1c')](_0x2860d8['query'][_0xbb43('0x1c')]);_0x3b2290[_0xbb43('0x1a')]=qs[_0xbb43('0x1a')](_0x2860d8[_0xbb43('0x34')][_0xbb43('0x1a')]);}_0x3b2290[_0xbb43('0x3a')]=qs[_0xbb43('0x3b')](_0x2860d8[_0xbb43('0x34')][_0xbb43('0x3b')]);_0x3b2290[_0xbb43('0x3c')]=qs[_0xbb43('0x32')](_[_0xbb43('0x3d')](_0x2860d8['query'],_0x209244[_0xbb43('0x32')]),_0x5b8a7d);if(_0x2860d8[_0xbb43('0x34')][_0xbb43('0x3e')]){_0x3b2290[_0xbb43('0x3c')]=_[_0xbb43('0x3f')](_0x3b2290[_0xbb43('0x3c')],{'$or':_[_0xbb43('0x2b')](_0x5b8a7d,function(_0x3d7d56){if(_0x3d7d56[_0xbb43('0x2f')]!==_0xbb43('0x40')){var _0x1fe204={};_0x1fe204[_0x3d7d56[_0xbb43('0x28')]]={'$like':'%'+_0x2860d8[_0xbb43('0x34')][_0xbb43('0x3e')]+'%'};return _0x1fe204;}})});}_0x3b2290=_[_0xbb43('0x3f')]({},_0x3b2290,_0x2860d8['options']);var _0x4807a3={'where':_0x3b2290[_0xbb43('0x3c')]};return db[_0xbb43('0x2c')][_0xbb43('0x1d')](_0x4807a3)[_0xbb43('0x23')](function(_0x4b32c9){_0x3c46c6['count']=_0x4b32c9;if(_0x2860d8[_0xbb43('0x34')][_0xbb43('0x41')]){_0x3b2290['include']=[{'all':!![]}];}return db['Tag'][_0xbb43('0x42')](_0x3b2290);})[_0xbb43('0x23')](function(_0x26aa10){_0x3c46c6[_0xbb43('0x43')]=_0x26aa10;return _0x3c46c6;})[_0xbb43('0x23')](respondWithFilteredResult(_0x48986d,_0x3b2290))['catch'](handleError(_0x48986d,null));};exports['show']=function(_0x2ea37b,_0x41fed6){var _0x3f48a1={'raw':!![],'where':{'id':_0x2ea37b[_0xbb43('0x44')]['id']}},_0x2d1256={};_0x2d1256[_0xbb43('0x31')]=_[_0xbb43('0x45')](db[_0xbb43('0x2c')][_0xbb43('0x2d')]);_0x2d1256[_0xbb43('0x34')]=_['keys'](_0x2ea37b['query']);_0x2d1256[_0xbb43('0x32')]=_[_0xbb43('0x33')](_0x2d1256['model'],_0x2d1256[_0xbb43('0x34')]);_0x3f48a1[_0xbb43('0x35')]=_[_0xbb43('0x33')](_0x2d1256[_0xbb43('0x31')],qs[_0xbb43('0x36')](_0x2ea37b[_0xbb43('0x34')][_0xbb43('0x36')]));_0x3f48a1['attributes']=_0x3f48a1[_0xbb43('0x35')][_0xbb43('0x37')]?_0x3f48a1['attributes']:_0x2d1256[_0xbb43('0x31')];if(_0x2ea37b[_0xbb43('0x34')]['includeAll']){_0x3f48a1[_0xbb43('0x46')]=[{'all':!![]}];}_0x3f48a1=_[_0xbb43('0x3f')]({},_0x3f48a1,_0x2ea37b[_0xbb43('0x47')]);return db[_0xbb43('0x2c')][_0xbb43('0x48')](_0x3f48a1)[_0xbb43('0x23')](handleEntityNotFound(_0x41fed6,null))[_0xbb43('0x23')](respondWithResult(_0x41fed6,null))[_0xbb43('0x49')](handleError(_0x41fed6,null));};exports[_0xbb43('0x4a')]=function(_0x2f044f,_0x38cc4d){return db[_0xbb43('0x2c')]['create'](_0x2f044f[_0xbb43('0x4b')],{})[_0xbb43('0x23')](function(_0x50096a){var _0x7089bb=_0x2f044f['user'][_0xbb43('0x25')]({'plain':!![]});if(!_0x7089bb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x7089bb[_0xbb43('0x4c')]==='user'){var _0x21f78b=_0x50096a[_0xbb43('0x25')]({'plain':!![]});var _0x26586c='Tags';return db[_0xbb43('0x4d')][_0xbb43('0x48')]({'where':{'name':_0x26586c,'userProfileId':_0x7089bb[_0xbb43('0x4e')]},'raw':!![]})['then'](function(_0xd485c7){if(_0xd485c7&&_0xd485c7[_0xbb43('0x4f')]===0x0){return db['UserProfileResource'][_0xbb43('0x4a')]({'name':_0x21f78b['name'],'resourceId':_0x21f78b['id'],'type':_0xd485c7[_0xbb43('0x28')],'sectionId':_0xd485c7['id']},{})[_0xbb43('0x23')](function(){return _0x50096a;});}else{return _0x50096a;}})['catch'](function(_0x13731d){logger[_0xbb43('0x50')](_0xbb43('0x51'),_0x13731d);throw _0x13731d;});}return _0x50096a;})['then'](respondWithResult(_0x38cc4d,0xc9))[_0xbb43('0x49')](handleError(_0x38cc4d,null));};exports['update']=function(_0x3433ff,_0x451007){if(_0x3433ff[_0xbb43('0x4b')]['id']){delete _0x3433ff['body']['id'];}return db[_0xbb43('0x2c')][_0xbb43('0x48')]({'where':{'id':_0x3433ff['params']['id']}})['then'](handleEntityNotFound(_0x451007,null))[_0xbb43('0x23')](saveUpdates(_0x3433ff[_0xbb43('0x4b')],null))['then'](respondWithResult(_0x451007,null))['catch'](handleError(_0x451007,null));};exports[_0xbb43('0x24')]=function(_0x51ca4f,_0x30908e){return db[_0xbb43('0x2c')][_0xbb43('0x48')]({'where':{'id':_0x51ca4f['params']['id']}})['then'](handleEntityNotFound(_0x30908e,null))['then'](removeEntity(_0x30908e,null))['catch'](handleError(_0x30908e,null));}; \ No newline at end of file +var _0xb43b=['rawAttributes','include','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','undefined','count','offset','limit','set','Content-Range','json','apply','reject','update','destroy','Tags','then','status','sendStatus','error','stack','name','send','index','Tag','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','merge','includeAll','rows','catch','show','params'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0xb43b,0x1b2));var _0xbb43=function(_0x3233f7,_0x106774){_0x3233f7=_0x3233f7-0x0;var _0x1e5deb=_0xb43b[_0x3233f7];return _0x1e5deb;};'use strict';var emlformat=require(_0xbb43('0x0'));var rimraf=require(_0xbb43('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbb43('0x2'));var rp=require(_0xbb43('0x3'));var moment=require(_0xbb43('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xbb43('0x5'));var util=require(_0xbb43('0x6'));var path=require(_0xbb43('0x7'));var sox=require(_0xbb43('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbb43('0x9'));var _=require('lodash');var squel=require(_0xbb43('0xa'));var crypto=require(_0xbb43('0xb'));var jsforce=require(_0xbb43('0xc'));var deskjs=require(_0xbb43('0xd'));var toCsv=require(_0xbb43('0xe'));var querystring=require('querystring');var Papa=require(_0xbb43('0xf'));var Redis=require(_0xbb43('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xbb43('0x11'));var as=require(_0xbb43('0x12'));var hardwareService=require(_0xbb43('0x13'));var logger=require(_0xbb43('0x14'))(_0xbb43('0x15'));var utils=require(_0xbb43('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xbb43('0x17'));var db=require(_0xbb43('0x18'))['db'];function respondWithStatusCode(_0x50e2c0,_0x578392){_0x578392=_0x578392||0xcc;return function(_0x41e7e5){if(_0x41e7e5){return _0x50e2c0['sendStatus'](_0x578392);}return _0x50e2c0['status'](_0x578392)[_0xbb43('0x19')]();};}function respondWithResult(_0x5a509f,_0x68d45d){_0x68d45d=_0x68d45d||0xc8;return function(_0x43021d){if(_0x43021d){return _0x5a509f['status'](_0x68d45d)['json'](_0x43021d);}};}function respondWithFilteredResult(_0x4d5bcf,_0x338120){return function(_0x2abce0){if(_0x2abce0){var _0x57bd1d=typeof _0x338120['offset']===_0xbb43('0x1a')&&typeof _0x338120['limit']==='undefined';var _0x2b0797=_0x2abce0[_0xbb43('0x1b')];var _0x2e3b43=_0x57bd1d?0x0:_0x338120['offset'];var _0x1c16d7=_0x57bd1d?_0x2abce0['count']:_0x338120[_0xbb43('0x1c')]+_0x338120[_0xbb43('0x1d')];var _0x4dfc54;if(_0x1c16d7>=_0x2b0797){_0x1c16d7=_0x2b0797;_0x4dfc54=0xc8;}else{_0x4dfc54=0xce;}_0x4d5bcf['status'](_0x4dfc54);return _0x4d5bcf[_0xbb43('0x1e')](_0xbb43('0x1f'),_0x2e3b43+'-'+_0x1c16d7+'/'+_0x2b0797)[_0xbb43('0x20')](_0x2abce0);}return null;};}function patchUpdates(_0x2bf2d4){return function(_0x5bcce7){try{jsonpatch[_0xbb43('0x21')](_0x5bcce7,_0x2bf2d4,!![]);}catch(_0x5f4416){return BPromise[_0xbb43('0x22')](_0x5f4416);}return _0x5bcce7['save']();};}function saveUpdates(_0x2f5e31,_0x565256){return function(_0x3f323e){if(_0x3f323e){return _0x3f323e[_0xbb43('0x23')](_0x2f5e31)['then'](function(_0x1d0768){return _0x1d0768;});}return null;};}function removeEntity(_0x4dfb7f,_0xf24e60){return function(_0x298ce2){if(_0x298ce2){return _0x298ce2[_0xbb43('0x24')]()['then'](function(){var _0x53f0d5=_0x298ce2['get']({'plain':!![]});var _0x269ca5=_0xbb43('0x25');return db['UserProfileResource'][_0xbb43('0x24')]({'where':{'type':_0x269ca5,'resourceId':_0x53f0d5['id']}})[_0xbb43('0x26')](function(){return _0x298ce2;});})[_0xbb43('0x26')](function(){_0x4dfb7f[_0xbb43('0x27')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b5342,_0x27fd7a){return function(_0x42800f){if(!_0x42800f){_0x4b5342[_0xbb43('0x28')](0x194);}return _0x42800f;};}function handleError(_0x8b3205,_0x510b05){_0x510b05=_0x510b05||0x1f4;return function(_0x40b04b){logger[_0xbb43('0x29')](_0x40b04b[_0xbb43('0x2a')]);if(_0x40b04b['name']){delete _0x40b04b[_0xbb43('0x2b')];}_0x8b3205['status'](_0x510b05)[_0xbb43('0x2c')](_0x40b04b);};}exports[_0xbb43('0x2d')]=function(_0x34f5b2,_0x1880cd){var _0x555b99={},_0x157d62={},_0x547a6f={'count':0x0,'rows':[]};var _0x5566cf=_['map'](db[_0xbb43('0x2e')]['rawAttributes'],function(_0xa7e144){return{'name':_0xa7e144[_0xbb43('0x2f')],'type':_0xa7e144[_0xbb43('0x30')]['key']};});_0x157d62[_0xbb43('0x31')]=_[_0xbb43('0x32')](_0x5566cf,_0xbb43('0x2b'));_0x157d62[_0xbb43('0x33')]=_[_0xbb43('0x34')](_0x34f5b2[_0xbb43('0x33')]);_0x157d62[_0xbb43('0x35')]=_[_0xbb43('0x36')](_0x157d62['model'],_0x157d62[_0xbb43('0x33')]);_0x555b99[_0xbb43('0x37')]=_[_0xbb43('0x36')](_0x157d62[_0xbb43('0x31')],qs[_0xbb43('0x38')](_0x34f5b2[_0xbb43('0x33')][_0xbb43('0x38')]));_0x555b99[_0xbb43('0x37')]=_0x555b99[_0xbb43('0x37')][_0xbb43('0x39')]?_0x555b99[_0xbb43('0x37')]:_0x157d62[_0xbb43('0x31')];if(!_0x34f5b2[_0xbb43('0x33')][_0xbb43('0x3a')](_0xbb43('0x3b'))){_0x555b99[_0xbb43('0x1d')]=qs['limit'](_0x34f5b2[_0xbb43('0x33')][_0xbb43('0x1d')]);_0x555b99['offset']=qs[_0xbb43('0x1c')](_0x34f5b2[_0xbb43('0x33')][_0xbb43('0x1c')]);}_0x555b99['order']=qs['sort'](_0x34f5b2['query'][_0xbb43('0x3c')]);_0x555b99[_0xbb43('0x3d')]=qs['filters'](_['pick'](_0x34f5b2[_0xbb43('0x33')],_0x157d62[_0xbb43('0x35')]),_0x5566cf);if(_0x34f5b2[_0xbb43('0x33')][_0xbb43('0x3e')]){_0x555b99[_0xbb43('0x3d')]=_['merge'](_0x555b99[_0xbb43('0x3d')],{'$or':_[_0xbb43('0x32')](_0x5566cf,function(_0x2cd8b8){if(_0x2cd8b8[_0xbb43('0x30')]!==_0xbb43('0x3f')){var _0x531d96={};_0x531d96[_0x2cd8b8[_0xbb43('0x2b')]]={'$like':'%'+_0x34f5b2['query'][_0xbb43('0x3e')]+'%'};return _0x531d96;}})});}_0x555b99=_[_0xbb43('0x40')]({},_0x555b99,_0x34f5b2['options']);var _0x4783fe={'where':_0x555b99['where']};return db[_0xbb43('0x2e')][_0xbb43('0x1b')](_0x4783fe)[_0xbb43('0x26')](function(_0xb84ece){_0x547a6f['count']=_0xb84ece;if(_0x34f5b2[_0xbb43('0x33')][_0xbb43('0x41')]){_0x555b99['include']=[{'all':!![]}];}return db[_0xbb43('0x2e')]['findAll'](_0x555b99);})[_0xbb43('0x26')](function(_0x14285d){_0x547a6f[_0xbb43('0x42')]=_0x14285d;return _0x547a6f;})[_0xbb43('0x26')](respondWithFilteredResult(_0x1880cd,_0x555b99))[_0xbb43('0x43')](handleError(_0x1880cd,null));};exports[_0xbb43('0x44')]=function(_0x4bf8ed,_0x1beb2a){var _0x5686ee={'raw':!![],'where':{'id':_0x4bf8ed[_0xbb43('0x45')]['id']}},_0x307f1e={};_0x307f1e[_0xbb43('0x31')]=_[_0xbb43('0x34')](db['Tag'][_0xbb43('0x46')]);_0x307f1e[_0xbb43('0x33')]=_[_0xbb43('0x34')](_0x4bf8ed[_0xbb43('0x33')]);_0x307f1e[_0xbb43('0x35')]=_[_0xbb43('0x36')](_0x307f1e[_0xbb43('0x31')],_0x307f1e[_0xbb43('0x33')]);_0x5686ee['attributes']=_[_0xbb43('0x36')](_0x307f1e[_0xbb43('0x31')],qs['fields'](_0x4bf8ed[_0xbb43('0x33')]['fields']));_0x5686ee['attributes']=_0x5686ee['attributes']['length']?_0x5686ee[_0xbb43('0x37')]:_0x307f1e['model'];if(_0x4bf8ed[_0xbb43('0x33')]['includeAll']){_0x5686ee[_0xbb43('0x47')]=[{'all':!![]}];}_0x5686ee=_[_0xbb43('0x40')]({},_0x5686ee,_0x4bf8ed[_0xbb43('0x48')]);return db['Tag'][_0xbb43('0x49')](_0x5686ee)['then'](handleEntityNotFound(_0x1beb2a,null))[_0xbb43('0x26')](respondWithResult(_0x1beb2a,null))[_0xbb43('0x43')](handleError(_0x1beb2a,null));};exports[_0xbb43('0x4a')]=function(_0x29840e,_0x417ad9){return db[_0xbb43('0x2e')][_0xbb43('0x4a')](_0x29840e['body'],{})[_0xbb43('0x26')](function(_0x26ea59){var _0x202059=_0x29840e[_0xbb43('0x4b')]['get']({'plain':!![]});if(!_0x202059)throw new Error(_0xbb43('0x4c'));if(_0x202059[_0xbb43('0x4d')]===_0xbb43('0x4b')){var _0xb1883e=_0x26ea59['get']({'plain':!![]});var _0x3206c0=_0xbb43('0x25');return db[_0xbb43('0x4e')]['find']({'where':{'name':_0x3206c0,'userProfileId':_0x202059[_0xbb43('0x4f')]},'raw':!![]})[_0xbb43('0x26')](function(_0x73d4ce){if(_0x73d4ce&&_0x73d4ce[_0xbb43('0x50')]===0x0){return db[_0xbb43('0x51')]['create']({'name':_0xb1883e['name'],'resourceId':_0xb1883e['id'],'type':_0x73d4ce[_0xbb43('0x2b')],'sectionId':_0x73d4ce['id']},{})['then'](function(){return _0x26ea59;});}else{return _0x26ea59;}})[_0xbb43('0x43')](function(_0xe0cdba){logger['error'](_0xbb43('0x52'),_0xe0cdba);throw _0xe0cdba;});}return _0x26ea59;})[_0xbb43('0x26')](respondWithResult(_0x417ad9,0xc9))[_0xbb43('0x43')](handleError(_0x417ad9,null));};exports[_0xbb43('0x23')]=function(_0x1dfbb9,_0x5cb3c6){if(_0x1dfbb9[_0xbb43('0x53')]['id']){delete _0x1dfbb9['body']['id'];}return db['Tag'][_0xbb43('0x49')]({'where':{'id':_0x1dfbb9[_0xbb43('0x45')]['id']}})[_0xbb43('0x26')](handleEntityNotFound(_0x5cb3c6,null))[_0xbb43('0x26')](saveUpdates(_0x1dfbb9[_0xbb43('0x53')],null))['then'](respondWithResult(_0x5cb3c6,null))['catch'](handleError(_0x5cb3c6,null));};exports[_0xbb43('0x24')]=function(_0x157824,_0x3a84ad){return db[_0xbb43('0x2e')][_0xbb43('0x49')]({'where':{'id':_0x157824[_0xbb43('0x45')]['id']}})[_0xbb43('0x26')](handleEntityNotFound(_0x3a84ad,null))[_0xbb43('0x26')](removeEntity(_0x3a84ad,null))[_0xbb43('0x43')](handleError(_0x3a84ad,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index 53e91e1..dca64fd 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 _0x94b6=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','Tag','tools_tags','lodash','util'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x94b6,0x143));var _0x694b=function(_0x18a436,_0x1dbe06){_0x18a436=_0x18a436-0x0;var _0x5c2cf8=_0x94b6[_0x18a436];return _0x5c2cf8;};'use strict';var _=require(_0x694b('0x0'));var util=require(_0x694b('0x1'));var logger=require('../../config/logger')(_0x694b('0x2'));var moment=require(_0x694b('0x3'));var BPromise=require(_0x694b('0x4'));var rp=require(_0x694b('0x5'));var fs=require('fs');var path=require(_0x694b('0x6'));var rimraf=require(_0x694b('0x7'));var config=require(_0x694b('0x8'));var attributes=require('./tag.attributes');module[_0x694b('0x9')]=function(_0x34dfb7,_0x3b6355){return _0x34dfb7[_0x694b('0xa')](_0x694b('0xb'),attributes,{'tableName':_0x694b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x81a9=['moment','bluebird','request-promise','./tag.attributes','exports','define','Tag','tools_tags','lodash','../../config/logger','api'];(function(_0x15c0d0,_0x34a6ab){var _0xbd8ae=function(_0x13ee33){while(--_0x13ee33){_0x15c0d0['push'](_0x15c0d0['shift']());}};_0xbd8ae(++_0x34a6ab);}(_0x81a9,0x81));var _0x981a=function(_0x3984df,_0x372e53){_0x3984df=_0x3984df-0x0;var _0x3b7d61=_0x81a9[_0x3984df];return _0x3b7d61;};'use strict';var _=require(_0x981a('0x0'));var util=require('util');var logger=require(_0x981a('0x1'))(_0x981a('0x2'));var moment=require(_0x981a('0x3'));var BPromise=require(_0x981a('0x4'));var rp=require(_0x981a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x981a('0x6'));module[_0x981a('0x7')]=function(_0x561042,_0x41c223){return _0x561042[_0x981a('0x8')](_0x981a('0x9'),attributes,{'tableName':_0x981a('0xa'),'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 8532ad5..596f687 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 _0xfa2b=['jayson/promise','client','http','request','then','info','Tag,\x20%s,\x20%s','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','code','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x3cd644,_0x4f4fd2){var _0x218c3f=function(_0x4e702d){while(--_0x4e702d){_0x3cd644['push'](_0x3cd644['shift']());}};_0x218c3f(++_0x4f4fd2);}(_0xfa2b,0x1b7));var _0xbfa2=function(_0x4ed21e,_0x31c606){_0x4ed21e=_0x4ed21e-0x0;var _0x4597a0=_0xfa2b[_0x4ed21e];return _0x4597a0;};'use strict';var _=require(_0xbfa2('0x0'));var util=require(_0xbfa2('0x1'));var moment=require(_0xbfa2('0x2'));var BPromise=require(_0xbfa2('0x3'));var rs=require(_0xbfa2('0x4'));var fs=require('fs');var Redis=require(_0xbfa2('0x5'));var db=require(_0xbfa2('0x6'))['db'];var utils=require(_0xbfa2('0x7'));var logger=require(_0xbfa2('0x8'))(_0xbfa2('0x9'));var config=require(_0xbfa2('0xa'));var jayson=require(_0xbfa2('0xb'));var client=jayson[_0xbfa2('0xc')][_0xbfa2('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x26ed93,_0x26e9bf,_0x4cd9ae){return new BPromise(function(_0x46a151,_0x4f17e6){return client[_0xbfa2('0xe')](_0x26ed93,_0x4cd9ae)[_0xbfa2('0xf')](function(_0x1b1c13){logger[_0xbfa2('0x10')](_0xbfa2('0x11'),_0x26e9bf,_0xbfa2('0x12'));logger[_0xbfa2('0x13')](_0xbfa2('0x14'),_0x26e9bf,_0xbfa2('0x12'),JSON['stringify'](_0x1b1c13));if(_0x1b1c13['error']){if(_0x1b1c13['error'][_0xbfa2('0x15')]===0x1f4){logger[_0xbfa2('0x16')](_0xbfa2('0x11'),_0x26e9bf,_0x1b1c13[_0xbfa2('0x16')][_0xbfa2('0x17')]);return _0x4f17e6(_0x1b1c13[_0xbfa2('0x16')]['message']);}logger[_0xbfa2('0x16')](_0xbfa2('0x11'),_0x26e9bf,_0x1b1c13[_0xbfa2('0x16')][_0xbfa2('0x17')]);return _0x46a151(_0x1b1c13[_0xbfa2('0x16')]['message']);}else{logger[_0xbfa2('0x10')]('Tag,\x20%s,\x20%s',_0x26e9bf,'request\x20sent');_0x46a151(_0x1b1c13[_0xbfa2('0x18')]['message']);}})['catch'](function(_0xab2c91){logger[_0xbfa2('0x16')]('Tag,\x20%s,\x20%s',_0x26e9bf,_0xab2c91);_0x4f17e6(_0xab2c91);});});} \ No newline at end of file +var _0x4ea3=['Tag,\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','Tag,\x20%s,\x20%s'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0x4ea3,0x70));var _0x34ea=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x4ea3[_0x397e5f];return _0x5302b8;};'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')]('Tag,\x20%s,\x20%s',_0x18b461,_0x3fa3b0);_0x341727(_0x3fa3b0);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index 7821b10..82db054 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(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa9e0[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var 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(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0xa9e0[_0x25bea7];return _0x175952;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/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 79a6c6b..65e6fba 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 _0xb7e7=['STRING','sequelize'];(function(_0x273c39,_0x1052e6){var _0x46d6b5=function(_0x44f1fb){while(--_0x44f1fb){_0x273c39['push'](_0x273c39['shift']());}};_0x46d6b5(++_0x1052e6);}(_0xb7e7,0x121));var _0x7b7e=function(_0x34843e,_0x4c4224){_0x34843e=_0x34843e-0x0;var _0x598f7f=_0xb7e7[_0x34843e];return _0x598f7f;};'use strict';var Sequelize=require(_0x7b7e('0x0'));module['exports']={'name':{'type':Sequelize[_0x7b7e('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize[_0x7b7e('0x1')]}}; \ No newline at end of file +var _0xb10b=['name','sequelize','STRING'];(function(_0x475b08,_0x5e1cf3){var _0x540b75=function(_0x5ed79d){while(--_0x5ed79d){_0x475b08['push'](_0x475b08['shift']());}};_0x540b75(++_0x5e1cf3);}(_0xb10b,0x12a));var _0xbb10=function(_0x36fc1f,_0x27c1c8){_0x36fc1f=_0x36fc1f-0x0;var _0x371281=_0xb10b[_0x36fc1f];return _0x371281;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'name':{'type':Sequelize[_0xbb10('0x1')],'allowNull':![],'unique':_0xbb10('0x2')},'description':{'type':Sequelize[_0xbb10('0x1')]}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index 3794bce..b450cbf 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 _0x8014=['Sequelize','QueryTypes','SELECT','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','VoiceQueueId','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','UserMailQueue','SmsQueueId','UserSmsQueue','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','ChatQueueId','UserChatQueue','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','WhatsappQueueId','UserWhatsappQueue','TeamVoicePrefix','VoicePrefixId','Teams','end','getQueues','findOne','channel','isValidChannel','ValidationError','Unknown\x20channel','capitalize','toLowerCase','Queue','Queues','addQueues','add','removeQueues','ids','addAgents','isArray','Voice','Mail','Sms','Whatsapp','through','penalty','QueueId','TeamVoiceQueue','findOrCreate','emit','Queue:save','interface','UserVoiceQueueRt','SIP/%s','voicePause','all','UserVoicePrefix','upsert','spread','Chat','Fax','Openchannel','removeAgents','getAgents','User','hasOwnProperty','eml-format','rimraf','zip-dir','request-promise','moment','mustache','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./team.socket','register','sendStatus','status','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','error','stack','send','index','rawAttributes','fieldName','type','key','model','map','name','query','attributes','intersection','fields','nolimit','limit','order','sort','where','filters','pick','filter','merge','options','Team','includeAll','findAll','rows','catch','keys','length','include','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','destroy','transaction','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','sequelize'];(function(_0x2e8a76,_0xed0bec){var _0x1379b0=function(_0x4efd0c){while(--_0x4efd0c){_0x2e8a76['push'](_0x2e8a76['shift']());}};_0x1379b0(++_0xed0bec);}(_0x8014,0xdf));var _0x4801=function(_0x322bef,_0x4890d4){_0x322bef=_0x322bef-0x0;var _0x229e60=_0x8014[_0x322bef];return _0x229e60;};'use strict';var emlformat=require(_0x4801('0x0'));var rimraf=require(_0x4801('0x1'));var zipdir=require(_0x4801('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4801('0x3'));var moment=require(_0x4801('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4801('0x5'));var util=require('util');var path=require(_0x4801('0x6'));var sox=require('sox');var csv=require(_0x4801('0x7'));var ejs=require(_0x4801('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4801('0x9'));var squel=require('squel');var crypto=require(_0x4801('0xa'));var jsforce=require(_0x4801('0xb'));var deskjs=require(_0x4801('0xc'));var toCsv=require(_0x4801('0x7'));var querystring=require(_0x4801('0xd'));var Papa=require('papaparse');var Redis=require(_0x4801('0xe'));var authService=require(_0x4801('0xf'));var qs=require(_0x4801('0x10'));var as=require(_0x4801('0x11'));var hardwareService=require(_0x4801('0x12'));var logger=require('../../config/logger')(_0x4801('0x13'));var utils=require(_0x4801('0x14'));var config=require(_0x4801('0x15'));var licenseUtil=require(_0x4801('0x16'));var db=require(_0x4801('0x17'))['db'];config[_0x4801('0x18')]=_[_0x4801('0x19')](config[_0x4801('0x18')],{'host':_0x4801('0x1a'),'port':0x18eb});var socket=require(_0x4801('0x1b'))(new Redis(config['redis']));require(_0x4801('0x1c'))[_0x4801('0x1d')](socket);function respondWithStatusCode(_0x24dee4,_0x34783c){_0x34783c=_0x34783c||0xcc;return function(_0x37122b){if(_0x37122b){return _0x24dee4[_0x4801('0x1e')](_0x34783c);}return _0x24dee4[_0x4801('0x1f')](_0x34783c)['end']();};}function respondWithResult(_0x814676,_0x17ff40){_0x17ff40=_0x17ff40||0xc8;return function(_0x57b5d3){if(_0x57b5d3){return _0x814676[_0x4801('0x1f')](_0x17ff40)[_0x4801('0x20')](_0x57b5d3);}};}function respondWithFilteredResult(_0x54a3ec,_0x33f009){return function(_0x400b61){if(_0x400b61){var _0x204d1b=typeof _0x33f009[_0x4801('0x21')]===_0x4801('0x22')&&typeof _0x33f009['limit']===_0x4801('0x22');var _0x8525d1=_0x400b61[_0x4801('0x23')];var _0x218385=_0x204d1b?0x0:_0x33f009[_0x4801('0x21')];var _0x99aa12=_0x204d1b?_0x400b61['count']:_0x33f009[_0x4801('0x21')]+_0x33f009['limit'];var _0x3165c2;if(_0x99aa12>=_0x8525d1){_0x99aa12=_0x8525d1;_0x3165c2=0xc8;}else{_0x3165c2=0xce;}_0x54a3ec[_0x4801('0x1f')](_0x3165c2);return _0x54a3ec[_0x4801('0x24')](_0x4801('0x25'),_0x218385+'-'+_0x99aa12+'/'+_0x8525d1)[_0x4801('0x20')](_0x400b61);}return null;};}function patchUpdates(_0x180793){return function(_0x5a182b){try{jsonpatch[_0x4801('0x26')](_0x5a182b,_0x180793,!![]);}catch(_0x2b48a6){return BPromise[_0x4801('0x27')](_0x2b48a6);}return _0x5a182b[_0x4801('0x28')]();};}function saveUpdates(_0x2a518b,_0xabbf01){return function(_0xdf4cd5){if(_0xdf4cd5){return _0xdf4cd5[_0x4801('0x29')](_0x2a518b)[_0x4801('0x2a')](function(_0x55ed74){return _0x55ed74;});}return null;};}function handleEntityNotFound(_0x34cb5e,_0x54e03d){return function(_0x2c34be){if(!_0x2c34be){_0x34cb5e[_0x4801('0x1e')](0x194);}return _0x2c34be;};}function handleError(_0x31f658,_0x174ecc){_0x174ecc=_0x174ecc||0x1f4;return function(_0x23e58c){logger[_0x4801('0x2b')](_0x23e58c[_0x4801('0x2c')]);if(_0x23e58c['name']){delete _0x23e58c['name'];}_0x31f658[_0x4801('0x1f')](_0x174ecc)[_0x4801('0x2d')](_0x23e58c);};}exports[_0x4801('0x2e')]=function(_0x308eaf,_0x206761){var _0x3b1801={},_0x104ff6={},_0x2214c0={'count':0x0,'rows':[]};var _0x2cabb6=_['map'](db['Team'][_0x4801('0x2f')],function(_0x2d8947){return{'name':_0x2d8947[_0x4801('0x30')],'type':_0x2d8947[_0x4801('0x31')][_0x4801('0x32')]};});_0x104ff6[_0x4801('0x33')]=_[_0x4801('0x34')](_0x2cabb6,_0x4801('0x35'));_0x104ff6[_0x4801('0x36')]=_['keys'](_0x308eaf['query']);_0x104ff6['filters']=_['intersection'](_0x104ff6[_0x4801('0x33')],_0x104ff6['query']);_0x3b1801[_0x4801('0x37')]=_[_0x4801('0x38')](_0x104ff6[_0x4801('0x33')],qs[_0x4801('0x39')](_0x308eaf[_0x4801('0x36')][_0x4801('0x39')]));_0x3b1801[_0x4801('0x37')]=_0x3b1801[_0x4801('0x37')]['length']?_0x3b1801[_0x4801('0x37')]:_0x104ff6[_0x4801('0x33')];if(!_0x308eaf[_0x4801('0x36')]['hasOwnProperty'](_0x4801('0x3a'))){_0x3b1801['limit']=qs['limit'](_0x308eaf[_0x4801('0x36')][_0x4801('0x3b')]);_0x3b1801[_0x4801('0x21')]=qs['offset'](_0x308eaf[_0x4801('0x36')][_0x4801('0x21')]);}_0x3b1801[_0x4801('0x3c')]=qs[_0x4801('0x3d')](_0x308eaf[_0x4801('0x36')][_0x4801('0x3d')]);_0x3b1801[_0x4801('0x3e')]=qs[_0x4801('0x3f')](_[_0x4801('0x40')](_0x308eaf[_0x4801('0x36')],_0x104ff6[_0x4801('0x3f')]),_0x2cabb6);if(_0x308eaf['query'][_0x4801('0x41')]){_0x3b1801[_0x4801('0x3e')]=_[_0x4801('0x42')](_0x3b1801['where'],{'$or':_[_0x4801('0x34')](_0x2cabb6,function(_0x24af57){if(_0x24af57[_0x4801('0x31')]!=='VIRTUAL'){var _0x53c969={};_0x53c969[_0x24af57[_0x4801('0x35')]]={'$like':'%'+_0x308eaf[_0x4801('0x36')]['filter']+'%'};return _0x53c969;}})});}_0x3b1801=_[_0x4801('0x42')]({},_0x3b1801,_0x308eaf[_0x4801('0x43')]);var _0x367764={'where':_0x3b1801['where']};return db[_0x4801('0x44')]['count'](_0x367764)['then'](function(_0x592b70){_0x2214c0[_0x4801('0x23')]=_0x592b70;if(_0x308eaf[_0x4801('0x36')][_0x4801('0x45')]){_0x3b1801['include']=[{'all':!![]}];}return db[_0x4801('0x44')][_0x4801('0x46')](_0x3b1801);})['then'](function(_0x23eff8){_0x2214c0[_0x4801('0x47')]=_0x23eff8;return _0x2214c0;})[_0x4801('0x2a')](respondWithFilteredResult(_0x206761,_0x3b1801))[_0x4801('0x48')](handleError(_0x206761,null));};exports['show']=function(_0x4eb857,_0x642622){var _0x4f98ba={'raw':![],'where':{'id':_0x4eb857['params']['id']}},_0x4e4528={};_0x4e4528[_0x4801('0x33')]=_[_0x4801('0x49')](db['Team']['rawAttributes']);_0x4e4528[_0x4801('0x36')]=_[_0x4801('0x49')](_0x4eb857[_0x4801('0x36')]);_0x4e4528['filters']=_[_0x4801('0x38')](_0x4e4528['model'],_0x4e4528[_0x4801('0x36')]);_0x4f98ba[_0x4801('0x37')]=_[_0x4801('0x38')](_0x4e4528[_0x4801('0x33')],qs[_0x4801('0x39')](_0x4eb857[_0x4801('0x36')][_0x4801('0x39')]));_0x4f98ba[_0x4801('0x37')]=_0x4f98ba[_0x4801('0x37')][_0x4801('0x4a')]?_0x4f98ba['attributes']:_0x4e4528[_0x4801('0x33')];if(_0x4eb857[_0x4801('0x36')]['includeAll']){_0x4f98ba[_0x4801('0x4b')]=[{'all':!![]}];}_0x4f98ba=_['merge']({},_0x4f98ba,_0x4eb857['options']);return db[_0x4801('0x44')][_0x4801('0x4c')](_0x4f98ba)[_0x4801('0x2a')](handleEntityNotFound(_0x642622,null))[_0x4801('0x2a')](respondWithResult(_0x642622,null))[_0x4801('0x48')](handleError(_0x642622,null));};exports[_0x4801('0x4d')]=function(_0x5a7f99,_0xd656ca){return db[_0x4801('0x44')]['create'](_0x5a7f99[_0x4801('0x4e')],{})[_0x4801('0x2a')](function(_0x44d53b){var _0x30796a=_0x5a7f99['user'][_0x4801('0x4f')]({'plain':!![]});if(!_0x30796a)throw new Error(_0x4801('0x50'));if(_0x30796a[_0x4801('0x51')]===_0x4801('0x52')){var _0x2a16fc=_0x44d53b['get']({'plain':!![]});var _0x2373d7='Teams';return db[_0x4801('0x53')][_0x4801('0x4c')]({'where':{'name':_0x2373d7,'userProfileId':_0x30796a['userProfileId']},'raw':!![]})[_0x4801('0x2a')](function(_0x118140){if(_0x118140&&_0x118140['autoAssociation']===0x0){return db[_0x4801('0x54')][_0x4801('0x4d')]({'name':_0x2a16fc[_0x4801('0x35')],'resourceId':_0x2a16fc['id'],'type':_0x118140['name'],'sectionId':_0x118140['id']},{})[_0x4801('0x2a')](function(){return _0x44d53b;});}else{return _0x44d53b;}})[_0x4801('0x48')](function(_0x49475c){logger[_0x4801('0x2b')](_0x4801('0x55'),_0x49475c);throw _0x49475c;});}return _0x44d53b;})[_0x4801('0x2a')](respondWithResult(_0xd656ca,0xc9))[_0x4801('0x48')](handleError(_0xd656ca,null));};exports[_0x4801('0x29')]=function(_0x317463,_0x32e799){if(_0x317463[_0x4801('0x4e')]['id']){delete _0x317463[_0x4801('0x4e')]['id'];}return db[_0x4801('0x44')][_0x4801('0x4c')]({'where':{'id':_0x317463[_0x4801('0x56')]['id']}})['then'](handleEntityNotFound(_0x32e799,null))[_0x4801('0x2a')](saveUpdates(_0x317463[_0x4801('0x4e')],null))[_0x4801('0x2a')](respondWithResult(_0x32e799,null))[_0x4801('0x48')](handleError(_0x32e799,null));};exports[_0x4801('0x57')]=function(_0x9f4e46,_0x31ba40){var _0x55f989=_0x9f4e46[_0x4801('0x56')]['id'];var _0x3849ef=[];return db['sequelize'][_0x4801('0x58')](function(_0x4522bf){var _0x458651=_0x4801('0x59')+_0x55f989;return db[_0x4801('0x5a')][_0x4801('0x36')](_0x458651,{'type':db[_0x4801('0x5b')][_0x4801('0x5c')][_0x4801('0x5d')],'raw':!![],'transaction':_0x4522bf})[_0x4801('0x2a')](function(_0x356367){_0x3849ef=_[_0x4801('0x34')](_0x356367,function(_0x52c9a0){return Number(_0x52c9a0[_0x4801('0x5e')]);});})['then'](function(){var _0xfa833c=_0x4801('0x5f')+_0x55f989;return db[_0x4801('0x5a')][_0x4801('0x36')](_0xfa833c,{'type':db['Sequelize'][_0x4801('0x5c')][_0x4801('0x5d')],'raw':!![],'transaction':_0x4522bf});})[_0x4801('0x2a')](function(_0x3b514a){var _0x132a58=_[_0x4801('0x34')](_0x3b514a,function(_0xd2522f){return Number(_0xd2522f[_0x4801('0x60')]);});return db['UserVoiceQueue'][_0x4801('0x57')]({'where':{'UserId':{'$in':_0x3849ef},'VoiceQueueId':{'$in':_0x132a58}},'transaction':_0x4522bf});})[_0x4801('0x2a')](function(){var _0x1db974=_0x4801('0x61')+_0x55f989;return db[_0x4801('0x5a')][_0x4801('0x36')](_0x1db974,{'type':db[_0x4801('0x5b')][_0x4801('0x5c')][_0x4801('0x5d')],'raw':!![],'transaction':_0x4522bf});})[_0x4801('0x2a')](function(_0x22cdc7){var _0x288531=_[_0x4801('0x34')](_0x22cdc7,function(_0x4bbc3f){return Number(_0x4bbc3f['MailQueueId']);});return db[_0x4801('0x62')][_0x4801('0x57')]({'where':{'UserId':{'$in':_0x3849ef},'MailQueueId':{'$in':_0x288531}},'transaction':_0x4522bf});})[_0x4801('0x2a')](function(){var _0x1a416f='SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20'+_0x55f989;return db[_0x4801('0x5a')][_0x4801('0x36')](_0x1a416f,{'type':db[_0x4801('0x5b')]['QueryTypes'][_0x4801('0x5d')],'raw':!![],'transaction':_0x4522bf});})['then'](function(_0x334691){var _0x34d4f9=_[_0x4801('0x34')](_0x334691,function(_0xc07708){return Number(_0xc07708[_0x4801('0x63')]);});return db[_0x4801('0x64')][_0x4801('0x57')]({'where':{'UserId':{'$in':_0x3849ef},'SmsQueueId':{'$in':_0x34d4f9}},'transaction':_0x4522bf});})[_0x4801('0x2a')](function(){var _0x4da222=_0x4801('0x65')+_0x55f989;return db[_0x4801('0x5a')]['query'](_0x4da222,{'type':db[_0x4801('0x5b')][_0x4801('0x5c')][_0x4801('0x5d')],'raw':!![],'transaction':_0x4522bf});})['then'](function(_0x1510ab){var _0x1018f1=_[_0x4801('0x34')](_0x1510ab,function(_0x40763e){return Number(_0x40763e[_0x4801('0x66')]);});return db[_0x4801('0x67')][_0x4801('0x57')]({'where':{'UserId':{'$in':_0x3849ef},'ChatQueueId':{'$in':_0x1018f1}},'transaction':_0x4522bf});})[_0x4801('0x2a')](function(){var _0x32d9bd='SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20'+_0x55f989;return db[_0x4801('0x5a')][_0x4801('0x36')](_0x32d9bd,{'type':db['Sequelize'][_0x4801('0x5c')][_0x4801('0x5d')],'raw':!![],'transaction':_0x4522bf});})[_0x4801('0x2a')](function(_0x3882cc){var _0x13b400=_[_0x4801('0x34')](_0x3882cc,function(_0xc39b7b){return Number(_0xc39b7b['FaxQueueId']);});return db[_0x4801('0x68')][_0x4801('0x57')]({'where':{'UserId':{'$in':_0x3849ef},'FaxQueueId':{'$in':_0x13b400}},'transaction':_0x4522bf});})[_0x4801('0x2a')](function(){var _0x47581d=_0x4801('0x69')+_0x55f989;return db[_0x4801('0x5a')][_0x4801('0x36')](_0x47581d,{'type':db[_0x4801('0x5b')]['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x4522bf});})['then'](function(_0x3af98c){var _0x401e31=_[_0x4801('0x34')](_0x3af98c,function(_0x458d2a){return Number(_0x458d2a[_0x4801('0x6a')]);});return db[_0x4801('0x6b')][_0x4801('0x57')]({'where':{'UserId':{'$in':_0x3849ef},'OpenchannelQueueId':{'$in':_0x401e31}},'transaction':_0x4522bf});})[_0x4801('0x2a')](function(){var _0x225539=_0x4801('0x6c')+_0x55f989;return db[_0x4801('0x5a')][_0x4801('0x36')](_0x225539,{'type':db[_0x4801('0x5b')]['QueryTypes'][_0x4801('0x5d')],'raw':!![],'transaction':_0x4522bf});})[_0x4801('0x2a')](function(_0x578985){var _0x398533=_[_0x4801('0x34')](_0x578985,function(_0x93d057){return Number(_0x93d057[_0x4801('0x6d')]);});return db[_0x4801('0x6e')]['destroy']({'where':{'UserId':{'$in':_0x3849ef},'WhatsappQueueId':{'$in':_0x398533}},'transaction':_0x4522bf});})[_0x4801('0x2a')](function(){return db[_0x4801('0x6f')][_0x4801('0x4c')]({'where':{'TeamId':_0x55f989}});})[_0x4801('0x2a')](function(_0xa4ed76){if(_0xa4ed76===null){return;}return db['UserVoicePrefix'][_0x4801('0x57')]({'where':{'UserId':{'$in':_0x3849ef},'VoicePrefixId':_0xa4ed76[_0x4801('0x70')]},'transaction':_0x4522bf});})[_0x4801('0x2a')](function(){return db['Team'][_0x4801('0x57')]({'where':{'id':_0x55f989},'cascade':!![],'transaction':_0x4522bf});})['then'](function(_0x28c87f){if(_0x28c87f===0x0){_0x31ba40[_0x4801('0x1e')](0x194);}else{return db[_0x4801('0x54')][_0x4801('0x57')]({'where':{'type':_0x4801('0x71'),'resourceId':_0x55f989},'cascade':!![],'transaction':_0x4522bf})[_0x4801('0x2a')](function(){_0x31ba40['status'](0xcc)[_0x4801('0x72')]();});}})['catch'](function(_0x5f9f64){_0x31ba40[_0x4801('0x1f')](0x1f4)[_0x4801('0x2d')](_0x5f9f64);});});};exports[_0x4801('0x73')]=function(_0x45f765,_0x125e14,_0x4f03ad){return db['Team'][_0x4801('0x74')]({'where':{'id':_0x45f765[_0x4801('0x56')]['id']}})[_0x4801('0x2a')](handleEntityNotFound(_0x125e14,null))[_0x4801('0x2a')](function(_0x3c15ff){if(!_0x45f765[_0x4801('0x36')][_0x4801('0x75')]||!utils[_0x4801('0x76')](_0x45f765[_0x4801('0x36')][_0x4801('0x75')])){throw new db['Sequelize'][(_0x4801('0x77'))](_0x4801('0x78'));}var _0x505ba8={};var _0x28402f={};_0x28402f['model']=_[_0x4801('0x49')](db[_[_0x4801('0x79')](_0x45f765[_0x4801('0x36')]['channel'][_0x4801('0x7a')]())+_0x4801('0x7b')][_0x4801('0x2f')]);_0x28402f['query']=_[_0x4801('0x49')](_0x45f765[_0x4801('0x36')]);_0x28402f[_0x4801('0x3f')]=_['intersection'](_0x28402f[_0x4801('0x33')],_0x28402f[_0x4801('0x36')]);_0x505ba8[_0x4801('0x37')]=_[_0x4801('0x38')](_0x28402f[_0x4801('0x33')],qs[_0x4801('0x39')](_0x45f765[_0x4801('0x36')]['fields']));_0x505ba8[_0x4801('0x37')]=_0x505ba8[_0x4801('0x37')][_0x4801('0x4a')]?_0x505ba8[_0x4801('0x37')]:_0x28402f[_0x4801('0x33')];_0x505ba8[_0x4801('0x3b')]=qs[_0x4801('0x3b')](_0x45f765[_0x4801('0x36')][_0x4801('0x3b')]);_0x505ba8[_0x4801('0x21')]=qs[_0x4801('0x21')](_0x45f765[_0x4801('0x36')][_0x4801('0x21')]);_0x505ba8[_0x4801('0x3c')]=qs['sort'](_0x45f765[_0x4801('0x36')]['sort']);_0x505ba8['where']=qs[_0x4801('0x3f')](_['pick'](_0x45f765[_0x4801('0x36')],_0x28402f['filters']));_0x505ba8=_[_0x4801('0x42')]({},_0x505ba8,_0x45f765[_0x4801('0x43')]);return _0x3c15ff[_0x4801('0x4f')+_[_0x4801('0x79')](_0x45f765['query'][_0x4801('0x75')][_0x4801('0x7a')]())+_0x4801('0x7c')](_0x505ba8);})['then'](respondWithResult(_0x125e14,null))['catch'](handleError(_0x125e14,null));};exports[_0x4801('0x7d')]=function(_0x245f88,_0x557068,_0x5e728f){return db['Team']['findOne']({'where':{'id':_0x245f88[_0x4801('0x56')]['id']}})[_0x4801('0x2a')](function(_0xdb3d97){if(_0xdb3d97){if(!_0x245f88[_0x4801('0x4e')]['channel']||!utils[_0x4801('0x76')](_0x245f88[_0x4801('0x4e')][_0x4801('0x75')])){throw new db[(_0x4801('0x5b'))]['ValidationError'](_0x4801('0x78'));}return _0xdb3d97[_0x4801('0x7e')+_[_0x4801('0x79')](_0x245f88[_0x4801('0x4e')][_0x4801('0x75')][_0x4801('0x7a')]())+_0x4801('0x7c')](_0x245f88[_0x4801('0x4e')]['ids']);}return null;})['then'](handleEntityNotFound(_0x557068,null))[_0x4801('0x2a')](respondWithStatusCode(_0x557068,null))[_0x4801('0x48')](handleError(_0x557068,null));};exports[_0x4801('0x7f')]=function(_0x2f4862,_0x37be11,_0x245aaa){return db[_0x4801('0x44')][_0x4801('0x74')]({'where':{'id':_0x2f4862[_0x4801('0x56')]['id']}})[_0x4801('0x2a')](function(_0x2242e2){if(_0x2242e2){if(!_0x2f4862[_0x4801('0x36')]['channel']||!utils['isValidChannel'](_0x2f4862[_0x4801('0x36')][_0x4801('0x75')])){throw new db['Sequelize'][(_0x4801('0x77'))](_0x4801('0x78'));}return _0x2242e2['remove'+_[_0x4801('0x79')](_0x2f4862[_0x4801('0x36')][_0x4801('0x75')][_0x4801('0x7a')]())+_0x4801('0x7c')](_0x2f4862[_0x4801('0x36')][_0x4801('0x80')]);}return null;})['then'](handleEntityNotFound(_0x37be11,null))[_0x4801('0x2a')](respondWithStatusCode(_0x37be11,null))[_0x4801('0x48')](handleError(_0x37be11,null));};exports[_0x4801('0x81')]=function(_0x2a16bd,_0x5d2ee3){var _0x50b0de=_[_0x4801('0x82')](_0x2a16bd[_0x4801('0x4e')][_0x4801('0x80')])?_0x2a16bd[_0x4801('0x4e')][_0x4801('0x80')]:[_0x2a16bd['body']['ids']];var _0x3de07c=_0x2a16bd[_0x4801('0x56')]['id'];return db['Team'][_0x4801('0x4c')]({'where':{'id':_0x3de07c}})[_0x4801('0x2a')](handleEntityNotFound(_0x5d2ee3,null))[_0x4801('0x2a')](function(_0x48be5c){if(_0x48be5c){var _0xc0e73e=[_0x4801('0x83'),'Chat',_0x4801('0x84'),_0x4801('0x85'),'Fax','Openchannel',_0x4801('0x86')];return db[_0x4801('0x5a')][_0x4801('0x58')](function(_0x139ac8){var _0x5e87e6=_['map'](_0xc0e73e,function(_0x5d64f8){var _0x267886={'attributes':['id','name']};if(_0x5d64f8===_0x4801('0x83')){_0x267886[_0x4801('0x87')]={'attributes':[_0x4801('0x88')]};}return _0x48be5c[_0x4801('0x4f')+_0x5d64f8+_0x4801('0x7c')](_0x267886)[_0x4801('0x2a')](function(_0x35e764){var _0x34bae1=_[_0x4801('0x34')](_0x35e764,function(_0x55e4cb){var _0x5e7d0e=_[_0x4801('0x34')](_0x50b0de,function(_0xc016bb){var _0x3667b5={'where':{'UserId':_0xc016bb,[_0x5d64f8+_0x4801('0x89')]:_0x55e4cb['id']},'transaction':_0x139ac8};if(_0x5d64f8===_0x4801('0x83')){_0x3667b5[_0x4801('0x19')]={'penalty':_0x55e4cb[_0x4801('0x8a')][_0x4801('0x88')]};}return db['User'+_0x5d64f8+_0x4801('0x7b')][_0x4801('0x8b')](_0x3667b5)['then'](function(){socket[_0x4801('0x8c')]('user'+_0x5d64f8+_0x4801('0x8d'),{'UserId':_0xc016bb,[_0x5d64f8+_0x4801('0x89')]:_0x55e4cb['id']});if(_0x5d64f8!==_0x4801('0x83')){return;}return db['User'][_0x4801('0x46')]({'where':{'id':_0x50b0de,'online':0x1},'attributes':['id',_0x4801('0x35'),'online','voicePause',_0x4801('0x8e')],'raw':!![]})['then'](function(_0x1d4a6a){var _0x2c6814=_['map'](_0x1d4a6a,function(_0x548bfb){return db[_0x4801('0x8f')]['upsert']({'membername':_0x548bfb[_0x4801('0x35')],'UserId':_0x548bfb['id'],'queue_name':_0x55e4cb[_0x4801('0x35')],'VoiceQueueId':_0x55e4cb['id'],'interface':_['isNil'](_0x548bfb[_0x4801('0x8e')])?util['format'](_0x4801('0x90'),_0x548bfb[_0x4801('0x35')]):_0x548bfb[_0x4801('0x8e')],'paused':_0x548bfb[_0x4801('0x91')]||![],'penalty':_0x55e4cb['TeamVoiceQueue'][_0x4801('0x88')]},{'transaction':_0x139ac8});});return Promise[_0x4801('0x92')](_0x2c6814);});});});return Promise[_0x4801('0x92')](_0x5e7d0e);});return Promise[_0x4801('0x92')](_0x34bae1);})[_0x4801('0x2a')](function(){return db['TeamVoicePrefix'][_0x4801('0x74')]({'where':{'teamId':_0x3de07c}})[_0x4801('0x2a')](function(_0x15a8f7){if(_0x15a8f7){var _0x10651a=_[_0x4801('0x34')](_0x50b0de,function(_0x19cbe8){db[_0x4801('0x93')][_0x4801('0x94')]({'UserId':_0x19cbe8,'VoicePrefixId':_0x15a8f7[_0x4801('0x70')]});});return Promise['all'](_0x10651a);}});});});return Promise[_0x4801('0x92')](_0x5e87e6)[_0x4801('0x2a')](function(){return _0x48be5c[_0x4801('0x81')](_0x50b0de,{'transaction':_0x139ac8})[_0x4801('0x95')](function(_0xab4841){return _0xab4841;});});});}})[_0x4801('0x2a')](respondWithResult(_0x5d2ee3,null))[_0x4801('0x48')](handleError(_0x5d2ee3,null));};exports['removeAgents']=function(_0x31c4b1,_0x25121b){var _0x1b1bff=_[_0x4801('0x82')](_0x31c4b1[_0x4801('0x36')][_0x4801('0x80')])?_0x31c4b1[_0x4801('0x36')]['ids']:[_0x31c4b1[_0x4801('0x36')][_0x4801('0x80')]];var _0x20c42c=_0x31c4b1['params']['id'];return db['Team'][_0x4801('0x4c')]({'where':{'id':_0x20c42c}})['then'](handleEntityNotFound(_0x25121b,null))['then'](function(_0x27d882){if(_0x27d882){var _0x2c261d=[_0x4801('0x83'),_0x4801('0x96'),_0x4801('0x84'),_0x4801('0x85'),_0x4801('0x97'),_0x4801('0x98'),_0x4801('0x86')];return db[_0x4801('0x5a')][_0x4801('0x58')](function(_0x405444){var _0x401a0d=_[_0x4801('0x34')](_0x2c261d,function(_0x578fbc){var _0x3e070c={'attributes':['id',_0x4801('0x35')]};return _0x27d882[_0x4801('0x4f')+_0x578fbc+_0x4801('0x7c')](_0x3e070c)['then'](function(_0x5b87f8){var _0x3b8d9b=_[_0x4801('0x34')](_0x5b87f8,function(_0x272887){return _0x272887[_0x4801('0x99')](_0x1b1bff,{'transaction':_0x405444})[_0x4801('0x2a')](function(){var _0x1d3544=_[_0x4801('0x34')](_0x1b1bff,function(_0x54aaea){socket[_0x4801('0x8c')](_0x4801('0x52')+_0x578fbc+'Queue:remove',{'UserId':Number(_0x54aaea),[_0x578fbc+'QueueId']:_0x272887['id']});if(_0x578fbc!=='Voice'){return;}return db[_0x4801('0x8f')][_0x4801('0x57')]({'where':{'VoiceQueueId':_0x272887['id'],'UserId':_0x54aaea},'transaction':_0x405444});});return Promise['all'](_0x1d3544);});});return Promise[_0x4801('0x92')](_0x3b8d9b);});});return Promise[_0x4801('0x92')](_0x401a0d)['then'](function(){return _0x27d882['removeAgents'](_0x1b1bff,{'transaction':_0x405444});})[_0x4801('0x2a')](function(){return db[_0x4801('0x6f')]['findOne']({'where':{'teamId':_0x20c42c}})[_0x4801('0x2a')](function(_0x13758e){if(_0x13758e){var _0x506ec9=_['map'](_0x1b1bff,function(_0x3d8f69){db['UserVoicePrefix'][_0x4801('0x57')]({'where':{'UserId':_0x3d8f69,'VoicePrefixId':_0x13758e[_0x4801('0x70')]}});});return Promise[_0x4801('0x92')](_0x506ec9);}});});});}})[_0x4801('0x2a')](respondWithStatusCode(_0x25121b,null))[_0x4801('0x48')](handleError(_0x25121b,null));};exports[_0x4801('0x9a')]=function(_0x481ad0,_0x12e9dd,_0x255b78){var _0x177278={};var _0x2ce298={};var _0x3711d0;var _0xad90fd;return db[_0x4801('0x44')][_0x4801('0x74')]({'where':{'id':_0x481ad0[_0x4801('0x56')]['id']}})[_0x4801('0x2a')](handleEntityNotFound(_0x12e9dd,null))[_0x4801('0x2a')](function(_0x21a8cd){if(_0x21a8cd){_0x3711d0=_0x21a8cd;_0x2ce298[_0x4801('0x33')]=_[_0x4801('0x49')](db[_0x4801('0x9b')][_0x4801('0x2f')]);_0x2ce298[_0x4801('0x36')]=_[_0x4801('0x49')](_0x481ad0[_0x4801('0x36')]);_0x2ce298[_0x4801('0x3f')]=_['intersection'](_0x2ce298[_0x4801('0x33')],_0x2ce298[_0x4801('0x36')]);_0x177278[_0x4801('0x37')]=_[_0x4801('0x38')](_0x2ce298[_0x4801('0x33')],qs['fields'](_0x481ad0[_0x4801('0x36')][_0x4801('0x39')]));_0x177278[_0x4801('0x37')]=_0x177278['attributes'][_0x4801('0x4a')]?_0x177278['attributes']:_0x2ce298[_0x4801('0x33')];_0x177278['order']=qs['sort'](_0x481ad0[_0x4801('0x36')][_0x4801('0x3d')]);_0x177278[_0x4801('0x3e')]=qs[_0x4801('0x3f')](_['pick'](_0x481ad0[_0x4801('0x36')],_0x2ce298[_0x4801('0x3f')]));if(_0x481ad0[_0x4801('0x36')]['filter']){_0x177278[_0x4801('0x3e')]=_[_0x4801('0x42')](_0x177278['where'],{'$or':_[_0x4801('0x34')](_0x177278[_0x4801('0x37')],function(_0x53deec){var _0x42751f={};_0x42751f[_0x53deec]={'$like':'%'+_0x481ad0['query'][_0x4801('0x41')]+'%'};return _0x42751f;})});}_0x177278=_[_0x4801('0x42')]({},_0x177278,_0x481ad0[_0x4801('0x43')]);return _0x3711d0[_0x4801('0x9a')](_0x177278);}})[_0x4801('0x2a')](function(_0x59d276){if(_0x59d276){_0xad90fd=_0x59d276[_0x4801('0x4a')];if(!_0x481ad0[_0x4801('0x36')][_0x4801('0x9c')](_0x4801('0x3a'))){_0x177278['limit']=qs[_0x4801('0x3b')](_0x481ad0[_0x4801('0x36')][_0x4801('0x3b')]);_0x177278[_0x4801('0x21')]=qs[_0x4801('0x21')](_0x481ad0[_0x4801('0x36')]['offset']);}return _0x3711d0['getAgents'](_0x177278);}})[_0x4801('0x2a')](function(_0x4cca4d){if(_0x4cca4d){return _0x4cca4d?{'count':_0xad90fd,'rows':_0x4cca4d}:null;}})[_0x4801('0x2a')](respondWithResult(_0x12e9dd,null))[_0x4801('0x48')](handleError(_0x12e9dd,null));}; \ No newline at end of file +var _0xebb8=['to-csv','ejs','fs-extra','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./team.socket','register','sendStatus','status','json','undefined','limit','count','offset','Content-Range','reject','save','error','stack','name','send','index','map','Team','rawAttributes','fieldName','key','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','pick','type','VIRTUAL','filter','merge','options','then','includeAll','include','findAll','rows','catch','show','keys','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Teams','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','destroy','sequelize','transaction','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','Sequelize','QueryTypes','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','SELECT','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','MailQueueId','UserMailQueue','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','UserSmsQueue','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','UserWhatsappQueue','VoicePrefixId','end','channel','isValidChannel','ValidationError','Unknown\x20channel','capitalize','toLowerCase','Queue','length','order','addQueues','Queues','ids','removeQueues','findOne','remove','addAgents','isArray','Voice','Chat','Mail','Fax','Openchannel','Whatsapp','through','penalty','QueueId','defaults','TeamVoiceQueue','findOrCreate','emit','Queue:save','User','online','voicePause','interface','UserVoiceQueueRt','upsert','isNil','format','SIP/%s','all','removeAgents','Sms','Queue:remove','TeamVoicePrefix','UserVoicePrefix','getAgents','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox'];(function(_0x48ab1f,_0x104e73){var _0xdb10e1=function(_0xc41671){while(--_0xc41671){_0x48ab1f['push'](_0x48ab1f['shift']());}};_0xdb10e1(++_0x104e73);}(_0xebb8,0x1d4));var _0x8ebb=function(_0x43fb15,_0x4b3f5b){_0x43fb15=_0x43fb15-0x0;var _0x42d47a=_0xebb8[_0x43fb15];return _0x42d47a;};'use strict';var emlformat=require(_0x8ebb('0x0'));var rimraf=require(_0x8ebb('0x1'));var zipdir=require(_0x8ebb('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8ebb('0x3'));var moment=require('moment');var BPromise=require(_0x8ebb('0x4'));var Mustache=require(_0x8ebb('0x5'));var util=require(_0x8ebb('0x6'));var path=require(_0x8ebb('0x7'));var sox=require(_0x8ebb('0x8'));var csv=require(_0x8ebb('0x9'));var ejs=require(_0x8ebb('0xa'));var fs=require('fs');var fs_extra=require(_0x8ebb('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x8ebb('0xc'));var deskjs=require(_0x8ebb('0xd'));var toCsv=require(_0x8ebb('0x9'));var querystring=require(_0x8ebb('0xe'));var Papa=require('papaparse');var Redis=require(_0x8ebb('0xf'));var authService=require(_0x8ebb('0x10'));var qs=require(_0x8ebb('0x11'));var as=require(_0x8ebb('0x12'));var hardwareService=require(_0x8ebb('0x13'));var logger=require(_0x8ebb('0x14'))(_0x8ebb('0x15'));var utils=require(_0x8ebb('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x8ebb('0x17'));var db=require(_0x8ebb('0x18'))['db'];config[_0x8ebb('0x19')]=_['defaults'](config[_0x8ebb('0x19')],{'host':_0x8ebb('0x1a'),'port':0x18eb});var socket=require(_0x8ebb('0x1b'))(new Redis(config['redis']));require(_0x8ebb('0x1c'))[_0x8ebb('0x1d')](socket);function respondWithStatusCode(_0x30b62d,_0x698ba8){_0x698ba8=_0x698ba8||0xcc;return function(_0x43343e){if(_0x43343e){return _0x30b62d[_0x8ebb('0x1e')](_0x698ba8);}return _0x30b62d[_0x8ebb('0x1f')](_0x698ba8)['end']();};}function respondWithResult(_0x1266ff,_0x6999ff){_0x6999ff=_0x6999ff||0xc8;return function(_0xf32334){if(_0xf32334){return _0x1266ff['status'](_0x6999ff)[_0x8ebb('0x20')](_0xf32334);}};}function respondWithFilteredResult(_0x20371d,_0x4f2b76){return function(_0x376999){if(_0x376999){var _0x5e3630=typeof _0x4f2b76['offset']===_0x8ebb('0x21')&&typeof _0x4f2b76[_0x8ebb('0x22')]===_0x8ebb('0x21');var _0x2725ae=_0x376999[_0x8ebb('0x23')];var _0x43c54a=_0x5e3630?0x0:_0x4f2b76[_0x8ebb('0x24')];var _0x4c123b=_0x5e3630?_0x376999[_0x8ebb('0x23')]:_0x4f2b76['offset']+_0x4f2b76['limit'];var _0x6f0b20;if(_0x4c123b>=_0x2725ae){_0x4c123b=_0x2725ae;_0x6f0b20=0xc8;}else{_0x6f0b20=0xce;}_0x20371d['status'](_0x6f0b20);return _0x20371d['set'](_0x8ebb('0x25'),_0x43c54a+'-'+_0x4c123b+'/'+_0x2725ae)['json'](_0x376999);}return null;};}function patchUpdates(_0x9c6605){return function(_0x13b4a4){try{jsonpatch['apply'](_0x13b4a4,_0x9c6605,!![]);}catch(_0xe604da){return BPromise[_0x8ebb('0x26')](_0xe604da);}return _0x13b4a4[_0x8ebb('0x27')]();};}function saveUpdates(_0xabb8b4,_0x2a0a3d){return function(_0x48f554){if(_0x48f554){return _0x48f554['update'](_0xabb8b4)['then'](function(_0x217709){return _0x217709;});}return null;};}function handleEntityNotFound(_0xfb33fe,_0x369fd4){return function(_0x1f92db){if(!_0x1f92db){_0xfb33fe['sendStatus'](0x194);}return _0x1f92db;};}function handleError(_0x32287f,_0x184d16){_0x184d16=_0x184d16||0x1f4;return function(_0x13a209){logger[_0x8ebb('0x28')](_0x13a209[_0x8ebb('0x29')]);if(_0x13a209[_0x8ebb('0x2a')]){delete _0x13a209['name'];}_0x32287f[_0x8ebb('0x1f')](_0x184d16)[_0x8ebb('0x2b')](_0x13a209);};}exports[_0x8ebb('0x2c')]=function(_0x39d2c0,_0x3a41ee){var _0x415006={},_0x1bead9={},_0x39a10e={'count':0x0,'rows':[]};var _0x1d661a=_[_0x8ebb('0x2d')](db[_0x8ebb('0x2e')][_0x8ebb('0x2f')],function(_0x4d4a04){return{'name':_0x4d4a04[_0x8ebb('0x30')],'type':_0x4d4a04['type'][_0x8ebb('0x31')]};});_0x1bead9[_0x8ebb('0x32')]=_[_0x8ebb('0x2d')](_0x1d661a,_0x8ebb('0x2a'));_0x1bead9[_0x8ebb('0x33')]=_['keys'](_0x39d2c0[_0x8ebb('0x33')]);_0x1bead9['filters']=_[_0x8ebb('0x34')](_0x1bead9['model'],_0x1bead9['query']);_0x415006[_0x8ebb('0x35')]=_[_0x8ebb('0x34')](_0x1bead9[_0x8ebb('0x32')],qs[_0x8ebb('0x36')](_0x39d2c0[_0x8ebb('0x33')][_0x8ebb('0x36')]));_0x415006[_0x8ebb('0x35')]=_0x415006[_0x8ebb('0x35')]['length']?_0x415006[_0x8ebb('0x35')]:_0x1bead9[_0x8ebb('0x32')];if(!_0x39d2c0[_0x8ebb('0x33')][_0x8ebb('0x37')](_0x8ebb('0x38'))){_0x415006[_0x8ebb('0x22')]=qs[_0x8ebb('0x22')](_0x39d2c0['query']['limit']);_0x415006[_0x8ebb('0x24')]=qs[_0x8ebb('0x24')](_0x39d2c0[_0x8ebb('0x33')][_0x8ebb('0x24')]);}_0x415006['order']=qs[_0x8ebb('0x39')](_0x39d2c0[_0x8ebb('0x33')][_0x8ebb('0x39')]);_0x415006[_0x8ebb('0x3a')]=qs[_0x8ebb('0x3b')](_[_0x8ebb('0x3c')](_0x39d2c0[_0x8ebb('0x33')],_0x1bead9[_0x8ebb('0x3b')]),_0x1d661a);if(_0x39d2c0[_0x8ebb('0x33')]['filter']){_0x415006[_0x8ebb('0x3a')]=_['merge'](_0x415006[_0x8ebb('0x3a')],{'$or':_[_0x8ebb('0x2d')](_0x1d661a,function(_0x27b51a){if(_0x27b51a[_0x8ebb('0x3d')]!==_0x8ebb('0x3e')){var _0x1ce059={};_0x1ce059[_0x27b51a[_0x8ebb('0x2a')]]={'$like':'%'+_0x39d2c0[_0x8ebb('0x33')][_0x8ebb('0x3f')]+'%'};return _0x1ce059;}})});}_0x415006=_[_0x8ebb('0x40')]({},_0x415006,_0x39d2c0[_0x8ebb('0x41')]);var _0x23ad3e={'where':_0x415006[_0x8ebb('0x3a')]};return db[_0x8ebb('0x2e')]['count'](_0x23ad3e)[_0x8ebb('0x42')](function(_0x40003e){_0x39a10e[_0x8ebb('0x23')]=_0x40003e;if(_0x39d2c0[_0x8ebb('0x33')][_0x8ebb('0x43')]){_0x415006[_0x8ebb('0x44')]=[{'all':!![]}];}return db[_0x8ebb('0x2e')][_0x8ebb('0x45')](_0x415006);})['then'](function(_0x1c172b){_0x39a10e[_0x8ebb('0x46')]=_0x1c172b;return _0x39a10e;})[_0x8ebb('0x42')](respondWithFilteredResult(_0x3a41ee,_0x415006))[_0x8ebb('0x47')](handleError(_0x3a41ee,null));};exports[_0x8ebb('0x48')]=function(_0x4de270,_0x43fd20){var _0x3a9c4f={'raw':![],'where':{'id':_0x4de270['params']['id']}},_0x399c40={};_0x399c40[_0x8ebb('0x32')]=_['keys'](db[_0x8ebb('0x2e')][_0x8ebb('0x2f')]);_0x399c40[_0x8ebb('0x33')]=_[_0x8ebb('0x49')](_0x4de270['query']);_0x399c40[_0x8ebb('0x3b')]=_[_0x8ebb('0x34')](_0x399c40[_0x8ebb('0x32')],_0x399c40[_0x8ebb('0x33')]);_0x3a9c4f[_0x8ebb('0x35')]=_[_0x8ebb('0x34')](_0x399c40[_0x8ebb('0x32')],qs['fields'](_0x4de270[_0x8ebb('0x33')][_0x8ebb('0x36')]));_0x3a9c4f[_0x8ebb('0x35')]=_0x3a9c4f[_0x8ebb('0x35')]['length']?_0x3a9c4f[_0x8ebb('0x35')]:_0x399c40[_0x8ebb('0x32')];if(_0x4de270[_0x8ebb('0x33')][_0x8ebb('0x43')]){_0x3a9c4f[_0x8ebb('0x44')]=[{'all':!![]}];}_0x3a9c4f=_[_0x8ebb('0x40')]({},_0x3a9c4f,_0x4de270[_0x8ebb('0x41')]);return db[_0x8ebb('0x2e')][_0x8ebb('0x4a')](_0x3a9c4f)[_0x8ebb('0x42')](handleEntityNotFound(_0x43fd20,null))['then'](respondWithResult(_0x43fd20,null))[_0x8ebb('0x47')](handleError(_0x43fd20,null));};exports['create']=function(_0x489623,_0x50f397){return db[_0x8ebb('0x2e')][_0x8ebb('0x4b')](_0x489623[_0x8ebb('0x4c')],{})[_0x8ebb('0x42')](function(_0x1c88f4){var _0x5641af=_0x489623[_0x8ebb('0x4d')][_0x8ebb('0x4e')]({'plain':!![]});if(!_0x5641af)throw new Error(_0x8ebb('0x4f'));if(_0x5641af[_0x8ebb('0x50')]===_0x8ebb('0x4d')){var _0x33d648=_0x1c88f4[_0x8ebb('0x4e')]({'plain':!![]});var _0x276664=_0x8ebb('0x51');return db[_0x8ebb('0x52')]['find']({'where':{'name':_0x276664,'userProfileId':_0x5641af[_0x8ebb('0x53')]},'raw':!![]})[_0x8ebb('0x42')](function(_0xb82c16){if(_0xb82c16&&_0xb82c16['autoAssociation']===0x0){return db[_0x8ebb('0x54')][_0x8ebb('0x4b')]({'name':_0x33d648[_0x8ebb('0x2a')],'resourceId':_0x33d648['id'],'type':_0xb82c16[_0x8ebb('0x2a')],'sectionId':_0xb82c16['id']},{})[_0x8ebb('0x42')](function(){return _0x1c88f4;});}else{return _0x1c88f4;}})['catch'](function(_0x51d491){logger[_0x8ebb('0x28')](_0x8ebb('0x55'),_0x51d491);throw _0x51d491;});}return _0x1c88f4;})[_0x8ebb('0x42')](respondWithResult(_0x50f397,0xc9))[_0x8ebb('0x47')](handleError(_0x50f397,null));};exports[_0x8ebb('0x56')]=function(_0x152e94,_0x2c9945){if(_0x152e94[_0x8ebb('0x4c')]['id']){delete _0x152e94[_0x8ebb('0x4c')]['id'];}return db[_0x8ebb('0x2e')][_0x8ebb('0x4a')]({'where':{'id':_0x152e94[_0x8ebb('0x57')]['id']}})[_0x8ebb('0x42')](handleEntityNotFound(_0x2c9945,null))[_0x8ebb('0x42')](saveUpdates(_0x152e94[_0x8ebb('0x4c')],null))[_0x8ebb('0x42')](respondWithResult(_0x2c9945,null))[_0x8ebb('0x47')](handleError(_0x2c9945,null));};exports[_0x8ebb('0x58')]=function(_0x5a55f4,_0x3dca38){var _0x5423e9=_0x5a55f4[_0x8ebb('0x57')]['id'];var _0x4085a7=[];return db[_0x8ebb('0x59')][_0x8ebb('0x5a')](function(_0x431ee1){var _0x4cbda9=_0x8ebb('0x5b')+_0x5423e9;return db[_0x8ebb('0x59')][_0x8ebb('0x33')](_0x4cbda9,{'type':db[_0x8ebb('0x5c')][_0x8ebb('0x5d')]['SELECT'],'raw':!![],'transaction':_0x431ee1})[_0x8ebb('0x42')](function(_0x18ad53){_0x4085a7=_['map'](_0x18ad53,function(_0x71a325){return Number(_0x71a325[_0x8ebb('0x5e')]);});})[_0x8ebb('0x42')](function(){var _0x338f6b=_0x8ebb('0x5f')+_0x5423e9;return db['sequelize'][_0x8ebb('0x33')](_0x338f6b,{'type':db['Sequelize'][_0x8ebb('0x5d')][_0x8ebb('0x60')],'raw':!![],'transaction':_0x431ee1});})[_0x8ebb('0x42')](function(_0x5c553a){var _0x12a65f=_[_0x8ebb('0x2d')](_0x5c553a,function(_0x4f66a9){return Number(_0x4f66a9['VoiceQueueId']);});return db['UserVoiceQueue'][_0x8ebb('0x58')]({'where':{'UserId':{'$in':_0x4085a7},'VoiceQueueId':{'$in':_0x12a65f}},'transaction':_0x431ee1});})['then'](function(){var _0x3f07c3=_0x8ebb('0x61')+_0x5423e9;return db[_0x8ebb('0x59')]['query'](_0x3f07c3,{'type':db[_0x8ebb('0x5c')][_0x8ebb('0x5d')]['SELECT'],'raw':!![],'transaction':_0x431ee1});})[_0x8ebb('0x42')](function(_0x526f49){var _0x8358e6=_[_0x8ebb('0x2d')](_0x526f49,function(_0x292dc5){return Number(_0x292dc5[_0x8ebb('0x62')]);});return db[_0x8ebb('0x63')][_0x8ebb('0x58')]({'where':{'UserId':{'$in':_0x4085a7},'MailQueueId':{'$in':_0x8358e6}},'transaction':_0x431ee1});})[_0x8ebb('0x42')](function(){var _0x1a3aff=_0x8ebb('0x64')+_0x5423e9;return db[_0x8ebb('0x59')]['query'](_0x1a3aff,{'type':db[_0x8ebb('0x5c')][_0x8ebb('0x5d')][_0x8ebb('0x60')],'raw':!![],'transaction':_0x431ee1});})[_0x8ebb('0x42')](function(_0x3afdbd){var _0x285613=_[_0x8ebb('0x2d')](_0x3afdbd,function(_0x4e9162){return Number(_0x4e9162[_0x8ebb('0x65')]);});return db[_0x8ebb('0x66')][_0x8ebb('0x58')]({'where':{'UserId':{'$in':_0x4085a7},'SmsQueueId':{'$in':_0x285613}},'transaction':_0x431ee1});})[_0x8ebb('0x42')](function(){var _0x2e3627=_0x8ebb('0x67')+_0x5423e9;return db[_0x8ebb('0x59')]['query'](_0x2e3627,{'type':db[_0x8ebb('0x5c')][_0x8ebb('0x5d')][_0x8ebb('0x60')],'raw':!![],'transaction':_0x431ee1});})[_0x8ebb('0x42')](function(_0x2b1774){var _0x5c55f2=_[_0x8ebb('0x2d')](_0x2b1774,function(_0x22548a){return Number(_0x22548a['ChatQueueId']);});return db[_0x8ebb('0x68')][_0x8ebb('0x58')]({'where':{'UserId':{'$in':_0x4085a7},'ChatQueueId':{'$in':_0x5c55f2}},'transaction':_0x431ee1});})[_0x8ebb('0x42')](function(){var _0x11225d=_0x8ebb('0x69')+_0x5423e9;return db[_0x8ebb('0x59')][_0x8ebb('0x33')](_0x11225d,{'type':db['Sequelize'][_0x8ebb('0x5d')]['SELECT'],'raw':!![],'transaction':_0x431ee1});})[_0x8ebb('0x42')](function(_0x2964ab){var _0x31f729=_[_0x8ebb('0x2d')](_0x2964ab,function(_0x315d99){return Number(_0x315d99['FaxQueueId']);});return db['UserFaxQueue']['destroy']({'where':{'UserId':{'$in':_0x4085a7},'FaxQueueId':{'$in':_0x31f729}},'transaction':_0x431ee1});})['then'](function(){var _0x478838=_0x8ebb('0x6a')+_0x5423e9;return db[_0x8ebb('0x59')][_0x8ebb('0x33')](_0x478838,{'type':db[_0x8ebb('0x5c')][_0x8ebb('0x5d')]['SELECT'],'raw':!![],'transaction':_0x431ee1});})[_0x8ebb('0x42')](function(_0xe359bc){var _0x3f9298=_[_0x8ebb('0x2d')](_0xe359bc,function(_0x404133){return Number(_0x404133['OpenchannelQueueId']);});return db['UserOpenchannelQueue'][_0x8ebb('0x58')]({'where':{'UserId':{'$in':_0x4085a7},'OpenchannelQueueId':{'$in':_0x3f9298}},'transaction':_0x431ee1});})[_0x8ebb('0x42')](function(){var _0x57b5b5=_0x8ebb('0x6b')+_0x5423e9;return db[_0x8ebb('0x59')][_0x8ebb('0x33')](_0x57b5b5,{'type':db['Sequelize'][_0x8ebb('0x5d')][_0x8ebb('0x60')],'raw':!![],'transaction':_0x431ee1});})[_0x8ebb('0x42')](function(_0x4d24ba){var _0x33a0d0=_[_0x8ebb('0x2d')](_0x4d24ba,function(_0x2accd9){return Number(_0x2accd9[_0x8ebb('0x6c')]);});return db[_0x8ebb('0x6d')][_0x8ebb('0x58')]({'where':{'UserId':{'$in':_0x4085a7},'WhatsappQueueId':{'$in':_0x33a0d0}},'transaction':_0x431ee1});})[_0x8ebb('0x42')](function(){return db['TeamVoicePrefix'][_0x8ebb('0x4a')]({'where':{'TeamId':_0x5423e9}});})[_0x8ebb('0x42')](function(_0xacf5e2){if(_0xacf5e2===null){return;}return db['UserVoicePrefix'][_0x8ebb('0x58')]({'where':{'UserId':{'$in':_0x4085a7},'VoicePrefixId':_0xacf5e2[_0x8ebb('0x6e')]},'transaction':_0x431ee1});})['then'](function(){return db[_0x8ebb('0x2e')]['destroy']({'where':{'id':_0x5423e9},'cascade':!![],'transaction':_0x431ee1});})[_0x8ebb('0x42')](function(_0x4b8ee7){if(_0x4b8ee7===0x0){_0x3dca38[_0x8ebb('0x1e')](0x194);}else{return db[_0x8ebb('0x54')][_0x8ebb('0x58')]({'where':{'type':_0x8ebb('0x51'),'resourceId':_0x5423e9},'cascade':!![],'transaction':_0x431ee1})[_0x8ebb('0x42')](function(){_0x3dca38['status'](0xcc)[_0x8ebb('0x6f')]();});}})[_0x8ebb('0x47')](function(_0x5abc74){_0x3dca38[_0x8ebb('0x1f')](0x1f4)[_0x8ebb('0x2b')](_0x5abc74);});});};exports['getQueues']=function(_0x5c9ca4,_0x38d271,_0x5821ed){return db['Team']['findOne']({'where':{'id':_0x5c9ca4['params']['id']}})[_0x8ebb('0x42')](handleEntityNotFound(_0x38d271,null))['then'](function(_0xbd4aa6){if(!_0x5c9ca4['query'][_0x8ebb('0x70')]||!utils[_0x8ebb('0x71')](_0x5c9ca4[_0x8ebb('0x33')][_0x8ebb('0x70')])){throw new db[(_0x8ebb('0x5c'))][(_0x8ebb('0x72'))](_0x8ebb('0x73'));}var _0x582f35={};var _0x3204b6={};_0x3204b6[_0x8ebb('0x32')]=_[_0x8ebb('0x49')](db[_[_0x8ebb('0x74')](_0x5c9ca4[_0x8ebb('0x33')][_0x8ebb('0x70')][_0x8ebb('0x75')]())+_0x8ebb('0x76')][_0x8ebb('0x2f')]);_0x3204b6[_0x8ebb('0x33')]=_['keys'](_0x5c9ca4['query']);_0x3204b6[_0x8ebb('0x3b')]=_[_0x8ebb('0x34')](_0x3204b6[_0x8ebb('0x32')],_0x3204b6[_0x8ebb('0x33')]);_0x582f35['attributes']=_[_0x8ebb('0x34')](_0x3204b6[_0x8ebb('0x32')],qs[_0x8ebb('0x36')](_0x5c9ca4[_0x8ebb('0x33')][_0x8ebb('0x36')]));_0x582f35[_0x8ebb('0x35')]=_0x582f35[_0x8ebb('0x35')][_0x8ebb('0x77')]?_0x582f35[_0x8ebb('0x35')]:_0x3204b6[_0x8ebb('0x32')];_0x582f35['limit']=qs[_0x8ebb('0x22')](_0x5c9ca4[_0x8ebb('0x33')][_0x8ebb('0x22')]);_0x582f35['offset']=qs[_0x8ebb('0x24')](_0x5c9ca4['query'][_0x8ebb('0x24')]);_0x582f35[_0x8ebb('0x78')]=qs[_0x8ebb('0x39')](_0x5c9ca4['query']['sort']);_0x582f35[_0x8ebb('0x3a')]=qs[_0x8ebb('0x3b')](_[_0x8ebb('0x3c')](_0x5c9ca4[_0x8ebb('0x33')],_0x3204b6[_0x8ebb('0x3b')]));_0x582f35=_[_0x8ebb('0x40')]({},_0x582f35,_0x5c9ca4[_0x8ebb('0x41')]);return _0xbd4aa6[_0x8ebb('0x4e')+_[_0x8ebb('0x74')](_0x5c9ca4[_0x8ebb('0x33')][_0x8ebb('0x70')][_0x8ebb('0x75')]())+'Queues'](_0x582f35);})[_0x8ebb('0x42')](respondWithResult(_0x38d271,null))[_0x8ebb('0x47')](handleError(_0x38d271,null));};exports[_0x8ebb('0x79')]=function(_0x1c9773,_0x4cbdb1,_0x40832b){return db[_0x8ebb('0x2e')]['findOne']({'where':{'id':_0x1c9773[_0x8ebb('0x57')]['id']}})[_0x8ebb('0x42')](function(_0x43b6f7){if(_0x43b6f7){if(!_0x1c9773[_0x8ebb('0x4c')][_0x8ebb('0x70')]||!utils[_0x8ebb('0x71')](_0x1c9773[_0x8ebb('0x4c')]['channel'])){throw new db[(_0x8ebb('0x5c'))]['ValidationError'](_0x8ebb('0x73'));}return _0x43b6f7['add'+_['capitalize'](_0x1c9773[_0x8ebb('0x4c')][_0x8ebb('0x70')]['toLowerCase']())+_0x8ebb('0x7a')](_0x1c9773[_0x8ebb('0x4c')][_0x8ebb('0x7b')]);}return null;})[_0x8ebb('0x42')](handleEntityNotFound(_0x4cbdb1,null))[_0x8ebb('0x42')](respondWithStatusCode(_0x4cbdb1,null))[_0x8ebb('0x47')](handleError(_0x4cbdb1,null));};exports[_0x8ebb('0x7c')]=function(_0x557165,_0x5db250,_0x2be6b2){return db[_0x8ebb('0x2e')][_0x8ebb('0x7d')]({'where':{'id':_0x557165[_0x8ebb('0x57')]['id']}})[_0x8ebb('0x42')](function(_0x1866ef){if(_0x1866ef){if(!_0x557165[_0x8ebb('0x33')]['channel']||!utils['isValidChannel'](_0x557165[_0x8ebb('0x33')][_0x8ebb('0x70')])){throw new db[(_0x8ebb('0x5c'))]['ValidationError'](_0x8ebb('0x73'));}return _0x1866ef[_0x8ebb('0x7e')+_[_0x8ebb('0x74')](_0x557165[_0x8ebb('0x33')][_0x8ebb('0x70')][_0x8ebb('0x75')]())+_0x8ebb('0x7a')](_0x557165[_0x8ebb('0x33')][_0x8ebb('0x7b')]);}return null;})[_0x8ebb('0x42')](handleEntityNotFound(_0x5db250,null))[_0x8ebb('0x42')](respondWithStatusCode(_0x5db250,null))[_0x8ebb('0x47')](handleError(_0x5db250,null));};exports[_0x8ebb('0x7f')]=function(_0x586059,_0x57ab50){var _0x3992be=_[_0x8ebb('0x80')](_0x586059[_0x8ebb('0x4c')][_0x8ebb('0x7b')])?_0x586059[_0x8ebb('0x4c')][_0x8ebb('0x7b')]:[_0x586059['body'][_0x8ebb('0x7b')]];var _0xbe9099=_0x586059[_0x8ebb('0x57')]['id'];return db[_0x8ebb('0x2e')][_0x8ebb('0x4a')]({'where':{'id':_0xbe9099}})[_0x8ebb('0x42')](handleEntityNotFound(_0x57ab50,null))[_0x8ebb('0x42')](function(_0x55a220){if(_0x55a220){var _0x4be381=[_0x8ebb('0x81'),_0x8ebb('0x82'),_0x8ebb('0x83'),'Sms',_0x8ebb('0x84'),_0x8ebb('0x85'),_0x8ebb('0x86')];return db[_0x8ebb('0x59')]['transaction'](function(_0xad218f){var _0x45e196=_[_0x8ebb('0x2d')](_0x4be381,function(_0xd63eb2){var _0x51373d={'attributes':['id',_0x8ebb('0x2a')]};if(_0xd63eb2===_0x8ebb('0x81')){_0x51373d[_0x8ebb('0x87')]={'attributes':[_0x8ebb('0x88')]};}return _0x55a220['get'+_0xd63eb2+'Queues'](_0x51373d)[_0x8ebb('0x42')](function(_0x28e6a3){var _0x418aa8=_[_0x8ebb('0x2d')](_0x28e6a3,function(_0x43f6c6){var _0x1021fc=_[_0x8ebb('0x2d')](_0x3992be,function(_0x234dea){var _0x46f4af={'where':{'UserId':_0x234dea,[_0xd63eb2+_0x8ebb('0x89')]:_0x43f6c6['id']},'transaction':_0xad218f};if(_0xd63eb2==='Voice'){_0x46f4af[_0x8ebb('0x8a')]={'penalty':_0x43f6c6[_0x8ebb('0x8b')][_0x8ebb('0x88')]};}return db['User'+_0xd63eb2+'Queue'][_0x8ebb('0x8c')](_0x46f4af)['then'](function(){socket[_0x8ebb('0x8d')](_0x8ebb('0x4d')+_0xd63eb2+_0x8ebb('0x8e'),{'UserId':_0x234dea,[_0xd63eb2+'QueueId']:_0x43f6c6['id']});if(_0xd63eb2!=='Voice'){return;}return db[_0x8ebb('0x8f')]['findAll']({'where':{'id':_0x3992be,'online':0x1},'attributes':['id',_0x8ebb('0x2a'),_0x8ebb('0x90'),_0x8ebb('0x91'),_0x8ebb('0x92')],'raw':!![]})[_0x8ebb('0x42')](function(_0x1e4478){var _0x1a0df0=_[_0x8ebb('0x2d')](_0x1e4478,function(_0x119866){return db[_0x8ebb('0x93')][_0x8ebb('0x94')]({'membername':_0x119866[_0x8ebb('0x2a')],'UserId':_0x119866['id'],'queue_name':_0x43f6c6[_0x8ebb('0x2a')],'VoiceQueueId':_0x43f6c6['id'],'interface':_[_0x8ebb('0x95')](_0x119866[_0x8ebb('0x92')])?util[_0x8ebb('0x96')](_0x8ebb('0x97'),_0x119866[_0x8ebb('0x2a')]):_0x119866[_0x8ebb('0x92')],'paused':_0x119866[_0x8ebb('0x91')]||![],'penalty':_0x43f6c6[_0x8ebb('0x8b')]['penalty']},{'transaction':_0xad218f});});return Promise['all'](_0x1a0df0);});});});return Promise[_0x8ebb('0x98')](_0x1021fc);});return Promise[_0x8ebb('0x98')](_0x418aa8);})['then'](function(){return db['TeamVoicePrefix'][_0x8ebb('0x7d')]({'where':{'teamId':_0xbe9099}})[_0x8ebb('0x42')](function(_0xbf92d6){if(_0xbf92d6){var _0x208fef=_[_0x8ebb('0x2d')](_0x3992be,function(_0x3b74be){db['UserVoicePrefix'][_0x8ebb('0x94')]({'UserId':_0x3b74be,'VoicePrefixId':_0xbf92d6['VoicePrefixId']});});return Promise['all'](_0x208fef);}});});});return Promise[_0x8ebb('0x98')](_0x45e196)[_0x8ebb('0x42')](function(){return _0x55a220[_0x8ebb('0x7f')](_0x3992be,{'transaction':_0xad218f})['spread'](function(_0x25f5fb){return _0x25f5fb;});});});}})[_0x8ebb('0x42')](respondWithResult(_0x57ab50,null))[_0x8ebb('0x47')](handleError(_0x57ab50,null));};exports[_0x8ebb('0x99')]=function(_0x1c07ed,_0x4012cf){var _0xec1dc8=_['isArray'](_0x1c07ed['query'][_0x8ebb('0x7b')])?_0x1c07ed[_0x8ebb('0x33')][_0x8ebb('0x7b')]:[_0x1c07ed[_0x8ebb('0x33')]['ids']];var _0x58db6e=_0x1c07ed[_0x8ebb('0x57')]['id'];return db[_0x8ebb('0x2e')][_0x8ebb('0x4a')]({'where':{'id':_0x58db6e}})[_0x8ebb('0x42')](handleEntityNotFound(_0x4012cf,null))['then'](function(_0x4c1050){if(_0x4c1050){var _0x31353c=[_0x8ebb('0x81'),_0x8ebb('0x82'),'Mail',_0x8ebb('0x9a'),'Fax',_0x8ebb('0x85'),_0x8ebb('0x86')];return db['sequelize'][_0x8ebb('0x5a')](function(_0x17d235){var _0x5ef475=_[_0x8ebb('0x2d')](_0x31353c,function(_0x142b22){var _0x4f74c0={'attributes':['id',_0x8ebb('0x2a')]};return _0x4c1050[_0x8ebb('0x4e')+_0x142b22+_0x8ebb('0x7a')](_0x4f74c0)[_0x8ebb('0x42')](function(_0x497c87){var _0x5a94bc=_[_0x8ebb('0x2d')](_0x497c87,function(_0x483405){return _0x483405['removeAgents'](_0xec1dc8,{'transaction':_0x17d235})[_0x8ebb('0x42')](function(){var _0x406c9c=_[_0x8ebb('0x2d')](_0xec1dc8,function(_0x33da82){socket[_0x8ebb('0x8d')](_0x8ebb('0x4d')+_0x142b22+_0x8ebb('0x9b'),{'UserId':Number(_0x33da82),[_0x142b22+_0x8ebb('0x89')]:_0x483405['id']});if(_0x142b22!==_0x8ebb('0x81')){return;}return db[_0x8ebb('0x93')][_0x8ebb('0x58')]({'where':{'VoiceQueueId':_0x483405['id'],'UserId':_0x33da82},'transaction':_0x17d235});});return Promise[_0x8ebb('0x98')](_0x406c9c);});});return Promise['all'](_0x5a94bc);});});return Promise[_0x8ebb('0x98')](_0x5ef475)[_0x8ebb('0x42')](function(){return _0x4c1050[_0x8ebb('0x99')](_0xec1dc8,{'transaction':_0x17d235});})['then'](function(){return db[_0x8ebb('0x9c')][_0x8ebb('0x7d')]({'where':{'teamId':_0x58db6e}})[_0x8ebb('0x42')](function(_0x596b43){if(_0x596b43){var _0x1b63cb=_[_0x8ebb('0x2d')](_0xec1dc8,function(_0x33d78b){db[_0x8ebb('0x9d')][_0x8ebb('0x58')]({'where':{'UserId':_0x33d78b,'VoicePrefixId':_0x596b43[_0x8ebb('0x6e')]}});});return Promise[_0x8ebb('0x98')](_0x1b63cb);}});});});}})[_0x8ebb('0x42')](respondWithStatusCode(_0x4012cf,null))[_0x8ebb('0x47')](handleError(_0x4012cf,null));};exports[_0x8ebb('0x9e')]=function(_0x43730e,_0x2e6339,_0x3c5f4f){var _0x1852c3={};var _0x4bf493={};var _0x53163a;var _0x53d009;return db[_0x8ebb('0x2e')]['findOne']({'where':{'id':_0x43730e[_0x8ebb('0x57')]['id']}})['then'](handleEntityNotFound(_0x2e6339,null))[_0x8ebb('0x42')](function(_0x5f4651){if(_0x5f4651){_0x53163a=_0x5f4651;_0x4bf493[_0x8ebb('0x32')]=_['keys'](db[_0x8ebb('0x8f')][_0x8ebb('0x2f')]);_0x4bf493[_0x8ebb('0x33')]=_[_0x8ebb('0x49')](_0x43730e[_0x8ebb('0x33')]);_0x4bf493[_0x8ebb('0x3b')]=_[_0x8ebb('0x34')](_0x4bf493[_0x8ebb('0x32')],_0x4bf493[_0x8ebb('0x33')]);_0x1852c3['attributes']=_[_0x8ebb('0x34')](_0x4bf493[_0x8ebb('0x32')],qs[_0x8ebb('0x36')](_0x43730e[_0x8ebb('0x33')][_0x8ebb('0x36')]));_0x1852c3[_0x8ebb('0x35')]=_0x1852c3[_0x8ebb('0x35')][_0x8ebb('0x77')]?_0x1852c3[_0x8ebb('0x35')]:_0x4bf493['model'];_0x1852c3['order']=qs['sort'](_0x43730e[_0x8ebb('0x33')][_0x8ebb('0x39')]);_0x1852c3[_0x8ebb('0x3a')]=qs[_0x8ebb('0x3b')](_[_0x8ebb('0x3c')](_0x43730e['query'],_0x4bf493[_0x8ebb('0x3b')]));if(_0x43730e[_0x8ebb('0x33')][_0x8ebb('0x3f')]){_0x1852c3[_0x8ebb('0x3a')]=_[_0x8ebb('0x40')](_0x1852c3['where'],{'$or':_['map'](_0x1852c3[_0x8ebb('0x35')],function(_0x1f75a0){var _0x4c2e14={};_0x4c2e14[_0x1f75a0]={'$like':'%'+_0x43730e[_0x8ebb('0x33')][_0x8ebb('0x3f')]+'%'};return _0x4c2e14;})});}_0x1852c3=_['merge']({},_0x1852c3,_0x43730e[_0x8ebb('0x41')]);return _0x53163a[_0x8ebb('0x9e')](_0x1852c3);}})['then'](function(_0x3a9b66){if(_0x3a9b66){_0x53d009=_0x3a9b66[_0x8ebb('0x77')];if(!_0x43730e['query'][_0x8ebb('0x37')]('nolimit')){_0x1852c3[_0x8ebb('0x22')]=qs['limit'](_0x43730e['query'][_0x8ebb('0x22')]);_0x1852c3[_0x8ebb('0x24')]=qs[_0x8ebb('0x24')](_0x43730e['query']['offset']);}return _0x53163a[_0x8ebb('0x9e')](_0x1852c3);}})[_0x8ebb('0x42')](function(_0x293cb5){if(_0x293cb5){return _0x293cb5?{'count':_0x53d009,'rows':_0x293cb5}:null;}})[_0x8ebb('0x42')](respondWithResult(_0x2e6339,null))[_0x8ebb('0x47')](handleError(_0x2e6339,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index a22d764..22b5688 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 _0x74d7=['hasOwnProperty','hook','events','Team','setMaxListeners','save','update','remove','emit'];(function(_0x18026e,_0x4590f3){var _0x2af9e0=function(_0x59b5b3){while(--_0x59b5b3){_0x18026e['push'](_0x18026e['shift']());}};_0x2af9e0(++_0x4590f3);}(_0x74d7,0x1a0));var _0x774d=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0x74d7[_0x47e7cb];return _0x2a8874;};'use strict';var EventEmitter=require(_0x774d('0x0'));var Team=require('../../mysqldb')['db'][_0x774d('0x1')];var TeamEvents=new EventEmitter();TeamEvents[_0x774d('0x2')](0x0);var events={'afterCreate':_0x774d('0x3'),'afterUpdate':_0x774d('0x4'),'afterDestroy':_0x774d('0x5')};function emitEvent(_0x3b996d){return function(_0x16b302,_0x84ac94,_0x4b536f){TeamEvents[_0x774d('0x6')](_0x3b996d+':'+_0x16b302['id'],_0x16b302);TeamEvents[_0x774d('0x6')](_0x3b996d,_0x16b302);_0x4b536f(null);};}for(var e in events){if(events[_0x774d('0x7')](e)){var event=events[e];Team[_0x774d('0x8')](e,emitEvent(event));}}module['exports']=TeamEvents; \ No newline at end of file +var _0x4e13=['hasOwnProperty','exports','events','../../mysqldb','Team','save','update','remove','emit'];(function(_0x5850b2,_0x3002e4){var _0x5da823=function(_0x1b21c0){while(--_0x1b21c0){_0x5850b2['push'](_0x5850b2['shift']());}};_0x5da823(++_0x3002e4);}(_0x4e13,0x158));var _0x34e1=function(_0x245e2d,_0x1515a6){_0x245e2d=_0x245e2d-0x0;var _0x2d1b6f=_0x4e13[_0x245e2d];return _0x2d1b6f;};'use strict';var EventEmitter=require(_0x34e1('0x0'));var Team=require(_0x34e1('0x1'))['db'][_0x34e1('0x2')];var TeamEvents=new EventEmitter();TeamEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x34e1('0x3'),'afterUpdate':_0x34e1('0x4'),'afterDestroy':_0x34e1('0x5')};function emitEvent(_0x2ce777){return function(_0x4572e7,_0x45422d,_0x51af28){TeamEvents[_0x34e1('0x6')](_0x2ce777+':'+_0x4572e7['id'],_0x4572e7);TeamEvents[_0x34e1('0x6')](_0x2ce777,_0x4572e7);_0x51af28(null);};}for(var e in events){if(events[_0x34e1('0x7')](e)){var event=events[e];Team['hook'](e,emitEvent(event));}}module[_0x34e1('0x8')]=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index c23a379..92a9060 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 _0xdf3c=['define','Team','teams','Chat','Mail','Openchannel','Voice','resolve','lodash','./team.attributes','get','Queues','then','map','channel','catch','exports'];(function(_0x31f07b,_0x594b5f){var _0x444e38=function(_0x1e2a4e){while(--_0x1e2a4e){_0x31f07b['push'](_0x31f07b['shift']());}};_0x444e38(++_0x594b5f);}(_0xdf3c,0x107));var _0xcdf3=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0xdf3c[_0x199572];return _0x13cfa3;};'use strict';var _=require(_0xcdf3('0x0'));var attributes=require(_0xcdf3('0x1'));function getQueuesByChannel(_0x17698e,_0x5036ca){var _0x5c4a72=_0xcdf3('0x2')+_0x5036ca+_0xcdf3('0x3');return _0x17698e[_0x5c4a72]()[_0xcdf3('0x4')](function(_0x7dee3a){return _[_0xcdf3('0x5')](_0x7dee3a,function(_0x749076){_0x749076['setDataValue'](_0xcdf3('0x6'),_0x5036ca);return _0x749076;});})[_0xcdf3('0x7')](function(_0x143217){throw _0x143217;});}module[_0xcdf3('0x8')]=function(_0x44c1fc){return _0x44c1fc[_0xcdf3('0x9')](_0xcdf3('0xa'),attributes,{'tableName':_0xcdf3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x179d17=this;var _0x1635e0=[_0xcdf3('0xc'),'Fax',_0xcdf3('0xd'),_0xcdf3('0xe'),'Sms',_0xcdf3('0xf'),'Whatsapp'];return Promise[_0xcdf3('0x10')]()[_0xcdf3('0x4')](function(){var _0x54417d=_['map'](_0x1635e0,function(_0x5f5b02){return getQueuesByChannel(_0x179d17,_0x5f5b02);});return Promise['all'](_0x54417d);})['catch'](function(_0x1891a9){throw _0x1891a9;});}}});}; \ No newline at end of file +var _0x83b2=['exports','define','Team','teams','Chat','Fax','Mail','Openchannel','Voice','Whatsapp','resolve','all','lodash','./team.attributes','get','Queues','then','map','setDataValue','channel','catch'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x83b2,0x1c5));var _0x283b=function(_0x2c0f49,_0x204a0e){_0x2c0f49=_0x2c0f49-0x0;var _0x28c55c=_0x83b2[_0x2c0f49];return _0x28c55c;};'use strict';var _=require(_0x283b('0x0'));var attributes=require(_0x283b('0x1'));function getQueuesByChannel(_0x22caf2,_0x54a37a){var _0x58563d=_0x283b('0x2')+_0x54a37a+_0x283b('0x3');return _0x22caf2[_0x58563d]()[_0x283b('0x4')](function(_0x592fea){return _[_0x283b('0x5')](_0x592fea,function(_0x363b1d){_0x363b1d[_0x283b('0x6')](_0x283b('0x7'),_0x54a37a);return _0x363b1d;});})[_0x283b('0x8')](function(_0x2d8204){throw _0x2d8204;});}module[_0x283b('0x9')]=function(_0x2687a1){return _0x2687a1[_0x283b('0xa')](_0x283b('0xb'),attributes,{'tableName':_0x283b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x9648d1=this;var _0x1f4eb0=[_0x283b('0xd'),_0x283b('0xe'),_0x283b('0xf'),_0x283b('0x10'),'Sms',_0x283b('0x11'),_0x283b('0x12')];return Promise[_0x283b('0x13')]()[_0x283b('0x4')](function(){var _0x5de67f=_['map'](_0x1f4eb0,function(_0x576783){return getQueuesByChannel(_0x9648d1,_0x576783);});return Promise[_0x283b('0x14')](_0x5de67f);})[_0x283b('0x8')](function(_0x513eee){throw _0x513eee;});}}});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index 6065fe6..1e03036 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 _0x6c13=['jayson/promise','http','redis','defaults','socket.io-emitter','then','info','Team,\x20%s,\x20%s','request\x20sent','Team,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6c13,0x12f));var _0x36c1=function(_0x5a529b,_0x555ba9){_0x5a529b=_0x5a529b-0x0;var _0x3a1ab5=_0x6c13[_0x5a529b];return _0x3a1ab5;};'use strict';var _=require(_0x36c1('0x0'));var util=require(_0x36c1('0x1'));var moment=require(_0x36c1('0x2'));var BPromise=require(_0x36c1('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x36c1('0x4'));var db=require(_0x36c1('0x5'))['db'];var utils=require(_0x36c1('0x6'));var logger=require('../../config/logger')(_0x36c1('0x7'));var config=require(_0x36c1('0x8'));var jayson=require(_0x36c1('0x9'));var client=jayson['client'][_0x36c1('0xa')]({'port':0x232a});config[_0x36c1('0xb')]=_[_0x36c1('0xc')](config[_0x36c1('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x36c1('0xd'))(new Redis(config['redis']));require('./team.socket')['register'](socket);function respondWithRpcPromise(_0x561fd7,_0x484f32,_0x1841ff){return new BPromise(function(_0x5427fa,_0xa05945){return client['request'](_0x561fd7,_0x1841ff)[_0x36c1('0xe')](function(_0x2badc9){logger[_0x36c1('0xf')](_0x36c1('0x10'),_0x484f32,_0x36c1('0x11'));logger['debug'](_0x36c1('0x12'),_0x484f32,_0x36c1('0x11'),JSON[_0x36c1('0x13')](_0x2badc9));if(_0x2badc9[_0x36c1('0x14')]){if(_0x2badc9[_0x36c1('0x14')][_0x36c1('0x15')]===0x1f4){logger[_0x36c1('0x14')]('Team,\x20%s,\x20%s',_0x484f32,_0x2badc9[_0x36c1('0x14')]['message']);return _0xa05945(_0x2badc9[_0x36c1('0x14')][_0x36c1('0x16')]);}logger[_0x36c1('0x14')](_0x36c1('0x10'),_0x484f32,_0x2badc9[_0x36c1('0x14')][_0x36c1('0x16')]);return _0x5427fa(_0x2badc9[_0x36c1('0x14')][_0x36c1('0x16')]);}else{logger[_0x36c1('0xf')](_0x36c1('0x10'),_0x484f32,_0x36c1('0x11'));_0x5427fa(_0x2badc9[_0x36c1('0x17')]['message']);}})['catch'](function(_0x1f7cab){logger[_0x36c1('0x14')](_0x36c1('0x10'),_0x484f32,_0x1f7cab);_0xa05945(_0x1f7cab);});});} \ No newline at end of file +var _0x09e6=['code','Team,\x20%s,\x20%s','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','defaults','./team.socket','register','then','info','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x19dd7a,_0x51de21){var _0x3feb6a=function(_0x4a3c84){while(--_0x4a3c84){_0x19dd7a['push'](_0x19dd7a['shift']());}};_0x3feb6a(++_0x51de21);}(_0x09e6,0xba));var _0x609e=function(_0x3a2c81,_0x356717){_0x3a2c81=_0x3a2c81-0x0;var _0x80c26c=_0x09e6[_0x3a2c81];return _0x80c26c;};'use strict';var _=require(_0x609e('0x0'));var util=require(_0x609e('0x1'));var moment=require(_0x609e('0x2'));var BPromise=require('bluebird');var rs=require(_0x609e('0x3'));var fs=require('fs');var Redis=require(_0x609e('0x4'));var db=require(_0x609e('0x5'))['db'];var utils=require(_0x609e('0x6'));var logger=require(_0x609e('0x7'))(_0x609e('0x8'));var config=require('../../config/environment');var jayson=require(_0x609e('0x9'));var client=jayson[_0x609e('0xa')]['http']({'port':0x232a});config[_0x609e('0xb')]=_[_0x609e('0xc')](config[_0x609e('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x609e('0xd'))[_0x609e('0xe')](socket);function respondWithRpcPromise(_0x1b88dd,_0x5ee138,_0xa7c101){return new BPromise(function(_0x1c5f89,_0x5badac){return client['request'](_0x1b88dd,_0xa7c101)[_0x609e('0xf')](function(_0xa1177f){logger[_0x609e('0x10')]('Team,\x20%s,\x20%s',_0x5ee138,_0x609e('0x11'));logger[_0x609e('0x12')](_0x609e('0x13'),_0x5ee138,_0x609e('0x11'),JSON[_0x609e('0x14')](_0xa1177f));if(_0xa1177f['error']){if(_0xa1177f[_0x609e('0x15')][_0x609e('0x16')]===0x1f4){logger[_0x609e('0x15')](_0x609e('0x17'),_0x5ee138,_0xa1177f[_0x609e('0x15')]['message']);return _0x5badac(_0xa1177f[_0x609e('0x15')][_0x609e('0x18')]);}logger[_0x609e('0x15')](_0x609e('0x17'),_0x5ee138,_0xa1177f[_0x609e('0x15')][_0x609e('0x18')]);return _0x1c5f89(_0xa1177f[_0x609e('0x15')]['message']);}else{logger[_0x609e('0x10')]('Team,\x20%s,\x20%s',_0x5ee138,_0x609e('0x11'));_0x1c5f89(_0xa1177f['result'][_0x609e('0x18')]);}})[_0x609e('0x19')](function(_0x4e3a47){logger[_0x609e('0x15')](_0x609e('0x17'),_0x5ee138,_0x4e3a47);_0x5badac(_0x4e3a47);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index bfb7242..f6bce5a 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 _0x76d2=['./team.events','save','remove','emit','removeListener','register','length','team:'];(function(_0x5293b4,_0x5a07e7){var _0x1b71a7=function(_0x5d84e2){while(--_0x5d84e2){_0x5293b4['push'](_0x5293b4['shift']());}};_0x1b71a7(++_0x5a07e7);}(_0x76d2,0xf8));var _0x276d=function(_0x5490c5,_0x4f90cb){_0x5490c5=_0x5490c5-0x0;var _0x3ff2e7=_0x76d2[_0x5490c5];return _0x3ff2e7;};'use strict';var TeamEvents=require(_0x276d('0x0'));var events=[_0x276d('0x1'),_0x276d('0x2'),'update'];function createListener(_0x1d0b17,_0x125834){return function(_0x2d4d90){_0x125834[_0x276d('0x3')](_0x1d0b17,_0x2d4d90);};}function removeListener(_0x57422a,_0x5f21ff){return function(){TeamEvents[_0x276d('0x4')](_0x57422a,_0x5f21ff);};}exports[_0x276d('0x5')]=function(_0x27729d){for(var _0x1904bf=0x0,_0x138f9f=events[_0x276d('0x6')];_0x1904bf<_0x138f9f;_0x1904bf++){var _0x357d9a=events[_0x1904bf];var _0x233a6c=createListener(_0x276d('0x7')+_0x357d9a,_0x27729d);TeamEvents['on'](_0x357d9a,_0x233a6c);}}; \ No newline at end of file +var _0xebb1=['save','remove','update','emit','removeListener','register','team:'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0xebb1,0x1e3));var _0x1ebb=function(_0x375662,_0x2bdd94){_0x375662=_0x375662-0x0;var _0x136ffa=_0xebb1[_0x375662];return _0x136ffa;};'use strict';var TeamEvents=require('./team.events');var events=[_0x1ebb('0x0'),_0x1ebb('0x1'),_0x1ebb('0x2')];function createListener(_0x2db068,_0x3f5e50){return function(_0x19735f){_0x3f5e50[_0x1ebb('0x3')](_0x2db068,_0x19735f);};}function removeListener(_0x10a84c,_0x146501){return function(){TeamEvents[_0x1ebb('0x4')](_0x10a84c,_0x146501);};}exports[_0x1ebb('0x5')]=function(_0x58d76b){for(var _0x3628f2=0x0,_0x2d3115=events['length'];_0x3628f2<_0x2d3115;_0x3628f2++){var _0x5f4f64=events[_0x3628f2];var _0x5da402=createListener(_0x1ebb('0x6')+_0x5f4f64,_0x58d76b);TeamEvents['on'](_0x5f4f64,_0x5da402);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index cf0a52c..6d682cd 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 _0x43b1=['exports','INTEGER','sequelize'];(function(_0x283ec9,_0x38e48b){var _0x52d8cd=function(_0xc07c19){while(--_0xc07c19){_0x283ec9['push'](_0x283ec9['shift']());}};_0x52d8cd(++_0x38e48b);}(_0x43b1,0x7d));var _0x143b=function(_0xe590ca,_0x3eed96){_0xe590ca=_0xe590ca-0x0;var _0x124882=_0x43b1[_0xe590ca];return _0x124882;};'use strict';var Sequelize=require(_0x143b('0x0'));module[_0x143b('0x1')]={'TeamId':{'type':Sequelize[_0x143b('0x2')]},'VoicePrefixId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x9000=['sequelize','exports','INTEGER'];(function(_0x238d90,_0x55ab60){var _0x46388a=function(_0x1ea450){while(--_0x1ea450){_0x238d90['push'](_0x238d90['shift']());}};_0x46388a(++_0x55ab60);}(_0x9000,0x19e));var _0x0900=function(_0xffdd08,_0x5cfdbc){_0xffdd08=_0xffdd08-0x0;var _0x2cb77f=_0x9000[_0xffdd08];return _0x2cb77f;};'use strict';var Sequelize=require(_0x0900('0x0'));module[_0x0900('0x1')]={'TeamId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0x0900('0x2')]}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index c10a5c0..e23da88 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 _0xd983=['util','../../config/logger','api','moment','path','rimraf','../../config/environment','./teamVoicePrefix.attributes','exports','TeamVoicePrefix','team_has_voice_prefixes','lodash'];(function(_0xb7acd4,_0x31ae1){var _0x1de12b=function(_0x14ad9d){while(--_0x14ad9d){_0xb7acd4['push'](_0xb7acd4['shift']());}};_0x1de12b(++_0x31ae1);}(_0xd983,0x1df));var _0x3d98=function(_0x26eea8,_0x5ae093){_0x26eea8=_0x26eea8-0x0;var _0x4c2b83=_0xd983[_0x26eea8];return _0x4c2b83;};'use strict';var _=require(_0x3d98('0x0'));var util=require(_0x3d98('0x1'));var logger=require(_0x3d98('0x2'))(_0x3d98('0x3'));var moment=require(_0x3d98('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3d98('0x5'));var rimraf=require(_0x3d98('0x6'));var config=require(_0x3d98('0x7'));var attributes=require(_0x3d98('0x8'));module[_0x3d98('0x9')]=function(_0x3e32c6,_0x394587){return _0x3e32c6['define'](_0x3d98('0xa'),attributes,{'tableName':_0x3d98('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbaf0=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./teamVoicePrefix.attributes','exports','define','TeamVoicePrefix','team_has_voice_prefixes','util'];(function(_0x4d16a2,_0x25fad8){var _0x4529f2=function(_0x31db05){while(--_0x31db05){_0x4d16a2['push'](_0x4d16a2['shift']());}};_0x4529f2(++_0x25fad8);}(_0xbaf0,0x12a));var _0x0baf=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xbaf0[_0x6c993a];return _0x27f547;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));module[_0x0baf('0x9')]=function(_0xe4c3c4,_0x335e24){return _0xe4c3c4[_0x0baf('0xa')](_0x0baf('0xb'),attributes,{'tableName':_0x0baf('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index 90c51be..86eab8f 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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x4006b0,_0x22d412){var _0x40c042=function(_0x30c66f){while(--_0x30c66f){_0x4006b0['push'](_0x4006b0['shift']());}};_0x40c042(++_0x22d412);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x374ada,_0x27b3a5){_0x374ada=_0x374ada-0x0;var _0x449ed8=_0xcb91[_0x374ada];return _0x449ed8;};'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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x179b80,_0x440291){var _0x1e8d03=function(_0x466a71){while(--_0x466a71){_0x179b80['push'](_0x179b80['shift']());}};_0x1e8d03(++_0x440291);}(_0x9c44,0x178));var _0x49c4=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0x9c44[_0x17b6e3];return _0x3906f3;};'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/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index a3b07e5..b6138ce 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 _0xcff4=['sequelize','INTEGER'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcff4,0x7a));var _0x4cff=function(_0x1fbc85,_0x1ae169){_0x1fbc85=_0x1fbc85-0x0;var _0xd50bd6=_0xcff4[_0x1fbc85];return _0xd50bd6;};'use strict';var Sequelize=require(_0x4cff('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x4cff('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xa43a=['exports','INTEGER','sequelize'];(function(_0x424a9a,_0x2dd9af){var _0xa7831c=function(_0x512534){while(--_0x512534){_0x424a9a['push'](_0x424a9a['shift']());}};_0xa7831c(++_0x2dd9af);}(_0xa43a,0xe3));var _0xaa43=function(_0x1b2e8f,_0x16b226){_0x1b2e8f=_0x1b2e8f-0x0;var _0x37a55d=_0xa43a[_0x1b2e8f];return _0x37a55d;};'use strict';var Sequelize=require(_0xaa43('0x0'));module[_0xaa43('0x1')]={'penalty':{'type':Sequelize[_0xaa43('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 6a697c5..b0dc0dd 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 _0x8135=['moment','request-promise','path','rimraf','../../config/environment','./teamVoiceQueue.attributes','define','TeamVoiceQueue','team_has_voice_queues','util','../../config/logger','api'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x8135,0x99));var _0x5813=function(_0x3a529a,_0xdce6d5){_0x3a529a=_0x3a529a-0x0;var _0x42483f=_0x8135[_0x3a529a];return _0x42483f;};'use strict';var _=require('lodash');var util=require(_0x5813('0x0'));var logger=require(_0x5813('0x1'))(_0x5813('0x2'));var moment=require(_0x5813('0x3'));var BPromise=require('bluebird');var rp=require(_0x5813('0x4'));var fs=require('fs');var path=require(_0x5813('0x5'));var rimraf=require(_0x5813('0x6'));var config=require(_0x5813('0x7'));var attributes=require(_0x5813('0x8'));module['exports']=function(_0x57ac38,_0x27599d){return _0x57ac38[_0x5813('0x9')](_0x5813('0xa'),attributes,{'tableName':_0x5813('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2e35=['exports','team_has_voice_queues','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./teamVoiceQueue.attributes'];(function(_0x45b29a,_0x2e9828){var _0x1e81c5=function(_0x30770c){while(--_0x30770c){_0x45b29a['push'](_0x45b29a['shift']());}};_0x1e81c5(++_0x2e9828);}(_0x2e35,0x1d0));var _0x52e3=function(_0x395c57,_0x1b6509){_0x395c57=_0x395c57-0x0;var _0x3008b7=_0x2e35[_0x395c57];return _0x3008b7;};'use strict';var _=require(_0x52e3('0x0'));var util=require(_0x52e3('0x1'));var logger=require(_0x52e3('0x2'))('api');var moment=require(_0x52e3('0x3'));var BPromise=require(_0x52e3('0x4'));var rp=require(_0x52e3('0x5'));var fs=require('fs');var path=require(_0x52e3('0x6'));var rimraf=require('rimraf');var config=require(_0x52e3('0x7'));var attributes=require(_0x52e3('0x8'));module[_0x52e3('0x9')]=function(_0x20d1bc,_0x5f117a){return _0x20d1bc['define']('TeamVoiceQueue',attributes,{'tableName':_0x52e3('0xa'),'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 60d2a5d..a947e6e 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 _0x53d1=['../../config/environment','jayson/promise','http','request','then','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x1b8b56,_0x14d6ab){var _0x27e26b=function(_0x35f262){while(--_0x35f262){_0x1b8b56['push'](_0x1b8b56['shift']());}};_0x27e26b(++_0x14d6ab);}(_0x53d1,0x174));var _0x153d=function(_0x5c3979,_0xd98781){_0x5c3979=_0x5c3979-0x0;var _0x427239=_0x53d1[_0x5c3979];return _0x427239;};'use strict';var _=require(_0x153d('0x0'));var util=require(_0x153d('0x1'));var moment=require('moment');var BPromise=require(_0x153d('0x2'));var rs=require(_0x153d('0x3'));var fs=require('fs');var Redis=require(_0x153d('0x4'));var db=require(_0x153d('0x5'))['db'];var utils=require(_0x153d('0x6'));var logger=require('../../config/logger')(_0x153d('0x7'));var config=require(_0x153d('0x8'));var jayson=require(_0x153d('0x9'));var client=jayson['client'][_0x153d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1c91b7,_0x1e4c6a,_0x50c344){return new BPromise(function(_0x35667d,_0x502fb7){return client[_0x153d('0xb')](_0x1c91b7,_0x50c344)[_0x153d('0xc')](function(_0x5de3d6){logger[_0x153d('0xd')](_0x153d('0xe'),_0x1e4c6a,_0x153d('0xf'));logger['debug'](_0x153d('0x10'),_0x1e4c6a,_0x153d('0xf'),JSON[_0x153d('0x11')](_0x5de3d6));if(_0x5de3d6[_0x153d('0x12')]){if(_0x5de3d6['error']['code']===0x1f4){logger['error'](_0x153d('0xe'),_0x1e4c6a,_0x5de3d6[_0x153d('0x12')][_0x153d('0x13')]);return _0x502fb7(_0x5de3d6[_0x153d('0x12')][_0x153d('0x13')]);}logger[_0x153d('0x12')]('TeamVoiceQueue,\x20%s,\x20%s',_0x1e4c6a,_0x5de3d6['error'][_0x153d('0x13')]);return _0x35667d(_0x5de3d6[_0x153d('0x12')][_0x153d('0x13')]);}else{logger[_0x153d('0xd')](_0x153d('0xe'),_0x1e4c6a,_0x153d('0xf'));_0x35667d(_0x5de3d6['result'][_0x153d('0x13')]);}})['catch'](function(_0x2f7871){logger[_0x153d('0x12')](_0x153d('0xe'),_0x1e4c6a,_0x2f7871);_0x502fb7(_0x2f7871);});});} \ No newline at end of file +var _0xb7dc=['TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x4d8764,_0xd13d7b){var _0x4e0b49=function(_0x56126a){while(--_0x56126a){_0x4d8764['push'](_0x4d8764['shift']());}};_0x4e0b49(++_0xd13d7b);}(_0xb7dc,0xf9));var _0xcb7d=function(_0x445073,_0x4e00d2){_0x445073=_0x445073-0x0;var _0x46f81f=_0xb7dc[_0x445073];return _0x46f81f;};'use strict';var _=require(_0xcb7d('0x0'));var util=require(_0xcb7d('0x1'));var moment=require(_0xcb7d('0x2'));var BPromise=require(_0xcb7d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xcb7d('0x4'));var logger=require(_0xcb7d('0x5'))(_0xcb7d('0x6'));var config=require(_0xcb7d('0x7'));var jayson=require(_0xcb7d('0x8'));var client=jayson[_0xcb7d('0x9')][_0xcb7d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x193716,_0x55030f,_0x4e8ed5){return new BPromise(function(_0x51b16e,_0x5a54be){return client['request'](_0x193716,_0x4e8ed5)[_0xcb7d('0xb')](function(_0x20d7c8){logger['info'](_0xcb7d('0xc'),_0x55030f,_0xcb7d('0xd'));logger[_0xcb7d('0xe')](_0xcb7d('0xf'),_0x55030f,'request\x20sent',JSON[_0xcb7d('0x10')](_0x20d7c8));if(_0x20d7c8[_0xcb7d('0x11')]){if(_0x20d7c8[_0xcb7d('0x11')]['code']===0x1f4){logger[_0xcb7d('0x11')](_0xcb7d('0xc'),_0x55030f,_0x20d7c8['error']['message']);return _0x5a54be(_0x20d7c8[_0xcb7d('0x11')][_0xcb7d('0x12')]);}logger[_0xcb7d('0x11')](_0xcb7d('0xc'),_0x55030f,_0x20d7c8[_0xcb7d('0x11')][_0xcb7d('0x12')]);return _0x51b16e(_0x20d7c8['error'][_0xcb7d('0x12')]);}else{logger[_0xcb7d('0x13')](_0xcb7d('0xc'),_0x55030f,'request\x20sent');_0x51b16e(_0x20d7c8[_0xcb7d('0x14')]['message']);}})[_0xcb7d('0x15')](function(_0x166d1e){logger['error'](_0xcb7d('0xc'),_0x55030f,_0x166d1e);_0x5a54be(_0x166d1e);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index b3d2956..10ce145 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 _0x3c32=['get','isAuthenticated','index','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','./template.controller'];(function(_0x134af7,_0x4e2960){var _0x28ab74=function(_0x57a661){while(--_0x57a661){_0x134af7['push'](_0x134af7['shift']());}};_0x28ab74(++_0x4e2960);}(_0x3c32,0x161));var _0x23c3=function(_0x50e309,_0x37deb6){_0x50e309=_0x50e309-0x0;var _0x43d01d=_0x3c32[_0x50e309];return _0x43d01d;};'use strict';var multer=require(_0x23c3('0x0'));var util=require(_0x23c3('0x1'));var path=require(_0x23c3('0x2'));var timeout=require('connect-timeout');var express=require(_0x23c3('0x3'));var router=express[_0x23c3('0x4')]();var fs_extra=require(_0x23c3('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x23c3('0x6'));var config=require('../../config/environment');var controller=require(_0x23c3('0x7'));router[_0x23c3('0x8')]('/',auth[_0x23c3('0x9')](),controller[_0x23c3('0xa')]);router[_0x23c3('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x23c3('0xb')]('/',auth[_0x23c3('0x9')](),controller[_0x23c3('0xc')]);router[_0x23c3('0xd')](_0x23c3('0xe'),auth[_0x23c3('0x9')](),controller[_0x23c3('0xf')]);router[_0x23c3('0x10')](_0x23c3('0xe'),auth[_0x23c3('0x9')](),controller[_0x23c3('0x11')]);module[_0x23c3('0x12')]=router; \ No newline at end of file +var _0x3cd0=['../../config/environment','get','isAuthenticated','index','/:id','show','create','put','update','delete','destroy','exports','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x125ff8,_0x41925f){var _0x2d9ef=function(_0x4ef34c){while(--_0x4ef34c){_0x125ff8['push'](_0x125ff8['shift']());}};_0x2d9ef(++_0x41925f);}(_0x3cd0,0x8a));var _0x03cd=function(_0x23c73d,_0x357b21){_0x23c73d=_0x23c73d-0x0;var _0x36ba47=_0x3cd0[_0x23c73d];return _0x36ba47;};'use strict';var multer=require(_0x03cd('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x03cd('0x1'));var express=require('express');var router=express[_0x03cd('0x2')]();var fs_extra=require(_0x03cd('0x3'));var auth=require(_0x03cd('0x4'));var interaction=require(_0x03cd('0x5'));var config=require(_0x03cd('0x6'));var controller=require('./template.controller');router[_0x03cd('0x7')]('/',auth[_0x03cd('0x8')](),controller[_0x03cd('0x9')]);router[_0x03cd('0x7')](_0x03cd('0xa'),auth['isAuthenticated'](),controller[_0x03cd('0xb')]);router['post']('/',auth[_0x03cd('0x8')](),controller[_0x03cd('0xc')]);router[_0x03cd('0xd')](_0x03cd('0xa'),auth['isAuthenticated'](),controller[_0x03cd('0xe')]);router[_0x03cd('0xf')](_0x03cd('0xa'),auth[_0x03cd('0x8')](),controller[_0x03cd('0x10')]);module[_0x03cd('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 c846460..bd7742c 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 _0x6c9c=['sequelize','exports','STRING','TEXT'];(function(_0x379fd8,_0x1a8425){var _0x4b15cb=function(_0x4fcb51){while(--_0x4fcb51){_0x379fd8['push'](_0x379fd8['shift']());}};_0x4b15cb(++_0x1a8425);}(_0x6c9c,0xf4));var _0xc6c9=function(_0x277c7f,_0x26c59f){_0x277c7f=_0x277c7f-0x0;var _0xe124a=_0x6c9c[_0x277c7f];return _0xe124a;};'use strict';var Sequelize=require(_0xc6c9('0x0'));module[_0xc6c9('0x1')]={'name':{'type':Sequelize[_0xc6c9('0x2')]},'description':{'type':Sequelize[_0xc6c9('0x2')]},'html':{'type':Sequelize[_0xc6c9('0x3')]}}; \ No newline at end of file +var _0x8cb5=['STRING','TEXT','exports'];(function(_0x79da9f,_0x54551a){var _0x402abd=function(_0x1e560a){while(--_0x1e560a){_0x79da9f['push'](_0x79da9f['shift']());}};_0x402abd(++_0x54551a);}(_0x8cb5,0x170));var _0x58cb=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x8cb5[_0x19e35c];return _0x3e1fe8;};'use strict';var Sequelize=require('sequelize');module[_0x58cb('0x0')]={'name':{'type':Sequelize[_0x58cb('0x1')]},'description':{'type':Sequelize[_0x58cb('0x1')]},'html':{'type':Sequelize[_0x58cb('0x2')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index afb047b..a1e053d 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 _0x1bb0=['map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','Template','includeAll','findAll','rows','catch','show','params','find','create','body','user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','count','offset','limit','apply','reject','save','then','destroy','get','Templates','UserProfileResource','error','stack','name','send','index'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x1bb0,0x160));var _0x01bb=function(_0x40f703,_0x39fdcd){_0x40f703=_0x40f703-0x0;var _0x35db9d=_0x1bb0[_0x40f703];return _0x35db9d;};'use strict';var emlformat=require(_0x01bb('0x0'));var rimraf=require(_0x01bb('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x01bb('0x2'));var moment=require(_0x01bb('0x3'));var BPromise=require(_0x01bb('0x4'));var Mustache=require(_0x01bb('0x5'));var util=require(_0x01bb('0x6'));var path=require('path');var sox=require(_0x01bb('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x01bb('0x8'));var _=require(_0x01bb('0x9'));var squel=require(_0x01bb('0xa'));var crypto=require(_0x01bb('0xb'));var jsforce=require(_0x01bb('0xc'));var deskjs=require(_0x01bb('0xd'));var toCsv=require(_0x01bb('0xe'));var querystring=require(_0x01bb('0xf'));var Papa=require(_0x01bb('0x10'));var Redis=require(_0x01bb('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x01bb('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x01bb('0x13'));var utils=require('../../config/utils');var config=require(_0x01bb('0x14'));var licenseUtil=require(_0x01bb('0x15'));var db=require(_0x01bb('0x16'))['db'];function respondWithStatusCode(_0x5625be,_0x6081a1){_0x6081a1=_0x6081a1||0xcc;return function(_0x4e3096){if(_0x4e3096){return _0x5625be[_0x01bb('0x17')](_0x6081a1);}return _0x5625be[_0x01bb('0x18')](_0x6081a1)[_0x01bb('0x19')]();};}function respondWithResult(_0x204d52,_0x4aa80c){_0x4aa80c=_0x4aa80c||0xc8;return function(_0x35643c){if(_0x35643c){return _0x204d52[_0x01bb('0x18')](_0x4aa80c)[_0x01bb('0x1a')](_0x35643c);}};}function respondWithFilteredResult(_0x34f55f,_0x2e050d){return function(_0x23ceaa){if(_0x23ceaa){var _0x33fcf4=typeof _0x2e050d['offset']==='undefined'&&typeof _0x2e050d['limit']==='undefined';var _0x16083e=_0x23ceaa[_0x01bb('0x1b')];var _0x4594bb=_0x33fcf4?0x0:_0x2e050d['offset'];var _0x8d8cdf=_0x33fcf4?_0x23ceaa[_0x01bb('0x1b')]:_0x2e050d[_0x01bb('0x1c')]+_0x2e050d[_0x01bb('0x1d')];var _0x4beef5;if(_0x8d8cdf>=_0x16083e){_0x8d8cdf=_0x16083e;_0x4beef5=0xc8;}else{_0x4beef5=0xce;}_0x34f55f[_0x01bb('0x18')](_0x4beef5);return _0x34f55f['set']('Content-Range',_0x4594bb+'-'+_0x8d8cdf+'/'+_0x16083e)['json'](_0x23ceaa);}return null;};}function patchUpdates(_0x56d7b6){return function(_0x56ef77){try{jsonpatch[_0x01bb('0x1e')](_0x56ef77,_0x56d7b6,!![]);}catch(_0x2f1a9f){return BPromise[_0x01bb('0x1f')](_0x2f1a9f);}return _0x56ef77[_0x01bb('0x20')]();};}function saveUpdates(_0x37b1a0,_0x288957){return function(_0x9d4c0e){if(_0x9d4c0e){return _0x9d4c0e['update'](_0x37b1a0)[_0x01bb('0x21')](function(_0x53ef48){return _0x53ef48;});}return null;};}function removeEntity(_0x1799e4,_0x50ed1a){return function(_0x4484b8){if(_0x4484b8){return _0x4484b8[_0x01bb('0x22')]()[_0x01bb('0x21')](function(){var _0x4015cc=_0x4484b8[_0x01bb('0x23')]({'plain':!![]});var _0x5ea007=_0x01bb('0x24');return db[_0x01bb('0x25')][_0x01bb('0x22')]({'where':{'type':_0x5ea007,'resourceId':_0x4015cc['id']}})[_0x01bb('0x21')](function(){return _0x4484b8;});})[_0x01bb('0x21')](function(){_0x1799e4['status'](0xcc)[_0x01bb('0x19')]();});}};}function handleEntityNotFound(_0x5e176d,_0x3cd019){return function(_0x13e670){if(!_0x13e670){_0x5e176d[_0x01bb('0x17')](0x194);}return _0x13e670;};}function handleError(_0x3e11e2,_0x5aae5e){_0x5aae5e=_0x5aae5e||0x1f4;return function(_0x22426a){logger[_0x01bb('0x26')](_0x22426a[_0x01bb('0x27')]);if(_0x22426a[_0x01bb('0x28')]){delete _0x22426a['name'];}_0x3e11e2[_0x01bb('0x18')](_0x5aae5e)[_0x01bb('0x29')](_0x22426a);};}exports[_0x01bb('0x2a')]=function(_0x3d9fa2,_0x5a6dff){var _0x4d31f4={},_0x2c2a2f={},_0xe9a05e={'count':0x0,'rows':[]};var _0x11454c=_[_0x01bb('0x2b')](db['Template'][_0x01bb('0x2c')],function(_0x5224e3){return{'name':_0x5224e3['fieldName'],'type':_0x5224e3[_0x01bb('0x2d')][_0x01bb('0x2e')]};});_0x2c2a2f[_0x01bb('0x2f')]=_[_0x01bb('0x2b')](_0x11454c,'name');_0x2c2a2f[_0x01bb('0x30')]=_[_0x01bb('0x31')](_0x3d9fa2[_0x01bb('0x30')]);_0x2c2a2f[_0x01bb('0x32')]=_[_0x01bb('0x33')](_0x2c2a2f['model'],_0x2c2a2f['query']);_0x4d31f4[_0x01bb('0x34')]=_['intersection'](_0x2c2a2f[_0x01bb('0x2f')],qs['fields'](_0x3d9fa2['query'][_0x01bb('0x35')]));_0x4d31f4[_0x01bb('0x34')]=_0x4d31f4[_0x01bb('0x34')][_0x01bb('0x36')]?_0x4d31f4[_0x01bb('0x34')]:_0x2c2a2f[_0x01bb('0x2f')];if(!_0x3d9fa2[_0x01bb('0x30')][_0x01bb('0x37')](_0x01bb('0x38'))){_0x4d31f4['limit']=qs['limit'](_0x3d9fa2[_0x01bb('0x30')][_0x01bb('0x1d')]);_0x4d31f4['offset']=qs['offset'](_0x3d9fa2['query']['offset']);}_0x4d31f4[_0x01bb('0x39')]=qs['sort'](_0x3d9fa2[_0x01bb('0x30')][_0x01bb('0x3a')]);_0x4d31f4[_0x01bb('0x3b')]=qs[_0x01bb('0x32')](_['pick'](_0x3d9fa2[_0x01bb('0x30')],_0x2c2a2f[_0x01bb('0x32')]),_0x11454c);if(_0x3d9fa2['query'][_0x01bb('0x3c')]){_0x4d31f4['where']=_[_0x01bb('0x3d')](_0x4d31f4[_0x01bb('0x3b')],{'$or':_[_0x01bb('0x2b')](_0x11454c,function(_0x4cc171){if(_0x4cc171[_0x01bb('0x2d')]!=='VIRTUAL'){var _0x422404={};_0x422404[_0x4cc171[_0x01bb('0x28')]]={'$like':'%'+_0x3d9fa2[_0x01bb('0x30')]['filter']+'%'};return _0x422404;}})});}_0x4d31f4=_[_0x01bb('0x3d')]({},_0x4d31f4,_0x3d9fa2[_0x01bb('0x3e')]);var _0x32b5ec={'where':_0x4d31f4['where']};return db[_0x01bb('0x3f')][_0x01bb('0x1b')](_0x32b5ec)[_0x01bb('0x21')](function(_0x3f11f2){_0xe9a05e['count']=_0x3f11f2;if(_0x3d9fa2['query'][_0x01bb('0x40')]){_0x4d31f4['include']=[{'all':!![]}];}return db[_0x01bb('0x3f')][_0x01bb('0x41')](_0x4d31f4);})[_0x01bb('0x21')](function(_0xd1eec2){_0xe9a05e[_0x01bb('0x42')]=_0xd1eec2;return _0xe9a05e;})[_0x01bb('0x21')](respondWithFilteredResult(_0x5a6dff,_0x4d31f4))[_0x01bb('0x43')](handleError(_0x5a6dff,null));};exports[_0x01bb('0x44')]=function(_0x42de7d,_0x13056e){var _0x522737={'raw':!![],'where':{'id':_0x42de7d[_0x01bb('0x45')]['id']}},_0x45b67a={};_0x45b67a[_0x01bb('0x2f')]=_[_0x01bb('0x31')](db[_0x01bb('0x3f')][_0x01bb('0x2c')]);_0x45b67a['query']=_[_0x01bb('0x31')](_0x42de7d[_0x01bb('0x30')]);_0x45b67a[_0x01bb('0x32')]=_[_0x01bb('0x33')](_0x45b67a[_0x01bb('0x2f')],_0x45b67a[_0x01bb('0x30')]);_0x522737[_0x01bb('0x34')]=_['intersection'](_0x45b67a[_0x01bb('0x2f')],qs['fields'](_0x42de7d[_0x01bb('0x30')]['fields']));_0x522737[_0x01bb('0x34')]=_0x522737[_0x01bb('0x34')][_0x01bb('0x36')]?_0x522737[_0x01bb('0x34')]:_0x45b67a[_0x01bb('0x2f')];if(_0x42de7d['query'][_0x01bb('0x40')]){_0x522737['include']=[{'all':!![]}];}_0x522737=_[_0x01bb('0x3d')]({},_0x522737,_0x42de7d[_0x01bb('0x3e')]);return db[_0x01bb('0x3f')][_0x01bb('0x46')](_0x522737)[_0x01bb('0x21')](handleEntityNotFound(_0x13056e,null))[_0x01bb('0x21')](respondWithResult(_0x13056e,null))['catch'](handleError(_0x13056e,null));};exports[_0x01bb('0x47')]=function(_0x39582e,_0x5edf3c){return db[_0x01bb('0x3f')][_0x01bb('0x47')](_0x39582e[_0x01bb('0x48')],{})[_0x01bb('0x21')](function(_0x47128e){var _0x5bf265=_0x39582e[_0x01bb('0x49')]['get']({'plain':!![]});if(!_0x5bf265)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5bf265[_0x01bb('0x4a')]===_0x01bb('0x49')){var _0x1bfb8c=_0x47128e[_0x01bb('0x23')]({'plain':!![]});var _0x2198d3=_0x01bb('0x24');return db[_0x01bb('0x4b')][_0x01bb('0x46')]({'where':{'name':_0x2198d3,'userProfileId':_0x5bf265['userProfileId']},'raw':!![]})['then'](function(_0x4068c1){if(_0x4068c1&&_0x4068c1[_0x01bb('0x4c')]===0x0){return db[_0x01bb('0x25')]['create']({'name':_0x1bfb8c[_0x01bb('0x28')],'resourceId':_0x1bfb8c['id'],'type':_0x4068c1[_0x01bb('0x28')],'sectionId':_0x4068c1['id']},{})[_0x01bb('0x21')](function(){return _0x47128e;});}else{return _0x47128e;}})[_0x01bb('0x43')](function(_0x128fc1){logger[_0x01bb('0x26')](_0x01bb('0x4d'),_0x128fc1);throw _0x128fc1;});}return _0x47128e;})[_0x01bb('0x21')](respondWithResult(_0x5edf3c,0xc9))['catch'](handleError(_0x5edf3c,null));};exports[_0x01bb('0x4e')]=function(_0x373189,_0x4a0a36){if(_0x373189[_0x01bb('0x48')]['id']){delete _0x373189['body']['id'];}return db[_0x01bb('0x3f')][_0x01bb('0x46')]({'where':{'id':_0x373189[_0x01bb('0x45')]['id']}})['then'](handleEntityNotFound(_0x4a0a36,null))[_0x01bb('0x21')](saveUpdates(_0x373189[_0x01bb('0x48')],null))[_0x01bb('0x21')](respondWithResult(_0x4a0a36,null))[_0x01bb('0x43')](handleError(_0x4a0a36,null));};exports['destroy']=function(_0x25138b,_0x379c58){return db[_0x01bb('0x3f')][_0x01bb('0x46')]({'where':{'id':_0x25138b['params']['id']}})[_0x01bb('0x21')](handleEntityNotFound(_0x379c58,null))[_0x01bb('0x21')](removeEntity(_0x379c58,null))[_0x01bb('0x43')](handleError(_0x379c58,null));}; \ No newline at end of file +var _0xdaaa=['where','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Templates','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','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','UserProfileResource','destroy','sendStatus','error','stack','name','index','map','Template','rawAttributes','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter'];(function(_0x3c77be,_0x3990ea){var _0x6cb6ea=function(_0x1ace5f){while(--_0x1ace5f){_0x3c77be['push'](_0x3c77be['shift']());}};_0x6cb6ea(++_0x3990ea);}(_0xdaaa,0x6e));var _0xadaa=function(_0x25abae,_0x570232){_0x25abae=_0x25abae-0x0;var _0x7e5ead=_0xdaaa[_0x25abae];return _0x7e5ead;};'use strict';var emlformat=require(_0xadaa('0x0'));var rimraf=require(_0xadaa('0x1'));var zipdir=require(_0xadaa('0x2'));var jsonpatch=require(_0xadaa('0x3'));var rp=require(_0xadaa('0x4'));var moment=require(_0xadaa('0x5'));var BPromise=require(_0xadaa('0x6'));var Mustache=require(_0xadaa('0x7'));var util=require(_0xadaa('0x8'));var path=require(_0xadaa('0x9'));var sox=require('sox');var csv=require(_0xadaa('0xa'));var ejs=require(_0xadaa('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xadaa('0xc'));var squel=require(_0xadaa('0xd'));var crypto=require(_0xadaa('0xe'));var jsforce=require(_0xadaa('0xf'));var deskjs=require(_0xadaa('0x10'));var toCsv=require(_0xadaa('0xa'));var querystring=require(_0xadaa('0x11'));var Papa=require(_0xadaa('0x12'));var Redis=require('ioredis');var authService=require(_0xadaa('0x13'));var qs=require(_0xadaa('0x14'));var as=require(_0xadaa('0x15'));var hardwareService=require(_0xadaa('0x16'));var logger=require('../../config/logger')(_0xadaa('0x17'));var utils=require(_0xadaa('0x18'));var config=require(_0xadaa('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xadaa('0x1a'))['db'];function respondWithStatusCode(_0x16d6d0,_0x4a934d){_0x4a934d=_0x4a934d||0xcc;return function(_0x56558c){if(_0x56558c){return _0x16d6d0['sendStatus'](_0x4a934d);}return _0x16d6d0[_0xadaa('0x1b')](_0x4a934d)[_0xadaa('0x1c')]();};}function respondWithResult(_0x2aba5e,_0x3ff264){_0x3ff264=_0x3ff264||0xc8;return function(_0x31b60d){if(_0x31b60d){return _0x2aba5e['status'](_0x3ff264)[_0xadaa('0x1d')](_0x31b60d);}};}function respondWithFilteredResult(_0x2afdb6,_0x80ce1c){return function(_0x102876){if(_0x102876){var _0x30446d=typeof _0x80ce1c[_0xadaa('0x1e')]===_0xadaa('0x1f')&&typeof _0x80ce1c[_0xadaa('0x20')]===_0xadaa('0x1f');var _0x36560d=_0x102876[_0xadaa('0x21')];var _0x36c06c=_0x30446d?0x0:_0x80ce1c[_0xadaa('0x1e')];var _0x11f39f=_0x30446d?_0x102876['count']:_0x80ce1c['offset']+_0x80ce1c[_0xadaa('0x20')];var _0x591848;if(_0x11f39f>=_0x36560d){_0x11f39f=_0x36560d;_0x591848=0xc8;}else{_0x591848=0xce;}_0x2afdb6[_0xadaa('0x1b')](_0x591848);return _0x2afdb6[_0xadaa('0x22')](_0xadaa('0x23'),_0x36c06c+'-'+_0x11f39f+'/'+_0x36560d)[_0xadaa('0x1d')](_0x102876);}return null;};}function patchUpdates(_0x16c8a4){return function(_0x7b0d83){try{jsonpatch[_0xadaa('0x24')](_0x7b0d83,_0x16c8a4,!![]);}catch(_0x55ea61){return BPromise[_0xadaa('0x25')](_0x55ea61);}return _0x7b0d83[_0xadaa('0x26')]();};}function saveUpdates(_0x4e57a7,_0x165622){return function(_0x4bc5a4){if(_0x4bc5a4){return _0x4bc5a4[_0xadaa('0x27')](_0x4e57a7)[_0xadaa('0x28')](function(_0x5927d9){return _0x5927d9;});}return null;};}function removeEntity(_0x2cd6f2,_0x529672){return function(_0x3a244e){if(_0x3a244e){return _0x3a244e['destroy']()[_0xadaa('0x28')](function(){var _0x5431c7=_0x3a244e[_0xadaa('0x29')]({'plain':!![]});var _0x47d095='Templates';return db[_0xadaa('0x2a')][_0xadaa('0x2b')]({'where':{'type':_0x47d095,'resourceId':_0x5431c7['id']}})[_0xadaa('0x28')](function(){return _0x3a244e;});})['then'](function(){_0x2cd6f2[_0xadaa('0x1b')](0xcc)[_0xadaa('0x1c')]();});}};}function handleEntityNotFound(_0x35a7a4,_0x1faf39){return function(_0x1ec801){if(!_0x1ec801){_0x35a7a4[_0xadaa('0x2c')](0x194);}return _0x1ec801;};}function handleError(_0x4557f9,_0x3e329d){_0x3e329d=_0x3e329d||0x1f4;return function(_0x574b67){logger[_0xadaa('0x2d')](_0x574b67[_0xadaa('0x2e')]);if(_0x574b67[_0xadaa('0x2f')]){delete _0x574b67[_0xadaa('0x2f')];}_0x4557f9[_0xadaa('0x1b')](_0x3e329d)['send'](_0x574b67);};}exports[_0xadaa('0x30')]=function(_0x3e6314,_0x18c191){var _0x3cd6ee={},_0x4118bf={},_0x211aa1={'count':0x0,'rows':[]};var _0xd0590d=_[_0xadaa('0x31')](db[_0xadaa('0x32')][_0xadaa('0x33')],function(_0xb332c){return{'name':_0xb332c['fieldName'],'type':_0xb332c['type'][_0xadaa('0x34')]};});_0x4118bf[_0xadaa('0x35')]=_[_0xadaa('0x31')](_0xd0590d,_0xadaa('0x2f'));_0x4118bf[_0xadaa('0x36')]=_['keys'](_0x3e6314['query']);_0x4118bf[_0xadaa('0x37')]=_[_0xadaa('0x38')](_0x4118bf['model'],_0x4118bf['query']);_0x3cd6ee[_0xadaa('0x39')]=_['intersection'](_0x4118bf[_0xadaa('0x35')],qs['fields'](_0x3e6314[_0xadaa('0x36')][_0xadaa('0x3a')]));_0x3cd6ee[_0xadaa('0x39')]=_0x3cd6ee[_0xadaa('0x39')][_0xadaa('0x3b')]?_0x3cd6ee[_0xadaa('0x39')]:_0x4118bf[_0xadaa('0x35')];if(!_0x3e6314[_0xadaa('0x36')][_0xadaa('0x3c')](_0xadaa('0x3d'))){_0x3cd6ee[_0xadaa('0x20')]=qs[_0xadaa('0x20')](_0x3e6314[_0xadaa('0x36')][_0xadaa('0x20')]);_0x3cd6ee[_0xadaa('0x1e')]=qs[_0xadaa('0x1e')](_0x3e6314[_0xadaa('0x36')]['offset']);}_0x3cd6ee[_0xadaa('0x3e')]=qs['sort'](_0x3e6314[_0xadaa('0x36')][_0xadaa('0x3f')]);_0x3cd6ee['where']=qs[_0xadaa('0x37')](_[_0xadaa('0x40')](_0x3e6314[_0xadaa('0x36')],_0x4118bf[_0xadaa('0x37')]),_0xd0590d);if(_0x3e6314['query'][_0xadaa('0x41')]){_0x3cd6ee[_0xadaa('0x42')]=_[_0xadaa('0x43')](_0x3cd6ee[_0xadaa('0x42')],{'$or':_[_0xadaa('0x31')](_0xd0590d,function(_0xb8e631){if(_0xb8e631['type']!=='VIRTUAL'){var _0x51cb0={};_0x51cb0[_0xb8e631['name']]={'$like':'%'+_0x3e6314[_0xadaa('0x36')]['filter']+'%'};return _0x51cb0;}})});}_0x3cd6ee=_[_0xadaa('0x43')]({},_0x3cd6ee,_0x3e6314[_0xadaa('0x44')]);var _0x20a593={'where':_0x3cd6ee[_0xadaa('0x42')]};return db[_0xadaa('0x32')][_0xadaa('0x21')](_0x20a593)[_0xadaa('0x28')](function(_0x55cfed){_0x211aa1[_0xadaa('0x21')]=_0x55cfed;if(_0x3e6314[_0xadaa('0x36')][_0xadaa('0x45')]){_0x3cd6ee[_0xadaa('0x46')]=[{'all':!![]}];}return db['Template'][_0xadaa('0x47')](_0x3cd6ee);})[_0xadaa('0x28')](function(_0x45c4c4){_0x211aa1[_0xadaa('0x48')]=_0x45c4c4;return _0x211aa1;})[_0xadaa('0x28')](respondWithFilteredResult(_0x18c191,_0x3cd6ee))[_0xadaa('0x49')](handleError(_0x18c191,null));};exports[_0xadaa('0x4a')]=function(_0x2bfbe5,_0x203fcc){var _0x33695f={'raw':!![],'where':{'id':_0x2bfbe5[_0xadaa('0x4b')]['id']}},_0x43411a={};_0x43411a[_0xadaa('0x35')]=_[_0xadaa('0x4c')](db[_0xadaa('0x32')][_0xadaa('0x33')]);_0x43411a[_0xadaa('0x36')]=_[_0xadaa('0x4c')](_0x2bfbe5[_0xadaa('0x36')]);_0x43411a[_0xadaa('0x37')]=_[_0xadaa('0x38')](_0x43411a[_0xadaa('0x35')],_0x43411a[_0xadaa('0x36')]);_0x33695f[_0xadaa('0x39')]=_[_0xadaa('0x38')](_0x43411a[_0xadaa('0x35')],qs[_0xadaa('0x3a')](_0x2bfbe5['query'][_0xadaa('0x3a')]));_0x33695f[_0xadaa('0x39')]=_0x33695f[_0xadaa('0x39')]['length']?_0x33695f[_0xadaa('0x39')]:_0x43411a[_0xadaa('0x35')];if(_0x2bfbe5[_0xadaa('0x36')][_0xadaa('0x45')]){_0x33695f['include']=[{'all':!![]}];}_0x33695f=_[_0xadaa('0x43')]({},_0x33695f,_0x2bfbe5[_0xadaa('0x44')]);return db['Template'][_0xadaa('0x4d')](_0x33695f)[_0xadaa('0x28')](handleEntityNotFound(_0x203fcc,null))[_0xadaa('0x28')](respondWithResult(_0x203fcc,null))[_0xadaa('0x49')](handleError(_0x203fcc,null));};exports[_0xadaa('0x4e')]=function(_0x12354c,_0x310821){return db[_0xadaa('0x32')]['create'](_0x12354c[_0xadaa('0x4f')],{})[_0xadaa('0x28')](function(_0x274a50){var _0x541003=_0x12354c[_0xadaa('0x50')]['get']({'plain':!![]});if(!_0x541003)throw new Error(_0xadaa('0x51'));if(_0x541003[_0xadaa('0x52')]===_0xadaa('0x50')){var _0x4bcfbe=_0x274a50[_0xadaa('0x29')]({'plain':!![]});var _0xb51269=_0xadaa('0x53');return db[_0xadaa('0x54')][_0xadaa('0x4d')]({'where':{'name':_0xb51269,'userProfileId':_0x541003[_0xadaa('0x55')]},'raw':!![]})[_0xadaa('0x28')](function(_0x2f2921){if(_0x2f2921&&_0x2f2921[_0xadaa('0x56')]===0x0){return db['UserProfileResource'][_0xadaa('0x4e')]({'name':_0x4bcfbe[_0xadaa('0x2f')],'resourceId':_0x4bcfbe['id'],'type':_0x2f2921[_0xadaa('0x2f')],'sectionId':_0x2f2921['id']},{})[_0xadaa('0x28')](function(){return _0x274a50;});}else{return _0x274a50;}})[_0xadaa('0x49')](function(_0x230808){logger[_0xadaa('0x2d')](_0xadaa('0x57'),_0x230808);throw _0x230808;});}return _0x274a50;})['then'](respondWithResult(_0x310821,0xc9))[_0xadaa('0x49')](handleError(_0x310821,null));};exports[_0xadaa('0x27')]=function(_0x4d33c8,_0x3242fa){if(_0x4d33c8[_0xadaa('0x4f')]['id']){delete _0x4d33c8[_0xadaa('0x4f')]['id'];}return db[_0xadaa('0x32')]['find']({'where':{'id':_0x4d33c8[_0xadaa('0x4b')]['id']}})[_0xadaa('0x28')](handleEntityNotFound(_0x3242fa,null))[_0xadaa('0x28')](saveUpdates(_0x4d33c8[_0xadaa('0x4f')],null))[_0xadaa('0x28')](respondWithResult(_0x3242fa,null))[_0xadaa('0x49')](handleError(_0x3242fa,null));};exports[_0xadaa('0x2b')]=function(_0x2aedaf,_0x526c22){return db[_0xadaa('0x32')][_0xadaa('0x4d')]({'where':{'id':_0x2aedaf[_0xadaa('0x4b')]['id']}})['then'](handleEntityNotFound(_0x526c22,null))[_0xadaa('0x28')](removeEntity(_0x526c22,null))[_0xadaa('0x49')](handleError(_0x526c22,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index 32313a6..274e24b 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 _0xb65e=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./template.attributes','exports','define','Template'];(function(_0x3edcb4,_0x53da60){var _0x51bbca=function(_0x57631b){while(--_0x57631b){_0x3edcb4['push'](_0x3edcb4['shift']());}};_0x51bbca(++_0x53da60);}(_0xb65e,0x17a));var _0xeb65=function(_0x597408,_0x59d3b1){_0x597408=_0x597408-0x0;var _0xa9748b=_0xb65e[_0x597408];return _0xa9748b;};'use strict';var _=require(_0xeb65('0x0'));var util=require(_0xeb65('0x1'));var logger=require(_0xeb65('0x2'))(_0xeb65('0x3'));var moment=require(_0xeb65('0x4'));var BPromise=require(_0xeb65('0x5'));var rp=require(_0xeb65('0x6'));var fs=require('fs');var path=require(_0xeb65('0x7'));var rimraf=require(_0xeb65('0x8'));var config=require(_0xeb65('0x9'));var attributes=require(_0xeb65('0xa'));module[_0xeb65('0xb')]=function(_0xa11688,_0x4198af){return _0xa11688[_0xeb65('0xc')](_0xeb65('0xd'),attributes,{'tableName':'tools_templates','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8219=['rimraf','../../config/environment','exports','define','Template','tools_templates','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3a7435,_0x4fe43d){var _0x1f861e=function(_0x89cadc){while(--_0x89cadc){_0x3a7435['push'](_0x3a7435['shift']());}};_0x1f861e(++_0x4fe43d);}(_0x8219,0x1b6));var _0x9821=function(_0x3c38c7,_0x14dd97){_0x3c38c7=_0x3c38c7-0x0;var _0x4aa4b1=_0x8219[_0x3c38c7];return _0x4aa4b1;};'use strict';var _=require(_0x9821('0x0'));var util=require('util');var logger=require(_0x9821('0x1'))(_0x9821('0x2'));var moment=require(_0x9821('0x3'));var BPromise=require(_0x9821('0x4'));var rp=require(_0x9821('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9821('0x6'));var config=require(_0x9821('0x7'));var attributes=require('./template.attributes');module[_0x9821('0x8')]=function(_0xc2edfe,_0x100ffc){return _0xc2edfe[_0x9821('0x9')](_0x9821('0xa'),attributes,{'tableName':_0x9821('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/template/template.rpc.js b/server/api/template/template.rpc.js index 991313f..3e23366 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 _0x8da8=['where','attributes','limit','include','map','model','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','Template,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','GetTemplate','findAll','options'];(function(_0x40b352,_0x45b570){var _0x3f4f93=function(_0x408804){while(--_0x408804){_0x40b352['push'](_0x40b352['shift']());}};_0x3f4f93(++_0x45b570);}(_0x8da8,0x187));var _0x88da=function(_0xa34bda,_0x34f584){_0xa34bda=_0xa34bda-0x0;var _0x37c970=_0x8da8[_0xa34bda];return _0x37c970;};'use strict';var _=require(_0x88da('0x0'));var util=require(_0x88da('0x1'));var moment=require(_0x88da('0x2'));var BPromise=require(_0x88da('0x3'));var rs=require(_0x88da('0x4'));var fs=require('fs');var Redis=require(_0x88da('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x88da('0x6'));var logger=require(_0x88da('0x7'))(_0x88da('0x8'));var config=require(_0x88da('0x9'));var jayson=require(_0x88da('0xa'));var client=jayson[_0x88da('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x6baa96,_0x33e3be,_0x3de109){return new BPromise(function(_0x3b2868,_0x58a969){return client['request'](_0x6baa96,_0x3de109)[_0x88da('0xc')](function(_0x10db86){logger[_0x88da('0xd')](_0x88da('0xe'),_0x33e3be,_0x88da('0xf'));logger[_0x88da('0x10')]('Template,\x20%s,\x20%s,\x20%s',_0x33e3be,_0x88da('0xf'),JSON[_0x88da('0x11')](_0x10db86));if(_0x10db86['error']){if(_0x10db86[_0x88da('0x12')][_0x88da('0x13')]===0x1f4){logger[_0x88da('0x12')](_0x88da('0xe'),_0x33e3be,_0x10db86['error'][_0x88da('0x14')]);return _0x58a969(_0x10db86['error']['message']);}logger['error'](_0x88da('0xe'),_0x33e3be,_0x10db86[_0x88da('0x12')][_0x88da('0x14')]);return _0x3b2868(_0x10db86[_0x88da('0x12')]['message']);}else{logger[_0x88da('0xd')]('Template,\x20%s,\x20%s',_0x33e3be,'request\x20sent');_0x3b2868(_0x10db86[_0x88da('0x15')][_0x88da('0x14')]);}})['catch'](function(_0x4d9ffd){logger[_0x88da('0x12')](_0x88da('0xe'),_0x33e3be,_0x4d9ffd);_0x58a969(_0x4d9ffd);});});}exports[_0x88da('0x16')]=function(_0x5d1932){var _0x20b272=this;return new Promise(function(_0xa20d60,_0x31891f){return db['Template'][_0x88da('0x17')]({'raw':_0x5d1932[_0x88da('0x18')]?_0x5d1932['options']['raw']===undefined?!![]:![]:!![],'where':_0x5d1932[_0x88da('0x18')]?_0x5d1932[_0x88da('0x18')][_0x88da('0x19')]||null:null,'attributes':_0x5d1932[_0x88da('0x18')]?_0x5d1932['options'][_0x88da('0x1a')]||null:null,'limit':_0x5d1932[_0x88da('0x18')]?_0x5d1932[_0x88da('0x18')][_0x88da('0x1b')]||null:null,'include':_0x5d1932[_0x88da('0x18')]?_0x5d1932[_0x88da('0x18')][_0x88da('0x1c')]?_[_0x88da('0x1d')](_0x5d1932[_0x88da('0x18')]['include'],function(_0x1e7624){return{'model':db[_0x1e7624[_0x88da('0x1e')]],'as':_0x1e7624['as'],'attributes':_0x1e7624[_0x88da('0x1a')],'include':_0x1e7624[_0x88da('0x1c')]?_['map'](_0x1e7624[_0x88da('0x1c')],function(_0x39ad71){return{'model':db[_0x39ad71[_0x88da('0x1e')]],'as':_0x39ad71['as'],'attributes':_0x39ad71[_0x88da('0x1a')],'include':_0x39ad71['include']?_['map'](_0x39ad71[_0x88da('0x1c')],function(_0x4d29b1){return{'model':db[_0x4d29b1[_0x88da('0x1e')]],'as':_0x4d29b1['as'],'attributes':_0x4d29b1[_0x88da('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x88da('0xc')](function(_0x9cb05f){logger[_0x88da('0xd')]('GetTemplate',_0x5d1932);logger[_0x88da('0x10')](_0x88da('0x16'),_0x5d1932,JSON[_0x88da('0x11')](_0x9cb05f));_0xa20d60(_0x9cb05f);})[_0x88da('0x1f')](function(_0x792c52){logger['error'](_0x88da('0x16'),_0x792c52[_0x88da('0x14')],_0x5d1932);_0x31891f(_0x20b272[_0x88da('0x12')](0x1f4,_0x792c52['message']));});});}; \ No newline at end of file +var _0xcade=['request','then','info','Template,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','GetTemplate','findAll','options','raw','attributes','limit','include','model','map','catch','util','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x32e281,_0x3b0bfe){var _0x1d71ae=function(_0x3f6bf7){while(--_0x3f6bf7){_0x32e281['push'](_0x32e281['shift']());}};_0x1d71ae(++_0x3b0bfe);}(_0xcade,0xab));var _0xecad=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcade[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xecad('0x0'));var moment=require('moment');var BPromise=require(_0xecad('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xecad('0x2'))['db'];var utils=require(_0xecad('0x3'));var logger=require('../../config/logger')(_0xecad('0x4'));var config=require(_0xecad('0x5'));var jayson=require(_0xecad('0x6'));var client=jayson[_0xecad('0x7')][_0xecad('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4ea175,_0x2a9c6d,_0x11c219){return new BPromise(function(_0x30a5c7,_0x24570e){return client[_0xecad('0x9')](_0x4ea175,_0x11c219)[_0xecad('0xa')](function(_0x1018c1){logger[_0xecad('0xb')](_0xecad('0xc'),_0x2a9c6d,_0xecad('0xd'));logger[_0xecad('0xe')]('Template,\x20%s,\x20%s,\x20%s',_0x2a9c6d,_0xecad('0xd'),JSON[_0xecad('0xf')](_0x1018c1));if(_0x1018c1[_0xecad('0x10')]){if(_0x1018c1['error'][_0xecad('0x11')]===0x1f4){logger[_0xecad('0x10')]('Template,\x20%s,\x20%s',_0x2a9c6d,_0x1018c1[_0xecad('0x10')][_0xecad('0x12')]);return _0x24570e(_0x1018c1[_0xecad('0x10')][_0xecad('0x12')]);}logger[_0xecad('0x10')](_0xecad('0xc'),_0x2a9c6d,_0x1018c1['error'][_0xecad('0x12')]);return _0x30a5c7(_0x1018c1[_0xecad('0x10')]['message']);}else{logger[_0xecad('0xb')]('Template,\x20%s,\x20%s',_0x2a9c6d,'request\x20sent');_0x30a5c7(_0x1018c1[_0xecad('0x13')][_0xecad('0x12')]);}})['catch'](function(_0x4d3b73){logger[_0xecad('0x10')](_0xecad('0xc'),_0x2a9c6d,_0x4d3b73);_0x24570e(_0x4d3b73);});});}exports[_0xecad('0x14')]=function(_0x5cab86){var _0x3ae5b3=this;return new Promise(function(_0x2794e0,_0x2443fb){return db['Template'][_0xecad('0x15')]({'raw':_0x5cab86[_0xecad('0x16')]?_0x5cab86[_0xecad('0x16')][_0xecad('0x17')]===undefined?!![]:![]:!![],'where':_0x5cab86[_0xecad('0x16')]?_0x5cab86[_0xecad('0x16')]['where']||null:null,'attributes':_0x5cab86[_0xecad('0x16')]?_0x5cab86[_0xecad('0x16')][_0xecad('0x18')]||null:null,'limit':_0x5cab86['options']?_0x5cab86[_0xecad('0x16')][_0xecad('0x19')]||null:null,'include':_0x5cab86[_0xecad('0x16')]?_0x5cab86[_0xecad('0x16')][_0xecad('0x1a')]?_['map'](_0x5cab86[_0xecad('0x16')][_0xecad('0x1a')],function(_0x26c4c5){return{'model':db[_0x26c4c5[_0xecad('0x1b')]],'as':_0x26c4c5['as'],'attributes':_0x26c4c5[_0xecad('0x18')],'include':_0x26c4c5[_0xecad('0x1a')]?_[_0xecad('0x1c')](_0x26c4c5[_0xecad('0x1a')],function(_0x45d306){return{'model':db[_0x45d306['model']],'as':_0x45d306['as'],'attributes':_0x45d306[_0xecad('0x18')],'include':_0x45d306['include']?_[_0xecad('0x1c')](_0x45d306[_0xecad('0x1a')],function(_0x5e1e93){return{'model':db[_0x5e1e93[_0xecad('0x1b')]],'as':_0x5e1e93['as'],'attributes':_0x5e1e93['attributes']};}):[]};}):[]};}):[]:[]})[_0xecad('0xa')](function(_0x92f9db){logger[_0xecad('0xb')](_0xecad('0x14'),_0x5cab86);logger[_0xecad('0xe')](_0xecad('0x14'),_0x5cab86,JSON[_0xecad('0xf')](_0x92f9db));_0x2794e0(_0x92f9db);})[_0xecad('0x1d')](function(_0x58fab8){logger[_0xecad('0x10')]('GetTemplate',_0x58fab8['message'],_0x5cab86);_0x2443fb(_0x3ae5b3['error'](0x1f4,_0x58fab8[_0xecad('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index 9b954a3..aa71060 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 _0x9e3a=['isAuthenticated','getAllConditions','getAnyConditions','/:id/actions','getActions','post','addAllCondition','/:id/any_conditions','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./trigger.controller','get','/:id','show','/:id/all_conditions'];(function(_0x130e4c,_0x43c577){var _0xd97ab7=function(_0xd9776e){while(--_0xd9776e){_0x130e4c['push'](_0x130e4c['shift']());}};_0xd97ab7(++_0x43c577);}(_0x9e3a,0x179));var _0xa9e3=function(_0x2877a2,_0xb6e49c){_0x2877a2=_0x2877a2-0x0;var _0x1eed6f=_0x9e3a[_0x2877a2];return _0x1eed6f;};'use strict';var multer=require(_0xa9e3('0x0'));var util=require(_0xa9e3('0x1'));var path=require(_0xa9e3('0x2'));var timeout=require(_0xa9e3('0x3'));var express=require(_0xa9e3('0x4'));var router=express[_0xa9e3('0x5')]();var fs_extra=require(_0xa9e3('0x6'));var auth=require(_0xa9e3('0x7'));var interaction=require(_0xa9e3('0x8'));var config=require(_0xa9e3('0x9'));var controller=require(_0xa9e3('0xa'));router[_0xa9e3('0xb')]('/',auth['isAuthenticated'](),controller['index']);router[_0xa9e3('0xb')](_0xa9e3('0xc'),auth['isAuthenticated'](),controller[_0xa9e3('0xd')]);router['get'](_0xa9e3('0xe'),auth[_0xa9e3('0xf')](),controller[_0xa9e3('0x10')]);router['get']('/:id/any_conditions',auth[_0xa9e3('0xf')](),controller[_0xa9e3('0x11')]);router[_0xa9e3('0xb')](_0xa9e3('0x12'),auth[_0xa9e3('0xf')](),controller[_0xa9e3('0x13')]);router[_0xa9e3('0x14')]('/',auth[_0xa9e3('0xf')](),controller['create']);router[_0xa9e3('0x14')](_0xa9e3('0xe'),auth['isAuthenticated'](),controller[_0xa9e3('0x15')]);router[_0xa9e3('0x14')](_0xa9e3('0x16'),auth[_0xa9e3('0xf')](),controller['addAnyCondition']);router['post'](_0xa9e3('0x12'),auth['isAuthenticated'](),controller['addAction']);router[_0xa9e3('0x17')]('/:id',auth[_0xa9e3('0xf')](),controller[_0xa9e3('0x18')]);router[_0xa9e3('0x19')]('/:id',auth['isAuthenticated'](),controller[_0xa9e3('0x1a')]);module[_0xa9e3('0x1b')]=router; \ No newline at end of file +var _0x58b6=['get','/:id/all_conditions','getAllConditions','/:id/any_conditions','getAnyConditions','/:id/actions','getActions','post','create','addAnyCondition','addAction','put','update','destroy','exports','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./trigger.controller','index','/:id','isAuthenticated','show'];(function(_0x49f8c2,_0x5166b7){var _0x3e63ec=function(_0x575c26){while(--_0x575c26){_0x49f8c2['push'](_0x49f8c2['shift']());}};_0x3e63ec(++_0x5166b7);}(_0x58b6,0x138));var _0x658b=function(_0x6f12cd,_0x1bb44d){_0x6f12cd=_0x6f12cd-0x0;var _0x4c608f=_0x58b6[_0x6f12cd];return _0x4c608f;};'use strict';var multer=require(_0x658b('0x0'));var util=require(_0x658b('0x1'));var path=require(_0x658b('0x2'));var timeout=require(_0x658b('0x3'));var express=require(_0x658b('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x658b('0x5'));var config=require(_0x658b('0x6'));var controller=require(_0x658b('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x658b('0x8')]);router['get'](_0x658b('0x9'),auth[_0x658b('0xa')](),controller[_0x658b('0xb')]);router[_0x658b('0xc')](_0x658b('0xd'),auth['isAuthenticated'](),controller[_0x658b('0xe')]);router['get'](_0x658b('0xf'),auth[_0x658b('0xa')](),controller[_0x658b('0x10')]);router[_0x658b('0xc')](_0x658b('0x11'),auth['isAuthenticated'](),controller[_0x658b('0x12')]);router[_0x658b('0x13')]('/',auth[_0x658b('0xa')](),controller[_0x658b('0x14')]);router[_0x658b('0x13')]('/:id/all_conditions',auth[_0x658b('0xa')](),controller['addAllCondition']);router[_0x658b('0x13')](_0x658b('0xf'),auth['isAuthenticated'](),controller[_0x658b('0x15')]);router[_0x658b('0x13')](_0x658b('0x11'),auth[_0x658b('0xa')](),controller[_0x658b('0x16')]);router[_0x658b('0x17')](_0x658b('0x9'),auth[_0x658b('0xa')](),controller[_0x658b('0x18')]);router['delete'](_0x658b('0x9'),auth[_0x658b('0xa')](),controller[_0x658b('0x19')]);module[_0x658b('0x1a')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index 7f75e2f..5b1fb37 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 _0x68ce=['exports','STRING'];(function(_0x8eae74,_0x2832b9){var _0x370105=function(_0x2552ca){while(--_0x2552ca){_0x8eae74['push'](_0x8eae74['shift']());}};_0x370105(++_0x2832b9);}(_0x68ce,0x124));var _0xe68c=function(_0x527733,_0x16051c){_0x527733=_0x527733-0x0;var _0x5400ba=_0x68ce[_0x527733];return _0x5400ba;};'use strict';var Sequelize=require('sequelize');module[_0xe68c('0x0')]={'name':{'type':Sequelize[_0xe68c('0x1')]},'channel':{'type':Sequelize[_0xe68c('0x1')]},'description':{'type':Sequelize[_0xe68c('0x1')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x4726=['sequelize','exports','STRING'];(function(_0x2eb8a8,_0x4669ff){var _0x7aada0=function(_0x20783e){while(--_0x20783e){_0x2eb8a8['push'](_0x2eb8a8['shift']());}};_0x7aada0(++_0x4669ff);}(_0x4726,0xf3));var _0x6472=function(_0x62e15e,_0x4eccc4){_0x62e15e=_0x62e15e-0x0;var _0x56a9ef=_0x4726[_0x62e15e];return _0x56a9ef;};'use strict';var Sequelize=require(_0x6472('0x0'));module[_0x6472('0x1')]={'name':{'type':Sequelize[_0x6472('0x2')]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x6472('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index 31823e6..72d7064 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 _0x579c=['json','apply','save','update','then','destroy','get','Triggers','UserProfileResource','sendStatus','stack','name','index','map','Trigger','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addAllCondition','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','getAllConditions','findOne','getAnyConditions','addAction','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','end','status','offset','limit','count','set'];(function(_0x2859bc,_0x2a4a74){var _0xaa4908=function(_0x2e34fc){while(--_0x2e34fc){_0x2859bc['push'](_0x2859bc['shift']());}};_0xaa4908(++_0x2a4a74);}(_0x579c,0x9b));var _0xc579=function(_0xa9e57c,_0x1e2e24){_0xa9e57c=_0xa9e57c-0x0;var _0x133fb4=_0x579c[_0xa9e57c];return _0x133fb4;};'use strict';var emlformat=require(_0xc579('0x0'));var rimraf=require(_0xc579('0x1'));var zipdir=require(_0xc579('0x2'));var jsonpatch=require(_0xc579('0x3'));var rp=require('request-promise');var moment=require(_0xc579('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc579('0x5'));var util=require(_0xc579('0x6'));var path=require(_0xc579('0x7'));var sox=require('sox');var csv=require(_0xc579('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc579('0x9'));var _=require(_0xc579('0xa'));var squel=require(_0xc579('0xb'));var crypto=require(_0xc579('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xc579('0xd'));var toCsv=require(_0xc579('0x8'));var querystring=require(_0xc579('0xe'));var Papa=require(_0xc579('0xf'));var Redis=require(_0xc579('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xc579('0x11'));var hardwareService=require(_0xc579('0x12'));var logger=require('../../config/logger')(_0xc579('0x13'));var utils=require(_0xc579('0x14'));var config=require(_0xc579('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xc579('0x16'))['db'];function respondWithStatusCode(_0x4cfb53,_0x2b5a4c){_0x2b5a4c=_0x2b5a4c||0xcc;return function(_0x375f77){if(_0x375f77){return _0x4cfb53['sendStatus'](_0x2b5a4c);}return _0x4cfb53['status'](_0x2b5a4c)[_0xc579('0x17')]();};}function respondWithResult(_0x39cb05,_0x364e4a){_0x364e4a=_0x364e4a||0xc8;return function(_0x53ac7f){if(_0x53ac7f){return _0x39cb05[_0xc579('0x18')](_0x364e4a)['json'](_0x53ac7f);}};}function respondWithFilteredResult(_0x310975,_0x52882c){return function(_0x1b66fe){if(_0x1b66fe){var _0x482517=typeof _0x52882c[_0xc579('0x19')]==='undefined'&&typeof _0x52882c[_0xc579('0x1a')]==='undefined';var _0x242d62=_0x1b66fe[_0xc579('0x1b')];var _0x5153a1=_0x482517?0x0:_0x52882c[_0xc579('0x19')];var _0x38c1d9=_0x482517?_0x1b66fe[_0xc579('0x1b')]:_0x52882c[_0xc579('0x19')]+_0x52882c['limit'];var _0x14e604;if(_0x38c1d9>=_0x242d62){_0x38c1d9=_0x242d62;_0x14e604=0xc8;}else{_0x14e604=0xce;}_0x310975[_0xc579('0x18')](_0x14e604);return _0x310975[_0xc579('0x1c')]('Content-Range',_0x5153a1+'-'+_0x38c1d9+'/'+_0x242d62)[_0xc579('0x1d')](_0x1b66fe);}return null;};}function patchUpdates(_0x2fc56e){return function(_0x500564){try{jsonpatch[_0xc579('0x1e')](_0x500564,_0x2fc56e,!![]);}catch(_0x3493c2){return BPromise['reject'](_0x3493c2);}return _0x500564[_0xc579('0x1f')]();};}function saveUpdates(_0x2fe15f,_0x4bd717){return function(_0x2ef0fe){if(_0x2ef0fe){return _0x2ef0fe[_0xc579('0x20')](_0x2fe15f)[_0xc579('0x21')](function(_0x259b65){return _0x259b65;});}return null;};}function removeEntity(_0x2409ca,_0x4b9e8c){return function(_0x1f2c77){if(_0x1f2c77){return _0x1f2c77[_0xc579('0x22')]()[_0xc579('0x21')](function(){var _0xa85c9d=_0x1f2c77[_0xc579('0x23')]({'plain':!![]});var _0x102c86=_0xc579('0x24');return db[_0xc579('0x25')][_0xc579('0x22')]({'where':{'type':_0x102c86,'resourceId':_0xa85c9d['id']}})[_0xc579('0x21')](function(){return _0x1f2c77;});})[_0xc579('0x21')](function(){_0x2409ca[_0xc579('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x57ae6f,_0x399747){return function(_0x263dd5){if(!_0x263dd5){_0x57ae6f[_0xc579('0x26')](0x194);}return _0x263dd5;};}function handleError(_0x2e39c6,_0x44bc8a){_0x44bc8a=_0x44bc8a||0x1f4;return function(_0x1c1985){logger['error'](_0x1c1985[_0xc579('0x27')]);if(_0x1c1985[_0xc579('0x28')]){delete _0x1c1985[_0xc579('0x28')];}_0x2e39c6[_0xc579('0x18')](_0x44bc8a)['send'](_0x1c1985);};}exports[_0xc579('0x29')]=function(_0x9b44b1,_0xdd1fd4){var _0x1413f8={},_0x25efc6={},_0x92394a={'count':0x0,'rows':[]};var _0x50f1e5=_[_0xc579('0x2a')](db[_0xc579('0x2b')][_0xc579('0x2c')],function(_0x14823e){return{'name':_0x14823e[_0xc579('0x2d')],'type':_0x14823e[_0xc579('0x2e')][_0xc579('0x2f')]};});_0x25efc6['model']=_[_0xc579('0x2a')](_0x50f1e5,_0xc579('0x28'));_0x25efc6[_0xc579('0x30')]=_[_0xc579('0x31')](_0x9b44b1['query']);_0x25efc6[_0xc579('0x32')]=_[_0xc579('0x33')](_0x25efc6[_0xc579('0x34')],_0x25efc6[_0xc579('0x30')]);_0x1413f8[_0xc579('0x35')]=_[_0xc579('0x33')](_0x25efc6['model'],qs['fields'](_0x9b44b1['query'][_0xc579('0x36')]));_0x1413f8[_0xc579('0x35')]=_0x1413f8[_0xc579('0x35')][_0xc579('0x37')]?_0x1413f8[_0xc579('0x35')]:_0x25efc6[_0xc579('0x34')];if(!_0x9b44b1[_0xc579('0x30')][_0xc579('0x38')](_0xc579('0x39'))){_0x1413f8[_0xc579('0x1a')]=qs[_0xc579('0x1a')](_0x9b44b1[_0xc579('0x30')][_0xc579('0x1a')]);_0x1413f8['offset']=qs[_0xc579('0x19')](_0x9b44b1[_0xc579('0x30')][_0xc579('0x19')]);}_0x1413f8[_0xc579('0x3a')]=qs[_0xc579('0x3b')](_0x9b44b1[_0xc579('0x30')][_0xc579('0x3b')]);_0x1413f8[_0xc579('0x3c')]=qs['filters'](_[_0xc579('0x3d')](_0x9b44b1[_0xc579('0x30')],_0x25efc6[_0xc579('0x32')]),_0x50f1e5);if(_0x9b44b1[_0xc579('0x30')][_0xc579('0x3e')]){_0x1413f8['where']=_['merge'](_0x1413f8['where'],{'$or':_['map'](_0x50f1e5,function(_0x5a9d7e){if(_0x5a9d7e[_0xc579('0x2e')]!==_0xc579('0x3f')){var _0x3f14a6={};_0x3f14a6[_0x5a9d7e['name']]={'$like':'%'+_0x9b44b1[_0xc579('0x30')]['filter']+'%'};return _0x3f14a6;}})});}_0x1413f8=_[_0xc579('0x40')]({},_0x1413f8,_0x9b44b1[_0xc579('0x41')]);var _0x41d24f={'where':_0x1413f8[_0xc579('0x3c')]};return db[_0xc579('0x2b')][_0xc579('0x1b')](_0x41d24f)[_0xc579('0x21')](function(_0x371e5a){_0x92394a['count']=_0x371e5a;if(_0x9b44b1[_0xc579('0x30')][_0xc579('0x42')]){_0x1413f8[_0xc579('0x43')]=[{'all':!![]}];}return db[_0xc579('0x2b')][_0xc579('0x44')](_0x1413f8);})[_0xc579('0x21')](function(_0x312bdb){_0x92394a['rows']=_0x312bdb;return _0x92394a;})[_0xc579('0x21')](respondWithFilteredResult(_0xdd1fd4,_0x1413f8))[_0xc579('0x45')](handleError(_0xdd1fd4,null));};exports[_0xc579('0x46')]=function(_0x15fc7d,_0x2955ef){var _0x375912={'raw':![],'where':{'id':_0x15fc7d[_0xc579('0x47')]['id']}},_0x155fc9={};_0x155fc9['model']=_[_0xc579('0x31')](db['Trigger'][_0xc579('0x2c')]);_0x155fc9[_0xc579('0x30')]=_['keys'](_0x15fc7d[_0xc579('0x30')]);_0x155fc9['filters']=_[_0xc579('0x33')](_0x155fc9[_0xc579('0x34')],_0x155fc9['query']);_0x375912['attributes']=_[_0xc579('0x33')](_0x155fc9[_0xc579('0x34')],qs[_0xc579('0x36')](_0x15fc7d[_0xc579('0x30')][_0xc579('0x36')]));_0x375912[_0xc579('0x35')]=_0x375912[_0xc579('0x35')][_0xc579('0x37')]?_0x375912[_0xc579('0x35')]:_0x155fc9[_0xc579('0x34')];if(_0x15fc7d['query'][_0xc579('0x42')]){_0x375912[_0xc579('0x43')]=[{'all':!![]}];}_0x375912=_[_0xc579('0x40')]({},_0x375912,_0x15fc7d['options']);return db[_0xc579('0x2b')][_0xc579('0x48')](_0x375912)[_0xc579('0x21')](handleEntityNotFound(_0x2955ef,null))[_0xc579('0x21')](respondWithResult(_0x2955ef,null))[_0xc579('0x45')](handleError(_0x2955ef,null));};exports[_0xc579('0x49')]=function(_0x325351,_0xde1d79){return db[_0xc579('0x2b')][_0xc579('0x49')](_0x325351[_0xc579('0x4a')],{})['then'](function(_0x4ba327){var _0x31a7dd=_0x325351[_0xc579('0x4b')][_0xc579('0x23')]({'plain':!![]});if(!_0x31a7dd)throw new Error(_0xc579('0x4c'));if(_0x31a7dd['role']===_0xc579('0x4b')){var _0xe6891c=_0x4ba327['get']({'plain':!![]});var _0x37a76a=_0xc579('0x24');return db[_0xc579('0x4d')]['find']({'where':{'name':_0x37a76a,'userProfileId':_0x31a7dd[_0xc579('0x4e')]},'raw':!![]})[_0xc579('0x21')](function(_0x141f90){if(_0x141f90&&_0x141f90['autoAssociation']===0x0){return db['UserProfileResource'][_0xc579('0x49')]({'name':_0xe6891c['name'],'resourceId':_0xe6891c['id'],'type':_0x141f90[_0xc579('0x28')],'sectionId':_0x141f90['id']},{})[_0xc579('0x21')](function(){return _0x4ba327;});}else{return _0x4ba327;}})[_0xc579('0x45')](function(_0x4e4980){logger[_0xc579('0x4f')](_0xc579('0x50'),_0x4e4980);throw _0x4e4980;});}return _0x4ba327;})['then'](respondWithResult(_0xde1d79,0xc9))[_0xc579('0x45')](handleError(_0xde1d79,null));};exports[_0xc579('0x20')]=function(_0x3470a0,_0x58399c){if(_0x3470a0[_0xc579('0x4a')]['id']){delete _0x3470a0[_0xc579('0x4a')]['id'];}return db['Trigger'][_0xc579('0x48')]({'where':{'id':_0x3470a0[_0xc579('0x47')]['id']}})[_0xc579('0x21')](handleEntityNotFound(_0x58399c,null))[_0xc579('0x21')](saveUpdates(_0x3470a0['body'],null))[_0xc579('0x21')](respondWithResult(_0x58399c,null))['catch'](handleError(_0x58399c,null));};exports[_0xc579('0x22')]=function(_0x3b7661,_0x401a77){return db['Trigger'][_0xc579('0x48')]({'where':{'id':_0x3b7661['params']['id']}})[_0xc579('0x21')](handleEntityNotFound(_0x401a77,null))[_0xc579('0x21')](removeEntity(_0x401a77,null))[_0xc579('0x45')](handleError(_0x401a77,null));};exports[_0xc579('0x51')]=function(_0x29bd98,_0x40b5b4,_0x51db18){if(_0x29bd98['body']['id']){delete _0x29bd98['body']['id'];}return db[_0xc579('0x2b')][_0xc579('0x48')]({'where':{'id':_0x29bd98[_0xc579('0x47')]['id']}})[_0xc579('0x21')](handleEntityNotFound(_0x40b5b4,null))['then'](function(_0x50772e){if(_0x50772e){_0x29bd98[_0xc579('0x4a')][_0xc579('0x52')]=_0x50772e['id'];return db[_0xc579('0x53')][_0xc579('0x49')](_0x29bd98[_0xc579('0x4a')]);}})[_0xc579('0x21')](respondWithResult(_0x40b5b4,null))[_0xc579('0x45')](handleError(_0x40b5b4,null));};exports[_0xc579('0x54')]=function(_0x47de68,_0x52fa74,_0x260560){if(_0x47de68['body']['id']){delete _0x47de68[_0xc579('0x4a')]['id'];}return db[_0xc579('0x2b')][_0xc579('0x48')]({'where':{'id':_0x47de68[_0xc579('0x47')]['id']}})[_0xc579('0x21')](handleEntityNotFound(_0x52fa74,null))['then'](function(_0x4dc3f5){if(_0x4dc3f5){_0x47de68['body'][_0xc579('0x55')]=_0x4dc3f5['id'];return db[_0xc579('0x53')][_0xc579('0x49')](_0x47de68[_0xc579('0x4a')]);}})['then'](respondWithResult(_0x52fa74,null))[_0xc579('0x45')](handleError(_0x52fa74,null));};exports[_0xc579('0x56')]=function(_0x579ba4,_0x594ff5,_0x31c43f){var _0x2b782d={};var _0x5dad6a={};var _0x47698d;var _0x10e2b0;return db['Trigger'][_0xc579('0x57')]({'where':{'id':_0x579ba4[_0xc579('0x47')]['id']}})[_0xc579('0x21')](handleEntityNotFound(_0x594ff5,null))['then'](function(_0x571d82){if(_0x571d82){_0x47698d=_0x571d82;_0x5dad6a['model']=_['keys'](db[_0xc579('0x53')]['rawAttributes']);_0x5dad6a[_0xc579('0x30')]=_['keys'](_0x579ba4[_0xc579('0x30')]);_0x5dad6a[_0xc579('0x32')]=_[_0xc579('0x33')](_0x5dad6a[_0xc579('0x34')],_0x5dad6a[_0xc579('0x30')]);_0x2b782d['attributes']=_[_0xc579('0x33')](_0x5dad6a[_0xc579('0x34')],qs[_0xc579('0x36')](_0x579ba4[_0xc579('0x30')][_0xc579('0x36')]));_0x2b782d['attributes']=_0x2b782d[_0xc579('0x35')][_0xc579('0x37')]?_0x2b782d['attributes']:_0x5dad6a['model'];_0x2b782d['order']=qs[_0xc579('0x3b')](_0x579ba4[_0xc579('0x30')][_0xc579('0x3b')]);_0x2b782d['where']=qs[_0xc579('0x32')](_[_0xc579('0x3d')](_0x579ba4[_0xc579('0x30')],_0x5dad6a['filters']));if(_0x579ba4[_0xc579('0x30')][_0xc579('0x3e')]){_0x2b782d[_0xc579('0x3c')]=_[_0xc579('0x40')](_0x2b782d[_0xc579('0x3c')],{'$or':_[_0xc579('0x2a')](_0x2b782d[_0xc579('0x35')],function(_0x30c222){var _0x4e4a74={};_0x4e4a74[_0x30c222]={'$like':'%'+_0x579ba4['query']['filter']+'%'};return _0x4e4a74;})});}_0x2b782d=_[_0xc579('0x40')]({},_0x2b782d,_0x579ba4['options']);return _0x47698d[_0xc579('0x56')](_0x2b782d);}})['then'](function(_0xcc7623){if(_0xcc7623){_0x10e2b0=_0xcc7623[_0xc579('0x37')];if(!_0x579ba4[_0xc579('0x30')][_0xc579('0x38')]('nolimit')){_0x2b782d['limit']=qs['limit'](_0x579ba4['query'][_0xc579('0x1a')]);_0x2b782d[_0xc579('0x19')]=qs[_0xc579('0x19')](_0x579ba4[_0xc579('0x30')]['offset']);}return _0x47698d[_0xc579('0x56')](_0x2b782d);}})[_0xc579('0x21')](function(_0x597316){if(_0x597316){return _0x597316?{'count':_0x10e2b0,'rows':_0x597316}:null;}})[_0xc579('0x21')](respondWithResult(_0x594ff5,null))[_0xc579('0x45')](handleError(_0x594ff5,null));};exports[_0xc579('0x58')]=function(_0x586729,_0x5c7f42,_0x1186bc){var _0x67909b={};var _0x42dde3={};var _0x48294f;var _0x5074a4;return db[_0xc579('0x2b')][_0xc579('0x57')]({'where':{'id':_0x586729[_0xc579('0x47')]['id']}})['then'](handleEntityNotFound(_0x5c7f42,null))[_0xc579('0x21')](function(_0x22bc86){if(_0x22bc86){_0x48294f=_0x22bc86;_0x42dde3['model']=_[_0xc579('0x31')](db['Condition'][_0xc579('0x2c')]);_0x42dde3['query']=_[_0xc579('0x31')](_0x586729[_0xc579('0x30')]);_0x42dde3[_0xc579('0x32')]=_[_0xc579('0x33')](_0x42dde3['model'],_0x42dde3[_0xc579('0x30')]);_0x67909b[_0xc579('0x35')]=_[_0xc579('0x33')](_0x42dde3[_0xc579('0x34')],qs['fields'](_0x586729['query'][_0xc579('0x36')]));_0x67909b[_0xc579('0x35')]=_0x67909b[_0xc579('0x35')]['length']?_0x67909b['attributes']:_0x42dde3[_0xc579('0x34')];_0x67909b['order']=qs['sort'](_0x586729[_0xc579('0x30')][_0xc579('0x3b')]);_0x67909b[_0xc579('0x3c')]=qs[_0xc579('0x32')](_[_0xc579('0x3d')](_0x586729['query'],_0x42dde3['filters']));if(_0x586729[_0xc579('0x30')][_0xc579('0x3e')]){_0x67909b['where']=_['merge'](_0x67909b[_0xc579('0x3c')],{'$or':_['map'](_0x67909b[_0xc579('0x35')],function(_0x1bfc21){var _0x411c02={};_0x411c02[_0x1bfc21]={'$like':'%'+_0x586729[_0xc579('0x30')][_0xc579('0x3e')]+'%'};return _0x411c02;})});}_0x67909b=_['merge']({},_0x67909b,_0x586729['options']);return _0x48294f[_0xc579('0x58')](_0x67909b);}})[_0xc579('0x21')](function(_0x5924e9){if(_0x5924e9){_0x5074a4=_0x5924e9[_0xc579('0x37')];if(!_0x586729[_0xc579('0x30')]['hasOwnProperty']('nolimit')){_0x67909b[_0xc579('0x1a')]=qs[_0xc579('0x1a')](_0x586729['query'][_0xc579('0x1a')]);_0x67909b[_0xc579('0x19')]=qs[_0xc579('0x19')](_0x586729[_0xc579('0x30')][_0xc579('0x19')]);}return _0x48294f[_0xc579('0x58')](_0x67909b);}})[_0xc579('0x21')](function(_0x58f708){if(_0x58f708){return _0x58f708?{'count':_0x5074a4,'rows':_0x58f708}:null;}})['then'](respondWithResult(_0x5c7f42,null))[_0xc579('0x45')](handleError(_0x5c7f42,null));};exports[_0xc579('0x59')]=function(_0x347601,_0x474cf8,_0x29e289){if(_0x347601[_0xc579('0x4a')]['id']){delete _0x347601['body']['id'];}return db[_0xc579('0x2b')][_0xc579('0x48')]({'where':{'id':_0x347601[_0xc579('0x47')]['id']}})[_0xc579('0x21')](handleEntityNotFound(_0x474cf8,null))[_0xc579('0x21')](function(_0x16930a){if(_0x16930a){_0x347601[_0xc579('0x4a')]['TriggerId']=_0x16930a['id'];return db[_0xc579('0x5a')][_0xc579('0x49')](_0x347601['body']);}})[_0xc579('0x21')](respondWithResult(_0x474cf8,null))[_0xc579('0x45')](handleError(_0x474cf8,null));};exports[_0xc579('0x5b')]=function(_0x5afc7e,_0x38d9d4,_0x2b8ad4){var _0x2edad7={};var _0x179443={};var _0x484139;var _0x1fa264;return db[_0xc579('0x2b')][_0xc579('0x57')]({'where':{'id':_0x5afc7e[_0xc579('0x47')]['id']}})['then'](handleEntityNotFound(_0x38d9d4,null))[_0xc579('0x21')](function(_0x5b33c7){if(_0x5b33c7){_0x484139=_0x5b33c7;_0x179443[_0xc579('0x34')]=_[_0xc579('0x31')](db[_0xc579('0x5a')][_0xc579('0x2c')]);_0x179443[_0xc579('0x30')]=_[_0xc579('0x31')](_0x5afc7e[_0xc579('0x30')]);_0x179443[_0xc579('0x32')]=_[_0xc579('0x33')](_0x179443[_0xc579('0x34')],_0x179443[_0xc579('0x30')]);_0x2edad7[_0xc579('0x35')]=_[_0xc579('0x33')](_0x179443['model'],qs[_0xc579('0x36')](_0x5afc7e['query'][_0xc579('0x36')]));_0x2edad7[_0xc579('0x35')]=_0x2edad7[_0xc579('0x35')][_0xc579('0x37')]?_0x2edad7['attributes']:_0x179443[_0xc579('0x34')];_0x2edad7[_0xc579('0x3a')]=qs[_0xc579('0x3b')](_0x5afc7e[_0xc579('0x30')][_0xc579('0x3b')]);_0x2edad7[_0xc579('0x3c')]=qs[_0xc579('0x32')](_[_0xc579('0x3d')](_0x5afc7e[_0xc579('0x30')],_0x179443['filters']));if(_0x5afc7e[_0xc579('0x30')][_0xc579('0x3e')]){_0x2edad7[_0xc579('0x3c')]=_[_0xc579('0x40')](_0x2edad7[_0xc579('0x3c')],{'$or':_[_0xc579('0x2a')](_0x2edad7[_0xc579('0x35')],function(_0x51438a){var _0x3d7fbb={};_0x3d7fbb[_0x51438a]={'$like':'%'+_0x5afc7e['query']['filter']+'%'};return _0x3d7fbb;})});}_0x2edad7=_['merge']({},_0x2edad7,_0x5afc7e['options']);return _0x484139[_0xc579('0x5b')](_0x2edad7);}})['then'](function(_0x5eef87){if(_0x5eef87){_0x1fa264=_0x5eef87[_0xc579('0x37')];if(!_0x5afc7e[_0xc579('0x30')][_0xc579('0x38')](_0xc579('0x39'))){_0x2edad7[_0xc579('0x1a')]=qs[_0xc579('0x1a')](_0x5afc7e[_0xc579('0x30')]['limit']);_0x2edad7[_0xc579('0x19')]=qs[_0xc579('0x19')](_0x5afc7e[_0xc579('0x30')][_0xc579('0x19')]);}return _0x484139['getActions'](_0x2edad7);}})[_0xc579('0x21')](function(_0x553ed2){if(_0x553ed2){return _0x553ed2?{'count':_0x1fa264,'rows':_0x553ed2}:null;}})[_0xc579('0x21')](respondWithResult(_0x38d9d4,null))[_0xc579('0x45')](handleError(_0x38d9d4,null));}; \ No newline at end of file +var _0x3002=['keys','length','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','addAllCondition','TriggerAllId','TriggerAnyId','Condition','findOne','getAllConditions','nolimit','getAnyConditions','addAction','TriggerId','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','update','then','destroy','Triggers','UserProfileResource','sendStatus','error','stack','name','send','index','map','Trigger','rawAttributes','type','query','filters','intersection','model','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params'];(function(_0x2c6e22,_0x583370){var _0x46ae6c=function(_0x3ba989){while(--_0x3ba989){_0x2c6e22['push'](_0x2c6e22['shift']());}};_0x46ae6c(++_0x583370);}(_0x3002,0x134));var _0x2300=function(_0x292a43,_0x475dac){_0x292a43=_0x292a43-0x0;var _0x37f303=_0x3002[_0x292a43];return _0x37f303;};'use strict';var emlformat=require(_0x2300('0x0'));var rimraf=require(_0x2300('0x1'));var zipdir=require(_0x2300('0x2'));var jsonpatch=require(_0x2300('0x3'));var rp=require(_0x2300('0x4'));var moment=require('moment');var BPromise=require(_0x2300('0x5'));var Mustache=require('mustache');var util=require(_0x2300('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x2300('0x7'));var ejs=require(_0x2300('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2300('0x9'));var squel=require(_0x2300('0xa'));var crypto=require(_0x2300('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x2300('0xc'));var toCsv=require(_0x2300('0x7'));var querystring=require(_0x2300('0xd'));var Papa=require(_0x2300('0xe'));var Redis=require(_0x2300('0xf'));var authService=require(_0x2300('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x2300('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2300('0x12'))(_0x2300('0x13'));var utils=require(_0x2300('0x14'));var config=require(_0x2300('0x15'));var licenseUtil=require(_0x2300('0x16'));var db=require(_0x2300('0x17'))['db'];function respondWithStatusCode(_0x3bf3be,_0x14d4f4){_0x14d4f4=_0x14d4f4||0xcc;return function(_0x47acac){if(_0x47acac){return _0x3bf3be['sendStatus'](_0x14d4f4);}return _0x3bf3be[_0x2300('0x18')](_0x14d4f4)[_0x2300('0x19')]();};}function respondWithResult(_0x18dff6,_0x2df680){_0x2df680=_0x2df680||0xc8;return function(_0xe789c5){if(_0xe789c5){return _0x18dff6['status'](_0x2df680)['json'](_0xe789c5);}};}function respondWithFilteredResult(_0x33e272,_0x142bda){return function(_0x3b109f){if(_0x3b109f){var _0x21d615=typeof _0x142bda[_0x2300('0x1a')]==='undefined'&&typeof _0x142bda[_0x2300('0x1b')]===_0x2300('0x1c');var _0x126856=_0x3b109f[_0x2300('0x1d')];var _0xbe8e7=_0x21d615?0x0:_0x142bda[_0x2300('0x1a')];var _0x45dcac=_0x21d615?_0x3b109f[_0x2300('0x1d')]:_0x142bda['offset']+_0x142bda[_0x2300('0x1b')];var _0x1ff49f;if(_0x45dcac>=_0x126856){_0x45dcac=_0x126856;_0x1ff49f=0xc8;}else{_0x1ff49f=0xce;}_0x33e272[_0x2300('0x18')](_0x1ff49f);return _0x33e272[_0x2300('0x1e')](_0x2300('0x1f'),_0xbe8e7+'-'+_0x45dcac+'/'+_0x126856)[_0x2300('0x20')](_0x3b109f);}return null;};}function patchUpdates(_0x173684){return function(_0x49bdb0){try{jsonpatch[_0x2300('0x21')](_0x49bdb0,_0x173684,!![]);}catch(_0x3b29b7){return BPromise[_0x2300('0x22')](_0x3b29b7);}return _0x49bdb0['save']();};}function saveUpdates(_0x15a89f,_0xb78e37){return function(_0x170296){if(_0x170296){return _0x170296[_0x2300('0x23')](_0x15a89f)[_0x2300('0x24')](function(_0x1a7d8a){return _0x1a7d8a;});}return null;};}function removeEntity(_0x4cc64f,_0x492751){return function(_0x4da802){if(_0x4da802){return _0x4da802[_0x2300('0x25')]()[_0x2300('0x24')](function(){var _0x4db0a8=_0x4da802['get']({'plain':!![]});var _0x5c4670=_0x2300('0x26');return db[_0x2300('0x27')][_0x2300('0x25')]({'where':{'type':_0x5c4670,'resourceId':_0x4db0a8['id']}})[_0x2300('0x24')](function(){return _0x4da802;});})['then'](function(){_0x4cc64f[_0x2300('0x18')](0xcc)[_0x2300('0x19')]();});}};}function handleEntityNotFound(_0x44a529,_0x46cb25){return function(_0x4451cf){if(!_0x4451cf){_0x44a529[_0x2300('0x28')](0x194);}return _0x4451cf;};}function handleError(_0x169eed,_0x2f2ce5){_0x2f2ce5=_0x2f2ce5||0x1f4;return function(_0x553a05){logger[_0x2300('0x29')](_0x553a05[_0x2300('0x2a')]);if(_0x553a05[_0x2300('0x2b')]){delete _0x553a05['name'];}_0x169eed[_0x2300('0x18')](_0x2f2ce5)[_0x2300('0x2c')](_0x553a05);};}exports[_0x2300('0x2d')]=function(_0x26a4d1,_0xf2413a){var _0x51bf24={},_0x5872aa={},_0x22be91={'count':0x0,'rows':[]};var _0x4ccc4f=_[_0x2300('0x2e')](db[_0x2300('0x2f')][_0x2300('0x30')],function(_0xe338cb){return{'name':_0xe338cb['fieldName'],'type':_0xe338cb[_0x2300('0x31')]['key']};});_0x5872aa['model']=_[_0x2300('0x2e')](_0x4ccc4f,_0x2300('0x2b'));_0x5872aa[_0x2300('0x32')]=_['keys'](_0x26a4d1['query']);_0x5872aa[_0x2300('0x33')]=_[_0x2300('0x34')](_0x5872aa[_0x2300('0x35')],_0x5872aa[_0x2300('0x32')]);_0x51bf24[_0x2300('0x36')]=_[_0x2300('0x34')](_0x5872aa['model'],qs[_0x2300('0x37')](_0x26a4d1[_0x2300('0x32')][_0x2300('0x37')]));_0x51bf24[_0x2300('0x36')]=_0x51bf24[_0x2300('0x36')]['length']?_0x51bf24['attributes']:_0x5872aa['model'];if(!_0x26a4d1[_0x2300('0x32')][_0x2300('0x38')]('nolimit')){_0x51bf24[_0x2300('0x1b')]=qs[_0x2300('0x1b')](_0x26a4d1[_0x2300('0x32')]['limit']);_0x51bf24[_0x2300('0x1a')]=qs[_0x2300('0x1a')](_0x26a4d1[_0x2300('0x32')]['offset']);}_0x51bf24[_0x2300('0x39')]=qs[_0x2300('0x3a')](_0x26a4d1[_0x2300('0x32')][_0x2300('0x3a')]);_0x51bf24[_0x2300('0x3b')]=qs[_0x2300('0x33')](_[_0x2300('0x3c')](_0x26a4d1[_0x2300('0x32')],_0x5872aa[_0x2300('0x33')]),_0x4ccc4f);if(_0x26a4d1['query'][_0x2300('0x3d')]){_0x51bf24['where']=_[_0x2300('0x3e')](_0x51bf24[_0x2300('0x3b')],{'$or':_[_0x2300('0x2e')](_0x4ccc4f,function(_0x366774){if(_0x366774[_0x2300('0x31')]!==_0x2300('0x3f')){var _0x2e166b={};_0x2e166b[_0x366774[_0x2300('0x2b')]]={'$like':'%'+_0x26a4d1[_0x2300('0x32')][_0x2300('0x3d')]+'%'};return _0x2e166b;}})});}_0x51bf24=_[_0x2300('0x3e')]({},_0x51bf24,_0x26a4d1[_0x2300('0x40')]);var _0xa5e0f5={'where':_0x51bf24['where']};return db[_0x2300('0x2f')][_0x2300('0x1d')](_0xa5e0f5)[_0x2300('0x24')](function(_0xafc40d){_0x22be91[_0x2300('0x1d')]=_0xafc40d;if(_0x26a4d1[_0x2300('0x32')][_0x2300('0x41')]){_0x51bf24[_0x2300('0x42')]=[{'all':!![]}];}return db[_0x2300('0x2f')][_0x2300('0x43')](_0x51bf24);})[_0x2300('0x24')](function(_0x3b1fb3){_0x22be91[_0x2300('0x44')]=_0x3b1fb3;return _0x22be91;})['then'](respondWithFilteredResult(_0xf2413a,_0x51bf24))[_0x2300('0x45')](handleError(_0xf2413a,null));};exports[_0x2300('0x46')]=function(_0x128ab5,_0x51aa71){var _0x45f604={'raw':![],'where':{'id':_0x128ab5[_0x2300('0x47')]['id']}},_0x3d897d={};_0x3d897d[_0x2300('0x35')]=_['keys'](db[_0x2300('0x2f')][_0x2300('0x30')]);_0x3d897d[_0x2300('0x32')]=_[_0x2300('0x48')](_0x128ab5[_0x2300('0x32')]);_0x3d897d[_0x2300('0x33')]=_[_0x2300('0x34')](_0x3d897d[_0x2300('0x35')],_0x3d897d['query']);_0x45f604[_0x2300('0x36')]=_['intersection'](_0x3d897d[_0x2300('0x35')],qs['fields'](_0x128ab5[_0x2300('0x32')][_0x2300('0x37')]));_0x45f604[_0x2300('0x36')]=_0x45f604[_0x2300('0x36')][_0x2300('0x49')]?_0x45f604[_0x2300('0x36')]:_0x3d897d[_0x2300('0x35')];if(_0x128ab5[_0x2300('0x32')][_0x2300('0x41')]){_0x45f604[_0x2300('0x42')]=[{'all':!![]}];}_0x45f604=_[_0x2300('0x3e')]({},_0x45f604,_0x128ab5[_0x2300('0x40')]);return db[_0x2300('0x2f')][_0x2300('0x4a')](_0x45f604)['then'](handleEntityNotFound(_0x51aa71,null))['then'](respondWithResult(_0x51aa71,null))[_0x2300('0x45')](handleError(_0x51aa71,null));};exports['create']=function(_0x4e2817,_0x4c9500){return db[_0x2300('0x2f')][_0x2300('0x4b')](_0x4e2817[_0x2300('0x4c')],{})['then'](function(_0x22bdb1){var _0x5ba767=_0x4e2817[_0x2300('0x4d')][_0x2300('0x4e')]({'plain':!![]});if(!_0x5ba767)throw new Error(_0x2300('0x4f'));if(_0x5ba767[_0x2300('0x50')]===_0x2300('0x4d')){var _0x458722=_0x22bdb1[_0x2300('0x4e')]({'plain':!![]});var _0x25cc3d=_0x2300('0x26');return db[_0x2300('0x51')][_0x2300('0x4a')]({'where':{'name':_0x25cc3d,'userProfileId':_0x5ba767['userProfileId']},'raw':!![]})[_0x2300('0x24')](function(_0xd7a980){if(_0xd7a980&&_0xd7a980[_0x2300('0x52')]===0x0){return db[_0x2300('0x27')][_0x2300('0x4b')]({'name':_0x458722['name'],'resourceId':_0x458722['id'],'type':_0xd7a980[_0x2300('0x2b')],'sectionId':_0xd7a980['id']},{})[_0x2300('0x24')](function(){return _0x22bdb1;});}else{return _0x22bdb1;}})[_0x2300('0x45')](function(_0x4cf306){logger[_0x2300('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4cf306);throw _0x4cf306;});}return _0x22bdb1;})[_0x2300('0x24')](respondWithResult(_0x4c9500,0xc9))[_0x2300('0x45')](handleError(_0x4c9500,null));};exports[_0x2300('0x23')]=function(_0x5edf0c,_0x13b049){if(_0x5edf0c['body']['id']){delete _0x5edf0c[_0x2300('0x4c')]['id'];}return db['Trigger'][_0x2300('0x4a')]({'where':{'id':_0x5edf0c['params']['id']}})[_0x2300('0x24')](handleEntityNotFound(_0x13b049,null))[_0x2300('0x24')](saveUpdates(_0x5edf0c[_0x2300('0x4c')],null))[_0x2300('0x24')](respondWithResult(_0x13b049,null))[_0x2300('0x45')](handleError(_0x13b049,null));};exports[_0x2300('0x25')]=function(_0x406edf,_0xe99a6){return db[_0x2300('0x2f')][_0x2300('0x4a')]({'where':{'id':_0x406edf[_0x2300('0x47')]['id']}})[_0x2300('0x24')](handleEntityNotFound(_0xe99a6,null))[_0x2300('0x24')](removeEntity(_0xe99a6,null))[_0x2300('0x45')](handleError(_0xe99a6,null));};exports[_0x2300('0x53')]=function(_0x1d3ec5,_0xd63bc8,_0xc291b3){if(_0x1d3ec5[_0x2300('0x4c')]['id']){delete _0x1d3ec5[_0x2300('0x4c')]['id'];}return db[_0x2300('0x2f')]['find']({'where':{'id':_0x1d3ec5[_0x2300('0x47')]['id']}})[_0x2300('0x24')](handleEntityNotFound(_0xd63bc8,null))['then'](function(_0x223179){if(_0x223179){_0x1d3ec5[_0x2300('0x4c')][_0x2300('0x54')]=_0x223179['id'];return db['Condition'][_0x2300('0x4b')](_0x1d3ec5['body']);}})['then'](respondWithResult(_0xd63bc8,null))[_0x2300('0x45')](handleError(_0xd63bc8,null));};exports['addAnyCondition']=function(_0x487fe9,_0x42cba7,_0x3449fd){if(_0x487fe9['body']['id']){delete _0x487fe9[_0x2300('0x4c')]['id'];}return db[_0x2300('0x2f')][_0x2300('0x4a')]({'where':{'id':_0x487fe9[_0x2300('0x47')]['id']}})[_0x2300('0x24')](handleEntityNotFound(_0x42cba7,null))[_0x2300('0x24')](function(_0x189fc7){if(_0x189fc7){_0x487fe9[_0x2300('0x4c')][_0x2300('0x55')]=_0x189fc7['id'];return db[_0x2300('0x56')][_0x2300('0x4b')](_0x487fe9['body']);}})[_0x2300('0x24')](respondWithResult(_0x42cba7,null))[_0x2300('0x45')](handleError(_0x42cba7,null));};exports['getAllConditions']=function(_0x44d9fd,_0x4b0ca1,_0x1f6ebd){var _0xe4b5b1={};var _0x194e32={};var _0x1d9004;var _0x2a0d1f;return db[_0x2300('0x2f')][_0x2300('0x57')]({'where':{'id':_0x44d9fd[_0x2300('0x47')]['id']}})[_0x2300('0x24')](handleEntityNotFound(_0x4b0ca1,null))[_0x2300('0x24')](function(_0x170e38){if(_0x170e38){_0x1d9004=_0x170e38;_0x194e32['model']=_[_0x2300('0x48')](db[_0x2300('0x56')][_0x2300('0x30')]);_0x194e32['query']=_[_0x2300('0x48')](_0x44d9fd[_0x2300('0x32')]);_0x194e32[_0x2300('0x33')]=_['intersection'](_0x194e32[_0x2300('0x35')],_0x194e32[_0x2300('0x32')]);_0xe4b5b1[_0x2300('0x36')]=_[_0x2300('0x34')](_0x194e32['model'],qs[_0x2300('0x37')](_0x44d9fd['query'][_0x2300('0x37')]));_0xe4b5b1[_0x2300('0x36')]=_0xe4b5b1[_0x2300('0x36')]['length']?_0xe4b5b1[_0x2300('0x36')]:_0x194e32['model'];_0xe4b5b1['order']=qs['sort'](_0x44d9fd[_0x2300('0x32')][_0x2300('0x3a')]);_0xe4b5b1[_0x2300('0x3b')]=qs['filters'](_[_0x2300('0x3c')](_0x44d9fd[_0x2300('0x32')],_0x194e32[_0x2300('0x33')]));if(_0x44d9fd[_0x2300('0x32')][_0x2300('0x3d')]){_0xe4b5b1[_0x2300('0x3b')]=_[_0x2300('0x3e')](_0xe4b5b1[_0x2300('0x3b')],{'$or':_[_0x2300('0x2e')](_0xe4b5b1[_0x2300('0x36')],function(_0x5ec14b){var _0x3c3022={};_0x3c3022[_0x5ec14b]={'$like':'%'+_0x44d9fd[_0x2300('0x32')][_0x2300('0x3d')]+'%'};return _0x3c3022;})});}_0xe4b5b1=_['merge']({},_0xe4b5b1,_0x44d9fd[_0x2300('0x40')]);return _0x1d9004[_0x2300('0x58')](_0xe4b5b1);}})[_0x2300('0x24')](function(_0x5cc857){if(_0x5cc857){_0x2a0d1f=_0x5cc857['length'];if(!_0x44d9fd['query'][_0x2300('0x38')](_0x2300('0x59'))){_0xe4b5b1[_0x2300('0x1b')]=qs[_0x2300('0x1b')](_0x44d9fd[_0x2300('0x32')][_0x2300('0x1b')]);_0xe4b5b1[_0x2300('0x1a')]=qs[_0x2300('0x1a')](_0x44d9fd['query'][_0x2300('0x1a')]);}return _0x1d9004[_0x2300('0x58')](_0xe4b5b1);}})[_0x2300('0x24')](function(_0x26844a){if(_0x26844a){return _0x26844a?{'count':_0x2a0d1f,'rows':_0x26844a}:null;}})[_0x2300('0x24')](respondWithResult(_0x4b0ca1,null))['catch'](handleError(_0x4b0ca1,null));};exports['getAnyConditions']=function(_0x3cf2cc,_0x10cf50,_0x441fb2){var _0x2fee27={};var _0x4b8a43={};var _0x17e6e7;var _0x461449;return db[_0x2300('0x2f')][_0x2300('0x57')]({'where':{'id':_0x3cf2cc[_0x2300('0x47')]['id']}})['then'](handleEntityNotFound(_0x10cf50,null))['then'](function(_0x35cecf){if(_0x35cecf){_0x17e6e7=_0x35cecf;_0x4b8a43[_0x2300('0x35')]=_[_0x2300('0x48')](db[_0x2300('0x56')]['rawAttributes']);_0x4b8a43['query']=_[_0x2300('0x48')](_0x3cf2cc['query']);_0x4b8a43[_0x2300('0x33')]=_[_0x2300('0x34')](_0x4b8a43[_0x2300('0x35')],_0x4b8a43[_0x2300('0x32')]);_0x2fee27[_0x2300('0x36')]=_[_0x2300('0x34')](_0x4b8a43[_0x2300('0x35')],qs[_0x2300('0x37')](_0x3cf2cc['query'][_0x2300('0x37')]));_0x2fee27[_0x2300('0x36')]=_0x2fee27['attributes']['length']?_0x2fee27[_0x2300('0x36')]:_0x4b8a43[_0x2300('0x35')];_0x2fee27[_0x2300('0x39')]=qs[_0x2300('0x3a')](_0x3cf2cc['query'][_0x2300('0x3a')]);_0x2fee27['where']=qs[_0x2300('0x33')](_[_0x2300('0x3c')](_0x3cf2cc['query'],_0x4b8a43['filters']));if(_0x3cf2cc[_0x2300('0x32')][_0x2300('0x3d')]){_0x2fee27['where']=_[_0x2300('0x3e')](_0x2fee27[_0x2300('0x3b')],{'$or':_[_0x2300('0x2e')](_0x2fee27[_0x2300('0x36')],function(_0x119809){var _0x6f7406={};_0x6f7406[_0x119809]={'$like':'%'+_0x3cf2cc[_0x2300('0x32')][_0x2300('0x3d')]+'%'};return _0x6f7406;})});}_0x2fee27=_[_0x2300('0x3e')]({},_0x2fee27,_0x3cf2cc[_0x2300('0x40')]);return _0x17e6e7[_0x2300('0x5a')](_0x2fee27);}})[_0x2300('0x24')](function(_0xec4bf5){if(_0xec4bf5){_0x461449=_0xec4bf5[_0x2300('0x49')];if(!_0x3cf2cc[_0x2300('0x32')]['hasOwnProperty']('nolimit')){_0x2fee27[_0x2300('0x1b')]=qs[_0x2300('0x1b')](_0x3cf2cc[_0x2300('0x32')][_0x2300('0x1b')]);_0x2fee27[_0x2300('0x1a')]=qs[_0x2300('0x1a')](_0x3cf2cc[_0x2300('0x32')][_0x2300('0x1a')]);}return _0x17e6e7[_0x2300('0x5a')](_0x2fee27);}})['then'](function(_0x1bc921){if(_0x1bc921){return _0x1bc921?{'count':_0x461449,'rows':_0x1bc921}:null;}})[_0x2300('0x24')](respondWithResult(_0x10cf50,null))[_0x2300('0x45')](handleError(_0x10cf50,null));};exports[_0x2300('0x5b')]=function(_0x1a47c6,_0x43ec73,_0x1840df){if(_0x1a47c6[_0x2300('0x4c')]['id']){delete _0x1a47c6['body']['id'];}return db[_0x2300('0x2f')][_0x2300('0x4a')]({'where':{'id':_0x1a47c6[_0x2300('0x47')]['id']}})['then'](handleEntityNotFound(_0x43ec73,null))[_0x2300('0x24')](function(_0xe7e758){if(_0xe7e758){_0x1a47c6[_0x2300('0x4c')][_0x2300('0x5c')]=_0xe7e758['id'];return db[_0x2300('0x5d')][_0x2300('0x4b')](_0x1a47c6[_0x2300('0x4c')]);}})['then'](respondWithResult(_0x43ec73,null))[_0x2300('0x45')](handleError(_0x43ec73,null));};exports[_0x2300('0x5e')]=function(_0x2034e1,_0x1bab96,_0x3839ea){var _0xaa548e={};var _0x2b9528={};var _0xd97ac8;var _0x5dd211;return db[_0x2300('0x2f')][_0x2300('0x57')]({'where':{'id':_0x2034e1['params']['id']}})[_0x2300('0x24')](handleEntityNotFound(_0x1bab96,null))[_0x2300('0x24')](function(_0x2195e3){if(_0x2195e3){_0xd97ac8=_0x2195e3;_0x2b9528['model']=_[_0x2300('0x48')](db[_0x2300('0x5d')]['rawAttributes']);_0x2b9528['query']=_['keys'](_0x2034e1['query']);_0x2b9528[_0x2300('0x33')]=_[_0x2300('0x34')](_0x2b9528[_0x2300('0x35')],_0x2b9528['query']);_0xaa548e[_0x2300('0x36')]=_[_0x2300('0x34')](_0x2b9528[_0x2300('0x35')],qs[_0x2300('0x37')](_0x2034e1[_0x2300('0x32')][_0x2300('0x37')]));_0xaa548e['attributes']=_0xaa548e[_0x2300('0x36')][_0x2300('0x49')]?_0xaa548e[_0x2300('0x36')]:_0x2b9528[_0x2300('0x35')];_0xaa548e[_0x2300('0x39')]=qs[_0x2300('0x3a')](_0x2034e1[_0x2300('0x32')]['sort']);_0xaa548e[_0x2300('0x3b')]=qs[_0x2300('0x33')](_[_0x2300('0x3c')](_0x2034e1[_0x2300('0x32')],_0x2b9528[_0x2300('0x33')]));if(_0x2034e1['query'][_0x2300('0x3d')]){_0xaa548e[_0x2300('0x3b')]=_[_0x2300('0x3e')](_0xaa548e['where'],{'$or':_[_0x2300('0x2e')](_0xaa548e[_0x2300('0x36')],function(_0x2fee20){var _0x5dd394={};_0x5dd394[_0x2fee20]={'$like':'%'+_0x2034e1[_0x2300('0x32')][_0x2300('0x3d')]+'%'};return _0x5dd394;})});}_0xaa548e=_['merge']({},_0xaa548e,_0x2034e1[_0x2300('0x40')]);return _0xd97ac8['getActions'](_0xaa548e);}})[_0x2300('0x24')](function(_0x23d3fa){if(_0x23d3fa){_0x5dd211=_0x23d3fa[_0x2300('0x49')];if(!_0x2034e1[_0x2300('0x32')][_0x2300('0x38')](_0x2300('0x59'))){_0xaa548e[_0x2300('0x1b')]=qs[_0x2300('0x1b')](_0x2034e1[_0x2300('0x32')][_0x2300('0x1b')]);_0xaa548e[_0x2300('0x1a')]=qs[_0x2300('0x1a')](_0x2034e1[_0x2300('0x32')][_0x2300('0x1a')]);}return _0xd97ac8['getActions'](_0xaa548e);}})[_0x2300('0x24')](function(_0x327248){if(_0x327248){return _0x327248?{'count':_0x5dd211,'rows':_0x327248}:null;}})['then'](respondWithResult(_0x1bab96,null))[_0x2300('0x45')](handleError(_0x1bab96,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index b5feee2..f498d3d 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 _0xb0d9=['exports','define','Trigger','tools_triggers','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x480c74,_0x2d29b8){var _0x4a1214=function(_0x2cb75f){while(--_0x2cb75f){_0x480c74['push'](_0x480c74['shift']());}};_0x4a1214(++_0x2d29b8);}(_0xb0d9,0x10c));var _0x9b0d=function(_0x283caf,_0xbb627b){_0x283caf=_0x283caf-0x0;var _0x599096=_0xb0d9[_0x283caf];return _0x599096;};'use strict';var _=require(_0x9b0d('0x0'));var util=require(_0x9b0d('0x1'));var logger=require(_0x9b0d('0x2'))(_0x9b0d('0x3'));var moment=require(_0x9b0d('0x4'));var BPromise=require(_0x9b0d('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9b0d('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./trigger.attributes');module[_0x9b0d('0x7')]=function(_0x3994a1,_0x584dde){return _0x3994a1[_0x9b0d('0x8')](_0x9b0d('0x9'),attributes,{'tableName':_0x9b0d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3dd5=['request-promise','path','rimraf','../../config/environment','./trigger.attributes','define','Trigger','lodash','../../config/logger','api','moment','bluebird'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0x3dd5,0x73));var _0x53dd=function(_0x98133,_0x4e3747){_0x98133=_0x98133-0x0;var _0xd037e1=_0x3dd5[_0x98133];return _0xd037e1;};'use strict';var _=require(_0x53dd('0x0'));var util=require('util');var logger=require(_0x53dd('0x1'))(_0x53dd('0x2'));var moment=require(_0x53dd('0x3'));var BPromise=require(_0x53dd('0x4'));var rp=require(_0x53dd('0x5'));var fs=require('fs');var path=require(_0x53dd('0x6'));var rimraf=require(_0x53dd('0x7'));var config=require(_0x53dd('0x8'));var attributes=require(_0x53dd('0x9'));module['exports']=function(_0x3c8f9e,_0x26c218){return _0x3c8f9e[_0x53dd('0xa')](_0x53dd('0xb'),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 2a5cb51..48e555a 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 _0xbeeb=['raw','where','attributes','limit','include','map','model','ShowTrigger','util','moment','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','Trigger,\x20%s,\x20%s','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetTrigger','Trigger','options'];(function(_0x5a7f64,_0x347d57){var _0x3d30f1=function(_0x4bd1d6){while(--_0x4bd1d6){_0x5a7f64['push'](_0x5a7f64['shift']());}};_0x3d30f1(++_0x347d57);}(_0xbeeb,0x1c8));var _0xbbee=function(_0x4dca39,_0x4a5a3a){_0x4dca39=_0x4dca39-0x0;var _0x5e66c0=_0xbeeb[_0x4dca39];return _0x5e66c0;};'use strict';var _=require('lodash');var util=require(_0xbbee('0x0'));var moment=require(_0xbbee('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbbee('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xbbee('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0xbbee('0x4'));var jayson=require(_0xbbee('0x5'));var client=jayson[_0xbbee('0x6')][_0xbbee('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x19963a,_0x1f0c54,_0x3a51fa){return new BPromise(function(_0x164de3,_0x3a7507){return client[_0xbbee('0x8')](_0x19963a,_0x3a51fa)[_0xbbee('0x9')](function(_0x12b7e8){logger['info'](_0xbbee('0xa'),_0x1f0c54,_0xbbee('0xb'));logger[_0xbbee('0xc')](_0xbbee('0xd'),_0x1f0c54,'request\x20sent',JSON[_0xbbee('0xe')](_0x12b7e8));if(_0x12b7e8['error']){if(_0x12b7e8[_0xbbee('0xf')][_0xbbee('0x10')]===0x1f4){logger[_0xbbee('0xf')]('Trigger,\x20%s,\x20%s',_0x1f0c54,_0x12b7e8[_0xbbee('0xf')][_0xbbee('0x11')]);return _0x3a7507(_0x12b7e8[_0xbbee('0xf')][_0xbbee('0x11')]);}logger[_0xbbee('0xf')]('Trigger,\x20%s,\x20%s',_0x1f0c54,_0x12b7e8[_0xbbee('0xf')]['message']);return _0x164de3(_0x12b7e8[_0xbbee('0xf')][_0xbbee('0x11')]);}else{logger[_0xbbee('0x12')](_0xbbee('0xa'),_0x1f0c54,_0xbbee('0xb'));_0x164de3(_0x12b7e8[_0xbbee('0x13')][_0xbbee('0x11')]);}})[_0xbbee('0x14')](function(_0x182077){logger[_0xbbee('0xf')](_0xbbee('0xa'),_0x1f0c54,_0x182077);_0x3a7507(_0x182077);});});}exports[_0xbbee('0x15')]=function(_0x204c11){var _0x1a7162=this;return new Promise(function(_0x51f211,_0x517797){return db[_0xbbee('0x16')]['findAll']({'raw':_0x204c11[_0xbbee('0x17')]?_0x204c11[_0xbbee('0x17')][_0xbbee('0x18')]===undefined?!![]:![]:!![],'where':_0x204c11[_0xbbee('0x17')]?_0x204c11['options'][_0xbbee('0x19')]||null:null,'attributes':_0x204c11[_0xbbee('0x17')]?_0x204c11[_0xbbee('0x17')][_0xbbee('0x1a')]||null:null,'limit':_0x204c11[_0xbbee('0x17')]?_0x204c11[_0xbbee('0x17')][_0xbbee('0x1b')]||null:null,'include':_0x204c11[_0xbbee('0x17')]?_0x204c11[_0xbbee('0x17')][_0xbbee('0x1c')]?_[_0xbbee('0x1d')](_0x204c11[_0xbbee('0x17')][_0xbbee('0x1c')],function(_0x3621d2){return{'model':db[_0x3621d2[_0xbbee('0x1e')]],'as':_0x3621d2['as'],'attributes':_0x3621d2[_0xbbee('0x1a')],'include':_0x3621d2['include']?_[_0xbbee('0x1d')](_0x3621d2[_0xbbee('0x1c')],function(_0x4ec3ec){return{'model':db[_0x4ec3ec[_0xbbee('0x1e')]],'as':_0x4ec3ec['as'],'attributes':_0x4ec3ec[_0xbbee('0x1a')],'include':_0x4ec3ec[_0xbbee('0x1c')]?_['map'](_0x4ec3ec['include'],function(_0x94fc0b){return{'model':db[_0x94fc0b[_0xbbee('0x1e')]],'as':_0x94fc0b['as'],'attributes':_0x94fc0b[_0xbbee('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4cfc3b){logger['info'](_0xbbee('0x15'),_0x204c11);logger['debug'](_0xbbee('0x15'),_0x204c11,JSON[_0xbbee('0xe')](_0x4cfc3b));_0x51f211(_0x4cfc3b);})[_0xbbee('0x14')](function(_0x5cec57){logger[_0xbbee('0xf')](_0xbbee('0x15'),_0x5cec57[_0xbbee('0x11')],_0x204c11);_0x517797(_0x1a7162['error'](0x1f4,_0x5cec57['message']));});});};exports[_0xbbee('0x1f')]=function(_0x3c3c09){var _0x563d4a=this;return new Promise(function(_0x34fdec,_0x33f867){return db[_0xbbee('0x16')]['find']({'raw':_0x3c3c09[_0xbbee('0x17')]?_0x3c3c09['options']['raw']===undefined?!![]:![]:!![],'where':_0x3c3c09['options']?_0x3c3c09['options'][_0xbbee('0x19')]||null:null,'attributes':_0x3c3c09[_0xbbee('0x17')]?_0x3c3c09[_0xbbee('0x17')][_0xbbee('0x1a')]||null:null,'include':_0x3c3c09['options']?_0x3c3c09['options'][_0xbbee('0x1c')]?_[_0xbbee('0x1d')](_0x3c3c09['options'][_0xbbee('0x1c')],function(_0x395dd5){return{'model':db[_0x395dd5[_0xbbee('0x1e')]],'as':_0x395dd5['as'],'attributes':_0x395dd5['attributes'],'include':_0x395dd5[_0xbbee('0x1c')]?_[_0xbbee('0x1d')](_0x395dd5['include'],function(_0x5cacb1){return{'model':db[_0x5cacb1[_0xbbee('0x1e')]],'as':_0x5cacb1['as'],'attributes':_0x5cacb1[_0xbbee('0x1a')],'include':_0x5cacb1[_0xbbee('0x1c')]?_[_0xbbee('0x1d')](_0x5cacb1[_0xbbee('0x1c')],function(_0x5cde94){return{'model':db[_0x5cde94['model']],'as':_0x5cde94['as'],'attributes':_0x5cde94[_0xbbee('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xbbee('0x9')](function(_0x138177){logger[_0xbbee('0x12')](_0xbbee('0x1f'),_0x3c3c09);logger[_0xbbee('0xc')]('ShowTrigger',_0x3c3c09,JSON['stringify'](_0x138177));_0x34fdec(_0x138177);})[_0xbbee('0x14')](function(_0x4d45ad){logger[_0xbbee('0xf')]('ShowTrigger',_0x4d45ad[_0xbbee('0x11')],_0x3c3c09);_0x33f867(_0x563d4a['error'](0x1f4,_0x4d45ad[_0xbbee('0x11')]));});});}; \ No newline at end of file +var _0x1db7=['map','model','stringify','ShowTrigger','find','debug','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc','client','http','request','then','info','Trigger,\x20%s,\x20%s','request\x20sent','Trigger,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetTrigger','Trigger','findAll','options','raw','where','attributes','include'];(function(_0x337314,_0x23d58b){var _0x3f4e59=function(_0x3248ec){while(--_0x3248ec){_0x337314['push'](_0x337314['shift']());}};_0x3f4e59(++_0x23d58b);}(_0x1db7,0x138));var _0x71db=function(_0x4b3523,_0x4f27c9){_0x4b3523=_0x4b3523-0x0;var _0x164424=_0x1db7[_0x4b3523];return _0x164424;};'use strict';var _=require(_0x71db('0x0'));var util=require(_0x71db('0x1'));var moment=require(_0x71db('0x2'));var BPromise=require(_0x71db('0x3'));var rs=require(_0x71db('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x71db('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x71db('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x71db('0x7')][_0x71db('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x31ce3d,_0x4efd9f,_0x4b94c8){return new BPromise(function(_0x159823,_0x563ccf){return client[_0x71db('0x9')](_0x31ce3d,_0x4b94c8)[_0x71db('0xa')](function(_0x53154f){logger[_0x71db('0xb')](_0x71db('0xc'),_0x4efd9f,_0x71db('0xd'));logger['debug'](_0x71db('0xe'),_0x4efd9f,_0x71db('0xd'),JSON['stringify'](_0x53154f));if(_0x53154f[_0x71db('0xf')]){if(_0x53154f[_0x71db('0xf')][_0x71db('0x10')]===0x1f4){logger['error']('Trigger,\x20%s,\x20%s',_0x4efd9f,_0x53154f['error']['message']);return _0x563ccf(_0x53154f[_0x71db('0xf')][_0x71db('0x11')]);}logger[_0x71db('0xf')](_0x71db('0xc'),_0x4efd9f,_0x53154f[_0x71db('0xf')][_0x71db('0x11')]);return _0x159823(_0x53154f[_0x71db('0xf')][_0x71db('0x11')]);}else{logger[_0x71db('0xb')]('Trigger,\x20%s,\x20%s',_0x4efd9f,_0x71db('0xd'));_0x159823(_0x53154f[_0x71db('0x12')][_0x71db('0x11')]);}})[_0x71db('0x13')](function(_0x47295d){logger[_0x71db('0xf')](_0x71db('0xc'),_0x4efd9f,_0x47295d);_0x563ccf(_0x47295d);});});}exports[_0x71db('0x14')]=function(_0x3083a7){var _0x2090ca=this;return new Promise(function(_0x56a2ff,_0x47b603){return db[_0x71db('0x15')][_0x71db('0x16')]({'raw':_0x3083a7['options']?_0x3083a7[_0x71db('0x17')][_0x71db('0x18')]===undefined?!![]:![]:!![],'where':_0x3083a7[_0x71db('0x17')]?_0x3083a7[_0x71db('0x17')][_0x71db('0x19')]||null:null,'attributes':_0x3083a7[_0x71db('0x17')]?_0x3083a7[_0x71db('0x17')][_0x71db('0x1a')]||null:null,'limit':_0x3083a7[_0x71db('0x17')]?_0x3083a7['options']['limit']||null:null,'include':_0x3083a7['options']?_0x3083a7[_0x71db('0x17')][_0x71db('0x1b')]?_[_0x71db('0x1c')](_0x3083a7[_0x71db('0x17')][_0x71db('0x1b')],function(_0x12f193){return{'model':db[_0x12f193[_0x71db('0x1d')]],'as':_0x12f193['as'],'attributes':_0x12f193[_0x71db('0x1a')],'include':_0x12f193['include']?_['map'](_0x12f193['include'],function(_0x4b6571){return{'model':db[_0x4b6571[_0x71db('0x1d')]],'as':_0x4b6571['as'],'attributes':_0x4b6571['attributes'],'include':_0x4b6571[_0x71db('0x1b')]?_[_0x71db('0x1c')](_0x4b6571['include'],function(_0xe9ac4f){return{'model':db[_0xe9ac4f[_0x71db('0x1d')]],'as':_0xe9ac4f['as'],'attributes':_0xe9ac4f[_0x71db('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x71db('0xa')](function(_0x4635bb){logger[_0x71db('0xb')](_0x71db('0x14'),_0x3083a7);logger['debug'](_0x71db('0x14'),_0x3083a7,JSON[_0x71db('0x1e')](_0x4635bb));_0x56a2ff(_0x4635bb);})['catch'](function(_0x364af2){logger[_0x71db('0xf')](_0x71db('0x14'),_0x364af2[_0x71db('0x11')],_0x3083a7);_0x47b603(_0x2090ca[_0x71db('0xf')](0x1f4,_0x364af2[_0x71db('0x11')]));});});};exports[_0x71db('0x1f')]=function(_0x167a61){var _0x31b67e=this;return new Promise(function(_0xed121c,_0x38b325){return db['Trigger'][_0x71db('0x20')]({'raw':_0x167a61[_0x71db('0x17')]?_0x167a61['options'][_0x71db('0x18')]===undefined?!![]:![]:!![],'where':_0x167a61[_0x71db('0x17')]?_0x167a61[_0x71db('0x17')][_0x71db('0x19')]||null:null,'attributes':_0x167a61[_0x71db('0x17')]?_0x167a61['options']['attributes']||null:null,'include':_0x167a61['options']?_0x167a61[_0x71db('0x17')][_0x71db('0x1b')]?_[_0x71db('0x1c')](_0x167a61[_0x71db('0x17')][_0x71db('0x1b')],function(_0x2f8354){return{'model':db[_0x2f8354[_0x71db('0x1d')]],'as':_0x2f8354['as'],'attributes':_0x2f8354['attributes'],'include':_0x2f8354[_0x71db('0x1b')]?_[_0x71db('0x1c')](_0x2f8354[_0x71db('0x1b')],function(_0x4d00cb){return{'model':db[_0x4d00cb[_0x71db('0x1d')]],'as':_0x4d00cb['as'],'attributes':_0x4d00cb[_0x71db('0x1a')],'include':_0x4d00cb['include']?_[_0x71db('0x1c')](_0x4d00cb[_0x71db('0x1b')],function(_0x1db185){return{'model':db[_0x1db185[_0x71db('0x1d')]],'as':_0x1db185['as'],'attributes':_0x1db185[_0x71db('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x71db('0xa')](function(_0x5989e5){logger[_0x71db('0xb')](_0x71db('0x1f'),_0x167a61);logger[_0x71db('0x21')](_0x71db('0x1f'),_0x167a61,JSON[_0x71db('0x1e')](_0x5989e5));_0xed121c(_0x5989e5);})[_0x71db('0x13')](function(_0x53a684){logger[_0x71db('0xf')](_0x71db('0x1f'),_0x53a684[_0x71db('0x11')],_0x167a61);_0x38b325(_0x31b67e[_0x71db('0xf')](0x1f4,_0x53a684[_0x71db('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index d7f5ff4..343f79b 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 _0x2db5=['create','put','/:id','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','post','clone'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0x2db5,0x123));var _0x52db=function(_0xdad237,_0x361a1d){_0xdad237=_0xdad237-0x0;var _0x15c575=_0x2db5[_0xdad237];return _0x15c575;};'use strict';var multer=require(_0x52db('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x52db('0x1'));var express=require(_0x52db('0x2'));var router=express[_0x52db('0x3')]();var fs_extra=require(_0x52db('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x52db('0x5'));var config=require(_0x52db('0x6'));var controller=require('./trunk.controller');router[_0x52db('0x7')]('/',auth[_0x52db('0x8')](),controller[_0x52db('0x9')]);router['get']('/:id',auth[_0x52db('0x8')](),controller[_0x52db('0xa')]);router[_0x52db('0xb')]('/:id/clone',auth[_0x52db('0x8')](),controller[_0x52db('0xc')]);router[_0x52db('0xb')]('/',auth[_0x52db('0x8')](),controller[_0x52db('0xd')]);router[_0x52db('0xe')](_0x52db('0xf'),auth[_0x52db('0x8')](),controller['update']);router[_0x52db('0x10')](_0x52db('0xf'),auth[_0x52db('0x8')](),controller[_0x52db('0x11')]);module[_0x52db('0x12')]=router; \ No newline at end of file +var _0x799d=['/:id','isAuthenticated','show','post','clone','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./trunk.controller','get','index'];(function(_0x4843f9,_0x4af459){var _0x193c6a=function(_0x51eca9){while(--_0x51eca9){_0x4843f9['push'](_0x4843f9['shift']());}};_0x193c6a(++_0x4af459);}(_0x799d,0x105));var _0xd799=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x799d[_0x21a9d9];return _0x46adce;};'use strict';var multer=require(_0xd799('0x0'));var util=require(_0xd799('0x1'));var path=require(_0xd799('0x2'));var timeout=require(_0xd799('0x3'));var express=require(_0xd799('0x4'));var router=express[_0xd799('0x5')]();var fs_extra=require(_0xd799('0x6'));var auth=require(_0xd799('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xd799('0x8'));var controller=require(_0xd799('0x9'));router[_0xd799('0xa')]('/',auth['isAuthenticated'](),controller[_0xd799('0xb')]);router[_0xd799('0xa')](_0xd799('0xc'),auth[_0xd799('0xd')](),controller[_0xd799('0xe')]);router[_0xd799('0xf')]('/:id/clone',auth[_0xd799('0xd')](),controller[_0xd799('0x10')]);router[_0xd799('0xf')]('/',auth[_0xd799('0xd')](),controller['create']);router[_0xd799('0x11')](_0xd799('0xc'),auth[_0xd799('0xd')](),controller['update']);router[_0xd799('0x12')](_0xd799('0xc'),auth[_0xd799('0xd')](),controller[_0xd799('0x13')]);module[_0xd799('0x14')]=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index 0c0649b..ad4e5da 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 _0x777d=['ENUM','friend','user','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','getDataValue','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','yes','nonat','outgoing','force_rport,comedia','nat','join','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\x22alaw\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','\x22\x22\x20<>','always','refuse','originate','pai','passive','actpass','update','update,nonat','sequelize','STRING','name'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x777d,0x185));var _0xd777=function(_0x2cff4f,_0x21e344){_0x2cff4f=_0x2cff4f-0x0;var _0x3df848=_0x777d[_0x2cff4f];return _0x3df848;};'use strict';var Sequelize=require(_0xd777('0x0'));module['exports']={'name':{'type':Sequelize[_0xd777('0x1')],'allowNull':![],'unique':_0xd777('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xd777('0x3')](_0xd777('0x4'),_0xd777('0x5'),'peer'),'allowNull':![],'defaultValue':_0xd777('0x4')},'context':{'type':Sequelize[_0xd777('0x1')],'allowNull':![],'defaultValue':_0xd777('0x6')},'callingpres':{'type':Sequelize[_0xd777('0x3')](_0xd777('0x7'),_0xd777('0x8'),_0xd777('0x9'),_0xd777('0xa'),_0xd777('0xb'),_0xd777('0xc'),_0xd777('0xd'),_0xd777('0xe'))},'deny':{'type':Sequelize[_0xd777('0x1')]},'permit':{'type':Sequelize[_0xd777('0x1')]},'secret':{'type':Sequelize[_0xd777('0x1')]},'md5secret':{'type':Sequelize[_0xd777('0x1')]},'remotesecret':{'type':Sequelize[_0xd777('0x1')]},'transport':{'type':Sequelize[_0xd777('0x1')],'defaultValue':_0xd777('0xf'),'set':function(_0x156d8c){this[_0xd777('0x10')]('transport',_0x156d8c?_0x156d8c['join'](','):null);},'get':function(){return this[_0xd777('0x11')](_0xd777('0x12'))?this[_0xd777('0x11')]('transport')[_0xd777('0x13')](','):null;},'comment':_0xd777('0x14')},'dtmfmode':{'type':Sequelize['ENUM'](_0xd777('0x15'),_0xd777('0x16'),_0xd777('0x17'),_0xd777('0x18'),'auto'),'defaultValue':_0xd777('0x15')},'directmedia':{'type':Sequelize[_0xd777('0x3')](_0xd777('0x19'),'no',_0xd777('0x1a'),'update',_0xd777('0x1b')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xd777('0x3')](_0xd777('0x19'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xd777('0x1')]},'directmediadeny':{'type':Sequelize[_0xd777('0x1')]},'nat':{'type':Sequelize[_0xd777('0x1')],'defaultValue':_0xd777('0x1c'),'set':function(_0x395c98){this[_0xd777('0x10')](_0xd777('0x1d'),_0x395c98?_0x395c98[_0xd777('0x1e')](','):null);},'get':function(){return this[_0xd777('0x11')](_0xd777('0x1d'))?this[_0xd777('0x11')](_0xd777('0x1d'))['split'](','):null;},'comment':_0xd777('0x1f')},'callgroup':{'type':Sequelize[_0xd777('0x1')]},'namedcallgroup':{'type':Sequelize[_0xd777('0x1')]},'pickupgroup':{'type':Sequelize[_0xd777('0x1')]},'namedpickupgroup':{'type':Sequelize[_0xd777('0x1')]},'language':{'type':Sequelize[_0xd777('0x1')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xd777('0x1')],'allowNull':!![]},'disallow':{'type':Sequelize[_0xd777('0x1')],'defaultValue':_0xd777('0x20')},'allow':{'type':Sequelize[_0xd777('0x1')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x5e856d){this['setDataValue'](_0xd777('0x21'),_0x5e856d?_0x5e856d[_0xd777('0x1e')](';'):_0xd777('0x22'));},'get':function(){return this[_0xd777('0x11')](_0xd777('0x21'))?this[_0xd777('0x11')](_0xd777('0x21'))[_0xd777('0x13')](';'):null;},'comment':_0xd777('0x23')},'autoframing':{'type':Sequelize[_0xd777('0x3')](_0xd777('0x19'),'no')},'insecure':{'type':Sequelize[_0xd777('0x1')],'defaultValue':'port,invite','set':function(_0x1accf9){this[_0xd777('0x10')](_0xd777('0x24'),_0x1accf9?_0x1accf9[_0xd777('0x1e')](','):null);},'get':function(){return this['getDataValue'](_0xd777('0x24'))?this['getDataValue'](_0xd777('0x24'))[_0xd777('0x13')](','):null;},'comment':_0xd777('0x25')},'trustrpid':{'type':Sequelize['ENUM'](_0xd777('0x19'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xd777('0x3')](_0xd777('0x19'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM']('yes','no',_0xd777('0x26'))},'promiscredir':{'type':Sequelize['ENUM']('yes','no')},'useclientcode':{'type':Sequelize[_0xd777('0x3')](_0xd777('0x19'),'no')},'accountcode':{'type':Sequelize[_0xd777('0x27')](0xb)},'setvar':{'type':Sequelize[_0xd777('0x1')]},'callerid':{'type':Sequelize[_0xd777('0x1')],'defaultValue':_0xd777('0x28')},'amaflags':{'type':Sequelize[_0xd777('0x1')]},'callcounter':{'type':Sequelize['ENUM'](_0xd777('0x19'),'no'),'defaultValue':_0xd777('0x19')},'busylevel':{'type':Sequelize[_0xd777('0x27')](0xb)},'allowoverlap':{'type':Sequelize['ENUM'](_0xd777('0x19'),'no')},'allowsubscribe':{'type':Sequelize[_0xd777('0x3')]('yes','no')},'allowtransfer':{'type':Sequelize['ENUM'](_0xd777('0x19'),'no')},'ignoresdpversion':{'type':Sequelize[_0xd777('0x3')]('yes','no')},'subscribecontext':{'type':Sequelize['STRING']},'template':{'type':Sequelize[_0xd777('0x1')]},'videosupport':{'type':Sequelize[_0xd777('0x3')](_0xd777('0x19'),'no',_0xd777('0x29')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xd777('0x27')](0xb)},'rfc2833compensate':{'type':Sequelize['ENUM'](_0xd777('0x19'),'no')},'mailbox':{'type':Sequelize[_0xd777('0x1')]},'session_timers':{'type':Sequelize[_0xd777('0x3')]('accept',_0xd777('0x2a'),_0xd777('0x2b'))},'session_expires':{'type':Sequelize['INTEGER'](0xb)},'session_minse':{'type':Sequelize[_0xd777('0x27')](0xb)},'session_refresher':{'type':Sequelize[_0xd777('0x3')]('uac','uas'),'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0xd777('0x1')]},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize[_0xd777('0x1')]},'fromuser':{'type':Sequelize[_0xd777('0x1')]},'port':{'type':Sequelize[_0xd777('0x27')](0x5)},'qualify':{'type':Sequelize[_0xd777('0x3')](_0xd777('0x19'),'no'),'defaultValue':_0xd777('0x19')},'keepalive':{'type':Sequelize[_0xd777('0x27')](0xb)},'defaultip':{'type':Sequelize['STRING']},'defaultuser':{'type':Sequelize[_0xd777('0x1')]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpholdtimeout':{'type':Sequelize[_0xd777('0x27')](0xb)},'rtpkeepalive':{'type':Sequelize[_0xd777('0x27')](0xb)},'sendrpid':{'type':Sequelize['ENUM'](_0xd777('0x19'),'no',_0xd777('0x2c')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xd777('0x1')]},'callbackextension':{'type':Sequelize[_0xd777('0x1')]},'timert1':{'type':Sequelize['INTEGER'](0xb)},'timerb':{'type':Sequelize[_0xd777('0x27')](0xb)},'qualifyfreq':{'type':Sequelize[_0xd777('0x27')](0xb)},'contactpermit':{'type':Sequelize[_0xd777('0x1')]},'contactdeny':{'type':Sequelize[_0xd777('0x1')]},'contactacl':{'type':Sequelize[_0xd777('0x1')]},'unsolicited_mailbox':{'type':Sequelize['STRING']},'use_q850_reason':{'type':Sequelize[_0xd777('0x1')]},'maxforwards':{'type':Sequelize['INTEGER'](0xb)},'encryption':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0xd777('0x19'),'no')},'force_avp':{'type':Sequelize[_0xd777('0x3')](_0xd777('0x19'),'no')},'icesupport':{'type':Sequelize['ENUM'](_0xd777('0x19'),'no')},'dtlsenable':{'type':Sequelize[_0xd777('0x3')](_0xd777('0x19'),'no')},'dtlsverify':{'type':Sequelize[_0xd777('0x3')]('yes','no','fingerprint','certificate')},'dtlsrekey':{'type':Sequelize[_0xd777('0x27')](0xb)},'dtlscertfile':{'type':Sequelize[_0xd777('0x1')]},'dtlsprivatekey':{'type':Sequelize[_0xd777('0x1')]},'dtlscipher':{'type':Sequelize[_0xd777('0x1')]},'dtlscafile':{'type':Sequelize[_0xd777('0x1')]},'dtlscapath':{'type':Sequelize[_0xd777('0x1')]},'dtlssetup':{'type':Sequelize[_0xd777('0x3')]('active',_0xd777('0x2d'),_0xd777('0x2e')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING']},'usereqphone':{'type':Sequelize[_0xd777('0x3')]('yes','no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xd777('0x1')]},'recordofffeature':{'type':Sequelize[_0xd777('0x1')]},'call_limit':{'type':Sequelize[_0xd777('0x27')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0xd777('0x3')](_0xd777('0x19'),'no')},'subscribemwi':{'type':Sequelize[_0xd777('0x3')](_0xd777('0x19'),'no')},'vmexten':{'type':Sequelize[_0xd777('0x1')]},'mohinterpret':{'type':Sequelize[_0xd777('0x1')]},'mohsuggest':{'type':Sequelize[_0xd777('0x1')]},'parkinglot':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xd777('0x1')]},'host':{'type':Sequelize[_0xd777('0x1')],'defaultValue':'dynamic'},'canreinvite':{'type':Sequelize[_0xd777('0x3')](_0xd777('0x19'),'no',_0xd777('0x1a'),_0xd777('0x2f'),_0xd777('0x30')),'defaultValue':'no'},'registry':{'type':Sequelize[_0xd777('0x1')]},'otherFields':{'type':Sequelize[_0xd777('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0xd777('0x1')],'defaultValue':'no'}}; \ No newline at end of file +var _0xa83e=['sequelize','name','friend','user','STRING','ENUM','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','setDataValue','transport','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','nonat','update','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','join','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','\x22\x22\x20<>','INTEGER','always','refuse','uac','uas','pai','active','actpass','update,nonat'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xa83e,0x1f4));var _0xea83=function(_0x1e03e4,_0x362f76){_0x1e03e4=_0x1e03e4-0x0;var _0x4a887e=_0xa83e[_0x1e03e4];return _0x4a887e;};'use strict';var Sequelize=require(_0xea83('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xea83('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0xea83('0x2'),_0xea83('0x3'),'peer'),'allowNull':![],'defaultValue':_0xea83('0x2')},'context':{'type':Sequelize[_0xea83('0x4')],'allowNull':![],'defaultValue':'from-voip-provider'},'callingpres':{'type':Sequelize[_0xea83('0x5')](_0xea83('0x6'),_0xea83('0x7'),_0xea83('0x8'),_0xea83('0x9'),_0xea83('0xa'),_0xea83('0xb'),_0xea83('0xc'),_0xea83('0xd'))},'deny':{'type':Sequelize[_0xea83('0x4')]},'permit':{'type':Sequelize[_0xea83('0x4')]},'secret':{'type':Sequelize['STRING']},'md5secret':{'type':Sequelize[_0xea83('0x4')]},'remotesecret':{'type':Sequelize[_0xea83('0x4')]},'transport':{'type':Sequelize[_0xea83('0x4')],'defaultValue':'udp','set':function(_0x22d3c1){this[_0xea83('0xe')]('transport',_0x22d3c1?_0x22d3c1['join'](','):null);},'get':function(){return this['getDataValue'](_0xea83('0xf'))?this[_0xea83('0x10')](_0xea83('0xf'))[_0xea83('0x11')](','):null;},'comment':_0xea83('0x12')},'dtmfmode':{'type':Sequelize[_0xea83('0x5')](_0xea83('0x13'),_0xea83('0x14'),_0xea83('0x15'),_0xea83('0x16'),_0xea83('0x17')),'defaultValue':_0xea83('0x13')},'directmedia':{'type':Sequelize[_0xea83('0x5')](_0xea83('0x18'),'no',_0xea83('0x19'),_0xea83('0x1a'),_0xea83('0x1b')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xea83('0x5')]('yes','no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xea83('0x4')]},'directmediadeny':{'type':Sequelize[_0xea83('0x4')]},'nat':{'type':Sequelize['STRING'],'defaultValue':_0xea83('0x1c'),'set':function(_0x1f4c6d){this['setDataValue'](_0xea83('0x1d'),_0x1f4c6d?_0x1f4c6d['join'](','):null);},'get':function(){return this[_0xea83('0x10')](_0xea83('0x1d'))?this[_0xea83('0x10')](_0xea83('0x1d'))['split'](','):null;},'comment':_0xea83('0x1e')},'callgroup':{'type':Sequelize[_0xea83('0x4')]},'namedcallgroup':{'type':Sequelize[_0xea83('0x4')]},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0xea83('0x4')]},'language':{'type':Sequelize[_0xea83('0x4')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xea83('0x4')],'allowNull':!![]},'disallow':{'type':Sequelize['STRING'],'defaultValue':_0xea83('0x1f')},'allow':{'type':Sequelize[_0xea83('0x4')],'allowNull':![],'defaultValue':_0xea83('0x20'),'set':function(_0x2f0f23){this[_0xea83('0xe')](_0xea83('0x21'),_0x2f0f23?_0x2f0f23[_0xea83('0x22')](';'):_0xea83('0x20'));},'get':function(){return this[_0xea83('0x10')](_0xea83('0x21'))?this['getDataValue'](_0xea83('0x21'))[_0xea83('0x11')](';'):null;},'comment':_0xea83('0x23')},'autoframing':{'type':Sequelize[_0xea83('0x5')]('yes','no')},'insecure':{'type':Sequelize[_0xea83('0x4')],'defaultValue':_0xea83('0x24'),'set':function(_0x3e7fb4){this[_0xea83('0xe')](_0xea83('0x25'),_0x3e7fb4?_0x3e7fb4[_0xea83('0x22')](','):null);},'get':function(){return this[_0xea83('0x10')](_0xea83('0x25'))?this['getDataValue'](_0xea83('0x25'))[_0xea83('0x11')](','):null;},'comment':_0xea83('0x26')},'trustrpid':{'type':Sequelize[_0xea83('0x5')]('yes','no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xea83('0x5')](_0xea83('0x18'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xea83('0x5')](_0xea83('0x18'),'no',_0xea83('0x27'))},'promiscredir':{'type':Sequelize[_0xea83('0x5')]('yes','no')},'useclientcode':{'type':Sequelize['ENUM'](_0xea83('0x18'),'no')},'accountcode':{'type':Sequelize['INTEGER'](0xb)},'setvar':{'type':Sequelize[_0xea83('0x4')]},'callerid':{'type':Sequelize[_0xea83('0x4')],'defaultValue':_0xea83('0x28')},'amaflags':{'type':Sequelize['STRING']},'callcounter':{'type':Sequelize[_0xea83('0x5')](_0xea83('0x18'),'no'),'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0xea83('0x29')](0xb)},'allowoverlap':{'type':Sequelize[_0xea83('0x5')](_0xea83('0x18'),'no')},'allowsubscribe':{'type':Sequelize[_0xea83('0x5')]('yes','no')},'allowtransfer':{'type':Sequelize[_0xea83('0x5')](_0xea83('0x18'),'no')},'ignoresdpversion':{'type':Sequelize[_0xea83('0x5')](_0xea83('0x18'),'no')},'subscribecontext':{'type':Sequelize[_0xea83('0x4')]},'template':{'type':Sequelize[_0xea83('0x4')]},'videosupport':{'type':Sequelize['ENUM']('yes','no',_0xea83('0x2a')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xea83('0x29')](0xb)},'rfc2833compensate':{'type':Sequelize[_0xea83('0x5')](_0xea83('0x18'),'no')},'mailbox':{'type':Sequelize[_0xea83('0x4')]},'session_timers':{'type':Sequelize[_0xea83('0x5')]('accept',_0xea83('0x2b'),'originate')},'session_expires':{'type':Sequelize[_0xea83('0x29')](0xb)},'session_minse':{'type':Sequelize['INTEGER'](0xb)},'session_refresher':{'type':Sequelize[_0xea83('0x5')](_0xea83('0x2c'),_0xea83('0x2d')),'defaultValue':_0xea83('0x2d')},'t38pt_usertpsource':{'type':Sequelize['STRING']},'regexten':{'type':Sequelize[_0xea83('0x4')]},'fromdomain':{'type':Sequelize['STRING']},'fromuser':{'type':Sequelize[_0xea83('0x4')]},'port':{'type':Sequelize[_0xea83('0x29')](0x5)},'qualify':{'type':Sequelize[_0xea83('0x5')](_0xea83('0x18'),'no'),'defaultValue':_0xea83('0x18')},'keepalive':{'type':Sequelize[_0xea83('0x29')](0xb)},'defaultip':{'type':Sequelize[_0xea83('0x4')]},'defaultuser':{'type':Sequelize[_0xea83('0x4')]},'rtptimeout':{'type':Sequelize[_0xea83('0x29')](0xb)},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpkeepalive':{'type':Sequelize[_0xea83('0x29')](0xb)},'sendrpid':{'type':Sequelize[_0xea83('0x5')](_0xea83('0x18'),'no',_0xea83('0x2e')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING']},'callbackextension':{'type':Sequelize[_0xea83('0x4')]},'timert1':{'type':Sequelize[_0xea83('0x29')](0xb)},'timerb':{'type':Sequelize[_0xea83('0x29')](0xb)},'qualifyfreq':{'type':Sequelize[_0xea83('0x29')](0xb)},'contactpermit':{'type':Sequelize['STRING']},'contactdeny':{'type':Sequelize[_0xea83('0x4')]},'contactacl':{'type':Sequelize['STRING']},'unsolicited_mailbox':{'type':Sequelize[_0xea83('0x4')]},'use_q850_reason':{'type':Sequelize['STRING']},'maxforwards':{'type':Sequelize['INTEGER'](0xb)},'encryption':{'type':Sequelize[_0xea83('0x5')](_0xea83('0x18'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0xea83('0x5')](_0xea83('0x18'),'no')},'force_avp':{'type':Sequelize[_0xea83('0x5')](_0xea83('0x18'),'no')},'icesupport':{'type':Sequelize[_0xea83('0x5')](_0xea83('0x18'),'no')},'dtlsenable':{'type':Sequelize['ENUM'](_0xea83('0x18'),'no')},'dtlsverify':{'type':Sequelize[_0xea83('0x5')](_0xea83('0x18'),'no','fingerprint','certificate')},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb)},'dtlscertfile':{'type':Sequelize[_0xea83('0x4')]},'dtlsprivatekey':{'type':Sequelize['STRING']},'dtlscipher':{'type':Sequelize[_0xea83('0x4')]},'dtlscafile':{'type':Sequelize[_0xea83('0x4')]},'dtlscapath':{'type':Sequelize[_0xea83('0x4')]},'dtlssetup':{'type':Sequelize['ENUM'](_0xea83('0x2f'),'passive',_0xea83('0x30')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xea83('0x4')]},'usereqphone':{'type':Sequelize[_0xea83('0x5')]('yes','no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xea83('0x4')]},'recordofffeature':{'type':Sequelize[_0xea83('0x4')]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize['ENUM'](_0xea83('0x18'),'no')},'subscribemwi':{'type':Sequelize[_0xea83('0x5')](_0xea83('0x18'),'no')},'vmexten':{'type':Sequelize[_0xea83('0x4')]},'mohinterpret':{'type':Sequelize[_0xea83('0x4')]},'mohsuggest':{'type':Sequelize[_0xea83('0x4')]},'parkinglot':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xea83('0x4')]},'host':{'type':Sequelize[_0xea83('0x4')],'defaultValue':'dynamic'},'canreinvite':{'type':Sequelize['ENUM'](_0xea83('0x18'),'no',_0xea83('0x19'),'update',_0xea83('0x31')),'defaultValue':'no'},'registry':{'type':Sequelize[_0xea83('0x4')]},'otherFields':{'type':Sequelize[_0xea83('0x4')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0xea83('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 a04ee32..faa3448 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 _0xf2ca=['omit','createdAt','body','updatedAt','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','join','root','server/files/templates/trunk.ejs','utf8','render','writeFileSync','registry','/etc/asterisk/sip_xcally_registers.conf','Unable\x20to\x20retrieve\x20the\x20current\x20user','server/files/templates/registry.ejs','/etc/asterisk/sip_xcally_trunks.conf','Reload','chan_sip.so','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','jayson/promise','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','end','json','offset','limit','count','set','Content-Range','apply','save','update','destroy','get','Trunks','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','pick','filter','where','merge','options','includeAll','include','findAll','show','params','Trunk','find','clone'];(function(_0x81b09f,_0x59649c){var _0x18d42d=function(_0x231339){while(--_0x231339){_0x81b09f['push'](_0x81b09f['shift']());}};_0x18d42d(++_0x59649c);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x5341ff,_0x1de6df){_0x5341ff=_0x5341ff-0x0;var _0x53be58=_0xf2ca[_0x5341ff];return _0x53be58;};'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'];var jayson=require(_0xaf2c('0x18'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x15ccb4,_0x8eaf9b,_0x935959,_0x18a8a5){return new BPromise(function(_0x293ca6,_0x152c73){var _0x214f47=_0x18a8a5||client;return _0x214f47[_0xaf2c('0x19')](_0x15ccb4,_0x935959)[_0xaf2c('0x1a')](function(_0x1d0633){logger[_0xaf2c('0x1b')](_0xaf2c('0x1c'),_0x8eaf9b,_0xaf2c('0x1d'));logger[_0xaf2c('0x1e')](_0xaf2c('0x1f'),_0x8eaf9b,'request\x20sent',JSON[_0xaf2c('0x20')](_0x1d0633));if(_0x1d0633['error']){if(_0x1d0633[_0xaf2c('0x21')][_0xaf2c('0x22')]===0x1f4){logger[_0xaf2c('0x21')]('Trunk,\x20%s,\x20%s',_0x8eaf9b,_0x1d0633[_0xaf2c('0x21')][_0xaf2c('0x23')]);return _0x152c73(_0x1d0633[_0xaf2c('0x21')][_0xaf2c('0x23')]);}logger[_0xaf2c('0x21')](_0xaf2c('0x1c'),_0x8eaf9b,_0x1d0633['error'][_0xaf2c('0x23')]);return _0x293ca6(_0x1d0633[_0xaf2c('0x21')][_0xaf2c('0x23')]);}else{logger[_0xaf2c('0x1b')](_0xaf2c('0x1c'),_0x8eaf9b,'request\x20sent');_0x293ca6(_0x1d0633[_0xaf2c('0x24')][_0xaf2c('0x23')]);}})[_0xaf2c('0x25')](function(_0x4be6ed){logger['error'](_0xaf2c('0x1c'),_0x8eaf9b,_0x4be6ed);_0x152c73(_0x4be6ed);});});}function respondWithStatusCode(_0x303546,_0x1cafad){_0x1cafad=_0x1cafad||0xcc;return function(_0x99f78d){if(_0x99f78d){return _0x303546['sendStatus'](_0x1cafad);}return _0x303546[_0xaf2c('0x26')](_0x1cafad)[_0xaf2c('0x27')]();};}function respondWithResult(_0x3a0145,_0x3c1ae6){_0x3c1ae6=_0x3c1ae6||0xc8;return function(_0xe929b5){if(_0xe929b5){return _0x3a0145[_0xaf2c('0x26')](_0x3c1ae6)[_0xaf2c('0x28')](_0xe929b5);}};}function respondWithFilteredResult(_0x4a8dd8,_0x29f8b0){return function(_0x2051be){if(_0x2051be){var _0x36f37c=typeof _0x29f8b0[_0xaf2c('0x29')]==='undefined'&&typeof _0x29f8b0[_0xaf2c('0x2a')]==='undefined';var _0x38db1b=_0x2051be[_0xaf2c('0x2b')];var _0x15466b=_0x36f37c?0x0:_0x29f8b0['offset'];var _0x2747bb=_0x36f37c?_0x2051be[_0xaf2c('0x2b')]:_0x29f8b0[_0xaf2c('0x29')]+_0x29f8b0['limit'];var _0xe18ba7;if(_0x2747bb>=_0x38db1b){_0x2747bb=_0x38db1b;_0xe18ba7=0xc8;}else{_0xe18ba7=0xce;}_0x4a8dd8[_0xaf2c('0x26')](_0xe18ba7);return _0x4a8dd8[_0xaf2c('0x2c')](_0xaf2c('0x2d'),_0x15466b+'-'+_0x2747bb+'/'+_0x38db1b)['json'](_0x2051be);}return null;};}function patchUpdates(_0x3da072){return function(_0x4072ff){try{jsonpatch[_0xaf2c('0x2e')](_0x4072ff,_0x3da072,!![]);}catch(_0x51a49c){return BPromise['reject'](_0x51a49c);}return _0x4072ff[_0xaf2c('0x2f')]();};}function saveUpdates(_0x4c9b4f,_0x39c0ed){return function(_0x5e7247){if(_0x5e7247){return _0x5e7247[_0xaf2c('0x30')](_0x4c9b4f)[_0xaf2c('0x1a')](function(_0x4ffbb9){return _0x4ffbb9;});}return null;};}function removeEntity(_0x1408e3,_0x5403f8){return function(_0x54db57){if(_0x54db57){return _0x54db57[_0xaf2c('0x31')]()[_0xaf2c('0x1a')](function(){var _0x211a69=_0x54db57[_0xaf2c('0x32')]({'plain':!![]});var _0x2d6ed7=_0xaf2c('0x33');return db['UserProfileResource'][_0xaf2c('0x31')]({'where':{'type':_0x2d6ed7,'resourceId':_0x211a69['id']}})['then'](function(){return _0x54db57;});})[_0xaf2c('0x1a')](function(){_0x1408e3['status'](0xcc)[_0xaf2c('0x27')]();});}};}function handleEntityNotFound(_0x59f686,_0x2f3d16){return function(_0x4e877e){if(!_0x4e877e){_0x59f686[_0xaf2c('0x34')](0x194);}return _0x4e877e;};}function handleError(_0x4b9c6b,_0x30fd87){_0x30fd87=_0x30fd87||0x1f4;return function(_0x356402){logger[_0xaf2c('0x21')](_0x356402[_0xaf2c('0x35')]);if(_0x356402[_0xaf2c('0x36')]){delete _0x356402['name'];}_0x4b9c6b['status'](_0x30fd87)[_0xaf2c('0x37')](_0x356402);};}exports[_0xaf2c('0x38')]=function(_0x409700,_0xa44813){var _0x4eeecf={},_0x316238={},_0x573db3={'count':0x0,'rows':[]};var _0xa1248e=_[_0xaf2c('0x39')](db['Trunk'][_0xaf2c('0x3a')],function(_0x24668d){return{'name':_0x24668d[_0xaf2c('0x3b')],'type':_0x24668d[_0xaf2c('0x3c')][_0xaf2c('0x3d')]};});_0x316238[_0xaf2c('0x3e')]=_[_0xaf2c('0x39')](_0xa1248e,_0xaf2c('0x36'));_0x316238[_0xaf2c('0x3f')]=_[_0xaf2c('0x40')](_0x409700[_0xaf2c('0x3f')]);_0x316238[_0xaf2c('0x41')]=_[_0xaf2c('0x42')](_0x316238['model'],_0x316238['query']);_0x4eeecf['attributes']=_[_0xaf2c('0x42')](_0x316238[_0xaf2c('0x3e')],qs[_0xaf2c('0x43')](_0x409700[_0xaf2c('0x3f')][_0xaf2c('0x43')]));_0x4eeecf[_0xaf2c('0x44')]=_0x4eeecf['attributes'][_0xaf2c('0x45')]?_0x4eeecf[_0xaf2c('0x44')]:_0x316238[_0xaf2c('0x3e')];if(!_0x409700['query']['hasOwnProperty'](_0xaf2c('0x46'))){_0x4eeecf['limit']=qs[_0xaf2c('0x2a')](_0x409700[_0xaf2c('0x3f')][_0xaf2c('0x2a')]);_0x4eeecf[_0xaf2c('0x29')]=qs['offset'](_0x409700[_0xaf2c('0x3f')]['offset']);}_0x4eeecf[_0xaf2c('0x47')]=qs[_0xaf2c('0x48')](_0x409700['query'][_0xaf2c('0x48')]);_0x4eeecf['where']=qs[_0xaf2c('0x41')](_[_0xaf2c('0x49')](_0x409700[_0xaf2c('0x3f')],_0x316238[_0xaf2c('0x41')]),_0xa1248e);if(_0x409700[_0xaf2c('0x3f')][_0xaf2c('0x4a')]){_0x4eeecf[_0xaf2c('0x4b')]=_[_0xaf2c('0x4c')](_0x4eeecf[_0xaf2c('0x4b')],{'$or':_['map'](_0xa1248e,function(_0x51d751){if(_0x51d751[_0xaf2c('0x3c')]!=='VIRTUAL'){var _0x4ad36e={};_0x4ad36e[_0x51d751['name']]={'$like':'%'+_0x409700[_0xaf2c('0x3f')][_0xaf2c('0x4a')]+'%'};return _0x4ad36e;}})});}_0x4eeecf=_[_0xaf2c('0x4c')]({},_0x4eeecf,_0x409700[_0xaf2c('0x4d')]);var _0x599b2d={'where':_0x4eeecf[_0xaf2c('0x4b')]};return db['Trunk'][_0xaf2c('0x2b')](_0x599b2d)['then'](function(_0x166c26){_0x573db3[_0xaf2c('0x2b')]=_0x166c26;if(_0x409700[_0xaf2c('0x3f')][_0xaf2c('0x4e')]){_0x4eeecf[_0xaf2c('0x4f')]=[{'all':!![]}];}return db['Trunk'][_0xaf2c('0x50')](_0x4eeecf);})[_0xaf2c('0x1a')](function(_0x4b3ca4){_0x573db3['rows']=_0x4b3ca4;return _0x573db3;})[_0xaf2c('0x1a')](respondWithFilteredResult(_0xa44813,_0x4eeecf))['catch'](handleError(_0xa44813,null));};exports[_0xaf2c('0x51')]=function(_0x23642b,_0x17b9ec){var _0x315b9f={'raw':![],'where':{'id':_0x23642b[_0xaf2c('0x52')]['id']}},_0x367112={};_0x367112[_0xaf2c('0x3e')]=_[_0xaf2c('0x40')](db[_0xaf2c('0x53')][_0xaf2c('0x3a')]);_0x367112[_0xaf2c('0x3f')]=_['keys'](_0x23642b[_0xaf2c('0x3f')]);_0x367112[_0xaf2c('0x41')]=_['intersection'](_0x367112['model'],_0x367112['query']);_0x315b9f[_0xaf2c('0x44')]=_[_0xaf2c('0x42')](_0x367112['model'],qs[_0xaf2c('0x43')](_0x23642b[_0xaf2c('0x3f')][_0xaf2c('0x43')]));_0x315b9f[_0xaf2c('0x44')]=_0x315b9f[_0xaf2c('0x44')][_0xaf2c('0x45')]?_0x315b9f[_0xaf2c('0x44')]:_0x367112['model'];if(_0x23642b[_0xaf2c('0x3f')][_0xaf2c('0x4e')]){_0x315b9f['include']=[{'all':!![]}];}_0x315b9f=_[_0xaf2c('0x4c')]({},_0x315b9f,_0x23642b[_0xaf2c('0x4d')]);return db[_0xaf2c('0x53')][_0xaf2c('0x54')](_0x315b9f)[_0xaf2c('0x1a')](handleEntityNotFound(_0x17b9ec,null))[_0xaf2c('0x1a')](respondWithResult(_0x17b9ec,null))[_0xaf2c('0x25')](handleError(_0x17b9ec,null));};exports[_0xaf2c('0x55')]=function(_0x19b82d,_0x300254){var _0x133678={'where':{'id':_0x19b82d[_0xaf2c('0x52')]['id']}},_0x10a270={};_0x10a270[_0xaf2c('0x3e')]=_[_0xaf2c('0x40')](db[_0xaf2c('0x53')][_0xaf2c('0x3a')]);_0x133678[_0xaf2c('0x44')]=_[_0xaf2c('0x42')](_0x10a270[_0xaf2c('0x3e')],qs['fields'](_0x19b82d[_0xaf2c('0x3f')][_0xaf2c('0x43')]));_0x133678[_0xaf2c('0x44')]=_0x133678['attributes'][_0xaf2c('0x45')]?_0x133678['attributes']:_0x10a270[_0xaf2c('0x3e')];if(_0x19b82d[_0xaf2c('0x3f')][_0xaf2c('0x4e')]){_0x133678[_0xaf2c('0x4f')]=[{'all':!![]}];}_0x133678=_[_0xaf2c('0x4c')]({},_0x133678,_0x19b82d[_0xaf2c('0x4d')]);return db[_0xaf2c('0x53')][_0xaf2c('0x54')](_0x133678)[_0xaf2c('0x1a')](handleEntityNotFound(_0x300254,null))['then'](function(_0x41d08b){if(_0x41d08b){var _0x400dcd=_0x41d08b[_0xaf2c('0x32')]({'plain':!![]});_0x400dcd=qs[_0xaf2c('0x56')](_0x400dcd,['id',_0xaf2c('0x57'),'updatedAt']);_0x19b82d[_0xaf2c('0x58')]=_[_0xaf2c('0x56')](_0x19b82d['body'],['id',_0xaf2c('0x57'),_0xaf2c('0x59')]);return db['Trunk']['create'](_[_0xaf2c('0x4c')](_0x400dcd,_0x19b82d[_0xaf2c('0x58')]),{'include':_0x19b82d[_0xaf2c('0x3f')][_0xaf2c('0x4e')]?[{'all':!![]}]:undefined})['then'](function(_0x36b6f0){var _0x3f48f1=_0x19b82d['user'][_0xaf2c('0x32')]({'plain':!![]});if(!_0x3f48f1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3f48f1[_0xaf2c('0x5a')]===_0xaf2c('0x5b')){var _0x16e9f4=_0x36b6f0[_0xaf2c('0x32')]({'plain':!![]});var _0x1a297e=_0xaf2c('0x33');return db[_0xaf2c('0x5c')][_0xaf2c('0x54')]({'where':{'name':_0x1a297e,'userProfileId':_0x3f48f1[_0xaf2c('0x5d')]},'raw':!![]})[_0xaf2c('0x1a')](function(_0x53ba41){if(_0x53ba41&&_0x53ba41[_0xaf2c('0x5e')]===0x0){return db[_0xaf2c('0x5f')][_0xaf2c('0x60')]({'name':_0x16e9f4[_0xaf2c('0x36')],'resourceId':_0x16e9f4['id'],'type':_0x53ba41[_0xaf2c('0x36')],'sectionId':_0x53ba41['id']},{})['then'](function(){return _0x36b6f0;});}else{return _0x36b6f0;}})[_0xaf2c('0x25')](function(_0x28b09f){logger[_0xaf2c('0x21')](_0xaf2c('0x61'),_0x28b09f);throw _0x28b09f;});}return _0x36b6f0;});}})[_0xaf2c('0x1a')](respondWithResult(_0x300254,0xc9))['catch'](handleError(_0x300254,null));};exports['create']=function(_0x1166c9,_0x1ead61,_0x5849f8){var _0xf96361;return db[_0xaf2c('0x53')][_0xaf2c('0x60')](_0x1166c9['body'],{'raw':!![]})[_0xaf2c('0x1a')](function(_0x2bd845){_0xf96361=_0x2bd845;return db[_0xaf2c('0x53')][_0xaf2c('0x50')]({'raw':!![]});})['then'](function(_0x32d552){var _0x26129c=fs[_0xaf2c('0x62')](path[_0xaf2c('0x63')](config[_0xaf2c('0x64')],_0xaf2c('0x65')),_0xaf2c('0x66'));var _0x2767c7=fs[_0xaf2c('0x62')](path[_0xaf2c('0x63')](config[_0xaf2c('0x64')],'server/files/templates/registry.ejs'),_0xaf2c('0x66'));var _0x5d965c=ejs[_0xaf2c('0x67')](_0x26129c,{'trunks':_0x32d552||[]});fs[_0xaf2c('0x68')]('/etc/asterisk/sip_xcally_trunks.conf',_0x5d965c);if(_0xf96361[_0xaf2c('0x69')]){var _0x5a95ac=ejs['render'](_0x2767c7,{'trunks':_0x32d552||[]});fs[_0xaf2c('0x68')](_0xaf2c('0x6a'),_0x5a95ac);}})[_0xaf2c('0x1a')](function(){return respondWithRpcPromise('Reload','create',{'module':'chan_sip.so'});})[_0xaf2c('0x1a')](function(){var _0x3e972c=_0x1166c9['user'][_0xaf2c('0x32')]({'plain':!![]});if(!_0x3e972c)throw new Error(_0xaf2c('0x6b'));if(_0x3e972c[_0xaf2c('0x5a')]===_0xaf2c('0x5b')){var _0x6e1837=_0xf96361[_0xaf2c('0x32')]({'plain':!![]});return db['UserProfileSection'][_0xaf2c('0x54')]({'where':{'name':_0xaf2c('0x33'),'userProfileId':_0x3e972c[_0xaf2c('0x5d')]},'raw':!![]})['then'](function(_0xc9dd21){if(_0xc9dd21&&_0xc9dd21[_0xaf2c('0x5e')]===0x0){return db[_0xaf2c('0x5f')]['create']({'name':_0x6e1837[_0xaf2c('0x36')],'resourceId':_0x6e1837['id'],'type':_0xc9dd21[_0xaf2c('0x36')],'sectionId':_0xc9dd21['id']},{})[_0xaf2c('0x1a')](function(){return _0xf96361;});}else{return _0xf96361;}})[_0xaf2c('0x25')](function(_0x491160){logger[_0xaf2c('0x21')](_0xaf2c('0x61'),_0x491160);throw _0x491160;});}return _0xf96361;})[_0xaf2c('0x1a')](respondWithResult(_0x1ead61,0xc9))['catch'](handleError(_0x1ead61,null));};exports['update']=function(_0x427ece,_0x1b7dc1,_0x5571eb){var _0x3675d9;return db[_0xaf2c('0x53')]['find']({'where':{'id':_0x427ece[_0xaf2c('0x52')]['id']}})[_0xaf2c('0x1a')](handleEntityNotFound(_0x1b7dc1,null))[_0xaf2c('0x1a')](saveUpdates(_0x427ece[_0xaf2c('0x58')],null))[_0xaf2c('0x1a')](function(_0x4af252){if(_0x4af252){_0x3675d9=_0x4af252;return db['Trunk'][_0xaf2c('0x50')]({'raw':!![]});}})[_0xaf2c('0x1a')](function(_0x55b568){if(_0x55b568){var _0x4f378e=fs[_0xaf2c('0x62')](path[_0xaf2c('0x63')](config[_0xaf2c('0x64')],_0xaf2c('0x65')),_0xaf2c('0x66'));var _0x4b9fdc=fs[_0xaf2c('0x62')](path[_0xaf2c('0x63')](config[_0xaf2c('0x64')],_0xaf2c('0x6c')),_0xaf2c('0x66'));var _0x41c707=ejs['render'](_0x4f378e,{'trunks':_0x55b568||[]});fs[_0xaf2c('0x68')](_0xaf2c('0x6d'),_0x41c707);var _0x483774=ejs['render'](_0x4b9fdc,{'trunks':_0x55b568||[]});fs['writeFileSync'](_0xaf2c('0x6a'),_0x483774);return respondWithRpcPromise(_0xaf2c('0x6e'),_0xaf2c('0x30'),{'module':_0xaf2c('0x6f')});}return null;})['then'](function(_0x19fbd5){if(_0x19fbd5){return _0x3675d9;}})[_0xaf2c('0x1a')](respondWithResult(_0x1b7dc1,null))[_0xaf2c('0x25')](handleError(_0x1b7dc1,null));};exports[_0xaf2c('0x31')]=function(_0x4ddf95,_0x1e8fc0,_0x23aeac){var _0x41590;return db[_0xaf2c('0x53')][_0xaf2c('0x54')]({'where':{'id':_0x4ddf95['params']['id']}})[_0xaf2c('0x1a')](handleEntityNotFound(_0x1e8fc0,null))[_0xaf2c('0x1a')](removeEntity(_0x1e8fc0,null))['then'](function(){return db['Trunk'][_0xaf2c('0x50')]({'raw':!![]});})[_0xaf2c('0x1a')](function(_0x5bce65){var _0x1e6a12=fs[_0xaf2c('0x62')](path[_0xaf2c('0x63')](config[_0xaf2c('0x64')],_0xaf2c('0x65')),_0xaf2c('0x66'));var _0x2a3cb4=fs[_0xaf2c('0x62')](path['join'](config[_0xaf2c('0x64')],'server/files/templates/registry.ejs'),_0xaf2c('0x66'));var _0x7724cc=ejs['render'](_0x1e6a12,{'trunks':_0x5bce65});var _0x4a9ea8=ejs[_0xaf2c('0x67')](_0x2a3cb4,{'trunks':_0x5bce65});fs[_0xaf2c('0x68')](_0xaf2c('0x6d'),_0x7724cc);fs['writeFileSync'](_0xaf2c('0x6a'),_0x4a9ea8);return respondWithRpcPromise(_0xaf2c('0x6e'),_0xaf2c('0x31'),{'module':'chan_sip.so'});})['catch'](handleError(_0x1e8fc0,null));}; \ No newline at end of file +var _0x8d0e=['omit','updatedAt','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','server/files/templates/trunk.ejs','utf8','readFileSync','root','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','client','http','request','then','Trunk,\x20%s,\x20%s','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','code','error','message','info','result','catch','sendStatus','status','end','json','offset','undefined','count','reject','update','destroy','get','Trunks','stack','name','send','map','Trunk','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','pick','where','merge','VIRTUAL','filter','options','include','findAll','rows','show','params','keys','rawAttributes','includeAll','find','createdAt','body'];(function(_0x39f9e8,_0x4edccf){var _0x2d37f6=function(_0x533cca){while(--_0x533cca){_0x39f9e8['push'](_0x39f9e8['shift']());}};_0x2d37f6(++_0x4edccf);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x2ec648,_0x296ecb){_0x2ec648=_0x2ec648-0x0;var _0x42ea6f=_0x8d0e[_0x2ec648];return _0x42ea6f;};'use strict';var emlformat=require(_0xe8d0('0x0'));var rimraf=require(_0xe8d0('0x1'));var zipdir=require(_0xe8d0('0x2'));var jsonpatch=require(_0xe8d0('0x3'));var rp=require(_0xe8d0('0x4'));var moment=require(_0xe8d0('0x5'));var BPromise=require(_0xe8d0('0x6'));var Mustache=require(_0xe8d0('0x7'));var util=require(_0xe8d0('0x8'));var path=require('path');var sox=require(_0xe8d0('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe8d0('0xa'));var _=require(_0xe8d0('0xb'));var squel=require(_0xe8d0('0xc'));var crypto=require(_0xe8d0('0xd'));var jsforce=require(_0xe8d0('0xe'));var deskjs=require(_0xe8d0('0xf'));var toCsv=require(_0xe8d0('0x10'));var querystring=require(_0xe8d0('0x11'));var Papa=require('papaparse');var Redis=require(_0xe8d0('0x12'));var authService=require(_0xe8d0('0x13'));var qs=require(_0xe8d0('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe8d0('0x15'))(_0xe8d0('0x16'));var utils=require(_0xe8d0('0x17'));var config=require(_0xe8d0('0x18'));var licenseUtil=require(_0xe8d0('0x19'));var db=require(_0xe8d0('0x1a'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xe8d0('0x1b')][_0xe8d0('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x533b42,_0x2b640d,_0x4cbd26,_0x59b4b7){return new BPromise(function(_0x90a1ea,_0x2aa906){var _0x1aa725=_0x59b4b7||client;return _0x1aa725[_0xe8d0('0x1d')](_0x533b42,_0x4cbd26)[_0xe8d0('0x1e')](function(_0x7151c6){logger['info'](_0xe8d0('0x1f'),_0x2b640d,'request\x20sent');logger[_0xe8d0('0x20')](_0xe8d0('0x21'),_0x2b640d,_0xe8d0('0x22'),JSON['stringify'](_0x7151c6));if(_0x7151c6['error']){if(_0x7151c6['error'][_0xe8d0('0x23')]===0x1f4){logger[_0xe8d0('0x24')](_0xe8d0('0x1f'),_0x2b640d,_0x7151c6[_0xe8d0('0x24')][_0xe8d0('0x25')]);return _0x2aa906(_0x7151c6['error'][_0xe8d0('0x25')]);}logger[_0xe8d0('0x24')]('Trunk,\x20%s,\x20%s',_0x2b640d,_0x7151c6['error']['message']);return _0x90a1ea(_0x7151c6[_0xe8d0('0x24')][_0xe8d0('0x25')]);}else{logger[_0xe8d0('0x26')](_0xe8d0('0x1f'),_0x2b640d,_0xe8d0('0x22'));_0x90a1ea(_0x7151c6[_0xe8d0('0x27')][_0xe8d0('0x25')]);}})[_0xe8d0('0x28')](function(_0x32e39a){logger['error'](_0xe8d0('0x1f'),_0x2b640d,_0x32e39a);_0x2aa906(_0x32e39a);});});}function respondWithStatusCode(_0x9f747,_0x572c25){_0x572c25=_0x572c25||0xcc;return function(_0x106614){if(_0x106614){return _0x9f747[_0xe8d0('0x29')](_0x572c25);}return _0x9f747[_0xe8d0('0x2a')](_0x572c25)[_0xe8d0('0x2b')]();};}function respondWithResult(_0x146783,_0x149dfd){_0x149dfd=_0x149dfd||0xc8;return function(_0x31519b){if(_0x31519b){return _0x146783[_0xe8d0('0x2a')](_0x149dfd)[_0xe8d0('0x2c')](_0x31519b);}};}function respondWithFilteredResult(_0x2dee67,_0x264de4){return function(_0x539548){if(_0x539548){var _0x24982c=typeof _0x264de4[_0xe8d0('0x2d')]===_0xe8d0('0x2e')&&typeof _0x264de4['limit']===_0xe8d0('0x2e');var _0x343b08=_0x539548['count'];var _0x1519e2=_0x24982c?0x0:_0x264de4[_0xe8d0('0x2d')];var _0x11fcf2=_0x24982c?_0x539548[_0xe8d0('0x2f')]:_0x264de4[_0xe8d0('0x2d')]+_0x264de4['limit'];var _0x3cc292;if(_0x11fcf2>=_0x343b08){_0x11fcf2=_0x343b08;_0x3cc292=0xc8;}else{_0x3cc292=0xce;}_0x2dee67['status'](_0x3cc292);return _0x2dee67['set']('Content-Range',_0x1519e2+'-'+_0x11fcf2+'/'+_0x343b08)[_0xe8d0('0x2c')](_0x539548);}return null;};}function patchUpdates(_0x13cd4c){return function(_0x36ccec){try{jsonpatch['apply'](_0x36ccec,_0x13cd4c,!![]);}catch(_0x57e375){return BPromise[_0xe8d0('0x30')](_0x57e375);}return _0x36ccec['save']();};}function saveUpdates(_0x3b5d31,_0x383084){return function(_0x327004){if(_0x327004){return _0x327004[_0xe8d0('0x31')](_0x3b5d31)[_0xe8d0('0x1e')](function(_0x5bbc9e){return _0x5bbc9e;});}return null;};}function removeEntity(_0x1bee61,_0x4db53c){return function(_0x402e90){if(_0x402e90){return _0x402e90[_0xe8d0('0x32')]()['then'](function(){var _0x4547b6=_0x402e90[_0xe8d0('0x33')]({'plain':!![]});var _0x4c1347=_0xe8d0('0x34');return db['UserProfileResource'][_0xe8d0('0x32')]({'where':{'type':_0x4c1347,'resourceId':_0x4547b6['id']}})['then'](function(){return _0x402e90;});})[_0xe8d0('0x1e')](function(){_0x1bee61['status'](0xcc)[_0xe8d0('0x2b')]();});}};}function handleEntityNotFound(_0xb2cdbf,_0x1e2430){return function(_0x320565){if(!_0x320565){_0xb2cdbf['sendStatus'](0x194);}return _0x320565;};}function handleError(_0x36a650,_0x354e19){_0x354e19=_0x354e19||0x1f4;return function(_0x20eec5){logger['error'](_0x20eec5[_0xe8d0('0x35')]);if(_0x20eec5[_0xe8d0('0x36')]){delete _0x20eec5[_0xe8d0('0x36')];}_0x36a650[_0xe8d0('0x2a')](_0x354e19)[_0xe8d0('0x37')](_0x20eec5);};}exports['index']=function(_0x5a969a,_0x1828c5){var _0x10970d={},_0x3d76d5={},_0x318106={'count':0x0,'rows':[]};var _0x23d72e=_[_0xe8d0('0x38')](db[_0xe8d0('0x39')]['rawAttributes'],function(_0x5dff14){return{'name':_0x5dff14[_0xe8d0('0x3a')],'type':_0x5dff14[_0xe8d0('0x3b')][_0xe8d0('0x3c')]};});_0x3d76d5[_0xe8d0('0x3d')]=_[_0xe8d0('0x38')](_0x23d72e,'name');_0x3d76d5[_0xe8d0('0x3e')]=_['keys'](_0x5a969a[_0xe8d0('0x3e')]);_0x3d76d5[_0xe8d0('0x3f')]=_[_0xe8d0('0x40')](_0x3d76d5['model'],_0x3d76d5[_0xe8d0('0x3e')]);_0x10970d[_0xe8d0('0x41')]=_[_0xe8d0('0x40')](_0x3d76d5[_0xe8d0('0x3d')],qs[_0xe8d0('0x42')](_0x5a969a['query']['fields']));_0x10970d['attributes']=_0x10970d['attributes'][_0xe8d0('0x43')]?_0x10970d['attributes']:_0x3d76d5[_0xe8d0('0x3d')];if(!_0x5a969a[_0xe8d0('0x3e')][_0xe8d0('0x44')](_0xe8d0('0x45'))){_0x10970d[_0xe8d0('0x46')]=qs[_0xe8d0('0x46')](_0x5a969a[_0xe8d0('0x3e')][_0xe8d0('0x46')]);_0x10970d['offset']=qs[_0xe8d0('0x2d')](_0x5a969a[_0xe8d0('0x3e')]['offset']);}_0x10970d['order']=qs[_0xe8d0('0x47')](_0x5a969a[_0xe8d0('0x3e')][_0xe8d0('0x47')]);_0x10970d['where']=qs[_0xe8d0('0x3f')](_[_0xe8d0('0x48')](_0x5a969a['query'],_0x3d76d5[_0xe8d0('0x3f')]),_0x23d72e);if(_0x5a969a[_0xe8d0('0x3e')]['filter']){_0x10970d[_0xe8d0('0x49')]=_[_0xe8d0('0x4a')](_0x10970d[_0xe8d0('0x49')],{'$or':_[_0xe8d0('0x38')](_0x23d72e,function(_0x1d5815){if(_0x1d5815[_0xe8d0('0x3b')]!==_0xe8d0('0x4b')){var _0x1ce97d={};_0x1ce97d[_0x1d5815['name']]={'$like':'%'+_0x5a969a[_0xe8d0('0x3e')][_0xe8d0('0x4c')]+'%'};return _0x1ce97d;}})});}_0x10970d=_[_0xe8d0('0x4a')]({},_0x10970d,_0x5a969a[_0xe8d0('0x4d')]);var _0x28d38b={'where':_0x10970d[_0xe8d0('0x49')]};return db[_0xe8d0('0x39')][_0xe8d0('0x2f')](_0x28d38b)[_0xe8d0('0x1e')](function(_0x2e2c05){_0x318106[_0xe8d0('0x2f')]=_0x2e2c05;if(_0x5a969a[_0xe8d0('0x3e')]['includeAll']){_0x10970d[_0xe8d0('0x4e')]=[{'all':!![]}];}return db[_0xe8d0('0x39')][_0xe8d0('0x4f')](_0x10970d);})[_0xe8d0('0x1e')](function(_0x34047c){_0x318106[_0xe8d0('0x50')]=_0x34047c;return _0x318106;})[_0xe8d0('0x1e')](respondWithFilteredResult(_0x1828c5,_0x10970d))['catch'](handleError(_0x1828c5,null));};exports[_0xe8d0('0x51')]=function(_0x424764,_0x151cf4){var _0x205933={'raw':![],'where':{'id':_0x424764[_0xe8d0('0x52')]['id']}},_0x4ed47f={};_0x4ed47f['model']=_[_0xe8d0('0x53')](db[_0xe8d0('0x39')][_0xe8d0('0x54')]);_0x4ed47f[_0xe8d0('0x3e')]=_[_0xe8d0('0x53')](_0x424764[_0xe8d0('0x3e')]);_0x4ed47f[_0xe8d0('0x3f')]=_['intersection'](_0x4ed47f[_0xe8d0('0x3d')],_0x4ed47f['query']);_0x205933['attributes']=_[_0xe8d0('0x40')](_0x4ed47f['model'],qs[_0xe8d0('0x42')](_0x424764['query'][_0xe8d0('0x42')]));_0x205933[_0xe8d0('0x41')]=_0x205933[_0xe8d0('0x41')][_0xe8d0('0x43')]?_0x205933['attributes']:_0x4ed47f[_0xe8d0('0x3d')];if(_0x424764[_0xe8d0('0x3e')][_0xe8d0('0x55')]){_0x205933[_0xe8d0('0x4e')]=[{'all':!![]}];}_0x205933=_[_0xe8d0('0x4a')]({},_0x205933,_0x424764['options']);return db[_0xe8d0('0x39')][_0xe8d0('0x56')](_0x205933)[_0xe8d0('0x1e')](handleEntityNotFound(_0x151cf4,null))['then'](respondWithResult(_0x151cf4,null))[_0xe8d0('0x28')](handleError(_0x151cf4,null));};exports['clone']=function(_0x56b4fa,_0x1bd329){var _0x37040a={'where':{'id':_0x56b4fa[_0xe8d0('0x52')]['id']}},_0x4e7b49={};_0x4e7b49[_0xe8d0('0x3d')]=_['keys'](db[_0xe8d0('0x39')][_0xe8d0('0x54')]);_0x37040a[_0xe8d0('0x41')]=_[_0xe8d0('0x40')](_0x4e7b49['model'],qs[_0xe8d0('0x42')](_0x56b4fa[_0xe8d0('0x3e')][_0xe8d0('0x42')]));_0x37040a[_0xe8d0('0x41')]=_0x37040a['attributes'][_0xe8d0('0x43')]?_0x37040a[_0xe8d0('0x41')]:_0x4e7b49[_0xe8d0('0x3d')];if(_0x56b4fa[_0xe8d0('0x3e')][_0xe8d0('0x55')]){_0x37040a[_0xe8d0('0x4e')]=[{'all':!![]}];}_0x37040a=_['merge']({},_0x37040a,_0x56b4fa['options']);return db[_0xe8d0('0x39')]['find'](_0x37040a)[_0xe8d0('0x1e')](handleEntityNotFound(_0x1bd329,null))[_0xe8d0('0x1e')](function(_0x4c0d4c){if(_0x4c0d4c){var _0x5ac1ae=_0x4c0d4c[_0xe8d0('0x33')]({'plain':!![]});_0x5ac1ae=qs['omit'](_0x5ac1ae,['id',_0xe8d0('0x57'),'updatedAt']);_0x56b4fa[_0xe8d0('0x58')]=_[_0xe8d0('0x59')](_0x56b4fa[_0xe8d0('0x58')],['id','createdAt',_0xe8d0('0x5a')]);return db[_0xe8d0('0x39')]['create'](_[_0xe8d0('0x4a')](_0x5ac1ae,_0x56b4fa['body']),{'include':_0x56b4fa[_0xe8d0('0x3e')]['includeAll']?[{'all':!![]}]:undefined})[_0xe8d0('0x1e')](function(_0x17afc2){var _0x29467d=_0x56b4fa[_0xe8d0('0x5b')][_0xe8d0('0x33')]({'plain':!![]});if(!_0x29467d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x29467d['role']===_0xe8d0('0x5b')){var _0x55a2df=_0x17afc2[_0xe8d0('0x33')]({'plain':!![]});var _0x18b655=_0xe8d0('0x34');return db[_0xe8d0('0x5c')][_0xe8d0('0x56')]({'where':{'name':_0x18b655,'userProfileId':_0x29467d[_0xe8d0('0x5d')]},'raw':!![]})[_0xe8d0('0x1e')](function(_0x20647d){if(_0x20647d&&_0x20647d[_0xe8d0('0x5e')]===0x0){return db[_0xe8d0('0x5f')][_0xe8d0('0x60')]({'name':_0x55a2df[_0xe8d0('0x36')],'resourceId':_0x55a2df['id'],'type':_0x20647d[_0xe8d0('0x36')],'sectionId':_0x20647d['id']},{})[_0xe8d0('0x1e')](function(){return _0x17afc2;});}else{return _0x17afc2;}})[_0xe8d0('0x28')](function(_0x4a68d5){logger[_0xe8d0('0x24')](_0xe8d0('0x61'),_0x4a68d5);throw _0x4a68d5;});}return _0x17afc2;});}})[_0xe8d0('0x1e')](respondWithResult(_0x1bd329,0xc9))[_0xe8d0('0x28')](handleError(_0x1bd329,null));};exports[_0xe8d0('0x60')]=function(_0x4848d4,_0x2eeb92,_0x1d30c0){var _0x45b42b;return db[_0xe8d0('0x39')][_0xe8d0('0x60')](_0x4848d4[_0xe8d0('0x58')],{'raw':!![]})[_0xe8d0('0x1e')](function(_0x13ceb4){_0x45b42b=_0x13ceb4;return db[_0xe8d0('0x39')][_0xe8d0('0x4f')]({'raw':!![]});})[_0xe8d0('0x1e')](function(_0xdb3e53){var _0x556d7e=fs['readFileSync'](path[_0xe8d0('0x62')](config['root'],_0xe8d0('0x63')),_0xe8d0('0x64'));var _0x56761c=fs[_0xe8d0('0x65')](path[_0xe8d0('0x62')](config[_0xe8d0('0x66')],_0xe8d0('0x67')),_0xe8d0('0x64'));var _0x1b5df8=ejs[_0xe8d0('0x68')](_0x556d7e,{'trunks':_0xdb3e53||[]});fs[_0xe8d0('0x69')](_0xe8d0('0x6a'),_0x1b5df8);if(_0x45b42b[_0xe8d0('0x6b')]){var _0xb078d8=ejs[_0xe8d0('0x68')](_0x56761c,{'trunks':_0xdb3e53||[]});fs[_0xe8d0('0x69')](_0xe8d0('0x6c'),_0xb078d8);}})[_0xe8d0('0x1e')](function(){return respondWithRpcPromise(_0xe8d0('0x6d'),_0xe8d0('0x60'),{'module':_0xe8d0('0x6e')});})[_0xe8d0('0x1e')](function(){var _0x500fb0=_0x4848d4[_0xe8d0('0x5b')][_0xe8d0('0x33')]({'plain':!![]});if(!_0x500fb0)throw new Error(_0xe8d0('0x6f'));if(_0x500fb0['role']===_0xe8d0('0x5b')){var _0x4c54c4=_0x45b42b[_0xe8d0('0x33')]({'plain':!![]});return db[_0xe8d0('0x5c')][_0xe8d0('0x56')]({'where':{'name':'Trunks','userProfileId':_0x500fb0[_0xe8d0('0x5d')]},'raw':!![]})[_0xe8d0('0x1e')](function(_0xc94cd3){if(_0xc94cd3&&_0xc94cd3[_0xe8d0('0x5e')]===0x0){return db[_0xe8d0('0x5f')]['create']({'name':_0x4c54c4[_0xe8d0('0x36')],'resourceId':_0x4c54c4['id'],'type':_0xc94cd3[_0xe8d0('0x36')],'sectionId':_0xc94cd3['id']},{})[_0xe8d0('0x1e')](function(){return _0x45b42b;});}else{return _0x45b42b;}})[_0xe8d0('0x28')](function(_0x252f0e){logger[_0xe8d0('0x24')](_0xe8d0('0x61'),_0x252f0e);throw _0x252f0e;});}return _0x45b42b;})[_0xe8d0('0x1e')](respondWithResult(_0x2eeb92,0xc9))['catch'](handleError(_0x2eeb92,null));};exports[_0xe8d0('0x31')]=function(_0x31b9d3,_0x14d722,_0x2aa6fc){var _0x4d5997;return db[_0xe8d0('0x39')][_0xe8d0('0x56')]({'where':{'id':_0x31b9d3[_0xe8d0('0x52')]['id']}})['then'](handleEntityNotFound(_0x14d722,null))[_0xe8d0('0x1e')](saveUpdates(_0x31b9d3['body'],null))[_0xe8d0('0x1e')](function(_0x478eb2){if(_0x478eb2){_0x4d5997=_0x478eb2;return db[_0xe8d0('0x39')][_0xe8d0('0x4f')]({'raw':!![]});}})[_0xe8d0('0x1e')](function(_0xa90bdc){if(_0xa90bdc){var _0x87aa04=fs[_0xe8d0('0x65')](path[_0xe8d0('0x62')](config[_0xe8d0('0x66')],_0xe8d0('0x63')),_0xe8d0('0x64'));var _0x2eaf2f=fs[_0xe8d0('0x65')](path['join'](config[_0xe8d0('0x66')],_0xe8d0('0x67')),_0xe8d0('0x64'));var _0x761e97=ejs[_0xe8d0('0x68')](_0x87aa04,{'trunks':_0xa90bdc||[]});fs[_0xe8d0('0x69')](_0xe8d0('0x6a'),_0x761e97);var _0x605b5f=ejs[_0xe8d0('0x68')](_0x2eaf2f,{'trunks':_0xa90bdc||[]});fs[_0xe8d0('0x69')]('/etc/asterisk/sip_xcally_registers.conf',_0x605b5f);return respondWithRpcPromise(_0xe8d0('0x6d'),_0xe8d0('0x31'),{'module':_0xe8d0('0x6e')});}return null;})[_0xe8d0('0x1e')](function(_0x255e4b){if(_0x255e4b){return _0x4d5997;}})['then'](respondWithResult(_0x14d722,null))['catch'](handleError(_0x14d722,null));};exports[_0xe8d0('0x32')]=function(_0x5c8c7d,_0x3fb7c8,_0x16098b){var _0x363b3a;return db['Trunk'][_0xe8d0('0x56')]({'where':{'id':_0x5c8c7d['params']['id']}})[_0xe8d0('0x1e')](handleEntityNotFound(_0x3fb7c8,null))[_0xe8d0('0x1e')](removeEntity(_0x3fb7c8,null))[_0xe8d0('0x1e')](function(){return db[_0xe8d0('0x39')][_0xe8d0('0x4f')]({'raw':!![]});})['then'](function(_0x58034d){var _0xfbacce=fs[_0xe8d0('0x65')](path[_0xe8d0('0x62')](config[_0xe8d0('0x66')],_0xe8d0('0x63')),_0xe8d0('0x64'));var _0x2790f=fs[_0xe8d0('0x65')](path[_0xe8d0('0x62')](config['root'],_0xe8d0('0x67')),_0xe8d0('0x64'));var _0x142db4=ejs[_0xe8d0('0x68')](_0xfbacce,{'trunks':_0x58034d});var _0x4a568f=ejs['render'](_0x2790f,{'trunks':_0x58034d});fs[_0xe8d0('0x69')](_0xe8d0('0x6a'),_0x142db4);fs[_0xe8d0('0x69')](_0xe8d0('0x6c'),_0x4a568f);return respondWithRpcPromise(_0xe8d0('0x6d'),_0xe8d0('0x32'),{'module':_0xe8d0('0x6e')});})[_0xe8d0('0x28')](handleError(_0x3fb7c8,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index 8842a2e..5b8feab 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 _0x35aa=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./trunk.attributes','define','util','../../config/logger'];(function(_0x3b7ce9,_0x1f9066){var _0x23d0ba=function(_0x502701){while(--_0x502701){_0x3b7ce9['push'](_0x3b7ce9['shift']());}};_0x23d0ba(++_0x1f9066);}(_0x35aa,0xda));var _0xa35a=function(_0x5b162b,_0x6a91fe){_0x5b162b=_0x5b162b-0x0;var _0x2f2cbe=_0x35aa[_0x5b162b];return _0x2f2cbe;};'use strict';var _=require('lodash');var util=require(_0xa35a('0x0'));var logger=require(_0xa35a('0x1'))(_0xa35a('0x2'));var moment=require(_0xa35a('0x3'));var BPromise=require(_0xa35a('0x4'));var rp=require(_0xa35a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa35a('0x6'));var config=require(_0xa35a('0x7'));var attributes=require(_0xa35a('0x8'));module['exports']=function(_0x253e6a,_0xf92926){return _0x253e6a[_0xa35a('0x9')]('Trunk',attributes,{'tableName':'tools_trunks','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc667=['../../config/environment','./trunk.attributes','exports','define','Trunk','tools_trunks','lodash','util','../../config/logger','api','moment','rimraf'];(function(_0x7f55fb,_0x443206){var _0x101e63=function(_0x492555){while(--_0x492555){_0x7f55fb['push'](_0x7f55fb['shift']());}};_0x101e63(++_0x443206);}(_0xc667,0x8a));var _0x7c66=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xc667[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x7c66('0x0'));var util=require(_0x7c66('0x1'));var logger=require(_0x7c66('0x2'))(_0x7c66('0x3'));var moment=require(_0x7c66('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x7c66('0x5'));var config=require(_0x7c66('0x6'));var attributes=require(_0x7c66('0x7'));module[_0x7c66('0x8')]=function(_0x220f83,_0x492d6f){return _0x220f83[_0x7c66('0x9')](_0x7c66('0xa'),attributes,{'tableName':_0x7c66('0xb'),'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 c96e689..2efb72c 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 _0x3b75=['where','limit','include','map','model','attributes','GetTrunk','stringify','ShowTrunk','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','error','message','catch','Trunk','findAll','options','raw'];(function(_0x42bdad,_0x12836c){var _0x122626=function(_0x2eb29c){while(--_0x2eb29c){_0x42bdad['push'](_0x42bdad['shift']());}};_0x122626(++_0x12836c);}(_0x3b75,0x144));var _0x53b7=function(_0x574ce3,_0x59eef4){_0x574ce3=_0x574ce3-0x0;var _0x3447a0=_0x3b75[_0x574ce3];return _0x3447a0;};'use strict';var _=require(_0x53b7('0x0'));var util=require(_0x53b7('0x1'));var moment=require(_0x53b7('0x2'));var BPromise=require(_0x53b7('0x3'));var rs=require(_0x53b7('0x4'));var fs=require('fs');var Redis=require(_0x53b7('0x5'));var db=require(_0x53b7('0x6'))['db'];var utils=require(_0x53b7('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x53b7('0x8'));var jayson=require(_0x53b7('0x9'));var client=jayson[_0x53b7('0xa')][_0x53b7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4e87d4,_0x4dd362,_0x13d9c7){return new BPromise(function(_0x42a770,_0x3eccbf){return client[_0x53b7('0xc')](_0x4e87d4,_0x13d9c7)[_0x53b7('0xd')](function(_0x4838a1){logger[_0x53b7('0xe')](_0x53b7('0xf'),_0x4dd362,_0x53b7('0x10'));logger[_0x53b7('0x11')](_0x53b7('0x12'),_0x4dd362,_0x53b7('0x10'),JSON['stringify'](_0x4838a1));if(_0x4838a1['error']){if(_0x4838a1[_0x53b7('0x13')]['code']===0x1f4){logger[_0x53b7('0x13')]('Trunk,\x20%s,\x20%s',_0x4dd362,_0x4838a1[_0x53b7('0x13')][_0x53b7('0x14')]);return _0x3eccbf(_0x4838a1[_0x53b7('0x13')]['message']);}logger[_0x53b7('0x13')](_0x53b7('0xf'),_0x4dd362,_0x4838a1['error']['message']);return _0x42a770(_0x4838a1[_0x53b7('0x13')][_0x53b7('0x14')]);}else{logger[_0x53b7('0xe')](_0x53b7('0xf'),_0x4dd362,_0x53b7('0x10'));_0x42a770(_0x4838a1['result'][_0x53b7('0x14')]);}})[_0x53b7('0x15')](function(_0x23bc46){logger[_0x53b7('0x13')](_0x53b7('0xf'),_0x4dd362,_0x23bc46);_0x3eccbf(_0x23bc46);});});}exports['GetTrunk']=function(_0x14f30f){var _0x47da7c=this;return new Promise(function(_0x5de2f6,_0x59734e){return db[_0x53b7('0x16')][_0x53b7('0x17')]({'raw':_0x14f30f[_0x53b7('0x18')]?_0x14f30f[_0x53b7('0x18')][_0x53b7('0x19')]===undefined?!![]:![]:!![],'where':_0x14f30f[_0x53b7('0x18')]?_0x14f30f[_0x53b7('0x18')][_0x53b7('0x1a')]||null:null,'attributes':_0x14f30f[_0x53b7('0x18')]?_0x14f30f[_0x53b7('0x18')]['attributes']||null:null,'limit':_0x14f30f[_0x53b7('0x18')]?_0x14f30f[_0x53b7('0x18')][_0x53b7('0x1b')]||null:null,'include':_0x14f30f[_0x53b7('0x18')]?_0x14f30f[_0x53b7('0x18')][_0x53b7('0x1c')]?_[_0x53b7('0x1d')](_0x14f30f[_0x53b7('0x18')][_0x53b7('0x1c')],function(_0x42063f){return{'model':db[_0x42063f[_0x53b7('0x1e')]],'as':_0x42063f['as'],'attributes':_0x42063f[_0x53b7('0x1f')],'include':_0x42063f['include']?_['map'](_0x42063f[_0x53b7('0x1c')],function(_0x3e70d8){return{'model':db[_0x3e70d8[_0x53b7('0x1e')]],'as':_0x3e70d8['as'],'attributes':_0x3e70d8[_0x53b7('0x1f')],'include':_0x3e70d8[_0x53b7('0x1c')]?_[_0x53b7('0x1d')](_0x3e70d8[_0x53b7('0x1c')],function(_0x10bede){return{'model':db[_0x10bede[_0x53b7('0x1e')]],'as':_0x10bede['as'],'attributes':_0x10bede['attributes']};}):[]};}):[]};}):[]:[]})[_0x53b7('0xd')](function(_0x8aa6a9){logger['info'](_0x53b7('0x20'),_0x14f30f);logger['debug'](_0x53b7('0x20'),_0x14f30f,JSON[_0x53b7('0x21')](_0x8aa6a9));_0x5de2f6(_0x8aa6a9);})[_0x53b7('0x15')](function(_0x13f5f6){logger['error'](_0x53b7('0x20'),_0x13f5f6[_0x53b7('0x14')],_0x14f30f);_0x59734e(_0x47da7c[_0x53b7('0x13')](0x1f4,_0x13f5f6['message']));});});};exports['ShowTrunk']=function(_0x23fd28){var _0xae77f6=this;return new Promise(function(_0x82dca,_0x560207){return db[_0x53b7('0x16')]['find']({'raw':_0x23fd28['options']?_0x23fd28[_0x53b7('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x23fd28[_0x53b7('0x18')]?_0x23fd28[_0x53b7('0x18')]['where']||null:null,'attributes':_0x23fd28[_0x53b7('0x18')]?_0x23fd28['options']['attributes']||null:null,'include':_0x23fd28[_0x53b7('0x18')]?_0x23fd28[_0x53b7('0x18')][_0x53b7('0x1c')]?_[_0x53b7('0x1d')](_0x23fd28['options'][_0x53b7('0x1c')],function(_0xf2fe8c){return{'model':db[_0xf2fe8c[_0x53b7('0x1e')]],'as':_0xf2fe8c['as'],'attributes':_0xf2fe8c[_0x53b7('0x1f')],'include':_0xf2fe8c[_0x53b7('0x1c')]?_[_0x53b7('0x1d')](_0xf2fe8c['include'],function(_0x397a85){return{'model':db[_0x397a85[_0x53b7('0x1e')]],'as':_0x397a85['as'],'attributes':_0x397a85['attributes'],'include':_0x397a85[_0x53b7('0x1c')]?_[_0x53b7('0x1d')](_0x397a85[_0x53b7('0x1c')],function(_0x3118c9){return{'model':db[_0x3118c9[_0x53b7('0x1e')]],'as':_0x3118c9['as'],'attributes':_0x3118c9[_0x53b7('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5dbc19){logger['info'](_0x53b7('0x22'),_0x23fd28);logger[_0x53b7('0x11')](_0x53b7('0x22'),_0x23fd28,JSON[_0x53b7('0x21')](_0x5dbc19));_0x82dca(_0x5dbc19);})[_0x53b7('0x15')](function(_0x5cdf32){logger['error']('ShowTrunk',_0x5cdf32[_0x53b7('0x14')],_0x23fd28);_0x560207(_0xae77f6[_0x53b7('0x13')](0x1f4,_0x5cdf32[_0x53b7('0x14')]));});});}; \ No newline at end of file +var _0x9bfa=['request\x20sent','stringify','error','code','Trunk,\x20%s,\x20%s','message','result','GetTrunk','options','raw','where','limit','include','map','model','attributes','then','catch','Trunk','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','debug'];(function(_0x45495a,_0x353d64){var _0xf6fb7c=function(_0x499820){while(--_0x499820){_0x45495a['push'](_0x45495a['shift']());}};_0xf6fb7c(++_0x353d64);}(_0x9bfa,0x167));var _0xa9bf=function(_0x238c4f,_0x2ba8a5){_0x238c4f=_0x238c4f-0x0;var _0x180e30=_0x9bfa[_0x238c4f];return _0x180e30;};'use strict';var _=require(_0xa9bf('0x0'));var util=require(_0xa9bf('0x1'));var moment=require('moment');var BPromise=require(_0xa9bf('0x2'));var rs=require(_0xa9bf('0x3'));var fs=require('fs');var Redis=require(_0xa9bf('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa9bf('0x5'));var logger=require(_0xa9bf('0x6'))(_0xa9bf('0x7'));var config=require(_0xa9bf('0x8'));var jayson=require(_0xa9bf('0x9'));var client=jayson[_0xa9bf('0xa')][_0xa9bf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2b61e1,_0x5b6b02,_0x41e8f5){return new BPromise(function(_0x21d8b9,_0x1256f9){return client[_0xa9bf('0xc')](_0x2b61e1,_0x41e8f5)['then'](function(_0x1df72d){logger[_0xa9bf('0xd')]('Trunk,\x20%s,\x20%s',_0x5b6b02,'request\x20sent');logger[_0xa9bf('0xe')]('Trunk,\x20%s,\x20%s,\x20%s',_0x5b6b02,_0xa9bf('0xf'),JSON[_0xa9bf('0x10')](_0x1df72d));if(_0x1df72d['error']){if(_0x1df72d[_0xa9bf('0x11')][_0xa9bf('0x12')]===0x1f4){logger[_0xa9bf('0x11')](_0xa9bf('0x13'),_0x5b6b02,_0x1df72d[_0xa9bf('0x11')][_0xa9bf('0x14')]);return _0x1256f9(_0x1df72d[_0xa9bf('0x11')][_0xa9bf('0x14')]);}logger[_0xa9bf('0x11')](_0xa9bf('0x13'),_0x5b6b02,_0x1df72d[_0xa9bf('0x11')][_0xa9bf('0x14')]);return _0x21d8b9(_0x1df72d['error']['message']);}else{logger['info'](_0xa9bf('0x13'),_0x5b6b02,_0xa9bf('0xf'));_0x21d8b9(_0x1df72d[_0xa9bf('0x15')][_0xa9bf('0x14')]);}})['catch'](function(_0x683da9){logger[_0xa9bf('0x11')](_0xa9bf('0x13'),_0x5b6b02,_0x683da9);_0x1256f9(_0x683da9);});});}exports[_0xa9bf('0x16')]=function(_0x29cc45){var _0x54447e=this;return new Promise(function(_0x236425,_0x9c2df){return db['Trunk']['findAll']({'raw':_0x29cc45[_0xa9bf('0x17')]?_0x29cc45[_0xa9bf('0x17')][_0xa9bf('0x18')]===undefined?!![]:![]:!![],'where':_0x29cc45[_0xa9bf('0x17')]?_0x29cc45[_0xa9bf('0x17')][_0xa9bf('0x19')]||null:null,'attributes':_0x29cc45[_0xa9bf('0x17')]?_0x29cc45[_0xa9bf('0x17')]['attributes']||null:null,'limit':_0x29cc45['options']?_0x29cc45[_0xa9bf('0x17')][_0xa9bf('0x1a')]||null:null,'include':_0x29cc45[_0xa9bf('0x17')]?_0x29cc45['options'][_0xa9bf('0x1b')]?_[_0xa9bf('0x1c')](_0x29cc45[_0xa9bf('0x17')][_0xa9bf('0x1b')],function(_0xc331ce){return{'model':db[_0xc331ce[_0xa9bf('0x1d')]],'as':_0xc331ce['as'],'attributes':_0xc331ce[_0xa9bf('0x1e')],'include':_0xc331ce[_0xa9bf('0x1b')]?_[_0xa9bf('0x1c')](_0xc331ce[_0xa9bf('0x1b')],function(_0x296cd6){return{'model':db[_0x296cd6[_0xa9bf('0x1d')]],'as':_0x296cd6['as'],'attributes':_0x296cd6['attributes'],'include':_0x296cd6[_0xa9bf('0x1b')]?_[_0xa9bf('0x1c')](_0x296cd6[_0xa9bf('0x1b')],function(_0x587576){return{'model':db[_0x587576[_0xa9bf('0x1d')]],'as':_0x587576['as'],'attributes':_0x587576[_0xa9bf('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xa9bf('0x1f')](function(_0x37b01d){logger['info'](_0xa9bf('0x16'),_0x29cc45);logger[_0xa9bf('0xe')](_0xa9bf('0x16'),_0x29cc45,JSON['stringify'](_0x37b01d));_0x236425(_0x37b01d);})[_0xa9bf('0x20')](function(_0x4a1ef8){logger['error'](_0xa9bf('0x16'),_0x4a1ef8[_0xa9bf('0x14')],_0x29cc45);_0x9c2df(_0x54447e[_0xa9bf('0x11')](0x1f4,_0x4a1ef8[_0xa9bf('0x14')]));});});};exports['ShowTrunk']=function(_0x3ab79b){var _0x2e6bf8=this;return new Promise(function(_0x230bd6,_0x2421cb){return db[_0xa9bf('0x21')]['find']({'raw':_0x3ab79b['options']?_0x3ab79b[_0xa9bf('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x3ab79b[_0xa9bf('0x17')]?_0x3ab79b[_0xa9bf('0x17')][_0xa9bf('0x19')]||null:null,'attributes':_0x3ab79b['options']?_0x3ab79b[_0xa9bf('0x17')][_0xa9bf('0x1e')]||null:null,'include':_0x3ab79b[_0xa9bf('0x17')]?_0x3ab79b[_0xa9bf('0x17')][_0xa9bf('0x1b')]?_[_0xa9bf('0x1c')](_0x3ab79b['options'][_0xa9bf('0x1b')],function(_0x564507){return{'model':db[_0x564507['model']],'as':_0x564507['as'],'attributes':_0x564507['attributes'],'include':_0x564507[_0xa9bf('0x1b')]?_[_0xa9bf('0x1c')](_0x564507['include'],function(_0x3916e4){return{'model':db[_0x3916e4[_0xa9bf('0x1d')]],'as':_0x3916e4['as'],'attributes':_0x3916e4[_0xa9bf('0x1e')],'include':_0x3916e4[_0xa9bf('0x1b')]?_[_0xa9bf('0x1c')](_0x3916e4[_0xa9bf('0x1b')],function(_0x381d0d){return{'model':db[_0x381d0d['model']],'as':_0x381d0d['as'],'attributes':_0x381d0d['attributes']};}):[]};}):[]};}):[]:[]})[_0xa9bf('0x1f')](function(_0x2eb264){logger['info']('ShowTrunk',_0x3ab79b);logger[_0xa9bf('0xe')]('ShowTrunk',_0x3ab79b,JSON[_0xa9bf('0x10')](_0x2eb264));_0x230bd6(_0x2eb264);})[_0xa9bf('0x20')](function(_0x29fce4){logger[_0xa9bf('0x11')]('ShowTrunk',_0x29fce4[_0xa9bf('0x14')],_0x3ab79b);_0x2421cb(_0x2e6bf8[_0xa9bf('0x11')](0x1f4,_0x29fce4[_0xa9bf('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/user-setting/index.js b/server/api/user-setting/index.js index 5b35697..af69072 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 _0xf5c8=['update','express','Router','../../components/auth/service','./user-setting.controller','put','isAuthenticated'];(function(_0x134c70,_0x431800){var _0x4f7e39=function(_0x5f3a8b){while(--_0x5f3a8b){_0x134c70['push'](_0x134c70['shift']());}};_0x4f7e39(++_0x431800);}(_0xf5c8,0x127));var _0x8f5c=function(_0x510b98,_0x4c4cbb){_0x510b98=_0x510b98-0x0;var _0x45e775=_0xf5c8[_0x510b98];return _0x45e775;};'use strict';var express=require(_0x8f5c('0x0'));var router=express[_0x8f5c('0x1')]();var auth=require(_0x8f5c('0x2'));var controller=require(_0x8f5c('0x3'));router[_0x8f5c('0x4')]('/:id',auth[_0x8f5c('0x5')](),controller[_0x8f5c('0x6')]);module['exports']=router; \ No newline at end of file +var _0xb486=['isAuthenticated','update','express','Router','./user-setting.controller','put','/:id'];(function(_0x21a2da,_0x9f4c2b){var _0x3ff5da=function(_0x216564){while(--_0x216564){_0x21a2da['push'](_0x21a2da['shift']());}};_0x3ff5da(++_0x9f4c2b);}(_0xb486,0x72));var _0x6b48=function(_0x1140ca,_0x362693){_0x1140ca=_0x1140ca-0x0;var _0x544c5d=_0xb486[_0x1140ca];return _0x544c5d;};'use strict';var express=require(_0x6b48('0x0'));var router=express[_0x6b48('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0x6b48('0x2'));router[_0x6b48('0x3')](_0x6b48('0x4'),auth[_0x6b48('0x5')](),controller[_0x6b48('0x6')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.attributes.js b/server/api/user-setting/user-setting.attributes.js index 20c48ce..8bd85cd 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 _0xe750=['DATE','UserId','error','warning','info','exports','BOOLEAN','TEXT'];(function(_0x95d45,_0x4bb3f1){var _0x38086f=function(_0x344b59){while(--_0x344b59){_0x95d45['push'](_0x95d45['shift']());}};_0x38086f(++_0x4bb3f1);}(_0xe750,0x18a));var _0x0e75=function(_0x390915,_0x4cc6a0){_0x390915=_0x390915-0x0;var _0x1c7d8d=_0xe750[_0x390915];return _0x1c7d8d;};'use strict';var Sequelize=require('sequelize');const CLIENT_SIDE_LOG_LEVELS=[_0x0e75('0x0'),_0x0e75('0x1'),_0x0e75('0x2'),'debug'];module[_0x0e75('0x3')]={'clientSideLoggingLevel':{'type':Sequelize['ENUM'](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0x0e75('0x0'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0x0e75('0x4')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0x0e75('0x5')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0x0e75('0x6')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize['INTEGER'],'unique':_0x0e75('0x7')}}; \ No newline at end of file +var _0xde2c=['DATE','INTEGER','error','debug','ENUM','TEXT'];(function(_0x189d3c,_0x5efebf){var _0x485959=function(_0x1161da){while(--_0x1161da){_0x189d3c['push'](_0x189d3c['shift']());}};_0x485959(++_0x5efebf);}(_0xde2c,0xfe));var _0xcde2=function(_0x1c5950,_0x49e128){_0x1c5950=_0x1c5950-0x0;var _0x2b720a=_0xde2c[_0x1c5950];return _0x2b720a;};'use strict';var Sequelize=require('sequelize');const CLIENT_SIDE_LOG_LEVELS=[_0xcde2('0x0'),'warning','info',_0xcde2('0x1')];module['exports']={'clientSideLoggingLevel':{'type':Sequelize[_0xcde2('0x2')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':'error','validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0xcde2('0x3')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0xcde2('0x4')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0xcde2('0x5')],'unique':'UserId'}}; \ 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 bb8e2ad..396c754 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 _0x84ab=['status','json','then','error','stack','name','send','update','user','role','admin','Unauthorized','params','Invalid\x20user\x20setting\x20id','UserSetting','body','catch','lodash','ioredis','../../config/logger','api','../../config/environment','socket.io-emitter','redis','register','defaults'];(function(_0x36caf5,_0x6f5e8){var _0x2d907b=function(_0x2a6984){while(--_0x2a6984){_0x36caf5['push'](_0x36caf5['shift']());}};_0x2d907b(++_0x6f5e8);}(_0x84ab,0x12f));var _0xb84a=function(_0x49c057,_0xc808ed){_0x49c057=_0x49c057-0x0;var _0xd8f0e6=_0x84ab[_0x49c057];return _0xd8f0e6;};'use strict';var _=require(_0xb84a('0x0'));var Redis=require(_0xb84a('0x1'));var logger=require(_0xb84a('0x2'))(_0xb84a('0x3'));var config=require(_0xb84a('0x4'));var db=require('../../mysqldb')['db'];var socket=require(_0xb84a('0x5'))(new Redis(config[_0xb84a('0x6')]));require('./user-setting.socket')[_0xb84a('0x7')](socket);config[_0xb84a('0x6')]=_[_0xb84a('0x8')](config['redis'],{'host':'localhost','port':0x18eb});function respondWithResult(_0x4dc496,_0xd445b5){_0xd445b5=_0xd445b5||0xc8;return function(_0x4fac4d){if(_0x4fac4d){return _0x4dc496[_0xb84a('0x9')](_0xd445b5)[_0xb84a('0xa')](_0x4fac4d);}};}function saveUpdates(_0x4d9321){return function(_0x181c87){if(_0x181c87){return _0x181c87['update'](_0x4d9321)[_0xb84a('0xb')](function(_0x1886e0){return _0x1886e0;});}return null;};}function handleEntityNotFound(_0x42daf5){return function(_0x5d3b29){if(!_0x5d3b29){_0x42daf5['sendStatus'](0x194);}return _0x5d3b29;};}function handleError(_0x591de9,_0x1e0180){_0x1e0180=_0x1e0180||0x1f4;return function(_0x17379b){logger[_0xb84a('0xc')](_0x17379b[_0xb84a('0xd')]);if(_0x17379b[_0xb84a('0xe')]){delete _0x17379b['name'];}_0x591de9[_0xb84a('0x9')](_0x1e0180)[_0xb84a('0xf')](_0x17379b);};}exports[_0xb84a('0x10')]=function(_0x3c161c,_0x44b26b){if(_0x3c161c[_0xb84a('0x11')][_0xb84a('0x12')]!==_0xb84a('0x13'))throw new Error(_0xb84a('0x14'));if(isNaN(Number(_0x3c161c[_0xb84a('0x15')]['id'])))throw new Error(_0xb84a('0x16'));return db[_0xb84a('0x17')]['find']({'where':{'id':_0x3c161c[_0xb84a('0x15')]['id']}})[_0xb84a('0xb')](handleEntityNotFound(_0x44b26b,null))[_0xb84a('0xb')](saveUpdates(_0x3c161c[_0xb84a('0x18')],null))[_0xb84a('0xb')](respondWithResult(_0x44b26b,null))[_0xb84a('0x19')](handleError(_0x44b26b,null));}; \ No newline at end of file +var _0x7ec2=['stack','name','user','role','admin','Unauthorized','Invalid\x20user\x20setting\x20id','UserSetting','body','catch','lodash','ioredis','../../config/logger','../../config/environment','../../mysqldb','redis','./user-setting.socket','register','defaults','localhost','status','json','update','then','sendStatus','error'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0x7ec2,0x15c));var _0x27ec=function(_0x465879,_0xb9c424){_0x465879=_0x465879-0x0;var _0xc61910=_0x7ec2[_0x465879];return _0xc61910;};'use strict';var _=require(_0x27ec('0x0'));var Redis=require(_0x27ec('0x1'));var logger=require(_0x27ec('0x2'))('api');var config=require(_0x27ec('0x3'));var db=require(_0x27ec('0x4'))['db'];var socket=require('socket.io-emitter')(new Redis(config[_0x27ec('0x5')]));require(_0x27ec('0x6'))[_0x27ec('0x7')](socket);config[_0x27ec('0x5')]=_[_0x27ec('0x8')](config[_0x27ec('0x5')],{'host':_0x27ec('0x9'),'port':0x18eb});function respondWithResult(_0x280cdb,_0x27b57c){_0x27b57c=_0x27b57c||0xc8;return function(_0x1ad634){if(_0x1ad634){return _0x280cdb[_0x27ec('0xa')](_0x27b57c)[_0x27ec('0xb')](_0x1ad634);}};}function saveUpdates(_0x247954){return function(_0x10e587){if(_0x10e587){return _0x10e587[_0x27ec('0xc')](_0x247954)[_0x27ec('0xd')](function(_0x13c5dc){return _0x13c5dc;});}return null;};}function handleEntityNotFound(_0x19c2d8){return function(_0x37faa8){if(!_0x37faa8){_0x19c2d8[_0x27ec('0xe')](0x194);}return _0x37faa8;};}function handleError(_0x3df870,_0x56c2af){_0x56c2af=_0x56c2af||0x1f4;return function(_0x21952a){logger[_0x27ec('0xf')](_0x21952a[_0x27ec('0x10')]);if(_0x21952a[_0x27ec('0x11')]){delete _0x21952a['name'];}_0x3df870[_0x27ec('0xa')](_0x56c2af)['send'](_0x21952a);};}exports[_0x27ec('0xc')]=function(_0x436fc5,_0x161909){if(_0x436fc5[_0x27ec('0x12')][_0x27ec('0x13')]!==_0x27ec('0x14'))throw new Error(_0x27ec('0x15'));if(isNaN(Number(_0x436fc5['params']['id'])))throw new Error(_0x27ec('0x16'));return db[_0x27ec('0x17')]['find']({'where':{'id':_0x436fc5['params']['id']}})[_0x27ec('0xd')](handleEntityNotFound(_0x161909,null))['then'](saveUpdates(_0x436fc5[_0x27ec('0x18')],null))[_0x27ec('0xd')](respondWithResult(_0x161909,null))[_0x27ec('0x19')](handleError(_0x161909,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 2d5743c..ccada5c 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 _0x2f24=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','UserSetting'];(function(_0x2bd8a6,_0x5b9211){var _0x1e037a=function(_0x486e4b){while(--_0x486e4b){_0x2bd8a6['push'](_0x2bd8a6['shift']());}};_0x1e037a(++_0x5b9211);}(_0x2f24,0x1dd));var _0x42f2=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x2f24[_0x6c993a];return _0x27f547;};'use strict';var EventEmitter=require(_0x42f2('0x0'));var UserSetting=require(_0x42f2('0x1'))['db'][_0x42f2('0x2')];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0x42f2('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x42f2('0x4'),'afterDestroy':_0x42f2('0x5')};function emitEvent(_0x495c4e){return function(_0xd21ac5,_0x258c1d,_0x397a80){UserSettingEvents[_0x42f2('0x6')](_0x495c4e+':'+_0xd21ac5['id'],_0xd21ac5);UserSettingEvents[_0x42f2('0x6')](_0x495c4e,_0xd21ac5);_0x397a80(null);};}for(var e in events){if(events[_0x42f2('0x7')](e)){var event=events[e];UserSetting[_0x42f2('0x8')](e,emitEvent(event));}}module[_0x42f2('0x9')]=UserSettingEvents; \ No newline at end of file +var _0xd94a=['hasOwnProperty','../../mysqldb','UserSetting','update','remove','emit'];(function(_0x3b2955,_0x8c8483){var _0x481de2=function(_0x5897f0){while(--_0x5897f0){_0x3b2955['push'](_0x3b2955['shift']());}};_0x481de2(++_0x8c8483);}(_0xd94a,0xdf));var _0xad94=function(_0x2302f5,_0x195210){_0x2302f5=_0x2302f5-0x0;var _0x4b5477=_0xd94a[_0x2302f5];return _0x4b5477;};'use strict';var EventEmitter=require('events');var UserSetting=require(_0xad94('0x0'))['db'][_0xad94('0x1')];var UserSettingEvents=new EventEmitter();UserSettingEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xad94('0x2'),'afterDestroy':_0xad94('0x3')};function emitEvent(_0x35b0e6){return function(_0x5777cf,_0x39c545,_0x3f966e){UserSettingEvents[_0xad94('0x4')](_0x35b0e6+':'+_0x5777cf['id'],_0x5777cf);UserSettingEvents[_0xad94('0x4')](_0x35b0e6,_0x5777cf);_0x3f966e(null);};}for(var e in events){if(events[_0xad94('0x5')](e)){var event=events[e];UserSetting['hook'](e,emitEvent(event));}}module['exports']=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 f5995bb..7e70929 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 _0x2cae=['user_settings','clientSideLoggingEnabled','clientSideLoggingEnabledSince','./user-setting.attributes','exports','UserSetting'];(function(_0x2ec2bf,_0x64e983){var _0x2c279c=function(_0x41fe42){while(--_0x41fe42){_0x2ec2bf['push'](_0x2ec2bf['shift']());}};_0x2c279c(++_0x64e983);}(_0x2cae,0x16b));var _0xe2ca=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x2cae[_0x422905];return _0x33dc6c;};'use strict';var attributes=require(_0xe2ca('0x0'));module[_0xe2ca('0x1')]=function(_0x5d4b71){return _0x5d4b71['define'](_0xe2ca('0x2'),attributes,{'tableName':_0xe2ca('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x482b27){if(!_0x482b27[_0xe2ca('0x4')])_0x482b27[_0xe2ca('0x5')]=null;else if(_0x482b27[_0xe2ca('0x5')]===null)_0x482b27[_0xe2ca('0x5')]=new Date();}}});}; \ No newline at end of file +var _0x2cbd=['clientSideLoggingEnabledSince','./user-setting.attributes','exports','define','UserSetting','user_settings','clientSideLoggingEnabled'];(function(_0x29dfa5,_0xd3078e){var _0x41c15a=function(_0x10802b){while(--_0x10802b){_0x29dfa5['push'](_0x29dfa5['shift']());}};_0x41c15a(++_0xd3078e);}(_0x2cbd,0x19e));var _0xd2cb=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0x2cbd[_0x3054be];return _0x3df150;};'use strict';var attributes=require(_0xd2cb('0x0'));module[_0xd2cb('0x1')]=function(_0x5dbb01){return _0x5dbb01[_0xd2cb('0x2')](_0xd2cb('0x3'),attributes,{'tableName':_0xd2cb('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4b1b3f){if(!_0x4b1b3f[_0xd2cb('0x5')])_0x4b1b3f[_0xd2cb('0x6')]=null;else if(_0x4b1b3f['clientSideLoggingEnabledSince']===null)_0x4b1b3f['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 653028b..f081a20 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 _0x8f91=['length','user-setting:','./user-setting.events','save','remove','update','emit','user-setting:update','user-setting:update:user-','register'];(function(_0x2825ae,_0x47550e){var _0x4601fe=function(_0x5c2346){while(--_0x5c2346){_0x2825ae['push'](_0x2825ae['shift']());}};_0x4601fe(++_0x47550e);}(_0x8f91,0x188));var _0x18f9=function(_0x5cd934,_0x306544){_0x5cd934=_0x5cd934-0x0;var _0x437d94=_0x8f91[_0x5cd934];return _0x437d94;};'use strict';var UserSettingEvents=require(_0x18f9('0x0'));var events=[_0x18f9('0x1'),_0x18f9('0x2'),_0x18f9('0x3')];function createListener(_0x5c2c91,_0x5c2da3){return function(_0x1cee03){_0x5c2da3[_0x18f9('0x4')](_0x5c2c91,_0x1cee03);if(_0x5c2c91===_0x18f9('0x5')){_0x5c2da3[_0x18f9('0x4')](_0x18f9('0x6')+_0x1cee03['UserId'],_0x1cee03);}};}exports[_0x18f9('0x7')]=function(_0x51fcc0){for(var _0xa86b67=0x0,_0x4afe0d=events[_0x18f9('0x8')];_0xa86b67<_0x4afe0d;_0xa86b67++){var _0x43e0b4=events[_0xa86b67];var _0x1a7ceb=createListener(_0x18f9('0x9')+_0x43e0b4,_0x51fcc0);UserSettingEvents['on'](_0x43e0b4,_0x1a7ceb);}}; \ No newline at end of file +var _0xbb1a=['register','length','user-setting:','./user-setting.events','remove','emit','user-setting:update:user-','UserId'];(function(_0x413c76,_0x140b4d){var _0x54e6cc=function(_0xa77a4c){while(--_0xa77a4c){_0x413c76['push'](_0x413c76['shift']());}};_0x54e6cc(++_0x140b4d);}(_0xbb1a,0x143));var _0xabb1=function(_0x2c3964,_0xd7070a){_0x2c3964=_0x2c3964-0x0;var _0x32ef29=_0xbb1a[_0x2c3964];return _0x32ef29;};'use strict';var UserSettingEvents=require(_0xabb1('0x0'));var events=['save',_0xabb1('0x1'),'update'];function createListener(_0x1aa9ac,_0x39e641){return function(_0x244d9c){_0x39e641['emit'](_0x1aa9ac,_0x244d9c);if(_0x1aa9ac==='user-setting:update'){_0x39e641[_0xabb1('0x2')](_0xabb1('0x3')+_0x244d9c[_0xabb1('0x4')],_0x244d9c);}};}exports[_0xabb1('0x5')]=function(_0x168a83){for(var _0x4e00e6=0x0,_0x30ea98=events[_0xabb1('0x6')];_0x4e00e6<_0x30ea98;_0x4e00e6++){var _0xcf8a46=events[_0x4e00e6];var _0x3d3ef4=createListener(_0xabb1('0x7')+_0xcf8a46,_0x168a83);UserSettingEvents['on'](_0xcf8a46,_0x3d3ef4);}}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index 0478239..79a3906 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 _0x47b1=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','get','isAuthenticated','index','/describe','/whoami','whoami','getPresence','/:id','show','/:id/avatar','getAvatar','getOpenTabs','/:id/contacts','getContacts','getQueues','getVoiceQueuesRt','getGroups','/:id/recordings','getRecordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','/:id/teams','getLists','/:id/agents','getAgents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','getSmsAccounts','/:id/chat_websites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/scheduled_calls','getScheduledCalls','post','addContacts','create','/create_many','bulkCreate','/:id/queues','addQueues','diskStorage','join','root','server/files/images/','originalname','single','file','addAvatar','/:id/login','logout','/:id/pause','/:id/unpause','unpause','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','/:id/openchannel_accounts','addOpenchannelAccounts','/:id/sms_accounts','addSmsAccounts','addChatWebsites','addWhatsappAccounts','/:id/api_key','put','update','changePassword','delete','removeTeams','destroy','removeChatInteractions','removeMailInteractions','removeSmsInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeChatWebsites','removeApiKey','exports','util','path','connect-timeout','express'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x47b1,0x143));var _0x147b=function(_0x30a318,_0x5697b9){_0x30a318=_0x30a318-0x0;var _0x6bf89f=_0x47b1[_0x30a318];return _0x6bf89f;};'use strict';var multer=require('multer');var util=require(_0x147b('0x0'));var path=require(_0x147b('0x1'));var timeout=require(_0x147b('0x2'));var express=require(_0x147b('0x3'));var router=express[_0x147b('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x147b('0x5'));var interaction=require(_0x147b('0x6'));var config=require(_0x147b('0x7'));var controller=require(_0x147b('0x8'));router[_0x147b('0x9')]('/',auth[_0x147b('0xa')](),controller[_0x147b('0xb')]);router[_0x147b('0x9')](_0x147b('0xc'),auth[_0x147b('0xa')](),controller['describe']);router[_0x147b('0x9')](_0x147b('0xd'),auth[_0x147b('0xa')](),controller[_0x147b('0xe')]);router[_0x147b('0x9')]('/presence',auth[_0x147b('0xa')](),controller[_0x147b('0xf')]);router['get'](_0x147b('0x10'),auth['isAuthenticated'](),controller[_0x147b('0x11')]);router[_0x147b('0x9')](_0x147b('0x12'),controller[_0x147b('0x13')]);router[_0x147b('0x9')]('/:id/open_tabs',auth['isAuthenticated'](),controller[_0x147b('0x14')]);router[_0x147b('0x9')](_0x147b('0x15'),auth[_0x147b('0xa')](),controller[_0x147b('0x16')]);router[_0x147b('0x9')]('/:id/queues',auth['isAuthenticated'](),controller[_0x147b('0x17')]);router[_0x147b('0x9')]('/:id/queues_rt',auth[_0x147b('0xa')](),controller[_0x147b('0x18')]);router[_0x147b('0x9')]('/:id/groups',auth[_0x147b('0xa')](),controller[_0x147b('0x19')]);router[_0x147b('0x9')](_0x147b('0x1a'),auth['isAuthenticated'](),controller[_0x147b('0x1b')]);router[_0x147b('0x9')]('/:id/screen_recordings',auth[_0x147b('0xa')](),controller[_0x147b('0x1c')]);router[_0x147b('0x9')](_0x147b('0x1d'),auth['isAuthenticated'](),controller[_0x147b('0x1e')]);router[_0x147b('0x9')](_0x147b('0x1f'),auth[_0x147b('0xa')](),controller['getOpenchannelInteractions']);router[_0x147b('0x9')](_0x147b('0x20'),auth[_0x147b('0xa')](),controller[_0x147b('0x21')]);router[_0x147b('0x9')](_0x147b('0x22'),auth[_0x147b('0xa')](),controller[_0x147b('0x23')]);router['get'](_0x147b('0x24'),auth['isAuthenticated'](),controller[_0x147b('0x25')]);router['get']('/:id/whatsapp/interactions',auth[_0x147b('0xa')](),controller['getWhatsappInteractions']);router[_0x147b('0x9')](_0x147b('0x26'),auth['isAuthenticated'](),controller['getTeams']);router['get']('/:id/lists',auth[_0x147b('0xa')](),controller[_0x147b('0x27')]);router[_0x147b('0x9')](_0x147b('0x28'),auth['isAuthenticated'](),controller[_0x147b('0x29')]);router[_0x147b('0x9')](_0x147b('0x2a'),auth[_0x147b('0xa')](),controller[_0x147b('0x2b')]);router[_0x147b('0x9')](_0x147b('0x2c'),auth[_0x147b('0xa')](),controller[_0x147b('0x2d')]);router[_0x147b('0x9')](_0x147b('0x2e'),auth[_0x147b('0xa')](),controller[_0x147b('0x2f')]);router['get']('/:id/openchannel_accounts',auth['isAuthenticated'](),controller['getOpenchannelAccounts']);router[_0x147b('0x9')]('/:id/sms_accounts',auth[_0x147b('0xa')](),controller[_0x147b('0x30')]);router[_0x147b('0x9')](_0x147b('0x31'),auth['isAuthenticated'](),controller['getChatWebsites']);router['get'](_0x147b('0x32'),auth[_0x147b('0xa')](),controller[_0x147b('0x33')]);router[_0x147b('0x9')](_0x147b('0x34'),auth[_0x147b('0xa')](),controller[_0x147b('0x35')]);router['get']('/:id/api_key',auth['isAuthenticated'](),controller['getApiKey']);router[_0x147b('0x36')](_0x147b('0x15'),auth[_0x147b('0xa')](),controller[_0x147b('0x37')]);router[_0x147b('0x36')]('/',auth[_0x147b('0xa')](),controller[_0x147b('0x38')]);router[_0x147b('0x36')](_0x147b('0x39'),auth['isAuthenticated'](),controller[_0x147b('0x3a')]);router['post'](_0x147b('0x3b'),auth['isAuthenticated'](),controller[_0x147b('0x3c')]);var upload=multer({'storage':multer[_0x147b('0x3d')]({'destination':function(_0x672cad,_0x3ea7d0,_0x2b0c1b){_0x2b0c1b(null,path[_0x147b('0x3e')](config[_0x147b('0x3f')],_0x147b('0x40')));},'filename':function(_0x208eef,_0x40680c,_0x23cf19){_0x23cf19(null,util['format']('%s-%s',Date['now'](),_0x40680c[_0x147b('0x41')]));}})});router[_0x147b('0x36')](_0x147b('0x12'),upload[_0x147b('0x42')](_0x147b('0x43')),controller[_0x147b('0x44')]);router['post'](_0x147b('0x45'),auth['isAuthenticated'](),controller['login']);router['post']('/:id/logout',auth[_0x147b('0xa')](),controller[_0x147b('0x46')]);router[_0x147b('0x36')](_0x147b('0x47'),auth['isAuthenticated'](),controller['pause']);router[_0x147b('0x36')](_0x147b('0x48'),auth[_0x147b('0xa')](),controller[_0x147b('0x49')]);router[_0x147b('0x36')]('/:id/teams',auth[_0x147b('0xa')](),controller['addTeams']);router['post'](_0x147b('0x4a'),auth[_0x147b('0xa')](),controller[_0x147b('0x4b')]);router['post'](_0x147b('0x4c'),auth[_0x147b('0xa')](),controller['addMailInteractions']);router[_0x147b('0x36')](_0x147b('0x4d'),auth[_0x147b('0xa')](),controller[_0x147b('0x4e')]);router[_0x147b('0x36')](_0x147b('0x4f'),auth[_0x147b('0xa')](),controller[_0x147b('0x50')]);router[_0x147b('0x36')](_0x147b('0x51'),auth[_0x147b('0xa')](),controller[_0x147b('0x52')]);router[_0x147b('0x36')](_0x147b('0x53'),auth['isAuthenticated'](),controller[_0x147b('0x54')]);router[_0x147b('0x36')](_0x147b('0x2c'),auth[_0x147b('0xa')](),controller['addFaxAccounts']);router[_0x147b('0x36')](_0x147b('0x2e'),auth[_0x147b('0xa')](),controller['addMailAccounts']);router[_0x147b('0x36')](_0x147b('0x55'),auth[_0x147b('0xa')](),controller[_0x147b('0x56')]);router['post'](_0x147b('0x57'),auth[_0x147b('0xa')](),controller[_0x147b('0x58')]);router['post'](_0x147b('0x31'),auth[_0x147b('0xa')](),controller[_0x147b('0x59')]);router[_0x147b('0x36')](_0x147b('0x32'),auth[_0x147b('0xa')](),controller[_0x147b('0x5a')]);router['post'](_0x147b('0x5b'),auth[_0x147b('0xa')](),controller['createApiKey']);router[_0x147b('0x5c')](_0x147b('0x10'),auth[_0x147b('0xa')](),controller[_0x147b('0x5d')]);router[_0x147b('0x5c')]('/:id/password',auth['isAuthenticated'](),controller[_0x147b('0x5e')]);router[_0x147b('0x5f')](_0x147b('0x3b'),auth[_0x147b('0xa')](),controller['removeQueues']);router[_0x147b('0x5f')]('/:id/teams',auth[_0x147b('0xa')](),controller[_0x147b('0x60')]);router['delete'](_0x147b('0x10'),auth[_0x147b('0xa')](),controller[_0x147b('0x61')]);router[_0x147b('0x5f')]('/:id/chat_interactions',auth[_0x147b('0xa')](),controller[_0x147b('0x62')]);router[_0x147b('0x5f')]('/:id/mail_interactions',auth[_0x147b('0xa')](),controller[_0x147b('0x63')]);router[_0x147b('0x5f')](_0x147b('0x4d'),auth[_0x147b('0xa')](),controller['removeFaxInteractions']);router['delete'](_0x147b('0x4f'),auth[_0x147b('0xa')](),controller[_0x147b('0x64')]);router[_0x147b('0x5f')](_0x147b('0x51'),auth[_0x147b('0xa')](),controller[_0x147b('0x65')]);router[_0x147b('0x5f')](_0x147b('0x53'),auth[_0x147b('0xa')](),controller[_0x147b('0x66')]);router[_0x147b('0x5f')]('/:id/fax_accounts',auth[_0x147b('0xa')](),controller[_0x147b('0x67')]);router[_0x147b('0x5f')](_0x147b('0x2e'),auth['isAuthenticated'](),controller[_0x147b('0x68')]);router[_0x147b('0x5f')](_0x147b('0x55'),auth[_0x147b('0xa')](),controller[_0x147b('0x69')]);router[_0x147b('0x5f')](_0x147b('0x57'),auth[_0x147b('0xa')](),controller['removeSmsAccounts']);router[_0x147b('0x5f')]('/:id/chat_websites',auth[_0x147b('0xa')](),controller[_0x147b('0x6a')]);router[_0x147b('0x5f')]('/:id/whatsapp_accounts',auth[_0x147b('0xa')](),controller['removeWhatsappAccounts']);router[_0x147b('0x5f')](_0x147b('0x5b'),auth[_0x147b('0xa')](),controller[_0x147b('0x6b')]);router[_0x147b('0x36')]('/:id/messengerSoundNotification',auth['isAuthenticated'](),controller['messengerSoundNotification']);module[_0x147b('0x6c')]=router; \ No newline at end of file +var _0xdfe2=['getGroups','/:id/recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','/:id/mail/interactions','getMailInteractions','/:id/fax/interactions','getFaxInteractions','getWhatsappInteractions','getTeams','/:id/lists','getLists','/:id/agents','getAgents','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','getApiKey','post','addContacts','create','/create_many','bulkCreate','diskStorage','root','server/files/images/','now','originalname','addAvatar','/:id/login','login','logout','/:id/pause','unpause','/:id/teams','addTeams','/:id/mail_interactions','addMailInteractions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','addOpenchannelInteractions','/:id/whatsapp_interactions','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','addSmsAccounts','addChatWebsites','put','update','/:id/password','changePassword','delete','/:id/queues','removeQueues','removeTeams','destroy','/:id/chat_interactions','removeChatInteractions','removeMailInteractions','/:id/fax_interactions','removeFaxInteractions','removeSmsInteractions','/:id/openchannel_interactions','removeOpenchannelInteractions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','removeApiKey','/:id/messengerSoundNotification','messengerSoundNotification','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','get','isAuthenticated','index','/describe','describe','/whoami','whoami','/presence','getPresence','/:id','/:id/avatar','getAvatar','/:id/open_tabs','/:id/contacts','getContacts','getVoiceQueuesRt'];(function(_0x59f670,_0x2a34aa){var _0x4ad264=function(_0x4a8709){while(--_0x4a8709){_0x59f670['push'](_0x59f670['shift']());}};_0x4ad264(++_0x2a34aa);}(_0xdfe2,0x1b1));var _0x2dfe=function(_0x39e283,_0x247e6b){_0x39e283=_0x39e283-0x0;var _0x7de89f=_0xdfe2[_0x39e283];return _0x7de89f;};'use strict';var multer=require(_0x2dfe('0x0'));var util=require(_0x2dfe('0x1'));var path=require(_0x2dfe('0x2'));var timeout=require(_0x2dfe('0x3'));var express=require(_0x2dfe('0x4'));var router=express[_0x2dfe('0x5')]();var fs_extra=require(_0x2dfe('0x6'));var auth=require(_0x2dfe('0x7'));var interaction=require(_0x2dfe('0x8'));var config=require(_0x2dfe('0x9'));var controller=require(_0x2dfe('0xa'));router[_0x2dfe('0xb')]('/',auth[_0x2dfe('0xc')](),controller[_0x2dfe('0xd')]);router[_0x2dfe('0xb')](_0x2dfe('0xe'),auth['isAuthenticated'](),controller[_0x2dfe('0xf')]);router['get'](_0x2dfe('0x10'),auth[_0x2dfe('0xc')](),controller[_0x2dfe('0x11')]);router[_0x2dfe('0xb')](_0x2dfe('0x12'),auth[_0x2dfe('0xc')](),controller[_0x2dfe('0x13')]);router[_0x2dfe('0xb')](_0x2dfe('0x14'),auth[_0x2dfe('0xc')](),controller['show']);router[_0x2dfe('0xb')](_0x2dfe('0x15'),controller[_0x2dfe('0x16')]);router[_0x2dfe('0xb')](_0x2dfe('0x17'),auth[_0x2dfe('0xc')](),controller['getOpenTabs']);router[_0x2dfe('0xb')](_0x2dfe('0x18'),auth['isAuthenticated'](),controller[_0x2dfe('0x19')]);router['get']('/:id/queues',auth[_0x2dfe('0xc')](),controller['getQueues']);router[_0x2dfe('0xb')]('/:id/queues_rt',auth['isAuthenticated'](),controller[_0x2dfe('0x1a')]);router[_0x2dfe('0xb')]('/:id/groups',auth['isAuthenticated'](),controller[_0x2dfe('0x1b')]);router['get'](_0x2dfe('0x1c'),auth[_0x2dfe('0xc')](),controller['getRecordings']);router[_0x2dfe('0xb')]('/:id/screen_recordings',auth[_0x2dfe('0xc')](),controller[_0x2dfe('0x1d')]);router[_0x2dfe('0xb')](_0x2dfe('0x1e'),auth['isAuthenticated'](),controller[_0x2dfe('0x1f')]);router['get'](_0x2dfe('0x20'),auth['isAuthenticated'](),controller['getOpenchannelInteractions']);router[_0x2dfe('0xb')](_0x2dfe('0x21'),auth[_0x2dfe('0xc')](),controller[_0x2dfe('0x22')]);router[_0x2dfe('0xb')]('/:id/sms/interactions',auth[_0x2dfe('0xc')](),controller['getSmsInteractions']);router[_0x2dfe('0xb')](_0x2dfe('0x23'),auth[_0x2dfe('0xc')](),controller[_0x2dfe('0x24')]);router[_0x2dfe('0xb')]('/:id/whatsapp/interactions',auth[_0x2dfe('0xc')](),controller[_0x2dfe('0x25')]);router['get']('/:id/teams',auth[_0x2dfe('0xc')](),controller[_0x2dfe('0x26')]);router['get'](_0x2dfe('0x27'),auth[_0x2dfe('0xc')](),controller[_0x2dfe('0x28')]);router[_0x2dfe('0xb')](_0x2dfe('0x29'),auth['isAuthenticated'](),controller[_0x2dfe('0x2a')]);router[_0x2dfe('0xb')]('/:id/prefixes',auth[_0x2dfe('0xc')](),controller['getVoicePrefixes']);router[_0x2dfe('0xb')](_0x2dfe('0x2b'),auth[_0x2dfe('0xc')](),controller[_0x2dfe('0x2c')]);router[_0x2dfe('0xb')](_0x2dfe('0x2d'),auth[_0x2dfe('0xc')](),controller[_0x2dfe('0x2e')]);router[_0x2dfe('0xb')](_0x2dfe('0x2f'),auth[_0x2dfe('0xc')](),controller[_0x2dfe('0x30')]);router[_0x2dfe('0xb')](_0x2dfe('0x31'),auth['isAuthenticated'](),controller[_0x2dfe('0x32')]);router[_0x2dfe('0xb')](_0x2dfe('0x33'),auth['isAuthenticated'](),controller[_0x2dfe('0x34')]);router[_0x2dfe('0xb')](_0x2dfe('0x35'),auth[_0x2dfe('0xc')](),controller[_0x2dfe('0x36')]);router[_0x2dfe('0xb')](_0x2dfe('0x37'),auth['isAuthenticated'](),controller[_0x2dfe('0x38')]);router[_0x2dfe('0xb')](_0x2dfe('0x39'),auth[_0x2dfe('0xc')](),controller[_0x2dfe('0x3a')]);router[_0x2dfe('0x3b')](_0x2dfe('0x18'),auth['isAuthenticated'](),controller[_0x2dfe('0x3c')]);router[_0x2dfe('0x3b')]('/',auth[_0x2dfe('0xc')](),controller[_0x2dfe('0x3d')]);router[_0x2dfe('0x3b')](_0x2dfe('0x3e'),auth[_0x2dfe('0xc')](),controller[_0x2dfe('0x3f')]);router[_0x2dfe('0x3b')]('/:id/queues',auth[_0x2dfe('0xc')](),controller['addQueues']);var upload=multer({'storage':multer[_0x2dfe('0x40')]({'destination':function(_0xc548ed,_0x12b9d5,_0x12c5a5){_0x12c5a5(null,path['join'](config[_0x2dfe('0x41')],_0x2dfe('0x42')));},'filename':function(_0x1940de,_0xc3763b,_0x4c6f4b){_0x4c6f4b(null,util['format']('%s-%s',Date[_0x2dfe('0x43')](),_0xc3763b[_0x2dfe('0x44')]));}})});router[_0x2dfe('0x3b')]('/:id/avatar',upload['single']('file'),controller[_0x2dfe('0x45')]);router[_0x2dfe('0x3b')](_0x2dfe('0x46'),auth[_0x2dfe('0xc')](),controller[_0x2dfe('0x47')]);router[_0x2dfe('0x3b')]('/:id/logout',auth['isAuthenticated'](),controller[_0x2dfe('0x48')]);router[_0x2dfe('0x3b')](_0x2dfe('0x49'),auth[_0x2dfe('0xc')](),controller['pause']);router['post']('/:id/unpause',auth[_0x2dfe('0xc')](),controller[_0x2dfe('0x4a')]);router[_0x2dfe('0x3b')](_0x2dfe('0x4b'),auth[_0x2dfe('0xc')](),controller[_0x2dfe('0x4c')]);router['post']('/:id/chat_interactions',auth['isAuthenticated'](),controller['addChatInteractions']);router['post'](_0x2dfe('0x4d'),auth[_0x2dfe('0xc')](),controller[_0x2dfe('0x4e')]);router[_0x2dfe('0x3b')]('/:id/fax_interactions',auth[_0x2dfe('0xc')](),controller[_0x2dfe('0x4f')]);router['post'](_0x2dfe('0x50'),auth['isAuthenticated'](),controller[_0x2dfe('0x51')]);router[_0x2dfe('0x3b')]('/:id/openchannel_interactions',auth[_0x2dfe('0xc')](),controller[_0x2dfe('0x52')]);router[_0x2dfe('0x3b')](_0x2dfe('0x53'),auth[_0x2dfe('0xc')](),controller['addWhatsappInteractions']);router[_0x2dfe('0x3b')](_0x2dfe('0x2b'),auth[_0x2dfe('0xc')](),controller[_0x2dfe('0x54')]);router['post'](_0x2dfe('0x2d'),auth[_0x2dfe('0xc')](),controller[_0x2dfe('0x55')]);router['post']('/:id/openchannel_accounts',auth[_0x2dfe('0xc')](),controller[_0x2dfe('0x56')]);router[_0x2dfe('0x3b')]('/:id/sms_accounts',auth[_0x2dfe('0xc')](),controller[_0x2dfe('0x57')]);router[_0x2dfe('0x3b')]('/:id/chat_websites',auth[_0x2dfe('0xc')](),controller[_0x2dfe('0x58')]);router[_0x2dfe('0x3b')](_0x2dfe('0x35'),auth[_0x2dfe('0xc')](),controller['addWhatsappAccounts']);router[_0x2dfe('0x3b')](_0x2dfe('0x39'),auth['isAuthenticated'](),controller['createApiKey']);router[_0x2dfe('0x59')](_0x2dfe('0x14'),auth['isAuthenticated'](),controller[_0x2dfe('0x5a')]);router['put'](_0x2dfe('0x5b'),auth[_0x2dfe('0xc')](),controller[_0x2dfe('0x5c')]);router[_0x2dfe('0x5d')](_0x2dfe('0x5e'),auth['isAuthenticated'](),controller[_0x2dfe('0x5f')]);router[_0x2dfe('0x5d')](_0x2dfe('0x4b'),auth[_0x2dfe('0xc')](),controller[_0x2dfe('0x60')]);router[_0x2dfe('0x5d')](_0x2dfe('0x14'),auth['isAuthenticated'](),controller[_0x2dfe('0x61')]);router[_0x2dfe('0x5d')](_0x2dfe('0x62'),auth[_0x2dfe('0xc')](),controller[_0x2dfe('0x63')]);router[_0x2dfe('0x5d')](_0x2dfe('0x4d'),auth['isAuthenticated'](),controller[_0x2dfe('0x64')]);router[_0x2dfe('0x5d')](_0x2dfe('0x65'),auth[_0x2dfe('0xc')](),controller[_0x2dfe('0x66')]);router[_0x2dfe('0x5d')](_0x2dfe('0x50'),auth[_0x2dfe('0xc')](),controller[_0x2dfe('0x67')]);router[_0x2dfe('0x5d')](_0x2dfe('0x68'),auth[_0x2dfe('0xc')](),controller[_0x2dfe('0x69')]);router[_0x2dfe('0x5d')](_0x2dfe('0x53'),auth[_0x2dfe('0xc')](),controller[_0x2dfe('0x6a')]);router[_0x2dfe('0x5d')](_0x2dfe('0x2b'),auth['isAuthenticated'](),controller[_0x2dfe('0x6b')]);router[_0x2dfe('0x5d')]('/:id/mail_accounts',auth['isAuthenticated'](),controller[_0x2dfe('0x6c')]);router['delete']('/:id/openchannel_accounts',auth[_0x2dfe('0xc')](),controller['removeOpenchannelAccounts']);router['delete'](_0x2dfe('0x31'),auth[_0x2dfe('0xc')](),controller[_0x2dfe('0x6d')]);router[_0x2dfe('0x5d')](_0x2dfe('0x33'),auth[_0x2dfe('0xc')](),controller[_0x2dfe('0x6e')]);router[_0x2dfe('0x5d')](_0x2dfe('0x35'),auth['isAuthenticated'](),controller[_0x2dfe('0x6f')]);router[_0x2dfe('0x5d')](_0x2dfe('0x39'),auth[_0x2dfe('0xc')](),controller[_0x2dfe('0x70')]);router['post'](_0x2dfe('0x71'),auth[_0x2dfe('0xc')](),controller[_0x2dfe('0x72')]);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 ff08896..0c462b9 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 _0xa16f=['transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','info','shortinfo','inband','auto','rfc2833','yes','nonat','update','outgoing','force_rport,comedia','join','nat','ulaw;alaw;gsm','allow','insecure','never','\x22\x22\x20<>','always','accept','refuse','originate','uac','active','actpass','update,nonat','DATE','TEXT','showWebBar','get','isArray','udp','wss','encryption','avpf','force_avp','icesupport','dtlsenable','dtlsverify','dtlscertfile','dtlsprivatekey','rtcp_mux','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blockedAt','UNSIGNED','sequelize','util','lodash','STRING','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','fullname','callerid','getDataValue','internal','email','ENUM','user','agent','telephone','accountcode','format','\x22%s\x22\x20<%s>','BOOLEAN','DEFAULT\x20PAUSE','INTEGER','friend','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','PROHIB_PASSED_SCREEN','PROHIB'];(function(_0x52b032,_0x2cd420){var _0x206171=function(_0x6bd1a9){while(--_0x6bd1a9){_0x52b032['push'](_0x52b032['shift']());}};_0x206171(++_0x2cd420);}(_0xa16f,0xe4));var _0xfa16=function(_0x6b072a,_0x137ab6){_0x6b072a=_0x6b072a-0x0;var _0x49b165=_0xa16f[_0x6b072a];return _0x49b165;};'use strict';var Sequelize=require(_0xfa16('0x0'));var moment=require('moment');var util=require(_0xfa16('0x1'));var _=require(_0xfa16('0x2'));module['exports']={'name':{'type':Sequelize[_0xfa16('0x3')],'allowNull':![],'unique':_0xfa16('0x4'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x1c2016){this['setDataValue'](_0xfa16('0x4'),_0x1c2016);this[_0xfa16('0x5')](_0xfa16('0x6'),_0x1c2016);},'comment':_0xfa16('0x7')},'fullname':{'type':Sequelize[_0xfa16('0x3')],'allowNull':![],'set':function(_0x569854){this[_0xfa16('0x5')](_0xfa16('0x8'),_0x569854);this['setDataValue'](_0xfa16('0x9'),util['format']('\x22%s\x22\x20<%s>',_0x569854,this[_0xfa16('0xa')](_0xfa16('0xb'))));}},'alias':{'type':Sequelize[_0xfa16('0x3')]},'email':{'type':Sequelize[_0xfa16('0x3')],'allowNull':![],'unique':_0xfa16('0xc'),'validate':{'isEmail':!![]},'set':function(_0x3270ad){if(_0x3270ad){this[_0xfa16('0x5')](_0xfa16('0xc'),_0x3270ad['toLowerCase']());}}},'role':{'type':Sequelize[_0xfa16('0xd')]('admin',_0xfa16('0xe'),_0xfa16('0xf'),_0xfa16('0x10')),'allowNull':![]},'password':{'type':Sequelize[_0xfa16('0x3')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0xfa16('0x3')],'defaultValue':'local'},'internal':{'type':Sequelize['INTEGER'](0xb),'allowNull':![],'unique':_0xfa16('0xb'),'set':function(_0x5b2543){this[_0xfa16('0x5')](_0xfa16('0xb'),_0x5b2543);this['setDataValue'](_0xfa16('0x11'),_0x5b2543);this[_0xfa16('0x5')](_0xfa16('0x9'),util[_0xfa16('0x12')](_0xfa16('0x13'),this[_0xfa16('0xa')](_0xfa16('0x8')),_0x5b2543));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xfa16('0x3')]},'mobile':{'type':Sequelize[_0xfa16('0x3')]},'address':{'type':Sequelize[_0xfa16('0x3')]},'zipcode':{'type':Sequelize[_0xfa16('0x3')]},'userpic':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xfa16('0x3')]},'country':{'type':Sequelize['STRING']},'online':{'type':Sequelize[_0xfa16('0x14')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize['DATE']},'voicePause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatPause':{'type':Sequelize[_0xfa16('0x14')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0xfa16('0x14')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0xfa16('0x14')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0xfa16('0x14')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0xfa16('0x14')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0xfa16('0x14')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0xfa16('0x3')],'defaultValue':_0xfa16('0x15')},'lastPauseAt':{'type':Sequelize['DATE']},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0xfa16('0x16')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0xfa16('0x16')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0xfa16('0x16')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0xfa16('0x14')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0xfa16('0x14')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0xfa16('0x16')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0xfa16('0x16')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0xfa16('0x14')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize['INTEGER'],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0xfa16('0x14')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0xfa16('0x14')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0xfa16('0x14')],'defaultValue':![]},'description':{'type':Sequelize[_0xfa16('0x3')],'allowNull':!![]},'host':{'type':Sequelize[_0xfa16('0x3')],'allowNull':!![],'defaultValue':'dynamic'},'ipaddr':{'type':Sequelize['STRING'],'allowNull':!![]},'port':{'type':Sequelize[_0xfa16('0x16')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0xfa16('0x16')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0xfa16('0x3')],'allowNull':!![]},'regserver':{'type':Sequelize[_0xfa16('0x3')],'allowNull':!![]},'useragent':{'type':Sequelize['STRING'],'allowNull':!![]},'lastms':{'type':Sequelize[_0xfa16('0x16')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0xfa16('0xd')](_0xfa16('0x17'),_0xfa16('0xe'),'peer'),'allowNull':!![],'defaultValue':_0xfa16('0x17')},'context':{'type':Sequelize[_0xfa16('0x3')],'allowNull':!![],'defaultValue':_0xfa16('0x18')},'callingpres':{'type':Sequelize[_0xfa16('0xd')](_0xfa16('0x19'),_0xfa16('0x1a'),_0xfa16('0x1b'),'ALLOWED','PROHIB_NOT_SCREENED',_0xfa16('0x1c'),'PROHIB_FAILED_SCREEN',_0xfa16('0x1d')),'allowNull':!![]},'deny':{'type':Sequelize['STRING'],'allowNull':!![]},'permit':{'type':Sequelize[_0xfa16('0x3')],'allowNull':!![]},'secret':{'type':Sequelize[_0xfa16('0x3')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0xfa16('0x3')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0xfa16('0x3')],'allowNull':!![]},'transport':{'type':Sequelize[_0xfa16('0x3')],'allowNull':!![],'defaultValue':'udp','set':function(_0x3cff43){this[_0xfa16('0x5')](_0xfa16('0x1e'),_0x3cff43?_0x3cff43['join'](','):null);},'get':function(){return this[_0xfa16('0xa')](_0xfa16('0x1e'))?this[_0xfa16('0xa')](_0xfa16('0x1e'))[_0xfa16('0x1f')](','):null;},'comment':_0xfa16('0x20')},'dtmfmode':{'type':Sequelize[_0xfa16('0xd')]('rfc2833',_0xfa16('0x21'),_0xfa16('0x22'),_0xfa16('0x23'),_0xfa16('0x24')),'allowNull':!![],'defaultValue':_0xfa16('0x25')},'directmedia':{'type':Sequelize[_0xfa16('0xd')](_0xfa16('0x26'),'no',_0xfa16('0x27'),_0xfa16('0x28'),_0xfa16('0x29')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xfa16('0xd')](_0xfa16('0x26'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING'],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0xfa16('0x3')],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xfa16('0x2a'),'set':function(_0x194f29){this[_0xfa16('0x5')]('nat',_0x194f29?_0x194f29[_0xfa16('0x2b')](','):null);},'get':function(){return this['getDataValue'](_0xfa16('0x2c'))?this['getDataValue'](_0xfa16('0x2c'))[_0xfa16('0x1f')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0xfa16('0x3')]},'language':{'type':Sequelize[_0xfa16('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xfa16('0x3')]},'disallow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'all'},'allow':{'type':Sequelize[_0xfa16('0x3')],'allowNull':![],'defaultValue':_0xfa16('0x2d'),'set':function(_0x9ba0dd){this['setDataValue'](_0xfa16('0x2e'),_0x9ba0dd?_0x9ba0dd[_0xfa16('0x2b')](';'):_0xfa16('0x2d'));},'get':function(){return this[_0xfa16('0xa')](_0xfa16('0x2e'))?this['getDataValue'](_0xfa16('0x2e'))[_0xfa16('0x1f')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize[_0xfa16('0xd')]('yes','no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0xfa16('0x3')],'allowNull':!![],'set':function(_0x3e515a){this[_0xfa16('0x5')]('insecure',_0x3e515a?_0x3e515a['join'](','):null);},'get':function(){return this[_0xfa16('0xa')](_0xfa16('0x2f'))?this[_0xfa16('0xa')]('insecure')[_0xfa16('0x1f')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0xfa16('0xd')](_0xfa16('0x26'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xfa16('0xd')](_0xfa16('0x26'),'no',_0xfa16('0x30')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0xfa16('0xd')](_0xfa16('0x26'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0xfa16('0xd')]('yes','no'),'allowNull':!![]},'accountcode':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0xfa16('0x3')],'allowNull':!![]},'callerid':{'type':Sequelize[_0xfa16('0x3')],'allowNull':!![],'defaultValue':_0xfa16('0x31')},'amaflags':{'type':Sequelize[_0xfa16('0x3')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0xfa16('0xd')](_0xfa16('0x26'),'no'),'allowNull':!![],'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0xfa16('0x16')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0xfa16('0xd')](_0xfa16('0x26'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0xfa16('0xd')](_0xfa16('0x26'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize['ENUM'](_0xfa16('0x26'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0xfa16('0xd')](_0xfa16('0x26'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0xfa16('0x3')],'allowNull':!![]},'template':{'type':Sequelize[_0xfa16('0x3')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0xfa16('0xd')](_0xfa16('0x26'),'no',_0xfa16('0x32')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xfa16('0x16')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0xfa16('0xd')](_0xfa16('0x26'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0xfa16('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0xfa16('0xd')](_0xfa16('0x33'),_0xfa16('0x34'),_0xfa16('0x35')),'allowNull':!![]},'session_expires':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize['ENUM'](_0xfa16('0x36'),'uas'),'allowNull':!![],'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize['STRING'],'allowNull':!![]},'regexten':{'type':Sequelize['STRING'],'allowNull':!![]},'fromdomain':{'type':Sequelize['STRING'],'allowNull':!![]},'fromuser':{'type':Sequelize[_0xfa16('0x3')],'allowNull':!![]},'qualify':{'type':Sequelize[_0xfa16('0xd')](_0xfa16('0x26'),'no'),'allowNull':!![],'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0xfa16('0x16')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0xfa16('0x3')],'allowNull':!![]},'defaultuser':{'type':Sequelize['STRING'],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0xfa16('0x16')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0xfa16('0x16')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0xfa16('0x16')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0xfa16('0xd')](_0xfa16('0x26'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xfa16('0x3')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0xfa16('0x3')],'allowNull':!![]},'timert1':{'type':Sequelize[_0xfa16('0x16')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0xfa16('0x16')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0xfa16('0x16')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0xfa16('0x3')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0xfa16('0x3')],'allowNull':!![]},'contactacl':{'type':Sequelize['STRING'],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0xfa16('0x3')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0xfa16('0x3')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0xfa16('0x16')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0xfa16('0xd')](_0xfa16('0x26'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0xfa16('0xd')]('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0xfa16('0xd')](_0xfa16('0x26'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0xfa16('0xd')](_0xfa16('0x26'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0xfa16('0xd')](_0xfa16('0x26'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0xfa16('0xd')]('yes','no','fingerprint','certificate'),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0xfa16('0x16')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0xfa16('0x3')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0xfa16('0x3')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0xfa16('0x3')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0xfa16('0x3')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0xfa16('0x3')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0xfa16('0xd')](_0xfa16('0x37'),'passive',_0xfa16('0x38')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xfa16('0x3')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0xfa16('0xd')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xfa16('0x3')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0xfa16('0x3')],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize['ENUM'](_0xfa16('0x26'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0xfa16('0xd')](_0xfa16('0x26'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize['STRING'],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0xfa16('0x3')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0xfa16('0x3')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0xfa16('0x3')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0xfa16('0xd')]('yes','no',_0xfa16('0x27'),'update',_0xfa16('0x39')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0xfa16('0x14')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0xfa16('0x3')]},'resetPasswordExpires':{'type':Sequelize[_0xfa16('0x3a')]},'passwordResetAt':{'type':Sequelize[_0xfa16('0x3a')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0xfa16('0x3b')]},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x37ce35){this[_0xfa16('0x5')](_0xfa16('0x3c'),_0x37ce35);var _0x3737b9=this[_0xfa16('0x3d')]({'plain':!![]});switch(_0x37ce35){case 0x0:case 0x1:var _0x7cbb97=_0x3737b9[_0xfa16('0x1e')]?_[_0xfa16('0x3e')](_0x3737b9[_0xfa16('0x1e')])?_0x3737b9[_0xfa16('0x1e')][_0xfa16('0x2b')]():_0x3737b9[_0xfa16('0x1e')]:_0xfa16('0x3f');if(_0x7cbb97===_0xfa16('0x40')){_0x7cbb97=_0xfa16('0x3f');}this[_0xfa16('0x5')]('transport',_0x7cbb97);this['setDataValue'](_0xfa16('0x41'),'no');this[_0xfa16('0x5')](_0xfa16('0x42'),null);this['setDataValue'](_0xfa16('0x43'),null);this[_0xfa16('0x5')](_0xfa16('0x44'),null);this[_0xfa16('0x5')](_0xfa16('0x45'),null);this['setDataValue'](_0xfa16('0x46'),null);this[_0xfa16('0x5')]('dtlssetup',null);this[_0xfa16('0x5')](_0xfa16('0x47'),null);this[_0xfa16('0x5')](_0xfa16('0x48'),null);this[_0xfa16('0x5')](_0xfa16('0x49'),'no');break;case 0x2:this[_0xfa16('0x5')](_0xfa16('0x1e'),_0xfa16('0x40'));this['setDataValue'](_0xfa16('0x41'),_0xfa16('0x26'));this['setDataValue'](_0xfa16('0x42'),_0xfa16('0x26'));this[_0xfa16('0x5')](_0xfa16('0x43'),'yes');this['setDataValue']('icesupport',_0xfa16('0x26'));this[_0xfa16('0x5')](_0xfa16('0x45'),_0xfa16('0x26'));this[_0xfa16('0x5')](_0xfa16('0x46'),'no');this['setDataValue']('dtlssetup',_0xfa16('0x38'));this[_0xfa16('0x5')](_0xfa16('0x47'),_0x3737b9[_0xfa16('0x47')]||_0xfa16('0x4a'));this[_0xfa16('0x5')](_0xfa16('0x48'),_0x3737b9[_0xfa16('0x48')]||_0xfa16('0x4b'));this[_0xfa16('0x5')]('rtcp_mux',_0xfa16('0x26'));break;default:}}},'permissions':{'type':Sequelize[_0xfa16('0x3b')],'set':function(_0x14a3e0){this[_0xfa16('0x5')](_0xfa16('0x4c'),_0x14a3e0?_0x14a3e0['join'](','):[]);},'get':function(){return this[_0xfa16('0xa')](_0xfa16('0x4c'))?_[_0xfa16('0x4d')](this[_0xfa16('0xa')](_0xfa16('0x4c'))['split'](','),function(_0x3516da){return parseInt(_0x3516da,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize['STRING']},'phoneBarNoReplyNumber':{'type':Sequelize[_0xfa16('0x3')]},'phoneBarBusyNumber':{'type':Sequelize[_0xfa16('0x3')]},'phoneBarUnconditional':{'type':Sequelize[_0xfa16('0x14')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0xfa16('0x14')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0xfa16('0x14')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0xfa16('0x14')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0xfa16('0x14')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0xfa16('0x16')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize['STRING'],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0xfa16('0x16')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0xfa16('0xd')]('yes','no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0xfa16('0x14')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0xfa16('0x3')]},'phoneBarEnableJaws':{'type':Sequelize[_0xfa16('0x14')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0xfa16('0x4e')],'get':function(){return this['getDataValue']('phoneBarEnableScreenRecordingByAgent')?this[_0xfa16('0xa')](_0xfa16('0x4f')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0xfa16('0x14')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0xfa16('0x14')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0xfa16('0x14')],'defaultValue':![]},'interface':{'type':Sequelize[_0xfa16('0x3')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0xfa16('0x14')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0xfa16('0x3')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize['STRING'],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0xfa16('0x14')],'defaultValue':![],'set':function(_0x34d62e){if(typeof _0x34d62e===_0xfa16('0x50')){var _0x26de87=_0x34d62e==='1'?!![]:_0x34d62e==='0'?![]:_0x34d62e===_0xfa16('0x51')?!![]:_0x34d62e===_0xfa16('0x52')?![]:![];this[_0xfa16('0x5')](_0xfa16('0x53'),_0x26de87);}else{this['setDataValue'](_0xfa16('0x53'),_0x34d62e);}}},'blocked':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x302bbb){this[_0xfa16('0x5')]('blocked',_0x302bbb);if(_0x302bbb===!![]){this[_0xfa16('0x5')](_0xfa16('0x54'),moment());this[_0xfa16('0x5')]('loginAttempts',0x0);}else{this['setDataValue'](_0xfa16('0x54'),null);}}},'blockedAt':{'type':Sequelize['DATE'],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0xfa16('0x16')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0xfa16('0x14')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0xfa16('0x14')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0xfa16('0x16')](0x5)[_0xfa16('0x55')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xfa16('0x14')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0xfa16('0x14')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0xfa16('0x14')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0xfa16('0x14')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0xfa16('0x16')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0xfa16('0x14')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize[_0xfa16('0x16')],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0xfa16('0x14')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize[_0xfa16('0x16')],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0xfa16('0x16')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0xfa16('0x14')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0xfa16('0x16')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0xfa16('0x14')],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize[_0xfa16('0x16')],'defaultValue':0x0},'messengerSoundNotification':{'type':Sequelize[_0xfa16('0x14')],'defaultValue':![]}}; \ No newline at end of file +var _0xc961=['force_avp','icesupport','dtlsenable','dtlsverify','dtlscertfile','dtlsprivatekey','rtcp_mux','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','screenrecording','blockedAt','loginAttempts','UNSIGNED','sequelize','moment','util','lodash','exports','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','STRING','fullname','callerid','format','\x22%s\x22\x20<%s>','getDataValue','internal','email','toLowerCase','ENUM','user','agent','telephone','INTEGER','accountcode','BOOLEAN','DATE','DEFAULT\x20PAUSE','dynamic','friend','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','shortinfo','inband','auto','update','outgoing','yes','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','\x22\x22\x20<>','always','accept','refuse','originate','uac','uas','fingerprint','active','passive','actpass','nonat','update,nonat','TEXT','showWebBar','get','isArray','wss','encryption','avpf'];(function(_0x66d46a,_0x304ea8){var _0x181123=function(_0x278f13){while(--_0x278f13){_0x66d46a['push'](_0x66d46a['shift']());}};_0x181123(++_0x304ea8);}(_0xc961,0x196));var _0x1c96=function(_0x820bf2,_0x5c6e3a){_0x820bf2=_0x820bf2-0x0;var _0x2962c1=_0xc961[_0x820bf2];return _0x2962c1;};'use strict';var Sequelize=require(_0x1c96('0x0'));var moment=require(_0x1c96('0x1'));var util=require(_0x1c96('0x2'));var _=require(_0x1c96('0x3'));module[_0x1c96('0x4')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x211dfa){this['setDataValue']('name',_0x211dfa);this[_0x1c96('0x5')](_0x1c96('0x6'),_0x211dfa);},'comment':_0x1c96('0x7')},'fullname':{'type':Sequelize[_0x1c96('0x8')],'allowNull':![],'set':function(_0x1d7655){this['setDataValue'](_0x1c96('0x9'),_0x1d7655);this[_0x1c96('0x5')](_0x1c96('0xa'),util[_0x1c96('0xb')](_0x1c96('0xc'),_0x1d7655,this[_0x1c96('0xd')](_0x1c96('0xe'))));}},'alias':{'type':Sequelize[_0x1c96('0x8')]},'email':{'type':Sequelize[_0x1c96('0x8')],'allowNull':![],'unique':_0x1c96('0xf'),'validate':{'isEmail':!![]},'set':function(_0x20cd5b){if(_0x20cd5b){this[_0x1c96('0x5')](_0x1c96('0xf'),_0x20cd5b[_0x1c96('0x10')]());}}},'role':{'type':Sequelize[_0x1c96('0x11')]('admin',_0x1c96('0x12'),_0x1c96('0x13'),_0x1c96('0x14')),'allowNull':![]},'password':{'type':Sequelize[_0x1c96('0x8')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x1c96('0x8')],'defaultValue':'local'},'internal':{'type':Sequelize[_0x1c96('0x15')](0xb),'allowNull':![],'unique':_0x1c96('0xe'),'set':function(_0x224e8f){this['setDataValue'](_0x1c96('0xe'),_0x224e8f);this[_0x1c96('0x5')](_0x1c96('0x16'),_0x224e8f);this['setDataValue']('callerid',util['format'](_0x1c96('0xc'),this[_0x1c96('0xd')](_0x1c96('0x9')),_0x224e8f));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x1c96('0x8')]},'mobile':{'type':Sequelize[_0x1c96('0x8')]},'address':{'type':Sequelize[_0x1c96('0x8')]},'zipcode':{'type':Sequelize[_0x1c96('0x8')]},'userpic':{'type':Sequelize[_0x1c96('0x8')]},'city':{'type':Sequelize[_0x1c96('0x8')]},'country':{'type':Sequelize[_0x1c96('0x8')]},'online':{'type':Sequelize[_0x1c96('0x17')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x1c96('0x18')]},'voicePause':{'type':Sequelize[_0x1c96('0x17')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x1c96('0x17')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x1c96('0x17')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x1c96('0x17')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x1c96('0x17')],'defaultValue':![]},'whatsappPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'openchannelPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x1c96('0x8')],'defaultValue':_0x1c96('0x19')},'lastPauseAt':{'type':Sequelize[_0x1c96('0x18')]},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x1c96('0x15')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x1c96('0x15')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x1c96('0x15')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x1c96('0x15')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x1c96('0x17')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x1c96('0x17')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x1c96('0x15')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x1c96('0x17')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize['INTEGER'],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chanspy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0x1c96('0x8')],'allowNull':!![]},'host':{'type':Sequelize[_0x1c96('0x8')],'allowNull':!![],'defaultValue':_0x1c96('0x1a')},'ipaddr':{'type':Sequelize[_0x1c96('0x8')],'allowNull':!![]},'port':{'type':Sequelize[_0x1c96('0x15')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize['STRING'],'allowNull':!![]},'regserver':{'type':Sequelize[_0x1c96('0x8')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x1c96('0x8')],'allowNull':!![]},'lastms':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x1c96('0x11')](_0x1c96('0x1b'),_0x1c96('0x12'),_0x1c96('0x1c')),'allowNull':!![],'defaultValue':'friend'},'context':{'type':Sequelize[_0x1c96('0x8')],'allowNull':!![],'defaultValue':_0x1c96('0x1d')},'callingpres':{'type':Sequelize[_0x1c96('0x11')](_0x1c96('0x1e'),_0x1c96('0x1f'),_0x1c96('0x20'),_0x1c96('0x21'),_0x1c96('0x22'),_0x1c96('0x23'),_0x1c96('0x24'),_0x1c96('0x25')),'allowNull':!![]},'deny':{'type':Sequelize[_0x1c96('0x8')],'allowNull':!![]},'permit':{'type':Sequelize[_0x1c96('0x8')],'allowNull':!![]},'secret':{'type':Sequelize[_0x1c96('0x8')],'allowNull':!![]},'md5secret':{'type':Sequelize['STRING'],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x1c96('0x8')],'allowNull':!![]},'transport':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x1c96('0x26'),'set':function(_0x3fd83c){this[_0x1c96('0x5')](_0x1c96('0x27'),_0x3fd83c?_0x3fd83c[_0x1c96('0x28')](','):null);},'get':function(){return this[_0x1c96('0xd')](_0x1c96('0x27'))?this['getDataValue'](_0x1c96('0x27'))[_0x1c96('0x29')](','):null;},'comment':_0x1c96('0x2a')},'dtmfmode':{'type':Sequelize[_0x1c96('0x11')](_0x1c96('0x2b'),'info',_0x1c96('0x2c'),_0x1c96('0x2d'),_0x1c96('0x2e')),'allowNull':!![],'defaultValue':_0x1c96('0x2b')},'directmedia':{'type':Sequelize[_0x1c96('0x11')]('yes','no','nonat',_0x1c96('0x2f'),_0x1c96('0x30')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0x1c96('0x31'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x1c96('0x8')],'allowNull':!![]},'directmediadeny':{'type':Sequelize['STRING'],'allowNull':!![]},'nat':{'type':Sequelize[_0x1c96('0x8')],'allowNull':!![],'defaultValue':_0x1c96('0x32'),'set':function(_0x379fd3){this[_0x1c96('0x5')]('nat',_0x379fd3?_0x379fd3[_0x1c96('0x28')](','):null);},'get':function(){return this[_0x1c96('0xd')]('nat')?this['getDataValue'](_0x1c96('0x33'))['split'](','):null;},'comment':_0x1c96('0x34')},'callgroup':{'type':Sequelize[_0x1c96('0x8')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x1c96('0x8')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x1c96('0x8')]},'disallow':{'type':Sequelize[_0x1c96('0x8')],'allowNull':![],'defaultValue':'all'},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x1c96('0x35'),'set':function(_0x48c11e){this['setDataValue'](_0x1c96('0x36'),_0x48c11e?_0x48c11e[_0x1c96('0x28')](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0x1c96('0xd')](_0x1c96('0x36'))?this[_0x1c96('0xd')](_0x1c96('0x36'))[_0x1c96('0x29')](';'):null;},'comment':_0x1c96('0x37')},'autoframing':{'type':Sequelize[_0x1c96('0x11')](_0x1c96('0x31'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x1c96('0x8')],'allowNull':!![],'set':function(_0x69284d){this['setDataValue']('insecure',_0x69284d?_0x69284d[_0x1c96('0x28')](','):null);},'get':function(){return this[_0x1c96('0xd')](_0x1c96('0x38'))?this[_0x1c96('0xd')](_0x1c96('0x38'))['split'](','):null;},'comment':_0x1c96('0x39')},'trustrpid':{'type':Sequelize['ENUM'](_0x1c96('0x31'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x1c96('0x11')](_0x1c96('0x31'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x1c96('0x11')]('yes','no',_0x1c96('0x3a')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x1c96('0x11')]('yes','no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x1c96('0x11')](_0x1c96('0x31'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x1c96('0x15')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize['STRING'],'allowNull':!![]},'callerid':{'type':Sequelize[_0x1c96('0x8')],'allowNull':!![],'defaultValue':_0x1c96('0x3b')},'amaflags':{'type':Sequelize[_0x1c96('0x8')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x1c96('0x11')](_0x1c96('0x31'),'no'),'allowNull':!![],'defaultValue':_0x1c96('0x31')},'busylevel':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x1c96('0x11')](_0x1c96('0x31'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM'](_0x1c96('0x31'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x1c96('0x11')]('yes','no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize['ENUM'](_0x1c96('0x31'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x1c96('0x8')],'allowNull':!![]},'template':{'type':Sequelize[_0x1c96('0x8')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x1c96('0x11')](_0x1c96('0x31'),'no',_0x1c96('0x3c')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize['ENUM'](_0x1c96('0x31'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x1c96('0x8')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x1c96('0x11')](_0x1c96('0x3d'),_0x1c96('0x3e'),_0x1c96('0x3f')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x1c96('0x15')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x1c96('0x15')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x1c96('0x11')](_0x1c96('0x40'),'uas'),'allowNull':!![],'defaultValue':_0x1c96('0x41')},'t38pt_usertpsource':{'type':Sequelize[_0x1c96('0x8')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x1c96('0x8')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x1c96('0x8')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x1c96('0x8')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x1c96('0x11')](_0x1c96('0x31'),'no'),'allowNull':!![],'defaultValue':_0x1c96('0x31')},'keepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x1c96('0x8')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x1c96('0x8')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x1c96('0x15')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x1c96('0x15')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x1c96('0x15')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x1c96('0x11')](_0x1c96('0x31'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING'],'allowNull':!![]},'callbackextension':{'type':Sequelize['STRING'],'allowNull':!![]},'timert1':{'type':Sequelize[_0x1c96('0x15')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x1c96('0x15')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x1c96('0x8')],'allowNull':!![]},'contactdeny':{'type':Sequelize['STRING'],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x1c96('0x8')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x1c96('0x8')],'allowNull':!![]},'maxforwards':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'encryption':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x1c96('0x11')](_0x1c96('0x31'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize['ENUM'](_0x1c96('0x31'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x1c96('0x11')](_0x1c96('0x31'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x1c96('0x11')]('yes','no',_0x1c96('0x42'),'certificate'),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x1c96('0x15')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x1c96('0x8')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscipher':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscafile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x1c96('0x8')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x1c96('0x11')](_0x1c96('0x43'),_0x1c96('0x44'),_0x1c96('0x45')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x1c96('0x8')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x1c96('0x11')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING'],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x1c96('0x8')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x1c96('0x15')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x1c96('0x11')](_0x1c96('0x31'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x1c96('0x11')](_0x1c96('0x31'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x1c96('0x8')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x1c96('0x8')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x1c96('0x8')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x1c96('0x8')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x1c96('0x11')]('yes','no',_0x1c96('0x46'),_0x1c96('0x2f'),_0x1c96('0x47')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize['STRING']},'resetPasswordExpires':{'type':Sequelize['DATE']},'passwordResetAt':{'type':Sequelize['DATE'],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x1c96('0x48')]},'showWebBar':{'type':Sequelize[_0x1c96('0x15')],'defaultValue':0x0,'set':function(_0x52a875){this[_0x1c96('0x5')](_0x1c96('0x49'),_0x52a875);var _0x3e8429=this[_0x1c96('0x4a')]({'plain':!![]});switch(_0x52a875){case 0x0:case 0x1:var _0x12f167=_0x3e8429[_0x1c96('0x27')]?_[_0x1c96('0x4b')](_0x3e8429['transport'])?_0x3e8429['transport'][_0x1c96('0x28')]():_0x3e8429[_0x1c96('0x27')]:_0x1c96('0x26');if(_0x12f167===_0x1c96('0x4c')){_0x12f167=_0x1c96('0x26');}this[_0x1c96('0x5')](_0x1c96('0x27'),_0x12f167);this[_0x1c96('0x5')](_0x1c96('0x4d'),'no');this[_0x1c96('0x5')](_0x1c96('0x4e'),null);this['setDataValue'](_0x1c96('0x4f'),null);this[_0x1c96('0x5')](_0x1c96('0x50'),null);this[_0x1c96('0x5')](_0x1c96('0x51'),null);this[_0x1c96('0x5')](_0x1c96('0x52'),null);this[_0x1c96('0x5')]('dtlssetup',null);this[_0x1c96('0x5')](_0x1c96('0x53'),null);this['setDataValue'](_0x1c96('0x54'),null);this[_0x1c96('0x5')](_0x1c96('0x55'),'no');break;case 0x2:this['setDataValue']('transport',_0x1c96('0x4c'));this['setDataValue']('encryption',_0x1c96('0x31'));this[_0x1c96('0x5')]('avpf',_0x1c96('0x31'));this[_0x1c96('0x5')](_0x1c96('0x4f'),_0x1c96('0x31'));this[_0x1c96('0x5')](_0x1c96('0x50'),_0x1c96('0x31'));this[_0x1c96('0x5')](_0x1c96('0x51'),_0x1c96('0x31'));this[_0x1c96('0x5')]('dtlsverify','no');this[_0x1c96('0x5')]('dtlssetup',_0x1c96('0x45'));this['setDataValue']('dtlscertfile',_0x3e8429['dtlscertfile']||_0x1c96('0x56'));this[_0x1c96('0x5')](_0x1c96('0x54'),_0x3e8429[_0x1c96('0x54')]||_0x1c96('0x57'));this[_0x1c96('0x5')](_0x1c96('0x55'),'yes');break;default:}}},'permissions':{'type':Sequelize[_0x1c96('0x48')],'set':function(_0x577506){this['setDataValue'](_0x1c96('0x58'),_0x577506?_0x577506['join'](','):[]);},'get':function(){return this[_0x1c96('0xd')](_0x1c96('0x58'))?_[_0x1c96('0x59')](this[_0x1c96('0xd')](_0x1c96('0x58'))[_0x1c96('0x29')](','),function(_0x3d3e7c){return parseInt(_0x3d3e7c,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x1c96('0x8')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x1c96('0x8')]},'phoneBarBusyNumber':{'type':Sequelize[_0x1c96('0x8')]},'phoneBarUnconditional':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x1c96('0x17')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x1c96('0x17')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x1c96('0x17')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x1c96('0x17')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x1c96('0x15')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x1c96('0x8')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x1c96('0x15')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x1c96('0x11')](_0x1c96('0x31'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x1c96('0x17')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x1c96('0x8')]},'phoneBarEnableJaws':{'type':Sequelize[_0x1c96('0x17')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x1c96('0x5a')],'get':function(){return this[_0x1c96('0xd')](_0x1c96('0x5b'))?this[_0x1c96('0xd')](_0x1c96('0x5b')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x1c96('0x17')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x1c96('0x17')],'defaultValue':![]},'interface':{'type':Sequelize[_0x1c96('0x8')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x1c96('0x17')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x1c96('0x8')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x1c96('0x8')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x1c96('0x17')],'defaultValue':![],'set':function(_0x340a10){if(typeof _0x340a10===_0x1c96('0x5c')){var _0x375782=_0x340a10==='1'?!![]:_0x340a10==='0'?![]:_0x340a10==='true'?!![]:_0x340a10==='false'?![]:![];this[_0x1c96('0x5')](_0x1c96('0x5d'),_0x375782);}else{this[_0x1c96('0x5')]('screenrecording',_0x340a10);}}},'blocked':{'type':Sequelize[_0x1c96('0x17')],'defaultValue':![],'set':function(_0x4666b3){this[_0x1c96('0x5')]('blocked',_0x4666b3);if(_0x4666b3===!![]){this[_0x1c96('0x5')](_0x1c96('0x5e'),moment());this[_0x1c96('0x5')](_0x1c96('0x5f'),0x0);}else{this['setDataValue'](_0x1c96('0x5e'),null);}}},'blockedAt':{'type':Sequelize[_0x1c96('0x18')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x1c96('0x15')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x1c96('0x17')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x1c96('0x17')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x1c96('0x15')](0x5)[_0x1c96('0x60')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x1c96('0x17')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x1c96('0x17')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x1c96('0x17')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x1c96('0x17')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x1c96('0x17')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0x1c96('0x17')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0x1c96('0x15')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0x1c96('0x17')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize[_0x1c96('0x15')],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0x1c96('0x17')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0x1c96('0x15')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0x1c96('0x17')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0x1c96('0x15')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0x1c96('0x17')],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize[_0x1c96('0x15')],'defaultValue':0x0},'messengerSoundNotification':{'type':Sequelize[_0x1c96('0x17')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index fd5deb6..a3c886d 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 _0xde58=['checkUserLimits','settingsEnabled','userProfileId','Agents','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','bulkCreate','Unauthorized','some','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator','UserProfileSection','telephone','compact','changePassword','newPassword','Sequelize','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','oldPassword','Wrong\x20credentials','ValidationError','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','findOne','passwordHistoryLimit','validatePasswordPattern','enforcePasswordHistory','validatePasswordHistory','updatePasswordsHistory','addQueues','online','loginInPause','interface','isValidChannel','Unknown\x20channel','add','capitalize','toLowerCase','Queues','penalty','spread','QueueId','Queue:save','voice','VoiceQueue','SIP/%s','voicePause','UserVoiceQueueRt','channel','remove','isArray','emit','Queue:remove','addAvatar','file','getAvatar','join','root','server/files/images/logos/default_profile.png','userpic','download','existsSync','server/files/images/','getOpenTabs','CHAT','createdAt','FaxOpenTabs','OpenchannelOpenTabs','MAIL','SMS','WHATSAPP','getContacts','format','User\x20with\x20id\x20%s\x20not\x20found','hasOwnProperty','CmList','List','Tag','tag','getQueues','Queue','model','intersection','fields','order','sort','filters','merge','Unknown\x20role','nolimit','getVoiceQueuesRt','keys','getGroups','getRecordings','VoiceRecording','pick','UserId','getScreenRecordings','ScreenRecording','getChatInteractions','getOpenchannelInteractions','MailInteraction','getSmsInteractions','SmsInteraction','getFaxInteractions','FaxInteraction','mobile','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','YYYY-MM-DD\x20HH:mm:ss','getChannels','PAUSE','MemberReport','concat','LOGININPAUSE','isMiddleware','resolve','logout','forEach','updateAttributes','DEFAULT\x20PAUSE','unpause','Channel\x20parameter\x20%s\x20is\x20invalid','mailPause','chatPause','faxPause','openchannelPause','smsPause','getTeams','addTeams','transaction','Team','getAssociatedQueues','flattenDeep','getDataValue','Voice','upsert','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','removeTeams','removeAgent','getLists','values','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','user_has_chat_interactions:save','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','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','removeSmsAccounts','getChatWebsites','ChatWebsite','addChatWebsites','removeChatWebsites','getWhatsappAccounts','WhatsappAccount','addWhatsappAccounts','removeWhatsappAccounts','CmHopper','$and','$gt','$gte','$lt','$ne','$eq','$not','$between','$notBetween','$notIn','$like','$notLike','$iLike','$notILike','$overlap','$contains','$any','firstName','lastName','phone','CmContact','dialActive','getApiKey','retrieveApiKey','No\x20API\x20access\x20key\x20found!','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','generateApiKey','token','removeApiKey','apiKeyNonce','whoami','getUserSetting','getPresence','idle','unknown','ringing','queues','inbound','getAgents','toString','col','asc','desc','substring','uniqBy','offline','pause','voiceStatus','unavailable','busy','slice','charAt','field','ui.','InteractionId','user_has_','_interactions','ui.UserId\x20=\x20?','messengerSoundNotification','enabled','moment','util','path','lodash','squel','../../components/auth/service','../../components/contacts','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../errors/api','APIBadRequestError','APINotFoundError','handleError','../../mysqldb','redis','./user.socket','register','localhost','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','role','agent','userNotification:recalc:','then','get','user','Telephones','filter','ignore','value','includes','find','name','UserProfileResource','destroy','error','stack','send','User','rawAttributes','map','fieldName','type','key','password','previousPasswords','resetPasswordToken','resetPasswordExpires','md5secret','index','getOptions','where','query','include','true','UserSetting','attributes','push','findAll','rows','openTabs','length','chat','dataValues','sms','fax','mail','whatsapp','show','params','includeAll','userSetting','options','openchannel','all','body','catch','describe','addContacts','omit','ids','internal','Setting','findById','securePassword','max','isNil','min_internal','sequelize','QueryTypes','SELECT','from','voicemail','mailbox','VoiceMail','fullname','email','permissions','101','102','103','105','106','107','109','100','111','create','admin','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator'];(function(_0x2c9d9a,_0x16e83a){var _0x679fc2=function(_0x5972d7){while(--_0x5972d7){_0x2c9d9a['push'](_0x2c9d9a['shift']());}};_0x679fc2(++_0x16e83a);}(_0xde58,0x106));var _0x8de5=function(_0xaf4af7,_0x6a8b6f){_0xaf4af7=_0xaf4af7-0x0;var _0x596009=_0xde58[_0xaf4af7];return _0x596009;};'use strict';var moment=require(_0x8de5('0x0'));var util=require(_0x8de5('0x1'));var path=require(_0x8de5('0x2'));var fs=require('fs');var _=require(_0x8de5('0x3'));var squel=require(_0x8de5('0x4'));var Redis=require('ioredis');var authService=require(_0x8de5('0x5'));var contacts=require(_0x8de5('0x6'));var qs=require(_0x8de5('0x7'));var rta=require('../../components/realtime/agents');var logger=require(_0x8de5('0x8'))(_0x8de5('0x9'));var utils=require(_0x8de5('0xa'));var config=require(_0x8de5('0xb'));var licenseUtil=require(_0x8de5('0xc'));var APIBadRequestError=require(_0x8de5('0xd'))[_0x8de5('0xe')];var APINotFoundError=require(_0x8de5('0xd'))[_0x8de5('0xf')];var APIHandleError=require(_0x8de5('0xd'))[_0x8de5('0x10')];var db=require(_0x8de5('0x11'))['db'];var socket=require('socket.io-emitter')(new Redis(config[_0x8de5('0x12')]));require(_0x8de5('0x13'))[_0x8de5('0x14')](socket);config[_0x8de5('0x12')]=_['defaults'](config[_0x8de5('0x12')],{'host':_0x8de5('0x15'),'port':0x18eb});var values;function respondWithStatusCode(_0x5de3f5,_0x35cf46){_0x35cf46=_0x35cf46||0xcc;return function(_0x21e7e3){if(_0x21e7e3){return _0x5de3f5[_0x8de5('0x16')](_0x35cf46);}return _0x5de3f5['status'](_0x35cf46)['end']();};}function respondWithResult(_0x44af75,_0x11791b){_0x11791b=_0x11791b||0xc8;return function(_0x2a03fe){if(_0x2a03fe){return _0x44af75[_0x8de5('0x17')](_0x11791b)[_0x8de5('0x18')](_0x2a03fe);}};}function respondWithFilteredResult(_0x1cc930,_0x19db30){return function(_0xcfe82a){if(_0xcfe82a){var _0x2886b2=typeof _0x19db30[_0x8de5('0x19')]===_0x8de5('0x1a')&&typeof _0x19db30[_0x8de5('0x1b')]===_0x8de5('0x1a');var _0x35695e=_0xcfe82a[_0x8de5('0x1c')];var _0x50ae1d=_0x2886b2?0x0:_0x19db30[_0x8de5('0x19')];var _0x413c81=_0x2886b2?_0xcfe82a[_0x8de5('0x1c')]:_0x19db30['offset']+_0x19db30[_0x8de5('0x1b')];var _0x108441;if(_0x413c81>=_0x35695e){_0x413c81=_0x35695e;_0x108441=0xc8;}else{_0x108441=0xce;}_0x1cc930[_0x8de5('0x17')](_0x108441);return _0x1cc930[_0x8de5('0x1d')](_0x8de5('0x1e'),_0x50ae1d+'-'+_0x413c81+'/'+_0x35695e)[_0x8de5('0x18')](_0xcfe82a);}return null;};}function saveUpdates(_0x34dba6){return function(_0x2816e4){if(_0x2816e4){return _0x2816e4[_0x8de5('0x1f')](_0x34dba6)['then'](function(_0x4fac7a){if(_0x4fac7a[_0x8de5('0x20')]===_0x8de5('0x21')){socket['emit'](_0x8de5('0x22')+_0x4fac7a['id'],_0x4fac7a);}return _0x4fac7a;});}return null;};}function removeEntity(_0x5773a5){return function(_0x5e3c67){if(_0x5e3c67){return _0x5e3c67['destroy']()[_0x8de5('0x23')](function(){var _0x12aef0=_0x5e3c67[_0x8de5('0x24')]({'plain':!![]});if(_0x12aef0[_0x8de5('0x20')]==='admin')return;var _0x85fdbf=[{'name':'Users','value':_0x8de5('0x25'),'ignore':!![]},{'name':'Agents','value':_0x8de5('0x21'),'ignore':![]},{'name':_0x8de5('0x26'),'value':'telephone','ignore':![]}];var _0x33627b=_(_0x85fdbf)[_0x8de5('0x27')](_0x8de5('0x28'))['map'](_0x8de5('0x29'))['value']();if(_[_0x8de5('0x2a')](_0x33627b,_0x12aef0[_0x8de5('0x20')])){return;}var _0x52c8f0=_[_0x8de5('0x2b')](_0x85fdbf,[_0x8de5('0x29'),_0x12aef0[_0x8de5('0x20')]])[_0x8de5('0x2c')];return db[_0x8de5('0x2d')][_0x8de5('0x2e')]({'where':{'type':_0x52c8f0,'resourceId':_0x12aef0['id']}})[_0x8de5('0x23')](function(){return _0x5e3c67;});})[_0x8de5('0x23')](function(){_0x5773a5[_0x8de5('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0xa872e8){return function(_0x3b34a4){if(!_0x3b34a4){_0xa872e8['sendStatus'](0x194);}return _0x3b34a4;};}function handleError(_0x208970,_0x3fb340){_0x3fb340=_0x3fb340||0x1f4;return function(_0x40018b){logger[_0x8de5('0x2f')](_0x40018b[_0x8de5('0x30')]);if(_0x40018b[_0x8de5('0x2c')]){delete _0x40018b[_0x8de5('0x2c')];}_0x208970['status'](_0x3fb340)[_0x8de5('0x31')](_0x40018b);};}function getUserAttributes(){return _(db[_0x8de5('0x32')][_0x8de5('0x33')])[_0x8de5('0x34')](function(_0x572214){return{'name':_0x572214[_0x8de5('0x35')],'type':_0x572214[_0x8de5('0x36')][_0x8de5('0x37')]};})[_0x8de5('0x27')](function(_0x15913b){return![_0x8de5('0x38'),'salt',_0x8de5('0x39'),_0x8de5('0x3a'),_0x8de5('0x3b'),_0x8de5('0x3c')]['includes'](_0x15913b['name']);})['value']();}exports[_0x8de5('0x3d')]=function(_0x40492c,_0x180d8c){var _0x46dcd3={},_0x5a4051={'count':0x0,'rows':[]};var _0x58586b=getUserAttributes();_0x46dcd3=qs[_0x8de5('0x3e')](_0x58586b,_0x40492c);var _0x443303={'where':_0x46dcd3[_0x8de5('0x3f')]};return db[_0x8de5('0x32')][_0x8de5('0x1c')](_0x443303)[_0x8de5('0x23')](function(_0xfe4194){_0x5a4051[_0x8de5('0x1c')]=_0xfe4194;if(_0x40492c[_0x8de5('0x40')]['includeAll']){_0x46dcd3[_0x8de5('0x41')]=[{'all':!![]}];}if(_0x40492c[_0x8de5('0x40')]['userSetting']===_0x8de5('0x42')){_0x46dcd3[_0x8de5('0x41')]=[{'model':db[_0x8de5('0x43')],'as':'userSetting'}];}if(!_[_0x8de5('0x2a')](_0x46dcd3[_0x8de5('0x44')],'id')){_0x46dcd3[_0x8de5('0x44')][_0x8de5('0x45')]('id');}return db['User'][_0x8de5('0x46')](_0x46dcd3);})[_0x8de5('0x23')](function(_0x1bb323){_0x5a4051[_0x8de5('0x47')]=_0x1bb323;if(_0x40492c[_0x8de5('0x40')][_0x8de5('0x48')]===_0x8de5('0x42')){var _0x385e7f=[];for(var _0x570a76=0x0;_0x570a76<_0x5a4051[_0x8de5('0x47')][_0x8de5('0x49')];_0x570a76++){_0x385e7f['push'](get_open_tabs(_0x8de5('0x4a'),_0x5a4051[_0x8de5('0x47')][_0x570a76][_0x8de5('0x4b')]));_0x385e7f[_0x8de5('0x45')](get_open_tabs(_0x8de5('0x4c'),_0x5a4051[_0x8de5('0x47')][_0x570a76][_0x8de5('0x4b')]));_0x385e7f['push'](get_open_tabs(_0x8de5('0x4d'),_0x5a4051[_0x8de5('0x47')][_0x570a76][_0x8de5('0x4b')]));_0x385e7f[_0x8de5('0x45')](get_open_tabs(_0x8de5('0x4e'),_0x5a4051[_0x8de5('0x47')][_0x570a76][_0x8de5('0x4b')]));_0x385e7f[_0x8de5('0x45')](get_open_tabs('openchannel',_0x5a4051['rows'][_0x570a76][_0x8de5('0x4b')]));_0x385e7f[_0x8de5('0x45')](get_open_tabs(_0x8de5('0x4f'),_0x5a4051[_0x8de5('0x47')][_0x570a76][_0x8de5('0x4b')]));}return Promise['all'](_0x385e7f)[_0x8de5('0x23')](function(){return _0x5a4051;});}else{return _0x5a4051;}})[_0x8de5('0x23')](respondWithFilteredResult(_0x180d8c,_0x46dcd3))['catch'](handleError(_0x180d8c,null));};exports[_0x8de5('0x50')]=function(_0x2bc0ee,_0x3063f3){var _0x5e4c31=getUserAttributes();_0x2bc0ee[_0x8de5('0x40')]['id']=_0x2bc0ee[_0x8de5('0x51')]['id'];var _0x228d04=qs[_0x8de5('0x3e')](_0x5e4c31,_0x2bc0ee);if(_0x2bc0ee[_0x8de5('0x40')][_0x8de5('0x52')]){_0x228d04[_0x8de5('0x41')]=[{'all':!![]}];}if(_0x2bc0ee[_0x8de5('0x40')][_0x8de5('0x53')]===_0x8de5('0x42')){_0x228d04[_0x8de5('0x41')]=[{'model':db[_0x8de5('0x43')],'as':_0x8de5('0x53')}];}_0x228d04=_['merge']({},_0x228d04,_0x2bc0ee[_0x8de5('0x54')]);if(!_[_0x8de5('0x2a')](_0x228d04[_0x8de5('0x44')],'id')){_0x228d04[_0x8de5('0x44')][_0x8de5('0x45')]('id');}return db[_0x8de5('0x32')][_0x8de5('0x2b')](_0x228d04)['then'](handleEntityNotFound(_0x3063f3,null))[_0x8de5('0x23')](function(_0x5d03ce){var _0x123fcb=[];values=_0x5d03ce;if(_0x2bc0ee[_0x8de5('0x40')][_0x8de5('0x48')]===_0x8de5('0x42')){_0x123fcb[_0x8de5('0x45')](get_open_tabs('chat',_0x5d03ce['dataValues']));_0x123fcb['push'](get_open_tabs(_0x8de5('0x4c'),_0x5d03ce[_0x8de5('0x4b')]));_0x123fcb[_0x8de5('0x45')](get_open_tabs(_0x8de5('0x55'),_0x5d03ce['dataValues']));_0x123fcb[_0x8de5('0x45')](get_open_tabs('whatsapp',_0x5d03ce[_0x8de5('0x4b')]));_0x123fcb[_0x8de5('0x45')](get_open_tabs('fax',_0x5d03ce[_0x8de5('0x4b')]));_0x123fcb[_0x8de5('0x45')](get_open_tabs('mail',_0x5d03ce[_0x8de5('0x4b')]));return Promise[_0x8de5('0x56')](_0x123fcb);}else{return values;}})[_0x8de5('0x23')](function(){return values;})[_0x8de5('0x23')](respondWithResult(_0x3063f3,null))['catch'](handleError(_0x3063f3,null));};exports[_0x8de5('0x1f')]=function(_0x2d5b88,_0x4a7cce){if(_0x2d5b88[_0x8de5('0x57')]['id']){delete _0x2d5b88['body']['id'];}delete _0x2d5b88[_0x8de5('0x57')]['role'];return db[_0x8de5('0x32')][_0x8de5('0x2b')]({'where':{'id':_0x2d5b88[_0x8de5('0x51')]['id']}})[_0x8de5('0x23')](handleEntityNotFound(_0x4a7cce,null))[_0x8de5('0x23')](saveUpdates(_0x2d5b88[_0x8de5('0x57')],null))[_0x8de5('0x23')](respondWithResult(_0x4a7cce,null))[_0x8de5('0x58')](handleError(_0x4a7cce,null));};exports[_0x8de5('0x59')]=function(_0x3704ed,_0x5c07b6){return db[_0x8de5('0x32')][_0x8de5('0x59')]()[_0x8de5('0x23')](respondWithResult(_0x5c07b6,null))[_0x8de5('0x58')](handleError(_0x5c07b6,null));};exports[_0x8de5('0x5a')]=function(_0x295ce3,_0x1303cb){return db[_0x8de5('0x32')][_0x8de5('0x2b')]({'where':{'id':_0x295ce3['params']['id']}})['then'](handleEntityNotFound(_0x1303cb,null))['then'](function(_0x24a38e){if(_0x24a38e){return _0x24a38e['addContacts'](_0x295ce3[_0x8de5('0x57')]['ids'],_[_0x8de5('0x5b')](_0x295ce3[_0x8de5('0x57')],[_0x8de5('0x5c'),'id'])||{});}})['then'](respondWithResult(_0x1303cb,null))['catch'](handleError(_0x1303cb,null));};function validateUser(_0x49580a){return new Promise(function(_0x25fab0,_0xafc1db){if(_0x49580a[_0x8de5('0x5d')])return _0x25fab0(_0x49580a);return db[_0x8de5('0x5e')][_0x8de5('0x5f')](0x1)[_0x8de5('0x23')](function(_0xbaaac1){if(_0xbaaac1[_0x8de5('0x60')])authService['validatePasswordPattern'](_0x49580a[_0x8de5('0x38')]);db['User'][_0x8de5('0x61')]('internal')['then'](function(_0xec9c07){if(_[_0x8de5('0x62')](_0xec9c07)){_0x49580a[_0x8de5('0x5d')]=_0xbaaac1[_0x8de5('0x63')]||0x1;return;}if(_['isNil'](_0xbaaac1[_0x8de5('0x63')])||_0xbaaac1[_0x8de5('0x63')]===_0xec9c07){_0x49580a[_0x8de5('0x5d')]=_0xec9c07+0x1;return;}if(_0xbaaac1[_0x8de5('0x63')]>_0xec9c07){_0x49580a[_0x8de5('0x5d')]=_0xbaaac1[_0x8de5('0x63')];return;}return db[_0x8de5('0x64')][_0x8de5('0x40')]('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[_0x8de5('0x64')][_0x8de5('0x65')][_0x8de5('0x66')]})['then'](function(_0x2fb61c){if(_0x2fb61c&&_0x2fb61c[_0x8de5('0x49')]){for(var _0x207cb8=0x0,_0x485378=_0x2fb61c[_0x8de5('0x49')];_0x207cb8<_0x485378&&_[_0x8de5('0x62')](_0x49580a['internal']);_0x207cb8++){if(_0xbaaac1['min_internal']<=_0x2fb61c[_0x207cb8][_0x8de5('0x67')]){_0x49580a[_0x8de5('0x5d')]=_0x2fb61c[_0x207cb8][_0x8de5('0x67')];}else if(_0xbaaac1[_0x8de5('0x63')]>_0x2fb61c[_0x207cb8][_0x8de5('0x67')]&&_0xbaaac1[_0x8de5('0x63')]<=_0x2fb61c[_0x207cb8]['to']){_0x49580a[_0x8de5('0x5d')]=_0xbaaac1['min_internal'];}}}if(_[_0x8de5('0x62')](_0x49580a[_0x8de5('0x5d')])){_0x49580a['internal']=_0xec9c07+0x1;}return _0x25fab0(_0x49580a);});});})[_0x8de5('0x58')](function(_0x580faf){_0xafc1db(_0x580faf);});});}function updateUser(_0x4eeed0){return new Promise(function(_0x55afbb,_0x55f06a){try{if(_0x4eeed0[_0x8de5('0x68')]){_0x4eeed0[_0x8de5('0x69')]=_0x4eeed0[_0x8de5('0x5d')];_0x4eeed0[_0x8de5('0x6a')]={'mailbox':_0x4eeed0[_0x8de5('0x5d')],'password':_0x4eeed0[_0x8de5('0x38')],'fullname':_0x4eeed0[_0x8de5('0x6b')],'email':_0x4eeed0[_0x8de5('0x6c')]};}if(_0x4eeed0[_0x8de5('0x20')]===_0x8de5('0x21')){if(!_0x4eeed0[_0x8de5('0x6d')])_0x4eeed0[_0x8de5('0x6d')]=[_0x8de5('0x6e'),_0x8de5('0x6f'),_0x8de5('0x70'),'113','110','104',_0x8de5('0x71'),_0x8de5('0x72'),_0x8de5('0x73'),'108',_0x8de5('0x74'),_0x8de5('0x75'),_0x8de5('0x76'),'114','115'];}_0x55afbb(_0x4eeed0);}catch(_0x440584){_0x55f06a(_0x440584);}});}exports[_0x8de5('0x77')]=function(_0x36cd01,_0x258124){if(_0x36cd01[_0x8de5('0x25')][_0x8de5('0x20')]===_0x8de5('0x21'))throw new Error('Unauthorized');if(_0x36cd01[_0x8de5('0x57')][_0x8de5('0x20')]===_0x8de5('0x25')&&_0x36cd01[_0x8de5('0x25')][_0x8de5('0x20')]!==_0x8de5('0x78')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_0x36cd01[_0x8de5('0x57')]['role']==='admin'&&_0x36cd01['user'][_0x8de5('0x20')]!=='admin'){throw new Error(_0x8de5('0x79'));}return licenseUtil[_0x8de5('0x7a')]([_0x36cd01[_0x8de5('0x57')]])[_0x8de5('0x23')](function(){return validateUser(_0x36cd01[_0x8de5('0x57')]);})[_0x8de5('0x23')](function(_0xa51e22){return updateUser(_0xa51e22)[_0x8de5('0x23')](function(_0x1a63d6){if(_0x1a63d6[_0x8de5('0x20')]==='admin'){_0x1a63d6[_0x8de5('0x7b')]=_0x36cd01[_0x8de5('0x25')][_0x8de5('0x7b')];delete _0x1a63d6[_0x8de5('0x7c')];}return _0x1a63d6;});})[_0x8de5('0x23')](function(_0x3ad645){return db[_0x8de5('0x32')][_0x8de5('0x77')](_0x3ad645,{'include':[{'model':db['VoiceMail'],'as':_0x8de5('0x6a')}]});})[_0x8de5('0x23')](function(_0x53fd94){if(_0x36cd01['body'][_0x8de5('0x20')]===_0x8de5('0x25'))return _0x53fd94;if(_0x36cd01[_0x8de5('0x25')]['role']!==_0x8de5('0x25'))return _0x53fd94;return db['UserProfileSection'][_0x8de5('0x2b')]({'where':{'name':_0x53fd94['role']===_0x8de5('0x21')?_0x8de5('0x7d'):_0x8de5('0x26'),'userProfileId':_0x36cd01[_0x8de5('0x25')]['userProfileId']},'raw':!![]})[_0x8de5('0x23')](function(_0x13f07e){if(!_0x13f07e||_0x13f07e[_0x8de5('0x7e')]!=0x0)return _0x53fd94;return db[_0x8de5('0x2d')][_0x8de5('0x77')]({'name':_0x53fd94[_0x8de5('0x2c')],'resourceId':_0x53fd94['id'],'type':_0x13f07e[_0x8de5('0x2c')],'sectionId':_0x13f07e['id']},{})['then'](function(){return _0x53fd94;});})[_0x8de5('0x58')](function(_0x544c86){logger['error'](_0x8de5('0x7f'),_0x544c86);throw _0x544c86;});})['then'](respondWithResult(_0x258124,0xc9))['catch'](handleError(_0x258124,null));};exports[_0x8de5('0x80')]=function(_0x53b909,_0x336d7c){var _0x2a07ff=_0x53b909[_0x8de5('0x57')];var _0x15eb26=[];if(_0x53b909[_0x8de5('0x25')]['role']===_0x8de5('0x21'))throw new Error(_0x8de5('0x81'));if(_[_0x8de5('0x82')](_0x2a07ff,['role',_0x8de5('0x25')])&&_0x53b909[_0x8de5('0x25')][_0x8de5('0x20')]!==_0x8de5('0x78')){throw new Error(_0x8de5('0x83'));}if(_['some'](_0x2a07ff,[_0x8de5('0x20'),_0x8de5('0x78')])&&_0x53b909[_0x8de5('0x25')]['role']!==_0x8de5('0x78')){throw new Error(_0x8de5('0x84'));}return licenseUtil['checkUserLimits'](_0x2a07ff)[_0x8de5('0x23')](function(){return validateUser(_0x2a07ff[0x0]);})[_0x8de5('0x23')](function(){for(var _0x1400c1=0x1;_0x1400c1<_0x2a07ff[_0x8de5('0x49')];_0x1400c1++){var _0x32774e=_0x2a07ff[_0x1400c1-0x1]['internal'];if(!_0x2a07ff[_0x1400c1]['internal'])_0x2a07ff[_0x1400c1][_0x8de5('0x5d')]=_0x32774e+0x1;_0x15eb26[_0x8de5('0x45')](validateUser(_0x2a07ff[_0x1400c1]));}return Promise[_0x8de5('0x56')](_0x15eb26);})[_0x8de5('0x23')](function(){_0x15eb26=[];for(var _0x3d38c9=0x0;_0x3d38c9<_0x2a07ff[_0x8de5('0x49')];_0x3d38c9++){_0x15eb26['push'](updateUser(_0x2a07ff[_0x3d38c9]));}return Promise['all'](_0x15eb26);})[_0x8de5('0x23')](function(){_0x15eb26=_0x2a07ff[_0x8de5('0x34')](function(_0x14b96f){return db[_0x8de5('0x32')][_0x8de5('0x77')](_0x14b96f,{'include':[{'model':db[_0x8de5('0x6a')],'as':'VoiceMail'}]})[_0x8de5('0x23')](function(_0x20fc11){_0x14b96f['id']=_0x20fc11['id'];return _0x14b96f;});});return Promise[_0x8de5('0x56')](_0x15eb26);})[_0x8de5('0x23')](function(_0x16ae74){if(_0x53b909[_0x8de5('0x57')][_0x8de5('0x20')]===_0x8de5('0x25'))return _0x16ae74;if(_0x53b909[_0x8de5('0x25')][_0x8de5('0x20')]!=='user')return _0x16ae74;var _0x43333c=_[_0x8de5('0x82')](_0x16ae74,function(_0x1ce48c){return _0x1ce48c['role']==='agent'||_0x1ce48c['role']==='telephone';});if(!_0x43333c)return _0x16ae74;return db[_0x8de5('0x85')][_0x8de5('0x46')]({'where':{'name':{'$or':['Agents','Telephones']},'userProfileId':_0x53b909[_0x8de5('0x25')]['userProfileId']},'raw':!![]})[_0x8de5('0x23')](function(_0x32419a){if(_['isEmpty'](_0x32419a)||!_['some'](_0x32419a,[_0x8de5('0x7e'),0x0]))return _0x16ae74;_0x15eb26=[];var _0x25df1a=_(_0x32419a)[_0x8de5('0x34')](function(_0x2d8873){if(_0x2d8873[_0x8de5('0x7e')]===0x1)return;return _0x2d8873[_0x8de5('0x2c')]===_0x8de5('0x7d')?'agent':_0x8de5('0x86');})[_0x8de5('0x87')]()['value']();for(var _0x1ff085=0x0;_0x1ff085<_0x16ae74[_0x8de5('0x49')];_0x1ff085++){if(!_['includes'](_0x25df1a,_0x16ae74[_0x1ff085][_0x8de5('0x20')]))return;var _0x47452f=_0x16ae74[_0x1ff085]['role']===_0x8de5('0x21')?_0x8de5('0x7d'):_0x8de5('0x26');_0x15eb26[_0x8de5('0x45')](db[_0x8de5('0x2d')]['create']({'name':_0x16ae74[_0x1ff085]['name'],'resourceId':_0x16ae74[_0x1ff085]['id'],'type':_0x47452f,'sectionId':_[_0x8de5('0x2b')](_0x32419a,['name',_0x47452f])['id']},{}));}return Promise['all'](_0x15eb26);});})[_0x8de5('0x23')](respondWithResult(_0x336d7c,0xc9))['catch'](handleError(_0x336d7c,null));};exports[_0x8de5('0x88')]=function(_0x3193b9,_0x18432e){if(_0x3193b9[_0x8de5('0x57')]['id']){delete _0x3193b9[_0x8de5('0x57')]['id'];}return db[_0x8de5('0x32')][_0x8de5('0x2b')]({'where':{'id':_0x3193b9[_0x8de5('0x51')]['id']}})[_0x8de5('0x23')](function(_0x26c19c){if(!_0x26c19c)return null;if(_0x26c19c['id']===_0x3193b9['user']['id']){if(!_0x3193b9[_0x8de5('0x57')]['oldPassword']||!_0x3193b9[_0x8de5('0x57')][_0x8de5('0x89')]){throw new db[(_0x8de5('0x8a'))]['ValidationError'](_0x8de5('0x8b'));}if(!_0x26c19c['authenticate'](_0x3193b9[_0x8de5('0x57')][_0x8de5('0x8c')])){throw new db[(_0x8de5('0x8a'))]['ValidationError'](_0x8de5('0x8d'));}if(_0x3193b9['body'][_0x8de5('0x8c')]===_0x3193b9[_0x8de5('0x57')][_0x8de5('0x89')]){throw new db[(_0x8de5('0x8a'))][(_0x8de5('0x8e'))](_0x8de5('0x8f'));}}else if(_0x3193b9[_0x8de5('0x25')][_0x8de5('0x20')]==='admin'){if(!_0x3193b9[_0x8de5('0x57')][_0x8de5('0x89')]){throw new db[(_0x8de5('0x8a'))][(_0x8de5('0x8e'))](_0x8de5('0x90'));}}else if(_0x3193b9[_0x8de5('0x25')]['role']===_0x8de5('0x25')){if(!_0x3193b9['body']['newPassword']){throw new db[(_0x8de5('0x8a'))][(_0x8de5('0x8e'))](_0x8de5('0x90'));}if(_0x26c19c[_0x8de5('0x20')]!==_0x8de5('0x21')){throw new db['Sequelize']['ValidationError'](_0x8de5('0x81'));}}else{throw new db[(_0x8de5('0x8a'))][(_0x8de5('0x8e'))](_0x8de5('0x81'));}return _0x26c19c;})[_0x8de5('0x23')](handleEntityNotFound(_0x18432e,null))[_0x8de5('0x23')](function(_0x4b0277){return db['Setting'][_0x8de5('0x91')]({'attributes':['id',_0x8de5('0x60'),'enforcePasswordHistory',_0x8de5('0x92')]})[_0x8de5('0x23')](function(_0x35cc5f){if(_0x35cc5f[_0x8de5('0x60')])authService[_0x8de5('0x93')](_0x3193b9['body']['newPassword']);if(!_0x35cc5f[_0x8de5('0x94')]||!_0x4b0277[_0x8de5('0x39')])return _0x4b0277;authService[_0x8de5('0x95')](_0x3193b9[_0x8de5('0x57')][_0x8de5('0x89')],_0x4b0277[_0x8de5('0x39')],_0x35cc5f['passwordHistoryLimit']);return _0x4b0277;})[_0x8de5('0x23')](saveUpdates({'password':_0x3193b9['body']['newPassword'],'passwordResetAt':_0x3193b9[_0x8de5('0x25')]['id']==_0x3193b9[_0x8de5('0x51')]['id']?moment():null,'previousPasswords':authService[_0x8de5('0x96')](_0x3193b9[_0x8de5('0x57')][_0x8de5('0x89')],_0x4b0277[_0x8de5('0x39')])},null));})['then'](respondWithResult(_0x18432e,null))[_0x8de5('0x58')](handleError(_0x18432e,null));};exports[_0x8de5('0x97')]=function(_0x135467,_0x330deb){var _0x5f01f7=_0x135467['body']['channel'];return db[_0x8de5('0x32')][_0x8de5('0x2b')]({'where':{'id':_0x135467[_0x8de5('0x51')]['id']},'attributes':['id',_0x8de5('0x2c'),_0x8de5('0x20'),_0x8de5('0x98'),_0x8de5('0x99'),'voicePause',_0x8de5('0x9a')]})[_0x8de5('0x23')](handleEntityNotFound(_0x330deb,null))[_0x8de5('0x23')](function(_0x19e1e2){if(_0x19e1e2){if(!utils[_0x8de5('0x9b')](_0x5f01f7)){throw new db[(_0x8de5('0x8a'))][(_0x8de5('0x8e'))](_0x8de5('0x9c'));}return _0x19e1e2[_0x8de5('0x9d')+_[_0x8de5('0x9e')](_0x5f01f7[_0x8de5('0x9f')]())+_0x8de5('0xa0')](_0x135467[_0x8de5('0x57')][_0x8de5('0x5c')],{'penalty':_0x135467[_0x8de5('0x57')][_0x8de5('0xa1')]||0x0})[_0x8de5('0xa2')](function(_0x3b0d69){for(var _0x7e6abd=0x0;_0x7e6abd<_0x135467[_0x8de5('0x57')][_0x8de5('0x5c')][_0x8de5('0x49')];_0x7e6abd+=0x1){var _0xa87bb5={'UserId':Number(_0x135467[_0x8de5('0x51')]['id'])};_0xa87bb5[_[_0x8de5('0x9e')](_0x5f01f7[_0x8de5('0x9f')]())+_0x8de5('0xa3')]=Number(_0x135467[_0x8de5('0x57')][_0x8de5('0x5c')][_0x7e6abd]);socket['emit'](_0x8de5('0x25')+_[_0x8de5('0x9e')](_0x5f01f7['toLowerCase']())+_0x8de5('0xa4'),_0xa87bb5);}return _0x3b0d69;})['then'](function(){if(_0x5f01f7===_0x8de5('0xa5')){return db[_0x8de5('0xa6')]['findAll']({'where':{'id':_0x135467[_0x8de5('0x57')]['ids']||[]},'raw':!![],'attributes':['id',_0x8de5('0x2c')]});}})[_0x8de5('0x23')](function(_0x3c6ff7){var _0x353699=_0x19e1e2['get']({'plain':!![]});var _0x342e13=[];if(_0x5f01f7===_0x8de5('0xa5')&&_0x353699[_0x8de5('0x20')]===_0x8de5('0x21')&&_0x353699['online']){for(let _0x11aa23=0x0;_0x11aa23<_0x3c6ff7[_0x8de5('0x49')];_0x11aa23+=0x1){_0x342e13['push']({'membername':_0x353699[_0x8de5('0x2c')],'UserId':_0x353699['id'],'queue_name':_0x3c6ff7[_0x11aa23][_0x8de5('0x2c')],'VoiceQueueId':_0x3c6ff7[_0x11aa23]['id'],'interface':_[_0x8de5('0x62')](_0x353699['interface'])?util['format'](_0x8de5('0xa7'),_0x353699[_0x8de5('0x2c')]):_0x353699[_0x8de5('0x9a')],'paused':_0x353699[_0x8de5('0xa8')]||![],'penalty':_0x135467[_0x8de5('0x57')][_0x8de5('0xa1')]||0x0});}return Promise[_0x8de5('0x56')](_0x342e13[_0x8de5('0x34')](function(_0x511f1b){return db[_0x8de5('0xa9')]['upsert'](_0x511f1b);}));}return _0x19e1e2;});}})[_0x8de5('0x23')](respondWithStatusCode(_0x330deb,null))[_0x8de5('0x58')](handleError(_0x330deb,null));};exports['removeQueues']=function(_0x57f9a7,_0x52e4a0){var _0x254f07,_0x1ce0d2;return db[_0x8de5('0x32')][_0x8de5('0x2b')]({'where':{'id':_0x57f9a7[_0x8de5('0x51')]['id']},'attributes':['id','name',_0x8de5('0x20')]})[_0x8de5('0x23')](handleEntityNotFound(_0x52e4a0,null))[_0x8de5('0x23')](function(_0x3dd51e){if(_0x3dd51e){_0x254f07=_0x3dd51e;if(!_0x57f9a7[_0x8de5('0x40')][_0x8de5('0xaa')]||!utils[_0x8de5('0x9b')](_0x57f9a7[_0x8de5('0x40')]['channel'])){throw new db['Sequelize']['ValidationError'](_0x8de5('0x9c'));}return _0x3dd51e[_0x8de5('0xab')+_[_0x8de5('0x9e')](_0x57f9a7[_0x8de5('0x40')][_0x8de5('0xaa')][_0x8de5('0x9f')]())+_0x8de5('0xa0')](_0x57f9a7[_0x8de5('0x40')][_0x8de5('0x5c')]);}})[_0x8de5('0x23')](function(_0x560641){if(_[_0x8de5('0xac')](_0x57f9a7['query']['ids'])){for(var _0x2f3683=0x0;_0x2f3683<_0x57f9a7[_0x8de5('0x40')]['ids']['length'];_0x2f3683+=0x1){_0x1ce0d2={'UserId':Number(_0x57f9a7[_0x8de5('0x51')]['id'])};_0x1ce0d2[_[_0x8de5('0x9e')](_0x57f9a7[_0x8de5('0x40')]['channel'][_0x8de5('0x9f')]())+_0x8de5('0xa3')]=Number(_0x57f9a7[_0x8de5('0x40')][_0x8de5('0x5c')][_0x2f3683]);socket[_0x8de5('0xad')]('user'+_['capitalize'](_0x57f9a7[_0x8de5('0x40')][_0x8de5('0xaa')][_0x8de5('0x9f')]())+_0x8de5('0xae'),_0x1ce0d2);}}else{_0x1ce0d2={'UserId':Number(_0x57f9a7[_0x8de5('0x51')]['id'])};_0x1ce0d2[_[_0x8de5('0x9e')](_0x57f9a7['query']['channel'][_0x8de5('0x9f')]())+_0x8de5('0xa3')]=Number(_0x57f9a7[_0x8de5('0x40')][_0x8de5('0x5c')]);socket[_0x8de5('0xad')](_0x8de5('0x25')+_[_0x8de5('0x9e')](_0x57f9a7[_0x8de5('0x40')]['channel'][_0x8de5('0x9f')]())+'Queue:remove',_0x1ce0d2);}return _0x560641;})[_0x8de5('0x23')](function(){if(_0x57f9a7[_0x8de5('0x40')]['channel']==='voice'){return db[_0x8de5('0xa9')][_0x8de5('0x2e')]({'where':{'UserId':_0x57f9a7[_0x8de5('0x51')]['id'],'VoiceQueueId':_0x57f9a7[_0x8de5('0x40')]['ids']},'individualHooks':!![]})['then'](function(){return _0x254f07;});}return _0x254f07;})['then'](respondWithStatusCode(_0x52e4a0,null))['catch'](handleError(_0x52e4a0,null));};exports[_0x8de5('0xaf')]=function(_0x5c615a,_0x138971){_0x5c615a[_0x8de5('0x57')]['userpic']=_0x5c615a[_0x8de5('0xb0')]['filename'];return db['User']['find']({'where':{'id':_0x5c615a[_0x8de5('0x51')]['id']}})[_0x8de5('0x23')](handleEntityNotFound(_0x138971,null))[_0x8de5('0x23')](saveUpdates(_0x5c615a[_0x8de5('0x57')],null))[_0x8de5('0x23')](respondWithResult(_0x138971,null))['catch'](handleError(_0x138971,null));};exports[_0x8de5('0xb1')]=function(_0x5b6d0e,_0x416ae2){var _0x19874d=path[_0x8de5('0xb2')](config[_0x8de5('0xb3')],_0x8de5('0xb4'));return db['User'][_0x8de5('0x2b')]({'where':{'id':_0x5b6d0e['params']['id']},'attributes':['id',_0x8de5('0xb5')],'raw':!![]})[_0x8de5('0x23')](handleEntityNotFound(_0x416ae2,null))[_0x8de5('0x23')](function(_0x1aab02){if(_0x1aab02){if(_[_0x8de5('0x62')](_0x1aab02[_0x8de5('0xb5')])){return _0x416ae2[_0x8de5('0xb6')](_0x19874d);}else{if(!fs[_0x8de5('0xb7')](path[_0x8de5('0xb2')](config[_0x8de5('0xb3')],_0x8de5('0xb8'),_0x1aab02[_0x8de5('0xb5')]))){return _0x416ae2[_0x8de5('0xb6')](_0x19874d);}return _0x416ae2['download'](path[_0x8de5('0xb2')](config[_0x8de5('0xb3')],_0x8de5('0xb8'),_0x1aab02['userpic']));}}})['catch'](handleError(_0x416ae2,null));};exports[_0x8de5('0xb9')]=function(_0x4dc564,_0x5313c8){return db[_0x8de5('0x32')]['find']({'where':{'id':_0x4dc564['params']['id']},'attributes':['id']})['then'](handleEntityNotFound(_0x5313c8,null))[_0x8de5('0x23')](function(_0x191360){var _0x21b451=[];values=_0x191360['dataValues'];_0x21b451[_0x8de5('0x45')](get_open_tabs(_0x8de5('0x4a'),_0x191360[_0x8de5('0x4b')]));_0x21b451[_0x8de5('0x45')](get_open_tabs(_0x8de5('0x4c'),_0x191360[_0x8de5('0x4b')]));_0x21b451[_0x8de5('0x45')](get_open_tabs(_0x8de5('0x55'),_0x191360['dataValues']));_0x21b451[_0x8de5('0x45')](get_open_tabs(_0x8de5('0x4f'),_0x191360[_0x8de5('0x4b')]));_0x21b451[_0x8de5('0x45')](get_open_tabs('fax',_0x191360[_0x8de5('0x4b')]));_0x21b451[_0x8de5('0x45')](get_open_tabs(_0x8de5('0x4e'),_0x191360[_0x8de5('0x4b')]));return Promise['all'](_0x21b451);})[_0x8de5('0x23')](function(_0x263b18){if(_0x263b18){var _0x15509a=_[_0x8de5('0x34')](values['ChatOpenTabs'],function(_0x200dc7){return{'channel':_0x8de5('0xba'),'id':_0x200dc7['id'],'createdAt':_0x200dc7[_0x8de5('0xbb')]};});var _0x1d44eb=_[_0x8de5('0x34')](values[_0x8de5('0xbc')],function(_0x59dfa9){return{'channel':'FAX','id':_0x59dfa9['id'],'createdAt':_0x59dfa9['createdAt']};});var _0x22315d=_[_0x8de5('0x34')](values[_0x8de5('0xbd')],function(_0x2b0d4b){return{'channel':'OPENCHANNEL','id':_0x2b0d4b['id'],'createdAt':_0x2b0d4b[_0x8de5('0xbb')]};});var _0x39dc4e=_[_0x8de5('0x34')](values['MailOpenTabs'],function(_0x2063f0){return{'channel':_0x8de5('0xbe'),'id':_0x2063f0['id'],'createdAt':_0x2063f0['createdAt']};});var _0x520d54=_[_0x8de5('0x34')](values['SmsOpenTabs'],function(_0x3b2f67){return{'channel':_0x8de5('0xbf'),'id':_0x3b2f67['id'],'createdAt':_0x3b2f67[_0x8de5('0xbb')]};});var _0xa6a017=_['map'](values['WhatsappOpenTabs'],function(_0x1bcf7e){return{'channel':_0x8de5('0xc0'),'id':_0x1bcf7e['id'],'createdAt':_0x1bcf7e[_0x8de5('0xbb')]};});var _0x5f9957=_['concat'](_0x15509a,_0x1d44eb,_0x22315d,_0x39dc4e,_0x520d54,_0xa6a017);var _0xa6bcd4={'count':_0x5f9957[_0x8de5('0x49')],'rows':_0x5f9957};return _0xa6bcd4;}else return null;})['then'](respondWithResult(_0x5313c8,null))[_0x8de5('0x58')](handleError(_0x5313c8,null));};exports[_0x8de5('0xc1')]=function(_0x42875f,_0xd90747){var _0x44267a={};return db['User']['findOne']({'where':{'id':_0x42875f[_0x8de5('0x51')]['id']}})[_0x8de5('0x23')](function(_0x33dc3c){if(!_0x33dc3c){throw new APINotFoundError(util[_0x8de5('0xc2')](_0x8de5('0xc3'),_0x42875f[_0x8de5('0x51')]['id']));}return contacts[_0x8de5('0x59')]();})[_0x8de5('0x23')](function(_0x3bd767){_0x42875f[_0x8de5('0x40')][_0x8de5('0x32')]=_0x42875f['params']['id'];_0x44267a=qs[_0x8de5('0x3e')](_0x3bd767,_0x42875f);if(_0x42875f[_0x8de5('0x40')][_0x8de5('0xc4')](_0x8de5('0x52'))){_0x44267a[_0x8de5('0x41')]=[{'model':db[_0x8de5('0xc5')],'as':_0x8de5('0xc6'),'required':![]},{'model':db[_0x8de5('0xc7')],'as':'Tags','attributes':['id',_0x8de5('0x2c'),'color'],'where':_0x42875f[_0x8de5('0x40')]['tag']?{'id':_0x42875f['query']['tag']}:undefined,'required':_0x42875f['query'][_0x8de5('0xc8')]?!![]:![]}];}return contacts['findAll'](_0x42875f[_0x8de5('0x40')],_0x42875f[_0x8de5('0x25')],_0x44267a,_0x3bd767);})['then'](respondWithFilteredResult(_0xd90747,_0x44267a))[_0x8de5('0x58')](APIHandleError(_0xd90747));};exports[_0x8de5('0xc9')]=function(_0x236530,_0x5de7af){var _0x516f6e;var _0x314796={};var _0x2a44df;return db[_0x8de5('0x32')][_0x8de5('0x91')]({'where':{'id':_0x236530[_0x8de5('0x51')]['id']},'attributes':['id',_0x8de5('0x2c'),'role']})['then'](handleEntityNotFound(_0x5de7af,null))[_0x8de5('0x23')](function(_0x144685){if(!utils['isValidChannel'](_0x236530[_0x8de5('0x40')][_0x8de5('0xaa')])){throw new db[(_0x8de5('0x8a'))][(_0x8de5('0x8e'))](_0x8de5('0x9c'));}_0x516f6e=_0x144685;var _0x2e407b={};_0x2e407b['model']=_['keys'](db[_[_0x8de5('0x9e')](_0x236530[_0x8de5('0x40')][_0x8de5('0xaa')])+_0x8de5('0xca')]['rawAttributes']);_0x2e407b['query']=_['keys'](_0x236530[_0x8de5('0x40')]);_0x2e407b['filters']=_['intersection'](_0x2e407b[_0x8de5('0xcb')],_0x2e407b[_0x8de5('0x40')]);_0x314796[_0x8de5('0x44')]=_[_0x8de5('0xcc')](_0x2e407b[_0x8de5('0xcb')],qs[_0x8de5('0xcd')](_0x236530[_0x8de5('0x40')]['fields']));_0x314796[_0x8de5('0x44')]=_0x314796['attributes'][_0x8de5('0x49')]?_0x314796[_0x8de5('0x44')]:_0x2e407b[_0x8de5('0xcb')];_0x314796[_0x8de5('0xce')]=qs['sort'](_0x236530[_0x8de5('0x40')][_0x8de5('0xcf')]);_0x314796['where']=qs[_0x8de5('0xd0')](_['pick'](_0x236530[_0x8de5('0x40')],_0x2e407b[_0x8de5('0xd0')]));if(_0x236530[_0x8de5('0x40')][_0x8de5('0x27')]){_0x314796['where']=_[_0x8de5('0xd1')](_0x314796[_0x8de5('0x3f')],{'$or':_['map'](_0x314796[_0x8de5('0x44')],function(_0x1474b2){var _0x40cc96={};_0x40cc96[_0x1474b2]={'$like':'%'+_0x236530[_0x8de5('0x40')][_0x8de5('0x27')]+'%'};return _0x40cc96;})});}_0x314796=_[_0x8de5('0xd1')]({},_0x314796,_0x236530[_0x8de5('0x54')]);switch(_0x516f6e[_0x8de5('0x20')]){case'admin':return db[_[_0x8de5('0x9e')](_0x236530[_0x8de5('0x40')][_0x8de5('0xaa')])+_0x8de5('0xca')][_0x8de5('0x46')](_0x314796);case _0x8de5('0x25'):case'agent':return _0x516f6e[_0x8de5('0x24')+_[_0x8de5('0x9e')](_0x236530['query'][_0x8de5('0xaa')])+_0x8de5('0xa0')](_0x314796);default:throw new db['Sequelize'][(_0x8de5('0x8e'))](_0x8de5('0xd2'));}})[_0x8de5('0x23')](function(_0x134a2b){_0x2a44df=_0x134a2b[_0x8de5('0x49')];if(!_0x236530[_0x8de5('0x40')]['hasOwnProperty'](_0x8de5('0xd3'))){_0x314796['limit']=qs[_0x8de5('0x1b')](_0x236530[_0x8de5('0x40')][_0x8de5('0x1b')]);_0x314796['offset']=qs['offset'](_0x236530[_0x8de5('0x40')][_0x8de5('0x19')]);}switch(_0x516f6e[_0x8de5('0x20')]){case _0x8de5('0x78'):return db[_[_0x8de5('0x9e')](_0x236530[_0x8de5('0x40')][_0x8de5('0xaa')])+_0x8de5('0xca')]['findAll'](_0x314796);case'user':case'agent':return _0x516f6e[_0x8de5('0x24')+_[_0x8de5('0x9e')](_0x236530[_0x8de5('0x40')]['channel'])+_0x8de5('0xa0')](_0x314796);}})[_0x8de5('0x23')](function(_0x2a4454){return{'count':_0x2a44df,'rows':_0x2a4454};})[_0x8de5('0x23')](respondWithResult(_0x5de7af,null))[_0x8de5('0x58')](handleError(_0x5de7af,null));};exports[_0x8de5('0xd4')]=function(_0x3fcd7b,_0x58573c){var _0x40d382={};var _0x5ae2f8={};var _0x32ed8f;var _0x477e9d;return db['User']['findOne']({'where':{'id':_0x3fcd7b['params']['id']}})[_0x8de5('0x23')](handleEntityNotFound(_0x58573c,null))['then'](function(_0x3082bf){if(_0x3082bf){_0x32ed8f=_0x3082bf;_0x5ae2f8[_0x8de5('0xcb')]=_[_0x8de5('0xd5')](db[_0x8de5('0xa9')][_0x8de5('0x33')]);_0x5ae2f8[_0x8de5('0x40')]=_[_0x8de5('0xd5')](_0x3fcd7b[_0x8de5('0x40')]);_0x5ae2f8[_0x8de5('0xd0')]=_['intersection'](_0x5ae2f8['model'],_0x5ae2f8[_0x8de5('0x40')]);_0x40d382[_0x8de5('0x44')]=_['intersection'](_0x5ae2f8[_0x8de5('0xcb')],qs['fields'](_0x3fcd7b[_0x8de5('0x40')][_0x8de5('0xcd')]));_0x40d382[_0x8de5('0x44')]=_0x40d382[_0x8de5('0x44')][_0x8de5('0x49')]?_0x40d382[_0x8de5('0x44')]:_0x5ae2f8[_0x8de5('0xcb')];_0x40d382['order']=qs['sort'](_0x3fcd7b['query'][_0x8de5('0xcf')]);_0x40d382[_0x8de5('0x3f')]=qs[_0x8de5('0xd0')](_['pick'](_0x3fcd7b[_0x8de5('0x40')],_0x5ae2f8[_0x8de5('0xd0')]));if(_0x3fcd7b['query'][_0x8de5('0x27')]){_0x40d382['where']=_[_0x8de5('0xd1')](_0x40d382[_0x8de5('0x3f')],{'$or':_[_0x8de5('0x34')](_0x40d382[_0x8de5('0x44')],function(_0x323b6b){var _0x318ad9={};_0x318ad9[_0x323b6b]={'$like':'%'+_0x3fcd7b['query'][_0x8de5('0x27')]+'%'};return _0x318ad9;})});}_0x40d382=_[_0x8de5('0xd1')]({},_0x40d382,_0x3fcd7b[_0x8de5('0x54')]);return _0x32ed8f[_0x8de5('0xd4')](_0x40d382);}})[_0x8de5('0x23')](function(_0x109c72){if(_0x109c72){_0x477e9d=_0x109c72[_0x8de5('0x49')];if(!_0x3fcd7b[_0x8de5('0x40')][_0x8de5('0xc4')](_0x8de5('0xd3'))){_0x40d382[_0x8de5('0x1b')]=qs[_0x8de5('0x1b')](_0x3fcd7b[_0x8de5('0x40')][_0x8de5('0x1b')]);_0x40d382[_0x8de5('0x19')]=qs[_0x8de5('0x19')](_0x3fcd7b[_0x8de5('0x40')]['offset']);}return _0x32ed8f[_0x8de5('0xd4')](_0x40d382);}})['then'](function(_0x13ca1d){if(_0x13ca1d){return _0x13ca1d?{'count':_0x477e9d,'rows':_0x13ca1d}:null;}})[_0x8de5('0x23')](respondWithResult(_0x58573c,null))[_0x8de5('0x58')](handleError(_0x58573c,null));};exports[_0x8de5('0xd6')]=function(_0x2a169c,_0x2df0ba){var _0x5cb768={};var _0x65131f={};var _0x1403c6;var _0x1d479e;return db[_0x8de5('0x32')][_0x8de5('0x91')]({'where':{'id':_0x2a169c[_0x8de5('0x51')]['id']}})[_0x8de5('0x23')](handleEntityNotFound(_0x2df0ba,null))['then'](function(_0x1831d4){if(_0x1831d4){_0x1403c6=_0x1831d4;_0x65131f[_0x8de5('0xcb')]=_['keys'](db['ChatGroup'][_0x8de5('0x33')]);_0x65131f[_0x8de5('0x40')]=_[_0x8de5('0xd5')](_0x2a169c['query']);_0x65131f[_0x8de5('0xd0')]=_['intersection'](_0x65131f['model'],_0x65131f['query']);_0x5cb768[_0x8de5('0x44')]=_[_0x8de5('0xcc')](_0x65131f[_0x8de5('0xcb')],qs[_0x8de5('0xcd')](_0x2a169c[_0x8de5('0x40')][_0x8de5('0xcd')]));_0x5cb768[_0x8de5('0x44')]=_0x5cb768[_0x8de5('0x44')][_0x8de5('0x49')]?_0x5cb768[_0x8de5('0x44')]:_0x65131f[_0x8de5('0xcb')];_0x5cb768[_0x8de5('0xce')]=qs[_0x8de5('0xcf')](_0x2a169c[_0x8de5('0x40')][_0x8de5('0xcf')]);_0x5cb768[_0x8de5('0x3f')]=qs[_0x8de5('0xd0')](_['pick'](_0x2a169c[_0x8de5('0x40')],_0x65131f['filters']));if(_0x2a169c['query'][_0x8de5('0x27')]){_0x5cb768['where']=_[_0x8de5('0xd1')](_0x5cb768[_0x8de5('0x3f')],{'$or':_[_0x8de5('0x34')](_0x5cb768[_0x8de5('0x44')],function(_0x2cf1ec){var _0x353cb7={};_0x353cb7[_0x2cf1ec]={'$like':'%'+_0x2a169c[_0x8de5('0x40')][_0x8de5('0x27')]+'%'};return _0x353cb7;})});}_0x5cb768=_['merge']({},_0x5cb768,_0x2a169c[_0x8de5('0x54')]);return _0x1403c6[_0x8de5('0xd6')](_0x5cb768);}})[_0x8de5('0x23')](function(_0x242eff){if(_0x242eff){_0x1d479e=_0x242eff[_0x8de5('0x49')];if(!_0x2a169c[_0x8de5('0x40')][_0x8de5('0xc4')]('nolimit')){_0x5cb768[_0x8de5('0x1b')]=qs[_0x8de5('0x1b')](_0x2a169c['query'][_0x8de5('0x1b')]);_0x5cb768['offset']=qs['offset'](_0x2a169c[_0x8de5('0x40')]['offset']);}return _0x1403c6[_0x8de5('0xd6')](_0x5cb768);}})['then'](function(_0x189e1e){if(_0x189e1e){return _0x189e1e?{'count':_0x1d479e,'rows':_0x189e1e}:null;}})[_0x8de5('0x23')](respondWithResult(_0x2df0ba,null))['catch'](handleError(_0x2df0ba,null));};exports[_0x8de5('0xd7')]=function(_0x258adf,_0x2a3be5){var _0x4609e6={'raw':!![],'where':{}};var _0x57e6c0={};var _0x1d07c0={'count':0x0,'rows':[]};return db['User'][_0x8de5('0x91')]({'where':{'id':_0x258adf['params']['id']}})[_0x8de5('0x23')](handleEntityNotFound(_0x2a3be5,null))[_0x8de5('0x23')](function(_0x5b6f6c){if(_0x5b6f6c){_0x57e6c0[_0x8de5('0xcb')]=_['keys'](db[_0x8de5('0xd8')][_0x8de5('0x33')]);_0x57e6c0[_0x8de5('0x40')]=_['keys'](_0x258adf[_0x8de5('0x40')]);_0x57e6c0[_0x8de5('0xd0')]=_[_0x8de5('0xcc')](_0x57e6c0[_0x8de5('0xcb')],_0x57e6c0['query']);_0x4609e6['attributes']=_[_0x8de5('0xcc')](_0x57e6c0['model'],qs['fields'](_0x258adf['query'][_0x8de5('0xcd')]));_0x4609e6[_0x8de5('0x44')]=_0x4609e6[_0x8de5('0x44')][_0x8de5('0x49')]?_0x4609e6[_0x8de5('0x44')]:_0x57e6c0[_0x8de5('0xcb')];if(!_0x258adf[_0x8de5('0x40')]['hasOwnProperty']('nolimit')){_0x4609e6[_0x8de5('0x1b')]=qs[_0x8de5('0x1b')](_0x258adf[_0x8de5('0x40')][_0x8de5('0x1b')]);_0x4609e6['offset']=qs[_0x8de5('0x19')](_0x258adf['query'][_0x8de5('0x19')]);}_0x4609e6[_0x8de5('0xce')]=qs['sort'](_0x258adf[_0x8de5('0x40')][_0x8de5('0xcf')]);_0x4609e6[_0x8de5('0x3f')]=qs['filters'](_[_0x8de5('0xd9')](_0x258adf[_0x8de5('0x40')],_0x57e6c0[_0x8de5('0xd0')]));_0x4609e6[_0x8de5('0x3f')][_0x8de5('0xda')]=_0x5b6f6c['id'];if(_0x258adf[_0x8de5('0x40')]['filter']){_0x4609e6[_0x8de5('0x3f')]=_[_0x8de5('0xd1')](_0x4609e6[_0x8de5('0x3f')],{'$or':_['map'](_0x4609e6['attributes'],function(_0x1ed3ee){var _0x4a5b58={};_0x4a5b58[_0x1ed3ee]={'$like':'%'+_0x258adf[_0x8de5('0x40')][_0x8de5('0x27')]+'%'};return _0x4a5b58;})});}_0x4609e6=_[_0x8de5('0xd1')]({},_0x4609e6,_0x258adf[_0x8de5('0x54')]);return db[_0x8de5('0xd8')]['count']({'where':_0x4609e6[_0x8de5('0x3f')]})[_0x8de5('0x23')](function(_0x279c07){_0x1d07c0['count']=_0x279c07;if(_0x258adf[_0x8de5('0x40')]['includeAll']){_0x4609e6[_0x8de5('0x41')]=[{'all':!![]}];}return db[_0x8de5('0xd8')][_0x8de5('0x46')](_0x4609e6);})['then'](function(_0x1988c4){_0x1d07c0['rows']=_0x1988c4;return _0x1d07c0;});}})['then'](respondWithFilteredResult(_0x2a3be5,_0x4609e6))[_0x8de5('0x58')](handleError(_0x2a3be5,null));};exports[_0x8de5('0xdb')]=function(_0x2f77e3,_0x2e231a){var _0x252be3={'raw':!![],'where':{}};var _0x540406={};var _0x3399f9={'count':0x0,'rows':[]};return db[_0x8de5('0x32')][_0x8de5('0x91')]({'where':{'id':_0x2f77e3[_0x8de5('0x51')]['id']}})['then'](handleEntityNotFound(_0x2e231a,null))[_0x8de5('0x23')](function(_0x40a6d9){if(_0x40a6d9){_0x540406['model']=_[_0x8de5('0xd5')](db['ScreenRecording']['rawAttributes']);_0x540406[_0x8de5('0x40')]=_['keys'](_0x2f77e3[_0x8de5('0x40')]);_0x540406[_0x8de5('0xd0')]=_[_0x8de5('0xcc')](_0x540406['model'],_0x540406[_0x8de5('0x40')]);_0x252be3[_0x8de5('0x44')]=_[_0x8de5('0xcc')](_0x540406[_0x8de5('0xcb')],qs[_0x8de5('0xcd')](_0x2f77e3[_0x8de5('0x40')][_0x8de5('0xcd')]));_0x252be3[_0x8de5('0x44')]=_0x252be3[_0x8de5('0x44')][_0x8de5('0x49')]?_0x252be3[_0x8de5('0x44')]:_0x540406[_0x8de5('0xcb')];if(!_0x2f77e3[_0x8de5('0x40')]['hasOwnProperty'](_0x8de5('0xd3'))){_0x252be3[_0x8de5('0x1b')]=qs[_0x8de5('0x1b')](_0x2f77e3[_0x8de5('0x40')][_0x8de5('0x1b')]);_0x252be3['offset']=qs[_0x8de5('0x19')](_0x2f77e3[_0x8de5('0x40')]['offset']);}_0x252be3['order']=qs[_0x8de5('0xcf')](_0x2f77e3[_0x8de5('0x40')]['sort']);_0x252be3[_0x8de5('0x3f')]=qs['filters'](_[_0x8de5('0xd9')](_0x2f77e3[_0x8de5('0x40')],_0x540406[_0x8de5('0xd0')]));_0x252be3['where']['UserId']=_0x40a6d9['id'];if(_0x2f77e3[_0x8de5('0x40')][_0x8de5('0x27')]){_0x252be3[_0x8de5('0x3f')]=_['merge'](_0x252be3[_0x8de5('0x3f')],{'$or':_[_0x8de5('0x34')](_0x252be3[_0x8de5('0x44')],function(_0x389833){var _0x4ef63b={};_0x4ef63b[_0x389833]={'$like':'%'+_0x2f77e3['query'][_0x8de5('0x27')]+'%'};return _0x4ef63b;})});}_0x252be3=_[_0x8de5('0xd1')]({},_0x252be3,_0x2f77e3[_0x8de5('0x54')]);return db[_0x8de5('0xdc')][_0x8de5('0x1c')]({'where':_0x252be3[_0x8de5('0x3f')]})['then'](function(_0xe57b3c){_0x3399f9[_0x8de5('0x1c')]=_0xe57b3c;if(_0x2f77e3['query'][_0x8de5('0x52')]){_0x252be3[_0x8de5('0x41')]=[{'all':!![]}];}return db[_0x8de5('0xdc')][_0x8de5('0x46')](_0x252be3);})['then'](function(_0x147f40){_0x3399f9[_0x8de5('0x47')]=_0x147f40;return _0x3399f9;});}})['then'](respondWithFilteredResult(_0x2e231a,_0x252be3))[_0x8de5('0x58')](handleError(_0x2e231a,null));};exports['getChatInteractions']=function(_0x4c80ef,_0x216d7d){var _0x3e4c57={};var _0x400d4c={};var _0x379dfe;var _0x49f869;return db[_0x8de5('0x32')]['findOne']({'where':{'id':_0x4c80ef[_0x8de5('0x51')]['id']}})[_0x8de5('0x23')](handleEntityNotFound(_0x216d7d,null))['then'](function(_0xc4a24d){if(_0xc4a24d){_0x379dfe=_0xc4a24d;_0x400d4c[_0x8de5('0xcb')]=_[_0x8de5('0xd5')](db['ChatInteraction'][_0x8de5('0x33')]);_0x400d4c[_0x8de5('0x40')]=_[_0x8de5('0xd5')](_0x4c80ef[_0x8de5('0x40')]);_0x400d4c[_0x8de5('0xd0')]=_[_0x8de5('0xcc')](_0x400d4c[_0x8de5('0xcb')],_0x400d4c[_0x8de5('0x40')]);_0x3e4c57[_0x8de5('0x44')]=_[_0x8de5('0xcc')](_0x400d4c['model'],qs[_0x8de5('0xcd')](_0x4c80ef[_0x8de5('0x40')][_0x8de5('0xcd')]));_0x3e4c57[_0x8de5('0x44')]=_0x3e4c57[_0x8de5('0x44')][_0x8de5('0x49')]?_0x3e4c57[_0x8de5('0x44')]:_0x400d4c[_0x8de5('0xcb')];_0x3e4c57[_0x8de5('0xce')]=qs[_0x8de5('0xcf')](_0x4c80ef[_0x8de5('0x40')][_0x8de5('0xcf')]);_0x3e4c57['where']=qs[_0x8de5('0xd0')](_['pick'](_0x4c80ef[_0x8de5('0x40')],_0x400d4c[_0x8de5('0xd0')]));if(_0x4c80ef[_0x8de5('0x40')]['filter']){_0x3e4c57[_0x8de5('0x3f')]=_[_0x8de5('0xd1')](_0x3e4c57['where'],{'$or':_[_0x8de5('0x34')](_0x3e4c57[_0x8de5('0x44')],function(_0x2e9167){var _0x1e31ee={};_0x1e31ee[_0x2e9167]={'$like':'%'+_0x4c80ef['query']['filter']+'%'};return _0x1e31ee;})});}_0x3e4c57=_[_0x8de5('0xd1')]({},_0x3e4c57,_0x4c80ef[_0x8de5('0x54')]);return _0x379dfe[_0x8de5('0xdd')](_0x3e4c57);}})['then'](function(_0x17d0ca){if(_0x17d0ca){_0x49f869=_0x17d0ca['length'];if(!_0x4c80ef[_0x8de5('0x40')][_0x8de5('0xc4')](_0x8de5('0xd3'))){_0x3e4c57[_0x8de5('0x1b')]=qs[_0x8de5('0x1b')](_0x4c80ef[_0x8de5('0x40')][_0x8de5('0x1b')]);_0x3e4c57[_0x8de5('0x19')]=qs[_0x8de5('0x19')](_0x4c80ef['query'][_0x8de5('0x19')]);}return _0x379dfe[_0x8de5('0xdd')](_0x3e4c57);}})['then'](function(_0x9f1c7d){if(_0x9f1c7d){return _0x9f1c7d?{'count':_0x49f869,'rows':_0x9f1c7d}:null;}})[_0x8de5('0x23')](respondWithResult(_0x216d7d,null))[_0x8de5('0x58')](handleError(_0x216d7d,null));};exports[_0x8de5('0xde')]=function(_0x27c51e,_0x7e1161){var _0x434616={};var _0x9d38c0={};var _0xe6c22e;var _0x133949;return db['User'][_0x8de5('0x91')]({'where':{'id':_0x27c51e[_0x8de5('0x51')]['id']}})['then'](handleEntityNotFound(_0x7e1161,null))[_0x8de5('0x23')](function(_0x2190e5){if(_0x2190e5){_0xe6c22e=_0x2190e5;_0x9d38c0[_0x8de5('0xcb')]=_[_0x8de5('0xd5')](db['OpenchannelInteraction'][_0x8de5('0x33')]);_0x9d38c0['query']=_[_0x8de5('0xd5')](_0x27c51e[_0x8de5('0x40')]);_0x9d38c0[_0x8de5('0xd0')]=_['intersection'](_0x9d38c0['model'],_0x9d38c0['query']);_0x434616[_0x8de5('0x44')]=_['intersection'](_0x9d38c0[_0x8de5('0xcb')],qs[_0x8de5('0xcd')](_0x27c51e['query'][_0x8de5('0xcd')]));_0x434616[_0x8de5('0x44')]=_0x434616[_0x8de5('0x44')]['length']?_0x434616[_0x8de5('0x44')]:_0x9d38c0[_0x8de5('0xcb')];_0x434616['order']=qs[_0x8de5('0xcf')](_0x27c51e[_0x8de5('0x40')][_0x8de5('0xcf')]);_0x434616[_0x8de5('0x3f')]=qs[_0x8de5('0xd0')](_[_0x8de5('0xd9')](_0x27c51e[_0x8de5('0x40')],_0x9d38c0[_0x8de5('0xd0')]));if(_0x27c51e[_0x8de5('0x40')]['filter']){_0x434616[_0x8de5('0x3f')]=_[_0x8de5('0xd1')](_0x434616[_0x8de5('0x3f')],{'$or':_[_0x8de5('0x34')](_0x434616[_0x8de5('0x44')],function(_0x4443cd){var _0x4a043f={};_0x4a043f[_0x4443cd]={'$like':'%'+_0x27c51e[_0x8de5('0x40')][_0x8de5('0x27')]+'%'};return _0x4a043f;})});}_0x434616=_[_0x8de5('0xd1')]({},_0x434616,_0x27c51e[_0x8de5('0x54')]);return _0xe6c22e[_0x8de5('0xde')](_0x434616);}})[_0x8de5('0x23')](function(_0x2880c9){if(_0x2880c9){_0x133949=_0x2880c9['length'];if(!_0x27c51e[_0x8de5('0x40')][_0x8de5('0xc4')](_0x8de5('0xd3'))){_0x434616[_0x8de5('0x1b')]=qs[_0x8de5('0x1b')](_0x27c51e[_0x8de5('0x40')]['limit']);_0x434616[_0x8de5('0x19')]=qs[_0x8de5('0x19')](_0x27c51e[_0x8de5('0x40')][_0x8de5('0x19')]);}return _0xe6c22e[_0x8de5('0xde')](_0x434616);}})[_0x8de5('0x23')](function(_0x44c02b){if(_0x44c02b){return _0x44c02b?{'count':_0x133949,'rows':_0x44c02b}:null;}})[_0x8de5('0x23')](respondWithResult(_0x7e1161,null))[_0x8de5('0x58')](handleError(_0x7e1161,null));};exports['getMailInteractions']=function(_0x5bc9ee,_0x15226f){var _0x7c9ada={'raw':!![],'where':{}};var _0x329d71={};var _0x3ab080={'count':0x0,'rows':[]};return db[_0x8de5('0x32')]['findOne']({'where':{'id':_0x5bc9ee[_0x8de5('0x51')]['id']}})[_0x8de5('0x23')](handleEntityNotFound(_0x15226f,null))[_0x8de5('0x23')](function(_0x18afdf){if(_0x18afdf){_0x329d71[_0x8de5('0xcb')]=_['keys'](db[_0x8de5('0xdf')]['rawAttributes']);_0x329d71['query']=_[_0x8de5('0xd5')](_0x5bc9ee[_0x8de5('0x40')]);_0x329d71[_0x8de5('0xd0')]=_[_0x8de5('0xcc')](_0x329d71[_0x8de5('0xcb')],_0x329d71[_0x8de5('0x40')]);_0x7c9ada[_0x8de5('0x44')]=_[_0x8de5('0xcc')](_0x329d71['model'],qs[_0x8de5('0xcd')](_0x5bc9ee[_0x8de5('0x40')][_0x8de5('0xcd')]));_0x7c9ada[_0x8de5('0x44')]=_0x7c9ada[_0x8de5('0x44')][_0x8de5('0x49')]?_0x7c9ada[_0x8de5('0x44')]:_0x329d71[_0x8de5('0xcb')];if(!_0x5bc9ee[_0x8de5('0x40')]['hasOwnProperty']('nolimit')){_0x7c9ada[_0x8de5('0x1b')]=qs[_0x8de5('0x1b')](_0x5bc9ee[_0x8de5('0x40')]['limit']);_0x7c9ada[_0x8de5('0x19')]=qs['offset'](_0x5bc9ee[_0x8de5('0x40')][_0x8de5('0x19')]);}_0x7c9ada[_0x8de5('0xce')]=qs[_0x8de5('0xcf')](_0x5bc9ee[_0x8de5('0x40')][_0x8de5('0xcf')]);_0x7c9ada[_0x8de5('0x3f')]=qs[_0x8de5('0xd0')](_['pick'](_0x5bc9ee[_0x8de5('0x40')],_0x329d71[_0x8de5('0xd0')]));_0x7c9ada[_0x8de5('0x3f')][_0x8de5('0xda')]=_0x18afdf['id'];if(_0x5bc9ee[_0x8de5('0x40')][_0x8de5('0x27')]){_0x7c9ada[_0x8de5('0x3f')]=_[_0x8de5('0xd1')](_0x7c9ada[_0x8de5('0x3f')],{'$or':_[_0x8de5('0x34')](_0x7c9ada[_0x8de5('0x44')],function(_0x1bcdb0){var _0xf603b6={};_0xf603b6[_0x1bcdb0]={'$like':'%'+_0x5bc9ee['query']['filter']+'%'};return _0xf603b6;})});}_0x7c9ada=_[_0x8de5('0xd1')]({},_0x7c9ada,_0x5bc9ee['options']);return db[_0x8de5('0xdf')][_0x8de5('0x1c')]({'where':_0x7c9ada[_0x8de5('0x3f')]})['then'](function(_0x382f89){_0x3ab080['count']=_0x382f89;if(_0x5bc9ee[_0x8de5('0x40')]['includeAll']){_0x7c9ada[_0x8de5('0x41')]=[{'all':!![]}];}return db[_0x8de5('0xdf')][_0x8de5('0x46')](_0x7c9ada);})[_0x8de5('0x23')](function(_0x35b3e7){_0x3ab080[_0x8de5('0x47')]=_0x35b3e7;return _0x3ab080;});}})[_0x8de5('0x23')](respondWithFilteredResult(_0x15226f,_0x7c9ada))[_0x8de5('0x58')](handleError(_0x15226f,null));};exports[_0x8de5('0xe0')]=function(_0x4c4229,_0x52097c){var _0x321ddf={};var _0x1e8f08={};var _0x5a34f8;var _0x5a60bd;return db[_0x8de5('0x32')]['findOne']({'where':{'id':_0x4c4229[_0x8de5('0x51')]['id']}})[_0x8de5('0x23')](handleEntityNotFound(_0x52097c,null))[_0x8de5('0x23')](function(_0x35fe7e){if(_0x35fe7e){_0x5a34f8=_0x35fe7e;_0x1e8f08[_0x8de5('0xcb')]=_[_0x8de5('0xd5')](db[_0x8de5('0xe1')][_0x8de5('0x33')]);_0x1e8f08[_0x8de5('0x40')]=_[_0x8de5('0xd5')](_0x4c4229[_0x8de5('0x40')]);_0x1e8f08['filters']=_[_0x8de5('0xcc')](_0x1e8f08[_0x8de5('0xcb')],_0x1e8f08[_0x8de5('0x40')]);_0x321ddf[_0x8de5('0x44')]=_[_0x8de5('0xcc')](_0x1e8f08[_0x8de5('0xcb')],qs[_0x8de5('0xcd')](_0x4c4229[_0x8de5('0x40')][_0x8de5('0xcd')]));_0x321ddf[_0x8de5('0x44')]=_0x321ddf[_0x8de5('0x44')][_0x8de5('0x49')]?_0x321ddf['attributes']:_0x1e8f08[_0x8de5('0xcb')];_0x321ddf[_0x8de5('0xce')]=qs[_0x8de5('0xcf')](_0x4c4229['query']['sort']);_0x321ddf[_0x8de5('0x3f')]=qs[_0x8de5('0xd0')](_[_0x8de5('0xd9')](_0x4c4229[_0x8de5('0x40')],_0x1e8f08[_0x8de5('0xd0')]));if(_0x4c4229['query'][_0x8de5('0x27')]){_0x321ddf[_0x8de5('0x3f')]=_[_0x8de5('0xd1')](_0x321ddf[_0x8de5('0x3f')],{'$or':_[_0x8de5('0x34')](_0x321ddf[_0x8de5('0x44')],function(_0x733e76){var _0x24d275={};_0x24d275[_0x733e76]={'$like':'%'+_0x4c4229[_0x8de5('0x40')][_0x8de5('0x27')]+'%'};return _0x24d275;})});}_0x321ddf=_['merge']({},_0x321ddf,_0x4c4229['options']);return _0x5a34f8[_0x8de5('0xe0')](_0x321ddf);}})['then'](function(_0x33a729){if(_0x33a729){_0x5a60bd=_0x33a729[_0x8de5('0x49')];if(!_0x4c4229[_0x8de5('0x40')][_0x8de5('0xc4')]('nolimit')){_0x321ddf[_0x8de5('0x1b')]=qs['limit'](_0x4c4229[_0x8de5('0x40')][_0x8de5('0x1b')]);_0x321ddf[_0x8de5('0x19')]=qs[_0x8de5('0x19')](_0x4c4229[_0x8de5('0x40')]['offset']);}return _0x5a34f8[_0x8de5('0xe0')](_0x321ddf);}})['then'](function(_0x9587f0){if(_0x9587f0){return _0x9587f0?{'count':_0x5a60bd,'rows':_0x9587f0}:null;}})['then'](respondWithResult(_0x52097c,null))[_0x8de5('0x58')](handleError(_0x52097c,null));};exports[_0x8de5('0xe2')]=function(_0xb6fdea,_0x2a3a8e){var _0xc1d786={};var _0x7d01ac={};var _0x372138;var _0x36d040;return db[_0x8de5('0x32')][_0x8de5('0x91')]({'where':{'id':_0xb6fdea[_0x8de5('0x51')]['id']}})[_0x8de5('0x23')](handleEntityNotFound(_0x2a3a8e,null))['then'](function(_0x4b080a){if(_0x4b080a){_0x372138=_0x4b080a;_0x7d01ac['model']=_[_0x8de5('0xd5')](db[_0x8de5('0xe3')]['rawAttributes']);_0x7d01ac['query']=_['keys'](_0xb6fdea[_0x8de5('0x40')]);_0x7d01ac[_0x8de5('0xd0')]=_['intersection'](_0x7d01ac[_0x8de5('0xcb')],_0x7d01ac[_0x8de5('0x40')]);_0xc1d786[_0x8de5('0x44')]=_[_0x8de5('0xcc')](_0x7d01ac['model'],qs[_0x8de5('0xcd')](_0xb6fdea[_0x8de5('0x40')]['fields']));_0xc1d786[_0x8de5('0x44')]=_0xc1d786['attributes'][_0x8de5('0x49')]?_0xc1d786['attributes']:_0x7d01ac['model'];_0xc1d786[_0x8de5('0xce')]=qs[_0x8de5('0xcf')](_0xb6fdea['query'][_0x8de5('0xcf')]);_0xc1d786['where']=qs[_0x8de5('0xd0')](_[_0x8de5('0xd9')](_0xb6fdea[_0x8de5('0x40')],_0x7d01ac['filters']));if(_0xb6fdea[_0x8de5('0x40')]['filter']){_0xc1d786[_0x8de5('0x3f')]=_['merge'](_0xc1d786[_0x8de5('0x3f')],{'$or':_['map'](_0xc1d786['attributes'],function(_0x8c3cdb){var _0x1ad1ea={};_0x1ad1ea[_0x8c3cdb]={'$like':'%'+_0xb6fdea[_0x8de5('0x40')]['filter']+'%'};return _0x1ad1ea;})});}_0xc1d786=_[_0x8de5('0xd1')]({},_0xc1d786,_0xb6fdea[_0x8de5('0x54')]);return _0x372138[_0x8de5('0xe2')](_0xc1d786);}})[_0x8de5('0x23')](function(_0x346929){if(_0x346929){_0x36d040=_0x346929[_0x8de5('0x49')];if(!_0xb6fdea[_0x8de5('0x40')]['hasOwnProperty'](_0x8de5('0xd3'))){_0xc1d786['limit']=qs['limit'](_0xb6fdea[_0x8de5('0x40')][_0x8de5('0x1b')]);_0xc1d786[_0x8de5('0x19')]=qs['offset'](_0xb6fdea['query'][_0x8de5('0x19')]);}return _0x372138[_0x8de5('0xe2')](_0xc1d786);}})[_0x8de5('0x23')](function(_0x273572){if(_0x273572){return _0x273572?{'count':_0x36d040,'rows':_0x273572}:null;}})[_0x8de5('0x23')](respondWithResult(_0x2a3a8e,null))['catch'](handleError(_0x2a3a8e,null));};exports['getWhatsappInteractions']=function(_0x39d55a,_0x39adc4){var _0x24a768={};var _0x3a859f={};var _0x4b7f48;var _0x5b1471;return db['User'][_0x8de5('0x91')]({'where':{'id':_0x39d55a[_0x8de5('0x51')]['id']}})[_0x8de5('0x23')](handleEntityNotFound(_0x39adc4,null))[_0x8de5('0x23')](function(_0x9ac184){if(_0x9ac184){_0x4b7f48=_0x9ac184;_0x3a859f[_0x8de5('0xcb')]=_[_0x8de5('0xd5')](db['WhatsappInteraction']['rawAttributes']);_0x3a859f['query']=_[_0x8de5('0xd5')](_0x39d55a[_0x8de5('0x40')]);_0x3a859f[_0x8de5('0xd0')]=_[_0x8de5('0xcc')](_0x3a859f[_0x8de5('0xcb')],_0x3a859f['query']);_0x24a768['attributes']=_[_0x8de5('0xcc')](_0x3a859f[_0x8de5('0xcb')],qs['fields'](_0x39d55a[_0x8de5('0x40')]['fields']));_0x24a768[_0x8de5('0x44')]=_0x24a768[_0x8de5('0x44')][_0x8de5('0x49')]?_0x24a768[_0x8de5('0x44')]:_0x3a859f['model'];_0x24a768[_0x8de5('0xce')]=qs[_0x8de5('0xcf')](_0x39d55a[_0x8de5('0x40')][_0x8de5('0xcf')]);_0x24a768['where']=qs['filters'](_[_0x8de5('0xd9')](_0x39d55a[_0x8de5('0x40')],_0x3a859f[_0x8de5('0xd0')]));if(_0x39d55a[_0x8de5('0x40')][_0x8de5('0x27')]){_0x24a768[_0x8de5('0x3f')]=_['merge'](_0x24a768[_0x8de5('0x3f')],{'$or':_['map'](_0x24a768['attributes'],function(_0x4799ec){var _0x2d6d09={};_0x2d6d09[_0x4799ec]={'$like':'%'+_0x39d55a[_0x8de5('0x40')]['filter']+'%'};return _0x2d6d09;})});}_0x24a768=_['merge']({},_0x24a768,_0x39d55a[_0x8de5('0x54')]);return _0x4b7f48['getWhatsappInteractions'](_0x24a768);}})[_0x8de5('0x23')](function(_0x2553fc){if(_0x2553fc){_0x5b1471=_0x2553fc[_0x8de5('0x49')];if(!_0x39d55a[_0x8de5('0x40')][_0x8de5('0xc4')](_0x8de5('0xd3'))){_0x24a768[_0x8de5('0x1b')]=qs[_0x8de5('0x1b')](_0x39d55a[_0x8de5('0x40')][_0x8de5('0x1b')]);_0x24a768[_0x8de5('0x19')]=qs['offset'](_0x39d55a[_0x8de5('0x40')][_0x8de5('0x19')]);}return _0x4b7f48['getWhatsappInteractions'](_0x24a768);}})[_0x8de5('0x23')](function(_0x217193){if(_0x217193){return _0x217193?{'count':_0x5b1471,'rows':_0x217193}:null;}})[_0x8de5('0x23')](respondWithResult(_0x39adc4,null))[_0x8de5('0x58')](handleError(_0x39adc4,null));};exports['login']=function(_0x782a67,_0x21806b,_0x2fa6aa){var _0x3d50b0;var _0x3a5499;var _0x57e5c0;var _0x344e34=!_[_0x8de5('0x62')](_0x782a67[_0x8de5('0x51')]['id'])?_0x782a67[_0x8de5('0x51')]['id']:!_[_0x8de5('0x62')](_0x782a67[_0x8de5('0x25')]['id'])?_0x782a67[_0x8de5('0x25')]['id']:null;return db['User'][_0x8de5('0x2b')]({'where':{'id':_0x344e34,'role':{'$or':[_0x8de5('0x78'),_0x8de5('0x25'),_0x8de5('0x21')]}},'attributes':['id','name','phone',_0x8de5('0xe4'),_0x8de5('0x20'),_0x8de5('0x5d'),_0x8de5('0x99')]})['then'](function(_0x2c3846){if(_0x2c3846){if(_0x2c3846[_0x8de5('0x20')]===_0x8de5('0x21')){_0x3d50b0=_0x2c3846;if(_0x782a67[_0x8de5('0x57')]['interface']){_0x57e5c0=util[_0x8de5('0xc2')]('LOCAL/%s@from-sip/n',_0x3d50b0[_0x782a67[_0x8de5('0x57')]['interface']]);}else if(_0x782a67[_0x8de5('0x57')][_0x8de5('0xe5')]){_0x57e5c0=util['format'](_0x8de5('0xa7'),_0x782a67[_0x8de5('0x57')][_0x8de5('0xe5')]);}else{_0x57e5c0=util[_0x8de5('0xc2')](_0x8de5('0xa7'),_0x3d50b0['name']);}socket['to'](util[_0x8de5('0xc2')](_0x8de5('0xe6'),_0x3d50b0['name']))['emit'](_0x8de5('0xe7'),{'user':{'id':_0x3d50b0['id'],'name':_0x3d50b0[_0x8de5('0x2c')]},'ip':_0x782a67[_0x8de5('0xe8')][_0x8de5('0xe9')]||_0x782a67[_0x8de5('0xea')][_0x8de5('0xeb')]||_0x782a67['socket'][_0x8de5('0xeb')]||_0x782a67['connection'][_0x8de5('0xec')][_0x8de5('0xeb')]});return db[_0x8de5('0xa9')][_0x8de5('0x2e')]({'where':{'membername':_0x3d50b0[_0x8de5('0x2c')]},'individualHooks':!![]});}}else{throw new db['Sequelize'][(_0x8de5('0x8e'))](_0x8de5('0xed'));}})['then'](function(){if(_0x3d50b0){return _0x3d50b0[_0x8de5('0xee')]({'raw':!![]});}})[_0x8de5('0x23')](function(_0x5e5445){if(_0x3d50b0){if(_0x5e5445){_0x3a5499=_0x5e5445;if(_0x3a5499[_0x8de5('0x49')]){var _0x654842=_0x3a5499[_0x8de5('0x34')](function(_0x3a51cc){var _0x573b10={'membername':_0x3d50b0['name'],'UserId':_0x3d50b0['id'],'queue_name':_0x3a51cc['name'],'VoiceQueueId':_0x3a51cc['id'],'interface':_0x57e5c0,'paused':_0x3d50b0[_0x8de5('0x99')]||![],'penalty':_0x3a51cc[_0x8de5('0xef')]||0x0};return db[_0x8de5('0xa9')]['upsert'](_0x573b10);});return Promise['all'](_0x654842);}}}})[_0x8de5('0x23')](function(){if(_0x3d50b0){return db['MemberReport'][_0x8de5('0x46')]({'where':{'membername':_0x3d50b0[_0x8de5('0x2c')],'exitAt':null}});}})['then'](function(_0x236d56){if(_0x3d50b0){var _0x4fca5a=[];_0x236d56['forEach'](function(_0x5ecaa3){_0x4fca5a[_0x8de5('0x45')](_0x5ecaa3[_0x8de5('0x1f')]({'exitAt':moment()[_0x8de5('0xc2')](_0x8de5('0xf0'))}));});return Promise[_0x8de5('0x56')](_0x4fca5a);}})[_0x8de5('0x23')](function(){if(_0x3d50b0){var _0x5d0258=[];var _0x5519fd=[];var _0x528d3a=utils[_0x8de5('0xf1')]();var _0x3e2bcd={'membername':_0x3d50b0[_0x8de5('0x2c')],'interface':_0x57e5c0,'enterAt':moment()[_0x8de5('0xc2')](_0x8de5('0xf0')),'role':_0x3d50b0['role'],'internal':_0x3d50b0[_0x8de5('0x5d')]};_0x528d3a['forEach'](function(_0x4dc03c){_0x5d0258['push'](_[_0x8de5('0xd1')]({'channel':_0x4dc03c,'type':'LOGIN','data1':_0x782a67['body']['device'],'data2':_0x57e5c0},_0x3e2bcd));if(_0x3d50b0[_0x8de5('0x99')]){_0x5519fd[_0x8de5('0x45')](_[_0x8de5('0xd1')]({'channel':_0x4dc03c,'type':_0x8de5('0xf2'),'data1':'LOGININPAUSE'},_0x3e2bcd));}});return db[_0x8de5('0xf3')][_0x8de5('0x80')](_0x5d0258[_0x8de5('0xf4')](_0x5519fd),{'individualHooks':!![]});}})['then'](function(){if(_0x3d50b0){return _0x3d50b0[_0x8de5('0x1f')]({'online':!![],'lastLoginAt':moment()[_0x8de5('0xc2')](_0x8de5('0xf0')),'voicePause':_0x3d50b0[_0x8de5('0x99')]||![],'mailPause':_0x3d50b0[_0x8de5('0x99')]||![],'chatPause':_0x3d50b0[_0x8de5('0x99')]||![],'faxPause':_0x3d50b0[_0x8de5('0x99')]||![],'smsPause':_0x3d50b0[_0x8de5('0x99')]||![],'openchannelPause':_0x3d50b0[_0x8de5('0x99')]||![],'whatsappPause':_0x3d50b0[_0x8de5('0x99')]||![],'pauseType':_0x3d50b0[_0x8de5('0x99')]?_0x8de5('0xf5'):null,'interface':_0x57e5c0,'lastPauseAt':moment()[_0x8de5('0xc2')](_0x8de5('0xf0'))});}})[_0x8de5('0x23')](function(_0x42e37e){if(_0x782a67[_0x8de5('0xf6')]){return _0x2fa6aa();}else{return Promise[_0x8de5('0xf7')](_0x42e37e)[_0x8de5('0x23')](respondWithResult(_0x21806b,null));}})[_0x8de5('0x58')](handleError(_0x21806b,null));};exports[_0x8de5('0xf8')]=function(_0x48b734,_0x24e474){var _0x41d16b;return db['User'][_0x8de5('0x2b')]({'where':{'id':_0x48b734['params']['id'],'role':_0x8de5('0x21')},'attributes':['id',_0x8de5('0x2c'),_0x8de5('0x20')]})[_0x8de5('0x23')](handleEntityNotFound(_0x24e474,null))[_0x8de5('0x23')](function(_0x440632){if(_0x440632){_0x41d16b=_0x440632;return db['UserVoiceQueueRt']['destroy']({'where':{'membername':_0x41d16b['name']},'individualHooks':!![]});}})['then'](function(){return db[_0x8de5('0xf3')][_0x8de5('0x46')]({'where':{'membername':_0x41d16b[_0x8de5('0x2c')],'exitAt':null}});})[_0x8de5('0x23')](function(_0x247e19){var _0x13bd77=[];_0x247e19[_0x8de5('0xf9')](function(_0x7fa899){_0x13bd77[_0x8de5('0x45')](_0x7fa899[_0x8de5('0x1f')]({'exitAt':moment()[_0x8de5('0xc2')]('YYYY-MM-DD\x20HH:mm:ss')}));});return Promise[_0x8de5('0x56')](_0x13bd77);})[_0x8de5('0x23')](function(){return _0x41d16b[_0x8de5('0x1f')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x8de5('0x23')](respondWithResult(_0x24e474,null))[_0x8de5('0x58')](handleError(_0x24e474,null));};exports['pause']=function(_0x3ce836,_0xf457c){var _0x52526b;return db[_0x8de5('0xa9')][_0x8de5('0x1f')]({'paused':0x1},{'where':{'UserId':_0x3ce836[_0x8de5('0x51')]['id']},'individualHooks':!![]})[_0x8de5('0x23')](function(){return db[_0x8de5('0x32')][_0x8de5('0x2b')]({'where':{'id':_0x3ce836['params']['id'],'role':'agent'},'attributes':['id',_0x8de5('0x2c'),_0x8de5('0x20'),_0x8de5('0x5d'),_0x8de5('0x9a'),'online']});})[_0x8de5('0x23')](handleEntityNotFound(_0xf457c,null))[_0x8de5('0x23')](function(_0x23617a){if(_0x23617a){_0x52526b=_0x23617a;return db['MemberReport'][_0x8de5('0x46')]({'where':{'membername':_0x52526b['name'],'type':'PAUSE','exitAt':null}});}})[_0x8de5('0x23')](function(_0x16cf39){if(_0x16cf39['length']){var _0xbb70dd=moment()[_0x8de5('0xc2')](_0x8de5('0xf0'));for(var _0x147461=0x0,_0x27765d=_0x16cf39['length'];_0x147461<_0x27765d;_0x147461++){_0x16cf39[_0x147461][_0x8de5('0xfa')]({'exitAt':_0xbb70dd});}}})[_0x8de5('0x23')](function(){var _0x5a38a9=[];var _0x59631e=utils['getChannels']();_0x59631e[_0x8de5('0xf9')](function(_0x5edeac){_0x5a38a9[_0x8de5('0x45')]({'channel':_0x5edeac,'membername':_0x52526b[_0x8de5('0x2c')],'interface':_[_0x8de5('0x62')](_0x52526b[_0x8de5('0x9a')])?util[_0x8de5('0xc2')](_0x8de5('0xa7'),_0x52526b[_0x8de5('0x2c')]):_0x52526b[_0x8de5('0x9a')],'type':'PAUSE','enterAt':moment()[_0x8de5('0xc2')]('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x3ce836[_0x8de5('0x57')][_0x8de5('0x36')]||_0x8de5('0xfb'),'role':_0x52526b[_0x8de5('0x20')],'internal':_0x52526b[_0x8de5('0x5d')]});});return db['MemberReport'][_0x8de5('0x80')](_0x5a38a9,{'individualHooks':!![]});})[_0x8de5('0x23')](function(){return _0x52526b[_0x8de5('0x1f')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x3ce836[_0x8de5('0x57')][_0x8de5('0x36')]||_0x8de5('0xfb'),'lastPauseAt':moment()[_0x8de5('0xc2')](_0x8de5('0xf0'))});})[_0x8de5('0x23')](respondWithResult(_0xf457c,null))[_0x8de5('0x58')](handleError(_0xf457c,null));};exports[_0x8de5('0xfc')]=function(_0x7748f4,_0x57cb11){if(_0x7748f4['body'][_0x8de5('0xaa')]&&!utils['isValidChannel'](_0x7748f4[_0x8de5('0x57')][_0x8de5('0xaa')])){throw new APIBadRequestError(util[_0x8de5('0xc2')](_0x8de5('0xfd'),_0x7748f4[_0x8de5('0x57')][_0x8de5('0xaa')]));}return db['User']['find']({'where':{'id':_0x7748f4[_0x8de5('0x51')]['id']},'attributes':['id',_0x8de5('0x2c'),'role',_0x8de5('0x5d'),_0x8de5('0x9a'),_0x8de5('0x98'),'voicePause',_0x8de5('0xfe'),_0x8de5('0xff'),_0x8de5('0x100'),_0x8de5('0x101'),_0x8de5('0x102'),'whatsappPause','pauseType','lastPauseAt']})[_0x8de5('0x23')](function(_0x55e804){if(!_0x55e804){throw new APINotFoundError(util[_0x8de5('0xc2')](_0x8de5('0xc3'),_0x7748f4[_0x8de5('0x51')]['id']));}return _0x55e804['unpause'](_0x7748f4['body'][_0x8de5('0xaa')]);})[_0x8de5('0x23')](respondWithResult(_0x57cb11,null))['catch'](APIHandleError(_0x57cb11));};exports['getTeams']=function(_0x12819d,_0x4e9f5b){var _0x3b6e74={};var _0x3e3aa8={};var _0x19e7b3;var _0xa4e1c5;return db[_0x8de5('0x32')]['findOne']({'where':{'id':_0x12819d[_0x8de5('0x51')]['id']}})[_0x8de5('0x23')](handleEntityNotFound(_0x4e9f5b,null))['then'](function(_0x2ede44){if(_0x2ede44){_0x19e7b3=_0x2ede44;_0x3e3aa8[_0x8de5('0xcb')]=_[_0x8de5('0xd5')](db['Team'][_0x8de5('0x33')]);_0x3e3aa8[_0x8de5('0x40')]=_[_0x8de5('0xd5')](_0x12819d[_0x8de5('0x40')]);_0x3e3aa8[_0x8de5('0xd0')]=_[_0x8de5('0xcc')](_0x3e3aa8[_0x8de5('0xcb')],_0x3e3aa8[_0x8de5('0x40')]);_0x3b6e74['attributes']=_[_0x8de5('0xcc')](_0x3e3aa8['model'],qs[_0x8de5('0xcd')](_0x12819d[_0x8de5('0x40')][_0x8de5('0xcd')]));_0x3b6e74[_0x8de5('0x44')]=_0x3b6e74[_0x8de5('0x44')][_0x8de5('0x49')]?_0x3b6e74[_0x8de5('0x44')]:_0x3e3aa8[_0x8de5('0xcb')];_0x3b6e74[_0x8de5('0xce')]=qs[_0x8de5('0xcf')](_0x12819d[_0x8de5('0x40')][_0x8de5('0xcf')]);_0x3b6e74[_0x8de5('0x3f')]=qs['filters'](_['pick'](_0x12819d[_0x8de5('0x40')],_0x3e3aa8[_0x8de5('0xd0')]));if(_0x12819d[_0x8de5('0x40')][_0x8de5('0x27')]){_0x3b6e74[_0x8de5('0x3f')]=_[_0x8de5('0xd1')](_0x3b6e74[_0x8de5('0x3f')],{'$or':_[_0x8de5('0x34')](_0x3b6e74['attributes'],function(_0x6838f8){var _0x7e3d84={};_0x7e3d84[_0x6838f8]={'$like':'%'+_0x12819d[_0x8de5('0x40')][_0x8de5('0x27')]+'%'};return _0x7e3d84;})});}_0x3b6e74=_[_0x8de5('0xd1')]({},_0x3b6e74,_0x12819d[_0x8de5('0x54')]);return _0x19e7b3[_0x8de5('0x103')](_0x3b6e74);}})[_0x8de5('0x23')](function(_0xea101a){if(_0xea101a){_0xa4e1c5=_0xea101a[_0x8de5('0x49')];if(!_0x12819d[_0x8de5('0x40')][_0x8de5('0xc4')](_0x8de5('0xd3'))){_0x3b6e74[_0x8de5('0x1b')]=qs['limit'](_0x12819d[_0x8de5('0x40')][_0x8de5('0x1b')]);_0x3b6e74[_0x8de5('0x19')]=qs['offset'](_0x12819d[_0x8de5('0x40')][_0x8de5('0x19')]);}return _0x19e7b3[_0x8de5('0x103')](_0x3b6e74);}})['then'](function(_0x4737de){if(_0x4737de){return _0x4737de?{'count':_0xa4e1c5,'rows':_0x4737de}:null;}})['then'](respondWithResult(_0x4e9f5b,null))['catch'](handleError(_0x4e9f5b,null));};exports[_0x8de5('0x104')]=function(_0x3e8e97,_0x391c63){var _0x4c687e=_0x3e8e97[_0x8de5('0x51')]['id'];var _0xeddd5=_0x3e8e97[_0x8de5('0x57')]?_0x3e8e97[_0x8de5('0x57')][_0x8de5('0x5c')]:null;var _0x2a5ada=[];return Promise['resolve']()['then'](function(){if(!_0xeddd5)throw new APIBadRequestError('Body\x20parameter\x20\x27ids\x27\x20is\x20required');})[_0x8de5('0x23')](function(){return db[_0x8de5('0x32')]['findOne']({'where':{'id':_0x4c687e}});})['then'](function(_0x152f4b){if(!_0x152f4b)throw new APINotFoundError(util[_0x8de5('0xc2')](_0x8de5('0xc3'),_0x3e8e97[_0x8de5('0x51')]['id']));return db[_0x8de5('0x64')][_0x8de5('0x105')](function(_0x2b3dc4){return _0x152f4b[_0x8de5('0x104')](_0xeddd5,{'transaction':_0x2b3dc4})[_0x8de5('0x23')](function(){return db[_0x8de5('0x106')]['findAll']({'where':{'id':{'$in':_0xeddd5}}});})['then'](function(_0x2ebaa5){var _0x6da83f=_[_0x8de5('0x34')](_0x2ebaa5,function(_0xdc5b9){return _0xdc5b9[_0x8de5('0x107')]();});return Promise[_0x8de5('0x56')](_0x6da83f);})[_0x8de5('0x23')](function(_0x222ac7){_0x2a5ada=_[_0x8de5('0x108')](_0x222ac7);var _0x1a4fb9=_[_0x8de5('0x34')](_0x2a5ada,function(_0xcc79ab){return _0xcc79ab['addAgent'](_0x152f4b['id'],{'transaction':_0x2b3dc4});});return Promise[_0x8de5('0x56')](_0x1a4fb9);})['then'](function(){if(!_0x152f4b[_0x8de5('0x98')])return;var _0x24e9bc=_[_0x8de5('0x27')](_0x2a5ada,function(_0x211ecc){return _0x211ecc[_0x8de5('0x109')](_0x8de5('0xaa'))===_0x8de5('0x10a');});var _0xa1b769=_[_0x8de5('0x34')](_0x24e9bc,function(_0x7e0e40){return db['UserVoiceQueueRt'][_0x8de5('0x10b')]({'membername':_0x152f4b[_0x8de5('0x2c')],'UserId':_0x152f4b['id'],'queue_name':_0x7e0e40[_0x8de5('0x2c')],'VoiceQueueId':_0x7e0e40['id'],'interface':_[_0x8de5('0x62')](_0x152f4b[_0x8de5('0x9a')])?util[_0x8de5('0xc2')](_0x8de5('0xa7'),_0x152f4b[_0x8de5('0x2c')]):_0x152f4b['interface'],'paused':_0x152f4b['voicePause']||![],'penalty':_0x152f4b[_0x8de5('0xa1')]},{'transaction':_0x2b3dc4});});return Promise[_0x8de5('0x56')](_0xa1b769);})[_0x8de5('0x23')](function(){return db[_0x8de5('0x10c')][_0x8de5('0x46')]({'where':{'teamId':{'$in':_0xeddd5}}});})[_0x8de5('0x23')](function(_0x205897){var _0xce8c45=_[_0x8de5('0x34')](_0x205897,function(_0xb498ac){return db[_0x8de5('0x10d')][_0x8de5('0x77')]({'UserId':_0x152f4b['id'],'VoicePrefixId':_0xb498ac[_0x8de5('0x10e')]},{'transaction':_0x2b3dc4});});return Promise['all'](_0xce8c45);});});})[_0x8de5('0x23')](function(){for(var _0x51cddf=0x0;_0x51cddf<_0x2a5ada[_0x8de5('0x49')];_0x51cddf++){var _0x27a2a0=_0x2a5ada[_0x51cddf][_0x8de5('0x109')]('channel');var _0x40d3a9=_0x27a2a0+_0x8de5('0xa3');socket[_0x8de5('0xad')](_0x8de5('0x25')+_0x27a2a0+'Queue:save',{'UserId':_0x4c687e,['queueField']:_0x2a5ada[_0x51cddf]['id']});}})[_0x8de5('0x23')](respondWithStatusCode(_0x391c63,null))['catch'](APIHandleError(_0x391c63));};exports[_0x8de5('0x10f')]=function(_0x2090dd,_0x1da368){var _0x6d567c=_0x2090dd[_0x8de5('0x51')]['id'];var _0x4fc705=null;if(_0x2090dd[_0x8de5('0x40')][_0x8de5('0x5c')]){_0x4fc705=_[_0x8de5('0xac')](_0x2090dd[_0x8de5('0x40')]['ids'])?_0x2090dd[_0x8de5('0x40')]['ids']:[_0x2090dd[_0x8de5('0x40')][_0x8de5('0x5c')]];}var _0x5e86ea=[];return Promise[_0x8de5('0xf7')]()[_0x8de5('0x23')](function(){if(!_0x4fc705)throw new APIBadRequestError('Query\x20parameter\x20\x27ids\x27\x20is\x20required');})[_0x8de5('0x23')](function(){return db['User'][_0x8de5('0x91')]({'where':{'id':_0x6d567c}});})[_0x8de5('0x23')](function(_0x21b433){if(!_0x21b433)throw new APINotFoundError(util['format'](_0x8de5('0xc3'),_0x2090dd[_0x8de5('0x51')]['id']));return db[_0x8de5('0x64')][_0x8de5('0x105')](function(_0x59a603){return _0x21b433[_0x8de5('0x10f')](_0x4fc705,{'transaction':_0x59a603})[_0x8de5('0x23')](function(){return db['Team']['findAll']({'where':{'id':{'$in':_0x4fc705}}});})[_0x8de5('0x23')](function(_0x55cab8){var _0x4a5d8b=_[_0x8de5('0x34')](_0x55cab8,function(_0x2ddc43){return _0x2ddc43[_0x8de5('0x107')]();});return Promise[_0x8de5('0x56')](_0x4a5d8b);})[_0x8de5('0x23')](function(_0x1854f3){_0x5e86ea=_[_0x8de5('0x108')](_0x1854f3);var _0x26a2bf=_[_0x8de5('0x34')](_0x5e86ea,function(_0x1ef312){return _0x1ef312[_0x8de5('0x110')](_0x21b433['id'],{'transaction':_0x59a603});});return Promise[_0x8de5('0x56')](_0x26a2bf);})[_0x8de5('0x23')](function(){if(!_0x21b433[_0x8de5('0x98')])return;var _0x10d8c9=_[_0x8de5('0x27')](_0x5e86ea,function(_0xe922c3){return _0xe922c3[_0x8de5('0x109')]('channel')===_0x8de5('0x10a');});var _0x2b7957=_[_0x8de5('0x34')](_0x10d8c9,function(_0x192008){return db[_0x8de5('0xa9')][_0x8de5('0x2e')]({'where':{'VoiceQueueId':_0x192008['id'],'UserId':_0x21b433['id']},'transaction':_0x59a603});});return Promise[_0x8de5('0x56')](_0x2b7957);})[_0x8de5('0x23')](function(){return db[_0x8de5('0x10c')][_0x8de5('0x46')]({'where':{'teamId':{'$in':_0x4fc705}}});})[_0x8de5('0x23')](function(_0x17d3bb){var _0x4e42f4=_[_0x8de5('0x34')](_0x17d3bb,function(_0x343b11){return db[_0x8de5('0x10d')][_0x8de5('0x2e')]({'where':{'UserId':_0x21b433['id'],'VoicePrefixId':_0x343b11[_0x8de5('0x10e')]}},{'transaction':_0x59a603});});return Promise[_0x8de5('0x56')](_0x4e42f4);});});})['then'](function(){for(var _0x29162f=0x0;_0x29162f<_0x5e86ea[_0x8de5('0x49')];_0x29162f++){var _0x4b53e7=_0x5e86ea[_0x29162f][_0x8de5('0x109')]('channel');var _0x227a68=_0x4b53e7+_0x8de5('0xa3');socket[_0x8de5('0xad')](_0x8de5('0x25')+_0x4b53e7+'Queue:remove',{'UserId':_0x6d567c,['queueField']:_0x5e86ea[_0x29162f]['id']});}})[_0x8de5('0x23')](respondWithStatusCode(_0x1da368,null))[_0x8de5('0x58')](APIHandleError(_0x1da368));};exports[_0x8de5('0x111')]=function(_0x1a727c,_0x2bcbd6){var _0x40dc9d={};var _0x1a957f={};var _0x2645fd;var _0x3ea541;return db[_0x8de5('0x32')][_0x8de5('0x91')]({'where':{'id':_0x1a727c[_0x8de5('0x51')]['id']}})[_0x8de5('0x23')](handleEntityNotFound(_0x2bcbd6,null))[_0x8de5('0x23')](function(_0x27ca72){if(_0x27ca72){_0x2645fd=_0x27ca72;_0x1a957f['model']=_[_0x8de5('0xd5')](db[_0x8de5('0xc5')][_0x8de5('0x33')]);_0x1a957f[_0x8de5('0x40')]=_[_0x8de5('0xd5')](_0x1a727c[_0x8de5('0x40')]);_0x1a957f[_0x8de5('0xd0')]=_[_0x8de5('0xcc')](_0x1a957f[_0x8de5('0xcb')],_0x1a957f[_0x8de5('0x40')]);_0x40dc9d[_0x8de5('0x44')]=_['intersection'](_0x1a957f[_0x8de5('0xcb')],qs[_0x8de5('0xcd')](_0x1a727c[_0x8de5('0x40')][_0x8de5('0xcd')]));_0x40dc9d[_0x8de5('0x44')]=_0x40dc9d['attributes'][_0x8de5('0x49')]?_0x40dc9d[_0x8de5('0x44')]:_0x1a957f['model'];_0x40dc9d[_0x8de5('0xce')]=qs['sort'](_0x1a727c['query'][_0x8de5('0xcf')]);_0x40dc9d[_0x8de5('0x3f')]=qs['filters'](_[_0x8de5('0xd9')](_0x1a727c[_0x8de5('0x40')],_0x1a957f['filters']));if(_0x1a727c[_0x8de5('0x40')]['filter']){_0x40dc9d[_0x8de5('0x3f')]=_[_0x8de5('0xd1')](_0x40dc9d[_0x8de5('0x3f')],{'$or':_[_0x8de5('0x34')](_0x40dc9d[_0x8de5('0x44')],function(_0x32eda5){var _0x5cf8eb={};_0x5cf8eb[_0x32eda5]={'$like':'%'+_0x1a727c[_0x8de5('0x40')][_0x8de5('0x27')]+'%'};return _0x5cf8eb;})});}_0x40dc9d=_[_0x8de5('0xd1')]({},_0x40dc9d,_0x1a727c['options']);return _0x2645fd[_0x8de5('0x111')](_0x40dc9d);}})[_0x8de5('0x23')](function(_0x19c2b5){if(_0x19c2b5){_0x3ea541=_0x19c2b5[_0x8de5('0x49')];if(!_0x1a727c[_0x8de5('0x40')][_0x8de5('0xc4')]('nolimit')){_0x40dc9d[_0x8de5('0x1b')]=qs[_0x8de5('0x1b')](_0x1a727c[_0x8de5('0x40')][_0x8de5('0x1b')]);_0x40dc9d[_0x8de5('0x19')]=qs[_0x8de5('0x19')](_0x1a727c['query'][_0x8de5('0x19')]);}return _0x2645fd[_0x8de5('0x111')](_0x40dc9d);}})['then'](function(_0x1e9a80){if(_0x1e9a80){return _0x1e9a80?{'count':_0x3ea541,'rows':_0x1e9a80}:null;}})['then'](respondWithResult(_0x2bcbd6,null))[_0x8de5('0x58')](handleError(_0x2bcbd6,null));};exports['getAgents']=function(_0x566465,_0x37da35){var _0x9c79a2={};var _0x2593df={};var _0x32460e;return db[_0x8de5('0x32')][_0x8de5('0x91')]({'where':{'id':_0x566465[_0x8de5('0x51')]['id']}})[_0x8de5('0x23')](handleEntityNotFound(_0x37da35,null))[_0x8de5('0x23')](function(_0x3bded3){if(_0x3bded3){_0x32460e=_0x3bded3;_0x2593df[_0x8de5('0xcb')]=_['keys'](db[_0x8de5('0x32')][_0x8de5('0x33')]);_0x2593df[_0x8de5('0x40')]=_[_0x8de5('0xd5')](_0x566465['query']);_0x2593df[_0x8de5('0xd0')]=_[_0x8de5('0xcc')](_0x2593df[_0x8de5('0xcb')],_0x2593df[_0x8de5('0x40')]);_0x9c79a2[_0x8de5('0x44')]=_[_0x8de5('0xcc')](_0x2593df[_0x8de5('0xcb')],qs[_0x8de5('0xcd')](_0x566465[_0x8de5('0x40')][_0x8de5('0xcd')]));_0x9c79a2[_0x8de5('0x44')]=_0x9c79a2[_0x8de5('0x44')][_0x8de5('0x49')]?_0x9c79a2[_0x8de5('0x44')]:_0x2593df[_0x8de5('0xcb')];_0x9c79a2[_0x8de5('0xce')]=qs[_0x8de5('0xcf')](_0x566465['query'][_0x8de5('0xcf')]);_0x9c79a2['where']=qs['filters'](_[_0x8de5('0xd9')](_0x566465[_0x8de5('0x40')],_0x2593df[_0x8de5('0xd0')]));if(_0x566465[_0x8de5('0x40')][_0x8de5('0x27')]){_0x9c79a2['where']=_[_0x8de5('0xd1')](_0x9c79a2[_0x8de5('0x3f')],{'$or':_[_0x8de5('0x34')](_0x9c79a2['attributes'],function(_0x95c71f){var _0x396c6a={};_0x396c6a[_0x95c71f]={'$like':'%'+_0x566465[_0x8de5('0x40')]['filter']+'%'};return _0x396c6a;})});}_0x9c79a2[_0x8de5('0xcb')]=db[_0x8de5('0x32')];_0x9c79a2['as']='Agents';_0x9c79a2=_[_0x8de5('0xd1')]({},_0x9c79a2,_0x566465[_0x8de5('0x54')]);return _0x32460e[_0x8de5('0xee')]({'include':[_0x9c79a2]});}})['then'](function(_0x2ba96d){if(_0x2ba96d){var _0x521e51={},_0x140d01=[];for(var _0x3ed78e=0x0;_0x3ed78e<_0x2ba96d[_0x8de5('0x49')];_0x3ed78e+=0x1){for(var _0x1b9e60=0x0,_0x59776a;_0x1b9e60<_0x2ba96d[_0x3ed78e][_0x8de5('0x7d')][_0x8de5('0x49')];_0x1b9e60+=0x1){_0x59776a=_0x2ba96d[_0x3ed78e][_0x8de5('0x7d')][_0x1b9e60]['get']({'plain':!![]});_0x521e51[_0x59776a['id']]=_0x59776a;}}_0x521e51=_[_0x8de5('0x112')](_0x521e51);for(var _0x25f12e=qs['offset'](_0x566465['query'][_0x8de5('0x19')]);_0x25f12e<_0x521e51[_0x8de5('0x49')]&&_0x140d01[_0x8de5('0x49')]=_0x40d9ea){_0x52a400=_0x40d9ea;_0x1507a9=0xc8;}else{_0x1507a9=0xce;}_0x4e1001[_0xb3c8('0x17')](_0x1507a9);return _0x4e1001['set'](_0xb3c8('0x18'),_0x11ee1f+'-'+_0x52a400+'/'+_0x40d9ea)['json'](_0x28fedc);}return null;};}function saveUpdates(_0x380967){return function(_0x29f688){if(_0x29f688){return _0x29f688[_0xb3c8('0x19')](_0x380967)['then'](function(_0x1c7955){if(_0x1c7955[_0xb3c8('0x1a')]===_0xb3c8('0x1b')){socket[_0xb3c8('0x1c')]('userNotification:recalc:'+_0x1c7955['id'],_0x1c7955);}return _0x1c7955;});}return null;};}function removeEntity(_0x347f3f){return function(_0x1a0bcf){if(_0x1a0bcf){return _0x1a0bcf['destroy']()[_0xb3c8('0x1d')](function(){var _0x421ea5=_0x1a0bcf[_0xb3c8('0x1e')]({'plain':!![]});if(_0x421ea5[_0xb3c8('0x1a')]===_0xb3c8('0x1f'))return;var _0x2dfa93=[{'name':_0xb3c8('0x20'),'value':_0xb3c8('0x21'),'ignore':!![]},{'name':_0xb3c8('0x22'),'value':_0xb3c8('0x1b'),'ignore':![]},{'name':'Telephones','value':'telephone','ignore':![]}];var _0x3d182c=_(_0x2dfa93)[_0xb3c8('0x23')]('ignore')['map']('value')[_0xb3c8('0x24')]();if(_['includes'](_0x3d182c,_0x421ea5[_0xb3c8('0x1a')])){return;}var _0x4d62b3=_[_0xb3c8('0x25')](_0x2dfa93,[_0xb3c8('0x24'),_0x421ea5[_0xb3c8('0x1a')]])[_0xb3c8('0x26')];return db[_0xb3c8('0x27')][_0xb3c8('0x28')]({'where':{'type':_0x4d62b3,'resourceId':_0x421ea5['id']}})[_0xb3c8('0x1d')](function(){return _0x1a0bcf;});})['then'](function(){_0x347f3f[_0xb3c8('0x17')](0xcc)[_0xb3c8('0x29')]();});}};}function handleEntityNotFound(_0x3c58a9){return function(_0x475801){if(!_0x475801){_0x3c58a9[_0xb3c8('0x2a')](0x194);}return _0x475801;};}function handleError(_0x21534a,_0x498b80){_0x498b80=_0x498b80||0x1f4;return function(_0x249e00){logger[_0xb3c8('0x2b')](_0x249e00[_0xb3c8('0x2c')]);if(_0x249e00['name']){delete _0x249e00[_0xb3c8('0x26')];}_0x21534a[_0xb3c8('0x17')](_0x498b80)[_0xb3c8('0x2d')](_0x249e00);};}function getUserAttributes(){return _(db[_0xb3c8('0x2e')][_0xb3c8('0x2f')])[_0xb3c8('0x30')](function(_0x548518){return{'name':_0x548518[_0xb3c8('0x31')],'type':_0x548518[_0xb3c8('0x32')]['key']};})['filter'](function(_0x25376e){return!['password',_0xb3c8('0x33'),_0xb3c8('0x34'),_0xb3c8('0x35'),_0xb3c8('0x36'),_0xb3c8('0x37')]['includes'](_0x25376e[_0xb3c8('0x26')]);})['value']();}exports[_0xb3c8('0x38')]=function(_0x4f8769,_0x5ccbf8){var _0x240e8f={},_0x2a99fe={'count':0x0,'rows':[]};var _0x297b3b=getUserAttributes();_0x240e8f=qs[_0xb3c8('0x39')](_0x297b3b,_0x4f8769);var _0x4c274e={'where':_0x240e8f[_0xb3c8('0x3a')]};return db[_0xb3c8('0x2e')]['count'](_0x4c274e)[_0xb3c8('0x1d')](function(_0x5a20de){_0x2a99fe['count']=_0x5a20de;if(_0x4f8769['query']['includeAll']){_0x240e8f['include']=[{'all':!![]}];}if(_0x4f8769[_0xb3c8('0x3b')][_0xb3c8('0x3c')]==='true'){_0x240e8f['include']=[{'model':db[_0xb3c8('0x3d')],'as':_0xb3c8('0x3c')}];}if(!_['includes'](_0x240e8f[_0xb3c8('0x3e')],'id')){_0x240e8f[_0xb3c8('0x3e')][_0xb3c8('0x3f')]('id');}return db[_0xb3c8('0x2e')]['findAll'](_0x240e8f);})[_0xb3c8('0x1d')](function(_0x1fc17c){_0x2a99fe[_0xb3c8('0x40')]=_0x1fc17c;if(_0x4f8769['query'][_0xb3c8('0x41')]==='true'){var _0x1298c3=[];for(var _0x10880a=0x0;_0x10880a<_0x2a99fe[_0xb3c8('0x40')][_0xb3c8('0x42')];_0x10880a++){_0x1298c3[_0xb3c8('0x3f')](get_open_tabs(_0xb3c8('0x43'),_0x2a99fe[_0xb3c8('0x40')][_0x10880a]['dataValues']));_0x1298c3[_0xb3c8('0x3f')](get_open_tabs(_0xb3c8('0x44'),_0x2a99fe['rows'][_0x10880a]['dataValues']));_0x1298c3[_0xb3c8('0x3f')](get_open_tabs(_0xb3c8('0x45'),_0x2a99fe[_0xb3c8('0x40')][_0x10880a][_0xb3c8('0x46')]));_0x1298c3[_0xb3c8('0x3f')](get_open_tabs(_0xb3c8('0x47'),_0x2a99fe[_0xb3c8('0x40')][_0x10880a]['dataValues']));_0x1298c3[_0xb3c8('0x3f')](get_open_tabs(_0xb3c8('0x48'),_0x2a99fe['rows'][_0x10880a][_0xb3c8('0x46')]));_0x1298c3[_0xb3c8('0x3f')](get_open_tabs(_0xb3c8('0x49'),_0x2a99fe[_0xb3c8('0x40')][_0x10880a][_0xb3c8('0x46')]));}return Promise[_0xb3c8('0x4a')](_0x1298c3)[_0xb3c8('0x1d')](function(){return _0x2a99fe;});}else{return _0x2a99fe;}})[_0xb3c8('0x1d')](respondWithFilteredResult(_0x5ccbf8,_0x240e8f))[_0xb3c8('0x4b')](handleError(_0x5ccbf8,null));};exports['show']=function(_0x8da1e0,_0x4b88a4){var _0xa7a12d=getUserAttributes();_0x8da1e0[_0xb3c8('0x3b')]['id']=_0x8da1e0[_0xb3c8('0x4c')]['id'];var _0x1a20f5=qs[_0xb3c8('0x39')](_0xa7a12d,_0x8da1e0);if(_0x8da1e0[_0xb3c8('0x3b')][_0xb3c8('0x4d')]){_0x1a20f5[_0xb3c8('0x4e')]=[{'all':!![]}];}if(_0x8da1e0[_0xb3c8('0x3b')][_0xb3c8('0x3c')]===_0xb3c8('0x4f')){_0x1a20f5[_0xb3c8('0x4e')]=[{'model':db[_0xb3c8('0x3d')],'as':'userSetting'}];}_0x1a20f5=_[_0xb3c8('0x50')]({},_0x1a20f5,_0x8da1e0[_0xb3c8('0x51')]);if(!_[_0xb3c8('0x52')](_0x1a20f5[_0xb3c8('0x3e')],'id')){_0x1a20f5[_0xb3c8('0x3e')]['push']('id');}return db[_0xb3c8('0x2e')][_0xb3c8('0x25')](_0x1a20f5)[_0xb3c8('0x1d')](handleEntityNotFound(_0x4b88a4,null))[_0xb3c8('0x1d')](function(_0x270941){var _0x461db8=[];values=_0x270941;if(_0x8da1e0[_0xb3c8('0x3b')][_0xb3c8('0x41')]===_0xb3c8('0x4f')){_0x461db8[_0xb3c8('0x3f')](get_open_tabs(_0xb3c8('0x43'),_0x270941['dataValues']));_0x461db8['push'](get_open_tabs(_0xb3c8('0x44'),_0x270941[_0xb3c8('0x46')]));_0x461db8[_0xb3c8('0x3f')](get_open_tabs('openchannel',_0x270941[_0xb3c8('0x46')]));_0x461db8[_0xb3c8('0x3f')](get_open_tabs(_0xb3c8('0x49'),_0x270941[_0xb3c8('0x46')]));_0x461db8['push'](get_open_tabs('fax',_0x270941[_0xb3c8('0x46')]));_0x461db8[_0xb3c8('0x3f')](get_open_tabs(_0xb3c8('0x47'),_0x270941['dataValues']));return Promise[_0xb3c8('0x4a')](_0x461db8);}else{return values;}})[_0xb3c8('0x1d')](function(){return values;})[_0xb3c8('0x1d')](respondWithResult(_0x4b88a4,null))[_0xb3c8('0x4b')](handleError(_0x4b88a4,null));};exports[_0xb3c8('0x19')]=function(_0x1696f3,_0x335605){if(_0x1696f3['body']['id']){delete _0x1696f3['body']['id'];}delete _0x1696f3[_0xb3c8('0x53')][_0xb3c8('0x1a')];return db[_0xb3c8('0x2e')]['find']({'where':{'id':_0x1696f3[_0xb3c8('0x4c')]['id']}})[_0xb3c8('0x1d')](handleEntityNotFound(_0x335605,null))[_0xb3c8('0x1d')](saveUpdates(_0x1696f3[_0xb3c8('0x53')],null))['then'](respondWithResult(_0x335605,null))['catch'](handleError(_0x335605,null));};exports[_0xb3c8('0x54')]=function(_0x5630f5,_0x25bf5e){return db[_0xb3c8('0x2e')][_0xb3c8('0x54')]()[_0xb3c8('0x1d')](respondWithResult(_0x25bf5e,null))[_0xb3c8('0x4b')](handleError(_0x25bf5e,null));};exports[_0xb3c8('0x55')]=function(_0x493ff7,_0x37a5db){return db[_0xb3c8('0x2e')]['find']({'where':{'id':_0x493ff7['params']['id']}})[_0xb3c8('0x1d')](handleEntityNotFound(_0x37a5db,null))[_0xb3c8('0x1d')](function(_0x14d601){if(_0x14d601){return _0x14d601[_0xb3c8('0x55')](_0x493ff7['body'][_0xb3c8('0x56')],_[_0xb3c8('0x57')](_0x493ff7[_0xb3c8('0x53')],[_0xb3c8('0x56'),'id'])||{});}})[_0xb3c8('0x1d')](respondWithResult(_0x37a5db,null))[_0xb3c8('0x4b')](handleError(_0x37a5db,null));};function validateUser(_0x21c5b1){return new Promise(function(_0x5a4179,_0x28600a){if(_0x21c5b1[_0xb3c8('0x58')])return _0x5a4179(_0x21c5b1);return db['Setting'][_0xb3c8('0x59')](0x1)['then'](function(_0x33a62c){if(_0x33a62c[_0xb3c8('0x5a')])authService[_0xb3c8('0x5b')](_0x21c5b1[_0xb3c8('0x5c')]);db[_0xb3c8('0x2e')][_0xb3c8('0x5d')]('internal')[_0xb3c8('0x1d')](function(_0x4e1faa){if(_[_0xb3c8('0x5e')](_0x4e1faa)){_0x21c5b1[_0xb3c8('0x58')]=_0x33a62c[_0xb3c8('0x5f')]||0x1;return;}if(_[_0xb3c8('0x5e')](_0x33a62c[_0xb3c8('0x5f')])||_0x33a62c['min_internal']===_0x4e1faa){_0x21c5b1[_0xb3c8('0x58')]=_0x4e1faa+0x1;return;}if(_0x33a62c[_0xb3c8('0x5f')]>_0x4e1faa){_0x21c5b1[_0xb3c8('0x58')]=_0x33a62c[_0xb3c8('0x5f')];return;}return db[_0xb3c8('0x60')][_0xb3c8('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[_0xb3c8('0x60')]['QueryTypes'][_0xb3c8('0x61')]})[_0xb3c8('0x1d')](function(_0x56c3d6){if(_0x56c3d6&&_0x56c3d6[_0xb3c8('0x42')]){for(var _0x11949b=0x0,_0x13af4a=_0x56c3d6[_0xb3c8('0x42')];_0x11949b<_0x13af4a&&_[_0xb3c8('0x5e')](_0x21c5b1[_0xb3c8('0x58')]);_0x11949b++){if(_0x33a62c[_0xb3c8('0x5f')]<=_0x56c3d6[_0x11949b]['from']){_0x21c5b1[_0xb3c8('0x58')]=_0x56c3d6[_0x11949b]['from'];}else if(_0x33a62c['min_internal']>_0x56c3d6[_0x11949b][_0xb3c8('0x62')]&&_0x33a62c[_0xb3c8('0x5f')]<=_0x56c3d6[_0x11949b]['to']){_0x21c5b1[_0xb3c8('0x58')]=_0x33a62c['min_internal'];}}}if(_[_0xb3c8('0x5e')](_0x21c5b1['internal'])){_0x21c5b1[_0xb3c8('0x58')]=_0x4e1faa+0x1;}return _0x5a4179(_0x21c5b1);});});})['catch'](function(_0x3f223b){_0x28600a(_0x3f223b);});});}function updateUser(_0x5e9d88){return new Promise(function(_0x363ab8,_0x476f08){try{if(_0x5e9d88['voicemail']){_0x5e9d88[_0xb3c8('0x63')]=_0x5e9d88['internal'];_0x5e9d88[_0xb3c8('0x64')]={'mailbox':_0x5e9d88[_0xb3c8('0x58')],'password':_0x5e9d88[_0xb3c8('0x5c')],'fullname':_0x5e9d88['fullname'],'email':_0x5e9d88['email']};}if(_0x5e9d88['role']===_0xb3c8('0x1b')){if(!_0x5e9d88[_0xb3c8('0x65')])_0x5e9d88[_0xb3c8('0x65')]=['101',_0xb3c8('0x66'),'103',_0xb3c8('0x67'),'110','104','105','106',_0xb3c8('0x68'),_0xb3c8('0x69'),_0xb3c8('0x6a'),'100',_0xb3c8('0x6b'),_0xb3c8('0x6c'),_0xb3c8('0x6d')];}_0x363ab8(_0x5e9d88);}catch(_0x786ddc){_0x476f08(_0x786ddc);}});}exports[_0xb3c8('0x6e')]=function(_0x150d11,_0xef5808){if(_0x150d11[_0xb3c8('0x21')][_0xb3c8('0x1a')]===_0xb3c8('0x1b'))throw new Error(_0xb3c8('0x6f'));if(_0x150d11[_0xb3c8('0x53')]['role']===_0xb3c8('0x21')&&_0x150d11['user'][_0xb3c8('0x1a')]!==_0xb3c8('0x1f')){throw new Error(_0xb3c8('0x70'));}if(_0x150d11[_0xb3c8('0x53')][_0xb3c8('0x1a')]===_0xb3c8('0x1f')&&_0x150d11[_0xb3c8('0x21')]['role']!==_0xb3c8('0x1f')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator');}return licenseUtil[_0xb3c8('0x71')]([_0x150d11['body']])[_0xb3c8('0x1d')](function(){return validateUser(_0x150d11['body']);})[_0xb3c8('0x1d')](function(_0x4798c6){return updateUser(_0x4798c6)[_0xb3c8('0x1d')](function(_0x5f55bf){if(_0x5f55bf[_0xb3c8('0x1a')]===_0xb3c8('0x1f')){_0x5f55bf[_0xb3c8('0x72')]=_0x150d11[_0xb3c8('0x21')][_0xb3c8('0x72')];delete _0x5f55bf[_0xb3c8('0x73')];}return _0x5f55bf;});})[_0xb3c8('0x1d')](function(_0x2cfcbc){return db['User']['create'](_0x2cfcbc,{'include':[{'model':db[_0xb3c8('0x64')],'as':_0xb3c8('0x64')}]});})[_0xb3c8('0x1d')](function(_0x49c515){if(_0x150d11[_0xb3c8('0x53')]['role']==='user')return _0x49c515;if(_0x150d11[_0xb3c8('0x21')][_0xb3c8('0x1a')]!==_0xb3c8('0x21'))return _0x49c515;return db[_0xb3c8('0x74')][_0xb3c8('0x25')]({'where':{'name':_0x49c515[_0xb3c8('0x1a')]==='agent'?_0xb3c8('0x22'):_0xb3c8('0x75'),'userProfileId':_0x150d11[_0xb3c8('0x21')][_0xb3c8('0x73')]},'raw':!![]})[_0xb3c8('0x1d')](function(_0x26a43e){if(!_0x26a43e||_0x26a43e[_0xb3c8('0x76')]!=0x0)return _0x49c515;return db['UserProfileResource']['create']({'name':_0x49c515[_0xb3c8('0x26')],'resourceId':_0x49c515['id'],'type':_0x26a43e['name'],'sectionId':_0x26a43e['id']},{})['then'](function(){return _0x49c515;});})['catch'](function(_0x2b642d){logger[_0xb3c8('0x2b')](_0xb3c8('0x77'),_0x2b642d);throw _0x2b642d;});})[_0xb3c8('0x1d')](respondWithResult(_0xef5808,0xc9))[_0xb3c8('0x4b')](handleError(_0xef5808,null));};exports[_0xb3c8('0x78')]=function(_0x54c9f2,_0x5d2db2){var _0x2c90db=_0x54c9f2[_0xb3c8('0x53')];var _0x2a77c2=[];if(_0x54c9f2[_0xb3c8('0x21')]['role']===_0xb3c8('0x1b'))throw new Error('Unauthorized');if(_[_0xb3c8('0x79')](_0x2c90db,[_0xb3c8('0x1a'),_0xb3c8('0x21')])&&_0x54c9f2[_0xb3c8('0x21')][_0xb3c8('0x1a')]!=='admin'){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_['some'](_0x2c90db,[_0xb3c8('0x1a'),_0xb3c8('0x1f')])&&_0x54c9f2['user'][_0xb3c8('0x1a')]!=='admin'){throw new Error(_0xb3c8('0x7a'));}return licenseUtil[_0xb3c8('0x71')](_0x2c90db)[_0xb3c8('0x1d')](function(){return validateUser(_0x2c90db[0x0]);})[_0xb3c8('0x1d')](function(){for(var _0xfff47d=0x1;_0xfff47d<_0x2c90db[_0xb3c8('0x42')];_0xfff47d++){var _0x445fa3=_0x2c90db[_0xfff47d-0x1]['internal'];if(!_0x2c90db[_0xfff47d][_0xb3c8('0x58')])_0x2c90db[_0xfff47d][_0xb3c8('0x58')]=_0x445fa3+0x1;_0x2a77c2['push'](validateUser(_0x2c90db[_0xfff47d]));}return Promise['all'](_0x2a77c2);})['then'](function(){_0x2a77c2=[];for(var _0x1afee9=0x0;_0x1afee9<_0x2c90db[_0xb3c8('0x42')];_0x1afee9++){_0x2a77c2[_0xb3c8('0x3f')](updateUser(_0x2c90db[_0x1afee9]));}return Promise[_0xb3c8('0x4a')](_0x2a77c2);})[_0xb3c8('0x1d')](function(){_0x2a77c2=_0x2c90db['map'](function(_0x40119d){return db[_0xb3c8('0x2e')][_0xb3c8('0x6e')](_0x40119d,{'include':[{'model':db[_0xb3c8('0x64')],'as':'VoiceMail'}]})[_0xb3c8('0x1d')](function(_0xa40702){_0x40119d['id']=_0xa40702['id'];return _0x40119d;});});return Promise['all'](_0x2a77c2);})[_0xb3c8('0x1d')](function(_0x347930){if(_0x54c9f2[_0xb3c8('0x53')][_0xb3c8('0x1a')]===_0xb3c8('0x21'))return _0x347930;if(_0x54c9f2[_0xb3c8('0x21')][_0xb3c8('0x1a')]!==_0xb3c8('0x21'))return _0x347930;var _0x4fbf01=_[_0xb3c8('0x79')](_0x347930,function(_0x58472e){return _0x58472e[_0xb3c8('0x1a')]==='agent'||_0x58472e[_0xb3c8('0x1a')]===_0xb3c8('0x7b');});if(!_0x4fbf01)return _0x347930;return db['UserProfileSection'][_0xb3c8('0x7c')]({'where':{'name':{'$or':['Agents',_0xb3c8('0x75')]},'userProfileId':_0x54c9f2[_0xb3c8('0x21')][_0xb3c8('0x73')]},'raw':!![]})[_0xb3c8('0x1d')](function(_0x4f2134){if(_['isEmpty'](_0x4f2134)||!_[_0xb3c8('0x79')](_0x4f2134,[_0xb3c8('0x76'),0x0]))return _0x347930;_0x2a77c2=[];var _0x1a8d44=_(_0x4f2134)[_0xb3c8('0x30')](function(_0x40f097){if(_0x40f097[_0xb3c8('0x76')]===0x1)return;return _0x40f097[_0xb3c8('0x26')]===_0xb3c8('0x22')?_0xb3c8('0x1b'):_0xb3c8('0x7b');})[_0xb3c8('0x7d')]()['value']();for(var _0x4834fd=0x0;_0x4834fd<_0x347930[_0xb3c8('0x42')];_0x4834fd++){if(!_[_0xb3c8('0x52')](_0x1a8d44,_0x347930[_0x4834fd][_0xb3c8('0x1a')]))return;var _0x593003=_0x347930[_0x4834fd][_0xb3c8('0x1a')]==='agent'?'Agents':_0xb3c8('0x75');_0x2a77c2['push'](db[_0xb3c8('0x27')][_0xb3c8('0x6e')]({'name':_0x347930[_0x4834fd]['name'],'resourceId':_0x347930[_0x4834fd]['id'],'type':_0x593003,'sectionId':_[_0xb3c8('0x25')](_0x4f2134,['name',_0x593003])['id']},{}));}return Promise['all'](_0x2a77c2);});})[_0xb3c8('0x1d')](respondWithResult(_0x5d2db2,0xc9))[_0xb3c8('0x4b')](handleError(_0x5d2db2,null));};exports[_0xb3c8('0x7e')]=function(_0x1a3247,_0x103422){if(_0x1a3247['body']['id']){delete _0x1a3247[_0xb3c8('0x53')]['id'];}return db[_0xb3c8('0x2e')][_0xb3c8('0x25')]({'where':{'id':_0x1a3247[_0xb3c8('0x4c')]['id']}})['then'](function(_0x2eb5a6){if(!_0x2eb5a6)return null;if(_0x2eb5a6['id']===_0x1a3247[_0xb3c8('0x21')]['id']){if(!_0x1a3247[_0xb3c8('0x53')][_0xb3c8('0x7f')]||!_0x1a3247[_0xb3c8('0x53')]['newPassword']){throw new db[(_0xb3c8('0x80'))]['ValidationError'](_0xb3c8('0x81'));}if(!_0x2eb5a6['authenticate'](_0x1a3247['body'][_0xb3c8('0x7f')])){throw new db[(_0xb3c8('0x80'))][(_0xb3c8('0x82'))](_0xb3c8('0x83'));}if(_0x1a3247[_0xb3c8('0x53')][_0xb3c8('0x7f')]===_0x1a3247[_0xb3c8('0x53')]['newPassword']){throw new db['Sequelize'][(_0xb3c8('0x82'))](_0xb3c8('0x84'));}}else if(_0x1a3247[_0xb3c8('0x21')][_0xb3c8('0x1a')]===_0xb3c8('0x1f')){if(!_0x1a3247[_0xb3c8('0x53')]['newPassword']){throw new db[(_0xb3c8('0x80'))][(_0xb3c8('0x82'))](_0xb3c8('0x85'));}}else if(_0x1a3247[_0xb3c8('0x21')]['role']===_0xb3c8('0x21')){if(!_0x1a3247[_0xb3c8('0x53')][_0xb3c8('0x86')]){throw new db['Sequelize'][(_0xb3c8('0x82'))](_0xb3c8('0x85'));}if(_0x2eb5a6[_0xb3c8('0x1a')]!==_0xb3c8('0x1b')){throw new db[(_0xb3c8('0x80'))][(_0xb3c8('0x82'))](_0xb3c8('0x6f'));}}else{throw new db[(_0xb3c8('0x80'))][(_0xb3c8('0x82'))](_0xb3c8('0x6f'));}return _0x2eb5a6;})[_0xb3c8('0x1d')](handleEntityNotFound(_0x103422,null))['then'](function(_0x1f3050){return db[_0xb3c8('0x87')][_0xb3c8('0x88')]({'attributes':['id',_0xb3c8('0x5a'),'enforcePasswordHistory',_0xb3c8('0x89')]})['then'](function(_0x173e7b){if(_0x173e7b['securePassword'])authService[_0xb3c8('0x5b')](_0x1a3247[_0xb3c8('0x53')][_0xb3c8('0x86')]);if(!_0x173e7b['enforcePasswordHistory']||!_0x1f3050[_0xb3c8('0x34')])return _0x1f3050;authService[_0xb3c8('0x8a')](_0x1a3247[_0xb3c8('0x53')]['newPassword'],_0x1f3050['previousPasswords'],_0x173e7b[_0xb3c8('0x89')]);return _0x1f3050;})['then'](saveUpdates({'password':_0x1a3247[_0xb3c8('0x53')][_0xb3c8('0x86')],'passwordResetAt':_0x1a3247[_0xb3c8('0x21')]['id']==_0x1a3247[_0xb3c8('0x4c')]['id']?moment():null,'previousPasswords':authService['updatePasswordsHistory'](_0x1a3247[_0xb3c8('0x53')]['newPassword'],_0x1f3050[_0xb3c8('0x34')])},null));})[_0xb3c8('0x1d')](respondWithResult(_0x103422,null))['catch'](handleError(_0x103422,null));};exports[_0xb3c8('0x8b')]=function(_0x27fbee,_0x4ee356){var _0x26b51a=_0x27fbee[_0xb3c8('0x53')]['channel'];return db[_0xb3c8('0x2e')][_0xb3c8('0x25')]({'where':{'id':_0x27fbee['params']['id']},'attributes':['id',_0xb3c8('0x26'),'role',_0xb3c8('0x8c'),_0xb3c8('0x8d'),'voicePause',_0xb3c8('0x8e')]})[_0xb3c8('0x1d')](handleEntityNotFound(_0x4ee356,null))[_0xb3c8('0x1d')](function(_0x5accec){if(_0x5accec){if(!utils['isValidChannel'](_0x26b51a)){throw new db[(_0xb3c8('0x80'))][(_0xb3c8('0x82'))](_0xb3c8('0x8f'));}return _0x5accec[_0xb3c8('0x90')+_[_0xb3c8('0x91')](_0x26b51a[_0xb3c8('0x92')]())+_0xb3c8('0x93')](_0x27fbee[_0xb3c8('0x53')][_0xb3c8('0x56')],{'penalty':_0x27fbee[_0xb3c8('0x53')][_0xb3c8('0x94')]||0x0})['spread'](function(_0x2d1e59){for(var _0x3e6b8f=0x0;_0x3e6b8f<_0x27fbee[_0xb3c8('0x53')]['ids']['length'];_0x3e6b8f+=0x1){var _0x4037c6={'UserId':Number(_0x27fbee['params']['id'])};_0x4037c6[_['capitalize'](_0x26b51a[_0xb3c8('0x92')]())+_0xb3c8('0x95')]=Number(_0x27fbee['body'][_0xb3c8('0x56')][_0x3e6b8f]);socket[_0xb3c8('0x1c')](_0xb3c8('0x21')+_[_0xb3c8('0x91')](_0x26b51a[_0xb3c8('0x92')]())+_0xb3c8('0x96'),_0x4037c6);}return _0x2d1e59;})[_0xb3c8('0x1d')](function(){if(_0x26b51a===_0xb3c8('0x97')){return db[_0xb3c8('0x98')][_0xb3c8('0x7c')]({'where':{'id':_0x27fbee[_0xb3c8('0x53')][_0xb3c8('0x56')]||[]},'raw':!![],'attributes':['id',_0xb3c8('0x26')]});}})['then'](function(_0x2ccd56){var _0x4abd2c=_0x5accec[_0xb3c8('0x1e')]({'plain':!![]});var _0x2db62f=[];if(_0x26b51a===_0xb3c8('0x97')&&_0x4abd2c[_0xb3c8('0x1a')]===_0xb3c8('0x1b')&&_0x4abd2c[_0xb3c8('0x8c')]){for(let _0x3c1a63=0x0;_0x3c1a63<_0x2ccd56[_0xb3c8('0x42')];_0x3c1a63+=0x1){_0x2db62f[_0xb3c8('0x3f')]({'membername':_0x4abd2c[_0xb3c8('0x26')],'UserId':_0x4abd2c['id'],'queue_name':_0x2ccd56[_0x3c1a63][_0xb3c8('0x26')],'VoiceQueueId':_0x2ccd56[_0x3c1a63]['id'],'interface':_[_0xb3c8('0x5e')](_0x4abd2c[_0xb3c8('0x8e')])?util[_0xb3c8('0x99')]('SIP/%s',_0x4abd2c[_0xb3c8('0x26')]):_0x4abd2c['interface'],'paused':_0x4abd2c[_0xb3c8('0x9a')]||![],'penalty':_0x27fbee[_0xb3c8('0x53')][_0xb3c8('0x94')]||0x0});}return Promise[_0xb3c8('0x4a')](_0x2db62f['map'](function(_0x3db61f){return db['UserVoiceQueueRt'][_0xb3c8('0x9b')](_0x3db61f);}));}return _0x5accec;});}})[_0xb3c8('0x1d')](respondWithStatusCode(_0x4ee356,null))[_0xb3c8('0x4b')](handleError(_0x4ee356,null));};exports[_0xb3c8('0x9c')]=function(_0x177548,_0x3a454b){var _0x18c3cf,_0x164fcf;return db[_0xb3c8('0x2e')][_0xb3c8('0x25')]({'where':{'id':_0x177548[_0xb3c8('0x4c')]['id']},'attributes':['id',_0xb3c8('0x26'),_0xb3c8('0x1a')]})['then'](handleEntityNotFound(_0x3a454b,null))[_0xb3c8('0x1d')](function(_0x8424bc){if(_0x8424bc){_0x18c3cf=_0x8424bc;if(!_0x177548['query'][_0xb3c8('0x9d')]||!utils[_0xb3c8('0x9e')](_0x177548[_0xb3c8('0x3b')]['channel'])){throw new db[(_0xb3c8('0x80'))][(_0xb3c8('0x82'))]('Unknown\x20channel');}return _0x8424bc[_0xb3c8('0x9f')+_[_0xb3c8('0x91')](_0x177548[_0xb3c8('0x3b')]['channel'][_0xb3c8('0x92')]())+_0xb3c8('0x93')](_0x177548['query'][_0xb3c8('0x56')]);}})['then'](function(_0x5ee74a){if(_[_0xb3c8('0xa0')](_0x177548[_0xb3c8('0x3b')][_0xb3c8('0x56')])){for(var _0x2acfd1=0x0;_0x2acfd1<_0x177548['query']['ids'][_0xb3c8('0x42')];_0x2acfd1+=0x1){_0x164fcf={'UserId':Number(_0x177548[_0xb3c8('0x4c')]['id'])};_0x164fcf[_[_0xb3c8('0x91')](_0x177548[_0xb3c8('0x3b')][_0xb3c8('0x9d')][_0xb3c8('0x92')]())+_0xb3c8('0x95')]=Number(_0x177548[_0xb3c8('0x3b')][_0xb3c8('0x56')][_0x2acfd1]);socket[_0xb3c8('0x1c')]('user'+_[_0xb3c8('0x91')](_0x177548['query'][_0xb3c8('0x9d')][_0xb3c8('0x92')]())+_0xb3c8('0xa1'),_0x164fcf);}}else{_0x164fcf={'UserId':Number(_0x177548['params']['id'])};_0x164fcf[_[_0xb3c8('0x91')](_0x177548[_0xb3c8('0x3b')][_0xb3c8('0x9d')][_0xb3c8('0x92')]())+_0xb3c8('0x95')]=Number(_0x177548[_0xb3c8('0x3b')][_0xb3c8('0x56')]);socket[_0xb3c8('0x1c')]('user'+_[_0xb3c8('0x91')](_0x177548[_0xb3c8('0x3b')][_0xb3c8('0x9d')][_0xb3c8('0x92')]())+'Queue:remove',_0x164fcf);}return _0x5ee74a;})[_0xb3c8('0x1d')](function(){if(_0x177548[_0xb3c8('0x3b')][_0xb3c8('0x9d')]===_0xb3c8('0x97')){return db[_0xb3c8('0xa2')][_0xb3c8('0x28')]({'where':{'UserId':_0x177548[_0xb3c8('0x4c')]['id'],'VoiceQueueId':_0x177548[_0xb3c8('0x3b')][_0xb3c8('0x56')]},'individualHooks':!![]})['then'](function(){return _0x18c3cf;});}return _0x18c3cf;})[_0xb3c8('0x1d')](respondWithStatusCode(_0x3a454b,null))['catch'](handleError(_0x3a454b,null));};exports[_0xb3c8('0xa3')]=function(_0x4734dd,_0x49db70){_0x4734dd[_0xb3c8('0x53')]['userpic']=_0x4734dd[_0xb3c8('0xa4')][_0xb3c8('0xa5')];return db[_0xb3c8('0x2e')][_0xb3c8('0x25')]({'where':{'id':_0x4734dd['params']['id']}})[_0xb3c8('0x1d')](handleEntityNotFound(_0x49db70,null))[_0xb3c8('0x1d')](saveUpdates(_0x4734dd[_0xb3c8('0x53')],null))[_0xb3c8('0x1d')](respondWithResult(_0x49db70,null))[_0xb3c8('0x4b')](handleError(_0x49db70,null));};exports[_0xb3c8('0xa6')]=function(_0x1ecae2,_0x17731d){var _0x2bdceb=path[_0xb3c8('0xa7')](config[_0xb3c8('0xa8')],_0xb3c8('0xa9'));return db[_0xb3c8('0x2e')][_0xb3c8('0x25')]({'where':{'id':_0x1ecae2['params']['id']},'attributes':['id','userpic'],'raw':!![]})[_0xb3c8('0x1d')](handleEntityNotFound(_0x17731d,null))[_0xb3c8('0x1d')](function(_0x131349){if(_0x131349){if(_[_0xb3c8('0x5e')](_0x131349[_0xb3c8('0xaa')])){return _0x17731d[_0xb3c8('0xab')](_0x2bdceb);}else{if(!fs[_0xb3c8('0xac')](path['join'](config[_0xb3c8('0xa8')],_0xb3c8('0xad'),_0x131349['userpic']))){return _0x17731d['download'](_0x2bdceb);}return _0x17731d[_0xb3c8('0xab')](path[_0xb3c8('0xa7')](config[_0xb3c8('0xa8')],_0xb3c8('0xad'),_0x131349[_0xb3c8('0xaa')]));}}})['catch'](handleError(_0x17731d,null));};exports['getOpenTabs']=function(_0x1e4e77,_0x21bf4c){return db[_0xb3c8('0x2e')][_0xb3c8('0x25')]({'where':{'id':_0x1e4e77[_0xb3c8('0x4c')]['id']},'attributes':['id']})[_0xb3c8('0x1d')](handleEntityNotFound(_0x21bf4c,null))[_0xb3c8('0x1d')](function(_0x527492){var _0x5ba742=[];values=_0x527492[_0xb3c8('0x46')];_0x5ba742['push'](get_open_tabs(_0xb3c8('0x43'),_0x527492[_0xb3c8('0x46')]));_0x5ba742['push'](get_open_tabs(_0xb3c8('0x44'),_0x527492['dataValues']));_0x5ba742['push'](get_open_tabs(_0xb3c8('0x48'),_0x527492[_0xb3c8('0x46')]));_0x5ba742[_0xb3c8('0x3f')](get_open_tabs(_0xb3c8('0x49'),_0x527492['dataValues']));_0x5ba742['push'](get_open_tabs(_0xb3c8('0x45'),_0x527492['dataValues']));_0x5ba742['push'](get_open_tabs('mail',_0x527492[_0xb3c8('0x46')]));return Promise['all'](_0x5ba742);})[_0xb3c8('0x1d')](function(_0x3b233b){if(_0x3b233b){var _0x185eae=_[_0xb3c8('0x30')](values[_0xb3c8('0xae')],function(_0x3f7e7b){return{'channel':_0xb3c8('0xaf'),'id':_0x3f7e7b['id'],'createdAt':_0x3f7e7b[_0xb3c8('0xb0')]};});var _0xb30ff5=_['map'](values[_0xb3c8('0xb1')],function(_0x305499){return{'channel':_0xb3c8('0xb2'),'id':_0x305499['id'],'createdAt':_0x305499[_0xb3c8('0xb0')]};});var _0x4ae73b=_['map'](values[_0xb3c8('0xb3')],function(_0xb0910f){return{'channel':'OPENCHANNEL','id':_0xb0910f['id'],'createdAt':_0xb0910f['createdAt']};});var _0x424951=_[_0xb3c8('0x30')](values[_0xb3c8('0xb4')],function(_0x37536c){return{'channel':_0xb3c8('0xb5'),'id':_0x37536c['id'],'createdAt':_0x37536c[_0xb3c8('0xb0')]};});var _0x491afb=_['map'](values[_0xb3c8('0xb6')],function(_0x4cc102){return{'channel':'SMS','id':_0x4cc102['id'],'createdAt':_0x4cc102[_0xb3c8('0xb0')]};});var _0x2bfd27=_[_0xb3c8('0x30')](values[_0xb3c8('0xb7')],function(_0x5a930b){return{'channel':_0xb3c8('0xb8'),'id':_0x5a930b['id'],'createdAt':_0x5a930b[_0xb3c8('0xb0')]};});var _0x506dc3=_[_0xb3c8('0xb9')](_0x185eae,_0xb30ff5,_0x4ae73b,_0x424951,_0x491afb,_0x2bfd27);var _0x1753d2={'count':_0x506dc3[_0xb3c8('0x42')],'rows':_0x506dc3};return _0x1753d2;}else return null;})['then'](respondWithResult(_0x21bf4c,null))['catch'](handleError(_0x21bf4c,null));};exports[_0xb3c8('0xba')]=function(_0x19de5b,_0x2f3d6d){var _0x3a4b82={};return db[_0xb3c8('0x2e')]['findOne']({'where':{'id':_0x19de5b[_0xb3c8('0x4c')]['id']}})['then'](function(_0x52cc9d){if(!_0x52cc9d){throw new APINotFoundError(util[_0xb3c8('0x99')](_0xb3c8('0xbb'),_0x19de5b[_0xb3c8('0x4c')]['id']));}return contacts['describe']();})[_0xb3c8('0x1d')](function(_0x23526b){_0x19de5b[_0xb3c8('0x3b')][_0xb3c8('0x2e')]=_0x19de5b[_0xb3c8('0x4c')]['id'];_0x3a4b82=qs[_0xb3c8('0x39')](_0x23526b,_0x19de5b);if(_0x19de5b[_0xb3c8('0x3b')][_0xb3c8('0xbc')](_0xb3c8('0x4d'))){_0x3a4b82[_0xb3c8('0x4e')]=[{'model':db[_0xb3c8('0xbd')],'as':_0xb3c8('0xbe'),'required':![]},{'model':db[_0xb3c8('0xbf')],'as':_0xb3c8('0xc0'),'attributes':['id',_0xb3c8('0x26'),_0xb3c8('0xc1')],'where':_0x19de5b[_0xb3c8('0x3b')]['tag']?{'id':_0x19de5b[_0xb3c8('0x3b')][_0xb3c8('0xc2')]}:undefined,'required':_0x19de5b[_0xb3c8('0x3b')][_0xb3c8('0xc2')]?!![]:![]}];}return contacts[_0xb3c8('0x7c')](_0x19de5b[_0xb3c8('0x3b')],_0x19de5b['user'],_0x3a4b82,_0x23526b);})['then'](respondWithFilteredResult(_0x2f3d6d,_0x3a4b82))['catch'](APIHandleError(_0x2f3d6d));};exports[_0xb3c8('0xc3')]=function(_0x56a0ba,_0x5a8fbf){var _0x414de0;var _0x399aa9={};var _0x35c63d;return db[_0xb3c8('0x2e')][_0xb3c8('0x88')]({'where':{'id':_0x56a0ba['params']['id']},'attributes':['id',_0xb3c8('0x26'),'role']})[_0xb3c8('0x1d')](handleEntityNotFound(_0x5a8fbf,null))[_0xb3c8('0x1d')](function(_0x5389bb){if(!utils['isValidChannel'](_0x56a0ba[_0xb3c8('0x3b')]['channel'])){throw new db[(_0xb3c8('0x80'))][(_0xb3c8('0x82'))](_0xb3c8('0x8f'));}_0x414de0=_0x5389bb;var _0x14898e={};_0x14898e[_0xb3c8('0xc4')]=_[_0xb3c8('0xc5')](db[_[_0xb3c8('0x91')](_0x56a0ba['query'][_0xb3c8('0x9d')])+_0xb3c8('0xc6')][_0xb3c8('0x2f')]);_0x14898e['query']=_[_0xb3c8('0xc5')](_0x56a0ba[_0xb3c8('0x3b')]);_0x14898e[_0xb3c8('0xc7')]=_[_0xb3c8('0xc8')](_0x14898e[_0xb3c8('0xc4')],_0x14898e['query']);_0x399aa9[_0xb3c8('0x3e')]=_[_0xb3c8('0xc8')](_0x14898e['model'],qs['fields'](_0x56a0ba[_0xb3c8('0x3b')][_0xb3c8('0xc9')]));_0x399aa9[_0xb3c8('0x3e')]=_0x399aa9[_0xb3c8('0x3e')][_0xb3c8('0x42')]?_0x399aa9[_0xb3c8('0x3e')]:_0x14898e[_0xb3c8('0xc4')];_0x399aa9[_0xb3c8('0xca')]=qs[_0xb3c8('0xcb')](_0x56a0ba[_0xb3c8('0x3b')]['sort']);_0x399aa9['where']=qs['filters'](_['pick'](_0x56a0ba['query'],_0x14898e['filters']));if(_0x56a0ba[_0xb3c8('0x3b')][_0xb3c8('0x23')]){_0x399aa9[_0xb3c8('0x3a')]=_[_0xb3c8('0x50')](_0x399aa9[_0xb3c8('0x3a')],{'$or':_[_0xb3c8('0x30')](_0x399aa9[_0xb3c8('0x3e')],function(_0xf03dc9){var _0x12fb03={};_0x12fb03[_0xf03dc9]={'$like':'%'+_0x56a0ba[_0xb3c8('0x3b')][_0xb3c8('0x23')]+'%'};return _0x12fb03;})});}_0x399aa9=_[_0xb3c8('0x50')]({},_0x399aa9,_0x56a0ba[_0xb3c8('0x51')]);switch(_0x414de0[_0xb3c8('0x1a')]){case _0xb3c8('0x1f'):return db[_[_0xb3c8('0x91')](_0x56a0ba[_0xb3c8('0x3b')]['channel'])+'Queue']['findAll'](_0x399aa9);case _0xb3c8('0x21'):case'agent':return _0x414de0[_0xb3c8('0x1e')+_[_0xb3c8('0x91')](_0x56a0ba[_0xb3c8('0x3b')]['channel'])+_0xb3c8('0x93')](_0x399aa9);default:throw new db[(_0xb3c8('0x80'))][(_0xb3c8('0x82'))](_0xb3c8('0xcc'));}})['then'](function(_0x7eca2a){_0x35c63d=_0x7eca2a[_0xb3c8('0x42')];if(!_0x56a0ba[_0xb3c8('0x3b')][_0xb3c8('0xbc')](_0xb3c8('0xcd'))){_0x399aa9[_0xb3c8('0x15')]=qs[_0xb3c8('0x15')](_0x56a0ba[_0xb3c8('0x3b')]['limit']);_0x399aa9[_0xb3c8('0x13')]=qs['offset'](_0x56a0ba[_0xb3c8('0x3b')][_0xb3c8('0x13')]);}switch(_0x414de0['role']){case _0xb3c8('0x1f'):return db[_[_0xb3c8('0x91')](_0x56a0ba[_0xb3c8('0x3b')][_0xb3c8('0x9d')])+_0xb3c8('0xc6')][_0xb3c8('0x7c')](_0x399aa9);case _0xb3c8('0x21'):case'agent':return _0x414de0[_0xb3c8('0x1e')+_['capitalize'](_0x56a0ba[_0xb3c8('0x3b')][_0xb3c8('0x9d')])+_0xb3c8('0x93')](_0x399aa9);}})[_0xb3c8('0x1d')](function(_0x3be75e){return{'count':_0x35c63d,'rows':_0x3be75e};})[_0xb3c8('0x1d')](respondWithResult(_0x5a8fbf,null))[_0xb3c8('0x4b')](handleError(_0x5a8fbf,null));};exports[_0xb3c8('0xce')]=function(_0xb481c9,_0x58e862){var _0x37f27a={};var _0x29be4c={};var _0x28a012;var _0xe1798;return db[_0xb3c8('0x2e')][_0xb3c8('0x88')]({'where':{'id':_0xb481c9['params']['id']}})[_0xb3c8('0x1d')](handleEntityNotFound(_0x58e862,null))['then'](function(_0x5a5af5){if(_0x5a5af5){_0x28a012=_0x5a5af5;_0x29be4c['model']=_[_0xb3c8('0xc5')](db['UserVoiceQueueRt'][_0xb3c8('0x2f')]);_0x29be4c[_0xb3c8('0x3b')]=_[_0xb3c8('0xc5')](_0xb481c9[_0xb3c8('0x3b')]);_0x29be4c[_0xb3c8('0xc7')]=_[_0xb3c8('0xc8')](_0x29be4c[_0xb3c8('0xc4')],_0x29be4c['query']);_0x37f27a[_0xb3c8('0x3e')]=_['intersection'](_0x29be4c['model'],qs['fields'](_0xb481c9[_0xb3c8('0x3b')][_0xb3c8('0xc9')]));_0x37f27a[_0xb3c8('0x3e')]=_0x37f27a['attributes'][_0xb3c8('0x42')]?_0x37f27a[_0xb3c8('0x3e')]:_0x29be4c['model'];_0x37f27a['order']=qs[_0xb3c8('0xcb')](_0xb481c9['query'][_0xb3c8('0xcb')]);_0x37f27a[_0xb3c8('0x3a')]=qs[_0xb3c8('0xc7')](_['pick'](_0xb481c9[_0xb3c8('0x3b')],_0x29be4c[_0xb3c8('0xc7')]));if(_0xb481c9['query']['filter']){_0x37f27a[_0xb3c8('0x3a')]=_[_0xb3c8('0x50')](_0x37f27a[_0xb3c8('0x3a')],{'$or':_['map'](_0x37f27a[_0xb3c8('0x3e')],function(_0x31ee58){var _0x3cd7af={};_0x3cd7af[_0x31ee58]={'$like':'%'+_0xb481c9['query'][_0xb3c8('0x23')]+'%'};return _0x3cd7af;})});}_0x37f27a=_[_0xb3c8('0x50')]({},_0x37f27a,_0xb481c9[_0xb3c8('0x51')]);return _0x28a012[_0xb3c8('0xce')](_0x37f27a);}})[_0xb3c8('0x1d')](function(_0x24974c){if(_0x24974c){_0xe1798=_0x24974c['length'];if(!_0xb481c9[_0xb3c8('0x3b')][_0xb3c8('0xbc')]('nolimit')){_0x37f27a[_0xb3c8('0x15')]=qs[_0xb3c8('0x15')](_0xb481c9[_0xb3c8('0x3b')][_0xb3c8('0x15')]);_0x37f27a['offset']=qs[_0xb3c8('0x13')](_0xb481c9[_0xb3c8('0x3b')][_0xb3c8('0x13')]);}return _0x28a012[_0xb3c8('0xce')](_0x37f27a);}})['then'](function(_0x37d435){if(_0x37d435){return _0x37d435?{'count':_0xe1798,'rows':_0x37d435}:null;}})[_0xb3c8('0x1d')](respondWithResult(_0x58e862,null))[_0xb3c8('0x4b')](handleError(_0x58e862,null));};exports[_0xb3c8('0xcf')]=function(_0x3d9238,_0xf4638d){var _0x37ad5a={};var _0x367ade={};var _0xa367c7;var _0x4b423b;return db[_0xb3c8('0x2e')][_0xb3c8('0x88')]({'where':{'id':_0x3d9238[_0xb3c8('0x4c')]['id']}})['then'](handleEntityNotFound(_0xf4638d,null))[_0xb3c8('0x1d')](function(_0x5f1fda){if(_0x5f1fda){_0xa367c7=_0x5f1fda;_0x367ade[_0xb3c8('0xc4')]=_[_0xb3c8('0xc5')](db['ChatGroup'][_0xb3c8('0x2f')]);_0x367ade['query']=_[_0xb3c8('0xc5')](_0x3d9238[_0xb3c8('0x3b')]);_0x367ade['filters']=_[_0xb3c8('0xc8')](_0x367ade[_0xb3c8('0xc4')],_0x367ade['query']);_0x37ad5a[_0xb3c8('0x3e')]=_[_0xb3c8('0xc8')](_0x367ade[_0xb3c8('0xc4')],qs[_0xb3c8('0xc9')](_0x3d9238['query'][_0xb3c8('0xc9')]));_0x37ad5a[_0xb3c8('0x3e')]=_0x37ad5a[_0xb3c8('0x3e')][_0xb3c8('0x42')]?_0x37ad5a[_0xb3c8('0x3e')]:_0x367ade[_0xb3c8('0xc4')];_0x37ad5a[_0xb3c8('0xca')]=qs['sort'](_0x3d9238[_0xb3c8('0x3b')][_0xb3c8('0xcb')]);_0x37ad5a[_0xb3c8('0x3a')]=qs[_0xb3c8('0xc7')](_[_0xb3c8('0xd0')](_0x3d9238[_0xb3c8('0x3b')],_0x367ade[_0xb3c8('0xc7')]));if(_0x3d9238['query'][_0xb3c8('0x23')]){_0x37ad5a[_0xb3c8('0x3a')]=_['merge'](_0x37ad5a['where'],{'$or':_[_0xb3c8('0x30')](_0x37ad5a[_0xb3c8('0x3e')],function(_0x176dd5){var _0x35c73c={};_0x35c73c[_0x176dd5]={'$like':'%'+_0x3d9238[_0xb3c8('0x3b')][_0xb3c8('0x23')]+'%'};return _0x35c73c;})});}_0x37ad5a=_[_0xb3c8('0x50')]({},_0x37ad5a,_0x3d9238[_0xb3c8('0x51')]);return _0xa367c7[_0xb3c8('0xcf')](_0x37ad5a);}})[_0xb3c8('0x1d')](function(_0xb2b40e){if(_0xb2b40e){_0x4b423b=_0xb2b40e[_0xb3c8('0x42')];if(!_0x3d9238[_0xb3c8('0x3b')][_0xb3c8('0xbc')]('nolimit')){_0x37ad5a['limit']=qs[_0xb3c8('0x15')](_0x3d9238[_0xb3c8('0x3b')][_0xb3c8('0x15')]);_0x37ad5a[_0xb3c8('0x13')]=qs['offset'](_0x3d9238['query']['offset']);}return _0xa367c7[_0xb3c8('0xcf')](_0x37ad5a);}})[_0xb3c8('0x1d')](function(_0x1c44e7){if(_0x1c44e7){return _0x1c44e7?{'count':_0x4b423b,'rows':_0x1c44e7}:null;}})[_0xb3c8('0x1d')](respondWithResult(_0xf4638d,null))[_0xb3c8('0x4b')](handleError(_0xf4638d,null));};exports[_0xb3c8('0xd1')]=function(_0x23726a,_0x165507){var _0x5ae9c5={'raw':!![],'where':{}};var _0x4ea655={};var _0x55a7fd={'count':0x0,'rows':[]};return db['User']['findOne']({'where':{'id':_0x23726a[_0xb3c8('0x4c')]['id']}})[_0xb3c8('0x1d')](handleEntityNotFound(_0x165507,null))[_0xb3c8('0x1d')](function(_0x295965){if(_0x295965){_0x4ea655['model']=_[_0xb3c8('0xc5')](db['VoiceRecording'][_0xb3c8('0x2f')]);_0x4ea655[_0xb3c8('0x3b')]=_[_0xb3c8('0xc5')](_0x23726a['query']);_0x4ea655[_0xb3c8('0xc7')]=_[_0xb3c8('0xc8')](_0x4ea655[_0xb3c8('0xc4')],_0x4ea655[_0xb3c8('0x3b')]);_0x5ae9c5['attributes']=_[_0xb3c8('0xc8')](_0x4ea655[_0xb3c8('0xc4')],qs[_0xb3c8('0xc9')](_0x23726a['query']['fields']));_0x5ae9c5[_0xb3c8('0x3e')]=_0x5ae9c5[_0xb3c8('0x3e')][_0xb3c8('0x42')]?_0x5ae9c5['attributes']:_0x4ea655[_0xb3c8('0xc4')];if(!_0x23726a[_0xb3c8('0x3b')][_0xb3c8('0xbc')](_0xb3c8('0xcd'))){_0x5ae9c5['limit']=qs[_0xb3c8('0x15')](_0x23726a['query']['limit']);_0x5ae9c5['offset']=qs[_0xb3c8('0x13')](_0x23726a[_0xb3c8('0x3b')]['offset']);}_0x5ae9c5['order']=qs[_0xb3c8('0xcb')](_0x23726a[_0xb3c8('0x3b')][_0xb3c8('0xcb')]);_0x5ae9c5[_0xb3c8('0x3a')]=qs[_0xb3c8('0xc7')](_[_0xb3c8('0xd0')](_0x23726a[_0xb3c8('0x3b')],_0x4ea655['filters']));_0x5ae9c5[_0xb3c8('0x3a')][_0xb3c8('0xd2')]=_0x295965['id'];if(_0x23726a['query'][_0xb3c8('0x23')]){_0x5ae9c5[_0xb3c8('0x3a')]=_[_0xb3c8('0x50')](_0x5ae9c5[_0xb3c8('0x3a')],{'$or':_[_0xb3c8('0x30')](_0x5ae9c5[_0xb3c8('0x3e')],function(_0x41ea31){var _0x9b3380={};_0x9b3380[_0x41ea31]={'$like':'%'+_0x23726a[_0xb3c8('0x3b')][_0xb3c8('0x23')]+'%'};return _0x9b3380;})});}_0x5ae9c5=_['merge']({},_0x5ae9c5,_0x23726a[_0xb3c8('0x51')]);return db[_0xb3c8('0xd3')]['count']({'where':_0x5ae9c5[_0xb3c8('0x3a')]})['then'](function(_0x148f2e){_0x55a7fd[_0xb3c8('0x16')]=_0x148f2e;if(_0x23726a[_0xb3c8('0x3b')]['includeAll']){_0x5ae9c5['include']=[{'all':!![]}];}return db['VoiceRecording']['findAll'](_0x5ae9c5);})[_0xb3c8('0x1d')](function(_0x42c067){_0x55a7fd[_0xb3c8('0x40')]=_0x42c067;return _0x55a7fd;});}})[_0xb3c8('0x1d')](respondWithFilteredResult(_0x165507,_0x5ae9c5))[_0xb3c8('0x4b')](handleError(_0x165507,null));};exports[_0xb3c8('0xd4')]=function(_0x134e5e,_0x121606){var _0x57f08e={'raw':!![],'where':{}};var _0x328d2a={};var _0x25650d={'count':0x0,'rows':[]};return db['User'][_0xb3c8('0x88')]({'where':{'id':_0x134e5e[_0xb3c8('0x4c')]['id']}})[_0xb3c8('0x1d')](handleEntityNotFound(_0x121606,null))[_0xb3c8('0x1d')](function(_0xa99c20){if(_0xa99c20){_0x328d2a[_0xb3c8('0xc4')]=_[_0xb3c8('0xc5')](db['ScreenRecording'][_0xb3c8('0x2f')]);_0x328d2a['query']=_[_0xb3c8('0xc5')](_0x134e5e['query']);_0x328d2a[_0xb3c8('0xc7')]=_[_0xb3c8('0xc8')](_0x328d2a['model'],_0x328d2a['query']);_0x57f08e['attributes']=_[_0xb3c8('0xc8')](_0x328d2a[_0xb3c8('0xc4')],qs['fields'](_0x134e5e[_0xb3c8('0x3b')][_0xb3c8('0xc9')]));_0x57f08e['attributes']=_0x57f08e[_0xb3c8('0x3e')][_0xb3c8('0x42')]?_0x57f08e['attributes']:_0x328d2a[_0xb3c8('0xc4')];if(!_0x134e5e[_0xb3c8('0x3b')][_0xb3c8('0xbc')]('nolimit')){_0x57f08e[_0xb3c8('0x15')]=qs[_0xb3c8('0x15')](_0x134e5e['query'][_0xb3c8('0x15')]);_0x57f08e[_0xb3c8('0x13')]=qs[_0xb3c8('0x13')](_0x134e5e[_0xb3c8('0x3b')]['offset']);}_0x57f08e[_0xb3c8('0xca')]=qs['sort'](_0x134e5e[_0xb3c8('0x3b')][_0xb3c8('0xcb')]);_0x57f08e['where']=qs[_0xb3c8('0xc7')](_['pick'](_0x134e5e['query'],_0x328d2a[_0xb3c8('0xc7')]));_0x57f08e['where'][_0xb3c8('0xd2')]=_0xa99c20['id'];if(_0x134e5e['query'][_0xb3c8('0x23')]){_0x57f08e['where']=_[_0xb3c8('0x50')](_0x57f08e[_0xb3c8('0x3a')],{'$or':_[_0xb3c8('0x30')](_0x57f08e[_0xb3c8('0x3e')],function(_0x3e34da){var _0x4b3150={};_0x4b3150[_0x3e34da]={'$like':'%'+_0x134e5e[_0xb3c8('0x3b')][_0xb3c8('0x23')]+'%'};return _0x4b3150;})});}_0x57f08e=_[_0xb3c8('0x50')]({},_0x57f08e,_0x134e5e[_0xb3c8('0x51')]);return db['ScreenRecording'][_0xb3c8('0x16')]({'where':_0x57f08e[_0xb3c8('0x3a')]})['then'](function(_0x43cfe1){_0x25650d[_0xb3c8('0x16')]=_0x43cfe1;if(_0x134e5e['query']['includeAll']){_0x57f08e['include']=[{'all':!![]}];}return db[_0xb3c8('0xd5')]['findAll'](_0x57f08e);})[_0xb3c8('0x1d')](function(_0xb115ed){_0x25650d[_0xb3c8('0x40')]=_0xb115ed;return _0x25650d;});}})[_0xb3c8('0x1d')](respondWithFilteredResult(_0x121606,_0x57f08e))['catch'](handleError(_0x121606,null));};exports[_0xb3c8('0xd6')]=function(_0x37d235,_0x5e6702){var _0x225adf={};var _0x1ef6ec={};var _0x477724;var _0x2aaf80;return db[_0xb3c8('0x2e')][_0xb3c8('0x88')]({'where':{'id':_0x37d235['params']['id']}})[_0xb3c8('0x1d')](handleEntityNotFound(_0x5e6702,null))[_0xb3c8('0x1d')](function(_0x3356e3){if(_0x3356e3){_0x477724=_0x3356e3;_0x1ef6ec[_0xb3c8('0xc4')]=_['keys'](db[_0xb3c8('0xd7')][_0xb3c8('0x2f')]);_0x1ef6ec['query']=_['keys'](_0x37d235[_0xb3c8('0x3b')]);_0x1ef6ec['filters']=_[_0xb3c8('0xc8')](_0x1ef6ec[_0xb3c8('0xc4')],_0x1ef6ec[_0xb3c8('0x3b')]);_0x225adf['attributes']=_[_0xb3c8('0xc8')](_0x1ef6ec[_0xb3c8('0xc4')],qs[_0xb3c8('0xc9')](_0x37d235['query'][_0xb3c8('0xc9')]));_0x225adf[_0xb3c8('0x3e')]=_0x225adf[_0xb3c8('0x3e')][_0xb3c8('0x42')]?_0x225adf[_0xb3c8('0x3e')]:_0x1ef6ec[_0xb3c8('0xc4')];_0x225adf[_0xb3c8('0xca')]=qs[_0xb3c8('0xcb')](_0x37d235[_0xb3c8('0x3b')][_0xb3c8('0xcb')]);_0x225adf[_0xb3c8('0x3a')]=qs[_0xb3c8('0xc7')](_[_0xb3c8('0xd0')](_0x37d235[_0xb3c8('0x3b')],_0x1ef6ec[_0xb3c8('0xc7')]));if(_0x37d235['query'][_0xb3c8('0x23')]){_0x225adf[_0xb3c8('0x3a')]=_[_0xb3c8('0x50')](_0x225adf[_0xb3c8('0x3a')],{'$or':_[_0xb3c8('0x30')](_0x225adf[_0xb3c8('0x3e')],function(_0x274427){var _0xa3f637={};_0xa3f637[_0x274427]={'$like':'%'+_0x37d235[_0xb3c8('0x3b')][_0xb3c8('0x23')]+'%'};return _0xa3f637;})});}_0x225adf=_[_0xb3c8('0x50')]({},_0x225adf,_0x37d235[_0xb3c8('0x51')]);return _0x477724[_0xb3c8('0xd6')](_0x225adf);}})[_0xb3c8('0x1d')](function(_0x24d809){if(_0x24d809){_0x2aaf80=_0x24d809['length'];if(!_0x37d235[_0xb3c8('0x3b')]['hasOwnProperty'](_0xb3c8('0xcd'))){_0x225adf[_0xb3c8('0x15')]=qs[_0xb3c8('0x15')](_0x37d235[_0xb3c8('0x3b')][_0xb3c8('0x15')]);_0x225adf[_0xb3c8('0x13')]=qs['offset'](_0x37d235['query'][_0xb3c8('0x13')]);}return _0x477724[_0xb3c8('0xd6')](_0x225adf);}})[_0xb3c8('0x1d')](function(_0x1c795){if(_0x1c795){return _0x1c795?{'count':_0x2aaf80,'rows':_0x1c795}:null;}})[_0xb3c8('0x1d')](respondWithResult(_0x5e6702,null))[_0xb3c8('0x4b')](handleError(_0x5e6702,null));};exports[_0xb3c8('0xd8')]=function(_0x3fd9a0,_0x4f7fe5){var _0x109935={};var _0x4a404c={};var _0x45d312;var _0x431596;return db[_0xb3c8('0x2e')]['findOne']({'where':{'id':_0x3fd9a0[_0xb3c8('0x4c')]['id']}})[_0xb3c8('0x1d')](handleEntityNotFound(_0x4f7fe5,null))[_0xb3c8('0x1d')](function(_0x4b8eec){if(_0x4b8eec){_0x45d312=_0x4b8eec;_0x4a404c[_0xb3c8('0xc4')]=_[_0xb3c8('0xc5')](db['OpenchannelInteraction']['rawAttributes']);_0x4a404c[_0xb3c8('0x3b')]=_['keys'](_0x3fd9a0[_0xb3c8('0x3b')]);_0x4a404c[_0xb3c8('0xc7')]=_[_0xb3c8('0xc8')](_0x4a404c['model'],_0x4a404c[_0xb3c8('0x3b')]);_0x109935['attributes']=_[_0xb3c8('0xc8')](_0x4a404c[_0xb3c8('0xc4')],qs[_0xb3c8('0xc9')](_0x3fd9a0[_0xb3c8('0x3b')][_0xb3c8('0xc9')]));_0x109935['attributes']=_0x109935[_0xb3c8('0x3e')][_0xb3c8('0x42')]?_0x109935['attributes']:_0x4a404c[_0xb3c8('0xc4')];_0x109935[_0xb3c8('0xca')]=qs[_0xb3c8('0xcb')](_0x3fd9a0[_0xb3c8('0x3b')][_0xb3c8('0xcb')]);_0x109935[_0xb3c8('0x3a')]=qs[_0xb3c8('0xc7')](_[_0xb3c8('0xd0')](_0x3fd9a0[_0xb3c8('0x3b')],_0x4a404c['filters']));if(_0x3fd9a0['query'][_0xb3c8('0x23')]){_0x109935[_0xb3c8('0x3a')]=_['merge'](_0x109935[_0xb3c8('0x3a')],{'$or':_[_0xb3c8('0x30')](_0x109935[_0xb3c8('0x3e')],function(_0x40bcdd){var _0x49454c={};_0x49454c[_0x40bcdd]={'$like':'%'+_0x3fd9a0[_0xb3c8('0x3b')][_0xb3c8('0x23')]+'%'};return _0x49454c;})});}_0x109935=_['merge']({},_0x109935,_0x3fd9a0[_0xb3c8('0x51')]);return _0x45d312['getOpenchannelInteractions'](_0x109935);}})[_0xb3c8('0x1d')](function(_0x44934c){if(_0x44934c){_0x431596=_0x44934c[_0xb3c8('0x42')];if(!_0x3fd9a0[_0xb3c8('0x3b')]['hasOwnProperty'](_0xb3c8('0xcd'))){_0x109935['limit']=qs['limit'](_0x3fd9a0[_0xb3c8('0x3b')][_0xb3c8('0x15')]);_0x109935[_0xb3c8('0x13')]=qs[_0xb3c8('0x13')](_0x3fd9a0[_0xb3c8('0x3b')][_0xb3c8('0x13')]);}return _0x45d312[_0xb3c8('0xd8')](_0x109935);}})[_0xb3c8('0x1d')](function(_0x664555){if(_0x664555){return _0x664555?{'count':_0x431596,'rows':_0x664555}:null;}})[_0xb3c8('0x1d')](respondWithResult(_0x4f7fe5,null))[_0xb3c8('0x4b')](handleError(_0x4f7fe5,null));};exports['getMailInteractions']=function(_0x3af3d4,_0x37b0bf){var _0x4ded46={'raw':!![],'where':{}};var _0x1817c2={};var _0x4e6af8={'count':0x0,'rows':[]};return db[_0xb3c8('0x2e')][_0xb3c8('0x88')]({'where':{'id':_0x3af3d4[_0xb3c8('0x4c')]['id']}})[_0xb3c8('0x1d')](handleEntityNotFound(_0x37b0bf,null))[_0xb3c8('0x1d')](function(_0x899694){if(_0x899694){_0x1817c2['model']=_[_0xb3c8('0xc5')](db[_0xb3c8('0xd9')]['rawAttributes']);_0x1817c2['query']=_[_0xb3c8('0xc5')](_0x3af3d4[_0xb3c8('0x3b')]);_0x1817c2[_0xb3c8('0xc7')]=_[_0xb3c8('0xc8')](_0x1817c2[_0xb3c8('0xc4')],_0x1817c2[_0xb3c8('0x3b')]);_0x4ded46['attributes']=_[_0xb3c8('0xc8')](_0x1817c2[_0xb3c8('0xc4')],qs[_0xb3c8('0xc9')](_0x3af3d4[_0xb3c8('0x3b')][_0xb3c8('0xc9')]));_0x4ded46['attributes']=_0x4ded46[_0xb3c8('0x3e')][_0xb3c8('0x42')]?_0x4ded46[_0xb3c8('0x3e')]:_0x1817c2[_0xb3c8('0xc4')];if(!_0x3af3d4['query']['hasOwnProperty']('nolimit')){_0x4ded46['limit']=qs[_0xb3c8('0x15')](_0x3af3d4[_0xb3c8('0x3b')]['limit']);_0x4ded46[_0xb3c8('0x13')]=qs['offset'](_0x3af3d4[_0xb3c8('0x3b')][_0xb3c8('0x13')]);}_0x4ded46[_0xb3c8('0xca')]=qs[_0xb3c8('0xcb')](_0x3af3d4[_0xb3c8('0x3b')][_0xb3c8('0xcb')]);_0x4ded46['where']=qs[_0xb3c8('0xc7')](_[_0xb3c8('0xd0')](_0x3af3d4[_0xb3c8('0x3b')],_0x1817c2[_0xb3c8('0xc7')]));_0x4ded46[_0xb3c8('0x3a')][_0xb3c8('0xd2')]=_0x899694['id'];if(_0x3af3d4['query'][_0xb3c8('0x23')]){_0x4ded46[_0xb3c8('0x3a')]=_[_0xb3c8('0x50')](_0x4ded46[_0xb3c8('0x3a')],{'$or':_[_0xb3c8('0x30')](_0x4ded46[_0xb3c8('0x3e')],function(_0x340b1d){var _0x57261d={};_0x57261d[_0x340b1d]={'$like':'%'+_0x3af3d4[_0xb3c8('0x3b')][_0xb3c8('0x23')]+'%'};return _0x57261d;})});}_0x4ded46=_[_0xb3c8('0x50')]({},_0x4ded46,_0x3af3d4['options']);return db[_0xb3c8('0xd9')][_0xb3c8('0x16')]({'where':_0x4ded46[_0xb3c8('0x3a')]})[_0xb3c8('0x1d')](function(_0x2317a0){_0x4e6af8['count']=_0x2317a0;if(_0x3af3d4[_0xb3c8('0x3b')]['includeAll']){_0x4ded46[_0xb3c8('0x4e')]=[{'all':!![]}];}return db['MailInteraction'][_0xb3c8('0x7c')](_0x4ded46);})[_0xb3c8('0x1d')](function(_0x518189){_0x4e6af8[_0xb3c8('0x40')]=_0x518189;return _0x4e6af8;});}})[_0xb3c8('0x1d')](respondWithFilteredResult(_0x37b0bf,_0x4ded46))[_0xb3c8('0x4b')](handleError(_0x37b0bf,null));};exports[_0xb3c8('0xda')]=function(_0x2f43eb,_0x1c4874){var _0x5bcfe8={};var _0x30986c={};var _0x4f5332;var _0x2d72ab;return db[_0xb3c8('0x2e')][_0xb3c8('0x88')]({'where':{'id':_0x2f43eb[_0xb3c8('0x4c')]['id']}})[_0xb3c8('0x1d')](handleEntityNotFound(_0x1c4874,null))['then'](function(_0x4338ca){if(_0x4338ca){_0x4f5332=_0x4338ca;_0x30986c[_0xb3c8('0xc4')]=_[_0xb3c8('0xc5')](db['SmsInteraction'][_0xb3c8('0x2f')]);_0x30986c[_0xb3c8('0x3b')]=_[_0xb3c8('0xc5')](_0x2f43eb[_0xb3c8('0x3b')]);_0x30986c[_0xb3c8('0xc7')]=_[_0xb3c8('0xc8')](_0x30986c['model'],_0x30986c[_0xb3c8('0x3b')]);_0x5bcfe8['attributes']=_[_0xb3c8('0xc8')](_0x30986c[_0xb3c8('0xc4')],qs[_0xb3c8('0xc9')](_0x2f43eb[_0xb3c8('0x3b')]['fields']));_0x5bcfe8[_0xb3c8('0x3e')]=_0x5bcfe8[_0xb3c8('0x3e')][_0xb3c8('0x42')]?_0x5bcfe8[_0xb3c8('0x3e')]:_0x30986c[_0xb3c8('0xc4')];_0x5bcfe8[_0xb3c8('0xca')]=qs[_0xb3c8('0xcb')](_0x2f43eb[_0xb3c8('0x3b')][_0xb3c8('0xcb')]);_0x5bcfe8[_0xb3c8('0x3a')]=qs[_0xb3c8('0xc7')](_[_0xb3c8('0xd0')](_0x2f43eb[_0xb3c8('0x3b')],_0x30986c[_0xb3c8('0xc7')]));if(_0x2f43eb['query'][_0xb3c8('0x23')]){_0x5bcfe8['where']=_['merge'](_0x5bcfe8[_0xb3c8('0x3a')],{'$or':_[_0xb3c8('0x30')](_0x5bcfe8[_0xb3c8('0x3e')],function(_0x42cd1c){var _0x54534a={};_0x54534a[_0x42cd1c]={'$like':'%'+_0x2f43eb[_0xb3c8('0x3b')][_0xb3c8('0x23')]+'%'};return _0x54534a;})});}_0x5bcfe8=_[_0xb3c8('0x50')]({},_0x5bcfe8,_0x2f43eb[_0xb3c8('0x51')]);return _0x4f5332[_0xb3c8('0xda')](_0x5bcfe8);}})[_0xb3c8('0x1d')](function(_0x5c5558){if(_0x5c5558){_0x2d72ab=_0x5c5558['length'];if(!_0x2f43eb[_0xb3c8('0x3b')][_0xb3c8('0xbc')](_0xb3c8('0xcd'))){_0x5bcfe8[_0xb3c8('0x15')]=qs['limit'](_0x2f43eb['query']['limit']);_0x5bcfe8[_0xb3c8('0x13')]=qs['offset'](_0x2f43eb['query'][_0xb3c8('0x13')]);}return _0x4f5332['getSmsInteractions'](_0x5bcfe8);}})[_0xb3c8('0x1d')](function(_0x3ca357){if(_0x3ca357){return _0x3ca357?{'count':_0x2d72ab,'rows':_0x3ca357}:null;}})['then'](respondWithResult(_0x1c4874,null))[_0xb3c8('0x4b')](handleError(_0x1c4874,null));};exports[_0xb3c8('0xdb')]=function(_0x146dd1,_0x51c6bf){var _0x12cc57={};var _0x56a710={};var _0x14920f;var _0x11641c;return db[_0xb3c8('0x2e')]['findOne']({'where':{'id':_0x146dd1[_0xb3c8('0x4c')]['id']}})[_0xb3c8('0x1d')](handleEntityNotFound(_0x51c6bf,null))[_0xb3c8('0x1d')](function(_0x59b2c7){if(_0x59b2c7){_0x14920f=_0x59b2c7;_0x56a710[_0xb3c8('0xc4')]=_[_0xb3c8('0xc5')](db[_0xb3c8('0xdc')][_0xb3c8('0x2f')]);_0x56a710[_0xb3c8('0x3b')]=_[_0xb3c8('0xc5')](_0x146dd1[_0xb3c8('0x3b')]);_0x56a710['filters']=_[_0xb3c8('0xc8')](_0x56a710['model'],_0x56a710[_0xb3c8('0x3b')]);_0x12cc57['attributes']=_[_0xb3c8('0xc8')](_0x56a710[_0xb3c8('0xc4')],qs[_0xb3c8('0xc9')](_0x146dd1[_0xb3c8('0x3b')][_0xb3c8('0xc9')]));_0x12cc57[_0xb3c8('0x3e')]=_0x12cc57['attributes'][_0xb3c8('0x42')]?_0x12cc57[_0xb3c8('0x3e')]:_0x56a710[_0xb3c8('0xc4')];_0x12cc57['order']=qs['sort'](_0x146dd1[_0xb3c8('0x3b')][_0xb3c8('0xcb')]);_0x12cc57[_0xb3c8('0x3a')]=qs[_0xb3c8('0xc7')](_[_0xb3c8('0xd0')](_0x146dd1[_0xb3c8('0x3b')],_0x56a710['filters']));if(_0x146dd1[_0xb3c8('0x3b')][_0xb3c8('0x23')]){_0x12cc57[_0xb3c8('0x3a')]=_[_0xb3c8('0x50')](_0x12cc57[_0xb3c8('0x3a')],{'$or':_[_0xb3c8('0x30')](_0x12cc57[_0xb3c8('0x3e')],function(_0x3a9204){var _0x264a86={};_0x264a86[_0x3a9204]={'$like':'%'+_0x146dd1[_0xb3c8('0x3b')][_0xb3c8('0x23')]+'%'};return _0x264a86;})});}_0x12cc57=_['merge']({},_0x12cc57,_0x146dd1[_0xb3c8('0x51')]);return _0x14920f['getFaxInteractions'](_0x12cc57);}})['then'](function(_0x583b8f){if(_0x583b8f){_0x11641c=_0x583b8f[_0xb3c8('0x42')];if(!_0x146dd1[_0xb3c8('0x3b')][_0xb3c8('0xbc')](_0xb3c8('0xcd'))){_0x12cc57['limit']=qs[_0xb3c8('0x15')](_0x146dd1[_0xb3c8('0x3b')][_0xb3c8('0x15')]);_0x12cc57['offset']=qs[_0xb3c8('0x13')](_0x146dd1[_0xb3c8('0x3b')]['offset']);}return _0x14920f[_0xb3c8('0xdb')](_0x12cc57);}})['then'](function(_0x3adaef){if(_0x3adaef){return _0x3adaef?{'count':_0x11641c,'rows':_0x3adaef}:null;}})[_0xb3c8('0x1d')](respondWithResult(_0x51c6bf,null))['catch'](handleError(_0x51c6bf,null));};exports[_0xb3c8('0xdd')]=function(_0x466b1d,_0x7568fe){var _0x194e75={};var _0x806b20={};var _0x42372e;var _0x26b8b5;return db[_0xb3c8('0x2e')]['findOne']({'where':{'id':_0x466b1d[_0xb3c8('0x4c')]['id']}})[_0xb3c8('0x1d')](handleEntityNotFound(_0x7568fe,null))[_0xb3c8('0x1d')](function(_0x1a3fd0){if(_0x1a3fd0){_0x42372e=_0x1a3fd0;_0x806b20['model']=_['keys'](db['WhatsappInteraction'][_0xb3c8('0x2f')]);_0x806b20['query']=_[_0xb3c8('0xc5')](_0x466b1d[_0xb3c8('0x3b')]);_0x806b20[_0xb3c8('0xc7')]=_[_0xb3c8('0xc8')](_0x806b20['model'],_0x806b20[_0xb3c8('0x3b')]);_0x194e75[_0xb3c8('0x3e')]=_['intersection'](_0x806b20[_0xb3c8('0xc4')],qs[_0xb3c8('0xc9')](_0x466b1d['query']['fields']));_0x194e75[_0xb3c8('0x3e')]=_0x194e75['attributes']['length']?_0x194e75[_0xb3c8('0x3e')]:_0x806b20[_0xb3c8('0xc4')];_0x194e75[_0xb3c8('0xca')]=qs['sort'](_0x466b1d[_0xb3c8('0x3b')][_0xb3c8('0xcb')]);_0x194e75[_0xb3c8('0x3a')]=qs[_0xb3c8('0xc7')](_['pick'](_0x466b1d['query'],_0x806b20[_0xb3c8('0xc7')]));if(_0x466b1d[_0xb3c8('0x3b')]['filter']){_0x194e75[_0xb3c8('0x3a')]=_[_0xb3c8('0x50')](_0x194e75[_0xb3c8('0x3a')],{'$or':_['map'](_0x194e75[_0xb3c8('0x3e')],function(_0x55b5a8){var _0x46e747={};_0x46e747[_0x55b5a8]={'$like':'%'+_0x466b1d[_0xb3c8('0x3b')]['filter']+'%'};return _0x46e747;})});}_0x194e75=_['merge']({},_0x194e75,_0x466b1d[_0xb3c8('0x51')]);return _0x42372e[_0xb3c8('0xdd')](_0x194e75);}})[_0xb3c8('0x1d')](function(_0x39db47){if(_0x39db47){_0x26b8b5=_0x39db47[_0xb3c8('0x42')];if(!_0x466b1d[_0xb3c8('0x3b')]['hasOwnProperty']('nolimit')){_0x194e75[_0xb3c8('0x15')]=qs[_0xb3c8('0x15')](_0x466b1d[_0xb3c8('0x3b')][_0xb3c8('0x15')]);_0x194e75[_0xb3c8('0x13')]=qs[_0xb3c8('0x13')](_0x466b1d[_0xb3c8('0x3b')]['offset']);}return _0x42372e['getWhatsappInteractions'](_0x194e75);}})[_0xb3c8('0x1d')](function(_0x5c6e77){if(_0x5c6e77){return _0x5c6e77?{'count':_0x26b8b5,'rows':_0x5c6e77}:null;}})['then'](respondWithResult(_0x7568fe,null))['catch'](handleError(_0x7568fe,null));};exports[_0xb3c8('0xde')]=function(_0x4e3d8e,_0x508174,_0x697397){var _0x236ced;var _0xc73a28;var _0x120b60;var _0x449e5e=!_['isNil'](_0x4e3d8e[_0xb3c8('0x4c')]['id'])?_0x4e3d8e['params']['id']:!_[_0xb3c8('0x5e')](_0x4e3d8e[_0xb3c8('0x21')]['id'])?_0x4e3d8e[_0xb3c8('0x21')]['id']:null;return db[_0xb3c8('0x2e')][_0xb3c8('0x25')]({'where':{'id':_0x449e5e,'role':{'$or':[_0xb3c8('0x1f'),_0xb3c8('0x21'),_0xb3c8('0x1b')]}},'attributes':['id','name','phone',_0xb3c8('0xdf'),'role',_0xb3c8('0x58'),_0xb3c8('0x8d')]})[_0xb3c8('0x1d')](function(_0x514f75){if(_0x514f75){if(_0x514f75[_0xb3c8('0x1a')]===_0xb3c8('0x1b')){_0x236ced=_0x514f75;if(_0x4e3d8e[_0xb3c8('0x53')]['interface']){_0x120b60=util[_0xb3c8('0x99')](_0xb3c8('0xe0'),_0x236ced[_0x4e3d8e[_0xb3c8('0x53')][_0xb3c8('0x8e')]]);}else if(_0x4e3d8e[_0xb3c8('0x53')][_0xb3c8('0xe1')]){_0x120b60=util['format'](_0xb3c8('0xe2'),_0x4e3d8e[_0xb3c8('0x53')]['intrf']);}else{_0x120b60=util[_0xb3c8('0x99')]('SIP/%s',_0x236ced[_0xb3c8('0x26')]);}socket['to'](util[_0xb3c8('0x99')]('user:%s',_0x236ced[_0xb3c8('0x26')]))[_0xb3c8('0x1c')]('user:forcelogout',{'user':{'id':_0x236ced['id'],'name':_0x236ced[_0xb3c8('0x26')]},'ip':_0x4e3d8e[_0xb3c8('0xe3')][_0xb3c8('0xe4')]||_0x4e3d8e[_0xb3c8('0xe5')][_0xb3c8('0xe6')]||_0x4e3d8e[_0xb3c8('0xe7')][_0xb3c8('0xe6')]||_0x4e3d8e[_0xb3c8('0xe5')][_0xb3c8('0xe7')]['remoteAddress']});return db[_0xb3c8('0xa2')][_0xb3c8('0x28')]({'where':{'membername':_0x236ced[_0xb3c8('0x26')]},'individualHooks':!![]});}}else{throw new db[(_0xb3c8('0x80'))][(_0xb3c8('0x82'))](_0xb3c8('0xe8'));}})[_0xb3c8('0x1d')](function(){if(_0x236ced){return _0x236ced[_0xb3c8('0xe9')]({'raw':!![]});}})[_0xb3c8('0x1d')](function(_0x2704f6){if(_0x236ced){if(_0x2704f6){_0xc73a28=_0x2704f6;if(_0xc73a28[_0xb3c8('0x42')]){var _0x36b1b1=_0xc73a28[_0xb3c8('0x30')](function(_0x1e7eae){var _0x3d1505={'membername':_0x236ced['name'],'UserId':_0x236ced['id'],'queue_name':_0x1e7eae[_0xb3c8('0x26')],'VoiceQueueId':_0x1e7eae['id'],'interface':_0x120b60,'paused':_0x236ced[_0xb3c8('0x8d')]||![],'penalty':_0x1e7eae[_0xb3c8('0xea')]||0x0};return db['UserVoiceQueueRt'][_0xb3c8('0x9b')](_0x3d1505);});return Promise[_0xb3c8('0x4a')](_0x36b1b1);}}}})[_0xb3c8('0x1d')](function(){if(_0x236ced){return db[_0xb3c8('0xeb')][_0xb3c8('0x7c')]({'where':{'membername':_0x236ced[_0xb3c8('0x26')],'exitAt':null}});}})['then'](function(_0x2419a8){if(_0x236ced){var _0x25e49e=[];_0x2419a8[_0xb3c8('0xec')](function(_0x47c528){_0x25e49e[_0xb3c8('0x3f')](_0x47c528[_0xb3c8('0x19')]({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')}));});return Promise[_0xb3c8('0x4a')](_0x25e49e);}})[_0xb3c8('0x1d')](function(){if(_0x236ced){var _0x4682d5=[];var _0x30bf74=[];var _0x1ffb06=utils[_0xb3c8('0xed')]();var _0xc5eae4={'membername':_0x236ced[_0xb3c8('0x26')],'interface':_0x120b60,'enterAt':moment()[_0xb3c8('0x99')](_0xb3c8('0xee')),'role':_0x236ced['role'],'internal':_0x236ced['internal']};_0x1ffb06[_0xb3c8('0xec')](function(_0x5ada64){_0x4682d5[_0xb3c8('0x3f')](_['merge']({'channel':_0x5ada64,'type':_0xb3c8('0xef'),'data1':_0x4e3d8e[_0xb3c8('0x53')][_0xb3c8('0xf0')],'data2':_0x120b60},_0xc5eae4));if(_0x236ced[_0xb3c8('0x8d')]){_0x30bf74[_0xb3c8('0x3f')](_['merge']({'channel':_0x5ada64,'type':_0xb3c8('0xf1'),'data1':_0xb3c8('0xf2')},_0xc5eae4));}});return db[_0xb3c8('0xeb')][_0xb3c8('0x78')](_0x4682d5[_0xb3c8('0xb9')](_0x30bf74),{'individualHooks':!![]});}})[_0xb3c8('0x1d')](function(){if(_0x236ced){return _0x236ced[_0xb3c8('0x19')]({'online':!![],'lastLoginAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x236ced[_0xb3c8('0x8d')]||![],'mailPause':_0x236ced[_0xb3c8('0x8d')]||![],'chatPause':_0x236ced[_0xb3c8('0x8d')]||![],'faxPause':_0x236ced[_0xb3c8('0x8d')]||![],'smsPause':_0x236ced[_0xb3c8('0x8d')]||![],'openchannelPause':_0x236ced['loginInPause']||![],'whatsappPause':_0x236ced[_0xb3c8('0x8d')]||![],'pauseType':_0x236ced[_0xb3c8('0x8d')]?_0xb3c8('0xf2'):null,'interface':_0x120b60,'lastPauseAt':moment()['format'](_0xb3c8('0xee'))});}})[_0xb3c8('0x1d')](function(_0x12957e){if(_0x4e3d8e[_0xb3c8('0xf3')]){return _0x697397();}else{return Promise['resolve'](_0x12957e)['then'](respondWithResult(_0x508174,null));}})[_0xb3c8('0x4b')](handleError(_0x508174,null));};exports[_0xb3c8('0xf4')]=function(_0xd1afb3,_0x2606c2){var _0x13027e;return db[_0xb3c8('0x2e')][_0xb3c8('0x25')]({'where':{'id':_0xd1afb3[_0xb3c8('0x4c')]['id'],'role':_0xb3c8('0x1b')},'attributes':['id',_0xb3c8('0x26'),'role']})['then'](handleEntityNotFound(_0x2606c2,null))[_0xb3c8('0x1d')](function(_0x5d53c8){if(_0x5d53c8){_0x13027e=_0x5d53c8;return db[_0xb3c8('0xa2')][_0xb3c8('0x28')]({'where':{'membername':_0x13027e['name']},'individualHooks':!![]});}})[_0xb3c8('0x1d')](function(){return db[_0xb3c8('0xeb')][_0xb3c8('0x7c')]({'where':{'membername':_0x13027e[_0xb3c8('0x26')],'exitAt':null}});})['then'](function(_0x2f6365){var _0x441592=[];_0x2f6365['forEach'](function(_0x2c55ba){_0x441592[_0xb3c8('0x3f')](_0x2c55ba[_0xb3c8('0x19')]({'exitAt':moment()[_0xb3c8('0x99')]('YYYY-MM-DD\x20HH:mm:ss')}));});return Promise[_0xb3c8('0x4a')](_0x441592);})[_0xb3c8('0x1d')](function(){return _0x13027e['update']({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0xb3c8('0x1d')](respondWithResult(_0x2606c2,null))[_0xb3c8('0x4b')](handleError(_0x2606c2,null));};exports[_0xb3c8('0xf5')]=function(_0x2466ec,_0x4f0bed){var _0x519c76;return db[_0xb3c8('0xa2')][_0xb3c8('0x19')]({'paused':0x1},{'where':{'UserId':_0x2466ec['params']['id']},'individualHooks':!![]})['then'](function(){return db[_0xb3c8('0x2e')][_0xb3c8('0x25')]({'where':{'id':_0x2466ec[_0xb3c8('0x4c')]['id'],'role':_0xb3c8('0x1b')},'attributes':['id',_0xb3c8('0x26'),_0xb3c8('0x1a'),_0xb3c8('0x58'),'interface',_0xb3c8('0x8c')]});})[_0xb3c8('0x1d')](handleEntityNotFound(_0x4f0bed,null))[_0xb3c8('0x1d')](function(_0x5b48d9){if(_0x5b48d9){_0x519c76=_0x5b48d9;return db[_0xb3c8('0xeb')][_0xb3c8('0x7c')]({'where':{'membername':_0x519c76[_0xb3c8('0x26')],'type':_0xb3c8('0xf1'),'exitAt':null}});}})[_0xb3c8('0x1d')](function(_0x2f4354){if(_0x2f4354[_0xb3c8('0x42')]){var _0x2a28ee=moment()[_0xb3c8('0x99')](_0xb3c8('0xee'));for(var _0x23833b=0x0,_0x405c7f=_0x2f4354[_0xb3c8('0x42')];_0x23833b<_0x405c7f;_0x23833b++){_0x2f4354[_0x23833b]['updateAttributes']({'exitAt':_0x2a28ee});}}})[_0xb3c8('0x1d')](function(){var _0x22854c=[];var _0x223f42=utils[_0xb3c8('0xed')]();_0x223f42[_0xb3c8('0xec')](function(_0x213d09){_0x22854c[_0xb3c8('0x3f')]({'channel':_0x213d09,'membername':_0x519c76[_0xb3c8('0x26')],'interface':_[_0xb3c8('0x5e')](_0x519c76[_0xb3c8('0x8e')])?util[_0xb3c8('0x99')](_0xb3c8('0xe2'),_0x519c76[_0xb3c8('0x26')]):_0x519c76[_0xb3c8('0x8e')],'type':_0xb3c8('0xf1'),'enterAt':moment()[_0xb3c8('0x99')](_0xb3c8('0xee')),'data1':_0x2466ec[_0xb3c8('0x53')][_0xb3c8('0x32')]||_0xb3c8('0xf6'),'role':_0x519c76[_0xb3c8('0x1a')],'internal':_0x519c76[_0xb3c8('0x58')]});});return db[_0xb3c8('0xeb')][_0xb3c8('0x78')](_0x22854c,{'individualHooks':!![]});})[_0xb3c8('0x1d')](function(){return _0x519c76['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x2466ec[_0xb3c8('0x53')][_0xb3c8('0x32')]||_0xb3c8('0xf6'),'lastPauseAt':moment()[_0xb3c8('0x99')](_0xb3c8('0xee'))});})[_0xb3c8('0x1d')](respondWithResult(_0x4f0bed,null))['catch'](handleError(_0x4f0bed,null));};exports[_0xb3c8('0xf7')]=function(_0x1c953c,_0x43e19c){if(_0x1c953c[_0xb3c8('0x53')][_0xb3c8('0x9d')]&&!utils[_0xb3c8('0x9e')](_0x1c953c[_0xb3c8('0x53')][_0xb3c8('0x9d')])){throw new APIBadRequestError(util[_0xb3c8('0x99')](_0xb3c8('0xf8'),_0x1c953c[_0xb3c8('0x53')][_0xb3c8('0x9d')]));}return db[_0xb3c8('0x2e')][_0xb3c8('0x25')]({'where':{'id':_0x1c953c[_0xb3c8('0x4c')]['id']},'attributes':['id','name','role',_0xb3c8('0x58'),_0xb3c8('0x8e'),_0xb3c8('0x8c'),'voicePause',_0xb3c8('0xf9'),'chatPause','faxPause',_0xb3c8('0xfa'),_0xb3c8('0xfb'),_0xb3c8('0xfc'),'pauseType','lastPauseAt']})[_0xb3c8('0x1d')](function(_0x238343){if(!_0x238343){throw new APINotFoundError(util['format'](_0xb3c8('0xbb'),_0x1c953c[_0xb3c8('0x4c')]['id']));}return _0x238343[_0xb3c8('0xf7')](_0x1c953c[_0xb3c8('0x53')]['channel']);})['then'](respondWithResult(_0x43e19c,null))[_0xb3c8('0x4b')](APIHandleError(_0x43e19c));};exports[_0xb3c8('0xfd')]=function(_0x9b8aec,_0x376b0b){var _0x2a52b7={};var _0x34beed={};var _0x1c4fd7;var _0x787280;return db[_0xb3c8('0x2e')]['findOne']({'where':{'id':_0x9b8aec[_0xb3c8('0x4c')]['id']}})['then'](handleEntityNotFound(_0x376b0b,null))['then'](function(_0xf161d9){if(_0xf161d9){_0x1c4fd7=_0xf161d9;_0x34beed[_0xb3c8('0xc4')]=_[_0xb3c8('0xc5')](db[_0xb3c8('0xfe')][_0xb3c8('0x2f')]);_0x34beed[_0xb3c8('0x3b')]=_[_0xb3c8('0xc5')](_0x9b8aec[_0xb3c8('0x3b')]);_0x34beed[_0xb3c8('0xc7')]=_['intersection'](_0x34beed[_0xb3c8('0xc4')],_0x34beed[_0xb3c8('0x3b')]);_0x2a52b7[_0xb3c8('0x3e')]=_['intersection'](_0x34beed[_0xb3c8('0xc4')],qs[_0xb3c8('0xc9')](_0x9b8aec[_0xb3c8('0x3b')][_0xb3c8('0xc9')]));_0x2a52b7[_0xb3c8('0x3e')]=_0x2a52b7[_0xb3c8('0x3e')]['length']?_0x2a52b7[_0xb3c8('0x3e')]:_0x34beed['model'];_0x2a52b7[_0xb3c8('0xca')]=qs[_0xb3c8('0xcb')](_0x9b8aec[_0xb3c8('0x3b')][_0xb3c8('0xcb')]);_0x2a52b7[_0xb3c8('0x3a')]=qs[_0xb3c8('0xc7')](_[_0xb3c8('0xd0')](_0x9b8aec[_0xb3c8('0x3b')],_0x34beed['filters']));if(_0x9b8aec['query'][_0xb3c8('0x23')]){_0x2a52b7['where']=_[_0xb3c8('0x50')](_0x2a52b7[_0xb3c8('0x3a')],{'$or':_['map'](_0x2a52b7[_0xb3c8('0x3e')],function(_0x7ed8c6){var _0x648009={};_0x648009[_0x7ed8c6]={'$like':'%'+_0x9b8aec[_0xb3c8('0x3b')][_0xb3c8('0x23')]+'%'};return _0x648009;})});}_0x2a52b7=_[_0xb3c8('0x50')]({},_0x2a52b7,_0x9b8aec[_0xb3c8('0x51')]);return _0x1c4fd7[_0xb3c8('0xfd')](_0x2a52b7);}})[_0xb3c8('0x1d')](function(_0x5aed65){if(_0x5aed65){_0x787280=_0x5aed65['length'];if(!_0x9b8aec[_0xb3c8('0x3b')]['hasOwnProperty'](_0xb3c8('0xcd'))){_0x2a52b7['limit']=qs[_0xb3c8('0x15')](_0x9b8aec['query'][_0xb3c8('0x15')]);_0x2a52b7['offset']=qs[_0xb3c8('0x13')](_0x9b8aec[_0xb3c8('0x3b')][_0xb3c8('0x13')]);}return _0x1c4fd7[_0xb3c8('0xfd')](_0x2a52b7);}})[_0xb3c8('0x1d')](function(_0x4d9856){if(_0x4d9856){return _0x4d9856?{'count':_0x787280,'rows':_0x4d9856}:null;}})[_0xb3c8('0x1d')](respondWithResult(_0x376b0b,null))['catch'](handleError(_0x376b0b,null));};exports[_0xb3c8('0xff')]=function(_0x2310e3,_0xddbc79){var _0x5311f6=_0x2310e3[_0xb3c8('0x4c')]['id'];var _0x52c251=_0x2310e3['body']?_0x2310e3[_0xb3c8('0x53')][_0xb3c8('0x56')]:null;var _0x31d404=[];return Promise[_0xb3c8('0x100')]()[_0xb3c8('0x1d')](function(){if(!_0x52c251)throw new APIBadRequestError('Body\x20parameter\x20\x27ids\x27\x20is\x20required');})[_0xb3c8('0x1d')](function(){return db[_0xb3c8('0x2e')][_0xb3c8('0x88')]({'where':{'id':_0x5311f6}});})[_0xb3c8('0x1d')](function(_0x314828){if(!_0x314828)throw new APINotFoundError(util[_0xb3c8('0x99')](_0xb3c8('0xbb'),_0x2310e3['params']['id']));return db[_0xb3c8('0x60')][_0xb3c8('0x101')](function(_0x59f083){return _0x314828[_0xb3c8('0xff')](_0x52c251,{'transaction':_0x59f083})[_0xb3c8('0x1d')](function(){return db[_0xb3c8('0xfe')][_0xb3c8('0x7c')]({'where':{'id':{'$in':_0x52c251}}});})[_0xb3c8('0x1d')](function(_0x154181){var _0x24a065=_[_0xb3c8('0x30')](_0x154181,function(_0x4bde7c){return _0x4bde7c[_0xb3c8('0x102')]();});return Promise[_0xb3c8('0x4a')](_0x24a065);})[_0xb3c8('0x1d')](function(_0x1ac193){_0x31d404=_[_0xb3c8('0x103')](_0x1ac193);var _0x30faa2=_['map'](_0x31d404,function(_0x24c6a3){return _0x24c6a3[_0xb3c8('0x104')](_0x314828['id'],{'transaction':_0x59f083});});return Promise['all'](_0x30faa2);})[_0xb3c8('0x1d')](function(){if(!_0x314828[_0xb3c8('0x8c')])return;var _0x474e7e=_[_0xb3c8('0x23')](_0x31d404,function(_0x3b6121){return _0x3b6121[_0xb3c8('0x105')](_0xb3c8('0x9d'))===_0xb3c8('0x106');});var _0x3153af=_['map'](_0x474e7e,function(_0x5c5c27){return db[_0xb3c8('0xa2')][_0xb3c8('0x9b')]({'membername':_0x314828[_0xb3c8('0x26')],'UserId':_0x314828['id'],'queue_name':_0x5c5c27[_0xb3c8('0x26')],'VoiceQueueId':_0x5c5c27['id'],'interface':_['isNil'](_0x314828['interface'])?util[_0xb3c8('0x99')]('SIP/%s',_0x314828[_0xb3c8('0x26')]):_0x314828[_0xb3c8('0x8e')],'paused':_0x314828[_0xb3c8('0x9a')]||![],'penalty':_0x314828[_0xb3c8('0x94')]},{'transaction':_0x59f083});});return Promise[_0xb3c8('0x4a')](_0x3153af);})[_0xb3c8('0x1d')](function(){return db[_0xb3c8('0x107')][_0xb3c8('0x7c')]({'where':{'teamId':{'$in':_0x52c251}}});})[_0xb3c8('0x1d')](function(_0x245028){var _0x3ea086=_[_0xb3c8('0x30')](_0x245028,function(_0x48cda9){return db['UserVoicePrefix'][_0xb3c8('0x6e')]({'UserId':_0x314828['id'],'VoicePrefixId':_0x48cda9[_0xb3c8('0x108')]},{'transaction':_0x59f083});});return Promise['all'](_0x3ea086);});});})['then'](function(){for(var _0x36951b=0x0;_0x36951b<_0x31d404[_0xb3c8('0x42')];_0x36951b++){var _0xa02cd6=_0x31d404[_0x36951b]['getDataValue']('channel');var _0x169095=_0xa02cd6+_0xb3c8('0x95');socket[_0xb3c8('0x1c')]('user'+_0xa02cd6+_0xb3c8('0x96'),{'UserId':_0x5311f6,['queueField']:_0x31d404[_0x36951b]['id']});}})[_0xb3c8('0x1d')](respondWithStatusCode(_0xddbc79,null))[_0xb3c8('0x4b')](APIHandleError(_0xddbc79));};exports[_0xb3c8('0x109')]=function(_0x5d07d1,_0x116d14){var _0xfd0469=_0x5d07d1[_0xb3c8('0x4c')]['id'];var _0x572e60=null;if(_0x5d07d1['query'][_0xb3c8('0x56')]){_0x572e60=_['isArray'](_0x5d07d1[_0xb3c8('0x3b')][_0xb3c8('0x56')])?_0x5d07d1[_0xb3c8('0x3b')][_0xb3c8('0x56')]:[_0x5d07d1[_0xb3c8('0x3b')][_0xb3c8('0x56')]];}var _0x2690d7=[];return Promise[_0xb3c8('0x100')]()['then'](function(){if(!_0x572e60)throw new APIBadRequestError(_0xb3c8('0x10a'));})[_0xb3c8('0x1d')](function(){return db[_0xb3c8('0x2e')][_0xb3c8('0x88')]({'where':{'id':_0xfd0469}});})['then'](function(_0x2140cd){if(!_0x2140cd)throw new APINotFoundError(util[_0xb3c8('0x99')](_0xb3c8('0xbb'),_0x5d07d1[_0xb3c8('0x4c')]['id']));return db['sequelize']['transaction'](function(_0x4f5da3){return _0x2140cd[_0xb3c8('0x109')](_0x572e60,{'transaction':_0x4f5da3})[_0xb3c8('0x1d')](function(){return db[_0xb3c8('0xfe')][_0xb3c8('0x7c')]({'where':{'id':{'$in':_0x572e60}}});})[_0xb3c8('0x1d')](function(_0x5e760b){var _0x2d2932=_[_0xb3c8('0x30')](_0x5e760b,function(_0x2a921c){return _0x2a921c[_0xb3c8('0x102')]();});return Promise[_0xb3c8('0x4a')](_0x2d2932);})[_0xb3c8('0x1d')](function(_0xc09198){_0x2690d7=_[_0xb3c8('0x103')](_0xc09198);var _0x1cc3dd=_['map'](_0x2690d7,function(_0x52824c){return _0x52824c[_0xb3c8('0x10b')](_0x2140cd['id'],{'transaction':_0x4f5da3});});return Promise[_0xb3c8('0x4a')](_0x1cc3dd);})[_0xb3c8('0x1d')](function(){if(!_0x2140cd['online'])return;var _0x21f7f1=_['filter'](_0x2690d7,function(_0x311641){return _0x311641[_0xb3c8('0x105')](_0xb3c8('0x9d'))==='Voice';});var _0x2f50a2=_[_0xb3c8('0x30')](_0x21f7f1,function(_0x102644){return db[_0xb3c8('0xa2')][_0xb3c8('0x28')]({'where':{'VoiceQueueId':_0x102644['id'],'UserId':_0x2140cd['id']},'transaction':_0x4f5da3});});return Promise['all'](_0x2f50a2);})['then'](function(){return db[_0xb3c8('0x107')][_0xb3c8('0x7c')]({'where':{'teamId':{'$in':_0x572e60}}});})[_0xb3c8('0x1d')](function(_0x149efa){var _0x4fcad4=_[_0xb3c8('0x30')](_0x149efa,function(_0x2c49b7){return db['UserVoicePrefix'][_0xb3c8('0x28')]({'where':{'UserId':_0x2140cd['id'],'VoicePrefixId':_0x2c49b7['VoicePrefixId']}},{'transaction':_0x4f5da3});});return Promise['all'](_0x4fcad4);});});})[_0xb3c8('0x1d')](function(){for(var _0x5249a3=0x0;_0x5249a3<_0x2690d7[_0xb3c8('0x42')];_0x5249a3++){var _0x1a5048=_0x2690d7[_0x5249a3][_0xb3c8('0x105')](_0xb3c8('0x9d'));var _0x4b7446=_0x1a5048+'QueueId';socket['emit']('user'+_0x1a5048+'Queue:remove',{'UserId':_0xfd0469,['queueField']:_0x2690d7[_0x5249a3]['id']});}})[_0xb3c8('0x1d')](respondWithStatusCode(_0x116d14,null))[_0xb3c8('0x4b')](APIHandleError(_0x116d14));};exports[_0xb3c8('0x10c')]=function(_0x3a9827,_0x35358c){var _0x5a5c59={};var _0x5d990a={};var _0x2f6ede;var _0x21d5a4;return db[_0xb3c8('0x2e')][_0xb3c8('0x88')]({'where':{'id':_0x3a9827[_0xb3c8('0x4c')]['id']}})[_0xb3c8('0x1d')](handleEntityNotFound(_0x35358c,null))[_0xb3c8('0x1d')](function(_0x1ce34c){if(_0x1ce34c){_0x2f6ede=_0x1ce34c;_0x5d990a[_0xb3c8('0xc4')]=_[_0xb3c8('0xc5')](db[_0xb3c8('0xbd')][_0xb3c8('0x2f')]);_0x5d990a['query']=_[_0xb3c8('0xc5')](_0x3a9827[_0xb3c8('0x3b')]);_0x5d990a['filters']=_['intersection'](_0x5d990a[_0xb3c8('0xc4')],_0x5d990a[_0xb3c8('0x3b')]);_0x5a5c59['attributes']=_[_0xb3c8('0xc8')](_0x5d990a[_0xb3c8('0xc4')],qs['fields'](_0x3a9827[_0xb3c8('0x3b')][_0xb3c8('0xc9')]));_0x5a5c59[_0xb3c8('0x3e')]=_0x5a5c59[_0xb3c8('0x3e')][_0xb3c8('0x42')]?_0x5a5c59[_0xb3c8('0x3e')]:_0x5d990a[_0xb3c8('0xc4')];_0x5a5c59[_0xb3c8('0xca')]=qs[_0xb3c8('0xcb')](_0x3a9827[_0xb3c8('0x3b')][_0xb3c8('0xcb')]);_0x5a5c59['where']=qs[_0xb3c8('0xc7')](_['pick'](_0x3a9827['query'],_0x5d990a[_0xb3c8('0xc7')]));if(_0x3a9827[_0xb3c8('0x3b')][_0xb3c8('0x23')]){_0x5a5c59[_0xb3c8('0x3a')]=_[_0xb3c8('0x50')](_0x5a5c59['where'],{'$or':_[_0xb3c8('0x30')](_0x5a5c59['attributes'],function(_0x2f3215){var _0x18b5a5={};_0x18b5a5[_0x2f3215]={'$like':'%'+_0x3a9827[_0xb3c8('0x3b')][_0xb3c8('0x23')]+'%'};return _0x18b5a5;})});}_0x5a5c59=_['merge']({},_0x5a5c59,_0x3a9827['options']);return _0x2f6ede['getLists'](_0x5a5c59);}})[_0xb3c8('0x1d')](function(_0x4e2926){if(_0x4e2926){_0x21d5a4=_0x4e2926[_0xb3c8('0x42')];if(!_0x3a9827[_0xb3c8('0x3b')][_0xb3c8('0xbc')](_0xb3c8('0xcd'))){_0x5a5c59[_0xb3c8('0x15')]=qs['limit'](_0x3a9827[_0xb3c8('0x3b')][_0xb3c8('0x15')]);_0x5a5c59['offset']=qs['offset'](_0x3a9827[_0xb3c8('0x3b')][_0xb3c8('0x13')]);}return _0x2f6ede['getLists'](_0x5a5c59);}})[_0xb3c8('0x1d')](function(_0x99ac82){if(_0x99ac82){return _0x99ac82?{'count':_0x21d5a4,'rows':_0x99ac82}:null;}})['then'](respondWithResult(_0x35358c,null))[_0xb3c8('0x4b')](handleError(_0x35358c,null));};exports[_0xb3c8('0x10d')]=function(_0x1561f7,_0x5ba362){var _0x2e11d5={};var _0x45c861={};var _0x3c8b18;return db['User'][_0xb3c8('0x88')]({'where':{'id':_0x1561f7[_0xb3c8('0x4c')]['id']}})[_0xb3c8('0x1d')](handleEntityNotFound(_0x5ba362,null))['then'](function(_0x3eb272){if(_0x3eb272){_0x3c8b18=_0x3eb272;_0x45c861[_0xb3c8('0xc4')]=_[_0xb3c8('0xc5')](db[_0xb3c8('0x2e')][_0xb3c8('0x2f')]);_0x45c861[_0xb3c8('0x3b')]=_[_0xb3c8('0xc5')](_0x1561f7[_0xb3c8('0x3b')]);_0x45c861[_0xb3c8('0xc7')]=_[_0xb3c8('0xc8')](_0x45c861[_0xb3c8('0xc4')],_0x45c861['query']);_0x2e11d5[_0xb3c8('0x3e')]=_[_0xb3c8('0xc8')](_0x45c861['model'],qs['fields'](_0x1561f7[_0xb3c8('0x3b')][_0xb3c8('0xc9')]));_0x2e11d5[_0xb3c8('0x3e')]=_0x2e11d5[_0xb3c8('0x3e')][_0xb3c8('0x42')]?_0x2e11d5[_0xb3c8('0x3e')]:_0x45c861[_0xb3c8('0xc4')];_0x2e11d5[_0xb3c8('0xca')]=qs[_0xb3c8('0xcb')](_0x1561f7[_0xb3c8('0x3b')][_0xb3c8('0xcb')]);_0x2e11d5[_0xb3c8('0x3a')]=qs[_0xb3c8('0xc7')](_[_0xb3c8('0xd0')](_0x1561f7[_0xb3c8('0x3b')],_0x45c861[_0xb3c8('0xc7')]));if(_0x1561f7[_0xb3c8('0x3b')][_0xb3c8('0x23')]){_0x2e11d5[_0xb3c8('0x3a')]=_[_0xb3c8('0x50')](_0x2e11d5['where'],{'$or':_[_0xb3c8('0x30')](_0x2e11d5['attributes'],function(_0x3cf563){var _0xe2fcb2={};_0xe2fcb2[_0x3cf563]={'$like':'%'+_0x1561f7[_0xb3c8('0x3b')]['filter']+'%'};return _0xe2fcb2;})});}_0x2e11d5['model']=db['User'];_0x2e11d5['as']=_0xb3c8('0x22');_0x2e11d5=_[_0xb3c8('0x50')]({},_0x2e11d5,_0x1561f7[_0xb3c8('0x51')]);return _0x3c8b18[_0xb3c8('0xe9')]({'include':[_0x2e11d5]});}})[_0xb3c8('0x1d')](function(_0x43d750){if(_0x43d750){var _0x30508a={},_0x10a9e1=[];for(var _0x43b649=0x0;_0x43b649<_0x43d750[_0xb3c8('0x42')];_0x43b649+=0x1){for(var _0xa35bd0=0x0,_0x36940c;_0xa35bd0<_0x43d750[_0x43b649][_0xb3c8('0x22')][_0xb3c8('0x42')];_0xa35bd0+=0x1){_0x36940c=_0x43d750[_0x43b649]['Agents'][_0xa35bd0][_0xb3c8('0x1e')]({'plain':!![]});_0x30508a[_0x36940c['id']]=_0x36940c;}}_0x30508a=_['values'](_0x30508a);for(var _0x54c012=qs[_0xb3c8('0x13')](_0x1561f7[_0xb3c8('0x3b')][_0xb3c8('0x13')]);_0x54c012<_0x30508a[_0xb3c8('0x42')]&&_0x10a9e1[_0xb3c8('0x42')]=_0x437da6[_0x40da('0x4a')]){throw new Error(_0x40da('0x4b'));}})[_0x40da('0x12')](function(){if(_0x153dd8){return db[_0x40da('0x25')][_0x40da('0x42')]({'where':{'membername':_0x153dd8[_0x40da('0x1e')]},'individualHooks':!![]});}})['then'](function(){if(_0x153dd8){return _0x153dd8[_0x40da('0x4c')]({'raw':!![]});}})[_0x40da('0x12')](function(_0x5b0557){if(_0x153dd8){if(_0x5b0557){var _0x568c36=[];_0x196b7d=_0x5b0557;if(_0x196b7d['length']){for(var _0x1d16b0=0x0;_0x1d16b0<_0x196b7d[_0x40da('0x4d')];_0x1d16b0++){_0x568c36['push'](db[_0x40da('0x25')][_0x40da('0x4e')]({'membername':_0x153dd8[_0x40da('0x1e')],'UserId':_0x153dd8['id'],'queue_name':_0x196b7d[_0x1d16b0][_0x40da('0x1e')],'VoiceQueueId':_0x196b7d[_0x1d16b0]['id'],'interface':_0x3b6f55,'paused':_0x153dd8['loginInPause']||![],'penalty':_0x196b7d[_0x1d16b0][_0x40da('0x4f')]||0x0}));}return BPromise[_0x40da('0x43')](_0x568c36);}}}})[_0x40da('0x12')](function(){if(_0x153dd8){return db[_0x40da('0x27')][_0x40da('0xb')]({'where':{'membername':_0x153dd8[_0x40da('0x1e')],'exitAt':null}});}})[_0x40da('0x12')](function(_0x31a305){if(_0x153dd8){if(_0x31a305&&_0x31a305[_0x40da('0x4d')]){var _0x4b54f=[];_0x31a305[_0x40da('0x2b')](function(_0x45060a){_0x4b54f[_0x40da('0x2c')](_0x45060a[_0x40da('0x26')]({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0x40da('0x43')](_0x4b54f);}}})[_0x40da('0x12')](function(){if(_0x153dd8){var _0x5517f3=[];var _0x2403bf=[];var _0x499cbb=utils[_0x40da('0x50')]();var _0xef10a2={'membername':_0x153dd8[_0x40da('0x1e')],'interface':_0x3b6f55,'enterAt':moment()[_0x40da('0x22')](_0x40da('0x29')),'role':_0x153dd8[_0x40da('0x1f')],'internal':_0x153dd8[_0x40da('0x20')]};_0x499cbb[_0x40da('0x2b')](function(_0x381842){_0x5517f3[_0x40da('0x2c')](_[_0x40da('0x51')]({'channel':_0x381842,'type':_0x40da('0x52'),'data1':'callysquare','data2':_0x3b6f55},_0xef10a2));if(_0x153dd8[_0x40da('0x46')]){_0x2403bf[_0x40da('0x2c')](_[_0x40da('0x51')]({'channel':_0x381842,'type':'PAUSE','data1':_0x40da('0x53')},_0xef10a2));}});return db[_0x40da('0x27')][_0x40da('0x31')](_0x5517f3[_0x40da('0x54')](_0x2403bf),{'individualHooks':!![]});}})[_0x40da('0x12')](function(){if(_0x153dd8){return _0x153dd8[_0x40da('0x26')]({'online':!![],'lastLoginAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x153dd8[_0x40da('0x46')]||![],'mailPause':_0x153dd8[_0x40da('0x46')]||![],'chatPause':_0x153dd8[_0x40da('0x46')]||![],'faxPause':_0x153dd8[_0x40da('0x46')]||![],'smsPause':_0x153dd8[_0x40da('0x46')]||![],'openchannelPause':_0x153dd8['loginInPause']||![],'pauseType':_0x153dd8[_0x40da('0x46')]?_0x40da('0x53'):null,'lastPauseAt':moment()['format'](_0x40da('0x29')),'interface':_0x3b6f55});}})[_0x40da('0x12')](function(_0x1b937d){_0x47a4ce(_0x1b937d);})[_0x40da('0x1b')](function(_0x4912ce){_0x5506a8(_0x267202[_0x40da('0x15')](0x1f4,_0x4912ce['message']));});});}; \ No newline at end of file +var _0x90f0=['role','uniqueid','bulkCreate','update','UnpauseUser','resolve','channel','isValidChannel','Channel\x20parameter\x20%s\x20is\x20invalid','findOne','voicePause','mailPause','chatPause','faxPause','openchannelPause','smsPause','whatsappPause','pauseType','lastPauseAt','system','destroy','forEach','all','LoginUser','phone','loginInPause','SIP/%s','count','agent','agents','Maximum\x20login\x20has\x20been\x20reached','getVoiceQueues','UserVoiceQueue.penalty','merge','LOGIN','LOGININPAUSE','concat','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','redis','defaults','localhost','socket.io-emitter','./user.socket','register','GetUser','User','options','where','attributes','limit','include','map','model','then','info','debug','stringify','catch','error','message','find','raw','ShowUser','PauseUser','name','internal','interface','User\x20with\x20id\x20%s\x20not\x20found','params','UserVoiceQueueRt','MemberReport','findAll','PAUSE','format','YYYY-MM-DD\x20HH:mm:ss','length','getChannels','push','isNil','body','type','DEFAULT\x20PAUSE'];(function(_0x5c7e61,_0x1a719d){var _0x17ca66=function(_0x50b936){while(--_0x50b936){_0x5c7e61['push'](_0x5c7e61['shift']());}};_0x17ca66(++_0x1a719d);}(_0x90f0,0x1dd));var _0x090f=function(_0x129ae0,_0x219179){_0x129ae0=_0x129ae0-0x0;var _0x40fdc0=_0x90f0[_0x129ae0];return _0x40fdc0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x090f('0x0'));var BPromise=require(_0x090f('0x1'));var Redis=require(_0x090f('0x2'));var db=require(_0x090f('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x090f('0x4'))(_0x090f('0x5'));var config=require(_0x090f('0x6'));config[_0x090f('0x7')]=_[_0x090f('0x8')](config[_0x090f('0x7')],{'host':_0x090f('0x9'),'port':0x18eb});var socket=require(_0x090f('0xa'))(new Redis(config['redis']));require(_0x090f('0xb'))[_0x090f('0xc')](socket);exports[_0x090f('0xd')]=function(_0xa4dec7){var _0x3fe950=this;return new Promise(function(_0x13469f,_0xd868db){return db[_0x090f('0xe')]['findAll']({'raw':_0xa4dec7[_0x090f('0xf')]?_0xa4dec7['options']['raw']===undefined?!![]:![]:!![],'where':_0xa4dec7[_0x090f('0xf')]?_0xa4dec7['options'][_0x090f('0x10')]||null:null,'attributes':_0xa4dec7[_0x090f('0xf')]?_0xa4dec7[_0x090f('0xf')][_0x090f('0x11')]||null:null,'limit':_0xa4dec7[_0x090f('0xf')]?_0xa4dec7[_0x090f('0xf')][_0x090f('0x12')]||null:null,'include':_0xa4dec7['options']?_0xa4dec7[_0x090f('0xf')][_0x090f('0x13')]?_[_0x090f('0x14')](_0xa4dec7['options'][_0x090f('0x13')],function(_0x406c91){return{'model':db[_0x406c91[_0x090f('0x15')]],'as':_0x406c91['as'],'attributes':_0x406c91[_0x090f('0x11')],'include':_0x406c91[_0x090f('0x13')]?_[_0x090f('0x14')](_0x406c91[_0x090f('0x13')],function(_0x38faaa){return{'model':db[_0x38faaa[_0x090f('0x15')]],'as':_0x38faaa['as'],'attributes':_0x38faaa[_0x090f('0x11')],'include':_0x38faaa['include']?_[_0x090f('0x14')](_0x38faaa['include'],function(_0x583cca){return{'model':db[_0x583cca[_0x090f('0x15')]],'as':_0x583cca['as'],'attributes':_0x583cca[_0x090f('0x11')]};}):[]};}):[]};}):[]:[]})[_0x090f('0x16')](function(_0x3a71ba){logger[_0x090f('0x17')](_0x090f('0xd'),_0xa4dec7);logger[_0x090f('0x18')]('GetUser',_0xa4dec7,JSON[_0x090f('0x19')](_0x3a71ba));_0x13469f(_0x3a71ba);})[_0x090f('0x1a')](function(_0x8a697){logger[_0x090f('0x1b')](_0x090f('0xd'),_0x8a697[_0x090f('0x1c')],_0xa4dec7);_0xd868db(_0x3fe950[_0x090f('0x1b')](0x1f4,_0x8a697[_0x090f('0x1c')]));});});};exports['ShowUser']=function(_0x2ddefc){var _0x5d826b=this;return new Promise(function(_0x43a24f,_0x3a35a5){return db[_0x090f('0xe')][_0x090f('0x1d')]({'raw':_0x2ddefc[_0x090f('0xf')]?_0x2ddefc[_0x090f('0xf')][_0x090f('0x1e')]===undefined?!![]:![]:!![],'where':_0x2ddefc[_0x090f('0xf')]?_0x2ddefc['options']['where']||null:null,'attributes':_0x2ddefc[_0x090f('0xf')]?_0x2ddefc['options'][_0x090f('0x11')]||null:null,'include':_0x2ddefc['options']?_0x2ddefc[_0x090f('0xf')][_0x090f('0x13')]?_[_0x090f('0x14')](_0x2ddefc[_0x090f('0xf')]['include'],function(_0x1151cd){return{'model':db[_0x1151cd['model']],'as':_0x1151cd['as'],'attributes':_0x1151cd['attributes'],'include':_0x1151cd[_0x090f('0x13')]?_[_0x090f('0x14')](_0x1151cd[_0x090f('0x13')],function(_0x20626a){return{'model':db[_0x20626a[_0x090f('0x15')]],'as':_0x20626a['as'],'attributes':_0x20626a['attributes'],'include':_0x20626a['include']?_['map'](_0x20626a['include'],function(_0x4476c1){return{'model':db[_0x4476c1[_0x090f('0x15')]],'as':_0x4476c1['as'],'attributes':_0x4476c1[_0x090f('0x11')]};}):[]};}):[]};}):[]:[]})[_0x090f('0x16')](function(_0x1ab9f4){logger[_0x090f('0x17')](_0x090f('0x1f'),_0x2ddefc);logger['debug'](_0x090f('0x1f'),_0x2ddefc,JSON[_0x090f('0x19')](_0x1ab9f4));_0x43a24f(_0x1ab9f4);})['catch'](function(_0x5b46e6){logger['error'](_0x090f('0x1f'),_0x5b46e6[_0x090f('0x1c')],_0x2ddefc);_0x3a35a5(_0x5d826b[_0x090f('0x1b')](0x1f4,_0x5b46e6[_0x090f('0x1c')]));});});};exports[_0x090f('0x20')]=function(_0x21bef7){var _0x5dd11a;return db['User'][_0x090f('0x1d')]({'where':_0x21bef7[_0x090f('0xf')][_0x090f('0x10')]||{},'attributes':['id',_0x090f('0x21'),'role',_0x090f('0x22'),_0x090f('0x23')]})[_0x090f('0x16')](function(_0x2b8ca4){if(!_0x2b8ca4){throw new Error(util['format'](_0x090f('0x24'),_0x21bef7[_0x090f('0x25')]['id']));}_0x5dd11a=_0x2b8ca4;return db[_0x090f('0x26')]['update']({'paused':0x1},{'where':{'UserId':_0x5dd11a['id']},'individualHooks':!![]});})['then'](function(){return db[_0x090f('0x27')][_0x090f('0x28')]({'where':{'membername':_0x5dd11a[_0x090f('0x21')],'type':_0x090f('0x29'),'exitAt':null}});})['then'](function(_0x53e0fc){if(_0x53e0fc&&_0x53e0fc['length']){var _0x514e27=moment()[_0x090f('0x2a')](_0x090f('0x2b'));for(var _0x5e2711=0x0,_0x11068e=_0x53e0fc[_0x090f('0x2c')];_0x5e2711<_0x11068e;_0x5e2711++){_0x53e0fc[_0x5e2711]['updateAttributes']({'exitAt':_0x514e27});}}})[_0x090f('0x16')](function(){var _0x2f2a23=[];var _0x4685c0=utils[_0x090f('0x2d')]();_0x4685c0['forEach'](function(_0x55ad98){_0x2f2a23[_0x090f('0x2e')]({'channel':_0x55ad98,'membername':_0x5dd11a[_0x090f('0x21')],'interface':_[_0x090f('0x2f')](_0x5dd11a[_0x090f('0x23')])?util[_0x090f('0x2a')]('SIP/%s',_0x5dd11a[_0x090f('0x21')]):_0x5dd11a[_0x090f('0x23')],'type':_0x090f('0x29'),'enterAt':moment()[_0x090f('0x2a')]('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x21bef7[_0x090f('0x30')][_0x090f('0x31')]||_0x090f('0x32'),'role':_0x5dd11a[_0x090f('0x33')],'internal':_0x5dd11a[_0x090f('0x22')],'uniqueid':_0x21bef7[_0x090f('0x30')][_0x090f('0x34')]||null});});return db['MemberReport'][_0x090f('0x35')](_0x2f2a23,{'individualHooks':!![]});})[_0x090f('0x16')](function(){return _0x5dd11a[_0x090f('0x36')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x21bef7[_0x090f('0x30')][_0x090f('0x31')]||_0x090f('0x32'),'lastPauseAt':moment()['format'](_0x090f('0x2b'))});})['catch'](function(_0x190415){throw _0x190415;});};exports[_0x090f('0x37')]=function(_0x21d6a3){return Promise[_0x090f('0x38')]()[_0x090f('0x16')](function(){if(_0x21d6a3[_0x090f('0x30')][_0x090f('0x39')]&&!utils[_0x090f('0x3a')](_0x21d6a3[_0x090f('0x30')][_0x090f('0x39')])){throw new Error(util['format'](_0x090f('0x3b'),_0x21d6a3['body'][_0x090f('0x39')]));}return db[_0x090f('0xe')][_0x090f('0x3c')]({'where':_0x21d6a3[_0x090f('0xf')][_0x090f('0x10')]||{},'attributes':['id',_0x090f('0x21'),'role','internal',_0x090f('0x23'),'online',_0x090f('0x3d'),_0x090f('0x3e'),_0x090f('0x3f'),_0x090f('0x40'),_0x090f('0x41'),_0x090f('0x42'),_0x090f('0x43'),_0x090f('0x44'),_0x090f('0x45')]});})[_0x090f('0x16')](function(_0x42980b){if(!_0x42980b){throw new Error(util[_0x090f('0x2a')](_0x090f('0x24'),_0x21d6a3[_0x090f('0x25')]['id']));}return _0x42980b['unpause'](_0x21d6a3[_0x090f('0x30')][_0x090f('0x39')],_0x090f('0x46'));})[_0x090f('0x1a')](function(_0x39e38a){throw _0x39e38a;});};exports['LogoutUser']=function(_0x163b9c){var _0xd07efb=this;return new Promise(function(_0x289dfb,_0x393511){var _0x5c32a7;return db[_0x090f('0xe')]['findOne']({'where':_0x163b9c[_0x090f('0xf')]['where']||{},'attributes':['id',_0x090f('0x21')]})['then'](function(_0x58e68a){if(_0x58e68a){_0x5c32a7=_0x58e68a;return db[_0x090f('0x26')][_0x090f('0x47')]({'where':{'membername':_0x5c32a7[_0x090f('0x21')]},'individualHooks':!![]});}})['then'](function(){if(_0x5c32a7){return db['MemberReport'][_0x090f('0x28')]({'where':{'membername':_0x5c32a7[_0x090f('0x21')],'exitAt':null}});}})['then'](function(_0x334975){if(_0x5c32a7){if(_0x334975&&_0x334975['length']){var _0x54a805=[];_0x334975[_0x090f('0x48')](function(_0x2a3ad6){_0x54a805['push'](_0x2a3ad6['update']({'exitAt':moment()[_0x090f('0x2a')](_0x090f('0x2b'))}));});return BPromise[_0x090f('0x49')](_0x54a805);}}})['then'](function(){if(_0x5c32a7){return _0x5c32a7[_0x090f('0x36')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0x090f('0x16')](function(_0x5f2e9e){_0x289dfb(_0x5f2e9e);})[_0x090f('0x1a')](function(_0x2d51f7){_0x393511(_0xd07efb[_0x090f('0x1b')](0x1f4,_0x2d51f7[_0x090f('0x1c')]));});});};exports[_0x090f('0x4a')]=function(_0x35fcb7){var _0x3e479a=this;return new Promise(function(_0x5895e3,_0x216ba8){var _0x43e3f5;var _0x3b8a29;var _0x315dac;var _0x7802c;return db[_0x090f('0xe')][_0x090f('0x3c')]({'where':_0x35fcb7[_0x090f('0xf')]['where']||{},'attributes':['id',_0x090f('0x21'),'role','mobile',_0x090f('0x4b'),_0x090f('0x22'),_0x090f('0x4c'),_0x090f('0x23')]})[_0x090f('0x16')](function(_0x40bc49){if(_0x40bc49){_0x43e3f5=_0x40bc49;_0x7802c=_0x35fcb7[_0x090f('0x30')][_0x090f('0x23')]?_0x35fcb7[_0x090f('0x30')][_0x090f('0x23')]:util[_0x090f('0x2a')](_0x090f('0x4d'),_0x43e3f5['name']);return db[_0x090f('0xe')][_0x090f('0x4e')]({'where':{'role':_0x090f('0x4f'),'online':!![],'id':{'$ne':_0x43e3f5['id']}}});}})[_0x090f('0x16')](function(_0xe0cc01){if(_0xe0cc01){_0x315dac=_0xe0cc01;return require('../../config/license/util')['getLicense']();}})[_0x090f('0x16')](function(_0x4b430b){if(_0x4b430b&&_0x4b430b[_0x090f('0x50')]&&_0x315dac>=_0x4b430b[_0x090f('0x50')]){throw new Error(_0x090f('0x51'));}})[_0x090f('0x16')](function(){if(_0x43e3f5){return db[_0x090f('0x26')][_0x090f('0x47')]({'where':{'membername':_0x43e3f5[_0x090f('0x21')]},'individualHooks':!![]});}})[_0x090f('0x16')](function(){if(_0x43e3f5){return _0x43e3f5[_0x090f('0x52')]({'raw':!![]});}})['then'](function(_0x178fd2){if(_0x43e3f5){if(_0x178fd2){var _0x27c6fc=[];_0x3b8a29=_0x178fd2;if(_0x3b8a29['length']){for(var _0xcc7e6c=0x0;_0xcc7e6c<_0x3b8a29[_0x090f('0x2c')];_0xcc7e6c++){_0x27c6fc[_0x090f('0x2e')](db[_0x090f('0x26')]['upsert']({'membername':_0x43e3f5[_0x090f('0x21')],'UserId':_0x43e3f5['id'],'queue_name':_0x3b8a29[_0xcc7e6c][_0x090f('0x21')],'VoiceQueueId':_0x3b8a29[_0xcc7e6c]['id'],'interface':_0x7802c,'paused':_0x43e3f5[_0x090f('0x4c')]||![],'penalty':_0x3b8a29[_0xcc7e6c][_0x090f('0x53')]||0x0}));}return BPromise['all'](_0x27c6fc);}}}})['then'](function(){if(_0x43e3f5){return db[_0x090f('0x27')]['findAll']({'where':{'membername':_0x43e3f5[_0x090f('0x21')],'exitAt':null}});}})[_0x090f('0x16')](function(_0x9e9fb6){if(_0x43e3f5){if(_0x9e9fb6&&_0x9e9fb6[_0x090f('0x2c')]){var _0x2d6111=[];_0x9e9fb6[_0x090f('0x48')](function(_0x485774){_0x2d6111['push'](_0x485774[_0x090f('0x36')]({'exitAt':moment()[_0x090f('0x2a')](_0x090f('0x2b'))}));});return BPromise['all'](_0x2d6111);}}})[_0x090f('0x16')](function(){if(_0x43e3f5){var _0x20b751=[];var _0x48540b=[];var _0x5cfb4d=utils['getChannels']();var _0x1180b2={'membername':_0x43e3f5['name'],'interface':_0x7802c,'enterAt':moment()['format'](_0x090f('0x2b')),'role':_0x43e3f5[_0x090f('0x33')],'internal':_0x43e3f5[_0x090f('0x22')]};_0x5cfb4d[_0x090f('0x48')](function(_0x52416b){_0x20b751[_0x090f('0x2e')](_[_0x090f('0x54')]({'channel':_0x52416b,'type':_0x090f('0x55'),'data1':'callysquare','data2':_0x7802c},_0x1180b2));if(_0x43e3f5['loginInPause']){_0x48540b['push'](_[_0x090f('0x54')]({'channel':_0x52416b,'type':_0x090f('0x29'),'data1':_0x090f('0x56')},_0x1180b2));}});return db[_0x090f('0x27')][_0x090f('0x35')](_0x20b751[_0x090f('0x57')](_0x48540b),{'individualHooks':!![]});}})['then'](function(){if(_0x43e3f5){return _0x43e3f5[_0x090f('0x36')]({'online':!![],'lastLoginAt':moment()[_0x090f('0x2a')](_0x090f('0x2b')),'voicePause':_0x43e3f5[_0x090f('0x4c')]||![],'mailPause':_0x43e3f5[_0x090f('0x4c')]||![],'chatPause':_0x43e3f5[_0x090f('0x4c')]||![],'faxPause':_0x43e3f5['loginInPause']||![],'smsPause':_0x43e3f5[_0x090f('0x4c')]||![],'openchannelPause':_0x43e3f5[_0x090f('0x4c')]||![],'pauseType':_0x43e3f5[_0x090f('0x4c')]?'LOGININPAUSE':null,'lastPauseAt':moment()[_0x090f('0x2a')](_0x090f('0x2b')),'interface':_0x7802c});}})[_0x090f('0x16')](function(_0x582b69){_0x5895e3(_0x582b69);})[_0x090f('0x1a')](function(_0x2c3f15){_0x216ba8(_0x3e479a[_0x090f('0x1b')](0x1f4,_0x2c3f15[_0x090f('0x1c')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index 3a5629f..8cdcd7d 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 _0x4a72=['register','user:','save','remove','update','emit','removeListener'];(function(_0x37bd26,_0x5ad346){var _0xe83dc4=function(_0x1ac229){while(--_0x1ac229){_0x37bd26['push'](_0x37bd26['shift']());}};_0xe83dc4(++_0x5ad346);}(_0x4a72,0xbf));var _0x24a7=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x4a72[_0x2641f9];return _0x585741;};'use strict';var UserEvents=require('./user.events');var events=[_0x24a7('0x0'),_0x24a7('0x1'),_0x24a7('0x2')];function createListener(_0x2640db,_0x41a9b4){return function(_0x2c91d0){_0x41a9b4[_0x24a7('0x3')](_0x2640db,_0x2c91d0);};}function removeListener(_0x5f11b9,_0xc1b08f){return function(){UserEvents[_0x24a7('0x4')](_0x5f11b9,_0xc1b08f);};}exports[_0x24a7('0x5')]=function(_0x346792){for(var _0x586557=0x0,_0x302e01=events['length'];_0x586557<_0x302e01;_0x586557++){var _0x16d080=events[_0x586557];var _0x55d1b0=createListener(_0x24a7('0x6')+_0x16d080,_0x346792);UserEvents['on'](_0x16d080,_0x55d1b0);}}; \ No newline at end of file +var _0x791a=['remove','update','emit','length','user:','./user.events','save'];(function(_0x268509,_0x196d93){var _0x5de441=function(_0x5ef235){while(--_0x5ef235){_0x268509['push'](_0x268509['shift']());}};_0x5de441(++_0x196d93);}(_0x791a,0x163));var _0xa791=function(_0x1dd533,_0x4f758b){_0x1dd533=_0x1dd533-0x0;var _0x1029e5=_0x791a[_0x1dd533];return _0x1029e5;};'use strict';var UserEvents=require(_0xa791('0x0'));var events=[_0xa791('0x1'),_0xa791('0x2'),_0xa791('0x3')];function createListener(_0x2be82f,_0xa51200){return function(_0x49be4){_0xa51200[_0xa791('0x4')](_0x2be82f,_0x49be4);};}function removeListener(_0x3302c7,_0x36d059){return function(){UserEvents['removeListener'](_0x3302c7,_0x36d059);};}exports['register']=function(_0x1acc49){for(var _0x57c884=0x0,_0x5d4908=events[_0xa791('0x5')];_0x57c884<_0x5d4908;_0x57c884++){var _0x5e519d=events[_0x57c884];var _0x3db8f9=createListener(_0xa791('0x6')+_0x5e519d,_0x1acc49);UserEvents['on'](_0x5e519d,_0x3db8f9);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index 21972f3..b8bcfff 100644 --- a/server/api/userChatQueue/index.js +++ b/server/api/userChatQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x469b7d,_0x4760f8){var _0xc78a4b=function(_0xd48e6c){while(--_0xd48e6c){_0x469b7d['push'](_0x469b7d['shift']());}};_0xc78a4b(++_0x4760f8);}(_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'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x3495b7,_0x3054fd){var _0x55eff5=function(_0x401d35){while(--_0x401d35){_0x3495b7['push'](_0x3495b7['shift']());}};_0x55eff5(++_0x3054fd);}(_0x9c44,0x178));var _0x49c4=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x9c44[_0x3bf83f];return _0x22c4a9;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index ee1e055..d18528f 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 _0x5ab3=['sequelize','exports'];(function(_0xcbaaf7,_0x3924d5){var _0x3f53e9=function(_0x5ace45){while(--_0x5ace45){_0xcbaaf7['push'](_0xcbaaf7['shift']());}};_0x3f53e9(++_0x3924d5);}(_0x5ab3,0x180));var _0x35ab=function(_0x5880d2,_0x540781){_0x5880d2=_0x5880d2-0x0;var _0x53d139=_0x5ab3[_0x5880d2];return _0x53d139;};'use strict';var Sequelize=require(_0x35ab('0x0'));module[_0x35ab('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x0689=['exports'];(function(_0xdf957a,_0x5e3f30){var _0x3aa727=function(_0x5d471b){while(--_0x5d471b){_0xdf957a['push'](_0xdf957a['shift']());}};_0x3aa727(++_0x5e3f30);}(_0x0689,0x161));var _0x9068=function(_0x2d7d81,_0x58179c){_0x2d7d81=_0x2d7d81-0x0;var _0x26e6e6=_0x0689[_0x2d7d81];return _0x26e6e6;};'use strict';var Sequelize=require('sequelize');module[_0x9068('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.model.js b/server/api/userChatQueue/userChatQueue.model.js index 07b3173..e35a8e0 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 _0x9e5f=['./userChatQueue.attributes','exports','UserChatQueue','user_has_chat_queues','util','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x3f99e0,_0x504666){var _0x2c539c=function(_0x54d546){while(--_0x54d546){_0x3f99e0['push'](_0x3f99e0['shift']());}};_0x2c539c(++_0x504666);}(_0x9e5f,0x1ee));var _0xf9e5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9e5f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xf9e5('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xf9e5('0x1'));var BPromise=require('bluebird');var rp=require(_0xf9e5('0x2'));var fs=require('fs');var path=require(_0xf9e5('0x3'));var rimraf=require(_0xf9e5('0x4'));var config=require(_0xf9e5('0x5'));var attributes=require(_0xf9e5('0x6'));module[_0xf9e5('0x7')]=function(_0x4cba11,_0x3a0110){return _0x4cba11['define'](_0xf9e5('0x8'),attributes,{'tableName':_0xf9e5('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x88b6=['../../config/environment','./userChatQueue.attributes','exports','user_has_chat_queues','util','api','bluebird','request-promise','path'];(function(_0x11cbd2,_0x4da7c9){var _0x58643b=function(_0x268b15){while(--_0x268b15){_0x11cbd2['push'](_0x11cbd2['shift']());}};_0x58643b(++_0x4da7c9);}(_0x88b6,0x109));var _0x688b=function(_0x5014de,_0x2e5b19){_0x5014de=_0x5014de-0x0;var _0x19a5c4=_0x88b6[_0x5014de];return _0x19a5c4;};'use strict';var _=require('lodash');var util=require(_0x688b('0x0'));var logger=require('../../config/logger')(_0x688b('0x1'));var moment=require('moment');var BPromise=require(_0x688b('0x2'));var rp=require(_0x688b('0x3'));var fs=require('fs');var path=require(_0x688b('0x4'));var rimraf=require('rimraf');var config=require(_0x688b('0x5'));var attributes=require(_0x688b('0x6'));module[_0x688b('0x7')]=function(_0x32dbb9,_0x82ee96){return _0x32dbb9['define']('UserChatQueue',attributes,{'tableName':_0x688b('0x8'),'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 bf49b92..09dcf4c 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 _0xc15e=['client','http','request','then','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x51909b,_0x1f65b2){var _0x4905eb=function(_0x37f8e4){while(--_0x37f8e4){_0x51909b['push'](_0x51909b['shift']());}};_0x4905eb(++_0x1f65b2);}(_0xc15e,0x186));var _0xec15=function(_0x40b242,_0x38d533){_0x40b242=_0x40b242-0x0;var _0x4b846b=_0xc15e[_0x40b242];return _0x4b846b;};'use strict';var _=require('lodash');var util=require(_0xec15('0x0'));var moment=require(_0xec15('0x1'));var BPromise=require(_0xec15('0x2'));var rs=require(_0xec15('0x3'));var fs=require('fs');var Redis=require(_0xec15('0x4'));var db=require(_0xec15('0x5'))['db'];var utils=require(_0xec15('0x6'));var logger=require(_0xec15('0x7'))(_0xec15('0x8'));var config=require('../../config/environment');var jayson=require(_0xec15('0x9'));var client=jayson[_0xec15('0xa')][_0xec15('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x449bc2,_0x200ed7,_0x3aa0c6){return new BPromise(function(_0x10a089,_0x361c7d){return client[_0xec15('0xc')](_0x449bc2,_0x3aa0c6)[_0xec15('0xd')](function(_0x5ab588){logger['info'](_0xec15('0xe'),_0x200ed7,_0xec15('0xf'));logger[_0xec15('0x10')](_0xec15('0x11'),_0x200ed7,_0xec15('0xf'),JSON[_0xec15('0x12')](_0x5ab588));if(_0x5ab588['error']){if(_0x5ab588[_0xec15('0x13')][_0xec15('0x14')]===0x1f4){logger[_0xec15('0x13')](_0xec15('0xe'),_0x200ed7,_0x5ab588[_0xec15('0x13')]['message']);return _0x361c7d(_0x5ab588[_0xec15('0x13')]['message']);}logger['error'](_0xec15('0xe'),_0x200ed7,_0x5ab588[_0xec15('0x13')][_0xec15('0x15')]);return _0x10a089(_0x5ab588[_0xec15('0x13')][_0xec15('0x15')]);}else{logger[_0xec15('0x16')](_0xec15('0xe'),_0x200ed7,_0xec15('0xf'));_0x10a089(_0x5ab588[_0xec15('0x17')][_0xec15('0x15')]);}})[_0xec15('0x18')](function(_0x36b0a0){logger[_0xec15('0x13')](_0xec15('0xe'),_0x200ed7,_0x36b0a0);_0x361c7d(_0x36b0a0);});});} \ No newline at end of file +var _0x6fb3=['UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','util','randomstring','../../config/utils','../../config/environment','jayson/promise','client','request','then'];(function(_0x20dd46,_0xbe15b4){var _0x2166ba=function(_0x4cc954){while(--_0x4cc954){_0x20dd46['push'](_0x20dd46['shift']());}};_0x2166ba(++_0xbe15b4);}(_0x6fb3,0xa3));var _0x36fb=function(_0x243624,_0x53494a){_0x243624=_0x243624-0x0;var _0x458ad1=_0x6fb3[_0x243624];return _0x458ad1;};'use strict';var _=require('lodash');var util=require(_0x36fb('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x36fb('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x36fb('0x2'));var logger=require('../../config/logger')('rpc');var config=require(_0x36fb('0x3'));var jayson=require(_0x36fb('0x4'));var client=jayson[_0x36fb('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0x469cf3,_0x72c5af,_0x256cef){return new BPromise(function(_0x53a580,_0x1c677a){return client[_0x36fb('0x6')](_0x469cf3,_0x256cef)[_0x36fb('0x7')](function(_0x39ebbb){logger['info'](_0x36fb('0x8'),_0x72c5af,_0x36fb('0x9'));logger[_0x36fb('0xa')](_0x36fb('0xb'),_0x72c5af,_0x36fb('0x9'),JSON[_0x36fb('0xc')](_0x39ebbb));if(_0x39ebbb['error']){if(_0x39ebbb[_0x36fb('0xd')][_0x36fb('0xe')]===0x1f4){logger['error']('UserChatQueue,\x20%s,\x20%s',_0x72c5af,_0x39ebbb[_0x36fb('0xd')][_0x36fb('0xf')]);return _0x1c677a(_0x39ebbb[_0x36fb('0xd')]['message']);}logger[_0x36fb('0xd')](_0x36fb('0x8'),_0x72c5af,_0x39ebbb[_0x36fb('0xd')]['message']);return _0x53a580(_0x39ebbb[_0x36fb('0xd')][_0x36fb('0xf')]);}else{logger[_0x36fb('0x10')](_0x36fb('0x8'),_0x72c5af,'request\x20sent');_0x53a580(_0x39ebbb[_0x36fb('0x11')]['message']);}})[_0x36fb('0x12')](function(_0x340c72){logger[_0x36fb('0xd')](_0x36fb('0x8'),_0x72c5af,_0x340c72);_0x1c677a(_0x340c72);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index 9916470..cdbc8d5 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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x3e9933,_0x14b5a8){var _0x2b1365=function(_0x28fb75){while(--_0x28fb75){_0x3e9933['push'](_0x3e9933['shift']());}};_0x2b1365(++_0x14b5a8);}(_0xedd9,0xfc));var _0x9edd=function(_0x3c4cf2,_0x11a4c5){_0x3c4cf2=_0x3c4cf2-0x0;var _0x57f90d=_0xedd9[_0x3c4cf2];return _0x57f90d;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router; \ No newline at end of file +var _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x116325,_0x52796b){var _0x3ff66e=function(_0x5d61b5){while(--_0x5d61b5){_0x116325['push'](_0x116325['shift']());}};_0x3ff66e(++_0x52796b);}(_0xedd9,0xfc));var _0x9edd=function(_0x45b695,_0xa2c64f){_0x45b695=_0x45b695-0x0;var _0x3abe1e=_0xedd9[_0x45b695];return _0x3abe1e;};'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/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index dae2061..67141b3 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 _0xe053=['sequelize','INTEGER'];(function(_0x2763f2,_0x416af8){var _0x3ef471=function(_0x288aa2){while(--_0x288aa2){_0x2763f2['push'](_0x2763f2['shift']());}};_0x3ef471(++_0x416af8);}(_0xe053,0xbc));var _0x3e05=function(_0x31a371,_0x50828e){_0x31a371=_0x31a371-0x0;var _0x2a5bd6=_0xe053[_0x31a371];return _0x2a5bd6;};'use strict';var Sequelize=require(_0x3e05('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x3e05('0x1')],'defaultValue':0x0},'queue':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xf21b=['sequelize','INTEGER','STRING'];(function(_0x202067,_0x25e057){var _0x4c792e=function(_0xd90a73){while(--_0xd90a73){_0x202067['push'](_0x202067['shift']());}};_0x4c792e(++_0x25e057);}(_0xf21b,0xb4));var _0xbf21=function(_0xcfcb5a,_0x4d40c6){_0xcfcb5a=_0xcfcb5a-0x0;var _0x4503e0=_0xf21b[_0xcfcb5a];return _0x4503e0;};'use strict';var Sequelize=require(_0xbf21('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xbf21('0x1')],'defaultValue':0x0},'assigned':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'queue':{'type':Sequelize[_0xbf21('0x2')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index 48215b9..feda61d 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 _0x3d7a=['bluebird','request-promise','path','../../config/environment','./userFaxQueue.attributes','define','lodash','util','../../config/logger','moment'];(function(_0x593d89,_0x45145f){var _0x4aa403=function(_0x21f674){while(--_0x21f674){_0x593d89['push'](_0x593d89['shift']());}};_0x4aa403(++_0x45145f);}(_0x3d7a,0xc4));var _0xa3d7=function(_0x405385,_0x56f573){_0x405385=_0x405385-0x0;var _0x43837b=_0x3d7a[_0x405385];return _0x43837b;};'use strict';var _=require(_0xa3d7('0x0'));var util=require(_0xa3d7('0x1'));var logger=require(_0xa3d7('0x2'))('api');var moment=require(_0xa3d7('0x3'));var BPromise=require(_0xa3d7('0x4'));var rp=require(_0xa3d7('0x5'));var fs=require('fs');var path=require(_0xa3d7('0x6'));var rimraf=require('rimraf');var config=require(_0xa3d7('0x7'));var attributes=require(_0xa3d7('0x8'));module['exports']=function(_0x2775a5,_0x2005e3){return _0x2775a5[_0xa3d7('0x9')]('UserFaxQueue',attributes,{'tableName':'user_has_fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xddd4=['path','rimraf','../../config/environment','./userFaxQueue.attributes','define','UserFaxQueue','lodash','util','moment','bluebird'];(function(_0x36c4fb,_0x20193c){var _0x13697a=function(_0x23e879){while(--_0x23e879){_0x36c4fb['push'](_0x36c4fb['shift']());}};_0x13697a(++_0x20193c);}(_0xddd4,0x16e));var _0x4ddd=function(_0x42bdad,_0x12836c){_0x42bdad=_0x42bdad-0x0;var _0x122626=_0xddd4[_0x42bdad];return _0x122626;};'use strict';var _=require(_0x4ddd('0x0'));var util=require(_0x4ddd('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x4ddd('0x2'));var BPromise=require(_0x4ddd('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4ddd('0x4'));var rimraf=require(_0x4ddd('0x5'));var config=require(_0x4ddd('0x6'));var attributes=require(_0x4ddd('0x7'));module['exports']=function(_0x3fd222,_0x6296b1){return _0x3fd222[_0x4ddd('0x8')](_0x4ddd('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 2f5acea..3c2b343 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 _0xd21b=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserFaxQueue,\x20%s,\x20%s','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x27753e,_0x5d7345){var _0x1cfc4f=function(_0x3d07f1){while(--_0x3d07f1){_0x27753e['push'](_0x27753e['shift']());}};_0x1cfc4f(++_0x5d7345);}(_0xd21b,0x135));var _0xbd21=function(_0x3aacea,_0x4dec2d){_0x3aacea=_0x3aacea-0x0;var _0xabe687=_0xd21b[_0x3aacea];return _0xabe687;};'use strict';var _=require(_0xbd21('0x0'));var util=require(_0xbd21('0x1'));var moment=require(_0xbd21('0x2'));var BPromise=require(_0xbd21('0x3'));var rs=require(_0xbd21('0x4'));var fs=require('fs');var Redis=require(_0xbd21('0x5'));var db=require(_0xbd21('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xbd21('0x7'))(_0xbd21('0x8'));var config=require(_0xbd21('0x9'));var jayson=require(_0xbd21('0xa'));var client=jayson[_0xbd21('0xb')][_0xbd21('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4ea46d,_0x1c0a0e,_0x4102bc){return new BPromise(function(_0x352b73,_0x4d0b8c){return client[_0xbd21('0xd')](_0x4ea46d,_0x4102bc)[_0xbd21('0xe')](function(_0x3a23e8){logger[_0xbd21('0xf')](_0xbd21('0x10'),_0x1c0a0e,'request\x20sent');logger[_0xbd21('0x11')](_0xbd21('0x12'),_0x1c0a0e,_0xbd21('0x13'),JSON[_0xbd21('0x14')](_0x3a23e8));if(_0x3a23e8[_0xbd21('0x15')]){if(_0x3a23e8[_0xbd21('0x15')][_0xbd21('0x16')]===0x1f4){logger[_0xbd21('0x15')](_0xbd21('0x10'),_0x1c0a0e,_0x3a23e8[_0xbd21('0x15')][_0xbd21('0x17')]);return _0x4d0b8c(_0x3a23e8[_0xbd21('0x15')]['message']);}logger[_0xbd21('0x15')](_0xbd21('0x10'),_0x1c0a0e,_0x3a23e8[_0xbd21('0x15')][_0xbd21('0x17')]);return _0x352b73(_0x3a23e8[_0xbd21('0x15')]['message']);}else{logger[_0xbd21('0xf')](_0xbd21('0x10'),_0x1c0a0e,_0xbd21('0x13'));_0x352b73(_0x3a23e8[_0xbd21('0x18')][_0xbd21('0x17')]);}})[_0xbd21('0x19')](function(_0x5752a6){logger[_0xbd21('0x15')](_0xbd21('0x10'),_0x1c0a0e,_0x5752a6);_0x4d0b8c(_0x5752a6);});});} \ No newline at end of file +var _0xad16=['client','http','request','info','UserFaxQueue,\x20%s,\x20%s','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x4939c9,_0x31de19){var _0x4ac1b9=function(_0x4810bc){while(--_0x4810bc){_0x4939c9['push'](_0x4939c9['shift']());}};_0x4ac1b9(++_0x31de19);}(_0xad16,0x1c5));var _0x6ad1=function(_0x503691,_0x458a17){_0x503691=_0x503691-0x0;var _0x127999=_0xad16[_0x503691];return _0x127999;};'use strict';var _=require(_0x6ad1('0x0'));var util=require('util');var moment=require(_0x6ad1('0x1'));var BPromise=require(_0x6ad1('0x2'));var rs=require(_0x6ad1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6ad1('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x6ad1('0x5'))(_0x6ad1('0x6'));var config=require(_0x6ad1('0x7'));var jayson=require(_0x6ad1('0x8'));var client=jayson[_0x6ad1('0x9')][_0x6ad1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3f1824,_0x21f361,_0x107c81){return new BPromise(function(_0x415864,_0x14462f){return client[_0x6ad1('0xb')](_0x3f1824,_0x107c81)['then'](function(_0x264372){logger[_0x6ad1('0xc')](_0x6ad1('0xd'),_0x21f361,'request\x20sent');logger[_0x6ad1('0xe')](_0x6ad1('0xf'),_0x21f361,'request\x20sent',JSON[_0x6ad1('0x10')](_0x264372));if(_0x264372[_0x6ad1('0x11')]){if(_0x264372[_0x6ad1('0x11')][_0x6ad1('0x12')]===0x1f4){logger[_0x6ad1('0x11')](_0x6ad1('0xd'),_0x21f361,_0x264372[_0x6ad1('0x11')][_0x6ad1('0x13')]);return _0x14462f(_0x264372[_0x6ad1('0x11')][_0x6ad1('0x13')]);}logger[_0x6ad1('0x11')]('UserFaxQueue,\x20%s,\x20%s',_0x21f361,_0x264372[_0x6ad1('0x11')][_0x6ad1('0x13')]);return _0x415864(_0x264372[_0x6ad1('0x11')][_0x6ad1('0x13')]);}else{logger[_0x6ad1('0xc')](_0x6ad1('0xd'),_0x21f361,'request\x20sent');_0x415864(_0x264372['result']['message']);}})[_0x6ad1('0x14')](function(_0x39b099){logger['error'](_0x6ad1('0xd'),_0x21f361,_0x39b099);_0x14462f(_0x39b099);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index ac04ff4..20b6ccb 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x59aeab,_0x2351a7){var _0x5af628=function(_0x2dd9ef){while(--_0x2dd9ef){_0x59aeab['push'](_0x59aeab['shift']());}};_0x5af628(++_0x2351a7);}(_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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x2c249a,_0x4a6096){var _0x3edb89=function(_0x46f832){while(--_0x46f832){_0x2c249a['push'](_0x2c249a['shift']());}};_0x3edb89(++_0x4a6096);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xa9e0[_0x3947c9];return _0x2e7871;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index 2ad1a57..56cea89 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 _0x0d84=['INTEGER','exports'];(function(_0x2574fa,_0x5adae8){var _0x35ceb7=function(_0x43c5ae){while(--_0x43c5ae){_0x2574fa['push'](_0x2574fa['shift']());}};_0x35ceb7(++_0x5adae8);}(_0x0d84,0x16b));var _0x40d8=function(_0x20f7ad,_0x33396f){_0x20f7ad=_0x20f7ad-0x0;var _0x4c9fef=_0x0d84[_0x20f7ad];return _0x4c9fef;};'use strict';var Sequelize=require('sequelize');module[_0x40d8('0x0')]={'penalty':{'type':Sequelize[_0x40d8('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x9a13=['INTEGER','sequelize','exports'];(function(_0x456066,_0x44930c){var _0x5a069a=function(_0x2ed314){while(--_0x2ed314){_0x456066['push'](_0x456066['shift']());}};_0x5a069a(++_0x44930c);}(_0x9a13,0x76));var _0x39a1=function(_0xc0bf1f,_0x38586e){_0xc0bf1f=_0xc0bf1f-0x0;var _0x216555=_0x9a13[_0xc0bf1f];return _0x216555;};'use strict';var Sequelize=require(_0x39a1('0x0'));module[_0x39a1('0x1')]={'penalty':{'type':Sequelize[_0x39a1('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 25ea9a8..33f2f9e 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 _0x6a57=['request-promise','path','rimraf','../../config/environment','exports','define','lodash','util','../../config/logger','api','bluebird'];(function(_0xc1a7e7,_0x4b21dd){var _0x4cf2c0=function(_0x43c844){while(--_0x43c844){_0xc1a7e7['push'](_0xc1a7e7['shift']());}};_0x4cf2c0(++_0x4b21dd);}(_0x6a57,0x103));var _0x76a5=function(_0x1843b3,_0x10995a){_0x1843b3=_0x1843b3-0x0;var _0x3c7de0=_0x6a57[_0x1843b3];return _0x3c7de0;};'use strict';var _=require(_0x76a5('0x0'));var util=require(_0x76a5('0x1'));var logger=require(_0x76a5('0x2'))(_0x76a5('0x3'));var moment=require('moment');var BPromise=require(_0x76a5('0x4'));var rp=require(_0x76a5('0x5'));var fs=require('fs');var path=require(_0x76a5('0x6'));var rimraf=require(_0x76a5('0x7'));var config=require(_0x76a5('0x8'));var attributes=require('./userMailQueue.attributes');module[_0x76a5('0x9')]=function(_0x1b6744,_0x2eade7){return _0x1b6744[_0x76a5('0xa')]('UserMailQueue',attributes,{'tableName':'user_has_mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd720=['exports','define','UserMailQueue','user_has_mail_queues','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./userMailQueue.attributes'];(function(_0x30f6c7,_0x272ea6){var _0x145bc2=function(_0x4efc57){while(--_0x4efc57){_0x30f6c7['push'](_0x30f6c7['shift']());}};_0x145bc2(++_0x272ea6);}(_0xd720,0x1c0));var _0x0d72=function(_0x417634,_0x5c375a){_0x417634=_0x417634-0x0;var _0x219a87=_0xd720[_0x417634];return _0x219a87;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0d72('0x0'))(_0x0d72('0x1'));var moment=require(_0x0d72('0x2'));var BPromise=require(_0x0d72('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0d72('0x4'));var rimraf=require(_0x0d72('0x5'));var config=require(_0x0d72('0x6'));var attributes=require(_0x0d72('0x7'));module[_0x0d72('0x8')]=function(_0x4566,_0x32671a){return _0x4566[_0x0d72('0x9')](_0x0d72('0xa'),attributes,{'tableName':_0x0d72('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 a8dd826..a9c6ba9 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 _0xa41a=['rpc','../../config/environment','client','http','request','then','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x2daed5,_0x220392){var _0xabeea2=function(_0x18a5a9){while(--_0x18a5a9){_0x2daed5['push'](_0x2daed5['shift']());}};_0xabeea2(++_0x220392);}(_0xa41a,0x6b));var _0xaa41=function(_0x41882d,_0x27f926){_0x41882d=_0x41882d-0x0;var _0x13440f=_0xa41a[_0x41882d];return _0x13440f;};'use strict';var _=require(_0xaa41('0x0'));var util=require(_0xaa41('0x1'));var moment=require('moment');var BPromise=require(_0xaa41('0x2'));var rs=require(_0xaa41('0x3'));var fs=require('fs');var Redis=require(_0xaa41('0x4'));var db=require(_0xaa41('0x5'))['db'];var utils=require(_0xaa41('0x6'));var logger=require(_0xaa41('0x7'))(_0xaa41('0x8'));var config=require(_0xaa41('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xaa41('0xa')][_0xaa41('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x54bc5a,_0x5b1fff,_0x179545){return new BPromise(function(_0x202cce,_0x588ab4){return client[_0xaa41('0xc')](_0x54bc5a,_0x179545)[_0xaa41('0xd')](function(_0x409dab){logger[_0xaa41('0xe')](_0xaa41('0xf'),_0x5b1fff,_0xaa41('0x10'));logger[_0xaa41('0x11')](_0xaa41('0x12'),_0x5b1fff,_0xaa41('0x10'),JSON['stringify'](_0x409dab));if(_0x409dab[_0xaa41('0x13')]){if(_0x409dab[_0xaa41('0x13')]['code']===0x1f4){logger['error'](_0xaa41('0xf'),_0x5b1fff,_0x409dab['error'][_0xaa41('0x14')]);return _0x588ab4(_0x409dab[_0xaa41('0x13')][_0xaa41('0x14')]);}logger[_0xaa41('0x13')](_0xaa41('0xf'),_0x5b1fff,_0x409dab['error'][_0xaa41('0x14')]);return _0x202cce(_0x409dab[_0xaa41('0x13')][_0xaa41('0x14')]);}else{logger[_0xaa41('0xe')](_0xaa41('0xf'),_0x5b1fff,_0xaa41('0x10'));_0x202cce(_0x409dab[_0xaa41('0x15')]['message']);}})[_0xaa41('0x16')](function(_0x16b930){logger[_0xaa41('0x13')](_0xaa41('0xf'),_0x5b1fff,_0x16b930);_0x588ab4(_0x16b930);});});} \ No newline at end of file +var _0x4b84=['../../config/logger','rpc','http','then','info','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','UserMailQueue,\x20%s,\x20%s','message','lodash','util','randomstring','../../config/utils'];(function(_0x1bf702,_0x37164c){var _0x18a7eb=function(_0x574d7b){while(--_0x574d7b){_0x1bf702['push'](_0x1bf702['shift']());}};_0x18a7eb(++_0x37164c);}(_0x4b84,0x1cc));var _0x44b8=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0x4b84[_0x334841];return _0x5beb4b;};'use strict';var _=require(_0x44b8('0x0'));var util=require(_0x44b8('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x44b8('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x44b8('0x3'));var logger=require(_0x44b8('0x4'))(_0x44b8('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x44b8('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x54274b,_0x327f59,_0x5947f7){return new BPromise(function(_0x3e87c5,_0x5a2353){return client['request'](_0x54274b,_0x5947f7)[_0x44b8('0x7')](function(_0x42319d){logger[_0x44b8('0x8')]('UserMailQueue,\x20%s,\x20%s',_0x327f59,_0x44b8('0x9'));logger[_0x44b8('0xa')](_0x44b8('0xb'),_0x327f59,_0x44b8('0x9'),JSON[_0x44b8('0xc')](_0x42319d));if(_0x42319d[_0x44b8('0xd')]){if(_0x42319d[_0x44b8('0xd')]['code']===0x1f4){logger[_0x44b8('0xd')](_0x44b8('0xe'),_0x327f59,_0x42319d['error'][_0x44b8('0xf')]);return _0x5a2353(_0x42319d['error'][_0x44b8('0xf')]);}logger[_0x44b8('0xd')]('UserMailQueue,\x20%s,\x20%s',_0x327f59,_0x42319d[_0x44b8('0xd')]['message']);return _0x3e87c5(_0x42319d['error'][_0x44b8('0xf')]);}else{logger[_0x44b8('0x8')](_0x44b8('0xe'),_0x327f59,_0x44b8('0x9'));_0x3e87c5(_0x42319d['result']['message']);}})['catch'](function(_0x3fe9fb){logger['error'](_0x44b8('0xe'),_0x327f59,_0x3fe9fb);_0x5a2353(_0x3fe9fb);});});} \ No newline at end of file diff --git a/server/api/userNotification/index.js b/server/api/userNotification/index.js index 5ea54f3..c4f2eca 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 _0xb184=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userNotification.controller','post','isAuthenticated','exports','multer','util'];(function(_0x28e2cd,_0x153b42){var _0x11fd46=function(_0x50df13){while(--_0x50df13){_0x28e2cd['push'](_0x28e2cd['shift']());}};_0x11fd46(++_0x153b42);}(_0xb184,0x1d2));var _0x4b18=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb184[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x4b18('0x0'));var util=require(_0x4b18('0x1'));var path=require(_0x4b18('0x2'));var timeout=require(_0x4b18('0x3'));var express=require(_0x4b18('0x4'));var router=express['Router']();var fs_extra=require(_0x4b18('0x5'));var auth=require(_0x4b18('0x6'));var interaction=require(_0x4b18('0x7'));var config=require(_0x4b18('0x8'));var controller=require(_0x4b18('0x9'));router[_0x4b18('0xa')]('/',auth[_0x4b18('0xb')](),controller['sendUserNotification']);module[_0x4b18('0xc')]=router; \ No newline at end of file +var _0x36b7=['../../components/auth/service','../../components/interaction/service','../../config/environment','./userNotification.controller','post','isAuthenticated','exports','multer','util','connect-timeout','Router'];(function(_0x4b4638,_0xe99cda){var _0x59e92b=function(_0x2817ea){while(--_0x2817ea){_0x4b4638['push'](_0x4b4638['shift']());}};_0x59e92b(++_0xe99cda);}(_0x36b7,0x130));var _0x736b=function(_0x1353d4,_0x25013f){_0x1353d4=_0x1353d4-0x0;var _0xf0f13c=_0x36b7[_0x1353d4];return _0xf0f13c;};'use strict';var multer=require(_0x736b('0x0'));var util=require(_0x736b('0x1'));var path=require('path');var timeout=require(_0x736b('0x2'));var express=require('express');var router=express[_0x736b('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x736b('0x4'));var interaction=require(_0x736b('0x5'));var config=require(_0x736b('0x6'));var controller=require(_0x736b('0x7'));router[_0x736b('0x8')]('/',auth[_0x736b('0x9')](),controller['sendUserNotification']);module[_0x736b('0xa')]=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index bc1a716..9321c5d 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 _0x84a7=['sequelize','TEXT','BOOLEAN'];(function(_0x1c97b5,_0x57047b){var _0x3a7bea=function(_0x212b44){while(--_0x212b44){_0x1c97b5['push'](_0x1c97b5['shift']());}};_0x3a7bea(++_0x57047b);}(_0x84a7,0x90));var _0x784a=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x84a7[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x784a('0x0'));module['exports']={'body':{'type':Sequelize[_0x784a('0x1')]},'senderName':{'type':Sequelize['STRING']},'recipientsId':{'type':Sequelize[_0x784a('0x1')]},'recipientsDescription':{'type':Sequelize['STRING']},'beep':{'type':Sequelize[_0x784a('0x2')]}}; \ No newline at end of file +var _0x815c=['STRING','BOOLEAN','sequelize','exports','TEXT'];(function(_0x313bb3,_0x5af89c){var _0x19ef94=function(_0x2b62f4){while(--_0x2b62f4){_0x313bb3['push'](_0x313bb3['shift']());}};_0x19ef94(++_0x5af89c);}(_0x815c,0x16a));var _0xc815=function(_0x42003f,_0x1ac84a){_0x42003f=_0x42003f-0x0;var _0x371c69=_0x815c[_0x42003f];return _0x371c69;};'use strict';var Sequelize=require(_0xc815('0x0'));module[_0xc815('0x1')]={'body':{'type':Sequelize[_0xc815('0x2')]},'senderName':{'type':Sequelize[_0xc815('0x3')]},'recipientsId':{'type':Sequelize[_0xc815('0x2')]},'recipientsDescription':{'type':Sequelize['STRING']},'beep':{'type':Sequelize[_0xc815('0x4')]}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index 583884f..3678d56 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 _0x54be=['sendUserNotification','body','hasOwnProperty','text','TemplateId','Sequelize','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','Missing\x20\x27view\x27\x20parameter','recipients','ValidationError','parse','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','mailqueue','openchannelqueue','smsqueue','voicequeue','whatsappqueue','team','some','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','user','fullname','recipientsDescription','beep','recipientsId','sortBy','join','sequelize','transaction','UserNotification','create','recipient','emit','catch','findOne','html','render','view','forEach','User','includes','ids','push','union','flatten','getAgents','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','register','status','end','json','offset','undefined','limit','count','set','then','sendStatus','error','stack','name','send'];(function(_0x4aca63,_0x4f55bf){var _0x5bd612=function(_0x3d0d33){while(--_0x3d0d33){_0x4aca63['push'](_0x4aca63['shift']());}};_0x5bd612(++_0x4f55bf);}(_0x54be,0x94));var _0xe54b=function(_0x394813,_0x3fcf6b){_0x394813=_0x394813-0x0;var _0x4606bd=_0x54be[_0x394813];return _0x4606bd;};'use strict';var emlformat=require(_0xe54b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe54b('0x1'));var jsonpatch=require(_0xe54b('0x2'));var rp=require('request-promise');var moment=require(_0xe54b('0x3'));var BPromise=require(_0xe54b('0x4'));var Mustache=require(_0xe54b('0x5'));var util=require(_0xe54b('0x6'));var path=require('path');var sox=require(_0xe54b('0x7'));var csv=require('to-csv');var ejs=require(_0xe54b('0x8'));var fs=require('fs');var fs_extra=require(_0xe54b('0x9'));var _=require(_0xe54b('0xa'));var squel=require(_0xe54b('0xb'));var crypto=require(_0xe54b('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xe54b('0xd'));var toCsv=require(_0xe54b('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe54b('0xf'));var authService=require(_0xe54b('0x10'));var qs=require(_0xe54b('0x11'));var as=require(_0xe54b('0x12'));var hardwareService=require(_0xe54b('0x13'));var logger=require(_0xe54b('0x14'))(_0xe54b('0x15'));var utils=require(_0xe54b('0x16'));var config=require(_0xe54b('0x17'));var licenseUtil=require(_0xe54b('0x18'));var db=require(_0xe54b('0x19'))['db'];config[_0xe54b('0x1a')]=_[_0xe54b('0x1b')](config[_0xe54b('0x1a')],{'host':_0xe54b('0x1c'),'port':0x18eb});var socket=require(_0xe54b('0x1d'))(new Redis(config[_0xe54b('0x1a')]));require(_0xe54b('0x1e'))[_0xe54b('0x1f')](socket);function respondWithStatusCode(_0x45e0e8,_0x14066d){_0x14066d=_0x14066d||0xcc;return function(_0x19a570){if(_0x19a570){return _0x45e0e8['sendStatus'](_0x14066d);}return _0x45e0e8[_0xe54b('0x20')](_0x14066d)[_0xe54b('0x21')]();};}function respondWithResult(_0x5090ca,_0x4c07d1){_0x4c07d1=_0x4c07d1||0xc8;return function(_0x2c1e69){if(_0x2c1e69){return _0x5090ca[_0xe54b('0x20')](_0x4c07d1)[_0xe54b('0x22')](_0x2c1e69);}};}function respondWithFilteredResult(_0x2e2ed1,_0xaa4eef){return function(_0xa0fd83){if(_0xa0fd83){var _0x5f035f=typeof _0xaa4eef[_0xe54b('0x23')]===_0xe54b('0x24')&&typeof _0xaa4eef[_0xe54b('0x25')]===_0xe54b('0x24');var _0x5e3cc7=_0xa0fd83[_0xe54b('0x26')];var _0x328344=_0x5f035f?0x0:_0xaa4eef[_0xe54b('0x23')];var _0x58f6cc=_0x5f035f?_0xa0fd83[_0xe54b('0x26')]:_0xaa4eef[_0xe54b('0x23')]+_0xaa4eef[_0xe54b('0x25')];var _0x40842a;if(_0x58f6cc>=_0x5e3cc7){_0x58f6cc=_0x5e3cc7;_0x40842a=0xc8;}else{_0x40842a=0xce;}_0x2e2ed1['status'](_0x40842a);return _0x2e2ed1[_0xe54b('0x27')]('Content-Range',_0x328344+'-'+_0x58f6cc+'/'+_0x5e3cc7)['json'](_0xa0fd83);}return null;};}function patchUpdates(_0x1e0d0e){return function(_0x1fe77c){try{jsonpatch['apply'](_0x1fe77c,_0x1e0d0e,!![]);}catch(_0x408d39){return BPromise['reject'](_0x408d39);}return _0x1fe77c['save']();};}function saveUpdates(_0x5290af,_0x388ba9){return function(_0x2a1333){if(_0x2a1333){return _0x2a1333['update'](_0x5290af)['then'](function(_0x3375e1){return _0x3375e1;});}return null;};}function removeEntity(_0x21c360,_0x396362){return function(_0x36a884){if(_0x36a884){return _0x36a884['destroy']()[_0xe54b('0x28')](function(){_0x21c360[_0xe54b('0x20')](0xcc)[_0xe54b('0x21')]();});}};}function handleEntityNotFound(_0x2b1588,_0x372c91){return function(_0x5664c0){if(!_0x5664c0){_0x2b1588[_0xe54b('0x29')](0x194);}return _0x5664c0;};}function handleError(_0x26c38f,_0x3e6911){_0x3e6911=_0x3e6911||0x1f4;return function(_0x3003c8){logger[_0xe54b('0x2a')](_0x3003c8[_0xe54b('0x2b')]);if(_0x3003c8[_0xe54b('0x2c')]){delete _0x3003c8[_0xe54b('0x2c')];}_0x26c38f[_0xe54b('0x20')](_0x3e6911)[_0xe54b('0x2d')](_0x3003c8);};}exports[_0xe54b('0x2e')]=function(_0x4ac0d8,_0x2ca250,_0x2598b9){if(!_0x4ac0d8[_0xe54b('0x2f')][_0xe54b('0x30')](_0xe54b('0x31'))&&!_0x4ac0d8['body']['hasOwnProperty'](_0xe54b('0x32'))){throw new db[(_0xe54b('0x33'))]['ValidationError'](_0xe54b('0x34'));}else{if(_0x4ac0d8[_0xe54b('0x2f')][_0xe54b('0x30')](_0xe54b('0x32'))&&!_0x4ac0d8[_0xe54b('0x2f')][_0xe54b('0x30')]('view')){throw new db[(_0xe54b('0x33'))]['ValidationError'](_0xe54b('0x35'));}if(!_0x4ac0d8['body'][_0xe54b('0x30')](_0xe54b('0x36'))){throw new db[(_0xe54b('0x33'))][(_0xe54b('0x37'))]('Missing\x20\x27recipients\x27\x20parameter');}else{try{var _0x32b5aa=JSON[_0xe54b('0x38')](_0x4ac0d8[_0xe54b('0x2f')][_0xe54b('0x36')]);}catch(_0x660ea){logger[_0xe54b('0x2a')](_0x660ea);throw new db[(_0xe54b('0x33'))][(_0xe54b('0x37'))](_0xe54b('0x39'));}var _0x11ab42=[_0xe54b('0x3a'),_0xe54b('0x3b'),_0xe54b('0x3c'),_0xe54b('0x3d'),_0xe54b('0x3e'),_0xe54b('0x3f'),_0xe54b('0x40'),_0xe54b('0x41'),'user'];if(_[_0xe54b('0x42')](_0x32b5aa,function(_0x366bb9){return!_['includes'](_0x11ab42,_0x366bb9[_0xe54b('0x43')][_0xe54b('0x44')]());})){throw new db[(_0xe54b('0x33'))][(_0xe54b('0x37'))](_0xe54b('0x45'));}}}var _0x2f68f3={};_0x2f68f3['senderName']=_0x4ac0d8['body'][_0xe54b('0x30')](_0xe54b('0x46'))?_0x4ac0d8[_0xe54b('0x2f')][_0xe54b('0x46')]:_0x4ac0d8[_0xe54b('0x47')][_0xe54b('0x48')];_0x2f68f3[_0xe54b('0x49')]=_['isEmpty'](_0x4ac0d8['body'][_0xe54b('0x49')])?null:_0x4ac0d8[_0xe54b('0x2f')]['recipientsDescription'];_0x2f68f3[_0xe54b('0x4a')]=_0x4ac0d8['body'][_0xe54b('0x4a')]||![];_0x2f68f3['SenderId']=_0x4ac0d8['user']['id'];return getContent(_0x4ac0d8[_0xe54b('0x2f')])[_0xe54b('0x28')](function(_0x1d2232){_0x2f68f3['body']=_0x1d2232;return getRecipients(_0x32b5aa);})['then'](function(_0x2223bf){_0x2f68f3[_0xe54b('0x4b')]=_[_0xe54b('0x4c')](_0x2223bf)[_0xe54b('0x4d')](',');return db[_0xe54b('0x4e')][_0xe54b('0x4f')](function(_0x863bb5){return db[_0xe54b('0x50')][_0xe54b('0x51')](_0x2f68f3,{'raw':!![],'transaction':_0x863bb5})[_0xe54b('0x28')](function(_0x17f651){var _0x512544={'sender':_0x2f68f3['senderName'],'description':_0x2f68f3['recipientsDescription'],'content':_0x2f68f3[_0xe54b('0x2f')],'beep':_0x2f68f3[_0xe54b('0x4a')]};_0x2223bf['forEach'](function(_0x12487f){_0x512544[_0xe54b('0x52')]=_0x12487f;socket[_0xe54b('0x53')]('userNotification:send',_0x512544);});return _0x17f651;});});})[_0xe54b('0x28')](respondWithResult(_0x2ca250,0xc9))[_0xe54b('0x54')](handleError(_0x2ca250,null));};function getContent(_0x4f155b){return new BPromise(function(_0x1504dc,_0x4390e4){if(_0x4f155b[_0xe54b('0x31')]){_0x1504dc(_0x4f155b[_0xe54b('0x31')]);return;}return db['Template'][_0xe54b('0x55')]({'attributes':[_0xe54b('0x56')],'where':{'id':_0x4f155b['TemplateId']},'raw':!![]})['then'](function(_0x17c7f7){if(!_0x17c7f7)throw new db[(_0xe54b('0x33'))][(_0xe54b('0x37'))]('Invalid\x20\x27TemplateId\x27\x20parameter');var _0x34b40c=Mustache[_0xe54b('0x57')](_0x17c7f7[_0xe54b('0x56')],_0x4f155b[_0xe54b('0x58')]);_0x1504dc(_0x34b40c);})['catch'](function(_0x3ca77d){_0x4390e4(_0x3ca77d);});});}function getRecipients(_0x335699){return new BPromise(function(_0xb7ebc1,_0x59db4e){var _0x2598c3=[];var _0x3b0aba=[];_0x335699[_0xe54b('0x59')](function(_0x2b8b52){var _0x122ceb=_['startCase'](_0x2b8b52[_0xe54b('0x43')][_0xe54b('0x44')]());if(_0x122ceb===_0xe54b('0x5a')){_0x2598c3=_['union'](_0x2598c3,_0x2b8b52['ids']);}else{if(_[_0xe54b('0x5b')](_0x122ceb,'queue'))_0x122ceb=_0x122ceb['replace']('queue','Queue');_0x2b8b52[_0xe54b('0x5c')]['forEach'](function(_0x3b6b17){_0x3b0aba[_0xe54b('0x5d')](getAgents(_0x122ceb,_0x3b6b17));});}});return BPromise['all'](_0x3b0aba)[_0xe54b('0x28')](function(_0x856e7f){_0x2598c3=_[_0xe54b('0x5e')](_0x2598c3,_[_0xe54b('0x5f')](_0x856e7f));_0xb7ebc1(_0x2598c3);})[_0xe54b('0x54')](function(_0x1bfc28){_0x59db4e(_0x1bfc28);});});}function getAgents(_0x3d70ce,_0x4c6ed1){return new BPromise(function(_0x14c8a4,_0x1c9d1b){return db[_0x3d70ce][_0xe54b('0x55')]({'where':{'id':_0x4c6ed1}})[_0xe54b('0x28')](function(_0xf46359){return _0xf46359[_0xe54b('0x60')]({'attributes':['id'],'raw':!![]})[_0xe54b('0x28')](function(_0x4cebf8){var _0x50afd4=_['map'](_0x4cebf8,'id');_0x14c8a4(_0x50afd4);});})[_0xe54b('0x54')](function(_0x3e167d){_0x1c9d1b(_0x3e167d);});});} \ No newline at end of file +var _0x1f0d=['update','then','destroy','end','error','stack','name','send','sendUserNotification','body','text','hasOwnProperty','TemplateId','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','Sequelize','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','Invalid\x20\x27recipients\x27\x20object','faxqueue','mailqueue','openchannelqueue','smsqueue','voicequeue','whatsappqueue','user','some','includes','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','isEmpty','recipientsDescription','beep','recipientsId','sortBy','sequelize','transaction','UserNotification','forEach','emit','catch','Template','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','view','model','User','union','replace','queue','Queue','ids','push','all','flatten','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','status','json','undefined','count','offset','limit','Content-Range','reject','save'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1f0d,0x107));var _0xd1f0=function(_0xdaae0b,_0x25fb65){_0xdaae0b=_0xdaae0b-0x0;var _0x5df895=_0x1f0d[_0xdaae0b];return _0x5df895;};'use strict';var emlformat=require(_0xd1f0('0x0'));var rimraf=require(_0xd1f0('0x1'));var zipdir=require(_0xd1f0('0x2'));var jsonpatch=require(_0xd1f0('0x3'));var rp=require('request-promise');var moment=require(_0xd1f0('0x4'));var BPromise=require(_0xd1f0('0x5'));var Mustache=require(_0xd1f0('0x6'));var util=require(_0xd1f0('0x7'));var path=require(_0xd1f0('0x8'));var sox=require('sox');var csv=require(_0xd1f0('0x9'));var ejs=require(_0xd1f0('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd1f0('0xb'));var squel=require(_0xd1f0('0xc'));var crypto=require(_0xd1f0('0xd'));var jsforce=require(_0xd1f0('0xe'));var deskjs=require(_0xd1f0('0xf'));var toCsv=require('to-csv');var querystring=require(_0xd1f0('0x10'));var Papa=require(_0xd1f0('0x11'));var Redis=require('ioredis');var authService=require(_0xd1f0('0x12'));var qs=require(_0xd1f0('0x13'));var as=require(_0xd1f0('0x14'));var hardwareService=require(_0xd1f0('0x15'));var logger=require('../../config/logger')(_0xd1f0('0x16'));var utils=require(_0xd1f0('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xd1f0('0x18'));var db=require(_0xd1f0('0x19'))['db'];config[_0xd1f0('0x1a')]=_['defaults'](config[_0xd1f0('0x1a')],{'host':_0xd1f0('0x1b'),'port':0x18eb});var socket=require(_0xd1f0('0x1c'))(new Redis(config[_0xd1f0('0x1a')]));require('./userNotification.socket')[_0xd1f0('0x1d')](socket);function respondWithStatusCode(_0x228152,_0x13199a){_0x13199a=_0x13199a||0xcc;return function(_0x5d51c5){if(_0x5d51c5){return _0x228152[_0xd1f0('0x1e')](_0x13199a);}return _0x228152[_0xd1f0('0x1f')](_0x13199a)['end']();};}function respondWithResult(_0x154558,_0x2904e1){_0x2904e1=_0x2904e1||0xc8;return function(_0x4d9b0b){if(_0x4d9b0b){return _0x154558['status'](_0x2904e1)[_0xd1f0('0x20')](_0x4d9b0b);}};}function respondWithFilteredResult(_0xe17074,_0x202fa3){return function(_0x5dc253){if(_0x5dc253){var _0x4aa241=typeof _0x202fa3['offset']===_0xd1f0('0x21')&&typeof _0x202fa3['limit']===_0xd1f0('0x21');var _0x569b4e=_0x5dc253[_0xd1f0('0x22')];var _0x3c1737=_0x4aa241?0x0:_0x202fa3['offset'];var _0x2c10c3=_0x4aa241?_0x5dc253[_0xd1f0('0x22')]:_0x202fa3[_0xd1f0('0x23')]+_0x202fa3[_0xd1f0('0x24')];var _0x557936;if(_0x2c10c3>=_0x569b4e){_0x2c10c3=_0x569b4e;_0x557936=0xc8;}else{_0x557936=0xce;}_0xe17074['status'](_0x557936);return _0xe17074['set'](_0xd1f0('0x25'),_0x3c1737+'-'+_0x2c10c3+'/'+_0x569b4e)['json'](_0x5dc253);}return null;};}function patchUpdates(_0x5716ea){return function(_0xe6e3d1){try{jsonpatch['apply'](_0xe6e3d1,_0x5716ea,!![]);}catch(_0xf6aced){return BPromise[_0xd1f0('0x26')](_0xf6aced);}return _0xe6e3d1[_0xd1f0('0x27')]();};}function saveUpdates(_0x455935,_0x4008d9){return function(_0x2f8202){if(_0x2f8202){return _0x2f8202[_0xd1f0('0x28')](_0x455935)[_0xd1f0('0x29')](function(_0x4688fe){return _0x4688fe;});}return null;};}function removeEntity(_0x2947c9,_0x24fdad){return function(_0x374931){if(_0x374931){return _0x374931[_0xd1f0('0x2a')]()['then'](function(){_0x2947c9['status'](0xcc)[_0xd1f0('0x2b')]();});}};}function handleEntityNotFound(_0x3e9fb0,_0xff5443){return function(_0x2a28a4){if(!_0x2a28a4){_0x3e9fb0[_0xd1f0('0x1e')](0x194);}return _0x2a28a4;};}function handleError(_0x50736f,_0x1672d2){_0x1672d2=_0x1672d2||0x1f4;return function(_0x8f046a){logger[_0xd1f0('0x2c')](_0x8f046a[_0xd1f0('0x2d')]);if(_0x8f046a[_0xd1f0('0x2e')]){delete _0x8f046a['name'];}_0x50736f[_0xd1f0('0x1f')](_0x1672d2)[_0xd1f0('0x2f')](_0x8f046a);};}exports[_0xd1f0('0x30')]=function(_0x5d833f,_0x197753,_0x5d1884){if(!_0x5d833f[_0xd1f0('0x31')]['hasOwnProperty'](_0xd1f0('0x32'))&&!_0x5d833f[_0xd1f0('0x31')][_0xd1f0('0x33')](_0xd1f0('0x34'))){throw new db['Sequelize'][(_0xd1f0('0x35'))](_0xd1f0('0x36'));}else{if(_0x5d833f[_0xd1f0('0x31')]['hasOwnProperty'](_0xd1f0('0x34'))&&!_0x5d833f[_0xd1f0('0x31')]['hasOwnProperty']('view')){throw new db[(_0xd1f0('0x37'))][(_0xd1f0('0x35'))](_0xd1f0('0x38'));}if(!_0x5d833f['body'][_0xd1f0('0x33')](_0xd1f0('0x39'))){throw new db[(_0xd1f0('0x37'))][(_0xd1f0('0x35'))](_0xd1f0('0x3a'));}else{try{var _0x5e0a8c=JSON[_0xd1f0('0x3b')](_0x5d833f[_0xd1f0('0x31')]['recipients']);}catch(_0x24ae53){logger['error'](_0x24ae53);throw new db[(_0xd1f0('0x37'))][(_0xd1f0('0x35'))](_0xd1f0('0x3c'));}var _0x129838=['chatqueue',_0xd1f0('0x3d'),_0xd1f0('0x3e'),_0xd1f0('0x3f'),_0xd1f0('0x40'),_0xd1f0('0x41'),_0xd1f0('0x42'),'team',_0xd1f0('0x43')];if(_[_0xd1f0('0x44')](_0x5e0a8c,function(_0x27b628){return!_[_0xd1f0('0x45')](_0x129838,_0x27b628['model'][_0xd1f0('0x46')]());})){throw new db['Sequelize'][(_0xd1f0('0x35'))](_0xd1f0('0x47'));}}}var _0x1a45f4={};_0x1a45f4[_0xd1f0('0x48')]=_0x5d833f[_0xd1f0('0x31')][_0xd1f0('0x33')](_0xd1f0('0x48'))?_0x5d833f[_0xd1f0('0x31')][_0xd1f0('0x48')]:_0x5d833f[_0xd1f0('0x43')][_0xd1f0('0x49')];_0x1a45f4['recipientsDescription']=_[_0xd1f0('0x4a')](_0x5d833f[_0xd1f0('0x31')][_0xd1f0('0x4b')])?null:_0x5d833f[_0xd1f0('0x31')][_0xd1f0('0x4b')];_0x1a45f4[_0xd1f0('0x4c')]=_0x5d833f[_0xd1f0('0x31')][_0xd1f0('0x4c')]||![];_0x1a45f4['SenderId']=_0x5d833f[_0xd1f0('0x43')]['id'];return getContent(_0x5d833f[_0xd1f0('0x31')])[_0xd1f0('0x29')](function(_0x1ebbb5){_0x1a45f4[_0xd1f0('0x31')]=_0x1ebbb5;return getRecipients(_0x5e0a8c);})[_0xd1f0('0x29')](function(_0x3d75e9){_0x1a45f4[_0xd1f0('0x4d')]=_[_0xd1f0('0x4e')](_0x3d75e9)['join'](',');return db[_0xd1f0('0x4f')][_0xd1f0('0x50')](function(_0x5d28b4){return db[_0xd1f0('0x51')]['create'](_0x1a45f4,{'raw':!![],'transaction':_0x5d28b4})[_0xd1f0('0x29')](function(_0x1e719f){var _0x1e6143={'sender':_0x1a45f4['senderName'],'description':_0x1a45f4['recipientsDescription'],'content':_0x1a45f4[_0xd1f0('0x31')],'beep':_0x1a45f4[_0xd1f0('0x4c')]};_0x3d75e9[_0xd1f0('0x52')](function(_0x35f87a){_0x1e6143['recipient']=_0x35f87a;socket[_0xd1f0('0x53')]('userNotification:send',_0x1e6143);});return _0x1e719f;});});})[_0xd1f0('0x29')](respondWithResult(_0x197753,0xc9))[_0xd1f0('0x54')](handleError(_0x197753,null));};function getContent(_0xb16a4c){return new BPromise(function(_0x3ee4ac,_0x21efd1){if(_0xb16a4c[_0xd1f0('0x32')]){_0x3ee4ac(_0xb16a4c[_0xd1f0('0x32')]);return;}return db[_0xd1f0('0x55')][_0xd1f0('0x56')]({'attributes':[_0xd1f0('0x57')],'where':{'id':_0xb16a4c[_0xd1f0('0x34')]},'raw':!![]})[_0xd1f0('0x29')](function(_0x41bdf3){if(!_0x41bdf3)throw new db[(_0xd1f0('0x37'))]['ValidationError'](_0xd1f0('0x58'));var _0x3c44cf=Mustache[_0xd1f0('0x59')](_0x41bdf3[_0xd1f0('0x57')],_0xb16a4c[_0xd1f0('0x5a')]);_0x3ee4ac(_0x3c44cf);})[_0xd1f0('0x54')](function(_0x26c66f){_0x21efd1(_0x26c66f);});});}function getRecipients(_0x127341){return new BPromise(function(_0x4cf3da,_0x4578d0){var _0x638122=[];var _0x2163fb=[];_0x127341[_0xd1f0('0x52')](function(_0x2d65a3){var _0x10874a=_['startCase'](_0x2d65a3[_0xd1f0('0x5b')][_0xd1f0('0x46')]());if(_0x10874a===_0xd1f0('0x5c')){_0x638122=_[_0xd1f0('0x5d')](_0x638122,_0x2d65a3['ids']);}else{if(_[_0xd1f0('0x45')](_0x10874a,'queue'))_0x10874a=_0x10874a[_0xd1f0('0x5e')](_0xd1f0('0x5f'),_0xd1f0('0x60'));_0x2d65a3[_0xd1f0('0x61')]['forEach'](function(_0x240b6b){_0x2163fb[_0xd1f0('0x62')](getAgents(_0x10874a,_0x240b6b));});}});return BPromise[_0xd1f0('0x63')](_0x2163fb)[_0xd1f0('0x29')](function(_0x129c04){_0x638122=_['union'](_0x638122,_[_0xd1f0('0x64')](_0x129c04));_0x4cf3da(_0x638122);})['catch'](function(_0x5eecc0){_0x4578d0(_0x5eecc0);});});}function getAgents(_0x12320a,_0x59658f){return new BPromise(function(_0x4b721d,_0x59b8c3){return db[_0x12320a][_0xd1f0('0x56')]({'where':{'id':_0x59658f}})[_0xd1f0('0x29')](function(_0x520337){return _0x520337['getAgents']({'attributes':['id'],'raw':!![]})[_0xd1f0('0x29')](function(_0x1019b7){var _0x236dc8=_['map'](_0x1019b7,'id');_0x4b721d(_0x236dc8);});})[_0xd1f0('0x54')](function(_0x49351b){_0x59b8c3(_0x49351b);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index eb03206..2b35d10 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 _0xd1b5=['save','update','emit','hasOwnProperty','hook','exports','../../mysqldb','UserNotification','setMaxListeners'];(function(_0x73029b,_0x3df32d){var _0x4ef368=function(_0x106423){while(--_0x106423){_0x73029b['push'](_0x73029b['shift']());}};_0x4ef368(++_0x3df32d);}(_0xd1b5,0x1d1));var _0x5d1b=function(_0x2da401,_0x17e6d4){_0x2da401=_0x2da401-0x0;var _0x37127d=_0xd1b5[_0x2da401];return _0x37127d;};'use strict';var EventEmitter=require('events');var UserNotification=require(_0x5d1b('0x0'))['db'][_0x5d1b('0x1')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x5d1b('0x2')](0x0);var events={'afterCreate':_0x5d1b('0x3'),'afterUpdate':_0x5d1b('0x4'),'afterDestroy':'remove'};function emitEvent(_0x33f67d){return function(_0x7b6198,_0x5e6069,_0x412d09){UserNotificationEvents['emit'](_0x33f67d+':'+_0x7b6198['id'],_0x7b6198);UserNotificationEvents[_0x5d1b('0x5')](_0x33f67d,_0x7b6198);_0x412d09(null);};}for(var e in events){if(events[_0x5d1b('0x6')](e)){var event=events[e];UserNotification[_0x5d1b('0x7')](e,emitEvent(event));}}module[_0x5d1b('0x8')]=UserNotificationEvents; \ No newline at end of file +var _0xce86=['emit','hasOwnProperty','hook','exports','events','setMaxListeners','save','update','remove'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xce86,0x1d8));var _0x6ce8=function(_0x5774be,_0x2259d3){_0x5774be=_0x5774be-0x0;var _0x4914b4=_0xce86[_0x5774be];return _0x4914b4;};'use strict';var EventEmitter=require(_0x6ce8('0x0'));var UserNotification=require('../../mysqldb')['db']['UserNotification'];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x6ce8('0x1')](0x0);var events={'afterCreate':_0x6ce8('0x2'),'afterUpdate':_0x6ce8('0x3'),'afterDestroy':_0x6ce8('0x4')};function emitEvent(_0x3f016e){return function(_0x3db02d,_0x43c4e3,_0x138ef0){UserNotificationEvents[_0x6ce8('0x5')](_0x3f016e+':'+_0x3db02d['id'],_0x3db02d);UserNotificationEvents[_0x6ce8('0x5')](_0x3f016e,_0x3db02d);_0x138ef0(null);};}for(var e in events){if(events[_0x6ce8('0x6')](e)){var event=events[e];UserNotification[_0x6ce8('0x7')](e,emitEvent(event));}}module[_0x6ce8('0x8')]=UserNotificationEvents; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.model.js b/server/api/userNotification/userNotification.model.js index f8b0df5..a013b94 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 _0xfc6e=['../../config/environment','./userNotification.attributes','define','UserNotification','utf8mb4','utf8mb4_unicode_ci','lodash','api','bluebird','request-promise','rimraf'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xfc6e,0x17c));var _0xefc6=function(_0x1559a0,_0x9b8fd7){_0x1559a0=_0x1559a0-0x0;var _0x37e36f=_0xfc6e[_0x1559a0];return _0x37e36f;};'use strict';var _=require(_0xefc6('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xefc6('0x1'));var moment=require('moment');var BPromise=require(_0xefc6('0x2'));var rp=require(_0xefc6('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xefc6('0x4'));var config=require(_0xefc6('0x5'));var attributes=require(_0xefc6('0x6'));module['exports']=function(_0xa99cff,_0x3ba8fe){return _0xa99cff[_0xefc6('0x7')](_0xefc6('0x8'),attributes,{'tableName':'userNotifications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xefc6('0x9'),'collate':_0xefc6('0xa')});}; \ No newline at end of file +var _0x4841=['request-promise','path','rimraf','../../config/environment','./userNotification.attributes','exports','userNotifications','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x4841,0x174));var _0x1484=function(_0x3c4654,_0x75bdad){_0x3c4654=_0x3c4654-0x0;var _0x404e78=_0x4841[_0x3c4654];return _0x404e78;};'use strict';var _=require(_0x1484('0x0'));var util=require(_0x1484('0x1'));var logger=require(_0x1484('0x2'))(_0x1484('0x3'));var moment=require(_0x1484('0x4'));var BPromise=require(_0x1484('0x5'));var rp=require(_0x1484('0x6'));var fs=require('fs');var path=require(_0x1484('0x7'));var rimraf=require(_0x1484('0x8'));var config=require(_0x1484('0x9'));var attributes=require(_0x1484('0xa'));module[_0x1484('0xb')]=function(_0x28bf87,_0x1fcc81){return _0x28bf87['define']('UserNotification',attributes,{'tableName':_0x1484('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1484('0xd'),'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 e4234b9..e914961 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 _0x304c=['debug','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','util','moment','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','register','request','then','UserNotification,\x20%s,\x20%s','request\x20sent'];(function(_0x454d82,_0x3794df){var _0x21fecb=function(_0x234c13){while(--_0x234c13){_0x454d82['push'](_0x454d82['shift']());}};_0x21fecb(++_0x3794df);}(_0x304c,0x1a8));var _0xc304=function(_0xd7ade2,_0x599520){_0xd7ade2=_0xd7ade2-0x0;var _0x491b3a=_0x304c[_0xd7ade2];return _0x491b3a;};'use strict';var _=require(_0xc304('0x0'));var util=require(_0xc304('0x1'));var moment=require(_0xc304('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc304('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xc304('0x4'));var logger=require('../../config/logger')(_0xc304('0x5'));var config=require(_0xc304('0x6'));var jayson=require(_0xc304('0x7'));var client=jayson['client']['http']({'port':0x232a});config[_0xc304('0x8')]=_[_0xc304('0x9')](config[_0xc304('0x8')],{'host':_0xc304('0xa'),'port':0x18eb});var socket=require(_0xc304('0xb'))(new Redis(config[_0xc304('0x8')]));require(_0xc304('0xc'))[_0xc304('0xd')](socket);function respondWithRpcPromise(_0x115e6d,_0x3ddd42,_0x5544a3){return new BPromise(function(_0x26df06,_0x2899e2){return client[_0xc304('0xe')](_0x115e6d,_0x5544a3)[_0xc304('0xf')](function(_0x1af8c3){logger['info'](_0xc304('0x10'),_0x3ddd42,_0xc304('0x11'));logger[_0xc304('0x12')](_0xc304('0x13'),_0x3ddd42,_0xc304('0x11'),JSON[_0xc304('0x14')](_0x1af8c3));if(_0x1af8c3['error']){if(_0x1af8c3[_0xc304('0x15')][_0xc304('0x16')]===0x1f4){logger[_0xc304('0x15')](_0xc304('0x10'),_0x3ddd42,_0x1af8c3[_0xc304('0x15')][_0xc304('0x17')]);return _0x2899e2(_0x1af8c3['error']['message']);}logger['error'](_0xc304('0x10'),_0x3ddd42,_0x1af8c3[_0xc304('0x15')][_0xc304('0x17')]);return _0x26df06(_0x1af8c3[_0xc304('0x15')][_0xc304('0x17')]);}else{logger[_0xc304('0x18')](_0xc304('0x10'),_0x3ddd42,'request\x20sent');_0x26df06(_0x1af8c3[_0xc304('0x19')][_0xc304('0x17')]);}})['catch'](function(_0x381906){logger['error']('UserNotification,\x20%s,\x20%s',_0x3ddd42,_0x381906);_0x2899e2(_0x381906);});});} \ No newline at end of file +var _0xa51c=['../../config/environment','client','http','redis','defaults','socket.io-emitter','./userNotification.socket','register','request','then','info','UserNotification,\x20%s,\x20%s','request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','message','result','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa51c,0x7f));var _0xca51=function(_0x3ab617,_0x2a25a6){_0x3ab617=_0x3ab617-0x0;var _0x4dc037=_0xa51c[_0x3ab617];return _0x4dc037;};'use strict';var _=require('lodash');var util=require(_0xca51('0x0'));var moment=require(_0xca51('0x1'));var BPromise=require(_0xca51('0x2'));var rs=require(_0xca51('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xca51('0x4'))['db'];var utils=require(_0xca51('0x5'));var logger=require(_0xca51('0x6'))(_0xca51('0x7'));var config=require(_0xca51('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xca51('0x9')][_0xca51('0xa')]({'port':0x232a});config[_0xca51('0xb')]=_[_0xca51('0xc')](config[_0xca51('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xca51('0xd'))(new Redis(config[_0xca51('0xb')]));require(_0xca51('0xe'))[_0xca51('0xf')](socket);function respondWithRpcPromise(_0x576284,_0x2d7b09,_0x3a01be){return new BPromise(function(_0x4c6553,_0x8571b8){return client[_0xca51('0x10')](_0x576284,_0x3a01be)[_0xca51('0x11')](function(_0x56b36b){logger[_0xca51('0x12')](_0xca51('0x13'),_0x2d7b09,_0xca51('0x14'));logger[_0xca51('0x15')](_0xca51('0x16'),_0x2d7b09,'request\x20sent',JSON[_0xca51('0x17')](_0x56b36b));if(_0x56b36b[_0xca51('0x18')]){if(_0x56b36b[_0xca51('0x18')]['code']===0x1f4){logger['error'](_0xca51('0x13'),_0x2d7b09,_0x56b36b[_0xca51('0x18')][_0xca51('0x19')]);return _0x8571b8(_0x56b36b[_0xca51('0x18')]['message']);}logger[_0xca51('0x18')](_0xca51('0x13'),_0x2d7b09,_0x56b36b[_0xca51('0x18')][_0xca51('0x19')]);return _0x4c6553(_0x56b36b[_0xca51('0x18')]['message']);}else{logger[_0xca51('0x12')]('UserNotification,\x20%s,\x20%s',_0x2d7b09,_0xca51('0x14'));_0x4c6553(_0x56b36b[_0xca51('0x1a')][_0xca51('0x19')]);}})['catch'](function(_0x167f5a){logger['error'](_0xca51('0x13'),_0x2d7b09,_0x167f5a);_0x8571b8(_0x167f5a);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index 8ac0fdb..be17b3d 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 _0x72c5=['./userNotification.events','update','emit','length','userNotification:'];(function(_0x340ff8,_0x26d4f8){var _0x36bed2=function(_0x4f0287){while(--_0x4f0287){_0x340ff8['push'](_0x340ff8['shift']());}};_0x36bed2(++_0x26d4f8);}(_0x72c5,0xb4));var _0x572c=function(_0x2beeb9,_0x415c85){_0x2beeb9=_0x2beeb9-0x0;var _0x3f7f25=_0x72c5[_0x2beeb9];return _0x3f7f25;};'use strict';var UserNotificationEvents=require(_0x572c('0x0'));var events=['save','remove',_0x572c('0x1')];function createListener(_0x23f7b4,_0x51dddb){return function(_0xac068f){_0x51dddb[_0x572c('0x2')](_0x23f7b4,_0xac068f);};}function removeListener(_0x3f8aee,_0x3df2fb){return function(){UserNotificationEvents['removeListener'](_0x3f8aee,_0x3df2fb);};}exports['register']=function(_0x120389){for(var _0x1be257=0x0,_0xad8cb5=events[_0x572c('0x3')];_0x1be257<_0xad8cb5;_0x1be257++){var _0x17d126=events[_0x1be257];var _0x26df9d=createListener(_0x572c('0x4')+_0x17d126,_0x120389);UserNotificationEvents['on'](_0x17d126,_0x26df9d);}}; \ No newline at end of file +var _0x777e=['save','update','emit','removeListener','register','length','userNotification:','./userNotification.events'];(function(_0x3d2b19,_0x349a5b){var _0x29769b=function(_0x5048ad){while(--_0x5048ad){_0x3d2b19['push'](_0x3d2b19['shift']());}};_0x29769b(++_0x349a5b);}(_0x777e,0x14f));var _0xe777=function(_0xd8f7bd,_0x45dc8c){_0xd8f7bd=_0xd8f7bd-0x0;var _0x1bd5ee=_0x777e[_0xd8f7bd];return _0x1bd5ee;};'use strict';var UserNotificationEvents=require(_0xe777('0x0'));var events=[_0xe777('0x1'),'remove',_0xe777('0x2')];function createListener(_0x1212de,_0x170ba8){return function(_0x51c0bd){_0x170ba8[_0xe777('0x3')](_0x1212de,_0x51c0bd);};}function removeListener(_0x1ef41c,_0x1107ff){return function(){UserNotificationEvents[_0xe777('0x4')](_0x1ef41c,_0x1107ff);};}exports[_0xe777('0x5')]=function(_0x93d12d){for(var _0x385c36=0x0,_0x5764a8=events[_0xe777('0x6')];_0x385c36<_0x5764a8;_0x385c36++){var _0x191a0b=events[_0x385c36];var _0x2b5b44=createListener(_0xe777('0x7')+_0x191a0b,_0x93d12d);UserNotificationEvents['on'](_0x191a0b,_0x2b5b44);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index 9023eae..6bf1b7f 100644 --- a/server/api/userOpenchannelQueue/index.js +++ b/server/api/userOpenchannelQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x4c2a9a,_0x4ba2f2){var _0xba43e1=function(_0x486b51){while(--_0x486b51){_0x4c2a9a['push'](_0x4c2a9a['shift']());}};_0xba43e1(++_0x4ba2f2);}(_0x70e0,0x17b));var _0x070e=function(_0x45e5eb,_0x97a0e8){_0x45e5eb=_0x45e5eb-0x0;var _0x3d46b7=_0x70e0[_0x45e5eb];return _0x3d46b7;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x307306,_0x47728b){var _0x44a6d4=function(_0x311e73){while(--_0x311e73){_0x307306['push'](_0x307306['shift']());}};_0x44a6d4(++_0x47728b);}(_0x70e0,0x17b));var _0x070e=function(_0x1ce5d7,_0x4052e4){_0x1ce5d7=_0x1ce5d7-0x0;var _0x3b516a=_0x70e0[_0x1ce5d7];return _0x3b516a;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index 882f6be..fa6067a 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 _0xa01a=['exports','INTEGER','sequelize'];(function(_0x183b97,_0x2d297c){var _0x629cf7=function(_0x4ffd24){while(--_0x4ffd24){_0x183b97['push'](_0x183b97['shift']());}};_0x629cf7(++_0x2d297c);}(_0xa01a,0x6e));var _0xaa01=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0xa01a[_0x4709c0];return _0x13348b;};'use strict';var Sequelize=require(_0xaa01('0x0'));module[_0xaa01('0x1')]={'penalty':{'type':Sequelize[_0xaa01('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x79a1=['exports'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0x79a1,0x1e2));var _0x179a=function(_0x885c76,_0x5a93d6){_0x885c76=_0x885c76-0x0;var _0xcaa37c=_0x79a1[_0x885c76];return _0xcaa37c;};'use strict';var Sequelize=require('sequelize');module[_0x179a('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js index 93770d1..0c7efc7 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 _0x9ef7=['bluebird','request-promise','path','rimraf','../../config/environment','./userOpenchannelQueue.attributes','exports','UserOpenchannelQueue','user_has_openchannel_queues','lodash','util','../../config/logger','api','moment'];(function(_0x24dc98,_0x235f7f){var _0x33e6c1=function(_0x3a6e74){while(--_0x3a6e74){_0x24dc98['push'](_0x24dc98['shift']());}};_0x33e6c1(++_0x235f7f);}(_0x9ef7,0xf7));var _0x79ef=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0x9ef7[_0x164eca];return _0x2ce562;};'use strict';var _=require(_0x79ef('0x0'));var util=require(_0x79ef('0x1'));var logger=require(_0x79ef('0x2'))(_0x79ef('0x3'));var moment=require(_0x79ef('0x4'));var BPromise=require(_0x79ef('0x5'));var rp=require(_0x79ef('0x6'));var fs=require('fs');var path=require(_0x79ef('0x7'));var rimraf=require(_0x79ef('0x8'));var config=require(_0x79ef('0x9'));var attributes=require(_0x79ef('0xa'));module[_0x79ef('0xb')]=function(_0x4282cb,_0x5c91c0){return _0x4282cb['define'](_0x79ef('0xc'),attributes,{'tableName':_0x79ef('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0e9f=['./userOpenchannelQueue.attributes','exports','UserOpenchannelQueue','user_has_openchannel_queues','util','../../config/logger','api','bluebird','request-promise','rimraf'];(function(_0x573413,_0x9dee23){var _0x5b7b2a=function(_0x3d25ba){while(--_0x3d25ba){_0x573413['push'](_0x573413['shift']());}};_0x5b7b2a(++_0x9dee23);}(_0x0e9f,0x176));var _0xf0e9=function(_0x219d8a,_0x27748a){_0x219d8a=_0x219d8a-0x0;var _0x2a0e9f=_0x0e9f[_0x219d8a];return _0x2a0e9f;};'use strict';var _=require('lodash');var util=require(_0xf0e9('0x0'));var logger=require(_0xf0e9('0x1'))(_0xf0e9('0x2'));var moment=require('moment');var BPromise=require(_0xf0e9('0x3'));var rp=require(_0xf0e9('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf0e9('0x5'));var config=require('../../config/environment');var attributes=require(_0xf0e9('0x6'));module[_0xf0e9('0x7')]=function(_0x2a7c08,_0x490815){return _0x2a7c08['define'](_0xf0e9('0x8'),attributes,{'tableName':_0xf0e9('0x9'),'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 923649e..cfe5b61 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 _0x3128=['debug','stringify','error','code','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','request','then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3128,0xba));var _0x8312=function(_0x2d115a,_0x4b4beb){_0x2d115a=_0x2d115a-0x0;var _0x55eda0=_0x3128[_0x2d115a];return _0x55eda0;};'use strict';var _=require(_0x8312('0x0'));var util=require(_0x8312('0x1'));var moment=require(_0x8312('0x2'));var BPromise=require(_0x8312('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8312('0x4'));var db=require(_0x8312('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8312('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x8312('0x7'));var client=jayson[_0x8312('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1d6265,_0x4b3382,_0x1ee396){return new BPromise(function(_0x4c06e1,_0x225f17){return client[_0x8312('0x9')](_0x1d6265,_0x1ee396)[_0x8312('0xa')](function(_0xa54a6f){logger[_0x8312('0xb')](_0x8312('0xc'),_0x4b3382,_0x8312('0xd'));logger[_0x8312('0xe')]('UserOpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x4b3382,_0x8312('0xd'),JSON[_0x8312('0xf')](_0xa54a6f));if(_0xa54a6f[_0x8312('0x10')]){if(_0xa54a6f[_0x8312('0x10')][_0x8312('0x11')]===0x1f4){logger[_0x8312('0x10')](_0x8312('0xc'),_0x4b3382,_0xa54a6f['error'][_0x8312('0x12')]);return _0x225f17(_0xa54a6f['error'][_0x8312('0x12')]);}logger['error'](_0x8312('0xc'),_0x4b3382,_0xa54a6f[_0x8312('0x10')][_0x8312('0x12')]);return _0x4c06e1(_0xa54a6f[_0x8312('0x10')][_0x8312('0x12')]);}else{logger[_0x8312('0xb')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x4b3382,_0x8312('0xd'));_0x4c06e1(_0xa54a6f['result']['message']);}})[_0x8312('0x13')](function(_0x29166a){logger[_0x8312('0x10')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x4b3382,_0x29166a);_0x225f17(_0x29166a);});});} \ No newline at end of file +var _0x3fe7=['debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_0x3fe7,0x194));var _0x73fe=function(_0x4a9a17,_0x273a09){_0x4a9a17=_0x4a9a17-0x0;var _0x30e831=_0x3fe7[_0x4a9a17];return _0x30e831;};'use strict';var _=require(_0x73fe('0x0'));var util=require(_0x73fe('0x1'));var moment=require(_0x73fe('0x2'));var BPromise=require(_0x73fe('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x73fe('0x4'));var db=require(_0x73fe('0x5'))['db'];var utils=require(_0x73fe('0x6'));var logger=require('../../config/logger')(_0x73fe('0x7'));var config=require('../../config/environment');var jayson=require(_0x73fe('0x8'));var client=jayson[_0x73fe('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x57b60f,_0x1494b5,_0x44914e){return new BPromise(function(_0x12a84f,_0x49871d){return client['request'](_0x57b60f,_0x44914e)[_0x73fe('0xa')](function(_0x4a9ac5){logger[_0x73fe('0xb')](_0x73fe('0xc'),_0x1494b5,_0x73fe('0xd'));logger[_0x73fe('0xe')](_0x73fe('0xf'),_0x1494b5,_0x73fe('0xd'),JSON[_0x73fe('0x10')](_0x4a9ac5));if(_0x4a9ac5[_0x73fe('0x11')]){if(_0x4a9ac5['error'][_0x73fe('0x12')]===0x1f4){logger[_0x73fe('0x11')](_0x73fe('0xc'),_0x1494b5,_0x4a9ac5[_0x73fe('0x11')][_0x73fe('0x13')]);return _0x49871d(_0x4a9ac5[_0x73fe('0x11')][_0x73fe('0x13')]);}logger['error']('UserOpenchannelQueue,\x20%s,\x20%s',_0x1494b5,_0x4a9ac5[_0x73fe('0x11')][_0x73fe('0x13')]);return _0x12a84f(_0x4a9ac5[_0x73fe('0x11')][_0x73fe('0x13')]);}else{logger[_0x73fe('0xb')](_0x73fe('0xc'),_0x1494b5,_0x73fe('0xd'));_0x12a84f(_0x4a9ac5[_0x73fe('0x14')]['message']);}})[_0x73fe('0x15')](function(_0x52beae){logger[_0x73fe('0x11')](_0x73fe('0xc'),_0x1494b5,_0x52beae);_0x49871d(_0x52beae);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index 60bc4b3..a6df65b 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 _0xf811=['index','isAuthenticated','/:id','show','getSections','/:id/resources','getResources','post','/:id/clone','clone','/:id/sections','addSections','addResources','put','update','delete','removeSections','removeResources','exports','multer','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./userProfile.controller','get'];(function(_0x34bf97,_0xc60f9d){var _0x292719=function(_0x31354e){while(--_0x31354e){_0x34bf97['push'](_0x34bf97['shift']());}};_0x292719(++_0xc60f9d);}(_0xf811,0xaf));var _0x1f81=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0xf811[_0xdea41a];return _0x15d0d8;};'use strict';var multer=require(_0x1f81('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x1f81('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x1f81('0x2'));var auth=require(_0x1f81('0x3'));var interaction=require(_0x1f81('0x4'));var config=require('../../config/environment');var controller=require(_0x1f81('0x5'));router[_0x1f81('0x6')]('/',auth['isAuthenticated'](),controller[_0x1f81('0x7')]);router[_0x1f81('0x6')]('/describe',auth[_0x1f81('0x8')](),controller['describe']);router['get'](_0x1f81('0x9'),auth[_0x1f81('0x8')](),controller[_0x1f81('0xa')]);router['get']('/:id/sections',auth[_0x1f81('0x8')](),controller[_0x1f81('0xb')]);router['get'](_0x1f81('0xc'),auth[_0x1f81('0x8')](),controller[_0x1f81('0xd')]);router['post']('/',auth[_0x1f81('0x8')](),controller['create']);router[_0x1f81('0xe')](_0x1f81('0xf'),auth[_0x1f81('0x8')](),controller[_0x1f81('0x10')]);router[_0x1f81('0xe')](_0x1f81('0x11'),auth[_0x1f81('0x8')](),controller[_0x1f81('0x12')]);router[_0x1f81('0xe')](_0x1f81('0xc'),auth[_0x1f81('0x8')](),controller[_0x1f81('0x13')]);router[_0x1f81('0x14')](_0x1f81('0x9'),auth[_0x1f81('0x8')](),controller[_0x1f81('0x15')]);router[_0x1f81('0x16')](_0x1f81('0x9'),auth[_0x1f81('0x8')](),controller['destroy']);router['delete'](_0x1f81('0x11'),auth[_0x1f81('0x8')](),controller[_0x1f81('0x17')]);router['delete'](_0x1f81('0xc'),auth[_0x1f81('0x8')](),controller[_0x1f81('0x18')]);module[_0x1f81('0x19')]=router; \ No newline at end of file +var _0xa3e9=['/:id/sections','getSections','/:id/resources','create','/:id/clone','clone','post','addSections','addResources','put','delete','removeSections','removeResources','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfile.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x441b02,_0x4dd375){var _0x1d7fc9=function(_0x2b8318){while(--_0x2b8318){_0x441b02['push'](_0x441b02['shift']());}};_0x1d7fc9(++_0x4dd375);}(_0xa3e9,0xc2));var _0x9a3e=function(_0x4b70b4,_0x40961c){_0x4b70b4=_0x4b70b4-0x0;var _0x1295d9=_0xa3e9[_0x4b70b4];return _0x1295d9;};'use strict';var multer=require(_0x9a3e('0x0'));var util=require(_0x9a3e('0x1'));var path=require(_0x9a3e('0x2'));var timeout=require(_0x9a3e('0x3'));var express=require(_0x9a3e('0x4'));var router=express['Router']();var fs_extra=require(_0x9a3e('0x5'));var auth=require(_0x9a3e('0x6'));var interaction=require(_0x9a3e('0x7'));var config=require(_0x9a3e('0x8'));var controller=require(_0x9a3e('0x9'));router[_0x9a3e('0xa')]('/',auth[_0x9a3e('0xb')](),controller[_0x9a3e('0xc')]);router['get'](_0x9a3e('0xd'),auth['isAuthenticated'](),controller[_0x9a3e('0xe')]);router[_0x9a3e('0xa')](_0x9a3e('0xf'),auth[_0x9a3e('0xb')](),controller['show']);router['get'](_0x9a3e('0x10'),auth[_0x9a3e('0xb')](),controller[_0x9a3e('0x11')]);router[_0x9a3e('0xa')](_0x9a3e('0x12'),auth[_0x9a3e('0xb')](),controller['getResources']);router['post']('/',auth[_0x9a3e('0xb')](),controller[_0x9a3e('0x13')]);router['post'](_0x9a3e('0x14'),auth[_0x9a3e('0xb')](),controller[_0x9a3e('0x15')]);router[_0x9a3e('0x16')](_0x9a3e('0x10'),auth[_0x9a3e('0xb')](),controller[_0x9a3e('0x17')]);router[_0x9a3e('0x16')](_0x9a3e('0x12'),auth[_0x9a3e('0xb')](),controller[_0x9a3e('0x18')]);router[_0x9a3e('0x19')](_0x9a3e('0xf'),auth[_0x9a3e('0xb')](),controller['update']);router[_0x9a3e('0x1a')](_0x9a3e('0xf'),auth[_0x9a3e('0xb')](),controller['destroy']);router['delete']('/:id/sections',auth[_0x9a3e('0xb')](),controller[_0x9a3e('0x1b')]);router['delete'](_0x9a3e('0x12'),auth['isAuthenticated'](),controller[_0x9a3e('0x1c')]);module[_0x9a3e('0x1d')]=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index 7bc5ec1..976491d 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 _0xf2cc=['sequelize','exports','STRING','name','setDataValue','join','crudPermissions','getDataValue','split','BOOLEAN'];(function(_0x431953,_0x22d793){var _0x4d9317=function(_0x593794){while(--_0x593794){_0x431953['push'](_0x431953['shift']());}};_0x4d9317(++_0x22d793);}(_0xf2cc,0x1cc));var _0xcf2c=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0xf2cc[_0x55e08b];return _0xd1a7ff;};'use strict';var Sequelize=require(_0xcf2c('0x0'));module[_0xcf2c('0x1')]={'name':{'type':Sequelize[_0xcf2c('0x2')],'allowNull':![],'unique':_0xcf2c('0x3')},'crudPermissions':{'type':Sequelize[_0xcf2c('0x2')],'set':function(_0xec19eb){this[_0xcf2c('0x4')]('crudPermissions',_0xec19eb?_0xec19eb[_0xcf2c('0x5')](''):[]);},'get':function(){return this['getDataValue'](_0xcf2c('0x6'))?this[_0xcf2c('0x7')](_0xcf2c('0x6'))[_0xcf2c('0x8')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0xcf2c('0x9')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0xcf2c('0x9')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0xcf2c('0x9')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0xcf2c('0x9')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xcf2c('0x9')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0xcf2c('0x9')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xcf2c('0x9')],'defaultValue':!![]}}; \ No newline at end of file +var _0x27b4=['setDataValue','getDataValue','crudPermissions','BOOLEAN','exports','STRING','name'];(function(_0x4f517f,_0x15e66f){var _0x48bc81=function(_0x275f58){while(--_0x275f58){_0x4f517f['push'](_0x4f517f['shift']());}};_0x48bc81(++_0x15e66f);}(_0x27b4,0x1b6));var _0x427b=function(_0x16c708,_0x2e58ca){_0x16c708=_0x16c708-0x0;var _0x13b3a4=_0x27b4[_0x16c708];return _0x13b3a4;};'use strict';var Sequelize=require('sequelize');module[_0x427b('0x0')]={'name':{'type':Sequelize[_0x427b('0x1')],'allowNull':![],'unique':_0x427b('0x2')},'crudPermissions':{'type':Sequelize[_0x427b('0x1')],'set':function(_0x2f6d05){this[_0x427b('0x3')]('crudPermissions',_0x2f6d05?_0x2f6d05['join'](''):[]);},'get':function(){return this[_0x427b('0x4')](_0x427b('0x5'))?this[_0x427b('0x4')](_0x427b('0x5'))['split'](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x427b('0x1')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x427b('0x6')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x427b('0x6')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x427b('0x6')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x427b('0x6')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x427b('0x6')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x427b('0x6')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index dae1491..20f63bd 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 _0x131d=['merge','type','VIRTUAL','includeAll','include','show','rawAttributes','options','find','catch','create','body','clone','params','get','createdAt','crudPermissions','omit','updatedAt','transaction','UserProfileSection','findAll','sectionId','userProfileId','UserProfileResource','Resources','describe','addSections','sequelize','each','push','ids','getSections','enabled','includes','isEmpty','subsections','findOne','autoAssociation','forEach','Plugin','resourceId','bulkCreate','removeResources','getResources','section','Missing\x20section\x20parameter','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','./userProfile.socket','register','end','status','json','undefined','count','set','apply','save','then','destroy','sendStatus','error','stack','name','send','index','UserProfile','fieldName','key','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','limit','offset','order','sort','where','pick','filter'];(function(_0x3a9e73,_0x567a70){var _0x5af67a=function(_0x3d793d){while(--_0x3d793d){_0x3a9e73['push'](_0x3a9e73['shift']());}};_0x5af67a(++_0x567a70);}(_0x131d,0x10a));var _0xd131=function(_0x14a770,_0x151e22){_0x14a770=_0x14a770-0x0;var _0x448cc9=_0x131d[_0x14a770];return _0x448cc9;};'use strict';var emlformat=require(_0xd131('0x0'));var rimraf=require(_0xd131('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd131('0x2'));var rp=require(_0xd131('0x3'));var moment=require(_0xd131('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd131('0x5'));var util=require(_0xd131('0x6'));var path=require('path');var sox=require(_0xd131('0x7'));var csv=require(_0xd131('0x8'));var ejs=require(_0xd131('0x9'));var fs=require('fs');var fs_extra=require(_0xd131('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xd131('0xb'));var jsforce=require(_0xd131('0xc'));var deskjs=require(_0xd131('0xd'));var toCsv=require(_0xd131('0x8'));var querystring=require(_0xd131('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xd131('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xd131('0x10'));var hardwareService=require(_0xd131('0x11'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xd131('0x12'));var licenseUtil=require(_0xd131('0x13'));var db=require(_0xd131('0x14'))['db'];config[_0xd131('0x15')]=_[_0xd131('0x16')](config[_0xd131('0x15')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xd131('0x17'))[_0xd131('0x18')](socket);function respondWithStatusCode(_0x4c476a,_0x10c944){_0x10c944=_0x10c944||0xcc;return function(_0x15330f){if(_0x15330f){return _0x4c476a['sendStatus'](_0x10c944);}return _0x4c476a['status'](_0x10c944)[_0xd131('0x19')]();};}function respondWithResult(_0x404ee0,_0x125e2d){_0x125e2d=_0x125e2d||0xc8;return function(_0x5bf9b7){if(_0x5bf9b7){return _0x404ee0[_0xd131('0x1a')](_0x125e2d)[_0xd131('0x1b')](_0x5bf9b7);}};}function respondWithFilteredResult(_0x24d634,_0x886e20){return function(_0x425d4){if(_0x425d4){var _0x1897a7=typeof _0x886e20['offset']===_0xd131('0x1c')&&typeof _0x886e20['limit']===_0xd131('0x1c');var _0x6756e=_0x425d4['count'];var _0x382f43=_0x1897a7?0x0:_0x886e20['offset'];var _0x1e5eee=_0x1897a7?_0x425d4[_0xd131('0x1d')]:_0x886e20['offset']+_0x886e20['limit'];var _0x139e75;if(_0x1e5eee>=_0x6756e){_0x1e5eee=_0x6756e;_0x139e75=0xc8;}else{_0x139e75=0xce;}_0x24d634['status'](_0x139e75);return _0x24d634[_0xd131('0x1e')]('Content-Range',_0x382f43+'-'+_0x1e5eee+'/'+_0x6756e)['json'](_0x425d4);}return null;};}function patchUpdates(_0x12b425){return function(_0x2f365c){try{jsonpatch[_0xd131('0x1f')](_0x2f365c,_0x12b425,!![]);}catch(_0x24a5ed){return BPromise['reject'](_0x24a5ed);}return _0x2f365c[_0xd131('0x20')]();};}function saveUpdates(_0x3f3ffc,_0x1247c0){return function(_0x5c0e63){if(_0x5c0e63){return _0x5c0e63['update'](_0x3f3ffc)[_0xd131('0x21')](function(_0x4e0893){return _0x4e0893;});}return null;};}function removeEntity(_0x356ca0,_0x6ba760){return function(_0x175003){if(_0x175003){return _0x175003[_0xd131('0x22')]()[_0xd131('0x21')](function(){_0x356ca0['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3b85bb,_0x5f508c){return function(_0x4c3043){if(!_0x4c3043){_0x3b85bb[_0xd131('0x23')](0x194);}return _0x4c3043;};}function handleError(_0x4de3ff,_0x288c46){_0x288c46=_0x288c46||0x1f4;return function(_0x27612f){logger[_0xd131('0x24')](_0x27612f[_0xd131('0x25')]);if(_0x27612f['name']){delete _0x27612f[_0xd131('0x26')];}_0x4de3ff[_0xd131('0x1a')](_0x288c46)[_0xd131('0x27')](_0x27612f);};}exports[_0xd131('0x28')]=function(_0x456fe4,_0x1544f4){var _0x26243d={},_0x4eb418={},_0x33d112={'count':0x0,'rows':[]};var _0x4664df=_['map'](db[_0xd131('0x29')]['rawAttributes'],function(_0x26ec18){return{'name':_0x26ec18[_0xd131('0x2a')],'type':_0x26ec18['type'][_0xd131('0x2b')]};});_0x4eb418[_0xd131('0x2c')]=_[_0xd131('0x2d')](_0x4664df,'name');_0x4eb418[_0xd131('0x2e')]=_[_0xd131('0x2f')](_0x456fe4[_0xd131('0x2e')]);_0x4eb418[_0xd131('0x30')]=_['intersection'](_0x4eb418[_0xd131('0x2c')],_0x4eb418[_0xd131('0x2e')]);_0x26243d[_0xd131('0x31')]=_[_0xd131('0x32')](_0x4eb418[_0xd131('0x2c')],qs[_0xd131('0x33')](_0x456fe4[_0xd131('0x2e')][_0xd131('0x33')]));_0x26243d[_0xd131('0x31')]=_0x26243d[_0xd131('0x31')][_0xd131('0x34')]?_0x26243d[_0xd131('0x31')]:_0x4eb418['model'];if(!_0x456fe4[_0xd131('0x2e')][_0xd131('0x35')]('nolimit')){_0x26243d[_0xd131('0x36')]=qs['limit'](_0x456fe4[_0xd131('0x2e')][_0xd131('0x36')]);_0x26243d['offset']=qs['offset'](_0x456fe4[_0xd131('0x2e')][_0xd131('0x37')]);}_0x26243d[_0xd131('0x38')]=qs[_0xd131('0x39')](_0x456fe4['query'][_0xd131('0x39')]);_0x26243d[_0xd131('0x3a')]=qs[_0xd131('0x30')](_[_0xd131('0x3b')](_0x456fe4['query'],_0x4eb418[_0xd131('0x30')]),_0x4664df);if(_0x456fe4['query'][_0xd131('0x3c')]){_0x26243d[_0xd131('0x3a')]=_[_0xd131('0x3d')](_0x26243d[_0xd131('0x3a')],{'$or':_[_0xd131('0x2d')](_0x4664df,function(_0x438f42){if(_0x438f42[_0xd131('0x3e')]!==_0xd131('0x3f')){var _0x4d5ed8={};_0x4d5ed8[_0x438f42[_0xd131('0x26')]]={'$like':'%'+_0x456fe4[_0xd131('0x2e')][_0xd131('0x3c')]+'%'};return _0x4d5ed8;}})});}_0x26243d=_['merge']({},_0x26243d,_0x456fe4['options']);var _0x42b838={'where':_0x26243d[_0xd131('0x3a')]};return db[_0xd131('0x29')]['count'](_0x42b838)[_0xd131('0x21')](function(_0x253362){_0x33d112[_0xd131('0x1d')]=_0x253362;if(_0x456fe4[_0xd131('0x2e')][_0xd131('0x40')]){_0x26243d[_0xd131('0x41')]=[{'all':!![]}];}return db[_0xd131('0x29')]['findAll'](_0x26243d);})[_0xd131('0x21')](function(_0xa2459b){_0x33d112['rows']=_0xa2459b;return _0x33d112;})['then'](respondWithFilteredResult(_0x1544f4,_0x26243d))['catch'](handleError(_0x1544f4,null));};exports[_0xd131('0x42')]=function(_0x4ebd8c,_0x1f3881){var _0x1d6a90={'raw':![],'where':{'id':_0x4ebd8c['params']['id']}},_0x339a21={};_0x339a21['model']=_[_0xd131('0x2f')](db[_0xd131('0x29')][_0xd131('0x43')]);_0x339a21[_0xd131('0x2e')]=_['keys'](_0x4ebd8c[_0xd131('0x2e')]);_0x339a21[_0xd131('0x30')]=_[_0xd131('0x32')](_0x339a21[_0xd131('0x2c')],_0x339a21[_0xd131('0x2e')]);_0x1d6a90[_0xd131('0x31')]=_[_0xd131('0x32')](_0x339a21['model'],qs[_0xd131('0x33')](_0x4ebd8c[_0xd131('0x2e')][_0xd131('0x33')]));_0x1d6a90[_0xd131('0x31')]=_0x1d6a90[_0xd131('0x31')]['length']?_0x1d6a90[_0xd131('0x31')]:_0x339a21[_0xd131('0x2c')];if(_0x4ebd8c['query'][_0xd131('0x40')]){_0x1d6a90[_0xd131('0x41')]=[{'all':!![]}];}_0x1d6a90=_[_0xd131('0x3d')]({},_0x1d6a90,_0x4ebd8c[_0xd131('0x44')]);return db[_0xd131('0x29')][_0xd131('0x45')](_0x1d6a90)[_0xd131('0x21')](handleEntityNotFound(_0x1f3881,null))[_0xd131('0x21')](respondWithResult(_0x1f3881,null))[_0xd131('0x46')](handleError(_0x1f3881,null));};exports[_0xd131('0x47')]=function(_0x4e8a5e,_0x2f33e7){return db[_0xd131('0x29')][_0xd131('0x47')](_0x4e8a5e[_0xd131('0x48')],{})[_0xd131('0x21')](respondWithResult(_0x2f33e7,0xc9))[_0xd131('0x46')](handleError(_0x2f33e7,null));};exports[_0xd131('0x49')]=function(_0x40a88c,_0x15e31d){var _0x3c70e8={'where':{'id':_0x40a88c[_0xd131('0x4a')]['id']}},_0xc303bf={};_0xc303bf[_0xd131('0x2c')]=_['keys'](db[_0xd131('0x29')]['rawAttributes']);_0x3c70e8['attributes']=_['intersection'](_0xc303bf[_0xd131('0x2c')],qs[_0xd131('0x33')](_0x40a88c[_0xd131('0x2e')][_0xd131('0x33')]));_0x3c70e8[_0xd131('0x31')]=_0x3c70e8[_0xd131('0x31')][_0xd131('0x34')]?_0x3c70e8[_0xd131('0x31')]:_0xc303bf[_0xd131('0x2c')];if(_0x40a88c[_0xd131('0x2e')][_0xd131('0x40')]){_0x3c70e8[_0xd131('0x41')]=[{'all':!![]}];}_0x3c70e8=_[_0xd131('0x3d')]({},_0x3c70e8,_0x40a88c['options']);return db[_0xd131('0x29')][_0xd131('0x45')](_0x3c70e8)[_0xd131('0x21')](handleEntityNotFound(_0x15e31d,null))['then'](function(_0x43cdbc){if(_0x43cdbc){var _0x2aafdd=_0x43cdbc[_0xd131('0x4b')]({'plain':!![]});_0x2aafdd=qs['omit'](_0x2aafdd,['id',_0xd131('0x4c'),'updatedAt',_0xd131('0x4d')]);_0x40a88c['body']=_[_0xd131('0x4e')](_0x40a88c[_0xd131('0x48')],['id',_0xd131('0x4c'),_0xd131('0x4f')]);return db['sequelize'][_0xd131('0x50')](function(_0xeacd4){return db[_0xd131('0x29')][_0xd131('0x47')](_[_0xd131('0x3d')](_0x2aafdd,_0x40a88c[_0xd131('0x48')]),{'include':_0x40a88c[_0xd131('0x2e')]['includeAll']?[{'all':!![]}]:undefined,'transaction':_0xeacd4})[_0xd131('0x21')](function(_0x4ac64f){var _0x32a978=_0x4ac64f[_0xd131('0x4b')]({'plain':!![]});return db[_0xd131('0x51')][_0xd131('0x52')]({'where':{'userProfileId':_0x40a88c['params']['id']},'raw':!![]})['then'](function(_0xdcf1ff){if(_0xdcf1ff){return BPromise['each'](_0xdcf1ff,function(_0xb70c0c){return new BPromise(function(_0x376155,_0x5e1626){if(_0xb70c0c['autoAssociation']===null||_0xb70c0c['autoAssociation']===0x1)_0x376155(null);return db['UserProfileResource'][_0xd131('0x52')]({'where':{'sectionId':_0xb70c0c['id']},'raw':!![]})[_0xd131('0x21')](function(_0x5785f5){var _0x28c9a3=_['map'](_0x5785f5,function(_0x5deed7){return qs[_0xd131('0x4e')](_0x5deed7,['id',_0xd131('0x4c'),'updatedAt',_0xd131('0x53')]);});_0x376155(_0x28c9a3);})['catch'](function(_0x164f8d){_0x5e1626(_0x164f8d);});})[_0xd131('0x21')](function(_0x39677e){var _0x3598e1=qs[_0xd131('0x4e')](_0xb70c0c,['id','createdAt',_0xd131('0x4f')]);_0x3598e1[_0xd131('0x54')]=_0x32a978['id'];if(_0x39677e)_0x3598e1['Resources']=_0x39677e;return _0x3598e1;})['then'](function(_0x218db8){return db[_0xd131('0x51')][_0xd131('0x47')](_0x218db8,{'include':[{'model':db[_0xd131('0x55')],'as':_0xd131('0x56')}],'raw':!![],'transaction':_0xeacd4});});})[_0xd131('0x21')](function(){return _0x32a978;});}});});});}})[_0xd131('0x21')](respondWithResult(_0x15e31d,0xc9))[_0xd131('0x46')](handleError(_0x15e31d,null));};exports['update']=function(_0xea5b41,_0x699987){if(_0xea5b41[_0xd131('0x48')]['id']){delete _0xea5b41['body']['id'];}return db[_0xd131('0x29')][_0xd131('0x45')]({'where':{'id':_0xea5b41['params']['id']}})['then'](handleEntityNotFound(_0x699987,null))['then'](saveUpdates(_0xea5b41[_0xd131('0x48')],null))[_0xd131('0x21')](respondWithResult(_0x699987,null))['catch'](handleError(_0x699987,null));};exports[_0xd131('0x22')]=function(_0x346a82,_0xffb1ad){return db[_0xd131('0x29')]['find']({'where':{'id':_0x346a82[_0xd131('0x4a')]['id']}})[_0xd131('0x21')](handleEntityNotFound(_0xffb1ad,null))['then'](removeEntity(_0xffb1ad,null))['catch'](handleError(_0xffb1ad,null));};exports[_0xd131('0x57')]=function(_0x40bfa4,_0x228728){return db[_0xd131('0x29')]['describe']()[_0xd131('0x21')](respondWithResult(_0x228728,null))[_0xd131('0x46')](handleError(_0x228728,null));};exports[_0xd131('0x58')]=function(_0x9dff18,_0x207337){var _0x546922=_0x9dff18[_0xd131('0x48')];return db[_0xd131('0x29')][_0xd131('0x45')]({'where':{'id':_0x9dff18[_0xd131('0x4a')]['id']}})[_0xd131('0x21')](handleEntityNotFound(_0x207337,null))[_0xd131('0x21')](function(_0x3e7ce4){if(_0x3e7ce4){return db[_0xd131('0x59')][_0xd131('0x50')](function(_0x258975){return db[_0xd131('0x51')][_0xd131('0x22')]({'where':{'userProfileId':_0x9dff18[_0xd131('0x4a')]['id'],'sectionId':_['map'](_0x546922,function(_0x25f444){return _0x25f444[_0xd131('0x53')];})},'transaction':_0x258975})[_0xd131('0x21')](function(){var _0x3fe0ac=_['map'](_0x546922,function(_0x23e3c1){_0x23e3c1[_0xd131('0x54')]=_0x9dff18[_0xd131('0x4a')]['id'];return _0x23e3c1;});var _0x4249b3=[];return BPromise[_0xd131('0x5a')](_0x3fe0ac,function(_0x1409ad){return db[_0xd131('0x51')][_0xd131('0x47')](_0x1409ad,{'include':[{'model':db[_0xd131('0x55')],'as':_0xd131('0x56')}],'raw':!![],'transaction':_0x258975})[_0xd131('0x21')](function(_0x44ae58){_0x4249b3[_0xd131('0x5b')](_0x44ae58[_0xd131('0x4b')]({'plain':!![]}));});})['then'](function(){return _0x4249b3;});});});}})['then'](function(_0x19f944){return _0x19f944;})[_0xd131('0x21')](respondWithResult(_0x207337,null))['catch'](handleError(_0x207337,null));};exports['removeSections']=function(_0x103669,_0x38cc89){var _0x459c15;return db['UserProfile']['find']({'where':{'id':_0x103669[_0xd131('0x4a')]['id']},'attributes':['id',_0xd131('0x26')]})['then'](handleEntityNotFound(_0x38cc89,null))[_0xd131('0x21')](function(_0xb1e2b1){if(_0xb1e2b1){_0x459c15=_0xb1e2b1;return db[_0xd131('0x51')]['destroy']({'where':{'userProfileId':_0x103669[_0xd131('0x4a')]['id'],'sectionId':_0x103669[_0xd131('0x2e')][_0xd131('0x5c')]}});}})[_0xd131('0x21')](function(){return _0x459c15;})['then'](respondWithStatusCode(_0x38cc89,null))[_0xd131('0x46')](handleError(_0x38cc89,null));};exports[_0xd131('0x5d')]=function(_0x4cece3,_0x13d5a7){var _0x51ed24=[];var _0x10e88a=[];return db[_0xd131('0x51')][_0xd131('0x52')]({'where':{'userProfileId':_0x4cece3['params']['id']},'raw':!![]})['then'](function(_0x31a232){_0x51ed24=_[_0xd131('0x3c')](_0x31a232,function(_0xbec95c){return _0xbec95c[_0xd131('0x5e')]===0x1||_[_0xd131('0x5f')]([0x3eb,0x709],_0xbec95c[_0xd131('0x53')]);});if(!_[_0xd131('0x60')](_0x51ed24)){return _[_0xd131('0x2d')](_0x51ed24,function(_0x1b5c04){return _0x1b5c04[_0xd131('0x53')];});}else{return;}})[_0xd131('0x21')](function(_0x45aebe){if(_0x45aebe)_0x10e88a=_0x45aebe;if(_[_0xd131('0x5f')](_0x10e88a,0x64)){var _0x7abdb8=_['find'](_0x51ed24,{'sectionId':0x64});return hasDefaultDashboard(_0x7abdb8)[_0xd131('0x21')](function(_0x5321e4){return _[_0xd131('0x2d')](_0x51ed24,function(_0x3189a1){if(_0x3189a1['sectionId']===0x64){_0x3189a1['subsections']=_0x5321e4;}return _0x3189a1;});});}else{return;}})[_0xd131('0x21')](function(_0x45bea8){if(_0x45bea8)_0x51ed24=_0x45bea8;if(_[_0xd131('0x5f')](_0x10e88a,0x3eb)){var _0x300ae3=_[_0xd131('0x45')](_0x51ed24,{'sectionId':0x3eb});return getCustomDashboards(_0x300ae3)[_0xd131('0x21')](function(_0x5bce0f){return _[_0xd131('0x2d')](_0x51ed24,function(_0x3fe51b){if(_0x300ae3[_0xd131('0x5e')]){if(_0x3fe51b['sectionId']===0x3eb){_0x3fe51b[_0xd131('0x61')]=_0x5bce0f;}}else{if(_0x3fe51b[_0xd131('0x53')]===0x64){if(!_0x3fe51b[_0xd131('0x61')]){_0x3fe51b[_0xd131('0x61')]=[];}_0x3fe51b[_0xd131('0x61')]=_0x3fe51b[_0xd131('0x61')]['concat'](_0x5bce0f);}}return _0x3fe51b;});});}else{return;}})[_0xd131('0x21')](function(_0x59b6f2){if(_0x59b6f2)_0x51ed24=_0x59b6f2;if(_[_0xd131('0x5f')](_0x10e88a,0x709)){var _0x1aa239=_[_0xd131('0x45')](_0x51ed24,{'sectionId':0x709});return getPlugins(_0x1aa239)[_0xd131('0x21')](function(_0x4f4ce7){if(_0x1aa239['enabled']){return _[_0xd131('0x2d')](_0x51ed24,function(_0x358423){if(_0x358423['sectionId']===0x709){_0x358423[_0xd131('0x61')]=_0x4f4ce7;}return _0x358423;});}else{var _0x456471={'sectionId':0x76c,'enabled':0x1,'subsections':_0x4f4ce7};var _0x474eb5=_[_0xd131('0x2d')](_0x51ed24);_0x474eb5[_0xd131('0x5b')](_0x456471);return _0x474eb5;}});}else{return;}})[_0xd131('0x21')](function(_0x19d9c9){if(_0x19d9c9)_0x51ed24=_0x19d9c9;return _[_0xd131('0x3c')](_0x51ed24,['enabled',0x1]);})[_0xd131('0x21')](respondWithResult(_0x13d5a7,null))['catch'](handleError(_0x13d5a7,null));};function hasDefaultDashboard(_0x41e45d){var _0x3e6729=[0x65];return new BPromise(function(_0x3327db,_0x1ac5be){try{if(_0x41e45d['autoAssociation']){_0x3327db(_0x3e6729);}else{return db['UserProfileResource'][_0xd131('0x62')]({'where':{'sectionId':_0x41e45d['id']},'raw':!![]})['then'](function(_0x4ea856){_0x4ea856?_0x3327db(_0x3e6729):_0x3327db();});}}catch(_0xe6740e){_0x1ac5be(_0xe6740e);}});}function getCustomDashboards(_0x534ed5){var _0x234eaf=[];return new BPromise(function(_0x17493d,_0x3383c6){try{if(_0x534ed5[_0xd131('0x63')]){return db['Dashboard'][_0xd131('0x52')]({'raw':!![]})[_0xd131('0x21')](function(_0x135f8f){_0x135f8f[_0xd131('0x64')](function(_0x25fa99){_0x234eaf[_0xd131('0x5b')](_0x25fa99['id']+0x1869f);});_0x17493d(_0x234eaf);});}else{return db[_0xd131('0x55')][_0xd131('0x52')]({'where':{'sectionId':_0x534ed5['id']},'raw':!![]})[_0xd131('0x21')](function(_0x539ed2){_0x539ed2[_0xd131('0x64')](function(_0x40b577){_0x234eaf[_0xd131('0x5b')](_0x40b577['resourceId']+0x1869f);});_0x17493d(_0x234eaf);});}}catch(_0x2bb465){_0x3383c6(_0x2bb465);}});}function getPlugins(_0x5e803e){var _0x165ca0=[];return new BPromise(function(_0x38f7b3,_0xad15de){try{if(_0x5e803e['autoAssociation']){return db[_0xd131('0x65')][_0xd131('0x52')]({'raw':!![]})[_0xd131('0x21')](function(_0x587826){_0x587826['forEach'](function(_0xd3f490){_0x165ca0['push'](_0xd3f490['id']+0x15b38);});_0x38f7b3(_0x165ca0);});}else{return db[_0xd131('0x55')][_0xd131('0x52')]({'where':{'sectionId':_0x5e803e['id']},'raw':!![]})['then'](function(_0xeeab03){_0xeeab03[_0xd131('0x64')](function(_0x43c2a0){_0x165ca0[_0xd131('0x5b')](_0x43c2a0[_0xd131('0x66')]+0x15b38);});_0x38f7b3(_0x165ca0);});}}catch(_0x702ab6){_0xad15de(_0x702ab6);}});}exports['addResources']=function(_0x11223a,_0x45777a){return db['UserProfile'][_0xd131('0x45')]({'where':{'id':_0x11223a[_0xd131('0x4a')]['id']}})[_0xd131('0x21')](handleEntityNotFound(_0x45777a,null))[_0xd131('0x21')](function(_0x3c63b1){if(_0x3c63b1){return db[_0xd131('0x59')]['transaction'](function(_0x501eb6){return db[_0xd131('0x51')][_0xd131('0x52')]({'where':{'userProfileId':_0x11223a[_0xd131('0x4a')]['id']},'attributes':['id'],'raw':!![]})[_0xd131('0x21')](function(_0x298ce0){if(_0x298ce0){return db[_0xd131('0x51')][_0xd131('0x22')]({'where':{'userProfileId':_0x11223a[_0xd131('0x4a')]['id'],'id':_[_0xd131('0x2d')](_0x298ce0,function(_0x1f8705){return _0x1f8705['id'];})},'transaction':_0x501eb6});}})[_0xd131('0x21')](function(_0x512080){var _0x4fdfb3=_['map'](_0x11223a[_0xd131('0x48')],function(_0x2e2993){_0x2e2993[_0xd131('0x54')]=_0x11223a[_0xd131('0x4a')]['id'];return _0x2e2993;});return db[_0xd131('0x51')][_0xd131('0x67')](_0x4fdfb3,{'raw':!![],'transaction':_0x501eb6});})[_0xd131('0x21')](function(_0x23e2f3){var _0x2b9fc9=_['filter'](_[_0xd131('0x2d')](_0x23e2f3,function(_0x42235e){return _0x42235e[_0xd131('0x4b')]({'plain':!![]});}),{'includeAll':![]});if(_0x2b9fc9){return db[_0xd131('0x51')][_0xd131('0x52')]({'where':{'userProfileId':_0x11223a[_0xd131('0x4a')]['id'],'sectionId':_[_0xd131('0x2d')](_0x2b9fc9,function(_0xd4eb13){return _0xd4eb13[_0xd131('0x53')];})},'attributes':['id','sectionId'],'raw':!![]})[_0xd131('0x21')](function(_0x2c055f){var _0x2a168c=_[_0xd131('0x2d')](_0x11223a[_0xd131('0x48')],function(_0x290d60){_0x290d60[_0xd131('0x54')]=_0x11223a[_0xd131('0x4a')]['id'];return _0x290d60;});return db['UserProfileResource']['bulkCreate'](_0x2a168c,{'raw':!![],'transaction':_0x501eb6});});}})[_0xd131('0x46')](handleError(_0x45777a,null));});}})[_0xd131('0x21')](function(_0x3ca2a4){var _0x5a0451=_['map'](_0x3ca2a4,function(_0x386929){return _0x386929[_0xd131('0x4b')]({'plain':!![]});});})[_0xd131('0x21')](respondWithResult(_0x45777a,null))[_0xd131('0x46')](handleError(_0x45777a,null));};exports[_0xd131('0x68')]=function(_0x5d064e,_0x2386a3,_0x3dacf5){return db['UserProfile'][_0xd131('0x45')]({'where':{'id':_0x5d064e['params']['id']}})[_0xd131('0x21')](handleEntityNotFound(_0x2386a3,null))['then'](function(_0x3bc030){if(_0x3bc030){return _0x3bc030['removeResources'](_0x5d064e[_0xd131('0x2e')][_0xd131('0x5c')]);}})[_0xd131('0x21')](respondWithStatusCode(_0x2386a3,null))[_0xd131('0x46')](handleError(_0x2386a3,null));};exports[_0xd131('0x69')]=function(_0x2e2835,_0x17ce02){var _0x52418e={};if(!_0x2e2835[_0xd131('0x2e')][_0xd131('0x6a')])throw new Error(_0xd131('0x6b'));if(!_0x2e2835[_0xd131('0x2e')][_0xd131('0x35')]('nolimit')){_0x52418e[_0xd131('0x36')]=qs[_0xd131('0x36')](_0x2e2835['query']['limit']);_0x52418e[_0xd131('0x37')]=qs['offset'](_0x2e2835[_0xd131('0x2e')][_0xd131('0x37')]);}return db['UserProfile']['find']({'where':{'id':_0x2e2835['params']['id']}})['then'](function(_0x25151f){if(!_0x25151f)throw new Error(_0xd131('0x6c')+_0x2e2835[_0xd131('0x4a')]['id']);return db['UserProfile'][_0xd131('0x69')](_0x2e2835);})[_0xd131('0x21')](respondWithFilteredResult(_0x17ce02,_0x52418e))[_0xd131('0x46')](handleError(_0x17ce02,null));}; \ No newline at end of file +var _0x421d=['moment','bluebird','mustache','util','ejs','fs-extra','squel','crypto','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','UserProfile','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','body','clone','createdAt','updatedAt','crudPermissions','transaction','get','UserProfileSection','findAll','autoAssociation','UserProfileResource','omit','userProfileId','Resources','describe','addSections','sequelize','each','push','removeSections','getSections','enabled','sectionId','isEmpty','subsections','includes','concat','findOne','Dashboard','forEach','addResources','bulkCreate','removeResources','ids','getResources','section','Missing\x20section\x20parameter','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x2406b5,_0x14cc18){var _0x107bc3=function(_0x464507){while(--_0x464507){_0x2406b5['push'](_0x2406b5['shift']());}};_0x107bc3(++_0x14cc18);}(_0x421d,0xe4));var _0xd421=function(_0x125ff8,_0x41925f){_0x125ff8=_0x125ff8-0x0;var _0x2d9ef=_0x421d[_0x125ff8];return _0x2d9ef;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd421('0x0'));var zipdir=require(_0xd421('0x1'));var jsonpatch=require(_0xd421('0x2'));var rp=require(_0xd421('0x3'));var moment=require(_0xd421('0x4'));var BPromise=require(_0xd421('0x5'));var Mustache=require(_0xd421('0x6'));var util=require(_0xd421('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd421('0x8'));var fs=require('fs');var fs_extra=require(_0xd421('0x9'));var _=require('lodash');var squel=require(_0xd421('0xa'));var crypto=require(_0xd421('0xb'));var jsforce=require(_0xd421('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xd421('0xd'));var querystring=require(_0xd421('0xe'));var Papa=require('papaparse');var Redis=require(_0xd421('0xf'));var authService=require(_0xd421('0x10'));var qs=require(_0xd421('0x11'));var as=require(_0xd421('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd421('0x13'))(_0xd421('0x14'));var utils=require('../../config/utils');var config=require(_0xd421('0x15'));var licenseUtil=require(_0xd421('0x16'));var db=require('../../mysqldb')['db'];config[_0xd421('0x17')]=_[_0xd421('0x18')](config[_0xd421('0x17')],{'host':_0xd421('0x19'),'port':0x18eb});var socket=require(_0xd421('0x1a'))(new Redis(config['redis']));require(_0xd421('0x1b'))[_0xd421('0x1c')](socket);function respondWithStatusCode(_0x53fc44,_0x46d0ee){_0x46d0ee=_0x46d0ee||0xcc;return function(_0x1cfeef){if(_0x1cfeef){return _0x53fc44[_0xd421('0x1d')](_0x46d0ee);}return _0x53fc44[_0xd421('0x1e')](_0x46d0ee)[_0xd421('0x1f')]();};}function respondWithResult(_0x4855e9,_0x13d809){_0x13d809=_0x13d809||0xc8;return function(_0x346f4c){if(_0x346f4c){return _0x4855e9['status'](_0x13d809)[_0xd421('0x20')](_0x346f4c);}};}function respondWithFilteredResult(_0x357d13,_0x2d70b0){return function(_0x3b1bd2){if(_0x3b1bd2){var _0xc90458=typeof _0x2d70b0[_0xd421('0x21')]===_0xd421('0x22')&&typeof _0x2d70b0[_0xd421('0x23')]===_0xd421('0x22');var _0x1d382c=_0x3b1bd2['count'];var _0x54d68f=_0xc90458?0x0:_0x2d70b0['offset'];var _0xf80d4b=_0xc90458?_0x3b1bd2[_0xd421('0x24')]:_0x2d70b0['offset']+_0x2d70b0[_0xd421('0x23')];var _0x2f9ad8;if(_0xf80d4b>=_0x1d382c){_0xf80d4b=_0x1d382c;_0x2f9ad8=0xc8;}else{_0x2f9ad8=0xce;}_0x357d13['status'](_0x2f9ad8);return _0x357d13['set'](_0xd421('0x25'),_0x54d68f+'-'+_0xf80d4b+'/'+_0x1d382c)['json'](_0x3b1bd2);}return null;};}function patchUpdates(_0x2a94f8){return function(_0x4a4a3a){try{jsonpatch[_0xd421('0x26')](_0x4a4a3a,_0x2a94f8,!![]);}catch(_0xad8ec9){return BPromise[_0xd421('0x27')](_0xad8ec9);}return _0x4a4a3a[_0xd421('0x28')]();};}function saveUpdates(_0x2f032f,_0x503f52){return function(_0x31f952){if(_0x31f952){return _0x31f952[_0xd421('0x29')](_0x2f032f)[_0xd421('0x2a')](function(_0x510dc8){return _0x510dc8;});}return null;};}function removeEntity(_0x1dc5b4,_0x4a73e8){return function(_0x1ea92e){if(_0x1ea92e){return _0x1ea92e[_0xd421('0x2b')]()[_0xd421('0x2a')](function(){_0x1dc5b4['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x258622,_0x169ffb){return function(_0x46e187){if(!_0x46e187){_0x258622[_0xd421('0x1d')](0x194);}return _0x46e187;};}function handleError(_0x358ea3,_0x3f900b){_0x3f900b=_0x3f900b||0x1f4;return function(_0x582e9c){logger[_0xd421('0x2c')](_0x582e9c[_0xd421('0x2d')]);if(_0x582e9c[_0xd421('0x2e')]){delete _0x582e9c[_0xd421('0x2e')];}_0x358ea3[_0xd421('0x1e')](_0x3f900b)[_0xd421('0x2f')](_0x582e9c);};}exports[_0xd421('0x30')]=function(_0x537ea4,_0x271ac0){var _0x336f52={},_0x4f0ec2={},_0x26049d={'count':0x0,'rows':[]};var _0x4632ab=_[_0xd421('0x31')](db[_0xd421('0x32')][_0xd421('0x33')],function(_0x400d7e){return{'name':_0x400d7e[_0xd421('0x34')],'type':_0x400d7e[_0xd421('0x35')][_0xd421('0x36')]};});_0x4f0ec2[_0xd421('0x37')]=_[_0xd421('0x31')](_0x4632ab,_0xd421('0x2e'));_0x4f0ec2[_0xd421('0x38')]=_[_0xd421('0x39')](_0x537ea4[_0xd421('0x38')]);_0x4f0ec2['filters']=_[_0xd421('0x3a')](_0x4f0ec2['model'],_0x4f0ec2[_0xd421('0x38')]);_0x336f52[_0xd421('0x3b')]=_[_0xd421('0x3a')](_0x4f0ec2[_0xd421('0x37')],qs[_0xd421('0x3c')](_0x537ea4[_0xd421('0x38')][_0xd421('0x3c')]));_0x336f52[_0xd421('0x3b')]=_0x336f52[_0xd421('0x3b')][_0xd421('0x3d')]?_0x336f52[_0xd421('0x3b')]:_0x4f0ec2[_0xd421('0x37')];if(!_0x537ea4[_0xd421('0x38')][_0xd421('0x3e')](_0xd421('0x3f'))){_0x336f52[_0xd421('0x23')]=qs[_0xd421('0x23')](_0x537ea4[_0xd421('0x38')][_0xd421('0x23')]);_0x336f52[_0xd421('0x21')]=qs[_0xd421('0x21')](_0x537ea4[_0xd421('0x38')][_0xd421('0x21')]);}_0x336f52['order']=qs[_0xd421('0x40')](_0x537ea4[_0xd421('0x38')]['sort']);_0x336f52[_0xd421('0x41')]=qs[_0xd421('0x42')](_['pick'](_0x537ea4[_0xd421('0x38')],_0x4f0ec2[_0xd421('0x42')]),_0x4632ab);if(_0x537ea4['query'][_0xd421('0x43')]){_0x336f52[_0xd421('0x41')]=_[_0xd421('0x44')](_0x336f52[_0xd421('0x41')],{'$or':_[_0xd421('0x31')](_0x4632ab,function(_0x2a5034){if(_0x2a5034[_0xd421('0x35')]!==_0xd421('0x45')){var _0x472214={};_0x472214[_0x2a5034['name']]={'$like':'%'+_0x537ea4[_0xd421('0x38')][_0xd421('0x43')]+'%'};return _0x472214;}})});}_0x336f52=_['merge']({},_0x336f52,_0x537ea4[_0xd421('0x46')]);var _0x452e58={'where':_0x336f52[_0xd421('0x41')]};return db['UserProfile'][_0xd421('0x24')](_0x452e58)[_0xd421('0x2a')](function(_0xead06d){_0x26049d[_0xd421('0x24')]=_0xead06d;if(_0x537ea4[_0xd421('0x38')][_0xd421('0x47')]){_0x336f52[_0xd421('0x48')]=[{'all':!![]}];}return db[_0xd421('0x32')]['findAll'](_0x336f52);})['then'](function(_0x40e7e5){_0x26049d[_0xd421('0x49')]=_0x40e7e5;return _0x26049d;})[_0xd421('0x2a')](respondWithFilteredResult(_0x271ac0,_0x336f52))[_0xd421('0x4a')](handleError(_0x271ac0,null));};exports[_0xd421('0x4b')]=function(_0x39afa2,_0x442dcf){var _0x39f081={'raw':![],'where':{'id':_0x39afa2[_0xd421('0x4c')]['id']}},_0x22843c={};_0x22843c['model']=_['keys'](db[_0xd421('0x32')]['rawAttributes']);_0x22843c[_0xd421('0x38')]=_[_0xd421('0x39')](_0x39afa2['query']);_0x22843c[_0xd421('0x42')]=_[_0xd421('0x3a')](_0x22843c[_0xd421('0x37')],_0x22843c[_0xd421('0x38')]);_0x39f081['attributes']=_[_0xd421('0x3a')](_0x22843c[_0xd421('0x37')],qs['fields'](_0x39afa2[_0xd421('0x38')][_0xd421('0x3c')]));_0x39f081[_0xd421('0x3b')]=_0x39f081[_0xd421('0x3b')]['length']?_0x39f081['attributes']:_0x22843c[_0xd421('0x37')];if(_0x39afa2[_0xd421('0x38')][_0xd421('0x47')]){_0x39f081[_0xd421('0x48')]=[{'all':!![]}];}_0x39f081=_[_0xd421('0x44')]({},_0x39f081,_0x39afa2[_0xd421('0x46')]);return db['UserProfile'][_0xd421('0x4d')](_0x39f081)[_0xd421('0x2a')](handleEntityNotFound(_0x442dcf,null))[_0xd421('0x2a')](respondWithResult(_0x442dcf,null))[_0xd421('0x4a')](handleError(_0x442dcf,null));};exports[_0xd421('0x4e')]=function(_0x4aa1f8,_0x2ca5bf){return db[_0xd421('0x32')][_0xd421('0x4e')](_0x4aa1f8[_0xd421('0x4f')],{})['then'](respondWithResult(_0x2ca5bf,0xc9))['catch'](handleError(_0x2ca5bf,null));};exports[_0xd421('0x50')]=function(_0x7e0c6f,_0x48939a){var _0x3610ef={'where':{'id':_0x7e0c6f['params']['id']}},_0x134557={};_0x134557['model']=_[_0xd421('0x39')](db[_0xd421('0x32')][_0xd421('0x33')]);_0x3610ef['attributes']=_['intersection'](_0x134557[_0xd421('0x37')],qs['fields'](_0x7e0c6f['query'][_0xd421('0x3c')]));_0x3610ef['attributes']=_0x3610ef[_0xd421('0x3b')][_0xd421('0x3d')]?_0x3610ef[_0xd421('0x3b')]:_0x134557[_0xd421('0x37')];if(_0x7e0c6f[_0xd421('0x38')][_0xd421('0x47')]){_0x3610ef[_0xd421('0x48')]=[{'all':!![]}];}_0x3610ef=_['merge']({},_0x3610ef,_0x7e0c6f['options']);return db[_0xd421('0x32')][_0xd421('0x4d')](_0x3610ef)[_0xd421('0x2a')](handleEntityNotFound(_0x48939a,null))[_0xd421('0x2a')](function(_0x482f64){if(_0x482f64){var _0x4ef55d=_0x482f64['get']({'plain':!![]});_0x4ef55d=qs['omit'](_0x4ef55d,['id',_0xd421('0x51'),_0xd421('0x52'),_0xd421('0x53')]);_0x7e0c6f[_0xd421('0x4f')]=_['omit'](_0x7e0c6f['body'],['id','createdAt',_0xd421('0x52')]);return db['sequelize'][_0xd421('0x54')](function(_0x85ad72){return db[_0xd421('0x32')]['create'](_[_0xd421('0x44')](_0x4ef55d,_0x7e0c6f[_0xd421('0x4f')]),{'include':_0x7e0c6f[_0xd421('0x38')][_0xd421('0x47')]?[{'all':!![]}]:undefined,'transaction':_0x85ad72})[_0xd421('0x2a')](function(_0x5114e3){var _0x3df73c=_0x5114e3[_0xd421('0x55')]({'plain':!![]});return db[_0xd421('0x56')][_0xd421('0x57')]({'where':{'userProfileId':_0x7e0c6f['params']['id']},'raw':!![]})['then'](function(_0x4173df){if(_0x4173df){return BPromise['each'](_0x4173df,function(_0x4cb584){return new BPromise(function(_0x4be284,_0x1aba65){if(_0x4cb584[_0xd421('0x58')]===null||_0x4cb584['autoAssociation']===0x1)_0x4be284(null);return db[_0xd421('0x59')]['findAll']({'where':{'sectionId':_0x4cb584['id']},'raw':!![]})[_0xd421('0x2a')](function(_0x15c013){var _0x54d267=_['map'](_0x15c013,function(_0x8a06f6){return qs[_0xd421('0x5a')](_0x8a06f6,['id',_0xd421('0x51'),_0xd421('0x52'),'sectionId']);});_0x4be284(_0x54d267);})[_0xd421('0x4a')](function(_0xfc4de1){_0x1aba65(_0xfc4de1);});})[_0xd421('0x2a')](function(_0x4bac46){var _0x20a7ff=qs[_0xd421('0x5a')](_0x4cb584,['id',_0xd421('0x51'),'updatedAt']);_0x20a7ff[_0xd421('0x5b')]=_0x3df73c['id'];if(_0x4bac46)_0x20a7ff[_0xd421('0x5c')]=_0x4bac46;return _0x20a7ff;})[_0xd421('0x2a')](function(_0x7eaa1c){return db[_0xd421('0x56')][_0xd421('0x4e')](_0x7eaa1c,{'include':[{'model':db['UserProfileResource'],'as':_0xd421('0x5c')}],'raw':!![],'transaction':_0x85ad72});});})['then'](function(){return _0x3df73c;});}});});});}})[_0xd421('0x2a')](respondWithResult(_0x48939a,0xc9))[_0xd421('0x4a')](handleError(_0x48939a,null));};exports['update']=function(_0x97c59e,_0x3730cd){if(_0x97c59e[_0xd421('0x4f')]['id']){delete _0x97c59e[_0xd421('0x4f')]['id'];}return db[_0xd421('0x32')]['find']({'where':{'id':_0x97c59e['params']['id']}})['then'](handleEntityNotFound(_0x3730cd,null))[_0xd421('0x2a')](saveUpdates(_0x97c59e[_0xd421('0x4f')],null))[_0xd421('0x2a')](respondWithResult(_0x3730cd,null))[_0xd421('0x4a')](handleError(_0x3730cd,null));};exports[_0xd421('0x2b')]=function(_0x49cbd8,_0x5a5241){return db[_0xd421('0x32')][_0xd421('0x4d')]({'where':{'id':_0x49cbd8[_0xd421('0x4c')]['id']}})[_0xd421('0x2a')](handleEntityNotFound(_0x5a5241,null))[_0xd421('0x2a')](removeEntity(_0x5a5241,null))[_0xd421('0x4a')](handleError(_0x5a5241,null));};exports[_0xd421('0x5d')]=function(_0x2199c2,_0x4b6a3f){return db[_0xd421('0x32')]['describe']()[_0xd421('0x2a')](respondWithResult(_0x4b6a3f,null))[_0xd421('0x4a')](handleError(_0x4b6a3f,null));};exports[_0xd421('0x5e')]=function(_0xc4c63d,_0x375152){var _0xe4c559=_0xc4c63d[_0xd421('0x4f')];return db[_0xd421('0x32')][_0xd421('0x4d')]({'where':{'id':_0xc4c63d[_0xd421('0x4c')]['id']}})[_0xd421('0x2a')](handleEntityNotFound(_0x375152,null))[_0xd421('0x2a')](function(_0x339b84){if(_0x339b84){return db[_0xd421('0x5f')]['transaction'](function(_0x31e03f){return db['UserProfileSection']['destroy']({'where':{'userProfileId':_0xc4c63d[_0xd421('0x4c')]['id'],'sectionId':_[_0xd421('0x31')](_0xe4c559,function(_0x38e3ae){return _0x38e3ae['sectionId'];})},'transaction':_0x31e03f})[_0xd421('0x2a')](function(){var _0x421e03=_[_0xd421('0x31')](_0xe4c559,function(_0x3d7937){_0x3d7937['userProfileId']=_0xc4c63d['params']['id'];return _0x3d7937;});var _0x5a8d60=[];return BPromise[_0xd421('0x60')](_0x421e03,function(_0x51544f){return db[_0xd421('0x56')][_0xd421('0x4e')](_0x51544f,{'include':[{'model':db[_0xd421('0x59')],'as':'Resources'}],'raw':!![],'transaction':_0x31e03f})[_0xd421('0x2a')](function(_0x2435e0){_0x5a8d60[_0xd421('0x61')](_0x2435e0[_0xd421('0x55')]({'plain':!![]}));});})['then'](function(){return _0x5a8d60;});});});}})[_0xd421('0x2a')](function(_0x195cb2){return _0x195cb2;})[_0xd421('0x2a')](respondWithResult(_0x375152,null))[_0xd421('0x4a')](handleError(_0x375152,null));};exports[_0xd421('0x62')]=function(_0x282d0e,_0x97479c){var _0x29db83;return db[_0xd421('0x32')][_0xd421('0x4d')]({'where':{'id':_0x282d0e[_0xd421('0x4c')]['id']},'attributes':['id',_0xd421('0x2e')]})[_0xd421('0x2a')](handleEntityNotFound(_0x97479c,null))[_0xd421('0x2a')](function(_0x282d19){if(_0x282d19){_0x29db83=_0x282d19;return db['UserProfileSection']['destroy']({'where':{'userProfileId':_0x282d0e[_0xd421('0x4c')]['id'],'sectionId':_0x282d0e[_0xd421('0x38')]['ids']}});}})['then'](function(){return _0x29db83;})['then'](respondWithStatusCode(_0x97479c,null))[_0xd421('0x4a')](handleError(_0x97479c,null));};exports[_0xd421('0x63')]=function(_0x2843a5,_0x708ef6){var _0x289c27=[];var _0xd15df1=[];return db[_0xd421('0x56')]['findAll']({'where':{'userProfileId':_0x2843a5[_0xd421('0x4c')]['id']},'raw':!![]})[_0xd421('0x2a')](function(_0x1785d6){_0x289c27=_[_0xd421('0x43')](_0x1785d6,function(_0x1d33f8){return _0x1d33f8[_0xd421('0x64')]===0x1||_['includes']([0x3eb,0x709],_0x1d33f8[_0xd421('0x65')]);});if(!_[_0xd421('0x66')](_0x289c27)){return _[_0xd421('0x31')](_0x289c27,function(_0x112528){return _0x112528[_0xd421('0x65')];});}else{return;}})['then'](function(_0x5e86e2){if(_0x5e86e2)_0xd15df1=_0x5e86e2;if(_['includes'](_0xd15df1,0x64)){var _0x376609=_['find'](_0x289c27,{'sectionId':0x64});return hasDefaultDashboard(_0x376609)[_0xd421('0x2a')](function(_0x27aaab){return _['map'](_0x289c27,function(_0x1075bb){if(_0x1075bb[_0xd421('0x65')]===0x64){_0x1075bb[_0xd421('0x67')]=_0x27aaab;}return _0x1075bb;});});}else{return;}})['then'](function(_0x59782f){if(_0x59782f)_0x289c27=_0x59782f;if(_[_0xd421('0x68')](_0xd15df1,0x3eb)){var _0x86cb0=_['find'](_0x289c27,{'sectionId':0x3eb});return getCustomDashboards(_0x86cb0)['then'](function(_0x3ea87d){return _[_0xd421('0x31')](_0x289c27,function(_0x45e010){if(_0x86cb0['enabled']){if(_0x45e010[_0xd421('0x65')]===0x3eb){_0x45e010[_0xd421('0x67')]=_0x3ea87d;}}else{if(_0x45e010['sectionId']===0x64){if(!_0x45e010[_0xd421('0x67')]){_0x45e010[_0xd421('0x67')]=[];}_0x45e010[_0xd421('0x67')]=_0x45e010['subsections'][_0xd421('0x69')](_0x3ea87d);}}return _0x45e010;});});}else{return;}})[_0xd421('0x2a')](function(_0x140026){if(_0x140026)_0x289c27=_0x140026;if(_[_0xd421('0x68')](_0xd15df1,0x709)){var _0x1945c0=_[_0xd421('0x4d')](_0x289c27,{'sectionId':0x709});return getPlugins(_0x1945c0)[_0xd421('0x2a')](function(_0x365d01){if(_0x1945c0['enabled']){return _[_0xd421('0x31')](_0x289c27,function(_0xa04a54){if(_0xa04a54[_0xd421('0x65')]===0x709){_0xa04a54[_0xd421('0x67')]=_0x365d01;}return _0xa04a54;});}else{var _0x5d5826={'sectionId':0x76c,'enabled':0x1,'subsections':_0x365d01};var _0x1a199b=_[_0xd421('0x31')](_0x289c27);_0x1a199b[_0xd421('0x61')](_0x5d5826);return _0x1a199b;}});}else{return;}})[_0xd421('0x2a')](function(_0x5a9334){if(_0x5a9334)_0x289c27=_0x5a9334;return _['filter'](_0x289c27,[_0xd421('0x64'),0x1]);})[_0xd421('0x2a')](respondWithResult(_0x708ef6,null))[_0xd421('0x4a')](handleError(_0x708ef6,null));};function hasDefaultDashboard(_0x39a057){var _0x35798e=[0x65];return new BPromise(function(_0x54abc7,_0x313f1f){try{if(_0x39a057[_0xd421('0x58')]){_0x54abc7(_0x35798e);}else{return db['UserProfileResource'][_0xd421('0x6a')]({'where':{'sectionId':_0x39a057['id']},'raw':!![]})['then'](function(_0x5c5965){_0x5c5965?_0x54abc7(_0x35798e):_0x54abc7();});}}catch(_0x465c64){_0x313f1f(_0x465c64);}});}function getCustomDashboards(_0x3c8602){var _0x2fbc04=[];return new BPromise(function(_0x614b7b,_0x3ded41){try{if(_0x3c8602[_0xd421('0x58')]){return db[_0xd421('0x6b')][_0xd421('0x57')]({'raw':!![]})[_0xd421('0x2a')](function(_0xccb2b0){_0xccb2b0[_0xd421('0x6c')](function(_0xe65587){_0x2fbc04[_0xd421('0x61')](_0xe65587['id']+0x1869f);});_0x614b7b(_0x2fbc04);});}else{return db['UserProfileResource'][_0xd421('0x57')]({'where':{'sectionId':_0x3c8602['id']},'raw':!![]})[_0xd421('0x2a')](function(_0x4858ae){_0x4858ae[_0xd421('0x6c')](function(_0x3218ab){_0x2fbc04[_0xd421('0x61')](_0x3218ab['resourceId']+0x1869f);});_0x614b7b(_0x2fbc04);});}}catch(_0x509285){_0x3ded41(_0x509285);}});}function getPlugins(_0x502b85){var _0x2146bb=[];return new BPromise(function(_0x5a9d42,_0x20021b){try{if(_0x502b85[_0xd421('0x58')]){return db['Plugin']['findAll']({'raw':!![]})[_0xd421('0x2a')](function(_0x276e55){_0x276e55[_0xd421('0x6c')](function(_0x6c4931){_0x2146bb['push'](_0x6c4931['id']+0x15b38);});_0x5a9d42(_0x2146bb);});}else{return db[_0xd421('0x59')][_0xd421('0x57')]({'where':{'sectionId':_0x502b85['id']},'raw':!![]})[_0xd421('0x2a')](function(_0xac7b13){_0xac7b13[_0xd421('0x6c')](function(_0x46d6a4){_0x2146bb[_0xd421('0x61')](_0x46d6a4['resourceId']+0x15b38);});_0x5a9d42(_0x2146bb);});}}catch(_0x40ad35){_0x20021b(_0x40ad35);}});}exports[_0xd421('0x6d')]=function(_0x22db02,_0xe9586b){return db[_0xd421('0x32')][_0xd421('0x4d')]({'where':{'id':_0x22db02[_0xd421('0x4c')]['id']}})[_0xd421('0x2a')](handleEntityNotFound(_0xe9586b,null))['then'](function(_0x2ea780){if(_0x2ea780){return db[_0xd421('0x5f')][_0xd421('0x54')](function(_0x466db1){return db[_0xd421('0x56')][_0xd421('0x57')]({'where':{'userProfileId':_0x22db02[_0xd421('0x4c')]['id']},'attributes':['id'],'raw':!![]})[_0xd421('0x2a')](function(_0x79e74e){if(_0x79e74e){return db[_0xd421('0x56')][_0xd421('0x2b')]({'where':{'userProfileId':_0x22db02['params']['id'],'id':_[_0xd421('0x31')](_0x79e74e,function(_0x25029c){return _0x25029c['id'];})},'transaction':_0x466db1});}})['then'](function(_0x55d26e){var _0xc926cb=_[_0xd421('0x31')](_0x22db02[_0xd421('0x4f')],function(_0x440022){_0x440022[_0xd421('0x5b')]=_0x22db02[_0xd421('0x4c')]['id'];return _0x440022;});return db[_0xd421('0x56')][_0xd421('0x6e')](_0xc926cb,{'raw':!![],'transaction':_0x466db1});})[_0xd421('0x2a')](function(_0x4a6a3a){var _0x16eafd=_[_0xd421('0x43')](_[_0xd421('0x31')](_0x4a6a3a,function(_0x346627){return _0x346627[_0xd421('0x55')]({'plain':!![]});}),{'includeAll':![]});if(_0x16eafd){return db['UserProfileSection'][_0xd421('0x57')]({'where':{'userProfileId':_0x22db02[_0xd421('0x4c')]['id'],'sectionId':_[_0xd421('0x31')](_0x16eafd,function(_0x3abade){return _0x3abade[_0xd421('0x65')];})},'attributes':['id','sectionId'],'raw':!![]})[_0xd421('0x2a')](function(_0xe9913f){var _0x2d1aa6=_['map'](_0x22db02['body'],function(_0x2fdf18){_0x2fdf18[_0xd421('0x5b')]=_0x22db02[_0xd421('0x4c')]['id'];return _0x2fdf18;});return db['UserProfileResource']['bulkCreate'](_0x2d1aa6,{'raw':!![],'transaction':_0x466db1});});}})[_0xd421('0x4a')](handleError(_0xe9586b,null));});}})[_0xd421('0x2a')](function(_0x2546b7){var _0x514af2=_[_0xd421('0x31')](_0x2546b7,function(_0x34d597){return _0x34d597[_0xd421('0x55')]({'plain':!![]});});})[_0xd421('0x2a')](respondWithResult(_0xe9586b,null))['catch'](handleError(_0xe9586b,null));};exports[_0xd421('0x6f')]=function(_0x244aa2,_0x529684,_0x560c53){return db[_0xd421('0x32')]['find']({'where':{'id':_0x244aa2[_0xd421('0x4c')]['id']}})[_0xd421('0x2a')](handleEntityNotFound(_0x529684,null))['then'](function(_0x320d6e){if(_0x320d6e){return _0x320d6e[_0xd421('0x6f')](_0x244aa2[_0xd421('0x38')][_0xd421('0x70')]);}})[_0xd421('0x2a')](respondWithStatusCode(_0x529684,null))[_0xd421('0x4a')](handleError(_0x529684,null));};exports[_0xd421('0x71')]=function(_0x23fa5f,_0x5ddfe1){var _0x580e80={};if(!_0x23fa5f['query'][_0xd421('0x72')])throw new Error(_0xd421('0x73'));if(!_0x23fa5f[_0xd421('0x38')][_0xd421('0x3e')](_0xd421('0x3f'))){_0x580e80[_0xd421('0x23')]=qs['limit'](_0x23fa5f[_0xd421('0x38')][_0xd421('0x23')]);_0x580e80[_0xd421('0x21')]=qs['offset'](_0x23fa5f['query'][_0xd421('0x21')]);}return db[_0xd421('0x32')][_0xd421('0x4d')]({'where':{'id':_0x23fa5f[_0xd421('0x4c')]['id']}})[_0xd421('0x2a')](function(_0x159e45){if(!_0x159e45)throw new Error('No\x20User\x20Profile\x20found\x20for\x20id\x20'+_0x23fa5f[_0xd421('0x4c')]['id']);return db[_0xd421('0x32')][_0xd421('0x71')](_0x23fa5f);})['then'](respondWithFilteredResult(_0x5ddfe1,_0x580e80))['catch'](handleError(_0x5ddfe1,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index 4978a90..31cb0e6 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 _0x323f=['save','update','remove','emit','hook','exports','../../mysqldb','setMaxListeners'];(function(_0x28a00f,_0x103ad8){var _0x47f8c8=function(_0x2289fd){while(--_0x2289fd){_0x28a00f['push'](_0x28a00f['shift']());}};_0x47f8c8(++_0x103ad8);}(_0x323f,0x1ee));var _0xf323=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0x323f[_0xb0f7c3];return _0x28ea68;};'use strict';var EventEmitter=require('events');var UserProfile=require(_0xf323('0x0'))['db']['UserProfile'];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0xf323('0x1')](0x0);var events={'afterCreate':_0xf323('0x2'),'afterUpdate':_0xf323('0x3'),'afterDestroy':_0xf323('0x4')};function emitEvent(_0x111042){return function(_0x2c9d35,_0xb4caa8,_0x2d4750){UserProfileEvents[_0xf323('0x5')](_0x111042+':'+_0x2c9d35['id'],_0x2c9d35);UserProfileEvents[_0xf323('0x5')](_0x111042,_0x2c9d35);_0x2d4750(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserProfile[_0xf323('0x6')](e,emitEvent(event));}}module[_0xf323('0x7')]=UserProfileEvents; \ No newline at end of file +var _0x1574=['UserProfile','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x2f8025,_0x12039f){var _0x98b163=function(_0x590c79){while(--_0x590c79){_0x2f8025['push'](_0x2f8025['shift']());}};_0x98b163(++_0x12039f);}(_0x1574,0x148));var _0x4157=function(_0x34990e,_0x6b0647){_0x34990e=_0x34990e-0x0;var _0x2740b5=_0x1574[_0x34990e];return _0x2740b5;};'use strict';var EventEmitter=require(_0x4157('0x0'));var UserProfile=require(_0x4157('0x1'))['db'][_0x4157('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x4157('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x4157('0x4'),'afterDestroy':_0x4157('0x5')};function emitEvent(_0xab8757){return function(_0x1759d6,_0x2f0766,_0x1c528e){UserProfileEvents[_0x4157('0x6')](_0xab8757+':'+_0x1759d6['id'],_0x1759d6);UserProfileEvents[_0x4157('0x6')](_0xab8757,_0x1759d6);_0x1c528e(null);};}for(var e in events){if(events[_0x4157('0x7')](e)){var event=events[e];UserProfile[_0x4157('0x8')](e,emitEvent(event));}}module[_0x4157('0x9')]=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index 55f200f..f3226a5 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 _0x2dcd=['Telephones','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','cannedanswers','dispositions','Disposition','Dashboard','intervals','Pause','scheduler','Schedule','sounds','Sound','tags','Tag','templates','Template','triggers','Trigger','trunks','Trunk','variables','Variable','Plugin','extractedreports','AnalyticExtractedReport','metrics','AnalyticMetric','charAt','toUpperCase','Sequelize','QueryTypes','SELECT','select','ui.','ui.createdAt','from','where','ui.UserId\x20=\x20?','toString','define','UserProfile','user_profiles','../../components/parsers/qs','raw','query','mergeResources','Invalid\x20section\x20\x27','isEmpty','length','push','find','params','all','union','ignore','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','offset','order','sort','pick','key','VIRTUAL','foreignKey','forEach','merge','options','includeAll','include','reportType','default','reportId','DefaultReports','custom','CustomReports','count','rows','ids','customSorting','extraQueryConditions','CmContact','Tags','color','tag','true','sms','dataValues','fax','mail','openchannel','whatsapp','./userProfile.attributes','squel','exports','filter','field','value','findAll','associatedResources','map','catch','model','then','name','UserProfileResource','resourceId','type','toLowerCase','squareprojects','childModel','SquareProject','odbc','SquareOdbc','squarerecordings','SquareRecording','parentSections','projectName','projects','JscriptyProject','Lists','ListId','lists','CmList','globalcustomfields','CmCustomField','chatqueues','ChatQueue','chatwebsites','ChatWebsite','FaxQueue','faxaccounts','FaxAccount','inboundroutes','internalroutes','outboundroutes','VoiceExtension','contexts','voicemails','voicerecordings','Agents','membername','User','role','agent','VoiceQueues','queue','inbound','VoiceQueue','outbound','musiconholds','VoiceMusicOnHold','voiceprefixes','VoicePrefix','mailqueues','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','openchannelaccounts','smsqueues','smsaccounts','SmsAccount','WhatsappQueue','whatsappaccounts','voicequeues','queuecampaigns','QueueCampaigns','users','agents','telephones','Users','user'];(function(_0x12f5d8,_0x5b72a1){var _0x2955c2=function(_0x1809db){while(--_0x1809db){_0x12f5d8['push'](_0x12f5d8['shift']());}};_0x2955c2(++_0x5b72a1);}(_0x2dcd,0x1e8));var _0xd2dc=function(_0x172660,_0x260d9b){_0x172660=_0x172660-0x0;var _0x83204f=_0x2dcd[_0x172660];return _0x83204f;};'use strict';var _=require('lodash');var attributes=require(_0xd2dc('0x0'));var squel=require(_0xd2dc('0x1'));module[_0xd2dc('0x2')]=function(_0xc3f0c9){var _0x24b566=_0xc3f0c9['models'];function _0x192e2e(_0x393738,_0x5600d4){return new Promise(function(_0x4400c3,_0xe45a2c){if(!_0x5600d4)return _0x4400c3(null);var _0x456909=_0x5600d4[_0xd2dc('0x3')]?{[_0x5600d4[_0xd2dc('0x3')][_0xd2dc('0x4')]]:_0x5600d4['filter'][_0xd2dc('0x5')]}:undefined;return _0x24b566[_0x393738][_0xd2dc('0x6')]({'where':_0x456909,'raw':!![]})['then'](function(_0x4e133e){_0x5600d4[_0xd2dc('0x7')]=_[_0xd2dc('0x8')](_0x4e133e,'id');_0x4400c3(_0x5600d4);})[_0xd2dc('0x9')](function(_0x2b92d8){_0xe45a2c(_0x2b92d8);});});}function _0x18af63(_0x46e8bf,_0xfe6da3){return new Promise(function(_0x1d3007,_0x1d50a6){var _0x45dba6=_0x46e8bf[_0xd2dc('0x3')]?{[_0x46e8bf[_0xd2dc('0x3')][_0xd2dc('0x4')]]:_0x46e8bf[_0xd2dc('0x3')]['value']}:undefined;return _0x24b566[_0x46e8bf[_0xd2dc('0xa')]][_0xd2dc('0x6')]({'where':_0x45dba6,'raw':!![]})[_0xd2dc('0xb')](function(_0x537a57){_0xfe6da3[_0xd2dc('0x7')]=_[_0xd2dc('0x8')](_0x537a57,function(_0xf65db1){return _0xf65db1[_0xd2dc('0xc')];});_0x1d3007(_0xfe6da3);})[_0xd2dc('0x9')](function(_0x19ce0d){_0x1d50a6(_0x19ce0d);});});}function _0x3e8568(_0x11dd90,_0x5da844,_0xdcea37){if(!_0x5da844)return Promise['resolve'](null);return new Promise(function(_0x2eb735,_0x3e17ef){return _0x24b566[_0xd2dc('0xd')][_0xd2dc('0x6')]({'where':{'sectionId':_0x5da844['id']},'raw':!![]})[_0xd2dc('0xb')](function(_0x38fca0){if(_0x11dd90[_0xd2dc('0x4')]&&_0x11dd90['field']!=='id'){_0x5da844['associatedResources']=_[_0xd2dc('0x8')](_0x38fca0,function(_0xc56fe2){return _0xc56fe2[_0x11dd90['field']];});}else{if(_0xdcea37==='AnalyticExtractedReport'){_0x5da844['associatedResources']=_[_0xd2dc('0x8')](_0x38fca0,function(_0x38a680){return{'id':_0x38a680[_0xd2dc('0xe')],'type':_0x38a680[_0xd2dc('0xf')]};});}else{_0x5da844[_0xd2dc('0x7')]=_[_0xd2dc('0x8')](_0x38fca0,function(_0x9328cf){return _0x9328cf[_0xd2dc('0xe')];});}}_0x2eb735(_0x5da844);})[_0xd2dc('0x9')](function(_0x21f662){_0x3e17ef(_0x21f662);});});}function _0x2f9711(_0x5ab855,_0x17eb48){var _0x365519={'parentSections':[]};switch(_0x5ab855[_0xd2dc('0x10')]()){case _0xd2dc('0x11'):_0x365519[_0xd2dc('0x12')]=_0xd2dc('0x13');break;case _0xd2dc('0x14'):_0x365519[_0xd2dc('0x12')]=_0xd2dc('0x15');break;case _0xd2dc('0x16'):_0x365519[_0xd2dc('0x12')]=_0xd2dc('0x17');_0x365519[_0xd2dc('0x18')]=[{'name':'SquareProjects','field':_0xd2dc('0xc'),'foreignKey':_0xd2dc('0x19')}];break;case _0xd2dc('0x1a'):_0x365519[_0xd2dc('0x12')]=_0xd2dc('0x1b');break;case'contacts':_0x365519[_0xd2dc('0x12')]='CmContact';_0x365519[_0xd2dc('0x18')]=[{'name':_0xd2dc('0x1c'),'field':'id','foreignKey':_0xd2dc('0x1d')}];break;case _0xd2dc('0x1e'):_0x365519[_0xd2dc('0x12')]=_0xd2dc('0x1f');break;case'companies':_0x365519[_0xd2dc('0x12')]='CmCompany';break;case _0xd2dc('0x20'):_0x365519[_0xd2dc('0x12')]=_0xd2dc('0x21');break;case _0xd2dc('0x22'):_0x365519[_0xd2dc('0x12')]=_0xd2dc('0x23');break;case _0xd2dc('0x24'):_0x365519['childModel']=_0xd2dc('0x25');break;case'faxqueues':_0x365519[_0xd2dc('0x12')]=_0xd2dc('0x26');break;case _0xd2dc('0x27'):_0x365519[_0xd2dc('0x12')]=_0xd2dc('0x28');break;case _0xd2dc('0x29'):case _0xd2dc('0x2a'):case _0xd2dc('0x2b'):_0x365519[_0xd2dc('0x12')]=_0xd2dc('0x2c');break;case _0xd2dc('0x2d'):_0x365519[_0xd2dc('0x12')]='VoiceContext';break;case _0xd2dc('0x2e'):_0x365519['childModel']='VoiceMail';break;case _0xd2dc('0x2f'):_0x365519[_0xd2dc('0x12')]='VoiceRecording';_0x365519[_0xd2dc('0x18')]=[{'name':_0xd2dc('0x30'),'field':_0xd2dc('0xc'),'foreignKey':_0xd2dc('0x31'),'model':_0xd2dc('0x32'),'filter':{'field':_0xd2dc('0x33'),'value':[_0xd2dc('0x34')]}},{'name':'Telephones','field':_0xd2dc('0xc'),'foreignKey':_0xd2dc('0x31'),'model':'User','filter':{'field':_0xd2dc('0x33'),'value':['telephone']}},{'name':_0xd2dc('0x35'),'field':_0xd2dc('0xc'),'foreignKey':_0xd2dc('0x36'),'model':'VoiceQueue','filter':{'field':'type','value':[_0xd2dc('0x37')]}},{'name':'QueueCampaigns','field':'name','foreignKey':'queue','model':_0xd2dc('0x38'),'filter':{'field':_0xd2dc('0xf'),'value':[_0xd2dc('0x39')]}}];break;case _0xd2dc('0x3a'):_0x365519['childModel']=_0xd2dc('0x3b');break;case'chanspies':_0x365519[_0xd2dc('0x12')]='VoiceChanSpy';break;case _0xd2dc('0x3c'):_0x365519[_0xd2dc('0x12')]=_0xd2dc('0x3d');break;case'ivrcampaigns':_0x365519['childModel']='Campaign';break;case _0xd2dc('0x3e'):_0x365519[_0xd2dc('0x12')]='MailQueue';break;case _0xd2dc('0x3f'):_0x365519['childModel']=_0xd2dc('0x40');break;case _0xd2dc('0x41'):_0x365519[_0xd2dc('0x12')]=_0xd2dc('0x42');break;case _0xd2dc('0x43'):_0x365519[_0xd2dc('0x12')]='OpenchannelQueue';break;case _0xd2dc('0x44'):_0x365519[_0xd2dc('0x12')]='OpenchannelAccount';break;case _0xd2dc('0x45'):_0x365519[_0xd2dc('0x12')]='SmsQueue';break;case _0xd2dc('0x46'):_0x365519[_0xd2dc('0x12')]=_0xd2dc('0x47');break;case'whatsappqueues':_0x365519['childModel']=_0xd2dc('0x48');break;case _0xd2dc('0x49'):_0x365519[_0xd2dc('0x12')]='WhatsappAccount';break;case'teams':_0x365519[_0xd2dc('0x12')]='Team';break;case _0xd2dc('0x4a'):case _0xd2dc('0x4b'):_0x365519[_0xd2dc('0x12')]=_0xd2dc('0x38');if(_0x17eb48){_0x365519[_0xd2dc('0x18')]=[{'name':'VoiceQueues'},{'name':_0xd2dc('0x4c')}];}break;case _0xd2dc('0x4d'):case _0xd2dc('0x4e'):case _0xd2dc('0x4f'):_0x365519[_0xd2dc('0x12')]=_0xd2dc('0x32');if(_0x17eb48){_0x365519[_0xd2dc('0x18')]=[{'name':_0xd2dc('0x50'),'filter':{'field':_0xd2dc('0x33'),'value':['admin',_0xd2dc('0x51')]},'ignore':!![]},{'name':_0xd2dc('0x30')},{'name':_0xd2dc('0x52')}];}break;case _0xd2dc('0x53'):_0x365519[_0xd2dc('0x12')]=_0xd2dc('0x54');break;case _0xd2dc('0x55'):_0x365519['childModel']=_0xd2dc('0x56');break;case _0xd2dc('0x57'):_0x365519[_0xd2dc('0x12')]='FreshdeskAccount';break;case _0xd2dc('0x58'):_0x365519['childModel']=_0xd2dc('0x59');break;case _0xd2dc('0x5a'):_0x365519[_0xd2dc('0x12')]=_0xd2dc('0x5b');break;case _0xd2dc('0x5c'):_0x365519[_0xd2dc('0x12')]=_0xd2dc('0x5d');break;case _0xd2dc('0x5e'):_0x365519[_0xd2dc('0x12')]=_0xd2dc('0x32');break;case _0xd2dc('0x5f'):_0x365519[_0xd2dc('0x12')]='CannedAnswer';break;case _0xd2dc('0x60'):_0x365519[_0xd2dc('0x12')]=_0xd2dc('0x61');break;case'customdashboards':_0x365519[_0xd2dc('0x12')]=_0xd2dc('0x62');break;case _0xd2dc('0x63'):_0x365519[_0xd2dc('0x12')]='Interval';break;case'pauses':_0x365519[_0xd2dc('0x12')]=_0xd2dc('0x64');break;case _0xd2dc('0x65'):_0x365519[_0xd2dc('0x12')]=_0xd2dc('0x66');break;case _0xd2dc('0x67'):_0x365519[_0xd2dc('0x12')]=_0xd2dc('0x68');break;case _0xd2dc('0x69'):_0x365519[_0xd2dc('0x12')]=_0xd2dc('0x6a');break;case _0xd2dc('0x6b'):_0x365519['childModel']=_0xd2dc('0x6c');break;case _0xd2dc('0x6d'):_0x365519[_0xd2dc('0x12')]=_0xd2dc('0x6e');break;case _0xd2dc('0x6f'):_0x365519['childModel']=_0xd2dc('0x70');break;case _0xd2dc('0x71'):_0x365519[_0xd2dc('0x12')]=_0xd2dc('0x72');break;case'plugins':_0x365519[_0xd2dc('0x12')]=_0xd2dc('0x73');break;case _0xd2dc('0x74'):_0x365519[_0xd2dc('0x12')]=_0xd2dc('0x75');_0x365519[_0xd2dc('0x18')]=[{'name':'Reports','field':'id','foreignKey':'reportId'}];break;case _0xd2dc('0x76'):_0x365519[_0xd2dc('0x12')]=_0xd2dc('0x77');break;}return _0x365519;}function _0x532a60(_0x59066c,_0x3cb6d2){var _0x490c7d=_0x59066c[_0xd2dc('0x78')](0x0)[_0xd2dc('0x79')]()+_0x59066c['slice'](0x1);var _0x429e4d={'type':_0x24b566[_0xd2dc('0x7a')][_0xd2dc('0x7b')][_0xd2dc('0x7c')],'raw':!![]};return new Promise(function(_0x707c7,_0x4c760e){var _0x3cc273=squel[_0xd2dc('0x7d')]()[_0xd2dc('0x4')](_0xd2dc('0x7e')+_0x490c7d+'InteractionId','id')[_0xd2dc('0x4')](_0xd2dc('0x7f'))[_0xd2dc('0x80')]('user_has_'+_0x59066c+'_interactions','ui')[_0xd2dc('0x81')](_0xd2dc('0x82'),_0x3cb6d2['id']);return _0x24b566['sequelize']['query'](_0x3cc273[_0xd2dc('0x83')](),_0x429e4d)['then'](function(_0x4ac0e8){_0x3cb6d2[_0x490c7d+'OpenTabs']=_0x4ac0e8;_0x707c7(_0x4ac0e8);})[_0xd2dc('0x9')](function(_0x4a8872){_0x4c760e(_0x4a8872);});});}return _0xc3f0c9[_0xd2dc('0x84')](_0xd2dc('0x85'),attributes,{'tableName':_0xd2dc('0x86'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x352d5d){var _0x5f10fb=require(_0xd2dc('0x87'));var _0x573bb4={'raw':_0x352d5d['query'][_0xd2dc('0x88')],'where':{}};var _0x431e2c={};var _0x56875f={'count':0x0,'rows':[]};var _0x619ead=_0x352d5d['query']['section'];var _0x52dd78=_0x352d5d[_0xd2dc('0x89')][_0xd2dc('0x8a')]||![];var _0x15be6d=_0x2f9711(_0x619ead,_0x52dd78);if(!_0x15be6d[_0xd2dc('0x12')])throw new Error(_0xd2dc('0x8b')+_0x619ead+'\x27');var _0x2fc417=[{'name':_0x619ead}];if(!_[_0xd2dc('0x8c')](_0x15be6d[_0xd2dc('0x18')]))_0x2fc417=_0x15be6d[_0xd2dc('0x18')];var _0x3f0d4c=[];for(var _0x41b305=0x0;_0x41b305<_0x2fc417[_0xd2dc('0x8d')];_0x41b305++){_0x3f0d4c[_0xd2dc('0x8e')](_0x24b566['UserProfileSection'][_0xd2dc('0x8f')]({'where':{'userProfileId':_0x352d5d[_0xd2dc('0x90')]['id'],'name':_0x2fc417[_0x41b305][_0xd2dc('0xc')]},'raw':!![]}));}return Promise[_0xd2dc('0x91')](_0x3f0d4c)[_0xd2dc('0xb')](function(_0x26648e){var _0x1859b9=_['filter'](_0x26648e,function(_0x24a381){return _0x24a381?_0x24a381:undefined;});var _0x3676c6=_[_0xd2dc('0x3')](_0x2fc417,['ignore',!![]]);var _0x4f8c50=_[_0xd2dc('0x8c')](_0x1859b9)&&_[_0xd2dc('0x8c')](_0x3676c6)?null:_[_0xd2dc('0x92')](_0x3676c6,_0x1859b9);if(!_0x4f8c50)return null;var _0x15e3cd=[];for(var _0xdbc3e4=0x0;_0xdbc3e4<_0x4f8c50[_0xd2dc('0x8d')];_0xdbc3e4++){var _0x2eb4f5=_['find'](_0x2fc417,function(_0x32de16){return _0x4f8c50[_0xdbc3e4]?_0x32de16['name']===_0x4f8c50[_0xdbc3e4][_0xd2dc('0xc')]:null;});if(_0x2eb4f5){if(_0x4f8c50[_0xdbc3e4][_0xd2dc('0x93')]){_0x15e3cd[_0xd2dc('0x8e')](_0x192e2e(_0x15be6d[_0xd2dc('0x12')],_0x4f8c50[_0xdbc3e4]));}else{if(!_0x4f8c50[_0xdbc3e4]['autoAssociation']){_0x15e3cd[_0xd2dc('0x8e')](_0x3e8568(_0x2eb4f5,_0x4f8c50[_0xdbc3e4],_0x15be6d[_0xd2dc('0x12')]));}else{if(_0x2eb4f5[_0xd2dc('0xa')]){_0x15e3cd[_0xd2dc('0x8e')](_0x18af63(_0x2eb4f5,_0x4f8c50[_0xdbc3e4]));}}}}}return Promise['all'](_0x15e3cd);})[_0xd2dc('0xb')](function(_0x871cb){var _0x2eba41=_0x871cb;var _0x4979f7=null;if(_0x2eba41){_0x4979f7=_0x2eba41[_0xd2dc('0x8d')]===0x1?_0x2eba41[0x0]:null;}if(!_0x4979f7&&!_0x2eba41)return _0x56875f;var _0x47088d=_0x24b566[_0x15be6d[_0xd2dc('0x12')]]['rawAttributes'];_0x431e2c['model']=_[_0xd2dc('0x94')](_0x47088d);_0x431e2c[_0xd2dc('0x89')]=_[_0xd2dc('0x94')](_0x352d5d[_0xd2dc('0x89')]);_0x431e2c[_0xd2dc('0x95')]=_[_0xd2dc('0x96')](_0x431e2c[_0xd2dc('0xa')],_0x431e2c[_0xd2dc('0x89')]);_0x573bb4[_0xd2dc('0x97')]=_['intersection'](_0x431e2c['model'],_0x5f10fb['fields'](_0x352d5d[_0xd2dc('0x89')][_0xd2dc('0x98')]));_0x573bb4[_0xd2dc('0x97')]=_0x573bb4['attributes'][_0xd2dc('0x8d')]?_0x573bb4[_0xd2dc('0x97')]:_0x431e2c[_0xd2dc('0xa')];if(!_0x352d5d[_0xd2dc('0x89')][_0xd2dc('0x99')](_0xd2dc('0x9a'))){_0x573bb4[_0xd2dc('0x9b')]=_0x5f10fb[_0xd2dc('0x9b')](_0x352d5d[_0xd2dc('0x89')][_0xd2dc('0x9b')]);_0x573bb4[_0xd2dc('0x9c')]=_0x5f10fb[_0xd2dc('0x9c')](_0x352d5d['query'][_0xd2dc('0x9c')]);}_0x573bb4[_0xd2dc('0x9d')]=_0x5f10fb[_0xd2dc('0x9e')](_0x352d5d[_0xd2dc('0x89')]['sort']);_0x573bb4[_0xd2dc('0x81')]=_0x5f10fb[_0xd2dc('0x95')](_[_0xd2dc('0x9f')](_0x352d5d[_0xd2dc('0x89')],_0x431e2c[_0xd2dc('0x95')]));if(_0x352d5d['query'][_0xd2dc('0x3')]){_0x573bb4[_0xd2dc('0x81')]=_['merge'](_0x573bb4['where'],{'$or':_[_0xd2dc('0x8')](_0x47088d,function(_0x4bb229){if(_0x4bb229[_0xd2dc('0xf')][_0xd2dc('0xa0')]!==_0xd2dc('0xa1')){var _0x19de1b={};_0x19de1b[_0x4bb229[_0xd2dc('0x4')]]={'$like':'%'+_0x352d5d[_0xd2dc('0x89')][_0xd2dc('0x3')]+'%'};return _0x19de1b;}})});}var _0x49ac62=[];var _0x237c34=null;var _0x43a7f0={};if(_0x4979f7){_0x237c34=_[_0xd2dc('0x8f')](_0x2fc417,[_0xd2dc('0xc'),_0x4979f7[_0xd2dc('0xc')]]);if(_0x237c34[_0xd2dc('0x4')]){_0x43a7f0={};if(_0x15be6d[_0xd2dc('0x12')]===_0xd2dc('0x75')){_0x43a7f0[_0x237c34[_0xd2dc('0xa2')]]=_[_0xd2dc('0x8')](_0x4979f7['associatedResources'],'id');}else{_0x43a7f0[_0x237c34[_0xd2dc('0xa2')]]=_0x4979f7['associatedResources'];}_0x49ac62[_0xd2dc('0x8e')](_0x43a7f0);}else{_0x573bb4[_0xd2dc('0x81')]['id']=_0x4979f7['associatedResources'];}}else{for(var _0x287e1f=0x0;_0x287e1f<_0x2eba41['length'];_0x287e1f++){_0x237c34=_[_0xd2dc('0x8f')](_0x2fc417,['name',_0x2eba41[_0x287e1f][_0xd2dc('0xc')]]);if(_0x237c34[_0xd2dc('0x4')]){_0x43a7f0={};_0x43a7f0[_0x237c34[_0xd2dc('0xa2')]]=_0x2eba41[_0x287e1f][_0xd2dc('0x7')];_0x49ac62[_0xd2dc('0x8e')](_0x43a7f0);}else{if(!_0x573bb4[_0xd2dc('0x81')]['id'])_0x573bb4[_0xd2dc('0x81')]['id']=[];_0x2eba41[_0x287e1f][_0xd2dc('0x7')][_0xd2dc('0xa3')](function(_0x21c7ac){_0x573bb4[_0xd2dc('0x81')]['id'][_0xd2dc('0x8e')](_0x21c7ac);});}}}if(!_[_0xd2dc('0x8c')](_0x49ac62)){_0x573bb4['where']=_[_0xd2dc('0xa4')](_0x573bb4['where'],{'$and':{'$or':_0x49ac62}});}_0x573bb4=_[_0xd2dc('0xa4')]({},_0x573bb4,_0x352d5d[_0xd2dc('0xa5')]);if(_0x4979f7&&!_0x4979f7['autoAssociation']&&_0x15be6d[_0xd2dc('0x12')]==='AnalyticExtractedReport'){if(_0x352d5d[_0xd2dc('0x89')][_0xd2dc('0xa6')]){_0x573bb4[_0xd2dc('0xa7')]=[{'all':!![]}];}return _0x24b566[_0x15be6d[_0xd2dc('0x12')]][_0xd2dc('0x6')](_0x573bb4)[_0xd2dc('0xb')](function(_0x17dbc7){var _0x53245f=[];_0x17dbc7[_0xd2dc('0xa3')](function(_0x558e49){var _0x2e085e;switch(_0x558e49[_0xd2dc('0xa8')]){case _0xd2dc('0xa9'):_0x2e085e=_[_0xd2dc('0x8f')](_0x4979f7[_0xd2dc('0x7')],function(_0x336005){return _0x336005['id']===_0x558e49[_0xd2dc('0xaa')]&&_0x336005[_0xd2dc('0xf')]===_0xd2dc('0xab');});break;case _0xd2dc('0xac'):_0x2e085e=_[_0xd2dc('0x8f')](_0x4979f7[_0xd2dc('0x7')],function(_0x43d8a3){return _0x43d8a3['id']===_0x558e49[_0xd2dc('0xaa')]&&_0x43d8a3[_0xd2dc('0xf')]===_0xd2dc('0xad');});break;}if(_0x2e085e)_0x53245f[_0xd2dc('0x8e')](_0x558e49);});_0x56875f[_0xd2dc('0xae')]=_0x53245f[_0xd2dc('0x8d')];_0x56875f[_0xd2dc('0xaf')]=_0x53245f;return _0x56875f;});}else{if(!_[_0xd2dc('0x8c')](_0x352d5d['query'][_0xd2dc('0xb0')])){_0x573bb4[_0xd2dc('0x81')]['id']=_0x573bb4[_0xd2dc('0x81')]['id']?_[_0xd2dc('0x96')](_0x573bb4[_0xd2dc('0x81')]['id'],_0x352d5d[_0xd2dc('0x89')]['ids']):_0x352d5d[_0xd2dc('0x89')]['ids'];if(_0x352d5d[_0xd2dc('0x89')][_0xd2dc('0xb1')]){_0x573bb4['order']=_0x352d5d[_0xd2dc('0x89')][_0xd2dc('0xb1')];}}if(_0x352d5d['query'][_0xd2dc('0xb2')]){_0x573bb4[_0xd2dc('0x81')]=_[_0xd2dc('0xa4')](_0x573bb4['where'],{'$and':_0x352d5d[_0xd2dc('0x89')][_0xd2dc('0xb2')]});}return _0x24b566[_0x15be6d[_0xd2dc('0x12')]]['count']({'where':_0x573bb4[_0xd2dc('0x81')]})[_0xd2dc('0xb')](function(_0x104039){_0x56875f[_0xd2dc('0xae')]=_0x104039;if(_0x352d5d[_0xd2dc('0x89')][_0xd2dc('0xa6')]){if(_0x15be6d[_0xd2dc('0x12')]===_0xd2dc('0xb3')){_0x573bb4[_0xd2dc('0xa7')]=[{'model':_0x24b566[_0xd2dc('0x6a')],'as':_0xd2dc('0xb4'),'attributes':['id',_0xd2dc('0xc'),_0xd2dc('0xb5')],'required':_0x352d5d['query'][_0xd2dc('0xb6')]?!![]:![]},{'model':_0x24b566[_0xd2dc('0x6a')],'as':'ThroughTags','attributes':['id',_0xd2dc('0xc'),_0xd2dc('0xb5')],'through':_0x352d5d[_0xd2dc('0x89')][_0xd2dc('0xb6')]?{'attributes':[],'where':{'TagId':_0x352d5d['query']['tag']||undefined}}:{},'required':_0x352d5d[_0xd2dc('0x89')][_0xd2dc('0xb6')]?!![]:![]}];}else{_0x573bb4[_0xd2dc('0xa7')]=[{'all':!![]}];}}return _0x24b566[_0x15be6d[_0xd2dc('0x12')]][_0xd2dc('0x6')](_0x573bb4);})[_0xd2dc('0xb')](function(_0x24a6b2){_0x56875f['rows']=_0x24a6b2;if(_0x619ead===_0xd2dc('0x30')&&_0x352d5d[_0xd2dc('0x89')]['openTabs']===_0xd2dc('0xb7')){var _0x3e1b93=[];for(var _0x3f9ac4=0x0;_0x3f9ac4<_0x56875f[_0xd2dc('0xaf')][_0xd2dc('0x8d')];_0x3f9ac4++){_0x3e1b93['push'](_0x532a60('chat',_0x56875f[_0xd2dc('0xaf')][_0x3f9ac4]['dataValues']));_0x3e1b93[_0xd2dc('0x8e')](_0x532a60(_0xd2dc('0xb8'),_0x56875f[_0xd2dc('0xaf')][_0x3f9ac4][_0xd2dc('0xb9')]));_0x3e1b93[_0xd2dc('0x8e')](_0x532a60(_0xd2dc('0xba'),_0x56875f[_0xd2dc('0xaf')][_0x3f9ac4][_0xd2dc('0xb9')]));_0x3e1b93[_0xd2dc('0x8e')](_0x532a60(_0xd2dc('0xbb'),_0x56875f['rows'][_0x3f9ac4][_0xd2dc('0xb9')]));_0x3e1b93[_0xd2dc('0x8e')](_0x532a60(_0xd2dc('0xbc'),_0x56875f[_0xd2dc('0xaf')][_0x3f9ac4]['dataValues']));_0x3e1b93[_0xd2dc('0x8e')](_0x532a60(_0xd2dc('0xbd'),_0x56875f[_0xd2dc('0xaf')][_0x3f9ac4]['dataValues']));}return Promise[_0xd2dc('0x91')](_0x3e1b93)[_0xd2dc('0xb')](function(){return _0x56875f;});}return _0x56875f;});}});}}});}; \ No newline at end of file +var _0x7112=['agents','telephones','Users','Agents','zendeskaccounts','ZendeskAccount','salesforceaccounts','freshdeskaccounts','FreshdeskAccount','SugarcrmAccount','DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','Disposition','customdashboards','Dashboard','Interval','pauses','Pause','scheduler','Sound','tags','Tag','templates','Template','Trigger','trunks','Trunk','variables','Variable','extractedreports','reportId','metrics','charAt','toUpperCase','slice','SELECT','select','InteractionId','ui.createdAt','user_has_','_interactions','ui.UserId\x20=\x20?','sequelize','query','toString','UserProfile','user_profiles','../../components/parsers/qs','raw','mergeResources','Invalid\x20section\x20\x27','isEmpty','length','push','find','all','ignore','union','autoAssociation','rawAttributes','keys','filters','intersection','attributes','fields','hasOwnProperty','limit','offset','order','sort','pick','where','key','VIRTUAL','foreignKey','forEach','merge','options','includeAll','include','reportType','default','DefaultReports','custom','CustomReports','ids','customSorting','extraQueryConditions','count','color','tag','ThroughTags','rows','openTabs','true','chat','dataValues','sms','fax','mail','openchannel','./userProfile.attributes','squel','exports','models','filter','field','value','findAll','then','associatedResources','catch','model','map','name','resolve','UserProfileResource','AnalyticExtractedReport','resourceId','type','toLowerCase','childModel','SquareProject','squarerecordings','SquareRecording','parentSections','SquareProjects','projects','JscriptyProject','CmContact','Lists','ListId','lists','CmList','CmCompany','CmCustomField','chatqueues','chatwebsites','faxqueues','FaxQueue','faxaccounts','FaxAccount','inboundroutes','internalroutes','outboundroutes','VoiceContext','voicemails','VoiceMail','voicerecordings','membername','User','role','agent','Telephones','telephone','VoiceQueues','queue','VoiceQueue','inbound','QueueCampaigns','VoiceMusicOnHold','voiceprefixes','ivrcampaigns','Campaign','mailqueues','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsqueues','smsaccounts','SmsAccount','whatsappqueues','whatsappaccounts','WhatsappAccount','Team'];(function(_0x5072ff,_0x3db870){var _0x1d1098=function(_0x25c946){while(--_0x25c946){_0x5072ff['push'](_0x5072ff['shift']());}};_0x1d1098(++_0x3db870);}(_0x7112,0x1da));var _0x2711=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x7112[_0x4565bf];return _0x5610ba;};'use strict';var _=require('lodash');var attributes=require(_0x2711('0x0'));var squel=require(_0x2711('0x1'));module[_0x2711('0x2')]=function(_0x3e46b6){var _0x444d43=_0x3e46b6[_0x2711('0x3')];function _0x466d5b(_0x32b755,_0x3dac0f){return new Promise(function(_0x4b4125,_0xab2ade){if(!_0x3dac0f)return _0x4b4125(null);var _0xcdd83b=_0x3dac0f[_0x2711('0x4')]?{[_0x3dac0f[_0x2711('0x4')][_0x2711('0x5')]]:_0x3dac0f[_0x2711('0x4')][_0x2711('0x6')]}:undefined;return _0x444d43[_0x32b755][_0x2711('0x7')]({'where':_0xcdd83b,'raw':!![]})[_0x2711('0x8')](function(_0x33c540){_0x3dac0f[_0x2711('0x9')]=_['map'](_0x33c540,'id');_0x4b4125(_0x3dac0f);})[_0x2711('0xa')](function(_0xbab9b0){_0xab2ade(_0xbab9b0);});});}function _0x570ef4(_0x161acc,_0x2924b3){return new Promise(function(_0x53f674,_0x4475b2){var _0x1d9023=_0x161acc['filter']?{[_0x161acc[_0x2711('0x4')][_0x2711('0x5')]]:_0x161acc[_0x2711('0x4')][_0x2711('0x6')]}:undefined;return _0x444d43[_0x161acc[_0x2711('0xb')]][_0x2711('0x7')]({'where':_0x1d9023,'raw':!![]})[_0x2711('0x8')](function(_0x1586f7){_0x2924b3[_0x2711('0x9')]=_[_0x2711('0xc')](_0x1586f7,function(_0x406829){return _0x406829[_0x2711('0xd')];});_0x53f674(_0x2924b3);})[_0x2711('0xa')](function(_0x39570f){_0x4475b2(_0x39570f);});});}function _0x3a0d91(_0x386577,_0x3bcbb5,_0x490436){if(!_0x3bcbb5)return Promise[_0x2711('0xe')](null);return new Promise(function(_0x3b6cdf,_0x529aaa){return _0x444d43[_0x2711('0xf')]['findAll']({'where':{'sectionId':_0x3bcbb5['id']},'raw':!![]})[_0x2711('0x8')](function(_0x77007c){if(_0x386577[_0x2711('0x5')]&&_0x386577[_0x2711('0x5')]!=='id'){_0x3bcbb5[_0x2711('0x9')]=_['map'](_0x77007c,function(_0x9d5f90){return _0x9d5f90[_0x386577[_0x2711('0x5')]];});}else{if(_0x490436===_0x2711('0x10')){_0x3bcbb5[_0x2711('0x9')]=_[_0x2711('0xc')](_0x77007c,function(_0x3ac55f){return{'id':_0x3ac55f[_0x2711('0x11')],'type':_0x3ac55f[_0x2711('0x12')]};});}else{_0x3bcbb5['associatedResources']=_[_0x2711('0xc')](_0x77007c,function(_0x333c53){return _0x333c53[_0x2711('0x11')];});}}_0x3b6cdf(_0x3bcbb5);})[_0x2711('0xa')](function(_0x556559){_0x529aaa(_0x556559);});});}function _0x5a6067(_0xabdb78,_0x1f1a31){var _0x42a1f4={'parentSections':[]};switch(_0xabdb78[_0x2711('0x13')]()){case'squareprojects':_0x42a1f4[_0x2711('0x14')]=_0x2711('0x15');break;case'odbc':_0x42a1f4[_0x2711('0x14')]='SquareOdbc';break;case _0x2711('0x16'):_0x42a1f4[_0x2711('0x14')]=_0x2711('0x17');_0x42a1f4[_0x2711('0x18')]=[{'name':_0x2711('0x19'),'field':_0x2711('0xd'),'foreignKey':'projectName'}];break;case _0x2711('0x1a'):_0x42a1f4[_0x2711('0x14')]=_0x2711('0x1b');break;case'contacts':_0x42a1f4[_0x2711('0x14')]=_0x2711('0x1c');_0x42a1f4[_0x2711('0x18')]=[{'name':_0x2711('0x1d'),'field':'id','foreignKey':_0x2711('0x1e')}];break;case _0x2711('0x1f'):_0x42a1f4[_0x2711('0x14')]=_0x2711('0x20');break;case'companies':_0x42a1f4[_0x2711('0x14')]=_0x2711('0x21');break;case'globalcustomfields':_0x42a1f4[_0x2711('0x14')]=_0x2711('0x22');break;case _0x2711('0x23'):_0x42a1f4[_0x2711('0x14')]='ChatQueue';break;case _0x2711('0x24'):_0x42a1f4[_0x2711('0x14')]='ChatWebsite';break;case _0x2711('0x25'):_0x42a1f4[_0x2711('0x14')]=_0x2711('0x26');break;case _0x2711('0x27'):_0x42a1f4[_0x2711('0x14')]=_0x2711('0x28');break;case _0x2711('0x29'):case _0x2711('0x2a'):case _0x2711('0x2b'):_0x42a1f4[_0x2711('0x14')]='VoiceExtension';break;case'contexts':_0x42a1f4[_0x2711('0x14')]=_0x2711('0x2c');break;case _0x2711('0x2d'):_0x42a1f4[_0x2711('0x14')]=_0x2711('0x2e');break;case _0x2711('0x2f'):_0x42a1f4[_0x2711('0x14')]='VoiceRecording';_0x42a1f4[_0x2711('0x18')]=[{'name':'Agents','field':_0x2711('0xd'),'foreignKey':_0x2711('0x30'),'model':_0x2711('0x31'),'filter':{'field':_0x2711('0x32'),'value':[_0x2711('0x33')]}},{'name':_0x2711('0x34'),'field':'name','foreignKey':_0x2711('0x30'),'model':_0x2711('0x31'),'filter':{'field':_0x2711('0x32'),'value':[_0x2711('0x35')]}},{'name':_0x2711('0x36'),'field':_0x2711('0xd'),'foreignKey':_0x2711('0x37'),'model':_0x2711('0x38'),'filter':{'field':_0x2711('0x12'),'value':[_0x2711('0x39')]}},{'name':_0x2711('0x3a'),'field':_0x2711('0xd'),'foreignKey':'queue','model':_0x2711('0x38'),'filter':{'field':_0x2711('0x12'),'value':['outbound']}}];break;case'musiconholds':_0x42a1f4[_0x2711('0x14')]=_0x2711('0x3b');break;case'chanspies':_0x42a1f4[_0x2711('0x14')]='VoiceChanSpy';break;case _0x2711('0x3c'):_0x42a1f4['childModel']='VoicePrefix';break;case _0x2711('0x3d'):_0x42a1f4[_0x2711('0x14')]=_0x2711('0x3e');break;case _0x2711('0x3f'):_0x42a1f4[_0x2711('0x14')]='MailQueue';break;case _0x2711('0x40'):_0x42a1f4[_0x2711('0x14')]=_0x2711('0x41');break;case _0x2711('0x42'):_0x42a1f4[_0x2711('0x14')]=_0x2711('0x43');break;case'openchannelqueues':_0x42a1f4[_0x2711('0x14')]=_0x2711('0x44');break;case _0x2711('0x45'):_0x42a1f4[_0x2711('0x14')]=_0x2711('0x46');break;case _0x2711('0x47'):_0x42a1f4[_0x2711('0x14')]='SmsQueue';break;case _0x2711('0x48'):_0x42a1f4[_0x2711('0x14')]=_0x2711('0x49');break;case _0x2711('0x4a'):_0x42a1f4[_0x2711('0x14')]='WhatsappQueue';break;case _0x2711('0x4b'):_0x42a1f4['childModel']=_0x2711('0x4c');break;case'teams':_0x42a1f4[_0x2711('0x14')]=_0x2711('0x4d');break;case'voicequeues':case'queuecampaigns':_0x42a1f4[_0x2711('0x14')]=_0x2711('0x38');if(_0x1f1a31){_0x42a1f4[_0x2711('0x18')]=[{'name':_0x2711('0x36')},{'name':_0x2711('0x3a')}];}break;case'users':case _0x2711('0x4e'):case _0x2711('0x4f'):_0x42a1f4['childModel']=_0x2711('0x31');if(_0x1f1a31){_0x42a1f4[_0x2711('0x18')]=[{'name':_0x2711('0x50'),'filter':{'field':'role','value':['admin','user']},'ignore':!![]},{'name':_0x2711('0x51')},{'name':_0x2711('0x34')}];}break;case _0x2711('0x52'):_0x42a1f4[_0x2711('0x14')]=_0x2711('0x53');break;case _0x2711('0x54'):_0x42a1f4[_0x2711('0x14')]='SalesforceAccount';break;case _0x2711('0x55'):_0x42a1f4[_0x2711('0x14')]=_0x2711('0x56');break;case'sugarcrmaccounts':_0x42a1f4[_0x2711('0x14')]=_0x2711('0x57');break;case'deskaccounts':_0x42a1f4['childModel']=_0x2711('0x58');break;case _0x2711('0x59'):_0x42a1f4[_0x2711('0x14')]=_0x2711('0x5a');break;case _0x2711('0x5b'):_0x42a1f4['childModel']=_0x2711('0x31');break;case _0x2711('0x5c'):_0x42a1f4['childModel']=_0x2711('0x5d');break;case _0x2711('0x5e'):_0x42a1f4[_0x2711('0x14')]=_0x2711('0x5f');break;case _0x2711('0x60'):_0x42a1f4[_0x2711('0x14')]=_0x2711('0x61');break;case'intervals':_0x42a1f4[_0x2711('0x14')]=_0x2711('0x62');break;case _0x2711('0x63'):_0x42a1f4['childModel']=_0x2711('0x64');break;case _0x2711('0x65'):_0x42a1f4['childModel']='Schedule';break;case'sounds':_0x42a1f4[_0x2711('0x14')]=_0x2711('0x66');break;case _0x2711('0x67'):_0x42a1f4[_0x2711('0x14')]=_0x2711('0x68');break;case _0x2711('0x69'):_0x42a1f4[_0x2711('0x14')]=_0x2711('0x6a');break;case'triggers':_0x42a1f4[_0x2711('0x14')]=_0x2711('0x6b');break;case _0x2711('0x6c'):_0x42a1f4[_0x2711('0x14')]=_0x2711('0x6d');break;case _0x2711('0x6e'):_0x42a1f4['childModel']=_0x2711('0x6f');break;case'plugins':_0x42a1f4[_0x2711('0x14')]='Plugin';break;case _0x2711('0x70'):_0x42a1f4['childModel']=_0x2711('0x10');_0x42a1f4['parentSections']=[{'name':'Reports','field':'id','foreignKey':_0x2711('0x71')}];break;case _0x2711('0x72'):_0x42a1f4['childModel']='AnalyticMetric';break;}return _0x42a1f4;}function _0x53b444(_0x3647ba,_0x241418){var _0x4ebd23=_0x3647ba[_0x2711('0x73')](0x0)[_0x2711('0x74')]()+_0x3647ba[_0x2711('0x75')](0x1);var _0x4b89ab={'type':_0x444d43['Sequelize']['QueryTypes'][_0x2711('0x76')],'raw':!![]};return new Promise(function(_0x3b8b66,_0x539e76){var _0x4a220d=squel[_0x2711('0x77')]()[_0x2711('0x5')]('ui.'+_0x4ebd23+_0x2711('0x78'),'id')[_0x2711('0x5')](_0x2711('0x79'))['from'](_0x2711('0x7a')+_0x3647ba+_0x2711('0x7b'),'ui')['where'](_0x2711('0x7c'),_0x241418['id']);return _0x444d43[_0x2711('0x7d')][_0x2711('0x7e')](_0x4a220d[_0x2711('0x7f')](),_0x4b89ab)[_0x2711('0x8')](function(_0x1230c8){_0x241418[_0x4ebd23+'OpenTabs']=_0x1230c8;_0x3b8b66(_0x1230c8);})[_0x2711('0xa')](function(_0x809c3c){_0x539e76(_0x809c3c);});});}return _0x3e46b6['define'](_0x2711('0x80'),attributes,{'tableName':_0x2711('0x81'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x554b4b){var _0x34f7d0=require(_0x2711('0x82'));var _0x3b973b={'raw':_0x554b4b[_0x2711('0x7e')][_0x2711('0x83')],'where':{}};var _0x5eb345={};var _0x478ef8={'count':0x0,'rows':[]};var _0x2e7419=_0x554b4b['query']['section'];var _0x5ca3c0=_0x554b4b[_0x2711('0x7e')][_0x2711('0x84')]||![];var _0x21c30c=_0x5a6067(_0x2e7419,_0x5ca3c0);if(!_0x21c30c[_0x2711('0x14')])throw new Error(_0x2711('0x85')+_0x2e7419+'\x27');var _0x43c017=[{'name':_0x2e7419}];if(!_[_0x2711('0x86')](_0x21c30c[_0x2711('0x18')]))_0x43c017=_0x21c30c[_0x2711('0x18')];var _0x1e8800=[];for(var _0x3be6b7=0x0;_0x3be6b7<_0x43c017[_0x2711('0x87')];_0x3be6b7++){_0x1e8800[_0x2711('0x88')](_0x444d43['UserProfileSection'][_0x2711('0x89')]({'where':{'userProfileId':_0x554b4b['params']['id'],'name':_0x43c017[_0x3be6b7][_0x2711('0xd')]},'raw':!![]}));}return Promise[_0x2711('0x8a')](_0x1e8800)[_0x2711('0x8')](function(_0x59dc77){var _0x4eb70e=_['filter'](_0x59dc77,function(_0x3ad2e4){return _0x3ad2e4?_0x3ad2e4:undefined;});var _0x52ebc0=_[_0x2711('0x4')](_0x43c017,[_0x2711('0x8b'),!![]]);var _0x116a1d=_[_0x2711('0x86')](_0x4eb70e)&&_[_0x2711('0x86')](_0x52ebc0)?null:_[_0x2711('0x8c')](_0x52ebc0,_0x4eb70e);if(!_0x116a1d)return null;var _0xd5a52b=[];for(var _0x5bcea1=0x0;_0x5bcea1<_0x116a1d[_0x2711('0x87')];_0x5bcea1++){var _0x3234f0=_[_0x2711('0x89')](_0x43c017,function(_0x3d53e2){return _0x116a1d[_0x5bcea1]?_0x3d53e2[_0x2711('0xd')]===_0x116a1d[_0x5bcea1][_0x2711('0xd')]:null;});if(_0x3234f0){if(_0x116a1d[_0x5bcea1][_0x2711('0x8b')]){_0xd5a52b[_0x2711('0x88')](_0x466d5b(_0x21c30c[_0x2711('0x14')],_0x116a1d[_0x5bcea1]));}else{if(!_0x116a1d[_0x5bcea1][_0x2711('0x8d')]){_0xd5a52b[_0x2711('0x88')](_0x3a0d91(_0x3234f0,_0x116a1d[_0x5bcea1],_0x21c30c['childModel']));}else{if(_0x3234f0['model']){_0xd5a52b['push'](_0x570ef4(_0x3234f0,_0x116a1d[_0x5bcea1]));}}}}}return Promise[_0x2711('0x8a')](_0xd5a52b);})[_0x2711('0x8')](function(_0x39d1b9){var _0x499e11=_0x39d1b9;var _0x4e8591=null;if(_0x499e11){_0x4e8591=_0x499e11[_0x2711('0x87')]===0x1?_0x499e11[0x0]:null;}if(!_0x4e8591&&!_0x499e11)return _0x478ef8;var _0x356fd1=_0x444d43[_0x21c30c['childModel']][_0x2711('0x8e')];_0x5eb345['model']=_[_0x2711('0x8f')](_0x356fd1);_0x5eb345['query']=_['keys'](_0x554b4b[_0x2711('0x7e')]);_0x5eb345[_0x2711('0x90')]=_[_0x2711('0x91')](_0x5eb345[_0x2711('0xb')],_0x5eb345[_0x2711('0x7e')]);_0x3b973b[_0x2711('0x92')]=_[_0x2711('0x91')](_0x5eb345[_0x2711('0xb')],_0x34f7d0[_0x2711('0x93')](_0x554b4b['query'][_0x2711('0x93')]));_0x3b973b['attributes']=_0x3b973b['attributes']['length']?_0x3b973b[_0x2711('0x92')]:_0x5eb345['model'];if(!_0x554b4b[_0x2711('0x7e')][_0x2711('0x94')]('nolimit')){_0x3b973b['limit']=_0x34f7d0[_0x2711('0x95')](_0x554b4b[_0x2711('0x7e')]['limit']);_0x3b973b[_0x2711('0x96')]=_0x34f7d0[_0x2711('0x96')](_0x554b4b['query']['offset']);}_0x3b973b[_0x2711('0x97')]=_0x34f7d0[_0x2711('0x98')](_0x554b4b[_0x2711('0x7e')]['sort']);_0x3b973b['where']=_0x34f7d0[_0x2711('0x90')](_[_0x2711('0x99')](_0x554b4b['query'],_0x5eb345[_0x2711('0x90')]));if(_0x554b4b['query']['filter']){_0x3b973b[_0x2711('0x9a')]=_['merge'](_0x3b973b['where'],{'$or':_[_0x2711('0xc')](_0x356fd1,function(_0x1776ca){if(_0x1776ca[_0x2711('0x12')][_0x2711('0x9b')]!==_0x2711('0x9c')){var _0x5bfbfa={};_0x5bfbfa[_0x1776ca[_0x2711('0x5')]]={'$like':'%'+_0x554b4b[_0x2711('0x7e')][_0x2711('0x4')]+'%'};return _0x5bfbfa;}})});}var _0x196267=[];var _0x274582=null;var _0x18962a={};if(_0x4e8591){_0x274582=_[_0x2711('0x89')](_0x43c017,['name',_0x4e8591['name']]);if(_0x274582[_0x2711('0x5')]){_0x18962a={};if(_0x21c30c[_0x2711('0x14')]===_0x2711('0x10')){_0x18962a[_0x274582[_0x2711('0x9d')]]=_[_0x2711('0xc')](_0x4e8591[_0x2711('0x9')],'id');}else{_0x18962a[_0x274582[_0x2711('0x9d')]]=_0x4e8591[_0x2711('0x9')];}_0x196267[_0x2711('0x88')](_0x18962a);}else{_0x3b973b[_0x2711('0x9a')]['id']=_0x4e8591[_0x2711('0x9')];}}else{for(var _0x42657d=0x0;_0x42657d<_0x499e11[_0x2711('0x87')];_0x42657d++){_0x274582=_[_0x2711('0x89')](_0x43c017,[_0x2711('0xd'),_0x499e11[_0x42657d][_0x2711('0xd')]]);if(_0x274582[_0x2711('0x5')]){_0x18962a={};_0x18962a[_0x274582[_0x2711('0x9d')]]=_0x499e11[_0x42657d]['associatedResources'];_0x196267[_0x2711('0x88')](_0x18962a);}else{if(!_0x3b973b[_0x2711('0x9a')]['id'])_0x3b973b[_0x2711('0x9a')]['id']=[];_0x499e11[_0x42657d][_0x2711('0x9')][_0x2711('0x9e')](function(_0x3f0992){_0x3b973b[_0x2711('0x9a')]['id']['push'](_0x3f0992);});}}}if(!_[_0x2711('0x86')](_0x196267)){_0x3b973b[_0x2711('0x9a')]=_[_0x2711('0x9f')](_0x3b973b[_0x2711('0x9a')],{'$and':{'$or':_0x196267}});}_0x3b973b=_[_0x2711('0x9f')]({},_0x3b973b,_0x554b4b[_0x2711('0xa0')]);if(_0x4e8591&&!_0x4e8591['autoAssociation']&&_0x21c30c[_0x2711('0x14')]===_0x2711('0x10')){if(_0x554b4b[_0x2711('0x7e')][_0x2711('0xa1')]){_0x3b973b[_0x2711('0xa2')]=[{'all':!![]}];}return _0x444d43[_0x21c30c['childModel']][_0x2711('0x7')](_0x3b973b)['then'](function(_0x140655){var _0xb1670c=[];_0x140655['forEach'](function(_0x3a37c9){var _0x9dda4a;switch(_0x3a37c9[_0x2711('0xa3')]){case _0x2711('0xa4'):_0x9dda4a=_[_0x2711('0x89')](_0x4e8591[_0x2711('0x9')],function(_0x183ff4){return _0x183ff4['id']===_0x3a37c9[_0x2711('0x71')]&&_0x183ff4[_0x2711('0x12')]===_0x2711('0xa5');});break;case _0x2711('0xa6'):_0x9dda4a=_[_0x2711('0x89')](_0x4e8591['associatedResources'],function(_0x4b875c){return _0x4b875c['id']===_0x3a37c9[_0x2711('0x71')]&&_0x4b875c[_0x2711('0x12')]===_0x2711('0xa7');});break;}if(_0x9dda4a)_0xb1670c[_0x2711('0x88')](_0x3a37c9);});_0x478ef8['count']=_0xb1670c['length'];_0x478ef8['rows']=_0xb1670c;return _0x478ef8;});}else{if(!_[_0x2711('0x86')](_0x554b4b[_0x2711('0x7e')][_0x2711('0xa8')])){_0x3b973b[_0x2711('0x9a')]['id']=_0x3b973b[_0x2711('0x9a')]['id']?_[_0x2711('0x91')](_0x3b973b[_0x2711('0x9a')]['id'],_0x554b4b[_0x2711('0x7e')][_0x2711('0xa8')]):_0x554b4b[_0x2711('0x7e')][_0x2711('0xa8')];if(_0x554b4b[_0x2711('0x7e')][_0x2711('0xa9')]){_0x3b973b[_0x2711('0x97')]=_0x554b4b[_0x2711('0x7e')][_0x2711('0xa9')];}}if(_0x554b4b['query']['extraQueryConditions']){_0x3b973b[_0x2711('0x9a')]=_[_0x2711('0x9f')](_0x3b973b[_0x2711('0x9a')],{'$and':_0x554b4b[_0x2711('0x7e')][_0x2711('0xaa')]});}return _0x444d43[_0x21c30c['childModel']][_0x2711('0xab')]({'where':_0x3b973b[_0x2711('0x9a')]})[_0x2711('0x8')](function(_0x5d5497){_0x478ef8['count']=_0x5d5497;if(_0x554b4b[_0x2711('0x7e')][_0x2711('0xa1')]){if(_0x21c30c[_0x2711('0x14')]===_0x2711('0x1c')){_0x3b973b[_0x2711('0xa2')]=[{'model':_0x444d43['Tag'],'as':'Tags','attributes':['id','name',_0x2711('0xac')],'required':_0x554b4b[_0x2711('0x7e')][_0x2711('0xad')]?!![]:![]},{'model':_0x444d43['Tag'],'as':_0x2711('0xae'),'attributes':['id',_0x2711('0xd'),_0x2711('0xac')],'through':_0x554b4b[_0x2711('0x7e')][_0x2711('0xad')]?{'attributes':[],'where':{'TagId':_0x554b4b['query']['tag']||undefined}}:{},'required':_0x554b4b[_0x2711('0x7e')][_0x2711('0xad')]?!![]:![]}];}else{_0x3b973b[_0x2711('0xa2')]=[{'all':!![]}];}}return _0x444d43[_0x21c30c[_0x2711('0x14')]][_0x2711('0x7')](_0x3b973b);})[_0x2711('0x8')](function(_0x291d07){_0x478ef8[_0x2711('0xaf')]=_0x291d07;if(_0x2e7419===_0x2711('0x51')&&_0x554b4b[_0x2711('0x7e')][_0x2711('0xb0')]===_0x2711('0xb1')){var _0x11af46=[];for(var _0x4465ec=0x0;_0x4465ec<_0x478ef8[_0x2711('0xaf')]['length'];_0x4465ec++){_0x11af46[_0x2711('0x88')](_0x53b444(_0x2711('0xb2'),_0x478ef8[_0x2711('0xaf')][_0x4465ec][_0x2711('0xb3')]));_0x11af46[_0x2711('0x88')](_0x53b444(_0x2711('0xb4'),_0x478ef8[_0x2711('0xaf')][_0x4465ec][_0x2711('0xb3')]));_0x11af46['push'](_0x53b444(_0x2711('0xb5'),_0x478ef8[_0x2711('0xaf')][_0x4465ec]['dataValues']));_0x11af46[_0x2711('0x88')](_0x53b444(_0x2711('0xb6'),_0x478ef8[_0x2711('0xaf')][_0x4465ec][_0x2711('0xb3')]));_0x11af46[_0x2711('0x88')](_0x53b444(_0x2711('0xb7'),_0x478ef8['rows'][_0x4465ec][_0x2711('0xb3')]));_0x11af46[_0x2711('0x88')](_0x53b444('whatsapp',_0x478ef8['rows'][_0x4465ec][_0x2711('0xb3')]));}return Promise[_0x2711('0x8a')](_0x11af46)[_0x2711('0x8')](function(){return _0x478ef8;});}return _0x478ef8;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index 57ef290..5a98853 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 _0xf03a=['client','redis','localhost','socket.io-emitter','./userProfile.socket','register','request','info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','error','code','message','result','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x1477ef,_0x54a5d6){var _0x164acd=function(_0x139149){while(--_0x139149){_0x1477ef['push'](_0x1477ef['shift']());}};_0x164acd(++_0x54a5d6);}(_0xf03a,0x1a0));var _0xaf03=function(_0x4979ad,_0x36df48){_0x4979ad=_0x4979ad-0x0;var _0x3e8c8e=_0xf03a[_0x4979ad];return _0x3e8c8e;};'use strict';var _=require('lodash');var util=require(_0xaf03('0x0'));var moment=require(_0xaf03('0x1'));var BPromise=require(_0xaf03('0x2'));var rs=require(_0xaf03('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaf03('0x4'))['db'];var utils=require(_0xaf03('0x5'));var logger=require('../../config/logger')(_0xaf03('0x6'));var config=require(_0xaf03('0x7'));var jayson=require(_0xaf03('0x8'));var client=jayson[_0xaf03('0x9')]['http']({'port':0x232a});config[_0xaf03('0xa')]=_['defaults'](config[_0xaf03('0xa')],{'host':_0xaf03('0xb'),'port':0x18eb});var socket=require(_0xaf03('0xc'))(new Redis(config[_0xaf03('0xa')]));require(_0xaf03('0xd'))[_0xaf03('0xe')](socket);function respondWithRpcPromise(_0x52d7fe,_0x1f3a5c,_0x12e1a1){return new BPromise(function(_0x4766d1,_0x33803e){return client[_0xaf03('0xf')](_0x52d7fe,_0x12e1a1)['then'](function(_0x1bc5a0){logger[_0xaf03('0x10')](_0xaf03('0x11'),_0x1f3a5c,_0xaf03('0x12'));logger[_0xaf03('0x13')](_0xaf03('0x14'),_0x1f3a5c,_0xaf03('0x12'),JSON['stringify'](_0x1bc5a0));if(_0x1bc5a0['error']){if(_0x1bc5a0[_0xaf03('0x15')][_0xaf03('0x16')]===0x1f4){logger[_0xaf03('0x15')]('UserProfile,\x20%s,\x20%s',_0x1f3a5c,_0x1bc5a0['error'][_0xaf03('0x17')]);return _0x33803e(_0x1bc5a0[_0xaf03('0x15')][_0xaf03('0x17')]);}logger[_0xaf03('0x15')](_0xaf03('0x11'),_0x1f3a5c,_0x1bc5a0[_0xaf03('0x15')]['message']);return _0x4766d1(_0x1bc5a0[_0xaf03('0x15')][_0xaf03('0x17')]);}else{logger[_0xaf03('0x10')](_0xaf03('0x11'),_0x1f3a5c,_0xaf03('0x12'));_0x4766d1(_0x1bc5a0[_0xaf03('0x18')]['message']);}})['catch'](function(_0x1e3508){logger[_0xaf03('0x15')](_0xaf03('0x11'),_0x1f3a5c,_0x1e3508);_0x33803e(_0x1e3508);});});} \ 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(_0xbeb808,_0x881ddf){var _0x5d6909=function(_0x37d652){while(--_0x37d652){_0xbeb808['push'](_0xbeb808['shift']());}};_0x5d6909(++_0x881ddf);}(_0x6337,0x18a));var _0x7633=function(_0x5ecaa8,_0x41361a){_0x5ecaa8=_0x5ecaa8-0x0;var _0x15f1f8=_0x6337[_0x5ecaa8];return _0x15f1f8;};'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 5f149d6..bce0100 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 _0xf294=['update','emit','register','length','save'];(function(_0x1695cb,_0x4df7a8){var _0x8ebba9=function(_0x250c13){while(--_0x250c13){_0x1695cb['push'](_0x1695cb['shift']());}};_0x8ebba9(++_0x4df7a8);}(_0xf294,0x199));var _0x4f29=function(_0x3b048d,_0x450938){_0x3b048d=_0x3b048d-0x0;var _0x31b2d4=_0xf294[_0x3b048d];return _0x31b2d4;};'use strict';var UserProfileEvents=require('./userProfile.events');var events=[_0x4f29('0x0'),'remove',_0x4f29('0x1')];function createListener(_0x4095c7,_0x44fce6){return function(_0x259c19){_0x44fce6[_0x4f29('0x2')](_0x4095c7,_0x259c19);};}function removeListener(_0x224460,_0x2ef62c){return function(){UserProfileEvents['removeListener'](_0x224460,_0x2ef62c);};}exports[_0x4f29('0x3')]=function(_0x216d7e){for(var _0x35b423=0x0,_0x57ad3d=events[_0x4f29('0x4')];_0x35b423<_0x57ad3d;_0x35b423++){var _0x5c224d=events[_0x35b423];var _0x7a120a=createListener('userProfile:'+_0x5c224d,_0x216d7e);UserProfileEvents['on'](_0x5c224d,_0x7a120a);}}; \ No newline at end of file +var _0xb523=['save','remove','emit','removeListener','userProfile:','./userProfile.events'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xb523,0x19d));var _0x3b52=function(_0x23be66,_0x16d4b2){_0x23be66=_0x23be66-0x0;var _0x1bab88=_0xb523[_0x23be66];return _0x1bab88;};'use strict';var UserProfileEvents=require(_0x3b52('0x0'));var events=[_0x3b52('0x1'),_0x3b52('0x2'),'update'];function createListener(_0x315152,_0x43019d){return function(_0x5093fe){_0x43019d[_0x3b52('0x3')](_0x315152,_0x5093fe);};}function removeListener(_0x18c4ca,_0x174e6b){return function(){UserProfileEvents[_0x3b52('0x4')](_0x18c4ca,_0x174e6b);};}exports['register']=function(_0x4b964b){for(var _0x5d2f43=0x0,_0x5a77b4=events['length'];_0x5d2f43<_0x5a77b4;_0x5d2f43++){var _0xb5b6a5=events[_0x5d2f43];var _0x146323=createListener(_0x3b52('0x5')+_0xb5b6a5,_0x4b964b);UserProfileEvents['on'](_0xb5b6a5,_0x146323);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index 3dd33cc..6f3caab 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 _0xd24d=['post','create','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./userProfileResource.controller','isAuthenticated','get','/describe','describe','/:id','show'];(function(_0x2f53e7,_0x20dbf9){var _0x531781=function(_0x4e118b){while(--_0x4e118b){_0x2f53e7['push'](_0x2f53e7['shift']());}};_0x531781(++_0x20dbf9);}(_0xd24d,0x181));var _0xdd24=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd24d[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0xdd24('0x0'));var util=require(_0xdd24('0x1'));var path=require('path');var timeout=require(_0xdd24('0x2'));var express=require(_0xdd24('0x3'));var router=express[_0xdd24('0x4')]();var fs_extra=require(_0xdd24('0x5'));var auth=require(_0xdd24('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xdd24('0x7'));var controller=require(_0xdd24('0x8'));router['get']('/',auth[_0xdd24('0x9')](),controller['index']);router[_0xdd24('0xa')](_0xdd24('0xb'),auth[_0xdd24('0x9')](),controller[_0xdd24('0xc')]);router[_0xdd24('0xa')](_0xdd24('0xd'),auth['isAuthenticated'](),controller[_0xdd24('0xe')]);router[_0xdd24('0xf')]('/',auth[_0xdd24('0x9')](),controller[_0xdd24('0x10')]);router['put']('/:id',auth[_0xdd24('0x9')](),controller['update']);router[_0xdd24('0x11')](_0xdd24('0xd'),auth['isAuthenticated'](),controller[_0xdd24('0x12')]);module[_0xdd24('0x13')]=router; \ No newline at end of file +var _0xb589=['multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./userProfileResource.controller','get','index','/describe','describe','/:id','isAuthenticated','show','post','put','update','delete','exports'];(function(_0x3ebbb7,_0x92ec16){var _0x54d44f=function(_0x33b25b){while(--_0x33b25b){_0x3ebbb7['push'](_0x3ebbb7['shift']());}};_0x54d44f(++_0x92ec16);}(_0xb589,0x1c8));var _0x9b58=function(_0x1ba4d1,_0x54fd0e){_0x1ba4d1=_0x1ba4d1-0x0;var _0x29a4a5=_0xb589[_0x1ba4d1];return _0x29a4a5;};'use strict';var multer=require(_0x9b58('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x9b58('0x1'));var express=require('express');var router=express[_0x9b58('0x2')]();var fs_extra=require(_0x9b58('0x3'));var auth=require(_0x9b58('0x4'));var interaction=require(_0x9b58('0x5'));var config=require('../../config/environment');var controller=require(_0x9b58('0x6'));router[_0x9b58('0x7')]('/',auth['isAuthenticated'](),controller[_0x9b58('0x8')]);router['get'](_0x9b58('0x9'),auth['isAuthenticated'](),controller[_0x9b58('0xa')]);router['get'](_0x9b58('0xb'),auth[_0x9b58('0xc')](),controller[_0x9b58('0xd')]);router[_0x9b58('0xe')]('/',auth[_0x9b58('0xc')](),controller['create']);router[_0x9b58('0xf')]('/:id',auth[_0x9b58('0xc')](),controller[_0x9b58('0x10')]);router[_0x9b58('0x11')](_0x9b58('0xb'),auth[_0x9b58('0xc')](),controller['destroy']);module[_0x9b58('0x12')]=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index e881009..f180ad1 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 _0xd206=['STRING','INTEGER','sequelize','exports'];(function(_0x5711f0,_0x699293){var _0x5ee738=function(_0x5f1c1f){while(--_0x5f1c1f){_0x5711f0['push'](_0x5711f0['shift']());}};_0x5ee738(++_0x699293);}(_0xd206,0x186));var _0x6d20=function(_0x9dfc10,_0x19c2d5){_0x9dfc10=_0x9dfc10-0x0;var _0x4f938a=_0xd206[_0x9dfc10];return _0x4f938a;};'use strict';var Sequelize=require(_0x6d20('0x0'));module[_0x6d20('0x1')]={'name':{'type':Sequelize[_0x6d20('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x6d20('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x6d20('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x8c6d=['INTEGER','sequelize','exports','STRING'];(function(_0x2d126e,_0x1e8257){var _0xcb04d3=function(_0x19a2d9){while(--_0x19a2d9){_0x2d126e['push'](_0x2d126e['shift']());}};_0xcb04d3(++_0x1e8257);}(_0x8c6d,0x189));var _0xd8c6=function(_0x39a09b,_0x1d355e){_0x39a09b=_0x39a09b-0x0;var _0x4b8db4=_0x8c6d[_0x39a09b];return _0x4b8db4;};'use strict';var Sequelize=require(_0xd8c6('0x0'));module[_0xd8c6('0x1')]={'name':{'type':Sequelize[_0xd8c6('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0xd8c6('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xd8c6('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 0931bc6..5809dc8 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 _0x90b1=['intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','pick','filter','merge','where','type','options','UserProfileResource','includeAll','rows','include','find','catch','body','params','describe','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','then','destroy','error','name','send','index','map','rawAttributes','fieldName','key','keys','query','filters'];(function(_0x457a5d,_0x496391){var _0x26aebd=function(_0x12387c){while(--_0x12387c){_0x457a5d['push'](_0x457a5d['shift']());}};_0x26aebd(++_0x496391);}(_0x90b1,0x1bb));var _0x190b=function(_0x22342c,_0x218835){_0x22342c=_0x22342c-0x0;var _0xd3b434=_0x90b1[_0x22342c];return _0xd3b434;};'use strict';var emlformat=require(_0x190b('0x0'));var rimraf=require(_0x190b('0x1'));var zipdir=require(_0x190b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x190b('0x3'));var BPromise=require(_0x190b('0x4'));var Mustache=require(_0x190b('0x5'));var util=require(_0x190b('0x6'));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(_0x190b('0x7'));var _=require(_0x190b('0x8'));var squel=require(_0x190b('0x9'));var crypto=require(_0x190b('0xa'));var jsforce=require(_0x190b('0xb'));var deskjs=require(_0x190b('0xc'));var toCsv=require(_0x190b('0xd'));var querystring=require('querystring');var Papa=require(_0x190b('0xe'));var Redis=require(_0x190b('0xf'));var authService=require(_0x190b('0x10'));var qs=require(_0x190b('0x11'));var as=require(_0x190b('0x12'));var hardwareService=require(_0x190b('0x13'));var logger=require(_0x190b('0x14'))(_0x190b('0x15'));var utils=require('../../config/utils');var config=require(_0x190b('0x16'));var licenseUtil=require(_0x190b('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4d63ac,_0x596c48){_0x596c48=_0x596c48||0xcc;return function(_0x286c81){if(_0x286c81){return _0x4d63ac[_0x190b('0x18')](_0x596c48);}return _0x4d63ac[_0x190b('0x19')](_0x596c48)[_0x190b('0x1a')]();};}function respondWithResult(_0x2e12d4,_0x13544c){_0x13544c=_0x13544c||0xc8;return function(_0x1ff180){if(_0x1ff180){return _0x2e12d4[_0x190b('0x19')](_0x13544c)[_0x190b('0x1b')](_0x1ff180);}};}function respondWithFilteredResult(_0x1a046f,_0xab346){return function(_0x3e8781){if(_0x3e8781){var _0x3fbfc3=typeof _0xab346[_0x190b('0x1c')]===_0x190b('0x1d')&&typeof _0xab346['limit']===_0x190b('0x1d');var _0x5efbed=_0x3e8781[_0x190b('0x1e')];var _0x21e458=_0x3fbfc3?0x0:_0xab346[_0x190b('0x1c')];var _0x16c009=_0x3fbfc3?_0x3e8781['count']:_0xab346[_0x190b('0x1c')]+_0xab346[_0x190b('0x1f')];var _0x441a2b;if(_0x16c009>=_0x5efbed){_0x16c009=_0x5efbed;_0x441a2b=0xc8;}else{_0x441a2b=0xce;}_0x1a046f[_0x190b('0x19')](_0x441a2b);return _0x1a046f[_0x190b('0x20')](_0x190b('0x21'),_0x21e458+'-'+_0x16c009+'/'+_0x5efbed)['json'](_0x3e8781);}return null;};}function patchUpdates(_0x3ed24c){return function(_0x14f0a5){try{jsonpatch['apply'](_0x14f0a5,_0x3ed24c,!![]);}catch(_0xb4c32b){return BPromise['reject'](_0xb4c32b);}return _0x14f0a5['save']();};}function saveUpdates(_0xcd15e5,_0x42e7f2){return function(_0x332006){if(_0x332006){return _0x332006['update'](_0xcd15e5)[_0x190b('0x22')](function(_0x2e633e){return _0x2e633e;});}return null;};}function removeEntity(_0x16e989,_0x292ce3){return function(_0x3b8c74){if(_0x3b8c74){return _0x3b8c74[_0x190b('0x23')]()[_0x190b('0x22')](function(){_0x16e989['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x262a63,_0x1a5f86){return function(_0x50605b){if(!_0x50605b){_0x262a63['sendStatus'](0x194);}return _0x50605b;};}function handleError(_0x3260d5,_0x4e2a93){_0x4e2a93=_0x4e2a93||0x1f4;return function(_0x328e5e){logger[_0x190b('0x24')](_0x328e5e['stack']);if(_0x328e5e[_0x190b('0x25')]){delete _0x328e5e[_0x190b('0x25')];}_0x3260d5['status'](_0x4e2a93)[_0x190b('0x26')](_0x328e5e);};}exports[_0x190b('0x27')]=function(_0x359b4a,_0x494f3f){var _0x536d7b={},_0x3730cc={},_0x4d5f3f={'count':0x0,'rows':[]};var _0x14be2c=_[_0x190b('0x28')](db['UserProfileResource'][_0x190b('0x29')],function(_0x580b92){return{'name':_0x580b92[_0x190b('0x2a')],'type':_0x580b92['type'][_0x190b('0x2b')]};});_0x3730cc['model']=_[_0x190b('0x28')](_0x14be2c,_0x190b('0x25'));_0x3730cc['query']=_[_0x190b('0x2c')](_0x359b4a[_0x190b('0x2d')]);_0x3730cc[_0x190b('0x2e')]=_[_0x190b('0x2f')](_0x3730cc[_0x190b('0x30')],_0x3730cc[_0x190b('0x2d')]);_0x536d7b[_0x190b('0x31')]=_[_0x190b('0x2f')](_0x3730cc['model'],qs['fields'](_0x359b4a[_0x190b('0x2d')][_0x190b('0x32')]));_0x536d7b['attributes']=_0x536d7b[_0x190b('0x31')][_0x190b('0x33')]?_0x536d7b[_0x190b('0x31')]:_0x3730cc[_0x190b('0x30')];if(!_0x359b4a[_0x190b('0x2d')][_0x190b('0x34')](_0x190b('0x35'))){_0x536d7b['limit']=qs['limit'](_0x359b4a[_0x190b('0x2d')][_0x190b('0x1f')]);_0x536d7b[_0x190b('0x1c')]=qs['offset'](_0x359b4a[_0x190b('0x2d')][_0x190b('0x1c')]);}_0x536d7b[_0x190b('0x36')]=qs['sort'](_0x359b4a[_0x190b('0x2d')]['sort']);_0x536d7b['where']=qs[_0x190b('0x2e')](_[_0x190b('0x37')](_0x359b4a['query'],_0x3730cc[_0x190b('0x2e')]),_0x14be2c);if(_0x359b4a[_0x190b('0x2d')][_0x190b('0x38')]){_0x536d7b['where']=_[_0x190b('0x39')](_0x536d7b[_0x190b('0x3a')],{'$or':_['map'](_0x14be2c,function(_0x5d006d){if(_0x5d006d[_0x190b('0x3b')]!=='VIRTUAL'){var _0x46bdba={};_0x46bdba[_0x5d006d[_0x190b('0x25')]]={'$like':'%'+_0x359b4a[_0x190b('0x2d')][_0x190b('0x38')]+'%'};return _0x46bdba;}})});}_0x536d7b=_['merge']({},_0x536d7b,_0x359b4a[_0x190b('0x3c')]);var _0x5f118c={'where':_0x536d7b[_0x190b('0x3a')]};return db[_0x190b('0x3d')]['count'](_0x5f118c)[_0x190b('0x22')](function(_0x2a75d2){_0x4d5f3f[_0x190b('0x1e')]=_0x2a75d2;if(_0x359b4a['query'][_0x190b('0x3e')]){_0x536d7b['include']=[{'all':!![]}];}return db['UserProfileResource']['findAll'](_0x536d7b);})[_0x190b('0x22')](function(_0x3aef1d){_0x4d5f3f[_0x190b('0x3f')]=_0x3aef1d;return _0x4d5f3f;})[_0x190b('0x22')](respondWithFilteredResult(_0x494f3f,_0x536d7b))['catch'](handleError(_0x494f3f,null));};exports['show']=function(_0x4045b7,_0x492240){var _0x110891={'raw':![],'where':{'id':_0x4045b7['params']['id']}},_0x3d67f0={};_0x3d67f0[_0x190b('0x30')]=_[_0x190b('0x2c')](db[_0x190b('0x3d')]['rawAttributes']);_0x3d67f0[_0x190b('0x2d')]=_[_0x190b('0x2c')](_0x4045b7['query']);_0x3d67f0[_0x190b('0x2e')]=_['intersection'](_0x3d67f0[_0x190b('0x30')],_0x3d67f0[_0x190b('0x2d')]);_0x110891[_0x190b('0x31')]=_['intersection'](_0x3d67f0[_0x190b('0x30')],qs['fields'](_0x4045b7[_0x190b('0x2d')][_0x190b('0x32')]));_0x110891[_0x190b('0x31')]=_0x110891[_0x190b('0x31')][_0x190b('0x33')]?_0x110891[_0x190b('0x31')]:_0x3d67f0[_0x190b('0x30')];if(_0x4045b7['query'][_0x190b('0x3e')]){_0x110891[_0x190b('0x40')]=[{'all':!![]}];}_0x110891=_[_0x190b('0x39')]({},_0x110891,_0x4045b7['options']);return db[_0x190b('0x3d')][_0x190b('0x41')](_0x110891)[_0x190b('0x22')](handleEntityNotFound(_0x492240,null))[_0x190b('0x22')](respondWithResult(_0x492240,null))[_0x190b('0x42')](handleError(_0x492240,null));};exports['create']=function(_0x1f2262,_0xadc789){return db[_0x190b('0x3d')]['create'](_0x1f2262[_0x190b('0x43')],{})[_0x190b('0x22')](respondWithResult(_0xadc789,0xc9))[_0x190b('0x42')](handleError(_0xadc789,null));};exports['update']=function(_0x4cb561,_0x14958e){if(_0x4cb561[_0x190b('0x43')]['id']){delete _0x4cb561[_0x190b('0x43')]['id'];}return db[_0x190b('0x3d')][_0x190b('0x41')]({'where':{'id':_0x4cb561[_0x190b('0x44')]['id']}})['then'](handleEntityNotFound(_0x14958e,null))[_0x190b('0x22')](saveUpdates(_0x4cb561[_0x190b('0x43')],null))[_0x190b('0x22')](respondWithResult(_0x14958e,null))['catch'](handleError(_0x14958e,null));};exports[_0x190b('0x23')]=function(_0x38c135,_0x215ab6){return db['UserProfileResource'][_0x190b('0x41')]({'where':{'id':_0x38c135[_0x190b('0x44')]['id']}})[_0x190b('0x22')](handleEntityNotFound(_0x215ab6,null))[_0x190b('0x22')](removeEntity(_0x215ab6,null))[_0x190b('0x42')](handleError(_0x215ab6,null));};exports[_0x190b('0x45')]=function(_0x33cc78,_0x2ea1c8){return db[_0x190b('0x3d')][_0x190b('0x45')]()[_0x190b('0x22')](respondWithResult(_0x2ea1c8,null))['catch'](handleError(_0x2ea1c8,null));}; \ No newline at end of file +var _0x4975=['to-csv','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','save','update','then','destroy','error','stack','name','fieldName','type','keys','query','filters','model','intersection','fields','attributes','length','hasOwnProperty','sort','pick','filter','where','map','VIRTUAL','options','UserProfileResource','count','includeAll','include','findAll','catch','show','params','rawAttributes','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox'];(function(_0x346b9e,_0x212837){var _0x330b9f=function(_0x2aa7dc){while(--_0x2aa7dc){_0x346b9e['push'](_0x346b9e['shift']());}};_0x330b9f(++_0x212837);}(_0x4975,0x86));var _0x5497=function(_0x367618,_0x392942){_0x367618=_0x367618-0x0;var _0x512471=_0x4975[_0x367618];return _0x512471;};'use strict';var emlformat=require(_0x5497('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5497('0x1'));var jsonpatch=require(_0x5497('0x2'));var rp=require(_0x5497('0x3'));var moment=require(_0x5497('0x4'));var BPromise=require(_0x5497('0x5'));var Mustache=require(_0x5497('0x6'));var util=require(_0x5497('0x7'));var path=require(_0x5497('0x8'));var sox=require(_0x5497('0x9'));var csv=require(_0x5497('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5497('0xb'));var _=require('lodash');var squel=require(_0x5497('0xc'));var crypto=require(_0x5497('0xd'));var jsforce=require(_0x5497('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5497('0xa'));var querystring=require('querystring');var Papa=require(_0x5497('0xf'));var Redis=require(_0x5497('0x10'));var authService=require(_0x5497('0x11'));var qs=require(_0x5497('0x12'));var as=require(_0x5497('0x13'));var hardwareService=require(_0x5497('0x14'));var logger=require(_0x5497('0x15'))(_0x5497('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x5497('0x17'))['db'];function respondWithStatusCode(_0x1b23df,_0x1bb794){_0x1bb794=_0x1bb794||0xcc;return function(_0x984990){if(_0x984990){return _0x1b23df[_0x5497('0x18')](_0x1bb794);}return _0x1b23df[_0x5497('0x19')](_0x1bb794)[_0x5497('0x1a')]();};}function respondWithResult(_0xaca97d,_0x363a5b){_0x363a5b=_0x363a5b||0xc8;return function(_0x1a4c74){if(_0x1a4c74){return _0xaca97d['status'](_0x363a5b)[_0x5497('0x1b')](_0x1a4c74);}};}function respondWithFilteredResult(_0x4fb8e9,_0x4237a9){return function(_0x2bfd8a){if(_0x2bfd8a){var _0x19e5f3=typeof _0x4237a9[_0x5497('0x1c')]===_0x5497('0x1d')&&typeof _0x4237a9[_0x5497('0x1e')]===_0x5497('0x1d');var _0x575f6b=_0x2bfd8a['count'];var _0x3f4d20=_0x19e5f3?0x0:_0x4237a9[_0x5497('0x1c')];var _0x3a47fd=_0x19e5f3?_0x2bfd8a['count']:_0x4237a9[_0x5497('0x1c')]+_0x4237a9[_0x5497('0x1e')];var _0x18e8a8;if(_0x3a47fd>=_0x575f6b){_0x3a47fd=_0x575f6b;_0x18e8a8=0xc8;}else{_0x18e8a8=0xce;}_0x4fb8e9[_0x5497('0x19')](_0x18e8a8);return _0x4fb8e9[_0x5497('0x1f')](_0x5497('0x20'),_0x3f4d20+'-'+_0x3a47fd+'/'+_0x575f6b)[_0x5497('0x1b')](_0x2bfd8a);}return null;};}function patchUpdates(_0x10226f){return function(_0x2e3960){try{jsonpatch[_0x5497('0x21')](_0x2e3960,_0x10226f,!![]);}catch(_0x186065){return BPromise['reject'](_0x186065);}return _0x2e3960[_0x5497('0x22')]();};}function saveUpdates(_0x4d1b27,_0x19200a){return function(_0xd0868d){if(_0xd0868d){return _0xd0868d[_0x5497('0x23')](_0x4d1b27)[_0x5497('0x24')](function(_0x35ecd9){return _0x35ecd9;});}return null;};}function removeEntity(_0x3b2fbc,_0x5018fa){return function(_0x54043a){if(_0x54043a){return _0x54043a[_0x5497('0x25')]()[_0x5497('0x24')](function(){_0x3b2fbc[_0x5497('0x19')](0xcc)[_0x5497('0x1a')]();});}};}function handleEntityNotFound(_0x5223b5,_0x13b7a4){return function(_0x57268c){if(!_0x57268c){_0x5223b5[_0x5497('0x18')](0x194);}return _0x57268c;};}function handleError(_0x16a2b4,_0x429d36){_0x429d36=_0x429d36||0x1f4;return function(_0x34a1a5){logger[_0x5497('0x26')](_0x34a1a5[_0x5497('0x27')]);if(_0x34a1a5['name']){delete _0x34a1a5[_0x5497('0x28')];}_0x16a2b4['status'](_0x429d36)['send'](_0x34a1a5);};}exports['index']=function(_0x39a2b7,_0x48d146){var _0x5e9356={},_0xc3465={},_0xb14593={'count':0x0,'rows':[]};var _0x1cf908=_['map'](db['UserProfileResource']['rawAttributes'],function(_0x371874){return{'name':_0x371874[_0x5497('0x29')],'type':_0x371874[_0x5497('0x2a')]['key']};});_0xc3465['model']=_['map'](_0x1cf908,_0x5497('0x28'));_0xc3465['query']=_[_0x5497('0x2b')](_0x39a2b7[_0x5497('0x2c')]);_0xc3465[_0x5497('0x2d')]=_['intersection'](_0xc3465[_0x5497('0x2e')],_0xc3465[_0x5497('0x2c')]);_0x5e9356['attributes']=_[_0x5497('0x2f')](_0xc3465[_0x5497('0x2e')],qs[_0x5497('0x30')](_0x39a2b7['query'][_0x5497('0x30')]));_0x5e9356[_0x5497('0x31')]=_0x5e9356[_0x5497('0x31')][_0x5497('0x32')]?_0x5e9356[_0x5497('0x31')]:_0xc3465['model'];if(!_0x39a2b7[_0x5497('0x2c')][_0x5497('0x33')]('nolimit')){_0x5e9356[_0x5497('0x1e')]=qs[_0x5497('0x1e')](_0x39a2b7[_0x5497('0x2c')][_0x5497('0x1e')]);_0x5e9356[_0x5497('0x1c')]=qs[_0x5497('0x1c')](_0x39a2b7['query'][_0x5497('0x1c')]);}_0x5e9356['order']=qs[_0x5497('0x34')](_0x39a2b7[_0x5497('0x2c')][_0x5497('0x34')]);_0x5e9356['where']=qs['filters'](_[_0x5497('0x35')](_0x39a2b7[_0x5497('0x2c')],_0xc3465[_0x5497('0x2d')]),_0x1cf908);if(_0x39a2b7[_0x5497('0x2c')][_0x5497('0x36')]){_0x5e9356[_0x5497('0x37')]=_['merge'](_0x5e9356[_0x5497('0x37')],{'$or':_[_0x5497('0x38')](_0x1cf908,function(_0x3de8fe){if(_0x3de8fe[_0x5497('0x2a')]!==_0x5497('0x39')){var _0x468902={};_0x468902[_0x3de8fe[_0x5497('0x28')]]={'$like':'%'+_0x39a2b7[_0x5497('0x2c')][_0x5497('0x36')]+'%'};return _0x468902;}})});}_0x5e9356=_['merge']({},_0x5e9356,_0x39a2b7[_0x5497('0x3a')]);var _0x32fa2b={'where':_0x5e9356[_0x5497('0x37')]};return db[_0x5497('0x3b')][_0x5497('0x3c')](_0x32fa2b)[_0x5497('0x24')](function(_0x4299be){_0xb14593['count']=_0x4299be;if(_0x39a2b7[_0x5497('0x2c')][_0x5497('0x3d')]){_0x5e9356[_0x5497('0x3e')]=[{'all':!![]}];}return db[_0x5497('0x3b')][_0x5497('0x3f')](_0x5e9356);})[_0x5497('0x24')](function(_0x114471){_0xb14593['rows']=_0x114471;return _0xb14593;})[_0x5497('0x24')](respondWithFilteredResult(_0x48d146,_0x5e9356))[_0x5497('0x40')](handleError(_0x48d146,null));};exports[_0x5497('0x41')]=function(_0x1e6389,_0x20e947){var _0xd90608={'raw':![],'where':{'id':_0x1e6389[_0x5497('0x42')]['id']}},_0xc1a999={};_0xc1a999[_0x5497('0x2e')]=_[_0x5497('0x2b')](db['UserProfileResource'][_0x5497('0x43')]);_0xc1a999['query']=_[_0x5497('0x2b')](_0x1e6389[_0x5497('0x2c')]);_0xc1a999[_0x5497('0x2d')]=_[_0x5497('0x2f')](_0xc1a999[_0x5497('0x2e')],_0xc1a999['query']);_0xd90608[_0x5497('0x31')]=_[_0x5497('0x2f')](_0xc1a999['model'],qs[_0x5497('0x30')](_0x1e6389['query'][_0x5497('0x30')]));_0xd90608['attributes']=_0xd90608[_0x5497('0x31')][_0x5497('0x32')]?_0xd90608[_0x5497('0x31')]:_0xc1a999[_0x5497('0x2e')];if(_0x1e6389[_0x5497('0x2c')]['includeAll']){_0xd90608['include']=[{'all':!![]}];}_0xd90608=_['merge']({},_0xd90608,_0x1e6389['options']);return db[_0x5497('0x3b')][_0x5497('0x44')](_0xd90608)[_0x5497('0x24')](handleEntityNotFound(_0x20e947,null))[_0x5497('0x24')](respondWithResult(_0x20e947,null))[_0x5497('0x40')](handleError(_0x20e947,null));};exports[_0x5497('0x45')]=function(_0xc78abe,_0x466287){return db[_0x5497('0x3b')]['create'](_0xc78abe[_0x5497('0x46')],{})[_0x5497('0x24')](respondWithResult(_0x466287,0xc9))[_0x5497('0x40')](handleError(_0x466287,null));};exports['update']=function(_0x3e4da2,_0x530475){if(_0x3e4da2[_0x5497('0x46')]['id']){delete _0x3e4da2[_0x5497('0x46')]['id'];}return db[_0x5497('0x3b')]['find']({'where':{'id':_0x3e4da2[_0x5497('0x42')]['id']}})[_0x5497('0x24')](handleEntityNotFound(_0x530475,null))['then'](saveUpdates(_0x3e4da2[_0x5497('0x46')],null))['then'](respondWithResult(_0x530475,null))[_0x5497('0x40')](handleError(_0x530475,null));};exports['destroy']=function(_0x416f76,_0x400860){return db[_0x5497('0x3b')][_0x5497('0x44')]({'where':{'id':_0x416f76[_0x5497('0x42')]['id']}})[_0x5497('0x24')](handleEntityNotFound(_0x400860,null))[_0x5497('0x24')](removeEntity(_0x400860,null))[_0x5497('0x40')](handleError(_0x400860,null));};exports['describe']=function(_0x1f73eb,_0x5b2c22){return db['UserProfileResource'][_0x5497('0x47')]()[_0x5497('0x24')](respondWithResult(_0x5b2c22,null))['catch'](handleError(_0x5b2c22,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index 1655291..8561706 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 _0xa7b5=['lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./userProfileResource.attributes','exports','user_profile_has_resources','resourceId','sectionId'];(function(_0x1efd53,_0x34b7c9){var _0x69f643=function(_0x17f7e9){while(--_0x17f7e9){_0x1efd53['push'](_0x1efd53['shift']());}};_0x69f643(++_0x34b7c9);}(_0xa7b5,0x193));var _0x5a7b=function(_0x4f9c38,_0x52d092){_0x4f9c38=_0x4f9c38-0x0;var _0x1d6a31=_0xa7b5[_0x4f9c38];return _0x1d6a31;};'use strict';var _=require(_0x5a7b('0x0'));var util=require(_0x5a7b('0x1'));var logger=require(_0x5a7b('0x2'))(_0x5a7b('0x3'));var moment=require('moment');var BPromise=require(_0x5a7b('0x4'));var rp=require(_0x5a7b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5a7b('0x6'));var config=require(_0x5a7b('0x7'));var attributes=require(_0x5a7b('0x8'));module[_0x5a7b('0x9')]=function(_0x1923c8,_0x32df53){return _0x1923c8['define']('UserProfileResource',attributes,{'tableName':_0x5a7b('0xa'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0x5a7b('0xb'),_0x5a7b('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x67b3=['moment','path','rimraf','../../config/environment','./userProfileResource.attributes','UserProfileResource','user_profile_has_resources','compositeIndex','resourceId','sectionId','util','api'];(function(_0x3f7694,_0x4976c2){var _0x5db782=function(_0x24e7b6){while(--_0x24e7b6){_0x3f7694['push'](_0x3f7694['shift']());}};_0x5db782(++_0x4976c2);}(_0x67b3,0xb2));var _0x367b=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0x67b3[_0x5608a3];return _0x1ed50a;};'use strict';var _=require('lodash');var util=require(_0x367b('0x0'));var logger=require('../../config/logger')(_0x367b('0x1'));var moment=require(_0x367b('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x367b('0x3'));var rimraf=require(_0x367b('0x4'));var config=require(_0x367b('0x5'));var attributes=require(_0x367b('0x6'));module['exports']=function(_0x4383f6,_0x21a0fc){return _0x4383f6['define'](_0x367b('0x7'),attributes,{'tableName':_0x367b('0x8'),'paranoid':![],'indexes':[{'name':_0x367b('0x9'),'fields':[_0x367b('0xa'),_0x367b('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index 935b0e7..db8beed 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 _0xdce7=['request','then','info','UserProfileResource,\x20%s,\x20%s','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client'];(function(_0x1d6a82,_0x37c315){var _0x5834ac=function(_0x2402ba){while(--_0x2402ba){_0x1d6a82['push'](_0x1d6a82['shift']());}};_0x5834ac(++_0x37c315);}(_0xdce7,0x68));var _0x7dce=function(_0x2bf888,_0x374f0b){_0x2bf888=_0x2bf888-0x0;var _0x3038d6=_0xdce7[_0x2bf888];return _0x3038d6;};'use strict';var _=require(_0x7dce('0x0'));var util=require(_0x7dce('0x1'));var moment=require(_0x7dce('0x2'));var BPromise=require(_0x7dce('0x3'));var rs=require(_0x7dce('0x4'));var fs=require('fs');var Redis=require(_0x7dce('0x5'));var db=require(_0x7dce('0x6'))['db'];var utils=require(_0x7dce('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x7dce('0x8'));var jayson=require(_0x7dce('0x9'));var client=jayson[_0x7dce('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4f8965,_0x544332,_0x468a03){return new BPromise(function(_0x3f5712,_0x2fa2c6){return client[_0x7dce('0xb')](_0x4f8965,_0x468a03)[_0x7dce('0xc')](function(_0x3feb42){logger[_0x7dce('0xd')](_0x7dce('0xe'),_0x544332,'request\x20sent');logger[_0x7dce('0xf')](_0x7dce('0x10'),_0x544332,_0x7dce('0x11'),JSON[_0x7dce('0x12')](_0x3feb42));if(_0x3feb42[_0x7dce('0x13')]){if(_0x3feb42['error']['code']===0x1f4){logger[_0x7dce('0x13')](_0x7dce('0xe'),_0x544332,_0x3feb42[_0x7dce('0x13')][_0x7dce('0x14')]);return _0x2fa2c6(_0x3feb42[_0x7dce('0x13')]['message']);}logger[_0x7dce('0x13')](_0x7dce('0xe'),_0x544332,_0x3feb42[_0x7dce('0x13')]['message']);return _0x3f5712(_0x3feb42['error'][_0x7dce('0x14')]);}else{logger[_0x7dce('0xd')](_0x7dce('0xe'),_0x544332,_0x7dce('0x11'));_0x3f5712(_0x3feb42[_0x7dce('0x15')]['message']);}})[_0x7dce('0x16')](function(_0x552724){logger[_0x7dce('0x13')](_0x7dce('0xe'),_0x544332,_0x552724);_0x2fa2c6(_0x552724);});});} \ No newline at end of file +var _0x9612=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x2d892a,_0x59e61a){var _0x367765=function(_0x1c9901){while(--_0x1c9901){_0x2d892a['push'](_0x2d892a['shift']());}};_0x367765(++_0x59e61a);}(_0x9612,0x152));var _0x2961=function(_0x4e17bc,_0x1e7f79){_0x4e17bc=_0x4e17bc-0x0;var _0x309bd9=_0x9612[_0x4e17bc];return _0x309bd9;};'use strict';var _=require(_0x2961('0x0'));var util=require(_0x2961('0x1'));var moment=require(_0x2961('0x2'));var BPromise=require(_0x2961('0x3'));var rs=require(_0x2961('0x4'));var fs=require('fs');var Redis=require(_0x2961('0x5'));var db=require(_0x2961('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x2961('0x7'))(_0x2961('0x8'));var config=require('../../config/environment');var jayson=require(_0x2961('0x9'));var client=jayson[_0x2961('0xa')][_0x2961('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3a7490,_0x568970,_0x53ae5b){return new BPromise(function(_0x541aae,_0x2e0845){return client[_0x2961('0xc')](_0x3a7490,_0x53ae5b)[_0x2961('0xd')](function(_0x4a6999){logger[_0x2961('0xe')](_0x2961('0xf'),_0x568970,_0x2961('0x10'));logger[_0x2961('0x11')]('UserProfileResource,\x20%s,\x20%s,\x20%s',_0x568970,_0x2961('0x10'),JSON[_0x2961('0x12')](_0x4a6999));if(_0x4a6999[_0x2961('0x13')]){if(_0x4a6999[_0x2961('0x13')][_0x2961('0x14')]===0x1f4){logger[_0x2961('0x13')](_0x2961('0xf'),_0x568970,_0x4a6999[_0x2961('0x13')][_0x2961('0x15')]);return _0x2e0845(_0x4a6999[_0x2961('0x13')][_0x2961('0x15')]);}logger[_0x2961('0x13')](_0x2961('0xf'),_0x568970,_0x4a6999[_0x2961('0x13')]['message']);return _0x541aae(_0x4a6999['error'][_0x2961('0x15')]);}else{logger[_0x2961('0xe')]('UserProfileResource,\x20%s,\x20%s',_0x568970,_0x2961('0x10'));_0x541aae(_0x4a6999[_0x2961('0x16')]['message']);}})[_0x2961('0x17')](function(_0x4a30ad){logger[_0x2961('0x13')](_0x2961('0xf'),_0x568970,_0x4a30ad);_0x2e0845(_0x4a30ad);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index 93915df..756530d 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 _0x23b0=['isAuthenticated','describe','show','post','create','put','/:id','update','delete','destroy','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileSection.controller','get','index','/describe'];(function(_0x426aab,_0xcd8e38){var _0x510f65=function(_0xf2032e){while(--_0xf2032e){_0x426aab['push'](_0x426aab['shift']());}};_0x510f65(++_0xcd8e38);}(_0x23b0,0x180));var _0x023b=function(_0x3a5c01,_0x6dbc92){_0x3a5c01=_0x3a5c01-0x0;var _0x9838d7=_0x23b0[_0x3a5c01];return _0x9838d7;};'use strict';var multer=require(_0x023b('0x0'));var util=require(_0x023b('0x1'));var path=require('path');var timeout=require(_0x023b('0x2'));var express=require('express');var router=express[_0x023b('0x3')]();var fs_extra=require(_0x023b('0x4'));var auth=require(_0x023b('0x5'));var interaction=require(_0x023b('0x6'));var config=require(_0x023b('0x7'));var controller=require(_0x023b('0x8'));router[_0x023b('0x9')]('/',auth['isAuthenticated'](),controller[_0x023b('0xa')]);router['get'](_0x023b('0xb'),auth[_0x023b('0xc')](),controller[_0x023b('0xd')]);router[_0x023b('0x9')]('/:id',auth[_0x023b('0xc')](),controller[_0x023b('0xe')]);router[_0x023b('0xf')]('/',auth['isAuthenticated'](),controller[_0x023b('0x10')]);router[_0x023b('0x11')](_0x023b('0x12'),auth['isAuthenticated'](),controller[_0x023b('0x13')]);router[_0x023b('0x14')](_0x023b('0x12'),auth[_0x023b('0xc')](),controller[_0x023b('0x15')]);module['exports']=router; \ No newline at end of file +var _0xd4a3=['exports','multer','util','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','./userProfileSection.controller','get','isAuthenticated','index','/describe','describe','show','create','put','/:id','update','delete','destroy'];(function(_0xf36008,_0x28e1aa){var _0x534b4c=function(_0x34ea90){while(--_0x34ea90){_0xf36008['push'](_0xf36008['shift']());}};_0x534b4c(++_0x28e1aa);}(_0xd4a3,0xa1));var _0x3d4a=function(_0x4b0b8c,_0x37022d){_0x4b0b8c=_0x4b0b8c-0x0;var _0x3f55a2=_0xd4a3[_0x4b0b8c];return _0x3f55a2;};'use strict';var multer=require(_0x3d4a('0x0'));var util=require(_0x3d4a('0x1'));var path=require('path');var timeout=require(_0x3d4a('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x3d4a('0x3'));var auth=require(_0x3d4a('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x3d4a('0x5'));var controller=require(_0x3d4a('0x6'));router[_0x3d4a('0x7')]('/',auth[_0x3d4a('0x8')](),controller[_0x3d4a('0x9')]);router['get'](_0x3d4a('0xa'),auth[_0x3d4a('0x8')](),controller[_0x3d4a('0xb')]);router[_0x3d4a('0x7')]('/:id',auth[_0x3d4a('0x8')](),controller[_0x3d4a('0xc')]);router['post']('/',auth[_0x3d4a('0x8')](),controller[_0x3d4a('0xd')]);router[_0x3d4a('0xe')](_0x3d4a('0xf'),auth[_0x3d4a('0x8')](),controller[_0x3d4a('0x10')]);router[_0x3d4a('0x11')](_0x3d4a('0xf'),auth[_0x3d4a('0x8')](),controller[_0x3d4a('0x12')]);module[_0x3d4a('0x13')]=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index 198796f..2a2e1c4 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 _0xbc9d=['sequelize','exports','STRING','INTEGER','setDataValue','crudPermissions','join','getDataValue','split'];(function(_0x107d38,_0x12fc9e){var _0x51397c=function(_0x29b0dc){while(--_0x29b0dc){_0x107d38['push'](_0x107d38['shift']());}};_0x51397c(++_0x12fc9e);}(_0xbc9d,0xb4));var _0xdbc9=function(_0x4c5e48,_0xc065e){_0x4c5e48=_0x4c5e48-0x0;var _0x39e96d=_0xbc9d[_0x4c5e48];return _0x39e96d;};'use strict';var Sequelize=require(_0xdbc9('0x0'));module[_0xdbc9('0x1')]={'name':{'type':Sequelize[_0xdbc9('0x2')],'allowNull':![]},'category':{'type':Sequelize[_0xdbc9('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize[_0xdbc9('0x3')],'allowNull':![]},'enabled':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'autoAssociation':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x2aba48){this[_0xdbc9('0x4')](_0xdbc9('0x5'),_0x2aba48?_0x2aba48[_0xdbc9('0x6')](''):[]);},'get':function(){return this[_0xdbc9('0x7')](_0xdbc9('0x5'))?this[_0xdbc9('0x7')]('crudPermissions')[_0xdbc9('0x8')](''):[];}}}; \ No newline at end of file +var _0xd4f4=['setDataValue','crudPermissions','getDataValue','split','sequelize','exports','STRING','INTEGER','BOOLEAN'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xd4f4,0x8b));var _0x4d4f=function(_0xc9d64b,_0x134ecd){_0xc9d64b=_0xc9d64b-0x0;var _0x2e2e76=_0xd4f4[_0xc9d64b];return _0x2e2e76;};'use strict';var Sequelize=require(_0x4d4f('0x0'));module[_0x4d4f('0x1')]={'name':{'type':Sequelize[_0x4d4f('0x2')],'allowNull':![]},'category':{'type':Sequelize[_0x4d4f('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x4d4f('0x3')],'allowNull':![]},'enabled':{'type':Sequelize[_0x4d4f('0x4')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x4d4f('0x4')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x4d4f('0x2')],'set':function(_0x25087a){this[_0x4d4f('0x5')](_0x4d4f('0x6'),_0x25087a?_0x25087a['join'](''):[]);},'get':function(){return this['getDataValue']('crudPermissions')?this[_0x4d4f('0x7')](_0x4d4f('0x6'))[_0x4d4f('0x8')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index 93a2978..0962b0f 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 _0xdef4=['options','UserProfileSection','includeAll','include','findAll','rows','catch','show','params','fields','length','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','squel','crypto','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','status','limit','count','offset','set','json','apply','reject','save','update','then','destroy','end','sendStatus','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','nolimit','sort','pick','filter','where','merge'];(function(_0x3aa97b,_0x1db7b8){var _0x37d05e=function(_0x4f3751){while(--_0x4f3751){_0x3aa97b['push'](_0x3aa97b['shift']());}};_0x37d05e(++_0x1db7b8);}(_0xdef4,0x1cb));var _0x4def=function(_0x2de753,_0x4a544d){_0x2de753=_0x2de753-0x0;var _0x8e70a5=_0xdef4[_0x2de753];return _0x8e70a5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4def('0x0'));var zipdir=require(_0x4def('0x1'));var jsonpatch=require(_0x4def('0x2'));var rp=require(_0x4def('0x3'));var moment=require(_0x4def('0x4'));var BPromise=require(_0x4def('0x5'));var Mustache=require(_0x4def('0x6'));var util=require(_0x4def('0x7'));var path=require('path');var sox=require(_0x4def('0x8'));var csv=require(_0x4def('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4def('0xa'));var _=require('lodash');var squel=require(_0x4def('0xb'));var crypto=require(_0x4def('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x4def('0xd'));var toCsv=require(_0x4def('0x9'));var querystring=require(_0x4def('0xe'));var Papa=require(_0x4def('0xf'));var Redis=require(_0x4def('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x4def('0x11'));var as=require(_0x4def('0x12'));var hardwareService=require(_0x4def('0x13'));var logger=require(_0x4def('0x14'))(_0x4def('0x15'));var utils=require(_0x4def('0x16'));var config=require(_0x4def('0x17'));var licenseUtil=require(_0x4def('0x18'));var db=require(_0x4def('0x19'))['db'];function respondWithStatusCode(_0x4e0603,_0x129559){_0x129559=_0x129559||0xcc;return function(_0x3abff4){if(_0x3abff4){return _0x4e0603['sendStatus'](_0x129559);}return _0x4e0603['status'](_0x129559)['end']();};}function respondWithResult(_0x51c297,_0x29cee1){_0x29cee1=_0x29cee1||0xc8;return function(_0x340c98){if(_0x340c98){return _0x51c297[_0x4def('0x1a')](_0x29cee1)['json'](_0x340c98);}};}function respondWithFilteredResult(_0x39df23,_0x163d5d){return function(_0x5a7e36){if(_0x5a7e36){var _0x2854a9=typeof _0x163d5d['offset']==='undefined'&&typeof _0x163d5d[_0x4def('0x1b')]==='undefined';var _0x26fec7=_0x5a7e36[_0x4def('0x1c')];var _0xf7ef84=_0x2854a9?0x0:_0x163d5d[_0x4def('0x1d')];var _0x53767f=_0x2854a9?_0x5a7e36[_0x4def('0x1c')]:_0x163d5d[_0x4def('0x1d')]+_0x163d5d['limit'];var _0x24063f;if(_0x53767f>=_0x26fec7){_0x53767f=_0x26fec7;_0x24063f=0xc8;}else{_0x24063f=0xce;}_0x39df23[_0x4def('0x1a')](_0x24063f);return _0x39df23[_0x4def('0x1e')]('Content-Range',_0xf7ef84+'-'+_0x53767f+'/'+_0x26fec7)[_0x4def('0x1f')](_0x5a7e36);}return null;};}function patchUpdates(_0x1d7b35){return function(_0x109e57){try{jsonpatch[_0x4def('0x20')](_0x109e57,_0x1d7b35,!![]);}catch(_0x32ee90){return BPromise[_0x4def('0x21')](_0x32ee90);}return _0x109e57[_0x4def('0x22')]();};}function saveUpdates(_0x5d632a,_0x2790f5){return function(_0x5dccc5){if(_0x5dccc5){return _0x5dccc5[_0x4def('0x23')](_0x5d632a)[_0x4def('0x24')](function(_0x28fcbb){return _0x28fcbb;});}return null;};}function removeEntity(_0x56d5f7,_0x5b612f){return function(_0x2436d9){if(_0x2436d9){return _0x2436d9[_0x4def('0x25')]()[_0x4def('0x24')](function(){_0x56d5f7['status'](0xcc)[_0x4def('0x26')]();});}};}function handleEntityNotFound(_0x2d8ebf,_0x548d9c){return function(_0x44ed1f){if(!_0x44ed1f){_0x2d8ebf[_0x4def('0x27')](0x194);}return _0x44ed1f;};}function handleError(_0xc15f26,_0x29ff5a){_0x29ff5a=_0x29ff5a||0x1f4;return function(_0x414ad9){logger['error'](_0x414ad9['stack']);if(_0x414ad9[_0x4def('0x28')]){delete _0x414ad9[_0x4def('0x28')];}_0xc15f26[_0x4def('0x1a')](_0x29ff5a)[_0x4def('0x29')](_0x414ad9);};}exports[_0x4def('0x2a')]=function(_0x40ebd1,_0x20e056){var _0x530119={},_0x3e00f9={},_0x4df660={'count':0x0,'rows':[]};var _0x2ff784=_[_0x4def('0x2b')](db['UserProfileSection'][_0x4def('0x2c')],function(_0x416c9c){return{'name':_0x416c9c[_0x4def('0x2d')],'type':_0x416c9c[_0x4def('0x2e')]['key']};});_0x3e00f9[_0x4def('0x2f')]=_['map'](_0x2ff784,_0x4def('0x28'));_0x3e00f9[_0x4def('0x30')]=_[_0x4def('0x31')](_0x40ebd1[_0x4def('0x30')]);_0x3e00f9[_0x4def('0x32')]=_[_0x4def('0x33')](_0x3e00f9[_0x4def('0x2f')],_0x3e00f9[_0x4def('0x30')]);_0x530119['attributes']=_[_0x4def('0x33')](_0x3e00f9[_0x4def('0x2f')],qs['fields'](_0x40ebd1[_0x4def('0x30')]['fields']));_0x530119[_0x4def('0x34')]=_0x530119[_0x4def('0x34')]['length']?_0x530119[_0x4def('0x34')]:_0x3e00f9[_0x4def('0x2f')];if(!_0x40ebd1['query']['hasOwnProperty'](_0x4def('0x35'))){_0x530119[_0x4def('0x1b')]=qs['limit'](_0x40ebd1[_0x4def('0x30')][_0x4def('0x1b')]);_0x530119[_0x4def('0x1d')]=qs[_0x4def('0x1d')](_0x40ebd1[_0x4def('0x30')][_0x4def('0x1d')]);}_0x530119['order']=qs[_0x4def('0x36')](_0x40ebd1[_0x4def('0x30')]['sort']);_0x530119['where']=qs[_0x4def('0x32')](_[_0x4def('0x37')](_0x40ebd1[_0x4def('0x30')],_0x3e00f9[_0x4def('0x32')]),_0x2ff784);if(_0x40ebd1['query'][_0x4def('0x38')]){_0x530119[_0x4def('0x39')]=_['merge'](_0x530119[_0x4def('0x39')],{'$or':_[_0x4def('0x2b')](_0x2ff784,function(_0x1b1b18){if(_0x1b1b18[_0x4def('0x2e')]!=='VIRTUAL'){var _0x4d4154={};_0x4d4154[_0x1b1b18[_0x4def('0x28')]]={'$like':'%'+_0x40ebd1['query'][_0x4def('0x38')]+'%'};return _0x4d4154;}})});}_0x530119=_[_0x4def('0x3a')]({},_0x530119,_0x40ebd1[_0x4def('0x3b')]);var _0x11c98a={'where':_0x530119['where']};return db[_0x4def('0x3c')][_0x4def('0x1c')](_0x11c98a)['then'](function(_0x376808){_0x4df660[_0x4def('0x1c')]=_0x376808;if(_0x40ebd1[_0x4def('0x30')][_0x4def('0x3d')]){_0x530119[_0x4def('0x3e')]=[{'all':!![]}];}return db[_0x4def('0x3c')][_0x4def('0x3f')](_0x530119);})[_0x4def('0x24')](function(_0x5c9233){_0x4df660[_0x4def('0x40')]=_0x5c9233;return _0x4df660;})[_0x4def('0x24')](respondWithFilteredResult(_0x20e056,_0x530119))[_0x4def('0x41')](handleError(_0x20e056,null));};exports[_0x4def('0x42')]=function(_0x33f21d,_0x41ec59){var _0x3c7e4f={'raw':![],'where':{'id':_0x33f21d[_0x4def('0x43')]['id']}},_0x51a79f={};_0x51a79f['model']=_[_0x4def('0x31')](db[_0x4def('0x3c')][_0x4def('0x2c')]);_0x51a79f[_0x4def('0x30')]=_[_0x4def('0x31')](_0x33f21d['query']);_0x51a79f[_0x4def('0x32')]=_['intersection'](_0x51a79f[_0x4def('0x2f')],_0x51a79f[_0x4def('0x30')]);_0x3c7e4f['attributes']=_[_0x4def('0x33')](_0x51a79f[_0x4def('0x2f')],qs[_0x4def('0x44')](_0x33f21d[_0x4def('0x30')][_0x4def('0x44')]));_0x3c7e4f[_0x4def('0x34')]=_0x3c7e4f['attributes'][_0x4def('0x45')]?_0x3c7e4f[_0x4def('0x34')]:_0x51a79f[_0x4def('0x2f')];if(_0x33f21d[_0x4def('0x30')]['includeAll']){_0x3c7e4f[_0x4def('0x3e')]=[{'all':!![]}];}_0x3c7e4f=_[_0x4def('0x3a')]({},_0x3c7e4f,_0x33f21d['options']);return db[_0x4def('0x3c')][_0x4def('0x46')](_0x3c7e4f)[_0x4def('0x24')](handleEntityNotFound(_0x41ec59,null))[_0x4def('0x24')](respondWithResult(_0x41ec59,null))['catch'](handleError(_0x41ec59,null));};exports[_0x4def('0x47')]=function(_0x237f87,_0x2f22c3){return db[_0x4def('0x3c')][_0x4def('0x47')](_0x237f87[_0x4def('0x48')],{})[_0x4def('0x24')](respondWithResult(_0x2f22c3,0xc9))[_0x4def('0x41')](handleError(_0x2f22c3,null));};exports['update']=function(_0x26c73c,_0x3f5634){if(_0x26c73c[_0x4def('0x48')]['id']){delete _0x26c73c[_0x4def('0x48')]['id'];}return db[_0x4def('0x3c')][_0x4def('0x46')]({'where':{'id':_0x26c73c[_0x4def('0x43')]['id']}})[_0x4def('0x24')](handleEntityNotFound(_0x3f5634,null))[_0x4def('0x24')](saveUpdates(_0x26c73c['body'],null))[_0x4def('0x24')](respondWithResult(_0x3f5634,null))[_0x4def('0x41')](handleError(_0x3f5634,null));};exports[_0x4def('0x25')]=function(_0x24c931,_0x39e1e5){return db[_0x4def('0x3c')][_0x4def('0x46')]({'where':{'id':_0x24c931['params']['id']}})[_0x4def('0x24')](handleEntityNotFound(_0x39e1e5,null))[_0x4def('0x24')](removeEntity(_0x39e1e5,null))[_0x4def('0x41')](handleError(_0x39e1e5,null));};exports[_0x4def('0x49')]=function(_0x52e955,_0x48cb43){return db[_0x4def('0x3c')]['describe']()[_0x4def('0x24')](respondWithResult(_0x48cb43,null))['catch'](handleError(_0x48cb43,null));}; \ No newline at end of file +var _0xc482=['limit','count','set','Content-Range','apply','reject','save','then','error','stack','name','UserProfileSection','rawAttributes','fieldName','model','map','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','include','rows','catch','show','params','keys','options','find','create','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined'];(function(_0x4b9f92,_0x486261){var _0x4e9616=function(_0x598daa){while(--_0x598daa){_0x4b9f92['push'](_0x4b9f92['shift']());}};_0x4e9616(++_0x486261);}(_0xc482,0x10d));var _0x2c48=function(_0x426e82,_0x2e1758){_0x426e82=_0x426e82-0x0;var _0x3db1f0=_0xc482[_0x426e82];return _0x3db1f0;};'use strict';var emlformat=require(_0x2c48('0x0'));var rimraf=require(_0x2c48('0x1'));var zipdir=require(_0x2c48('0x2'));var jsonpatch=require(_0x2c48('0x3'));var rp=require(_0x2c48('0x4'));var moment=require('moment');var BPromise=require(_0x2c48('0x5'));var Mustache=require('mustache');var util=require(_0x2c48('0x6'));var path=require(_0x2c48('0x7'));var sox=require('sox');var csv=require(_0x2c48('0x8'));var ejs=require(_0x2c48('0x9'));var fs=require('fs');var fs_extra=require(_0x2c48('0xa'));var _=require('lodash');var squel=require(_0x2c48('0xb'));var crypto=require(_0x2c48('0xc'));var jsforce=require(_0x2c48('0xd'));var deskjs=require(_0x2c48('0xe'));var toCsv=require(_0x2c48('0x8'));var querystring=require(_0x2c48('0xf'));var Papa=require(_0x2c48('0x10'));var Redis=require(_0x2c48('0x11'));var authService=require(_0x2c48('0x12'));var qs=require(_0x2c48('0x13'));var as=require(_0x2c48('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2c48('0x15'))('api');var utils=require(_0x2c48('0x16'));var config=require(_0x2c48('0x17'));var licenseUtil=require(_0x2c48('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3dd8b8,_0x4bf5e8){_0x4bf5e8=_0x4bf5e8||0xcc;return function(_0x50ae3b){if(_0x50ae3b){return _0x3dd8b8[_0x2c48('0x19')](_0x4bf5e8);}return _0x3dd8b8[_0x2c48('0x1a')](_0x4bf5e8)[_0x2c48('0x1b')]();};}function respondWithResult(_0x46934b,_0x326418){_0x326418=_0x326418||0xc8;return function(_0x2e2b6d){if(_0x2e2b6d){return _0x46934b[_0x2c48('0x1a')](_0x326418)[_0x2c48('0x1c')](_0x2e2b6d);}};}function respondWithFilteredResult(_0xbe5647,_0xf60394){return function(_0x1a31f2){if(_0x1a31f2){var _0x36d435=typeof _0xf60394[_0x2c48('0x1d')]===_0x2c48('0x1e')&&typeof _0xf60394[_0x2c48('0x1f')]===_0x2c48('0x1e');var _0x1a9f4e=_0x1a31f2['count'];var _0x1caa71=_0x36d435?0x0:_0xf60394[_0x2c48('0x1d')];var _0xac0f0a=_0x36d435?_0x1a31f2[_0x2c48('0x20')]:_0xf60394[_0x2c48('0x1d')]+_0xf60394[_0x2c48('0x1f')];var _0x34bc51;if(_0xac0f0a>=_0x1a9f4e){_0xac0f0a=_0x1a9f4e;_0x34bc51=0xc8;}else{_0x34bc51=0xce;}_0xbe5647[_0x2c48('0x1a')](_0x34bc51);return _0xbe5647[_0x2c48('0x21')](_0x2c48('0x22'),_0x1caa71+'-'+_0xac0f0a+'/'+_0x1a9f4e)['json'](_0x1a31f2);}return null;};}function patchUpdates(_0x4f9262){return function(_0x39e354){try{jsonpatch[_0x2c48('0x23')](_0x39e354,_0x4f9262,!![]);}catch(_0x31ba0){return BPromise[_0x2c48('0x24')](_0x31ba0);}return _0x39e354[_0x2c48('0x25')]();};}function saveUpdates(_0x2bca0a,_0xcc7fb9){return function(_0x3dc84d){if(_0x3dc84d){return _0x3dc84d['update'](_0x2bca0a)[_0x2c48('0x26')](function(_0x5d1f7b){return _0x5d1f7b;});}return null;};}function removeEntity(_0x139b45,_0x38a740){return function(_0x403d4a){if(_0x403d4a){return _0x403d4a['destroy']()[_0x2c48('0x26')](function(){_0x139b45[_0x2c48('0x1a')](0xcc)[_0x2c48('0x1b')]();});}};}function handleEntityNotFound(_0x2f7d55,_0x5035b6){return function(_0x59ed8f){if(!_0x59ed8f){_0x2f7d55['sendStatus'](0x194);}return _0x59ed8f;};}function handleError(_0xc9d3c8,_0x4f200a){_0x4f200a=_0x4f200a||0x1f4;return function(_0x5a2c96){logger[_0x2c48('0x27')](_0x5a2c96[_0x2c48('0x28')]);if(_0x5a2c96[_0x2c48('0x29')]){delete _0x5a2c96[_0x2c48('0x29')];}_0xc9d3c8['status'](_0x4f200a)['send'](_0x5a2c96);};}exports['index']=function(_0x5a3c29,_0x1a0508){var _0x303d0c={},_0x1ed0d9={},_0x2e4613={'count':0x0,'rows':[]};var _0x2fff37=_['map'](db[_0x2c48('0x2a')][_0x2c48('0x2b')],function(_0xbebe6d){return{'name':_0xbebe6d[_0x2c48('0x2c')],'type':_0xbebe6d['type']['key']};});_0x1ed0d9[_0x2c48('0x2d')]=_[_0x2c48('0x2e')](_0x2fff37,_0x2c48('0x29'));_0x1ed0d9[_0x2c48('0x2f')]=_['keys'](_0x5a3c29[_0x2c48('0x2f')]);_0x1ed0d9[_0x2c48('0x30')]=_['intersection'](_0x1ed0d9[_0x2c48('0x2d')],_0x1ed0d9[_0x2c48('0x2f')]);_0x303d0c[_0x2c48('0x31')]=_[_0x2c48('0x32')](_0x1ed0d9[_0x2c48('0x2d')],qs[_0x2c48('0x33')](_0x5a3c29[_0x2c48('0x2f')][_0x2c48('0x33')]));_0x303d0c['attributes']=_0x303d0c[_0x2c48('0x31')][_0x2c48('0x34')]?_0x303d0c[_0x2c48('0x31')]:_0x1ed0d9[_0x2c48('0x2d')];if(!_0x5a3c29['query'][_0x2c48('0x35')](_0x2c48('0x36'))){_0x303d0c[_0x2c48('0x1f')]=qs[_0x2c48('0x1f')](_0x5a3c29[_0x2c48('0x2f')][_0x2c48('0x1f')]);_0x303d0c[_0x2c48('0x1d')]=qs['offset'](_0x5a3c29[_0x2c48('0x2f')][_0x2c48('0x1d')]);}_0x303d0c[_0x2c48('0x37')]=qs[_0x2c48('0x38')](_0x5a3c29['query']['sort']);_0x303d0c[_0x2c48('0x39')]=qs[_0x2c48('0x30')](_[_0x2c48('0x3a')](_0x5a3c29['query'],_0x1ed0d9[_0x2c48('0x30')]),_0x2fff37);if(_0x5a3c29[_0x2c48('0x2f')][_0x2c48('0x3b')]){_0x303d0c[_0x2c48('0x39')]=_[_0x2c48('0x3c')](_0x303d0c['where'],{'$or':_['map'](_0x2fff37,function(_0x1b511e){if(_0x1b511e[_0x2c48('0x3d')]!==_0x2c48('0x3e')){var _0x3bbd6a={};_0x3bbd6a[_0x1b511e['name']]={'$like':'%'+_0x5a3c29[_0x2c48('0x2f')]['filter']+'%'};return _0x3bbd6a;}})});}_0x303d0c=_[_0x2c48('0x3c')]({},_0x303d0c,_0x5a3c29['options']);var _0x22a0a5={'where':_0x303d0c['where']};return db['UserProfileSection'][_0x2c48('0x20')](_0x22a0a5)[_0x2c48('0x26')](function(_0x2322ed){_0x2e4613[_0x2c48('0x20')]=_0x2322ed;if(_0x5a3c29[_0x2c48('0x2f')]['includeAll']){_0x303d0c[_0x2c48('0x3f')]=[{'all':!![]}];}return db[_0x2c48('0x2a')]['findAll'](_0x303d0c);})[_0x2c48('0x26')](function(_0x34aad2){_0x2e4613[_0x2c48('0x40')]=_0x34aad2;return _0x2e4613;})[_0x2c48('0x26')](respondWithFilteredResult(_0x1a0508,_0x303d0c))[_0x2c48('0x41')](handleError(_0x1a0508,null));};exports[_0x2c48('0x42')]=function(_0x3041ec,_0x37eba7){var _0x11570e={'raw':![],'where':{'id':_0x3041ec[_0x2c48('0x43')]['id']}},_0x4cf5df={};_0x4cf5df['model']=_[_0x2c48('0x44')](db[_0x2c48('0x2a')][_0x2c48('0x2b')]);_0x4cf5df[_0x2c48('0x2f')]=_[_0x2c48('0x44')](_0x3041ec[_0x2c48('0x2f')]);_0x4cf5df[_0x2c48('0x30')]=_[_0x2c48('0x32')](_0x4cf5df[_0x2c48('0x2d')],_0x4cf5df['query']);_0x11570e[_0x2c48('0x31')]=_[_0x2c48('0x32')](_0x4cf5df[_0x2c48('0x2d')],qs[_0x2c48('0x33')](_0x3041ec['query'][_0x2c48('0x33')]));_0x11570e[_0x2c48('0x31')]=_0x11570e[_0x2c48('0x31')][_0x2c48('0x34')]?_0x11570e[_0x2c48('0x31')]:_0x4cf5df[_0x2c48('0x2d')];if(_0x3041ec[_0x2c48('0x2f')]['includeAll']){_0x11570e[_0x2c48('0x3f')]=[{'all':!![]}];}_0x11570e=_[_0x2c48('0x3c')]({},_0x11570e,_0x3041ec[_0x2c48('0x45')]);return db[_0x2c48('0x2a')][_0x2c48('0x46')](_0x11570e)[_0x2c48('0x26')](handleEntityNotFound(_0x37eba7,null))[_0x2c48('0x26')](respondWithResult(_0x37eba7,null))[_0x2c48('0x41')](handleError(_0x37eba7,null));};exports[_0x2c48('0x47')]=function(_0x2b2702,_0x15ecdf){return db[_0x2c48('0x2a')]['create'](_0x2b2702[_0x2c48('0x48')],{})['then'](respondWithResult(_0x15ecdf,0xc9))[_0x2c48('0x41')](handleError(_0x15ecdf,null));};exports[_0x2c48('0x49')]=function(_0x1541a9,_0x56e16f){if(_0x1541a9[_0x2c48('0x48')]['id']){delete _0x1541a9[_0x2c48('0x48')]['id'];}return db[_0x2c48('0x2a')]['find']({'where':{'id':_0x1541a9[_0x2c48('0x43')]['id']}})[_0x2c48('0x26')](handleEntityNotFound(_0x56e16f,null))[_0x2c48('0x26')](saveUpdates(_0x1541a9['body'],null))[_0x2c48('0x26')](respondWithResult(_0x56e16f,null))[_0x2c48('0x41')](handleError(_0x56e16f,null));};exports['destroy']=function(_0x51bc59,_0x367092){return db['UserProfileSection'][_0x2c48('0x46')]({'where':{'id':_0x51bc59[_0x2c48('0x43')]['id']}})['then'](handleEntityNotFound(_0x367092,null))[_0x2c48('0x26')](removeEntity(_0x367092,null))[_0x2c48('0x41')](handleError(_0x367092,null));};exports[_0x2c48('0x4a')]=function(_0x1d8345,_0x16d055){return db[_0x2c48('0x2a')][_0x2c48('0x4a')]()[_0x2c48('0x26')](respondWithResult(_0x16d055,null))[_0x2c48('0x41')](handleError(_0x16d055,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index 641a310..63111cd 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 _0x6d7a=['./userProfileSection.attributes','exports','define','UserProfileSection','user_profile_has_sections','compositeIndex','userProfileId','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x6d7a,0xd9));var _0xa6d7=function(_0x12f688,_0x585c25){_0x12f688=_0x12f688-0x0;var _0x59c3de=_0x6d7a[_0x12f688];return _0x59c3de;};'use strict';var _=require(_0xa6d7('0x0'));var util=require(_0xa6d7('0x1'));var logger=require(_0xa6d7('0x2'))(_0xa6d7('0x3'));var moment=require(_0xa6d7('0x4'));var BPromise=require('bluebird');var rp=require(_0xa6d7('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa6d7('0x6'));var config=require(_0xa6d7('0x7'));var attributes=require(_0xa6d7('0x8'));module[_0xa6d7('0x9')]=function(_0x214625,_0x25daa2){return _0x214625[_0xa6d7('0xa')](_0xa6d7('0xb'),attributes,{'tableName':_0xa6d7('0xc'),'paranoid':![],'indexes':[{'name':_0xa6d7('0xd'),'fields':['sectionId',_0xa6d7('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd74f=['path','../../config/environment','./userProfileSection.attributes','define','UserProfileSection','user_profile_has_sections','compositeIndex','userProfileId','../../config/logger','moment','bluebird'];(function(_0x41197c,_0x1569ff){var _0x327fda=function(_0x95625e){while(--_0x95625e){_0x41197c['push'](_0x41197c['shift']());}};_0x327fda(++_0x1569ff);}(_0xd74f,0x17e));var _0xfd74=function(_0x2ba4e3,_0x3c376c){_0x2ba4e3=_0x2ba4e3-0x0;var _0x79cdde=_0xd74f[_0x2ba4e3];return _0x79cdde;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xfd74('0x0'))('api');var moment=require(_0xfd74('0x1'));var BPromise=require(_0xfd74('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfd74('0x3'));var rimraf=require('rimraf');var config=require(_0xfd74('0x4'));var attributes=require(_0xfd74('0x5'));module['exports']=function(_0x10ecc9,_0x4bdd01){return _0x10ecc9[_0xfd74('0x6')](_0xfd74('0x7'),attributes,{'tableName':_0xfd74('0x8'),'paranoid':![],'indexes':[{'name':_0xfd74('0x9'),'fields':['sectionId',_0xfd74('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index cef005e..ab9fd6e 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 _0x956c=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','UserProfileSection,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x397c86,_0x24edb8){var _0x5c40c5=function(_0x3c92a3){while(--_0x3c92a3){_0x397c86['push'](_0x397c86['shift']());}};_0x5c40c5(++_0x24edb8);}(_0x956c,0xe2));var _0xc956=function(_0x30b188,_0x660d3b){_0x30b188=_0x30b188-0x0;var _0x5c382b=_0x956c[_0x30b188];return _0x5c382b;};'use strict';var _=require(_0xc956('0x0'));var util=require(_0xc956('0x1'));var moment=require(_0xc956('0x2'));var BPromise=require(_0xc956('0x3'));var rs=require(_0xc956('0x4'));var fs=require('fs');var Redis=require(_0xc956('0x5'));var db=require(_0xc956('0x6'))['db'];var utils=require(_0xc956('0x7'));var logger=require(_0xc956('0x8'))('rpc');var config=require(_0xc956('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xc956('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5128e9,_0x5b7cce,_0x53b61f){return new BPromise(function(_0x399c3d,_0x1ba43e){return client[_0xc956('0xb')](_0x5128e9,_0x53b61f)['then'](function(_0x18f24d){logger['info'](_0xc956('0xc'),_0x5b7cce,_0xc956('0xd'));logger['debug']('UserProfileSection,\x20%s,\x20%s,\x20%s',_0x5b7cce,_0xc956('0xd'),JSON[_0xc956('0xe')](_0x18f24d));if(_0x18f24d['error']){if(_0x18f24d[_0xc956('0xf')][_0xc956('0x10')]===0x1f4){logger['error'](_0xc956('0xc'),_0x5b7cce,_0x18f24d[_0xc956('0xf')][_0xc956('0x11')]);return _0x1ba43e(_0x18f24d['error'][_0xc956('0x11')]);}logger[_0xc956('0xf')](_0xc956('0xc'),_0x5b7cce,_0x18f24d['error'][_0xc956('0x11')]);return _0x399c3d(_0x18f24d['error'][_0xc956('0x11')]);}else{logger[_0xc956('0x12')](_0xc956('0xc'),_0x5b7cce,_0xc956('0xd'));_0x399c3d(_0x18f24d[_0xc956('0x13')][_0xc956('0x11')]);}})[_0xc956('0x14')](function(_0x271b6c){logger['error'](_0xc956('0xc'),_0x5b7cce,_0x271b6c);_0x1ba43e(_0x271b6c);});});} \ No newline at end of file +var _0xff43=['client','http','request','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise'];(function(_0x5ef12e,_0x59a72a){var _0xd8607=function(_0x4a71f8){while(--_0x4a71f8){_0x5ef12e['push'](_0x5ef12e['shift']());}};_0xd8607(++_0x59a72a);}(_0xff43,0x65));var _0x3ff4=function(_0x584f86,_0x5ec770){_0x584f86=_0x584f86-0x0;var _0x4f2807=_0xff43[_0x584f86];return _0x4f2807;};'use strict';var _=require('lodash');var util=require(_0x3ff4('0x0'));var moment=require(_0x3ff4('0x1'));var BPromise=require(_0x3ff4('0x2'));var rs=require(_0x3ff4('0x3'));var fs=require('fs');var Redis=require(_0x3ff4('0x4'));var db=require(_0x3ff4('0x5'))['db'];var utils=require(_0x3ff4('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x3ff4('0x7'));var jayson=require(_0x3ff4('0x8'));var client=jayson[_0x3ff4('0x9')][_0x3ff4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf3b14c,_0x260334,_0x394fe6){return new BPromise(function(_0x50266b,_0x38b3c2){return client[_0x3ff4('0xb')](_0xf3b14c,_0x394fe6)[_0x3ff4('0xc')](function(_0x46da1e){logger[_0x3ff4('0xd')](_0x3ff4('0xe'),_0x260334,'request\x20sent');logger['debug']('UserProfileSection,\x20%s,\x20%s,\x20%s',_0x260334,_0x3ff4('0xf'),JSON[_0x3ff4('0x10')](_0x46da1e));if(_0x46da1e[_0x3ff4('0x11')]){if(_0x46da1e['error'][_0x3ff4('0x12')]===0x1f4){logger['error'](_0x3ff4('0xe'),_0x260334,_0x46da1e[_0x3ff4('0x11')]['message']);return _0x38b3c2(_0x46da1e[_0x3ff4('0x11')][_0x3ff4('0x13')]);}logger[_0x3ff4('0x11')](_0x3ff4('0xe'),_0x260334,_0x46da1e[_0x3ff4('0x11')][_0x3ff4('0x13')]);return _0x50266b(_0x46da1e[_0x3ff4('0x11')]['message']);}else{logger[_0x3ff4('0xd')](_0x3ff4('0xe'),_0x260334,_0x3ff4('0xf'));_0x50266b(_0x46da1e[_0x3ff4('0x14')][_0x3ff4('0x13')]);}})[_0x3ff4('0x15')](function(_0x1194b3){logger['error']('UserProfileSection,\x20%s,\x20%s',_0x260334,_0x1194b3);_0x38b3c2(_0x1194b3);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index 9e0b090..b97b02c 100644 --- a/server/api/userSmsQueue/index.js +++ b/server/api/userSmsQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x45d809,_0x379b71){var _0x1fdd72=function(_0x57c7c5){while(--_0x57c7c5){_0x45d809['push'](_0x45d809['shift']());}};_0x1fdd72(++_0x379b71);}(_0xa9e0,0x123));var _0x0a9e=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0xa9e0[_0x28947d];return _0x12d2ee;};'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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x28bdb5,_0x463268){var _0x31ad7b=function(_0x23915a){while(--_0x23915a){_0x28bdb5['push'](_0x28bdb5['shift']());}};_0x31ad7b(++_0x463268);}(_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 20b3941..f9cd0cf 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 _0xc684=['sequelize','INTEGER'];(function(_0x1cebed,_0x184870){var _0x181235=function(_0x5b1109){while(--_0x5b1109){_0x1cebed['push'](_0x1cebed['shift']());}};_0x181235(++_0x184870);}(_0xc684,0x106));var _0x4c68=function(_0x2477e7,_0x386f4f){_0x2477e7=_0x2477e7-0x0;var _0x4883d7=_0xc684[_0x2477e7];return _0x4883d7;};'use strict';var Sequelize=require(_0x4c68('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x4c68('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x9611=['sequelize','exports'];(function(_0x544346,_0x12d37a){var _0x2fa5ba=function(_0x37e561){while(--_0x37e561){_0x544346['push'](_0x544346['shift']());}};_0x2fa5ba(++_0x12d37a);}(_0x9611,0xce));var _0x1961=function(_0x29ce4a,_0x929a79){_0x29ce4a=_0x29ce4a-0x0;var _0x4a842b=_0x9611[_0x29ce4a];return _0x4a842b;};'use strict';var Sequelize=require(_0x1961('0x0'));module[_0x1961('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'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 90cf643..721244e 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 _0x9b0d=['define','UserSmsQueue','user_has_sms_queues','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x5e4ef0,_0x25d300){var _0x1e46c8=function(_0x50d706){while(--_0x50d706){_0x5e4ef0['push'](_0x5e4ef0['shift']());}};_0x1e46c8(++_0x25d300);}(_0x9b0d,0xb7));var _0xd9b0=function(_0x28649e,_0x36c6bf){_0x28649e=_0x28649e-0x0;var _0x321334=_0x9b0d[_0x28649e];return _0x321334;};'use strict';var _=require('lodash');var util=require(_0xd9b0('0x0'));var logger=require(_0xd9b0('0x1'))(_0xd9b0('0x2'));var moment=require(_0xd9b0('0x3'));var BPromise=require('bluebird');var rp=require(_0xd9b0('0x4'));var fs=require('fs');var path=require(_0xd9b0('0x5'));var rimraf=require(_0xd9b0('0x6'));var config=require(_0xd9b0('0x7'));var attributes=require('./userSmsQueue.attributes');module[_0xd9b0('0x8')]=function(_0x21798d,_0x41dad9){return _0x21798d[_0xd9b0('0x9')](_0xd9b0('0xa'),attributes,{'tableName':_0xd9b0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x13f5=['define','UserSmsQueue','user_has_sms_queues','lodash','util','../../config/logger','api','bluebird','rimraf','../../config/environment','./userSmsQueue.attributes','exports'];(function(_0x220d5b,_0x290a1f){var _0x54ce5f=function(_0x11b979){while(--_0x11b979){_0x220d5b['push'](_0x220d5b['shift']());}};_0x54ce5f(++_0x290a1f);}(_0x13f5,0xc3));var _0x513f=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x13f5[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0x513f('0x0'));var util=require(_0x513f('0x1'));var logger=require(_0x513f('0x2'))(_0x513f('0x3'));var moment=require('moment');var BPromise=require(_0x513f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x513f('0x5'));var config=require(_0x513f('0x6'));var attributes=require(_0x513f('0x7'));module[_0x513f('0x8')]=function(_0x8d019b,_0x579681){return _0x8d019b[_0x513f('0x9')](_0x513f('0xa'),attributes,{'tableName':_0x513f('0xb'),'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 6273a8a..c1cb9f2 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 _0x09e0=['error','code','UserSmsQueue,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x26a680,_0x2661e0){var _0x5d6490=function(_0x20647c){while(--_0x20647c){_0x26a680['push'](_0x26a680['shift']());}};_0x5d6490(++_0x2661e0);}(_0x09e0,0x16e));var _0x009e=function(_0x158965,_0x117f97){_0x158965=_0x158965-0x0;var _0x3a3e9d=_0x09e0[_0x158965];return _0x3a3e9d;};'use strict';var _=require(_0x009e('0x0'));var util=require(_0x009e('0x1'));var moment=require(_0x009e('0x2'));var BPromise=require('bluebird');var rs=require(_0x009e('0x3'));var fs=require('fs');var Redis=require(_0x009e('0x4'));var db=require(_0x009e('0x5'))['db'];var utils=require(_0x009e('0x6'));var logger=require('../../config/logger')(_0x009e('0x7'));var config=require('../../config/environment');var jayson=require(_0x009e('0x8'));var client=jayson[_0x009e('0x9')][_0x009e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4cfd10,_0x6f73fe,_0x162336){return new BPromise(function(_0x23bed0,_0x60c085){return client[_0x009e('0xb')](_0x4cfd10,_0x162336)[_0x009e('0xc')](function(_0x4dd3b9){logger[_0x009e('0xd')]('UserSmsQueue,\x20%s,\x20%s',_0x6f73fe,_0x009e('0xe'));logger[_0x009e('0xf')](_0x009e('0x10'),_0x6f73fe,_0x009e('0xe'),JSON[_0x009e('0x11')](_0x4dd3b9));if(_0x4dd3b9[_0x009e('0x12')]){if(_0x4dd3b9[_0x009e('0x12')][_0x009e('0x13')]===0x1f4){logger[_0x009e('0x12')](_0x009e('0x14'),_0x6f73fe,_0x4dd3b9['error']['message']);return _0x60c085(_0x4dd3b9['error']['message']);}logger['error'](_0x009e('0x14'),_0x6f73fe,_0x4dd3b9[_0x009e('0x12')][_0x009e('0x15')]);return _0x23bed0(_0x4dd3b9[_0x009e('0x12')][_0x009e('0x15')]);}else{logger[_0x009e('0xd')](_0x009e('0x14'),_0x6f73fe,_0x009e('0xe'));_0x23bed0(_0x4dd3b9[_0x009e('0x16')][_0x009e('0x15')]);}})[_0x009e('0x17')](function(_0x3c100c){logger[_0x009e('0x12')](_0x009e('0x14'),_0x6f73fe,_0x3c100c);_0x60c085(_0x3c100c);});});} \ No newline at end of file +var _0xe0e7=['then','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0x420513,_0x30eae3){var _0x1b44ec=function(_0x644f88){while(--_0x644f88){_0x420513['push'](_0x420513['shift']());}};_0x1b44ec(++_0x30eae3);}(_0xe0e7,0x12c));var _0x7e0e=function(_0x34b245,_0xfe65b4){_0x34b245=_0x34b245-0x0;var _0x3a8984=_0xe0e7[_0x34b245];return _0x3a8984;};'use strict';var _=require(_0x7e0e('0x0'));var util=require(_0x7e0e('0x1'));var moment=require(_0x7e0e('0x2'));var BPromise=require(_0x7e0e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7e0e('0x4'))['db'];var utils=require(_0x7e0e('0x5'));var logger=require(_0x7e0e('0x6'))(_0x7e0e('0x7'));var config=require(_0x7e0e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x7e0e('0x9')][_0x7e0e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x209f4d,_0x2a0b6a,_0x36b5a0){return new BPromise(function(_0x58cfd5,_0x1aa170){return client[_0x7e0e('0xb')](_0x209f4d,_0x36b5a0)[_0x7e0e('0xc')](function(_0x7da2ae){logger[_0x7e0e('0xd')](_0x7e0e('0xe'),_0x2a0b6a,_0x7e0e('0xf'));logger[_0x7e0e('0x10')](_0x7e0e('0x11'),_0x2a0b6a,'request\x20sent',JSON[_0x7e0e('0x12')](_0x7da2ae));if(_0x7da2ae['error']){if(_0x7da2ae['error'][_0x7e0e('0x13')]===0x1f4){logger['error'](_0x7e0e('0xe'),_0x2a0b6a,_0x7da2ae[_0x7e0e('0x14')][_0x7e0e('0x15')]);return _0x1aa170(_0x7da2ae[_0x7e0e('0x14')]['message']);}logger[_0x7e0e('0x14')](_0x7e0e('0xe'),_0x2a0b6a,_0x7da2ae['error'][_0x7e0e('0x15')]);return _0x58cfd5(_0x7da2ae['error'][_0x7e0e('0x15')]);}else{logger[_0x7e0e('0xd')](_0x7e0e('0xe'),_0x2a0b6a,_0x7e0e('0xf'));_0x58cfd5(_0x7da2ae[_0x7e0e('0x16')][_0x7e0e('0x15')]);}})[_0x7e0e('0x17')](function(_0x54676f){logger['error']('UserSmsQueue,\x20%s,\x20%s',_0x2a0b6a,_0x54676f);_0x1aa170(_0x54676f);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index 276d2aa..8b1a7a5 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 _0x4e4f=['exports','sequelize'];(function(_0xf79bae,_0x263b2a){var _0x5d2cb7=function(_0x27c86b){while(--_0x27c86b){_0xf79bae['push'](_0xf79bae['shift']());}};_0x5d2cb7(++_0x263b2a);}(_0x4e4f,0xbd));var _0xf4e4=function(_0x1153cc,_0x38ba57){_0x1153cc=_0x1153cc-0x0;var _0x373613=_0x4e4f[_0x1153cc];return _0x373613;};'use strict';var Sequelize=require(_0xf4e4('0x0'));module[_0xf4e4('0x1')]={'UserId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x32bf=['INTEGER','sequelize','exports'];(function(_0x186ffb,_0x39a322){var _0x529c26=function(_0x3d1496){while(--_0x3d1496){_0x186ffb['push'](_0x186ffb['shift']());}};_0x529c26(++_0x39a322);}(_0x32bf,0x103));var _0xf32b=function(_0x39479f,_0x1b52c7){_0x39479f=_0x39479f-0x0;var _0x50ca97=_0x32bf[_0x39479f];return _0x50ca97;};'use strict';var Sequelize=require(_0xf32b('0x0'));module[_0xf32b('0x1')]={'UserId':{'type':Sequelize[_0xf32b('0x2')]},'VoicePrefixId':{'type':Sequelize[_0xf32b('0x2')]}}; \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.model.js b/server/api/userVoicePrefix/userVoicePrefix.model.js index 545e4cb..b56eb2b 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(_0x27a621,_0x2fe127){var _0x1cd457=function(_0x14dfc6){while(--_0x14dfc6){_0x27a621['push'](_0x27a621['shift']());}};_0x1cd457(++_0x2fe127);}(_0xa9e0,0x123));var _0x0a9e=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xa9e0[_0x297fd3];return _0x2af381;};'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(_0x1ff757,_0x52b941){var _0x570f1a=function(_0x3e64f4){while(--_0x3e64f4){_0x1ff757['push'](_0x1ff757['shift']());}};_0x570f1a(++_0x52b941);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xa9e0[_0x5c351c];return _0x26f3b3;};'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 6b2b8df..21b39c7 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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x213e3a,_0x2adf8a){var _0x1f5253=function(_0x52c19f){while(--_0x52c19f){_0x213e3a['push'](_0x213e3a['shift']());}};_0x1f5253(++_0x2adf8a);}(_0xcb91,0x1a9));var _0x1cb9=function(_0xaf025d,_0x586d7a){_0xaf025d=_0xaf025d-0x0;var _0x1c77cb=_0xcb91[_0xaf025d];return _0x1c77cb;};'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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x24e2b8,_0xd369a4){var _0x5e114f=function(_0x46f731){while(--_0x46f731){_0x24e2b8['push'](_0x24e2b8['shift']());}};_0x5e114f(++_0xd369a4);}(_0xe706,0xa3));var _0x6e70=function(_0x4f1da5,_0x4ced17){_0x4f1da5=_0x4f1da5-0x0;var _0xe972a8=_0xe706[_0x4f1da5];return _0xe972a8;};'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 86924c3..fbaedb9 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 _0xe57c=['exports','sequelize'];(function(_0x21940d,_0x2209da){var _0x22d948=function(_0x53ee6d){while(--_0x53ee6d){_0x21940d['push'](_0x21940d['shift']());}};_0x22d948(++_0x2209da);}(_0xe57c,0xeb));var _0xce57=function(_0x2d7e49,_0xa9c5d2){_0x2d7e49=_0x2d7e49-0x0;var _0x259d84=_0xe57c[_0x2d7e49];return _0x259d84;};'use strict';var Sequelize=require(_0xce57('0x0'));module[_0xce57('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x8254=['sequelize','exports','INTEGER'];(function(_0x5b5c9e,_0x28b6c8){var _0xcd3a2e=function(_0x49c320){while(--_0x49c320){_0x5b5c9e['push'](_0x5b5c9e['shift']());}};_0xcd3a2e(++_0x28b6c8);}(_0x8254,0x15f));var _0x4825=function(_0x178a10,_0x21d099){_0x178a10=_0x178a10-0x0;var _0x2d10a0=_0x8254[_0x178a10];return _0x2d10a0;};'use strict';var Sequelize=require(_0x4825('0x0'));module[_0x4825('0x1')]={'penalty':{'type':Sequelize[_0x4825('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 5041467..8df5cac 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 _0x7d67=['exports','define','UserVoiceQueue','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./userVoiceQueue.attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7d67,0x85));var _0x77d6=function(_0x245fc9,_0x1d3d53){_0x245fc9=_0x245fc9-0x0;var _0x1e3bef=_0x7d67[_0x245fc9];return _0x1e3bef;};'use strict';var _=require(_0x77d6('0x0'));var util=require(_0x77d6('0x1'));var logger=require(_0x77d6('0x2'))(_0x77d6('0x3'));var moment=require(_0x77d6('0x4'));var BPromise=require(_0x77d6('0x5'));var rp=require(_0x77d6('0x6'));var fs=require('fs');var path=require(_0x77d6('0x7'));var rimraf=require(_0x77d6('0x8'));var config=require('../../config/environment');var attributes=require(_0x77d6('0x9'));module[_0x77d6('0xa')]=function(_0x3a0dfb,_0x76c340){return _0x3a0dfb[_0x77d6('0xb')](_0x77d6('0xc'),attributes,{'tableName':'user_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc965=['./userVoiceQueue.attributes','exports','define','UserVoiceQueue','user_has_voice_queues','../../config/logger','moment','path','../../config/environment'];(function(_0x4b7215,_0x152f22){var _0x269d2c=function(_0x1be0e7){while(--_0x1be0e7){_0x4b7215['push'](_0x4b7215['shift']());}};_0x269d2c(++_0x152f22);}(_0xc965,0x176));var _0x5c96=function(_0x366ce0,_0x4c3fad){_0x366ce0=_0x366ce0-0x0;var _0x5ae1c0=_0xc965[_0x366ce0];return _0x5ae1c0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x5c96('0x0'))('api');var moment=require(_0x5c96('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x5c96('0x2'));var rimraf=require('rimraf');var config=require(_0x5c96('0x3'));var attributes=require(_0x5c96('0x4'));module[_0x5c96('0x5')]=function(_0x2e0a72,_0x49840a){return _0x2e0a72[_0x5c96('0x6')](_0x5c96('0x7'),attributes,{'tableName':_0x5c96('0x8'),'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 030671a..e5e0990 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 _0x94c1=['request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserVoiceQueue,\x20%s,\x20%s'];(function(_0x43b5c3,_0xf806f7){var _0x2827be=function(_0x2d90e3){while(--_0x2d90e3){_0x43b5c3['push'](_0x43b5c3['shift']());}};_0x2827be(++_0xf806f7);}(_0x94c1,0x18f));var _0x194c=function(_0x339f08,_0x5892dd){_0x339f08=_0x339f08-0x0;var _0x14b96d=_0x94c1[_0x339f08];return _0x14b96d;};'use strict';var _=require('lodash');var util=require(_0x194c('0x0'));var moment=require(_0x194c('0x1'));var BPromise=require(_0x194c('0x2'));var rs=require(_0x194c('0x3'));var fs=require('fs');var Redis=require(_0x194c('0x4'));var db=require(_0x194c('0x5'))['db'];var utils=require(_0x194c('0x6'));var logger=require(_0x194c('0x7'))(_0x194c('0x8'));var config=require(_0x194c('0x9'));var jayson=require(_0x194c('0xa'));var client=jayson[_0x194c('0xb')][_0x194c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x276a2b,_0x5bf144,_0x38a8ed){return new BPromise(function(_0x3b8f95,_0x54ac14){return client[_0x194c('0xd')](_0x276a2b,_0x38a8ed)[_0x194c('0xe')](function(_0x1e7090){logger[_0x194c('0xf')](_0x194c('0x10'),_0x5bf144,_0x194c('0x11'));logger[_0x194c('0x12')](_0x194c('0x13'),_0x5bf144,_0x194c('0x11'),JSON[_0x194c('0x14')](_0x1e7090));if(_0x1e7090[_0x194c('0x15')]){if(_0x1e7090[_0x194c('0x15')][_0x194c('0x16')]===0x1f4){logger[_0x194c('0x15')](_0x194c('0x10'),_0x5bf144,_0x1e7090[_0x194c('0x15')]['message']);return _0x54ac14(_0x1e7090[_0x194c('0x15')]['message']);}logger[_0x194c('0x15')](_0x194c('0x10'),_0x5bf144,_0x1e7090['error']['message']);return _0x3b8f95(_0x1e7090[_0x194c('0x15')][_0x194c('0x17')]);}else{logger[_0x194c('0xf')](_0x194c('0x10'),_0x5bf144,_0x194c('0x11'));_0x3b8f95(_0x1e7090[_0x194c('0x18')][_0x194c('0x17')]);}})[_0x194c('0x19')](function(_0x4d3aed){logger['error'](_0x194c('0x10'),_0x5bf144,_0x4d3aed);_0x54ac14(_0x4d3aed);});});} \ No newline at end of file +var _0xbb30=['then','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request'];(function(_0x30cd7e,_0x4db10a){var _0x462a02=function(_0x157d81){while(--_0x157d81){_0x30cd7e['push'](_0x30cd7e['shift']());}};_0x462a02(++_0x4db10a);}(_0xbb30,0x14c));var _0x0bb3=function(_0x3efcd5,_0x4a8d63){_0x3efcd5=_0x3efcd5-0x0;var _0x1b3333=_0xbb30[_0x3efcd5];return _0x1b3333;};'use strict';var _=require(_0x0bb3('0x0'));var util=require(_0x0bb3('0x1'));var moment=require(_0x0bb3('0x2'));var BPromise=require(_0x0bb3('0x3'));var rs=require(_0x0bb3('0x4'));var fs=require('fs');var Redis=require(_0x0bb3('0x5'));var db=require(_0x0bb3('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x0bb3('0x7'))(_0x0bb3('0x8'));var config=require('../../config/environment');var jayson=require(_0x0bb3('0x9'));var client=jayson[_0x0bb3('0xa')][_0x0bb3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3f6bb3,_0x534f30,_0x53af6e){return new BPromise(function(_0xca1ebf,_0x173e08){return client[_0x0bb3('0xc')](_0x3f6bb3,_0x53af6e)[_0x0bb3('0xd')](function(_0x4b555c){logger[_0x0bb3('0xe')](_0x0bb3('0xf'),_0x534f30,_0x0bb3('0x10'));logger[_0x0bb3('0x11')](_0x0bb3('0x12'),_0x534f30,_0x0bb3('0x10'),JSON['stringify'](_0x4b555c));if(_0x4b555c['error']){if(_0x4b555c[_0x0bb3('0x13')][_0x0bb3('0x14')]===0x1f4){logger['error'](_0x0bb3('0xf'),_0x534f30,_0x4b555c[_0x0bb3('0x13')][_0x0bb3('0x15')]);return _0x173e08(_0x4b555c[_0x0bb3('0x13')][_0x0bb3('0x15')]);}logger[_0x0bb3('0x13')](_0x0bb3('0xf'),_0x534f30,_0x4b555c[_0x0bb3('0x13')][_0x0bb3('0x15')]);return _0xca1ebf(_0x4b555c[_0x0bb3('0x13')][_0x0bb3('0x15')]);}else{logger['info'](_0x0bb3('0xf'),_0x534f30,_0x0bb3('0x10'));_0xca1ebf(_0x4b555c['result'][_0x0bb3('0x15')]);}})[_0x0bb3('0x16')](function(_0x359d7f){logger[_0x0bb3('0x13')](_0x0bb3('0xf'),_0x534f30,_0x359d7f);_0x173e08(_0x359d7f);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index 6a6e7ad..531071c 100644 --- a/server/api/userVoiceQueueRt/index.js +++ b/server/api/userVoiceQueueRt/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x36ed80,_0x102296){var _0x418c68=function(_0x2a91fc){while(--_0x2a91fc){_0x36ed80['push'](_0x36ed80['shift']());}};_0x418c68(++_0x102296);}(_0x9c44,0x178));var _0x49c4=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x9c44[_0x8c43de];return _0xa6591b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x302633,_0x1db44e){var _0x2c88fb=function(_0x11c9b7){while(--_0x11c9b7){_0x302633['push'](_0x302633['shift']());}};_0x2c88fb(++_0x1db44e);}(_0x70e0,0x17b));var _0x070e=function(_0x420674,_0x4dea8b){_0x420674=_0x420674-0x0;var _0x502f8b=_0x70e0[_0x420674];return _0x502f8b;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index 198985c..95bfb82 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 _0x60d4=['queue_interface','sequelize','exports','INTEGER','Required\x20by\x20Asterisk','STRING'];(function(_0x5b9a93,_0x331ff7){var _0x2737eb=function(_0x7c2428){while(--_0x7c2428){_0x5b9a93['push'](_0x5b9a93['shift']());}};_0x2737eb(++_0x331ff7);}(_0x60d4,0x1ed));var _0x460d=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x60d4[_0x4b369d];return _0x571a98;};'use strict';var Sequelize=require(_0x460d('0x0'));module[_0x460d('0x1')]={'uniqueid':{'type':Sequelize[_0x460d('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x460d('0x3')},'membername':{'type':Sequelize[_0x460d('0x4')],'allowNull':![],'comment':'Required\x20by\x20Asterisk'},'UserId':{'type':Sequelize[_0x460d('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x460d('0x5'),'comment':_0x460d('0x3')},'VoiceQueueId':{'type':Sequelize[_0x460d('0x2')],'allowNull':![]},'interface':{'type':Sequelize[_0x460d('0x4')],'allowNull':![],'unique':_0x460d('0x5'),'comment':_0x460d('0x3')},'penalty':{'type':Sequelize[_0x460d('0x2')](0xb),'defaultValue':0x0,'comment':_0x460d('0x3')},'paused':{'type':Sequelize[_0x460d('0x2')](0xb),'defaultValue':0x0,'comment':_0x460d('0x3')}}; \ No newline at end of file +var _0xe7cc=['exports','INTEGER','STRING','Required\x20by\x20Asterisk','queue_interface','sequelize'];(function(_0x57c136,_0x282611){var _0x4f95b8=function(_0x1e0c0b){while(--_0x1e0c0b){_0x57c136['push'](_0x57c136['shift']());}};_0x4f95b8(++_0x282611);}(_0xe7cc,0x83));var _0xce7c=function(_0x1e7665,_0x111f69){_0x1e7665=_0x1e7665-0x0;var _0x48eba0=_0xe7cc[_0x1e7665];return _0x48eba0;};'use strict';var Sequelize=require(_0xce7c('0x0'));module[_0xce7c('0x1')]={'uniqueid':{'type':Sequelize[_0xce7c('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':'Required\x20by\x20Asterisk'},'membername':{'type':Sequelize[_0xce7c('0x3')],'allowNull':![],'comment':_0xce7c('0x4')},'UserId':{'type':Sequelize[_0xce7c('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize[_0xce7c('0x3')],'allowNull':![],'unique':_0xce7c('0x5'),'comment':'Required\x20by\x20Asterisk'},'VoiceQueueId':{'type':Sequelize[_0xce7c('0x2')],'allowNull':![]},'interface':{'type':Sequelize[_0xce7c('0x3')],'allowNull':![],'unique':_0xce7c('0x5'),'comment':_0xce7c('0x4')},'penalty':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'},'paused':{'type':Sequelize[_0xce7c('0x2')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index a2a1e59..4f7a1e4 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 _0x6644=['hasOwnProperty','UserVoiceQueueRt','setMaxListeners','save','update','remove','emit'];(function(_0x2fcbb7,_0xe05760){var _0x274bea=function(_0x4a9528){while(--_0x4a9528){_0x2fcbb7['push'](_0x2fcbb7['shift']());}};_0x274bea(++_0xe05760);}(_0x6644,0xc5));var _0x4664=function(_0x4bb16e,_0x1a31ff){_0x4bb16e=_0x4bb16e-0x0;var _0xb1c41e=_0x6644[_0x4bb16e];return _0xb1c41e;};'use strict';var EventEmitter=require('events');var UserVoiceQueueRt=require('../../mysqldb')['db'][_0x4664('0x0')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x4664('0x1')](0x0);var events={'afterCreate':_0x4664('0x2'),'afterUpdate':_0x4664('0x3'),'afterDestroy':_0x4664('0x4')};function emitEvent(_0x21a97d){return function(_0x2b812f,_0x510485,_0x25e921){UserVoiceQueueRtEvents['emit'](_0x21a97d+':'+_0x2b812f['id'],_0x2b812f);UserVoiceQueueRtEvents[_0x4664('0x5')](_0x21a97d,_0x2b812f);_0x25e921(null);};}for(var e in events){if(events[_0x4664('0x6')](e)){var event=events[e];UserVoiceQueueRt['hook'](e,emitEvent(event));}}module['exports']=UserVoiceQueueRtEvents; \ No newline at end of file +var _0x3edd=['update','emit','hasOwnProperty','hook','events','../../mysqldb','setMaxListeners','save'];(function(_0x328ac9,_0x2f7225){var _0x2b3a0a=function(_0x759e26){while(--_0x759e26){_0x328ac9['push'](_0x328ac9['shift']());}};_0x2b3a0a(++_0x2f7225);}(_0x3edd,0x8c));var _0xd3ed=function(_0xea88e6,_0x2f4d9f){_0xea88e6=_0xea88e6-0x0;var _0x1a0f99=_0x3edd[_0xea88e6];return _0x1a0f99;};'use strict';var EventEmitter=require(_0xd3ed('0x0'));var UserVoiceQueueRt=require(_0xd3ed('0x1'))['db']['UserVoiceQueueRt'];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xd3ed('0x2')](0x0);var events={'afterCreate':_0xd3ed('0x3'),'afterUpdate':_0xd3ed('0x4'),'afterDestroy':'remove'};function emitEvent(_0x51c378){return function(_0x2631ec,_0x24d1fa,_0x526318){UserVoiceQueueRtEvents['emit'](_0x51c378+':'+_0x2631ec['id'],_0x2631ec);UserVoiceQueueRtEvents[_0xd3ed('0x5')](_0x51c378,_0x2631ec);_0x526318(null);};}for(var e in events){if(events[_0xd3ed('0x6')](e)){var event=events[e];UserVoiceQueueRt[_0xd3ed('0x7')](e,emitEvent(event));}}module['exports']=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index 26fec59..d07a57b 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 _0x4a53=['util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./userVoiceQueueRt.attributes','exports','UserVoiceQueueRt','user_has_voice_queues_rt','lodash'];(function(_0x21b36c,_0x543483){var _0x236627=function(_0x174f99){while(--_0x174f99){_0x21b36c['push'](_0x21b36c['shift']());}};_0x236627(++_0x543483);}(_0x4a53,0x113));var _0x34a5=function(_0x53e4be,_0x1926b0){_0x53e4be=_0x53e4be-0x0;var _0x4f972c=_0x4a53[_0x53e4be];return _0x4f972c;};'use strict';var _=require(_0x34a5('0x0'));var util=require(_0x34a5('0x1'));var logger=require(_0x34a5('0x2'))('api');var moment=require(_0x34a5('0x3'));var BPromise=require(_0x34a5('0x4'));var rp=require(_0x34a5('0x5'));var fs=require('fs');var path=require(_0x34a5('0x6'));var rimraf=require('rimraf');var config=require(_0x34a5('0x7'));var attributes=require(_0x34a5('0x8'));module[_0x34a5('0x9')]=function(_0x20edaf,_0x382f6a){return _0x20edaf['define'](_0x34a5('0xa'),attributes,{'tableName':_0x34a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xda22=['./userVoiceQueueRt.attributes','UserVoiceQueueRt','lodash','util','path','rimraf','../../config/environment'];(function(_0xc58e33,_0x113136){var _0x4afd5b=function(_0x468025){while(--_0x468025){_0xc58e33['push'](_0xc58e33['shift']());}};_0x4afd5b(++_0x113136);}(_0xda22,0x6b));var _0x2da2=function(_0x5abb5a,_0x1198e2){_0x5abb5a=_0x5abb5a-0x0;var _0x4183e8=_0xda22[_0x5abb5a];return _0x4183e8;};'use strict';var _=require(_0x2da2('0x0'));var util=require(_0x2da2('0x1'));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(_0x2da2('0x2'));var rimraf=require(_0x2da2('0x3'));var config=require(_0x2da2('0x4'));var attributes=require(_0x2da2('0x5'));module['exports']=function(_0x53befa,_0x45b819){return _0x53befa['define'](_0x2da2('0x6'),attributes,{'tableName':'user_has_voice_queues_rt','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js index 6604fba..c328844 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 _0xf26d=['request\x20sent','error','code','message','result','catch','UserVoiceQueueRt','findAll','options','raw','where','sequelize','COUNT','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','GetVoiceQueueRtPauses','debug','stringify','lodash','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','localhost','socket.io-emitter','redis','register','then','info','UserVoiceQueueRt,\x20%s,\x20%s'];(function(_0x49739f,_0x2c5eef){var _0x248028=function(_0x4f9888){while(--_0x4f9888){_0x49739f['push'](_0x49739f['shift']());}};_0x248028(++_0x2c5eef);}(_0xf26d,0xbc));var _0xdf26=function(_0x5f1f55,_0x4bc97a){_0x5f1f55=_0x5f1f55-0x0;var _0x34e8a2=_0xf26d[_0x5f1f55];return _0x34e8a2;};'use strict';var _=require(_0xdf26('0x0'));var util=require('util');var moment=require(_0xdf26('0x1'));var BPromise=require(_0xdf26('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdf26('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xdf26('0x4'))(_0xdf26('0x5'));var config=require(_0xdf26('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xdf26('0x7')][_0xdf26('0x8')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0xdf26('0x9'),'port':0x18eb});var socket=require(_0xdf26('0xa'))(new Redis(config[_0xdf26('0xb')]));require('./userVoiceQueueRt.socket')[_0xdf26('0xc')](socket);function respondWithRpcPromise(_0x4caef0,_0x222b9f,_0x303fc1){return new BPromise(function(_0x3205d8,_0x537310){return client['request'](_0x4caef0,_0x303fc1)[_0xdf26('0xd')](function(_0x51c07d){logger[_0xdf26('0xe')](_0xdf26('0xf'),_0x222b9f,_0xdf26('0x10'));logger['debug']('UserVoiceQueueRt,\x20%s,\x20%s,\x20%s',_0x222b9f,_0xdf26('0x10'),JSON['stringify'](_0x51c07d));if(_0x51c07d[_0xdf26('0x11')]){if(_0x51c07d[_0xdf26('0x11')][_0xdf26('0x12')]===0x1f4){logger[_0xdf26('0x11')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x222b9f,_0x51c07d[_0xdf26('0x11')][_0xdf26('0x13')]);return _0x537310(_0x51c07d[_0xdf26('0x11')][_0xdf26('0x13')]);}logger[_0xdf26('0x11')](_0xdf26('0xf'),_0x222b9f,_0x51c07d[_0xdf26('0x11')][_0xdf26('0x13')]);return _0x3205d8(_0x51c07d[_0xdf26('0x11')]['message']);}else{logger[_0xdf26('0xe')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x222b9f,_0xdf26('0x10'));_0x3205d8(_0x51c07d[_0xdf26('0x14')]['message']);}})[_0xdf26('0x15')](function(_0xa19399){logger[_0xdf26('0x11')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x222b9f,_0xa19399);_0x537310(_0xa19399);});});}exports['GetVoiceQueueRtPauses']=function(_0x1339d6){var _0x9e7c82=this;return new Promise(function(_0x501b3a,_0xf3cf71){return db[_0xdf26('0x16')][_0xdf26('0x17')]({'raw':_0x1339d6['options']?_0x1339d6[_0xdf26('0x18')][_0xdf26('0x19')]===undefined?!![]:![]:!![],'where':_0x1339d6[_0xdf26('0x18')]?_0x1339d6['options'][_0xdf26('0x1a')]||null:null,'attributes':[[db[_0xdf26('0x1b')]['fn'](_0xdf26('0x1c'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0xdf26('0x1d')))),_0xdf26('0x1e')]]})[_0xdf26('0xd')](function(_0xfa0b64){logger[_0xdf26('0xe')](_0xdf26('0x1f'),_0x1339d6);logger[_0xdf26('0x20')](_0xdf26('0x1f'),_0x1339d6,JSON[_0xdf26('0x21')](_0xfa0b64));_0x501b3a(_0xfa0b64);})[_0xdf26('0x15')](function(_0x53bce1){logger[_0xdf26('0x11')](_0xdf26('0x1f'),_0x53bce1[_0xdf26('0x13')],_0x1339d6);_0xf3cf71(_0x9e7c82[_0xdf26('0x11')](0x1f4,_0x53bce1[_0xdf26('0x13')]));});});}; \ No newline at end of file +var _0x3f04=['COUNT','sequelize','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','info','catch','lodash','util','../../mysqldb','../../config/logger','rpc','jayson/promise','redis','localhost','socket.io-emitter','./userVoiceQueueRt.socket','request','then','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','raw','where'];(function(_0x1ac7f5,_0x1e9348){var _0x141dde=function(_0x4cef68){while(--_0x4cef68){_0x1ac7f5['push'](_0x1ac7f5['shift']());}};_0x141dde(++_0x1e9348);}(_0x3f04,0x6d));var _0x43f0=function(_0x2e02f5,_0x2cb87e){_0x2e02f5=_0x2e02f5-0x0;var _0x5091f7=_0x3f04[_0x2e02f5];return _0x5091f7;};'use strict';var _=require(_0x43f0('0x0'));var util=require(_0x43f0('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x43f0('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x43f0('0x3'))(_0x43f0('0x4'));var config=require('../../config/environment');var jayson=require(_0x43f0('0x5'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_['defaults'](config[_0x43f0('0x6')],{'host':_0x43f0('0x7'),'port':0x18eb});var socket=require(_0x43f0('0x8'))(new Redis(config['redis']));require(_0x43f0('0x9'))['register'](socket);function respondWithRpcPromise(_0x47af6c,_0x399f87,_0x2e1965){return new BPromise(function(_0x37499a,_0x14efd0){return client[_0x43f0('0xa')](_0x47af6c,_0x2e1965)[_0x43f0('0xb')](function(_0x376e77){logger['info'](_0x43f0('0xc'),_0x399f87,_0x43f0('0xd'));logger[_0x43f0('0xe')](_0x43f0('0xf'),_0x399f87,_0x43f0('0xd'),JSON[_0x43f0('0x10')](_0x376e77));if(_0x376e77[_0x43f0('0x11')]){if(_0x376e77['error'][_0x43f0('0x12')]===0x1f4){logger[_0x43f0('0x11')](_0x43f0('0xc'),_0x399f87,_0x376e77[_0x43f0('0x11')][_0x43f0('0x13')]);return _0x14efd0(_0x376e77[_0x43f0('0x11')][_0x43f0('0x13')]);}logger[_0x43f0('0x11')](_0x43f0('0xc'),_0x399f87,_0x376e77[_0x43f0('0x11')][_0x43f0('0x13')]);return _0x37499a(_0x376e77['error'][_0x43f0('0x13')]);}else{logger['info'](_0x43f0('0xc'),_0x399f87,_0x43f0('0xd'));_0x37499a(_0x376e77[_0x43f0('0x14')]['message']);}})['catch'](function(_0x49c522){logger[_0x43f0('0x11')](_0x43f0('0xc'),_0x399f87,_0x49c522);_0x14efd0(_0x49c522);});});}exports[_0x43f0('0x15')]=function(_0x509f24){var _0x2564bf=this;return new Promise(function(_0x297255,_0xc96562){return db[_0x43f0('0x16')][_0x43f0('0x17')]({'raw':_0x509f24[_0x43f0('0x18')]?_0x509f24[_0x43f0('0x18')][_0x43f0('0x19')]===undefined?!![]:![]:!![],'where':_0x509f24[_0x43f0('0x18')]?_0x509f24['options'][_0x43f0('0x1a')]||null:null,'attributes':[[db['sequelize']['fn'](_0x43f0('0x1b'),db[_0x43f0('0x1c')]['fn']('IF',db['sequelize'][_0x43f0('0x1d')](_0x43f0('0x1e')))),_0x43f0('0x1f')]]})[_0x43f0('0xb')](function(_0x5752cb){logger[_0x43f0('0x20')](_0x43f0('0x15'),_0x509f24);logger[_0x43f0('0xe')](_0x43f0('0x15'),_0x509f24,JSON[_0x43f0('0x10')](_0x5752cb));_0x297255(_0x5752cb);})[_0x43f0('0x21')](function(_0x961a7f){logger[_0x43f0('0x11')](_0x43f0('0x15'),_0x961a7f[_0x43f0('0x13')],_0x509f24);_0xc96562(_0x2564bf[_0x43f0('0x11')](0x1f4,_0x961a7f[_0x43f0('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index 1168dcd..92a6934 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 _0xaf11=['update','emit','removeListener','register','length','userVoiceQueueRt:','./userVoiceQueueRt.events','save','remove'];(function(_0x45adaf,_0x21c3c1){var _0x15d189=function(_0x48dc43){while(--_0x48dc43){_0x45adaf['push'](_0x45adaf['shift']());}};_0x15d189(++_0x21c3c1);}(_0xaf11,0x12f));var _0x1af1=function(_0x2b9a42,_0x1b711a){_0x2b9a42=_0x2b9a42-0x0;var _0x261fe3=_0xaf11[_0x2b9a42];return _0x261fe3;};'use strict';var UserVoiceQueueRtEvents=require(_0x1af1('0x0'));var events=[_0x1af1('0x1'),_0x1af1('0x2'),_0x1af1('0x3')];function createListener(_0x532050,_0x15fe21){return function(_0x2c89fa){_0x15fe21[_0x1af1('0x4')](_0x532050,_0x2c89fa);};}function removeListener(_0x53af48,_0xb0ace){return function(){UserVoiceQueueRtEvents[_0x1af1('0x5')](_0x53af48,_0xb0ace);};}exports[_0x1af1('0x6')]=function(_0x4d3153){for(var _0x36f1a0=0x0,_0x5dbe9d=events[_0x1af1('0x7')];_0x36f1a0<_0x5dbe9d;_0x36f1a0++){var _0x26d917=events[_0x36f1a0];var _0x48b286=createListener(_0x1af1('0x8')+_0x26d917,_0x4d3153);UserVoiceQueueRtEvents['on'](_0x26d917,_0x48b286);}}; \ No newline at end of file +var _0x6299=['register','remove','update','emit','removeListener'];(function(_0x4e08ee,_0x241beb){var _0x516c31=function(_0x385a9d){while(--_0x385a9d){_0x4e08ee['push'](_0x4e08ee['shift']());}};_0x516c31(++_0x241beb);}(_0x6299,0x169));var _0x9629=function(_0x76a24f,_0x2d3ffd){_0x76a24f=_0x76a24f-0x0;var _0x12712b=_0x6299[_0x76a24f];return _0x12712b;};'use strict';var UserVoiceQueueRtEvents=require('./userVoiceQueueRt.events');var events=['save',_0x9629('0x0'),_0x9629('0x1')];function createListener(_0x3cf1e1,_0x35868a){return function(_0x3c3ab2){_0x35868a[_0x9629('0x2')](_0x3cf1e1,_0x3c3ab2);};}function removeListener(_0x55d4ce,_0x327ee9){return function(){UserVoiceQueueRtEvents[_0x9629('0x3')](_0x55d4ce,_0x327ee9);};}exports[_0x9629('0x4')]=function(_0x1edc13){for(var _0x1206bf=0x0,_0x5d5981=events['length'];_0x1206bf<_0x5d5981;_0x1206bf++){var _0x2c5ca5=events[_0x1206bf];var _0x1754e6=createListener('userVoiceQueueRt:'+_0x2c5ca5,_0x1edc13);UserVoiceQueueRtEvents['on'](_0x2c5ca5,_0x1754e6);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index f04f208..1f2c058 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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x3567c8,_0x10f0fd){var _0x2e1f59=function(_0x5b5117){while(--_0x5b5117){_0x3567c8['push'](_0x3567c8['shift']());}};_0x2e1f59(++_0x10f0fd);}(_0xe706,0xa3));var _0x6e70=function(_0x581249,_0x483f03){_0x581249=_0x581249-0x0;var _0x284bae=_0xe706[_0x581249];return _0x284bae;};'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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x4884e4,_0x4ba6fd){var _0x10ef92=function(_0x29c4e5){while(--_0x29c4e5){_0x4884e4['push'](_0x4884e4['shift']());}};_0x10ef92(++_0x4ba6fd);}(_0x70e0,0x17b));var _0x070e=function(_0x5d34d5,_0x4f1b38){_0x5d34d5=_0x5d34d5-0x0;var _0xa0ac47=_0x70e0[_0x5d34d5];return _0xa0ac47;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index 526408a..38b0f3e 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 _0x54e9=['INTEGER'];(function(_0x5e6850,_0x3f0815){var _0x3fce80=function(_0x3fa240){while(--_0x3fa240){_0x5e6850['push'](_0x5e6850['shift']());}};_0x3fce80(++_0x3f0815);}(_0x54e9,0xbd));var _0x954e=function(_0x1f83b9,_0x88e2e){_0x1f83b9=_0x1f83b9-0x0;var _0x9eb0c7=_0x54e9[_0x1f83b9];return _0x9eb0c7;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0x954e('0x0')],'defaultValue':0x0}}; \ No newline at end of file +var _0xb41e=['sequelize','INTEGER'];(function(_0x14f5bb,_0x49669d){var _0x5865dc=function(_0x4b1cec){while(--_0x4b1cec){_0x14f5bb['push'](_0x14f5bb['shift']());}};_0x5865dc(++_0x49669d);}(_0xb41e,0x1f0));var _0xeb41=function(_0x267692,_0x229aaa){_0x267692=_0x267692-0x0;var _0x209905=_0xb41e[_0x267692];return _0x209905;};'use strict';var Sequelize=require(_0xeb41('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xeb41('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 458e14b..3eca2ed 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 _0x9bf2=['define','user_has_whatsapp_queues','lodash','util','../../config/logger','api','../../config/environment'];(function(_0x4f8e06,_0x3226b1){var _0x327dad=function(_0x4dced3){while(--_0x4dced3){_0x4f8e06['push'](_0x4f8e06['shift']());}};_0x327dad(++_0x3226b1);}(_0x9bf2,0x79));var _0x29bf=function(_0x24f81f,_0xc83129){_0x24f81f=_0x24f81f-0x0;var _0xf8f549=_0x9bf2[_0x24f81f];return _0xf8f549;};'use strict';var _=require(_0x29bf('0x0'));var util=require(_0x29bf('0x1'));var logger=require(_0x29bf('0x2'))(_0x29bf('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x29bf('0x4'));var attributes=require('./userWhatsappQueue.attributes');module['exports']=function(_0x587400,_0x2f5d36){return _0x587400[_0x29bf('0x5')]('UserWhatsappQueue',attributes,{'tableName':_0x29bf('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe396=['lodash','util','moment','bluebird','path','rimraf','./userWhatsappQueue.attributes','exports','define','UserWhatsappQueue','user_has_whatsapp_queues'];(function(_0x19905b,_0x8d7e99){var _0x44e679=function(_0x5b6c01){while(--_0x5b6c01){_0x19905b['push'](_0x19905b['shift']());}};_0x44e679(++_0x8d7e99);}(_0xe396,0xbb));var _0x6e39=function(_0x17534f,_0x33e0cb){_0x17534f=_0x17534f-0x0;var _0xb538fa=_0xe396[_0x17534f];return _0xb538fa;};'use strict';var _=require(_0x6e39('0x0'));var util=require(_0x6e39('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x6e39('0x2'));var BPromise=require(_0x6e39('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6e39('0x4'));var rimraf=require(_0x6e39('0x5'));var config=require('../../config/environment');var attributes=require(_0x6e39('0x6'));module[_0x6e39('0x7')]=function(_0x2263e3,_0x327599){return _0x2263e3[_0x6e39('0x8')](_0x6e39('0x9'),attributes,{'tableName':_0x6e39('0xa'),'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 6ca21a9..7720540 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 _0x68b5=['info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then'];(function(_0xa30766,_0x6f613e){var _0x24e780=function(_0x3d58fb){while(--_0x3d58fb){_0xa30766['push'](_0xa30766['shift']());}};_0x24e780(++_0x6f613e);}(_0x68b5,0xdb));var _0x568b=function(_0x47e970,_0x36a0fa){_0x47e970=_0x47e970-0x0;var _0x44e30b=_0x68b5[_0x47e970];return _0x44e30b;};'use strict';var _=require(_0x568b('0x0'));var util=require(_0x568b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x568b('0x2'));var fs=require('fs');var Redis=require(_0x568b('0x3'));var db=require(_0x568b('0x4'))['db'];var utils=require(_0x568b('0x5'));var logger=require(_0x568b('0x6'))(_0x568b('0x7'));var config=require(_0x568b('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x568b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4c4f21,_0x15644b,_0x117f55){return new BPromise(function(_0x4a1984,_0x370ce1){return client[_0x568b('0xa')](_0x4c4f21,_0x117f55)[_0x568b('0xb')](function(_0xdcb18a){logger[_0x568b('0xc')](_0x568b('0xd'),_0x15644b,_0x568b('0xe'));logger['debug']('UserWhatsappQueue,\x20%s,\x20%s,\x20%s',_0x15644b,_0x568b('0xe'),JSON[_0x568b('0xf')](_0xdcb18a));if(_0xdcb18a['error']){if(_0xdcb18a[_0x568b('0x10')][_0x568b('0x11')]===0x1f4){logger[_0x568b('0x10')](_0x568b('0xd'),_0x15644b,_0xdcb18a[_0x568b('0x10')][_0x568b('0x12')]);return _0x370ce1(_0xdcb18a[_0x568b('0x10')][_0x568b('0x12')]);}logger['error'](_0x568b('0xd'),_0x15644b,_0xdcb18a[_0x568b('0x10')][_0x568b('0x12')]);return _0x4a1984(_0xdcb18a['error'][_0x568b('0x12')]);}else{logger[_0x568b('0xc')](_0x568b('0xd'),_0x15644b,_0x568b('0xe'));_0x4a1984(_0xdcb18a[_0x568b('0x13')][_0x568b('0x12')]);}})[_0x568b('0x14')](function(_0x4b826b){logger[_0x568b('0x10')](_0x568b('0xd'),_0x15644b,_0x4b826b);_0x370ce1(_0x4b826b);});});} \ No newline at end of file +var _0xabd3=['../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','request\x20sent','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserWhatsappQueue,\x20%s,\x20%s','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x1c2aeb,_0x48433c){var _0x783379=function(_0x3e8820){while(--_0x3e8820){_0x1c2aeb['push'](_0x1c2aeb['shift']());}};_0x783379(++_0x48433c);}(_0xabd3,0x19b));var _0x3abd=function(_0x136a0d,_0x476fe2){_0x136a0d=_0x136a0d-0x0;var _0x212ea5=_0xabd3[_0x136a0d];return _0x212ea5;};'use strict';var _=require(_0x3abd('0x0'));var util=require(_0x3abd('0x1'));var moment=require(_0x3abd('0x2'));var BPromise=require('bluebird');var rs=require(_0x3abd('0x3'));var fs=require('fs');var Redis=require(_0x3abd('0x4'));var db=require(_0x3abd('0x5'))['db'];var utils=require(_0x3abd('0x6'));var logger=require(_0x3abd('0x7'))(_0x3abd('0x8'));var config=require(_0x3abd('0x9'));var jayson=require(_0x3abd('0xa'));var client=jayson['client'][_0x3abd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x413e7a,_0x3bc9d1,_0x1d0f15){return new BPromise(function(_0xcf303d,_0x2e9f94){return client['request'](_0x413e7a,_0x1d0f15)[_0x3abd('0xc')](function(_0x4e1e5d){logger[_0x3abd('0xd')]('UserWhatsappQueue,\x20%s,\x20%s',_0x3bc9d1,_0x3abd('0xe'));logger['debug'](_0x3abd('0xf'),_0x3bc9d1,_0x3abd('0xe'),JSON[_0x3abd('0x10')](_0x4e1e5d));if(_0x4e1e5d[_0x3abd('0x11')]){if(_0x4e1e5d[_0x3abd('0x11')][_0x3abd('0x12')]===0x1f4){logger['error'](_0x3abd('0x13'),_0x3bc9d1,_0x4e1e5d[_0x3abd('0x11')][_0x3abd('0x14')]);return _0x2e9f94(_0x4e1e5d[_0x3abd('0x11')][_0x3abd('0x14')]);}logger[_0x3abd('0x11')]('UserWhatsappQueue,\x20%s,\x20%s',_0x3bc9d1,_0x4e1e5d[_0x3abd('0x11')][_0x3abd('0x14')]);return _0xcf303d(_0x4e1e5d[_0x3abd('0x11')][_0x3abd('0x14')]);}else{logger[_0x3abd('0xd')](_0x3abd('0x13'),_0x3bc9d1,_0x3abd('0xe'));_0xcf303d(_0x4e1e5d[_0x3abd('0x15')]['message']);}})['catch'](function(_0x4c5de7){logger[_0x3abd('0x11')](_0x3abd('0x13'),_0x3bc9d1,_0x4c5de7);_0x2e9f94(_0x4c5de7);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index 7d9982d..6c229df 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 _0x291c=['/:id','show','post','create','put','update','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./variable.controller','isAuthenticated'];(function(_0xe17162,_0x102d4e){var _0x33f8e2=function(_0x433c8a){while(--_0x433c8a){_0xe17162['push'](_0xe17162['shift']());}};_0x33f8e2(++_0x102d4e);}(_0x291c,0x137));var _0xc291=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x291c[_0x2c91e9];return _0x13f0ff;};'use strict';var multer=require(_0xc291('0x0'));var util=require(_0xc291('0x1'));var path=require(_0xc291('0x2'));var timeout=require(_0xc291('0x3'));var express=require(_0xc291('0x4'));var router=express[_0xc291('0x5')]();var fs_extra=require(_0xc291('0x6'));var auth=require(_0xc291('0x7'));var interaction=require(_0xc291('0x8'));var config=require(_0xc291('0x9'));var controller=require(_0xc291('0xa'));router['get']('/',auth[_0xc291('0xb')](),controller['index']);router['get'](_0xc291('0xc'),auth[_0xc291('0xb')](),controller[_0xc291('0xd')]);router[_0xc291('0xe')]('/',auth['isAuthenticated'](),controller[_0xc291('0xf')]);router[_0xc291('0x10')](_0xc291('0xc'),auth[_0xc291('0xb')](),controller[_0xc291('0x11')]);router[_0xc291('0x12')](_0xc291('0xc'),auth[_0xc291('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x9cff=['index','/:id','show','post','put','update','destroy','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./variable.controller','get','isAuthenticated'];(function(_0x867b0a,_0x587ccf){var _0x137438=function(_0xbeafa6){while(--_0xbeafa6){_0x867b0a['push'](_0x867b0a['shift']());}};_0x137438(++_0x587ccf);}(_0x9cff,0x1b0));var _0xf9cf=function(_0x4f45c0,_0xce273){_0x4f45c0=_0x4f45c0-0x0;var _0x584a1b=_0x9cff[_0x4f45c0];return _0x584a1b;};'use strict';var multer=require('multer');var util=require(_0xf9cf('0x0'));var path=require(_0xf9cf('0x1'));var timeout=require(_0xf9cf('0x2'));var express=require('express');var router=express[_0xf9cf('0x3')]();var fs_extra=require(_0xf9cf('0x4'));var auth=require(_0xf9cf('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xf9cf('0x6'));var controller=require(_0xf9cf('0x7'));router[_0xf9cf('0x8')]('/',auth[_0xf9cf('0x9')](),controller[_0xf9cf('0xa')]);router[_0xf9cf('0x8')](_0xf9cf('0xb'),auth[_0xf9cf('0x9')](),controller[_0xf9cf('0xc')]);router[_0xf9cf('0xd')]('/',auth[_0xf9cf('0x9')](),controller['create']);router[_0xf9cf('0xe')](_0xf9cf('0xb'),auth['isAuthenticated'](),controller[_0xf9cf('0xf')]);router['delete']('/:id',auth[_0xf9cf('0x9')](),controller[_0xf9cf('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index d89e27c..d9ab36d 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 _0x2e01=['STRING','name','exports'];(function(_0x227b3e,_0x380b09){var _0x69b536=function(_0x2e1cc6){while(--_0x2e1cc6){_0x227b3e['push'](_0x227b3e['shift']());}};_0x69b536(++_0x380b09);}(_0x2e01,0x1d0));var _0x12e0=function(_0x381543,_0x18bbd0){_0x381543=_0x381543-0x0;var _0x2778a6=_0x2e01[_0x381543];return _0x2778a6;};'use strict';var Sequelize=require('sequelize');module[_0x12e0('0x0')]={'name':{'type':Sequelize[_0x12e0('0x1')],'unique':_0x12e0('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x12e0('0x1')]}}; \ No newline at end of file +var _0x0dec=['sequelize','exports','STRING','name'];(function(_0x21806f,_0x1ac9c0){var _0x8654d=function(_0x1fd7f2){while(--_0x1fd7f2){_0x21806f['push'](_0x21806f['shift']());}};_0x8654d(++_0x1ac9c0);}(_0x0dec,0x11c));var _0xc0de=function(_0x981537,_0x5c9405){_0x981537=_0x981537-0x0;var _0x2c71d4=_0x0dec[_0x981537];return _0x2c71d4;};'use strict';var Sequelize=require(_0xc0de('0x0'));module[_0xc0de('0x1')]={'name':{'type':Sequelize[_0xc0de('0x2')],'unique':_0xc0de('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index 16c9676..c0a6d12 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 _0xb772=['fields','attributes','nolimit','sort','where','filter','merge','VIRTUAL','options','Variable','include','rows','catch','show','params','includeAll','find','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','undefined','limit','offset','count','Content-Range','json','reject','save','then','destroy','Variables','UserProfileResource','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection'];(function(_0x15c851,_0x16b2d5){var _0x53fabe=function(_0xa878d0){while(--_0xa878d0){_0x15c851['push'](_0x15c851['shift']());}};_0x53fabe(++_0x16b2d5);}(_0xb772,0x18b));var _0x2b77=function(_0x21e5d8,_0x100d94){_0x21e5d8=_0x21e5d8-0x0;var _0x523ab2=_0xb772[_0x21e5d8];return _0x523ab2;};'use strict';var emlformat=require(_0x2b77('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x2b77('0x1'));var rp=require(_0x2b77('0x2'));var moment=require(_0x2b77('0x3'));var BPromise=require(_0x2b77('0x4'));var Mustache=require('mustache');var util=require(_0x2b77('0x5'));var path=require(_0x2b77('0x6'));var sox=require(_0x2b77('0x7'));var csv=require(_0x2b77('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2b77('0x9'));var _=require(_0x2b77('0xa'));var squel=require(_0x2b77('0xb'));var crypto=require(_0x2b77('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x2b77('0xd'));var toCsv=require(_0x2b77('0x8'));var querystring=require(_0x2b77('0xe'));var Papa=require('papaparse');var Redis=require(_0x2b77('0xf'));var authService=require(_0x2b77('0x10'));var qs=require(_0x2b77('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x2b77('0x12'))('api');var utils=require(_0x2b77('0x13'));var config=require(_0x2b77('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x2b77('0x15'))['db'];function respondWithStatusCode(_0x32aecd,_0x98d13e){_0x98d13e=_0x98d13e||0xcc;return function(_0x18b411){if(_0x18b411){return _0x32aecd[_0x2b77('0x16')](_0x98d13e);}return _0x32aecd[_0x2b77('0x17')](_0x98d13e)['end']();};}function respondWithResult(_0x328162,_0x254b67){_0x254b67=_0x254b67||0xc8;return function(_0x432f91){if(_0x432f91){return _0x328162[_0x2b77('0x17')](_0x254b67)['json'](_0x432f91);}};}function respondWithFilteredResult(_0x563c7e,_0x4767dc){return function(_0x35f9db){if(_0x35f9db){var _0x1f8db5=typeof _0x4767dc['offset']===_0x2b77('0x18')&&typeof _0x4767dc[_0x2b77('0x19')]==='undefined';var _0x1fbdc6=_0x35f9db['count'];var _0x4c2eeb=_0x1f8db5?0x0:_0x4767dc[_0x2b77('0x1a')];var _0x36ffac=_0x1f8db5?_0x35f9db[_0x2b77('0x1b')]:_0x4767dc[_0x2b77('0x1a')]+_0x4767dc[_0x2b77('0x19')];var _0x226155;if(_0x36ffac>=_0x1fbdc6){_0x36ffac=_0x1fbdc6;_0x226155=0xc8;}else{_0x226155=0xce;}_0x563c7e['status'](_0x226155);return _0x563c7e['set'](_0x2b77('0x1c'),_0x4c2eeb+'-'+_0x36ffac+'/'+_0x1fbdc6)[_0x2b77('0x1d')](_0x35f9db);}return null;};}function patchUpdates(_0x37c802){return function(_0x314c02){try{jsonpatch['apply'](_0x314c02,_0x37c802,!![]);}catch(_0x3df883){return BPromise[_0x2b77('0x1e')](_0x3df883);}return _0x314c02[_0x2b77('0x1f')]();};}function saveUpdates(_0x5e53ed,_0x3ca6b3){return function(_0x470058){if(_0x470058){return _0x470058['update'](_0x5e53ed)[_0x2b77('0x20')](function(_0xcc0161){return _0xcc0161;});}return null;};}function removeEntity(_0x255d0f,_0x3de6b6){return function(_0x2712ee){if(_0x2712ee){return _0x2712ee[_0x2b77('0x21')]()[_0x2b77('0x20')](function(){var _0x294809=_0x2712ee['get']({'plain':!![]});var _0x3e36ba=_0x2b77('0x22');return db[_0x2b77('0x23')][_0x2b77('0x21')]({'where':{'type':_0x3e36ba,'resourceId':_0x294809['id']}})[_0x2b77('0x20')](function(){return _0x2712ee;});})['then'](function(){_0x255d0f[_0x2b77('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x106dc6,_0x47fc41){return function(_0x57bb40){if(!_0x57bb40){_0x106dc6[_0x2b77('0x16')](0x194);}return _0x57bb40;};}function handleError(_0x4de100,_0x3f2d32){_0x3f2d32=_0x3f2d32||0x1f4;return function(_0x4a41f4){logger['error'](_0x4a41f4[_0x2b77('0x24')]);if(_0x4a41f4[_0x2b77('0x25')]){delete _0x4a41f4[_0x2b77('0x25')];}_0x4de100[_0x2b77('0x17')](_0x3f2d32)[_0x2b77('0x26')](_0x4a41f4);};}exports[_0x2b77('0x27')]=function(_0x3a6ac9,_0x1056e5){var _0x4ab909={},_0x3071a1={},_0x20f14e={'count':0x0,'rows':[]};var _0x15da00=_[_0x2b77('0x28')](db['Variable'][_0x2b77('0x29')],function(_0x27921b){return{'name':_0x27921b[_0x2b77('0x2a')],'type':_0x27921b[_0x2b77('0x2b')]['key']};});_0x3071a1[_0x2b77('0x2c')]=_['map'](_0x15da00,'name');_0x3071a1[_0x2b77('0x2d')]=_[_0x2b77('0x2e')](_0x3a6ac9[_0x2b77('0x2d')]);_0x3071a1[_0x2b77('0x2f')]=_[_0x2b77('0x30')](_0x3071a1[_0x2b77('0x2c')],_0x3071a1[_0x2b77('0x2d')]);_0x4ab909['attributes']=_[_0x2b77('0x30')](_0x3071a1[_0x2b77('0x2c')],qs[_0x2b77('0x31')](_0x3a6ac9[_0x2b77('0x2d')][_0x2b77('0x31')]));_0x4ab909['attributes']=_0x4ab909[_0x2b77('0x32')]['length']?_0x4ab909[_0x2b77('0x32')]:_0x3071a1['model'];if(!_0x3a6ac9[_0x2b77('0x2d')]['hasOwnProperty'](_0x2b77('0x33'))){_0x4ab909['limit']=qs[_0x2b77('0x19')](_0x3a6ac9[_0x2b77('0x2d')][_0x2b77('0x19')]);_0x4ab909[_0x2b77('0x1a')]=qs['offset'](_0x3a6ac9[_0x2b77('0x2d')][_0x2b77('0x1a')]);}_0x4ab909['order']=qs[_0x2b77('0x34')](_0x3a6ac9['query'][_0x2b77('0x34')]);_0x4ab909[_0x2b77('0x35')]=qs[_0x2b77('0x2f')](_['pick'](_0x3a6ac9[_0x2b77('0x2d')],_0x3071a1[_0x2b77('0x2f')]),_0x15da00);if(_0x3a6ac9[_0x2b77('0x2d')][_0x2b77('0x36')]){_0x4ab909[_0x2b77('0x35')]=_[_0x2b77('0x37')](_0x4ab909[_0x2b77('0x35')],{'$or':_[_0x2b77('0x28')](_0x15da00,function(_0x283b18){if(_0x283b18[_0x2b77('0x2b')]!==_0x2b77('0x38')){var _0x40ca57={};_0x40ca57[_0x283b18[_0x2b77('0x25')]]={'$like':'%'+_0x3a6ac9[_0x2b77('0x2d')][_0x2b77('0x36')]+'%'};return _0x40ca57;}})});}_0x4ab909=_[_0x2b77('0x37')]({},_0x4ab909,_0x3a6ac9[_0x2b77('0x39')]);var _0x582b84={'where':_0x4ab909[_0x2b77('0x35')]};return db[_0x2b77('0x3a')][_0x2b77('0x1b')](_0x582b84)[_0x2b77('0x20')](function(_0x2811e3){_0x20f14e['count']=_0x2811e3;if(_0x3a6ac9['query']['includeAll']){_0x4ab909[_0x2b77('0x3b')]=[{'all':!![]}];}return db[_0x2b77('0x3a')]['findAll'](_0x4ab909);})[_0x2b77('0x20')](function(_0x3c54f8){_0x20f14e[_0x2b77('0x3c')]=_0x3c54f8;return _0x20f14e;})[_0x2b77('0x20')](respondWithFilteredResult(_0x1056e5,_0x4ab909))[_0x2b77('0x3d')](handleError(_0x1056e5,null));};exports[_0x2b77('0x3e')]=function(_0x2c624e,_0x31fe04){var _0x3d6d3e={'raw':!![],'where':{'id':_0x2c624e[_0x2b77('0x3f')]['id']}},_0x10deca={};_0x10deca[_0x2b77('0x2c')]=_['keys'](db[_0x2b77('0x3a')][_0x2b77('0x29')]);_0x10deca['query']=_[_0x2b77('0x2e')](_0x2c624e[_0x2b77('0x2d')]);_0x10deca[_0x2b77('0x2f')]=_[_0x2b77('0x30')](_0x10deca[_0x2b77('0x2c')],_0x10deca['query']);_0x3d6d3e[_0x2b77('0x32')]=_[_0x2b77('0x30')](_0x10deca[_0x2b77('0x2c')],qs[_0x2b77('0x31')](_0x2c624e['query'][_0x2b77('0x31')]));_0x3d6d3e[_0x2b77('0x32')]=_0x3d6d3e[_0x2b77('0x32')]['length']?_0x3d6d3e[_0x2b77('0x32')]:_0x10deca[_0x2b77('0x2c')];if(_0x2c624e['query'][_0x2b77('0x40')]){_0x3d6d3e[_0x2b77('0x3b')]=[{'all':!![]}];}_0x3d6d3e=_[_0x2b77('0x37')]({},_0x3d6d3e,_0x2c624e[_0x2b77('0x39')]);return db[_0x2b77('0x3a')][_0x2b77('0x41')](_0x3d6d3e)[_0x2b77('0x20')](handleEntityNotFound(_0x31fe04,null))[_0x2b77('0x20')](respondWithResult(_0x31fe04,null))[_0x2b77('0x3d')](handleError(_0x31fe04,null));};exports[_0x2b77('0x42')]=function(_0x4eb615,_0x54d393){return db[_0x2b77('0x3a')]['create'](_0x4eb615['body'],{})[_0x2b77('0x20')](function(_0x34dcd2){var _0xde2dbb=_0x4eb615['user'][_0x2b77('0x43')]({'plain':!![]});if(!_0xde2dbb)throw new Error(_0x2b77('0x44'));if(_0xde2dbb[_0x2b77('0x45')]==='user'){var _0x395ee4=_0x34dcd2[_0x2b77('0x43')]({'plain':!![]});var _0x50263a=_0x2b77('0x22');return db['UserProfileSection'][_0x2b77('0x41')]({'where':{'name':_0x50263a,'userProfileId':_0xde2dbb[_0x2b77('0x46')]},'raw':!![]})[_0x2b77('0x20')](function(_0x24de67){if(_0x24de67&&_0x24de67['autoAssociation']===0x0){return db[_0x2b77('0x23')]['create']({'name':_0x395ee4['name'],'resourceId':_0x395ee4['id'],'type':_0x24de67[_0x2b77('0x25')],'sectionId':_0x24de67['id']},{})['then'](function(){return _0x34dcd2;});}else{return _0x34dcd2;}})[_0x2b77('0x3d')](function(_0x34c9d4){logger[_0x2b77('0x47')](_0x2b77('0x48'),_0x34c9d4);throw _0x34c9d4;});}return _0x34dcd2;})[_0x2b77('0x20')](respondWithResult(_0x54d393,0xc9))[_0x2b77('0x3d')](handleError(_0x54d393,null));};exports['update']=function(_0xccde2e,_0x7b9f40){if(_0xccde2e[_0x2b77('0x49')]['id']){delete _0xccde2e[_0x2b77('0x49')]['id'];}return db[_0x2b77('0x3a')][_0x2b77('0x41')]({'where':{'id':_0xccde2e[_0x2b77('0x3f')]['id']}})[_0x2b77('0x20')](handleEntityNotFound(_0x7b9f40,null))[_0x2b77('0x20')](saveUpdates(_0xccde2e['body'],null))[_0x2b77('0x20')](respondWithResult(_0x7b9f40,null))[_0x2b77('0x3d')](handleError(_0x7b9f40,null));};exports[_0x2b77('0x21')]=function(_0x252331,_0x45c162){return db[_0x2b77('0x3a')]['find']({'where':{'id':_0x252331['params']['id']}})['then'](handleEntityNotFound(_0x45c162,null))[_0x2b77('0x20')](removeEntity(_0x45c162,null))[_0x2b77('0x3d')](handleError(_0x45c162,null));}; \ No newline at end of file +var _0x2789=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','sendStatus','end','status','json','offset','undefined','count','set','Content-Range','apply','save','update','then','get','Variables','destroy','error','stack','name','send','index','map','rawAttributes','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','filter','where','merge','VIRTUAL','options','Variable','include','findAll','show','params','includeAll','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','path','sox','to-csv','ejs','lodash','desk.js','querystring','papaparse','ioredis'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x2789,0x89));var _0x9278=function(_0xa8ac5a,_0x58bf27){_0xa8ac5a=_0xa8ac5a-0x0;var _0xeb35fa=_0x2789[_0xa8ac5a];return _0xeb35fa;};'use strict';var emlformat=require(_0x9278('0x0'));var rimraf=require(_0x9278('0x1'));var zipdir=require(_0x9278('0x2'));var jsonpatch=require(_0x9278('0x3'));var rp=require('request-promise');var moment=require(_0x9278('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x9278('0x5'));var path=require(_0x9278('0x6'));var sox=require(_0x9278('0x7'));var csv=require(_0x9278('0x8'));var ejs=require(_0x9278('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9278('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x9278('0xb'));var toCsv=require(_0x9278('0x8'));var querystring=require(_0x9278('0xc'));var Papa=require(_0x9278('0xd'));var Redis=require(_0x9278('0xe'));var authService=require(_0x9278('0xf'));var qs=require(_0x9278('0x10'));var as=require(_0x9278('0x11'));var hardwareService=require(_0x9278('0x12'));var logger=require('../../config/logger')(_0x9278('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a8364,_0xd50be8){_0xd50be8=_0xd50be8||0xcc;return function(_0x6cca2){if(_0x6cca2){return _0x2a8364[_0x9278('0x14')](_0xd50be8);}return _0x2a8364['status'](_0xd50be8)[_0x9278('0x15')]();};}function respondWithResult(_0x5a8948,_0x3384a0){_0x3384a0=_0x3384a0||0xc8;return function(_0x1439ca){if(_0x1439ca){return _0x5a8948[_0x9278('0x16')](_0x3384a0)[_0x9278('0x17')](_0x1439ca);}};}function respondWithFilteredResult(_0x176b7a,_0x55430e){return function(_0x7be45b){if(_0x7be45b){var _0x4ff1c4=typeof _0x55430e[_0x9278('0x18')]===_0x9278('0x19')&&typeof _0x55430e['limit']==='undefined';var _0x204cfc=_0x7be45b[_0x9278('0x1a')];var _0x1af4cb=_0x4ff1c4?0x0:_0x55430e[_0x9278('0x18')];var _0x3d5313=_0x4ff1c4?_0x7be45b[_0x9278('0x1a')]:_0x55430e[_0x9278('0x18')]+_0x55430e['limit'];var _0x57886d;if(_0x3d5313>=_0x204cfc){_0x3d5313=_0x204cfc;_0x57886d=0xc8;}else{_0x57886d=0xce;}_0x176b7a['status'](_0x57886d);return _0x176b7a[_0x9278('0x1b')](_0x9278('0x1c'),_0x1af4cb+'-'+_0x3d5313+'/'+_0x204cfc)[_0x9278('0x17')](_0x7be45b);}return null;};}function patchUpdates(_0x59fade){return function(_0x284016){try{jsonpatch[_0x9278('0x1d')](_0x284016,_0x59fade,!![]);}catch(_0x18915f){return BPromise['reject'](_0x18915f);}return _0x284016[_0x9278('0x1e')]();};}function saveUpdates(_0xab147d,_0x3dadff){return function(_0x52634f){if(_0x52634f){return _0x52634f[_0x9278('0x1f')](_0xab147d)[_0x9278('0x20')](function(_0x593fd0){return _0x593fd0;});}return null;};}function removeEntity(_0x253081,_0x52e357){return function(_0x1415ec){if(_0x1415ec){return _0x1415ec['destroy']()[_0x9278('0x20')](function(){var _0x37e95f=_0x1415ec[_0x9278('0x21')]({'plain':!![]});var _0x4ee2a7=_0x9278('0x22');return db['UserProfileResource'][_0x9278('0x23')]({'where':{'type':_0x4ee2a7,'resourceId':_0x37e95f['id']}})[_0x9278('0x20')](function(){return _0x1415ec;});})[_0x9278('0x20')](function(){_0x253081[_0x9278('0x16')](0xcc)[_0x9278('0x15')]();});}};}function handleEntityNotFound(_0x24cdc8,_0xd6da24){return function(_0x357325){if(!_0x357325){_0x24cdc8['sendStatus'](0x194);}return _0x357325;};}function handleError(_0x59651b,_0x4ea8d1){_0x4ea8d1=_0x4ea8d1||0x1f4;return function(_0x81e98d){logger[_0x9278('0x24')](_0x81e98d[_0x9278('0x25')]);if(_0x81e98d[_0x9278('0x26')]){delete _0x81e98d[_0x9278('0x26')];}_0x59651b[_0x9278('0x16')](_0x4ea8d1)[_0x9278('0x27')](_0x81e98d);};}exports[_0x9278('0x28')]=function(_0x57c222,_0x11fd5f){var _0x507bab={},_0xff9e1d={},_0x42b4f1={'count':0x0,'rows':[]};var _0x370078=_[_0x9278('0x29')](db['Variable'][_0x9278('0x2a')],function(_0x4f582d){return{'name':_0x4f582d['fieldName'],'type':_0x4f582d[_0x9278('0x2b')][_0x9278('0x2c')]};});_0xff9e1d[_0x9278('0x2d')]=_[_0x9278('0x29')](_0x370078,'name');_0xff9e1d['query']=_[_0x9278('0x2e')](_0x57c222[_0x9278('0x2f')]);_0xff9e1d[_0x9278('0x30')]=_['intersection'](_0xff9e1d[_0x9278('0x2d')],_0xff9e1d[_0x9278('0x2f')]);_0x507bab['attributes']=_[_0x9278('0x31')](_0xff9e1d[_0x9278('0x2d')],qs[_0x9278('0x32')](_0x57c222[_0x9278('0x2f')][_0x9278('0x32')]));_0x507bab['attributes']=_0x507bab[_0x9278('0x33')][_0x9278('0x34')]?_0x507bab[_0x9278('0x33')]:_0xff9e1d[_0x9278('0x2d')];if(!_0x57c222[_0x9278('0x2f')][_0x9278('0x35')](_0x9278('0x36'))){_0x507bab[_0x9278('0x37')]=qs[_0x9278('0x37')](_0x57c222[_0x9278('0x2f')]['limit']);_0x507bab[_0x9278('0x18')]=qs[_0x9278('0x18')](_0x57c222[_0x9278('0x2f')][_0x9278('0x18')]);}_0x507bab[_0x9278('0x38')]=qs[_0x9278('0x39')](_0x57c222['query'][_0x9278('0x39')]);_0x507bab['where']=qs['filters'](_['pick'](_0x57c222[_0x9278('0x2f')],_0xff9e1d['filters']),_0x370078);if(_0x57c222[_0x9278('0x2f')][_0x9278('0x3a')]){_0x507bab[_0x9278('0x3b')]=_[_0x9278('0x3c')](_0x507bab[_0x9278('0x3b')],{'$or':_[_0x9278('0x29')](_0x370078,function(_0x367082){if(_0x367082[_0x9278('0x2b')]!==_0x9278('0x3d')){var _0x5d29de={};_0x5d29de[_0x367082[_0x9278('0x26')]]={'$like':'%'+_0x57c222[_0x9278('0x2f')]['filter']+'%'};return _0x5d29de;}})});}_0x507bab=_[_0x9278('0x3c')]({},_0x507bab,_0x57c222[_0x9278('0x3e')]);var _0x50dd9b={'where':_0x507bab[_0x9278('0x3b')]};return db[_0x9278('0x3f')][_0x9278('0x1a')](_0x50dd9b)[_0x9278('0x20')](function(_0x233f3b){_0x42b4f1[_0x9278('0x1a')]=_0x233f3b;if(_0x57c222[_0x9278('0x2f')]['includeAll']){_0x507bab[_0x9278('0x40')]=[{'all':!![]}];}return db[_0x9278('0x3f')][_0x9278('0x41')](_0x507bab);})['then'](function(_0x7c3aa8){_0x42b4f1['rows']=_0x7c3aa8;return _0x42b4f1;})['then'](respondWithFilteredResult(_0x11fd5f,_0x507bab))['catch'](handleError(_0x11fd5f,null));};exports[_0x9278('0x42')]=function(_0x419b93,_0x15c2f6){var _0x408d5d={'raw':!![],'where':{'id':_0x419b93[_0x9278('0x43')]['id']}},_0x59f323={};_0x59f323['model']=_[_0x9278('0x2e')](db[_0x9278('0x3f')][_0x9278('0x2a')]);_0x59f323['query']=_[_0x9278('0x2e')](_0x419b93[_0x9278('0x2f')]);_0x59f323[_0x9278('0x30')]=_['intersection'](_0x59f323['model'],_0x59f323['query']);_0x408d5d[_0x9278('0x33')]=_[_0x9278('0x31')](_0x59f323['model'],qs[_0x9278('0x32')](_0x419b93['query'][_0x9278('0x32')]));_0x408d5d[_0x9278('0x33')]=_0x408d5d['attributes'][_0x9278('0x34')]?_0x408d5d['attributes']:_0x59f323[_0x9278('0x2d')];if(_0x419b93[_0x9278('0x2f')][_0x9278('0x44')]){_0x408d5d[_0x9278('0x40')]=[{'all':!![]}];}_0x408d5d=_[_0x9278('0x3c')]({},_0x408d5d,_0x419b93[_0x9278('0x3e')]);return db[_0x9278('0x3f')][_0x9278('0x45')](_0x408d5d)[_0x9278('0x20')](handleEntityNotFound(_0x15c2f6,null))['then'](respondWithResult(_0x15c2f6,null))[_0x9278('0x46')](handleError(_0x15c2f6,null));};exports[_0x9278('0x47')]=function(_0x38a24e,_0x254b58){return db[_0x9278('0x3f')]['create'](_0x38a24e[_0x9278('0x48')],{})[_0x9278('0x20')](function(_0xc01693){var _0x5710f5=_0x38a24e['user'][_0x9278('0x21')]({'plain':!![]});if(!_0x5710f5)throw new Error(_0x9278('0x49'));if(_0x5710f5['role']==='user'){var _0x1059e0=_0xc01693[_0x9278('0x21')]({'plain':!![]});var _0x4f63f2='Variables';return db[_0x9278('0x4a')][_0x9278('0x45')]({'where':{'name':_0x4f63f2,'userProfileId':_0x5710f5['userProfileId']},'raw':!![]})[_0x9278('0x20')](function(_0x180e15){if(_0x180e15&&_0x180e15['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x1059e0['name'],'resourceId':_0x1059e0['id'],'type':_0x180e15[_0x9278('0x26')],'sectionId':_0x180e15['id']},{})[_0x9278('0x20')](function(){return _0xc01693;});}else{return _0xc01693;}})[_0x9278('0x46')](function(_0x16befc){logger[_0x9278('0x24')](_0x9278('0x4b'),_0x16befc);throw _0x16befc;});}return _0xc01693;})[_0x9278('0x20')](respondWithResult(_0x254b58,0xc9))[_0x9278('0x46')](handleError(_0x254b58,null));};exports[_0x9278('0x1f')]=function(_0x11ec23,_0x4aa39e){if(_0x11ec23[_0x9278('0x48')]['id']){delete _0x11ec23[_0x9278('0x48')]['id'];}return db[_0x9278('0x3f')][_0x9278('0x45')]({'where':{'id':_0x11ec23[_0x9278('0x43')]['id']}})[_0x9278('0x20')](handleEntityNotFound(_0x4aa39e,null))[_0x9278('0x20')](saveUpdates(_0x11ec23[_0x9278('0x48')],null))[_0x9278('0x20')](respondWithResult(_0x4aa39e,null))[_0x9278('0x46')](handleError(_0x4aa39e,null));};exports[_0x9278('0x23')]=function(_0x49513b,_0x338207){return db['Variable'][_0x9278('0x45')]({'where':{'id':_0x49513b[_0x9278('0x43')]['id']}})['then'](handleEntityNotFound(_0x338207,null))[_0x9278('0x20')](removeEntity(_0x338207,null))[_0x9278('0x46')](handleError(_0x338207,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index b434e9a..19f1d2e 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 _0x73ae=['./variable.attributes','exports','define','tools_variables','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x5f44c3,_0x460f76){var _0x577bf7=function(_0x370579){while(--_0x370579){_0x5f44c3['push'](_0x5f44c3['shift']());}};_0x577bf7(++_0x460f76);}(_0x73ae,0xac));var _0xe73a=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0x73ae[_0x34bf97];return _0x292719;};'use strict';var _=require(_0xe73a('0x0'));var util=require('util');var logger=require(_0xe73a('0x1'))(_0xe73a('0x2'));var moment=require(_0xe73a('0x3'));var BPromise=require(_0xe73a('0x4'));var rp=require(_0xe73a('0x5'));var fs=require('fs');var path=require(_0xe73a('0x6'));var rimraf=require('rimraf');var config=require(_0xe73a('0x7'));var attributes=require(_0xe73a('0x8'));module[_0xe73a('0x9')]=function(_0x4bee6f,_0x4fe302){return _0x4bee6f[_0xe73a('0xa')]('Variable',attributes,{'tableName':_0xe73a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb22e=['Variable','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./variable.attributes','exports','define'];(function(_0x548cfe,_0x867071){var _0x5dd279=function(_0x57d78d){while(--_0x57d78d){_0x548cfe['push'](_0x548cfe['shift']());}};_0x5dd279(++_0x867071);}(_0xb22e,0x90));var _0xeb22=function(_0xc8c103,_0x6a13ca){_0xc8c103=_0xc8c103-0x0;var _0x460998=_0xb22e[_0xc8c103];return _0x460998;};'use strict';var _=require(_0xeb22('0x0'));var util=require('util');var logger=require(_0xeb22('0x1'))(_0xeb22('0x2'));var moment=require(_0xeb22('0x3'));var BPromise=require(_0xeb22('0x4'));var rp=require(_0xeb22('0x5'));var fs=require('fs');var path=require(_0xeb22('0x6'));var rimraf=require(_0xeb22('0x7'));var config=require(_0xeb22('0x8'));var attributes=require(_0xeb22('0x9'));module[_0xeb22('0xa')]=function(_0xfc8eec,_0x3b1a9b){return _0xfc8eec[_0xeb22('0xb')](_0xeb22('0xc'),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 9f39652..9ecd6f8 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 _0x1cb9=['include','map','model','then','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','ShowVariable','Variable','options','attributes'];(function(_0x4808d3,_0x3353c6){var _0x3057fa=function(_0x535a58){while(--_0x535a58){_0x4808d3['push'](_0x4808d3['shift']());}};_0x3057fa(++_0x3353c6);}(_0x1cb9,0x14e));var _0x91cb=function(_0x27ce59,_0x3900e4){_0x27ce59=_0x27ce59-0x0;var _0xae0d17=_0x1cb9[_0x27ce59];return _0xae0d17;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var moment=require(_0x91cb('0x1'));var BPromise=require(_0x91cb('0x2'));var rs=require(_0x91cb('0x3'));var fs=require('fs');var Redis=require(_0x91cb('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x91cb('0x5'));var logger=require(_0x91cb('0x6'))('rpc');var config=require(_0x91cb('0x7'));var jayson=require(_0x91cb('0x8'));var client=jayson[_0x91cb('0x9')][_0x91cb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3b9d98,_0x8f8a3b,_0x4c1f56){return new BPromise(function(_0x15c517,_0x5bda2f){return client[_0x91cb('0xb')](_0x3b9d98,_0x4c1f56)['then'](function(_0xa43e7a){logger[_0x91cb('0xc')](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));logger[_0x91cb('0xf')](_0x91cb('0x10'),_0x8f8a3b,_0x91cb('0xe'),JSON[_0x91cb('0x11')](_0xa43e7a));if(_0xa43e7a[_0x91cb('0x12')]){if(_0xa43e7a[_0x91cb('0x12')]['code']===0x1f4){logger[_0x91cb('0x12')](_0x91cb('0xd'),_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x5bda2f(_0xa43e7a[_0x91cb('0x12')][_0x91cb('0x13')]);}logger[_0x91cb('0x12')]('Variable,\x20%s,\x20%s',_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x15c517(_0xa43e7a[_0x91cb('0x12')]['message']);}else{logger['info'](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));_0x15c517(_0xa43e7a[_0x91cb('0x14')]['message']);}})[_0x91cb('0x15')](function(_0x135890){logger['error'](_0x91cb('0xd'),_0x8f8a3b,_0x135890);_0x5bda2f(_0x135890);});});}exports[_0x91cb('0x16')]=function(_0x1cd34b){var _0xcd1a78=this;return new Promise(function(_0x5cc1c3,_0x3fba4f){return db[_0x91cb('0x17')]['find']({'raw':_0x1cd34b[_0x91cb('0x18')]?_0x1cd34b['options']['raw']===undefined?!![]:![]:!![],'where':_0x1cd34b[_0x91cb('0x18')]?_0x1cd34b[_0x91cb('0x18')]['where']||null:null,'attributes':_0x1cd34b['options']?_0x1cd34b['options'][_0x91cb('0x19')]||null:null,'include':_0x1cd34b[_0x91cb('0x18')]?_0x1cd34b[_0x91cb('0x18')][_0x91cb('0x1a')]?_['map'](_0x1cd34b[_0x91cb('0x18')][_0x91cb('0x1a')],function(_0x1fa837){return{'model':db[_0x1fa837['model']],'as':_0x1fa837['as'],'attributes':_0x1fa837[_0x91cb('0x19')],'include':_0x1fa837[_0x91cb('0x1a')]?_[_0x91cb('0x1b')](_0x1fa837[_0x91cb('0x1a')],function(_0x3ca500){return{'model':db[_0x3ca500[_0x91cb('0x1c')]],'as':_0x3ca500['as'],'attributes':_0x3ca500[_0x91cb('0x19')],'include':_0x3ca500[_0x91cb('0x1a')]?_[_0x91cb('0x1b')](_0x3ca500['include'],function(_0x59bf3a){return{'model':db[_0x59bf3a[_0x91cb('0x1c')]],'as':_0x59bf3a['as'],'attributes':_0x59bf3a['attributes']};}):[]};}):[]};}):[]:[]})[_0x91cb('0x1d')](function(_0x34d372){logger[_0x91cb('0xc')]('ShowVariable',_0x1cd34b);logger[_0x91cb('0xf')]('ShowVariable',_0x1cd34b,JSON[_0x91cb('0x11')](_0x34d372));_0x5cc1c3(_0x34d372);})[_0x91cb('0x15')](function(_0x3b3ee6){logger[_0x91cb('0x12')](_0x91cb('0x16'),_0x3b3ee6['message'],_0x1cd34b);_0x3fba4f(_0xcd1a78[_0x91cb('0x12')](0x1f4,_0x3b3ee6['message']));});});}; \ No newline at end of file +var _0x3e74=['catch','Variable','find','options','raw','where','attributes','include','map','model','then','ShowVariable','stringify','lodash','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','error','Variable,\x20%s,\x20%s','message','info'];(function(_0x8bca3f,_0x158cf8){var _0x448ab5=function(_0x5b5537){while(--_0x5b5537){_0x8bca3f['push'](_0x8bca3f['shift']());}};_0x448ab5(++_0x158cf8);}(_0x3e74,0x175));var _0x43e7=function(_0x10d1ea,_0xf5a45c){_0x10d1ea=_0x10d1ea-0x0;var _0x44c45e=_0x3e74[_0x10d1ea];return _0x44c45e;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var moment=require(_0x43e7('0x1'));var BPromise=require(_0x43e7('0x2'));var rs=require(_0x43e7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x43e7('0x4'));var logger=require('../../config/logger')(_0x43e7('0x5'));var config=require(_0x43e7('0x6'));var jayson=require(_0x43e7('0x7'));var client=jayson[_0x43e7('0x8')][_0x43e7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x503698,_0x45a0d1,_0x3491d6){return new BPromise(function(_0x2ede2d,_0x8528fc){return client[_0x43e7('0xa')](_0x503698,_0x3491d6)['then'](function(_0x212c6c){logger['info']('Variable,\x20%s,\x20%s',_0x45a0d1,_0x43e7('0xb'));logger[_0x43e7('0xc')]('Variable,\x20%s,\x20%s,\x20%s',_0x45a0d1,_0x43e7('0xb'),JSON['stringify'](_0x212c6c));if(_0x212c6c[_0x43e7('0xd')]){if(_0x212c6c[_0x43e7('0xd')]['code']===0x1f4){logger[_0x43e7('0xd')](_0x43e7('0xe'),_0x45a0d1,_0x212c6c[_0x43e7('0xd')][_0x43e7('0xf')]);return _0x8528fc(_0x212c6c['error']['message']);}logger[_0x43e7('0xd')](_0x43e7('0xe'),_0x45a0d1,_0x212c6c[_0x43e7('0xd')]['message']);return _0x2ede2d(_0x212c6c['error'][_0x43e7('0xf')]);}else{logger[_0x43e7('0x10')](_0x43e7('0xe'),_0x45a0d1,_0x43e7('0xb'));_0x2ede2d(_0x212c6c['result']['message']);}})[_0x43e7('0x11')](function(_0x264575){logger[_0x43e7('0xd')]('Variable,\x20%s,\x20%s',_0x45a0d1,_0x264575);_0x8528fc(_0x264575);});});}exports['ShowVariable']=function(_0x446986){var _0x1ca758=this;return new Promise(function(_0x9037d3,_0x140657){return db[_0x43e7('0x12')][_0x43e7('0x13')]({'raw':_0x446986[_0x43e7('0x14')]?_0x446986[_0x43e7('0x14')][_0x43e7('0x15')]===undefined?!![]:![]:!![],'where':_0x446986[_0x43e7('0x14')]?_0x446986[_0x43e7('0x14')][_0x43e7('0x16')]||null:null,'attributes':_0x446986['options']?_0x446986[_0x43e7('0x14')][_0x43e7('0x17')]||null:null,'include':_0x446986['options']?_0x446986[_0x43e7('0x14')][_0x43e7('0x18')]?_[_0x43e7('0x19')](_0x446986[_0x43e7('0x14')][_0x43e7('0x18')],function(_0x2f4cb4){return{'model':db[_0x2f4cb4['model']],'as':_0x2f4cb4['as'],'attributes':_0x2f4cb4[_0x43e7('0x17')],'include':_0x2f4cb4['include']?_['map'](_0x2f4cb4[_0x43e7('0x18')],function(_0x43f4ff){return{'model':db[_0x43f4ff['model']],'as':_0x43f4ff['as'],'attributes':_0x43f4ff[_0x43e7('0x17')],'include':_0x43f4ff['include']?_[_0x43e7('0x19')](_0x43f4ff['include'],function(_0x1af208){return{'model':db[_0x1af208[_0x43e7('0x1a')]],'as':_0x1af208['as'],'attributes':_0x1af208[_0x43e7('0x17')]};}):[]};}):[]};}):[]:[]})[_0x43e7('0x1b')](function(_0x51f4d7){logger['info'](_0x43e7('0x1c'),_0x446986);logger['debug'](_0x43e7('0x1c'),_0x446986,JSON[_0x43e7('0x1d')](_0x51f4d7));_0x9037d3(_0x51f4d7);})[_0x43e7('0x11')](function(_0xb1fc63){logger['error'](_0x43e7('0x1c'),_0xb1fc63[_0x43e7('0xf')],_0x446986);_0x140657(_0x1ca758[_0x43e7('0xd')](0x1f4,_0xb1fc63[_0x43e7('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index 1354941..2080cce 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 _0x0ffd=['pull','/restart','restart','/migrations','migrations','Router','./version.controller','get','index','/fetch','isAuthenticated','canUpdate','fetch','/reset','reset','/pull'];(function(_0x5c1731,_0x45255e){var _0x3af53d=function(_0x52b5d7){while(--_0x52b5d7){_0x5c1731['push'](_0x5c1731['shift']());}};_0x3af53d(++_0x45255e);}(_0x0ffd,0x145));var _0xd0ff=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x0ffd[_0x4cf98e];return _0x1623ac;};'use strict';var express=require('express');var router=express[_0xd0ff('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0xd0ff('0x1'));router[_0xd0ff('0x2')]('/',controller[_0xd0ff('0x3')]);router[_0xd0ff('0x2')](_0xd0ff('0x4'),auth[_0xd0ff('0x5')](),auth[_0xd0ff('0x6')](),controller[_0xd0ff('0x7')]);router[_0xd0ff('0x2')](_0xd0ff('0x8'),auth[_0xd0ff('0x5')](),auth[_0xd0ff('0x6')](),controller[_0xd0ff('0x9')]);router[_0xd0ff('0x2')](_0xd0ff('0xa'),auth[_0xd0ff('0x5')](),auth['canUpdate'](),controller[_0xd0ff('0xb')]);router[_0xd0ff('0x2')](_0xd0ff('0xc'),auth[_0xd0ff('0x5')](),controller[_0xd0ff('0xd')]);router[_0xd0ff('0x2')](_0xd0ff('0xe'),controller[_0xd0ff('0xf')]);module['exports']=router; \ No newline at end of file +var _0xb9cd=['migrations','exports','express','../../components/auth/service','./version.controller','get','index','/fetch','isAuthenticated','canUpdate','pull','/migrations'];(function(_0xbdd912,_0x5545a2){var _0x157d7f=function(_0x462248){while(--_0x462248){_0xbdd912['push'](_0xbdd912['shift']());}};_0x157d7f(++_0x5545a2);}(_0xb9cd,0x18e));var _0xdb9c=function(_0x11b8ae,_0x485fa8){_0x11b8ae=_0x11b8ae-0x0;var _0x35a448=_0xb9cd[_0x11b8ae];return _0x35a448;};'use strict';var express=require(_0xdb9c('0x0'));var router=express['Router']();var auth=require(_0xdb9c('0x1'));var controller=require(_0xdb9c('0x2'));router[_0xdb9c('0x3')]('/',controller[_0xdb9c('0x4')]);router['get'](_0xdb9c('0x5'),auth[_0xdb9c('0x6')](),auth[_0xdb9c('0x7')](),controller['fetch']);router[_0xdb9c('0x3')]('/reset',auth[_0xdb9c('0x6')](),auth['canUpdate'](),controller['reset']);router[_0xdb9c('0x3')]('/pull',auth[_0xdb9c('0x6')](),auth[_0xdb9c('0x7')](),controller[_0xdb9c('0x8')]);router['get']('/restart',auth[_0xdb9c('0x6')](),controller['restart']);router[_0xdb9c('0x3')](_0xdb9c('0x9'),controller[_0xdb9c('0xa')]);module[_0xdb9c('0xb')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index 4c11f93..f5c15b8 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 _0x7be7=['Migration','constructor','map','.js','Database\x20migrated\x20successfully\x20from\x20version\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash','pkginfo','version','compare-versions','child_process','../../config/pm2','../../config/logger','simple-git','root','index','exports','query','latest','fetch','tags','2.0.0','json','status','origin','master','error','info','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','git\x20reset\x20--hard','pull','restart','motion2','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','readdirSync','join','server','push','length','sort','sequelize'];(function(_0x48ec67,_0x2fdce5){var _0x5d5bc8=function(_0x5c8bba){while(--_0x5c8bba){_0x48ec67['push'](_0x48ec67['shift']());}};_0x5d5bc8(++_0x2fdce5);}(_0x7be7,0x10c));var _0x77be=function(_0x48319a,_0x488a49){_0x48319a=_0x48319a-0x0;var _0xfb1e80=_0x7be7[_0x48319a];return _0xfb1e80;};'use strict';var Umzug=require(_0x77be('0x0'));var path=require(_0x77be('0x1'));var fs=require('fs');var _=require(_0x77be('0x2'));var pkginfo=require(_0x77be('0x3'))(module,_0x77be('0x4'));var compareVersions=require(_0x77be('0x5'));var exec=require(_0x77be('0x6'))['exec'];var db=require('../../mysqldb')['db'];var config=require('../../config/environment');var pm2=require(_0x77be('0x7'));var logger=require(_0x77be('0x8'))('update');var git=require(_0x77be('0x9'))(config[_0x77be('0xa')]);exports[_0x77be('0xb')]=function(_0xb661f6,_0x40b87a){var _0x35323e={'current':module[_0x77be('0xc')][_0x77be('0x4')],'phonebar':0x2};if(_0xb661f6[_0x77be('0xd')]&&_0xb661f6[_0x77be('0xd')][_0x77be('0xe')]){return git[_0x77be('0xf')]()[_0x77be('0x10')](function(_0x327364,_0x11ce43){_0x35323e['latest']=(_0x327364?module[_0x77be('0xc')][_0x77be('0x4')]:_0x11ce43['latest'])||_0x77be('0x11');return _0x40b87a['status'](0xc8)[_0x77be('0x12')](_0x35323e);});}else{return _0x40b87a[_0x77be('0x13')](0xc8)['json'](_0x35323e);}};exports['fetch']=function(_0xf959a5,_0x1954dd){return git[_0x77be('0xf')]([_0x77be('0x14'),_0x77be('0x15')],function(_0x53cd9d){if(_0x53cd9d){logger[_0x77be('0x16')](_0x53cd9d);return _0x1954dd['status'](0x1f4)[_0x77be('0x12')](_0x53cd9d);}logger[_0x77be('0x17')]('git\x20fetch');return _0x1954dd['status'](0xc8)[_0x77be('0x12')]({'output':_0x77be('0x18')});});};exports[_0x77be('0x19')]=function(_0x7d71d9,_0x1bd3be){return git[_0x77be('0x19')]([_0x77be('0x1a'),_0x77be('0x1b')],function(_0x485396){if(_0x485396){logger['error'](_0x485396);return _0x1bd3be[_0x77be('0x13')](0x1f4)[_0x77be('0x12')](_0x485396);}logger['info']('git\x20reset\x20--hard\x20FETCH_HEAD');return _0x1bd3be[_0x77be('0x13')](0xc8)[_0x77be('0x12')]({'output':_0x77be('0x1c')});});};exports[_0x77be('0x1d')]=function(_0x1c7e90,_0x2c4c90){exec('npm\x20install\x20--production',function(_0x39e625,_0x4de2d3,_0x1f2d9d){logger[_0x77be('0x17')](_0x4de2d3);logger['info'](_0x1f2d9d);if(_0x39e625){logger[_0x77be('0x16')](_0x39e625);return _0x2c4c90[_0x77be('0x13')](0x1f4)['json'](_0x39e625);}return _0x2c4c90['status'](0xc8)[_0x77be('0x12')]({'output':_0x4de2d3});});};exports[_0x77be('0x1e')]=function(_0x44fe02,_0x35c903){return pm2[_0x77be('0x1e')](_0x77be('0x1f'))[_0x77be('0x20')](function(_0x2d71b6){logger[_0x77be('0x17')](_0x77be('0x21'),_0x2d71b6);return _0x35c903['status'](0xc8)[_0x77be('0x12')]({'output':_0x77be('0x22')});})[_0x77be('0x23')](function(_0x346fa9){logger[_0x77be('0x16')](_0x346fa9);return _0x35c903[_0x77be('0x13')](0x1f4)[_0x77be('0x12')](_0x346fa9);});};exports[_0x77be('0x24')]=function(_0x4586af,_0x51773e){var _0x15c6c2=fs[_0x77be('0x25')](path[_0x77be('0x26')](config[_0x77be('0xa')],_0x77be('0x27'),_0x77be('0x24')));var _0x1f7750=[];for(var _0x5e860b=0x0;_0x5e860b<_0x15c6c2['length'];_0x5e860b++){var _0x567369=_0x15c6c2[_0x5e860b]['replace']('.js','');if(compareVersions(module[_0x77be('0xc')][_0x77be('0x4')],_0x567369)===-0x1){_0x1f7750[_0x77be('0x28')](_0x567369);}}if(_0x1f7750[_0x77be('0x29')]){var _0x2bd510=_0x1f7750[_0x77be('0x2a')](compareVersions);var _0x5967f5=new Umzug({'storage':_0x77be('0x2b'),'storageOptions':{'model':db[_0x77be('0x2c')],'modelName':_0x77be('0x2c'),'columnName':_0x77be('0x4')},'migrations':{'params':[db[_0x77be('0x2b')]['getQueryInterface'](),db[_0x77be('0x2b')][_0x77be('0x2d')],function(){throw new Error('Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.');}],'path':path[_0x77be('0x26')](config[_0x77be('0xa')],_0x77be('0x27'),'migrations'),'pattern':/\.js$/}});_0x5967f5['up']({'migrations':_[_0x77be('0x2e')](_0x2bd510,function(_0x59844e){return _0x59844e+_0x77be('0x2f');})})[_0x77be('0x20')](function(){return _0x51773e[_0x77be('0x13')](0xc8)[_0x77be('0x12')]({'output':_0x77be('0x30')+module['exports'][_0x77be('0x4')]+'\x20to\x20'+_[_0x77be('0x31')](_0x2bd510),'migrations':_[_0x77be('0x26')](_0x2bd510)});})[_0x77be('0x23')](function(_0xc71a4d){if(_0xc71a4d instanceof db[_0x77be('0x2b')][_0x77be('0x32')]){return _0x51773e[_0x77be('0x13')](0xc8)['json']({'output':_0x77be('0x33')});}else{return _0x51773e[_0x77be('0x13')](0x1f4)[_0x77be('0x12')](_0xc71a4d);}});}else{return _0x51773e['status'](0xc8)[_0x77be('0x12')]({'output':'Database\x20already\x20up-to-date'});}}; \ No newline at end of file +var _0x9b77=['catch','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','pkginfo','version','compare-versions','child_process','exec','../../mysqldb','../../config/environment','../../config/pm2','../../config/logger','update','root','index','exports','query','fetch','tags','latest','2.0.0','status','json','origin','git\x20fetch\x20origin\x20master','reset','FETCH_HEAD','error','info','npm\x20install\x20--production','restart','motion2','Your\x20system\x20has\x20been\x20restart\x20successfully','migrations','readdirSync','server','length','replace','.js','sort','sequelize','Migration','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','join'];(function(_0x20cb20,_0x256051){var _0x2fcf4b=function(_0x26200b){while(--_0x26200b){_0x20cb20['push'](_0x20cb20['shift']());}};_0x2fcf4b(++_0x256051);}(_0x9b77,0x102));var _0x79b7=function(_0x46401e,_0x2a345b){_0x46401e=_0x46401e-0x0;var _0x447cba=_0x9b77[_0x46401e];return _0x447cba;};'use strict';var Umzug=require(_0x79b7('0x0'));var path=require(_0x79b7('0x1'));var fs=require('fs');var _=require('lodash');var pkginfo=require(_0x79b7('0x2'))(module,_0x79b7('0x3'));var compareVersions=require(_0x79b7('0x4'));var exec=require(_0x79b7('0x5'))[_0x79b7('0x6')];var db=require(_0x79b7('0x7'))['db'];var config=require(_0x79b7('0x8'));var pm2=require(_0x79b7('0x9'));var logger=require(_0x79b7('0xa'))(_0x79b7('0xb'));var git=require('simple-git')(config[_0x79b7('0xc')]);exports[_0x79b7('0xd')]=function(_0xb6c530,_0x588da9){var _0x7417bd={'current':module[_0x79b7('0xe')]['version'],'phonebar':0x2};if(_0xb6c530[_0x79b7('0xf')]&&_0xb6c530[_0x79b7('0xf')]['latest']){return git[_0x79b7('0x10')]()[_0x79b7('0x11')](function(_0x6c77a6,_0xf9fd9f){_0x7417bd[_0x79b7('0x12')]=(_0x6c77a6?module[_0x79b7('0xe')][_0x79b7('0x3')]:_0xf9fd9f[_0x79b7('0x12')])||_0x79b7('0x13');return _0x588da9[_0x79b7('0x14')](0xc8)[_0x79b7('0x15')](_0x7417bd);});}else{return _0x588da9[_0x79b7('0x14')](0xc8)[_0x79b7('0x15')](_0x7417bd);}};exports[_0x79b7('0x10')]=function(_0x317678,_0x621c69){return git[_0x79b7('0x10')]([_0x79b7('0x16'),'master'],function(_0x26664d){if(_0x26664d){logger['error'](_0x26664d);return _0x621c69['status'](0x1f4)['json'](_0x26664d);}logger['info']('git\x20fetch');return _0x621c69[_0x79b7('0x14')](0xc8)[_0x79b7('0x15')]({'output':_0x79b7('0x17')});});};exports[_0x79b7('0x18')]=function(_0x30aeb3,_0x59f13a){return git[_0x79b7('0x18')](['--hard',_0x79b7('0x19')],function(_0x14e7e7){if(_0x14e7e7){logger[_0x79b7('0x1a')](_0x14e7e7);return _0x59f13a[_0x79b7('0x14')](0x1f4)[_0x79b7('0x15')](_0x14e7e7);}logger[_0x79b7('0x1b')]('git\x20reset\x20--hard\x20FETCH_HEAD');return _0x59f13a[_0x79b7('0x14')](0xc8)[_0x79b7('0x15')]({'output':'git\x20reset\x20--hard'});});};exports['pull']=function(_0x439f4a,_0x7b0240){exec(_0x79b7('0x1c'),function(_0x105b17,_0x4af384,_0x1d2a39){logger[_0x79b7('0x1b')](_0x4af384);logger['info'](_0x1d2a39);if(_0x105b17){logger['error'](_0x105b17);return _0x7b0240[_0x79b7('0x14')](0x1f4)[_0x79b7('0x15')](_0x105b17);}return _0x7b0240[_0x79b7('0x14')](0xc8)[_0x79b7('0x15')]({'output':_0x4af384});});};exports[_0x79b7('0x1d')]=function(_0x3aa991,_0x22e242){return pm2[_0x79b7('0x1d')](_0x79b7('0x1e'))['then'](function(_0x8fff1c){logger[_0x79b7('0x1b')]('pm2\x20restart\x20motion\x20%s',_0x8fff1c);return _0x22e242[_0x79b7('0x14')](0xc8)[_0x79b7('0x15')]({'output':_0x79b7('0x1f')});})['catch'](function(_0x3c9559){logger[_0x79b7('0x1a')](_0x3c9559);return _0x22e242[_0x79b7('0x14')](0x1f4)[_0x79b7('0x15')](_0x3c9559);});};exports[_0x79b7('0x20')]=function(_0x9d7146,_0x5566ed){var _0x3fa890=fs[_0x79b7('0x21')](path['join'](config[_0x79b7('0xc')],_0x79b7('0x22'),_0x79b7('0x20')));var _0x28c249=[];for(var _0x1f7e68=0x0;_0x1f7e68<_0x3fa890[_0x79b7('0x23')];_0x1f7e68++){var _0x56eab1=_0x3fa890[_0x1f7e68][_0x79b7('0x24')](_0x79b7('0x25'),'');if(compareVersions(module[_0x79b7('0xe')]['version'],_0x56eab1)===-0x1){_0x28c249['push'](_0x56eab1);}}if(_0x28c249[_0x79b7('0x23')]){var _0x592722=_0x28c249[_0x79b7('0x26')](compareVersions);var _0x3b70aa=new Umzug({'storage':_0x79b7('0x27'),'storageOptions':{'model':db[_0x79b7('0x28')],'modelName':'Migration','columnName':'version'},'migrations':{'params':[db[_0x79b7('0x27')][_0x79b7('0x29')](),db[_0x79b7('0x27')][_0x79b7('0x2a')],function(){throw new Error(_0x79b7('0x2b'));}],'path':path['join'](config[_0x79b7('0xc')],_0x79b7('0x22'),_0x79b7('0x20')),'pattern':/\.js$/}});_0x3b70aa['up']({'migrations':_['map'](_0x592722,function(_0x91a62b){return _0x91a62b+_0x79b7('0x25');})})['then'](function(){return _0x5566ed[_0x79b7('0x14')](0xc8)[_0x79b7('0x15')]({'output':_0x79b7('0x2c')+module[_0x79b7('0xe')][_0x79b7('0x3')]+_0x79b7('0x2d')+_[_0x79b7('0x2e')](_0x592722),'migrations':_[_0x79b7('0x2f')](_0x592722)});})[_0x79b7('0x30')](function(_0x18d103){if(_0x18d103 instanceof db['sequelize'][_0x79b7('0x31')]){return _0x5566ed['status'](0xc8)[_0x79b7('0x15')]({'output':_0x79b7('0x32')});}else{return _0x5566ed['status'](0x1f4)['json'](_0x18d103);}});}else{return _0x5566ed[_0x79b7('0x14')](0xc8)[_0x79b7('0x15')]({'output':_0x79b7('0x32')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index 17fdee4..edcfde4 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 _0xc360=['index','/describe','describe','post','create','put','/:id','update','delete','destroy','exports','multer','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','get','isAuthenticated'];(function(_0x50cfc3,_0x526cc6){var _0x5c11ef=function(_0xeaf96a){while(--_0xeaf96a){_0x50cfc3['push'](_0x50cfc3['shift']());}};_0x5c11ef(++_0x526cc6);}(_0xc360,0x1af));var _0x0c36=function(_0x58a50e,_0x12a952){_0x58a50e=_0x58a50e-0x0;var _0x3b1e57=_0xc360[_0x58a50e];return _0x3b1e57;};'use strict';var multer=require(_0x0c36('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x0c36('0x1'));var router=express[_0x0c36('0x2')]();var fs_extra=require(_0x0c36('0x3'));var auth=require(_0x0c36('0x4'));var interaction=require(_0x0c36('0x5'));var config=require(_0x0c36('0x6'));var controller=require(_0x0c36('0x7'));router[_0x0c36('0x8')]('/',auth[_0x0c36('0x9')](),controller[_0x0c36('0xa')]);router['get'](_0x0c36('0xb'),auth[_0x0c36('0x9')](),controller[_0x0c36('0xc')]);router[_0x0c36('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x0c36('0xd')]('/',auth[_0x0c36('0x9')](),controller[_0x0c36('0xe')]);router[_0x0c36('0xf')](_0x0c36('0x10'),auth[_0x0c36('0x9')](),controller[_0x0c36('0x11')]);router[_0x0c36('0x12')](_0x0c36('0x10'),auth[_0x0c36('0x9')](),controller[_0x0c36('0x13')]);module[_0x0c36('0x14')]=router; \ No newline at end of file +var _0x401a=['get','isAuthenticated','index','/describe','describe','/:id','show','post','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x29e669,_0x275d8e){var _0x4b7ba7=function(_0x26eac9){while(--_0x26eac9){_0x29e669['push'](_0x29e669['shift']());}};_0x4b7ba7(++_0x275d8e);}(_0x401a,0x83));var _0xa401=function(_0x3d6449,_0x2cfb57){_0x3d6449=_0x3d6449-0x0;var _0x10d0b3=_0x401a[_0x3d6449];return _0x10d0b3;};'use strict';var multer=require('multer');var util=require(_0xa401('0x0'));var path=require(_0xa401('0x1'));var timeout=require(_0xa401('0x2'));var express=require(_0xa401('0x3'));var router=express[_0xa401('0x4')]();var fs_extra=require(_0xa401('0x5'));var auth=require(_0xa401('0x6'));var interaction=require(_0xa401('0x7'));var config=require(_0xa401('0x8'));var controller=require('./voiceAgentReport.controller');router[_0xa401('0x9')]('/',auth[_0xa401('0xa')](),controller[_0xa401('0xb')]);router[_0xa401('0x9')](_0xa401('0xc'),auth[_0xa401('0xa')](),controller[_0xa401('0xd')]);router[_0xa401('0x9')](_0xa401('0xe'),auth[_0xa401('0xa')](),controller[_0xa401('0xf')]);router[_0xa401('0x10')]('/',auth[_0xa401('0xa')](),controller['create']);router['put']('/:id',auth[_0xa401('0xa')](),controller['update']);router[_0xa401('0x11')](_0xa401('0xe'),auth[_0xa401('0xa')](),controller[_0xa401('0x12')]);module[_0xa401('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index ebb6816..f022aed 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 _0xf3aa=['INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING','DATE'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf3aa,0xf1));var _0xaf3a=function(_0x1ce9ea,_0x32e6f4){_0x1ce9ea=_0x1ce9ea-0x0;var _0x2a95b9=_0xf3aa[_0x1ce9ea];return _0x2a95b9;};'use strict';var Sequelize=require(_0xaf3a('0x0'));module[_0xaf3a('0x1')]={'type':{'type':Sequelize[_0xaf3a('0x2')]},'uniqueid':{'type':Sequelize[_0xaf3a('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xaf3a('0x2')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xaf3a('0x2')]},'agentcalledAt':{'type':Sequelize[_0xaf3a('0x3')]},'agentconnectAt':{'type':Sequelize[_0xaf3a('0x3')]},'agentcompleteAt':{'type':Sequelize[_0xaf3a('0x3')]},'agentringnoanswerAt':{'type':Sequelize[_0xaf3a('0x3')]},'agentdumpAt':{'type':Sequelize[_0xaf3a('0x3')]},'holdtime':{'type':Sequelize[_0xaf3a('0x4')]},'agentcomplete':{'type':Sequelize[_0xaf3a('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'talktime':{'type':Sequelize[_0xaf3a('0x4')]},'agentacw':{'type':Sequelize[_0xaf3a('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xaf3a('0x4')]},'reason':{'type':Sequelize['STRING']},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xaf3a('0x2')]},'channelstate':{'type':Sequelize[_0xaf3a('0x4')]},'channelstatedesc':{'type':Sequelize[_0xaf3a('0x2')]},'connectedlinenum':{'type':Sequelize[_0xaf3a('0x2')]},'connectedlinename':{'type':Sequelize[_0xaf3a('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xaf3a('0x2')]},'context':{'type':Sequelize[_0xaf3a('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xaf3a('0x2')]},'destchannel':{'type':Sequelize[_0xaf3a('0x2')]},'destchannelstate':{'type':Sequelize[_0xaf3a('0x4')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0xaf3a('0x2')]},'destcalleridname':{'type':Sequelize[_0xaf3a('0x2')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0xaf3a('0x2')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0xaf3a('0x2')]},'destexten':{'type':Sequelize[_0xaf3a('0x2')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0xaf3a('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xaf3a('0x2')]},'answeredelsewheremembername':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0xaf3a('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xaf3a('0x2')],'comment':_0xaf3a('0x6')},'transferexten':{'type':Sequelize[_0xaf3a('0x2')]},'transferuniqueid':{'type':Sequelize['STRING']},'agententerreason':{'type':Sequelize[_0xaf3a('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0xd509=['FORWARD,\x20BLIND,\x20ATTENDED','STRING','DATE','INTEGER','BOOLEAN'];(function(_0xd250ec,_0x446153){var _0x108b01=function(_0x3ce68f){while(--_0x3ce68f){_0xd250ec['push'](_0xd250ec['shift']());}};_0x108b01(++_0x446153);}(_0xd509,0xc9));var _0x9d50=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd509[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x9d50('0x0')]},'uniqueid':{'type':Sequelize[_0x9d50('0x0')]},'calleridnum':{'type':Sequelize[_0x9d50('0x0')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x9d50('0x0')]},'membername':{'type':Sequelize[_0x9d50('0x0')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0x9d50('0x1')]},'agentcompleteAt':{'type':Sequelize[_0x9d50('0x1')]},'agentringnoanswerAt':{'type':Sequelize[_0x9d50('0x1')]},'agentdumpAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0x9d50('0x2')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x9d50('0x3')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x9d50('0x3')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x9d50('0x2')]},'agentacw':{'type':Sequelize[_0x9d50('0x3')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x9d50('0x2')]},'reason':{'type':Sequelize['STRING']},'lastevent':{'type':Sequelize[_0x9d50('0x0')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x9d50('0x0')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x9d50('0x0')]},'language':{'type':Sequelize[_0x9d50('0x0')]},'accountcode':{'type':Sequelize[_0x9d50('0x0')]},'context':{'type':Sequelize[_0x9d50('0x0')]},'exten':{'type':Sequelize[_0x9d50('0x0')]},'priority':{'type':Sequelize[_0x9d50('0x0')]},'destchannel':{'type':Sequelize[_0x9d50('0x0')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0x9d50('0x0')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x9d50('0x0')]},'destconnectedlinenum':{'type':Sequelize[_0x9d50('0x0')]},'destconnectedlinename':{'type':Sequelize[_0x9d50('0x0')]},'destlanguage':{'type':Sequelize[_0x9d50('0x0')]},'destaccountcode':{'type':Sequelize[_0x9d50('0x0')]},'destcontext':{'type':Sequelize[_0x9d50('0x0')]},'destexten':{'type':Sequelize[_0x9d50('0x0')]},'destpriority':{'type':Sequelize[_0x9d50('0x0')]},'destuniqueid':{'type':Sequelize[_0x9d50('0x0')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x9d50('0x0')]},'answeredelsewheremembername':{'type':Sequelize[_0x9d50('0x0')]},'transfer':{'type':Sequelize[_0x9d50('0x3')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0x9d50('0x4')},'transferexten':{'type':Sequelize[_0x9d50('0x0')]},'transferuniqueid':{'type':Sequelize[_0x9d50('0x0')]},'agententerreason':{'type':Sequelize[_0x9d50('0x2')],'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 08b2584..2154b3d 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(_0x56916d,_0x37b935){var _0x2b7f1f=function(_0x206eb1){while(--_0x206eb1){_0x56916d['push'](_0x56916d['shift']());}};_0x2b7f1f(++_0x37b935);}(_0xa9e0,0x123));var _0x0a9e=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0xa9e0[_0x934425];return _0x31d596;};'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(_0x1203f,_0x554bbc){var _0x365f0a=function(_0x3531d0){while(--_0x3531d0){_0x1203f['push'](_0x1203f['shift']());}};_0x365f0a(++_0x554bbc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xa9e0[_0x4cf98e];return _0x1623ac;};'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 ee3e04d..2fd6aeb 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 _0x14f5=['./voiceAgentReport.attributes','exports','define','VoiceAgentReport','report_agent','destuniqueid','util','api','moment','bluebird','path','rimraf'];(function(_0x5d6fa2,_0x384022){var _0x2e5a96=function(_0x2d95c8){while(--_0x2d95c8){_0x5d6fa2['push'](_0x5d6fa2['shift']());}};_0x2e5a96(++_0x384022);}(_0x14f5,0xae));var _0x514f=function(_0x367059,_0x13299d){_0x367059=_0x367059-0x0;var _0x336f1f=_0x14f5[_0x367059];return _0x336f1f;};'use strict';var _=require('lodash');var util=require(_0x514f('0x0'));var logger=require('../../config/logger')(_0x514f('0x1'));var moment=require(_0x514f('0x2'));var BPromise=require(_0x514f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x514f('0x4'));var rimraf=require(_0x514f('0x5'));var config=require('../../config/environment');var attributes=require(_0x514f('0x6'));module[_0x514f('0x7')]=function(_0xc2ca56,_0x434452){return _0xc2ca56[_0x514f('0x8')](_0x514f('0x9'),attributes,{'tableName':_0x514f('0xa'),'paranoid':![],'indexes':[{'fields':['uniqueid',_0x514f('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6753=['define','VoiceAgentReport','report_agent','uniqueid','destuniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x133277,_0xb1d6b2){var _0x5b4a22=function(_0x484c26){while(--_0x484c26){_0x133277['push'](_0x133277['shift']());}};_0x5b4a22(++_0xb1d6b2);}(_0x6753,0xa1));var _0x3675=function(_0x1031e2,_0x5ee7a9){_0x1031e2=_0x1031e2-0x0;var _0x55408a=_0x6753[_0x1031e2];return _0x55408a;};'use strict';var _=require(_0x3675('0x0'));var util=require(_0x3675('0x1'));var logger=require(_0x3675('0x2'))(_0x3675('0x3'));var moment=require('moment');var BPromise=require(_0x3675('0x4'));var rp=require(_0x3675('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3675('0x6'));var config=require(_0x3675('0x7'));var attributes=require('./voiceAgentReport.attributes');module['exports']=function(_0x4e4e73,_0x396a35){return _0x4e4e73[_0x3675('0x8')](_0x3675('0x9'),attributes,{'tableName':_0x3675('0xa'),'paranoid':![],'indexes':[{'fields':[_0x3675('0xb'),_0x3675('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index 8880a62..f80a514 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 _0x9bee=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','VoiceAgentReport,\x20%s,\x20%s','VoiceAgentReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','CreateVoiceAgentReport','VoiceAgentReport','create','body','options','raw','debug','catch','UpdateVoiceAgentReport','update','where','attributes','limit','moment','bluebird'];(function(_0x1db831,_0x42b7b5){var _0x39ba56=function(_0x2c2dd3){while(--_0x2c2dd3){_0x1db831['push'](_0x1db831['shift']());}};_0x39ba56(++_0x42b7b5);}(_0x9bee,0x64));var _0xe9be=function(_0x1836e1,_0xd988ef){_0x1836e1=_0x1836e1-0x0;var _0x1fcbc4=_0x9bee[_0x1836e1];return _0x1fcbc4;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe9be('0x0'));var BPromise=require(_0xe9be('0x1'));var rs=require(_0xe9be('0x2'));var fs=require('fs');var Redis=require(_0xe9be('0x3'));var db=require(_0xe9be('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xe9be('0x5'))(_0xe9be('0x6'));var config=require(_0xe9be('0x7'));var jayson=require(_0xe9be('0x8'));var client=jayson[_0xe9be('0x9')][_0xe9be('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15de09,_0x553b1e,_0x77d8e4){return new BPromise(function(_0x582e1a,_0x1b986e){return client['request'](_0x15de09,_0x77d8e4)[_0xe9be('0xb')](function(_0x167dc8){logger[_0xe9be('0xc')](_0xe9be('0xd'),_0x553b1e,'request\x20sent');logger['debug'](_0xe9be('0xe'),_0x553b1e,_0xe9be('0xf'),JSON[_0xe9be('0x10')](_0x167dc8));if(_0x167dc8['error']){if(_0x167dc8[_0xe9be('0x11')][_0xe9be('0x12')]===0x1f4){logger['error'](_0xe9be('0xd'),_0x553b1e,_0x167dc8[_0xe9be('0x11')][_0xe9be('0x13')]);return _0x1b986e(_0x167dc8[_0xe9be('0x11')][_0xe9be('0x13')]);}logger['error'](_0xe9be('0xd'),_0x553b1e,_0x167dc8[_0xe9be('0x11')][_0xe9be('0x13')]);return _0x582e1a(_0x167dc8[_0xe9be('0x11')][_0xe9be('0x13')]);}else{logger[_0xe9be('0xc')](_0xe9be('0xd'),_0x553b1e,_0xe9be('0xf'));_0x582e1a(_0x167dc8[_0xe9be('0x14')][_0xe9be('0x13')]);}})['catch'](function(_0x429faf){logger[_0xe9be('0x11')](_0xe9be('0xd'),_0x553b1e,_0x429faf);_0x1b986e(_0x429faf);});});}exports[_0xe9be('0x15')]=function(_0x1a7d67){var _0x1b2fe4=this;return new Promise(function(_0x2dd4a8,_0x1081b4){return db[_0xe9be('0x16')][_0xe9be('0x17')](_0x1a7d67[_0xe9be('0x18')],{'raw':_0x1a7d67[_0xe9be('0x19')]?_0x1a7d67[_0xe9be('0x19')][_0xe9be('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x37671b){logger[_0xe9be('0xc')](_0xe9be('0x15'),_0x1a7d67);logger[_0xe9be('0x1b')](_0xe9be('0x15'),_0x1a7d67,JSON[_0xe9be('0x10')](_0x37671b));_0x2dd4a8(_0x37671b);})[_0xe9be('0x1c')](function(_0x7bffe){logger[_0xe9be('0x11')](_0xe9be('0x15'),_0x7bffe['message'],_0x1a7d67);_0x1081b4(_0x1b2fe4[_0xe9be('0x11')](0x1f4,_0x7bffe['message']));});});};exports[_0xe9be('0x1d')]=function(_0x3f43cc){var _0x409229=this;return new Promise(function(_0x59e3e4,_0x25cda1){return db[_0xe9be('0x16')][_0xe9be('0x1e')](_0x3f43cc[_0xe9be('0x18')],{'raw':_0x3f43cc[_0xe9be('0x19')]?_0x3f43cc[_0xe9be('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f43cc[_0xe9be('0x19')]?_0x3f43cc[_0xe9be('0x19')][_0xe9be('0x1f')]||null:null,'attributes':_0x3f43cc[_0xe9be('0x19')]?_0x3f43cc[_0xe9be('0x19')][_0xe9be('0x20')]||null:null,'limit':_0x3f43cc[_0xe9be('0x19')]?_0x3f43cc[_0xe9be('0x19')][_0xe9be('0x21')]||null:null})[_0xe9be('0xb')](function(_0x269c2e){logger[_0xe9be('0xc')]('UpdateVoiceAgentReport',_0x3f43cc);logger[_0xe9be('0x1b')](_0xe9be('0x1d'),_0x3f43cc,JSON[_0xe9be('0x10')](_0x269c2e));_0x59e3e4(_0x269c2e);})['catch'](function(_0x28ea11){logger[_0xe9be('0x11')](_0xe9be('0x1d'),_0x28ea11['message'],_0x3f43cc);_0x25cda1(_0x409229['error'](0x1f4,_0x28ea11['message']));});});}; \ No newline at end of file +var _0x1264=['create','body','options','raw','catch','VoiceAgentReport','where','attributes','limit','UpdateVoiceAgentReport','lodash','util','moment','bluebird','../../config/utils','rpc','client','http','request','then','info','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceAgentReport,\x20%s,\x20%s','message','result','CreateVoiceAgentReport'];(function(_0x197683,_0x21df72){var _0x137639=function(_0x46b902){while(--_0x46b902){_0x197683['push'](_0x197683['shift']());}};_0x137639(++_0x21df72);}(_0x1264,0x102));var _0x4126=function(_0xabfec4,_0x35076e){_0xabfec4=_0xabfec4-0x0;var _0x7bafa2=_0x1264[_0xabfec4];return _0x7bafa2;};'use strict';var _=require(_0x4126('0x0'));var util=require(_0x4126('0x1'));var moment=require(_0x4126('0x2'));var BPromise=require(_0x4126('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4126('0x4'));var logger=require('../../config/logger')(_0x4126('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4126('0x6')][_0x4126('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x47f545,_0x4058d5,_0x1ae51a){return new BPromise(function(_0x4c65aa,_0x1a176b){return client[_0x4126('0x8')](_0x47f545,_0x1ae51a)[_0x4126('0x9')](function(_0x3c4f12){logger[_0x4126('0xa')]('VoiceAgentReport,\x20%s,\x20%s',_0x4058d5,_0x4126('0xb'));logger[_0x4126('0xc')](_0x4126('0xd'),_0x4058d5,_0x4126('0xb'),JSON[_0x4126('0xe')](_0x3c4f12));if(_0x3c4f12[_0x4126('0xf')]){if(_0x3c4f12['error'][_0x4126('0x10')]===0x1f4){logger[_0x4126('0xf')](_0x4126('0x11'),_0x4058d5,_0x3c4f12[_0x4126('0xf')][_0x4126('0x12')]);return _0x1a176b(_0x3c4f12[_0x4126('0xf')]['message']);}logger[_0x4126('0xf')](_0x4126('0x11'),_0x4058d5,_0x3c4f12[_0x4126('0xf')][_0x4126('0x12')]);return _0x4c65aa(_0x3c4f12[_0x4126('0xf')]['message']);}else{logger[_0x4126('0xa')]('VoiceAgentReport,\x20%s,\x20%s',_0x4058d5,_0x4126('0xb'));_0x4c65aa(_0x3c4f12[_0x4126('0x13')][_0x4126('0x12')]);}})['catch'](function(_0x123b15){logger[_0x4126('0xf')]('VoiceAgentReport,\x20%s,\x20%s',_0x4058d5,_0x123b15);_0x1a176b(_0x123b15);});});}exports[_0x4126('0x14')]=function(_0x4baecc){var _0x47e05a=this;return new Promise(function(_0x124b84,_0x4e53fd){return db['VoiceAgentReport'][_0x4126('0x15')](_0x4baecc[_0x4126('0x16')],{'raw':_0x4baecc[_0x4126('0x17')]?_0x4baecc[_0x4126('0x17')][_0x4126('0x18')]===undefined?!![]:![]:!![]})[_0x4126('0x9')](function(_0x2c0216){logger[_0x4126('0xa')](_0x4126('0x14'),_0x4baecc);logger[_0x4126('0xc')]('CreateVoiceAgentReport',_0x4baecc,JSON[_0x4126('0xe')](_0x2c0216));_0x124b84(_0x2c0216);})[_0x4126('0x19')](function(_0x532b26){logger['error'](_0x4126('0x14'),_0x532b26['message'],_0x4baecc);_0x4e53fd(_0x47e05a['error'](0x1f4,_0x532b26[_0x4126('0x12')]));});});};exports['UpdateVoiceAgentReport']=function(_0x259e8f){var _0x4d8ad8=this;return new Promise(function(_0x105a9e,_0x55667d){return db[_0x4126('0x1a')]['update'](_0x259e8f[_0x4126('0x16')],{'raw':_0x259e8f[_0x4126('0x17')]?_0x259e8f['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x259e8f[_0x4126('0x17')]?_0x259e8f[_0x4126('0x17')][_0x4126('0x1b')]||null:null,'attributes':_0x259e8f[_0x4126('0x17')]?_0x259e8f[_0x4126('0x17')][_0x4126('0x1c')]||null:null,'limit':_0x259e8f['options']?_0x259e8f['options'][_0x4126('0x1d')]||null:null})[_0x4126('0x9')](function(_0x387418){logger[_0x4126('0xa')](_0x4126('0x1e'),_0x259e8f);logger[_0x4126('0xc')](_0x4126('0x1e'),_0x259e8f,JSON['stringify'](_0x387418));_0x105a9e(_0x387418);})['catch'](function(_0x61b35f){logger['error'](_0x4126('0x1e'),_0x61b35f[_0x4126('0x12')],_0x259e8f);_0x55667d(_0x4d8ad8['error'](0x1f4,_0x61b35f[_0x4126('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index 3dbfb1b..24dcbe3 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 _0x84ab=['util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./voiceCallReport.controller','get','/describe','describe','isAuthenticated','post','create','update','delete','/:id','destroy','multer'];(function(_0x3a87d1,_0x584e71){var _0x3aa6d8=function(_0x1e1417){while(--_0x1e1417){_0x3a87d1['push'](_0x3a87d1['shift']());}};_0x3aa6d8(++_0x584e71);}(_0x84ab,0x12f));var _0xb84a=function(_0x10e983,_0x2f4eda){_0x10e983=_0x10e983-0x0;var _0x324138=_0x84ab[_0x10e983];return _0x324138;};'use strict';var multer=require(_0xb84a('0x0'));var util=require(_0xb84a('0x1'));var path=require(_0xb84a('0x2'));var timeout=require(_0xb84a('0x3'));var express=require(_0xb84a('0x4'));var router=express['Router']();var fs_extra=require(_0xb84a('0x5'));var auth=require(_0xb84a('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xb84a('0x7'));var controller=require(_0xb84a('0x8'));router[_0xb84a('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xb84a('0xa'),auth['isAuthenticated'](),controller[_0xb84a('0xb')]);router[_0xb84a('0x9')]('/:id',auth[_0xb84a('0xc')](),controller['show']);router[_0xb84a('0xd')]('/',auth[_0xb84a('0xc')](),controller[_0xb84a('0xe')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xb84a('0xf')]);router[_0xb84a('0x10')](_0xb84a('0x11'),auth[_0xb84a('0xc')](),controller[_0xb84a('0x12')]);module['exports']=router; \ No newline at end of file +var _0xf69d=['./voiceCallReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','multer','util','path','connect-timeout','express','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);}(_0xf69d,0xd3));var _0xdf69=function(_0x51f454,_0x39e838){_0x51f454=_0x51f454-0x0;var _0x2ba9cb=_0xf69d[_0x51f454];return _0x2ba9cb;};'use strict';var multer=require(_0xdf69('0x0'));var util=require(_0xdf69('0x1'));var path=require(_0xdf69('0x2'));var timeout=require(_0xdf69('0x3'));var express=require(_0xdf69('0x4'));var router=express['Router']();var fs_extra=require(_0xdf69('0x5'));var auth=require(_0xdf69('0x6'));var interaction=require(_0xdf69('0x7'));var config=require(_0xdf69('0x8'));var controller=require(_0xdf69('0x9'));router[_0xdf69('0xa')]('/',auth[_0xdf69('0xb')](),controller[_0xdf69('0xc')]);router[_0xdf69('0xa')](_0xdf69('0xd'),auth[_0xdf69('0xb')](),controller[_0xdf69('0xe')]);router[_0xdf69('0xa')](_0xdf69('0xf'),auth[_0xdf69('0xb')](),controller[_0xdf69('0x10')]);router[_0xdf69('0x11')]('/',auth['isAuthenticated'](),controller[_0xdf69('0x12')]);router[_0xdf69('0x13')](_0xdf69('0xf'),auth[_0xdf69('0xb')](),controller[_0xdf69('0x14')]);router[_0xdf69('0x15')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index a42fb08..c4e6117 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 _0xf29c=['STRING','inbound','inbound-fax','dialer','TEXT','DATE','INTEGER','sequelize','exports'];(function(_0x30bf81,_0x4c00c5){var _0x148a30=function(_0x320430){while(--_0x320430){_0x30bf81['push'](_0x30bf81['shift']());}};_0x148a30(++_0x4c00c5);}(_0xf29c,0xf1));var _0xcf29=function(_0xcde8ed,_0x27b300){_0xcde8ed=_0xcde8ed-0x0;var _0x3492b8=_0xf29c[_0xcde8ed];return _0x3492b8;};'use strict';var Sequelize=require(_0xcf29('0x0'));module[_0xcf29('0x1')]={'uniqueid':{'type':Sequelize[_0xcf29('0x2')]},'type':{'type':Sequelize['ENUM'](_0xcf29('0x3'),'internal','outbound',_0xcf29('0x4'),'outbound-fax',_0xcf29('0x5'))},'tag':{'type':Sequelize[_0xcf29('0x2')]},'accountcode':{'type':Sequelize['STRING']},'source':{'type':Sequelize[_0xcf29('0x2')]},'destination':{'type':Sequelize[_0xcf29('0x2')]},'destinationcontext':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xcf29('0x2')]},'channel':{'type':Sequelize[_0xcf29('0x2')]},'destinationchannel':{'type':Sequelize[_0xcf29('0x2')]},'lastapplication':{'type':Sequelize[_0xcf29('0x2')]},'lastdata':{'type':Sequelize[_0xcf29('0x6')]},'starttime':{'type':Sequelize[_0xcf29('0x7')]},'systemanswertime':{'type':Sequelize[_0xcf29('0x7')]},'answertime':{'type':Sequelize[_0xcf29('0x7')]},'endtime':{'type':Sequelize[_0xcf29('0x7')]},'duration':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize[_0xcf29('0x8')]},'mohtime':{'type':Sequelize[_0xcf29('0x8')],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0xcf29('0x2')]},'userfield':{'type':Sequelize[_0xcf29('0x2')]},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0xcf29('0x2')]},'userThirdDisposition':{'type':Sequelize[_0xcf29('0x2')]},'note':{'type':Sequelize[_0xcf29('0x2')]},'prefix':{'type':Sequelize[_0xcf29('0x2')]},'routeid':{'type':Sequelize[_0xcf29('0x8')]},'sipcallid':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x696e=['INTEGER','sequelize','STRING','ENUM','internal','outbound','dialer','DATE'];(function(_0x149041,_0x140e26){var _0x4b99f6=function(_0x3dea54){while(--_0x3dea54){_0x149041['push'](_0x149041['shift']());}};_0x4b99f6(++_0x140e26);}(_0x696e,0x1d1));var _0xe696=function(_0x2a6817,_0x8c7aa3){_0x2a6817=_0x2a6817-0x0;var _0x294cf8=_0x696e[_0x2a6817];return _0x294cf8;};'use strict';var Sequelize=require(_0xe696('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xe696('0x1')]},'type':{'type':Sequelize[_0xe696('0x2')]('inbound',_0xe696('0x3'),_0xe696('0x4'),'inbound-fax','outbound-fax',_0xe696('0x5'))},'tag':{'type':Sequelize[_0xe696('0x1')]},'accountcode':{'type':Sequelize['STRING']},'source':{'type':Sequelize[_0xe696('0x1')]},'destination':{'type':Sequelize['STRING']},'destinationcontext':{'type':Sequelize[_0xe696('0x1')]},'callerid':{'type':Sequelize[_0xe696('0x1')]},'channel':{'type':Sequelize[_0xe696('0x1')]},'destinationchannel':{'type':Sequelize[_0xe696('0x1')]},'lastapplication':{'type':Sequelize[_0xe696('0x1')]},'lastdata':{'type':Sequelize['TEXT']},'starttime':{'type':Sequelize[_0xe696('0x6')]},'systemanswertime':{'type':Sequelize[_0xe696('0x6')]},'answertime':{'type':Sequelize[_0xe696('0x6')]},'endtime':{'type':Sequelize[_0xe696('0x6')]},'duration':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize[_0xe696('0x7')]},'mohtime':{'type':Sequelize[_0xe696('0x7')],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0xe696('0x1')]},'userfield':{'type':Sequelize[_0xe696('0x1')]},'userDisposition':{'type':Sequelize[_0xe696('0x1')]},'userSecondDisposition':{'type':Sequelize[_0xe696('0x1')]},'userThirdDisposition':{'type':Sequelize[_0xe696('0x1')]},'note':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0xe696('0x1')]},'routeid':{'type':Sequelize['INTEGER']},'sipcallid':{'type':Sequelize[_0xe696('0x1')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index f6c6be6..656d663 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 _0x0b0e=['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','VoiceCallReport','rawAttributes','fieldName','type','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','merge','where','VIRTUAL','options','count','includeAll','fullname','alias','User','findAll','rows','params','find','create','body','catch','describe','update','uniqueid','user','eml-format','zip-dir','request-promise','moment'];(function(_0x4e4eea,_0x598d81){var _0xf52a6e=function(_0x1e5cc9){while(--_0x1e5cc9){_0x4e4eea['push'](_0x4e4eea['shift']());}};_0xf52a6e(++_0x598d81);}(_0x0b0e,0x187));var _0xe0b0=function(_0x46ae5a,_0x2a38d0){_0x46ae5a=_0x46ae5a-0x0;var _0x434986=_0x0b0e[_0x46ae5a];return _0x434986;};'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['VoiceCallReport'][_0xe0b0('0x3f')](_0x115a69)['then'](function(_0x34178d){_0x36d137[_0xe0b0('0x3f')]=_0x34178d;if(_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x40')]){_0x15e13b['include']=[{'attributes':['id',_0xe0b0('0x27'),_0xe0b0('0x41'),_0xe0b0('0x42')],'model':db[_0xe0b0('0x43')],'as':_0xe0b0('0x43')}];}return db[_0xe0b0('0x2a')][_0xe0b0('0x44')](_0x15e13b);})[_0xe0b0('0x23')](function(_0x52ffe4){_0x36d137[_0xe0b0('0x45')]=_0x52ffe4;return _0x36d137;})[_0xe0b0('0x23')](respondWithFilteredResult(_0x5b7a64,_0x15e13b))['catch'](handleError(_0x5b7a64,null));};exports['show']=function(_0x327fb4,_0x247f8d){var _0x56e7df={'raw':!![],'where':{'id':_0x327fb4[_0xe0b0('0x46')]['id']}},_0x18a59d={};_0x18a59d[_0xe0b0('0x31')]=_[_0xe0b0('0x2f')](db[_0xe0b0('0x2a')]['rawAttributes']);_0x18a59d['query']=_['keys'](_0x327fb4[_0xe0b0('0x2e')]);_0x18a59d[_0xe0b0('0x39')]=_['intersection'](_0x18a59d[_0xe0b0('0x31')],_0x18a59d[_0xe0b0('0x2e')]);_0x56e7df[_0xe0b0('0x32')]=_[_0xe0b0('0x30')](_0x18a59d[_0xe0b0('0x31')],qs['fields'](_0x327fb4['query'][_0xe0b0('0x33')]));_0x56e7df[_0xe0b0('0x32')]=_0x56e7df[_0xe0b0('0x32')][_0xe0b0('0x34')]?_0x56e7df[_0xe0b0('0x32')]:_0x18a59d['model'];if(_0x327fb4[_0xe0b0('0x2e')][_0xe0b0('0x40')]){_0x56e7df['include']=[{'all':!![]}];}_0x56e7df=_['merge']({},_0x56e7df,_0x327fb4['options']);return db[_0xe0b0('0x2a')][_0xe0b0('0x47')](_0x56e7df)[_0xe0b0('0x23')](handleEntityNotFound(_0x247f8d,null))[_0xe0b0('0x23')](respondWithResult(_0x247f8d,null))['catch'](handleError(_0x247f8d,null));};exports[_0xe0b0('0x48')]=function(_0x87d8f3,_0x483f12){return db['VoiceCallReport'][_0xe0b0('0x48')](_0x87d8f3[_0xe0b0('0x49')],{})['then'](respondWithResult(_0x483f12,0xc9))[_0xe0b0('0x4a')](handleError(_0x483f12,null));};exports[_0xe0b0('0x24')]=function(_0x504284,_0x5cb2b6){return db[_0xe0b0('0x2a')]['find']({'where':{'id':_0x504284[_0xe0b0('0x46')]['id']}})[_0xe0b0('0x23')](handleEntityNotFound(_0x5cb2b6,null))[_0xe0b0('0x23')](removeEntity(_0x5cb2b6,null))[_0xe0b0('0x4a')](handleError(_0x5cb2b6,null));};exports[_0xe0b0('0x4b')]=function(_0xf9e694,_0x5f5486){return db['VoiceCallReport'][_0xe0b0('0x4b')]()['then'](respondWithResult(_0x5f5486,null))['catch'](handleError(_0x5f5486,null));};exports[_0xe0b0('0x4c')]=function(_0x222174,_0x54cf7b){if(_0x222174['body'][_0xe0b0('0x4d')]){delete _0x222174[_0xe0b0('0x49')][_0xe0b0('0x4d')];}return db[_0xe0b0('0x2a')][_0xe0b0('0x47')]({'where':{'uniqueid':_0x222174[_0xe0b0('0x46')]['id'],'UserId':{'$or':[null,_0x222174[_0xe0b0('0x4e')]['id']]}}})['then'](handleEntityNotFound(_0x54cf7b,null))[_0xe0b0('0x23')](saveUpdates(_0x222174['body'],null))[_0xe0b0('0x23')](respondWithResult(_0x54cf7b,null))['catch'](handleError(_0x54cf7b,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(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0x2ef3,0xba));var _0x32ef=function(_0x59ca9e,_0x31074b){_0x59ca9e=_0x59ca9e-0x0;var _0x56e7ea=_0x2ef3[_0x59ca9e];return _0x56e7ea;};'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 8c79856..88b5a29 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 _0x8d6b=['../../config/environment','./voiceCallReport.attributes','VoiceCallReport','report_call','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x4f5318,_0x5f13a1){var _0x2f09db=function(_0x13c00d){while(--_0x13c00d){_0x4f5318['push'](_0x4f5318['shift']());}};_0x2f09db(++_0x5f13a1);}(_0x8d6b,0x124));var _0xb8d6=function(_0x2034eb,_0x395619){_0x2034eb=_0x2034eb-0x0;var _0x1a7dba=_0x8d6b[_0x2034eb];return _0x1a7dba;};'use strict';var _=require(_0xb8d6('0x0'));var util=require(_0xb8d6('0x1'));var logger=require(_0xb8d6('0x2'))(_0xb8d6('0x3'));var moment=require(_0xb8d6('0x4'));var BPromise=require('bluebird');var rp=require(_0xb8d6('0x5'));var fs=require('fs');var path=require(_0xb8d6('0x6'));var rimraf=require(_0xb8d6('0x7'));var config=require(_0xb8d6('0x8'));var attributes=require(_0xb8d6('0x9'));module['exports']=function(_0x2a40a2,_0x1b38fa){return _0x2a40a2['define'](_0xb8d6('0xa'),attributes,{'tableName':_0xb8d6('0xb'),'paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xdf6d=['report_call','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','VoiceCallReport'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xdf6d,0x15e));var _0xddf6=function(_0x18cc69,_0x475ffa){_0x18cc69=_0x18cc69-0x0;var _0x5c0dfc=_0xdf6d[_0x18cc69];return _0x5c0dfc;};'use strict';var _=require(_0xddf6('0x0'));var util=require('util');var logger=require(_0xddf6('0x1'))(_0xddf6('0x2'));var moment=require(_0xddf6('0x3'));var BPromise=require(_0xddf6('0x4'));var rp=require(_0xddf6('0x5'));var fs=require('fs');var path=require(_0xddf6('0x6'));var rimraf=require(_0xddf6('0x7'));var config=require(_0xddf6('0x8'));var attributes=require('./voiceCallReport.attributes');module['exports']=function(_0x571842,_0x33fdfd){return _0x571842['define'](_0xddf6('0x9'),attributes,{'tableName':_0xddf6('0xa'),'paranoid':![],'indexes':[{'fields':[_0xddf6('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index 4bc7006..9547cda 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 _0x2c36=['options','raw','where','attributes','limit','include','map','model','GetVoiceCallReport','debug','CreateVoiceCallReport','create','body','UpdateVoiceCallReport','update','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','VoiceCallReport,\x20%s,\x20%s','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','result','catch','VoiceCallReport','findAll'];(function(_0x125c6b,_0x3396bd){var _0x49b36f=function(_0x14a408){while(--_0x14a408){_0x125c6b['push'](_0x125c6b['shift']());}};_0x49b36f(++_0x3396bd);}(_0x2c36,0x177));var _0x62c3=function(_0x145b3c,_0x31ea4a){_0x145b3c=_0x145b3c-0x0;var _0x1b6e36=_0x2c36[_0x145b3c];return _0x1b6e36;};'use strict';var _=require(_0x62c3('0x0'));var util=require('util');var moment=require(_0x62c3('0x1'));var BPromise=require(_0x62c3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x62c3('0x3'));var db=require(_0x62c3('0x4'))['db'];var utils=require(_0x62c3('0x5'));var logger=require(_0x62c3('0x6'))(_0x62c3('0x7'));var config=require('../../config/environment');var jayson=require(_0x62c3('0x8'));var client=jayson[_0x62c3('0x9')][_0x62c3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3fc103,_0x207941,_0x678aa6){return new BPromise(function(_0x410c82,_0x1b6c83){return client[_0x62c3('0xb')](_0x3fc103,_0x678aa6)[_0x62c3('0xc')](function(_0x3bccc0){logger['info'](_0x62c3('0xd'),_0x207941,'request\x20sent');logger['debug'](_0x62c3('0xe'),_0x207941,'request\x20sent',JSON[_0x62c3('0xf')](_0x3bccc0));if(_0x3bccc0['error']){if(_0x3bccc0[_0x62c3('0x10')][_0x62c3('0x11')]===0x1f4){logger['error'](_0x62c3('0xd'),_0x207941,_0x3bccc0[_0x62c3('0x10')][_0x62c3('0x12')]);return _0x1b6c83(_0x3bccc0[_0x62c3('0x10')][_0x62c3('0x12')]);}logger[_0x62c3('0x10')](_0x62c3('0xd'),_0x207941,_0x3bccc0['error'][_0x62c3('0x12')]);return _0x410c82(_0x3bccc0[_0x62c3('0x10')][_0x62c3('0x12')]);}else{logger[_0x62c3('0x13')]('VoiceCallReport,\x20%s,\x20%s',_0x207941,_0x62c3('0x14'));_0x410c82(_0x3bccc0[_0x62c3('0x15')][_0x62c3('0x12')]);}})[_0x62c3('0x16')](function(_0x39d950){logger[_0x62c3('0x10')](_0x62c3('0xd'),_0x207941,_0x39d950);_0x1b6c83(_0x39d950);});});}exports['GetVoiceCallReport']=function(_0x17b42a){var _0x4546e8=this;return new Promise(function(_0x4c4fe4,_0x5e68bb){return db[_0x62c3('0x17')][_0x62c3('0x18')]({'raw':_0x17b42a[_0x62c3('0x19')]?_0x17b42a[_0x62c3('0x19')][_0x62c3('0x1a')]===undefined?!![]:![]:!![],'where':_0x17b42a[_0x62c3('0x19')]?_0x17b42a['options'][_0x62c3('0x1b')]||null:null,'attributes':_0x17b42a[_0x62c3('0x19')]?_0x17b42a[_0x62c3('0x19')][_0x62c3('0x1c')]||null:null,'limit':_0x17b42a[_0x62c3('0x19')]?_0x17b42a[_0x62c3('0x19')][_0x62c3('0x1d')]||null:null,'include':_0x17b42a[_0x62c3('0x19')]?_0x17b42a['options'][_0x62c3('0x1e')]?_[_0x62c3('0x1f')](_0x17b42a[_0x62c3('0x19')][_0x62c3('0x1e')],function(_0x4d753b){return{'model':db[_0x4d753b[_0x62c3('0x20')]],'as':_0x4d753b['as'],'attributes':_0x4d753b['attributes'],'include':_0x4d753b[_0x62c3('0x1e')]?_['map'](_0x4d753b[_0x62c3('0x1e')],function(_0x1fbc27){return{'model':db[_0x1fbc27[_0x62c3('0x20')]],'as':_0x1fbc27['as'],'attributes':_0x1fbc27[_0x62c3('0x1c')],'include':_0x1fbc27[_0x62c3('0x1e')]?_[_0x62c3('0x1f')](_0x1fbc27['include'],function(_0x22b6a1){return{'model':db[_0x22b6a1[_0x62c3('0x20')]],'as':_0x22b6a1['as'],'attributes':_0x22b6a1[_0x62c3('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x62c3('0xc')](function(_0x31966d){logger[_0x62c3('0x13')](_0x62c3('0x21'),_0x17b42a);logger[_0x62c3('0x22')]('GetVoiceCallReport',_0x17b42a,JSON[_0x62c3('0xf')](_0x31966d));_0x4c4fe4(_0x31966d);})[_0x62c3('0x16')](function(_0x5bf0d6){logger[_0x62c3('0x10')](_0x62c3('0x21'),_0x5bf0d6[_0x62c3('0x12')],_0x17b42a);_0x5e68bb(_0x4546e8[_0x62c3('0x10')](0x1f4,_0x5bf0d6[_0x62c3('0x12')]));});});};exports[_0x62c3('0x23')]=function(_0x281c86){var _0x107b6d=this;return new Promise(function(_0x128ae3,_0x7024ce){return db[_0x62c3('0x17')][_0x62c3('0x24')](_0x281c86[_0x62c3('0x25')],{'raw':_0x281c86['options']?_0x281c86[_0x62c3('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x62c3('0xc')](function(_0x4afdca){logger[_0x62c3('0x13')]('CreateVoiceCallReport',_0x281c86);logger[_0x62c3('0x22')](_0x62c3('0x23'),_0x281c86,JSON[_0x62c3('0xf')](_0x4afdca));_0x128ae3(_0x4afdca);})[_0x62c3('0x16')](function(_0x730add){logger[_0x62c3('0x10')](_0x62c3('0x23'),_0x730add[_0x62c3('0x12')],_0x281c86);_0x7024ce(_0x107b6d['error'](0x1f4,_0x730add[_0x62c3('0x12')]));});});};exports[_0x62c3('0x26')]=function(_0x415a76){var _0x53e6b9=this;return new Promise(function(_0x36ba24,_0x27b75c){return db['VoiceCallReport'][_0x62c3('0x27')](_0x415a76[_0x62c3('0x25')],{'raw':_0x415a76[_0x62c3('0x19')]?_0x415a76[_0x62c3('0x19')][_0x62c3('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x415a76[_0x62c3('0x19')]?_0x415a76[_0x62c3('0x19')][_0x62c3('0x1b')]||null:null,'attributes':_0x415a76[_0x62c3('0x19')]?_0x415a76[_0x62c3('0x19')]['attributes']||null:null,'limit':_0x415a76[_0x62c3('0x19')]?_0x415a76[_0x62c3('0x19')][_0x62c3('0x1d')]||null:null})['then'](function(_0x265e02){logger[_0x62c3('0x13')](_0x62c3('0x26'),_0x415a76);logger[_0x62c3('0x22')]('UpdateVoiceCallReport',_0x415a76,JSON['stringify'](_0x265e02));_0x36ba24(_0x265e02);})[_0x62c3('0x16')](function(_0xd2652b){logger[_0x62c3('0x10')](_0x62c3('0x26'),_0xd2652b[_0x62c3('0x12')],_0x415a76);_0x27b75c(_0x53e6b9[_0x62c3('0x10')](0x1f4,_0xd2652b[_0x62c3('0x12')]));});});}; \ No newline at end of file +var _0x1b7a=['../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceCallReport,\x20%s,\x20%s','message','result','catch','GetVoiceCallReport','VoiceCallReport','raw','options','where','map','include','model','attributes','CreateVoiceCallReport','UpdateVoiceCallReport','update','limit','util','bluebird','randomstring','ioredis'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1b7a,0x15a));var _0xa1b7=function(_0x2506db,_0x3a490a){_0x2506db=_0x2506db-0x0;var _0x198518=_0x1b7a[_0x2506db];return _0x198518;};'use strict';var _=require('lodash');var util=require(_0xa1b7('0x0'));var moment=require('moment');var BPromise=require(_0xa1b7('0x1'));var rs=require(_0xa1b7('0x2'));var fs=require('fs');var Redis=require(_0xa1b7('0x3'));var db=require(_0xa1b7('0x4'))['db'];var utils=require(_0xa1b7('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xa1b7('0x6'));var jayson=require(_0xa1b7('0x7'));var client=jayson[_0xa1b7('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x396abc,_0x4368ce,_0x927a79){return new BPromise(function(_0x1b0d05,_0x3e8ff2){return client[_0xa1b7('0x9')](_0x396abc,_0x927a79)[_0xa1b7('0xa')](function(_0x5b1ebf){logger[_0xa1b7('0xb')]('VoiceCallReport,\x20%s,\x20%s',_0x4368ce,_0xa1b7('0xc'));logger[_0xa1b7('0xd')](_0xa1b7('0xe'),_0x4368ce,_0xa1b7('0xc'),JSON[_0xa1b7('0xf')](_0x5b1ebf));if(_0x5b1ebf[_0xa1b7('0x10')]){if(_0x5b1ebf[_0xa1b7('0x10')][_0xa1b7('0x11')]===0x1f4){logger['error'](_0xa1b7('0x12'),_0x4368ce,_0x5b1ebf[_0xa1b7('0x10')][_0xa1b7('0x13')]);return _0x3e8ff2(_0x5b1ebf[_0xa1b7('0x10')][_0xa1b7('0x13')]);}logger['error'](_0xa1b7('0x12'),_0x4368ce,_0x5b1ebf[_0xa1b7('0x10')]['message']);return _0x1b0d05(_0x5b1ebf[_0xa1b7('0x10')][_0xa1b7('0x13')]);}else{logger[_0xa1b7('0xb')](_0xa1b7('0x12'),_0x4368ce,'request\x20sent');_0x1b0d05(_0x5b1ebf[_0xa1b7('0x14')][_0xa1b7('0x13')]);}})[_0xa1b7('0x15')](function(_0x1fba41){logger[_0xa1b7('0x10')](_0xa1b7('0x12'),_0x4368ce,_0x1fba41);_0x3e8ff2(_0x1fba41);});});}exports[_0xa1b7('0x16')]=function(_0x1322bf){var _0x28f55e=this;return new Promise(function(_0x57d2a0,_0x4ab00f){return db[_0xa1b7('0x17')]['findAll']({'raw':_0x1322bf['options']?_0x1322bf['options'][_0xa1b7('0x18')]===undefined?!![]:![]:!![],'where':_0x1322bf[_0xa1b7('0x19')]?_0x1322bf[_0xa1b7('0x19')][_0xa1b7('0x1a')]||null:null,'attributes':_0x1322bf[_0xa1b7('0x19')]?_0x1322bf[_0xa1b7('0x19')]['attributes']||null:null,'limit':_0x1322bf[_0xa1b7('0x19')]?_0x1322bf[_0xa1b7('0x19')]['limit']||null:null,'include':_0x1322bf[_0xa1b7('0x19')]?_0x1322bf[_0xa1b7('0x19')]['include']?_[_0xa1b7('0x1b')](_0x1322bf[_0xa1b7('0x19')][_0xa1b7('0x1c')],function(_0x58118a){return{'model':db[_0x58118a[_0xa1b7('0x1d')]],'as':_0x58118a['as'],'attributes':_0x58118a[_0xa1b7('0x1e')],'include':_0x58118a[_0xa1b7('0x1c')]?_[_0xa1b7('0x1b')](_0x58118a[_0xa1b7('0x1c')],function(_0x3ebfce){return{'model':db[_0x3ebfce[_0xa1b7('0x1d')]],'as':_0x3ebfce['as'],'attributes':_0x3ebfce[_0xa1b7('0x1e')],'include':_0x3ebfce[_0xa1b7('0x1c')]?_[_0xa1b7('0x1b')](_0x3ebfce['include'],function(_0x20c18f){return{'model':db[_0x20c18f[_0xa1b7('0x1d')]],'as':_0x20c18f['as'],'attributes':_0x20c18f['attributes']};}):[]};}):[]};}):[]:[]})[_0xa1b7('0xa')](function(_0x414d31){logger[_0xa1b7('0xb')](_0xa1b7('0x16'),_0x1322bf);logger[_0xa1b7('0xd')](_0xa1b7('0x16'),_0x1322bf,JSON[_0xa1b7('0xf')](_0x414d31));_0x57d2a0(_0x414d31);})['catch'](function(_0xb5d133){logger['error'](_0xa1b7('0x16'),_0xb5d133[_0xa1b7('0x13')],_0x1322bf);_0x4ab00f(_0x28f55e[_0xa1b7('0x10')](0x1f4,_0xb5d133[_0xa1b7('0x13')]));});});};exports[_0xa1b7('0x1f')]=function(_0x4defd){var _0x211a3c=this;return new Promise(function(_0xa0c5df,_0x4cf90e){return db['VoiceCallReport']['create'](_0x4defd['body'],{'raw':_0x4defd[_0xa1b7('0x19')]?_0x4defd['options'][_0xa1b7('0x18')]===undefined?!![]:![]:!![]})[_0xa1b7('0xa')](function(_0x552d35){logger[_0xa1b7('0xb')]('CreateVoiceCallReport',_0x4defd);logger[_0xa1b7('0xd')]('CreateVoiceCallReport',_0x4defd,JSON[_0xa1b7('0xf')](_0x552d35));_0xa0c5df(_0x552d35);})[_0xa1b7('0x15')](function(_0x20b217){logger[_0xa1b7('0x10')](_0xa1b7('0x1f'),_0x20b217['message'],_0x4defd);_0x4cf90e(_0x211a3c[_0xa1b7('0x10')](0x1f4,_0x20b217[_0xa1b7('0x13')]));});});};exports[_0xa1b7('0x20')]=function(_0x20b393){var _0xd1978d=this;return new Promise(function(_0xd2b397,_0x30ba7c){return db[_0xa1b7('0x17')][_0xa1b7('0x21')](_0x20b393['body'],{'raw':_0x20b393[_0xa1b7('0x19')]?_0x20b393['options'][_0xa1b7('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x20b393[_0xa1b7('0x19')]?_0x20b393[_0xa1b7('0x19')][_0xa1b7('0x1a')]||null:null,'attributes':_0x20b393[_0xa1b7('0x19')]?_0x20b393['options']['attributes']||null:null,'limit':_0x20b393[_0xa1b7('0x19')]?_0x20b393[_0xa1b7('0x19')][_0xa1b7('0x22')]||null:null})[_0xa1b7('0xa')](function(_0xc03de0){logger[_0xa1b7('0xb')](_0xa1b7('0x20'),_0x20b393);logger[_0xa1b7('0xd')](_0xa1b7('0x20'),_0x20b393,JSON[_0xa1b7('0xf')](_0xc03de0));_0xd2b397(_0xc03de0);})[_0xa1b7('0x15')](function(_0x5ea8ce){logger[_0xa1b7('0x10')](_0xa1b7('0x20'),_0x5ea8ce[_0xa1b7('0x13')],_0x20b393);_0x30ba7c(_0xd1978d[_0xa1b7('0x10')](0x1f4,_0x5ea8ce[_0xa1b7('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index 79aff6f..3b59adf 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 _0x4d22=['destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','get','isAuthenticated','index','/:id','update'];(function(_0xbc78b,_0x1fd37d){var _0x24fb2e=function(_0x52f46e){while(--_0x52f46e){_0xbc78b['push'](_0xbc78b['shift']());}};_0x24fb2e(++_0x1fd37d);}(_0x4d22,0xa2));var _0x24d2=function(_0x488784,_0x2d04cf){_0x488784=_0x488784-0x0;var _0x10d1fa=_0x4d22[_0x488784];return _0x10d1fa;};'use strict';var multer=require(_0x24d2('0x0'));var util=require(_0x24d2('0x1'));var path=require(_0x24d2('0x2'));var timeout=require('connect-timeout');var express=require(_0x24d2('0x3'));var router=express[_0x24d2('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x24d2('0x5'));var interaction=require(_0x24d2('0x6'));var config=require(_0x24d2('0x7'));var controller=require(_0x24d2('0x8'));router[_0x24d2('0x9')]('/',auth[_0x24d2('0xa')](),controller[_0x24d2('0xb')]);router['get'](_0x24d2('0xc'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x24d2('0xa')](),controller['create']);router['put']('/:id',auth[_0x24d2('0xa')](),controller[_0x24d2('0xd')]);router['delete']('/:id',auth[_0x24d2('0xa')](),controller[_0x24d2('0xe')]);module[_0x24d2('0xf')]=router; \ No newline at end of file +var _0x6c79=['update','delete','isAuthenticated','destroy','exports','multer','path','Router','fs-extra','../../components/interaction/service','./voiceChanSpy.controller','get','index','/:id','show','post','put'];(function(_0x54c191,_0x4a04ef){var _0x40ee4a=function(_0x200a79){while(--_0x200a79){_0x54c191['push'](_0x54c191['shift']());}};_0x40ee4a(++_0x4a04ef);}(_0x6c79,0x1d0));var _0x96c7=function(_0x165da7,_0x3d18ef){_0x165da7=_0x165da7-0x0;var _0xcd7f87=_0x6c79[_0x165da7];return _0xcd7f87;};'use strict';var multer=require(_0x96c7('0x0'));var util=require('util');var path=require(_0x96c7('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x96c7('0x2')]();var fs_extra=require(_0x96c7('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x96c7('0x4'));var config=require('../../config/environment');var controller=require(_0x96c7('0x5'));router[_0x96c7('0x6')]('/',auth['isAuthenticated'](),controller[_0x96c7('0x7')]);router[_0x96c7('0x6')](_0x96c7('0x8'),auth['isAuthenticated'](),controller[_0x96c7('0x9')]);router[_0x96c7('0xa')]('/',auth['isAuthenticated'](),controller['create']);router[_0x96c7('0xb')](_0x96c7('0x8'),auth['isAuthenticated'](),controller[_0x96c7('0xc')]);router[_0x96c7('0xd')]('/:id',auth[_0x96c7('0xe')](),controller[_0x96c7('0xf')]);module[_0x96c7('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 97b849e..54b63d5 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 _0x68cf=['options','split','sequelize','exports','STRING','setDataValue','join','getDataValue'];(function(_0x96f74c,_0xfc30a4){var _0x379222=function(_0x1bbde9){while(--_0x1bbde9){_0x96f74c['push'](_0x96f74c['shift']());}};_0x379222(++_0xfc30a4);}(_0x68cf,0xaa));var _0xf68c=function(_0x128e8b,_0x5f0f53){_0x128e8b=_0x128e8b-0x0;var _0xe0f3db=_0x68cf[_0x128e8b];return _0xe0f3db;};'use strict';var Sequelize=require(_0xf68c('0x0'));module[_0xf68c('0x1')]={'name':{'type':Sequelize[_0xf68c('0x2')]},'prefix':{'type':Sequelize[_0xf68c('0x2')],'unique':'name','allowNull':![]},'options':{'type':Sequelize['STRING'],'set':function(_0x3d4ee7){this[_0xf68c('0x3')]('options',_0x3d4ee7?_0x3d4ee7[_0xf68c('0x4')](''):[]);},'get':function(){return this[_0xf68c('0x5')](_0xf68c('0x6'))?this[_0xf68c('0x5')]('options')[_0xf68c('0x7')](''):[];}},'auth':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'password':{'type':Sequelize[_0xf68c('0x2')]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xf68c('0x2')]},'description':{'type':Sequelize[_0xf68c('0x2')]}}; \ No newline at end of file +var _0x9de6=['join','getDataValue','split','BOOLEAN','sequelize','exports','STRING','name','setDataValue'];(function(_0x45c43e,_0x3f45fb){var _0x1db42f=function(_0x3a0d03){while(--_0x3a0d03){_0x45c43e['push'](_0x45c43e['shift']());}};_0x1db42f(++_0x3f45fb);}(_0x9de6,0x1ea));var _0x69de=function(_0x4a75f9,_0x1b5a42){_0x4a75f9=_0x4a75f9-0x0;var _0x2b4ced=_0x9de6[_0x4a75f9];return _0x2b4ced;};'use strict';var Sequelize=require(_0x69de('0x0'));module[_0x69de('0x1')]={'name':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0x69de('0x2')],'unique':_0x69de('0x3'),'allowNull':![]},'options':{'type':Sequelize['STRING'],'set':function(_0x37b423){this[_0x69de('0x4')]('options',_0x37b423?_0x37b423[_0x69de('0x5')](''):[]);},'get':function(){return this[_0x69de('0x6')]('options')?this[_0x69de('0x6')]('options')[_0x69de('0x7')](''):[];}},'auth':{'type':Sequelize[_0x69de('0x8')],'defaultValue':![]},'password':{'type':Sequelize[_0x69de('0x2')]},'record':{'type':Sequelize[_0x69de('0x8')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x69de('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index d12aa73..e91bbff 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 _0x524a=['rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','json','offset','undefined','count','status','set','Content-Range','apply','reject','save','update','then','ChanSpies','UserProfileResource','destroy','stack','name','index','map','VoiceChanSpy','fieldName','model','query','filters','attributes','intersection','fields','length','limit','order','sort','where','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','keys','rawAttributes','find','catch','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format'];(function(_0x290612,_0x264e17){var _0x44aade=function(_0x3358d9){while(--_0x3358d9){_0x290612['push'](_0x290612['shift']());}};_0x44aade(++_0x264e17);}(_0x524a,0xf5));var _0xa524=function(_0x4f1cea,_0x217f65){_0x4f1cea=_0x4f1cea-0x0;var _0x4c18c6=_0x524a[_0x4f1cea];return _0x4c18c6;};'use strict';var emlformat=require(_0xa524('0x0'));var rimraf=require(_0xa524('0x1'));var zipdir=require(_0xa524('0x2'));var jsonpatch=require(_0xa524('0x3'));var rp=require('request-promise');var moment=require(_0xa524('0x4'));var BPromise=require(_0xa524('0x5'));var Mustache=require(_0xa524('0x6'));var util=require('util');var path=require('path');var sox=require(_0xa524('0x7'));var csv=require(_0xa524('0x8'));var ejs=require(_0xa524('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa524('0xa'));var squel=require('squel');var crypto=require(_0xa524('0xb'));var jsforce=require(_0xa524('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa524('0x8'));var querystring=require(_0xa524('0xd'));var Papa=require(_0xa524('0xe'));var Redis=require(_0xa524('0xf'));var authService=require(_0xa524('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xa524('0x11'));var hardwareService=require(_0xa524('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0xa524('0x13'));var config=require(_0xa524('0x14'));var licenseUtil=require(_0xa524('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x55117f,_0x14a0d6){_0x14a0d6=_0x14a0d6||0xcc;return function(_0x4aa46d){if(_0x4aa46d){return _0x55117f[_0xa524('0x16')](_0x14a0d6);}return _0x55117f['status'](_0x14a0d6)[_0xa524('0x17')]();};}function respondWithResult(_0x5c7e6a,_0x75bfe8){_0x75bfe8=_0x75bfe8||0xc8;return function(_0x281137){if(_0x281137){return _0x5c7e6a['status'](_0x75bfe8)[_0xa524('0x18')](_0x281137);}};}function respondWithFilteredResult(_0x15b14c,_0xe85361){return function(_0x1de01e){if(_0x1de01e){var _0x45347f=typeof _0xe85361[_0xa524('0x19')]===_0xa524('0x1a')&&typeof _0xe85361['limit']===_0xa524('0x1a');var _0x3d8494=_0x1de01e[_0xa524('0x1b')];var _0x3d6a0d=_0x45347f?0x0:_0xe85361[_0xa524('0x19')];var _0x805b93=_0x45347f?_0x1de01e[_0xa524('0x1b')]:_0xe85361[_0xa524('0x19')]+_0xe85361['limit'];var _0x304dea;if(_0x805b93>=_0x3d8494){_0x805b93=_0x3d8494;_0x304dea=0xc8;}else{_0x304dea=0xce;}_0x15b14c[_0xa524('0x1c')](_0x304dea);return _0x15b14c[_0xa524('0x1d')](_0xa524('0x1e'),_0x3d6a0d+'-'+_0x805b93+'/'+_0x3d8494)['json'](_0x1de01e);}return null;};}function patchUpdates(_0x5510fa){return function(_0x40f4bd){try{jsonpatch[_0xa524('0x1f')](_0x40f4bd,_0x5510fa,!![]);}catch(_0x21e114){return BPromise[_0xa524('0x20')](_0x21e114);}return _0x40f4bd[_0xa524('0x21')]();};}function saveUpdates(_0x3866e2,_0x4abffe){return function(_0x262eac){if(_0x262eac){return _0x262eac[_0xa524('0x22')](_0x3866e2)[_0xa524('0x23')](function(_0x40fb4b){return _0x40fb4b;});}return null;};}function removeEntity(_0x226784,_0x45cdcc){return function(_0x26e931){if(_0x26e931){return _0x26e931['destroy']()[_0xa524('0x23')](function(){var _0x221bf=_0x26e931['get']({'plain':!![]});var _0x47efb3=_0xa524('0x24');return db[_0xa524('0x25')][_0xa524('0x26')]({'where':{'type':_0x47efb3,'resourceId':_0x221bf['id']}})[_0xa524('0x23')](function(){return _0x26e931;});})[_0xa524('0x23')](function(){_0x226784['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1aeabc,_0x869b22){return function(_0x1582fa){if(!_0x1582fa){_0x1aeabc[_0xa524('0x16')](0x194);}return _0x1582fa;};}function handleError(_0x505c42,_0x1c84c6){_0x1c84c6=_0x1c84c6||0x1f4;return function(_0x32ba03){logger['error'](_0x32ba03[_0xa524('0x27')]);if(_0x32ba03[_0xa524('0x28')]){delete _0x32ba03['name'];}_0x505c42[_0xa524('0x1c')](_0x1c84c6)['send'](_0x32ba03);};}exports[_0xa524('0x29')]=function(_0x38e051,_0x45b846){var _0x238133={},_0x136e83={},_0x1c706b={'count':0x0,'rows':[]};var _0x4f6133=_[_0xa524('0x2a')](db[_0xa524('0x2b')]['rawAttributes'],function(_0x535e41){return{'name':_0x535e41[_0xa524('0x2c')],'type':_0x535e41['type']['key']};});_0x136e83[_0xa524('0x2d')]=_[_0xa524('0x2a')](_0x4f6133,_0xa524('0x28'));_0x136e83[_0xa524('0x2e')]=_['keys'](_0x38e051['query']);_0x136e83[_0xa524('0x2f')]=_['intersection'](_0x136e83['model'],_0x136e83[_0xa524('0x2e')]);_0x238133[_0xa524('0x30')]=_[_0xa524('0x31')](_0x136e83[_0xa524('0x2d')],qs[_0xa524('0x32')](_0x38e051[_0xa524('0x2e')][_0xa524('0x32')]));_0x238133[_0xa524('0x30')]=_0x238133[_0xa524('0x30')][_0xa524('0x33')]?_0x238133[_0xa524('0x30')]:_0x136e83[_0xa524('0x2d')];if(!_0x38e051['query']['hasOwnProperty']('nolimit')){_0x238133[_0xa524('0x34')]=qs[_0xa524('0x34')](_0x38e051['query'][_0xa524('0x34')]);_0x238133['offset']=qs[_0xa524('0x19')](_0x38e051[_0xa524('0x2e')]['offset']);}_0x238133[_0xa524('0x35')]=qs[_0xa524('0x36')](_0x38e051[_0xa524('0x2e')]['sort']);_0x238133[_0xa524('0x37')]=qs[_0xa524('0x2f')](_['pick'](_0x38e051[_0xa524('0x2e')],_0x136e83[_0xa524('0x2f')]),_0x4f6133);if(_0x38e051['query'][_0xa524('0x38')]){_0x238133[_0xa524('0x37')]=_['merge'](_0x238133[_0xa524('0x37')],{'$or':_[_0xa524('0x2a')](_0x4f6133,function(_0x186395){if(_0x186395[_0xa524('0x39')]!==_0xa524('0x3a')){var _0x38f87a={};_0x38f87a[_0x186395[_0xa524('0x28')]]={'$like':'%'+_0x38e051[_0xa524('0x2e')][_0xa524('0x38')]+'%'};return _0x38f87a;}})});}_0x238133=_[_0xa524('0x3b')]({},_0x238133,_0x38e051[_0xa524('0x3c')]);var _0x51cd09={'where':_0x238133[_0xa524('0x37')]};return db['VoiceChanSpy'][_0xa524('0x1b')](_0x51cd09)[_0xa524('0x23')](function(_0x35d92d){_0x1c706b[_0xa524('0x1b')]=_0x35d92d;if(_0x38e051[_0xa524('0x2e')][_0xa524('0x3d')]){_0x238133[_0xa524('0x3e')]=[{'all':!![]}];}return db[_0xa524('0x2b')][_0xa524('0x3f')](_0x238133);})[_0xa524('0x23')](function(_0x4a87d4){_0x1c706b[_0xa524('0x40')]=_0x4a87d4;return _0x1c706b;})[_0xa524('0x23')](respondWithFilteredResult(_0x45b846,_0x238133))['catch'](handleError(_0x45b846,null));};exports[_0xa524('0x41')]=function(_0x3f5564,_0x4885a4){var _0x492851={'raw':![],'where':{'id':_0x3f5564['params']['id']}},_0x4dff4b={};_0x4dff4b['model']=_[_0xa524('0x42')](db[_0xa524('0x2b')][_0xa524('0x43')]);_0x4dff4b[_0xa524('0x2e')]=_['keys'](_0x3f5564[_0xa524('0x2e')]);_0x4dff4b[_0xa524('0x2f')]=_[_0xa524('0x31')](_0x4dff4b[_0xa524('0x2d')],_0x4dff4b['query']);_0x492851[_0xa524('0x30')]=_[_0xa524('0x31')](_0x4dff4b[_0xa524('0x2d')],qs[_0xa524('0x32')](_0x3f5564[_0xa524('0x2e')]['fields']));_0x492851[_0xa524('0x30')]=_0x492851[_0xa524('0x30')][_0xa524('0x33')]?_0x492851[_0xa524('0x30')]:_0x4dff4b[_0xa524('0x2d')];if(_0x3f5564[_0xa524('0x2e')][_0xa524('0x3d')]){_0x492851[_0xa524('0x3e')]=[{'all':!![]}];}_0x492851=_[_0xa524('0x3b')]({},_0x492851,_0x3f5564['options']);return db['VoiceChanSpy'][_0xa524('0x44')](_0x492851)[_0xa524('0x23')](handleEntityNotFound(_0x4885a4,null))[_0xa524('0x23')](respondWithResult(_0x4885a4,null))[_0xa524('0x45')](handleError(_0x4885a4,null));};exports[_0xa524('0x46')]=function(_0xddc80,_0x56e570){return db[_0xa524('0x2b')][_0xa524('0x46')](_0xddc80[_0xa524('0x47')],{})[_0xa524('0x23')](function(_0x24c7ef){var _0x451bbe=_0xddc80['user'][_0xa524('0x48')]({'plain':!![]});if(!_0x451bbe)throw new Error(_0xa524('0x49'));if(_0x451bbe[_0xa524('0x4a')]===_0xa524('0x4b')){var _0x25ffbd=_0x24c7ef[_0xa524('0x48')]({'plain':!![]});var _0xef18b7=_0xa524('0x24');return db[_0xa524('0x4c')][_0xa524('0x44')]({'where':{'name':_0xef18b7,'userProfileId':_0x451bbe[_0xa524('0x4d')]},'raw':!![]})[_0xa524('0x23')](function(_0x3a374f){if(_0x3a374f&&_0x3a374f[_0xa524('0x4e')]===0x0){return db[_0xa524('0x25')]['create']({'name':_0x25ffbd[_0xa524('0x28')],'resourceId':_0x25ffbd['id'],'type':_0x3a374f[_0xa524('0x28')],'sectionId':_0x3a374f['id']},{})['then'](function(){return _0x24c7ef;});}else{return _0x24c7ef;}})['catch'](function(_0x32844c){logger[_0xa524('0x4f')](_0xa524('0x50'),_0x32844c);throw _0x32844c;});}return _0x24c7ef;})[_0xa524('0x23')](respondWithResult(_0x56e570,0xc9))[_0xa524('0x45')](handleError(_0x56e570,null));};exports[_0xa524('0x22')]=function(_0x121fc5,_0x4e3709){if(_0x121fc5[_0xa524('0x47')]['id']){delete _0x121fc5[_0xa524('0x47')]['id'];}return db[_0xa524('0x2b')][_0xa524('0x44')]({'where':{'id':_0x121fc5[_0xa524('0x51')]['id']}})['then'](handleEntityNotFound(_0x4e3709,null))[_0xa524('0x23')](saveUpdates(_0x121fc5['body'],null))[_0xa524('0x23')](respondWithResult(_0x4e3709,null))[_0xa524('0x45')](handleError(_0x4e3709,null));};exports[_0xa524('0x26')]=function(_0x3f5694,_0x161393){return db[_0xa524('0x2b')][_0xa524('0x44')]({'where':{'id':_0x3f5694['params']['id']}})['then'](handleEntityNotFound(_0x161393,null))[_0xa524('0x23')](removeEntity(_0x161393,null))[_0xa524('0x45')](handleError(_0x161393,null));}; \ No newline at end of file +var _0xfb3f=['../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','destroy','then','UserProfileResource','error','name','send','VoiceChanSpy','rawAttributes','type','key','map','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','findAll','catch','show','params','includeAll','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x13a426,_0x1e285b){var _0x3ba455=function(_0x248a1a){while(--_0x248a1a){_0x13a426['push'](_0x13a426['shift']());}};_0x3ba455(++_0x1e285b);}(_0xfb3f,0xd9));var _0xffb3=function(_0x356594,_0x59c53c){_0x356594=_0x356594-0x0;var _0x1f85fd=_0xfb3f[_0x356594];return _0x1f85fd;};'use strict';var emlformat=require(_0xffb3('0x0'));var rimraf=require(_0xffb3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xffb3('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xffb3('0x3'));var Mustache=require('mustache');var util=require(_0xffb3('0x4'));var path=require(_0xffb3('0x5'));var sox=require(_0xffb3('0x6'));var csv=require(_0xffb3('0x7'));var ejs=require(_0xffb3('0x8'));var fs=require('fs');var fs_extra=require(_0xffb3('0x9'));var _=require(_0xffb3('0xa'));var squel=require(_0xffb3('0xb'));var crypto=require('crypto');var jsforce=require(_0xffb3('0xc'));var deskjs=require(_0xffb3('0xd'));var toCsv=require(_0xffb3('0x7'));var querystring=require(_0xffb3('0xe'));var Papa=require(_0xffb3('0xf'));var Redis=require('ioredis');var authService=require(_0xffb3('0x10'));var qs=require(_0xffb3('0x11'));var as=require(_0xffb3('0x12'));var hardwareService=require(_0xffb3('0x13'));var logger=require(_0xffb3('0x14'))(_0xffb3('0x15'));var utils=require(_0xffb3('0x16'));var config=require(_0xffb3('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xffb3('0x18'))['db'];function respondWithStatusCode(_0x40c953,_0x55192c){_0x55192c=_0x55192c||0xcc;return function(_0x21924a){if(_0x21924a){return _0x40c953[_0xffb3('0x19')](_0x55192c);}return _0x40c953[_0xffb3('0x1a')](_0x55192c)[_0xffb3('0x1b')]();};}function respondWithResult(_0x65ef59,_0x420156){_0x420156=_0x420156||0xc8;return function(_0x19ce6e){if(_0x19ce6e){return _0x65ef59[_0xffb3('0x1a')](_0x420156)[_0xffb3('0x1c')](_0x19ce6e);}};}function respondWithFilteredResult(_0x3183bd,_0x38daab){return function(_0x2c3ef7){if(_0x2c3ef7){var _0x4d3c48=typeof _0x38daab[_0xffb3('0x1d')]===_0xffb3('0x1e')&&typeof _0x38daab[_0xffb3('0x1f')]==='undefined';var _0x51f3bb=_0x2c3ef7[_0xffb3('0x20')];var _0x167ed7=_0x4d3c48?0x0:_0x38daab['offset'];var _0x3b35de=_0x4d3c48?_0x2c3ef7[_0xffb3('0x20')]:_0x38daab[_0xffb3('0x1d')]+_0x38daab['limit'];var _0x2dfb40;if(_0x3b35de>=_0x51f3bb){_0x3b35de=_0x51f3bb;_0x2dfb40=0xc8;}else{_0x2dfb40=0xce;}_0x3183bd[_0xffb3('0x1a')](_0x2dfb40);return _0x3183bd['set'](_0xffb3('0x21'),_0x167ed7+'-'+_0x3b35de+'/'+_0x51f3bb)[_0xffb3('0x1c')](_0x2c3ef7);}return null;};}function patchUpdates(_0x223ad5){return function(_0x21c9ad){try{jsonpatch[_0xffb3('0x22')](_0x21c9ad,_0x223ad5,!![]);}catch(_0x46858f){return BPromise[_0xffb3('0x23')](_0x46858f);}return _0x21c9ad['save']();};}function saveUpdates(_0x473cff,_0xe4c60e){return function(_0x5e0f48){if(_0x5e0f48){return _0x5e0f48[_0xffb3('0x24')](_0x473cff)['then'](function(_0x5b707a){return _0x5b707a;});}return null;};}function removeEntity(_0x24c502,_0x3d55e6){return function(_0x22bbea){if(_0x22bbea){return _0x22bbea[_0xffb3('0x25')]()[_0xffb3('0x26')](function(){var _0x146708=_0x22bbea['get']({'plain':!![]});var _0x796b8e='ChanSpies';return db[_0xffb3('0x27')][_0xffb3('0x25')]({'where':{'type':_0x796b8e,'resourceId':_0x146708['id']}})['then'](function(){return _0x22bbea;});})[_0xffb3('0x26')](function(){_0x24c502['status'](0xcc)[_0xffb3('0x1b')]();});}};}function handleEntityNotFound(_0x148ad8,_0x45522c){return function(_0x6ba942){if(!_0x6ba942){_0x148ad8['sendStatus'](0x194);}return _0x6ba942;};}function handleError(_0x5f2f3e,_0x4a3b8c){_0x4a3b8c=_0x4a3b8c||0x1f4;return function(_0x52fc8c){logger[_0xffb3('0x28')](_0x52fc8c['stack']);if(_0x52fc8c[_0xffb3('0x29')]){delete _0x52fc8c[_0xffb3('0x29')];}_0x5f2f3e[_0xffb3('0x1a')](_0x4a3b8c)[_0xffb3('0x2a')](_0x52fc8c);};}exports['index']=function(_0x282f46,_0x42fa8e){var _0x4d544d={},_0x474d85={},_0x39ca38={'count':0x0,'rows':[]};var _0x266d7c=_['map'](db[_0xffb3('0x2b')][_0xffb3('0x2c')],function(_0x2b4bac){return{'name':_0x2b4bac['fieldName'],'type':_0x2b4bac[_0xffb3('0x2d')][_0xffb3('0x2e')]};});_0x474d85['model']=_[_0xffb3('0x2f')](_0x266d7c,_0xffb3('0x29'));_0x474d85[_0xffb3('0x30')]=_[_0xffb3('0x31')](_0x282f46[_0xffb3('0x30')]);_0x474d85['filters']=_[_0xffb3('0x32')](_0x474d85[_0xffb3('0x33')],_0x474d85[_0xffb3('0x30')]);_0x4d544d['attributes']=_[_0xffb3('0x32')](_0x474d85[_0xffb3('0x33')],qs['fields'](_0x282f46[_0xffb3('0x30')][_0xffb3('0x34')]));_0x4d544d['attributes']=_0x4d544d[_0xffb3('0x35')][_0xffb3('0x36')]?_0x4d544d['attributes']:_0x474d85['model'];if(!_0x282f46['query'][_0xffb3('0x37')](_0xffb3('0x38'))){_0x4d544d['limit']=qs[_0xffb3('0x1f')](_0x282f46['query'][_0xffb3('0x1f')]);_0x4d544d[_0xffb3('0x1d')]=qs['offset'](_0x282f46[_0xffb3('0x30')]['offset']);}_0x4d544d[_0xffb3('0x39')]=qs[_0xffb3('0x3a')](_0x282f46['query'][_0xffb3('0x3a')]);_0x4d544d[_0xffb3('0x3b')]=qs[_0xffb3('0x3c')](_[_0xffb3('0x3d')](_0x282f46[_0xffb3('0x30')],_0x474d85[_0xffb3('0x3c')]),_0x266d7c);if(_0x282f46[_0xffb3('0x30')][_0xffb3('0x3e')]){_0x4d544d[_0xffb3('0x3b')]=_[_0xffb3('0x3f')](_0x4d544d[_0xffb3('0x3b')],{'$or':_[_0xffb3('0x2f')](_0x266d7c,function(_0x2f8bc0){if(_0x2f8bc0['type']!==_0xffb3('0x40')){var _0x282431={};_0x282431[_0x2f8bc0[_0xffb3('0x29')]]={'$like':'%'+_0x282f46['query'][_0xffb3('0x3e')]+'%'};return _0x282431;}})});}_0x4d544d=_['merge']({},_0x4d544d,_0x282f46[_0xffb3('0x41')]);var _0x30cd19={'where':_0x4d544d['where']};return db[_0xffb3('0x2b')][_0xffb3('0x20')](_0x30cd19)['then'](function(_0x596af5){_0x39ca38[_0xffb3('0x20')]=_0x596af5;if(_0x282f46[_0xffb3('0x30')]['includeAll']){_0x4d544d[_0xffb3('0x42')]=[{'all':!![]}];}return db[_0xffb3('0x2b')][_0xffb3('0x43')](_0x4d544d);})[_0xffb3('0x26')](function(_0x2e8564){_0x39ca38['rows']=_0x2e8564;return _0x39ca38;})[_0xffb3('0x26')](respondWithFilteredResult(_0x42fa8e,_0x4d544d))[_0xffb3('0x44')](handleError(_0x42fa8e,null));};exports[_0xffb3('0x45')]=function(_0x40a691,_0x3d56d7){var _0x567883={'raw':![],'where':{'id':_0x40a691[_0xffb3('0x46')]['id']}},_0x5d1890={};_0x5d1890[_0xffb3('0x33')]=_['keys'](db[_0xffb3('0x2b')][_0xffb3('0x2c')]);_0x5d1890[_0xffb3('0x30')]=_[_0xffb3('0x31')](_0x40a691['query']);_0x5d1890['filters']=_[_0xffb3('0x32')](_0x5d1890[_0xffb3('0x33')],_0x5d1890[_0xffb3('0x30')]);_0x567883[_0xffb3('0x35')]=_[_0xffb3('0x32')](_0x5d1890[_0xffb3('0x33')],qs['fields'](_0x40a691[_0xffb3('0x30')]['fields']));_0x567883[_0xffb3('0x35')]=_0x567883[_0xffb3('0x35')][_0xffb3('0x36')]?_0x567883[_0xffb3('0x35')]:_0x5d1890['model'];if(_0x40a691['query'][_0xffb3('0x47')]){_0x567883['include']=[{'all':!![]}];}_0x567883=_[_0xffb3('0x3f')]({},_0x567883,_0x40a691[_0xffb3('0x41')]);return db[_0xffb3('0x2b')]['find'](_0x567883)[_0xffb3('0x26')](handleEntityNotFound(_0x3d56d7,null))[_0xffb3('0x26')](respondWithResult(_0x3d56d7,null))[_0xffb3('0x44')](handleError(_0x3d56d7,null));};exports[_0xffb3('0x48')]=function(_0x2f99ed,_0x4b0fd3){return db[_0xffb3('0x2b')][_0xffb3('0x48')](_0x2f99ed[_0xffb3('0x49')],{})['then'](function(_0x21e9e0){var _0x641c4e=_0x2f99ed[_0xffb3('0x4a')]['get']({'plain':!![]});if(!_0x641c4e)throw new Error(_0xffb3('0x4b'));if(_0x641c4e[_0xffb3('0x4c')]===_0xffb3('0x4a')){var _0x1c179c=_0x21e9e0['get']({'plain':!![]});var _0x525ecf='ChanSpies';return db['UserProfileSection'][_0xffb3('0x4d')]({'where':{'name':_0x525ecf,'userProfileId':_0x641c4e['userProfileId']},'raw':!![]})['then'](function(_0x763c1c){if(_0x763c1c&&_0x763c1c[_0xffb3('0x4e')]===0x0){return db[_0xffb3('0x27')][_0xffb3('0x48')]({'name':_0x1c179c[_0xffb3('0x29')],'resourceId':_0x1c179c['id'],'type':_0x763c1c[_0xffb3('0x29')],'sectionId':_0x763c1c['id']},{})[_0xffb3('0x26')](function(){return _0x21e9e0;});}else{return _0x21e9e0;}})['catch'](function(_0x29ba96){logger[_0xffb3('0x28')](_0xffb3('0x4f'),_0x29ba96);throw _0x29ba96;});}return _0x21e9e0;})[_0xffb3('0x26')](respondWithResult(_0x4b0fd3,0xc9))[_0xffb3('0x44')](handleError(_0x4b0fd3,null));};exports[_0xffb3('0x24')]=function(_0x4cf832,_0x99ff99){if(_0x4cf832[_0xffb3('0x49')]['id']){delete _0x4cf832['body']['id'];}return db['VoiceChanSpy'][_0xffb3('0x4d')]({'where':{'id':_0x4cf832['params']['id']}})[_0xffb3('0x26')](handleEntityNotFound(_0x99ff99,null))[_0xffb3('0x26')](saveUpdates(_0x4cf832[_0xffb3('0x49')],null))['then'](respondWithResult(_0x99ff99,null))['catch'](handleError(_0x99ff99,null));};exports['destroy']=function(_0x2ec815,_0x5d9bda){return db['VoiceChanSpy']['find']({'where':{'id':_0x2ec815[_0xffb3('0x46')]['id']}})[_0xffb3('0x26')](handleEntityNotFound(_0x5d9bda,null))[_0xffb3('0x26')](removeEntity(_0x5d9bda,null))['catch'](handleError(_0x5d9bda,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index b41f0b1..6487bb6 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 _0xf34a=['format','%s%s','system','merge','Set','CDR(type)=%s','chanspy','record','push','MixMonitor','${UNIQUEID}.%s,a','Authenticate','password','ChanSpy','SIP/%s,%s','name','options','StopMixMonitor','length','concat','User','findAll','internal','agent','then','catch','exports','models','voice_chanspy','VoiceExtension','bulkCreate','destroy','./voiceChanSpy.attributes','from-sip'];(function(_0x4af8a5,_0x235b51){var _0x2f73a0=function(_0x62bae6){while(--_0x62bae6){_0x4af8a5['push'](_0x4af8a5['shift']());}};_0x2f73a0(++_0x235b51);}(_0xf34a,0xec));var _0xaf34=function(_0x1fbfa0,_0x3f1d51){_0x1fbfa0=_0x1fbfa0-0x0;var _0x33461a=_0xf34a[_0x1fbfa0];return _0x33461a;};'use strict';var _=require('lodash');var util=require('util');var BPromise=require('bluebird');var attributes=require(_0xaf34('0x0'));var getUserApplications=function(_0x176d1d,_0x8cf4c5,_0x3f73a5){var _0x4bea22=0x1;var _0x7bdf7c=[];var _0x241c96={'context':_0x8cf4c5['context']||_0xaf34('0x1'),'exten':util[_0xaf34('0x2')](_0xaf34('0x3'),_0x176d1d['prefix'],_0x3f73a5),'type':_0xaf34('0x4'),'isApp':![],'ChanSpyId':_0x176d1d['id'],'UserId':_0x8cf4c5['id']};_0x7bdf7c['push'](_[_0xaf34('0x5')]({'app':_0xaf34('0x6'),'appdata':util[_0xaf34('0x2')](_0xaf34('0x7'),_0xaf34('0x8')),'priority':_0x4bea22++},_0x241c96));if(_0x176d1d[_0xaf34('0x9')]){_0x7bdf7c[_0xaf34('0xa')](_[_0xaf34('0x5')]({'app':_0xaf34('0xb'),'appdata':util[_0xaf34('0x2')](_0xaf34('0xc'),_0x176d1d['recordingFormat']),'priority':_0x4bea22++},_0x241c96));}if(_0x176d1d['auth']){_0x7bdf7c[_0xaf34('0xa')](_[_0xaf34('0x5')]({'app':_0xaf34('0xd'),'appdata':_0x176d1d[_0xaf34('0xe')],'priority':_0x4bea22++},_0x241c96));}_0x7bdf7c[_0xaf34('0xa')](_[_0xaf34('0x5')]({'app':_0xaf34('0xf'),'appdata':util['format'](_0xaf34('0x10'),_0x8cf4c5[_0xaf34('0x11')],_0x176d1d['options']?_0x176d1d[_0xaf34('0x12')]['join'](''):''),'priority':_0x4bea22++},_0x241c96));if(_0x176d1d['record']){_0x7bdf7c[_0xaf34('0xa')](_[_0xaf34('0x5')]({'app':_0xaf34('0x13'),'priority':_0x4bea22++},_0x241c96));}return _0x7bdf7c;};var getChanSpyApplications=function(_0x36cd34,_0x502256){var _0x39fdcb=[];for(var _0x22adb4=0x0,_0x3a3f39=0x1;_0x22adb4<_0x502256[_0xaf34('0x14')];_0x22adb4++,_0x3a3f39=0x1){_0x39fdcb=_0x39fdcb['concat'](getUserApplications(_0x36cd34,_0x502256[_0x22adb4],_0x502256[_0x22adb4]['internal']));if(_0x502256[_0x22adb4]['internal']!=_0x502256[_0x22adb4][_0xaf34('0x11')]){_0x39fdcb=_0x39fdcb[_0xaf34('0x15')](getUserApplications(_0x36cd34,_0x502256[_0x22adb4],_0x502256[_0x22adb4][_0xaf34('0x11')]));}}return _0x39fdcb;};var getChanSpyPromise=function(_0x2cf351,_0x296be3){return new BPromise(function(_0x36ce2b,_0x5c5ecd){return _0x2cf351[_0xaf34('0x16')][_0xaf34('0x17')]({'attributes':['id',_0xaf34('0x11'),_0xaf34('0x18')],'where':{'role':_0xaf34('0x19'),'chanspy':!![]},'raw':!![]})[_0xaf34('0x1a')](function(_0x214722){if(_0x214722){return _0x36ce2b(getChanSpyApplications(_0x296be3,_0x214722));}return _0x36ce2b([]);})[_0xaf34('0x1b')](function(_0x3a1984){_0x5c5ecd(_0x3a1984);});});};module[_0xaf34('0x1c')]=function(_0x59de7c,_0x3e374c){var _0x3628d7=_0x59de7c[_0xaf34('0x1d')];return _0x59de7c['define']('VoiceChanSpy',attributes,{'tableName':_0xaf34('0x1e'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x582508,_0x52b607,_0x2afaec){return getChanSpyPromise(_0x3628d7,_0x582508)[_0xaf34('0x1a')](function(_0x22304){if(_0x22304&&_0x22304[_0xaf34('0x14')]){return _0x3628d7[_0xaf34('0x1f')][_0xaf34('0x20')](_0x22304);}})[_0xaf34('0x1a')](function(){_0x2afaec();})[_0xaf34('0x1b')](function(_0x157e5a){_0x2afaec(_0x157e5a);});},'afterUpdate':function(_0x109d34,_0xb46670,_0x3f97aa){return _0x3628d7['VoiceExtension'][_0xaf34('0x21')]({'where':{'ChanSpyId':_0x109d34['id']}})[_0xaf34('0x1a')](function(){return getChanSpyPromise(_0x3628d7,_0x109d34);})[_0xaf34('0x1a')](function(_0x421196){if(_0x421196&&_0x421196['length']){return _0x3628d7[_0xaf34('0x1f')][_0xaf34('0x20')](_0x421196);}})[_0xaf34('0x1a')](function(){_0x3f97aa();})[_0xaf34('0x1b')](function(_0x26abf2){_0x3f97aa(_0x26abf2);});},'afterDestroy':function(_0x369fd8,_0x5e814a,_0x1c76ce){return _0x3628d7[_0xaf34('0x1f')][_0xaf34('0x21')]({'where':{'ChanSpyId':_0x369fd8['id']}})['then'](function(){_0x1c76ce();})[_0xaf34('0x1b')](function(_0x1718c2){_0x1c76ce(_0x1718c2);});}}});}; \ No newline at end of file +var _0x326a=['${UNIQUEID}.%s,a','recordingFormat','auth','Authenticate','password','ChanSpy','SIP/%s,%s','name','options','join','StopMixMonitor','length','concat','internal','User','findAll','then','exports','models','define','VoiceChanSpy','bulkCreate','VoiceExtension','destroy','catch','lodash','util','./voiceChanSpy.attributes','context','from-sip','format','%s%s','prefix','system','push','merge','Set','CDR(type)=%s','chanspy','record','MixMonitor'];(function(_0x4410ff,_0x4bcef0){var _0x2504cb=function(_0xe955c8){while(--_0xe955c8){_0x4410ff['push'](_0x4410ff['shift']());}};_0x2504cb(++_0x4bcef0);}(_0x326a,0x161));var _0xa326=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0x326a[_0x580576];return _0x3f55a0;};'use strict';var _=require(_0xa326('0x0'));var util=require(_0xa326('0x1'));var BPromise=require('bluebird');var attributes=require(_0xa326('0x2'));var getUserApplications=function(_0x2bfe50,_0x4845f2,_0x47391f){var _0x122e66=0x1;var _0x2f6302=[];var _0x548917={'context':_0x4845f2[_0xa326('0x3')]||_0xa326('0x4'),'exten':util[_0xa326('0x5')](_0xa326('0x6'),_0x2bfe50[_0xa326('0x7')],_0x47391f),'type':_0xa326('0x8'),'isApp':![],'ChanSpyId':_0x2bfe50['id'],'UserId':_0x4845f2['id']};_0x2f6302[_0xa326('0x9')](_[_0xa326('0xa')]({'app':_0xa326('0xb'),'appdata':util[_0xa326('0x5')](_0xa326('0xc'),_0xa326('0xd')),'priority':_0x122e66++},_0x548917));if(_0x2bfe50[_0xa326('0xe')]){_0x2f6302[_0xa326('0x9')](_['merge']({'app':_0xa326('0xf'),'appdata':util[_0xa326('0x5')](_0xa326('0x10'),_0x2bfe50[_0xa326('0x11')]),'priority':_0x122e66++},_0x548917));}if(_0x2bfe50[_0xa326('0x12')]){_0x2f6302['push'](_['merge']({'app':_0xa326('0x13'),'appdata':_0x2bfe50[_0xa326('0x14')],'priority':_0x122e66++},_0x548917));}_0x2f6302[_0xa326('0x9')](_[_0xa326('0xa')]({'app':_0xa326('0x15'),'appdata':util[_0xa326('0x5')](_0xa326('0x16'),_0x4845f2[_0xa326('0x17')],_0x2bfe50[_0xa326('0x18')]?_0x2bfe50['options'][_0xa326('0x19')](''):''),'priority':_0x122e66++},_0x548917));if(_0x2bfe50[_0xa326('0xe')]){_0x2f6302[_0xa326('0x9')](_[_0xa326('0xa')]({'app':_0xa326('0x1a'),'priority':_0x122e66++},_0x548917));}return _0x2f6302;};var getChanSpyApplications=function(_0x332276,_0x5a428f){var _0x1be96a=[];for(var _0x136df3=0x0,_0x554d23=0x1;_0x136df3<_0x5a428f[_0xa326('0x1b')];_0x136df3++,_0x554d23=0x1){_0x1be96a=_0x1be96a[_0xa326('0x1c')](getUserApplications(_0x332276,_0x5a428f[_0x136df3],_0x5a428f[_0x136df3][_0xa326('0x1d')]));if(_0x5a428f[_0x136df3]['internal']!=_0x5a428f[_0x136df3]['name']){_0x1be96a=_0x1be96a[_0xa326('0x1c')](getUserApplications(_0x332276,_0x5a428f[_0x136df3],_0x5a428f[_0x136df3]['name']));}}return _0x1be96a;};var getChanSpyPromise=function(_0x12d6e5,_0x3e77c5){return new BPromise(function(_0xf35434,_0x4f633e){return _0x12d6e5[_0xa326('0x1e')][_0xa326('0x1f')]({'attributes':['id',_0xa326('0x17'),_0xa326('0x1d')],'where':{'role':'agent','chanspy':!![]},'raw':!![]})[_0xa326('0x20')](function(_0x11bcea){if(_0x11bcea){return _0xf35434(getChanSpyApplications(_0x3e77c5,_0x11bcea));}return _0xf35434([]);})['catch'](function(_0x1ab88d){_0x4f633e(_0x1ab88d);});});};module[_0xa326('0x21')]=function(_0x20fc31,_0x532fd1){var _0x482d43=_0x20fc31[_0xa326('0x22')];return _0x20fc31[_0xa326('0x23')](_0xa326('0x24'),attributes,{'tableName':'voice_chanspy','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x3e16e4,_0xe0e1a4,_0x3380df){return getChanSpyPromise(_0x482d43,_0x3e16e4)['then'](function(_0x4477cb){if(_0x4477cb&&_0x4477cb['length']){return _0x482d43['VoiceExtension'][_0xa326('0x25')](_0x4477cb);}})[_0xa326('0x20')](function(){_0x3380df();})['catch'](function(_0x2a4582){_0x3380df(_0x2a4582);});},'afterUpdate':function(_0x28d004,_0x593a9c,_0x533f24){return _0x482d43[_0xa326('0x26')]['destroy']({'where':{'ChanSpyId':_0x28d004['id']}})[_0xa326('0x20')](function(){return getChanSpyPromise(_0x482d43,_0x28d004);})[_0xa326('0x20')](function(_0xcb83fe){if(_0xcb83fe&&_0xcb83fe[_0xa326('0x1b')]){return _0x482d43[_0xa326('0x26')][_0xa326('0x25')](_0xcb83fe);}})['then'](function(){_0x533f24();})['catch'](function(_0x34ab67){_0x533f24(_0x34ab67);});},'afterDestroy':function(_0x2c4089,_0x52ff47,_0x32af9b){return _0x482d43[_0xa326('0x26')][_0xa326('0x27')]({'where':{'ChanSpyId':_0x2c4089['id']}})['then'](function(){_0x32af9b();})[_0xa326('0x28')](function(_0x445f68){_0x32af9b(_0x445f68);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index 399a512..dde5c0e 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 _0x765e=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','VoiceChanSpy,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x765e,0x131));var _0xe765=function(_0x181ace,_0x38ee10){_0x181ace=_0x181ace-0x0;var _0x358998=_0x765e[_0x181ace];return _0x358998;};'use strict';var _=require(_0xe765('0x0'));var util=require(_0xe765('0x1'));var moment=require(_0xe765('0x2'));var BPromise=require(_0xe765('0x3'));var rs=require(_0xe765('0x4'));var fs=require('fs');var Redis=require(_0xe765('0x5'));var db=require(_0xe765('0x6'))['db'];var utils=require(_0xe765('0x7'));var logger=require(_0xe765('0x8'))(_0xe765('0x9'));var config=require(_0xe765('0xa'));var jayson=require(_0xe765('0xb'));var client=jayson[_0xe765('0xc')][_0xe765('0xd')]({'port':0x232a});function respondWithRpcPromise(_0xdd89e7,_0x504542,_0x35d891){return new BPromise(function(_0x28e955,_0x27b0f4){return client[_0xe765('0xe')](_0xdd89e7,_0x35d891)[_0xe765('0xf')](function(_0x41801f){logger[_0xe765('0x10')]('VoiceChanSpy,\x20%s,\x20%s',_0x504542,_0xe765('0x11'));logger[_0xe765('0x12')](_0xe765('0x13'),_0x504542,'request\x20sent',JSON[_0xe765('0x14')](_0x41801f));if(_0x41801f['error']){if(_0x41801f['error']['code']===0x1f4){logger[_0xe765('0x15')](_0xe765('0x16'),_0x504542,_0x41801f[_0xe765('0x15')][_0xe765('0x17')]);return _0x27b0f4(_0x41801f[_0xe765('0x15')]['message']);}logger[_0xe765('0x15')](_0xe765('0x16'),_0x504542,_0x41801f[_0xe765('0x15')][_0xe765('0x17')]);return _0x28e955(_0x41801f[_0xe765('0x15')]['message']);}else{logger['info'](_0xe765('0x16'),_0x504542,_0xe765('0x11'));_0x28e955(_0x41801f[_0xe765('0x18')]['message']);}})[_0xe765('0x19')](function(_0x36aca3){logger[_0xe765('0x15')](_0xe765('0x16'),_0x504542,_0x36aca3);_0x27b0f4(_0x36aca3);});});} \ No newline at end of file +var _0x422f=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','VoiceChanSpy,\x20%s,\x20%s','result','catch','util'];(function(_0x1443eb,_0x203408){var _0x2b8810=function(_0x48bc4e){while(--_0x48bc4e){_0x1443eb['push'](_0x1443eb['shift']());}};_0x2b8810(++_0x203408);}(_0x422f,0x1c7));var _0xf422=function(_0x4cf104,_0x470834){_0x4cf104=_0x4cf104-0x0;var _0xa32f24=_0x422f[_0x4cf104];return _0xa32f24;};'use strict';var _=require('lodash');var util=require(_0xf422('0x0'));var moment=require('moment');var BPromise=require(_0xf422('0x1'));var rs=require(_0xf422('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf422('0x3'))['db'];var utils=require(_0xf422('0x4'));var logger=require(_0xf422('0x5'))(_0xf422('0x6'));var config=require(_0xf422('0x7'));var jayson=require(_0xf422('0x8'));var client=jayson[_0xf422('0x9')][_0xf422('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x350b2d,_0x583283,_0x3f4801){return new BPromise(function(_0x1037fa,_0xc2c9f5){return client[_0xf422('0xb')](_0x350b2d,_0x3f4801)[_0xf422('0xc')](function(_0x5f02da){logger[_0xf422('0xd')]('VoiceChanSpy,\x20%s,\x20%s',_0x583283,'request\x20sent');logger[_0xf422('0xe')](_0xf422('0xf'),_0x583283,_0xf422('0x10'),JSON[_0xf422('0x11')](_0x5f02da));if(_0x5f02da[_0xf422('0x12')]){if(_0x5f02da['error'][_0xf422('0x13')]===0x1f4){logger[_0xf422('0x12')]('VoiceChanSpy,\x20%s,\x20%s',_0x583283,_0x5f02da[_0xf422('0x12')][_0xf422('0x14')]);return _0xc2c9f5(_0x5f02da[_0xf422('0x12')][_0xf422('0x14')]);}logger[_0xf422('0x12')](_0xf422('0x15'),_0x583283,_0x5f02da[_0xf422('0x12')][_0xf422('0x14')]);return _0x1037fa(_0x5f02da[_0xf422('0x12')]['message']);}else{logger['info']('VoiceChanSpy,\x20%s,\x20%s',_0x583283,_0xf422('0x10'));_0x1037fa(_0x5f02da[_0xf422('0x16')][_0xf422('0x14')]);}})[_0xf422('0x17')](function(_0x5f3de5){logger[_0xf422('0x12')](_0xf422('0x15'),_0x583283,_0x5f3de5);_0xc2c9f5(_0x5f3de5);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index ee7c5e8..3db670e 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 _0x1b31=['create','put','/:id','update','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceContext.controller','get','index','isAuthenticated','show','post'];(function(_0x199b1f,_0x4ed849){var _0x267ac9=function(_0x184ac6){while(--_0x184ac6){_0x199b1f['push'](_0x199b1f['shift']());}};_0x267ac9(++_0x4ed849);}(_0x1b31,0x1d2));var _0x11b3=function(_0x257569,_0x4b90be){_0x257569=_0x257569-0x0;var _0x4ddb91=_0x1b31[_0x257569];return _0x4ddb91;};'use strict';var multer=require(_0x11b3('0x0'));var util=require(_0x11b3('0x1'));var path=require('path');var timeout=require(_0x11b3('0x2'));var express=require('express');var router=express[_0x11b3('0x3')]();var fs_extra=require(_0x11b3('0x4'));var auth=require(_0x11b3('0x5'));var interaction=require(_0x11b3('0x6'));var config=require(_0x11b3('0x7'));var controller=require(_0x11b3('0x8'));router[_0x11b3('0x9')]('/',auth['isAuthenticated'](),controller[_0x11b3('0xa')]);router['get']('/:id',auth[_0x11b3('0xb')](),controller[_0x11b3('0xc')]);router[_0x11b3('0xd')]('/',auth[_0x11b3('0xb')](),controller[_0x11b3('0xe')]);router[_0x11b3('0xf')](_0x11b3('0x10'),auth[_0x11b3('0xb')](),controller[_0x11b3('0x11')]);router['delete'](_0x11b3('0x10'),auth[_0x11b3('0xb')](),controller[_0x11b3('0x12')]);module[_0x11b3('0x13')]=router; \ No newline at end of file +var _0x4400=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','../../components/interaction/service','../../config/environment','./voiceContext.controller','get','isAuthenticated','index','/:id','show','post','create'];(function(_0x2cfb48,_0x24b83b){var _0xc4594f=function(_0x3bc089){while(--_0x3bc089){_0x2cfb48['push'](_0x2cfb48['shift']());}};_0xc4594f(++_0x24b83b);}(_0x4400,0xfc));var _0x0440=function(_0x2f22e0,_0x3a5483){_0x2f22e0=_0x2f22e0-0x0;var _0x314516=_0x4400[_0x2f22e0];return _0x314516;};'use strict';var multer=require(_0x0440('0x0'));var util=require(_0x0440('0x1'));var path=require(_0x0440('0x2'));var timeout=require(_0x0440('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x0440('0x4'));var config=require(_0x0440('0x5'));var controller=require(_0x0440('0x6'));router[_0x0440('0x7')]('/',auth[_0x0440('0x8')](),controller[_0x0440('0x9')]);router[_0x0440('0x7')](_0x0440('0xa'),auth[_0x0440('0x8')](),controller[_0x0440('0xb')]);router[_0x0440('0xc')]('/',auth[_0x0440('0x8')](),controller[_0x0440('0xd')]);router[_0x0440('0xe')](_0x0440('0xa'),auth['isAuthenticated'](),controller[_0x0440('0xf')]);router[_0x0440('0x10')](_0x0440('0xa'),auth[_0x0440('0x8')](),controller[_0x0440('0x11')]);module[_0x0440('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index c46a106..1f5ea51 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 _0x432f=['STRING','name','BOOLEAN','sequelize','exports'];(function(_0x2832a2,_0x1e34ea){var _0x2eb3c1=function(_0x1600fd){while(--_0x1600fd){_0x2832a2['push'](_0x2832a2['shift']());}};_0x2eb3c1(++_0x1e34ea);}(_0x432f,0x67));var _0xf432=function(_0x5317b5,_0x4dfd6e){_0x5317b5=_0x5317b5-0x0;var _0x3b7ce2=_0x432f[_0x5317b5];return _0x3b7ce2;};'use strict';var Sequelize=require(_0xf432('0x0'));module[_0xf432('0x1')]={'name':{'type':Sequelize[_0xf432('0x2')],'unique':_0xf432('0x3')},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0xf432('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x6ce7=['name','BOOLEAN','sequelize','exports','STRING'];(function(_0x1aa368,_0x56c31d){var _0x3d9e29=function(_0x32c580){while(--_0x32c580){_0x1aa368['push'](_0x1aa368['shift']());}};_0x3d9e29(++_0x56c31d);}(_0x6ce7,0x110));var _0x76ce=function(_0x5df98e,_0x5aeb02){_0x5df98e=_0x5df98e-0x0;var _0x2fdcd9=_0x6ce7[_0x5df98e];return _0x2fdcd9;};'use strict';var Sequelize=require(_0x76ce('0x0'));module[_0x76ce('0x1')]={'name':{'type':Sequelize[_0x76ce('0x2')],'unique':_0x76ce('0x3')},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x76ce('0x4')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.controller.js b/server/api/voiceContext/voiceContext.controller.js index 087ae91..7721669 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 _0x2b87=['http','request','then','request\x20sent','error','code','VoiceContext,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','offset','undefined','count','Content-Range','json','apply','reject','update','destroy','Contexts','UserProfileResource','name','send','index','rawAttributes','type','model','map','query','keys','filters','intersection','attributes','fields','nolimit','limit','sort','where','merge','VIRTUAL','filter','options','VoiceContext','includeAll','include','findAll','rows','show','params','length','find','create','body','readFileSync','join','root','server/files/templates/context.ejs','render','/etc/asterisk/extensions_xcally_contexts.conf','chan_sip.so','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','utf8','writeFileSync','Reload','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client'];(function(_0x31ead6,_0x2b9768){var _0x18343e=function(_0x523173){while(--_0x523173){_0x31ead6['push'](_0x31ead6['shift']());}};_0x18343e(++_0x2b9768);}(_0x2b87,0x109));var _0x72b8=function(_0x3c38da,_0x321e19){_0x3c38da=_0x3c38da-0x0;var _0xc7b900=_0x2b87[_0x3c38da];return _0xc7b900;};'use strict';var emlformat=require(_0x72b8('0x0'));var rimraf=require(_0x72b8('0x1'));var zipdir=require(_0x72b8('0x2'));var jsonpatch=require(_0x72b8('0x3'));var rp=require('request-promise');var moment=require(_0x72b8('0x4'));var BPromise=require(_0x72b8('0x5'));var Mustache=require(_0x72b8('0x6'));var util=require(_0x72b8('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x72b8('0x8'));var ejs=require(_0x72b8('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x72b8('0xa'));var squel=require(_0x72b8('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x72b8('0xc'));var toCsv=require(_0x72b8('0x8'));var querystring=require(_0x72b8('0xd'));var Papa=require('papaparse');var Redis=require(_0x72b8('0xe'));var authService=require(_0x72b8('0xf'));var qs=require(_0x72b8('0x10'));var as=require(_0x72b8('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x72b8('0x12'))(_0x72b8('0x13'));var utils=require(_0x72b8('0x14'));var config=require(_0x72b8('0x15'));var licenseUtil=require(_0x72b8('0x16'));var db=require(_0x72b8('0x17'))['db'];var jayson=require(_0x72b8('0x18'));var client=jayson[_0x72b8('0x19')][_0x72b8('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x5b8794,_0x285aaf,_0x8336f7,_0x1e23ee){return new BPromise(function(_0x5af858,_0x523aba){var _0x18f5e8=_0x1e23ee||client;return _0x18f5e8[_0x72b8('0x1b')](_0x5b8794,_0x8336f7)[_0x72b8('0x1c')](function(_0x52722c){logger['info']('VoiceContext,\x20%s,\x20%s',_0x285aaf,_0x72b8('0x1d'));logger['debug']('VoiceContext,\x20%s,\x20%s,\x20%s',_0x285aaf,_0x72b8('0x1d'),JSON['stringify'](_0x52722c));if(_0x52722c[_0x72b8('0x1e')]){if(_0x52722c['error'][_0x72b8('0x1f')]===0x1f4){logger['error']('VoiceContext,\x20%s,\x20%s',_0x285aaf,_0x52722c[_0x72b8('0x1e')]['message']);return _0x523aba(_0x52722c['error']['message']);}logger[_0x72b8('0x1e')](_0x72b8('0x20'),_0x285aaf,_0x52722c[_0x72b8('0x1e')]['message']);return _0x5af858(_0x52722c[_0x72b8('0x1e')][_0x72b8('0x21')]);}else{logger['info'](_0x72b8('0x20'),_0x285aaf,'request\x20sent');_0x5af858(_0x52722c[_0x72b8('0x22')][_0x72b8('0x21')]);}})[_0x72b8('0x23')](function(_0x5d1843){logger[_0x72b8('0x1e')](_0x72b8('0x20'),_0x285aaf,_0x5d1843);_0x523aba(_0x5d1843);});});}function respondWithStatusCode(_0x47f471,_0x304092){_0x304092=_0x304092||0xcc;return function(_0x2e2d67){if(_0x2e2d67){return _0x47f471[_0x72b8('0x24')](_0x304092);}return _0x47f471[_0x72b8('0x25')](_0x304092)[_0x72b8('0x26')]();};}function respondWithResult(_0x384652,_0x4ee3bb){_0x4ee3bb=_0x4ee3bb||0xc8;return function(_0x5af8be){if(_0x5af8be){return _0x384652['status'](_0x4ee3bb)['json'](_0x5af8be);}};}function respondWithFilteredResult(_0x7a0f26,_0x118af9){return function(_0x19904e){if(_0x19904e){var _0x370d95=typeof _0x118af9[_0x72b8('0x27')]===_0x72b8('0x28')&&typeof _0x118af9['limit']===_0x72b8('0x28');var _0x181594=_0x19904e[_0x72b8('0x29')];var _0x3c5188=_0x370d95?0x0:_0x118af9[_0x72b8('0x27')];var _0x5108b9=_0x370d95?_0x19904e['count']:_0x118af9[_0x72b8('0x27')]+_0x118af9['limit'];var _0x5b2a73;if(_0x5108b9>=_0x181594){_0x5108b9=_0x181594;_0x5b2a73=0xc8;}else{_0x5b2a73=0xce;}_0x7a0f26['status'](_0x5b2a73);return _0x7a0f26['set'](_0x72b8('0x2a'),_0x3c5188+'-'+_0x5108b9+'/'+_0x181594)[_0x72b8('0x2b')](_0x19904e);}return null;};}function patchUpdates(_0x19592e){return function(_0x24c1f9){try{jsonpatch[_0x72b8('0x2c')](_0x24c1f9,_0x19592e,!![]);}catch(_0x43b04f){return BPromise[_0x72b8('0x2d')](_0x43b04f);}return _0x24c1f9['save']();};}function saveUpdates(_0x1736bd,_0x55919b){return function(_0x35e3eb){if(_0x35e3eb){return _0x35e3eb[_0x72b8('0x2e')](_0x1736bd)['then'](function(_0x4e84c4){return _0x4e84c4;});}return null;};}function removeEntity(_0x4df2bc,_0x31671f){return function(_0x402364){if(_0x402364){return _0x402364[_0x72b8('0x2f')]()['then'](function(){var _0x1d9b17=_0x402364['get']({'plain':!![]});var _0x7a59c3=_0x72b8('0x30');return db[_0x72b8('0x31')][_0x72b8('0x2f')]({'where':{'type':_0x7a59c3,'resourceId':_0x1d9b17['id']}})['then'](function(){return _0x402364;});})[_0x72b8('0x1c')](function(){_0x4df2bc[_0x72b8('0x25')](0xcc)[_0x72b8('0x26')]();});}};}function handleEntityNotFound(_0xa5b93b,_0xf258b1){return function(_0x489603){if(!_0x489603){_0xa5b93b['sendStatus'](0x194);}return _0x489603;};}function handleError(_0x37c1fe,_0x1336e9){_0x1336e9=_0x1336e9||0x1f4;return function(_0x3bae0c){logger['error'](_0x3bae0c['stack']);if(_0x3bae0c[_0x72b8('0x32')]){delete _0x3bae0c[_0x72b8('0x32')];}_0x37c1fe[_0x72b8('0x25')](_0x1336e9)[_0x72b8('0x33')](_0x3bae0c);};}exports[_0x72b8('0x34')]=function(_0x45192f,_0x352b5c){var _0xd7e9c4={},_0x2035bc={},_0x59fe5e={'count':0x0,'rows':[]};var _0x1252be=_['map'](db['VoiceContext'][_0x72b8('0x35')],function(_0x1b6e58){return{'name':_0x1b6e58['fieldName'],'type':_0x1b6e58[_0x72b8('0x36')]['key']};});_0x2035bc[_0x72b8('0x37')]=_[_0x72b8('0x38')](_0x1252be,_0x72b8('0x32'));_0x2035bc[_0x72b8('0x39')]=_[_0x72b8('0x3a')](_0x45192f['query']);_0x2035bc[_0x72b8('0x3b')]=_[_0x72b8('0x3c')](_0x2035bc[_0x72b8('0x37')],_0x2035bc[_0x72b8('0x39')]);_0xd7e9c4[_0x72b8('0x3d')]=_[_0x72b8('0x3c')](_0x2035bc[_0x72b8('0x37')],qs['fields'](_0x45192f[_0x72b8('0x39')][_0x72b8('0x3e')]));_0xd7e9c4[_0x72b8('0x3d')]=_0xd7e9c4[_0x72b8('0x3d')]['length']?_0xd7e9c4[_0x72b8('0x3d')]:_0x2035bc[_0x72b8('0x37')];if(!_0x45192f[_0x72b8('0x39')]['hasOwnProperty'](_0x72b8('0x3f'))){_0xd7e9c4[_0x72b8('0x40')]=qs[_0x72b8('0x40')](_0x45192f[_0x72b8('0x39')]['limit']);_0xd7e9c4[_0x72b8('0x27')]=qs[_0x72b8('0x27')](_0x45192f[_0x72b8('0x39')][_0x72b8('0x27')]);}_0xd7e9c4['order']=qs[_0x72b8('0x41')](_0x45192f[_0x72b8('0x39')][_0x72b8('0x41')]);_0xd7e9c4['where']=qs[_0x72b8('0x3b')](_['pick'](_0x45192f[_0x72b8('0x39')],_0x2035bc['filters']),_0x1252be);if(_0x45192f[_0x72b8('0x39')]['filter']){_0xd7e9c4[_0x72b8('0x42')]=_[_0x72b8('0x43')](_0xd7e9c4['where'],{'$or':_['map'](_0x1252be,function(_0x20a54f){if(_0x20a54f[_0x72b8('0x36')]!==_0x72b8('0x44')){var _0x4a5119={};_0x4a5119[_0x20a54f['name']]={'$like':'%'+_0x45192f['query'][_0x72b8('0x45')]+'%'};return _0x4a5119;}})});}_0xd7e9c4=_[_0x72b8('0x43')]({},_0xd7e9c4,_0x45192f[_0x72b8('0x46')]);var _0x2a1634={'where':_0xd7e9c4[_0x72b8('0x42')]};return db[_0x72b8('0x47')][_0x72b8('0x29')](_0x2a1634)[_0x72b8('0x1c')](function(_0x1c6f01){_0x59fe5e['count']=_0x1c6f01;if(_0x45192f['query'][_0x72b8('0x48')]){_0xd7e9c4[_0x72b8('0x49')]=[{'all':!![]}];}return db[_0x72b8('0x47')][_0x72b8('0x4a')](_0xd7e9c4);})[_0x72b8('0x1c')](function(_0x48f6a6){_0x59fe5e[_0x72b8('0x4b')]=_0x48f6a6;return _0x59fe5e;})['then'](respondWithFilteredResult(_0x352b5c,_0xd7e9c4))[_0x72b8('0x23')](handleError(_0x352b5c,null));};exports[_0x72b8('0x4c')]=function(_0x1df071,_0x5c238b){var _0x5b233b={'raw':![],'where':{'id':_0x1df071[_0x72b8('0x4d')]['id']}},_0x47d980={};_0x47d980[_0x72b8('0x37')]=_['keys'](db[_0x72b8('0x47')][_0x72b8('0x35')]);_0x47d980[_0x72b8('0x39')]=_['keys'](_0x1df071[_0x72b8('0x39')]);_0x47d980[_0x72b8('0x3b')]=_['intersection'](_0x47d980['model'],_0x47d980['query']);_0x5b233b[_0x72b8('0x3d')]=_[_0x72b8('0x3c')](_0x47d980['model'],qs['fields'](_0x1df071[_0x72b8('0x39')]['fields']));_0x5b233b[_0x72b8('0x3d')]=_0x5b233b[_0x72b8('0x3d')][_0x72b8('0x4e')]?_0x5b233b['attributes']:_0x47d980[_0x72b8('0x37')];if(_0x1df071[_0x72b8('0x39')][_0x72b8('0x48')]){_0x5b233b[_0x72b8('0x49')]=[{'all':!![]}];}_0x5b233b=_['merge']({},_0x5b233b,_0x1df071['options']);return db[_0x72b8('0x47')][_0x72b8('0x4f')](_0x5b233b)[_0x72b8('0x1c')](handleEntityNotFound(_0x5c238b,null))[_0x72b8('0x1c')](respondWithResult(_0x5c238b,null))[_0x72b8('0x23')](handleError(_0x5c238b,null));};exports[_0x72b8('0x50')]=function(_0x2d6fb9,_0x3698c0,_0x46e04d){var _0x271e22;return db[_0x72b8('0x47')][_0x72b8('0x50')](_0x2d6fb9[_0x72b8('0x51')],{'raw':!![]})[_0x72b8('0x1c')](function(_0x41602e){_0x271e22=_0x41602e;return db[_0x72b8('0x47')][_0x72b8('0x4a')]({'raw':!![]});})['then'](function(_0x52c645){var _0x3d36f1=fs[_0x72b8('0x52')](path[_0x72b8('0x53')](config[_0x72b8('0x54')],_0x72b8('0x55')),'utf8');var _0x55bc01=ejs[_0x72b8('0x56')](_0x3d36f1,{'contexts':_0x52c645||[]});fs['writeFileSync'](_0x72b8('0x57'),_0x55bc01);})[_0x72b8('0x1c')](function(){return respondWithRpcPromise('Reload','create',{'module':_0x72b8('0x58')});})[_0x72b8('0x1c')](function(){var _0x322f87=_0x2d6fb9[_0x72b8('0x59')][_0x72b8('0x5a')]({'plain':!![]});if(!_0x322f87)throw new Error(_0x72b8('0x5b'));if(_0x322f87[_0x72b8('0x5c')]===_0x72b8('0x59')){var _0x416657=_0x271e22['get']({'plain':!![]});return db['UserProfileSection'][_0x72b8('0x4f')]({'where':{'name':_0x72b8('0x30'),'userProfileId':_0x322f87['userProfileId']},'raw':!![]})[_0x72b8('0x1c')](function(_0x3323e0){if(_0x3323e0&&_0x3323e0['autoAssociation']===0x0){return db[_0x72b8('0x31')][_0x72b8('0x50')]({'name':_0x416657[_0x72b8('0x32')],'resourceId':_0x416657['id'],'type':_0x3323e0[_0x72b8('0x32')],'sectionId':_0x3323e0['id']},{})[_0x72b8('0x1c')](function(){return _0x271e22;});}else{return _0x271e22;}})['catch'](function(_0x38b6a8){logger[_0x72b8('0x1e')](_0x72b8('0x5d'),_0x38b6a8);throw _0x38b6a8;});}return _0x271e22;})['then'](respondWithResult(_0x3698c0,0xc9))[_0x72b8('0x23')](handleError(_0x3698c0,null));};exports[_0x72b8('0x2e')]=function(_0x31cdbd,_0x33b05f,_0x3ee618){var _0x4d8cf8;return db[_0x72b8('0x47')][_0x72b8('0x4f')]({'where':{'id':_0x31cdbd['params']['id']}})[_0x72b8('0x1c')](handleEntityNotFound(_0x33b05f,null))[_0x72b8('0x1c')](saveUpdates(_0x31cdbd['body'],null))[_0x72b8('0x1c')](function(_0x5a8c8f){if(_0x5a8c8f){_0x4d8cf8=_0x5a8c8f;return db[_0x72b8('0x47')][_0x72b8('0x4a')]({'raw':!![]});}})[_0x72b8('0x1c')](function(_0x2edd7b){var _0xb17c84=fs[_0x72b8('0x52')](path['join'](config[_0x72b8('0x54')],_0x72b8('0x55')),_0x72b8('0x5e'));var _0x2a1c03=ejs[_0x72b8('0x56')](_0xb17c84,{'contexts':_0x2edd7b||[]});fs[_0x72b8('0x5f')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x2a1c03);})['then'](function(){return respondWithRpcPromise(_0x72b8('0x60'),_0x72b8('0x2e'),{'module':'chan_sip.so'});})[_0x72b8('0x1c')](function(){return _0x4d8cf8;})[_0x72b8('0x1c')](respondWithResult(_0x33b05f,null))[_0x72b8('0x23')](handleError(_0x33b05f,null));};exports[_0x72b8('0x2f')]=function(_0xcbc4bf,_0x55ba5e,_0x156339){var _0xa1f788;return db['VoiceContext'][_0x72b8('0x4f')]({'where':{'id':_0xcbc4bf[_0x72b8('0x4d')]['id']}})[_0x72b8('0x1c')](handleEntityNotFound(_0x55ba5e,null))['then'](removeEntity(_0x55ba5e,null))[_0x72b8('0x1c')](function(){return db[_0x72b8('0x47')]['findAll']({'raw':!![]});})[_0x72b8('0x1c')](function(_0x462e38){var _0x12090c=fs[_0x72b8('0x52')](path['join'](config[_0x72b8('0x54')],_0x72b8('0x55')),'utf8');var _0x5cd928=ejs[_0x72b8('0x56')](_0x12090c,{'contexts':_0x462e38});fs[_0x72b8('0x5f')](_0x72b8('0x57'),_0x5cd928);return respondWithRpcPromise(_0x72b8('0x60'),_0x72b8('0x2f'),{'module':_0x72b8('0x58')});})[_0x72b8('0x23')](handleError(_0x55ba5e,null));}; \ No newline at end of file +var _0x314a=['length','hasOwnProperty','nolimit','order','sort','where','filters','pick','map','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','show','keys','rawAttributes','find','create','body','readFileSync','join','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','autoAssociation','writeFileSync','params','root','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','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','http','then','info','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','VoiceContext,\x20%s,\x20%s','message','result','catch','sendStatus','end','status','offset','limit','count','set','json','apply','reject','update','UserProfileResource','destroy','name','send','VoiceContext','type','query','intersection','attributes','model','fields'];(function(_0x15a158,_0x462479){var _0x3d31b8=function(_0x45aaf6){while(--_0x45aaf6){_0x15a158['push'](_0x15a158['shift']());}};_0x3d31b8(++_0x462479);}(_0x314a,0xee));var _0xa314=function(_0x2a0a38,_0x4a6de5){_0x2a0a38=_0x2a0a38-0x0;var _0x4a200e=_0x314a[_0x2a0a38];return _0x4a200e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa314('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa314('0x1'));var rp=require(_0xa314('0x2'));var moment=require('moment');var BPromise=require(_0xa314('0x3'));var Mustache=require(_0xa314('0x4'));var util=require(_0xa314('0x5'));var path=require(_0xa314('0x6'));var sox=require('sox');var csv=require(_0xa314('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa314('0x8'));var _=require(_0xa314('0x9'));var squel=require('squel');var crypto=require(_0xa314('0xa'));var jsforce=require(_0xa314('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xa314('0x7'));var querystring=require(_0xa314('0xc'));var Papa=require(_0xa314('0xd'));var Redis=require(_0xa314('0xe'));var authService=require(_0xa314('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xa314('0x10'));var hardwareService=require(_0xa314('0x11'));var logger=require(_0xa314('0x12'))(_0xa314('0x13'));var utils=require(_0xa314('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xa314('0x15'));var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0xa314('0x16')]({'port':0x232a});function respondWithRpcPromise(_0x5afc84,_0x55bd21,_0x1539fd,_0x3caeff){return new BPromise(function(_0x231108,_0x1f04e3){var _0x31f45c=_0x3caeff||client;return _0x31f45c['request'](_0x5afc84,_0x1539fd)[_0xa314('0x17')](function(_0x4fcee7){logger[_0xa314('0x18')]('VoiceContext,\x20%s,\x20%s',_0x55bd21,_0xa314('0x19'));logger[_0xa314('0x1a')](_0xa314('0x1b'),_0x55bd21,_0xa314('0x19'),JSON[_0xa314('0x1c')](_0x4fcee7));if(_0x4fcee7[_0xa314('0x1d')]){if(_0x4fcee7[_0xa314('0x1d')]['code']===0x1f4){logger['error'](_0xa314('0x1e'),_0x55bd21,_0x4fcee7[_0xa314('0x1d')]['message']);return _0x1f04e3(_0x4fcee7[_0xa314('0x1d')][_0xa314('0x1f')]);}logger[_0xa314('0x1d')]('VoiceContext,\x20%s,\x20%s',_0x55bd21,_0x4fcee7[_0xa314('0x1d')][_0xa314('0x1f')]);return _0x231108(_0x4fcee7[_0xa314('0x1d')]['message']);}else{logger[_0xa314('0x18')](_0xa314('0x1e'),_0x55bd21,_0xa314('0x19'));_0x231108(_0x4fcee7[_0xa314('0x20')][_0xa314('0x1f')]);}})[_0xa314('0x21')](function(_0x4d72c1){logger[_0xa314('0x1d')](_0xa314('0x1e'),_0x55bd21,_0x4d72c1);_0x1f04e3(_0x4d72c1);});});}function respondWithStatusCode(_0x2082a0,_0x5e3ed6){_0x5e3ed6=_0x5e3ed6||0xcc;return function(_0x2e68dc){if(_0x2e68dc){return _0x2082a0[_0xa314('0x22')](_0x5e3ed6);}return _0x2082a0['status'](_0x5e3ed6)[_0xa314('0x23')]();};}function respondWithResult(_0x51abdf,_0x3992eb){_0x3992eb=_0x3992eb||0xc8;return function(_0xa5f3f7){if(_0xa5f3f7){return _0x51abdf[_0xa314('0x24')](_0x3992eb)['json'](_0xa5f3f7);}};}function respondWithFilteredResult(_0x110df4,_0x46c299){return function(_0xa4818e){if(_0xa4818e){var _0x8e8b0d=typeof _0x46c299[_0xa314('0x25')]==='undefined'&&typeof _0x46c299[_0xa314('0x26')]==='undefined';var _0x4ed20c=_0xa4818e[_0xa314('0x27')];var _0x599d34=_0x8e8b0d?0x0:_0x46c299['offset'];var _0x50571a=_0x8e8b0d?_0xa4818e[_0xa314('0x27')]:_0x46c299[_0xa314('0x25')]+_0x46c299[_0xa314('0x26')];var _0x2597bb;if(_0x50571a>=_0x4ed20c){_0x50571a=_0x4ed20c;_0x2597bb=0xc8;}else{_0x2597bb=0xce;}_0x110df4[_0xa314('0x24')](_0x2597bb);return _0x110df4[_0xa314('0x28')]('Content-Range',_0x599d34+'-'+_0x50571a+'/'+_0x4ed20c)[_0xa314('0x29')](_0xa4818e);}return null;};}function patchUpdates(_0x54ce68){return function(_0x4cbb09){try{jsonpatch[_0xa314('0x2a')](_0x4cbb09,_0x54ce68,!![]);}catch(_0xb9c4b4){return BPromise[_0xa314('0x2b')](_0xb9c4b4);}return _0x4cbb09['save']();};}function saveUpdates(_0x4f2304,_0x181011){return function(_0x4bc288){if(_0x4bc288){return _0x4bc288[_0xa314('0x2c')](_0x4f2304)[_0xa314('0x17')](function(_0x1b2458){return _0x1b2458;});}return null;};}function removeEntity(_0x2e322c,_0x3ab381){return function(_0x5072ae){if(_0x5072ae){return _0x5072ae['destroy']()[_0xa314('0x17')](function(){var _0x122327=_0x5072ae['get']({'plain':!![]});var _0x36b024='Contexts';return db[_0xa314('0x2d')][_0xa314('0x2e')]({'where':{'type':_0x36b024,'resourceId':_0x122327['id']}})[_0xa314('0x17')](function(){return _0x5072ae;});})['then'](function(){_0x2e322c[_0xa314('0x24')](0xcc)[_0xa314('0x23')]();});}};}function handleEntityNotFound(_0x58298b,_0x3fb51a){return function(_0x2569c4){if(!_0x2569c4){_0x58298b[_0xa314('0x22')](0x194);}return _0x2569c4;};}function handleError(_0x3f8080,_0x3fb351){_0x3fb351=_0x3fb351||0x1f4;return function(_0x3415dc){logger[_0xa314('0x1d')](_0x3415dc['stack']);if(_0x3415dc[_0xa314('0x2f')]){delete _0x3415dc[_0xa314('0x2f')];}_0x3f8080[_0xa314('0x24')](_0x3fb351)[_0xa314('0x30')](_0x3415dc);};}exports['index']=function(_0x595895,_0x53e4fd){var _0xa36ced={},_0x215f1e={},_0x242637={'count':0x0,'rows':[]};var _0x3552f8=_['map'](db[_0xa314('0x31')]['rawAttributes'],function(_0x461cb2){return{'name':_0x461cb2['fieldName'],'type':_0x461cb2[_0xa314('0x32')]['key']};});_0x215f1e['model']=_['map'](_0x3552f8,_0xa314('0x2f'));_0x215f1e[_0xa314('0x33')]=_['keys'](_0x595895['query']);_0x215f1e['filters']=_[_0xa314('0x34')](_0x215f1e['model'],_0x215f1e[_0xa314('0x33')]);_0xa36ced[_0xa314('0x35')]=_[_0xa314('0x34')](_0x215f1e[_0xa314('0x36')],qs[_0xa314('0x37')](_0x595895[_0xa314('0x33')][_0xa314('0x37')]));_0xa36ced[_0xa314('0x35')]=_0xa36ced[_0xa314('0x35')][_0xa314('0x38')]?_0xa36ced[_0xa314('0x35')]:_0x215f1e[_0xa314('0x36')];if(!_0x595895[_0xa314('0x33')][_0xa314('0x39')](_0xa314('0x3a'))){_0xa36ced[_0xa314('0x26')]=qs['limit'](_0x595895[_0xa314('0x33')][_0xa314('0x26')]);_0xa36ced['offset']=qs[_0xa314('0x25')](_0x595895[_0xa314('0x33')][_0xa314('0x25')]);}_0xa36ced[_0xa314('0x3b')]=qs[_0xa314('0x3c')](_0x595895['query'][_0xa314('0x3c')]);_0xa36ced[_0xa314('0x3d')]=qs[_0xa314('0x3e')](_[_0xa314('0x3f')](_0x595895['query'],_0x215f1e['filters']),_0x3552f8);if(_0x595895[_0xa314('0x33')]['filter']){_0xa36ced[_0xa314('0x3d')]=_['merge'](_0xa36ced[_0xa314('0x3d')],{'$or':_[_0xa314('0x40')](_0x3552f8,function(_0x55984e){if(_0x55984e[_0xa314('0x32')]!==_0xa314('0x41')){var _0x52344b={};_0x52344b[_0x55984e[_0xa314('0x2f')]]={'$like':'%'+_0x595895[_0xa314('0x33')][_0xa314('0x42')]+'%'};return _0x52344b;}})});}_0xa36ced=_[_0xa314('0x43')]({},_0xa36ced,_0x595895[_0xa314('0x44')]);var _0x14a383={'where':_0xa36ced['where']};return db[_0xa314('0x31')]['count'](_0x14a383)[_0xa314('0x17')](function(_0x2c9cad){_0x242637[_0xa314('0x27')]=_0x2c9cad;if(_0x595895[_0xa314('0x33')][_0xa314('0x45')]){_0xa36ced[_0xa314('0x46')]=[{'all':!![]}];}return db[_0xa314('0x31')][_0xa314('0x47')](_0xa36ced);})[_0xa314('0x17')](function(_0xa00839){_0x242637[_0xa314('0x48')]=_0xa00839;return _0x242637;})[_0xa314('0x17')](respondWithFilteredResult(_0x53e4fd,_0xa36ced))[_0xa314('0x21')](handleError(_0x53e4fd,null));};exports[_0xa314('0x49')]=function(_0x3935e7,_0x467e36){var _0xfdd2f8={'raw':![],'where':{'id':_0x3935e7['params']['id']}},_0x429448={};_0x429448[_0xa314('0x36')]=_[_0xa314('0x4a')](db['VoiceContext'][_0xa314('0x4b')]);_0x429448[_0xa314('0x33')]=_[_0xa314('0x4a')](_0x3935e7[_0xa314('0x33')]);_0x429448[_0xa314('0x3e')]=_[_0xa314('0x34')](_0x429448[_0xa314('0x36')],_0x429448[_0xa314('0x33')]);_0xfdd2f8[_0xa314('0x35')]=_[_0xa314('0x34')](_0x429448['model'],qs[_0xa314('0x37')](_0x3935e7['query']['fields']));_0xfdd2f8[_0xa314('0x35')]=_0xfdd2f8['attributes']['length']?_0xfdd2f8[_0xa314('0x35')]:_0x429448[_0xa314('0x36')];if(_0x3935e7['query'][_0xa314('0x45')]){_0xfdd2f8[_0xa314('0x46')]=[{'all':!![]}];}_0xfdd2f8=_[_0xa314('0x43')]({},_0xfdd2f8,_0x3935e7[_0xa314('0x44')]);return db[_0xa314('0x31')][_0xa314('0x4c')](_0xfdd2f8)[_0xa314('0x17')](handleEntityNotFound(_0x467e36,null))[_0xa314('0x17')](respondWithResult(_0x467e36,null))['catch'](handleError(_0x467e36,null));};exports['create']=function(_0x4e319c,_0x2b2531,_0x1fd90c){var _0x3c104e;return db['VoiceContext'][_0xa314('0x4d')](_0x4e319c[_0xa314('0x4e')],{'raw':!![]})['then'](function(_0x21b0ca){_0x3c104e=_0x21b0ca;return db[_0xa314('0x31')][_0xa314('0x47')]({'raw':!![]});})[_0xa314('0x17')](function(_0xafa9ac){var _0x589aa8=fs[_0xa314('0x4f')](path[_0xa314('0x50')](config['root'],_0xa314('0x51')),_0xa314('0x52'));var _0x45493f=ejs[_0xa314('0x53')](_0x589aa8,{'contexts':_0xafa9ac||[]});fs['writeFileSync'](_0xa314('0x54'),_0x45493f);})[_0xa314('0x17')](function(){return respondWithRpcPromise(_0xa314('0x55'),_0xa314('0x4d'),{'module':_0xa314('0x56')});})['then'](function(){var _0x541beb=_0x4e319c[_0xa314('0x57')][_0xa314('0x58')]({'plain':!![]});if(!_0x541beb)throw new Error(_0xa314('0x59'));if(_0x541beb[_0xa314('0x5a')]===_0xa314('0x57')){var _0x46dffd=_0x3c104e[_0xa314('0x58')]({'plain':!![]});return db[_0xa314('0x5b')][_0xa314('0x4c')]({'where':{'name':_0xa314('0x5c'),'userProfileId':_0x541beb[_0xa314('0x5d')]},'raw':!![]})[_0xa314('0x17')](function(_0x10f233){if(_0x10f233&&_0x10f233[_0xa314('0x5e')]===0x0){return db[_0xa314('0x2d')]['create']({'name':_0x46dffd[_0xa314('0x2f')],'resourceId':_0x46dffd['id'],'type':_0x10f233[_0xa314('0x2f')],'sectionId':_0x10f233['id']},{})[_0xa314('0x17')](function(){return _0x3c104e;});}else{return _0x3c104e;}})[_0xa314('0x21')](function(_0x43f12f){logger[_0xa314('0x1d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x43f12f);throw _0x43f12f;});}return _0x3c104e;})[_0xa314('0x17')](respondWithResult(_0x2b2531,0xc9))[_0xa314('0x21')](handleError(_0x2b2531,null));};exports['update']=function(_0x21c000,_0x77e92b,_0x4d10c4){var _0x2a943c;return db['VoiceContext'][_0xa314('0x4c')]({'where':{'id':_0x21c000['params']['id']}})[_0xa314('0x17')](handleEntityNotFound(_0x77e92b,null))[_0xa314('0x17')](saveUpdates(_0x21c000['body'],null))['then'](function(_0x43e9be){if(_0x43e9be){_0x2a943c=_0x43e9be;return db[_0xa314('0x31')]['findAll']({'raw':!![]});}})[_0xa314('0x17')](function(_0x33644a){var _0x528b7f=fs['readFileSync'](path[_0xa314('0x50')](config['root'],_0xa314('0x51')),'utf8');var _0xc3b216=ejs[_0xa314('0x53')](_0x528b7f,{'contexts':_0x33644a||[]});fs[_0xa314('0x5f')](_0xa314('0x54'),_0xc3b216);})[_0xa314('0x17')](function(){return respondWithRpcPromise(_0xa314('0x55'),_0xa314('0x2c'),{'module':_0xa314('0x56')});})[_0xa314('0x17')](function(){return _0x2a943c;})[_0xa314('0x17')](respondWithResult(_0x77e92b,null))[_0xa314('0x21')](handleError(_0x77e92b,null));};exports[_0xa314('0x2e')]=function(_0x379977,_0x1a43ca,_0x54ccf2){var _0x348763;return db['VoiceContext'][_0xa314('0x4c')]({'where':{'id':_0x379977[_0xa314('0x60')]['id']}})['then'](handleEntityNotFound(_0x1a43ca,null))[_0xa314('0x17')](removeEntity(_0x1a43ca,null))['then'](function(){return db['VoiceContext'][_0xa314('0x47')]({'raw':!![]});})['then'](function(_0x41af16){var _0x592d1a=fs[_0xa314('0x4f')](path[_0xa314('0x50')](config[_0xa314('0x61')],'server/files/templates/context.ejs'),'utf8');var _0x166140=ejs[_0xa314('0x53')](_0x592d1a,{'contexts':_0x41af16});fs[_0xa314('0x5f')](_0xa314('0x54'),_0x166140);return respondWithRpcPromise(_0xa314('0x55'),_0xa314('0x2e'),{'module':_0xa314('0x56')});})[_0xa314('0x21')](handleError(_0x1a43ca,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index 501ae77..74b7eb9 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 _0x0a3e=['../../config/environment','./voiceContext.attributes','exports','define','VoiceContext','voice_contexts','lodash','util','../../config/logger','api','request-promise','path','rimraf'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0a3e,0xd6));var _0xe0a3=function(_0x3c6965,_0x286311){_0x3c6965=_0x3c6965-0x0;var _0xe1b601=_0x0a3e[_0x3c6965];return _0xe1b601;};'use strict';var _=require(_0xe0a3('0x0'));var util=require(_0xe0a3('0x1'));var logger=require(_0xe0a3('0x2'))(_0xe0a3('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xe0a3('0x4'));var fs=require('fs');var path=require(_0xe0a3('0x5'));var rimraf=require(_0xe0a3('0x6'));var config=require(_0xe0a3('0x7'));var attributes=require(_0xe0a3('0x8'));module[_0xe0a3('0x9')]=function(_0x238bc4,_0x920873){return _0x238bc4[_0xe0a3('0xa')](_0xe0a3('0xb'),attributes,{'tableName':_0xe0a3('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0031=['VoiceContext','voice_contexts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceContext.attributes','exports','define'];(function(_0x383627,_0x5be16e){var _0x2c16a0=function(_0x569b72){while(--_0x569b72){_0x383627['push'](_0x383627['shift']());}};_0x2c16a0(++_0x5be16e);}(_0x0031,0x6b));var _0x1003=function(_0x4529e0,_0x23a383){_0x4529e0=_0x4529e0-0x0;var _0x31bbc6=_0x0031[_0x4529e0];return _0x31bbc6;};'use strict';var _=require(_0x1003('0x0'));var util=require(_0x1003('0x1'));var logger=require(_0x1003('0x2'))(_0x1003('0x3'));var moment=require(_0x1003('0x4'));var BPromise=require(_0x1003('0x5'));var rp=require(_0x1003('0x6'));var fs=require('fs');var path=require(_0x1003('0x7'));var rimraf=require(_0x1003('0x8'));var config=require(_0x1003('0x9'));var attributes=require(_0x1003('0xa'));module[_0x1003('0xb')]=function(_0x1d444c,_0x176cdf){return _0x1d444c[_0x1003('0xc')](_0x1003('0xd'),attributes,{'tableName':_0x1003('0xe'),'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 ee241d3..00a3d24 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 _0xeb43=['request\x20sent','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceContext,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','../../config/utils','../../config/logger','jayson/promise','client','request','then','info'];(function(_0x27a3cb,_0x4af597){var _0x54ff38=function(_0x3a82d2){while(--_0x3a82d2){_0x27a3cb['push'](_0x27a3cb['shift']());}};_0x54ff38(++_0x4af597);}(_0xeb43,0x149));var _0x3eb4=function(_0x3b16e1,_0x3bda3e){_0x3b16e1=_0x3b16e1-0x0;var _0x311d1b=_0xeb43[_0x3b16e1];return _0x311d1b;};'use strict';var _=require(_0x3eb4('0x0'));var util=require(_0x3eb4('0x1'));var moment=require(_0x3eb4('0x2'));var BPromise=require('bluebird');var rs=require(_0x3eb4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x3eb4('0x4'));var logger=require(_0x3eb4('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x3eb4('0x6'));var client=jayson[_0x3eb4('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x45b9b8,_0x5d8f80,_0x14f2c3){return new BPromise(function(_0x557a28,_0x43570f){return client[_0x3eb4('0x8')](_0x45b9b8,_0x14f2c3)[_0x3eb4('0x9')](function(_0x10f337){logger[_0x3eb4('0xa')]('VoiceContext,\x20%s,\x20%s',_0x5d8f80,_0x3eb4('0xb'));logger['debug'](_0x3eb4('0xc'),_0x5d8f80,_0x3eb4('0xb'),JSON[_0x3eb4('0xd')](_0x10f337));if(_0x10f337[_0x3eb4('0xe')]){if(_0x10f337['error'][_0x3eb4('0xf')]===0x1f4){logger[_0x3eb4('0xe')](_0x3eb4('0x10'),_0x5d8f80,_0x10f337[_0x3eb4('0xe')][_0x3eb4('0x11')]);return _0x43570f(_0x10f337[_0x3eb4('0xe')]['message']);}logger[_0x3eb4('0xe')]('VoiceContext,\x20%s,\x20%s',_0x5d8f80,_0x10f337['error'][_0x3eb4('0x11')]);return _0x557a28(_0x10f337['error'][_0x3eb4('0x11')]);}else{logger[_0x3eb4('0xa')](_0x3eb4('0x10'),_0x5d8f80,_0x3eb4('0xb'));_0x557a28(_0x10f337[_0x3eb4('0x12')][_0x3eb4('0x11')]);}})[_0x3eb4('0x13')](function(_0x3fdd27){logger[_0x3eb4('0xe')](_0x3eb4('0x10'),_0x5d8f80,_0x3fdd27);_0x43570f(_0x3fdd27);});});} \ No newline at end of file +var _0xd86f=['../../config/utils','jayson/promise','client','http','request','then','info','VoiceContext,\x20%s,\x20%s','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x4053a8,_0xd8fd82){var _0x35a79b=function(_0x5ad4b2){while(--_0x5ad4b2){_0x4053a8['push'](_0x4053a8['shift']());}};_0x35a79b(++_0xd8fd82);}(_0xd86f,0xf6));var _0xfd86=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0xd86f[_0x53ccf2];return _0x5a2964;};'use strict';var _=require(_0xfd86('0x0'));var util=require(_0xfd86('0x1'));var moment=require(_0xfd86('0x2'));var BPromise=require(_0xfd86('0x3'));var rs=require(_0xfd86('0x4'));var fs=require('fs');var Redis=require(_0xfd86('0x5'));var db=require(_0xfd86('0x6'))['db'];var utils=require(_0xfd86('0x7'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xfd86('0x8'));var client=jayson[_0xfd86('0x9')][_0xfd86('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x52baeb,_0x4d1781,_0xa7cae3){return new BPromise(function(_0x5bf033,_0x4e5d6d){return client[_0xfd86('0xb')](_0x52baeb,_0xa7cae3)[_0xfd86('0xc')](function(_0x1a1932){logger[_0xfd86('0xd')](_0xfd86('0xe'),_0x4d1781,'request\x20sent');logger[_0xfd86('0xf')](_0xfd86('0x10'),_0x4d1781,'request\x20sent',JSON[_0xfd86('0x11')](_0x1a1932));if(_0x1a1932[_0xfd86('0x12')]){if(_0x1a1932[_0xfd86('0x12')]['code']===0x1f4){logger[_0xfd86('0x12')]('VoiceContext,\x20%s,\x20%s',_0x4d1781,_0x1a1932['error'][_0xfd86('0x13')]);return _0x4e5d6d(_0x1a1932[_0xfd86('0x12')]['message']);}logger[_0xfd86('0x12')]('VoiceContext,\x20%s,\x20%s',_0x4d1781,_0x1a1932[_0xfd86('0x12')][_0xfd86('0x13')]);return _0x5bf033(_0x1a1932[_0xfd86('0x12')][_0xfd86('0x13')]);}else{logger[_0xfd86('0xd')](_0xfd86('0xe'),_0x4d1781,_0xfd86('0x14'));_0x5bf033(_0x1a1932[_0xfd86('0x15')]['message']);}})[_0xfd86('0x16')](function(_0x23d34f){logger['error'](_0xfd86('0xe'),_0x4d1781,_0x23d34f);_0x4e5d6d(_0x23d34f);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index 51e77e4..4e7fcdb 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 _0x1360=['update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','get','isAuthenticated','index','describe','/:id','show','post','create','put'];(function(_0x2ab2cc,_0xe88512){var _0x4f89f6=function(_0x3f6e6c){while(--_0x3f6e6c){_0x2ab2cc['push'](_0x2ab2cc['shift']());}};_0x4f89f6(++_0xe88512);}(_0x1360,0xd6));var _0x0136=function(_0x3b534c,_0x2c614f){_0x3b534c=_0x3b534c-0x0;var _0x449ef9=_0x1360[_0x3b534c];return _0x449ef9;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x0136('0x0'));var timeout=require(_0x0136('0x1'));var express=require(_0x0136('0x2'));var router=express[_0x0136('0x3')]();var fs_extra=require(_0x0136('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x0136('0x5'));var config=require(_0x0136('0x6'));var controller=require(_0x0136('0x7'));router[_0x0136('0x8')]('/',auth[_0x0136('0x9')](),controller[_0x0136('0xa')]);router['get']('/describe',auth[_0x0136('0x9')](),controller[_0x0136('0xb')]);router[_0x0136('0x8')](_0x0136('0xc'),auth[_0x0136('0x9')](),controller[_0x0136('0xd')]);router[_0x0136('0xe')]('/',auth[_0x0136('0x9')](),controller[_0x0136('0xf')]);router[_0x0136('0x10')]('/:id',auth[_0x0136('0x9')](),controller[_0x0136('0x11')]);router[_0x0136('0x12')](_0x0136('0xc'),auth[_0x0136('0x9')](),controller[_0x0136('0x13')]);module[_0x0136('0x14')]=router; \ No newline at end of file +var _0x8d7e=['Router','fs-extra','../../config/environment','./voiceDialReport.controller','get','index','/describe','isAuthenticated','describe','/:id','update','delete','exports','multer','path','express'];(function(_0x5a8bbc,_0x4ced07){var _0x5bc98c=function(_0x3b9a4f){while(--_0x3b9a4f){_0x5a8bbc['push'](_0x5a8bbc['shift']());}};_0x5bc98c(++_0x4ced07);}(_0x8d7e,0x7d));var _0xe8d7=function(_0x260cfc,_0x323f78){_0x260cfc=_0x260cfc-0x0;var _0xed1077=_0x8d7e[_0x260cfc];return _0xed1077;};'use strict';var multer=require(_0xe8d7('0x0'));var util=require('util');var path=require(_0xe8d7('0x1'));var timeout=require('connect-timeout');var express=require(_0xe8d7('0x2'));var router=express[_0xe8d7('0x3')]();var fs_extra=require(_0xe8d7('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xe8d7('0x5'));var controller=require(_0xe8d7('0x6'));router[_0xe8d7('0x7')]('/',auth['isAuthenticated'](),controller[_0xe8d7('0x8')]);router[_0xe8d7('0x7')](_0xe8d7('0x9'),auth[_0xe8d7('0xa')](),controller[_0xe8d7('0xb')]);router[_0xe8d7('0x7')](_0xe8d7('0xc'),auth[_0xe8d7('0xa')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xe8d7('0xc'),auth[_0xe8d7('0xa')](),controller[_0xe8d7('0xd')]);router[_0xe8d7('0xe')](_0xe8d7('0xc'),auth[_0xe8d7('0xa')](),controller['destroy']);module[_0xe8d7('0xf')]=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index 88db09b..3e2a6fc 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 _0x8d0e=['INTEGER','DATE','called,connect,complete','sequelize','exports','STRING'];(function(_0xa5f5ab,_0x251aa3){var _0xc25c1b=function(_0x10af38){while(--_0x10af38){_0xa5f5ab['push'](_0xa5f5ab['shift']());}};_0xc25c1b(++_0x251aa3);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x473399,_0x1cea7d){_0x473399=_0x473399-0x0;var _0x106022=_0x8d0e[_0x473399];return _0x106022;};'use strict';var Sequelize=require(_0xe8d0('0x0'));module[_0xe8d0('0x1')]={'privilege':{'type':Sequelize[_0xe8d0('0x2')]},'channel':{'type':Sequelize[_0xe8d0('0x2')]},'channelstate':{'type':Sequelize[_0xe8d0('0x3')]},'channelstatedesc':{'type':Sequelize[_0xe8d0('0x2')]},'calleridnum':{'type':Sequelize[_0xe8d0('0x2')]},'calleridname':{'type':Sequelize[_0xe8d0('0x2')]},'connectedlinenum':{'type':Sequelize[_0xe8d0('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xe8d0('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0xe8d0('0x2')]},'priority':{'type':Sequelize[_0xe8d0('0x3')]},'uniqueid':{'type':Sequelize[_0xe8d0('0x2')]},'linkedid':{'type':Sequelize[_0xe8d0('0x2')]},'destchannel':{'type':Sequelize[_0xe8d0('0x2')]},'destchannelstate':{'type':Sequelize[_0xe8d0('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0xe8d0('0x2')]},'destcalleridnum':{'type':Sequelize[_0xe8d0('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0xe8d0('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xe8d0('0x2')]},'destlanguage':{'type':Sequelize[_0xe8d0('0x2')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0xe8d0('0x2')]},'destpriority':{'type':Sequelize[_0xe8d0('0x3')]},'destuniqueid':{'type':Sequelize[_0xe8d0('0x2')]},'destlinkedid':{'type':Sequelize[_0xe8d0('0x2')]},'dialstring':{'type':Sequelize[_0xe8d0('0x2')]},'dialstatus':{'type':Sequelize[_0xe8d0('0x2')]},'starttime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xe8d0('0x4')]},'endtime':{'type':Sequelize[_0xe8d0('0x4')]},'lastevent':{'type':Sequelize['STRING'],'comment':_0xe8d0('0x5')},'routeId':{'type':Sequelize['INTEGER']},'duration':{'type':Sequelize['INTEGER']},'holdtime':{'type':Sequelize[_0xe8d0('0x3')]},'billableseconds':{'type':Sequelize[_0xe8d0('0x3')]}}; \ No newline at end of file +var _0x24ca=['STRING','INTEGER','DATE','called,connect,complete','sequelize'];(function(_0x5bfad2,_0x64dd5b){var _0x56441b=function(_0x5a1da9){while(--_0x5a1da9){_0x5bfad2['push'](_0x5bfad2['shift']());}};_0x56441b(++_0x64dd5b);}(_0x24ca,0x1bc));var _0xa24c=function(_0x4c5c97,_0x4f85bf){_0x4c5c97=_0x4c5c97-0x0;var _0xd5d2cb=_0x24ca[_0x4c5c97];return _0xd5d2cb;};'use strict';var Sequelize=require(_0xa24c('0x0'));module['exports']={'privilege':{'type':Sequelize[_0xa24c('0x1')]},'channel':{'type':Sequelize[_0xa24c('0x1')]},'channelstate':{'type':Sequelize[_0xa24c('0x2')]},'channelstatedesc':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xa24c('0x1')]},'calleridname':{'type':Sequelize[_0xa24c('0x1')]},'connectedlinenum':{'type':Sequelize[_0xa24c('0x1')]},'connectedlinename':{'type':Sequelize[_0xa24c('0x1')]},'language':{'type':Sequelize[_0xa24c('0x1')]},'accountcode':{'type':Sequelize[_0xa24c('0x1')]},'context':{'type':Sequelize[_0xa24c('0x1')]},'exten':{'type':Sequelize[_0xa24c('0x1')]},'priority':{'type':Sequelize[_0xa24c('0x2')]},'uniqueid':{'type':Sequelize[_0xa24c('0x1')]},'linkedid':{'type':Sequelize[_0xa24c('0x1')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xa24c('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0xa24c('0x1')]},'destcalleridnum':{'type':Sequelize[_0xa24c('0x1')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0xa24c('0x1')]},'destconnectedlinename':{'type':Sequelize[_0xa24c('0x1')]},'destlanguage':{'type':Sequelize[_0xa24c('0x1')]},'destaccountcode':{'type':Sequelize[_0xa24c('0x1')]},'destcontext':{'type':Sequelize[_0xa24c('0x1')]},'destexten':{'type':Sequelize[_0xa24c('0x1')]},'destpriority':{'type':Sequelize[_0xa24c('0x2')]},'destuniqueid':{'type':Sequelize[_0xa24c('0x1')]},'destlinkedid':{'type':Sequelize[_0xa24c('0x1')]},'dialstring':{'type':Sequelize['STRING']},'dialstatus':{'type':Sequelize[_0xa24c('0x1')]},'starttime':{'type':Sequelize[_0xa24c('0x3')]},'answertime':{'type':Sequelize[_0xa24c('0x3')]},'endtime':{'type':Sequelize[_0xa24c('0x3')]},'lastevent':{'type':Sequelize['STRING'],'comment':_0xa24c('0x4')},'routeId':{'type':Sequelize[_0xa24c('0x2')]},'duration':{'type':Sequelize[_0xa24c('0x2')]},'holdtime':{'type':Sequelize[_0xa24c('0x2')]},'billableseconds':{'type':Sequelize[_0xa24c('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index e48d2b0..c1a5bd5 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 _0xb75b=['where','pick','filter','merge','VIRTUAL','VoiceDialReport','includeAll','findAll','rows','catch','show','params','include','options','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','update','destroy','then','error','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','sort'];(function(_0x29adb7,_0x4356ec){var _0x2d676d=function(_0x20b2a8){while(--_0x20b2a8){_0x29adb7['push'](_0x29adb7['shift']());}};_0x2d676d(++_0x4356ec);}(_0xb75b,0xea));var _0xbb75=function(_0x112e8b,_0x4ad05e){_0x112e8b=_0x112e8b-0x0;var _0x5e161a=_0xb75b[_0x112e8b];return _0x5e161a;};'use strict';var emlformat=require(_0xbb75('0x0'));var rimraf=require(_0xbb75('0x1'));var zipdir=require(_0xbb75('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbb75('0x3'));var moment=require(_0xbb75('0x4'));var BPromise=require(_0xbb75('0x5'));var Mustache=require(_0xbb75('0x6'));var util=require(_0xbb75('0x7'));var path=require(_0xbb75('0x8'));var sox=require(_0xbb75('0x9'));var csv=require(_0xbb75('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xbb75('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xbb75('0xc'));var toCsv=require(_0xbb75('0xa'));var querystring=require(_0xbb75('0xd'));var Papa=require(_0xbb75('0xe'));var Redis=require(_0xbb75('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xbb75('0x10'));var hardwareService=require(_0xbb75('0x11'));var logger=require('../../config/logger')(_0xbb75('0x12'));var utils=require(_0xbb75('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xbb75('0x14'));var db=require(_0xbb75('0x15'))['db'];function respondWithStatusCode(_0x56c50f,_0x5c381c){_0x5c381c=_0x5c381c||0xcc;return function(_0x3f9714){if(_0x3f9714){return _0x56c50f[_0xbb75('0x16')](_0x5c381c);}return _0x56c50f['status'](_0x5c381c)[_0xbb75('0x17')]();};}function respondWithResult(_0x30f7ae,_0x437123){_0x437123=_0x437123||0xc8;return function(_0x3b6201){if(_0x3b6201){return _0x30f7ae[_0xbb75('0x18')](_0x437123)[_0xbb75('0x19')](_0x3b6201);}};}function respondWithFilteredResult(_0x173a3c,_0x4336eb){return function(_0xef63fd){if(_0xef63fd){var _0x9a308f=typeof _0x4336eb[_0xbb75('0x1a')]===_0xbb75('0x1b')&&typeof _0x4336eb[_0xbb75('0x1c')]===_0xbb75('0x1b');var _0x59d803=_0xef63fd['count'];var _0x25d1cf=_0x9a308f?0x0:_0x4336eb[_0xbb75('0x1a')];var _0x50bba4=_0x9a308f?_0xef63fd[_0xbb75('0x1d')]:_0x4336eb[_0xbb75('0x1a')]+_0x4336eb[_0xbb75('0x1c')];var _0x2708d4;if(_0x50bba4>=_0x59d803){_0x50bba4=_0x59d803;_0x2708d4=0xc8;}else{_0x2708d4=0xce;}_0x173a3c['status'](_0x2708d4);return _0x173a3c[_0xbb75('0x1e')](_0xbb75('0x1f'),_0x25d1cf+'-'+_0x50bba4+'/'+_0x59d803)[_0xbb75('0x19')](_0xef63fd);}return null;};}function patchUpdates(_0x55d948){return function(_0x3ff2e8){try{jsonpatch[_0xbb75('0x20')](_0x3ff2e8,_0x55d948,!![]);}catch(_0x46e856){return BPromise['reject'](_0x46e856);}return _0x3ff2e8['save']();};}function saveUpdates(_0x401d18,_0x3bd590){return function(_0x2864b3){if(_0x2864b3){return _0x2864b3[_0xbb75('0x21')](_0x401d18)['then'](function(_0x1a636e){return _0x1a636e;});}return null;};}function removeEntity(_0x4c9529,_0xd7edf2){return function(_0x2f9fda){if(_0x2f9fda){return _0x2f9fda[_0xbb75('0x22')]()[_0xbb75('0x23')](function(){_0x4c9529['status'](0xcc)[_0xbb75('0x17')]();});}};}function handleEntityNotFound(_0x48c795,_0x3d3946){return function(_0x252926){if(!_0x252926){_0x48c795[_0xbb75('0x16')](0x194);}return _0x252926;};}function handleError(_0x219651,_0x1007e9){_0x1007e9=_0x1007e9||0x1f4;return function(_0x2142de){logger[_0xbb75('0x24')](_0x2142de['stack']);if(_0x2142de[_0xbb75('0x25')]){delete _0x2142de[_0xbb75('0x25')];}_0x219651[_0xbb75('0x18')](_0x1007e9)[_0xbb75('0x26')](_0x2142de);};}exports[_0xbb75('0x27')]=function(_0x1d98d7,_0x3b30bf){var _0x26c536={},_0x3f3b64={},_0xc495f1={'count':0x0,'rows':[]};var _0x1e2963=_[_0xbb75('0x28')](db['VoiceDialReport'][_0xbb75('0x29')],function(_0x452f3c){return{'name':_0x452f3c[_0xbb75('0x2a')],'type':_0x452f3c['type'][_0xbb75('0x2b')]};});_0x3f3b64[_0xbb75('0x2c')]=_[_0xbb75('0x28')](_0x1e2963,_0xbb75('0x25'));_0x3f3b64[_0xbb75('0x2d')]=_[_0xbb75('0x2e')](_0x1d98d7[_0xbb75('0x2d')]);_0x3f3b64[_0xbb75('0x2f')]=_[_0xbb75('0x30')](_0x3f3b64[_0xbb75('0x2c')],_0x3f3b64[_0xbb75('0x2d')]);_0x26c536['attributes']=_['intersection'](_0x3f3b64[_0xbb75('0x2c')],qs['fields'](_0x1d98d7[_0xbb75('0x2d')][_0xbb75('0x31')]));_0x26c536[_0xbb75('0x32')]=_0x26c536[_0xbb75('0x32')][_0xbb75('0x33')]?_0x26c536['attributes']:_0x3f3b64['model'];if(!_0x1d98d7[_0xbb75('0x2d')][_0xbb75('0x34')]('nolimit')){_0x26c536['limit']=qs[_0xbb75('0x1c')](_0x1d98d7[_0xbb75('0x2d')]['limit']);_0x26c536[_0xbb75('0x1a')]=qs[_0xbb75('0x1a')](_0x1d98d7[_0xbb75('0x2d')][_0xbb75('0x1a')]);}_0x26c536['order']=qs[_0xbb75('0x35')](_0x1d98d7[_0xbb75('0x2d')][_0xbb75('0x35')]);_0x26c536[_0xbb75('0x36')]=qs[_0xbb75('0x2f')](_[_0xbb75('0x37')](_0x1d98d7[_0xbb75('0x2d')],_0x3f3b64[_0xbb75('0x2f')]),_0x1e2963);if(_0x1d98d7[_0xbb75('0x2d')][_0xbb75('0x38')]){_0x26c536[_0xbb75('0x36')]=_[_0xbb75('0x39')](_0x26c536[_0xbb75('0x36')],{'$or':_['map'](_0x1e2963,function(_0x371515){if(_0x371515['type']!==_0xbb75('0x3a')){var _0x5d7dd0={};_0x5d7dd0[_0x371515[_0xbb75('0x25')]]={'$like':'%'+_0x1d98d7[_0xbb75('0x2d')][_0xbb75('0x38')]+'%'};return _0x5d7dd0;}})});}_0x26c536=_['merge']({},_0x26c536,_0x1d98d7['options']);var _0x67409d={'where':_0x26c536['where']};return db[_0xbb75('0x3b')][_0xbb75('0x1d')](_0x67409d)[_0xbb75('0x23')](function(_0x211253){_0xc495f1[_0xbb75('0x1d')]=_0x211253;if(_0x1d98d7[_0xbb75('0x2d')][_0xbb75('0x3c')]){_0x26c536['include']=[{'all':!![]}];}return db[_0xbb75('0x3b')][_0xbb75('0x3d')](_0x26c536);})[_0xbb75('0x23')](function(_0x55abdb){_0xc495f1[_0xbb75('0x3e')]=_0x55abdb;return _0xc495f1;})[_0xbb75('0x23')](respondWithFilteredResult(_0x3b30bf,_0x26c536))[_0xbb75('0x3f')](handleError(_0x3b30bf,null));};exports[_0xbb75('0x40')]=function(_0x6aca6e,_0x10f9f5){var _0x2203af={'raw':!![],'where':{'id':_0x6aca6e[_0xbb75('0x41')]['id']}},_0x1b576e={};_0x1b576e[_0xbb75('0x2c')]=_[_0xbb75('0x2e')](db[_0xbb75('0x3b')]['rawAttributes']);_0x1b576e[_0xbb75('0x2d')]=_['keys'](_0x6aca6e[_0xbb75('0x2d')]);_0x1b576e['filters']=_[_0xbb75('0x30')](_0x1b576e[_0xbb75('0x2c')],_0x1b576e['query']);_0x2203af['attributes']=_[_0xbb75('0x30')](_0x1b576e[_0xbb75('0x2c')],qs[_0xbb75('0x31')](_0x6aca6e['query'][_0xbb75('0x31')]));_0x2203af[_0xbb75('0x32')]=_0x2203af[_0xbb75('0x32')][_0xbb75('0x33')]?_0x2203af[_0xbb75('0x32')]:_0x1b576e['model'];if(_0x6aca6e[_0xbb75('0x2d')][_0xbb75('0x3c')]){_0x2203af[_0xbb75('0x42')]=[{'all':!![]}];}_0x2203af=_[_0xbb75('0x39')]({},_0x2203af,_0x6aca6e[_0xbb75('0x43')]);return db[_0xbb75('0x3b')][_0xbb75('0x44')](_0x2203af)[_0xbb75('0x23')](handleEntityNotFound(_0x10f9f5,null))['then'](respondWithResult(_0x10f9f5,null))[_0xbb75('0x3f')](handleError(_0x10f9f5,null));};exports[_0xbb75('0x45')]=function(_0x285e8a,_0x3adfc9){return db[_0xbb75('0x3b')][_0xbb75('0x45')](_0x285e8a[_0xbb75('0x46')],{})['then'](respondWithResult(_0x3adfc9,0xc9))[_0xbb75('0x3f')](handleError(_0x3adfc9,null));};exports[_0xbb75('0x21')]=function(_0x54b6e6,_0x34204d){if(_0x54b6e6[_0xbb75('0x46')]['id']){delete _0x54b6e6[_0xbb75('0x46')]['id'];}return db[_0xbb75('0x3b')]['find']({'where':{'id':_0x54b6e6[_0xbb75('0x41')]['id']}})[_0xbb75('0x23')](handleEntityNotFound(_0x34204d,null))[_0xbb75('0x23')](saveUpdates(_0x54b6e6['body'],null))[_0xbb75('0x23')](respondWithResult(_0x34204d,null))[_0xbb75('0x3f')](handleError(_0x34204d,null));};exports[_0xbb75('0x22')]=function(_0x554cc8,_0x5a0f1f){return db['VoiceDialReport']['find']({'where':{'id':_0x554cc8[_0xbb75('0x41')]['id']}})['then'](handleEntityNotFound(_0x5a0f1f,null))[_0xbb75('0x23')](removeEntity(_0x5a0f1f,null))['catch'](handleError(_0x5a0f1f,null));};exports[_0xbb75('0x47')]=function(_0xb36e49,_0x3808a3){return db['VoiceDialReport'][_0xbb75('0x47')]()[_0xbb75('0x23')](respondWithResult(_0x3808a3,null))[_0xbb75('0x3f')](handleError(_0x3808a3,null));}; \ No newline at end of file +var _0x9bef=['filter','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','undefined','count','offset','set','apply','reject','save','update','then','destroy','stack','name','index','map','VoiceDialReport','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','order','sort','where','pick'];(function(_0x22ce9c,_0x4d9ce0){var _0x5ed38e=function(_0x5b0782){while(--_0x5b0782){_0x22ce9c['push'](_0x22ce9c['shift']());}};_0x5ed38e(++_0x4d9ce0);}(_0x9bef,0x186));var _0xf9be=function(_0xd5faf0,_0x3e95cd){_0xd5faf0=_0xd5faf0-0x0;var _0x14c14e=_0x9bef[_0xd5faf0];return _0x14c14e;};'use strict';var emlformat=require(_0xf9be('0x0'));var rimraf=require(_0xf9be('0x1'));var zipdir=require(_0xf9be('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf9be('0x3'));var moment=require(_0xf9be('0x4'));var BPromise=require(_0xf9be('0x5'));var Mustache=require(_0xf9be('0x6'));var util=require(_0xf9be('0x7'));var path=require(_0xf9be('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xf9be('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf9be('0xa'));var squel=require(_0xf9be('0xb'));var crypto=require(_0xf9be('0xc'));var jsforce=require(_0xf9be('0xd'));var deskjs=require(_0xf9be('0xe'));var toCsv=require(_0xf9be('0xf'));var querystring=require(_0xf9be('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xf9be('0x11'));var qs=require(_0xf9be('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf9be('0x13'));var logger=require(_0xf9be('0x14'))(_0xf9be('0x15'));var utils=require(_0xf9be('0x16'));var config=require(_0xf9be('0x17'));var licenseUtil=require(_0xf9be('0x18'));var db=require(_0xf9be('0x19'))['db'];function respondWithStatusCode(_0x430972,_0x41d7f4){_0x41d7f4=_0x41d7f4||0xcc;return function(_0x3510e0){if(_0x3510e0){return _0x430972[_0xf9be('0x1a')](_0x41d7f4);}return _0x430972['status'](_0x41d7f4)['end']();};}function respondWithResult(_0x2de050,_0x195f72){_0x195f72=_0x195f72||0xc8;return function(_0x2fe527){if(_0x2fe527){return _0x2de050[_0xf9be('0x1b')](_0x195f72)[_0xf9be('0x1c')](_0x2fe527);}};}function respondWithFilteredResult(_0x3441e9,_0x402def){return function(_0x4d23c6){if(_0x4d23c6){var _0x4d3760=typeof _0x402def['offset']==='undefined'&&typeof _0x402def[_0xf9be('0x1d')]===_0xf9be('0x1e');var _0x9d2709=_0x4d23c6[_0xf9be('0x1f')];var _0x19e48e=_0x4d3760?0x0:_0x402def[_0xf9be('0x20')];var _0x36443d=_0x4d3760?_0x4d23c6[_0xf9be('0x1f')]:_0x402def[_0xf9be('0x20')]+_0x402def[_0xf9be('0x1d')];var _0x80b079;if(_0x36443d>=_0x9d2709){_0x36443d=_0x9d2709;_0x80b079=0xc8;}else{_0x80b079=0xce;}_0x3441e9[_0xf9be('0x1b')](_0x80b079);return _0x3441e9[_0xf9be('0x21')]('Content-Range',_0x19e48e+'-'+_0x36443d+'/'+_0x9d2709)[_0xf9be('0x1c')](_0x4d23c6);}return null;};}function patchUpdates(_0x4d8824){return function(_0x5c98e7){try{jsonpatch[_0xf9be('0x22')](_0x5c98e7,_0x4d8824,!![]);}catch(_0x3d3b2d){return BPromise[_0xf9be('0x23')](_0x3d3b2d);}return _0x5c98e7[_0xf9be('0x24')]();};}function saveUpdates(_0x4b5982,_0x2b4f81){return function(_0x4bba50){if(_0x4bba50){return _0x4bba50[_0xf9be('0x25')](_0x4b5982)[_0xf9be('0x26')](function(_0x3efbc0){return _0x3efbc0;});}return null;};}function removeEntity(_0x2233ea,_0x5056fe){return function(_0x48e9c2){if(_0x48e9c2){return _0x48e9c2[_0xf9be('0x27')]()['then'](function(){_0x2233ea[_0xf9be('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1eb0fc,_0x2f5ebc){return function(_0x2a2017){if(!_0x2a2017){_0x1eb0fc[_0xf9be('0x1a')](0x194);}return _0x2a2017;};}function handleError(_0x3ef734,_0x49eae7){_0x49eae7=_0x49eae7||0x1f4;return function(_0x2e4d85){logger['error'](_0x2e4d85[_0xf9be('0x28')]);if(_0x2e4d85[_0xf9be('0x29')]){delete _0x2e4d85[_0xf9be('0x29')];}_0x3ef734[_0xf9be('0x1b')](_0x49eae7)['send'](_0x2e4d85);};}exports[_0xf9be('0x2a')]=function(_0x4659d4,_0x52daa5){var _0x4ed5f3={},_0xa57f66={},_0x483be1={'count':0x0,'rows':[]};var _0x361841=_[_0xf9be('0x2b')](db[_0xf9be('0x2c')][_0xf9be('0x2d')],function(_0x3e14b1){return{'name':_0x3e14b1[_0xf9be('0x2e')],'type':_0x3e14b1[_0xf9be('0x2f')]['key']};});_0xa57f66[_0xf9be('0x30')]=_[_0xf9be('0x2b')](_0x361841,_0xf9be('0x29'));_0xa57f66['query']=_[_0xf9be('0x31')](_0x4659d4[_0xf9be('0x32')]);_0xa57f66[_0xf9be('0x33')]=_[_0xf9be('0x34')](_0xa57f66['model'],_0xa57f66[_0xf9be('0x32')]);_0x4ed5f3[_0xf9be('0x35')]=_[_0xf9be('0x34')](_0xa57f66[_0xf9be('0x30')],qs[_0xf9be('0x36')](_0x4659d4[_0xf9be('0x32')][_0xf9be('0x36')]));_0x4ed5f3[_0xf9be('0x35')]=_0x4ed5f3['attributes'][_0xf9be('0x37')]?_0x4ed5f3[_0xf9be('0x35')]:_0xa57f66[_0xf9be('0x30')];if(!_0x4659d4[_0xf9be('0x32')]['hasOwnProperty']('nolimit')){_0x4ed5f3[_0xf9be('0x1d')]=qs[_0xf9be('0x1d')](_0x4659d4['query'][_0xf9be('0x1d')]);_0x4ed5f3[_0xf9be('0x20')]=qs[_0xf9be('0x20')](_0x4659d4[_0xf9be('0x32')][_0xf9be('0x20')]);}_0x4ed5f3[_0xf9be('0x38')]=qs[_0xf9be('0x39')](_0x4659d4[_0xf9be('0x32')][_0xf9be('0x39')]);_0x4ed5f3[_0xf9be('0x3a')]=qs[_0xf9be('0x33')](_[_0xf9be('0x3b')](_0x4659d4[_0xf9be('0x32')],_0xa57f66[_0xf9be('0x33')]),_0x361841);if(_0x4659d4[_0xf9be('0x32')][_0xf9be('0x3c')]){_0x4ed5f3[_0xf9be('0x3a')]=_['merge'](_0x4ed5f3[_0xf9be('0x3a')],{'$or':_[_0xf9be('0x2b')](_0x361841,function(_0x3e1796){if(_0x3e1796[_0xf9be('0x2f')]!==_0xf9be('0x3d')){var _0x16ffd8={};_0x16ffd8[_0x3e1796[_0xf9be('0x29')]]={'$like':'%'+_0x4659d4[_0xf9be('0x32')]['filter']+'%'};return _0x16ffd8;}})});}_0x4ed5f3=_[_0xf9be('0x3e')]({},_0x4ed5f3,_0x4659d4[_0xf9be('0x3f')]);var _0x3a8fa5={'where':_0x4ed5f3[_0xf9be('0x3a')]};return db['VoiceDialReport'][_0xf9be('0x1f')](_0x3a8fa5)[_0xf9be('0x26')](function(_0x5d7d68){_0x483be1[_0xf9be('0x1f')]=_0x5d7d68;if(_0x4659d4[_0xf9be('0x32')][_0xf9be('0x40')]){_0x4ed5f3['include']=[{'all':!![]}];}return db['VoiceDialReport'][_0xf9be('0x41')](_0x4ed5f3);})[_0xf9be('0x26')](function(_0x430333){_0x483be1[_0xf9be('0x42')]=_0x430333;return _0x483be1;})[_0xf9be('0x26')](respondWithFilteredResult(_0x52daa5,_0x4ed5f3))[_0xf9be('0x43')](handleError(_0x52daa5,null));};exports[_0xf9be('0x44')]=function(_0x47091b,_0x17c903){var _0x20874d={'raw':!![],'where':{'id':_0x47091b[_0xf9be('0x45')]['id']}},_0x1e528c={};_0x1e528c['model']=_[_0xf9be('0x31')](db[_0xf9be('0x2c')][_0xf9be('0x2d')]);_0x1e528c[_0xf9be('0x32')]=_[_0xf9be('0x31')](_0x47091b[_0xf9be('0x32')]);_0x1e528c['filters']=_[_0xf9be('0x34')](_0x1e528c[_0xf9be('0x30')],_0x1e528c[_0xf9be('0x32')]);_0x20874d[_0xf9be('0x35')]=_[_0xf9be('0x34')](_0x1e528c[_0xf9be('0x30')],qs[_0xf9be('0x36')](_0x47091b['query'][_0xf9be('0x36')]));_0x20874d['attributes']=_0x20874d['attributes']['length']?_0x20874d[_0xf9be('0x35')]:_0x1e528c[_0xf9be('0x30')];if(_0x47091b[_0xf9be('0x32')][_0xf9be('0x40')]){_0x20874d[_0xf9be('0x46')]=[{'all':!![]}];}_0x20874d=_[_0xf9be('0x3e')]({},_0x20874d,_0x47091b[_0xf9be('0x3f')]);return db[_0xf9be('0x2c')][_0xf9be('0x47')](_0x20874d)[_0xf9be('0x26')](handleEntityNotFound(_0x17c903,null))['then'](respondWithResult(_0x17c903,null))['catch'](handleError(_0x17c903,null));};exports['create']=function(_0x252cef,_0x433027){return db[_0xf9be('0x2c')][_0xf9be('0x48')](_0x252cef['body'],{})['then'](respondWithResult(_0x433027,0xc9))['catch'](handleError(_0x433027,null));};exports[_0xf9be('0x25')]=function(_0x4e991f,_0x34f490){if(_0x4e991f[_0xf9be('0x49')]['id']){delete _0x4e991f[_0xf9be('0x49')]['id'];}return db[_0xf9be('0x2c')][_0xf9be('0x47')]({'where':{'id':_0x4e991f[_0xf9be('0x45')]['id']}})[_0xf9be('0x26')](handleEntityNotFound(_0x34f490,null))[_0xf9be('0x26')](saveUpdates(_0x4e991f[_0xf9be('0x49')],null))[_0xf9be('0x26')](respondWithResult(_0x34f490,null))[_0xf9be('0x43')](handleError(_0x34f490,null));};exports[_0xf9be('0x27')]=function(_0x1b9614,_0x573371){return db[_0xf9be('0x2c')][_0xf9be('0x47')]({'where':{'id':_0x1b9614[_0xf9be('0x45')]['id']}})[_0xf9be('0x26')](handleEntityNotFound(_0x573371,null))['then'](removeEntity(_0x573371,null))[_0xf9be('0x43')](handleError(_0x573371,null));};exports[_0xf9be('0x4a')]=function(_0x4cc14d,_0x12cdbf){return db[_0xf9be('0x2c')][_0xf9be('0x4a')]()[_0xf9be('0x26')](respondWithResult(_0x12cdbf,null))[_0xf9be('0x43')](handleError(_0x12cdbf,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index 554661d..dfe6d17 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 _0x49e5=['exports','define','VoiceDialReport','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./voiceDialReport.attributes'];(function(_0x2d53d7,_0x2c16cb){var _0x43bde9=function(_0x2f88a1){while(--_0x2f88a1){_0x2d53d7['push'](_0x2d53d7['shift']());}};_0x43bde9(++_0x2c16cb);}(_0x49e5,0x196));var _0x549e=function(_0x34c4e9,_0x2b4d90){_0x34c4e9=_0x34c4e9-0x0;var _0x144dd4=_0x49e5[_0x34c4e9];return _0x144dd4;};'use strict';var _=require(_0x549e('0x0'));var util=require(_0x549e('0x1'));var logger=require(_0x549e('0x2'))(_0x549e('0x3'));var moment=require(_0x549e('0x4'));var BPromise=require(_0x549e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x549e('0x6'));var rimraf=require(_0x549e('0x7'));var config=require(_0x549e('0x8'));var attributes=require(_0x549e('0x9'));module[_0x549e('0xa')]=function(_0x480e2c,_0x1b110f){return _0x480e2c[_0x549e('0xb')](_0x549e('0xc'),attributes,{'tableName':'report_dial','paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xb761=['bluebird','request-promise','define','VoiceDialReport','report_dial','lodash','util','../../config/logger','api','moment'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xb761,0x113));var _0x1b76=function(_0x274638,_0x578968){_0x274638=_0x274638-0x0;var _0x5755df=_0xb761[_0x274638];return _0x5755df;};'use strict';var _=require(_0x1b76('0x0'));var util=require(_0x1b76('0x1'));var logger=require(_0x1b76('0x2'))(_0x1b76('0x3'));var moment=require(_0x1b76('0x4'));var BPromise=require(_0x1b76('0x5'));var rp=require(_0x1b76('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./voiceDialReport.attributes');module['exports']=function(_0x284ec8,_0x1acca9){return _0x284ec8[_0x1b76('0x7')](_0x1b76('0x8'),attributes,{'tableName':_0x1b76('0x9'),'paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index 16ee32e..0e0d18a 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 _0xf213=['VoiceDialReport','update','body','where','attributes','limit','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','http','request','then','VoiceDialReport,\x20%s,\x20%s','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','request\x20sent','result','catch','CreateVoiceDialReport','create','options','raw','debug','UpdateVoiceDialReport'];(function(_0x3720d1,_0x968d8b){var _0x14a1e8=function(_0x454184){while(--_0x454184){_0x3720d1['push'](_0x3720d1['shift']());}};_0x14a1e8(++_0x968d8b);}(_0xf213,0xcc));var _0x3f21=function(_0x4434db,_0x63bdfa){_0x4434db=_0x4434db-0x0;var _0x39df64=_0xf213[_0x4434db];return _0x39df64;};'use strict';var _=require(_0x3f21('0x0'));var util=require(_0x3f21('0x1'));var moment=require('moment');var BPromise=require(_0x3f21('0x2'));var rs=require(_0x3f21('0x3'));var fs=require('fs');var Redis=require(_0x3f21('0x4'));var db=require(_0x3f21('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x3f21('0x6'))(_0x3f21('0x7'));var config=require('../../config/environment');var jayson=require(_0x3f21('0x8'));var client=jayson['client'][_0x3f21('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x323694,_0x352abe,_0x2b2ad7){return new BPromise(function(_0x24e0f4,_0x14f3d9){return client[_0x3f21('0xa')](_0x323694,_0x2b2ad7)[_0x3f21('0xb')](function(_0x40a839){logger['info'](_0x3f21('0xc'),_0x352abe,'request\x20sent');logger['debug'](_0x3f21('0xd'),_0x352abe,'request\x20sent',JSON[_0x3f21('0xe')](_0x40a839));if(_0x40a839['error']){if(_0x40a839[_0x3f21('0xf')]['code']===0x1f4){logger[_0x3f21('0xf')](_0x3f21('0xc'),_0x352abe,_0x40a839['error'][_0x3f21('0x10')]);return _0x14f3d9(_0x40a839[_0x3f21('0xf')][_0x3f21('0x10')]);}logger['error'](_0x3f21('0xc'),_0x352abe,_0x40a839[_0x3f21('0xf')][_0x3f21('0x10')]);return _0x24e0f4(_0x40a839[_0x3f21('0xf')]['message']);}else{logger[_0x3f21('0x11')](_0x3f21('0xc'),_0x352abe,_0x3f21('0x12'));_0x24e0f4(_0x40a839[_0x3f21('0x13')]['message']);}})[_0x3f21('0x14')](function(_0x547f58){logger['error'](_0x3f21('0xc'),_0x352abe,_0x547f58);_0x14f3d9(_0x547f58);});});}exports[_0x3f21('0x15')]=function(_0x5de2a8){var _0x241d48=this;return new Promise(function(_0x5e3c0c,_0x2ae0c0){return db['VoiceDialReport'][_0x3f21('0x16')](_0x5de2a8['body'],{'raw':_0x5de2a8[_0x3f21('0x17')]?_0x5de2a8[_0x3f21('0x17')][_0x3f21('0x18')]===undefined?!![]:![]:!![]})[_0x3f21('0xb')](function(_0x326f6a){logger[_0x3f21('0x11')](_0x3f21('0x15'),_0x5de2a8);logger[_0x3f21('0x19')](_0x3f21('0x15'),_0x5de2a8,JSON['stringify'](_0x326f6a));_0x5e3c0c(_0x326f6a);})[_0x3f21('0x14')](function(_0x35137e){logger[_0x3f21('0xf')](_0x3f21('0x15'),_0x35137e[_0x3f21('0x10')],_0x5de2a8);_0x2ae0c0(_0x241d48[_0x3f21('0xf')](0x1f4,_0x35137e[_0x3f21('0x10')]));});});};exports[_0x3f21('0x1a')]=function(_0xe08d3c){var _0x3e9b9c=this;return new Promise(function(_0x316439,_0x33ed3b){return db[_0x3f21('0x1b')][_0x3f21('0x1c')](_0xe08d3c[_0x3f21('0x1d')],{'raw':_0xe08d3c[_0x3f21('0x17')]?_0xe08d3c[_0x3f21('0x17')][_0x3f21('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xe08d3c['options']?_0xe08d3c[_0x3f21('0x17')][_0x3f21('0x1e')]||null:null,'attributes':_0xe08d3c[_0x3f21('0x17')]?_0xe08d3c[_0x3f21('0x17')][_0x3f21('0x1f')]||null:null,'limit':_0xe08d3c[_0x3f21('0x17')]?_0xe08d3c[_0x3f21('0x17')][_0x3f21('0x20')]||null:null})['then'](function(_0x56ac1f){logger[_0x3f21('0x11')](_0x3f21('0x1a'),_0xe08d3c);logger[_0x3f21('0x19')](_0x3f21('0x1a'),_0xe08d3c,JSON['stringify'](_0x56ac1f));_0x316439(_0x56ac1f);})[_0x3f21('0x14')](function(_0x25d9fd){logger[_0x3f21('0xf')](_0x3f21('0x1a'),_0x25d9fd[_0x3f21('0x10')],_0xe08d3c);_0x33ed3b(_0x3e9b9c[_0x3f21('0xf')](0x1f4,_0x25d9fd[_0x3f21('0x10')]));});});}; \ No newline at end of file +var _0xb179=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','VoiceDialReport,\x20%s,\x20%s','VoiceDialReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','CreateVoiceDialReport','create','options','raw','then','debug','UpdateVoiceDialReport','body','where','attributes','bluebird'];(function(_0x3f0d0d,_0x56df06){var _0x4f7095=function(_0xe0ee77){while(--_0xe0ee77){_0x3f0d0d['push'](_0x3f0d0d['shift']());}};_0x4f7095(++_0x56df06);}(_0xb179,0x1ef));var _0x9b17=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xb179[_0x126558];return _0x1f6d14;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x9b17('0x0'));var rs=require(_0x9b17('0x1'));var fs=require('fs');var Redis=require(_0x9b17('0x2'));var db=require(_0x9b17('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x9b17('0x4'))(_0x9b17('0x5'));var config=require(_0x9b17('0x6'));var jayson=require(_0x9b17('0x7'));var client=jayson[_0x9b17('0x8')][_0x9b17('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1de0fd,_0x208bd4,_0x50cedd){return new BPromise(function(_0x1599b7,_0x3d3726){return client[_0x9b17('0xa')](_0x1de0fd,_0x50cedd)['then'](function(_0x20c5bf){logger['info'](_0x9b17('0xb'),_0x208bd4,'request\x20sent');logger['debug'](_0x9b17('0xc'),_0x208bd4,_0x9b17('0xd'),JSON[_0x9b17('0xe')](_0x20c5bf));if(_0x20c5bf['error']){if(_0x20c5bf[_0x9b17('0xf')][_0x9b17('0x10')]===0x1f4){logger[_0x9b17('0xf')](_0x9b17('0xb'),_0x208bd4,_0x20c5bf[_0x9b17('0xf')]['message']);return _0x3d3726(_0x20c5bf['error'][_0x9b17('0x11')]);}logger['error'](_0x9b17('0xb'),_0x208bd4,_0x20c5bf[_0x9b17('0xf')][_0x9b17('0x11')]);return _0x1599b7(_0x20c5bf[_0x9b17('0xf')][_0x9b17('0x11')]);}else{logger[_0x9b17('0x12')](_0x9b17('0xb'),_0x208bd4,'request\x20sent');_0x1599b7(_0x20c5bf[_0x9b17('0x13')][_0x9b17('0x11')]);}})[_0x9b17('0x14')](function(_0x1f5634){logger[_0x9b17('0xf')](_0x9b17('0xb'),_0x208bd4,_0x1f5634);_0x3d3726(_0x1f5634);});});}exports[_0x9b17('0x15')]=function(_0x5c6157){var _0x230b5e=this;return new Promise(function(_0x2cb50f,_0x520a4d){return db['VoiceDialReport'][_0x9b17('0x16')](_0x5c6157['body'],{'raw':_0x5c6157[_0x9b17('0x17')]?_0x5c6157[_0x9b17('0x17')][_0x9b17('0x18')]===undefined?!![]:![]:!![]})[_0x9b17('0x19')](function(_0xf9625d){logger['info'](_0x9b17('0x15'),_0x5c6157);logger[_0x9b17('0x1a')](_0x9b17('0x15'),_0x5c6157,JSON['stringify'](_0xf9625d));_0x2cb50f(_0xf9625d);})[_0x9b17('0x14')](function(_0x112c90){logger[_0x9b17('0xf')]('CreateVoiceDialReport',_0x112c90[_0x9b17('0x11')],_0x5c6157);_0x520a4d(_0x230b5e[_0x9b17('0xf')](0x1f4,_0x112c90[_0x9b17('0x11')]));});});};exports[_0x9b17('0x1b')]=function(_0x58e4d2){var _0x58def8=this;return new Promise(function(_0x184e8c,_0x26e775){return db['VoiceDialReport']['update'](_0x58e4d2[_0x9b17('0x1c')],{'raw':_0x58e4d2[_0x9b17('0x17')]?_0x58e4d2[_0x9b17('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x58e4d2[_0x9b17('0x17')]?_0x58e4d2['options'][_0x9b17('0x1d')]||null:null,'attributes':_0x58e4d2[_0x9b17('0x17')]?_0x58e4d2[_0x9b17('0x17')][_0x9b17('0x1e')]||null:null,'limit':_0x58e4d2[_0x9b17('0x17')]?_0x58e4d2[_0x9b17('0x17')]['limit']||null:null})[_0x9b17('0x19')](function(_0x34a572){logger[_0x9b17('0x12')]('UpdateVoiceDialReport',_0x58e4d2);logger['debug'](_0x9b17('0x1b'),_0x58e4d2,JSON[_0x9b17('0xe')](_0x34a572));_0x184e8c(_0x34a572);})['catch'](function(_0xc8515){logger[_0x9b17('0xf')]('UpdateVoiceDialReport',_0xc8515[_0x9b17('0x11')],_0x58e4d2);_0x26e775(_0x58def8[_0x9b17('0xf')](0x1f4,_0xc8515[_0x9b17('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index 11792a5..4911e94 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 _0x6d2d=['./voiceExtension.controller','isAuthenticated','index','get','show','post','/:id/applications','addApplications','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x2c7eb0,_0x1640a4){var _0x273293=function(_0x27cc6d){while(--_0x27cc6d){_0x2c7eb0['push'](_0x2c7eb0['shift']());}};_0x273293(++_0x1640a4);}(_0x6d2d,0xf3));var _0xd6d2=function(_0x4b70d6,_0x142320){_0x4b70d6=_0x4b70d6-0x0;var _0x58a837=_0x6d2d[_0x4b70d6];return _0x58a837;};'use strict';var multer=require(_0xd6d2('0x0'));var util=require(_0xd6d2('0x1'));var path=require(_0xd6d2('0x2'));var timeout=require(_0xd6d2('0x3'));var express=require(_0xd6d2('0x4'));var router=express[_0xd6d2('0x5')]();var fs_extra=require(_0xd6d2('0x6'));var auth=require(_0xd6d2('0x7'));var interaction=require(_0xd6d2('0x8'));var config=require(_0xd6d2('0x9'));var controller=require(_0xd6d2('0xa'));router['get']('/',auth[_0xd6d2('0xb')](),controller[_0xd6d2('0xc')]);router[_0xd6d2('0xd')]('/:id',auth['isAuthenticated'](),controller[_0xd6d2('0xe')]);router[_0xd6d2('0xf')]('/',auth[_0xd6d2('0xb')](),controller['create']);router['post'](_0xd6d2('0x10'),auth['isAuthenticated'](),controller[_0xd6d2('0x11')]);router[_0xd6d2('0x12')](_0xd6d2('0x13'),auth[_0xd6d2('0xb')](),controller[_0xd6d2('0x14')]);router['delete']('/:id',auth[_0xd6d2('0xb')](),controller[_0xd6d2('0x15')]);module[_0xd6d2('0x16')]=router; \ No newline at end of file +var _0x49fd=['express','Router','fs-extra','../../config/environment','./voiceExtension.controller','get','isAuthenticated','index','show','post','create','/:id/applications','addApplications','put','/:id','delete','exports','multer','path'];(function(_0x45e7c9,_0x241220){var _0x8f3a53=function(_0x2eace3){while(--_0x2eace3){_0x45e7c9['push'](_0x45e7c9['shift']());}};_0x8f3a53(++_0x241220);}(_0x49fd,0xbc));var _0xd49f=function(_0x1c644b,_0x174dcb){_0x1c644b=_0x1c644b-0x0;var _0x5b025a=_0x49fd[_0x1c644b];return _0x5b025a;};'use strict';var multer=require(_0xd49f('0x0'));var util=require('util');var path=require(_0xd49f('0x1'));var timeout=require('connect-timeout');var express=require(_0xd49f('0x2'));var router=express[_0xd49f('0x3')]();var fs_extra=require(_0xd49f('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xd49f('0x5'));var controller=require(_0xd49f('0x6'));router[_0xd49f('0x7')]('/',auth[_0xd49f('0x8')](),controller[_0xd49f('0x9')]);router['get']('/:id',auth[_0xd49f('0x8')](),controller[_0xd49f('0xa')]);router[_0xd49f('0xb')]('/',auth[_0xd49f('0x8')](),controller[_0xd49f('0xc')]);router['post'](_0xd49f('0xd'),auth['isAuthenticated'](),controller[_0xd49f('0xe')]);router[_0xd49f('0xf')](_0xd49f('0x10'),auth[_0xd49f('0x8')](),controller['update']);router[_0xd49f('0x11')](_0xd49f('0x10'),auth[_0xd49f('0x8')](),controller['destroy']);module[_0xd49f('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index 7c2393c..b6b03a0 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 _0xe800=['internal','inbound-fax','outbound-fax','any','*,*,*,*','INTEGER','BOOLEAN','wav','VIRTUAL','getDataValue','sequelize','exports','STRING','compositeIndex','NoOp','ENUM'];(function(_0x414f67,_0x861aed){var _0x338537=function(_0x4696fd){while(--_0x4696fd){_0x414f67['push'](_0x414f67['shift']());}};_0x338537(++_0x861aed);}(_0xe800,0xea));var _0x0e80=function(_0x31cb5f,_0x2df766){_0x31cb5f=_0x31cb5f-0x0;var _0x586042=_0xe800[_0x31cb5f];return _0x586042;};'use strict';var Sequelize=require(_0x0e80('0x0'));module[_0x0e80('0x1')]={'context':{'type':Sequelize[_0x0e80('0x2')],'allowNull':![],'unique':_0x0e80('0x3'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x0e80('0x2')],'allowNull':![],'unique':_0x0e80('0x3')},'priority':{'type':Sequelize[_0x0e80('0x2')],'allowNull':![],'defaultValue':'1','unique':'compositeIndex'},'tag':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x0e80('0x2')],'allowNull':![],'defaultValue':_0x0e80('0x4')},'appdata':{'type':Sequelize[_0x0e80('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x0e80('0x5')]('inbound','outbound',_0x0e80('0x6'),_0x0e80('0x7'),_0x0e80('0x8'),'system',_0x0e80('0x9')),'allowNull':![]},'description':{'type':Sequelize[_0x0e80('0x2')]},'interval':{'type':Sequelize[_0x0e80('0x2')],'allowNull':![],'defaultValue':_0x0e80('0xa')},'IntervalId':{'type':Sequelize[_0x0e80('0xb')]},'isApp':{'type':Sequelize[_0x0e80('0xc')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x0e80('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0x0e80('0x2')],'allowNull':!![]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x0e80('0xb')]},'recordingFormat':{'type':Sequelize[_0x0e80('0x2')],'defaultValue':_0x0e80('0xd')},'answer':{'type':Sequelize[_0x0e80('0xc')],'defaultValue':!![]},'name':{'type':Sequelize[_0x0e80('0xe')],'get':function(_0x3733f7){return this[_0x0e80('0xf')]('exten');}},'alias':{'type':Sequelize[_0x0e80('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0x869e=['INTEGER','BOOLEAN','wav','getDataValue','exten','sequelize','exports','STRING','compositeIndex','ENUM','inbound','outbound','internal','inbound-fax','outbound-fax','system','any'];(function(_0xf81435,_0x1a1f00){var _0x2c1b13=function(_0x10d178){while(--_0x10d178){_0xf81435['push'](_0xf81435['shift']());}};_0x2c1b13(++_0x1a1f00);}(_0x869e,0x104));var _0xe869=function(_0x165fd3,_0x3b6685){_0x165fd3=_0x165fd3-0x0;var _0x55688e=_0x869e[_0x165fd3];return _0x55688e;};'use strict';var Sequelize=require(_0xe869('0x0'));module[_0xe869('0x1')]={'context':{'type':Sequelize[_0xe869('0x2')],'allowNull':![],'unique':_0xe869('0x3'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0xe869('0x2')],'allowNull':![],'unique':_0xe869('0x3')},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':_0xe869('0x3')},'tag':{'type':Sequelize[_0xe869('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'NoOp'},'appdata':{'type':Sequelize[_0xe869('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0xe869('0x4')](_0xe869('0x5'),_0xe869('0x6'),_0xe869('0x7'),_0xe869('0x8'),_0xe869('0x9'),_0xe869('0xa'),_0xe869('0xb')),'allowNull':![]},'description':{'type':Sequelize[_0xe869('0x2')]},'interval':{'type':Sequelize[_0xe869('0x2')],'allowNull':![],'defaultValue':'*,*,*,*'},'IntervalId':{'type':Sequelize[_0xe869('0xc')]},'isApp':{'type':Sequelize[_0xe869('0xd')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize['STRING'],'defaultValue':null},'callerID':{'type':Sequelize[_0xe869('0x2')],'allowNull':!![]},'record':{'type':Sequelize[_0xe869('0xd')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0xe869('0xc')]},'recordingFormat':{'type':Sequelize[_0xe869('0x2')],'defaultValue':_0xe869('0xe')},'answer':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x162b02){return this[_0xe869('0xf')](_0xe869('0x10'));}},'alias':{'type':Sequelize[_0xe869('0x2')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index bb10e8d..6137868 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 _0x5b5f=['fields','length','hasOwnProperty','nolimit','limit','sort','where','merge','includeAll','findAll','rows','catch','rawAttributes','keys','options','params','create','outbound','startsWith','exten','body','concat','user','role','inbound','InternalRoutes','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','context','recordingFormat','mandatoryDisposition','alias','addApplications','transaction','Transaction','ISOLATION_LEVELS','VoiceExtensionId','isApp','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','finally','lodash','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./voiceExtension.socket','sendStatus','status','json','offset','undefined','count','set','Content-Range','destroy','get','InboundRoutes','OutboundRoutes','internal','filter','value','includes','type','find','name','UserProfileResource','then','end','error','stack','send','VoiceExtension','fieldName','model','map','query','filters','attributes','intersection'];(function(_0x43df8b,_0x163b58){var _0x3268fd=function(_0x190e88){while(--_0x190e88){_0x43df8b['push'](_0x43df8b['shift']());}};_0x3268fd(++_0x163b58);}(_0x5b5f,0x1e0));var _0xf5b5=function(_0x30e977,_0x5edc12){_0x30e977=_0x30e977-0x0;var _0x536cb5=_0x5b5f[_0x30e977];return _0x536cb5;};'use strict';var _=require(_0xf5b5('0x0'));var Redis=require('ioredis');var qs=require(_0xf5b5('0x1'));var logger=require('../../config/logger')(_0xf5b5('0x2'));var config=require(_0xf5b5('0x3'));var db=require(_0xf5b5('0x4'))['db'];config[_0xf5b5('0x5')]=_[_0xf5b5('0x6')](config[_0xf5b5('0x5')],{'host':_0xf5b5('0x7'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf5b5('0x5')]));require(_0xf5b5('0x8'))['register'](socket);function respondWithStatusCode(_0x169d43,_0x104428){_0x104428=_0x104428||0xcc;return function(_0x1d487e){if(_0x1d487e){return _0x169d43[_0xf5b5('0x9')](_0x104428);}return _0x169d43[_0xf5b5('0xa')](_0x104428)['end']();};}function respondWithResult(_0x51af88,_0x9e63cb){_0x9e63cb=_0x9e63cb||0xc8;return function(_0x279c2b){if(_0x279c2b){return _0x51af88[_0xf5b5('0xa')](_0x9e63cb)[_0xf5b5('0xb')](_0x279c2b);}};}function respondWithFilteredResult(_0x53085c,_0x6d4873){return function(_0x208876){if(_0x208876){var _0x2a290a=typeof _0x6d4873[_0xf5b5('0xc')]===_0xf5b5('0xd')&&typeof _0x6d4873['limit']==='undefined';var _0x4baef7=_0x208876[_0xf5b5('0xe')];var _0x13cc9d=_0x2a290a?0x0:_0x6d4873[_0xf5b5('0xc')];var _0x4fbb23=_0x2a290a?_0x208876[_0xf5b5('0xe')]:_0x6d4873[_0xf5b5('0xc')]+_0x6d4873['limit'];var _0x2ec527;if(_0x4fbb23>=_0x4baef7){_0x4fbb23=_0x4baef7;_0x2ec527=0xc8;}else{_0x2ec527=0xce;}_0x53085c[_0xf5b5('0xa')](_0x2ec527);return _0x53085c[_0xf5b5('0xf')](_0xf5b5('0x10'),_0x13cc9d+'-'+_0x4fbb23+'/'+_0x4baef7)[_0xf5b5('0xb')](_0x208876);}return null;};}function removeEntity(_0x1a31a4){return function(_0x361832){if(_0x361832){return _0x361832[_0xf5b5('0x11')]()['then'](function(){var _0x16033c=_0x361832[_0xf5b5('0x12')]({'plain':!![]});var _0x3f5b5f=[{'name':_0xf5b5('0x13'),'value':'inbound','ignore':![]},{'name':_0xf5b5('0x14'),'value':'outbound','ignore':![]},{'name':'InternalRoutes','value':_0xf5b5('0x15'),'ignore':![]}];var _0x1ae5f0=_(_0x3f5b5f)[_0xf5b5('0x16')]('ignore')['map'](_0xf5b5('0x17'))[_0xf5b5('0x17')]();if(_[_0xf5b5('0x18')](_0x1ae5f0,_0x16033c[_0xf5b5('0x19')])){return;}var _0x35fd86=_[_0xf5b5('0x1a')](_0x3f5b5f,['value',_0x16033c[_0xf5b5('0x19')]])[_0xf5b5('0x1b')];return db[_0xf5b5('0x1c')][_0xf5b5('0x11')]({'where':{'type':_0x35fd86,'resourceId':_0x16033c['id']}})[_0xf5b5('0x1d')](function(){return _0x361832;});})[_0xf5b5('0x1d')](function(){_0x1a31a4['status'](0xcc)[_0xf5b5('0x1e')]();});}};}function handleEntityNotFound(_0x291555){return function(_0xd689ec){if(!_0xd689ec){_0x291555[_0xf5b5('0x9')](0x194);}return _0xd689ec;};}function handleError(_0x121dca,_0x55024e){_0x55024e=_0x55024e||0x1f4;return function(_0x1bed07){logger[_0xf5b5('0x1f')](_0x1bed07[_0xf5b5('0x20')]);if(_0x1bed07[_0xf5b5('0x1b')]){delete _0x1bed07[_0xf5b5('0x1b')];}_0x121dca[_0xf5b5('0xa')](_0x55024e)[_0xf5b5('0x21')](_0x1bed07);};}exports['index']=function(_0x1babe8,_0x8694ae){var _0x2198d1={},_0x5cf250={},_0x57a3db={'count':0x0,'rows':[]};var _0x38c7d4=_['map'](db[_0xf5b5('0x22')]['rawAttributes'],function(_0x418c0f){return{'name':_0x418c0f[_0xf5b5('0x23')],'type':_0x418c0f['type']['key']};});_0x5cf250[_0xf5b5('0x24')]=_[_0xf5b5('0x25')](_0x38c7d4,_0xf5b5('0x1b'));_0x5cf250[_0xf5b5('0x26')]=_['keys'](_0x1babe8[_0xf5b5('0x26')]);_0x5cf250[_0xf5b5('0x27')]=_['intersection'](_0x5cf250[_0xf5b5('0x24')],_0x5cf250[_0xf5b5('0x26')]);_0x2198d1[_0xf5b5('0x28')]=_[_0xf5b5('0x29')](_0x5cf250[_0xf5b5('0x24')],qs[_0xf5b5('0x2a')](_0x1babe8[_0xf5b5('0x26')][_0xf5b5('0x2a')]));_0x2198d1['attributes']=_0x2198d1[_0xf5b5('0x28')][_0xf5b5('0x2b')]?_0x2198d1[_0xf5b5('0x28')]:_0x5cf250['model'];if(!_0x1babe8[_0xf5b5('0x26')][_0xf5b5('0x2c')](_0xf5b5('0x2d'))){_0x2198d1['limit']=qs[_0xf5b5('0x2e')](_0x1babe8['query']['limit']);_0x2198d1[_0xf5b5('0xc')]=qs[_0xf5b5('0xc')](_0x1babe8[_0xf5b5('0x26')][_0xf5b5('0xc')]);}_0x2198d1['order']=qs[_0xf5b5('0x2f')](_0x1babe8[_0xf5b5('0x26')][_0xf5b5('0x2f')]);_0x2198d1[_0xf5b5('0x30')]=qs[_0xf5b5('0x27')](_['pick'](_0x1babe8[_0xf5b5('0x26')],_0x5cf250[_0xf5b5('0x27')]),_0x38c7d4);if(_0x1babe8[_0xf5b5('0x26')]['filter']){_0x2198d1[_0xf5b5('0x30')]=_[_0xf5b5('0x31')](_0x2198d1[_0xf5b5('0x30')],{'$or':_[_0xf5b5('0x25')](_0x38c7d4,function(_0xf87173){if(_0xf87173['type']!=='VIRTUAL'){var _0xc8ab56={};_0xc8ab56[_0xf87173[_0xf5b5('0x1b')]]={'$like':'%'+_0x1babe8[_0xf5b5('0x26')]['filter']+'%'};return _0xc8ab56;}})});}_0x2198d1=_[_0xf5b5('0x31')]({},_0x2198d1,_0x1babe8['options']);var _0x5d88f={'where':_0x2198d1[_0xf5b5('0x30')]};return db[_0xf5b5('0x22')][_0xf5b5('0xe')](_0x5d88f)['then'](function(_0xa4e17f){_0x57a3db['count']=_0xa4e17f;if(_0x1babe8['query'][_0xf5b5('0x32')]){_0x2198d1['include']=[{'all':!![]}];}return db[_0xf5b5('0x22')][_0xf5b5('0x33')](_0x2198d1);})[_0xf5b5('0x1d')](function(_0x3eb218){_0x57a3db[_0xf5b5('0x34')]=_0x3eb218;return _0x57a3db;})['then'](respondWithFilteredResult(_0x8694ae,_0x2198d1))[_0xf5b5('0x35')](handleError(_0x8694ae,null));};exports['show']=function(_0x1ec626,_0x1ecc50){var _0x2a4caf={'raw':![],'where':{'id':_0x1ec626['params']['id']}},_0x597e47={};_0x597e47['model']=_['keys'](db[_0xf5b5('0x22')][_0xf5b5('0x36')]);_0x597e47[_0xf5b5('0x26')]=_[_0xf5b5('0x37')](_0x1ec626[_0xf5b5('0x26')]);_0x597e47[_0xf5b5('0x27')]=_['intersection'](_0x597e47[_0xf5b5('0x24')],_0x597e47[_0xf5b5('0x26')]);_0x2a4caf[_0xf5b5('0x28')]=_[_0xf5b5('0x29')](_0x597e47['model'],qs[_0xf5b5('0x2a')](_0x1ec626[_0xf5b5('0x26')][_0xf5b5('0x2a')]));_0x2a4caf['attributes']=_0x2a4caf[_0xf5b5('0x28')][_0xf5b5('0x2b')]?_0x2a4caf[_0xf5b5('0x28')]:_0x597e47['model'];if(_0x1ec626[_0xf5b5('0x26')][_0xf5b5('0x32')]){_0x2a4caf['include']=[{'all':!![]}];}_0x2a4caf=_[_0xf5b5('0x31')]({},_0x2a4caf,_0x1ec626[_0xf5b5('0x38')]);return db[_0xf5b5('0x22')][_0xf5b5('0x1a')](_0x2a4caf)[_0xf5b5('0x1d')](handleEntityNotFound(_0x1ecc50,null))[_0xf5b5('0x1d')](respondWithResult(_0x1ecc50,null))['catch'](handleError(_0x1ecc50,null));};exports[_0xf5b5('0x11')]=function(_0x381c2a,_0x2e8f55){return db[_0xf5b5('0x22')]['find']({'where':{'id':_0x381c2a[_0xf5b5('0x39')]['id']}})[_0xf5b5('0x1d')](handleEntityNotFound(_0x2e8f55,null))[_0xf5b5('0x1d')](removeEntity(_0x2e8f55,null))[_0xf5b5('0x35')](handleError(_0x2e8f55,null));};exports[_0xf5b5('0x3a')]=function(_0x3cdcaf,_0x13d02a){if(_0x3cdcaf['body'][_0xf5b5('0x19')]===_0xf5b5('0x3b')&&!_[_0xf5b5('0x3c')](_0x3cdcaf['body'][_0xf5b5('0x3d')],'_')){_0x3cdcaf[_0xf5b5('0x3e')][_0xf5b5('0x3d')]='_'[_0xf5b5('0x3f')](_0x3cdcaf['body'][_0xf5b5('0x3d')]);}return db[_0xf5b5('0x22')][_0xf5b5('0x3a')](_0x3cdcaf['body'],{'raw':![]})['then'](function(_0x117fd0){var _0x562258=_0x3cdcaf[_0xf5b5('0x40')][_0xf5b5('0x12')]({'plain':!![]});if(!_0x562258)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x562258[_0xf5b5('0x41')]===_0xf5b5('0x40')){var _0x359464=_0x117fd0[_0xf5b5('0x12')]({'plain':!![]});var _0x33f816=[{'name':_0xf5b5('0x13'),'value':_0xf5b5('0x42')},{'name':_0xf5b5('0x14'),'value':_0xf5b5('0x3b')},{'name':_0xf5b5('0x43'),'value':_0xf5b5('0x15')}];var _0x528651=_[_0xf5b5('0x1a')](_0x33f816,[_0xf5b5('0x17'),_0x359464[_0xf5b5('0x19')]])['name'];return db[_0xf5b5('0x44')][_0xf5b5('0x1a')]({'where':{'name':_0x528651,'userProfileId':_0x562258[_0xf5b5('0x45')]},'raw':!![]})[_0xf5b5('0x1d')](function(_0x25f4bd){if(_0x25f4bd&&_0x25f4bd[_0xf5b5('0x46')]===0x0){return db['UserProfileResource']['create']({'name':_0x359464[_0xf5b5('0x1b')],'resourceId':_0x359464['id'],'type':_0x25f4bd['name'],'sectionId':_0x25f4bd['id']},{})[_0xf5b5('0x1d')](function(){return _0x117fd0;});}else{return _0x117fd0;}})['catch'](function(_0x55b10d){logger['error'](_0xf5b5('0x47'),_0x55b10d);throw _0x55b10d;});}return _0x117fd0;})[_0xf5b5('0x1d')](respondWithResult(_0x13d02a,0xc9))['catch'](handleError(_0x13d02a,null));};exports['update']=function(_0x29143e,_0x7bd5d6){if(_0x29143e[_0xf5b5('0x3e')]['id']){delete _0x29143e['body']['id'];}return db[_0xf5b5('0x22')]['find']({'where':{'id':_0x29143e[_0xf5b5('0x39')]['id']}})['then'](handleEntityNotFound(_0x7bd5d6,null))[_0xf5b5('0x1d')](function(_0xe8067f){if(_0xe8067f){return db[_0xf5b5('0x22')][_0xf5b5('0x48')](_['pick'](_0x29143e[_0xf5b5('0x3e')],['exten',_0xf5b5('0x49'),'description',_0xf5b5('0x4a'),'cutdigits',_0xf5b5('0x4b'),_0xf5b5('0x4c')]),{'where':{'context':_0xe8067f[_0xf5b5('0x49')],'exten':_0xe8067f[_0xf5b5('0x3d')]},'individualHooks':!![]})[_0xf5b5('0x1d')](function(_0x182db1){return _0x182db1;});}return null;})['then'](respondWithStatusCode(_0x7bd5d6,null))[_0xf5b5('0x35')](handleError(_0x7bd5d6,null));};exports[_0xf5b5('0x4d')]=function(_0x5da795,_0x4eb2a4){var _0x280304=_0x5da795['params']['id'];var _0x16c871=_0x5da795['body'];var _0x36a996=0xc8;var _0x3bb898=null;return db['sequelize'][_0xf5b5('0x4e')]({'isolationLevel':db['sequelize'][_0xf5b5('0x4f')][_0xf5b5('0x50')]['READ_COMMITTED']},function(_0x4befb5){return db[_0xf5b5('0x22')]['findOne']({'where':{'id':_0x280304},'transaction':_0x4befb5})[_0xf5b5('0x1d')](function(_0x53e45f){if(_0x53e45f){return db[_0xf5b5('0x22')][_0xf5b5('0x11')]({'where':{'VoiceExtensionId':_0x280304},'transaction':_0x4befb5})[_0xf5b5('0x1d')](function(){var _0x1bff5b=_[_0xf5b5('0x25')](_0x16c871,function(_0x3e6dd6){_0x3e6dd6[_0xf5b5('0x51')]=_0x280304;_0x3e6dd6[_0xf5b5('0x52')]=!![];return _0x3e6dd6;});return _0x53e45f['createRouting'](_0x1bff5b);})[_0xf5b5('0x1d')](function(_0x21b23a){return db[_0xf5b5('0x22')][_0xf5b5('0x53')](_0x21b23a,{'transaction':_0x4befb5});});}else{_0x36a996=0x194;_0x3bb898=[];}});})[_0xf5b5('0x1d')](function(){if(_0x36a996!==0x194){return db[_0xf5b5('0x22')][_0xf5b5('0x54')]({'where':{'isApp':!![],'VoiceExtensionId':_0x280304},'order':_0xf5b5('0x55')})[_0xf5b5('0x1d')](function(_0x5cd008){_0x3bb898=_0x5cd008;});}})[_0xf5b5('0x35')](function(_0x242d9f){_0x36a996=0x1f4;logger[_0xf5b5('0x1f')](_0x242d9f[_0xf5b5('0x20')]);if(_0x242d9f['name']){delete _0x242d9f['name'];}_0x3bb898=_0x242d9f;})[_0xf5b5('0x56')](function(){if(_0x3bb898===null){_0x4eb2a4[_0xf5b5('0x9')](_0x36a996);}else{if(_0x36a996===0x1f4){_0x4eb2a4['status'](_0x36a996)[_0xf5b5('0x21')](_0x3bb898);}else{_0x4eb2a4[_0xf5b5('0xa')](_0x36a996)[_0xf5b5('0xb')](_0x3bb898);}}});}; \ No newline at end of file +var _0xa5bb=['ioredis','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./voiceExtension.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','destroy','then','get','InboundRoutes','outbound','InternalRoutes','ignore','map','value','includes','find','type','name','UserProfileResource','stack','send','index','VoiceExtension','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','sort','where','pick','merge','filter','options','includeAll','rows','catch','show','params','include','create','body','startsWith','exten','concat','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','OutboundRoutes','internal','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','context','description','recordingFormat','cutdigits','alias','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','findOne','isApp','createRouting','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','finally','lodash'];(function(_0x23cb72,_0x458456){var _0x2a82bb=function(_0x548c7f){while(--_0x548c7f){_0x23cb72['push'](_0x23cb72['shift']());}};_0x2a82bb(++_0x458456);}(_0xa5bb,0x1cb));var _0xba5b=function(_0xa3ca1e,_0x14f547){_0xa3ca1e=_0xa3ca1e-0x0;var _0x224bac=_0xa5bb[_0xa3ca1e];return _0x224bac;};'use strict';var _=require(_0xba5b('0x0'));var Redis=require(_0xba5b('0x1'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0xba5b('0x2'));var config=require(_0xba5b('0x3'));var db=require(_0xba5b('0x4'))['db'];config[_0xba5b('0x5')]=_[_0xba5b('0x6')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xba5b('0x7'))(new Redis(config[_0xba5b('0x5')]));require(_0xba5b('0x8'))['register'](socket);function respondWithStatusCode(_0x572ce2,_0x5b76c6){_0x5b76c6=_0x5b76c6||0xcc;return function(_0x394008){if(_0x394008){return _0x572ce2[_0xba5b('0x9')](_0x5b76c6);}return _0x572ce2[_0xba5b('0xa')](_0x5b76c6)[_0xba5b('0xb')]();};}function respondWithResult(_0xa32a61,_0x4f24ab){_0x4f24ab=_0x4f24ab||0xc8;return function(_0xe7aa94){if(_0xe7aa94){return _0xa32a61[_0xba5b('0xa')](_0x4f24ab)[_0xba5b('0xc')](_0xe7aa94);}};}function respondWithFilteredResult(_0x1c2d01,_0x130e18){return function(_0x5e3a70){if(_0x5e3a70){var _0x436021=typeof _0x130e18[_0xba5b('0xd')]===_0xba5b('0xe')&&typeof _0x130e18[_0xba5b('0xf')]===_0xba5b('0xe');var _0x4aa0ee=_0x5e3a70[_0xba5b('0x10')];var _0x11aa31=_0x436021?0x0:_0x130e18[_0xba5b('0xd')];var _0x5e8ca3=_0x436021?_0x5e3a70['count']:_0x130e18[_0xba5b('0xd')]+_0x130e18['limit'];var _0x357436;if(_0x5e8ca3>=_0x4aa0ee){_0x5e8ca3=_0x4aa0ee;_0x357436=0xc8;}else{_0x357436=0xce;}_0x1c2d01[_0xba5b('0xa')](_0x357436);return _0x1c2d01[_0xba5b('0x11')](_0xba5b('0x12'),_0x11aa31+'-'+_0x5e8ca3+'/'+_0x4aa0ee)[_0xba5b('0xc')](_0x5e3a70);}return null;};}function removeEntity(_0x1603e7){return function(_0x245acb){if(_0x245acb){return _0x245acb[_0xba5b('0x13')]()[_0xba5b('0x14')](function(){var _0x39988f=_0x245acb[_0xba5b('0x15')]({'plain':!![]});var _0x26d763=[{'name':_0xba5b('0x16'),'value':'inbound','ignore':![]},{'name':'OutboundRoutes','value':_0xba5b('0x17'),'ignore':![]},{'name':_0xba5b('0x18'),'value':'internal','ignore':![]}];var _0x1d9f18=_(_0x26d763)['filter'](_0xba5b('0x19'))[_0xba5b('0x1a')]('value')[_0xba5b('0x1b')]();if(_[_0xba5b('0x1c')](_0x1d9f18,_0x39988f['type'])){return;}var _0x3c7ae1=_[_0xba5b('0x1d')](_0x26d763,[_0xba5b('0x1b'),_0x39988f[_0xba5b('0x1e')]])[_0xba5b('0x1f')];return db[_0xba5b('0x20')][_0xba5b('0x13')]({'where':{'type':_0x3c7ae1,'resourceId':_0x39988f['id']}})[_0xba5b('0x14')](function(){return _0x245acb;});})['then'](function(){_0x1603e7[_0xba5b('0xa')](0xcc)[_0xba5b('0xb')]();});}};}function handleEntityNotFound(_0x3b22ad){return function(_0x3f0c5b){if(!_0x3f0c5b){_0x3b22ad['sendStatus'](0x194);}return _0x3f0c5b;};}function handleError(_0x28021f,_0x51cfe1){_0x51cfe1=_0x51cfe1||0x1f4;return function(_0x55fc7d){logger['error'](_0x55fc7d[_0xba5b('0x21')]);if(_0x55fc7d[_0xba5b('0x1f')]){delete _0x55fc7d['name'];}_0x28021f[_0xba5b('0xa')](_0x51cfe1)[_0xba5b('0x22')](_0x55fc7d);};}exports[_0xba5b('0x23')]=function(_0x1038b0,_0x1ff8f6){var _0x1d6ebb={},_0x3e1142={},_0x2deec5={'count':0x0,'rows':[]};var _0x10a8eb=_[_0xba5b('0x1a')](db[_0xba5b('0x24')][_0xba5b('0x25')],function(_0x4b6e25){return{'name':_0x4b6e25[_0xba5b('0x26')],'type':_0x4b6e25[_0xba5b('0x1e')][_0xba5b('0x27')]};});_0x3e1142[_0xba5b('0x28')]=_[_0xba5b('0x1a')](_0x10a8eb,_0xba5b('0x1f'));_0x3e1142[_0xba5b('0x29')]=_[_0xba5b('0x2a')](_0x1038b0[_0xba5b('0x29')]);_0x3e1142[_0xba5b('0x2b')]=_['intersection'](_0x3e1142[_0xba5b('0x28')],_0x3e1142[_0xba5b('0x29')]);_0x1d6ebb[_0xba5b('0x2c')]=_[_0xba5b('0x2d')](_0x3e1142[_0xba5b('0x28')],qs[_0xba5b('0x2e')](_0x1038b0['query'][_0xba5b('0x2e')]));_0x1d6ebb['attributes']=_0x1d6ebb[_0xba5b('0x2c')][_0xba5b('0x2f')]?_0x1d6ebb[_0xba5b('0x2c')]:_0x3e1142[_0xba5b('0x28')];if(!_0x1038b0[_0xba5b('0x29')][_0xba5b('0x30')]('nolimit')){_0x1d6ebb['limit']=qs[_0xba5b('0xf')](_0x1038b0[_0xba5b('0x29')][_0xba5b('0xf')]);_0x1d6ebb[_0xba5b('0xd')]=qs[_0xba5b('0xd')](_0x1038b0[_0xba5b('0x29')][_0xba5b('0xd')]);}_0x1d6ebb['order']=qs[_0xba5b('0x31')](_0x1038b0[_0xba5b('0x29')][_0xba5b('0x31')]);_0x1d6ebb[_0xba5b('0x32')]=qs['filters'](_[_0xba5b('0x33')](_0x1038b0[_0xba5b('0x29')],_0x3e1142[_0xba5b('0x2b')]),_0x10a8eb);if(_0x1038b0[_0xba5b('0x29')]['filter']){_0x1d6ebb[_0xba5b('0x32')]=_[_0xba5b('0x34')](_0x1d6ebb[_0xba5b('0x32')],{'$or':_[_0xba5b('0x1a')](_0x10a8eb,function(_0x2158e8){if(_0x2158e8[_0xba5b('0x1e')]!=='VIRTUAL'){var _0x2671cc={};_0x2671cc[_0x2158e8['name']]={'$like':'%'+_0x1038b0[_0xba5b('0x29')][_0xba5b('0x35')]+'%'};return _0x2671cc;}})});}_0x1d6ebb=_['merge']({},_0x1d6ebb,_0x1038b0[_0xba5b('0x36')]);var _0x5a152a={'where':_0x1d6ebb['where']};return db[_0xba5b('0x24')][_0xba5b('0x10')](_0x5a152a)[_0xba5b('0x14')](function(_0x564c17){_0x2deec5[_0xba5b('0x10')]=_0x564c17;if(_0x1038b0[_0xba5b('0x29')][_0xba5b('0x37')]){_0x1d6ebb['include']=[{'all':!![]}];}return db[_0xba5b('0x24')]['findAll'](_0x1d6ebb);})['then'](function(_0x50f1c0){_0x2deec5[_0xba5b('0x38')]=_0x50f1c0;return _0x2deec5;})['then'](respondWithFilteredResult(_0x1ff8f6,_0x1d6ebb))[_0xba5b('0x39')](handleError(_0x1ff8f6,null));};exports[_0xba5b('0x3a')]=function(_0x930637,_0x3b0b24){var _0x3b1485={'raw':![],'where':{'id':_0x930637[_0xba5b('0x3b')]['id']}},_0x202c49={};_0x202c49[_0xba5b('0x28')]=_['keys'](db[_0xba5b('0x24')][_0xba5b('0x25')]);_0x202c49[_0xba5b('0x29')]=_[_0xba5b('0x2a')](_0x930637[_0xba5b('0x29')]);_0x202c49[_0xba5b('0x2b')]=_[_0xba5b('0x2d')](_0x202c49[_0xba5b('0x28')],_0x202c49['query']);_0x3b1485[_0xba5b('0x2c')]=_[_0xba5b('0x2d')](_0x202c49[_0xba5b('0x28')],qs['fields'](_0x930637['query']['fields']));_0x3b1485[_0xba5b('0x2c')]=_0x3b1485[_0xba5b('0x2c')][_0xba5b('0x2f')]?_0x3b1485[_0xba5b('0x2c')]:_0x202c49[_0xba5b('0x28')];if(_0x930637[_0xba5b('0x29')][_0xba5b('0x37')]){_0x3b1485[_0xba5b('0x3c')]=[{'all':!![]}];}_0x3b1485=_[_0xba5b('0x34')]({},_0x3b1485,_0x930637['options']);return db[_0xba5b('0x24')][_0xba5b('0x1d')](_0x3b1485)[_0xba5b('0x14')](handleEntityNotFound(_0x3b0b24,null))[_0xba5b('0x14')](respondWithResult(_0x3b0b24,null))['catch'](handleError(_0x3b0b24,null));};exports[_0xba5b('0x13')]=function(_0x554395,_0xc0f40c){return db['VoiceExtension'][_0xba5b('0x1d')]({'where':{'id':_0x554395[_0xba5b('0x3b')]['id']}})[_0xba5b('0x14')](handleEntityNotFound(_0xc0f40c,null))[_0xba5b('0x14')](removeEntity(_0xc0f40c,null))['catch'](handleError(_0xc0f40c,null));};exports[_0xba5b('0x3d')]=function(_0x3b2e50,_0x44a88a){if(_0x3b2e50[_0xba5b('0x3e')]['type']===_0xba5b('0x17')&&!_[_0xba5b('0x3f')](_0x3b2e50[_0xba5b('0x3e')]['exten'],'_')){_0x3b2e50[_0xba5b('0x3e')][_0xba5b('0x40')]='_'[_0xba5b('0x41')](_0x3b2e50['body'][_0xba5b('0x40')]);}return db[_0xba5b('0x24')][_0xba5b('0x3d')](_0x3b2e50[_0xba5b('0x3e')],{'raw':![]})[_0xba5b('0x14')](function(_0x220a2e){var _0x210372=_0x3b2e50[_0xba5b('0x42')][_0xba5b('0x15')]({'plain':!![]});if(!_0x210372)throw new Error(_0xba5b('0x43'));if(_0x210372['role']===_0xba5b('0x42')){var _0x56a12d=_0x220a2e[_0xba5b('0x15')]({'plain':!![]});var _0x447e95=[{'name':'InboundRoutes','value':'inbound'},{'name':_0xba5b('0x44'),'value':_0xba5b('0x17')},{'name':_0xba5b('0x18'),'value':_0xba5b('0x45')}];var _0x5a88de=_[_0xba5b('0x1d')](_0x447e95,[_0xba5b('0x1b'),_0x56a12d[_0xba5b('0x1e')]])[_0xba5b('0x1f')];return db[_0xba5b('0x46')][_0xba5b('0x1d')]({'where':{'name':_0x5a88de,'userProfileId':_0x210372['userProfileId']},'raw':!![]})[_0xba5b('0x14')](function(_0x1b1a0d){if(_0x1b1a0d&&_0x1b1a0d[_0xba5b('0x47')]===0x0){return db[_0xba5b('0x20')][_0xba5b('0x3d')]({'name':_0x56a12d['name'],'resourceId':_0x56a12d['id'],'type':_0x1b1a0d[_0xba5b('0x1f')],'sectionId':_0x1b1a0d['id']},{})[_0xba5b('0x14')](function(){return _0x220a2e;});}else{return _0x220a2e;}})[_0xba5b('0x39')](function(_0x26d8a0){logger[_0xba5b('0x48')](_0xba5b('0x49'),_0x26d8a0);throw _0x26d8a0;});}return _0x220a2e;})[_0xba5b('0x14')](respondWithResult(_0x44a88a,0xc9))['catch'](handleError(_0x44a88a,null));};exports[_0xba5b('0x4a')]=function(_0x4bc765,_0x2d029b){if(_0x4bc765[_0xba5b('0x3e')]['id']){delete _0x4bc765[_0xba5b('0x3e')]['id'];}return db[_0xba5b('0x24')]['find']({'where':{'id':_0x4bc765[_0xba5b('0x3b')]['id']}})[_0xba5b('0x14')](handleEntityNotFound(_0x2d029b,null))[_0xba5b('0x14')](function(_0x12784d){if(_0x12784d){return db[_0xba5b('0x24')]['update'](_[_0xba5b('0x33')](_0x4bc765[_0xba5b('0x3e')],[_0xba5b('0x40'),_0xba5b('0x4b'),_0xba5b('0x4c'),_0xba5b('0x4d'),_0xba5b('0x4e'),'mandatoryDisposition',_0xba5b('0x4f')]),{'where':{'context':_0x12784d[_0xba5b('0x4b')],'exten':_0x12784d[_0xba5b('0x40')]},'individualHooks':!![]})[_0xba5b('0x14')](function(_0x3bce28){return _0x3bce28;});}return null;})[_0xba5b('0x14')](respondWithStatusCode(_0x2d029b,null))[_0xba5b('0x39')](handleError(_0x2d029b,null));};exports[_0xba5b('0x50')]=function(_0x2caaca,_0x4845ee){var _0x543442=_0x2caaca['params']['id'];var _0x1e5e92=_0x2caaca[_0xba5b('0x3e')];var _0x41bff6=0xc8;var _0x374b18=null;return db[_0xba5b('0x51')][_0xba5b('0x52')]({'isolationLevel':db[_0xba5b('0x51')][_0xba5b('0x53')][_0xba5b('0x54')]['READ_COMMITTED']},function(_0x21dece){return db[_0xba5b('0x24')][_0xba5b('0x55')]({'where':{'id':_0x543442},'transaction':_0x21dece})[_0xba5b('0x14')](function(_0x3509da){if(_0x3509da){return db[_0xba5b('0x24')][_0xba5b('0x13')]({'where':{'VoiceExtensionId':_0x543442},'transaction':_0x21dece})[_0xba5b('0x14')](function(){var _0x1aa636=_[_0xba5b('0x1a')](_0x1e5e92,function(_0x2b4311){_0x2b4311['VoiceExtensionId']=_0x543442;_0x2b4311[_0xba5b('0x56')]=!![];return _0x2b4311;});return _0x3509da[_0xba5b('0x57')](_0x1aa636);})[_0xba5b('0x14')](function(_0x4d9b5f){return db[_0xba5b('0x24')][_0xba5b('0x58')](_0x4d9b5f,{'transaction':_0x21dece});});}else{_0x41bff6=0x194;_0x374b18=[];}});})[_0xba5b('0x14')](function(){if(_0x41bff6!==0x194){return db[_0xba5b('0x24')][_0xba5b('0x59')]({'where':{'isApp':!![],'VoiceExtensionId':_0x543442},'order':_0xba5b('0x5a')})['then'](function(_0x1db73a){_0x374b18=_0x1db73a;});}})[_0xba5b('0x39')](function(_0x46108e){_0x41bff6=0x1f4;logger[_0xba5b('0x48')](_0x46108e[_0xba5b('0x21')]);if(_0x46108e[_0xba5b('0x1f')]){delete _0x46108e[_0xba5b('0x1f')];}_0x374b18=_0x46108e;})[_0xba5b('0x5b')](function(){if(_0x374b18===null){_0x4845ee[_0xba5b('0x9')](_0x41bff6);}else{if(_0x41bff6===0x1f4){_0x4845ee[_0xba5b('0xa')](_0x41bff6)[_0xba5b('0x22')](_0x374b18);}else{_0x4845ee[_0xba5b('0xa')](_0x41bff6)[_0xba5b('0xc')](_0x374b18);}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index 5fedb6d..5f50cc7 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 _0x0515=['setMaxListeners','update','emit','hasOwnProperty','exports','events','VoiceExtension'];(function(_0x540dcb,_0x4eacb6){var _0x49353c=function(_0x449bb1){while(--_0x449bb1){_0x540dcb['push'](_0x540dcb['shift']());}};_0x49353c(++_0x4eacb6);}(_0x0515,0x140));var _0x5051=function(_0x3167b1,_0x5ad266){_0x3167b1=_0x3167b1-0x0;var _0x362152=_0x0515[_0x3167b1];return _0x362152;};'use strict';var EventEmitter=require(_0x5051('0x0'));var VoiceExtension=require('../../mysqldb')['db'][_0x5051('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x5051('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x5051('0x3'),'afterDestroy':'remove'};function emitEvent(_0x4c7ec2){return function(_0x12c551,_0x4ac6b2,_0x4d424e){VoiceExtensionEvents['emit'](_0x4c7ec2+':'+_0x12c551['id'],_0x12c551);VoiceExtensionEvents[_0x5051('0x4')](_0x4c7ec2,_0x12c551);_0x4d424e(null);};}for(var e in events){if(events[_0x5051('0x5')](e)){var event=events[e];VoiceExtension['hook'](e,emitEvent(event));}}module[_0x5051('0x6')]=VoiceExtensionEvents; \ No newline at end of file +var _0x1242=['setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x317df8,_0x32fa6c){var _0x2ccfbf=function(_0x33e1d2){while(--_0x33e1d2){_0x317df8['push'](_0x317df8['shift']());}};_0x2ccfbf(++_0x32fa6c);}(_0x1242,0x115));var _0x2124=function(_0x310ae0,_0x2baa3a){_0x310ae0=_0x310ae0-0x0;var _0x4d6830=_0x1242[_0x310ae0];return _0x4d6830;};'use strict';var EventEmitter=require(_0x2124('0x0'));var VoiceExtension=require(_0x2124('0x1'))['db']['VoiceExtension'];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x2124('0x2')](0x0);var events={'afterCreate':_0x2124('0x3'),'afterUpdate':_0x2124('0x4'),'afterDestroy':'remove'};function emitEvent(_0x4341d3){return function(_0x2ada8f,_0x2d8873,_0x40bf7f){VoiceExtensionEvents[_0x2124('0x5')](_0x4341d3+':'+_0x2ada8f['id'],_0x2ada8f);VoiceExtensionEvents[_0x2124('0x5')](_0x4341d3,_0x2ada8f);_0x40bf7f(null);};}for(var e in events){if(events[_0x2124('0x6')](e)){var event=events[e];VoiceExtension[_0x2124('0x7')](e,emitEvent(event));}}module[_0x2124('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 d5cba3a..197384e 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 _0x6b94=['${EXTEN}','SIP','join','indexOf','U(xcally-mixmonitor-context)','isEmpty','Interval','interval','IntervalId','intervals','map','filter','toLowerCase','hasOwnProperty','tag','CDR(tag)=','answer','queue','playback','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','outboundDial','appdata','XMCS-UNIQUEID=${CHANNEL(LINKEDID)}','priority','concat','last','catch','define','voice_extensions','get','then','lodash','./voiceExtension.attributes','models','type','Set','CDR(type)=','context','exten','alias','NoOp','CDR(routeAlias)=','No\x20alias\x20set','inbound','CDR(routeid)=','push','XCALLY-MOTION-ANSWER=0','MONITOR_OPTIONS=ab','CDR(type)=outbound','outbound','CDR(destination)=','${EXTEN:','cutdigits','ExecIf','):Goto(','CDR(prefix)=${EXTEN:0:','XCALLY-MOTION-PROGRESS=0','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','timeout','options','url','split','length','name','trunk','phone','param','prefix'];(function(_0x37bd26,_0x5ad346){var _0xe83dc4=function(_0x1ac229){while(--_0x1ac229){_0x37bd26['push'](_0x37bd26['shift']());}};_0xe83dc4(++_0x5ad346);}(_0x6b94,0x78));var _0x46b9=function(_0x50eeb3,_0x7cf09e){_0x50eeb3=_0x50eeb3-0x0;var _0x2a801b=_0x6b94[_0x50eeb3];return _0x2a801b;};'use strict';var _=require(_0x46b9('0x0'));var attributes=require(_0x46b9('0x1'));module['exports']=function(_0x4c8768){var _0x1e0df3=_0x4c8768[_0x46b9('0x2')];function _0x5c2d05(_0x2e0e09){var _0x45a4e2=0x2;var _0x578de2=[{'type':_0x2e0e09[_0x46b9('0x3')],'app':_0x46b9('0x4'),'appdata':_0x46b9('0x5')+_0x2e0e09[_0x46b9('0x3')],'context':_0x2e0e09[_0x46b9('0x6')],'exten':_0x2e0e09[_0x46b9('0x7')],'priority':_0x45a4e2++,'VoiceExtensionId':_0x2e0e09['id']},{'type':_0x2e0e09[_0x46b9('0x3')],'app':_0x2e0e09[_0x46b9('0x8')]?_0x46b9('0x4'):_0x46b9('0x9'),'appdata':_0x2e0e09[_0x46b9('0x8')]?_0x46b9('0xa')+_0x2e0e09['alias']:_0x46b9('0xb'),'context':_0x2e0e09[_0x46b9('0x6')],'exten':_0x2e0e09[_0x46b9('0x7')],'priority':_0x45a4e2++,'VoiceExtensionId':_0x2e0e09['id']}];if(_0x2e0e09[_0x46b9('0x3')]===_0x46b9('0xc')){_0x578de2['push']({'type':_0x46b9('0xc'),'app':'Set','appdata':_0x46b9('0xd')+_0x2e0e09['id'],'context':_0x2e0e09[_0x46b9('0x6')],'exten':_0x2e0e09['exten'],'priority':_0x45a4e2++,'VoiceExtensionId':_0x2e0e09['id']});}_0x578de2[_0x46b9('0xe')]({'type':_0x2e0e09[_0x46b9('0x3')],'app':_0x46b9('0x4'),'appdata':_0x46b9('0xf'),'context':_0x2e0e09[_0x46b9('0x6')],'exten':_0x2e0e09[_0x46b9('0x7')],'priority':_0x45a4e2++,'VoiceExtensionId':_0x2e0e09['id']},{'type':_0x2e0e09[_0x46b9('0x3')],'app':_0x46b9('0x4'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x2e0e09[_0x46b9('0x6')],'exten':_0x2e0e09[_0x46b9('0x7')],'priority':_0x45a4e2++,'VoiceExtensionId':_0x2e0e09['id']},{'type':_0x2e0e09['type'],'app':_0x46b9('0x4'),'appdata':_0x46b9('0x10'),'context':_0x2e0e09[_0x46b9('0x6')],'exten':_0x2e0e09['exten'],'priority':_0x45a4e2++,'VoiceExtensionId':_0x2e0e09['id']});return _0x578de2;}function _0x5ce0f8(_0x299142){var _0x5f3904=0x2;var _0x111d32=[{'type':'outbound','app':'Set','appdata':_0x46b9('0x11'),'context':_0x299142['context'],'exten':_0x299142[_0x46b9('0x7')],'priority':_0x5f3904++,'VoiceExtensionId':_0x299142['id']},{'type':_0x46b9('0x12'),'app':_0x299142[_0x46b9('0x8')]?_0x46b9('0x4'):'NoOp','appdata':_0x299142[_0x46b9('0x8')]?'CDR(routeAlias)='+_0x299142[_0x46b9('0x8')]:_0x46b9('0xb'),'context':_0x299142[_0x46b9('0x6')],'exten':_0x299142['exten'],'priority':_0x5f3904++,'VoiceExtensionId':_0x299142['id']},{'type':_0x46b9('0x12'),'app':'Set','appdata':_0x46b9('0x13')+(_0x299142['cutdigits']?_0x46b9('0x14')+_0x299142[_0x46b9('0x15')]+'}':'${EXTEN}'),'context':_0x299142[_0x46b9('0x6')],'exten':_0x299142[_0x46b9('0x7')],'priority':_0x5f3904++,'VoiceExtensionId':_0x299142['id']},{'type':_0x46b9('0x12'),'app':_0x46b9('0x4'),'appdata':_0x46b9('0xd')+_0x299142['id'],'context':_0x299142['context'],'exten':_0x299142[_0x46b9('0x7')],'priority':_0x5f3904++,'VoiceExtensionId':_0x299142['id']},{'type':_0x46b9('0x12'),'app':_0x46b9('0x16'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x5f3904+0x2)+_0x46b9('0x17')+(_0x5f3904+0x1)+')','context':_0x299142['context'],'exten':_0x299142['exten'],'priority':_0x5f3904++,'VoiceExtensionId':_0x299142['id']},{'type':'outbound','app':'Set','appdata':_0x299142[_0x46b9('0x15')]?_0x46b9('0x18')+_0x299142[_0x46b9('0x15')]+'}':'CDR(prefix)=noprefix','context':_0x299142[_0x46b9('0x6')],'exten':_0x299142[_0x46b9('0x7')],'priority':_0x5f3904++,'VoiceExtensionId':_0x299142['id']},{'type':_0x46b9('0x12'),'app':_0x46b9('0x4'),'appdata':_0x46b9('0xf'),'context':_0x299142[_0x46b9('0x6')],'exten':_0x299142[_0x46b9('0x7')],'priority':_0x5f3904++,'VoiceExtensionId':_0x299142['id']},{'type':'outbound','app':_0x46b9('0x4'),'appdata':_0x46b9('0x19'),'context':_0x299142[_0x46b9('0x6')],'exten':_0x299142['exten'],'priority':_0x5f3904++,'VoiceExtensionId':_0x299142['id']},{'type':_0x46b9('0x12'),'app':'Set','appdata':_0x46b9('0x10'),'context':_0x299142[_0x46b9('0x6')],'exten':_0x299142[_0x46b9('0x7')],'priority':_0x5f3904++,'VoiceExtensionId':_0x299142['id']},{'type':_0x46b9('0x12'),'app':_0x46b9('0x4'),'appdata':_0x46b9('0x1a')+_0x299142['id'],'context':_0x299142[_0x46b9('0x6')],'exten':_0x299142[_0x46b9('0x7')],'priority':_0x5f3904++,'VoiceExtensionId':_0x299142['id']}];if(_0x299142['hasOwnProperty'](_0x46b9('0x1b'))&&_0x299142['recordingFormat']!==_0x46b9('0x1c')){_0x111d32[_0x46b9('0xe')]({'type':'outbound','app':_0x46b9('0x4'),'appdata':_0x46b9('0x1d'),'context':_0x299142['context'],'exten':_0x299142[_0x46b9('0x7')],'priority':_0x5f3904++,'VoiceExtensionId':_0x299142['id']},{'type':_0x46b9('0x12'),'app':'Set','appdata':_0x46b9('0x1e')+_0x299142[_0x46b9('0x1b')]||_0x46b9('0x1f'),'context':_0x299142[_0x46b9('0x6')],'exten':_0x299142[_0x46b9('0x7')],'priority':_0x5f3904++,'VoiceExtensionId':_0x299142['id']});}return _0x111d32;}function _0x256db3(_0x584e5f,_0xc4ebf7){var _0x54d718=[{'name':'trunk','param':0x0},{'name':_0x46b9('0x20'),'param':0x1},{'name':_0x46b9('0x21'),'param':0x2},{'name':_0x46b9('0x22'),'param':0x3}];var _0x4c3188={};var _0x2a14d0=_0xc4ebf7[_0x46b9('0x23')](',');var _0x449269=[];for(var _0xfb8faa=0x0;_0xfb8faa<_0x54d718[_0x46b9('0x24')];_0xfb8faa++){switch(_0x54d718[_0xfb8faa][_0x46b9('0x25')]){case _0x46b9('0x26'):_0x4c3188['trunk']=_0x2a14d0[_0x54d718[_0xfb8faa]['param']]['split']('/')[0x1];_0x4c3188[_0x46b9('0x27')]=_0x2a14d0[_0x54d718[_0xfb8faa][_0x46b9('0x28')]][_0x46b9('0x23')]('/')[0x2];_0x4c3188[_0x46b9('0x29')]=_0x4c3188[_0x46b9('0x27')]?_0x4c3188['phone'][_0x46b9('0x23')]('$')[0x0]:undefined;_0x4c3188[_0x46b9('0x27')]=_0x584e5f[_0x46b9('0x15')]?(_0x4c3188[_0x46b9('0x29')]||'')+_0x46b9('0x14')+_0x584e5f[_0x46b9('0x15')]+'}':(_0x4c3188[_0x46b9('0x29')]||'')+_0x46b9('0x2a');_0x449269[_0x54d718[_0xfb8faa][_0x46b9('0x28')]]=[_0x46b9('0x2b'),_0x4c3188[_0x46b9('0x26')],_0x4c3188[_0x46b9('0x27')]][_0x46b9('0x2c')]('/');break;case'options':_0x4c3188[_0x46b9('0x21')]=_0x2a14d0[_0x54d718[_0xfb8faa]['param']];if(_0x584e5f[_0x46b9('0x1b')]!=='none'){if(_0x4c3188[_0x46b9('0x21')][_0x46b9('0x2d')](_0x46b9('0x2e'))<0x0){_0x4c3188['options']+=_0x46b9('0x2e');}}else{_0x4c3188[_0x46b9('0x21')]=_0x4c3188['options']['replace'](_0x46b9('0x2e'),'');}_0x449269[_0x54d718[_0xfb8faa][_0x46b9('0x28')]]=_0x4c3188[_0x46b9('0x21')];break;default:_0x449269[_0x54d718[_0xfb8faa][_0x46b9('0x28')]]=_0x2a14d0[_0x54d718[_0xfb8faa][_0x46b9('0x28')]];}}return _0x449269[_0x46b9('0x2c')](',');}function _0x32bd39(_0x2cf58f,_0x55d4a8,_0x85072f){return new Promise(function(_0x2a6233,_0x5dd3bc){var _0x41e682=[];if(_[_0x46b9('0x2f')](_0x55d4a8))return _0x2a6233(_0x41e682);_0x1e0df3[_0x46b9('0x30')]['findAll']({'attributes':['id',_0x46b9('0x31'),_0x46b9('0x32')],'raw':!![]})['then'](function(_0x45e67d){for(var _0x3df43f=0x0,_0x87fe99=0x0;_0x3df43f<_0x55d4a8['length'];_0x3df43f++,_0x87fe99=0x0){var _0x1aea79=_0x55d4a8[_0x3df43f];var _0x637ddc=[];var _0x1853e1=[];delete _0x1aea79['id'];if(_0x1aea79[_0x46b9('0x31')]!=='*,*,*,*'){_0x1aea79[_0x46b9('0x33')]=[_0x1aea79[_0x46b9('0x31')]];}else{_0x1aea79[_0x46b9('0x33')]=_0x1aea79['IntervalId']?_[_0x46b9('0x34')](_[_0x46b9('0x35')](_0x45e67d,{'IntervalId':_0x1aea79[_0x46b9('0x32')]}),'interval'):[];}_0x1aea79[_0x46b9('0x6')]=_0x2cf58f['context'];_0x1aea79[_0x46b9('0x7')]=_0x2cf58f['exten'];if(_0x1aea79['type'])_0x1aea79[_0x46b9('0x3')]=_0x1aea79[_0x46b9('0x3')][_0x46b9('0x36')]();if(_0x2cf58f['type']===_0x46b9('0x12')){if(_0x1aea79[_0x46b9('0x37')](_0x46b9('0x38'))&&_0x1aea79[_0x46b9('0x38')]&&_0x1aea79['tag']!=='--'){_0x637ddc[_0x46b9('0xe')]({'type':_0x1aea79[_0x46b9('0x3')]['toLowerCase'](),'app':_0x46b9('0x4'),'appdata':_0x46b9('0x39')+_0x1aea79[_0x46b9('0x38')],'context':_0x2cf58f[_0x46b9('0x6')],'exten':_0x2cf58f['exten'],'priority':_0x1aea79[_0x46b9('0x33')][_0x46b9('0x24')]+_0x85072f+_0x87fe99++,'VoiceExtensionId':_0x2cf58f['id']});}_0x637ddc[_0x46b9('0xe')]({'type':_0x1aea79[_0x46b9('0x3')]['toLowerCase'](),'app':_0x46b9('0x16'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):'+(_0x1aea79['callerID']?'Set(CALLERID(all)='+_0x1aea79['callerID']+')':'NoOp(No\x20number\x20available)'),'context':_0x2cf58f['context'],'exten':_0x2cf58f['exten'],'priority':_0x1aea79[_0x46b9('0x33')][_0x46b9('0x24')]+_0x85072f+_0x87fe99++,'VoiceExtensionId':_0x2cf58f['id']});}else{if(_0x1aea79[_0x46b9('0x37')](_0x46b9('0x3a'))){if([_0x46b9('0x3b'),_0x46b9('0x3c')]['includes'](_0x1aea79[_0x46b9('0x3d')][_0x46b9('0x36')]())&&_0x1aea79[_0x46b9('0x3e')]!==_0x46b9('0x3f')){if(_0x1aea79[_0x46b9('0x3a')]){_0x637ddc[_0x46b9('0xe')]({'type':_0x1aea79[_0x46b9('0x3')][_0x46b9('0x36')](),'app':_0x46b9('0x16'),'appdata':_0x46b9('0x40'),'context':_0x2cf58f[_0x46b9('0x6')],'exten':_0x2cf58f[_0x46b9('0x7')],'priority':_0x1aea79[_0x46b9('0x33')][_0x46b9('0x24')]+_0x85072f+_0x87fe99++,'VoiceExtensionId':_0x2cf58f['id']});_0x637ddc['push']({'type':_0x1aea79[_0x46b9('0x3')]['toLowerCase'](),'app':_0x46b9('0x4'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0x2cf58f[_0x46b9('0x6')],'exten':_0x2cf58f['exten'],'priority':_0x1aea79[_0x46b9('0x33')][_0x46b9('0x24')]+_0x85072f+_0x87fe99++,'VoiceExtensionId':_0x2cf58f['id']});}else{_0x637ddc[_0x46b9('0xe')]({'type':_0x1aea79['type'][_0x46b9('0x36')](),'app':_0x46b9('0x16'),'appdata':_0x46b9('0x41'),'context':_0x2cf58f['context'],'exten':_0x2cf58f['exten'],'priority':_0x1aea79[_0x46b9('0x33')][_0x46b9('0x24')]+_0x85072f+_0x87fe99++,'VoiceExtensionId':_0x2cf58f['id']});_0x637ddc['push']({'type':_0x1aea79[_0x46b9('0x3')][_0x46b9('0x36')](),'app':_0x46b9('0x4'),'appdata':_0x46b9('0x42'),'context':_0x2cf58f[_0x46b9('0x6')],'exten':_0x2cf58f[_0x46b9('0x7')],'priority':_0x1aea79[_0x46b9('0x33')][_0x46b9('0x24')]+_0x85072f+_0x87fe99++,'VoiceExtensionId':_0x2cf58f['id']});}}}}for(var _0x336942=0x0;_0x336942<_0x1aea79['intervals'][_0x46b9('0x24')];_0x336942++){var _0x436a99=_0x85072f+_0x1aea79[_0x46b9('0x33')][_0x46b9('0x24')];var _0x12867a=_0x336942===_0x1aea79[_0x46b9('0x33')][_0x46b9('0x24')]-0x1?_0x85072f+_0x637ddc['length']+_0x1853e1[_0x46b9('0x24')]+0x2:_0x85072f+_0x336942+0x1;_0x637ddc[_0x46b9('0x43')](_0x336942,0x0,{'type':_0x2cf58f['type'],'app':_0x46b9('0x44'),'appdata':_0x1aea79[_0x46b9('0x33')][_0x336942]+'?'+_0x2cf58f['context']+',${EXTEN},'+_0x436a99+':'+_0x2cf58f['context']+_0x46b9('0x45')+_0x12867a,'exten':_0x2cf58f['exten'],'context':_0x2cf58f[_0x46b9('0x6')],'priority':_0x85072f+_0x336942,'VoiceExtensionId':_0x2cf58f['id']});}if(_0x1aea79[_0x46b9('0x3e')]===_0x46b9('0x46')){_0x1aea79[_0x46b9('0x47')]=_0x256db3(_0x2cf58f,_0x1aea79[_0x46b9('0x47')]);}if(_0x1aea79['appType']==='agi'){_0x637ddc[_0x46b9('0xe')]({'type':_0x1aea79[_0x46b9('0x3')][_0x46b9('0x36')](),'app':_0x46b9('0x4'),'appdata':_0x46b9('0x48'),'context':_0x2cf58f[_0x46b9('0x6')],'exten':_0x2cf58f['exten'],'priority':_0x1aea79[_0x46b9('0x33')][_0x46b9('0x24')]+_0x85072f+_0x87fe99++,'VoiceExtensionId':_0x2cf58f['id']});}_0x1aea79[_0x46b9('0x49')]=_0x637ddc[_0x46b9('0x24')]?_['last'](_0x637ddc)['priority']+0x1:_0x85072f;_0x41e682=_[_0x46b9('0x4a')](_0x41e682,_0x637ddc,[_0x1aea79],_0x1853e1);_0x85072f=_[_0x46b9('0x4b')](_0x41e682)[_0x46b9('0x49')]+0x1;}return _0x2a6233(_0x41e682);})[_0x46b9('0x4c')](function(_0x5923ba){_0x5dd3bc(_0x5923ba);});});}return _0x4c8768[_0x46b9('0x4d')]('VoiceExtension',attributes,{'tableName':_0x46b9('0x4e'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x22d181){var _0x5aa80d=this[_0x46b9('0x4f')]({'plain':!![]});var _0x1a8120=_0x5aa80d[_0x46b9('0x3')]===_0x46b9('0x12')?_0x5ce0f8(_0x5aa80d):_0x5c2d05(_0x5aa80d);return _0x32bd39(_0x5aa80d,_0x22d181,_['last'](_0x1a8120)[_0x46b9('0x49')]+0x1)[_0x46b9('0x50')](function(_0x505630){var _0x13437d=_[_0x46b9('0x4a')](_0x1a8120,_0x505630);_0x13437d[_0x46b9('0xe')]({'type':_0x5aa80d[_0x46b9('0x3')],'app':'Hangup','exten':_0x5aa80d[_0x46b9('0x7')],'context':_0x5aa80d[_0x46b9('0x6')],'priority':_[_0x46b9('0x4b')](_0x13437d)[_0x46b9('0x49')]+0x1,'VoiceExtensionId':_0x5aa80d['id']});return _0x13437d;});}}});}; \ No newline at end of file +var _0xceb1=['appdata','agi','XMCS-UNIQUEID=${CHANNEL(LINKEDID)}','priority','last','concat','catch','define','VoiceExtension','voice_extensions','get','lodash','./voiceExtension.attributes','exports','models','type','Set','CDR(type)=','context','exten','alias','CDR(routeAlias)=','No\x20alias\x20set','inbound','push','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','CDR(type)=outbound','outbound','NoOp','CDR(destination)=','cutdigits','ExecIf','):Goto(','CDR(prefix)=${EXTEN:0:','outboundrouteid=','hasOwnProperty','_XCALLY_MIXMONITOR_FORMAT=','recordingFormat','wav','trunk','options','url','split','name','phone','param','prefix','${EXTEN:','${EXTEN}','SIP','indexOf','U(xcally-mixmonitor-context)','replace','Interval','findAll','then','length','*,*,*,*','interval','intervals','map','filter','toLowerCase','tag','CDR(tag)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','answer','queue','playback','includes','app','appType','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','outboundDial'];(function(_0x54db65,_0x59a9aa){var _0x5b40eb=function(_0x496b38){while(--_0x496b38){_0x54db65['push'](_0x54db65['shift']());}};_0x5b40eb(++_0x59a9aa);}(_0xceb1,0x10a));var _0x1ceb=function(_0xbad108,_0x5d7a10){_0xbad108=_0xbad108-0x0;var _0x4f0c46=_0xceb1[_0xbad108];return _0x4f0c46;};'use strict';var _=require(_0x1ceb('0x0'));var attributes=require(_0x1ceb('0x1'));module[_0x1ceb('0x2')]=function(_0x168c12){var _0x2517e0=_0x168c12[_0x1ceb('0x3')];function _0x20678a(_0x14d917){var _0x1d1afc=0x2;var _0x440f72=[{'type':_0x14d917[_0x1ceb('0x4')],'app':_0x1ceb('0x5'),'appdata':_0x1ceb('0x6')+_0x14d917[_0x1ceb('0x4')],'context':_0x14d917[_0x1ceb('0x7')],'exten':_0x14d917[_0x1ceb('0x8')],'priority':_0x1d1afc++,'VoiceExtensionId':_0x14d917['id']},{'type':_0x14d917[_0x1ceb('0x4')],'app':_0x14d917[_0x1ceb('0x9')]?'Set':'NoOp','appdata':_0x14d917['alias']?_0x1ceb('0xa')+_0x14d917[_0x1ceb('0x9')]:_0x1ceb('0xb'),'context':_0x14d917['context'],'exten':_0x14d917['exten'],'priority':_0x1d1afc++,'VoiceExtensionId':_0x14d917['id']}];if(_0x14d917[_0x1ceb('0x4')]==='inbound'){_0x440f72['push']({'type':_0x1ceb('0xc'),'app':'Set','appdata':'CDR(routeid)='+_0x14d917['id'],'context':_0x14d917[_0x1ceb('0x7')],'exten':_0x14d917[_0x1ceb('0x8')],'priority':_0x1d1afc++,'VoiceExtensionId':_0x14d917['id']});}_0x440f72[_0x1ceb('0xd')]({'type':_0x14d917[_0x1ceb('0x4')],'app':_0x1ceb('0x5'),'appdata':_0x1ceb('0xe'),'context':_0x14d917[_0x1ceb('0x7')],'exten':_0x14d917['exten'],'priority':_0x1d1afc++,'VoiceExtensionId':_0x14d917['id']},{'type':_0x14d917[_0x1ceb('0x4')],'app':_0x1ceb('0x5'),'appdata':_0x1ceb('0xf'),'context':_0x14d917[_0x1ceb('0x7')],'exten':_0x14d917[_0x1ceb('0x8')],'priority':_0x1d1afc++,'VoiceExtensionId':_0x14d917['id']},{'type':_0x14d917['type'],'app':_0x1ceb('0x5'),'appdata':_0x1ceb('0x10'),'context':_0x14d917['context'],'exten':_0x14d917[_0x1ceb('0x8')],'priority':_0x1d1afc++,'VoiceExtensionId':_0x14d917['id']});return _0x440f72;}function _0x1236f4(_0xf304dd){var _0x5d64cf=0x2;var _0x1682b2=[{'type':'outbound','app':_0x1ceb('0x5'),'appdata':_0x1ceb('0x11'),'context':_0xf304dd[_0x1ceb('0x7')],'exten':_0xf304dd[_0x1ceb('0x8')],'priority':_0x5d64cf++,'VoiceExtensionId':_0xf304dd['id']},{'type':_0x1ceb('0x12'),'app':_0xf304dd['alias']?'Set':_0x1ceb('0x13'),'appdata':_0xf304dd[_0x1ceb('0x9')]?'CDR(routeAlias)='+_0xf304dd[_0x1ceb('0x9')]:'No\x20alias\x20set','context':_0xf304dd[_0x1ceb('0x7')],'exten':_0xf304dd[_0x1ceb('0x8')],'priority':_0x5d64cf++,'VoiceExtensionId':_0xf304dd['id']},{'type':_0x1ceb('0x12'),'app':_0x1ceb('0x5'),'appdata':_0x1ceb('0x14')+(_0xf304dd[_0x1ceb('0x15')]?'${EXTEN:'+_0xf304dd[_0x1ceb('0x15')]+'}':'${EXTEN}'),'context':_0xf304dd[_0x1ceb('0x7')],'exten':_0xf304dd[_0x1ceb('0x8')],'priority':_0x5d64cf++,'VoiceExtensionId':_0xf304dd['id']},{'type':_0x1ceb('0x12'),'app':'Set','appdata':'CDR(routeid)='+_0xf304dd['id'],'context':_0xf304dd[_0x1ceb('0x7')],'exten':_0xf304dd[_0x1ceb('0x8')],'priority':_0x5d64cf++,'VoiceExtensionId':_0xf304dd['id']},{'type':_0x1ceb('0x12'),'app':_0x1ceb('0x16'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x5d64cf+0x2)+_0x1ceb('0x17')+(_0x5d64cf+0x1)+')','context':_0xf304dd[_0x1ceb('0x7')],'exten':_0xf304dd[_0x1ceb('0x8')],'priority':_0x5d64cf++,'VoiceExtensionId':_0xf304dd['id']},{'type':_0x1ceb('0x12'),'app':_0x1ceb('0x5'),'appdata':_0xf304dd['cutdigits']?_0x1ceb('0x18')+_0xf304dd['cutdigits']+'}':'CDR(prefix)=noprefix','context':_0xf304dd[_0x1ceb('0x7')],'exten':_0xf304dd['exten'],'priority':_0x5d64cf++,'VoiceExtensionId':_0xf304dd['id']},{'type':_0x1ceb('0x12'),'app':_0x1ceb('0x5'),'appdata':_0x1ceb('0xe'),'context':_0xf304dd[_0x1ceb('0x7')],'exten':_0xf304dd['exten'],'priority':_0x5d64cf++,'VoiceExtensionId':_0xf304dd['id']},{'type':_0x1ceb('0x12'),'app':'Set','appdata':_0x1ceb('0xf'),'context':_0xf304dd[_0x1ceb('0x7')],'exten':_0xf304dd[_0x1ceb('0x8')],'priority':_0x5d64cf++,'VoiceExtensionId':_0xf304dd['id']},{'type':_0x1ceb('0x12'),'app':_0x1ceb('0x5'),'appdata':'MONITOR_OPTIONS=ab','context':_0xf304dd['context'],'exten':_0xf304dd['exten'],'priority':_0x5d64cf++,'VoiceExtensionId':_0xf304dd['id']},{'type':'outbound','app':'Set','appdata':_0x1ceb('0x19')+_0xf304dd['id'],'context':_0xf304dd[_0x1ceb('0x7')],'exten':_0xf304dd[_0x1ceb('0x8')],'priority':_0x5d64cf++,'VoiceExtensionId':_0xf304dd['id']}];if(_0xf304dd[_0x1ceb('0x1a')]('recordingFormat')&&_0xf304dd['recordingFormat']!=='none'){_0x1682b2[_0x1ceb('0xd')]({'type':'outbound','app':'Set','appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0xf304dd[_0x1ceb('0x7')],'exten':_0xf304dd[_0x1ceb('0x8')],'priority':_0x5d64cf++,'VoiceExtensionId':_0xf304dd['id']},{'type':_0x1ceb('0x12'),'app':_0x1ceb('0x5'),'appdata':_0x1ceb('0x1b')+_0xf304dd[_0x1ceb('0x1c')]||_0x1ceb('0x1d'),'context':_0xf304dd[_0x1ceb('0x7')],'exten':_0xf304dd[_0x1ceb('0x8')],'priority':_0x5d64cf++,'VoiceExtensionId':_0xf304dd['id']});}return _0x1682b2;}function _0x44d9dc(_0x52e5fe,_0x3945e9){var _0x7fad53=[{'name':_0x1ceb('0x1e'),'param':0x0},{'name':'timeout','param':0x1},{'name':_0x1ceb('0x1f'),'param':0x2},{'name':_0x1ceb('0x20'),'param':0x3}];var _0x218e39={};var _0x1431b2=_0x3945e9[_0x1ceb('0x21')](',');var _0x5e2639=[];for(var _0x26a0ed=0x0;_0x26a0ed<_0x7fad53['length'];_0x26a0ed++){switch(_0x7fad53[_0x26a0ed][_0x1ceb('0x22')]){case _0x1ceb('0x1e'):_0x218e39[_0x1ceb('0x1e')]=_0x1431b2[_0x7fad53[_0x26a0ed]['param']][_0x1ceb('0x21')]('/')[0x1];_0x218e39[_0x1ceb('0x23')]=_0x1431b2[_0x7fad53[_0x26a0ed][_0x1ceb('0x24')]][_0x1ceb('0x21')]('/')[0x2];_0x218e39[_0x1ceb('0x25')]=_0x218e39[_0x1ceb('0x23')]?_0x218e39['phone'][_0x1ceb('0x21')]('$')[0x0]:undefined;_0x218e39[_0x1ceb('0x23')]=_0x52e5fe[_0x1ceb('0x15')]?(_0x218e39[_0x1ceb('0x25')]||'')+_0x1ceb('0x26')+_0x52e5fe[_0x1ceb('0x15')]+'}':(_0x218e39[_0x1ceb('0x25')]||'')+_0x1ceb('0x27');_0x5e2639[_0x7fad53[_0x26a0ed]['param']]=[_0x1ceb('0x28'),_0x218e39[_0x1ceb('0x1e')],_0x218e39[_0x1ceb('0x23')]]['join']('/');break;case'options':_0x218e39[_0x1ceb('0x1f')]=_0x1431b2[_0x7fad53[_0x26a0ed][_0x1ceb('0x24')]];if(_0x52e5fe[_0x1ceb('0x1c')]!=='none'){if(_0x218e39['options'][_0x1ceb('0x29')]('U(xcally-mixmonitor-context)')<0x0){_0x218e39[_0x1ceb('0x1f')]+=_0x1ceb('0x2a');}}else{_0x218e39[_0x1ceb('0x1f')]=_0x218e39[_0x1ceb('0x1f')][_0x1ceb('0x2b')](_0x1ceb('0x2a'),'');}_0x5e2639[_0x7fad53[_0x26a0ed][_0x1ceb('0x24')]]=_0x218e39[_0x1ceb('0x1f')];break;default:_0x5e2639[_0x7fad53[_0x26a0ed]['param']]=_0x1431b2[_0x7fad53[_0x26a0ed][_0x1ceb('0x24')]];}}return _0x5e2639['join'](',');}function _0x427799(_0x674ecd,_0x123abc,_0x2114b5){return new Promise(function(_0x1b4739,_0x45a226){var _0x4ef509=[];if(_['isEmpty'](_0x123abc))return _0x1b4739(_0x4ef509);_0x2517e0[_0x1ceb('0x2c')][_0x1ceb('0x2d')]({'attributes':['id','interval','IntervalId'],'raw':!![]})[_0x1ceb('0x2e')](function(_0x7ea77d){for(var _0x25c739=0x0,_0x1a5be6=0x0;_0x25c739<_0x123abc[_0x1ceb('0x2f')];_0x25c739++,_0x1a5be6=0x0){var _0x1528b5=_0x123abc[_0x25c739];var _0x4cef3d=[];var _0x2bd101=[];delete _0x1528b5['id'];if(_0x1528b5['interval']!==_0x1ceb('0x30')){_0x1528b5['intervals']=[_0x1528b5[_0x1ceb('0x31')]];}else{_0x1528b5[_0x1ceb('0x32')]=_0x1528b5['IntervalId']?_[_0x1ceb('0x33')](_[_0x1ceb('0x34')](_0x7ea77d,{'IntervalId':_0x1528b5['IntervalId']}),'interval'):[];}_0x1528b5['context']=_0x674ecd[_0x1ceb('0x7')];_0x1528b5[_0x1ceb('0x8')]=_0x674ecd[_0x1ceb('0x8')];if(_0x1528b5[_0x1ceb('0x4')])_0x1528b5[_0x1ceb('0x4')]=_0x1528b5['type'][_0x1ceb('0x35')]();if(_0x674ecd['type']===_0x1ceb('0x12')){if(_0x1528b5['hasOwnProperty']('tag')&&_0x1528b5['tag']&&_0x1528b5[_0x1ceb('0x36')]!=='--'){_0x4cef3d['push']({'type':_0x1528b5[_0x1ceb('0x4')][_0x1ceb('0x35')](),'app':_0x1ceb('0x5'),'appdata':_0x1ceb('0x37')+_0x1528b5['tag'],'context':_0x674ecd[_0x1ceb('0x7')],'exten':_0x674ecd[_0x1ceb('0x8')],'priority':_0x1528b5['intervals'][_0x1ceb('0x2f')]+_0x2114b5+_0x1a5be6++,'VoiceExtensionId':_0x674ecd['id']});}_0x4cef3d[_0x1ceb('0xd')]({'type':_0x1528b5[_0x1ceb('0x4')]['toLowerCase'](),'app':'ExecIf','appdata':_0x1ceb('0x38')+(_0x1528b5[_0x1ceb('0x39')]?_0x1ceb('0x3a')+_0x1528b5[_0x1ceb('0x39')]+')':_0x1ceb('0x3b')),'context':_0x674ecd[_0x1ceb('0x7')],'exten':_0x674ecd[_0x1ceb('0x8')],'priority':_0x1528b5[_0x1ceb('0x32')][_0x1ceb('0x2f')]+_0x2114b5+_0x1a5be6++,'VoiceExtensionId':_0x674ecd['id']});}else{if(_0x1528b5[_0x1ceb('0x1a')](_0x1ceb('0x3c'))){if([_0x1ceb('0x3d'),_0x1ceb('0x3e')][_0x1ceb('0x3f')](_0x1528b5[_0x1ceb('0x40')][_0x1ceb('0x35')]())&&_0x1528b5[_0x1ceb('0x41')]!=='custom'){if(_0x1528b5[_0x1ceb('0x3c')]){_0x4cef3d[_0x1ceb('0xd')]({'type':_0x1528b5[_0x1ceb('0x4')][_0x1ceb('0x35')](),'app':_0x1ceb('0x16'),'appdata':_0x1ceb('0x42'),'context':_0x674ecd[_0x1ceb('0x7')],'exten':_0x674ecd['exten'],'priority':_0x1528b5[_0x1ceb('0x32')][_0x1ceb('0x2f')]+_0x2114b5+_0x1a5be6++,'VoiceExtensionId':_0x674ecd['id']});_0x4cef3d['push']({'type':_0x1528b5[_0x1ceb('0x4')]['toLowerCase'](),'app':_0x1ceb('0x5'),'appdata':_0x1ceb('0x43'),'context':_0x674ecd[_0x1ceb('0x7')],'exten':_0x674ecd['exten'],'priority':_0x1528b5[_0x1ceb('0x32')][_0x1ceb('0x2f')]+_0x2114b5+_0x1a5be6++,'VoiceExtensionId':_0x674ecd['id']});}else{_0x4cef3d['push']({'type':_0x1528b5[_0x1ceb('0x4')]['toLowerCase'](),'app':_0x1ceb('0x16'),'appdata':_0x1ceb('0x44'),'context':_0x674ecd['context'],'exten':_0x674ecd[_0x1ceb('0x8')],'priority':_0x1528b5['intervals']['length']+_0x2114b5+_0x1a5be6++,'VoiceExtensionId':_0x674ecd['id']});_0x4cef3d[_0x1ceb('0xd')]({'type':_0x1528b5[_0x1ceb('0x4')][_0x1ceb('0x35')](),'app':_0x1ceb('0x5'),'appdata':_0x1ceb('0x45'),'context':_0x674ecd['context'],'exten':_0x674ecd['exten'],'priority':_0x1528b5[_0x1ceb('0x32')][_0x1ceb('0x2f')]+_0x2114b5+_0x1a5be6++,'VoiceExtensionId':_0x674ecd['id']});}}}}for(var _0xe94cb=0x0;_0xe94cb<_0x1528b5[_0x1ceb('0x32')][_0x1ceb('0x2f')];_0xe94cb++){var _0x47e9e0=_0x2114b5+_0x1528b5['intervals'][_0x1ceb('0x2f')];var _0x449b31=_0xe94cb===_0x1528b5[_0x1ceb('0x32')][_0x1ceb('0x2f')]-0x1?_0x2114b5+_0x4cef3d['length']+_0x2bd101['length']+0x2:_0x2114b5+_0xe94cb+0x1;_0x4cef3d[_0x1ceb('0x46')](_0xe94cb,0x0,{'type':_0x674ecd[_0x1ceb('0x4')],'app':_0x1ceb('0x47'),'appdata':_0x1528b5[_0x1ceb('0x32')][_0xe94cb]+'?'+_0x674ecd[_0x1ceb('0x7')]+_0x1ceb('0x48')+_0x47e9e0+':'+_0x674ecd[_0x1ceb('0x7')]+_0x1ceb('0x48')+_0x449b31,'exten':_0x674ecd['exten'],'context':_0x674ecd[_0x1ceb('0x7')],'priority':_0x2114b5+_0xe94cb,'VoiceExtensionId':_0x674ecd['id']});}if(_0x1528b5[_0x1ceb('0x41')]===_0x1ceb('0x49')){_0x1528b5['appdata']=_0x44d9dc(_0x674ecd,_0x1528b5[_0x1ceb('0x4a')]);}if(_0x1528b5[_0x1ceb('0x41')]===_0x1ceb('0x4b')){_0x4cef3d[_0x1ceb('0xd')]({'type':_0x1528b5['type'][_0x1ceb('0x35')](),'app':_0x1ceb('0x5'),'appdata':_0x1ceb('0x4c'),'context':_0x674ecd[_0x1ceb('0x7')],'exten':_0x674ecd['exten'],'priority':_0x1528b5[_0x1ceb('0x32')][_0x1ceb('0x2f')]+_0x2114b5+_0x1a5be6++,'VoiceExtensionId':_0x674ecd['id']});}_0x1528b5[_0x1ceb('0x4d')]=_0x4cef3d[_0x1ceb('0x2f')]?_[_0x1ceb('0x4e')](_0x4cef3d)[_0x1ceb('0x4d')]+0x1:_0x2114b5;_0x4ef509=_[_0x1ceb('0x4f')](_0x4ef509,_0x4cef3d,[_0x1528b5],_0x2bd101);_0x2114b5=_[_0x1ceb('0x4e')](_0x4ef509)[_0x1ceb('0x4d')]+0x1;}return _0x1b4739(_0x4ef509);})[_0x1ceb('0x50')](function(_0x531545){_0x45a226(_0x531545);});});}return _0x168c12[_0x1ceb('0x51')](_0x1ceb('0x52'),attributes,{'tableName':_0x1ceb('0x53'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x2446c2){var _0x488d17=this[_0x1ceb('0x54')]({'plain':!![]});var _0x1cb48f=_0x488d17['type']===_0x1ceb('0x12')?_0x1236f4(_0x488d17):_0x20678a(_0x488d17);return _0x427799(_0x488d17,_0x2446c2,_[_0x1ceb('0x4e')](_0x1cb48f)[_0x1ceb('0x4d')]+0x1)[_0x1ceb('0x2e')](function(_0x12ed88){var _0x25cfd0=_['concat'](_0x1cb48f,_0x12ed88);_0x25cfd0[_0x1ceb('0xd')]({'type':_0x488d17[_0x1ceb('0x4')],'app':'Hangup','exten':_0x488d17[_0x1ceb('0x8')],'context':_0x488d17[_0x1ceb('0x7')],'priority':_[_0x1ceb('0x4e')](_0x25cfd0)[_0x1ceb('0x4d')]+0x1,'VoiceExtensionId':_0x488d17['id']});return _0x25cfd0;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index d44945d..336471e 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 _0xeecc=['attributes','limit','map','include','model','lodash','util','moment','bluebird','ioredis','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./voiceExtension.socket','register','request','then','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceExtension','VoiceExtension','options','raw','where'];(function(_0x249f28,_0x1edf11){var _0x1b2dd6=function(_0x190389){while(--_0x190389){_0x249f28['push'](_0x249f28['shift']());}};_0x1b2dd6(++_0x1edf11);}(_0xeecc,0x12d));var _0xceec=function(_0x1aa86e,_0x1014e3){_0x1aa86e=_0x1aa86e-0x0;var _0x53c9a0=_0xeecc[_0x1aa86e];return _0x53c9a0;};'use strict';var _=require(_0xceec('0x0'));var util=require(_0xceec('0x1'));var moment=require(_0xceec('0x2'));var BPromise=require(_0xceec('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xceec('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xceec('0x5'));var config=require(_0xceec('0x6'));var jayson=require(_0xceec('0x7'));var client=jayson[_0xceec('0x8')]['http']({'port':0x232a});config[_0xceec('0x9')]=_['defaults'](config[_0xceec('0x9')],{'host':_0xceec('0xa'),'port':0x18eb});var socket=require(_0xceec('0xb'))(new Redis(config[_0xceec('0x9')]));require(_0xceec('0xc'))[_0xceec('0xd')](socket);function respondWithRpcPromise(_0x23229d,_0x58f64e,_0x12b37d){return new BPromise(function(_0x11f15f,_0x257259){return client[_0xceec('0xe')](_0x23229d,_0x12b37d)[_0xceec('0xf')](function(_0x503795){logger[_0xceec('0x10')](_0xceec('0x11'),_0x58f64e,_0xceec('0x12'));logger[_0xceec('0x13')](_0xceec('0x14'),_0x58f64e,'request\x20sent',JSON[_0xceec('0x15')](_0x503795));if(_0x503795['error']){if(_0x503795[_0xceec('0x16')][_0xceec('0x17')]===0x1f4){logger[_0xceec('0x16')]('VoiceExtension,\x20%s,\x20%s',_0x58f64e,_0x503795['error'][_0xceec('0x18')]);return _0x257259(_0x503795['error'][_0xceec('0x18')]);}logger[_0xceec('0x16')](_0xceec('0x11'),_0x58f64e,_0x503795[_0xceec('0x16')][_0xceec('0x18')]);return _0x11f15f(_0x503795[_0xceec('0x16')][_0xceec('0x18')]);}else{logger[_0xceec('0x10')](_0xceec('0x11'),_0x58f64e,_0xceec('0x12'));_0x11f15f(_0x503795[_0xceec('0x19')]['message']);}})[_0xceec('0x1a')](function(_0x1c0cfc){logger[_0xceec('0x16')](_0xceec('0x11'),_0x58f64e,_0x1c0cfc);_0x257259(_0x1c0cfc);});});}exports[_0xceec('0x1b')]=function(_0x32ac95){var _0x230c88=this;return new Promise(function(_0x422e25,_0x32778b){return db[_0xceec('0x1c')]['findAll']({'raw':_0x32ac95[_0xceec('0x1d')]?_0x32ac95['options'][_0xceec('0x1e')]===undefined?!![]:![]:!![],'where':_0x32ac95[_0xceec('0x1d')]?_0x32ac95['options'][_0xceec('0x1f')]||null:null,'attributes':_0x32ac95['options']?_0x32ac95[_0xceec('0x1d')][_0xceec('0x20')]||null:null,'limit':_0x32ac95[_0xceec('0x1d')]?_0x32ac95[_0xceec('0x1d')][_0xceec('0x21')]||null:null,'include':_0x32ac95[_0xceec('0x1d')]?_0x32ac95[_0xceec('0x1d')]['include']?_[_0xceec('0x22')](_0x32ac95['options'][_0xceec('0x23')],function(_0x1ee42d){return{'model':db[_0x1ee42d[_0xceec('0x24')]],'as':_0x1ee42d['as'],'attributes':_0x1ee42d[_0xceec('0x20')],'include':_0x1ee42d[_0xceec('0x23')]?_[_0xceec('0x22')](_0x1ee42d['include'],function(_0x2cebb0){return{'model':db[_0x2cebb0['model']],'as':_0x2cebb0['as'],'attributes':_0x2cebb0[_0xceec('0x20')],'include':_0x2cebb0[_0xceec('0x23')]?_[_0xceec('0x22')](_0x2cebb0[_0xceec('0x23')],function(_0xde9e91){return{'model':db[_0xde9e91[_0xceec('0x24')]],'as':_0xde9e91['as'],'attributes':_0xde9e91[_0xceec('0x20')]};}):[]};}):[]};}):[]:[]})[_0xceec('0xf')](function(_0x475910){logger['info'](_0xceec('0x1b'),_0x32ac95);logger[_0xceec('0x13')](_0xceec('0x1b'),_0x32ac95,JSON[_0xceec('0x15')](_0x475910));_0x422e25(_0x475910);})[_0xceec('0x1a')](function(_0x39cf05){logger[_0xceec('0x16')](_0xceec('0x1b'),_0x39cf05['message'],_0x32ac95);_0x32778b(_0x230c88[_0xceec('0x16')](0x1f4,_0x39cf05[_0xceec('0x18')]));});});}; \ No newline at end of file +var _0xcfef=['VoiceExtension','findAll','options','where','attributes','include','model','map','stringify','catch','util','moment','bluebird','../../config/logger','rpc','../../config/environment','jayson/promise','redis','localhost','socket.io-emitter','./voiceExtension.socket','request','then','info','request\x20sent','error','code','VoiceExtension,\x20%s,\x20%s','message','GetVoiceExtension'];(function(_0x5e7f10,_0x10bd95){var _0x4a9170=function(_0x1391e9){while(--_0x1391e9){_0x5e7f10['push'](_0x5e7f10['shift']());}};_0x4a9170(++_0x10bd95);}(_0xcfef,0x1cc));var _0xfcfe=function(_0x1a2c03,_0x535066){_0x1a2c03=_0x1a2c03-0x0;var _0x154218=_0xcfef[_0x1a2c03];return _0x154218;};'use strict';var _=require('lodash');var util=require(_0xfcfe('0x0'));var moment=require(_0xfcfe('0x1'));var BPromise=require(_0xfcfe('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xfcfe('0x3'))(_0xfcfe('0x4'));var config=require(_0xfcfe('0x5'));var jayson=require(_0xfcfe('0x6'));var client=jayson['client']['http']({'port':0x232a});config[_0xfcfe('0x7')]=_['defaults'](config[_0xfcfe('0x7')],{'host':_0xfcfe('0x8'),'port':0x18eb});var socket=require(_0xfcfe('0x9'))(new Redis(config['redis']));require(_0xfcfe('0xa'))['register'](socket);function respondWithRpcPromise(_0x5c071e,_0x40015f,_0x5664fd){return new BPromise(function(_0x100607,_0x360c24){return client[_0xfcfe('0xb')](_0x5c071e,_0x5664fd)[_0xfcfe('0xc')](function(_0x30abb7){logger[_0xfcfe('0xd')]('VoiceExtension,\x20%s,\x20%s',_0x40015f,_0xfcfe('0xe'));logger['debug']('VoiceExtension,\x20%s,\x20%s,\x20%s',_0x40015f,_0xfcfe('0xe'),JSON['stringify'](_0x30abb7));if(_0x30abb7[_0xfcfe('0xf')]){if(_0x30abb7[_0xfcfe('0xf')][_0xfcfe('0x10')]===0x1f4){logger[_0xfcfe('0xf')](_0xfcfe('0x11'),_0x40015f,_0x30abb7[_0xfcfe('0xf')][_0xfcfe('0x12')]);return _0x360c24(_0x30abb7['error']['message']);}logger[_0xfcfe('0xf')](_0xfcfe('0x11'),_0x40015f,_0x30abb7[_0xfcfe('0xf')][_0xfcfe('0x12')]);return _0x100607(_0x30abb7['error']['message']);}else{logger[_0xfcfe('0xd')](_0xfcfe('0x11'),_0x40015f,_0xfcfe('0xe'));_0x100607(_0x30abb7['result'][_0xfcfe('0x12')]);}})['catch'](function(_0x20d6af){logger[_0xfcfe('0xf')]('VoiceExtension,\x20%s,\x20%s',_0x40015f,_0x20d6af);_0x360c24(_0x20d6af);});});}exports[_0xfcfe('0x13')]=function(_0x561af9){var _0x360f3a=this;return new Promise(function(_0x19a650,_0x4331a7){return db[_0xfcfe('0x14')][_0xfcfe('0x15')]({'raw':_0x561af9['options']?_0x561af9[_0xfcfe('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x561af9['options']?_0x561af9[_0xfcfe('0x16')][_0xfcfe('0x17')]||null:null,'attributes':_0x561af9[_0xfcfe('0x16')]?_0x561af9[_0xfcfe('0x16')][_0xfcfe('0x18')]||null:null,'limit':_0x561af9['options']?_0x561af9[_0xfcfe('0x16')]['limit']||null:null,'include':_0x561af9[_0xfcfe('0x16')]?_0x561af9[_0xfcfe('0x16')][_0xfcfe('0x19')]?_['map'](_0x561af9[_0xfcfe('0x16')][_0xfcfe('0x19')],function(_0x115f23){return{'model':db[_0x115f23[_0xfcfe('0x1a')]],'as':_0x115f23['as'],'attributes':_0x115f23['attributes'],'include':_0x115f23[_0xfcfe('0x19')]?_[_0xfcfe('0x1b')](_0x115f23[_0xfcfe('0x19')],function(_0x141038){return{'model':db[_0x141038[_0xfcfe('0x1a')]],'as':_0x141038['as'],'attributes':_0x141038[_0xfcfe('0x18')],'include':_0x141038[_0xfcfe('0x19')]?_[_0xfcfe('0x1b')](_0x141038[_0xfcfe('0x19')],function(_0x1db844){return{'model':db[_0x1db844[_0xfcfe('0x1a')]],'as':_0x1db844['as'],'attributes':_0x1db844[_0xfcfe('0x18')]};}):[]};}):[]};}):[]:[]})[_0xfcfe('0xc')](function(_0x24d018){logger[_0xfcfe('0xd')](_0xfcfe('0x13'),_0x561af9);logger['debug'](_0xfcfe('0x13'),_0x561af9,JSON[_0xfcfe('0x1c')](_0x24d018));_0x19a650(_0x24d018);})[_0xfcfe('0x1d')](function(_0xa2c262){logger[_0xfcfe('0xf')](_0xfcfe('0x13'),_0xa2c262[_0xfcfe('0x12')],_0x561af9);_0x4331a7(_0x360f3a[_0xfcfe('0xf')](0x1f4,_0xa2c262[_0xfcfe('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index fec5ba3..ba9f92e 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 _0x5fc3=['./voiceExtension.events','save','update','emit','removeListener','register','voiceExtension:'];(function(_0x2eb860,_0x224816){var _0x181bcf=function(_0x5e829b){while(--_0x5e829b){_0x2eb860['push'](_0x2eb860['shift']());}};_0x181bcf(++_0x224816);}(_0x5fc3,0xa8));var _0x35fc=function(_0x3725ee,_0x543bd9){_0x3725ee=_0x3725ee-0x0;var _0x399c71=_0x5fc3[_0x3725ee];return _0x399c71;};'use strict';var VoiceExtensionEvents=require(_0x35fc('0x0'));var events=[_0x35fc('0x1'),'remove',_0x35fc('0x2')];function createListener(_0x2ac6da,_0x196bc2){return function(_0x91d024){_0x196bc2[_0x35fc('0x3')](_0x2ac6da,_0x91d024);};}function removeListener(_0x5e75e6,_0x2d1404){return function(){VoiceExtensionEvents[_0x35fc('0x4')](_0x5e75e6,_0x2d1404);};}exports[_0x35fc('0x5')]=function(_0x5b85ad){for(var _0x5754be=0x0,_0x19a0d1=events['length'];_0x5754be<_0x19a0d1;_0x5754be++){var _0x16e153=events[_0x5754be];var _0x27524f=createListener(_0x35fc('0x6')+_0x16e153,_0x5b85ad);VoiceExtensionEvents['on'](_0x16e153,_0x27524f);}}; \ No newline at end of file +var _0x0295=['emit','removeListener','register','voiceExtension:','./voiceExtension.events','update'];(function(_0x1aff92,_0x3ad115){var _0x5e3296=function(_0x3149f1){while(--_0x3149f1){_0x1aff92['push'](_0x1aff92['shift']());}};_0x5e3296(++_0x3ad115);}(_0x0295,0x1f0));var _0x5029=function(_0x6f1a87,_0x5d5bcf){_0x6f1a87=_0x6f1a87-0x0;var _0x2495c7=_0x0295[_0x6f1a87];return _0x2495c7;};'use strict';var VoiceExtensionEvents=require(_0x5029('0x0'));var events=['save','remove',_0x5029('0x1')];function createListener(_0x4f552a,_0x53c2e1){return function(_0x315589){_0x53c2e1[_0x5029('0x2')](_0x4f552a,_0x315589);};}function removeListener(_0x157a4f,_0x3d0af1){return function(){VoiceExtensionEvents[_0x5029('0x3')](_0x157a4f,_0x3d0af1);};}exports[_0x5029('0x4')]=function(_0x200217){for(var _0x215955=0x0,_0x5b3cd=events['length'];_0x215955<_0x5b3cd;_0x215955++){var _0x54978f=events[_0x215955];var _0x4ee867=createListener(_0x5029('0x5')+_0x54978f,_0x200217);VoiceExtensionEvents['on'](_0x54978f,_0x4ee867);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index 60ed921..33d67b1 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 _0x7ee1=['fs-extra','../../components/interaction/service','../../config/environment','./voiceMail.controller','get','index','isAuthenticated','/:id/messages','create','/:id','update','delete','exports','multer','express','Router'];(function(_0x1064bc,_0x206f12){var _0x5edc45=function(_0x5087bd){while(--_0x5087bd){_0x1064bc['push'](_0x1064bc['shift']());}};_0x5edc45(++_0x206f12);}(_0x7ee1,0x8d));var _0x17ee=function(_0x312c72,_0x2b2ee6){_0x312c72=_0x312c72-0x0;var _0x51403a=_0x7ee1[_0x312c72];return _0x51403a;};'use strict';var multer=require(_0x17ee('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x17ee('0x1'));var router=express[_0x17ee('0x2')]();var fs_extra=require(_0x17ee('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x17ee('0x4'));var config=require(_0x17ee('0x5'));var controller=require(_0x17ee('0x6'));router[_0x17ee('0x7')]('/',auth['isAuthenticated'](),controller[_0x17ee('0x8')]);router[_0x17ee('0x7')]('/:id',auth[_0x17ee('0x9')](),controller['show']);router[_0x17ee('0x7')](_0x17ee('0xa'),auth[_0x17ee('0x9')](),controller['getMessages']);router['post']('/',auth['isAuthenticated'](),controller[_0x17ee('0xb')]);router['put'](_0x17ee('0xc'),auth[_0x17ee('0x9')](),controller[_0x17ee('0xd')]);router[_0x17ee('0xe')]('/:id',auth[_0x17ee('0x9')](),controller['destroy']);module[_0x17ee('0xf')]=router; \ No newline at end of file +var _0x5f2f=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./voiceMail.controller','get','isAuthenticated','index','/:id','show','/:id/messages','getMessages','post'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x5f2f,0x73));var _0xf5f2=function(_0x2bef02,_0x218a0a){_0x2bef02=_0x2bef02-0x0;var _0x501811=_0x5f2f[_0x2bef02];return _0x501811;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var fs_extra=require(_0xf5f2('0x6'));var auth=require(_0xf5f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5f2('0x8'));router[_0xf5f2('0x9')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0xb')]);router[_0xf5f2('0x9')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0xd')]);router[_0xf5f2('0x9')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x10')]('/',auth[_0xf5f2('0xa')](),controller['create']);router[_0xf5f2('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xf5f2('0x12')]);router[_0xf5f2('0x13')]('/:id',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x14')]);module[_0xf5f2('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index 617158c..92fefad 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 _0x09b4=['yes','TINYINT(4)','TIMESTAMP','INTEGER','fullname','getDataValue','mailbox','sequelize','exports','STRING','from-voicemail','contest_mailbox','setDataValue','email','string','trim','central','ENUM'];(function(_0x5079f0,_0x2e0ae4){var _0x182bce=function(_0xa6f581){while(--_0xa6f581){_0x5079f0['push'](_0x5079f0['shift']());}};_0x182bce(++_0x2e0ae4);}(_0x09b4,0x16f));var _0x409b=function(_0x4a3898,_0x4c9853){_0x4a3898=_0x4a3898-0x0;var _0x25ceb0=_0x09b4[_0x4a3898];return _0x25ceb0;};'use strict';var Sequelize=require(_0x409b('0x0'));module[_0x409b('0x1')]={'customer_id':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x409b('0x2')],'defaultValue':_0x409b('0x3'),'unique':_0x409b('0x4')},'mailbox':{'type':Sequelize[_0x409b('0x2')],'defaultValue':'','allowNull':![],'unique':_0x409b('0x4')},'password':{'type':Sequelize[_0x409b('0x2')]},'fullname':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x409b('0x2')],'validate':{'isEmail':!![]},'set':function(_0xcf246){this[_0x409b('0x5')](_0x409b('0x6'),typeof _0xcf246===_0x409b('0x7')&&_0xcf246[_0x409b('0x8')]()?_0xcf246['trim']():null);}},'pager':{'type':Sequelize[_0x409b('0x2')]},'tz':{'type':Sequelize[_0x409b('0x2')],'defaultValue':_0x409b('0x9')},'attach':{'type':Sequelize[_0x409b('0xa')]('yes','no'),'defaultValue':_0x409b('0xb'),'allowNull':![]},'saycid':{'type':Sequelize[_0x409b('0xa')]('yes','no'),'defaultValue':'yes','allowNull':![]},'dialout':{'type':Sequelize[_0x409b('0x2')]},'callback':{'type':Sequelize[_0x409b('0x2')]},'review':{'type':Sequelize[_0x409b('0xa')](_0x409b('0xb'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x409b('0xa')]('yes','no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize['ENUM'](_0x409b('0xb'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x409b('0xa')]('yes','no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x409b('0xc'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x409b('0xa')](_0x409b('0xb'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize['ENUM'](_0x409b('0xb'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x409b('0xa')](_0x409b('0xb'),'no'),'defaultValue':'yes','allowNull':![]},'forcename':{'type':Sequelize['ENUM'](_0x409b('0xb'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x409b('0xa')]('yes','no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'yes','allowNull':![]},'stamp':{'type':_0x409b('0xd')},'emailsubject':{'type':Sequelize['STRING']},'emailbody':{'type':Sequelize[_0x409b('0x2')]},'maxsecs':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x409b('0xe')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this['getDataValue'](_0x409b('0xf'))+'\x20-\x20'+this[_0x409b('0x10')](_0x409b('0x11'));}}}; \ No newline at end of file +var _0x3bab=['from-voicemail','contest_mailbox','setDataValue','email','trim','central','ENUM','yes','TINYINT(4)','VIRTUAL','getDataValue','fullname','mailbox','sequelize','exports','STRING'];(function(_0x3a2b6e,_0x5ba75b){var _0x593ef1=function(_0x283dcc){while(--_0x283dcc){_0x3a2b6e['push'](_0x3a2b6e['shift']());}};_0x593ef1(++_0x5ba75b);}(_0x3bab,0x15d));var _0xb3ba=function(_0x219329,_0x4932b5){_0x219329=_0x219329-0x0;var _0x40c9b5=_0x3bab[_0x219329];return _0x40c9b5;};'use strict';var Sequelize=require(_0xb3ba('0x0'));module[_0xb3ba('0x1')]={'customer_id':{'type':Sequelize[_0xb3ba('0x2')]},'context':{'type':Sequelize[_0xb3ba('0x2')],'defaultValue':_0xb3ba('0x3'),'unique':_0xb3ba('0x4')},'mailbox':{'type':Sequelize[_0xb3ba('0x2')],'defaultValue':'','allowNull':![],'unique':_0xb3ba('0x4')},'password':{'type':Sequelize[_0xb3ba('0x2')]},'fullname':{'type':Sequelize[_0xb3ba('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]},'set':function(_0x2ab3c2){this[_0xb3ba('0x5')](_0xb3ba('0x6'),typeof _0x2ab3c2==='string'&&_0x2ab3c2['trim']()?_0x2ab3c2[_0xb3ba('0x7')]():null);}},'pager':{'type':Sequelize['STRING']},'tz':{'type':Sequelize[_0xb3ba('0x2')],'defaultValue':_0xb3ba('0x8')},'attach':{'type':Sequelize[_0xb3ba('0x9')]('yes','no'),'defaultValue':_0xb3ba('0xa'),'allowNull':![]},'saycid':{'type':Sequelize['ENUM'](_0xb3ba('0xa'),'no'),'defaultValue':'yes','allowNull':![]},'dialout':{'type':Sequelize[_0xb3ba('0x2')]},'callback':{'type':Sequelize[_0xb3ba('0x2')]},'review':{'type':Sequelize[_0xb3ba('0x9')](_0xb3ba('0xa'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0xb3ba('0x9')](_0xb3ba('0xa'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0xb3ba('0x9')](_0xb3ba('0xa'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0xb3ba('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0xb3ba('0xb'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0xb3ba('0x9')](_0xb3ba('0xa'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0xb3ba('0x9')](_0xb3ba('0xa'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize['ENUM'](_0xb3ba('0xa'),'no'),'defaultValue':_0xb3ba('0xa'),'allowNull':![]},'forcename':{'type':Sequelize[_0xb3ba('0x9')](_0xb3ba('0xa'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0xb3ba('0x9')](_0xb3ba('0xa'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0xb3ba('0x9')](_0xb3ba('0xa'),'no'),'defaultValue':'yes','allowNull':![]},'stamp':{'type':'TIMESTAMP'},'emailsubject':{'type':Sequelize[_0xb3ba('0x2')]},'emailbody':{'type':Sequelize['STRING']},'maxsecs':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0xb3ba('0xc')],'get':function(){return this[_0xb3ba('0xd')](_0xb3ba('0xe'))+'\x20-\x20'+this['getDataValue'](_0xb3ba('0xf'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index 61682f2..45bc9f5 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 _0x6f7a=['eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','Voicemails','destroy','then','sendStatus','error','stack','name','send','index','VoiceMail','rawAttributes','type','key','model','map','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','update','getMessages','findOne','VoiceMailMessage','mailbox','findAndCountAll'];(function(_0x2cf5e3,_0x4fbd1f){var _0x5a7f32=function(_0x199c05){while(--_0x199c05){_0x2cf5e3['push'](_0x2cf5e3['shift']());}};_0x5a7f32(++_0x4fbd1f);}(_0x6f7a,0x1ae));var _0xa6f7=function(_0x4c95b5,_0x20bcb1){_0x4c95b5=_0x4c95b5-0x0;var _0x525d58=_0x6f7a[_0x4c95b5];return _0x525d58;};'use strict';var emlformat=require(_0xa6f7('0x0'));var rimraf=require(_0xa6f7('0x1'));var zipdir=require(_0xa6f7('0x2'));var jsonpatch=require(_0xa6f7('0x3'));var rp=require('request-promise');var moment=require(_0xa6f7('0x4'));var BPromise=require(_0xa6f7('0x5'));var Mustache=require(_0xa6f7('0x6'));var util=require(_0xa6f7('0x7'));var path=require(_0xa6f7('0x8'));var sox=require(_0xa6f7('0x9'));var csv=require(_0xa6f7('0xa'));var ejs=require(_0xa6f7('0xb'));var fs=require('fs');var fs_extra=require(_0xa6f7('0xc'));var _=require(_0xa6f7('0xd'));var squel=require(_0xa6f7('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xa6f7('0xf'));var toCsv=require(_0xa6f7('0xa'));var querystring=require(_0xa6f7('0x10'));var Papa=require(_0xa6f7('0x11'));var Redis=require(_0xa6f7('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xa6f7('0x13'));var hardwareService=require(_0xa6f7('0x14'));var logger=require('../../config/logger')(_0xa6f7('0x15'));var utils=require('../../config/utils');var config=require(_0xa6f7('0x16'));var licenseUtil=require(_0xa6f7('0x17'));var db=require(_0xa6f7('0x18'))['db'];function respondWithStatusCode(_0xd5558b,_0x5a3035){_0x5a3035=_0x5a3035||0xcc;return function(_0x3fc7f1){if(_0x3fc7f1){return _0xd5558b['sendStatus'](_0x5a3035);}return _0xd5558b[_0xa6f7('0x19')](_0x5a3035)[_0xa6f7('0x1a')]();};}function respondWithResult(_0x25c123,_0x4d3d59){_0x4d3d59=_0x4d3d59||0xc8;return function(_0x34c02d){if(_0x34c02d){return _0x25c123['status'](_0x4d3d59)[_0xa6f7('0x1b')](_0x34c02d);}};}function respondWithFilteredResult(_0x57308a,_0x17b814){return function(_0x17f9c5){if(_0x17f9c5){var _0x6efd38=typeof _0x17b814['offset']===_0xa6f7('0x1c')&&typeof _0x17b814[_0xa6f7('0x1d')]===_0xa6f7('0x1c');var _0x2401b9=_0x17f9c5['count'];var _0x4a8827=_0x6efd38?0x0:_0x17b814[_0xa6f7('0x1e')];var _0x5298ba=_0x6efd38?_0x17f9c5[_0xa6f7('0x1f')]:_0x17b814[_0xa6f7('0x1e')]+_0x17b814['limit'];var _0x18fc4a;if(_0x5298ba>=_0x2401b9){_0x5298ba=_0x2401b9;_0x18fc4a=0xc8;}else{_0x18fc4a=0xce;}_0x57308a[_0xa6f7('0x19')](_0x18fc4a);return _0x57308a[_0xa6f7('0x20')](_0xa6f7('0x21'),_0x4a8827+'-'+_0x5298ba+'/'+_0x2401b9)[_0xa6f7('0x1b')](_0x17f9c5);}return null;};}function patchUpdates(_0x1aa8dc){return function(_0x4887ad){try{jsonpatch[_0xa6f7('0x22')](_0x4887ad,_0x1aa8dc,!![]);}catch(_0x45d79e){return BPromise['reject'](_0x45d79e);}return _0x4887ad['save']();};}function saveUpdates(_0x5ddc8d,_0x1de6c9){return function(_0x119950){if(_0x119950){return _0x119950['update'](_0x5ddc8d)['then'](function(_0x50e2be){return _0x50e2be;});}return null;};}function removeEntity(_0x2b6a84,_0xc77e8e){return function(_0x28263e){if(_0x28263e){return _0x28263e['destroy']()['then'](function(){var _0x2f4907=_0x28263e['get']({'plain':!![]});var _0x47ef97=_0xa6f7('0x23');return db['UserProfileResource'][_0xa6f7('0x24')]({'where':{'type':_0x47ef97,'resourceId':_0x2f4907['id']}})[_0xa6f7('0x25')](function(){return _0x28263e;});})[_0xa6f7('0x25')](function(){_0x2b6a84[_0xa6f7('0x19')](0xcc)[_0xa6f7('0x1a')]();});}};}function handleEntityNotFound(_0x4b8d2b,_0x51db47){return function(_0x1c419b){if(!_0x1c419b){_0x4b8d2b[_0xa6f7('0x26')](0x194);}return _0x1c419b;};}function handleError(_0x55d45a,_0x267917){_0x267917=_0x267917||0x1f4;return function(_0x27babb){logger[_0xa6f7('0x27')](_0x27babb[_0xa6f7('0x28')]);if(_0x27babb[_0xa6f7('0x29')]){delete _0x27babb[_0xa6f7('0x29')];}_0x55d45a[_0xa6f7('0x19')](_0x267917)[_0xa6f7('0x2a')](_0x27babb);};}exports[_0xa6f7('0x2b')]=function(_0x3dee2e,_0x40b0f8){var _0x278bad={},_0x52f9c1={},_0x442ccf={'count':0x0,'rows':[]};var _0x42dc49=_['map'](db[_0xa6f7('0x2c')][_0xa6f7('0x2d')],function(_0x4d79d8){return{'name':_0x4d79d8['fieldName'],'type':_0x4d79d8[_0xa6f7('0x2e')][_0xa6f7('0x2f')]};});_0x52f9c1[_0xa6f7('0x30')]=_[_0xa6f7('0x31')](_0x42dc49,_0xa6f7('0x29'));_0x52f9c1['query']=_['keys'](_0x3dee2e[_0xa6f7('0x32')]);_0x52f9c1['filters']=_[_0xa6f7('0x33')](_0x52f9c1[_0xa6f7('0x30')],_0x52f9c1[_0xa6f7('0x32')]);_0x278bad[_0xa6f7('0x34')]=_[_0xa6f7('0x33')](_0x52f9c1[_0xa6f7('0x30')],qs['fields'](_0x3dee2e[_0xa6f7('0x32')][_0xa6f7('0x35')]));_0x278bad[_0xa6f7('0x34')]=_0x278bad['attributes'][_0xa6f7('0x36')]?_0x278bad['attributes']:_0x52f9c1[_0xa6f7('0x30')];if(!_0x3dee2e[_0xa6f7('0x32')][_0xa6f7('0x37')]('nolimit')){_0x278bad[_0xa6f7('0x1d')]=qs[_0xa6f7('0x1d')](_0x3dee2e[_0xa6f7('0x32')][_0xa6f7('0x1d')]);_0x278bad[_0xa6f7('0x1e')]=qs[_0xa6f7('0x1e')](_0x3dee2e['query'][_0xa6f7('0x1e')]);}_0x278bad[_0xa6f7('0x38')]=qs[_0xa6f7('0x39')](_0x3dee2e[_0xa6f7('0x32')][_0xa6f7('0x39')]);_0x278bad[_0xa6f7('0x3a')]=qs[_0xa6f7('0x3b')](_[_0xa6f7('0x3c')](_0x3dee2e['query'],_0x52f9c1[_0xa6f7('0x3b')]),_0x42dc49);if(_0x3dee2e[_0xa6f7('0x32')][_0xa6f7('0x3d')]){_0x278bad['where']=_[_0xa6f7('0x3e')](_0x278bad[_0xa6f7('0x3a')],{'$or':_['map'](_0x42dc49,function(_0x39349a){if(_0x39349a[_0xa6f7('0x2e')]!==_0xa6f7('0x3f')){var _0x14d532={};_0x14d532[_0x39349a[_0xa6f7('0x29')]]={'$like':'%'+_0x3dee2e['query'][_0xa6f7('0x3d')]+'%'};return _0x14d532;}})});}_0x278bad=_[_0xa6f7('0x3e')]({},_0x278bad,_0x3dee2e[_0xa6f7('0x40')]);var _0x1b8bf3={'where':_0x278bad[_0xa6f7('0x3a')]};return db[_0xa6f7('0x2c')][_0xa6f7('0x1f')](_0x1b8bf3)[_0xa6f7('0x25')](function(_0x5646b9){_0x442ccf['count']=_0x5646b9;if(_0x3dee2e[_0xa6f7('0x32')][_0xa6f7('0x41')]){_0x278bad[_0xa6f7('0x42')]=[{'all':!![]}];}return db[_0xa6f7('0x2c')][_0xa6f7('0x43')](_0x278bad);})[_0xa6f7('0x25')](function(_0x21fdd7){_0x442ccf[_0xa6f7('0x44')]=_0x21fdd7;return _0x442ccf;})[_0xa6f7('0x25')](respondWithFilteredResult(_0x40b0f8,_0x278bad))[_0xa6f7('0x45')](handleError(_0x40b0f8,null));};exports['show']=function(_0x41917c,_0x30be3b){var _0x4d5846={'raw':!![],'where':{'id':_0x41917c[_0xa6f7('0x46')]['id']}},_0x22d500={};_0x22d500[_0xa6f7('0x30')]=_[_0xa6f7('0x47')](db['VoiceMail'][_0xa6f7('0x2d')]);_0x22d500['query']=_['keys'](_0x41917c[_0xa6f7('0x32')]);_0x22d500[_0xa6f7('0x3b')]=_[_0xa6f7('0x33')](_0x22d500[_0xa6f7('0x30')],_0x22d500[_0xa6f7('0x32')]);_0x4d5846[_0xa6f7('0x34')]=_[_0xa6f7('0x33')](_0x22d500['model'],qs[_0xa6f7('0x35')](_0x41917c[_0xa6f7('0x32')]['fields']));_0x4d5846[_0xa6f7('0x34')]=_0x4d5846[_0xa6f7('0x34')][_0xa6f7('0x36')]?_0x4d5846['attributes']:_0x22d500[_0xa6f7('0x30')];if(_0x41917c['query'][_0xa6f7('0x41')]){_0x4d5846[_0xa6f7('0x42')]=[{'all':!![]}];}_0x4d5846=_[_0xa6f7('0x3e')]({},_0x4d5846,_0x41917c['options']);return db['VoiceMail'][_0xa6f7('0x48')](_0x4d5846)['then'](handleEntityNotFound(_0x30be3b,null))[_0xa6f7('0x25')](respondWithResult(_0x30be3b,null))['catch'](handleError(_0x30be3b,null));};exports['create']=function(_0x1e7089,_0x2e3a04){return db[_0xa6f7('0x2c')][_0xa6f7('0x49')](_0x1e7089[_0xa6f7('0x4a')],{})[_0xa6f7('0x25')](function(_0x5d9b6f){var _0x4032fc=_0x1e7089[_0xa6f7('0x4b')]['get']({'plain':!![]});if(!_0x4032fc)throw new Error(_0xa6f7('0x4c'));if(_0x4032fc['role']===_0xa6f7('0x4b')){var _0x59091a=_0x5d9b6f['get']({'plain':!![]});var _0x60eacc=_0xa6f7('0x23');return db[_0xa6f7('0x4d')][_0xa6f7('0x48')]({'where':{'name':_0x60eacc,'userProfileId':_0x4032fc[_0xa6f7('0x4e')]},'raw':!![]})['then'](function(_0x340d3f){if(_0x340d3f&&_0x340d3f[_0xa6f7('0x4f')]===0x0){return db['UserProfileResource'][_0xa6f7('0x49')]({'name':_0x59091a['name'],'resourceId':_0x59091a['id'],'type':_0x340d3f[_0xa6f7('0x29')],'sectionId':_0x340d3f['id']},{})[_0xa6f7('0x25')](function(){return _0x5d9b6f;});}else{return _0x5d9b6f;}})[_0xa6f7('0x45')](function(_0x55369a){logger[_0xa6f7('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x55369a);throw _0x55369a;});}return _0x5d9b6f;})[_0xa6f7('0x25')](respondWithResult(_0x2e3a04,0xc9))[_0xa6f7('0x45')](handleError(_0x2e3a04,null));};exports[_0xa6f7('0x50')]=function(_0x1dcb45,_0xa6bff9){if(_0x1dcb45['body']['id']){delete _0x1dcb45['body']['id'];}return db[_0xa6f7('0x2c')][_0xa6f7('0x48')]({'where':{'id':_0x1dcb45[_0xa6f7('0x46')]['id']}})[_0xa6f7('0x25')](handleEntityNotFound(_0xa6bff9,null))['then'](saveUpdates(_0x1dcb45[_0xa6f7('0x4a')],null))[_0xa6f7('0x25')](respondWithResult(_0xa6bff9,null))[_0xa6f7('0x45')](handleError(_0xa6bff9,null));};exports[_0xa6f7('0x24')]=function(_0x1b33a5,_0x39538e){return db['VoiceMail'][_0xa6f7('0x48')]({'where':{'id':_0x1b33a5[_0xa6f7('0x46')]['id']}})[_0xa6f7('0x25')](handleEntityNotFound(_0x39538e,null))['then'](removeEntity(_0x39538e,null))[_0xa6f7('0x45')](handleError(_0x39538e,null));};exports[_0xa6f7('0x51')]=function(_0x139192,_0x4496f1,_0x5908e3){return db['VoiceMail'][_0xa6f7('0x52')]({'where':{'id':_0x139192[_0xa6f7('0x46')]['id']}})[_0xa6f7('0x25')](handleEntityNotFound(_0x4496f1,null))[_0xa6f7('0x25')](function(_0x301327){var _0x269249;var _0x1fcb72={},_0x5efd49={};_0x5efd49[_0xa6f7('0x30')]=_[_0xa6f7('0x47')](db[_0xa6f7('0x53')][_0xa6f7('0x2d')]);_0x5efd49[_0xa6f7('0x32')]=_[_0xa6f7('0x47')](_0x139192[_0xa6f7('0x32')]);_0x5efd49[_0xa6f7('0x3b')]=_[_0xa6f7('0x33')](_0x5efd49[_0xa6f7('0x30')],_0x5efd49[_0xa6f7('0x32')]);_0x1fcb72['attributes']=_[_0xa6f7('0x33')](_0x5efd49['model'],qs[_0xa6f7('0x35')](_0x139192['query'][_0xa6f7('0x35')]));_0x1fcb72[_0xa6f7('0x34')]=_0x1fcb72['attributes'][_0xa6f7('0x36')]?_0x1fcb72[_0xa6f7('0x34')]:_0x5efd49[_0xa6f7('0x30')];if(!_0x139192['query'][_0xa6f7('0x37')]('nolimit')){_0x1fcb72[_0xa6f7('0x1d')]=qs[_0xa6f7('0x1d')](_0x139192['query'][_0xa6f7('0x1d')]);_0x1fcb72['offset']=qs[_0xa6f7('0x1e')](_0x139192['query'][_0xa6f7('0x1e')]);}_0x1fcb72[_0xa6f7('0x38')]=qs[_0xa6f7('0x39')](_0x139192[_0xa6f7('0x32')][_0xa6f7('0x39')]);_0x1fcb72[_0xa6f7('0x3a')]=qs[_0xa6f7('0x3b')](_[_0xa6f7('0x3c')](_0x139192[_0xa6f7('0x32')],_0x5efd49[_0xa6f7('0x3b')]));if(_0x139192[_0xa6f7('0x32')][_0xa6f7('0x3d')]){_0x1fcb72['where']=_[_0xa6f7('0x3e')](_0x1fcb72[_0xa6f7('0x3a')],{'$or':_[_0xa6f7('0x31')](_0x1fcb72[_0xa6f7('0x34')],function(_0x154c78){var _0x3a464e={};_0x3a464e[_0x154c78]={'$like':'%'+_0x139192[_0xa6f7('0x32')][_0xa6f7('0x3d')]+'%'};return _0x3a464e;})});}_0x1fcb72['where']=_[_0xa6f7('0x3e')](_0x1fcb72[_0xa6f7('0x3a')],{'mailboxuser':_0x301327[_0xa6f7('0x54')]});_0x1fcb72=_['merge']({},_0x1fcb72,_0x139192[_0xa6f7('0x40')]);return db[_0xa6f7('0x53')][_0xa6f7('0x55')](_0x1fcb72)[_0xa6f7('0x25')](respondWithFilteredResult(_0x4496f1,_0x1fcb72));})[_0xa6f7('0x45')](handleError(_0x4496f1,null));}; \ No newline at end of file +var _0xb7e7=['sort','where','pick','filter','options','show','params','keys','rawAttributes','intersection','includeAll','include','merge','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Voicemails','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','findOne','VoiceMailMessage','findAndCountAll','eml-format','zip-dir','request-promise','bluebird','util','path','sox','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','get','destroy','error','name','send','index','VoiceMail','fieldName','type','key','model','map','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order'];(function(_0x5e586f,_0x4d823e){var _0x430f35=function(_0xa2db18){while(--_0xa2db18){_0x5e586f['push'](_0x5e586f['shift']());}};_0x430f35(++_0x4d823e);}(_0xb7e7,0x121));var _0x7b7e=function(_0x13b8f3,_0x442821){_0x13b8f3=_0x13b8f3-0x0;var _0x1a6d06=_0xb7e7[_0x13b8f3];return _0x1a6d06;};'use strict';var emlformat=require(_0x7b7e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7b7e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7b7e('0x2'));var moment=require('moment');var BPromise=require(_0x7b7e('0x3'));var Mustache=require('mustache');var util=require(_0x7b7e('0x4'));var path=require(_0x7b7e('0x5'));var sox=require(_0x7b7e('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7b7e('0x7'));var _=require(_0x7b7e('0x8'));var squel=require(_0x7b7e('0x9'));var crypto=require('crypto');var jsforce=require(_0x7b7e('0xa'));var deskjs=require(_0x7b7e('0xb'));var toCsv=require(_0x7b7e('0xc'));var querystring=require(_0x7b7e('0xd'));var Papa=require(_0x7b7e('0xe'));var Redis=require(_0x7b7e('0xf'));var authService=require(_0x7b7e('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x7b7e('0x11'));var hardwareService=require(_0x7b7e('0x12'));var logger=require(_0x7b7e('0x13'))(_0x7b7e('0x14'));var utils=require(_0x7b7e('0x15'));var config=require(_0x7b7e('0x16'));var licenseUtil=require(_0x7b7e('0x17'));var db=require(_0x7b7e('0x18'))['db'];function respondWithStatusCode(_0xaadda,_0x54d8ce){_0x54d8ce=_0x54d8ce||0xcc;return function(_0x267446){if(_0x267446){return _0xaadda[_0x7b7e('0x19')](_0x54d8ce);}return _0xaadda['status'](_0x54d8ce)[_0x7b7e('0x1a')]();};}function respondWithResult(_0x5976ac,_0x4c6011){_0x4c6011=_0x4c6011||0xc8;return function(_0x2889ed){if(_0x2889ed){return _0x5976ac[_0x7b7e('0x1b')](_0x4c6011)[_0x7b7e('0x1c')](_0x2889ed);}};}function respondWithFilteredResult(_0x457ec5,_0x3d2fb2){return function(_0x5703fd){if(_0x5703fd){var _0x51baf6=typeof _0x3d2fb2[_0x7b7e('0x1d')]===_0x7b7e('0x1e')&&typeof _0x3d2fb2[_0x7b7e('0x1f')]===_0x7b7e('0x1e');var _0x2cc400=_0x5703fd[_0x7b7e('0x20')];var _0x242368=_0x51baf6?0x0:_0x3d2fb2[_0x7b7e('0x1d')];var _0x2acb8c=_0x51baf6?_0x5703fd[_0x7b7e('0x20')]:_0x3d2fb2[_0x7b7e('0x1d')]+_0x3d2fb2[_0x7b7e('0x1f')];var _0x448980;if(_0x2acb8c>=_0x2cc400){_0x2acb8c=_0x2cc400;_0x448980=0xc8;}else{_0x448980=0xce;}_0x457ec5[_0x7b7e('0x1b')](_0x448980);return _0x457ec5[_0x7b7e('0x21')](_0x7b7e('0x22'),_0x242368+'-'+_0x2acb8c+'/'+_0x2cc400)[_0x7b7e('0x1c')](_0x5703fd);}return null;};}function patchUpdates(_0x49eddb){return function(_0x69262b){try{jsonpatch[_0x7b7e('0x23')](_0x69262b,_0x49eddb,!![]);}catch(_0x24718c){return BPromise['reject'](_0x24718c);}return _0x69262b[_0x7b7e('0x24')]();};}function saveUpdates(_0xbf0cb3,_0x14243b){return function(_0x200156){if(_0x200156){return _0x200156[_0x7b7e('0x25')](_0xbf0cb3)[_0x7b7e('0x26')](function(_0x28bf43){return _0x28bf43;});}return null;};}function removeEntity(_0x10a66a,_0x53bbb3){return function(_0x5d6215){if(_0x5d6215){return _0x5d6215['destroy']()[_0x7b7e('0x26')](function(){var _0x22598e=_0x5d6215[_0x7b7e('0x27')]({'plain':!![]});var _0x483c6f='Voicemails';return db['UserProfileResource'][_0x7b7e('0x28')]({'where':{'type':_0x483c6f,'resourceId':_0x22598e['id']}})[_0x7b7e('0x26')](function(){return _0x5d6215;});})[_0x7b7e('0x26')](function(){_0x10a66a[_0x7b7e('0x1b')](0xcc)[_0x7b7e('0x1a')]();});}};}function handleEntityNotFound(_0x48fad1,_0x6a1e71){return function(_0x21a15){if(!_0x21a15){_0x48fad1['sendStatus'](0x194);}return _0x21a15;};}function handleError(_0x57b9da,_0x4e5de7){_0x4e5de7=_0x4e5de7||0x1f4;return function(_0x12ef0b){logger[_0x7b7e('0x29')](_0x12ef0b['stack']);if(_0x12ef0b[_0x7b7e('0x2a')]){delete _0x12ef0b['name'];}_0x57b9da[_0x7b7e('0x1b')](_0x4e5de7)[_0x7b7e('0x2b')](_0x12ef0b);};}exports[_0x7b7e('0x2c')]=function(_0x5515ca,_0x3960b8){var _0xe31336={},_0x35602a={},_0x326dd2={'count':0x0,'rows':[]};var _0x33f9a1=_['map'](db[_0x7b7e('0x2d')]['rawAttributes'],function(_0x23a453){return{'name':_0x23a453[_0x7b7e('0x2e')],'type':_0x23a453[_0x7b7e('0x2f')][_0x7b7e('0x30')]};});_0x35602a[_0x7b7e('0x31')]=_[_0x7b7e('0x32')](_0x33f9a1,_0x7b7e('0x2a'));_0x35602a['query']=_['keys'](_0x5515ca[_0x7b7e('0x33')]);_0x35602a[_0x7b7e('0x34')]=_['intersection'](_0x35602a[_0x7b7e('0x31')],_0x35602a[_0x7b7e('0x33')]);_0xe31336[_0x7b7e('0x35')]=_['intersection'](_0x35602a[_0x7b7e('0x31')],qs[_0x7b7e('0x36')](_0x5515ca[_0x7b7e('0x33')][_0x7b7e('0x36')]));_0xe31336[_0x7b7e('0x35')]=_0xe31336[_0x7b7e('0x35')][_0x7b7e('0x37')]?_0xe31336[_0x7b7e('0x35')]:_0x35602a[_0x7b7e('0x31')];if(!_0x5515ca[_0x7b7e('0x33')][_0x7b7e('0x38')](_0x7b7e('0x39'))){_0xe31336[_0x7b7e('0x1f')]=qs[_0x7b7e('0x1f')](_0x5515ca[_0x7b7e('0x33')][_0x7b7e('0x1f')]);_0xe31336['offset']=qs[_0x7b7e('0x1d')](_0x5515ca[_0x7b7e('0x33')][_0x7b7e('0x1d')]);}_0xe31336[_0x7b7e('0x3a')]=qs[_0x7b7e('0x3b')](_0x5515ca[_0x7b7e('0x33')][_0x7b7e('0x3b')]);_0xe31336[_0x7b7e('0x3c')]=qs[_0x7b7e('0x34')](_[_0x7b7e('0x3d')](_0x5515ca['query'],_0x35602a[_0x7b7e('0x34')]),_0x33f9a1);if(_0x5515ca[_0x7b7e('0x33')][_0x7b7e('0x3e')]){_0xe31336[_0x7b7e('0x3c')]=_['merge'](_0xe31336[_0x7b7e('0x3c')],{'$or':_[_0x7b7e('0x32')](_0x33f9a1,function(_0x3d5280){if(_0x3d5280['type']!=='VIRTUAL'){var _0x22651e={};_0x22651e[_0x3d5280['name']]={'$like':'%'+_0x5515ca[_0x7b7e('0x33')][_0x7b7e('0x3e')]+'%'};return _0x22651e;}})});}_0xe31336=_['merge']({},_0xe31336,_0x5515ca[_0x7b7e('0x3f')]);var _0x2074d1={'where':_0xe31336[_0x7b7e('0x3c')]};return db[_0x7b7e('0x2d')][_0x7b7e('0x20')](_0x2074d1)[_0x7b7e('0x26')](function(_0xc888e4){_0x326dd2[_0x7b7e('0x20')]=_0xc888e4;if(_0x5515ca[_0x7b7e('0x33')]['includeAll']){_0xe31336['include']=[{'all':!![]}];}return db[_0x7b7e('0x2d')]['findAll'](_0xe31336);})[_0x7b7e('0x26')](function(_0x5e8b5d){_0x326dd2['rows']=_0x5e8b5d;return _0x326dd2;})[_0x7b7e('0x26')](respondWithFilteredResult(_0x3960b8,_0xe31336))['catch'](handleError(_0x3960b8,null));};exports[_0x7b7e('0x40')]=function(_0x52051c,_0xa8521d){var _0x3e58be={'raw':!![],'where':{'id':_0x52051c[_0x7b7e('0x41')]['id']}},_0x7ea84c={};_0x7ea84c['model']=_[_0x7b7e('0x42')](db[_0x7b7e('0x2d')][_0x7b7e('0x43')]);_0x7ea84c[_0x7b7e('0x33')]=_[_0x7b7e('0x42')](_0x52051c[_0x7b7e('0x33')]);_0x7ea84c['filters']=_['intersection'](_0x7ea84c['model'],_0x7ea84c[_0x7b7e('0x33')]);_0x3e58be[_0x7b7e('0x35')]=_[_0x7b7e('0x44')](_0x7ea84c[_0x7b7e('0x31')],qs[_0x7b7e('0x36')](_0x52051c[_0x7b7e('0x33')]['fields']));_0x3e58be[_0x7b7e('0x35')]=_0x3e58be[_0x7b7e('0x35')]['length']?_0x3e58be['attributes']:_0x7ea84c[_0x7b7e('0x31')];if(_0x52051c[_0x7b7e('0x33')][_0x7b7e('0x45')]){_0x3e58be[_0x7b7e('0x46')]=[{'all':!![]}];}_0x3e58be=_[_0x7b7e('0x47')]({},_0x3e58be,_0x52051c[_0x7b7e('0x3f')]);return db['VoiceMail'][_0x7b7e('0x48')](_0x3e58be)['then'](handleEntityNotFound(_0xa8521d,null))[_0x7b7e('0x26')](respondWithResult(_0xa8521d,null))[_0x7b7e('0x49')](handleError(_0xa8521d,null));};exports[_0x7b7e('0x4a')]=function(_0x5874e2,_0x58e4e6){return db[_0x7b7e('0x2d')][_0x7b7e('0x4a')](_0x5874e2[_0x7b7e('0x4b')],{})[_0x7b7e('0x26')](function(_0x1f9d0f){var _0x5cce7c=_0x5874e2[_0x7b7e('0x4c')][_0x7b7e('0x27')]({'plain':!![]});if(!_0x5cce7c)throw new Error(_0x7b7e('0x4d'));if(_0x5cce7c[_0x7b7e('0x4e')]===_0x7b7e('0x4c')){var _0x5a9697=_0x1f9d0f[_0x7b7e('0x27')]({'plain':!![]});var _0x29024e=_0x7b7e('0x4f');return db[_0x7b7e('0x50')][_0x7b7e('0x48')]({'where':{'name':_0x29024e,'userProfileId':_0x5cce7c[_0x7b7e('0x51')]},'raw':!![]})[_0x7b7e('0x26')](function(_0x4a7be0){if(_0x4a7be0&&_0x4a7be0[_0x7b7e('0x52')]===0x0){return db['UserProfileResource'][_0x7b7e('0x4a')]({'name':_0x5a9697[_0x7b7e('0x2a')],'resourceId':_0x5a9697['id'],'type':_0x4a7be0['name'],'sectionId':_0x4a7be0['id']},{})[_0x7b7e('0x26')](function(){return _0x1f9d0f;});}else{return _0x1f9d0f;}})[_0x7b7e('0x49')](function(_0x16c81d){logger[_0x7b7e('0x29')](_0x7b7e('0x53'),_0x16c81d);throw _0x16c81d;});}return _0x1f9d0f;})[_0x7b7e('0x26')](respondWithResult(_0x58e4e6,0xc9))[_0x7b7e('0x49')](handleError(_0x58e4e6,null));};exports['update']=function(_0xbf044d,_0x3ff731){if(_0xbf044d[_0x7b7e('0x4b')]['id']){delete _0xbf044d[_0x7b7e('0x4b')]['id'];}return db['VoiceMail']['find']({'where':{'id':_0xbf044d['params']['id']}})[_0x7b7e('0x26')](handleEntityNotFound(_0x3ff731,null))[_0x7b7e('0x26')](saveUpdates(_0xbf044d[_0x7b7e('0x4b')],null))['then'](respondWithResult(_0x3ff731,null))['catch'](handleError(_0x3ff731,null));};exports[_0x7b7e('0x28')]=function(_0x39efb5,_0x4fecf7){return db[_0x7b7e('0x2d')][_0x7b7e('0x48')]({'where':{'id':_0x39efb5[_0x7b7e('0x41')]['id']}})['then'](handleEntityNotFound(_0x4fecf7,null))[_0x7b7e('0x26')](removeEntity(_0x4fecf7,null))[_0x7b7e('0x49')](handleError(_0x4fecf7,null));};exports['getMessages']=function(_0x25c933,_0x441c3c,_0x1d7db1){return db[_0x7b7e('0x2d')][_0x7b7e('0x54')]({'where':{'id':_0x25c933[_0x7b7e('0x41')]['id']}})[_0x7b7e('0x26')](handleEntityNotFound(_0x441c3c,null))[_0x7b7e('0x26')](function(_0x45fff9){var _0x5509ad;var _0x29d0af={},_0x20108a={};_0x20108a['model']=_[_0x7b7e('0x42')](db[_0x7b7e('0x55')][_0x7b7e('0x43')]);_0x20108a['query']=_[_0x7b7e('0x42')](_0x25c933['query']);_0x20108a[_0x7b7e('0x34')]=_[_0x7b7e('0x44')](_0x20108a['model'],_0x20108a[_0x7b7e('0x33')]);_0x29d0af[_0x7b7e('0x35')]=_['intersection'](_0x20108a[_0x7b7e('0x31')],qs[_0x7b7e('0x36')](_0x25c933[_0x7b7e('0x33')][_0x7b7e('0x36')]));_0x29d0af['attributes']=_0x29d0af[_0x7b7e('0x35')][_0x7b7e('0x37')]?_0x29d0af[_0x7b7e('0x35')]:_0x20108a[_0x7b7e('0x31')];if(!_0x25c933[_0x7b7e('0x33')][_0x7b7e('0x38')](_0x7b7e('0x39'))){_0x29d0af[_0x7b7e('0x1f')]=qs[_0x7b7e('0x1f')](_0x25c933[_0x7b7e('0x33')]['limit']);_0x29d0af[_0x7b7e('0x1d')]=qs['offset'](_0x25c933['query'][_0x7b7e('0x1d')]);}_0x29d0af[_0x7b7e('0x3a')]=qs[_0x7b7e('0x3b')](_0x25c933[_0x7b7e('0x33')]['sort']);_0x29d0af[_0x7b7e('0x3c')]=qs[_0x7b7e('0x34')](_[_0x7b7e('0x3d')](_0x25c933[_0x7b7e('0x33')],_0x20108a[_0x7b7e('0x34')]));if(_0x25c933[_0x7b7e('0x33')]['filter']){_0x29d0af[_0x7b7e('0x3c')]=_['merge'](_0x29d0af['where'],{'$or':_[_0x7b7e('0x32')](_0x29d0af['attributes'],function(_0x47aa4c){var _0x4a2378={};_0x4a2378[_0x47aa4c]={'$like':'%'+_0x25c933[_0x7b7e('0x33')][_0x7b7e('0x3e')]+'%'};return _0x4a2378;})});}_0x29d0af['where']=_[_0x7b7e('0x47')](_0x29d0af[_0x7b7e('0x3c')],{'mailboxuser':_0x45fff9['mailbox']});_0x29d0af=_[_0x7b7e('0x47')]({},_0x29d0af,_0x25c933[_0x7b7e('0x3f')]);return db[_0x7b7e('0x55')][_0x7b7e('0x56')](_0x29d0af)[_0x7b7e('0x26')](respondWithFilteredResult(_0x441c3c,_0x29d0af));})[_0x7b7e('0x49')](handleError(_0x441c3c,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index 49185b5..d2f6d56 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 _0xe86b=['context','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMail.attributes','exports','define','VoiceMail','voice_voicemail','mailbox_context','mailbox'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xe86b,0x1c3));var _0xbe86=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xe86b[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0xbe86('0x0'));var util=require(_0xbe86('0x1'));var logger=require(_0xbe86('0x2'))(_0xbe86('0x3'));var moment=require(_0xbe86('0x4'));var BPromise=require(_0xbe86('0x5'));var rp=require(_0xbe86('0x6'));var fs=require('fs');var path=require(_0xbe86('0x7'));var rimraf=require(_0xbe86('0x8'));var config=require(_0xbe86('0x9'));var attributes=require(_0xbe86('0xa'));module[_0xbe86('0xb')]=function(_0x5b3750,_0x32feaf){return _0x5b3750[_0xbe86('0xc')](_0xbe86('0xd'),attributes,{'tableName':_0xbe86('0xe'),'paranoid':![],'indexes':[{'name':_0xbe86('0xf'),'fields':[_0xbe86('0x10'),_0xbe86('0x11')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x05c2=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','VoiceMail','voice_voicemail','mailbox','context'];(function(_0x34b3bb,_0x531597){var _0x430797=function(_0x3a1c6c){while(--_0x3a1c6c){_0x34b3bb['push'](_0x34b3bb['shift']());}};_0x430797(++_0x531597);}(_0x05c2,0x186));var _0x205c=function(_0x1dc985,_0x5914c3){_0x1dc985=_0x1dc985-0x0;var _0x30ebf6=_0x05c2[_0x1dc985];return _0x30ebf6;};'use strict';var _=require(_0x205c('0x0'));var util=require(_0x205c('0x1'));var logger=require(_0x205c('0x2'))(_0x205c('0x3'));var moment=require(_0x205c('0x4'));var BPromise=require(_0x205c('0x5'));var rp=require(_0x205c('0x6'));var fs=require('fs');var path=require(_0x205c('0x7'));var rimraf=require('rimraf');var config=require(_0x205c('0x8'));var attributes=require('./voiceMail.attributes');module['exports']=function(_0x2b6538,_0x510a03){return _0x2b6538['define'](_0x205c('0x9'),attributes,{'tableName':_0x205c('0xa'),'paranoid':![],'indexes':[{'name':'mailbox_context','fields':[_0x205c('0xb'),_0x205c('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index 7866bba..ad75817 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 _0x778b=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','then','info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util'];(function(_0x2e3a01,_0x2c2a2a){var _0x1115a9=function(_0x4f01f3){while(--_0x4f01f3){_0x2e3a01['push'](_0x2e3a01['shift']());}};_0x1115a9(++_0x2c2a2a);}(_0x778b,0x91));var _0xb778=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0x778b[_0xc6be3a];return _0x56a310;};'use strict';var _=require(_0xb778('0x0'));var util=require(_0xb778('0x1'));var moment=require(_0xb778('0x2'));var BPromise=require(_0xb778('0x3'));var rs=require(_0xb778('0x4'));var fs=require('fs');var Redis=require(_0xb778('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb778('0x6'));var logger=require(_0xb778('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xb778('0x8'));var client=jayson[_0xb778('0x9')][_0xb778('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4ec562,_0x234318,_0x5f5c71){return new BPromise(function(_0x5d4255,_0x1737fb){return client['request'](_0x4ec562,_0x5f5c71)[_0xb778('0xb')](function(_0x4ae591){logger[_0xb778('0xc')](_0xb778('0xd'),_0x234318,_0xb778('0xe'));logger[_0xb778('0xf')]('VoiceMail,\x20%s,\x20%s,\x20%s',_0x234318,_0xb778('0xe'),JSON[_0xb778('0x10')](_0x4ae591));if(_0x4ae591['error']){if(_0x4ae591[_0xb778('0x11')][_0xb778('0x12')]===0x1f4){logger[_0xb778('0x11')](_0xb778('0xd'),_0x234318,_0x4ae591['error'][_0xb778('0x13')]);return _0x1737fb(_0x4ae591[_0xb778('0x11')][_0xb778('0x13')]);}logger[_0xb778('0x11')](_0xb778('0xd'),_0x234318,_0x4ae591['error'][_0xb778('0x13')]);return _0x5d4255(_0x4ae591['error'][_0xb778('0x13')]);}else{logger['info'](_0xb778('0xd'),_0x234318,_0xb778('0xe'));_0x5d4255(_0x4ae591[_0xb778('0x14')][_0xb778('0x13')]);}})['catch'](function(_0x530ad7){logger['error'](_0xb778('0xd'),_0x234318,_0x530ad7);_0x1737fb(_0x530ad7);});});} \ No newline at end of file +var _0x59e9=['randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird'];(function(_0xb3b452,_0x582e8e){var _0x238983=function(_0x3bc866){while(--_0x3bc866){_0xb3b452['push'](_0xb3b452['shift']());}};_0x238983(++_0x582e8e);}(_0x59e9,0x9e));var _0x959e=function(_0x1a5c1f,_0x5e8b15){_0x1a5c1f=_0x1a5c1f-0x0;var _0x3da623=_0x59e9[_0x1a5c1f];return _0x3da623;};'use strict';var _=require(_0x959e('0x0'));var util=require('util');var moment=require(_0x959e('0x1'));var BPromise=require(_0x959e('0x2'));var rs=require(_0x959e('0x3'));var fs=require('fs');var Redis=require(_0x959e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x959e('0x5'));var logger=require(_0x959e('0x6'))(_0x959e('0x7'));var config=require(_0x959e('0x8'));var jayson=require(_0x959e('0x9'));var client=jayson['client'][_0x959e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x278f23,_0x167757,_0x18d451){return new BPromise(function(_0x189b1f,_0x94cb7a){return client[_0x959e('0xb')](_0x278f23,_0x18d451)[_0x959e('0xc')](function(_0x48b096){logger['info'](_0x959e('0xd'),_0x167757,_0x959e('0xe'));logger[_0x959e('0xf')](_0x959e('0x10'),_0x167757,_0x959e('0xe'),JSON[_0x959e('0x11')](_0x48b096));if(_0x48b096['error']){if(_0x48b096[_0x959e('0x12')][_0x959e('0x13')]===0x1f4){logger[_0x959e('0x12')](_0x959e('0xd'),_0x167757,_0x48b096[_0x959e('0x12')][_0x959e('0x14')]);return _0x94cb7a(_0x48b096[_0x959e('0x12')]['message']);}logger[_0x959e('0x12')]('VoiceMail,\x20%s,\x20%s',_0x167757,_0x48b096['error']['message']);return _0x189b1f(_0x48b096[_0x959e('0x12')][_0x959e('0x14')]);}else{logger['info'](_0x959e('0xd'),_0x167757,_0x959e('0xe'));_0x189b1f(_0x48b096[_0x959e('0x15')][_0x959e('0x14')]);}})[_0x959e('0x16')](function(_0x11acc1){logger[_0x959e('0x12')](_0x959e('0xd'),_0x167757,_0x11acc1);_0x94cb7a(_0x11acc1);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index 7696c04..710b9a0 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 _0xff79=['/:id/download','download','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id'];(function(_0x20913a,_0x43e4f1){var _0x179f06=function(_0x107e3f){while(--_0x107e3f){_0x20913a['push'](_0x20913a['shift']());}};_0x179f06(++_0x43e4f1);}(_0xff79,0x143));var _0x9ff7=function(_0x5c2a33,_0x355731){_0x5c2a33=_0x5c2a33-0x0;var _0x4ebd63=_0xff79[_0x5c2a33];return _0x4ebd63;};'use strict';var multer=require(_0x9ff7('0x0'));var util=require(_0x9ff7('0x1'));var path=require(_0x9ff7('0x2'));var timeout=require(_0x9ff7('0x3'));var express=require(_0x9ff7('0x4'));var router=express[_0x9ff7('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x9ff7('0x6'));var interaction=require(_0x9ff7('0x7'));var config=require(_0x9ff7('0x8'));var controller=require('./voiceMailMessage.controller');router['get']('/',auth[_0x9ff7('0x9')](),controller[_0x9ff7('0xa')]);router[_0x9ff7('0xb')](_0x9ff7('0xc'),auth[_0x9ff7('0x9')](),controller['show']);router[_0x9ff7('0xb')](_0x9ff7('0xd'),auth[_0x9ff7('0x9')](),controller[_0x9ff7('0xe')]);router[_0x9ff7('0xf')]('/',auth[_0x9ff7('0x9')](),controller[_0x9ff7('0x10')]);router[_0x9ff7('0x11')](_0x9ff7('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x9ff7('0x12')](_0x9ff7('0xc'),auth[_0x9ff7('0x9')](),controller[_0x9ff7('0x13')]);module[_0x9ff7('0x14')]=router; \ No newline at end of file +var _0x4380=['../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','download','post','create','put','delete','destroy','multer','util','path','connect-timeout','fs-extra'];(function(_0x1ea538,_0x3030f0){var _0x127e1d=function(_0x3ccbe9){while(--_0x3ccbe9){_0x1ea538['push'](_0x1ea538['shift']());}};_0x127e1d(++_0x3030f0);}(_0x4380,0x67));var _0x0438=function(_0x5e9aca,_0x1bfeeb){_0x5e9aca=_0x5e9aca-0x0;var _0x22b7c2=_0x4380[_0x5e9aca];return _0x22b7c2;};'use strict';var multer=require(_0x0438('0x0'));var util=require(_0x0438('0x1'));var path=require(_0x0438('0x2'));var timeout=require(_0x0438('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x0438('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x0438('0x5'));var config=require(_0x0438('0x6'));var controller=require('./voiceMailMessage.controller');router[_0x0438('0x7')]('/',auth['isAuthenticated'](),controller[_0x0438('0x8')]);router[_0x0438('0x7')](_0x0438('0x9'),auth[_0x0438('0xa')](),controller[_0x0438('0xb')]);router['get']('/:id/download',auth[_0x0438('0xa')](),controller[_0x0438('0xc')]);router[_0x0438('0xd')]('/',auth[_0x0438('0xa')](),controller[_0x0438('0xe')]);router[_0x0438('0xf')](_0x0438('0x9'),auth[_0x0438('0xa')](),controller['update']);router[_0x0438('0x10')](_0x0438('0x9'),auth[_0x0438('0xa')](),controller[_0x0438('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index 071105d..9f0eb50 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 _0xe6c8=['long','TIMESTAMP','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','VIRTUAL','getDataValue','INTEGER','STRING','BLOB'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe6c8,0x1ea));var _0x8e6c=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xe6c8[_0x24237f];return _0x48298e;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x8e6c('0x0')],'get':function(_0x5c6931){return this[_0x8e6c('0x1')]('id');}},'msgnum':{'type':Sequelize[_0x8e6c('0x2')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize['STRING'],'defaultValue':''},'context':{'type':Sequelize[_0x8e6c('0x3')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x8e6c('0x3')],'defaultValue':''},'callerid':{'type':Sequelize[_0x8e6c('0x3')],'defaultValue':''},'origtime':{'type':Sequelize[_0x8e6c('0x3')],'defaultValue':''},'duration':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x8e6c('0x3')],'defaultValue':''},'mailboxcontext':{'type':Sequelize['STRING'],'defaultValue':''},'recording':{'type':Sequelize[_0x8e6c('0x4')](_0x8e6c('0x5')),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize[_0x8e6c('0x3')],'defaultValue':''},'stamp':{'type':_0x8e6c('0x6'),'defaultValue':Sequelize[_0x8e6c('0x7')](_0x8e6c('0x8'))}}; \ No newline at end of file +var _0x306b=['literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','exports','VIRTUAL','getDataValue','INTEGER','STRING','BLOB','long'];(function(_0xb3a2c0,_0x3ed55f){var _0x5d90c2=function(_0x71a1ca){while(--_0x71a1ca){_0xb3a2c0['push'](_0xb3a2c0['shift']());}};_0x5d90c2(++_0x3ed55f);}(_0x306b,0x84));var _0xb306=function(_0x329c16,_0x23a5e1){_0x329c16=_0x329c16-0x0;var _0x54d505=_0x306b[_0x329c16];return _0x54d505;};'use strict';var Sequelize=require(_0xb306('0x0'));module[_0xb306('0x1')]={'name':{'type':Sequelize[_0xb306('0x2')],'get':function(_0x9d55dd){return this[_0xb306('0x3')]('id');}},'msgnum':{'type':Sequelize[_0xb306('0x4')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0xb306('0x5')],'defaultValue':''},'context':{'type':Sequelize['STRING'],'defaultValue':''},'macrocontext':{'type':Sequelize['STRING'],'defaultValue':''},'callerid':{'type':Sequelize[_0xb306('0x5')],'defaultValue':''},'origtime':{'type':Sequelize[_0xb306('0x5')],'defaultValue':''},'duration':{'type':Sequelize[_0xb306('0x5')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0xb306('0x5')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xb306('0x5')],'defaultValue':''},'recording':{'type':Sequelize[_0xb306('0x6')](_0xb306('0x7')),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize[_0xb306('0x5')],'defaultValue':''},'stamp':{'type':'TIMESTAMP','defaultValue':Sequelize[_0xb306('0x8')](_0xb306('0x9'))}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index 243871f..e2a959e 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 _0xedf2=['find','create','body','download','recording','Sequelize','VoiceMailMessage\x20not\x20found','audio/wav','attachment','msg_id','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','set','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','Content-Range','json','save','update','then','destroy','stack','name','send','index','map','VoiceMailMessage','rawAttributes','type','key','model','differenceBy','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','include','findAll','rows','catch','params','includeAll','options'];(function(_0x4e9274,_0x49576e){var _0x8b474c=function(_0x204cca){while(--_0x204cca){_0x4e9274['push'](_0x4e9274['shift']());}};_0x8b474c(++_0x49576e);}(_0xedf2,0x10d));var _0x2edf=function(_0x55bfce,_0x2578d4){_0x55bfce=_0x55bfce-0x0;var _0x4b15ea=_0xedf2[_0x55bfce];return _0x4b15ea;};'use strict';var emlformat=require(_0x2edf('0x0'));var rimraf=require(_0x2edf('0x1'));var zipdir=require(_0x2edf('0x2'));var jsonpatch=require(_0x2edf('0x3'));var rp=require(_0x2edf('0x4'));var moment=require(_0x2edf('0x5'));var BPromise=require(_0x2edf('0x6'));var Mustache=require(_0x2edf('0x7'));var util=require(_0x2edf('0x8'));var path=require(_0x2edf('0x9'));var sox=require(_0x2edf('0xa'));var csv=require(_0x2edf('0xb'));var ejs=require(_0x2edf('0xc'));var fs=require('fs');var fs_extra=require(_0x2edf('0xd'));var _=require('lodash');var squel=require(_0x2edf('0xe'));var crypto=require('crypto');var jsforce=require(_0x2edf('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x2edf('0xb'));var querystring=require('querystring');var Papa=require(_0x2edf('0x10'));var Redis=require(_0x2edf('0x11'));var authService=require(_0x2edf('0x12'));var qs=require(_0x2edf('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2edf('0x14'));var logger=require(_0x2edf('0x15'))(_0x2edf('0x16'));var utils=require(_0x2edf('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x2edf('0x18'));var db=require(_0x2edf('0x19'))['db'];function respondWithStatusCode(_0x58b1d4,_0x2d7789){_0x2d7789=_0x2d7789||0xcc;return function(_0x20b671){if(_0x20b671){return _0x58b1d4[_0x2edf('0x1a')](_0x2d7789);}return _0x58b1d4[_0x2edf('0x1b')](_0x2d7789)[_0x2edf('0x1c')]();};}function respondWithResult(_0x3534cc,_0xec05ef){_0xec05ef=_0xec05ef||0xc8;return function(_0xd60f38){if(_0xd60f38){return _0x3534cc[_0x2edf('0x1b')](_0xec05ef)['json'](_0xd60f38);}};}function respondWithFilteredResult(_0x49c582,_0x49b25d){return function(_0x46e548){if(_0x46e548){var _0x10e8bc=typeof _0x49b25d['offset']===_0x2edf('0x1d')&&typeof _0x49b25d[_0x2edf('0x1e')]===_0x2edf('0x1d');var _0x142944=_0x46e548[_0x2edf('0x1f')];var _0x16a015=_0x10e8bc?0x0:_0x49b25d[_0x2edf('0x20')];var _0x178ad9=_0x10e8bc?_0x46e548[_0x2edf('0x1f')]:_0x49b25d[_0x2edf('0x20')]+_0x49b25d[_0x2edf('0x1e')];var _0x2434f8;if(_0x178ad9>=_0x142944){_0x178ad9=_0x142944;_0x2434f8=0xc8;}else{_0x2434f8=0xce;}_0x49c582[_0x2edf('0x1b')](_0x2434f8);return _0x49c582['set'](_0x2edf('0x21'),_0x16a015+'-'+_0x178ad9+'/'+_0x142944)[_0x2edf('0x22')](_0x46e548);}return null;};}function patchUpdates(_0x186252){return function(_0x350e73){try{jsonpatch['apply'](_0x350e73,_0x186252,!![]);}catch(_0x2819a1){return BPromise['reject'](_0x2819a1);}return _0x350e73[_0x2edf('0x23')]();};}function saveUpdates(_0x5a540d,_0x3aa141){return function(_0x216481){if(_0x216481){return _0x216481[_0x2edf('0x24')](_0x5a540d)[_0x2edf('0x25')](function(_0x4d73aa){return _0x4d73aa;});}return null;};}function removeEntity(_0x1a95e2,_0x4dbafd){return function(_0x1e37ed){if(_0x1e37ed){return _0x1e37ed[_0x2edf('0x26')]()[_0x2edf('0x25')](function(){_0x1a95e2[_0x2edf('0x1b')](0xcc)[_0x2edf('0x1c')]();});}};}function handleEntityNotFound(_0xe693db,_0x42dcdb){return function(_0x266888){if(!_0x266888){_0xe693db[_0x2edf('0x1a')](0x194);}return _0x266888;};}function handleError(_0x2f1532,_0x16524){_0x16524=_0x16524||0x1f4;return function(_0x512558){logger['error'](_0x512558[_0x2edf('0x27')]);if(_0x512558[_0x2edf('0x28')]){delete _0x512558['name'];}_0x2f1532[_0x2edf('0x1b')](_0x16524)[_0x2edf('0x29')](_0x512558);};}exports[_0x2edf('0x2a')]=function(_0x1cb383,_0x4e1173){var _0x5b5206={},_0x585f28={},_0x5f1ae3={'count':0x0,'rows':[]};var _0x153508=_[_0x2edf('0x2b')](db[_0x2edf('0x2c')][_0x2edf('0x2d')],function(_0x43e026){return{'name':_0x43e026['fieldName'],'type':_0x43e026[_0x2edf('0x2e')][_0x2edf('0x2f')]};});_0x585f28[_0x2edf('0x30')]=_[_0x2edf('0x31')](_[_0x2edf('0x2b')](_0x153508,'name'),[_0x2edf('0x28')]);_0x585f28[_0x2edf('0x32')]=_[_0x2edf('0x33')](_0x1cb383['query']);_0x585f28['filters']=_[_0x2edf('0x34')](_0x585f28[_0x2edf('0x30')],_0x585f28[_0x2edf('0x32')]);_0x5b5206[_0x2edf('0x35')]=_['intersection'](_0x585f28[_0x2edf('0x30')],qs[_0x2edf('0x36')](_0x1cb383['query'][_0x2edf('0x36')]));_0x5b5206[_0x2edf('0x35')]=_0x5b5206[_0x2edf('0x35')][_0x2edf('0x37')]?_0x5b5206[_0x2edf('0x35')]:_0x585f28[_0x2edf('0x30')];if(!_0x1cb383[_0x2edf('0x32')][_0x2edf('0x38')](_0x2edf('0x39'))){_0x5b5206[_0x2edf('0x1e')]=qs[_0x2edf('0x1e')](_0x1cb383[_0x2edf('0x32')][_0x2edf('0x1e')]);_0x5b5206['offset']=qs[_0x2edf('0x20')](_0x1cb383[_0x2edf('0x32')]['offset']);}_0x5b5206[_0x2edf('0x3a')]=qs[_0x2edf('0x3b')](_0x1cb383[_0x2edf('0x32')][_0x2edf('0x3b')]);_0x5b5206[_0x2edf('0x3c')]=qs[_0x2edf('0x3d')](_['pick'](_0x1cb383[_0x2edf('0x32')],_0x585f28[_0x2edf('0x3d')]),_0x153508);if(_0x1cb383[_0x2edf('0x32')][_0x2edf('0x3e')]){_0x5b5206['where']=_[_0x2edf('0x3f')](_0x5b5206['where'],{'$or':_['map'](_0x153508,function(_0x1104ff){if(_0x1104ff['type']!=='VIRTUAL'){var _0x332482={};_0x332482[_0x1104ff[_0x2edf('0x28')]]={'$like':'%'+_0x1cb383[_0x2edf('0x32')][_0x2edf('0x3e')]+'%'};return _0x332482;}})});}_0x5b5206=_[_0x2edf('0x3f')]({},_0x5b5206,_0x1cb383['options']);var _0x26bf00={'where':_0x5b5206['where']};return db[_0x2edf('0x2c')][_0x2edf('0x1f')](_0x26bf00)[_0x2edf('0x25')](function(_0x1e7271){_0x5f1ae3['count']=_0x1e7271;if(_0x1cb383[_0x2edf('0x32')]['includeAll']){_0x5b5206[_0x2edf('0x40')]=[{'all':!![]}];}return db[_0x2edf('0x2c')][_0x2edf('0x41')](_0x5b5206);})['then'](function(_0x54150b){_0x5f1ae3[_0x2edf('0x42')]=_0x54150b;return _0x5f1ae3;})['then'](respondWithFilteredResult(_0x4e1173,_0x5b5206))[_0x2edf('0x43')](handleError(_0x4e1173,null));};exports['show']=function(_0x8b5589,_0x512723){var _0x5984aa={'raw':!![],'where':{'id':_0x8b5589[_0x2edf('0x44')]['id']}},_0x544054={};_0x544054[_0x2edf('0x30')]=_[_0x2edf('0x33')](db[_0x2edf('0x2c')][_0x2edf('0x2d')]);_0x544054[_0x2edf('0x32')]=_[_0x2edf('0x33')](_0x8b5589[_0x2edf('0x32')]);_0x544054[_0x2edf('0x3d')]=_[_0x2edf('0x34')](_0x544054[_0x2edf('0x30')],_0x544054['query']);_0x5984aa[_0x2edf('0x35')]=_[_0x2edf('0x34')](_0x544054[_0x2edf('0x30')],qs['fields'](_0x8b5589[_0x2edf('0x32')][_0x2edf('0x36')]));_0x5984aa[_0x2edf('0x35')]=_0x5984aa[_0x2edf('0x35')][_0x2edf('0x37')]?_0x5984aa['attributes']:_0x544054[_0x2edf('0x30')];if(_0x8b5589[_0x2edf('0x32')][_0x2edf('0x45')]){_0x5984aa[_0x2edf('0x40')]=[{'all':!![]}];}_0x5984aa=_['merge']({},_0x5984aa,_0x8b5589[_0x2edf('0x46')]);return db['VoiceMailMessage'][_0x2edf('0x47')](_0x5984aa)[_0x2edf('0x25')](handleEntityNotFound(_0x512723,null))[_0x2edf('0x25')](respondWithResult(_0x512723,null))[_0x2edf('0x43')](handleError(_0x512723,null));};exports[_0x2edf('0x48')]=function(_0x195315,_0x2dbf41){return db[_0x2edf('0x2c')][_0x2edf('0x48')](_0x195315[_0x2edf('0x49')],{})[_0x2edf('0x25')](respondWithResult(_0x2dbf41,0xc9))[_0x2edf('0x43')](handleError(_0x2dbf41,null));};exports[_0x2edf('0x24')]=function(_0x110f13,_0x5a81ab){if(_0x110f13[_0x2edf('0x49')]['id']){delete _0x110f13[_0x2edf('0x49')]['id'];}return db[_0x2edf('0x2c')]['find']({'where':{'id':_0x110f13['params']['id']}})['then'](handleEntityNotFound(_0x5a81ab,null))['then'](saveUpdates(_0x110f13['body'],null))[_0x2edf('0x25')](respondWithResult(_0x5a81ab,null))[_0x2edf('0x43')](handleError(_0x5a81ab,null));};exports[_0x2edf('0x26')]=function(_0x3ce646,_0x1877bf){return db['VoiceMailMessage'][_0x2edf('0x47')]({'where':{'id':_0x3ce646['params']['id']}})['then'](handleEntityNotFound(_0x1877bf,null))[_0x2edf('0x25')](removeEntity(_0x1877bf,null))['catch'](handleError(_0x1877bf,null));};exports[_0x2edf('0x4a')]=function(_0x395df1,_0x460e8c,_0x3ed026){return db[_0x2edf('0x2c')][_0x2edf('0x47')]({'where':{'id':_0x395df1[_0x2edf('0x44')]['id']},'attributes':['id','recording','msg_id']})['then'](handleEntityNotFound(_0x460e8c,null))[_0x2edf('0x25')](function(_0x17f72f){if(_0x17f72f){if(!_0x17f72f[_0x2edf('0x4b')]){throw new db[(_0x2edf('0x4c'))]['ValidationError'](_0x2edf('0x4d'));}var _0x494d1d={'Content-Type':_0x2edf('0x4e'),'Content-Disposition':_0x2edf('0x4f')};if(_0x17f72f[_0x2edf('0x50')]){_0x494d1d[_0x2edf('0x51')]=_0x2edf('0x52')+_0x17f72f[_0x2edf('0x50')]+_0x2edf('0x53');}_0x460e8c[_0x2edf('0x54')](_0x494d1d);return _0x460e8c[_0x2edf('0x29')](new Buffer(_0x17f72f[_0x2edf('0x4b')]));}})[_0x2edf('0x43')](handleError(_0x460e8c,null));}; \ No newline at end of file +var _0x0d76=['../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','VoiceMailMessage','fieldName','key','model','differenceBy','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','type','options','includeAll','include','rows','catch','show','params','rawAttributes','length','find','create','body','download','recording','msg_id','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','rimraf','fast-json-patch','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x1c443a,_0xecb71b){var _0x55a347=function(_0x349634){while(--_0x349634){_0x1c443a['push'](_0x1c443a['shift']());}};_0x55a347(++_0xecb71b);}(_0x0d76,0x96));var _0x60d7=function(_0x31379c,_0x52f29f){_0x31379c=_0x31379c-0x0;var _0x2ff709=_0x0d76[_0x31379c];return _0x2ff709;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x60d7('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x60d7('0x1'));var rp=require('request-promise');var moment=require(_0x60d7('0x2'));var BPromise=require(_0x60d7('0x3'));var Mustache=require(_0x60d7('0x4'));var util=require('util');var path=require(_0x60d7('0x5'));var sox=require('sox');var csv=require(_0x60d7('0x6'));var ejs=require(_0x60d7('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x60d7('0x8'));var squel=require(_0x60d7('0x9'));var crypto=require(_0x60d7('0xa'));var jsforce=require(_0x60d7('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x60d7('0xc'));var Papa=require(_0x60d7('0xd'));var Redis=require(_0x60d7('0xe'));var authService=require(_0x60d7('0xf'));var qs=require(_0x60d7('0x10'));var as=require(_0x60d7('0x11'));var hardwareService=require(_0x60d7('0x12'));var logger=require(_0x60d7('0x13'))('api');var utils=require(_0x60d7('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x60d7('0x15'));var db=require(_0x60d7('0x16'))['db'];function respondWithStatusCode(_0x36958c,_0x1b6ac4){_0x1b6ac4=_0x1b6ac4||0xcc;return function(_0x2fc272){if(_0x2fc272){return _0x36958c[_0x60d7('0x17')](_0x1b6ac4);}return _0x36958c['status'](_0x1b6ac4)[_0x60d7('0x18')]();};}function respondWithResult(_0x111838,_0x100002){_0x100002=_0x100002||0xc8;return function(_0x104c31){if(_0x104c31){return _0x111838[_0x60d7('0x19')](_0x100002)[_0x60d7('0x1a')](_0x104c31);}};}function respondWithFilteredResult(_0x41b76f,_0x579a51){return function(_0x3b5705){if(_0x3b5705){var _0x16d99d=typeof _0x579a51[_0x60d7('0x1b')]===_0x60d7('0x1c')&&typeof _0x579a51[_0x60d7('0x1d')]===_0x60d7('0x1c');var _0x36068f=_0x3b5705[_0x60d7('0x1e')];var _0x9f541f=_0x16d99d?0x0:_0x579a51['offset'];var _0x2533fd=_0x16d99d?_0x3b5705[_0x60d7('0x1e')]:_0x579a51[_0x60d7('0x1b')]+_0x579a51['limit'];var _0x56594c;if(_0x2533fd>=_0x36068f){_0x2533fd=_0x36068f;_0x56594c=0xc8;}else{_0x56594c=0xce;}_0x41b76f[_0x60d7('0x19')](_0x56594c);return _0x41b76f[_0x60d7('0x1f')](_0x60d7('0x20'),_0x9f541f+'-'+_0x2533fd+'/'+_0x36068f)['json'](_0x3b5705);}return null;};}function patchUpdates(_0x32346a){return function(_0x52321f){try{jsonpatch[_0x60d7('0x21')](_0x52321f,_0x32346a,!![]);}catch(_0x4f0dcd){return BPromise[_0x60d7('0x22')](_0x4f0dcd);}return _0x52321f['save']();};}function saveUpdates(_0x500696,_0x6da0eb){return function(_0x43d34d){if(_0x43d34d){return _0x43d34d[_0x60d7('0x23')](_0x500696)[_0x60d7('0x24')](function(_0x4fa3de){return _0x4fa3de;});}return null;};}function removeEntity(_0x461b59,_0x1bc91e){return function(_0x520af2){if(_0x520af2){return _0x520af2[_0x60d7('0x25')]()['then'](function(){_0x461b59[_0x60d7('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0xd2ee26,_0x5405a0){return function(_0x34cf79){if(!_0x34cf79){_0xd2ee26[_0x60d7('0x17')](0x194);}return _0x34cf79;};}function handleError(_0x4b8fc0,_0xc60209){_0xc60209=_0xc60209||0x1f4;return function(_0x1ab0f0){logger[_0x60d7('0x26')](_0x1ab0f0[_0x60d7('0x27')]);if(_0x1ab0f0[_0x60d7('0x28')]){delete _0x1ab0f0[_0x60d7('0x28')];}_0x4b8fc0[_0x60d7('0x19')](_0xc60209)[_0x60d7('0x29')](_0x1ab0f0);};}exports[_0x60d7('0x2a')]=function(_0x36a144,_0x2239f7){var _0x34b5e3={},_0x2884b6={},_0x977e7e={'count':0x0,'rows':[]};var _0x2ae39d=_['map'](db[_0x60d7('0x2b')]['rawAttributes'],function(_0x58e48d){return{'name':_0x58e48d[_0x60d7('0x2c')],'type':_0x58e48d['type'][_0x60d7('0x2d')]};});_0x2884b6[_0x60d7('0x2e')]=_[_0x60d7('0x2f')](_[_0x60d7('0x30')](_0x2ae39d,_0x60d7('0x28')),['name']);_0x2884b6[_0x60d7('0x31')]=_[_0x60d7('0x32')](_0x36a144[_0x60d7('0x31')]);_0x2884b6[_0x60d7('0x33')]=_[_0x60d7('0x34')](_0x2884b6['model'],_0x2884b6[_0x60d7('0x31')]);_0x34b5e3[_0x60d7('0x35')]=_['intersection'](_0x2884b6[_0x60d7('0x2e')],qs[_0x60d7('0x36')](_0x36a144['query'][_0x60d7('0x36')]));_0x34b5e3['attributes']=_0x34b5e3[_0x60d7('0x35')]['length']?_0x34b5e3[_0x60d7('0x35')]:_0x2884b6[_0x60d7('0x2e')];if(!_0x36a144['query'][_0x60d7('0x37')]('nolimit')){_0x34b5e3[_0x60d7('0x1d')]=qs[_0x60d7('0x1d')](_0x36a144[_0x60d7('0x31')]['limit']);_0x34b5e3[_0x60d7('0x1b')]=qs[_0x60d7('0x1b')](_0x36a144['query'][_0x60d7('0x1b')]);}_0x34b5e3[_0x60d7('0x38')]=qs[_0x60d7('0x39')](_0x36a144['query']['sort']);_0x34b5e3[_0x60d7('0x3a')]=qs[_0x60d7('0x33')](_[_0x60d7('0x3b')](_0x36a144['query'],_0x2884b6[_0x60d7('0x33')]),_0x2ae39d);if(_0x36a144[_0x60d7('0x31')][_0x60d7('0x3c')]){_0x34b5e3[_0x60d7('0x3a')]=_[_0x60d7('0x3d')](_0x34b5e3['where'],{'$or':_[_0x60d7('0x30')](_0x2ae39d,function(_0x28a21f){if(_0x28a21f[_0x60d7('0x3e')]!=='VIRTUAL'){var _0x44e2c4={};_0x44e2c4[_0x28a21f[_0x60d7('0x28')]]={'$like':'%'+_0x36a144[_0x60d7('0x31')][_0x60d7('0x3c')]+'%'};return _0x44e2c4;}})});}_0x34b5e3=_[_0x60d7('0x3d')]({},_0x34b5e3,_0x36a144[_0x60d7('0x3f')]);var _0x3fb10b={'where':_0x34b5e3['where']};return db[_0x60d7('0x2b')][_0x60d7('0x1e')](_0x3fb10b)[_0x60d7('0x24')](function(_0x1fecbc){_0x977e7e['count']=_0x1fecbc;if(_0x36a144[_0x60d7('0x31')][_0x60d7('0x40')]){_0x34b5e3[_0x60d7('0x41')]=[{'all':!![]}];}return db[_0x60d7('0x2b')]['findAll'](_0x34b5e3);})[_0x60d7('0x24')](function(_0x10a77a){_0x977e7e[_0x60d7('0x42')]=_0x10a77a;return _0x977e7e;})[_0x60d7('0x24')](respondWithFilteredResult(_0x2239f7,_0x34b5e3))[_0x60d7('0x43')](handleError(_0x2239f7,null));};exports[_0x60d7('0x44')]=function(_0x4a131e,_0x95f328){var _0x42ccaa={'raw':!![],'where':{'id':_0x4a131e[_0x60d7('0x45')]['id']}},_0x1988d1={};_0x1988d1[_0x60d7('0x2e')]=_['keys'](db[_0x60d7('0x2b')][_0x60d7('0x46')]);_0x1988d1[_0x60d7('0x31')]=_['keys'](_0x4a131e[_0x60d7('0x31')]);_0x1988d1['filters']=_['intersection'](_0x1988d1['model'],_0x1988d1[_0x60d7('0x31')]);_0x42ccaa[_0x60d7('0x35')]=_[_0x60d7('0x34')](_0x1988d1[_0x60d7('0x2e')],qs[_0x60d7('0x36')](_0x4a131e[_0x60d7('0x31')][_0x60d7('0x36')]));_0x42ccaa[_0x60d7('0x35')]=_0x42ccaa[_0x60d7('0x35')][_0x60d7('0x47')]?_0x42ccaa[_0x60d7('0x35')]:_0x1988d1['model'];if(_0x4a131e[_0x60d7('0x31')][_0x60d7('0x40')]){_0x42ccaa[_0x60d7('0x41')]=[{'all':!![]}];}_0x42ccaa=_[_0x60d7('0x3d')]({},_0x42ccaa,_0x4a131e[_0x60d7('0x3f')]);return db['VoiceMailMessage'][_0x60d7('0x48')](_0x42ccaa)['then'](handleEntityNotFound(_0x95f328,null))[_0x60d7('0x24')](respondWithResult(_0x95f328,null))[_0x60d7('0x43')](handleError(_0x95f328,null));};exports[_0x60d7('0x49')]=function(_0x1da9a2,_0x4b6ac1){return db['VoiceMailMessage'][_0x60d7('0x49')](_0x1da9a2[_0x60d7('0x4a')],{})['then'](respondWithResult(_0x4b6ac1,0xc9))[_0x60d7('0x43')](handleError(_0x4b6ac1,null));};exports[_0x60d7('0x23')]=function(_0x460fba,_0x4f3ce9){if(_0x460fba['body']['id']){delete _0x460fba['body']['id'];}return db[_0x60d7('0x2b')]['find']({'where':{'id':_0x460fba['params']['id']}})[_0x60d7('0x24')](handleEntityNotFound(_0x4f3ce9,null))['then'](saveUpdates(_0x460fba['body'],null))['then'](respondWithResult(_0x4f3ce9,null))[_0x60d7('0x43')](handleError(_0x4f3ce9,null));};exports[_0x60d7('0x25')]=function(_0x54b86c,_0x5f2bc0){return db[_0x60d7('0x2b')][_0x60d7('0x48')]({'where':{'id':_0x54b86c[_0x60d7('0x45')]['id']}})[_0x60d7('0x24')](handleEntityNotFound(_0x5f2bc0,null))[_0x60d7('0x24')](removeEntity(_0x5f2bc0,null))[_0x60d7('0x43')](handleError(_0x5f2bc0,null));};exports[_0x60d7('0x4b')]=function(_0x5141cd,_0x565ae3,_0x549736){return db['VoiceMailMessage'][_0x60d7('0x48')]({'where':{'id':_0x5141cd['params']['id']},'attributes':['id',_0x60d7('0x4c'),_0x60d7('0x4d')]})[_0x60d7('0x24')](handleEntityNotFound(_0x565ae3,null))[_0x60d7('0x24')](function(_0x45b79c){if(_0x45b79c){if(!_0x45b79c[_0x60d7('0x4c')]){throw new db['Sequelize'][(_0x60d7('0x4e'))](_0x60d7('0x4f'));}var _0x2d493d={'Content-Type':_0x60d7('0x50'),'Content-Disposition':_0x60d7('0x51')};if(_0x45b79c[_0x60d7('0x4d')]){_0x2d493d[_0x60d7('0x52')]=_0x60d7('0x53')+_0x45b79c['msg_id']+_0x60d7('0x54');}_0x565ae3['set'](_0x2d493d);return _0x565ae3['send'](new Buffer(_0x45b79c[_0x60d7('0x4c')]));}})[_0x60d7('0x43')](handleError(_0x565ae3,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index 1149b84..94f3e28 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 _0x5c11=['request-promise','path','rimraf','./voiceMailMessage.attributes','exports','define','VoiceMailMessage','dir','util','../../config/logger','api','moment','bluebird'];(function(_0x5ba87c,_0x3cce02){var _0x1ddb7e=function(_0x3e196c){while(--_0x3e196c){_0x5ba87c['push'](_0x5ba87c['shift']());}};_0x1ddb7e(++_0x3cce02);}(_0x5c11,0xb1));var _0x15c1=function(_0x8036e9,_0xb2a199){_0x8036e9=_0x8036e9-0x0;var _0x34a8eb=_0x5c11[_0x8036e9];return _0x34a8eb;};'use strict';var _=require('lodash');var util=require(_0x15c1('0x0'));var logger=require(_0x15c1('0x1'))(_0x15c1('0x2'));var moment=require(_0x15c1('0x3'));var BPromise=require(_0x15c1('0x4'));var rp=require(_0x15c1('0x5'));var fs=require('fs');var path=require(_0x15c1('0x6'));var rimraf=require(_0x15c1('0x7'));var config=require('../../config/environment');var attributes=require(_0x15c1('0x8'));module[_0x15c1('0x9')]=function(_0xa98fdb,_0x356e58){return _0xa98fdb[_0x15c1('0xa')](_0x15c1('0xb'),attributes,{'tableName':'voice_voicemail_messages','paranoid':![],'indexes':[{'name':_0x15c1('0xc'),'fields':['dir']}],'timestamps':![]});}; \ No newline at end of file +var _0x9c15=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceMailMessage.attributes','define','voice_voicemail_messages','dir','lodash'];(function(_0x4b6042,_0x33edf2){var _0x25bb10=function(_0x243c2c){while(--_0x243c2c){_0x4b6042['push'](_0x4b6042['shift']());}};_0x25bb10(++_0x33edf2);}(_0x9c15,0x11d));var _0x59c1=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x9c15[_0x465028];return _0xb783d4;};'use strict';var _=require(_0x59c1('0x0'));var util=require(_0x59c1('0x1'));var logger=require(_0x59c1('0x2'))(_0x59c1('0x3'));var moment=require(_0x59c1('0x4'));var BPromise=require(_0x59c1('0x5'));var rp=require(_0x59c1('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x59c1('0x7'));var config=require(_0x59c1('0x8'));var attributes=require(_0x59c1('0x9'));module['exports']=function(_0x5b144c,_0x575908){return _0x5b144c[_0x59c1('0xa')]('VoiceMailMessage',attributes,{'tableName':_0x59c1('0xb'),'paranoid':![],'indexes':[{'name':_0x59c1('0xc'),'fields':[_0x59c1('0xc')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index 9b23adf..ad50679 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 _0xbc71=['message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','VoiceMailMessage,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x3be2e2,_0x5c166d){var _0x53b9c5=function(_0x248aa7){while(--_0x248aa7){_0x3be2e2['push'](_0x3be2e2['shift']());}};_0x53b9c5(++_0x5c166d);}(_0xbc71,0x1bc));var _0x1bc7=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0xbc71[_0xb0f7c3];return _0x28ea68;};'use strict';var _=require(_0x1bc7('0x0'));var util=require(_0x1bc7('0x1'));var moment=require(_0x1bc7('0x2'));var BPromise=require('bluebird');var rs=require(_0x1bc7('0x3'));var fs=require('fs');var Redis=require(_0x1bc7('0x4'));var db=require(_0x1bc7('0x5'))['db'];var utils=require(_0x1bc7('0x6'));var logger=require(_0x1bc7('0x7'))('rpc');var config=require(_0x1bc7('0x8'));var jayson=require(_0x1bc7('0x9'));var client=jayson[_0x1bc7('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4f34cc,_0x17eb8f,_0x3532ef){return new BPromise(function(_0x5c0303,_0x6974c8){return client['request'](_0x4f34cc,_0x3532ef)[_0x1bc7('0xb')](function(_0x134afb){logger[_0x1bc7('0xc')](_0x1bc7('0xd'),_0x17eb8f,_0x1bc7('0xe'));logger['debug'](_0x1bc7('0xf'),_0x17eb8f,_0x1bc7('0xe'),JSON['stringify'](_0x134afb));if(_0x134afb[_0x1bc7('0x10')]){if(_0x134afb['error'][_0x1bc7('0x11')]===0x1f4){logger['error'](_0x1bc7('0xd'),_0x17eb8f,_0x134afb['error'][_0x1bc7('0x12')]);return _0x6974c8(_0x134afb['error']['message']);}logger[_0x1bc7('0x10')](_0x1bc7('0xd'),_0x17eb8f,_0x134afb['error']['message']);return _0x5c0303(_0x134afb['error'][_0x1bc7('0x12')]);}else{logger[_0x1bc7('0xc')](_0x1bc7('0xd'),_0x17eb8f,_0x1bc7('0xe'));_0x5c0303(_0x134afb[_0x1bc7('0x13')][_0x1bc7('0x12')]);}})[_0x1bc7('0x14')](function(_0x396e27){logger[_0x1bc7('0x10')](_0x1bc7('0xd'),_0x17eb8f,_0x396e27);_0x6974c8(_0x396e27);});});} \ No newline at end of file +var _0x47a5=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring'];(function(_0x2de020,_0x252df0){var _0x182b7c=function(_0xcbcdaa){while(--_0xcbcdaa){_0x2de020['push'](_0x2de020['shift']());}};_0x182b7c(++_0x252df0);}(_0x47a5,0x1d0));var _0x547a=function(_0x54e8f1,_0x4f0751){_0x54e8f1=_0x54e8f1-0x0;var _0xca216f=_0x47a5[_0x54e8f1];return _0xca216f;};'use strict';var _=require(_0x547a('0x0'));var util=require(_0x547a('0x1'));var moment=require('moment');var BPromise=require(_0x547a('0x2'));var rs=require(_0x547a('0x3'));var fs=require('fs');var Redis=require(_0x547a('0x4'));var db=require(_0x547a('0x5'))['db'];var utils=require(_0x547a('0x6'));var logger=require(_0x547a('0x7'))(_0x547a('0x8'));var config=require(_0x547a('0x9'));var jayson=require(_0x547a('0xa'));var client=jayson[_0x547a('0xb')][_0x547a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x146c08,_0x221c8d,_0x54203e){return new BPromise(function(_0x5a75b1,_0x4aa231){return client[_0x547a('0xd')](_0x146c08,_0x54203e)[_0x547a('0xe')](function(_0x2d650a){logger[_0x547a('0xf')](_0x547a('0x10'),_0x221c8d,_0x547a('0x11'));logger[_0x547a('0x12')](_0x547a('0x13'),_0x221c8d,'request\x20sent',JSON[_0x547a('0x14')](_0x2d650a));if(_0x2d650a[_0x547a('0x15')]){if(_0x2d650a['error'][_0x547a('0x16')]===0x1f4){logger[_0x547a('0x15')](_0x547a('0x10'),_0x221c8d,_0x2d650a[_0x547a('0x15')][_0x547a('0x17')]);return _0x4aa231(_0x2d650a['error'][_0x547a('0x17')]);}logger[_0x547a('0x15')](_0x547a('0x10'),_0x221c8d,_0x2d650a[_0x547a('0x15')]['message']);return _0x5a75b1(_0x2d650a['error'][_0x547a('0x17')]);}else{logger[_0x547a('0xf')](_0x547a('0x10'),_0x221c8d,_0x547a('0x11'));_0x5a75b1(_0x2d650a[_0x547a('0x18')][_0x547a('0x17')]);}})[_0x547a('0x19')](function(_0x253b40){logger[_0x547a('0x15')](_0x547a('0x10'),_0x221c8d,_0x253b40);_0x4aa231(_0x253b40);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index 912a090..4ad2e33 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 _0x36b6=['get','index','/:id','isAuthenticated','show','/:id/sounds','post','create','addSound','put','delete','destroy','/:id/sounds/:id2','removeSound','exports','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller'];(function(_0x14afab,_0x1bd101){var _0x31ba9f=function(_0x2f7ee6){while(--_0x2f7ee6){_0x14afab['push'](_0x14afab['shift']());}};_0x31ba9f(++_0x1bd101);}(_0x36b6,0x159));var _0x636b=function(_0xff2639,_0x2fa99c){_0xff2639=_0xff2639-0x0;var _0x54334c=_0x36b6[_0xff2639];return _0x54334c;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x636b('0x0'));var router=express[_0x636b('0x1')]();var fs_extra=require(_0x636b('0x2'));var auth=require(_0x636b('0x3'));var interaction=require(_0x636b('0x4'));var config=require(_0x636b('0x5'));var controller=require(_0x636b('0x6'));router[_0x636b('0x7')]('/',auth['isAuthenticated'](),controller[_0x636b('0x8')]);router[_0x636b('0x7')](_0x636b('0x9'),auth[_0x636b('0xa')](),controller[_0x636b('0xb')]);router[_0x636b('0x7')](_0x636b('0xc'),auth[_0x636b('0xa')](),controller['getSounds']);router[_0x636b('0xd')]('/',auth['isAuthenticated'](),controller[_0x636b('0xe')]);router[_0x636b('0xd')](_0x636b('0xc'),auth[_0x636b('0xa')](),controller[_0x636b('0xf')]);router[_0x636b('0x10')]('/:id',auth[_0x636b('0xa')](),controller['update']);router[_0x636b('0x11')](_0x636b('0x9'),auth[_0x636b('0xa')](),controller[_0x636b('0x12')]);router['delete'](_0x636b('0x13'),auth[_0x636b('0xa')](),controller[_0x636b('0x14')]);module[_0x636b('0x15')]=router; \ No newline at end of file +var _0x6899=['update','destroy','delete','/:id/sounds/:id2','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','get','isAuthenticated','index','/:id','/:id/sounds','getSounds','create','post','addSound','put'];(function(_0x422890,_0x434494){var _0x202cf0=function(_0x10e9f0){while(--_0x10e9f0){_0x422890['push'](_0x422890['shift']());}};_0x202cf0(++_0x434494);}(_0x6899,0x1cd));var _0x9689=function(_0x4577b5,_0x306a8f){_0x4577b5=_0x4577b5-0x0;var _0x2d7596=_0x6899[_0x4577b5];return _0x2d7596;};'use strict';var multer=require(_0x9689('0x0'));var util=require(_0x9689('0x1'));var path=require('path');var timeout=require(_0x9689('0x2'));var express=require(_0x9689('0x3'));var router=express[_0x9689('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x9689('0x5'));var interaction=require(_0x9689('0x6'));var config=require(_0x9689('0x7'));var controller=require(_0x9689('0x8'));router[_0x9689('0x9')]('/',auth[_0x9689('0xa')](),controller[_0x9689('0xb')]);router['get'](_0x9689('0xc'),auth[_0x9689('0xa')](),controller['show']);router['get'](_0x9689('0xd'),auth[_0x9689('0xa')](),controller[_0x9689('0xe')]);router['post']('/',auth[_0x9689('0xa')](),controller[_0x9689('0xf')]);router[_0x9689('0x10')](_0x9689('0xd'),auth[_0x9689('0xa')](),controller[_0x9689('0x11')]);router[_0x9689('0x12')](_0x9689('0xc'),auth[_0x9689('0xa')](),controller[_0x9689('0x13')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x9689('0x14')]);router[_0x9689('0x15')](_0x9689('0x16'),auth[_0x9689('0xa')](),controller['removeSound']);module[_0x9689('0x17')]=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index 0ee7af2..e4cf3f0 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 _0xd560=['files','STRING','alpha','BOOLEAN','sequelize','exports','custom'];(function(_0x1ae673,_0x568d61){var _0x433cc6=function(_0x12f18f){while(--_0x12f18f){_0x1ae673['push'](_0x1ae673['shift']());}};_0x433cc6(++_0x568d61);}(_0xd560,0xba));var _0x0d56=function(_0x3c0c62,_0x57ba75){_0x3c0c62=_0x3c0c62-0x0;var _0x298b1f=_0xd560[_0x3c0c62];return _0x298b1f;};'use strict';var Sequelize=require(_0x0d56('0x0'));module[_0x0d56('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'mode':{'type':Sequelize['ENUM'](_0x0d56('0x2'),_0x0d56('0x3'),'mp3nb','quietmp3nb','quietmp3','mp3'),'allowNull':!![],'defaultValue':_0x0d56('0x3')},'directory':{'type':Sequelize[_0x0d56('0x4')],'allowNull':!![]},'application':{'type':Sequelize[_0x0d56('0x4')],'allowNull':!![]},'digit':{'type':Sequelize['STRING'],'allowNull':!![]},'sort':{'type':Sequelize[_0x0d56('0x4')],'allowNull':!![],'defaultValue':_0x0d56('0x5')},'format':{'type':Sequelize[_0x0d56('0x4')],'allowNull':!![]},'stamp':{'type':'TIMESTAMP'},'defaultEntry':{'type':Sequelize[_0x0d56('0x6')],'defaultValue':0x0}}; \ No newline at end of file +var _0x97bf=['exports','ENUM','files','quietmp3nb','quietmp3','STRING','TIMESTAMP','sequelize'];(function(_0x43e7c4,_0x24fb15){var _0x4685d9=function(_0x223a94){while(--_0x223a94){_0x43e7c4['push'](_0x43e7c4['shift']());}};_0x4685d9(++_0x24fb15);}(_0x97bf,0x1b7));var _0xf97b=function(_0x5966ef,_0x5bdaef){_0x5966ef=_0x5966ef-0x0;var _0x313b0b=_0x97bf[_0x5966ef];return _0x313b0b;};'use strict';var Sequelize=require(_0xf97b('0x0'));module[_0xf97b('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'mode':{'type':Sequelize[_0xf97b('0x2')]('custom',_0xf97b('0x3'),'mp3nb',_0xf97b('0x4'),_0xf97b('0x5'),'mp3'),'allowNull':!![],'defaultValue':'files'},'directory':{'type':Sequelize[_0xf97b('0x6')],'allowNull':!![]},'application':{'type':Sequelize[_0xf97b('0x6')],'allowNull':!![]},'digit':{'type':Sequelize[_0xf97b('0x6')],'allowNull':!![]},'sort':{'type':Sequelize[_0xf97b('0x6')],'allowNull':!![],'defaultValue':'alpha'},'format':{'type':Sequelize[_0xf97b('0x6')],'allowNull':!![]},'stamp':{'type':_0xf97b('0x7')},'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 3cb57c0..d4aa691 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 _0x6dab=['status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','MusicOnHolds','UserProfileResource','error','stack','name','send','VoiceMusicOnHold','rawAttributes','type','key','model','map','query','keys','intersection','attributes','fields','length','order','sort','where','pick','filters','filter','merge','includeAll','include','findAll','rows','catch','show','params','options','find','body','create','sequelize','transaction','files','directory','join','root','server/files/moh','mode','0777','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','forEach','unlinkSync','rmdirSync','ValidationError','addSound','Sound','findOne','save_name','converted_format','createdAt','format','%s.%s','extname','symlinkSync','removeSound','id2','Sequelize','message','getSounds','hasOwnProperty','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus'];(function(_0x4e6ae6,_0x49dba6){var _0x23c108=function(_0x1bc103){while(--_0x1bc103){_0x4e6ae6['push'](_0x4e6ae6['shift']());}};_0x23c108(++_0x49dba6);}(_0x6dab,0xc7));var _0xb6da=function(_0xd9c529,_0x19f8cc){_0xd9c529=_0xd9c529-0x0;var _0x146760=_0x6dab[_0xd9c529];return _0x146760;};'use strict';var emlformat=require(_0xb6da('0x0'));var rimraf=require(_0xb6da('0x1'));var zipdir=require(_0xb6da('0x2'));var jsonpatch=require(_0xb6da('0x3'));var rp=require('request-promise');var moment=require(_0xb6da('0x4'));var BPromise=require(_0xb6da('0x5'));var Mustache=require(_0xb6da('0x6'));var util=require(_0xb6da('0x7'));var path=require(_0xb6da('0x8'));var sox=require(_0xb6da('0x9'));var csv=require(_0xb6da('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb6da('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xb6da('0xc'));var deskjs=require(_0xb6da('0xd'));var toCsv=require(_0xb6da('0xa'));var querystring=require('querystring');var Papa=require(_0xb6da('0xe'));var Redis=require(_0xb6da('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xb6da('0x10'));var hardwareService=require(_0xb6da('0x11'));var logger=require(_0xb6da('0x12'))(_0xb6da('0x13'));var utils=require('../../config/utils');var config=require(_0xb6da('0x14'));var licenseUtil=require(_0xb6da('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x9e6248,_0x4c3d83){_0x4c3d83=_0x4c3d83||0xcc;return function(_0x55a8e0){if(_0x55a8e0){return _0x9e6248[_0xb6da('0x16')](_0x4c3d83);}return _0x9e6248[_0xb6da('0x17')](_0x4c3d83)[_0xb6da('0x18')]();};}function respondWithResult(_0x254060,_0x281f9c){_0x281f9c=_0x281f9c||0xc8;return function(_0xd620e6){if(_0xd620e6){return _0x254060['status'](_0x281f9c)[_0xb6da('0x19')](_0xd620e6);}};}function respondWithFilteredResult(_0x4f30d2,_0x15286d){return function(_0x2add22){if(_0x2add22){var _0x120e70=typeof _0x15286d[_0xb6da('0x1a')]===_0xb6da('0x1b')&&typeof _0x15286d[_0xb6da('0x1c')]==='undefined';var _0x5243b2=_0x2add22[_0xb6da('0x1d')];var _0x4488de=_0x120e70?0x0:_0x15286d['offset'];var _0x520a08=_0x120e70?_0x2add22[_0xb6da('0x1d')]:_0x15286d[_0xb6da('0x1a')]+_0x15286d['limit'];var _0x24221c;if(_0x520a08>=_0x5243b2){_0x520a08=_0x5243b2;_0x24221c=0xc8;}else{_0x24221c=0xce;}_0x4f30d2[_0xb6da('0x17')](_0x24221c);return _0x4f30d2[_0xb6da('0x1e')](_0xb6da('0x1f'),_0x4488de+'-'+_0x520a08+'/'+_0x5243b2)[_0xb6da('0x19')](_0x2add22);}return null;};}function patchUpdates(_0x415518){return function(_0x87ffbb){try{jsonpatch[_0xb6da('0x20')](_0x87ffbb,_0x415518,!![]);}catch(_0xfcdb61){return BPromise[_0xb6da('0x21')](_0xfcdb61);}return _0x87ffbb[_0xb6da('0x22')]();};}function saveUpdates(_0x283133,_0x1eab7f){return function(_0x2f1515){if(_0x2f1515){return _0x2f1515[_0xb6da('0x23')](_0x283133)[_0xb6da('0x24')](function(_0x482f55){return _0x482f55;});}return null;};}function removeEntity(_0x63ff2d,_0x21fc10){return function(_0xea389c){if(_0xea389c){return _0xea389c[_0xb6da('0x25')]()[_0xb6da('0x24')](function(){var _0x3a11c9=_0xea389c[_0xb6da('0x26')]({'plain':!![]});var _0x37d656=_0xb6da('0x27');return db[_0xb6da('0x28')]['destroy']({'where':{'type':_0x37d656,'resourceId':_0x3a11c9['id']}})['then'](function(){return _0xea389c;});})[_0xb6da('0x24')](function(){_0x63ff2d[_0xb6da('0x17')](0xcc)[_0xb6da('0x18')]();});}};}function handleEntityNotFound(_0x2c3dfd,_0x51f464){return function(_0x111940){if(!_0x111940){_0x2c3dfd['sendStatus'](0x194);}return _0x111940;};}function handleError(_0x12f8f5,_0x4aed5c){_0x4aed5c=_0x4aed5c||0x1f4;return function(_0x1676be){logger[_0xb6da('0x29')](_0x1676be[_0xb6da('0x2a')]);if(_0x1676be['name']){delete _0x1676be[_0xb6da('0x2b')];}_0x12f8f5[_0xb6da('0x17')](_0x4aed5c)[_0xb6da('0x2c')](_0x1676be);};}exports['index']=function(_0x466731,_0x524364){var _0x4f1fdb={},_0x2b558f={},_0x218781={'count':0x0,'rows':[]};var _0x5d04cd=_['map'](db[_0xb6da('0x2d')][_0xb6da('0x2e')],function(_0x1f4a5b){return{'name':_0x1f4a5b['fieldName'],'type':_0x1f4a5b[_0xb6da('0x2f')][_0xb6da('0x30')]};});_0x2b558f[_0xb6da('0x31')]=_[_0xb6da('0x32')](_0x5d04cd,'name');_0x2b558f[_0xb6da('0x33')]=_[_0xb6da('0x34')](_0x466731[_0xb6da('0x33')]);_0x2b558f['filters']=_[_0xb6da('0x35')](_0x2b558f[_0xb6da('0x31')],_0x2b558f['query']);_0x4f1fdb[_0xb6da('0x36')]=_[_0xb6da('0x35')](_0x2b558f['model'],qs['fields'](_0x466731[_0xb6da('0x33')][_0xb6da('0x37')]));_0x4f1fdb[_0xb6da('0x36')]=_0x4f1fdb[_0xb6da('0x36')][_0xb6da('0x38')]?_0x4f1fdb[_0xb6da('0x36')]:_0x2b558f[_0xb6da('0x31')];if(!_0x466731[_0xb6da('0x33')]['hasOwnProperty']('nolimit')){_0x4f1fdb[_0xb6da('0x1c')]=qs[_0xb6da('0x1c')](_0x466731[_0xb6da('0x33')][_0xb6da('0x1c')]);_0x4f1fdb['offset']=qs[_0xb6da('0x1a')](_0x466731[_0xb6da('0x33')][_0xb6da('0x1a')]);}_0x4f1fdb[_0xb6da('0x39')]=qs[_0xb6da('0x3a')](_0x466731['query'][_0xb6da('0x3a')]);delete _0x466731[_0xb6da('0x33')][_0xb6da('0x3a')];_0x4f1fdb[_0xb6da('0x3b')]=qs['filters'](_[_0xb6da('0x3c')](_0x466731['query'],_0x2b558f[_0xb6da('0x3d')]),_0x5d04cd);if(_0x466731[_0xb6da('0x33')][_0xb6da('0x3e')]){_0x4f1fdb[_0xb6da('0x3b')]=_[_0xb6da('0x3f')](_0x4f1fdb[_0xb6da('0x3b')],{'$or':_[_0xb6da('0x32')](_0x5d04cd,function(_0x4d2deb){if(_0x4d2deb[_0xb6da('0x2f')]!=='VIRTUAL'){var _0x1a7630={};_0x1a7630[_0x4d2deb[_0xb6da('0x2b')]]={'$like':'%'+_0x466731[_0xb6da('0x33')]['filter']+'%'};return _0x1a7630;}})});}_0x4f1fdb=_['merge']({},_0x4f1fdb,_0x466731['options']);var _0x2bac98={'where':_0x4f1fdb[_0xb6da('0x3b')]};return db[_0xb6da('0x2d')][_0xb6da('0x1d')](_0x2bac98)[_0xb6da('0x24')](function(_0x2123b5){_0x218781['count']=_0x2123b5;if(_0x466731['query'][_0xb6da('0x40')]){_0x4f1fdb[_0xb6da('0x41')]=[{'all':!![]}];}return db['VoiceMusicOnHold'][_0xb6da('0x42')](_0x4f1fdb);})[_0xb6da('0x24')](function(_0x542223){_0x218781[_0xb6da('0x43')]=_0x542223;return _0x218781;})[_0xb6da('0x24')](respondWithFilteredResult(_0x524364,_0x4f1fdb))[_0xb6da('0x44')](handleError(_0x524364,null));};exports[_0xb6da('0x45')]=function(_0x1b0c6d,_0x524007){var _0x4e3abf={'raw':![],'where':{'id':_0x1b0c6d[_0xb6da('0x46')]['id']}},_0x1b7fea={};_0x1b7fea['model']=_['keys'](db[_0xb6da('0x2d')][_0xb6da('0x2e')]);_0x1b7fea[_0xb6da('0x33')]=_['keys'](_0x1b0c6d[_0xb6da('0x33')]);_0x1b7fea[_0xb6da('0x3d')]=_[_0xb6da('0x35')](_0x1b7fea[_0xb6da('0x31')],_0x1b7fea[_0xb6da('0x33')]);_0x4e3abf[_0xb6da('0x36')]=_[_0xb6da('0x35')](_0x1b7fea[_0xb6da('0x31')],qs[_0xb6da('0x37')](_0x1b0c6d[_0xb6da('0x33')][_0xb6da('0x37')]));_0x4e3abf['attributes']=_0x4e3abf['attributes'][_0xb6da('0x38')]?_0x4e3abf[_0xb6da('0x36')]:_0x1b7fea[_0xb6da('0x31')];if(_0x1b0c6d[_0xb6da('0x33')]['includeAll']){_0x4e3abf['include']=[{'all':!![]}];}_0x4e3abf=_[_0xb6da('0x3f')]({},_0x4e3abf,_0x1b0c6d[_0xb6da('0x47')]);return db[_0xb6da('0x2d')][_0xb6da('0x48')](_0x4e3abf)[_0xb6da('0x24')](handleEntityNotFound(_0x524007,null))[_0xb6da('0x24')](respondWithResult(_0x524007,null))[_0xb6da('0x44')](handleError(_0x524007,null));};exports[_0xb6da('0x23')]=function(_0x43e8c6,_0x268e0a){if(_0x43e8c6[_0xb6da('0x49')]['id']){delete _0x43e8c6[_0xb6da('0x49')]['id'];}return db[_0xb6da('0x2d')][_0xb6da('0x48')]({'where':{'id':_0x43e8c6['params']['id']}})['then'](handleEntityNotFound(_0x268e0a,null))['then'](saveUpdates(_0x43e8c6[_0xb6da('0x49')],null))[_0xb6da('0x24')](respondWithResult(_0x268e0a,null))[_0xb6da('0x44')](handleError(_0x268e0a,null));};exports[_0xb6da('0x4a')]=function(_0x569e8d,_0x5e979f,_0x3db3c0){return db[_0xb6da('0x4b')][_0xb6da('0x4c')](function(_0x108494){if(_0x569e8d[_0xb6da('0x49')]['mode']===_0xb6da('0x4d')){_0x569e8d[_0xb6da('0x49')][_0xb6da('0x4e')]=path[_0xb6da('0x4f')](config[_0xb6da('0x50')],_0xb6da('0x51'),_0x569e8d['body'][_0xb6da('0x2b')]);}return db[_0xb6da('0x2d')][_0xb6da('0x4a')](_0x569e8d[_0xb6da('0x49')],{'transaction':_0x108494})[_0xb6da('0x24')](function(_0x246c43){if(_0x569e8d[_0xb6da('0x49')][_0xb6da('0x52')]===_0xb6da('0x4d')){fs['mkdirSync'](_0x246c43[_0xb6da('0x4e')],parseInt(_0xb6da('0x53'),0x8));}var _0x4d5fbf=_0x569e8d[_0xb6da('0x54')][_0xb6da('0x26')]({'plain':!![]});if(!_0x4d5fbf)throw new Error(_0xb6da('0x55'));if(_0x4d5fbf[_0xb6da('0x56')]==='user'){var _0x4204ed=_0x246c43[_0xb6da('0x26')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':'MusicOnHolds','userProfileId':_0x4d5fbf[_0xb6da('0x57')]},'raw':!![]})['then'](function(_0x84d069){if(_0x84d069&&_0x84d069[_0xb6da('0x58')]===0x0){return db[_0xb6da('0x28')]['create']({'name':_0x4204ed[_0xb6da('0x2b')],'resourceId':_0x4204ed['id'],'type':_0x84d069[_0xb6da('0x2b')],'sectionId':_0x84d069['id']},{})[_0xb6da('0x24')](function(){return _0x246c43;});}else{return _0x246c43;}})[_0xb6da('0x44')](function(_0x2f9647){logger['error'](_0xb6da('0x59'),_0x2f9647);});}return _0x246c43;});})[_0xb6da('0x24')](respondWithResult(_0x5e979f,0xc9))[_0xb6da('0x44')](handleError(_0x5e979f,null));};exports[_0xb6da('0x25')]=function(_0x43d97e,_0x2cd31a,_0xc33a1){var _0x3af55f;return db[_0xb6da('0x2d')][_0xb6da('0x48')]({'where':{'id':_0x43d97e[_0xb6da('0x46')]['id']}})[_0xb6da('0x24')](function(_0x4ef430){if(_0x4ef430){return db[_0xb6da('0x4b')][_0xb6da('0x4c')](function(_0x1c45e2){return _0x4ef430[_0xb6da('0x25')]({'transaction':_0x1c45e2,'raw':!![]})[_0xb6da('0x24')](function(_0x2606e1){if(_0x2606e1[_0xb6da('0x4e')]){fs['readdirSync'](_0x2606e1[_0xb6da('0x4e')])[_0xb6da('0x5a')](function(_0x2ca635){fs[_0xb6da('0x5b')](path['join'](_0x2606e1['directory'],_0x2ca635));});fs[_0xb6da('0x5c')](_0x2606e1[_0xb6da('0x4e')]);}return _0x2606e1;});})[_0xb6da('0x44')](function(_0x256f26){throw new db['Sequelize'][(_0xb6da('0x5d'))](_0x256f26['message']);});}})[_0xb6da('0x24')](handleEntityNotFound(_0x2cd31a,null))[_0xb6da('0x24')](removeEntity(_0x2cd31a,null))[_0xb6da('0x44')](handleError(_0x2cd31a,null));};exports['addSound']=function(_0x25eb1d,_0x49687d,_0x3c4076){return db[_0xb6da('0x4b')]['transaction'](function(_0x196253){var _0xb04820;return db['VoiceMusicOnHold'][_0xb6da('0x48')]({'where':{'id':_0x25eb1d[_0xb6da('0x46')]['id']}})[_0xb6da('0x24')](function(_0x542dcb){if(_0x542dcb){_0xb04820=_0x542dcb;return _0x542dcb[_0xb6da('0x5e')](_0x25eb1d[_0xb6da('0x49')]['id'],{'transaction':_0x196253});}})[_0xb6da('0x24')](function(_0x1d445d){if(_0x1d445d){return db[_0xb6da('0x5f')][_0xb6da('0x60')]({'where':{'id':_0x25eb1d[_0xb6da('0x49')]['id']},'attributes':['id','name',_0xb6da('0x61'),_0xb6da('0x62'),_0xb6da('0x63')],'raw':!![]});}})['then'](function(_0xf403ca){if(_0xf403ca){var _0x5afcb8=path[_0xb6da('0x4f')](config[_0xb6da('0x50')],'server/files/sounds/converted',util[_0xb6da('0x64')](_0xb6da('0x65'),path['basename'](_0xf403ca['save_name'],path[_0xb6da('0x66')](_0xf403ca[_0xb6da('0x61')])),_0xf403ca['converted_format']));var _0x4aac9b=path[_0xb6da('0x4f')](config['root'],_0xb6da('0x51'),_0xb04820[_0xb6da('0x2b')],util[_0xb6da('0x64')](_0xb6da('0x65'),_0xf403ca[_0xb6da('0x2b')],_0xf403ca['converted_format']));fs[_0xb6da('0x67')](_0x5afcb8,_0x4aac9b);return _0xf403ca;}})[_0xb6da('0x44')](function(_0x1cdb8a){throw new db['Sequelize'][(_0xb6da('0x5d'))](_0x1cdb8a['message']);});})[_0xb6da('0x24')](handleEntityNotFound(_0x49687d,null))[_0xb6da('0x24')](respondWithResult(_0x49687d,0xc9))['catch'](handleError(_0x49687d,null));};exports['removeSound']=function(_0x3d69aa,_0x5afac8,_0x293af3){return db[_0xb6da('0x4b')]['transaction'](function(_0x1d9539){var _0x361372;return db['VoiceMusicOnHold'][_0xb6da('0x60')]({'where':{'id':_0x3d69aa['params']['id']}})[_0xb6da('0x24')](handleEntityNotFound(_0x5afac8,null))[_0xb6da('0x24')](function(_0x58f4ee){if(_0x58f4ee){_0x361372=_0x58f4ee;return _0x58f4ee[_0xb6da('0x68')](_0x3d69aa['params'][_0xb6da('0x69')]);}})[_0xb6da('0x24')](function(_0x349f0b){if(_0x349f0b){return db[_0xb6da('0x5f')][_0xb6da('0x60')]({'where':{'id':_0x3d69aa['params']['id2']},'attributes':['id',_0xb6da('0x2b'),_0xb6da('0x61'),_0xb6da('0x62'),_0xb6da('0x63')],'raw':!![]});}})[_0xb6da('0x24')](function(_0x1359d4){if(_0x1359d4){fs[_0xb6da('0x5b')](path[_0xb6da('0x4f')](_0x361372[_0xb6da('0x4e')],util[_0xb6da('0x64')](_0xb6da('0x65'),_0x1359d4[_0xb6da('0x2b')],_0x1359d4[_0xb6da('0x62')])));return _0x1359d4;}})[_0xb6da('0x44')](function(_0x3f53bf){throw new db[(_0xb6da('0x6a'))]['ValidationError'](_0x3f53bf[_0xb6da('0x6b')]);});})[_0xb6da('0x24')](handleEntityNotFound(_0x5afac8,null))[_0xb6da('0x24')](respondWithStatusCode(_0x5afac8,0xcc))[_0xb6da('0x44')](handleError(_0x5afac8,null));};exports[_0xb6da('0x6c')]=function(_0x57b7d6,_0x25d134,_0x1f0738){var _0x1bcb2e={};var _0x39417b={};var _0x598f13;var _0x3b6b36;return db[_0xb6da('0x2d')][_0xb6da('0x60')]({'where':{'id':_0x57b7d6[_0xb6da('0x46')]['id']}})[_0xb6da('0x24')](handleEntityNotFound(_0x25d134,null))[_0xb6da('0x24')](function(_0x1953b8){if(_0x1953b8){_0x598f13=_0x1953b8;_0x39417b['model']=_[_0xb6da('0x34')](db['Sound'][_0xb6da('0x2e')]);_0x39417b[_0xb6da('0x33')]=_[_0xb6da('0x34')](_0x57b7d6[_0xb6da('0x33')]);_0x39417b[_0xb6da('0x3d')]=_[_0xb6da('0x35')](_0x39417b['model'],_0x39417b[_0xb6da('0x33')]);_0x1bcb2e[_0xb6da('0x36')]=_[_0xb6da('0x35')](_0x39417b[_0xb6da('0x31')],qs[_0xb6da('0x37')](_0x57b7d6[_0xb6da('0x33')][_0xb6da('0x37')]));_0x1bcb2e[_0xb6da('0x36')]=_0x1bcb2e[_0xb6da('0x36')][_0xb6da('0x38')]?_0x1bcb2e['attributes']:_0x39417b['model'];_0x1bcb2e[_0xb6da('0x39')]=qs['sort'](_0x57b7d6[_0xb6da('0x33')][_0xb6da('0x3a')]);_0x1bcb2e[_0xb6da('0x3b')]=qs[_0xb6da('0x3d')](_[_0xb6da('0x3c')](_0x57b7d6[_0xb6da('0x33')],_0x39417b[_0xb6da('0x3d')]));if(_0x57b7d6[_0xb6da('0x33')][_0xb6da('0x3e')]){_0x1bcb2e[_0xb6da('0x3b')]=_[_0xb6da('0x3f')](_0x1bcb2e['where'],{'$or':_[_0xb6da('0x32')](_0x1bcb2e[_0xb6da('0x36')],function(_0x4bd323){var _0x1b5491={};_0x1b5491[_0x4bd323]={'$like':'%'+_0x57b7d6[_0xb6da('0x33')][_0xb6da('0x3e')]+'%'};return _0x1b5491;})});}_0x1bcb2e=_[_0xb6da('0x3f')]({},_0x1bcb2e,_0x57b7d6['options']);return _0x598f13['getSounds'](_0x1bcb2e);}})[_0xb6da('0x24')](function(_0x29ed41){if(_0x29ed41){_0x3b6b36=_0x29ed41[_0xb6da('0x38')];if(!_0x57b7d6[_0xb6da('0x33')][_0xb6da('0x6d')](_0xb6da('0x6e'))){_0x1bcb2e['limit']=qs[_0xb6da('0x1c')](_0x57b7d6[_0xb6da('0x33')]['limit']);_0x1bcb2e[_0xb6da('0x1a')]=qs[_0xb6da('0x1a')](_0x57b7d6[_0xb6da('0x33')][_0xb6da('0x1a')]);}return _0x598f13['getSounds'](_0x1bcb2e);}})[_0xb6da('0x24')](function(_0xdab0d3){if(_0xdab0d3){return _0xdab0d3?{'count':_0x3b6b36,'rows':_0xdab0d3}:null;}})['then'](respondWithResult(_0x25d134,null))[_0xb6da('0x44')](handleError(_0x25d134,null));}; \ No newline at end of file +var _0x51aa=['format','extname','symlinkSync','removeSound','id2','createdAt','%s.%s','getSounds','Sound','pick','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','destroy','then','get','MusicOnHolds','error','stack','name','send','index','map','VoiceMusicOnHold','rawAttributes','fieldName','type','key','keys','filters','intersection','model','query','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','attributes','body','find','sequelize','files','join','root','server/files/moh','create','mode','directory','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','transaction','readdirSync','forEach','unlinkSync','rmdirSync','Sequelize','ValidationError','message','addSound','findOne','save_name','converted_format','server/files/sounds/converted'];(function(_0x551906,_0x569941){var _0x58bfb6=function(_0x1eb6de){while(--_0x1eb6de){_0x551906['push'](_0x551906['shift']());}};_0x58bfb6(++_0x569941);}(_0x51aa,0x166));var _0xa51a=function(_0x1ea3bd,_0x506c52){_0x1ea3bd=_0x1ea3bd-0x0;var _0x47787f=_0x51aa[_0x1ea3bd];return _0x47787f;};'use strict';var emlformat=require(_0xa51a('0x0'));var rimraf=require(_0xa51a('0x1'));var zipdir=require(_0xa51a('0x2'));var jsonpatch=require(_0xa51a('0x3'));var rp=require(_0xa51a('0x4'));var moment=require(_0xa51a('0x5'));var BPromise=require(_0xa51a('0x6'));var Mustache=require('mustache');var util=require(_0xa51a('0x7'));var path=require(_0xa51a('0x8'));var sox=require(_0xa51a('0x9'));var csv=require(_0xa51a('0xa'));var ejs=require(_0xa51a('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa51a('0xc'));var squel=require(_0xa51a('0xd'));var crypto=require('crypto');var jsforce=require(_0xa51a('0xe'));var deskjs=require(_0xa51a('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xa51a('0x10'));var Redis=require(_0xa51a('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xa51a('0x12'));var as=require(_0xa51a('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa51a('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xa51a('0x15'));var licenseUtil=require(_0xa51a('0x16'));var db=require(_0xa51a('0x17'))['db'];function respondWithStatusCode(_0x264bcb,_0x5f2578){_0x5f2578=_0x5f2578||0xcc;return function(_0x2dbdb9){if(_0x2dbdb9){return _0x264bcb[_0xa51a('0x18')](_0x5f2578);}return _0x264bcb['status'](_0x5f2578)[_0xa51a('0x19')]();};}function respondWithResult(_0x2b511d,_0x43f579){_0x43f579=_0x43f579||0xc8;return function(_0x367cfe){if(_0x367cfe){return _0x2b511d[_0xa51a('0x1a')](_0x43f579)['json'](_0x367cfe);}};}function respondWithFilteredResult(_0x3706c4,_0x24b8fc){return function(_0x460c88){if(_0x460c88){var _0x4bfdb1=typeof _0x24b8fc[_0xa51a('0x1b')]==='undefined'&&typeof _0x24b8fc[_0xa51a('0x1c')]===_0xa51a('0x1d');var _0x362494=_0x460c88[_0xa51a('0x1e')];var _0x40dc5d=_0x4bfdb1?0x0:_0x24b8fc['offset'];var _0x2502b9=_0x4bfdb1?_0x460c88[_0xa51a('0x1e')]:_0x24b8fc['offset']+_0x24b8fc[_0xa51a('0x1c')];var _0x2aa940;if(_0x2502b9>=_0x362494){_0x2502b9=_0x362494;_0x2aa940=0xc8;}else{_0x2aa940=0xce;}_0x3706c4[_0xa51a('0x1a')](_0x2aa940);return _0x3706c4[_0xa51a('0x1f')](_0xa51a('0x20'),_0x40dc5d+'-'+_0x2502b9+'/'+_0x362494)[_0xa51a('0x21')](_0x460c88);}return null;};}function patchUpdates(_0x49f06c){return function(_0x40ed0f){try{jsonpatch[_0xa51a('0x22')](_0x40ed0f,_0x49f06c,!![]);}catch(_0x2e037e){return BPromise[_0xa51a('0x23')](_0x2e037e);}return _0x40ed0f[_0xa51a('0x24')]();};}function saveUpdates(_0x307c3c,_0x4e19ca){return function(_0x4c8bb9){if(_0x4c8bb9){return _0x4c8bb9[_0xa51a('0x25')](_0x307c3c)['then'](function(_0x2d2a82){return _0x2d2a82;});}return null;};}function removeEntity(_0x469a58,_0x59f874){return function(_0x4d0c87){if(_0x4d0c87){return _0x4d0c87[_0xa51a('0x26')]()[_0xa51a('0x27')](function(){var _0x43bbc7=_0x4d0c87[_0xa51a('0x28')]({'plain':!![]});var _0x447421=_0xa51a('0x29');return db['UserProfileResource'][_0xa51a('0x26')]({'where':{'type':_0x447421,'resourceId':_0x43bbc7['id']}})[_0xa51a('0x27')](function(){return _0x4d0c87;});})[_0xa51a('0x27')](function(){_0x469a58[_0xa51a('0x1a')](0xcc)[_0xa51a('0x19')]();});}};}function handleEntityNotFound(_0x5307c0,_0x2016eb){return function(_0x518c3f){if(!_0x518c3f){_0x5307c0[_0xa51a('0x18')](0x194);}return _0x518c3f;};}function handleError(_0x8aa4a8,_0x18b8c5){_0x18b8c5=_0x18b8c5||0x1f4;return function(_0x36ac34){logger[_0xa51a('0x2a')](_0x36ac34[_0xa51a('0x2b')]);if(_0x36ac34[_0xa51a('0x2c')]){delete _0x36ac34['name'];}_0x8aa4a8[_0xa51a('0x1a')](_0x18b8c5)[_0xa51a('0x2d')](_0x36ac34);};}exports[_0xa51a('0x2e')]=function(_0x5eb97b,_0x4418f1){var _0x5c15a={},_0x4147b1={},_0x7add51={'count':0x0,'rows':[]};var _0x41dc3f=_[_0xa51a('0x2f')](db[_0xa51a('0x30')][_0xa51a('0x31')],function(_0x372827){return{'name':_0x372827[_0xa51a('0x32')],'type':_0x372827[_0xa51a('0x33')][_0xa51a('0x34')]};});_0x4147b1['model']=_[_0xa51a('0x2f')](_0x41dc3f,_0xa51a('0x2c'));_0x4147b1['query']=_[_0xa51a('0x35')](_0x5eb97b['query']);_0x4147b1[_0xa51a('0x36')]=_[_0xa51a('0x37')](_0x4147b1[_0xa51a('0x38')],_0x4147b1[_0xa51a('0x39')]);_0x5c15a['attributes']=_[_0xa51a('0x37')](_0x4147b1['model'],qs[_0xa51a('0x3a')](_0x5eb97b['query']['fields']));_0x5c15a['attributes']=_0x5c15a['attributes'][_0xa51a('0x3b')]?_0x5c15a['attributes']:_0x4147b1[_0xa51a('0x38')];if(!_0x5eb97b['query'][_0xa51a('0x3c')](_0xa51a('0x3d'))){_0x5c15a[_0xa51a('0x1c')]=qs['limit'](_0x5eb97b[_0xa51a('0x39')]['limit']);_0x5c15a[_0xa51a('0x1b')]=qs['offset'](_0x5eb97b[_0xa51a('0x39')][_0xa51a('0x1b')]);}_0x5c15a[_0xa51a('0x3e')]=qs[_0xa51a('0x3f')](_0x5eb97b[_0xa51a('0x39')][_0xa51a('0x3f')]);delete _0x5eb97b[_0xa51a('0x39')]['sort'];_0x5c15a[_0xa51a('0x40')]=qs[_0xa51a('0x36')](_['pick'](_0x5eb97b[_0xa51a('0x39')],_0x4147b1[_0xa51a('0x36')]),_0x41dc3f);if(_0x5eb97b[_0xa51a('0x39')][_0xa51a('0x41')]){_0x5c15a[_0xa51a('0x40')]=_[_0xa51a('0x42')](_0x5c15a[_0xa51a('0x40')],{'$or':_[_0xa51a('0x2f')](_0x41dc3f,function(_0x3b2be1){if(_0x3b2be1[_0xa51a('0x33')]!==_0xa51a('0x43')){var _0x1782f2={};_0x1782f2[_0x3b2be1[_0xa51a('0x2c')]]={'$like':'%'+_0x5eb97b['query'][_0xa51a('0x41')]+'%'};return _0x1782f2;}})});}_0x5c15a=_[_0xa51a('0x42')]({},_0x5c15a,_0x5eb97b[_0xa51a('0x44')]);var _0x4f1d1d={'where':_0x5c15a['where']};return db['VoiceMusicOnHold']['count'](_0x4f1d1d)[_0xa51a('0x27')](function(_0x574434){_0x7add51[_0xa51a('0x1e')]=_0x574434;if(_0x5eb97b[_0xa51a('0x39')][_0xa51a('0x45')]){_0x5c15a[_0xa51a('0x46')]=[{'all':!![]}];}return db[_0xa51a('0x30')][_0xa51a('0x47')](_0x5c15a);})[_0xa51a('0x27')](function(_0x15accf){_0x7add51[_0xa51a('0x48')]=_0x15accf;return _0x7add51;})[_0xa51a('0x27')](respondWithFilteredResult(_0x4418f1,_0x5c15a))[_0xa51a('0x49')](handleError(_0x4418f1,null));};exports['show']=function(_0x211ffe,_0x148f61){var _0x63c30a={'raw':![],'where':{'id':_0x211ffe[_0xa51a('0x4a')]['id']}},_0x50b332={};_0x50b332[_0xa51a('0x38')]=_['keys'](db[_0xa51a('0x30')][_0xa51a('0x31')]);_0x50b332['query']=_[_0xa51a('0x35')](_0x211ffe['query']);_0x50b332[_0xa51a('0x36')]=_['intersection'](_0x50b332[_0xa51a('0x38')],_0x50b332[_0xa51a('0x39')]);_0x63c30a[_0xa51a('0x4b')]=_[_0xa51a('0x37')](_0x50b332[_0xa51a('0x38')],qs[_0xa51a('0x3a')](_0x211ffe['query'][_0xa51a('0x3a')]));_0x63c30a[_0xa51a('0x4b')]=_0x63c30a['attributes']['length']?_0x63c30a[_0xa51a('0x4b')]:_0x50b332['model'];if(_0x211ffe[_0xa51a('0x39')]['includeAll']){_0x63c30a[_0xa51a('0x46')]=[{'all':!![]}];}_0x63c30a=_[_0xa51a('0x42')]({},_0x63c30a,_0x211ffe[_0xa51a('0x44')]);return db['VoiceMusicOnHold']['find'](_0x63c30a)[_0xa51a('0x27')](handleEntityNotFound(_0x148f61,null))[_0xa51a('0x27')](respondWithResult(_0x148f61,null))[_0xa51a('0x49')](handleError(_0x148f61,null));};exports[_0xa51a('0x25')]=function(_0x9bbc13,_0x21901d){if(_0x9bbc13['body']['id']){delete _0x9bbc13[_0xa51a('0x4c')]['id'];}return db['VoiceMusicOnHold'][_0xa51a('0x4d')]({'where':{'id':_0x9bbc13['params']['id']}})[_0xa51a('0x27')](handleEntityNotFound(_0x21901d,null))[_0xa51a('0x27')](saveUpdates(_0x9bbc13[_0xa51a('0x4c')],null))[_0xa51a('0x27')](respondWithResult(_0x21901d,null))[_0xa51a('0x49')](handleError(_0x21901d,null));};exports['create']=function(_0x1b8487,_0xa41127,_0x2c894f){return db[_0xa51a('0x4e')]['transaction'](function(_0x53e382){if(_0x1b8487[_0xa51a('0x4c')]['mode']===_0xa51a('0x4f')){_0x1b8487[_0xa51a('0x4c')]['directory']=path[_0xa51a('0x50')](config[_0xa51a('0x51')],_0xa51a('0x52'),_0x1b8487[_0xa51a('0x4c')]['name']);}return db[_0xa51a('0x30')][_0xa51a('0x53')](_0x1b8487[_0xa51a('0x4c')],{'transaction':_0x53e382})[_0xa51a('0x27')](function(_0x16750b){if(_0x1b8487[_0xa51a('0x4c')][_0xa51a('0x54')]==='files'){fs['mkdirSync'](_0x16750b[_0xa51a('0x55')],parseInt('0777',0x8));}var _0x591aa8=_0x1b8487['user'][_0xa51a('0x28')]({'plain':!![]});if(!_0x591aa8)throw new Error(_0xa51a('0x56'));if(_0x591aa8[_0xa51a('0x57')]===_0xa51a('0x58')){var _0x44b3b5=_0x16750b[_0xa51a('0x28')]({'plain':!![]});return db['UserProfileSection'][_0xa51a('0x4d')]({'where':{'name':_0xa51a('0x29'),'userProfileId':_0x591aa8[_0xa51a('0x59')]},'raw':!![]})['then'](function(_0x3f7763){if(_0x3f7763&&_0x3f7763[_0xa51a('0x5a')]===0x0){return db[_0xa51a('0x5b')][_0xa51a('0x53')]({'name':_0x44b3b5[_0xa51a('0x2c')],'resourceId':_0x44b3b5['id'],'type':_0x3f7763[_0xa51a('0x2c')],'sectionId':_0x3f7763['id']},{})['then'](function(){return _0x16750b;});}else{return _0x16750b;}})[_0xa51a('0x49')](function(_0x1f5224){logger[_0xa51a('0x2a')](_0xa51a('0x5c'),_0x1f5224);});}return _0x16750b;});})['then'](respondWithResult(_0xa41127,0xc9))[_0xa51a('0x49')](handleError(_0xa41127,null));};exports[_0xa51a('0x26')]=function(_0x408b84,_0x55b2ae,_0x40bfc2){var _0x5dcef9;return db['VoiceMusicOnHold']['find']({'where':{'id':_0x408b84[_0xa51a('0x4a')]['id']}})[_0xa51a('0x27')](function(_0x40f402){if(_0x40f402){return db[_0xa51a('0x4e')][_0xa51a('0x5d')](function(_0x258016){return _0x40f402[_0xa51a('0x26')]({'transaction':_0x258016,'raw':!![]})[_0xa51a('0x27')](function(_0x33b22){if(_0x33b22[_0xa51a('0x55')]){fs[_0xa51a('0x5e')](_0x33b22['directory'])[_0xa51a('0x5f')](function(_0x5befe8){fs[_0xa51a('0x60')](path[_0xa51a('0x50')](_0x33b22[_0xa51a('0x55')],_0x5befe8));});fs[_0xa51a('0x61')](_0x33b22['directory']);}return _0x33b22;});})[_0xa51a('0x49')](function(_0x5eadcd){throw new db[(_0xa51a('0x62'))][(_0xa51a('0x63'))](_0x5eadcd[_0xa51a('0x64')]);});}})[_0xa51a('0x27')](handleEntityNotFound(_0x55b2ae,null))[_0xa51a('0x27')](removeEntity(_0x55b2ae,null))[_0xa51a('0x49')](handleError(_0x55b2ae,null));};exports['addSound']=function(_0x530e85,_0x522850,_0x55187e){return db[_0xa51a('0x4e')][_0xa51a('0x5d')](function(_0x18361c){var _0x595a67;return db[_0xa51a('0x30')][_0xa51a('0x4d')]({'where':{'id':_0x530e85[_0xa51a('0x4a')]['id']}})[_0xa51a('0x27')](function(_0x41254c){if(_0x41254c){_0x595a67=_0x41254c;return _0x41254c[_0xa51a('0x65')](_0x530e85[_0xa51a('0x4c')]['id'],{'transaction':_0x18361c});}})[_0xa51a('0x27')](function(_0x3c67be){if(_0x3c67be){return db['Sound'][_0xa51a('0x66')]({'where':{'id':_0x530e85[_0xa51a('0x4c')]['id']},'attributes':['id',_0xa51a('0x2c'),_0xa51a('0x67'),_0xa51a('0x68'),'createdAt'],'raw':!![]});}})[_0xa51a('0x27')](function(_0x328fd9){if(_0x328fd9){var _0x22c335=path[_0xa51a('0x50')](config['root'],_0xa51a('0x69'),util[_0xa51a('0x6a')]('%s.%s',path['basename'](_0x328fd9['save_name'],path[_0xa51a('0x6b')](_0x328fd9[_0xa51a('0x67')])),_0x328fd9[_0xa51a('0x68')]));var _0x4fefda=path[_0xa51a('0x50')](config[_0xa51a('0x51')],_0xa51a('0x52'),_0x595a67['name'],util['format']('%s.%s',_0x328fd9['name'],_0x328fd9[_0xa51a('0x68')]));fs[_0xa51a('0x6c')](_0x22c335,_0x4fefda);return _0x328fd9;}})['catch'](function(_0x290007){throw new db['Sequelize'][(_0xa51a('0x63'))](_0x290007[_0xa51a('0x64')]);});})[_0xa51a('0x27')](handleEntityNotFound(_0x522850,null))[_0xa51a('0x27')](respondWithResult(_0x522850,0xc9))[_0xa51a('0x49')](handleError(_0x522850,null));};exports['removeSound']=function(_0x2e0621,_0x16ed5b,_0x5a12d4){return db['sequelize'][_0xa51a('0x5d')](function(_0x38b7d1){var _0x4d02cd;return db['VoiceMusicOnHold']['findOne']({'where':{'id':_0x2e0621[_0xa51a('0x4a')]['id']}})[_0xa51a('0x27')](handleEntityNotFound(_0x16ed5b,null))[_0xa51a('0x27')](function(_0x49fede){if(_0x49fede){_0x4d02cd=_0x49fede;return _0x49fede[_0xa51a('0x6d')](_0x2e0621[_0xa51a('0x4a')][_0xa51a('0x6e')]);}})[_0xa51a('0x27')](function(_0x1ffbc3){if(_0x1ffbc3){return db['Sound'][_0xa51a('0x66')]({'where':{'id':_0x2e0621[_0xa51a('0x4a')][_0xa51a('0x6e')]},'attributes':['id','name',_0xa51a('0x67'),_0xa51a('0x68'),_0xa51a('0x6f')],'raw':!![]});}})['then'](function(_0x586b65){if(_0x586b65){fs[_0xa51a('0x60')](path[_0xa51a('0x50')](_0x4d02cd[_0xa51a('0x55')],util['format'](_0xa51a('0x70'),_0x586b65[_0xa51a('0x2c')],_0x586b65[_0xa51a('0x68')])));return _0x586b65;}})[_0xa51a('0x49')](function(_0x1db716){throw new db[(_0xa51a('0x62'))]['ValidationError'](_0x1db716[_0xa51a('0x64')]);});})[_0xa51a('0x27')](handleEntityNotFound(_0x16ed5b,null))[_0xa51a('0x27')](respondWithStatusCode(_0x16ed5b,0xcc))[_0xa51a('0x49')](handleError(_0x16ed5b,null));};exports[_0xa51a('0x71')]=function(_0x1a1746,_0xd60f5d,_0x4ec163){var _0x36f8f6={};var _0x2eb817={};var _0x59db04;var _0x2b29e9;return db[_0xa51a('0x30')][_0xa51a('0x66')]({'where':{'id':_0x1a1746[_0xa51a('0x4a')]['id']}})[_0xa51a('0x27')](handleEntityNotFound(_0xd60f5d,null))[_0xa51a('0x27')](function(_0x5c2bfb){if(_0x5c2bfb){_0x59db04=_0x5c2bfb;_0x2eb817[_0xa51a('0x38')]=_[_0xa51a('0x35')](db[_0xa51a('0x72')][_0xa51a('0x31')]);_0x2eb817['query']=_[_0xa51a('0x35')](_0x1a1746[_0xa51a('0x39')]);_0x2eb817['filters']=_['intersection'](_0x2eb817[_0xa51a('0x38')],_0x2eb817['query']);_0x36f8f6['attributes']=_[_0xa51a('0x37')](_0x2eb817['model'],qs[_0xa51a('0x3a')](_0x1a1746[_0xa51a('0x39')]['fields']));_0x36f8f6['attributes']=_0x36f8f6['attributes'][_0xa51a('0x3b')]?_0x36f8f6['attributes']:_0x2eb817['model'];_0x36f8f6[_0xa51a('0x3e')]=qs['sort'](_0x1a1746[_0xa51a('0x39')]['sort']);_0x36f8f6[_0xa51a('0x40')]=qs[_0xa51a('0x36')](_[_0xa51a('0x73')](_0x1a1746[_0xa51a('0x39')],_0x2eb817[_0xa51a('0x36')]));if(_0x1a1746[_0xa51a('0x39')][_0xa51a('0x41')]){_0x36f8f6['where']=_[_0xa51a('0x42')](_0x36f8f6[_0xa51a('0x40')],{'$or':_[_0xa51a('0x2f')](_0x36f8f6[_0xa51a('0x4b')],function(_0x21efdf){var _0x30553f={};_0x30553f[_0x21efdf]={'$like':'%'+_0x1a1746['query'][_0xa51a('0x41')]+'%'};return _0x30553f;})});}_0x36f8f6=_[_0xa51a('0x42')]({},_0x36f8f6,_0x1a1746[_0xa51a('0x44')]);return _0x59db04[_0xa51a('0x71')](_0x36f8f6);}})[_0xa51a('0x27')](function(_0x25aa54){if(_0x25aa54){_0x2b29e9=_0x25aa54[_0xa51a('0x3b')];if(!_0x1a1746[_0xa51a('0x39')][_0xa51a('0x3c')](_0xa51a('0x3d'))){_0x36f8f6[_0xa51a('0x1c')]=qs[_0xa51a('0x1c')](_0x1a1746[_0xa51a('0x39')][_0xa51a('0x1c')]);_0x36f8f6[_0xa51a('0x1b')]=qs['offset'](_0x1a1746[_0xa51a('0x39')]['offset']);}return _0x59db04['getSounds'](_0x36f8f6);}})[_0xa51a('0x27')](function(_0xd2fc19){if(_0xd2fc19){return _0xd2fc19?{'count':_0x2b29e9,'rows':_0xd2fc19}:null;}})[_0xa51a('0x27')](respondWithResult(_0xd60f5d,null))[_0xa51a('0x49')](handleError(_0xd60f5d,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index 26b21f9..d042f25 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 _0xa0cf=['./voiceMusicOnHold.attributes','exports','define','voice_musiconhold','lodash','util','../../config/logger','api','moment','path','../../config/environment'];(function(_0x278787,_0x50e874){var _0x3430ab=function(_0x575ddb){while(--_0x575ddb){_0x278787['push'](_0x278787['shift']());}};_0x3430ab(++_0x50e874);}(_0xa0cf,0x164));var _0xfa0c=function(_0xdee7ec,_0x29d552){_0xdee7ec=_0xdee7ec-0x0;var _0x1879b6=_0xa0cf[_0xdee7ec];return _0x1879b6;};'use strict';var _=require(_0xfa0c('0x0'));var util=require(_0xfa0c('0x1'));var logger=require(_0xfa0c('0x2'))(_0xfa0c('0x3'));var moment=require(_0xfa0c('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xfa0c('0x5'));var rimraf=require('rimraf');var config=require(_0xfa0c('0x6'));var attributes=require(_0xfa0c('0x7'));module[_0xfa0c('0x8')]=function(_0x59a554,_0x27d9f7){return _0x59a554[_0xfa0c('0x9')]('VoiceMusicOnHold',attributes,{'tableName':_0xfa0c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6ed1=['rimraf','../../config/environment','./voiceMusicOnHold.attributes','exports','define','VoiceMusicOnHold','voice_musiconhold','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x565ed7,_0x398228){var _0x183ad7=function(_0x5a43d7){while(--_0x5a43d7){_0x565ed7['push'](_0x565ed7['shift']());}};_0x183ad7(++_0x398228);}(_0x6ed1,0x85));var _0x16ed=function(_0x4342f0,_0x3009c8){_0x4342f0=_0x4342f0-0x0;var _0x5ce9f0=_0x6ed1[_0x4342f0];return _0x5ce9f0;};'use strict';var _=require('lodash');var util=require(_0x16ed('0x0'));var logger=require(_0x16ed('0x1'))(_0x16ed('0x2'));var moment=require(_0x16ed('0x3'));var BPromise=require(_0x16ed('0x4'));var rp=require(_0x16ed('0x5'));var fs=require('fs');var path=require(_0x16ed('0x6'));var rimraf=require(_0x16ed('0x7'));var config=require(_0x16ed('0x8'));var attributes=require(_0x16ed('0x9'));module[_0x16ed('0xa')]=function(_0x4c24aa,_0x5b7aeb){return _0x4c24aa[_0x16ed('0xb')](_0x16ed('0xc'),attributes,{'tableName':_0x16ed('0xd'),'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 283083e..c20ff18 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 _0xcb91=['stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s'];(function(_0x5726aa,_0x551bec){var _0xd967ab=function(_0x3ca624){while(--_0x3ca624){_0x5726aa['push'](_0x5726aa['shift']());}};_0xd967ab(++_0x551bec);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x35f7f5,_0x4e2ee1){_0x35f7f5=_0x35f7f5-0x0;var _0x5567a4=_0xcb91[_0x35f7f5];return _0x5567a4;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cb9('0x0'));var BPromise=require(_0x1cb9('0x1'));var rs=require(_0x1cb9('0x2'));var fs=require('fs');var Redis=require(_0x1cb9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1cb9('0x4'));var logger=require(_0x1cb9('0x5'))('rpc');var config=require(_0x1cb9('0x6'));var jayson=require(_0x1cb9('0x7'));var client=jayson['client'][_0x1cb9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f7deb,_0x4ffe20,_0x38737d){return new BPromise(function(_0x12567c,_0x59d1be){return client[_0x1cb9('0x9')](_0x3f7deb,_0x38737d)['then'](function(_0x567139){logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,_0x1cb9('0xc'));logger[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x4ffe20,'request\x20sent',JSON[_0x1cb9('0xf')](_0x567139));if(_0x567139[_0x1cb9('0x10')]){if(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x11')]===0x1f4){logger[_0x1cb9('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x4ffe20,_0x567139['error']['message']);return _0x59d1be(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x567139['error'][_0x1cb9('0x12')]);return _0x12567c(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}else{logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,'request\x20sent');_0x12567c(_0x567139['result'][_0x1cb9('0x12')]);}})[_0x1cb9('0x13')](function(_0x3904b7){logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x3904b7);_0x59d1be(_0x3904b7);});});} \ No newline at end of file +var _0x0713=['VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\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(_0x5861eb,_0x1a1176){var _0x4d4d0e=function(_0x290d46){while(--_0x290d46){_0x5861eb['push'](_0x5861eb['shift']());}};_0x4d4d0e(++_0x1a1176);}(_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')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec['error'][_0x3071('0x15')]);return _0x3e9a5e(_0x4a36ec['error'][_0x3071('0x15')]);}logger[_0x3071('0x13')]('VoiceMusicOnHold,\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')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2f1e87,_0x21aad3);_0x3e9a5e(_0x21aad3);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index c2b3ec3..3f6e328 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 _0xd694=['removeAgents','removeTeams','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./voicePrefix.controller','isAuthenticated','index','get','/describe','describe','/:id','show','getAgents','/:id/teams','getTeams','post','create','/:id/users','addAgents','put','update','delete'];(function(_0x49465c,_0x27f01b){var _0x22469f=function(_0x27cfd2){while(--_0x27cfd2){_0x49465c['push'](_0x49465c['shift']());}};_0x22469f(++_0x27f01b);}(_0xd694,0x11b));var _0x4d69=function(_0x1c28d2,_0x1e77f7){_0x1c28d2=_0x1c28d2-0x0;var _0x5aa5b3=_0xd694[_0x1c28d2];return _0x5aa5b3;};'use strict';var multer=require(_0x4d69('0x0'));var util=require('util');var path=require(_0x4d69('0x1'));var timeout=require(_0x4d69('0x2'));var express=require(_0x4d69('0x3'));var router=express[_0x4d69('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x4d69('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4d69('0x6'));var controller=require(_0x4d69('0x7'));router['get']('/',auth[_0x4d69('0x8')](),controller[_0x4d69('0x9')]);router[_0x4d69('0xa')](_0x4d69('0xb'),auth['isAuthenticated'](),controller[_0x4d69('0xc')]);router['get'](_0x4d69('0xd'),auth[_0x4d69('0x8')](),controller[_0x4d69('0xe')]);router['get']('/:id/users',auth[_0x4d69('0x8')](),controller[_0x4d69('0xf')]);router[_0x4d69('0xa')](_0x4d69('0x10'),auth[_0x4d69('0x8')](),controller[_0x4d69('0x11')]);router[_0x4d69('0x12')]('/',auth[_0x4d69('0x8')](),controller[_0x4d69('0x13')]);router['post'](_0x4d69('0x14'),auth[_0x4d69('0x8')](),controller[_0x4d69('0x15')]);router[_0x4d69('0x12')](_0x4d69('0x10'),auth[_0x4d69('0x8')](),controller['addTeams']);router[_0x4d69('0x16')]('/:id',auth[_0x4d69('0x8')](),controller[_0x4d69('0x17')]);router[_0x4d69('0x18')](_0x4d69('0xd'),auth[_0x4d69('0x8')](),controller['destroy']);router[_0x4d69('0x18')](_0x4d69('0x14'),auth[_0x4d69('0x8')](),controller[_0x4d69('0x19')]);router[_0x4d69('0x18')](_0x4d69('0x10'),auth[_0x4d69('0x8')](),controller[_0x4d69('0x1a')]);module[_0x4d69('0x1b')]=router; \ No newline at end of file +var _0x867f=['get','isAuthenticated','index','/describe','describe','show','/:id/users','getAgents','/:id/teams','create','post','addAgents','addTeams','put','/:id','update','destroy','delete','removeTeams','multer','util','path','connect-timeout','express','Router','fs-extra','./voicePrefix.controller'];(function(_0x5a6644,_0x45d612){var _0x3a2a5d=function(_0x54159e){while(--_0x54159e){_0x5a6644['push'](_0x5a6644['shift']());}};_0x3a2a5d(++_0x45d612);}(_0x867f,0x7f));var _0xf867=function(_0x2fdee1,_0x466858){_0x2fdee1=_0x2fdee1-0x0;var _0x2c5533=_0x867f[_0x2fdee1];return _0x2c5533;};'use strict';var multer=require(_0xf867('0x0'));var util=require(_0xf867('0x1'));var path=require(_0xf867('0x2'));var timeout=require(_0xf867('0x3'));var express=require(_0xf867('0x4'));var router=express[_0xf867('0x5')]();var fs_extra=require(_0xf867('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf867('0x7'));router[_0xf867('0x8')]('/',auth[_0xf867('0x9')](),controller[_0xf867('0xa')]);router['get'](_0xf867('0xb'),auth[_0xf867('0x9')](),controller[_0xf867('0xc')]);router[_0xf867('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xf867('0xd')]);router[_0xf867('0x8')](_0xf867('0xe'),auth['isAuthenticated'](),controller[_0xf867('0xf')]);router['get'](_0xf867('0x10'),auth[_0xf867('0x9')](),controller['getTeams']);router['post']('/',auth[_0xf867('0x9')](),controller[_0xf867('0x11')]);router[_0xf867('0x12')]('/:id/users',auth[_0xf867('0x9')](),controller[_0xf867('0x13')]);router[_0xf867('0x12')](_0xf867('0x10'),auth[_0xf867('0x9')](),controller[_0xf867('0x14')]);router[_0xf867('0x15')](_0xf867('0x16'),auth['isAuthenticated'](),controller[_0xf867('0x17')]);router['delete'](_0xf867('0x16'),auth[_0xf867('0x9')](),controller[_0xf867('0x18')]);router[_0xf867('0x19')]('/:id/users',auth[_0xf867('0x9')](),controller['removeAgents']);router[_0xf867('0x19')]('/:id/teams',auth[_0xf867('0x9')](),controller[_0xf867('0x1a')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index 7229534..4e3f3e0 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 _0x9c29=['system-','getDataValue','name','INTEGER','sequelize','STRING'];(function(_0x521599,_0x12ebc1){var _0x47e8e8=function(_0x28ade9){while(--_0x28ade9){_0x521599['push'](_0x521599['shift']());}};_0x47e8e8(++_0x12ebc1);}(_0x9c29,0xee));var _0x99c2=function(_0x52f652,_0x71f6c7){_0x52f652=_0x52f652-0x0;var _0x176100=_0x9c29[_0x52f652];return _0x176100;};'use strict';var Sequelize=require(_0x99c2('0x0'));module['exports']={'name':{'type':Sequelize[_0x99c2('0x1')],'allowNull':![],'unique':'name'},'prefix':{'type':Sequelize['VIRTUAL'],'get':function(_0x1db4b3){return _0x99c2('0x2')+this[_0x99c2('0x3')](_0x99c2('0x4'))+'-';}},'description':{'type':Sequelize['STRING']},'callerIdAll':{'type':Sequelize[_0x99c2('0x1')]},'VoiceExtensionId':{'type':Sequelize[_0x99c2('0x5')]}}; \ No newline at end of file +var _0x90d9=['system-','getDataValue','INTEGER','exports','STRING','name'];(function(_0x5f49c0,_0x27a1b4){var _0x5ab653=function(_0x4de962){while(--_0x4de962){_0x5f49c0['push'](_0x5f49c0['shift']());}};_0x5ab653(++_0x27a1b4);}(_0x90d9,0xdb));var _0x990d=function(_0x1605ca,_0x3efd44){_0x1605ca=_0x1605ca-0x0;var _0x29812c=_0x90d9[_0x1605ca];return _0x29812c;};'use strict';var Sequelize=require('sequelize');module[_0x990d('0x0')]={'name':{'type':Sequelize[_0x990d('0x1')],'allowNull':![],'unique':_0x990d('0x2')},'prefix':{'type':Sequelize['VIRTUAL'],'get':function(_0x21d0b7){return _0x990d('0x3')+this[_0x990d('0x4')](_0x990d('0x2'))+'-';}},'description':{'type':Sequelize['STRING']},'callerIdAll':{'type':Sequelize[_0x990d('0x1')]},'VoiceExtensionId':{'type':Sequelize[_0x990d('0x5')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index e1de67c..9215d50 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 _0x4fc2=['set','save','update','then','get','VoicePrefixes','UserProfileResource','destroy','stack','name','send','index','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','limit','order','sort','pick','filter','where','merge','VIRTUAL','options','VoicePrefix','include','findAll','rows','catch','show','params','length','find','describe','sequelize','transaction','create','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','from-sip','exten','system','description','Voice\x20Prefix\x20Extension','priority','NoOp','Voice\x20Prefix','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','prefix','push','Set','CDR(prefix)=','callerIdAll','No\x20callerid\x20available','goto','context','charAt','body','findById','addAgents','omit','spread','ids','emit','userVoicePrefix:save','removeAgents','userVoicePrefix:remove','getAgents','nolimit','getTeams','Team','addTeams','Agents','online','voicePause','interface','findOrCreate','forEach','removeTeams','User','select','field','team_has_voice_prefixes','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./voicePrefix.socket','sendStatus','end','status','json','offset','undefined','count'];(function(_0x154a93,_0xf11b03){var _0x330c47=function(_0x4c01a6){while(--_0x4c01a6){_0x154a93['push'](_0x154a93['shift']());}};_0x330c47(++_0xf11b03);}(_0x4fc2,0x111));var _0x24fc=function(_0x1a79c6,_0x5bad0b){_0x1a79c6=_0x1a79c6-0x0;var _0x301647=_0x4fc2[_0x1a79c6];return _0x301647;};'use strict';var emlformat=require(_0x24fc('0x0'));var rimraf=require(_0x24fc('0x1'));var zipdir=require(_0x24fc('0x2'));var jsonpatch=require(_0x24fc('0x3'));var rp=require('request-promise');var moment=require(_0x24fc('0x4'));var BPromise=require(_0x24fc('0x5'));var Mustache=require(_0x24fc('0x6'));var util=require('util');var path=require(_0x24fc('0x7'));var sox=require(_0x24fc('0x8'));var csv=require('to-csv');var ejs=require(_0x24fc('0x9'));var fs=require('fs');var fs_extra=require(_0x24fc('0xa'));var _=require('lodash');var squel=require(_0x24fc('0xb'));var crypto=require(_0x24fc('0xc'));var jsforce=require(_0x24fc('0xd'));var deskjs=require(_0x24fc('0xe'));var toCsv=require(_0x24fc('0xf'));var querystring=require(_0x24fc('0x10'));var Papa=require('papaparse');var Redis=require(_0x24fc('0x11'));var authService=require(_0x24fc('0x12'));var qs=require(_0x24fc('0x13'));var as=require(_0x24fc('0x14'));var hardwareService=require(_0x24fc('0x15'));var logger=require(_0x24fc('0x16'))(_0x24fc('0x17'));var utils=require(_0x24fc('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x24fc('0x19'));var db=require(_0x24fc('0x1a'))['db'];config['redis']=_[_0x24fc('0x1b')](config[_0x24fc('0x1c')],{'host':_0x24fc('0x1d'),'port':0x18eb});var socket=require(_0x24fc('0x1e'))(new Redis(config[_0x24fc('0x1c')]));require(_0x24fc('0x1f'))['register'](socket);function respondWithStatusCode(_0x2a0971,_0x18c0a7){_0x18c0a7=_0x18c0a7||0xcc;return function(_0x2ffed3){if(_0x2ffed3){return _0x2a0971[_0x24fc('0x20')](_0x18c0a7);}return _0x2a0971['status'](_0x18c0a7)[_0x24fc('0x21')]();};}function respondWithResult(_0x588543,_0x4af098){_0x4af098=_0x4af098||0xc8;return function(_0x3385c7){if(_0x3385c7){return _0x588543[_0x24fc('0x22')](_0x4af098)[_0x24fc('0x23')](_0x3385c7);}};}function respondWithFilteredResult(_0x25cb40,_0x52a884){return function(_0x23873c){if(_0x23873c){var _0x1cb3d0=typeof _0x52a884[_0x24fc('0x24')]===_0x24fc('0x25')&&typeof _0x52a884['limit']===_0x24fc('0x25');var _0x4073e0=_0x23873c[_0x24fc('0x26')];var _0x5b0516=_0x1cb3d0?0x0:_0x52a884[_0x24fc('0x24')];var _0x36a771=_0x1cb3d0?_0x23873c[_0x24fc('0x26')]:_0x52a884[_0x24fc('0x24')]+_0x52a884['limit'];var _0x323beb;if(_0x36a771>=_0x4073e0){_0x36a771=_0x4073e0;_0x323beb=0xc8;}else{_0x323beb=0xce;}_0x25cb40['status'](_0x323beb);return _0x25cb40[_0x24fc('0x27')]('Content-Range',_0x5b0516+'-'+_0x36a771+'/'+_0x4073e0)[_0x24fc('0x23')](_0x23873c);}return null;};}function patchUpdates(_0x44c121){return function(_0x2ffade){try{jsonpatch['apply'](_0x2ffade,_0x44c121,!![]);}catch(_0x313a25){return BPromise['reject'](_0x313a25);}return _0x2ffade[_0x24fc('0x28')]();};}function saveUpdates(_0x2bb93a,_0x36a9b4){return function(_0x34b5b2){if(_0x34b5b2){return _0x34b5b2[_0x24fc('0x29')](_0x2bb93a)[_0x24fc('0x2a')](function(_0x3f0875){return _0x3f0875;});}return null;};}function removeEntity(_0x20192b,_0x168d98){return function(_0x2a5c4b){if(_0x2a5c4b){return _0x2a5c4b['destroy']()[_0x24fc('0x2a')](function(){var _0x16f27f=_0x2a5c4b[_0x24fc('0x2b')]({'plain':!![]});var _0x5bb4c8=_0x24fc('0x2c');return db[_0x24fc('0x2d')][_0x24fc('0x2e')]({'where':{'type':_0x5bb4c8,'resourceId':_0x16f27f['id']}})[_0x24fc('0x2a')](function(){return _0x2a5c4b;});})[_0x24fc('0x2a')](function(){_0x20192b[_0x24fc('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x240ae7,_0x29a461){return function(_0x3c99ed){if(!_0x3c99ed){_0x240ae7[_0x24fc('0x20')](0x194);}return _0x3c99ed;};}function handleError(_0x9f7bbc,_0x490aa5){_0x490aa5=_0x490aa5||0x1f4;return function(_0x55c27f){logger['error'](_0x55c27f[_0x24fc('0x2f')]);if(_0x55c27f['name']){delete _0x55c27f[_0x24fc('0x30')];}_0x9f7bbc[_0x24fc('0x22')](_0x490aa5)[_0x24fc('0x31')](_0x55c27f);};}exports[_0x24fc('0x32')]=function(_0x4dbd52,_0x66eec0){var _0x33f368={},_0x523c1f={},_0xf46cd5={'count':0x0,'rows':[]};var _0x1b174d=_['map'](db['VoicePrefix'][_0x24fc('0x33')],function(_0x56eae7){return{'name':_0x56eae7[_0x24fc('0x34')],'type':_0x56eae7[_0x24fc('0x35')]['key']};});_0x523c1f[_0x24fc('0x36')]=_[_0x24fc('0x37')](_0x1b174d,_0x24fc('0x30'));_0x523c1f[_0x24fc('0x38')]=_[_0x24fc('0x39')](_0x4dbd52[_0x24fc('0x38')]);_0x523c1f[_0x24fc('0x3a')]=_[_0x24fc('0x3b')](_0x523c1f[_0x24fc('0x36')],_0x523c1f['query']);_0x33f368[_0x24fc('0x3c')]=_[_0x24fc('0x3b')](_0x523c1f[_0x24fc('0x36')],qs[_0x24fc('0x3d')](_0x4dbd52[_0x24fc('0x38')]['fields']));_0x33f368['attributes']=_0x33f368[_0x24fc('0x3c')]['length']?_0x33f368[_0x24fc('0x3c')]:_0x523c1f[_0x24fc('0x36')];if(!_0x4dbd52[_0x24fc('0x38')][_0x24fc('0x3e')]('nolimit')){_0x33f368[_0x24fc('0x3f')]=qs['limit'](_0x4dbd52[_0x24fc('0x38')][_0x24fc('0x3f')]);_0x33f368[_0x24fc('0x24')]=qs[_0x24fc('0x24')](_0x4dbd52[_0x24fc('0x38')]['offset']);}_0x33f368[_0x24fc('0x40')]=qs[_0x24fc('0x41')](_0x4dbd52[_0x24fc('0x38')][_0x24fc('0x41')]);_0x33f368['where']=qs[_0x24fc('0x3a')](_[_0x24fc('0x42')](_0x4dbd52['query'],_0x523c1f[_0x24fc('0x3a')]),_0x1b174d);if(_0x4dbd52['query'][_0x24fc('0x43')]){_0x33f368[_0x24fc('0x44')]=_[_0x24fc('0x45')](_0x33f368[_0x24fc('0x44')],{'$or':_[_0x24fc('0x37')](_0x1b174d,function(_0x278b18){if(_0x278b18[_0x24fc('0x35')]!==_0x24fc('0x46')){var _0x4a18bb={};_0x4a18bb[_0x278b18[_0x24fc('0x30')]]={'$like':'%'+_0x4dbd52[_0x24fc('0x38')][_0x24fc('0x43')]+'%'};return _0x4a18bb;}})});}_0x33f368=_['merge']({},_0x33f368,_0x4dbd52[_0x24fc('0x47')]);var _0x1e3b52={'where':_0x33f368['where']};return db[_0x24fc('0x48')][_0x24fc('0x26')](_0x1e3b52)[_0x24fc('0x2a')](function(_0x5e4e9b){_0xf46cd5[_0x24fc('0x26')]=_0x5e4e9b;if(_0x4dbd52[_0x24fc('0x38')]['includeAll']){_0x33f368[_0x24fc('0x49')]=[{'all':!![]}];}return db[_0x24fc('0x48')][_0x24fc('0x4a')](_0x33f368);})[_0x24fc('0x2a')](function(_0x4c8dad){_0xf46cd5[_0x24fc('0x4b')]=_0x4c8dad;return _0xf46cd5;})[_0x24fc('0x2a')](respondWithFilteredResult(_0x66eec0,_0x33f368))[_0x24fc('0x4c')](handleError(_0x66eec0,null));};exports[_0x24fc('0x4d')]=function(_0xbcbcfa,_0x58a950){var _0x2a27e6={'raw':![],'where':{'id':_0xbcbcfa[_0x24fc('0x4e')]['id']}},_0x1b9c90={};_0x1b9c90[_0x24fc('0x36')]=_['keys'](db[_0x24fc('0x48')][_0x24fc('0x33')]);_0x1b9c90['query']=_['keys'](_0xbcbcfa[_0x24fc('0x38')]);_0x1b9c90['filters']=_['intersection'](_0x1b9c90[_0x24fc('0x36')],_0x1b9c90['query']);_0x2a27e6[_0x24fc('0x3c')]=_[_0x24fc('0x3b')](_0x1b9c90[_0x24fc('0x36')],qs['fields'](_0xbcbcfa[_0x24fc('0x38')][_0x24fc('0x3d')]));_0x2a27e6[_0x24fc('0x3c')]=_0x2a27e6[_0x24fc('0x3c')][_0x24fc('0x4f')]?_0x2a27e6[_0x24fc('0x3c')]:_0x1b9c90[_0x24fc('0x36')];if(_0xbcbcfa[_0x24fc('0x38')]['includeAll']){_0x2a27e6['include']=[{'all':!![]}];}_0x2a27e6=_[_0x24fc('0x45')]({},_0x2a27e6,_0xbcbcfa[_0x24fc('0x47')]);return db[_0x24fc('0x48')]['find'](_0x2a27e6)['then'](handleEntityNotFound(_0x58a950,null))[_0x24fc('0x2a')](respondWithResult(_0x58a950,null))[_0x24fc('0x4c')](handleError(_0x58a950,null));};exports[_0x24fc('0x2e')]=function(_0x134f64,_0x21f8b8){return db[_0x24fc('0x48')][_0x24fc('0x50')]({'where':{'id':_0x134f64[_0x24fc('0x4e')]['id']}})[_0x24fc('0x2a')](handleEntityNotFound(_0x21f8b8,null))[_0x24fc('0x2a')](removeEntity(_0x21f8b8,null))[_0x24fc('0x4c')](handleError(_0x21f8b8,null));};exports[_0x24fc('0x51')]=function(_0x5ec1c0,_0x1c9a28){return db[_0x24fc('0x48')][_0x24fc('0x51')]()[_0x24fc('0x2a')](respondWithResult(_0x1c9a28,null))[_0x24fc('0x4c')](handleError(_0x1c9a28,null));};exports['create']=function(_0x428012,_0x4bf3a8){var _0x2c8f74;return db[_0x24fc('0x52')][_0x24fc('0x53')](function(_0x41ddfb){return db[_0x24fc('0x48')][_0x24fc('0x54')](_0x428012['body'],{'transaction':_0x41ddfb})[_0x24fc('0x2a')](function(_0xc2ba88){_0x2c8f74=_0xc2ba88[_0x24fc('0x2b')]({'plain':!![]});return db[_0x24fc('0x55')][_0x24fc('0x50')]({'where':{'id':_0x2c8f74[_0x24fc('0x56')]},'raw':!![]})['then'](function(_0x36d500){return createVoicePrefixExtensions(_0x2c8f74,_0x36d500,_0x41ddfb);});});})[_0x24fc('0x2a')](function(){var _0x1628b4=_0x428012[_0x24fc('0x57')][_0x24fc('0x2b')]({'plain':!![]});if(!_0x1628b4)throw new Error(_0x24fc('0x58'));if(_0x1628b4[_0x24fc('0x59')]==='user'){var _0xd673f8=_0x2c8f74;return db[_0x24fc('0x5a')]['find']({'where':{'name':_0x24fc('0x2c'),'userProfileId':_0x1628b4[_0x24fc('0x5b')]},'raw':!![]})[_0x24fc('0x2a')](function(_0x2ba959){if(_0x2ba959&&_0x2ba959[_0x24fc('0x5c')]===0x0){return db[_0x24fc('0x2d')]['create']({'name':_0xd673f8[_0x24fc('0x30')],'resourceId':_0xd673f8['id'],'type':_0x2ba959['name'],'sectionId':_0x2ba959['id']},{})[_0x24fc('0x2a')](function(){return _0x2c8f74;});}else{return _0x2c8f74;}})[_0x24fc('0x4c')](function(_0x50e5b0){logger[_0x24fc('0x5d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x50e5b0);throw _0x50e5b0;});}return _0x2c8f74;})[_0x24fc('0x2a')](respondWithResult(_0x4bf3a8,null))['catch'](handleError(_0x4bf3a8,null));};function Extension(_0xdff811,_0x27b612,_0x57daaf,_0x2edef7){this['context']=_0x24fc('0x5e');this[_0x24fc('0x5f')]=_0xdff811;this['app']=_0x57daaf;this[_0x24fc('0x35')]=_0x24fc('0x60');this[_0x24fc('0x61')]=_0x24fc('0x62');this[_0x24fc('0x63')]=_0x27b612;this['appdata']=_0x2edef7;}function createVoicePrefixExtensions(_0x39da59,_0x2f62b0,_0x2d657a){return new BPromise(function(_0x2b5dca,_0x11d0e0){var _0x5e9c03=new Extension(formatPrefixName(_0x39da59['prefix']),0x1,_0x24fc('0x64'),_0x24fc('0x65'));_0x5e9c03['VoicePrefixId']=_0x39da59['id'];return db['VoiceExtension'][_0x24fc('0x54')](_0x5e9c03,{'transaction':_0x2d657a})[_0x24fc('0x2a')](function(_0x28ef6a){var _0x1c47cd=_0x28ef6a['get']({'plain':!![]});var _0x20973d=_[_0x24fc('0x37')](addVoicePrefixExtensions(_0x39da59,_0x2f62b0),function(_0x14427b){_0x14427b[_0x24fc('0x56')]=_0x1c47cd['id'];_0x14427b[_0x24fc('0x66')]=_0x39da59['id'];return _0x14427b;});return db[_0x24fc('0x55')][_0x24fc('0x67')](_0x20973d,{'transaction':_0x2d657a})[_0x24fc('0x2a')](function(_0xbe136e){if(!_0xbe136e){return _0x11d0e0(_0x24fc('0x68'));}else{return _0x2b5dca(_0xbe136e);}})[_0x24fc('0x4c')](function(_0x456690){return _0x11d0e0(_0x456690);});});;});};function addVoicePrefixExtensions(_0x8dbb4a,_0x24ca4b){var _0x354fc6=[];var _0x54ead5=formatPrefixName(_0x8dbb4a[_0x24fc('0x69')]);_0x354fc6[_0x24fc('0x6a')](new Extension(_0x54ead5,0x2,_0x24fc('0x6b'),_0x24fc('0x6c')+_0x8dbb4a[_0x24fc('0x30')]));if(_0x8dbb4a[_0x24fc('0x6d')]){_0x354fc6[_0x24fc('0x6a')](new Extension(_0x54ead5,0x3,_0x24fc('0x6b'),'PREFIX-CALLERIDALL='+_0x8dbb4a[_0x24fc('0x6d')]));}else{_0x354fc6[_0x24fc('0x6a')](new Extension(_0x54ead5,0x3,_0x24fc('0x64'),_0x24fc('0x6e')));}_0x354fc6['push'](new Extension(_0x54ead5,0x4,_0x24fc('0x6f'),_0x24ca4b[_0x24fc('0x70')]+','+'${EXTEN:'+(0x8+_0x8dbb4a['name']['length'])+'}'+','+0x1));return _0x354fc6;}function formatPrefixName(_0x2ae2ac){var _0x698283='_';for(var _0x246ef1=0x0;_0x246ef1<_0x2ae2ac[_0x24fc('0x4f')];_0x246ef1++){if(_0x2ae2ac[_0x24fc('0x71')](_0x246ef1)=='-'){_0x698283+=_0x2ae2ac[_0x24fc('0x71')](_0x246ef1);}else{_0x698283+='['+_0x2ae2ac['charAt'](_0x246ef1)+']';}}_0x698283+='.';return _0x698283;}exports[_0x24fc('0x29')]=function(_0x15e8a3,_0x5a2c09,_0x51b1c0){var _0xfc6b7f=_0x15e8a3[_0x24fc('0x72')];_0xfc6b7f[_0x24fc('0x69')]='system-'+_0xfc6b7f[_0x24fc('0x30')]+'-';return db[_0x24fc('0x52')][_0x24fc('0x53')](function(_0x4f5547){return db['VoicePrefix']['update'](_0xfc6b7f,{'where':{'id':_0xfc6b7f['id']},'transaction':_0x4f5547})['then'](function(){return db['VoiceExtension'][_0x24fc('0x2e')]({'where':{'VoicePrefixId':_0xfc6b7f['id']},'transaction':_0x4f5547})[_0x24fc('0x2a')](function(){return db[_0x24fc('0x55')][_0x24fc('0x50')]({'where':{'id':_0xfc6b7f['VoiceExtensionId']},'raw':!![]})[_0x24fc('0x2a')](function(_0x56dd0b){return createVoicePrefixExtensions(_0xfc6b7f,_0x56dd0b,_0x4f5547);});});});})[_0x24fc('0x2a')](function(){return db['VoicePrefix'][_0x24fc('0x73')](_0xfc6b7f['id']);})[_0x24fc('0x2a')](respondWithResult(_0x5a2c09,null))[_0x24fc('0x4c')](handleError(_0x5a2c09,null));};exports[_0x24fc('0x74')]=function(_0x3c4e2c,_0x291d60,_0x35c5f7){return db['VoicePrefix'][_0x24fc('0x50')]({'where':{'id':_0x3c4e2c[_0x24fc('0x4e')]['id']}})[_0x24fc('0x2a')](handleEntityNotFound(_0x291d60,null))['then'](function(_0x5201e7){if(_0x5201e7){return _0x5201e7[_0x24fc('0x74')](_0x3c4e2c[_0x24fc('0x72')]['ids'],_[_0x24fc('0x75')](_0x3c4e2c[_0x24fc('0x72')],['ids','id'])||{})[_0x24fc('0x76')](function(_0x383503){for(var _0x5249ea=0x0;_0x5249ea<_0x3c4e2c[_0x24fc('0x72')][_0x24fc('0x77')][_0x24fc('0x4f')];_0x5249ea+=0x1){socket[_0x24fc('0x78')](_0x24fc('0x79'),{'UserId':Number(_0x3c4e2c[_0x24fc('0x72')]['ids'][_0x5249ea]),'VoicePrefixId':Number(_0x3c4e2c['params']['id'])});}return _0x383503;});}})[_0x24fc('0x2a')](respondWithResult(_0x291d60,null))['catch'](handleError(_0x291d60,null));};exports[_0x24fc('0x7a')]=function(_0x52d54e,_0x5233c5,_0x436652){return db[_0x24fc('0x48')][_0x24fc('0x50')]({'where':{'id':_0x52d54e[_0x24fc('0x4e')]['id']}})[_0x24fc('0x2a')](handleEntityNotFound(_0x5233c5,null))[_0x24fc('0x2a')](function(_0x44eb26){if(_0x44eb26){return _0x44eb26[_0x24fc('0x7a')](_0x52d54e['query'][_0x24fc('0x77')])[_0x24fc('0x2a')](function(){if(_['isArray'](_0x52d54e['query'][_0x24fc('0x77')])){for(var _0x3cb0b5=0x0;_0x3cb0b5<_0x52d54e[_0x24fc('0x38')][_0x24fc('0x77')][_0x24fc('0x4f')];_0x3cb0b5+=0x1){socket['emit'](_0x24fc('0x7b'),{'UserId':Number(_0x52d54e[_0x24fc('0x38')]['ids'][_0x3cb0b5]),'VoicePrefixId':Number(_0x52d54e[_0x24fc('0x4e')]['id'])});}}else{socket[_0x24fc('0x78')](_0x24fc('0x7b'),{'UserId':Number(_0x52d54e['query'][_0x24fc('0x77')]),'VoicePrefixId':Number(_0x52d54e[_0x24fc('0x4e')]['id'])});}});}})[_0x24fc('0x2a')](respondWithStatusCode(_0x5233c5,null))[_0x24fc('0x4c')](handleError(_0x5233c5,null));};exports[_0x24fc('0x7c')]=function(_0x1ce8cb,_0x17f88a,_0x46b320){var _0x188edb={};var _0x54f379={};var _0x7f4f80;var _0x2921a7;return db[_0x24fc('0x48')]['findOne']({'where':{'id':_0x1ce8cb['params']['id']}})['then'](handleEntityNotFound(_0x17f88a,null))[_0x24fc('0x2a')](function(_0x560c80){if(_0x560c80){_0x7f4f80=_0x560c80;_0x54f379[_0x24fc('0x36')]=_[_0x24fc('0x39')](db['User'][_0x24fc('0x33')]);_0x54f379['query']=_[_0x24fc('0x39')](_0x1ce8cb['query']);_0x54f379[_0x24fc('0x3a')]=_[_0x24fc('0x3b')](_0x54f379[_0x24fc('0x36')],_0x54f379[_0x24fc('0x38')]);_0x188edb[_0x24fc('0x3c')]=_[_0x24fc('0x3b')](_0x54f379['model'],qs[_0x24fc('0x3d')](_0x1ce8cb[_0x24fc('0x38')][_0x24fc('0x3d')]));_0x188edb[_0x24fc('0x3c')]=_0x188edb[_0x24fc('0x3c')][_0x24fc('0x4f')]?_0x188edb[_0x24fc('0x3c')]:_0x54f379[_0x24fc('0x36')];_0x188edb[_0x24fc('0x40')]=qs['sort'](_0x1ce8cb[_0x24fc('0x38')][_0x24fc('0x41')]);_0x188edb[_0x24fc('0x44')]=qs[_0x24fc('0x3a')](_['pick'](_0x1ce8cb[_0x24fc('0x38')],_0x54f379[_0x24fc('0x3a')]));if(_0x1ce8cb[_0x24fc('0x38')]['filter']){_0x188edb[_0x24fc('0x44')]=_['merge'](_0x188edb['where'],{'$or':_['map'](_0x188edb[_0x24fc('0x3c')],function(_0x49c35c){var _0x29f1c1={};_0x29f1c1[_0x49c35c]={'$like':'%'+_0x1ce8cb[_0x24fc('0x38')][_0x24fc('0x43')]+'%'};return _0x29f1c1;})});}_0x188edb=_[_0x24fc('0x45')]({},_0x188edb,_0x1ce8cb['options']);return _0x7f4f80[_0x24fc('0x7c')](_0x188edb);}})[_0x24fc('0x2a')](function(_0x3d8394){if(_0x3d8394){_0x2921a7=_0x3d8394[_0x24fc('0x4f')];if(!_0x1ce8cb[_0x24fc('0x38')]['hasOwnProperty'](_0x24fc('0x7d'))){_0x188edb[_0x24fc('0x3f')]=qs[_0x24fc('0x3f')](_0x1ce8cb[_0x24fc('0x38')]['limit']);_0x188edb['offset']=qs[_0x24fc('0x24')](_0x1ce8cb[_0x24fc('0x38')][_0x24fc('0x24')]);}return _0x7f4f80[_0x24fc('0x7c')](_0x188edb);}})[_0x24fc('0x2a')](function(_0x49e6f2){if(_0x49e6f2){return _0x49e6f2?{'count':_0x2921a7,'rows':_0x49e6f2}:null;}})[_0x24fc('0x2a')](respondWithResult(_0x17f88a,null))[_0x24fc('0x4c')](handleError(_0x17f88a,null));};exports[_0x24fc('0x7e')]=function(_0x5d5a59,_0xa8881f,_0x69a2cd){var _0x437233={};var _0x1e1474={};var _0xc52004;var _0x4c10d9;return db['VoicePrefix']['findOne']({'where':{'id':_0x5d5a59[_0x24fc('0x4e')]['id']}})[_0x24fc('0x2a')](handleEntityNotFound(_0xa8881f,null))[_0x24fc('0x2a')](function(_0x23a033){if(_0x23a033){_0xc52004=_0x23a033;_0x1e1474[_0x24fc('0x36')]=_[_0x24fc('0x39')](db[_0x24fc('0x7f')][_0x24fc('0x33')]);_0x1e1474[_0x24fc('0x38')]=_[_0x24fc('0x39')](_0x5d5a59[_0x24fc('0x38')]);_0x1e1474[_0x24fc('0x3a')]=_['intersection'](_0x1e1474['model'],_0x1e1474[_0x24fc('0x38')]);_0x437233['attributes']=_[_0x24fc('0x3b')](_0x1e1474[_0x24fc('0x36')],qs[_0x24fc('0x3d')](_0x5d5a59[_0x24fc('0x38')][_0x24fc('0x3d')]));_0x437233[_0x24fc('0x3c')]=_0x437233[_0x24fc('0x3c')][_0x24fc('0x4f')]?_0x437233[_0x24fc('0x3c')]:_0x1e1474['model'];_0x437233[_0x24fc('0x40')]=qs[_0x24fc('0x41')](_0x5d5a59['query']['sort']);_0x437233[_0x24fc('0x44')]=qs[_0x24fc('0x3a')](_[_0x24fc('0x42')](_0x5d5a59[_0x24fc('0x38')],_0x1e1474[_0x24fc('0x3a')]));if(_0x5d5a59[_0x24fc('0x38')]['filter']){_0x437233[_0x24fc('0x44')]=_[_0x24fc('0x45')](_0x437233[_0x24fc('0x44')],{'$or':_[_0x24fc('0x37')](_0x437233['attributes'],function(_0x2fb68a){var _0x10519f={};_0x10519f[_0x2fb68a]={'$like':'%'+_0x5d5a59[_0x24fc('0x38')]['filter']+'%'};return _0x10519f;})});}_0x437233=_[_0x24fc('0x45')]({},_0x437233,_0x5d5a59[_0x24fc('0x47')]);return _0xc52004[_0x24fc('0x7e')](_0x437233);}})['then'](function(_0x163a99){if(_0x163a99){_0x4c10d9=_0x163a99[_0x24fc('0x4f')];if(!_0x5d5a59['query']['hasOwnProperty'](_0x24fc('0x7d'))){_0x437233[_0x24fc('0x3f')]=qs[_0x24fc('0x3f')](_0x5d5a59[_0x24fc('0x38')][_0x24fc('0x3f')]);_0x437233[_0x24fc('0x24')]=qs['offset'](_0x5d5a59[_0x24fc('0x38')][_0x24fc('0x24')]);}return _0xc52004[_0x24fc('0x7e')](_0x437233);}})[_0x24fc('0x2a')](function(_0x6f8974){if(_0x6f8974){return _0x6f8974?{'count':_0x4c10d9,'rows':_0x6f8974}:null;}})[_0x24fc('0x2a')](respondWithResult(_0xa8881f,null))['catch'](handleError(_0xa8881f,null));};exports[_0x24fc('0x80')]=function(_0x4a2522,_0x5226aa,_0x260a62){var _0x19b426=_0x4a2522['body'][_0x24fc('0x77')];var _0x45e8da;return db[_0x24fc('0x7f')][_0x24fc('0x4a')]({'where':{'id':_0x19b426},'attributes':['id'],'include':[{'model':db['User'],'as':_0x24fc('0x81'),'attributes':['id',_0x24fc('0x30'),_0x24fc('0x82'),_0x24fc('0x83'),_0x24fc('0x84')],'raw':!![]}]})[_0x24fc('0x2a')](function(_0x4e31bd){if(_0x4e31bd){_0x45e8da=_0x4e31bd;var _0x492328=_['flatMap'](_0x4e31bd,function(_0xc4f001){var _0x3fb8fc=_0xc4f001['get']({'plain':!![]});return _0x3fb8fc[_0x24fc('0x81')];});return db[_0x24fc('0x48')][_0x24fc('0x50')]({'where':{'id':_0x4a2522['params']['id']}})[_0x24fc('0x2a')](function(_0x15dbba){return db['sequelize']['transaction'](function(_0x33c581){return _0x15dbba[_0x24fc('0x80')](_0x19b426,{'transaction':_0x33c581})[_0x24fc('0x2a')](function(){return BPromise['each'](_0x45e8da,function(_0x2e4e38){return db['TeamVoicePrefix']['upsert']({'TeamId':_0x2e4e38['id'],'VoicePrefixId':_0x4a2522[_0x24fc('0x4e')]['id']},{'transaction':_0x33c581});});})['then'](function(){return BPromise['each'](_0x492328,function(_0x6dee4c){return db['UserVoicePrefix'][_0x24fc('0x85')]({'where':{'UserId':_0x6dee4c['id'],'VoicePrefixId':_0x4a2522[_0x24fc('0x4e')]['id']},'transaction':_0x33c581});});})[_0x24fc('0x2a')](function(){_0x492328[_0x24fc('0x86')](function(_0x4ae346){socket[_0x24fc('0x78')](_0x24fc('0x79'),{'UserId':_0x4ae346['id'],'VoicePrefixId':_0x15dbba['id']});});});});});}})['then'](respondWithStatusCode(_0x5226aa,null))[_0x24fc('0x4c')](handleError(_0x5226aa,null));};exports[_0x24fc('0x87')]=function(_0x30d523,_0x8b1efd,_0x2a19f9){return db['Team'][_0x24fc('0x4a')]({'where':{'id':_0x30d523[_0x24fc('0x38')]['ids']},'attributes':['id'],'include':[{'model':db[_0x24fc('0x88')],'as':_0x24fc('0x81'),'attributes':['id'],'raw':!![]}]})[_0x24fc('0x2a')](handleEntityNotFound(_0x8b1efd,null))[_0x24fc('0x2a')](function(_0x18197a){var _0x5aaa55=_[_0x24fc('0x37')](_0x18197a,'id');var _0x5d6e00=[];var _0x5c8969=[];var _0x42c158=squel[_0x24fc('0x89')]();_0x42c158[_0x24fc('0x8a')]('tq.TeamId')['from'](_0x24fc('0x8b'),'tq')[_0x24fc('0x8c')](_0x24fc('0x8d'),'ut',_0x24fc('0x8e'))[_0x24fc('0x44')](_0x24fc('0x8f'),_0x30d523[_0x24fc('0x4e')]['id']);for(var _0x1efb25=0x0;_0x1efb25<_0x18197a['length'];_0x1efb25+=0x1){let _0x5bbe2c=_0x18197a[_0x1efb25];for(var _0x316b8f=0x0;_0x316b8f<_0x5bbe2c['Agents']['length'];_0x316b8f+=0x1){let _0x1bf646=_0x5bbe2c[_0x24fc('0x81')][_0x316b8f];var _0x31c499=_0x42c158[_0x24fc('0x90')]();_0x31c499[_0x24fc('0x44')](_0x24fc('0x91'),_0x1bf646['id']);_0x5c8969[_0x24fc('0x6a')](db['sequelize'][_0x24fc('0x38')](_0x31c499[_0x24fc('0x92')](),{'type':db[_0x24fc('0x52')][_0x24fc('0x93')][_0x24fc('0x94')]})[_0x24fc('0x2a')](function(_0x3be176){if(_0x3be176[_0x24fc('0x4f')]===0x1){return _0x1bf646['id'];}else{var _0x9fd1b5=_[_0x24fc('0x95')](_[_0x24fc('0x37')](_0x3be176,_0x24fc('0x96')),function(_0x11ed4f){return _[_0x24fc('0x97')](_0x5aaa55,_0x11ed4f);});if(_0x9fd1b5){return _0x1bf646['id'];}}}));}}return BPromise[_0x24fc('0x98')](_0x5c8969)[_0x24fc('0x2a')](function(_0x29af09){_0x5d6e00=_(_0x5d6e00)[_0x24fc('0x99')](_0x29af09)[_0x24fc('0x9a')]()[_0x24fc('0x9b')]();return db[_0x24fc('0x48')][_0x24fc('0x50')]({'where':{'id':_0x30d523[_0x24fc('0x4e')]['id']}})[_0x24fc('0x2a')](function(_0x219be8){return db['sequelize'][_0x24fc('0x53')](function(_0x4217f0){return _0x219be8[_0x24fc('0x87')](_0x30d523[_0x24fc('0x38')]['ids'],{'transaction':_0x4217f0})['then'](function(){if(!_['isEmpty'](_0x5d6e00)){return _0x219be8[_0x24fc('0x7a')](_0x5d6e00,{'transaction':_0x4217f0});}})['then'](function(){_0x5d6e00[_0x24fc('0x86')](function(_0x49e026){socket[_0x24fc('0x78')](_0x24fc('0x7b'),{'UserId':_0x49e026,'VoicePrefixId':_0x219be8['id']});});});});});});})[_0x24fc('0x2a')](respondWithStatusCode(_0x8b1efd,null))[_0x24fc('0x4c')](handleError(_0x8b1efd,null));}; \ No newline at end of file +var _0x1893=['compact','value','isEmpty','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./voicePrefix.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','save','update','then','destroy','get','error','name','index','map','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','VoicePrefix','includeAll','findAll','rows','show','length','options','find','catch','describe','create','sequelize','transaction','VoiceExtension','VoiceExtensionId','user','UserProfileSection','VoicePrefixes','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','exten','app','system','description','Voice\x20Prefix\x20Extension','priority','appdata','prefix','NoOp','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','push','Set','CDR(prefix)=','callerIdAll','PREFIX-CALLERIDALL=','context','${EXTEN:','charAt','body','system-','findById','addAgents','params','ids','omit','spread','emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','findOne','User','rawAttributes','pick','getAgents','getTeams','addTeams','Team','Agents','online','voicePause','flatMap','each','upsert','findOrCreate','forEach','removeTeams','field','tq.TeamId','from','team_has_voice_prefixes','join','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone','toString','QueryTypes','SELECT','every','TeamId','includes','all','union'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1893,0xa2));var _0x3189=function(_0x699049,_0x51d7d6){_0x699049=_0x699049-0x0;var _0x5e25e4=_0x1893[_0x699049];return _0x5e25e4;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3189('0x0'));var jsonpatch=require(_0x3189('0x1'));var rp=require(_0x3189('0x2'));var moment=require(_0x3189('0x3'));var BPromise=require(_0x3189('0x4'));var Mustache=require(_0x3189('0x5'));var util=require(_0x3189('0x6'));var path=require('path');var sox=require(_0x3189('0x7'));var csv=require(_0x3189('0x8'));var ejs=require(_0x3189('0x9'));var fs=require('fs');var fs_extra=require(_0x3189('0xa'));var _=require(_0x3189('0xb'));var squel=require(_0x3189('0xc'));var crypto=require(_0x3189('0xd'));var jsforce=require(_0x3189('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x3189('0x8'));var querystring=require('querystring');var Papa=require(_0x3189('0xf'));var Redis=require('ioredis');var authService=require(_0x3189('0x10'));var qs=require(_0x3189('0x11'));var as=require(_0x3189('0x12'));var hardwareService=require(_0x3189('0x13'));var logger=require('../../config/logger')(_0x3189('0x14'));var utils=require(_0x3189('0x15'));var config=require(_0x3189('0x16'));var licenseUtil=require(_0x3189('0x17'));var db=require(_0x3189('0x18'))['db'];config['redis']=_[_0x3189('0x19')](config[_0x3189('0x1a')],{'host':_0x3189('0x1b'),'port':0x18eb});var socket=require(_0x3189('0x1c'))(new Redis(config[_0x3189('0x1a')]));require(_0x3189('0x1d'))[_0x3189('0x1e')](socket);function respondWithStatusCode(_0x25a917,_0x5521bb){_0x5521bb=_0x5521bb||0xcc;return function(_0x220b18){if(_0x220b18){return _0x25a917[_0x3189('0x1f')](_0x5521bb);}return _0x25a917[_0x3189('0x20')](_0x5521bb)[_0x3189('0x21')]();};}function respondWithResult(_0x486dd2,_0x40195d){_0x40195d=_0x40195d||0xc8;return function(_0x5f2e82){if(_0x5f2e82){return _0x486dd2['status'](_0x40195d)[_0x3189('0x22')](_0x5f2e82);}};}function respondWithFilteredResult(_0x49b1bc,_0x42c3a3){return function(_0xf8aed7){if(_0xf8aed7){var _0x22c7ba=typeof _0x42c3a3[_0x3189('0x23')]==='undefined'&&typeof _0x42c3a3[_0x3189('0x24')]===_0x3189('0x25');var _0x16edd7=_0xf8aed7['count'];var _0x561265=_0x22c7ba?0x0:_0x42c3a3[_0x3189('0x23')];var _0x306ed3=_0x22c7ba?_0xf8aed7[_0x3189('0x26')]:_0x42c3a3[_0x3189('0x23')]+_0x42c3a3['limit'];var _0x1771a8;if(_0x306ed3>=_0x16edd7){_0x306ed3=_0x16edd7;_0x1771a8=0xc8;}else{_0x1771a8=0xce;}_0x49b1bc[_0x3189('0x20')](_0x1771a8);return _0x49b1bc[_0x3189('0x27')]('Content-Range',_0x561265+'-'+_0x306ed3+'/'+_0x16edd7)[_0x3189('0x22')](_0xf8aed7);}return null;};}function patchUpdates(_0x47abb4){return function(_0x4bfc03){try{jsonpatch[_0x3189('0x28')](_0x4bfc03,_0x47abb4,!![]);}catch(_0x200f16){return BPromise[_0x3189('0x29')](_0x200f16);}return _0x4bfc03[_0x3189('0x2a')]();};}function saveUpdates(_0x393fcb,_0x5a08dc){return function(_0x4b03ad){if(_0x4b03ad){return _0x4b03ad[_0x3189('0x2b')](_0x393fcb)[_0x3189('0x2c')](function(_0x1dc1c8){return _0x1dc1c8;});}return null;};}function removeEntity(_0x3cc1e5,_0x103de4){return function(_0x3f4789){if(_0x3f4789){return _0x3f4789[_0x3189('0x2d')]()[_0x3189('0x2c')](function(){var _0x17b540=_0x3f4789[_0x3189('0x2e')]({'plain':!![]});var _0x5ce5f5='VoicePrefixes';return db['UserProfileResource'][_0x3189('0x2d')]({'where':{'type':_0x5ce5f5,'resourceId':_0x17b540['id']}})[_0x3189('0x2c')](function(){return _0x3f4789;});})[_0x3189('0x2c')](function(){_0x3cc1e5[_0x3189('0x20')](0xcc)[_0x3189('0x21')]();});}};}function handleEntityNotFound(_0x2f7504,_0x4d453a){return function(_0x1ab94b){if(!_0x1ab94b){_0x2f7504[_0x3189('0x1f')](0x194);}return _0x1ab94b;};}function handleError(_0x4bd677,_0x173f18){_0x173f18=_0x173f18||0x1f4;return function(_0x3744ff){logger[_0x3189('0x2f')](_0x3744ff['stack']);if(_0x3744ff[_0x3189('0x30')]){delete _0x3744ff[_0x3189('0x30')];}_0x4bd677[_0x3189('0x20')](_0x173f18)['send'](_0x3744ff);};}exports[_0x3189('0x31')]=function(_0x47f7a7,_0x51ce54){var _0x32ca90={},_0x34007b={},_0x374f23={'count':0x0,'rows':[]};var _0x3bdc84=_[_0x3189('0x32')](db['VoicePrefix']['rawAttributes'],function(_0x7d7745){return{'name':_0x7d7745['fieldName'],'type':_0x7d7745[_0x3189('0x33')][_0x3189('0x34')]};});_0x34007b[_0x3189('0x35')]=_[_0x3189('0x32')](_0x3bdc84,_0x3189('0x30'));_0x34007b[_0x3189('0x36')]=_[_0x3189('0x37')](_0x47f7a7[_0x3189('0x36')]);_0x34007b[_0x3189('0x38')]=_['intersection'](_0x34007b[_0x3189('0x35')],_0x34007b[_0x3189('0x36')]);_0x32ca90[_0x3189('0x39')]=_[_0x3189('0x3a')](_0x34007b[_0x3189('0x35')],qs[_0x3189('0x3b')](_0x47f7a7[_0x3189('0x36')]['fields']));_0x32ca90['attributes']=_0x32ca90[_0x3189('0x39')]['length']?_0x32ca90[_0x3189('0x39')]:_0x34007b[_0x3189('0x35')];if(!_0x47f7a7['query'][_0x3189('0x3c')](_0x3189('0x3d'))){_0x32ca90[_0x3189('0x24')]=qs[_0x3189('0x24')](_0x47f7a7['query'][_0x3189('0x24')]);_0x32ca90['offset']=qs['offset'](_0x47f7a7[_0x3189('0x36')][_0x3189('0x23')]);}_0x32ca90[_0x3189('0x3e')]=qs[_0x3189('0x3f')](_0x47f7a7[_0x3189('0x36')][_0x3189('0x3f')]);_0x32ca90[_0x3189('0x40')]=qs[_0x3189('0x38')](_['pick'](_0x47f7a7['query'],_0x34007b[_0x3189('0x38')]),_0x3bdc84);if(_0x47f7a7[_0x3189('0x36')][_0x3189('0x41')]){_0x32ca90[_0x3189('0x40')]=_[_0x3189('0x42')](_0x32ca90[_0x3189('0x40')],{'$or':_['map'](_0x3bdc84,function(_0x280146){if(_0x280146[_0x3189('0x33')]!==_0x3189('0x43')){var _0xaf76f1={};_0xaf76f1[_0x280146['name']]={'$like':'%'+_0x47f7a7[_0x3189('0x36')][_0x3189('0x41')]+'%'};return _0xaf76f1;}})});}_0x32ca90=_['merge']({},_0x32ca90,_0x47f7a7['options']);var _0x1ef1b2={'where':_0x32ca90['where']};return db[_0x3189('0x44')][_0x3189('0x26')](_0x1ef1b2)[_0x3189('0x2c')](function(_0x9593f3){_0x374f23['count']=_0x9593f3;if(_0x47f7a7[_0x3189('0x36')][_0x3189('0x45')]){_0x32ca90['include']=[{'all':!![]}];}return db[_0x3189('0x44')][_0x3189('0x46')](_0x32ca90);})[_0x3189('0x2c')](function(_0x3a6a36){_0x374f23[_0x3189('0x47')]=_0x3a6a36;return _0x374f23;})['then'](respondWithFilteredResult(_0x51ce54,_0x32ca90))['catch'](handleError(_0x51ce54,null));};exports[_0x3189('0x48')]=function(_0x5ca360,_0x44e45f){var _0xf095fe={'raw':![],'where':{'id':_0x5ca360['params']['id']}},_0x1a3e51={};_0x1a3e51[_0x3189('0x35')]=_[_0x3189('0x37')](db[_0x3189('0x44')]['rawAttributes']);_0x1a3e51[_0x3189('0x36')]=_[_0x3189('0x37')](_0x5ca360[_0x3189('0x36')]);_0x1a3e51[_0x3189('0x38')]=_[_0x3189('0x3a')](_0x1a3e51[_0x3189('0x35')],_0x1a3e51['query']);_0xf095fe['attributes']=_[_0x3189('0x3a')](_0x1a3e51['model'],qs['fields'](_0x5ca360[_0x3189('0x36')]['fields']));_0xf095fe[_0x3189('0x39')]=_0xf095fe[_0x3189('0x39')][_0x3189('0x49')]?_0xf095fe['attributes']:_0x1a3e51[_0x3189('0x35')];if(_0x5ca360['query'][_0x3189('0x45')]){_0xf095fe['include']=[{'all':!![]}];}_0xf095fe=_['merge']({},_0xf095fe,_0x5ca360[_0x3189('0x4a')]);return db['VoicePrefix'][_0x3189('0x4b')](_0xf095fe)['then'](handleEntityNotFound(_0x44e45f,null))['then'](respondWithResult(_0x44e45f,null))[_0x3189('0x4c')](handleError(_0x44e45f,null));};exports[_0x3189('0x2d')]=function(_0x4373f6,_0x35cb23){return db[_0x3189('0x44')][_0x3189('0x4b')]({'where':{'id':_0x4373f6['params']['id']}})[_0x3189('0x2c')](handleEntityNotFound(_0x35cb23,null))['then'](removeEntity(_0x35cb23,null))['catch'](handleError(_0x35cb23,null));};exports[_0x3189('0x4d')]=function(_0x4f641a,_0xd90868){return db[_0x3189('0x44')][_0x3189('0x4d')]()[_0x3189('0x2c')](respondWithResult(_0xd90868,null))['catch'](handleError(_0xd90868,null));};exports[_0x3189('0x4e')]=function(_0x4ad892,_0x35fdb2){var _0x242ec4;return db[_0x3189('0x4f')][_0x3189('0x50')](function(_0x4f41e5){return db[_0x3189('0x44')][_0x3189('0x4e')](_0x4ad892['body'],{'transaction':_0x4f41e5})[_0x3189('0x2c')](function(_0xbf07c5){_0x242ec4=_0xbf07c5[_0x3189('0x2e')]({'plain':!![]});return db[_0x3189('0x51')]['find']({'where':{'id':_0x242ec4[_0x3189('0x52')]},'raw':!![]})['then'](function(_0x1ebb0d){return createVoicePrefixExtensions(_0x242ec4,_0x1ebb0d,_0x4f41e5);});});})['then'](function(){var _0x460c6e=_0x4ad892[_0x3189('0x53')]['get']({'plain':!![]});if(!_0x460c6e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x460c6e['role']===_0x3189('0x53')){var _0x5b14ac=_0x242ec4;return db[_0x3189('0x54')][_0x3189('0x4b')]({'where':{'name':_0x3189('0x55'),'userProfileId':_0x460c6e[_0x3189('0x56')]},'raw':!![]})[_0x3189('0x2c')](function(_0x40623f){if(_0x40623f&&_0x40623f[_0x3189('0x57')]===0x0){return db[_0x3189('0x58')][_0x3189('0x4e')]({'name':_0x5b14ac['name'],'resourceId':_0x5b14ac['id'],'type':_0x40623f[_0x3189('0x30')],'sectionId':_0x40623f['id']},{})[_0x3189('0x2c')](function(){return _0x242ec4;});}else{return _0x242ec4;}})[_0x3189('0x4c')](function(_0x429de3){logger[_0x3189('0x2f')](_0x3189('0x59'),_0x429de3);throw _0x429de3;});}return _0x242ec4;})[_0x3189('0x2c')](respondWithResult(_0x35fdb2,null))[_0x3189('0x4c')](handleError(_0x35fdb2,null));};function Extension(_0xa1316a,_0x68de3c,_0x187877,_0x3a2fe6){this['context']='from-sip';this[_0x3189('0x5a')]=_0xa1316a;this[_0x3189('0x5b')]=_0x187877;this[_0x3189('0x33')]=_0x3189('0x5c');this[_0x3189('0x5d')]=_0x3189('0x5e');this[_0x3189('0x5f')]=_0x68de3c;this[_0x3189('0x60')]=_0x3a2fe6;}function createVoicePrefixExtensions(_0x120a8a,_0x1472b6,_0xd45395){return new BPromise(function(_0x4f0ccb,_0x5b31dd){var _0x57aae5=new Extension(formatPrefixName(_0x120a8a[_0x3189('0x61')]),0x1,_0x3189('0x62'),'Voice\x20Prefix');_0x57aae5[_0x3189('0x63')]=_0x120a8a['id'];return db[_0x3189('0x51')][_0x3189('0x4e')](_0x57aae5,{'transaction':_0xd45395})[_0x3189('0x2c')](function(_0x26fdf2){var _0x4875a2=_0x26fdf2[_0x3189('0x2e')]({'plain':!![]});var _0x35a4d1=_[_0x3189('0x32')](addVoicePrefixExtensions(_0x120a8a,_0x1472b6),function(_0x228dfc){_0x228dfc['VoiceExtensionId']=_0x4875a2['id'];_0x228dfc[_0x3189('0x63')]=_0x120a8a['id'];return _0x228dfc;});return db[_0x3189('0x51')][_0x3189('0x64')](_0x35a4d1,{'transaction':_0xd45395})[_0x3189('0x2c')](function(_0x4a7172){if(!_0x4a7172){return _0x5b31dd(_0x3189('0x65'));}else{return _0x4f0ccb(_0x4a7172);}})['catch'](function(_0x1d7a44){return _0x5b31dd(_0x1d7a44);});});;});};function addVoicePrefixExtensions(_0x448635,_0x10fe1b){var _0xb02b4f=[];var _0x55bcf0=formatPrefixName(_0x448635[_0x3189('0x61')]);_0xb02b4f[_0x3189('0x66')](new Extension(_0x55bcf0,0x2,_0x3189('0x67'),_0x3189('0x68')+_0x448635[_0x3189('0x30')]));if(_0x448635[_0x3189('0x69')]){_0xb02b4f['push'](new Extension(_0x55bcf0,0x3,_0x3189('0x67'),_0x3189('0x6a')+_0x448635[_0x3189('0x69')]));}else{_0xb02b4f[_0x3189('0x66')](new Extension(_0x55bcf0,0x3,_0x3189('0x62'),'No\x20callerid\x20available'));}_0xb02b4f[_0x3189('0x66')](new Extension(_0x55bcf0,0x4,'goto',_0x10fe1b[_0x3189('0x6b')]+','+_0x3189('0x6c')+(0x8+_0x448635[_0x3189('0x30')][_0x3189('0x49')])+'}'+','+0x1));return _0xb02b4f;}function formatPrefixName(_0x46faac){var _0x458db9='_';for(var _0x403d31=0x0;_0x403d31<_0x46faac[_0x3189('0x49')];_0x403d31++){if(_0x46faac['charAt'](_0x403d31)=='-'){_0x458db9+=_0x46faac[_0x3189('0x6d')](_0x403d31);}else{_0x458db9+='['+_0x46faac['charAt'](_0x403d31)+']';}}_0x458db9+='.';return _0x458db9;}exports[_0x3189('0x2b')]=function(_0x2eedf4,_0xf740b0,_0x1e08f4){var _0x3d11ac=_0x2eedf4[_0x3189('0x6e')];_0x3d11ac['prefix']=_0x3189('0x6f')+_0x3d11ac[_0x3189('0x30')]+'-';return db['sequelize'][_0x3189('0x50')](function(_0x50438f){return db[_0x3189('0x44')][_0x3189('0x2b')](_0x3d11ac,{'where':{'id':_0x3d11ac['id']},'transaction':_0x50438f})[_0x3189('0x2c')](function(){return db['VoiceExtension']['destroy']({'where':{'VoicePrefixId':_0x3d11ac['id']},'transaction':_0x50438f})[_0x3189('0x2c')](function(){return db[_0x3189('0x51')][_0x3189('0x4b')]({'where':{'id':_0x3d11ac['VoiceExtensionId']},'raw':!![]})[_0x3189('0x2c')](function(_0x285b0d){return createVoicePrefixExtensions(_0x3d11ac,_0x285b0d,_0x50438f);});});});})['then'](function(){return db[_0x3189('0x44')][_0x3189('0x70')](_0x3d11ac['id']);})[_0x3189('0x2c')](respondWithResult(_0xf740b0,null))['catch'](handleError(_0xf740b0,null));};exports[_0x3189('0x71')]=function(_0x28bbe6,_0x3ab88e,_0x5d3478){return db['VoicePrefix'][_0x3189('0x4b')]({'where':{'id':_0x28bbe6[_0x3189('0x72')]['id']}})[_0x3189('0x2c')](handleEntityNotFound(_0x3ab88e,null))['then'](function(_0x1f57c7){if(_0x1f57c7){return _0x1f57c7[_0x3189('0x71')](_0x28bbe6[_0x3189('0x6e')][_0x3189('0x73')],_[_0x3189('0x74')](_0x28bbe6[_0x3189('0x6e')],[_0x3189('0x73'),'id'])||{})[_0x3189('0x75')](function(_0x2c110e){for(var _0x41d415=0x0;_0x41d415<_0x28bbe6['body'][_0x3189('0x73')][_0x3189('0x49')];_0x41d415+=0x1){socket[_0x3189('0x76')](_0x3189('0x77'),{'UserId':Number(_0x28bbe6[_0x3189('0x6e')][_0x3189('0x73')][_0x41d415]),'VoicePrefixId':Number(_0x28bbe6[_0x3189('0x72')]['id'])});}return _0x2c110e;});}})[_0x3189('0x2c')](respondWithResult(_0x3ab88e,null))['catch'](handleError(_0x3ab88e,null));};exports[_0x3189('0x78')]=function(_0x4861ba,_0x226a58,_0x176c44){return db[_0x3189('0x44')][_0x3189('0x4b')]({'where':{'id':_0x4861ba['params']['id']}})['then'](handleEntityNotFound(_0x226a58,null))[_0x3189('0x2c')](function(_0x2c0e85){if(_0x2c0e85){return _0x2c0e85[_0x3189('0x78')](_0x4861ba[_0x3189('0x36')]['ids'])[_0x3189('0x2c')](function(){if(_[_0x3189('0x79')](_0x4861ba['query'][_0x3189('0x73')])){for(var _0x65c13f=0x0;_0x65c13f<_0x4861ba['query'][_0x3189('0x73')][_0x3189('0x49')];_0x65c13f+=0x1){socket['emit']('userVoicePrefix:remove',{'UserId':Number(_0x4861ba[_0x3189('0x36')]['ids'][_0x65c13f]),'VoicePrefixId':Number(_0x4861ba[_0x3189('0x72')]['id'])});}}else{socket[_0x3189('0x76')](_0x3189('0x7a'),{'UserId':Number(_0x4861ba[_0x3189('0x36')][_0x3189('0x73')]),'VoicePrefixId':Number(_0x4861ba['params']['id'])});}});}})['then'](respondWithStatusCode(_0x226a58,null))[_0x3189('0x4c')](handleError(_0x226a58,null));};exports['getAgents']=function(_0x33b271,_0x5c138a,_0x583d35){var _0x51303a={};var _0x278553={};var _0x4917e3;var _0x2d3d78;return db[_0x3189('0x44')][_0x3189('0x7b')]({'where':{'id':_0x33b271[_0x3189('0x72')]['id']}})[_0x3189('0x2c')](handleEntityNotFound(_0x5c138a,null))[_0x3189('0x2c')](function(_0x4d3554){if(_0x4d3554){_0x4917e3=_0x4d3554;_0x278553[_0x3189('0x35')]=_[_0x3189('0x37')](db[_0x3189('0x7c')][_0x3189('0x7d')]);_0x278553[_0x3189('0x36')]=_['keys'](_0x33b271[_0x3189('0x36')]);_0x278553[_0x3189('0x38')]=_[_0x3189('0x3a')](_0x278553[_0x3189('0x35')],_0x278553[_0x3189('0x36')]);_0x51303a['attributes']=_[_0x3189('0x3a')](_0x278553[_0x3189('0x35')],qs[_0x3189('0x3b')](_0x33b271[_0x3189('0x36')][_0x3189('0x3b')]));_0x51303a[_0x3189('0x39')]=_0x51303a[_0x3189('0x39')][_0x3189('0x49')]?_0x51303a[_0x3189('0x39')]:_0x278553[_0x3189('0x35')];_0x51303a['order']=qs[_0x3189('0x3f')](_0x33b271[_0x3189('0x36')][_0x3189('0x3f')]);_0x51303a[_0x3189('0x40')]=qs[_0x3189('0x38')](_[_0x3189('0x7e')](_0x33b271['query'],_0x278553[_0x3189('0x38')]));if(_0x33b271['query'][_0x3189('0x41')]){_0x51303a['where']=_[_0x3189('0x42')](_0x51303a['where'],{'$or':_[_0x3189('0x32')](_0x51303a['attributes'],function(_0x3a84e8){var _0x17b46a={};_0x17b46a[_0x3a84e8]={'$like':'%'+_0x33b271['query'][_0x3189('0x41')]+'%'};return _0x17b46a;})});}_0x51303a=_[_0x3189('0x42')]({},_0x51303a,_0x33b271[_0x3189('0x4a')]);return _0x4917e3[_0x3189('0x7f')](_0x51303a);}})[_0x3189('0x2c')](function(_0x549bbd){if(_0x549bbd){_0x2d3d78=_0x549bbd['length'];if(!_0x33b271[_0x3189('0x36')][_0x3189('0x3c')](_0x3189('0x3d'))){_0x51303a[_0x3189('0x24')]=qs[_0x3189('0x24')](_0x33b271[_0x3189('0x36')]['limit']);_0x51303a[_0x3189('0x23')]=qs[_0x3189('0x23')](_0x33b271['query'][_0x3189('0x23')]);}return _0x4917e3[_0x3189('0x7f')](_0x51303a);}})[_0x3189('0x2c')](function(_0x5d10f8){if(_0x5d10f8){return _0x5d10f8?{'count':_0x2d3d78,'rows':_0x5d10f8}:null;}})[_0x3189('0x2c')](respondWithResult(_0x5c138a,null))[_0x3189('0x4c')](handleError(_0x5c138a,null));};exports[_0x3189('0x80')]=function(_0x24fec5,_0x5a7cf4,_0x2ef30c){var _0x14cecc={};var _0x2165f1={};var _0x1b8666;var _0x5bbf36;return db[_0x3189('0x44')][_0x3189('0x7b')]({'where':{'id':_0x24fec5[_0x3189('0x72')]['id']}})[_0x3189('0x2c')](handleEntityNotFound(_0x5a7cf4,null))['then'](function(_0x4371b7){if(_0x4371b7){_0x1b8666=_0x4371b7;_0x2165f1[_0x3189('0x35')]=_[_0x3189('0x37')](db['Team'][_0x3189('0x7d')]);_0x2165f1['query']=_[_0x3189('0x37')](_0x24fec5['query']);_0x2165f1[_0x3189('0x38')]=_[_0x3189('0x3a')](_0x2165f1[_0x3189('0x35')],_0x2165f1[_0x3189('0x36')]);_0x14cecc['attributes']=_[_0x3189('0x3a')](_0x2165f1[_0x3189('0x35')],qs[_0x3189('0x3b')](_0x24fec5[_0x3189('0x36')][_0x3189('0x3b')]));_0x14cecc[_0x3189('0x39')]=_0x14cecc['attributes']['length']?_0x14cecc[_0x3189('0x39')]:_0x2165f1[_0x3189('0x35')];_0x14cecc['order']=qs[_0x3189('0x3f')](_0x24fec5[_0x3189('0x36')][_0x3189('0x3f')]);_0x14cecc[_0x3189('0x40')]=qs['filters'](_[_0x3189('0x7e')](_0x24fec5[_0x3189('0x36')],_0x2165f1[_0x3189('0x38')]));if(_0x24fec5[_0x3189('0x36')]['filter']){_0x14cecc[_0x3189('0x40')]=_[_0x3189('0x42')](_0x14cecc['where'],{'$or':_[_0x3189('0x32')](_0x14cecc[_0x3189('0x39')],function(_0x5eeb3d){var _0xe94bda={};_0xe94bda[_0x5eeb3d]={'$like':'%'+_0x24fec5[_0x3189('0x36')]['filter']+'%'};return _0xe94bda;})});}_0x14cecc=_[_0x3189('0x42')]({},_0x14cecc,_0x24fec5[_0x3189('0x4a')]);return _0x1b8666[_0x3189('0x80')](_0x14cecc);}})[_0x3189('0x2c')](function(_0x23d34e){if(_0x23d34e){_0x5bbf36=_0x23d34e[_0x3189('0x49')];if(!_0x24fec5['query'][_0x3189('0x3c')](_0x3189('0x3d'))){_0x14cecc[_0x3189('0x24')]=qs[_0x3189('0x24')](_0x24fec5[_0x3189('0x36')][_0x3189('0x24')]);_0x14cecc[_0x3189('0x23')]=qs[_0x3189('0x23')](_0x24fec5['query'][_0x3189('0x23')]);}return _0x1b8666[_0x3189('0x80')](_0x14cecc);}})['then'](function(_0x418ef8){if(_0x418ef8){return _0x418ef8?{'count':_0x5bbf36,'rows':_0x418ef8}:null;}})[_0x3189('0x2c')](respondWithResult(_0x5a7cf4,null))['catch'](handleError(_0x5a7cf4,null));};exports[_0x3189('0x81')]=function(_0x85c195,_0x4917ee,_0x2a8f73){var _0x464843=_0x85c195[_0x3189('0x6e')][_0x3189('0x73')];var _0x429bc1;return db[_0x3189('0x82')]['findAll']({'where':{'id':_0x464843},'attributes':['id'],'include':[{'model':db[_0x3189('0x7c')],'as':_0x3189('0x83'),'attributes':['id','name',_0x3189('0x84'),_0x3189('0x85'),'interface'],'raw':!![]}]})['then'](function(_0x158199){if(_0x158199){_0x429bc1=_0x158199;var _0x431e68=_[_0x3189('0x86')](_0x158199,function(_0x18d525){var _0x5e565c=_0x18d525['get']({'plain':!![]});return _0x5e565c[_0x3189('0x83')];});return db[_0x3189('0x44')]['find']({'where':{'id':_0x85c195[_0x3189('0x72')]['id']}})[_0x3189('0x2c')](function(_0x36262a){return db['sequelize'][_0x3189('0x50')](function(_0xd24f4a){return _0x36262a[_0x3189('0x81')](_0x464843,{'transaction':_0xd24f4a})[_0x3189('0x2c')](function(){return BPromise[_0x3189('0x87')](_0x429bc1,function(_0x33f64c){return db['TeamVoicePrefix'][_0x3189('0x88')]({'TeamId':_0x33f64c['id'],'VoicePrefixId':_0x85c195['params']['id']},{'transaction':_0xd24f4a});});})[_0x3189('0x2c')](function(){return BPromise[_0x3189('0x87')](_0x431e68,function(_0x1c919f){return db['UserVoicePrefix'][_0x3189('0x89')]({'where':{'UserId':_0x1c919f['id'],'VoicePrefixId':_0x85c195[_0x3189('0x72')]['id']},'transaction':_0xd24f4a});});})['then'](function(){_0x431e68[_0x3189('0x8a')](function(_0x2bab94){socket['emit'](_0x3189('0x77'),{'UserId':_0x2bab94['id'],'VoicePrefixId':_0x36262a['id']});});});});});}})[_0x3189('0x2c')](respondWithStatusCode(_0x4917ee,null))[_0x3189('0x4c')](handleError(_0x4917ee,null));};exports[_0x3189('0x8b')]=function(_0x39fe89,_0x4f564d,_0x341e23){return db['Team'][_0x3189('0x46')]({'where':{'id':_0x39fe89[_0x3189('0x36')]['ids']},'attributes':['id'],'include':[{'model':db[_0x3189('0x7c')],'as':_0x3189('0x83'),'attributes':['id'],'raw':!![]}]})[_0x3189('0x2c')](handleEntityNotFound(_0x4f564d,null))['then'](function(_0x4fb475){var _0x522aa5=_[_0x3189('0x32')](_0x4fb475,'id');var _0x1f0c98=[];var _0x3f5cf9=[];var _0x47ce18=squel['select']();_0x47ce18[_0x3189('0x8c')](_0x3189('0x8d'))[_0x3189('0x8e')](_0x3189('0x8f'),'tq')[_0x3189('0x90')]('user_has_teams','ut',_0x3189('0x91'))['where'](_0x3189('0x92'),_0x39fe89['params']['id']);for(var _0x241a67=0x0;_0x241a67<_0x4fb475[_0x3189('0x49')];_0x241a67+=0x1){let _0x51913c=_0x4fb475[_0x241a67];for(var _0x1a07d7=0x0;_0x1a07d7<_0x51913c[_0x3189('0x83')][_0x3189('0x49')];_0x1a07d7+=0x1){let _0x36602c=_0x51913c['Agents'][_0x1a07d7];var _0x1f9018=_0x47ce18[_0x3189('0x93')]();_0x1f9018[_0x3189('0x40')]('ut.UserId\x20=\x20?',_0x36602c['id']);_0x3f5cf9[_0x3189('0x66')](db[_0x3189('0x4f')][_0x3189('0x36')](_0x1f9018[_0x3189('0x94')](),{'type':db['sequelize'][_0x3189('0x95')][_0x3189('0x96')]})[_0x3189('0x2c')](function(_0x13fc9f){if(_0x13fc9f[_0x3189('0x49')]===0x1){return _0x36602c['id'];}else{var _0x516164=_[_0x3189('0x97')](_['map'](_0x13fc9f,_0x3189('0x98')),function(_0x1f506c){return _[_0x3189('0x99')](_0x522aa5,_0x1f506c);});if(_0x516164){return _0x36602c['id'];}}}));}}return BPromise[_0x3189('0x9a')](_0x3f5cf9)[_0x3189('0x2c')](function(_0x48835c){_0x1f0c98=_(_0x1f0c98)[_0x3189('0x9b')](_0x48835c)[_0x3189('0x9c')]()[_0x3189('0x9d')]();return db['VoicePrefix']['find']({'where':{'id':_0x39fe89[_0x3189('0x72')]['id']}})[_0x3189('0x2c')](function(_0x4c19e2){return db[_0x3189('0x4f')][_0x3189('0x50')](function(_0x5d89ec){return _0x4c19e2[_0x3189('0x8b')](_0x39fe89[_0x3189('0x36')][_0x3189('0x73')],{'transaction':_0x5d89ec})['then'](function(){if(!_[_0x3189('0x9e')](_0x1f0c98)){return _0x4c19e2[_0x3189('0x78')](_0x1f0c98,{'transaction':_0x5d89ec});}})['then'](function(){_0x1f0c98[_0x3189('0x8a')](function(_0xab746c){socket[_0x3189('0x76')](_0x3189('0x7a'),{'UserId':_0xab746c,'VoicePrefixId':_0x4c19e2['id']});});});});});});})[_0x3189('0x2c')](respondWithStatusCode(_0x4f564d,null))[_0x3189('0x4c')](handleError(_0x4f564d,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index 04c4e00..ff8efb7 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 _0x4a77=['setMaxListeners','remove','emit','hasOwnProperty','../../mysqldb','VoicePrefix'];(function(_0x394514,_0x291743){var _0x4e3ed1=function(_0x4b3832){while(--_0x4b3832){_0x394514['push'](_0x394514['shift']());}};_0x4e3ed1(++_0x291743);}(_0x4a77,0x1ba));var _0x74a7=function(_0x318b2e,_0x41e795){_0x318b2e=_0x318b2e-0x0;var _0x3609bd=_0x4a77[_0x318b2e];return _0x3609bd;};'use strict';var EventEmitter=require('events');var VoicePrefix=require(_0x74a7('0x0'))['db'][_0x74a7('0x1')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x74a7('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x74a7('0x3')};function emitEvent(_0x537dc1){return function(_0x5f59ad,_0x5cf832,_0x30d8e1){VoicePrefixEvents[_0x74a7('0x4')](_0x537dc1+':'+_0x5f59ad['id'],_0x5f59ad);VoicePrefixEvents['emit'](_0x537dc1,_0x5f59ad);_0x30d8e1(null);};}for(var e in events){if(events[_0x74a7('0x5')](e)){var event=events[e];VoicePrefix['hook'](e,emitEvent(event));}}module['exports']=VoicePrefixEvents; \ No newline at end of file +var _0x8d73=['hook','exports','../../mysqldb','save','update','remove','emit','hasOwnProperty'];(function(_0x3e76d8,_0x35c413){var _0x42c25b=function(_0x4396bc){while(--_0x4396bc){_0x3e76d8['push'](_0x3e76d8['shift']());}};_0x42c25b(++_0x35c413);}(_0x8d73,0x17a));var _0x38d7=function(_0x3246b4,_0x401153){_0x3246b4=_0x3246b4-0x0;var _0x34b3d7=_0x8d73[_0x3246b4];return _0x34b3d7;};'use strict';var EventEmitter=require('events');var VoicePrefix=require(_0x38d7('0x0'))['db']['VoicePrefix'];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x38d7('0x1'),'afterUpdate':_0x38d7('0x2'),'afterDestroy':_0x38d7('0x3')};function emitEvent(_0x5bfba3){return function(_0x54ed5e,_0xacc5a3,_0x3129b6){VoicePrefixEvents[_0x38d7('0x4')](_0x5bfba3+':'+_0x54ed5e['id'],_0x54ed5e);VoicePrefixEvents[_0x38d7('0x4')](_0x5bfba3,_0x54ed5e);_0x3129b6(null);};}for(var e in events){if(events[_0x38d7('0x5')](e)){var event=events[e];VoicePrefix[_0x38d7('0x6')](e,emitEvent(event));}}module[_0x38d7('0x7')]=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index d87565a..a9a9422 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 _0x0fa8=['request-promise','rimraf','../../config/environment','./voicePrefix.attributes','exports','define','VoicePrefix','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0fa8,0x6f));var _0x80fa=function(_0x187499,_0x5e416a){_0x187499=_0x187499-0x0;var _0x2965fe=_0x0fa8[_0x187499];return _0x2965fe;};'use strict';var _=require(_0x80fa('0x0'));var util=require(_0x80fa('0x1'));var logger=require(_0x80fa('0x2'))(_0x80fa('0x3'));var moment=require(_0x80fa('0x4'));var BPromise=require(_0x80fa('0x5'));var rp=require(_0x80fa('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x80fa('0x7'));var config=require(_0x80fa('0x8'));var attributes=require(_0x80fa('0x9'));module[_0x80fa('0xa')]=function(_0xa2e2b,_0x3fd1f2){return _0xa2e2b[_0x80fa('0xb')](_0x80fa('0xc'),attributes,{'tableName':'voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xefc0=['api','moment','bluebird','request-promise','path','./voicePrefix.attributes','exports','VoicePrefix','voice_prefixes','lodash','../../config/logger'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xefc0,0x148));var _0x0efc=function(_0x381bdf,_0x2d1279){_0x381bdf=_0x381bdf-0x0;var _0x1d482a=_0xefc0[_0x381bdf];return _0x1d482a;};'use strict';var _=require(_0x0efc('0x0'));var util=require('util');var logger=require(_0x0efc('0x1'))(_0x0efc('0x2'));var moment=require(_0x0efc('0x3'));var BPromise=require(_0x0efc('0x4'));var rp=require(_0x0efc('0x5'));var fs=require('fs');var path=require(_0x0efc('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x0efc('0x7'));module[_0x0efc('0x8')]=function(_0x13fcdf,_0x5e569a){return _0x13fcdf['define'](_0x0efc('0x9'),attributes,{'tableName':_0x0efc('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.rpc.js b/server/api/voicePrefix/voicePrefix.rpc.js index cf7b5c2..5001cb2 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 _0x1a85=['catch','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','http','defaults','redis','socket.io-emitter','register','request','then','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x262798,_0x16c1f4){var _0x313b56=function(_0x3b4517){while(--_0x3b4517){_0x262798['push'](_0x262798['shift']());}};_0x313b56(++_0x16c1f4);}(_0x1a85,0x178));var _0x51a8=function(_0x34404c,_0x49b8d1){_0x34404c=_0x34404c-0x0;var _0x46d1f2=_0x1a85[_0x34404c];return _0x46d1f2;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x51a8('0x0'));var BPromise=require(_0x51a8('0x1'));var rs=require(_0x51a8('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x51a8('0x3'));var logger=require(_0x51a8('0x4'))(_0x51a8('0x5'));var config=require('../../config/environment');var jayson=require(_0x51a8('0x6'));var client=jayson['client'][_0x51a8('0x7')]({'port':0x232a});config['redis']=_[_0x51a8('0x8')](config[_0x51a8('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x51a8('0xa'))(new Redis(config['redis']));require('./voicePrefix.socket')[_0x51a8('0xb')](socket);function respondWithRpcPromise(_0x2f276b,_0x1a476d,_0x45a3f4){return new BPromise(function(_0x418f06,_0x421fa4){return client[_0x51a8('0xc')](_0x2f276b,_0x45a3f4)[_0x51a8('0xd')](function(_0x34c887){logger[_0x51a8('0xe')](_0x51a8('0xf'),_0x1a476d,_0x51a8('0x10'));logger[_0x51a8('0x11')](_0x51a8('0x12'),_0x1a476d,_0x51a8('0x10'),JSON[_0x51a8('0x13')](_0x34c887));if(_0x34c887[_0x51a8('0x14')]){if(_0x34c887['error'][_0x51a8('0x15')]===0x1f4){logger[_0x51a8('0x14')](_0x51a8('0xf'),_0x1a476d,_0x34c887['error'][_0x51a8('0x16')]);return _0x421fa4(_0x34c887['error'][_0x51a8('0x16')]);}logger[_0x51a8('0x14')](_0x51a8('0xf'),_0x1a476d,_0x34c887[_0x51a8('0x14')][_0x51a8('0x16')]);return _0x418f06(_0x34c887[_0x51a8('0x14')][_0x51a8('0x16')]);}else{logger['info'](_0x51a8('0xf'),_0x1a476d,_0x51a8('0x10'));_0x418f06(_0x34c887[_0x51a8('0x17')][_0x51a8('0x16')]);}})[_0x51a8('0x18')](function(_0x544886){logger['error'](_0x51a8('0xf'),_0x1a476d,_0x544886);_0x421fa4(_0x544886);});});} \ No newline at end of file +var _0x8b52=['http','redis','defaults','localhost','./voicePrefix.socket','register','request','then','VoicePrefix,\x20%s,\x20%s','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','message','info','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x293f4a,_0x2cfcdd){var _0x4648de=function(_0x149dc9){while(--_0x149dc9){_0x293f4a['push'](_0x293f4a['shift']());}};_0x4648de(++_0x2cfcdd);}(_0x8b52,0x151));var _0x28b5=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x8b52[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0x28b5('0x0'));var util=require(_0x28b5('0x1'));var moment=require(_0x28b5('0x2'));var BPromise=require('bluebird');var rs=require(_0x28b5('0x3'));var fs=require('fs');var Redis=require(_0x28b5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x28b5('0x5'));var logger=require(_0x28b5('0x6'))(_0x28b5('0x7'));var config=require(_0x28b5('0x8'));var jayson=require(_0x28b5('0x9'));var client=jayson[_0x28b5('0xa')][_0x28b5('0xb')]({'port':0x232a});config[_0x28b5('0xc')]=_[_0x28b5('0xd')](config['redis'],{'host':_0x28b5('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x28b5('0xf'))[_0x28b5('0x10')](socket);function respondWithRpcPromise(_0x4f2a41,_0xd8f394,_0x315ed6){return new BPromise(function(_0x4d3d4e,_0x10d2b5){return client[_0x28b5('0x11')](_0x4f2a41,_0x315ed6)[_0x28b5('0x12')](function(_0x6b22a8){logger['info'](_0x28b5('0x13'),_0xd8f394,'request\x20sent');logger[_0x28b5('0x14')](_0x28b5('0x15'),_0xd8f394,'request\x20sent',JSON[_0x28b5('0x16')](_0x6b22a8));if(_0x6b22a8['error']){if(_0x6b22a8[_0x28b5('0x17')]['code']===0x1f4){logger['error'](_0x28b5('0x13'),_0xd8f394,_0x6b22a8[_0x28b5('0x17')]['message']);return _0x10d2b5(_0x6b22a8[_0x28b5('0x17')][_0x28b5('0x18')]);}logger[_0x28b5('0x17')](_0x28b5('0x13'),_0xd8f394,_0x6b22a8[_0x28b5('0x17')]['message']);return _0x4d3d4e(_0x6b22a8[_0x28b5('0x17')]['message']);}else{logger[_0x28b5('0x19')](_0x28b5('0x13'),_0xd8f394,_0x28b5('0x1a'));_0x4d3d4e(_0x6b22a8[_0x28b5('0x1b')]['message']);}})[_0x28b5('0x1c')](function(_0x1396cf){logger[_0x28b5('0x17')]('VoicePrefix,\x20%s,\x20%s',_0xd8f394,_0x1396cf);_0x10d2b5(_0x1396cf);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index a5b66e5..0e10410 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 _0x68fc=['emit','removeListener','register','voicePrefix:','./voicePrefix.events','save','remove'];(function(_0x560448,_0x2c1082){var _0x550276=function(_0x37e949){while(--_0x37e949){_0x560448['push'](_0x560448['shift']());}};_0x550276(++_0x2c1082);}(_0x68fc,0xa5));var _0xc68f=function(_0x5122be,_0x593c17){_0x5122be=_0x5122be-0x0;var _0x261b62=_0x68fc[_0x5122be];return _0x261b62;};'use strict';var VoicePrefixEvents=require(_0xc68f('0x0'));var events=[_0xc68f('0x1'),_0xc68f('0x2'),'update'];function createListener(_0x49aa95,_0x26513f){return function(_0x506fb5){_0x26513f[_0xc68f('0x3')](_0x49aa95,_0x506fb5);};}function removeListener(_0x593648,_0x5899ea){return function(){VoicePrefixEvents[_0xc68f('0x4')](_0x593648,_0x5899ea);};}exports[_0xc68f('0x5')]=function(_0x1c6df9){for(var _0x363cdf=0x0,_0x4fcce4=events['length'];_0x363cdf<_0x4fcce4;_0x363cdf++){var _0x9f2705=events[_0x363cdf];var _0x2bf3fd=createListener(_0xc68f('0x6')+_0x9f2705,_0x1c6df9);VoicePrefixEvents['on'](_0x9f2705,_0x2bf3fd);}}; \ No newline at end of file +var _0x99b7=['emit','removeListener','register','length','voicePrefix:','./voicePrefix.events','remove'];(function(_0x24a26b,_0x49c278){var _0x3ebfd0=function(_0x2f1f9c){while(--_0x2f1f9c){_0x24a26b['push'](_0x24a26b['shift']());}};_0x3ebfd0(++_0x49c278);}(_0x99b7,0x14e));var _0x799b=function(_0xfbdff6,_0x2af690){_0xfbdff6=_0xfbdff6-0x0;var _0x4cb9be=_0x99b7[_0xfbdff6];return _0x4cb9be;};'use strict';var VoicePrefixEvents=require(_0x799b('0x0'));var events=['save',_0x799b('0x1'),'update'];function createListener(_0x5ae2c3,_0x58056f){return function(_0x41135c){_0x58056f[_0x799b('0x2')](_0x5ae2c3,_0x41135c);};}function removeListener(_0x43adef,_0x4cafd5){return function(){VoicePrefixEvents[_0x799b('0x3')](_0x43adef,_0x4cafd5);};}exports[_0x799b('0x4')]=function(_0x3959ed){for(var _0x70f082=0x0,_0xfd685a=events[_0x799b('0x5')];_0x70f082<_0xfd685a;_0x70f082++){var _0x4b901a=events[_0x70f082];var _0x418a70=createListener(_0x799b('0x6')+_0x4b901a,_0x3959ed);VoicePrefixEvents['on'](_0x4b901a,_0x418a70);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index 0cef068..7e5b99a 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 _0xb10b=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','isAuthenticated','show','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperBlacks','/:id/teams','getTeams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','/:id/blacklists','getBlackLists','post','create','/:id/clone','addTeams','addAgents','addLists','addBlackLists','put','/:id','update','delete','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','path','connect-timeout'];(function(_0x21f931,_0x598b2d){var _0x3f083c=function(_0x1c7c49){while(--_0x1c7c49){_0x21f931['push'](_0x21f931['shift']());}};_0x3f083c(++_0x598b2d);}(_0xb10b,0x12a));var _0xbb10=function(_0x35ec01,_0x5c44ac){_0x35ec01=_0x35ec01-0x0;var _0x4f75d5=_0xb10b[_0x35ec01];return _0x4f75d5;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0x9')](_0xbb10('0xf'),auth['isAuthenticated'](),controller['getHopperHistories']);router[_0xbb10('0x9')](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller['getHopperFinals']);router[_0xbb10('0x9')]('/:id/hopper_black',auth[_0xbb10('0xb')](),controller[_0xbb10('0x11')]);router[_0xbb10('0x9')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x13')]);router['get'](_0xbb10('0x14'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x15')]);router[_0xbb10('0x9')](_0xbb10('0x16'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x17')]);router[_0xbb10('0x9')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller['getLists']);router[_0xbb10('0x9')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1a')]);router[_0xbb10('0x1b')]('/',auth[_0xbb10('0xb')](),controller[_0xbb10('0x1c')]);router[_0xbb10('0x1b')](_0xbb10('0x1d'),auth[_0xbb10('0xb')](),controller['clone']);router[_0xbb10('0x1b')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1e')]);router[_0xbb10('0x1b')](_0xbb10('0x14'),auth['isAuthenticated'](),controller[_0xbb10('0x1f')]);router[_0xbb10('0x1b')]('/:id/lists',auth['isAuthenticated'](),controller[_0xbb10('0x20')]);router[_0xbb10('0x1b')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x21')]);router[_0xbb10('0x22')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x24')]);router[_0xbb10('0x25')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller['destroy']);router['delete']('/:id/teams',auth[_0xbb10('0xb')](),controller[_0xbb10('0x26')]);router[_0xbb10('0x25')]('/:id/users',auth[_0xbb10('0xb')](),controller[_0xbb10('0x27')]);router[_0xbb10('0x25')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x28')]);router[_0xbb10('0x25')]('/:id/blacklists',auth[_0xbb10('0xb')](),controller[_0xbb10('0x29')]);module[_0xbb10('0x2a')]=router; \ No newline at end of file +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(_0x384c23,_0x30cd65){var _0x1fdf67=function(_0x21d205){while(--_0x21d205){_0x384c23['push'](_0x384c23['shift']());}};_0x1fdf67(++_0x30cd65);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4e1d03,_0x786f3a){_0x4e1d03=_0x4e1d03-0x0;var _0x362d4b=_0xa9e0[_0x4e1d03];return _0x362d4b;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var 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 cfe1274..7bed55a 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 _0xbecd=['ringall','fewestcalls','random','rrmemory','linear','rrordered','strategy','getDataValue','type','dialMethod','preview','booked','roundrobin','includes','setDataValue','INTEGER','yes','once','TEXT','periodic_announce','join','joinempty','split','leavewhenempty','BOOLEAN','acw','wrapuptime','progressive','power','predictive','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','Active/Disactive\x20Recall\x20In\x20Queue','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','#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)','mandatoryDispositionPauseId','STRING','name','inbound','outbound','ENUM'];(function(_0x11b19f,_0x4cb2bf){var _0xc53c9d=function(_0x2bc447){while(--_0x2bc447){_0x11b19f['push'](_0x11b19f['shift']());}};_0xc53c9d(++_0x4cb2bf);}(_0xbecd,0x181));var _0xdbec=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xbecd[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xdbec('0x0')],'allowNull':![],'unique':_0xdbec('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0xdbec('0x2'),_0xdbec('0x3')),'allowNull':![],'defaultValue':_0xdbec('0x2')},'musiconhold':{'type':Sequelize['STRING'],'defaultValue':'default'},'announce':{'type':Sequelize[_0xdbec('0x0')],'defaultValue':''},'strategy':{'type':Sequelize[_0xdbec('0x4')]('rr',_0xdbec('0x5'),'leastrecent',_0xdbec('0x6'),_0xdbec('0x7'),_0xdbec('0x8'),_0xdbec('0x9'),'wrandom',_0xdbec('0xa')),'allowNull':![],'defaultValue':_0xdbec('0x5'),'set':function(_0x32af41){this['setDataValue'](_0xdbec('0xb'),_0x32af41?_0x32af41:_0xdbec('0x8'));},'get':function(){var _0x375d97=this[_0xdbec('0xc')](_0xdbec('0xd'));var _0x3d70a7=this[_0xdbec('0xc')](_0xdbec('0xe'));var _0x354df9=this[_0xdbec('0xc')](_0xdbec('0xb'));if(_0x375d97===_0xdbec('0x3')){if(_0x3d70a7===_0xdbec('0xf')){return null;}if(_0x3d70a7===_0xdbec('0x10')&&![_0xdbec('0x8'),_0xdbec('0x11')][_0xdbec('0x12')](_0x354df9)){this[_0xdbec('0x13')](_0xdbec('0xb'),_0xdbec('0x8'));}}return _0x354df9;}},'servicelevel':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0xdbec('0x0')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0xdbec('0x14')](0xb)},'timeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0xdbec('0x14')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0xdbec('0x0')]},'weight':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0xdbec('0x14')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize['ENUM'](_0xdbec('0x15'),'no'),'defaultValue':_0xdbec('0x15')},'autopause':{'type':Sequelize['ENUM'](_0xdbec('0x15'),'no','all'),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0xdbec('0x14')](0xb)},'autopausebusy':{'type':Sequelize['ENUM'](_0xdbec('0x15'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize['ENUM'](_0xdbec('0x15'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0xdbec('0x14')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0xdbec('0x4')](_0xdbec('0x15'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize['ENUM'](_0xdbec('0x15'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0xdbec('0x4')](_0xdbec('0x15'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0xdbec('0x4')](_0xdbec('0x15'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0xdbec('0x0')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0xdbec('0x0')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0xdbec('0x14')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0xdbec('0x14')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0xdbec('0x14')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0xdbec('0x4')](_0xdbec('0x15'),'no'),'defaultValue':_0xdbec('0x15')},'announce_holdtime':{'type':Sequelize[_0xdbec('0x4')](_0xdbec('0x15'),'no',_0xdbec('0x16')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0xdbec('0x0')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0xdbec('0x4')](_0xdbec('0x15'),'no')},'announce_position_limit':{'type':Sequelize[_0xdbec('0x14')](0xb)},'announce_round_seconds':{'type':Sequelize[_0xdbec('0x4')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize['STRING'],'defaultValue':''},'monitor_type':{'type':Sequelize['STRING']},'queue_youarenext':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0xdbec('0x0')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize['STRING'],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0xdbec('0x0')],'defaultValue':null},'queue_minute':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize['STRING'],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0xdbec('0x0')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0xdbec('0x0')],'defaultValue':null},'queue_reporthold':{'type':Sequelize['STRING']},'queue_quantity1':{'type':Sequelize[_0xdbec('0x0')]},'queue_quantity2':{'type':Sequelize['STRING']},'queue_periodic_announce':{'type':Sequelize[_0xdbec('0x0')]},'queue_less_than':{'type':Sequelize['STRING']},'periodic_announce':{'type':Sequelize[_0xdbec('0x17')],'set':function(_0x59e325){this[_0xdbec('0x13')](_0xdbec('0x18'),_0x59e325?_0x59e325[_0xdbec('0x19')](','):[]);},'get':function(){return this[_0xdbec('0xc')]('periodic_announce')?this[_0xdbec('0xc')](_0xdbec('0x18'))['split'](','):[];}},'joinempty':{'type':Sequelize['STRING'],'defaultValue':_0xdbec('0x15'),'set':function(_0x1ff329){this[_0xdbec('0x13')](_0xdbec('0x1a'),_0x1ff329?_0x1ff329['join'](','):undefined);},'get':function(){return this['getDataValue'](_0xdbec('0x1a'))?this[_0xdbec('0xc')](_0xdbec('0x1a'))[_0xdbec('0x1b')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0xdbec('0x0')],'defaultValue':'no','set':function(_0x194a14){this[_0xdbec('0x13')]('leavewhenempty',_0x194a14?_0x194a14[_0xdbec('0x19')](','):undefined);},'get':function(){return this['getDataValue'](_0xdbec('0x1c'))?this['getDataValue'](_0xdbec('0x1c'))[_0xdbec('0x1b')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0xdbec('0x4')]('yes','no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0xdbec('0x4')](_0xdbec('0x15'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0xdbec('0x4')]('yes','no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0xdbec('0x0')]},'description':{'type':Sequelize[_0xdbec('0x0')]},'acw':{'type':Sequelize[_0xdbec('0x1d')],'defaultValue':0x0,'set':function(_0x3c4e4f){this['setDataValue'](_0xdbec('0x1e'),_0x3c4e4f);if(_0x3c4e4f){if(this['getDataValue'](_0xdbec('0x1f'))<0x2){this[_0xdbec('0x13')](_0xdbec('0x1f'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0xdbec('0x14')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0xdbec('0x1d')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'dialMethod':{'type':Sequelize[_0xdbec('0x4')](_0xdbec('0xf'),_0xdbec('0x20'),_0xdbec('0x21'),_0xdbec('0x22'),_0xdbec('0x10')),'defaultValue':'progressive','comment':_0xdbec('0x23')},'dialLimitChannel':{'type':Sequelize[_0xdbec('0x14')](0x4)[_0xdbec('0x24')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xdbec('0x25')},'dialLimitQueue':{'type':Sequelize[_0xdbec('0x14')](0x4)[_0xdbec('0x24')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xdbec('0x26')},'dialPowerLevel':{'type':Sequelize[_0xdbec('0x27')](0x2)[_0xdbec('0x24')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0xdbec('0x28')},'dialPredictiveOptimization':{'type':Sequelize['ENUM'](_0xdbec('0x29'),_0xdbec('0x2a')),'defaultValue':_0xdbec('0x2a'),'comment':'Only\x20for\x20predictive\x20method.'},'dialPredictiveOptimizationPercentage':{'type':Sequelize['FLOAT'](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0xdbec('0x2b')},'dialPredictiveInterval':{'type':Sequelize[_0xdbec('0x14')](0x3)[_0xdbec('0x24')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0xdbec('0x2c')},'dialOriginateCallerIdName':{'type':Sequelize[_0xdbec('0x0')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xdbec('0x0')]},'dialOriginateTimeout':{'type':Sequelize[_0xdbec('0x14')](0x3)[_0xdbec('0x24')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdbec('0x2d')},'dialQueueOptions':{'type':Sequelize[_0xdbec('0x0')],'defaultValue':_0xdbec('0x2e'),'comment':'https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue'},'dialQueueTimeout':{'type':Sequelize[_0xdbec('0x14')](0x3)[_0xdbec('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdbec('0x2f')},'dialQueueProject':{'type':Sequelize[_0xdbec('0x0')],'comment':_0xdbec('0x30')},'dialCongestionMaxRetry':{'type':Sequelize[_0xdbec('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0xdbec('0x14')](0x5)[_0xdbec('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdbec('0x31')},'dialBusyMaxRetry':{'type':Sequelize[_0xdbec('0x14')](0x3)[_0xdbec('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdbec('0x32')},'dialBusyRetryFrequency':{'type':Sequelize[_0xdbec('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdbec('0x33')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xdbec('0x14')](0x3)[_0xdbec('0x24')],'defaultValue':0x3,'comment':_0xdbec('0x34')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xdbec('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xdbec('0x35')},'dialTimezone':{'type':Sequelize[_0xdbec('0x0')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xdbec('0x0')],'defaultValue':'07:00-22:00,*,*,*'},'dialPrefix':{'type':Sequelize[_0xdbec('0x0')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0xdbec('0x4')](_0xdbec('0x36'),_0xdbec('0x37'),_0xdbec('0x38')),'defaultValue':_0xdbec('0x36')},'dialAMDActive':{'type':Sequelize[_0xdbec('0x1d')],'defaultValue':0x0,'comment':_0xdbec('0x39')},'dialAMDInitialSilence':{'type':Sequelize[_0xdbec('0x14')](0x9)[_0xdbec('0x24')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xdbec('0x3a')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0xdbec('0x24')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xdbec('0x3b')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xdbec('0x14')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xdbec('0x3c')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0xdbec('0x14')](0x9)[_0xdbec('0x24')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xdbec('0x3d')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xdbec('0x14')](0x9)[_0xdbec('0x24')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xdbec('0x3e')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xdbec('0x14')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xdbec('0x3f')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xdbec('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0xdbec('0x14')](0x9)[_0xdbec('0x24')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialRecallMeTimeout':{'type':Sequelize[_0xdbec('0x14')](0x5)[_0xdbec('0x24')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':'#RecallMe\x20Timeout\x20(min:1)'},'dialRecallInQueue':{'type':Sequelize[_0xdbec('0x1d')],'defaultValue':0x0,'comment':_0xdbec('0x40')},'dialOrderByScheduledAt':{'type':Sequelize[_0xdbec('0x4')]('DESC','ASC'),'defaultValue':_0xdbec('0x41')},'dialQueueProject2':{'type':Sequelize[_0xdbec('0x0')],'comment':_0xdbec('0x30')},'dialAgiAfterHangupClient':{'type':Sequelize[_0xdbec('0x1d')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0xdbec('0x1d')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xdbec('0x14')](0x3)[_0xdbec('0x24')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xdbec('0x42')},'dialCutDigit':{'type':Sequelize[_0xdbec('0x14')](0x3)[_0xdbec('0x24')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xdbec('0x43')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xdbec('0x14')](0x3)[_0xdbec('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdbec('0x44')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xdbec('0x14')](0x5)[_0xdbec('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdbec('0x45')},'dialDropMaxRetry':{'type':Sequelize[_0xdbec('0x14')](0x3)[_0xdbec('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdbec('0x46')},'dialDropRetryFrequency':{'type':Sequelize[_0xdbec('0x14')](0x5)[_0xdbec('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xdbec('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdbec('0x47')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xdbec('0x14')](0x5)[_0xdbec('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdbec('0x48')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdbec('0x49')},'dialMachineRetryFrequency':{'type':Sequelize[_0xdbec('0x14')](0x5)[_0xdbec('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdbec('0x4a')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdbec('0x4b')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xdbec('0x14')](0x5)[_0xdbec('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdbec('0x4c')},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xdbec('0x1d')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x1bce3f){if(!_0x1bce3f)this[_0xdbec('0x13')](_0xdbec('0x4d'),null);this[_0xdbec('0x13')]('mandatoryDisposition',_0x1bce3f);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0xdbec('0x14')](0x3)['UNSIGNED'],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize['INTEGER'](0x3)[_0xdbec('0x24')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0xdbec('0x1d')],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0xdbec('0x14')](0x3)[_0xdbec('0x24')],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0xdbec('0x1d')],'defaultValue':![]}}; \ No newline at end of file +var _0xe54a=['BOOLEAN','progressive','predictive','booked','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)','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)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','#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','inbound','outbound','default','ringall','leastrecent','random','rrmemory','linear','wrandom','setDataValue','getDataValue','type','dialMethod','strategy','preview','roundrobin','INTEGER','yes','all','once','TEXT','join','periodic_announce','joinempty','leavewhenempty','split'];(function(_0x4b7e4d,_0x82d2ab){var _0x38d6af=function(_0x227432){while(--_0x227432){_0x4b7e4d['push'](_0x4b7e4d['shift']());}};_0x38d6af(++_0x82d2ab);}(_0xe54a,0x1b5));var _0xae54=function(_0x3d22b1,_0x25ec59){_0x3d22b1=_0x3d22b1-0x0;var _0x1e99e7=_0xe54a[_0x3d22b1];return _0x1e99e7;};'use strict';var Sequelize=require(_0xae54('0x0'));module[_0xae54('0x1')]={'name':{'type':Sequelize[_0xae54('0x2')],'allowNull':![],'unique':_0xae54('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xae54('0x4')](_0xae54('0x5'),_0xae54('0x6')),'allowNull':![],'defaultValue':_0xae54('0x5')},'musiconhold':{'type':Sequelize[_0xae54('0x2')],'defaultValue':_0xae54('0x7')},'announce':{'type':Sequelize[_0xae54('0x2')],'defaultValue':''},'strategy':{'type':Sequelize[_0xae54('0x4')]('rr',_0xae54('0x8'),_0xae54('0x9'),'fewestcalls',_0xae54('0xa'),_0xae54('0xb'),_0xae54('0xc'),_0xae54('0xd'),'rrordered'),'allowNull':![],'defaultValue':_0xae54('0x8'),'set':function(_0x4d9eb8){this[_0xae54('0xe')]('strategy',_0x4d9eb8?_0x4d9eb8:_0xae54('0xb'));},'get':function(){var _0x2ad65c=this[_0xae54('0xf')](_0xae54('0x10'));var _0x227d54=this[_0xae54('0xf')](_0xae54('0x11'));var _0x28bd95=this[_0xae54('0xf')](_0xae54('0x12'));if(_0x2ad65c===_0xae54('0x6')){if(_0x227d54===_0xae54('0x13')){return null;}if(_0x227d54==='booked'&&!['rrmemory',_0xae54('0x14')]['includes'](_0x28bd95)){this['setDataValue'](_0xae54('0x12'),'rrmemory');}}return _0x28bd95;}},'servicelevel':{'type':Sequelize[_0xae54('0x15')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0xae54('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0xae54('0x15')](0xb)},'timeout':{'type':Sequelize[_0xae54('0x15')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0xae54('0x15')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0xae54('0x2')]},'weight':{'type':Sequelize[_0xae54('0x15')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0xae54('0x16')},'autopause':{'type':Sequelize[_0xae54('0x4')](_0xae54('0x16'),'no',_0xae54('0x17')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0xae54('0x15')](0xb)},'autopausebusy':{'type':Sequelize[_0xae54('0x4')](_0xae54('0x16'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0xae54('0x4')](_0xae54('0x16'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0xae54('0x15')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize['ENUM'](_0xae54('0x16'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize['ENUM'](_0xae54('0x16'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0xae54('0x4')](_0xae54('0x16'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0xae54('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0xae54('0x2')],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0xae54('0x4')]('yes','no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0xae54('0x4')](_0xae54('0x16'),'no'),'defaultValue':_0xae54('0x16')},'announce_holdtime':{'type':Sequelize[_0xae54('0x4')](_0xae54('0x16'),'no',_0xae54('0x18')),'defaultValue':'no'},'announce_position':{'type':Sequelize['STRING'],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize['ENUM'](_0xae54('0x16'),'no')},'announce_position_limit':{'type':Sequelize[_0xae54('0x15')](0xb)},'announce_round_seconds':{'type':Sequelize[_0xae54('0x4')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0xae54('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0xae54('0x2')]},'queue_youarenext':{'type':Sequelize[_0xae54('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0xae54('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize['STRING'],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0xae54('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0xae54('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0xae54('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0xae54('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize['STRING']},'queue_quantity1':{'type':Sequelize['STRING']},'queue_quantity2':{'type':Sequelize[_0xae54('0x2')]},'queue_periodic_announce':{'type':Sequelize[_0xae54('0x2')]},'queue_less_than':{'type':Sequelize['STRING']},'periodic_announce':{'type':Sequelize[_0xae54('0x19')],'set':function(_0x3038b0){this['setDataValue']('periodic_announce',_0x3038b0?_0x3038b0[_0xae54('0x1a')](','):[]);},'get':function(){return this[_0xae54('0xf')](_0xae54('0x1b'))?this[_0xae54('0xf')](_0xae54('0x1b'))['split'](','):[];}},'joinempty':{'type':Sequelize['STRING'],'defaultValue':'yes','set':function(_0x4edafa){this[_0xae54('0xe')](_0xae54('0x1c'),_0x4edafa?_0x4edafa[_0xae54('0x1a')](','):undefined);},'get':function(){return this['getDataValue'](_0xae54('0x1c'))?this[_0xae54('0xf')](_0xae54('0x1c'))['split'](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0xae54('0x2')],'defaultValue':'no','set':function(_0x38221e){this['setDataValue'](_0xae54('0x1d'),_0x38221e?_0x38221e['join'](','):undefined);},'get':function(){return this[_0xae54('0xf')](_0xae54('0x1d'))?this[_0xae54('0xf')](_0xae54('0x1d'))[_0xae54('0x1e')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0xae54('0x4')](_0xae54('0x16'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0xae54('0x4')]('yes','no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0xae54('0x15')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0xae54('0x4')](_0xae54('0x16'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0xae54('0x2')]},'description':{'type':Sequelize['STRING']},'acw':{'type':Sequelize[_0xae54('0x1f')],'defaultValue':0x0,'set':function(_0x5bb2a6){this[_0xae54('0xe')]('acw',_0x5bb2a6);if(_0x5bb2a6){if(this[_0xae54('0xf')]('wrapuptime')<0x2){this[_0xae54('0xe')]('wrapuptime',0x2);}}}},'acwTimeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'dialMethod':{'type':Sequelize['ENUM'](_0xae54('0x13'),_0xae54('0x20'),'power',_0xae54('0x21'),_0xae54('0x22')),'defaultValue':_0xae54('0x20'),'comment':_0xae54('0x23')},'dialLimitChannel':{'type':Sequelize['INTEGER'](0x4)[_0xae54('0x24')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xae54('0x25')},'dialLimitQueue':{'type':Sequelize[_0xae54('0x15')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xae54('0x26')},'dialPowerLevel':{'type':Sequelize[_0xae54('0x27')](0x2)[_0xae54('0x24')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0xae54('0x28')},'dialPredictiveOptimization':{'type':Sequelize['ENUM'](_0xae54('0x29'),'dropRate'),'defaultValue':_0xae54('0x2a'),'comment':_0xae54('0x2b')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0xae54('0x27')](0x2)[_0xae54('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0xae54('0x2c')},'dialPredictiveInterval':{'type':Sequelize['INTEGER'](0x3)[_0xae54('0x24')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0xae54('0x2d')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xae54('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0xae54('0x15')](0x3)[_0xae54('0x24')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueOptions':{'type':Sequelize[_0xae54('0x2')],'defaultValue':_0xae54('0x2e'),'comment':_0xae54('0x2f')},'dialQueueTimeout':{'type':Sequelize[_0xae54('0x15')](0x3)[_0xae54('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xae54('0x30')},'dialQueueProject':{'type':Sequelize[_0xae54('0x2')],'comment':_0xae54('0x31')},'dialCongestionMaxRetry':{'type':Sequelize[_0xae54('0x15')](0x3)[_0xae54('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0xae54('0x15')](0x5)[_0xae54('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xae54('0x32')},'dialBusyMaxRetry':{'type':Sequelize[_0xae54('0x15')](0x3)[_0xae54('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0xae54('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xae54('0x33')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xae54('0x15')](0x3)[_0xae54('0x24')],'defaultValue':0x3,'comment':_0xae54('0x34')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xae54('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xae54('0x35')},'dialGlobalMaxRetry':{'type':Sequelize[_0xae54('0x15')](0x3)[_0xae54('0x24')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xae54('0x36')},'dialTimezone':{'type':Sequelize[_0xae54('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0xae54('0x37')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM']('always','never','onlyIfOpen'),'defaultValue':_0xae54('0x38')},'dialAMDActive':{'type':Sequelize[_0xae54('0x1f')],'defaultValue':0x0,'comment':_0xae54('0x39')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0xae54('0x24')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xae54('0x3a')},'dialAMDGreeting':{'type':Sequelize[_0xae54('0x15')](0x9)[_0xae54('0x24')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xae54('0x3b')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0xae54('0x24')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xae54('0x15')](0x9)[_0xae54('0x24')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xae54('0x3c')},'dialAMDMinWordLength':{'type':Sequelize[_0xae54('0x15')](0x9)[_0xae54('0x24')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xae54('0x3d')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xae54('0x15')](0x9)[_0xae54('0x24')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xae54('0x3e')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0xae54('0x24')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xae54('0x3f')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xae54('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0xae54('0x15')](0x9)[_0xae54('0x24')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialRecallMeTimeout':{'type':Sequelize[_0xae54('0x15')](0x5)[_0xae54('0x24')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0xae54('0x40')},'dialRecallInQueue':{'type':Sequelize[_0xae54('0x1f')],'defaultValue':0x0,'comment':_0xae54('0x41')},'dialOrderByScheduledAt':{'type':Sequelize[_0xae54('0x4')](_0xae54('0x42'),_0xae54('0x43')),'defaultValue':_0xae54('0x42')},'dialQueueProject2':{'type':Sequelize[_0xae54('0x2')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialAgiAfterHangupClient':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0xae54('0x24')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0xae54('0x24')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xae54('0x15')](0x3)[_0xae54('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xae54('0x44')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xae54('0x15')](0x5)[_0xae54('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0xae54('0x15')](0x3)[_0xae54('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0xae54('0x15')](0x5)[_0xae54('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xae54('0x45')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xae54('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xae54('0x46')},'dialMachineMaxRetry':{'type':Sequelize[_0xae54('0x15')](0x3)[_0xae54('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xae54('0x47')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xae54('0x48')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xae54('0x15')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xae54('0x49')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xae54('0x15')](0x5)[_0xae54('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xae54('0x4a')},'mandatoryDispositionPauseId':{'type':Sequelize[_0xae54('0x15')],'allowNull':!![],'comment':_0xae54('0x4b')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xae54('0x4c'),'set':function(_0x5b46a4){if(!_0x5b46a4)this[_0xae54('0xe')](_0xae54('0x4d'),null);this[_0xae54('0xe')]('mandatoryDisposition',_0x5b46a4);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize['INTEGER'](0x3)[_0xae54('0x24')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0xae54('0x1f')],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0xae54('0x15')](0x3)['UNSIGNED'],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0xae54('0x1f')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index 94618b7..0983c39 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 _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(_0x2e49cc,_0x1f72a7){var _0xa0c6c1=function(_0x38b018){while(--_0x38b018){_0x2e49cc['push'](_0x2e49cc['shift']());}};_0xa0c6c1(++_0x1f72a7);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x54d2bd,_0x57c539){_0x54d2bd=_0x54d2bd-0x0;var _0x34f0d4=_0x7fbe[_0x54d2bd];return _0x34f0d4;};'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 +var _0xa41a=['createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','getHoppers','CmHopper','filters','nolimit','order','sort','pick','VoiceQueueId','getHopperHistories','CmHopperHistory','hasOwnProperty','getHopperFinals','findOne','CmHopperFinal','getHopperBlacks','CmHopperBlack','Team','getTeams','teams','User','Agents','online','voicePause','interface','forEach','penalty','sequelize','transaction','addTeams','each','TeamVoiceQueue','upsert','UserVoiceQueue','findOrCreate','UserVoiceQueueRt','isNil','format','SIP/%s','emit','ids','field','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','all','union','compact','removeTeams','isEmpty','removeAgents','addAgents','spread','userVoiceQueue:remove','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','select','CmListId','cm_contacts','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','onlyIfOpen','deletedAt\x20IS\x20NULL','CmHopperId','OrderBy','h.id','ci.item','ci.OrderBy+1','cm_contact_has_items','h.scheduledat=?','ci.ItemClass=?','PHONE','removeLists','getBlackLists','addBlackLists','cm_hopper_black','NOW()','removeBlackLists','moment','bluebird','lodash','squel','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','./voiceQueue.socket','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','update','then','get','inbound','QueueCampaigns','filter','map','value','includes','type','find','name','UserProfileResource','destroy','error','stack','send','index','rawAttributes','key','where','include','VoiceQueue','findAll','rows','catch','params','model','query','keys','attributes','intersection','fields','length','merge','options','create','body','user','role','VoiceQueues','outbound','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','includeAll','omit'];(function(_0x41b58a,_0x2c8e4a){var _0x5c9819=function(_0x33ad04){while(--_0x33ad04){_0x41b58a['push'](_0x41b58a['shift']());}};_0x5c9819(++_0x2c8e4a);}(_0xa41a,0x6b));var _0xaa41=function(_0x5e271c,_0x125cee){_0x5e271c=_0x5e271c-0x0;var _0x3bf784=_0xa41a[_0x5e271c];return _0x3bf784;};'use strict';var moment=require(_0xaa41('0x0'));var BPromise=require(_0xaa41('0x1'));var util=require('util');var _=require(_0xaa41('0x2'));var squel=require(_0xaa41('0x3'));var Redis=require(_0xaa41('0x4'));var qs=require(_0xaa41('0x5'));var logger=require(_0xaa41('0x6'))(_0xaa41('0x7'));var config=require(_0xaa41('0x8'));var db=require(_0xaa41('0x9'))['db'];config['redis']=_[_0xaa41('0xa')](config[_0xaa41('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xaa41('0xb')]));require(_0xaa41('0xc'))['register'](socket);function respondWithStatusCode(_0x31df43,_0x33f66b){_0x33f66b=_0x33f66b||0xcc;return function(_0x409dab){if(_0x409dab){return _0x31df43[_0xaa41('0xd')](_0x33f66b);}return _0x31df43[_0xaa41('0xe')](_0x33f66b)[_0xaa41('0xf')]();};}function respondWithResult(_0x806f08,_0x423a19){_0x423a19=_0x423a19||0xc8;return function(_0x1c291e){if(_0x1c291e){return _0x806f08['status'](_0x423a19)[_0xaa41('0x10')](_0x1c291e);}};}function respondWithFilteredResult(_0x10cda9,_0x524cab){return function(_0x54827c){if(_0x54827c){var _0x1d0a54=typeof _0x524cab['offset']===_0xaa41('0x11')&&typeof _0x524cab[_0xaa41('0x12')]===_0xaa41('0x11');var _0x889d44=_0x54827c[_0xaa41('0x13')];var _0x4eaf81=_0x1d0a54?0x0:_0x524cab[_0xaa41('0x14')];var _0x178170=_0x1d0a54?_0x54827c[_0xaa41('0x13')]:_0x524cab[_0xaa41('0x14')]+_0x524cab[_0xaa41('0x12')];var _0x2005ae;if(_0x178170>=_0x889d44){_0x178170=_0x889d44;_0x2005ae=0xc8;}else{_0x2005ae=0xce;}_0x10cda9[_0xaa41('0xe')](_0x2005ae);return _0x10cda9['set'](_0xaa41('0x15'),_0x4eaf81+'-'+_0x178170+'/'+_0x889d44)[_0xaa41('0x10')](_0x54827c);}return null;};}function saveUpdates(_0x4210fa){return function(_0x391b01){if(_0x391b01){return _0x391b01[_0xaa41('0x16')](_0x4210fa)[_0xaa41('0x17')](function(_0x29efe5){return _0x29efe5;});}return null;};}function removeEntity(_0x46e6d3){return function(_0x150ddf){if(_0x150ddf){return _0x150ddf['destroy']()['then'](function(){var _0x1f502a=_0x150ddf[_0xaa41('0x18')]({'plain':!![]});var _0x35c753=[{'name':'VoiceQueues','value':_0xaa41('0x19'),'ignore':![]},{'name':_0xaa41('0x1a'),'value':'outbound','ignore':![]}];var _0x513c61=_(_0x35c753)[_0xaa41('0x1b')]('ignore')[_0xaa41('0x1c')](_0xaa41('0x1d'))[_0xaa41('0x1d')]();if(_[_0xaa41('0x1e')](_0x513c61,_0x1f502a[_0xaa41('0x1f')])){return;}var _0x4eb01f=_[_0xaa41('0x20')](_0x35c753,[_0xaa41('0x1d'),_0x1f502a[_0xaa41('0x1f')]])[_0xaa41('0x21')];return db[_0xaa41('0x22')][_0xaa41('0x23')]({'where':{'type':_0x4eb01f,'resourceId':_0x1f502a['id']}})['then'](function(){return _0x150ddf;});})['then'](function(){_0x46e6d3[_0xaa41('0xe')](0xcc)['end']();});}};}function handleEntityNotFound(_0x493a10){return function(_0x12e362){if(!_0x12e362){_0x493a10['sendStatus'](0x194);}return _0x12e362;};}function handleError(_0x536bed,_0x2d0ac0){_0x2d0ac0=_0x2d0ac0||0x1f4;return function(_0x9c8c21){logger[_0xaa41('0x24')](_0x9c8c21[_0xaa41('0x25')]);if(_0x9c8c21[_0xaa41('0x21')]){delete _0x9c8c21[_0xaa41('0x21')];}_0x536bed['status'](_0x2d0ac0)[_0xaa41('0x26')](_0x9c8c21);};}exports[_0xaa41('0x27')]=function(_0x63c18c,_0x9a16e3){var _0x1d8c2b={};var _0x4466a3={'count':0x0,'rows':[]};var _0x30f88e=_[_0xaa41('0x1c')](db['VoiceQueue'][_0xaa41('0x28')],function(_0x48b48b){return{'name':_0x48b48b['fieldName'],'type':_0x48b48b[_0xaa41('0x1f')][_0xaa41('0x29')]};});_0x1d8c2b=qs['getOptions'](_0x30f88e,_0x63c18c);var _0x392b5d={'where':_0x1d8c2b[_0xaa41('0x2a')]};return db['VoiceQueue']['count'](_0x392b5d)['then'](function(_0x1cf3da){_0x4466a3[_0xaa41('0x13')]=_0x1cf3da;_0x1d8c2b[_0xaa41('0x2b')]=qs[_0xaa41('0x2b')](_0x63c18c['query']);return db[_0xaa41('0x2c')][_0xaa41('0x2d')](_0x1d8c2b);})[_0xaa41('0x17')](function(_0x4de770){_0x4466a3[_0xaa41('0x2e')]=_0x4de770;return _0x4466a3;})[_0xaa41('0x17')](respondWithFilteredResult(_0x9a16e3,_0x1d8c2b))[_0xaa41('0x2f')](handleError(_0x9a16e3,null));};exports['show']=function(_0x252c62,_0x374117){var _0x57fe1d={'raw':![],'where':{'id':_0x252c62[_0xaa41('0x30')]['id']}},_0x23eb50={};_0x23eb50[_0xaa41('0x31')]=_['keys'](db[_0xaa41('0x2c')]['rawAttributes']);_0x23eb50[_0xaa41('0x32')]=_[_0xaa41('0x33')](_0x252c62[_0xaa41('0x32')]);_0x23eb50['filters']=_['intersection'](_0x23eb50['model'],_0x23eb50[_0xaa41('0x32')]);_0x57fe1d[_0xaa41('0x34')]=_[_0xaa41('0x35')](_0x23eb50[_0xaa41('0x31')],qs['fields'](_0x252c62['query'][_0xaa41('0x36')]));_0x57fe1d[_0xaa41('0x34')]=_0x57fe1d[_0xaa41('0x34')][_0xaa41('0x37')]?_0x57fe1d[_0xaa41('0x34')]:_0x23eb50[_0xaa41('0x31')];if(_0x252c62[_0xaa41('0x32')]['includeAll']){_0x57fe1d[_0xaa41('0x2b')]=[{'all':!![]}];}_0x57fe1d=_[_0xaa41('0x38')]({},_0x57fe1d,_0x252c62[_0xaa41('0x39')]);return db[_0xaa41('0x2c')]['find'](_0x57fe1d)['then'](handleEntityNotFound(_0x374117,null))[_0xaa41('0x17')](respondWithResult(_0x374117,null))[_0xaa41('0x2f')](handleError(_0x374117,null));};exports['create']=function(_0x4101ab,_0x563687){return db[_0xaa41('0x2c')][_0xaa41('0x3a')](_0x4101ab[_0xaa41('0x3b')],{})[_0xaa41('0x17')](function(_0x3e6cac){var _0x12ba1a=_0x4101ab[_0xaa41('0x3c')][_0xaa41('0x18')]({'plain':!![]});if(!_0x12ba1a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x12ba1a[_0xaa41('0x3d')]===_0xaa41('0x3c')){var _0x35c685=_0x3e6cac[_0xaa41('0x18')]({'plain':!![]});var _0xc84fb8=[{'name':_0xaa41('0x3e'),'value':'inbound'},{'name':'QueueCampaigns','value':_0xaa41('0x3f')}];var _0x4f9086=_[_0xaa41('0x20')](_0xc84fb8,[_0xaa41('0x1d'),_0x35c685[_0xaa41('0x1f')]])[_0xaa41('0x21')];return db[_0xaa41('0x40')][_0xaa41('0x20')]({'where':{'name':_0x4f9086,'userProfileId':_0x12ba1a[_0xaa41('0x41')]},'raw':!![]})['then'](function(_0x124992){if(_0x124992&&_0x124992['autoAssociation']===0x0){return db['UserProfileResource'][_0xaa41('0x3a')]({'name':_0x35c685['name'],'resourceId':_0x35c685['id'],'type':_0x124992['name'],'sectionId':_0x124992['id']},{})['then'](function(){return _0x3e6cac;});}else{return _0x3e6cac;}})[_0xaa41('0x2f')](function(_0x525b09){logger[_0xaa41('0x24')](_0xaa41('0x42'),_0x525b09);throw _0x525b09;});}return _0x3e6cac;})['then'](respondWithResult(_0x563687,0xc9))['catch'](handleError(_0x563687,null));};exports[_0xaa41('0x43')]=function(_0x1b7b97,_0x1bb973){var _0x2af8ba={'where':{'id':_0x1b7b97[_0xaa41('0x30')]['id']}},_0x3fe1a9={};_0x3fe1a9[_0xaa41('0x31')]=_[_0xaa41('0x33')](db[_0xaa41('0x2c')]['rawAttributes']);_0x2af8ba[_0xaa41('0x34')]=_[_0xaa41('0x35')](_0x3fe1a9[_0xaa41('0x31')],qs[_0xaa41('0x36')](_0x1b7b97[_0xaa41('0x32')][_0xaa41('0x36')]));_0x2af8ba['attributes']=_0x2af8ba[_0xaa41('0x34')][_0xaa41('0x37')]?_0x2af8ba[_0xaa41('0x34')]:_0x3fe1a9[_0xaa41('0x31')];if(_0x1b7b97['query'][_0xaa41('0x44')]){_0x2af8ba['include']=[{'all':!![]}];}_0x2af8ba=_['merge']({},_0x2af8ba,_0x1b7b97[_0xaa41('0x39')]);return db[_0xaa41('0x2c')][_0xaa41('0x20')](_0x2af8ba)['then'](handleEntityNotFound(_0x1bb973,null))[_0xaa41('0x17')](function(_0x3e1a73){if(_0x3e1a73){var _0x853ccb=_0x3e1a73['get']({'plain':!![]});_0x853ccb=qs[_0xaa41('0x45')](_0x853ccb,['id',_0xaa41('0x46'),_0xaa41('0x47')]);_0x1b7b97[_0xaa41('0x3b')]=_[_0xaa41('0x45')](_0x1b7b97[_0xaa41('0x3b')],['id',_0xaa41('0x46'),_0xaa41('0x47')]);return db['VoiceQueue'][_0xaa41('0x3a')](_['merge'](_0x853ccb,_0x1b7b97['body']),{'include':_0x1b7b97[_0xaa41('0x32')][_0xaa41('0x44')]?[{'all':!![]}]:undefined})[_0xaa41('0x17')](function(_0x11f7d9){var _0x14aab0=_0x1b7b97[_0xaa41('0x3c')][_0xaa41('0x18')]({'plain':!![]});if(!_0x14aab0)throw new Error(_0xaa41('0x48'));if(_0x14aab0['role']===_0xaa41('0x3c')){var _0x14b0f0=_0x11f7d9[_0xaa41('0x18')]({'plain':!![]});var _0x4f9e92=[{'name':_0xaa41('0x3e'),'value':_0xaa41('0x19')},{'name':'QueueCampaigns','value':_0xaa41('0x3f')}];var _0xd36d1a=_[_0xaa41('0x20')](_0x4f9e92,['value',_0x14b0f0[_0xaa41('0x1f')]])[_0xaa41('0x21')];return db['UserProfileSection']['find']({'where':{'name':_0xd36d1a,'userProfileId':_0x14aab0[_0xaa41('0x41')]},'raw':!![]})[_0xaa41('0x17')](function(_0x3a29d2){if(_0x3a29d2&&_0x3a29d2['autoAssociation']===0x0){return db[_0xaa41('0x22')][_0xaa41('0x3a')]({'name':_0x14b0f0[_0xaa41('0x21')],'resourceId':_0x14b0f0['id'],'type':_0x3a29d2[_0xaa41('0x21')],'sectionId':_0x3a29d2['id']},{})[_0xaa41('0x17')](function(){return _0x11f7d9;});}else{return _0x11f7d9;}})['catch'](function(_0x2ae70c){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2ae70c);throw _0x2ae70c;});}return _0x11f7d9;});}})[_0xaa41('0x17')](respondWithResult(_0x1bb973,0xc9))['catch'](handleError(_0x1bb973,null));};exports[_0xaa41('0x16')]=function(_0xbbf261,_0x169ddf){if(_0xbbf261['body']['id']){delete _0xbbf261[_0xaa41('0x3b')]['id'];}return db[_0xaa41('0x2c')][_0xaa41('0x20')]({'where':{'id':_0xbbf261[_0xaa41('0x30')]['id']}})[_0xaa41('0x17')](handleEntityNotFound(_0x169ddf,null))[_0xaa41('0x17')](saveUpdates(_0xbbf261[_0xaa41('0x3b')],null))[_0xaa41('0x17')](respondWithResult(_0x169ddf,null))[_0xaa41('0x2f')](handleError(_0x169ddf,null));};exports['destroy']=function(_0x35a09e,_0x40cdfc){return db[_0xaa41('0x2c')]['find']({'where':{'id':_0x35a09e[_0xaa41('0x30')]['id']}})[_0xaa41('0x17')](handleEntityNotFound(_0x40cdfc,null))[_0xaa41('0x17')](removeEntity(_0x40cdfc,null))[_0xaa41('0x2f')](handleError(_0x40cdfc,null));};exports[_0xaa41('0x49')]=function(_0xfbe748,_0x320ce7){var _0x5ea056={'raw':![],'where':{}};var _0x55a85c={};var _0x5cb34d={'count':0x0,'rows':[]};return db['VoiceQueue']['findOne']({'where':{'id':_0xfbe748['params']['id']}})[_0xaa41('0x17')](handleEntityNotFound(_0x320ce7,null))['then'](function(_0x576e6e){if(_0x576e6e){_0x55a85c[_0xaa41('0x31')]=_[_0xaa41('0x33')](db[_0xaa41('0x4a')][_0xaa41('0x28')]);_0x55a85c['query']=_[_0xaa41('0x33')](_0xfbe748[_0xaa41('0x32')]);_0x55a85c[_0xaa41('0x4b')]=_[_0xaa41('0x35')](_0x55a85c[_0xaa41('0x31')],_0x55a85c[_0xaa41('0x32')]);_0x5ea056[_0xaa41('0x34')]=_[_0xaa41('0x35')](_0x55a85c[_0xaa41('0x31')],qs['fields'](_0xfbe748[_0xaa41('0x32')][_0xaa41('0x36')]));_0x5ea056['attributes']=_0x5ea056['attributes']['length']?_0x5ea056[_0xaa41('0x34')]:_0x55a85c['model'];if(!_0xfbe748[_0xaa41('0x32')]['hasOwnProperty'](_0xaa41('0x4c'))){_0x5ea056[_0xaa41('0x12')]=qs['limit'](_0xfbe748[_0xaa41('0x32')][_0xaa41('0x12')]);_0x5ea056[_0xaa41('0x14')]=qs[_0xaa41('0x14')](_0xfbe748['query']['offset']);}_0x5ea056[_0xaa41('0x4d')]=qs[_0xaa41('0x4e')](_0xfbe748['query']['sort']);_0x5ea056[_0xaa41('0x2a')]=qs[_0xaa41('0x4b')](_[_0xaa41('0x4f')](_0xfbe748[_0xaa41('0x32')],_0x55a85c[_0xaa41('0x4b')]));_0x5ea056['where'][_0xaa41('0x50')]=_0x576e6e['id'];if(_0xfbe748['query']['filter']){_0x5ea056['where']=_[_0xaa41('0x38')](_0x5ea056[_0xaa41('0x2a')],{'$or':_[_0xaa41('0x1c')](_0x5ea056['attributes'],function(_0x229297){var _0x2adf93={};_0x2adf93[_0x229297]={'$like':'%'+_0xfbe748[_0xaa41('0x32')][_0xaa41('0x1b')]+'%'};return _0x2adf93;})});}_0x5ea056=_[_0xaa41('0x38')]({},_0x5ea056,_0xfbe748[_0xaa41('0x39')]);return db[_0xaa41('0x4a')]['count']({'where':_0x5ea056[_0xaa41('0x2a')]})[_0xaa41('0x17')](function(_0x40b47c){_0x5cb34d[_0xaa41('0x13')]=_0x40b47c;if(_0xfbe748['query'][_0xaa41('0x44')]){_0x5ea056['include']=[{'all':!![]}];}return db[_0xaa41('0x4a')][_0xaa41('0x2d')](_0x5ea056);})[_0xaa41('0x17')](function(_0x143ef0){_0x5cb34d['rows']=_0x143ef0;return _0x5cb34d;});}})[_0xaa41('0x17')](respondWithFilteredResult(_0x320ce7,_0x5ea056))[_0xaa41('0x2f')](handleError(_0x320ce7,null));};exports[_0xaa41('0x51')]=function(_0x304aad,_0x59052d){var _0x140d78={'raw':!![],'where':{}};var _0x50197b={};var _0x55d380={'count':0x0,'rows':[]};return db[_0xaa41('0x2c')]['findOne']({'where':{'id':_0x304aad[_0xaa41('0x30')]['id']}})[_0xaa41('0x17')](handleEntityNotFound(_0x59052d,null))[_0xaa41('0x17')](function(_0x582d79){if(_0x582d79){_0x50197b[_0xaa41('0x31')]=_[_0xaa41('0x33')](db[_0xaa41('0x52')][_0xaa41('0x28')]);_0x50197b[_0xaa41('0x32')]=_[_0xaa41('0x33')](_0x304aad[_0xaa41('0x32')]);_0x50197b['filters']=_[_0xaa41('0x35')](_0x50197b[_0xaa41('0x31')],_0x50197b[_0xaa41('0x32')]);_0x140d78['attributes']=_['intersection'](_0x50197b[_0xaa41('0x31')],qs[_0xaa41('0x36')](_0x304aad['query'][_0xaa41('0x36')]));_0x140d78[_0xaa41('0x34')]=_0x140d78['attributes'][_0xaa41('0x37')]?_0x140d78[_0xaa41('0x34')]:_0x50197b[_0xaa41('0x31')];if(!_0x304aad[_0xaa41('0x32')][_0xaa41('0x53')](_0xaa41('0x4c'))){_0x140d78[_0xaa41('0x12')]=qs[_0xaa41('0x12')](_0x304aad['query']['limit']);_0x140d78[_0xaa41('0x14')]=qs['offset'](_0x304aad[_0xaa41('0x32')][_0xaa41('0x14')]);}_0x140d78[_0xaa41('0x4d')]=qs['sort'](_0x304aad[_0xaa41('0x32')][_0xaa41('0x4e')]);_0x140d78[_0xaa41('0x2a')]=qs['filters'](_[_0xaa41('0x4f')](_0x304aad[_0xaa41('0x32')],_0x50197b['filters']));_0x140d78[_0xaa41('0x2a')]['VoiceQueueId']=_0x582d79['id'];if(_0x304aad['query'][_0xaa41('0x1b')]){_0x140d78[_0xaa41('0x2a')]=_['merge'](_0x140d78['where'],{'$or':_[_0xaa41('0x1c')](_0x140d78[_0xaa41('0x34')],function(_0x3c189d){var _0x447183={};_0x447183[_0x3c189d]={'$like':'%'+_0x304aad['query'][_0xaa41('0x1b')]+'%'};return _0x447183;})});}_0x140d78=_[_0xaa41('0x38')]({},_0x140d78,_0x304aad[_0xaa41('0x39')]);return db['CmHopperHistory'][_0xaa41('0x13')]({'where':_0x140d78[_0xaa41('0x2a')]})[_0xaa41('0x17')](function(_0x5697b6){_0x55d380[_0xaa41('0x13')]=_0x5697b6;if(_0x304aad['query']['includeAll']){_0x140d78[_0xaa41('0x2b')]=[{'all':!![]}];}return db[_0xaa41('0x52')]['findAll'](_0x140d78);})[_0xaa41('0x17')](function(_0x9e8ebb){_0x55d380[_0xaa41('0x2e')]=_0x9e8ebb;return _0x55d380;});}})['then'](respondWithFilteredResult(_0x59052d,_0x140d78))[_0xaa41('0x2f')](handleError(_0x59052d,null));};exports[_0xaa41('0x54')]=function(_0x1a2deb,_0x16dcac){var _0x38f5d0={'raw':!![],'where':{}};var _0x4e087d={};var _0x24eb2e={'count':0x0,'rows':[]};return db['VoiceQueue'][_0xaa41('0x55')]({'where':{'id':_0x1a2deb[_0xaa41('0x30')]['id']}})[_0xaa41('0x17')](handleEntityNotFound(_0x16dcac,null))[_0xaa41('0x17')](function(_0x33ec81){if(_0x33ec81){_0x4e087d[_0xaa41('0x31')]=_[_0xaa41('0x33')](db[_0xaa41('0x56')][_0xaa41('0x28')]);_0x4e087d[_0xaa41('0x32')]=_[_0xaa41('0x33')](_0x1a2deb['query']);_0x4e087d[_0xaa41('0x4b')]=_[_0xaa41('0x35')](_0x4e087d['model'],_0x4e087d[_0xaa41('0x32')]);_0x38f5d0['attributes']=_[_0xaa41('0x35')](_0x4e087d[_0xaa41('0x31')],qs[_0xaa41('0x36')](_0x1a2deb[_0xaa41('0x32')][_0xaa41('0x36')]));_0x38f5d0[_0xaa41('0x34')]=_0x38f5d0[_0xaa41('0x34')]['length']?_0x38f5d0[_0xaa41('0x34')]:_0x4e087d[_0xaa41('0x31')];if(!_0x1a2deb[_0xaa41('0x32')][_0xaa41('0x53')]('nolimit')){_0x38f5d0[_0xaa41('0x12')]=qs['limit'](_0x1a2deb[_0xaa41('0x32')][_0xaa41('0x12')]);_0x38f5d0[_0xaa41('0x14')]=qs[_0xaa41('0x14')](_0x1a2deb[_0xaa41('0x32')]['offset']);}_0x38f5d0[_0xaa41('0x4d')]=qs[_0xaa41('0x4e')](_0x1a2deb['query'][_0xaa41('0x4e')]);_0x38f5d0[_0xaa41('0x2a')]=qs[_0xaa41('0x4b')](_[_0xaa41('0x4f')](_0x1a2deb[_0xaa41('0x32')],_0x4e087d[_0xaa41('0x4b')]));_0x38f5d0[_0xaa41('0x2a')][_0xaa41('0x50')]=_0x33ec81['id'];if(_0x1a2deb['query'][_0xaa41('0x1b')]){_0x38f5d0[_0xaa41('0x2a')]=_[_0xaa41('0x38')](_0x38f5d0[_0xaa41('0x2a')],{'$or':_[_0xaa41('0x1c')](_0x38f5d0[_0xaa41('0x34')],function(_0x5489be){var _0x56f5ff={};_0x56f5ff[_0x5489be]={'$like':'%'+_0x1a2deb['query'][_0xaa41('0x1b')]+'%'};return _0x56f5ff;})});}_0x38f5d0=_[_0xaa41('0x38')]({},_0x38f5d0,_0x1a2deb['options']);return db[_0xaa41('0x56')][_0xaa41('0x13')]({'where':_0x38f5d0['where']})[_0xaa41('0x17')](function(_0x1da898){_0x24eb2e[_0xaa41('0x13')]=_0x1da898;if(_0x1a2deb[_0xaa41('0x32')]['includeAll']){_0x38f5d0[_0xaa41('0x2b')]=[{'all':!![]}];}return db['CmHopperFinal'][_0xaa41('0x2d')](_0x38f5d0);})[_0xaa41('0x17')](function(_0x374873){_0x24eb2e[_0xaa41('0x2e')]=_0x374873;return _0x24eb2e;});}})[_0xaa41('0x17')](respondWithFilteredResult(_0x16dcac,_0x38f5d0))[_0xaa41('0x2f')](handleError(_0x16dcac,null));};exports[_0xaa41('0x57')]=function(_0x27363e,_0x25cac8){var _0x5381d5={'raw':!![],'where':{}};var _0x276013={};var _0x3135c3={'count':0x0,'rows':[]};return db[_0xaa41('0x2c')]['findOne']({'where':{'id':_0x27363e[_0xaa41('0x30')]['id']}})[_0xaa41('0x17')](handleEntityNotFound(_0x25cac8,null))[_0xaa41('0x17')](function(_0x408d95){if(_0x408d95){_0x276013[_0xaa41('0x31')]=_[_0xaa41('0x33')](db[_0xaa41('0x58')][_0xaa41('0x28')]);_0x276013[_0xaa41('0x32')]=_[_0xaa41('0x33')](_0x27363e[_0xaa41('0x32')]);_0x276013['filters']=_[_0xaa41('0x35')](_0x276013[_0xaa41('0x31')],_0x276013[_0xaa41('0x32')]);_0x5381d5[_0xaa41('0x34')]=_[_0xaa41('0x35')](_0x276013['model'],qs['fields'](_0x27363e[_0xaa41('0x32')][_0xaa41('0x36')]));_0x5381d5['attributes']=_0x5381d5[_0xaa41('0x34')][_0xaa41('0x37')]?_0x5381d5['attributes']:_0x276013['model'];if(!_0x27363e['query'][_0xaa41('0x53')](_0xaa41('0x4c'))){_0x5381d5[_0xaa41('0x12')]=qs[_0xaa41('0x12')](_0x27363e[_0xaa41('0x32')][_0xaa41('0x12')]);_0x5381d5[_0xaa41('0x14')]=qs[_0xaa41('0x14')](_0x27363e[_0xaa41('0x32')][_0xaa41('0x14')]);}_0x5381d5[_0xaa41('0x4d')]=qs['sort'](_0x27363e['query'][_0xaa41('0x4e')]);_0x5381d5[_0xaa41('0x2a')]=qs['filters'](_[_0xaa41('0x4f')](_0x27363e['query'],_0x276013[_0xaa41('0x4b')]));_0x5381d5[_0xaa41('0x2a')][_0xaa41('0x50')]=_0x408d95['id'];if(_0x27363e[_0xaa41('0x32')][_0xaa41('0x1b')]){_0x5381d5[_0xaa41('0x2a')]=_[_0xaa41('0x38')](_0x5381d5[_0xaa41('0x2a')],{'$or':_[_0xaa41('0x1c')](_0x5381d5['attributes'],function(_0x56bd21){var _0x56661a={};_0x56661a[_0x56bd21]={'$like':'%'+_0x27363e[_0xaa41('0x32')][_0xaa41('0x1b')]+'%'};return _0x56661a;})});}_0x5381d5=_['merge']({},_0x5381d5,_0x27363e['options']);return db[_0xaa41('0x58')][_0xaa41('0x13')]({'where':_0x5381d5['where']})['then'](function(_0xf651b7){_0x3135c3['count']=_0xf651b7;if(_0x27363e[_0xaa41('0x32')][_0xaa41('0x44')]){_0x5381d5[_0xaa41('0x2b')]=[{'all':!![]}];}return db[_0xaa41('0x58')][_0xaa41('0x2d')](_0x5381d5);})[_0xaa41('0x17')](function(_0x211455){_0x3135c3[_0xaa41('0x2e')]=_0x211455;return _0x3135c3;});}})[_0xaa41('0x17')](respondWithFilteredResult(_0x25cac8,_0x5381d5))['catch'](handleError(_0x25cac8,null));};exports['getTeams']=function(_0x38884d,_0x25d938){var _0x337655={};var _0x415705={};var _0x3efb43;var _0xae746;return db[_0xaa41('0x2c')][_0xaa41('0x55')]({'where':{'id':_0x38884d[_0xaa41('0x30')]['id']}})[_0xaa41('0x17')](handleEntityNotFound(_0x25d938,null))[_0xaa41('0x17')](function(_0x17442e){if(_0x17442e){_0x3efb43=_0x17442e;_0x415705[_0xaa41('0x31')]=_[_0xaa41('0x33')](db[_0xaa41('0x59')]['rawAttributes']);_0x415705[_0xaa41('0x32')]=_['keys'](_0x38884d[_0xaa41('0x32')]);_0x415705[_0xaa41('0x4b')]=_[_0xaa41('0x35')](_0x415705[_0xaa41('0x31')],_0x415705[_0xaa41('0x32')]);_0x337655[_0xaa41('0x34')]=_[_0xaa41('0x35')](_0x415705[_0xaa41('0x31')],qs['fields'](_0x38884d[_0xaa41('0x32')][_0xaa41('0x36')]));_0x337655[_0xaa41('0x34')]=_0x337655[_0xaa41('0x34')][_0xaa41('0x37')]?_0x337655[_0xaa41('0x34')]:_0x415705[_0xaa41('0x31')];_0x337655[_0xaa41('0x4d')]=qs[_0xaa41('0x4e')](_0x38884d[_0xaa41('0x32')]['sort']);_0x337655['where']=qs[_0xaa41('0x4b')](_[_0xaa41('0x4f')](_0x38884d[_0xaa41('0x32')],_0x415705[_0xaa41('0x4b')]));if(_0x38884d[_0xaa41('0x32')][_0xaa41('0x1b')]){_0x337655[_0xaa41('0x2a')]=_[_0xaa41('0x38')](_0x337655[_0xaa41('0x2a')],{'$or':_[_0xaa41('0x1c')](_0x337655['attributes'],function(_0x49b468){var _0x17018e={};_0x17018e[_0x49b468]={'$like':'%'+_0x38884d[_0xaa41('0x32')]['filter']+'%'};return _0x17018e;})});}_0x337655=_[_0xaa41('0x38')]({},_0x337655,_0x38884d['options']);return _0x3efb43[_0xaa41('0x5a')](_0x337655);}})[_0xaa41('0x17')](function(_0x50e03d){if(_0x50e03d){_0xae746=_0x50e03d['length'];if(!_0x38884d[_0xaa41('0x32')][_0xaa41('0x53')](_0xaa41('0x4c'))){_0x337655['limit']=qs['limit'](_0x38884d[_0xaa41('0x32')]['limit']);_0x337655[_0xaa41('0x14')]=qs['offset'](_0x38884d[_0xaa41('0x32')][_0xaa41('0x14')]);}return _0x3efb43[_0xaa41('0x5a')](_0x337655);}})[_0xaa41('0x17')](function(_0x182b0b){if(_0x182b0b){return _0x182b0b?{'count':_0xae746,'rows':_0x182b0b}:null;}})[_0xaa41('0x17')](respondWithResult(_0x25d938,null))[_0xaa41('0x2f')](handleError(_0x25d938,null));};exports['addTeams']=function(_0x4363b5,_0x1fa1f5){var _0x50883c=_0x4363b5[_0xaa41('0x3b')][_0xaa41('0x5b')];var _0x1c3d7f=_[_0xaa41('0x1c')](_0x50883c,'id');return db['Team'][_0xaa41('0x2d')]({'where':{'id':_0x1c3d7f},'attributes':['id'],'include':[{'model':db[_0xaa41('0x5c')],'as':_0xaa41('0x5d'),'attributes':['id',_0xaa41('0x21'),_0xaa41('0x5e'),_0xaa41('0x5f'),_0xaa41('0x60')],'raw':!![]}]})[_0xaa41('0x17')](function(_0xe2574a){if(_0xe2574a){var _0x4d83ce=_['flatMap'](_0xe2574a,function(_0x214ebe){var _0x2df75c=_0x214ebe[_0xaa41('0x18')]({'plain':!![]});_0x2df75c[_0xaa41('0x5d')][_0xaa41('0x61')](function(_0x401586){_0x401586['penalty']=_[_0xaa41('0x20')](_0x50883c,{'id':_0x2df75c['id']})[_0xaa41('0x62')];});return _0x2df75c[_0xaa41('0x5d')];});return db[_0xaa41('0x2c')][_0xaa41('0x20')]({'where':{'id':_0x4363b5[_0xaa41('0x30')]['id']}})['then'](function(_0xe8076e){return db[_0xaa41('0x63')][_0xaa41('0x64')](function(_0x4cf0c5){return _0xe8076e[_0xaa41('0x65')](_0x1c3d7f,{'transaction':_0x4cf0c5})[_0xaa41('0x17')](function(){return BPromise[_0xaa41('0x66')](_0x50883c,function(_0x255e76){return db[_0xaa41('0x67')][_0xaa41('0x68')]({'TeamId':_0x255e76['id'],'VoiceQueueId':_0x4363b5[_0xaa41('0x30')]['id'],'penalty':_0x255e76[_0xaa41('0x62')]},{'transaction':_0x4cf0c5});});})[_0xaa41('0x17')](function(){return BPromise[_0xaa41('0x66')](_0x4d83ce,function(_0x19a42c){return db[_0xaa41('0x69')][_0xaa41('0x6a')]({'where':{'UserId':_0x19a42c['id'],'VoiceQueueId':_0x4363b5['params']['id']},'defaults':{'penalty':_0x19a42c['penalty']},'transaction':_0x4cf0c5});});})[_0xaa41('0x17')](function(){return BPromise[_0xaa41('0x66')](_[_0xaa41('0x1b')](_0x4d83ce,{'online':!![]}),function(_0x2c4595){return db[_0xaa41('0x6b')][_0xaa41('0x68')]({'membername':_0x2c4595[_0xaa41('0x21')],'UserId':_0x2c4595['id'],'queue_name':_0xe8076e['name'],'VoiceQueueId':_0xe8076e['id'],'interface':_[_0xaa41('0x6c')](_0x2c4595[_0xaa41('0x60')])?util[_0xaa41('0x6d')](_0xaa41('0x6e'),_0x2c4595[_0xaa41('0x21')]):_0x2c4595[_0xaa41('0x60')],'paused':_0x2c4595[_0xaa41('0x5f')]||![],'penalty':_0x2c4595[_0xaa41('0x62')]},{'transaction':_0x4cf0c5});});})[_0xaa41('0x17')](function(){_0x4d83ce[_0xaa41('0x61')](function(_0x3f2dbb){socket[_0xaa41('0x6f')]('userVoiceQueue:save',{'UserId':_0x3f2dbb['id'],'VoiceQueueId':_0xe8076e['id']});});});});});}})[_0xaa41('0x17')](respondWithStatusCode(_0x1fa1f5,null))[_0xaa41('0x2f')](handleError(_0x1fa1f5,null));};exports['removeTeams']=function(_0x33f008,_0x1489fe){return db[_0xaa41('0x59')][_0xaa41('0x2d')]({'where':{'id':_0x33f008['query'][_0xaa41('0x70')]},'attributes':['id'],'include':[{'model':db[_0xaa41('0x5c')],'as':_0xaa41('0x5d'),'attributes':['id'],'raw':!![]}]})[_0xaa41('0x17')](handleEntityNotFound(_0x1489fe,null))[_0xaa41('0x17')](function(_0x4baae3){var _0xc59a12=_['map'](_0x4baae3,'id');var _0x50a526=[];var _0x3dd3fa=[];var _0x552493=squel['select']();_0x552493[_0xaa41('0x71')](_0xaa41('0x72'))[_0xaa41('0x73')]('team_has_voice_queues','tq')[_0xaa41('0x74')](_0xaa41('0x75'),'ut',_0xaa41('0x76'))[_0xaa41('0x2a')](_0xaa41('0x77'),_0x33f008[_0xaa41('0x30')]['id']);for(var _0x29d34a=0x0;_0x29d34a<_0x4baae3[_0xaa41('0x37')];_0x29d34a+=0x1){let _0x48e2cf=_0x4baae3[_0x29d34a];for(var _0x410d6e=0x0;_0x410d6e<_0x48e2cf[_0xaa41('0x5d')][_0xaa41('0x37')];_0x410d6e+=0x1){let _0x3361f5=_0x48e2cf[_0xaa41('0x5d')][_0x410d6e];var _0x4f1bcb=_0x552493['clone']();_0x4f1bcb[_0xaa41('0x2a')](_0xaa41('0x78'),_0x3361f5['id']);_0x3dd3fa[_0xaa41('0x79')](db[_0xaa41('0x63')][_0xaa41('0x32')](_0x4f1bcb[_0xaa41('0x7a')](),{'type':db['sequelize'][_0xaa41('0x7b')][_0xaa41('0x7c')]})['then'](function(_0x40f4ce){if(_0x40f4ce[_0xaa41('0x37')]===0x1){return _0x3361f5['id'];}else{var _0x95300a=_[_0xaa41('0x7d')](_[_0xaa41('0x1c')](_0x40f4ce,_0xaa41('0x7e')),function(_0x1926bd){return _['includes'](_0xc59a12,_0x1926bd);});if(_0x95300a){return _0x3361f5['id'];}}}));}}return BPromise[_0xaa41('0x7f')](_0x3dd3fa)[_0xaa41('0x17')](function(_0x5404cd){_0x50a526=_(_0x50a526)[_0xaa41('0x80')](_0x5404cd)[_0xaa41('0x81')]()[_0xaa41('0x1d')]();return db[_0xaa41('0x2c')]['find']({'where':{'id':_0x33f008[_0xaa41('0x30')]['id']}})[_0xaa41('0x17')](function(_0x339537){return db[_0xaa41('0x63')][_0xaa41('0x64')](function(_0x4b84bc){return _0x339537[_0xaa41('0x82')](_0x33f008[_0xaa41('0x32')]['ids'],{'transaction':_0x4b84bc})['then'](function(){if(!_[_0xaa41('0x83')](_0x50a526)){return _0x339537[_0xaa41('0x84')](_0x50a526,{'transaction':_0x4b84bc})[_0xaa41('0x17')](function(){return db[_0xaa41('0x6b')][_0xaa41('0x23')]({'where':{'VoiceQueueId':_0x33f008[_0xaa41('0x30')]['id'],'UserId':_0x50a526},'transaction':_0x4b84bc});});}})['then'](function(){_0x50a526['forEach'](function(_0x395323){socket[_0xaa41('0x6f')]('userVoiceQueue:remove',{'UserId':_0x395323,'VoiceQueueId':_0x339537['id']});});});});});});})['then'](respondWithStatusCode(_0x1489fe,null))[_0xaa41('0x2f')](handleError(_0x1489fe,null));};exports[_0xaa41('0x85')]=function(_0x2fe50f,_0x520b50){var _0x50122d,_0x1d609e;return db[_0xaa41('0x2c')][_0xaa41('0x20')]({'where':{'id':_0x2fe50f['params']['id']}})[_0xaa41('0x17')](handleEntityNotFound(_0x520b50,null))[_0xaa41('0x17')](function(_0x5a0791){if(_0x5a0791){_0x1d609e=_0x5a0791;return _0x5a0791['addAgents'](_0x2fe50f[_0xaa41('0x3b')]['ids'],_[_0xaa41('0x45')](_0x2fe50f[_0xaa41('0x3b')],[_0xaa41('0x70'),'id'])||{})[_0xaa41('0x86')](function(_0x1d7c2e){for(var _0xdc0493=0x0;_0xdc0493<_0x2fe50f[_0xaa41('0x3b')]['ids'][_0xaa41('0x37')];_0xdc0493+=0x1){socket[_0xaa41('0x6f')]('userVoiceQueue:save',{'UserId':Number(_0x2fe50f[_0xaa41('0x3b')][_0xaa41('0x70')][_0xdc0493]),'VoiceQueueId':Number(_0x2fe50f[_0xaa41('0x30')]['id'])});}return _0x1d7c2e;});}})[_0xaa41('0x17')](function(_0x2af16e){_0x50122d=_0x2af16e||[];if(_0x1d609e){return db[_0xaa41('0x5c')]['findAll']({'where':{'id':_0x2fe50f[_0xaa41('0x3b')][_0xaa41('0x70')]},'attributes':['id',_0xaa41('0x21'),_0xaa41('0x5e'),_0xaa41('0x5f'),_0xaa41('0x60')],'raw':!![]});}})[_0xaa41('0x17')](function(_0x5083ff){if(!_[_0xaa41('0x83')](_0x5083ff)){var _0x3c4e89=[];for(var _0x415acc=0x0;_0x415acc<_0x5083ff['length'];_0x415acc++){if(_0x5083ff[_0x415acc]['online']){_0x3c4e89['push'](db[_0xaa41('0x6b')][_0xaa41('0x68')]({'membername':_0x5083ff[_0x415acc][_0xaa41('0x21')],'UserId':_0x5083ff[_0x415acc]['id'],'queue_name':_0x1d609e[_0xaa41('0x21')],'VoiceQueueId':_0x1d609e['id'],'interface':_[_0xaa41('0x6c')](_0x5083ff[_0x415acc]['interface'])?util[_0xaa41('0x6d')](_0xaa41('0x6e'),_0x5083ff[_0x415acc][_0xaa41('0x21')]):_0x5083ff[_0x415acc][_0xaa41('0x60')],'paused':_0x5083ff[_0x415acc][_0xaa41('0x5f')]||![],'penalty':_0x2fe50f[_0xaa41('0x3b')][_0xaa41('0x62')]||0x0}));}}return BPromise['all'](_0x3c4e89);}})[_0xaa41('0x17')](function(){return _0x50122d;})[_0xaa41('0x17')](respondWithResult(_0x520b50,null))[_0xaa41('0x2f')](handleError(_0x520b50,null));};exports['removeAgents']=function(_0x16a173,_0x53a519){return db['VoiceQueue'][_0xaa41('0x20')]({'where':{'id':_0x16a173['params']['id']}})[_0xaa41('0x17')](handleEntityNotFound(_0x53a519,null))[_0xaa41('0x17')](function(_0x366705){if(_0x366705){return _0x366705[_0xaa41('0x84')](_0x16a173[_0xaa41('0x32')][_0xaa41('0x70')])[_0xaa41('0x17')](function(){if(_['isArray'](_0x16a173[_0xaa41('0x32')][_0xaa41('0x70')])){for(var _0x3ee9e3=0x0;_0x3ee9e3<_0x16a173[_0xaa41('0x32')][_0xaa41('0x70')][_0xaa41('0x37')];_0x3ee9e3+=0x1){socket[_0xaa41('0x6f')](_0xaa41('0x87'),{'UserId':Number(_0x16a173[_0xaa41('0x32')][_0xaa41('0x70')][_0x3ee9e3]),'VoiceQueueId':Number(_0x16a173[_0xaa41('0x30')]['id'])});}}else{socket[_0xaa41('0x6f')](_0xaa41('0x87'),{'UserId':Number(_0x16a173[_0xaa41('0x32')][_0xaa41('0x70')]),'VoiceQueueId':Number(_0x16a173[_0xaa41('0x30')]['id'])});}});}})['then'](function(_0x29b27e){return db['UserVoiceQueueRt']['destroy']({'where':{'VoiceQueueId':_0x16a173['params']['id'],'UserId':_0x16a173[_0xaa41('0x32')][_0xaa41('0x70')]}})['then'](function(){return _0x29b27e;});})[_0xaa41('0x17')](respondWithStatusCode(_0x53a519,null))[_0xaa41('0x2f')](handleError(_0x53a519,null));};exports[_0xaa41('0x88')]=function(_0x15bb60,_0x232732){var _0x34d857={};var _0x239f1b={};var _0x445925;var _0x1e8591;return db[_0xaa41('0x2c')][_0xaa41('0x55')]({'where':{'id':_0x15bb60[_0xaa41('0x30')]['id']}})[_0xaa41('0x17')](handleEntityNotFound(_0x232732,null))[_0xaa41('0x17')](function(_0x7bae82){if(_0x7bae82){_0x445925=_0x7bae82;_0x239f1b[_0xaa41('0x31')]=_[_0xaa41('0x33')](db['User'][_0xaa41('0x28')]);_0x239f1b[_0xaa41('0x32')]=_[_0xaa41('0x33')](_0x15bb60[_0xaa41('0x32')]);_0x239f1b['filters']=_[_0xaa41('0x35')](_0x239f1b[_0xaa41('0x31')],_0x239f1b['query']);_0x34d857[_0xaa41('0x34')]=_[_0xaa41('0x35')](_0x239f1b[_0xaa41('0x31')],qs[_0xaa41('0x36')](_0x15bb60[_0xaa41('0x32')][_0xaa41('0x36')]));_0x34d857[_0xaa41('0x34')]=_0x34d857[_0xaa41('0x34')][_0xaa41('0x37')]?_0x34d857[_0xaa41('0x34')]:_0x239f1b['model'];_0x34d857[_0xaa41('0x4d')]=qs[_0xaa41('0x4e')](_0x15bb60[_0xaa41('0x32')][_0xaa41('0x4e')]);_0x34d857[_0xaa41('0x2a')]=qs[_0xaa41('0x4b')](_['pick'](_0x15bb60[_0xaa41('0x32')],_0x239f1b['filters']));if(_0x15bb60[_0xaa41('0x32')][_0xaa41('0x1b')]){_0x34d857[_0xaa41('0x2a')]=_[_0xaa41('0x38')](_0x34d857[_0xaa41('0x2a')],{'$or':_['map'](_0x34d857[_0xaa41('0x34')],function(_0x345002){var _0x5f39b4={};_0x5f39b4[_0x345002]={'$like':'%'+_0x15bb60[_0xaa41('0x32')][_0xaa41('0x1b')]+'%'};return _0x5f39b4;})});}_0x34d857=_[_0xaa41('0x38')]({},_0x34d857,_0x15bb60[_0xaa41('0x39')]);return _0x445925[_0xaa41('0x88')](_0x34d857);}})[_0xaa41('0x17')](function(_0x38b3be){if(_0x38b3be){_0x1e8591=_0x38b3be[_0xaa41('0x37')];if(!_0x15bb60[_0xaa41('0x32')][_0xaa41('0x53')]('nolimit')){_0x34d857[_0xaa41('0x12')]=qs[_0xaa41('0x12')](_0x15bb60[_0xaa41('0x32')]['limit']);_0x34d857['offset']=qs[_0xaa41('0x14')](_0x15bb60['query']['offset']);}return _0x445925[_0xaa41('0x88')](_0x34d857);}})[_0xaa41('0x17')](function(_0xa4dbd3){if(_0xa4dbd3){return _0xa4dbd3?{'count':_0x1e8591,'rows':_0xa4dbd3}:null;}})[_0xaa41('0x17')](respondWithResult(_0x232732,null))['catch'](handleError(_0x232732,null));};exports['getMembers']=function(_0xa63e60,_0xf4f13f){var _0xef0e44={};var _0x46d37f={};var _0x6a6081;var _0x5e3bb2;return db[_0xaa41('0x2c')][_0xaa41('0x55')]({'where':{'id':_0xa63e60['params']['id']}})[_0xaa41('0x17')](handleEntityNotFound(_0xf4f13f,null))[_0xaa41('0x17')](function(_0x4b4a4a){if(_0x4b4a4a){_0x6a6081=_0x4b4a4a;_0x46d37f[_0xaa41('0x31')]=_[_0xaa41('0x33')](db['UserVoiceQueueRt'][_0xaa41('0x28')]);_0x46d37f[_0xaa41('0x32')]=_['keys'](_0xa63e60[_0xaa41('0x32')]);_0x46d37f['filters']=_['intersection'](_0x46d37f[_0xaa41('0x31')],_0x46d37f[_0xaa41('0x32')]);_0xef0e44[_0xaa41('0x34')]=_[_0xaa41('0x35')](_0x46d37f[_0xaa41('0x31')],qs['fields'](_0xa63e60[_0xaa41('0x32')]['fields']));_0xef0e44['attributes']=_0xef0e44[_0xaa41('0x34')][_0xaa41('0x37')]?_0xef0e44[_0xaa41('0x34')]:_0x46d37f[_0xaa41('0x31')];_0xef0e44[_0xaa41('0x4d')]=qs[_0xaa41('0x4e')](_0xa63e60[_0xaa41('0x32')]['sort']);_0xef0e44[_0xaa41('0x2a')]=qs[_0xaa41('0x4b')](_[_0xaa41('0x4f')](_0xa63e60[_0xaa41('0x32')],_0x46d37f[_0xaa41('0x4b')]));if(_0xa63e60[_0xaa41('0x32')][_0xaa41('0x1b')]){_0xef0e44[_0xaa41('0x2a')]=_[_0xaa41('0x38')](_0xef0e44[_0xaa41('0x2a')],{'$or':_[_0xaa41('0x1c')](_0xef0e44[_0xaa41('0x34')],function(_0x5a2ba0){var _0x4fc7d6={};_0x4fc7d6[_0x5a2ba0]={'$like':'%'+_0xa63e60[_0xaa41('0x32')][_0xaa41('0x1b')]+'%'};return _0x4fc7d6;})});}_0xef0e44=_[_0xaa41('0x38')]({},_0xef0e44,_0xa63e60['options']);return _0x6a6081[_0xaa41('0x89')](_0xef0e44);}})[_0xaa41('0x17')](function(_0x15bc15){if(_0x15bc15){_0x5e3bb2=_0x15bc15[_0xaa41('0x37')];if(!_0xa63e60[_0xaa41('0x32')][_0xaa41('0x53')](_0xaa41('0x4c'))){_0xef0e44[_0xaa41('0x12')]=qs[_0xaa41('0x12')](_0xa63e60[_0xaa41('0x32')][_0xaa41('0x12')]);_0xef0e44[_0xaa41('0x14')]=qs[_0xaa41('0x14')](_0xa63e60[_0xaa41('0x32')][_0xaa41('0x14')]);}return _0x6a6081['getMembers'](_0xef0e44);}})[_0xaa41('0x17')](function(_0x28c109){return _0x28c109?{'count':_0x5e3bb2,'rows':_0x28c109}:null;})[_0xaa41('0x17')](respondWithResult(_0xf4f13f,null))['catch'](handleError(_0xf4f13f,null));};exports[_0xaa41('0x8a')]=function(_0xfc1e24,_0x35c48f){var _0x2b0bf9={};var _0x21c0c6={};var _0x1138d0;var _0x394987;return db[_0xaa41('0x2c')]['findOne']({'where':{'id':_0xfc1e24[_0xaa41('0x30')]['id']}})[_0xaa41('0x17')](handleEntityNotFound(_0x35c48f,null))[_0xaa41('0x17')](function(_0x2fc4b1){if(_0x2fc4b1){_0x1138d0=_0x2fc4b1;_0x21c0c6[_0xaa41('0x31')]=_['keys'](db[_0xaa41('0x8b')]['rawAttributes']);_0x21c0c6[_0xaa41('0x32')]=_[_0xaa41('0x33')](_0xfc1e24[_0xaa41('0x32')]);_0x21c0c6[_0xaa41('0x4b')]=_[_0xaa41('0x35')](_0x21c0c6[_0xaa41('0x31')],_0x21c0c6[_0xaa41('0x32')]);_0x2b0bf9[_0xaa41('0x34')]=_[_0xaa41('0x35')](_0x21c0c6[_0xaa41('0x31')],qs[_0xaa41('0x36')](_0xfc1e24[_0xaa41('0x32')]['fields']));_0x2b0bf9['attributes']=_0x2b0bf9[_0xaa41('0x34')][_0xaa41('0x37')]?_0x2b0bf9[_0xaa41('0x34')]:_0x21c0c6[_0xaa41('0x31')];_0x2b0bf9[_0xaa41('0x4d')]=qs[_0xaa41('0x4e')](_0xfc1e24['query'][_0xaa41('0x4e')]);_0x2b0bf9['where']=qs[_0xaa41('0x4b')](_[_0xaa41('0x4f')](_0xfc1e24[_0xaa41('0x32')],_0x21c0c6[_0xaa41('0x4b')]));if(_0xfc1e24[_0xaa41('0x32')][_0xaa41('0x1b')]){_0x2b0bf9['where']=_['merge'](_0x2b0bf9[_0xaa41('0x2a')],{'$or':_['map'](_0x2b0bf9[_0xaa41('0x34')],function(_0x3f8296){var _0x438fcf={};_0x438fcf[_0x3f8296]={'$like':'%'+_0xfc1e24[_0xaa41('0x32')][_0xaa41('0x1b')]+'%'};return _0x438fcf;})});}_0x2b0bf9=_[_0xaa41('0x38')]({},_0x2b0bf9,_0xfc1e24[_0xaa41('0x39')]);return _0x1138d0[_0xaa41('0x8a')](_0x2b0bf9);}})[_0xaa41('0x17')](function(_0x2667bd){if(_0x2667bd){_0x394987=_0x2667bd[_0xaa41('0x37')];if(!_0xfc1e24[_0xaa41('0x32')][_0xaa41('0x53')](_0xaa41('0x4c'))){_0x2b0bf9['limit']=qs[_0xaa41('0x12')](_0xfc1e24['query'][_0xaa41('0x12')]);_0x2b0bf9['offset']=qs[_0xaa41('0x14')](_0xfc1e24[_0xaa41('0x32')][_0xaa41('0x14')]);}return _0x1138d0[_0xaa41('0x8a')](_0x2b0bf9);}})[_0xaa41('0x17')](function(_0x3dafc6){if(_0x3dafc6){return _0x3dafc6?{'count':_0x394987,'rows':_0x3dafc6}:null;}})[_0xaa41('0x17')](respondWithResult(_0x35c48f,null))['catch'](handleError(_0x35c48f,null));};exports[_0xaa41('0x8c')]=function(_0x533f4b,_0x47ca9d){var _0xd1f9ba=moment()[_0xaa41('0x6d')]('YYYY-MM-DD\x20HH:mm:ss');var _0x2c4930,_0x1285ed;return db['VoiceQueue'][_0xaa41('0x20')]({'where':{'id':_0x533f4b[_0xaa41('0x30')]['id']}})[_0xaa41('0x17')](handleEntityNotFound(_0x47ca9d,null))['then'](function(_0x3ecde6){if(_0x3ecde6){_0x1285ed=_0x3ecde6;return _0x3ecde6['addLists'](_0x533f4b[_0xaa41('0x3b')][_0xaa41('0x70')],_[_0xaa41('0x45')](_0x533f4b[_0xaa41('0x3b')],['ids','id'])||{});}return null;})[_0xaa41('0x86')](function(_0x32a07e){var _0x2b8b73;_0x2c4930=_0x32a07e||[];var _0x49e4a5=[];if(_0x32a07e){for(var _0xda8e73=0x0;_0xda8e73<_0x32a07e[_0xaa41('0x37')];_0xda8e73+=0x1){var _0x25f5ba=_0x32a07e[_0xda8e73][_0xaa41('0x18')]({'plain':!![]});_0x1285ed[_0xaa41('0x8d')]=_0x533f4b[_0xaa41('0x3b')][_0xaa41('0x8d')]?_0x533f4b[_0xaa41('0x3b')]['dialCheckDuplicateType']:_0x1285ed[_0xaa41('0x8d')];switch(_0x1285ed['dialCheckDuplicateType']){case _0xaa41('0x8e'):_0x2b8b73=squel[_0xaa41('0x8f')]()[_0xaa41('0x90')](_0xaa41('0x91'))[_0xaa41('0x92')]([_0xaa41('0x93'),_0xaa41('0x94'),_0xaa41('0x95'),_0xaa41('0x96'),_0xaa41('0x50'),_0xaa41('0x46'),_0xaa41('0x47')],squel[_0xaa41('0x97')]()['field'](_0xaa41('0x93'),_0xaa41('0x93'))[_0xaa41('0x71')]('\x27'+_0xd1f9ba+'\x27',_0xaa41('0x94'))[_0xaa41('0x71')]('id',_0xaa41('0x95'))[_0xaa41('0x71')](_0x25f5ba[_0xaa41('0x98')][_0xaa41('0x7a')](),'ListId')[_0xaa41('0x71')](_0x533f4b[_0xaa41('0x30')]['id'][_0xaa41('0x7a')](),_0xaa41('0x50'))[_0xaa41('0x71')]('\x27'+_0xd1f9ba+'\x27',_0xaa41('0x46'))[_0xaa41('0x71')]('\x27'+_0xd1f9ba+'\x27',_0xaa41('0x47'))[_0xaa41('0x73')](_0xaa41('0x99'))['where']('deletedAt\x20IS\x20NULL')['where'](_0xaa41('0x9a'),_0x25f5ba[_0xaa41('0x98')]['toString']())[_0xaa41('0x2a')](_0xaa41('0x9b'))['where'](_0xaa41('0x9c'),squel['select']()[_0xaa41('0x71')](_0xaa41('0x9d'))[_0xaa41('0x73')](_0xaa41('0x9e'))[_0xaa41('0x2a')]('VoiceQueueId\x20=\x20?',_0x533f4b[_0xaa41('0x30')]['id'][_0xaa41('0x7a')]()))[_0xaa41('0x2a')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0xaa41('0x71')](_0xaa41('0x9f'))['from'](_0xaa41('0x91'))[_0xaa41('0x2a')](_0xaa41('0x77'),_0x533f4b['params']['id'][_0xaa41('0x7a')]())))[_0xaa41('0x7a')]();break;case _0xaa41('0xa0'):_0x2b8b73=squel['insert']()[_0xaa41('0x90')](_0xaa41('0x91'))['fromQuery'](['phone',_0xaa41('0x94'),_0xaa41('0x95'),_0xaa41('0x96'),_0xaa41('0x50'),'createdAt',_0xaa41('0x47')],squel[_0xaa41('0x97')]()['field'](_0xaa41('0x93'),_0xaa41('0x93'))[_0xaa41('0x71')]('\x27'+_0xd1f9ba+'\x27',_0xaa41('0x94'))['field']('id',_0xaa41('0x95'))[_0xaa41('0x71')](_0x25f5ba[_0xaa41('0x98')][_0xaa41('0x7a')](),_0xaa41('0x96'))[_0xaa41('0x71')](_0x533f4b[_0xaa41('0x30')]['id'][_0xaa41('0x7a')](),_0xaa41('0x50'))[_0xaa41('0x71')]('\x27'+_0xd1f9ba+'\x27','createdAt')[_0xaa41('0x71')]('\x27'+_0xd1f9ba+'\x27',_0xaa41('0x47'))[_0xaa41('0x73')](_0xaa41('0x99'))[_0xaa41('0x2a')]('deletedAt\x20IS\x20NULL')[_0xaa41('0x2a')]('ListId\x20=\x20?',_0x25f5ba[_0xaa41('0x98')]['toString']())['where'](_0xaa41('0x9b'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0xaa41('0x97')]()[_0xaa41('0x71')](_0xaa41('0x9f'))[_0xaa41('0x73')](_0xaa41('0x91'))[_0xaa41('0x2a')]('VoiceQueueId\x20=\x20?',_0x533f4b[_0xaa41('0x30')]['id'][_0xaa41('0x7a')]())))[_0xaa41('0x7a')]();break;default:_0x2b8b73=squel['insert']()[_0xaa41('0x90')]('cm_hopper')[_0xaa41('0x92')]([_0xaa41('0x93'),_0xaa41('0x94'),_0xaa41('0x95'),'ListId','VoiceQueueId',_0xaa41('0x46'),_0xaa41('0x47')],squel['select']()['field'](_0xaa41('0x93'),_0xaa41('0x93'))[_0xaa41('0x71')]('\x27'+_0xd1f9ba+'\x27',_0xaa41('0x94'))[_0xaa41('0x71')]('id',_0xaa41('0x95'))[_0xaa41('0x71')](_0x25f5ba[_0xaa41('0x98')]['toString'](),_0xaa41('0x96'))[_0xaa41('0x71')](_0x533f4b[_0xaa41('0x30')]['id'][_0xaa41('0x7a')](),_0xaa41('0x50'))['field']('\x27'+_0xd1f9ba+'\x27',_0xaa41('0x46'))['field']('\x27'+_0xd1f9ba+'\x27',_0xaa41('0x47'))['from'](_0xaa41('0x99'))[_0xaa41('0x2a')](_0xaa41('0xa1'))['where'](_0xaa41('0x9a'),_0x25f5ba[_0xaa41('0x98')][_0xaa41('0x7a')]())[_0xaa41('0x2a')](_0xaa41('0x9b')))[_0xaa41('0x7a')]();}_0x49e4a5[_0xaa41('0x79')](db[_0xaa41('0x63')][_0xaa41('0x32')](_0x2b8b73));}return BPromise[_0xaa41('0x7f')](_0x49e4a5);}})['then'](function(){var _0x58f009=[];var _0x405eba=squel[_0xaa41('0x8f')]()[_0xaa41('0x90')]('cm_hopper_additional_phones')[_0xaa41('0x92')]([_0xaa41('0xa2'),_0xaa41('0x93'),_0xaa41('0xa3'),_0xaa41('0x46'),_0xaa41('0x47')],squel['select']()[_0xaa41('0x71')](_0xaa41('0xa4'))[_0xaa41('0x71')](_0xaa41('0xa5'))['field'](_0xaa41('0xa6'))[_0xaa41('0x71')]('\x27'+_0xd1f9ba+'\x27',_0xaa41('0x46'))['field']('\x27'+_0xd1f9ba+'\x27','updatedAt')[_0xaa41('0x73')](_0xaa41('0xa7'),'ci')[_0xaa41('0x74')]('cm_hopper','h','h.ContactId=ci.CmContactId')[_0xaa41('0x2a')](_0xaa41('0xa8'),_0xd1f9ba)[_0xaa41('0x2a')](_0xaa41('0xa9'),_0xaa41('0xaa')))[_0xaa41('0x7a')]();_0x58f009['push'](db[_0xaa41('0x63')][_0xaa41('0x32')](_0x405eba));return BPromise[_0xaa41('0x7f')](_0x58f009);})[_0xaa41('0x17')](function(){return _0x2c4930;})[_0xaa41('0x17')](respondWithResult(_0x47ca9d,null))[_0xaa41('0x2f')](handleError(_0x47ca9d,null));};exports[_0xaa41('0xab')]=function(_0x718a84,_0x151c5f){return db[_0xaa41('0x2c')][_0xaa41('0x20')]({'where':{'id':_0x718a84['params']['id']}})['then'](handleEntityNotFound(_0x151c5f,null))[_0xaa41('0x17')](function(_0x293a1d){if(_0x293a1d){return _0x293a1d['removeLists'](_0x718a84[_0xaa41('0x32')][_0xaa41('0x70')]);}})['then'](function(_0x490a6c){if(_0x490a6c){return db[_0xaa41('0x4a')][_0xaa41('0x23')]({'where':{'ListId':_0x718a84[_0xaa41('0x32')]['ids'],'VoiceQueueId':_0x718a84[_0xaa41('0x30')]['id']}})[_0xaa41('0x17')](function(){return _0x490a6c;});}})['then'](respondWithStatusCode(_0x151c5f,null))[_0xaa41('0x2f')](handleError(_0x151c5f,null));};exports[_0xaa41('0xac')]=function(_0x536cdb,_0x431b75){var _0x18499f={};var _0x49cbd7={};var _0x515f91;var _0x4b5953;return db['VoiceQueue'][_0xaa41('0x55')]({'where':{'id':_0x536cdb[_0xaa41('0x30')]['id']}})[_0xaa41('0x17')](handleEntityNotFound(_0x431b75,null))[_0xaa41('0x17')](function(_0x4ca8f7){if(_0x4ca8f7){_0x515f91=_0x4ca8f7;_0x49cbd7['model']=_[_0xaa41('0x33')](db['CmList'][_0xaa41('0x28')]);_0x49cbd7[_0xaa41('0x32')]=_[_0xaa41('0x33')](_0x536cdb[_0xaa41('0x32')]);_0x49cbd7['filters']=_[_0xaa41('0x35')](_0x49cbd7[_0xaa41('0x31')],_0x49cbd7[_0xaa41('0x32')]);_0x18499f[_0xaa41('0x34')]=_[_0xaa41('0x35')](_0x49cbd7[_0xaa41('0x31')],qs[_0xaa41('0x36')](_0x536cdb[_0xaa41('0x32')]['fields']));_0x18499f['attributes']=_0x18499f[_0xaa41('0x34')][_0xaa41('0x37')]?_0x18499f[_0xaa41('0x34')]:_0x49cbd7[_0xaa41('0x31')];_0x18499f[_0xaa41('0x4d')]=qs[_0xaa41('0x4e')](_0x536cdb[_0xaa41('0x32')][_0xaa41('0x4e')]);_0x18499f[_0xaa41('0x2a')]=qs[_0xaa41('0x4b')](_[_0xaa41('0x4f')](_0x536cdb[_0xaa41('0x32')],_0x49cbd7[_0xaa41('0x4b')]));if(_0x536cdb['query'][_0xaa41('0x1b')]){_0x18499f[_0xaa41('0x2a')]=_['merge'](_0x18499f[_0xaa41('0x2a')],{'$or':_[_0xaa41('0x1c')](_0x18499f[_0xaa41('0x34')],function(_0x5cd79d){var _0x558583={};_0x558583[_0x5cd79d]={'$like':'%'+_0x536cdb[_0xaa41('0x32')][_0xaa41('0x1b')]+'%'};return _0x558583;})});}_0x18499f=_['merge']({},_0x18499f,_0x536cdb['options']);return _0x515f91[_0xaa41('0xac')](_0x18499f);}})[_0xaa41('0x17')](function(_0x117841){if(_0x117841){_0x4b5953=_0x117841[_0xaa41('0x37')];if(!_0x536cdb[_0xaa41('0x32')]['hasOwnProperty'](_0xaa41('0x4c'))){_0x18499f[_0xaa41('0x12')]=qs['limit'](_0x536cdb['query'][_0xaa41('0x12')]);_0x18499f[_0xaa41('0x14')]=qs[_0xaa41('0x14')](_0x536cdb[_0xaa41('0x32')]['offset']);}return _0x515f91[_0xaa41('0xac')](_0x18499f);}})[_0xaa41('0x17')](function(_0x1be3c1){if(_0x1be3c1){return _0x1be3c1?{'count':_0x4b5953,'rows':_0x1be3c1}:null;}})[_0xaa41('0x17')](respondWithResult(_0x431b75,null))[_0xaa41('0x2f')](handleError(_0x431b75,null));};exports[_0xaa41('0xad')]=function(_0x42ae0c,_0x4fa4ca){var _0x1e41b5;return db[_0xaa41('0x2c')]['find']({'where':{'id':_0x42ae0c[_0xaa41('0x30')]['id']}})[_0xaa41('0x17')](handleEntityNotFound(_0x4fa4ca,null))[_0xaa41('0x17')](function(_0x135f31){if(_0x135f31){return _0x135f31[_0xaa41('0xad')](_0x42ae0c[_0xaa41('0x3b')][_0xaa41('0x70')],_[_0xaa41('0x45')](_0x42ae0c['body'],[_0xaa41('0x70'),'id'])||{});}return null;})['spread'](function(_0x5eac30){var _0x3e28b7;_0x1e41b5=_0x5eac30||[];var _0x1ac854=[];if(_0x5eac30){for(var _0x187bf9=0x0;_0x187bf9<_0x5eac30['length'];_0x187bf9+=0x1){var _0x50fa22=_0x5eac30[_0x187bf9][_0xaa41('0x18')]({'plain':!![]});_0x3e28b7=squel[_0xaa41('0x8f')]()[_0xaa41('0x90')](_0xaa41('0xae'))['fromQuery']([_0xaa41('0x93'),'ContactId',_0xaa41('0x96'),_0xaa41('0x50'),_0xaa41('0x46'),'updatedAt'],squel[_0xaa41('0x97')]()['field'](_0xaa41('0x93'),_0xaa41('0x93'))[_0xaa41('0x71')]('id',_0xaa41('0x95'))[_0xaa41('0x71')](_0x50fa22['CmListId'][_0xaa41('0x7a')](),'ListId')['field'](_0x42ae0c['params']['id'][_0xaa41('0x7a')](),'VoiceQueueId')[_0xaa41('0x71')]('NOW()','createdAt')[_0xaa41('0x71')](_0xaa41('0xaf'),_0xaa41('0x47'))[_0xaa41('0x73')](_0xaa41('0x99'))[_0xaa41('0x2a')](_0xaa41('0xa1'))[_0xaa41('0x2a')](_0xaa41('0x9a'),_0x50fa22['CmListId'][_0xaa41('0x7a')]())[_0xaa41('0x2a')](_0xaa41('0x9b')))['toString']();_0x1ac854[_0xaa41('0x79')](db[_0xaa41('0x63')][_0xaa41('0x32')](_0x3e28b7));}return BPromise['all'](_0x1ac854);}})[_0xaa41('0x17')](function(){return _0x1e41b5;})[_0xaa41('0x17')](respondWithResult(_0x4fa4ca,null))['catch'](handleError(_0x4fa4ca,null));};exports[_0xaa41('0xb0')]=function(_0x2edb93,_0x4e34c2){return db[_0xaa41('0x2c')][_0xaa41('0x20')]({'where':{'id':_0x2edb93[_0xaa41('0x30')]['id']}})[_0xaa41('0x17')](handleEntityNotFound(_0x4e34c2,null))[_0xaa41('0x17')](function(_0x17b359){if(_0x17b359){return _0x17b359['removeBlackLists'](_0x2edb93['query']['ids']);}})['then'](function(_0x5b820b){if(_0x5b820b){return db[_0xaa41('0x58')][_0xaa41('0x23')]({'where':{'ListId':_0x2edb93[_0xaa41('0x32')][_0xaa41('0x70')],'VoiceQueueId':_0x2edb93[_0xaa41('0x30')]['id']}})[_0xaa41('0x17')](function(){return _0x5b820b;});}})[_0xaa41('0x17')](respondWithStatusCode(_0x4e34c2,null))[_0xaa41('0x2f')](handleError(_0x4e34c2,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index 01207c8..308ab41 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 _0x6b77=['update','remove','emit','hasOwnProperty','exports','../../mysqldb','setMaxListeners','save'];(function(_0x4e697a,_0x56a14b){var _0x88850c=function(_0x4e368a){while(--_0x4e368a){_0x4e697a['push'](_0x4e697a['shift']());}};_0x88850c(++_0x56a14b);}(_0x6b77,0x145));var _0x76b7=function(_0x5944af,_0x31cbab){_0x5944af=_0x5944af-0x0;var _0x9d3940=_0x6b77[_0x5944af];return _0x9d3940;};'use strict';var EventEmitter=require('events');var VoiceQueue=require(_0x76b7('0x0'))['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x76b7('0x1')](0x0);var events={'afterCreate':_0x76b7('0x2'),'afterUpdate':_0x76b7('0x3'),'afterDestroy':_0x76b7('0x4')};function emitEvent(_0x21d68a){return function(_0x3c941b,_0x171562,_0x12e460){VoiceQueueEvents['emit'](_0x21d68a+':'+_0x3c941b['id'],_0x3c941b);VoiceQueueEvents[_0x76b7('0x5')](_0x21d68a,_0x3c941b);_0x12e460(null);};}for(var e in events){if(events[_0x76b7('0x6')](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module[_0x76b7('0x7')]=VoiceQueueEvents; \ No newline at end of file +var _0xe2a5=['hook','exports','events','../../mysqldb','VoiceQueue','save','update','hasOwnProperty'];(function(_0x1bf768,_0x2c4769){var _0x34d6e0=function(_0x2a7258){while(--_0x2a7258){_0x1bf768['push'](_0x1bf768['shift']());}};_0x34d6e0(++_0x2c4769);}(_0xe2a5,0x1da));var _0x5e2a=function(_0x173e96,_0x5cffd7){_0x173e96=_0x173e96-0x0;var _0x2d0cdb=_0xe2a5[_0x173e96];return _0x2d0cdb;};'use strict';var EventEmitter=require(_0x5e2a('0x0'));var VoiceQueue=require(_0x5e2a('0x1'))['db'][_0x5e2a('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5e2a('0x3'),'afterUpdate':_0x5e2a('0x4'),'afterDestroy':'remove'};function emitEvent(_0xabb0e2){return function(_0x18536d,_0x15c1f9,_0x4932db){VoiceQueueEvents['emit'](_0xabb0e2+':'+_0x18536d['id'],_0x18536d);VoiceQueueEvents['emit'](_0xabb0e2,_0x18536d);_0x4932db(null);};}for(var e in events){if(events[_0x5e2a('0x5')](e)){var event=events[e];VoiceQueue[_0x5e2a('0x6')](e,emitEvent(event));}}module[_0x5e2a('0x7')]=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index 2c9e742..a985dd8 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 _0xedd9=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./voiceQueue.attributes','exports','VoiceQueue','util'];(function(_0x3f99a4,_0x49a964){var _0x4ea168=function(_0x36b575){while(--_0x36b575){_0x3f99a4['push'](_0x3f99a4['shift']());}};_0x4ea168(++_0x49a964);}(_0xedd9,0xfc));var _0x9edd=function(_0x4ba2bb,_0x26a0ef){_0x4ba2bb=_0x4ba2bb-0x0;var _0x4c93cc=_0xedd9[_0x4ba2bb];return _0x4c93cc;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var logger=require(_0x9edd('0x1'))(_0x9edd('0x2'));var moment=require(_0x9edd('0x3'));var BPromise=require(_0x9edd('0x4'));var rp=require(_0x9edd('0x5'));var fs=require('fs');var path=require(_0x9edd('0x6'));var rimraf=require(_0x9edd('0x7'));var config=require('../../config/environment');var attributes=require(_0x9edd('0x8'));module[_0x9edd('0x9')]=function(_0x268f9e,_0x34c1a7){return _0x268f9e['define'](_0x9edd('0xa'),attributes,{'tableName':'voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3e74=['exports','VoiceQueue','voice_queues','lodash','../../config/logger','api','moment','path','../../config/environment','./voiceQueue.attributes'];(function(_0x25b314,_0x2af525){var _0x2f267f=function(_0x38061b){while(--_0x38061b){_0x25b314['push'](_0x25b314['shift']());}};_0x2f267f(++_0x2af525);}(_0x3e74,0x175));var _0x43e7=function(_0x3c6100,_0x16ce8b){_0x3c6100=_0x3c6100-0x0;var _0x5bd99b=_0x3e74[_0x3c6100];return _0x5bd99b;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var logger=require(_0x43e7('0x1'))(_0x43e7('0x2'));var moment=require(_0x43e7('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x43e7('0x4'));var rimraf=require('rimraf');var config=require(_0x43e7('0x5'));var attributes=require(_0x43e7('0x6'));module[_0x43e7('0x7')]=function(_0x1c503b,_0xc98b9c){return _0x1c503b['define'](_0x43e7('0x8'),attributes,{'tableName':_0x43e7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.rpc.js b/server/api/voiceQueue/voiceQueue.rpc.js index 37591aa..64424fa 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 _0x5331=['stringify','error','message','request\x20sent','result','catch','GetVoiceQueue','VoiceQueue','findAll','options','where','include','map','model','attributes','debug','find','raw','ShowVoiceQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./voiceQueue.socket','register','request','then','info','VoiceQueue,\x20%s,\x20%s','VoiceQueue,\x20%s,\x20%s,\x20%s'];(function(_0x46652d,_0x37f677){var _0x175796=function(_0x5b5673){while(--_0x5b5673){_0x46652d['push'](_0x46652d['shift']());}};_0x175796(++_0x37f677);}(_0x5331,0x1c1));var _0x1533=function(_0xd4b628,_0x1d653f){_0xd4b628=_0xd4b628-0x0;var _0x41b47f=_0x5331[_0xd4b628];return _0x41b47f;};'use strict';var _=require(_0x1533('0x0'));var util=require(_0x1533('0x1'));var moment=require(_0x1533('0x2'));var BPromise=require(_0x1533('0x3'));var rs=require(_0x1533('0x4'));var fs=require('fs');var Redis=require(_0x1533('0x5'));var db=require(_0x1533('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x1533('0x7'))(_0x1533('0x8'));var config=require(_0x1533('0x9'));var jayson=require(_0x1533('0xa'));var client=jayson[_0x1533('0xb')][_0x1533('0xc')]({'port':0x232a});config['redis']=_[_0x1533('0xd')](config[_0x1533('0xe')],{'host':_0x1533('0xf'),'port':0x18eb});var socket=require(_0x1533('0x10'))(new Redis(config['redis']));require(_0x1533('0x11'))[_0x1533('0x12')](socket);function respondWithRpcPromise(_0x51931f,_0x101434,_0x44294e){return new BPromise(function(_0x3fb505,_0x13a682){return client[_0x1533('0x13')](_0x51931f,_0x44294e)[_0x1533('0x14')](function(_0x2620b3){logger[_0x1533('0x15')](_0x1533('0x16'),_0x101434,'request\x20sent');logger['debug'](_0x1533('0x17'),_0x101434,'request\x20sent',JSON[_0x1533('0x18')](_0x2620b3));if(_0x2620b3[_0x1533('0x19')]){if(_0x2620b3[_0x1533('0x19')]['code']===0x1f4){logger[_0x1533('0x19')](_0x1533('0x16'),_0x101434,_0x2620b3[_0x1533('0x19')][_0x1533('0x1a')]);return _0x13a682(_0x2620b3[_0x1533('0x19')][_0x1533('0x1a')]);}logger[_0x1533('0x19')](_0x1533('0x16'),_0x101434,_0x2620b3[_0x1533('0x19')][_0x1533('0x1a')]);return _0x3fb505(_0x2620b3[_0x1533('0x19')][_0x1533('0x1a')]);}else{logger[_0x1533('0x15')](_0x1533('0x16'),_0x101434,_0x1533('0x1b'));_0x3fb505(_0x2620b3[_0x1533('0x1c')]['message']);}})[_0x1533('0x1d')](function(_0x1a91bd){logger[_0x1533('0x19')](_0x1533('0x16'),_0x101434,_0x1a91bd);_0x13a682(_0x1a91bd);});});}exports[_0x1533('0x1e')]=function(_0x4af250){var _0x4eadd1=this;return new Promise(function(_0x5ed90c,_0xc17096){return db[_0x1533('0x1f')][_0x1533('0x20')]({'raw':_0x4af250['options']?_0x4af250[_0x1533('0x21')]['raw']===undefined?!![]:![]:!![],'where':_0x4af250[_0x1533('0x21')]?_0x4af250[_0x1533('0x21')][_0x1533('0x22')]||null:null,'attributes':_0x4af250['options']?_0x4af250[_0x1533('0x21')]['attributes']||null:null,'limit':_0x4af250[_0x1533('0x21')]?_0x4af250['options']['limit']||null:null,'include':_0x4af250[_0x1533('0x21')]?_0x4af250[_0x1533('0x21')][_0x1533('0x23')]?_[_0x1533('0x24')](_0x4af250[_0x1533('0x21')][_0x1533('0x23')],function(_0x380e8d){return{'model':db[_0x380e8d[_0x1533('0x25')]],'as':_0x380e8d['as'],'attributes':_0x380e8d['attributes'],'include':_0x380e8d[_0x1533('0x23')]?_['map'](_0x380e8d[_0x1533('0x23')],function(_0x32d57f){return{'model':db[_0x32d57f['model']],'as':_0x32d57f['as'],'attributes':_0x32d57f[_0x1533('0x26')],'include':_0x32d57f['include']?_[_0x1533('0x24')](_0x32d57f['include'],function(_0x5147c8){return{'model':db[_0x5147c8['model']],'as':_0x5147c8['as'],'attributes':_0x5147c8[_0x1533('0x26')]};}):[]};}):[]};}):[]:[]})[_0x1533('0x14')](function(_0x5d08af){logger[_0x1533('0x15')]('GetVoiceQueue',_0x4af250);logger[_0x1533('0x27')]('GetVoiceQueue',_0x4af250,JSON[_0x1533('0x18')](_0x5d08af));_0x5ed90c(_0x5d08af);})[_0x1533('0x1d')](function(_0x6cabc0){logger['error'](_0x1533('0x1e'),_0x6cabc0[_0x1533('0x1a')],_0x4af250);_0xc17096(_0x4eadd1['error'](0x1f4,_0x6cabc0[_0x1533('0x1a')]));});});};exports['ShowVoiceQueue']=function(_0x219dcc){var _0x8f0112=this;return new Promise(function(_0x46bdf2,_0x2e6d99){return db[_0x1533('0x1f')][_0x1533('0x28')]({'raw':_0x219dcc[_0x1533('0x21')]?_0x219dcc[_0x1533('0x21')][_0x1533('0x29')]===undefined?!![]:![]:!![],'where':_0x219dcc[_0x1533('0x21')]?_0x219dcc[_0x1533('0x21')][_0x1533('0x22')]||null:null,'attributes':_0x219dcc[_0x1533('0x21')]?_0x219dcc['options']['attributes']||null:null,'include':_0x219dcc[_0x1533('0x21')]?_0x219dcc[_0x1533('0x21')][_0x1533('0x23')]?_[_0x1533('0x24')](_0x219dcc[_0x1533('0x21')]['include'],function(_0x570d1e){return{'model':db[_0x570d1e[_0x1533('0x25')]],'as':_0x570d1e['as'],'attributes':_0x570d1e[_0x1533('0x26')],'include':_0x570d1e['include']?_[_0x1533('0x24')](_0x570d1e[_0x1533('0x23')],function(_0x56630a){return{'model':db[_0x56630a['model']],'as':_0x56630a['as'],'attributes':_0x56630a[_0x1533('0x26')],'include':_0x56630a[_0x1533('0x23')]?_['map'](_0x56630a[_0x1533('0x23')],function(_0x2226a4){return{'model':db[_0x2226a4[_0x1533('0x25')]],'as':_0x2226a4['as'],'attributes':_0x2226a4[_0x1533('0x26')]};}):[]};}):[]};}):[]:[]})[_0x1533('0x14')](function(_0x2ee1b0){logger[_0x1533('0x15')](_0x1533('0x2a'),_0x219dcc);logger[_0x1533('0x27')]('ShowVoiceQueue',_0x219dcc,JSON['stringify'](_0x2ee1b0));_0x46bdf2(_0x2ee1b0);})[_0x1533('0x1d')](function(_0x15dfb8){logger['error'](_0x1533('0x2a'),_0x15dfb8[_0x1533('0x1a')],_0x219dcc);_0x2e6d99(_0x8f0112['error'](0x1f4,_0x15dfb8[_0x1533('0x1a')]));});});}; \ No newline at end of file +var _0x4926=['attributes','include','map','model','GetVoiceQueue','debug','ShowVoiceQueue','find','raw','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','request','then','VoiceQueue,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','info','result','catch','VoiceQueue','findAll','options','where'];(function(_0x4de74d,_0x154c5f){var _0x259706=function(_0x237371){while(--_0x237371){_0x4de74d['push'](_0x4de74d['shift']());}};_0x259706(++_0x154c5f);}(_0x4926,0xd6));var _0x6492=function(_0x14363e,_0x4f0e0d){_0x14363e=_0x14363e-0x0;var _0x17c56d=_0x4926[_0x14363e];return _0x17c56d;};'use strict';var _=require(_0x6492('0x0'));var util=require('util');var moment=require(_0x6492('0x1'));var BPromise=require(_0x6492('0x2'));var rs=require(_0x6492('0x3'));var fs=require('fs');var Redis=require(_0x6492('0x4'));var db=require(_0x6492('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x6492('0x6'))(_0x6492('0x7'));var config=require(_0x6492('0x8'));var jayson=require(_0x6492('0x9'));var client=jayson['client'][_0x6492('0xa')]({'port':0x232a});config[_0x6492('0xb')]=_[_0x6492('0xc')](config[_0x6492('0xb')],{'host':_0x6492('0xd'),'port':0x18eb});var socket=require(_0x6492('0xe'))(new Redis(config[_0x6492('0xb')]));require(_0x6492('0xf'))[_0x6492('0x10')](socket);function respondWithRpcPromise(_0x5dc856,_0x471b1c,_0x1d8f74){return new BPromise(function(_0x474acb,_0x517c2d){return client[_0x6492('0x11')](_0x5dc856,_0x1d8f74)[_0x6492('0x12')](function(_0x2ff986){logger['info'](_0x6492('0x13'),_0x471b1c,_0x6492('0x14'));logger['debug']('VoiceQueue,\x20%s,\x20%s,\x20%s',_0x471b1c,'request\x20sent',JSON[_0x6492('0x15')](_0x2ff986));if(_0x2ff986['error']){if(_0x2ff986['error'][_0x6492('0x16')]===0x1f4){logger[_0x6492('0x17')](_0x6492('0x13'),_0x471b1c,_0x2ff986[_0x6492('0x17')][_0x6492('0x18')]);return _0x517c2d(_0x2ff986[_0x6492('0x17')][_0x6492('0x18')]);}logger[_0x6492('0x17')](_0x6492('0x13'),_0x471b1c,_0x2ff986[_0x6492('0x17')]['message']);return _0x474acb(_0x2ff986['error'][_0x6492('0x18')]);}else{logger[_0x6492('0x19')](_0x6492('0x13'),_0x471b1c,'request\x20sent');_0x474acb(_0x2ff986[_0x6492('0x1a')][_0x6492('0x18')]);}})[_0x6492('0x1b')](function(_0x256c50){logger[_0x6492('0x17')](_0x6492('0x13'),_0x471b1c,_0x256c50);_0x517c2d(_0x256c50);});});}exports['GetVoiceQueue']=function(_0x484b9b){var _0x326682=this;return new Promise(function(_0x17f178,_0x545226){return db[_0x6492('0x1c')][_0x6492('0x1d')]({'raw':_0x484b9b[_0x6492('0x1e')]?_0x484b9b[_0x6492('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x484b9b['options']?_0x484b9b[_0x6492('0x1e')][_0x6492('0x1f')]||null:null,'attributes':_0x484b9b['options']?_0x484b9b['options'][_0x6492('0x20')]||null:null,'limit':_0x484b9b[_0x6492('0x1e')]?_0x484b9b[_0x6492('0x1e')]['limit']||null:null,'include':_0x484b9b[_0x6492('0x1e')]?_0x484b9b[_0x6492('0x1e')][_0x6492('0x21')]?_[_0x6492('0x22')](_0x484b9b[_0x6492('0x1e')][_0x6492('0x21')],function(_0x4160db){return{'model':db[_0x4160db[_0x6492('0x23')]],'as':_0x4160db['as'],'attributes':_0x4160db[_0x6492('0x20')],'include':_0x4160db[_0x6492('0x21')]?_[_0x6492('0x22')](_0x4160db['include'],function(_0x17c5e1){return{'model':db[_0x17c5e1[_0x6492('0x23')]],'as':_0x17c5e1['as'],'attributes':_0x17c5e1['attributes'],'include':_0x17c5e1['include']?_[_0x6492('0x22')](_0x17c5e1['include'],function(_0x41164f){return{'model':db[_0x41164f[_0x6492('0x23')]],'as':_0x41164f['as'],'attributes':_0x41164f['attributes']};}):[]};}):[]};}):[]:[]})[_0x6492('0x12')](function(_0x27c3a1){logger[_0x6492('0x19')](_0x6492('0x24'),_0x484b9b);logger[_0x6492('0x25')](_0x6492('0x24'),_0x484b9b,JSON['stringify'](_0x27c3a1));_0x17f178(_0x27c3a1);})['catch'](function(_0x550692){logger[_0x6492('0x17')](_0x6492('0x24'),_0x550692[_0x6492('0x18')],_0x484b9b);_0x545226(_0x326682[_0x6492('0x17')](0x1f4,_0x550692['message']));});});};exports[_0x6492('0x26')]=function(_0x3b626b){var _0x518b29=this;return new Promise(function(_0x2d620d,_0x3ca6cc){return db['VoiceQueue'][_0x6492('0x27')]({'raw':_0x3b626b[_0x6492('0x1e')]?_0x3b626b[_0x6492('0x1e')][_0x6492('0x28')]===undefined?!![]:![]:!![],'where':_0x3b626b['options']?_0x3b626b[_0x6492('0x1e')][_0x6492('0x1f')]||null:null,'attributes':_0x3b626b[_0x6492('0x1e')]?_0x3b626b[_0x6492('0x1e')][_0x6492('0x20')]||null:null,'include':_0x3b626b[_0x6492('0x1e')]?_0x3b626b[_0x6492('0x1e')][_0x6492('0x21')]?_[_0x6492('0x22')](_0x3b626b[_0x6492('0x1e')][_0x6492('0x21')],function(_0x56f485){return{'model':db[_0x56f485[_0x6492('0x23')]],'as':_0x56f485['as'],'attributes':_0x56f485[_0x6492('0x20')],'include':_0x56f485[_0x6492('0x21')]?_[_0x6492('0x22')](_0x56f485[_0x6492('0x21')],function(_0x119bd2){return{'model':db[_0x119bd2[_0x6492('0x23')]],'as':_0x119bd2['as'],'attributes':_0x119bd2[_0x6492('0x20')],'include':_0x119bd2[_0x6492('0x21')]?_['map'](_0x119bd2[_0x6492('0x21')],function(_0x9174f2){return{'model':db[_0x9174f2['model']],'as':_0x9174f2['as'],'attributes':_0x9174f2[_0x6492('0x20')]};}):[]};}):[]};}):[]:[]})[_0x6492('0x12')](function(_0x4825f9){logger[_0x6492('0x19')](_0x6492('0x26'),_0x3b626b);logger['debug'](_0x6492('0x26'),_0x3b626b,JSON[_0x6492('0x15')](_0x4825f9));_0x2d620d(_0x4825f9);})[_0x6492('0x1b')](function(_0x6f14c0){logger[_0x6492('0x17')]('ShowVoiceQueue',_0x6f14c0[_0x6492('0x18')],_0x3b626b);_0x3ca6cc(_0x518b29[_0x6492('0x17')](0x1f4,_0x6f14c0[_0x6492('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index 3f6ab2b..f2ebf37 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 _0x8ebe=['save','remove','emit','removeListener','register','voiceQueue:','./voiceQueue.events'];(function(_0x3511d3,_0x4107ae){var _0x5d6321=function(_0x1a23da){while(--_0x1a23da){_0x3511d3['push'](_0x3511d3['shift']());}};_0x5d6321(++_0x4107ae);}(_0x8ebe,0x8b));var _0xe8eb=function(_0x2ae22a,_0x4fe753){_0x2ae22a=_0x2ae22a-0x0;var _0x286a82=_0x8ebe[_0x2ae22a];return _0x286a82;};'use strict';var VoiceQueueEvents=require(_0xe8eb('0x0'));var events=[_0xe8eb('0x1'),_0xe8eb('0x2'),'update'];function createListener(_0x4c8b34,_0x33fa5a){return function(_0x49e043){_0x33fa5a[_0xe8eb('0x3')](_0x4c8b34,_0x49e043);};}function removeListener(_0x9a4ea1,_0x3faa30){return function(){VoiceQueueEvents[_0xe8eb('0x4')](_0x9a4ea1,_0x3faa30);};}exports[_0xe8eb('0x5')]=function(_0x18884f){for(var _0x435e0e=0x0,_0x294c52=events['length'];_0x435e0e<_0x294c52;_0x435e0e++){var _0x2b069e=events[_0x435e0e];var _0x54c598=createListener(_0xe8eb('0x6')+_0x2b069e,_0x18884f);VoiceQueueEvents['on'](_0x2b069e,_0x54c598);}}; \ No newline at end of file +var _0xc7a7=['removeListener','length','./voiceQueue.events','save','update','emit'];(function(_0x33c6e5,_0xcf8dc3){var _0x1a893a=function(_0x1e08cc){while(--_0x1e08cc){_0x33c6e5['push'](_0x33c6e5['shift']());}};_0x1a893a(++_0xcf8dc3);}(_0xc7a7,0x1b2));var _0x7c7a=function(_0x1b3391,_0xf0f02a){_0x1b3391=_0x1b3391-0x0;var _0x88073d=_0xc7a7[_0x1b3391];return _0x88073d;};'use strict';var VoiceQueueEvents=require(_0x7c7a('0x0'));var events=[_0x7c7a('0x1'),'remove',_0x7c7a('0x2')];function createListener(_0x226273,_0x168d2f){return function(_0x546b4e){_0x168d2f[_0x7c7a('0x3')](_0x226273,_0x546b4e);};}function removeListener(_0x544f78,_0x1d076b){return function(){VoiceQueueEvents[_0x7c7a('0x4')](_0x544f78,_0x1d076b);};}exports['register']=function(_0x4f23fb){for(var _0x320657=0x0,_0x1eae5b=events[_0x7c7a('0x5')];_0x320657<_0x1eae5b;_0x320657++){var _0x153db=events[_0x320657];var _0x4fc946=createListener('voiceQueue:'+_0x153db,_0x4f23fb);VoiceQueueEvents['on'](_0x153db,_0x4fc946);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index 6be421c..ae57f32 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 _0x0546=['get','isAuthenticated','index','/describe','describe','/index','getVoiceQueuesReport','/:id','show','post','create','put','update','delete','destroy','exports','multer','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller'];(function(_0x31bca3,_0x209a1e){var _0x2f10ea=function(_0x248a36){while(--_0x248a36){_0x31bca3['push'](_0x31bca3['shift']());}};_0x2f10ea(++_0x209a1e);}(_0x0546,0xb8));var _0x6054=function(_0x507403,_0x3f954d){_0x507403=_0x507403-0x0;var _0x1327c=_0x0546[_0x507403];return _0x1327c;};'use strict';var multer=require(_0x6054('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x6054('0x1'));var express=require(_0x6054('0x2'));var router=express['Router']();var fs_extra=require(_0x6054('0x3'));var auth=require(_0x6054('0x4'));var interaction=require(_0x6054('0x5'));var config=require(_0x6054('0x6'));var controller=require(_0x6054('0x7'));router[_0x6054('0x8')]('/',auth[_0x6054('0x9')](),controller[_0x6054('0xa')]);router[_0x6054('0x8')](_0x6054('0xb'),auth[_0x6054('0x9')](),controller[_0x6054('0xc')]);router[_0x6054('0x8')](_0x6054('0xd'),auth[_0x6054('0x9')](),controller[_0x6054('0xe')]);router[_0x6054('0x8')](_0x6054('0xf'),auth[_0x6054('0x9')](),controller[_0x6054('0x10')]);router[_0x6054('0x11')]('/',auth[_0x6054('0x9')](),controller[_0x6054('0x12')]);router[_0x6054('0x13')](_0x6054('0xf'),auth[_0x6054('0x9')](),controller[_0x6054('0x14')]);router[_0x6054('0x15')](_0x6054('0xf'),auth[_0x6054('0x9')](),controller[_0x6054('0x16')]);module[_0x6054('0x17')]=router; \ No newline at end of file +var _0x2cc0=['./voiceQueueReport.controller','isAuthenticated','get','describe','/index','getVoiceQueuesReport','/:id','show','post','put','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x5ae621,_0x1867c7){var _0x137ad0=function(_0x3709ab){while(--_0x3709ab){_0x5ae621['push'](_0x5ae621['shift']());}};_0x137ad0(++_0x1867c7);}(_0x2cc0,0xdf));var _0x02cc=function(_0x195ac2,_0x4557d7){_0x195ac2=_0x195ac2-0x0;var _0x83cb5a=_0x2cc0[_0x195ac2];return _0x83cb5a;};'use strict';var multer=require(_0x02cc('0x0'));var util=require('util');var path=require(_0x02cc('0x1'));var timeout=require('connect-timeout');var express=require(_0x02cc('0x2'));var router=express[_0x02cc('0x3')]();var fs_extra=require(_0x02cc('0x4'));var auth=require(_0x02cc('0x5'));var interaction=require(_0x02cc('0x6'));var config=require(_0x02cc('0x7'));var controller=require(_0x02cc('0x8'));router['get']('/',auth[_0x02cc('0x9')](),controller['index']);router[_0x02cc('0xa')]('/describe',auth[_0x02cc('0x9')](),controller[_0x02cc('0xb')]);router[_0x02cc('0xa')](_0x02cc('0xc'),auth[_0x02cc('0x9')](),controller[_0x02cc('0xd')]);router[_0x02cc('0xa')](_0x02cc('0xe'),auth[_0x02cc('0x9')](),controller[_0x02cc('0xf')]);router[_0x02cc('0x10')]('/',auth[_0x02cc('0x9')](),controller['create']);router[_0x02cc('0x11')](_0x02cc('0xe'),auth['isAuthenticated'](),controller['update']);router[_0x02cc('0x12')]('/:id',auth[_0x02cc('0x9')](),controller[_0x02cc('0x13')]);module[_0x02cc('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index 14c1710..313c73b 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 _0x1223=['moment','exports','STRING','DATE','getDataValue','format','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','sequelize'];(function(_0x20845e,_0x211e78){var _0x28cf2b=function(_0x31d613){while(--_0x31d613){_0x20845e['push'](_0x20845e['shift']());}};_0x28cf2b(++_0x211e78);}(_0x1223,0x158));var _0x3122=function(_0x546f7d,_0x19d51d){_0x546f7d=_0x546f7d-0x0;var _0x22b4b5=_0x1223[_0x546f7d];return _0x22b4b5;};'use strict';var Sequelize=require(_0x3122('0x0'));var moment=require(_0x3122('0x1'));module[_0x3122('0x2')]={'type':{'type':Sequelize[_0x3122('0x3')]},'uniqueid':{'type':Sequelize[_0x3122('0x3')]},'calleridnum':{'type':Sequelize[_0x3122('0x3')]},'calleridname':{'type':Sequelize[_0x3122('0x3')]},'queue':{'type':Sequelize['STRING']},'queuecallerjoinAt':{'type':Sequelize[_0x3122('0x4')]},'queuecallerleaveAt':{'type':Sequelize[_0x3122('0x4')],'set':function(_0x392f24){var _0x5979ec=moment(_0x392f24);var _0x520070=moment(this[_0x3122('0x5')]('queuecallerjoinAt'))[_0x3122('0x6')](_0x3122('0x7'));var _0x2b4750=_0x5979ec[_0x3122('0x8')](_0x520070,_0x3122('0x9'));this[_0x3122('0xa')](_0x3122('0xb'),_0x392f24);this['setDataValue'](_0x3122('0xc'),_0x2b4750||null);}},'position':{'type':Sequelize[_0x3122('0xd')]},'count':{'type':Sequelize[_0x3122('0xd')]},'queuecallerabandon':{'type':Sequelize[_0x3122('0xe')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x3122('0x4')]},'queuecallercomplete':{'type':Sequelize[_0x3122('0xe')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x3122('0x4')]},'queuecallerexit':{'type':Sequelize[_0x3122('0xe')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x3122('0x4')]},'queuecallerexitreason':{'type':Sequelize[_0x3122('0x3')],'comment':'COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'},'originalposition':{'type':Sequelize[_0x3122('0xd')]},'channel':{'type':Sequelize[_0x3122('0x3')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x3122('0x3')]},'accountcode':{'type':Sequelize[_0x3122('0x3')]},'context':{'type':Sequelize[_0x3122('0x3')]},'exten':{'type':Sequelize[_0x3122('0x3')]},'priority':{'type':Sequelize[_0x3122('0x3')]},'holdtime':{'type':Sequelize[_0x3122('0xd')]},'mohtime':{'type':Sequelize[_0x3122('0xd')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x3122('0xe')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0x3122('0xe')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0x3122('0x3')]},'disposition':{'type':Sequelize[_0x3122('0x3')]},'secondDisposition':{'type':Sequelize[_0x3122('0x3')]},'thirdDisposition':{'type':Sequelize[_0x3122('0x3')]},'queuecallerenterreason':{'type':Sequelize[_0x3122('0xd')],'defaultValue':0x0},'note':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x7fd9=['queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','STRING','getDataValue','queuecallerjoinAt','format','seconds'];(function(_0x3d5df9,_0x5b3623){var _0x50ba39=function(_0x3c0de0){while(--_0x3c0de0){_0x3d5df9['push'](_0x3d5df9['shift']());}};_0x50ba39(++_0x5b3623);}(_0x7fd9,0x102));var _0x97fd=function(_0x2bf66e,_0xfb08f0){_0x2bf66e=_0x2bf66e-0x0;var _0x10179b=_0x7fd9[_0x2bf66e];return _0x10179b;};'use strict';var Sequelize=require(_0x97fd('0x0'));var moment=require('moment');module['exports']={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x97fd('0x1')]},'calleridnum':{'type':Sequelize[_0x97fd('0x1')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x97fd('0x1')]},'queuecallerjoinAt':{'type':Sequelize['DATE']},'queuecallerleaveAt':{'type':Sequelize['DATE'],'set':function(_0x10f362){var _0xd574f7=moment(_0x10f362);var _0x240441=moment(this[_0x97fd('0x2')](_0x97fd('0x3')))[_0x97fd('0x4')]('YYYY-MM-DD\x20HH:mm:ss');var _0xd33697=_0xd574f7['diff'](_0x240441,_0x97fd('0x5'));this['setDataValue'](_0x97fd('0x6'),_0x10f362);this['setDataValue'](_0x97fd('0x7'),_0xd33697||null);}},'position':{'type':Sequelize[_0x97fd('0x8')]},'count':{'type':Sequelize[_0x97fd('0x8')]},'queuecallerabandon':{'type':Sequelize[_0x97fd('0x9')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize['DATE']},'queuecallercomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize['DATE']},'queuecallerexit':{'type':Sequelize[_0x97fd('0x9')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize['DATE']},'queuecallerexitreason':{'type':Sequelize[_0x97fd('0x1')],'comment':_0x97fd('0xa')},'originalposition':{'type':Sequelize[_0x97fd('0x8')]},'channel':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x97fd('0x1')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x97fd('0x1')]},'exten':{'type':Sequelize[_0x97fd('0x1')]},'priority':{'type':Sequelize[_0x97fd('0x1')]},'holdtime':{'type':Sequelize[_0x97fd('0x8')]},'mohtime':{'type':Sequelize[_0x97fd('0x8')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x97fd('0x9')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0x97fd('0x9')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x97fd('0x1')],'comment':_0x97fd('0xb')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0x97fd('0x1')]},'disposition':{'type':Sequelize[_0x97fd('0x1')]},'secondDisposition':{'type':Sequelize[_0x97fd('0x1')]},'thirdDisposition':{'type':Sequelize[_0x97fd('0x1')]},'queuecallerenterreason':{'type':Sequelize[_0x97fd('0x8')],'defaultValue':0x0},'note':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.controller.js b/server/api/voiceQueueReport/voiceQueueReport.controller.js index b33cc13..ef9e506 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 _0x4e4f=['includeAll','include','findAll','rows','params','find','create','body','catch','describe','nolimit','getVoiceQueuesReport','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./voiceQueueReport.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','VoiceQueueReport','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge'];(function(_0xe0b8a0,_0xdf3087){var _0xd2cd16=function(_0x391bcb){while(--_0x391bcb){_0xe0b8a0['push'](_0xe0b8a0['shift']());}};_0xd2cd16(++_0xdf3087);}(_0x4e4f,0x1b5));var _0xf4e4=function(_0x3ab214,_0x3134f5){_0x3ab214=_0x3ab214-0x0;var _0x297528=_0x4e4f[_0x3ab214];return _0x297528;};'use strict';var emlformat=require(_0xf4e4('0x0'));var rimraf=require(_0xf4e4('0x1'));var zipdir=require(_0xf4e4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf4e4('0x3'));var moment=require(_0xf4e4('0x4'));var BPromise=require(_0xf4e4('0x5'));var Mustache=require(_0xf4e4('0x6'));var util=require(_0xf4e4('0x7'));var path=require(_0xf4e4('0x8'));var sox=require(_0xf4e4('0x9'));var csv=require(_0xf4e4('0xa'));var ejs=require(_0xf4e4('0xb'));var fs=require('fs');var fs_extra=require(_0xf4e4('0xc'));var _=require(_0xf4e4('0xd'));var squel=require(_0xf4e4('0xe'));var crypto=require(_0xf4e4('0xf'));var jsforce=require(_0xf4e4('0x10'));var deskjs=require(_0xf4e4('0x11'));var toCsv=require('to-csv');var querystring=require(_0xf4e4('0x12'));var Papa=require('papaparse');var Redis=require(_0xf4e4('0x13'));var authService=require(_0xf4e4('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xf4e4('0x15'))(_0xf4e4('0x16'));var utils=require('../../config/utils');var config=require(_0xf4e4('0x17'));var licenseUtil=require(_0xf4e4('0x18'));var db=require(_0xf4e4('0x19'))['db'];config[_0xf4e4('0x1a')]=_['defaults'](config[_0xf4e4('0x1a')],{'host':_0xf4e4('0x1b'),'port':0x18eb});var socket=require(_0xf4e4('0x1c'))(new Redis(config[_0xf4e4('0x1a')]));require(_0xf4e4('0x1d'))[_0xf4e4('0x1e')](socket);function respondWithStatusCode(_0x5165fc,_0x2c5b94){_0x2c5b94=_0x2c5b94||0xcc;return function(_0xb689bf){if(_0xb689bf){return _0x5165fc[_0xf4e4('0x1f')](_0x2c5b94);}return _0x5165fc[_0xf4e4('0x20')](_0x2c5b94)[_0xf4e4('0x21')]();};}function respondWithResult(_0x31e36e,_0x4353c9){_0x4353c9=_0x4353c9||0xc8;return function(_0xc39f31){if(_0xc39f31){return _0x31e36e[_0xf4e4('0x20')](_0x4353c9)[_0xf4e4('0x22')](_0xc39f31);}};}function respondWithFilteredResult(_0x449c87,_0x16536e){return function(_0x1d7457){if(_0x1d7457){var _0x49b67b=typeof _0x16536e[_0xf4e4('0x23')]===_0xf4e4('0x24')&&typeof _0x16536e[_0xf4e4('0x25')]===_0xf4e4('0x24');var _0x4b2750=_0x1d7457[_0xf4e4('0x26')];var _0x2cc5de=_0x49b67b?0x0:_0x16536e[_0xf4e4('0x23')];var _0x558898=_0x49b67b?_0x1d7457[_0xf4e4('0x26')]:_0x16536e[_0xf4e4('0x23')]+_0x16536e[_0xf4e4('0x25')];var _0x319357;if(_0x558898>=_0x4b2750){_0x558898=_0x4b2750;_0x319357=0xc8;}else{_0x319357=0xce;}_0x449c87[_0xf4e4('0x20')](_0x319357);return _0x449c87[_0xf4e4('0x27')](_0xf4e4('0x28'),_0x2cc5de+'-'+_0x558898+'/'+_0x4b2750)[_0xf4e4('0x22')](_0x1d7457);}return null;};}function patchUpdates(_0x210a5e){return function(_0xcb9ac7){try{jsonpatch[_0xf4e4('0x29')](_0xcb9ac7,_0x210a5e,!![]);}catch(_0x38ae65){return BPromise[_0xf4e4('0x2a')](_0x38ae65);}return _0xcb9ac7[_0xf4e4('0x2b')]();};}function saveUpdates(_0x13e318,_0x3fb94b){return function(_0x670ced){if(_0x670ced){return _0x670ced[_0xf4e4('0x2c')](_0x13e318)[_0xf4e4('0x2d')](function(_0x24be52){return _0x24be52;});}return null;};}function removeEntity(_0x3b504e,_0x1ac115){return function(_0x412963){if(_0x412963){return _0x412963['destroy']()['then'](function(){_0x3b504e[_0xf4e4('0x20')](0xcc)[_0xf4e4('0x21')]();});}};}function handleEntityNotFound(_0x79ff22,_0xfbe929){return function(_0x51e5d7){if(!_0x51e5d7){_0x79ff22[_0xf4e4('0x1f')](0x194);}return _0x51e5d7;};}function handleError(_0x394c80,_0x457626){_0x457626=_0x457626||0x1f4;return function(_0x2a11ce){logger[_0xf4e4('0x2e')](_0x2a11ce[_0xf4e4('0x2f')]);if(_0x2a11ce[_0xf4e4('0x30')]){delete _0x2a11ce[_0xf4e4('0x30')];}_0x394c80['status'](_0x457626)[_0xf4e4('0x31')](_0x2a11ce);};}exports[_0xf4e4('0x32')]=function(_0x1d296d,_0x4dfb0f){var _0xf23ec8={},_0x4aa244={},_0x2a3bf6={'count':0x0,'rows':[]};var _0x5dd837=_[_0xf4e4('0x33')](db[_0xf4e4('0x34')][_0xf4e4('0x35')],function(_0x4928e4){return{'name':_0x4928e4[_0xf4e4('0x36')],'type':_0x4928e4[_0xf4e4('0x37')][_0xf4e4('0x38')]};});_0x4aa244[_0xf4e4('0x39')]=_[_0xf4e4('0x33')](_0x5dd837,'name');_0x4aa244['query']=_[_0xf4e4('0x3a')](_0x1d296d['query']);_0x4aa244[_0xf4e4('0x3b')]=_[_0xf4e4('0x3c')](_0x4aa244['model'],_0x4aa244[_0xf4e4('0x3d')]);_0xf23ec8['attributes']=_[_0xf4e4('0x3c')](_0x4aa244['model'],qs[_0xf4e4('0x3e')](_0x1d296d[_0xf4e4('0x3d')][_0xf4e4('0x3e')]));_0xf23ec8[_0xf4e4('0x3f')]=_0xf23ec8[_0xf4e4('0x3f')][_0xf4e4('0x40')]?_0xf23ec8['attributes']:_0x4aa244[_0xf4e4('0x39')];if(!_0x1d296d[_0xf4e4('0x3d')][_0xf4e4('0x41')]('nolimit')){_0xf23ec8[_0xf4e4('0x25')]=qs[_0xf4e4('0x25')](_0x1d296d[_0xf4e4('0x3d')][_0xf4e4('0x25')]);_0xf23ec8[_0xf4e4('0x23')]=qs['offset'](_0x1d296d[_0xf4e4('0x3d')][_0xf4e4('0x23')]);}_0xf23ec8[_0xf4e4('0x42')]=qs[_0xf4e4('0x43')](_0x1d296d[_0xf4e4('0x3d')][_0xf4e4('0x43')]);_0xf23ec8[_0xf4e4('0x44')]=qs[_0xf4e4('0x3b')](_[_0xf4e4('0x45')](_0x1d296d[_0xf4e4('0x3d')],_0x4aa244[_0xf4e4('0x3b')]),_0x5dd837);if(_0x1d296d['query'][_0xf4e4('0x46')]){_0xf23ec8['where']=_['merge'](_0xf23ec8[_0xf4e4('0x44')],{'$or':_[_0xf4e4('0x33')](_0x5dd837,function(_0x12a596){if(_0x12a596[_0xf4e4('0x37')]!==_0xf4e4('0x47')){var _0x17095d={};_0x17095d[_0x12a596[_0xf4e4('0x30')]]={'$like':'%'+_0x1d296d[_0xf4e4('0x3d')][_0xf4e4('0x46')]+'%'};return _0x17095d;}})});}_0xf23ec8=_[_0xf4e4('0x48')]({},_0xf23ec8,_0x1d296d['options']);var _0x48aaf5={'where':_0xf23ec8[_0xf4e4('0x44')]};return db[_0xf4e4('0x34')]['count'](_0x48aaf5)[_0xf4e4('0x2d')](function(_0x287fe7){_0x2a3bf6[_0xf4e4('0x26')]=_0x287fe7;if(_0x1d296d['query'][_0xf4e4('0x49')]){_0xf23ec8[_0xf4e4('0x4a')]=[{'all':!![]}];}return db[_0xf4e4('0x34')][_0xf4e4('0x4b')](_0xf23ec8);})[_0xf4e4('0x2d')](function(_0x552868){_0x2a3bf6[_0xf4e4('0x4c')]=_0x552868;return _0x2a3bf6;})['then'](respondWithFilteredResult(_0x4dfb0f,_0xf23ec8))['catch'](handleError(_0x4dfb0f,null));};exports['show']=function(_0x1763ee,_0x169e92){var _0x31ccba={'raw':![],'where':{'id':_0x1763ee[_0xf4e4('0x4d')]['id']}},_0x181933={};_0x181933['model']=_[_0xf4e4('0x3a')](db[_0xf4e4('0x34')][_0xf4e4('0x35')]);_0x181933['query']=_[_0xf4e4('0x3a')](_0x1763ee[_0xf4e4('0x3d')]);_0x181933[_0xf4e4('0x3b')]=_[_0xf4e4('0x3c')](_0x181933[_0xf4e4('0x39')],_0x181933['query']);_0x31ccba[_0xf4e4('0x3f')]=_[_0xf4e4('0x3c')](_0x181933[_0xf4e4('0x39')],qs[_0xf4e4('0x3e')](_0x1763ee[_0xf4e4('0x3d')][_0xf4e4('0x3e')]));_0x31ccba[_0xf4e4('0x3f')]=_0x31ccba[_0xf4e4('0x3f')][_0xf4e4('0x40')]?_0x31ccba[_0xf4e4('0x3f')]:_0x181933[_0xf4e4('0x39')];if(_0x1763ee[_0xf4e4('0x3d')][_0xf4e4('0x49')]){_0x31ccba[_0xf4e4('0x4a')]=[{'all':!![]}];}_0x31ccba=_['merge']({},_0x31ccba,_0x1763ee['options']);return db[_0xf4e4('0x34')][_0xf4e4('0x4e')](_0x31ccba)[_0xf4e4('0x2d')](handleEntityNotFound(_0x169e92,null))[_0xf4e4('0x2d')](respondWithResult(_0x169e92,null))['catch'](handleError(_0x169e92,null));};exports['create']=function(_0x37ce4d,_0x457cb7){return db[_0xf4e4('0x34')][_0xf4e4('0x4f')](_0x37ce4d[_0xf4e4('0x50')],{})[_0xf4e4('0x2d')](respondWithResult(_0x457cb7,0xc9))[_0xf4e4('0x51')](handleError(_0x457cb7,null));};exports[_0xf4e4('0x2c')]=function(_0x182c45,_0x5ca653){if(_0x182c45['body']['id']){delete _0x182c45['body']['id'];}return db[_0xf4e4('0x34')][_0xf4e4('0x4e')]({'where':{'id':_0x182c45[_0xf4e4('0x4d')]['id']}})[_0xf4e4('0x2d')](handleEntityNotFound(_0x5ca653,null))[_0xf4e4('0x2d')](saveUpdates(_0x182c45[_0xf4e4('0x50')],null))[_0xf4e4('0x2d')](respondWithResult(_0x5ca653,null))[_0xf4e4('0x51')](handleError(_0x5ca653,null));};exports['destroy']=function(_0x311e5d,_0x1922cc){return db[_0xf4e4('0x34')]['find']({'where':{'id':_0x311e5d[_0xf4e4('0x4d')]['id']}})[_0xf4e4('0x2d')](handleEntityNotFound(_0x1922cc,null))['then'](removeEntity(_0x1922cc,null))['catch'](handleError(_0x1922cc,null));};exports[_0xf4e4('0x52')]=function(_0x517870,_0x3d2607){return db['VoiceQueueReport'][_0xf4e4('0x52')]()[_0xf4e4('0x2d')](respondWithResult(_0x3d2607,null))[_0xf4e4('0x51')](handleError(_0x3d2607,null));};exports['getVoiceQueuesReport']=function(_0x251bef,_0x24d82b){var _0x1b3376={},_0x5f1db8={},_0xbb9fd3={'count':0x0,'rows':[]};_0x5f1db8[_0xf4e4('0x39')]=_[_0xf4e4('0x3a')](db['VoiceQueueReport'][_0xf4e4('0x35')]);_0x5f1db8[_0xf4e4('0x3d')]=_['keys'](_0x251bef['query']);_0x5f1db8[_0xf4e4('0x3b')]=_[_0xf4e4('0x3c')](_0x5f1db8[_0xf4e4('0x39')],_0x5f1db8[_0xf4e4('0x3d')]);_0x1b3376['attributes']=_['intersection'](_0x5f1db8[_0xf4e4('0x39')],qs[_0xf4e4('0x3e')](_0x251bef['query'][_0xf4e4('0x3e')]));_0x1b3376[_0xf4e4('0x3f')]=_0x1b3376[_0xf4e4('0x3f')][_0xf4e4('0x40')]?_0x1b3376['attributes']:_0x5f1db8['model'];if(!_0x251bef['query']['hasOwnProperty'](_0xf4e4('0x53'))){_0x1b3376[_0xf4e4('0x25')]=qs[_0xf4e4('0x25')](_0x251bef['query'][_0xf4e4('0x25')]);_0x1b3376[_0xf4e4('0x23')]=qs[_0xf4e4('0x23')](_0x251bef['query'][_0xf4e4('0x23')]);}_0x1b3376[_0xf4e4('0x42')]=qs[_0xf4e4('0x43')](_0x251bef[_0xf4e4('0x3d')][_0xf4e4('0x43')]);_0x1b3376[_0xf4e4('0x44')]=qs[_0xf4e4('0x3b')](_['pick'](_0x251bef[_0xf4e4('0x3d')],_0x5f1db8['filters']));if(_0x251bef[_0xf4e4('0x3d')][_0xf4e4('0x46')]){_0x1b3376[_0xf4e4('0x44')]=_['merge'](_0x1b3376[_0xf4e4('0x44')],{'$or':_[_0xf4e4('0x33')](_0x1b3376[_0xf4e4('0x3f')],function(_0xd2b512){var _0x110fc2={};_0x110fc2[_0xd2b512]={'$like':'%'+_0x251bef[_0xf4e4('0x3d')]['filter']+'%'};return _0x110fc2;})});}_0x1b3376=_[_0xf4e4('0x48')]({},_0x1b3376,_0x251bef['options']);var _0x2d502b={'where':_0x1b3376[_0xf4e4('0x44')]};return db[_0xf4e4('0x34')]['count'](_0x2d502b)[_0xf4e4('0x2d')](function(_0x47257f){_0xbb9fd3['count']=_0x47257f;if(_0x251bef[_0xf4e4('0x3d')][_0xf4e4('0x49')]){_0x1b3376[_0xf4e4('0x4a')]=[{'all':!![]}];}return db[_0xf4e4('0x34')][_0xf4e4('0x4b')](_0x1b3376);})['then'](function(_0x47259b){_0xbb9fd3[_0xf4e4('0x4c')]=_0x47259b;return _0xbb9fd3;})[_0xf4e4('0x2d')](respondWithFilteredResult(_0x24d82b,_0x1b3376,_0xf4e4('0x54')))[_0xf4e4('0x51')](handleError(_0x24d82b,null,_0xf4e4('0x54')));}; \ No newline at end of file +var _0x2911=['ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./voiceQueueReport.socket','register','sendStatus','status','json','undefined','limit','count','offset','set','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','VoiceQueueReport','type','key','map','keys','filters','intersection','model','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','getVoiceQueuesReport','rawAttributes','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','papaparse'];(function(_0x22419f,_0x1ea160){var _0x1e1b68=function(_0x3bb649){while(--_0x3bb649){_0x22419f['push'](_0x22419f['shift']());}};_0x1e1b68(++_0x1ea160);}(_0x2911,0x147));var _0x1291=function(_0x12f52d,_0x2b3b28){_0x12f52d=_0x12f52d-0x0;var _0x2c796e=_0x2911[_0x12f52d];return _0x2c796e;};'use strict';var emlformat=require(_0x1291('0x0'));var rimraf=require(_0x1291('0x1'));var zipdir=require(_0x1291('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1291('0x3'));var moment=require(_0x1291('0x4'));var BPromise=require(_0x1291('0x5'));var Mustache=require(_0x1291('0x6'));var util=require('util');var path=require(_0x1291('0x7'));var sox=require(_0x1291('0x8'));var csv=require('to-csv');var ejs=require(_0x1291('0x9'));var fs=require('fs');var fs_extra=require(_0x1291('0xa'));var _=require(_0x1291('0xb'));var squel=require(_0x1291('0xc'));var crypto=require('crypto');var jsforce=require(_0x1291('0xd'));var deskjs=require(_0x1291('0xe'));var toCsv=require(_0x1291('0xf'));var querystring=require('querystring');var Papa=require(_0x1291('0x10'));var Redis=require(_0x1291('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x1291('0x12'));var as=require(_0x1291('0x13'));var hardwareService=require(_0x1291('0x14'));var logger=require(_0x1291('0x15'))(_0x1291('0x16'));var utils=require(_0x1291('0x17'));var config=require(_0x1291('0x18'));var licenseUtil=require(_0x1291('0x19'));var db=require(_0x1291('0x1a'))['db'];config[_0x1291('0x1b')]=_[_0x1291('0x1c')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x1291('0x1d'))(new Redis(config['redis']));require(_0x1291('0x1e'))[_0x1291('0x1f')](socket);function respondWithStatusCode(_0x30e025,_0x4a02f1){_0x4a02f1=_0x4a02f1||0xcc;return function(_0xbf8221){if(_0xbf8221){return _0x30e025[_0x1291('0x20')](_0x4a02f1);}return _0x30e025[_0x1291('0x21')](_0x4a02f1)['end']();};}function respondWithResult(_0x471a26,_0x953590){_0x953590=_0x953590||0xc8;return function(_0x55b11b){if(_0x55b11b){return _0x471a26[_0x1291('0x21')](_0x953590)[_0x1291('0x22')](_0x55b11b);}};}function respondWithFilteredResult(_0x6cfdf7,_0x358f79){return function(_0x172855){if(_0x172855){var _0x27be4f=typeof _0x358f79['offset']===_0x1291('0x23')&&typeof _0x358f79[_0x1291('0x24')]===_0x1291('0x23');var _0x34f178=_0x172855[_0x1291('0x25')];var _0x490793=_0x27be4f?0x0:_0x358f79['offset'];var _0x2e11ae=_0x27be4f?_0x172855[_0x1291('0x25')]:_0x358f79[_0x1291('0x26')]+_0x358f79[_0x1291('0x24')];var _0x43ab73;if(_0x2e11ae>=_0x34f178){_0x2e11ae=_0x34f178;_0x43ab73=0xc8;}else{_0x43ab73=0xce;}_0x6cfdf7[_0x1291('0x21')](_0x43ab73);return _0x6cfdf7[_0x1291('0x27')]('Content-Range',_0x490793+'-'+_0x2e11ae+'/'+_0x34f178)[_0x1291('0x22')](_0x172855);}return null;};}function patchUpdates(_0x5c94a1){return function(_0x27010f){try{jsonpatch[_0x1291('0x28')](_0x27010f,_0x5c94a1,!![]);}catch(_0x401f20){return BPromise[_0x1291('0x29')](_0x401f20);}return _0x27010f[_0x1291('0x2a')]();};}function saveUpdates(_0x10beb5,_0x1bbafd){return function(_0x1f552c){if(_0x1f552c){return _0x1f552c[_0x1291('0x2b')](_0x10beb5)[_0x1291('0x2c')](function(_0x4b74c2){return _0x4b74c2;});}return null;};}function removeEntity(_0x552f93,_0x5e3c17){return function(_0x2739b7){if(_0x2739b7){return _0x2739b7[_0x1291('0x2d')]()[_0x1291('0x2c')](function(){_0x552f93[_0x1291('0x21')](0xcc)[_0x1291('0x2e')]();});}};}function handleEntityNotFound(_0x21bac6,_0x5a2edf){return function(_0x58d3eb){if(!_0x58d3eb){_0x21bac6[_0x1291('0x20')](0x194);}return _0x58d3eb;};}function handleError(_0xe6f7a3,_0x30bb23){_0x30bb23=_0x30bb23||0x1f4;return function(_0x228434){logger[_0x1291('0x2f')](_0x228434[_0x1291('0x30')]);if(_0x228434[_0x1291('0x31')]){delete _0x228434[_0x1291('0x31')];}_0xe6f7a3['status'](_0x30bb23)[_0x1291('0x32')](_0x228434);};}exports[_0x1291('0x33')]=function(_0x48afb2,_0x9dbb78){var _0x34927c={},_0x173ada={},_0x273e60={'count':0x0,'rows':[]};var _0x1ad03d=_['map'](db[_0x1291('0x34')]['rawAttributes'],function(_0x37a41a){return{'name':_0x37a41a['fieldName'],'type':_0x37a41a[_0x1291('0x35')][_0x1291('0x36')]};});_0x173ada['model']=_[_0x1291('0x37')](_0x1ad03d,_0x1291('0x31'));_0x173ada['query']=_[_0x1291('0x38')](_0x48afb2['query']);_0x173ada[_0x1291('0x39')]=_[_0x1291('0x3a')](_0x173ada[_0x1291('0x3b')],_0x173ada[_0x1291('0x3c')]);_0x34927c[_0x1291('0x3d')]=_['intersection'](_0x173ada[_0x1291('0x3b')],qs[_0x1291('0x3e')](_0x48afb2[_0x1291('0x3c')][_0x1291('0x3e')]));_0x34927c[_0x1291('0x3d')]=_0x34927c[_0x1291('0x3d')][_0x1291('0x3f')]?_0x34927c['attributes']:_0x173ada[_0x1291('0x3b')];if(!_0x48afb2['query'][_0x1291('0x40')](_0x1291('0x41'))){_0x34927c['limit']=qs[_0x1291('0x24')](_0x48afb2['query']['limit']);_0x34927c['offset']=qs[_0x1291('0x26')](_0x48afb2['query'][_0x1291('0x26')]);}_0x34927c[_0x1291('0x42')]=qs[_0x1291('0x43')](_0x48afb2['query'][_0x1291('0x43')]);_0x34927c['where']=qs[_0x1291('0x39')](_[_0x1291('0x44')](_0x48afb2[_0x1291('0x3c')],_0x173ada[_0x1291('0x39')]),_0x1ad03d);if(_0x48afb2['query'][_0x1291('0x45')]){_0x34927c[_0x1291('0x46')]=_['merge'](_0x34927c[_0x1291('0x46')],{'$or':_[_0x1291('0x37')](_0x1ad03d,function(_0xd81076){if(_0xd81076['type']!==_0x1291('0x47')){var _0x49305f={};_0x49305f[_0xd81076['name']]={'$like':'%'+_0x48afb2[_0x1291('0x3c')]['filter']+'%'};return _0x49305f;}})});}_0x34927c=_[_0x1291('0x48')]({},_0x34927c,_0x48afb2['options']);var _0x14be9f={'where':_0x34927c['where']};return db['VoiceQueueReport'][_0x1291('0x25')](_0x14be9f)[_0x1291('0x2c')](function(_0x1c2d40){_0x273e60[_0x1291('0x25')]=_0x1c2d40;if(_0x48afb2[_0x1291('0x3c')][_0x1291('0x49')]){_0x34927c[_0x1291('0x4a')]=[{'all':!![]}];}return db[_0x1291('0x34')][_0x1291('0x4b')](_0x34927c);})[_0x1291('0x2c')](function(_0x4e1703){_0x273e60[_0x1291('0x4c')]=_0x4e1703;return _0x273e60;})[_0x1291('0x2c')](respondWithFilteredResult(_0x9dbb78,_0x34927c))[_0x1291('0x4d')](handleError(_0x9dbb78,null));};exports[_0x1291('0x4e')]=function(_0x4caa37,_0x383fff){var _0x1272c6={'raw':![],'where':{'id':_0x4caa37[_0x1291('0x4f')]['id']}},_0x2142c7={};_0x2142c7['model']=_[_0x1291('0x38')](db[_0x1291('0x34')]['rawAttributes']);_0x2142c7['query']=_[_0x1291('0x38')](_0x4caa37[_0x1291('0x3c')]);_0x2142c7[_0x1291('0x39')]=_[_0x1291('0x3a')](_0x2142c7[_0x1291('0x3b')],_0x2142c7['query']);_0x1272c6[_0x1291('0x3d')]=_[_0x1291('0x3a')](_0x2142c7['model'],qs[_0x1291('0x3e')](_0x4caa37['query'][_0x1291('0x3e')]));_0x1272c6[_0x1291('0x3d')]=_0x1272c6[_0x1291('0x3d')]['length']?_0x1272c6[_0x1291('0x3d')]:_0x2142c7[_0x1291('0x3b')];if(_0x4caa37[_0x1291('0x3c')][_0x1291('0x49')]){_0x1272c6[_0x1291('0x4a')]=[{'all':!![]}];}_0x1272c6=_[_0x1291('0x48')]({},_0x1272c6,_0x4caa37[_0x1291('0x50')]);return db[_0x1291('0x34')][_0x1291('0x51')](_0x1272c6)[_0x1291('0x2c')](handleEntityNotFound(_0x383fff,null))[_0x1291('0x2c')](respondWithResult(_0x383fff,null))[_0x1291('0x4d')](handleError(_0x383fff,null));};exports['create']=function(_0x348d8d,_0x4139af){return db['VoiceQueueReport'][_0x1291('0x52')](_0x348d8d[_0x1291('0x53')],{})['then'](respondWithResult(_0x4139af,0xc9))[_0x1291('0x4d')](handleError(_0x4139af,null));};exports[_0x1291('0x2b')]=function(_0xfa768a,_0x58c349){if(_0xfa768a[_0x1291('0x53')]['id']){delete _0xfa768a[_0x1291('0x53')]['id'];}return db['VoiceQueueReport']['find']({'where':{'id':_0xfa768a[_0x1291('0x4f')]['id']}})[_0x1291('0x2c')](handleEntityNotFound(_0x58c349,null))[_0x1291('0x2c')](saveUpdates(_0xfa768a[_0x1291('0x53')],null))[_0x1291('0x2c')](respondWithResult(_0x58c349,null))[_0x1291('0x4d')](handleError(_0x58c349,null));};exports[_0x1291('0x2d')]=function(_0x2228ea,_0x2a9e5b){return db[_0x1291('0x34')]['find']({'where':{'id':_0x2228ea[_0x1291('0x4f')]['id']}})[_0x1291('0x2c')](handleEntityNotFound(_0x2a9e5b,null))['then'](removeEntity(_0x2a9e5b,null))[_0x1291('0x4d')](handleError(_0x2a9e5b,null));};exports['describe']=function(_0x3949dc,_0x9e33b){return db[_0x1291('0x34')]['describe']()[_0x1291('0x2c')](respondWithResult(_0x9e33b,null))['catch'](handleError(_0x9e33b,null));};exports[_0x1291('0x54')]=function(_0x451452,_0x47bd2e){var _0x298271={},_0x45f3e5={},_0xa179a={'count':0x0,'rows':[]};_0x45f3e5[_0x1291('0x3b')]=_[_0x1291('0x38')](db[_0x1291('0x34')][_0x1291('0x55')]);_0x45f3e5[_0x1291('0x3c')]=_[_0x1291('0x38')](_0x451452[_0x1291('0x3c')]);_0x45f3e5[_0x1291('0x39')]=_[_0x1291('0x3a')](_0x45f3e5[_0x1291('0x3b')],_0x45f3e5['query']);_0x298271['attributes']=_[_0x1291('0x3a')](_0x45f3e5['model'],qs['fields'](_0x451452[_0x1291('0x3c')][_0x1291('0x3e')]));_0x298271[_0x1291('0x3d')]=_0x298271[_0x1291('0x3d')][_0x1291('0x3f')]?_0x298271[_0x1291('0x3d')]:_0x45f3e5[_0x1291('0x3b')];if(!_0x451452['query'][_0x1291('0x40')]('nolimit')){_0x298271[_0x1291('0x24')]=qs[_0x1291('0x24')](_0x451452['query'][_0x1291('0x24')]);_0x298271[_0x1291('0x26')]=qs[_0x1291('0x26')](_0x451452[_0x1291('0x3c')]['offset']);}_0x298271[_0x1291('0x42')]=qs['sort'](_0x451452[_0x1291('0x3c')][_0x1291('0x43')]);_0x298271[_0x1291('0x46')]=qs[_0x1291('0x39')](_['pick'](_0x451452[_0x1291('0x3c')],_0x45f3e5['filters']));if(_0x451452[_0x1291('0x3c')][_0x1291('0x45')]){_0x298271[_0x1291('0x46')]=_[_0x1291('0x48')](_0x298271[_0x1291('0x46')],{'$or':_[_0x1291('0x37')](_0x298271['attributes'],function(_0x5f4974){var _0x433bd0={};_0x433bd0[_0x5f4974]={'$like':'%'+_0x451452[_0x1291('0x3c')][_0x1291('0x45')]+'%'};return _0x433bd0;})});}_0x298271=_[_0x1291('0x48')]({},_0x298271,_0x451452[_0x1291('0x50')]);var _0x4846cb={'where':_0x298271[_0x1291('0x46')]};return db[_0x1291('0x34')][_0x1291('0x25')](_0x4846cb)[_0x1291('0x2c')](function(_0x371fa3){_0xa179a[_0x1291('0x25')]=_0x371fa3;if(_0x451452['query']['includeAll']){_0x298271['include']=[{'all':!![]}];}return db['VoiceQueueReport'][_0x1291('0x4b')](_0x298271);})[_0x1291('0x2c')](function(_0x1a0e74){_0xa179a[_0x1291('0x4c')]=_0x1a0e74;return _0xa179a;})[_0x1291('0x2c')](respondWithFilteredResult(_0x47bd2e,_0x298271,_0x1291('0x54')))['catch'](handleError(_0x47bd2e,null,_0x1291('0x54')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index 0612f09..be6b4b3 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 _0x847d=['hasOwnProperty','hook','exports','events','../../mysqldb','VoiceQueueReport','update','remove','emit'];(function(_0x3aaef5,_0x16cdc8){var _0x4c0ed5=function(_0x4f7046){while(--_0x4f7046){_0x3aaef5['push'](_0x3aaef5['shift']());}};_0x4c0ed5(++_0x16cdc8);}(_0x847d,0x93));var _0xd847=function(_0x16771d,_0x224c60){_0x16771d=_0x16771d-0x0;var _0x386f11=_0x847d[_0x16771d];return _0x386f11;};'use strict';var EventEmitter=require(_0xd847('0x0'));var VoiceQueueReport=require(_0xd847('0x1'))['db'][_0xd847('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xd847('0x3'),'afterDestroy':_0xd847('0x4')};function emitEvent(_0x443f86){return function(_0x3f2f1b,_0x120f01,_0x596ccd){VoiceQueueReportEvents[_0xd847('0x5')](_0x443f86+':'+_0x3f2f1b['id'],_0x3f2f1b);VoiceQueueReportEvents[_0xd847('0x5')](_0x443f86,_0x3f2f1b);_0x596ccd(null);};}for(var e in events){if(events[_0xd847('0x6')](e)){var event=events[e];VoiceQueueReport[_0xd847('0x7')](e,emitEvent(event));}}module[_0xd847('0x8')]=VoiceQueueReportEvents; \ No newline at end of file +var _0x082e=['emit','hook','exports','../../mysqldb','VoiceQueueReport','setMaxListeners','save','update','remove'];(function(_0x16d3c7,_0x82a2c4){var _0x1f6edc=function(_0x3719a8){while(--_0x3719a8){_0x16d3c7['push'](_0x16d3c7['shift']());}};_0x1f6edc(++_0x82a2c4);}(_0x082e,0x1a1));var _0xe082=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x082e[_0x14add3];return _0x4a174f;};'use strict';var EventEmitter=require('events');var VoiceQueueReport=require(_0xe082('0x0'))['db'][_0xe082('0x1')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0xe082('0x2')](0x0);var events={'afterCreate':_0xe082('0x3'),'afterUpdate':_0xe082('0x4'),'afterDestroy':_0xe082('0x5')};function emitEvent(_0xa7402c){return function(_0x385342,_0x27b99e,_0x604975){VoiceQueueReportEvents[_0xe082('0x6')](_0xa7402c+':'+_0x385342['id'],_0x385342);VoiceQueueReportEvents[_0xe082('0x6')](_0xa7402c,_0x385342);_0x604975(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueueReport[_0xe082('0x7')](e,emitEvent(event));}}module[_0xe082('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 faf238d..b7ae240 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 _0x95eb=['VoiceQueueReport','uniqueid','calleridnum','lodash','util','moment','bluebird','path','../../config/environment','exports','define'];(function(_0x4c9191,_0xe10c76){var _0x593642=function(_0x11e43b){while(--_0x11e43b){_0x4c9191['push'](_0x4c9191['shift']());}};_0x593642(++_0xe10c76);}(_0x95eb,0x7c));var _0xb95e=function(_0x914fd8,_0x202308){_0x914fd8=_0x914fd8-0x0;var _0x4aa239=_0x95eb[_0x914fd8];return _0x4aa239;};'use strict';var _=require(_0xb95e('0x0'));var util=require(_0xb95e('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xb95e('0x2'));var BPromise=require(_0xb95e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb95e('0x4'));var rimraf=require('rimraf');var config=require(_0xb95e('0x5'));var attributes=require('./voiceQueueReport.attributes');module[_0xb95e('0x6')]=function(_0x199060,_0x475608){return _0x199060[_0xb95e('0x7')](_0xb95e('0x8'),attributes,{'tableName':'report_queue','paranoid':![],'indexes':[{'fields':[_0xb95e('0x9')]},{'fields':[_0xb95e('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc37b=['util','../../config/logger','moment','bluebird','rimraf','../../config/environment','./voiceQueueReport.attributes','define','VoiceQueueReport','report_queue','uniqueid','lodash'];(function(_0x4b621c,_0x122fa7){var _0x11719a=function(_0xcac626){while(--_0xcac626){_0x4b621c['push'](_0x4b621c['shift']());}};_0x11719a(++_0x122fa7);}(_0xc37b,0x15b));var _0xbc37=function(_0x98834f,_0x38aa2e){_0x98834f=_0x98834f-0x0;var _0x5974a4=_0xc37b[_0x98834f];return _0x5974a4;};'use strict';var _=require(_0xbc37('0x0'));var util=require(_0xbc37('0x1'));var logger=require(_0xbc37('0x2'))('api');var moment=require(_0xbc37('0x3'));var BPromise=require(_0xbc37('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xbc37('0x5'));var config=require(_0xbc37('0x6'));var attributes=require(_0xbc37('0x7'));module['exports']=function(_0x2f2fe4,_0x294950){return _0x2f2fe4[_0xbc37('0x8')](_0xbc37('0x9'),attributes,{'tableName':_0xbc37('0xa'),'paranoid':![],'indexes':[{'fields':[_0xbc37('0xb')]},{'fields':['calleridnum']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index 25bb6a1..573f78a 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 _0x9c13=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','request','then','info','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceQueueReport,\x20%s,\x20%s','message','result','catch','GetVoiceQueueReport','VoiceQueueReport','findAll','options','raw','where','attributes','limit','include','map','model','CreateVoiceQueueReport','body','update','UpdateVoiceQueueReport','lodash','util','moment','bluebird','ioredis'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x9c13,0x10f));var _0x39c1=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9c13[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0x39c1('0x0'));var util=require(_0x39c1('0x1'));var moment=require(_0x39c1('0x2'));var BPromise=require(_0x39c1('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x39c1('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x39c1('0x5'));var logger=require(_0x39c1('0x6'))(_0x39c1('0x7'));var config=require(_0x39c1('0x8'));var jayson=require(_0x39c1('0x9'));var client=jayson[_0x39c1('0xa')][_0x39c1('0xb')]({'port':0x232a});config[_0x39c1('0xc')]=_[_0x39c1('0xd')](config[_0x39c1('0xc')],{'host':_0x39c1('0xe'),'port':0x18eb});var socket=require(_0x39c1('0xf'))(new Redis(config[_0x39c1('0xc')]));require(_0x39c1('0x10'))[_0x39c1('0x11')](socket);function respondWithRpcPromise(_0x202236,_0xf3f628,_0x559c06){return new BPromise(function(_0x52651d,_0x575e6e){return client[_0x39c1('0x12')](_0x202236,_0x559c06)[_0x39c1('0x13')](function(_0x1372d1){logger[_0x39c1('0x14')]('VoiceQueueReport,\x20%s,\x20%s',_0xf3f628,_0x39c1('0x15'));logger[_0x39c1('0x16')](_0x39c1('0x17'),_0xf3f628,_0x39c1('0x15'),JSON[_0x39c1('0x18')](_0x1372d1));if(_0x1372d1[_0x39c1('0x19')]){if(_0x1372d1[_0x39c1('0x19')][_0x39c1('0x1a')]===0x1f4){logger[_0x39c1('0x19')](_0x39c1('0x1b'),_0xf3f628,_0x1372d1[_0x39c1('0x19')]['message']);return _0x575e6e(_0x1372d1[_0x39c1('0x19')][_0x39c1('0x1c')]);}logger[_0x39c1('0x19')]('VoiceQueueReport,\x20%s,\x20%s',_0xf3f628,_0x1372d1[_0x39c1('0x19')][_0x39c1('0x1c')]);return _0x52651d(_0x1372d1[_0x39c1('0x19')]['message']);}else{logger['info'](_0x39c1('0x1b'),_0xf3f628,_0x39c1('0x15'));_0x52651d(_0x1372d1[_0x39c1('0x1d')][_0x39c1('0x1c')]);}})[_0x39c1('0x1e')](function(_0x54c740){logger[_0x39c1('0x19')](_0x39c1('0x1b'),_0xf3f628,_0x54c740);_0x575e6e(_0x54c740);});});}exports[_0x39c1('0x1f')]=function(_0x527612){var _0x4ea4bc=this;return new Promise(function(_0xbb20ed,_0x5c60ba){return db[_0x39c1('0x20')][_0x39c1('0x21')]({'raw':_0x527612[_0x39c1('0x22')]?_0x527612['options'][_0x39c1('0x23')]===undefined?!![]:![]:!![],'where':_0x527612['options']?_0x527612[_0x39c1('0x22')][_0x39c1('0x24')]||null:null,'attributes':_0x527612[_0x39c1('0x22')]?_0x527612[_0x39c1('0x22')][_0x39c1('0x25')]||null:null,'limit':_0x527612[_0x39c1('0x22')]?_0x527612[_0x39c1('0x22')][_0x39c1('0x26')]||null:null,'include':_0x527612[_0x39c1('0x22')]?_0x527612[_0x39c1('0x22')][_0x39c1('0x27')]?_[_0x39c1('0x28')](_0x527612[_0x39c1('0x22')][_0x39c1('0x27')],function(_0x45a22b){return{'model':db[_0x45a22b['model']],'as':_0x45a22b['as'],'attributes':_0x45a22b['attributes'],'include':_0x45a22b['include']?_[_0x39c1('0x28')](_0x45a22b[_0x39c1('0x27')],function(_0x3c6100){return{'model':db[_0x3c6100['model']],'as':_0x3c6100['as'],'attributes':_0x3c6100[_0x39c1('0x25')],'include':_0x3c6100[_0x39c1('0x27')]?_[_0x39c1('0x28')](_0x3c6100[_0x39c1('0x27')],function(_0x1b65f){return{'model':db[_0x1b65f[_0x39c1('0x29')]],'as':_0x1b65f['as'],'attributes':_0x1b65f['attributes']};}):[]};}):[]};}):[]:[]})[_0x39c1('0x13')](function(_0x505e79){logger[_0x39c1('0x14')](_0x39c1('0x1f'),_0x527612);logger[_0x39c1('0x16')]('GetVoiceQueueReport',_0x527612,JSON[_0x39c1('0x18')](_0x505e79));_0xbb20ed(_0x505e79);})[_0x39c1('0x1e')](function(_0x27de2e){logger[_0x39c1('0x19')](_0x39c1('0x1f'),_0x27de2e[_0x39c1('0x1c')],_0x527612);_0x5c60ba(_0x4ea4bc[_0x39c1('0x19')](0x1f4,_0x27de2e[_0x39c1('0x1c')]));});});};exports[_0x39c1('0x2a')]=function(_0x1bf28){var _0x334b3e=this;return new Promise(function(_0x1737e0,_0x211ddd){return db[_0x39c1('0x20')]['create'](_0x1bf28[_0x39c1('0x2b')],{'raw':_0x1bf28[_0x39c1('0x22')]?_0x1bf28[_0x39c1('0x22')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x18a3e2){logger['info'](_0x39c1('0x2a'),_0x1bf28);logger['debug'](_0x39c1('0x2a'),_0x1bf28,JSON[_0x39c1('0x18')](_0x18a3e2));_0x1737e0(_0x18a3e2);})[_0x39c1('0x1e')](function(_0x1794a4){logger['error'](_0x39c1('0x2a'),_0x1794a4[_0x39c1('0x1c')],_0x1bf28);_0x211ddd(_0x334b3e['error'](0x1f4,_0x1794a4[_0x39c1('0x1c')]));});});};exports['UpdateVoiceQueueReport']=function(_0x5542ae){var _0x45f0f7=this;return new Promise(function(_0x4d3908,_0x10c723){return db[_0x39c1('0x20')][_0x39c1('0x2c')](_0x5542ae[_0x39c1('0x2b')],{'raw':_0x5542ae['options']?_0x5542ae['options'][_0x39c1('0x23')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5542ae['options']?_0x5542ae[_0x39c1('0x22')][_0x39c1('0x24')]||null:null,'attributes':_0x5542ae[_0x39c1('0x22')]?_0x5542ae[_0x39c1('0x22')][_0x39c1('0x25')]||null:null,'limit':_0x5542ae[_0x39c1('0x22')]?_0x5542ae[_0x39c1('0x22')]['limit']||null:null})[_0x39c1('0x13')](function(_0x31de3e){logger['info']('UpdateVoiceQueueReport',_0x5542ae);logger[_0x39c1('0x16')](_0x39c1('0x2d'),_0x5542ae,JSON[_0x39c1('0x18')](_0x31de3e));_0x4d3908(_0x31de3e);})[_0x39c1('0x1e')](function(_0x2f8526){logger[_0x39c1('0x19')](_0x39c1('0x2d'),_0x2f8526['message'],_0x5542ae);_0x10c723(_0x45f0f7[_0x39c1('0x19')](0x1f4,_0x2f8526[_0x39c1('0x1c')]));});});}; \ No newline at end of file +var _0x7905=['UpdateVoiceQueueReport','update','lodash','util','moment','bluebird','randomstring','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./voiceQueueReport.socket','register','request','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','error','message','catch','VoiceQueueReport','findAll','options','raw','where','limit','include','map','model','attributes','GetVoiceQueueReport','stringify','body','CreateVoiceQueueReport'];(function(_0x5483f8,_0x565060){var _0x32e7f0=function(_0x3c891c){while(--_0x3c891c){_0x5483f8['push'](_0x5483f8['shift']());}};_0x32e7f0(++_0x565060);}(_0x7905,0xf2));var _0x5790=function(_0x1a6f42,_0x5b921f){_0x1a6f42=_0x1a6f42-0x0;var _0x4afe1e=_0x7905[_0x1a6f42];return _0x4afe1e;};'use strict';var _=require(_0x5790('0x0'));var util=require(_0x5790('0x1'));var moment=require(_0x5790('0x2'));var BPromise=require(_0x5790('0x3'));var rs=require(_0x5790('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x5790('0x5'));var jayson=require(_0x5790('0x6'));var client=jayson[_0x5790('0x7')][_0x5790('0x8')]({'port':0x232a});config[_0x5790('0x9')]=_['defaults'](config[_0x5790('0x9')],{'host':_0x5790('0xa'),'port':0x18eb});var socket=require(_0x5790('0xb'))(new Redis(config['redis']));require(_0x5790('0xc'))[_0x5790('0xd')](socket);function respondWithRpcPromise(_0x4b0746,_0x93c17b,_0x5e347e){return new BPromise(function(_0x2f72e0,_0x44f6ea){return client[_0x5790('0xe')](_0x4b0746,_0x5e347e)[_0x5790('0xf')](function(_0xbd136a){logger[_0x5790('0x10')](_0x5790('0x11'),_0x93c17b,_0x5790('0x12'));logger[_0x5790('0x13')](_0x5790('0x14'),_0x93c17b,_0x5790('0x12'),JSON['stringify'](_0xbd136a));if(_0xbd136a[_0x5790('0x15')]){if(_0xbd136a[_0x5790('0x15')]['code']===0x1f4){logger[_0x5790('0x15')](_0x5790('0x11'),_0x93c17b,_0xbd136a[_0x5790('0x15')][_0x5790('0x16')]);return _0x44f6ea(_0xbd136a[_0x5790('0x15')]['message']);}logger[_0x5790('0x15')]('VoiceQueueReport,\x20%s,\x20%s',_0x93c17b,_0xbd136a[_0x5790('0x15')][_0x5790('0x16')]);return _0x2f72e0(_0xbd136a[_0x5790('0x15')][_0x5790('0x16')]);}else{logger[_0x5790('0x10')](_0x5790('0x11'),_0x93c17b,_0x5790('0x12'));_0x2f72e0(_0xbd136a['result'][_0x5790('0x16')]);}})[_0x5790('0x17')](function(_0x5c8551){logger[_0x5790('0x15')](_0x5790('0x11'),_0x93c17b,_0x5c8551);_0x44f6ea(_0x5c8551);});});}exports['GetVoiceQueueReport']=function(_0x5c1ffc){var _0x282cf2=this;return new Promise(function(_0x27aab7,_0x3904de){return db[_0x5790('0x18')][_0x5790('0x19')]({'raw':_0x5c1ffc[_0x5790('0x1a')]?_0x5c1ffc[_0x5790('0x1a')][_0x5790('0x1b')]===undefined?!![]:![]:!![],'where':_0x5c1ffc['options']?_0x5c1ffc['options'][_0x5790('0x1c')]||null:null,'attributes':_0x5c1ffc[_0x5790('0x1a')]?_0x5c1ffc['options']['attributes']||null:null,'limit':_0x5c1ffc[_0x5790('0x1a')]?_0x5c1ffc['options'][_0x5790('0x1d')]||null:null,'include':_0x5c1ffc[_0x5790('0x1a')]?_0x5c1ffc[_0x5790('0x1a')][_0x5790('0x1e')]?_[_0x5790('0x1f')](_0x5c1ffc[_0x5790('0x1a')][_0x5790('0x1e')],function(_0x13ee3d){return{'model':db[_0x13ee3d[_0x5790('0x20')]],'as':_0x13ee3d['as'],'attributes':_0x13ee3d[_0x5790('0x21')],'include':_0x13ee3d[_0x5790('0x1e')]?_[_0x5790('0x1f')](_0x13ee3d[_0x5790('0x1e')],function(_0x3f7de7){return{'model':db[_0x3f7de7[_0x5790('0x20')]],'as':_0x3f7de7['as'],'attributes':_0x3f7de7[_0x5790('0x21')],'include':_0x3f7de7['include']?_['map'](_0x3f7de7['include'],function(_0x2469d0){return{'model':db[_0x2469d0[_0x5790('0x20')]],'as':_0x2469d0['as'],'attributes':_0x2469d0['attributes']};}):[]};}):[]};}):[]:[]})[_0x5790('0xf')](function(_0x14ee19){logger[_0x5790('0x10')](_0x5790('0x22'),_0x5c1ffc);logger[_0x5790('0x13')](_0x5790('0x22'),_0x5c1ffc,JSON[_0x5790('0x23')](_0x14ee19));_0x27aab7(_0x14ee19);})[_0x5790('0x17')](function(_0x172a31){logger[_0x5790('0x15')](_0x5790('0x22'),_0x172a31[_0x5790('0x16')],_0x5c1ffc);_0x3904de(_0x282cf2[_0x5790('0x15')](0x1f4,_0x172a31[_0x5790('0x16')]));});});};exports['CreateVoiceQueueReport']=function(_0x5c9fd2){var _0x31943d=this;return new Promise(function(_0x14c3c6,_0x3bf40b){return db['VoiceQueueReport']['create'](_0x5c9fd2[_0x5790('0x24')],{'raw':_0x5c9fd2[_0x5790('0x1a')]?_0x5c9fd2[_0x5790('0x1a')][_0x5790('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0xf5e3ac){logger[_0x5790('0x10')](_0x5790('0x25'),_0x5c9fd2);logger[_0x5790('0x13')](_0x5790('0x25'),_0x5c9fd2,JSON[_0x5790('0x23')](_0xf5e3ac));_0x14c3c6(_0xf5e3ac);})[_0x5790('0x17')](function(_0x2b9735){logger[_0x5790('0x15')](_0x5790('0x25'),_0x2b9735['message'],_0x5c9fd2);_0x3bf40b(_0x31943d['error'](0x1f4,_0x2b9735['message']));});});};exports[_0x5790('0x26')]=function(_0x319db0){var _0x9701af=this;return new Promise(function(_0x37f802,_0x4f7922){return db[_0x5790('0x18')][_0x5790('0x27')](_0x319db0[_0x5790('0x24')],{'raw':_0x319db0[_0x5790('0x1a')]?_0x319db0[_0x5790('0x1a')][_0x5790('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x319db0['options']?_0x319db0[_0x5790('0x1a')]['where']||null:null,'attributes':_0x319db0[_0x5790('0x1a')]?_0x319db0[_0x5790('0x1a')]['attributes']||null:null,'limit':_0x319db0[_0x5790('0x1a')]?_0x319db0[_0x5790('0x1a')][_0x5790('0x1d')]||null:null})[_0x5790('0xf')](function(_0x35010d){logger['info'](_0x5790('0x26'),_0x319db0);logger[_0x5790('0x13')](_0x5790('0x26'),_0x319db0,JSON['stringify'](_0x35010d));_0x37f802(_0x35010d);})[_0x5790('0x17')](function(_0x3ed944){logger[_0x5790('0x15')](_0x5790('0x26'),_0x3ed944['message'],_0x319db0);_0x4f7922(_0x9701af['error'](0x1f4,_0x3ed944[_0x5790('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index 0d5a909..8ffcc4d 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 _0x5a52=['voiceQueueReport:','./voiceQueueReport.events','emit','removeListener','register','length'];(function(_0x572637,_0x216d95){var _0xb6748=function(_0x3eeb8c){while(--_0x3eeb8c){_0x572637['push'](_0x572637['shift']());}};_0xb6748(++_0x216d95);}(_0x5a52,0x18d));var _0x25a5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5a52[_0x3dd15e];return _0x231fd0;};'use strict';var VoiceQueueReportEvents=require(_0x25a5('0x0'));var events=['save','remove','update'];function createListener(_0x4427a1,_0x3d1573){return function(_0x2553ad){_0x3d1573[_0x25a5('0x1')](_0x4427a1,_0x2553ad);};}function removeListener(_0x2fc1db,_0x407636){return function(){VoiceQueueReportEvents[_0x25a5('0x2')](_0x2fc1db,_0x407636);};}exports[_0x25a5('0x3')]=function(_0x5db751){for(var _0x2c210a=0x0,_0x4d0639=events[_0x25a5('0x4')];_0x2c210a<_0x4d0639;_0x2c210a++){var _0x2d8920=events[_0x2c210a];var _0x31a0a=createListener(_0x25a5('0x5')+_0x2d8920,_0x5db751);VoiceQueueReportEvents['on'](_0x2d8920,_0x31a0a);}}; \ No newline at end of file +var _0x383d=['register','length','remove','update','emit','removeListener'];(function(_0x43d8fb,_0x3db3b4){var _0x10d700=function(_0x12364f){while(--_0x12364f){_0x43d8fb['push'](_0x43d8fb['shift']());}};_0x10d700(++_0x3db3b4);}(_0x383d,0x86));var _0xd383=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x383d[_0x14add3];return _0x4a174f;};'use strict';var VoiceQueueReportEvents=require('./voiceQueueReport.events');var events=['save',_0xd383('0x0'),_0xd383('0x1')];function createListener(_0x35486e,_0x559dd3){return function(_0x7554ef){_0x559dd3[_0xd383('0x2')](_0x35486e,_0x7554ef);};}function removeListener(_0x319f67,_0x3439dd){return function(){VoiceQueueReportEvents[_0xd383('0x3')](_0x319f67,_0x3439dd);};}exports[_0xd383('0x4')]=function(_0x5a0b1d){for(var _0xc64e9b=0x0,_0x30ba82=events[_0xd383('0x5')];_0xc64e9b<_0x30ba82;_0xc64e9b++){var _0x470d8d=events[_0xc64e9b];var _0xffa778=createListener('voiceQueueReport:'+_0x470d8d,_0x5a0b1d);VoiceQueueReportEvents['on'](_0x470d8d,_0xffa778);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index 83f3e75..e41da70 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 _0xa67b=['util','path','express','fs-extra','../../components/auth/service','../../config/environment','./voiceQueuesLog.controller','isAuthenticated','index','get','/:id','show','create','put','update','delete','destroy','multer'];(function(_0x266105,_0x196dce){var _0x5ec0d5=function(_0x2e4481){while(--_0x2e4481){_0x266105['push'](_0x266105['shift']());}};_0x5ec0d5(++_0x196dce);}(_0xa67b,0xc5));var _0xba67=function(_0x7b9a37,_0x21163){_0x7b9a37=_0x7b9a37-0x0;var _0x262da0=_0xa67b[_0x7b9a37];return _0x262da0;};'use strict';var multer=require(_0xba67('0x0'));var util=require(_0xba67('0x1'));var path=require(_0xba67('0x2'));var timeout=require('connect-timeout');var express=require(_0xba67('0x3'));var router=express['Router']();var fs_extra=require(_0xba67('0x4'));var auth=require(_0xba67('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xba67('0x6'));var controller=require(_0xba67('0x7'));router['get']('/',auth[_0xba67('0x8')](),controller[_0xba67('0x9')]);router[_0xba67('0xa')](_0xba67('0xb'),auth[_0xba67('0x8')](),controller[_0xba67('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0xba67('0xd')]);router[_0xba67('0xe')](_0xba67('0xb'),auth['isAuthenticated'](),controller[_0xba67('0xf')]);router[_0xba67('0x10')](_0xba67('0xb'),auth[_0xba67('0x8')](),controller[_0xba67('0x11')]);module['exports']=router; \ No newline at end of file +var _0x0ed3=['exports','multer','util','path','express','Router','../../components/auth/service','../../config/environment','./voiceQueuesLog.controller','get','isAuthenticated','index','/:id','create','put','update','delete','destroy'];(function(_0x1aba44,_0xe368cf){var _0x3179fc=function(_0x515055){while(--_0x515055){_0x1aba44['push'](_0x1aba44['shift']());}};_0x3179fc(++_0xe368cf);}(_0x0ed3,0x91));var _0x30ed=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x0ed3[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x30ed('0x0'));var util=require(_0x30ed('0x1'));var path=require(_0x30ed('0x2'));var timeout=require('connect-timeout');var express=require(_0x30ed('0x3'));var router=express[_0x30ed('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x30ed('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x30ed('0x6'));var controller=require(_0x30ed('0x7'));router[_0x30ed('0x8')]('/',auth[_0x30ed('0x9')](),controller[_0x30ed('0xa')]);router[_0x30ed('0x8')](_0x30ed('0xb'),auth[_0x30ed('0x9')](),controller['show']);router['post']('/',auth[_0x30ed('0x9')](),controller[_0x30ed('0xc')]);router[_0x30ed('0xd')](_0x30ed('0xb'),auth['isAuthenticated'](),controller[_0x30ed('0xe')]);router[_0x30ed('0xf')](_0x30ed('0xb'),auth['isAuthenticated'](),controller[_0x30ed('0x10')]);module[_0x30ed('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index 4218381..6916373 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 _0xab9b=['moment','exports','STRING','DATE','literal'];(function(_0x4883cb,_0x3df63c){var _0x33aad7=function(_0x2e901e){while(--_0x2e901e){_0x4883cb['push'](_0x4883cb['shift']());}};_0x33aad7(++_0x3df63c);}(_0xab9b,0x1b3));var _0xbab9=function(_0x3e8f4d,_0x2973ed){_0x3e8f4d=_0x3e8f4d-0x0;var _0x590a2e=_0xab9b[_0x3e8f4d];return _0x590a2e;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xbab9('0x0'));module[_0xbab9('0x1')]={'time':{'type':Sequelize['STRING']},'callid':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0xbab9('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0xbab9('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0xbab9('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0xbab9('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0xbab9('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xbab9('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0xbab9('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xbab9('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0xbab9('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xbab9('0x3')],'allowNull':![],'defaultValue':Sequelize[_0xbab9('0x4')]('CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP')}}; \ No newline at end of file +var _0x9a62=['CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','STRING','DATE','literal'];(function(_0x322246,_0x21d668){var _0x3b29f4=function(_0x3cdf8a){while(--_0x3cdf8a){_0x322246['push'](_0x322246['shift']());}};_0x3b29f4(++_0x21d668);}(_0x9a62,0x1c1));var _0x29a6=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x9a62[_0x40a045];return _0x1a687c;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module['exports']={'time':{'type':Sequelize[_0x29a6('0x0')]},'callid':{'type':Sequelize[_0x29a6('0x0')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x29a6('0x0')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x29a6('0x0')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x29a6('0x0')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x29a6('0x0')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x29a6('0x1')],'allowNull':![],'defaultValue':Sequelize[_0x29a6('0x2')](_0x29a6('0x3'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index 2be9bbe..216a160 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 _0x9e17=['status','json','offset','undefined','count','limit','set','Content-Range','reject','update','then','destroy','stack','name','send','map','VoiceQueuesLog','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','merge','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus'];(function(_0x1b3a5c,_0x2f9d5f){var _0x2ae8cb=function(_0x549ab8){while(--_0x549ab8){_0x1b3a5c['push'](_0x1b3a5c['shift']());}};_0x2ae8cb(++_0x2f9d5f);}(_0x9e17,0x7b));var _0x79e1=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0x9e17[_0x47b58b];return _0x46bebe;};'use strict';var emlformat=require(_0x79e1('0x0'));var rimraf=require(_0x79e1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x79e1('0x2'));var rp=require(_0x79e1('0x3'));var moment=require(_0x79e1('0x4'));var BPromise=require(_0x79e1('0x5'));var Mustache=require(_0x79e1('0x6'));var util=require('util');var path=require(_0x79e1('0x7'));var sox=require(_0x79e1('0x8'));var csv=require('to-csv');var ejs=require(_0x79e1('0x9'));var fs=require('fs');var fs_extra=require(_0x79e1('0xa'));var _=require(_0x79e1('0xb'));var squel=require(_0x79e1('0xc'));var crypto=require(_0x79e1('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x79e1('0xe'));var toCsv=require('to-csv');var querystring=require(_0x79e1('0xf'));var Papa=require(_0x79e1('0x10'));var Redis=require(_0x79e1('0x11'));var authService=require(_0x79e1('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x79e1('0x13'));var hardwareService=require(_0x79e1('0x14'));var logger=require(_0x79e1('0x15'))(_0x79e1('0x16'));var utils=require(_0x79e1('0x17'));var config=require(_0x79e1('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x79e1('0x19'))['db'];function respondWithStatusCode(_0x109928,_0x20b01f){_0x20b01f=_0x20b01f||0xcc;return function(_0x54a4bb){if(_0x54a4bb){return _0x109928[_0x79e1('0x1a')](_0x20b01f);}return _0x109928[_0x79e1('0x1b')](_0x20b01f)['end']();};}function respondWithResult(_0x174ba2,_0x5e501){_0x5e501=_0x5e501||0xc8;return function(_0x38c99d){if(_0x38c99d){return _0x174ba2['status'](_0x5e501)[_0x79e1('0x1c')](_0x38c99d);}};}function respondWithFilteredResult(_0x2610f2,_0x19165d){return function(_0x228199){if(_0x228199){var _0x1a928d=typeof _0x19165d[_0x79e1('0x1d')]===_0x79e1('0x1e')&&typeof _0x19165d['limit']===_0x79e1('0x1e');var _0x3912a6=_0x228199[_0x79e1('0x1f')];var _0x25dc4a=_0x1a928d?0x0:_0x19165d[_0x79e1('0x1d')];var _0x605195=_0x1a928d?_0x228199[_0x79e1('0x1f')]:_0x19165d[_0x79e1('0x1d')]+_0x19165d[_0x79e1('0x20')];var _0x4d7262;if(_0x605195>=_0x3912a6){_0x605195=_0x3912a6;_0x4d7262=0xc8;}else{_0x4d7262=0xce;}_0x2610f2[_0x79e1('0x1b')](_0x4d7262);return _0x2610f2[_0x79e1('0x21')](_0x79e1('0x22'),_0x25dc4a+'-'+_0x605195+'/'+_0x3912a6)[_0x79e1('0x1c')](_0x228199);}return null;};}function patchUpdates(_0x29ce1d){return function(_0x4647a0){try{jsonpatch['apply'](_0x4647a0,_0x29ce1d,!![]);}catch(_0x2c17cb){return BPromise[_0x79e1('0x23')](_0x2c17cb);}return _0x4647a0['save']();};}function saveUpdates(_0x429dc3,_0x1341fb){return function(_0x1ae7e2){if(_0x1ae7e2){return _0x1ae7e2[_0x79e1('0x24')](_0x429dc3)[_0x79e1('0x25')](function(_0x381a77){return _0x381a77;});}return null;};}function removeEntity(_0x4a4d27,_0x542c9b){return function(_0x4cea07){if(_0x4cea07){return _0x4cea07[_0x79e1('0x26')]()[_0x79e1('0x25')](function(){_0x4a4d27[_0x79e1('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x48e9bf,_0x16cf54){return function(_0x5dea7d){if(!_0x5dea7d){_0x48e9bf[_0x79e1('0x1a')](0x194);}return _0x5dea7d;};}function handleError(_0x550192,_0x5383b5){_0x5383b5=_0x5383b5||0x1f4;return function(_0x5f196c){logger['error'](_0x5f196c[_0x79e1('0x27')]);if(_0x5f196c[_0x79e1('0x28')]){delete _0x5f196c[_0x79e1('0x28')];}_0x550192['status'](_0x5383b5)[_0x79e1('0x29')](_0x5f196c);};}exports['index']=function(_0x4f6e62,_0x2d3be2){var _0x1b416e={},_0x404648={},_0xba1a0e={'count':0x0,'rows':[]};var _0x5550ef=_[_0x79e1('0x2a')](db[_0x79e1('0x2b')][_0x79e1('0x2c')],function(_0x207dd7){return{'name':_0x207dd7[_0x79e1('0x2d')],'type':_0x207dd7[_0x79e1('0x2e')][_0x79e1('0x2f')]};});_0x404648['model']=_[_0x79e1('0x2a')](_0x5550ef,_0x79e1('0x28'));_0x404648[_0x79e1('0x30')]=_[_0x79e1('0x31')](_0x4f6e62['query']);_0x404648[_0x79e1('0x32')]=_['intersection'](_0x404648[_0x79e1('0x33')],_0x404648[_0x79e1('0x30')]);_0x1b416e[_0x79e1('0x34')]=_[_0x79e1('0x35')](_0x404648[_0x79e1('0x33')],qs[_0x79e1('0x36')](_0x4f6e62[_0x79e1('0x30')][_0x79e1('0x36')]));_0x1b416e['attributes']=_0x1b416e[_0x79e1('0x34')][_0x79e1('0x37')]?_0x1b416e[_0x79e1('0x34')]:_0x404648[_0x79e1('0x33')];if(!_0x4f6e62[_0x79e1('0x30')][_0x79e1('0x38')](_0x79e1('0x39'))){_0x1b416e[_0x79e1('0x20')]=qs['limit'](_0x4f6e62[_0x79e1('0x30')][_0x79e1('0x20')]);_0x1b416e[_0x79e1('0x1d')]=qs[_0x79e1('0x1d')](_0x4f6e62[_0x79e1('0x30')][_0x79e1('0x1d')]);}_0x1b416e[_0x79e1('0x3a')]=qs['sort'](_0x4f6e62['query'][_0x79e1('0x3b')]);_0x1b416e[_0x79e1('0x3c')]=qs[_0x79e1('0x32')](_[_0x79e1('0x3d')](_0x4f6e62['query'],_0x404648[_0x79e1('0x32')]),_0x5550ef);if(_0x4f6e62[_0x79e1('0x30')]['filter']){_0x1b416e[_0x79e1('0x3c')]=_['merge'](_0x1b416e[_0x79e1('0x3c')],{'$or':_[_0x79e1('0x2a')](_0x5550ef,function(_0x715139){if(_0x715139[_0x79e1('0x2e')]!==_0x79e1('0x3e')){var _0x4dea25={};_0x4dea25[_0x715139[_0x79e1('0x28')]]={'$like':'%'+_0x4f6e62[_0x79e1('0x30')]['filter']+'%'};return _0x4dea25;}})});}_0x1b416e=_['merge']({},_0x1b416e,_0x4f6e62[_0x79e1('0x3f')]);var _0x16d451={'where':_0x1b416e[_0x79e1('0x3c')]};return db['VoiceQueuesLog']['count'](_0x16d451)[_0x79e1('0x25')](function(_0x4aad4e){_0xba1a0e['count']=_0x4aad4e;if(_0x4f6e62[_0x79e1('0x30')][_0x79e1('0x40')]){_0x1b416e[_0x79e1('0x41')]=[{'all':!![]}];}return db[_0x79e1('0x2b')][_0x79e1('0x42')](_0x1b416e);})[_0x79e1('0x25')](function(_0x5c317e){_0xba1a0e[_0x79e1('0x43')]=_0x5c317e;return _0xba1a0e;})[_0x79e1('0x25')](respondWithFilteredResult(_0x2d3be2,_0x1b416e))[_0x79e1('0x44')](handleError(_0x2d3be2,null));};exports[_0x79e1('0x45')]=function(_0x4d5534,_0x1bf710){var _0x1326ee={'raw':!![],'where':{'id':_0x4d5534[_0x79e1('0x46')]['id']}},_0x50f9c7={};_0x50f9c7[_0x79e1('0x33')]=_['keys'](db[_0x79e1('0x2b')][_0x79e1('0x2c')]);_0x50f9c7[_0x79e1('0x30')]=_[_0x79e1('0x31')](_0x4d5534[_0x79e1('0x30')]);_0x50f9c7['filters']=_['intersection'](_0x50f9c7[_0x79e1('0x33')],_0x50f9c7[_0x79e1('0x30')]);_0x1326ee[_0x79e1('0x34')]=_[_0x79e1('0x35')](_0x50f9c7[_0x79e1('0x33')],qs['fields'](_0x4d5534['query'][_0x79e1('0x36')]));_0x1326ee['attributes']=_0x1326ee[_0x79e1('0x34')][_0x79e1('0x37')]?_0x1326ee['attributes']:_0x50f9c7['model'];if(_0x4d5534[_0x79e1('0x30')][_0x79e1('0x40')]){_0x1326ee[_0x79e1('0x41')]=[{'all':!![]}];}_0x1326ee=_[_0x79e1('0x47')]({},_0x1326ee,_0x4d5534['options']);return db[_0x79e1('0x2b')][_0x79e1('0x48')](_0x1326ee)['then'](handleEntityNotFound(_0x1bf710,null))[_0x79e1('0x25')](respondWithResult(_0x1bf710,null))['catch'](handleError(_0x1bf710,null));};exports[_0x79e1('0x49')]=function(_0x22c6fa,_0x1ca997){return db[_0x79e1('0x2b')][_0x79e1('0x49')](_0x22c6fa[_0x79e1('0x4a')],{})[_0x79e1('0x25')](respondWithResult(_0x1ca997,0xc9))[_0x79e1('0x44')](handleError(_0x1ca997,null));};exports[_0x79e1('0x24')]=function(_0x14c069,_0x1825fe){if(_0x14c069[_0x79e1('0x4a')]['id']){delete _0x14c069['body']['id'];}return db['VoiceQueuesLog'][_0x79e1('0x48')]({'where':{'id':_0x14c069[_0x79e1('0x46')]['id']}})[_0x79e1('0x25')](handleEntityNotFound(_0x1825fe,null))[_0x79e1('0x25')](saveUpdates(_0x14c069['body'],null))[_0x79e1('0x25')](respondWithResult(_0x1825fe,null))[_0x79e1('0x44')](handleError(_0x1825fe,null));};exports['destroy']=function(_0x203b0b,_0xbd7e0e){return db[_0x79e1('0x2b')][_0x79e1('0x48')]({'where':{'id':_0x203b0b['params']['id']}})[_0x79e1('0x25')](handleEntityNotFound(_0xbd7e0e,null))[_0x79e1('0x25')](removeEntity(_0xbd7e0e,null))['catch'](handleError(_0xbd7e0e,null));}; \ No newline at end of file +var _0x4ac3=['status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','stack','name','send','VoiceQueuesLog','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus'];(function(_0x1c3633,_0x250f92){var _0x50935a=function(_0x208aeb){while(--_0x208aeb){_0x1c3633['push'](_0x1c3633['shift']());}};_0x50935a(++_0x250f92);}(_0x4ac3,0x18d));var _0x34ac=function(_0x205a87,_0x4c3854){_0x205a87=_0x205a87-0x0;var _0x2107e8=_0x4ac3[_0x205a87];return _0x2107e8;};'use strict';var emlformat=require(_0x34ac('0x0'));var rimraf=require(_0x34ac('0x1'));var zipdir=require(_0x34ac('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x34ac('0x3'));var moment=require(_0x34ac('0x4'));var BPromise=require(_0x34ac('0x5'));var Mustache=require(_0x34ac('0x6'));var util=require(_0x34ac('0x7'));var path=require(_0x34ac('0x8'));var sox=require(_0x34ac('0x9'));var csv=require(_0x34ac('0xa'));var ejs=require(_0x34ac('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x34ac('0xc'));var squel=require(_0x34ac('0xd'));var crypto=require(_0x34ac('0xe'));var jsforce=require(_0x34ac('0xf'));var deskjs=require(_0x34ac('0x10'));var toCsv=require(_0x34ac('0xa'));var querystring=require(_0x34ac('0x11'));var Papa=require(_0x34ac('0x12'));var Redis=require(_0x34ac('0x13'));var authService=require(_0x34ac('0x14'));var qs=require(_0x34ac('0x15'));var as=require(_0x34ac('0x16'));var hardwareService=require(_0x34ac('0x17'));var logger=require(_0x34ac('0x18'))(_0x34ac('0x19'));var utils=require('../../config/utils');var config=require(_0x34ac('0x1a'));var licenseUtil=require(_0x34ac('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3a6552,_0xfd8587){_0xfd8587=_0xfd8587||0xcc;return function(_0x1c580e){if(_0x1c580e){return _0x3a6552[_0x34ac('0x1c')](_0xfd8587);}return _0x3a6552[_0x34ac('0x1d')](_0xfd8587)[_0x34ac('0x1e')]();};}function respondWithResult(_0x470e0a,_0x36ff0f){_0x36ff0f=_0x36ff0f||0xc8;return function(_0x43a58d){if(_0x43a58d){return _0x470e0a['status'](_0x36ff0f)[_0x34ac('0x1f')](_0x43a58d);}};}function respondWithFilteredResult(_0x3e3376,_0x28920c){return function(_0x3b746c){if(_0x3b746c){var _0x5be90d=typeof _0x28920c[_0x34ac('0x20')]===_0x34ac('0x21')&&typeof _0x28920c[_0x34ac('0x22')]===_0x34ac('0x21');var _0x6f9ea2=_0x3b746c[_0x34ac('0x23')];var _0x15992e=_0x5be90d?0x0:_0x28920c[_0x34ac('0x20')];var _0x11bfa8=_0x5be90d?_0x3b746c[_0x34ac('0x23')]:_0x28920c['offset']+_0x28920c[_0x34ac('0x22')];var _0x1f9d18;if(_0x11bfa8>=_0x6f9ea2){_0x11bfa8=_0x6f9ea2;_0x1f9d18=0xc8;}else{_0x1f9d18=0xce;}_0x3e3376[_0x34ac('0x1d')](_0x1f9d18);return _0x3e3376['set'](_0x34ac('0x24'),_0x15992e+'-'+_0x11bfa8+'/'+_0x6f9ea2)[_0x34ac('0x1f')](_0x3b746c);}return null;};}function patchUpdates(_0x37e731){return function(_0x64e8bd){try{jsonpatch[_0x34ac('0x25')](_0x64e8bd,_0x37e731,!![]);}catch(_0x821d37){return BPromise[_0x34ac('0x26')](_0x821d37);}return _0x64e8bd['save']();};}function saveUpdates(_0x114cc3,_0x5cc5c5){return function(_0x102f43){if(_0x102f43){return _0x102f43[_0x34ac('0x27')](_0x114cc3)['then'](function(_0x354dcd){return _0x354dcd;});}return null;};}function removeEntity(_0x56d577,_0x180e14){return function(_0x1928c5){if(_0x1928c5){return _0x1928c5['destroy']()[_0x34ac('0x28')](function(){_0x56d577['status'](0xcc)[_0x34ac('0x1e')]();});}};}function handleEntityNotFound(_0x8c0de5,_0x134682){return function(_0x4996f5){if(!_0x4996f5){_0x8c0de5[_0x34ac('0x1c')](0x194);}return _0x4996f5;};}function handleError(_0x4b5a58,_0x3eea18){_0x3eea18=_0x3eea18||0x1f4;return function(_0x586bb6){logger['error'](_0x586bb6[_0x34ac('0x29')]);if(_0x586bb6[_0x34ac('0x2a')]){delete _0x586bb6[_0x34ac('0x2a')];}_0x4b5a58['status'](_0x3eea18)[_0x34ac('0x2b')](_0x586bb6);};}exports['index']=function(_0x5004d0,_0x17f2f2){var _0x59ab82={},_0x450d8e={},_0x4e1c34={'count':0x0,'rows':[]};var _0x491676=_['map'](db[_0x34ac('0x2c')]['rawAttributes'],function(_0x265605){return{'name':_0x265605['fieldName'],'type':_0x265605[_0x34ac('0x2d')][_0x34ac('0x2e')]};});_0x450d8e[_0x34ac('0x2f')]=_[_0x34ac('0x30')](_0x491676,_0x34ac('0x2a'));_0x450d8e['query']=_[_0x34ac('0x31')](_0x5004d0[_0x34ac('0x32')]);_0x450d8e[_0x34ac('0x33')]=_[_0x34ac('0x34')](_0x450d8e[_0x34ac('0x2f')],_0x450d8e['query']);_0x59ab82[_0x34ac('0x35')]=_[_0x34ac('0x34')](_0x450d8e['model'],qs['fields'](_0x5004d0[_0x34ac('0x32')][_0x34ac('0x36')]));_0x59ab82['attributes']=_0x59ab82[_0x34ac('0x35')][_0x34ac('0x37')]?_0x59ab82[_0x34ac('0x35')]:_0x450d8e[_0x34ac('0x2f')];if(!_0x5004d0['query'][_0x34ac('0x38')]('nolimit')){_0x59ab82[_0x34ac('0x22')]=qs[_0x34ac('0x22')](_0x5004d0[_0x34ac('0x32')][_0x34ac('0x22')]);_0x59ab82[_0x34ac('0x20')]=qs['offset'](_0x5004d0[_0x34ac('0x32')][_0x34ac('0x20')]);}_0x59ab82['order']=qs['sort'](_0x5004d0['query']['sort']);_0x59ab82['where']=qs['filters'](_['pick'](_0x5004d0[_0x34ac('0x32')],_0x450d8e[_0x34ac('0x33')]),_0x491676);if(_0x5004d0['query'][_0x34ac('0x39')]){_0x59ab82[_0x34ac('0x3a')]=_['merge'](_0x59ab82['where'],{'$or':_[_0x34ac('0x30')](_0x491676,function(_0x4f872d){if(_0x4f872d[_0x34ac('0x2d')]!==_0x34ac('0x3b')){var _0x4b0690={};_0x4b0690[_0x4f872d[_0x34ac('0x2a')]]={'$like':'%'+_0x5004d0['query'][_0x34ac('0x39')]+'%'};return _0x4b0690;}})});}_0x59ab82=_[_0x34ac('0x3c')]({},_0x59ab82,_0x5004d0[_0x34ac('0x3d')]);var _0x7a32b7={'where':_0x59ab82[_0x34ac('0x3a')]};return db[_0x34ac('0x2c')][_0x34ac('0x23')](_0x7a32b7)[_0x34ac('0x28')](function(_0x1b51fc){_0x4e1c34['count']=_0x1b51fc;if(_0x5004d0[_0x34ac('0x32')][_0x34ac('0x3e')]){_0x59ab82[_0x34ac('0x3f')]=[{'all':!![]}];}return db[_0x34ac('0x2c')][_0x34ac('0x40')](_0x59ab82);})['then'](function(_0x1a386f){_0x4e1c34['rows']=_0x1a386f;return _0x4e1c34;})['then'](respondWithFilteredResult(_0x17f2f2,_0x59ab82))[_0x34ac('0x41')](handleError(_0x17f2f2,null));};exports[_0x34ac('0x42')]=function(_0x2fa200,_0x53a8f5){var _0x31024c={'raw':!![],'where':{'id':_0x2fa200[_0x34ac('0x43')]['id']}},_0x450458={};_0x450458[_0x34ac('0x2f')]=_[_0x34ac('0x31')](db[_0x34ac('0x2c')]['rawAttributes']);_0x450458[_0x34ac('0x32')]=_[_0x34ac('0x31')](_0x2fa200['query']);_0x450458[_0x34ac('0x33')]=_[_0x34ac('0x34')](_0x450458[_0x34ac('0x2f')],_0x450458['query']);_0x31024c['attributes']=_['intersection'](_0x450458[_0x34ac('0x2f')],qs[_0x34ac('0x36')](_0x2fa200[_0x34ac('0x32')][_0x34ac('0x36')]));_0x31024c[_0x34ac('0x35')]=_0x31024c['attributes'][_0x34ac('0x37')]?_0x31024c['attributes']:_0x450458[_0x34ac('0x2f')];if(_0x2fa200[_0x34ac('0x32')]['includeAll']){_0x31024c[_0x34ac('0x3f')]=[{'all':!![]}];}_0x31024c=_[_0x34ac('0x3c')]({},_0x31024c,_0x2fa200['options']);return db[_0x34ac('0x2c')][_0x34ac('0x44')](_0x31024c)[_0x34ac('0x28')](handleEntityNotFound(_0x53a8f5,null))[_0x34ac('0x28')](respondWithResult(_0x53a8f5,null))[_0x34ac('0x41')](handleError(_0x53a8f5,null));};exports[_0x34ac('0x45')]=function(_0x123242,_0x1dec99){return db['VoiceQueuesLog'][_0x34ac('0x45')](_0x123242[_0x34ac('0x46')],{})[_0x34ac('0x28')](respondWithResult(_0x1dec99,0xc9))['catch'](handleError(_0x1dec99,null));};exports['update']=function(_0xa2b305,_0x3e1721){if(_0xa2b305['body']['id']){delete _0xa2b305[_0x34ac('0x46')]['id'];}return db[_0x34ac('0x2c')][_0x34ac('0x44')]({'where':{'id':_0xa2b305[_0x34ac('0x43')]['id']}})[_0x34ac('0x28')](handleEntityNotFound(_0x3e1721,null))['then'](saveUpdates(_0xa2b305['body'],null))['then'](respondWithResult(_0x3e1721,null))[_0x34ac('0x41')](handleError(_0x3e1721,null));};exports['destroy']=function(_0x36798d,_0x1917d7){return db[_0x34ac('0x2c')][_0x34ac('0x44')]({'where':{'id':_0x36798d[_0x34ac('0x43')]['id']}})[_0x34ac('0x28')](handleEntityNotFound(_0x1917d7,null))[_0x34ac('0x28')](removeEntity(_0x1917d7,null))['catch'](handleError(_0x1917d7,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index 7004b23..f6d9e60 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 _0x92e8=['rimraf','../../config/environment','./voiceQueuesLog.attributes','define','voice_queues_log','event','dtm','lodash','api','bluebird','request-promise','path'];(function(_0xba2543,_0x43bbdc){var _0x33a874=function(_0x1d85b6){while(--_0x1d85b6){_0xba2543['push'](_0xba2543['shift']());}};_0x33a874(++_0x43bbdc);}(_0x92e8,0x7f));var _0x892e=function(_0x559a80,_0x3d193d){_0x559a80=_0x559a80-0x0;var _0x42f555=_0x92e8[_0x559a80];return _0x42f555;};'use strict';var _=require(_0x892e('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x892e('0x1'));var moment=require('moment');var BPromise=require(_0x892e('0x2'));var rp=require(_0x892e('0x3'));var fs=require('fs');var path=require(_0x892e('0x4'));var rimraf=require(_0x892e('0x5'));var config=require(_0x892e('0x6'));var attributes=require(_0x892e('0x7'));module['exports']=function(_0x3b557d,_0x47adfa){return _0x3b557d[_0x892e('0x8')]('VoiceQueuesLog',attributes,{'tableName':_0x892e('0x9'),'paranoid':![],'indexes':[{'name':'event_dtm','fields':[_0x892e('0xa'),_0x892e('0xb')]}],'timestamps':![]});}; \ No newline at end of file +var _0xecfd=['voice_queues_log','event','dtm','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./voiceQueuesLog.attributes','exports','define'];(function(_0x3c4782,_0xedb792){var _0x14abd6=function(_0x290f8b){while(--_0x290f8b){_0x3c4782['push'](_0x3c4782['shift']());}};_0x14abd6(++_0xedb792);}(_0xecfd,0x6c));var _0xdecf=function(_0x2e10bd,_0x5ece63){_0x2e10bd=_0x2e10bd-0x0;var _0x441b4c=_0xecfd[_0x2e10bd];return _0x441b4c;};'use strict';var _=require(_0xdecf('0x0'));var util=require(_0xdecf('0x1'));var logger=require(_0xdecf('0x2'))(_0xdecf('0x3'));var moment=require(_0xdecf('0x4'));var BPromise=require(_0xdecf('0x5'));var rp=require(_0xdecf('0x6'));var fs=require('fs');var path=require(_0xdecf('0x7'));var rimraf=require(_0xdecf('0x8'));var config=require('../../config/environment');var attributes=require(_0xdecf('0x9'));module[_0xdecf('0xa')]=function(_0x1ac946,_0x572caf){return _0x1ac946[_0xdecf('0xb')]('VoiceQueuesLog',attributes,{'tableName':_0xdecf('0xc'),'paranoid':![],'indexes':[{'name':'event_dtm','fields':[_0xdecf('0xd'),_0xdecf('0xe')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index c4dfc86..fe400d8 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 _0x5044=['VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceQueuesLog,\x20%s,\x20%s','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug'];(function(_0x1844a5,_0x57212e){var _0x59621e=function(_0x51f95f){while(--_0x51f95f){_0x1844a5['push'](_0x1844a5['shift']());}};_0x59621e(++_0x57212e);}(_0x5044,0xc8));var _0x4504=function(_0xf40a8a,_0x4474b2){_0xf40a8a=_0xf40a8a-0x0;var _0x13f1c4=_0x5044[_0xf40a8a];return _0x13f1c4;};'use strict';var _=require('lodash');var util=require(_0x4504('0x0'));var moment=require('moment');var BPromise=require(_0x4504('0x1'));var rs=require(_0x4504('0x2'));var fs=require('fs');var Redis=require(_0x4504('0x3'));var db=require(_0x4504('0x4'))['db'];var utils=require(_0x4504('0x5'));var logger=require(_0x4504('0x6'))(_0x4504('0x7'));var config=require(_0x4504('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x4504('0x9')][_0x4504('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x282816,_0x6e2dbb,_0x3df37b){return new BPromise(function(_0xbce7c4,_0x2cd45a){return client[_0x4504('0xb')](_0x282816,_0x3df37b)[_0x4504('0xc')](function(_0x56961c){logger[_0x4504('0xd')]('VoiceQueuesLog,\x20%s,\x20%s',_0x6e2dbb,_0x4504('0xe'));logger[_0x4504('0xf')](_0x4504('0x10'),_0x6e2dbb,_0x4504('0xe'),JSON[_0x4504('0x11')](_0x56961c));if(_0x56961c[_0x4504('0x12')]){if(_0x56961c[_0x4504('0x12')][_0x4504('0x13')]===0x1f4){logger[_0x4504('0x12')](_0x4504('0x14'),_0x6e2dbb,_0x56961c[_0x4504('0x12')][_0x4504('0x15')]);return _0x2cd45a(_0x56961c[_0x4504('0x12')]['message']);}logger[_0x4504('0x12')](_0x4504('0x14'),_0x6e2dbb,_0x56961c['error'][_0x4504('0x15')]);return _0xbce7c4(_0x56961c[_0x4504('0x12')][_0x4504('0x15')]);}else{logger[_0x4504('0xd')]('VoiceQueuesLog,\x20%s,\x20%s',_0x6e2dbb,'request\x20sent');_0xbce7c4(_0x56961c[_0x4504('0x16')]['message']);}})[_0x4504('0x17')](function(_0x5ede87){logger[_0x4504('0x12')](_0x4504('0x14'),_0x6e2dbb,_0x5ede87);_0x2cd45a(_0x5ede87);});});} \ No newline at end of file +var _0x3d76=['request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','error','code','VoiceQueuesLog,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request'];(function(_0x1da527,_0x2dc953){var _0x40fc7c=function(_0x9949f5){while(--_0x9949f5){_0x1da527['push'](_0x1da527['shift']());}};_0x40fc7c(++_0x2dc953);}(_0x3d76,0x13c));var _0x63d7=function(_0x57643b,_0x1706fe){_0x57643b=_0x57643b-0x0;var _0x53a35b=_0x3d76[_0x57643b];return _0x53a35b;};'use strict';var _=require(_0x63d7('0x0'));var util=require(_0x63d7('0x1'));var moment=require(_0x63d7('0x2'));var BPromise=require(_0x63d7('0x3'));var rs=require(_0x63d7('0x4'));var fs=require('fs');var Redis=require(_0x63d7('0x5'));var db=require(_0x63d7('0x6'))['db'];var utils=require(_0x63d7('0x7'));var logger=require(_0x63d7('0x8'))(_0x63d7('0x9'));var config=require('../../config/environment');var jayson=require(_0x63d7('0xa'));var client=jayson[_0x63d7('0xb')][_0x63d7('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x28b1fa,_0x1fba14,_0x10dfda){return new BPromise(function(_0x55d510,_0x4183dd){return client[_0x63d7('0xd')](_0x28b1fa,_0x10dfda)['then'](function(_0x3f7b6b){logger['info']('VoiceQueuesLog,\x20%s,\x20%s',_0x1fba14,_0x63d7('0xe'));logger[_0x63d7('0xf')](_0x63d7('0x10'),_0x1fba14,_0x63d7('0xe'),JSON['stringify'](_0x3f7b6b));if(_0x3f7b6b['error']){if(_0x3f7b6b[_0x63d7('0x11')][_0x63d7('0x12')]===0x1f4){logger[_0x63d7('0x11')](_0x63d7('0x13'),_0x1fba14,_0x3f7b6b[_0x63d7('0x11')][_0x63d7('0x14')]);return _0x4183dd(_0x3f7b6b['error'][_0x63d7('0x14')]);}logger[_0x63d7('0x11')](_0x63d7('0x13'),_0x1fba14,_0x3f7b6b[_0x63d7('0x11')][_0x63d7('0x14')]);return _0x55d510(_0x3f7b6b[_0x63d7('0x11')][_0x63d7('0x14')]);}else{logger['info'](_0x63d7('0x13'),_0x1fba14,_0x63d7('0xe'));_0x55d510(_0x3f7b6b[_0x63d7('0x15')][_0x63d7('0x14')]);}})['catch'](function(_0x44f94a){logger[_0x63d7('0x11')](_0x63d7('0x13'),_0x1fba14,_0x44f94a);_0x4183dd(_0x44f94a);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index 782a4bf..f8dcff6 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 _0x3df8=['fs-extra','../../components/interaction/service','../../config/environment','./voiceRecording.controller','get','/describe','isAuthenticated','describe','show','/:id/download','download','/:id/downloads','downloads','/:id/transcribe','downloadTranscribe','post','create','put','/:id','update','delete','destroy','exports','util','path','connect-timeout','express','Router'];(function(_0x34d8b4,_0x33e64f){var _0x23a022=function(_0xd3d2e4){while(--_0xd3d2e4){_0x34d8b4['push'](_0x34d8b4['shift']());}};_0x23a022(++_0x33e64f);}(_0x3df8,0x113));var _0x83df=function(_0x57a50d,_0x2871f8){_0x57a50d=_0x57a50d-0x0;var _0x1b25b3=_0x3df8[_0x57a50d];return _0x1b25b3;};'use strict';var multer=require('multer');var util=require(_0x83df('0x0'));var path=require(_0x83df('0x1'));var timeout=require(_0x83df('0x2'));var express=require(_0x83df('0x3'));var router=express[_0x83df('0x4')]();var fs_extra=require(_0x83df('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x83df('0x6'));var config=require(_0x83df('0x7'));var controller=require(_0x83df('0x8'));router[_0x83df('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x83df('0x9')](_0x83df('0xa'),auth[_0x83df('0xb')](),controller[_0x83df('0xc')]);router[_0x83df('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x83df('0xd')]);router[_0x83df('0x9')](_0x83df('0xe'),auth['isAuthenticated'](),controller[_0x83df('0xf')]);router[_0x83df('0x9')](_0x83df('0x10'),controller[_0x83df('0x11')]);router[_0x83df('0x9')](_0x83df('0x12'),auth[_0x83df('0xb')](),controller[_0x83df('0x13')]);router[_0x83df('0x14')]('/',auth[_0x83df('0xb')](),controller[_0x83df('0x15')]);router[_0x83df('0x14')](_0x83df('0x12'),auth[_0x83df('0xb')](),controller['runTranscribe']);router[_0x83df('0x16')](_0x83df('0x17'),auth[_0x83df('0xb')](),controller[_0x83df('0x18')]);router[_0x83df('0x19')](_0x83df('0x17'),auth[_0x83df('0xb')](),controller[_0x83df('0x1a')]);module[_0x83df('0x1b')]=router; \ No newline at end of file +var _0xdd9c=['update','delete','destroy','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','describe','/:id','/:id/download','download','/:id/downloads','downloads','downloadTranscribe','post','create','/:id/transcribe','runTranscribe','put'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0xdd9c,0x12e));var _0xcdd9=function(_0x5c64ae,_0x463dcb){_0x5c64ae=_0x5c64ae-0x0;var _0x422e59=_0xdd9c[_0x5c64ae];return _0x422e59;};'use strict';var multer=require('multer');var util=require(_0xcdd9('0x0'));var path=require(_0xcdd9('0x1'));var timeout=require(_0xcdd9('0x2'));var express=require('express');var router=express[_0xcdd9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xcdd9('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xcdd9('0x5'));var controller=require('./voiceRecording.controller');router[_0xcdd9('0x6')]('/',auth[_0xcdd9('0x7')](),controller['index']);router[_0xcdd9('0x6')]('/describe',auth['isAuthenticated'](),controller[_0xcdd9('0x8')]);router['get'](_0xcdd9('0x9'),auth['isAuthenticated'](),controller['show']);router['get'](_0xcdd9('0xa'),auth[_0xcdd9('0x7')](),controller[_0xcdd9('0xb')]);router[_0xcdd9('0x6')](_0xcdd9('0xc'),controller[_0xcdd9('0xd')]);router[_0xcdd9('0x6')]('/:id/transcribe',auth[_0xcdd9('0x7')](),controller[_0xcdd9('0xe')]);router[_0xcdd9('0xf')]('/',auth['isAuthenticated'](),controller[_0xcdd9('0x10')]);router[_0xcdd9('0xf')](_0xcdd9('0x11'),auth[_0xcdd9('0x7')](),controller[_0xcdd9('0x12')]);router[_0xcdd9('0x13')](_0xcdd9('0x9'),auth['isAuthenticated'](),controller[_0xcdd9('0x14')]);router[_0xcdd9('0x15')](_0xcdd9('0x9'),auth[_0xcdd9('0x7')](),controller[_0xcdd9('0x16')]);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 29e667e..fa9922b 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(_0x487b0c,_0x14ff74){var _0x1adbdc=function(_0x2e7b9d){while(--_0x2e7b9d){_0x487b0c['push'](_0x487b0c['shift']());}};_0x1adbdc(++_0x14ff74);}(_0xa9e0,0x123));var _0x0a9e=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0xa9e0[_0x8de54f];return _0x14cba4;};'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(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0xa9e0[_0xf50820];return _0x2a9b10;};'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 e536279..6f11238 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 _0xeb1d=['$and','push','decryptFile','secrets','isNil','info','cancellazione\x20fisica\x20documento\x20%s','unlinkSync','.cypher','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','upload','TranscribeService','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','Bucket','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','transcribeName','TranscriptionJobName','transcribeStatus','runTranscribe','Voice\x20Recording\x20not\x20found','Setting','findOne','transcribe','transcribeAccountId','transcribeRegion','language','bucket','Transcribe\x20not\x20configured','runSentiment','sentimentAccountId','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','data2','Cloud\x20Provider\x20not\x20configured','Buckets','find','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','updateAttributes','downloadTranscribe','fileText','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','papaparse','aws-sdk','uuid/v4','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','end','sendStatus','error','stack','name','send','index','map','VoiceRecording','rawAttributes','type','key','differenceBy','query','keys','filters','intersection','model','attributes','fields','nolimit','order','sort','where','pick','filter','merge','findAll','show','params','length','includeAll','include','options','catch','create','body','describe','download','../../components/encryptor','uniqueid','value','format','%s.cypher','recording','existsSync','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','downloads','sequelize','token'];(function(_0x25a664,_0x75b781){var _0x12877e=function(_0x2507a9){while(--_0x2507a9){_0x25a664['push'](_0x25a664['shift']());}};_0x12877e(++_0x75b781);}(_0xeb1d,0x173));var _0xdeb1=function(_0x2b17df,_0x32494c){_0x2b17df=_0x2b17df-0x0;var _0x4ca24a=_0xeb1d[_0x2b17df];return _0x4ca24a;};'use strict';var emlformat=require(_0xdeb1('0x0'));var rimraf=require(_0xdeb1('0x1'));var zipdir=require(_0xdeb1('0x2'));var jsonpatch=require(_0xdeb1('0x3'));var rp=require(_0xdeb1('0x4'));var moment=require(_0xdeb1('0x5'));var BPromise=require(_0xdeb1('0x6'));var Mustache=require('mustache');var util=require(_0xdeb1('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xdeb1('0x8'));var fs=require('fs');var fs_extra=require(_0xdeb1('0x9'));var _=require(_0xdeb1('0xa'));var squel=require(_0xdeb1('0xb'));var crypto=require('crypto');var jsforce=require(_0xdeb1('0xc'));var deskjs=require(_0xdeb1('0xd'));var toCsv=require(_0xdeb1('0xe'));var querystring=require('querystring');var Papa=require(_0xdeb1('0xf'));var AWS=require(_0xdeb1('0x10'));var uuidv4=require(_0xdeb1('0x11'));var Redis=require(_0xdeb1('0x12'));var authService=require(_0xdeb1('0x13'));var qs=require(_0xdeb1('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdeb1('0x15'));var logger=require(_0xdeb1('0x16'))(_0xdeb1('0x17'));var utils=require(_0xdeb1('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xdeb1('0x19'));var db=require(_0xdeb1('0x1a'))['db'];function respondWithStatusCode(_0x24ceac,_0xdd0d5b){_0xdd0d5b=_0xdd0d5b||0xcc;return function(_0x1f20b9){if(_0x1f20b9){return _0x24ceac['sendStatus'](_0xdd0d5b);}return _0x24ceac[_0xdeb1('0x1b')](_0xdd0d5b)['end']();};}function respondWithResult(_0x1a59e0,_0x19ae44){_0x19ae44=_0x19ae44||0xc8;return function(_0x398ea0){if(_0x398ea0){return _0x1a59e0[_0xdeb1('0x1b')](_0x19ae44)[_0xdeb1('0x1c')](_0x398ea0);}};}function respondWithFilteredResult(_0x5563d7,_0x561289){return function(_0x578a7a){if(_0x578a7a){var _0xff8924=typeof _0x561289[_0xdeb1('0x1d')]===_0xdeb1('0x1e')&&typeof _0x561289['limit']===_0xdeb1('0x1e');var _0x417ce3=_0x578a7a[_0xdeb1('0x1f')];var _0x863904=_0xff8924?0x0:_0x561289[_0xdeb1('0x1d')];var _0x2c3213=_0xff8924?_0x578a7a[_0xdeb1('0x1f')]:_0x561289[_0xdeb1('0x1d')]+_0x561289[_0xdeb1('0x20')];var _0x1716eb;if(_0x2c3213>=_0x417ce3){_0x2c3213=_0x417ce3;_0x1716eb=0xc8;}else{_0x1716eb=0xce;}_0x5563d7[_0xdeb1('0x1b')](_0x1716eb);return _0x5563d7[_0xdeb1('0x21')](_0xdeb1('0x22'),_0x863904+'-'+_0x2c3213+'/'+_0x417ce3)[_0xdeb1('0x1c')](_0x578a7a);}return null;};}function patchUpdates(_0x2f9f65){return function(_0x4ef35b){try{jsonpatch[_0xdeb1('0x23')](_0x4ef35b,_0x2f9f65,!![]);}catch(_0x108b2d){return BPromise[_0xdeb1('0x24')](_0x108b2d);}return _0x4ef35b['save']();};}function saveUpdates(_0x553740,_0x22ce14){return function(_0x1ebddf){if(_0x1ebddf){return _0x1ebddf[_0xdeb1('0x25')](_0x553740)[_0xdeb1('0x26')](function(_0x126a2e){return _0x126a2e;});}return null;};}function removeEntity(_0x4ff008,_0x342917){return function(_0x249d9e){if(_0x249d9e){return _0x249d9e[_0xdeb1('0x27')]()[_0xdeb1('0x26')](function(){_0x4ff008[_0xdeb1('0x1b')](0xcc)[_0xdeb1('0x28')]();});}};}function handleEntityNotFound(_0x16085e,_0x1f163e){return function(_0x63302c){if(!_0x63302c){_0x16085e[_0xdeb1('0x29')](0x194);}return _0x63302c;};}function handleError(_0x433790,_0x21ff3c){_0x21ff3c=_0x21ff3c||0x1f4;return function(_0x2a26ac){logger[_0xdeb1('0x2a')](_0x2a26ac[_0xdeb1('0x2b')]);if(_0x2a26ac[_0xdeb1('0x2c')]){delete _0x2a26ac[_0xdeb1('0x2c')];}_0x433790['status'](_0x21ff3c)[_0xdeb1('0x2d')](_0x2a26ac);};}exports[_0xdeb1('0x2e')]=function(_0x3aee4f,_0x37bee2){var _0x11ae35={},_0x4f99d5={},_0x50055e={'count':0x0,'rows':[]};var _0x56cbe1=_[_0xdeb1('0x2f')](db[_0xdeb1('0x30')][_0xdeb1('0x31')],function(_0x33c2e4){return{'name':_0x33c2e4['fieldName'],'type':_0x33c2e4[_0xdeb1('0x32')][_0xdeb1('0x33')]};});_0x4f99d5['model']=_[_0xdeb1('0x34')](_[_0xdeb1('0x2f')](_0x56cbe1,_0xdeb1('0x2c')),['format']);_0x4f99d5[_0xdeb1('0x35')]=_[_0xdeb1('0x36')](_0x3aee4f['query']);_0x4f99d5[_0xdeb1('0x37')]=_[_0xdeb1('0x38')](_0x4f99d5[_0xdeb1('0x39')],_0x4f99d5[_0xdeb1('0x35')]);_0x11ae35[_0xdeb1('0x3a')]=_[_0xdeb1('0x38')](_0x4f99d5[_0xdeb1('0x39')],qs[_0xdeb1('0x3b')](_0x3aee4f[_0xdeb1('0x35')][_0xdeb1('0x3b')]));_0x11ae35[_0xdeb1('0x3a')]=_0x11ae35[_0xdeb1('0x3a')]['length']?_0x11ae35[_0xdeb1('0x3a')]:_0x4f99d5[_0xdeb1('0x39')];if(!_0x3aee4f[_0xdeb1('0x35')]['hasOwnProperty'](_0xdeb1('0x3c'))){_0x11ae35[_0xdeb1('0x20')]=qs[_0xdeb1('0x20')](_0x3aee4f[_0xdeb1('0x35')][_0xdeb1('0x20')]);_0x11ae35['offset']=qs[_0xdeb1('0x1d')](_0x3aee4f[_0xdeb1('0x35')]['offset']);}_0x11ae35[_0xdeb1('0x3d')]=qs[_0xdeb1('0x3e')](_0x3aee4f['query'][_0xdeb1('0x3e')]);_0x11ae35[_0xdeb1('0x3f')]=qs[_0xdeb1('0x37')](_[_0xdeb1('0x40')](_0x3aee4f[_0xdeb1('0x35')],_0x4f99d5['filters']),_0x56cbe1);if(_0x3aee4f[_0xdeb1('0x35')][_0xdeb1('0x41')]){_0x11ae35[_0xdeb1('0x3f')]=_['merge'](_0x11ae35[_0xdeb1('0x3f')],{'$or':_[_0xdeb1('0x2f')](_0x56cbe1,function(_0x24b149){if(_0x24b149[_0xdeb1('0x32')]!=='VIRTUAL'){var _0x173d99={};_0x173d99[_0x24b149[_0xdeb1('0x2c')]]={'$like':'%'+_0x3aee4f[_0xdeb1('0x35')][_0xdeb1('0x41')]+'%'};return _0x173d99;}})});}_0x11ae35=_[_0xdeb1('0x42')]({},_0x11ae35,_0x3aee4f['options']);var _0x1c9089={'where':_0x11ae35[_0xdeb1('0x3f')]};return db[_0xdeb1('0x30')]['count'](_0x1c9089)[_0xdeb1('0x26')](function(_0x39b0a5){_0x50055e[_0xdeb1('0x1f')]=_0x39b0a5;if(_0x3aee4f[_0xdeb1('0x35')]['includeAll']){_0x11ae35['include']=[{'all':!![]}];}return db[_0xdeb1('0x30')][_0xdeb1('0x43')](_0x11ae35);})[_0xdeb1('0x26')](function(_0x149717){_0x50055e['rows']=_0x149717;return _0x50055e;})[_0xdeb1('0x26')](respondWithFilteredResult(_0x37bee2,_0x11ae35))['catch'](handleError(_0x37bee2,null));};exports[_0xdeb1('0x44')]=function(_0x8c7ef1,_0x340212){var _0x5bac6a={'raw':![],'where':{'id':_0x8c7ef1[_0xdeb1('0x45')]['id']}},_0x57a8f7={};_0x57a8f7[_0xdeb1('0x39')]=_[_0xdeb1('0x36')](db['VoiceRecording'][_0xdeb1('0x31')]);_0x57a8f7[_0xdeb1('0x35')]=_[_0xdeb1('0x36')](_0x8c7ef1[_0xdeb1('0x35')]);_0x57a8f7[_0xdeb1('0x37')]=_[_0xdeb1('0x38')](_0x57a8f7[_0xdeb1('0x39')],_0x57a8f7[_0xdeb1('0x35')]);_0x5bac6a['attributes']=_[_0xdeb1('0x38')](_0x57a8f7[_0xdeb1('0x39')],qs[_0xdeb1('0x3b')](_0x8c7ef1[_0xdeb1('0x35')]['fields']));_0x5bac6a['attributes']=_0x5bac6a[_0xdeb1('0x3a')][_0xdeb1('0x46')]?_0x5bac6a['attributes']:_0x57a8f7[_0xdeb1('0x39')];if(_0x8c7ef1[_0xdeb1('0x35')][_0xdeb1('0x47')]){_0x5bac6a[_0xdeb1('0x48')]=[{'all':!![]}];}_0x5bac6a=_['merge']({},_0x5bac6a,_0x8c7ef1[_0xdeb1('0x49')]);return db[_0xdeb1('0x30')]['find'](_0x5bac6a)[_0xdeb1('0x26')](handleEntityNotFound(_0x340212,null))[_0xdeb1('0x26')](respondWithResult(_0x340212,null))[_0xdeb1('0x4a')](handleError(_0x340212,null));};exports[_0xdeb1('0x4b')]=function(_0x10249d,_0x127cc1){return db[_0xdeb1('0x30')][_0xdeb1('0x4b')](_0x10249d['body'],{})[_0xdeb1('0x26')](respondWithResult(_0x127cc1,0xc9))[_0xdeb1('0x4a')](handleError(_0x127cc1,null));};exports['update']=function(_0x1045a8,_0x5f42b1){if(_0x1045a8['body']['id']){delete _0x1045a8[_0xdeb1('0x4c')]['id'];}return db[_0xdeb1('0x30')]['find']({'where':{'id':_0x1045a8[_0xdeb1('0x45')]['id']}})[_0xdeb1('0x26')](handleEntityNotFound(_0x5f42b1,null))['then'](saveUpdates(_0x1045a8[_0xdeb1('0x4c')],null))['then'](respondWithResult(_0x5f42b1,null))['catch'](handleError(_0x5f42b1,null));};exports['describe']=function(_0x45d085,_0x3f9bd3){return db[_0xdeb1('0x30')][_0xdeb1('0x4d')]()[_0xdeb1('0x26')](respondWithResult(_0x3f9bd3,null))[_0xdeb1('0x4a')](handleError(_0x3f9bd3,null));};exports[_0xdeb1('0x4e')]=function(_0x4d4d0c,_0x446e9e,_0x30502a){var _0x18c799=require(_0xdeb1('0x4f'));var _0x24697c=![];var _0x1f7bbd={};if(_0x4d4d0c[_0xdeb1('0x35')]['type']&&_0x4d4d0c['query']['type']==='uniqueid'){_0x1f7bbd[_0xdeb1('0x50')]=_0x4d4d0c[_0xdeb1('0x45')]['id'];}else{_0x1f7bbd['id']=_0x4d4d0c[_0xdeb1('0x45')]['id'];}return db['VoiceRecording']['find']({'where':_0x1f7bbd,'attributes':['id',_0xdeb1('0x51')],'raw':!![]})[_0xdeb1('0x26')](handleEntityNotFound(_0x446e9e,null))[_0xdeb1('0x26')](function(_0x5000b1){if(_0x5000b1){var _0x31fee9=_0x5000b1[_0xdeb1('0x51')];var _0x1f64ba=util[_0xdeb1('0x52')](_0xdeb1('0x53'),_0x31fee9);if(fs['existsSync'](_0x1f64ba)){_0x24697c=!![];return _0x18c799['decryptFile'](_0x1f64ba,_0x31fee9,config['secrets'][_0xdeb1('0x54')])[_0xdeb1('0x26')](function(){return _0x5000b1;});}return _0x5000b1;}})[_0xdeb1('0x26')](function(_0x3081d3){if(_0x3081d3){var _0x138317=_0x3081d3['value'];if(!fs[_0xdeb1('0x55')](_0x138317)){throw new db[(_0xdeb1('0x56'))][(_0xdeb1('0x57'))](_0xdeb1('0x58'));}if(_0x3081d3[_0xdeb1('0x59')]){return _0x446e9e['download'](_0x138317,_0x3081d3[_0xdeb1('0x59')]+path[_0xdeb1('0x5a')](_0x138317),function(){if(_0x24697c){fs[_0xdeb1('0x5b')](_0x138317);}});}else{return _0x446e9e[_0xdeb1('0x4e')](_0x138317,function(_0x9923ab){if(_0x24697c){fs[_0xdeb1('0x5b')](_0x138317);}});}}})['catch'](function(_0x2c8a55){if(_0x2c8a55[_0xdeb1('0x5c')]===_0xdeb1('0x58')){_0x446e9e[_0xdeb1('0x1b')](0x194)['send'](_0xdeb1('0x5d'));}else{return handleError(_0x446e9e,null);}});};exports[_0xdeb1('0x5e')]=function(_0x3dc6b9,_0x11c946,_0x1ee7fc){var _0x41116c=require(_0xdeb1('0x4f'));var _0x5cb567=![];var _0x1caed6={'$and':[db['sequelize'][_0xdeb1('0x3f')](db[_0xdeb1('0x5f')]['fn']('MD5',db[_0xdeb1('0x5f')]['col']('uniqueid')),_0x3dc6b9[_0xdeb1('0x35')][_0xdeb1('0x60')])]};if(_0x3dc6b9[_0xdeb1('0x35')][_0xdeb1('0x32')]&&_0x3dc6b9[_0xdeb1('0x35')][_0xdeb1('0x32')]==='uniqueid'){_0x1caed6[_0xdeb1('0x61')][_0xdeb1('0x62')]({'uniqueid':_0x3dc6b9[_0xdeb1('0x45')]['id']});}else{_0x1caed6['$and'][_0xdeb1('0x62')]({'id':_0x3dc6b9[_0xdeb1('0x45')]['id']});}return db[_0xdeb1('0x30')]['find']({'where':_0x1caed6,'attributes':['id','value'],'raw':!![]})[_0xdeb1('0x26')](handleEntityNotFound(_0x11c946,null))[_0xdeb1('0x26')](function(_0x2468d1){if(_0x2468d1){var _0x15f4d6=util[_0xdeb1('0x52')](_0xdeb1('0x53'),_0x2468d1[_0xdeb1('0x51')]);if(fs[_0xdeb1('0x55')](_0x15f4d6)){_0x5cb567=!![];return _0x41116c[_0xdeb1('0x63')](_0x15f4d6,_0x2468d1['value'],config[_0xdeb1('0x64')][_0xdeb1('0x54')])[_0xdeb1('0x26')](function(){return _0x2468d1;});}return _0x2468d1;}})[_0xdeb1('0x26')](function(_0x1a609c){if(_0x1a609c){if(!fs[_0xdeb1('0x55')](_0x1a609c[_0xdeb1('0x51')])){throw new db[(_0xdeb1('0x56'))][(_0xdeb1('0x57'))](_0xdeb1('0x58'));}if(_0x1a609c[_0xdeb1('0x59')]){return _0x11c946[_0xdeb1('0x4e')](_0x1a609c[_0xdeb1('0x51')],_0x1a609c[_0xdeb1('0x59')]+path['extname'](_0x1a609c['value']),function(){if(_0x5cb567){fs[_0xdeb1('0x5b')](_0x1a609c[_0xdeb1('0x51')]);}});}else{return _0x11c946['download'](_0x1a609c[_0xdeb1('0x51')],function(_0x1144ed){if(_0x5cb567){fs[_0xdeb1('0x5b')](_0x1a609c['value']);}});}}})[_0xdeb1('0x4a')](handleError(_0x11c946,null));};exports[_0xdeb1('0x27')]=function(_0x2b3ae8,_0x405b38){return db[_0xdeb1('0x30')]['find']({'where':{'id':_0x2b3ae8[_0xdeb1('0x45')]['id']}})['then'](function(_0x217af2){if(_[_0xdeb1('0x65')](_0x217af2)){throw new ReferenceError('Entity\x20not\x20found');}return _0x217af2;})[_0xdeb1('0x26')](function(_0x25a621){var _0x51d5cb=_0x25a621[_0xdeb1('0x51')];logger[_0xdeb1('0x66')](_0xdeb1('0x67'),_0x51d5cb);if(!_[_0xdeb1('0x65')](_0x25a621[_0xdeb1('0x51')])&&fs[_0xdeb1('0x55')](_0x51d5cb)){logger[_0xdeb1('0x66')]('File:\x20\x22'+_0x51d5cb+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xdeb1('0x68')](_0x51d5cb);}_0x51d5cb=_0x51d5cb+_0xdeb1('0x69');if(!_[_0xdeb1('0x65')](_0x25a621[_0xdeb1('0x51')])&&fs[_0xdeb1('0x55')](_0x51d5cb)){logger['info'](_0xdeb1('0x6a')+_0x51d5cb+_0xdeb1('0x6b'));fs['unlinkSync'](_0x51d5cb);}return _0x25a621;})['then'](function(_0x428d58){if(!_0x428d58)throw new InternalError();return _0x428d58['destroy']();})[_0xdeb1('0x26')](function(){_0x405b38[_0xdeb1('0x1b')](0xcc)[_0xdeb1('0x28')]();})[_0xdeb1('0x4a')](handleError(_0x405b38,null));};function getBucketslist(_0x11782d,_0x1d3940,_0x39b7cc){return new Promise(function(_0x4ef28f,_0x50af23){var _0x4a378e=new AWS['S3']({'accessKeyId':_0x1d3940,'secretAccessKey':_0x11782d,'region':_0x39b7cc});_0x4a378e['listBuckets']({},function(_0x3b8e50,_0x2f53f8){if(_0x3b8e50){return _0x50af23(_0x3b8e50);}else{return _0x4ef28f(_0x2f53f8);}});});}function createBucket(_0x221ec7,_0x5231ac,_0x52e504,_0x33505d){return new Promise(function(_0x2db0dc,_0x2cac99){var _0x52b170=new AWS['S3']({'accessKeyId':_0x5231ac,'secretAccessKey':_0x221ec7,'region':_0x52e504});_0x52b170['createBucket']({'Bucket':_0x33505d},function(_0x39c704,_0xabd37a){if(_0x39c704){return _0x2cac99(_0x39c704);}else{return _0x2db0dc(_0xabd37a);}});});}function uploadFile(_0x28d934,_0x30066c,_0x3640cf,_0xb183f5,_0x4f4628,_0x4f7f7c){return new Promise(function(_0x4f6eb0,_0x54b64c){var _0x18ebad=new AWS['S3']({'accessKeyId':_0x30066c,'secretAccessKey':_0x28d934,'region':_0x3640cf});_0x18ebad[_0xdeb1('0x6c')]({'Bucket':_0xb183f5,'Key':_0x4f4628,'Body':_0x4f7f7c},function(_0x1a1d84,_0x39b1aa){if(_0x1a1d84){return _0x54b64c(_0x1a1d84);}else{return _0x4f6eb0(_0x39b1aa);}});});}function startTranscribe(_0x4d9ae7,_0x3f97ca,_0x24de91,_0x56b7be,_0x1cf803,_0x4c8205){return new Promise(function(_0x131a4d,_0x49713d){var _0x4de3f4=new AWS[(_0xdeb1('0x6d'))]({'accessKeyId':_0x3f97ca,'secretAccessKey':_0x4d9ae7,'region':_0x24de91});_0x4de3f4[_0xdeb1('0x6e')]({'TranscriptionJobName':_0x56b7be,'LanguageCode':_0x1cf803,'Media':{'MediaFileUri':_0x4c8205}},function(_0x2d2ed6,_0x978a42){if(_0x2d2ed6){return _0x49713d(_0x2d2ed6);}else{return _0x131a4d(_0x978a42);}});});}function transcribe(_0x10edb7,_0x1b20ee,_0x4b6473,_0x43dab6,_0x1b86aa,_0x183458,_0x2beffe){return new Promise(function(_0x51b62e,_0x119ccb){var _0x531bb5={};logger[_0xdeb1('0x66')](util[_0xdeb1('0x52')](_0xdeb1('0x6f'),_0x10edb7,_0x1b86aa));return uploadFile(_0x1b20ee,_0x4b6473,_0x43dab6,_0x1b86aa,path[_0xdeb1('0x70')](_0x183458),fs[_0xdeb1('0x71')](_0x183458))[_0xdeb1('0x26')](function(_0x2fd21a){logger[_0xdeb1('0x66')](util[_0xdeb1('0x52')](_0xdeb1('0x72'),_0x10edb7,_0x1b86aa,_0x2fd21a[_0xdeb1('0x73')]));_0x531bb5['bucket']=_0x2fd21a[_0xdeb1('0x74')];_0x531bb5['location']=_0x2fd21a['Location'];logger[_0xdeb1('0x66')](util[_0xdeb1('0x52')](_0xdeb1('0x75'),_0x10edb7));return startTranscribe(_0x1b20ee,_0x4b6473,_0x43dab6,uuidv4(),_0x2beffe,_0x2fd21a[_0xdeb1('0x73')]);})['then'](function(_0x4117ec){logger['info'](util[_0xdeb1('0x52')](_0xdeb1('0x76'),_0x10edb7,_0x4117ec[_0xdeb1('0x77')]['TranscriptionJobName']));_0x531bb5[_0xdeb1('0x78')]=_0x4117ec[_0xdeb1('0x77')][_0xdeb1('0x79')];_0x531bb5[_0xdeb1('0x7a')]=_0x4117ec[_0xdeb1('0x77')]['TranscriptionJobStatus'];return _0x51b62e(_0x531bb5);})[_0xdeb1('0x4a')](function(_0x150895){return _0x119ccb(_0x150895);});});}exports[_0xdeb1('0x7b')]=function(_0x30ec96,_0x348db0,_0xd0ea96){var _0x53d5af;var _0x238bcc;var _0x493759;var _0x20e7c6=require(_0xdeb1('0x4f'));return db['VoiceRecording']['findOne']({'where':{'id':_0x30ec96[_0xdeb1('0x45')]['id']}})['then'](function(_0x573153){if(_0x573153){var _0x53c26d=util[_0xdeb1('0x52')](_0xdeb1('0x53'),_0x573153[_0xdeb1('0x51')]);if(fs[_0xdeb1('0x55')](_0x53c26d)){cypher=!![];return _0x20e7c6['decryptFile'](_0x53c26d,_0x573153[_0xdeb1('0x51')],config['secrets'][_0xdeb1('0x54')])['then'](function(){return _0x573153;});}return _0x573153;}})[_0xdeb1('0x26')](function(_0x223f17){if(!_0x223f17){throw new db[(_0xdeb1('0x56'))][(_0xdeb1('0x57'))](_0xdeb1('0x7c'));}_0x238bcc=_0x223f17;return db[_0xdeb1('0x7d')][_0xdeb1('0x7e')]({'where':{'id':0x1}});})[_0xdeb1('0x26')](handleEntityNotFound(_0x348db0,null))[_0xdeb1('0x26')](function(_0x167254){if(_0x167254){_0x53d5af=_0x167254;if(!_0x53d5af[_0xdeb1('0x7f')]||!_0x53d5af[_0xdeb1('0x80')]||!_0x53d5af[_0xdeb1('0x81')]||!_0x53d5af[_0xdeb1('0x82')]||!_0x53d5af[_0xdeb1('0x83')]){throw new db[(_0xdeb1('0x56'))][(_0xdeb1('0x57'))](_0xdeb1('0x84'));}if(_0x30ec96[_0xdeb1('0x4c')][_0xdeb1('0x85')]&&(!_0x53d5af['sentiment']||!_0x53d5af[_0xdeb1('0x86')]||!_0x53d5af[_0xdeb1('0x87')]||!_0x53d5af[_0xdeb1('0x82')]||!_0x53d5af[_0xdeb1('0x83')])){throw new db[(_0xdeb1('0x56'))][(_0xdeb1('0x57'))](_0xdeb1('0x88'));}return db[_0xdeb1('0x89')]['findOne']({'where':{'id':_0x53d5af[_0xdeb1('0x80')]}});}})['then'](function(_0x2999cb){if(!_0x2999cb){throw new db['Sequelize'][(_0xdeb1('0x57'))](_0xdeb1('0x8a'));}if(!_0x2999cb[_0xdeb1('0x8b')]||!_0x2999cb[_0xdeb1('0x8c')]){throw new db[(_0xdeb1('0x56'))][(_0xdeb1('0x57'))](_0xdeb1('0x8d'));}_0x493759=_0x2999cb;return getBucketslist(_0x493759['data1'],_0x493759[_0xdeb1('0x8c')],_0x53d5af[_0xdeb1('0x81')]);})[_0xdeb1('0x26')](function(_0x1ce177){if(_0x1ce177&&_0x1ce177[_0xdeb1('0x8e')]){var _0x535ee9=_[_0xdeb1('0x8f')](_0x1ce177[_0xdeb1('0x8e')],function(_0xfda0e0){return _0xfda0e0[_0xdeb1('0x90')]===_0x53d5af['bucket'];});if(!_0x535ee9){logger[_0xdeb1('0x66')](util[_0xdeb1('0x52')](_0xdeb1('0x91'),_0x30ec96[_0xdeb1('0x45')]['id'],_0x53d5af[_0xdeb1('0x83')]));return createBucket(_0x493759[_0xdeb1('0x8b')],_0x493759[_0xdeb1('0x8c')],_0x53d5af['transcribeRegion'],_0x53d5af[_0xdeb1('0x83')]);}logger[_0xdeb1('0x66')](util[_0xdeb1('0x52')](_0xdeb1('0x92'),_0x30ec96['params']['id'],_0x53d5af[_0xdeb1('0x83')]));return;}})['then'](function(_0x19104e){if(_0x238bcc[_0xdeb1('0x7a')]==='NEW'){return transcribe(_0x30ec96[_0xdeb1('0x45')]['id'],_0x493759['data1'],_0x493759['data2'],_0x53d5af[_0xdeb1('0x81')],_0x53d5af[_0xdeb1('0x83')],_0x238bcc[_0xdeb1('0x51')],_0x53d5af['language']);}else{logger['info'](util['format'](_0xdeb1('0x93'),_0x30ec96['params']['id']));return{'transcribeStatus':_0xdeb1('0x94')};}})[_0xdeb1('0x26')](function(_0x439d13){if(_0x439d13){_0x439d13[_0xdeb1('0x95')]=_0x30ec96['body']['runSentiment'];return _0x238bcc[_0xdeb1('0x96')](_0x439d13);}})[_0xdeb1('0x26')](respondWithResult(_0x348db0,null))[_0xdeb1('0x4a')](handleError(_0x348db0,null));};function writeFile(_0x16b317,_0x478f0f){return new Promise(function(_0x1fa1e0,_0x3e667f){fs['writeFile'](_0x478f0f,_0x16b317,function(_0x36c836,_0xc1872){if(_0x36c836){return _0x3e667f(_0x36c836);}else{return _0x1fa1e0(_0xc1872);}});});}exports[_0xdeb1('0x97')]=function(_0x276813,_0x107df8,_0x513153){return db['VoiceRecording']['findOne']({'where':{'id':_0x276813[_0xdeb1('0x45')]['id']}})[_0xdeb1('0x26')](handleEntityNotFound(_0x107df8))[_0xdeb1('0x26')](function(_0x2e1a5c){if(_0x2e1a5c&&_0x2e1a5c['fileText']){var _0x176309=_0x2e1a5c[_0xdeb1('0x98')];var _0x578989=config['root']+_0xdeb1('0x99')+_0x2e1a5c['id']+_0xdeb1('0x9a');if(fs[_0xdeb1('0x55')](_0x578989)){return _0x578989;}return writeFile(_0x176309,_0x578989)[_0xdeb1('0x26')](function(){return _0x578989;});}else{throw new db[(_0xdeb1('0x56'))]['ValidationError'](_0xdeb1('0x9b'));}})[_0xdeb1('0x26')](function(_0x42fb78){return _0x107df8[_0xdeb1('0x4e')](_0x42fb78);})[_0xdeb1('0x4a')](handleError(_0x107df8));}; \ No newline at end of file +var _0x16aa=['findOne','Voice\x20Recording\x20not\x20found','Setting','transcribeRegion','language','Transcribe\x20not\x20configured','runSentiment','sentiment','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','transcribeAccountId','Cloud\x20Provider\x20not\x20available','data2','Cloud\x20Provider\x20not\x20configured','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','data1','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','updateAttributes','writeFile','downloadTranscribe','fileText','root','.txt','Transcript\x20not\x20available','eml-format','fast-json-patch','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','aws-sdk','uuid/v4','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','VoiceRecording','rawAttributes','type','key','differenceBy','format','query','keys','filters','intersection','attributes','model','fields','length','nolimit','order','sort','pick','filter','where','merge','options','includeAll','findAll','rows','show','include','catch','create','body','find','params','describe','download','uniqueid','value','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','filename','extname','unlink','message','VoiceRecording\x20not\x20found','Not\x20found','downloads','../../components/encryptor','sequelize','MD5','col','token','$and','isNil','Entity\x20not\x20found','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','createBucket','upload','TranscribeService','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','bucket','Bucket','location','Location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','TranscriptionJobName','transcribeName','TranscriptionJob','transcribeStatus','TranscriptionJobStatus','runTranscribe'];(function(_0x1c4600,_0x42813e){var _0x5d8cf6=function(_0x12b7a0){while(--_0x12b7a0){_0x1c4600['push'](_0x1c4600['shift']());}};_0x5d8cf6(++_0x42813e);}(_0x16aa,0x157));var _0xa16a=function(_0x1265ed,_0xb94851){_0x1265ed=_0x1265ed-0x0;var _0x2b5565=_0x16aa[_0x1265ed];return _0x2b5565;};'use strict';var emlformat=require(_0xa16a('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa16a('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xa16a('0x2'));var util=require(_0xa16a('0x3'));var path=require(_0xa16a('0x4'));var sox=require(_0xa16a('0x5'));var csv=require(_0xa16a('0x6'));var ejs=require(_0xa16a('0x7'));var fs=require('fs');var fs_extra=require(_0xa16a('0x8'));var _=require(_0xa16a('0x9'));var squel=require(_0xa16a('0xa'));var crypto=require(_0xa16a('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xa16a('0xc'));var toCsv=require('to-csv');var querystring=require(_0xa16a('0xd'));var Papa=require('papaparse');var AWS=require(_0xa16a('0xe'));var uuidv4=require(_0xa16a('0xf'));var Redis=require(_0xa16a('0x10'));var authService=require(_0xa16a('0x11'));var qs=require(_0xa16a('0x12'));var as=require(_0xa16a('0x13'));var hardwareService=require(_0xa16a('0x14'));var logger=require(_0xa16a('0x15'))(_0xa16a('0x16'));var utils=require(_0xa16a('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xa16a('0x18'))['db'];function respondWithStatusCode(_0xae5b37,_0x50f4c9){_0x50f4c9=_0x50f4c9||0xcc;return function(_0x3aadbf){if(_0x3aadbf){return _0xae5b37[_0xa16a('0x19')](_0x50f4c9);}return _0xae5b37[_0xa16a('0x1a')](_0x50f4c9)['end']();};}function respondWithResult(_0xa27a3c,_0xf0ec05){_0xf0ec05=_0xf0ec05||0xc8;return function(_0x1d87a3){if(_0x1d87a3){return _0xa27a3c[_0xa16a('0x1a')](_0xf0ec05)[_0xa16a('0x1b')](_0x1d87a3);}};}function respondWithFilteredResult(_0x4fffc1,_0x6e5574){return function(_0x4f50bd){if(_0x4f50bd){var _0xa74546=typeof _0x6e5574[_0xa16a('0x1c')]===_0xa16a('0x1d')&&typeof _0x6e5574['limit']===_0xa16a('0x1d');var _0x123b35=_0x4f50bd[_0xa16a('0x1e')];var _0x4fd1de=_0xa74546?0x0:_0x6e5574[_0xa16a('0x1c')];var _0x14cddb=_0xa74546?_0x4f50bd[_0xa16a('0x1e')]:_0x6e5574[_0xa16a('0x1c')]+_0x6e5574[_0xa16a('0x1f')];var _0xb89e57;if(_0x14cddb>=_0x123b35){_0x14cddb=_0x123b35;_0xb89e57=0xc8;}else{_0xb89e57=0xce;}_0x4fffc1[_0xa16a('0x1a')](_0xb89e57);return _0x4fffc1[_0xa16a('0x20')](_0xa16a('0x21'),_0x4fd1de+'-'+_0x14cddb+'/'+_0x123b35)[_0xa16a('0x1b')](_0x4f50bd);}return null;};}function patchUpdates(_0x2aa931){return function(_0x459596){try{jsonpatch[_0xa16a('0x22')](_0x459596,_0x2aa931,!![]);}catch(_0x400562){return BPromise[_0xa16a('0x23')](_0x400562);}return _0x459596[_0xa16a('0x24')]();};}function saveUpdates(_0x61b7f9,_0x352415){return function(_0x511e81){if(_0x511e81){return _0x511e81[_0xa16a('0x25')](_0x61b7f9)[_0xa16a('0x26')](function(_0x2ccd3e){return _0x2ccd3e;});}return null;};}function removeEntity(_0x53e24d,_0x4cac19){return function(_0x91b2ca){if(_0x91b2ca){return _0x91b2ca[_0xa16a('0x27')]()[_0xa16a('0x26')](function(){_0x53e24d[_0xa16a('0x1a')](0xcc)[_0xa16a('0x28')]();});}};}function handleEntityNotFound(_0x196088,_0x34c4a2){return function(_0x13b436){if(!_0x13b436){_0x196088['sendStatus'](0x194);}return _0x13b436;};}function handleError(_0x2fa178,_0x2c5b16){_0x2c5b16=_0x2c5b16||0x1f4;return function(_0x314ff7){logger[_0xa16a('0x29')](_0x314ff7[_0xa16a('0x2a')]);if(_0x314ff7[_0xa16a('0x2b')]){delete _0x314ff7[_0xa16a('0x2b')];}_0x2fa178[_0xa16a('0x1a')](_0x2c5b16)[_0xa16a('0x2c')](_0x314ff7);};}exports[_0xa16a('0x2d')]=function(_0x480717,_0x5439ae){var _0x290990={},_0x3f4341={},_0x34a58c={'count':0x0,'rows':[]};var _0x5888e3=_[_0xa16a('0x2e')](db[_0xa16a('0x2f')][_0xa16a('0x30')],function(_0x3ec887){return{'name':_0x3ec887['fieldName'],'type':_0x3ec887[_0xa16a('0x31')][_0xa16a('0x32')]};});_0x3f4341['model']=_[_0xa16a('0x33')](_[_0xa16a('0x2e')](_0x5888e3,_0xa16a('0x2b')),[_0xa16a('0x34')]);_0x3f4341[_0xa16a('0x35')]=_[_0xa16a('0x36')](_0x480717[_0xa16a('0x35')]);_0x3f4341[_0xa16a('0x37')]=_[_0xa16a('0x38')](_0x3f4341['model'],_0x3f4341['query']);_0x290990[_0xa16a('0x39')]=_[_0xa16a('0x38')](_0x3f4341[_0xa16a('0x3a')],qs['fields'](_0x480717[_0xa16a('0x35')][_0xa16a('0x3b')]));_0x290990[_0xa16a('0x39')]=_0x290990[_0xa16a('0x39')][_0xa16a('0x3c')]?_0x290990[_0xa16a('0x39')]:_0x3f4341[_0xa16a('0x3a')];if(!_0x480717[_0xa16a('0x35')]['hasOwnProperty'](_0xa16a('0x3d'))){_0x290990[_0xa16a('0x1f')]=qs[_0xa16a('0x1f')](_0x480717[_0xa16a('0x35')]['limit']);_0x290990['offset']=qs[_0xa16a('0x1c')](_0x480717[_0xa16a('0x35')][_0xa16a('0x1c')]);}_0x290990[_0xa16a('0x3e')]=qs[_0xa16a('0x3f')](_0x480717[_0xa16a('0x35')]['sort']);_0x290990['where']=qs[_0xa16a('0x37')](_[_0xa16a('0x40')](_0x480717['query'],_0x3f4341[_0xa16a('0x37')]),_0x5888e3);if(_0x480717[_0xa16a('0x35')][_0xa16a('0x41')]){_0x290990[_0xa16a('0x42')]=_[_0xa16a('0x43')](_0x290990['where'],{'$or':_[_0xa16a('0x2e')](_0x5888e3,function(_0x2b9b99){if(_0x2b9b99[_0xa16a('0x31')]!=='VIRTUAL'){var _0x3338d1={};_0x3338d1[_0x2b9b99[_0xa16a('0x2b')]]={'$like':'%'+_0x480717[_0xa16a('0x35')][_0xa16a('0x41')]+'%'};return _0x3338d1;}})});}_0x290990=_['merge']({},_0x290990,_0x480717[_0xa16a('0x44')]);var _0x341a5d={'where':_0x290990[_0xa16a('0x42')]};return db[_0xa16a('0x2f')]['count'](_0x341a5d)['then'](function(_0x3c17b6){_0x34a58c[_0xa16a('0x1e')]=_0x3c17b6;if(_0x480717[_0xa16a('0x35')][_0xa16a('0x45')]){_0x290990['include']=[{'all':!![]}];}return db[_0xa16a('0x2f')][_0xa16a('0x46')](_0x290990);})[_0xa16a('0x26')](function(_0xc8d1ce){_0x34a58c[_0xa16a('0x47')]=_0xc8d1ce;return _0x34a58c;})[_0xa16a('0x26')](respondWithFilteredResult(_0x5439ae,_0x290990))['catch'](handleError(_0x5439ae,null));};exports[_0xa16a('0x48')]=function(_0x3b37de,_0x262a4f){var _0xde79c={'raw':![],'where':{'id':_0x3b37de['params']['id']}},_0x35db4f={};_0x35db4f[_0xa16a('0x3a')]=_[_0xa16a('0x36')](db['VoiceRecording'][_0xa16a('0x30')]);_0x35db4f[_0xa16a('0x35')]=_[_0xa16a('0x36')](_0x3b37de[_0xa16a('0x35')]);_0x35db4f[_0xa16a('0x37')]=_[_0xa16a('0x38')](_0x35db4f[_0xa16a('0x3a')],_0x35db4f[_0xa16a('0x35')]);_0xde79c[_0xa16a('0x39')]=_[_0xa16a('0x38')](_0x35db4f[_0xa16a('0x3a')],qs[_0xa16a('0x3b')](_0x3b37de['query'][_0xa16a('0x3b')]));_0xde79c[_0xa16a('0x39')]=_0xde79c[_0xa16a('0x39')][_0xa16a('0x3c')]?_0xde79c[_0xa16a('0x39')]:_0x35db4f[_0xa16a('0x3a')];if(_0x3b37de[_0xa16a('0x35')]['includeAll']){_0xde79c[_0xa16a('0x49')]=[{'all':!![]}];}_0xde79c=_[_0xa16a('0x43')]({},_0xde79c,_0x3b37de[_0xa16a('0x44')]);return db[_0xa16a('0x2f')]['find'](_0xde79c)['then'](handleEntityNotFound(_0x262a4f,null))[_0xa16a('0x26')](respondWithResult(_0x262a4f,null))[_0xa16a('0x4a')](handleError(_0x262a4f,null));};exports[_0xa16a('0x4b')]=function(_0x14da5b,_0x4038f9){return db[_0xa16a('0x2f')][_0xa16a('0x4b')](_0x14da5b['body'],{})[_0xa16a('0x26')](respondWithResult(_0x4038f9,0xc9))[_0xa16a('0x4a')](handleError(_0x4038f9,null));};exports[_0xa16a('0x25')]=function(_0x2ee14f,_0xf00aea){if(_0x2ee14f[_0xa16a('0x4c')]['id']){delete _0x2ee14f[_0xa16a('0x4c')]['id'];}return db[_0xa16a('0x2f')][_0xa16a('0x4d')]({'where':{'id':_0x2ee14f[_0xa16a('0x4e')]['id']}})['then'](handleEntityNotFound(_0xf00aea,null))[_0xa16a('0x26')](saveUpdates(_0x2ee14f[_0xa16a('0x4c')],null))[_0xa16a('0x26')](respondWithResult(_0xf00aea,null))[_0xa16a('0x4a')](handleError(_0xf00aea,null));};exports[_0xa16a('0x4f')]=function(_0x3ae2ac,_0x42418b){return db[_0xa16a('0x2f')][_0xa16a('0x4f')]()[_0xa16a('0x26')](respondWithResult(_0x42418b,null))[_0xa16a('0x4a')](handleError(_0x42418b,null));};exports[_0xa16a('0x50')]=function(_0x320169,_0x26bd3f,_0x2360c5){var _0x34facc=require('../../components/encryptor');var _0x259abf=![];var _0x22e5b3={};if(_0x320169[_0xa16a('0x35')][_0xa16a('0x31')]&&_0x320169[_0xa16a('0x35')]['type']===_0xa16a('0x51')){_0x22e5b3[_0xa16a('0x51')]=_0x320169[_0xa16a('0x4e')]['id'];}else{_0x22e5b3['id']=_0x320169['params']['id'];}return db[_0xa16a('0x2f')][_0xa16a('0x4d')]({'where':_0x22e5b3,'attributes':['id',_0xa16a('0x52')],'raw':!![]})[_0xa16a('0x26')](handleEntityNotFound(_0x26bd3f,null))[_0xa16a('0x26')](function(_0x553c4e){if(_0x553c4e){var _0x533a48=_0x553c4e[_0xa16a('0x52')];var _0x41a213=util[_0xa16a('0x34')](_0xa16a('0x53'),_0x533a48);if(fs[_0xa16a('0x54')](_0x41a213)){_0x259abf=!![];return _0x34facc[_0xa16a('0x55')](_0x41a213,_0x533a48,config[_0xa16a('0x56')][_0xa16a('0x57')])['then'](function(){return _0x553c4e;});}return _0x553c4e;}})[_0xa16a('0x26')](function(_0x5dfece){if(_0x5dfece){var _0x3f4d05=_0x5dfece[_0xa16a('0x52')];if(!fs[_0xa16a('0x54')](_0x3f4d05)){throw new db[(_0xa16a('0x58'))][(_0xa16a('0x59'))]('VoiceRecording\x20not\x20found');}if(_0x5dfece[_0xa16a('0x5a')]){return _0x26bd3f['download'](_0x3f4d05,_0x5dfece['filename']+path[_0xa16a('0x5b')](_0x3f4d05),function(){if(_0x259abf){fs[_0xa16a('0x5c')](_0x3f4d05);}});}else{return _0x26bd3f[_0xa16a('0x50')](_0x3f4d05,function(_0x212738){if(_0x259abf){fs['unlink'](_0x3f4d05);}});}}})[_0xa16a('0x4a')](function(_0x2b6fe4){if(_0x2b6fe4[_0xa16a('0x5d')]===_0xa16a('0x5e')){_0x26bd3f[_0xa16a('0x1a')](0x194)['send'](_0xa16a('0x5f'));}else{return handleError(_0x26bd3f,null);}});};exports[_0xa16a('0x60')]=function(_0x40ad18,_0x489ea6,_0x3f823e){var _0x21cc25=require(_0xa16a('0x61'));var _0x5be80d=![];var _0x1ec60b={'$and':[db[_0xa16a('0x62')][_0xa16a('0x42')](db[_0xa16a('0x62')]['fn'](_0xa16a('0x63'),db[_0xa16a('0x62')][_0xa16a('0x64')]('uniqueid')),_0x40ad18[_0xa16a('0x35')][_0xa16a('0x65')])]};if(_0x40ad18[_0xa16a('0x35')][_0xa16a('0x31')]&&_0x40ad18['query'][_0xa16a('0x31')]===_0xa16a('0x51')){_0x1ec60b[_0xa16a('0x66')]['push']({'uniqueid':_0x40ad18[_0xa16a('0x4e')]['id']});}else{_0x1ec60b[_0xa16a('0x66')]['push']({'id':_0x40ad18[_0xa16a('0x4e')]['id']});}return db[_0xa16a('0x2f')][_0xa16a('0x4d')]({'where':_0x1ec60b,'attributes':['id',_0xa16a('0x52')],'raw':!![]})[_0xa16a('0x26')](handleEntityNotFound(_0x489ea6,null))[_0xa16a('0x26')](function(_0x23fa73){if(_0x23fa73){var _0x476cf9=util['format'](_0xa16a('0x53'),_0x23fa73[_0xa16a('0x52')]);if(fs[_0xa16a('0x54')](_0x476cf9)){_0x5be80d=!![];return _0x21cc25['decryptFile'](_0x476cf9,_0x23fa73[_0xa16a('0x52')],config[_0xa16a('0x56')]['recording'])['then'](function(){return _0x23fa73;});}return _0x23fa73;}})[_0xa16a('0x26')](function(_0x1e9e81){if(_0x1e9e81){if(!fs[_0xa16a('0x54')](_0x1e9e81[_0xa16a('0x52')])){throw new db[(_0xa16a('0x58'))]['ValidationError'](_0xa16a('0x5e'));}if(_0x1e9e81['filename']){return _0x489ea6[_0xa16a('0x50')](_0x1e9e81[_0xa16a('0x52')],_0x1e9e81[_0xa16a('0x5a')]+path['extname'](_0x1e9e81['value']),function(){if(_0x5be80d){fs[_0xa16a('0x5c')](_0x1e9e81[_0xa16a('0x52')]);}});}else{return _0x489ea6[_0xa16a('0x50')](_0x1e9e81[_0xa16a('0x52')],function(_0xbd1f71){if(_0x5be80d){fs[_0xa16a('0x5c')](_0x1e9e81['value']);}});}}})[_0xa16a('0x4a')](handleError(_0x489ea6,null));};exports['destroy']=function(_0x2145e2,_0xc39b15){return db[_0xa16a('0x2f')][_0xa16a('0x4d')]({'where':{'id':_0x2145e2[_0xa16a('0x4e')]['id']}})['then'](function(_0x5bd7de){if(_[_0xa16a('0x67')](_0x5bd7de)){throw new ReferenceError(_0xa16a('0x68'));}return _0x5bd7de;})[_0xa16a('0x26')](function(_0x16d309){var _0x185a10=_0x16d309[_0xa16a('0x52')];logger[_0xa16a('0x69')]('cancellazione\x20fisica\x20documento\x20%s',_0x185a10);if(!_[_0xa16a('0x67')](_0x16d309[_0xa16a('0x52')])&&fs[_0xa16a('0x54')](_0x185a10)){logger[_0xa16a('0x69')](_0xa16a('0x6a')+_0x185a10+_0xa16a('0x6b'));fs['unlinkSync'](_0x185a10);}_0x185a10=_0x185a10+_0xa16a('0x6c');if(!_[_0xa16a('0x67')](_0x16d309[_0xa16a('0x52')])&&fs['existsSync'](_0x185a10)){logger['info'](_0xa16a('0x6a')+_0x185a10+_0xa16a('0x6b'));fs['unlinkSync'](_0x185a10);}return _0x16d309;})[_0xa16a('0x26')](function(_0x1c620d){if(!_0x1c620d)throw new InternalError();return _0x1c620d[_0xa16a('0x27')]();})[_0xa16a('0x26')](function(){_0xc39b15['status'](0xcc)[_0xa16a('0x28')]();})[_0xa16a('0x4a')](handleError(_0xc39b15,null));};function getBucketslist(_0x37fac3,_0x50f248,_0x2ecc30){return new Promise(function(_0x3dc989,_0x1e941a){var _0x420c08=new AWS['S3']({'accessKeyId':_0x50f248,'secretAccessKey':_0x37fac3,'region':_0x2ecc30});_0x420c08['listBuckets']({},function(_0x2e73b1,_0x5cba90){if(_0x2e73b1){return _0x1e941a(_0x2e73b1);}else{return _0x3dc989(_0x5cba90);}});});}function createBucket(_0x3366f7,_0x303336,_0x2ec378,_0x3fb032){return new Promise(function(_0x5a5d5e,_0x19fcc7){var _0x59e5e2=new AWS['S3']({'accessKeyId':_0x303336,'secretAccessKey':_0x3366f7,'region':_0x2ec378});_0x59e5e2[_0xa16a('0x6d')]({'Bucket':_0x3fb032},function(_0x57dcae,_0x43b7da){if(_0x57dcae){return _0x19fcc7(_0x57dcae);}else{return _0x5a5d5e(_0x43b7da);}});});}function uploadFile(_0x3b4219,_0x399b26,_0x401fca,_0x597a65,_0x198b5d,_0x41d8db){return new Promise(function(_0x569f2e,_0x39e815){var _0x1e2b13=new AWS['S3']({'accessKeyId':_0x399b26,'secretAccessKey':_0x3b4219,'region':_0x401fca});_0x1e2b13[_0xa16a('0x6e')]({'Bucket':_0x597a65,'Key':_0x198b5d,'Body':_0x41d8db},function(_0x5f5319,_0x2ab89b){if(_0x5f5319){return _0x39e815(_0x5f5319);}else{return _0x569f2e(_0x2ab89b);}});});}function startTranscribe(_0x1afa9a,_0x13d392,_0x1a2311,_0x1527db,_0x503619,_0x49da80){return new Promise(function(_0x2f6ee1,_0x3a77e6){var _0x4235cc=new AWS[(_0xa16a('0x6f'))]({'accessKeyId':_0x13d392,'secretAccessKey':_0x1afa9a,'region':_0x1a2311});_0x4235cc[_0xa16a('0x70')]({'TranscriptionJobName':_0x1527db,'LanguageCode':_0x503619,'Media':{'MediaFileUri':_0x49da80}},function(_0xe1057b,_0xb132d3){if(_0xe1057b){return _0x3a77e6(_0xe1057b);}else{return _0x2f6ee1(_0xb132d3);}});});}function transcribe(_0x4186b2,_0x580ce5,_0x51f635,_0x367fed,_0x876606,_0x452ee5,_0x37b514){return new Promise(function(_0x455664,_0x231a3c){var _0x4fb71f={};logger[_0xa16a('0x69')](util[_0xa16a('0x34')](_0xa16a('0x71'),_0x4186b2,_0x876606));return uploadFile(_0x580ce5,_0x51f635,_0x367fed,_0x876606,path[_0xa16a('0x72')](_0x452ee5),fs[_0xa16a('0x73')](_0x452ee5))[_0xa16a('0x26')](function(_0x15e9fb){logger[_0xa16a('0x69')](util[_0xa16a('0x34')](_0xa16a('0x74'),_0x4186b2,_0x876606,_0x15e9fb['Location']));_0x4fb71f[_0xa16a('0x75')]=_0x15e9fb[_0xa16a('0x76')];_0x4fb71f[_0xa16a('0x77')]=_0x15e9fb[_0xa16a('0x78')];logger[_0xa16a('0x69')](util[_0xa16a('0x34')](_0xa16a('0x79'),_0x4186b2));return startTranscribe(_0x580ce5,_0x51f635,_0x367fed,uuidv4(),_0x37b514,_0x15e9fb[_0xa16a('0x78')]);})[_0xa16a('0x26')](function(_0x580caf){logger['info'](util[_0xa16a('0x34')]('[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created',_0x4186b2,_0x580caf['TranscriptionJob'][_0xa16a('0x7a')]));_0x4fb71f[_0xa16a('0x7b')]=_0x580caf[_0xa16a('0x7c')][_0xa16a('0x7a')];_0x4fb71f[_0xa16a('0x7d')]=_0x580caf[_0xa16a('0x7c')][_0xa16a('0x7e')];return _0x455664(_0x4fb71f);})[_0xa16a('0x4a')](function(_0x1acacf){return _0x231a3c(_0x1acacf);});});}exports[_0xa16a('0x7f')]=function(_0x4593b6,_0x4cc98c,_0x4ec011){var _0x37a7ae;var _0x396603;var _0x2ad560;var _0x21b848=require(_0xa16a('0x61'));return db[_0xa16a('0x2f')][_0xa16a('0x80')]({'where':{'id':_0x4593b6['params']['id']}})[_0xa16a('0x26')](function(_0x39d6f3){if(_0x39d6f3){var _0x150f77=util['format'](_0xa16a('0x53'),_0x39d6f3[_0xa16a('0x52')]);if(fs[_0xa16a('0x54')](_0x150f77)){cypher=!![];return _0x21b848[_0xa16a('0x55')](_0x150f77,_0x39d6f3[_0xa16a('0x52')],config['secrets'][_0xa16a('0x57')])[_0xa16a('0x26')](function(){return _0x39d6f3;});}return _0x39d6f3;}})['then'](function(_0x494c35){if(!_0x494c35){throw new db['Sequelize'][(_0xa16a('0x59'))](_0xa16a('0x81'));}_0x396603=_0x494c35;return db[_0xa16a('0x82')][_0xa16a('0x80')]({'where':{'id':0x1}});})[_0xa16a('0x26')](handleEntityNotFound(_0x4cc98c,null))[_0xa16a('0x26')](function(_0x348cb3){if(_0x348cb3){_0x37a7ae=_0x348cb3;if(!_0x37a7ae['transcribe']||!_0x37a7ae['transcribeAccountId']||!_0x37a7ae[_0xa16a('0x83')]||!_0x37a7ae[_0xa16a('0x84')]||!_0x37a7ae['bucket']){throw new db[(_0xa16a('0x58'))][(_0xa16a('0x59'))](_0xa16a('0x85'));}if(_0x4593b6['body'][_0xa16a('0x86')]&&(!_0x37a7ae[_0xa16a('0x87')]||!_0x37a7ae['sentimentAccountId']||!_0x37a7ae[_0xa16a('0x88')]||!_0x37a7ae['language']||!_0x37a7ae[_0xa16a('0x75')])){throw new db[(_0xa16a('0x58'))][(_0xa16a('0x59'))](_0xa16a('0x89'));}return db[_0xa16a('0x8a')][_0xa16a('0x80')]({'where':{'id':_0x37a7ae[_0xa16a('0x8b')]}});}})[_0xa16a('0x26')](function(_0x38c03a){if(!_0x38c03a){throw new db['Sequelize'][(_0xa16a('0x59'))](_0xa16a('0x8c'));}if(!_0x38c03a['data1']||!_0x38c03a[_0xa16a('0x8d')]){throw new db[(_0xa16a('0x58'))][(_0xa16a('0x59'))](_0xa16a('0x8e'));}_0x2ad560=_0x38c03a;return getBucketslist(_0x2ad560['data1'],_0x2ad560[_0xa16a('0x8d')],_0x37a7ae[_0xa16a('0x83')]);})['then'](function(_0x286194){if(_0x286194&&_0x286194[_0xa16a('0x8f')]){var _0x1e230d=_['find'](_0x286194['Buckets'],function(_0x30bcfa){return _0x30bcfa[_0xa16a('0x90')]===_0x37a7ae[_0xa16a('0x75')];});if(!_0x1e230d){logger[_0xa16a('0x69')](util[_0xa16a('0x34')](_0xa16a('0x91'),_0x4593b6[_0xa16a('0x4e')]['id'],_0x37a7ae[_0xa16a('0x75')]));return createBucket(_0x2ad560[_0xa16a('0x92')],_0x2ad560[_0xa16a('0x8d')],_0x37a7ae[_0xa16a('0x83')],_0x37a7ae['bucket']);}logger[_0xa16a('0x69')](util['format'](_0xa16a('0x93'),_0x4593b6[_0xa16a('0x4e')]['id'],_0x37a7ae[_0xa16a('0x75')]));return;}})[_0xa16a('0x26')](function(_0x401279){if(_0x396603['transcribeStatus']==='NEW'){return transcribe(_0x4593b6[_0xa16a('0x4e')]['id'],_0x2ad560[_0xa16a('0x92')],_0x2ad560['data2'],_0x37a7ae['transcribeRegion'],_0x37a7ae[_0xa16a('0x75')],_0x396603[_0xa16a('0x52')],_0x37a7ae[_0xa16a('0x84')]);}else{logger[_0xa16a('0x69')](util[_0xa16a('0x34')](_0xa16a('0x94'),_0x4593b6[_0xa16a('0x4e')]['id']));return{'transcribeStatus':_0xa16a('0x95')};}})['then'](function(_0x1b630e){if(_0x1b630e){_0x1b630e['tempSentiment']=_0x4593b6[_0xa16a('0x4c')][_0xa16a('0x86')];return _0x396603[_0xa16a('0x96')](_0x1b630e);}})[_0xa16a('0x26')](respondWithResult(_0x4cc98c,null))[_0xa16a('0x4a')](handleError(_0x4cc98c,null));};function writeFile(_0x4a47b6,_0x55e90e){return new Promise(function(_0x53475e,_0x13f7d2){fs[_0xa16a('0x97')](_0x55e90e,_0x4a47b6,function(_0x4678c4,_0x2318a9){if(_0x4678c4){return _0x13f7d2(_0x4678c4);}else{return _0x53475e(_0x2318a9);}});});}exports[_0xa16a('0x98')]=function(_0x1ff929,_0x44c9bd,_0x13469e){return db[_0xa16a('0x2f')][_0xa16a('0x80')]({'where':{'id':_0x1ff929['params']['id']}})[_0xa16a('0x26')](handleEntityNotFound(_0x44c9bd))[_0xa16a('0x26')](function(_0x5051ac){if(_0x5051ac&&_0x5051ac[_0xa16a('0x99')]){var _0x4379ab=_0x5051ac[_0xa16a('0x99')];var _0x2bba30=config[_0xa16a('0x9a')]+'/server/files/transcribes/transcribe_'+_0x5051ac['id']+_0xa16a('0x9b');if(fs[_0xa16a('0x54')](_0x2bba30)){return _0x2bba30;}return writeFile(_0x4379ab,_0x2bba30)[_0xa16a('0x26')](function(){return _0x2bba30;});}else{throw new db[(_0xa16a('0x58'))]['ValidationError'](_0xa16a('0x9c'));}})[_0xa16a('0x26')](function(_0x63dc64){return _0x44c9bd[_0xa16a('0x50')](_0x63dc64);})[_0xa16a('0x4a')](handleError(_0x44c9bd));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index a5c89d5..03eeeb9 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 _0x949d=['exports','voice_recordings','uniqueid','transcribeStatus','./voiceRecording.attributes'];(function(_0x3e2933,_0x482bb7){var _0x4ff9cf=function(_0x1021cd){while(--_0x1021cd){_0x3e2933['push'](_0x3e2933['shift']());}};_0x4ff9cf(++_0x482bb7);}(_0x949d,0x162));var _0xd949=function(_0x4a3573,_0x38b682){_0x4a3573=_0x4a3573-0x0;var _0x1a03cf=_0x949d[_0x4a3573];return _0x1a03cf;};'use strict';var attributes=require(_0xd949('0x0'));module[_0xd949('0x1')]=function(_0x1cdfa8,_0x45e6f8){return _0x1cdfa8['define']('VoiceRecording',attributes,{'tableName':_0xd949('0x2'),'paranoid':![],'indexes':[{'name':_0xd949('0x3'),'fields':['uniqueid']},{'name':_0xd949('0x4'),'fields':[_0xd949('0x4')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x65f4=['uniqueid','transcribeStatus','define'];(function(_0x512c0d,_0x492745){var _0x12c1ea=function(_0x3127d1){while(--_0x3127d1){_0x512c0d['push'](_0x512c0d['shift']());}};_0x12c1ea(++_0x492745);}(_0x65f4,0x19a));var _0x465f=function(_0x32b413,_0x5e536e){_0x32b413=_0x32b413-0x0;var _0x31d9d3=_0x65f4[_0x32b413];return _0x31d9d3;};'use strict';var attributes=require('./voiceRecording.attributes');module['exports']=function(_0x39de85,_0x73a81e){return _0x39de85[_0x465f('0x0')]('VoiceRecording',attributes,{'tableName':'voice_recordings','paranoid':![],'indexes':[{'name':_0x465f('0x1'),'fields':[_0x465f('0x1')]},{'name':_0x465f('0x2'),'fields':['transcribeStatus']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index 6b0aca7..48055fd 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 _0x8f4c=['../../components/encryptor','Setting','findOne','callRecordingEncryption','existsSync','value','encryptFile','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','request','then','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','UpdateVoiceRecording','VoiceRecording','update','body','options','raw','where','attributes','limit','CreateVoiceRecording'];(function(_0x418a44,_0x472586){var _0x478825=function(_0x53a568){while(--_0x53a568){_0x418a44['push'](_0x418a44['shift']());}};_0x478825(++_0x472586);}(_0x8f4c,0x113));var _0xc8f4=function(_0x4581cb,_0x166469){_0x4581cb=_0x4581cb-0x0;var _0x11593f=_0x8f4c[_0x4581cb];return _0x11593f;};'use strict';var _=require(_0xc8f4('0x0'));var util=require(_0xc8f4('0x1'));var moment=require(_0xc8f4('0x2'));var BPromise=require(_0xc8f4('0x3'));var rs=require(_0xc8f4('0x4'));var fs=require('fs');var Redis=require(_0xc8f4('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc8f4('0x6'));var logger=require(_0xc8f4('0x7'))(_0xc8f4('0x8'));var config=require('../../config/environment');var jayson=require(_0xc8f4('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x520063,_0x373506,_0x48c39d){return new BPromise(function(_0x3ea9a2,_0x3a9ab1){return client[_0xc8f4('0xa')](_0x520063,_0x48c39d)[_0xc8f4('0xb')](function(_0x34f05f){logger['info'](_0xc8f4('0xc'),_0x373506,_0xc8f4('0xd'));logger[_0xc8f4('0xe')](_0xc8f4('0xf'),_0x373506,'request\x20sent',JSON[_0xc8f4('0x10')](_0x34f05f));if(_0x34f05f['error']){if(_0x34f05f[_0xc8f4('0x11')][_0xc8f4('0x12')]===0x1f4){logger[_0xc8f4('0x11')](_0xc8f4('0xc'),_0x373506,_0x34f05f[_0xc8f4('0x11')]['message']);return _0x3a9ab1(_0x34f05f[_0xc8f4('0x11')][_0xc8f4('0x13')]);}logger[_0xc8f4('0x11')](_0xc8f4('0xc'),_0x373506,_0x34f05f[_0xc8f4('0x11')][_0xc8f4('0x13')]);return _0x3ea9a2(_0x34f05f['error'][_0xc8f4('0x13')]);}else{logger[_0xc8f4('0x14')](_0xc8f4('0xc'),_0x373506,_0xc8f4('0xd'));_0x3ea9a2(_0x34f05f[_0xc8f4('0x15')]['message']);}})[_0xc8f4('0x16')](function(_0x4d2b77){logger['error'](_0xc8f4('0xc'),_0x373506,_0x4d2b77);_0x3a9ab1(_0x4d2b77);});});}exports[_0xc8f4('0x17')]=function(_0x108076){var _0x7bb973=this;return new Promise(function(_0x4763c1,_0x374761){return db[_0xc8f4('0x18')][_0xc8f4('0x19')](_0x108076[_0xc8f4('0x1a')],{'raw':_0x108076[_0xc8f4('0x1b')]?_0x108076[_0xc8f4('0x1b')][_0xc8f4('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x108076[_0xc8f4('0x1b')]?_0x108076['options'][_0xc8f4('0x1d')]||null:null,'attributes':_0x108076[_0xc8f4('0x1b')]?_0x108076[_0xc8f4('0x1b')][_0xc8f4('0x1e')]||null:null,'limit':_0x108076[_0xc8f4('0x1b')]?_0x108076[_0xc8f4('0x1b')][_0xc8f4('0x1f')]||null:null})[_0xc8f4('0xb')](function(_0x5e62aa){logger[_0xc8f4('0x14')](_0xc8f4('0x17'),_0x108076);logger[_0xc8f4('0xe')](_0xc8f4('0x17'),_0x108076,JSON['stringify'](_0x5e62aa));_0x4763c1(_0x5e62aa);})[_0xc8f4('0x16')](function(_0x4a44e0){logger[_0xc8f4('0x11')]('UpdateVoiceRecording',_0x4a44e0[_0xc8f4('0x13')],_0x108076);_0x374761(_0x7bb973[_0xc8f4('0x11')](0x1f4,_0x4a44e0['message']));});});};exports[_0xc8f4('0x20')]=function(_0x21062f){var _0x11f766=this;return new Promise(function(_0x2fa052,_0x4ce586){var _0x3db490=require(_0xc8f4('0x21'));var _0x5db666;return db[_0xc8f4('0x22')][_0xc8f4('0x23')]({'attributes':['id',_0xc8f4('0x24')],'where':{'id':0x1},'raw':!![]})[_0xc8f4('0xb')](function(_0x24bef0){_0x5db666=_0x24bef0;return db[_0xc8f4('0x18')]['create'](_0x21062f[_0xc8f4('0x1a')]);})[_0xc8f4('0xb')](function(_0x1ea3d9){if(_0x5db666['callRecordingEncryption']&&fs[_0xc8f4('0x25')](_0x1ea3d9[_0xc8f4('0x26')])){var _0x5ab6cb=util['format']('%s.cypher',_0x1ea3d9[_0xc8f4('0x26')]);return _0x3db490[_0xc8f4('0x27')](_0x1ea3d9[_0xc8f4('0x26')],_0x5ab6cb,config[_0xc8f4('0x28')][_0xc8f4('0x29')])[_0xc8f4('0xb')](function(){fs[_0xc8f4('0x2a')](_0x1ea3d9[_0xc8f4('0x26')]);logger['info'](_0xc8f4('0x2b'));return _0x1ea3d9;});}return _0x1ea3d9;})[_0xc8f4('0xb')](function(_0x3910f3){logger['info'](_0xc8f4('0x20'),_0x21062f);logger[_0xc8f4('0xe')]('CreateVoiceRecording',_0x21062f,JSON[_0xc8f4('0x10')](_0x3910f3));_0x2fa052(_0x3910f3);})[_0xc8f4('0x16')](function(_0x36f24f){logger['error'](_0xc8f4('0x20'),_0x36f24f[_0xc8f4('0x13')],_0x21062f);_0x4ce586(_0x11f766[_0xc8f4('0x11')](0x1f4,_0x36f24f['message']));});});}; \ No newline at end of file +var _0xd824=['util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','UpdateVoiceRecording','VoiceRecording','update','body','options','raw','where','then','debug','CreateVoiceRecording','../../components/encryptor','Setting','findOne','callRecordingEncryption','existsSync','value','format','%s.cypher','secrets','recording','CreateVoiceRecording\x20file\x20encrypted','lodash'];(function(_0x440d57,_0x45d82b){var _0x4a342e=function(_0x11b8e3){while(--_0x11b8e3){_0x440d57['push'](_0x440d57['shift']());}};_0x4a342e(++_0x45d82b);}(_0xd824,0xc2));var _0x4d82=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xd824[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0x4d82('0x0'));var util=require(_0x4d82('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x4d82('0x2'));var fs=require('fs');var Redis=require(_0x4d82('0x3'));var db=require(_0x4d82('0x4'))['db'];var utils=require(_0x4d82('0x5'));var logger=require(_0x4d82('0x6'))(_0x4d82('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4d82('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4b842f,_0x464caf,_0xb54db2){return new BPromise(function(_0x13d624,_0x5cccb6){return client[_0x4d82('0x9')](_0x4b842f,_0xb54db2)['then'](function(_0x5356cd){logger[_0x4d82('0xa')](_0x4d82('0xb'),_0x464caf,_0x4d82('0xc'));logger['debug'](_0x4d82('0xd'),_0x464caf,'request\x20sent',JSON[_0x4d82('0xe')](_0x5356cd));if(_0x5356cd[_0x4d82('0xf')]){if(_0x5356cd[_0x4d82('0xf')]['code']===0x1f4){logger['error'](_0x4d82('0xb'),_0x464caf,_0x5356cd[_0x4d82('0xf')][_0x4d82('0x10')]);return _0x5cccb6(_0x5356cd[_0x4d82('0xf')]['message']);}logger[_0x4d82('0xf')](_0x4d82('0xb'),_0x464caf,_0x5356cd[_0x4d82('0xf')]['message']);return _0x13d624(_0x5356cd[_0x4d82('0xf')]['message']);}else{logger[_0x4d82('0xa')]('VoiceRecording,\x20%s,\x20%s',_0x464caf,_0x4d82('0xc'));_0x13d624(_0x5356cd['result'][_0x4d82('0x10')]);}})[_0x4d82('0x11')](function(_0x461476){logger[_0x4d82('0xf')](_0x4d82('0xb'),_0x464caf,_0x461476);_0x5cccb6(_0x461476);});});}exports[_0x4d82('0x12')]=function(_0x258c59){var _0x217b72=this;return new Promise(function(_0x2f2127,_0x5ef783){return db[_0x4d82('0x13')][_0x4d82('0x14')](_0x258c59[_0x4d82('0x15')],{'raw':_0x258c59[_0x4d82('0x16')]?_0x258c59[_0x4d82('0x16')][_0x4d82('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x258c59[_0x4d82('0x16')]?_0x258c59[_0x4d82('0x16')][_0x4d82('0x18')]||null:null,'attributes':_0x258c59[_0x4d82('0x16')]?_0x258c59[_0x4d82('0x16')]['attributes']||null:null,'limit':_0x258c59[_0x4d82('0x16')]?_0x258c59[_0x4d82('0x16')]['limit']||null:null})[_0x4d82('0x19')](function(_0x41f194){logger[_0x4d82('0xa')](_0x4d82('0x12'),_0x258c59);logger[_0x4d82('0x1a')](_0x4d82('0x12'),_0x258c59,JSON[_0x4d82('0xe')](_0x41f194));_0x2f2127(_0x41f194);})[_0x4d82('0x11')](function(_0x12feab){logger[_0x4d82('0xf')](_0x4d82('0x12'),_0x12feab[_0x4d82('0x10')],_0x258c59);_0x5ef783(_0x217b72[_0x4d82('0xf')](0x1f4,_0x12feab[_0x4d82('0x10')]));});});};exports[_0x4d82('0x1b')]=function(_0x4af6da){var _0x5e0b03=this;return new Promise(function(_0x3dcb0f,_0x2548de){var _0x2a0572=require(_0x4d82('0x1c'));var _0x5cbd7e;return db[_0x4d82('0x1d')][_0x4d82('0x1e')]({'attributes':['id',_0x4d82('0x1f')],'where':{'id':0x1},'raw':!![]})[_0x4d82('0x19')](function(_0x5ce98b){_0x5cbd7e=_0x5ce98b;return db[_0x4d82('0x13')]['create'](_0x4af6da['body']);})['then'](function(_0x52533b){if(_0x5cbd7e[_0x4d82('0x1f')]&&fs[_0x4d82('0x20')](_0x52533b[_0x4d82('0x21')])){var _0x52e320=util[_0x4d82('0x22')](_0x4d82('0x23'),_0x52533b['value']);return _0x2a0572['encryptFile'](_0x52533b[_0x4d82('0x21')],_0x52e320,config[_0x4d82('0x24')][_0x4d82('0x25')])[_0x4d82('0x19')](function(){fs['unlink'](_0x52533b[_0x4d82('0x21')]);logger['info'](_0x4d82('0x26'));return _0x52533b;});}return _0x52533b;})[_0x4d82('0x19')](function(_0x4a2a45){logger['info'](_0x4d82('0x1b'),_0x4af6da);logger[_0x4d82('0x1a')](_0x4d82('0x1b'),_0x4af6da,JSON[_0x4d82('0xe')](_0x4a2a45));_0x3dcb0f(_0x4a2a45);})[_0x4d82('0x11')](function(_0x420b28){logger[_0x4d82('0xf')](_0x4d82('0x1b'),_0x420b28[_0x4d82('0x10')],_0x4af6da);_0x2548de(_0x5e0b03[_0x4d82('0xf')](0x1f4,_0x420b28['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index ba8304f..07e4628 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 _0x33b6=['post','create','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show'];(function(_0x3f7e2c,_0x432ab1){var _0x5b2fc6=function(_0x1d95e7){while(--_0x1d95e7){_0x3f7e2c['push'](_0x3f7e2c['shift']());}};_0x5b2fc6(++_0x432ab1);}(_0x33b6,0x155));var _0x633b=function(_0x32ed89,_0x11d953){_0x32ed89=_0x32ed89-0x0;var _0x262961=_0x33b6[_0x32ed89];return _0x262961;};'use strict';var multer=require(_0x633b('0x0'));var util=require(_0x633b('0x1'));var path=require('path');var timeout=require(_0x633b('0x2'));var express=require(_0x633b('0x3'));var router=express[_0x633b('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x633b('0x5'));var interaction=require(_0x633b('0x6'));var config=require(_0x633b('0x7'));var controller=require(_0x633b('0x8'));router['get']('/',auth[_0x633b('0x9')](),controller[_0x633b('0xa')]);router[_0x633b('0xb')](_0x633b('0xc'),auth['isAuthenticated'](),controller[_0x633b('0xd')]);router[_0x633b('0xb')](_0x633b('0xe'),auth[_0x633b('0x9')](),controller[_0x633b('0xf')]);router[_0x633b('0x10')]('/',auth[_0x633b('0x9')](),controller[_0x633b('0x11')]);router['put'](_0x633b('0xe'),auth[_0x633b('0x9')](),controller['update']);router[_0x633b('0x12')]('/:id',auth[_0x633b('0x9')](),controller[_0x633b('0x13')]);module[_0x633b('0x14')]=router; \ No newline at end of file +var _0xdced=['get','isAuthenticated','/describe','describe','post','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceTransferReport.controller'];(function(_0x263ba9,_0x45e341){var _0x50777a=function(_0x7ea5ee){while(--_0x7ea5ee){_0x263ba9['push'](_0x263ba9['shift']());}};_0x50777a(++_0x45e341);}(_0xdced,0x1ac));var _0xddce=function(_0x5e4424,_0xf1d263){_0x5e4424=_0x5e4424-0x0;var _0xc88ea9=_0xdced[_0x5e4424];return _0xc88ea9;};'use strict';var multer=require(_0xddce('0x0'));var util=require(_0xddce('0x1'));var path=require(_0xddce('0x2'));var timeout=require(_0xddce('0x3'));var express=require(_0xddce('0x4'));var router=express['Router']();var fs_extra=require(_0xddce('0x5'));var auth=require(_0xddce('0x6'));var interaction=require(_0xddce('0x7'));var config=require('../../config/environment');var controller=require(_0xddce('0x8'));router[_0xddce('0x9')]('/',auth[_0xddce('0xa')](),controller['index']);router['get'](_0xddce('0xb'),auth[_0xddce('0xa')](),controller[_0xddce('0xc')]);router[_0xddce('0x9')]('/:id',auth[_0xddce('0xa')](),controller['show']);router[_0xddce('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xddce('0xe')](_0xddce('0xf'),auth[_0xddce('0xa')](),controller[_0xddce('0x10')]);router['delete'](_0xddce('0xf'),auth[_0xddce('0xa')](),controller[_0xddce('0x11')]);module[_0xddce('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index e07f65c..df048da 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 _0x00b9=['attended','STRING','Yes','sequelize','exports','ENUM','blind'];(function(_0x3eb1c1,_0x1bb418){var _0x53645a=function(_0x5824b8){while(--_0x5824b8){_0x3eb1c1['push'](_0x3eb1c1['shift']());}};_0x53645a(++_0x1bb418);}(_0x00b9,0x1ca));var _0x900b=function(_0x102fdd,_0x1c412){_0x102fdd=_0x102fdd-0x0;var _0x309f0c=_0x00b9[_0x102fdd];return _0x309f0c;};'use strict';var Sequelize=require(_0x900b('0x0'));var moment=require('moment');module[_0x900b('0x1')]={'type':{'type':Sequelize[_0x900b('0x2')](_0x900b('0x3'),_0x900b('0x4'))},'result':{'type':Sequelize[_0x900b('0x5')]},'transfererchannel':{'type':Sequelize['STRING']},'transferercalleridnum':{'type':Sequelize[_0x900b('0x5')]},'transferercalleridname':{'type':Sequelize[_0x900b('0x5')]},'transfererconnectedlinenum':{'type':Sequelize[_0x900b('0x5')]},'transfererconnectedlinename':{'type':Sequelize['STRING']},'transfereraccountcode':{'type':Sequelize[_0x900b('0x5')]},'transferercontext':{'type':Sequelize[_0x900b('0x5')]},'transfererexten':{'type':Sequelize['STRING']},'transfererlinkedid':{'type':Sequelize[_0x900b('0x5')]},'transfereechannel':{'type':Sequelize['STRING']},'transfereecalleridnum':{'type':Sequelize['STRING']},'transfereecalleridname':{'type':Sequelize['STRING']},'transfereeconnectedlinenum':{'type':Sequelize['STRING']},'transfereeconnectedlinename':{'type':Sequelize[_0x900b('0x5')]},'transfereeaccountcode':{'type':Sequelize['STRING']},'transfereecontext':{'type':Sequelize[_0x900b('0x5')]},'transfereeexten':{'type':Sequelize[_0x900b('0x5')]},'transfereelinkedid':{'type':Sequelize['STRING']},'isexternal':{'type':Sequelize['ENUM'](_0x900b('0x6'),'No')},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xdc45=['attended','STRING','Yes','exports','ENUM'];(function(_0xdb040b,_0x54e23e){var _0xaedb0b=function(_0x35aa3d){while(--_0x35aa3d){_0xdb040b['push'](_0xdb040b['shift']());}};_0xaedb0b(++_0x54e23e);}(_0xdc45,0xc1));var _0x5dc4=function(_0x22b3a3,_0x567578){_0x22b3a3=_0x22b3a3-0x0;var _0x11508e=_0xdc45[_0x22b3a3];return _0x11508e;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0x5dc4('0x0')]={'type':{'type':Sequelize[_0x5dc4('0x1')]('blind',_0x5dc4('0x2'))},'result':{'type':Sequelize[_0x5dc4('0x3')]},'transfererchannel':{'type':Sequelize['STRING']},'transferercalleridnum':{'type':Sequelize[_0x5dc4('0x3')]},'transferercalleridname':{'type':Sequelize[_0x5dc4('0x3')]},'transfererconnectedlinenum':{'type':Sequelize[_0x5dc4('0x3')]},'transfererconnectedlinename':{'type':Sequelize[_0x5dc4('0x3')]},'transfereraccountcode':{'type':Sequelize[_0x5dc4('0x3')]},'transferercontext':{'type':Sequelize[_0x5dc4('0x3')]},'transfererexten':{'type':Sequelize[_0x5dc4('0x3')]},'transfererlinkedid':{'type':Sequelize[_0x5dc4('0x3')]},'transfereechannel':{'type':Sequelize[_0x5dc4('0x3')]},'transfereecalleridnum':{'type':Sequelize[_0x5dc4('0x3')]},'transfereecalleridname':{'type':Sequelize[_0x5dc4('0x3')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x5dc4('0x3')]},'transfereeconnectedlinename':{'type':Sequelize[_0x5dc4('0x3')]},'transfereeaccountcode':{'type':Sequelize['STRING']},'transfereecontext':{'type':Sequelize['STRING']},'transfereeexten':{'type':Sequelize['STRING']},'transfereelinkedid':{'type':Sequelize['STRING']},'isexternal':{'type':Sequelize[_0x5dc4('0x1')](_0x5dc4('0x4'),'No')},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x5dc4('0x3')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index b60245d..9562f66 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 _0x647f=['reject','save','update','destroy','then','error','stack','name','index','map','VoiceTransferReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','create','body','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','undefined','limit','count','offset','set','Content-Range','json','apply'];(function(_0x4a8c1d,_0x4c717a){var _0x95d97d=function(_0x39f596){while(--_0x39f596){_0x4a8c1d['push'](_0x4a8c1d['shift']());}};_0x95d97d(++_0x4c717a);}(_0x647f,0xbf));var _0xf647=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x647f[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf647('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf647('0x1'));var rp=require(_0xf647('0x2'));var moment=require(_0xf647('0x3'));var BPromise=require(_0xf647('0x4'));var Mustache=require('mustache');var util=require(_0xf647('0x5'));var path=require(_0xf647('0x6'));var sox=require(_0xf647('0x7'));var csv=require(_0xf647('0x8'));var ejs=require(_0xf647('0x9'));var fs=require('fs');var fs_extra=require(_0xf647('0xa'));var _=require(_0xf647('0xb'));var squel=require(_0xf647('0xc'));var crypto=require(_0xf647('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xf647('0xe'));var toCsv=require(_0xf647('0x8'));var querystring=require('querystring');var Papa=require(_0xf647('0xf'));var Redis=require(_0xf647('0x10'));var authService=require(_0xf647('0x11'));var qs=require(_0xf647('0x12'));var as=require(_0xf647('0x13'));var hardwareService=require(_0xf647('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xf647('0x15'));var config=require(_0xf647('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xf647('0x17'))['db'];function respondWithStatusCode(_0x684d06,_0xb8f11c){_0xb8f11c=_0xb8f11c||0xcc;return function(_0x3b2e0e){if(_0x3b2e0e){return _0x684d06[_0xf647('0x18')](_0xb8f11c);}return _0x684d06[_0xf647('0x19')](_0xb8f11c)['end']();};}function respondWithResult(_0x3e7532,_0x36a4a3){_0x36a4a3=_0x36a4a3||0xc8;return function(_0x4a513c){if(_0x4a513c){return _0x3e7532[_0xf647('0x19')](_0x36a4a3)['json'](_0x4a513c);}};}function respondWithFilteredResult(_0x250829,_0x59fa7d){return function(_0x43973f){if(_0x43973f){var _0x285627=typeof _0x59fa7d['offset']===_0xf647('0x1a')&&typeof _0x59fa7d[_0xf647('0x1b')]===_0xf647('0x1a');var _0x1c4a89=_0x43973f[_0xf647('0x1c')];var _0x2ea07f=_0x285627?0x0:_0x59fa7d[_0xf647('0x1d')];var _0x194b4a=_0x285627?_0x43973f[_0xf647('0x1c')]:_0x59fa7d[_0xf647('0x1d')]+_0x59fa7d['limit'];var _0x8e5ed3;if(_0x194b4a>=_0x1c4a89){_0x194b4a=_0x1c4a89;_0x8e5ed3=0xc8;}else{_0x8e5ed3=0xce;}_0x250829['status'](_0x8e5ed3);return _0x250829[_0xf647('0x1e')](_0xf647('0x1f'),_0x2ea07f+'-'+_0x194b4a+'/'+_0x1c4a89)[_0xf647('0x20')](_0x43973f);}return null;};}function patchUpdates(_0x1ee344){return function(_0x1f1fa0){try{jsonpatch[_0xf647('0x21')](_0x1f1fa0,_0x1ee344,!![]);}catch(_0x4f7d18){return BPromise[_0xf647('0x22')](_0x4f7d18);}return _0x1f1fa0[_0xf647('0x23')]();};}function saveUpdates(_0x2c1777,_0x59fa46){return function(_0x624f77){if(_0x624f77){return _0x624f77[_0xf647('0x24')](_0x2c1777)['then'](function(_0x1fd7dc){return _0x1fd7dc;});}return null;};}function removeEntity(_0x13fb7f,_0x32fed1){return function(_0x55cbda){if(_0x55cbda){return _0x55cbda[_0xf647('0x25')]()[_0xf647('0x26')](function(){_0x13fb7f[_0xf647('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0xa04f71,_0x197123){return function(_0x47e450){if(!_0x47e450){_0xa04f71[_0xf647('0x18')](0x194);}return _0x47e450;};}function handleError(_0xdf7168,_0xb34871){_0xb34871=_0xb34871||0x1f4;return function(_0x190056){logger[_0xf647('0x27')](_0x190056[_0xf647('0x28')]);if(_0x190056[_0xf647('0x29')]){delete _0x190056['name'];}_0xdf7168[_0xf647('0x19')](_0xb34871)['send'](_0x190056);};}exports[_0xf647('0x2a')]=function(_0x467173,_0xa21983){var _0x18f761={},_0x4b08cd={},_0x32e283={'count':0x0,'rows':[]};var _0x4c156e=_[_0xf647('0x2b')](db[_0xf647('0x2c')][_0xf647('0x2d')],function(_0x429b60){return{'name':_0x429b60[_0xf647('0x2e')],'type':_0x429b60[_0xf647('0x2f')][_0xf647('0x30')]};});_0x4b08cd['model']=_[_0xf647('0x2b')](_0x4c156e,'name');_0x4b08cd[_0xf647('0x31')]=_[_0xf647('0x32')](_0x467173[_0xf647('0x31')]);_0x4b08cd[_0xf647('0x33')]=_[_0xf647('0x34')](_0x4b08cd[_0xf647('0x35')],_0x4b08cd[_0xf647('0x31')]);_0x18f761[_0xf647('0x36')]=_[_0xf647('0x34')](_0x4b08cd[_0xf647('0x35')],qs[_0xf647('0x37')](_0x467173['query']['fields']));_0x18f761[_0xf647('0x36')]=_0x18f761[_0xf647('0x36')][_0xf647('0x38')]?_0x18f761[_0xf647('0x36')]:_0x4b08cd[_0xf647('0x35')];if(!_0x467173[_0xf647('0x31')]['hasOwnProperty'](_0xf647('0x39'))){_0x18f761[_0xf647('0x1b')]=qs[_0xf647('0x1b')](_0x467173['query']['limit']);_0x18f761[_0xf647('0x1d')]=qs[_0xf647('0x1d')](_0x467173['query'][_0xf647('0x1d')]);}_0x18f761[_0xf647('0x3a')]=qs[_0xf647('0x3b')](_0x467173[_0xf647('0x31')][_0xf647('0x3b')]);_0x18f761[_0xf647('0x3c')]=qs[_0xf647('0x33')](_[_0xf647('0x3d')](_0x467173[_0xf647('0x31')],_0x4b08cd[_0xf647('0x33')]),_0x4c156e);if(_0x467173[_0xf647('0x31')][_0xf647('0x3e')]){_0x18f761[_0xf647('0x3c')]=_[_0xf647('0x3f')](_0x18f761['where'],{'$or':_[_0xf647('0x2b')](_0x4c156e,function(_0x219b07){if(_0x219b07[_0xf647('0x2f')]!==_0xf647('0x40')){var _0x3cb238={};_0x3cb238[_0x219b07[_0xf647('0x29')]]={'$like':'%'+_0x467173[_0xf647('0x31')]['filter']+'%'};return _0x3cb238;}})});}_0x18f761=_[_0xf647('0x3f')]({},_0x18f761,_0x467173[_0xf647('0x41')]);var _0x3dd640={'where':_0x18f761['where']};return db[_0xf647('0x2c')]['count'](_0x3dd640)[_0xf647('0x26')](function(_0xfabce8){_0x32e283['count']=_0xfabce8;if(_0x467173[_0xf647('0x31')][_0xf647('0x42')]){_0x18f761[_0xf647('0x43')]=[{'all':!![]}];}return db[_0xf647('0x2c')][_0xf647('0x44')](_0x18f761);})[_0xf647('0x26')](function(_0x381eb5){_0x32e283[_0xf647('0x45')]=_0x381eb5;return _0x32e283;})['then'](respondWithFilteredResult(_0xa21983,_0x18f761))[_0xf647('0x46')](handleError(_0xa21983,null));};exports['show']=function(_0x1f935b,_0x52f562){var _0x1159b7={'raw':!![],'where':{'id':_0x1f935b[_0xf647('0x47')]['id']}},_0x4f28f5={};_0x4f28f5['model']=_[_0xf647('0x32')](db[_0xf647('0x2c')][_0xf647('0x2d')]);_0x4f28f5[_0xf647('0x31')]=_[_0xf647('0x32')](_0x1f935b[_0xf647('0x31')]);_0x4f28f5['filters']=_[_0xf647('0x34')](_0x4f28f5[_0xf647('0x35')],_0x4f28f5[_0xf647('0x31')]);_0x1159b7[_0xf647('0x36')]=_['intersection'](_0x4f28f5[_0xf647('0x35')],qs[_0xf647('0x37')](_0x1f935b[_0xf647('0x31')][_0xf647('0x37')]));_0x1159b7[_0xf647('0x36')]=_0x1159b7[_0xf647('0x36')][_0xf647('0x38')]?_0x1159b7[_0xf647('0x36')]:_0x4f28f5['model'];if(_0x1f935b[_0xf647('0x31')][_0xf647('0x42')]){_0x1159b7[_0xf647('0x43')]=[{'all':!![]}];}_0x1159b7=_[_0xf647('0x3f')]({},_0x1159b7,_0x1f935b[_0xf647('0x41')]);return db[_0xf647('0x2c')][_0xf647('0x48')](_0x1159b7)['then'](handleEntityNotFound(_0x52f562,null))['then'](respondWithResult(_0x52f562,null))[_0xf647('0x46')](handleError(_0x52f562,null));};exports[_0xf647('0x49')]=function(_0x3cf8c5,_0xee65f5){return db['VoiceTransferReport'][_0xf647('0x49')](_0x3cf8c5['body'],{})[_0xf647('0x26')](respondWithResult(_0xee65f5,0xc9))[_0xf647('0x46')](handleError(_0xee65f5,null));};exports['update']=function(_0x521601,_0x4de279){if(_0x521601[_0xf647('0x4a')]['id']){delete _0x521601[_0xf647('0x4a')]['id'];}return db[_0xf647('0x2c')][_0xf647('0x48')]({'where':{'id':_0x521601['params']['id']}})[_0xf647('0x26')](handleEntityNotFound(_0x4de279,null))[_0xf647('0x26')](saveUpdates(_0x521601[_0xf647('0x4a')],null))[_0xf647('0x26')](respondWithResult(_0x4de279,null))[_0xf647('0x46')](handleError(_0x4de279,null));};exports['destroy']=function(_0x47e7d3,_0x39d066){return db[_0xf647('0x2c')][_0xf647('0x48')]({'where':{'id':_0x47e7d3[_0xf647('0x47')]['id']}})[_0xf647('0x26')](handleEntityNotFound(_0x39d066,null))[_0xf647('0x26')](removeEntity(_0x39d066,null))[_0xf647('0x46')](handleError(_0x39d066,null));};exports['describe']=function(_0x386c12,_0x1466b1){return db['VoiceTransferReport']['describe']()[_0xf647('0x26')](respondWithResult(_0x1466b1,null))['catch'](handleError(_0x1466b1,null));}; \ No newline at end of file +var _0x441d=['rows','show','params','find','catch','create','update','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','save','destroy','error','stack','name','send','VoiceTransferReport','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','then','includeAll','include','findAll'];(function(_0x30d341,_0x107f86){var _0x30ab6b=function(_0x459911){while(--_0x459911){_0x30d341['push'](_0x30d341['shift']());}};_0x30ab6b(++_0x107f86);}(_0x441d,0x145));var _0xd441=function(_0x5acb9c,_0x36a761){_0x5acb9c=_0x5acb9c-0x0;var _0x543439=_0x441d[_0x5acb9c];return _0x543439;};'use strict';var emlformat=require(_0xd441('0x0'));var rimraf=require(_0xd441('0x1'));var zipdir=require(_0xd441('0x2'));var jsonpatch=require(_0xd441('0x3'));var rp=require(_0xd441('0x4'));var moment=require(_0xd441('0x5'));var BPromise=require(_0xd441('0x6'));var Mustache=require(_0xd441('0x7'));var util=require(_0xd441('0x8'));var path=require(_0xd441('0x9'));var sox=require(_0xd441('0xa'));var csv=require('to-csv');var ejs=require(_0xd441('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd441('0xc'));var squel=require(_0xd441('0xd'));var crypto=require(_0xd441('0xe'));var jsforce=require(_0xd441('0xf'));var deskjs=require(_0xd441('0x10'));var toCsv=require(_0xd441('0x11'));var querystring=require('querystring');var Papa=require(_0xd441('0x12'));var Redis=require(_0xd441('0x13'));var authService=require(_0xd441('0x14'));var qs=require(_0xd441('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd441('0x16'));var logger=require(_0xd441('0x17'))(_0xd441('0x18'));var utils=require(_0xd441('0x19'));var config=require(_0xd441('0x1a'));var licenseUtil=require(_0xd441('0x1b'));var db=require(_0xd441('0x1c'))['db'];function respondWithStatusCode(_0xf91d78,_0x41c7ff){_0x41c7ff=_0x41c7ff||0xcc;return function(_0x27b145){if(_0x27b145){return _0xf91d78[_0xd441('0x1d')](_0x41c7ff);}return _0xf91d78[_0xd441('0x1e')](_0x41c7ff)[_0xd441('0x1f')]();};}function respondWithResult(_0x408796,_0x1d2180){_0x1d2180=_0x1d2180||0xc8;return function(_0x5f5d5b){if(_0x5f5d5b){return _0x408796[_0xd441('0x1e')](_0x1d2180)['json'](_0x5f5d5b);}};}function respondWithFilteredResult(_0x3b15e9,_0x33f5b5){return function(_0x20f272){if(_0x20f272){var _0x1b6490=typeof _0x33f5b5[_0xd441('0x20')]===_0xd441('0x21')&&typeof _0x33f5b5[_0xd441('0x22')]===_0xd441('0x21');var _0x2cd083=_0x20f272[_0xd441('0x23')];var _0x1de0f3=_0x1b6490?0x0:_0x33f5b5[_0xd441('0x20')];var _0x3e54f5=_0x1b6490?_0x20f272['count']:_0x33f5b5[_0xd441('0x20')]+_0x33f5b5[_0xd441('0x22')];var _0x100f06;if(_0x3e54f5>=_0x2cd083){_0x3e54f5=_0x2cd083;_0x100f06=0xc8;}else{_0x100f06=0xce;}_0x3b15e9['status'](_0x100f06);return _0x3b15e9[_0xd441('0x24')](_0xd441('0x25'),_0x1de0f3+'-'+_0x3e54f5+'/'+_0x2cd083)['json'](_0x20f272);}return null;};}function patchUpdates(_0x16d918){return function(_0x2c0c3f){try{jsonpatch[_0xd441('0x26')](_0x2c0c3f,_0x16d918,!![]);}catch(_0x1acc2a){return BPromise['reject'](_0x1acc2a);}return _0x2c0c3f[_0xd441('0x27')]();};}function saveUpdates(_0x20fb15,_0x407b19){return function(_0x2419ba){if(_0x2419ba){return _0x2419ba['update'](_0x20fb15)['then'](function(_0x57b92f){return _0x57b92f;});}return null;};}function removeEntity(_0x2b3c78,_0x5d6925){return function(_0x1095d4){if(_0x1095d4){return _0x1095d4[_0xd441('0x28')]()['then'](function(){_0x2b3c78[_0xd441('0x1e')](0xcc)[_0xd441('0x1f')]();});}};}function handleEntityNotFound(_0x37a3a5,_0x3dcac0){return function(_0x2a6cce){if(!_0x2a6cce){_0x37a3a5['sendStatus'](0x194);}return _0x2a6cce;};}function handleError(_0x1b2de6,_0x820752){_0x820752=_0x820752||0x1f4;return function(_0x38a960){logger[_0xd441('0x29')](_0x38a960[_0xd441('0x2a')]);if(_0x38a960[_0xd441('0x2b')]){delete _0x38a960[_0xd441('0x2b')];}_0x1b2de6[_0xd441('0x1e')](_0x820752)[_0xd441('0x2c')](_0x38a960);};}exports['index']=function(_0x77274,_0x4cb33c){var _0x492441={},_0x3906a2={},_0xf02a9e={'count':0x0,'rows':[]};var _0x25bd79=_['map'](db[_0xd441('0x2d')][_0xd441('0x2e')],function(_0xfa7161){return{'name':_0xfa7161[_0xd441('0x2f')],'type':_0xfa7161['type'][_0xd441('0x30')]};});_0x3906a2[_0xd441('0x31')]=_[_0xd441('0x32')](_0x25bd79,_0xd441('0x2b'));_0x3906a2[_0xd441('0x33')]=_[_0xd441('0x34')](_0x77274['query']);_0x3906a2[_0xd441('0x35')]=_['intersection'](_0x3906a2['model'],_0x3906a2['query']);_0x492441['attributes']=_[_0xd441('0x36')](_0x3906a2[_0xd441('0x31')],qs['fields'](_0x77274[_0xd441('0x33')][_0xd441('0x37')]));_0x492441[_0xd441('0x38')]=_0x492441['attributes'][_0xd441('0x39')]?_0x492441[_0xd441('0x38')]:_0x3906a2[_0xd441('0x31')];if(!_0x77274[_0xd441('0x33')][_0xd441('0x3a')](_0xd441('0x3b'))){_0x492441[_0xd441('0x22')]=qs['limit'](_0x77274[_0xd441('0x33')][_0xd441('0x22')]);_0x492441['offset']=qs['offset'](_0x77274['query'][_0xd441('0x20')]);}_0x492441[_0xd441('0x3c')]=qs['sort'](_0x77274[_0xd441('0x33')][_0xd441('0x3d')]);_0x492441[_0xd441('0x3e')]=qs['filters'](_['pick'](_0x77274['query'],_0x3906a2[_0xd441('0x35')]),_0x25bd79);if(_0x77274[_0xd441('0x33')][_0xd441('0x3f')]){_0x492441[_0xd441('0x3e')]=_[_0xd441('0x40')](_0x492441[_0xd441('0x3e')],{'$or':_['map'](_0x25bd79,function(_0x50a986){if(_0x50a986['type']!=='VIRTUAL'){var _0x499dd0={};_0x499dd0[_0x50a986[_0xd441('0x2b')]]={'$like':'%'+_0x77274['query'][_0xd441('0x3f')]+'%'};return _0x499dd0;}})});}_0x492441=_[_0xd441('0x40')]({},_0x492441,_0x77274[_0xd441('0x41')]);var _0x496b90={'where':_0x492441[_0xd441('0x3e')]};return db[_0xd441('0x2d')][_0xd441('0x23')](_0x496b90)[_0xd441('0x42')](function(_0x5b3ab6){_0xf02a9e['count']=_0x5b3ab6;if(_0x77274['query'][_0xd441('0x43')]){_0x492441[_0xd441('0x44')]=[{'all':!![]}];}return db[_0xd441('0x2d')][_0xd441('0x45')](_0x492441);})['then'](function(_0x700a20){_0xf02a9e[_0xd441('0x46')]=_0x700a20;return _0xf02a9e;})[_0xd441('0x42')](respondWithFilteredResult(_0x4cb33c,_0x492441))['catch'](handleError(_0x4cb33c,null));};exports[_0xd441('0x47')]=function(_0x2530f9,_0x41de40){var _0x4a0d6a={'raw':!![],'where':{'id':_0x2530f9[_0xd441('0x48')]['id']}},_0x5038e5={};_0x5038e5[_0xd441('0x31')]=_[_0xd441('0x34')](db[_0xd441('0x2d')][_0xd441('0x2e')]);_0x5038e5[_0xd441('0x33')]=_[_0xd441('0x34')](_0x2530f9[_0xd441('0x33')]);_0x5038e5[_0xd441('0x35')]=_[_0xd441('0x36')](_0x5038e5[_0xd441('0x31')],_0x5038e5[_0xd441('0x33')]);_0x4a0d6a[_0xd441('0x38')]=_['intersection'](_0x5038e5[_0xd441('0x31')],qs[_0xd441('0x37')](_0x2530f9['query'][_0xd441('0x37')]));_0x4a0d6a[_0xd441('0x38')]=_0x4a0d6a[_0xd441('0x38')][_0xd441('0x39')]?_0x4a0d6a[_0xd441('0x38')]:_0x5038e5[_0xd441('0x31')];if(_0x2530f9[_0xd441('0x33')][_0xd441('0x43')]){_0x4a0d6a[_0xd441('0x44')]=[{'all':!![]}];}_0x4a0d6a=_[_0xd441('0x40')]({},_0x4a0d6a,_0x2530f9['options']);return db[_0xd441('0x2d')][_0xd441('0x49')](_0x4a0d6a)[_0xd441('0x42')](handleEntityNotFound(_0x41de40,null))[_0xd441('0x42')](respondWithResult(_0x41de40,null))[_0xd441('0x4a')](handleError(_0x41de40,null));};exports[_0xd441('0x4b')]=function(_0x499f54,_0x44814d){return db[_0xd441('0x2d')]['create'](_0x499f54['body'],{})[_0xd441('0x42')](respondWithResult(_0x44814d,0xc9))[_0xd441('0x4a')](handleError(_0x44814d,null));};exports[_0xd441('0x4c')]=function(_0x190690,_0x681cba){if(_0x190690[_0xd441('0x4d')]['id']){delete _0x190690[_0xd441('0x4d')]['id'];}return db[_0xd441('0x2d')][_0xd441('0x49')]({'where':{'id':_0x190690[_0xd441('0x48')]['id']}})[_0xd441('0x42')](handleEntityNotFound(_0x681cba,null))['then'](saveUpdates(_0x190690[_0xd441('0x4d')],null))['then'](respondWithResult(_0x681cba,null))[_0xd441('0x4a')](handleError(_0x681cba,null));};exports['destroy']=function(_0x66d20b,_0x7a471a){return db[_0xd441('0x2d')][_0xd441('0x49')]({'where':{'id':_0x66d20b[_0xd441('0x48')]['id']}})['then'](handleEntityNotFound(_0x7a471a,null))['then'](removeEntity(_0x7a471a,null))[_0xd441('0x4a')](handleError(_0x7a471a,null));};exports[_0xd441('0x4e')]=function(_0x49e515,_0xf76cfe){return db[_0xd441('0x2d')][_0xd441('0x4e')]()[_0xd441('0x42')](respondWithResult(_0xf76cfe,null))[_0xd441('0x4a')](handleError(_0xf76cfe,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index c2dc92a..912a1fd 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 _0x1385=['request-promise','path','rimraf','../../config/environment','exports','define','VoiceTransferReport','report_call_transfer','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x5a6f32,_0x58b204){var _0x18c961=function(_0x2b7dc2){while(--_0x2b7dc2){_0x5a6f32['push'](_0x5a6f32['shift']());}};_0x18c961(++_0x58b204);}(_0x1385,0x174));var _0x5138=function(_0x1ea773,_0x133cc8){_0x1ea773=_0x1ea773-0x0;var _0x5b9e2f=_0x1385[_0x1ea773];return _0x5b9e2f;};'use strict';var _=require(_0x5138('0x0'));var util=require(_0x5138('0x1'));var logger=require(_0x5138('0x2'))(_0x5138('0x3'));var moment=require(_0x5138('0x4'));var BPromise=require(_0x5138('0x5'));var rp=require(_0x5138('0x6'));var fs=require('fs');var path=require(_0x5138('0x7'));var rimraf=require(_0x5138('0x8'));var config=require(_0x5138('0x9'));var attributes=require('./voiceTransferReport.attributes');module[_0x5138('0xa')]=function(_0x50c22d,_0x2a707c){return _0x50c22d[_0x5138('0xb')](_0x5138('0xc'),attributes,{'tableName':_0x5138('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x46a8=['../../config/environment','exports','define','VoiceTransferReport','report_call_transfer','util','../../config/logger','api','path','rimraf'];(function(_0x4200d1,_0x724d52){var _0x616187=function(_0x4409ce){while(--_0x4409ce){_0x4200d1['push'](_0x4200d1['shift']());}};_0x616187(++_0x724d52);}(_0x46a8,0x11d));var _0x846a=function(_0x3a5d2f,_0xfec304){_0x3a5d2f=_0x3a5d2f-0x0;var _0x5ac002=_0x46a8[_0x3a5d2f];return _0x5ac002;};'use strict';var _=require('lodash');var util=require(_0x846a('0x0'));var logger=require(_0x846a('0x1'))(_0x846a('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x846a('0x3'));var rimraf=require(_0x846a('0x4'));var config=require(_0x846a('0x5'));var attributes=require('./voiceTransferReport.attributes');module[_0x846a('0x6')]=function(_0x15a165,_0x4a6098){return _0x15a165[_0x846a('0x7')](_0x846a('0x8'),attributes,{'tableName':_0x846a('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 3758fe6..219958c 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 _0xc48f=['catch','CreateVoiceTransferReport','VoiceTransferReport','create','body','options','raw','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','error','message','info'];(function(_0x48a928,_0x430727){var _0x11c1e9=function(_0x338805){while(--_0x338805){_0x48a928['push'](_0x48a928['shift']());}};_0x11c1e9(++_0x430727);}(_0xc48f,0x19e));var _0xfc48=function(_0x12dafa,_0x51ce5){_0x12dafa=_0x12dafa-0x0;var _0x1f3784=_0xc48f[_0x12dafa];return _0x1f3784;};'use strict';var _=require(_0xfc48('0x0'));var util=require(_0xfc48('0x1'));var moment=require(_0xfc48('0x2'));var BPromise=require(_0xfc48('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfc48('0x4'));var db=require(_0xfc48('0x5'))['db'];var utils=require(_0xfc48('0x6'));var logger=require(_0xfc48('0x7'))(_0xfc48('0x8'));var config=require(_0xfc48('0x9'));var jayson=require(_0xfc48('0xa'));var client=jayson[_0xfc48('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x35849b,_0x1e10a9,_0x3deacc){return new BPromise(function(_0x1a968e,_0x3bc446){return client[_0xfc48('0xc')](_0x35849b,_0x3deacc)[_0xfc48('0xd')](function(_0xd7bbe0){logger['info'](_0xfc48('0xe'),_0x1e10a9,_0xfc48('0xf'));logger[_0xfc48('0x10')](_0xfc48('0x11'),_0x1e10a9,_0xfc48('0xf'),JSON['stringify'](_0xd7bbe0));if(_0xd7bbe0[_0xfc48('0x12')]){if(_0xd7bbe0['error']['code']===0x1f4){logger[_0xfc48('0x12')](_0xfc48('0xe'),_0x1e10a9,_0xd7bbe0[_0xfc48('0x12')][_0xfc48('0x13')]);return _0x3bc446(_0xd7bbe0[_0xfc48('0x12')][_0xfc48('0x13')]);}logger[_0xfc48('0x12')](_0xfc48('0xe'),_0x1e10a9,_0xd7bbe0[_0xfc48('0x12')][_0xfc48('0x13')]);return _0x1a968e(_0xd7bbe0[_0xfc48('0x12')][_0xfc48('0x13')]);}else{logger[_0xfc48('0x14')]('VoiceTransferReport,\x20%s,\x20%s',_0x1e10a9,_0xfc48('0xf'));_0x1a968e(_0xd7bbe0['result'][_0xfc48('0x13')]);}})[_0xfc48('0x15')](function(_0x4f5e30){logger[_0xfc48('0x12')](_0xfc48('0xe'),_0x1e10a9,_0x4f5e30);_0x3bc446(_0x4f5e30);});});}exports[_0xfc48('0x16')]=function(_0x478bd2){var _0x251b3c=this;return new Promise(function(_0x1fe606,_0x168882){return db[_0xfc48('0x17')][_0xfc48('0x18')](_0x478bd2[_0xfc48('0x19')],{'raw':_0x478bd2['options']?_0x478bd2[_0xfc48('0x1a')][_0xfc48('0x1b')]===undefined?!![]:![]:!![]})[_0xfc48('0xd')](function(_0x340134){logger[_0xfc48('0x14')](_0xfc48('0x16'),_0x478bd2);logger[_0xfc48('0x10')]('CreateVoiceTransferReport',_0x478bd2,JSON[_0xfc48('0x1c')](_0x340134));_0x1fe606(_0x340134);})[_0xfc48('0x15')](function(_0x3cd57f){logger[_0xfc48('0x12')]('CreateVoiceTransferReport',_0x3cd57f[_0xfc48('0x13')],_0x478bd2);_0x168882(_0x251b3c[_0xfc48('0x12')](0x1f4,_0x3cd57f[_0xfc48('0x13')]));});});}; \ No newline at end of file +var _0x3b1a=['jayson/promise','client','http','request','then','VoiceTransferReport,\x20%s,\x20%s','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','VoiceTransferReport','body','options','raw','CreateVoiceTransferReport','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x255777,_0xd75713){var _0x3a312b=function(_0x18927e){while(--_0x18927e){_0x255777['push'](_0x255777['shift']());}};_0x3a312b(++_0xd75713);}(_0x3b1a,0x122));var _0xa3b1=function(_0x4b6f5c,_0x56f7ce){_0x4b6f5c=_0x4b6f5c-0x0;var _0x55548b=_0x3b1a[_0x4b6f5c];return _0x55548b;};'use strict';var _=require('lodash');var util=require(_0xa3b1('0x0'));var moment=require('moment');var BPromise=require(_0xa3b1('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa3b1('0x2'));var db=require(_0xa3b1('0x3'))['db'];var utils=require(_0xa3b1('0x4'));var logger=require(_0xa3b1('0x5'))('rpc');var config=require(_0xa3b1('0x6'));var jayson=require(_0xa3b1('0x7'));var client=jayson[_0xa3b1('0x8')][_0xa3b1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x49c677,_0x59b564,_0x4f2a0e){return new BPromise(function(_0x32f0b6,_0x5d4e1f){return client[_0xa3b1('0xa')](_0x49c677,_0x4f2a0e)[_0xa3b1('0xb')](function(_0x437f04){logger['info'](_0xa3b1('0xc'),_0x59b564,'request\x20sent');logger[_0xa3b1('0xd')](_0xa3b1('0xe'),_0x59b564,_0xa3b1('0xf'),JSON[_0xa3b1('0x10')](_0x437f04));if(_0x437f04[_0xa3b1('0x11')]){if(_0x437f04[_0xa3b1('0x11')]['code']===0x1f4){logger['error'](_0xa3b1('0xc'),_0x59b564,_0x437f04[_0xa3b1('0x11')][_0xa3b1('0x12')]);return _0x5d4e1f(_0x437f04['error'][_0xa3b1('0x12')]);}logger['error']('VoiceTransferReport,\x20%s,\x20%s',_0x59b564,_0x437f04[_0xa3b1('0x11')][_0xa3b1('0x12')]);return _0x32f0b6(_0x437f04[_0xa3b1('0x11')][_0xa3b1('0x12')]);}else{logger[_0xa3b1('0x13')](_0xa3b1('0xc'),_0x59b564,_0xa3b1('0xf'));_0x32f0b6(_0x437f04[_0xa3b1('0x14')][_0xa3b1('0x12')]);}})['catch'](function(_0x17248c){logger['error'](_0xa3b1('0xc'),_0x59b564,_0x17248c);_0x5d4e1f(_0x17248c);});});}exports['CreateVoiceTransferReport']=function(_0x1128b4){var _0x3dd6ee=this;return new Promise(function(_0x5e08c1,_0x7b2d1f){return db[_0xa3b1('0x15')]['create'](_0x1128b4[_0xa3b1('0x16')],{'raw':_0x1128b4['options']?_0x1128b4[_0xa3b1('0x17')][_0xa3b1('0x18')]===undefined?!![]:![]:!![]})[_0xa3b1('0xb')](function(_0x37dbab){logger['info'](_0xa3b1('0x19'),_0x1128b4);logger[_0xa3b1('0xd')](_0xa3b1('0x19'),_0x1128b4,JSON[_0xa3b1('0x10')](_0x37dbab));_0x5e08c1(_0x37dbab);})[_0xa3b1('0x1a')](function(_0x168d3a){logger[_0xa3b1('0x11')](_0xa3b1('0x19'),_0x168d3a['message'],_0x1128b4);_0x7b2d1f(_0x3dd6ee[_0xa3b1('0x11')](0x1f4,_0x168d3a[_0xa3b1('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index 3aa16b9..05f0f9e 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 _0xf4eb=['/hangup','isAuthenticated','isWebrtcLicence','hangup','/hold','hold','/unhold','unhold','/calls','calls','transfer','exports','express','/originate','originate','post'];(function(_0x208683,_0x26bbfa){var _0x21bc96=function(_0x5487a7){while(--_0x5487a7){_0x208683['push'](_0x208683['shift']());}};_0x21bc96(++_0x26bbfa);}(_0xf4eb,0xec));var _0xbf4e=function(_0x3e2d0d,_0x129175){_0x3e2d0d=_0x3e2d0d-0x0;var _0x122897=_0xf4eb[_0x3e2d0d];return _0x122897;};'use strict';var express=require(_0xbf4e('0x0'));var router=express['Router']();var auth=require('../../components/auth/service');var controller=require('./webbar.controller');router['post'](_0xbf4e('0x1'),auth['isAuthenticated'](),auth['isWebrtcLicence'](),controller[_0xbf4e('0x2')]);router[_0xbf4e('0x3')](_0xbf4e('0x4'),auth[_0xbf4e('0x5')](),auth[_0xbf4e('0x6')](),controller[_0xbf4e('0x7')]);router[_0xbf4e('0x3')]('/answer',auth[_0xbf4e('0x5')](),auth['isWebrtcLicence'](),controller['answer']);router[_0xbf4e('0x3')](_0xbf4e('0x8'),auth[_0xbf4e('0x5')](),auth[_0xbf4e('0x6')](),controller[_0xbf4e('0x9')]);router[_0xbf4e('0x3')](_0xbf4e('0xa'),auth['isAuthenticated'](),auth['isWebrtcLicence'](),controller[_0xbf4e('0xb')]);router['post'](_0xbf4e('0xc'),auth[_0xbf4e('0x5')](),auth['isWebrtcLicence'](),controller[_0xbf4e('0xd')]);router['post']('/transfer',auth[_0xbf4e('0x5')](),auth[_0xbf4e('0x6')](),controller[_0xbf4e('0xe')]);module[_0xbf4e('0xf')]=router; \ No newline at end of file +var _0xaa88=['/hold','/unhold','/calls','calls','transfer','express','Router','../../components/auth/service','./webbar.controller','/originate','isAuthenticated','isWebrtcLicence','originate','post','/hangup','hangup','/answer','answer'];(function(_0x541389,_0x15f173){var _0x5eaa0a=function(_0x555f3c){while(--_0x555f3c){_0x541389['push'](_0x541389['shift']());}};_0x5eaa0a(++_0x15f173);}(_0xaa88,0x137));var _0x8aa8=function(_0x387dc1,_0x3ba649){_0x387dc1=_0x387dc1-0x0;var _0x17567c=_0xaa88[_0x387dc1];return _0x17567c;};'use strict';var express=require(_0x8aa8('0x0'));var router=express[_0x8aa8('0x1')]();var auth=require(_0x8aa8('0x2'));var controller=require(_0x8aa8('0x3'));router['post'](_0x8aa8('0x4'),auth[_0x8aa8('0x5')](),auth[_0x8aa8('0x6')](),controller[_0x8aa8('0x7')]);router[_0x8aa8('0x8')](_0x8aa8('0x9'),auth['isAuthenticated'](),auth['isWebrtcLicence'](),controller[_0x8aa8('0xa')]);router['post'](_0x8aa8('0xb'),auth[_0x8aa8('0x5')](),auth[_0x8aa8('0x6')](),controller[_0x8aa8('0xc')]);router['post'](_0x8aa8('0xd'),auth[_0x8aa8('0x5')](),auth[_0x8aa8('0x6')](),controller['hold']);router[_0x8aa8('0x8')](_0x8aa8('0xe'),auth[_0x8aa8('0x5')](),auth[_0x8aa8('0x6')](),controller['unhold']);router[_0x8aa8('0x8')](_0x8aa8('0xf'),auth['isAuthenticated'](),auth[_0x8aa8('0x6')](),controller[_0x8aa8('0x10')]);router[_0x8aa8('0x8')]('/transfer',auth[_0x8aa8('0x5')](),auth[_0x8aa8('0x6')](),controller[_0x8aa8('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index b99f25c..b0f4f41 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 _0xadb8=['originate\x20fired:','body','json','userId','callNumber','callerId','entityFound:','format','user:%s','webbar:originate','originate\x20executed!','hangup','length','webbar:hangup','answer\x20fired:','answer\x20executed!','hold','hold\x20fired:','webbar:hold','hold\x20executed!','unhold','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls','filter','conference\x20fired:','webbar:conference','conference\x20executed!','transfer','webbar:transfer','transfer\x20executed!','../../mysqldb','util','bluebird','jayson/promise','client','http','../../config/logger','webbarapi','redis','defaults','localhost','socket.io-emitter','validate','callNumber\x20is\x20required','userId\x20is\x20required','string','number','sessionId\x20is\x20required','info','emit','handleError:','error','stack','name','status','send','request','then','message','result','catch','User','findOne','VoiceChannels','all','rows','UserId','sessionId','sessionId\x20','originate'];(function(_0x316cb9,_0xae8733){var _0x496599=function(_0x37f3bf){while(--_0x37f3bf){_0x316cb9['push'](_0x316cb9['shift']());}};_0x496599(++_0xae8733);}(_0xadb8,0x1d0));var _0x8adb=function(_0x1bf8f5,_0x28f62c){_0x1bf8f5=_0x1bf8f5-0x0;var _0x36a54e=_0xadb8[_0x1bf8f5];return _0x36a54e;};'use strict';var path=require('path');var fs=require('fs');var _=require('lodash');var db=require(_0x8adb('0x0'))['db'];var config=require('../../config/environment');var util=require(_0x8adb('0x1'));var BPromise=require(_0x8adb('0x2'));var jayson=require(_0x8adb('0x3'));var amiClient=jayson[_0x8adb('0x4')][_0x8adb('0x5')]({'port':0x232a});var logger=require(_0x8adb('0x6'))(_0x8adb('0x7'));var Redis=require('ioredis');config[_0x8adb('0x8')]=_[_0x8adb('0x9')](config[_0x8adb('0x8')],{'host':_0x8adb('0xa'),'port':0x18eb});var io=require(_0x8adb('0xb'))(new Redis(config[_0x8adb('0x8')]));var Schema=require(_0x8adb('0xc'));var originateValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'callNumber':{'type':'string','required':[!![],_0x8adb('0xd')]},'callerId':{'type':'string'},'callbackUrl':{'type':'string'}});var hangupValidation=new Schema({'userId':{'type':'number','required':[!![],_0x8adb('0xe')]},'sessionId':{'type':_0x8adb('0xf'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0x8adb('0x10'),'required':[!![],_0x8adb('0xe')]},'sessionId':{'type':_0x8adb('0xf'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0x8adb('0x10'),'required':[!![],_0x8adb('0xe')]},'sessionId':{'type':_0x8adb('0xf'),'required':[!![],_0x8adb('0x11')]},'transferNumber':{'type':_0x8adb('0xf'),'required':[!![],'transferNumber\x20is\x20required']}});var holdValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x8adb('0xf'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':'number','required':[!![],_0x8adb('0xe')]},'sessionId':{'type':_0x8adb('0xf'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x8adb('0x10'),'required':[!![],'userId\x20is\x20required']}});var conferenceValidation=new Schema({'userId':{'type':_0x8adb('0x10'),'required':[!![],_0x8adb('0xe')]}});function emit(_0x1096fb,_0x3f1ca7,_0x224e6c){logger[_0x8adb('0x12')](_0x1096fb,_0x3f1ca7,JSON['stringify'](_0x224e6c));io['to'](_0x1096fb)[_0x8adb('0x13')](_0x3f1ca7,_0x224e6c);}function handleError(_0xe8cfa5){return function(_0x4ba298){console['log'](_0x8adb('0x14'),_0x4ba298,_0x4ba298 instanceof RangeError);logger[_0x8adb('0x15')](_0x4ba298[_0x8adb('0x16')]);if(_0x4ba298 instanceof RangeError){if(_0x4ba298[_0x8adb('0x17')]){delete _0x4ba298[_0x8adb('0x17')];}_0xe8cfa5[_0x8adb('0x18')](0x194)[_0x8adb('0x19')](_0x4ba298);}else{if(_0x4ba298[_0x8adb('0x17')]){delete _0x4ba298[_0x8adb('0x17')];}_0xe8cfa5[_0x8adb('0x18')](0x1f4)[_0x8adb('0x19')](_0x4ba298);}};}function checkError(){return function(_0x190171){if(!_0x190171){throw new RangeError('NotFound');}return _0x190171;};}function respondWithRpcPromise(_0x548317,_0x24b31d){return new BPromise(function(_0x3d37db,_0x4f33e7){var _0x37b0a4=amiClient;return _0x37b0a4[_0x8adb('0x1a')](_0x548317,_0x24b31d)[_0x8adb('0x1b')](function(_0x184c2a){if(_0x184c2a[_0x8adb('0x15')]){if(_0x184c2a[_0x8adb('0x15')]['code']===0x1f4){return _0x4f33e7(_0x184c2a[_0x8adb('0x15')][_0x8adb('0x1c')]);}return _0x3d37db(_0x184c2a[_0x8adb('0x15')]['message']);}else{_0x3d37db(_0x184c2a[_0x8adb('0x1d')]);}})[_0x8adb('0x1e')](function(_0x2892bb){_0x4f33e7(_0x2892bb);});});}function getAgent(_0xd49f8f){return db[_0x8adb('0x1f')][_0x8adb('0x20')]({'where':{'id':_0xd49f8f,'role':'agent'}})[_0x8adb('0x1b')](checkError());}function getAgentCheckSession(_0x16f724,_0x18f94e){return new BPromise(function(_0x44f242,_0x42c6cc){var _0x4aca77=respondWithRpcPromise(_0x8adb('0x21'));var _0x5c5a7b=getAgent(_0x16f724);Promise[_0x8adb('0x22')]([_0x4aca77,_0x5c5a7b])[_0x8adb('0x1b')](function(_0x3e0ccf){var _0x824eda=_0x3e0ccf[0x0];var _0x48fd77=_0x3e0ccf[0x1];var _0x3ed9e9=_['filter'](_0x824eda[_0x8adb('0x23')],function(_0x1ac23e){return _0x1ac23e[_0x8adb('0x24')]==_0x48fd77['id']&&_0x1ac23e[_0x8adb('0x25')]==_0x18f94e;});if(_0x3ed9e9['length']==0x1){_0x44f242(_0x48fd77);}else{_0x42c6cc(new RangeError(_0x8adb('0x26')+_0x18f94e+'\x20not\x20found!'));}});});}exports[_0x8adb('0x27')]=function(_0x5ac5d5,_0x1d4962){logger[_0x8adb('0x12')](_0x8adb('0x28'),_0x5ac5d5[_0x8adb('0x29')]);var _0x309236=originateValidation[_0x8adb('0xc')](_0x5ac5d5['body']);if(_0x309236['length']>0x0){return _0x1d4962[_0x8adb('0x18')](0x190)[_0x8adb('0x2a')](_0x309236);}var _0x429d5a=_0x5ac5d5[_0x8adb('0x29')][_0x8adb('0x2b')];var _0x259137=_0x5ac5d5[_0x8adb('0x29')][_0x8adb('0x2c')];var _0x20a7d6=_0x5ac5d5[_0x8adb('0x29')][_0x8adb('0x2d')];var _0x3c4f7c=_0x5ac5d5[_0x8adb('0x29')]['callbackUrl'];return getAgent(_0x429d5a)[_0x8adb('0x1b')](function(_0x420ae0){logger['info'](_0x8adb('0x2e'),_0x420ae0['name']);emit(util[_0x8adb('0x2f')](_0x8adb('0x30'),_0x420ae0[_0x8adb('0x17')]),_0x8adb('0x31'),{'callNumber':_0x259137,'callerId':_0x20a7d6,'callbackUrl':_0x3c4f7c});return _0x1d4962[_0x8adb('0x18')](0xc8)['json']({'error':![],'message':_0x8adb('0x32')});})['catch'](handleError(_0x1d4962));};exports[_0x8adb('0x33')]=function(_0x374ef3,_0x4a1693){logger[_0x8adb('0x12')]('hangup\x20fired:',_0x374ef3[_0x8adb('0x29')]);var _0x494afd=hangupValidation[_0x8adb('0xc')](_0x374ef3[_0x8adb('0x29')]);if(_0x494afd[_0x8adb('0x34')]>0x0){return _0x4a1693['status'](0x190)['json'](_0x494afd);}var _0x182c4b=_0x374ef3[_0x8adb('0x29')]['userId'];var _0x1f6481=_0x374ef3[_0x8adb('0x29')][_0x8adb('0x25')];return getAgent(_0x182c4b)[_0x8adb('0x1b')](function(_0x922b58){logger[_0x8adb('0x12')](_0x8adb('0x2e'),_0x922b58[_0x8adb('0x17')]);emit(util['format']('user:%s',_0x922b58[_0x8adb('0x17')]),_0x8adb('0x35'),{'sessionId':_0x1f6481});return _0x4a1693[_0x8adb('0x18')](0xc8)[_0x8adb('0x2a')]({'error':![],'message':'hangup\x20executed!'});})[_0x8adb('0x1e')](handleError(_0x4a1693));};exports['answer']=function(_0x26abec,_0x32b764){logger[_0x8adb('0x12')](_0x8adb('0x36'),_0x26abec['body']);var _0x4ef5a3=answerValidation[_0x8adb('0xc')](_0x26abec['body']);if(_0x4ef5a3[_0x8adb('0x34')]>0x0){return _0x32b764['status'](0x190)['json'](_0x4ef5a3);}var _0x18984a=_0x26abec[_0x8adb('0x29')]['userId'];var _0x3fb9e0=_0x26abec[_0x8adb('0x29')][_0x8adb('0x25')];return getAgent(_0x18984a)[_0x8adb('0x1b')](function(_0x1f3934){logger['info'](_0x8adb('0x2e'),_0x1f3934['name']);emit(util[_0x8adb('0x2f')](_0x8adb('0x30'),_0x1f3934['name']),'webbar:answer',{'sessionId':_0x3fb9e0});return _0x32b764[_0x8adb('0x18')](0xc8)['json']({'error':![],'message':_0x8adb('0x37')});})[_0x8adb('0x1e')](handleError(_0x32b764));};exports[_0x8adb('0x38')]=function(_0x222f06,_0x5181ed){logger[_0x8adb('0x12')](_0x8adb('0x39'),_0x222f06['body']);var _0x5ba7a5=holdValidation[_0x8adb('0xc')](_0x222f06[_0x8adb('0x29')]);if(_0x5ba7a5[_0x8adb('0x34')]>0x0){return _0x5181ed['status'](0x190)[_0x8adb('0x2a')](_0x5ba7a5);}var _0x18c04f=_0x222f06[_0x8adb('0x29')][_0x8adb('0x2b')];var _0x2f6031=_0x222f06[_0x8adb('0x29')][_0x8adb('0x25')];return getAgent(_0x18c04f)[_0x8adb('0x1b')](function(_0xc2861b){logger[_0x8adb('0x12')](_0x8adb('0x2e'),_0xc2861b[_0x8adb('0x17')]);emit(util['format'](_0x8adb('0x30'),_0xc2861b[_0x8adb('0x17')]),_0x8adb('0x3a'),{'sessionId':_0x2f6031});return _0x5181ed[_0x8adb('0x18')](0xc8)[_0x8adb('0x2a')]({'error':![],'message':_0x8adb('0x3b')});})[_0x8adb('0x1e')](handleError(_0x5181ed));};exports[_0x8adb('0x3c')]=function(_0x276af8,_0x2033aa){logger['info'](_0x8adb('0x3d'),_0x276af8[_0x8adb('0x29')]);var _0x42d299=unholdValidation[_0x8adb('0xc')](_0x276af8[_0x8adb('0x29')]);if(_0x42d299[_0x8adb('0x34')]>0x0){return _0x2033aa[_0x8adb('0x18')](0x190)[_0x8adb('0x2a')](_0x42d299);}var _0x59aeb2=_0x276af8[_0x8adb('0x29')][_0x8adb('0x2b')];var _0x33f519=_0x276af8[_0x8adb('0x29')]['sessionId'];return getAgent(_0x59aeb2)[_0x8adb('0x1b')](function(_0x2c4e7e){logger[_0x8adb('0x12')](_0x8adb('0x2e'),_0x2c4e7e['name']);emit(util[_0x8adb('0x2f')](_0x8adb('0x30'),_0x2c4e7e[_0x8adb('0x17')]),_0x8adb('0x3e'),{'sessionId':_0x33f519});return _0x2033aa[_0x8adb('0x18')](0xc8)[_0x8adb('0x2a')]({'error':![],'message':_0x8adb('0x3f')});})[_0x8adb('0x1e')](handleError(_0x2033aa));};exports[_0x8adb('0x40')]=function(_0x253758,_0x404ba5){logger[_0x8adb('0x12')]('calls\x20fired:',_0x404ba5[_0x8adb('0x29')]);var _0x492a60=callsValidation['validate'](_0x253758[_0x8adb('0x29')]);if(_0x492a60[_0x8adb('0x34')]>0x0){return _0x404ba5['status'](0x190)[_0x8adb('0x2a')](_0x492a60);}var _0x37bdb4=_0x253758[_0x8adb('0x29')][_0x8adb('0x2b')];var _0x545a47=respondWithRpcPromise(_0x8adb('0x21'));var _0x509eec=getAgent(_0x37bdb4);return Promise[_0x8adb('0x22')]([_0x545a47,_0x509eec])[_0x8adb('0x1b')](function(_0x13bc21){var _0x47a2a4=_0x13bc21[0x0];var _0x3142c3=_0x13bc21[0x1];var _0x50dc53=_[_0x8adb('0x41')](_0x47a2a4[_0x8adb('0x23')],function(_0x43271b){return _0x43271b['UserId']==_0x3142c3['id'];});return _0x404ba5[_0x8adb('0x18')](0xc8)[_0x8adb('0x2a')]({'count':_0x50dc53[_0x8adb('0x34')],'rows':_0x50dc53});})[_0x8adb('0x1e')](handleError(_0x404ba5));};exports['conference']=function(_0x1a001e,_0x2bf6c8){logger['info'](_0x8adb('0x42'),_0x1a001e[_0x8adb('0x29')]);var _0x43730e=conferenceValidation['validate'](_0x1a001e[_0x8adb('0x29')]);if(_0x43730e[_0x8adb('0x34')]>0x0){return _0x2bf6c8[_0x8adb('0x18')](0x190)[_0x8adb('0x2a')](_0x43730e);}var _0x4d46b6=_0x1a001e[_0x8adb('0x29')]['userId'];return getAgent(_0x4d46b6)['then'](function(_0x4b658e){logger[_0x8adb('0x12')](_0x8adb('0x2e'),_0x4b658e[_0x8adb('0x17')]);emit(util['format'](_0x8adb('0x30'),_0x4b658e['name']),_0x8adb('0x43'));return _0x2bf6c8[_0x8adb('0x18')](0xc8)[_0x8adb('0x2a')]({'error':![],'message':_0x8adb('0x44')});})[_0x8adb('0x1e')](handleError(_0x2bf6c8));};exports[_0x8adb('0x45')]=function(_0x414448,_0xa04f70){logger[_0x8adb('0x12')]('transfer\x20fired:',_0x414448[_0x8adb('0x29')]);var _0x85f9ae=transferValidation[_0x8adb('0xc')](_0x414448[_0x8adb('0x29')]);if(_0x85f9ae['length']>0x0){return _0xa04f70[_0x8adb('0x18')](0x190)['json'](_0x85f9ae);}var _0x247d1e=_0x414448[_0x8adb('0x29')][_0x8adb('0x2b')];var _0x4121b8=_0x414448['body'][_0x8adb('0x25')];var _0x14c13b=_0x414448['body']['transferNumber'];return getAgent(_0x247d1e)['then'](function(_0x366b92){logger[_0x8adb('0x12')](_0x8adb('0x2e'),_0x366b92['name']);emit(util['format'](_0x8adb('0x30'),_0x366b92[_0x8adb('0x17')]),_0x8adb('0x46'),{'sessionId':_0x4121b8,'transferNumber':_0x14c13b});return _0xa04f70['status'](0xc8)[_0x8adb('0x2a')]({'error':![],'message':_0x8adb('0x47')});})[_0x8adb('0x1e')](handleError(_0xa04f70));}; \ No newline at end of file +var _0xc874=['filter','rows','UserId','sessionId','length','sessionId\x20','\x20not\x20found!','originate','originate\x20fired:','body','json','userId','callerId','callbackUrl','info','format','webbar:originate','originate\x20executed!','hangup','validate','webbar:hangup','hangup\x20executed!','answer','entityFound:','user:%s','webbar:answer','answer\x20executed!','hold\x20fired:','webbar:hold','hold\x20executed!','webbar:unhold','unhold\x20executed!','calls','calls\x20fired:','conference\x20fired:','conference\x20executed!','transfer','transfer\x20fired:','transferNumber','transfer\x20executed!','path','../../mysqldb','../../config/environment','jayson/promise','client','http','webbarapi','ioredis','defaults','redis','localhost','socket.io-emitter','number','string','callNumber\x20is\x20required','userId\x20is\x20required','sessionId\x20is\x20required','stringify','emit','log','error','stack','name','send','status','NotFound','request','then','code','message','result','catch','User','findOne','VoiceChannels'];(function(_0x1ba567,_0x33cfa0){var _0x21cd0a=function(_0xfb04dc){while(--_0xfb04dc){_0x1ba567['push'](_0x1ba567['shift']());}};_0x21cd0a(++_0x33cfa0);}(_0xc874,0x154));var _0x4c87=function(_0x146a97,_0x2d8483){_0x146a97=_0x146a97-0x0;var _0x259d5c=_0xc874[_0x146a97];return _0x259d5c;};'use strict';var path=require(_0x4c87('0x0'));var fs=require('fs');var _=require('lodash');var db=require(_0x4c87('0x1'))['db'];var config=require(_0x4c87('0x2'));var util=require('util');var BPromise=require('bluebird');var jayson=require(_0x4c87('0x3'));var amiClient=jayson[_0x4c87('0x4')][_0x4c87('0x5')]({'port':0x232a});var logger=require('../../config/logger')(_0x4c87('0x6'));var Redis=require(_0x4c87('0x7'));config['redis']=_[_0x4c87('0x8')](config[_0x4c87('0x9')],{'host':_0x4c87('0xa'),'port':0x18eb});var io=require(_0x4c87('0xb'))(new Redis(config[_0x4c87('0x9')]));var Schema=require('validate');var originateValidation=new Schema({'userId':{'type':_0x4c87('0xc'),'required':[!![],'userId\x20is\x20required']},'callNumber':{'type':_0x4c87('0xd'),'required':[!![],_0x4c87('0xe')]},'callerId':{'type':_0x4c87('0xd')},'callbackUrl':{'type':_0x4c87('0xd')}});var hangupValidation=new Schema({'userId':{'type':_0x4c87('0xc'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x4c87('0xd'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0x4c87('0xc'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x4c87('0xd'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0x4c87('0xc'),'required':[!![],_0x4c87('0xf')]},'sessionId':{'type':_0x4c87('0xd'),'required':[!![],_0x4c87('0x10')]},'transferNumber':{'type':'string','required':[!![],'transferNumber\x20is\x20required']}});var holdValidation=new Schema({'userId':{'type':'number','required':[!![],_0x4c87('0xf')]},'sessionId':{'type':_0x4c87('0xd'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x4c87('0xc'),'required':[!![],_0x4c87('0xf')]},'sessionId':{'type':_0x4c87('0xd'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x4c87('0xc'),'required':[!![],_0x4c87('0xf')]}});var conferenceValidation=new Schema({'userId':{'type':_0x4c87('0xc'),'required':[!![],'userId\x20is\x20required']}});function emit(_0x27abb9,_0x3c32cc,_0x585705){logger['info'](_0x27abb9,_0x3c32cc,JSON[_0x4c87('0x11')](_0x585705));io['to'](_0x27abb9)[_0x4c87('0x12')](_0x3c32cc,_0x585705);}function handleError(_0x2b55fa){return function(_0x547d92){console[_0x4c87('0x13')]('handleError:',_0x547d92,_0x547d92 instanceof RangeError);logger[_0x4c87('0x14')](_0x547d92[_0x4c87('0x15')]);if(_0x547d92 instanceof RangeError){if(_0x547d92[_0x4c87('0x16')]){delete _0x547d92[_0x4c87('0x16')];}_0x2b55fa['status'](0x194)[_0x4c87('0x17')](_0x547d92);}else{if(_0x547d92[_0x4c87('0x16')]){delete _0x547d92[_0x4c87('0x16')];}_0x2b55fa[_0x4c87('0x18')](0x1f4)[_0x4c87('0x17')](_0x547d92);}};}function checkError(){return function(_0x22fac7){if(!_0x22fac7){throw new RangeError(_0x4c87('0x19'));}return _0x22fac7;};}function respondWithRpcPromise(_0x9da0d6,_0x50289b){return new BPromise(function(_0x353ac9,_0x33aafd){var _0x5cc15d=amiClient;return _0x5cc15d[_0x4c87('0x1a')](_0x9da0d6,_0x50289b)[_0x4c87('0x1b')](function(_0x5a9496){if(_0x5a9496[_0x4c87('0x14')]){if(_0x5a9496[_0x4c87('0x14')][_0x4c87('0x1c')]===0x1f4){return _0x33aafd(_0x5a9496[_0x4c87('0x14')]['message']);}return _0x353ac9(_0x5a9496[_0x4c87('0x14')][_0x4c87('0x1d')]);}else{_0x353ac9(_0x5a9496[_0x4c87('0x1e')]);}})[_0x4c87('0x1f')](function(_0x637dbc){_0x33aafd(_0x637dbc);});});}function getAgent(_0x3eb09e){return db[_0x4c87('0x20')][_0x4c87('0x21')]({'where':{'id':_0x3eb09e,'role':'agent'}})[_0x4c87('0x1b')](checkError());}function getAgentCheckSession(_0x47ef54,_0x27f13d){return new BPromise(function(_0x381af7,_0x3a9520){var _0x1f246e=respondWithRpcPromise(_0x4c87('0x22'));var _0x583371=getAgent(_0x47ef54);Promise['all']([_0x1f246e,_0x583371])[_0x4c87('0x1b')](function(_0x23483e){var _0x2e3549=_0x23483e[0x0];var _0x106121=_0x23483e[0x1];var _0xa7eb3=_[_0x4c87('0x23')](_0x2e3549[_0x4c87('0x24')],function(_0x10aea2){return _0x10aea2[_0x4c87('0x25')]==_0x106121['id']&&_0x10aea2[_0x4c87('0x26')]==_0x27f13d;});if(_0xa7eb3[_0x4c87('0x27')]==0x1){_0x381af7(_0x106121);}else{_0x3a9520(new RangeError(_0x4c87('0x28')+_0x27f13d+_0x4c87('0x29')));}});});}exports[_0x4c87('0x2a')]=function(_0x3a1aaf,_0x185590){logger['info'](_0x4c87('0x2b'),_0x3a1aaf['body']);var _0x110b84=originateValidation['validate'](_0x3a1aaf[_0x4c87('0x2c')]);if(_0x110b84[_0x4c87('0x27')]>0x0){return _0x185590[_0x4c87('0x18')](0x190)[_0x4c87('0x2d')](_0x110b84);}var _0x58eb98=_0x3a1aaf[_0x4c87('0x2c')][_0x4c87('0x2e')];var _0x2f307a=_0x3a1aaf[_0x4c87('0x2c')]['callNumber'];var _0x2060f8=_0x3a1aaf[_0x4c87('0x2c')][_0x4c87('0x2f')];var _0x30fdba=_0x3a1aaf['body'][_0x4c87('0x30')];return getAgent(_0x58eb98)[_0x4c87('0x1b')](function(_0x5fb196){logger[_0x4c87('0x31')]('entityFound:',_0x5fb196['name']);emit(util[_0x4c87('0x32')]('user:%s',_0x5fb196[_0x4c87('0x16')]),_0x4c87('0x33'),{'callNumber':_0x2f307a,'callerId':_0x2060f8,'callbackUrl':_0x30fdba});return _0x185590[_0x4c87('0x18')](0xc8)[_0x4c87('0x2d')]({'error':![],'message':_0x4c87('0x34')});})['catch'](handleError(_0x185590));};exports[_0x4c87('0x35')]=function(_0x11a632,_0xcc73b5){logger['info']('hangup\x20fired:',_0x11a632[_0x4c87('0x2c')]);var _0x2da03f=hangupValidation[_0x4c87('0x36')](_0x11a632['body']);if(_0x2da03f[_0x4c87('0x27')]>0x0){return _0xcc73b5['status'](0x190)['json'](_0x2da03f);}var _0x5bbd35=_0x11a632[_0x4c87('0x2c')][_0x4c87('0x2e')];var _0x2de50d=_0x11a632['body'][_0x4c87('0x26')];return getAgent(_0x5bbd35)[_0x4c87('0x1b')](function(_0x5de7b1){logger[_0x4c87('0x31')]('entityFound:',_0x5de7b1['name']);emit(util[_0x4c87('0x32')]('user:%s',_0x5de7b1[_0x4c87('0x16')]),_0x4c87('0x37'),{'sessionId':_0x2de50d});return _0xcc73b5['status'](0xc8)[_0x4c87('0x2d')]({'error':![],'message':_0x4c87('0x38')});})['catch'](handleError(_0xcc73b5));};exports[_0x4c87('0x39')]=function(_0x5a70b7,_0x521944){logger[_0x4c87('0x31')]('answer\x20fired:',_0x5a70b7['body']);var _0x35c74b=answerValidation[_0x4c87('0x36')](_0x5a70b7['body']);if(_0x35c74b[_0x4c87('0x27')]>0x0){return _0x521944[_0x4c87('0x18')](0x190)[_0x4c87('0x2d')](_0x35c74b);}var _0x45b950=_0x5a70b7['body'][_0x4c87('0x2e')];var _0x448208=_0x5a70b7[_0x4c87('0x2c')][_0x4c87('0x26')];return getAgent(_0x45b950)['then'](function(_0x33716e){logger[_0x4c87('0x31')](_0x4c87('0x3a'),_0x33716e['name']);emit(util[_0x4c87('0x32')](_0x4c87('0x3b'),_0x33716e[_0x4c87('0x16')]),_0x4c87('0x3c'),{'sessionId':_0x448208});return _0x521944['status'](0xc8)[_0x4c87('0x2d')]({'error':![],'message':_0x4c87('0x3d')});})[_0x4c87('0x1f')](handleError(_0x521944));};exports['hold']=function(_0x507686,_0x41cfe9){logger[_0x4c87('0x31')](_0x4c87('0x3e'),_0x507686[_0x4c87('0x2c')]);var _0x52bac1=holdValidation['validate'](_0x507686[_0x4c87('0x2c')]);if(_0x52bac1[_0x4c87('0x27')]>0x0){return _0x41cfe9[_0x4c87('0x18')](0x190)[_0x4c87('0x2d')](_0x52bac1);}var _0x2c7eef=_0x507686[_0x4c87('0x2c')][_0x4c87('0x2e')];var _0x290761=_0x507686[_0x4c87('0x2c')][_0x4c87('0x26')];return getAgent(_0x2c7eef)['then'](function(_0x20f4f2){logger[_0x4c87('0x31')](_0x4c87('0x3a'),_0x20f4f2[_0x4c87('0x16')]);emit(util['format'](_0x4c87('0x3b'),_0x20f4f2[_0x4c87('0x16')]),_0x4c87('0x3f'),{'sessionId':_0x290761});return _0x41cfe9['status'](0xc8)[_0x4c87('0x2d')]({'error':![],'message':_0x4c87('0x40')});})[_0x4c87('0x1f')](handleError(_0x41cfe9));};exports['unhold']=function(_0x31f23a,_0x1b5843){logger[_0x4c87('0x31')]('unhold\x20fired:',_0x31f23a['body']);var _0x578b39=unholdValidation['validate'](_0x31f23a['body']);if(_0x578b39[_0x4c87('0x27')]>0x0){return _0x1b5843[_0x4c87('0x18')](0x190)['json'](_0x578b39);}var _0x59545c=_0x31f23a[_0x4c87('0x2c')][_0x4c87('0x2e')];var _0x205419=_0x31f23a[_0x4c87('0x2c')][_0x4c87('0x26')];return getAgent(_0x59545c)[_0x4c87('0x1b')](function(_0x64642a){logger[_0x4c87('0x31')]('entityFound:',_0x64642a['name']);emit(util[_0x4c87('0x32')](_0x4c87('0x3b'),_0x64642a[_0x4c87('0x16')]),_0x4c87('0x41'),{'sessionId':_0x205419});return _0x1b5843[_0x4c87('0x18')](0xc8)[_0x4c87('0x2d')]({'error':![],'message':_0x4c87('0x42')});})[_0x4c87('0x1f')](handleError(_0x1b5843));};exports[_0x4c87('0x43')]=function(_0x2a4bf1,_0x4aa6e3){logger['info'](_0x4c87('0x44'),_0x4aa6e3['body']);var _0x3fae0d=callsValidation[_0x4c87('0x36')](_0x2a4bf1[_0x4c87('0x2c')]);if(_0x3fae0d['length']>0x0){return _0x4aa6e3[_0x4c87('0x18')](0x190)[_0x4c87('0x2d')](_0x3fae0d);}var _0x3d407a=_0x2a4bf1[_0x4c87('0x2c')][_0x4c87('0x2e')];var _0x67c32d=respondWithRpcPromise(_0x4c87('0x22'));var _0x4e552a=getAgent(_0x3d407a);return Promise['all']([_0x67c32d,_0x4e552a])[_0x4c87('0x1b')](function(_0x2fb4a){var _0x253e8b=_0x2fb4a[0x0];var _0x197c0d=_0x2fb4a[0x1];var _0x16be71=_[_0x4c87('0x23')](_0x253e8b[_0x4c87('0x24')],function(_0x1f7b9b){return _0x1f7b9b[_0x4c87('0x25')]==_0x197c0d['id'];});return _0x4aa6e3[_0x4c87('0x18')](0xc8)[_0x4c87('0x2d')]({'count':_0x16be71[_0x4c87('0x27')],'rows':_0x16be71});})[_0x4c87('0x1f')](handleError(_0x4aa6e3));};exports['conference']=function(_0x37b319,_0x24c52a){logger[_0x4c87('0x31')](_0x4c87('0x45'),_0x37b319[_0x4c87('0x2c')]);var _0x1d71e5=conferenceValidation[_0x4c87('0x36')](_0x37b319['body']);if(_0x1d71e5['length']>0x0){return _0x24c52a[_0x4c87('0x18')](0x190)['json'](_0x1d71e5);}var _0x53e6ba=_0x37b319['body'][_0x4c87('0x2e')];return getAgent(_0x53e6ba)[_0x4c87('0x1b')](function(_0x20c0b6){logger[_0x4c87('0x31')](_0x4c87('0x3a'),_0x20c0b6['name']);emit(util['format'](_0x4c87('0x3b'),_0x20c0b6['name']),'webbar:conference');return _0x24c52a['status'](0xc8)[_0x4c87('0x2d')]({'error':![],'message':_0x4c87('0x46')});})[_0x4c87('0x1f')](handleError(_0x24c52a));};exports[_0x4c87('0x47')]=function(_0x44a2c7,_0x4ed555){logger['info'](_0x4c87('0x48'),_0x44a2c7[_0x4c87('0x2c')]);var _0xdf24be=transferValidation[_0x4c87('0x36')](_0x44a2c7['body']);if(_0xdf24be['length']>0x0){return _0x4ed555[_0x4c87('0x18')](0x190)['json'](_0xdf24be);}var _0x30773f=_0x44a2c7[_0x4c87('0x2c')]['userId'];var _0x10b898=_0x44a2c7['body'][_0x4c87('0x26')];var _0x38dfad=_0x44a2c7[_0x4c87('0x2c')][_0x4c87('0x49')];return getAgent(_0x30773f)['then'](function(_0x44a493){logger[_0x4c87('0x31')](_0x4c87('0x3a'),_0x44a493[_0x4c87('0x16')]);emit(util[_0x4c87('0x32')](_0x4c87('0x3b'),_0x44a493['name']),'webbar:transfer',{'sessionId':_0x10b898,'transferNumber':_0x38dfad});return _0x4ed555[_0x4c87('0x18')](0xc8)[_0x4c87('0x2d')]({'error':![],'message':_0x4c87('0x4a')});})['catch'](handleError(_0x4ed555));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index 9f54b25..6008c45 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 _0x6aaa=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/users','getApplications','post','create','addDisposition','addAnswer','addAgents','/:id/applications','addApplications','notify','/:id/send','send','update','delete','destroy','removeAgents','exports','multer','util','path','connect-timeout','express'];(function(_0x42f1e7,_0x3a1279){var _0x460d91=function(_0x3e9820){while(--_0x3e9820){_0x42f1e7['push'](_0x42f1e7['shift']());}};_0x460d91(++_0x3a1279);}(_0x6aaa,0x163));var _0xa6aa=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6aaa[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xa6aa('0x0'));var util=require(_0xa6aa('0x1'));var path=require(_0xa6aa('0x2'));var timeout=require(_0xa6aa('0x3'));var express=require(_0xa6aa('0x4'));var router=express[_0xa6aa('0x5')]();var fs_extra=require(_0xa6aa('0x6'));var auth=require(_0xa6aa('0x7'));var interaction=require(_0xa6aa('0x8'));var config=require(_0xa6aa('0x9'));var controller=require('./whatsappAccount.controller');router[_0xa6aa('0xa')]('/',auth[_0xa6aa('0xb')](),controller[_0xa6aa('0xc')]);router['get'](_0xa6aa('0xd'),auth[_0xa6aa('0xb')](),controller['describe']);router['get'](_0xa6aa('0xe'),auth[_0xa6aa('0xb')](),controller[_0xa6aa('0xf')]);router['get'](_0xa6aa('0x10'),auth[_0xa6aa('0xb')](),controller['getDispositions']);router[_0xa6aa('0xa')](_0xa6aa('0x11'),auth[_0xa6aa('0xb')](),controller[_0xa6aa('0x12')]);router[_0xa6aa('0xa')](_0xa6aa('0x13'),auth[_0xa6aa('0xb')](),controller['getAgents']);router[_0xa6aa('0xa')]('/:id/applications',auth[_0xa6aa('0xb')](),controller[_0xa6aa('0x14')]);router[_0xa6aa('0x15')]('/',auth[_0xa6aa('0xb')](),controller[_0xa6aa('0x16')]);router['post'](_0xa6aa('0x10'),auth[_0xa6aa('0xb')](),controller[_0xa6aa('0x17')]);router[_0xa6aa('0x15')](_0xa6aa('0x11'),auth[_0xa6aa('0xb')](),controller[_0xa6aa('0x18')]);router[_0xa6aa('0x15')](_0xa6aa('0x13'),auth[_0xa6aa('0xb')](),controller[_0xa6aa('0x19')]);router[_0xa6aa('0x15')](_0xa6aa('0x1a'),auth[_0xa6aa('0xb')](),controller[_0xa6aa('0x1b')]);router[_0xa6aa('0x15')]('/:id/notify',controller[_0xa6aa('0x1c')]);router[_0xa6aa('0x15')](_0xa6aa('0x1d'),auth[_0xa6aa('0xb')](),controller[_0xa6aa('0x1e')]);router['put'](_0xa6aa('0xe'),auth[_0xa6aa('0xb')](),controller[_0xa6aa('0x1f')]);router[_0xa6aa('0x20')](_0xa6aa('0xe'),auth['isAuthenticated'](),controller[_0xa6aa('0x21')]);router[_0xa6aa('0x20')](_0xa6aa('0x10'),auth['isAuthenticated'](),controller['removeDispositions']);router[_0xa6aa('0x20')](_0xa6aa('0x11'),auth[_0xa6aa('0xb')](),controller['removeAnswers']);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0xa6aa('0x22')]);module[_0xa6aa('0x23')]=router; \ No newline at end of file +var _0xb770=['create','addDisposition','post','/:id/canned_answers','addAnswer','addApplications','notify','/:id/send','send','put','update','delete','destroy','removeAgents','exports','multer','util','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','index','isAuthenticated','describe','get','/:id','show','/:id/dispositions','getDispositions','getAnswers','/:id/users','getAgents','/:id/applications','getApplications'];(function(_0x32b542,_0x4512fa){var _0x554d54=function(_0x35cdfc){while(--_0x35cdfc){_0x32b542['push'](_0x32b542['shift']());}};_0x554d54(++_0x4512fa);}(_0xb770,0x14a));var _0x0b77=function(_0x2aaf4d,_0x3169ee){_0x2aaf4d=_0x2aaf4d-0x0;var _0x3f3f44=_0xb770[_0x2aaf4d];return _0x3f3f44;};'use strict';var multer=require(_0x0b77('0x0'));var util=require(_0x0b77('0x1'));var path=require('path');var timeout=require(_0x0b77('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x0b77('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x0b77('0x4'));var config=require(_0x0b77('0x5'));var controller=require(_0x0b77('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x0b77('0x7')]);router['get']('/describe',auth[_0x0b77('0x8')](),controller[_0x0b77('0x9')]);router[_0x0b77('0xa')](_0x0b77('0xb'),auth[_0x0b77('0x8')](),controller[_0x0b77('0xc')]);router[_0x0b77('0xa')](_0x0b77('0xd'),auth[_0x0b77('0x8')](),controller[_0x0b77('0xe')]);router[_0x0b77('0xa')]('/:id/canned_answers',auth[_0x0b77('0x8')](),controller[_0x0b77('0xf')]);router['get'](_0x0b77('0x10'),auth[_0x0b77('0x8')](),controller[_0x0b77('0x11')]);router[_0x0b77('0xa')](_0x0b77('0x12'),auth[_0x0b77('0x8')](),controller[_0x0b77('0x13')]);router['post']('/',auth[_0x0b77('0x8')](),controller[_0x0b77('0x14')]);router['post'](_0x0b77('0xd'),auth[_0x0b77('0x8')](),controller[_0x0b77('0x15')]);router[_0x0b77('0x16')](_0x0b77('0x17'),auth[_0x0b77('0x8')](),controller[_0x0b77('0x18')]);router[_0x0b77('0x16')](_0x0b77('0x10'),auth[_0x0b77('0x8')](),controller['addAgents']);router[_0x0b77('0x16')](_0x0b77('0x12'),auth[_0x0b77('0x8')](),controller[_0x0b77('0x19')]);router[_0x0b77('0x16')]('/:id/notify',controller[_0x0b77('0x1a')]);router[_0x0b77('0x16')](_0x0b77('0x1b'),auth[_0x0b77('0x8')](),controller[_0x0b77('0x1c')]);router[_0x0b77('0x1d')]('/:id',auth['isAuthenticated'](),controller[_0x0b77('0x1e')]);router[_0x0b77('0x1f')]('/:id',auth['isAuthenticated'](),controller[_0x0b77('0x20')]);router[_0x0b77('0x1f')]('/:id/dispositions',auth[_0x0b77('0x8')](),controller['removeDispositions']);router['delete'](_0x0b77('0x17'),auth['isAuthenticated'](),controller['removeAnswers']);router[_0x0b77('0x1f')]('/:id/users',auth[_0x0b77('0x8')](),controller[_0x0b77('0x21')]);module[_0x0b77('0x22')]=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index b5d8877..d96a8b9 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 _0xd536=['generate','ENUM','twilio','sinch','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','randomstring','STRING','name'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd536,0x1ed));var _0x6d53=function(_0x3a8d99,_0x2e16a0){_0x3a8d99=_0x3a8d99-0x0;var _0x5aa05f=_0xd536[_0x3a8d99];return _0x5aa05f;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x6d53('0x0'));module['exports']={'name':{'type':Sequelize[_0x6d53('0x1')],'unique':_0x6d53('0x2'),'allowNull':![]},'key':{'type':Sequelize[_0x6d53('0x1')],'allowNull':![]},'remote':{'type':Sequelize[_0x6d53('0x1')],'allowNull':![]},'token':{'type':Sequelize[_0x6d53('0x1')],'defaultValue':function(){return rs[_0x6d53('0x3')]();}},'phone':{'type':Sequelize[_0x6d53('0x1')]},'type':{'type':Sequelize[_0x6d53('0x4')](_0x6d53('0x5'),_0x6d53('0x6'))},'accountSid':{'type':Sequelize[_0x6d53('0x1')]},'baseUrl':{'type':Sequelize[_0x6d53('0x1')]},'authToken':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x6d53('0x7')],'defaultValue':function(){return _0x6d53('0x8');}},'notificationSound':{'type':Sequelize[_0x6d53('0x9')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x6d53('0x9')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x6d53('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x6d53('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x6d53('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x6d53('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x6d53('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x6d53('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x6d53('0xb')},'mandatoryDisposition':{'type':Sequelize[_0x6d53('0x9')],'defaultValue':![],'comment':_0x6d53('0xc'),'set':function(_0x4467ee){if(!_0x4467ee){this[_0x6d53('0xd')](_0x6d53('0xe'),null);}this[_0x6d53('0xd')](_0x6d53('0xf'),_0x4467ee);}},'description':{'type':Sequelize[_0x6d53('0x1')]}}; \ No newline at end of file +var _0x028a=['exports','STRING','name','generate','ENUM','twilio','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDisposition','sequelize','randomstring'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x028a,0x1c0));var _0xa028=function(_0x1dfdb9,_0x5965e3){_0x1dfdb9=_0x1dfdb9-0x0;var _0x30c307=_0x028a[_0x1dfdb9];return _0x30c307;};'use strict';var Sequelize=require(_0xa028('0x0'));var rs=require(_0xa028('0x1'));module[_0xa028('0x2')]={'name':{'type':Sequelize[_0xa028('0x3')],'unique':_0xa028('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0xa028('0x3')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0xa028('0x3')],'defaultValue':function(){return rs[_0xa028('0x5')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xa028('0x6')](_0xa028('0x7'),'sinch')},'accountSid':{'type':Sequelize[_0xa028('0x3')]},'baseUrl':{'type':Sequelize[_0xa028('0x3')]},'authToken':{'type':Sequelize[_0xa028('0x3')]},'notificationTemplate':{'type':Sequelize[_0xa028('0x8')],'defaultValue':function(){return _0xa028('0x9');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0xa028('0xa')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xa028('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xa028('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xa028('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xa028('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0xa028('0xc')},'mandatoryDisposition':{'type':Sequelize[_0xa028('0xa')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x21c682){if(!_0x21c682){this['setDataValue']('mandatoryDispositionPauseId',null);}this[_0xa028('0xd')](_0xa028('0xe'),_0x21c682);}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index ee5050e..274e047 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 _0x9490=['update','destroy','get','WhatsappAccounts','UserProfileResource','name','send','Pause','mandatoryDispositionPause','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filter','where','VIRTUAL','options','includeAll','include','WhatsappAccount','findAll','rows','catch','show','merge','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','WhatsappAccountId','Disposition','getDispositions','findOne','length','pick','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addAgents','omit','spread','emit','userWhatsappAccount:save','removeAgents','getAgents','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','WhatsappApplication','bulkCreate','priority','finally','getApplications','notify','whatsapp','Applications','account','sinch','statuses','state','WhatsappMessage','orderBy','asc','CmContact','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','mobile','from','whatsapp:','messageId','notifications','message_id','Sequelize','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','contact','WhatsappInteraction','interaction','applications','close','unmanaged','*,*,*,*','ContactId','AttachmentId','UserId','User','unshift','waitForTheAssignedAgent','queueId','WhatsappQueue','waitForTheAssignedQueue','Start','receiveMessage','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','twilio','Content-Type','to\x20is\x20mandatory','List','DESC','dataValues','Messages','push','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','defaults','redis','./whatsappAccount.socket','jayson/promise','client','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save'];(function(_0x55d58f,_0x2bea83){var _0x1ad6e6=function(_0x31447e){while(--_0x31447e){_0x55d58f['push'](_0x55d58f['shift']());}};_0x1ad6e6(++_0x2bea83);}(_0x9490,0x148));var _0x0949=function(_0x593491,_0x43f424){_0x593491=_0x593491-0x0;var _0x46165c=_0x9490[_0x593491];return _0x46165c;};'use strict';var emlformat=require(_0x0949('0x0'));var rimraf=require(_0x0949('0x1'));var zipdir=require(_0x0949('0x2'));var jsonpatch=require(_0x0949('0x3'));var rp=require('request-promise');var moment=require(_0x0949('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x0949('0x5'));var util=require(_0x0949('0x6'));var path=require(_0x0949('0x7'));var sox=require(_0x0949('0x8'));var csv=require(_0x0949('0x9'));var ejs=require(_0x0949('0xa'));var fs=require('fs');var fs_extra=require(_0x0949('0xb'));var _=require(_0x0949('0xc'));var squel=require(_0x0949('0xd'));var crypto=require('crypto');var jsforce=require(_0x0949('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x0949('0x9'));var querystring=require('querystring');var Papa=require(_0x0949('0xf'));var Redis=require(_0x0949('0x10'));var authService=require(_0x0949('0x11'));var qs=require(_0x0949('0x12'));var as=require(_0x0949('0x13'));var hardwareService=require(_0x0949('0x14'));var logger=require(_0x0949('0x15'))(_0x0949('0x16'));var utils=require(_0x0949('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x0949('0x18'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x0949('0x19')](config[_0x0949('0x1a')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0949('0x1a')]));require(_0x0949('0x1b'))['register'](socket);var jayson=require(_0x0949('0x1c'));var client=jayson[_0x0949('0x1d')]['http']({'port':0x232c});function respondWithRpcPromise(_0x4b2787,_0x41d083,_0xe1a553,_0x541732){return new BPromise(function(_0x2c3cf3,_0xbf5cb3){var _0x4d1624=_0x541732||client;return _0x4d1624['request'](_0x4b2787,_0xe1a553)[_0x0949('0x1e')](function(_0x185cee){logger[_0x0949('0x1f')](_0x0949('0x20'),_0x41d083,_0x0949('0x21'));logger[_0x0949('0x22')](_0x0949('0x23'),_0x41d083,_0x0949('0x21'),JSON[_0x0949('0x24')](_0x185cee));if(_0x185cee[_0x0949('0x25')]){if(_0x185cee[_0x0949('0x25')][_0x0949('0x26')]===0x1f4){logger[_0x0949('0x25')]('WhatsappAccount,\x20%s,\x20%s',_0x41d083,_0x185cee[_0x0949('0x25')]['message']);return _0xbf5cb3(_0x185cee['error']['message']);}logger['error'](_0x0949('0x20'),_0x41d083,_0x185cee[_0x0949('0x25')][_0x0949('0x27')]);return _0x2c3cf3(_0x185cee[_0x0949('0x25')][_0x0949('0x27')]);}else{logger[_0x0949('0x1f')](_0x0949('0x20'),_0x41d083,_0x0949('0x21'));_0x2c3cf3(_0x185cee[_0x0949('0x28')][_0x0949('0x27')]);}})['catch'](function(_0x13df8d){logger['error'](_0x0949('0x20'),_0x41d083,_0x13df8d);_0xbf5cb3(_0x13df8d);});});}function respondWithStatusCode(_0x57fae9,_0xa78047){_0xa78047=_0xa78047||0xcc;return function(_0x1c6421){if(_0x1c6421){return _0x57fae9[_0x0949('0x29')](_0xa78047);}return _0x57fae9[_0x0949('0x2a')](_0xa78047)[_0x0949('0x2b')]();};}function respondWithResult(_0x5534db,_0x58defa){_0x58defa=_0x58defa||0xc8;return function(_0x80dc23){if(_0x80dc23){return _0x5534db['status'](_0x58defa)[_0x0949('0x2c')](_0x80dc23);}};}function respondWithFilteredResult(_0x4bf602,_0x308c92){return function(_0x567ef0){if(_0x567ef0){var _0x406d55=typeof _0x308c92['offset']===_0x0949('0x2d')&&typeof _0x308c92['limit']==='undefined';var _0x209d02=_0x567ef0[_0x0949('0x2e')];var _0x2aaaba=_0x406d55?0x0:_0x308c92[_0x0949('0x2f')];var _0x1b1e9e=_0x406d55?_0x567ef0['count']:_0x308c92[_0x0949('0x2f')]+_0x308c92[_0x0949('0x30')];var _0x2e168a;if(_0x1b1e9e>=_0x209d02){_0x1b1e9e=_0x209d02;_0x2e168a=0xc8;}else{_0x2e168a=0xce;}_0x4bf602[_0x0949('0x2a')](_0x2e168a);return _0x4bf602[_0x0949('0x31')](_0x0949('0x32'),_0x2aaaba+'-'+_0x1b1e9e+'/'+_0x209d02)[_0x0949('0x2c')](_0x567ef0);}return null;};}function patchUpdates(_0x147164){return function(_0x290f29){try{jsonpatch[_0x0949('0x33')](_0x290f29,_0x147164,!![]);}catch(_0x291727){return BPromise[_0x0949('0x34')](_0x291727);}return _0x290f29[_0x0949('0x35')]();};}function saveUpdates(_0x3ae278,_0x40e522){return function(_0x2578c4){if(_0x2578c4){return _0x2578c4[_0x0949('0x36')](_0x3ae278)[_0x0949('0x1e')](function(_0x1208d9){return _0x1208d9;});}return null;};}function removeEntity(_0x624b88,_0x3ece2b){return function(_0x4d1ed7){if(_0x4d1ed7){return _0x4d1ed7[_0x0949('0x37')]()[_0x0949('0x1e')](function(){var _0x1460aa=_0x4d1ed7[_0x0949('0x38')]({'plain':!![]});var _0x3191ad=_0x0949('0x39');return db[_0x0949('0x3a')][_0x0949('0x37')]({'where':{'type':_0x3191ad,'resourceId':_0x1460aa['id']}})[_0x0949('0x1e')](function(){return _0x4d1ed7;});})[_0x0949('0x1e')](function(){_0x624b88[_0x0949('0x2a')](0xcc)[_0x0949('0x2b')]();});}};}function handleEntityNotFound(_0x2da271,_0x1c5e4c){return function(_0x51305b){if(!_0x51305b){_0x2da271[_0x0949('0x29')](0x194);}return _0x51305b;};}function handleError(_0x7b9cd0,_0x50509e){_0x50509e=_0x50509e||0x1f4;return function(_0x4f1f2f){logger[_0x0949('0x25')](_0x4f1f2f['stack']);if(_0x4f1f2f[_0x0949('0x3b')]){delete _0x4f1f2f['name'];}_0x7b9cd0[_0x0949('0x2a')](_0x50509e)[_0x0949('0x3c')](_0x4f1f2f);};}exports['index']=function(_0x9d6dc2,_0x502c7b){var _0x160815={'include':[{'model':db[_0x0949('0x3d')],'as':_0x0949('0x3e')}]},_0x5424fc={},_0x44d5c7={'count':0x0,'rows':[]};var _0x42013d=_[_0x0949('0x3f')](db['WhatsappAccount'][_0x0949('0x40')],function(_0x126243){return{'name':_0x126243[_0x0949('0x41')],'type':_0x126243[_0x0949('0x42')]['key']};});_0x5424fc[_0x0949('0x43')]=_[_0x0949('0x3f')](_0x42013d,_0x0949('0x3b'));_0x5424fc[_0x0949('0x44')]=_[_0x0949('0x45')](_0x9d6dc2[_0x0949('0x44')]);_0x5424fc[_0x0949('0x46')]=_[_0x0949('0x47')](_0x5424fc[_0x0949('0x43')],_0x5424fc['query']);_0x160815[_0x0949('0x48')]=_['intersection'](_0x5424fc[_0x0949('0x43')],qs['fields'](_0x9d6dc2[_0x0949('0x44')][_0x0949('0x49')]));_0x160815[_0x0949('0x48')]=_0x160815[_0x0949('0x48')]['length']?_0x160815[_0x0949('0x48')]:_0x5424fc['model'];if(!_0x9d6dc2[_0x0949('0x44')][_0x0949('0x4a')](_0x0949('0x4b'))){_0x160815['limit']=qs[_0x0949('0x30')](_0x9d6dc2[_0x0949('0x44')][_0x0949('0x30')]);_0x160815[_0x0949('0x2f')]=qs[_0x0949('0x2f')](_0x9d6dc2[_0x0949('0x44')][_0x0949('0x2f')]);}_0x160815[_0x0949('0x4c')]=qs[_0x0949('0x4d')](_0x9d6dc2[_0x0949('0x44')]['sort']);_0x160815['where']=qs['filters'](_['pick'](_0x9d6dc2[_0x0949('0x44')],_0x5424fc['filters']),_0x42013d);if(_0x9d6dc2[_0x0949('0x44')][_0x0949('0x4e')]){_0x160815[_0x0949('0x4f')]=_['merge'](_0x160815[_0x0949('0x4f')],{'$or':_[_0x0949('0x3f')](_0x42013d,function(_0x4a8d14){if(_0x4a8d14[_0x0949('0x42')]!==_0x0949('0x50')){var _0x4fb4d5={};_0x4fb4d5[_0x4a8d14['name']]={'$like':'%'+_0x9d6dc2['query']['filter']+'%'};return _0x4fb4d5;}})});}_0x160815=_['merge']({},_0x160815,_0x9d6dc2[_0x0949('0x51')]);var _0x4e9370={'where':_0x160815[_0x0949('0x4f')]};return db['WhatsappAccount'][_0x0949('0x2e')](_0x4e9370)[_0x0949('0x1e')](function(_0x43cb91){_0x44d5c7[_0x0949('0x2e')]=_0x43cb91;if(_0x9d6dc2[_0x0949('0x44')][_0x0949('0x52')]){_0x160815[_0x0949('0x53')]=[{'all':!![]}];}return db[_0x0949('0x54')][_0x0949('0x55')](_0x160815);})[_0x0949('0x1e')](function(_0x364729){_0x44d5c7[_0x0949('0x56')]=_0x364729;return _0x44d5c7;})['then'](respondWithFilteredResult(_0x502c7b,_0x160815))[_0x0949('0x57')](handleError(_0x502c7b,null));};exports[_0x0949('0x58')]=function(_0x28cd52,_0x175afe){var _0x4ee5d7={'raw':![],'where':{'id':_0x28cd52['params']['id']},'include':[{'model':db[_0x0949('0x3d')],'as':_0x0949('0x3e')}]},_0x187351={};_0x187351['model']=_[_0x0949('0x45')](db[_0x0949('0x54')][_0x0949('0x40')]);_0x187351[_0x0949('0x44')]=_[_0x0949('0x45')](_0x28cd52[_0x0949('0x44')]);_0x187351['filters']=_[_0x0949('0x47')](_0x187351[_0x0949('0x43')],_0x187351[_0x0949('0x44')]);_0x4ee5d7[_0x0949('0x48')]=_[_0x0949('0x47')](_0x187351[_0x0949('0x43')],qs[_0x0949('0x49')](_0x28cd52[_0x0949('0x44')][_0x0949('0x49')]));_0x4ee5d7[_0x0949('0x48')]=_0x4ee5d7['attributes']['length']?_0x4ee5d7[_0x0949('0x48')]:_0x187351[_0x0949('0x43')];if(_0x28cd52['query'][_0x0949('0x52')]){_0x4ee5d7['include']=[{'all':!![]}];}_0x4ee5d7=_[_0x0949('0x59')]({},_0x4ee5d7,_0x28cd52[_0x0949('0x51')]);return db[_0x0949('0x54')][_0x0949('0x5a')](_0x4ee5d7)['then'](handleEntityNotFound(_0x175afe,null))[_0x0949('0x1e')](respondWithResult(_0x175afe,null))[_0x0949('0x57')](handleError(_0x175afe,null));};exports[_0x0949('0x5b')]=function(_0x156442,_0x3e965f){return db[_0x0949('0x54')][_0x0949('0x5b')](_0x156442[_0x0949('0x5c')],{})[_0x0949('0x1e')](function(_0x38597b){var _0x144803=_0x156442[_0x0949('0x5d')][_0x0949('0x38')]({'plain':!![]});if(!_0x144803)throw new Error(_0x0949('0x5e'));if(_0x144803[_0x0949('0x5f')]===_0x0949('0x5d')){var _0xd0b0d1=_0x38597b[_0x0949('0x38')]({'plain':!![]});var _0x3bd1d9=_0x0949('0x39');return db[_0x0949('0x60')][_0x0949('0x5a')]({'where':{'name':_0x3bd1d9,'userProfileId':_0x144803['userProfileId']},'raw':!![]})[_0x0949('0x1e')](function(_0x2551aa){if(_0x2551aa&&_0x2551aa[_0x0949('0x61')]===0x0){return db[_0x0949('0x3a')][_0x0949('0x5b')]({'name':_0xd0b0d1[_0x0949('0x3b')],'resourceId':_0xd0b0d1['id'],'type':_0x2551aa[_0x0949('0x3b')],'sectionId':_0x2551aa['id']},{})[_0x0949('0x1e')](function(){return _0x38597b;});}else{return _0x38597b;}})[_0x0949('0x57')](function(_0x1eae68){logger[_0x0949('0x25')](_0x0949('0x62'),_0x1eae68);throw _0x1eae68;});}return _0x38597b;})[_0x0949('0x1e')](respondWithResult(_0x3e965f,0xc9))[_0x0949('0x57')](handleError(_0x3e965f,null));};exports[_0x0949('0x36')]=function(_0x1aa196,_0x62bb43){if(_0x1aa196['body']['id']){delete _0x1aa196[_0x0949('0x5c')]['id'];}return db[_0x0949('0x54')][_0x0949('0x5a')]({'where':{'id':_0x1aa196[_0x0949('0x63')]['id']},'include':[{'model':db['Pause'],'as':_0x0949('0x3e')}]})[_0x0949('0x1e')](handleEntityNotFound(_0x62bb43,null))[_0x0949('0x1e')](saveUpdates(_0x1aa196[_0x0949('0x5c')],null))[_0x0949('0x1e')](respondWithResult(_0x62bb43,null))[_0x0949('0x57')](handleError(_0x62bb43,null));};exports[_0x0949('0x37')]=function(_0x5ac678,_0x26f586){return db[_0x0949('0x54')][_0x0949('0x5a')]({'where':{'id':_0x5ac678[_0x0949('0x63')]['id']}})[_0x0949('0x1e')](handleEntityNotFound(_0x26f586,null))['then'](removeEntity(_0x26f586,null))['catch'](handleError(_0x26f586,null));};exports[_0x0949('0x64')]=function(_0x2302fd,_0x3b8f21){return db[_0x0949('0x54')][_0x0949('0x64')]()[_0x0949('0x1e')](respondWithResult(_0x3b8f21,null))['catch'](handleError(_0x3b8f21,null));};exports['addDisposition']=function(_0x42ce72,_0x3098db,_0x1ea763){if(_0x42ce72[_0x0949('0x5c')]['id']){delete _0x42ce72['body']['id'];}return db['WhatsappAccount'][_0x0949('0x5a')]({'where':{'id':_0x42ce72['params']['id']}})['then'](handleEntityNotFound(_0x3098db,null))[_0x0949('0x1e')](function(_0x1952f2){if(_0x1952f2){_0x42ce72['body'][_0x0949('0x65')]=_0x1952f2['id'];return db[_0x0949('0x66')][_0x0949('0x5b')](_0x42ce72[_0x0949('0x5c')]);}})[_0x0949('0x1e')](respondWithResult(_0x3098db,null))[_0x0949('0x57')](handleError(_0x3098db,null));};exports[_0x0949('0x67')]=function(_0x390cb1,_0x527d67,_0x2e598b){var _0x4d3773={'raw':![],'where':{}};var _0x543f81={};var _0x1161c7={'count':0x0,'rows':[]};return db[_0x0949('0x54')][_0x0949('0x68')]({'where':{'id':_0x390cb1[_0x0949('0x63')]['id']}})['then'](handleEntityNotFound(_0x527d67,null))['then'](function(_0x846356){if(_0x846356){_0x543f81[_0x0949('0x43')]=_[_0x0949('0x45')](db[_0x0949('0x66')][_0x0949('0x40')]);_0x543f81[_0x0949('0x44')]=_['keys'](_0x390cb1[_0x0949('0x44')]);_0x543f81['filters']=_[_0x0949('0x47')](_0x543f81[_0x0949('0x43')],_0x543f81[_0x0949('0x44')]);_0x4d3773[_0x0949('0x48')]=_[_0x0949('0x47')](_0x543f81[_0x0949('0x43')],qs['fields'](_0x390cb1[_0x0949('0x44')][_0x0949('0x49')]));_0x4d3773['attributes']=_0x4d3773[_0x0949('0x48')][_0x0949('0x69')]?_0x4d3773[_0x0949('0x48')]:_0x543f81[_0x0949('0x43')];if(!_0x390cb1[_0x0949('0x44')]['hasOwnProperty']('nolimit')){_0x4d3773['limit']=qs['limit'](_0x390cb1[_0x0949('0x44')][_0x0949('0x30')]);_0x4d3773[_0x0949('0x2f')]=qs['offset'](_0x390cb1[_0x0949('0x44')]['offset']);}_0x4d3773[_0x0949('0x4c')]=qs['sort'](_0x390cb1[_0x0949('0x44')]['sort']);_0x4d3773['where']=qs[_0x0949('0x46')](_[_0x0949('0x6a')](_0x390cb1[_0x0949('0x44')],_0x543f81[_0x0949('0x46')]));_0x4d3773[_0x0949('0x4f')][_0x0949('0x65')]=_0x846356['id'];if(_0x390cb1[_0x0949('0x44')]['filter']){_0x4d3773[_0x0949('0x4f')]=_[_0x0949('0x59')](_0x4d3773[_0x0949('0x4f')],{'$or':_[_0x0949('0x3f')](_0x4d3773[_0x0949('0x48')],function(_0x14bc18){var _0x302974={};_0x302974[_0x14bc18]={'$like':'%'+_0x390cb1[_0x0949('0x44')][_0x0949('0x4e')]+'%'};return _0x302974;})});}_0x4d3773=_[_0x0949('0x59')]({},_0x4d3773,_0x390cb1['options']);return db[_0x0949('0x66')][_0x0949('0x2e')]({'where':_0x4d3773[_0x0949('0x4f')]})[_0x0949('0x1e')](function(_0x593b74){_0x1161c7['count']=_0x593b74;if(_0x390cb1[_0x0949('0x44')][_0x0949('0x52')]){_0x4d3773[_0x0949('0x53')]=[{'all':!![]}];}return db[_0x0949('0x66')][_0x0949('0x55')](_0x4d3773);})[_0x0949('0x1e')](function(_0x19beec){_0x1161c7[_0x0949('0x56')]=_0x19beec;return _0x1161c7;});}})[_0x0949('0x1e')](respondWithFilteredResult(_0x527d67,_0x4d3773))[_0x0949('0x57')](handleError(_0x527d67,null));};exports[_0x0949('0x6b')]=function(_0x2f9c1f,_0x1497f6,_0x27cb2e){return db['WhatsappAccount'][_0x0949('0x5a')]({'where':{'id':_0x2f9c1f[_0x0949('0x63')]['id']}})[_0x0949('0x1e')](handleEntityNotFound(_0x1497f6,null))['then'](function(_0x13cfc3){if(_0x13cfc3){return _0x13cfc3['removeDispositions'](_0x2f9c1f['query'][_0x0949('0x6c')]);}})[_0x0949('0x1e')](respondWithStatusCode(_0x1497f6,null))['catch'](handleError(_0x1497f6,null));};exports[_0x0949('0x6d')]=function(_0x1a7b7a,_0xaebe16,_0x5d1443){if(_0x1a7b7a[_0x0949('0x5c')]['id']){delete _0x1a7b7a[_0x0949('0x5c')]['id'];}return db[_0x0949('0x54')][_0x0949('0x5a')]({'where':{'id':_0x1a7b7a['params']['id']}})[_0x0949('0x1e')](handleEntityNotFound(_0xaebe16,null))[_0x0949('0x1e')](function(_0x1bba30){if(_0x1bba30){_0x1a7b7a[_0x0949('0x5c')][_0x0949('0x65')]=_0x1bba30['id'];return db[_0x0949('0x6e')]['create'](_0x1a7b7a[_0x0949('0x5c')]);}})['then'](respondWithResult(_0xaebe16,null))[_0x0949('0x57')](handleError(_0xaebe16,null));};exports[_0x0949('0x6f')]=function(_0x1e2a6f,_0x1809fa,_0x29be10){var _0xa5d7fa={'raw':![],'where':{}};var _0x25bb73={};var _0x134e9c={'count':0x0,'rows':[]};return db[_0x0949('0x54')][_0x0949('0x68')]({'where':{'id':_0x1e2a6f[_0x0949('0x63')]['id']}})[_0x0949('0x1e')](handleEntityNotFound(_0x1809fa,null))[_0x0949('0x1e')](function(_0x2854ef){if(_0x2854ef){_0x25bb73['model']=_[_0x0949('0x45')](db[_0x0949('0x6e')][_0x0949('0x40')]);_0x25bb73['query']=_[_0x0949('0x45')](_0x1e2a6f[_0x0949('0x44')]);_0x25bb73['filters']=_[_0x0949('0x47')](_0x25bb73['model'],_0x25bb73[_0x0949('0x44')]);_0xa5d7fa[_0x0949('0x48')]=_['intersection'](_0x25bb73[_0x0949('0x43')],qs['fields'](_0x1e2a6f['query'][_0x0949('0x49')]));_0xa5d7fa[_0x0949('0x48')]=_0xa5d7fa[_0x0949('0x48')][_0x0949('0x69')]?_0xa5d7fa[_0x0949('0x48')]:_0x25bb73[_0x0949('0x43')];if(!_0x1e2a6f[_0x0949('0x44')][_0x0949('0x4a')]('nolimit')){_0xa5d7fa[_0x0949('0x30')]=qs[_0x0949('0x30')](_0x1e2a6f['query'][_0x0949('0x30')]);_0xa5d7fa[_0x0949('0x2f')]=qs['offset'](_0x1e2a6f[_0x0949('0x44')][_0x0949('0x2f')]);}_0xa5d7fa['order']=qs['sort'](_0x1e2a6f[_0x0949('0x44')][_0x0949('0x4d')]);_0xa5d7fa[_0x0949('0x4f')]=qs[_0x0949('0x46')](_[_0x0949('0x6a')](_0x1e2a6f['query'],_0x25bb73[_0x0949('0x46')]));_0xa5d7fa[_0x0949('0x4f')]['WhatsappAccountId']=_0x2854ef['id'];if(_0x1e2a6f[_0x0949('0x44')][_0x0949('0x4e')]){_0xa5d7fa[_0x0949('0x4f')]=_['merge'](_0xa5d7fa[_0x0949('0x4f')],{'$or':_[_0x0949('0x3f')](_0xa5d7fa[_0x0949('0x48')],function(_0x633b72){var _0x232627={};_0x232627[_0x633b72]={'$like':'%'+_0x1e2a6f['query'][_0x0949('0x4e')]+'%'};return _0x232627;})});}_0xa5d7fa=_[_0x0949('0x59')]({},_0xa5d7fa,_0x1e2a6f['options']);return db[_0x0949('0x6e')][_0x0949('0x2e')]({'where':_0xa5d7fa[_0x0949('0x4f')]})[_0x0949('0x1e')](function(_0x50ddf1){_0x134e9c[_0x0949('0x2e')]=_0x50ddf1;if(_0x1e2a6f[_0x0949('0x44')][_0x0949('0x52')]){_0xa5d7fa[_0x0949('0x53')]=[{'all':!![]}];}return db[_0x0949('0x6e')][_0x0949('0x55')](_0xa5d7fa);})[_0x0949('0x1e')](function(_0x2c927c){_0x134e9c['rows']=_0x2c927c;return _0x134e9c;});}})[_0x0949('0x1e')](respondWithFilteredResult(_0x1809fa,_0xa5d7fa))[_0x0949('0x57')](handleError(_0x1809fa,null));};exports['removeAnswers']=function(_0x1e9293,_0x24bc88,_0x5cf173){return db['WhatsappAccount'][_0x0949('0x5a')]({'where':{'id':_0x1e9293['params']['id']}})[_0x0949('0x1e')](handleEntityNotFound(_0x24bc88,null))[_0x0949('0x1e')](function(_0x51016b){if(_0x51016b){return _0x51016b[_0x0949('0x70')](_0x1e9293[_0x0949('0x44')][_0x0949('0x6c')]);}})[_0x0949('0x1e')](respondWithStatusCode(_0x24bc88,null))['catch'](handleError(_0x24bc88,null));};exports['addAgents']=function(_0x3ed849,_0x175a46,_0x11aadf){return db['WhatsappAccount'][_0x0949('0x5a')]({'where':{'id':_0x3ed849[_0x0949('0x63')]['id']}})['then'](handleEntityNotFound(_0x175a46,null))[_0x0949('0x1e')](function(_0x552399){if(_0x552399){return _0x552399[_0x0949('0x71')](_0x3ed849[_0x0949('0x5c')][_0x0949('0x6c')],_[_0x0949('0x72')](_0x3ed849[_0x0949('0x5c')],[_0x0949('0x6c'),'id'])||{})[_0x0949('0x73')](function(_0x288c1a){for(var _0x39e490=0x0;_0x39e490<_0x3ed849[_0x0949('0x5c')][_0x0949('0x6c')][_0x0949('0x69')];_0x39e490+=0x1){socket[_0x0949('0x74')](_0x0949('0x75'),{'UserId':Number(_0x3ed849['body'][_0x0949('0x6c')][_0x39e490]),'WhatsappAccountId':Number(_0x3ed849['params']['id'])});}return _0x288c1a;});}})[_0x0949('0x1e')](respondWithResult(_0x175a46,null))[_0x0949('0x57')](handleError(_0x175a46,null));};exports[_0x0949('0x76')]=function(_0x488cdf,_0x38142f,_0x4bee19){return db[_0x0949('0x54')][_0x0949('0x5a')]({'where':{'id':_0x488cdf[_0x0949('0x63')]['id']}})[_0x0949('0x1e')](handleEntityNotFound(_0x38142f,null))[_0x0949('0x1e')](function(_0x3a142b){if(_0x3a142b){return _0x3a142b[_0x0949('0x76')](_0x488cdf[_0x0949('0x44')]['ids'])[_0x0949('0x1e')](function(){if(_['isArray'](_0x488cdf['query'][_0x0949('0x6c')])){for(var _0x405b05=0x0;_0x405b05<_0x488cdf[_0x0949('0x44')][_0x0949('0x6c')][_0x0949('0x69')];_0x405b05+=0x1){socket[_0x0949('0x74')]('userWhatsappAccount:remove',{'UserId':Number(_0x488cdf[_0x0949('0x44')][_0x0949('0x6c')][_0x405b05]),'WhatsappAccountId':Number(_0x488cdf[_0x0949('0x63')]['id'])});}}else{socket['emit']('userWhatsappAccount:remove',{'UserId':Number(_0x488cdf['query'][_0x0949('0x6c')]),'WhatsappAccountId':Number(_0x488cdf[_0x0949('0x63')]['id'])});}});}})[_0x0949('0x1e')](respondWithStatusCode(_0x38142f,null))[_0x0949('0x57')](handleError(_0x38142f,null));};exports['getAgents']=function(_0x207b8f,_0x3c3ce3,_0x47ddb9){var _0x5de502={};var _0x5f0ad1={};var _0x2012f9;var _0x3700d7;return db['WhatsappAccount'][_0x0949('0x68')]({'where':{'id':_0x207b8f[_0x0949('0x63')]['id']}})[_0x0949('0x1e')](handleEntityNotFound(_0x3c3ce3,null))[_0x0949('0x1e')](function(_0x4a211c){if(_0x4a211c){_0x2012f9=_0x4a211c;_0x5f0ad1[_0x0949('0x43')]=_[_0x0949('0x45')](db['User']['rawAttributes']);_0x5f0ad1[_0x0949('0x44')]=_[_0x0949('0x45')](_0x207b8f[_0x0949('0x44')]);_0x5f0ad1['filters']=_[_0x0949('0x47')](_0x5f0ad1[_0x0949('0x43')],_0x5f0ad1[_0x0949('0x44')]);_0x5de502['attributes']=_[_0x0949('0x47')](_0x5f0ad1[_0x0949('0x43')],qs[_0x0949('0x49')](_0x207b8f[_0x0949('0x44')][_0x0949('0x49')]));_0x5de502['attributes']=_0x5de502[_0x0949('0x48')]['length']?_0x5de502['attributes']:_0x5f0ad1[_0x0949('0x43')];_0x5de502['order']=qs['sort'](_0x207b8f[_0x0949('0x44')]['sort']);_0x5de502[_0x0949('0x4f')]=qs[_0x0949('0x46')](_['pick'](_0x207b8f[_0x0949('0x44')],_0x5f0ad1[_0x0949('0x46')]));if(_0x207b8f[_0x0949('0x44')]['filter']){_0x5de502['where']=_['merge'](_0x5de502[_0x0949('0x4f')],{'$or':_[_0x0949('0x3f')](_0x5de502[_0x0949('0x48')],function(_0x116467){var _0x40cb0e={};_0x40cb0e[_0x116467]={'$like':'%'+_0x207b8f[_0x0949('0x44')][_0x0949('0x4e')]+'%'};return _0x40cb0e;})});}_0x5de502=_[_0x0949('0x59')]({},_0x5de502,_0x207b8f[_0x0949('0x51')]);return _0x2012f9[_0x0949('0x77')](_0x5de502);}})['then'](function(_0x37f213){if(_0x37f213){_0x3700d7=_0x37f213['length'];if(!_0x207b8f[_0x0949('0x44')][_0x0949('0x4a')]('nolimit')){_0x5de502[_0x0949('0x30')]=qs[_0x0949('0x30')](_0x207b8f[_0x0949('0x44')][_0x0949('0x30')]);_0x5de502[_0x0949('0x2f')]=qs[_0x0949('0x2f')](_0x207b8f[_0x0949('0x44')]['offset']);}return _0x2012f9[_0x0949('0x77')](_0x5de502);}})[_0x0949('0x1e')](function(_0x4eab51){if(_0x4eab51){return _0x4eab51?{'count':_0x3700d7,'rows':_0x4eab51}:null;}})[_0x0949('0x1e')](respondWithResult(_0x3c3ce3,null))['catch'](handleError(_0x3c3ce3,null));};exports[_0x0949('0x78')]=function(_0x39847b,_0x12608f){var _0x2be35a=_0x39847b[_0x0949('0x63')]['id'];var _0x260bea=_0x39847b[_0x0949('0x5c')];var _0x2e7697=0xc8;var _0x5987ce=null;return db[_0x0949('0x79')][_0x0949('0x7a')]({'isolationLevel':db[_0x0949('0x79')][_0x0949('0x7b')][_0x0949('0x7c')]['READ_COMMITTED']},function(_0x18a880){return db['WhatsappAccount'][_0x0949('0x68')]({'where':{'id':_0x2be35a},'transaction':_0x18a880})['then'](function(_0x3e362b){if(_0x3e362b){return db[_0x0949('0x7d')]['destroy']({'where':{'WhatsappAccountId':_0x2be35a},'transaction':_0x18a880})[_0x0949('0x1e')](function(){var _0x1c50ba=_[_0x0949('0x3f')](_0x260bea,function(_0xdd8aa3){_0xdd8aa3[_0x0949('0x65')]=_0x2be35a;return _0xdd8aa3;});return db['WhatsappApplication'][_0x0949('0x7e')](_0x1c50ba,{'transaction':_0x18a880});});}else{_0x2e7697=0x194;_0x5987ce=[];}});})[_0x0949('0x1e')](function(){if(_0x2e7697!==0x194){return db['WhatsappApplication']['findAndCountAll']({'where':{'WhatsappAccountId':_0x2be35a},'order':_0x0949('0x7f')})[_0x0949('0x1e')](function(_0x578226){_0x5987ce=_0x578226;});}})['catch'](function(_0x15179a){_0x2e7697=0x1f4;logger[_0x0949('0x25')](_0x15179a['stack']);if(_0x15179a[_0x0949('0x3b')]){delete _0x15179a[_0x0949('0x3b')];}_0x5987ce=_0x15179a;})[_0x0949('0x80')](function(){if(_0x5987ce===null){_0x12608f[_0x0949('0x29')](_0x2e7697);}else{if(_0x2e7697===0x1f4){_0x12608f[_0x0949('0x2a')](_0x2e7697)[_0x0949('0x3c')](_0x5987ce);}else{_0x12608f[_0x0949('0x2a')](_0x2e7697)[_0x0949('0x2c')](_0x5987ce);}}});};exports[_0x0949('0x81')]=function(_0x167ca8,_0x52eb96,_0x1a0982){var _0x2ce15b={};var _0x15d635={};var _0xfd2e11;var _0x8c861e;return db[_0x0949('0x54')][_0x0949('0x68')]({'where':{'id':_0x167ca8['params']['id']}})[_0x0949('0x1e')](handleEntityNotFound(_0x52eb96,null))['then'](function(_0x1bf998){if(_0x1bf998){_0xfd2e11=_0x1bf998;_0x15d635[_0x0949('0x43')]=_[_0x0949('0x45')](db[_0x0949('0x7d')][_0x0949('0x40')]);_0x15d635[_0x0949('0x44')]=_[_0x0949('0x45')](_0x167ca8[_0x0949('0x44')]);_0x15d635[_0x0949('0x46')]=_[_0x0949('0x47')](_0x15d635[_0x0949('0x43')],_0x15d635[_0x0949('0x44')]);_0x2ce15b[_0x0949('0x48')]=_['intersection'](_0x15d635[_0x0949('0x43')],qs[_0x0949('0x49')](_0x167ca8[_0x0949('0x44')][_0x0949('0x49')]));_0x2ce15b[_0x0949('0x48')]=_0x2ce15b[_0x0949('0x48')][_0x0949('0x69')]?_0x2ce15b[_0x0949('0x48')]:_0x15d635['model'];_0x2ce15b[_0x0949('0x4c')]=qs[_0x0949('0x4d')](_0x167ca8['query'][_0x0949('0x4d')]);_0x2ce15b[_0x0949('0x4f')]=qs[_0x0949('0x46')](_[_0x0949('0x6a')](_0x167ca8[_0x0949('0x44')],_0x15d635[_0x0949('0x46')]));if(_0x167ca8[_0x0949('0x44')][_0x0949('0x4e')]){_0x2ce15b[_0x0949('0x4f')]=_[_0x0949('0x59')](_0x2ce15b[_0x0949('0x4f')],{'$or':_[_0x0949('0x3f')](_0x2ce15b[_0x0949('0x48')],function(_0x5d48bd){var _0x21ea16={};_0x21ea16[_0x5d48bd]={'$like':'%'+_0x167ca8[_0x0949('0x44')][_0x0949('0x4e')]+'%'};return _0x21ea16;})});}_0x2ce15b=_['merge']({},_0x2ce15b,_0x167ca8[_0x0949('0x51')]);return _0xfd2e11[_0x0949('0x81')](_0x2ce15b);}})['then'](function(_0x59120a){if(_0x59120a){_0x8c861e=_0x59120a[_0x0949('0x69')];if(!_0x167ca8['query'][_0x0949('0x4a')](_0x0949('0x4b'))){_0x2ce15b[_0x0949('0x30')]=qs[_0x0949('0x30')](_0x167ca8[_0x0949('0x44')][_0x0949('0x30')]);_0x2ce15b['offset']=qs[_0x0949('0x2f')](_0x167ca8['query'][_0x0949('0x2f')]);}return _0xfd2e11[_0x0949('0x81')](_0x2ce15b);}})[_0x0949('0x1e')](function(_0x31adbc){if(_0x31adbc){return _0x31adbc?{'count':_0x8c861e,'rows':_0x31adbc}:null;}})['then'](respondWithResult(_0x52eb96,null))[_0x0949('0x57')](handleError(_0x52eb96,null));};exports[_0x0949('0x82')]=function(_0x4f9205,_0x4532e3,_0x327eaa){var _0x20bff4={'channel':_0x0949('0x83')};var _0x3c49f3=[];var _0x4e9426=[];var _0x9a0a7b={};return db[_0x0949('0x54')][_0x0949('0x5a')]({'where':{'id':_0x4f9205['params']['id']},'include':[{'model':db[_0x0949('0x7d')],'as':_0x0949('0x84')}]})[_0x0949('0x1e')](handleEntityNotFound(_0x4532e3,null))['then'](function(_0x2a9232){_0x20bff4[_0x0949('0x85')]=_0x2a9232;if(_0x20bff4[_0x0949('0x85')]&&_0x20bff4[_0x0949('0x85')][_0x0949('0x42')]===_0x0949('0x86')&&_0x4f9205[_0x0949('0x5c')][_0x0949('0x87')]){if(_0x4f9205[_0x0949('0x5c')]['statuses'][_0x0949('0x69')]===0x0)return;if(_0x4f9205[_0x0949('0x5c')][_0x0949('0x87')][0x0][_0x0949('0x88')]!=='read')return;return db[_0x0949('0x89')]['update']({'read':!![],'readAt':_0x4f9205[_0x0949('0x5c')][_0x0949('0x87')][0x0]['timestamp']},{'where':{'messageId':_0x4f9205['body'][_0x0949('0x87')][0x0]['message_id']},'individualHooks':!![]})['then'](function(_0x5078ec){return _0x4532e3['status'](0xc8)[_0x0949('0x2c')](_0x5078ec);});}_0x20bff4['applications']=_[_0x0949('0x8a')](_0x2a9232[_0x0949('0x84')],[_0x0949('0x7f')],[_0x0949('0x8b')]);if(_0x20bff4['account'][_0x0949('0x84')]){delete _0x20bff4[_0x0949('0x85')][_0x0949('0x84')];}return db[_0x0949('0x8c')]['describe']()[_0x0949('0x1e')](function(_0x4a8cef){if(!_0x4a8cef){throw new db['Sequelize'][(_0x0949('0x8d'))](_0x0949('0x8e'));}_0x3c49f3=_[_0x0949('0x8f')](_['keys'](_0x4a8cef),[_0x0949('0x90'),_0x0949('0x91')]);_0x4e9426=_[_0x0949('0x8f')](_[_0x0949('0x45')](_0x4a8cef),[_0x0949('0x90'),'updatedAt',_0x0949('0x92'),_0x0949('0x93')]);_0x20bff4[_0x0949('0x5c')]={'mapKey':_0x0949('0x94')};if(_0x20bff4[_0x0949('0x85')]&&_0x20bff4[_0x0949('0x85')][_0x0949('0x42')]==='twilio'){_0x20bff4[_0x0949('0x5c')][_0x0949('0x95')]=_0x4f9205[_0x0949('0x5c')]['From']['replace'](_0x0949('0x96'),'');_0x20bff4[_0x0949('0x5c')]['body']=_0x4f9205[_0x0949('0x5c')]['Body'];_0x20bff4[_0x0949('0x5c')][_0x0949('0x97')]=_0x4f9205[_0x0949('0x5c')]['MessageSid'];}if(_0x20bff4['account']&&_0x20bff4[_0x0949('0x85')][_0x0949('0x42')]===_0x0949('0x86')){_0x20bff4['body'][_0x0949('0x95')]=_0x4f9205[_0x0949('0x5c')][_0x0949('0x98')][0x0][_0x0949('0x95')];_0x20bff4[_0x0949('0x5c')][_0x0949('0x5c')]=_0x4f9205[_0x0949('0x5c')]['notifications'][0x0][_0x0949('0x27')]['body'];_0x20bff4[_0x0949('0x5c')][_0x0949('0x97')]=_0x4f9205['body'][_0x0949('0x98')][0x0][_0x0949('0x99')];}if(_0x20bff4['body']['id']){delete _0x20bff4[_0x0949('0x5c')]['id'];}if(_['isNil'](_0x20bff4[_0x0949('0x5c')][_0x0949('0x95')])){throw new db[(_0x0949('0x9a'))][(_0x0949('0x8d'))]('from\x20is\x20mandatory');}if(_[_0x0949('0x9b')](_0x20bff4[_0x0949('0x5c')][_0x0949('0x5c')])||_0x20bff4[_0x0949('0x5c')][_0x0949('0x5c')]===''){throw new db[(_0x0949('0x9a'))]['ValidationError'](_0x0949('0x9c'));}if(_[_0x0949('0x9b')](_0x20bff4[_0x0949('0x5c')][_0x0949('0x9d')])){throw new db['Sequelize'][(_0x0949('0x8d'))](_0x0949('0x9e')+_0x4e9426);}if(!_[_0x0949('0x9f')](_0x4e9426,_0x20bff4['body'][_0x0949('0x9d')])){throw new db[(_0x0949('0x9a'))]['ValidationError'](_0x0949('0xa0')+_0x4e9426);}_0x9a0a7b[_0x20bff4['body'][_0x0949('0x9d')]]=_0x20bff4[_0x0949('0x5c')][_0x0949('0x95')];return db[_0x0949('0xa1')]['find']({'where':{'id':_0x20bff4['account'][_0x0949('0x93')]},'include':[{'model':db[_0x0949('0x8c')],'as':_0x0949('0xa2'),'where':_0x9a0a7b,'limit':0x1,'order':[[_0x0949('0x91'),'DESC']]}]});})[_0x0949('0x1e')](handleEntityNotFound(_0x4532e3,null))[_0x0949('0x1e')](function(_0x3ba391){if(_0x3ba391){_0x20bff4['list']=_[_0x0949('0x72')](_0x3ba391,[_0x0949('0xa2')]);if(_0x3ba391['Contacts']['length']){return _0x3ba391[_0x0949('0xa2')][0x0];}var _0x288b74=_[_0x0949('0x19')](_0x20bff4['body'],{'firstName':_0x20bff4[_0x0949('0x5c')][_0x0949('0x95')],'ListId':_0x3ba391['id']});_0x288b74[_0x20bff4[_0x0949('0x5c')][_0x0949('0x9d')]]=_0x20bff4[_0x0949('0x5c')][_0x0949('0x95')];return db[_0x0949('0x8c')]['create'](_0x288b74,{'fields':_0x3c49f3,'raw':!![]});}})[_0x0949('0x1e')](handleEntityNotFound(_0x4532e3,null))['then'](function(_0x4170c3){if(_0x4170c3){_0x20bff4[_0x0949('0xa3')]=_0x4170c3;var _0x30b0d1={'ContactId':_0x4170c3['id'],'phone':_0x20bff4[_0x0949('0x5c')]['from'],'WhatsappAccountId':_0x4f9205[_0x0949('0x63')]['id']};var _0x103dd8={'ContactId':_0x4170c3['id'],'WhatsappAccountId':_0x4f9205[_0x0949('0x63')]['id'],'closed':![]};return db[_0x0949('0xa4')]['find']({'where':_0x103dd8})[_0x0949('0x1e')](function(_0x538113){if(_0x538113){return[_0x538113,![]];}return db['WhatsappInteraction'][_0x0949('0x5b')](_0x30b0d1)[_0x0949('0x1e')](function(_0x309eb8){return[_0x309eb8,!![]];});});}})[_0x0949('0x73')](function(_0x2b6d7d,_0x335f5d){_0x20bff4[_0x0949('0xa5')]=_0x2b6d7d[_0x0949('0x38')]({'plain':!![]});_0x20bff4['interaction']['created']=![];if(_0x335f5d){if(_0x20bff4[_0x0949('0x85')]['autoclose']){_0x20bff4[_0x0949('0xa6')]['push']({'id':0x0,'priority':_0x20bff4['applications'][_0x0949('0x69')]+0x1,'app':_0x0949('0xa7'),'appdata':_0x0949('0xa8'),'interval':_0x0949('0xa9')});}_0x20bff4[_0x0949('0xa5')]['created']=!![];}return db[_0x0949('0x89')][_0x0949('0x5b')]({'phone':_0x20bff4['body']['from'],'messageId':_0x20bff4['body']['messageId'],'body':_0x20bff4[_0x0949('0x5c')]['body'],'WhatsappAccountId':_0x4f9205[_0x0949('0x63')]['id'],'WhatsappInteractionId':_0x2b6d7d['id'],'direction':'in','ContactId':_0x2b6d7d[_0x0949('0xaa')],'AttachmentId':_0x20bff4['body'][_0x0949('0xab')]});})[_0x0949('0x1e')](function(_0x54c1ff){_0x20bff4[_0x0949('0x27')]=_0x54c1ff;if(!_0x20bff4[_0x0949('0xa5')][_0x0949('0xac')])return;return db[_0x0949('0xad')][_0x0949('0x5a')]({'attributes':['id',_0x0949('0x3b')],'where':{'id':_0x20bff4[_0x0949('0xa5')][_0x0949('0xac')]}});})[_0x0949('0x1e')](function(_0x10bac5){if(_0x10bac5){_0x20bff4['applications'][_0x0949('0xae')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x10bac5[_0x0949('0x3b')]+','+(_0x20bff4[_0x0949('0x85')][_0x0949('0xaf')]||0xa),'interval':_0x0949('0xa9')});}if(!_0x20bff4['interaction'][_0x0949('0xb0')])return;return db[_0x0949('0xb1')][_0x0949('0x5a')]({'attributes':['id',_0x0949('0x3b')],'where':{'id':_0x20bff4['interaction'][_0x0949('0xb0')]}});})['then'](function(_0x5e30d9){if(_0x5e30d9){_0x20bff4[_0x0949('0xa6')][_0x0949('0xae')]({'id':0x0,'priority':0x1,'app':'queue','appdata':_0x5e30d9[_0x0949('0x3b')]+','+(_0x20bff4['account'][_0x0949('0xb2')]||0x12c),'interval':_0x0949('0xa9')});}return respondWithRpcPromise(_0x0949('0xb3'),'startRouting',_0x20bff4);})[_0x0949('0x1e')](function(_0x190b5c){if(_0x190b5c){var _0xbc1612=0xc8;var _0x49453d=_0x0949('0xb4');logger['info'](_0x0949('0x23'),_0x49453d,_0xbc1612,_0x0949('0xb5'));logger[_0x0949('0x22')](_0x0949('0xb6'),_0x49453d,_0xbc1612,_0x0949('0xb5'),JSON[_0x0949('0x24')](_0x190b5c));if(_0x20bff4['account'][_0x0949('0x42')]===_0x0949('0xb7')){return _0x4532e3[_0x0949('0x2a')](_0xbc1612)[_0x0949('0x31')](_0x0949('0xb8'),'text/xml')['send']('\x0a');}else{return _0x4532e3[_0x0949('0x2a')](_0xbc1612)[_0x0949('0x2c')](_0x190b5c);}}});})['catch'](handleError(_0x4532e3,null));};exports['send']=function(_0x103cb1,_0x242829,_0x49705c){var _0x5d3f75,_0x26fcab,_0x133340;if(_[_0x0949('0x9b')](_0x103cb1[_0x0949('0x5c')]['body'])||_0x103cb1['body']['body']===''){throw new db[(_0x0949('0x9a'))][(_0x0949('0x8d'))](_0x0949('0x9c'));}if(_[_0x0949('0x9b')](_0x103cb1[_0x0949('0x5c')]['to'])){throw new db['Sequelize'][(_0x0949('0x8d'))](_0x0949('0xb9'));}_0x5d3f75=_0x103cb1[_0x0949('0x5c')]['to'];return db[_0x0949('0x54')]['find']({'where':{'id':_0x103cb1[_0x0949('0x63')]['id']},'include':[{'model':db[_0x0949('0xa1')],'as':_0x0949('0xba'),'include':[{'model':db[_0x0949('0x8c')],'as':_0x0949('0xa2'),'where':{'mobile':_0x5d3f75},'limit':0x1,'order':[[_0x0949('0x91'),_0x0949('0xbb')]]}]}]})[_0x0949('0x1e')](handleEntityNotFound(_0x242829,null))[_0x0949('0x1e')](function(_0x541122){if(_0x541122&&_0x541122[_0x0949('0xba')]){_0x26fcab=_0x541122['get']({'plain':!![]});if(_0x26fcab[_0x0949('0xba')]&&_0x26fcab['List']['Contacts'][_0x0949('0x69')]){return _0x26fcab[_0x0949('0xba')]['Contacts'][0x0];}return db[_0x0949('0x8c')]['create'](_['defaults'](_0x103cb1[_0x0949('0x5c')],{'firstName':_0x5d3f75,'mobile':_0x5d3f75,'phone':_0x5d3f75,'ListId':_0x26fcab['ListId']}));}})['then'](handleEntityNotFound(_0x242829,null))[_0x0949('0x1e')](function(_0x27cb9c){if(_0x27cb9c){_0x133340=_0x27cb9c;return db[_0x0949('0xa4')]['find']({'where':{'ContactId':_0x133340['id'],'closed':![],'WhatsappAccountId':_0x26fcab['id']}})[_0x0949('0x1e')](function(_0x411363){if(_0x411363){return[_0x411363,![]];}return db[_0x0949('0xa4')][_0x0949('0x5b')]({'UserId':_0x103cb1['user']['id'],'ContactId':_0x133340['id'],'WhatsappAccountId':_0x26fcab['id'],'phone':_0x5d3f75,'firstMsgDirection':'out','Messages':[_['merge'](_0x103cb1[_0x0949('0x5c')],{'read':![],'body':_0x103cb1[_0x0949('0x5c')][_0x0949('0x5c')],'phone':_0x5d3f75,'WhatsappAccountId':_0x26fcab['id'],'UserId':_0x103cb1[_0x0949('0x5d')]['id'],'ContactId':_0x133340['id']})]},{'include':[{'model':db[_0x0949('0x89')],'as':'Messages'}]})[_0x0949('0x1e')](function(_0x5c4607){return[_0x5c4607,!![]];});});}})[_0x0949('0x73')](function(_0x170ad4,_0xb4eed2){if(_0xb4eed2){return _0x170ad4;}return db[_0x0949('0x89')][_0x0949('0x5b')](_['merge'](_0x103cb1[_0x0949('0x5c')],{'read':![],'body':_0x103cb1[_0x0949('0x5c')][_0x0949('0x5c')],'phone':_0x5d3f75,'WhatsappAccountId':_0x26fcab['id'],'WhatsappInteractionId':_0x170ad4['id'],'UserId':_0x103cb1['user']['id'],'ContactId':_0x133340['id']}))[_0x0949('0x1e')](function(_0x5aad89){_0x170ad4[_0x0949('0xbc')][_0x0949('0xbd')]=[];_0x170ad4['dataValues'][_0x0949('0xbd')][_0x0949('0xbe')](_0x5aad89['dataValues']);return _0x170ad4;});})[_0x0949('0x1e')](respondWithResult(_0x242829,null))['catch'](handleError(_0x242829,null));}; \ No newline at end of file +var _0x42cd=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','./whatsappAccount.socket','register','jayson/promise','client','http','request','then','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','sendStatus','end','json','undefined','count','offset','limit','status','set','reject','save','update','destroy','get','WhatsappAccounts','name','index','Pause','map','WhatsappAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','show','params','mandatoryDispositionPause','fields','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','addDisposition','WhatsappAccountId','getDispositions','findOne','options','Disposition','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','nolimit','removeAnswers','addAgents','omit','spread','userWhatsappAccount:save','isArray','emit','userWhatsappAccount:remove','getAgents','User','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','WhatsappApplication','bulkCreate','priority','finally','send','getApplications','notify','account','sinch','state','read','WhatsappMessage','statuses','applications','orderBy','Applications','asc','CmContact','describe','Sequelize','ValidationError','difference','createdAt','updatedAt','CompanyId','ListId','twilio','from','From','replace','whatsapp:','Body','messageId','notifications','message_id','isNil','from\x20is\x20mandatory','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','list','contact','WhatsappInteraction','interaction','created','push','unmanaged','AttachmentId','UserId','unshift','agent','*,*,*,*','queueId','WhatsappQueue','queue','waitForTheAssignedQueue','Start','receiveMessage','info','WhatsappAccount,\x20%s,\x20%s,\x20%s','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','\x0a','body\x20is\x20mandatory\x20and\x20not\x20empty','to\x20is\x20mandatory','List','out','Messages','dataValues','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x313820,_0x28a767){var _0x1047ad=function(_0x339b78){while(--_0x339b78){_0x313820['push'](_0x313820['shift']());}};_0x1047ad(++_0x28a767);}(_0x42cd,0x17f));var _0xd42c=function(_0x24f3f9,_0x538f12){_0x24f3f9=_0x24f3f9-0x0;var _0x1e1ace=_0x42cd[_0x24f3f9];return _0x1e1ace;};'use strict';var emlformat=require(_0xd42c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd42c('0x1'));var jsonpatch=require(_0xd42c('0x2'));var rp=require(_0xd42c('0x3'));var moment=require(_0xd42c('0x4'));var BPromise=require(_0xd42c('0x5'));var Mustache=require(_0xd42c('0x6'));var util=require(_0xd42c('0x7'));var path=require(_0xd42c('0x8'));var sox=require(_0xd42c('0x9'));var csv=require(_0xd42c('0xa'));var ejs=require(_0xd42c('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd42c('0xc'));var squel=require(_0xd42c('0xd'));var crypto=require(_0xd42c('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xd42c('0xf'));var toCsv=require(_0xd42c('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd42c('0x10'));var authService=require(_0xd42c('0x11'));var qs=require(_0xd42c('0x12'));var as=require(_0xd42c('0x13'));var hardwareService=require(_0xd42c('0x14'));var logger=require(_0xd42c('0x15'))(_0xd42c('0x16'));var utils=require(_0xd42c('0x17'));var config=require(_0xd42c('0x18'));var licenseUtil=require(_0xd42c('0x19'));var db=require(_0xd42c('0x1a'))['db'];config['redis']=_[_0xd42c('0x1b')](config[_0xd42c('0x1c')],{'host':_0xd42c('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd42c('0x1c')]));require(_0xd42c('0x1e'))[_0xd42c('0x1f')](socket);var jayson=require(_0xd42c('0x20'));var client=jayson[_0xd42c('0x21')][_0xd42c('0x22')]({'port':0x232c});function respondWithRpcPromise(_0x42e78f,_0x187e3b,_0x4fd128,_0x4dead2){return new BPromise(function(_0x37c728,_0x44d99c){var _0x44de78=_0x4dead2||client;return _0x44de78[_0xd42c('0x23')](_0x42e78f,_0x4fd128)[_0xd42c('0x24')](function(_0x118d6b){logger['info'](_0xd42c('0x25'),_0x187e3b,_0xd42c('0x26'));logger[_0xd42c('0x27')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x187e3b,_0xd42c('0x26'),JSON[_0xd42c('0x28')](_0x118d6b));if(_0x118d6b[_0xd42c('0x29')]){if(_0x118d6b[_0xd42c('0x29')]['code']===0x1f4){logger['error'](_0xd42c('0x25'),_0x187e3b,_0x118d6b[_0xd42c('0x29')]['message']);return _0x44d99c(_0x118d6b[_0xd42c('0x29')][_0xd42c('0x2a')]);}logger[_0xd42c('0x29')](_0xd42c('0x25'),_0x187e3b,_0x118d6b[_0xd42c('0x29')]['message']);return _0x37c728(_0x118d6b[_0xd42c('0x29')]['message']);}else{logger['info'](_0xd42c('0x25'),_0x187e3b,_0xd42c('0x26'));_0x37c728(_0x118d6b[_0xd42c('0x2b')]['message']);}})[_0xd42c('0x2c')](function(_0x48d052){logger['error'](_0xd42c('0x25'),_0x187e3b,_0x48d052);_0x44d99c(_0x48d052);});});}function respondWithStatusCode(_0x50ced2,_0xb37dd){_0xb37dd=_0xb37dd||0xcc;return function(_0x9f891a){if(_0x9f891a){return _0x50ced2[_0xd42c('0x2d')](_0xb37dd);}return _0x50ced2['status'](_0xb37dd)[_0xd42c('0x2e')]();};}function respondWithResult(_0x30d785,_0x36a815){_0x36a815=_0x36a815||0xc8;return function(_0x39bc88){if(_0x39bc88){return _0x30d785['status'](_0x36a815)[_0xd42c('0x2f')](_0x39bc88);}};}function respondWithFilteredResult(_0x5ba5b5,_0xac3ce4){return function(_0xf3c3f3){if(_0xf3c3f3){var _0x2ea7be=typeof _0xac3ce4['offset']===_0xd42c('0x30')&&typeof _0xac3ce4['limit']===_0xd42c('0x30');var _0x70215b=_0xf3c3f3['count'];var _0x1f586b=_0x2ea7be?0x0:_0xac3ce4['offset'];var _0x51b040=_0x2ea7be?_0xf3c3f3[_0xd42c('0x31')]:_0xac3ce4[_0xd42c('0x32')]+_0xac3ce4[_0xd42c('0x33')];var _0x461f81;if(_0x51b040>=_0x70215b){_0x51b040=_0x70215b;_0x461f81=0xc8;}else{_0x461f81=0xce;}_0x5ba5b5[_0xd42c('0x34')](_0x461f81);return _0x5ba5b5[_0xd42c('0x35')]('Content-Range',_0x1f586b+'-'+_0x51b040+'/'+_0x70215b)[_0xd42c('0x2f')](_0xf3c3f3);}return null;};}function patchUpdates(_0x759dca){return function(_0x2e0d3b){try{jsonpatch['apply'](_0x2e0d3b,_0x759dca,!![]);}catch(_0x2af0b0){return BPromise[_0xd42c('0x36')](_0x2af0b0);}return _0x2e0d3b[_0xd42c('0x37')]();};}function saveUpdates(_0x146db3,_0x7b5203){return function(_0x30b51f){if(_0x30b51f){return _0x30b51f[_0xd42c('0x38')](_0x146db3)[_0xd42c('0x24')](function(_0x2e0a0f){return _0x2e0a0f;});}return null;};}function removeEntity(_0x27b9d6,_0x205493){return function(_0x10aed6){if(_0x10aed6){return _0x10aed6[_0xd42c('0x39')]()[_0xd42c('0x24')](function(){var _0x2cf14d=_0x10aed6[_0xd42c('0x3a')]({'plain':!![]});var _0x5737ae=_0xd42c('0x3b');return db['UserProfileResource'][_0xd42c('0x39')]({'where':{'type':_0x5737ae,'resourceId':_0x2cf14d['id']}})['then'](function(){return _0x10aed6;});})[_0xd42c('0x24')](function(){_0x27b9d6['status'](0xcc)[_0xd42c('0x2e')]();});}};}function handleEntityNotFound(_0x3d75ba,_0x45d604){return function(_0x499a51){if(!_0x499a51){_0x3d75ba[_0xd42c('0x2d')](0x194);}return _0x499a51;};}function handleError(_0x12b02e,_0x83098){_0x83098=_0x83098||0x1f4;return function(_0x28e9a1){logger[_0xd42c('0x29')](_0x28e9a1['stack']);if(_0x28e9a1[_0xd42c('0x3c')]){delete _0x28e9a1[_0xd42c('0x3c')];}_0x12b02e[_0xd42c('0x34')](_0x83098)['send'](_0x28e9a1);};}exports[_0xd42c('0x3d')]=function(_0x37f125,_0x2d9781){var _0x1b2d9a={'include':[{'model':db[_0xd42c('0x3e')],'as':'mandatoryDispositionPause'}]},_0x4e4653={},_0x3a5d33={'count':0x0,'rows':[]};var _0x51b3e9=_[_0xd42c('0x3f')](db[_0xd42c('0x40')][_0xd42c('0x41')],function(_0x285c6b){return{'name':_0x285c6b[_0xd42c('0x42')],'type':_0x285c6b[_0xd42c('0x43')][_0xd42c('0x44')]};});_0x4e4653[_0xd42c('0x45')]=_[_0xd42c('0x3f')](_0x51b3e9,_0xd42c('0x3c'));_0x4e4653[_0xd42c('0x46')]=_[_0xd42c('0x47')](_0x37f125[_0xd42c('0x46')]);_0x4e4653[_0xd42c('0x48')]=_['intersection'](_0x4e4653[_0xd42c('0x45')],_0x4e4653[_0xd42c('0x46')]);_0x1b2d9a[_0xd42c('0x49')]=_[_0xd42c('0x4a')](_0x4e4653[_0xd42c('0x45')],qs['fields'](_0x37f125['query']['fields']));_0x1b2d9a[_0xd42c('0x49')]=_0x1b2d9a['attributes'][_0xd42c('0x4b')]?_0x1b2d9a[_0xd42c('0x49')]:_0x4e4653['model'];if(!_0x37f125[_0xd42c('0x46')][_0xd42c('0x4c')]('nolimit')){_0x1b2d9a[_0xd42c('0x33')]=qs[_0xd42c('0x33')](_0x37f125['query']['limit']);_0x1b2d9a[_0xd42c('0x32')]=qs[_0xd42c('0x32')](_0x37f125[_0xd42c('0x46')][_0xd42c('0x32')]);}_0x1b2d9a[_0xd42c('0x4d')]=qs[_0xd42c('0x4e')](_0x37f125[_0xd42c('0x46')]['sort']);_0x1b2d9a[_0xd42c('0x4f')]=qs[_0xd42c('0x48')](_[_0xd42c('0x50')](_0x37f125[_0xd42c('0x46')],_0x4e4653[_0xd42c('0x48')]),_0x51b3e9);if(_0x37f125[_0xd42c('0x46')][_0xd42c('0x51')]){_0x1b2d9a['where']=_[_0xd42c('0x52')](_0x1b2d9a[_0xd42c('0x4f')],{'$or':_[_0xd42c('0x3f')](_0x51b3e9,function(_0x1009bb){if(_0x1009bb[_0xd42c('0x43')]!==_0xd42c('0x53')){var _0xe8fc94={};_0xe8fc94[_0x1009bb[_0xd42c('0x3c')]]={'$like':'%'+_0x37f125[_0xd42c('0x46')][_0xd42c('0x51')]+'%'};return _0xe8fc94;}})});}_0x1b2d9a=_[_0xd42c('0x52')]({},_0x1b2d9a,_0x37f125['options']);var _0x3cf89e={'where':_0x1b2d9a[_0xd42c('0x4f')]};return db[_0xd42c('0x40')][_0xd42c('0x31')](_0x3cf89e)['then'](function(_0x10fc46){_0x3a5d33[_0xd42c('0x31')]=_0x10fc46;if(_0x37f125[_0xd42c('0x46')][_0xd42c('0x54')]){_0x1b2d9a['include']=[{'all':!![]}];}return db[_0xd42c('0x40')][_0xd42c('0x55')](_0x1b2d9a);})[_0xd42c('0x24')](function(_0x5ea92f){_0x3a5d33['rows']=_0x5ea92f;return _0x3a5d33;})[_0xd42c('0x24')](respondWithFilteredResult(_0x2d9781,_0x1b2d9a))['catch'](handleError(_0x2d9781,null));};exports[_0xd42c('0x56')]=function(_0x5b22d5,_0x5be203){var _0x408264={'raw':![],'where':{'id':_0x5b22d5[_0xd42c('0x57')]['id']},'include':[{'model':db[_0xd42c('0x3e')],'as':_0xd42c('0x58')}]},_0x3647d2={};_0x3647d2[_0xd42c('0x45')]=_[_0xd42c('0x47')](db[_0xd42c('0x40')][_0xd42c('0x41')]);_0x3647d2[_0xd42c('0x46')]=_[_0xd42c('0x47')](_0x5b22d5[_0xd42c('0x46')]);_0x3647d2['filters']=_[_0xd42c('0x4a')](_0x3647d2['model'],_0x3647d2[_0xd42c('0x46')]);_0x408264['attributes']=_[_0xd42c('0x4a')](_0x3647d2[_0xd42c('0x45')],qs[_0xd42c('0x59')](_0x5b22d5['query'][_0xd42c('0x59')]));_0x408264[_0xd42c('0x49')]=_0x408264['attributes'][_0xd42c('0x4b')]?_0x408264[_0xd42c('0x49')]:_0x3647d2[_0xd42c('0x45')];if(_0x5b22d5[_0xd42c('0x46')][_0xd42c('0x54')]){_0x408264[_0xd42c('0x5a')]=[{'all':!![]}];}_0x408264=_['merge']({},_0x408264,_0x5b22d5['options']);return db[_0xd42c('0x40')][_0xd42c('0x5b')](_0x408264)[_0xd42c('0x24')](handleEntityNotFound(_0x5be203,null))['then'](respondWithResult(_0x5be203,null))[_0xd42c('0x2c')](handleError(_0x5be203,null));};exports['create']=function(_0xa5ec40,_0x7be7e7){return db['WhatsappAccount'][_0xd42c('0x5c')](_0xa5ec40[_0xd42c('0x5d')],{})[_0xd42c('0x24')](function(_0x204397){var _0x56d2cc=_0xa5ec40[_0xd42c('0x5e')]['get']({'plain':!![]});if(!_0x56d2cc)throw new Error(_0xd42c('0x5f'));if(_0x56d2cc[_0xd42c('0x60')]==='user'){var _0x55abb3=_0x204397[_0xd42c('0x3a')]({'plain':!![]});var _0x4e144f='WhatsappAccounts';return db['UserProfileSection']['find']({'where':{'name':_0x4e144f,'userProfileId':_0x56d2cc[_0xd42c('0x61')]},'raw':!![]})[_0xd42c('0x24')](function(_0x253a7c){if(_0x253a7c&&_0x253a7c[_0xd42c('0x62')]===0x0){return db[_0xd42c('0x63')][_0xd42c('0x5c')]({'name':_0x55abb3[_0xd42c('0x3c')],'resourceId':_0x55abb3['id'],'type':_0x253a7c['name'],'sectionId':_0x253a7c['id']},{})[_0xd42c('0x24')](function(){return _0x204397;});}else{return _0x204397;}})[_0xd42c('0x2c')](function(_0x3ff3a9){logger[_0xd42c('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3ff3a9);throw _0x3ff3a9;});}return _0x204397;})['then'](respondWithResult(_0x7be7e7,0xc9))[_0xd42c('0x2c')](handleError(_0x7be7e7,null));};exports[_0xd42c('0x38')]=function(_0x55f0e4,_0x260306){if(_0x55f0e4[_0xd42c('0x5d')]['id']){delete _0x55f0e4[_0xd42c('0x5d')]['id'];}return db['WhatsappAccount'][_0xd42c('0x5b')]({'where':{'id':_0x55f0e4[_0xd42c('0x57')]['id']},'include':[{'model':db[_0xd42c('0x3e')],'as':_0xd42c('0x58')}]})['then'](handleEntityNotFound(_0x260306,null))[_0xd42c('0x24')](saveUpdates(_0x55f0e4[_0xd42c('0x5d')],null))[_0xd42c('0x24')](respondWithResult(_0x260306,null))[_0xd42c('0x2c')](handleError(_0x260306,null));};exports[_0xd42c('0x39')]=function(_0x4037de,_0x181e95){return db['WhatsappAccount'][_0xd42c('0x5b')]({'where':{'id':_0x4037de[_0xd42c('0x57')]['id']}})[_0xd42c('0x24')](handleEntityNotFound(_0x181e95,null))[_0xd42c('0x24')](removeEntity(_0x181e95,null))[_0xd42c('0x2c')](handleError(_0x181e95,null));};exports['describe']=function(_0xf40c9d,_0x310272){return db[_0xd42c('0x40')]['describe']()[_0xd42c('0x24')](respondWithResult(_0x310272,null))[_0xd42c('0x2c')](handleError(_0x310272,null));};exports[_0xd42c('0x64')]=function(_0x599816,_0xeb35fe,_0x1102a0){if(_0x599816[_0xd42c('0x5d')]['id']){delete _0x599816[_0xd42c('0x5d')]['id'];}return db[_0xd42c('0x40')][_0xd42c('0x5b')]({'where':{'id':_0x599816[_0xd42c('0x57')]['id']}})['then'](handleEntityNotFound(_0xeb35fe,null))[_0xd42c('0x24')](function(_0x3fe1f2){if(_0x3fe1f2){_0x599816['body'][_0xd42c('0x65')]=_0x3fe1f2['id'];return db['Disposition'][_0xd42c('0x5c')](_0x599816[_0xd42c('0x5d')]);}})[_0xd42c('0x24')](respondWithResult(_0xeb35fe,null))[_0xd42c('0x2c')](handleError(_0xeb35fe,null));};exports[_0xd42c('0x66')]=function(_0x240e29,_0x4a9996,_0x2f7ed2){var _0x534bf6={'raw':![],'where':{}};var _0x2bcd0d={};var _0x55e0a7={'count':0x0,'rows':[]};return db[_0xd42c('0x40')][_0xd42c('0x67')]({'where':{'id':_0x240e29[_0xd42c('0x57')]['id']}})[_0xd42c('0x24')](handleEntityNotFound(_0x4a9996,null))[_0xd42c('0x24')](function(_0x2daec8){if(_0x2daec8){_0x2bcd0d['model']=_['keys'](db['Disposition'][_0xd42c('0x41')]);_0x2bcd0d[_0xd42c('0x46')]=_[_0xd42c('0x47')](_0x240e29['query']);_0x2bcd0d[_0xd42c('0x48')]=_[_0xd42c('0x4a')](_0x2bcd0d[_0xd42c('0x45')],_0x2bcd0d[_0xd42c('0x46')]);_0x534bf6[_0xd42c('0x49')]=_[_0xd42c('0x4a')](_0x2bcd0d[_0xd42c('0x45')],qs[_0xd42c('0x59')](_0x240e29['query'][_0xd42c('0x59')]));_0x534bf6[_0xd42c('0x49')]=_0x534bf6[_0xd42c('0x49')][_0xd42c('0x4b')]?_0x534bf6['attributes']:_0x2bcd0d[_0xd42c('0x45')];if(!_0x240e29[_0xd42c('0x46')][_0xd42c('0x4c')]('nolimit')){_0x534bf6[_0xd42c('0x33')]=qs[_0xd42c('0x33')](_0x240e29[_0xd42c('0x46')][_0xd42c('0x33')]);_0x534bf6['offset']=qs[_0xd42c('0x32')](_0x240e29[_0xd42c('0x46')][_0xd42c('0x32')]);}_0x534bf6[_0xd42c('0x4d')]=qs['sort'](_0x240e29[_0xd42c('0x46')][_0xd42c('0x4e')]);_0x534bf6['where']=qs[_0xd42c('0x48')](_[_0xd42c('0x50')](_0x240e29['query'],_0x2bcd0d[_0xd42c('0x48')]));_0x534bf6[_0xd42c('0x4f')][_0xd42c('0x65')]=_0x2daec8['id'];if(_0x240e29['query']['filter']){_0x534bf6[_0xd42c('0x4f')]=_[_0xd42c('0x52')](_0x534bf6[_0xd42c('0x4f')],{'$or':_[_0xd42c('0x3f')](_0x534bf6[_0xd42c('0x49')],function(_0x240b15){var _0x13d9b4={};_0x13d9b4[_0x240b15]={'$like':'%'+_0x240e29[_0xd42c('0x46')][_0xd42c('0x51')]+'%'};return _0x13d9b4;})});}_0x534bf6=_['merge']({},_0x534bf6,_0x240e29[_0xd42c('0x68')]);return db['Disposition'][_0xd42c('0x31')]({'where':_0x534bf6[_0xd42c('0x4f')]})[_0xd42c('0x24')](function(_0x12545f){_0x55e0a7[_0xd42c('0x31')]=_0x12545f;if(_0x240e29['query'][_0xd42c('0x54')]){_0x534bf6['include']=[{'all':!![]}];}return db[_0xd42c('0x69')][_0xd42c('0x55')](_0x534bf6);})[_0xd42c('0x24')](function(_0x151804){_0x55e0a7[_0xd42c('0x6a')]=_0x151804;return _0x55e0a7;});}})['then'](respondWithFilteredResult(_0x4a9996,_0x534bf6))['catch'](handleError(_0x4a9996,null));};exports[_0xd42c('0x6b')]=function(_0x1dce4a,_0x2ad5df,_0x84d0bd){return db['WhatsappAccount'][_0xd42c('0x5b')]({'where':{'id':_0x1dce4a['params']['id']}})[_0xd42c('0x24')](handleEntityNotFound(_0x2ad5df,null))[_0xd42c('0x24')](function(_0x1ffce7){if(_0x1ffce7){return _0x1ffce7[_0xd42c('0x6b')](_0x1dce4a['query'][_0xd42c('0x6c')]);}})['then'](respondWithStatusCode(_0x2ad5df,null))[_0xd42c('0x2c')](handleError(_0x2ad5df,null));};exports[_0xd42c('0x6d')]=function(_0x29a511,_0xcbff14,_0x2e3e61){if(_0x29a511[_0xd42c('0x5d')]['id']){delete _0x29a511['body']['id'];}return db[_0xd42c('0x40')]['find']({'where':{'id':_0x29a511[_0xd42c('0x57')]['id']}})[_0xd42c('0x24')](handleEntityNotFound(_0xcbff14,null))[_0xd42c('0x24')](function(_0x444fe5){if(_0x444fe5){_0x29a511[_0xd42c('0x5d')][_0xd42c('0x65')]=_0x444fe5['id'];return db[_0xd42c('0x6e')][_0xd42c('0x5c')](_0x29a511[_0xd42c('0x5d')]);}})[_0xd42c('0x24')](respondWithResult(_0xcbff14,null))[_0xd42c('0x2c')](handleError(_0xcbff14,null));};exports[_0xd42c('0x6f')]=function(_0xe794dc,_0x52d478,_0x34f56e){var _0x52b4ca={'raw':![],'where':{}};var _0x1d5431={};var _0x19f37f={'count':0x0,'rows':[]};return db[_0xd42c('0x40')][_0xd42c('0x67')]({'where':{'id':_0xe794dc[_0xd42c('0x57')]['id']}})['then'](handleEntityNotFound(_0x52d478,null))[_0xd42c('0x24')](function(_0x548cb0){if(_0x548cb0){_0x1d5431[_0xd42c('0x45')]=_[_0xd42c('0x47')](db[_0xd42c('0x6e')]['rawAttributes']);_0x1d5431['query']=_[_0xd42c('0x47')](_0xe794dc[_0xd42c('0x46')]);_0x1d5431[_0xd42c('0x48')]=_[_0xd42c('0x4a')](_0x1d5431[_0xd42c('0x45')],_0x1d5431['query']);_0x52b4ca[_0xd42c('0x49')]=_[_0xd42c('0x4a')](_0x1d5431['model'],qs[_0xd42c('0x59')](_0xe794dc[_0xd42c('0x46')][_0xd42c('0x59')]));_0x52b4ca[_0xd42c('0x49')]=_0x52b4ca[_0xd42c('0x49')][_0xd42c('0x4b')]?_0x52b4ca[_0xd42c('0x49')]:_0x1d5431['model'];if(!_0xe794dc[_0xd42c('0x46')]['hasOwnProperty'](_0xd42c('0x70'))){_0x52b4ca[_0xd42c('0x33')]=qs[_0xd42c('0x33')](_0xe794dc[_0xd42c('0x46')][_0xd42c('0x33')]);_0x52b4ca['offset']=qs[_0xd42c('0x32')](_0xe794dc[_0xd42c('0x46')][_0xd42c('0x32')]);}_0x52b4ca[_0xd42c('0x4d')]=qs[_0xd42c('0x4e')](_0xe794dc[_0xd42c('0x46')]['sort']);_0x52b4ca['where']=qs['filters'](_['pick'](_0xe794dc[_0xd42c('0x46')],_0x1d5431['filters']));_0x52b4ca[_0xd42c('0x4f')][_0xd42c('0x65')]=_0x548cb0['id'];if(_0xe794dc[_0xd42c('0x46')][_0xd42c('0x51')]){_0x52b4ca['where']=_[_0xd42c('0x52')](_0x52b4ca[_0xd42c('0x4f')],{'$or':_['map'](_0x52b4ca[_0xd42c('0x49')],function(_0x2eae50){var _0xe6b14a={};_0xe6b14a[_0x2eae50]={'$like':'%'+_0xe794dc[_0xd42c('0x46')][_0xd42c('0x51')]+'%'};return _0xe6b14a;})});}_0x52b4ca=_['merge']({},_0x52b4ca,_0xe794dc[_0xd42c('0x68')]);return db['CannedAnswer']['count']({'where':_0x52b4ca[_0xd42c('0x4f')]})[_0xd42c('0x24')](function(_0x2451c1){_0x19f37f[_0xd42c('0x31')]=_0x2451c1;if(_0xe794dc[_0xd42c('0x46')][_0xd42c('0x54')]){_0x52b4ca['include']=[{'all':!![]}];}return db['CannedAnswer'][_0xd42c('0x55')](_0x52b4ca);})['then'](function(_0x1ca8fd){_0x19f37f['rows']=_0x1ca8fd;return _0x19f37f;});}})[_0xd42c('0x24')](respondWithFilteredResult(_0x52d478,_0x52b4ca))['catch'](handleError(_0x52d478,null));};exports['removeAnswers']=function(_0x56d0eb,_0x506826,_0x4cfeeb){return db[_0xd42c('0x40')][_0xd42c('0x5b')]({'where':{'id':_0x56d0eb['params']['id']}})[_0xd42c('0x24')](handleEntityNotFound(_0x506826,null))[_0xd42c('0x24')](function(_0x1ad259){if(_0x1ad259){return _0x1ad259[_0xd42c('0x71')](_0x56d0eb[_0xd42c('0x46')]['ids']);}})[_0xd42c('0x24')](respondWithStatusCode(_0x506826,null))['catch'](handleError(_0x506826,null));};exports['addAgents']=function(_0x1d8e99,_0x357456,_0xfa916f){return db[_0xd42c('0x40')][_0xd42c('0x5b')]({'where':{'id':_0x1d8e99[_0xd42c('0x57')]['id']}})['then'](handleEntityNotFound(_0x357456,null))[_0xd42c('0x24')](function(_0x90480f){if(_0x90480f){return _0x90480f[_0xd42c('0x72')](_0x1d8e99[_0xd42c('0x5d')][_0xd42c('0x6c')],_[_0xd42c('0x73')](_0x1d8e99['body'],[_0xd42c('0x6c'),'id'])||{})[_0xd42c('0x74')](function(_0x28b2a7){for(var _0x1b9a15=0x0;_0x1b9a15<_0x1d8e99['body'][_0xd42c('0x6c')]['length'];_0x1b9a15+=0x1){socket['emit'](_0xd42c('0x75'),{'UserId':Number(_0x1d8e99[_0xd42c('0x5d')]['ids'][_0x1b9a15]),'WhatsappAccountId':Number(_0x1d8e99[_0xd42c('0x57')]['id'])});}return _0x28b2a7;});}})[_0xd42c('0x24')](respondWithResult(_0x357456,null))[_0xd42c('0x2c')](handleError(_0x357456,null));};exports['removeAgents']=function(_0x4ab061,_0x409207,_0x10ef0b){return db[_0xd42c('0x40')][_0xd42c('0x5b')]({'where':{'id':_0x4ab061[_0xd42c('0x57')]['id']}})[_0xd42c('0x24')](handleEntityNotFound(_0x409207,null))['then'](function(_0x63c092){if(_0x63c092){return _0x63c092['removeAgents'](_0x4ab061[_0xd42c('0x46')][_0xd42c('0x6c')])[_0xd42c('0x24')](function(){if(_[_0xd42c('0x76')](_0x4ab061['query']['ids'])){for(var _0x466028=0x0;_0x466028<_0x4ab061[_0xd42c('0x46')][_0xd42c('0x6c')]['length'];_0x466028+=0x1){socket[_0xd42c('0x77')](_0xd42c('0x78'),{'UserId':Number(_0x4ab061[_0xd42c('0x46')]['ids'][_0x466028]),'WhatsappAccountId':Number(_0x4ab061[_0xd42c('0x57')]['id'])});}}else{socket['emit'](_0xd42c('0x78'),{'UserId':Number(_0x4ab061[_0xd42c('0x46')][_0xd42c('0x6c')]),'WhatsappAccountId':Number(_0x4ab061[_0xd42c('0x57')]['id'])});}});}})[_0xd42c('0x24')](respondWithStatusCode(_0x409207,null))['catch'](handleError(_0x409207,null));};exports[_0xd42c('0x79')]=function(_0x1a64c6,_0x3c2f28,_0x5de8f3){var _0x197108={};var _0x2a9516={};var _0x329abf;var _0x253ecf;return db['WhatsappAccount'][_0xd42c('0x67')]({'where':{'id':_0x1a64c6[_0xd42c('0x57')]['id']}})[_0xd42c('0x24')](handleEntityNotFound(_0x3c2f28,null))['then'](function(_0x41bf20){if(_0x41bf20){_0x329abf=_0x41bf20;_0x2a9516[_0xd42c('0x45')]=_[_0xd42c('0x47')](db[_0xd42c('0x7a')][_0xd42c('0x41')]);_0x2a9516[_0xd42c('0x46')]=_[_0xd42c('0x47')](_0x1a64c6[_0xd42c('0x46')]);_0x2a9516['filters']=_[_0xd42c('0x4a')](_0x2a9516['model'],_0x2a9516[_0xd42c('0x46')]);_0x197108['attributes']=_[_0xd42c('0x4a')](_0x2a9516[_0xd42c('0x45')],qs[_0xd42c('0x59')](_0x1a64c6[_0xd42c('0x46')][_0xd42c('0x59')]));_0x197108[_0xd42c('0x49')]=_0x197108[_0xd42c('0x49')][_0xd42c('0x4b')]?_0x197108['attributes']:_0x2a9516[_0xd42c('0x45')];_0x197108[_0xd42c('0x4d')]=qs['sort'](_0x1a64c6[_0xd42c('0x46')]['sort']);_0x197108[_0xd42c('0x4f')]=qs['filters'](_['pick'](_0x1a64c6[_0xd42c('0x46')],_0x2a9516[_0xd42c('0x48')]));if(_0x1a64c6[_0xd42c('0x46')][_0xd42c('0x51')]){_0x197108[_0xd42c('0x4f')]=_[_0xd42c('0x52')](_0x197108[_0xd42c('0x4f')],{'$or':_[_0xd42c('0x3f')](_0x197108[_0xd42c('0x49')],function(_0x5e5ff6){var _0x3ff8be={};_0x3ff8be[_0x5e5ff6]={'$like':'%'+_0x1a64c6['query'][_0xd42c('0x51')]+'%'};return _0x3ff8be;})});}_0x197108=_[_0xd42c('0x52')]({},_0x197108,_0x1a64c6[_0xd42c('0x68')]);return _0x329abf[_0xd42c('0x79')](_0x197108);}})[_0xd42c('0x24')](function(_0x19ed55){if(_0x19ed55){_0x253ecf=_0x19ed55['length'];if(!_0x1a64c6['query'][_0xd42c('0x4c')](_0xd42c('0x70'))){_0x197108[_0xd42c('0x33')]=qs[_0xd42c('0x33')](_0x1a64c6[_0xd42c('0x46')][_0xd42c('0x33')]);_0x197108[_0xd42c('0x32')]=qs[_0xd42c('0x32')](_0x1a64c6[_0xd42c('0x46')]['offset']);}return _0x329abf[_0xd42c('0x79')](_0x197108);}})['then'](function(_0x5c46c8){if(_0x5c46c8){return _0x5c46c8?{'count':_0x253ecf,'rows':_0x5c46c8}:null;}})[_0xd42c('0x24')](respondWithResult(_0x3c2f28,null))[_0xd42c('0x2c')](handleError(_0x3c2f28,null));};exports[_0xd42c('0x7b')]=function(_0x50aa30,_0x30878a){var _0x2bbe5d=_0x50aa30[_0xd42c('0x57')]['id'];var _0x5e0ead=_0x50aa30[_0xd42c('0x5d')];var _0x42155d=0xc8;var _0x45414c=null;return db[_0xd42c('0x7c')][_0xd42c('0x7d')]({'isolationLevel':db[_0xd42c('0x7c')][_0xd42c('0x7e')][_0xd42c('0x7f')][_0xd42c('0x80')]},function(_0x580f62){return db['WhatsappAccount'][_0xd42c('0x67')]({'where':{'id':_0x2bbe5d},'transaction':_0x580f62})[_0xd42c('0x24')](function(_0x5f4343){if(_0x5f4343){return db[_0xd42c('0x81')]['destroy']({'where':{'WhatsappAccountId':_0x2bbe5d},'transaction':_0x580f62})['then'](function(){var _0x3897aa=_[_0xd42c('0x3f')](_0x5e0ead,function(_0x456fa1){_0x456fa1[_0xd42c('0x65')]=_0x2bbe5d;return _0x456fa1;});return db[_0xd42c('0x81')][_0xd42c('0x82')](_0x3897aa,{'transaction':_0x580f62});});}else{_0x42155d=0x194;_0x45414c=[];}});})[_0xd42c('0x24')](function(){if(_0x42155d!==0x194){return db[_0xd42c('0x81')]['findAndCountAll']({'where':{'WhatsappAccountId':_0x2bbe5d},'order':_0xd42c('0x83')})[_0xd42c('0x24')](function(_0x5bf99c){_0x45414c=_0x5bf99c;});}})[_0xd42c('0x2c')](function(_0x14b102){_0x42155d=0x1f4;logger[_0xd42c('0x29')](_0x14b102['stack']);if(_0x14b102['name']){delete _0x14b102[_0xd42c('0x3c')];}_0x45414c=_0x14b102;})[_0xd42c('0x84')](function(){if(_0x45414c===null){_0x30878a[_0xd42c('0x2d')](_0x42155d);}else{if(_0x42155d===0x1f4){_0x30878a[_0xd42c('0x34')](_0x42155d)[_0xd42c('0x85')](_0x45414c);}else{_0x30878a[_0xd42c('0x34')](_0x42155d)[_0xd42c('0x2f')](_0x45414c);}}});};exports[_0xd42c('0x86')]=function(_0x4c9161,_0x49afdb,_0x230093){var _0x466d32={};var _0x481492={};var _0x54d4a1;var _0x5d293d;return db[_0xd42c('0x40')][_0xd42c('0x67')]({'where':{'id':_0x4c9161[_0xd42c('0x57')]['id']}})['then'](handleEntityNotFound(_0x49afdb,null))[_0xd42c('0x24')](function(_0xb186e0){if(_0xb186e0){_0x54d4a1=_0xb186e0;_0x481492[_0xd42c('0x45')]=_['keys'](db[_0xd42c('0x81')][_0xd42c('0x41')]);_0x481492[_0xd42c('0x46')]=_[_0xd42c('0x47')](_0x4c9161[_0xd42c('0x46')]);_0x481492[_0xd42c('0x48')]=_['intersection'](_0x481492[_0xd42c('0x45')],_0x481492[_0xd42c('0x46')]);_0x466d32[_0xd42c('0x49')]=_[_0xd42c('0x4a')](_0x481492[_0xd42c('0x45')],qs[_0xd42c('0x59')](_0x4c9161['query'][_0xd42c('0x59')]));_0x466d32[_0xd42c('0x49')]=_0x466d32[_0xd42c('0x49')][_0xd42c('0x4b')]?_0x466d32[_0xd42c('0x49')]:_0x481492[_0xd42c('0x45')];_0x466d32[_0xd42c('0x4d')]=qs['sort'](_0x4c9161[_0xd42c('0x46')][_0xd42c('0x4e')]);_0x466d32[_0xd42c('0x4f')]=qs[_0xd42c('0x48')](_[_0xd42c('0x50')](_0x4c9161[_0xd42c('0x46')],_0x481492['filters']));if(_0x4c9161[_0xd42c('0x46')][_0xd42c('0x51')]){_0x466d32[_0xd42c('0x4f')]=_[_0xd42c('0x52')](_0x466d32[_0xd42c('0x4f')],{'$or':_[_0xd42c('0x3f')](_0x466d32[_0xd42c('0x49')],function(_0x46fae1){var _0x26d7e6={};_0x26d7e6[_0x46fae1]={'$like':'%'+_0x4c9161[_0xd42c('0x46')][_0xd42c('0x51')]+'%'};return _0x26d7e6;})});}_0x466d32=_[_0xd42c('0x52')]({},_0x466d32,_0x4c9161[_0xd42c('0x68')]);return _0x54d4a1['getApplications'](_0x466d32);}})[_0xd42c('0x24')](function(_0x327437){if(_0x327437){_0x5d293d=_0x327437['length'];if(!_0x4c9161['query'][_0xd42c('0x4c')](_0xd42c('0x70'))){_0x466d32['limit']=qs[_0xd42c('0x33')](_0x4c9161['query']['limit']);_0x466d32[_0xd42c('0x32')]=qs['offset'](_0x4c9161[_0xd42c('0x46')]['offset']);}return _0x54d4a1[_0xd42c('0x86')](_0x466d32);}})[_0xd42c('0x24')](function(_0x1127f4){if(_0x1127f4){return _0x1127f4?{'count':_0x5d293d,'rows':_0x1127f4}:null;}})[_0xd42c('0x24')](respondWithResult(_0x49afdb,null))[_0xd42c('0x2c')](handleError(_0x49afdb,null));};exports[_0xd42c('0x87')]=function(_0x4eb395,_0x662b5c,_0x16d55c){var _0x255bda={'channel':'whatsapp'};var _0x5e24e5=[];var _0x17021f=[];var _0x10e557={};return db[_0xd42c('0x40')][_0xd42c('0x5b')]({'where':{'id':_0x4eb395['params']['id']},'include':[{'model':db[_0xd42c('0x81')],'as':'Applications'}]})['then'](handleEntityNotFound(_0x662b5c,null))[_0xd42c('0x24')](function(_0x5a3864){_0x255bda[_0xd42c('0x88')]=_0x5a3864;if(_0x255bda[_0xd42c('0x88')]&&_0x255bda[_0xd42c('0x88')][_0xd42c('0x43')]===_0xd42c('0x89')&&_0x4eb395[_0xd42c('0x5d')]['statuses']){if(_0x4eb395[_0xd42c('0x5d')]['statuses'][_0xd42c('0x4b')]===0x0)return;if(_0x4eb395['body']['statuses'][0x0][_0xd42c('0x8a')]!==_0xd42c('0x8b'))return;return db[_0xd42c('0x8c')][_0xd42c('0x38')]({'read':!![],'readAt':_0x4eb395['body'][_0xd42c('0x8d')][0x0]['timestamp']},{'where':{'messageId':_0x4eb395[_0xd42c('0x5d')]['statuses'][0x0]['message_id']},'individualHooks':!![]})['then'](function(_0x329ea9){return _0x662b5c['status'](0xc8)['json'](_0x329ea9);});}_0x255bda[_0xd42c('0x8e')]=_[_0xd42c('0x8f')](_0x5a3864[_0xd42c('0x90')],[_0xd42c('0x83')],[_0xd42c('0x91')]);if(_0x255bda[_0xd42c('0x88')][_0xd42c('0x90')]){delete _0x255bda[_0xd42c('0x88')][_0xd42c('0x90')];}return db[_0xd42c('0x92')][_0xd42c('0x93')]()[_0xd42c('0x24')](function(_0x4dee66){if(!_0x4dee66){throw new db[(_0xd42c('0x94'))][(_0xd42c('0x95'))]('no\x20available\x20attributes');}_0x5e24e5=_[_0xd42c('0x96')](_[_0xd42c('0x47')](_0x4dee66),[_0xd42c('0x97'),_0xd42c('0x98')]);_0x17021f=_[_0xd42c('0x96')](_['keys'](_0x4dee66),[_0xd42c('0x97'),_0xd42c('0x98'),_0xd42c('0x99'),_0xd42c('0x9a')]);_0x255bda[_0xd42c('0x5d')]={'mapKey':'mobile'};if(_0x255bda['account']&&_0x255bda[_0xd42c('0x88')]['type']===_0xd42c('0x9b')){_0x255bda[_0xd42c('0x5d')][_0xd42c('0x9c')]=_0x4eb395['body'][_0xd42c('0x9d')][_0xd42c('0x9e')](_0xd42c('0x9f'),'');_0x255bda[_0xd42c('0x5d')][_0xd42c('0x5d')]=_0x4eb395[_0xd42c('0x5d')][_0xd42c('0xa0')];_0x255bda[_0xd42c('0x5d')][_0xd42c('0xa1')]=_0x4eb395[_0xd42c('0x5d')]['MessageSid'];}if(_0x255bda[_0xd42c('0x88')]&&_0x255bda[_0xd42c('0x88')][_0xd42c('0x43')]==='sinch'){_0x255bda[_0xd42c('0x5d')][_0xd42c('0x9c')]=_0x4eb395[_0xd42c('0x5d')][_0xd42c('0xa2')][0x0][_0xd42c('0x9c')];_0x255bda[_0xd42c('0x5d')]['body']=_0x4eb395['body']['notifications'][0x0][_0xd42c('0x2a')]['body'];_0x255bda[_0xd42c('0x5d')][_0xd42c('0xa1')]=_0x4eb395[_0xd42c('0x5d')][_0xd42c('0xa2')][0x0][_0xd42c('0xa3')];}if(_0x255bda['body']['id']){delete _0x255bda[_0xd42c('0x5d')]['id'];}if(_[_0xd42c('0xa4')](_0x255bda[_0xd42c('0x5d')][_0xd42c('0x9c')])){throw new db[(_0xd42c('0x94'))]['ValidationError'](_0xd42c('0xa5'));}if(_['isNil'](_0x255bda[_0xd42c('0x5d')][_0xd42c('0x5d')])||_0x255bda[_0xd42c('0x5d')]['body']===''){throw new db[(_0xd42c('0x94'))][(_0xd42c('0x95'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xd42c('0xa4')](_0x255bda[_0xd42c('0x5d')]['mapKey'])){throw new db[(_0xd42c('0x94'))]['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x17021f);}if(!_[_0xd42c('0xa6')](_0x17021f,_0x255bda[_0xd42c('0x5d')][_0xd42c('0xa7')])){throw new db[(_0xd42c('0x94'))][(_0xd42c('0x95'))](_0xd42c('0xa8')+_0x17021f);}_0x10e557[_0x255bda[_0xd42c('0x5d')][_0xd42c('0xa7')]]=_0x255bda[_0xd42c('0x5d')][_0xd42c('0x9c')];return db[_0xd42c('0xa9')][_0xd42c('0x5b')]({'where':{'id':_0x255bda[_0xd42c('0x88')][_0xd42c('0x9a')]},'include':[{'model':db['CmContact'],'as':_0xd42c('0xaa'),'where':_0x10e557,'limit':0x1,'order':[['updatedAt',_0xd42c('0xab')]]}]});})[_0xd42c('0x24')](handleEntityNotFound(_0x662b5c,null))['then'](function(_0x4dd8f0){if(_0x4dd8f0){_0x255bda[_0xd42c('0xac')]=_[_0xd42c('0x73')](_0x4dd8f0,[_0xd42c('0xaa')]);if(_0x4dd8f0['Contacts']['length']){return _0x4dd8f0[_0xd42c('0xaa')][0x0];}var _0x4c1355=_[_0xd42c('0x1b')](_0x255bda['body'],{'firstName':_0x255bda['body']['from'],'ListId':_0x4dd8f0['id']});_0x4c1355[_0x255bda['body'][_0xd42c('0xa7')]]=_0x255bda['body'][_0xd42c('0x9c')];return db[_0xd42c('0x92')]['create'](_0x4c1355,{'fields':_0x5e24e5,'raw':!![]});}})[_0xd42c('0x24')](handleEntityNotFound(_0x662b5c,null))['then'](function(_0x2791bf){if(_0x2791bf){_0x255bda[_0xd42c('0xad')]=_0x2791bf;var _0x177474={'ContactId':_0x2791bf['id'],'phone':_0x255bda[_0xd42c('0x5d')][_0xd42c('0x9c')],'WhatsappAccountId':_0x4eb395['params']['id']};var _0x4f6789={'ContactId':_0x2791bf['id'],'WhatsappAccountId':_0x4eb395[_0xd42c('0x57')]['id'],'closed':![]};return db[_0xd42c('0xae')]['find']({'where':_0x4f6789})[_0xd42c('0x24')](function(_0x3797c5){if(_0x3797c5){return[_0x3797c5,![]];}return db[_0xd42c('0xae')]['create'](_0x177474)[_0xd42c('0x24')](function(_0x266a77){return[_0x266a77,!![]];});});}})[_0xd42c('0x74')](function(_0x3ca30d,_0x1ec88b){_0x255bda[_0xd42c('0xaf')]=_0x3ca30d['get']({'plain':!![]});_0x255bda[_0xd42c('0xaf')][_0xd42c('0xb0')]=![];if(_0x1ec88b){if(_0x255bda[_0xd42c('0x88')]['autoclose']){_0x255bda['applications'][_0xd42c('0xb1')]({'id':0x0,'priority':_0x255bda[_0xd42c('0x8e')][_0xd42c('0x4b')]+0x1,'app':'close','appdata':_0xd42c('0xb2'),'interval':'*,*,*,*'});}_0x255bda['interaction'][_0xd42c('0xb0')]=!![];}return db[_0xd42c('0x8c')][_0xd42c('0x5c')]({'phone':_0x255bda[_0xd42c('0x5d')][_0xd42c('0x9c')],'messageId':_0x255bda[_0xd42c('0x5d')][_0xd42c('0xa1')],'body':_0x255bda['body'][_0xd42c('0x5d')],'WhatsappAccountId':_0x4eb395['params']['id'],'WhatsappInteractionId':_0x3ca30d['id'],'direction':'in','ContactId':_0x3ca30d['ContactId'],'AttachmentId':_0x255bda['body'][_0xd42c('0xb3')]});})[_0xd42c('0x24')](function(_0x5a3d07){_0x255bda[_0xd42c('0x2a')]=_0x5a3d07;if(!_0x255bda[_0xd42c('0xaf')][_0xd42c('0xb4')])return;return db[_0xd42c('0x7a')][_0xd42c('0x5b')]({'attributes':['id',_0xd42c('0x3c')],'where':{'id':_0x255bda[_0xd42c('0xaf')]['UserId']}});})['then'](function(_0x18a908){if(_0x18a908){_0x255bda['applications'][_0xd42c('0xb5')]({'id':0x0,'priority':0x0,'app':_0xd42c('0xb6'),'appdata':_0x18a908[_0xd42c('0x3c')]+','+(_0x255bda[_0xd42c('0x88')]['waitForTheAssignedAgent']||0xa),'interval':_0xd42c('0xb7')});}if(!_0x255bda[_0xd42c('0xaf')][_0xd42c('0xb8')])return;return db[_0xd42c('0xb9')][_0xd42c('0x5b')]({'attributes':['id',_0xd42c('0x3c')],'where':{'id':_0x255bda['interaction'][_0xd42c('0xb8')]}});})[_0xd42c('0x24')](function(_0x30a9f9){if(_0x30a9f9){_0x255bda[_0xd42c('0x8e')]['unshift']({'id':0x0,'priority':0x1,'app':_0xd42c('0xba'),'appdata':_0x30a9f9[_0xd42c('0x3c')]+','+(_0x255bda[_0xd42c('0x88')][_0xd42c('0xbb')]||0x12c),'interval':_0xd42c('0xb7')});}return respondWithRpcPromise(_0xd42c('0xbc'),'startRouting',_0x255bda);})[_0xd42c('0x24')](function(_0xc88cd4){if(_0xc88cd4){var _0x52b475=0xc8;var _0x39d4fe=_0xd42c('0xbd');logger[_0xd42c('0xbe')](_0xd42c('0xbf'),_0x39d4fe,_0x52b475,_0xd42c('0xc0'));logger['debug'](_0xd42c('0xc1'),_0x39d4fe,_0x52b475,_0xd42c('0xc0'),JSON['stringify'](_0xc88cd4));if(_0x255bda[_0xd42c('0x88')][_0xd42c('0x43')]===_0xd42c('0x9b')){return _0x662b5c['status'](_0x52b475)['set'](_0xd42c('0xc2'),_0xd42c('0xc3'))['send'](_0xd42c('0xc4'));}else{return _0x662b5c[_0xd42c('0x34')](_0x52b475)[_0xd42c('0x2f')](_0xc88cd4);}}});})[_0xd42c('0x2c')](handleError(_0x662b5c,null));};exports[_0xd42c('0x85')]=function(_0x2bb169,_0x57b125,_0x26baee){var _0x234f50,_0xde3afe,_0x48fa5d;if(_['isNil'](_0x2bb169['body']['body'])||_0x2bb169[_0xd42c('0x5d')][_0xd42c('0x5d')]===''){throw new db[(_0xd42c('0x94'))]['ValidationError'](_0xd42c('0xc5'));}if(_[_0xd42c('0xa4')](_0x2bb169['body']['to'])){throw new db[(_0xd42c('0x94'))][(_0xd42c('0x95'))](_0xd42c('0xc6'));}_0x234f50=_0x2bb169[_0xd42c('0x5d')]['to'];return db[_0xd42c('0x40')][_0xd42c('0x5b')]({'where':{'id':_0x2bb169[_0xd42c('0x57')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0xd42c('0x92')],'as':_0xd42c('0xaa'),'where':{'mobile':_0x234f50},'limit':0x1,'order':[[_0xd42c('0x98'),_0xd42c('0xab')]]}]}]})[_0xd42c('0x24')](handleEntityNotFound(_0x57b125,null))['then'](function(_0x52bba7){if(_0x52bba7&&_0x52bba7['List']){_0xde3afe=_0x52bba7[_0xd42c('0x3a')]({'plain':!![]});if(_0xde3afe[_0xd42c('0xc7')]&&_0xde3afe[_0xd42c('0xc7')][_0xd42c('0xaa')][_0xd42c('0x4b')]){return _0xde3afe[_0xd42c('0xc7')][_0xd42c('0xaa')][0x0];}return db[_0xd42c('0x92')][_0xd42c('0x5c')](_[_0xd42c('0x1b')](_0x2bb169[_0xd42c('0x5d')],{'firstName':_0x234f50,'mobile':_0x234f50,'phone':_0x234f50,'ListId':_0xde3afe['ListId']}));}})[_0xd42c('0x24')](handleEntityNotFound(_0x57b125,null))[_0xd42c('0x24')](function(_0x335222){if(_0x335222){_0x48fa5d=_0x335222;return db[_0xd42c('0xae')]['find']({'where':{'ContactId':_0x48fa5d['id'],'closed':![],'WhatsappAccountId':_0xde3afe['id']}})['then'](function(_0x208606){if(_0x208606){return[_0x208606,![]];}return db[_0xd42c('0xae')][_0xd42c('0x5c')]({'UserId':_0x2bb169[_0xd42c('0x5e')]['id'],'ContactId':_0x48fa5d['id'],'WhatsappAccountId':_0xde3afe['id'],'phone':_0x234f50,'firstMsgDirection':_0xd42c('0xc8'),'Messages':[_[_0xd42c('0x52')](_0x2bb169[_0xd42c('0x5d')],{'read':![],'body':_0x2bb169[_0xd42c('0x5d')][_0xd42c('0x5d')],'phone':_0x234f50,'WhatsappAccountId':_0xde3afe['id'],'UserId':_0x2bb169[_0xd42c('0x5e')]['id'],'ContactId':_0x48fa5d['id']})]},{'include':[{'model':db[_0xd42c('0x8c')],'as':_0xd42c('0xc9')}]})[_0xd42c('0x24')](function(_0x139c9f){return[_0x139c9f,!![]];});});}})[_0xd42c('0x74')](function(_0x34d195,_0x2dc546){if(_0x2dc546){return _0x34d195;}return db['WhatsappMessage'][_0xd42c('0x5c')](_['merge'](_0x2bb169[_0xd42c('0x5d')],{'read':![],'body':_0x2bb169[_0xd42c('0x5d')]['body'],'phone':_0x234f50,'WhatsappAccountId':_0xde3afe['id'],'WhatsappInteractionId':_0x34d195['id'],'UserId':_0x2bb169[_0xd42c('0x5e')]['id'],'ContactId':_0x48fa5d['id']}))[_0xd42c('0x24')](function(_0xa6e1c8){_0x34d195['dataValues'][_0xd42c('0xc9')]=[];_0x34d195[_0xd42c('0xca')][_0xd42c('0xc9')][_0xd42c('0xb1')](_0xa6e1c8[_0xd42c('0xca')]);return _0x34d195;});})[_0xd42c('0x24')](respondWithResult(_0x57b125,null))[_0xd42c('0x2c')](handleError(_0x57b125,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index 2475109..0fc3fa1 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 _0x8129=['remove','emit','hasOwnProperty','exports','events','../../mysqldb','WhatsappAccount','setMaxListeners','save'];(function(_0x4c8232,_0x4e0dea){var _0x3cc8e5=function(_0x248561){while(--_0x248561){_0x4c8232['push'](_0x4c8232['shift']());}};_0x3cc8e5(++_0x4e0dea);}(_0x8129,0x13f));var _0x9812=function(_0x2a2890,_0x22b0fc){_0x2a2890=_0x2a2890-0x0;var _0x53d497=_0x8129[_0x2a2890];return _0x53d497;};'use strict';var EventEmitter=require(_0x9812('0x0'));var WhatsappAccount=require(_0x9812('0x1'))['db'][_0x9812('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x9812('0x3')](0x0);var events={'afterCreate':_0x9812('0x4'),'afterUpdate':'update','afterDestroy':_0x9812('0x5')};function emitEvent(_0x457200){return function(_0x1b8bde,_0x2ab782,_0x2cd29f){WhatsappAccountEvents[_0x9812('0x6')](_0x457200+':'+_0x1b8bde['id'],_0x1b8bde);WhatsappAccountEvents[_0x9812('0x6')](_0x457200,_0x1b8bde);_0x2cd29f(null);};}for(var e in events){if(events[_0x9812('0x7')](e)){var event=events[e];WhatsappAccount['hook'](e,emitEvent(event));}}module[_0x9812('0x8')]=WhatsappAccountEvents; \ No newline at end of file +var _0x8e3c=['remove','hasOwnProperty','hook','events','../../mysqldb','WhatsappAccount','setMaxListeners','save','update'];(function(_0x13f980,_0x1e1c56){var _0x27153c=function(_0x3953d5){while(--_0x3953d5){_0x13f980['push'](_0x13f980['shift']());}};_0x27153c(++_0x1e1c56);}(_0x8e3c,0x1aa));var _0xc8e3=function(_0x701ad0,_0x406c52){_0x701ad0=_0x701ad0-0x0;var _0x2264a6=_0x8e3c[_0x701ad0];return _0x2264a6;};'use strict';var EventEmitter=require(_0xc8e3('0x0'));var WhatsappAccount=require(_0xc8e3('0x1'))['db'][_0xc8e3('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0xc8e3('0x3')](0x0);var events={'afterCreate':_0xc8e3('0x4'),'afterUpdate':_0xc8e3('0x5'),'afterDestroy':_0xc8e3('0x6')};function emitEvent(_0x3e899c){return function(_0x1d18c0,_0x15efaa,_0x1e75b7){WhatsappAccountEvents['emit'](_0x3e899c+':'+_0x1d18c0['id'],_0x1d18c0);WhatsappAccountEvents['emit'](_0x3e899c,_0x1d18c0);_0x1e75b7(null);};}for(var e in events){if(events[_0xc8e3('0x7')](e)){var event=events[e];WhatsappAccount[_0xc8e3('0x8')](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 f8eb533..c420f04 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 _0xe84a=['rimraf','./whatsappAccount.attributes','exports','define','WhatsappAccount','whatsapp_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x29615d,_0x352029){var _0x53336c=function(_0x2cd2d5){while(--_0x2cd2d5){_0x29615d['push'](_0x29615d['shift']());}};_0x53336c(++_0x352029);}(_0xe84a,0x1d4));var _0xae84=function(_0x323116,_0x5ced14){_0x323116=_0x323116-0x0;var _0x14b3ea=_0xe84a[_0x323116];return _0x14b3ea;};'use strict';var _=require(_0xae84('0x0'));var util=require(_0xae84('0x1'));var logger=require(_0xae84('0x2'))(_0xae84('0x3'));var moment=require(_0xae84('0x4'));var BPromise=require(_0xae84('0x5'));var rp=require(_0xae84('0x6'));var fs=require('fs');var path=require(_0xae84('0x7'));var rimraf=require(_0xae84('0x8'));var config=require('../../config/environment');var attributes=require(_0xae84('0x9'));module[_0xae84('0xa')]=function(_0x24f650,_0x4f1bf4){return _0x24f650[_0xae84('0xb')](_0xae84('0xc'),attributes,{'tableName':_0xae84('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x55d4=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappAccount.attributes','exports','define','WhatsappAccount','whatsapp_accounts','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x55d4,0x99));var _0x455d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x55d4[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x455d('0x0'));var util=require(_0x455d('0x1'));var logger=require(_0x455d('0x2'))('api');var moment=require(_0x455d('0x3'));var BPromise=require(_0x455d('0x4'));var rp=require(_0x455d('0x5'));var fs=require('fs');var path=require(_0x455d('0x6'));var rimraf=require(_0x455d('0x7'));var config=require(_0x455d('0x8'));var attributes=require(_0x455d('0x9'));module[_0x455d('0xa')]=function(_0x1ae831,_0x5dbc89){return _0x1ae831[_0x455d('0xb')](_0x455d('0xc'),attributes,{'tableName':_0x455d('0xd'),'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 f5134b0..20444a1 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 _0x467e=['jayson/promise','redis','defaults','socket.io-emitter','register','request','then','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','catch','ShowWhatsappAccount','WhatsappAccount','find','options','raw','where','attributes','include','map','model','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x282d28,_0x39bdc4){var _0x5e7073=function(_0xcb228f){while(--_0xcb228f){_0x282d28['push'](_0x282d28['shift']());}};_0x5e7073(++_0x39bdc4);}(_0x467e,0x121));var _0xe467=function(_0x26d386,_0x1660c0){_0x26d386=_0x26d386-0x0;var _0x4ef9a8=_0x467e[_0x26d386];return _0x4ef9a8;};'use strict';var _=require(_0xe467('0x0'));var util=require(_0xe467('0x1'));var moment=require(_0xe467('0x2'));var BPromise=require('bluebird');var rs=require(_0xe467('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe467('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xe467('0x5'))(_0xe467('0x6'));var config=require(_0xe467('0x7'));var jayson=require(_0xe467('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0xe467('0x9')]=_[_0xe467('0xa')](config[_0xe467('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xe467('0xb'))(new Redis(config[_0xe467('0x9')]));require('./whatsappAccount.socket')[_0xe467('0xc')](socket);function respondWithRpcPromise(_0x3fb58d,_0xa3b91a,_0x17640f){return new BPromise(function(_0x3f1ee4,_0x59caca){return client[_0xe467('0xd')](_0x3fb58d,_0x17640f)[_0xe467('0xe')](function(_0x45be0d){logger['info'](_0xe467('0xf'),_0xa3b91a,_0xe467('0x10'));logger[_0xe467('0x11')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0xa3b91a,_0xe467('0x10'),JSON[_0xe467('0x12')](_0x45be0d));if(_0x45be0d[_0xe467('0x13')]){if(_0x45be0d[_0xe467('0x13')]['code']===0x1f4){logger[_0xe467('0x13')](_0xe467('0xf'),_0xa3b91a,_0x45be0d[_0xe467('0x13')][_0xe467('0x14')]);return _0x59caca(_0x45be0d['error'][_0xe467('0x14')]);}logger['error'](_0xe467('0xf'),_0xa3b91a,_0x45be0d[_0xe467('0x13')][_0xe467('0x14')]);return _0x3f1ee4(_0x45be0d[_0xe467('0x13')][_0xe467('0x14')]);}else{logger[_0xe467('0x15')](_0xe467('0xf'),_0xa3b91a,'request\x20sent');_0x3f1ee4(_0x45be0d['result'][_0xe467('0x14')]);}})[_0xe467('0x16')](function(_0x5eefe0){logger[_0xe467('0x13')]('WhatsappAccount,\x20%s,\x20%s',_0xa3b91a,_0x5eefe0);_0x59caca(_0x5eefe0);});});}exports[_0xe467('0x17')]=function(_0xf288f2){var _0x3da597=this;return new Promise(function(_0x133f94,_0x45fa44){return db[_0xe467('0x18')][_0xe467('0x19')]({'raw':_0xf288f2['options']?_0xf288f2[_0xe467('0x1a')][_0xe467('0x1b')]===undefined?!![]:![]:!![],'where':_0xf288f2[_0xe467('0x1a')]?_0xf288f2['options'][_0xe467('0x1c')]||null:null,'attributes':_0xf288f2['options']?_0xf288f2[_0xe467('0x1a')][_0xe467('0x1d')]||null:null,'include':_0xf288f2[_0xe467('0x1a')]?_0xf288f2[_0xe467('0x1a')][_0xe467('0x1e')]?_[_0xe467('0x1f')](_0xf288f2[_0xe467('0x1a')][_0xe467('0x1e')],function(_0x4ae01b){return{'model':db[_0x4ae01b[_0xe467('0x20')]],'as':_0x4ae01b['as'],'attributes':_0x4ae01b[_0xe467('0x1d')],'include':_0x4ae01b[_0xe467('0x1e')]?_[_0xe467('0x1f')](_0x4ae01b['include'],function(_0x2694c8){return{'model':db[_0x2694c8[_0xe467('0x20')]],'as':_0x2694c8['as'],'attributes':_0x2694c8[_0xe467('0x1d')],'include':_0x2694c8[_0xe467('0x1e')]?_[_0xe467('0x1f')](_0x2694c8[_0xe467('0x1e')],function(_0x699bee){return{'model':db[_0x699bee[_0xe467('0x20')]],'as':_0x699bee['as'],'attributes':_0x699bee['attributes']};}):[]};}):[]};}):[]:[]})[_0xe467('0xe')](function(_0x61b1e0){logger['info'](_0xe467('0x17'),_0xf288f2);logger[_0xe467('0x11')](_0xe467('0x17'),_0xf288f2,JSON[_0xe467('0x12')](_0x61b1e0));_0x133f94(_0x61b1e0);})['catch'](function(_0x67ef1d){logger[_0xe467('0x13')](_0xe467('0x17'),_0x67ef1d[_0xe467('0x14')],_0xf288f2);_0x45fa44(_0x3da597[_0xe467('0x13')](0x1f4,_0x67ef1d[_0xe467('0x14')]));});});}; \ No newline at end of file +var _0xd7cc=['request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappAccount,\x20%s,\x20%s','message','result','ShowWhatsappAccount','options','where','attributes','map','model','include','catch','lodash','util','moment','bluebird','randomstring','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','register','request','then','info'];(function(_0x256d9a,_0x1dc479){var _0x705ca4=function(_0x237e82){while(--_0x237e82){_0x256d9a['push'](_0x256d9a['shift']());}};_0x705ca4(++_0x1dc479);}(_0xd7cc,0x131));var _0xcd7c=function(_0x14e8fb,_0x26d132){_0x14e8fb=_0x14e8fb-0x0;var _0x47db51=_0xd7cc[_0x14e8fb];return _0x47db51;};'use strict';var _=require(_0xcd7c('0x0'));var util=require(_0xcd7c('0x1'));var moment=require(_0xcd7c('0x2'));var BPromise=require(_0xcd7c('0x3'));var rs=require(_0xcd7c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xcd7c('0x5'))(_0xcd7c('0x6'));var config=require('../../config/environment');var jayson=require(_0xcd7c('0x7'));var client=jayson[_0xcd7c('0x8')][_0xcd7c('0x9')]({'port':0x232a});config[_0xcd7c('0xa')]=_[_0xcd7c('0xb')](config['redis'],{'host':_0xcd7c('0xc'),'port':0x18eb});var socket=require(_0xcd7c('0xd'))(new Redis(config['redis']));require(_0xcd7c('0xe'))[_0xcd7c('0xf')](socket);function respondWithRpcPromise(_0x27ab28,_0x7598b3,_0x5e6b18){return new BPromise(function(_0x50cafc,_0x125a39){return client[_0xcd7c('0x10')](_0x27ab28,_0x5e6b18)[_0xcd7c('0x11')](function(_0x3b6572){logger[_0xcd7c('0x12')]('WhatsappAccount,\x20%s,\x20%s',_0x7598b3,_0xcd7c('0x13'));logger[_0xcd7c('0x14')](_0xcd7c('0x15'),_0x7598b3,_0xcd7c('0x13'),JSON[_0xcd7c('0x16')](_0x3b6572));if(_0x3b6572[_0xcd7c('0x17')]){if(_0x3b6572[_0xcd7c('0x17')][_0xcd7c('0x18')]===0x1f4){logger[_0xcd7c('0x17')](_0xcd7c('0x19'),_0x7598b3,_0x3b6572[_0xcd7c('0x17')][_0xcd7c('0x1a')]);return _0x125a39(_0x3b6572[_0xcd7c('0x17')][_0xcd7c('0x1a')]);}logger[_0xcd7c('0x17')](_0xcd7c('0x19'),_0x7598b3,_0x3b6572[_0xcd7c('0x17')][_0xcd7c('0x1a')]);return _0x50cafc(_0x3b6572[_0xcd7c('0x17')][_0xcd7c('0x1a')]);}else{logger[_0xcd7c('0x12')](_0xcd7c('0x19'),_0x7598b3,'request\x20sent');_0x50cafc(_0x3b6572[_0xcd7c('0x1b')][_0xcd7c('0x1a')]);}})['catch'](function(_0x10792b){logger[_0xcd7c('0x17')](_0xcd7c('0x19'),_0x7598b3,_0x10792b);_0x125a39(_0x10792b);});});}exports[_0xcd7c('0x1c')]=function(_0x59e6a5){var _0x483a1d=this;return new Promise(function(_0xdd4f9c,_0x52e187){return db['WhatsappAccount']['find']({'raw':_0x59e6a5[_0xcd7c('0x1d')]?_0x59e6a5[_0xcd7c('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x59e6a5[_0xcd7c('0x1d')]?_0x59e6a5['options'][_0xcd7c('0x1e')]||null:null,'attributes':_0x59e6a5[_0xcd7c('0x1d')]?_0x59e6a5[_0xcd7c('0x1d')][_0xcd7c('0x1f')]||null:null,'include':_0x59e6a5[_0xcd7c('0x1d')]?_0x59e6a5[_0xcd7c('0x1d')]['include']?_[_0xcd7c('0x20')](_0x59e6a5[_0xcd7c('0x1d')]['include'],function(_0x2084e6){return{'model':db[_0x2084e6[_0xcd7c('0x21')]],'as':_0x2084e6['as'],'attributes':_0x2084e6[_0xcd7c('0x1f')],'include':_0x2084e6[_0xcd7c('0x22')]?_[_0xcd7c('0x20')](_0x2084e6[_0xcd7c('0x22')],function(_0xe63008){return{'model':db[_0xe63008[_0xcd7c('0x21')]],'as':_0xe63008['as'],'attributes':_0xe63008['attributes'],'include':_0xe63008[_0xcd7c('0x22')]?_[_0xcd7c('0x20')](_0xe63008[_0xcd7c('0x22')],function(_0x37a47e){return{'model':db[_0x37a47e[_0xcd7c('0x21')]],'as':_0x37a47e['as'],'attributes':_0x37a47e[_0xcd7c('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xcd7c('0x11')](function(_0x405a75){logger[_0xcd7c('0x12')](_0xcd7c('0x1c'),_0x59e6a5);logger['debug'](_0xcd7c('0x1c'),_0x59e6a5,JSON['stringify'](_0x405a75));_0xdd4f9c(_0x405a75);})[_0xcd7c('0x23')](function(_0xf7bf8a){logger[_0xcd7c('0x17')](_0xcd7c('0x1c'),_0xf7bf8a['message'],_0x59e6a5);_0x52e187(_0x483a1d[_0xcd7c('0x17')](0x1f4,_0xf7bf8a[_0xcd7c('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index 5b6e4ca..5dd0aac 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 _0x6ec2=['removeListener','register','length','whatsappAccount:','./whatsappAccount.events','save','remove','update'];(function(_0x2cc594,_0x4d727b){var _0x4abff7=function(_0x22b01d){while(--_0x22b01d){_0x2cc594['push'](_0x2cc594['shift']());}};_0x4abff7(++_0x4d727b);}(_0x6ec2,0xb4));var _0x26ec=function(_0x433766,_0x49e912){_0x433766=_0x433766-0x0;var _0x48dba8=_0x6ec2[_0x433766];return _0x48dba8;};'use strict';var WhatsappAccountEvents=require(_0x26ec('0x0'));var events=[_0x26ec('0x1'),_0x26ec('0x2'),_0x26ec('0x3')];function createListener(_0x5e7e23,_0x145aa7){return function(_0x42c613){_0x145aa7['emit'](_0x5e7e23,_0x42c613);};}function removeListener(_0x56662d,_0x14584c){return function(){WhatsappAccountEvents[_0x26ec('0x4')](_0x56662d,_0x14584c);};}exports[_0x26ec('0x5')]=function(_0x14be40){for(var _0x17bebd=0x0,_0x16955e=events[_0x26ec('0x6')];_0x17bebd<_0x16955e;_0x17bebd++){var _0x11d8d6=events[_0x17bebd];var _0x53deee=createListener(_0x26ec('0x7')+_0x11d8d6,_0x14be40);WhatsappAccountEvents['on'](_0x11d8d6,_0x53deee);}}; \ No newline at end of file +var _0x3c76=['./whatsappAccount.events','remove','emit','removeListener'];(function(_0x47f6f3,_0x5b0a81){var _0x3a2ae6=function(_0x11c29d){while(--_0x11c29d){_0x47f6f3['push'](_0x47f6f3['shift']());}};_0x3a2ae6(++_0x5b0a81);}(_0x3c76,0xb4));var _0x63c7=function(_0x378811,_0x42643c){_0x378811=_0x378811-0x0;var _0x33da6f=_0x3c76[_0x378811];return _0x33da6f;};'use strict';var WhatsappAccountEvents=require(_0x63c7('0x0'));var events=['save',_0x63c7('0x1'),'update'];function createListener(_0x4220a6,_0x18b05b){return function(_0x15bf45){_0x18b05b[_0x63c7('0x2')](_0x4220a6,_0x15bf45);};}function removeListener(_0x10ff92,_0x2696e5){return function(){WhatsappAccountEvents[_0x63c7('0x3')](_0x10ff92,_0x2696e5);};}exports['register']=function(_0x14d77f){for(var _0x507071=0x0,_0x1c76f3=events['length'];_0x507071<_0x1c76f3;_0x507071++){var _0x27b361=events[_0x507071];var _0x3a7b6d=createListener('whatsappAccount:'+_0x27b361,_0x14d77f);WhatsappAccountEvents['on'](_0x27b361,_0x3a7b6d);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index a3bae7c..673a1af 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 _0x6a3f=['multer','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','/:id','show','post','isAuthenticated','create','put','update','delete','exports'];(function(_0x1331a4,_0x1aba4c){var _0x46d5a7=function(_0x354f1a){while(--_0x354f1a){_0x1331a4['push'](_0x1331a4['shift']());}};_0x46d5a7(++_0x1aba4c);}(_0x6a3f,0xaa));var _0xf6a3=function(_0x318e2a,_0x50e65d){_0x318e2a=_0x318e2a-0x0;var _0x111736=_0x6a3f[_0x318e2a];return _0x111736;};'use strict';var multer=require(_0xf6a3('0x0'));var util=require(_0xf6a3('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xf6a3('0x2'));var router=express[_0xf6a3('0x3')]();var fs_extra=require(_0xf6a3('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xf6a3('0x5'));var config=require(_0xf6a3('0x6'));var controller=require('./whatsappApplication.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xf6a3('0x7')](_0xf6a3('0x8'),auth['isAuthenticated'](),controller[_0xf6a3('0x9')]);router[_0xf6a3('0xa')]('/',auth[_0xf6a3('0xb')](),controller[_0xf6a3('0xc')]);router[_0xf6a3('0xd')](_0xf6a3('0x8'),auth['isAuthenticated'](),controller[_0xf6a3('0xe')]);router[_0xf6a3('0xf')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xf6a3('0x10')]=router; \ No newline at end of file +var _0xd324=['destroy','multer','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','post','create','update','delete'];(function(_0x2d85f9,_0x1add32){var _0x2e0f3f=function(_0x58102d){while(--_0x58102d){_0x2d85f9['push'](_0x2d85f9['shift']());}};_0x2e0f3f(++_0x1add32);}(_0xd324,0x121));var _0x4d32=function(_0x24f31b,_0x44b8f3){_0x24f31b=_0x24f31b-0x0;var _0x488401=_0xd324[_0x24f31b];return _0x488401;};'use strict';var multer=require(_0x4d32('0x0'));var util=require('util');var path=require(_0x4d32('0x1'));var timeout=require(_0x4d32('0x2'));var express=require('express');var router=express[_0x4d32('0x3')]();var fs_extra=require(_0x4d32('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x4d32('0x5'));var config=require(_0x4d32('0x6'));var controller=require('./whatsappApplication.controller');router['get']('/',auth[_0x4d32('0x7')](),controller[_0x4d32('0x8')]);router[_0x4d32('0x9')](_0x4d32('0xa'),auth[_0x4d32('0x7')](),controller['show']);router[_0x4d32('0xb')]('/',auth['isAuthenticated'](),controller[_0x4d32('0xc')]);router['put'](_0x4d32('0xa'),auth[_0x4d32('0x7')](),controller[_0x4d32('0xd')]);router[_0x4d32('0xe')](_0x4d32('0xa'),auth['isAuthenticated'](),controller[_0x4d32('0xf')]);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 a069959..94164e8 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 _0xce39=['*,*,*,*','sequelize','STRING','noop','TEXT'];(function(_0x50d760,_0x586779){var _0x24aa96=function(_0x26dff4){while(--_0x26dff4){_0x50d760['push'](_0x50d760['shift']());}};_0x24aa96(++_0x586779);}(_0xce39,0x11e));var _0x9ce3=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xce39[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require(_0x9ce3('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x9ce3('0x1')],'allowNull':![],'defaultValue':_0x9ce3('0x2')},'appdata':{'type':Sequelize[_0x9ce3('0x3')]()},'description':{'type':Sequelize[_0x9ce3('0x1')]},'interval':{'type':Sequelize[_0x9ce3('0x1')],'defaultValue':_0x9ce3('0x4')}}; \ No newline at end of file +var _0xa3bb=['sequelize','exports','STRING','noop','TEXT'];(function(_0x3ec1da,_0x1e36f5){var _0x472358=function(_0x1d41b1){while(--_0x1d41b1){_0x3ec1da['push'](_0x3ec1da['shift']());}};_0x472358(++_0x1e36f5);}(_0xa3bb,0xd2));var _0xba3b=function(_0xca5c04,_0x3a5a54){_0xca5c04=_0xca5c04-0x0;var _0x382460=_0xa3bb[_0xca5c04];return _0x382460;};'use strict';var Sequelize=require(_0xba3b('0x0'));module[_0xba3b('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xba3b('0x2')],'allowNull':![],'defaultValue':_0xba3b('0x3')},'appdata':{'type':Sequelize[_0xba3b('0x4')]()},'description':{'type':Sequelize[_0xba3b('0x2')]},'interval':{'type':Sequelize[_0xba3b('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index 4ac9ade..09d833a 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 _0xf954=['count','set','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','index','map','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','WhatsappApplication','includeAll','include','rows','catch','show','params','rawAttributes','options','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit'];(function(_0x3ac69a,_0x3263ad){var _0x2f403b=function(_0x1cd460){while(--_0x1cd460){_0x3ac69a['push'](_0x3ac69a['shift']());}};_0x2f403b(++_0x3263ad);}(_0xf954,0x10e));var _0x4f95=function(_0x3b58c9,_0x1f46c3){_0x3b58c9=_0x3b58c9-0x0;var _0x5b653a=_0xf954[_0x3b58c9];return _0x5b653a;};'use strict';var emlformat=require(_0x4f95('0x0'));var rimraf=require(_0x4f95('0x1'));var zipdir=require(_0x4f95('0x2'));var jsonpatch=require(_0x4f95('0x3'));var rp=require(_0x4f95('0x4'));var moment=require(_0x4f95('0x5'));var BPromise=require(_0x4f95('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x4f95('0x7'));var sox=require(_0x4f95('0x8'));var csv=require(_0x4f95('0x9'));var ejs=require(_0x4f95('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4f95('0xb'));var squel=require(_0x4f95('0xc'));var crypto=require(_0x4f95('0xd'));var jsforce=require(_0x4f95('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4f95('0xf'));var Papa=require(_0x4f95('0x10'));var Redis=require(_0x4f95('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4f95('0x12'));var logger=require(_0x4f95('0x13'))(_0x4f95('0x14'));var utils=require(_0x4f95('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x4f95('0x16'));var db=require(_0x4f95('0x17'))['db'];function respondWithStatusCode(_0x424457,_0x4629d9){_0x4629d9=_0x4629d9||0xcc;return function(_0xefe2a2){if(_0xefe2a2){return _0x424457['sendStatus'](_0x4629d9);}return _0x424457[_0x4f95('0x18')](_0x4629d9)[_0x4f95('0x19')]();};}function respondWithResult(_0x39a456,_0x125249){_0x125249=_0x125249||0xc8;return function(_0x56d995){if(_0x56d995){return _0x39a456[_0x4f95('0x18')](_0x125249)[_0x4f95('0x1a')](_0x56d995);}};}function respondWithFilteredResult(_0x234adf,_0x57bbcd){return function(_0xfd3673){if(_0xfd3673){var _0x451dc2=typeof _0x57bbcd[_0x4f95('0x1b')]===_0x4f95('0x1c')&&typeof _0x57bbcd[_0x4f95('0x1d')]===_0x4f95('0x1c');var _0x2aa444=_0xfd3673[_0x4f95('0x1e')];var _0x235c03=_0x451dc2?0x0:_0x57bbcd[_0x4f95('0x1b')];var _0x5918ad=_0x451dc2?_0xfd3673[_0x4f95('0x1e')]:_0x57bbcd[_0x4f95('0x1b')]+_0x57bbcd[_0x4f95('0x1d')];var _0x2d2595;if(_0x5918ad>=_0x2aa444){_0x5918ad=_0x2aa444;_0x2d2595=0xc8;}else{_0x2d2595=0xce;}_0x234adf[_0x4f95('0x18')](_0x2d2595);return _0x234adf[_0x4f95('0x1f')](_0x4f95('0x20'),_0x235c03+'-'+_0x5918ad+'/'+_0x2aa444)[_0x4f95('0x1a')](_0xfd3673);}return null;};}function patchUpdates(_0xc449b4){return function(_0x50d3b0){try{jsonpatch[_0x4f95('0x21')](_0x50d3b0,_0xc449b4,!![]);}catch(_0xf70461){return BPromise[_0x4f95('0x22')](_0xf70461);}return _0x50d3b0[_0x4f95('0x23')]();};}function saveUpdates(_0x131436,_0xe47cd7){return function(_0xe49db2){if(_0xe49db2){return _0xe49db2[_0x4f95('0x24')](_0x131436)[_0x4f95('0x25')](function(_0x10cab5){return _0x10cab5;});}return null;};}function removeEntity(_0x21e3eb,_0x27a229){return function(_0x1e675c){if(_0x1e675c){return _0x1e675c['destroy']()[_0x4f95('0x25')](function(){_0x21e3eb[_0x4f95('0x18')](0xcc)[_0x4f95('0x19')]();});}};}function handleEntityNotFound(_0x34a4de,_0x3875fe){return function(_0x14ba9f){if(!_0x14ba9f){_0x34a4de[_0x4f95('0x26')](0x194);}return _0x14ba9f;};}function handleError(_0x49677d,_0x2154c4){_0x2154c4=_0x2154c4||0x1f4;return function(_0x50996d){logger[_0x4f95('0x27')](_0x50996d[_0x4f95('0x28')]);if(_0x50996d[_0x4f95('0x29')]){delete _0x50996d[_0x4f95('0x29')];}_0x49677d[_0x4f95('0x18')](_0x2154c4)['send'](_0x50996d);};}exports[_0x4f95('0x2a')]=function(_0x2dc278,_0x1cdd1b){var _0x6ff6c4={},_0x1ae268={},_0x73783a={'count':0x0,'rows':[]};var _0x2e33dc=_[_0x4f95('0x2b')](db['WhatsappApplication']['rawAttributes'],function(_0x5ea525){return{'name':_0x5ea525[_0x4f95('0x2c')],'type':_0x5ea525['type'][_0x4f95('0x2d')]};});_0x1ae268[_0x4f95('0x2e')]=_[_0x4f95('0x2b')](_0x2e33dc,_0x4f95('0x29'));_0x1ae268[_0x4f95('0x2f')]=_[_0x4f95('0x30')](_0x2dc278[_0x4f95('0x2f')]);_0x1ae268[_0x4f95('0x31')]=_['intersection'](_0x1ae268[_0x4f95('0x2e')],_0x1ae268[_0x4f95('0x2f')]);_0x6ff6c4[_0x4f95('0x32')]=_[_0x4f95('0x33')](_0x1ae268[_0x4f95('0x2e')],qs[_0x4f95('0x34')](_0x2dc278[_0x4f95('0x2f')][_0x4f95('0x34')]));_0x6ff6c4['attributes']=_0x6ff6c4[_0x4f95('0x32')][_0x4f95('0x35')]?_0x6ff6c4[_0x4f95('0x32')]:_0x1ae268[_0x4f95('0x2e')];if(!_0x2dc278[_0x4f95('0x2f')][_0x4f95('0x36')](_0x4f95('0x37'))){_0x6ff6c4[_0x4f95('0x1d')]=qs[_0x4f95('0x1d')](_0x2dc278[_0x4f95('0x2f')][_0x4f95('0x1d')]);_0x6ff6c4[_0x4f95('0x1b')]=qs[_0x4f95('0x1b')](_0x2dc278['query']['offset']);}_0x6ff6c4[_0x4f95('0x38')]=qs[_0x4f95('0x39')](_0x2dc278[_0x4f95('0x2f')][_0x4f95('0x39')]);_0x6ff6c4[_0x4f95('0x3a')]=qs['filters'](_['pick'](_0x2dc278[_0x4f95('0x2f')],_0x1ae268[_0x4f95('0x31')]),_0x2e33dc);if(_0x2dc278[_0x4f95('0x2f')][_0x4f95('0x3b')]){_0x6ff6c4[_0x4f95('0x3a')]=_[_0x4f95('0x3c')](_0x6ff6c4['where'],{'$or':_[_0x4f95('0x2b')](_0x2e33dc,function(_0x110470){if(_0x110470[_0x4f95('0x3d')]!==_0x4f95('0x3e')){var _0x203b19={};_0x203b19[_0x110470[_0x4f95('0x29')]]={'$like':'%'+_0x2dc278[_0x4f95('0x2f')]['filter']+'%'};return _0x203b19;}})});}_0x6ff6c4=_['merge']({},_0x6ff6c4,_0x2dc278['options']);var _0x5322db={'where':_0x6ff6c4[_0x4f95('0x3a')]};return db[_0x4f95('0x3f')]['count'](_0x5322db)['then'](function(_0x4b6009){_0x73783a[_0x4f95('0x1e')]=_0x4b6009;if(_0x2dc278[_0x4f95('0x2f')][_0x4f95('0x40')]){_0x6ff6c4[_0x4f95('0x41')]=[{'all':!![]}];}return db[_0x4f95('0x3f')]['findAll'](_0x6ff6c4);})[_0x4f95('0x25')](function(_0x2af149){_0x73783a[_0x4f95('0x42')]=_0x2af149;return _0x73783a;})[_0x4f95('0x25')](respondWithFilteredResult(_0x1cdd1b,_0x6ff6c4))[_0x4f95('0x43')](handleError(_0x1cdd1b,null));};exports[_0x4f95('0x44')]=function(_0x338d48,_0x10e8bf){var _0x2e133d={'raw':!![],'where':{'id':_0x338d48[_0x4f95('0x45')]['id']}},_0x572606={};_0x572606[_0x4f95('0x2e')]=_[_0x4f95('0x30')](db[_0x4f95('0x3f')][_0x4f95('0x46')]);_0x572606['query']=_['keys'](_0x338d48['query']);_0x572606[_0x4f95('0x31')]=_[_0x4f95('0x33')](_0x572606[_0x4f95('0x2e')],_0x572606['query']);_0x2e133d['attributes']=_[_0x4f95('0x33')](_0x572606[_0x4f95('0x2e')],qs[_0x4f95('0x34')](_0x338d48['query'][_0x4f95('0x34')]));_0x2e133d[_0x4f95('0x32')]=_0x2e133d['attributes']['length']?_0x2e133d[_0x4f95('0x32')]:_0x572606[_0x4f95('0x2e')];if(_0x338d48[_0x4f95('0x2f')][_0x4f95('0x40')]){_0x2e133d[_0x4f95('0x41')]=[{'all':!![]}];}_0x2e133d=_[_0x4f95('0x3c')]({},_0x2e133d,_0x338d48[_0x4f95('0x47')]);return db[_0x4f95('0x3f')][_0x4f95('0x48')](_0x2e133d)[_0x4f95('0x25')](handleEntityNotFound(_0x10e8bf,null))[_0x4f95('0x25')](respondWithResult(_0x10e8bf,null))['catch'](handleError(_0x10e8bf,null));};exports[_0x4f95('0x49')]=function(_0x23b029,_0x372e1b){return db[_0x4f95('0x3f')]['create'](_0x23b029[_0x4f95('0x4a')],{})[_0x4f95('0x25')](respondWithResult(_0x372e1b,0xc9))[_0x4f95('0x43')](handleError(_0x372e1b,null));};exports[_0x4f95('0x24')]=function(_0x3b66b8,_0x43c97b){if(_0x3b66b8['body']['id']){delete _0x3b66b8[_0x4f95('0x4a')]['id'];}return db[_0x4f95('0x3f')][_0x4f95('0x48')]({'where':{'id':_0x3b66b8[_0x4f95('0x45')]['id']}})[_0x4f95('0x25')](handleEntityNotFound(_0x43c97b,null))[_0x4f95('0x25')](saveUpdates(_0x3b66b8[_0x4f95('0x4a')],null))['then'](respondWithResult(_0x43c97b,null))[_0x4f95('0x43')](handleError(_0x43c97b,null));};exports['destroy']=function(_0x4646ca,_0x2d91bc){return db[_0x4f95('0x3f')]['find']({'where':{'id':_0x4646ca['params']['id']}})[_0x4f95('0x25')](handleEntityNotFound(_0x2d91bc,null))['then'](removeEntity(_0x2d91bc,null))[_0x4f95('0x43')](handleError(_0x2d91bc,null));}; \ No newline at end of file +var _0xf0f4=['options','include','findAll','rows','show','params','find','create','catch','body','destroy','rimraf','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','update','then','error','stack','name','send','index','WhatsappApplication','fieldName','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf0f4,0x182));var _0x4f0f=function(_0x503444,_0x35bf4d){_0x503444=_0x503444-0x0;var _0x5dd68c=_0xf0f4[_0x503444];return _0x5dd68c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4f0f('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x4f0f('0x1'));var moment=require(_0x4f0f('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x4f0f('0x3'));var util=require(_0x4f0f('0x4'));var path=require(_0x4f0f('0x5'));var sox=require(_0x4f0f('0x6'));var csv=require(_0x4f0f('0x7'));var ejs=require(_0x4f0f('0x8'));var fs=require('fs');var fs_extra=require(_0x4f0f('0x9'));var _=require('lodash');var squel=require(_0x4f0f('0xa'));var crypto=require(_0x4f0f('0xb'));var jsforce=require(_0x4f0f('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x4f0f('0x7'));var querystring=require(_0x4f0f('0xd'));var Papa=require(_0x4f0f('0xe'));var Redis=require(_0x4f0f('0xf'));var authService=require(_0x4f0f('0x10'));var qs=require(_0x4f0f('0x11'));var as=require(_0x4f0f('0x12'));var hardwareService=require(_0x4f0f('0x13'));var logger=require('../../config/logger')(_0x4f0f('0x14'));var utils=require(_0x4f0f('0x15'));var config=require(_0x4f0f('0x16'));var licenseUtil=require(_0x4f0f('0x17'));var db=require(_0x4f0f('0x18'))['db'];function respondWithStatusCode(_0x1a1b94,_0x123845){_0x123845=_0x123845||0xcc;return function(_0x11749b){if(_0x11749b){return _0x1a1b94[_0x4f0f('0x19')](_0x123845);}return _0x1a1b94[_0x4f0f('0x1a')](_0x123845)[_0x4f0f('0x1b')]();};}function respondWithResult(_0x4e1e26,_0xebecc0){_0xebecc0=_0xebecc0||0xc8;return function(_0x447238){if(_0x447238){return _0x4e1e26[_0x4f0f('0x1a')](_0xebecc0)[_0x4f0f('0x1c')](_0x447238);}};}function respondWithFilteredResult(_0x51a713,_0xd9ad12){return function(_0x46d7cf){if(_0x46d7cf){var _0x5783=typeof _0xd9ad12[_0x4f0f('0x1d')]===_0x4f0f('0x1e')&&typeof _0xd9ad12['limit']===_0x4f0f('0x1e');var _0x1942cf=_0x46d7cf[_0x4f0f('0x1f')];var _0x566049=_0x5783?0x0:_0xd9ad12[_0x4f0f('0x1d')];var _0x86186f=_0x5783?_0x46d7cf[_0x4f0f('0x1f')]:_0xd9ad12['offset']+_0xd9ad12[_0x4f0f('0x20')];var _0x2455f9;if(_0x86186f>=_0x1942cf){_0x86186f=_0x1942cf;_0x2455f9=0xc8;}else{_0x2455f9=0xce;}_0x51a713[_0x4f0f('0x1a')](_0x2455f9);return _0x51a713[_0x4f0f('0x21')](_0x4f0f('0x22'),_0x566049+'-'+_0x86186f+'/'+_0x1942cf)[_0x4f0f('0x1c')](_0x46d7cf);}return null;};}function patchUpdates(_0x537074){return function(_0x276387){try{jsonpatch['apply'](_0x276387,_0x537074,!![]);}catch(_0x3a6f22){return BPromise[_0x4f0f('0x23')](_0x3a6f22);}return _0x276387['save']();};}function saveUpdates(_0x4e4b28,_0x1bdfb4){return function(_0x55d318){if(_0x55d318){return _0x55d318[_0x4f0f('0x24')](_0x4e4b28)[_0x4f0f('0x25')](function(_0x18abde){return _0x18abde;});}return null;};}function removeEntity(_0x17f10c,_0x454720){return function(_0x17a9e9){if(_0x17a9e9){return _0x17a9e9['destroy']()[_0x4f0f('0x25')](function(){_0x17f10c[_0x4f0f('0x1a')](0xcc)[_0x4f0f('0x1b')]();});}};}function handleEntityNotFound(_0x3bc77d,_0xe969c7){return function(_0x3e6b72){if(!_0x3e6b72){_0x3bc77d[_0x4f0f('0x19')](0x194);}return _0x3e6b72;};}function handleError(_0x419986,_0x17cf17){_0x17cf17=_0x17cf17||0x1f4;return function(_0xb20be9){logger[_0x4f0f('0x26')](_0xb20be9[_0x4f0f('0x27')]);if(_0xb20be9[_0x4f0f('0x28')]){delete _0xb20be9['name'];}_0x419986[_0x4f0f('0x1a')](_0x17cf17)[_0x4f0f('0x29')](_0xb20be9);};}exports[_0x4f0f('0x2a')]=function(_0x58ec43,_0xa8a240){var _0x4e5f0d={},_0x449788={},_0x1f4e1d={'count':0x0,'rows':[]};var _0x5ada54=_['map'](db[_0x4f0f('0x2b')]['rawAttributes'],function(_0x1a005e){return{'name':_0x1a005e[_0x4f0f('0x2c')],'type':_0x1a005e['type'][_0x4f0f('0x2d')]};});_0x449788[_0x4f0f('0x2e')]=_[_0x4f0f('0x2f')](_0x5ada54,_0x4f0f('0x28'));_0x449788['query']=_[_0x4f0f('0x30')](_0x58ec43[_0x4f0f('0x31')]);_0x449788[_0x4f0f('0x32')]=_[_0x4f0f('0x33')](_0x449788['model'],_0x449788[_0x4f0f('0x31')]);_0x4e5f0d[_0x4f0f('0x34')]=_[_0x4f0f('0x33')](_0x449788['model'],qs[_0x4f0f('0x35')](_0x58ec43[_0x4f0f('0x31')]['fields']));_0x4e5f0d[_0x4f0f('0x34')]=_0x4e5f0d[_0x4f0f('0x34')][_0x4f0f('0x36')]?_0x4e5f0d[_0x4f0f('0x34')]:_0x449788['model'];if(!_0x58ec43[_0x4f0f('0x31')][_0x4f0f('0x37')](_0x4f0f('0x38'))){_0x4e5f0d[_0x4f0f('0x20')]=qs[_0x4f0f('0x20')](_0x58ec43[_0x4f0f('0x31')][_0x4f0f('0x20')]);_0x4e5f0d[_0x4f0f('0x1d')]=qs['offset'](_0x58ec43[_0x4f0f('0x31')][_0x4f0f('0x1d')]);}_0x4e5f0d[_0x4f0f('0x39')]=qs[_0x4f0f('0x3a')](_0x58ec43[_0x4f0f('0x31')][_0x4f0f('0x3a')]);_0x4e5f0d[_0x4f0f('0x3b')]=qs['filters'](_[_0x4f0f('0x3c')](_0x58ec43[_0x4f0f('0x31')],_0x449788[_0x4f0f('0x32')]),_0x5ada54);if(_0x58ec43['query'][_0x4f0f('0x3d')]){_0x4e5f0d['where']=_[_0x4f0f('0x3e')](_0x4e5f0d['where'],{'$or':_[_0x4f0f('0x2f')](_0x5ada54,function(_0x27b5bf){if(_0x27b5bf['type']!==_0x4f0f('0x3f')){var _0x2d58b0={};_0x2d58b0[_0x27b5bf[_0x4f0f('0x28')]]={'$like':'%'+_0x58ec43['query'][_0x4f0f('0x3d')]+'%'};return _0x2d58b0;}})});}_0x4e5f0d=_[_0x4f0f('0x3e')]({},_0x4e5f0d,_0x58ec43[_0x4f0f('0x40')]);var _0x1b91d7={'where':_0x4e5f0d[_0x4f0f('0x3b')]};return db[_0x4f0f('0x2b')][_0x4f0f('0x1f')](_0x1b91d7)[_0x4f0f('0x25')](function(_0x2659b0){_0x1f4e1d[_0x4f0f('0x1f')]=_0x2659b0;if(_0x58ec43[_0x4f0f('0x31')]['includeAll']){_0x4e5f0d[_0x4f0f('0x41')]=[{'all':!![]}];}return db[_0x4f0f('0x2b')][_0x4f0f('0x42')](_0x4e5f0d);})[_0x4f0f('0x25')](function(_0x419cb4){_0x1f4e1d[_0x4f0f('0x43')]=_0x419cb4;return _0x1f4e1d;})[_0x4f0f('0x25')](respondWithFilteredResult(_0xa8a240,_0x4e5f0d))['catch'](handleError(_0xa8a240,null));};exports[_0x4f0f('0x44')]=function(_0x2e30d6,_0x1d8017){var _0x2bf0b3={'raw':!![],'where':{'id':_0x2e30d6[_0x4f0f('0x45')]['id']}},_0x1744f9={};_0x1744f9['model']=_[_0x4f0f('0x30')](db[_0x4f0f('0x2b')]['rawAttributes']);_0x1744f9['query']=_[_0x4f0f('0x30')](_0x2e30d6[_0x4f0f('0x31')]);_0x1744f9[_0x4f0f('0x32')]=_['intersection'](_0x1744f9[_0x4f0f('0x2e')],_0x1744f9['query']);_0x2bf0b3['attributes']=_[_0x4f0f('0x33')](_0x1744f9[_0x4f0f('0x2e')],qs[_0x4f0f('0x35')](_0x2e30d6[_0x4f0f('0x31')][_0x4f0f('0x35')]));_0x2bf0b3[_0x4f0f('0x34')]=_0x2bf0b3['attributes']['length']?_0x2bf0b3[_0x4f0f('0x34')]:_0x1744f9[_0x4f0f('0x2e')];if(_0x2e30d6[_0x4f0f('0x31')]['includeAll']){_0x2bf0b3[_0x4f0f('0x41')]=[{'all':!![]}];}_0x2bf0b3=_[_0x4f0f('0x3e')]({},_0x2bf0b3,_0x2e30d6[_0x4f0f('0x40')]);return db['WhatsappApplication'][_0x4f0f('0x46')](_0x2bf0b3)['then'](handleEntityNotFound(_0x1d8017,null))[_0x4f0f('0x25')](respondWithResult(_0x1d8017,null))['catch'](handleError(_0x1d8017,null));};exports[_0x4f0f('0x47')]=function(_0x3f2c6e,_0x2b0d3e){return db[_0x4f0f('0x2b')][_0x4f0f('0x47')](_0x3f2c6e['body'],{})['then'](respondWithResult(_0x2b0d3e,0xc9))[_0x4f0f('0x48')](handleError(_0x2b0d3e,null));};exports['update']=function(_0x12e587,_0x32d298){if(_0x12e587[_0x4f0f('0x49')]['id']){delete _0x12e587[_0x4f0f('0x49')]['id'];}return db[_0x4f0f('0x2b')][_0x4f0f('0x46')]({'where':{'id':_0x12e587[_0x4f0f('0x45')]['id']}})[_0x4f0f('0x25')](handleEntityNotFound(_0x32d298,null))['then'](saveUpdates(_0x12e587[_0x4f0f('0x49')],null))[_0x4f0f('0x25')](respondWithResult(_0x32d298,null))[_0x4f0f('0x48')](handleError(_0x32d298,null));};exports[_0x4f0f('0x4a')]=function(_0x355517,_0x3262a6){return db[_0x4f0f('0x2b')][_0x4f0f('0x46')]({'where':{'id':_0x355517[_0x4f0f('0x45')]['id']}})[_0x4f0f('0x25')](handleEntityNotFound(_0x3262a6,null))['then'](removeEntity(_0x3262a6,null))[_0x4f0f('0x48')](handleError(_0x3262a6,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index a9e28ff..c8edf8e 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 _0xc997=['rimraf','../../config/environment','./whatsappApplication.attributes','exports','define','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','path'];(function(_0x496729,_0x4e331f){var _0x100ad4=function(_0x4a6303){while(--_0x4a6303){_0x496729['push'](_0x496729['shift']());}};_0x100ad4(++_0x4e331f);}(_0xc997,0x1ac));var _0x7c99=function(_0x33d022,_0x555dee){_0x33d022=_0x33d022-0x0;var _0x3760e5=_0xc997[_0x33d022];return _0x3760e5;};'use strict';var _=require('lodash');var util=require(_0x7c99('0x0'));var logger=require(_0x7c99('0x1'))(_0x7c99('0x2'));var moment=require(_0x7c99('0x3'));var BPromise=require(_0x7c99('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7c99('0x5'));var rimraf=require(_0x7c99('0x6'));var config=require(_0x7c99('0x7'));var attributes=require(_0x7c99('0x8'));module[_0x7c99('0x9')]=function(_0x404ffb,_0x1a21e1){return _0x404ffb[_0x7c99('0xa')]('WhatsappApplication',attributes,{'tableName':_0x7c99('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7c99('0xc'),'collate':_0x7c99('0xd')});}; \ No newline at end of file +var _0xed1f=['request-promise','path','rimraf','../../config/environment','./whatsappApplication.attributes','exports','define','WhatsappApplication','whatsapp_applications','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xed1f,0x6a));var _0xfed1=function(_0x1589dd,_0x2b9d22){_0x1589dd=_0x1589dd-0x0;var _0x1bddd1=_0xed1f[_0x1589dd];return _0x1bddd1;};'use strict';var _=require(_0xfed1('0x0'));var util=require(_0xfed1('0x1'));var logger=require(_0xfed1('0x2'))(_0xfed1('0x3'));var moment=require(_0xfed1('0x4'));var BPromise=require(_0xfed1('0x5'));var rp=require(_0xfed1('0x6'));var fs=require('fs');var path=require(_0xfed1('0x7'));var rimraf=require(_0xfed1('0x8'));var config=require(_0xfed1('0x9'));var attributes=require(_0xfed1('0xa'));module[_0xfed1('0xb')]=function(_0x3d6706,_0x42751d){return _0x3d6706[_0xfed1('0xc')](_0xfed1('0xd'),attributes,{'tableName':_0xfed1('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xfed1('0xf'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index f603288..189389e 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 _0x7bae=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','moment','bluebird','ioredis','../../config/utils','../../config/logger'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x7bae,0x13b));var _0xe7ba=function(_0x397cfb,_0xb8f317){_0x397cfb=_0x397cfb-0x0;var _0x15fed9=_0x7bae[_0x397cfb];return _0x15fed9;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe7ba('0x0'));var BPromise=require(_0xe7ba('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe7ba('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xe7ba('0x3'));var logger=require(_0xe7ba('0x4'))(_0xe7ba('0x5'));var config=require(_0xe7ba('0x6'));var jayson=require(_0xe7ba('0x7'));var client=jayson[_0xe7ba('0x8')][_0xe7ba('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3c5e59,_0x10b307,_0x34fb18){return new BPromise(function(_0x160565,_0x27b1d5){return client[_0xe7ba('0xa')](_0x3c5e59,_0x34fb18)[_0xe7ba('0xb')](function(_0x588f08){logger[_0xe7ba('0xc')](_0xe7ba('0xd'),_0x10b307,_0xe7ba('0xe'));logger[_0xe7ba('0xf')](_0xe7ba('0x10'),_0x10b307,_0xe7ba('0xe'),JSON[_0xe7ba('0x11')](_0x588f08));if(_0x588f08[_0xe7ba('0x12')]){if(_0x588f08[_0xe7ba('0x12')]['code']===0x1f4){logger[_0xe7ba('0x12')]('WhatsappApplication,\x20%s,\x20%s',_0x10b307,_0x588f08[_0xe7ba('0x12')][_0xe7ba('0x13')]);return _0x27b1d5(_0x588f08[_0xe7ba('0x12')][_0xe7ba('0x13')]);}logger[_0xe7ba('0x12')](_0xe7ba('0xd'),_0x10b307,_0x588f08['error']['message']);return _0x160565(_0x588f08[_0xe7ba('0x12')][_0xe7ba('0x13')]);}else{logger[_0xe7ba('0xc')]('WhatsappApplication,\x20%s,\x20%s',_0x10b307,_0xe7ba('0xe'));_0x160565(_0x588f08['result']['message']);}})['catch'](function(_0x393f75){logger['error'](_0xe7ba('0xd'),_0x10b307,_0x393f75);_0x27b1d5(_0x393f75);});});} \ No newline at end of file +var _0xeec6=['then','info','WhatsappApplication,\x20%s,\x20%s,\x20%s','request\x20sent','error','WhatsappApplication,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x43a37c,_0x25a567){var _0x5d1d40=function(_0x3ec673){while(--_0x3ec673){_0x43a37c['push'](_0x43a37c['shift']());}};_0x5d1d40(++_0x25a567);}(_0xeec6,0x1c2));var _0x6eec=function(_0x39d6a8,_0xc9c91a){_0x39d6a8=_0x39d6a8-0x0;var _0x93f3db=_0xeec6[_0x39d6a8];return _0x93f3db;};'use strict';var _=require(_0x6eec('0x0'));var util=require(_0x6eec('0x1'));var moment=require(_0x6eec('0x2'));var BPromise=require(_0x6eec('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6eec('0x4'));var db=require(_0x6eec('0x5'))['db'];var utils=require(_0x6eec('0x6'));var logger=require(_0x6eec('0x7'))(_0x6eec('0x8'));var config=require(_0x6eec('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x6eec('0xa')][_0x6eec('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x48064a,_0x5a5e47,_0x1c810e){return new BPromise(function(_0x3443c2,_0x834c2){return client['request'](_0x48064a,_0x1c810e)[_0x6eec('0xc')](function(_0x3aca38){logger[_0x6eec('0xd')]('WhatsappApplication,\x20%s,\x20%s',_0x5a5e47,'request\x20sent');logger['debug'](_0x6eec('0xe'),_0x5a5e47,_0x6eec('0xf'),JSON['stringify'](_0x3aca38));if(_0x3aca38['error']){if(_0x3aca38[_0x6eec('0x10')]['code']===0x1f4){logger[_0x6eec('0x10')](_0x6eec('0x11'),_0x5a5e47,_0x3aca38[_0x6eec('0x10')][_0x6eec('0x12')]);return _0x834c2(_0x3aca38[_0x6eec('0x10')]['message']);}logger[_0x6eec('0x10')](_0x6eec('0x11'),_0x5a5e47,_0x3aca38[_0x6eec('0x10')][_0x6eec('0x12')]);return _0x3443c2(_0x3aca38[_0x6eec('0x10')][_0x6eec('0x12')]);}else{logger[_0x6eec('0xd')](_0x6eec('0x11'),_0x5a5e47,_0x6eec('0xf'));_0x3443c2(_0x3aca38[_0x6eec('0x13')]['message']);}})[_0x6eec('0x14')](function(_0x5f1f33){logger[_0x6eec('0x10')](_0x6eec('0x11'),_0x5a5e47,_0x5f1f33);_0x834c2(_0x5f1f33);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index ca1b1f4..11a6185 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 _0x56a4=['create','/:id/tags','tracked','whatsappinteraction:addtags','addTags','put','/:id','whatsappinteraction:update','update','delete','whatsapp','whatsappinteraction:destroy','removeTags','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','get','index','isAuthenticated','describe','/:id/messages','getMessages','/:id/download','download','post'];(function(_0x264545,_0x214037){var _0x114d10=function(_0x9e3461){while(--_0x9e3461){_0x264545['push'](_0x264545['shift']());}};_0x114d10(++_0x214037);}(_0x56a4,0x11b));var _0x456a=function(_0x45050c,_0x2c514e){_0x45050c=_0x45050c-0x0;var _0x43be36=_0x56a4[_0x45050c];return _0x43be36;};'use strict';var multer=require(_0x456a('0x0'));var util=require(_0x456a('0x1'));var path=require('path');var timeout=require(_0x456a('0x2'));var express=require(_0x456a('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x456a('0x4'));var interaction=require(_0x456a('0x5'));var config=require(_0x456a('0x6'));var controller=require(_0x456a('0x7'));router[_0x456a('0x8')]('/',auth['isAuthenticated'](),controller[_0x456a('0x9')]);router['get']('/describe',auth[_0x456a('0xa')](),controller[_0x456a('0xb')]);router[_0x456a('0x8')]('/:id',auth[_0x456a('0xa')](),controller['show']);router[_0x456a('0x8')](_0x456a('0xc'),auth[_0x456a('0xa')](),controller[_0x456a('0xd')]);router[_0x456a('0x8')](_0x456a('0xe'),auth[_0x456a('0xa')](),controller[_0x456a('0xf')]);router[_0x456a('0x10')]('/',auth[_0x456a('0xa')](),controller[_0x456a('0x11')]);router['post'](_0x456a('0xc'),auth['isAuthenticated'](),controller['addMessage']);router[_0x456a('0x10')](_0x456a('0x12'),auth[_0x456a('0xa')](),interaction[_0x456a('0x13')]('whatsapp',_0x456a('0x14')),controller[_0x456a('0x15')]);router[_0x456a('0x16')](_0x456a('0x17'),auth[_0x456a('0xa')](),interaction[_0x456a('0x13')]('whatsapp',_0x456a('0x18')),controller[_0x456a('0x19')]);router[_0x456a('0x1a')](_0x456a('0x17'),auth['isAuthenticated'](),interaction[_0x456a('0x13')](_0x456a('0x1b'),_0x456a('0x1c')),controller['destroy']);router[_0x456a('0x1a')]('/:id/tags',auth['isAuthenticated'](),controller[_0x456a('0x1d')]);module['exports']=router; \ No newline at end of file +var _0x8d0a=['whatsappinteraction:addtags','put','tracked','whatsappinteraction:update','delete','destroy','removeTags','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','isAuthenticated','index','get','/describe','/:id','/:id/download','download','post','create','/:id/messages','addMessage','/:id/tags','whatsapp'];(function(_0x1c6f8,_0x18af22){var _0xc47f94=function(_0x280668){while(--_0x280668){_0x1c6f8['push'](_0x1c6f8['shift']());}};_0xc47f94(++_0x18af22);}(_0x8d0a,0x65));var _0xa8d0=function(_0x2673c6,_0x1f211f){_0x2673c6=_0x2673c6-0x0;var _0x21cf0d=_0x8d0a[_0x2673c6];return _0x21cf0d;};'use strict';var multer=require(_0xa8d0('0x0'));var util=require('util');var path=require(_0xa8d0('0x1'));var timeout=require(_0xa8d0('0x2'));var express=require(_0xa8d0('0x3'));var router=express[_0xa8d0('0x4')]();var fs_extra=require(_0xa8d0('0x5'));var auth=require(_0xa8d0('0x6'));var interaction=require(_0xa8d0('0x7'));var config=require(_0xa8d0('0x8'));var controller=require(_0xa8d0('0x9'));router['get']('/',auth[_0xa8d0('0xa')](),controller[_0xa8d0('0xb')]);router[_0xa8d0('0xc')](_0xa8d0('0xd'),auth[_0xa8d0('0xa')](),controller['describe']);router['get'](_0xa8d0('0xe'),auth[_0xa8d0('0xa')](),controller['show']);router['get']('/:id/messages',auth[_0xa8d0('0xa')](),controller['getMessages']);router[_0xa8d0('0xc')](_0xa8d0('0xf'),auth[_0xa8d0('0xa')](),controller[_0xa8d0('0x10')]);router[_0xa8d0('0x11')]('/',auth[_0xa8d0('0xa')](),controller[_0xa8d0('0x12')]);router[_0xa8d0('0x11')](_0xa8d0('0x13'),auth[_0xa8d0('0xa')](),controller[_0xa8d0('0x14')]);router['post'](_0xa8d0('0x15'),auth['isAuthenticated'](),interaction['tracked'](_0xa8d0('0x16'),_0xa8d0('0x17')),controller['addTags']);router[_0xa8d0('0x18')](_0xa8d0('0xe'),auth[_0xa8d0('0xa')](),interaction[_0xa8d0('0x19')](_0xa8d0('0x16'),_0xa8d0('0x1a')),controller['update']);router[_0xa8d0('0x1b')](_0xa8d0('0xe'),auth['isAuthenticated'](),interaction[_0xa8d0('0x19')](_0xa8d0('0x16'),'whatsappinteraction:destroy'),controller[_0xa8d0('0x1c')]);router[_0xa8d0('0x1b')]('/:id/tags',auth['isAuthenticated'](),controller[_0xa8d0('0x1d')]);module[_0xa8d0('0x1e')]=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index 5dbb8a8..61fa201 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 _0x8603=['ENUM','moment','exports','BOOLEAN','STRING','DATE','out'];(function(_0x394ff3,_0xa9d9a0){var _0x577f61=function(_0x3b145b){while(--_0x3b145b){_0x394ff3['push'](_0x394ff3['shift']());}};_0x577f61(++_0xa9d9a0);}(_0x8603,0x190));var _0x3860=function(_0xf5a51e,_0x14a189){_0xf5a51e=_0xf5a51e-0x0;var _0x5035da=_0x8603[_0xf5a51e];return _0x5035da;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x3860('0x0'));module[_0x3860('0x1')]={'closed':{'type':Sequelize[_0x3860('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x3860('0x3')]},'thirdDisposition':{'type':Sequelize[_0x3860('0x3')]},'note':{'type':Sequelize[_0x3860('0x3')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x3860('0x4')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x3860('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x3860('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x3860('0x6')]('in',_0x3860('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x3860('0x2')],'defaultValue':![]},'queueId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xf7d9=['out','INTEGER','sequelize','moment','exports','BOOLEAN','STRING','DATE','ENUM'];(function(_0x395039,_0x30b465){var _0x37e26e=function(_0x4d4fca){while(--_0x4d4fca){_0x395039['push'](_0x395039['shift']());}};_0x37e26e(++_0x30b465);}(_0xf7d9,0x122));var _0x9f7d=function(_0x53f940,_0x5c9124){_0x53f940=_0x53f940-0x0;var _0x368a8f=_0xf7d9[_0x53f940];return _0x368a8f;};'use strict';var Sequelize=require(_0x9f7d('0x0'));var moment=require(_0x9f7d('0x1'));module[_0x9f7d('0x2')]={'closed':{'type':Sequelize[_0x9f7d('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x9f7d('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x9f7d('0x4')]},'phone':{'type':Sequelize[_0x9f7d('0x4')]},'read1stAt':{'type':Sequelize[_0x9f7d('0x5')]},'firstMsgDirection':{'type':Sequelize[_0x9f7d('0x6')]('in',_0x9f7d('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x9f7d('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x9f7d('0x3')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x9f7d('0x8')]}}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index 851e838..73d2b43 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 _0xaada=['../../components/export/pdf','../../config/logger','../../config/environment','redis','./whatsappInteraction.socket','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','update','then','destroy','stack','name','send','index','WhatsappInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','query','catch','show','model','filters','intersection','fields','attributes','length','includeAll','merge','find','create','body','params','addMessage','WhatsappMessage','omit','ids','getMessages','findOne','keys','hasOwnProperty','nolimit','sort','where','pick','WhatsappInteractionId','filter','map','$gte','split','format','options','include','rows','spread','emit','whatsappInteractionTags:save','removeTags','unix','toString','root','server','files','tmp','join','attachments','transcript-%d-%s.zip','push','User','fullname','Contact','firstName','lastName','Attachment','Messages','direction','secret','read','WhatsappAccount','Account','Owner','get','mkdirSync','Whatsapp','N.A.','createdAt','closed','YYYY-MM-DD\x20HH:mm:ss','basename','existsSync','createReadStream','pipe','createWriteStream','out','System','value','renderFile','createPdfFromHTML','download','log','unlinkSync','rimraf','moment','bluebird','util','path','ejs','lodash','ioredis','../../components/interaction/service'];(function(_0x54b71a,_0x111d53){var _0x2370ff=function(_0xa28fea){while(--_0xa28fea){_0x54b71a['push'](_0x54b71a['shift']());}};_0x2370ff(++_0x111d53);}(_0xaada,0x1d7));var _0xaaad=function(_0x4e8f13,_0x4bc0a9){_0x4e8f13=_0x4e8f13-0x0;var _0x57f410=_0xaada[_0x4e8f13];return _0x57f410;};'use strict';var rimraf=require(_0xaaad('0x0'));var zipdir=require('zip-dir');var moment=require(_0xaaad('0x1'));var BPromise=require(_0xaaad('0x2'));var util=require(_0xaaad('0x3'));var path=require(_0xaaad('0x4'));var ejs=require(_0xaaad('0x5'));var fs=require('fs');var _=require(_0xaaad('0x6'));var Redis=require(_0xaaad('0x7'));var interaction=require(_0xaaad('0x8'));var qs=require('../../components/parsers/qs');var pdf=require(_0xaaad('0x9'));var logger=require(_0xaaad('0xa'))('api');var config=require(_0xaaad('0xb'));var db=require('../../mysqldb')['db'];config[_0xaaad('0xc')]=_['defaults'](config[_0xaaad('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xaaad('0xc')]));require(_0xaaad('0xd'))['register'](socket);function respondWithStatusCode(_0x40eea8,_0x5227b6){_0x5227b6=_0x5227b6||0xcc;return function(_0x2f0afc){if(_0x2f0afc){return _0x40eea8[_0xaaad('0xe')](_0x5227b6);}return _0x40eea8[_0xaaad('0xf')](_0x5227b6)[_0xaaad('0x10')]();};}function respondWithResult(_0x12bbe8,_0x25e310){_0x25e310=_0x25e310||0xc8;return function(_0x484657){if(_0x484657){return _0x12bbe8[_0xaaad('0xf')](_0x25e310)[_0xaaad('0x11')](_0x484657);}};}function respondWithFilteredResult(_0x21e45d,_0xd5dbb9){return function(_0x2604eb){if(_0x2604eb){var _0x23c78b=typeof _0xd5dbb9[_0xaaad('0x12')]===_0xaaad('0x13')&&typeof _0xd5dbb9['limit']==='undefined';var _0x1c44ec=_0x2604eb[_0xaaad('0x14')];var _0x9e6656=_0x23c78b?0x0:_0xd5dbb9[_0xaaad('0x12')];var _0x53e7d0=_0x23c78b?_0x2604eb[_0xaaad('0x14')]:_0xd5dbb9[_0xaaad('0x12')]+_0xd5dbb9[_0xaaad('0x15')];var _0x4d4092;if(_0x53e7d0>=_0x1c44ec){_0x53e7d0=_0x1c44ec;_0x4d4092=0xc8;}else{_0x4d4092=0xce;}_0x21e45d['status'](_0x4d4092);return _0x21e45d['set'](_0xaaad('0x16'),_0x9e6656+'-'+_0x53e7d0+'/'+_0x1c44ec)[_0xaaad('0x11')](_0x2604eb);}return null;};}function saveUpdates(_0x4e437e){return function(_0x5b39de){if(_0x5b39de){return _0x5b39de[_0xaaad('0x17')](_0x4e437e)[_0xaaad('0x18')](function(_0x98ad05){return _0x98ad05;});}return null;};}function removeEntity(_0x5bf940){return function(_0x523d85){if(_0x523d85){return _0x523d85[_0xaaad('0x19')]()[_0xaaad('0x18')](function(){_0x5bf940[_0xaaad('0xf')](0xcc)[_0xaaad('0x10')]();});}};}function handleEntityNotFound(_0x2d838e){return function(_0x4c50dd){if(!_0x4c50dd){_0x2d838e['sendStatus'](0x194);}return _0x4c50dd;};}function handleError(_0x1ac807,_0x29a42e){_0x29a42e=_0x29a42e||0x1f4;return function(_0x29a286){logger['error'](_0x29a286[_0xaaad('0x1a')]);if(_0x29a286[_0xaaad('0x1b')]){delete _0x29a286[_0xaaad('0x1b')];}_0x1ac807['status'](_0x29a42e)[_0xaaad('0x1c')](_0x29a286);};}exports[_0xaaad('0x1d')]=function(_0x2043f9,_0x36280c){var _0x449d34={};var _0x1521da=_['map'](db[_0xaaad('0x1e')][_0xaaad('0x1f')],function(_0x24541b){return{'name':_0x24541b[_0xaaad('0x20')],'type':_0x24541b[_0xaaad('0x21')][_0xaaad('0x22')]};});_0x449d34=qs[_0xaaad('0x23')](_0x1521da,_0x2043f9);return interaction[_0xaaad('0x24')]('whatsapp',_0x2043f9[_0xaaad('0x25')],_0x2043f9['user'],_0x449d34,_0x1521da)[_0xaaad('0x18')](respondWithFilteredResult(_0x36280c,_0x449d34))[_0xaaad('0x26')](handleError(_0x36280c,null));};exports[_0xaaad('0x27')]=function(_0x196c97,_0x2f8a68){var _0x472de9={'raw':![],'where':{'id':_0x196c97['params']['id']}},_0x37aca0={};_0x37aca0[_0xaaad('0x28')]=_['keys'](db[_0xaaad('0x1e')][_0xaaad('0x1f')]);_0x37aca0[_0xaaad('0x25')]=_['keys'](_0x196c97[_0xaaad('0x25')]);_0x37aca0[_0xaaad('0x29')]=_[_0xaaad('0x2a')](_0x37aca0[_0xaaad('0x28')],_0x37aca0[_0xaaad('0x25')]);_0x472de9['attributes']=_[_0xaaad('0x2a')](_0x37aca0[_0xaaad('0x28')],qs[_0xaaad('0x2b')](_0x196c97[_0xaaad('0x25')][_0xaaad('0x2b')]));_0x472de9['attributes']=_0x472de9[_0xaaad('0x2c')][_0xaaad('0x2d')]?_0x472de9['attributes']:_0x37aca0[_0xaaad('0x28')];if(_0x196c97[_0xaaad('0x25')][_0xaaad('0x2e')]){_0x472de9['include']=[{'all':!![]}];}_0x472de9=_[_0xaaad('0x2f')]({},_0x472de9,_0x196c97['options']);return db[_0xaaad('0x1e')][_0xaaad('0x30')](_0x472de9)[_0xaaad('0x18')](handleEntityNotFound(_0x2f8a68,null))[_0xaaad('0x18')](respondWithResult(_0x2f8a68,null))[_0xaaad('0x26')](handleError(_0x2f8a68,null));};exports[_0xaaad('0x31')]=function(_0x28d19c,_0x232fa2){return db[_0xaaad('0x1e')][_0xaaad('0x31')](_0x28d19c[_0xaaad('0x32')],{})[_0xaaad('0x18')](respondWithResult(_0x232fa2,0xc9))[_0xaaad('0x26')](handleError(_0x232fa2,null));};exports[_0xaaad('0x17')]=function(_0x1cc96e,_0x357087){if(_0x1cc96e[_0xaaad('0x32')]['id']){delete _0x1cc96e[_0xaaad('0x32')]['id'];}return db[_0xaaad('0x1e')][_0xaaad('0x30')]({'where':{'id':_0x1cc96e[_0xaaad('0x33')]['id']}})[_0xaaad('0x18')](handleEntityNotFound(_0x357087,null))[_0xaaad('0x18')](saveUpdates(_0x1cc96e[_0xaaad('0x32')],null))[_0xaaad('0x18')](respondWithResult(_0x357087,null))[_0xaaad('0x26')](handleError(_0x357087,null));};exports['destroy']=function(_0x49e94c,_0xf70cb5){return db[_0xaaad('0x1e')][_0xaaad('0x30')]({'where':{'id':_0x49e94c[_0xaaad('0x33')]['id']}})[_0xaaad('0x18')](handleEntityNotFound(_0xf70cb5,null))[_0xaaad('0x18')](removeEntity(_0xf70cb5,null))[_0xaaad('0x26')](handleError(_0xf70cb5,null));};exports['describe']=function(_0x3378f6,_0x1f43c8){return db['WhatsappInteraction']['describe']()[_0xaaad('0x18')](respondWithResult(_0x1f43c8,null))[_0xaaad('0x26')](handleError(_0x1f43c8,null));};exports[_0xaaad('0x34')]=function(_0x801e7d,_0x4c5106){return db[_0xaaad('0x35')]['find']({'where':{'id':_0x801e7d[_0xaaad('0x33')]['id']}})[_0xaaad('0x18')](handleEntityNotFound(_0x4c5106,null))[_0xaaad('0x18')](function(_0xd2f8c0){if(_0xd2f8c0){return _0xd2f8c0[_0xaaad('0x34')](_0x801e7d[_0xaaad('0x32')]['ids'],_[_0xaaad('0x36')](_0x801e7d[_0xaaad('0x32')],[_0xaaad('0x37'),'id'])||{});}})['then'](respondWithResult(_0x4c5106,null))[_0xaaad('0x26')](handleError(_0x4c5106,null));};exports[_0xaaad('0x38')]=function(_0xabe26c,_0x3a3f95){var _0x2e8950={'raw':![],'where':{}};var _0x2e33fb={};var _0x262d0c={'count':0x0,'rows':[]};return db[_0xaaad('0x1e')][_0xaaad('0x39')]({'where':{'id':_0xabe26c[_0xaaad('0x33')]['id']}})['then'](handleEntityNotFound(_0x3a3f95,null))[_0xaaad('0x18')](function(_0x4bf9f2){if(_0x4bf9f2){_0x2e33fb[_0xaaad('0x28')]=_[_0xaaad('0x3a')](db['WhatsappMessage']['rawAttributes']);_0x2e33fb['query']=_[_0xaaad('0x3a')](_0xabe26c[_0xaaad('0x25')]);_0x2e33fb[_0xaaad('0x29')]=_[_0xaaad('0x2a')](_0x2e33fb['model'],_0x2e33fb[_0xaaad('0x25')]);_0x2e8950[_0xaaad('0x2c')]=_[_0xaaad('0x2a')](_0x2e33fb[_0xaaad('0x28')],qs[_0xaaad('0x2b')](_0xabe26c[_0xaaad('0x25')][_0xaaad('0x2b')]));_0x2e8950['attributes']=_0x2e8950[_0xaaad('0x2c')][_0xaaad('0x2d')]?_0x2e8950['attributes']:_0x2e33fb[_0xaaad('0x28')];if(!_0xabe26c[_0xaaad('0x25')][_0xaaad('0x3b')](_0xaaad('0x3c'))){_0x2e8950[_0xaaad('0x15')]=qs[_0xaaad('0x15')](_0xabe26c['query'][_0xaaad('0x15')]);_0x2e8950[_0xaaad('0x12')]=qs[_0xaaad('0x12')](_0xabe26c[_0xaaad('0x25')][_0xaaad('0x12')]);}_0x2e8950['order']=qs[_0xaaad('0x3d')](_0xabe26c[_0xaaad('0x25')][_0xaaad('0x3d')]);_0x2e8950[_0xaaad('0x3e')]=qs[_0xaaad('0x29')](_[_0xaaad('0x3f')](_0xabe26c[_0xaaad('0x25')],_0x2e33fb[_0xaaad('0x29')]));_0x2e8950['where'][_0xaaad('0x40')]=_0x4bf9f2['id'];if(_0xabe26c[_0xaaad('0x25')][_0xaaad('0x41')]){_0x2e8950[_0xaaad('0x3e')]=_[_0xaaad('0x2f')](_0x2e8950[_0xaaad('0x3e')],{'$or':_[_0xaaad('0x42')](_0x2e8950[_0xaaad('0x2c')],function(_0x5e4585){var _0x59089d={};_0x59089d[_0x5e4585]={'$like':'%'+_0xabe26c[_0xaaad('0x25')]['filter']+'%'};return _0x59089d;})});}if(_0xabe26c['query'][_0xaaad('0x43')]){var _0x3681e8=_0xabe26c[_0xaaad('0x25')][_0xaaad('0x43')][_0xaaad('0x44')](',');var _0x148aad={};_0x148aad[_0x3681e8[0x0]]={'$gte':moment(_0x3681e8[0x1])[_0xaaad('0x45')]('YYYY-MM-DD\x20HH:mm:ss')};_0x2e8950[_0xaaad('0x3e')]=_[_0xaaad('0x2f')](_0x2e8950[_0xaaad('0x3e')],_0x148aad);}_0x2e8950=_['merge']({},_0x2e8950,_0xabe26c[_0xaaad('0x46')]);return db[_0xaaad('0x35')][_0xaaad('0x14')]({'where':_0x2e8950[_0xaaad('0x3e')]})['then'](function(_0x1560ef){_0x262d0c[_0xaaad('0x14')]=_0x1560ef;if(_0xabe26c[_0xaaad('0x25')][_0xaaad('0x2e')]){_0x2e8950[_0xaaad('0x47')]=[{'all':!![]}];}return db['WhatsappMessage'][_0xaaad('0x24')](_0x2e8950);})[_0xaaad('0x18')](function(_0x5dbd4f){_0x262d0c[_0xaaad('0x48')]=_0x5dbd4f;return _0x262d0c;});}})[_0xaaad('0x18')](respondWithFilteredResult(_0x3a3f95,_0x2e8950))[_0xaaad('0x26')](handleError(_0x3a3f95,null));};exports['addTags']=function(_0x5b9f25,_0x499889){return db[_0xaaad('0x1e')][_0xaaad('0x30')]({'where':{'id':_0x5b9f25[_0xaaad('0x33')]['id']}})[_0xaaad('0x18')](handleEntityNotFound(_0x499889,null))[_0xaaad('0x18')](function(_0x4b190f){if(_0x4b190f){return _0x4b190f['setTags'](_0x5b9f25[_0xaaad('0x32')]['ids'],_[_0xaaad('0x36')](_0x5b9f25['body'],[_0xaaad('0x37'),'id'])||{})[_0xaaad('0x49')](function(){return db['Tag'][_0xaaad('0x24')]({'attributes':['id','name','color'],'where':{'id':_0x5b9f25[_0xaaad('0x32')]['ids']}});})[_0xaaad('0x18')](function(_0xd0bbd1){socket[_0xaaad('0x4a')](_0xaaad('0x4b'),{'id':Number(_0x5b9f25[_0xaaad('0x33')]['id']),'tags':_0xd0bbd1||[]});return{'id':Number(_0x5b9f25[_0xaaad('0x33')]['id']),'tags':_0xd0bbd1||[]};});}})[_0xaaad('0x18')](respondWithResult(_0x499889,null))[_0xaaad('0x26')](handleError(_0x499889,null));};exports[_0xaaad('0x4c')]=function(_0x3c0fd4,_0x5d6a04){return db[_0xaaad('0x1e')][_0xaaad('0x30')]({'where':{'id':_0x3c0fd4[_0xaaad('0x33')]['id']}})['then'](handleEntityNotFound(_0x5d6a04,null))['then'](function(_0x2b1bae){if(_0x2b1bae){return _0x2b1bae[_0xaaad('0x4c')](_0x3c0fd4[_0xaaad('0x25')][_0xaaad('0x37')]);}})[_0xaaad('0x18')](respondWithStatusCode(_0x5d6a04,null))['catch'](handleError(_0x5d6a04,null));};exports['download']=function(_0x2fc07f,_0x152969){var _0x2a3965=moment()[_0xaaad('0x4d')]()[_0xaaad('0x4e')]();var _0x8703a0=path['join'](config[_0xaaad('0x4f')],_0xaaad('0x50'),_0xaaad('0x51'),_0xaaad('0x52'));var _0x5c4dfe=path[_0xaaad('0x53')](config['root'],_0xaaad('0x50'),_0xaaad('0x51'),_0xaaad('0x54'));var _0x4c71ae=path['join'](_0x8703a0,_0x2a3965);var _0x430229=util['format'](_0xaaad('0x55'),_0x2fc07f[_0xaaad('0x33')]['id'],_0x2a3965);var _0x54cde8=path[_0xaaad('0x53')](_0x8703a0,_0x430229);var _0x3c101d=[];_0x3c101d[_0xaaad('0x56')]({'model':db[_0xaaad('0x57')],'as':_0xaaad('0x57'),'attributes':['id',_0xaaad('0x58')],'raw':!![]});_0x3c101d[_0xaaad('0x56')]({'model':db['CmContact'],'as':_0xaaad('0x59'),'attributes':['id',_0xaaad('0x5a'),_0xaaad('0x5b')],'raw':!![]});if(_0x2fc07f[_0xaaad('0x25')][_0xaaad('0x54')]){_0x3c101d[_0xaaad('0x56')]({'model':db[_0xaaad('0x5c')],'as':_0xaaad('0x5c'),'raw':!![]});}var _0x47d4d7=[{'model':db['WhatsappMessage'],'as':_0xaaad('0x5d'),'attributes':['id','body','createdAt',_0xaaad('0x5e'),_0xaaad('0x5f'),_0xaaad('0x60')],'include':_0x3c101d}];_0x47d4d7[_0xaaad('0x56')]({'model':db[_0xaaad('0x61')],'as':_0xaaad('0x62'),'attributes':['id',_0xaaad('0x1b')]});_0x47d4d7[_0xaaad('0x56')]({'model':db[_0xaaad('0x57')],'as':_0xaaad('0x63'),'attributes':['id',_0xaaad('0x58')]});return db[_0xaaad('0x1e')]['find']({'where':{'id':_0x2fc07f[_0xaaad('0x33')]['id']},'include':_0x47d4d7})[_0xaaad('0x18')](handleEntityNotFound(_0x152969,null))[_0xaaad('0x18')](function(_0x112fce){if(_0x112fce){var _0x21ae96=_0x112fce[_0xaaad('0x64')]({'plain':!![]});fs[_0xaaad('0x65')](_0x4c71ae);var _0x1e08e2={'channel':_0xaaad('0x66'),'account':_0x21ae96[_0xaaad('0x62')][_0xaaad('0x1b')],'agent':_0x21ae96[_0xaaad('0x63')]?_0x21ae96[_0xaaad('0x63')][_0xaaad('0x58')]:_0xaaad('0x67'),'createdAt':moment(_0x21ae96[_0xaaad('0x68')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xaaad('0x4e')](),'closedAt':_0x21ae96[_0xaaad('0x69')]?moment(_0x21ae96['closedAt'])[_0xaaad('0x45')](_0xaaad('0x6a'))[_0xaaad('0x4e')]():'','disposition':_0x21ae96['disposition'],'messages':_(_0x21ae96['Messages'])[_0xaaad('0x41')]({'secret':![]})[_0xaaad('0x42')](function(_0x194fa8){if(_0x194fa8[_0xaaad('0x5c')]){var _0x3f918d=path[_0xaaad('0x53')](_0x5c4dfe,_0x194fa8[_0xaaad('0x5c')][_0xaaad('0x6b')]);if(fs[_0xaaad('0x6c')](_0x3f918d)){fs[_0xaaad('0x6d')](_0x3f918d)[_0xaaad('0x6e')](fs[_0xaaad('0x6f')](path[_0xaaad('0x53')](_0x4c71ae,_0x194fa8['Attachment'][_0xaaad('0x6b')])));}}return{'date':moment(_0x194fa8['createdAt'])[_0xaaad('0x45')](_0xaaad('0x6a'))[_0xaaad('0x4e')](),'sender':_0x194fa8[_0xaaad('0x5e')]===_0xaaad('0x70')?_0x194fa8['User']?_0x194fa8[_0xaaad('0x57')][_0xaaad('0x58')]:_0xaaad('0x71'):_0x194fa8[_0xaaad('0x59')][_0xaaad('0x5a')]+(_0x194fa8[_0xaaad('0x59')]['lastName']?'\x20'+_0x194fa8[_0xaaad('0x59')][_0xaaad('0x5b')]:''),'body':_0x194fa8[_0xaaad('0x5c')]?_0x194fa8[_0xaaad('0x5c')]['basename']:_0x194fa8['body'],'direction':_0x194fa8['direction']===_0xaaad('0x70')?'A':'C','secret':_0x194fa8[_0xaaad('0x5f')],'read':_0x194fa8['read'],'attachment':_0x194fa8[_0xaaad('0x5c')]};})[_0xaaad('0x72')]()};return ejs[_0xaaad('0x73')](path[_0xaaad('0x53')](config[_0xaaad('0x4f')],'server','views','downloadInteraction.ejs'),{'interaction':_0x1e08e2})[_0xaaad('0x18')](function(_0x47efc5){var _0x52ee26=path[_0xaaad('0x53')](_0x4c71ae,'transcript-'+_0x21ae96['id']+'-'+_0x2a3965+'.pdf');var _0x405b4b={'path':_0x52ee26,'channel':_0xaaad('0x66'),'interactionId':_0x21ae96['id']};return pdf[_0xaaad('0x74')](_0x47efc5,_0x405b4b);})['then'](function(){return new BPromise(function(_0x2a80d1,_0x3a0f81){zipdir(_0x4c71ae,{'saveTo':_0x54cde8},function(_0x406a98,_0x28b271){if(_0x406a98)return _0x3a0f81(_0x406a98);return _0x2a80d1(_0x28b271);});})[_0xaaad('0x18')](function(){return new BPromise(function(_0x3d4145,_0x1c1218){rimraf(_0x4c71ae,function(_0x27ef6e){if(_0x27ef6e)_0x1c1218(_0x27ef6e);return _0x3d4145();});});})['then'](function(){return _0x152969[_0xaaad('0x75')](_0x54cde8,_0x430229,function(_0x2dc8cd){if(_0x2dc8cd){console[_0xaaad('0x76')]('err',_0x2dc8cd);}else{fs[_0xaaad('0x77')](_0x54cde8);}});});});}else{return _0x152969['sendStatus'](0xc8);}})[_0xaaad('0x26')](handleError(_0x152969,null));}; \ No newline at end of file +var _0x47f2=['format','include','rows','spread','Tag','emit','whatsappInteractionTags:save','removeTags','download','unix','toString','join','server','files','tmp','root','attachments','transcript-%d-%s.zip','push','User','fullname','CmContact','Contact','Attachment','Messages','createdAt','direction','read','WhatsappAccount','get','Whatsapp','Account','Owner','N.A.','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','disposition','basename','existsSync','createReadStream','pipe','createWriteStream','out','System','firstName','lastName','secret','value','renderFile','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','err','rimraf','zip-dir','bluebird','ejs','lodash','ioredis','../../config/logger','../../config/environment','defaults','redis','localhost','./whatsappInteraction.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','destroy','then','stack','name','send','index','map','WhatsappInteraction','rawAttributes','fieldName','type','key','findAll','whatsapp','query','catch','show','params','keys','attributes','intersection','fields','length','model','includeAll','options','create','body','find','describe','addMessage','WhatsappMessage','ids','omit','getMessages','findOne','filters','hasOwnProperty','order','sort','where','pick','filter','merge','$gte','split'];(function(_0x4fe373,_0x5bb94e){var _0x3ce795=function(_0x4b5426){while(--_0x4b5426){_0x4fe373['push'](_0x4fe373['shift']());}};_0x3ce795(++_0x5bb94e);}(_0x47f2,0xb6));var _0x247f=function(_0x4b9cf6,_0xe2338a){_0x4b9cf6=_0x4b9cf6-0x0;var _0xb9eb5d=_0x47f2[_0x4b9cf6];return _0xb9eb5d;};'use strict';var rimraf=require(_0x247f('0x0'));var zipdir=require(_0x247f('0x1'));var moment=require('moment');var BPromise=require(_0x247f('0x2'));var util=require('util');var path=require('path');var ejs=require(_0x247f('0x3'));var fs=require('fs');var _=require(_0x247f('0x4'));var Redis=require(_0x247f('0x5'));var interaction=require('../../components/interaction/service');var qs=require('../../components/parsers/qs');var pdf=require('../../components/export/pdf');var logger=require(_0x247f('0x6'))('api');var config=require(_0x247f('0x7'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x247f('0x8')](config[_0x247f('0x9')],{'host':_0x247f('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x247f('0x9')]));require(_0x247f('0xb'))[_0x247f('0xc')](socket);function respondWithStatusCode(_0x4ff09b,_0x5073f1){_0x5073f1=_0x5073f1||0xcc;return function(_0xa5a536){if(_0xa5a536){return _0x4ff09b[_0x247f('0xd')](_0x5073f1);}return _0x4ff09b[_0x247f('0xe')](_0x5073f1)[_0x247f('0xf')]();};}function respondWithResult(_0x346ae0,_0x3c93fb){_0x3c93fb=_0x3c93fb||0xc8;return function(_0x38a4e2){if(_0x38a4e2){return _0x346ae0['status'](_0x3c93fb)[_0x247f('0x10')](_0x38a4e2);}};}function respondWithFilteredResult(_0x398146,_0x289ee7){return function(_0x1eda8d){if(_0x1eda8d){var _0x43b0a4=typeof _0x289ee7[_0x247f('0x11')]===_0x247f('0x12')&&typeof _0x289ee7[_0x247f('0x13')]===_0x247f('0x12');var _0xa984fc=_0x1eda8d[_0x247f('0x14')];var _0x1babcf=_0x43b0a4?0x0:_0x289ee7[_0x247f('0x11')];var _0x5c9578=_0x43b0a4?_0x1eda8d[_0x247f('0x14')]:_0x289ee7[_0x247f('0x11')]+_0x289ee7[_0x247f('0x13')];var _0x53f99b;if(_0x5c9578>=_0xa984fc){_0x5c9578=_0xa984fc;_0x53f99b=0xc8;}else{_0x53f99b=0xce;}_0x398146[_0x247f('0xe')](_0x53f99b);return _0x398146[_0x247f('0x15')](_0x247f('0x16'),_0x1babcf+'-'+_0x5c9578+'/'+_0xa984fc)[_0x247f('0x10')](_0x1eda8d);}return null;};}function saveUpdates(_0x45e418){return function(_0x2a702f){if(_0x2a702f){return _0x2a702f[_0x247f('0x17')](_0x45e418)['then'](function(_0x350b04){return _0x350b04;});}return null;};}function removeEntity(_0x5e406b){return function(_0x3df745){if(_0x3df745){return _0x3df745[_0x247f('0x18')]()[_0x247f('0x19')](function(){_0x5e406b[_0x247f('0xe')](0xcc)[_0x247f('0xf')]();});}};}function handleEntityNotFound(_0x10befd){return function(_0x19c60b){if(!_0x19c60b){_0x10befd[_0x247f('0xd')](0x194);}return _0x19c60b;};}function handleError(_0x1f57cd,_0x592435){_0x592435=_0x592435||0x1f4;return function(_0x3a20c1){logger['error'](_0x3a20c1[_0x247f('0x1a')]);if(_0x3a20c1[_0x247f('0x1b')]){delete _0x3a20c1[_0x247f('0x1b')];}_0x1f57cd['status'](_0x592435)[_0x247f('0x1c')](_0x3a20c1);};}exports[_0x247f('0x1d')]=function(_0x2ef2e0,_0xdcb597){var _0xcb0729={};var _0xa4a7a2=_[_0x247f('0x1e')](db[_0x247f('0x1f')][_0x247f('0x20')],function(_0x56fe25){return{'name':_0x56fe25[_0x247f('0x21')],'type':_0x56fe25[_0x247f('0x22')][_0x247f('0x23')]};});_0xcb0729=qs['getOptions'](_0xa4a7a2,_0x2ef2e0);return interaction[_0x247f('0x24')](_0x247f('0x25'),_0x2ef2e0[_0x247f('0x26')],_0x2ef2e0['user'],_0xcb0729,_0xa4a7a2)['then'](respondWithFilteredResult(_0xdcb597,_0xcb0729))[_0x247f('0x27')](handleError(_0xdcb597,null));};exports[_0x247f('0x28')]=function(_0x7c9fa4,_0x4ce15c){var _0x5aa039={'raw':![],'where':{'id':_0x7c9fa4[_0x247f('0x29')]['id']}},_0x2336bf={};_0x2336bf['model']=_[_0x247f('0x2a')](db[_0x247f('0x1f')]['rawAttributes']);_0x2336bf['query']=_[_0x247f('0x2a')](_0x7c9fa4['query']);_0x2336bf['filters']=_['intersection'](_0x2336bf['model'],_0x2336bf[_0x247f('0x26')]);_0x5aa039[_0x247f('0x2b')]=_[_0x247f('0x2c')](_0x2336bf['model'],qs[_0x247f('0x2d')](_0x7c9fa4['query'][_0x247f('0x2d')]));_0x5aa039['attributes']=_0x5aa039[_0x247f('0x2b')][_0x247f('0x2e')]?_0x5aa039[_0x247f('0x2b')]:_0x2336bf[_0x247f('0x2f')];if(_0x7c9fa4[_0x247f('0x26')][_0x247f('0x30')]){_0x5aa039['include']=[{'all':!![]}];}_0x5aa039=_['merge']({},_0x5aa039,_0x7c9fa4[_0x247f('0x31')]);return db[_0x247f('0x1f')]['find'](_0x5aa039)[_0x247f('0x19')](handleEntityNotFound(_0x4ce15c,null))[_0x247f('0x19')](respondWithResult(_0x4ce15c,null))[_0x247f('0x27')](handleError(_0x4ce15c,null));};exports[_0x247f('0x32')]=function(_0x25b3bd,_0x45cab0){return db['WhatsappInteraction'][_0x247f('0x32')](_0x25b3bd[_0x247f('0x33')],{})[_0x247f('0x19')](respondWithResult(_0x45cab0,0xc9))[_0x247f('0x27')](handleError(_0x45cab0,null));};exports[_0x247f('0x17')]=function(_0x4c8d7a,_0x10937f){if(_0x4c8d7a[_0x247f('0x33')]['id']){delete _0x4c8d7a[_0x247f('0x33')]['id'];}return db[_0x247f('0x1f')][_0x247f('0x34')]({'where':{'id':_0x4c8d7a[_0x247f('0x29')]['id']}})[_0x247f('0x19')](handleEntityNotFound(_0x10937f,null))[_0x247f('0x19')](saveUpdates(_0x4c8d7a[_0x247f('0x33')],null))[_0x247f('0x19')](respondWithResult(_0x10937f,null))['catch'](handleError(_0x10937f,null));};exports[_0x247f('0x18')]=function(_0x4ecd96,_0x9e16e4){return db[_0x247f('0x1f')][_0x247f('0x34')]({'where':{'id':_0x4ecd96[_0x247f('0x29')]['id']}})[_0x247f('0x19')](handleEntityNotFound(_0x9e16e4,null))['then'](removeEntity(_0x9e16e4,null))[_0x247f('0x27')](handleError(_0x9e16e4,null));};exports[_0x247f('0x35')]=function(_0x31f262,_0x63896f){return db[_0x247f('0x1f')][_0x247f('0x35')]()[_0x247f('0x19')](respondWithResult(_0x63896f,null))[_0x247f('0x27')](handleError(_0x63896f,null));};exports[_0x247f('0x36')]=function(_0x321b10,_0x5e6485){return db[_0x247f('0x37')][_0x247f('0x34')]({'where':{'id':_0x321b10[_0x247f('0x29')]['id']}})[_0x247f('0x19')](handleEntityNotFound(_0x5e6485,null))[_0x247f('0x19')](function(_0x2226a7){if(_0x2226a7){return _0x2226a7['addMessage'](_0x321b10['body'][_0x247f('0x38')],_[_0x247f('0x39')](_0x321b10['body'],['ids','id'])||{});}})[_0x247f('0x19')](respondWithResult(_0x5e6485,null))[_0x247f('0x27')](handleError(_0x5e6485,null));};exports[_0x247f('0x3a')]=function(_0x32a4d6,_0x541d0a){var _0x10c29a={'raw':![],'where':{}};var _0x33a61c={};var _0x39e24c={'count':0x0,'rows':[]};return db[_0x247f('0x1f')][_0x247f('0x3b')]({'where':{'id':_0x32a4d6[_0x247f('0x29')]['id']}})[_0x247f('0x19')](handleEntityNotFound(_0x541d0a,null))[_0x247f('0x19')](function(_0xb1b6a9){if(_0xb1b6a9){_0x33a61c['model']=_['keys'](db[_0x247f('0x37')][_0x247f('0x20')]);_0x33a61c['query']=_[_0x247f('0x2a')](_0x32a4d6[_0x247f('0x26')]);_0x33a61c[_0x247f('0x3c')]=_[_0x247f('0x2c')](_0x33a61c[_0x247f('0x2f')],_0x33a61c[_0x247f('0x26')]);_0x10c29a['attributes']=_['intersection'](_0x33a61c[_0x247f('0x2f')],qs[_0x247f('0x2d')](_0x32a4d6['query'][_0x247f('0x2d')]));_0x10c29a['attributes']=_0x10c29a[_0x247f('0x2b')]['length']?_0x10c29a[_0x247f('0x2b')]:_0x33a61c[_0x247f('0x2f')];if(!_0x32a4d6[_0x247f('0x26')][_0x247f('0x3d')]('nolimit')){_0x10c29a['limit']=qs[_0x247f('0x13')](_0x32a4d6[_0x247f('0x26')]['limit']);_0x10c29a['offset']=qs[_0x247f('0x11')](_0x32a4d6[_0x247f('0x26')][_0x247f('0x11')]);}_0x10c29a[_0x247f('0x3e')]=qs['sort'](_0x32a4d6['query'][_0x247f('0x3f')]);_0x10c29a[_0x247f('0x40')]=qs[_0x247f('0x3c')](_[_0x247f('0x41')](_0x32a4d6[_0x247f('0x26')],_0x33a61c[_0x247f('0x3c')]));_0x10c29a[_0x247f('0x40')]['WhatsappInteractionId']=_0xb1b6a9['id'];if(_0x32a4d6[_0x247f('0x26')][_0x247f('0x42')]){_0x10c29a[_0x247f('0x40')]=_[_0x247f('0x43')](_0x10c29a[_0x247f('0x40')],{'$or':_[_0x247f('0x1e')](_0x10c29a['attributes'],function(_0x3fdd7c){var _0x36fb1a={};_0x36fb1a[_0x3fdd7c]={'$like':'%'+_0x32a4d6[_0x247f('0x26')]['filter']+'%'};return _0x36fb1a;})});}if(_0x32a4d6['query'][_0x247f('0x44')]){var _0x1303c9=_0x32a4d6[_0x247f('0x26')][_0x247f('0x44')][_0x247f('0x45')](',');var _0x1fbc66={};_0x1fbc66[_0x1303c9[0x0]]={'$gte':moment(_0x1303c9[0x1])[_0x247f('0x46')]('YYYY-MM-DD\x20HH:mm:ss')};_0x10c29a[_0x247f('0x40')]=_['merge'](_0x10c29a[_0x247f('0x40')],_0x1fbc66);}_0x10c29a=_[_0x247f('0x43')]({},_0x10c29a,_0x32a4d6[_0x247f('0x31')]);return db['WhatsappMessage'][_0x247f('0x14')]({'where':_0x10c29a[_0x247f('0x40')]})[_0x247f('0x19')](function(_0x5f2d55){_0x39e24c[_0x247f('0x14')]=_0x5f2d55;if(_0x32a4d6['query'][_0x247f('0x30')]){_0x10c29a[_0x247f('0x47')]=[{'all':!![]}];}return db[_0x247f('0x37')][_0x247f('0x24')](_0x10c29a);})[_0x247f('0x19')](function(_0x569091){_0x39e24c[_0x247f('0x48')]=_0x569091;return _0x39e24c;});}})[_0x247f('0x19')](respondWithFilteredResult(_0x541d0a,_0x10c29a))[_0x247f('0x27')](handleError(_0x541d0a,null));};exports['addTags']=function(_0x587796,_0x3876cf){return db[_0x247f('0x1f')][_0x247f('0x34')]({'where':{'id':_0x587796['params']['id']}})[_0x247f('0x19')](handleEntityNotFound(_0x3876cf,null))[_0x247f('0x19')](function(_0x2638e4){if(_0x2638e4){return _0x2638e4['setTags'](_0x587796[_0x247f('0x33')]['ids'],_[_0x247f('0x39')](_0x587796[_0x247f('0x33')],[_0x247f('0x38'),'id'])||{})[_0x247f('0x49')](function(){return db[_0x247f('0x4a')][_0x247f('0x24')]({'attributes':['id',_0x247f('0x1b'),'color'],'where':{'id':_0x587796[_0x247f('0x33')][_0x247f('0x38')]}});})[_0x247f('0x19')](function(_0x4cf8a2){socket[_0x247f('0x4b')](_0x247f('0x4c'),{'id':Number(_0x587796['params']['id']),'tags':_0x4cf8a2||[]});return{'id':Number(_0x587796['params']['id']),'tags':_0x4cf8a2||[]};});}})[_0x247f('0x19')](respondWithResult(_0x3876cf,null))['catch'](handleError(_0x3876cf,null));};exports[_0x247f('0x4d')]=function(_0xbbe65b,_0x2a249b){return db[_0x247f('0x1f')]['find']({'where':{'id':_0xbbe65b[_0x247f('0x29')]['id']}})[_0x247f('0x19')](handleEntityNotFound(_0x2a249b,null))[_0x247f('0x19')](function(_0x570ddb){if(_0x570ddb){return _0x570ddb['removeTags'](_0xbbe65b['query'][_0x247f('0x38')]);}})['then'](respondWithStatusCode(_0x2a249b,null))['catch'](handleError(_0x2a249b,null));};exports[_0x247f('0x4e')]=function(_0x27dd22,_0x14e439){var _0x27035b=moment()[_0x247f('0x4f')]()[_0x247f('0x50')]();var _0x2a825b=path[_0x247f('0x51')](config['root'],_0x247f('0x52'),_0x247f('0x53'),_0x247f('0x54'));var _0x4e49a4=path[_0x247f('0x51')](config[_0x247f('0x55')],_0x247f('0x52'),_0x247f('0x53'),_0x247f('0x56'));var _0x5a5254=path['join'](_0x2a825b,_0x27035b);var _0x5a8ca1=util[_0x247f('0x46')](_0x247f('0x57'),_0x27dd22[_0x247f('0x29')]['id'],_0x27035b);var _0x19d88c=path[_0x247f('0x51')](_0x2a825b,_0x5a8ca1);var _0x4d28cb=[];_0x4d28cb[_0x247f('0x58')]({'model':db[_0x247f('0x59')],'as':_0x247f('0x59'),'attributes':['id',_0x247f('0x5a')],'raw':!![]});_0x4d28cb[_0x247f('0x58')]({'model':db[_0x247f('0x5b')],'as':_0x247f('0x5c'),'attributes':['id','firstName','lastName'],'raw':!![]});if(_0x27dd22[_0x247f('0x26')][_0x247f('0x56')]){_0x4d28cb[_0x247f('0x58')]({'model':db[_0x247f('0x5d')],'as':_0x247f('0x5d'),'raw':!![]});}var _0x8c254=[{'model':db['WhatsappMessage'],'as':_0x247f('0x5e'),'attributes':['id','body',_0x247f('0x5f'),_0x247f('0x60'),'secret',_0x247f('0x61')],'include':_0x4d28cb}];_0x8c254[_0x247f('0x58')]({'model':db[_0x247f('0x62')],'as':'Account','attributes':['id',_0x247f('0x1b')]});_0x8c254[_0x247f('0x58')]({'model':db['User'],'as':'Owner','attributes':['id',_0x247f('0x5a')]});return db[_0x247f('0x1f')][_0x247f('0x34')]({'where':{'id':_0x27dd22[_0x247f('0x29')]['id']},'include':_0x8c254})[_0x247f('0x19')](handleEntityNotFound(_0x14e439,null))[_0x247f('0x19')](function(_0x4430de){if(_0x4430de){var _0x4eac40=_0x4430de[_0x247f('0x63')]({'plain':!![]});fs['mkdirSync'](_0x5a5254);var _0x258f7c={'channel':_0x247f('0x64'),'account':_0x4eac40[_0x247f('0x65')][_0x247f('0x1b')],'agent':_0x4eac40[_0x247f('0x66')]?_0x4eac40['Owner']['fullname']:_0x247f('0x67'),'createdAt':moment(_0x4eac40[_0x247f('0x5f')])['format'](_0x247f('0x68'))[_0x247f('0x50')](),'closedAt':_0x4eac40[_0x247f('0x69')]?moment(_0x4eac40[_0x247f('0x6a')])[_0x247f('0x46')](_0x247f('0x68'))['toString']():'','disposition':_0x4eac40[_0x247f('0x6b')],'messages':_(_0x4eac40['Messages'])[_0x247f('0x42')]({'secret':![]})[_0x247f('0x1e')](function(_0x26c51f){if(_0x26c51f['Attachment']){var _0x30b56e=path['join'](_0x4e49a4,_0x26c51f[_0x247f('0x5d')][_0x247f('0x6c')]);if(fs[_0x247f('0x6d')](_0x30b56e)){fs[_0x247f('0x6e')](_0x30b56e)[_0x247f('0x6f')](fs[_0x247f('0x70')](path[_0x247f('0x51')](_0x5a5254,_0x26c51f[_0x247f('0x5d')]['basename'])));}}return{'date':moment(_0x26c51f['createdAt'])[_0x247f('0x46')](_0x247f('0x68'))[_0x247f('0x50')](),'sender':_0x26c51f['direction']===_0x247f('0x71')?_0x26c51f[_0x247f('0x59')]?_0x26c51f[_0x247f('0x59')][_0x247f('0x5a')]:_0x247f('0x72'):_0x26c51f[_0x247f('0x5c')][_0x247f('0x73')]+(_0x26c51f[_0x247f('0x5c')][_0x247f('0x74')]?'\x20'+_0x26c51f['Contact'][_0x247f('0x74')]:''),'body':_0x26c51f[_0x247f('0x5d')]?_0x26c51f[_0x247f('0x5d')][_0x247f('0x6c')]:_0x26c51f[_0x247f('0x33')],'direction':_0x26c51f[_0x247f('0x60')]==='out'?'A':'C','secret':_0x26c51f[_0x247f('0x75')],'read':_0x26c51f[_0x247f('0x61')],'attachment':_0x26c51f[_0x247f('0x5d')]};})[_0x247f('0x76')]()};return ejs[_0x247f('0x77')](path[_0x247f('0x51')](config['root'],_0x247f('0x52'),'views',_0x247f('0x78')),{'interaction':_0x258f7c})[_0x247f('0x19')](function(_0x238367){var _0x74c3f1=path[_0x247f('0x51')](_0x5a5254,_0x247f('0x79')+_0x4eac40['id']+'-'+_0x27035b+_0x247f('0x7a'));var _0x1aa301={'path':_0x74c3f1,'channel':'Whatsapp','interactionId':_0x4eac40['id']};return pdf[_0x247f('0x7b')](_0x238367,_0x1aa301);})[_0x247f('0x19')](function(){return new BPromise(function(_0x1294eb,_0x836c38){zipdir(_0x5a5254,{'saveTo':_0x19d88c},function(_0x478c6e,_0x2f573f){if(_0x478c6e)return _0x836c38(_0x478c6e);return _0x1294eb(_0x2f573f);});})['then'](function(){return new BPromise(function(_0x15316c,_0x11fa3e){rimraf(_0x5a5254,function(_0x32272a){if(_0x32272a)_0x11fa3e(_0x32272a);return _0x15316c();});});})[_0x247f('0x19')](function(){return _0x14e439[_0x247f('0x4e')](_0x19d88c,_0x5a8ca1,function(_0x25a5d3){if(_0x25a5d3){console[_0x247f('0x7c')](_0x247f('0x7d'),_0x25a5d3);}else{fs['unlinkSync'](_0x19d88c);}});});});}else{return _0x14e439[_0x247f('0xd')](0xc8);}})[_0x247f('0x27')](handleError(_0x14e439,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index 867d2e9..84f7a31 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 _0x7834=['update','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','events','../../mysqldb','setMaxListeners','save'];(function(_0x404b5a,_0x255e99){var _0x33bd94=function(_0x5517bb){while(--_0x5517bb){_0x404b5a['push'](_0x404b5a['shift']());}};_0x33bd94(++_0x255e99);}(_0x7834,0x13f));var _0x4783=function(_0xccd4d3,_0xec2028){_0xccd4d3=_0xccd4d3-0x0;var _0xca752=_0x7834[_0xccd4d3];return _0xca752;};'use strict';var EventEmitter=require(_0x4783('0x0'));var WhatsappInteraction=require('../../mysqldb')['db']['WhatsappInteraction'];var WhatsappMessage=require(_0x4783('0x1'))['db']['WhatsappMessage'];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x4783('0x2')](0x0);var events={'afterCreate':_0x4783('0x3'),'afterUpdate':_0x4783('0x4'),'afterDestroy':_0x4783('0x5')};function emitEvent(_0x29566c){return function(_0x3ebf06,_0x4150f2,_0x49114c){_0x3ebf06[_0x4783('0x6')]({'attributes':['id'],'raw':!![]})[_0x4783('0x7')](function(_0x518da8){_0x3ebf06[_0x4783('0x8')](_0x4783('0x9'),_0x518da8[_0x4783('0xa')](function(_0x112a19){return{'id':_0x112a19['id']};}));return WhatsappMessage[_0x4783('0xb')]({'where':{'WhatsappInteractionId':_0x3ebf06['id'],'direction':'in','read':![]},'raw':!![]});})[_0x4783('0x7')](function(_0x5caa81){_0x3ebf06[_0x4783('0x8')](_0x4783('0xc'),_0x5caa81[_0x4783('0xd')]);WhatsappInteractionEvents[_0x4783('0xe')](_0x29566c+':'+_0x3ebf06['id'],_0x3ebf06);WhatsappInteractionEvents[_0x4783('0xe')](_0x29566c,_0x3ebf06);_0x49114c(null);})[_0x4783('0xf')](_0x49114c(null));};}for(var e in events){if(events[_0x4783('0x10')](e)){var event=events[e];WhatsappInteraction['hook'](e,emitEvent(event));}}module['exports']=WhatsappInteractionEvents; \ No newline at end of file +var _0xbee3=['emit','hasOwnProperty','exports','../../mysqldb','WhatsappMessage','setMaxListeners','update','remove','then','setDataValue','Users','map','findAll','unreadMessages','length'];(function(_0x51e4c4,_0x2f8017){var _0x3f59c6=function(_0x322619){while(--_0x322619){_0x51e4c4['push'](_0x51e4c4['shift']());}};_0x3f59c6(++_0x2f8017);}(_0xbee3,0xd5));var _0x3bee=function(_0x501f36,_0x62dc5b){_0x501f36=_0x501f36-0x0;var _0x21b79b=_0xbee3[_0x501f36];return _0x21b79b;};'use strict';var EventEmitter=require('events');var WhatsappInteraction=require(_0x3bee('0x0'))['db']['WhatsappInteraction'];var WhatsappMessage=require('../../mysqldb')['db'][_0x3bee('0x1')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x3bee('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x3bee('0x3'),'afterDestroy':_0x3bee('0x4')};function emitEvent(_0x1cf379){return function(_0x507c6a,_0x33fd9b,_0x3baf77){_0x507c6a['getUsers']({'attributes':['id'],'raw':!![]})[_0x3bee('0x5')](function(_0x28d912){_0x507c6a[_0x3bee('0x6')](_0x3bee('0x7'),_0x28d912[_0x3bee('0x8')](function(_0x9aab05){return{'id':_0x9aab05['id']};}));return WhatsappMessage[_0x3bee('0x9')]({'where':{'WhatsappInteractionId':_0x507c6a['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x34cd74){_0x507c6a[_0x3bee('0x6')](_0x3bee('0xa'),_0x34cd74[_0x3bee('0xb')]);WhatsappInteractionEvents[_0x3bee('0xc')](_0x1cf379+':'+_0x507c6a['id'],_0x507c6a);WhatsappInteractionEvents[_0x3bee('0xc')](_0x1cf379,_0x507c6a);_0x3baf77(null);})['catch'](_0x3baf77(null));};}for(var e in events){if(events[_0x3bee('0xd')](e)){var event=events[e];WhatsappInteraction['hook'](e,emitEvent(event));}}module[_0x3bee('0xe')]=WhatsappInteractionEvents; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.model.js b/server/api/whatsappInteraction/whatsappInteraction.model.js index 8b9fa9f..ad7696c 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 _0x0e5c=['moment','bluebird','request-promise','path','define','WhatsappInteraction','whatsapp_interactions','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api'];(function(_0x288937,_0xb6129){var _0xf1e7fb=function(_0x5d914c){while(--_0x5d914c){_0x288937['push'](_0x288937['shift']());}};_0xf1e7fb(++_0xb6129);}(_0x0e5c,0x1cd));var _0xc0e5=function(_0x576e2b,_0x328953){_0x576e2b=_0x576e2b-0x0;var _0x46461a=_0x0e5c[_0x576e2b];return _0x46461a;};'use strict';var _=require(_0xc0e5('0x0'));var util=require(_0xc0e5('0x1'));var logger=require(_0xc0e5('0x2'))(_0xc0e5('0x3'));var moment=require(_0xc0e5('0x4'));var BPromise=require(_0xc0e5('0x5'));var rp=require(_0xc0e5('0x6'));var fs=require('fs');var path=require(_0xc0e5('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./whatsappInteraction.attributes');module['exports']=function(_0x9e56c4,_0x23939a){return _0x9e56c4[_0xc0e5('0x8')](_0xc0e5('0x9'),attributes,{'tableName':_0xc0e5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x582218,_0x2081a2,_0x1e089a){if(_0x582218[_0xc0e5('0xb')](_0xc0e5('0xc'))){_0x582218['closedAt']=moment()[_0xc0e5('0xd')](_0xc0e5('0xe'));}_0x1e089a(null,_0x582218);}}});}; \ No newline at end of file +var _0x369d=['YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./whatsappInteraction.attributes','exports','define','WhatsappInteraction','whatsapp_interactions','changed','closedAt','format'];(function(_0x1b0dfc,_0x5a696f){var _0x22a11b=function(_0xc179a6){while(--_0xc179a6){_0x1b0dfc['push'](_0x1b0dfc['shift']());}};_0x22a11b(++_0x5a696f);}(_0x369d,0x166));var _0xd369=function(_0x4287b4,_0xc3d5e3){_0x4287b4=_0x4287b4-0x0;var _0x108ef3=_0x369d[_0x4287b4];return _0x108ef3;};'use strict';var _=require(_0xd369('0x0'));var util=require(_0xd369('0x1'));var logger=require(_0xd369('0x2'))('api');var moment=require(_0xd369('0x3'));var BPromise=require(_0xd369('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd369('0x5'));var rimraf=require(_0xd369('0x6'));var config=require(_0xd369('0x7'));var attributes=require(_0xd369('0x8'));module[_0xd369('0x9')]=function(_0xc7e189,_0x34fbdf){return _0xc7e189[_0xd369('0xa')](_0xd369('0xb'),attributes,{'tableName':_0xd369('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2fcdaf,_0x4138d6,_0x49e764){if(_0x2fcdaf[_0xd369('0xd')]('closed')){_0x2fcdaf[_0xd369('0xe')]=moment()[_0xd369('0xf')](_0xd369('0x10'));}_0x49e764(null,_0x2fcdaf);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index aedffdf..c4c98be 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 _0xbc22=['client','http','redis','defaults','socket.io-emitter','./whatsappInteraction.socket','request','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','UpdateWhatsappInteraction','WhatsappInteraction','update','body','raw','options','where','attributes','limit','then','debug','catch','AddTagsToWhatsappInteraction','find','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x2cccd3,_0x45547d){var _0x481e99=function(_0x552b14){while(--_0x552b14){_0x2cccd3['push'](_0x2cccd3['shift']());}};_0x481e99(++_0x45547d);}(_0xbc22,0xc1));var _0x2bc2=function(_0x1c06f4,_0x2feba6){_0x1c06f4=_0x1c06f4-0x0;var _0x1a727e=_0xbc22[_0x1c06f4];return _0x1a727e;};'use strict';var _=require(_0x2bc2('0x0'));var util=require(_0x2bc2('0x1'));var moment=require(_0x2bc2('0x2'));var BPromise=require(_0x2bc2('0x3'));var rs=require(_0x2bc2('0x4'));var fs=require('fs');var Redis=require(_0x2bc2('0x5'));var db=require(_0x2bc2('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2bc2('0x7')][_0x2bc2('0x8')]({'port':0x232a});config[_0x2bc2('0x9')]=_[_0x2bc2('0xa')](config[_0x2bc2('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x2bc2('0xb'))(new Redis(config[_0x2bc2('0x9')]));require(_0x2bc2('0xc'))['register'](socket);function respondWithRpcPromise(_0x5e96d2,_0x5e2146,_0x56a277){return new BPromise(function(_0x166ca1,_0x1f51f8){return client[_0x2bc2('0xd')](_0x5e96d2,_0x56a277)['then'](function(_0x4ad98a){logger[_0x2bc2('0xe')](_0x2bc2('0xf'),_0x5e2146,_0x2bc2('0x10'));logger['debug']('WhatsappInteraction,\x20%s,\x20%s,\x20%s',_0x5e2146,'request\x20sent',JSON[_0x2bc2('0x11')](_0x4ad98a));if(_0x4ad98a['error']){if(_0x4ad98a[_0x2bc2('0x12')][_0x2bc2('0x13')]===0x1f4){logger[_0x2bc2('0x12')]('WhatsappInteraction,\x20%s,\x20%s',_0x5e2146,_0x4ad98a[_0x2bc2('0x12')][_0x2bc2('0x14')]);return _0x1f51f8(_0x4ad98a[_0x2bc2('0x12')][_0x2bc2('0x14')]);}logger[_0x2bc2('0x12')](_0x2bc2('0xf'),_0x5e2146,_0x4ad98a[_0x2bc2('0x12')][_0x2bc2('0x14')]);return _0x166ca1(_0x4ad98a[_0x2bc2('0x12')][_0x2bc2('0x14')]);}else{logger[_0x2bc2('0xe')]('WhatsappInteraction,\x20%s,\x20%s',_0x5e2146,'request\x20sent');_0x166ca1(_0x4ad98a[_0x2bc2('0x15')]['message']);}})['catch'](function(_0x5e72ef){logger[_0x2bc2('0x12')](_0x2bc2('0xf'),_0x5e2146,_0x5e72ef);_0x1f51f8(_0x5e72ef);});});}exports[_0x2bc2('0x16')]=function(_0x2d28d1){var _0x324b13=this;return new Promise(function(_0x41848f,_0x450b4b){return db[_0x2bc2('0x17')][_0x2bc2('0x18')](_0x2d28d1[_0x2bc2('0x19')],{'raw':_0x2d28d1['options']?_0x2d28d1['options'][_0x2bc2('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2d28d1[_0x2bc2('0x1b')]?_0x2d28d1[_0x2bc2('0x1b')][_0x2bc2('0x1c')]||null:null,'attributes':_0x2d28d1['options']?_0x2d28d1[_0x2bc2('0x1b')][_0x2bc2('0x1d')]||null:null,'limit':_0x2d28d1[_0x2bc2('0x1b')]?_0x2d28d1[_0x2bc2('0x1b')][_0x2bc2('0x1e')]||null:null})[_0x2bc2('0x1f')](function(_0x189eb3){logger[_0x2bc2('0xe')]('UpdateWhatsappInteraction',_0x2d28d1);logger[_0x2bc2('0x20')](_0x2bc2('0x16'),_0x2d28d1,JSON[_0x2bc2('0x11')](_0x189eb3));_0x41848f(_0x189eb3);})[_0x2bc2('0x21')](function(_0x3d6677){logger[_0x2bc2('0x12')](_0x2bc2('0x16'),_0x3d6677[_0x2bc2('0x14')],_0x2d28d1);_0x450b4b(_0x324b13[_0x2bc2('0x12')](0x1f4,_0x3d6677['message']));});});};exports[_0x2bc2('0x22')]=function(_0x284e84){return new Promise(function(_0x5079e5,_0x174de5){return db[_0x2bc2('0x17')][_0x2bc2('0x23')]({'where':_0x284e84['options']?_0x284e84[_0x2bc2('0x1b')]['where']||null:null})[_0x2bc2('0x1f')](function(_0x510d3a){if(_0x510d3a){return _0x510d3a['addTags'](_0x284e84['body'][_0x2bc2('0x24')],_[_0x2bc2('0x25')](_0x284e84[_0x2bc2('0x19')],[_0x2bc2('0x24'),'id'])||{});}})[_0x2bc2('0x26')](function(_0x50efb9){logger[_0x2bc2('0xe')]('AddTags',_0x284e84);logger['debug'](_0x2bc2('0x27'),_0x284e84,JSON['stringify'](_0x50efb9));_0x5079e5(_0x50efb9);})['catch'](function(_0x3e751a){logger[_0x2bc2('0x12')](_0x2bc2('0x27'),_0x3e751a['message'],_0x284e84);_0x174de5(_this[_0x2bc2('0x12')](0x1f4,_0x3e751a[_0x2bc2('0x14')]));});});}; \ No newline at end of file +var _0x93d4=['raw','where','attributes','limit','find','addTags','body','ids','omit','spread','AddTags','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','request','then','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','UpdateWhatsappInteraction','WhatsappInteraction','update','options'];(function(_0x47dff5,_0x136e4a){var _0x1b739b=function(_0x14adb6){while(--_0x14adb6){_0x47dff5['push'](_0x47dff5['shift']());}};_0x1b739b(++_0x136e4a);}(_0x93d4,0xab));var _0x493d=function(_0x5e8208,_0x124ea7){_0x5e8208=_0x5e8208-0x0;var _0x3c8a5b=_0x93d4[_0x5e8208];return _0x3c8a5b;};'use strict';var _=require(_0x493d('0x0'));var util=require(_0x493d('0x1'));var moment=require(_0x493d('0x2'));var BPromise=require(_0x493d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x493d('0x4'));var db=require(_0x493d('0x5'))['db'];var utils=require(_0x493d('0x6'));var logger=require(_0x493d('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x493d('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0x493d('0x9')]=_[_0x493d('0xa')](config[_0x493d('0x9')],{'host':_0x493d('0xb'),'port':0x18eb});var socket=require(_0x493d('0xc'))(new Redis(config[_0x493d('0x9')]));require(_0x493d('0xd'))['register'](socket);function respondWithRpcPromise(_0xa12c08,_0x53211a,_0x455471){return new BPromise(function(_0x4f353a,_0x56b351){return client[_0x493d('0xe')](_0xa12c08,_0x455471)[_0x493d('0xf')](function(_0x97cf19){logger[_0x493d('0x10')](_0x493d('0x11'),_0x53211a,_0x493d('0x12'));logger[_0x493d('0x13')](_0x493d('0x14'),_0x53211a,_0x493d('0x12'),JSON[_0x493d('0x15')](_0x97cf19));if(_0x97cf19[_0x493d('0x16')]){if(_0x97cf19['error']['code']===0x1f4){logger['error'](_0x493d('0x11'),_0x53211a,_0x97cf19[_0x493d('0x16')][_0x493d('0x17')]);return _0x56b351(_0x97cf19[_0x493d('0x16')][_0x493d('0x17')]);}logger['error'](_0x493d('0x11'),_0x53211a,_0x97cf19[_0x493d('0x16')][_0x493d('0x17')]);return _0x4f353a(_0x97cf19[_0x493d('0x16')]['message']);}else{logger[_0x493d('0x10')](_0x493d('0x11'),_0x53211a,_0x493d('0x12'));_0x4f353a(_0x97cf19['result'][_0x493d('0x17')]);}})[_0x493d('0x18')](function(_0xcb8513){logger[_0x493d('0x16')](_0x493d('0x11'),_0x53211a,_0xcb8513);_0x56b351(_0xcb8513);});});}exports[_0x493d('0x19')]=function(_0x1159ef){var _0x55687d=this;return new Promise(function(_0x570f48,_0x5eb28f){return db[_0x493d('0x1a')][_0x493d('0x1b')](_0x1159ef['body'],{'raw':_0x1159ef[_0x493d('0x1c')]?_0x1159ef[_0x493d('0x1c')][_0x493d('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1159ef[_0x493d('0x1c')]?_0x1159ef[_0x493d('0x1c')][_0x493d('0x1e')]||null:null,'attributes':_0x1159ef['options']?_0x1159ef[_0x493d('0x1c')][_0x493d('0x1f')]||null:null,'limit':_0x1159ef['options']?_0x1159ef['options'][_0x493d('0x20')]||null:null})['then'](function(_0x5585e1){logger[_0x493d('0x10')](_0x493d('0x19'),_0x1159ef);logger[_0x493d('0x13')]('UpdateWhatsappInteraction',_0x1159ef,JSON[_0x493d('0x15')](_0x5585e1));_0x570f48(_0x5585e1);})[_0x493d('0x18')](function(_0x410af0){logger[_0x493d('0x16')](_0x493d('0x19'),_0x410af0[_0x493d('0x17')],_0x1159ef);_0x5eb28f(_0x55687d[_0x493d('0x16')](0x1f4,_0x410af0['message']));});});};exports['AddTagsToWhatsappInteraction']=function(_0xe1e79e){return new Promise(function(_0x3ddd68,_0x2cad1a){return db[_0x493d('0x1a')][_0x493d('0x21')]({'where':_0xe1e79e[_0x493d('0x1c')]?_0xe1e79e[_0x493d('0x1c')][_0x493d('0x1e')]||null:null})[_0x493d('0xf')](function(_0x4f09b2){if(_0x4f09b2){return _0x4f09b2[_0x493d('0x22')](_0xe1e79e[_0x493d('0x23')][_0x493d('0x24')],_[_0x493d('0x25')](_0xe1e79e[_0x493d('0x23')],[_0x493d('0x24'),'id'])||{});}})[_0x493d('0x26')](function(_0x50e2be){logger['info'](_0x493d('0x27'),_0xe1e79e);logger[_0x493d('0x13')]('AddTags',_0xe1e79e,JSON[_0x493d('0x15')](_0x50e2be));_0x3ddd68(_0x50e2be);})['catch'](function(_0x32930a){logger[_0x493d('0x16')](_0x493d('0x27'),_0x32930a[_0x493d('0x17')],_0xe1e79e);_0x2cad1a(_this[_0x493d('0x16')](0x1f4,_0x32930a[_0x493d('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index 983153b..3ee2f47 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 _0xa8ef=['whatsappInteraction:','./whatsappInteraction.events','save','remove','update','emit','removeListener','register','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa8ef,0xac));var _0xfa8e=function(_0x1568c5,_0x298d64){_0x1568c5=_0x1568c5-0x0;var _0x145229=_0xa8ef[_0x1568c5];return _0x145229;};'use strict';var WhatsappInteractionEvents=require(_0xfa8e('0x0'));var events=[_0xfa8e('0x1'),_0xfa8e('0x2'),_0xfa8e('0x3')];function createListener(_0x4f3c7e,_0x7c18d6){return function(_0x1a8e34){_0x7c18d6[_0xfa8e('0x4')](_0x4f3c7e,_0x1a8e34);};}function removeListener(_0x179a5f,_0x381cee){return function(){WhatsappInteractionEvents[_0xfa8e('0x5')](_0x179a5f,_0x381cee);};}exports[_0xfa8e('0x6')]=function(_0x38857e){for(var _0x3182a7=0x0,_0x29e044=events[_0xfa8e('0x7')];_0x3182a7<_0x29e044;_0x3182a7++){var _0x18df76=events[_0x3182a7];var _0x182769=createListener(_0xfa8e('0x8')+_0x18df76,_0x38857e);WhatsappInteractionEvents['on'](_0x18df76,_0x182769);}}; \ No newline at end of file +var _0x9a1b=['emit','register','whatsappInteraction:','./whatsappInteraction.events','save','remove','update'];(function(_0x4b0830,_0x2e3b0a){var _0x1f53a7=function(_0x4b5503){while(--_0x4b5503){_0x4b0830['push'](_0x4b0830['shift']());}};_0x1f53a7(++_0x2e3b0a);}(_0x9a1b,0x13e));var _0xb9a1=function(_0x3f3a31,_0x5c5f9e){_0x3f3a31=_0x3f3a31-0x0;var _0x4ecc75=_0x9a1b[_0x3f3a31];return _0x4ecc75;};'use strict';var WhatsappInteractionEvents=require(_0xb9a1('0x0'));var events=[_0xb9a1('0x1'),_0xb9a1('0x2'),_0xb9a1('0x3')];function createListener(_0x199822,_0x4fca17){return function(_0x12d1ba){_0x4fca17[_0xb9a1('0x4')](_0x199822,_0x12d1ba);};}function removeListener(_0x19ddc9,_0x2c800f){return function(){WhatsappInteractionEvents['removeListener'](_0x19ddc9,_0x2c800f);};}exports[_0xb9a1('0x5')]=function(_0x3ac788){for(var _0x3b171a=0x0,_0x4aa4bb=events['length'];_0x3b171a<_0x4aa4bb;_0x3b171a++){var _0x2574dc=events[_0x3b171a];var _0x448a87=createListener(_0xb9a1('0x6')+_0x2574dc,_0x3ac788);WhatsappInteractionEvents['on'](_0x2574dc,_0x448a87);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index faffb5e..01cfa1c 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 _0x2a70=['/:id','show','post','whatsapp','whatsappmessage:create','create','put','accept','/:id/reject','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./whatsappMessage.controller','get','index','/describe','isAuthenticated'];(function(_0x16be8b,_0x4d4b42){var _0x4e1ab6=function(_0x45f886){while(--_0x45f886){_0x16be8b['push'](_0x16be8b['shift']());}};_0x4e1ab6(++_0x4d4b42);}(_0x2a70,0x88));var _0x02a7=function(_0x65fcb4,_0x4ef502){_0x65fcb4=_0x65fcb4-0x0;var _0x4353be=_0x2a70[_0x65fcb4];return _0x4353be;};'use strict';var multer=require(_0x02a7('0x0'));var util=require(_0x02a7('0x1'));var path=require(_0x02a7('0x2'));var timeout=require(_0x02a7('0x3'));var express=require(_0x02a7('0x4'));var router=express[_0x02a7('0x5')]();var fs_extra=require(_0x02a7('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x02a7('0x7'));var config=require(_0x02a7('0x8'));var controller=require(_0x02a7('0x9'));router[_0x02a7('0xa')]('/',auth['isAuthenticated'](),controller[_0x02a7('0xb')]);router[_0x02a7('0xa')](_0x02a7('0xc'),auth[_0x02a7('0xd')](),controller['describe']);router[_0x02a7('0xa')](_0x02a7('0xe'),auth[_0x02a7('0xd')](),controller[_0x02a7('0xf')]);router[_0x02a7('0x10')]('/',auth[_0x02a7('0xd')](),interaction['tracked'](_0x02a7('0x11'),_0x02a7('0x12')),controller[_0x02a7('0x13')]);router[_0x02a7('0x10')]('/:id/status',controller['status']);router[_0x02a7('0x14')](_0x02a7('0xe'),auth[_0x02a7('0xd')](),controller['update']);router[_0x02a7('0x14')]('/:id/accept',auth[_0x02a7('0xd')](),controller[_0x02a7('0x15')]);router[_0x02a7('0x14')](_0x02a7('0x16'),auth[_0x02a7('0xd')](),controller['reject']);router['delete'](_0x02a7('0xe'),auth[_0x02a7('0xd')](),controller[_0x02a7('0x17')]);module[_0x02a7('0x18')]=router; \ No newline at end of file +var _0x8b9f=['tracked','whatsapp','create','/:id/status','status','put','accept','/:id/reject','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./whatsappMessage.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x8b9f,0x7b));var _0xf8b9=function(_0x3e8de2,_0x468431){_0x3e8de2=_0x3e8de2-0x0;var _0x56b736=_0x8b9f[_0x3e8de2];return _0x56b736;};'use strict';var multer=require(_0xf8b9('0x0'));var util=require('util');var path=require(_0xf8b9('0x1'));var timeout=require(_0xf8b9('0x2'));var express=require(_0xf8b9('0x3'));var router=express[_0xf8b9('0x4')]();var fs_extra=require(_0xf8b9('0x5'));var auth=require(_0xf8b9('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xf8b9('0x7'));var controller=require(_0xf8b9('0x8'));router[_0xf8b9('0x9')]('/',auth['isAuthenticated'](),controller[_0xf8b9('0xa')]);router[_0xf8b9('0x9')](_0xf8b9('0xb'),auth[_0xf8b9('0xc')](),controller[_0xf8b9('0xd')]);router[_0xf8b9('0x9')](_0xf8b9('0xe'),auth[_0xf8b9('0xc')](),controller[_0xf8b9('0xf')]);router[_0xf8b9('0x10')]('/',auth[_0xf8b9('0xc')](),interaction[_0xf8b9('0x11')](_0xf8b9('0x12'),'whatsappmessage:create'),controller[_0xf8b9('0x13')]);router[_0xf8b9('0x10')](_0xf8b9('0x14'),controller[_0xf8b9('0x15')]);router[_0xf8b9('0x16')](_0xf8b9('0xe'),auth[_0xf8b9('0xc')](),controller['update']);router[_0xf8b9('0x16')]('/:id/accept',auth['isAuthenticated'](),controller[_0xf8b9('0x17')]);router[_0xf8b9('0x16')](_0xf8b9('0x18'),auth[_0xf8b9('0xc')](),controller['reject']);router[_0xf8b9('0x19')](_0xf8b9('0xe'),auth[_0xf8b9('0xc')](),controller[_0xf8b9('0x1a')]);module[_0xf8b9('0x1b')]=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index 2cdf412..e83ad38 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 _0x1cb9=['medium','BOOLEAN','ENUM','out','STRING','DATE','sequelize','TEXT'];(function(_0x5e6bb2,_0x5478c6){var _0x43721e=function(_0x280fd3){while(--_0x280fd3){_0x5e6bb2['push'](_0x5e6bb2['shift']());}};_0x43721e(++_0x5478c6);}(_0x1cb9,0x14e));var _0x91cb=function(_0x355d9c,_0x540750){_0x355d9c=_0x355d9c-0x0;var _0x51de8a=_0x1cb9[_0x355d9c];return _0x51de8a;};'use strict';var Sequelize=require(_0x91cb('0x0'));module['exports']={'body':{'type':Sequelize[_0x91cb('0x1')](_0x91cb('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x91cb('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x91cb('0x4')]('in','out'),'defaultValue':_0x91cb('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x91cb('0x6')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0x91cb('0x7')]},'secret':{'type':Sequelize[_0x91cb('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x91cb('0x6')]},'providerResponse':{'type':Sequelize[_0x91cb('0x1')]}}; \ No newline at end of file +var _0xc7b9=['sequelize','exports','TEXT','ENUM','out','STRING','BOOLEAN'];(function(_0x170af0,_0x352297){var _0x40d17f=function(_0x2b996f){while(--_0x2b996f){_0x170af0['push'](_0x170af0['shift']());}};_0x40d17f(++_0x352297);}(_0xc7b9,0xa8));var _0x9c7b=function(_0x385a8a,_0x5ec722){_0x385a8a=_0x385a8a-0x0;var _0x377eb3=_0xc7b9[_0x385a8a];return _0x377eb3;};'use strict';var Sequelize=require(_0x9c7b('0x0'));module[_0x9c7b('0x1')]={'body':{'type':Sequelize[_0x9c7b('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x9c7b('0x3')]('in',_0x9c7b('0x4')),'defaultValue':_0x9c7b('0x4'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0x9c7b('0x5')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0x9c7b('0x6')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x9c7b('0x5')]},'providerResponse':{'type':Sequelize[_0x9c7b('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index 57829bf..13d2c5c 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 _0x1d7e=['jayson/promise','client','http','request','then','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','map','WhatsappMessage','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','length','find','create','body','params','describe','whatsapp-interactions','accept','whatsapp','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','WhatsappInteraction','WhatsappInteractionId','isNil','read1stAt','interaction','info','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','fullname','email','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT','contact','User','rejectmessage','WhatsappAccount','WhatsppMessage,\x20%s,\x20%s,\x20%s','inspect','twilio','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./whatsappMessage.socket'];(function(_0x432fca,_0xb0b1b5){var _0x3adba4=function(_0x5e3ae4){while(--_0x5e3ae4){_0x432fca['push'](_0x432fca['shift']());}};_0x3adba4(++_0xb0b1b5);}(_0x1d7e,0x71));var _0xe1d7=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0x1d7e[_0x47a7d0];return _0xb9bd08;};'use strict';var emlformat=require(_0xe1d7('0x0'));var rimraf=require(_0xe1d7('0x1'));var zipdir=require(_0xe1d7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe1d7('0x3'));var moment=require(_0xe1d7('0x4'));var BPromise=require(_0xe1d7('0x5'));var Mustache=require(_0xe1d7('0x6'));var util=require(_0xe1d7('0x7'));var path=require(_0xe1d7('0x8'));var sox=require('sox');var csv=require(_0xe1d7('0x9'));var ejs=require(_0xe1d7('0xa'));var fs=require('fs');var fs_extra=require(_0xe1d7('0xb'));var _=require(_0xe1d7('0xc'));var squel=require(_0xe1d7('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xe1d7('0x9'));var querystring=require(_0xe1d7('0xe'));var Papa=require('papaparse');var Redis=require(_0xe1d7('0xf'));var authService=require(_0xe1d7('0x10'));var qs=require(_0xe1d7('0x11'));var as=require(_0xe1d7('0x12'));var hardwareService=require(_0xe1d7('0x13'));var logger=require(_0xe1d7('0x14'))(_0xe1d7('0x15'));var utils=require(_0xe1d7('0x16'));var config=require(_0xe1d7('0x17'));var licenseUtil=require(_0xe1d7('0x18'));var db=require(_0xe1d7('0x19'))['db'];config[_0xe1d7('0x1a')]=_[_0xe1d7('0x1b')](config[_0xe1d7('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0xe1d7('0x1c'))(new Redis(config[_0xe1d7('0x1a')]));require(_0xe1d7('0x1d'))['register'](socket);var jayson=require(_0xe1d7('0x1e'));var client=jayson[_0xe1d7('0x1f')][_0xe1d7('0x20')]({'port':0x232c});var client9002=jayson[_0xe1d7('0x1f')]['http']({'port':0x232a});function respondWithRpcPromise(_0x449049,_0x3c7e6b,_0x406101,_0x52de99){return new BPromise(function(_0x5aaa82,_0xa7bf89){var _0x5a275d=_0x52de99||client;return _0x5a275d[_0xe1d7('0x21')](_0x449049,_0x406101)[_0xe1d7('0x22')](function(_0x3fd069){logger['info'](_0xe1d7('0x23'),_0x3c7e6b,_0xe1d7('0x24'));logger[_0xe1d7('0x25')](_0xe1d7('0x26'),_0x3c7e6b,'request\x20sent',JSON[_0xe1d7('0x27')](_0x3fd069));if(_0x3fd069[_0xe1d7('0x28')]){if(_0x3fd069['error'][_0xe1d7('0x29')]===0x1f4){logger[_0xe1d7('0x28')](_0xe1d7('0x23'),_0x3c7e6b,_0x3fd069[_0xe1d7('0x28')]['message']);return _0xa7bf89(_0x3fd069[_0xe1d7('0x28')][_0xe1d7('0x2a')]);}logger[_0xe1d7('0x28')]('WhatsappMessage,\x20%s,\x20%s',_0x3c7e6b,_0x3fd069[_0xe1d7('0x28')][_0xe1d7('0x2a')]);return _0x5aaa82(_0x3fd069['error'][_0xe1d7('0x2a')]);}else{logger['info'](_0xe1d7('0x23'),_0x3c7e6b,_0xe1d7('0x24'));_0x5aaa82(_0x3fd069['result']['message']);}})[_0xe1d7('0x2b')](function(_0x4341b6){logger[_0xe1d7('0x28')](_0xe1d7('0x23'),_0x3c7e6b,_0x4341b6);_0xa7bf89(_0x4341b6);});});}function respondWithStatusCode(_0x31b9a1,_0x152062){_0x152062=_0x152062||0xcc;return function(_0x16be88){if(_0x16be88){return _0x31b9a1['sendStatus'](_0x152062);}return _0x31b9a1[_0xe1d7('0x2c')](_0x152062)[_0xe1d7('0x2d')]();};}function respondWithResult(_0x49f862,_0x87d6c7){_0x87d6c7=_0x87d6c7||0xc8;return function(_0x4ed7ba){if(_0x4ed7ba){return _0x49f862[_0xe1d7('0x2c')](_0x87d6c7)[_0xe1d7('0x2e')](_0x4ed7ba);}};}function respondWithFilteredResult(_0x3726d3,_0x1eb749){return function(_0x4ecbd3){if(_0x4ecbd3){var _0x1a0924=typeof _0x1eb749[_0xe1d7('0x2f')]===_0xe1d7('0x30')&&typeof _0x1eb749[_0xe1d7('0x31')]===_0xe1d7('0x30');var _0x3963e5=_0x4ecbd3[_0xe1d7('0x32')];var _0x3cbcd7=_0x1a0924?0x0:_0x1eb749[_0xe1d7('0x2f')];var _0x23995e=_0x1a0924?_0x4ecbd3[_0xe1d7('0x32')]:_0x1eb749[_0xe1d7('0x2f')]+_0x1eb749['limit'];var _0xf7adb4;if(_0x23995e>=_0x3963e5){_0x23995e=_0x3963e5;_0xf7adb4=0xc8;}else{_0xf7adb4=0xce;}_0x3726d3['status'](_0xf7adb4);return _0x3726d3[_0xe1d7('0x33')](_0xe1d7('0x34'),_0x3cbcd7+'-'+_0x23995e+'/'+_0x3963e5)[_0xe1d7('0x2e')](_0x4ecbd3);}return null;};}function patchUpdates(_0x480f13){return function(_0x278cac){try{jsonpatch[_0xe1d7('0x35')](_0x278cac,_0x480f13,!![]);}catch(_0x28e0f7){return BPromise[_0xe1d7('0x36')](_0x28e0f7);}return _0x278cac[_0xe1d7('0x37')]();};}function saveUpdates(_0x136e41,_0x5cbf96){return function(_0x9e9ee0){if(_0x9e9ee0){return _0x9e9ee0[_0xe1d7('0x38')](_0x136e41)['then'](function(_0x1b0db5){return _0x1b0db5;});}return null;};}function removeEntity(_0x2059d0,_0x4ea709){return function(_0x2ae4b3){if(_0x2ae4b3){return _0x2ae4b3[_0xe1d7('0x39')]()[_0xe1d7('0x22')](function(){_0x2059d0[_0xe1d7('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0xd2977c,_0x3e6e7b){return function(_0x218ad5){if(!_0x218ad5){_0xd2977c['sendStatus'](0x194);}return _0x218ad5;};}function handleError(_0x4321c9,_0x4b68c2){_0x4b68c2=_0x4b68c2||0x1f4;return function(_0x16eb02){logger[_0xe1d7('0x28')](_0x16eb02[_0xe1d7('0x3a')]);if(_0x16eb02[_0xe1d7('0x3b')]){delete _0x16eb02[_0xe1d7('0x3b')];}_0x4321c9[_0xe1d7('0x2c')](_0x4b68c2)[_0xe1d7('0x3c')](_0x16eb02);};}exports[_0xe1d7('0x3d')]=function(_0x3613e1,_0x5483a9){var _0x1f1fc0={},_0x5a165c={},_0xe85643={'count':0x0,'rows':[]};var _0x3343c0=_[_0xe1d7('0x3e')](db[_0xe1d7('0x3f')][_0xe1d7('0x40')],function(_0x549482){return{'name':_0x549482[_0xe1d7('0x41')],'type':_0x549482['type'][_0xe1d7('0x42')]};});_0x5a165c['model']=_[_0xe1d7('0x3e')](_0x3343c0,_0xe1d7('0x3b'));_0x5a165c[_0xe1d7('0x43')]=_[_0xe1d7('0x44')](_0x3613e1['query']);_0x5a165c[_0xe1d7('0x45')]=_[_0xe1d7('0x46')](_0x5a165c[_0xe1d7('0x47')],_0x5a165c[_0xe1d7('0x43')]);_0x1f1fc0[_0xe1d7('0x48')]=_[_0xe1d7('0x46')](_0x5a165c[_0xe1d7('0x47')],qs[_0xe1d7('0x49')](_0x3613e1[_0xe1d7('0x43')][_0xe1d7('0x49')]));_0x1f1fc0[_0xe1d7('0x48')]=_0x1f1fc0[_0xe1d7('0x48')]['length']?_0x1f1fc0[_0xe1d7('0x48')]:_0x5a165c[_0xe1d7('0x47')];if(!_0x3613e1[_0xe1d7('0x43')][_0xe1d7('0x4a')]('nolimit')){_0x1f1fc0[_0xe1d7('0x31')]=qs[_0xe1d7('0x31')](_0x3613e1[_0xe1d7('0x43')][_0xe1d7('0x31')]);_0x1f1fc0[_0xe1d7('0x2f')]=qs[_0xe1d7('0x2f')](_0x3613e1['query']['offset']);}_0x1f1fc0['order']=qs[_0xe1d7('0x4b')](_0x3613e1['query']['sort']);_0x1f1fc0[_0xe1d7('0x4c')]=qs['filters'](_[_0xe1d7('0x4d')](_0x3613e1['query'],_0x5a165c[_0xe1d7('0x45')]),_0x3343c0);if(_0x3613e1['query'][_0xe1d7('0x4e')]){_0x1f1fc0['where']=_[_0xe1d7('0x4f')](_0x1f1fc0[_0xe1d7('0x4c')],{'$or':_[_0xe1d7('0x3e')](_0x3343c0,function(_0x553d5e){if(_0x553d5e[_0xe1d7('0x50')]!==_0xe1d7('0x51')){var _0x503192={};_0x503192[_0x553d5e[_0xe1d7('0x3b')]]={'$like':'%'+_0x3613e1[_0xe1d7('0x43')][_0xe1d7('0x4e')]+'%'};return _0x503192;}})});}_0x1f1fc0=_[_0xe1d7('0x4f')]({},_0x1f1fc0,_0x3613e1[_0xe1d7('0x52')]);var _0x3765ab={'where':_0x1f1fc0['where']};return db[_0xe1d7('0x3f')][_0xe1d7('0x32')](_0x3765ab)[_0xe1d7('0x22')](function(_0x2fc2ac){_0xe85643[_0xe1d7('0x32')]=_0x2fc2ac;if(_0x3613e1[_0xe1d7('0x43')][_0xe1d7('0x53')]){_0x1f1fc0[_0xe1d7('0x54')]=[{'all':!![]}];}return db['WhatsappMessage'][_0xe1d7('0x55')](_0x1f1fc0);})['then'](function(_0x1bd389){_0xe85643[_0xe1d7('0x56')]=_0x1bd389;return _0xe85643;})[_0xe1d7('0x22')](respondWithFilteredResult(_0x5483a9,_0x1f1fc0))['catch'](handleError(_0x5483a9,null));};exports['show']=function(_0xcdb433,_0x1b0cee){var _0x2aef9f={'raw':!![],'where':{'id':_0xcdb433['params']['id']}},_0x3c91b6={};_0x3c91b6[_0xe1d7('0x47')]=_['keys'](db[_0xe1d7('0x3f')][_0xe1d7('0x40')]);_0x3c91b6[_0xe1d7('0x43')]=_[_0xe1d7('0x44')](_0xcdb433[_0xe1d7('0x43')]);_0x3c91b6['filters']=_[_0xe1d7('0x46')](_0x3c91b6[_0xe1d7('0x47')],_0x3c91b6[_0xe1d7('0x43')]);_0x2aef9f[_0xe1d7('0x48')]=_['intersection'](_0x3c91b6[_0xe1d7('0x47')],qs['fields'](_0xcdb433[_0xe1d7('0x43')][_0xe1d7('0x49')]));_0x2aef9f[_0xe1d7('0x48')]=_0x2aef9f['attributes'][_0xe1d7('0x57')]?_0x2aef9f[_0xe1d7('0x48')]:_0x3c91b6[_0xe1d7('0x47')];if(_0xcdb433[_0xe1d7('0x43')][_0xe1d7('0x53')]){_0x2aef9f[_0xe1d7('0x54')]=[{'all':!![]}];}_0x2aef9f=_[_0xe1d7('0x4f')]({},_0x2aef9f,_0xcdb433[_0xe1d7('0x52')]);return db[_0xe1d7('0x3f')][_0xe1d7('0x58')](_0x2aef9f)[_0xe1d7('0x22')](handleEntityNotFound(_0x1b0cee,null))[_0xe1d7('0x22')](respondWithResult(_0x1b0cee,null))[_0xe1d7('0x2b')](handleError(_0x1b0cee,null));};exports[_0xe1d7('0x59')]=function(_0x508806,_0x21ed30){return db['WhatsappMessage'][_0xe1d7('0x59')](_0x508806[_0xe1d7('0x5a')],{})['then'](respondWithResult(_0x21ed30,0xc9))[_0xe1d7('0x2b')](handleError(_0x21ed30,null));};exports[_0xe1d7('0x38')]=function(_0x4b2107,_0x4f93a7){if(_0x4b2107[_0xe1d7('0x5a')]['id']){delete _0x4b2107[_0xe1d7('0x5a')]['id'];}return db['WhatsappMessage'][_0xe1d7('0x58')]({'where':{'id':_0x4b2107['params']['id']}})[_0xe1d7('0x22')](handleEntityNotFound(_0x4f93a7,null))[_0xe1d7('0x22')](saveUpdates(_0x4b2107[_0xe1d7('0x5a')],null))['then'](respondWithResult(_0x4f93a7,null))[_0xe1d7('0x2b')](handleError(_0x4f93a7,null));};exports[_0xe1d7('0x39')]=function(_0x5f166a,_0x460713){return db['WhatsappMessage'][_0xe1d7('0x58')]({'where':{'id':_0x5f166a[_0xe1d7('0x5b')]['id']}})[_0xe1d7('0x22')](handleEntityNotFound(_0x460713,null))[_0xe1d7('0x22')](removeEntity(_0x460713,null))['catch'](handleError(_0x460713,null));};exports[_0xe1d7('0x5c')]=function(_0x439105,_0x47ad27){return db[_0xe1d7('0x3f')]['describe']()['then'](respondWithResult(_0x47ad27,null))['catch'](handleError(_0x47ad27,null));};var interaction_log=require(_0xe1d7('0x14'))(_0xe1d7('0x5d'));exports[_0xe1d7('0x5e')]=function(_0x4becb2,_0x44d634,_0x438832){var _0x4e39c5={'agent':{},'channel':_0xe1d7('0x5f')};if(_0x4becb2[_0xe1d7('0x5a')]['id']){delete _0x4becb2[_0xe1d7('0x5a')]['id'];}_0x4becb2['body'][_0xe1d7('0x60')]=!![];_0x4becb2[_0xe1d7('0x5a')][_0xe1d7('0x61')]=moment()[_0xe1d7('0x62')](_0xe1d7('0x63'));_0x4becb2[_0xe1d7('0x5a')][_0xe1d7('0x64')]=_0x4becb2[_0xe1d7('0x5a')][_0xe1d7('0x64')]||_0x4becb2[_0xe1d7('0x65')]['id'];_0x4e39c5[_0xe1d7('0x66')]['id']=_0x4becb2[_0xe1d7('0x5a')][_0xe1d7('0x64')];return db[_0xe1d7('0x3f')][_0xe1d7('0x58')]({'where':{'id':_0x4becb2[_0xe1d7('0x5b')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x44d634,null))[_0xe1d7('0x22')](saveUpdates(_0x4becb2[_0xe1d7('0x5a')],null))[_0xe1d7('0x22')](function(_0x17c3c0){if(_0x17c3c0){_0x4e39c5[_0xe1d7('0x2a')]=_0x17c3c0[_0xe1d7('0x67')]({'plain':!![]});return db[_0xe1d7('0x68')][_0xe1d7('0x58')]({'where':{'id':_0x17c3c0[_0xe1d7('0x69')]}});}return null;})[_0xe1d7('0x22')](handleEntityNotFound(_0x44d634,null))['then'](function(_0x28b372){if(_0x28b372){return _0x28b372[_0xe1d7('0x38')]({'UserId':_0x4becb2['body']['UserId'],'read1stAt':_[_0xe1d7('0x6a')](_0x28b372[_0xe1d7('0x6b')])?moment()['format'](_0xe1d7('0x63')):undefined});}return null;})['then'](function(_0x2a3050){if(_0x2a3050){_0x4e39c5[_0xe1d7('0x6c')]=_0x2a3050['get']({'plain':!![]});interaction_log[_0xe1d7('0x6d')](_0xe1d7('0x6e'),_0x4becb2['user']['id'],_0x4becb2[_0xe1d7('0x65')][_0xe1d7('0x3b')],_0x4becb2[_0xe1d7('0x65')][_0xe1d7('0x6f')],_0x4e39c5[_0xe1d7('0x6c')]['id'],_0x4becb2[_0xe1d7('0x5a')]?JSON[_0xe1d7('0x27')](_0x4becb2['body']):_0xe1d7('0x70'));return respondWithRpcPromise('AcceptMessage',_0xe1d7('0x71'),_0x4e39c5);}return null;})[_0xe1d7('0x22')](function(_0x1836d2){var _0xe356a5=_0xe1d7('0x72')+_0x1836d2['message'][_0xe1d7('0x73')];return db[_0xe1d7('0x74')]['query'](_0xe356a5,{'type':db[_0xe1d7('0x75')][_0xe1d7('0x76')]['SELECT'],'raw':!![]})[_0xe1d7('0x22')](function(_0x3b7753){return _0x3b7753;});})['then'](function(_0x1963e4){if(_0x1963e4){_0x4e39c5[_0xe1d7('0x2a')]['contact']=_0x1963e4[0x0];if(!_0x4becb2['body']['UserId'])return;return db['User'][_0xe1d7('0x58')]({'where':{'id':_0x4becb2[_0xe1d7('0x5a')][_0xe1d7('0x64')],'role':_0xe1d7('0x66')},'attributes':['id','name',_0xe1d7('0x77'),_0xe1d7('0x78'),'internal'],'raw':!![]});}return null;})['then'](function(_0x233863){if(!_0x233863)return null;_0x4e39c5[_0xe1d7('0x2a')][_0xe1d7('0x66')]=_0x233863;return _0x4e39c5;})['then'](function(_0x41ce12){if(_0x41ce12){if(_0x4becb2['body'][_0xe1d7('0x79')]){_0x4e39c5[_0xe1d7('0x2a')][_0xe1d7('0x7a')]=util[_0xe1d7('0x62')](_0xe1d7('0x7b'),_0x4becb2[_0xe1d7('0x65')][_0xe1d7('0x3b')]);_0x4e39c5[_0xe1d7('0x2a')][_0xe1d7('0x7c')]=_0x4e39c5[_0xe1d7('0x7c')];_0x4e39c5[_0xe1d7('0x2a')]['motionChannel']=_0x4e39c5['channel'];_0x4e39c5['message'][_0xe1d7('0x7d')]=_0xe1d7('0x5e');return respondWithRpcPromise(_0xe1d7('0x7e'),_0xe1d7('0x7e'),{'event':_0xe1d7('0x7f'),'message':_0x4e39c5[_0xe1d7('0x2a')]},client9002)[_0xe1d7('0x22')](function(){return _0x4e39c5;});}return _0x4e39c5;}return null;})[_0xe1d7('0x22')](respondWithResult(_0x44d634,null))[_0xe1d7('0x2b')](handleError(_0x44d634,null));};var interaction_log=require('../../config/logger')('whatsapp-interactions');exports[_0xe1d7('0x36')]=function(_0xcc2e08,_0x2aa9e7,_0x44dbce){var _0x2b9726={'agent':{},'channel':_0xe1d7('0x5f')};if(_0xcc2e08[_0xe1d7('0x5a')]['id']){delete _0xcc2e08['body']['id'];}_0xcc2e08[_0xe1d7('0x5a')][_0xe1d7('0x64')]=_0xcc2e08[_0xe1d7('0x5a')][_0xe1d7('0x64')]||_0xcc2e08[_0xe1d7('0x65')]['id'];_0x2b9726[_0xe1d7('0x66')]['id']=_0xcc2e08[_0xe1d7('0x5a')][_0xe1d7('0x64')];return db[_0xe1d7('0x3f')][_0xe1d7('0x58')]({'where':{'id':_0xcc2e08[_0xe1d7('0x5b')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x2aa9e7,null))['then'](function(_0x372cc6){if(_0x372cc6){_0x2b9726[_0xe1d7('0x2a')]=_0x372cc6[_0xe1d7('0x67')]({'plain':!![]});return db['WhatsappInteraction']['find']({'where':{'id':_0x372cc6[_0xe1d7('0x69')]}});}return null;})['then'](handleEntityNotFound(_0x2aa9e7,null))[_0xe1d7('0x22')](function(_0x373e75){if(_0x373e75){_0x2b9726['interaction']=_0x373e75[_0xe1d7('0x67')]({'plain':!![]});interaction_log[_0xe1d7('0x6d')](_0xe1d7('0x80'),_0xcc2e08[_0xe1d7('0x65')]['id'],_0xcc2e08[_0xe1d7('0x65')]['name'],_0xcc2e08['user']['role'],_0x2b9726[_0xe1d7('0x6c')]['id'],_0xcc2e08['body']?JSON[_0xe1d7('0x27')](_0xcc2e08['body']):'null');return respondWithRpcPromise(_0xe1d7('0x81'),_0xe1d7('0x82'),_0x2b9726);}return null;})[_0xe1d7('0x22')](function(_0x5f2011){var _0x59682d=_0xe1d7('0x72')+_0x5f2011[_0xe1d7('0x2a')][_0xe1d7('0x73')];return db[_0xe1d7('0x74')][_0xe1d7('0x43')](_0x59682d,{'type':db[_0xe1d7('0x75')][_0xe1d7('0x76')][_0xe1d7('0x83')],'raw':!![]})['then'](function(_0x21d4fd){return _0x21d4fd;});})['then'](function(_0x4c1ea8){if(_0x4c1ea8){_0x2b9726[_0xe1d7('0x2a')][_0xe1d7('0x84')]=_0x4c1ea8[0x0];if(!_0xcc2e08['body'][_0xe1d7('0x64')])return;return db[_0xe1d7('0x85')]['find']({'where':{'id':_0xcc2e08[_0xe1d7('0x5a')]['UserId'],'role':_0xe1d7('0x66')},'attributes':['id',_0xe1d7('0x3b'),_0xe1d7('0x77'),_0xe1d7('0x78'),'internal'],'raw':!![]});}return null;})[_0xe1d7('0x22')](function(_0x3e4b30){if(!_0x3e4b30)return null;_0x2b9726['message'][_0xe1d7('0x66')]=_0x3e4b30;return _0x2b9726;})[_0xe1d7('0x22')](function(_0xa7a28c){if(_0xa7a28c){_0xa7a28c[_0xe1d7('0x2a')][_0xe1d7('0x7a')]=util[_0xe1d7('0x62')](_0xe1d7('0x7b'),_0xcc2e08[_0xe1d7('0x65')][_0xe1d7('0x3b')]);_0xa7a28c[_0xe1d7('0x2a')]['channel']=_0x2b9726[_0xe1d7('0x7c')];_0xa7a28c['message']['motionChannel']=_0x2b9726[_0xe1d7('0x7c')];_0xa7a28c['message'][_0xe1d7('0x7d')]=_0xe1d7('0x36');respondWithRpcPromise(_0xe1d7('0x7e'),_0xe1d7('0x7e'),{'event':_0xe1d7('0x86'),'message':_0xa7a28c[_0xe1d7('0x2a')]},client9002);return _0x2b9726;}return null;})[_0xe1d7('0x22')](respondWithResult(_0x2aa9e7,null))[_0xe1d7('0x2b')](handleError(_0x2aa9e7,null));};exports[_0xe1d7('0x2c')]=function(_0x399c4b,_0x44fe2f,_0x48f93c){if(_0x399c4b[_0xe1d7('0x5a')]['id']){delete _0x399c4b[_0xe1d7('0x5a')]['id'];}var _0x5e14a6;return db[_0xe1d7('0x3f')]['find']({'where':{'id':_0x399c4b[_0xe1d7('0x5b')]['id']}})[_0xe1d7('0x22')](handleEntityNotFound(_0x44fe2f,null))['then'](function(_0x502682){if(_0x502682){_0x5e14a6=_0x502682;return db[_0xe1d7('0x87')][_0xe1d7('0x58')]({'where':{'id':_0x502682['WhatsappAccountId']}});}})[_0xe1d7('0x22')](handleEntityNotFound(_0x44fe2f,null))['then'](function(_0x15e1f9){if(_0x15e1f9){logger[_0xe1d7('0x25')](_0xe1d7('0x88'),_0xe1d7('0x2c'),'received\x20delivery\x20report\x20from',_0x15e1f9['type'],util[_0xe1d7('0x89')](_0x399c4b[_0xe1d7('0x5a')],{'showHidden':![],'depth':null}));switch(_0x15e1f9[_0xe1d7('0x50')]){case _0xe1d7('0x8a'):if(_0x399c4b[_0xe1d7('0x5a')][_0xe1d7('0x8b')]&&_0x399c4b[_0xe1d7('0x5a')][_0xe1d7('0x8b')]===_0x5e14a6[_0xe1d7('0x8c')]&&_0x399c4b[_0xe1d7('0x5a')][_0xe1d7('0x8d')]&&_0x399c4b[_0xe1d7('0x5a')][_0xe1d7('0x8d')]===_0xe1d7('0x60')){return _0x5e14a6['update']({'read':!![]});}else{logger[_0xe1d7('0x28')](_0xe1d7('0x8e'),_0xe1d7('0x2c'),_0xe1d7('0x8a'),util[_0xe1d7('0x89')](_0x399c4b[_0xe1d7('0x5a')],{'showHidden':![],'depth':null}));}break;}return _0x5e14a6;}})[_0xe1d7('0x22')](respondWithResult(_0x44fe2f,null))[_0xe1d7('0x2b')](handleError(_0x44fe2f,null));}; \ No newline at end of file +var _0x1397=['length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','include','rows','show','params','keys','includeAll','find','create','body','describe','whatsapp-interactions','accept','whatsapp','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','WhatsappInteraction','WhatsappInteractionId','isNil','interaction','role','stringify','null','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','contact','User','agent','email','internal','interface','SIP/%s','channel','motionChannel','EventManager','acceptmessage','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT','fullname','rejectmessage','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','MessageStatus','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','./whatsappMessage.socket','register','jayson/promise','client','http','request','then','request\x20sent','debug','error','code','WhatsappMessage,\x20%s,\x20%s','message','info','result','catch','sendStatus','status','offset','limit','undefined','count','set','Content-Range','json','reject','save','update','destroy','end','stack','name','send','index','map','WhatsappMessage','rawAttributes','fieldName','type','query','filters','intersection','model','fields','attributes'];(function(_0x9871cd,_0x3494ef){var _0x4d9aba=function(_0x1b644d){while(--_0x1b644d){_0x9871cd['push'](_0x9871cd['shift']());}};_0x4d9aba(++_0x3494ef);}(_0x1397,0x1e7));var _0x7139=function(_0x1ca282,_0x38ad9b){_0x1ca282=_0x1ca282-0x0;var _0x3c92eb=_0x1397[_0x1ca282];return _0x3c92eb;};'use strict';var emlformat=require(_0x7139('0x0'));var rimraf=require(_0x7139('0x1'));var zipdir=require(_0x7139('0x2'));var jsonpatch=require(_0x7139('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x7139('0x4'));var Mustache=require(_0x7139('0x5'));var util=require('util');var path=require(_0x7139('0x6'));var sox=require('sox');var csv=require(_0x7139('0x7'));var ejs=require(_0x7139('0x8'));var fs=require('fs');var fs_extra=require(_0x7139('0x9'));var _=require(_0x7139('0xa'));var squel=require(_0x7139('0xb'));var crypto=require(_0x7139('0xc'));var jsforce=require(_0x7139('0xd'));var deskjs=require(_0x7139('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7139('0xf'));var Redis=require(_0x7139('0x10'));var authService=require(_0x7139('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x7139('0x12'));var hardwareService=require(_0x7139('0x13'));var logger=require(_0x7139('0x14'))(_0x7139('0x15'));var utils=require(_0x7139('0x16'));var config=require(_0x7139('0x17'));var licenseUtil=require(_0x7139('0x18'));var db=require('../../mysqldb')['db'];config[_0x7139('0x19')]=_[_0x7139('0x1a')](config[_0x7139('0x19')],{'host':_0x7139('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7139('0x19')]));require(_0x7139('0x1c'))[_0x7139('0x1d')](socket);var jayson=require(_0x7139('0x1e'));var client=jayson[_0x7139('0x1f')][_0x7139('0x20')]({'port':0x232c});var client9002=jayson['client'][_0x7139('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x501efa,_0x4b077d,_0x48a288,_0x59a968){return new BPromise(function(_0x29d03a,_0x1d85b1){var _0x3a95db=_0x59a968||client;return _0x3a95db[_0x7139('0x21')](_0x501efa,_0x48a288)[_0x7139('0x22')](function(_0x484da9){logger['info']('WhatsappMessage,\x20%s,\x20%s',_0x4b077d,_0x7139('0x23'));logger[_0x7139('0x24')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x4b077d,_0x7139('0x23'),JSON['stringify'](_0x484da9));if(_0x484da9[_0x7139('0x25')]){if(_0x484da9[_0x7139('0x25')][_0x7139('0x26')]===0x1f4){logger[_0x7139('0x25')](_0x7139('0x27'),_0x4b077d,_0x484da9[_0x7139('0x25')]['message']);return _0x1d85b1(_0x484da9[_0x7139('0x25')][_0x7139('0x28')]);}logger['error'](_0x7139('0x27'),_0x4b077d,_0x484da9[_0x7139('0x25')][_0x7139('0x28')]);return _0x29d03a(_0x484da9[_0x7139('0x25')]['message']);}else{logger[_0x7139('0x29')]('WhatsappMessage,\x20%s,\x20%s',_0x4b077d,_0x7139('0x23'));_0x29d03a(_0x484da9[_0x7139('0x2a')][_0x7139('0x28')]);}})[_0x7139('0x2b')](function(_0x5cef4d){logger[_0x7139('0x25')](_0x7139('0x27'),_0x4b077d,_0x5cef4d);_0x1d85b1(_0x5cef4d);});});}function respondWithStatusCode(_0x493486,_0x52329b){_0x52329b=_0x52329b||0xcc;return function(_0x1d53ac){if(_0x1d53ac){return _0x493486[_0x7139('0x2c')](_0x52329b);}return _0x493486[_0x7139('0x2d')](_0x52329b)['end']();};}function respondWithResult(_0x5051e1,_0x51bee8){_0x51bee8=_0x51bee8||0xc8;return function(_0x18cd48){if(_0x18cd48){return _0x5051e1[_0x7139('0x2d')](_0x51bee8)['json'](_0x18cd48);}};}function respondWithFilteredResult(_0x4b5302,_0xcfa373){return function(_0x12887b){if(_0x12887b){var _0x2dc24c=typeof _0xcfa373[_0x7139('0x2e')]==='undefined'&&typeof _0xcfa373[_0x7139('0x2f')]===_0x7139('0x30');var _0x179a9b=_0x12887b[_0x7139('0x31')];var _0x468aad=_0x2dc24c?0x0:_0xcfa373['offset'];var _0x96a5e2=_0x2dc24c?_0x12887b['count']:_0xcfa373[_0x7139('0x2e')]+_0xcfa373[_0x7139('0x2f')];var _0x1a355c;if(_0x96a5e2>=_0x179a9b){_0x96a5e2=_0x179a9b;_0x1a355c=0xc8;}else{_0x1a355c=0xce;}_0x4b5302[_0x7139('0x2d')](_0x1a355c);return _0x4b5302[_0x7139('0x32')](_0x7139('0x33'),_0x468aad+'-'+_0x96a5e2+'/'+_0x179a9b)[_0x7139('0x34')](_0x12887b);}return null;};}function patchUpdates(_0x318fac){return function(_0x521aa2){try{jsonpatch['apply'](_0x521aa2,_0x318fac,!![]);}catch(_0x3fcf7c){return BPromise[_0x7139('0x35')](_0x3fcf7c);}return _0x521aa2[_0x7139('0x36')]();};}function saveUpdates(_0x2d3239,_0x1c079e){return function(_0x44a67c){if(_0x44a67c){return _0x44a67c[_0x7139('0x37')](_0x2d3239)[_0x7139('0x22')](function(_0x5668fc){return _0x5668fc;});}return null;};}function removeEntity(_0x5ab55d,_0x484481){return function(_0x21a684){if(_0x21a684){return _0x21a684[_0x7139('0x38')]()['then'](function(){_0x5ab55d[_0x7139('0x2d')](0xcc)[_0x7139('0x39')]();});}};}function handleEntityNotFound(_0x47166d,_0x23623b){return function(_0x5be726){if(!_0x5be726){_0x47166d[_0x7139('0x2c')](0x194);}return _0x5be726;};}function handleError(_0x3e311a,_0x14a13e){_0x14a13e=_0x14a13e||0x1f4;return function(_0x45ef5d){logger['error'](_0x45ef5d[_0x7139('0x3a')]);if(_0x45ef5d[_0x7139('0x3b')]){delete _0x45ef5d[_0x7139('0x3b')];}_0x3e311a['status'](_0x14a13e)[_0x7139('0x3c')](_0x45ef5d);};}exports[_0x7139('0x3d')]=function(_0x49be11,_0x345894){var _0x3a69b3={},_0x22c7d2={},_0x1d5957={'count':0x0,'rows':[]};var _0x507ced=_[_0x7139('0x3e')](db[_0x7139('0x3f')][_0x7139('0x40')],function(_0xb5de6b){return{'name':_0xb5de6b[_0x7139('0x41')],'type':_0xb5de6b[_0x7139('0x42')]['key']};});_0x22c7d2['model']=_[_0x7139('0x3e')](_0x507ced,_0x7139('0x3b'));_0x22c7d2[_0x7139('0x43')]=_['keys'](_0x49be11[_0x7139('0x43')]);_0x22c7d2[_0x7139('0x44')]=_[_0x7139('0x45')](_0x22c7d2[_0x7139('0x46')],_0x22c7d2[_0x7139('0x43')]);_0x3a69b3['attributes']=_[_0x7139('0x45')](_0x22c7d2[_0x7139('0x46')],qs[_0x7139('0x47')](_0x49be11[_0x7139('0x43')][_0x7139('0x47')]));_0x3a69b3[_0x7139('0x48')]=_0x3a69b3[_0x7139('0x48')][_0x7139('0x49')]?_0x3a69b3['attributes']:_0x22c7d2[_0x7139('0x46')];if(!_0x49be11[_0x7139('0x43')][_0x7139('0x4a')]('nolimit')){_0x3a69b3[_0x7139('0x2f')]=qs[_0x7139('0x2f')](_0x49be11[_0x7139('0x43')]['limit']);_0x3a69b3[_0x7139('0x2e')]=qs[_0x7139('0x2e')](_0x49be11[_0x7139('0x43')]['offset']);}_0x3a69b3[_0x7139('0x4b')]=qs[_0x7139('0x4c')](_0x49be11[_0x7139('0x43')][_0x7139('0x4c')]);_0x3a69b3[_0x7139('0x4d')]=qs[_0x7139('0x44')](_[_0x7139('0x4e')](_0x49be11[_0x7139('0x43')],_0x22c7d2['filters']),_0x507ced);if(_0x49be11['query'][_0x7139('0x4f')]){_0x3a69b3[_0x7139('0x4d')]=_[_0x7139('0x50')](_0x3a69b3[_0x7139('0x4d')],{'$or':_[_0x7139('0x3e')](_0x507ced,function(_0x391e57){if(_0x391e57[_0x7139('0x42')]!==_0x7139('0x51')){var _0x49689e={};_0x49689e[_0x391e57[_0x7139('0x3b')]]={'$like':'%'+_0x49be11['query'][_0x7139('0x4f')]+'%'};return _0x49689e;}})});}_0x3a69b3=_[_0x7139('0x50')]({},_0x3a69b3,_0x49be11[_0x7139('0x52')]);var _0x52dbda={'where':_0x3a69b3['where']};return db[_0x7139('0x3f')][_0x7139('0x31')](_0x52dbda)[_0x7139('0x22')](function(_0x180c77){_0x1d5957[_0x7139('0x31')]=_0x180c77;if(_0x49be11[_0x7139('0x43')]['includeAll']){_0x3a69b3[_0x7139('0x53')]=[{'all':!![]}];}return db[_0x7139('0x3f')]['findAll'](_0x3a69b3);})[_0x7139('0x22')](function(_0x5df8bc){_0x1d5957[_0x7139('0x54')]=_0x5df8bc;return _0x1d5957;})[_0x7139('0x22')](respondWithFilteredResult(_0x345894,_0x3a69b3))[_0x7139('0x2b')](handleError(_0x345894,null));};exports[_0x7139('0x55')]=function(_0x1993bb,_0xf7cdf9){var _0x15b57e={'raw':!![],'where':{'id':_0x1993bb[_0x7139('0x56')]['id']}},_0x32d3ee={};_0x32d3ee[_0x7139('0x46')]=_[_0x7139('0x57')](db[_0x7139('0x3f')][_0x7139('0x40')]);_0x32d3ee['query']=_[_0x7139('0x57')](_0x1993bb[_0x7139('0x43')]);_0x32d3ee[_0x7139('0x44')]=_[_0x7139('0x45')](_0x32d3ee[_0x7139('0x46')],_0x32d3ee['query']);_0x15b57e[_0x7139('0x48')]=_[_0x7139('0x45')](_0x32d3ee[_0x7139('0x46')],qs[_0x7139('0x47')](_0x1993bb['query'][_0x7139('0x47')]));_0x15b57e['attributes']=_0x15b57e[_0x7139('0x48')][_0x7139('0x49')]?_0x15b57e[_0x7139('0x48')]:_0x32d3ee[_0x7139('0x46')];if(_0x1993bb[_0x7139('0x43')][_0x7139('0x58')]){_0x15b57e[_0x7139('0x53')]=[{'all':!![]}];}_0x15b57e=_['merge']({},_0x15b57e,_0x1993bb[_0x7139('0x52')]);return db[_0x7139('0x3f')][_0x7139('0x59')](_0x15b57e)[_0x7139('0x22')](handleEntityNotFound(_0xf7cdf9,null))[_0x7139('0x22')](respondWithResult(_0xf7cdf9,null))[_0x7139('0x2b')](handleError(_0xf7cdf9,null));};exports['create']=function(_0x2f8272,_0x54d9af){return db[_0x7139('0x3f')][_0x7139('0x5a')](_0x2f8272['body'],{})[_0x7139('0x22')](respondWithResult(_0x54d9af,0xc9))[_0x7139('0x2b')](handleError(_0x54d9af,null));};exports[_0x7139('0x37')]=function(_0x46b299,_0x203b24){if(_0x46b299[_0x7139('0x5b')]['id']){delete _0x46b299['body']['id'];}return db[_0x7139('0x3f')][_0x7139('0x59')]({'where':{'id':_0x46b299[_0x7139('0x56')]['id']}})['then'](handleEntityNotFound(_0x203b24,null))[_0x7139('0x22')](saveUpdates(_0x46b299[_0x7139('0x5b')],null))[_0x7139('0x22')](respondWithResult(_0x203b24,null))[_0x7139('0x2b')](handleError(_0x203b24,null));};exports['destroy']=function(_0x362be4,_0x329a0b){return db[_0x7139('0x3f')]['find']({'where':{'id':_0x362be4[_0x7139('0x56')]['id']}})['then'](handleEntityNotFound(_0x329a0b,null))[_0x7139('0x22')](removeEntity(_0x329a0b,null))['catch'](handleError(_0x329a0b,null));};exports[_0x7139('0x5c')]=function(_0x3eb721,_0x5114d5){return db[_0x7139('0x3f')][_0x7139('0x5c')]()[_0x7139('0x22')](respondWithResult(_0x5114d5,null))['catch'](handleError(_0x5114d5,null));};var interaction_log=require(_0x7139('0x14'))(_0x7139('0x5d'));exports[_0x7139('0x5e')]=function(_0x550de5,_0x2be451,_0xf17391){var _0x5cb88b={'agent':{},'channel':_0x7139('0x5f')};if(_0x550de5[_0x7139('0x5b')]['id']){delete _0x550de5[_0x7139('0x5b')]['id'];}_0x550de5[_0x7139('0x5b')]['read']=!![];_0x550de5[_0x7139('0x5b')][_0x7139('0x60')]=moment()[_0x7139('0x61')](_0x7139('0x62'));_0x550de5[_0x7139('0x5b')][_0x7139('0x63')]=_0x550de5[_0x7139('0x5b')][_0x7139('0x63')]||_0x550de5[_0x7139('0x64')]['id'];_0x5cb88b['agent']['id']=_0x550de5[_0x7139('0x5b')]['UserId'];return db[_0x7139('0x3f')][_0x7139('0x59')]({'where':{'id':_0x550de5[_0x7139('0x56')]['id'],'UserId':null}})[_0x7139('0x22')](handleEntityNotFound(_0x2be451,null))[_0x7139('0x22')](saveUpdates(_0x550de5[_0x7139('0x5b')],null))[_0x7139('0x22')](function(_0x332426){if(_0x332426){_0x5cb88b[_0x7139('0x28')]=_0x332426[_0x7139('0x65')]({'plain':!![]});return db[_0x7139('0x66')][_0x7139('0x59')]({'where':{'id':_0x332426[_0x7139('0x67')]}});}return null;})['then'](handleEntityNotFound(_0x2be451,null))[_0x7139('0x22')](function(_0x18343d){if(_0x18343d){return _0x18343d[_0x7139('0x37')]({'UserId':_0x550de5[_0x7139('0x5b')]['UserId'],'read1stAt':_[_0x7139('0x68')](_0x18343d['read1stAt'])?moment()[_0x7139('0x61')](_0x7139('0x62')):undefined});}return null;})['then'](function(_0x4a7a67){if(_0x4a7a67){_0x5cb88b[_0x7139('0x69')]=_0x4a7a67[_0x7139('0x65')]({'plain':!![]});interaction_log[_0x7139('0x29')]('[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x550de5[_0x7139('0x64')]['id'],_0x550de5[_0x7139('0x64')][_0x7139('0x3b')],_0x550de5[_0x7139('0x64')][_0x7139('0x6a')],_0x5cb88b[_0x7139('0x69')]['id'],_0x550de5[_0x7139('0x5b')]?JSON[_0x7139('0x6b')](_0x550de5['body']):_0x7139('0x6c'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x5cb88b);}return null;})[_0x7139('0x22')](function(_0xef8af5){var _0x1fedef=_0x7139('0x6d')+_0xef8af5[_0x7139('0x28')][_0x7139('0x6e')];return db[_0x7139('0x6f')]['query'](_0x1fedef,{'type':db[_0x7139('0x70')][_0x7139('0x71')]['SELECT'],'raw':!![]})['then'](function(_0x2523c8){return _0x2523c8;});})[_0x7139('0x22')](function(_0x43999a){if(_0x43999a){_0x5cb88b[_0x7139('0x28')][_0x7139('0x72')]=_0x43999a[0x0];if(!_0x550de5[_0x7139('0x5b')][_0x7139('0x63')])return;return db[_0x7139('0x73')][_0x7139('0x59')]({'where':{'id':_0x550de5[_0x7139('0x5b')][_0x7139('0x63')],'role':_0x7139('0x74')},'attributes':['id',_0x7139('0x3b'),'fullname',_0x7139('0x75'),_0x7139('0x76')],'raw':!![]});}return null;})[_0x7139('0x22')](function(_0x5a7b19){if(!_0x5a7b19)return null;_0x5cb88b[_0x7139('0x28')][_0x7139('0x74')]=_0x5a7b19;return _0x5cb88b;})[_0x7139('0x22')](function(_0x1228ca){if(_0x1228ca){if(_0x550de5[_0x7139('0x5b')]['manual']){_0x5cb88b[_0x7139('0x28')][_0x7139('0x77')]=util['format'](_0x7139('0x78'),_0x550de5[_0x7139('0x64')]['name']);_0x5cb88b[_0x7139('0x28')]['channel']=_0x5cb88b[_0x7139('0x79')];_0x5cb88b[_0x7139('0x28')][_0x7139('0x7a')]=_0x5cb88b[_0x7139('0x79')];_0x5cb88b[_0x7139('0x28')]['event']='accept';return respondWithRpcPromise('EventManager',_0x7139('0x7b'),{'event':_0x7139('0x7c'),'message':_0x5cb88b[_0x7139('0x28')]},client9002)[_0x7139('0x22')](function(){return _0x5cb88b;});}return _0x5cb88b;}return null;})['then'](respondWithResult(_0x2be451,null))[_0x7139('0x2b')](handleError(_0x2be451,null));};var interaction_log=require(_0x7139('0x14'))('whatsapp-interactions');exports[_0x7139('0x35')]=function(_0x162ee2,_0x100248,_0x4be59b){var _0x481b75={'agent':{},'channel':_0x7139('0x5f')};if(_0x162ee2[_0x7139('0x5b')]['id']){delete _0x162ee2[_0x7139('0x5b')]['id'];}_0x162ee2[_0x7139('0x5b')][_0x7139('0x63')]=_0x162ee2[_0x7139('0x5b')]['UserId']||_0x162ee2[_0x7139('0x64')]['id'];_0x481b75[_0x7139('0x74')]['id']=_0x162ee2[_0x7139('0x5b')][_0x7139('0x63')];return db['WhatsappMessage'][_0x7139('0x59')]({'where':{'id':_0x162ee2[_0x7139('0x56')]['id'],'UserId':null}})[_0x7139('0x22')](handleEntityNotFound(_0x100248,null))[_0x7139('0x22')](function(_0x57d18b){if(_0x57d18b){_0x481b75[_0x7139('0x28')]=_0x57d18b['get']({'plain':!![]});return db[_0x7139('0x66')][_0x7139('0x59')]({'where':{'id':_0x57d18b[_0x7139('0x67')]}});}return null;})[_0x7139('0x22')](handleEntityNotFound(_0x100248,null))[_0x7139('0x22')](function(_0x18a759){if(_0x18a759){_0x481b75['interaction']=_0x18a759['get']({'plain':!![]});interaction_log[_0x7139('0x29')](_0x7139('0x7d'),_0x162ee2[_0x7139('0x64')]['id'],_0x162ee2['user'][_0x7139('0x3b')],_0x162ee2[_0x7139('0x64')][_0x7139('0x6a')],_0x481b75['interaction']['id'],_0x162ee2[_0x7139('0x5b')]?JSON['stringify'](_0x162ee2[_0x7139('0x5b')]):'null');return respondWithRpcPromise(_0x7139('0x7e'),_0x7139('0x7f'),_0x481b75);}return null;})[_0x7139('0x22')](function(_0x1ccf6d){var _0xb93fcf=_0x7139('0x6d')+_0x1ccf6d['message'][_0x7139('0x6e')];return db[_0x7139('0x6f')]['query'](_0xb93fcf,{'type':db['Sequelize'][_0x7139('0x71')][_0x7139('0x80')],'raw':!![]})[_0x7139('0x22')](function(_0x53b4f7){return _0x53b4f7;});})[_0x7139('0x22')](function(_0xda3de8){if(_0xda3de8){_0x481b75[_0x7139('0x28')][_0x7139('0x72')]=_0xda3de8[0x0];if(!_0x162ee2[_0x7139('0x5b')][_0x7139('0x63')])return;return db[_0x7139('0x73')][_0x7139('0x59')]({'where':{'id':_0x162ee2[_0x7139('0x5b')][_0x7139('0x63')],'role':'agent'},'attributes':['id',_0x7139('0x3b'),_0x7139('0x81'),_0x7139('0x75'),'internal'],'raw':!![]});}return null;})[_0x7139('0x22')](function(_0x49c23a){if(!_0x49c23a)return null;_0x481b75[_0x7139('0x28')][_0x7139('0x74')]=_0x49c23a;return _0x481b75;})[_0x7139('0x22')](function(_0x571383){if(_0x571383){_0x571383[_0x7139('0x28')][_0x7139('0x77')]=util['format'](_0x7139('0x78'),_0x162ee2[_0x7139('0x64')][_0x7139('0x3b')]);_0x571383[_0x7139('0x28')][_0x7139('0x79')]=_0x481b75[_0x7139('0x79')];_0x571383[_0x7139('0x28')][_0x7139('0x7a')]=_0x481b75[_0x7139('0x79')];_0x571383[_0x7139('0x28')]['event']=_0x7139('0x35');respondWithRpcPromise(_0x7139('0x7b'),_0x7139('0x7b'),{'event':_0x7139('0x82'),'message':_0x571383[_0x7139('0x28')]},client9002);return _0x481b75;}return null;})[_0x7139('0x22')](respondWithResult(_0x100248,null))[_0x7139('0x2b')](handleError(_0x100248,null));};exports[_0x7139('0x2d')]=function(_0x20f4da,_0x206c21,_0xffa9c1){if(_0x20f4da['body']['id']){delete _0x20f4da[_0x7139('0x5b')]['id'];}var _0x2734da;return db[_0x7139('0x3f')][_0x7139('0x59')]({'where':{'id':_0x20f4da[_0x7139('0x56')]['id']}})[_0x7139('0x22')](handleEntityNotFound(_0x206c21,null))[_0x7139('0x22')](function(_0x358263){if(_0x358263){_0x2734da=_0x358263;return db[_0x7139('0x83')]['find']({'where':{'id':_0x358263[_0x7139('0x84')]}});}})[_0x7139('0x22')](handleEntityNotFound(_0x206c21,null))[_0x7139('0x22')](function(_0x468511){if(_0x468511){logger['debug'](_0x7139('0x85'),'status',_0x7139('0x86'),_0x468511[_0x7139('0x42')],util[_0x7139('0x87')](_0x20f4da[_0x7139('0x5b')],{'showHidden':![],'depth':null}));switch(_0x468511[_0x7139('0x42')]){case _0x7139('0x88'):if(_0x20f4da[_0x7139('0x5b')]['MessageSid']&&_0x20f4da['body'][_0x7139('0x89')]===_0x2734da[_0x7139('0x8a')]&&_0x20f4da[_0x7139('0x5b')][_0x7139('0x8b')]&&_0x20f4da[_0x7139('0x5b')][_0x7139('0x8b')]==='read'){return _0x2734da[_0x7139('0x37')]({'read':!![]});}else{logger[_0x7139('0x25')]('WhatsappAccount,\x20%s,\x20%s,\x20%s','status',_0x7139('0x88'),util[_0x7139('0x87')](_0x20f4da[_0x7139('0x5b')],{'showHidden':![],'depth':null}));}break;}return _0x2734da;}})[_0x7139('0x22')](respondWithResult(_0x206c21,null))[_0x7139('0x2b')](handleError(_0x206c21,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index d9b7a53..e169b74 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 _0x0db9=['hook','exports','events','save','update','emit','hasOwnProperty'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0db9,0xa3));var _0x90db=function(_0x4bfcbe,_0x4630f5){_0x4bfcbe=_0x4bfcbe-0x0;var _0x5b65e6=_0x0db9[_0x4bfcbe];return _0x5b65e6;};'use strict';var EventEmitter=require(_0x90db('0x0'));var WhatsappMessage=require('../../mysqldb')['db']['WhatsappMessage'];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x90db('0x1'),'afterUpdate':_0x90db('0x2'),'afterDestroy':'remove'};function emitEvent(_0x2da262){return function(_0x500dcf,_0x1e0f41,_0x29b59f){WhatsappMessageEvents['emit'](_0x2da262+':'+_0x500dcf['id'],_0x500dcf);WhatsappMessageEvents[_0x90db('0x3')](_0x2da262,_0x500dcf);_0x29b59f(null);};}for(var e in events){if(events[_0x90db('0x4')](e)){var event=events[e];WhatsappMessage[_0x90db('0x5')](e,emitEvent(event));}}module[_0x90db('0x6')]=WhatsappMessageEvents; \ No newline at end of file +var _0x7072=['save','update','emit','hasOwnProperty','hook','exports','../../mysqldb','WhatsappMessage','setMaxListeners'];(function(_0x175f79,_0x7fed9){var _0x5005da=function(_0x27ab74){while(--_0x27ab74){_0x175f79['push'](_0x175f79['shift']());}};_0x5005da(++_0x7fed9);}(_0x7072,0x138));var _0x2707=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x7072[_0x160c73];return _0xd9302;};'use strict';var EventEmitter=require('events');var WhatsappMessage=require(_0x2707('0x0'))['db'][_0x2707('0x1')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x2707('0x2')](0x0);var events={'afterCreate':_0x2707('0x3'),'afterUpdate':_0x2707('0x4'),'afterDestroy':'remove'};function emitEvent(_0x5af54f){return function(_0xfdfa7a,_0x5f3c1c,_0xd36287){WhatsappMessageEvents[_0x2707('0x5')](_0x5af54f+':'+_0xfdfa7a['id'],_0xfdfa7a);WhatsappMessageEvents[_0x2707('0x5')](_0x5af54f,_0xfdfa7a);_0xd36287(null);};}for(var e in events){if(events[_0x2707('0x6')](e)){var event=events[e];WhatsappMessage[_0x2707('0x7')](e,emitEvent(event));}}module[_0x2707('0x8')]=WhatsappMessageEvents; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.model.js b/server/api/whatsappMessage/whatsappMessage.model.js index 984a846..d5286e9 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 _0x851e=['catch','error','find','type','twilio','accountSid','authToken','phone','messages','whatsapp:','remote','/api/whatsapp/messages/','/status?token=','token','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','baseUrl','/whatsapp/v1/','text','POST','Bearer\x20','application/json','statuses','message_id','err','WhatsappMessage,\x20%s','finally','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','request-promise','node-fetch','path','rimraf','./whatsappMessage.attributes','exports','define','whatsapp_messages','fti_whatsapp_messages','body','FULLTEXT','models','get','toLowerCase','direction','out','isNil','WhatsappInteraction','findOne','then','update'];(function(_0x21f86d,_0x5df318){var _0x1c8bf7=function(_0x1b87a2){while(--_0x1b87a2){_0x21f86d['push'](_0x21f86d['shift']());}};_0x1c8bf7(++_0x5df318);}(_0x851e,0x1e8));var _0xe851=function(_0x508167,_0x2a24ec){_0x508167=_0x508167-0x0;var _0x5e7a78=_0x851e[_0x508167];return _0x5e7a78;};'use strict';var _=require(_0xe851('0x0'));var util=require(_0xe851('0x1'));var logger=require(_0xe851('0x2'))('api');var moment=require('moment');var BPromise=require(_0xe851('0x3'));var rp=require(_0xe851('0x4'));var fetch=require(_0xe851('0x5'));var fs=require('fs');var path=require(_0xe851('0x6'));var rimraf=require(_0xe851('0x7'));var config=require('../../config/environment');var attributes=require(_0xe851('0x8'));module[_0xe851('0x9')]=function(_0xba0648,_0x37ac0b){return _0xba0648[_0xe851('0xa')]('WhatsappMessage',attributes,{'tableName':_0xe851('0xb'),'paranoid':![],'indexes':[{'name':'messageId','fields':['messageId']},{'name':_0xe851('0xc'),'fields':[_0xe851('0xd')],'type':_0xe851('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0xe0cb8d,_0x4e5eca,_0x3325f5){var _0xd5d71c=_0xba0648[_0xe851('0xf')];var _0x4e360f=_0xe0cb8d[_0xe851('0x10')]({'plain':!![]});if(_0x4e360f['direction'][_0xe851('0x11')]()==='in'||_0x4e360f[_0xe851('0x12')]['toLowerCase']()===_0xe851('0x13')&&!_0x4e360f['secret']&&!_[_0xe851('0x14')](_0x4e360f['UserId'])){_0xd5d71c[_0xe851('0x15')][_0xe851('0x16')]({'where':{'id':_0x4e360f['WhatsappInteractionId']}})[_0xe851('0x17')](function(_0x3ba4cb){if(_0x3ba4cb){_0x3ba4cb[_0xe851('0x18')]({'lastMsgAt':_0x4e360f['createdAt'],'lastMsgDirection':_0x4e360f['direction'][_0xe851('0x11')]()});}})[_0xe851('0x19')](function(_0x1c7181){console[_0xe851('0x1a')](_0x1c7181);});}if(_0x4e360f[_0xe851('0x12')]===_0xe851('0x13')&&!_0x4e360f['secret']){var _0xa8a883;_0xd5d71c['WhatsappAccount'][_0xe851('0x1b')]({'where':{'id':_0x4e360f['WhatsappAccountId']},'raw':!![]})[_0xe851('0x17')](function(_0x51d5ba){_0xa8a883=_0x51d5ba;if(_0xa8a883&&_0xa8a883[_0xe851('0x1c')]){switch(_0xa8a883[_0xe851('0x1c')]){case _0xe851('0x1d'):var _0x1adceb=require(_0xe851('0x1d'));if(_0xa8a883[_0xe851('0x1e')]&&_0xa8a883[_0xe851('0x1f')]&&_0xa8a883[_0xe851('0x20')]){var _0x4d1c54=new _0x1adceb(_0xa8a883[_0xe851('0x1e')],_0xa8a883['authToken']);_0x4d1c54[_0xe851('0x21')]['create']({'body':_0x4e360f[_0xe851('0xd')],'to':_0xe851('0x22')+_0x4e360f['phone'],'from':'whatsapp:'+_0xa8a883[_0xe851('0x20')],'statusCallback':_0xa8a883[_0xe851('0x23')]+_0xe851('0x24')+_0x4e360f['id']+_0xe851('0x25')+_0xa8a883[_0xe851('0x26')]})[_0xe851('0x17')](function(_0x4ce93a){if(_0x4ce93a[_0xe851('0x27')]){return _0xe0cb8d[_0xe851('0x18')]({'messageId':_0x4ce93a['sid']});}})['catch'](function(_0x40af50){logger['error'](_0xe851('0x28'),_0xe851('0x29'),_0xe851('0x1d'),util[_0xe851('0x2a')](_0x40af50,{'showHidden':![],'depth':null}));});}else{logger[_0xe851('0x1a')](_0xe851('0x28'),_0xe851('0x29'),_0xe851('0x1d'),_0xe851('0x2b'));}break;case _0xe851('0x2c'):var _0x595de7=_0xa8a883['accountSid'];var _0x5d2a79=_0xa8a883[_0xe851('0x1f')];var _0x3a8631=_0xa8a883[_0xe851('0x2d')]+_0xe851('0x2e')+_0x595de7+'/messages/';var _0x4d9d17={'to':[_0x4e360f[_0xe851('0x20')]],'message':{'type':_0xe851('0x2f'),'text':_0x4e360f[_0xe851('0xd')]}};var _0x7d1569={'method':_0xe851('0x30'),'uri':_0x3a8631,'headers':{'Authorization':_0xe851('0x31')+_0x5d2a79,'Content-Type':_0xe851('0x32')},'body':_0x4d9d17,'json':!![]};rp(_0x7d1569)['then'](function(_0x5e6840){if(_0x5e6840[_0xe851('0x33')][0x0][_0xe851('0x34')]){return _0xe0cb8d[_0xe851('0x18')]({'messageId':_0x5e6840[_0xe851('0x33')][0x0][_0xe851('0x34')]});}})[_0xe851('0x19')](function(_0x31a9bd){logger[_0xe851('0x35')](_0xe851('0x36'),_0x31a9bd);});break;}}})[_0xe851('0x37')](function(){_0x3325f5();});}else{_0x3325f5();}}},'charset':'utf8mb4','collate':_0xe851('0x38')});}; \ No newline at end of file +var _0x3ee8=['bluebird','node-fetch','rimraf','../../config/environment','exports','define','WhatsappMessage','whatsapp_messages','messageId','fti_whatsapp_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','WhatsappInteraction','findOne','WhatsappInteractionId','update','createdAt','catch','error','WhatsappAccount','find','WhatsappAccountId','then','type','twilio','authToken','phone','accountSid','messages','create','whatsapp:','token','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','sinch','Bearer\x20','application/json','statuses','message_id','WhatsappMessage,\x20%s','utf8mb4_unicode_ci','lodash','util'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x3ee8,0x136));var _0x83ee=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3ee8[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x83ee('0x0'));var util=require(_0x83ee('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x83ee('0x2'));var rp=require('request-promise');var fetch=require(_0x83ee('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x83ee('0x4'));var config=require(_0x83ee('0x5'));var attributes=require('./whatsappMessage.attributes');module[_0x83ee('0x6')]=function(_0x557f4a,_0xf29543){return _0x557f4a[_0x83ee('0x7')](_0x83ee('0x8'),attributes,{'tableName':_0x83ee('0x9'),'paranoid':![],'indexes':[{'name':_0x83ee('0xa'),'fields':['messageId']},{'name':_0x83ee('0xb'),'fields':[_0x83ee('0xc')],'type':_0x83ee('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x544a1b,_0x7bdd73,_0x538550){var _0x4a40c3=_0x557f4a[_0x83ee('0xe')];var _0x4d09ce=_0x544a1b[_0x83ee('0xf')]({'plain':!![]});if(_0x4d09ce[_0x83ee('0x10')][_0x83ee('0x11')]()==='in'||_0x4d09ce[_0x83ee('0x10')][_0x83ee('0x11')]()===_0x83ee('0x12')&&!_0x4d09ce[_0x83ee('0x13')]&&!_[_0x83ee('0x14')](_0x4d09ce[_0x83ee('0x15')])){_0x4a40c3[_0x83ee('0x16')][_0x83ee('0x17')]({'where':{'id':_0x4d09ce[_0x83ee('0x18')]}})['then'](function(_0x263813){if(_0x263813){_0x263813[_0x83ee('0x19')]({'lastMsgAt':_0x4d09ce[_0x83ee('0x1a')],'lastMsgDirection':_0x4d09ce[_0x83ee('0x10')]['toLowerCase']()});}})[_0x83ee('0x1b')](function(_0x49a93e){console[_0x83ee('0x1c')](_0x49a93e);});}if(_0x4d09ce[_0x83ee('0x10')]==='out'&&!_0x4d09ce['secret']){var _0x578495;_0x4a40c3[_0x83ee('0x1d')][_0x83ee('0x1e')]({'where':{'id':_0x4d09ce[_0x83ee('0x1f')]},'raw':!![]})[_0x83ee('0x20')](function(_0x3cc0c0){_0x578495=_0x3cc0c0;if(_0x578495&&_0x578495[_0x83ee('0x21')]){switch(_0x578495['type']){case _0x83ee('0x22'):var _0x541e63=require(_0x83ee('0x22'));if(_0x578495['accountSid']&&_0x578495[_0x83ee('0x23')]&&_0x578495[_0x83ee('0x24')]){var _0x1b9d5c=new _0x541e63(_0x578495[_0x83ee('0x25')],_0x578495['authToken']);_0x1b9d5c[_0x83ee('0x26')][_0x83ee('0x27')]({'body':_0x4d09ce[_0x83ee('0xc')],'to':_0x83ee('0x28')+_0x4d09ce['phone'],'from':_0x83ee('0x28')+_0x578495[_0x83ee('0x24')],'statusCallback':_0x578495['remote']+'/api/whatsapp/messages/'+_0x4d09ce['id']+'/status?token='+_0x578495[_0x83ee('0x29')]})[_0x83ee('0x20')](function(_0x3cdd80){if(_0x3cdd80[_0x83ee('0x2a')]){return _0x544a1b[_0x83ee('0x19')]({'messageId':_0x3cdd80['sid']});}})[_0x83ee('0x1b')](function(_0x4b572b){logger['error'](_0x83ee('0x2b'),_0x83ee('0x2c'),'twilio',util['inspect'](_0x4b572b,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x83ee('0x2b'),'afterCreate','twilio','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0x83ee('0x2d'):var _0x84c1da=_0x578495[_0x83ee('0x25')];var _0xa4b30f=_0x578495[_0x83ee('0x23')];var _0x593492=_0x578495['baseUrl']+'/whatsapp/v1/'+_0x84c1da+'/messages/';var _0x50b189={'to':[_0x4d09ce['phone']],'message':{'type':'text','text':_0x4d09ce[_0x83ee('0xc')]}};var _0x31237a={'method':'POST','uri':_0x593492,'headers':{'Authorization':_0x83ee('0x2e')+_0xa4b30f,'Content-Type':_0x83ee('0x2f')},'body':_0x50b189,'json':!![]};rp(_0x31237a)['then'](function(_0x3a358a){if(_0x3a358a[_0x83ee('0x30')][0x0]['message_id']){return _0x544a1b['update']({'messageId':_0x3a358a[_0x83ee('0x30')][0x0][_0x83ee('0x31')]});}})[_0x83ee('0x1b')](function(_0x476069){logger['err'](_0x83ee('0x32'),_0x476069);});break;}}})['finally'](function(){_0x538550();});}else{_0x538550();}}},'charset':'utf8mb4','collate':_0x83ee('0x33')});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index db3563e..0e39ec0 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 _0x9b3c=['CreateWhatsappMessage','WhatsappMessage','create','body','options','raw','debug','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','defaults','redis','./whatsappMessage.socket','register','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result'];(function(_0x455989,_0x4804c8){var _0x7479a4=function(_0x4bbfe2){while(--_0x4bbfe2){_0x455989['push'](_0x455989['shift']());}};_0x7479a4(++_0x4804c8);}(_0x9b3c,0x6b));var _0xc9b3=function(_0x41c0db,_0x53385e){_0x41c0db=_0x41c0db-0x0;var _0x2d71d1=_0x9b3c[_0x41c0db];return _0x2d71d1;};'use strict';var _=require(_0xc9b3('0x0'));var util=require(_0xc9b3('0x1'));var moment=require(_0xc9b3('0x2'));var BPromise=require(_0xc9b3('0x3'));var rs=require(_0xc9b3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc9b3('0x5'))['db'];var utils=require(_0xc9b3('0x6'));var logger=require('../../config/logger')(_0xc9b3('0x7'));var config=require(_0xc9b3('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc9b3('0x9')][_0xc9b3('0xa')]({'port':0x232a});config['redis']=_[_0xc9b3('0xb')](config[_0xc9b3('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xc9b3('0xd'))[_0xc9b3('0xe')](socket);function respondWithRpcPromise(_0x5838e7,_0x4d44ad,_0x13ebc1){return new BPromise(function(_0x100894,_0x42b24b){return client[_0xc9b3('0xf')](_0x5838e7,_0x13ebc1)[_0xc9b3('0x10')](function(_0x3d745e){logger[_0xc9b3('0x11')](_0xc9b3('0x12'),_0x4d44ad,_0xc9b3('0x13'));logger['debug']('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x4d44ad,_0xc9b3('0x13'),JSON[_0xc9b3('0x14')](_0x3d745e));if(_0x3d745e[_0xc9b3('0x15')]){if(_0x3d745e[_0xc9b3('0x15')][_0xc9b3('0x16')]===0x1f4){logger[_0xc9b3('0x15')](_0xc9b3('0x12'),_0x4d44ad,_0x3d745e['error'][_0xc9b3('0x17')]);return _0x42b24b(_0x3d745e['error']['message']);}logger[_0xc9b3('0x15')]('WhatsappMessage,\x20%s,\x20%s',_0x4d44ad,_0x3d745e['error']['message']);return _0x100894(_0x3d745e[_0xc9b3('0x15')][_0xc9b3('0x17')]);}else{logger[_0xc9b3('0x11')](_0xc9b3('0x12'),_0x4d44ad,_0xc9b3('0x13'));_0x100894(_0x3d745e[_0xc9b3('0x18')][_0xc9b3('0x17')]);}})['catch'](function(_0x36b4d0){logger[_0xc9b3('0x15')](_0xc9b3('0x12'),_0x4d44ad,_0x36b4d0);_0x42b24b(_0x36b4d0);});});}exports[_0xc9b3('0x19')]=function(_0x4f6f81){var _0x227137=this;return new Promise(function(_0x1da6b5,_0x30417f){return db[_0xc9b3('0x1a')][_0xc9b3('0x1b')](_0x4f6f81[_0xc9b3('0x1c')],{'raw':_0x4f6f81[_0xc9b3('0x1d')]?_0x4f6f81[_0xc9b3('0x1d')][_0xc9b3('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x5a8a86){logger[_0xc9b3('0x11')](_0xc9b3('0x19'),_0x4f6f81);logger[_0xc9b3('0x1f')](_0xc9b3('0x19'),_0x4f6f81,JSON['stringify'](_0x5a8a86));_0x1da6b5(_0x5a8a86);})[_0xc9b3('0x20')](function(_0x402268){logger[_0xc9b3('0x15')](_0xc9b3('0x19'),_0x402268[_0xc9b3('0x17')],_0x4f6f81);_0x30417f(_0x227137[_0xc9b3('0x15')](0x1f4,_0x402268[_0xc9b3('0x17')]));});});}; \ No newline at end of file +var _0xd3b3=['jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','request','then','info','WhatsappMessage,\x20%s,\x20%s','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','catch','CreateWhatsappMessage','create','body','options','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x2015e2,_0x39085e){var _0x34d1b3=function(_0x198860){while(--_0x198860){_0x2015e2['push'](_0x2015e2['shift']());}};_0x34d1b3(++_0x39085e);}(_0xd3b3,0xb6));var _0x3d3b=function(_0x17e9c4,_0x13991b){_0x17e9c4=_0x17e9c4-0x0;var _0x53922a=_0xd3b3[_0x17e9c4];return _0x53922a;};'use strict';var _=require(_0x3d3b('0x0'));var util=require(_0x3d3b('0x1'));var moment=require(_0x3d3b('0x2'));var BPromise=require(_0x3d3b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3d3b('0x4'));var db=require(_0x3d3b('0x5'))['db'];var utils=require(_0x3d3b('0x6'));var logger=require(_0x3d3b('0x7'))(_0x3d3b('0x8'));var config=require(_0x3d3b('0x9'));var jayson=require(_0x3d3b('0xa'));var client=jayson[_0x3d3b('0xb')]['http']({'port':0x232a});config[_0x3d3b('0xc')]=_[_0x3d3b('0xd')](config[_0x3d3b('0xc')],{'host':_0x3d3b('0xe'),'port':0x18eb});var socket=require(_0x3d3b('0xf'))(new Redis(config[_0x3d3b('0xc')]));require(_0x3d3b('0x10'))['register'](socket);function respondWithRpcPromise(_0x32f04e,_0x4b7880,_0x5af28a){return new BPromise(function(_0x392849,_0x3d4cd4){return client[_0x3d3b('0x11')](_0x32f04e,_0x5af28a)[_0x3d3b('0x12')](function(_0x249b3b){logger[_0x3d3b('0x13')](_0x3d3b('0x14'),_0x4b7880,'request\x20sent');logger[_0x3d3b('0x15')](_0x3d3b('0x16'),_0x4b7880,_0x3d3b('0x17'),JSON['stringify'](_0x249b3b));if(_0x249b3b[_0x3d3b('0x18')]){if(_0x249b3b[_0x3d3b('0x18')]['code']===0x1f4){logger[_0x3d3b('0x18')]('WhatsappMessage,\x20%s,\x20%s',_0x4b7880,_0x249b3b[_0x3d3b('0x18')]['message']);return _0x3d4cd4(_0x249b3b[_0x3d3b('0x18')][_0x3d3b('0x19')]);}logger[_0x3d3b('0x18')]('WhatsappMessage,\x20%s,\x20%s',_0x4b7880,_0x249b3b[_0x3d3b('0x18')][_0x3d3b('0x19')]);return _0x392849(_0x249b3b[_0x3d3b('0x18')]['message']);}else{logger['info'](_0x3d3b('0x14'),_0x4b7880,_0x3d3b('0x17'));_0x392849(_0x249b3b['result'][_0x3d3b('0x19')]);}})[_0x3d3b('0x1a')](function(_0x342752){logger[_0x3d3b('0x18')](_0x3d3b('0x14'),_0x4b7880,_0x342752);_0x3d4cd4(_0x342752);});});}exports[_0x3d3b('0x1b')]=function(_0x1d6c4e){var _0x5856fa=this;return new Promise(function(_0x40cbb4,_0x13b54b){return db['WhatsappMessage'][_0x3d3b('0x1c')](_0x1d6c4e[_0x3d3b('0x1d')],{'raw':_0x1d6c4e[_0x3d3b('0x1e')]?_0x1d6c4e['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x24c3a3){logger['info'](_0x3d3b('0x1b'),_0x1d6c4e);logger[_0x3d3b('0x15')]('CreateWhatsappMessage',_0x1d6c4e,JSON[_0x3d3b('0x1f')](_0x24c3a3));_0x40cbb4(_0x24c3a3);})['catch'](function(_0x3634b2){logger[_0x3d3b('0x18')](_0x3d3b('0x1b'),_0x3634b2[_0x3d3b('0x19')],_0x1d6c4e);_0x13b54b(_0x5856fa[_0x3d3b('0x18')](0x1f4,_0x3634b2[_0x3d3b('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index 35377dd..ec62c87 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 _0xd9a8=['length','./whatsappMessage.events','save','update','register'];(function(_0xd7b0a4,_0x53c7d3){var _0x184e9e=function(_0x325bbd){while(--_0x325bbd){_0xd7b0a4['push'](_0xd7b0a4['shift']());}};_0x184e9e(++_0x53c7d3);}(_0xd9a8,0x1a0));var _0x8d9a=function(_0xe8f3bc,_0x12985f){_0xe8f3bc=_0xe8f3bc-0x0;var _0x4d1fe2=_0xd9a8[_0xe8f3bc];return _0x4d1fe2;};'use strict';var WhatsappMessageEvents=require(_0x8d9a('0x0'));var events=[_0x8d9a('0x1'),'remove',_0x8d9a('0x2')];function createListener(_0x30087c,_0x1a2635){return function(_0x4327f1){_0x1a2635['emit'](_0x30087c,_0x4327f1);};}function removeListener(_0x273eba,_0xccce59){return function(){WhatsappMessageEvents['removeListener'](_0x273eba,_0xccce59);};}exports[_0x8d9a('0x3')]=function(_0x58c0cf){for(var _0x1164ef=0x0,_0x262f75=events[_0x8d9a('0x4')];_0x1164ef<_0x262f75;_0x1164ef++){var _0x550690=events[_0x1164ef];var _0x15d2ff=createListener('whatsappMessage:'+_0x550690,_0x58c0cf);WhatsappMessageEvents['on'](_0x550690,_0x15d2ff);}}; \ No newline at end of file +var _0x15c9=['register','length','whatsappMessage:','./whatsappMessage.events','save','removeListener'];(function(_0x2a41d7,_0x2058b9){var _0x74b2a2=function(_0xa2ba24){while(--_0xa2ba24){_0x2a41d7['push'](_0x2a41d7['shift']());}};_0x74b2a2(++_0x2058b9);}(_0x15c9,0x93));var _0x915c=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x15c9[_0x2641f9];return _0x585741;};'use strict';var WhatsappMessageEvents=require(_0x915c('0x0'));var events=[_0x915c('0x1'),'remove','update'];function createListener(_0x21057d,_0x1a8253){return function(_0x129fe9){_0x1a8253['emit'](_0x21057d,_0x129fe9);};}function removeListener(_0x325e0c,_0x1f7851){return function(){WhatsappMessageEvents[_0x915c('0x2')](_0x325e0c,_0x1f7851);};}exports[_0x915c('0x3')]=function(_0x53b332){for(var _0x3b9f91=0x0,_0x47b78a=events[_0x915c('0x4')];_0x3b9f91<_0x47b78a;_0x3b9f91++){var _0x471413=events[_0x3b9f91];var _0x4578ab=createListener(_0x915c('0x5')+_0x471413,_0x53b332);WhatsappMessageEvents['on'](_0x471413,_0x4578ab);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index fa758dc..c16ca6e 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 _0x4425=['/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','destroy','removeTeams','delete','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers'];(function(_0x512d18,_0x5a874f){var _0x3be5af=function(_0x200a4e){while(--_0x200a4e){_0x512d18['push'](_0x512d18['shift']());}};_0x3be5af(++_0x5a874f);}(_0x4425,0x19a));var _0x5442=function(_0x24b82c,_0x45767d){_0x24b82c=_0x24b82c-0x0;var _0x349d5d=_0x4425[_0x24b82c];return _0x349d5d;};'use strict';var multer=require(_0x5442('0x0'));var util=require(_0x5442('0x1'));var path=require(_0x5442('0x2'));var timeout=require(_0x5442('0x3'));var express=require(_0x5442('0x4'));var router=express[_0x5442('0x5')]();var fs_extra=require(_0x5442('0x6'));var auth=require(_0x5442('0x7'));var interaction=require(_0x5442('0x8'));var config=require(_0x5442('0x9'));var controller=require('./whatsappQueue.controller');router[_0x5442('0xa')]('/',auth[_0x5442('0xb')](),controller[_0x5442('0xc')]);router['get'](_0x5442('0xd'),auth[_0x5442('0xb')](),controller[_0x5442('0xe')]);router[_0x5442('0xa')](_0x5442('0xf'),auth[_0x5442('0xb')](),controller[_0x5442('0x10')]);router[_0x5442('0xa')](_0x5442('0x11'),auth['isAuthenticated'](),controller[_0x5442('0x12')]);router[_0x5442('0xa')](_0x5442('0x13'),auth[_0x5442('0xb')](),controller[_0x5442('0x14')]);router[_0x5442('0xa')](_0x5442('0x15'),auth[_0x5442('0xb')](),controller[_0x5442('0x16')]);router[_0x5442('0x17')]('/',auth[_0x5442('0xb')](),controller[_0x5442('0x18')]);router[_0x5442('0x17')](_0x5442('0x13'),auth[_0x5442('0xb')](),controller[_0x5442('0x19')]);router[_0x5442('0x17')](_0x5442('0x15'),auth[_0x5442('0xb')](),controller[_0x5442('0x1a')]);router[_0x5442('0x1b')]('/:id',auth[_0x5442('0xb')](),controller['update']);router['delete']('/:id',auth[_0x5442('0xb')](),controller[_0x5442('0x1c')]);router['delete'](_0x5442('0x13'),auth[_0x5442('0xb')](),controller[_0x5442('0x1d')]);router[_0x5442('0x1e')](_0x5442('0x15'),auth[_0x5442('0xb')](),controller[_0x5442('0x1f')]);module[_0x5442('0x20')]=router; \ No newline at end of file +var _0x401f=['connect-timeout','Router','fs-extra','../../config/environment','./whatsappQueue.controller','isAuthenticated','get','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','getAgents','post','create','addTeams','/:id/users','addAgents','put','delete','removeTeams','removeAgents','exports','multer','util','path'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x401f,0x169));var _0xf401=function(_0x18fe2e,_0x329199){_0x18fe2e=_0x18fe2e-0x0;var _0x36108e=_0x401f[_0x18fe2e];return _0x36108e;};'use strict';var multer=require(_0xf401('0x0'));var util=require(_0xf401('0x1'));var path=require(_0xf401('0x2'));var timeout=require(_0xf401('0x3'));var express=require('express');var router=express[_0xf401('0x4')]();var fs_extra=require(_0xf401('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xf401('0x6'));var controller=require(_0xf401('0x7'));router['get']('/',auth[_0xf401('0x8')](),controller['index']);router[_0xf401('0x9')]('/describe',auth[_0xf401('0x8')](),controller[_0xf401('0xa')]);router[_0xf401('0x9')](_0xf401('0xb'),auth['isAuthenticated'](),controller[_0xf401('0xc')]);router[_0xf401('0x9')](_0xf401('0xd'),auth[_0xf401('0x8')](),controller[_0xf401('0xe')]);router[_0xf401('0x9')](_0xf401('0xf'),auth[_0xf401('0x8')](),controller[_0xf401('0x10')]);router[_0xf401('0x9')]('/:id/users',auth[_0xf401('0x8')](),controller[_0xf401('0x11')]);router[_0xf401('0x12')]('/',auth[_0xf401('0x8')](),controller[_0xf401('0x13')]);router[_0xf401('0x12')]('/:id/teams',auth[_0xf401('0x8')](),controller[_0xf401('0x14')]);router['post'](_0xf401('0x15'),auth['isAuthenticated'](),controller[_0xf401('0x16')]);router[_0xf401('0x17')](_0xf401('0xb'),auth['isAuthenticated'](),controller['update']);router[_0xf401('0x18')]('/:id',auth[_0xf401('0x8')](),controller['destroy']);router['delete']('/:id/teams',auth[_0xf401('0x8')](),controller[_0xf401('0x19')]);router[_0xf401('0x18')]('/:id/users',auth[_0xf401('0x8')](),controller[_0xf401('0x1a')]);module[_0xf401('0x1b')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index 6b13bcb..1fbb639 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 _0xcd31=['STRING','name','ENUM','rrmemory','beepall','roundrobin','exports'];(function(_0x4e3fb9,_0x3046cc){var _0x525d75=function(_0xd5dbee){while(--_0xd5dbee){_0x4e3fb9['push'](_0x4e3fb9['shift']());}};_0x525d75(++_0x3046cc);}(_0xcd31,0x15d));var _0x1cd3=function(_0x4fecb6,_0x7def4e){_0x4fecb6=_0x4fecb6-0x0;var _0x47036a=_0xcd31[_0x4fecb6];return _0x47036a;};'use strict';var Sequelize=require('sequelize');module[_0x1cd3('0x0')]={'name':{'type':Sequelize[_0x1cd3('0x1')],'unique':_0x1cd3('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x1cd3('0x3')](_0x1cd3('0x4'),_0x1cd3('0x5'),_0x1cd3('0x6'))},'description':{'type':Sequelize[_0x1cd3('0x1')]}}; \ No newline at end of file +var _0x3140=['sequelize','exports','STRING','name','rrmemory','beepall','roundrobin'];(function(_0x282a1f,_0x49a6ef){var _0x296ea7=function(_0x4bac68){while(--_0x4bac68){_0x282a1f['push'](_0x282a1f['shift']());}};_0x296ea7(++_0x49a6ef);}(_0x3140,0xaf));var _0x0314=function(_0x3cf053,_0x7a9947){_0x3cf053=_0x3cf053-0x0;var _0x3b55a0=_0x3140[_0x3cf053];return _0x3b55a0;};'use strict';var Sequelize=require(_0x0314('0x0'));module[_0x0314('0x1')]={'name':{'type':Sequelize[_0x0314('0x2')],'unique':_0x0314('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x0314('0x4'),_0x0314('0x5'),_0x0314('0x6'))},'description':{'type':Sequelize[_0x0314('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index 5fb0385..22ffd99 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 _0x77f9=['Agents','online','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userWhatsappQueue:save','removeTeams','field','tq.TeamId','from','team_has_whatsapp_queues','join','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','SELECT','every','TeamId','includes','all','union','compact','isEmpty','userWhatsappQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','util','ioredis','../../components/parsers/qs','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','register','sendStatus','status','end','offset','undefined','limit','count','json','update','then','destroy','get','WhatsappQueues','error','name','index','map','WhatsappQueue','fieldName','type','key','getOptions','where','include','query','findAll','catch','show','params','rawAttributes','keys','filters','intersection','model','attributes','fields','merge','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserWhatsappQueue','length','nolimit','order','sort','filter','User','findAndCountAll','UserId','agent','whatsappPause','updatedAt','rows','format','%s/%s','getTeams','Team','pick','hasOwnProperty','addTeams','ids'];(function(_0x509e54,_0x1c358c){var _0x4a2400=function(_0x47ede1){while(--_0x47ede1){_0x509e54['push'](_0x509e54['shift']());}};_0x4a2400(++_0x1c358c);}(_0x77f9,0x9c));var _0x977f=function(_0xa9a245,_0x2a0387){_0xa9a245=_0xa9a245-0x0;var _0x2d0eaa=_0x77f9[_0xa9a245];return _0x2d0eaa;};'use strict';var BPromise=require('bluebird');var util=require(_0x977f('0x0'));var _=require('lodash');var squel=require('squel');var Redis=require(_0x977f('0x1'));var qs=require(_0x977f('0x2'));var logger=require('../../config/logger')(_0x977f('0x3'));var config=require('../../config/environment');var db=require(_0x977f('0x4'))['db'];config[_0x977f('0x5')]=_[_0x977f('0x6')](config['redis'],{'host':_0x977f('0x7'),'port':0x18eb});var socket=require(_0x977f('0x8'))(new Redis(config[_0x977f('0x5')]));require(_0x977f('0x9'))[_0x977f('0xa')](socket);function respondWithStatusCode(_0x5c308a,_0x570f36){_0x570f36=_0x570f36||0xcc;return function(_0x4947a2){if(_0x4947a2){return _0x5c308a[_0x977f('0xb')](_0x570f36);}return _0x5c308a[_0x977f('0xc')](_0x570f36)[_0x977f('0xd')]();};}function respondWithResult(_0x450257,_0x494942){_0x494942=_0x494942||0xc8;return function(_0x2519fd){if(_0x2519fd){return _0x450257[_0x977f('0xc')](_0x494942)['json'](_0x2519fd);}};}function respondWithFilteredResult(_0x4fe658,_0x144a15){return function(_0x108832){if(_0x108832){var _0x1a99c0=typeof _0x144a15[_0x977f('0xe')]===_0x977f('0xf')&&typeof _0x144a15[_0x977f('0x10')]==='undefined';var _0x4c981c=_0x108832[_0x977f('0x11')];var _0x3026bf=_0x1a99c0?0x0:_0x144a15[_0x977f('0xe')];var _0x17ea8a=_0x1a99c0?_0x108832[_0x977f('0x11')]:_0x144a15[_0x977f('0xe')]+_0x144a15[_0x977f('0x10')];var _0x1b7c7f;if(_0x17ea8a>=_0x4c981c){_0x17ea8a=_0x4c981c;_0x1b7c7f=0xc8;}else{_0x1b7c7f=0xce;}_0x4fe658[_0x977f('0xc')](_0x1b7c7f);return _0x4fe658['set']('Content-Range',_0x3026bf+'-'+_0x17ea8a+'/'+_0x4c981c)[_0x977f('0x12')](_0x108832);}return null;};}function saveUpdates(_0x16fff6){return function(_0x4669ae){if(_0x4669ae){return _0x4669ae[_0x977f('0x13')](_0x16fff6)[_0x977f('0x14')](function(_0x40b870){return _0x40b870;});}return null;};}function removeEntity(_0x30c633){return function(_0x4b7e1e){if(_0x4b7e1e){return _0x4b7e1e[_0x977f('0x15')]()[_0x977f('0x14')](function(){var _0x280208=_0x4b7e1e[_0x977f('0x16')]({'plain':!![]});var _0x2b0b54=_0x977f('0x17');return db['UserProfileResource'][_0x977f('0x15')]({'where':{'type':_0x2b0b54,'resourceId':_0x280208['id']}})[_0x977f('0x14')](function(){return _0x4b7e1e;});})[_0x977f('0x14')](function(){_0x30c633['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e6a02){return function(_0x3599a7){if(!_0x3599a7){_0x1e6a02[_0x977f('0xb')](0x194);}return _0x3599a7;};}function handleError(_0x546371,_0x1b7468){_0x1b7468=_0x1b7468||0x1f4;return function(_0x162b6b){logger[_0x977f('0x18')](_0x162b6b['stack']);if(_0x162b6b[_0x977f('0x19')]){delete _0x162b6b['name'];}_0x546371['status'](_0x1b7468)['send'](_0x162b6b);};}exports[_0x977f('0x1a')]=function(_0x1b5b36,_0x49f95d){var _0x23f4f5={};var _0x469559={'count':0x0,'rows':[]};var _0x5a78d5=_[_0x977f('0x1b')](db[_0x977f('0x1c')]['rawAttributes'],function(_0x2a149b){return{'name':_0x2a149b[_0x977f('0x1d')],'type':_0x2a149b[_0x977f('0x1e')][_0x977f('0x1f')]};});_0x23f4f5=qs[_0x977f('0x20')](_0x5a78d5,_0x1b5b36);var _0x427393={'where':_0x23f4f5[_0x977f('0x21')]};return db[_0x977f('0x1c')][_0x977f('0x11')](_0x427393)[_0x977f('0x14')](function(_0xaf5a09){_0x469559[_0x977f('0x11')]=_0xaf5a09;_0x23f4f5[_0x977f('0x22')]=qs['include'](_0x1b5b36[_0x977f('0x23')]);return db[_0x977f('0x1c')][_0x977f('0x24')](_0x23f4f5);})['then'](function(_0x3c1075){_0x469559['rows']=_0x3c1075;return _0x469559;})[_0x977f('0x14')](respondWithFilteredResult(_0x49f95d,_0x23f4f5))[_0x977f('0x25')](handleError(_0x49f95d,null));};exports[_0x977f('0x26')]=function(_0x1b9f6a,_0x1a887b){var _0x521f5c={'raw':!![],'where':{'id':_0x1b9f6a[_0x977f('0x27')]['id']}},_0x380a5b={};_0x380a5b['model']=_['keys'](db['WhatsappQueue'][_0x977f('0x28')]);_0x380a5b[_0x977f('0x23')]=_[_0x977f('0x29')](_0x1b9f6a[_0x977f('0x23')]);_0x380a5b[_0x977f('0x2a')]=_[_0x977f('0x2b')](_0x380a5b[_0x977f('0x2c')],_0x380a5b[_0x977f('0x23')]);_0x521f5c[_0x977f('0x2d')]=_[_0x977f('0x2b')](_0x380a5b[_0x977f('0x2c')],qs[_0x977f('0x2e')](_0x1b9f6a[_0x977f('0x23')][_0x977f('0x2e')]));_0x521f5c['attributes']=_0x521f5c['attributes']['length']?_0x521f5c['attributes']:_0x380a5b[_0x977f('0x2c')];if(_0x1b9f6a[_0x977f('0x23')]['includeAll']){_0x521f5c[_0x977f('0x22')]=[{'all':!![]}];}_0x521f5c=_[_0x977f('0x2f')]({},_0x521f5c,_0x1b9f6a[_0x977f('0x30')]);return db[_0x977f('0x1c')][_0x977f('0x31')](_0x521f5c)[_0x977f('0x14')](handleEntityNotFound(_0x1a887b,null))['then'](respondWithResult(_0x1a887b,null))[_0x977f('0x25')](handleError(_0x1a887b,null));};exports[_0x977f('0x32')]=function(_0x36f45c,_0x8cc376){return db[_0x977f('0x1c')]['create'](_0x36f45c[_0x977f('0x33')],{})[_0x977f('0x14')](function(_0x413113){var _0x274f29=_0x36f45c[_0x977f('0x34')][_0x977f('0x16')]({'plain':!![]});if(!_0x274f29)throw new Error(_0x977f('0x35'));if(_0x274f29[_0x977f('0x36')]==='user'){var _0x33b1ce=_0x413113[_0x977f('0x16')]({'plain':!![]});var _0x2226cd=_0x977f('0x17');return db[_0x977f('0x37')][_0x977f('0x31')]({'where':{'name':_0x2226cd,'userProfileId':_0x274f29[_0x977f('0x38')]},'raw':!![]})[_0x977f('0x14')](function(_0x245ab7){if(_0x245ab7&&_0x245ab7['autoAssociation']===0x0){return db['UserProfileResource'][_0x977f('0x32')]({'name':_0x33b1ce['name'],'resourceId':_0x33b1ce['id'],'type':_0x245ab7[_0x977f('0x19')],'sectionId':_0x245ab7['id']},{})['then'](function(){return _0x413113;});}else{return _0x413113;}})[_0x977f('0x25')](function(_0x57372f){logger['error'](_0x977f('0x39'),_0x57372f);throw _0x57372f;});}return _0x413113;})[_0x977f('0x14')](respondWithResult(_0x8cc376,0xc9))[_0x977f('0x25')](handleError(_0x8cc376,null));};exports['update']=function(_0x759a82,_0x33d9c0){if(_0x759a82[_0x977f('0x33')]['id']){delete _0x759a82[_0x977f('0x33')]['id'];}return db[_0x977f('0x1c')][_0x977f('0x31')]({'where':{'id':_0x759a82['params']['id']}})[_0x977f('0x14')](handleEntityNotFound(_0x33d9c0,null))['then'](saveUpdates(_0x759a82['body'],null))['then'](respondWithResult(_0x33d9c0,null))['catch'](handleError(_0x33d9c0,null));};exports[_0x977f('0x15')]=function(_0x31ff4c,_0x3d3363){return db['WhatsappQueue'][_0x977f('0x31')]({'where':{'id':_0x31ff4c['params']['id']}})[_0x977f('0x14')](handleEntityNotFound(_0x3d3363,null))[_0x977f('0x14')](removeEntity(_0x3d3363,null))[_0x977f('0x25')](handleError(_0x3d3363,null));};exports[_0x977f('0x3a')]=function(_0x1fec7f,_0x5ac9a3){return db[_0x977f('0x1c')][_0x977f('0x3a')]()[_0x977f('0x14')](respondWithResult(_0x5ac9a3,null))['catch'](handleError(_0x5ac9a3,null));};exports[_0x977f('0x3b')]=function(_0x2feeee,_0x45702e){var _0x3dd369={'raw':!![],'where':{}},_0x9d7ed3={},_0x2ef3a0;return db['WhatsappQueue'][_0x977f('0x3c')]({'where':{'id':_0x2feeee[_0x977f('0x27')]['id']}})[_0x977f('0x14')](handleEntityNotFound(_0x45702e,null))[_0x977f('0x14')](function(_0x58cd17){if(_0x58cd17){_0x2ef3a0=_0x58cd17[_0x977f('0x16')]({'plain':!![]});_0x9d7ed3['model']=_[_0x977f('0x29')](db[_0x977f('0x3d')]['rawAttributes']);_0x9d7ed3[_0x977f('0x23')]=_[_0x977f('0x29')](_0x2feeee['query']);_0x9d7ed3[_0x977f('0x2a')]=_[_0x977f('0x2b')](_0x9d7ed3[_0x977f('0x2c')],_0x9d7ed3['query']);_0x3dd369[_0x977f('0x2d')]=_['intersection'](_0x9d7ed3[_0x977f('0x2c')],qs[_0x977f('0x2e')](_0x2feeee[_0x977f('0x23')][_0x977f('0x2e')]));_0x3dd369[_0x977f('0x2d')]=_0x3dd369[_0x977f('0x2d')][_0x977f('0x3e')]?_0x3dd369[_0x977f('0x2d')]:_0x9d7ed3[_0x977f('0x2c')];if(!_0x2feeee[_0x977f('0x23')]['hasOwnProperty'](_0x977f('0x3f'))){_0x3dd369[_0x977f('0x10')]=qs['limit'](_0x2feeee[_0x977f('0x23')][_0x977f('0x10')]);_0x3dd369['offset']=qs[_0x977f('0xe')](_0x2feeee['query'][_0x977f('0xe')]);}_0x3dd369[_0x977f('0x40')]=qs[_0x977f('0x41')](_0x2feeee[_0x977f('0x23')]['sort']);_0x3dd369['where']=qs[_0x977f('0x2a')](_['pick'](_0x2feeee['query'],_0x9d7ed3['filters']));_0x3dd369['where']['WhatsappQueueId']=_0x58cd17['id'];if(_0x2feeee[_0x977f('0x23')]['filter']){_0x3dd369[_0x977f('0x21')]=_[_0x977f('0x2f')](_0x3dd369[_0x977f('0x21')],{'$or':_[_0x977f('0x1b')](_0x3dd369['attributes'],function(_0x1653ce){var _0x4026fe={};_0x4026fe[_0x1653ce]={'$like':'%'+_0x2feeee[_0x977f('0x23')][_0x977f('0x42')]+'%'};return _0x4026fe;})});}_0x3dd369=_[_0x977f('0x2f')]({},_0x3dd369,_0x2feeee[_0x977f('0x30')]);return db['UserWhatsappQueue'][_0x977f('0x24')](_0x3dd369);}})['then'](function(_0x5c4aee){if(_0x5c4aee){return db[_0x977f('0x43')][_0x977f('0x44')]({'where':{'id':_[_0x977f('0x1b')](_0x5c4aee,_0x977f('0x45')),'role':_0x977f('0x46')},'attributes':['id',_0x977f('0x19'),_0x977f('0x47'),_0x977f('0x48'),'createdAt']});}})[_0x977f('0x14')](function(_0x30466a){if(_0x30466a){return{'count':_0x30466a[_0x977f('0x11')],'rows':_[_0x977f('0x1b')](_0x30466a[_0x977f('0x49')],function(_0x8cdb83){return{'membername':_0x8cdb83[_0x977f('0x19')],'UserId':_0x8cdb83['id'],'queue_name':_0x2ef3a0[_0x977f('0x19')],'WhatsappQueueId':_0x2ef3a0['id'],'interface':util[_0x977f('0x4a')](_0x977f('0x4b'),'SIP',_0x8cdb83[_0x977f('0x19')]),'penalty':0x0,'paused':_0x8cdb83['whatsappPause'],'createdAt':_0x8cdb83['createdAt'],'updatedAt':_0x8cdb83[_0x977f('0x48')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x45702e,_0x3dd369))['catch'](handleError(_0x45702e,null));};exports[_0x977f('0x4c')]=function(_0xfb8860,_0x4edb38){var _0x44b1e2={};var _0x4374c1={};var _0x457175;var _0x52cf2f;return db[_0x977f('0x1c')][_0x977f('0x3c')]({'where':{'id':_0xfb8860[_0x977f('0x27')]['id']}})[_0x977f('0x14')](handleEntityNotFound(_0x4edb38,null))['then'](function(_0x104936){if(_0x104936){_0x457175=_0x104936;_0x4374c1['model']=_['keys'](db[_0x977f('0x4d')][_0x977f('0x28')]);_0x4374c1['query']=_[_0x977f('0x29')](_0xfb8860[_0x977f('0x23')]);_0x4374c1['filters']=_[_0x977f('0x2b')](_0x4374c1['model'],_0x4374c1[_0x977f('0x23')]);_0x44b1e2[_0x977f('0x2d')]=_['intersection'](_0x4374c1['model'],qs['fields'](_0xfb8860[_0x977f('0x23')][_0x977f('0x2e')]));_0x44b1e2[_0x977f('0x2d')]=_0x44b1e2[_0x977f('0x2d')][_0x977f('0x3e')]?_0x44b1e2[_0x977f('0x2d')]:_0x4374c1['model'];_0x44b1e2[_0x977f('0x40')]=qs[_0x977f('0x41')](_0xfb8860[_0x977f('0x23')]['sort']);_0x44b1e2[_0x977f('0x21')]=qs[_0x977f('0x2a')](_[_0x977f('0x4e')](_0xfb8860['query'],_0x4374c1[_0x977f('0x2a')]));if(_0xfb8860['query']['filter']){_0x44b1e2['where']=_[_0x977f('0x2f')](_0x44b1e2[_0x977f('0x21')],{'$or':_[_0x977f('0x1b')](_0x44b1e2[_0x977f('0x2d')],function(_0x259543){var _0x2903db={};_0x2903db[_0x259543]={'$like':'%'+_0xfb8860[_0x977f('0x23')]['filter']+'%'};return _0x2903db;})});}_0x44b1e2=_[_0x977f('0x2f')]({},_0x44b1e2,_0xfb8860[_0x977f('0x30')]);return _0x457175['getTeams'](_0x44b1e2);}})[_0x977f('0x14')](function(_0x54c76e){if(_0x54c76e){_0x52cf2f=_0x54c76e[_0x977f('0x3e')];if(!_0xfb8860[_0x977f('0x23')][_0x977f('0x4f')](_0x977f('0x3f'))){_0x44b1e2[_0x977f('0x10')]=qs[_0x977f('0x10')](_0xfb8860[_0x977f('0x23')][_0x977f('0x10')]);_0x44b1e2[_0x977f('0xe')]=qs['offset'](_0xfb8860['query'][_0x977f('0xe')]);}return _0x457175[_0x977f('0x4c')](_0x44b1e2);}})[_0x977f('0x14')](function(_0x44771d){if(_0x44771d){return _0x44771d?{'count':_0x52cf2f,'rows':_0x44771d}:null;}})[_0x977f('0x14')](respondWithResult(_0x4edb38,null))[_0x977f('0x25')](handleError(_0x4edb38,null));};exports[_0x977f('0x50')]=function(_0x5528cc,_0x4fc71f){var _0x20abb5=_0x5528cc['body'][_0x977f('0x51')];return db[_0x977f('0x4d')][_0x977f('0x24')]({'where':{'id':_0x20abb5},'attributes':['id'],'include':[{'model':db[_0x977f('0x43')],'as':_0x977f('0x52'),'attributes':['id',_0x977f('0x19'),_0x977f('0x53'),'voicePause',_0x977f('0x54')],'raw':!![]}]})[_0x977f('0x14')](function(_0x4c03cd){if(_0x4c03cd){var _0x25a7b8=_[_0x977f('0x55')](_0x4c03cd,function(_0x382db1){var _0xe0f675=_0x382db1[_0x977f('0x16')]({'plain':!![]});return _0xe0f675[_0x977f('0x52')];});return db[_0x977f('0x1c')][_0x977f('0x31')]({'where':{'id':_0x5528cc[_0x977f('0x27')]['id']}})[_0x977f('0x14')](function(_0x5ee317){return db[_0x977f('0x56')][_0x977f('0x57')](function(_0x2724d6){return _0x5ee317[_0x977f('0x50')](_0x20abb5,{'transaction':_0x2724d6})[_0x977f('0x14')](function(){return BPromise[_0x977f('0x58')](_0x25a7b8,function(_0x386a0e){return db[_0x977f('0x3d')][_0x977f('0x59')]({'where':{'UserId':_0x386a0e['id'],'WhatsappQueueId':_0x5528cc['params']['id']},'transaction':_0x2724d6});});})[_0x977f('0x14')](function(){_0x25a7b8[_0x977f('0x5a')](function(_0xeea7f5){socket[_0x977f('0x5b')](_0x977f('0x5c'),{'UserId':_0xeea7f5['id'],'WhatsappQueueId':_0x5ee317['id']});});});});});}})[_0x977f('0x14')](respondWithStatusCode(_0x4fc71f,null))[_0x977f('0x25')](handleError(_0x4fc71f,null));};exports[_0x977f('0x5d')]=function(_0x2bf8c,_0x17d33d){return db[_0x977f('0x4d')][_0x977f('0x24')]({'where':{'id':_0x2bf8c[_0x977f('0x23')][_0x977f('0x51')]},'attributes':['id'],'include':[{'model':db[_0x977f('0x43')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x977f('0x14')](handleEntityNotFound(_0x17d33d,null))['then'](function(_0x405b27){var _0x3f0388=_[_0x977f('0x1b')](_0x405b27,'id');var _0x32d315=[];var _0x2700e0=[];var _0x11c864=squel['select']();_0x11c864[_0x977f('0x5e')](_0x977f('0x5f'))[_0x977f('0x60')](_0x977f('0x61'),'tq')[_0x977f('0x62')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0x977f('0x21')](_0x977f('0x63'),_0x2bf8c[_0x977f('0x27')]['id']);for(var _0x15a2d5=0x0;_0x15a2d5<_0x405b27[_0x977f('0x3e')];_0x15a2d5+=0x1){let _0x54ca72=_0x405b27[_0x15a2d5];for(var _0x13d09e=0x0;_0x13d09e<_0x54ca72['Agents'][_0x977f('0x3e')];_0x13d09e+=0x1){let _0x4167d4=_0x54ca72[_0x977f('0x52')][_0x13d09e];var _0x33073b=_0x11c864[_0x977f('0x64')]();_0x33073b[_0x977f('0x21')](_0x977f('0x65'),_0x4167d4['id']);_0x2700e0[_0x977f('0x66')](db[_0x977f('0x56')][_0x977f('0x23')](_0x33073b[_0x977f('0x67')](),{'type':db[_0x977f('0x56')]['QueryTypes'][_0x977f('0x68')]})[_0x977f('0x14')](function(_0x5d2dcd){if(_0x5d2dcd[_0x977f('0x3e')]===0x1){return _0x4167d4['id'];}else{var _0x4f4ce0=_[_0x977f('0x69')](_['map'](_0x5d2dcd,_0x977f('0x6a')),function(_0x7291a8){return _[_0x977f('0x6b')](_0x3f0388,_0x7291a8);});if(_0x4f4ce0){return _0x4167d4['id'];}}}));}}return BPromise[_0x977f('0x6c')](_0x2700e0)[_0x977f('0x14')](function(_0x56db90){_0x32d315=_(_0x32d315)[_0x977f('0x6d')](_0x56db90)[_0x977f('0x6e')]()['value']();return db[_0x977f('0x1c')][_0x977f('0x31')]({'where':{'id':_0x2bf8c['params']['id']}})[_0x977f('0x14')](function(_0x1c6ac7){return db['sequelize'][_0x977f('0x57')](function(_0x4dfe00){return _0x1c6ac7[_0x977f('0x5d')](_0x2bf8c[_0x977f('0x23')][_0x977f('0x51')],{'transaction':_0x4dfe00})[_0x977f('0x14')](function(){if(!_[_0x977f('0x6f')](_0x32d315)){return _0x1c6ac7['removeAgents'](_0x32d315,{'transaction':_0x4dfe00});}})[_0x977f('0x14')](function(){_0x32d315[_0x977f('0x5a')](function(_0x5440b5){socket[_0x977f('0x5b')](_0x977f('0x70'),{'UserId':_0x5440b5,'WhatsappQueueId':_0x1c6ac7['id']});});});});});});})[_0x977f('0x14')](respondWithStatusCode(_0x17d33d,null))['catch'](handleError(_0x17d33d,null));};exports[_0x977f('0x71')]=function(_0x5c7715,_0x57eca5){return db['WhatsappQueue'][_0x977f('0x31')]({'where':{'id':_0x5c7715[_0x977f('0x27')]['id']}})[_0x977f('0x14')](handleEntityNotFound(_0x57eca5,null))[_0x977f('0x14')](function(_0x1f98a5){if(_0x1f98a5){return _0x1f98a5[_0x977f('0x71')](_0x5c7715[_0x977f('0x33')][_0x977f('0x51')],_[_0x977f('0x72')](_0x5c7715['body'],[_0x977f('0x51'),'id'])||{})[_0x977f('0x73')](function(_0x264c8f){for(var _0x3cd55a=0x0;_0x3cd55a<_0x5c7715[_0x977f('0x33')]['ids'][_0x977f('0x3e')];_0x3cd55a+=0x1){socket[_0x977f('0x5b')](_0x977f('0x5c'),{'UserId':Number(_0x5c7715['body']['ids'][_0x3cd55a]),'WhatsappQueueId':Number(_0x5c7715['params']['id'])});}return _0x264c8f;});}})['then'](respondWithResult(_0x57eca5,null))[_0x977f('0x25')](handleError(_0x57eca5,null));};exports[_0x977f('0x74')]=function(_0x3f7f97,_0x3446bd){return db[_0x977f('0x1c')][_0x977f('0x31')]({'where':{'id':_0x3f7f97['params']['id']}})['then'](handleEntityNotFound(_0x3446bd,null))[_0x977f('0x14')](function(_0x2175e8){if(_0x2175e8){return _0x2175e8[_0x977f('0x74')](_0x3f7f97[_0x977f('0x23')][_0x977f('0x51')])[_0x977f('0x14')](function(){if(_[_0x977f('0x75')](_0x3f7f97['query'][_0x977f('0x51')])){for(var _0x209ccd=0x0;_0x209ccd<_0x3f7f97[_0x977f('0x23')]['ids'][_0x977f('0x3e')];_0x209ccd+=0x1){socket[_0x977f('0x5b')](_0x977f('0x70'),{'UserId':Number(_0x3f7f97[_0x977f('0x23')][_0x977f('0x51')][_0x209ccd]),'WhatsappQueueId':Number(_0x3f7f97[_0x977f('0x27')]['id'])});}}else{socket[_0x977f('0x5b')](_0x977f('0x70'),{'UserId':Number(_0x3f7f97[_0x977f('0x23')][_0x977f('0x51')]),'WhatsappQueueId':Number(_0x3f7f97['params']['id'])});}});}})[_0x977f('0x14')](respondWithStatusCode(_0x3446bd,null))[_0x977f('0x25')](handleError(_0x3446bd,null));};exports[_0x977f('0x76')]=function(_0x8dc24a,_0x440189){var _0x4368f4={};var _0x1aed58={};var _0x3e74c1;var _0x992122;return db[_0x977f('0x1c')][_0x977f('0x3c')]({'where':{'id':_0x8dc24a[_0x977f('0x27')]['id']}})[_0x977f('0x14')](handleEntityNotFound(_0x440189,null))[_0x977f('0x14')](function(_0x4cf9ec){if(_0x4cf9ec){_0x3e74c1=_0x4cf9ec;_0x1aed58[_0x977f('0x2c')]=_[_0x977f('0x29')](db[_0x977f('0x43')][_0x977f('0x28')]);_0x1aed58[_0x977f('0x23')]=_[_0x977f('0x29')](_0x8dc24a[_0x977f('0x23')]);_0x1aed58[_0x977f('0x2a')]=_[_0x977f('0x2b')](_0x1aed58['model'],_0x1aed58[_0x977f('0x23')]);_0x4368f4[_0x977f('0x2d')]=_['intersection'](_0x1aed58[_0x977f('0x2c')],qs[_0x977f('0x2e')](_0x8dc24a[_0x977f('0x23')]['fields']));_0x4368f4[_0x977f('0x2d')]=_0x4368f4[_0x977f('0x2d')]['length']?_0x4368f4[_0x977f('0x2d')]:_0x1aed58[_0x977f('0x2c')];_0x4368f4[_0x977f('0x40')]=qs[_0x977f('0x41')](_0x8dc24a[_0x977f('0x23')][_0x977f('0x41')]);_0x4368f4[_0x977f('0x21')]=qs[_0x977f('0x2a')](_[_0x977f('0x4e')](_0x8dc24a['query'],_0x1aed58[_0x977f('0x2a')]));if(_0x8dc24a['query'][_0x977f('0x42')]){_0x4368f4['where']=_[_0x977f('0x2f')](_0x4368f4[_0x977f('0x21')],{'$or':_[_0x977f('0x1b')](_0x4368f4['attributes'],function(_0x2bbea3){var _0x2f6a83={};_0x2f6a83[_0x2bbea3]={'$like':'%'+_0x8dc24a['query'][_0x977f('0x42')]+'%'};return _0x2f6a83;})});}_0x4368f4=_['merge']({},_0x4368f4,_0x8dc24a[_0x977f('0x30')]);return _0x3e74c1['getAgents'](_0x4368f4);}})['then'](function(_0x2e4153){if(_0x2e4153){_0x992122=_0x2e4153[_0x977f('0x3e')];if(!_0x8dc24a[_0x977f('0x23')][_0x977f('0x4f')]('nolimit')){_0x4368f4['limit']=qs[_0x977f('0x10')](_0x8dc24a[_0x977f('0x23')][_0x977f('0x10')]);_0x4368f4[_0x977f('0xe')]=qs[_0x977f('0xe')](_0x8dc24a[_0x977f('0x23')][_0x977f('0xe')]);}return _0x3e74c1['getAgents'](_0x4368f4);}})['then'](function(_0x23c358){if(_0x23c358){return _0x23c358?{'count':_0x992122,'rows':_0x23c358}:null;}})['then'](respondWithResult(_0x440189,null))[_0x977f('0x25')](handleError(_0x440189,null));}; \ No newline at end of file +var _0xcc65=['../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','register','status','end','json','limit','count','offset','set','Content-Range','destroy','then','get','WhatsappQueues','UserProfileResource','sendStatus','error','stack','name','send','index','map','WhatsappQueue','fieldName','key','where','include','findAll','catch','show','params','keys','rawAttributes','query','model','intersection','fields','attributes','length','includeAll','merge','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserWhatsappQueue','filters','nolimit','order','sort','pick','WhatsappQueueId','filter','User','findAndCountAll','UserId','agent','whatsappPause','updatedAt','createdAt','rows','format','%s/%s','Team','hasOwnProperty','getTeams','ids','flatMap','Agents','sequelize','transaction','addTeams','findOrCreate','forEach','userWhatsappQueue:save','removeTeams','field','tq.TeamId','from','team_has_whatsapp_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','SELECT','TeamId','includes','union','compact','isEmpty','removeAgents','userWhatsappQueue:remove','addAgents','spread','emit','getAgents','lodash','squel','../../components/parsers/qs','../../config/logger','api'];(function(_0x19513f,_0x8b3e1f){var _0x2663cb=function(_0x277fdf){while(--_0x277fdf){_0x19513f['push'](_0x19513f['shift']());}};_0x2663cb(++_0x8b3e1f);}(_0xcc65,0x1d7));var _0x5cc6=function(_0x8c1005,_0x1f3f16){_0x8c1005=_0x8c1005-0x0;var _0x175354=_0xcc65[_0x8c1005];return _0x175354;};'use strict';var BPromise=require('bluebird');var util=require('util');var _=require(_0x5cc6('0x0'));var squel=require(_0x5cc6('0x1'));var Redis=require('ioredis');var qs=require(_0x5cc6('0x2'));var logger=require(_0x5cc6('0x3'))(_0x5cc6('0x4'));var config=require(_0x5cc6('0x5'));var db=require(_0x5cc6('0x6'))['db'];config[_0x5cc6('0x7')]=_[_0x5cc6('0x8')](config[_0x5cc6('0x7')],{'host':_0x5cc6('0x9'),'port':0x18eb});var socket=require(_0x5cc6('0xa'))(new Redis(config[_0x5cc6('0x7')]));require(_0x5cc6('0xb'))[_0x5cc6('0xc')](socket);function respondWithStatusCode(_0xa8a5f9,_0x58b4c4){_0x58b4c4=_0x58b4c4||0xcc;return function(_0x57a3dd){if(_0x57a3dd){return _0xa8a5f9['sendStatus'](_0x58b4c4);}return _0xa8a5f9[_0x5cc6('0xd')](_0x58b4c4)[_0x5cc6('0xe')]();};}function respondWithResult(_0x171efd,_0x587979){_0x587979=_0x587979||0xc8;return function(_0x15e34d){if(_0x15e34d){return _0x171efd['status'](_0x587979)[_0x5cc6('0xf')](_0x15e34d);}};}function respondWithFilteredResult(_0x1b02f3,_0x256cb8){return function(_0x44ecba){if(_0x44ecba){var _0x1a9910=typeof _0x256cb8['offset']==='undefined'&&typeof _0x256cb8[_0x5cc6('0x10')]==='undefined';var _0x506ff6=_0x44ecba[_0x5cc6('0x11')];var _0x32c85f=_0x1a9910?0x0:_0x256cb8[_0x5cc6('0x12')];var _0x2dd8a4=_0x1a9910?_0x44ecba[_0x5cc6('0x11')]:_0x256cb8[_0x5cc6('0x12')]+_0x256cb8[_0x5cc6('0x10')];var _0x4b39ee;if(_0x2dd8a4>=_0x506ff6){_0x2dd8a4=_0x506ff6;_0x4b39ee=0xc8;}else{_0x4b39ee=0xce;}_0x1b02f3[_0x5cc6('0xd')](_0x4b39ee);return _0x1b02f3[_0x5cc6('0x13')](_0x5cc6('0x14'),_0x32c85f+'-'+_0x2dd8a4+'/'+_0x506ff6)['json'](_0x44ecba);}return null;};}function saveUpdates(_0x2901ac){return function(_0x3dccc4){if(_0x3dccc4){return _0x3dccc4['update'](_0x2901ac)['then'](function(_0x498c28){return _0x498c28;});}return null;};}function removeEntity(_0x4daeb7){return function(_0x1e8357){if(_0x1e8357){return _0x1e8357[_0x5cc6('0x15')]()[_0x5cc6('0x16')](function(){var _0x333d6c=_0x1e8357[_0x5cc6('0x17')]({'plain':!![]});var _0x49c775=_0x5cc6('0x18');return db[_0x5cc6('0x19')]['destroy']({'where':{'type':_0x49c775,'resourceId':_0x333d6c['id']}})[_0x5cc6('0x16')](function(){return _0x1e8357;});})[_0x5cc6('0x16')](function(){_0x4daeb7[_0x5cc6('0xd')](0xcc)[_0x5cc6('0xe')]();});}};}function handleEntityNotFound(_0x5a40e0){return function(_0x11498e){if(!_0x11498e){_0x5a40e0[_0x5cc6('0x1a')](0x194);}return _0x11498e;};}function handleError(_0x519f69,_0x49e9fd){_0x49e9fd=_0x49e9fd||0x1f4;return function(_0x2c91a7){logger[_0x5cc6('0x1b')](_0x2c91a7[_0x5cc6('0x1c')]);if(_0x2c91a7[_0x5cc6('0x1d')]){delete _0x2c91a7[_0x5cc6('0x1d')];}_0x519f69[_0x5cc6('0xd')](_0x49e9fd)[_0x5cc6('0x1e')](_0x2c91a7);};}exports[_0x5cc6('0x1f')]=function(_0x4fa451,_0x4808c1){var _0x5775c0={};var _0x4d2334={'count':0x0,'rows':[]};var _0x9fea3=_[_0x5cc6('0x20')](db[_0x5cc6('0x21')]['rawAttributes'],function(_0x1cd439){return{'name':_0x1cd439[_0x5cc6('0x22')],'type':_0x1cd439['type'][_0x5cc6('0x23')]};});_0x5775c0=qs['getOptions'](_0x9fea3,_0x4fa451);var _0x131ca7={'where':_0x5775c0[_0x5cc6('0x24')]};return db[_0x5cc6('0x21')][_0x5cc6('0x11')](_0x131ca7)['then'](function(_0x557f1a){_0x4d2334[_0x5cc6('0x11')]=_0x557f1a;_0x5775c0[_0x5cc6('0x25')]=qs[_0x5cc6('0x25')](_0x4fa451['query']);return db[_0x5cc6('0x21')][_0x5cc6('0x26')](_0x5775c0);})[_0x5cc6('0x16')](function(_0x526ded){_0x4d2334['rows']=_0x526ded;return _0x4d2334;})['then'](respondWithFilteredResult(_0x4808c1,_0x5775c0))[_0x5cc6('0x27')](handleError(_0x4808c1,null));};exports[_0x5cc6('0x28')]=function(_0x3c1973,_0xb4b5a1){var _0x128de1={'raw':!![],'where':{'id':_0x3c1973[_0x5cc6('0x29')]['id']}},_0x1428a4={};_0x1428a4['model']=_[_0x5cc6('0x2a')](db[_0x5cc6('0x21')][_0x5cc6('0x2b')]);_0x1428a4['query']=_[_0x5cc6('0x2a')](_0x3c1973[_0x5cc6('0x2c')]);_0x1428a4['filters']=_['intersection'](_0x1428a4[_0x5cc6('0x2d')],_0x1428a4[_0x5cc6('0x2c')]);_0x128de1['attributes']=_[_0x5cc6('0x2e')](_0x1428a4['model'],qs['fields'](_0x3c1973[_0x5cc6('0x2c')][_0x5cc6('0x2f')]));_0x128de1[_0x5cc6('0x30')]=_0x128de1[_0x5cc6('0x30')][_0x5cc6('0x31')]?_0x128de1[_0x5cc6('0x30')]:_0x1428a4['model'];if(_0x3c1973[_0x5cc6('0x2c')][_0x5cc6('0x32')]){_0x128de1[_0x5cc6('0x25')]=[{'all':!![]}];}_0x128de1=_[_0x5cc6('0x33')]({},_0x128de1,_0x3c1973[_0x5cc6('0x34')]);return db[_0x5cc6('0x21')][_0x5cc6('0x35')](_0x128de1)['then'](handleEntityNotFound(_0xb4b5a1,null))[_0x5cc6('0x16')](respondWithResult(_0xb4b5a1,null))[_0x5cc6('0x27')](handleError(_0xb4b5a1,null));};exports[_0x5cc6('0x36')]=function(_0x51ff91,_0x1e70ef){return db[_0x5cc6('0x21')]['create'](_0x51ff91[_0x5cc6('0x37')],{})[_0x5cc6('0x16')](function(_0x44f775){var _0x2011b8=_0x51ff91[_0x5cc6('0x38')][_0x5cc6('0x17')]({'plain':!![]});if(!_0x2011b8)throw new Error(_0x5cc6('0x39'));if(_0x2011b8['role']===_0x5cc6('0x38')){var _0x22db52=_0x44f775[_0x5cc6('0x17')]({'plain':!![]});var _0x3a2156=_0x5cc6('0x18');return db[_0x5cc6('0x3a')][_0x5cc6('0x35')]({'where':{'name':_0x3a2156,'userProfileId':_0x2011b8[_0x5cc6('0x3b')]},'raw':!![]})[_0x5cc6('0x16')](function(_0xb77776){if(_0xb77776&&_0xb77776[_0x5cc6('0x3c')]===0x0){return db[_0x5cc6('0x19')]['create']({'name':_0x22db52['name'],'resourceId':_0x22db52['id'],'type':_0xb77776[_0x5cc6('0x1d')],'sectionId':_0xb77776['id']},{})[_0x5cc6('0x16')](function(){return _0x44f775;});}else{return _0x44f775;}})[_0x5cc6('0x27')](function(_0x457348){logger[_0x5cc6('0x1b')](_0x5cc6('0x3d'),_0x457348);throw _0x457348;});}return _0x44f775;})[_0x5cc6('0x16')](respondWithResult(_0x1e70ef,0xc9))[_0x5cc6('0x27')](handleError(_0x1e70ef,null));};exports['update']=function(_0x5d00f8,_0x2812e4){if(_0x5d00f8[_0x5cc6('0x37')]['id']){delete _0x5d00f8[_0x5cc6('0x37')]['id'];}return db[_0x5cc6('0x21')][_0x5cc6('0x35')]({'where':{'id':_0x5d00f8[_0x5cc6('0x29')]['id']}})[_0x5cc6('0x16')](handleEntityNotFound(_0x2812e4,null))['then'](saveUpdates(_0x5d00f8['body'],null))[_0x5cc6('0x16')](respondWithResult(_0x2812e4,null))[_0x5cc6('0x27')](handleError(_0x2812e4,null));};exports[_0x5cc6('0x15')]=function(_0x23fe28,_0x5812b5){return db[_0x5cc6('0x21')][_0x5cc6('0x35')]({'where':{'id':_0x23fe28[_0x5cc6('0x29')]['id']}})[_0x5cc6('0x16')](handleEntityNotFound(_0x5812b5,null))[_0x5cc6('0x16')](removeEntity(_0x5812b5,null))['catch'](handleError(_0x5812b5,null));};exports[_0x5cc6('0x3e')]=function(_0x1a9483,_0x36767f){return db[_0x5cc6('0x21')][_0x5cc6('0x3e')]()[_0x5cc6('0x16')](respondWithResult(_0x36767f,null))['catch'](handleError(_0x36767f,null));};exports[_0x5cc6('0x3f')]=function(_0x535f86,_0xd2bf39){var _0x2cdfe5={'raw':!![],'where':{}},_0xde76a6={},_0xa1360a;return db[_0x5cc6('0x21')][_0x5cc6('0x40')]({'where':{'id':_0x535f86[_0x5cc6('0x29')]['id']}})[_0x5cc6('0x16')](handleEntityNotFound(_0xd2bf39,null))['then'](function(_0x2684b4){if(_0x2684b4){_0xa1360a=_0x2684b4[_0x5cc6('0x17')]({'plain':!![]});_0xde76a6[_0x5cc6('0x2d')]=_[_0x5cc6('0x2a')](db[_0x5cc6('0x41')][_0x5cc6('0x2b')]);_0xde76a6[_0x5cc6('0x2c')]=_[_0x5cc6('0x2a')](_0x535f86[_0x5cc6('0x2c')]);_0xde76a6[_0x5cc6('0x42')]=_[_0x5cc6('0x2e')](_0xde76a6['model'],_0xde76a6[_0x5cc6('0x2c')]);_0x2cdfe5['attributes']=_[_0x5cc6('0x2e')](_0xde76a6[_0x5cc6('0x2d')],qs['fields'](_0x535f86[_0x5cc6('0x2c')][_0x5cc6('0x2f')]));_0x2cdfe5[_0x5cc6('0x30')]=_0x2cdfe5[_0x5cc6('0x30')]['length']?_0x2cdfe5['attributes']:_0xde76a6[_0x5cc6('0x2d')];if(!_0x535f86[_0x5cc6('0x2c')]['hasOwnProperty'](_0x5cc6('0x43'))){_0x2cdfe5[_0x5cc6('0x10')]=qs['limit'](_0x535f86[_0x5cc6('0x2c')][_0x5cc6('0x10')]);_0x2cdfe5[_0x5cc6('0x12')]=qs['offset'](_0x535f86[_0x5cc6('0x2c')][_0x5cc6('0x12')]);}_0x2cdfe5[_0x5cc6('0x44')]=qs[_0x5cc6('0x45')](_0x535f86[_0x5cc6('0x2c')][_0x5cc6('0x45')]);_0x2cdfe5['where']=qs[_0x5cc6('0x42')](_[_0x5cc6('0x46')](_0x535f86[_0x5cc6('0x2c')],_0xde76a6['filters']));_0x2cdfe5[_0x5cc6('0x24')][_0x5cc6('0x47')]=_0x2684b4['id'];if(_0x535f86[_0x5cc6('0x2c')][_0x5cc6('0x48')]){_0x2cdfe5[_0x5cc6('0x24')]=_['merge'](_0x2cdfe5[_0x5cc6('0x24')],{'$or':_[_0x5cc6('0x20')](_0x2cdfe5[_0x5cc6('0x30')],function(_0x306334){var _0x3e8334={};_0x3e8334[_0x306334]={'$like':'%'+_0x535f86[_0x5cc6('0x2c')][_0x5cc6('0x48')]+'%'};return _0x3e8334;})});}_0x2cdfe5=_[_0x5cc6('0x33')]({},_0x2cdfe5,_0x535f86[_0x5cc6('0x34')]);return db[_0x5cc6('0x41')][_0x5cc6('0x26')](_0x2cdfe5);}})[_0x5cc6('0x16')](function(_0x45d66f){if(_0x45d66f){return db[_0x5cc6('0x49')][_0x5cc6('0x4a')]({'where':{'id':_[_0x5cc6('0x20')](_0x45d66f,_0x5cc6('0x4b')),'role':_0x5cc6('0x4c')},'attributes':['id','name',_0x5cc6('0x4d'),_0x5cc6('0x4e'),_0x5cc6('0x4f')]});}})[_0x5cc6('0x16')](function(_0x19d629){if(_0x19d629){return{'count':_0x19d629[_0x5cc6('0x11')],'rows':_[_0x5cc6('0x20')](_0x19d629[_0x5cc6('0x50')],function(_0x56c988){return{'membername':_0x56c988[_0x5cc6('0x1d')],'UserId':_0x56c988['id'],'queue_name':_0xa1360a['name'],'WhatsappQueueId':_0xa1360a['id'],'interface':util[_0x5cc6('0x51')](_0x5cc6('0x52'),'SIP',_0x56c988[_0x5cc6('0x1d')]),'penalty':0x0,'paused':_0x56c988[_0x5cc6('0x4d')],'createdAt':_0x56c988[_0x5cc6('0x4f')],'updatedAt':_0x56c988[_0x5cc6('0x4e')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x5cc6('0x16')](respondWithFilteredResult(_0xd2bf39,_0x2cdfe5))[_0x5cc6('0x27')](handleError(_0xd2bf39,null));};exports['getTeams']=function(_0xbfacb7,_0x470a7c){var _0x40b48f={};var _0x54221e={};var _0x228085;var _0x53056d;return db[_0x5cc6('0x21')][_0x5cc6('0x40')]({'where':{'id':_0xbfacb7[_0x5cc6('0x29')]['id']}})['then'](handleEntityNotFound(_0x470a7c,null))[_0x5cc6('0x16')](function(_0x307a2d){if(_0x307a2d){_0x228085=_0x307a2d;_0x54221e[_0x5cc6('0x2d')]=_[_0x5cc6('0x2a')](db[_0x5cc6('0x53')][_0x5cc6('0x2b')]);_0x54221e[_0x5cc6('0x2c')]=_[_0x5cc6('0x2a')](_0xbfacb7['query']);_0x54221e['filters']=_[_0x5cc6('0x2e')](_0x54221e[_0x5cc6('0x2d')],_0x54221e[_0x5cc6('0x2c')]);_0x40b48f[_0x5cc6('0x30')]=_['intersection'](_0x54221e[_0x5cc6('0x2d')],qs['fields'](_0xbfacb7[_0x5cc6('0x2c')][_0x5cc6('0x2f')]));_0x40b48f[_0x5cc6('0x30')]=_0x40b48f[_0x5cc6('0x30')][_0x5cc6('0x31')]?_0x40b48f[_0x5cc6('0x30')]:_0x54221e['model'];_0x40b48f[_0x5cc6('0x44')]=qs[_0x5cc6('0x45')](_0xbfacb7[_0x5cc6('0x2c')][_0x5cc6('0x45')]);_0x40b48f[_0x5cc6('0x24')]=qs[_0x5cc6('0x42')](_['pick'](_0xbfacb7[_0x5cc6('0x2c')],_0x54221e['filters']));if(_0xbfacb7[_0x5cc6('0x2c')][_0x5cc6('0x48')]){_0x40b48f[_0x5cc6('0x24')]=_['merge'](_0x40b48f['where'],{'$or':_[_0x5cc6('0x20')](_0x40b48f[_0x5cc6('0x30')],function(_0x3cfe7c){var _0x157779={};_0x157779[_0x3cfe7c]={'$like':'%'+_0xbfacb7[_0x5cc6('0x2c')][_0x5cc6('0x48')]+'%'};return _0x157779;})});}_0x40b48f=_[_0x5cc6('0x33')]({},_0x40b48f,_0xbfacb7[_0x5cc6('0x34')]);return _0x228085['getTeams'](_0x40b48f);}})[_0x5cc6('0x16')](function(_0x24a3be){if(_0x24a3be){_0x53056d=_0x24a3be['length'];if(!_0xbfacb7[_0x5cc6('0x2c')][_0x5cc6('0x54')](_0x5cc6('0x43'))){_0x40b48f[_0x5cc6('0x10')]=qs[_0x5cc6('0x10')](_0xbfacb7[_0x5cc6('0x2c')][_0x5cc6('0x10')]);_0x40b48f['offset']=qs['offset'](_0xbfacb7[_0x5cc6('0x2c')][_0x5cc6('0x12')]);}return _0x228085[_0x5cc6('0x55')](_0x40b48f);}})[_0x5cc6('0x16')](function(_0x3abba4){if(_0x3abba4){return _0x3abba4?{'count':_0x53056d,'rows':_0x3abba4}:null;}})['then'](respondWithResult(_0x470a7c,null))[_0x5cc6('0x27')](handleError(_0x470a7c,null));};exports['addTeams']=function(_0x43ca73,_0x1f76a6){var _0x3ac003=_0x43ca73['body'][_0x5cc6('0x56')];return db['Team']['findAll']({'where':{'id':_0x3ac003},'attributes':['id'],'include':[{'model':db[_0x5cc6('0x49')],'as':'Agents','attributes':['id',_0x5cc6('0x1d'),'online','voicePause','interface'],'raw':!![]}]})[_0x5cc6('0x16')](function(_0x2b624f){if(_0x2b624f){var _0x77d6b0=_[_0x5cc6('0x57')](_0x2b624f,function(_0x33228e){var _0x405a37=_0x33228e[_0x5cc6('0x17')]({'plain':!![]});return _0x405a37[_0x5cc6('0x58')];});return db[_0x5cc6('0x21')][_0x5cc6('0x35')]({'where':{'id':_0x43ca73[_0x5cc6('0x29')]['id']}})['then'](function(_0x49a3fe){return db[_0x5cc6('0x59')][_0x5cc6('0x5a')](function(_0x23af6e){return _0x49a3fe[_0x5cc6('0x5b')](_0x3ac003,{'transaction':_0x23af6e})[_0x5cc6('0x16')](function(){return BPromise['each'](_0x77d6b0,function(_0x3a1f4f){return db[_0x5cc6('0x41')][_0x5cc6('0x5c')]({'where':{'UserId':_0x3a1f4f['id'],'WhatsappQueueId':_0x43ca73[_0x5cc6('0x29')]['id']},'transaction':_0x23af6e});});})[_0x5cc6('0x16')](function(){_0x77d6b0[_0x5cc6('0x5d')](function(_0x49e989){socket['emit'](_0x5cc6('0x5e'),{'UserId':_0x49e989['id'],'WhatsappQueueId':_0x49a3fe['id']});});});});});}})[_0x5cc6('0x16')](respondWithStatusCode(_0x1f76a6,null))['catch'](handleError(_0x1f76a6,null));};exports[_0x5cc6('0x5f')]=function(_0x43410c,_0x54f1d1){return db[_0x5cc6('0x53')][_0x5cc6('0x26')]({'where':{'id':_0x43410c['query'][_0x5cc6('0x56')]},'attributes':['id'],'include':[{'model':db[_0x5cc6('0x49')],'as':_0x5cc6('0x58'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x54f1d1,null))[_0x5cc6('0x16')](function(_0x2f3a66){var _0x4b10cc=_[_0x5cc6('0x20')](_0x2f3a66,'id');var _0x41d3ae=[];var _0x27a853=[];var _0x168548=squel['select']();_0x168548[_0x5cc6('0x60')](_0x5cc6('0x61'))[_0x5cc6('0x62')](_0x5cc6('0x63'),'tq')[_0x5cc6('0x64')](_0x5cc6('0x65'),'ut',_0x5cc6('0x66'))[_0x5cc6('0x24')](_0x5cc6('0x67'),_0x43410c[_0x5cc6('0x29')]['id']);for(var _0x176f56=0x0;_0x176f56<_0x2f3a66[_0x5cc6('0x31')];_0x176f56+=0x1){let _0x3b02a5=_0x2f3a66[_0x176f56];for(var _0x47f5f8=0x0;_0x47f5f8<_0x3b02a5[_0x5cc6('0x58')][_0x5cc6('0x31')];_0x47f5f8+=0x1){let _0x41ae6e=_0x3b02a5['Agents'][_0x47f5f8];var _0x2b6224=_0x168548[_0x5cc6('0x68')]();_0x2b6224[_0x5cc6('0x24')](_0x5cc6('0x69'),_0x41ae6e['id']);_0x27a853['push'](db[_0x5cc6('0x59')][_0x5cc6('0x2c')](_0x2b6224[_0x5cc6('0x6a')](),{'type':db[_0x5cc6('0x59')]['QueryTypes'][_0x5cc6('0x6b')]})[_0x5cc6('0x16')](function(_0x385d07){if(_0x385d07[_0x5cc6('0x31')]===0x1){return _0x41ae6e['id'];}else{var _0x3b4583=_['every'](_[_0x5cc6('0x20')](_0x385d07,_0x5cc6('0x6c')),function(_0x470633){return _[_0x5cc6('0x6d')](_0x4b10cc,_0x470633);});if(_0x3b4583){return _0x41ae6e['id'];}}}));}}return BPromise['all'](_0x27a853)[_0x5cc6('0x16')](function(_0xec602){_0x41d3ae=_(_0x41d3ae)[_0x5cc6('0x6e')](_0xec602)[_0x5cc6('0x6f')]()['value']();return db[_0x5cc6('0x21')][_0x5cc6('0x35')]({'where':{'id':_0x43410c[_0x5cc6('0x29')]['id']}})[_0x5cc6('0x16')](function(_0x5273ad){return db['sequelize']['transaction'](function(_0x52f4e7){return _0x5273ad[_0x5cc6('0x5f')](_0x43410c[_0x5cc6('0x2c')][_0x5cc6('0x56')],{'transaction':_0x52f4e7})[_0x5cc6('0x16')](function(){if(!_[_0x5cc6('0x70')](_0x41d3ae)){return _0x5273ad[_0x5cc6('0x71')](_0x41d3ae,{'transaction':_0x52f4e7});}})['then'](function(){_0x41d3ae['forEach'](function(_0x4da7d2){socket['emit'](_0x5cc6('0x72'),{'UserId':_0x4da7d2,'WhatsappQueueId':_0x5273ad['id']});});});});});});})[_0x5cc6('0x16')](respondWithStatusCode(_0x54f1d1,null))[_0x5cc6('0x27')](handleError(_0x54f1d1,null));};exports[_0x5cc6('0x73')]=function(_0x5c3b6c,_0x5a8eea){return db[_0x5cc6('0x21')][_0x5cc6('0x35')]({'where':{'id':_0x5c3b6c[_0x5cc6('0x29')]['id']}})[_0x5cc6('0x16')](handleEntityNotFound(_0x5a8eea,null))[_0x5cc6('0x16')](function(_0x485bbd){if(_0x485bbd){return _0x485bbd['addAgents'](_0x5c3b6c['body'][_0x5cc6('0x56')],_['omit'](_0x5c3b6c[_0x5cc6('0x37')],['ids','id'])||{})[_0x5cc6('0x74')](function(_0x2e9086){for(var _0x389727=0x0;_0x389727<_0x5c3b6c[_0x5cc6('0x37')][_0x5cc6('0x56')][_0x5cc6('0x31')];_0x389727+=0x1){socket[_0x5cc6('0x75')](_0x5cc6('0x5e'),{'UserId':Number(_0x5c3b6c[_0x5cc6('0x37')][_0x5cc6('0x56')][_0x389727]),'WhatsappQueueId':Number(_0x5c3b6c[_0x5cc6('0x29')]['id'])});}return _0x2e9086;});}})[_0x5cc6('0x16')](respondWithResult(_0x5a8eea,null))[_0x5cc6('0x27')](handleError(_0x5a8eea,null));};exports['removeAgents']=function(_0x53b339,_0x168ceb){return db[_0x5cc6('0x21')]['find']({'where':{'id':_0x53b339['params']['id']}})['then'](handleEntityNotFound(_0x168ceb,null))[_0x5cc6('0x16')](function(_0x575ced){if(_0x575ced){return _0x575ced[_0x5cc6('0x71')](_0x53b339[_0x5cc6('0x2c')][_0x5cc6('0x56')])[_0x5cc6('0x16')](function(){if(_['isArray'](_0x53b339['query'][_0x5cc6('0x56')])){for(var _0xcd15b7=0x0;_0xcd15b7<_0x53b339[_0x5cc6('0x2c')][_0x5cc6('0x56')][_0x5cc6('0x31')];_0xcd15b7+=0x1){socket[_0x5cc6('0x75')](_0x5cc6('0x72'),{'UserId':Number(_0x53b339[_0x5cc6('0x2c')][_0x5cc6('0x56')][_0xcd15b7]),'WhatsappQueueId':Number(_0x53b339['params']['id'])});}}else{socket[_0x5cc6('0x75')]('userWhatsappQueue:remove',{'UserId':Number(_0x53b339[_0x5cc6('0x2c')][_0x5cc6('0x56')]),'WhatsappQueueId':Number(_0x53b339['params']['id'])});}});}})[_0x5cc6('0x16')](respondWithStatusCode(_0x168ceb,null))[_0x5cc6('0x27')](handleError(_0x168ceb,null));};exports['getAgents']=function(_0x5cdb8b,_0x2f446b){var _0x4766c9={};var _0x2e0676={};var _0x25206e;var _0x442a8e;return db[_0x5cc6('0x21')]['findOne']({'where':{'id':_0x5cdb8b['params']['id']}})[_0x5cc6('0x16')](handleEntityNotFound(_0x2f446b,null))[_0x5cc6('0x16')](function(_0x1da641){if(_0x1da641){_0x25206e=_0x1da641;_0x2e0676[_0x5cc6('0x2d')]=_[_0x5cc6('0x2a')](db[_0x5cc6('0x49')]['rawAttributes']);_0x2e0676['query']=_['keys'](_0x5cdb8b['query']);_0x2e0676[_0x5cc6('0x42')]=_[_0x5cc6('0x2e')](_0x2e0676['model'],_0x2e0676[_0x5cc6('0x2c')]);_0x4766c9[_0x5cc6('0x30')]=_['intersection'](_0x2e0676[_0x5cc6('0x2d')],qs[_0x5cc6('0x2f')](_0x5cdb8b[_0x5cc6('0x2c')][_0x5cc6('0x2f')]));_0x4766c9[_0x5cc6('0x30')]=_0x4766c9[_0x5cc6('0x30')]['length']?_0x4766c9[_0x5cc6('0x30')]:_0x2e0676['model'];_0x4766c9[_0x5cc6('0x44')]=qs[_0x5cc6('0x45')](_0x5cdb8b[_0x5cc6('0x2c')]['sort']);_0x4766c9[_0x5cc6('0x24')]=qs['filters'](_['pick'](_0x5cdb8b[_0x5cc6('0x2c')],_0x2e0676['filters']));if(_0x5cdb8b[_0x5cc6('0x2c')]['filter']){_0x4766c9[_0x5cc6('0x24')]=_[_0x5cc6('0x33')](_0x4766c9[_0x5cc6('0x24')],{'$or':_[_0x5cc6('0x20')](_0x4766c9['attributes'],function(_0x591866){var _0x5cc452={};_0x5cc452[_0x591866]={'$like':'%'+_0x5cdb8b['query'][_0x5cc6('0x48')]+'%'};return _0x5cc452;})});}_0x4766c9=_[_0x5cc6('0x33')]({},_0x4766c9,_0x5cdb8b['options']);return _0x25206e[_0x5cc6('0x76')](_0x4766c9);}})[_0x5cc6('0x16')](function(_0x315d0f){if(_0x315d0f){_0x442a8e=_0x315d0f[_0x5cc6('0x31')];if(!_0x5cdb8b[_0x5cc6('0x2c')]['hasOwnProperty'](_0x5cc6('0x43'))){_0x4766c9[_0x5cc6('0x10')]=qs[_0x5cc6('0x10')](_0x5cdb8b[_0x5cc6('0x2c')][_0x5cc6('0x10')]);_0x4766c9[_0x5cc6('0x12')]=qs[_0x5cc6('0x12')](_0x5cdb8b['query'][_0x5cc6('0x12')]);}return _0x25206e[_0x5cc6('0x76')](_0x4766c9);}})[_0x5cc6('0x16')](function(_0x5079dd){if(_0x5079dd){return _0x5079dd?{'count':_0x442a8e,'rows':_0x5079dd}:null;}})[_0x5cc6('0x16')](respondWithResult(_0x2f446b,null))['catch'](handleError(_0x2f446b,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index fe43f9c..2afb4a1 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 _0x2c87=['emit','hasOwnProperty','../../mysqldb','WhatsappQueue','save','remove'];(function(_0x1d94d1,_0x347bb8){var _0x23c397=function(_0x489441){while(--_0x489441){_0x1d94d1['push'](_0x1d94d1['shift']());}};_0x23c397(++_0x347bb8);}(_0x2c87,0x86));var _0x72c8=function(_0xd35ba6,_0xb9cf44){_0xd35ba6=_0xd35ba6-0x0;var _0x503dd6=_0x2c87[_0xd35ba6];return _0x503dd6;};'use strict';var EventEmitter=require('events');var WhatsappQueue=require(_0x72c8('0x0'))['db'][_0x72c8('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x72c8('0x2'),'afterUpdate':'update','afterDestroy':_0x72c8('0x3')};function emitEvent(_0x2cbcab){return function(_0x267d28,_0x1b4d13,_0x597cb7){WhatsappQueueEvents[_0x72c8('0x4')](_0x2cbcab+':'+_0x267d28['id'],_0x267d28);WhatsappQueueEvents[_0x72c8('0x4')](_0x2cbcab,_0x267d28);_0x597cb7(null);};}for(var e in events){if(events[_0x72c8('0x5')](e)){var event=events[e];WhatsappQueue['hook'](e,emitEvent(event));}}module['exports']=WhatsappQueueEvents; \ No newline at end of file +var _0x7cde=['update','remove','emit','hasOwnProperty','exports','../../mysqldb','WhatsappQueue','setMaxListeners','save'];(function(_0x2594ef,_0xeeffc0){var _0x1faa38=function(_0x4a6502){while(--_0x4a6502){_0x2594ef['push'](_0x2594ef['shift']());}};_0x1faa38(++_0xeeffc0);}(_0x7cde,0x10a));var _0xe7cd=function(_0x3a290d,_0x1a363b){_0x3a290d=_0x3a290d-0x0;var _0x2533cc=_0x7cde[_0x3a290d];return _0x2533cc;};'use strict';var EventEmitter=require('events');var WhatsappQueue=require(_0xe7cd('0x0'))['db'][_0xe7cd('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0xe7cd('0x2')](0x0);var events={'afterCreate':_0xe7cd('0x3'),'afterUpdate':_0xe7cd('0x4'),'afterDestroy':_0xe7cd('0x5')};function emitEvent(_0x136683){return function(_0x483f52,_0x33336b,_0x53c8d7){WhatsappQueueEvents[_0xe7cd('0x6')](_0x136683+':'+_0x483f52['id'],_0x483f52);WhatsappQueueEvents[_0xe7cd('0x6')](_0x136683,_0x483f52);_0x53c8d7(null);};}for(var e in events){if(events[_0xe7cd('0x7')](e)){var event=events[e];WhatsappQueue['hook'](e,emitEvent(event));}}module[_0xe7cd('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 cb1dc18..41b6541 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 _0x11a1=['./whatsappQueue.attributes','exports','define','WhatsappQueue','whatsapp_queues','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x18dc00,_0x133afb){var _0x2366e9=function(_0x40e430){while(--_0x40e430){_0x18dc00['push'](_0x18dc00['shift']());}};_0x2366e9(++_0x133afb);}(_0x11a1,0xef));var _0x111a=function(_0xc50180,_0x29c6db){_0xc50180=_0xc50180-0x0;var _0x45d326=_0x11a1[_0xc50180];return _0x45d326;};'use strict';var _=require(_0x111a('0x0'));var util=require(_0x111a('0x1'));var logger=require('../../config/logger')(_0x111a('0x2'));var moment=require(_0x111a('0x3'));var BPromise=require(_0x111a('0x4'));var rp=require(_0x111a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x111a('0x6'));var config=require(_0x111a('0x7'));var attributes=require(_0x111a('0x8'));module[_0x111a('0x9')]=function(_0x406ee7,_0x432dec){return _0x406ee7[_0x111a('0xa')](_0x111a('0xb'),attributes,{'tableName':_0x111a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2f7d=['define','WhatsappQueue','lodash','util','../../config/logger','moment','request-promise','rimraf','../../config/environment','./whatsappQueue.attributes','exports'];(function(_0x1562a2,_0x2e4655){var _0x39a636=function(_0x25483a){while(--_0x25483a){_0x1562a2['push'](_0x1562a2['shift']());}};_0x39a636(++_0x2e4655);}(_0x2f7d,0x86));var _0xd2f7=function(_0x18ccbe,_0xb67456){_0x18ccbe=_0x18ccbe-0x0;var _0xd98f57=_0x2f7d[_0x18ccbe];return _0xd98f57;};'use strict';var _=require(_0xd2f7('0x0'));var util=require(_0xd2f7('0x1'));var logger=require(_0xd2f7('0x2'))('api');var moment=require(_0xd2f7('0x3'));var BPromise=require('bluebird');var rp=require(_0xd2f7('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd2f7('0x5'));var config=require(_0xd2f7('0x6'));var attributes=require(_0xd2f7('0x7'));module[_0xd2f7('0x8')]=function(_0x12c55e,_0x5373ae){return _0x12c55e[_0xd2f7('0x9')](_0xd2f7('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 1c39d58..9d4bd9a 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 _0x65c9=['error','code','message','result','GetWhatsappQueue','WhatsappQueue','findAll','options','attributes','limit','map','include','model','catch','find','raw','where','ShowWhatsappQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','WhatsappQueue,\x20%s,\x20%s','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x24f862,_0x4b645a){var _0x198aa4=function(_0x131195){while(--_0x131195){_0x24f862['push'](_0x24f862['shift']());}};_0x198aa4(++_0x4b645a);}(_0x65c9,0x96));var _0x965c=function(_0x1820f3,_0x5da090){_0x1820f3=_0x1820f3-0x0;var _0x78857a=_0x65c9[_0x1820f3];return _0x78857a;};'use strict';var _=require(_0x965c('0x0'));var util=require(_0x965c('0x1'));var moment=require(_0x965c('0x2'));var BPromise=require(_0x965c('0x3'));var rs=require(_0x965c('0x4'));var fs=require('fs');var Redis=require(_0x965c('0x5'));var db=require(_0x965c('0x6'))['db'];var utils=require(_0x965c('0x7'));var logger=require(_0x965c('0x8'))('rpc');var config=require(_0x965c('0x9'));var jayson=require(_0x965c('0xa'));var client=jayson[_0x965c('0xb')][_0x965c('0xc')]({'port':0x232a});config[_0x965c('0xd')]=_[_0x965c('0xe')](config['redis'],{'host':_0x965c('0xf'),'port':0x18eb});var socket=require(_0x965c('0x10'))(new Redis(config[_0x965c('0xd')]));require('./whatsappQueue.socket')[_0x965c('0x11')](socket);function respondWithRpcPromise(_0x376cee,_0x546bb8,_0x2efd31){return new BPromise(function(_0x150a9a,_0x51d1ca){return client[_0x965c('0x12')](_0x376cee,_0x2efd31)[_0x965c('0x13')](function(_0xae6ab6){logger[_0x965c('0x14')](_0x965c('0x15'),_0x546bb8,'request\x20sent');logger[_0x965c('0x16')](_0x965c('0x17'),_0x546bb8,_0x965c('0x18'),JSON[_0x965c('0x19')](_0xae6ab6));if(_0xae6ab6[_0x965c('0x1a')]){if(_0xae6ab6[_0x965c('0x1a')][_0x965c('0x1b')]===0x1f4){logger[_0x965c('0x1a')](_0x965c('0x15'),_0x546bb8,_0xae6ab6[_0x965c('0x1a')]['message']);return _0x51d1ca(_0xae6ab6[_0x965c('0x1a')][_0x965c('0x1c')]);}logger[_0x965c('0x1a')](_0x965c('0x15'),_0x546bb8,_0xae6ab6[_0x965c('0x1a')][_0x965c('0x1c')]);return _0x150a9a(_0xae6ab6[_0x965c('0x1a')][_0x965c('0x1c')]);}else{logger[_0x965c('0x14')](_0x965c('0x15'),_0x546bb8,_0x965c('0x18'));_0x150a9a(_0xae6ab6[_0x965c('0x1d')][_0x965c('0x1c')]);}})['catch'](function(_0x20dc0f){logger[_0x965c('0x1a')](_0x965c('0x15'),_0x546bb8,_0x20dc0f);_0x51d1ca(_0x20dc0f);});});}exports[_0x965c('0x1e')]=function(_0x26355f){var _0x2559a5=this;return new Promise(function(_0x5f2ffd,_0x727601){return db[_0x965c('0x1f')][_0x965c('0x20')]({'raw':_0x26355f[_0x965c('0x21')]?_0x26355f[_0x965c('0x21')]['raw']===undefined?!![]:![]:!![],'where':_0x26355f[_0x965c('0x21')]?_0x26355f[_0x965c('0x21')]['where']||null:null,'attributes':_0x26355f[_0x965c('0x21')]?_0x26355f[_0x965c('0x21')][_0x965c('0x22')]||null:null,'limit':_0x26355f[_0x965c('0x21')]?_0x26355f[_0x965c('0x21')][_0x965c('0x23')]||null:null,'include':_0x26355f[_0x965c('0x21')]?_0x26355f['options']['include']?_[_0x965c('0x24')](_0x26355f['options'][_0x965c('0x25')],function(_0x3e1840){return{'model':db[_0x3e1840[_0x965c('0x26')]],'as':_0x3e1840['as'],'attributes':_0x3e1840[_0x965c('0x22')],'include':_0x3e1840[_0x965c('0x25')]?_[_0x965c('0x24')](_0x3e1840[_0x965c('0x25')],function(_0x2ef149){return{'model':db[_0x2ef149[_0x965c('0x26')]],'as':_0x2ef149['as'],'attributes':_0x2ef149[_0x965c('0x22')],'include':_0x2ef149['include']?_[_0x965c('0x24')](_0x2ef149[_0x965c('0x25')],function(_0x2b568d){return{'model':db[_0x2b568d[_0x965c('0x26')]],'as':_0x2b568d['as'],'attributes':_0x2b568d['attributes']};}):[]};}):[]};}):[]:[]})[_0x965c('0x13')](function(_0x44d080){logger['info']('GetWhatsappQueue',_0x26355f);logger[_0x965c('0x16')](_0x965c('0x1e'),_0x26355f,JSON[_0x965c('0x19')](_0x44d080));_0x5f2ffd(_0x44d080);})[_0x965c('0x27')](function(_0x232aa2){logger[_0x965c('0x1a')](_0x965c('0x1e'),_0x232aa2[_0x965c('0x1c')],_0x26355f);_0x727601(_0x2559a5['error'](0x1f4,_0x232aa2[_0x965c('0x1c')]));});});};exports['ShowWhatsappQueue']=function(_0x82c2cb){var _0x46ee9c=this;return new Promise(function(_0xd4038b,_0x3b52f9){return db['WhatsappQueue'][_0x965c('0x28')]({'raw':_0x82c2cb[_0x965c('0x21')]?_0x82c2cb['options'][_0x965c('0x29')]===undefined?!![]:![]:!![],'where':_0x82c2cb[_0x965c('0x21')]?_0x82c2cb[_0x965c('0x21')][_0x965c('0x2a')]||null:null,'attributes':_0x82c2cb[_0x965c('0x21')]?_0x82c2cb['options'][_0x965c('0x22')]||null:null,'include':_0x82c2cb[_0x965c('0x21')]?_0x82c2cb['options'][_0x965c('0x25')]?_[_0x965c('0x24')](_0x82c2cb[_0x965c('0x21')]['include'],function(_0x5cb3b8){return{'model':db[_0x5cb3b8[_0x965c('0x26')]],'as':_0x5cb3b8['as'],'attributes':_0x5cb3b8['attributes'],'include':_0x5cb3b8[_0x965c('0x25')]?_[_0x965c('0x24')](_0x5cb3b8[_0x965c('0x25')],function(_0x29c07b){return{'model':db[_0x29c07b[_0x965c('0x26')]],'as':_0x29c07b['as'],'attributes':_0x29c07b[_0x965c('0x22')],'include':_0x29c07b['include']?_['map'](_0x29c07b[_0x965c('0x25')],function(_0x4ed78e){return{'model':db[_0x4ed78e[_0x965c('0x26')]],'as':_0x4ed78e['as'],'attributes':_0x4ed78e[_0x965c('0x22')]};}):[]};}):[]};}):[]:[]})[_0x965c('0x13')](function(_0x3afcfa){logger[_0x965c('0x14')]('ShowWhatsappQueue',_0x82c2cb);logger[_0x965c('0x16')](_0x965c('0x2b'),_0x82c2cb,JSON[_0x965c('0x19')](_0x3afcfa));_0xd4038b(_0x3afcfa);})[_0x965c('0x27')](function(_0x4d941e){logger[_0x965c('0x1a')](_0x965c('0x2b'),_0x4d941e[_0x965c('0x1c')],_0x82c2cb);_0x3b52f9(_0x46ee9c[_0x965c('0x1a')](0x1f4,_0x4d941e[_0x965c('0x1c')]));});});}; \ No newline at end of file +var _0xb360=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','socket.io-emitter','redis','register','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','attributes','limit','include','model','map','find','raw','ShowWhatsappQueue','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x284c9c,_0x1f0cf2){var _0x15fc20=function(_0x183101){while(--_0x183101){_0x284c9c['push'](_0x284c9c['shift']());}};_0x15fc20(++_0x1f0cf2);}(_0xb360,0x9e));var _0x0b36=function(_0x42e25c,_0x505425){_0x42e25c=_0x42e25c-0x0;var _0x2f6dc2=_0xb360[_0x42e25c];return _0x2f6dc2;};'use strict';var _=require(_0x0b36('0x0'));var util=require(_0x0b36('0x1'));var moment=require(_0x0b36('0x2'));var BPromise=require(_0x0b36('0x3'));var rs=require(_0x0b36('0x4'));var fs=require('fs');var Redis=require(_0x0b36('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x0b36('0x6'));var logger=require(_0x0b36('0x7'))(_0x0b36('0x8'));var config=require(_0x0b36('0x9'));var jayson=require(_0x0b36('0xa'));var client=jayson[_0x0b36('0xb')]['http']({'port':0x232a});config['redis']=_[_0x0b36('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0b36('0xd'))(new Redis(config[_0x0b36('0xe')]));require('./whatsappQueue.socket')[_0x0b36('0xf')](socket);function respondWithRpcPromise(_0x36e333,_0x2417dc,_0x14e080){return new BPromise(function(_0x158095,_0x516197){return client[_0x0b36('0x10')](_0x36e333,_0x14e080)[_0x0b36('0x11')](function(_0x54df7e){logger[_0x0b36('0x12')](_0x0b36('0x13'),_0x2417dc,_0x0b36('0x14'));logger[_0x0b36('0x15')](_0x0b36('0x16'),_0x2417dc,'request\x20sent',JSON[_0x0b36('0x17')](_0x54df7e));if(_0x54df7e[_0x0b36('0x18')]){if(_0x54df7e['error'][_0x0b36('0x19')]===0x1f4){logger[_0x0b36('0x18')]('WhatsappQueue,\x20%s,\x20%s',_0x2417dc,_0x54df7e['error'][_0x0b36('0x1a')]);return _0x516197(_0x54df7e[_0x0b36('0x18')][_0x0b36('0x1a')]);}logger['error'](_0x0b36('0x13'),_0x2417dc,_0x54df7e['error']['message']);return _0x158095(_0x54df7e[_0x0b36('0x18')]['message']);}else{logger[_0x0b36('0x12')]('WhatsappQueue,\x20%s,\x20%s',_0x2417dc,_0x0b36('0x14'));_0x158095(_0x54df7e[_0x0b36('0x1b')][_0x0b36('0x1a')]);}})[_0x0b36('0x1c')](function(_0x2cff2d){logger[_0x0b36('0x18')](_0x0b36('0x13'),_0x2417dc,_0x2cff2d);_0x516197(_0x2cff2d);});});}exports[_0x0b36('0x1d')]=function(_0x6e66c5){var _0x566425=this;return new Promise(function(_0x557cc3,_0x52bbf2){return db[_0x0b36('0x1e')]['findAll']({'raw':_0x6e66c5[_0x0b36('0x1f')]?_0x6e66c5[_0x0b36('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x6e66c5[_0x0b36('0x1f')]?_0x6e66c5[_0x0b36('0x1f')][_0x0b36('0x20')]||null:null,'attributes':_0x6e66c5[_0x0b36('0x1f')]?_0x6e66c5[_0x0b36('0x1f')][_0x0b36('0x21')]||null:null,'limit':_0x6e66c5[_0x0b36('0x1f')]?_0x6e66c5[_0x0b36('0x1f')][_0x0b36('0x22')]||null:null,'include':_0x6e66c5[_0x0b36('0x1f')]?_0x6e66c5['options'][_0x0b36('0x23')]?_['map'](_0x6e66c5[_0x0b36('0x1f')]['include'],function(_0x1b0649){return{'model':db[_0x1b0649[_0x0b36('0x24')]],'as':_0x1b0649['as'],'attributes':_0x1b0649[_0x0b36('0x21')],'include':_0x1b0649['include']?_[_0x0b36('0x25')](_0x1b0649['include'],function(_0x52e6e0){return{'model':db[_0x52e6e0['model']],'as':_0x52e6e0['as'],'attributes':_0x52e6e0['attributes'],'include':_0x52e6e0['include']?_[_0x0b36('0x25')](_0x52e6e0[_0x0b36('0x23')],function(_0x283967){return{'model':db[_0x283967[_0x0b36('0x24')]],'as':_0x283967['as'],'attributes':_0x283967['attributes']};}):[]};}):[]};}):[]:[]})[_0x0b36('0x11')](function(_0x1c61bd){logger['info'](_0x0b36('0x1d'),_0x6e66c5);logger[_0x0b36('0x15')](_0x0b36('0x1d'),_0x6e66c5,JSON[_0x0b36('0x17')](_0x1c61bd));_0x557cc3(_0x1c61bd);})[_0x0b36('0x1c')](function(_0x265e00){logger[_0x0b36('0x18')](_0x0b36('0x1d'),_0x265e00[_0x0b36('0x1a')],_0x6e66c5);_0x52bbf2(_0x566425[_0x0b36('0x18')](0x1f4,_0x265e00[_0x0b36('0x1a')]));});});};exports['ShowWhatsappQueue']=function(_0x55e6a0){var _0x7958e1=this;return new Promise(function(_0x154d8c,_0x4c763f){return db[_0x0b36('0x1e')][_0x0b36('0x26')]({'raw':_0x55e6a0[_0x0b36('0x1f')]?_0x55e6a0[_0x0b36('0x1f')][_0x0b36('0x27')]===undefined?!![]:![]:!![],'where':_0x55e6a0[_0x0b36('0x1f')]?_0x55e6a0[_0x0b36('0x1f')][_0x0b36('0x20')]||null:null,'attributes':_0x55e6a0[_0x0b36('0x1f')]?_0x55e6a0['options']['attributes']||null:null,'include':_0x55e6a0[_0x0b36('0x1f')]?_0x55e6a0[_0x0b36('0x1f')][_0x0b36('0x23')]?_['map'](_0x55e6a0[_0x0b36('0x1f')]['include'],function(_0x4b5bce){return{'model':db[_0x4b5bce['model']],'as':_0x4b5bce['as'],'attributes':_0x4b5bce[_0x0b36('0x21')],'include':_0x4b5bce[_0x0b36('0x23')]?_[_0x0b36('0x25')](_0x4b5bce[_0x0b36('0x23')],function(_0x312b65){return{'model':db[_0x312b65[_0x0b36('0x24')]],'as':_0x312b65['as'],'attributes':_0x312b65['attributes'],'include':_0x312b65['include']?_[_0x0b36('0x25')](_0x312b65[_0x0b36('0x23')],function(_0x242f60){return{'model':db[_0x242f60[_0x0b36('0x24')]],'as':_0x242f60['as'],'attributes':_0x242f60[_0x0b36('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x503077){logger[_0x0b36('0x12')](_0x0b36('0x28'),_0x55e6a0);logger['debug'](_0x0b36('0x28'),_0x55e6a0,JSON[_0x0b36('0x17')](_0x503077));_0x154d8c(_0x503077);})[_0x0b36('0x1c')](function(_0x51709a){logger[_0x0b36('0x18')](_0x0b36('0x28'),_0x51709a[_0x0b36('0x1a')],_0x55e6a0);_0x4c763f(_0x7958e1[_0x0b36('0x18')](0x1f4,_0x51709a[_0x0b36('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index 0676e7f..ad61b32 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 _0xaaa6=['emit','removeListener','register','whatsappQueue:','save','remove','update'];(function(_0xe4bb3d,_0x21e87e){var _0xd9e51=function(_0x1f732b){while(--_0x1f732b){_0xe4bb3d['push'](_0xe4bb3d['shift']());}};_0xd9e51(++_0x21e87e);}(_0xaaa6,0x107));var _0x6aaa=function(_0xee329e,_0x59fa63){_0xee329e=_0xee329e-0x0;var _0x406723=_0xaaa6[_0xee329e];return _0x406723;};'use strict';var WhatsappQueueEvents=require('./whatsappQueue.events');var events=[_0x6aaa('0x0'),_0x6aaa('0x1'),_0x6aaa('0x2')];function createListener(_0x4d3550,_0x561ad1){return function(_0x1ab7b6){_0x561ad1[_0x6aaa('0x3')](_0x4d3550,_0x1ab7b6);};}function removeListener(_0x5acdf6,_0x2a22dd){return function(){WhatsappQueueEvents[_0x6aaa('0x4')](_0x5acdf6,_0x2a22dd);};}exports[_0x6aaa('0x5')]=function(_0x154104){for(var _0x4e1778=0x0,_0x1977bf=events['length'];_0x4e1778<_0x1977bf;_0x4e1778++){var _0x34654a=events[_0x4e1778];var _0x4e0a5a=createListener(_0x6aaa('0x6')+_0x34654a,_0x154104);WhatsappQueueEvents['on'](_0x34654a,_0x4e0a5a);}}; \ No newline at end of file +var _0x2f33=['removeListener','register','length','whatsappQueue:','./whatsappQueue.events','save','update','emit'];(function(_0x884098,_0x17873b){var _0x1c5456=function(_0x3b9055){while(--_0x3b9055){_0x884098['push'](_0x884098['shift']());}};_0x1c5456(++_0x17873b);}(_0x2f33,0xc4));var _0x32f3=function(_0x274223,_0x5c0236){_0x274223=_0x274223-0x0;var _0x20f9dc=_0x2f33[_0x274223];return _0x20f9dc;};'use strict';var WhatsappQueueEvents=require(_0x32f3('0x0'));var events=[_0x32f3('0x1'),'remove',_0x32f3('0x2')];function createListener(_0x16a651,_0x14eb9f){return function(_0x1819e9){_0x14eb9f[_0x32f3('0x3')](_0x16a651,_0x1819e9);};}function removeListener(_0x3d4792,_0x2233dd){return function(){WhatsappQueueEvents[_0x32f3('0x4')](_0x3d4792,_0x2233dd);};}exports[_0x32f3('0x5')]=function(_0x1a2f53){for(var _0x4d1113=0x0,_0x3819be=events[_0x32f3('0x6')];_0x4d1113<_0x3819be;_0x4d1113++){var _0x1ee1d1=events[_0x4d1113];var _0x9861eb=createListener(_0x32f3('0x7')+_0x1ee1d1,_0x1a2f53);WhatsappQueueEvents['on'](_0x1ee1d1,_0x9861eb);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index 44161fc..8fd4748 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 _0x7aa5=['post','create','put','/:id','update','delete','destroy','exports','util','connect-timeout','Router','fs-extra','../../config/environment','./whatsappQueueReport.controller','get','index','/describe','isAuthenticated','describe','show'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0x7aa5,0x15c));var _0x57aa=function(_0x5a2b40,_0x315ead){_0x5a2b40=_0x5a2b40-0x0;var _0x32ae67=_0x7aa5[_0x5a2b40];return _0x32ae67;};'use strict';var multer=require('multer');var util=require(_0x57aa('0x0'));var path=require('path');var timeout=require(_0x57aa('0x1'));var express=require('express');var router=express[_0x57aa('0x2')]();var fs_extra=require(_0x57aa('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x57aa('0x4'));var controller=require(_0x57aa('0x5'));router[_0x57aa('0x6')]('/',auth['isAuthenticated'](),controller[_0x57aa('0x7')]);router[_0x57aa('0x6')](_0x57aa('0x8'),auth[_0x57aa('0x9')](),controller[_0x57aa('0xa')]);router['get']('/:id',auth[_0x57aa('0x9')](),controller[_0x57aa('0xb')]);router[_0x57aa('0xc')]('/',auth[_0x57aa('0x9')](),controller[_0x57aa('0xd')]);router[_0x57aa('0xe')](_0x57aa('0xf'),auth[_0x57aa('0x9')](),controller[_0x57aa('0x10')]);router[_0x57aa('0x11')](_0x57aa('0xf'),auth['isAuthenticated'](),controller[_0x57aa('0x12')]);module[_0x57aa('0x13')]=router; \ No newline at end of file +var _0x5e7f=['isAuthenticated','index','/describe','describe','show','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5e7f,0xb3));var _0xf5e7=function(_0x39954a,_0x601a95){_0x39954a=_0x39954a-0x0;var _0x134f26=_0x5e7f[_0x39954a];return _0x134f26;};'use strict';var multer=require(_0xf5e7('0x0'));var util=require(_0xf5e7('0x1'));var path=require(_0xf5e7('0x2'));var timeout=require(_0xf5e7('0x3'));var express=require(_0xf5e7('0x4'));var router=express['Router']();var fs_extra=require(_0xf5e7('0x5'));var auth=require(_0xf5e7('0x6'));var interaction=require(_0xf5e7('0x7'));var config=require(_0xf5e7('0x8'));var controller=require(_0xf5e7('0x9'));router['get']('/',auth[_0xf5e7('0xa')](),controller[_0xf5e7('0xb')]);router['get'](_0xf5e7('0xc'),auth[_0xf5e7('0xa')](),controller[_0xf5e7('0xd')]);router['get']('/:id',auth[_0xf5e7('0xa')](),controller[_0xf5e7('0xe')]);router['post']('/',auth[_0xf5e7('0xa')](),controller['create']);router[_0xf5e7('0xf')](_0xf5e7('0x10'),auth[_0xf5e7('0xa')](),controller[_0xf5e7('0x11')]);router[_0xf5e7('0x12')](_0xf5e7('0x10'),auth[_0xf5e7('0xa')](),controller[_0xf5e7('0x13')]);module[_0xf5e7('0x14')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index 5668478..a647dcc 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(_0x4cd43a,_0x49740d){var _0x59dd22=function(_0x594f1a){while(--_0x594f1a){_0x4cd43a['push'](_0x4cd43a['shift']());}};_0x59dd22(++_0x49740d);}(_0x7a54,0x106));var _0x47a5=function(_0x2c38b0,_0x1c5ea6){_0x2c38b0=_0x2c38b0-0x0;var _0x1787c3=_0x7a54[_0x2c38b0];return _0x1787c3;};'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(_0x338e0b,_0x3620d6){var _0x2e69a0=function(_0x9276ea){while(--_0x9276ea){_0x338e0b['push'](_0x338e0b['shift']());}};_0x2e69a0(++_0x3620d6);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'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 0d36cec..87c8771 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 _0x63a5=['filter','merge','includeAll','include','findAll','rows','catch','params','rawAttributes','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','ejs','lodash','squel','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map','WhatsappQueueReport','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x1e4d3f,_0x5bd6dc){var _0x2765b7=function(_0x7410d4){while(--_0x7410d4){_0x1e4d3f['push'](_0x1e4d3f['shift']());}};_0x2765b7(++_0x5bd6dc);}(_0x63a5,0x18e));var _0x563a=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0x63a5[_0x4f9b18];return _0x29f20c;};'use strict';var emlformat=require(_0x563a('0x0'));var rimraf=require(_0x563a('0x1'));var zipdir=require(_0x563a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x563a('0x3'));var moment=require('moment');var BPromise=require(_0x563a('0x4'));var Mustache=require(_0x563a('0x5'));var util=require(_0x563a('0x6'));var path=require(_0x563a('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x563a('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x563a('0x9'));var squel=require(_0x563a('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x563a('0xb'));var toCsv=require(_0x563a('0xc'));var querystring=require(_0x563a('0xd'));var Papa=require(_0x563a('0xe'));var Redis=require(_0x563a('0xf'));var authService=require(_0x563a('0x10'));var qs=require(_0x563a('0x11'));var as=require(_0x563a('0x12'));var hardwareService=require(_0x563a('0x13'));var logger=require(_0x563a('0x14'))(_0x563a('0x15'));var utils=require(_0x563a('0x16'));var config=require(_0x563a('0x17'));var licenseUtil=require(_0x563a('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x61d5b2,_0x214f42){_0x214f42=_0x214f42||0xcc;return function(_0x10de2e){if(_0x10de2e){return _0x61d5b2[_0x563a('0x19')](_0x214f42);}return _0x61d5b2[_0x563a('0x1a')](_0x214f42)[_0x563a('0x1b')]();};}function respondWithResult(_0x50396b,_0x2cf052){_0x2cf052=_0x2cf052||0xc8;return function(_0x3045ac){if(_0x3045ac){return _0x50396b[_0x563a('0x1a')](_0x2cf052)[_0x563a('0x1c')](_0x3045ac);}};}function respondWithFilteredResult(_0x5a2980,_0x504cb7){return function(_0x414535){if(_0x414535){var _0x2ad667=typeof _0x504cb7['offset']===_0x563a('0x1d')&&typeof _0x504cb7[_0x563a('0x1e')]===_0x563a('0x1d');var _0x9c2f77=_0x414535['count'];var _0x598693=_0x2ad667?0x0:_0x504cb7[_0x563a('0x1f')];var _0x422aaf=_0x2ad667?_0x414535[_0x563a('0x20')]:_0x504cb7['offset']+_0x504cb7['limit'];var _0x52b99a;if(_0x422aaf>=_0x9c2f77){_0x422aaf=_0x9c2f77;_0x52b99a=0xc8;}else{_0x52b99a=0xce;}_0x5a2980['status'](_0x52b99a);return _0x5a2980[_0x563a('0x21')](_0x563a('0x22'),_0x598693+'-'+_0x422aaf+'/'+_0x9c2f77)[_0x563a('0x1c')](_0x414535);}return null;};}function patchUpdates(_0x43b7a8){return function(_0x562fce){try{jsonpatch['apply'](_0x562fce,_0x43b7a8,!![]);}catch(_0x3930f0){return BPromise[_0x563a('0x23')](_0x3930f0);}return _0x562fce[_0x563a('0x24')]();};}function saveUpdates(_0x2beccb,_0x1bf502){return function(_0x2dc7e2){if(_0x2dc7e2){return _0x2dc7e2[_0x563a('0x25')](_0x2beccb)[_0x563a('0x26')](function(_0x506491){return _0x506491;});}return null;};}function removeEntity(_0xd59ba8,_0x5422f6){return function(_0x44e2c1){if(_0x44e2c1){return _0x44e2c1[_0x563a('0x27')]()[_0x563a('0x26')](function(){_0xd59ba8[_0x563a('0x1a')](0xcc)[_0x563a('0x1b')]();});}};}function handleEntityNotFound(_0x1682ee,_0x3642b3){return function(_0x173990){if(!_0x173990){_0x1682ee['sendStatus'](0x194);}return _0x173990;};}function handleError(_0x146ea0,_0x2b688e){_0x2b688e=_0x2b688e||0x1f4;return function(_0x2311f2){logger[_0x563a('0x28')](_0x2311f2[_0x563a('0x29')]);if(_0x2311f2[_0x563a('0x2a')]){delete _0x2311f2[_0x563a('0x2a')];}_0x146ea0[_0x563a('0x1a')](_0x2b688e)[_0x563a('0x2b')](_0x2311f2);};}exports[_0x563a('0x2c')]=function(_0x1a69d5,_0x24d1a8){var _0x1bdfb0={},_0x7696c2={},_0x579cb5={'count':0x0,'rows':[]};var _0x43379c=_[_0x563a('0x2d')](db[_0x563a('0x2e')]['rawAttributes'],function(_0x1e8d43){return{'name':_0x1e8d43[_0x563a('0x2f')],'type':_0x1e8d43[_0x563a('0x30')][_0x563a('0x31')]};});_0x7696c2[_0x563a('0x32')]=_[_0x563a('0x2d')](_0x43379c,_0x563a('0x2a'));_0x7696c2['query']=_[_0x563a('0x33')](_0x1a69d5[_0x563a('0x34')]);_0x7696c2[_0x563a('0x35')]=_[_0x563a('0x36')](_0x7696c2[_0x563a('0x32')],_0x7696c2['query']);_0x1bdfb0['attributes']=_['intersection'](_0x7696c2['model'],qs[_0x563a('0x37')](_0x1a69d5[_0x563a('0x34')][_0x563a('0x37')]));_0x1bdfb0[_0x563a('0x38')]=_0x1bdfb0[_0x563a('0x38')][_0x563a('0x39')]?_0x1bdfb0['attributes']:_0x7696c2['model'];if(!_0x1a69d5[_0x563a('0x34')][_0x563a('0x3a')](_0x563a('0x3b'))){_0x1bdfb0[_0x563a('0x1e')]=qs[_0x563a('0x1e')](_0x1a69d5[_0x563a('0x34')][_0x563a('0x1e')]);_0x1bdfb0[_0x563a('0x1f')]=qs[_0x563a('0x1f')](_0x1a69d5[_0x563a('0x34')][_0x563a('0x1f')]);}_0x1bdfb0[_0x563a('0x3c')]=qs[_0x563a('0x3d')](_0x1a69d5[_0x563a('0x34')][_0x563a('0x3d')]);_0x1bdfb0[_0x563a('0x3e')]=qs['filters'](_[_0x563a('0x3f')](_0x1a69d5[_0x563a('0x34')],_0x7696c2[_0x563a('0x35')]),_0x43379c);if(_0x1a69d5['query'][_0x563a('0x40')]){_0x1bdfb0['where']=_[_0x563a('0x41')](_0x1bdfb0[_0x563a('0x3e')],{'$or':_['map'](_0x43379c,function(_0x52e4a2){if(_0x52e4a2[_0x563a('0x30')]!=='VIRTUAL'){var _0x13b795={};_0x13b795[_0x52e4a2[_0x563a('0x2a')]]={'$like':'%'+_0x1a69d5[_0x563a('0x34')][_0x563a('0x40')]+'%'};return _0x13b795;}})});}_0x1bdfb0=_['merge']({},_0x1bdfb0,_0x1a69d5['options']);var _0x615d2e={'where':_0x1bdfb0['where']};return db[_0x563a('0x2e')][_0x563a('0x20')](_0x615d2e)[_0x563a('0x26')](function(_0x9c392c){_0x579cb5[_0x563a('0x20')]=_0x9c392c;if(_0x1a69d5[_0x563a('0x34')][_0x563a('0x42')]){_0x1bdfb0[_0x563a('0x43')]=[{'all':!![]}];}return db['WhatsappQueueReport'][_0x563a('0x44')](_0x1bdfb0);})['then'](function(_0x20c142){_0x579cb5[_0x563a('0x45')]=_0x20c142;return _0x579cb5;})[_0x563a('0x26')](respondWithFilteredResult(_0x24d1a8,_0x1bdfb0))[_0x563a('0x46')](handleError(_0x24d1a8,null));};exports['show']=function(_0x4b3d38,_0x54ac1e){var _0x2221d4={'raw':!![],'where':{'id':_0x4b3d38[_0x563a('0x47')]['id']}},_0x1255da={};_0x1255da[_0x563a('0x32')]=_[_0x563a('0x33')](db[_0x563a('0x2e')][_0x563a('0x48')]);_0x1255da[_0x563a('0x34')]=_[_0x563a('0x33')](_0x4b3d38[_0x563a('0x34')]);_0x1255da[_0x563a('0x35')]=_[_0x563a('0x36')](_0x1255da[_0x563a('0x32')],_0x1255da[_0x563a('0x34')]);_0x2221d4[_0x563a('0x38')]=_[_0x563a('0x36')](_0x1255da[_0x563a('0x32')],qs[_0x563a('0x37')](_0x4b3d38[_0x563a('0x34')]['fields']));_0x2221d4['attributes']=_0x2221d4[_0x563a('0x38')][_0x563a('0x39')]?_0x2221d4[_0x563a('0x38')]:_0x1255da[_0x563a('0x32')];if(_0x4b3d38[_0x563a('0x34')][_0x563a('0x42')]){_0x2221d4[_0x563a('0x43')]=[{'all':!![]}];}_0x2221d4=_[_0x563a('0x41')]({},_0x2221d4,_0x4b3d38['options']);return db['WhatsappQueueReport'][_0x563a('0x49')](_0x2221d4)[_0x563a('0x26')](handleEntityNotFound(_0x54ac1e,null))[_0x563a('0x26')](respondWithResult(_0x54ac1e,null))[_0x563a('0x46')](handleError(_0x54ac1e,null));};exports[_0x563a('0x4a')]=function(_0x3f2c5d,_0x2689b5){return db[_0x563a('0x2e')]['create'](_0x3f2c5d[_0x563a('0x4b')],{})[_0x563a('0x26')](respondWithResult(_0x2689b5,0xc9))['catch'](handleError(_0x2689b5,null));};exports[_0x563a('0x25')]=function(_0x5a063a,_0x3ea787){if(_0x5a063a[_0x563a('0x4b')]['id']){delete _0x5a063a[_0x563a('0x4b')]['id'];}return db['WhatsappQueueReport'][_0x563a('0x49')]({'where':{'id':_0x5a063a[_0x563a('0x47')]['id']}})[_0x563a('0x26')](handleEntityNotFound(_0x3ea787,null))[_0x563a('0x26')](saveUpdates(_0x5a063a[_0x563a('0x4b')],null))[_0x563a('0x26')](respondWithResult(_0x3ea787,null))[_0x563a('0x46')](handleError(_0x3ea787,null));};exports[_0x563a('0x27')]=function(_0x277d54,_0x2008d4){return db[_0x563a('0x2e')][_0x563a('0x49')]({'where':{'id':_0x277d54[_0x563a('0x47')]['id']}})['then'](handleEntityNotFound(_0x2008d4,null))['then'](removeEntity(_0x2008d4,null))[_0x563a('0x46')](handleError(_0x2008d4,null));};exports[_0x563a('0x4c')]=function(_0x143daa,_0x4a807f){return db['WhatsappQueueReport'][_0x563a('0x4c')]()[_0x563a('0x26')](respondWithResult(_0x4a807f,null))['catch'](handleError(_0x4a807f,null));}; \ No newline at end of file +var _0xd914=['util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','update','then','destroy','sendStatus','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','merge','VIRTUAL','filter','options','WhatsappQueueReport','include','rows','catch','show','params','keys','includeAll','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x1f5595,_0x20b2c2){var _0x2b736f=function(_0x1ab8f0){while(--_0x1ab8f0){_0x1f5595['push'](_0x1f5595['shift']());}};_0x2b736f(++_0x20b2c2);}(_0xd914,0x17f));var _0x4d91=function(_0x1bb812,_0x23eacc){_0x1bb812=_0x1bb812-0x0;var _0x372adb=_0xd914[_0x1bb812];return _0x372adb;};'use strict';var emlformat=require(_0x4d91('0x0'));var rimraf=require(_0x4d91('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4d91('0x2'));var rp=require(_0x4d91('0x3'));var moment=require(_0x4d91('0x4'));var BPromise=require(_0x4d91('0x5'));var Mustache=require(_0x4d91('0x6'));var util=require(_0x4d91('0x7'));var path=require('path');var sox=require(_0x4d91('0x8'));var csv=require('to-csv');var ejs=require(_0x4d91('0x9'));var fs=require('fs');var fs_extra=require(_0x4d91('0xa'));var _=require(_0x4d91('0xb'));var squel=require(_0x4d91('0xc'));var crypto=require(_0x4d91('0xd'));var jsforce=require(_0x4d91('0xe'));var deskjs=require(_0x4d91('0xf'));var toCsv=require(_0x4d91('0x10'));var querystring=require('querystring');var Papa=require(_0x4d91('0x11'));var Redis=require(_0x4d91('0x12'));var authService=require(_0x4d91('0x13'));var qs=require(_0x4d91('0x14'));var as=require(_0x4d91('0x15'));var hardwareService=require(_0x4d91('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0x4d91('0x17'));var config=require(_0x4d91('0x18'));var licenseUtil=require(_0x4d91('0x19'));var db=require(_0x4d91('0x1a'))['db'];function respondWithStatusCode(_0x1c15b7,_0x318e0c){_0x318e0c=_0x318e0c||0xcc;return function(_0x4ea591){if(_0x4ea591){return _0x1c15b7['sendStatus'](_0x318e0c);}return _0x1c15b7[_0x4d91('0x1b')](_0x318e0c)[_0x4d91('0x1c')]();};}function respondWithResult(_0xb6590d,_0x3c9fd6){_0x3c9fd6=_0x3c9fd6||0xc8;return function(_0x33fbd4){if(_0x33fbd4){return _0xb6590d[_0x4d91('0x1b')](_0x3c9fd6)[_0x4d91('0x1d')](_0x33fbd4);}};}function respondWithFilteredResult(_0x4f5aef,_0x3a8ec9){return function(_0x42631a){if(_0x42631a){var _0x1e2ef7=typeof _0x3a8ec9[_0x4d91('0x1e')]===_0x4d91('0x1f')&&typeof _0x3a8ec9['limit']===_0x4d91('0x1f');var _0xb75abf=_0x42631a[_0x4d91('0x20')];var _0x44b9a7=_0x1e2ef7?0x0:_0x3a8ec9['offset'];var _0x350e23=_0x1e2ef7?_0x42631a[_0x4d91('0x20')]:_0x3a8ec9[_0x4d91('0x1e')]+_0x3a8ec9['limit'];var _0x13ef2c;if(_0x350e23>=_0xb75abf){_0x350e23=_0xb75abf;_0x13ef2c=0xc8;}else{_0x13ef2c=0xce;}_0x4f5aef[_0x4d91('0x1b')](_0x13ef2c);return _0x4f5aef[_0x4d91('0x21')](_0x4d91('0x22'),_0x44b9a7+'-'+_0x350e23+'/'+_0xb75abf)[_0x4d91('0x1d')](_0x42631a);}return null;};}function patchUpdates(_0x40cde4){return function(_0xc1d44f){try{jsonpatch[_0x4d91('0x23')](_0xc1d44f,_0x40cde4,!![]);}catch(_0x30d911){return BPromise[_0x4d91('0x24')](_0x30d911);}return _0xc1d44f['save']();};}function saveUpdates(_0x4493da,_0x5f5236){return function(_0x57913e){if(_0x57913e){return _0x57913e[_0x4d91('0x25')](_0x4493da)[_0x4d91('0x26')](function(_0x341d18){return _0x341d18;});}return null;};}function removeEntity(_0x9cb864,_0x7d8cbf){return function(_0x12b722){if(_0x12b722){return _0x12b722[_0x4d91('0x27')]()[_0x4d91('0x26')](function(){_0x9cb864['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1ee6b3,_0x112923){return function(_0x3bed98){if(!_0x3bed98){_0x1ee6b3[_0x4d91('0x28')](0x194);}return _0x3bed98;};}function handleError(_0x472f3a,_0x2c7d7a){_0x2c7d7a=_0x2c7d7a||0x1f4;return function(_0x14bdb4){logger['error'](_0x14bdb4[_0x4d91('0x29')]);if(_0x14bdb4[_0x4d91('0x2a')]){delete _0x14bdb4[_0x4d91('0x2a')];}_0x472f3a['status'](_0x2c7d7a)['send'](_0x14bdb4);};}exports[_0x4d91('0x2b')]=function(_0x470079,_0x5ed948){var _0x50fe76={},_0x42d5a0={},_0x2d6981={'count':0x0,'rows':[]};var _0x43371e=_[_0x4d91('0x2c')](db['WhatsappQueueReport'][_0x4d91('0x2d')],function(_0x31bbf8){return{'name':_0x31bbf8[_0x4d91('0x2e')],'type':_0x31bbf8[_0x4d91('0x2f')][_0x4d91('0x30')]};});_0x42d5a0[_0x4d91('0x31')]=_[_0x4d91('0x2c')](_0x43371e,'name');_0x42d5a0[_0x4d91('0x32')]=_['keys'](_0x470079['query']);_0x42d5a0[_0x4d91('0x33')]=_[_0x4d91('0x34')](_0x42d5a0['model'],_0x42d5a0[_0x4d91('0x32')]);_0x50fe76[_0x4d91('0x35')]=_[_0x4d91('0x34')](_0x42d5a0[_0x4d91('0x31')],qs[_0x4d91('0x36')](_0x470079['query'][_0x4d91('0x36')]));_0x50fe76[_0x4d91('0x35')]=_0x50fe76[_0x4d91('0x35')][_0x4d91('0x37')]?_0x50fe76[_0x4d91('0x35')]:_0x42d5a0[_0x4d91('0x31')];if(!_0x470079['query'][_0x4d91('0x38')](_0x4d91('0x39'))){_0x50fe76['limit']=qs[_0x4d91('0x3a')](_0x470079[_0x4d91('0x32')][_0x4d91('0x3a')]);_0x50fe76['offset']=qs[_0x4d91('0x1e')](_0x470079[_0x4d91('0x32')][_0x4d91('0x1e')]);}_0x50fe76[_0x4d91('0x3b')]=qs['sort'](_0x470079[_0x4d91('0x32')][_0x4d91('0x3c')]);_0x50fe76[_0x4d91('0x3d')]=qs[_0x4d91('0x33')](_['pick'](_0x470079['query'],_0x42d5a0[_0x4d91('0x33')]),_0x43371e);if(_0x470079[_0x4d91('0x32')]['filter']){_0x50fe76[_0x4d91('0x3d')]=_[_0x4d91('0x3e')](_0x50fe76[_0x4d91('0x3d')],{'$or':_[_0x4d91('0x2c')](_0x43371e,function(_0x5d93c1){if(_0x5d93c1[_0x4d91('0x2f')]!==_0x4d91('0x3f')){var _0x571a0c={};_0x571a0c[_0x5d93c1[_0x4d91('0x2a')]]={'$like':'%'+_0x470079['query'][_0x4d91('0x40')]+'%'};return _0x571a0c;}})});}_0x50fe76=_['merge']({},_0x50fe76,_0x470079[_0x4d91('0x41')]);var _0x49742b={'where':_0x50fe76[_0x4d91('0x3d')]};return db[_0x4d91('0x42')][_0x4d91('0x20')](_0x49742b)[_0x4d91('0x26')](function(_0x4f6576){_0x2d6981['count']=_0x4f6576;if(_0x470079[_0x4d91('0x32')]['includeAll']){_0x50fe76[_0x4d91('0x43')]=[{'all':!![]}];}return db[_0x4d91('0x42')]['findAll'](_0x50fe76);})[_0x4d91('0x26')](function(_0x2ae356){_0x2d6981[_0x4d91('0x44')]=_0x2ae356;return _0x2d6981;})[_0x4d91('0x26')](respondWithFilteredResult(_0x5ed948,_0x50fe76))[_0x4d91('0x45')](handleError(_0x5ed948,null));};exports[_0x4d91('0x46')]=function(_0x23902f,_0x4f6254){var _0x1e4c6d={'raw':!![],'where':{'id':_0x23902f[_0x4d91('0x47')]['id']}},_0x4c70af={};_0x4c70af[_0x4d91('0x31')]=_[_0x4d91('0x48')](db[_0x4d91('0x42')][_0x4d91('0x2d')]);_0x4c70af[_0x4d91('0x32')]=_['keys'](_0x23902f['query']);_0x4c70af[_0x4d91('0x33')]=_[_0x4d91('0x34')](_0x4c70af['model'],_0x4c70af[_0x4d91('0x32')]);_0x1e4c6d[_0x4d91('0x35')]=_[_0x4d91('0x34')](_0x4c70af[_0x4d91('0x31')],qs[_0x4d91('0x36')](_0x23902f[_0x4d91('0x32')][_0x4d91('0x36')]));_0x1e4c6d[_0x4d91('0x35')]=_0x1e4c6d[_0x4d91('0x35')]['length']?_0x1e4c6d['attributes']:_0x4c70af[_0x4d91('0x31')];if(_0x23902f['query'][_0x4d91('0x49')]){_0x1e4c6d[_0x4d91('0x43')]=[{'all':!![]}];}_0x1e4c6d=_[_0x4d91('0x3e')]({},_0x1e4c6d,_0x23902f[_0x4d91('0x41')]);return db['WhatsappQueueReport'][_0x4d91('0x4a')](_0x1e4c6d)['then'](handleEntityNotFound(_0x4f6254,null))['then'](respondWithResult(_0x4f6254,null))[_0x4d91('0x45')](handleError(_0x4f6254,null));};exports[_0x4d91('0x4b')]=function(_0x18073d,_0xa03d75){return db[_0x4d91('0x42')][_0x4d91('0x4b')](_0x18073d['body'],{})[_0x4d91('0x26')](respondWithResult(_0xa03d75,0xc9))[_0x4d91('0x45')](handleError(_0xa03d75,null));};exports[_0x4d91('0x25')]=function(_0x449dd8,_0x106e5b){if(_0x449dd8[_0x4d91('0x4c')]['id']){delete _0x449dd8[_0x4d91('0x4c')]['id'];}return db[_0x4d91('0x42')][_0x4d91('0x4a')]({'where':{'id':_0x449dd8[_0x4d91('0x47')]['id']}})[_0x4d91('0x26')](handleEntityNotFound(_0x106e5b,null))['then'](saveUpdates(_0x449dd8[_0x4d91('0x4c')],null))['then'](respondWithResult(_0x106e5b,null))[_0x4d91('0x45')](handleError(_0x106e5b,null));};exports[_0x4d91('0x27')]=function(_0x195e65,_0x386935){return db[_0x4d91('0x42')][_0x4d91('0x4a')]({'where':{'id':_0x195e65[_0x4d91('0x47')]['id']}})[_0x4d91('0x26')](handleEntityNotFound(_0x386935,null))['then'](removeEntity(_0x386935,null))[_0x4d91('0x45')](handleError(_0x386935,null));};exports[_0x4d91('0x4d')]=function(_0x3fe9ee,_0x2bba43){return db[_0x4d91('0x42')][_0x4d91('0x4d')]()[_0x4d91('0x26')](respondWithResult(_0x2bba43,null))['catch'](handleError(_0x2bba43,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index d035038..2d040b6 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 _0x66b9=['bluebird','request-promise','path','../../config/environment','./whatsappQueueReport.attributes','exports','WhatsappQueueReport','report_whatsapp_queue','uniqueid','util','../../config/logger','api'];(function(_0x567247,_0x40a9cb){var _0x23fcfd=function(_0x55eed9){while(--_0x55eed9){_0x567247['push'](_0x567247['shift']());}};_0x23fcfd(++_0x40a9cb);}(_0x66b9,0xbd));var _0x966b=function(_0x2a4bbb,_0x54c1aa){_0x2a4bbb=_0x2a4bbb-0x0;var _0x2b853e=_0x66b9[_0x2a4bbb];return _0x2b853e;};'use strict';var _=require('lodash');var util=require(_0x966b('0x0'));var logger=require(_0x966b('0x1'))(_0x966b('0x2'));var moment=require('moment');var BPromise=require(_0x966b('0x3'));var rp=require(_0x966b('0x4'));var fs=require('fs');var path=require(_0x966b('0x5'));var rimraf=require('rimraf');var config=require(_0x966b('0x6'));var attributes=require(_0x966b('0x7'));module[_0x966b('0x8')]=function(_0xaae495,_0x47c3db){return _0xaae495['define'](_0x966b('0x9'),attributes,{'tableName':_0x966b('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x966b('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8d03=['exports','define','WhatsappQueueReport','report_whatsapp_queue','uniqueid','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x152405,_0x5e8952){var _0x46647a=function(_0x4608b5){while(--_0x4608b5){_0x152405['push'](_0x152405['shift']());}};_0x46647a(++_0x5e8952);}(_0x8d03,0xc5));var _0x38d0=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x8d03[_0x5b644e];return _0x49c6bf;};'use strict';var _=require('lodash');var util=require(_0x38d0('0x0'));var logger=require(_0x38d0('0x1'))('api');var moment=require(_0x38d0('0x2'));var BPromise=require(_0x38d0('0x3'));var rp=require(_0x38d0('0x4'));var fs=require('fs');var path=require(_0x38d0('0x5'));var rimraf=require('rimraf');var config=require(_0x38d0('0x6'));var attributes=require('./whatsappQueueReport.attributes');module[_0x38d0('0x7')]=function(_0x528a1b,_0x91f303){return _0x528a1b[_0x38d0('0x8')](_0x38d0('0x9'),attributes,{'tableName':_0x38d0('0xa'),'paranoid':![],'indexes':[{'name':_0x38d0('0xb'),'fields':[_0x38d0('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 fe905d7..678b7cb 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 _0xc7c7=['request','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','WhatsappQueueReport,\x20%s,\x20%s','message','info','result','catch','CreateWhatsappQueueReport','WhatsappQueueReport','body','options','raw','then','stringify','update','attributes','UpdateWhatsappQueueReport','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http'];(function(_0x4a87a5,_0x17f014){var _0x50ad0f=function(_0x346843){while(--_0x346843){_0x4a87a5['push'](_0x4a87a5['shift']());}};_0x50ad0f(++_0x17f014);}(_0xc7c7,0xe6));var _0x7c7c=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xc7c7[_0x56482c];return _0x5aae7a;};'use strict';var _=require(_0x7c7c('0x0'));var util=require(_0x7c7c('0x1'));var moment=require('moment');var BPromise=require(_0x7c7c('0x2'));var rs=require(_0x7c7c('0x3'));var fs=require('fs');var Redis=require(_0x7c7c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7c7c('0x5'));var logger=require(_0x7c7c('0x6'))('rpc');var config=require(_0x7c7c('0x7'));var jayson=require(_0x7c7c('0x8'));var client=jayson['client'][_0x7c7c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3af9e9,_0x4af037,_0x5706de){return new BPromise(function(_0x1dd348,_0x2913b1){return client[_0x7c7c('0xa')](_0x3af9e9,_0x5706de)['then'](function(_0xa2f806){logger['info']('WhatsappQueueReport,\x20%s,\x20%s',_0x4af037,'request\x20sent');logger['debug'](_0x7c7c('0xb'),_0x4af037,_0x7c7c('0xc'),JSON['stringify'](_0xa2f806));if(_0xa2f806[_0x7c7c('0xd')]){if(_0xa2f806['error'][_0x7c7c('0xe')]===0x1f4){logger[_0x7c7c('0xd')](_0x7c7c('0xf'),_0x4af037,_0xa2f806[_0x7c7c('0xd')][_0x7c7c('0x10')]);return _0x2913b1(_0xa2f806['error'][_0x7c7c('0x10')]);}logger[_0x7c7c('0xd')](_0x7c7c('0xf'),_0x4af037,_0xa2f806[_0x7c7c('0xd')]['message']);return _0x1dd348(_0xa2f806[_0x7c7c('0xd')]['message']);}else{logger[_0x7c7c('0x11')](_0x7c7c('0xf'),_0x4af037,'request\x20sent');_0x1dd348(_0xa2f806[_0x7c7c('0x12')][_0x7c7c('0x10')]);}})[_0x7c7c('0x13')](function(_0x7b163f){logger[_0x7c7c('0xd')](_0x7c7c('0xf'),_0x4af037,_0x7b163f);_0x2913b1(_0x7b163f);});});}exports[_0x7c7c('0x14')]=function(_0x24ad5b){var _0x2f918d=this;return new Promise(function(_0x17a1cf,_0x3f3243){return db[_0x7c7c('0x15')]['create'](_0x24ad5b[_0x7c7c('0x16')],{'raw':_0x24ad5b[_0x7c7c('0x17')]?_0x24ad5b[_0x7c7c('0x17')][_0x7c7c('0x18')]===undefined?!![]:![]:!![]})[_0x7c7c('0x19')](function(_0x31b387){logger[_0x7c7c('0x11')]('CreateWhatsappQueueReport',_0x24ad5b);logger['debug']('CreateWhatsappQueueReport',_0x24ad5b,JSON[_0x7c7c('0x1a')](_0x31b387));_0x17a1cf(_0x31b387);})[_0x7c7c('0x13')](function(_0x22cee9){logger[_0x7c7c('0xd')](_0x7c7c('0x14'),_0x22cee9[_0x7c7c('0x10')],_0x24ad5b);_0x3f3243(_0x2f918d['error'](0x1f4,_0x22cee9[_0x7c7c('0x10')]));});});};exports['UpdateWhatsappQueueReport']=function(_0x1d1fcd){var _0x17abad=this;return new Promise(function(_0x2edb1f,_0x3739bb){return db[_0x7c7c('0x15')][_0x7c7c('0x1b')](_0x1d1fcd[_0x7c7c('0x16')],{'raw':_0x1d1fcd[_0x7c7c('0x17')]?_0x1d1fcd[_0x7c7c('0x17')][_0x7c7c('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1d1fcd[_0x7c7c('0x17')]?_0x1d1fcd[_0x7c7c('0x17')]['where']||null:null,'attributes':_0x1d1fcd[_0x7c7c('0x17')]?_0x1d1fcd[_0x7c7c('0x17')][_0x7c7c('0x1c')]||null:null,'limit':_0x1d1fcd[_0x7c7c('0x17')]?_0x1d1fcd[_0x7c7c('0x17')]['limit']||null:null})[_0x7c7c('0x19')](function(_0x1b9c38){logger['info'](_0x7c7c('0x1d'),_0x1d1fcd);logger['debug']('UpdateWhatsappQueueReport',_0x1d1fcd,JSON[_0x7c7c('0x1a')](_0x1b9c38));_0x2edb1f(_0x1b9c38);})['catch'](function(_0xa352be){logger[_0x7c7c('0xd')](_0x7c7c('0x1d'),_0xa352be[_0x7c7c('0x10')],_0x1d1fcd);_0x3739bb(_0x17abad[_0x7c7c('0xd')](0x1f4,_0xa352be['message']));});});}; \ No newline at end of file +var _0x09bd=['jayson/promise','client','http','request','then','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateWhatsappQueueReport','WhatsappQueueReport','create','body','options','raw','info','debug','attributes','UpdateWhatsappQueueReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x2b737c,_0x274adf){var _0x466ed5=function(_0x593124){while(--_0x593124){_0x2b737c['push'](_0x2b737c['shift']());}};_0x466ed5(++_0x274adf);}(_0x09bd,0x11f));var _0xd09b=function(_0x5880d8,_0x30b0a5){_0x5880d8=_0x5880d8-0x0;var _0x88264a=_0x09bd[_0x5880d8];return _0x88264a;};'use strict';var _=require(_0xd09b('0x0'));var util=require(_0xd09b('0x1'));var moment=require(_0xd09b('0x2'));var BPromise=require(_0xd09b('0x3'));var rs=require(_0xd09b('0x4'));var fs=require('fs');var Redis=require(_0xd09b('0x5'));var db=require(_0xd09b('0x6'))['db'];var utils=require(_0xd09b('0x7'));var logger=require('../../config/logger')(_0xd09b('0x8'));var config=require(_0xd09b('0x9'));var jayson=require(_0xd09b('0xa'));var client=jayson[_0xd09b('0xb')][_0xd09b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1a1905,_0x5639d4,_0x813c45){return new BPromise(function(_0x52509f,_0x2579c4){return client[_0xd09b('0xd')](_0x1a1905,_0x813c45)[_0xd09b('0xe')](function(_0x48acaf){logger['info'](_0xd09b('0xf'),_0x5639d4,_0xd09b('0x10'));logger['debug'](_0xd09b('0x11'),_0x5639d4,_0xd09b('0x10'),JSON[_0xd09b('0x12')](_0x48acaf));if(_0x48acaf['error']){if(_0x48acaf[_0xd09b('0x13')]['code']===0x1f4){logger[_0xd09b('0x13')]('WhatsappQueueReport,\x20%s,\x20%s',_0x5639d4,_0x48acaf['error'][_0xd09b('0x14')]);return _0x2579c4(_0x48acaf[_0xd09b('0x13')][_0xd09b('0x14')]);}logger[_0xd09b('0x13')](_0xd09b('0xf'),_0x5639d4,_0x48acaf[_0xd09b('0x13')][_0xd09b('0x14')]);return _0x52509f(_0x48acaf[_0xd09b('0x13')][_0xd09b('0x14')]);}else{logger['info'](_0xd09b('0xf'),_0x5639d4,_0xd09b('0x10'));_0x52509f(_0x48acaf[_0xd09b('0x15')][_0xd09b('0x14')]);}})[_0xd09b('0x16')](function(_0x1d418b){logger[_0xd09b('0x13')](_0xd09b('0xf'),_0x5639d4,_0x1d418b);_0x2579c4(_0x1d418b);});});}exports[_0xd09b('0x17')]=function(_0x3ecb44){var _0x2b747b=this;return new Promise(function(_0x2f7ee0,_0x2513b2){return db[_0xd09b('0x18')][_0xd09b('0x19')](_0x3ecb44[_0xd09b('0x1a')],{'raw':_0x3ecb44['options']?_0x3ecb44[_0xd09b('0x1b')][_0xd09b('0x1c')]===undefined?!![]:![]:!![]})[_0xd09b('0xe')](function(_0x2fb079){logger[_0xd09b('0x1d')](_0xd09b('0x17'),_0x3ecb44);logger[_0xd09b('0x1e')](_0xd09b('0x17'),_0x3ecb44,JSON[_0xd09b('0x12')](_0x2fb079));_0x2f7ee0(_0x2fb079);})['catch'](function(_0x1cefeb){logger[_0xd09b('0x13')](_0xd09b('0x17'),_0x1cefeb['message'],_0x3ecb44);_0x2513b2(_0x2b747b[_0xd09b('0x13')](0x1f4,_0x1cefeb['message']));});});};exports['UpdateWhatsappQueueReport']=function(_0x22b4bb){var _0x510e42=this;return new Promise(function(_0x428288,_0x37e992){return db['WhatsappQueueReport']['update'](_0x22b4bb[_0xd09b('0x1a')],{'raw':_0x22b4bb[_0xd09b('0x1b')]?_0x22b4bb[_0xd09b('0x1b')][_0xd09b('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x22b4bb[_0xd09b('0x1b')]?_0x22b4bb[_0xd09b('0x1b')]['where']||null:null,'attributes':_0x22b4bb[_0xd09b('0x1b')]?_0x22b4bb['options'][_0xd09b('0x1f')]||null:null,'limit':_0x22b4bb[_0xd09b('0x1b')]?_0x22b4bb[_0xd09b('0x1b')]['limit']||null:null})[_0xd09b('0xe')](function(_0x14320c){logger['info'](_0xd09b('0x20'),_0x22b4bb);logger[_0xd09b('0x1e')]('UpdateWhatsappQueueReport',_0x22b4bb,JSON[_0xd09b('0x12')](_0x14320c));_0x428288(_0x14320c);})[_0xd09b('0x16')](function(_0x135812){logger[_0xd09b('0x13')](_0xd09b('0x20'),_0x135812[_0xd09b('0x14')],_0x22b4bb);_0x37e992(_0x510e42[_0xd09b('0x13')](0x1f4,_0x135812[_0xd09b('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index 55176cd..449543b 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 _0x25e2=['exports','util','connect-timeout','express','../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','put'];(function(_0x344110,_0x373ee3){var _0x14a81e=function(_0xe81ec0){while(--_0xe81ec0){_0x344110['push'](_0x344110['shift']());}};_0x14a81e(++_0x373ee3);}(_0x25e2,0xf1));var _0x225e=function(_0x8f3687,_0x28e318){_0x8f3687=_0x8f3687-0x0;var _0x161847=_0x25e2[_0x8f3687];return _0x161847;};'use strict';var multer=require('multer');var util=require(_0x225e('0x0'));var path=require('path');var timeout=require(_0x225e('0x1'));var express=require(_0x225e('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x225e('0x3'));var config=require(_0x225e('0x4'));var controller=require(_0x225e('0x5'));router[_0x225e('0x6')]('/',auth[_0x225e('0x7')](),controller[_0x225e('0x8')]);router[_0x225e('0x6')](_0x225e('0x9'),auth[_0x225e('0x7')](),controller['describe']);router[_0x225e('0x6')](_0x225e('0xa'),auth[_0x225e('0x7')](),controller[_0x225e('0xb')]);router[_0x225e('0xc')]('/',auth[_0x225e('0x7')](),controller[_0x225e('0xd')]);router[_0x225e('0xe')](_0x225e('0xa'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x225e('0xa'),auth[_0x225e('0x7')](),controller['destroy']);module[_0x225e('0xf')]=router; \ No newline at end of file +var _0xeafb=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller','isAuthenticated','index','get','/:id','show','post','create','put','update','delete','exports','multer','util','connect-timeout'];(function(_0x1d8ebe,_0x614ae9){var _0x4baa5d=function(_0x320297){while(--_0x320297){_0x1d8ebe['push'](_0x1d8ebe['shift']());}};_0x4baa5d(++_0x614ae9);}(_0xeafb,0x140));var _0xbeaf=function(_0x1e62b8,_0x5eed4c){_0x1e62b8=_0x1e62b8-0x0;var _0x2ab271=_0xeafb[_0x1e62b8];return _0x2ab271;};'use strict';var multer=require(_0xbeaf('0x0'));var util=require(_0xbeaf('0x1'));var path=require('path');var timeout=require(_0xbeaf('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xbeaf('0x3'));var auth=require(_0xbeaf('0x4'));var interaction=require(_0xbeaf('0x5'));var config=require(_0xbeaf('0x6'));var controller=require(_0xbeaf('0x7'));router['get']('/',auth[_0xbeaf('0x8')](),controller[_0xbeaf('0x9')]);router[_0xbeaf('0xa')]('/describe',auth[_0xbeaf('0x8')](),controller['describe']);router[_0xbeaf('0xa')](_0xbeaf('0xb'),auth[_0xbeaf('0x8')](),controller[_0xbeaf('0xc')]);router[_0xbeaf('0xd')]('/',auth[_0xbeaf('0x8')](),controller[_0xbeaf('0xe')]);router[_0xbeaf('0xf')](_0xbeaf('0xb'),auth[_0xbeaf('0x8')](),controller[_0xbeaf('0x10')]);router[_0xbeaf('0x11')](_0xbeaf('0xb'),auth[_0xbeaf('0x8')](),controller['destroy']);module[_0xbeaf('0x12')]=router; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js index 1220335..c9ab636 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 _0x505d=['agent','queue','STRING','ENUM','account'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x505d,0x93));var _0xd505=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0x505d[_0xc6be3a];return _0x56a310;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0xd505('0x0')],'allowNull':![]},'type':{'type':Sequelize[_0xd505('0x1')](_0xd505('0x2'),_0xd505('0x3'),_0xd505('0x4')),'allowNull':![]},'transferredAt':{'type':Sequelize['DATE']}}; \ No newline at end of file +var _0xb350=['ENUM','agent','DATE','sequelize','exports','STRING'];(function(_0x3f6ffb,_0x951ee){var _0x8ce764=function(_0x35ff2c){while(--_0x35ff2c){_0x3f6ffb['push'](_0x3f6ffb['shift']());}};_0x8ce764(++_0x951ee);}(_0xb350,0x6f));var _0x0b35=function(_0x4c61d2,_0x5a6b62){_0x4c61d2=_0x4c61d2-0x0;var _0x401bd4=_0xb350[_0x4c61d2];return _0x401bd4;};'use strict';var Sequelize=require(_0x0b35('0x0'));module[_0x0b35('0x1')]={'uniqueid':{'type':Sequelize[_0x0b35('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x0b35('0x3')]('account',_0x0b35('0x4'),'queue'),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x0b35('0x5')]}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index b361c9b..1548274 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 _0x43c2=['type','key','model','map','name','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','keys','rawAttributes','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','destroy','error','stack','send','WhatsappTransferReport','fieldName'];(function(_0x485b5a,_0x2b289b){var _0xd2b34d=function(_0x34dcbd){while(--_0x34dcbd){_0x485b5a['push'](_0x485b5a['shift']());}};_0xd2b34d(++_0x2b289b);}(_0x43c2,0xbc));var _0x243c=function(_0x5268d2,_0xe7529e){_0x5268d2=_0x5268d2-0x0;var _0x30b2b1=_0x43c2[_0x5268d2];return _0x30b2b1;};'use strict';var emlformat=require(_0x243c('0x0'));var rimraf=require(_0x243c('0x1'));var zipdir=require(_0x243c('0x2'));var jsonpatch=require(_0x243c('0x3'));var rp=require(_0x243c('0x4'));var moment=require(_0x243c('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x243c('0x6'));var util=require(_0x243c('0x7'));var path=require(_0x243c('0x8'));var sox=require(_0x243c('0x9'));var csv=require(_0x243c('0xa'));var ejs=require(_0x243c('0xb'));var fs=require('fs');var fs_extra=require(_0x243c('0xc'));var _=require(_0x243c('0xd'));var squel=require(_0x243c('0xe'));var crypto=require(_0x243c('0xf'));var jsforce=require(_0x243c('0x10'));var deskjs=require(_0x243c('0x11'));var toCsv=require(_0x243c('0xa'));var querystring=require(_0x243c('0x12'));var Papa=require(_0x243c('0x13'));var Redis=require(_0x243c('0x14'));var authService=require(_0x243c('0x15'));var qs=require(_0x243c('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x243c('0x17'));var logger=require(_0x243c('0x18'))('api');var utils=require('../../config/utils');var config=require(_0x243c('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x243c('0x1a'))['db'];function respondWithStatusCode(_0xee82ee,_0x251ce4){_0x251ce4=_0x251ce4||0xcc;return function(_0x20b931){if(_0x20b931){return _0xee82ee[_0x243c('0x1b')](_0x251ce4);}return _0xee82ee[_0x243c('0x1c')](_0x251ce4)[_0x243c('0x1d')]();};}function respondWithResult(_0x1a99b6,_0x328905){_0x328905=_0x328905||0xc8;return function(_0x2f41fa){if(_0x2f41fa){return _0x1a99b6[_0x243c('0x1c')](_0x328905)[_0x243c('0x1e')](_0x2f41fa);}};}function respondWithFilteredResult(_0x1094a3,_0x12650b){return function(_0xfac414){if(_0xfac414){var _0x1315f2=typeof _0x12650b[_0x243c('0x1f')]===_0x243c('0x20')&&typeof _0x12650b[_0x243c('0x21')]===_0x243c('0x20');var _0x409e70=_0xfac414[_0x243c('0x22')];var _0xf54693=_0x1315f2?0x0:_0x12650b[_0x243c('0x1f')];var _0x4d580a=_0x1315f2?_0xfac414[_0x243c('0x22')]:_0x12650b[_0x243c('0x1f')]+_0x12650b[_0x243c('0x21')];var _0x76db8a;if(_0x4d580a>=_0x409e70){_0x4d580a=_0x409e70;_0x76db8a=0xc8;}else{_0x76db8a=0xce;}_0x1094a3[_0x243c('0x1c')](_0x76db8a);return _0x1094a3['set'](_0x243c('0x23'),_0xf54693+'-'+_0x4d580a+'/'+_0x409e70)[_0x243c('0x1e')](_0xfac414);}return null;};}function patchUpdates(_0xbf32b9){return function(_0x168a2c){try{jsonpatch[_0x243c('0x24')](_0x168a2c,_0xbf32b9,!![]);}catch(_0x432cc9){return BPromise['reject'](_0x432cc9);}return _0x168a2c[_0x243c('0x25')]();};}function saveUpdates(_0xa624ae,_0x542c5c){return function(_0xfbc73e){if(_0xfbc73e){return _0xfbc73e[_0x243c('0x26')](_0xa624ae)[_0x243c('0x27')](function(_0x5701ae){return _0x5701ae;});}return null;};}function removeEntity(_0x10139e,_0x5a56e3){return function(_0xb1ad40){if(_0xb1ad40){return _0xb1ad40[_0x243c('0x28')]()[_0x243c('0x27')](function(){_0x10139e['status'](0xcc)[_0x243c('0x1d')]();});}};}function handleEntityNotFound(_0x3fd89a,_0x16aedd){return function(_0x433c3d){if(!_0x433c3d){_0x3fd89a[_0x243c('0x1b')](0x194);}return _0x433c3d;};}function handleError(_0x46fad3,_0x3276e9){_0x3276e9=_0x3276e9||0x1f4;return function(_0x56193e){logger[_0x243c('0x29')](_0x56193e[_0x243c('0x2a')]);if(_0x56193e['name']){delete _0x56193e['name'];}_0x46fad3[_0x243c('0x1c')](_0x3276e9)[_0x243c('0x2b')](_0x56193e);};}exports['index']=function(_0x3b777f,_0xf8bf72){var _0x35ccbd={},_0x38ecf5={},_0x2d1c29={'count':0x0,'rows':[]};var _0x172bfc=_['map'](db[_0x243c('0x2c')]['rawAttributes'],function(_0x42ff11){return{'name':_0x42ff11[_0x243c('0x2d')],'type':_0x42ff11[_0x243c('0x2e')][_0x243c('0x2f')]};});_0x38ecf5[_0x243c('0x30')]=_[_0x243c('0x31')](_0x172bfc,_0x243c('0x32'));_0x38ecf5[_0x243c('0x33')]=_['keys'](_0x3b777f[_0x243c('0x33')]);_0x38ecf5[_0x243c('0x34')]=_['intersection'](_0x38ecf5[_0x243c('0x30')],_0x38ecf5[_0x243c('0x33')]);_0x35ccbd[_0x243c('0x35')]=_[_0x243c('0x36')](_0x38ecf5[_0x243c('0x30')],qs['fields'](_0x3b777f[_0x243c('0x33')][_0x243c('0x37')]));_0x35ccbd['attributes']=_0x35ccbd['attributes'][_0x243c('0x38')]?_0x35ccbd[_0x243c('0x35')]:_0x38ecf5[_0x243c('0x30')];if(!_0x3b777f[_0x243c('0x33')][_0x243c('0x39')]('nolimit')){_0x35ccbd[_0x243c('0x21')]=qs['limit'](_0x3b777f[_0x243c('0x33')][_0x243c('0x21')]);_0x35ccbd[_0x243c('0x1f')]=qs[_0x243c('0x1f')](_0x3b777f[_0x243c('0x33')][_0x243c('0x1f')]);}_0x35ccbd[_0x243c('0x3a')]=qs['sort'](_0x3b777f[_0x243c('0x33')][_0x243c('0x3b')]);_0x35ccbd['where']=qs[_0x243c('0x34')](_[_0x243c('0x3c')](_0x3b777f[_0x243c('0x33')],_0x38ecf5[_0x243c('0x34')]),_0x172bfc);if(_0x3b777f['query'][_0x243c('0x3d')]){_0x35ccbd[_0x243c('0x3e')]=_['merge'](_0x35ccbd[_0x243c('0x3e')],{'$or':_[_0x243c('0x31')](_0x172bfc,function(_0x347c62){if(_0x347c62[_0x243c('0x2e')]!==_0x243c('0x3f')){var _0x3c59c5={};_0x3c59c5[_0x347c62[_0x243c('0x32')]]={'$like':'%'+_0x3b777f[_0x243c('0x33')][_0x243c('0x3d')]+'%'};return _0x3c59c5;}})});}_0x35ccbd=_[_0x243c('0x40')]({},_0x35ccbd,_0x3b777f[_0x243c('0x41')]);var _0x22395a={'where':_0x35ccbd['where']};return db[_0x243c('0x2c')][_0x243c('0x22')](_0x22395a)[_0x243c('0x27')](function(_0x25deb0){_0x2d1c29[_0x243c('0x22')]=_0x25deb0;if(_0x3b777f[_0x243c('0x33')][_0x243c('0x42')]){_0x35ccbd[_0x243c('0x43')]=[{'all':!![]}];}return db[_0x243c('0x2c')][_0x243c('0x44')](_0x35ccbd);})[_0x243c('0x27')](function(_0x344cbe){_0x2d1c29[_0x243c('0x45')]=_0x344cbe;return _0x2d1c29;})[_0x243c('0x27')](respondWithFilteredResult(_0xf8bf72,_0x35ccbd))[_0x243c('0x46')](handleError(_0xf8bf72,null));};exports['show']=function(_0x49d50a,_0x4c2383){var _0x2f7fc0={'raw':!![],'where':{'id':_0x49d50a[_0x243c('0x47')]['id']}},_0x53ecd3={};_0x53ecd3['model']=_[_0x243c('0x48')](db['WhatsappTransferReport'][_0x243c('0x49')]);_0x53ecd3[_0x243c('0x33')]=_[_0x243c('0x48')](_0x49d50a[_0x243c('0x33')]);_0x53ecd3[_0x243c('0x34')]=_[_0x243c('0x36')](_0x53ecd3['model'],_0x53ecd3['query']);_0x2f7fc0[_0x243c('0x35')]=_[_0x243c('0x36')](_0x53ecd3['model'],qs[_0x243c('0x37')](_0x49d50a[_0x243c('0x33')][_0x243c('0x37')]));_0x2f7fc0[_0x243c('0x35')]=_0x2f7fc0[_0x243c('0x35')][_0x243c('0x38')]?_0x2f7fc0[_0x243c('0x35')]:_0x53ecd3[_0x243c('0x30')];if(_0x49d50a['query']['includeAll']){_0x2f7fc0['include']=[{'all':!![]}];}_0x2f7fc0=_[_0x243c('0x40')]({},_0x2f7fc0,_0x49d50a[_0x243c('0x41')]);return db[_0x243c('0x2c')][_0x243c('0x4a')](_0x2f7fc0)[_0x243c('0x27')](handleEntityNotFound(_0x4c2383,null))[_0x243c('0x27')](respondWithResult(_0x4c2383,null))[_0x243c('0x46')](handleError(_0x4c2383,null));};exports[_0x243c('0x4b')]=function(_0x5e0704,_0x4eab12){return db[_0x243c('0x2c')]['create'](_0x5e0704['body'],{})[_0x243c('0x27')](respondWithResult(_0x4eab12,0xc9))[_0x243c('0x46')](handleError(_0x4eab12,null));};exports['update']=function(_0x3db40f,_0xe8a1f5){if(_0x3db40f[_0x243c('0x4c')]['id']){delete _0x3db40f[_0x243c('0x4c')]['id'];}return db['WhatsappTransferReport'][_0x243c('0x4a')]({'where':{'id':_0x3db40f[_0x243c('0x47')]['id']}})['then'](handleEntityNotFound(_0xe8a1f5,null))[_0x243c('0x27')](saveUpdates(_0x3db40f[_0x243c('0x4c')],null))[_0x243c('0x27')](respondWithResult(_0xe8a1f5,null))[_0x243c('0x46')](handleError(_0xe8a1f5,null));};exports[_0x243c('0x28')]=function(_0x3ad501,_0x1c6b8c){return db[_0x243c('0x2c')]['find']({'where':{'id':_0x3ad501[_0x243c('0x47')]['id']}})['then'](handleEntityNotFound(_0x1c6b8c,null))[_0x243c('0x27')](removeEntity(_0x1c6b8c,null))[_0x243c('0x46')](handleError(_0x1c6b8c,null));};exports[_0x243c('0x4d')]=function(_0x1be7a6,_0x303b44){return db['WhatsappTransferReport'][_0x243c('0x4d')]()[_0x243c('0x27')](respondWithResult(_0x303b44,null))[_0x243c('0x46')](handleError(_0x303b44,null));}; \ No newline at end of file +var _0x7b22=['error','name','send','index','map','WhatsappTransferReport','type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','rawAttributes','find','create','body','describe','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','fs-extra','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','sendStatus'];(function(_0x461c81,_0x213767){var _0x467cba=function(_0x3b64ef){while(--_0x3b64ef){_0x461c81['push'](_0x461c81['shift']());}};_0x467cba(++_0x213767);}(_0x7b22,0x1e6));var _0x27b2=function(_0x30033a,_0x5ce4a6){_0x30033a=_0x30033a-0x0;var _0x5e3518=_0x7b22[_0x30033a];return _0x5e3518;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x27b2('0x0'));var zipdir=require(_0x27b2('0x1'));var jsonpatch=require(_0x27b2('0x2'));var rp=require('request-promise');var moment=require(_0x27b2('0x3'));var BPromise=require(_0x27b2('0x4'));var Mustache=require(_0x27b2('0x5'));var util=require(_0x27b2('0x6'));var path=require(_0x27b2('0x7'));var sox=require('sox');var csv=require(_0x27b2('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x27b2('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x27b2('0xa'));var jsforce=require(_0x27b2('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x27b2('0x8'));var querystring=require(_0x27b2('0xc'));var Papa=require(_0x27b2('0xd'));var Redis=require(_0x27b2('0xe'));var authService=require(_0x27b2('0xf'));var qs=require(_0x27b2('0x10'));var as=require(_0x27b2('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x27b2('0x12'))(_0x27b2('0x13'));var utils=require(_0x27b2('0x14'));var config=require(_0x27b2('0x15'));var licenseUtil=require(_0x27b2('0x16'));var db=require(_0x27b2('0x17'))['db'];function respondWithStatusCode(_0x15b690,_0xcae601){_0xcae601=_0xcae601||0xcc;return function(_0xa5048d){if(_0xa5048d){return _0x15b690['sendStatus'](_0xcae601);}return _0x15b690['status'](_0xcae601)[_0x27b2('0x18')]();};}function respondWithResult(_0x2e740f,_0x598747){_0x598747=_0x598747||0xc8;return function(_0x34cf75){if(_0x34cf75){return _0x2e740f[_0x27b2('0x19')](_0x598747)['json'](_0x34cf75);}};}function respondWithFilteredResult(_0x212d17,_0x38de62){return function(_0x26d4e1){if(_0x26d4e1){var _0x523753=typeof _0x38de62['offset']===_0x27b2('0x1a')&&typeof _0x38de62[_0x27b2('0x1b')]===_0x27b2('0x1a');var _0x2044f3=_0x26d4e1[_0x27b2('0x1c')];var _0xd21d3b=_0x523753?0x0:_0x38de62[_0x27b2('0x1d')];var _0x113991=_0x523753?_0x26d4e1['count']:_0x38de62[_0x27b2('0x1d')]+_0x38de62[_0x27b2('0x1b')];var _0x2131f1;if(_0x113991>=_0x2044f3){_0x113991=_0x2044f3;_0x2131f1=0xc8;}else{_0x2131f1=0xce;}_0x212d17[_0x27b2('0x19')](_0x2131f1);return _0x212d17[_0x27b2('0x1e')](_0x27b2('0x1f'),_0xd21d3b+'-'+_0x113991+'/'+_0x2044f3)['json'](_0x26d4e1);}return null;};}function patchUpdates(_0x3e82c4){return function(_0x557727){try{jsonpatch[_0x27b2('0x20')](_0x557727,_0x3e82c4,!![]);}catch(_0x14062c){return BPromise[_0x27b2('0x21')](_0x14062c);}return _0x557727[_0x27b2('0x22')]();};}function saveUpdates(_0x4ba2b0,_0x599f4c){return function(_0x2d3cd4){if(_0x2d3cd4){return _0x2d3cd4[_0x27b2('0x23')](_0x4ba2b0)['then'](function(_0x20174e){return _0x20174e;});}return null;};}function removeEntity(_0x210349,_0x5510bc){return function(_0x5199b0){if(_0x5199b0){return _0x5199b0[_0x27b2('0x24')]()[_0x27b2('0x25')](function(){_0x210349[_0x27b2('0x19')](0xcc)[_0x27b2('0x18')]();});}};}function handleEntityNotFound(_0x425486,_0x199ad4){return function(_0x161f9d){if(!_0x161f9d){_0x425486[_0x27b2('0x26')](0x194);}return _0x161f9d;};}function handleError(_0x598336,_0x4adabf){_0x4adabf=_0x4adabf||0x1f4;return function(_0x140f5d){logger[_0x27b2('0x27')](_0x140f5d['stack']);if(_0x140f5d[_0x27b2('0x28')]){delete _0x140f5d[_0x27b2('0x28')];}_0x598336[_0x27b2('0x19')](_0x4adabf)[_0x27b2('0x29')](_0x140f5d);};}exports[_0x27b2('0x2a')]=function(_0x5e0e55,_0x19b7f7){var _0x3c45a4={},_0xb32ab4={},_0x5602cd={'count':0x0,'rows':[]};var _0x17df1e=_[_0x27b2('0x2b')](db[_0x27b2('0x2c')]['rawAttributes'],function(_0x24ff9c){return{'name':_0x24ff9c['fieldName'],'type':_0x24ff9c[_0x27b2('0x2d')][_0x27b2('0x2e')]};});_0xb32ab4['model']=_[_0x27b2('0x2b')](_0x17df1e,_0x27b2('0x28'));_0xb32ab4[_0x27b2('0x2f')]=_[_0x27b2('0x30')](_0x5e0e55[_0x27b2('0x2f')]);_0xb32ab4[_0x27b2('0x31')]=_[_0x27b2('0x32')](_0xb32ab4['model'],_0xb32ab4[_0x27b2('0x2f')]);_0x3c45a4[_0x27b2('0x33')]=_[_0x27b2('0x32')](_0xb32ab4[_0x27b2('0x34')],qs[_0x27b2('0x35')](_0x5e0e55[_0x27b2('0x2f')][_0x27b2('0x35')]));_0x3c45a4[_0x27b2('0x33')]=_0x3c45a4[_0x27b2('0x33')][_0x27b2('0x36')]?_0x3c45a4['attributes']:_0xb32ab4['model'];if(!_0x5e0e55[_0x27b2('0x2f')][_0x27b2('0x37')](_0x27b2('0x38'))){_0x3c45a4['limit']=qs[_0x27b2('0x1b')](_0x5e0e55[_0x27b2('0x2f')][_0x27b2('0x1b')]);_0x3c45a4['offset']=qs[_0x27b2('0x1d')](_0x5e0e55[_0x27b2('0x2f')][_0x27b2('0x1d')]);}_0x3c45a4['order']=qs[_0x27b2('0x39')](_0x5e0e55[_0x27b2('0x2f')]['sort']);_0x3c45a4[_0x27b2('0x3a')]=qs[_0x27b2('0x31')](_[_0x27b2('0x3b')](_0x5e0e55[_0x27b2('0x2f')],_0xb32ab4[_0x27b2('0x31')]),_0x17df1e);if(_0x5e0e55[_0x27b2('0x2f')][_0x27b2('0x3c')]){_0x3c45a4[_0x27b2('0x3a')]=_[_0x27b2('0x3d')](_0x3c45a4[_0x27b2('0x3a')],{'$or':_[_0x27b2('0x2b')](_0x17df1e,function(_0x43824b){if(_0x43824b['type']!==_0x27b2('0x3e')){var _0x4e65b7={};_0x4e65b7[_0x43824b[_0x27b2('0x28')]]={'$like':'%'+_0x5e0e55[_0x27b2('0x2f')]['filter']+'%'};return _0x4e65b7;}})});}_0x3c45a4=_[_0x27b2('0x3d')]({},_0x3c45a4,_0x5e0e55[_0x27b2('0x3f')]);var _0x11c84a={'where':_0x3c45a4[_0x27b2('0x3a')]};return db[_0x27b2('0x2c')][_0x27b2('0x1c')](_0x11c84a)[_0x27b2('0x25')](function(_0x414a29){_0x5602cd[_0x27b2('0x1c')]=_0x414a29;if(_0x5e0e55['query'][_0x27b2('0x40')]){_0x3c45a4[_0x27b2('0x41')]=[{'all':!![]}];}return db[_0x27b2('0x2c')][_0x27b2('0x42')](_0x3c45a4);})[_0x27b2('0x25')](function(_0x49a26a){_0x5602cd['rows']=_0x49a26a;return _0x5602cd;})[_0x27b2('0x25')](respondWithFilteredResult(_0x19b7f7,_0x3c45a4))[_0x27b2('0x43')](handleError(_0x19b7f7,null));};exports[_0x27b2('0x44')]=function(_0x8f1c60,_0x28b2bc){var _0x3645eb={'raw':!![],'where':{'id':_0x8f1c60[_0x27b2('0x45')]['id']}},_0x38cef4={};_0x38cef4['model']=_[_0x27b2('0x30')](db[_0x27b2('0x2c')][_0x27b2('0x46')]);_0x38cef4[_0x27b2('0x2f')]=_[_0x27b2('0x30')](_0x8f1c60[_0x27b2('0x2f')]);_0x38cef4[_0x27b2('0x31')]=_[_0x27b2('0x32')](_0x38cef4['model'],_0x38cef4['query']);_0x3645eb['attributes']=_[_0x27b2('0x32')](_0x38cef4[_0x27b2('0x34')],qs[_0x27b2('0x35')](_0x8f1c60[_0x27b2('0x2f')][_0x27b2('0x35')]));_0x3645eb[_0x27b2('0x33')]=_0x3645eb['attributes']['length']?_0x3645eb[_0x27b2('0x33')]:_0x38cef4['model'];if(_0x8f1c60[_0x27b2('0x2f')]['includeAll']){_0x3645eb[_0x27b2('0x41')]=[{'all':!![]}];}_0x3645eb=_[_0x27b2('0x3d')]({},_0x3645eb,_0x8f1c60[_0x27b2('0x3f')]);return db['WhatsappTransferReport'][_0x27b2('0x47')](_0x3645eb)['then'](handleEntityNotFound(_0x28b2bc,null))[_0x27b2('0x25')](respondWithResult(_0x28b2bc,null))[_0x27b2('0x43')](handleError(_0x28b2bc,null));};exports[_0x27b2('0x48')]=function(_0x2abc6a,_0x5031e1){return db['WhatsappTransferReport'][_0x27b2('0x48')](_0x2abc6a[_0x27b2('0x49')],{})[_0x27b2('0x25')](respondWithResult(_0x5031e1,0xc9))[_0x27b2('0x43')](handleError(_0x5031e1,null));};exports['update']=function(_0xb4be8,_0x4d8ddc){if(_0xb4be8[_0x27b2('0x49')]['id']){delete _0xb4be8[_0x27b2('0x49')]['id'];}return db[_0x27b2('0x2c')][_0x27b2('0x47')]({'where':{'id':_0xb4be8[_0x27b2('0x45')]['id']}})[_0x27b2('0x25')](handleEntityNotFound(_0x4d8ddc,null))[_0x27b2('0x25')](saveUpdates(_0xb4be8['body'],null))[_0x27b2('0x25')](respondWithResult(_0x4d8ddc,null))[_0x27b2('0x43')](handleError(_0x4d8ddc,null));};exports[_0x27b2('0x24')]=function(_0x115ac7,_0x522e6b){return db[_0x27b2('0x2c')]['find']({'where':{'id':_0x115ac7[_0x27b2('0x45')]['id']}})['then'](handleEntityNotFound(_0x522e6b,null))[_0x27b2('0x25')](removeEntity(_0x522e6b,null))[_0x27b2('0x43')](handleError(_0x522e6b,null));};exports[_0x27b2('0x4a')]=function(_0x43f635,_0x210d48){return db[_0x27b2('0x2c')][_0x27b2('0x4a')]()[_0x27b2('0x25')](respondWithResult(_0x210d48,null))[_0x27b2('0x43')](handleError(_0x210d48,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index c7a3e2b..234e5fe 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 _0xdfb6=['request-promise','path','rimraf','../../config/environment','./whatsappTransferReport.attributes','exports','define','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','lodash','util','../../config/logger','api','bluebird'];(function(_0x382a62,_0x1baa5e){var _0x490a25=function(_0x1b3427){while(--_0x1b3427){_0x382a62['push'](_0x382a62['shift']());}};_0x490a25(++_0x1baa5e);}(_0xdfb6,0x1cc));var _0x6dfb=function(_0x4fb0d9,_0x10767b){_0x4fb0d9=_0x4fb0d9-0x0;var _0x4e4fa0=_0xdfb6[_0x4fb0d9];return _0x4e4fa0;};'use strict';var _=require(_0x6dfb('0x0'));var util=require(_0x6dfb('0x1'));var logger=require(_0x6dfb('0x2'))(_0x6dfb('0x3'));var moment=require('moment');var BPromise=require(_0x6dfb('0x4'));var rp=require(_0x6dfb('0x5'));var fs=require('fs');var path=require(_0x6dfb('0x6'));var rimraf=require(_0x6dfb('0x7'));var config=require(_0x6dfb('0x8'));var attributes=require(_0x6dfb('0x9'));module[_0x6dfb('0xa')]=function(_0x7e3994,_0x490615){return _0x7e3994[_0x6dfb('0xb')](_0x6dfb('0xc'),attributes,{'tableName':_0x6dfb('0xd'),'paranoid':![],'indexes':[{'name':_0x6dfb('0xe'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x166f=['bluebird','request-promise','path','rimraf','./whatsappTransferReport.attributes','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','lodash','util','api','moment'];(function(_0x530bb8,_0x504b57){var _0x140fca=function(_0x16e565){while(--_0x16e565){_0x530bb8['push'](_0x530bb8['shift']());}};_0x140fca(++_0x504b57);}(_0x166f,0x80));var _0xf166=function(_0x497601,_0x2f25c8){_0x497601=_0x497601-0x0;var _0x2475cc=_0x166f[_0x497601];return _0x2475cc;};'use strict';var _=require(_0xf166('0x0'));var util=require(_0xf166('0x1'));var logger=require('../../config/logger')(_0xf166('0x2'));var moment=require(_0xf166('0x3'));var BPromise=require(_0xf166('0x4'));var rp=require(_0xf166('0x5'));var fs=require('fs');var path=require(_0xf166('0x6'));var rimraf=require(_0xf166('0x7'));var config=require('../../config/environment');var attributes=require(_0xf166('0x8'));module['exports']=function(_0x9240ec,_0x12e4f7){return _0x9240ec['define'](_0xf166('0x9'),attributes,{'tableName':_0xf166('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xf166('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js index 6847b72..c234df1 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 _0xf4a5=['message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','WhatsappTransferReport,\x20%s,\x20%s','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x5c78d9,_0x2736c7){var _0x69ae1f=function(_0x4b31ac){while(--_0x4b31ac){_0x5c78d9['push'](_0x5c78d9['shift']());}};_0x69ae1f(++_0x2736c7);}(_0xf4a5,0x1d1));var _0x5f4a=function(_0x6d0143,_0x3d7c30){_0x6d0143=_0x6d0143-0x0;var _0x29cb75=_0xf4a5[_0x6d0143];return _0x29cb75;};'use strict';var _=require(_0x5f4a('0x0'));var util=require('util');var moment=require(_0x5f4a('0x1'));var BPromise=require(_0x5f4a('0x2'));var rs=require(_0x5f4a('0x3'));var fs=require('fs');var Redis=require(_0x5f4a('0x4'));var db=require(_0x5f4a('0x5'))['db'];var utils=require(_0x5f4a('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x5f4a('0x7'));var jayson=require(_0x5f4a('0x8'));var client=jayson[_0x5f4a('0x9')][_0x5f4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5144da,_0x2c5d23,_0x1bc91d){return new BPromise(function(_0x43b59d,_0x230cb8){return client[_0x5f4a('0xb')](_0x5144da,_0x1bc91d)['then'](function(_0x21dc44){logger['info'](_0x5f4a('0xc'),_0x2c5d23,'request\x20sent');logger['debug'](_0x5f4a('0xd'),_0x2c5d23,_0x5f4a('0xe'),JSON[_0x5f4a('0xf')](_0x21dc44));if(_0x21dc44[_0x5f4a('0x10')]){if(_0x21dc44[_0x5f4a('0x10')][_0x5f4a('0x11')]===0x1f4){logger[_0x5f4a('0x10')](_0x5f4a('0xc'),_0x2c5d23,_0x21dc44[_0x5f4a('0x10')][_0x5f4a('0x12')]);return _0x230cb8(_0x21dc44[_0x5f4a('0x10')]['message']);}logger['error'](_0x5f4a('0xc'),_0x2c5d23,_0x21dc44[_0x5f4a('0x10')][_0x5f4a('0x12')]);return _0x43b59d(_0x21dc44[_0x5f4a('0x10')][_0x5f4a('0x12')]);}else{logger['info'](_0x5f4a('0xc'),_0x2c5d23,_0x5f4a('0xe'));_0x43b59d(_0x21dc44[_0x5f4a('0x13')][_0x5f4a('0x12')]);}})[_0x5f4a('0x14')](function(_0x82420){logger['error']('WhatsappTransferReport,\x20%s,\x20%s',_0x2c5d23,_0x82420);_0x230cb8(_0x82420);});});} \ No newline at end of file +var _0xa68b=['catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','error','message'];(function(_0xf56e6f,_0x35950e){var _0x5d25a0=function(_0x4b869c){while(--_0x4b869c){_0xf56e6f['push'](_0xf56e6f['shift']());}};_0x5d25a0(++_0x35950e);}(_0xa68b,0xd9));var _0xba68=function(_0x1e7b16,_0x4607a1){_0x1e7b16=_0x1e7b16-0x0;var _0x37fadc=_0xa68b[_0x1e7b16];return _0x37fadc;};'use strict';var _=require('lodash');var util=require(_0xba68('0x0'));var moment=require('moment');var BPromise=require(_0xba68('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xba68('0x2'));var db=require(_0xba68('0x3'))['db'];var utils=require(_0xba68('0x4'));var logger=require(_0xba68('0x5'))(_0xba68('0x6'));var config=require('../../config/environment');var jayson=require(_0xba68('0x7'));var client=jayson[_0xba68('0x8')][_0xba68('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x361a05,_0x54be9c,_0x52e771){return new BPromise(function(_0x2bf14f,_0x1456ad){return client['request'](_0x361a05,_0x52e771)['then'](function(_0x100a74){logger[_0xba68('0xa')](_0xba68('0xb'),_0x54be9c,_0xba68('0xc'));logger[_0xba68('0xd')](_0xba68('0xe'),_0x54be9c,_0xba68('0xc'),JSON['stringify'](_0x100a74));if(_0x100a74['error']){if(_0x100a74['error']['code']===0x1f4){logger[_0xba68('0xf')](_0xba68('0xb'),_0x54be9c,_0x100a74[_0xba68('0xf')][_0xba68('0x10')]);return _0x1456ad(_0x100a74[_0xba68('0xf')][_0xba68('0x10')]);}logger['error']('WhatsappTransferReport,\x20%s,\x20%s',_0x54be9c,_0x100a74[_0xba68('0xf')][_0xba68('0x10')]);return _0x2bf14f(_0x100a74[_0xba68('0xf')][_0xba68('0x10')]);}else{logger[_0xba68('0xa')](_0xba68('0xb'),_0x54be9c,'request\x20sent');_0x2bf14f(_0x100a74['result'][_0xba68('0x10')]);}})[_0xba68('0x11')](function(_0x2012ef){logger[_0xba68('0xf')]('WhatsappTransferReport,\x20%s,\x20%s',_0x54be9c,_0x2012ef);_0x1456ad(_0x2012ef);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index 300b642..b722029 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4813=['listen','info','start','filter','number','exitCode','name','online','Offline\x20apps:','map','status','join','None','log','App\x20Ready!','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./config/seedDB','./config/license','./rpc','./config/environment','./config/logger','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','sequelize','then','seedDB','default'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4813,0x14e));var _0x3481=function(_0x1965d6,_0x1e8d86){_0x1965d6=_0x1965d6-0x0;var _0x3d0399=_0x4813[_0x1965d6];return _0x3d0399;};'use strict';var _=require(_0x3481('0x0'));var db=require(_0x3481('0x1'))['db'];var seedDb=require(_0x3481('0x2'));var checkLicense=require(_0x3481('0x3'));var rpc=require(_0x3481('0x4'));var config=require(_0x3481('0x5'));var logger=require(_0x3481('0x6'))('app');var pm2=require(_0x3481('0x7'));var pm2Config=require(_0x3481('0x8'));var schedule=require(_0x3481('0x9'));var chat=require(_0x3481('0xa'));var whatsapp=require(_0x3481('0xb'));var transcribe=require('./config/schedule/transcribe');var provider=require('./config/schedule/cloud-provider');function main(){return db[_0x3481('0xc')]['sync']()[_0x3481('0xd')](function(){if(config[_0x3481('0xe')]){return seedDb[_0x3481('0xf')]();}})['then'](function(){return checkLicense['default']();})['then'](function(){return rpc[_0x3481('0x10')]();})['then'](function(_0x4da46b){logger[_0x3481('0x11')](_0x4da46b);return chat[_0x3481('0x12')]();})[_0x3481('0xd')](function(){return whatsapp[_0x3481('0x12')]();})[_0x3481('0xd')](function(){return schedule[_0x3481('0x12')]();})[_0x3481('0xd')](function(){return transcribe[_0x3481('0x12')]();})[_0x3481('0xd')](function(){return provider[_0x3481('0x12')]();})[_0x3481('0xd')](function(_0x18c6df){logger['info'](_0x18c6df);return pm2[_0x3481('0x12')](pm2Config);})[_0x3481('0xd')](function(_0x1bcfad){var _0x3f5ef5=_0x1bcfad[_0x3481('0x13')](function(_0x39e581){return typeof _0x39e581['exitCode']===_0x3481('0x14')&&_0x39e581[_0x3481('0x15')]>=0x0;});if(_0x3f5ef5['length']>0x0){throw new Error(_0x3f5ef5['length']+'\x20processes\x20failed\x20at\x20startup:\x20'+_['map'](_0x3f5ef5,function(_0x4f5d1b){return'\x22'+_0x4f5d1b['pm2_env'][_0x3481('0x16')]+'\x22';}));}logger[_0x3481('0x11')]('Online\x20apps:',_['map'](_[_0x3481('0x13')](_0x1bcfad,{'status':_0x3481('0x17')}),_0x3481('0x16'))['join']());logger['info'](_0x3481('0x18'),_[_0x3481('0x19')](_[_0x3481('0x13')](_0x1bcfad,function(_0x1ba743){return _0x1ba743[_0x3481('0x1a')]!==_0x3481('0x17');}),'name')[_0x3481('0x1b')]()||_0x3481('0x1c'));console[_0x3481('0x1d')](_0x3481('0x1e'));})['catch'](function(_0x2ecb2d){console['log'](_0x3481('0x1f'),_0x2ecb2d);logger[_0x3481('0x20')](_0x3481('0x21'),_0x2ecb2d);process[_0x3481('0x22')](0x1);});}main(); \ No newline at end of file +var _0x22ed=['exitCode','number','length','\x20processes\x20failed\x20at\x20startup:\x20','map','pm2_env','name','Online\x20apps:','filter','online','join','None','App\x20Ready!','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./config/seedDB','./config/license','./rpc','./config/environment','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/transcribe','./config/schedule/cloud-provider','sync','then','default','info','start'];(function(_0x3eb39f,_0x53fded){var _0xc02de7=function(_0x569258){while(--_0x569258){_0x3eb39f['push'](_0x3eb39f['shift']());}};_0xc02de7(++_0x53fded);}(_0x22ed,0x1a9));var _0xd22e=function(_0x51eb9d,_0x1e9a02){_0x51eb9d=_0x51eb9d-0x0;var _0x1fb227=_0x22ed[_0x51eb9d];return _0x1fb227;};'use strict';var _=require(_0xd22e('0x0'));var db=require(_0xd22e('0x1'))['db'];var seedDb=require(_0xd22e('0x2'));var checkLicense=require(_0xd22e('0x3'));var rpc=require(_0xd22e('0x4'));var config=require(_0xd22e('0x5'));var logger=require(_0xd22e('0x6'))(_0xd22e('0x7'));var pm2=require(_0xd22e('0x8'));var pm2Config=require(_0xd22e('0x9'));var schedule=require(_0xd22e('0xa'));var chat=require(_0xd22e('0xb'));var whatsapp=require('./config/schedule/whatsapp');var transcribe=require(_0xd22e('0xc'));var provider=require(_0xd22e('0xd'));function main(){return db['sequelize'][_0xd22e('0xe')]()[_0xd22e('0xf')](function(){if(config['seedDB']){return seedDb[_0xd22e('0x10')]();}})['then'](function(){return checkLicense['default']();})[_0xd22e('0xf')](function(){return rpc['listen']();})['then'](function(_0x54c27d){logger[_0xd22e('0x11')](_0x54c27d);return chat[_0xd22e('0x12')]();})[_0xd22e('0xf')](function(){return whatsapp[_0xd22e('0x12')]();})['then'](function(){return schedule[_0xd22e('0x12')]();})[_0xd22e('0xf')](function(){return transcribe[_0xd22e('0x12')]();})[_0xd22e('0xf')](function(){return provider[_0xd22e('0x12')]();})[_0xd22e('0xf')](function(_0x5d36cb){logger[_0xd22e('0x11')](_0x5d36cb);return pm2[_0xd22e('0x12')](pm2Config);})[_0xd22e('0xf')](function(_0x5b6d95){var _0x3b06e2=_0x5b6d95['filter'](function(_0x3525b5){return typeof _0x3525b5[_0xd22e('0x13')]===_0xd22e('0x14')&&_0x3525b5[_0xd22e('0x13')]>=0x0;});if(_0x3b06e2[_0xd22e('0x15')]>0x0){throw new Error(_0x3b06e2[_0xd22e('0x15')]+_0xd22e('0x16')+_[_0xd22e('0x17')](_0x3b06e2,function(_0x57f44f){return'\x22'+_0x57f44f[_0xd22e('0x18')][_0xd22e('0x19')]+'\x22';}));}logger[_0xd22e('0x11')](_0xd22e('0x1a'),_[_0xd22e('0x17')](_[_0xd22e('0x1b')](_0x5b6d95,{'status':'online'}),_0xd22e('0x19'))['join']());logger[_0xd22e('0x11')]('Offline\x20apps:',_['map'](_[_0xd22e('0x1b')](_0x5b6d95,function(_0x47b008){return _0x47b008['status']!==_0xd22e('0x1c');}),_0xd22e('0x19'))[_0xd22e('0x1d')]()||_0xd22e('0x1e'));console['log'](_0xd22e('0x1f'));})[_0xd22e('0x20')](function(_0x28f5b7){console['log'](_0xd22e('0x21'),_0x28f5b7);logger[_0xd22e('0x22')](_0xd22e('0x23'),_0x28f5b7);process[_0xd22e('0x24')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index 374e5c0..1ef4a08 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 _0x4cf8=['Setting','allowedLoginAttempts','blockDuration','isEqual','apiKeyNonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blocked','blockedAt','add','minutes','catch','User\x20object\x20not\x20found.','update','isWebrtcLicence','getLicense','webrtc','Forbidden','isMiddleware','signToken','setTokenCookie','cookie','motion.token','redirect','/dashboards/general','retrieveApiKey','isNil','apiKeyIat','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','test','ValidationError','validatePasswordHistory','decryptString','split','toLowerCase','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','Sequelize','updatePasswordsHistory','length','splice','unshift','encryptString','join','sign','secret','session','options','promisify','verify','randomBytes','toString','HS512','../../mysqldb','../../config/environment','../../config/license/hardware','../../config/license/util','../encryptor','lodash','jsonwebtoken','express-jwt','composable-middleware','basic-auth','crypto','bluebird','secrets','role','fullname','internal','email','permissions','md5secret','voicePause','chatPause','faxPause','smsPause','showWebBar','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','interface','privacyEnabled','settingsEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','ignorePauseForPreviewCalls','chatAutoanswerDelay','emailAutoanswer','emailAutoanswerDelay','smsAutoanswer','smsAutoanswerDelay','openchannelAutoanswerDelay','faxAutoanswer','faxAutoanswerDelay','whatsappAutoanswer','whatsappAutoanswerDelay','isChatInteractionAuthorized','isAuthenticated','use','user','findOne','params','closed','disposition','then','status','unmanaged','Unmanaged.','Forbidden.','headers','authorization','startsWith','Basic','User','authenticate','pass','json','Wrong\x20credentials.','Unknown\x20authorization\x20format','query','apikey','getUuid','find','sub'];(function(_0x1ee9a1,_0x5f1434){var _0x21270f=function(_0x303251){while(--_0x303251){_0x1ee9a1['push'](_0x1ee9a1['shift']());}};_0x21270f(++_0x5f1434);}(_0x4cf8,0x1e1));var _0x84cf=function(_0x1a7e4b,_0x2fbd40){_0x1a7e4b=_0x1a7e4b-0x0;var _0x37a8fd=_0x4cf8[_0x1a7e4b];return _0x37a8fd;};'use strict';var db=require(_0x84cf('0x0'))['db'];var config=require(_0x84cf('0x1'));var hardwareConf=require(_0x84cf('0x2'));var licenseUtil=require(_0x84cf('0x3'));var encryptor=require(_0x84cf('0x4'));var _=require(_0x84cf('0x5'));var jwt=require(_0x84cf('0x6'));var expressJwt=require(_0x84cf('0x7'));var compose=require(_0x84cf('0x8'));var basicAuth=require(_0x84cf('0x9'));var crypto=require(_0x84cf('0xa'));var BPromise=require(_0x84cf('0xb'));var util=require('util');var moment=require('moment');var validateJwt=expressJwt({'secret':config[_0x84cf('0xc')]['session']});var userAttributes=['id',_0x84cf('0xd'),_0x84cf('0xe'),'name',_0x84cf('0xf'),_0x84cf('0x10'),'userpic',_0x84cf('0x11'),_0x84cf('0x12'),_0x84cf('0x13'),_0x84cf('0x14'),'mailPause',_0x84cf('0x15'),_0x84cf('0x16'),'openchannelPause','pauseType',_0x84cf('0x17'),_0x84cf('0x18'),_0x84cf('0x19'),_0x84cf('0x1a'),_0x84cf('0x1b'),_0x84cf('0x1c'),_0x84cf('0x1d'),_0x84cf('0x1e'),_0x84cf('0x1f'),_0x84cf('0x20'),_0x84cf('0x21'),_0x84cf('0x22'),_0x84cf('0x23'),_0x84cf('0x24'),_0x84cf('0x25'),_0x84cf('0x26'),_0x84cf('0x27'),_0x84cf('0x28'),_0x84cf('0x29'),'userProfileId',_0x84cf('0x2a'),_0x84cf('0x2b'),_0x84cf('0x2c'),_0x84cf('0x2d'),_0x84cf('0x2e'),_0x84cf('0x2f'),_0x84cf('0x30'),'selectRecallMeCampaign','chatAutoanswer',_0x84cf('0x31'),_0x84cf('0x32'),_0x84cf('0x33'),_0x84cf('0x34'),_0x84cf('0x35'),'openchannelAutoanswer',_0x84cf('0x36'),_0x84cf('0x37'),_0x84cf('0x38'),_0x84cf('0x39'),_0x84cf('0x3a'),'messengerSoundNotification'];exports[_0x84cf('0x3b')]=function(){return this[_0x84cf('0x3c')](!![])[_0x84cf('0x3d')](function(_0x23e1e7,_0x3e5e94,_0x29e9e1){if(_0x23e1e7[_0x84cf('0x3e')]){_0x29e9e1();}else{return db['ChatInteraction'][_0x84cf('0x3f')]({'where':{'id':_0x23e1e7[_0x84cf('0x40')]['id']},'attributes':['id',_0x84cf('0x41'),_0x84cf('0x42')],'raw':!![]})[_0x84cf('0x43')](function(_0x44d4bf){if(_0x44d4bf&&_0x44d4bf[_0x84cf('0x41')]){return _0x3e5e94[_0x84cf('0x44')](_0x44d4bf[_0x84cf('0x42')]===_0x84cf('0x45')?0x195:0x193)['json']({'message':_0x44d4bf[_0x84cf('0x42')]===_0x84cf('0x45')?_0x84cf('0x46'):_0x84cf('0x47')});}else{_0x29e9e1();}})['catch'](function(_0x1595dd){_0x29e9e1(_0x1595dd);});}});};exports['isAuthenticated']=function isAuthenticated(_0x29455e){return compose()[_0x84cf('0x3d')](function(_0x43b41b,_0xc15298,_0x51adcf){var _0x20de4b;if(_0x43b41b[_0x84cf('0x48')][_0x84cf('0x49')]){if(_[_0x84cf('0x4a')](_0x43b41b[_0x84cf('0x48')][_0x84cf('0x49')],_0x84cf('0x4b'))){var _0x18243d=basicAuth(_0x43b41b);db[_0x84cf('0x4c')]['find']({'where':{'name':_0x18243d['name']}})[_0x84cf('0x43')](function(_0x25de3a){if(!_0x25de3a||!_0x25de3a[_0x84cf('0x4d')](_0x18243d[_0x84cf('0x4e')])){return _0xc15298[_0x84cf('0x44')](0x191)[_0x84cf('0x4f')]({'message':_0x84cf('0x50')});}_0x43b41b[_0x84cf('0x3e')]={'id':_0x25de3a['id']};_0x51adcf();})['catch'](function(_0x113b3e){_0x51adcf(_0x113b3e);});}else if(_[_0x84cf('0x4a')](_0x43b41b['headers'][_0x84cf('0x49')],'Bearer')){validateJwt(_0x43b41b,_0xc15298,_0x51adcf);}else{if(_0x29455e){_0x51adcf();}else{return _0xc15298[_0x84cf('0x44')](0x193)[_0x84cf('0x4f')]({'message':_0x84cf('0x51')});}}}else if(_0x43b41b[_0x84cf('0x52')][_0x84cf('0x53')]){try{var _0x49d415={'audience':hardwareConf[_0x84cf('0x54')](),'issuer':hardwareConf['getUuid']()};verifyJwt(_0x43b41b['query'][_0x84cf('0x53')],_0x49d415)[_0x84cf('0x43')](function(_0x4c4676){return db[_0x84cf('0x4c')][_0x84cf('0x55')]({'where':{'id':_0x4c4676[_0x84cf('0x56')]}})[_0x84cf('0x43')](function(_0xd13908){_0x20de4b=_0xd13908;return db[_0x84cf('0x57')]['findOne']({'where':{'id':0x1},'attributes':[_0x84cf('0x58'),_0x84cf('0x59')],'raw':!![]});})[_0x84cf('0x43')](function(_0x32cff6){if(!_0x20de4b||!_[_0x84cf('0x5a')](_0x20de4b[_0x84cf('0x5b')],_0x4c4676['nonce'])){return _0xc15298[_0x84cf('0x44')](0x191)['json']({'message':_0x84cf('0x5c')});}if(_0x20de4b[_0x84cf('0x5d')]){return _0xc15298[_0x84cf('0x44')](0x191)[_0x84cf('0x4f')]({'message':_0x84cf('0x5e')});}if(_0x20de4b[_0x84cf('0x5f')]){if(_0x32cff6[_0x84cf('0x59')]>0x0){if(moment(_0x20de4b[_0x84cf('0x60')])[_0x84cf('0x61')](_0x32cff6['blockDuration'],_0x84cf('0x62'))>moment()){return _0xc15298['status'](0x191)[_0x84cf('0x4f')]({'message':_0x84cf('0x5e')});}}else{return _0xc15298['status'](0x191)[_0x84cf('0x4f')]({'message':'Invalid\x20API\x20access\x20key'});}}_0x43b41b[_0x84cf('0x3e')]={'id':_0x20de4b['id']};_0x51adcf();});})['catch'](function(){return _0xc15298[_0x84cf('0x44')](0x191)['json']({'message':_0x84cf('0x5e')});});}catch(_0x40ae50){_0x51adcf(_0x40ae50);}}else if(_0x29455e){_0x51adcf();}else{return _0xc15298['status'](0x193)[_0x84cf('0x4f')]({'message':_0x84cf('0x51')});}})[_0x84cf('0x3d')](function(_0x5ef5fb,_0x3c1314,_0x5f1b8e){if(_0x5ef5fb[_0x84cf('0x3e')]){db['User']['find']({'where':{'id':_0x5ef5fb['user']['id']},'attributes':userAttributes})[_0x84cf('0x43')](function(_0xcf14ba){if(!_0xcf14ba){return _0x3c1314['status'](0x194)[_0x84cf('0x4f')]({'message':'User\x20not\x20found.'});}_0x5ef5fb[_0x84cf('0x3e')]=_0xcf14ba;_0x5f1b8e();})[_0x84cf('0x63')](function(_0x5ce309){_0x5f1b8e(_0x5ce309);});}else if(_0x29455e){_0x5f1b8e();}else{return _0x3c1314[_0x84cf('0x44')](0x194)['json']({'message':_0x84cf('0x64')});}});};exports['canUpdate']=function canUpdate(){return compose()['use'](function(_0x5d8b69,_0x5498ec,_0x585644){return licenseUtil['getLicense']()['then'](function(_0x210d9b){if(_0x210d9b[_0x84cf('0x65')]){_0x585644();}else{return _0x5498ec[_0x84cf('0x44')](0x193)[_0x84cf('0x4f')]({'message':'Forbidden'});}})[_0x84cf('0x63')](function(_0x4af229){_0x585644(_0x4af229);});});};exports[_0x84cf('0x66')]=function isWebrtcLicence(){return compose()[_0x84cf('0x3d')](function(_0x1533a7,_0x253464,_0x121bb9){return licenseUtil[_0x84cf('0x67')]()['then'](function(_0x2f7da6){if(_0x2f7da6[_0x84cf('0x68')]){_0x121bb9();}else{return _0x253464['status'](0x193)[_0x84cf('0x4f')]({'message':_0x84cf('0x69')});}})[_0x84cf('0x63')](function(_0x5212ec){_0x121bb9(_0x5212ec);});});};exports['isMiddleware']=function(_0x5499f9,_0x1cf3f6,_0x104421){_0x5499f9[_0x84cf('0x6a')]=!![];return _0x104421();};exports[_0x84cf('0x6b')]=function signToken(_0x271cc3){return signJwt(_0x271cc3);};exports[_0x84cf('0x6c')]=function(_0x51d725,_0x350985){if(!_0x51d725['user']){return _0x350985[_0x84cf('0x44')](0x194)['json']({'message':'It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.'});}var _0x46c595={'payload':{'id':_0x51d725[_0x84cf('0x3e')]['id'],'role':_0x51d725[_0x84cf('0x3e')]['role']},'options':{'expiresIn':0x15180}};return signJwt(_0x46c595)['then'](function(_0x290a4d){_0x350985[_0x84cf('0x6d')](_0x84cf('0x6e'),_0x290a4d);_0x350985[_0x84cf('0x6f')](_0x84cf('0x70'));})['catch'](function(_0xcfe28f){return _0x350985[_0x84cf('0x44')](0x1f4)['send'](_0xcfe28f);});};exports[_0x84cf('0x71')]=function(_0x5baea8){if(_['isNil'](_0x5baea8[_0x84cf('0x5b')])||_[_0x84cf('0x72')](_0x5baea8['apiKeyIat'])){return null;}else{return createJwt(_0x5baea8);}};exports['generateApiKey']=function(_0x31176c){_0x31176c[_0x84cf('0x5b')]=generateNonce();_0x31176c[_0x84cf('0x73')]=generateIssuedAt();return createJwt(_0x31176c);};exports[_0x84cf('0x74')]=function(_0x406c33,_0x3edaec){var _0x3a0eb4=_0x406c33[_0x84cf('0x52')]['apikey'];if(_0x3a0eb4){var _0x1bc15c={'nonce':_0x3edaec[_0x84cf('0x5b')],'iat':_0x3edaec['apiKeyIat'],'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0x84cf('0x54')]()};return verifyJwt(_0x3a0eb4,_0x1bc15c)[_0x84cf('0x43')](function(){return generateApiKey(_0x3edaec);});}else{throw{'message':_0x84cf('0x75')};}};exports[_0x84cf('0x76')]=function(_0x340915){var _0xfec87d=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0xfec87d[_0x84cf('0x77')](_0x340915))throw new db['Sequelize'][(_0x84cf('0x78'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');return;};exports[_0x84cf('0x79')]=function(_0x5c0122,_0x2a60bc,_0x1c2f1b){var _0x55d8c4=encryptor[_0x84cf('0x7a')](_0x2a60bc)[_0x84cf('0x7b')](',');for(var _0x52a3f1=0x0;_0x52a3f1<_0x1c2f1b;_0x52a3f1++){if(!_0x55d8c4[_0x52a3f1])break;if(_0x5c0122[_0x84cf('0x7c')]()===_0x55d8c4[_0x52a3f1]['toLowerCase']()){var _0x577d55=util['format']('The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.',_0x1c2f1b);if(_0x1c2f1b===0x1){_0x577d55=_0x84cf('0x7d');}throw new db[(_0x84cf('0x7e'))][(_0x84cf('0x78'))](_0x577d55);}}return;};exports[_0x84cf('0x7f')]=function(_0x480c3e,_0x32aa8b){var _0x3c1c55=_0x32aa8b?encryptor['decryptString'](_0x32aa8b)[_0x84cf('0x7b')](','):[];if(_0x3c1c55[_0x84cf('0x80')]===0x5){_0x3c1c55[_0x84cf('0x81')](-0x1,0x1);}_0x3c1c55[_0x84cf('0x82')](_0x480c3e);return encryptor[_0x84cf('0x83')](_0x3c1c55[_0x84cf('0x84')](','));};function signJwt(_0x1f1f76){var _0x39a336=BPromise['promisify'](jwt[_0x84cf('0x85')],{'context':jwt});var _0x58a96a=_0x1f1f76[_0x84cf('0x86')]||config[_0x84cf('0xc')][_0x84cf('0x87')];return new BPromise(function(_0x276ab1,_0x2602b7){_0x39a336(_0x1f1f76['payload'],_0x58a96a,_0x1f1f76[_0x84cf('0x88')])[_0x84cf('0x43')](function(_0xe1a1d9){_0x276ab1(_0xe1a1d9);})['catch'](function(_0xdb9b0c){_0x2602b7(_0xdb9b0c);});});}function verifyJwt(_0x240cca,_0x4e6077,_0x84d9cb){var _0x482958=BPromise[_0x84cf('0x89')](jwt[_0x84cf('0x8a')],{'context':jwt});var _0x57f1f2=_0x84d9cb||config[_0x84cf('0xc')][_0x84cf('0x87')];return new BPromise(function(_0x4a7905,_0x40b33e){_0x482958(_0x240cca,_0x57f1f2,_0x4e6077)[_0x84cf('0x43')](function(_0x262ae1){_0x4a7905(_0x262ae1);})[_0x84cf('0x63')](function(_0x577ade){_0x40b33e(_0x577ade);});});}function generateNonce(){return crypto[_0x84cf('0x8b')](0x10)[_0x84cf('0x8c')]('hex');}function generateIssuedAt(){return Math['floor'](Date['now']()/0x3e8)[_0x84cf('0x8c')]();}function createJwt(_0x8399f4){var _0xfcd0d={'payload':{'iat':_0x8399f4['apiKeyIat'],'nonce':_0x8399f4['apiKeyNonce']},'options':{'algorithm':_0x84cf('0x8d'),'subject':_0x8399f4['id'][_0x84cf('0x8c')](),'issuer':hardwareConf[_0x84cf('0x54')](),'audience':hardwareConf[_0x84cf('0x54')]()}};return signJwt(_0xfcd0d)[_0x84cf('0x43')](function(_0x39bd44){return{'iat':_0x8399f4[_0x84cf('0x73')],'nonce':_0x8399f4[_0x84cf('0x5b')],'token':_0x39bd44};});} \ No newline at end of file +var _0xd8b0=['cookie','motion.token','send','isNil','apiKeyNonce','generateApiKey','apiKeyIat','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','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~!@#$%^&-_=+[{]}.','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','length','splice','unshift','encryptString','promisify','sign','session','payload','verify','toString','hex','floor','now','HS512','../../mysqldb','../../config/environment','lodash','jsonwebtoken','express-jwt','composable-middleware','basic-auth','util','moment','secrets','role','fullname','internal','email','userpic','permissions','md5secret','voicePause','chatPause','mailPause','smsPause','pauseType','showWebBar','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','interface','privacyEnabled','settingsEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','ignorePauseForPreviewCalls','selectRecallMeCampaign','chatAutoanswerDelay','emailAutoanswer','emailAutoanswerDelay','smsAutoanswer','smsAutoanswerDelay','openchannelAutoanswer','openchannelAutoanswerDelay','faxAutoanswer','whatsappAutoanswerDelay','use','user','ChatInteraction','findOne','params','closed','then','status','unmanaged','json','disposition','Forbidden.','catch','isAuthenticated','authorization','headers','Basic','name','Wrong\x20credentials.','startsWith','Bearer','Unknown\x20authorization\x20format','query','apikey','getUuid','User','find','Setting','allowedLoginAttempts','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blocked','blockDuration','blockedAt','add','minutes','User\x20object\x20not\x20found.','update','isWebrtcLicence','getLicense','webrtc','Forbidden','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.'];(function(_0x4ad5b8,_0x4073de){var _0x4f1fe8=function(_0x474b28){while(--_0x474b28){_0x4ad5b8['push'](_0x4ad5b8['shift']());}};_0x4f1fe8(++_0x4073de);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var db=require(_0x0d8b('0x0'))['db'];var config=require(_0x0d8b('0x1'));var hardwareConf=require('../../config/license/hardware');var licenseUtil=require('../../config/license/util');var encryptor=require('../encryptor');var _=require(_0x0d8b('0x2'));var jwt=require(_0x0d8b('0x3'));var expressJwt=require(_0x0d8b('0x4'));var compose=require(_0x0d8b('0x5'));var basicAuth=require(_0x0d8b('0x6'));var crypto=require('crypto');var BPromise=require('bluebird');var util=require(_0x0d8b('0x7'));var moment=require(_0x0d8b('0x8'));var validateJwt=expressJwt({'secret':config[_0x0d8b('0x9')]['session']});var userAttributes=['id',_0x0d8b('0xa'),_0x0d8b('0xb'),'name',_0x0d8b('0xc'),_0x0d8b('0xd'),_0x0d8b('0xe'),_0x0d8b('0xf'),_0x0d8b('0x10'),_0x0d8b('0x11'),_0x0d8b('0x12'),_0x0d8b('0x13'),'faxPause',_0x0d8b('0x14'),'openchannelPause',_0x0d8b('0x15'),_0x0d8b('0x16'),_0x0d8b('0x17'),_0x0d8b('0x18'),_0x0d8b('0x19'),_0x0d8b('0x1a'),_0x0d8b('0x1b'),_0x0d8b('0x1c'),_0x0d8b('0x1d'),_0x0d8b('0x1e'),_0x0d8b('0x1f'),_0x0d8b('0x20'),_0x0d8b('0x21'),_0x0d8b('0x22'),'phoneBarExpires',_0x0d8b('0x23'),_0x0d8b('0x24'),_0x0d8b('0x25'),_0x0d8b('0x26'),_0x0d8b('0x27'),'userProfileId',_0x0d8b('0x28'),_0x0d8b('0x29'),_0x0d8b('0x2a'),_0x0d8b('0x2b'),_0x0d8b('0x2c'),_0x0d8b('0x2d'),_0x0d8b('0x2e'),_0x0d8b('0x2f'),'chatAutoanswer',_0x0d8b('0x30'),_0x0d8b('0x31'),_0x0d8b('0x32'),_0x0d8b('0x33'),_0x0d8b('0x34'),_0x0d8b('0x35'),_0x0d8b('0x36'),_0x0d8b('0x37'),'faxAutoanswerDelay','whatsappAutoanswer',_0x0d8b('0x38'),'messengerSoundNotification'];exports['isChatInteractionAuthorized']=function(){return this['isAuthenticated'](!![])[_0x0d8b('0x39')](function(_0x2b924f,_0x214778,_0x38efc8){if(_0x2b924f[_0x0d8b('0x3a')]){_0x38efc8();}else{return db[_0x0d8b('0x3b')][_0x0d8b('0x3c')]({'where':{'id':_0x2b924f[_0x0d8b('0x3d')]['id']},'attributes':['id',_0x0d8b('0x3e'),'disposition'],'raw':!![]})[_0x0d8b('0x3f')](function(_0x4463ee){if(_0x4463ee&&_0x4463ee['closed']){return _0x214778[_0x0d8b('0x40')](_0x4463ee['disposition']===_0x0d8b('0x41')?0x195:0x193)[_0x0d8b('0x42')]({'message':_0x4463ee[_0x0d8b('0x43')]==='unmanaged'?'Unmanaged.':_0x0d8b('0x44')});}else{_0x38efc8();}})[_0x0d8b('0x45')](function(_0x4c05ee){_0x38efc8(_0x4c05ee);});}});};exports[_0x0d8b('0x46')]=function isAuthenticated(_0x59aa83){return compose()[_0x0d8b('0x39')](function(_0x4b59e5,_0x97050a,_0x48f24f){var _0x2ab00d;if(_0x4b59e5['headers'][_0x0d8b('0x47')]){if(_['startsWith'](_0x4b59e5[_0x0d8b('0x48')][_0x0d8b('0x47')],_0x0d8b('0x49'))){var _0x56120a=basicAuth(_0x4b59e5);db['User']['find']({'where':{'name':_0x56120a[_0x0d8b('0x4a')]}})['then'](function(_0x3cdf3c){if(!_0x3cdf3c||!_0x3cdf3c['authenticate'](_0x56120a['pass'])){return _0x97050a[_0x0d8b('0x40')](0x191)[_0x0d8b('0x42')]({'message':_0x0d8b('0x4b')});}_0x4b59e5[_0x0d8b('0x3a')]={'id':_0x3cdf3c['id']};_0x48f24f();})[_0x0d8b('0x45')](function(_0xeaa769){_0x48f24f(_0xeaa769);});}else if(_[_0x0d8b('0x4c')](_0x4b59e5[_0x0d8b('0x48')]['authorization'],_0x0d8b('0x4d'))){validateJwt(_0x4b59e5,_0x97050a,_0x48f24f);}else{if(_0x59aa83){_0x48f24f();}else{return _0x97050a[_0x0d8b('0x40')](0x193)['json']({'message':_0x0d8b('0x4e')});}}}else if(_0x4b59e5[_0x0d8b('0x4f')][_0x0d8b('0x50')]){try{var _0x4f2ed2={'audience':hardwareConf[_0x0d8b('0x51')](),'issuer':hardwareConf[_0x0d8b('0x51')]()};verifyJwt(_0x4b59e5[_0x0d8b('0x4f')][_0x0d8b('0x50')],_0x4f2ed2)[_0x0d8b('0x3f')](function(_0x55d742){return db[_0x0d8b('0x52')][_0x0d8b('0x53')]({'where':{'id':_0x55d742['sub']}})[_0x0d8b('0x3f')](function(_0x3cc3ee){_0x2ab00d=_0x3cc3ee;return db[_0x0d8b('0x54')][_0x0d8b('0x3c')]({'where':{'id':0x1},'attributes':[_0x0d8b('0x55'),'blockDuration'],'raw':!![]});})['then'](function(_0x41b4f9){if(!_0x2ab00d||!_['isEqual'](_0x2ab00d['apiKeyNonce'],_0x55d742[_0x0d8b('0x56')])){return _0x97050a[_0x0d8b('0x40')](0x191)[_0x0d8b('0x42')]({'message':_0x0d8b('0x57')});}if(_0x2ab00d[_0x0d8b('0x58')]){return _0x97050a[_0x0d8b('0x40')](0x191)['json']({'message':_0x0d8b('0x59')});}if(_0x2ab00d[_0x0d8b('0x5a')]){if(_0x41b4f9[_0x0d8b('0x5b')]>0x0){if(moment(_0x2ab00d[_0x0d8b('0x5c')])[_0x0d8b('0x5d')](_0x41b4f9[_0x0d8b('0x5b')],_0x0d8b('0x5e'))>moment()){return _0x97050a['status'](0x191)[_0x0d8b('0x42')]({'message':_0x0d8b('0x59')});}}else{return _0x97050a[_0x0d8b('0x40')](0x191)[_0x0d8b('0x42')]({'message':'Invalid\x20API\x20access\x20key'});}}_0x4b59e5[_0x0d8b('0x3a')]={'id':_0x2ab00d['id']};_0x48f24f();});})['catch'](function(){return _0x97050a[_0x0d8b('0x40')](0x191)[_0x0d8b('0x42')]({'message':_0x0d8b('0x59')});});}catch(_0x26ac10){_0x48f24f(_0x26ac10);}}else if(_0x59aa83){_0x48f24f();}else{return _0x97050a[_0x0d8b('0x40')](0x193)[_0x0d8b('0x42')]({'message':_0x0d8b('0x4e')});}})[_0x0d8b('0x39')](function(_0x89ab0d,_0x2c3c84,_0x482069){if(_0x89ab0d['user']){db['User']['find']({'where':{'id':_0x89ab0d['user']['id']},'attributes':userAttributes})[_0x0d8b('0x3f')](function(_0x402fe0){if(!_0x402fe0){return _0x2c3c84[_0x0d8b('0x40')](0x194)['json']({'message':'User\x20not\x20found.'});}_0x89ab0d[_0x0d8b('0x3a')]=_0x402fe0;_0x482069();})[_0x0d8b('0x45')](function(_0x344278){_0x482069(_0x344278);});}else if(_0x59aa83){_0x482069();}else{return _0x2c3c84['status'](0x194)[_0x0d8b('0x42')]({'message':_0x0d8b('0x5f')});}});};exports['canUpdate']=function canUpdate(){return compose()['use'](function(_0x372740,_0x495870,_0x1e22e5){return licenseUtil['getLicense']()['then'](function(_0x30ccee){if(_0x30ccee[_0x0d8b('0x60')]){_0x1e22e5();}else{return _0x495870['status'](0x193)['json']({'message':'Forbidden'});}})['catch'](function(_0x374d40){_0x1e22e5(_0x374d40);});});};exports[_0x0d8b('0x61')]=function isWebrtcLicence(){return compose()[_0x0d8b('0x39')](function(_0x490eda,_0xb0910e,_0x1afe8a){return licenseUtil[_0x0d8b('0x62')]()[_0x0d8b('0x3f')](function(_0x423ecd){if(_0x423ecd[_0x0d8b('0x63')]){_0x1afe8a();}else{return _0xb0910e[_0x0d8b('0x40')](0x193)[_0x0d8b('0x42')]({'message':_0x0d8b('0x64')});}})[_0x0d8b('0x45')](function(_0x44d54b){_0x1afe8a(_0x44d54b);});});};exports[_0x0d8b('0x65')]=function(_0x84ef1c,_0x3e569b,_0x570af8){_0x84ef1c[_0x0d8b('0x65')]=!![];return _0x570af8();};exports[_0x0d8b('0x66')]=function signToken(_0x1e162c){return signJwt(_0x1e162c);};exports[_0x0d8b('0x67')]=function(_0x574b90,_0x371fa0){if(!_0x574b90['user']){return _0x371fa0['status'](0x194)[_0x0d8b('0x42')]({'message':_0x0d8b('0x68')});}var _0x3f943a={'payload':{'id':_0x574b90[_0x0d8b('0x3a')]['id'],'role':_0x574b90['user'][_0x0d8b('0xa')]},'options':{'expiresIn':0x15180}};return signJwt(_0x3f943a)[_0x0d8b('0x3f')](function(_0x386074){_0x371fa0[_0x0d8b('0x69')](_0x0d8b('0x6a'),_0x386074);_0x371fa0['redirect']('/dashboards/general');})['catch'](function(_0x573f4f){return _0x371fa0[_0x0d8b('0x40')](0x1f4)[_0x0d8b('0x6b')](_0x573f4f);});};exports['retrieveApiKey']=function(_0x4950a8){if(_[_0x0d8b('0x6c')](_0x4950a8[_0x0d8b('0x6d')])||_['isNil'](_0x4950a8['apiKeyIat'])){return null;}else{return createJwt(_0x4950a8);}};exports[_0x0d8b('0x6e')]=function(_0xeeefd4){_0xeeefd4[_0x0d8b('0x6d')]=generateNonce();_0xeeefd4[_0x0d8b('0x6f')]=generateIssuedAt();return createJwt(_0xeeefd4);};exports[_0x0d8b('0x70')]=function(_0x506a79,_0x2de903){var _0x2afe34=_0x506a79['query']['apikey'];if(_0x2afe34){var _0xf6a773={'nonce':_0x2de903[_0x0d8b('0x6d')],'iat':_0x2de903['apiKeyIat'],'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0x0d8b('0x51')]()};return verifyJwt(_0x2afe34,_0xf6a773)[_0x0d8b('0x3f')](function(){return generateApiKey(_0x2de903);});}else{throw{'message':_0x0d8b('0x71')};}};exports[_0x0d8b('0x72')]=function(_0x4a2989){var _0x356b3d=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x356b3d['test'](_0x4a2989))throw new db['Sequelize'][(_0x0d8b('0x73'))](_0x0d8b('0x74'));return;};exports['validatePasswordHistory']=function(_0x4a8f33,_0x44ed23,_0x3d7161){var _0xccc2a9=encryptor[_0x0d8b('0x75')](_0x44ed23)[_0x0d8b('0x76')](',');for(var _0xb66e76=0x0;_0xb66e76<_0x3d7161;_0xb66e76++){if(!_0xccc2a9[_0xb66e76])break;if(_0x4a8f33[_0x0d8b('0x77')]()===_0xccc2a9[_0xb66e76][_0x0d8b('0x77')]()){var _0x5418d8=util[_0x0d8b('0x78')](_0x0d8b('0x79'),_0x3d7161);if(_0x3d7161===0x1){_0x5418d8=_0x0d8b('0x7a');}throw new db[(_0x0d8b('0x7b'))][(_0x0d8b('0x73'))](_0x5418d8);}}return;};exports[_0x0d8b('0x7c')]=function(_0x70c8c4,_0x1c78b6){var _0x375684=_0x1c78b6?encryptor['decryptString'](_0x1c78b6)[_0x0d8b('0x76')](','):[];if(_0x375684[_0x0d8b('0x7d')]===0x5){_0x375684[_0x0d8b('0x7e')](-0x1,0x1);}_0x375684[_0x0d8b('0x7f')](_0x70c8c4);return encryptor[_0x0d8b('0x80')](_0x375684['join'](','));};function signJwt(_0x1e1dce){var _0x2d6284=BPromise[_0x0d8b('0x81')](jwt[_0x0d8b('0x82')],{'context':jwt});var _0x1d6cd4=_0x1e1dce['secret']||config['secrets'][_0x0d8b('0x83')];return new BPromise(function(_0x291b83,_0x3e4a41){_0x2d6284(_0x1e1dce[_0x0d8b('0x84')],_0x1d6cd4,_0x1e1dce['options'])[_0x0d8b('0x3f')](function(_0x12aef7){_0x291b83(_0x12aef7);})[_0x0d8b('0x45')](function(_0x5952dd){_0x3e4a41(_0x5952dd);});});}function verifyJwt(_0x2f19f4,_0x532a85,_0x2fce07){var _0x3ed63e=BPromise[_0x0d8b('0x81')](jwt[_0x0d8b('0x85')],{'context':jwt});var _0x2b6eb6=_0x2fce07||config[_0x0d8b('0x9')]['session'];return new BPromise(function(_0x382d2e,_0x4c074d){_0x3ed63e(_0x2f19f4,_0x2b6eb6,_0x532a85)[_0x0d8b('0x3f')](function(_0x4577c8){_0x382d2e(_0x4577c8);})[_0x0d8b('0x45')](function(_0x33a614){_0x4c074d(_0x33a614);});});}function generateNonce(){return crypto['randomBytes'](0x10)[_0x0d8b('0x86')](_0x0d8b('0x87'));}function generateIssuedAt(){return Math[_0x0d8b('0x88')](Date[_0x0d8b('0x89')]()/0x3e8)[_0x0d8b('0x86')]();}function createJwt(_0x273aef){var _0x223fd8={'payload':{'iat':_0x273aef[_0x0d8b('0x6f')],'nonce':_0x273aef[_0x0d8b('0x6d')]},'options':{'algorithm':_0x0d8b('0x8a'),'subject':_0x273aef['id']['toString'](),'issuer':hardwareConf['getUuid'](),'audience':hardwareConf[_0x0d8b('0x51')]()}};return signJwt(_0x223fd8)[_0x0d8b('0x3f')](function(_0x53e399){return{'iat':_0x273aef[_0x0d8b('0x6f')],'nonce':_0x273aef['apiKeyNonce'],'token':_0x53e399};});} \ No newline at end of file diff --git a/server/components/contacts/index.js b/server/components/contacts/index.js index b7dccfe..81f160f 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 _0x7b17=['skip','checkListsRestrictions','ids','tag','countFilteredContacts','count','User','buildContactsQuery','fields','clause','getFilteredContacts','rows','describe','CmContact','keys','filter','map','CmCustomField','slice','all','cf_','fieldType','type','./sql-utils','findAll','skipContactsQuery','resolve','getContactsSubquery','then','parseAdvancedSearchFilter','search','parseQueryParameters','default','where','tags','user'];(function(_0x2da127,_0x1344e1){var _0x4dc47b=function(_0x7e9a3b){while(--_0x7e9a3b){_0x2da127['push'](_0x2da127['shift']());}};_0x4dc47b(++_0x1344e1);}(_0x7b17,0x17f));var _0x77b1=function(_0x2ac5f8,_0x4c3a9f){_0x2ac5f8=_0x2ac5f8-0x0;var _0x3b8229=_0x7b17[_0x2ac5f8];return _0x3b8229;};'use strict';var _=require('lodash');var sqlUtils=require(_0x77b1('0x0'));var db=require('../../mysqldb')['db'];exports[_0x77b1('0x1')]=function(_0x8b2a24,_0x12f5f4,_0x1f09d0,_0x2d5b79){var _0x688a55={'count':0x0,'rows':[]};var _0x5ef1d=sqlUtils[_0x77b1('0x2')](_0x12f5f4,_0x8b2a24);if(_0x5ef1d){return Promise[_0x77b1('0x3')](_0x688a55);}var _0x26d71a=sqlUtils[_0x77b1('0x4')]();var _0xd6b0a2={};var _0x3e7f57=![];var _0x197e6f=![];return Promise[_0x77b1('0x3')]()[_0x77b1('0x5')](function(){if(_0x8b2a24['search']){return sqlUtils[_0x77b1('0x6')](_0x8b2a24[_0x77b1('0x7')],_0x2d5b79);}else{return sqlUtils[_0x77b1('0x8')](_0x8b2a24,_0x2d5b79);}})[_0x77b1('0x5')](function(_0x1890fe){_0x26d71a['where'](_0x1890fe[_0x77b1('0x9')]);_0x26d71a['where'](_0x1890fe['fields']);_0x26d71a['where'](_0x1890fe['filter']);_0x26d71a[_0x77b1('0xa')](_0x1890fe['user']['clause']);_0xd6b0a2=_0x1890fe[_0x77b1('0xb')];_0x197e6f=_0x1890fe[_0x77b1('0xc')][_0x77b1('0xd')];return sqlUtils[_0x77b1('0xe')](_0x12f5f4,_0x8b2a24,_0x197e6f);})[_0x77b1('0x5')](function(_0x4baa95){_0x26d71a['where'](_0x4baa95);var _0x1625d6=_0x8b2a24['search']?_0xd6b0a2[_0x77b1('0xf')]:_0x8b2a24[_0x77b1('0x10')];_0x3e7f57=_0x1625d6?!![]:![];return sqlUtils[_0x77b1('0x11')](_0x26d71a,_0x1625d6);})[_0x77b1('0x5')](function(_0x384b81){_0x688a55[_0x77b1('0x12')]=_0x384b81;if(_0x688a55[_0x77b1('0x12')]===0x0){return;}if(_0x8b2a24[_0x77b1('0x13')]){_0x197e6f=!![];}return sqlUtils[_0x77b1('0x14')](_0x26d71a,_0x8b2a24[_0x77b1('0x15')],_0x1f09d0,_0x3e7f57,_0xd6b0a2[_0x77b1('0x16')],_0x197e6f);})['then'](function(_0x2826d2){if(!_0x2826d2){return[];}return sqlUtils[_0x77b1('0x17')](_0x2826d2,_0x8b2a24,_0x1f09d0);})[_0x77b1('0x5')](function(_0x2f582c){_0x688a55[_0x77b1('0x18')]=_0x2f582c;return _0x688a55;})['catch'](function(_0x54b37c){throw _0x54b37c;});};exports[_0x77b1('0x19')]=function(){var _0x46243c={};var _0x5deff7=[];return db[_0x77b1('0x1a')][_0x77b1('0x19')]()['then'](function(_0x2e2715){_0x46243c=_0x2e2715;var _0x9bc355=Object[_0x77b1('0x1b')](_0x46243c)[_0x77b1('0x1c')](function(_0x57d6b8){return _['startsWith'](_0x57d6b8,'cf_')?_0x57d6b8:undefined;});var _0x199243=_0x9bc355[_0x77b1('0x1d')](function(_0x38c9fd){return db[_0x77b1('0x1e')]['findOne']({'where':{'id':_0x38c9fd[_0x77b1('0x1f')](0x3)},'raw':!![]});});return Promise[_0x77b1('0x20')](_0x199243);})[_0x77b1('0x5')](function(_0x2471e8){for(var _0x272fd6=0x0;_0x272fd6<_0x2471e8['length'];_0x272fd6++){if(_0x2471e8[_0x272fd6]){var _0x402494=_0x77b1('0x21')+_0x2471e8[_0x272fd6]['id'];_0x46243c[_0x402494][_0x77b1('0x22')]=_0x2471e8[_0x272fd6][_0x77b1('0x23')];}}_0x5deff7=_[_0x77b1('0x1d')](Object[_0x77b1('0x1b')](_0x46243c),function(_0x2629f7){return{'name':_0x2629f7,'type':_0x46243c[_0x2629f7]['type']};});return _0x5deff7;})['catch'](function(_0x52277e){throw _0x52277e;});}; \ No newline at end of file +var _0xac83=['getContactsSubquery','then','search','parseAdvancedSearchFilter','parseQueryParameters','default','fields','where','filter','user','clause','tags','checkListsRestrictions','tag','countFilteredContacts','count','buildContactsQuery','getFilteredContacts','catch','describe','CmContact','startsWith','cf_','map','CmCustomField','findOne','all','length','type','keys','./sql-utils','../../mysqldb','findAll','resolve'];(function(_0x1d701b,_0x267344){var _0x32f0fd=function(_0x302838){while(--_0x302838){_0x1d701b['push'](_0x1d701b['shift']());}};_0x32f0fd(++_0x267344);}(_0xac83,0x194));var _0x3ac8=function(_0x412b2a,_0x11fb8a){_0x412b2a=_0x412b2a-0x0;var _0x5872e3=_0xac83[_0x412b2a];return _0x5872e3;};'use strict';var _=require('lodash');var sqlUtils=require(_0x3ac8('0x0'));var db=require(_0x3ac8('0x1'))['db'];exports[_0x3ac8('0x2')]=function(_0x131d43,_0x104739,_0x2276e9,_0x46b667){var _0x215355={'count':0x0,'rows':[]};var _0x2ea265=sqlUtils['skipContactsQuery'](_0x104739,_0x131d43);if(_0x2ea265){return Promise[_0x3ac8('0x3')](_0x215355);}var _0x40fc3f=sqlUtils[_0x3ac8('0x4')]();var _0x3d9dff={};var _0x1544a4=![];var _0x5ce171=![];return Promise[_0x3ac8('0x3')]()[_0x3ac8('0x5')](function(){if(_0x131d43[_0x3ac8('0x6')]){return sqlUtils[_0x3ac8('0x7')](_0x131d43[_0x3ac8('0x6')],_0x46b667);}else{return sqlUtils[_0x3ac8('0x8')](_0x131d43,_0x46b667);}})[_0x3ac8('0x5')](function(_0x2bf244){_0x40fc3f['where'](_0x2bf244[_0x3ac8('0x9')]);_0x40fc3f['where'](_0x2bf244[_0x3ac8('0xa')]);_0x40fc3f[_0x3ac8('0xb')](_0x2bf244[_0x3ac8('0xc')]);_0x40fc3f[_0x3ac8('0xb')](_0x2bf244[_0x3ac8('0xd')][_0x3ac8('0xe')]);_0x3d9dff=_0x2bf244[_0x3ac8('0xf')];_0x5ce171=_0x2bf244[_0x3ac8('0xd')]['skip'];return sqlUtils[_0x3ac8('0x10')](_0x104739,_0x131d43,_0x5ce171);})[_0x3ac8('0x5')](function(_0x55fd74){_0x40fc3f[_0x3ac8('0xb')](_0x55fd74);var _0x434e12=_0x131d43['search']?_0x3d9dff['ids']:_0x131d43[_0x3ac8('0x11')];_0x1544a4=_0x434e12?!![]:![];return sqlUtils[_0x3ac8('0x12')](_0x40fc3f,_0x434e12);})[_0x3ac8('0x5')](function(_0x5adda6){_0x215355[_0x3ac8('0x13')]=_0x5adda6;if(_0x215355[_0x3ac8('0x13')]===0x0){return;}if(_0x131d43['User']){_0x5ce171=!![];}return sqlUtils[_0x3ac8('0x14')](_0x40fc3f,_0x131d43['fields'],_0x2276e9,_0x1544a4,_0x3d9dff['clause'],_0x5ce171);})[_0x3ac8('0x5')](function(_0x224f65){if(!_0x224f65){return[];}return sqlUtils[_0x3ac8('0x15')](_0x224f65,_0x131d43,_0x2276e9);})[_0x3ac8('0x5')](function(_0x453a0d){_0x215355['rows']=_0x453a0d;return _0x215355;})[_0x3ac8('0x16')](function(_0xbd102){throw _0xbd102;});};exports[_0x3ac8('0x17')]=function(){var _0x47dc5e={};var _0x613eca=[];return db[_0x3ac8('0x18')]['describe']()[_0x3ac8('0x5')](function(_0x2491f7){_0x47dc5e=_0x2491f7;var _0x255c5b=Object['keys'](_0x47dc5e)['filter'](function(_0x51d300){return _[_0x3ac8('0x19')](_0x51d300,_0x3ac8('0x1a'))?_0x51d300:undefined;});var _0xbde636=_0x255c5b[_0x3ac8('0x1b')](function(_0x34f88a){return db[_0x3ac8('0x1c')][_0x3ac8('0x1d')]({'where':{'id':_0x34f88a['slice'](0x3)},'raw':!![]});});return Promise[_0x3ac8('0x1e')](_0xbde636);})[_0x3ac8('0x5')](function(_0xf9b10e){for(var _0x3b9ca3=0x0;_0x3b9ca3<_0xf9b10e[_0x3ac8('0x1f')];_0x3b9ca3++){if(_0xf9b10e[_0x3b9ca3]){var _0x4bc4e0=_0x3ac8('0x1a')+_0xf9b10e[_0x3b9ca3]['id'];_0x47dc5e[_0x4bc4e0]['fieldType']=_0xf9b10e[_0x3b9ca3][_0x3ac8('0x20')];}}_0x613eca=_[_0x3ac8('0x1b')](Object[_0x3ac8('0x21')](_0x47dc5e),function(_0x2caa75){return{'name':_0x2caa75,'type':_0x47dc5e[_0x2caa75]['type']};});return _0x613eca;})['catch'](function(_0x20db6b){throw _0x20db6b;});}; \ No newline at end of file diff --git a/server/components/contacts/sql-utils.js b/server/components/contacts/sql-utils.js index 5179437..457f537 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 _0x7318=['buildExpression','type','default','value','end','Tag','map','tags','clause','ids','User','user','and','uc.UserId\x20=\x20?','skip','some','Contact','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','resolve','then','fields','tag','filter','search','agent','getLists','c.ListId\x20IS\x20NULL','attributes','group','c.id','limit','offset','subqry.id','order','subqry.','DESC','from','name','color','keyBy','Sequelize','QueryTypes','CmContact','sequelize','query','toString','Tags','COUNT(*)','isEmpty','t.id\x20IN\x20?','SELECT','exports','lodash','squel','../parsers/advancedSearch','../parsers/qs','../interaction/utils','role','ListId','autocomplete','select','cm_contacts','where','c.deletedAt\x20IS\x20NULL','subqry','cm_user_has_contacts','uc.CmContactId\x20=\x20','cm_contact_has_tags','.id','left_join','tools_tags','t.id\x20=\x20ct.TagId','firstName','mobile','fax','CompanyId','createdAt','TagIds','includes','push','forEach','field','GROUP_CONCAT(DISTINCT\x20t.id)','expr','getSelectedTags','CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','replace','split','length','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','parseSearch','conditions','find','dateOfBirth','datetime','castTo'];(function(_0x39bc44,_0x1d4373){var _0x2916d8=function(_0x1767ac){while(--_0x1767ac){_0x39bc44['push'](_0x39bc44['shift']());}};_0x2916d8(++_0x1d4373);}(_0x7318,0xa4));var _0x8731=function(_0x59f49b,_0x2c24b5){_0x59f49b=_0x59f49b-0x0;var _0x313bfb=_0x7318[_0x59f49b];return _0x313bfb;};'use strict';var _=require(_0x8731('0x0'));var squel=require(_0x8731('0x1'));var as=require(_0x8731('0x2'));var qs=require(_0x8731('0x3'));var utils=require(_0x8731('0x4'));var db=require('../../mysqldb')['db'];function skipContactsQuery(_0x1bd22f,_0x34c588){var _0x4b2f18=![];if(_0x1bd22f[_0x8731('0x5')]==='agent'&&!_0x34c588['search']&&!_0x34c588[_0x8731('0x6')]&&_0x34c588[_0x8731('0x7')]!=='true'){_0x4b2f18=!![];}return _0x4b2f18;}function getContactsSubquery(){return squel[_0x8731('0x8')]()['from'](_0x8731('0x9'),'c')[_0x8731('0xa')](_0x8731('0xb'));}function applyJoinClauses(_0xd40941,_0x23a6fc){var _0x5c7721=_0x23a6fc?'c':_0x8731('0xc');_0xd40941['left_join'](_0x8731('0xd'),'uc',_0x8731('0xe')+_0x5c7721+'.id')['left_join'](_0x8731('0xf'),'ct','ct.CmContactId\x20=\x20'+_0x5c7721+_0x8731('0x10'))[_0x8731('0x11')](_0x8731('0x12'),'t',_0x8731('0x13'));return _0xd40941;}function addFieldsToQuery(_0x2274ef,_0x4703c3,_0x3613df,_0x364714,_0x2fa594){var _0x14e739=_0x2fa594?'c':'subqry';if(!_0x4703c3){_0x4703c3=['id',_0x8731('0x14'),'lastName','phone',_0x8731('0x15'),_0x8731('0x16'),'email',_0x8731('0x6'),_0x8731('0x17'),_0x8731('0x18'),'updatedAt','deletedAt',_0x8731('0x19')];}else if(!_0x4703c3[_0x8731('0x1a')]('id')){_0x4703c3[_0x8731('0x1b')]('id');}var _0x320cf0=_0x3613df&&_0x2fa594||!_0x3613df&&!_0x2fa594;if(_0x364714){_0x320cf0=_0x364714&&_0x2fa594||!_0x364714&&!_0x2fa594;}_0x4703c3[_0x8731('0x1c')](function(_0x20986d){if(_0x20986d==='TagIds'){if(_0x320cf0){_0x2274ef[_0x8731('0x1d')](_0x8731('0x1e'),_0x20986d);}else if(_0x3613df||_0x364714){_0x2274ef['field'](_0x14e739+'.'+_0x20986d);}}else{_0x2274ef[_0x8731('0x1d')](_0x14e739+'.'+_0x20986d);}});return _0x2274ef;}function getSqlClauses(){var _0x19da5d={'default':squel[_0x8731('0x1f')](),'fields':squel[_0x8731('0x1f')](),'filter':squel[_0x8731('0x1f')](),'tags':{'clause':squel[_0x8731('0x1f')](),'ids':null},'user':{'clause':squel[_0x8731('0x1f')](),'skip':![]}};return _0x19da5d;}function parseTagParameter(_0x543c3a){var _0x3088cc=squel[_0x8731('0x1f')]();if(_0x543c3a){var _0x14ca36=utils[_0x8731('0x20')](_0x543c3a);_0x14ca36['forEach'](function(_0x3cb6c0){_0x3088cc['or'](_0x8731('0x21'),'%,'+_0x3cb6c0+',%');});}return _0x3088cc;}function parseSearchFilter(_0x221cf2){var _0xa59723=squel[_0x8731('0x1f')]();if(_0x221cf2){var _0x47efda=_0x221cf2[_0x8731('0x22')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(_0x47efda[_0x8731('0x23')]('\x20')[_0x8731('0x24')]>0x1){_0xa59723['or'](_0x8731('0x25'),qs[_0x8731('0x26')](_0x47efda,!![]),null);}else{if(qs[_0x8731('0x27')](_0x47efda)){_0xa59723['or'](_0x8731('0x28'),_0x47efda+'%');_0xa59723['or'](_0x8731('0x29'),_0x47efda+'%');_0xa59723['or'](_0x8731('0x2a'),_0x47efda+'%');_0xa59723['or'](_0x8731('0x2b'),_0x47efda+'%');}else if(qs[_0x8731('0x2c')](_0x47efda)){_0xa59723['or'](_0x8731('0x2d'),_0x47efda+'%');}else{_0xa59723['or'](_0x8731('0x2e'),'%'+_0x47efda+'%');_0xa59723['or'](_0x8731('0x2f'),'%'+_0x47efda+'%');_0xa59723['or'](_0x8731('0x2d'),'%'+_0x47efda+'%');}}}return _0xa59723;}function parseAdvancedSearchFilter(_0x5f49d3,_0x30e258){var _0x261ec3=getSqlClauses();var _0x1e0a89=as[_0x8731('0x30')](_0x5f49d3);var _0x23f130=_0x1e0a89['sqlOperator'];for(var _0x421a9e=0x0;_0x421a9e<_0x1e0a89[_0x8731('0x31')][_0x8731('0x24')];_0x421a9e++){var _0x5d73b6=_0x1e0a89[_0x8731('0x31')][_0x421a9e];var _0x4dc0e5='c';var _0x3ba63e=_[_0x8731('0x32')](_0x30e258,['name',_0x5d73b6[_0x8731('0x1d')]]);if(_0x3ba63e){if(_0x5d73b6[_0x8731('0x1d')]===_0x8731('0x33')||_0x3ba63e['fieldType']===_0x8731('0x34')){_0x5d73b6[_0x8731('0x35')]='DATE';}var _0x2a4505=as[_0x8731('0x36')](_0x4dc0e5,_0x3ba63e[_0x8731('0x37')],_0x5d73b6);_0x261ec3[_0x8731('0x38')][_0x23f130](_0x2a4505['text'],_0x2a4505[_0x8731('0x39')]['start'],_0x2a4505['value'][_0x8731('0x3a')]);}else{if(_0x5d73b6['field']===_0x8731('0x3b')){var _0x5aeb8b=_0x5d73b6[_0x8731('0x39')][_0x8731('0x23')](',')[_0x8731('0x3c')](function(_0x4ff41b){return Number(_0x4ff41b);});var _0x248a00=parseTagParameter(_0x5aeb8b);_0x261ec3[_0x8731('0x3d')][_0x8731('0x3e')]['and'](_0x248a00);_0x261ec3[_0x8731('0x3d')][_0x8731('0x3f')]=_0x5aeb8b;}else if(_0x5d73b6['field']===_0x8731('0x40')){_0x261ec3[_0x8731('0x41')][_0x8731('0x3e')][_0x8731('0x42')](_0x8731('0x43'),_0x5d73b6['value']);_0x261ec3[_0x8731('0x41')][_0x8731('0x44')]=!![];}}}return _0x261ec3;}function parseModelFields(_0x1f6313,_0x55e3af){var _0x5e94cb=squel[_0x8731('0x1f')]();var _0x27f60f=_(_0x1f6313)['keys']()[_0x8731('0x3c')](function(_0x493e0c){return _[_0x8731('0x45')](_0x55e3af,['name',_0x493e0c])?_0x493e0c:undefined;})['compact']()[_0x8731('0x39')]();if(_0x1f6313[_0x8731('0x46')]){_0x27f60f[_0x8731('0x1b')](_0x8731('0x46'));}if(_0x1f6313[_0x8731('0x40')]){_0x27f60f[_0x8731('0x1b')](_0x8731('0x40'));}if(_0x27f60f[_0x8731('0x24')]>0x0){_0x27f60f[_0x8731('0x1c')](function(_0x14e27d){if(_0x14e27d==='ListId'){_0x5e94cb[_0x8731('0x42')](_0x8731('0x47'),[][_0x8731('0x48')](_0x1f6313[_0x14e27d]));}else if(_0x14e27d==='Contact'){var _0x38a6c5='%'+_0x1f6313[_0x14e27d]+'%';_0x5e94cb[_0x8731('0x42')](_0x8731('0x49'),_0x38a6c5);}else if(_0x14e27d===_0x8731('0x40')){_0x5e94cb[_0x8731('0x42')](_0x8731('0x43'),_0x1f6313[_0x14e27d]);}else{_0x5e94cb[_0x8731('0x42')]('c.'+_0x14e27d+_0x8731('0x4a'),_0x1f6313[_0x14e27d]);}});}return _0x5e94cb;}function parseQueryParameters(_0x2cabe2,_0x683a33){var _0x753037=getSqlClauses();return Promise[_0x8731('0x4b')]()[_0x8731('0x4c')](function(){return parseModelFields(_0x2cabe2,_0x683a33);})[_0x8731('0x4c')](function(_0x5cc4cb){_0x753037[_0x8731('0x4d')]['and'](_0x5cc4cb);return parseTagParameter(_0x2cabe2[_0x8731('0x4e')]);})[_0x8731('0x4c')](function(_0x13fd12){_0x753037[_0x8731('0x3d')][_0x8731('0x3e')]['and'](_0x13fd12);return parseSearchFilter(_0x2cabe2[_0x8731('0x4f')]);})[_0x8731('0x4c')](function(_0x144ee0){_0x753037['filter']=_0x144ee0;return _0x753037;});}function checkListsRestrictions(_0x4e5841,_0x441d60,_0x118afc){var _0x3f3801=squel[_0x8731('0x1f')]();return Promise['resolve']()[_0x8731('0x4c')](function(){if(_0x441d60[_0x8731('0x50')]&&_0x4e5841[_0x8731('0x5')]===_0x8731('0x51')&&!_0x118afc){return _0x4e5841[_0x8731('0x52')]({'attributes':['id'],'raw':!![]});}})[_0x8731('0x4c')](function(_0x17188c){if(_0x17188c){if(_0x17188c[_0x8731('0x24')]===0x0){_0x3f3801['and'](_0x8731('0x53'));}else{_0x3f3801['and'](_0x8731('0x47'),_[_0x8731('0x3c')](_0x17188c,'id'));}}})[_0x8731('0x4c')](function(){return _0x3f3801;});}function buildContactsQuery(_0x14dfc1,_0x5e3e43,_0x291015,_0x2c7ec5,_0x1f9c56,_0x2a9cbc){if(_0x5e3e43){_0x5e3e43=_0x291015[_0x8731('0x54')];}_0x14dfc1=addFieldsToQuery(_0x14dfc1,_0x5e3e43,_0x2c7ec5,_0x2a9cbc,!![]);var _0x44f149=squel[_0x8731('0x8')]();_0x44f149=addFieldsToQuery(_0x44f149,_0x5e3e43,_0x2c7ec5,_0x2a9cbc,![]);if(_0x2c7ec5||_0x2a9cbc){_0x14dfc1=applyJoinClauses(_0x14dfc1,!![]);_0x14dfc1[_0x8731('0x55')](_0x8731('0x56'));if(_0x291015['limit']){_0x44f149[_0x8731('0x57')](_0x291015[_0x8731('0x57')]);}if(_0x291015[_0x8731('0x58')]){_0x44f149[_0x8731('0x58')](_0x291015[_0x8731('0x58')]);}}else{_0x44f149=applyJoinClauses(_0x44f149,![]);_0x44f149[_0x8731('0x55')](_0x8731('0x59'));if(_0x291015['limit']){_0x14dfc1[_0x8731('0x57')](_0x291015[_0x8731('0x57')]);}if(_0x291015[_0x8731('0x58')]){_0x14dfc1[_0x8731('0x58')](_0x291015['offset']);}}_0x44f149['having'](_0x1f9c56);if(_0x291015[_0x8731('0x5a')]){_0x291015[_0x8731('0x5a')]['forEach'](function(_0x50d7c8){_0x14dfc1[_0x8731('0x5a')]('c.'+_0x50d7c8[0x0],_0x50d7c8[0x1]==='DESC'?![]:!![]);_0x44f149[_0x8731('0x5a')](_0x8731('0x5b')+_0x50d7c8[0x0],_0x50d7c8[0x1]===_0x8731('0x5c')?![]:!![]);});}_0x44f149[_0x8731('0x5d')](_0x14dfc1,_0x8731('0xc'));return _0x44f149;}function getFilteredContacts(_0x5171c2){var _0x437f8f=[];return db['Tag']['findAll']({'attributes':['id',_0x8731('0x5e'),_0x8731('0x5f')],'raw':!![]})[_0x8731('0x4c')](function(_0x7f8f38){_0x437f8f=_[_0x8731('0x60')](_0x7f8f38,'id');var _0x303b7b={'type':db[_0x8731('0x61')][_0x8731('0x62')]['SELECT'],'model':db[_0x8731('0x63')],'mapToModel':!![],'nest':!![],'raw':!![]};return db[_0x8731('0x64')][_0x8731('0x65')](_0x5171c2[_0x8731('0x66')](),_0x303b7b);})[_0x8731('0x4c')](function(_0x2c61ed){_0x2c61ed[_0x8731('0x1c')](function(_0x2952d8){if(_0x2952d8[_0x8731('0x19')]){_0x2952d8[_0x8731('0x67')]=[];_0x2952d8[_0x8731('0x19')][_0x8731('0x23')](',')[_0x8731('0x1c')](function(_0xd28c07){_0x2952d8['Tags']['push'](_0x437f8f[_0xd28c07]);});}delete _0x2952d8[_0x8731('0x19')];});return _0x2c61ed;});}function countFilteredContacts(_0x4e92ef,_0x15f53c){var _0x5b390b=_0x4e92ef['clone']();_0x5b390b[_0x8731('0x1d')](_0x8731('0x68'));_0x5b390b=applyJoinClauses(_0x5b390b,!![]);_0x4e92ef[_0x8731('0x55')](_0x8731('0x56'));var _0x193ff3=utils[_0x8731('0x20')](_0x15f53c);if(!_[_0x8731('0x69')](_0x193ff3)){_0x5b390b['where'](_0x8731('0x6a'),_0x193ff3);}var _0x2ab07e={'type':db[_0x8731('0x61')]['QueryTypes'][_0x8731('0x6b')],'raw':!![]};return db['sequelize'][_0x8731('0x65')](_0x5b390b[_0x8731('0x66')](),_0x2ab07e)[_0x8731('0x4c')](function(_0x12759b){return _0x12759b[0x0][_0x8731('0x68')];});}module[_0x8731('0x6c')]={'buildContactsQuery':buildContactsQuery,'checkListsRestrictions':checkListsRestrictions,'countFilteredContacts':countFilteredContacts,'getContactsSubquery':getContactsSubquery,'getFilteredContacts':getFilteredContacts,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipContactsQuery':skipContactsQuery}; \ No newline at end of file +var _0x6f03=['uc.UserId\x20=\x20?','\x20=\x20?','resolve','then','tag','filter','role','getLists','c.ListId\x20IS\x20NULL','attributes','c.id','limit','offset','group','subqry.id','order','DESC','subqry.','from','color','keyBy','Sequelize','QueryTypes','SELECT','sequelize','toString','Tags','clone','COUNT(*)','getSelectedTags','isEmpty','query','exports','squel','../parsers/advancedSearch','../parsers/qs','../interaction/utils','../../mysqldb','agent','search','true','select','where','c.deletedAt\x20IS\x20NULL','subqry','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20','.id','ct.CmContactId\x20=\x20','tools_tags','t.id\x20=\x20ct.TagId','lastName','phone','mobile','ListId','CompanyId','createdAt','deletedAt','TagIds','includes','forEach','field','GROUP_CONCAT(DISTINCT\x20t.id)','expr','CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','replace','split','length','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','isEmail','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','c.email\x20LIKE\x20?','sqlOperator','conditions','find','fieldType','datetime','castTo','buildExpression','type','default','text','value','start','end','Tag','map','tags','clause','and','ids','user','skip','keys','some','name','Contact','push','c.ListId\x20IN\x20?','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x6f03,0x1c9));var _0x36f0=function(_0x3ca509,_0x2147fd){_0x3ca509=_0x3ca509-0x0;var _0xe3defe=_0x6f03[_0x3ca509];return _0xe3defe;};'use strict';var _=require('lodash');var squel=require(_0x36f0('0x0'));var as=require(_0x36f0('0x1'));var qs=require(_0x36f0('0x2'));var utils=require(_0x36f0('0x3'));var db=require(_0x36f0('0x4'))['db'];function skipContactsQuery(_0x567451,_0x5757b2){var _0x1af42f=![];if(_0x567451['role']===_0x36f0('0x5')&&!_0x5757b2[_0x36f0('0x6')]&&!_0x5757b2['ListId']&&_0x5757b2['autocomplete']!==_0x36f0('0x7')){_0x1af42f=!![];}return _0x1af42f;}function getContactsSubquery(){return squel[_0x36f0('0x8')]()['from']('cm_contacts','c')[_0x36f0('0x9')](_0x36f0('0xa'));}function applyJoinClauses(_0x3672b2,_0x4e8577){var _0x1b9cb4=_0x4e8577?'c':_0x36f0('0xb');_0x3672b2[_0x36f0('0xc')](_0x36f0('0xd'),'uc',_0x36f0('0xe')+_0x1b9cb4+_0x36f0('0xf'))[_0x36f0('0xc')]('cm_contact_has_tags','ct',_0x36f0('0x10')+_0x1b9cb4+_0x36f0('0xf'))[_0x36f0('0xc')](_0x36f0('0x11'),'t',_0x36f0('0x12'));return _0x3672b2;}function addFieldsToQuery(_0x49327d,_0x1903cc,_0x2d14ba,_0x4caf13,_0x112267){var _0x150e3d=_0x112267?'c':_0x36f0('0xb');if(!_0x1903cc){_0x1903cc=['id','firstName',_0x36f0('0x13'),_0x36f0('0x14'),_0x36f0('0x15'),'fax','email',_0x36f0('0x16'),_0x36f0('0x17'),_0x36f0('0x18'),'updatedAt',_0x36f0('0x19'),_0x36f0('0x1a')];}else if(!_0x1903cc[_0x36f0('0x1b')]('id')){_0x1903cc['push']('id');}var _0x5cd24c=_0x2d14ba&&_0x112267||!_0x2d14ba&&!_0x112267;if(_0x4caf13){_0x5cd24c=_0x4caf13&&_0x112267||!_0x4caf13&&!_0x112267;}_0x1903cc[_0x36f0('0x1c')](function(_0x17d6f7){if(_0x17d6f7===_0x36f0('0x1a')){if(_0x5cd24c){_0x49327d[_0x36f0('0x1d')](_0x36f0('0x1e'),_0x17d6f7);}else if(_0x2d14ba||_0x4caf13){_0x49327d[_0x36f0('0x1d')](_0x150e3d+'.'+_0x17d6f7);}}else{_0x49327d[_0x36f0('0x1d')](_0x150e3d+'.'+_0x17d6f7);}});return _0x49327d;}function getSqlClauses(){var _0x792ba={'default':squel[_0x36f0('0x1f')](),'fields':squel[_0x36f0('0x1f')](),'filter':squel['expr'](),'tags':{'clause':squel[_0x36f0('0x1f')](),'ids':null},'user':{'clause':squel['expr'](),'skip':![]}};return _0x792ba;}function parseTagParameter(_0x29c6c8){var _0x27db52=squel[_0x36f0('0x1f')]();if(_0x29c6c8){var _0x419952=utils['getSelectedTags'](_0x29c6c8);_0x419952['forEach'](function(_0x2aa640){_0x27db52['or'](_0x36f0('0x20'),'%,'+_0x2aa640+',%');});}return _0x27db52;}function parseSearchFilter(_0x167d1e){var _0x4ace05=squel['expr']();if(_0x167d1e){var _0x47a25e=_0x167d1e[_0x36f0('0x21')]('\x5c','\x5c\x5c')[_0x36f0('0x21')](/'/g,'\x27\x27');if(_0x47a25e[_0x36f0('0x22')]('\x20')[_0x36f0('0x23')]>0x1){_0x4ace05['or'](_0x36f0('0x24'),qs[_0x36f0('0x25')](_0x47a25e,!![]),null);}else{if(qs['isNumeric'](_0x47a25e)){_0x4ace05['or'](_0x36f0('0x26'),_0x47a25e+'%');_0x4ace05['or'](_0x36f0('0x27'),_0x47a25e+'%');_0x4ace05['or'](_0x36f0('0x28'),_0x47a25e+'%');_0x4ace05['or']('c.fax\x20LIKE\x20?',_0x47a25e+'%');}else if(qs[_0x36f0('0x29')](_0x47a25e)){_0x4ace05['or']('c.email\x20LIKE\x20?',_0x47a25e+'%');}else{_0x4ace05['or'](_0x36f0('0x2a'),'%'+_0x47a25e+'%');_0x4ace05['or'](_0x36f0('0x2b'),'%'+_0x47a25e+'%');_0x4ace05['or'](_0x36f0('0x2c'),'%'+_0x47a25e+'%');}}}return _0x4ace05;}function parseAdvancedSearchFilter(_0x58cf1a,_0x53edf6){var _0x23b193=getSqlClauses();var _0x23af97=as['parseSearch'](_0x58cf1a);var _0xec0468=_0x23af97[_0x36f0('0x2d')];for(var _0x3305f0=0x0;_0x3305f0<_0x23af97[_0x36f0('0x2e')][_0x36f0('0x23')];_0x3305f0++){var _0x1fe913=_0x23af97[_0x36f0('0x2e')][_0x3305f0];var _0x5f13c5='c';var _0x457b82=_[_0x36f0('0x2f')](_0x53edf6,['name',_0x1fe913[_0x36f0('0x1d')]]);if(_0x457b82){if(_0x1fe913[_0x36f0('0x1d')]==='dateOfBirth'||_0x457b82[_0x36f0('0x30')]===_0x36f0('0x31')){_0x1fe913[_0x36f0('0x32')]='DATE';}var _0x4daf5a=as[_0x36f0('0x33')](_0x5f13c5,_0x457b82[_0x36f0('0x34')],_0x1fe913);_0x23b193[_0x36f0('0x35')][_0xec0468](_0x4daf5a[_0x36f0('0x36')],_0x4daf5a[_0x36f0('0x37')][_0x36f0('0x38')],_0x4daf5a[_0x36f0('0x37')][_0x36f0('0x39')]);}else{if(_0x1fe913[_0x36f0('0x1d')]===_0x36f0('0x3a')){var _0x25177d=_0x1fe913[_0x36f0('0x37')][_0x36f0('0x22')](',')[_0x36f0('0x3b')](function(_0x1f7282){return Number(_0x1f7282);});var _0x9dc673=parseTagParameter(_0x25177d);_0x23b193[_0x36f0('0x3c')][_0x36f0('0x3d')][_0x36f0('0x3e')](_0x9dc673);_0x23b193[_0x36f0('0x3c')][_0x36f0('0x3f')]=_0x25177d;}else if(_0x1fe913[_0x36f0('0x1d')]==='User'){_0x23b193[_0x36f0('0x40')]['clause'][_0x36f0('0x3e')]('uc.UserId\x20=\x20?',_0x1fe913[_0x36f0('0x37')]);_0x23b193[_0x36f0('0x40')][_0x36f0('0x41')]=!![];}}}return _0x23b193;}function parseModelFields(_0x530139,_0x5a464b){var _0x3fb690=squel[_0x36f0('0x1f')]();var _0x295f48=_(_0x530139)[_0x36f0('0x42')]()['map'](function(_0x5a0de5){return _[_0x36f0('0x43')](_0x5a464b,[_0x36f0('0x44'),_0x5a0de5])?_0x5a0de5:undefined;})['compact']()['value']();if(_0x530139[_0x36f0('0x45')]){_0x295f48[_0x36f0('0x46')](_0x36f0('0x45'));}if(_0x530139['User']){_0x295f48[_0x36f0('0x46')]('User');}if(_0x295f48[_0x36f0('0x23')]>0x0){_0x295f48['forEach'](function(_0x1a6db9){if(_0x1a6db9===_0x36f0('0x16')){_0x3fb690[_0x36f0('0x3e')](_0x36f0('0x47'),[]['concat'](_0x530139[_0x1a6db9]));}else if(_0x1a6db9===_0x36f0('0x45')){var _0x204d41='%'+_0x530139[_0x1a6db9]+'%';_0x3fb690['and'](_0x36f0('0x48'),_0x204d41);}else if(_0x1a6db9==='User'){_0x3fb690[_0x36f0('0x3e')](_0x36f0('0x49'),_0x530139[_0x1a6db9]);}else{_0x3fb690[_0x36f0('0x3e')]('c.'+_0x1a6db9+_0x36f0('0x4a'),_0x530139[_0x1a6db9]);}});}return _0x3fb690;}function parseQueryParameters(_0x10cc32,_0x2a8266){var _0x212ac8=getSqlClauses();return Promise[_0x36f0('0x4b')]()[_0x36f0('0x4c')](function(){return parseModelFields(_0x10cc32,_0x2a8266);})['then'](function(_0x15747e){_0x212ac8['fields'][_0x36f0('0x3e')](_0x15747e);return parseTagParameter(_0x10cc32[_0x36f0('0x4d')]);})['then'](function(_0x10be2c){_0x212ac8[_0x36f0('0x3c')][_0x36f0('0x3d')]['and'](_0x10be2c);return parseSearchFilter(_0x10cc32[_0x36f0('0x4e')]);})[_0x36f0('0x4c')](function(_0x2dfadf){_0x212ac8[_0x36f0('0x4e')]=_0x2dfadf;return _0x212ac8;});}function checkListsRestrictions(_0x402052,_0x592918,_0x3cfbcb){var _0x3bdcb8=squel[_0x36f0('0x1f')]();return Promise['resolve']()[_0x36f0('0x4c')](function(){if(_0x592918[_0x36f0('0x6')]&&_0x402052[_0x36f0('0x4f')]===_0x36f0('0x5')&&!_0x3cfbcb){return _0x402052[_0x36f0('0x50')]({'attributes':['id'],'raw':!![]});}})['then'](function(_0x3e2a80){if(_0x3e2a80){if(_0x3e2a80[_0x36f0('0x23')]===0x0){_0x3bdcb8['and'](_0x36f0('0x51'));}else{_0x3bdcb8[_0x36f0('0x3e')](_0x36f0('0x47'),_[_0x36f0('0x3b')](_0x3e2a80,'id'));}}})[_0x36f0('0x4c')](function(){return _0x3bdcb8;});}function buildContactsQuery(_0x27f2c8,_0x319466,_0x3ad3e9,_0x5a19b4,_0x58c52e,_0x4b634c){if(_0x319466){_0x319466=_0x3ad3e9[_0x36f0('0x52')];}_0x27f2c8=addFieldsToQuery(_0x27f2c8,_0x319466,_0x5a19b4,_0x4b634c,!![]);var _0x470799=squel[_0x36f0('0x8')]();_0x470799=addFieldsToQuery(_0x470799,_0x319466,_0x5a19b4,_0x4b634c,![]);if(_0x5a19b4||_0x4b634c){_0x27f2c8=applyJoinClauses(_0x27f2c8,!![]);_0x27f2c8['group'](_0x36f0('0x53'));if(_0x3ad3e9['limit']){_0x470799['limit'](_0x3ad3e9[_0x36f0('0x54')]);}if(_0x3ad3e9[_0x36f0('0x55')]){_0x470799['offset'](_0x3ad3e9['offset']);}}else{_0x470799=applyJoinClauses(_0x470799,![]);_0x470799[_0x36f0('0x56')](_0x36f0('0x57'));if(_0x3ad3e9[_0x36f0('0x54')]){_0x27f2c8[_0x36f0('0x54')](_0x3ad3e9[_0x36f0('0x54')]);}if(_0x3ad3e9['offset']){_0x27f2c8[_0x36f0('0x55')](_0x3ad3e9[_0x36f0('0x55')]);}}_0x470799['having'](_0x58c52e);if(_0x3ad3e9[_0x36f0('0x58')]){_0x3ad3e9[_0x36f0('0x58')][_0x36f0('0x1c')](function(_0xb91fc1){_0x27f2c8[_0x36f0('0x58')]('c.'+_0xb91fc1[0x0],_0xb91fc1[0x1]===_0x36f0('0x59')?![]:!![]);_0x470799[_0x36f0('0x58')](_0x36f0('0x5a')+_0xb91fc1[0x0],_0xb91fc1[0x1]==='DESC'?![]:!![]);});}_0x470799[_0x36f0('0x5b')](_0x27f2c8,_0x36f0('0xb'));return _0x470799;}function getFilteredContacts(_0xa8c636){var _0x6b8e0f=[];return db[_0x36f0('0x3a')]['findAll']({'attributes':['id','name',_0x36f0('0x5c')],'raw':!![]})[_0x36f0('0x4c')](function(_0x25cf02){_0x6b8e0f=_[_0x36f0('0x5d')](_0x25cf02,'id');var _0x4260c2={'type':db[_0x36f0('0x5e')][_0x36f0('0x5f')][_0x36f0('0x60')],'model':db['CmContact'],'mapToModel':!![],'nest':!![],'raw':!![]};return db[_0x36f0('0x61')]['query'](_0xa8c636[_0x36f0('0x62')](),_0x4260c2);})[_0x36f0('0x4c')](function(_0x3ba731){_0x3ba731['forEach'](function(_0x19f68b){if(_0x19f68b['TagIds']){_0x19f68b[_0x36f0('0x63')]=[];_0x19f68b[_0x36f0('0x1a')]['split'](',')[_0x36f0('0x1c')](function(_0x1a22a){_0x19f68b['Tags'][_0x36f0('0x46')](_0x6b8e0f[_0x1a22a]);});}delete _0x19f68b['TagIds'];});return _0x3ba731;});}function countFilteredContacts(_0x1941ee,_0x384f48){var _0x472892=_0x1941ee[_0x36f0('0x64')]();_0x472892[_0x36f0('0x1d')](_0x36f0('0x65'));_0x472892=applyJoinClauses(_0x472892,!![]);_0x1941ee['group'](_0x36f0('0x53'));var _0x509578=utils[_0x36f0('0x66')](_0x384f48);if(!_[_0x36f0('0x67')](_0x509578)){_0x472892[_0x36f0('0x9')]('t.id\x20IN\x20?',_0x509578);}var _0x4f076c={'type':db[_0x36f0('0x5e')][_0x36f0('0x5f')][_0x36f0('0x60')],'raw':!![]};return db[_0x36f0('0x61')][_0x36f0('0x68')](_0x472892[_0x36f0('0x62')](),_0x4f076c)['then'](function(_0x488fe1){return _0x488fe1[0x0]['COUNT(*)'];});}module[_0x36f0('0x69')]={'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 26aac75..65cd555 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 _0x5c43=['final','write','end','close','unlink','decryptFile','createDecipher','encryptString','secret','createCipher','utf8','base64','crypto','bluebird','../../config/environment','app','secrets','aes192','encrypt','algorithm','join','error','getCiphers','indexOf','hasOwnProperty','encryptFile','createReadStream','createWriteStream','data','update','binary'];(function(_0x9f384d,_0x5d8032){var _0x3b64ec=function(_0x52b37a){while(--_0x52b37a){_0x9f384d['push'](_0x9f384d['shift']());}};_0x3b64ec(++_0x5d8032);}(_0x5c43,0x123));var _0x35c4=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x5c43[_0x321bb2];return _0x9c12ed;};'use strict';var crypto=require(_0x35c4('0x0'));var fs=require('fs');var BPromise=require(_0x35c4('0x1'));var _=require('lodash');var config=require(_0x35c4('0x2'));var logger=require('../../config/logger')(_0x35c4('0x3'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x35c4('0x4')]['session'],'algorithm':'aes-256-ctr'};const fileOptions={'algorithm':_0x35c4('0x5')};if(config[_0x35c4('0x6')]&&config['encrypt'][_0x35c4('0x7')]){var isSupported=isAlgorithmSupported(config[_0x35c4('0x6')][_0x35c4('0x7')]);if(isSupported){fileOptions[_0x35c4('0x7')]=config[_0x35c4('0x6')]['algorithm'];}else{var supportedAlgorithms=getSupportedCiphers()[_0x35c4('0x8')](',\x20');logger[_0x35c4('0x9')](config[_0x35c4('0x6')][_0x35c4('0x7')],'is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:',supportedAlgorithms);}}function isASupportedCipher(_0x2f9c1d){return AES_SUPPORTED_RX['test'](_0x2f9c1d);}function getSupportedCiphers(){return crypto[_0x35c4('0xa')]()['filter'](isASupportedCipher);}function isAlgorithmSupported(_0xddf14){return getSupportedCiphers()[_0x35c4('0xb')](_0xddf14)>-0x1;}function combineOptions(_0x13cb08){var _0x26f6b2={};for(var _0x58b1ee in fileOptions){if(fileOptions[_0x35c4('0xc')](_0x58b1ee)){_0x26f6b2[_0x58b1ee]=fileOptions[_0x58b1ee];}}if(_0x13cb08){for(var _0x30440b in _0x13cb08){if(_0x13cb08['hasOwnProperty'](_0x30440b)){_0x26f6b2[_0x30440b]=_0x13cb08[_0x30440b];}}}return _0x26f6b2;}exports[_0x35c4('0xd')]=function(_0x33241d,_0x420330,_0x2afd1f,_0x41b506){return new BPromise(function(_0x4e42ca,_0x248cea){_0x41b506=combineOptions(_0x41b506);var _0x26de8d=new Buffer(_0x2afd1f);var _0x3a1071=fs[_0x35c4('0xe')](_0x33241d);var _0x94ad85=fs[_0x35c4('0xf')](_0x420330);var _0x3feaca=crypto['createCipher'](_0x41b506[_0x35c4('0x7')],_0x26de8d);_0x3a1071['on'](_0x35c4('0x10'),function(_0x3b095e){var _0x1680b6=new Buffer(_0x3feaca[_0x35c4('0x11')](_0x3b095e),_0x35c4('0x12'));_0x94ad85['write'](_0x1680b6);});_0x3a1071['on']('end',function(){try{var _0x156608=new Buffer(_0x3feaca[_0x35c4('0x13')](_0x35c4('0x12')),_0x35c4('0x12'));_0x94ad85[_0x35c4('0x14')](_0x156608);_0x94ad85[_0x35c4('0x15')]();_0x94ad85['on'](_0x35c4('0x16'),function(){return _0x4e42ca(_0x420330);});}catch(_0x17953c){fs[_0x35c4('0x17')](_0x420330);return _0x248cea(_0x17953c);}});});};exports[_0x35c4('0x18')]=function(_0x39dbf8,_0x51a30a,_0x13e4d4,_0x2a617b){return new BPromise(function(_0x3328d0,_0x458188){_0x2a617b=combineOptions(_0x2a617b);var _0x1b7c78=new Buffer(_0x13e4d4);var _0x17cd7a=fs[_0x35c4('0xe')](_0x39dbf8);var _0x905829=fs['createWriteStream'](_0x51a30a);var _0x245870=crypto[_0x35c4('0x19')](_0x2a617b['algorithm'],_0x1b7c78);_0x17cd7a['on']('data',function(_0x133faa){var _0x43bee5=new Buffer(_0x245870['update'](_0x133faa),'binary');_0x905829[_0x35c4('0x14')](_0x43bee5);});_0x17cd7a['on'](_0x35c4('0x15'),function(){try{var _0x4e6baa=new Buffer(_0x245870[_0x35c4('0x13')](_0x35c4('0x12')),_0x35c4('0x12'));_0x905829[_0x35c4('0x14')](_0x4e6baa);_0x905829[_0x35c4('0x15')]();_0x905829['on'](_0x35c4('0x16'),function(){return _0x3328d0(_0x51a30a);});}catch(_0x573264){fs[_0x35c4('0x17')](_0x51a30a);return _0x458188(_0x573264);}});});};exports[_0x35c4('0x1a')]=function(_0x2c5a1a,_0x54d78c,_0x59b711){var _0x56ca90=_0x59b711||stringOptions[_0x35c4('0x7')];var _0x124ab4=_0x54d78c||stringOptions[_0x35c4('0x1b')];var _0x250ad3=crypto[_0x35c4('0x1c')](_0x56ca90,_0x124ab4);var _0x3600b8=_0x250ad3[_0x35c4('0x11')](_0x2c5a1a,_0x35c4('0x1d'),'base64');_0x3600b8+=_0x250ad3[_0x35c4('0x13')](_0x35c4('0x1e'));return _0x3600b8;};exports['decryptString']=function(_0x21d34d,_0x339271,_0x170ac6){var _0x5ba4a0=_0x170ac6||stringOptions[_0x35c4('0x7')];var _0x1fe978=_0x339271||stringOptions['secret'];var _0x59a00f=crypto[_0x35c4('0x19')](_0x5ba4a0,_0x1fe978);var _0x19fd83=_0x59a00f['update'](_0x21d34d,_0x35c4('0x1e'),_0x35c4('0x1d'));_0x19fd83+=_0x59a00f[_0x35c4('0x13')](_0x35c4('0x1d'));return _0x19fd83;}; \ No newline at end of file +var _0x6cf1=['secret','utf8','base64','crypto','bluebird','../../config/environment','app','secrets','session','aes-256-ctr','aes192','encrypt','algorithm','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','filter','indexOf','hasOwnProperty','encryptFile','createReadStream','createWriteStream','createCipher','data','update','binary','write','end','close','createDecipher','final','unlink','encryptString'];(function(_0x52ed34,_0xea2f1a){var _0x379be8=function(_0x10249c){while(--_0x10249c){_0x52ed34['push'](_0x52ed34['shift']());}};_0x379be8(++_0xea2f1a);}(_0x6cf1,0x11b));var _0x16cf=function(_0x56d0b4,_0x206b02){_0x56d0b4=_0x56d0b4-0x0;var _0x509de8=_0x6cf1[_0x56d0b4];return _0x509de8;};'use strict';var crypto=require(_0x16cf('0x0'));var fs=require('fs');var BPromise=require(_0x16cf('0x1'));var _=require('lodash');var config=require(_0x16cf('0x2'));var logger=require('../../config/logger')(_0x16cf('0x3'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x16cf('0x4')][_0x16cf('0x5')],'algorithm':_0x16cf('0x6')};const fileOptions={'algorithm':_0x16cf('0x7')};if(config['encrypt']&&config[_0x16cf('0x8')][_0x16cf('0x9')]){var isSupported=isAlgorithmSupported(config['encrypt'][_0x16cf('0x9')]);if(isSupported){fileOptions[_0x16cf('0x9')]=config[_0x16cf('0x8')][_0x16cf('0x9')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x16cf('0xa')](',\x20');logger[_0x16cf('0xb')](config[_0x16cf('0x8')][_0x16cf('0x9')],_0x16cf('0xc'),supportedAlgorithms);}}function isASupportedCipher(_0x25c70e){return AES_SUPPORTED_RX[_0x16cf('0xd')](_0x25c70e);}function getSupportedCiphers(){return crypto[_0x16cf('0xe')]()[_0x16cf('0xf')](isASupportedCipher);}function isAlgorithmSupported(_0x5bea1b){return getSupportedCiphers()[_0x16cf('0x10')](_0x5bea1b)>-0x1;}function combineOptions(_0x299ea9){var _0x2d6083={};for(var _0x3873df in fileOptions){if(fileOptions[_0x16cf('0x11')](_0x3873df)){_0x2d6083[_0x3873df]=fileOptions[_0x3873df];}}if(_0x299ea9){for(var _0xe8bf2a in _0x299ea9){if(_0x299ea9[_0x16cf('0x11')](_0xe8bf2a)){_0x2d6083[_0xe8bf2a]=_0x299ea9[_0xe8bf2a];}}}return _0x2d6083;}exports[_0x16cf('0x12')]=function(_0x70fb96,_0xc480f6,_0x3180b9,_0x45b827){return new BPromise(function(_0x144dd5,_0x3c0117){_0x45b827=combineOptions(_0x45b827);var _0x3909b4=new Buffer(_0x3180b9);var _0x2aac64=fs[_0x16cf('0x13')](_0x70fb96);var _0x3a93e4=fs[_0x16cf('0x14')](_0xc480f6);var _0x256dd2=crypto[_0x16cf('0x15')](_0x45b827[_0x16cf('0x9')],_0x3909b4);_0x2aac64['on'](_0x16cf('0x16'),function(_0x36e5bc){var _0x5b3166=new Buffer(_0x256dd2[_0x16cf('0x17')](_0x36e5bc),_0x16cf('0x18'));_0x3a93e4[_0x16cf('0x19')](_0x5b3166);});_0x2aac64['on']('end',function(){try{var _0x2a6831=new Buffer(_0x256dd2['final'](_0x16cf('0x18')),_0x16cf('0x18'));_0x3a93e4['write'](_0x2a6831);_0x3a93e4[_0x16cf('0x1a')]();_0x3a93e4['on'](_0x16cf('0x1b'),function(){return _0x144dd5(_0xc480f6);});}catch(_0x4d572c){fs['unlink'](_0xc480f6);return _0x3c0117(_0x4d572c);}});});};exports['decryptFile']=function(_0x532899,_0x2cfc9f,_0x5cf47a,_0x43ef83){return new BPromise(function(_0x2cd4f4,_0x10f6ef){_0x43ef83=combineOptions(_0x43ef83);var _0x160abe=new Buffer(_0x5cf47a);var _0x1635e1=fs['createReadStream'](_0x532899);var _0x475f5c=fs['createWriteStream'](_0x2cfc9f);var _0x327f4b=crypto[_0x16cf('0x1c')](_0x43ef83[_0x16cf('0x9')],_0x160abe);_0x1635e1['on']('data',function(_0x46a785){var _0x41e883=new Buffer(_0x327f4b[_0x16cf('0x17')](_0x46a785),_0x16cf('0x18'));_0x475f5c[_0x16cf('0x19')](_0x41e883);});_0x1635e1['on'](_0x16cf('0x1a'),function(){try{var _0x326851=new Buffer(_0x327f4b[_0x16cf('0x1d')](_0x16cf('0x18')),'binary');_0x475f5c[_0x16cf('0x19')](_0x326851);_0x475f5c[_0x16cf('0x1a')]();_0x475f5c['on'](_0x16cf('0x1b'),function(){return _0x2cd4f4(_0x2cfc9f);});}catch(_0xc17d3f){fs[_0x16cf('0x1e')](_0x2cfc9f);return _0x10f6ef(_0xc17d3f);}});});};exports[_0x16cf('0x1f')]=function(_0x28f645,_0x2caa3f,_0x322da9){var _0x203a96=_0x322da9||stringOptions['algorithm'];var _0x54efb6=_0x2caa3f||stringOptions[_0x16cf('0x20')];var _0x91a3c6=crypto[_0x16cf('0x15')](_0x203a96,_0x54efb6);var _0x4c2953=_0x91a3c6[_0x16cf('0x17')](_0x28f645,_0x16cf('0x21'),'base64');_0x4c2953+=_0x91a3c6['final'](_0x16cf('0x22'));return _0x4c2953;};exports['decryptString']=function(_0x171d2f,_0x3f2d06,_0xb01d73){var _0x2845af=_0xb01d73||stringOptions[_0x16cf('0x9')];var _0x461ede=_0x3f2d06||stringOptions[_0x16cf('0x20')];var _0x5dda11=crypto['createDecipher'](_0x2845af,_0x461ede);var _0xd201c=_0x5dda11[_0x16cf('0x17')](_0x171d2f,_0x16cf('0x22'),_0x16cf('0x21'));_0xd201c+=_0x5dda11['final'](_0x16cf('0x21'));return _0xd201c;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index 3860fb8..7aa60f5 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 _0xad6d=['csv','%s.%s','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','CSV','zip','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','finally','path','to-csv','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','find','split','splitSizeCsv','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','Empty','length','range','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','basename','.csv','join','mkdirSync','each'];(function(_0x56c56d,_0x431b80){var _0x1cabc3=function(_0x218d9c){while(--_0x218d9c){_0x56c56d['push'](_0x56c56d['shift']());}};_0x1cabc3(++_0x431b80);}(_0xad6d,0x143));var _0xdad6=function(_0x5f3f64,_0x1e8de8){_0x5f3f64=_0x5f3f64-0x0;var _0x18f660=_0xad6d[_0x5f3f64];return _0x18f660;};'use strict';var util=require('util');var path=require(_0xdad6('0x0'));var _=require('lodash');var csv=require(_0xdad6('0x1'));var fs=require('fs');var BPromise=require('bluebird');var zipdir=require(_0xdad6('0x2'));var rimraf=require(_0xdad6('0x3'));var db=require(_0xdad6('0x4'))['db'];var dbH=require(_0xdad6('0x4'))[_0xdad6('0x5')];var logger=require(_0xdad6('0x6'))(_0xdad6('0x7'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0xdad6('0x8')][0x3];var PATH=process[_0xdad6('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x33238a,_0x1b8881){var _0x16f34a={'status':_0x33238a};var _0x18d1f5={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x1b8881){_0x16f34a[_0xdad6('0x9')]=_0x1b8881;}return db[_0xdad6('0xa')][_0xdad6('0xb')](_0x16f34a,_0x18d1f5);}function main(){var _0x5255ab=0x1388;var _0x27cc83;logger[_0xdad6('0xc')](util[_0xdad6('0xd')](_0xdad6('0xe'),EXTRACTED_REPORT_ID,'CSV'));return db[_0xdad6('0xf')][_0xdad6('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xdad6('0x11'),_0xdad6('0x12')]})[_0xdad6('0x13')](function(_0x5090db){if(_0x5090db){_0x27cc83=_0x5090db;_0x5255ab=_0x27cc83[_0xdad6('0x12')]||0x1388;}})[_0xdad6('0x13')](function(){return dbH[_0xdad6('0x14')][_0xdad6('0x15')](util['format'](_0xdad6('0x16'),QUERY),{'type':dbH[_0xdad6('0x14')][_0xdad6('0x17')][_0xdad6('0x18')]});})['then'](function(_0x3698f8){if(!_0x3698f8[0x0][_0xdad6('0x19')]){return analyticExtractedReport(_0xdad6('0x1a'));}var _0x2ea6ea=[];var _0x195a81=0x0;if(_0x27cc83[_0xdad6('0x11')]){if(_0x3698f8&&_0x3698f8[_0xdad6('0x1b')]){var _0x1f90c1=_[_0xdad6('0x1c')](_0x3698f8[0x0][_0xdad6('0x19')]/_0x5255ab);var _0x1f3837=Number['isInteger'](_0x3698f8[0x0][_0xdad6('0x19')]/_0x5255ab)?_0x3698f8[0x0]['num']%_0x5255ab:0x0;_0x1f90c1[_0xdad6('0x1d')](function(_0x185c1a){if(_0x185c1a>0x0){_0x195a81+=_0x5255ab;}_0x2ea6ea[_0xdad6('0x1e')](dbH[_0xdad6('0x14')][_0xdad6('0x15')](util[_0xdad6('0xd')](_0xdad6('0x1f'),QUERY,_0x5255ab,_0x195a81),{'type':dbH[_0xdad6('0x14')][_0xdad6('0x17')]['SELECT']}));});if(_0x1f3837>0x0){_0x195a81+=_0x5255ab;_0x2ea6ea[_0xdad6('0x1e')](dbH[_0xdad6('0x14')][_0xdad6('0x15')](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x1f3837,_0x195a81),{'type':dbH[_0xdad6('0x14')]['QueryTypes']['SELECT']}));}}}else{_0x2ea6ea[_0xdad6('0x1e')](dbH[_0xdad6('0x14')]['query'](QUERY,{'type':dbH[_0xdad6('0x14')][_0xdad6('0x17')]['SELECT']}));}var _0x201e16=path['dirname'](PATH);var _0x48fd61=path[_0xdad6('0x20')](PATH,_0xdad6('0x21'));var _0x3b8bb1=_0x27cc83[_0xdad6('0x11')]&&_0x2ea6ea['length']>0x1;var _0x1141b3=[];if(!fs['existsSync'](path[_0xdad6('0x22')](_0x201e16,_0x48fd61))&&_0x3b8bb1){fs[_0xdad6('0x23')](path['join'](_0x201e16,_0x48fd61));}return BPromise[_0xdad6('0x24')](_0x2ea6ea,function(_0x51d8c1){_0x1141b3[_0xdad6('0x1e')](_0x51d8c1);})['then'](function(){for(var _0x3a46d9=0x0;_0x3a46d9<_0x1141b3['length'];_0x3a46d9+=0x1){var _0x3f65ec;var _0x3daecd=_0x1141b3[_0x3a46d9];if(_0x3b8bb1){_0x3f65ec=path[_0xdad6('0x22')](_0x201e16,_0x48fd61,util[_0xdad6('0xd')]('%s%d.%s',_0x48fd61,_0x3a46d9,_0xdad6('0x25')));}else{_0x3f65ec=path[_0xdad6('0x22')](_0x201e16,util[_0xdad6('0xd')](_0xdad6('0x26'),_0x48fd61,_0xdad6('0x25')));}fs['writeFileSync'](_0x3f65ec,csv(_0x3daecd));}})[_0xdad6('0x13')](function(){if(_0x3b8bb1){return new Promise(function(_0x3d02c7){zipdir(path[_0xdad6('0x22')](_0x201e16,_0x48fd61),{'saveTo':path[_0xdad6('0x22')](_0x201e16,util[_0xdad6('0xd')](_0xdad6('0x26'),_0x48fd61,'zip'))},function(_0x1f9e90,_0x1403c4){rimraf(path[_0xdad6('0x22')](_0x201e16,_0x48fd61),function(){});_0x3d02c7('zip\x20finished');});});}})[_0xdad6('0x13')](function(){logger[_0xdad6('0xc')](util['format'](_0xdad6('0x27'),EXTRACTED_REPORT_ID,_0xdad6('0x28')));return analyticExtractedReport('Completed',_0x3b8bb1?util[_0xdad6('0xd')](_0xdad6('0x26'),_0x48fd61,_0x3b8bb1?_0xdad6('0x29'):_0xdad6('0x25')):null);});})['catch'](function(_0x368614){logger[_0xdad6('0xc')](util[_0xdad6('0xd')](_0xdad6('0x2a'),EXTRACTED_REPORT_ID,_0xdad6('0x28')),util[_0xdad6('0x2b')](_0x368614,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0xdad6('0x2c')](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file +var _0xe04e=['SELECT','dirname','basename','.csv','existsSync','join','each','%s%d.%s','csv','%s.%s','writeFileSync','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','CSV','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','finally','exit','util','lodash','to-csv','zip-dir','rimraf','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','find','split','splitSizeCsv','then','sequelize','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','num','Empty','length','range','isInteger','forEach','push','query','%s\x20limit\x20%d\x20OFFSET\x20%d'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xe04e,0x1f2));var _0xee04=function(_0x4c1a2f,_0x3aef7b){_0x4c1a2f=_0x4c1a2f-0x0;var _0x20ba0c=_0xe04e[_0x4c1a2f];return _0x20ba0c;};'use strict';var util=require(_0xee04('0x0'));var path=require('path');var _=require(_0xee04('0x1'));var csv=require(_0xee04('0x2'));var fs=require('fs');var BPromise=require('bluebird');var zipdir=require(_0xee04('0x3'));var rimraf=require(_0xee04('0x4'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0xee04('0x5')];var logger=require(_0xee04('0x6'))(_0xee04('0x7'));var EXTRACTED_REPORT_ID=Number(process[_0xee04('0x8')][0x2]);var QUERY=process[_0xee04('0x8')][0x3];var PATH=process[_0xee04('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x3a78c4,_0x3b5f0f){var _0x4ab7cf={'status':_0x3a78c4};var _0x2d7940={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x3b5f0f){_0x4ab7cf[_0xee04('0x9')]=_0x3b5f0f;}return db[_0xee04('0xa')][_0xee04('0xb')](_0x4ab7cf,_0x2d7940);}function main(){var _0x256e67=0x1388;var _0xe18b82;logger[_0xee04('0xc')](util[_0xee04('0xd')](_0xee04('0xe'),EXTRACTED_REPORT_ID,'CSV'));return db[_0xee04('0xf')][_0xee04('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xee04('0x11'),_0xee04('0x12')]})['then'](function(_0x14d962){if(_0x14d962){_0xe18b82=_0x14d962;_0x256e67=_0xe18b82[_0xee04('0x12')]||0x1388;}})[_0xee04('0x13')](function(){return dbH[_0xee04('0x14')]['query'](util['format'](_0xee04('0x15'),QUERY),{'type':dbH[_0xee04('0x14')][_0xee04('0x16')]['SELECT']});})['then'](function(_0x2cc9da){if(!_0x2cc9da[0x0][_0xee04('0x17')]){return analyticExtractedReport(_0xee04('0x18'));}var _0x29d0a6=[];var _0x1ab141=0x0;if(_0xe18b82['split']){if(_0x2cc9da&&_0x2cc9da[_0xee04('0x19')]){var _0x277327=_[_0xee04('0x1a')](_0x2cc9da[0x0][_0xee04('0x17')]/_0x256e67);var _0x22c353=Number[_0xee04('0x1b')](_0x2cc9da[0x0][_0xee04('0x17')]/_0x256e67)?_0x2cc9da[0x0][_0xee04('0x17')]%_0x256e67:0x0;_0x277327[_0xee04('0x1c')](function(_0x21092d){if(_0x21092d>0x0){_0x1ab141+=_0x256e67;}_0x29d0a6[_0xee04('0x1d')](dbH[_0xee04('0x14')][_0xee04('0x1e')](util[_0xee04('0xd')](_0xee04('0x1f'),QUERY,_0x256e67,_0x1ab141),{'type':dbH[_0xee04('0x14')][_0xee04('0x16')][_0xee04('0x20')]}));});if(_0x22c353>0x0){_0x1ab141+=_0x256e67;_0x29d0a6['push'](dbH[_0xee04('0x14')][_0xee04('0x1e')](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x22c353,_0x1ab141),{'type':dbH[_0xee04('0x14')][_0xee04('0x16')]['SELECT']}));}}}else{_0x29d0a6[_0xee04('0x1d')](dbH[_0xee04('0x14')]['query'](QUERY,{'type':dbH[_0xee04('0x14')][_0xee04('0x16')][_0xee04('0x20')]}));}var _0x14cb15=path[_0xee04('0x21')](PATH);var _0x4623cb=path[_0xee04('0x22')](PATH,_0xee04('0x23'));var _0x419ca9=_0xe18b82[_0xee04('0x11')]&&_0x29d0a6[_0xee04('0x19')]>0x1;var _0x407f38=[];if(!fs[_0xee04('0x24')](path[_0xee04('0x25')](_0x14cb15,_0x4623cb))&&_0x419ca9){fs['mkdirSync'](path[_0xee04('0x25')](_0x14cb15,_0x4623cb));}return BPromise[_0xee04('0x26')](_0x29d0a6,function(_0x1ceebd){_0x407f38[_0xee04('0x1d')](_0x1ceebd);})[_0xee04('0x13')](function(){for(var _0x2d7177=0x0;_0x2d7177<_0x407f38[_0xee04('0x19')];_0x2d7177+=0x1){var _0x4fb9b8;var _0x4b76b2=_0x407f38[_0x2d7177];if(_0x419ca9){_0x4fb9b8=path[_0xee04('0x25')](_0x14cb15,_0x4623cb,util[_0xee04('0xd')](_0xee04('0x27'),_0x4623cb,_0x2d7177,_0xee04('0x28')));}else{_0x4fb9b8=path['join'](_0x14cb15,util[_0xee04('0xd')](_0xee04('0x29'),_0x4623cb,_0xee04('0x28')));}fs[_0xee04('0x2a')](_0x4fb9b8,csv(_0x4b76b2));}})['then'](function(){if(_0x419ca9){return new Promise(function(_0x1529bb){zipdir(path[_0xee04('0x25')](_0x14cb15,_0x4623cb),{'saveTo':path[_0xee04('0x25')](_0x14cb15,util[_0xee04('0xd')](_0xee04('0x29'),_0x4623cb,_0xee04('0x2b')))},function(_0x2391ec,_0x3c9ece){rimraf(path['join'](_0x14cb15,_0x4623cb),function(){});_0x1529bb(_0xee04('0x2c'));});});}})[_0xee04('0x13')](function(){logger[_0xee04('0xc')](util['format'](_0xee04('0x2d'),EXTRACTED_REPORT_ID,_0xee04('0x2e')));return analyticExtractedReport(_0xee04('0x2f'),_0x419ca9?util[_0xee04('0xd')](_0xee04('0x29'),_0x4623cb,_0x419ca9?_0xee04('0x2b'):_0xee04('0x28')):null);});})[_0xee04('0x30')](function(_0x472d6d){logger[_0xee04('0xc')](util['format'](_0xee04('0x31'),EXTRACTED_REPORT_ID,_0xee04('0x2e')),util['inspect'](_0x472d6d,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xee04('0x32'));})[_0xee04('0x33')](function(){process[_0xee04('0x34')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index 046d673..c187997 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 _0xde36=['findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','PDF','inspect','Failed','exit','/fonts/arial-regular.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','YYYY-MM-DD','center','Interaction\x20Transcript','footer','pipe','createWriteStream','finish','error','end','createPdfFromHTML','util','path','moment','pdfmake/src/printer','jsdom','JSDOM','window','bluebird','../../mysqldb','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','update','map','tableHeader','pick','toString','value','fill','length','auto','body','concat','chunk','keys','forEach','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','endDate','push','header','pageBreak','before','margin','Arial','black','right','Empty','Setting','split','then','splitSizePdf','num','sequelize','query','QueryTypes','SELECT','%s\x20limit\x20%d\x20OFFSET\x20%d','basename','.pdf','existsSync','join','mkdirSync','each','createPdfKitDocument','%s%d.%s','pdf','%s.%s','all','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','zip','info','AnalyticExtractedReport'];(function(_0xbe8733,_0x5360f3){var _0x1d5823=function(_0x8c2d85){while(--_0x8c2d85){_0xbe8733['push'](_0xbe8733['shift']());}};_0x1d5823(++_0x5360f3);}(_0xde36,0x71));var _0x6de3=function(_0x4330e5,_0x141433){_0x4330e5=_0x4330e5-0x0;var _0x1363ff=_0xde36[_0x4330e5];return _0x1363ff;};'use strict';var _=require('lodash');var fs=require('fs');var util=require(_0x6de3('0x0'));var path=require(_0x6de3('0x1'));var moment=require(_0x6de3('0x2'));var htmlToPdfmake=require('html-to-pdfmake');var PdfPrinter=require(_0x6de3('0x3'));var zipdir=require('zip-dir');var rimraf=require('rimraf');var JSDOM=require(_0x6de3('0x4'))[_0x6de3('0x5')];var window=new JSDOM('')[_0x6de3('0x6')];var BPromise=require(_0x6de3('0x7'));var db=require('../../mysqldb')['db'];var dbH=require(_0x6de3('0x8'))['dbH'];var logger=require(_0x6de3('0x9'))(_0x6de3('0xa'));var EXTRACTED_REPORT_ID=Number(process[_0x6de3('0xb')][0x2]);var QUERY=process[_0x6de3('0xb')][0x3];var PATH=process['argv'][0x4];var NAME=process[_0x6de3('0xb')][0x5];var FORMAT=_0x6de3('0xc');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x5cf891,_0x39b172){var _0x3065ad={'status':_0x5cf891};var _0x3cb069={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x39b172){_0x3065ad[_0x6de3('0xd')]=_0x39b172;}return db['AnalyticExtractedReport'][_0x6de3('0xe')](_0x3065ad,_0x3cb069);}function getHeaders(_0xf8eb85){return _[_0x6de3('0xf')](_0xf8eb85,function(_0xdd4c13){return{'text':_0xdd4c13,'style':_0x6de3('0x10')};});}function getRows(_0x5aad99,_0x5d7da6){return _[_0x6de3('0xf')](_0x5d7da6,function(_0x1cc596){return _(_0x1cc596)[_0x6de3('0x11')](_0x5aad99)[_0x6de3('0xf')](function(_0x665dc7){return _0x665dc7?_[_0x6de3('0x12')](_0x665dc7):'';})[_0x6de3('0x13')]();});}function createTable(_0x3e397d,_0x139c1b){var _0x17c708={'widths':_[_0x6de3('0x14')](Array(_0x3e397d[_0x6de3('0x15')]),0x91),'heights':function(_0x4d494c){return _0x4d494c===0x0?_0x6de3('0x16'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x488148=getHeaders(_0x3e397d);_0x17c708[_0x6de3('0x17')]['push'](_0x488148);var _0x2af54d=getRows(_0x3e397d,_0x139c1b);_0x17c708[_0x6de3('0x17')]=_0x17c708['body'][_0x6de3('0x18')](_0x2af54d);return _0x17c708;}function createTables(_0x1e34e2){var _0x1996b8=[];var _0x14e174=_[_0x6de3('0x19')](Object[_0x6de3('0x1a')](_0x1e34e2[0x0]),0x5);_0x14e174[_0x6de3('0x1b')](function(_0x3c3145){_0x1996b8['push'](createTable(_0x3c3145,_0x1e34e2));});return _0x1996b8;}function getPDFDocDefinition(_0xd42f9a){var _0x3a865e=util[_0x6de3('0x1c')](_0x6de3('0x1d'),NAME,EXTRACTED_REPORT[_0x6de3('0x1e')],moment(EXTRACTED_REPORT[_0x6de3('0x1f')])[_0x6de3('0x1c')](FORMAT),moment(EXTRACTED_REPORT[_0x6de3('0x20')])[_0x6de3('0x1c')](FORMAT));var _0x38ec66=[];for(var _0x199b86=0x0;_0x199b86<_0xd42f9a[_0x6de3('0x15')];_0x199b86++){var _0x1e2cce=[];if(_0x199b86===0x0){_0x1e2cce[_0x6de3('0x21')]({'text':_0x3a865e,'style':_0x6de3('0x22')});}var _0x5100b9={'table':_0xd42f9a[_0x199b86]};if(_0x199b86>0x0){_0x5100b9[_0x6de3('0x23')]=_0x6de3('0x24');_0x5100b9[_0x6de3('0x25')]=[0x0,0x46,0x0,0x0];}_0x1e2cce[_0x6de3('0x21')](_0x5100b9);_0x38ec66[_0x6de3('0x21')](_0x1e2cce);}return{'pageSize':'A4','pageOrientation':'landscape','content':_0x38ec66,'footer':function(_0x2c486d,_0x3aa173){return{'text':_0x2c486d[_0x6de3('0x12')]()+'\x20/\x20'+_0x3aa173,'style':'footer'};},'defaultStyle':{'font':_0x6de3('0x26')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x6de3('0x27')},'footer':{'alignment':_0x6de3('0x28'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0xb73fcd){var _0x5a37d4=0x1388;var _0x350b84;if(!_0xb73fcd[0x0]['num']){return analyticExtractedReport(_0x6de3('0x29'));}return db[_0x6de3('0x2a')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x6de3('0x2b'),'splitSizePdf']})[_0x6de3('0x2c')](function(_0x3c5988){if(_0x3c5988){_0x350b84=_0x3c5988;_0x5a37d4=_0x350b84[_0x6de3('0x2d')]||0x3e8;}})[_0x6de3('0x2c')](function(){var _0x2a24da=[];var _0x4af169=0x0;if(_0x350b84[_0x6de3('0x2b')]){if(_0xb73fcd&&_0xb73fcd[_0x6de3('0x15')]){var _0x537e7e=_['range'](_0xb73fcd[0x0]['num']/_0x5a37d4);var _0x446d43=Number['isInteger'](_0xb73fcd[0x0]['num']/_0x5a37d4)?_0xb73fcd[0x0][_0x6de3('0x2e')]%_0x5a37d4:0x0;_0x537e7e['forEach'](function(_0x4bad34){if(_0x4bad34>0x0){_0x4af169+=_0x5a37d4;}_0x2a24da[_0x6de3('0x21')](dbH[_0x6de3('0x2f')][_0x6de3('0x30')](util[_0x6de3('0x1c')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x5a37d4,_0x4af169),{'type':dbH[_0x6de3('0x2f')][_0x6de3('0x31')][_0x6de3('0x32')]}));});if(_0x446d43>0x0){_0x4af169+=_0x5a37d4;_0x2a24da[_0x6de3('0x21')](dbH[_0x6de3('0x2f')][_0x6de3('0x30')](util[_0x6de3('0x1c')](_0x6de3('0x33'),QUERY,_0x446d43,_0x4af169),{'type':dbH['sequelize']['QueryTypes'][_0x6de3('0x32')]}));}}}else{_0x2a24da[_0x6de3('0x21')](dbH[_0x6de3('0x2f')][_0x6de3('0x30')](QUERY,{'type':dbH[_0x6de3('0x2f')][_0x6de3('0x31')]['SELECT']}));}var _0x2da015=path['dirname'](PATH);var _0x3f08fd=path[_0x6de3('0x34')](PATH,_0x6de3('0x35'));var _0x32ff4d=_0x350b84[_0x6de3('0x2b')]&&_0x2a24da[_0x6de3('0x15')]>0x1;var _0xe80c0d=[];if(!fs[_0x6de3('0x36')](path[_0x6de3('0x37')](_0x2da015,_0x3f08fd))&&_0x32ff4d){fs[_0x6de3('0x38')](path[_0x6de3('0x37')](_0x2da015,_0x3f08fd));}return BPromise[_0x6de3('0x39')](_0x2a24da,function(_0x40f987){_0xe80c0d[_0x6de3('0x21')](_0x40f987);})[_0x6de3('0x2c')](function(){var _0x583033=[];for(var _0x5a0372=0x0;_0x5a0372<_0xe80c0d[_0x6de3('0x15')];_0x5a0372+=0x1){var _0x427ba0=_0xe80c0d[_0x5a0372];var _0x3d3785=createTables(_['flatten'](_0x427ba0));var _0x4ff350;var _0x269264=getPDFDocDefinition(_0x3d3785);var _0x28de2e=getPDFPrinter();var _0x2e6f81=_0x28de2e[_0x6de3('0x3a')](_0x269264);if(_0x32ff4d){_0x4ff350=path[_0x6de3('0x37')](_0x2da015,_0x3f08fd,util[_0x6de3('0x1c')](_0x6de3('0x3b'),_0x3f08fd,_0x5a0372,_0x6de3('0x3c')));}else{_0x4ff350=path[_0x6de3('0x37')](_0x2da015,util[_0x6de3('0x1c')](_0x6de3('0x3d'),_0x3f08fd,_0x6de3('0x3c')));}_0x583033[_0x6de3('0x21')](writePDFDocument(_0x2e6f81,_0x4ff350));}return Promise[_0x6de3('0x3e')](_0x583033);})['then'](function(){if(_0x32ff4d){return new Promise(function(_0x2aa714){zipdir(path[_0x6de3('0x37')](_0x2da015,_0x3f08fd),{'saveTo':path[_0x6de3('0x37')](_0x2da015,util[_0x6de3('0x1c')](_0x6de3('0x3d'),_0x3f08fd,'zip'))},function(){rimraf(path[_0x6de3('0x37')](_0x2da015,_0x3f08fd),function(){});_0x2aa714(_0x6de3('0x3f'));});});}})[_0x6de3('0x2c')](function(){if(!_0x32ff4d)return;rimraf(path['join'](_0x2da015,_0x3f08fd),function(){});})[_0x6de3('0x2c')](function(){logger['info'](util[_0x6de3('0x1c')](_0x6de3('0x40'),EXTRACTED_REPORT_ID,'PDF'));return analyticExtractedReport(_0x6de3('0x41'),_0x32ff4d?util[_0x6de3('0x1c')](_0x6de3('0x3d'),_0x3f08fd,_0x32ff4d?_0x6de3('0x42'):_0x6de3('0x3c')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x6de3('0x43')](util[_0x6de3('0x1c')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'PDF'));return db[_0x6de3('0x44')][_0x6de3('0x45')]({'where':{'id':EXTRACTED_REPORT_ID}})['then'](function(_0x31965f){EXTRACTED_REPORT=_0x31965f;return dbH[_0x6de3('0x2f')]['query'](util[_0x6de3('0x1c')](_0x6de3('0x46'),QUERY),{'type':dbH[_0x6de3('0x2f')]['QueryTypes'][_0x6de3('0x32')]});})[_0x6de3('0x2c')](extractReport)[_0x6de3('0x47')](function(_0x23e531){logger[_0x6de3('0x43')](util['format']('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x6de3('0x48')),util[_0x6de3('0x49')](_0x23e531,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x6de3('0x4a'));})['finally'](function(){process[_0x6de3('0x4b')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x9befca=new PdfPrinter({'Arial':{'normal':__dirname+_0x6de3('0x4c'),'bold':__dirname+'/fonts/arial-bold.ttf','italics':__dirname+_0x6de3('0x4d'),'bolditalics':__dirname+_0x6de3('0x4e')}});return _0x9befca;}function getPDFDocDefinitionFromHTML(_0x59cdbe,_0x5d0ef0){var _0x28bb5b=util[_0x6de3('0x1c')](_0x6de3('0x4f'),_0x5d0ef0[_0x6de3('0x50')],_0x5d0ef0['interactionId']);var _0x4cf681=moment()[_0x6de3('0x1c')](_0x6de3('0x51'))[_0x6de3('0x12')]();var _0xc6c9b=htmlToPdfmake(_0x59cdbe,{'window':window,'tableAutoSize':!![]});return{'content':[_0xc6c9b],'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':'center','margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x6de3('0x52'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':'center'}},'header':function(){return[{'text':_0x6de3('0x53'),'style':'header'}];},'footer':function(_0x5b85cd,_0x12b520){return[{'text':util['format']('\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s',_0x28bb5b,_0x5b85cd,_0x12b520,_0x4cf681),'style':_0x6de3('0x54')}];}};}function writePDFDocument(_0x251077,_0x2ccf4a){return new Promise(function(_0x3985ad,_0x4513ea){var _0x1f903e=_0x251077[_0x6de3('0x55')](fs[_0x6de3('0x56')](_0x2ccf4a));_0x1f903e['on']('finish',function(){_0x3985ad(_0x6de3('0x57'));});_0x1f903e['on'](_0x6de3('0x58'),function(_0x31c95a){_0x4513ea(_0x31c95a);});_0x251077[_0x6de3('0x59')]();});}exports[_0x6de3('0x5a')]=function(_0x33b962,_0xeccd3c){var _0x4bc806=getPDFPrinter();var _0x14055c=getPDFDocDefinitionFromHTML(_0x33b962,_0xeccd3c);var _0x45625f=_0x4bc806[_0x6de3('0x3a')](_0x14055c);return writePDFDocument(_0x45625f,_0xeccd3c[_0x6de3('0x1')])['catch'](function(_0x1fe837){throw _0x1fe837;});}; \ No newline at end of file +var _0xe47a=['info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Failed','finally','exit','/fonts/arial-bold.ttf','/fonts/arial-bold-italic.ttf','interactionId','YYYY-MM-DD','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','finish','error','createPdfFromHTML','lodash','util','path','moment','zip-dir','jsdom','JSDOM','window','bluebird','dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','update','tableHeader','pick','toString','value','fill','auto','body','concat','chunk','keys','push','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','endDate','length','header','before','margin','\x20/\x20','footer','Arial','black','right','Empty','Setting','find','split','splitSizePdf','then','num','forEach','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','dirname','basename','.pdf','existsSync','mkdirSync','join','each','flatten','createPdfKitDocument','%s%d.%s','pdf','%s.%s','all','zip','zip\x20finished'];(function(_0x27dba4,_0x419253){var _0x35ec9d=function(_0x2d13b2){while(--_0x2d13b2){_0x27dba4['push'](_0x27dba4['shift']());}};_0x35ec9d(++_0x419253);}(_0xe47a,0x1dc));var _0xae47=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xe47a[_0xfae23b];return _0x200640;};'use strict';var _=require(_0xae47('0x0'));var fs=require('fs');var util=require(_0xae47('0x1'));var path=require(_0xae47('0x2'));var moment=require(_0xae47('0x3'));var htmlToPdfmake=require('html-to-pdfmake');var PdfPrinter=require('pdfmake/src/printer');var zipdir=require(_0xae47('0x4'));var rimraf=require('rimraf');var JSDOM=require(_0xae47('0x5'))[_0xae47('0x6')];var window=new JSDOM('')[_0xae47('0x7')];var BPromise=require(_0xae47('0x8'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0xae47('0x9')];var logger=require(_0xae47('0xa'))(_0xae47('0xb'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0xae47('0xc')][0x3];var PATH=process[_0xae47('0xc')][0x4];var NAME=process[_0xae47('0xc')][0x5];var FORMAT=_0xae47('0xd');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0xe09f32,_0x4b03c8){var _0x5e05a4={'status':_0xe09f32};var _0x29aca7={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x4b03c8){_0x5e05a4[_0xae47('0xe')]=_0x4b03c8;}return db[_0xae47('0xf')][_0xae47('0x10')](_0x5e05a4,_0x29aca7);}function getHeaders(_0x3b72c1){return _['map'](_0x3b72c1,function(_0x4868de){return{'text':_0x4868de,'style':_0xae47('0x11')};});}function getRows(_0x273451,_0x29784e){return _['map'](_0x29784e,function(_0x7a6f81){return _(_0x7a6f81)[_0xae47('0x12')](_0x273451)['map'](function(_0x3588ae){return _0x3588ae?_[_0xae47('0x13')](_0x3588ae):'';})[_0xae47('0x14')]();});}function createTable(_0x48bb75,_0x2d872c){var _0x6bfb4a={'widths':_[_0xae47('0x15')](Array(_0x48bb75['length']),0x91),'heights':function(_0xc63f58){return _0xc63f58===0x0?_0xae47('0x16'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0xf418a5=getHeaders(_0x48bb75);_0x6bfb4a[_0xae47('0x17')]['push'](_0xf418a5);var _0x1b4fe3=getRows(_0x48bb75,_0x2d872c);_0x6bfb4a[_0xae47('0x17')]=_0x6bfb4a['body'][_0xae47('0x18')](_0x1b4fe3);return _0x6bfb4a;}function createTables(_0x2a38fb){var _0x1c4796=[];var _0x479c49=_[_0xae47('0x19')](Object[_0xae47('0x1a')](_0x2a38fb[0x0]),0x5);_0x479c49['forEach'](function(_0x10d0c3){_0x1c4796[_0xae47('0x1b')](createTable(_0x10d0c3,_0x2a38fb));});return _0x1c4796;}function getPDFDocDefinition(_0x74a265){var _0x34d9ad=util[_0xae47('0x1c')](_0xae47('0x1d'),NAME,EXTRACTED_REPORT[_0xae47('0x1e')],moment(EXTRACTED_REPORT[_0xae47('0x1f')])[_0xae47('0x1c')](FORMAT),moment(EXTRACTED_REPORT[_0xae47('0x20')])[_0xae47('0x1c')](FORMAT));var _0x4b98ad=[];for(var _0x4d7d4a=0x0;_0x4d7d4a<_0x74a265[_0xae47('0x21')];_0x4d7d4a++){var _0x12b0b3=[];if(_0x4d7d4a===0x0){_0x12b0b3[_0xae47('0x1b')]({'text':_0x34d9ad,'style':_0xae47('0x22')});}var _0x3d12d0={'table':_0x74a265[_0x4d7d4a]};if(_0x4d7d4a>0x0){_0x3d12d0['pageBreak']=_0xae47('0x23');_0x3d12d0[_0xae47('0x24')]=[0x0,0x46,0x0,0x0];}_0x12b0b3[_0xae47('0x1b')](_0x3d12d0);_0x4b98ad['push'](_0x12b0b3);}return{'pageSize':'A4','pageOrientation':'landscape','content':_0x4b98ad,'footer':function(_0x313995,_0x3cf2d8){return{'text':_0x313995['toString']()+_0xae47('0x25')+_0x3cf2d8,'style':_0xae47('0x26')};},'defaultStyle':{'font':_0xae47('0x27')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xae47('0x28')},'footer':{'alignment':_0xae47('0x29'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x2ac02f){var _0x37cc70=0x1388;var _0x26a351;if(!_0x2ac02f[0x0]['num']){return analyticExtractedReport(_0xae47('0x2a'));}return db[_0xae47('0x2b')][_0xae47('0x2c')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xae47('0x2d'),_0xae47('0x2e')]})['then'](function(_0xb1d851){if(_0xb1d851){_0x26a351=_0xb1d851;_0x37cc70=_0x26a351[_0xae47('0x2e')]||0x3e8;}})[_0xae47('0x2f')](function(){var _0x2ff263=[];var _0xf2228c=0x0;if(_0x26a351[_0xae47('0x2d')]){if(_0x2ac02f&&_0x2ac02f['length']){var _0x22c46f=_['range'](_0x2ac02f[0x0]['num']/_0x37cc70);var _0x5147f3=Number['isInteger'](_0x2ac02f[0x0]['num']/_0x37cc70)?_0x2ac02f[0x0][_0xae47('0x30')]%_0x37cc70:0x0;_0x22c46f[_0xae47('0x31')](function(_0x25baf8){if(_0x25baf8>0x0){_0xf2228c+=_0x37cc70;}_0x2ff263[_0xae47('0x1b')](dbH[_0xae47('0x32')][_0xae47('0x33')](util['format'](_0xae47('0x34'),QUERY,_0x37cc70,_0xf2228c),{'type':dbH['sequelize'][_0xae47('0x35')][_0xae47('0x36')]}));});if(_0x5147f3>0x0){_0xf2228c+=_0x37cc70;_0x2ff263['push'](dbH[_0xae47('0x32')][_0xae47('0x33')](util['format'](_0xae47('0x34'),QUERY,_0x5147f3,_0xf2228c),{'type':dbH[_0xae47('0x32')][_0xae47('0x35')][_0xae47('0x36')]}));}}}else{_0x2ff263[_0xae47('0x1b')](dbH[_0xae47('0x32')][_0xae47('0x33')](QUERY,{'type':dbH['sequelize']['QueryTypes'][_0xae47('0x36')]}));}var _0x3a26bf=path[_0xae47('0x37')](PATH);var _0x513880=path[_0xae47('0x38')](PATH,_0xae47('0x39'));var _0x6a546=_0x26a351[_0xae47('0x2d')]&&_0x2ff263[_0xae47('0x21')]>0x1;var _0x34b7f0=[];if(!fs[_0xae47('0x3a')](path['join'](_0x3a26bf,_0x513880))&&_0x6a546){fs[_0xae47('0x3b')](path[_0xae47('0x3c')](_0x3a26bf,_0x513880));}return BPromise[_0xae47('0x3d')](_0x2ff263,function(_0x42c284){_0x34b7f0['push'](_0x42c284);})['then'](function(){var _0x4461c9=[];for(var _0x346d8f=0x0;_0x346d8f<_0x34b7f0[_0xae47('0x21')];_0x346d8f+=0x1){var _0x5e797a=_0x34b7f0[_0x346d8f];var _0x489419=createTables(_[_0xae47('0x3e')](_0x5e797a));var _0x37c511;var _0x14a573=getPDFDocDefinition(_0x489419);var _0xa1107d=getPDFPrinter();var _0x7565a0=_0xa1107d[_0xae47('0x3f')](_0x14a573);if(_0x6a546){_0x37c511=path[_0xae47('0x3c')](_0x3a26bf,_0x513880,util[_0xae47('0x1c')](_0xae47('0x40'),_0x513880,_0x346d8f,_0xae47('0x41')));}else{_0x37c511=path[_0xae47('0x3c')](_0x3a26bf,util[_0xae47('0x1c')](_0xae47('0x42'),_0x513880,_0xae47('0x41')));}_0x4461c9[_0xae47('0x1b')](writePDFDocument(_0x7565a0,_0x37c511));}return Promise[_0xae47('0x43')](_0x4461c9);})[_0xae47('0x2f')](function(){if(_0x6a546){return new Promise(function(_0x5b68f8){zipdir(path['join'](_0x3a26bf,_0x513880),{'saveTo':path['join'](_0x3a26bf,util[_0xae47('0x1c')](_0xae47('0x42'),_0x513880,_0xae47('0x44')))},function(){rimraf(path[_0xae47('0x3c')](_0x3a26bf,_0x513880),function(){});_0x5b68f8(_0xae47('0x45'));});});}})[_0xae47('0x2f')](function(){if(!_0x6a546)return;rimraf(path[_0xae47('0x3c')](_0x3a26bf,_0x513880),function(){});})['then'](function(){logger[_0xae47('0x46')](util['format'](_0xae47('0x47'),EXTRACTED_REPORT_ID,_0xae47('0x48')));return analyticExtractedReport('Completed',_0x6a546?util[_0xae47('0x1c')](_0xae47('0x42'),_0x513880,_0x6a546?'zip':'pdf'):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger['info'](util[_0xae47('0x1c')](_0xae47('0x49'),EXTRACTED_REPORT_ID,_0xae47('0x48')));return db[_0xae47('0xf')][_0xae47('0x4a')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0xae47('0x2f')](function(_0x5da003){EXTRACTED_REPORT=_0x5da003;return dbH[_0xae47('0x32')]['query'](util[_0xae47('0x1c')](_0xae47('0x4b'),QUERY),{'type':dbH[_0xae47('0x32')][_0xae47('0x35')][_0xae47('0x36')]});})['then'](extractReport)[_0xae47('0x4c')](function(_0x33a00c){logger[_0xae47('0x46')](util[_0xae47('0x1c')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xae47('0x48')),util['inspect'](_0x33a00c,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xae47('0x4d'));})[_0xae47('0x4e')](function(){process[_0xae47('0x4f')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x4ee03e=new PdfPrinter({'Arial':{'normal':__dirname+'/fonts/arial-regular.ttf','bold':__dirname+_0xae47('0x50'),'italics':__dirname+'/fonts/arial-italic.ttf','bolditalics':__dirname+_0xae47('0x51')}});return _0x4ee03e;}function getPDFDocDefinitionFromHTML(_0x184f30,_0x257394){var _0x40533a=util[_0xae47('0x1c')]('%s\x20#%d',_0x257394['channel'],_0x257394[_0xae47('0x52')]);var _0x5e668e=moment()[_0xae47('0x1c')](_0xae47('0x53'))['toString']();var _0x2993fd=htmlToPdfmake(_0x184f30,{'window':window,'tableAutoSize':!![]});return{'content':[_0x2993fd],'defaultStyle':{'font':_0xae47('0x27')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':'center','margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0xae47('0x54'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0xae47('0x54')}},'header':function(){return[{'text':_0xae47('0x55'),'style':_0xae47('0x22')}];},'footer':function(_0x418055,_0x36e0cf){return[{'text':util[_0xae47('0x1c')](_0xae47('0x56'),_0x40533a,_0x418055,_0x36e0cf,_0x5e668e),'style':_0xae47('0x26')}];}};}function writePDFDocument(_0x1fb7c2,_0x5d472c){return new Promise(function(_0x4d4f58,_0x1490ae){var _0x384e2b=_0x1fb7c2[_0xae47('0x57')](fs['createWriteStream'](_0x5d472c));_0x384e2b['on'](_0xae47('0x58'),function(){_0x4d4f58(_0xae47('0x58'));});_0x384e2b['on'](_0xae47('0x59'),function(_0x3e0dd2){_0x1490ae(_0x3e0dd2);});_0x1fb7c2['end']();});}exports[_0xae47('0x5a')]=function(_0x8eb9fc,_0x136bd0){var _0x446823=getPDFPrinter();var _0x11a7c6=getPDFDocDefinitionFromHTML(_0x8eb9fc,_0x136bd0);var _0x4a1368=_0x446823[_0xae47('0x3f')](_0x11a7c6);return writePDFDocument(_0x4a1368,_0x136bd0[_0xae47('0x2')])[_0xae47('0x4c')](function(_0x1ca281){throw _0x1ca281;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index dea6c9f..1b975c4 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 _0x6c9c=['split','length','range','num','isInteger','push','query','%s\x20limit\x20%d\x20OFFSET\x20%d','basename','.xlsx','join','each','%s%d.%s','xlsx','%s.%s','writeFileSync','zip','Completed','catch','inspect','Failed','exit','util','path','json2xls','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','info','format','XLSX','splitSizeXlsx','then','sequelize','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','Empty'];(function(_0x5ab5d9,_0x38a056){var _0x106fb8=function(_0x135e83){while(--_0x135e83){_0x5ab5d9['push'](_0x5ab5d9['shift']());}};_0x106fb8(++_0x38a056);}(_0x6c9c,0x12a));var _0xc6c9=function(_0x217c42,_0xa0e462){_0x217c42=_0x217c42-0x0;var _0x4ddb57=_0x6c9c[_0x217c42];return _0x4ddb57;};'use strict';var util=require(_0xc6c9('0x0'));var path=require(_0xc6c9('0x1'));var _=require('lodash');var fs=require('fs');var json2xls=require(_0xc6c9('0x2'));var BPromise=require(_0xc6c9('0x3'));var zipdir=require(_0xc6c9('0x4'));var rimraf=require(_0xc6c9('0x5'));var db=require('../../mysqldb')['db'];var dbH=require(_0xc6c9('0x6'))[_0xc6c9('0x7')];var logger=require(_0xc6c9('0x8'))(_0xc6c9('0x9'));var EXTRACTED_REPORT_ID=Number(process[_0xc6c9('0xa')][0x2]);var QUERY=process[_0xc6c9('0xa')][0x3];var PATH=process[_0xc6c9('0xa')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0xd310e9,_0x30db53){var _0x15cf6e={'status':_0xd310e9};var _0xb11c68={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x30db53){_0x15cf6e[_0xc6c9('0xb')]=_0x30db53;}return db[_0xc6c9('0xc')][_0xc6c9('0xd')](_0x15cf6e,_0xb11c68);}function main(){var _0x2fb627=0x1388;var _0x10a3d4;logger[_0xc6c9('0xe')](util[_0xc6c9('0xf')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xc6c9('0x10')));return db['Setting']['find']({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0xc6c9('0x11')]})[_0xc6c9('0x12')](function(_0x2d35c9){if(_0x2d35c9){_0x10a3d4=_0x2d35c9;_0x2fb627=_0x10a3d4[_0xc6c9('0x11')]||0x1388;}})[_0xc6c9('0x12')](function(){return dbH[_0xc6c9('0x13')]['query'](util['format'](_0xc6c9('0x14'),QUERY),{'type':dbH[_0xc6c9('0x13')][_0xc6c9('0x15')][_0xc6c9('0x16')]});})[_0xc6c9('0x12')](function(_0x12d501){if(!_0x12d501[0x0]['num']){return analyticExtractedReport(_0xc6c9('0x17'));}var _0x242d20=[];var _0x406add=0x0;if(_0x10a3d4[_0xc6c9('0x18')]){if(_0x12d501&&_0x12d501[_0xc6c9('0x19')]){var _0x35c82c=_[_0xc6c9('0x1a')](_0x12d501[0x0][_0xc6c9('0x1b')]/_0x2fb627);var _0x40d245=Number[_0xc6c9('0x1c')](_0x12d501[0x0][_0xc6c9('0x1b')]/_0x2fb627)?_0x12d501[0x0]['num']%_0x2fb627:0x0;_0x35c82c['forEach'](function(_0x3b46af){if(_0x3b46af>0x0){_0x406add+=_0x2fb627;}_0x242d20[_0xc6c9('0x1d')](dbH[_0xc6c9('0x13')]['query'](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x2fb627,_0x406add),{'type':dbH['sequelize'][_0xc6c9('0x15')][_0xc6c9('0x16')]}));});if(_0x40d245>0x0){_0x406add+=_0x2fb627;_0x242d20[_0xc6c9('0x1d')](dbH[_0xc6c9('0x13')][_0xc6c9('0x1e')](util['format'](_0xc6c9('0x1f'),QUERY,_0x40d245,_0x406add),{'type':dbH[_0xc6c9('0x13')]['QueryTypes']['SELECT']}));}}}else{_0x242d20['push'](dbH[_0xc6c9('0x13')][_0xc6c9('0x1e')](QUERY,{'type':dbH[_0xc6c9('0x13')][_0xc6c9('0x15')][_0xc6c9('0x16')]}));}var _0x589dbf=path['dirname'](PATH);var _0xb432ec=path[_0xc6c9('0x20')](PATH,_0xc6c9('0x21'));var _0x5e1817=_0x10a3d4[_0xc6c9('0x18')]&&_0x242d20[_0xc6c9('0x19')]>0x1;var _0x1fe406=[];if(!fs['existsSync'](path['join'](_0x589dbf,_0xb432ec))&&_0x5e1817){fs['mkdirSync'](path[_0xc6c9('0x22')](_0x589dbf,_0xb432ec));}return BPromise[_0xc6c9('0x23')](_0x242d20,function(_0x9ffcb5){_0x1fe406[_0xc6c9('0x1d')](_0x9ffcb5);})[_0xc6c9('0x12')](function(){for(var _0x47fe8e=0x0;_0x47fe8e<_0x1fe406[_0xc6c9('0x19')];_0x47fe8e+=0x1){var _0x167173;var _0x5a6848=_0x1fe406[_0x47fe8e];if(_0x5e1817){_0x167173=path[_0xc6c9('0x22')](_0x589dbf,_0xb432ec,util[_0xc6c9('0xf')](_0xc6c9('0x24'),_0xb432ec,_0x47fe8e,_0xc6c9('0x25')));}else{_0x167173=path[_0xc6c9('0x22')](_0x589dbf,util['format'](_0xc6c9('0x26'),_0xb432ec,_0xc6c9('0x25')));}fs[_0xc6c9('0x27')](_0x167173,json2xls(_0x5a6848),'binary');}})[_0xc6c9('0x12')](function(){if(_0x5e1817){return new Promise(function(_0x1493ca){zipdir(path[_0xc6c9('0x22')](_0x589dbf,_0xb432ec),{'saveTo':path[_0xc6c9('0x22')](_0x589dbf,util[_0xc6c9('0xf')](_0xc6c9('0x26'),_0xb432ec,_0xc6c9('0x28')))},function(_0x156968,_0xa36594){rimraf(path[_0xc6c9('0x22')](_0x589dbf,_0xb432ec),function(){});_0x1493ca('zip\x20finished');});});}})[_0xc6c9('0x12')](function(){logger['info'](util[_0xc6c9('0xf')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,'XLSX'));return analyticExtractedReport(_0xc6c9('0x29'),_0x5e1817?util[_0xc6c9('0xf')](_0xc6c9('0x26'),_0xb432ec,_0x5e1817?'zip':_0xc6c9('0x25')):null);});})[_0xc6c9('0x2a')](function(_0x859dd8){logger[_0xc6c9('0xe')](util[_0xc6c9('0xf')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xc6c9('0x10')),util[_0xc6c9('0x2b')](_0x859dd8,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xc6c9('0x2c'));})['finally'](function(){process[_0xc6c9('0x2d')](EXIT_CODE);});}main(); \ No newline at end of file +var _0x2dd8=['path','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','argv','savename','AnalyticExtractedReport','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','find','splitSizeXlsx','then','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','sequelize','QueryTypes','SELECT','num','Empty','split','length','range','isInteger','forEach','push','query','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.xlsx','existsSync','join','mkdirSync','each','%s%d.%s','xlsx','%s.%s','binary','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','zip','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','util'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0x2dd8,0x143));var _0x82dd=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x2dd8[_0xa464c9];return _0x3d73c4;};'use strict';var util=require(_0x82dd('0x0'));var path=require(_0x82dd('0x1'));var _=require('lodash');var fs=require('fs');var json2xls=require('json2xls');var BPromise=require(_0x82dd('0x2'));var zipdir=require(_0x82dd('0x3'));var rimraf=require(_0x82dd('0x4'));var db=require(_0x82dd('0x5'))['db'];var dbH=require(_0x82dd('0x5'))[_0x82dd('0x6')];var logger=require(_0x82dd('0x7'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x82dd('0x8')][0x2]);var QUERY=process[_0x82dd('0x8')][0x3];var PATH=process[_0x82dd('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x2e9d89,_0x54fb28){var _0x21ebb8={'status':_0x2e9d89};var _0x3e8516={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x54fb28){_0x21ebb8[_0x82dd('0x9')]=_0x54fb28;}return db[_0x82dd('0xa')]['update'](_0x21ebb8,_0x3e8516);}function main(){var _0x4a2fa6=0x1388;var _0x332c36;logger['info'](util[_0x82dd('0xb')](_0x82dd('0xc'),EXTRACTED_REPORT_ID,_0x82dd('0xd')));return db[_0x82dd('0xe')][_0x82dd('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x82dd('0x10')]})[_0x82dd('0x11')](function(_0x348f79){if(_0x348f79){_0x332c36=_0x348f79;_0x4a2fa6=_0x332c36[_0x82dd('0x10')]||0x1388;}})[_0x82dd('0x11')](function(){return dbH['sequelize']['query'](util[_0x82dd('0xb')](_0x82dd('0x12'),QUERY),{'type':dbH[_0x82dd('0x13')][_0x82dd('0x14')][_0x82dd('0x15')]});})[_0x82dd('0x11')](function(_0x31b9c1){if(!_0x31b9c1[0x0][_0x82dd('0x16')]){return analyticExtractedReport(_0x82dd('0x17'));}var _0x1b90e0=[];var _0x3d7664=0x0;if(_0x332c36[_0x82dd('0x18')]){if(_0x31b9c1&&_0x31b9c1[_0x82dd('0x19')]){var _0x51d2a9=_[_0x82dd('0x1a')](_0x31b9c1[0x0][_0x82dd('0x16')]/_0x4a2fa6);var _0x34d991=Number[_0x82dd('0x1b')](_0x31b9c1[0x0][_0x82dd('0x16')]/_0x4a2fa6)?_0x31b9c1[0x0][_0x82dd('0x16')]%_0x4a2fa6:0x0;_0x51d2a9[_0x82dd('0x1c')](function(_0x1e8ea2){if(_0x1e8ea2>0x0){_0x3d7664+=_0x4a2fa6;}_0x1b90e0[_0x82dd('0x1d')](dbH[_0x82dd('0x13')][_0x82dd('0x1e')](util[_0x82dd('0xb')](_0x82dd('0x1f'),QUERY,_0x4a2fa6,_0x3d7664),{'type':dbH['sequelize'][_0x82dd('0x14')][_0x82dd('0x15')]}));});if(_0x34d991>0x0){_0x3d7664+=_0x4a2fa6;_0x1b90e0[_0x82dd('0x1d')](dbH[_0x82dd('0x13')][_0x82dd('0x1e')](util[_0x82dd('0xb')](_0x82dd('0x1f'),QUERY,_0x34d991,_0x3d7664),{'type':dbH[_0x82dd('0x13')]['QueryTypes']['SELECT']}));}}}else{_0x1b90e0[_0x82dd('0x1d')](dbH[_0x82dd('0x13')]['query'](QUERY,{'type':dbH['sequelize'][_0x82dd('0x14')][_0x82dd('0x15')]}));}var _0x3b0740=path[_0x82dd('0x20')](PATH);var _0x4609c1=path[_0x82dd('0x21')](PATH,_0x82dd('0x22'));var _0x1374e3=_0x332c36[_0x82dd('0x18')]&&_0x1b90e0[_0x82dd('0x19')]>0x1;var _0xe6aacd=[];if(!fs[_0x82dd('0x23')](path[_0x82dd('0x24')](_0x3b0740,_0x4609c1))&&_0x1374e3){fs[_0x82dd('0x25')](path['join'](_0x3b0740,_0x4609c1));}return BPromise[_0x82dd('0x26')](_0x1b90e0,function(_0x3abff0){_0xe6aacd[_0x82dd('0x1d')](_0x3abff0);})['then'](function(){for(var _0x15da13=0x0;_0x15da13<_0xe6aacd['length'];_0x15da13+=0x1){var _0x15f31f;var _0x93fd00=_0xe6aacd[_0x15da13];if(_0x1374e3){_0x15f31f=path[_0x82dd('0x24')](_0x3b0740,_0x4609c1,util['format'](_0x82dd('0x27'),_0x4609c1,_0x15da13,_0x82dd('0x28')));}else{_0x15f31f=path['join'](_0x3b0740,util['format'](_0x82dd('0x29'),_0x4609c1,_0x82dd('0x28')));}fs['writeFileSync'](_0x15f31f,json2xls(_0x93fd00),_0x82dd('0x2a'));}})[_0x82dd('0x11')](function(){if(_0x1374e3){return new Promise(function(_0x2d2b7b){zipdir(path['join'](_0x3b0740,_0x4609c1),{'saveTo':path[_0x82dd('0x24')](_0x3b0740,util[_0x82dd('0xb')]('%s.%s',_0x4609c1,'zip'))},function(_0x1b3c04,_0x225cf1){rimraf(path['join'](_0x3b0740,_0x4609c1),function(){});_0x2d2b7b(_0x82dd('0x2b'));});});}})[_0x82dd('0x11')](function(){logger[_0x82dd('0x2c')](util[_0x82dd('0xb')](_0x82dd('0x2d'),EXTRACTED_REPORT_ID,'XLSX'));return analyticExtractedReport(_0x82dd('0x2e'),_0x1374e3?util[_0x82dd('0xb')]('%s.%s',_0x4609c1,_0x1374e3?_0x82dd('0x2f'):_0x82dd('0x28')):null);});})[_0x82dd('0x30')](function(_0xffb16c){logger['info'](util[_0x82dd('0xb')](_0x82dd('0x31'),EXTRACTED_REPORT_ID,_0x82dd('0xd')),util[_0x82dd('0x32')](_0xffb16c,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x82dd('0x33'));})[_0x82dd('0x34')](function(){process[_0x82dd('0x35')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index 21d5783..3249bff 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 _0xf557=['wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','toLowerCase','createdAt','interval','*,*,*,*','tag','CDR(tag)=','length','callerID','ExecIf','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','$[${XCALLY-MOTION-PROGRESS}=0]?Progress',',${EXTEN},','last','Hangup','concat','transaction','destroy','bulkCreate','sortBy','catch','error','rewrite','lodash','util','models','Interval','then','intervals','VoiceExtension','findAll','IntervalId','map','exten','filter','groupBy','queue','playback','hasOwnProperty','priority','extension','extensions','VoiceExtensionId','type','push','Set','CDR(routeid)=','outbound','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','context','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT='];(function(_0x549739,_0x7d6313){var _0x675472=function(_0x447757){while(--_0x447757){_0x549739['push'](_0x549739['shift']());}};_0x675472(++_0x7d6313);}(_0xf557,0x1bd));var _0x7f55=function(_0x8f1b0,_0x7bd5db){_0x8f1b0=_0x8f1b0-0x0;var _0x2a8db8=_0xf557[_0x8f1b0];return _0x2a8db8;};'use strict';var _=require(_0x7f55('0x0'));var util=require(_0x7f55('0x1'));function rewrite(_0xf3e724,_0x1514f8){var _0x46de52=this;return _0xf3e724[_0x7f55('0x2')][_0x7f55('0x3')]['findAll']({'raw':!![]})[_0x7f55('0x4')](function(_0x3941ab){_0x46de52[_0x7f55('0x5')]=_0x3941ab;return _0xf3e724[_0x7f55('0x2')][_0x7f55('0x6')][_0x7f55('0x7')]({'where':{'IntervalId':_0x1514f8[_0x7f55('0x8')]},'raw':!![]});})[_0x7f55('0x4')](function(_0x38b032){return _0xf3e724[_0x7f55('0x2')][_0x7f55('0x6')][_0x7f55('0x7')]({'where':{'exten':{'$in':_['uniq'](_[_0x7f55('0x9')](_0x38b032,_0x7f55('0xa')))}},'order':[{'raw':'CAST(priority\x20AS\x20UNSIGNED)'}],'raw':!![]});})[_0x7f55('0x4')](function(_0x2b1235){var _0x391df7=_['filter'](_0x2b1235,{'priority':'1'});var _0x34d480=_[_0x7f55('0xb')](_0x2b1235,{'isApp':0x1});var _0x6030c4=_[_0x7f55('0xc')](_0x34d480,_0x7f55('0xa'));var _0x50f5ea=[_0x7f55('0xd'),_0x7f55('0xe')];var _0x1c0eb0=[];var _0x26f29c=[];for(var _0x28f7b9 in _0x6030c4){if(_0x6030c4[_0x7f55('0xf')](_0x28f7b9)){_0x46de52[_0x7f55('0x10')]=0x2;_0x46de52['extensions']=[];_0x46de52[_0x7f55('0x11')]=_['find'](_0x391df7,{'exten':_0x6030c4[_0x28f7b9][0x0][_0x7f55('0xa')]});_0x46de52[_0x7f55('0x12')]['push']({'type':_0x6030c4[_0x28f7b9][0x0]['type'],'app':'Set','appdata':util['format']('CDR(type)=%s',_0x6030c4[_0x28f7b9][0x0]['type']),'context':_0x6030c4[_0x28f7b9][0x0]['context'],'exten':_0x6030c4[_0x28f7b9][0x0][_0x7f55('0xa')],'priority':_0x46de52['priority']++,'VoiceExtensionId':_0x6030c4[_0x28f7b9][0x0][_0x7f55('0x13')]});if(_0x6030c4[_0x28f7b9][0x0][_0x7f55('0x14')]==='inbound'){_0x46de52[_0x7f55('0x12')][_0x7f55('0x15')]({'type':_0x6030c4[_0x28f7b9][0x0][_0x7f55('0x14')],'app':_0x7f55('0x16'),'appdata':_0x7f55('0x17')+_0x6030c4[_0x28f7b9][0x0][_0x7f55('0x13')],'context':_0x6030c4[_0x28f7b9][0x0]['context'],'exten':_0x6030c4[_0x28f7b9][0x0][_0x7f55('0xa')],'priority':_0x46de52['priority']++,'VoiceExtensionId':_0x6030c4[_0x28f7b9][0x0]['VoiceExtensionId']});}else if(_0x6030c4[_0x28f7b9][0x0][_0x7f55('0x14')]===_0x7f55('0x18')){if(_0x46de52[_0x7f55('0x11')]){_0x46de52[_0x7f55('0x12')][_0x7f55('0x15')]({'type':_0x6030c4[_0x28f7b9][0x0][_0x7f55('0x14')],'app':_0x7f55('0x16'),'appdata':_0x7f55('0x19')+(_0x46de52[_0x7f55('0x11')][_0x7f55('0x1a')]?_0x7f55('0x1b')+_0x46de52[_0x7f55('0x11')][_0x7f55('0x1a')]+'}':_0x7f55('0x1c')),'context':_0x6030c4[_0x28f7b9][0x0][_0x7f55('0x1d')],'exten':_0x6030c4[_0x28f7b9][0x0]['exten'],'priority':_0x46de52['priority']++,'VoiceExtensionId':_0x6030c4[_0x28f7b9][0x0]['VoiceExtensionId']});}_0x46de52[_0x7f55('0x12')][_0x7f55('0x15')]({'type':_0x6030c4[_0x28f7b9][0x0][_0x7f55('0x14')],'app':_0x7f55('0x16'),'appdata':_0x7f55('0x17')+_0x6030c4[_0x28f7b9][0x0][_0x7f55('0x13')],'context':_0x6030c4[_0x28f7b9][0x0]['context'],'exten':_0x6030c4[_0x28f7b9][0x0]['exten'],'priority':_0x46de52['priority']++,'VoiceExtensionId':_0x6030c4[_0x28f7b9][0x0][_0x7f55('0x13')]});var _0x3acb12=_0x46de52[_0x7f55('0x10')]++;_0x46de52[_0x7f55('0x12')][_0x7f55('0x15')]({'type':_0x6030c4[_0x28f7b9][0x0]['type'],'app':'ExecIf','appdata':_0x7f55('0x1e')+(_0x3acb12+0x2)+_0x7f55('0x1f')+(_0x3acb12+0x1)+')','context':_0x6030c4[_0x28f7b9][0x0]['context'],'exten':_0x6030c4[_0x28f7b9][0x0][_0x7f55('0xa')],'priority':_0x3acb12,'VoiceExtensionId':_0x6030c4[_0x28f7b9][0x0][_0x7f55('0x13')]});if(_0x46de52[_0x7f55('0x11')]){_0x46de52[_0x7f55('0x12')]['push']({'type':_0x6030c4[_0x28f7b9][0x0][_0x7f55('0x14')],'app':_0x7f55('0x16'),'appdata':_0x46de52['extension'][_0x7f55('0x1a')]?_0x7f55('0x20')+_0x46de52[_0x7f55('0x11')][_0x7f55('0x1a')]+'}':'CDR(prefix)=noprefix','context':_0x6030c4[_0x28f7b9][0x0]['context'],'exten':_0x6030c4[_0x28f7b9][0x0][_0x7f55('0xa')],'priority':_0x46de52['priority']++,'VoiceExtensionId':_0x6030c4[_0x28f7b9][0x0][_0x7f55('0x13')]});}_0x46de52[_0x7f55('0x12')]['push']({'type':_0x6030c4[_0x28f7b9][0x0][_0x7f55('0x14')],'app':_0x7f55('0x16'),'appdata':_0x7f55('0x21')+_0x6030c4[_0x28f7b9][0x0][_0x7f55('0x13')],'context':_0x6030c4[_0x28f7b9][0x0][_0x7f55('0x1d')],'exten':_0x6030c4[_0x28f7b9][0x0][_0x7f55('0xa')],'priority':_0x46de52['priority']++,'VoiceExtensionId':_0x6030c4[_0x28f7b9][0x0][_0x7f55('0x13')]});if(_0x46de52['extension']&&_0x46de52[_0x7f55('0x11')]['hasOwnProperty']('recordingFormat')&&_0x46de52[_0x7f55('0x11')][_0x7f55('0x22')]!==_0x7f55('0x23')){_0x46de52[_0x7f55('0x12')][_0x7f55('0x15')]({'type':_0x6030c4[_0x28f7b9][0x0][_0x7f55('0x14')],'app':_0x7f55('0x16'),'appdata':_0x7f55('0x24'),'context':_0x6030c4[_0x28f7b9][0x0][_0x7f55('0x1d')],'exten':_0x6030c4[_0x28f7b9][0x0][_0x7f55('0xa')],'priority':_0x46de52[_0x7f55('0x10')]++,'VoiceExtensionId':_0x6030c4[_0x28f7b9][0x0][_0x7f55('0x13')]});_0x46de52['extensions'][_0x7f55('0x15')]({'type':_0x6030c4[_0x28f7b9][0x0][_0x7f55('0x14')],'app':'Set','appdata':_0x7f55('0x25')+_0x46de52[_0x7f55('0x11')][_0x7f55('0x22')]||_0x7f55('0x26'),'context':_0x6030c4[_0x28f7b9][0x0][_0x7f55('0x1d')],'exten':_0x6030c4[_0x28f7b9][0x0][_0x7f55('0xa')],'priority':_0x46de52['priority']++,'VoiceExtensionId':_0x6030c4[_0x28f7b9][0x0][_0x7f55('0x13')]});}}_0x46de52[_0x7f55('0x12')][_0x7f55('0x15')]({'type':_0x6030c4[_0x28f7b9][0x0][_0x7f55('0x14')],'app':'Set','appdata':_0x7f55('0x27'),'context':_0x6030c4[_0x28f7b9][0x0][_0x7f55('0x1d')],'exten':_0x6030c4[_0x28f7b9][0x0][_0x7f55('0xa')],'priority':_0x46de52[_0x7f55('0x10')]++,'VoiceExtensionId':_0x6030c4[_0x28f7b9][0x0]['VoiceExtensionId']});_0x46de52[_0x7f55('0x12')][_0x7f55('0x15')]({'type':_0x6030c4[_0x28f7b9][0x0][_0x7f55('0x14')],'app':_0x7f55('0x16'),'appdata':_0x7f55('0x28'),'context':_0x6030c4[_0x28f7b9][0x0][_0x7f55('0x1d')],'exten':_0x6030c4[_0x28f7b9][0x0][_0x7f55('0xa')],'priority':_0x46de52[_0x7f55('0x10')]++,'VoiceExtensionId':_0x6030c4[_0x28f7b9][0x0]['VoiceExtensionId']});_0x46de52[_0x7f55('0x12')][_0x7f55('0x15')]({'type':_0x6030c4[_0x28f7b9][0x0][_0x7f55('0x14')],'app':_0x7f55('0x16'),'appdata':_0x7f55('0x29'),'context':_0x6030c4[_0x28f7b9][0x0][_0x7f55('0x1d')],'exten':_0x6030c4[_0x28f7b9][0x0][_0x7f55('0xa')],'priority':_0x46de52['priority']++,'VoiceExtensionId':_0x6030c4[_0x28f7b9][0x0]['VoiceExtensionId']});for(var _0xee8a5a=0x0,_0x34c3dc=0x0;_0xee8a5a<_0x6030c4[_0x28f7b9]['length'];_0xee8a5a+=0x1,_0x34c3dc=0x0){var _0x20649a=_0x6030c4[_0x28f7b9][_0xee8a5a];if(_0x20649a['type']){_0x20649a[_0x7f55('0x14')]=_0x20649a[_0x7f55('0x14')][_0x7f55('0x2a')]();}var _0x5c5309=[];var _0x6d1164=[];delete _0x20649a['id'];delete _0x20649a[_0x7f55('0x2b')];delete _0x20649a['updatedAt'];var _0x3f21a3=_0x20649a[_0x7f55('0x2c')]!==_0x7f55('0x2d')?[_0x20649a[_0x7f55('0x2c')]]:_0x20649a[_0x7f55('0x8')]?_[_0x7f55('0x9')](_[_0x7f55('0xb')](_0x46de52[_0x7f55('0x5')],{'IntervalId':_0x20649a[_0x7f55('0x8')]}),_0x7f55('0x2c')):[];if(_0x20649a['hasOwnProperty']('tag')){if(_0x20649a[_0x7f55('0x2e')]&&_0x20649a[_0x7f55('0x2e')]!=='--'){_0x5c5309[_0x7f55('0x15')]({'type':_0x20649a[_0x7f55('0x14')],'app':_0x7f55('0x16'),'appdata':_0x7f55('0x2f')+_0x20649a[_0x7f55('0x2e')],'context':_0x20649a['context'],'exten':_0x20649a['exten'],'priority':_0x3f21a3[_0x7f55('0x30')]+_0x46de52['priority']+_0x34c3dc++,'VoiceExtensionId':_0x20649a[_0x7f55('0x13')]});}}if(_0x20649a[_0x7f55('0x14')]===_0x7f55('0x18')&&_0x20649a[_0x7f55('0xf')](_0x7f55('0x31'))){if(_0x20649a['callerID']){_0x5c5309[_0x7f55('0x15')]({'type':_0x20649a[_0x7f55('0x14')],'app':_0x7f55('0x32'),'appdata':_0x7f55('0x33')+_0x20649a[_0x7f55('0x31')]+')','context':_0x20649a['context'],'exten':_0x20649a[_0x7f55('0xa')],'priority':_0x3f21a3['length']+_0x46de52[_0x7f55('0x10')]+_0x34c3dc++,'VoiceExtensionId':_0x20649a[_0x7f55('0x13')]});}else{_0x5c5309[_0x7f55('0x15')]({'type':_0x20649a[_0x7f55('0x14')],'app':_0x7f55('0x32'),'appdata':_0x7f55('0x34'),'context':_0x20649a[_0x7f55('0x1d')],'exten':_0x20649a[_0x7f55('0xa')],'priority':_0x3f21a3['length']+_0x46de52[_0x7f55('0x10')]+_0x34c3dc++,'VoiceExtensionId':_0x20649a[_0x7f55('0x13')]});}}if(_0x20649a[_0x7f55('0xf')](_0x7f55('0x35'))){if(_0x50f5ea[_0x7f55('0x36')](_0x20649a['app'][_0x7f55('0x2a')]())>=0x0&&_0x20649a['appType']!==_0x7f55('0x37')){if(_0x20649a[_0x7f55('0x35')]){_0x5c5309[_0x7f55('0x15')]({'type':_0x20649a['type'],'app':_0x7f55('0x32'),'appdata':_0x7f55('0x38'),'context':_0x20649a['context'],'exten':_0x20649a[_0x7f55('0xa')],'priority':_0x3f21a3[_0x7f55('0x30')]+_0x46de52[_0x7f55('0x10')]+_0x34c3dc++,'VoiceExtensionId':_0x20649a[_0x7f55('0x13')]});_0x5c5309['push']({'type':_0x20649a['type'],'app':'Set','appdata':'XCALLY-MOTION-ANSWER=1','context':_0x20649a['context'],'exten':_0x20649a[_0x7f55('0xa')],'priority':_0x3f21a3[_0x7f55('0x30')]+_0x46de52[_0x7f55('0x10')]+_0x34c3dc++,'VoiceExtensionId':_0x20649a['VoiceExtensionId']});}else{_0x5c5309[_0x7f55('0x15')]({'type':_0x20649a['type'],'app':_0x7f55('0x32'),'appdata':_0x7f55('0x39'),'context':_0x20649a['context'],'exten':_0x20649a[_0x7f55('0xa')],'priority':_0x3f21a3[_0x7f55('0x30')]+_0x46de52[_0x7f55('0x10')]+_0x34c3dc++,'VoiceExtensionId':_0x20649a['VoiceExtensionId']});_0x5c5309['push']({'type':_0x20649a[_0x7f55('0x14')],'app':_0x7f55('0x16'),'appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x20649a[_0x7f55('0x1d')],'exten':_0x20649a[_0x7f55('0xa')],'priority':_0x3f21a3[_0x7f55('0x30')]+_0x46de52[_0x7f55('0x10')]+_0x34c3dc++,'VoiceExtensionId':_0x20649a['VoiceExtensionId']});}}}for(var _0x467012=0x0;_0x467012<_0x3f21a3[_0x7f55('0x30')];_0x467012+=0x1){var _0x59dc7f=_0x46de52[_0x7f55('0x10')]+_0x3f21a3[_0x7f55('0x30')];var _0xb4a2dc=_0x467012===_0x3f21a3[_0x7f55('0x30')]-0x1?_0x46de52[_0x7f55('0x10')]+_0x5c5309[_0x7f55('0x30')]+_0x6d1164['length']+0x2:_0x46de52[_0x7f55('0x10')]+_0x467012+0x1;_0x5c5309['splice'](_0x467012,0x0,{'type':_0x20649a['type'],'app':'GotoIfTime','appdata':_0x3f21a3[_0x467012]+'?'+_0x20649a[_0x7f55('0x1d')]+_0x7f55('0x3a')+_0x59dc7f+':'+_0x20649a[_0x7f55('0x1d')]+_0x7f55('0x3a')+_0xb4a2dc,'exten':_0x20649a['exten'],'context':_0x20649a[_0x7f55('0x1d')],'priority':_0x46de52[_0x7f55('0x10')]+_0x467012,'VoiceExtensionId':_0x6030c4[_0x28f7b9][0x0][_0x7f55('0x13')]});}_0x20649a[_0x7f55('0x10')]=_0x5c5309['length']?_[_0x7f55('0x3b')](_0x5c5309)[_0x7f55('0x10')]+0x1:_0x46de52[_0x7f55('0x10')];_0x46de52[_0x7f55('0x10')]=(_0x6d1164[_0x7f55('0x30')]?_[_0x7f55('0x3b')](_0x6d1164)[_0x7f55('0x10')]:_0x20649a[_0x7f55('0x10')])+0x1;_0x46de52['extensions']=_['concat'](_0x46de52[_0x7f55('0x12')],_0x5c5309,[_0x20649a],_0x6d1164);}_0x46de52[_0x7f55('0x12')]['push']({'type':_0x6030c4[_0x28f7b9][0x0][_0x7f55('0x14')],'app':_0x7f55('0x3c'),'exten':_0x6030c4[_0x28f7b9][0x0][_0x7f55('0xa')],'context':_0x6030c4[_0x28f7b9][0x0]['context'],'priority':_0x46de52[_0x7f55('0x10')],'VoiceExtensionId':_0x6030c4[_0x28f7b9][0x0][_0x7f55('0x13')]});_0x1c0eb0['push'](_0x6030c4[_0x28f7b9][0x0]['VoiceExtensionId']);_0x26f29c=_[_0x7f55('0x3d')](_0x26f29c,_0x46de52[_0x7f55('0x12')]);}}return _0xf3e724[_0x7f55('0x3e')](function(_0x578c74){return _0xf3e724[_0x7f55('0x2')][_0x7f55('0x6')][_0x7f55('0x3f')]({'where':{'VoiceExtensionId':{'$in':_0x1c0eb0}},'transaction':_0x578c74})['then'](function(_0x1756a1){return _0xf3e724[_0x7f55('0x2')]['VoiceExtension'][_0x7f55('0x40')](_[_0x7f55('0x41')](_0x26f29c,'priority'),{'transaction':_0x578c74});});});})[_0x7f55('0x42')](function(_0x46e702){console[_0x7f55('0x43')](_0x46e702);});}exports[_0x7f55('0x44')]=rewrite; \ No newline at end of file +var _0xff1e=['interval','IntervalId','hasOwnProperty','tag','CDR(tag)=','callerID','ExecIf','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','splice',',${EXTEN},','last','concat','Hangup','destroy','bulkCreate','sortBy','error','rewrite','util','models','Interval','findAll','then','intervals','VoiceExtension','uniq','map','filter','groupBy','exten','queue','playback','extensions','extension','find','push','type','Set','CDR(type)=%s','priority','VoiceExtensionId','context','outbound','CDR(destination)=','${EXTEN:','cutdigits','CDR(routeid)=','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','toLowerCase','createdAt','updatedAt'];(function(_0x4c440b,_0x3ea627){var _0x2d48cf=function(_0x56bac7){while(--_0x56bac7){_0x4c440b['push'](_0x4c440b['shift']());}};_0x2d48cf(++_0x3ea627);}(_0xff1e,0xef));var _0xeff1=function(_0x86b219,_0x43038f){_0x86b219=_0x86b219-0x0;var _0x1f320c=_0xff1e[_0x86b219];return _0x1f320c;};'use strict';var _=require('lodash');var util=require(_0xeff1('0x0'));function rewrite(_0xd7f1ae,_0x9889f3){var _0x2a201a=this;return _0xd7f1ae[_0xeff1('0x1')][_0xeff1('0x2')][_0xeff1('0x3')]({'raw':!![]})[_0xeff1('0x4')](function(_0x3b8bc0){_0x2a201a[_0xeff1('0x5')]=_0x3b8bc0;return _0xd7f1ae[_0xeff1('0x1')][_0xeff1('0x6')]['findAll']({'where':{'IntervalId':_0x9889f3['IntervalId']},'raw':!![]});})['then'](function(_0x1bb09d){return _0xd7f1ae[_0xeff1('0x1')][_0xeff1('0x6')][_0xeff1('0x3')]({'where':{'exten':{'$in':_[_0xeff1('0x7')](_[_0xeff1('0x8')](_0x1bb09d,'exten'))}},'order':[{'raw':'CAST(priority\x20AS\x20UNSIGNED)'}],'raw':!![]});})['then'](function(_0x590239){var _0xe4a458=_['filter'](_0x590239,{'priority':'1'});var _0xf7b07e=_[_0xeff1('0x9')](_0x590239,{'isApp':0x1});var _0x2980b4=_[_0xeff1('0xa')](_0xf7b07e,_0xeff1('0xb'));var _0x3a911b=[_0xeff1('0xc'),_0xeff1('0xd')];var _0x3ddfc4=[];var _0x408d93=[];for(var _0xc1162f in _0x2980b4){if(_0x2980b4['hasOwnProperty'](_0xc1162f)){_0x2a201a['priority']=0x2;_0x2a201a[_0xeff1('0xe')]=[];_0x2a201a[_0xeff1('0xf')]=_[_0xeff1('0x10')](_0xe4a458,{'exten':_0x2980b4[_0xc1162f][0x0]['exten']});_0x2a201a[_0xeff1('0xe')][_0xeff1('0x11')]({'type':_0x2980b4[_0xc1162f][0x0][_0xeff1('0x12')],'app':_0xeff1('0x13'),'appdata':util['format'](_0xeff1('0x14'),_0x2980b4[_0xc1162f][0x0]['type']),'context':_0x2980b4[_0xc1162f][0x0]['context'],'exten':_0x2980b4[_0xc1162f][0x0][_0xeff1('0xb')],'priority':_0x2a201a[_0xeff1('0x15')]++,'VoiceExtensionId':_0x2980b4[_0xc1162f][0x0][_0xeff1('0x16')]});if(_0x2980b4[_0xc1162f][0x0][_0xeff1('0x12')]==='inbound'){_0x2a201a[_0xeff1('0xe')][_0xeff1('0x11')]({'type':_0x2980b4[_0xc1162f][0x0][_0xeff1('0x12')],'app':'Set','appdata':'CDR(routeid)='+_0x2980b4[_0xc1162f][0x0][_0xeff1('0x16')],'context':_0x2980b4[_0xc1162f][0x0][_0xeff1('0x17')],'exten':_0x2980b4[_0xc1162f][0x0][_0xeff1('0xb')],'priority':_0x2a201a[_0xeff1('0x15')]++,'VoiceExtensionId':_0x2980b4[_0xc1162f][0x0]['VoiceExtensionId']});}else if(_0x2980b4[_0xc1162f][0x0][_0xeff1('0x12')]===_0xeff1('0x18')){if(_0x2a201a[_0xeff1('0xf')]){_0x2a201a[_0xeff1('0xe')][_0xeff1('0x11')]({'type':_0x2980b4[_0xc1162f][0x0][_0xeff1('0x12')],'app':_0xeff1('0x13'),'appdata':_0xeff1('0x19')+(_0x2a201a[_0xeff1('0xf')]['cutdigits']?_0xeff1('0x1a')+_0x2a201a[_0xeff1('0xf')][_0xeff1('0x1b')]+'}':'${EXTEN}'),'context':_0x2980b4[_0xc1162f][0x0][_0xeff1('0x17')],'exten':_0x2980b4[_0xc1162f][0x0][_0xeff1('0xb')],'priority':_0x2a201a[_0xeff1('0x15')]++,'VoiceExtensionId':_0x2980b4[_0xc1162f][0x0][_0xeff1('0x16')]});}_0x2a201a[_0xeff1('0xe')][_0xeff1('0x11')]({'type':_0x2980b4[_0xc1162f][0x0][_0xeff1('0x12')],'app':_0xeff1('0x13'),'appdata':_0xeff1('0x1c')+_0x2980b4[_0xc1162f][0x0]['VoiceExtensionId'],'context':_0x2980b4[_0xc1162f][0x0]['context'],'exten':_0x2980b4[_0xc1162f][0x0][_0xeff1('0xb')],'priority':_0x2a201a[_0xeff1('0x15')]++,'VoiceExtensionId':_0x2980b4[_0xc1162f][0x0][_0xeff1('0x16')]});var _0x57b6fc=_0x2a201a[_0xeff1('0x15')]++;_0x2a201a[_0xeff1('0xe')][_0xeff1('0x11')]({'type':_0x2980b4[_0xc1162f][0x0][_0xeff1('0x12')],'app':'ExecIf','appdata':_0xeff1('0x1d')+(_0x57b6fc+0x2)+_0xeff1('0x1e')+(_0x57b6fc+0x1)+')','context':_0x2980b4[_0xc1162f][0x0]['context'],'exten':_0x2980b4[_0xc1162f][0x0][_0xeff1('0xb')],'priority':_0x57b6fc,'VoiceExtensionId':_0x2980b4[_0xc1162f][0x0][_0xeff1('0x16')]});if(_0x2a201a['extension']){_0x2a201a[_0xeff1('0xe')][_0xeff1('0x11')]({'type':_0x2980b4[_0xc1162f][0x0][_0xeff1('0x12')],'app':_0xeff1('0x13'),'appdata':_0x2a201a[_0xeff1('0xf')]['cutdigits']?_0xeff1('0x1f')+_0x2a201a[_0xeff1('0xf')][_0xeff1('0x1b')]+'}':'CDR(prefix)=noprefix','context':_0x2980b4[_0xc1162f][0x0]['context'],'exten':_0x2980b4[_0xc1162f][0x0][_0xeff1('0xb')],'priority':_0x2a201a['priority']++,'VoiceExtensionId':_0x2980b4[_0xc1162f][0x0][_0xeff1('0x16')]});}_0x2a201a[_0xeff1('0xe')][_0xeff1('0x11')]({'type':_0x2980b4[_0xc1162f][0x0][_0xeff1('0x12')],'app':_0xeff1('0x13'),'appdata':_0xeff1('0x20')+_0x2980b4[_0xc1162f][0x0][_0xeff1('0x16')],'context':_0x2980b4[_0xc1162f][0x0][_0xeff1('0x17')],'exten':_0x2980b4[_0xc1162f][0x0]['exten'],'priority':_0x2a201a[_0xeff1('0x15')]++,'VoiceExtensionId':_0x2980b4[_0xc1162f][0x0][_0xeff1('0x16')]});if(_0x2a201a[_0xeff1('0xf')]&&_0x2a201a[_0xeff1('0xf')]['hasOwnProperty']('recordingFormat')&&_0x2a201a[_0xeff1('0xf')][_0xeff1('0x21')]!==_0xeff1('0x22')){_0x2a201a['extensions'][_0xeff1('0x11')]({'type':_0x2980b4[_0xc1162f][0x0][_0xeff1('0x12')],'app':_0xeff1('0x13'),'appdata':_0xeff1('0x23'),'context':_0x2980b4[_0xc1162f][0x0][_0xeff1('0x17')],'exten':_0x2980b4[_0xc1162f][0x0]['exten'],'priority':_0x2a201a[_0xeff1('0x15')]++,'VoiceExtensionId':_0x2980b4[_0xc1162f][0x0]['VoiceExtensionId']});_0x2a201a[_0xeff1('0xe')][_0xeff1('0x11')]({'type':_0x2980b4[_0xc1162f][0x0][_0xeff1('0x12')],'app':_0xeff1('0x13'),'appdata':_0xeff1('0x24')+_0x2a201a[_0xeff1('0xf')]['recordingFormat']||_0xeff1('0x25'),'context':_0x2980b4[_0xc1162f][0x0][_0xeff1('0x17')],'exten':_0x2980b4[_0xc1162f][0x0][_0xeff1('0xb')],'priority':_0x2a201a[_0xeff1('0x15')]++,'VoiceExtensionId':_0x2980b4[_0xc1162f][0x0][_0xeff1('0x16')]});}}_0x2a201a['extensions']['push']({'type':_0x2980b4[_0xc1162f][0x0][_0xeff1('0x12')],'app':_0xeff1('0x13'),'appdata':_0xeff1('0x26'),'context':_0x2980b4[_0xc1162f][0x0]['context'],'exten':_0x2980b4[_0xc1162f][0x0][_0xeff1('0xb')],'priority':_0x2a201a[_0xeff1('0x15')]++,'VoiceExtensionId':_0x2980b4[_0xc1162f][0x0][_0xeff1('0x16')]});_0x2a201a[_0xeff1('0xe')][_0xeff1('0x11')]({'type':_0x2980b4[_0xc1162f][0x0]['type'],'app':_0xeff1('0x13'),'appdata':_0xeff1('0x27'),'context':_0x2980b4[_0xc1162f][0x0][_0xeff1('0x17')],'exten':_0x2980b4[_0xc1162f][0x0][_0xeff1('0xb')],'priority':_0x2a201a['priority']++,'VoiceExtensionId':_0x2980b4[_0xc1162f][0x0][_0xeff1('0x16')]});_0x2a201a[_0xeff1('0xe')][_0xeff1('0x11')]({'type':_0x2980b4[_0xc1162f][0x0][_0xeff1('0x12')],'app':_0xeff1('0x13'),'appdata':_0xeff1('0x28'),'context':_0x2980b4[_0xc1162f][0x0]['context'],'exten':_0x2980b4[_0xc1162f][0x0][_0xeff1('0xb')],'priority':_0x2a201a[_0xeff1('0x15')]++,'VoiceExtensionId':_0x2980b4[_0xc1162f][0x0]['VoiceExtensionId']});for(var _0x17288d=0x0,_0x1b6a8a=0x0;_0x17288d<_0x2980b4[_0xc1162f][_0xeff1('0x29')];_0x17288d+=0x1,_0x1b6a8a=0x0){var _0x42e8cc=_0x2980b4[_0xc1162f][_0x17288d];if(_0x42e8cc[_0xeff1('0x12')]){_0x42e8cc[_0xeff1('0x12')]=_0x42e8cc['type'][_0xeff1('0x2a')]();}var _0xa61905=[];var _0x5e6016=[];delete _0x42e8cc['id'];delete _0x42e8cc[_0xeff1('0x2b')];delete _0x42e8cc[_0xeff1('0x2c')];var _0x33b298=_0x42e8cc['interval']!=='*,*,*,*'?[_0x42e8cc[_0xeff1('0x2d')]]:_0x42e8cc[_0xeff1('0x2e')]?_['map'](_[_0xeff1('0x9')](_0x2a201a['intervals'],{'IntervalId':_0x42e8cc[_0xeff1('0x2e')]}),_0xeff1('0x2d')):[];if(_0x42e8cc[_0xeff1('0x2f')]('tag')){if(_0x42e8cc[_0xeff1('0x30')]&&_0x42e8cc[_0xeff1('0x30')]!=='--'){_0xa61905[_0xeff1('0x11')]({'type':_0x42e8cc[_0xeff1('0x12')],'app':_0xeff1('0x13'),'appdata':_0xeff1('0x31')+_0x42e8cc[_0xeff1('0x30')],'context':_0x42e8cc[_0xeff1('0x17')],'exten':_0x42e8cc[_0xeff1('0xb')],'priority':_0x33b298[_0xeff1('0x29')]+_0x2a201a[_0xeff1('0x15')]+_0x1b6a8a++,'VoiceExtensionId':_0x42e8cc[_0xeff1('0x16')]});}}if(_0x42e8cc[_0xeff1('0x12')]===_0xeff1('0x18')&&_0x42e8cc[_0xeff1('0x2f')](_0xeff1('0x32'))){if(_0x42e8cc[_0xeff1('0x32')]){_0xa61905[_0xeff1('0x11')]({'type':_0x42e8cc[_0xeff1('0x12')],'app':_0xeff1('0x33'),'appdata':_0xeff1('0x34')+_0x42e8cc['callerID']+')','context':_0x42e8cc[_0xeff1('0x17')],'exten':_0x42e8cc['exten'],'priority':_0x33b298['length']+_0x2a201a[_0xeff1('0x15')]+_0x1b6a8a++,'VoiceExtensionId':_0x42e8cc[_0xeff1('0x16')]});}else{_0xa61905[_0xeff1('0x11')]({'type':_0x42e8cc['type'],'app':'ExecIf','appdata':_0xeff1('0x35'),'context':_0x42e8cc['context'],'exten':_0x42e8cc[_0xeff1('0xb')],'priority':_0x33b298['length']+_0x2a201a[_0xeff1('0x15')]+_0x1b6a8a++,'VoiceExtensionId':_0x42e8cc[_0xeff1('0x16')]});}}if(_0x42e8cc[_0xeff1('0x2f')](_0xeff1('0x36'))){if(_0x3a911b['indexOf'](_0x42e8cc[_0xeff1('0x37')][_0xeff1('0x2a')]())>=0x0&&_0x42e8cc[_0xeff1('0x38')]!==_0xeff1('0x39')){if(_0x42e8cc[_0xeff1('0x36')]){_0xa61905[_0xeff1('0x11')]({'type':_0x42e8cc[_0xeff1('0x12')],'app':_0xeff1('0x33'),'appdata':_0xeff1('0x3a'),'context':_0x42e8cc[_0xeff1('0x17')],'exten':_0x42e8cc['exten'],'priority':_0x33b298[_0xeff1('0x29')]+_0x2a201a[_0xeff1('0x15')]+_0x1b6a8a++,'VoiceExtensionId':_0x42e8cc[_0xeff1('0x16')]});_0xa61905[_0xeff1('0x11')]({'type':_0x42e8cc[_0xeff1('0x12')],'app':_0xeff1('0x13'),'appdata':_0xeff1('0x3b'),'context':_0x42e8cc[_0xeff1('0x17')],'exten':_0x42e8cc[_0xeff1('0xb')],'priority':_0x33b298['length']+_0x2a201a['priority']+_0x1b6a8a++,'VoiceExtensionId':_0x42e8cc[_0xeff1('0x16')]});}else{_0xa61905[_0xeff1('0x11')]({'type':_0x42e8cc[_0xeff1('0x12')],'app':'ExecIf','appdata':_0xeff1('0x3c'),'context':_0x42e8cc[_0xeff1('0x17')],'exten':_0x42e8cc[_0xeff1('0xb')],'priority':_0x33b298[_0xeff1('0x29')]+_0x2a201a['priority']+_0x1b6a8a++,'VoiceExtensionId':_0x42e8cc[_0xeff1('0x16')]});_0xa61905['push']({'type':_0x42e8cc[_0xeff1('0x12')],'app':_0xeff1('0x13'),'appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x42e8cc[_0xeff1('0x17')],'exten':_0x42e8cc[_0xeff1('0xb')],'priority':_0x33b298['length']+_0x2a201a[_0xeff1('0x15')]+_0x1b6a8a++,'VoiceExtensionId':_0x42e8cc[_0xeff1('0x16')]});}}}for(var _0x2d96b8=0x0;_0x2d96b8<_0x33b298['length'];_0x2d96b8+=0x1){var _0x356ffa=_0x2a201a['priority']+_0x33b298[_0xeff1('0x29')];var _0x23cc53=_0x2d96b8===_0x33b298['length']-0x1?_0x2a201a[_0xeff1('0x15')]+_0xa61905['length']+_0x5e6016[_0xeff1('0x29')]+0x2:_0x2a201a[_0xeff1('0x15')]+_0x2d96b8+0x1;_0xa61905[_0xeff1('0x3d')](_0x2d96b8,0x0,{'type':_0x42e8cc['type'],'app':'GotoIfTime','appdata':_0x33b298[_0x2d96b8]+'?'+_0x42e8cc['context']+',${EXTEN},'+_0x356ffa+':'+_0x42e8cc[_0xeff1('0x17')]+_0xeff1('0x3e')+_0x23cc53,'exten':_0x42e8cc[_0xeff1('0xb')],'context':_0x42e8cc[_0xeff1('0x17')],'priority':_0x2a201a[_0xeff1('0x15')]+_0x2d96b8,'VoiceExtensionId':_0x2980b4[_0xc1162f][0x0][_0xeff1('0x16')]});}_0x42e8cc[_0xeff1('0x15')]=_0xa61905[_0xeff1('0x29')]?_[_0xeff1('0x3f')](_0xa61905)[_0xeff1('0x15')]+0x1:_0x2a201a['priority'];_0x2a201a[_0xeff1('0x15')]=(_0x5e6016[_0xeff1('0x29')]?_[_0xeff1('0x3f')](_0x5e6016)[_0xeff1('0x15')]:_0x42e8cc['priority'])+0x1;_0x2a201a[_0xeff1('0xe')]=_[_0xeff1('0x40')](_0x2a201a[_0xeff1('0xe')],_0xa61905,[_0x42e8cc],_0x5e6016);}_0x2a201a['extensions'][_0xeff1('0x11')]({'type':_0x2980b4[_0xc1162f][0x0][_0xeff1('0x12')],'app':_0xeff1('0x41'),'exten':_0x2980b4[_0xc1162f][0x0][_0xeff1('0xb')],'context':_0x2980b4[_0xc1162f][0x0][_0xeff1('0x17')],'priority':_0x2a201a['priority'],'VoiceExtensionId':_0x2980b4[_0xc1162f][0x0][_0xeff1('0x16')]});_0x3ddfc4['push'](_0x2980b4[_0xc1162f][0x0][_0xeff1('0x16')]);_0x408d93=_['concat'](_0x408d93,_0x2a201a[_0xeff1('0xe')]);}}return _0xd7f1ae['transaction'](function(_0x556500){return _0xd7f1ae['models'][_0xeff1('0x6')][_0xeff1('0x42')]({'where':{'VoiceExtensionId':{'$in':_0x3ddfc4}},'transaction':_0x556500})[_0xeff1('0x4')](function(_0x29d616){return _0xd7f1ae[_0xeff1('0x1')][_0xeff1('0x6')][_0xeff1('0x43')](_[_0xeff1('0x44')](_0x408d93,_0xeff1('0x15')),{'transaction':_0x556500});});});})['catch'](function(_0x384fe6){console[_0xeff1('0x45')](_0x384fe6);});}exports[_0xeff1('0x46')]=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index 4d864e9..6f3256f 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 _0x7ab7=['cm_hopper_black','VoiceQueue','findAll','outbound','Lists','always','sequelize','query','onlyIfOpen','VoiceQueueId','all','CmList','BlackLists','get','Campaign','dialCheckDuplicateType','CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','emit','contact:csv_','exit','SIGINT','info','CSV\x20import\x20process\x20stopped!','resolve','createReadStream','parse','pause','CSV\x20parsed\x20correctly!','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','api','defaults','redis','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20filepath\x20parameter!','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','contact','index','test','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','map','join','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email\x20format\x20is\x20not\x20valid!','ListId','length','find','duplicate','Duplicate\x20Contact','CmContact','create','keys','then','push','pick','catch','message','stringify','cmContact','checkHopper','inspect','insert','scheduledAt','ContactId','updatedAt','select','field','phone','NOW()','toString','createdAt','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','from','cm_hopper','\x20=\x20?','into','fromQuery','id\x20IN\x20?','str','cm_hopper_final','phone\x20NOT\x20IN\x20(?)'];(function(_0x158b1c,_0x39aa8a){var _0x126827=function(_0x4eb84a){while(--_0x4eb84a){_0x158b1c['push'](_0x158b1c['shift']());}};_0x126827(++_0x39aa8a);}(_0x7ab7,0x91));var _0x77ab=function(_0xa434e5,_0x390c6b){_0xa434e5=_0xa434e5-0x0;var _0x21704d=_0x7ab7[_0xa434e5];return _0x21704d;};'use strict';var BPromise=require(_0x77ab('0x0'));var util=require(_0x77ab('0x1'));var _=require('lodash');var fs=require('fs');var squel=require(_0x77ab('0x2'));var Papa=require('papaparse');var Redis=require(_0x77ab('0x3'));var db=require(_0x77ab('0x4'))['db'];var config=require(_0x77ab('0x5'));var logger=require(_0x77ab('0x6'))(_0x77ab('0x7'));config['redis']=_[_0x77ab('0x8')](config[_0x77ab('0x9')],{'host':_0x77ab('0xa'),'port':0x18eb});var socket=require(_0x77ab('0xb'))(new Redis(config[_0x77ab('0x9')]));require(_0x77ab('0xc'))[_0x77ab('0xd')](socket);try{if(!process['argv'][0x2]||process[_0x77ab('0xe')][0x2]===_0x77ab('0xf')||process[_0x77ab('0xe')][0x2]===_0x77ab('0x10')){throw new Error(_0x77ab('0x11'));}var FILEPATH=process[_0x77ab('0xe')][0x2];if(!process['argv'][0x3]||process[_0x77ab('0xe')][0x3]===_0x77ab('0xf')||process[_0x77ab('0xe')][0x3]===_0x77ab('0x10')||!process[_0x77ab('0xe')][0x4]||process[_0x77ab('0xe')][0x4]===_0x77ab('0xf')||process['argv'][0x4]===_0x77ab('0x10')){throw new Error('Missing\x20binding\x20parameters!');}var FIELDS=_[_0x77ab('0x12')](process['argv'][0x3][_0x77ab('0x13')](','),process[_0x77ab('0xe')][0x4][_0x77ab('0x13')](','));if(!process[_0x77ab('0xe')][0x5]||process[_0x77ab('0xe')][0x5]==='undefined'||process[_0x77ab('0xe')][0x5]==='null'){throw new Error(_0x77ab('0x14'));}var LISTID=process[_0x77ab('0xe')][0x5];var COMPANYID=process[_0x77ab('0xe')][0x6]&&process[_0x77ab('0xe')][0x6]!==_0x77ab('0xf')&&process['argv'][0x6]!==_0x77ab('0x10')?process['argv'][0x6]:null;var DUPLICATES=process[_0x77ab('0xe')][0x7]&&process[_0x77ab('0xe')][0x7]!=='undefined'&&process[_0x77ab('0xe')][0x7]!==_0x77ab('0x10')?process[_0x77ab('0xe')][0x7]:null;if(!process[_0x77ab('0xe')][0x8]||process['argv'][0x8]===_0x77ab('0xf')||process[_0x77ab('0xe')][0x8]===_0x77ab('0x10')){throw new Error(_0x77ab('0x15'));}var SOCKET_TIMESTAMP=process['argv'][0x8];}catch(_0x285207){logger[_0x77ab('0x16')](_0x285207);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(_0x583699,_0xe0d0c7,_0x46a180,_0x3ffbd5){var _0x2e157c={'message':_0xe0d0c7};_0x2e157c[_0x583699]=!![];if(_0x46a180){_0x2e157c[_0x77ab('0x17')]=_0x46a180;}if(_0x3ffbd5){_0x2e157c[_0x77ab('0x18')]=_0x3ffbd5;}return _0x2e157c;}function isEmail(_0x217de1){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))*$/[_0x77ab('0x19')](_0x217de1);}function checkRow(_0x1be87a,_0x188c49,_0x46bee8){return new BPromise(function(_0x470da7,_0x3ba594){if(_[_0x77ab('0x1a')](_0x1be87a)){return _0x3ba594(handleCheckRowError(_0x77ab('0x16'),_0x77ab('0x1b'),null,_0x46bee8));}if(_0x1be87a[_0x77ab('0x1c')]&&_0x1be87a[_0x77ab('0x1c')]['length']){var _0x45dfb6=_[_0x77ab('0x1d')](_0x1be87a[_0x77ab('0x1c')],'message')[_0x77ab('0x1e')](';');return _0x3ba594(handleCheckRowError(_0x77ab('0x16'),_0x45dfb6,null,_0x46bee8));}var _0x40554b={};for(var _0x490e14 in FIELDS){if(FIELDS[_0x77ab('0x1f')](_0x490e14)&&FIELDS[_0x490e14]){_0x40554b[_0x490e14]=_0x1be87a[_0x77ab('0x20')][0x0][FIELDS[_0x490e14]]||_0x1be87a[_0x77ab('0x20')][0x0]['\ufeff'+FIELDS[_0x490e14]];}}if(!_0x40554b[_0x77ab('0x21')]){return _0x3ba594(handleCheckRowError(_0x77ab('0x16'),_0x77ab('0x22'),null,_0x46bee8));}if(!_0x40554b['phone']){return _0x3ba594(handleCheckRowError(_0x77ab('0x16'),'phone\x20not\x20specified!',null,_0x46bee8));}if(_0x40554b[_0x77ab('0x23')]){var _0x436999=moment(_0x40554b[_0x77ab('0x23')],_0x77ab('0x24'));if(!_0x436999[_0x77ab('0x25')]()){return _0x3ba594(handleCheckRowError(_0x77ab('0x16'),_0x77ab('0x26'),null,_0x46bee8));}}if(_0x40554b['email']){if(!isEmail(_0x40554b['email'])){return _0x3ba594(handleCheckRowError(_0x77ab('0x16'),_0x77ab('0x27'),null,_0x46bee8));}}_0x40554b[_0x77ab('0x28')]=LISTID;_0x40554b['CompanyId']=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x77ab('0x29')]&&_0x188c49){var _0x7e2995={};for(var _0x268e38=0x0,_0x309c40=DUPLICATES[_0x77ab('0x29')];_0x268e38<_0x309c40;_0x268e38+=0x1){_0x7e2995[DUPLICATES[_0x268e38]]=_0x40554b[DUPLICATES[_0x268e38]];}var _0x139bde=_[_0x77ab('0x2a')](_0x188c49,_0x7e2995);if(_0x139bde){return _0x3ba594(handleCheckRowError(_0x77ab('0x2b'),_0x77ab('0x2c'),_0x139bde,_0x46bee8));}}return db[_0x77ab('0x2d')][_0x77ab('0x2e')](_0x40554b,{'raw':!![],'hooks':![],'fields':_[_0x77ab('0x2f')](_0x40554b)})[_0x77ab('0x30')](function(_0x12c76e){if(DUPLICATES&&DUPLICATES['length']&&_0x188c49){_0x188c49[_0x77ab('0x31')](_[_0x77ab('0x32')](_0x40554b,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x12c76e['id'];return _0x470da7();})[_0x77ab('0x33')](function(_0x18090c){return _0x3ba594(handleCheckRowError(_0x77ab('0x16'),'Error\x20while\x20creating\x20contact:\x20'+(_0x18090c[_0x77ab('0x34')]||JSON[_0x77ab('0x35')](_0x18090c)),null,_0x46bee8));});});}function checkHopper(){function _0x19d0e2(){return function(_0x1049a8){logger['error'](_0x77ab('0x36'),_0x77ab('0x37'),util[_0x77ab('0x38')](_0x1049a8,{'showHidden':![],'depth':null}));};}var _0x19ab94=function(_0x1b59f2,_0x1a1de4){var _0xc16558=squel[_0x77ab('0x39')]()['into']('cm_hopper')['fromQuery'](['phone',_0x77ab('0x3a'),_0x77ab('0x3b'),_0x77ab('0x28'),_0x1a1de4,'createdAt',_0x77ab('0x3c')],squel[_0x77ab('0x3d')]()[_0x77ab('0x3e')](_0x77ab('0x3f'),_0x77ab('0x3f'))[_0x77ab('0x3e')](_0x77ab('0x40'),'scheduledAt')[_0x77ab('0x3e')]('id',_0x77ab('0x3b'))[_0x77ab('0x3e')](LISTID[_0x77ab('0x41')](),_0x77ab('0x28'))[_0x77ab('0x3e')](_0x1b59f2['id'][_0x77ab('0x41')](),_0x1a1de4)['field'](_0x77ab('0x40'),_0x77ab('0x42'))[_0x77ab('0x3e')](_0x77ab('0x40'),_0x77ab('0x3c'))['from'](_0x77ab('0x43'))[_0x77ab('0x44')](_0x77ab('0x45'))[_0x77ab('0x44')](_0x77ab('0x46'),LISTID[_0x77ab('0x41')]())[_0x77ab('0x44')](_0x77ab('0x47'))[_0x77ab('0x44')]('phone\x20NOT\x20IN\x20(?)',squel[_0x77ab('0x3d')]()[_0x77ab('0x3e')](_0x77ab('0x3f'))[_0x77ab('0x48')](_0x77ab('0x49'))[_0x77ab('0x44')](_0x1a1de4+_0x77ab('0x4a'),_0x1b59f2['id'][_0x77ab('0x41')]())))[_0x77ab('0x41')]();return _0xc16558;};var _0x3a67f2=function(_0x3a92d9,_0x461924){var _0x39d9db=squel[_0x77ab('0x39')]()[_0x77ab('0x4b')](_0x77ab('0x49'))[_0x77ab('0x4c')]([_0x77ab('0x3f'),_0x77ab('0x3a'),'ContactId',_0x77ab('0x28'),_0x461924,_0x77ab('0x42'),'updatedAt'],squel[_0x77ab('0x3d')]()[_0x77ab('0x3e')](_0x77ab('0x3f'),_0x77ab('0x3f'))[_0x77ab('0x3e')]('NOW()',_0x77ab('0x3a'))['field']('id',_0x77ab('0x3b'))[_0x77ab('0x3e')](LISTID[_0x77ab('0x41')](),_0x77ab('0x28'))[_0x77ab('0x3e')](_0x3a92d9['id'][_0x77ab('0x41')](),_0x461924)[_0x77ab('0x3e')](_0x77ab('0x40'),_0x77ab('0x42'))['field'](_0x77ab('0x40'),_0x77ab('0x3c'))[_0x77ab('0x48')](_0x77ab('0x43'))[_0x77ab('0x44')](_0x77ab('0x45'))[_0x77ab('0x44')](_0x77ab('0x46'),LISTID[_0x77ab('0x41')]())[_0x77ab('0x44')](_0x77ab('0x4d'),squel[_0x77ab('0x4e')](hopperContacts))[_0x77ab('0x44')]('phone\x20IS\x20NOT\x20NULL')['where']('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x77ab('0x3e')]('calleridnum')[_0x77ab('0x48')](_0x77ab('0x4f'))[_0x77ab('0x44')](_0x461924+_0x77ab('0x4a'),_0x3a92d9['id'][_0x77ab('0x41')]()))['where'](_0x77ab('0x50'),squel[_0x77ab('0x3d')]()[_0x77ab('0x3e')]('phone')[_0x77ab('0x48')](_0x77ab('0x49'))[_0x77ab('0x44')](_0x461924+_0x77ab('0x4a'),_0x3a92d9['id'][_0x77ab('0x41')]())))[_0x77ab('0x41')]();return _0x39d9db;};function _0x4671a2(_0x388ac0,_0x5e068d){var _0x56b3bf=squel['insert']()['into']('cm_hopper')[_0x77ab('0x4c')]([_0x77ab('0x3f'),_0x77ab('0x3a'),_0x77ab('0x3b'),'ListId',_0x5e068d,_0x77ab('0x42'),_0x77ab('0x3c')],squel[_0x77ab('0x3d')]()[_0x77ab('0x3e')](_0x77ab('0x3f'),_0x77ab('0x3f'))[_0x77ab('0x3e')](_0x77ab('0x40'),_0x77ab('0x3a'))[_0x77ab('0x3e')]('id',_0x77ab('0x3b'))[_0x77ab('0x3e')](LISTID['toString'](),_0x77ab('0x28'))[_0x77ab('0x3e')](_0x388ac0['id'][_0x77ab('0x41')](),_0x5e068d)['field'](_0x77ab('0x40'),'createdAt')['field'](_0x77ab('0x40'),'updatedAt')[_0x77ab('0x48')]('cm_contacts')[_0x77ab('0x44')](_0x77ab('0x45'))['where']('ListId\x20=\x20?',LISTID[_0x77ab('0x41')]())[_0x77ab('0x44')](_0x77ab('0x4d'),squel['str'](hopperContacts))['where'](_0x77ab('0x47')))[_0x77ab('0x41')]();return _0x56b3bf;}function _0x1f9625(_0x235c54,_0x49c786){var _0x1f44dd=squel['insert']()[_0x77ab('0x4b')](_0x77ab('0x51'))[_0x77ab('0x4c')]([_0x77ab('0x3f'),_0x77ab('0x3b'),'ListId',_0x49c786,_0x77ab('0x42'),'updatedAt'],squel[_0x77ab('0x3d')]()[_0x77ab('0x3e')]('phone',_0x77ab('0x3f'))['field']('id',_0x77ab('0x3b'))['field'](LISTID[_0x77ab('0x41')](),_0x77ab('0x28'))[_0x77ab('0x3e')](_0x235c54['id'][_0x77ab('0x41')](),_0x49c786)['field'](_0x77ab('0x40'),_0x77ab('0x42'))[_0x77ab('0x3e')](_0x77ab('0x40'),_0x77ab('0x3c'))[_0x77ab('0x48')](_0x77ab('0x43'))[_0x77ab('0x44')](_0x77ab('0x45'))[_0x77ab('0x44')](_0x77ab('0x46'),LISTID[_0x77ab('0x41')]())[_0x77ab('0x44')]('id\x20IN\x20?',squel[_0x77ab('0x4e')](hopperContacts))[_0x77ab('0x44')](_0x77ab('0x47')))['toString']();return _0x1f44dd;}return db[_0x77ab('0x52')][_0x77ab('0x53')]({'where':{'type':_0x77ab('0x54')},'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db['CmList'],'as':_0x77ab('0x55'),'where':{'id':LISTID}}]})['then'](function(_0xc39ca9){var _0x40ecad=[];if(_0xc39ca9){var _0x19d786;for(var _0xb4bff=0x0,_0x4d8cbe;_0xb4bff<_0xc39ca9[_0x77ab('0x29')];_0xb4bff+=0x1){_0x4d8cbe=_0xc39ca9[_0xb4bff]['get']({'plain':!![]});switch(_0x4d8cbe['dialCheckDuplicateType']){case _0x77ab('0x56'):_0x40ecad[_0x77ab('0x31')](db[_0x77ab('0x57')][_0x77ab('0x58')](_0x3a67f2(_0x4d8cbe,'VoiceQueueId'))[_0x77ab('0x30')](function(){})['catch'](_0x19d0e2()));break;case _0x77ab('0x59'):_0x40ecad[_0x77ab('0x31')](db[_0x77ab('0x57')]['query'](_0x19ab94(_0x4d8cbe,_0x77ab('0x5a')))[_0x77ab('0x30')](function(){})[_0x77ab('0x33')](_0x19d0e2()));break;default:_0x40ecad[_0x77ab('0x31')](db[_0x77ab('0x57')][_0x77ab('0x58')](_0x4671a2(_0x4d8cbe,_0x77ab('0x5a')))[_0x77ab('0x30')](function(){})[_0x77ab('0x33')](_0x19d0e2()));}}}return _0x40ecad;})[_0x77ab('0x5b')]()['then'](function(){return db[_0x77ab('0x52')][_0x77ab('0x53')]({'where':{'type':_0x77ab('0x54')},'attributes':['id'],'include':[{'model':db[_0x77ab('0x5c')],'as':_0x77ab('0x5d'),'where':{'id':LISTID}}]})[_0x77ab('0x30')](function(_0x1e8cc8){var _0x259b63=[];if(_0x1e8cc8){var _0xc999a2;for(var _0x34dcbf=0x0,_0x483dc1;_0x34dcbf<_0x1e8cc8['length'];_0x34dcbf+=0x1){_0x483dc1=_0x1e8cc8[_0x34dcbf][_0x77ab('0x5e')]({'plain':!![]});_0x259b63[_0x77ab('0x31')](db[_0x77ab('0x57')]['query'](_0x1f9625(_0x483dc1,_0x77ab('0x5a')))[_0x77ab('0x30')](function(){})['catch'](_0x19d0e2()));}}return _0x259b63;})['all']();})[_0x77ab('0x30')](function(){return db[_0x77ab('0x5f')][_0x77ab('0x53')]({'attributes':['id',_0x77ab('0x60')],'include':[{'model':db['CmList'],'as':_0x77ab('0x55'),'where':{'id':LISTID}}]})[_0x77ab('0x30')](function(_0x5ca92d){var _0xb3ed57=[];if(_0x5ca92d){for(var _0x425f6b=0x0,_0x2e09c4;_0x425f6b<_0x5ca92d['length'];_0x425f6b+=0x1){_0x2e09c4=_0x5ca92d[_0x425f6b][_0x77ab('0x5e')]({'plain':!![]});switch(_0x2e09c4[_0x77ab('0x60')]){case _0x77ab('0x56'):_0xb3ed57['push'](db['sequelize'][_0x77ab('0x58')](_0x3a67f2(_0x2e09c4,_0x77ab('0x61')))[_0x77ab('0x30')](function(){})[_0x77ab('0x33')](_0x19d0e2()));break;case _0x77ab('0x59'):_0xb3ed57[_0x77ab('0x31')](db[_0x77ab('0x57')]['query'](_0x19ab94(_0x2e09c4,_0x77ab('0x61')))[_0x77ab('0x30')](function(){})['catch'](_0x19d0e2()));break;default:_0xb3ed57['push'](db[_0x77ab('0x57')][_0x77ab('0x58')](_0x4671a2(_0x2e09c4,'CampaignId'))['then'](function(){})['catch'](_0x19d0e2()));}}}return _0xb3ed57;})['all']();})[_0x77ab('0x30')](function(){return db[_0x77ab('0x5f')]['findAll']({'attributes':['id'],'include':[{'model':db[_0x77ab('0x5c')],'as':_0x77ab('0x5d'),'where':{'id':LISTID}}]})[_0x77ab('0x30')](function(_0xaed23c){var _0x1ebee8=[];if(_0xaed23c){for(var _0x4fdbb7=0x0,_0x303f01;_0x4fdbb7<_0xaed23c[_0x77ab('0x29')];_0x4fdbb7+=0x1){_0x303f01=_0xaed23c[_0x4fdbb7][_0x77ab('0x5e')]({'plain':!![]});_0x1ebee8[_0x77ab('0x31')](db[_0x77ab('0x57')][_0x77ab('0x58')](_0x1f9625(_0x303f01,'CampaignId'))[_0x77ab('0x30')](function(){})[_0x77ab('0x33')](_0x19d0e2()));}}return _0x1ebee8;})[_0x77ab('0x5b')]();})[_0x77ab('0x33')](function(_0x591073){logger[_0x77ab('0x16')](_0x77ab('0x62'),_0x77ab('0x63'),_0x591073['message']);});}var processPromises=function(_0x965278){return BPromise[_0x77ab('0x5b')](promises)['then'](function(_0x2638a0){})[_0x77ab('0x33')](function(_0x30054b){logger[_0x77ab('0x16')](_0x77ab('0x64'),JSON[_0x77ab('0x35')](_0x30054b));})['finally'](function(){socket[_0x77ab('0x65')]('contact:csv_'+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x965278){return _0x965278['resume']();}});};var endCsv=function(){return BPromise['resolve']()[_0x77ab('0x30')](function(){if(hopperContacts){return checkHopper();}})[_0x77ab('0x30')](function(){socket[_0x77ab('0x65')](_0x77ab('0x66')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs['unlinkSync'](FILEPATH);}catch(_0x2503b9){logger['error']('Unable\x20to\x20delete\x20temp\x20file:',JSON[_0x77ab('0x35')](_0x2503b9));}finally{process[_0x77ab('0x67')](0x0);}});};process['on'](_0x77ab('0x68'),function(){logger[_0x77ab('0x69')](_0x77ab('0x6a'));endCsv();});function main(){return BPromise[_0x77ab('0x6b')]()[_0x77ab('0x30')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x77ab('0x13')](',');return db['CmContact'][_0x77ab('0x53')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x77ab('0x30')](function(_0x56f060){var _0x1d7e11=fs[_0x77ab('0x6c')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x77ab('0x6d')](_0x1d7e11,{'header':!![],'skipEmptyLines':!![],'step':function(_0x2c4305,_0x26891b){total+=0x1;var _0x3aee7b=total;promises[_0x77ab('0x31')](checkRow(_0x2c4305,_0x56f060,_0x3aee7b)[_0x77ab('0x30')](function(){success+=0x1;})[_0x77ab('0x33')](function(_0x15a1a8){if(_0x15a1a8[_0x77ab('0x16')]){errors+=0x1;delete _0x15a1a8[_0x77ab('0x16')];}else if(_0x15a1a8[_0x77ab('0x2b')]){duplicates+=0x1;delete _0x15a1a8[_0x77ab('0x2b')];}rows[_0x77ab('0x31')](_0x15a1a8);}));if(total%0xc8===0x0){_0x26891b[_0x77ab('0x6e')]();return processPromises(_0x26891b);}},'complete':function(){return processPromises()[_0x77ab('0x30')](function(){logger['info'](_0x77ab('0x6f'));endCsv();});},'error':function(_0x926fcf,_0x23b2d5){logger['info']('CSV\x20parse\x20error',JSON[_0x77ab('0x35')](_0x926fcf));endCsv();}});})['catch'](function(_0x764f31){logger[_0x77ab('0x16')](_0x77ab('0x70'),JSON[_0x77ab('0x35')](_0x764f31));});}main(); \ No newline at end of file +var _0x4f93=['lodash','squel','ioredis','../../../config/environment','../../../config/logger','api','defaults','redis','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','argv','Missing\x20filepath\x20parameter!','undefined','null','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','index','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','map','join','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','length','find','duplicate','Duplicate\x20Contact','CmContact','create','keys','then','push','pick','catch','message','stringify','cmContact','checkHopper','inspect','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','createdAt','updatedAt','select','field','toString','NOW()','from','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','\x20=\x20?','id\x20IN\x20?','str','calleridnum','cm_hopper_final','cm_hopper_black','VoiceQueue','findAll','outbound','dialCheckDuplicateType','Lists','always','query','VoiceQueueId','onlyIfOpen','sequelize','CmList','BlackLists','Campaign','get','CampaignId','all','Error\x20processing\x20rows\x20block:','finally','emit','contact:csv_','resume','unlinkSync','exit','SIGINT','info','resolve','parse','pause','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util'];(function(_0x569fef,_0x49c37a){var _0x11f20b=function(_0x3721d8){while(--_0x3721d8){_0x569fef['push'](_0x569fef['shift']());}};_0x11f20b(++_0x49c37a);}(_0x4f93,0x1c2));var _0x34f9=function(_0x3e24f6,_0x375d27){_0x3e24f6=_0x3e24f6-0x0;var _0x46d9f4=_0x4f93[_0x3e24f6];return _0x46d9f4;};'use strict';var BPromise=require(_0x34f9('0x0'));var util=require(_0x34f9('0x1'));var _=require(_0x34f9('0x2'));var fs=require('fs');var squel=require(_0x34f9('0x3'));var Papa=require('papaparse');var Redis=require(_0x34f9('0x4'));var db=require('../../../mysqldb')['db'];var config=require(_0x34f9('0x5'));var logger=require(_0x34f9('0x6'))(_0x34f9('0x7'));config['redis']=_[_0x34f9('0x8')](config[_0x34f9('0x9')],{'host':_0x34f9('0xa'),'port':0x18eb});var socket=require(_0x34f9('0xb'))(new Redis(config[_0x34f9('0x9')]));require(_0x34f9('0xc'))['register'](socket);try{if(!process['argv'][0x2]||process[_0x34f9('0xd')][0x2]==='undefined'||process[_0x34f9('0xd')][0x2]==='null'){throw new Error(_0x34f9('0xe'));}var FILEPATH=process['argv'][0x2];if(!process['argv'][0x3]||process[_0x34f9('0xd')][0x3]===_0x34f9('0xf')||process[_0x34f9('0xd')][0x3]==='null'||!process['argv'][0x4]||process[_0x34f9('0xd')][0x4]===_0x34f9('0xf')||process[_0x34f9('0xd')][0x4]===_0x34f9('0x10')){throw new Error('Missing\x20binding\x20parameters!');}var FIELDS=_[_0x34f9('0x11')](process[_0x34f9('0xd')][0x3][_0x34f9('0x12')](','),process[_0x34f9('0xd')][0x4]['split'](','));if(!process[_0x34f9('0xd')][0x5]||process[_0x34f9('0xd')][0x5]==='undefined'||process[_0x34f9('0xd')][0x5]==='null'){throw new Error(_0x34f9('0x13'));}var LISTID=process[_0x34f9('0xd')][0x5];var COMPANYID=process[_0x34f9('0xd')][0x6]&&process[_0x34f9('0xd')][0x6]!==_0x34f9('0xf')&&process[_0x34f9('0xd')][0x6]!==_0x34f9('0x10')?process[_0x34f9('0xd')][0x6]:null;var DUPLICATES=process['argv'][0x7]&&process['argv'][0x7]!==_0x34f9('0xf')&&process['argv'][0x7]!==_0x34f9('0x10')?process['argv'][0x7]:null;if(!process[_0x34f9('0xd')][0x8]||process[_0x34f9('0xd')][0x8]===_0x34f9('0xf')||process[_0x34f9('0xd')][0x8]==='null'){throw new Error(_0x34f9('0x14'));}var SOCKET_TIMESTAMP=process[_0x34f9('0xd')][0x8];}catch(_0x431dcc){logger[_0x34f9('0x15')](_0x431dcc);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(_0x398b7b,_0x43bd8a,_0x482d19,_0x1c9cef){var _0x4221ec={'message':_0x43bd8a};_0x4221ec[_0x398b7b]=!![];if(_0x482d19){_0x4221ec['contact']=_0x482d19;}if(_0x1c9cef){_0x4221ec[_0x34f9('0x16')]=_0x1c9cef;}return _0x4221ec;}function isEmail(_0xbff014){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'](_0xbff014);}function checkRow(_0x5b82ba,_0x1a6768,_0xaadfb7){return new BPromise(function(_0x35d61a,_0x24bc69){if(_[_0x34f9('0x17')](_0x5b82ba)){return _0x24bc69(handleCheckRowError(_0x34f9('0x15'),_0x34f9('0x18'),null,_0xaadfb7));}if(_0x5b82ba[_0x34f9('0x19')]&&_0x5b82ba[_0x34f9('0x19')]['length']){var _0x4a5c3c=_[_0x34f9('0x1a')](_0x5b82ba[_0x34f9('0x19')],'message')[_0x34f9('0x1b')](';');return _0x24bc69(handleCheckRowError(_0x34f9('0x15'),_0x4a5c3c,null,_0xaadfb7));}var _0x50b79a={};for(var _0x34035d in FIELDS){if(FIELDS[_0x34f9('0x1c')](_0x34035d)&&FIELDS[_0x34035d]){_0x50b79a[_0x34035d]=_0x5b82ba[_0x34f9('0x1d')][0x0][FIELDS[_0x34035d]]||_0x5b82ba[_0x34f9('0x1d')][0x0]['\ufeff'+FIELDS[_0x34035d]];}}if(!_0x50b79a[_0x34f9('0x1e')]){return _0x24bc69(handleCheckRowError(_0x34f9('0x15'),_0x34f9('0x1f'),null,_0xaadfb7));}if(!_0x50b79a[_0x34f9('0x20')]){return _0x24bc69(handleCheckRowError(_0x34f9('0x15'),_0x34f9('0x21'),null,_0xaadfb7));}if(_0x50b79a['birthDate']){var _0x57f84c=moment(_0x50b79a[_0x34f9('0x22')],_0x34f9('0x23'));if(!_0x57f84c[_0x34f9('0x24')]()){return _0x24bc69(handleCheckRowError(_0x34f9('0x15'),'birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!',null,_0xaadfb7));}}if(_0x50b79a[_0x34f9('0x25')]){if(!isEmail(_0x50b79a[_0x34f9('0x25')])){return _0x24bc69(handleCheckRowError(_0x34f9('0x15'),_0x34f9('0x26'),null,_0xaadfb7));}}_0x50b79a[_0x34f9('0x27')]=LISTID;_0x50b79a[_0x34f9('0x28')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x34f9('0x29')]&&_0x1a6768){var _0x32cf3d={};for(var _0x3c64ed=0x0,_0x51b9f0=DUPLICATES['length'];_0x3c64ed<_0x51b9f0;_0x3c64ed+=0x1){_0x32cf3d[DUPLICATES[_0x3c64ed]]=_0x50b79a[DUPLICATES[_0x3c64ed]];}var _0x20b930=_[_0x34f9('0x2a')](_0x1a6768,_0x32cf3d);if(_0x20b930){return _0x24bc69(handleCheckRowError(_0x34f9('0x2b'),_0x34f9('0x2c'),_0x20b930,_0xaadfb7));}}return db[_0x34f9('0x2d')][_0x34f9('0x2e')](_0x50b79a,{'raw':!![],'hooks':![],'fields':_[_0x34f9('0x2f')](_0x50b79a)})[_0x34f9('0x30')](function(_0x18b693){if(DUPLICATES&&DUPLICATES[_0x34f9('0x29')]&&_0x1a6768){_0x1a6768[_0x34f9('0x31')](_[_0x34f9('0x32')](_0x50b79a,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x18b693['id'];return _0x35d61a();})[_0x34f9('0x33')](function(_0x26a0c8){return _0x24bc69(handleCheckRowError(_0x34f9('0x15'),'Error\x20while\x20creating\x20contact:\x20'+(_0x26a0c8[_0x34f9('0x34')]||JSON[_0x34f9('0x35')](_0x26a0c8)),null,_0xaadfb7));});});}function checkHopper(){function _0x2f6d23(){return function(_0x2af7a6){logger[_0x34f9('0x15')](_0x34f9('0x36'),_0x34f9('0x37'),util[_0x34f9('0x38')](_0x2af7a6,{'showHidden':![],'depth':null}));};}var _0xce52da=function(_0x41f5b1,_0x10dbd5){var _0x41e1cb=squel[_0x34f9('0x39')]()[_0x34f9('0x3a')](_0x34f9('0x3b'))[_0x34f9('0x3c')]([_0x34f9('0x20'),_0x34f9('0x3d'),_0x34f9('0x3e'),'ListId',_0x10dbd5,_0x34f9('0x3f'),_0x34f9('0x40')],squel[_0x34f9('0x41')]()[_0x34f9('0x42')](_0x34f9('0x20'),_0x34f9('0x20'))[_0x34f9('0x42')]('NOW()','scheduledAt')[_0x34f9('0x42')]('id',_0x34f9('0x3e'))['field'](LISTID[_0x34f9('0x43')](),'ListId')['field'](_0x41f5b1['id']['toString'](),_0x10dbd5)[_0x34f9('0x42')](_0x34f9('0x44'),_0x34f9('0x3f'))['field'](_0x34f9('0x44'),_0x34f9('0x40'))[_0x34f9('0x45')](_0x34f9('0x46'))[_0x34f9('0x47')](_0x34f9('0x48'))[_0x34f9('0x47')](_0x34f9('0x49'),LISTID[_0x34f9('0x43')]())[_0x34f9('0x47')](_0x34f9('0x4a'))[_0x34f9('0x47')](_0x34f9('0x4b'),squel['select']()[_0x34f9('0x42')]('phone')[_0x34f9('0x45')]('cm_hopper')[_0x34f9('0x47')](_0x10dbd5+_0x34f9('0x4c'),_0x41f5b1['id'][_0x34f9('0x43')]())))[_0x34f9('0x43')]();return _0x41e1cb;};var _0x313071=function(_0x4d161b,_0x3196a1){var _0x4251e8=squel[_0x34f9('0x39')]()['into'](_0x34f9('0x3b'))[_0x34f9('0x3c')]([_0x34f9('0x20'),_0x34f9('0x3d'),_0x34f9('0x3e'),'ListId',_0x3196a1,_0x34f9('0x3f'),_0x34f9('0x40')],squel[_0x34f9('0x41')]()[_0x34f9('0x42')](_0x34f9('0x20'),'phone')[_0x34f9('0x42')]('NOW()','scheduledAt')[_0x34f9('0x42')]('id',_0x34f9('0x3e'))[_0x34f9('0x42')](LISTID[_0x34f9('0x43')](),_0x34f9('0x27'))[_0x34f9('0x42')](_0x4d161b['id'][_0x34f9('0x43')](),_0x3196a1)[_0x34f9('0x42')](_0x34f9('0x44'),_0x34f9('0x3f'))[_0x34f9('0x42')]('NOW()','updatedAt')[_0x34f9('0x45')](_0x34f9('0x46'))['where'](_0x34f9('0x48'))[_0x34f9('0x47')](_0x34f9('0x49'),LISTID['toString']())[_0x34f9('0x47')](_0x34f9('0x4d'),squel[_0x34f9('0x4e')](hopperContacts))['where'](_0x34f9('0x4a'))['where'](_0x34f9('0x4b'),squel[_0x34f9('0x41')]()['field'](_0x34f9('0x4f'))[_0x34f9('0x45')](_0x34f9('0x50'))[_0x34f9('0x47')](_0x3196a1+'\x20=\x20?',_0x4d161b['id'][_0x34f9('0x43')]()))[_0x34f9('0x47')](_0x34f9('0x4b'),squel[_0x34f9('0x41')]()['field']('phone')['from'](_0x34f9('0x3b'))[_0x34f9('0x47')](_0x3196a1+'\x20=\x20?',_0x4d161b['id'][_0x34f9('0x43')]())))[_0x34f9('0x43')]();return _0x4251e8;};function _0x33b5aa(_0xace384,_0x4cad9a){var _0x14f02d=squel[_0x34f9('0x39')]()[_0x34f9('0x3a')](_0x34f9('0x3b'))['fromQuery']([_0x34f9('0x20'),'scheduledAt',_0x34f9('0x3e'),_0x34f9('0x27'),_0x4cad9a,'createdAt',_0x34f9('0x40')],squel[_0x34f9('0x41')]()[_0x34f9('0x42')](_0x34f9('0x20'),_0x34f9('0x20'))[_0x34f9('0x42')](_0x34f9('0x44'),'scheduledAt')[_0x34f9('0x42')]('id','ContactId')[_0x34f9('0x42')](LISTID[_0x34f9('0x43')](),_0x34f9('0x27'))[_0x34f9('0x42')](_0xace384['id'][_0x34f9('0x43')](),_0x4cad9a)[_0x34f9('0x42')](_0x34f9('0x44'),_0x34f9('0x3f'))[_0x34f9('0x42')](_0x34f9('0x44'),'updatedAt')['from'](_0x34f9('0x46'))[_0x34f9('0x47')](_0x34f9('0x48'))['where'](_0x34f9('0x49'),LISTID[_0x34f9('0x43')]())[_0x34f9('0x47')](_0x34f9('0x4d'),squel['str'](hopperContacts))[_0x34f9('0x47')]('phone\x20IS\x20NOT\x20NULL'))[_0x34f9('0x43')]();return _0x14f02d;}function _0x1cfca6(_0x29fe13,_0x5d5a09){var _0x4a3f55=squel['insert']()[_0x34f9('0x3a')](_0x34f9('0x51'))['fromQuery']([_0x34f9('0x20'),_0x34f9('0x3e'),_0x34f9('0x27'),_0x5d5a09,_0x34f9('0x3f'),_0x34f9('0x40')],squel['select']()[_0x34f9('0x42')]('phone',_0x34f9('0x20'))[_0x34f9('0x42')]('id',_0x34f9('0x3e'))[_0x34f9('0x42')](LISTID[_0x34f9('0x43')](),_0x34f9('0x27'))[_0x34f9('0x42')](_0x29fe13['id']['toString'](),_0x5d5a09)['field'](_0x34f9('0x44'),_0x34f9('0x3f'))[_0x34f9('0x42')](_0x34f9('0x44'),_0x34f9('0x40'))[_0x34f9('0x45')](_0x34f9('0x46'))['where']('deletedAt\x20IS\x20NULL')[_0x34f9('0x47')](_0x34f9('0x49'),LISTID[_0x34f9('0x43')]())[_0x34f9('0x47')](_0x34f9('0x4d'),squel[_0x34f9('0x4e')](hopperContacts))[_0x34f9('0x47')](_0x34f9('0x4a')))[_0x34f9('0x43')]();return _0x4a3f55;}return db[_0x34f9('0x52')][_0x34f9('0x53')]({'where':{'type':_0x34f9('0x54')},'attributes':['id',_0x34f9('0x55')],'include':[{'model':db['CmList'],'as':_0x34f9('0x56'),'where':{'id':LISTID}}]})[_0x34f9('0x30')](function(_0x35738b){var _0x31cc1f=[];if(_0x35738b){var _0x2af758;for(var _0x2bcd93=0x0,_0x4a4e96;_0x2bcd93<_0x35738b[_0x34f9('0x29')];_0x2bcd93+=0x1){_0x4a4e96=_0x35738b[_0x2bcd93]['get']({'plain':!![]});switch(_0x4a4e96[_0x34f9('0x55')]){case _0x34f9('0x57'):_0x31cc1f[_0x34f9('0x31')](db['sequelize'][_0x34f9('0x58')](_0x313071(_0x4a4e96,_0x34f9('0x59')))[_0x34f9('0x30')](function(){})[_0x34f9('0x33')](_0x2f6d23()));break;case _0x34f9('0x5a'):_0x31cc1f[_0x34f9('0x31')](db['sequelize'][_0x34f9('0x58')](_0xce52da(_0x4a4e96,'VoiceQueueId'))[_0x34f9('0x30')](function(){})[_0x34f9('0x33')](_0x2f6d23()));break;default:_0x31cc1f['push'](db[_0x34f9('0x5b')][_0x34f9('0x58')](_0x33b5aa(_0x4a4e96,'VoiceQueueId'))[_0x34f9('0x30')](function(){})[_0x34f9('0x33')](_0x2f6d23()));}}}return _0x31cc1f;})['all']()[_0x34f9('0x30')](function(){return db[_0x34f9('0x52')][_0x34f9('0x53')]({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':db[_0x34f9('0x5c')],'as':_0x34f9('0x5d'),'where':{'id':LISTID}}]})[_0x34f9('0x30')](function(_0xd95723){var _0x27c1d9=[];if(_0xd95723){var _0x36bb17;for(var _0x5256ca=0x0,_0x4e8ea6;_0x5256ca<_0xd95723[_0x34f9('0x29')];_0x5256ca+=0x1){_0x4e8ea6=_0xd95723[_0x5256ca]['get']({'plain':!![]});_0x27c1d9[_0x34f9('0x31')](db['sequelize'][_0x34f9('0x58')](_0x1cfca6(_0x4e8ea6,'VoiceQueueId'))[_0x34f9('0x30')](function(){})['catch'](_0x2f6d23()));}}return _0x27c1d9;})['all']();})['then'](function(){return db[_0x34f9('0x5e')][_0x34f9('0x53')]({'attributes':['id',_0x34f9('0x55')],'include':[{'model':db['CmList'],'as':_0x34f9('0x56'),'where':{'id':LISTID}}]})[_0x34f9('0x30')](function(_0x4df51b){var _0x2e96ba=[];if(_0x4df51b){for(var _0x5be178=0x0,_0x33bab7;_0x5be178<_0x4df51b[_0x34f9('0x29')];_0x5be178+=0x1){_0x33bab7=_0x4df51b[_0x5be178][_0x34f9('0x5f')]({'plain':!![]});switch(_0x33bab7[_0x34f9('0x55')]){case _0x34f9('0x57'):_0x2e96ba['push'](db[_0x34f9('0x5b')][_0x34f9('0x58')](_0x313071(_0x33bab7,'CampaignId'))[_0x34f9('0x30')](function(){})[_0x34f9('0x33')](_0x2f6d23()));break;case _0x34f9('0x5a'):_0x2e96ba[_0x34f9('0x31')](db[_0x34f9('0x5b')][_0x34f9('0x58')](_0xce52da(_0x33bab7,_0x34f9('0x60')))['then'](function(){})[_0x34f9('0x33')](_0x2f6d23()));break;default:_0x2e96ba[_0x34f9('0x31')](db[_0x34f9('0x5b')][_0x34f9('0x58')](_0x33b5aa(_0x33bab7,_0x34f9('0x60')))[_0x34f9('0x30')](function(){})['catch'](_0x2f6d23()));}}}return _0x2e96ba;})[_0x34f9('0x61')]();})['then'](function(){return db['Campaign'][_0x34f9('0x53')]({'attributes':['id'],'include':[{'model':db[_0x34f9('0x5c')],'as':_0x34f9('0x5d'),'where':{'id':LISTID}}]})['then'](function(_0x7f6dae){var _0x1695e1=[];if(_0x7f6dae){for(var _0x41ba23=0x0,_0x20bd79;_0x41ba23<_0x7f6dae[_0x34f9('0x29')];_0x41ba23+=0x1){_0x20bd79=_0x7f6dae[_0x41ba23][_0x34f9('0x5f')]({'plain':!![]});_0x1695e1[_0x34f9('0x31')](db[_0x34f9('0x5b')][_0x34f9('0x58')](_0x1cfca6(_0x20bd79,'CampaignId'))[_0x34f9('0x30')](function(){})[_0x34f9('0x33')](_0x2f6d23()));}}return _0x1695e1;})[_0x34f9('0x61')]();})['catch'](function(_0x4312b3){logger[_0x34f9('0x15')]('cmContact,\x20%s,\x20%s','generalCheckHopper',_0x4312b3['message']);});}var processPromises=function(_0x367993){return BPromise[_0x34f9('0x61')](promises)[_0x34f9('0x30')](function(_0x28dd3c){})[_0x34f9('0x33')](function(_0x406cba){logger[_0x34f9('0x15')](_0x34f9('0x62'),JSON[_0x34f9('0x35')](_0x406cba));})[_0x34f9('0x63')](function(){socket[_0x34f9('0x64')](_0x34f9('0x65')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x367993){return _0x367993[_0x34f9('0x66')]();}});};var endCsv=function(){return BPromise['resolve']()[_0x34f9('0x30')](function(){if(hopperContacts){return checkHopper();}})[_0x34f9('0x30')](function(){socket['emit'](_0x34f9('0x65')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x34f9('0x67')](FILEPATH);}catch(_0xcfdb83){logger[_0x34f9('0x15')]('Unable\x20to\x20delete\x20temp\x20file:',JSON[_0x34f9('0x35')](_0xcfdb83));}finally{process[_0x34f9('0x68')](0x0);}});};process['on'](_0x34f9('0x69'),function(){logger[_0x34f9('0x6a')]('CSV\x20import\x20process\x20stopped!');endCsv();});function main(){return BPromise[_0x34f9('0x6b')]()['then'](function(){if(DUPLICATES){DUPLICATES=DUPLICATES['split'](',');return db[_0x34f9('0x2d')][_0x34f9('0x53')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})['then'](function(_0x32796d){var _0x132ec6=fs['createReadStream'](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x34f9('0x6c')](_0x132ec6,{'header':!![],'skipEmptyLines':!![],'step':function(_0x45b5ef,_0x4304e7){total+=0x1;var _0x424ba5=total;promises[_0x34f9('0x31')](checkRow(_0x45b5ef,_0x32796d,_0x424ba5)[_0x34f9('0x30')](function(){success+=0x1;})['catch'](function(_0x2a7389){if(_0x2a7389['error']){errors+=0x1;delete _0x2a7389[_0x34f9('0x15')];}else if(_0x2a7389['duplicate']){duplicates+=0x1;delete _0x2a7389[_0x34f9('0x2b')];}rows[_0x34f9('0x31')](_0x2a7389);}));if(total%0xc8===0x0){_0x4304e7[_0x34f9('0x6d')]();return processPromises(_0x4304e7);}},'complete':function(){return processPromises()[_0x34f9('0x30')](function(){logger[_0x34f9('0x6a')](_0x34f9('0x6e'));endCsv();});},'error':function(_0x1d97da,_0x2b5639){logger[_0x34f9('0x6a')](_0x34f9('0x6f'),JSON['stringify'](_0x1d97da));endCsv();}});})['catch'](function(_0x36188c){logger['error'](_0x34f9('0x70'),JSON[_0x34f9('0x35')](_0x36188c));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index 3f447cf..64ed5f0 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 _0xee4b=['scheduledat','ListId','createdAt','updatedAt','priority','recallme','fields','cm_contacts','cm_contacts.ListId\x20=\x20','where','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','.CmListId\x20=\x20?','field','cm_hopper_black','ListId\x20=\x20?','toString','date_add(cm_contacts.scheduledat,interval\x20','cm_contacts.createdAt','ContactId','.CmListId','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_hopper_additional_phones','CmHopperId','OrderBy','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','concat','keys','CompanyId','scheduledAt',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','group','info','error','message','exit','errors','code','sequelize','query','catch','campaigns.id','campaigns.dialTimezone','campaigns','campaigns_has_cm_lists','spread','voice_queues.id','voice_queues.dialTimezone','voice_queues','voice_queues_has_cm_lists','voice_queues_has_cm_lists.CmListId=','timezones','dialTimezone','utcOffset','set','main','stringify','send','start','binding','clone','socket_timestamp','root','server/files/tmp','.csv','includes','header','ContactItemType','name','_description','createReadStream','data','rows','find','hasOwnProperty','trim','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','isNumber','agent\x20not\x20exists','email\x20wrong\x20format','YYYY-MM-DD','isValid','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','replace','description','SystemRow','emit','contact:import:','Abort\x20parser','abort','SystemError','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','campaigns_','voice_queues_','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','each',',\x20scheduledAt\x20=\x20NOW()','contactTypeId','orderBy','voice_queues_has_cm_blacklists','VoiceQueueId','CampaignId','campaigns_has_cm_blacklists','DROP\x20TABLE\x20','finish','affectedRows','unlink','complete','argv','arguments\x20\x20\x20','existsSync','file\x20doesn\x27t\x20exists','parse','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','UserId','ListId\x20is\x20mandatory','map','SIGINT','path','lodash','papaparse','util','moment','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/environment/shared','../../../config/logger','import','redis','defaults','localhost','socket.io-emitter','YYYY-MM-DD\x20HH:mm:ss','format','select','phone','from','join','.id\x20=\x20','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','CmContact','findAll','AdditionalPhones','then','length','push','all','split','isNil','CmContactHasItem','findOne','update','updated','create','inserted','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.updatedAt','cm_contacts.priority','insert','into','cm_hopper','fromQuery'];(function(_0x4709c0,_0x3396c7){var _0x13348b=function(_0x426235){while(--_0x426235){_0x4709c0['push'](_0x4709c0['shift']());}};_0x13348b(++_0x3396c7);}(_0xee4b,0x86));var _0xbee4=function(_0x21cb7f,_0x48cd16){_0x21cb7f=_0x21cb7f-0x0;var _0x5a079a=_0xee4b[_0x21cb7f];return _0x5a079a;};'use strict';var fs=require('fs');var path=require(_0xbee4('0x0'));var _=require(_0xbee4('0x1'));var Papa=require(_0xbee4('0x2'));var util=require(_0xbee4('0x3'));var BPromise=require('bluebird');var moment=require(_0xbee4('0x4'));var squel=require(_0xbee4('0x5'));var Redis=require(_0xbee4('0x6'));var db=require(_0xbee4('0x7'))['db'];var config=require(_0xbee4('0x8'));var shared=require(_0xbee4('0x9'));var logger=require(_0xbee4('0xa'))(_0xbee4('0xb'));config[_0xbee4('0xc')]=_[_0xbee4('0xd')](config[_0xbee4('0xc')],{'host':_0xbee4('0xe'),'port':0x18eb});var socket=require(_0xbee4('0xf'))(new Redis(config[_0xbee4('0xc')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()['format'](_0xbee4('0x10'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0xbee4('0x11')](_0xbee4('0x10'));function isEmail(_0x34914d){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'](_0x34914d);}function selectNotIn(_0xab4057,_0x3d676c,_0x4b8384,_0x14a194,_0x6cebde){return squel[_0xbee4('0x12')]()['field'](_0xbee4('0x13'))[_0xbee4('0x14')](_0x14a194)[_0xbee4('0x15')](_0x3d676c,null,_0x3d676c+_0xbee4('0x16')+_0x14a194+'.'+_0x4b8384)['where'](_0x14a194+'.'+_0x4b8384+_0xbee4('0x17')+_0xab4057+'.'+_0x4b8384)['where'](_0x3d676c+_0xbee4('0x18')+_0x6cebde[_0xbee4('0x15')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x214d92,_0x168732){promisesAdditionalPhones=[];return db[_0xbee4('0x19')][_0xbee4('0x1a')]({'raw':!![],'attributes':['id',_0xbee4('0x1b')],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})[_0xbee4('0x1c')](function(_0x42e7b7){if(_0x42e7b7!==null){var _0x5c7022=[];for(var _0x179717=0x0;_0x179717<_0x42e7b7[_0xbee4('0x1d')];_0x179717++){var _0x51cd6f=_0x42e7b7[_0x179717];_0x5c7022[_0xbee4('0x1e')](insertAdditionalPhones(_0x51cd6f));}}Promise[_0xbee4('0x1f')](_0x5c7022)[_0xbee4('0x1c')](function(){_0x214d92({'val':0x1});});});});}function insertAdditionalPhones(_0x4eb420){return new Promise(function(_0x5cf8a1,_0x4e1d41){var _0x3ae3c7=_0x4eb420['AdditionalPhones'];var _0xf700b1=_0x3ae3c7[_0xbee4('0x20')](';');var _0x55f333=[];orderBy=0x0;for(var _0x274f3e=0x0;_0x274f3e<_0xf700b1[_0xbee4('0x1d')];_0x274f3e++){_0x55f333[_0xbee4('0x1e')](splitAdditionalPhone(_0x4eb420['id'],_0xf700b1[_0x274f3e]));}Promise[_0xbee4('0x1f')](_0x55f333)[_0xbee4('0x1c')](function(){_0x5cf8a1({'val':_0xf700b1[_0xbee4('0x1d')]});});});}function splitAdditionalPhone(_0x740927,_0x1e51fa){return new Promise(function(_0x58e951,_0x1a5501){var _0x6cc7ef=_0x1e51fa['split'](':');var _0x2242a6=_0x6cc7ef[0x0];var _0x291e6c=_0x6cc7ef[0x1];if(!_[_0xbee4('0x21')](_0x291e6c)){var _0x13256f=_0x291e6c['split']('|');var _0x37c197=[];for(var _0x3c8ade=0x0;_0x3c8ade<_0x13256f[_0xbee4('0x1d')];_0x3c8ade++){if(_0x13256f[_0x3c8ade]!==''){var _0xfebee=_['filter'](promisesAdditionalPhones,{'contactId':_0x740927,'phone':_0x13256f[_0x3c8ade]});if(_0xfebee[_0xbee4('0x1d')]==0x0){orderBy++;promisesAdditionalPhones[_0xbee4('0x1e')]({'contactId':_0x740927,'contactTypeId':_0x2242a6,'phone':_0x13256f[_0x3c8ade],'orderBy':orderBy});}}}_0x58e951({'ok':0x1});}else _0x58e951({'res':0x0});});}function createAdditionalPhone(_0x3b0aef,_0x1ac521,_0x1fd87e,_0x49fba7){var _0x453ecf='';var _0x2433b1='';var _0x56bd55=_0x1fd87e[_0xbee4('0x20')]('§');_0x453ecf=_0x56bd55[0x0];if(_0x56bd55[_0xbee4('0x1d')]==0x2)_0x2433b1=_0x56bd55[0x1];return new Promise(function(_0x345348,_0x101ed3){return db[_0xbee4('0x22')][_0xbee4('0x23')]({'where':{'CmContactId':_0x3b0aef,'item':_0x453ecf}})[_0xbee4('0x1c')](function(_0x53e57f){if(_0x53e57f){return db[_0xbee4('0x22')][_0xbee4('0x24')]({'ItemTypeId':_0x1ac521,'description':_0x2433b1,'OrderBy':_0x49fba7},{'where':{'CmContactId':_0x3b0aef,'item':_0x453ecf}})['then'](function(_0x564dbf){_0x345348({'res':_0xbee4('0x25')});});}else{return db[_0xbee4('0x22')][_0xbee4('0x26')]({'CmContactId':_0x3b0aef,'item':_0x453ecf,'description':_0x2433b1,'ItemTypeId':_0x1ac521,'OrderBy':_0x49fba7,'ItemClass':'PHONE'})[_0xbee4('0x1c')](function(_0x355a19){_0x345348({'res':_0xbee4('0x27')});});}});});}function insertCmHopper(_0x3f572a,_0x527ead,_0x5d966d,_0x22951e,_0x223265){var _0x5d2b3b=[_0xbee4('0x28'),_0xbee4('0x29'),_0xbee4('0x2a'),_0xbee4('0x2b'),_0x527ead+'.'+_0x22951e,'cm_contacts.createdAt',_0xbee4('0x2c'),_0xbee4('0x2d'),'cm_contacts.UserId','\x22'+_0x223265+'\x22'];return squel[_0xbee4('0x2e')]()[_0xbee4('0x2f')](_0xbee4('0x30'))[_0xbee4('0x31')](['phone',_0xbee4('0x32'),'ContactId',_0xbee4('0x33'),_0x22951e,_0xbee4('0x34'),_0xbee4('0x35'),_0xbee4('0x36'),'UserId',_0xbee4('0x37')],squel['select']()[_0xbee4('0x38')](_0x5d2b3b)[_0xbee4('0x14')](_0x527ead)[_0xbee4('0x15')](_0xbee4('0x39'),null,_0xbee4('0x3a')+_0x527ead+'.CmListId')[_0xbee4('0x15')](_0x5d966d,null,_0x5d966d+'.id\x20=\x20'+_0x527ead+'.'+_0x22951e)[_0xbee4('0x3b')](_0x527ead+'.CmListId\x20=\x20?',_0x3f572a)['where'](_0xbee4('0x3c'),NOW)[_0xbee4('0x3b')](_0xbee4('0x3d'),selectNotIn(_0x527ead,_0x5d966d,_0x22951e,_0xbee4('0x30'),[_0xbee4('0x3e'),_0xbee4('0x3f')]))[_0xbee4('0x3b')](_0xbee4('0x3d'),selectNotIn(_0x527ead,_0x5d966d,_0x22951e,_0xbee4('0x30'),[_0xbee4('0x3e')])))['toString']();}function insertCmHopperBlack(_0x161b58,_0x1e43ef,_0x33858d,_0x3c39c4){var _0x4cd2a3=[_0xbee4('0x28'),'cm_contacts.id',_0xbee4('0x2b'),_0x1e43ef+'.'+_0x3c39c4,'cm_contacts.createdAt',_0xbee4('0x2c')];return squel[_0xbee4('0x2e')]()[_0xbee4('0x2f')]('cm_hopper_black')[_0xbee4('0x31')](['phone','ContactId',_0xbee4('0x33'),_0x3c39c4,_0xbee4('0x34'),_0xbee4('0x35')],squel['select']()['fields'](_0x4cd2a3)[_0xbee4('0x14')](_0x1e43ef)[_0xbee4('0x15')](_0xbee4('0x39'),null,_0xbee4('0x3a')+_0x1e43ef+'.CmListId')[_0xbee4('0x15')](_0x33858d,null,_0x33858d+_0xbee4('0x16')+_0x1e43ef+'.'+_0x3c39c4)['where'](_0x1e43ef+_0xbee4('0x40'),_0x161b58)[_0xbee4('0x3b')](_0xbee4('0x3c'),NOW)['where'](_0xbee4('0x3d'),squel[_0xbee4('0x12')]()[_0xbee4('0x41')](_0xbee4('0x13'))[_0xbee4('0x14')](_0xbee4('0x42'))[_0xbee4('0x3b')](_0xbee4('0x43'),_0x161b58)[_0xbee4('0x3b')](_0x3c39c4+_0xbee4('0x17')+_0x1e43ef+'.'+_0x3c39c4)))[_0xbee4('0x44')]();}function insertTzCmHopper(_0x2ada17,_0x208ef2,_0x8abfd7,_0x1b5b23,_0x14beaa,_0x10dcd9){var _0xcd0a3a=[_0xbee4('0x28'),_0xbee4('0x45')+_0x10dcd9+'.offset-cm_contacts.utcOffset\x20minute)',_0xbee4('0x2a'),'cm_contacts.ListId',_0x208ef2+'.'+_0x1b5b23,_0xbee4('0x46'),_0xbee4('0x2c'),'cm_contacts.priority','cm_contacts.UserId','\x22'+_0x14beaa+'\x22'];var _0x4b9ace=squel['insert']()[_0xbee4('0x2f')](_0xbee4('0x30'))['fromQuery']([_0xbee4('0x13'),_0xbee4('0x32'),_0xbee4('0x47'),_0xbee4('0x33'),_0x1b5b23,_0xbee4('0x34'),_0xbee4('0x35'),_0xbee4('0x36'),'UserId',_0xbee4('0x37')],squel[_0xbee4('0x12')]()['fields'](_0xcd0a3a)['from'](_0x208ef2)[_0xbee4('0x15')](_0xbee4('0x39'),null,_0xbee4('0x3a')+_0x208ef2+_0xbee4('0x48'))[_0xbee4('0x15')](_0x8abfd7,null,_0x8abfd7+_0xbee4('0x16')+_0x208ef2+'.'+_0x1b5b23)[_0xbee4('0x15')](_0x10dcd9,null,_0x10dcd9+_0xbee4('0x16')+_0x208ef2+'.'+_0x1b5b23)['where'](_0x208ef2+_0xbee4('0x40'),_0x2ada17)[_0xbee4('0x3b')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0xbee4('0x3b')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x208ef2,_0x8abfd7,_0x1b5b23,_0xbee4('0x30'),[_0xbee4('0x3e'),_0xbee4('0x3f')]))[_0xbee4('0x3b')](_0xbee4('0x3d'),selectNotIn(_0x208ef2,_0x8abfd7,_0x1b5b23,_0xbee4('0x30'),[_0xbee4('0x3e')])))[_0xbee4('0x44')]();return _0x4b9ace;}function insertTzCmHopperBlack(_0x582f0a,_0x2d0001,_0x2db95a,_0x4e19ae){var _0x49a158=[_0xbee4('0x28'),_0xbee4('0x2a'),_0xbee4('0x2b'),_0x2d0001+'.'+_0x4e19ae,_0xbee4('0x46'),_0xbee4('0x2c')];return squel[_0xbee4('0x2e')]()[_0xbee4('0x2f')](_0xbee4('0x42'))[_0xbee4('0x31')]([_0xbee4('0x13'),'ContactId',_0xbee4('0x33'),_0x4e19ae,'createdAt',_0xbee4('0x35')],squel[_0xbee4('0x12')]()[_0xbee4('0x38')](_0x49a158)[_0xbee4('0x14')](_0x2d0001)['join'](_0xbee4('0x39'),null,'cm_contacts.ListId\x20=\x20'+_0x2d0001+_0xbee4('0x48'))['join'](_0x2db95a,null,_0x2db95a+'.id\x20=\x20'+_0x2d0001+'.'+_0x4e19ae)[_0xbee4('0x3b')](_0x2d0001+_0xbee4('0x40'),_0x582f0a)[_0xbee4('0x3b')]('cm_contacts.createdAt\x20=\x20?',NOW)['where']('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0xbee4('0x12')]()[_0xbee4('0x41')](_0xbee4('0x13'))[_0xbee4('0x14')](_0xbee4('0x42'))['where'](_0xbee4('0x43'),_0x582f0a)[_0xbee4('0x3b')](_0x4e19ae+_0xbee4('0x17')+_0x2d0001+'.'+_0x4e19ae)))['toString']();}function insertCmHopperAdditionalPhones(_0x4b288b){var _0xe59e50=[_0xbee4('0x49'),_0xbee4('0x4a'),_0xbee4('0x4b'),'cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt'];return squel[_0xbee4('0x2e')]()[_0xbee4('0x2f')](_0xbee4('0x4c'))[_0xbee4('0x31')]([_0xbee4('0x4d'),_0xbee4('0x13'),_0xbee4('0x4e'),_0xbee4('0x34'),'updatedAt'],squel[_0xbee4('0x12')]()['fields'](_0xe59e50)[_0xbee4('0x14')](_0xbee4('0x30'))[_0xbee4('0x15')]('cm_contacts',null,_0xbee4('0x4f'))[_0xbee4('0x15')]('cm_contact_has_items',null,_0xbee4('0x50'))[_0xbee4('0x3b')]('cm_hopper.ListId\x20=\x20?',_0x4b288b)[_0xbee4('0x3b')](_0xbee4('0x3c'),NOW))[_0xbee4('0x44')]();}function insertCmContact(_0x28836d,_0x59ce82,_0xfd23f4,_0x272d98){var _0x19df8c=_[_0xbee4('0x51')](_[_0xbee4('0x52')](_0x272d98),['ListId',_0xbee4('0x53'),_0xbee4('0x34'),_0xbee4('0x35'),_0xbee4('0x54')]);return squel['insert']()[_0xbee4('0x2f')](_0xbee4('0x39'))['fromQuery'](_0x19df8c,squel[_0xbee4('0x12')]()[_0xbee4('0x38')](_0x19df8c)['from'](_0x59ce82)[_0xbee4('0x3b')]('('+_0xfd23f4[_0xbee4('0x15')](',')+_0xbee4('0x55'),squel[_0xbee4('0x12')]()[_0xbee4('0x38')](_0xfd23f4)[_0xbee4('0x14')](_0xbee4('0x39'))['where'](_0xbee4('0x43'),_0x28836d)[_0xbee4('0x3b')](_0xbee4('0x56')))['where'](_0xbee4('0x57'),squel[_0xbee4('0x12')]()[_0xbee4('0x41')]('MIN(id)','min_id')['from'](_0x59ce82)[_0xbee4('0x58')](_0xfd23f4['join'](','))))[_0xbee4('0x44')]();}function handleStop(){logger[_0xbee4('0x59')]('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x4cdd4b){logger[_0xbee4('0x5a')](_0x4cdd4b[_0xbee4('0x5b')]);process[_0xbee4('0x5c')](0x1);}function handleError(_0x2e6ca5,_0x30e2ed){stats[_0xbee4('0x5d')][_0xbee4('0x1e')]({'name':_0x30e2ed[_0xbee4('0x5e')],'message':_0x30e2ed[_0xbee4('0x5b')],'row':_0x2e6ca5});}function handleQuery(_0x5beed1){logger[_0xbee4('0x59')](_0x5beed1);return db[_0xbee4('0x5f')][_0xbee4('0x60')](_0x5beed1)['spread'](function(_0x1568ce){results[_0xbee4('0x1e')](_0x1568ce);})[_0xbee4('0x61')](function(_0x4672c2){logger[_0xbee4('0x5a')](_0x4672c2[_0xbee4('0x5b')]);});}function updateTzCampaigns(_0x261c9a){return new Promise(function(_0x1106ca,_0x1c8b96){var _0x31b51c=squel['select']()['fields']([_0xbee4('0x62'),_0xbee4('0x63')])[_0xbee4('0x14')](_0xbee4('0x64'))[_0xbee4('0x15')](_0xbee4('0x65'),null,'campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId')['where']('campaigns_has_cm_lists.CmListId='+_0x261c9a);db[_0xbee4('0x5f')][_0xbee4('0x60')](_0x31b51c[_0xbee4('0x44')]())[_0xbee4('0x66')](function(_0x363057){var _0x2f14fa=[];for(var _0x41e535=0x0;_0x41e535<_0x363057[_0xbee4('0x1d')];_0x41e535++){_0x2f14fa[_0xbee4('0x1e')](getTimezoneData(_0x363057[_0x41e535],tmp_campaigns));}BPromise[_0xbee4('0x1f')](_0x2f14fa)[_0xbee4('0x1c')](function(){_0x1106ca({'val':0x1});});})[_0xbee4('0x61')](function(_0x55e980){logger[_0xbee4('0x5a')](_0x55e980[_0xbee4('0x5b')]);_0x1106ca({'val':0x0});});});}function updateTzVoiceQueues(_0x26bd43){return new Promise(function(_0x165d40,_0x4d950f){var _0x2843c4=squel[_0xbee4('0x12')]()['fields']([_0xbee4('0x67'),_0xbee4('0x68')])[_0xbee4('0x14')](_0xbee4('0x69'))[_0xbee4('0x15')](_0xbee4('0x6a'),null,'voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId')['where'](_0xbee4('0x6b')+_0x26bd43);db[_0xbee4('0x5f')][_0xbee4('0x60')](_0x2843c4['toString']())[_0xbee4('0x66')](function(_0x4b1e81){var _0xfbd0bd=[];for(var _0xfae00d=0x0;_0xfae00d<_0x4b1e81['length'];_0xfae00d++){_0xfbd0bd[_0xbee4('0x1e')](getTimezoneData(_0x4b1e81[_0xfae00d],tmp_voice_queues));}BPromise[_0xbee4('0x1f')](_0xfbd0bd)[_0xbee4('0x1c')](function(){_0x165d40({'val':0x1});});})[_0xbee4('0x61')](function(_0x59ec1e){logger['error'](_0x59ec1e['message']);_0x165d40({'val':0x0});});});}function getTimezoneData(_0x3adcf1,_0x2cf227){return new Promise(function(_0x3226c1,_0x1ef264){var _0x4993f7=shared[_0xbee4('0x6c')];var _0x3d4c36=_0x4993f7[_0x3adcf1[_0xbee4('0x6d')]];if(_[_0xbee4('0x21')](_0x3d4c36)){_0x3226c1({'ret':0x1});}else{var _0x5cda9b=_0x3d4c36[_0xbee4('0x6e')];var _0x62f172=squel[_0xbee4('0x2e')]()[_0xbee4('0x2f')](_0x2cf227)[_0xbee4('0x6f')]('id',_0x3adcf1['id'])[_0xbee4('0x6f')]('offset',_0x5cda9b)[_0xbee4('0x6f')](_0xbee4('0x6d'),_0x3adcf1[_0xbee4('0x6d')])[_0xbee4('0x44')]();return db['sequelize'][_0xbee4('0x60')](_0x62f172)['spread'](function(_0x3272f8){_0x3226c1({'ret':0x1});})[_0xbee4('0x61')](function(_0xeca46b){logger[_0xbee4('0x5a')](_0xeca46b[_0xbee4('0x5b')]);_0x1ef264({'ret':0x1});});}});}function handleTZQuery(_0x577309){logger[_0xbee4('0x59')](_0x577309);return db[_0xbee4('0x5f')][_0xbee4('0x60')](_0x577309)[_0xbee4('0x66')](function(_0x5f2c27){})[_0xbee4('0x61')](function(_0x556d13){logger[_0xbee4('0x5a')](_0x556d13['message']);});}function main(_0x5aeef2,_0x1c4cd1,_0x14a339,_0x593892){logger[_0xbee4('0x59')](_0xbee4('0x70'),_0x5aeef2,JSON[_0xbee4('0x71')](_0x1c4cd1));process[_0xbee4('0x72')](_0xbee4('0x73'));var _0x134b23=_0x1c4cd1[_0xbee4('0x74')];var _0x54a428=_[_0xbee4('0x75')](_0x134b23);var _0x5d33cd=_0x1c4cd1[_0xbee4('0x76')];var _0x5187bd=path[_0xbee4('0x15')](config[_0xbee4('0x77')],_0xbee4('0x78'),_0x5d33cd+_0xbee4('0x79'));hasTZ=_['keys'](_0x134b23)[_0xbee4('0x7a')](_0xbee4('0x6d'));var _0x3db9c5=_['keys'](_0x134b23)[_0xbee4('0x15')]();logger[_0xbee4('0x59')](_0xbee4('0x7b'),_0x3db9c5);db[_0xbee4('0x7c')][_0xbee4('0x1a')]({'raw':!![],'attributes':['id',_0xbee4('0x7d')]})[_0xbee4('0x1c')](function(_0x5f4ec5){for(var _0x54a24e=0x0;_0x54a24e<_0x5f4ec5[_0xbee4('0x1d')];_0x54a24e++){if(_0x5f4ec5[_0x54a24e][_0xbee4('0x7d')]in _0x134b23){contactItemTypes[_0xbee4('0x1e')](_0x5f4ec5[_0x54a24e]);delete _0x54a428[_0x5f4ec5[_0x54a24e][_0xbee4('0x7d')]];hasAdditionalPhones=!![];}for(var _0x263292 in _0x134b23){if(_0x5f4ec5[_0x54a24e]['name']+_0xbee4('0x7e')===_0x263292){phoneDescriptions[_0xbee4('0x1e')]({'itemTypeId':_0x5f4ec5[_0x54a24e]['id'],'description':_0x263292});delete _0x54a428[_0x263292];}}}if(hasAdditionalPhones)_0x54a428[_0xbee4('0x1b')]='';var _0x4eb9f=_[_0xbee4('0x52')](_0x54a428)['join']();logger[_0xbee4('0x59')](_0xbee4('0x7b'),_0x4eb9f);fs['writeFileSync'](_0x5187bd,_0x4eb9f+'\x0a');Papa['parse'](fs[_0xbee4('0x7f')](_0x5aeef2),{'header':!![],'skipEmptyLines':!![],'step':function(_0x3d87c6,_0x1ac72e){try{for(var _0x36acc7=0x0,_0x56ad70=[];_0x36acc7<_0x3d87c6[_0xbee4('0x80')]['length'];_0x36acc7++){stats[_0xbee4('0x81')]+=0x1;if(_0x3d87c6['errors'][_0x36acc7]){handleError(_0x3d87c6[_0xbee4('0x80')][_0x36acc7],_0x3d87c6[_0xbee4('0x5d')][_0x36acc7]);}else{var _0x2b14f9=[];var _0xf0cafa=[];var _0x59f2a6={};for(var _0x2a91fa in _0x134b23){let _0x38a274=contactItemTypes['find'](_0x76de96=>_0x76de96[_0xbee4('0x7d')]===_0x2a91fa);let _0x435f8b=contactItemTypes[_0xbee4('0x82')](_0x3d1d1b=>_0x3d1d1b['name']+'_description'===_0x2a91fa);if(_['isNil'](_0x38a274)&&_[_0xbee4('0x21')](_0x435f8b)){if(_0x134b23[_0xbee4('0x83')](_0x2a91fa)){if(_0x3d87c6[_0xbee4('0x80')][_0x36acc7][_0x134b23[_0x2a91fa]]){var _0x1b52fd=_[_0xbee4('0x84')](_0x3d87c6[_0xbee4('0x80')][_0x36acc7][_0x134b23[_0x2a91fa]]['replace'](/"/g,'\x27'));switch(_0x2a91fa){case _0xbee4('0x32'):var _0xb1f80a=moment(_0x1b52fd,_0xbee4('0x10'),!![]);if(_0xb1f80a['isValid']()){_0x56ad70['push']('\x22'+_0x1b52fd+'\x22');}else{_0x2b14f9[_0xbee4('0x1e')](_0xbee4('0x85'));}break;case _0xbee4('0x36'):var _0x22843e=parseInt(_0x1b52fd);_0x1b52fd=_[_0xbee4('0x86')](_0x22843e)||_0x22843e<0x0||_0x22843e>0x4?_0x593892?0x3:0x2:_0x22843e;_0x56ad70[_0xbee4('0x1e')]('\x22'+_0x1b52fd+'\x22');break;case'UserId':var _0x2bbd72=parseInt(_0x1b52fd);if(_[_0xbee4('0x87')](_0x2bbd72)&&_[_0xbee4('0x7a')](_0x14a339,_0x2bbd72)){_0x56ad70[_0xbee4('0x1e')]('\x22'+_0x2bbd72+'\x22');}else{_0x2b14f9[_0xbee4('0x1e')](_0xbee4('0x88'));}break;case'email':if(isEmail(_0x1b52fd)){_0x56ad70[_0xbee4('0x1e')]('\x22'+_0x1b52fd+'\x22');}else{_0x2b14f9[_0xbee4('0x1e')](_0xbee4('0x89'));}break;case'dateOfBirth':var _0x5cd204=moment(_0x1b52fd,_0xbee4('0x8a'),!![]);if(_0x5cd204[_0xbee4('0x8b')]()){_0x56ad70['push']('\x22'+_0x1b52fd+'\x22');}else{_0x2b14f9[_0xbee4('0x1e')](_0xbee4('0x8c'));}break;case _0xbee4('0x6d'):var _0x1e12c2=shared[_0xbee4('0x6c')];var _0x1d9113=_0x1e12c2[_0x1b52fd];if(!_[_0xbee4('0x21')](_0x1d9113)){var _0x3bcfb9=_0x1d9113[_0xbee4('0x6e')];_0x56ad70[_0xbee4('0x1e')]('\x22'+_0x1b52fd+'\x22');_0x56ad70['push']('\x22'+_0x3bcfb9+'\x22');}break;default:_0x56ad70[_0xbee4('0x1e')]('\x22'+_0x1b52fd+'\x22');}}else{switch(_0x2a91fa){case _0xbee4('0x8d'):case'phone':_0x2b14f9[_0xbee4('0x1e')](_0x2a91fa+_0xbee4('0x8e'));break;default:_0x56ad70['push']('\x22\x22');}}}}else{var _0x4a3c4b='';if(!_[_0xbee4('0x21')](_0x38a274)){if(!_0x59f2a6[_0xbee4('0x83')](_0x38a274['id'])){if(!_[_0xbee4('0x21')](_0x3d87c6['data'][_0x36acc7][_0x134b23[_0x2a91fa]])){var _0x1b52fd=_[_0xbee4('0x84')](_0x3d87c6[_0xbee4('0x80')][_0x36acc7][_0x134b23[_0x2a91fa]][_0xbee4('0x8f')](/"/g,'\x27'));var _0x35fc6e=phoneDescriptions[_0xbee4('0x82')](_0x8b0777=>_0x8b0777['itemTypeId']===_0x38a274['id']);if(!_[_0xbee4('0x21')](_0x35fc6e)){var _0x2deefd=_['trim'](_0x3d87c6[_0xbee4('0x80')][_0x36acc7][_0x134b23[_0x35fc6e[_0xbee4('0x90')]]][_0xbee4('0x8f')](/"/g,'\x27'));if(!_['isNil'](_0x2deefd))_0x1b52fd=_0x1b52fd+'§'+_0x2deefd;}if(_0x4a3c4b=='')_0x4a3c4b=_0x1b52fd;else _0x4a3c4b+='|'+_0x1b52fd;}_0xf0cafa[_0xbee4('0x1e')](_0x38a274['id']+':'+_0x4a3c4b);_0x59f2a6[_0x38a274['id']]=0x1;}}}}if(hasAdditionalPhones){_0x56ad70[_0xbee4('0x1e')]('\x22'+_0xf0cafa['join'](';')+'\x22');}if(_0x2b14f9['length']){handleError(_0x3d87c6['data'][_0x36acc7],{'code':_0xbee4('0x91'),'message':_0x2b14f9[_0xbee4('0x15')]()});}else{fs['appendFileSync'](_0x5187bd,_0x56ad70[_0xbee4('0x15')]()+'\x0a');}_0x56ad70=[];}if(!(stats[_0xbee4('0x81')]%0xc8)){socket[_0xbee4('0x92')](_0xbee4('0x93')+_0x5d33cd,stats);stats[_0xbee4('0x5d')]=[];}}if(stopped){logger[_0xbee4('0x59')](_0xbee4('0x94'));_0x1ac72e[_0xbee4('0x95')]();}}catch(_0x3e35b7){handleError(_0x3d87c6[_0xbee4('0x80')][_0x36acc7],{'code':_0xbee4('0x96'),'message':_0x3e35b7[_0xbee4('0x5b')]});logger[_0xbee4('0x5a')](_0xbee4('0x97'),_0x3e35b7[_0xbee4('0x5b')]);}},'complete':function(){try{var _0x22bd49=[];var _0x40f121=[];var _0x32b162='cm_contacts';if(_0x1c4cd1[_0xbee4('0x98')]&&_0x1c4cd1['duplicates'][_0xbee4('0x1d')]){_0x32b162=_0xbee4('0x99')+_0x5d33cd;_0x22bd49[_0xbee4('0x1e')](_0xbee4('0x9a')+_0x32b162+_0xbee4('0x9b'));}tmp_campaigns=_0xbee4('0x9c')+_0x5d33cd;tmp_voice_queues=_0xbee4('0x9d')+_0x5d33cd;_0x40f121['push'](_0xbee4('0x9a')+tmp_campaigns+_0xbee4('0x9e'));_0x40f121[_0xbee4('0x1e')](_0xbee4('0x9a')+tmp_voice_queues+_0xbee4('0x9e'));BPromise[_0xbee4('0x9f')](_0x40f121,handleTZQuery)[_0xbee4('0x1c')](function(_0x5a88f0){updateTzCampaigns(_0x1c4cd1['ListId'])['then'](function(_0x3a79be){updateTzVoiceQueues(_0x1c4cd1['ListId'])[_0xbee4('0x1c')](function(_0x480e3c){if(hasTZ)_0x4eb9f=_0x4eb9f[_0xbee4('0x8f')](_0xbee4('0x6d'),'dialTimezone,utcOffset');var _0x1cedb2=util[_0xbee4('0x11')]('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',_0x5187bd,_0x32b162,_0x4eb9f,_0x1c4cd1[_0xbee4('0x33')],_0x1c4cd1[_0xbee4('0x53')]||null,NOW,NOW);if(_['isNil'](_0x134b23[_0xbee4('0x32')])){_0x1cedb2+=_0xbee4('0xa0');}_0x22bd49[_0xbee4('0x1e')](_0x1cedb2);if(_0x1c4cd1[_0xbee4('0x98')]&&_0x1c4cd1[_0xbee4('0x98')][_0xbee4('0x1d')]){_0x22bd49['push'](insertCmContact(_0x1c4cd1['ListId'],_0x32b162,_0x1c4cd1['duplicates'],_0x134b23));_0x22bd49['push']('DROP\x20TABLE\x20'+_0x32b162+';');}BPromise[_0xbee4('0x9f')](_0x22bd49,handleQuery)['then'](function(_0x2fce15){BPromise['all']([handleAdditionalPhones()])[_0xbee4('0x1c')](function(){_0x22bd49=[];for(var _0x50abef=0x0;_0x50abef\x20\x20','root','existsSync','file\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','map','No\x20agent\x20available','SIGINT','lodash','util','bluebird','moment','squel','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','phone','from','join','.id\x20=\x20','\x20=\x20','where','.dialCheckDuplicateType\x20IN\x20(','findAll','AdditionalPhones','then','length','all','split','push','isNil','CmContactHasItem','findOne','update','updated','inserted','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.priority','cm_contacts.UserId','insert','into','scheduledat','ContactId','ListId','createdAt','updatedAt','priority','UserId','recallme','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','toString','cm_contacts.createdAt','cm_contacts.updatedAt','cm_hopper_black','fields','ListId\x20=\x20?','date_add(cm_contacts.scheduledat,interval\x20','.offset-cm_contacts.utcOffset\x20minute)','fromQuery','cm_hopper.id','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','cm_hopper_additional_phones','CmHopperId','OrderBy','cm_contacts.id\x20=\x20cm_hopper.ContactId','concat','keys','scheduledAt','min_id','Received\x20SIGINT','error','message','errors','code','info','sequelize','query','spread','catch'];(function(_0x84aa0d,_0x1dea7c){var _0x172f95=function(_0x60930f){while(--_0x60930f){_0x84aa0d['push'](_0x84aa0d['shift']());}};_0x172f95(++_0x1dea7c);}(_0x97ed,0x1a3));var _0xd97e=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x97ed[_0x46698a];return _0x356db0;};'use strict';var fs=require('fs');var path=require('path');var _=require(_0xd97e('0x0'));var Papa=require('papaparse');var util=require(_0xd97e('0x1'));var BPromise=require(_0xd97e('0x2'));var moment=require(_0xd97e('0x3'));var squel=require(_0xd97e('0x4'));var Redis=require(_0xd97e('0x5'));var db=require('../../../mysqldb')['db'];var config=require(_0xd97e('0x6'));var shared=require(_0xd97e('0x7'));var logger=require(_0xd97e('0x8'))(_0xd97e('0x9'));config[_0xd97e('0xa')]=_[_0xd97e('0xb')](config[_0xd97e('0xa')],{'host':_0xd97e('0xc'),'port':0x18eb});var socket=require(_0xd97e('0xd'))(new Redis(config[_0xd97e('0xa')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0xd97e('0xe')](_0xd97e('0xf'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0xd97e('0xe')](_0xd97e('0xf'));function isEmail(_0x42eee6){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))*$/[_0xd97e('0x10')](_0x42eee6);}function selectNotIn(_0x5e0ee5,_0x3f1298,_0x2399c7,_0x48ae83,_0x53b425){return squel[_0xd97e('0x11')]()[_0xd97e('0x12')](_0xd97e('0x13'))[_0xd97e('0x14')](_0x48ae83)[_0xd97e('0x15')](_0x3f1298,null,_0x3f1298+_0xd97e('0x16')+_0x48ae83+'.'+_0x2399c7)['where'](_0x48ae83+'.'+_0x2399c7+_0xd97e('0x17')+_0x5e0ee5+'.'+_0x2399c7)[_0xd97e('0x18')](_0x3f1298+_0xd97e('0x19')+_0x53b425[_0xd97e('0x15')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x183495,_0x20d8e2){promisesAdditionalPhones=[];return db['CmContact'][_0xd97e('0x1a')]({'raw':!![],'attributes':['id',_0xd97e('0x1b')],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})[_0xd97e('0x1c')](function(_0x59a536){if(_0x59a536!==null){var _0xa98268=[];for(var _0x236e6b=0x0;_0x236e6b<_0x59a536[_0xd97e('0x1d')];_0x236e6b++){var _0x27b7db=_0x59a536[_0x236e6b];_0xa98268['push'](insertAdditionalPhones(_0x27b7db));}}Promise[_0xd97e('0x1e')](_0xa98268)[_0xd97e('0x1c')](function(){_0x183495({'val':0x1});});});});}function insertAdditionalPhones(_0x3591da){return new Promise(function(_0x8bf06d,_0x176432){var _0x385b99=_0x3591da[_0xd97e('0x1b')];var _0x3939c7=_0x385b99[_0xd97e('0x1f')](';');var _0x4c3423=[];orderBy=0x0;for(var _0x4baa25=0x0;_0x4baa25<_0x3939c7[_0xd97e('0x1d')];_0x4baa25++){_0x4c3423[_0xd97e('0x20')](splitAdditionalPhone(_0x3591da['id'],_0x3939c7[_0x4baa25]));}Promise[_0xd97e('0x1e')](_0x4c3423)['then'](function(){_0x8bf06d({'val':_0x3939c7[_0xd97e('0x1d')]});});});}function splitAdditionalPhone(_0xed2ea,_0x4ac7c0){return new Promise(function(_0x2ecec1,_0xbf8e08){var _0x1d6f0d=_0x4ac7c0['split'](':');var _0x34471b=_0x1d6f0d[0x0];var _0x497dbb=_0x1d6f0d[0x1];if(!_[_0xd97e('0x21')](_0x497dbb)){var _0x3b9e69=_0x497dbb[_0xd97e('0x1f')]('|');var _0x3cd7f2=[];for(var _0xa6366b=0x0;_0xa6366b<_0x3b9e69[_0xd97e('0x1d')];_0xa6366b++){if(_0x3b9e69[_0xa6366b]!==''){var _0x28a2ed=_['filter'](promisesAdditionalPhones,{'contactId':_0xed2ea,'phone':_0x3b9e69[_0xa6366b]});if(_0x28a2ed['length']==0x0){orderBy++;promisesAdditionalPhones[_0xd97e('0x20')]({'contactId':_0xed2ea,'contactTypeId':_0x34471b,'phone':_0x3b9e69[_0xa6366b],'orderBy':orderBy});}}}_0x2ecec1({'ok':0x1});}else _0x2ecec1({'res':0x0});});}function createAdditionalPhone(_0x33b4b8,_0x3e52d2,_0x1690f5,_0x1ccddb){var _0x3d25b7='';var _0x52d52d='';var _0x3f3db5=_0x1690f5[_0xd97e('0x1f')]('§');_0x3d25b7=_0x3f3db5[0x0];if(_0x3f3db5[_0xd97e('0x1d')]==0x2)_0x52d52d=_0x3f3db5[0x1];return new Promise(function(_0x301a1c,_0x21a6e1){return db[_0xd97e('0x22')][_0xd97e('0x23')]({'where':{'CmContactId':_0x33b4b8,'item':_0x3d25b7}})[_0xd97e('0x1c')](function(_0x8a3063){if(_0x8a3063){return db[_0xd97e('0x22')][_0xd97e('0x24')]({'ItemTypeId':_0x3e52d2,'description':_0x52d52d,'OrderBy':_0x1ccddb},{'where':{'CmContactId':_0x33b4b8,'item':_0x3d25b7}})['then'](function(_0x3a94ab){_0x301a1c({'res':_0xd97e('0x25')});});}else{return db[_0xd97e('0x22')]['create']({'CmContactId':_0x33b4b8,'item':_0x3d25b7,'description':_0x52d52d,'ItemTypeId':_0x3e52d2,'OrderBy':_0x1ccddb,'ItemClass':'PHONE'})['then'](function(_0xe4ca22){_0x301a1c({'res':_0xd97e('0x26')});});}});});}function insertCmHopper(_0x2900e9,_0x57f598,_0x15c002,_0x1f1030,_0x57da48){var _0x143e96=[_0xd97e('0x27'),_0xd97e('0x28'),_0xd97e('0x29'),_0xd97e('0x2a'),_0x57f598+'.'+_0x1f1030,'cm_contacts.createdAt','cm_contacts.updatedAt',_0xd97e('0x2b'),_0xd97e('0x2c'),'\x22'+_0x57da48+'\x22'];return squel[_0xd97e('0x2d')]()[_0xd97e('0x2e')]('cm_hopper')['fromQuery'](['phone',_0xd97e('0x2f'),_0xd97e('0x30'),_0xd97e('0x31'),_0x1f1030,_0xd97e('0x32'),_0xd97e('0x33'),_0xd97e('0x34'),_0xd97e('0x35'),_0xd97e('0x36')],squel[_0xd97e('0x11')]()['fields'](_0x143e96)['from'](_0x57f598)['join'](_0xd97e('0x37'),null,_0xd97e('0x38')+_0x57f598+_0xd97e('0x39'))[_0xd97e('0x15')](_0x15c002,null,_0x15c002+_0xd97e('0x16')+_0x57f598+'.'+_0x1f1030)['where'](_0x57f598+_0xd97e('0x3a'),_0x2900e9)['where'](_0xd97e('0x3b'),NOW)[_0xd97e('0x18')](_0xd97e('0x3c'),selectNotIn(_0x57f598,_0x15c002,_0x1f1030,_0xd97e('0x3d'),[_0xd97e('0x3e'),_0xd97e('0x3f')]))[_0xd97e('0x18')](_0xd97e('0x3c'),selectNotIn(_0x57f598,_0x15c002,_0x1f1030,_0xd97e('0x3d'),['\x22always\x22'])))[_0xd97e('0x40')]();}function insertCmHopperBlack(_0x2a4e62,_0x18ce53,_0x419e22,_0x40a227){var _0x10873d=['cm_contacts.phone',_0xd97e('0x29'),_0xd97e('0x2a'),_0x18ce53+'.'+_0x40a227,_0xd97e('0x41'),_0xd97e('0x42')];return squel['insert']()[_0xd97e('0x2e')](_0xd97e('0x43'))['fromQuery']([_0xd97e('0x13'),_0xd97e('0x30'),_0xd97e('0x31'),_0x40a227,_0xd97e('0x32'),_0xd97e('0x33')],squel[_0xd97e('0x11')]()[_0xd97e('0x44')](_0x10873d)['from'](_0x18ce53)['join'](_0xd97e('0x37'),null,_0xd97e('0x38')+_0x18ce53+_0xd97e('0x39'))[_0xd97e('0x15')](_0x419e22,null,_0x419e22+_0xd97e('0x16')+_0x18ce53+'.'+_0x40a227)[_0xd97e('0x18')](_0x18ce53+_0xd97e('0x3a'),_0x2a4e62)['where'](_0xd97e('0x3b'),NOW)[_0xd97e('0x18')](_0xd97e('0x3c'),squel[_0xd97e('0x11')]()[_0xd97e('0x12')](_0xd97e('0x13'))[_0xd97e('0x14')]('cm_hopper_black')[_0xd97e('0x18')](_0xd97e('0x45'),_0x2a4e62)[_0xd97e('0x18')](_0x40a227+_0xd97e('0x17')+_0x18ce53+'.'+_0x40a227)))['toString']();}function insertTzCmHopper(_0x39a5ee,_0x3f80ad,_0x4a9eb1,_0x3991bf,_0x57b44c,_0x2414e5){var _0x32d07c=[_0xd97e('0x27'),_0xd97e('0x46')+_0x2414e5+_0xd97e('0x47'),'cm_contacts.id','cm_contacts.ListId',_0x3f80ad+'.'+_0x3991bf,_0xd97e('0x41'),'cm_contacts.updatedAt',_0xd97e('0x2b'),_0xd97e('0x2c'),'\x22'+_0x57b44c+'\x22'];var _0xd75821=squel[_0xd97e('0x2d')]()[_0xd97e('0x2e')](_0xd97e('0x3d'))[_0xd97e('0x48')](['phone',_0xd97e('0x2f'),_0xd97e('0x30'),_0xd97e('0x31'),_0x3991bf,_0xd97e('0x32'),_0xd97e('0x33'),_0xd97e('0x34'),_0xd97e('0x35'),'recallme'],squel['select']()[_0xd97e('0x44')](_0x32d07c)[_0xd97e('0x14')](_0x3f80ad)[_0xd97e('0x15')](_0xd97e('0x37'),null,_0xd97e('0x38')+_0x3f80ad+'.CmListId')[_0xd97e('0x15')](_0x4a9eb1,null,_0x4a9eb1+'.id\x20=\x20'+_0x3f80ad+'.'+_0x3991bf)['join'](_0x2414e5,null,_0x2414e5+_0xd97e('0x16')+_0x3f80ad+'.'+_0x3991bf)[_0xd97e('0x18')](_0x3f80ad+_0xd97e('0x3a'),_0x39a5ee)['where'](_0xd97e('0x3b'),NOW)[_0xd97e('0x18')](_0xd97e('0x3c'),selectNotIn(_0x3f80ad,_0x4a9eb1,_0x3991bf,_0xd97e('0x3d'),[_0xd97e('0x3e'),_0xd97e('0x3f')]))['where'](_0xd97e('0x3c'),selectNotIn(_0x3f80ad,_0x4a9eb1,_0x3991bf,'cm_hopper',[_0xd97e('0x3e')])))[_0xd97e('0x40')]();return _0xd75821;}function insertTzCmHopperBlack(_0x210e3b,_0xf79e60,_0x4e69b5,_0x52b6a4){var _0x4d72c7=['cm_contacts.phone',_0xd97e('0x29'),_0xd97e('0x2a'),_0xf79e60+'.'+_0x52b6a4,'cm_contacts.createdAt',_0xd97e('0x42')];return squel[_0xd97e('0x2d')]()[_0xd97e('0x2e')](_0xd97e('0x43'))['fromQuery'](['phone','ContactId',_0xd97e('0x31'),_0x52b6a4,_0xd97e('0x32'),'updatedAt'],squel[_0xd97e('0x11')]()['fields'](_0x4d72c7)[_0xd97e('0x14')](_0xf79e60)[_0xd97e('0x15')](_0xd97e('0x37'),null,_0xd97e('0x38')+_0xf79e60+'.CmListId')[_0xd97e('0x15')](_0x4e69b5,null,_0x4e69b5+_0xd97e('0x16')+_0xf79e60+'.'+_0x52b6a4)[_0xd97e('0x18')](_0xf79e60+'.CmListId\x20=\x20?',_0x210e3b)[_0xd97e('0x18')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0xd97e('0x18')](_0xd97e('0x3c'),squel['select']()[_0xd97e('0x12')]('phone')[_0xd97e('0x14')]('cm_hopper_black')[_0xd97e('0x18')](_0xd97e('0x45'),_0x210e3b)['where'](_0x52b6a4+_0xd97e('0x17')+_0xf79e60+'.'+_0x52b6a4)))[_0xd97e('0x40')]();}function insertCmHopperAdditionalPhones(_0x630b3){var _0x5d4caf=[_0xd97e('0x49'),'cm_contact_has_items.item',_0xd97e('0x4a'),_0xd97e('0x4b'),'cm_contact_has_items.updatedAt'];return squel[_0xd97e('0x2d')]()[_0xd97e('0x2e')](_0xd97e('0x4c'))['fromQuery']([_0xd97e('0x4d'),_0xd97e('0x13'),_0xd97e('0x4e'),_0xd97e('0x32'),_0xd97e('0x33')],squel['select']()['fields'](_0x5d4caf)['from'](_0xd97e('0x3d'))[_0xd97e('0x15')](_0xd97e('0x37'),null,_0xd97e('0x4f'))['join']('cm_contact_has_items',null,'cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId')[_0xd97e('0x18')]('cm_hopper.ListId\x20=\x20?',_0x630b3)['where'](_0xd97e('0x3b'),NOW))[_0xd97e('0x40')]();}function insertCmContact(_0x3c98c9,_0x4acd93,_0x157b71,_0x493b4e){var _0x3604be=_[_0xd97e('0x50')](_[_0xd97e('0x51')](_0x493b4e),[_0xd97e('0x31'),'CompanyId',_0xd97e('0x32'),'updatedAt',_0xd97e('0x52')]);return squel[_0xd97e('0x2d')]()[_0xd97e('0x2e')](_0xd97e('0x37'))[_0xd97e('0x48')](_0x3604be,squel['select']()[_0xd97e('0x44')](_0x3604be)[_0xd97e('0x14')](_0x4acd93)['where']('('+_0x157b71[_0xd97e('0x15')](',')+')\x20NOT\x20IN\x20?',squel[_0xd97e('0x11')]()[_0xd97e('0x44')](_0x157b71)[_0xd97e('0x14')]('cm_contacts')['where'](_0xd97e('0x45'),_0x3c98c9)[_0xd97e('0x18')]('deletedAt\x20IS\x20NULL'))['where']('id\x20IN\x20?',squel[_0xd97e('0x11')]()['field']('MIN(id)',_0xd97e('0x53'))[_0xd97e('0x14')](_0x4acd93)['group'](_0x157b71[_0xd97e('0x15')](','))))['toString']();}function handleStop(){logger['info'](_0xd97e('0x54'));stopped=!![];}function handleUncaughtException(_0x587de1){logger[_0xd97e('0x55')](_0x587de1[_0xd97e('0x56')]);process['exit'](0x1);}function handleError(_0x34ca70,_0x392923){stats[_0xd97e('0x57')][_0xd97e('0x20')]({'name':_0x392923[_0xd97e('0x58')],'message':_0x392923[_0xd97e('0x56')],'row':_0x34ca70});}function handleQuery(_0x33f404){logger[_0xd97e('0x59')](_0x33f404);return db[_0xd97e('0x5a')][_0xd97e('0x5b')](_0x33f404)[_0xd97e('0x5c')](function(_0x382656){results[_0xd97e('0x20')](_0x382656);})[_0xd97e('0x5d')](function(_0x22ee35){logger['error'](_0x22ee35[_0xd97e('0x56')]);});}function updateTzCampaigns(_0x1e3ca2){return new Promise(function(_0xc035e2,_0x109c50){var _0x57d0e4=squel[_0xd97e('0x11')]()[_0xd97e('0x44')]([_0xd97e('0x5e'),'campaigns.dialTimezone'])[_0xd97e('0x14')](_0xd97e('0x5f'))[_0xd97e('0x15')](_0xd97e('0x60'),null,_0xd97e('0x61'))[_0xd97e('0x18')]('campaigns_has_cm_lists.CmListId='+_0x1e3ca2);db[_0xd97e('0x5a')][_0xd97e('0x5b')](_0x57d0e4[_0xd97e('0x40')]())[_0xd97e('0x5c')](function(_0x5c696c){var _0x4d00e7=[];for(var _0x3ebef7=0x0;_0x3ebef7<_0x5c696c[_0xd97e('0x1d')];_0x3ebef7++){_0x4d00e7[_0xd97e('0x20')](getTimezoneData(_0x5c696c[_0x3ebef7],tmp_campaigns));}BPromise[_0xd97e('0x1e')](_0x4d00e7)[_0xd97e('0x1c')](function(){_0xc035e2({'val':0x1});});})[_0xd97e('0x5d')](function(_0x426b75){logger[_0xd97e('0x55')](_0x426b75[_0xd97e('0x56')]);_0xc035e2({'val':0x0});});});}function updateTzVoiceQueues(_0x218c73){return new Promise(function(_0x219254,_0x2da917){var _0x243f85=squel['select']()['fields'](['voice_queues.id',_0xd97e('0x62')])[_0xd97e('0x14')]('voice_queues')[_0xd97e('0x15')](_0xd97e('0x63'),null,'voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId')['where'](_0xd97e('0x64')+_0x218c73);db['sequelize'][_0xd97e('0x5b')](_0x243f85['toString']())[_0xd97e('0x5c')](function(_0x960b8){var _0x265651=[];for(var _0x38e8e5=0x0;_0x38e8e5<_0x960b8[_0xd97e('0x1d')];_0x38e8e5++){_0x265651[_0xd97e('0x20')](getTimezoneData(_0x960b8[_0x38e8e5],tmp_voice_queues));}BPromise['all'](_0x265651)['then'](function(){_0x219254({'val':0x1});});})[_0xd97e('0x5d')](function(_0x5c5b9c){logger['error'](_0x5c5b9c[_0xd97e('0x56')]);_0x219254({'val':0x0});});});}function getTimezoneData(_0x268d26,_0x45c605){return new Promise(function(_0x42d9fa,_0x2027e7){var _0x3e8a75=shared[_0xd97e('0x65')];var _0x40a697=_0x3e8a75[_0x268d26['dialTimezone']];if(_[_0xd97e('0x21')](_0x40a697)){_0x42d9fa({'ret':0x1});}else{var _0x37e524=_0x40a697[_0xd97e('0x66')];var _0x4c1af9=squel[_0xd97e('0x2d')]()[_0xd97e('0x2e')](_0x45c605)['set']('id',_0x268d26['id'])[_0xd97e('0x67')](_0xd97e('0x68'),_0x37e524)[_0xd97e('0x67')](_0xd97e('0x69'),_0x268d26[_0xd97e('0x69')])[_0xd97e('0x40')]();return db[_0xd97e('0x5a')][_0xd97e('0x5b')](_0x4c1af9)[_0xd97e('0x5c')](function(_0x466a34){_0x42d9fa({'ret':0x1});})[_0xd97e('0x5d')](function(_0x2f749c){logger[_0xd97e('0x55')](_0x2f749c['message']);_0x2027e7({'ret':0x1});});}});}function handleTZQuery(_0x35d96f){logger[_0xd97e('0x59')](_0x35d96f);return db[_0xd97e('0x5a')][_0xd97e('0x5b')](_0x35d96f)[_0xd97e('0x5c')](function(_0x2d0dfa){})[_0xd97e('0x5d')](function(_0x66ecc6){logger[_0xd97e('0x55')](_0x66ecc6['message']);});}function main(_0x1d1cbe,_0x4fdf5d,_0x3ef248,_0x4e9755){logger[_0xd97e('0x59')]('main',_0x1d1cbe,JSON['stringify'](_0x4fdf5d));process[_0xd97e('0x6a')](_0xd97e('0x6b'));var _0x2e851c=_0x4fdf5d[_0xd97e('0x6c')];var _0x19276a=_['clone'](_0x2e851c);var _0x7551e8=_0x4fdf5d[_0xd97e('0x6d')];var _0x31df44=path[_0xd97e('0x15')](config['root'],_0xd97e('0x6e'),_0x7551e8+_0xd97e('0x6f'));hasTZ=_['keys'](_0x2e851c)[_0xd97e('0x70')](_0xd97e('0x69'));var _0x20ec87=_['keys'](_0x2e851c)[_0xd97e('0x15')]();logger[_0xd97e('0x59')](_0xd97e('0x71'),_0x20ec87);db[_0xd97e('0x72')][_0xd97e('0x1a')]({'raw':!![],'attributes':['id','name']})[_0xd97e('0x1c')](function(_0x24d09f){for(var _0x19b942=0x0;_0x19b942<_0x24d09f[_0xd97e('0x1d')];_0x19b942++){if(_0x24d09f[_0x19b942][_0xd97e('0x73')]in _0x2e851c){contactItemTypes[_0xd97e('0x20')](_0x24d09f[_0x19b942]);delete _0x19276a[_0x24d09f[_0x19b942][_0xd97e('0x73')]];hasAdditionalPhones=!![];}for(var _0xf7e930 in _0x2e851c){if(_0x24d09f[_0x19b942][_0xd97e('0x73')]+_0xd97e('0x74')===_0xf7e930){phoneDescriptions[_0xd97e('0x20')]({'itemTypeId':_0x24d09f[_0x19b942]['id'],'description':_0xf7e930});delete _0x19276a[_0xf7e930];}}}if(hasAdditionalPhones)_0x19276a[_0xd97e('0x1b')]='';var _0x868caa=_[_0xd97e('0x51')](_0x19276a)['join']();logger['info'](_0xd97e('0x71'),_0x868caa);fs['writeFileSync'](_0x31df44,_0x868caa+'\x0a');Papa[_0xd97e('0x75')](fs[_0xd97e('0x76')](_0x1d1cbe),{'header':!![],'skipEmptyLines':!![],'step':function(_0xea5439,_0x421491){try{for(var _0x89ace7=0x0,_0xc4dc21=[];_0x89ace7<_0xea5439[_0xd97e('0x77')]['length'];_0x89ace7++){stats['rows']+=0x1;if(_0xea5439[_0xd97e('0x57')][_0x89ace7]){handleError(_0xea5439[_0xd97e('0x77')][_0x89ace7],_0xea5439[_0xd97e('0x57')][_0x89ace7]);}else{var _0x51b5d5=[];var _0x1ecb3d=[];var _0x19fb53={};for(var _0x1d341c in _0x2e851c){let _0x238337=contactItemTypes['find'](_0x36a24b=>_0x36a24b[_0xd97e('0x73')]===_0x1d341c);let _0x3ecc9a=contactItemTypes[_0xd97e('0x78')](_0x241dd7=>_0x241dd7[_0xd97e('0x73')]+_0xd97e('0x74')===_0x1d341c);if(_['isNil'](_0x238337)&&_[_0xd97e('0x21')](_0x3ecc9a)){if(_0x2e851c[_0xd97e('0x79')](_0x1d341c)){if(_0xea5439['data'][_0x89ace7][_0x2e851c[_0x1d341c]]){var _0x20bb80=_[_0xd97e('0x7a')](_0xea5439['data'][_0x89ace7][_0x2e851c[_0x1d341c]][_0xd97e('0x7b')](/"/g,'\x27'));switch(_0x1d341c){case'scheduledat':var _0x2c391c=moment(_0x20bb80,_0xd97e('0xf'),!![]);if(_0x2c391c['isValid']()){_0xc4dc21['push']('\x22'+_0x20bb80+'\x22');}else{_0x51b5d5[_0xd97e('0x20')]('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case'priority':var _0x3a5b73=parseInt(_0x20bb80);_0x20bb80=_[_0xd97e('0x7c')](_0x3a5b73)||_0x3a5b73<0x0||_0x3a5b73>0x4?_0x4e9755?0x3:0x2:_0x3a5b73;_0xc4dc21[_0xd97e('0x20')]('\x22'+_0x20bb80+'\x22');break;case _0xd97e('0x35'):var _0x12ebb2=parseInt(_0x20bb80);if(_[_0xd97e('0x7d')](_0x12ebb2)&&_[_0xd97e('0x70')](_0x3ef248,_0x12ebb2)){_0xc4dc21['push']('\x22'+_0x12ebb2+'\x22');}else{_0x51b5d5[_0xd97e('0x20')](_0xd97e('0x7e'));}break;case _0xd97e('0x7f'):if(isEmail(_0x20bb80)){_0xc4dc21[_0xd97e('0x20')]('\x22'+_0x20bb80+'\x22');}else{_0x51b5d5[_0xd97e('0x20')]('email\x20wrong\x20format');}break;case'dateOfBirth':var _0x939466=moment(_0x20bb80,_0xd97e('0x80'),!![]);if(_0x939466[_0xd97e('0x81')]()){_0xc4dc21[_0xd97e('0x20')]('\x22'+_0x20bb80+'\x22');}else{_0x51b5d5[_0xd97e('0x20')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;case _0xd97e('0x69'):var _0x28fec8=shared[_0xd97e('0x65')];var _0xcd2dba=_0x28fec8[_0x20bb80];if(!_[_0xd97e('0x21')](_0xcd2dba)){var _0x2ca4c7=_0xcd2dba[_0xd97e('0x66')];_0xc4dc21[_0xd97e('0x20')]('\x22'+_0x20bb80+'\x22');_0xc4dc21[_0xd97e('0x20')]('\x22'+_0x2ca4c7+'\x22');}break;default:_0xc4dc21['push']('\x22'+_0x20bb80+'\x22');}}else{switch(_0x1d341c){case _0xd97e('0x82'):case'phone':_0x51b5d5[_0xd97e('0x20')](_0x1d341c+'\x20not\x20specified');break;default:_0xc4dc21[_0xd97e('0x20')]('\x22\x22');}}}}else{var _0x182bc2='';if(!_[_0xd97e('0x21')](_0x238337)){if(!_0x19fb53[_0xd97e('0x79')](_0x238337['id'])){if(!_[_0xd97e('0x21')](_0xea5439['data'][_0x89ace7][_0x2e851c[_0x1d341c]])){var _0x20bb80=_[_0xd97e('0x7a')](_0xea5439[_0xd97e('0x77')][_0x89ace7][_0x2e851c[_0x1d341c]][_0xd97e('0x7b')](/"/g,'\x27'));var _0x2fb696=phoneDescriptions['find'](_0x43ff36=>_0x43ff36[_0xd97e('0x83')]===_0x238337['id']);if(!_[_0xd97e('0x21')](_0x2fb696)){var _0x34e48d=_[_0xd97e('0x7a')](_0xea5439[_0xd97e('0x77')][_0x89ace7][_0x2e851c[_0x2fb696[_0xd97e('0x84')]]][_0xd97e('0x7b')](/"/g,'\x27'));if(!_[_0xd97e('0x21')](_0x34e48d))_0x20bb80=_0x20bb80+'§'+_0x34e48d;}if(_0x182bc2=='')_0x182bc2=_0x20bb80;else _0x182bc2+='|'+_0x20bb80;}_0x1ecb3d[_0xd97e('0x20')](_0x238337['id']+':'+_0x182bc2);_0x19fb53[_0x238337['id']]=0x1;}}}}if(hasAdditionalPhones){_0xc4dc21[_0xd97e('0x20')]('\x22'+_0x1ecb3d[_0xd97e('0x15')](';')+'\x22');}if(_0x51b5d5[_0xd97e('0x1d')]){handleError(_0xea5439[_0xd97e('0x77')][_0x89ace7],{'code':_0xd97e('0x85'),'message':_0x51b5d5[_0xd97e('0x15')]()});}else{fs[_0xd97e('0x86')](_0x31df44,_0xc4dc21[_0xd97e('0x15')]()+'\x0a');}_0xc4dc21=[];}if(!(stats[_0xd97e('0x87')]%0xc8)){socket['emit']('contact:import:'+_0x7551e8,stats);stats[_0xd97e('0x57')]=[];}}if(stopped){logger[_0xd97e('0x59')]('Abort\x20parser');_0x421491[_0xd97e('0x88')]();}}catch(_0x1f5fe0){handleError(_0xea5439[_0xd97e('0x77')][_0x89ace7],{'code':_0xd97e('0x89'),'message':_0x1f5fe0[_0xd97e('0x56')]});logger[_0xd97e('0x55')](_0xd97e('0x8a'),_0x1f5fe0[_0xd97e('0x56')]);}},'complete':function(){try{var _0x27b9a5=[];var _0x3619f1=[];var _0x584746=_0xd97e('0x37');if(_0x4fdf5d[_0xd97e('0x8b')]&&_0x4fdf5d[_0xd97e('0x8b')][_0xd97e('0x1d')]){_0x584746=_0xd97e('0x8c')+_0x7551e8;_0x27b9a5[_0xd97e('0x20')](_0xd97e('0x8d')+_0x584746+_0xd97e('0x8e'));}tmp_campaigns=_0xd97e('0x8f')+_0x7551e8;tmp_voice_queues='voice_queues_'+_0x7551e8;_0x3619f1['push'](_0xd97e('0x8d')+tmp_campaigns+'(id\x20int,dialTimezone\x20varchar(255),offset\x20int);');_0x3619f1[_0xd97e('0x20')](_0xd97e('0x8d')+tmp_voice_queues+_0xd97e('0x90'));BPromise[_0xd97e('0x91')](_0x3619f1,handleTZQuery)['then'](function(_0x43383f){updateTzCampaigns(_0x4fdf5d[_0xd97e('0x31')])[_0xd97e('0x1c')](function(_0x44e98c){updateTzVoiceQueues(_0x4fdf5d[_0xd97e('0x31')])[_0xd97e('0x1c')](function(_0x426571){if(hasTZ)_0x868caa=_0x868caa[_0xd97e('0x7b')]('dialTimezone','dialTimezone,utcOffset');var _0x44d58d=util['format'](_0xd97e('0x92'),_0x31df44,_0x584746,_0x868caa,_0x4fdf5d[_0xd97e('0x31')],_0x4fdf5d[_0xd97e('0x93')]||null,NOW,NOW);if(_[_0xd97e('0x21')](_0x2e851c['scheduledat'])){_0x44d58d+=_0xd97e('0x94');}_0x27b9a5[_0xd97e('0x20')](_0x44d58d);if(_0x4fdf5d[_0xd97e('0x8b')]&&_0x4fdf5d[_0xd97e('0x8b')][_0xd97e('0x1d')]){_0x27b9a5[_0xd97e('0x20')](insertCmContact(_0x4fdf5d[_0xd97e('0x31')],_0x584746,_0x4fdf5d['duplicates'],_0x2e851c));_0x27b9a5[_0xd97e('0x20')](_0xd97e('0x95')+_0x584746+';');}BPromise[_0xd97e('0x91')](_0x27b9a5,handleQuery)[_0xd97e('0x1c')](function(_0x33c9ba){BPromise[_0xd97e('0x1e')]([handleAdditionalPhones()])[_0xd97e('0x1c')](function(){_0x27b9a5=[];for(var _0x31db4e=0x0;_0x31db4e\x20\x20','root','existsSync','binding\x20doesn\x27t\x20exists','ListId\x20is\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','papaparse','util','bluebird','moment','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','import','redis'];(function(_0x1fd3e2,_0x1a6772){var _0x5a9210=function(_0x37e9c3){while(--_0x37e9c3){_0x1fd3e2['push'](_0x1fd3e2['shift']());}};_0x5a9210(++_0x1a6772);}(_0x7a52,0x1bd));var _0x27a5=function(_0x42c436,_0x49ad36){_0x42c436=_0x42c436-0x0;var _0x1bf0ce=_0x7a52[_0x42c436];return _0x1bf0ce;};'use strict';var fs=require('fs');var path=require(_0x27a5('0x0'));var _=require('lodash');var Papa=require(_0x27a5('0x1'));var util=require(_0x27a5('0x2'));var BPromise=require(_0x27a5('0x3'));var moment=require(_0x27a5('0x4'));var squel=require('squel');var Redis=require(_0x27a5('0x5'));var db=require(_0x27a5('0x6'))['db'];var config=require(_0x27a5('0x7'));var logger=require(_0x27a5('0x8'))(_0x27a5('0x9'));config[_0x27a5('0xa')]=_[_0x27a5('0xb')](config['redis'],{'host':_0x27a5('0xc'),'port':0x18eb});var socket=require(_0x27a5('0xd'))(new Redis(config['redis']));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var promisesContact=[];var orderBy=0x0;var updatedRows=0x0;var stopped=![];var NOW=moment()['format'](_0x27a5('0xe'));var tempTableName='cm_contacts_temp_'+moment()[_0x27a5('0xf')](_0x27a5('0x10'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x2222c2){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'](_0x2222c2);}function selectNotIn(_0xb4c6ee,_0x3164d6,_0x30687b,_0x57b4fe,_0x5cf8a7){return squel[_0x27a5('0x11')]()['field']('phone')[_0x27a5('0x12')](_0x57b4fe)[_0x27a5('0x13')](_0x3164d6,null,_0x3164d6+_0x27a5('0x14')+_0x57b4fe+'.'+_0x30687b)[_0x27a5('0x15')](_0x57b4fe+'.'+_0x30687b+_0x27a5('0x16')+_0xb4c6ee+'.'+_0x30687b)[_0x27a5('0x15')](_0x3164d6+_0x27a5('0x17')+_0x5cf8a7['join']()+')');}function handleAdditionalPhones(){return new Promise(function(_0x447f2c,_0x368d9){promisesAdditionalPhones=[];promisesContact=[];return db[_0x27a5('0x18')]['query']('select\x20*\x20from\x20'+tempTableName)[_0x27a5('0x19')](function(_0x4e03fb){if(_0x4e03fb!==null){var _0x4500c4=[];for(var _0x25e512=0x0;_0x25e512<_0x4e03fb[_0x27a5('0x1a')];_0x25e512++){var _0x24bec0=_0x4e03fb[_0x25e512];if(!_[_0x27a5('0x1b')](_0x24bec0[_0x27a5('0x1c')])){if(!_['isNil'](_0x24bec0[_0x27a5('0x1d')]))_0x4500c4[_0x27a5('0x1e')](insertAdditionalPhones(_0x24bec0));promisesContact[_0x27a5('0x1e')]({'contact':_0x24bec0});}}}Promise[_0x27a5('0x1f')](_0x4500c4)[_0x27a5('0x20')](function(){_0x447f2c({'val':0x1});});})[_0x27a5('0x21')](function(_0x110b3d){logger['error'](_0x110b3d[_0x27a5('0x22')]);});});}function insertAdditionalPhones(_0x4088f6){return new Promise(function(_0x499b6d,_0x3cf7b7){var _0x8851a0=_0x4088f6[_0x27a5('0x1d')];if(_[_0x27a5('0x1b')](_0x8851a0))_0x3cf7b7({'val':0x0});else{var _0x44f33a=_0x8851a0['split'](';');var _0x28c06c=[];orderBy=0x0;for(var _0x3c5073=0x0;_0x3c5073<_0x44f33a['length'];_0x3c5073++){_0x28c06c['push'](splitAdditionalPhone(_0x4088f6['id'],_0x44f33a[_0x3c5073]));}Promise[_0x27a5('0x1f')](_0x28c06c)[_0x27a5('0x20')](function(){_0x499b6d({'val':_0x44f33a[_0x27a5('0x1a')]});});}});}function splitAdditionalPhone(_0x304abb,_0x5b7313){return new Promise(function(_0x188b95,_0x49e862){var _0x37efdd=_0x5b7313['split'](':');var _0x38075e=_0x37efdd[0x0];var _0x2158b2=_0x37efdd[0x1];if(_0x2158b2!==''){var _0x34b5fc=_0x2158b2[_0x27a5('0x23')]('|');var _0x5128f0=[];for(var _0x5dd9d1=0x0;_0x5dd9d1<_0x34b5fc[_0x27a5('0x1a')];_0x5dd9d1++){if(_0x34b5fc[_0x5dd9d1]!==''){var _0x5c3906=_[_0x27a5('0x24')](promisesAdditionalPhones,{'contactId':_0x304abb,'phone':_0x34b5fc[_0x5dd9d1]});if(_0x5c3906[_0x27a5('0x1a')]==0x0){orderBy++;promisesAdditionalPhones[_0x27a5('0x1e')]({'contactId':_0x304abb,'contactTypeId':_0x38075e,'phone':_0x34b5fc[_0x5dd9d1],'orderBy':orderBy});}}}_0x188b95({'ok':0x1});}else _0x188b95({'res':0x0});});}function createAdditionalPhone(_0x4e2cf7,_0x45a33e,_0x1df29d,_0x6cdab1){var _0x3de6c3='';var _0x110a17='';var _0xaf45fa=_0x1df29d[_0x27a5('0x23')]('§');_0x3de6c3=_0xaf45fa[0x0];if(_0xaf45fa[_0x27a5('0x1a')]==0x2)_0x110a17=_0xaf45fa[0x1];return new Promise(function(_0x203a95,_0x4f8145){return db[_0x27a5('0x25')][_0x27a5('0x26')]({'where':{'CmContactId':_0x4e2cf7,'item':_0x3de6c3}})[_0x27a5('0x20')](function(_0x438850){if(_0x438850){return db['CmContactHasItem'][_0x27a5('0x27')]({'ItemTypeId':_0x45a33e,'description':_0x110a17,'OrderBy':_0x6cdab1},{'where':{'CmContactId':_0x4e2cf7,'item':_0x3de6c3}})[_0x27a5('0x20')](function(_0x3e8904){_0x203a95({'res':_0x27a5('0x28')});});}else{return db[_0x27a5('0x25')][_0x27a5('0x29')]({'CmContactId':_0x4e2cf7,'item':_0x3de6c3,'ItemTypeId':_0x45a33e,'description':_0x110a17,'OrderBy':_0x6cdab1,'ItemClass':_0x27a5('0x2a')})[_0x27a5('0x20')](function(_0xd8e800){_0x203a95({'res':_0x27a5('0x2b')});});}});});}function updateContact(_0x50ecdf){return new Promise(function(_0xea4e48,_0x3bb59f){var _0x57b7a6=_0x50ecdf['id'];delete _0x50ecdf['id'];return db['CmContact'][_0x27a5('0x27')](_0x50ecdf,{'where':{'id':_0x57b7a6}})['then'](function(_0xe22fc8){updatedRows+=0x1;return db[_0x27a5('0x2c')][_0x27a5('0x27')]({'phone':_0x50ecdf[_0x27a5('0x1c')]},{'where':{'ContactId':_0x57b7a6}})[_0x27a5('0x20')](function(_0x1b7c86){_0xea4e48({'ret':'OK'});});});});}function insertCmHopper(_0xac327c,_0x8f2ebe,_0x25c42f,_0x40629c,_0x97cb27){var _0x48f022=[_0x27a5('0x2d'),'cm_contacts.scheduledat',_0x27a5('0x2e'),_0x27a5('0x2f'),_0x8f2ebe+'.'+_0x40629c,_0x27a5('0x30'),'cm_contacts.updatedAt',_0x27a5('0x31'),'cm_contacts.UserId','\x22'+_0x97cb27+'\x22'];return squel[_0x27a5('0x32')]()[_0x27a5('0x33')]('cm_hopper')['fromQuery']([_0x27a5('0x1c'),_0x27a5('0x34'),'ContactId','ListId',_0x40629c,_0x27a5('0x35'),_0x27a5('0x36'),_0x27a5('0x37'),'UserId',_0x27a5('0x38')],squel[_0x27a5('0x11')]()[_0x27a5('0x39')](_0x48f022)[_0x27a5('0x12')](_0x8f2ebe)[_0x27a5('0x13')]('cm_contacts',null,'cm_contacts.ListId\x20=\x20'+_0x8f2ebe+_0x27a5('0x3a'))[_0x27a5('0x13')](_0x25c42f,null,_0x25c42f+_0x27a5('0x14')+_0x8f2ebe+'.'+_0x40629c)[_0x27a5('0x15')](_0x8f2ebe+_0x27a5('0x3b'),_0xac327c)[_0x27a5('0x15')](_0x27a5('0x3c'),NOW)[_0x27a5('0x15')](_0x27a5('0x3d'),selectNotIn(_0x8f2ebe,_0x25c42f,_0x40629c,_0x27a5('0x3e'),['\x22always\x22',_0x27a5('0x3f')]))[_0x27a5('0x15')](_0x27a5('0x3d'),selectNotIn(_0x8f2ebe,_0x25c42f,_0x40629c,_0x27a5('0x3e'),[_0x27a5('0x40')])))[_0x27a5('0x41')]();}function insertCmHopperBlack(_0x5ed676,_0x4fe261,_0x2f985e,_0x7b3aba){var _0x5e8e14=[_0x27a5('0x2d'),_0x27a5('0x2e'),_0x27a5('0x2f'),_0x4fe261+'.'+_0x7b3aba,_0x27a5('0x30'),_0x27a5('0x42')];return squel[_0x27a5('0x32')]()[_0x27a5('0x33')](_0x27a5('0x43'))[_0x27a5('0x44')]([_0x27a5('0x1c'),'ContactId',_0x27a5('0x45'),_0x7b3aba,_0x27a5('0x35'),_0x27a5('0x36')],squel[_0x27a5('0x11')]()[_0x27a5('0x39')](_0x5e8e14)[_0x27a5('0x12')](_0x4fe261)[_0x27a5('0x13')](_0x27a5('0x46'),null,_0x27a5('0x47')+_0x4fe261+_0x27a5('0x3a'))[_0x27a5('0x13')](_0x2f985e,null,_0x2f985e+'.id\x20=\x20'+_0x4fe261+'.'+_0x7b3aba)[_0x27a5('0x15')](_0x4fe261+'.CmListId\x20=\x20?',_0x5ed676)[_0x27a5('0x15')](_0x27a5('0x3c'),NOW)[_0x27a5('0x15')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x27a5('0x48')]('phone')[_0x27a5('0x12')](_0x27a5('0x43'))[_0x27a5('0x15')](_0x27a5('0x49'),_0x5ed676)[_0x27a5('0x15')](_0x7b3aba+_0x27a5('0x4a'),_0x4fe261+'.'+_0x7b3aba)))[_0x27a5('0x41')]();}function insertCmHopperAdditionalPhones(_0xf166b0){var _0x3e956b=['cm_hopper.id',_0x27a5('0x4b'),_0x27a5('0x4c'),_0x27a5('0x4d'),_0x27a5('0x4e')];return squel['insert']()[_0x27a5('0x33')](_0x27a5('0x4f'))[_0x27a5('0x44')]([_0x27a5('0x50'),_0x27a5('0x1c'),_0x27a5('0x51'),_0x27a5('0x35'),'updatedAt'],squel[_0x27a5('0x11')]()[_0x27a5('0x39')](_0x3e956b)[_0x27a5('0x12')](_0x27a5('0x3e'))[_0x27a5('0x13')]('cm_contacts',null,_0x27a5('0x52'))['join']('cm_contact_has_items',null,_0x27a5('0x53'))[_0x27a5('0x15')]('cm_hopper.ListId\x20=\x20?',_0xf166b0)[_0x27a5('0x15')](_0x27a5('0x3c'),NOW))[_0x27a5('0x41')]();}function insertCmContact(_0x364583,_0x43e984,_0xb5a42f,_0x52d059){var _0x25f31a=_['concat'](_['keys'](_0x52d059),['ListId',_0x27a5('0x54'),_0x27a5('0x35'),_0x27a5('0x36')]);return squel[_0x27a5('0x32')]()[_0x27a5('0x33')](_0x27a5('0x46'))[_0x27a5('0x44')](_0x25f31a,squel[_0x27a5('0x11')]()[_0x27a5('0x39')](_0x25f31a)[_0x27a5('0x12')](_0x43e984)[_0x27a5('0x15')]('('+_0xb5a42f[_0x27a5('0x13')](',')+')\x20NOT\x20IN\x20?',squel[_0x27a5('0x11')]()[_0x27a5('0x39')](_0xb5a42f)[_0x27a5('0x12')]('cm_contacts')[_0x27a5('0x15')](_0x27a5('0x49'),_0x364583))['where'](_0x27a5('0x55'),squel[_0x27a5('0x11')]()[_0x27a5('0x48')](_0x27a5('0x56'),_0x27a5('0x57'))[_0x27a5('0x12')](_0x43e984)['group'](_0xb5a42f['join'](','))))[_0x27a5('0x41')]();}function handleStop(){logger[_0x27a5('0x58')](_0x27a5('0x59'));stopped=!![];}function handleUncaughtException(_0x58af78){logger[_0x27a5('0x5a')](_0x58af78[_0x27a5('0x22')]);process[_0x27a5('0x5b')](0x1);}function handleError(_0x1e415a,_0x8f2f15){stats[_0x27a5('0x5c')][_0x27a5('0x1e')]({'name':_0x8f2f15[_0x27a5('0x5d')],'message':_0x8f2f15['message'],'row':_0x1e415a});}function handleQuery(_0x3f89b7){logger[_0x27a5('0x58')](_0x3f89b7);return db[_0x27a5('0x18')]['query'](_0x3f89b7)['spread'](function(_0x40ca71){results['push'](_0x40ca71);})[_0x27a5('0x21')](function(_0x66281f){logger[_0x27a5('0x5a')](_0x66281f['message']);});}function main(_0x404c97,_0x26002c,_0x5de71f,_0x37615b){logger[_0x27a5('0x58')](_0x27a5('0x5e'),_0x404c97,JSON['stringify'](_0x26002c));process[_0x27a5('0x5f')](_0x27a5('0x60'));var _0x20f0d6=_0x26002c[_0x27a5('0x61')];var _0x4a3dd4=_['clone'](_0x20f0d6);var _0x33147b=_0x26002c['socket_timestamp'];var _0x31c3c2=path[_0x27a5('0x13')](config['root'],'server/files/tmp',_0x33147b+_0x27a5('0x62'));logger[_0x27a5('0x58')](_0x27a5('0x63'),_0x26002c);db[_0x27a5('0x64')][_0x27a5('0x65')]({'raw':!![],'attributes':['id',_0x27a5('0x66')]})[_0x27a5('0x20')](function(_0x188b71){for(var _0x5075a4=0x0;_0x5075a4<_0x188b71[_0x27a5('0x1a')];_0x5075a4++){if(_0x188b71[_0x5075a4]['name']in _0x20f0d6){contactItemTypes[_0x27a5('0x1e')](_0x188b71[_0x5075a4]);delete _0x4a3dd4[_0x188b71[_0x5075a4]['name']];hasAdditionalPhones=!![];}for(var _0xc47589 in _0x20f0d6){if(_0x188b71[_0x5075a4][_0x27a5('0x66')]+_0x27a5('0x67')===_0xc47589){phoneDescriptions[_0x27a5('0x1e')]({'itemTypeId':_0x188b71[_0x5075a4]['id'],'description':_0xc47589});delete _0x4a3dd4[_0xc47589];}}}if(hasAdditionalPhones)_0x4a3dd4[_0x27a5('0x1d')]='';var _0x5a58a8=_['keys'](_0x4a3dd4)['join']();logger['info'](_0x27a5('0x68'),_0x5a58a8);fs[_0x27a5('0x69')](_0x31c3c2,_0x5a58a8+'\x0a');Papa[_0x27a5('0x6a')](fs[_0x27a5('0x6b')](_0x404c97),{'header':!![],'skipEmptyLines':!![],'step':function(_0x3697fa,_0x4ad71c){try{for(var _0x2f6d6b=0x0,_0x20d11d=[];_0x2f6d6b<_0x3697fa[_0x27a5('0x6c')][_0x27a5('0x1a')];_0x2f6d6b++){stats[_0x27a5('0x6d')]+=0x1;if(_0x3697fa[_0x27a5('0x5c')][_0x2f6d6b]){handleError(_0x3697fa['data'][_0x2f6d6b],_0x3697fa[_0x27a5('0x5c')][_0x2f6d6b]);}else{var _0x22b528=[];var _0x163e35=[];var _0x5448b0={};for(var _0x42e98e in _0x20f0d6){let _0x13eab5=contactItemTypes[_0x27a5('0x6e')](_0x9b6091=>_0x9b6091[_0x27a5('0x66')]===_0x42e98e);let _0x2c1a87=contactItemTypes[_0x27a5('0x6e')](_0x4f9b6e=>_0x4f9b6e[_0x27a5('0x66')]+_0x27a5('0x67')===_0x42e98e);if(_[_0x27a5('0x1b')](_0x13eab5)&&_['isNil'](_0x2c1a87)){if(_0x20f0d6[_0x27a5('0x6f')](_0x42e98e)){if(_0x3697fa[_0x27a5('0x6c')][_0x2f6d6b][_0x20f0d6[_0x42e98e]]){var _0x537ead=_[_0x27a5('0x70')](_0x3697fa['data'][_0x2f6d6b][_0x20f0d6[_0x42e98e]][_0x27a5('0x71')](/"/g,'\x27'));switch(_0x42e98e){case _0x27a5('0x34'):var _0x2b5c54=moment(_0x537ead,_0x27a5('0xe'),!![]);if(_0x2b5c54[_0x27a5('0x72')]()){_0x20d11d['push']('\x22'+_0x537ead+'\x22');}else{_0x22b528['push'](_0x27a5('0x73'));}break;case _0x27a5('0x37'):var _0x5df4fa=parseInt(_0x537ead);_0x537ead=_[_0x27a5('0x74')](_0x5df4fa)||_0x5df4fa<0x0||_0x5df4fa>0x4?_0x37615b?0x3:0x2:_0x5df4fa;_0x20d11d[_0x27a5('0x1e')]('\x22'+_0x537ead+'\x22');break;case _0x27a5('0x75'):var _0x4dcd69=parseInt(_0x537ead);if(_[_0x27a5('0x76')](_0x4dcd69)&&_['includes'](_0x5de71f,_0x4dcd69)){_0x20d11d[_0x27a5('0x1e')]('\x22'+_0x4dcd69+'\x22');}else{_0x22b528[_0x27a5('0x1e')](_0x27a5('0x77'));}break;case _0x27a5('0x78'):if(isEmail(_0x537ead)){_0x20d11d[_0x27a5('0x1e')]('\x22'+_0x537ead+'\x22');}else{_0x22b528[_0x27a5('0x1e')]('email\x20wrong\x20format');}break;case'dateOfBirth':var _0x58718c=moment(_0x537ead,_0x27a5('0x79'),!![]);if(_0x58718c['isValid']()){_0x20d11d[_0x27a5('0x1e')]('\x22'+_0x537ead+'\x22');}else{_0x22b528['push'](_0x27a5('0x7a'));}break;default:_0x20d11d[_0x27a5('0x1e')]('\x22'+_0x537ead+'\x22');}}else{switch(_0x42e98e){case'firstName':case _0x27a5('0x1c'):_0x22b528[_0x27a5('0x1e')](_0x42e98e+'\x20not\x20specified');break;default:_0x20d11d[_0x27a5('0x1e')]('\x22\x22');}}}}else{var _0x4bc4a5='';if(!_[_0x27a5('0x1b')](_0x13eab5)){if(!_0x5448b0[_0x27a5('0x6f')](_0x13eab5['id'])){for(var _0x28ac55=0x0;_0x28ac55<_0x20f0d6[_0x42e98e][_0x27a5('0x1a')];_0x28ac55++){var _0x537ead=_['trim'](_0x3697fa[_0x27a5('0x6c')][_0x2f6d6b][_0x20f0d6[_0x42e98e][_0x28ac55]][_0x27a5('0x71')](/"/g,'\x27'));var _0x56ad59=phoneDescriptions[_0x27a5('0x6e')](_0x2bd859=>_0x2bd859['itemTypeId']===_0x13eab5['id']);if(!_['isNil'](_0x56ad59)){var _0x2ef778=_[_0x27a5('0x70')](_0x3697fa[_0x27a5('0x6c')][_0x2f6d6b][_0x20f0d6[_0x56ad59[_0x27a5('0x7b')]][0x0]][_0x27a5('0x71')](/"/g,'\x27'));if(!_[_0x27a5('0x1b')](_0x2ef778))_0x537ead=_0x537ead+'§'+_0x2ef778;}if(_0x4bc4a5=='')_0x4bc4a5=_0x537ead;else _0x4bc4a5+='|'+_0x537ead;}_0x163e35['push'](_0x13eab5['id']+':'+_0x4bc4a5);_0x5448b0[_0x13eab5['id']]=0x1;}}}}if(hasAdditionalPhones){_0x20d11d[_0x27a5('0x1e')]('\x22'+_0x163e35[_0x27a5('0x13')](';')+'\x22');}if(_0x22b528[_0x27a5('0x1a')]){handleError(_0x3697fa[_0x27a5('0x6c')][_0x2f6d6b],{'code':_0x27a5('0x7c'),'message':_0x22b528['join']()});}else{fs['appendFileSync'](_0x31c3c2,_0x20d11d[_0x27a5('0x13')]()+'\x0a');}_0x20d11d=[];}if(!(stats['rows']%0xc8)){socket[_0x27a5('0x7d')]('contact:import:'+_0x33147b,stats);stats['errors']=[];}}if(stopped){logger[_0x27a5('0x58')](_0x27a5('0x7e'));_0x4ad71c[_0x27a5('0x7f')]();}}catch(_0x750093){handleError(_0x3697fa[_0x27a5('0x6c')][_0x2f6d6b],{'code':_0x27a5('0x80'),'message':_0x750093[_0x27a5('0x22')]});logger['error'](_0x27a5('0x81'),_0x750093[_0x27a5('0x22')]);}},'complete':function(){try{var _0x4d1e73=[];var _0x1a7118=tempTableName;_0x4d1e73[_0x27a5('0x1e')](_0x27a5('0x82')+_0x1a7118+_0x27a5('0x83'));logger[_0x27a5('0x58')]('CIS\x20len',contactItemTypes[_0x27a5('0x1a')]);var _0x259920=util[_0x27a5('0xf')](_0x27a5('0x84'),_0x31c3c2,_0x1a7118,_0x5a58a8,_0x26002c[_0x27a5('0x45')],_0x26002c['CompanyId']||null,NOW,NOW);if(_['isNil'](_0x20f0d6[_0x27a5('0x34')])){_0x259920+=',\x20scheduledAt\x20=\x20NOW()';}_0x4d1e73[_0x27a5('0x1e')](_0x259920);BPromise['each'](_0x4d1e73,handleQuery)[_0x27a5('0x20')](function(_0x18ca37){BPromise[_0x27a5('0x1f')]([handleAdditionalPhones()])[_0x27a5('0x20')](function(){_0x4d1e73=[];for(var _0x54fe7a=0x0;_0x54fe7a_0x479ab3[_0x5b4e('0x66')]===_0x5a0962);let _0x3f55b0=contactItemTypes[_0x5b4e('0x6a')](_0x10a976=>_0x10a976[_0x5b4e('0x66')]+_0x5b4e('0x6b')===_0x5a0962);if(_[_0x5b4e('0x1d')](_0x147484)&&_[_0x5b4e('0x1d')](_0x3f55b0)){if(_0x30b167[_0x5b4e('0x6c')](_0x5a0962)){if(_0x14e9fa[_0x5b4e('0x68')][_0x2e64e4][_0x30b167[_0x5a0962]]){var _0x5ac807=_[_0x5b4e('0x6d')](_0x14e9fa[_0x5b4e('0x68')][_0x2e64e4][_0x30b167[_0x5a0962]][_0x5b4e('0x6e')](/"/g,'\x27'));switch(_0x5a0962){case _0x5b4e('0x36'):var _0x30d11f=moment(_0x5ac807,_0x5b4e('0xd'),!![]);if(_0x30d11f[_0x5b4e('0x6f')]()){_0x3582de[_0x5b4e('0x1f')]('\x22'+_0x5ac807+'\x22');}else{_0x43e38b['push'](_0x5b4e('0x70'));}break;case _0x5b4e('0x71'):var _0x535098=parseInt(_0x5ac807);_0x5ac807=_[_0x5b4e('0x72')](_0x535098)||_0x535098<0x0||_0x535098>0x4?_0x291565?0x3:0x2:_0x535098;_0x3582de['push']('\x22'+_0x5ac807+'\x22');break;case _0x5b4e('0x73'):var _0x54f973=parseInt(_0x5ac807);if(_[_0x5b4e('0x74')](_0x54f973)&&_[_0x5b4e('0x75')](_0x19ac43,_0x54f973)){_0x3582de[_0x5b4e('0x1f')]('\x22'+_0x54f973+'\x22');}else{_0x43e38b['push'](_0x5b4e('0x76'));}break;case _0x5b4e('0x77'):if(isEmail(_0x5ac807)){_0x3582de[_0x5b4e('0x1f')]('\x22'+_0x5ac807+'\x22');}else{_0x43e38b[_0x5b4e('0x1f')](_0x5b4e('0x78'));}break;case'dateOfBirth':var _0x162507=moment(_0x5ac807,_0x5b4e('0x79'),!![]);if(_0x162507[_0x5b4e('0x6f')]()){_0x3582de['push']('\x22'+_0x5ac807+'\x22');}else{_0x43e38b[_0x5b4e('0x1f')](_0x5b4e('0x7a'));}break;default:_0x3582de['push']('\x22'+_0x5ac807+'\x22');}}else{switch(_0x5a0962){case _0x5b4e('0x7b'):case'phone':_0x43e38b[_0x5b4e('0x1f')](_0x5a0962+_0x5b4e('0x7c'));break;default:_0x3582de[_0x5b4e('0x1f')]('\x22\x22');}}}}else{var _0xb3c678='';if(!_[_0x5b4e('0x1d')](_0x147484)){if(!_0x504ab6[_0x5b4e('0x6c')](_0x147484['id'])){for(var _0x2b35c1=0x0;_0x2b35c1<_0x30b167[_0x5a0962]['length'];_0x2b35c1++){var _0x5ac807=_['trim'](_0x14e9fa[_0x5b4e('0x68')][_0x2e64e4][_0x30b167[_0x5a0962][_0x2b35c1]][_0x5b4e('0x6e')](/"/g,'\x27'));var _0x1a1a0e=phoneDescriptions[_0x5b4e('0x6a')](_0x3bbf12=>_0x3bbf12[_0x5b4e('0x7d')]===_0x147484['id']);if(!_[_0x5b4e('0x1d')](_0x1a1a0e)){var _0x497c18=_[_0x5b4e('0x6d')](_0x14e9fa['data'][_0x2e64e4][_0x30b167[_0x1a1a0e[_0x5b4e('0x7e')]][0x0]][_0x5b4e('0x6e')](/"/g,'\x27'));if(!_[_0x5b4e('0x1d')](_0x497c18))_0x5ac807=_0x5ac807+'§'+_0x497c18;}if(_0xb3c678=='')_0xb3c678=_0x5ac807;else _0xb3c678+='|'+_0x5ac807;}_0x22d968[_0x5b4e('0x1f')](_0x147484['id']+':'+_0xb3c678);_0x504ab6[_0x147484['id']]=0x1;}}}}if(hasAdditionalPhones){_0x3582de['push']('\x22'+_0x22d968['join'](';')+'\x22');}if(_0x43e38b['length']){handleError(_0x14e9fa[_0x5b4e('0x68')][_0x2e64e4],{'code':_0x5b4e('0x7f'),'message':_0x43e38b[_0x5b4e('0x15')]()});}else{fs[_0x5b4e('0x80')](_0x419a89,_0x3582de[_0x5b4e('0x15')]()+'\x0a');}_0x3582de=[];}if(!(stats['rows']%0xc8)){socket[_0x5b4e('0x81')](_0x5b4e('0x82')+_0x47c0a9,stats);stats[_0x5b4e('0x59')]=[];}}if(stopped){logger[_0x5b4e('0x5b')]('Abort\x20parser');_0x26db4c[_0x5b4e('0x83')]();}}catch(_0x2d4bef){handleError(_0x14e9fa['data'][_0x2e64e4],{'code':_0x5b4e('0x84'),'message':_0x2d4bef[_0x5b4e('0x23')]});logger['error'](_0x5b4e('0x85'),_0x2d4bef[_0x5b4e('0x23')]);}},'complete':function(){try{var _0x92fbdb=[];var _0x12f1e2=tempTableName;_0x92fbdb[_0x5b4e('0x1f')](_0x5b4e('0x86')+_0x12f1e2+_0x5b4e('0x87'));logger[_0x5b4e('0x5b')](_0x5b4e('0x88'),contactItemTypes[_0x5b4e('0x1c')]);var _0x18480e=util[_0x5b4e('0xc')](_0x5b4e('0x89'),_0x419a89,_0x12f1e2,_0x172e73,_0x1eb1e0['ListId'],_0x1eb1e0[_0x5b4e('0x53')]||null,NOW,NOW);if(_[_0x5b4e('0x1d')](_0x30b167[_0x5b4e('0x36')])){_0x18480e+=_0x5b4e('0x8a');}_0x92fbdb[_0x5b4e('0x1f')](_0x18480e);BPromise[_0x5b4e('0x8b')](_0x92fbdb,handleQuery)[_0x5b4e('0x26')](function(_0x5de2a7){BPromise[_0x5b4e('0x20')]([handleAdditionalPhones()])[_0x5b4e('0x26')](function(){_0x92fbdb=[];for(var _0x3ef6ee=0x0;_0x3ef6ee\x20\x20');}var _0x2dd06c=path[_0x5b4e('0x15')](config['root'],_0x5b4e('0x61'),process[_0x5b4e('0x93')][0x2]);if(!fs[_0x5b4e('0x94')](_0x2dd06c)){throw new Error(_0x5b4e('0x95'));}var _0x180af4={};try{_0x180af4=JSON['parse'](process[_0x5b4e('0x93')][0x3]);if(!_0x180af4[_0x5b4e('0x96')]){throw new Error(_0x5b4e('0x97'));}var _0xf8a126=0x0;if(_0x180af4[_0x5b4e('0x96')][_0x5b4e('0x73')]){_0xf8a126=0x1;}if(!_0x180af4['ListId']){throw new Error(_0x5b4e('0x98'));}}catch(_0x658e3b){throw new Error('body\x20id\x20mandatory');}var _0x1dc716=[];try{_0x1dc716=_[_0x5b4e('0x99')](JSON['parse'](process[_0x5b4e('0x93')][0x4]),'id');}catch(_0x539259){logger[_0x5b4e('0x5b')](_0x5b4e('0x9a'));}main(_0x2dd06c,_0x180af4,_0x1dc716,_0xf8a126);}validate();process['on'](_0x5b4e('0x9b'),handleStop);process['on'](_0x5b4e('0x9c'),handleUncaughtException); \ No newline at end of file diff --git a/server/components/integrations/configuration.js b/server/components/integrations/configuration.js index d06c374..15a4cd4 100644 --- a/server/components/integrations/configuration.js +++ b/server/components/integrations/configuration.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa7dc=['Queue','queue','uniqueid','Date','agentcalledAt','***\x20Agent\x20Info\x20***','Agent\x20Name','destcalleridname','Agent\x20Number','***\x20Time\x20Info\x20***','Agent\x20Ring','agentconnectAt','Agent\x20Complete','agentcompleteAt','holdtime','talktime','Member\x20Name','membername','UniqueId','starttime','Answer\x20Time','answertime','Duration','duration','Billable\x20Time','getSubjects','[xCALLY\x20Ticket]','toLowerCase','voice','inbound','push','variable','calleridnum','outbound','string','Outbound\x20Call','destcalleridnum','getDescriptions','***\x20Call\x20Info\x20***','keyValue','Caller\x20Number','calleridname','Call\x20To','destexten'];(function(_0x2dea24,_0x2fc021){var _0x309d58=function(_0x2eb89f){while(--_0x2eb89f){_0x2dea24['push'](_0x2dea24['shift']());}};_0x309d58(++_0x2fc021);}(_0xa7dc,0x9d));var _0xca7d=function(_0x3c579f,_0x1c1461){_0x3c579f=_0x3c579f-0x0;var _0x559c67=_0xa7dc[_0x3c579f];return _0x559c67;};'use strict';exports[_0xca7d('0x0')]=function(_0x2b8e11,_0x53f072){var _0x4b646f=[{'type':'string','content':_0xca7d('0x1'),'variableName':null}];switch(_0x2b8e11[_0xca7d('0x2')]()){case _0xca7d('0x3'):switch(_0x53f072[_0xca7d('0x2')]()){case _0xca7d('0x4'):_0x4b646f[_0xca7d('0x5')]({'type':_0xca7d('0x6'),'content':'','variableName':'queue'});_0x4b646f[_0xca7d('0x5')]({'type':_0xca7d('0x6'),'content':'','variableName':_0xca7d('0x7')});break;case _0xca7d('0x8'):_0x4b646f[_0xca7d('0x5')]({'type':_0xca7d('0x9'),'content':_0xca7d('0xa'),'variableName':null});_0x4b646f[_0xca7d('0x5')]({'type':'variable','content':'','variableName':_0xca7d('0xb')});break;}}return _0x4b646f;};exports[_0xca7d('0xc')]=function(_0x988ec9,_0x406e5f){var _0x2318da=[];switch(_0x988ec9[_0xca7d('0x2')]()){case _0xca7d('0x3'):switch(_0x406e5f[_0xca7d('0x2')]()){case _0xca7d('0x4'):_0x2318da=[{'type':_0xca7d('0x9'),'content':_0xca7d('0xd'),'key':null,'keyType':null,'variableName':null},{'type':_0xca7d('0xe'),'content':'','key':_0xca7d('0xf'),'keyType':_0xca7d('0x6'),'variableName':'calleridnum'},{'type':_0xca7d('0xe'),'content':'','key':'Caller\x20Name','keyType':_0xca7d('0x6'),'variableName':_0xca7d('0x10')},{'type':_0xca7d('0xe'),'content':'','key':_0xca7d('0x11'),'keyType':'variable','variableName':_0xca7d('0x12')},{'type':_0xca7d('0xe'),'content':'','key':_0xca7d('0x13'),'keyType':_0xca7d('0x6'),'variableName':_0xca7d('0x14')},{'type':_0xca7d('0xe'),'content':'','key':'UniqueId','keyType':_0xca7d('0x6'),'variableName':_0xca7d('0x15')},{'type':_0xca7d('0xe'),'content':'','key':_0xca7d('0x16'),'keyType':_0xca7d('0x6'),'variableName':_0xca7d('0x17')},{'type':_0xca7d('0x9'),'content':_0xca7d('0x18'),'key':null,'keyType':null,'variableName':null},{'type':_0xca7d('0xe'),'content':'','key':_0xca7d('0x19'),'keyType':_0xca7d('0x6'),'variableName':_0xca7d('0x1a')},{'type':_0xca7d('0xe'),'content':'','key':_0xca7d('0x1b'),'keyType':_0xca7d('0x6'),'variableName':_0xca7d('0xb')},{'type':_0xca7d('0x9'),'content':_0xca7d('0x1c'),'key':null,'keyType':null,'variableName':null},{'type':_0xca7d('0xe'),'content':'','key':_0xca7d('0x1d'),'keyType':_0xca7d('0x6'),'variableName':'agentcalledAt'},{'type':_0xca7d('0xe'),'content':'','key':'Agent\x20Connect','keyType':_0xca7d('0x6'),'variableName':_0xca7d('0x1e')},{'type':_0xca7d('0xe'),'content':'','key':_0xca7d('0x1f'),'keyType':_0xca7d('0x6'),'variableName':_0xca7d('0x20')},{'type':_0xca7d('0xe'),'content':'','key':'Hold\x20Time','keyType':_0xca7d('0x6'),'variableName':_0xca7d('0x21')},{'type':_0xca7d('0xe'),'content':'','key':'Talk\x20Time','keyType':_0xca7d('0x6'),'variableName':_0xca7d('0x22')}];break;case _0xca7d('0x8'):_0x2318da=[{'type':_0xca7d('0x9'),'content':_0xca7d('0xd'),'variableName':null},{'type':_0xca7d('0xe'),'content':'','key':'Called\x20Number','keyType':_0xca7d('0x6'),'keyContent':'','variableName':_0xca7d('0xb')},{'type':_0xca7d('0xe'),'content':'','key':_0xca7d('0x23'),'keyType':_0xca7d('0x6'),'keyContent':'','variableName':_0xca7d('0x24')},{'type':_0xca7d('0xe'),'content':'','key':_0xca7d('0x25'),'keyType':_0xca7d('0x6'),'keyContent':'','variableName':'uniqueid'},{'type':_0xca7d('0xe'),'content':'','key':'Date','keyType':_0xca7d('0x6'),'keyContent':'','variableName':_0xca7d('0x26')},{'type':_0xca7d('0x9'),'content':_0xca7d('0x1c')},{'type':_0xca7d('0xe'),'content':'','key':_0xca7d('0x27'),'keyType':_0xca7d('0x6'),'keyContent':'','variableName':_0xca7d('0x28')},{'type':_0xca7d('0xe'),'content':'','key':'Complete\x20Time','keyType':_0xca7d('0x6'),'keyContent':'','variableName':'endtime'},{'type':_0xca7d('0xe'),'content':'','key':_0xca7d('0x29'),'keyType':'variable','keyContent':'','variableName':_0xca7d('0x2a')},{'type':_0xca7d('0xe'),'content':'','key':_0xca7d('0x2b'),'keyType':_0xca7d('0x6'),'keyContent':'','variableName':'billableseconds'}];break;}}return _0x2318da;}; \ No newline at end of file +var _0x956c=['getDescriptions','toLowerCase','inbound','Caller\x20Number','keyValue','Caller\x20Name','Call\x20To','Queue','queue','UniqueId','Date','agentcalledAt','***\x20Agent\x20Info\x20***','destcalleridname','Agent\x20Number','Agent\x20Ring','agentconnectAt','Agent\x20Complete','agentcompleteAt','Hold\x20Time','holdtime','Talk\x20Time','***\x20Call\x20Info\x20***','Called\x20Number','Member\x20Name','membername','uniqueid','starttime','***\x20Time\x20Info\x20***','Answer\x20Time','Complete\x20Time','endtime','duration','Billable\x20Time','billableseconds','string','[xCALLY\x20Ticket]','voice','push','variable','calleridnum','outbound','destcalleridnum'];(function(_0x9fd42f,_0x57080f){var _0x11f7b6=function(_0xaacd91){while(--_0xaacd91){_0x9fd42f['push'](_0x9fd42f['shift']());}};_0x11f7b6(++_0x57080f);}(_0x956c,0x17b));var _0xc956=function(_0x460da5,_0x4d8fae){_0x460da5=_0x460da5-0x0;var _0xc23582=_0x956c[_0x460da5];return _0xc23582;};'use strict';exports['getSubjects']=function(_0x3409e8,_0x2209eb){var _0x5b7449=[{'type':_0xc956('0x0'),'content':_0xc956('0x1'),'variableName':null}];switch(_0x3409e8['toLowerCase']()){case _0xc956('0x2'):switch(_0x2209eb['toLowerCase']()){case'inbound':_0x5b7449[_0xc956('0x3')]({'type':_0xc956('0x4'),'content':'','variableName':'queue'});_0x5b7449[_0xc956('0x3')]({'type':_0xc956('0x4'),'content':'','variableName':_0xc956('0x5')});break;case _0xc956('0x6'):_0x5b7449['push']({'type':_0xc956('0x0'),'content':'Outbound\x20Call','variableName':null});_0x5b7449[_0xc956('0x3')]({'type':_0xc956('0x4'),'content':'','variableName':_0xc956('0x7')});break;}}return _0x5b7449;};exports[_0xc956('0x8')]=function(_0x2bb77b,_0x271d6b){var _0x2cbf7e=[];switch(_0x2bb77b[_0xc956('0x9')]()){case _0xc956('0x2'):switch(_0x271d6b[_0xc956('0x9')]()){case _0xc956('0xa'):_0x2cbf7e=[{'type':'string','content':'***\x20Call\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0xc956('0xb'),'keyType':_0xc956('0x4'),'variableName':_0xc956('0x5')},{'type':_0xc956('0xc'),'content':'','key':_0xc956('0xd'),'keyType':_0xc956('0x4'),'variableName':'calleridname'},{'type':_0xc956('0xc'),'content':'','key':_0xc956('0xe'),'keyType':_0xc956('0x4'),'variableName':'destexten'},{'type':_0xc956('0xc'),'content':'','key':_0xc956('0xf'),'keyType':_0xc956('0x4'),'variableName':_0xc956('0x10')},{'type':_0xc956('0xc'),'content':'','key':_0xc956('0x11'),'keyType':_0xc956('0x4'),'variableName':'uniqueid'},{'type':'keyValue','content':'','key':_0xc956('0x12'),'keyType':_0xc956('0x4'),'variableName':_0xc956('0x13')},{'type':_0xc956('0x0'),'content':_0xc956('0x14'),'key':null,'keyType':null,'variableName':null},{'type':_0xc956('0xc'),'content':'','key':'Agent\x20Name','keyType':_0xc956('0x4'),'variableName':_0xc956('0x15')},{'type':'keyValue','content':'','key':_0xc956('0x16'),'keyType':_0xc956('0x4'),'variableName':_0xc956('0x7')},{'type':_0xc956('0x0'),'content':'***\x20Time\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0xc956('0xc'),'content':'','key':_0xc956('0x17'),'keyType':_0xc956('0x4'),'variableName':'agentcalledAt'},{'type':_0xc956('0xc'),'content':'','key':'Agent\x20Connect','keyType':'variable','variableName':_0xc956('0x18')},{'type':'keyValue','content':'','key':_0xc956('0x19'),'keyType':'variable','variableName':_0xc956('0x1a')},{'type':_0xc956('0xc'),'content':'','key':_0xc956('0x1b'),'keyType':_0xc956('0x4'),'variableName':_0xc956('0x1c')},{'type':_0xc956('0xc'),'content':'','key':_0xc956('0x1d'),'keyType':_0xc956('0x4'),'variableName':'talktime'}];break;case _0xc956('0x6'):_0x2cbf7e=[{'type':_0xc956('0x0'),'content':_0xc956('0x1e'),'variableName':null},{'type':_0xc956('0xc'),'content':'','key':_0xc956('0x1f'),'keyType':_0xc956('0x4'),'keyContent':'','variableName':_0xc956('0x7')},{'type':_0xc956('0xc'),'content':'','key':_0xc956('0x20'),'keyType':_0xc956('0x4'),'keyContent':'','variableName':_0xc956('0x21')},{'type':'keyValue','content':'','key':_0xc956('0x11'),'keyType':_0xc956('0x4'),'keyContent':'','variableName':_0xc956('0x22')},{'type':_0xc956('0xc'),'content':'','key':_0xc956('0x12'),'keyType':_0xc956('0x4'),'keyContent':'','variableName':_0xc956('0x23')},{'type':_0xc956('0x0'),'content':_0xc956('0x24')},{'type':_0xc956('0xc'),'content':'','key':_0xc956('0x25'),'keyType':_0xc956('0x4'),'keyContent':'','variableName':'answertime'},{'type':'keyValue','content':'','key':_0xc956('0x26'),'keyType':_0xc956('0x4'),'keyContent':'','variableName':_0xc956('0x27')},{'type':'keyValue','content':'','key':'Duration','keyType':_0xc956('0x4'),'keyContent':'','variableName':_0xc956('0x28')},{'type':'keyValue','content':'','key':_0xc956('0x29'),'keyType':_0xc956('0x4'),'keyContent':'','variableName':_0xc956('0x2a')}];break;}}return _0x2cbf7e;}; \ No newline at end of file diff --git a/server/components/interaction/service.js b/server/components/interaction/service.js index ddf7124..a97b5a8 100644 --- a/server/components/interaction/service.js +++ b/server/components/interaction/service.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xad1b=['parseAdvancedSearchFilter','search','where','body','contact','filter','user','read','tags','checkAccountsRestrictions','group','i.id','ids','countFilteredInteractions','count','clause','order','forEach','contactName','DESC','closed','rows','tracked','query','clone','html','phone','fax','updateUser','lodash','./sql-utils','./utils','skipInteractionsQuery','resolve','getInteractionsQuery','then'];(function(_0x44ce56,_0x8de757){var _0x28b9aa=function(_0x3c8201){while(--_0x3c8201){_0x44ce56['push'](_0x44ce56['shift']());}};_0x28b9aa(++_0x8de757);}(_0xad1b,0xf5));var _0xbad1=function(_0x221686,_0x1b686e){_0x221686=_0x221686-0x0;var _0x3a8d5b=_0xad1b[_0x221686];return _0x3a8d5b;};'use strict';var _=require(_0xbad1('0x0'));var sqlUtils=require(_0xbad1('0x1'));var utils=require(_0xbad1('0x2'));exports['findAll']=function(_0x28fa67,_0x7a73c3,_0x3ee7cc,_0x3c4a6b,_0x343622){var _0x33c2f8={'count':0x0,'rows':[]};var _0x338a59=sqlUtils[_0xbad1('0x3')](_0x28fa67,_0x3ee7cc,_0x7a73c3);if(_0x338a59){return Promise[_0xbad1('0x4')](_0x33c2f8);}var _0x4f1646=sqlUtils[_0xbad1('0x5')](_0x28fa67);var _0x4278c4={};return Promise[_0xbad1('0x4')]()[_0xbad1('0x6')](function(){if(_0x7a73c3['search']){return sqlUtils[_0xbad1('0x7')](_0x7a73c3[_0xbad1('0x8')],_0x343622);}else{return sqlUtils['parseQueryParameters'](_0x28fa67,_0x7a73c3,_0x343622);}})['then'](function(_0x232c72){_0x4f1646[_0xbad1('0x9')](_0x232c72[_0xbad1('0xa')]);_0x4f1646[_0xbad1('0x9')](_0x232c72[_0xbad1('0xb')]);_0x4f1646[_0xbad1('0x9')](_0x232c72['default']);_0x4f1646[_0xbad1('0x9')](_0x232c72['fields']);_0x4f1646[_0xbad1('0x9')](_0x232c72[_0xbad1('0xc')]);_0x4f1646[_0xbad1('0x9')](_0x232c72[_0xbad1('0xd')]);_0x4f1646['having'](_0x232c72[_0xbad1('0xe')]);_0x4278c4=_0x232c72[_0xbad1('0xf')];return sqlUtils[_0xbad1('0x10')](_0x28fa67,_0x3ee7cc,_0x7a73c3);})[_0xbad1('0x6')](function(_0x3c897e){_0x4f1646['where'](_0x3c897e);_0x4f1646[_0xbad1('0x11')](_0xbad1('0x12'));var _0x4b0339=_0x7a73c3[_0xbad1('0x8')]?_0x4278c4[_0xbad1('0x13')]:_0x7a73c3['tag'];return sqlUtils[_0xbad1('0x14')](_0x4f1646,_0x4b0339);})[_0xbad1('0x6')](function(_0x1dbb11){_0x33c2f8[_0xbad1('0x15')]=_0x1dbb11['length'];if(_0x33c2f8[_0xbad1('0x15')]===0x0){return[];}_0x4f1646['having'](_0x4278c4[_0xbad1('0x16')]);if(_0x3c4a6b[_0xbad1('0x17')]){_0x3c4a6b[_0xbad1('0x17')][_0xbad1('0x18')](function(_0x5c55b6){var _0x3ad531=_0x5c55b6[0x0]===_0xbad1('0x19')?_0x5c55b6[0x0]:'i.'+_0x5c55b6[0x0];_0x4f1646[_0xbad1('0x17')](_0x3ad531,_0x5c55b6[0x1]===_0xbad1('0x1a')?![]:!![]);if(_0x5c55b6[0x0]===_0xbad1('0x1b')){var _0x3a2cb8=sqlUtils['getClosedOrderClause'](_0x28fa67,_0x7a73c3);_0x4f1646[_0xbad1('0x17')](_0x3a2cb8,_0x5c55b6[0x1]==='DESC'?![]:!![]);}});}return sqlUtils['getFilteredInteractions'](_0x28fa67,_0x4f1646,_0x7a73c3,_0x3c4a6b);})['then'](function(_0x46227c){_0x33c2f8[_0xbad1('0x1c')]=_0x46227c;return _0x33c2f8;})['catch'](function(_0x3db365){throw _0x3db365;});};exports[_0xbad1('0x1d')]=function(_0xe97ae2,_0x3aa729){return function(_0x99ee8d,_0x4c7b57,_0x1b82cb){var _0x1929f=_0x99ee8d[_0xbad1('0xd')];var _0x238bc4={};var _0x381cd5=_0x99ee8d[_0xbad1('0x1e')];if(_0x238bc4){_0x238bc4=_[_0xbad1('0x1f')](_0x99ee8d['body']);_0x238bc4=_['omit'](_0x238bc4,[_0xbad1('0xa'),_0xbad1('0x20'),_0xbad1('0x21'),_0xbad1('0x22'),'mobile']);}utils[_0xbad1('0x23')](_0x1929f,_0x238bc4,_0x381cd5,_0xe97ae2,_0x3aa729);_0x1b82cb(null);};}; \ No newline at end of file +var _0x11b0=['closed','getClosedOrderClause','getFilteredInteractions','rows','catch','tracked','user','query','omit','html','phone','updateUser','lodash','findAll','skipInteractionsQuery','resolve','getInteractionsQuery','then','parseAdvancedSearchFilter','parseQueryParameters','body','where','contact','default','fields','tags','checkAccountsRestrictions','search','ids','tag','countFilteredInteractions','count','length','having','order','forEach','contactName'];(function(_0x309a5e,_0x1ec246){var _0x1d21f1=function(_0x1d902d){while(--_0x1d902d){_0x309a5e['push'](_0x309a5e['shift']());}};_0x1d21f1(++_0x1ec246);}(_0x11b0,0xa0));var _0x011b=function(_0x345711,_0x1a7438){_0x345711=_0x345711-0x0;var _0x3a8554=_0x11b0[_0x345711];return _0x3a8554;};'use strict';var _=require(_0x011b('0x0'));var sqlUtils=require('./sql-utils');var utils=require('./utils');exports[_0x011b('0x1')]=function(_0x10c97f,_0x1a734c,_0x57bc01,_0x3dc024,_0xbeec15){var _0x271136={'count':0x0,'rows':[]};var _0x241a5b=sqlUtils[_0x011b('0x2')](_0x10c97f,_0x57bc01,_0x1a734c);if(_0x241a5b){return Promise[_0x011b('0x3')](_0x271136);}var _0x5a3c20=sqlUtils[_0x011b('0x4')](_0x10c97f);var _0x27d712={};return Promise[_0x011b('0x3')]()[_0x011b('0x5')](function(){if(_0x1a734c['search']){return sqlUtils[_0x011b('0x6')](_0x1a734c['search'],_0xbeec15);}else{return sqlUtils[_0x011b('0x7')](_0x10c97f,_0x1a734c,_0xbeec15);}})[_0x011b('0x5')](function(_0x243d1e){_0x5a3c20['where'](_0x243d1e[_0x011b('0x8')]);_0x5a3c20[_0x011b('0x9')](_0x243d1e[_0x011b('0xa')]);_0x5a3c20[_0x011b('0x9')](_0x243d1e[_0x011b('0xb')]);_0x5a3c20[_0x011b('0x9')](_0x243d1e[_0x011b('0xc')]);_0x5a3c20[_0x011b('0x9')](_0x243d1e['filter']);_0x5a3c20[_0x011b('0x9')](_0x243d1e['user']);_0x5a3c20['having'](_0x243d1e['read']);_0x27d712=_0x243d1e[_0x011b('0xd')];return sqlUtils[_0x011b('0xe')](_0x10c97f,_0x57bc01,_0x1a734c);})[_0x011b('0x5')](function(_0x3c34c4){_0x5a3c20[_0x011b('0x9')](_0x3c34c4);_0x5a3c20['group']('i.id');var _0x3c3277=_0x1a734c[_0x011b('0xf')]?_0x27d712[_0x011b('0x10')]:_0x1a734c[_0x011b('0x11')];return sqlUtils[_0x011b('0x12')](_0x5a3c20,_0x3c3277);})[_0x011b('0x5')](function(_0x1af931){_0x271136[_0x011b('0x13')]=_0x1af931[_0x011b('0x14')];if(_0x271136['count']===0x0){return[];}_0x5a3c20[_0x011b('0x15')](_0x27d712['clause']);if(_0x3dc024['order']){_0x3dc024[_0x011b('0x16')][_0x011b('0x17')](function(_0x57836a){var _0x28af42=_0x57836a[0x0]===_0x011b('0x18')?_0x57836a[0x0]:'i.'+_0x57836a[0x0];_0x5a3c20['order'](_0x28af42,_0x57836a[0x1]==='DESC'?![]:!![]);if(_0x57836a[0x0]===_0x011b('0x19')){var _0x466340=sqlUtils[_0x011b('0x1a')](_0x10c97f,_0x1a734c);_0x5a3c20['order'](_0x466340,_0x57836a[0x1]==='DESC'?![]:!![]);}});}return sqlUtils[_0x011b('0x1b')](_0x10c97f,_0x5a3c20,_0x1a734c,_0x3dc024);})[_0x011b('0x5')](function(_0x4816b6){_0x271136[_0x011b('0x1c')]=_0x4816b6;return _0x271136;})[_0x011b('0x1d')](function(_0x21e85f){throw _0x21e85f;});};exports[_0x011b('0x1e')]=function(_0x59769a,_0x31e58d){return function(_0x53fa73,_0x576f75,_0x4fdf1f){var _0x2af442=_0x53fa73[_0x011b('0x1f')];var _0x426e2f={};var _0x4c5ac8=_0x53fa73[_0x011b('0x20')];if(_0x426e2f){_0x426e2f=_['clone'](_0x53fa73['body']);_0x426e2f=_[_0x011b('0x21')](_0x426e2f,[_0x011b('0x8'),_0x011b('0x22'),_0x011b('0x23'),'fax','mobile']);}utils[_0x011b('0x24')](_0x2af442,_0x426e2f,_0x4c5ac8,_0x59769a,_0x31e58d);_0x4fdf1f(null);};}; \ No newline at end of file diff --git a/server/components/interaction/sql-utils.js b/server/components/interaction/sql-utils.js index 7631304..3a496e7 100644 --- a/server/components/interaction/sql-utils.js +++ b/server/components/interaction/sql-utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x87a2=['start','end','unreadMessages','value','read','and','Contact','operator','$substring','split','contact','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','Tag','tags','clause','ids','User','user','UserId','body','plainBody','compact','concat','createdAt','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','then','tag','filter','get','capitalize','chat','Websites','Accounts','resolve','agent','\x20IS\x20NOT\x20NULL','i.secondDisposition','i.disposition','unshift','closed','i.substatus','shift','join','Interaction','Sequelize','QueryTypes','sequelize','query','toString','keyBy','merge','fields','attributes','Account.key','a.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','i.id','i.updatedAt','i.closed','i.closedAt','i.attach','i.lastMsgAt','i.lastMsgDirection','i.thirdDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','Contact.firstName','Contact.lastName','c.email','Contact.phone','c.mobile','Contact.mobile','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','limit','offset','groupBy','Setting','findOne','enableEmailPreview','all','clone','COUNT(*)','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','getSelectedTags','isEmpty','t.id\x20IN\x20?','SELECT','exports','lodash','squel','../parsers/qs','./update-interaction','updateInteraction','./utils','../../mysqldb','getAccountFK','role','search','select','field','name','color','from','tools_tags','getInteractionFK','ui.','users','u.id\x20=\x20ui.UserId','length','where','\x20IN\x20?','map','getInteractionsTables','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','left_join','accounts','a.id\x20=\x20i.','messages','me.','interactionsTags','it.','\x20=\x20i.id','expr','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','replace','{OPERATOR}','i.id\x20LIKE\x20?','sms','whatsapp','i.phone\x20LIKE\x20?','fax','i.fax\x20LIKE\x20?','openchannel','i.from\x20LIKE\x20?','mail','isEmail','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','parseSearch','sqlOperator','find','type','text'];(function(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0x87a2,0x64));var _0x287a=function(_0x152678,_0x11e0ac){_0x152678=_0x152678-0x0;var _0x311a9=_0x87a2[_0x152678];return _0x311a9;};'use strict';var _=require(_0x287a('0x0'));var squel=require(_0x287a('0x1'));var as=require('../parsers/advancedSearch');var qs=require(_0x287a('0x2'));var updateInteraction=require(_0x287a('0x3'))[_0x287a('0x4')];var utils=require(_0x287a('0x5'));var db=require(_0x287a('0x6'))['db'];function skipInteractionsQuery(_0x26ad1f,_0x473a4f,_0x48c37a){var _0x23e5fa=![];var _0x1fa8b1=utils[_0x287a('0x7')](_0x26ad1f);if(_0x473a4f[_0x287a('0x8')]==='agent'&&!_0x48c37a[_0x287a('0x9')]&&!_0x48c37a[_0x1fa8b1]){_0x23e5fa=!![];}return _0x23e5fa;}function getTagsQuery(){return squel[_0x287a('0xa')]()[_0x287a('0xb')]('id')[_0x287a('0xb')](_0x287a('0xc'))[_0x287a('0xb')](_0x287a('0xd'))[_0x287a('0xe')](_0x287a('0xf'));}function getUsersQuery(_0x176a93,_0x351abd){var _0x72b411=utils[_0x287a('0x10')](_0x176a93);var _0x2d5f35='user_has_'+_0x176a93+'_interactions';var _0x51d934=squel[_0x287a('0xa')]()['field']('u.id')[_0x287a('0xb')]('u.fullname')['field'](_0x287a('0x11')+_0x72b411)[_0x287a('0xe')](_0x2d5f35,'ui')['left_join'](_0x287a('0x12'),'u',_0x287a('0x13'));if(_0x351abd[_0x287a('0x14')]>0x0){_0x51d934[_0x287a('0x15')](_0x287a('0x11')+_0x72b411+_0x287a('0x16'),_[_0x287a('0x17')](_0x351abd,'id'));}return _0x51d934;}function getInteractionsQuery(_0x24d20e){var _0x57174e=utils[_0x287a('0x18')](_0x24d20e);var _0x40a35e=utils[_0x287a('0x7')](_0x24d20e);var _0x1d33ad=utils[_0x287a('0x10')](_0x24d20e);return squel['select']()['from'](_0x57174e['interactions'],'i')['left_join']('cm_contacts','c',_0x287a('0x19'))[_0x287a('0x1a')](_0x287a('0x12'),'o','o.id\x20=\x20i.UserId')[_0x287a('0x1a')](_0x57174e[_0x287a('0x1b')],'a',_0x287a('0x1c')+_0x40a35e)['left_join'](_0x57174e[_0x287a('0x1d')],'me',_0x287a('0x1e')+_0x1d33ad+'\x20=\x20i.id')[_0x287a('0x1a')](_0x57174e[_0x287a('0x1f')],'it',_0x287a('0x20')+_0x1d33ad+_0x287a('0x21'))[_0x287a('0x1a')](_0x287a('0xf'),'t','t.id\x20=\x20it.TagId');}function getSqlClauses(){var _0x103684={'body':squel[_0x287a('0x22')](),'contact':squel[_0x287a('0x22')](),'default':squel[_0x287a('0x22')](),'fields':squel[_0x287a('0x22')](),'filter':squel[_0x287a('0x22')](),'read':squel[_0x287a('0x22')](),'tags':{'clause':squel[_0x287a('0x22')](),'ids':null},'user':squel['expr']()};return _0x103684;}function parseTagParameter(_0x3fa06f){var _0x585f57=squel[_0x287a('0x22')]();if(_0x3fa06f){var _0x45f139=utils['getSelectedTags'](_0x3fa06f);_0x45f139[_0x287a('0x23')](function(_0x129000){_0x585f57['or'](_0x287a('0x24'),'%,'+_0x129000+',%');});}return _0x585f57;}function parseReadParameter(_0x2eabc1){var _0x1cf312='';if(_0x2eabc1){_0x1cf312='unreadMessages\x20{OPERATOR}\x200';if(_0x2eabc1==='1'){_0x1cf312=_0x1cf312[_0x287a('0x25')]('{OPERATOR}','=');}else{_0x1cf312=_0x1cf312[_0x287a('0x25')](_0x287a('0x26'),'>');}}return _0x1cf312;}function parseSearchFilter(_0x689d29,_0xa9cfdf){var _0x591b2c=squel[_0x287a('0x22')]();if(_0xa9cfdf){var _0x183c7b=_0xa9cfdf[_0x287a('0x25')]('\x5c','\x5c\x5c')[_0x287a('0x25')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x183c7b)){_0x591b2c['or'](_0x287a('0x27'),_0x183c7b+'%');if([_0x287a('0x28'),_0x287a('0x29')]['includes'](_0x689d29)){_0x591b2c['or'](_0x287a('0x2a'),_0x183c7b+'%');}else if(_0x689d29===_0x287a('0x2b')){_0x591b2c['or'](_0x287a('0x2c'),_0x183c7b+'%');}else if(_0x689d29===_0x287a('0x2d')){_0x591b2c['or'](_0x287a('0x2e'),_0x183c7b+'%');}}else if(_0x689d29===_0x287a('0x2f')&&qs[_0x287a('0x30')](_0x183c7b)){_0x591b2c['or'](_0x287a('0x31'),_0x183c7b+'%');}else{if(_0x689d29===_0x287a('0x2f')){_0x591b2c['or'](_0x287a('0x32'),qs[_0x287a('0x33')](_0x183c7b,!![]))['or'](_0x287a('0x34'),qs[_0x287a('0x33')](_0x183c7b));}else if(_0x689d29!==_0x287a('0x2b')){_0x591b2c['or'](_0x287a('0x35'),qs[_0x287a('0x33')](_0x183c7b));}_0x591b2c['or'](_0x287a('0x36'),qs[_0x287a('0x33')](_0x183c7b,!![]),null);}}return _0x591b2c;}function parseAdvancedSearchFilter(_0x2ae820,_0x25def3){var _0x3560d9=getSqlClauses();var _0x30ca58=as[_0x287a('0x37')](_0x2ae820);var _0x5c8300=_0x30ca58[_0x287a('0x38')];for(var _0x3550f8=0x0;_0x3550f8<_0x30ca58['conditions'][_0x287a('0x14')];_0x3550f8++){var _0x264245=_0x30ca58['conditions'][_0x3550f8];var _0x4f4d77='i';var _0x437225=_[_0x287a('0x39')](_0x25def3,[_0x287a('0xc'),_0x264245[_0x287a('0xb')]]);if(_0x437225){var _0x20ed22=as['buildExpression'](_0x4f4d77,_0x437225[_0x287a('0x3a')],_0x264245);_0x3560d9['default'][_0x5c8300](_0x20ed22[_0x287a('0x3b')],_0x20ed22['value'][_0x287a('0x3c')],_0x20ed22['value'][_0x287a('0x3d')]);}else{switch(_0x264245[_0x287a('0xb')]){case _0x287a('0x3e'):var _0xc9a255=parseReadParameter(_0x264245[_0x287a('0x3f')]);_0x3560d9[_0x287a('0x40')][_0x287a('0x41')](_0xc9a255);break;case _0x287a('0x42'):if(_0x264245[_0x287a('0x43')]===_0x287a('0x44')){if(_0x264245[_0x287a('0x3f')][_0x287a('0x45')]('\x20')[_0x287a('0x14')]>0x1){_0x3560d9['contact'][_0x5c8300]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x287a('0x33')](_0x264245[_0x287a('0x3f')],!![]),null);}else{var _0x30a3ec='%'+_0x264245[_0x287a('0x3f')]+'%';_0x3560d9[_0x287a('0x46')][_0x5c8300](_0x287a('0x47'),_0x30a3ec,_0x30a3ec,_0x30a3ec);}}else{_0x437225=_[_0x287a('0x39')](_0x25def3,[_0x287a('0xc'),_0x287a('0x48')]);_0x264245[_0x287a('0xb')]=_0x287a('0x48');_0x20ed22=as[_0x287a('0x49')](_0x4f4d77,_0x437225[_0x287a('0x3a')],_0x264245);_0x3560d9[_0x287a('0x46')][_0x5c8300](_0x20ed22[_0x287a('0x3b')],_0x20ed22[_0x287a('0x3f')][_0x287a('0x3c')],_0x20ed22[_0x287a('0x3f')][_0x287a('0x3d')]);}break;case _0x287a('0x4a'):var _0x15323f=_0x264245[_0x287a('0x3f')][_0x287a('0x45')](',')[_0x287a('0x17')](function(_0x477d28){return Number(_0x477d28);});var _0xc9f645=parseTagParameter(_0x15323f);_0x3560d9[_0x287a('0x4b')][_0x287a('0x4c')][_0x287a('0x41')](_0xc9f645);_0x3560d9['tags'][_0x287a('0x4d')]=_0x15323f;break;case _0x287a('0x4e'):if(_0x264245[_0x287a('0x43')]===_0x287a('0x44')){_0x3560d9[_0x287a('0x4f')][_0x5c8300]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x264245[_0x287a('0x3f')]+'%',null);}else{_0x437225=_['find'](_0x25def3,[_0x287a('0xc'),_0x287a('0x50')]);_0x264245[_0x287a('0xb')]=_0x287a('0x50');_0x20ed22=as[_0x287a('0x49')](_0x4f4d77,_0x437225['type'],_0x264245);_0x3560d9[_0x287a('0x4f')][_0x5c8300](_0x20ed22['text'],_0x20ed22[_0x287a('0x3f')][_0x287a('0x3c')],_0x20ed22[_0x287a('0x3f')][_0x287a('0x3d')]);}break;case _0x287a('0x51'):case _0x287a('0x52'):_0x20ed22=as[_0x287a('0x49')]('me',null,_0x264245);_0x3560d9[_0x287a('0x51')][_0x5c8300](_0x20ed22[_0x287a('0x3b')],_0x20ed22['value']['start'],_0x20ed22[_0x287a('0x3f')][_0x287a('0x3d')]);break;}}}return _0x3560d9;}function parseModelFields(_0x354429,_0x1390e2,_0x1a8857){var _0x3fbab7=utils[_0x287a('0x7')](_0x354429);var _0x265c96=squel['expr']();var _0xa39d96=_(_0x1390e2)['keys']()['map'](function(_0x25eb28){return _['some'](_0x1a8857,[_0x287a('0xc'),_0x25eb28])?_0x25eb28:undefined;})[_0x287a('0x53')]()[_0x287a('0x3f')]();if(_0xa39d96[_0x287a('0x14')]>0x0){_0xa39d96[_0x287a('0x23')](function(_0x5bb071){if(_0x5bb071===_0x3fbab7){_0x265c96[_0x287a('0x41')]('i.'+_0x3fbab7+_0x287a('0x16'),[][_0x287a('0x54')](_0x1390e2[_0x5bb071]));}else if(_0x5bb071===_0x287a('0x55')){var _0x1bf799=JSON[_0x287a('0x56')](_0x1390e2[_0x5bb071])[_0x287a('0x57')];var _0x106bbf=JSON[_0x287a('0x56')](_0x1390e2[_0x5bb071])['$lte'];_0x265c96['and'](_0x287a('0x58'),_0x1bf799,_0x106bbf);}else{if(_0x1390e2[_0x5bb071]===_0x287a('0x59')){_0x265c96[_0x287a('0x41')]('i.'+_0x5bb071+'\x20IS\x20NULL');}else{_0x265c96['and']('i.'+_0x5bb071+_0x287a('0x5a'),_0x1390e2[_0x5bb071]);}}});}return _0x265c96;}function parseQueryParameters(_0x3b1868,_0x236c75,_0x341e2e){var _0x13f158=getSqlClauses();return Promise['resolve']()[_0x287a('0x5b')](function(){return parseModelFields(_0x3b1868,_0x236c75,_0x341e2e);})['then'](function(_0x3a1206){_0x13f158['fields'][_0x287a('0x41')](_0x3a1206);return parseReadParameter(_0x236c75[_0x287a('0x40')]);})[_0x287a('0x5b')](function(_0x119cc6){_0x13f158[_0x287a('0x40')][_0x287a('0x41')](_0x119cc6);return parseTagParameter(_0x236c75[_0x287a('0x5c')]);})[_0x287a('0x5b')](function(_0x3f98e2){_0x13f158['tags'][_0x287a('0x4c')]['and'](_0x3f98e2);return parseSearchFilter(_0x3b1868,_0x236c75[_0x287a('0x5d')]);})['then'](function(_0x3b75ce){_0x13f158[_0x287a('0x5d')]=_0x3b75ce;return _0x13f158;});}function checkAccountsRestrictions(_0x24a7c9,_0x1fb707,_0x474bad){var _0x3997c6=utils['getAccountFK'](_0x24a7c9);var _0x150780=_0x287a('0x5e')+_[_0x287a('0x5f')](_0x24a7c9)+(_0x24a7c9===_0x287a('0x60')?_0x287a('0x61'):_0x287a('0x62'));var _0x2ce36a=squel['expr']();return Promise[_0x287a('0x63')]()[_0x287a('0x5b')](function(){if(_0x474bad[_0x287a('0x9')]&&_0x1fb707[_0x287a('0x8')]===_0x287a('0x64')){return _0x1fb707[_0x150780]({'attributes':['id'],'raw':!![]});}})[_0x287a('0x5b')](function(_0x597dbb){if(_0x597dbb){if(_0x597dbb[_0x287a('0x14')]===0x0){_0x2ce36a[_0x287a('0x41')]('i.'+_0x3997c6+'\x20IS\x20NULL');}else{_0x2ce36a['and']('i.'+_0x3997c6+_0x287a('0x16'),_['map'](_0x597dbb,'id'));}}else if(!_0x474bad[_0x3997c6]){_0x2ce36a[_0x287a('0x41')]('i.'+_0x3997c6+_0x287a('0x65'));}})[_0x287a('0x5b')](function(){return _0x2ce36a;});}function getClosedOrderClause(_0x2f0f5c,_0x171f09){var _0x19e851='';var _0x4ccaec=['i.thirdDisposition',_0x287a('0x66'),_0x287a('0x67')];if(_0x2f0f5c===_0x287a('0x2f')){_0x4ccaec[_0x287a('0x68')]('i.substatus');}if(_0x171f09[_0x287a('0x69')]==='0'&&_0x2f0f5c===_0x287a('0x2f')){_0x19e851=_0x287a('0x6a');}else{if(_0x171f09[_0x287a('0x69')]==='1'){_0x4ccaec[_0x287a('0x6b')]();}_0x19e851='CONCAT_WS(\x27\x27,\x20'+_0x4ccaec[_0x287a('0x6c')](',\x20')+')';}return _0x19e851;}function getFilteredInteractions(_0x3b802f,_0x5f2806,_0x5d2909,_0x3c0b44){var _0xc36555=utils[_0x287a('0x10')](_0x3b802f);var _0x35de67=_[_0x287a('0x5f')](_0x3b802f)+_0x287a('0x6d');var _0x29fa41=[];var _0x17f0a6=getTagsQuery();var _0x580af4={'type':db[_0x287a('0x6e')][_0x287a('0x6f')]['SELECT'],'raw':!![]};var _0x2d6dc9=[];var _0x2120ab=[];return db[_0x287a('0x70')][_0x287a('0x71')](_0x17f0a6[_0x287a('0x72')](),_0x580af4)[_0x287a('0x5b')](function(_0x76404b){_0x29fa41=_[_0x287a('0x73')](_0x76404b,'id');_0x580af4=_[_0x287a('0x74')](_0x580af4,{'model':db[_0x35de67],'mapToModel':!![],'nest':!![]});if(_0x5d2909[_0x287a('0x75')]){_0x3c0b44[_0x287a('0x76')][_0x287a('0x23')](function(_0x2197ed){_0x5f2806['field']('i.'+_0x2197ed);});}else{_0x5f2806['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x287a('0x3e'));_0x5f2806[_0x287a('0xb')]('a.key',_0x287a('0x77'));_0x5f2806[_0x287a('0xb')](_0x287a('0x78'),'Account.mandatoryDisposition');if(_0x3b802f===_0x287a('0x2f')){_0x5f2806[_0x287a('0xb')](_0x287a('0x79'),'Account.email');_0x5f2806[_0x287a('0xb')](_0x287a('0x7a'),'contactName');_0x5f2806[_0x287a('0xb')](_0x287a('0x7b'));_0x5f2806['field']('i.createdAt');_0x5f2806['field'](_0x287a('0x7c'));_0x5f2806[_0x287a('0xb')](_0x287a('0x7d'));_0x5f2806['field'](_0x287a('0x7e'));_0x5f2806[_0x287a('0xb')](_0x287a('0x7f'));_0x5f2806[_0x287a('0xb')](_0x287a('0x80'));_0x5f2806[_0x287a('0xb')](_0x287a('0x81'));_0x5f2806[_0x287a('0xb')]('i.subject');_0x5f2806[_0x287a('0xb')]('i.disposition');_0x5f2806[_0x287a('0xb')](_0x287a('0x66'));_0x5f2806[_0x287a('0xb')](_0x287a('0x82'));_0x5f2806[_0x287a('0xb')](_0x287a('0x6a'));_0x5f2806[_0x287a('0xb')]('i.to');_0x5f2806[_0x287a('0xb')]('i.ContactId');_0x5f2806[_0x287a('0xb')]('i.MailAccountId');_0x5f2806[_0x287a('0xb')]('i.UserId');}else if(_0x3b802f===_0x287a('0x2d')){_0x5f2806[_0x287a('0xb')]('CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName');}else{_0x5f2806[_0x287a('0xb')](_0x287a('0x83'),'contactName');}if(_0x3b802f!==_0x287a('0x2f')){_0x5f2806[_0x287a('0xb')]('i.*');}_0x5f2806['field']('c.firstName',_0x287a('0x84'));_0x5f2806['field']('c.lastName',_0x287a('0x85'));_0x5f2806[_0x287a('0xb')](_0x287a('0x86'),'Contact.email');_0x5f2806[_0x287a('0xb')]('c.phone',_0x287a('0x87'));_0x5f2806[_0x287a('0xb')](_0x287a('0x88'),_0x287a('0x89'));_0x5f2806[_0x287a('0xb')]('c.fax',_0x287a('0x8a'));_0x5f2806[_0x287a('0xb')](_0x287a('0x8b'),_0x287a('0x8c'));_0x5f2806['field'](_0x287a('0x8d'),_0x287a('0x8e'));_0x5f2806[_0x287a('0xb')](_0x287a('0x8f'),_0x287a('0x90'));}if(_0x3c0b44[_0x287a('0x91')]){_0x5f2806[_0x287a('0x91')](_0x3c0b44[_0x287a('0x91')]);}if(_0x3c0b44[_0x287a('0x92')]){_0x5f2806[_0x287a('0x92')](_0x3c0b44[_0x287a('0x92')]);}return db['sequelize'][_0x287a('0x71')](_0x5f2806['toString'](),_0x580af4);})[_0x287a('0x5b')](function(_0x33063b){_0x2d6dc9=_0x33063b;var _0x387424=getUsersQuery(_0x3b802f,_0x2d6dc9);return db[_0x287a('0x70')][_0x287a('0x71')](_0x387424[_0x287a('0x72')](),_0x580af4);})[_0x287a('0x5b')](function(_0x25ba3f){_0x2120ab=_[_0x287a('0x93')](_0x25ba3f,_0xc36555);if(_0x3b802f===_0x287a('0x2f')){return db[_0x287a('0x94')][_0x287a('0x95')]({'attributes':[_0x287a('0x96')],'raw':!![]});}})[_0x287a('0x5b')](function(_0x3039c3){var _0x26bed6=_0x3039c3?_0x3039c3[_0x287a('0x96')]:undefined;var _0x13dfb8=_0x2d6dc9['map'](function(_0x39658e){return updateInteraction(_0x39658e,_0x29fa41,_0x2120ab,_0x26bed6);});return Promise[_0x287a('0x97')](_0x13dfb8);});}function countFilteredInteractions(_0x9129dc,_0x470b78){var _0x4e100a=_0x9129dc[_0x287a('0x98')]();_0x4e100a['field'](_0x287a('0x99'));_0x4e100a[_0x287a('0xb')](_0x287a('0x9a'),_0x287a('0x3e'));var _0x47e7c1=utils[_0x287a('0x9b')](_0x470b78);if(!_[_0x287a('0x9c')](_0x47e7c1)){_0x4e100a[_0x287a('0x15')](_0x287a('0x9d'),_0x47e7c1);}var _0x270b69={'type':db[_0x287a('0x6e')][_0x287a('0x6f')][_0x287a('0x9e')],'raw':!![]};return db[_0x287a('0x70')][_0x287a('0x71')](_0x4e100a['toString'](),_0x270b69);}module[_0x287a('0x9f')]={'checkAccountsRestrictions':checkAccountsRestrictions,'countFilteredInteractions':countFilteredInteractions,'getClosedOrderClause':getClosedOrderClause,'getFilteredInteractions':getFilteredInteractions,'getInteractionsQuery':getInteractionsQuery,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipInteractionsQuery':skipInteractionsQuery}; \ No newline at end of file +var _0xc03c=['fax','i.fax\x20LIKE\x20?','openchannel','mail','isEmail','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','parseSearch','sqlOperator','conditions','find','buildExpression','type','value','end','unreadMessages','read','and','Contact','operator','$substring','split','contact','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','text','start','map','tags','clause','ids','User','user','UserId','body','plainBody','keys','some','compact','parse','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','then','fields','tag','filter','capitalize','Websites','Accounts','resolve','\x20IS\x20NOT\x20NULL','i.secondDisposition','i.disposition','closed','i.substatus','CONCAT_WS(\x27\x27,\x20','join','Interaction','Sequelize','QueryTypes','SELECT','sequelize','query','toString','keyBy','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','a.email','Account.email','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20CONCAT(\x27%\x27,\x20a.email,\x20\x27%\x27)\x20THEN\x20TRIM(SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201))\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.createdAt','i.updatedAt','i.closed','i.closedAt','i.attach','i.lastMsgDirection','i.subject','i.thirdDisposition','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','contactName','c.firstName','Contact.lastName','Contact.email','Contact.phone','c.mobile','Contact.mobile','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','limit','offset','groupBy','Setting','findOne','enableEmailPreview','all','clone','COUNT(*)','getSelectedTags','isEmpty','t.id\x20IN\x20?','exports','squel','../parsers/qs','./update-interaction','./utils','../../mysqldb','role','agent','select','field','name','color','tools_tags','getInteractionFK','user_has_','_interactions','u.id','u.fullname','from','left_join','users','u.id\x20=\x20ui.UserId','length','where','ui.','\x20IN\x20?','getInteractionsTables','getAccountFK','interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','accounts','a.id\x20=\x20i.','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','{OPERATOR}','isNumeric','i.id\x20LIKE\x20?','sms','whatsapp','includes','i.phone\x20LIKE\x20?'];(function(_0x1fc122,_0x5e2c17){var _0xa2cb13=function(_0x263b13){while(--_0x263b13){_0x1fc122['push'](_0x1fc122['shift']());}};_0xa2cb13(++_0x5e2c17);}(_0xc03c,0x1c4));var _0xcc03=function(_0x119280,_0x439c3e){_0x119280=_0x119280-0x0;var _0x481797=_0xc03c[_0x119280];return _0x481797;};'use strict';var _=require('lodash');var squel=require(_0xcc03('0x0'));var as=require('../parsers/advancedSearch');var qs=require(_0xcc03('0x1'));var updateInteraction=require(_0xcc03('0x2'))['updateInteraction'];var utils=require(_0xcc03('0x3'));var db=require(_0xcc03('0x4'))['db'];function skipInteractionsQuery(_0x8dc381,_0x80f20,_0x4e6cbf){var _0x550773=![];var _0x19ea42=utils['getAccountFK'](_0x8dc381);if(_0x80f20[_0xcc03('0x5')]===_0xcc03('0x6')&&!_0x4e6cbf['search']&&!_0x4e6cbf[_0x19ea42]){_0x550773=!![];}return _0x550773;}function getTagsQuery(){return squel[_0xcc03('0x7')]()[_0xcc03('0x8')]('id')[_0xcc03('0x8')](_0xcc03('0x9'))[_0xcc03('0x8')](_0xcc03('0xa'))['from'](_0xcc03('0xb'));}function getUsersQuery(_0x4617d6,_0x11bcb3){var _0x4d8035=utils[_0xcc03('0xc')](_0x4617d6);var _0x5b0f60=_0xcc03('0xd')+_0x4617d6+_0xcc03('0xe');var _0x52d2f3=squel[_0xcc03('0x7')]()[_0xcc03('0x8')](_0xcc03('0xf'))[_0xcc03('0x8')](_0xcc03('0x10'))[_0xcc03('0x8')]('ui.'+_0x4d8035)[_0xcc03('0x11')](_0x5b0f60,'ui')[_0xcc03('0x12')](_0xcc03('0x13'),'u',_0xcc03('0x14'));if(_0x11bcb3[_0xcc03('0x15')]>0x0){_0x52d2f3[_0xcc03('0x16')](_0xcc03('0x17')+_0x4d8035+_0xcc03('0x18'),_['map'](_0x11bcb3,'id'));}return _0x52d2f3;}function getInteractionsQuery(_0x11862e){var _0x163d4c=utils[_0xcc03('0x19')](_0x11862e);var _0x3fe066=utils[_0xcc03('0x1a')](_0x11862e);var _0x11b8bd=utils['getInteractionFK'](_0x11862e);return squel[_0xcc03('0x7')]()[_0xcc03('0x11')](_0x163d4c[_0xcc03('0x1b')],'i')[_0xcc03('0x12')](_0xcc03('0x1c'),'c',_0xcc03('0x1d'))['left_join']('users','o',_0xcc03('0x1e'))[_0xcc03('0x12')](_0x163d4c[_0xcc03('0x1f')],'a',_0xcc03('0x20')+_0x3fe066)[_0xcc03('0x12')](_0x163d4c['messages'],'me',_0xcc03('0x21')+_0x11b8bd+_0xcc03('0x22'))[_0xcc03('0x12')](_0x163d4c['interactionsTags'],'it',_0xcc03('0x23')+_0x11b8bd+'\x20=\x20i.id')[_0xcc03('0x12')](_0xcc03('0xb'),'t',_0xcc03('0x24'));}function getSqlClauses(){var _0x26a926={'body':squel[_0xcc03('0x25')](),'contact':squel[_0xcc03('0x25')](),'default':squel[_0xcc03('0x25')](),'fields':squel[_0xcc03('0x25')](),'filter':squel[_0xcc03('0x25')](),'read':squel[_0xcc03('0x25')](),'tags':{'clause':squel[_0xcc03('0x25')](),'ids':null},'user':squel['expr']()};return _0x26a926;}function parseTagParameter(_0x2e4991){var _0x25cd7b=squel[_0xcc03('0x25')]();if(_0x2e4991){var _0x5ba8b1=utils['getSelectedTags'](_0x2e4991);_0x5ba8b1[_0xcc03('0x26')](function(_0x3b39aa){_0x25cd7b['or'](_0xcc03('0x27'),'%,'+_0x3b39aa+',%');});}return _0x25cd7b;}function parseReadParameter(_0x555b11){var _0x5c85ab='';if(_0x555b11){_0x5c85ab=_0xcc03('0x28');if(_0x555b11==='1'){_0x5c85ab=_0x5c85ab[_0xcc03('0x29')]('{OPERATOR}','=');}else{_0x5c85ab=_0x5c85ab['replace'](_0xcc03('0x2a'),'>');}}return _0x5c85ab;}function parseSearchFilter(_0x3b1094,_0x4b47c9){var _0x3712c8=squel[_0xcc03('0x25')]();if(_0x4b47c9){var _0x374178=_0x4b47c9['replace']('\x5c','\x5c\x5c')[_0xcc03('0x29')](/'/g,'\x27\x27');if(qs[_0xcc03('0x2b')](_0x374178)){_0x3712c8['or'](_0xcc03('0x2c'),_0x374178+'%');if([_0xcc03('0x2d'),_0xcc03('0x2e')][_0xcc03('0x2f')](_0x3b1094)){_0x3712c8['or'](_0xcc03('0x30'),_0x374178+'%');}else if(_0x3b1094===_0xcc03('0x31')){_0x3712c8['or'](_0xcc03('0x32'),_0x374178+'%');}else if(_0x3b1094===_0xcc03('0x33')){_0x3712c8['or']('i.from\x20LIKE\x20?',_0x374178+'%');}}else if(_0x3b1094===_0xcc03('0x34')&&qs[_0xcc03('0x35')](_0x374178)){_0x3712c8['or'](_0xcc03('0x36'),_0x374178+'%');}else{if(_0x3b1094==='mail'){_0x3712c8['or'](_0xcc03('0x37'),qs[_0xcc03('0x38')](_0x374178,!![]))['or'](_0xcc03('0x39'),qs[_0xcc03('0x38')](_0x374178));}else if(_0x3b1094!=='fax'){_0x3712c8['or'](_0xcc03('0x3a'),qs[_0xcc03('0x38')](_0x374178));}_0x3712c8['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xcc03('0x38')](_0x374178,!![]),null);}}return _0x3712c8;}function parseAdvancedSearchFilter(_0x1301ad,_0x1f7791){var _0x443796=getSqlClauses();var _0x76b90=as[_0xcc03('0x3b')](_0x1301ad);var _0x617793=_0x76b90[_0xcc03('0x3c')];for(var _0x4237c4=0x0;_0x4237c4<_0x76b90[_0xcc03('0x3d')][_0xcc03('0x15')];_0x4237c4++){var _0x39ada7=_0x76b90['conditions'][_0x4237c4];var _0x5e8c29='i';var _0xf65869=_[_0xcc03('0x3e')](_0x1f7791,[_0xcc03('0x9'),_0x39ada7[_0xcc03('0x8')]]);if(_0xf65869){var _0x3e7a83=as[_0xcc03('0x3f')](_0x5e8c29,_0xf65869[_0xcc03('0x40')],_0x39ada7);_0x443796['default'][_0x617793](_0x3e7a83['text'],_0x3e7a83['value']['start'],_0x3e7a83[_0xcc03('0x41')][_0xcc03('0x42')]);}else{switch(_0x39ada7[_0xcc03('0x8')]){case _0xcc03('0x43'):var _0x4f078a=parseReadParameter(_0x39ada7['value']);_0x443796[_0xcc03('0x44')][_0xcc03('0x45')](_0x4f078a);break;case _0xcc03('0x46'):if(_0x39ada7[_0xcc03('0x47')]===_0xcc03('0x48')){if(_0x39ada7[_0xcc03('0x41')][_0xcc03('0x49')]('\x20')[_0xcc03('0x15')]>0x1){_0x443796[_0xcc03('0x4a')][_0x617793](_0xcc03('0x4b'),qs[_0xcc03('0x38')](_0x39ada7[_0xcc03('0x41')],!![]),null);}else{var _0x2f7b5c='%'+_0x39ada7[_0xcc03('0x41')]+'%';_0x443796[_0xcc03('0x4a')][_0x617793](_0xcc03('0x4c'),_0x2f7b5c,_0x2f7b5c,_0x2f7b5c);}}else{_0xf65869=_[_0xcc03('0x3e')](_0x1f7791,[_0xcc03('0x9'),_0xcc03('0x4d')]);_0x39ada7['field']='ContactId';_0x3e7a83=as[_0xcc03('0x3f')](_0x5e8c29,_0xf65869[_0xcc03('0x40')],_0x39ada7);_0x443796['contact'][_0x617793](_0x3e7a83[_0xcc03('0x4e')],_0x3e7a83[_0xcc03('0x41')][_0xcc03('0x4f')],_0x3e7a83[_0xcc03('0x41')][_0xcc03('0x42')]);}break;case'Tag':var _0x41774a=_0x39ada7['value'][_0xcc03('0x49')](',')[_0xcc03('0x50')](function(_0x18a6e1){return Number(_0x18a6e1);});var _0x91a36a=parseTagParameter(_0x41774a);_0x443796[_0xcc03('0x51')][_0xcc03('0x52')][_0xcc03('0x45')](_0x91a36a);_0x443796[_0xcc03('0x51')][_0xcc03('0x53')]=_0x41774a;break;case _0xcc03('0x54'):if(_0x39ada7[_0xcc03('0x47')]===_0xcc03('0x48')){_0x443796[_0xcc03('0x55')][_0x617793]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x39ada7['value']+'%',null);}else{_0xf65869=_[_0xcc03('0x3e')](_0x1f7791,[_0xcc03('0x9'),_0xcc03('0x56')]);_0x39ada7[_0xcc03('0x8')]=_0xcc03('0x56');_0x3e7a83=as[_0xcc03('0x3f')](_0x5e8c29,_0xf65869[_0xcc03('0x40')],_0x39ada7);_0x443796[_0xcc03('0x55')][_0x617793](_0x3e7a83[_0xcc03('0x4e')],_0x3e7a83[_0xcc03('0x41')][_0xcc03('0x4f')],_0x3e7a83[_0xcc03('0x41')][_0xcc03('0x42')]);}break;case _0xcc03('0x57'):case _0xcc03('0x58'):_0x3e7a83=as['buildExpression']('me',null,_0x39ada7);_0x443796[_0xcc03('0x57')][_0x617793](_0x3e7a83[_0xcc03('0x4e')],_0x3e7a83[_0xcc03('0x41')][_0xcc03('0x4f')],_0x3e7a83[_0xcc03('0x41')]['end']);break;}}}return _0x443796;}function parseModelFields(_0x4483d8,_0x2f3443,_0x547f5b){var _0x3f1707=utils['getAccountFK'](_0x4483d8);var _0xbbd357=squel[_0xcc03('0x25')]();var _0x1e60be=_(_0x2f3443)[_0xcc03('0x59')]()[_0xcc03('0x50')](function(_0x2e736f){return _[_0xcc03('0x5a')](_0x547f5b,[_0xcc03('0x9'),_0x2e736f])?_0x2e736f:undefined;})[_0xcc03('0x5b')]()[_0xcc03('0x41')]();if(_0x1e60be[_0xcc03('0x15')]>0x0){_0x1e60be[_0xcc03('0x26')](function(_0x35c041){if(_0x35c041===_0x3f1707){_0xbbd357['and']('i.'+_0x3f1707+_0xcc03('0x18'),[]['concat'](_0x2f3443[_0x35c041]));}else if(_0x35c041==='createdAt'){var _0x3b264b=JSON['parse'](_0x2f3443[_0x35c041])['$gte'];var _0x2fb87b=JSON[_0xcc03('0x5c')](_0x2f3443[_0x35c041])['$lte'];_0xbbd357['and'](_0xcc03('0x5d'),_0x3b264b,_0x2fb87b);}else{if(_0x2f3443[_0x35c041]===_0xcc03('0x5e')){_0xbbd357[_0xcc03('0x45')]('i.'+_0x35c041+_0xcc03('0x5f'));}else{_0xbbd357[_0xcc03('0x45')]('i.'+_0x35c041+_0xcc03('0x60'),_0x2f3443[_0x35c041]);}}});}return _0xbbd357;}function parseQueryParameters(_0x261b72,_0x2aa59c,_0x1dcd50){var _0x3c0439=getSqlClauses();return Promise['resolve']()[_0xcc03('0x61')](function(){return parseModelFields(_0x261b72,_0x2aa59c,_0x1dcd50);})[_0xcc03('0x61')](function(_0x39b5f6){_0x3c0439[_0xcc03('0x62')]['and'](_0x39b5f6);return parseReadParameter(_0x2aa59c[_0xcc03('0x44')]);})[_0xcc03('0x61')](function(_0x2bac39){_0x3c0439['read'][_0xcc03('0x45')](_0x2bac39);return parseTagParameter(_0x2aa59c[_0xcc03('0x63')]);})['then'](function(_0x304dd8){_0x3c0439[_0xcc03('0x51')]['clause'][_0xcc03('0x45')](_0x304dd8);return parseSearchFilter(_0x261b72,_0x2aa59c[_0xcc03('0x64')]);})[_0xcc03('0x61')](function(_0x2c3577){_0x3c0439[_0xcc03('0x64')]=_0x2c3577;return _0x3c0439;});}function checkAccountsRestrictions(_0x1db611,_0x5c5bff,_0x598784){var _0x5afde3=utils[_0xcc03('0x1a')](_0x1db611);var _0x32707a='get'+_[_0xcc03('0x65')](_0x1db611)+(_0x1db611==='chat'?_0xcc03('0x66'):_0xcc03('0x67'));var _0x1355fc=squel[_0xcc03('0x25')]();return Promise[_0xcc03('0x68')]()[_0xcc03('0x61')](function(){if(_0x598784['search']&&_0x5c5bff[_0xcc03('0x5')]==='agent'){return _0x5c5bff[_0x32707a]({'attributes':['id'],'raw':!![]});}})['then'](function(_0x318b17){if(_0x318b17){if(_0x318b17['length']===0x0){_0x1355fc[_0xcc03('0x45')]('i.'+_0x5afde3+_0xcc03('0x5f'));}else{_0x1355fc[_0xcc03('0x45')]('i.'+_0x5afde3+_0xcc03('0x18'),_[_0xcc03('0x50')](_0x318b17,'id'));}}else if(!_0x598784[_0x5afde3]){_0x1355fc['and']('i.'+_0x5afde3+_0xcc03('0x69'));}})[_0xcc03('0x61')](function(){return _0x1355fc;});}function getClosedOrderClause(_0x1ce06e,_0x1164a1){var _0x256673='';var _0x444e9d=['i.thirdDisposition',_0xcc03('0x6a'),_0xcc03('0x6b')];if(_0x1ce06e===_0xcc03('0x34')){_0x444e9d['unshift']('i.substatus');}if(_0x1164a1[_0xcc03('0x6c')]==='0'&&_0x1ce06e===_0xcc03('0x34')){_0x256673=_0xcc03('0x6d');}else{if(_0x1164a1['closed']==='1'){_0x444e9d['shift']();}_0x256673=_0xcc03('0x6e')+_0x444e9d[_0xcc03('0x6f')](',\x20')+')';}return _0x256673;}function getFilteredInteractions(_0x30d4de,_0x10e2da,_0x346d59,_0x3e5732){var _0x56e98b=utils[_0xcc03('0xc')](_0x30d4de);var _0x2596ed=_[_0xcc03('0x65')](_0x30d4de)+_0xcc03('0x70');var _0x55b4b5=[];var _0x3d5c50=getTagsQuery();var _0x8bdeb3={'type':db[_0xcc03('0x71')][_0xcc03('0x72')][_0xcc03('0x73')],'raw':!![]};var _0x4c6018=[];var _0x455e60=[];return db[_0xcc03('0x74')][_0xcc03('0x75')](_0x3d5c50[_0xcc03('0x76')](),_0x8bdeb3)[_0xcc03('0x61')](function(_0x5e44b1){_0x55b4b5=_[_0xcc03('0x77')](_0x5e44b1,'id');_0x8bdeb3=_[_0xcc03('0x78')](_0x8bdeb3,{'model':db[_0x2596ed],'mapToModel':!![],'nest':!![]});if(_0x346d59['fields']){_0x3e5732['attributes'][_0xcc03('0x26')](function(_0x3527b1){_0x10e2da['field']('i.'+_0x3527b1);});}else{_0x10e2da[_0xcc03('0x8')](_0xcc03('0x79'),_0xcc03('0x43'));_0x10e2da[_0xcc03('0x8')](_0xcc03('0x7a'),_0xcc03('0x7b'));_0x10e2da[_0xcc03('0x8')](_0xcc03('0x7c'),_0xcc03('0x7d'));if(_0x30d4de==='mail'){_0x10e2da[_0xcc03('0x8')](_0xcc03('0x7e'),_0xcc03('0x7f'));_0x10e2da[_0xcc03('0x8')](_0xcc03('0x80'),'contactName');_0x10e2da[_0xcc03('0x8')]('i.id');_0x10e2da['field'](_0xcc03('0x81'));_0x10e2da[_0xcc03('0x8')](_0xcc03('0x82'));_0x10e2da['field'](_0xcc03('0x83'));_0x10e2da['field'](_0xcc03('0x84'));_0x10e2da['field'](_0xcc03('0x85'));_0x10e2da['field']('i.lastMsgAt');_0x10e2da[_0xcc03('0x8')](_0xcc03('0x86'));_0x10e2da[_0xcc03('0x8')](_0xcc03('0x87'));_0x10e2da[_0xcc03('0x8')]('i.disposition');_0x10e2da[_0xcc03('0x8')](_0xcc03('0x6a'));_0x10e2da[_0xcc03('0x8')](_0xcc03('0x88'));_0x10e2da[_0xcc03('0x8')](_0xcc03('0x6d'));_0x10e2da['field']('i.to');_0x10e2da[_0xcc03('0x8')](_0xcc03('0x89'));_0x10e2da[_0xcc03('0x8')](_0xcc03('0x8a'));_0x10e2da['field'](_0xcc03('0x8b'));}else if(_0x30d4de==='openchannel'){_0x10e2da[_0xcc03('0x8')](_0xcc03('0x8c'),_0xcc03('0x8d'));}else{_0x10e2da[_0xcc03('0x8')]('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',_0xcc03('0x8d'));}if(_0x30d4de!==_0xcc03('0x34')){_0x10e2da[_0xcc03('0x8')]('i.*');}_0x10e2da['field'](_0xcc03('0x8e'),'Contact.firstName');_0x10e2da[_0xcc03('0x8')]('c.lastName',_0xcc03('0x8f'));_0x10e2da[_0xcc03('0x8')]('c.email',_0xcc03('0x90'));_0x10e2da[_0xcc03('0x8')]('c.phone',_0xcc03('0x91'));_0x10e2da[_0xcc03('0x8')](_0xcc03('0x92'),_0xcc03('0x93'));_0x10e2da[_0xcc03('0x8')]('c.fax','Contact.fax');_0x10e2da[_0xcc03('0x8')](_0xcc03('0x94'),_0xcc03('0x95'));_0x10e2da[_0xcc03('0x8')](_0xcc03('0x96'),_0xcc03('0x97'));_0x10e2da[_0xcc03('0x8')](_0xcc03('0x98'),_0xcc03('0x99'));}if(_0x3e5732[_0xcc03('0x9a')]){_0x10e2da[_0xcc03('0x9a')](_0x3e5732[_0xcc03('0x9a')]);}if(_0x3e5732[_0xcc03('0x9b')]){_0x10e2da[_0xcc03('0x9b')](_0x3e5732[_0xcc03('0x9b')]);}return db[_0xcc03('0x74')][_0xcc03('0x75')](_0x10e2da['toString'](),_0x8bdeb3);})[_0xcc03('0x61')](function(_0x502a1f){_0x4c6018=_0x502a1f;var _0x556302=getUsersQuery(_0x30d4de,_0x4c6018);return db[_0xcc03('0x74')][_0xcc03('0x75')](_0x556302[_0xcc03('0x76')](),_0x8bdeb3);})[_0xcc03('0x61')](function(_0x3c408a){_0x455e60=_[_0xcc03('0x9c')](_0x3c408a,_0x56e98b);if(_0x30d4de===_0xcc03('0x34')){return db[_0xcc03('0x9d')][_0xcc03('0x9e')]({'attributes':['enableEmailPreview'],'raw':!![]});}})[_0xcc03('0x61')](function(_0x493771){var _0x1ef045=_0x493771?_0x493771[_0xcc03('0x9f')]:undefined;var _0x16287a=_0x4c6018[_0xcc03('0x50')](function(_0x49ed7b){return updateInteraction(_0x49ed7b,_0x55b4b5,_0x455e60,_0x1ef045);});return Promise[_0xcc03('0xa0')](_0x16287a);});}function countFilteredInteractions(_0x26e5c6,_0x301012){var _0x327275=_0x26e5c6[_0xcc03('0xa1')]();_0x327275[_0xcc03('0x8')](_0xcc03('0xa2'));_0x327275[_0xcc03('0x8')](_0xcc03('0x79'),_0xcc03('0x43'));var _0x14da61=utils[_0xcc03('0xa3')](_0x301012);if(!_[_0xcc03('0xa4')](_0x14da61)){_0x327275[_0xcc03('0x16')](_0xcc03('0xa5'),_0x14da61);}var _0x581d58={'type':db[_0xcc03('0x71')][_0xcc03('0x72')][_0xcc03('0x73')],'raw':!![]};return db['sequelize']['query'](_0x327275[_0xcc03('0x76')](),_0x581d58);}module[_0xcc03('0xa6')]={'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 95cc940..000c060 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 _0x62f1=['then','lastMsgText','trimStart','catch','updateInteraction','Users','TagIds','Tags','lodash','../../mysqldb','map','split','forEach','push','waiting','talking','answered','unmanaged','abandoned','total','closed','disposition','UserId','MailMessage','findOne','out','plainBody'];(function(_0x38ff4d,_0x6ef55b){var _0x2e5488=function(_0xd5f321){while(--_0xd5f321){_0x38ff4d['push'](_0x38ff4d['shift']());}};_0x2e5488(++_0x6ef55b);}(_0x62f1,0x131));var _0x162f=function(_0x31a137,_0x45d1a5){_0x31a137=_0x31a137-0x0;var _0x1e8017=_0x62f1[_0x31a137];return _0x1e8017;};'use strict';var _=require(_0x162f('0x0'));var db=require(_0x162f('0x1'))['db'];function getInteractionUsers(_0x3392e6,_0x5bf141){return new Promise(function(_0x53e5c2,_0x1642d8){try{var _0x56e697=[];if(_0x5bf141[_0x3392e6]){_0x56e697=_0x5bf141[_0x3392e6][_0x162f('0x2')](function(_0x7d7202){return{'id':_0x7d7202['id'],'fullname':_0x7d7202['fullname']};});}return _0x53e5c2(_0x56e697);}catch(_0x5437c0){_0x1642d8(_0x5437c0);}});}function getInteractionTags(_0x3fe838,_0x242ee6){var _0x1a2cde=[];if(_0x3fe838){_0x3fe838[_0x162f('0x3')](',')[_0x162f('0x4')](function(_0x70c948){_0x1a2cde[_0x162f('0x5')](_0x242ee6[_0x70c948]);});}return _0x1a2cde;}function updateWaitingCounter(_0x196e99){if(_0x196e99[_0x162f('0x6')]){_0x196e99['waiting']-=0x1;}}function updateInteractionCounters(_0xe54136){_0xe54136[_0x162f('0x6')]=0x0;_0xe54136[_0x162f('0x7')]=0x0;_0xe54136[_0x162f('0x8')]=0x0;_0xe54136[_0x162f('0x9')]=0x0;_0xe54136[_0x162f('0xa')]=0x0;_0xe54136[_0x162f('0xb')]=0x0;if(_0xe54136[_0x162f('0xc')]){if(_0xe54136[_0x162f('0xd')]===_0x162f('0xa')){_0xe54136[_0x162f('0xa')]+=0x1;updateWaitingCounter(_0xe54136);}if(_0xe54136[_0x162f('0xe')]){_0xe54136['answered']+=0x1;if(_0xe54136[_0x162f('0x7')]){_0xe54136[_0x162f('0x7')]-=0x1;}}else{if(_0xe54136['disposition']){_0xe54136['unmanaged']+=0x1;updateWaitingCounter(_0xe54136);}}}else{if(!_0xe54136[_0x162f('0xe')]){_0xe54136[_0x162f('0x6')]+=0x1;}if(_0xe54136[_0x162f('0xe')]){_0xe54136['talking']+=0x1;updateWaitingCounter(_0xe54136);}}_0xe54136[_0x162f('0xb')]+=0x1;return _0xe54136;}function getLastMessageText(_0x163c0d){return db[_0x162f('0xf')][_0x162f('0x10')]({'where':{'$and':[{'MailInteractionId':_0x163c0d['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x162f('0x11')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x162f('0x12')],'order':'-id','raw':!![]})[_0x162f('0x13')](function(_0x520697){if(_0x520697&&_0x520697[_0x162f('0x12')]){_0x163c0d[_0x162f('0x14')]=_[_0x162f('0x15')](_0x520697['plainBody']);}return _0x163c0d;})[_0x162f('0x16')](function(_0xf6a448){throw _0xf6a448;});}exports[_0x162f('0x17')]=function(_0x4087ab,_0x42e4f1,_0x27cdb5,_0x7d0877){return new Promise(function(_0x41caa9,_0xb2bbee){return getInteractionUsers(_0x4087ab['id'],_0x27cdb5)[_0x162f('0x13')](function(_0x31eea7){_0x4087ab[_0x162f('0x18')]=_0x31eea7;return getInteractionTags(_0x4087ab[_0x162f('0x19')],_0x42e4f1);})[_0x162f('0x13')](function(_0x45c557){_0x4087ab[_0x162f('0x1a')]=_0x45c557;delete _0x4087ab['TagIds'];return updateInteractionCounters(_0x4087ab);})[_0x162f('0x13')](function(_0x37832b){if(_0x7d0877){return getLastMessageText(_0x37832b);}else{return _0x37832b;}})[_0x162f('0x13')](function(_0x11c68d){_0x41caa9(_0x11c68d);})[_0x162f('0x16')](function(_0x632f8c){_0xb2bbee(_0x632f8c);});});}; \ No newline at end of file +var _0x4e78=['disposition','UserId','talking','unmanaged','MailMessage','findOne','out','plainBody','-id','then','lastMsgText','trimStart','catch','updateInteraction','Users','TagIds','../../mysqldb','map','fullname','split','forEach','push','waiting','answered','abandoned','total','closed'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x4e78,0x139));var _0x84e7=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x4e78[_0x46e363];return _0x3fb059;};'use strict';var _=require('lodash');var db=require(_0x84e7('0x0'))['db'];function getInteractionUsers(_0x2057ed,_0x380dc4){return new Promise(function(_0x514a18,_0x3120bb){try{var _0x38a058=[];if(_0x380dc4[_0x2057ed]){_0x38a058=_0x380dc4[_0x2057ed][_0x84e7('0x1')](function(_0x3800c9){return{'id':_0x3800c9['id'],'fullname':_0x3800c9[_0x84e7('0x2')]};});}return _0x514a18(_0x38a058);}catch(_0xd2c41){_0x3120bb(_0xd2c41);}});}function getInteractionTags(_0x1cda0e,_0x3fd6d5){var _0xd92c07=[];if(_0x1cda0e){_0x1cda0e[_0x84e7('0x3')](',')[_0x84e7('0x4')](function(_0x4d97cb){_0xd92c07[_0x84e7('0x5')](_0x3fd6d5[_0x4d97cb]);});}return _0xd92c07;}function updateWaitingCounter(_0x178e23){if(_0x178e23['waiting']){_0x178e23[_0x84e7('0x6')]-=0x1;}}function updateInteractionCounters(_0x4deb72){_0x4deb72[_0x84e7('0x6')]=0x0;_0x4deb72['talking']=0x0;_0x4deb72[_0x84e7('0x7')]=0x0;_0x4deb72['unmanaged']=0x0;_0x4deb72[_0x84e7('0x8')]=0x0;_0x4deb72[_0x84e7('0x9')]=0x0;if(_0x4deb72[_0x84e7('0xa')]){if(_0x4deb72[_0x84e7('0xb')]===_0x84e7('0x8')){_0x4deb72['abandoned']+=0x1;updateWaitingCounter(_0x4deb72);}if(_0x4deb72[_0x84e7('0xc')]){_0x4deb72[_0x84e7('0x7')]+=0x1;if(_0x4deb72[_0x84e7('0xd')]){_0x4deb72[_0x84e7('0xd')]-=0x1;}}else{if(_0x4deb72[_0x84e7('0xb')]){_0x4deb72[_0x84e7('0xe')]+=0x1;updateWaitingCounter(_0x4deb72);}}}else{if(!_0x4deb72[_0x84e7('0xc')]){_0x4deb72[_0x84e7('0x6')]+=0x1;}if(_0x4deb72['UserId']){_0x4deb72['talking']+=0x1;updateWaitingCounter(_0x4deb72);}}_0x4deb72[_0x84e7('0x9')]+=0x1;return _0x4deb72;}function getLastMessageText(_0x2e997b){return db[_0x84e7('0xf')][_0x84e7('0x10')]({'where':{'$and':[{'MailInteractionId':_0x2e997b['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x84e7('0x11')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x84e7('0x12')],'order':_0x84e7('0x13'),'raw':!![]})[_0x84e7('0x14')](function(_0x56b79f){if(_0x56b79f&&_0x56b79f[_0x84e7('0x12')]){_0x2e997b[_0x84e7('0x15')]=_[_0x84e7('0x16')](_0x56b79f[_0x84e7('0x12')]);}return _0x2e997b;})[_0x84e7('0x17')](function(_0xfa3ba3){throw _0xfa3ba3;});}exports[_0x84e7('0x18')]=function(_0x6bc059,_0x3cc541,_0x56e25b,_0x1de2d6){return new Promise(function(_0x476984,_0x22cab9){return getInteractionUsers(_0x6bc059['id'],_0x56e25b)['then'](function(_0x17986f){_0x6bc059[_0x84e7('0x19')]=_0x17986f;return getInteractionTags(_0x6bc059[_0x84e7('0x1a')],_0x3cc541);})[_0x84e7('0x14')](function(_0x419b5f){_0x6bc059['Tags']=_0x419b5f;delete _0x6bc059[_0x84e7('0x1a')];return updateInteractionCounters(_0x6bc059);})[_0x84e7('0x14')](function(_0x115013){if(_0x1de2d6){return getLastMessageText(_0x115013);}else{return _0x115013;}})[_0x84e7('0x14')](function(_0x1a0682){_0x476984(_0x1a0682);})[_0x84e7('0x17')](function(_0x19b9f1){_0x22cab9(_0x19b9f1);});});}; \ No newline at end of file diff --git a/server/components/interaction/utils.js b/server/components/interaction/utils.js index ba4317d..11c1d0a 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 _0x6bdf=['lodash','../../mysqldb','../../config/logger','openchannel-interactions','mail-interactions','fax-interactions','sms-interactions','chat-interactions','whatsapp-interactions','capitalize','chat','Account','InteractionId','upperFirst','unknown','websites','accounts','_interaction_has_tags','_messages','user_has_','_interactions','isArray','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','name','role','stringify','null','Interaction','then','info','catch','error','exports'];(function(_0x178740,_0x1bf75d){var _0x4aa7bd=function(_0x47df96){while(--_0x47df96){_0x178740['push'](_0x178740['shift']());}};_0x4aa7bd(++_0x1bf75d);}(_0x6bdf,0x88));var _0xf6bd=function(_0x51fe5f,_0x1d8632){_0x51fe5f=_0x51fe5f-0x0;var _0x4abce9=_0x6bdf[_0x51fe5f];return _0x4abce9;};'use strict';var _=require(_0xf6bd('0x0'));var db=require(_0xf6bd('0x1'))['db'];var loggers={'openchannel':require(_0xf6bd('0x2'))(_0xf6bd('0x3')),'mail':require(_0xf6bd('0x2'))(_0xf6bd('0x4')),'fax':require(_0xf6bd('0x2'))(_0xf6bd('0x5')),'sms':require(_0xf6bd('0x2'))(_0xf6bd('0x6')),'chat':require('../../config/logger')(_0xf6bd('0x7')),'whatsapp':require('../../config/logger')(_0xf6bd('0x8'))};function getAccountFK(_0x21d8ba){return _[_0xf6bd('0x9')](_0x21d8ba)+(_0x21d8ba===_0xf6bd('0xa')?'Website':_0xf6bd('0xb'))+'Id';}function getInteractionFK(_0x44c73b){return _[_0xf6bd('0x9')](_0x44c73b)+_0xf6bd('0xc');}function getInteractionId(_0x5c10b8,_0x3a9a37,_0x47da0c){if(_0x5c10b8&&_0x5c10b8[_[_0xf6bd('0xd')](_0x47da0c)+_0xf6bd('0xc')]){return _0x5c10b8[_[_0xf6bd('0xd')](_0x47da0c)+'InteractionId'];}else if(_0x5c10b8&&_0x5c10b8['id']){return _0x5c10b8['id'];}else if(_0x3a9a37&&_0x3a9a37['id']){return _0x3a9a37['id'];}else{return _0xf6bd('0xe');}}function getInteractionsTables(_0x29ddfe){return{'accounts':_0x29ddfe+'_'+(_0x29ddfe===_0xf6bd('0xa')?_0xf6bd('0xf'):_0xf6bd('0x10')),'interactions':_0x29ddfe+'_interactions','interactionsTags':_0x29ddfe+_0xf6bd('0x11'),'messages':_0x29ddfe+_0xf6bd('0x12'),'userInteractions':_0xf6bd('0x13')+_0x29ddfe+_0xf6bd('0x14')};}function getSelectedTags(_0x342009){var _0x34868e=[];if(_0x342009){_0x34868e=Array[_0xf6bd('0x15')](_0x342009)?_0x342009:[_0x342009];}return _0x34868e;}function log(_0x1ea60d,_0x3559ed,_0x1a7d59,_0x1effb0,_0x5edf99,_0x10acbc){loggers[_0x5edf99[_0xf6bd('0x16')]()][_0x1ea60d](_0xf6bd('0x17'),_0x10acbc['toUpperCase'](),_0x3559ed?_0x3559ed['id']:null,_0x3559ed?_0x3559ed[_0xf6bd('0x18')]:null,_0x3559ed?_0x3559ed[_0xf6bd('0x19')]:null,getInteractionId(_0x1a7d59,_0x1effb0,_0x5edf99),_0x1a7d59?JSON[_0xf6bd('0x1a')](_0x1a7d59):_0xf6bd('0x1b'));}function updateUser(_0x54a5bf,_0x48ce26,_0x2d97a5,_0x3479b2,_0x5761ab){db[_[_0xf6bd('0xd')](_0x3479b2)+_0xf6bd('0x1c')]['findOne']({'where':{'id':getInteractionId(_0x48ce26,_0x2d97a5,_0x3479b2)}})[_0xf6bd('0x1d')](function(_0x2045d3){if(_0x2045d3){return _0x2045d3['update']({'UserId':_0x54a5bf?_0x54a5bf['id']:null});}})[_0xf6bd('0x1d')](function(_0x1effcd){if(_0x1effcd){log(_0xf6bd('0x1e'),_0x54a5bf,_0x48ce26,_0x2d97a5,_0x3479b2,_0x5761ab);}})[_0xf6bd('0x1f')](function(){log(_0xf6bd('0x20'),_0x54a5bf,_0x48ce26,_0x2d97a5,_0x3479b2,_0x5761ab);});}module[_0xf6bd('0x21')]={'getAccountFK':getAccountFK,'getInteractionFK':getInteractionFK,'getInteractionsTables':getInteractionsTables,'getSelectedTags':getSelectedTags,'updateUser':updateUser}; \ No newline at end of file +var _0x67d8=['websites','_interactions','_interaction_has_tags','user_has_','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','name','role','stringify','null','findOne','then','update','info','catch','error','exports','lodash','../../mysqldb','../../config/logger','mail-interactions','sms-interactions','chat-interactions','whatsapp-interactions','capitalize','Website','Account','InteractionId','upperFirst','unknown','chat'];(function(_0x4e6ae6,_0x49dba6){var _0x23c108=function(_0x1bc103){while(--_0x1bc103){_0x4e6ae6['push'](_0x4e6ae6['shift']());}};_0x23c108(++_0x49dba6);}(_0x67d8,0x109));var _0x867d=function(_0x2267ee,_0x2eabf){_0x2267ee=_0x2267ee-0x0;var _0xdf3559=_0x67d8[_0x2267ee];return _0xdf3559;};'use strict';var _=require(_0x867d('0x0'));var db=require(_0x867d('0x1'))['db'];var loggers={'openchannel':require(_0x867d('0x2'))('openchannel-interactions'),'mail':require('../../config/logger')(_0x867d('0x3')),'fax':require(_0x867d('0x2'))('fax-interactions'),'sms':require('../../config/logger')(_0x867d('0x4')),'chat':require(_0x867d('0x2'))(_0x867d('0x5')),'whatsapp':require('../../config/logger')(_0x867d('0x6'))};function getAccountFK(_0x3fb6ac){return _[_0x867d('0x7')](_0x3fb6ac)+(_0x3fb6ac==='chat'?_0x867d('0x8'):_0x867d('0x9'))+'Id';}function getInteractionFK(_0x2d9d30){return _[_0x867d('0x7')](_0x2d9d30)+_0x867d('0xa');}function getInteractionId(_0x30ec1d,_0x18d816,_0x4413f4){if(_0x30ec1d&&_0x30ec1d[_[_0x867d('0xb')](_0x4413f4)+_0x867d('0xa')]){return _0x30ec1d[_[_0x867d('0xb')](_0x4413f4)+_0x867d('0xa')];}else if(_0x30ec1d&&_0x30ec1d['id']){return _0x30ec1d['id'];}else if(_0x18d816&&_0x18d816['id']){return _0x18d816['id'];}else{return _0x867d('0xc');}}function getInteractionsTables(_0x5d9b4e){return{'accounts':_0x5d9b4e+'_'+(_0x5d9b4e===_0x867d('0xd')?_0x867d('0xe'):'accounts'),'interactions':_0x5d9b4e+_0x867d('0xf'),'interactionsTags':_0x5d9b4e+_0x867d('0x10'),'messages':_0x5d9b4e+'_messages','userInteractions':_0x867d('0x11')+_0x5d9b4e+_0x867d('0xf')};}function getSelectedTags(_0x37bc71){var _0x2df76b=[];if(_0x37bc71){_0x2df76b=Array['isArray'](_0x37bc71)?_0x37bc71:[_0x37bc71];}return _0x2df76b;}function log(_0x48d77e,_0x943165,_0x575b99,_0xadff43,_0x2b5423,_0x19b5af){loggers[_0x2b5423[_0x867d('0x12')]()][_0x48d77e](_0x867d('0x13'),_0x19b5af['toUpperCase'](),_0x943165?_0x943165['id']:null,_0x943165?_0x943165[_0x867d('0x14')]:null,_0x943165?_0x943165[_0x867d('0x15')]:null,getInteractionId(_0x575b99,_0xadff43,_0x2b5423),_0x575b99?JSON[_0x867d('0x16')](_0x575b99):_0x867d('0x17'));}function updateUser(_0x3d9c79,_0x5463b2,_0x4fbe3e,_0x43e95b,_0x513b5e){db[_['upperFirst'](_0x43e95b)+'Interaction'][_0x867d('0x18')]({'where':{'id':getInteractionId(_0x5463b2,_0x4fbe3e,_0x43e95b)}})[_0x867d('0x19')](function(_0x3f468d){if(_0x3f468d){return _0x3f468d[_0x867d('0x1a')]({'UserId':_0x3d9c79?_0x3d9c79['id']:null});}})[_0x867d('0x19')](function(_0x2e9dc8){if(_0x2e9dc8){log(_0x867d('0x1b'),_0x3d9c79,_0x5463b2,_0x4fbe3e,_0x43e95b,_0x513b5e);}})[_0x867d('0x1c')](function(){log(_0x867d('0x1d'),_0x3d9c79,_0x5463b2,_0x4fbe3e,_0x43e95b,_0x513b5e);});}module[_0x867d('0x1e')]={'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 7e72def..40d8eda 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 _0xdeb7=['License','findOne','then','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','users','User','isUserLimit','crypto','util','composable-middleware','../../mysqldb','data1','license','aes-256-ctr','format','%s:%s:%s','base64','utf8','final','parse','hasOwnProperty','use'];(function(_0x1ed116,_0x23bc80){var _0x574066=function(_0x424f9e){while(--_0x424f9e){_0x1ed116['push'](_0x1ed116['shift']());}};_0x574066(++_0x23bc80);}(_0xdeb7,0xb1));var _0x7deb=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xdeb7[_0x2641f9];return _0x585741;};'use strict';var crypto=require(_0x7deb('0x0'));var util=require(_0x7deb('0x1'));var compose=require(_0x7deb('0x2'));var db=require(_0x7deb('0x3'))['db'];var config=require('../../config/environment');function getValueFromLicense(_0x934a19,_0x3cae79){if(_0x934a19&&_0x3cae79){if(_0x3cae79[_0x7deb('0x4')]&&_0x3cae79[_0x7deb('0x5')]){var _0x40cf4a=_0x3cae79['data1'];var _0x2c4360=_0x3cae79[_0x7deb('0x5')];var _0x407c52=_0x40cf4a['split']('-')[0x4];var _0x3b8b87=_0x40cf4a['split']('-')[0x0];var _0x56baf4=crypto['createDecipher'](_0x7deb('0x6'),util[_0x7deb('0x7')](_0x7deb('0x8'),_0x407c52,_0x40cf4a,_0x3b8b87));var _0x4e33b7=_0x56baf4['update'](_0x2c4360,_0x7deb('0x9'),_0x7deb('0xa'));_0x4e33b7+=_0x56baf4[_0x7deb('0xb')](_0x7deb('0xa'));var _0x58d5fd=JSON[_0x7deb('0xc')](_0x4e33b7);return _0x58d5fd[_0x7deb('0xd')](_0x934a19)?_0x58d5fd[_0x934a19]:null;}}return null;}function isLimit(_0x3ddb52,_0x27fa3f,_0x2b3b6d,_0x3ff2c0){var _0x545058=_0x27fa3f;return compose()[_0x7deb('0xe')](function(_0x44c12e,_0x3120fb,_0x4a42f5){return db[_0x7deb('0xf')][_0x7deb('0x10')]({'where':{'id':0x1},'raw':!![]})['then'](function(_0xb53842){var _0xd40575=getValueFromLicense(_0x3ddb52,_0xb53842);return _0xd40575?_0xd40575:_0x545058;})[_0x7deb('0x11')](function(_0xaf069e){_0x545058=_0xaf069e;return _0x2b3b6d['count'](_0x3ff2c0);})[_0x7deb('0x11')](function(_0x1042b5){if(_0x1042b5>=_0x545058){return _0x3120fb[_0x7deb('0x12')](0x193)[_0x7deb('0x13')]({'message':util[_0x7deb('0x7')](_0x7deb('0x14'),_0x3ddb52)});}_0x4a42f5();})['catch'](function(_0x3f40ca){_0x4a42f5(_0x3f40ca);});});}function isUserLimit(){return isLimit(_0x7deb('0x15'),0x1,db[_0x7deb('0x16')],{'where':{'$or':[{'role':'admin'},{'role':'user'}]}});}exports[_0x7deb('0x17')]=isUserLimit; \ No newline at end of file +var _0xaa54=['format','%s:%s:%s','update','base64','utf8','final','parse','hasOwnProperty','License','findOne','then','count','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','User','admin','user','isUserLimit','composable-middleware','../../config/environment','license','data1','split','aes-256-ctr'];(function(_0x472166,_0x4d08e8){var _0x11f0ba=function(_0x4ec411){while(--_0x4ec411){_0x472166['push'](_0x472166['shift']());}};_0x11f0ba(++_0x4d08e8);}(_0xaa54,0xb7));var _0x4aa5=function(_0xe73080,_0x24c56d){_0xe73080=_0xe73080-0x0;var _0x12cbc4=_0xaa54[_0xe73080];return _0x12cbc4;};'use strict';var crypto=require('crypto');var util=require('util');var compose=require(_0x4aa5('0x0'));var db=require('../../mysqldb')['db'];var config=require(_0x4aa5('0x1'));function getValueFromLicense(_0x183705,_0xdce8c3){if(_0x183705&&_0xdce8c3){if(_0xdce8c3['data1']&&_0xdce8c3[_0x4aa5('0x2')]){var _0x54d652=_0xdce8c3[_0x4aa5('0x3')];var _0x222eb9=_0xdce8c3[_0x4aa5('0x2')];var _0x2ee085=_0x54d652[_0x4aa5('0x4')]('-')[0x4];var _0x4e5c65=_0x54d652['split']('-')[0x0];var _0x56a15d=crypto['createDecipher'](_0x4aa5('0x5'),util[_0x4aa5('0x6')](_0x4aa5('0x7'),_0x2ee085,_0x54d652,_0x4e5c65));var _0x3b241f=_0x56a15d[_0x4aa5('0x8')](_0x222eb9,_0x4aa5('0x9'),_0x4aa5('0xa'));_0x3b241f+=_0x56a15d[_0x4aa5('0xb')](_0x4aa5('0xa'));var _0x56df36=JSON[_0x4aa5('0xc')](_0x3b241f);return _0x56df36[_0x4aa5('0xd')](_0x183705)?_0x56df36[_0x183705]:null;}}return null;}function isLimit(_0x4d5a14,_0x11b291,_0x1cf02e,_0x1d6112){var _0x220d75=_0x11b291;return compose()['use'](function(_0x2009e8,_0x454950,_0x5f099f){return db[_0x4aa5('0xe')][_0x4aa5('0xf')]({'where':{'id':0x1},'raw':!![]})[_0x4aa5('0x10')](function(_0x1fe18f){var _0x2630a0=getValueFromLicense(_0x4d5a14,_0x1fe18f);return _0x2630a0?_0x2630a0:_0x220d75;})['then'](function(_0x59d2fb){_0x220d75=_0x59d2fb;return _0x1cf02e[_0x4aa5('0x11')](_0x1d6112);})[_0x4aa5('0x10')](function(_0xf7c8c4){if(_0xf7c8c4>=_0x220d75){return _0x454950[_0x4aa5('0x12')](0x193)[_0x4aa5('0x13')]({'message':util['format'](_0x4aa5('0x14'),_0x4d5a14)});}_0x5f099f();})[_0x4aa5('0x15')](function(_0x485a35){_0x5f099f(_0x485a35);});});}function isUserLimit(){return isLimit(_0x4aa5('0x16'),0x1,db[_0x4aa5('0x17')],{'where':{'$or':[{'role':_0x4aa5('0x18')},{'role':_0x4aa5('0x19')}]}});}exports[_0x4aa5('0x1a')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index 4e8c7cf..5e1fd14 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 _0xf738=['$gte','BETWEEN\x20?\x20AND\x20?','start','$between','shift','pop','utcOffset','add','hours','minutes','seconds','lodash','moment','parseSearch','sqlOperator','[$or]','and','replace','length','split','forEach','match','filter','indexOf','map','conditions','push','buildExpression','DATE','$eq','operator','value','$gt','$lte','days','YYYY-MM-DD','castTo','text','field','$ne','\x20OR\x20','\x20IS\x20NULL)','$in','$notIn','=\x20?','$substring','$startsWith','LIKE\x20?','$lt','<\x20?','<=\x20?'];(function(_0x4391aa,_0x45396c){var _0x1dbef1=function(_0x102854){while(--_0x102854){_0x4391aa['push'](_0x4391aa['shift']());}};_0x1dbef1(++_0x45396c);}(_0xf738,0x10a));var _0x8f73=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xf738[_0x297fd3];return _0x2af381;};'use strict';var _=require(_0x8f73('0x0'));var moment=require(_0x8f73('0x1'));exports[_0x8f73('0x2')]=function(_0x12aba7){var _0x482e49={'conditions':[]};_0x482e49[_0x8f73('0x3')]=_['startsWith'](_0x12aba7,_0x8f73('0x4'))?'or':_0x8f73('0x5');var _0x51938d=_0x12aba7['replace']('[$and]','')[_0x8f73('0x6')](_0x8f73('0x4'),'')['split']('||');for(var _0x19ea46=0x0;_0x19ea46<_0x51938d[_0x8f73('0x7')];_0x19ea46++){var _0x5d74d1=_0x51938d[_0x19ea46][_0x8f73('0x8')](':=');var _0x54bfb5=_0x5d74d1[0x0];var _0x5a1710=_0x5d74d1['slice'](0x1);_0x5a1710[_0x8f73('0x9')](function(_0x113929){var _0x35420b=_0x113929[_0x8f73('0x8')]('[')['shift']();var _0x42f538=_0x113929[_0x8f73('0xa')](/\[(.*?)\]/g);_0x42f538[_0x8f73('0x9')](function(_0x17c879){var _0x32e241=_0x17c879['split']('[')[_0x8f73('0xb')](function(_0x1c4c0c){return _0x1c4c0c[_0x8f73('0xc')](']')>-0x1;})[_0x8f73('0xd')](function(_0x33c936){return _0x33c936[_0x8f73('0x8')](']')[0x0];})[0x0];_0x482e49[_0x8f73('0xe')][_0x8f73('0xf')]({'field':_0x54bfb5,'operator':_0x35420b,'value':_0x32e241});});});}return _0x482e49;};exports[_0x8f73('0x10')]=function(_0x16fd4c,_0x20f6a2,_0x145fd8){var _0x244682={};if(_0x20f6a2===_0x8f73('0x11')){if(_0x145fd8['operator']===_0x8f73('0x12')){_0x145fd8[_0x8f73('0x13')]='$between';_0x145fd8[_0x8f73('0x14')]+=','+_0x145fd8[_0x8f73('0x14')];}else if(_['includes']([_0x8f73('0x15'),_0x8f73('0x16')],_0x145fd8[_0x8f73('0x13')])){_0x145fd8[_0x8f73('0x14')]=moment(_0x145fd8[_0x8f73('0x14')])['add'](0x1,_0x8f73('0x17'))['format'](_0x8f73('0x18'));}}if(_0x145fd8[_0x8f73('0x19')]){_0x20f6a2=_0x145fd8[_0x8f73('0x19')];_0x244682[_0x8f73('0x1a')]='CAST('+_0x16fd4c+'.'+_0x145fd8[_0x8f73('0x1b')]+'\x20AS\x20'+_0x145fd8['castTo']+')\x20'+parseOperator(_0x145fd8['operator']);}else{_0x244682[_0x8f73('0x1a')]=_0x16fd4c+'.'+_0x145fd8[_0x8f73('0x1b')]+'\x20'+parseOperator(_0x145fd8[_0x8f73('0x13')]);}if(_['includes']([_0x8f73('0x1c'),'$notIn'],_0x145fd8['operator']))_0x244682[_0x8f73('0x1a')]='('+_0x244682['text']+_0x8f73('0x1d')+_0x16fd4c+'.'+_0x145fd8['field']+_0x8f73('0x1e');_0x244682[_0x8f73('0x14')]=parseValue(_0x20f6a2,_0x145fd8[_0x8f73('0x13')],_0x145fd8[_0x8f73('0x14')]);return _0x244682;};function parseOperator(_0x2600e4){var _0x331f97;switch(_0x2600e4){case _0x8f73('0x1f'):_0x331f97='IN\x20?';break;case _0x8f73('0x20'):_0x331f97='NOT\x20IN\x20?';break;case _0x8f73('0x12'):_0x331f97=_0x8f73('0x21');break;case _0x8f73('0x1c'):_0x331f97='<>\x20?';break;case _0x8f73('0x22'):case _0x8f73('0x23'):case'$endsWith':_0x331f97=_0x8f73('0x24');break;case _0x8f73('0x25'):_0x331f97=_0x8f73('0x26');break;case _0x8f73('0x15'):_0x331f97='>\x20?';break;case'$lte':_0x331f97=_0x8f73('0x27');break;case _0x8f73('0x28'):_0x331f97='>=\x20?';break;case'$between':_0x331f97=_0x8f73('0x29');break;}return _0x331f97;}function parseValue(_0x12f823,_0x30bf40,_0x4a642b){var _0x41edd2={'start':undefined,'end':undefined};switch(_0x30bf40){case _0x8f73('0x1f'):case _0x8f73('0x20'):_0x41edd2[_0x8f73('0x2a')]=_0x4a642b['split'](',');break;case'$substring':_0x41edd2['start']='%'+_0x4a642b+'%';break;case'$startsWith':_0x41edd2[_0x8f73('0x2a')]=_0x4a642b+'%';break;case'$endsWith':_0x41edd2['start']='%'+_0x4a642b;break;case _0x8f73('0x2b'):var _0x1a95c9=_0x4a642b[_0x8f73('0x8')](',');var _0x4a642b=_0x1a95c9[_0x8f73('0x2c')]();var _0x36e65c=_0x1a95c9[_0x8f73('0x2d')]();if(_0x12f823==='DATE'){_0x4a642b=moment(_0x4a642b)['utcOffset'](0x0,!![])['format']();_0x36e65c=moment(_0x36e65c)[_0x8f73('0x2e')](0x0,!![])[_0x8f73('0x2f')](0x17,_0x8f73('0x30'))[_0x8f73('0x2f')](0x3b,_0x8f73('0x31'))[_0x8f73('0x2f')](0x3b,_0x8f73('0x32'))['format']();}_0x41edd2={'start':_0x4a642b,'end':_0x36e65c};break;default:_0x41edd2[_0x8f73('0x2a')]=_0x4a642b;break;}return _0x41edd2;} \ No newline at end of file +var _0x3e1e=['add','seconds','lodash','moment','parseSearch','sqlOperator','startsWith','and','replace','[$or]','split','length','forEach','shift','match','filter','map','buildExpression','DATE','operator','$eq','$between','value','includes','$gt','$lte','format','YYYY-MM-DD','castTo','text','CAST(','field','\x20AS\x20','$ne','\x20OR\x20','$in','IN\x20?','$notIn','=\x20?','<>\x20?','$substring','$lt','<\x20?','>\x20?','<=\x20?','$gte','>=\x20?','start','$startsWith','$endsWith','pop','hours'];(function(_0x32b542,_0x4512fa){var _0x554d54=function(_0x35cdfc){while(--_0x35cdfc){_0x32b542['push'](_0x32b542['shift']());}};_0x554d54(++_0x4512fa);}(_0x3e1e,0x1a2));var _0xe3e1=function(_0x54e895,_0x559be1){_0x54e895=_0x54e895-0x0;var _0x4df4e8=_0x3e1e[_0x54e895];return _0x4df4e8;};'use strict';var _=require(_0xe3e1('0x0'));var moment=require(_0xe3e1('0x1'));exports[_0xe3e1('0x2')]=function(_0x1e0f97){var _0x503293={'conditions':[]};_0x503293[_0xe3e1('0x3')]=_[_0xe3e1('0x4')](_0x1e0f97,'[$or]')?'or':_0xe3e1('0x5');var _0x1935fd=_0x1e0f97[_0xe3e1('0x6')]('[$and]','')['replace'](_0xe3e1('0x7'),'')[_0xe3e1('0x8')]('||');for(var _0x1974bf=0x0;_0x1974bf<_0x1935fd[_0xe3e1('0x9')];_0x1974bf++){var _0x6fe582=_0x1935fd[_0x1974bf]['split'](':=');var _0x56a27b=_0x6fe582[0x0];var _0x191e51=_0x6fe582['slice'](0x1);_0x191e51[_0xe3e1('0xa')](function(_0x422174){var _0x49ce99=_0x422174[_0xe3e1('0x8')]('[')[_0xe3e1('0xb')]();var _0x32bfc0=_0x422174[_0xe3e1('0xc')](/\[(.*?)\]/g);_0x32bfc0[_0xe3e1('0xa')](function(_0x1bf0c6){var _0x449b76=_0x1bf0c6[_0xe3e1('0x8')]('[')[_0xe3e1('0xd')](function(_0x53be90){return _0x53be90['indexOf'](']')>-0x1;})[_0xe3e1('0xe')](function(_0x894b11){return _0x894b11['split'](']')[0x0];})[0x0];_0x503293['conditions']['push']({'field':_0x56a27b,'operator':_0x49ce99,'value':_0x449b76});});});}return _0x503293;};exports[_0xe3e1('0xf')]=function(_0x14c29f,_0x214669,_0x205e46){var _0x27037c={};if(_0x214669===_0xe3e1('0x10')){if(_0x205e46[_0xe3e1('0x11')]===_0xe3e1('0x12')){_0x205e46['operator']=_0xe3e1('0x13');_0x205e46[_0xe3e1('0x14')]+=','+_0x205e46[_0xe3e1('0x14')];}else if(_[_0xe3e1('0x15')]([_0xe3e1('0x16'),_0xe3e1('0x17')],_0x205e46[_0xe3e1('0x11')])){_0x205e46['value']=moment(_0x205e46['value'])['add'](0x1,'days')[_0xe3e1('0x18')](_0xe3e1('0x19'));}}if(_0x205e46[_0xe3e1('0x1a')]){_0x214669=_0x205e46[_0xe3e1('0x1a')];_0x27037c[_0xe3e1('0x1b')]=_0xe3e1('0x1c')+_0x14c29f+'.'+_0x205e46[_0xe3e1('0x1d')]+_0xe3e1('0x1e')+_0x205e46[_0xe3e1('0x1a')]+')\x20'+parseOperator(_0x205e46['operator']);}else{_0x27037c[_0xe3e1('0x1b')]=_0x14c29f+'.'+_0x205e46[_0xe3e1('0x1d')]+'\x20'+parseOperator(_0x205e46['operator']);}if(_[_0xe3e1('0x15')]([_0xe3e1('0x1f'),'$notIn'],_0x205e46[_0xe3e1('0x11')]))_0x27037c[_0xe3e1('0x1b')]='('+_0x27037c[_0xe3e1('0x1b')]+_0xe3e1('0x20')+_0x14c29f+'.'+_0x205e46[_0xe3e1('0x1d')]+'\x20IS\x20NULL)';_0x27037c['value']=parseValue(_0x214669,_0x205e46[_0xe3e1('0x11')],_0x205e46['value']);return _0x27037c;};function parseOperator(_0x19ce9d){var _0x4eeb9c;switch(_0x19ce9d){case _0xe3e1('0x21'):_0x4eeb9c=_0xe3e1('0x22');break;case _0xe3e1('0x23'):_0x4eeb9c='NOT\x20IN\x20?';break;case'$eq':_0x4eeb9c=_0xe3e1('0x24');break;case _0xe3e1('0x1f'):_0x4eeb9c=_0xe3e1('0x25');break;case _0xe3e1('0x26'):case'$startsWith':case'$endsWith':_0x4eeb9c='LIKE\x20?';break;case _0xe3e1('0x27'):_0x4eeb9c=_0xe3e1('0x28');break;case'$gt':_0x4eeb9c=_0xe3e1('0x29');break;case _0xe3e1('0x17'):_0x4eeb9c=_0xe3e1('0x2a');break;case _0xe3e1('0x2b'):_0x4eeb9c=_0xe3e1('0x2c');break;case _0xe3e1('0x13'):_0x4eeb9c='BETWEEN\x20?\x20AND\x20?';break;}return _0x4eeb9c;}function parseValue(_0x1849b3,_0x1b4816,_0x251e08){var _0x49db6e={'start':undefined,'end':undefined};switch(_0x1b4816){case'$in':case'$notIn':_0x49db6e[_0xe3e1('0x2d')]=_0x251e08[_0xe3e1('0x8')](',');break;case _0xe3e1('0x26'):_0x49db6e['start']='%'+_0x251e08+'%';break;case _0xe3e1('0x2e'):_0x49db6e[_0xe3e1('0x2d')]=_0x251e08+'%';break;case _0xe3e1('0x2f'):_0x49db6e['start']='%'+_0x251e08;break;case _0xe3e1('0x13'):var _0x111d9a=_0x251e08['split'](',');var _0x251e08=_0x111d9a['shift']();var _0x1200d0=_0x111d9a[_0xe3e1('0x30')]();if(_0x1849b3===_0xe3e1('0x10')){_0x251e08=moment(_0x251e08)['utcOffset'](0x0,!![])[_0xe3e1('0x18')]();_0x1200d0=moment(_0x1200d0)['utcOffset'](0x0,!![])['add'](0x17,_0xe3e1('0x31'))['add'](0x3b,'minutes')[_0xe3e1('0x32')](0x3b,_0xe3e1('0x33'))['format']();}_0x49db6e={'start':_0x251e08,'end':_0x1200d0};break;default:_0x49db6e[_0xe3e1('0x2d')]=_0x251e08;break;}return _0x49db6e;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index b75617f..262536f 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 _0x815b=['YYYY-MM-DD','utc','subtract','name','uniqueid','isArray','offset','sort','map','indexOf','priority','cast','col','unsigned','substr','DESC','ASC','omit','length','isObject','isString','unset','match','isEmail','getFullTextValue','\x22{EXPR}\x22','push','{EXPR}','join','query','$id','intersection','attributes','hasOwnProperty','limit','order','filter','object','columns','value','where','VIRTUAL','lower','merge','options','include','lodash','sequelize','moment','../../mysqldb','keys','includes','parse','model','alias','fields','raw','split','filters','isEmpty','forOwn','find','type','DATE','isPlainObject','$gte','format'];(function(_0x43c07c,_0x27faf3){var _0x2534a9=function(_0x144b40){while(--_0x144b40){_0x43c07c['push'](_0x43c07c['shift']());}};_0x2534a9(++_0x27faf3);}(_0x815b,0xb4));var _0xb815=function(_0x32138c,_0x4090c5){_0x32138c=_0x32138c-0x0;var _0x20cec6=_0x815b[_0x32138c];return _0x20cec6;};'use strict';var _=require(_0xb815('0x0'));var sequelize=require(_0xb815('0x1'));var moment=require(_0xb815('0x2'));var db=require(_0xb815('0x3'))['db'];var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x6314c){var _0x592cd5=['ne'];try{var _0x1e70fa=JSON['parse'](_0x6314c);var _0x5b4516=Object[_0xb815('0x4')](_0x1e70fa)[0x0];return _0x592cd5[_0xb815('0x5')](_0x5b4516);}catch(_0x93c8e8){return![];}}function getOperatorValue(_0x5a5c18){var _0x466899=JSON[_0xb815('0x6')](_0x5a5c18);var _0x4930f6=Object[_0xb815('0x4')](_0x466899)[0x0];var _0x479b09=_0x466899[_0x4930f6];return{['$'+_0x4930f6]:_0x479b09};}function parseIncludeModel(_0x4d0873){var _0x1e626f=JSON[_0xb815('0x6')](_0x4d0873);return{'model':db[_0x1e626f[_0xb815('0x7')]],'as':_0x1e626f[_0xb815('0x8')],'attributes':_0x1e626f[_0xb815('0x9')],'raw':_0x1e626f[_0xb815('0xa')]};}exports[_0xb815('0x9')]=function(_0x205a49){var _0x50f5f0=null;if(_0x205a49){_0x50f5f0=_0x205a49[_0xb815('0xb')](',');}return _0x50f5f0;};exports[_0xb815('0xc')]=function(_0x22ed07,_0x3c9ebe){var _0x3753bb={};if(!_[_0xb815('0xd')](_0x22ed07)){_[_0xb815('0xe')](_0x22ed07,function(_0x5af22a,_0x5f360b){try{if(_0x3c9ebe){var _0x471ccc=_[_0xb815('0xf')](_0x3c9ebe,{'name':_0x5f360b})||{};if(hasSequelizeOperator(_0x5af22a)){_0x3753bb[_0x5f360b]=getOperatorValue(_0x5af22a);}else if(_0x471ccc[_0xb815('0x10')]===_0xb815('0x11')&&_[_0xb815('0x12')](_0x5af22a)){var _0x1d130f=JSON[_0xb815('0x6')](_0x5af22a);var _0x4636c7={'$gte':moment(moment(_0x1d130f[_0xb815('0x13')])[_0xb815('0x14')](_0xb815('0x15')))[_0xb815('0x16')]()[_0xb815('0x14')](),'$lte':moment(moment(_0x1d130f['$lte'])['format'](_0xb815('0x15')))[_0xb815('0x16')]()[_0xb815('0x17')](0x1,'s')[_0xb815('0x14')]()};_0x3753bb[_0x5f360b]=_0x4636c7;}else if(_0x471ccc[_0xb815('0x18')]===_0xb815('0x19')){_0x3753bb[_0x5f360b]=_0x5af22a;}else{_0x3753bb[_0x5f360b]=_[_0xb815('0x1a')](_0x5af22a)?_0x5af22a:JSON[_0xb815('0x6')](_0x5af22a);}}else{_0x3753bb[_0x5f360b]=_[_0xb815('0x1a')](_0x5af22a)?_0x5af22a:JSON['parse'](_0x5af22a);}}catch(_0x5bdcbc){_0x3753bb[_0x5f360b]=_0x5af22a[_0xb815('0xb')](',');}});}return _0x3753bb;};exports['limit']=function(_0x261b8d){_0x261b8d=parseInt(_0x261b8d,0xa);if(!_0x261b8d||_0x261b8d<0x0){_0x261b8d=LIMIT_VALUE;}return _0x261b8d;};exports[_0xb815('0x1b')]=function(_0x1343f8){_0x1343f8=parseInt(_0x1343f8,0xa);if(!_0x1343f8||_0x1343f8<0x0){_0x1343f8=0x0;}return _0x1343f8;};exports[_0xb815('0x1c')]=function(_0x4a1650){var _0x25d246,_0x3c787e=null;if(_0x4a1650){_0x25d246=_0x4a1650['split'](',');_0x3c787e=_[_0xb815('0x1d')](_0x25d246,function(_0x26e7d9){if(_0x26e7d9[_0xb815('0x1e')]('-')===0x0){return[_0x26e7d9===_0xb815('0x1f')?sequelize[_0xb815('0x20')](sequelize[_0xb815('0x21')](_0xb815('0x1f')),_0xb815('0x22')):_0x26e7d9[_0xb815('0x23')](0x1),_0xb815('0x24')];}else{return[_0x26e7d9===_0xb815('0x1f')?sequelize[_0xb815('0x20')](sequelize['col'](_0xb815('0x1f')),_0xb815('0x22')):_0x26e7d9,_0xb815('0x25')];}});}return _0x3c787e;};exports[_0xb815('0x26')]=function(_0x5f2eaf,_0x22f594){if(_[_0xb815('0xd')](_0x5f2eaf)){return _0x5f2eaf;}if(_[_0xb815('0x1a')](_0x5f2eaf)){for(var _0x4d014a=0x0;_0x4d014a<_0x5f2eaf[_0xb815('0x27')];_0x4d014a+=0x1){_0x5f2eaf[_0x4d014a]=this[_0xb815('0x26')](_0x5f2eaf[_0x4d014a],_0x22f594);}return _0x5f2eaf;}if(!_[_0xb815('0x28')](_0x5f2eaf)){return _0x5f2eaf;}if(_[_0xb815('0x29')](_0x22f594)){_0x22f594=[_0x22f594];}if(!_[_0xb815('0x1a')](_0x22f594)){return _0x5f2eaf;}for(var _0x3b0152=0x0;_0x3b0152<_0x22f594[_0xb815('0x27')];_0x3b0152+=0x1){_[_0xb815('0x2a')](_0x5f2eaf,_0x22f594[_0x3b0152]);}for(var _0x46c545 in _0x5f2eaf){if(_0x5f2eaf['hasOwnProperty'](_0x46c545)){_0x5f2eaf[_0x46c545]=this['omit'](_0x5f2eaf[_0x46c545],_0x22f594);}}return _0x5f2eaf;};exports['isNumeric']=function(_0x45b5e5){return _0x45b5e5[_0xb815('0x2b')](RegExp('^[+]?[0-9]*$'))?!![]:![];};exports[_0xb815('0x2c')]=function(_0x403276){return _0x403276[_0xb815('0x2b')](/^\S+@\S+$/)?!![]:![];};exports[_0xb815('0x2d')]=function(_0x5973c7,_0x3f9c60){var _0x17da68=[];var _0x4e2823=/[ `!@#$%^&*()_\-?~]/;var _0x51d053=_0x3f9c60?_0xb815('0x2e'):'{EXPR}';_0x5973c7[_0xb815('0xb')](/[ ,]+/)['forEach'](function(_0x6573cd){_0x6573cd=_0x6573cd['replace'](/([^:]")"+/g,'$1');_0x6573cd='+'+_0x6573cd+'*';var _0xa7b669=_0x6573cd[_0xb815('0x2b')](_0x4e2823);if(_0xa7b669){_0x6573cd='\x22'+_0x6573cd+'\x22';}_0x17da68[_0xb815('0x2f')](_0x6573cd);});_0x51d053=_0x51d053['replace'](_0xb815('0x30'),_0x17da68[_0xb815('0x31')]('\x20'));return _0x51d053;};exports['getOptions']=function(_0x441b5a,_0x19848c,_0x29ecee){var _0x131210={},_0x1c2ca6={};if(_0x19848c[_0xb815('0x32')]['$id']){_0x19848c[_0xb815('0x32')]['id']=_0x19848c[_0xb815('0x32')][_0xb815('0x33')];delete _0x19848c[_0xb815('0x32')][_0xb815('0x33')];}_0x131210['model']=_['map'](_0x441b5a,'name');_0x131210[_0xb815('0x32')]=_['keys'](_0x19848c[_0xb815('0x32')]);_0x131210[_0xb815('0xc')]=_[_0xb815('0x34')](_0x131210[_0xb815('0x7')],_0x131210[_0xb815('0x32')]);_0x1c2ca6[_0xb815('0x35')]=_[_0xb815('0x34')](_0x131210[_0xb815('0x7')],this[_0xb815('0x9')](_0x19848c[_0xb815('0x32')][_0xb815('0x9')]));_0x1c2ca6[_0xb815('0x35')]=_0x1c2ca6[_0xb815('0x35')][_0xb815('0x27')]?_0x1c2ca6[_0xb815('0x35')]:_0x131210[_0xb815('0x7')];if(!_0x19848c[_0xb815('0x32')][_0xb815('0x36')]('nolimit')){_0x1c2ca6['limit']=this['limit'](_0x19848c[_0xb815('0x32')][_0xb815('0x37')]);_0x1c2ca6['offset']=this[_0xb815('0x1b')](_0x19848c[_0xb815('0x32')][_0xb815('0x1b')]);}_0x1c2ca6[_0xb815('0x38')]=this[_0xb815('0x1c')](_0x19848c[_0xb815('0x32')]['sort']);_0x1c2ca6['where']=this[_0xb815('0xc')](_['pick'](_0x19848c['query'],_0x131210[_0xb815('0xc')]),_0x441b5a);if(_0x19848c[_0xb815('0x32')][_0xb815('0x39')]){var _0x388754=_0x441b5a;var _0x4c8655=_0x19848c['query'][_0xb815('0x39')];if(typeof _0x4c8655===_0xb815('0x3a')){_0x388754=_[_0xb815('0x39')](_0x441b5a,function(_0x38750d){return _[_0xb815('0x5')](_0x4c8655[_0xb815('0x3b')],_0x38750d[_0xb815('0x18')]);});_0x4c8655=_0x4c8655[_0xb815('0x3c')];}_0x1c2ca6[_0xb815('0x3d')]=_['merge'](_0x1c2ca6[_0xb815('0x3d')],{'$or':_['map'](_0x388754,function(_0x202ce5){if(_0x202ce5['type']!==_0xb815('0x3e')){if(_0x29ecee){return sequelize[_0xb815('0x3d')](sequelize['fn'](_0xb815('0x3f'),sequelize['col'](_0x202ce5['name'])),{'$like':sequelize['fn'](_0xb815('0x3f'),'%'+_0x19848c[_0xb815('0x32')][_0xb815('0x39')]+'%')});}else{var _0x5d7fbc={};_0x5d7fbc[_0x202ce5[_0xb815('0x18')]]={'$like':'%'+_0x19848c[_0xb815('0x32')][_0xb815('0x39')]+'%'};return _0x5d7fbc;}}})});}_0x1c2ca6=_[_0xb815('0x40')]({},_0x1c2ca6,_0x19848c[_0xb815('0x41')]);return _0x1c2ca6;};exports[_0xb815('0x42')]=function(_0x2fa188){var _0x3626ce=[];if(_0x2fa188['includeAll']){_0x3626ce['push']({'all':!![]});}else if(_0x2fa188[_0xb815('0x42')]){if(Array[_0xb815('0x1a')](_0x2fa188[_0xb815('0x42')])){_0x3626ce=Object[_0xb815('0x4')](_0x2fa188['include'])['map'](function(_0xf1bf3){return parseIncludeModel(_0x2fa188[_0xb815('0x42')][_0xf1bf3]);});}else{var _0x549106=parseIncludeModel(_0x2fa188[_0xb815('0x42')]);_0x3626ce['push'](_0x549106);}}return _0x3626ce;}; \ No newline at end of file +var _0x2056=['../../mysqldb','parse','keys','includes','model','alias','fields','split','filters','isEmpty','forOwn','type','$gte','format','YYYY-MM-DD','utc','subtract','name','uniqueid','isArray','offset','map','indexOf','priority','col','unsigned','substr','DESC','cast','ASC','omit','length','isObject','isString','unset','isNumeric','match','isEmail','getFullTextValue','{EXPR}','forEach','replace','join','getOptions','query','$id','intersection','attributes','hasOwnProperty','nolimit','limit','order','sort','where','filter','object','columns','value','merge','VIRTUAL','lower','options','include','includeAll','push','moment'];(function(_0x6f27a5,_0x487389){var _0x4e3c04=function(_0x2b326e){while(--_0x2b326e){_0x6f27a5['push'](_0x6f27a5['shift']());}};_0x4e3c04(++_0x487389);}(_0x2056,0x107));var _0x6205=function(_0x36a786,_0x1f112a){_0x36a786=_0x36a786-0x0;var _0x371498=_0x2056[_0x36a786];return _0x371498;};'use strict';var _=require('lodash');var sequelize=require('sequelize');var moment=require(_0x6205('0x0'));var db=require(_0x6205('0x1'))['db'];var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x1d6202){var _0x3580a1=['ne'];try{var _0x2198ce=JSON[_0x6205('0x2')](_0x1d6202);var _0x2f3052=Object[_0x6205('0x3')](_0x2198ce)[0x0];return _0x3580a1[_0x6205('0x4')](_0x2f3052);}catch(_0x5398fe){return![];}}function getOperatorValue(_0x45afa8){var _0x2c555d=JSON[_0x6205('0x2')](_0x45afa8);var _0x446132=Object[_0x6205('0x3')](_0x2c555d)[0x0];var _0x556d20=_0x2c555d[_0x446132];return{['$'+_0x446132]:_0x556d20};}function parseIncludeModel(_0x1b7091){var _0xfefdec=JSON[_0x6205('0x2')](_0x1b7091);return{'model':db[_0xfefdec[_0x6205('0x5')]],'as':_0xfefdec[_0x6205('0x6')],'attributes':_0xfefdec[_0x6205('0x7')],'raw':_0xfefdec['raw']};}exports[_0x6205('0x7')]=function(_0x5a391b){var _0xecd9ff=null;if(_0x5a391b){_0xecd9ff=_0x5a391b[_0x6205('0x8')](',');}return _0xecd9ff;};exports[_0x6205('0x9')]=function(_0x3c8996,_0x3d1525){var _0x4ed8b1={};if(!_[_0x6205('0xa')](_0x3c8996)){_[_0x6205('0xb')](_0x3c8996,function(_0x5a2d36,_0x30503d){try{if(_0x3d1525){var _0x1dbb81=_['find'](_0x3d1525,{'name':_0x30503d})||{};if(hasSequelizeOperator(_0x5a2d36)){_0x4ed8b1[_0x30503d]=getOperatorValue(_0x5a2d36);}else if(_0x1dbb81[_0x6205('0xc')]==='DATE'&&_['isPlainObject'](_0x5a2d36)){var _0x4d6685=JSON[_0x6205('0x2')](_0x5a2d36);var _0x7ab1f1={'$gte':moment(moment(_0x4d6685[_0x6205('0xd')])[_0x6205('0xe')](_0x6205('0xf')))[_0x6205('0x10')]()['format'](),'$lte':moment(moment(_0x4d6685['$lte'])[_0x6205('0xe')]('YYYY-MM-DD'))[_0x6205('0x10')]()[_0x6205('0x11')](0x1,'s')[_0x6205('0xe')]()};_0x4ed8b1[_0x30503d]=_0x7ab1f1;}else if(_0x1dbb81[_0x6205('0x12')]===_0x6205('0x13')){_0x4ed8b1[_0x30503d]=_0x5a2d36;}else{_0x4ed8b1[_0x30503d]=_['isArray'](_0x5a2d36)?_0x5a2d36:JSON['parse'](_0x5a2d36);}}else{_0x4ed8b1[_0x30503d]=_[_0x6205('0x14')](_0x5a2d36)?_0x5a2d36:JSON['parse'](_0x5a2d36);}}catch(_0x5dafa6){_0x4ed8b1[_0x30503d]=_0x5a2d36[_0x6205('0x8')](',');}});}return _0x4ed8b1;};exports['limit']=function(_0x4ddefb){_0x4ddefb=parseInt(_0x4ddefb,0xa);if(!_0x4ddefb||_0x4ddefb<0x0){_0x4ddefb=LIMIT_VALUE;}return _0x4ddefb;};exports[_0x6205('0x15')]=function(_0x16c499){_0x16c499=parseInt(_0x16c499,0xa);if(!_0x16c499||_0x16c499<0x0){_0x16c499=0x0;}return _0x16c499;};exports['sort']=function(_0x339be2){var _0x55da51,_0x285e43=null;if(_0x339be2){_0x55da51=_0x339be2[_0x6205('0x8')](',');_0x285e43=_[_0x6205('0x16')](_0x55da51,function(_0x47ec88){if(_0x47ec88[_0x6205('0x17')]('-')===0x0){return[_0x47ec88===_0x6205('0x18')?sequelize['cast'](sequelize[_0x6205('0x19')]('priority'),_0x6205('0x1a')):_0x47ec88[_0x6205('0x1b')](0x1),_0x6205('0x1c')];}else{return[_0x47ec88===_0x6205('0x18')?sequelize[_0x6205('0x1d')](sequelize[_0x6205('0x19')](_0x6205('0x18')),_0x6205('0x1a')):_0x47ec88,_0x6205('0x1e')];}});}return _0x285e43;};exports[_0x6205('0x1f')]=function(_0x3596d9,_0x9abdaa){if(_[_0x6205('0xa')](_0x3596d9)){return _0x3596d9;}if(_[_0x6205('0x14')](_0x3596d9)){for(var _0x5df61b=0x0;_0x5df61b<_0x3596d9[_0x6205('0x20')];_0x5df61b+=0x1){_0x3596d9[_0x5df61b]=this['omit'](_0x3596d9[_0x5df61b],_0x9abdaa);}return _0x3596d9;}if(!_[_0x6205('0x21')](_0x3596d9)){return _0x3596d9;}if(_[_0x6205('0x22')](_0x9abdaa)){_0x9abdaa=[_0x9abdaa];}if(!_[_0x6205('0x14')](_0x9abdaa)){return _0x3596d9;}for(var _0x268fce=0x0;_0x268fce<_0x9abdaa['length'];_0x268fce+=0x1){_[_0x6205('0x23')](_0x3596d9,_0x9abdaa[_0x268fce]);}for(var _0x4c647d in _0x3596d9){if(_0x3596d9['hasOwnProperty'](_0x4c647d)){_0x3596d9[_0x4c647d]=this[_0x6205('0x1f')](_0x3596d9[_0x4c647d],_0x9abdaa);}}return _0x3596d9;};exports[_0x6205('0x24')]=function(_0x4fbc1e){return _0x4fbc1e[_0x6205('0x25')](RegExp('^[+]?[0-9]*$'))?!![]:![];};exports[_0x6205('0x26')]=function(_0xd9f8b5){return _0xd9f8b5[_0x6205('0x25')](/^\S+@\S+$/)?!![]:![];};exports[_0x6205('0x27')]=function(_0x36ce52,_0x20f3cb){var _0x158b3e=[];var _0x156e80=/[ `!@#$%^&*()_\-?~]/;var _0x3f119b=_0x20f3cb?'\x22{EXPR}\x22':_0x6205('0x28');_0x36ce52[_0x6205('0x8')](/[ ,]+/)[_0x6205('0x29')](function(_0x538d55){_0x538d55=_0x538d55['replace'](/([^:]")"+/g,'$1');_0x538d55='+'+_0x538d55+'*';var _0x472d15=_0x538d55['match'](_0x156e80);if(_0x472d15){_0x538d55='\x22'+_0x538d55+'\x22';}_0x158b3e['push'](_0x538d55);});_0x3f119b=_0x3f119b[_0x6205('0x2a')](_0x6205('0x28'),_0x158b3e[_0x6205('0x2b')]('\x20'));return _0x3f119b;};exports[_0x6205('0x2c')]=function(_0x49e6d2,_0x446f91,_0x332597){var _0x58d1c9={},_0x31cacc={};if(_0x446f91[_0x6205('0x2d')][_0x6205('0x2e')]){_0x446f91[_0x6205('0x2d')]['id']=_0x446f91['query']['$id'];delete _0x446f91['query'][_0x6205('0x2e')];}_0x58d1c9[_0x6205('0x5')]=_[_0x6205('0x16')](_0x49e6d2,_0x6205('0x12'));_0x58d1c9[_0x6205('0x2d')]=_[_0x6205('0x3')](_0x446f91[_0x6205('0x2d')]);_0x58d1c9[_0x6205('0x9')]=_[_0x6205('0x2f')](_0x58d1c9[_0x6205('0x5')],_0x58d1c9[_0x6205('0x2d')]);_0x31cacc[_0x6205('0x30')]=_[_0x6205('0x2f')](_0x58d1c9['model'],this[_0x6205('0x7')](_0x446f91[_0x6205('0x2d')][_0x6205('0x7')]));_0x31cacc['attributes']=_0x31cacc[_0x6205('0x30')]['length']?_0x31cacc[_0x6205('0x30')]:_0x58d1c9[_0x6205('0x5')];if(!_0x446f91[_0x6205('0x2d')][_0x6205('0x31')](_0x6205('0x32'))){_0x31cacc[_0x6205('0x33')]=this[_0x6205('0x33')](_0x446f91[_0x6205('0x2d')][_0x6205('0x33')]);_0x31cacc['offset']=this[_0x6205('0x15')](_0x446f91[_0x6205('0x2d')][_0x6205('0x15')]);}_0x31cacc[_0x6205('0x34')]=this[_0x6205('0x35')](_0x446f91[_0x6205('0x2d')][_0x6205('0x35')]);_0x31cacc[_0x6205('0x36')]=this[_0x6205('0x9')](_['pick'](_0x446f91[_0x6205('0x2d')],_0x58d1c9[_0x6205('0x9')]),_0x49e6d2);if(_0x446f91[_0x6205('0x2d')][_0x6205('0x37')]){var _0x3c16b8=_0x49e6d2;var _0x15de48=_0x446f91[_0x6205('0x2d')][_0x6205('0x37')];if(typeof _0x15de48===_0x6205('0x38')){_0x3c16b8=_['filter'](_0x49e6d2,function(_0x4ef4c7){return _[_0x6205('0x4')](_0x15de48[_0x6205('0x39')],_0x4ef4c7['name']);});_0x15de48=_0x15de48[_0x6205('0x3a')];}_0x31cacc[_0x6205('0x36')]=_[_0x6205('0x3b')](_0x31cacc['where'],{'$or':_['map'](_0x3c16b8,function(_0x570137){if(_0x570137[_0x6205('0xc')]!==_0x6205('0x3c')){if(_0x332597){return sequelize[_0x6205('0x36')](sequelize['fn'](_0x6205('0x3d'),sequelize['col'](_0x570137[_0x6205('0x12')])),{'$like':sequelize['fn'](_0x6205('0x3d'),'%'+_0x446f91['query'][_0x6205('0x37')]+'%')});}else{var _0x90e0ea={};_0x90e0ea[_0x570137[_0x6205('0x12')]]={'$like':'%'+_0x446f91[_0x6205('0x2d')]['filter']+'%'};return _0x90e0ea;}}})});}_0x31cacc=_[_0x6205('0x3b')]({},_0x31cacc,_0x446f91[_0x6205('0x3e')]);return _0x31cacc;};exports[_0x6205('0x3f')]=function(_0x1ce4ea){var _0x21168b=[];if(_0x1ce4ea[_0x6205('0x40')]){_0x21168b[_0x6205('0x41')]({'all':!![]});}else if(_0x1ce4ea[_0x6205('0x3f')]){if(Array[_0x6205('0x14')](_0x1ce4ea['include'])){_0x21168b=Object[_0x6205('0x3')](_0x1ce4ea[_0x6205('0x3f')])[_0x6205('0x16')](function(_0x1265e7){return parseIncludeModel(_0x1ce4ea[_0x6205('0x3f')][_0x1265e7]);});}else{var _0x3d523e=parseIncludeModel(_0x1ce4ea[_0x6205('0x3f')]);_0x21168b[_0x6205('0x41')](_0x3d523e);}}return _0x21168b;}; \ No newline at end of file diff --git a/server/components/realtime/agents.js b/server/components/realtime/agents.js index 57280bb..f76f062 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 _0xaedf=['ringing','isNil','voiceStatus','voicePause','pause','chatStatus','faxStatus','openchannelStatus','smsStatus','whatsappStatus','request','Agents','then','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','merge','catch','getRealtimeAgents','busy','getAgentStatus','isArray','startCase','Queue','map','all','flatten','value','filter','getAgentIdsByStatus','resolve','includes','User','findAll','name','globalStatus','order','startsWith','DESC','ASC','fullname,internal','fullname','internal','sort','pauseType','toLowerCase','sortAgentsByStatus','online','lastLoginAt','lastPauseAt','address','openchannelCapacity','mailCapacity','smsCapacity','faxCapacity','openchannelCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','openchannelStatusTime','smsStatusTime','faxStatusTime','queue','screenrecording','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','routealias','omit','pick','lodash','jayson/promise','../../mysqldb','client','http','chatPause','faxPause','mailPause','openchannelPause','smsPause','whatsappPause','every','length','idle','unknown','unavailable'];(function(_0x2af200,_0x28a8c0){var _0x1da2af=function(_0x25f499){while(--_0x25f499){_0x2af200['push'](_0x2af200['shift']());}};_0x1da2af(++_0x28a8c0);}(_0xaedf,0x1a3));var _0xfaed=function(_0x117e9c,_0x527d23){_0x117e9c=_0x117e9c-0x0;var _0x3a2cd9=_0xaedf[_0x117e9c];return _0x3a2cd9;};'use strict';var _=require(_0xfaed('0x0'));var jayson=require(_0xfaed('0x1'));var db=require(_0xfaed('0x2'))['db'];var amiClient=jayson['client']['http']({'port':0x232a});var routingClient=jayson[_0xfaed('0x3')][_0xfaed('0x4')]({'port':0x232c});function isAgentPaused(_0x489543,_0x167b2a){var _0x36d846=[_0x489543[_0xfaed('0x5')],_0x489543[_0xfaed('0x6')],_0x489543[_0xfaed('0x7')],_0x489543[_0xfaed('0x8')],_0x489543[_0xfaed('0x9')],_0x489543['voicePause'],_0x489543[_0xfaed('0xa')]];if(!_0x167b2a)return _[_0xfaed('0xb')](_0x36d846);var _0x5ecea1=_['filter'](_0x36d846);return _0x5ecea1[_0xfaed('0xc')]>0x0&&_0x5ecea1[_0xfaed('0xc')]<_0x36d846['length']?!![]:![];}function isIdle(_0x57dced){return _0x57dced===_0xfaed('0xd')||_0x57dced===_0xfaed('0xe')||_0x57dced===_0xfaed('0xf')||_0x57dced===_0xfaed('0x10')||_[_0xfaed('0x11')](_0x57dced);}function isAgentIdle(_0x9cc4ea){if(_0x9cc4ea[_0xfaed('0x12')]!=='idle'&&_0x9cc4ea[_0xfaed('0x13')]){_0x9cc4ea[_0xfaed('0x12')]=_0xfaed('0x14');return![];}return _[_0xfaed('0xb')]([_0x9cc4ea[_0xfaed('0x15')],_0x9cc4ea[_0xfaed('0x16')],_0x9cc4ea['mailStatus'],_0x9cc4ea[_0xfaed('0x17')],_0x9cc4ea[_0xfaed('0x18')],_0x9cc4ea[_0xfaed('0x12')],_0x9cc4ea[_0xfaed('0x19')]],isIdle);}function getRealtimeAgents(){return amiClient[_0xfaed('0x1a')](_0xfaed('0x1b'),{})[_0xfaed('0x1c')](function(_0x125097){if(_0x125097[_0xfaed('0x1d')]){throw new Error(_0xfaed('0x1e'));}var _0x56ca89=_0x125097[_0xfaed('0x1f')];return routingClient[_0xfaed('0x1a')](_0xfaed('0x1b'),{})[_0xfaed('0x1c')](function(_0x3f4db9){if(_0x3f4db9[_0xfaed('0x1d')]){throw new Error(_0xfaed('0x20'));}var _0x4ab8a4=_0x3f4db9['result'];return _[_0xfaed('0x21')]({},_0x56ca89,_0x4ab8a4);});})[_0xfaed('0x22')](function(_0x5e5772){throw _0x5e5772;});}exports[_0xfaed('0x23')]=getRealtimeAgents;function getAgentStatus(_0x1dbbbe){var _0xf14fe1=_0xfaed('0xe');if(isAgentPaused(_0x1dbbbe))_0xf14fe1=_0xfaed('0x14');else if(isAgentPaused(_0x1dbbbe,!![]))_0xf14fe1='*pause';else if(isAgentIdle(_0x1dbbbe))_0xf14fe1=_0xfaed('0xd');else _0xf14fe1=_0xfaed('0x24');return _0xf14fe1;}exports[_0xfaed('0x25')]=getAgentStatus;function getAgentIdsByQueues(_0x2fec23,_0x9a8d6e){var _0x48563c=_[_0xfaed('0x26')](_0x2fec23)?_0x2fec23:[_0x2fec23];var _0x5d2e50=_[_0xfaed('0x27')](_0x9a8d6e)+_0xfaed('0x28');var _0x12a1f4=_[_0xfaed('0x29')](_0x48563c,function(_0x475f90){return db[_0x5d2e50]['findOne']({'where':{'id':_0x475f90}})['then'](function(_0x15ff4c){if(!_0x15ff4c)return[];return _0x15ff4c['getAgents']({'attributes':['id'],'raw':!![]});});});return Promise[_0xfaed('0x2a')](_0x12a1f4)[_0xfaed('0x1c')](function(_0x102271){var _0x2a4977=_(_0x102271)[_0xfaed('0x2b')]()[_0xfaed('0x29')]('id')['uniq']()[_0xfaed('0x2c')]();return _0x2a4977;});}exports['getAgentIdsByQueues']=getAgentIdsByQueues;function getAgentIdsByStatus(_0x7174e5,_0x4fbd04,_0x1293ed){try{if(_0x4fbd04[_0xfaed('0xc')]>0x0){_0x7174e5=_0x7174e5[_0xfaed('0x2d')](function(_0x4155e8){return _0x4fbd04['includes'](_0x4155e8['id']);});}var _0x586cf3=_0x7174e5[_0xfaed('0x2d')](function(_0x2370b2){var _0x1b29a6=_0xfaed('0x24');if(isAgentIdle(_0x2370b2)){_0x1b29a6=_0xfaed('0xd');}return _0x1b29a6===_0x1293ed;});return _[_0xfaed('0x29')](_0x586cf3,'id');}catch(_0x1ba68f){throw _0x1ba68f;}}exports[_0xfaed('0x2e')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x2fcf95,_0x39af1d,_0x56982d){return Promise[_0xfaed('0x2f')]()[_0xfaed('0x1c')](function(){if(_0x39af1d[_0xfaed('0xc')]>0x0){_0x2fcf95=_0x2fcf95['filter'](function(_0x20e272){return _0x39af1d[_0xfaed('0x30')](_0x20e272['id']);});}return _0x2fcf95;})[_0xfaed('0x1c')](function(){return db[_0xfaed('0x31')][_0xfaed('0x32')]({'attributes':['id',_0xfaed('0x33'),'fullname',_0xfaed('0x5'),_0xfaed('0x6'),'mailPause',_0xfaed('0x8'),_0xfaed('0x9'),_0xfaed('0x13'),'whatsappPause','pauseType'],'where':{'id':{'$in':_[_0xfaed('0x29')](_0x2fcf95,'id')}},'raw':!![]});})[_0xfaed('0x1c')](function(_0x1b9305){return _0x1b9305[_0xfaed('0x29')](function(_0x116f80){var _0x293bd1=_['find'](_0x2fcf95,['id',_0x116f80['id']]);var _0xd0dd3=filterAgentAttributes(_0x293bd1);_[_0xfaed('0x21')](_0x116f80,_0xd0dd3);_0x116f80['globalStatus']=getAgentStatus(_0x116f80);return _0x116f80;});})[_0xfaed('0x1c')](function(_0x5a6ca5){var _0x3c6ec4=sortAgentsByStatus(_0x5a6ca5,_0x56982d);return _[_0xfaed('0x29')](_0x3c6ec4,'id');})[_0xfaed('0x22')](function(_0x3e3640){throw _0x3e3640;});}exports['getSortedAgentsIdsByStatus']=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x58a9f1){var _0x18b77c={'fields':[],'order':null};var _0x498e19=_0x58a9f1['split'](',');_0x18b77c['fields']=_[_0xfaed('0x2d')](_0x498e19,function(_0x45bf6f){if(!_0x45bf6f[_0xfaed('0x30')](_0xfaed('0x34'))){return!![];}_0x18b77c[_0xfaed('0x35')]=_[_0xfaed('0x36')](_0x45bf6f,'-')?_0xfaed('0x37'):_0xfaed('0x38');return![];});return _0x18b77c;}exports['getUpdatedSortOptions']=getUpdatedSortOptions;function validateSortParameter(_0x2661e4){if(!_0x2661e4){_0x2661e4=_0xfaed('0x39');}if(_0x2661e4['includes'](_0xfaed('0x3a'))&&!_0x2661e4['includes'](_0xfaed('0x3b'))){var _0x5d32b0=_0x2661e4['substring'](0x0,_0x2661e4['indexOf'](_0xfaed('0x3a')));_0x2661e4+=','+_0x5d32b0+_0xfaed('0x3b');}return _0x2661e4;}exports['validateSortParameter']=validateSortParameter;function sortAgentsByStatus(_0x2d5d0d,_0x401e4a){var _0x3db2cc=_0x2d5d0d[_0xfaed('0x3c')](function(_0xb7e43,_0x4b1688){if(_0xb7e43[_0xfaed('0x34')]===_0x4b1688[_0xfaed('0x34')]){if(_0xb7e43[_0xfaed('0x34')]===_0xfaed('0x14')){if(_0x401e4a===_0xfaed('0x37')){return(_0xb7e43[_0xfaed('0x3d')]||'')<(_0x4b1688['pauseType']||'')||_0xb7e43['fullname']['toLowerCase']()>_0x4b1688[_0xfaed('0x3a')][_0xfaed('0x3e')]()?0x1:-0x1;}else{return(_0xb7e43['pauseType']||'')<(_0x4b1688[_0xfaed('0x3d')]||'')||_0xb7e43[_0xfaed('0x3a')]['toLowerCase']()>_0x4b1688['fullname'][_0xfaed('0x3e')]()?-0x1:0x1;}}else{if(_0x401e4a===_0xfaed('0x37')){return _0xb7e43[_0xfaed('0x3a')]['toLowerCase']()<_0x4b1688[_0xfaed('0x3a')][_0xfaed('0x3e')]()?0x1:-0x1;}else{return _0xb7e43[_0xfaed('0x3a')]['toLowerCase']()<_0x4b1688[_0xfaed('0x3a')][_0xfaed('0x3e')]()?-0x1:0x1;}}}else{if(_0x401e4a===_0xfaed('0x37')){return _0xb7e43[_0xfaed('0x34')]<_0x4b1688[_0xfaed('0x34')]?0x1:-0x1;}else{return _0xb7e43[_0xfaed('0x34')]<_0x4b1688[_0xfaed('0x34')]?-0x1:0x1;}}});return _0x3db2cc;}exports[_0xfaed('0x3f')]=sortAgentsByStatus;function filterAgentAttributes(_0x242cf8){var _0x35a20a=['userpic',_0xfaed('0x40'),_0xfaed('0x41'),_0xfaed('0x42'),_0xfaed('0x3d'),_0xfaed('0x42'),_0xfaed('0x3b'),_0xfaed('0x43'),'chatPause',_0xfaed('0x8'),_0xfaed('0x7'),'smsPause',_0xfaed('0xa'),_0xfaed('0x6'),'voicePause','chatCapacity',_0xfaed('0x44'),_0xfaed('0x45'),_0xfaed('0x46'),'whatsappCapacity',_0xfaed('0x47'),'chatCurrentCapacity',_0xfaed('0x48'),_0xfaed('0x49'),_0xfaed('0x4a'),_0xfaed('0x4b'),_0xfaed('0x4c'),_0xfaed('0x15'),'openchannelStatus','mailStatus','smsStatus',_0xfaed('0x19'),_0xfaed('0x16'),_0xfaed('0x12'),'chatStatusTime',_0xfaed('0x4d'),'mailStatusTime',_0xfaed('0x4e'),'whatsappStatusTime',_0xfaed('0x4f'),'voiceStatusTime',_0xfaed('0x50'),'destconnectedlinenum',_0xfaed('0x51'),_0xfaed('0x52'),_0xfaed('0x53'),_0xfaed('0x54')];var _0x52639a=[_0xfaed('0x5'),_0xfaed('0x8'),_0xfaed('0x7'),_0xfaed('0x9'),'whatsappPause','faxPause','voicePause',_0xfaed('0x40')];var _0x5201db=_(_0x242cf8)[_0xfaed('0x55')](_0x52639a)[_0xfaed('0x56')](_0x35a20a)[_0xfaed('0x2c')]();return _0x5201db;}exports['filterAgentAttributes']=filterAgentAttributes; \ No newline at end of file +var _0x26d8=['sort','toLowerCase','sortAgentsByStatus','online','lastPauseAt','address','chatCapacity','openchannelCapacity','mailCapacity','smsCapacity','whatsappCapacity','faxCapacity','chatCurrentCapacity','openchannelCurrentCapacity','mailCurrentCapacity','whatsappCurrentCapacity','mailStatus','faxStatus','chatStatusTime','openchannelStatusTime','smsStatusTime','whatsappStatusTime','faxStatusTime','voiceStatusTime','queue','destconnectedlinenum','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','routealias','omit','pick','filterAgentAttributes','../../mysqldb','client','http','chatPause','faxPause','mailPause','openchannelPause','smsPause','voicePause','whatsappPause','every','filter','length','idle','unknown','unavailable','ringing','voiceStatus','pause','chatStatus','openchannelStatus','smsStatus','whatsappStatus','request','Agents','then','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','merge','catch','getRealtimeAgents','*pause','busy','getAgentStatus','startCase','Queue','map','findOne','getAgents','all','flatten','uniq','value','getAgentIdsByStatus','includes','User','findAll','pauseType','find','split','fields','globalStatus','order','startsWith','DESC','ASC','getUpdatedSortOptions','fullname,internal','fullname','internal'];(function(_0x4cd31e,_0x186fd0){var _0x18fd4d=function(_0xf483c8){while(--_0xf483c8){_0x4cd31e['push'](_0x4cd31e['shift']());}};_0x18fd4d(++_0x186fd0);}(_0x26d8,0x194));var _0x826d=function(_0x4db764,_0x3d2900){_0x4db764=_0x4db764-0x0;var _0x11eca4=_0x26d8[_0x4db764];return _0x11eca4;};'use strict';var _=require('lodash');var jayson=require('jayson/promise');var db=require(_0x826d('0x0'))['db'];var amiClient=jayson[_0x826d('0x1')][_0x826d('0x2')]({'port':0x232a});var routingClient=jayson[_0x826d('0x1')][_0x826d('0x2')]({'port':0x232c});function isAgentPaused(_0x593c89,_0x3728f4){var _0x3bd357=[_0x593c89[_0x826d('0x3')],_0x593c89[_0x826d('0x4')],_0x593c89[_0x826d('0x5')],_0x593c89[_0x826d('0x6')],_0x593c89[_0x826d('0x7')],_0x593c89[_0x826d('0x8')],_0x593c89[_0x826d('0x9')]];if(!_0x3728f4)return _[_0x826d('0xa')](_0x3bd357);var _0x14a54f=_[_0x826d('0xb')](_0x3bd357);return _0x14a54f[_0x826d('0xc')]>0x0&&_0x14a54f['length']<_0x3bd357[_0x826d('0xc')]?!![]:![];}function isIdle(_0x41ebfe){return _0x41ebfe===_0x826d('0xd')||_0x41ebfe===_0x826d('0xe')||_0x41ebfe===_0x826d('0xf')||_0x41ebfe===_0x826d('0x10')||_['isNil'](_0x41ebfe);}function isAgentIdle(_0x3b4f9e){if(_0x3b4f9e['voiceStatus']!==_0x826d('0xd')&&_0x3b4f9e[_0x826d('0x8')]){_0x3b4f9e[_0x826d('0x11')]=_0x826d('0x12');return![];}return _[_0x826d('0xa')]([_0x3b4f9e[_0x826d('0x13')],_0x3b4f9e['faxStatus'],_0x3b4f9e['mailStatus'],_0x3b4f9e[_0x826d('0x14')],_0x3b4f9e[_0x826d('0x15')],_0x3b4f9e[_0x826d('0x11')],_0x3b4f9e[_0x826d('0x16')]],isIdle);}function getRealtimeAgents(){return amiClient[_0x826d('0x17')](_0x826d('0x18'),{})[_0x826d('0x19')](function(_0x7664ff){if(_0x7664ff[_0x826d('0x1a')]){throw new Error(_0x826d('0x1b'));}var _0x4c388c=_0x7664ff[_0x826d('0x1c')];return routingClient[_0x826d('0x17')](_0x826d('0x18'),{})[_0x826d('0x19')](function(_0x488765){if(_0x488765['error']){throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)');}var _0xf01dbb=_0x488765[_0x826d('0x1c')];return _[_0x826d('0x1d')]({},_0x4c388c,_0xf01dbb);});})[_0x826d('0x1e')](function(_0x8a197){throw _0x8a197;});}exports[_0x826d('0x1f')]=getRealtimeAgents;function getAgentStatus(_0x4ddbc8){var _0x2d37ed=_0x826d('0xe');if(isAgentPaused(_0x4ddbc8))_0x2d37ed=_0x826d('0x12');else if(isAgentPaused(_0x4ddbc8,!![]))_0x2d37ed=_0x826d('0x20');else if(isAgentIdle(_0x4ddbc8))_0x2d37ed=_0x826d('0xd');else _0x2d37ed=_0x826d('0x21');return _0x2d37ed;}exports[_0x826d('0x22')]=getAgentStatus;function getAgentIdsByQueues(_0xd2da95,_0x574c21){var _0x127e4c=_['isArray'](_0xd2da95)?_0xd2da95:[_0xd2da95];var _0x1831fd=_[_0x826d('0x23')](_0x574c21)+_0x826d('0x24');var _0x573665=_[_0x826d('0x25')](_0x127e4c,function(_0x250dfe){return db[_0x1831fd][_0x826d('0x26')]({'where':{'id':_0x250dfe}})[_0x826d('0x19')](function(_0x401af2){if(!_0x401af2)return[];return _0x401af2[_0x826d('0x27')]({'attributes':['id'],'raw':!![]});});});return Promise[_0x826d('0x28')](_0x573665)['then'](function(_0x3af14b){var _0x55cc57=_(_0x3af14b)[_0x826d('0x29')]()['map']('id')[_0x826d('0x2a')]()[_0x826d('0x2b')]();return _0x55cc57;});}exports['getAgentIdsByQueues']=getAgentIdsByQueues;function getAgentIdsByStatus(_0x39478b,_0x140284,_0x5ab743){try{if(_0x140284['length']>0x0){_0x39478b=_0x39478b[_0x826d('0xb')](function(_0x986969){return _0x140284['includes'](_0x986969['id']);});}var _0x361210=_0x39478b[_0x826d('0xb')](function(_0x29c663){var _0x28d2c9=_0x826d('0x21');if(isAgentIdle(_0x29c663)){_0x28d2c9=_0x826d('0xd');}return _0x28d2c9===_0x5ab743;});return _[_0x826d('0x25')](_0x361210,'id');}catch(_0x19841b){throw _0x19841b;}}exports[_0x826d('0x2c')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x1040a1,_0x5002be,_0x4128ed){return Promise['resolve']()[_0x826d('0x19')](function(){if(_0x5002be[_0x826d('0xc')]>0x0){_0x1040a1=_0x1040a1[_0x826d('0xb')](function(_0x4afae5){return _0x5002be[_0x826d('0x2d')](_0x4afae5['id']);});}return _0x1040a1;})[_0x826d('0x19')](function(){return db[_0x826d('0x2e')][_0x826d('0x2f')]({'attributes':['id','name','fullname',_0x826d('0x3'),_0x826d('0x4'),_0x826d('0x5'),_0x826d('0x6'),_0x826d('0x7'),'voicePause',_0x826d('0x9'),_0x826d('0x30')],'where':{'id':{'$in':_[_0x826d('0x25')](_0x1040a1,'id')}},'raw':!![]});})['then'](function(_0x253fb6){return _0x253fb6['map'](function(_0x46ade7){var _0x21a1dc=_[_0x826d('0x31')](_0x1040a1,['id',_0x46ade7['id']]);var _0x3ea8ce=filterAgentAttributes(_0x21a1dc);_[_0x826d('0x1d')](_0x46ade7,_0x3ea8ce);_0x46ade7['globalStatus']=getAgentStatus(_0x46ade7);return _0x46ade7;});})[_0x826d('0x19')](function(_0x599f01){var _0x2acae8=sortAgentsByStatus(_0x599f01,_0x4128ed);return _[_0x826d('0x25')](_0x2acae8,'id');})[_0x826d('0x1e')](function(_0x24dddc){throw _0x24dddc;});}exports['getSortedAgentsIdsByStatus']=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x3c53cf){var _0x195b48={'fields':[],'order':null};var _0x551ddf=_0x3c53cf[_0x826d('0x32')](',');_0x195b48[_0x826d('0x33')]=_[_0x826d('0xb')](_0x551ddf,function(_0x10ba5d){if(!_0x10ba5d['includes'](_0x826d('0x34'))){return!![];}_0x195b48[_0x826d('0x35')]=_[_0x826d('0x36')](_0x10ba5d,'-')?_0x826d('0x37'):_0x826d('0x38');return![];});return _0x195b48;}exports[_0x826d('0x39')]=getUpdatedSortOptions;function validateSortParameter(_0x4641db){if(!_0x4641db){_0x4641db=_0x826d('0x3a');}if(_0x4641db[_0x826d('0x2d')](_0x826d('0x3b'))&&!_0x4641db[_0x826d('0x2d')](_0x826d('0x3c'))){var _0x10731f=_0x4641db['substring'](0x0,_0x4641db['indexOf'](_0x826d('0x3b')));_0x4641db+=','+_0x10731f+'internal';}return _0x4641db;}exports['validateSortParameter']=validateSortParameter;function sortAgentsByStatus(_0x4def04,_0xbf5a33){var _0x4e91f3=_0x4def04[_0x826d('0x3d')](function(_0x445185,_0x9644f9){if(_0x445185[_0x826d('0x34')]===_0x9644f9[_0x826d('0x34')]){if(_0x445185[_0x826d('0x34')]===_0x826d('0x12')){if(_0xbf5a33===_0x826d('0x37')){return(_0x445185['pauseType']||'')<(_0x9644f9[_0x826d('0x30')]||'')||_0x445185[_0x826d('0x3b')]['toLowerCase']()>_0x9644f9['fullname']['toLowerCase']()?0x1:-0x1;}else{return(_0x445185[_0x826d('0x30')]||'')<(_0x9644f9['pauseType']||'')||_0x445185[_0x826d('0x3b')][_0x826d('0x3e')]()>_0x9644f9[_0x826d('0x3b')][_0x826d('0x3e')]()?-0x1:0x1;}}else{if(_0xbf5a33==='DESC'){return _0x445185[_0x826d('0x3b')]['toLowerCase']()<_0x9644f9[_0x826d('0x3b')]['toLowerCase']()?0x1:-0x1;}else{return _0x445185['fullname'][_0x826d('0x3e')]()<_0x9644f9[_0x826d('0x3b')][_0x826d('0x3e')]()?-0x1:0x1;}}}else{if(_0xbf5a33===_0x826d('0x37')){return _0x445185['globalStatus']<_0x9644f9[_0x826d('0x34')]?0x1:-0x1;}else{return _0x445185[_0x826d('0x34')]<_0x9644f9[_0x826d('0x34')]?-0x1:0x1;}}});return _0x4e91f3;}exports[_0x826d('0x3f')]=sortAgentsByStatus;function filterAgentAttributes(_0x4fa4ff){var _0x15ea4d=['userpic',_0x826d('0x40'),'lastLoginAt',_0x826d('0x41'),_0x826d('0x30'),'lastPauseAt',_0x826d('0x3c'),_0x826d('0x42'),_0x826d('0x3'),_0x826d('0x6'),'mailPause',_0x826d('0x7'),_0x826d('0x9'),_0x826d('0x4'),'voicePause',_0x826d('0x43'),_0x826d('0x44'),_0x826d('0x45'),_0x826d('0x46'),_0x826d('0x47'),_0x826d('0x48'),_0x826d('0x49'),_0x826d('0x4a'),_0x826d('0x4b'),'smsCurrentCapacity',_0x826d('0x4c'),'faxCurrentCapacity','chatStatus',_0x826d('0x14'),_0x826d('0x4d'),'smsStatus',_0x826d('0x16'),_0x826d('0x4e'),_0x826d('0x11'),_0x826d('0x4f'),_0x826d('0x50'),'mailStatusTime',_0x826d('0x51'),_0x826d('0x52'),_0x826d('0x53'),_0x826d('0x54'),_0x826d('0x55'),_0x826d('0x56'),'screenrecording',_0x826d('0x57'),_0x826d('0x58'),_0x826d('0x59')];var _0x2377e4=[_0x826d('0x3'),_0x826d('0x6'),_0x826d('0x5'),'smsPause','whatsappPause','faxPause',_0x826d('0x8'),_0x826d('0x40')];var _0x41155f=_(_0x4fa4ff)[_0x826d('0x5a')](_0x2377e4)[_0x826d('0x5b')](_0x15ea4d)['value']();return _0x41155f;}exports[_0x826d('0x5c')]=filterAgentAttributes; \ No newline at end of file diff --git a/server/components/realtime/queues.js b/server/components/realtime/queues.js index 4373d1e..1a1f61f 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 _0x5a63=['client','loggedIn','paused','waiting','busy','inUse','invalid','loggedInDb','notInUse','ringInUse','talking','unavailable','unknown','originated','dialMethod','Trunk','startPredictive','startProgressive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','voice','request','startCase','error','format','result','getRealtimeQueues','inbound','concat','outbound','map','get','pTalking','find','pick','jayson/promise','util','http'];(function(_0x3a16d4,_0x23ecda){var _0x31ea9c=function(_0x35fea8){while(--_0x35fea8){_0x3a16d4['push'](_0x3a16d4['shift']());}};_0x31ea9c(++_0x23ecda);}(_0x5a63,0x11d));var _0x35a6=function(_0x4bfd8e,_0x29fa05){_0x4bfd8e=_0x4bfd8e-0x0;var _0xec89f4=_0x5a63[_0x4bfd8e];return _0xec89f4;};'use strict';var _=require('lodash');var jayson=require(_0x35a6('0x0'));var util=require(_0x35a6('0x1'));var amiClient=jayson['client'][_0x35a6('0x2')]({'port':0x232a});var routingClient=jayson[_0x35a6('0x3')][_0x35a6('0x2')]({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=['available',_0x35a6('0x4'),_0x35a6('0x5'),_0x35a6('0x6')];var VOICE_QUEUE_ATTRIBUTES=[_0x35a6('0x7'),_0x35a6('0x8'),_0x35a6('0x9'),_0x35a6('0xa'),_0x35a6('0xb'),'onHold','ringing',_0x35a6('0xc'),_0x35a6('0xd'),_0x35a6('0xe'),_0x35a6('0xf')];var OUTBOUND_QUEUE_ATTRIBUTES=['pTalking',_0x35a6('0x10'),'message','statusMessage','dialActive',_0x35a6('0x11'),_0x35a6('0x12'),_0x35a6('0x13'),_0x35a6('0x14'),_0x35a6('0x15'),_0x35a6('0x16'),_0x35a6('0x17'),_0x35a6('0x18'),'dialPredictiveInterval','dialPredictiveIntervalMaxThreshold',_0x35a6('0x19'),_0x35a6('0x1a'),_0x35a6('0x1b'),_0x35a6('0x1c'),_0x35a6('0x1d'),_0x35a6('0x1e'),_0x35a6('0x1f'),_0x35a6('0x20')];function getRealtimeQueues(_0x50ae21,_0x59fcb0){var _0x2ec9ee=_0x59fcb0===_0x35a6('0x21')?amiClient:routingClient;return _0x2ec9ee[_0x35a6('0x22')](_[_0x35a6('0x23')](_0x59fcb0)+'Queues',_0x50ae21)['then'](function(_0x240159){if(_0x240159[_0x35a6('0x24')])throw new Error(util[_0x35a6('0x25')]('Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues',_0x59fcb0));return _0x240159[_0x35a6('0x26')];})['catch'](function(_0x330bac){throw _0x330bac;});}exports[_0x35a6('0x27')]=getRealtimeQueues;function initializeQueues(_0x22efa7,_0xf859c2,_0x44c0ce,_0x5daba0){var _0xd86f8a=DEFAULT_QUEUE_ATTRIBUTES;if(_0x44c0ce===_0x35a6('0x21')){if(_0x5daba0===_0x35a6('0x28')){_0xd86f8a=_0xd86f8a[_0x35a6('0x29')](VOICE_QUEUE_ATTRIBUTES);}else if(_0x5daba0===_0x35a6('0x2a')){_0xd86f8a=_0xd86f8a['concat'](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0x22efa7[_0x35a6('0x2b')](function(_0xe3f2a8){var _0x569239=_0xe3f2a8[_0x35a6('0x2c')]({'plain':!![]});_0x569239['paused']=0x0;_0x569239[_0x35a6('0xa')]=0x0;_0x569239['loggedIn']=0x0;_0x569239['available']=0x0;_0x569239[_0x35a6('0x6')]=0x0;if(_0x44c0ce==='voice'){_0x569239['talking']=0x0;_0x569239[_0x35a6('0x7')]=0x0;if(_0x5daba0===_0x35a6('0x2a')){_0x569239[_0x35a6('0x2d')]=0x0;_0x569239['originated']=0x0;}}var _0x921abd=_[_0x35a6('0x2e')](_0xf859c2,['id',_0x569239['id']]);if(_0x921abd){_['merge'](_0x569239,_[_0x35a6('0x2f')](_0x921abd,_0xd86f8a));}return _0x569239;});}exports['initializeQueues']=initializeQueues; \ No newline at end of file +var _0x1aa6=['ringing','ringInUse','talking','unavailable','pTalking','message','dialActive','dialMethod','Trunk','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','voice','request','startCase','Queues','error','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','catch','getRealtimeQueues','concat','outbound','map','get','originated','find','merge','initializeQueues','lodash','jayson/promise','util','client','http','available','paused','waiting','busy','inUse','invalid','loggedInDb','notInUse','onHold'];(function(_0x5365ad,_0x41ec9b){var _0x365519=function(_0x5f0cd2){while(--_0x5f0cd2){_0x5365ad['push'](_0x5365ad['shift']());}};_0x365519(++_0x41ec9b);}(_0x1aa6,0x1f0));var _0x61aa=function(_0x5f519b,_0x5b606f){_0x5f519b=_0x5f519b-0x0;var _0x2461e2=_0x1aa6[_0x5f519b];return _0x2461e2;};'use strict';var _=require(_0x61aa('0x0'));var jayson=require(_0x61aa('0x1'));var util=require(_0x61aa('0x2'));var amiClient=jayson[_0x61aa('0x3')][_0x61aa('0x4')]({'port':0x232a});var routingClient=jayson['client'][_0x61aa('0x4')]({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=[_0x61aa('0x5'),'loggedIn',_0x61aa('0x6'),_0x61aa('0x7')];var VOICE_QUEUE_ATTRIBUTES=[_0x61aa('0x8'),_0x61aa('0x9'),_0x61aa('0xa'),_0x61aa('0xb'),_0x61aa('0xc'),_0x61aa('0xd'),_0x61aa('0xe'),_0x61aa('0xf'),_0x61aa('0x10'),_0x61aa('0x11'),'unknown'];var OUTBOUND_QUEUE_ATTRIBUTES=[_0x61aa('0x12'),'originated',_0x61aa('0x13'),'statusMessage',_0x61aa('0x14'),_0x61aa('0x15'),_0x61aa('0x16'),'startPredictive','startProgressive',_0x61aa('0x17'),_0x61aa('0x18'),_0x61aa('0x19'),'erlangBusyFactor',_0x61aa('0x1a'),_0x61aa('0x1b'),'dialPredictiveIntervalMinThreshold',_0x61aa('0x1c'),_0x61aa('0x1d'),_0x61aa('0x1e'),'predictiveIntervalDroppedCallsTimeout',_0x61aa('0x1f'),_0x61aa('0x20'),_0x61aa('0x21')];function getRealtimeQueues(_0x2659fd,_0x148264){var _0x549784=_0x148264===_0x61aa('0x22')?amiClient:routingClient;return _0x549784[_0x61aa('0x23')](_[_0x61aa('0x24')](_0x148264)+_0x61aa('0x25'),_0x2659fd)['then'](function(_0x356d99){if(_0x356d99[_0x61aa('0x26')])throw new Error(util[_0x61aa('0x27')](_0x61aa('0x28'),_0x148264));return _0x356d99['result'];})[_0x61aa('0x29')](function(_0x455979){throw _0x455979;});}exports[_0x61aa('0x2a')]=getRealtimeQueues;function initializeQueues(_0x30140b,_0x4d81d8,_0x5f0768,_0x2ffaec){var _0x1508d5=DEFAULT_QUEUE_ATTRIBUTES;if(_0x5f0768===_0x61aa('0x22')){if(_0x2ffaec==='inbound'){_0x1508d5=_0x1508d5[_0x61aa('0x2b')](VOICE_QUEUE_ATTRIBUTES);}else if(_0x2ffaec===_0x61aa('0x2c')){_0x1508d5=_0x1508d5[_0x61aa('0x2b')](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0x30140b[_0x61aa('0x2d')](function(_0x1e259d){var _0x48e77e=_0x1e259d[_0x61aa('0x2e')]({'plain':!![]});_0x48e77e[_0x61aa('0x6')]=0x0;_0x48e77e[_0x61aa('0xb')]=0x0;_0x48e77e['loggedIn']=0x0;_0x48e77e['available']=0x0;_0x48e77e[_0x61aa('0x7')]=0x0;if(_0x5f0768===_0x61aa('0x22')){_0x48e77e[_0x61aa('0x10')]=0x0;_0x48e77e[_0x61aa('0x8')]=0x0;if(_0x2ffaec===_0x61aa('0x2c')){_0x48e77e['pTalking']=0x0;_0x48e77e[_0x61aa('0x2f')]=0x0;}}var _0x277482=_[_0x61aa('0x30')](_0x4d81d8,['id',_0x48e77e['id']]);if(_0x277482){_[_0x61aa('0x31')](_0x48e77e,_['pick'](_0x277482,_0x1508d5));}return _0x48e77e;});}exports[_0x61aa('0x32')]=initializeQueues; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index 8a89139..adf91e3 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(_0x37f053,_0x4b2ad0){var _0x78f6a0=function(_0x84b926){while(--_0x84b926){_0x37f053['push'](_0x37f053['shift']());}};_0x78f6a0(++_0x4b2ad0);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var express=require(_0x7995('0x0'));var methodOverride=require(_0x7995('0x1'));var cookieParser=require(_0x7995('0x2'));var errorHandler=require(_0x7995('0x3'));var path=require('path');var passport=require(_0x7995('0x4'));var cors=require(_0x7995('0x5'));var config=require(_0x7995('0x6'));exports[_0x7995('0x7')]=function(_0x576d89){var _0x744bea=_0x576d89[_0x7995('0x8')](_0x7995('0x9'));if(_0x744bea===_0x7995('0xa')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path['join'](config[_0x7995('0xd')],_0x7995('0xe')));}if(_0x744bea==='development'||_0x744bea===_0x7995('0xf')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path[_0x7995('0x10')](config[_0x7995('0xd')],_0x7995('0x11')));_0x576d89[_0x7995('0x12')](errorHandler());}_0x576d89['set'](_0x7995('0x13'),function(_0x41c652,_0x581f22){if(this[_0x41c652]instanceof Date){_0x581f22=this[_0x41c652][_0x7995('0x14')]()[_0x7995('0x15')]('.')[0x0]+'Z';}return _0x581f22;});_0x576d89[_0x7995('0x12')](express[_0x7995('0x16')](_0x576d89[_0x7995('0x8')](_0x7995('0xc'))));_0x576d89[_0x7995('0xb')]('views',config['root']+_0x7995('0x17'));_0x576d89[_0x7995('0x18')](_0x7995('0x19'),require(_0x7995('0x1a'))[_0x7995('0x1b')]);_0x576d89[_0x7995('0xb')](_0x7995('0x1c'),_0x7995('0x19'));_0x576d89['use'](express[_0x7995('0x1d')]({'limit':'50mb','extended':!![]}));_0x576d89[_0x7995('0x12')](express[_0x7995('0x1e')]({'limit':_0x7995('0x1f')}));_0x576d89[_0x7995('0x12')](cors());_0x576d89[_0x7995('0x12')](methodOverride());_0x576d89[_0x7995('0x12')](cookieParser());_0x576d89['use'](passport['initialize']());}; \ No newline at end of file +var _0x9957=['root','public','test','join','client','use','json\x20replacer','toISOString','split','static','/server/views','engine','html','ejs','renderFile','view\x20engine','urlencoded','json','50mb','express','method-override','cookie-parser','errorhandler','passport','cors','./environment','default','get','env','production','set','appPath'];(function(_0x223734,_0x15c460){var _0x2705e4=function(_0x623605){while(--_0x623605){_0x223734['push'](_0x223734['shift']());}};_0x2705e4(++_0x15c460);}(_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 diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index a0290a8..ae4c3aa 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 _0x4dba=['macAddress','md5','update','substring','lodash','crypto','bimedia-machine-uuid','../environment','orderBy','keys','filter','family','internal','concat','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','cpus','map','model','createHash','digest','hex','getUuid','test','licenseToken','win32','utf8','replace'];(function(_0x544620,_0x3bef42){var _0x259b5e=function(_0x57b3a6){while(--_0x57b3a6){_0x544620['push'](_0x544620['shift']());}};_0x259b5e(++_0x3bef42);}(_0x4dba,0x9f));var _0xa4db=function(_0xa50aeb,_0x397379){_0xa50aeb=_0xa50aeb-0x0;var _0x424ab2=_0x4dba[_0xa50aeb];return _0x424ab2;};'use strict';var _=require(_0xa4db('0x0'));var os=require('os');var crypto=require(_0xa4db('0x1'));var machine=require(_0xa4db('0x2'));var exec=require('child_process')['execSync'];var config=require(_0xa4db('0x3'));function getInterfaces(){var _0x47727e=[];var _0x23a910=os['networkInterfaces']();var _0x7091d7=_[_0xa4db('0x4')](_[_0xa4db('0x5')](_0x23a910));for(var _0x2d4700=0x0;_0x2d4700<_0x7091d7['length'];_0x2d4700++){var _0x56427a=_0x23a910[_0x7091d7[_0x2d4700]][_0xa4db('0x6')](function(_0x3e710c){return _0x3e710c[_0xa4db('0x7')]==='IPv4'&&_0x3e710c[_0xa4db('0x8')]===![];});_0x47727e=_0x47727e[_0xa4db('0x9')](_0x56427a);}return _0x47727e;}function getFirstInterface(){var _0x3b6fd7=_['head'](getInterfaces());return{'macAddress':_0x3b6fd7&&_0x3b6fd7[_0xa4db('0xa')]?_0x3b6fd7['mac']:_0xa4db('0xb'),'ipAddress':_0x3b6fd7&&_0x3b6fd7[_0xa4db('0xc')]?_0x3b6fd7['address']:_0xa4db('0xd')};}exports[_0xa4db('0xe')]=getFirstInterface;function getCPUhash(){var _0x576634=_[_0xa4db('0x4')](os[_0xa4db('0xf')]()[_0xa4db('0x10')](function(_0x373ef7){return _0x373ef7[_0xa4db('0x11')];}))['join'](':');return crypto[_0xa4db('0x12')]('md5')['update'](_0x576634)[_0xa4db('0x13')](_0xa4db('0x14'));}exports[_0xa4db('0x15')]=function(){var _0x15e28a=os['platform']();var _0xd2351f=/[0-9a-f-]{36}/;if(config['licenseToken']&&_0xd2351f[_0xa4db('0x16')](config['licenseToken'])){return config[_0xa4db('0x17')];}else if(_0x15e28a===_0xa4db('0x18')){return exec('dmidecode\x20--string\x20system-uuid',{'encoding':_0xa4db('0x19')})[_0xa4db('0x1a')]('\x0d\x0a','');}else{var _0x2c992a=getFirstInterface();var _0x55d765=getCPUhash();var _0x445a98=_0x55d765+'|'+os['hostname']()+'|'+_0x2c992a[_0xa4db('0x1b')]+'|'+_0x2c992a['ipAddress'];var _0x15dcf7=crypto[_0xa4db('0x12')](_0xa4db('0x1c'))[_0xa4db('0x1d')](_0x445a98)[_0xa4db('0x13')](_0xa4db('0x14'));return _0x15dcf7[_0xa4db('0x1e')](0x0,0x8)+'-'+_0x15dcf7['substring'](0x8,0xc)+'-'+_0x15dcf7[_0xa4db('0x1e')](0xc,0x10)+'-'+_0x15dcf7['substring'](0x10,0x14)+'-'+_0x15dcf7[_0xa4db('0x1e')](0x14);}}; \ No newline at end of file +var _0xed34=['ipAddress','substring','crypto','bimedia-machine-uuid','child_process','../environment','networkInterfaces','orderBy','keys','length','filter','IPv4','internal','concat','mac','address','127.0.0.1','getFirstInterface','cpus','map','model','join','createHash','md5','update','digest','hex','test','win32','utf8','hostname'];(function(_0x34326b,_0x126058){var _0x594547=function(_0x563733){while(--_0x563733){_0x34326b['push'](_0x34326b['shift']());}};_0x594547(++_0x126058);}(_0xed34,0x1f2));var _0x4ed3=function(_0x15498,_0x8880e){_0x15498=_0x15498-0x0;var _0x530e85=_0xed34[_0x15498];return _0x530e85;};'use strict';var _=require('lodash');var os=require('os');var crypto=require(_0x4ed3('0x0'));var machine=require(_0x4ed3('0x1'));var exec=require(_0x4ed3('0x2'))['execSync'];var config=require(_0x4ed3('0x3'));function getInterfaces(){var _0x2ce90a=[];var _0x58c8ec=os[_0x4ed3('0x4')]();var _0x25b28d=_[_0x4ed3('0x5')](_[_0x4ed3('0x6')](_0x58c8ec));for(var _0x25af75=0x0;_0x25af75<_0x25b28d[_0x4ed3('0x7')];_0x25af75++){var _0x18b3b0=_0x58c8ec[_0x25b28d[_0x25af75]][_0x4ed3('0x8')](function(_0x20ff48){return _0x20ff48['family']===_0x4ed3('0x9')&&_0x20ff48[_0x4ed3('0xa')]===![];});_0x2ce90a=_0x2ce90a[_0x4ed3('0xb')](_0x18b3b0);}return _0x2ce90a;}function getFirstInterface(){var _0x1476bb=_['head'](getInterfaces());return{'macAddress':_0x1476bb&&_0x1476bb[_0x4ed3('0xc')]?_0x1476bb[_0x4ed3('0xc')]:'00:00:00:00:00:00','ipAddress':_0x1476bb&&_0x1476bb[_0x4ed3('0xd')]?_0x1476bb[_0x4ed3('0xd')]:_0x4ed3('0xe')};}exports[_0x4ed3('0xf')]=getFirstInterface;function getCPUhash(){var _0x506f5f=_[_0x4ed3('0x5')](os[_0x4ed3('0x10')]()[_0x4ed3('0x11')](function(_0x50841c){return _0x50841c[_0x4ed3('0x12')];}))[_0x4ed3('0x13')](':');return crypto[_0x4ed3('0x14')](_0x4ed3('0x15'))[_0x4ed3('0x16')](_0x506f5f)[_0x4ed3('0x17')](_0x4ed3('0x18'));}exports['getUuid']=function(){var _0x7cd487=os['platform']();var _0x493c6a=/[0-9a-f-]{36}/;if(config['licenseToken']&&_0x493c6a[_0x4ed3('0x19')](config['licenseToken'])){return config['licenseToken'];}else if(_0x7cd487===_0x4ed3('0x1a')){return exec('dmidecode\x20--string\x20system-uuid',{'encoding':_0x4ed3('0x1b')})['replace']('\x0d\x0a','');}else{var _0x80a1ee=getFirstInterface();var _0x4b2f95=getCPUhash();var _0x550bdb=_0x4b2f95+'|'+os[_0x4ed3('0x1c')]()+'|'+_0x80a1ee['macAddress']+'|'+_0x80a1ee[_0x4ed3('0x1d')];var _0x491113=crypto[_0x4ed3('0x14')](_0x4ed3('0x15'))[_0x4ed3('0x16')](_0x550bdb)[_0x4ed3('0x17')]('hex');return _0x491113[_0x4ed3('0x1e')](0x0,0x8)+'-'+_0x491113[_0x4ed3('0x1e')](0x8,0xc)+'-'+_0x491113[_0x4ed3('0x1e')](0xc,0x10)+'-'+_0x491113[_0x4ed3('0x1e')](0x10,0x14)+'-'+_0x491113[_0x4ed3('0x1e')](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index a4afd0e..aedfbfe 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 _0xff16=['Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','encryptString','diff','days','DEMO\x20START\x20AT\x20%s','error','getUuid','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','message','default','util','moment','request-promise','bluebird','version','../../components/encryptor','./hardware','../logger','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','then','catch','get','data1','data2','active','license','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update'];(function(_0x5af7e2,_0x2a2ce2){var _0x156d8b=function(_0x3c7e62){while(--_0x3c7e62){_0x5af7e2['push'](_0x5af7e2['shift']());}};_0x156d8b(++_0x2a2ce2);}(_0xff16,0x161));var _0x6ff1=function(_0xcbfd81,_0x3273f7){_0xcbfd81=_0xcbfd81-0x0;var _0xe26470=_0xff16[_0xcbfd81];return _0xe26470;};'use strict';var util=require(_0x6ff1('0x0'));var moment=require(_0x6ff1('0x1'));var rp=require(_0x6ff1('0x2'));var BPromise=require(_0x6ff1('0x3'));var pkginfo=require('pkginfo')(module,_0x6ff1('0x4'));var db=require('../../mysqldb')['db'];var encryptor=require(_0x6ff1('0x5'));var hardware=require(_0x6ff1('0x6'));var logger=require(_0x6ff1('0x7'))('license');var HOST=_0x6ff1('0x8');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x39b0a3){return new BPromise(function(_0x34bc55,_0x34b13f){var _0xf61e3e=util[_0x6ff1('0x9')](_0x6ff1('0xa'),HOST,_0x39b0a3,module[_0x6ff1('0xb')][_0x6ff1('0x4')]);if(oldToken){_0xf61e3e=util[_0x6ff1('0x9')](_0x6ff1('0xc'),HOST,_0x39b0a3,module['exports'][_0x6ff1('0x4')],oldToken);}var _0x2d9d78={'uri':_0xf61e3e,'method':_0x6ff1('0xd'),'timeout':0xea60,'json':!![]};return rp(_0x2d9d78)[_0x6ff1('0xe')](function(_0x2007f7){_0x34bc55(_0x2007f7);})[_0x6ff1('0xf')](function(_0x14107f){_0x34b13f(_0x14107f);});});}function manageLicense(_0x587940,_0x49b472){var _0x647555=_0x49b472[_0x6ff1('0x10')]({'plain':!![]});if(!isOldTokenSent&&_0x647555[_0x6ff1('0x11')]!==_0x587940&&!_0x647555[_0x6ff1('0x12')]){oldToken=_0x647555[_0x6ff1('0x11')];}httpRequest(_0x587940)[_0x6ff1('0xe')](function(_0x3df238){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x3df238[_0x6ff1('0x13')]){isOldTokenSent=![];if(!_0x647555[_0x6ff1('0x14')]&&_0x647555[_0x6ff1('0x14')]!=_0x3df238[_0x6ff1('0x14')]||_0x647555[_0x6ff1('0x14')]&&_0x647555['data2']){logger[_0x6ff1('0x15')](_0x6ff1('0x16'));}if(_0x647555[_0x6ff1('0x14')]&&!_0x647555[_0x6ff1('0x12')]&&_0x647555[_0x6ff1('0x14')]!=_0x3df238[_0x6ff1('0x14')]){logger['info'](_0x6ff1('0x17'));}if(_0x647555[_0x6ff1('0x14')]&&!_0x647555[_0x6ff1('0x12')]&&_0x647555[_0x6ff1('0x14')]==_0x3df238[_0x6ff1('0x14')]){return _0x49b472;}return _0x49b472[_0x6ff1('0x18')]({'data1':_0x587940,'data2':null,'license':_0x3df238[_0x6ff1('0x14')]});}else{if(_0x3df238[_0x6ff1('0x14')]||_0x647555['license']){if(!_0x647555[_0x6ff1('0x12')]){if(_0x647555[_0x6ff1('0x11')]==_0x587940){GRAY_PERIOD_REASON=_0x6ff1('0x19');logger['info'](_0x6ff1('0x1a'));}else{GRAY_PERIOD_REASON=_0x6ff1('0x1b');logger[_0x6ff1('0x15')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x647555['data1'],_0x587940);}logger[_0x6ff1('0x15')](_0x6ff1('0x1c'),GRAY_PERIOD_REASON[_0x6ff1('0x1d')](),moment()['format'](_0x6ff1('0x1e')));return _0x49b472['update']({'data2':encryptor[_0x6ff1('0x1f')](moment()[_0x6ff1('0x9')](_0x6ff1('0x1e')))});}else{if(moment()[_0x6ff1('0x20')](encryptor['decryptString'](_0x647555[_0x6ff1('0x12')]),_0x6ff1('0x21'))>DAYS){logger[_0x6ff1('0x15')](_0x6ff1('0x22'),moment()[_0x6ff1('0x9')](_0x6ff1('0x1e')));isOldTokenSent=![];return _0x49b472[_0x6ff1('0x18')]({'data1':_0x587940,'data2':null,'license':null});}}}else{if(_0x647555[_0x6ff1('0x11')]!=_0x587940){logger['info']('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x647555['data1'],_0x587940);return _0x49b472[_0x6ff1('0x18')]({'data1':_0x587940,'data2':null,'license':null});}}}return _0x49b472;})[_0x6ff1('0xe')](function(_0x103d4a){_0x49b472=_0x103d4a;})[_0x6ff1('0xf')](function(_0x1aca24){logger[_0x6ff1('0x23')](_0x1aca24['message']);})['finally'](function(){setTimeout(function(){manageLicense(hardware[_0x6ff1('0x24')](),_0x49b472);},TIME);});}function defaultLicense(){var _0x1b5ecb=hardware['getUuid']();if(_0x1b5ecb){return db['License'][_0x6ff1('0x25')]({'where':{'id':0x1},'defaults':{'data1':_0x1b5ecb}})[_0x6ff1('0x26')](function(_0x4cff21,_0x2e1dcd){logger['info'](_0x6ff1('0x27'),_0x1b5ecb);manageLicense(_0x1b5ecb,_0x4cff21);})['catch'](function(_0x149ae5){logger[_0x6ff1('0x23')](_0x149ae5[_0x6ff1('0x28')]);});}}exports[_0x6ff1('0x29')]=defaultLicense; \ No newline at end of file +var _0x58f3=['getUuid','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','message','default','request-promise','bluebird','pkginfo','version','./hardware','../logger','license','https://www.xcallymotion.com','%s/api/servers/%s/check?version=%s','format','%s/api/servers/%s/check?version=%s&oldtoken=%s','exports','GET','then','data1','data2','active','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','toUpperCase','diff','days','DEMO\x20START\x20AT\x20%s','YYYY-MM-DD\x20HH:mm','update','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','catch','error','finally'];(function(_0x532278,_0x56cd84){var _0x2881c9=function(_0x24e9ea){while(--_0x24e9ea){_0x532278['push'](_0x532278['shift']());}};_0x2881c9(++_0x56cd84);}(_0x58f3,0xf7));var _0x358f=function(_0x2dc059,_0x1db81d){_0x2dc059=_0x2dc059-0x0;var _0x28b419=_0x58f3[_0x2dc059];return _0x28b419;};'use strict';var util=require('util');var moment=require('moment');var rp=require(_0x358f('0x0'));var BPromise=require(_0x358f('0x1'));var pkginfo=require(_0x358f('0x2'))(module,_0x358f('0x3'));var db=require('../../mysqldb')['db'];var encryptor=require('../../components/encryptor');var hardware=require(_0x358f('0x4'));var logger=require(_0x358f('0x5'))(_0x358f('0x6'));var HOST=_0x358f('0x7');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x30f53f){return new BPromise(function(_0x1f6e6c,_0x6a8d2){var _0xe23d65=util['format'](_0x358f('0x8'),HOST,_0x30f53f,module['exports'][_0x358f('0x3')]);if(oldToken){_0xe23d65=util[_0x358f('0x9')](_0x358f('0xa'),HOST,_0x30f53f,module[_0x358f('0xb')]['version'],oldToken);}var _0x576ea9={'uri':_0xe23d65,'method':_0x358f('0xc'),'timeout':0xea60,'json':!![]};return rp(_0x576ea9)[_0x358f('0xd')](function(_0x5c374b){_0x1f6e6c(_0x5c374b);})['catch'](function(_0x37ec15){_0x6a8d2(_0x37ec15);});});}function manageLicense(_0x1cb092,_0x5ed856){var _0x4f89a9=_0x5ed856['get']({'plain':!![]});if(!isOldTokenSent&&_0x4f89a9[_0x358f('0xe')]!==_0x1cb092&&!_0x4f89a9[_0x358f('0xf')]){oldToken=_0x4f89a9[_0x358f('0xe')];}httpRequest(_0x1cb092)['then'](function(_0x2bc181){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x2bc181[_0x358f('0x10')]){isOldTokenSent=![];if(!_0x4f89a9['license']&&_0x4f89a9[_0x358f('0x6')]!=_0x2bc181['license']||_0x4f89a9[_0x358f('0x6')]&&_0x4f89a9[_0x358f('0xf')]){logger[_0x358f('0x11')](_0x358f('0x12'));}if(_0x4f89a9[_0x358f('0x6')]&&!_0x4f89a9['data2']&&_0x4f89a9[_0x358f('0x6')]!=_0x2bc181[_0x358f('0x6')]){logger[_0x358f('0x11')](_0x358f('0x13'));}if(_0x4f89a9[_0x358f('0x6')]&&!_0x4f89a9[_0x358f('0xf')]&&_0x4f89a9[_0x358f('0x6')]==_0x2bc181['license']){return _0x5ed856;}return _0x5ed856['update']({'data1':_0x1cb092,'data2':null,'license':_0x2bc181['license']});}else{if(_0x2bc181[_0x358f('0x6')]||_0x4f89a9['license']){if(!_0x4f89a9[_0x358f('0xf')]){if(_0x4f89a9['data1']==_0x1cb092){GRAY_PERIOD_REASON=_0x358f('0x14');logger[_0x358f('0x11')](_0x358f('0x15'));}else{GRAY_PERIOD_REASON=_0x358f('0x16');logger['info']('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x4f89a9['data1'],_0x1cb092);}logger[_0x358f('0x11')]('%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s',GRAY_PERIOD_REASON[_0x358f('0x17')](),moment()[_0x358f('0x9')]('YYYY-MM-DD\x20HH:mm'));return _0x5ed856['update']({'data2':encryptor['encryptString'](moment()[_0x358f('0x9')]('YYYY-MM-DD\x20HH:mm'))});}else{if(moment()[_0x358f('0x18')](encryptor['decryptString'](_0x4f89a9[_0x358f('0xf')]),_0x358f('0x19'))>DAYS){logger[_0x358f('0x11')](_0x358f('0x1a'),moment()['format'](_0x358f('0x1b')));isOldTokenSent=![];return _0x5ed856[_0x358f('0x1c')]({'data1':_0x1cb092,'data2':null,'license':null});}}}else{if(_0x4f89a9[_0x358f('0xe')]!=_0x1cb092){logger['info'](_0x358f('0x1d'),_0x4f89a9[_0x358f('0xe')],_0x1cb092);return _0x5ed856[_0x358f('0x1c')]({'data1':_0x1cb092,'data2':null,'license':null});}}}return _0x5ed856;})[_0x358f('0xd')](function(_0x1874c1){_0x5ed856=_0x1874c1;})[_0x358f('0x1e')](function(_0x39e55d){logger[_0x358f('0x1f')](_0x39e55d['message']);})[_0x358f('0x20')](function(){setTimeout(function(){manageLicense(hardware[_0x358f('0x21')](),_0x5ed856);},TIME);});}function defaultLicense(){var _0x3c64d7=hardware[_0x358f('0x21')]();if(_0x3c64d7){return db[_0x358f('0x22')][_0x358f('0x23')]({'where':{'id':0x1},'defaults':{'data1':_0x3c64d7}})[_0x358f('0x24')](function(_0xbd7619,_0x1ba449){logger[_0x358f('0x11')](_0x358f('0x25'),_0x3c64d7);manageLicense(_0x3c64d7,_0xbd7619);})[_0x358f('0x1e')](function(_0x4a138a){logger[_0x358f('0x1f')](_0x4a138a[_0x358f('0x26')]);});}}exports[_0x358f('0x27')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index 94e3736..2839c44 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 _0x0794=['License','find','defaults','then','catch','uuid','data1','license','isEmpty','License\x20key\x20value\x20not\x20found','split','parse','machineUuid','decryptString','deadline','add','days','changed','disabled','message','User','findAll','sequelize','col','role','admin','users','telephones','forEach','user','count','pick','countBy','telephone','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','util','bluebird','../../mysqldb','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid'];(function(_0x9f140b,_0x1b5921){var _0x200190=function(_0x329ba5){while(--_0x329ba5){_0x9f140b['push'](_0x9f140b['shift']());}};_0x200190(++_0x1b5921);}(_0x0794,0xfc));var _0x4079=function(_0x7d061a,_0x1a35a5){_0x7d061a=_0x7d061a-0x0;var _0x42596a=_0x0794[_0x7d061a];return _0x42596a;};'use strict';var util=require(_0x4079('0x0'));var _=require('lodash');var moment=require('moment');var BPromise=require(_0x4079('0x1'));var hardware=require('./hardware');var encryptor=require('../../components/encryptor');var db=require(_0x4079('0x2'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x4079('0x3'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x4079('0x4'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x4079('0x3'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':'Breaking\x20license','machineUuid':hardware[_0x4079('0x5')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x2e6774){return new BPromise(function(_0x3a2a91,_0x4ae93c){return db[_0x4079('0x6')][_0x4079('0x7')](_[_0x4079('0x8')](_0x2e6774,{'raw':!![],'where':{'id':0x1}}))['then'](function(_0x4ee193){return checkLicense(_0x4ee193,null);})[_0x4079('0x9')](function(_0x244ff0){_0x3a2a91(_0x244ff0);return;})[_0x4079('0xa')](function(_0xdb6114){_0x4ae93c(_0xdb6114);});});}function checkLicense(_0x4fe3d8,_0x32547b){if(!_0x4fe3d8){demoLicense[_0x4079('0xb')]=_0x4fe3d8[_0x4079('0xc')];return demoLicense;}try{var _0x2192c2=_0x32547b||_0x4fe3d8[_0x4079('0xd')];if(_[_0x4079('0xe')](_0x2192c2)){throw new Error(_0x4079('0xf'));}var _0x520c56=_0x4fe3d8[_0x4079('0xc')];var _0x365472=_0x4fe3d8['data2'];var _0x247f1d=_0x520c56[_0x4079('0x10')]('-')[0x4];var _0x586e95=_0x520c56['split']('-')[0x0];var _0x316a53=encryptor['decryptString'](_0x2192c2,util['format']('%s:%s:%s',_0x247f1d,_0x520c56,_0x586e95));var _0x4396e8=JSON[_0x4079('0x11')](_0x316a53);_0x4396e8['demo']=![];_0x4396e8['uuid']=_0x520c56;_0x4396e8[_0x4079('0x12')]=hardware[_0x4079('0x5')]();if(_0x365472){var _0x5085c3=encryptor[_0x4079('0x13')](_0x365472);_0x4396e8['gray']=_0x5085c3;_0x4396e8[_0x4079('0x14')]=moment(_0x5085c3)[_0x4079('0x15')](0x7,_0x4079('0x16'))['format']();_0x4396e8['grayReason']=_0x4396e8['uuid']!=_0x4396e8[_0x4079('0x12')]?_0x4079('0x17'):_0x4079('0x18');}return _0x4396e8;}catch(_0x4492c8){breakingLicense['uuid']=_0x4fe3d8[_0x4079('0xc')];breakingLicense[_0x4079('0x19')]=_0x4492c8['message'];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x239b3c,_0x152839){getLicense()['then'](function(_0x381dbc){return db[_0x4079('0x1a')][_0x4079('0x1b')]({'attributes':['role',[db['sequelize']['fn']('COUNT',db[_0x4079('0x1c')][_0x4079('0x1d')]('role')),'count']],'group':_0x4079('0x1e'),'where':{'role':{'$or':[_0x4079('0x1f'),'user','telephone']}},'raw':!![]})[_0x4079('0x9')](function(_0x2c6e36){var _0xf04814={'user':_0x381dbc[_0x4079('0x20')]||0x0,'telephone':_0x381dbc[_0x4079('0x21')]||0x0};_0x2c6e36[_0x4079('0x22')](function(_0x316f6c){var _0x290264=_0x316f6c[_0x4079('0x1e')]==='admin'?_0x4079('0x23'):_0x316f6c[_0x4079('0x1e')];_0xf04814[_0x290264]-=_0x316f6c[_0x4079('0x24')];if(_0xf04814[_0x290264]<0x0)_0xf04814[_0x290264]=0x0;});_0x239b3c(_0xf04814);return;});})[_0x4079('0xa')](function(_0x2e1a74){_0x152839(_0x2e1a74);});});}function checkUserLimits(_0x315b0a){return new BPromise(function(_0x4d8e1e,_0x161e67){getLimits()[_0x4079('0x9')](function(_0x5148e9){var _0x18856f=_[_0x4079('0x25')](_[_0x4079('0x26')](_0x315b0a,_0x4079('0x1e')),['admin',_0x4079('0x23'),'telephone']);var _0x5cdb19=(_0x18856f[_0x4079('0x1f')]||0x0)+(_0x18856f['user']||0x0);var _0x3a4d33=_0x18856f[_0x4079('0x27')]||0x0;if(_0x5cdb19>_0x5148e9[_0x4079('0x23')])return _0x161e67(_0x4079('0x28'));if(_0x3a4d33>_0x5148e9[_0x4079('0x27')])return _0x161e67(_0x4079('0x29'));return _0x4d8e1e();})['catch'](function(_0x3f2d0e){_0x161e67(_0x3f2d0e);});});}module[_0x4079('0x2a')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0x88e9=['isEmpty','License\x20key\x20value\x20not\x20found','data1','data2','split','format','parse','demo','uuid','machineUuid','decryptString','deadline','days','grayReason','disabled','message','findAll','role','sequelize','COUNT','col','admin','user','telephone','users','forEach','pick','countBy','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','util','moment','bluebird','./hardware','../../mysqldb','Demo\x20license','getUuid','2027-01-01T00:00:00.000Z','Breaking\x20license','License','find','then','catch','license'];(function(_0x18a95d,_0x4669d5){var _0x153c40=function(_0x356252){while(--_0x356252){_0x18a95d['push'](_0x18a95d['shift']());}};_0x153c40(++_0x4669d5);}(_0x88e9,0x1e1));var _0x988e=function(_0x4abe9e,_0x58820f){_0x4abe9e=_0x4abe9e-0x0;var _0x28788d=_0x88e9[_0x4abe9e];return _0x28788d;};'use strict';var util=require(_0x988e('0x0'));var _=require('lodash');var moment=require(_0x988e('0x1'));var BPromise=require(_0x988e('0x2'));var hardware=require(_0x988e('0x3'));var encryptor=require('../../components/encryptor');var db=require(_0x988e('0x4'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x988e('0x5'),'machineUuid':hardware[_0x988e('0x6')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x988e('0x7'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x988e('0x8'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x1897a9){return new BPromise(function(_0x4062be,_0x228054){return db[_0x988e('0x9')][_0x988e('0xa')](_['defaults'](_0x1897a9,{'raw':!![],'where':{'id':0x1}}))['then'](function(_0x24fdc6){return checkLicense(_0x24fdc6,null);})[_0x988e('0xb')](function(_0x1fd847){_0x4062be(_0x1fd847);return;})[_0x988e('0xc')](function(_0x114110){_0x228054(_0x114110);});});}function checkLicense(_0x4f3afd,_0x139c47){if(!_0x4f3afd){demoLicense['uuid']=_0x4f3afd['data1'];return demoLicense;}try{var _0x20db40=_0x139c47||_0x4f3afd[_0x988e('0xd')];if(_[_0x988e('0xe')](_0x20db40)){throw new Error(_0x988e('0xf'));}var _0x2426b5=_0x4f3afd[_0x988e('0x10')];var _0x4a7a14=_0x4f3afd[_0x988e('0x11')];var _0x18fe20=_0x2426b5['split']('-')[0x4];var _0x3f4539=_0x2426b5[_0x988e('0x12')]('-')[0x0];var _0x3b29e8=encryptor['decryptString'](_0x20db40,util[_0x988e('0x13')]('%s:%s:%s',_0x18fe20,_0x2426b5,_0x3f4539));var _0x39d260=JSON[_0x988e('0x14')](_0x3b29e8);_0x39d260[_0x988e('0x15')]=![];_0x39d260[_0x988e('0x16')]=_0x2426b5;_0x39d260[_0x988e('0x17')]=hardware[_0x988e('0x6')]();if(_0x4a7a14){var _0x56e7ec=encryptor[_0x988e('0x18')](_0x4a7a14);_0x39d260['gray']=_0x56e7ec;_0x39d260[_0x988e('0x19')]=moment(_0x56e7ec)['add'](0x7,_0x988e('0x1a'))[_0x988e('0x13')]();_0x39d260[_0x988e('0x1b')]=_0x39d260[_0x988e('0x16')]!=_0x39d260[_0x988e('0x17')]?'changed':_0x988e('0x1c');}return _0x39d260;}catch(_0x516fa5){breakingLicense[_0x988e('0x16')]=_0x4f3afd[_0x988e('0x10')];breakingLicense[_0x988e('0x1d')]=_0x516fa5[_0x988e('0x1d')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x29018f,_0x2457b6){getLicense()[_0x988e('0xb')](function(_0x37b164){return db['User'][_0x988e('0x1e')]({'attributes':[_0x988e('0x1f'),[db[_0x988e('0x20')]['fn'](_0x988e('0x21'),db[_0x988e('0x20')][_0x988e('0x22')](_0x988e('0x1f'))),'count']],'group':_0x988e('0x1f'),'where':{'role':{'$or':[_0x988e('0x23'),_0x988e('0x24'),_0x988e('0x25')]}},'raw':!![]})[_0x988e('0xb')](function(_0x31a5fb){var _0x436986={'user':_0x37b164[_0x988e('0x26')]||0x0,'telephone':_0x37b164['telephones']||0x0};_0x31a5fb[_0x988e('0x27')](function(_0x19ec66){var _0x3397bb=_0x19ec66[_0x988e('0x1f')]===_0x988e('0x23')?'user':_0x19ec66[_0x988e('0x1f')];_0x436986[_0x3397bb]-=_0x19ec66['count'];if(_0x436986[_0x3397bb]<0x0)_0x436986[_0x3397bb]=0x0;});_0x29018f(_0x436986);return;});})[_0x988e('0xc')](function(_0x400e13){_0x2457b6(_0x400e13);});});}function checkUserLimits(_0x44782b){return new BPromise(function(_0x508b1f,_0xd07a0d){getLimits()[_0x988e('0xb')](function(_0x15c228){var _0x38736e=_[_0x988e('0x28')](_[_0x988e('0x29')](_0x44782b,_0x988e('0x1f')),[_0x988e('0x23'),_0x988e('0x24'),_0x988e('0x25')]);var _0x3f16df=(_0x38736e[_0x988e('0x23')]||0x0)+(_0x38736e['user']||0x0);var _0x610ba1=_0x38736e[_0x988e('0x25')]||0x0;if(_0x3f16df>_0x15c228['user'])return _0xd07a0d(_0x988e('0x2a'));if(_0x610ba1>_0x15c228[_0x988e('0x25')])return _0xd07a0d(_0x988e('0x2b'));return _0x508b1f();})['catch'](function(_0x27815c){_0xd07a0d(_0x27815c);});});}module[_0x988e('0x2c')]={'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 eb835af..91f71b7 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 _0x84a0=['myappanuglar-secret','app-id','exports','http://localhost:9000'];(function(_0x4a3ea8,_0x3e6a1d){var _0x13cba1=function(_0x475ba3){while(--_0x475ba3){_0x4a3ea8['push'](_0x4a3ea8['shift']());}};_0x13cba1(++_0x3e6a1d);}(_0x84a0,0x66));var _0x084a=function(_0x1b3335,_0x2b2f52){_0x1b3335=_0x1b3335-0x0;var _0x300d95=_0x84a0[_0x1b3335];return _0x300d95;};'use strict';module[_0x084a('0x0')]={'DOMAIN':_0x084a('0x1'),'SESSION_SECRET':_0x084a('0x2'),'GOOGLE_ID':_0x084a('0x3'),'GOOGLE_SECRET':'secret','DEBUG':''}; \ No newline at end of file +var _0x1a85=['secret','myappanuglar-secret','app-id'];(function(_0x4cf0a4,_0x4bd739){var _0x3c3869=function(_0xd239e8){while(--_0xd239e8){_0x4cf0a4['push'](_0x4cf0a4['shift']());}};_0x3c3869(++_0x4bd739);}(_0x1a85,0x178));var _0x51a8=function(_0x1ca9a0,_0x17be2b){_0x1ca9a0=_0x1ca9a0-0x0;var _0x4a80d6=_0x1a85[_0x1ca9a0];return _0x4a80d6;};'use strict';module['exports']={'DOMAIN':'http://localhost:9000','SESSION_SECRET':_0x51a8('0x0'),'GOOGLE_ID':_0x51a8('0x1'),'GOOGLE_SECRET':_0x51a8('0x2'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index 79b0b52..8f8f375 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x09c5=['exports','fileLogger'];(function(_0x2a1b33,_0x409f50){var _0x4c50e7=function(_0x13e16d){while(--_0x13e16d){_0x2a1b33['push'](_0x2a1b33['shift']());}};_0x4c50e7(++_0x409f50);}(_0x09c5,0x183));var _0x509c=function(_0x212579,_0xdb4d5a){_0x212579=_0x212579-0x0;var _0x55d50e=_0x09c5[_0x212579];return _0x55d50e;};'use strict';var fileLogger=require('../utils/loggers')[_0x509c('0x0')];module[_0x509c('0x1')]=fileLogger; \ No newline at end of file +var _0xa96e=['exports','../utils/loggers'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xa96e,0x101));var _0xea96=function(_0x503c09,_0xb59e68){_0x503c09=_0x503c09-0x0;var _0x5606c5=_0xa96e[_0x503c09];return _0x5606c5;};'use strict';var fileLogger=require(_0xea96('0x0'))['fileLogger'];module[_0xea96('0x1')]=fileLogger; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index b067a7f..a16a6d7 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 _0xe57e=['path','../../config/environment','resolve','join','root','legacy-libs','express','../../services/express/index.js','../../services/ami/index.js','../../services/agi/index.js','email','../../services/email/index.js','routing','xdr','../../services/xdr/index.js','exports'];(function(_0x5f1292,_0x8fa358){var _0x3abdf2=function(_0x563664){while(--_0x563664){_0x5f1292['push'](_0x5f1292['shift']());}};_0x3abdf2(++_0x8fa358);}(_0xe57e,0x110));var _0xee57=function(_0x4c1769,_0x49036f){_0x4c1769=_0x4c1769-0x0;var _0x5aa20a=_0xe57e[_0x4c1769];return _0x5aa20a;};'use strict';var path=require(_0xee57('0x0'));var cfg=require(_0xee57('0x1'));var env={'NODE_PATH':path[_0xee57('0x2')](path[_0xee57('0x3')](cfg[_0xee57('0x4')],_0xee57('0x5')))};var pm2config={'apps':[{'name':_0xee57('0x6'),'script':path[_0xee57('0x3')](__dirname,_0xee57('0x7')),'env':env},{'name':'ami','script':path['join'](__dirname,_0xee57('0x8')),'env':env},{'name':'agi','script':path[_0xee57('0x3')](__dirname,_0xee57('0x9')),'env':env},{'name':_0xee57('0xa'),'script':path[_0xee57('0x3')](__dirname,_0xee57('0xb')),'env':env},{'name':_0xee57('0xc'),'script':path[_0xee57('0x3')](__dirname,'../../services/routing/index.js'),'env':env},{'name':_0xee57('0xd'),'script':path[_0xee57('0x3')](__dirname,_0xee57('0xe')),'env':env}]};module[_0xee57('0xf')]=pm2config; \ No newline at end of file +var _0xe3bc=['../../services/express/index.js','ami','../../services/ami/index.js','agi','../../services/agi/index.js','../../services/email/index.js','routing','../../services/routing/index.js','xdr','../../services/xdr/index.js','exports','path','root','legacy-libs','express','join'];(function(_0x4bebc8,_0x434441){var _0x4efdc9=function(_0x14749a){while(--_0x14749a){_0x4bebc8['push'](_0x4bebc8['shift']());}};_0x4efdc9(++_0x434441);}(_0xe3bc,0x1bb));var _0xce3b=function(_0x3612d9,_0x186308){_0x3612d9=_0x3612d9-0x0;var _0x513eb6=_0xe3bc[_0x3612d9];return _0x513eb6;};'use strict';var path=require(_0xce3b('0x0'));var cfg=require('../../config/environment');var env={'NODE_PATH':path['resolve'](path['join'](cfg[_0xce3b('0x1')],_0xce3b('0x2')))};var pm2config={'apps':[{'name':_0xce3b('0x3'),'script':path[_0xce3b('0x4')](__dirname,_0xce3b('0x5')),'env':env},{'name':_0xce3b('0x6'),'script':path[_0xce3b('0x4')](__dirname,_0xce3b('0x7')),'env':env},{'name':_0xce3b('0x8'),'script':path[_0xce3b('0x4')](__dirname,_0xce3b('0x9')),'env':env},{'name':'email','script':path['join'](__dirname,_0xce3b('0xa')),'env':env},{'name':_0xce3b('0xb'),'script':path[_0xce3b('0x4')](__dirname,_0xce3b('0xc')),'env':env},{'name':_0xce3b('0xd'),'script':path[_0xce3b('0x4')](__dirname,_0xce3b('0xe')),'env':env}]};module[_0xce3b('0xf')]=pm2config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index ee43f98..11820c4 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 _0xe792=['list','describe','delete','dump','saved','bluebird','./config','connected','start','then','stop','disconnect','restart'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xe792,0x13d));var _0x2e79=function(_0x350aa3,_0x40a901){_0x350aa3=_0x350aa3-0x0;var _0x570a10=_0xe792[_0x350aa3];return _0x570a10;};'use strict';var pm2=require('pm2');var BPromise=require(_0x2e79('0x0'));var config=require(_0x2e79('0x1'));function connect(){return new BPromise(function(_0x310872,_0x240a27){return pm2['connect'](function(_0x539c9e){if(_0x539c9e){return _0x240a27(_0x539c9e);}return _0x310872(_0x2e79('0x2'));});});};exports[_0x2e79('0x3')]=function(_0x47528c){return connect()[_0x2e79('0x4')](function(){return new BPromise(function(_0x40b299,_0x40a2d3){return pm2[_0x2e79('0x3')](_0x47528c,function(_0x25e923,_0x40a58e){if(_0x25e923){return _0x40a2d3(_0x25e923);}pm2['disconnect']();return _0x40b299(_0x40a58e);});});});};exports['stop']=function(_0x5335a6){return connect()['then'](function(){return new BPromise(function(_0x358172,_0x3573be){return pm2[_0x2e79('0x5')](_0x5335a6,function(_0x1ba595,_0x25348c){if(_0x1ba595){return _0x3573be(_0x1ba595);}pm2[_0x2e79('0x6')]();return _0x358172(_0x25348c);});});});};exports[_0x2e79('0x7')]=function(_0x259c61){return connect()[_0x2e79('0x4')](function(){return new BPromise(function(_0x150873,_0x29f20a){return pm2[_0x2e79('0x7')](_0x259c61,function(_0x544412,_0x2c4205){if(_0x544412){return _0x29f20a(_0x544412);}pm2[_0x2e79('0x6')]();return _0x150873(_0x2c4205);});});});};exports[_0x2e79('0x8')]=function(){return connect()['then'](function(){return new BPromise(function(_0x5ec781,_0x151981){return pm2[_0x2e79('0x8')](function(_0x458f53,_0x59c182){if(_0x458f53){return _0x151981(_0x458f53);}pm2[_0x2e79('0x6')]();return _0x5ec781(_0x59c182);});});});};exports[_0x2e79('0x9')]=function(_0x129bb7){return connect()[_0x2e79('0x4')](function(){return new BPromise(function(_0x19b83d,_0x86596b){return pm2['describe'](_0x129bb7,function(_0x1d9454,_0x44c452){if(_0x1d9454){return _0x86596b(_0x1d9454);}pm2[_0x2e79('0x6')]();return _0x19b83d(_0x44c452);});});});};exports[_0x2e79('0xa')]=function(_0xbef2fa){return connect()[_0x2e79('0x4')](function(){return new BPromise(function(_0x19fa68,_0x479b58){return pm2[_0x2e79('0xa')](_0xbef2fa,function(_0x1558cc,_0x313ca8){if(_0x1558cc){return _0x479b58(_0x1558cc);}pm2[_0x2e79('0x6')]();return _0x19fa68(_0x313ca8);});});});};exports[_0x2e79('0xb')]=function(){return connect()['then'](function(){return new BPromise(function(_0x3fed37,_0xb6ca81){return pm2[_0x2e79('0xb')](function(_0x2566fc){if(_0x2566fc){return _0xb6ca81(_0x2566fc);}return _0x3fed37(_0x2e79('0xc'));});});});}; \ No newline at end of file +var _0x7f66=['connected','start','stop','disconnect','restart','then','list','describe','delete','dump','saved','pm2','./config','connect'];(function(_0x59c8e9,_0x5c5682){var _0x8323e2=function(_0x4e61ef){while(--_0x4e61ef){_0x59c8e9['push'](_0x59c8e9['shift']());}};_0x8323e2(++_0x5c5682);}(_0x7f66,0x89));var _0x67f6=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x7f66[_0x17d9e3];return _0x14192d;};'use strict';var pm2=require(_0x67f6('0x0'));var BPromise=require('bluebird');var config=require(_0x67f6('0x1'));function connect(){return new BPromise(function(_0x23642d,_0x4f3f93){return pm2[_0x67f6('0x2')](function(_0x278ab6){if(_0x278ab6){return _0x4f3f93(_0x278ab6);}return _0x23642d(_0x67f6('0x3'));});});};exports['start']=function(_0x3772d9){return connect()['then'](function(){return new BPromise(function(_0x4f77b9,_0x3b10ba){return pm2[_0x67f6('0x4')](_0x3772d9,function(_0x41a29c,_0x3bf20f){if(_0x41a29c){return _0x3b10ba(_0x41a29c);}pm2['disconnect']();return _0x4f77b9(_0x3bf20f);});});});};exports['stop']=function(_0x5d7eba){return connect()['then'](function(){return new BPromise(function(_0x4195b4,_0x458847){return pm2[_0x67f6('0x5')](_0x5d7eba,function(_0x1ef1c0,_0x3bad29){if(_0x1ef1c0){return _0x458847(_0x1ef1c0);}pm2[_0x67f6('0x6')]();return _0x4195b4(_0x3bad29);});});});};exports[_0x67f6('0x7')]=function(_0x328386){return connect()[_0x67f6('0x8')](function(){return new BPromise(function(_0x57b268,_0x155936){return pm2[_0x67f6('0x7')](_0x328386,function(_0x174016,_0x11671b){if(_0x174016){return _0x155936(_0x174016);}pm2[_0x67f6('0x6')]();return _0x57b268(_0x11671b);});});});};exports[_0x67f6('0x9')]=function(){return connect()[_0x67f6('0x8')](function(){return new BPromise(function(_0x458c42,_0x273fb4){return pm2[_0x67f6('0x9')](function(_0x4a4f61,_0x283196){if(_0x4a4f61){return _0x273fb4(_0x4a4f61);}pm2[_0x67f6('0x6')]();return _0x458c42(_0x283196);});});});};exports['describe']=function(_0x1bdf88){return connect()[_0x67f6('0x8')](function(){return new BPromise(function(_0x2ea2a7,_0x108870){return pm2[_0x67f6('0xa')](_0x1bdf88,function(_0x41d245,_0x17d946){if(_0x41d245){return _0x108870(_0x41d245);}pm2['disconnect']();return _0x2ea2a7(_0x17d946);});});});};exports[_0x67f6('0xb')]=function(_0x1ff98c){return connect()[_0x67f6('0x8')](function(){return new BPromise(function(_0xfe3b19,_0x5cd827){return pm2[_0x67f6('0xb')](_0x1ff98c,function(_0x54e07b,_0x3431ed){if(_0x54e07b){return _0x5cd827(_0x54e07b);}pm2[_0x67f6('0x6')]();return _0xfe3b19(_0x3431ed);});});});};exports['dump']=function(){return connect()[_0x67f6('0x8')](function(){return new BPromise(function(_0x179cce,_0xd96c6f){return pm2[_0x67f6('0xc')](function(_0x192208){if(_0x192208){return _0xd96c6f(_0x192208);}return _0x179cce(_0x67f6('0xd'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index 60be109..83549eb 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 _0x589e=['localhost','Setting','find','chatTimeout','ChatInteraction','findAll','lastMsgAt','subtract','minutes','then','length','map','info','[CHAT]\x20Interactions\x20to\x20close:','join','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','emit','chatInteraction:update','error','[CHAT]\x20Error\x20closing\x20interactions','inspect','start','lodash','moment','ioredis','util','../../config/environment','../../mysqldb','schedule','defaults','redis'];(function(_0x4b2251,_0x393f10){var _0x5d22fb=function(_0x10992c){while(--_0x10992c){_0x4b2251['push'](_0x4b2251['shift']());}};_0x5d22fb(++_0x393f10);}(_0x589e,0x1a7));var _0xe589=function(_0x32d5dc,_0x46c77f){_0x32d5dc=_0x32d5dc-0x0;var _0x2cb077=_0x589e[_0x32d5dc];return _0x2cb077;};'use strict';var _=require(_0xe589('0x0'));var moment=require(_0xe589('0x1'));var Redis=require(_0xe589('0x2'));var util=require(_0xe589('0x3'));var config=require(_0xe589('0x4'));var db=require(_0xe589('0x5'))['db'];var logger=require('../logger')(_0xe589('0x6'));config['redis']=_[_0xe589('0x7')](config[_0xe589('0x8')],{'host':_0xe589('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xe589('0x8')]));function closeInteractions(){var _0x4e5466=0x0;var _0xb9d48f=[];return db[_0xe589('0xa')][_0xe589('0xb')]({'raw':!![],'attributes':['id','chatTimeout'],'where':{'id':0x1}})['then'](function(_0xae7f1f){_0x4e5466=_0xae7f1f[_0xe589('0xc')];if(_0x4e5466){return db[_0xe589('0xd')][_0xe589('0xe')]({'raw':!![],'attributes':['id',_0xe589('0xf')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0xe589('0x10')](_0xae7f1f[_0xe589('0xc')],_0xe589('0x11'))}}});}else{return[];}})[_0xe589('0x12')](function(_0x433151){if(_0x433151&&_0x433151[_0xe589('0x13')]){_0xb9d48f=_[_0xe589('0x14')](_0x433151||[],'id');logger[_0xe589('0x15')](_0xe589('0x16'),_0xb9d48f[_0xe589('0x17')]());return db[_0xe589('0xd')][_0xe589('0x18')]({'closeReason':_0xe589('0x19'),'disposition':_0xe589('0x1a'),'closed':!![],'closedAt':moment()[_0xe589('0x1b')](_0xe589('0x1c'))},{'where':{'id':_0xb9d48f}});}})['then'](function(){if(_0xb9d48f&&_0xb9d48f[_0xe589('0x13')]){logger[_0xe589('0x15')](_0xe589('0x1d'),_0xb9d48f[_0xe589('0x17')]());for(var _0x3e396d=0x0;_0x3e396d<_0xb9d48f[_0xe589('0x13')];_0x3e396d++){io[_0xe589('0x1e')](_0xe589('0x1f'),{'id':_0xb9d48f[_0x3e396d],'closed':!![]});}}})['catch'](function(_0x43e0dc){logger[_0xe589('0x20')](_0xe589('0x21'),_0x43e0dc?util[_0xe589('0x22')](_0x43e0dc,{'showHidden':![],'depth':null}):'');});}exports[_0xe589('0x23')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x9b33=['error','[CHAT]\x20Error\x20closing\x20interactions','start','lodash','moment','util','../../config/environment','../../mysqldb','../logger','redis','localhost','Setting','chatTimeout','then','ChatInteraction','findAll','subtract','minutes','info','[CHAT]\x20Interactions\x20to\x20close:','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','length','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','emit','chatInteraction:update','catch'];(function(_0x262511,_0x29f73f){var _0x2148c6=function(_0x215ec4){while(--_0x215ec4){_0x262511['push'](_0x262511['shift']());}};_0x2148c6(++_0x29f73f);}(_0x9b33,0x7b));var _0x39b3=function(_0x1c8c28,_0x3ee093){_0x1c8c28=_0x1c8c28-0x0;var _0x1f59b4=_0x9b33[_0x1c8c28];return _0x1f59b4;};'use strict';var _=require(_0x39b3('0x0'));var moment=require(_0x39b3('0x1'));var Redis=require('ioredis');var util=require(_0x39b3('0x2'));var config=require(_0x39b3('0x3'));var db=require(_0x39b3('0x4'))['db'];var logger=require(_0x39b3('0x5'))('schedule');config[_0x39b3('0x6')]=_['defaults'](config['redis'],{'host':_0x39b3('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x39b3('0x6')]));function closeInteractions(){var _0x30c618=0x0;var _0x398a57=[];return db[_0x39b3('0x8')]['find']({'raw':!![],'attributes':['id',_0x39b3('0x9')],'where':{'id':0x1}})[_0x39b3('0xa')](function(_0x395d96){_0x30c618=_0x395d96['chatTimeout'];if(_0x30c618){return db[_0x39b3('0xb')][_0x39b3('0xc')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x39b3('0xd')](_0x395d96[_0x39b3('0x9')],_0x39b3('0xe'))}}});}else{return[];}})[_0x39b3('0xa')](function(_0x2a6a2b){if(_0x2a6a2b&&_0x2a6a2b['length']){_0x398a57=_['map'](_0x2a6a2b||[],'id');logger[_0x39b3('0xf')](_0x39b3('0x10'),_0x398a57['join']());return db[_0x39b3('0xb')][_0x39b3('0x11')]({'closeReason':_0x39b3('0x12'),'disposition':_0x39b3('0x13'),'closed':!![],'closedAt':moment()[_0x39b3('0x14')](_0x39b3('0x15'))},{'where':{'id':_0x398a57}});}})[_0x39b3('0xa')](function(){if(_0x398a57&&_0x398a57[_0x39b3('0x16')]){logger[_0x39b3('0xf')](_0x39b3('0x17'),_0x398a57['join']());for(var _0x345fa8=0x0;_0x345fa8<_0x398a57[_0x39b3('0x16')];_0x345fa8++){io[_0x39b3('0x18')](_0x39b3('0x19'),{'id':_0x398a57[_0x345fa8],'closed':!![]});}}})[_0x39b3('0x1a')](function(_0x359ff2){logger[_0x39b3('0x1b')](_0x39b3('0x1c'),_0x359ff2?util['inspect'](_0x359ff2,{'showHidden':![],'depth':null}):'');});}exports[_0x39b3('0x1d')]=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 27f80db..9774614 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 _0xb875=['exports','../../api/cloudProvider/cloudProvider.oauth.js','startAllRefreshIntervals'];(function(_0x13ba21,_0x190d6e){var _0x4307f6=function(_0x231122){while(--_0x231122){_0x13ba21['push'](_0x13ba21['shift']());}};_0x4307f6(++_0x190d6e);}(_0xb875,0x6a));var _0x5b87=function(_0x4fb05b,_0x2be521){_0x4fb05b=_0x4fb05b-0x0;var _0x6c0e91=_0xb875[_0x4fb05b];return _0x6c0e91;};'use strict';function start(){var _0x20b566=require(_0x5b87('0x0'));return _0x20b566[_0x5b87('0x1')]();}module[_0x5b87('0x2')]={'intervals':{},'start':start}; \ No newline at end of file +var _0x55ad=['exports','../../api/cloudProvider/cloudProvider.oauth.js'];(function(_0x1057a3,_0x28d9b7){var _0x131cdb=function(_0x47a386){while(--_0x47a386){_0x1057a3['push'](_0x1057a3['shift']());}};_0x131cdb(++_0x28d9b7);}(_0x55ad,0xa5));var _0xd55a=function(_0x9df81e,_0x29f594){_0x9df81e=_0x9df81e-0x0;var _0x4bb554=_0x55ad[_0x9df81e];return _0x4bb554;};'use strict';function start(){var _0x19d38f=require(_0xd55a('0x0'));return _0x19d38f['startAllRefreshIntervals']();}module[_0xd55a('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 066a3ac..2fbd100 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 _0x0762=['no\x20report\x20id','findAll','MailServerOut','CloudProvider','jobs','keyBy','toString','difference','intersection','length','exists','deleteJob','delete\x20cron','toRun','index','my\x20id','resolve','run\x20job','cron','isBetween','startAt','endAt','add','start','add\x20cron','stop','stop\x20cron','active','update','update\x20cron','util','moment','cron-job-manager','jayson/promise','bluebird','schedule','../../mysqldb','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','getSmtpOptions','format','\x22%s\x22\x20<%s>','Smtp','bcc','Report\x20%s\x20last\x20%s\x20%s','name','subtractNumber','subtractUnit','join','../../files/reports','savename','basename','zip','existsSync','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','stringify','status','Sent','sendIfEmpty','info','empty\x20file,\x20email\x20not\x20sent','request','SendMail','then','error','error\x20mail','email\x20sent','catch','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','exec\x20defaul\x20report\x20id:%s','runReport','DefaultReportId','CustomReportId','exec\x20custom\x20report\x20id:%s'];(function(_0x3672d7,_0x4c7eef){var _0xb8fc76=function(_0x269c08){while(--_0x269c08){_0x3672d7['push'](_0x3672d7['shift']());}};_0xb8fc76(++_0x4c7eef);}(_0x0762,0x1d1));var _0x2076=function(_0x1139ea,_0x1e9cc7){_0x1139ea=_0x1139ea-0x0;var _0x2b3ab5=_0x0762[_0x1139ea];return _0x2b3ab5;};'use strict';var fs=require('fs');var util=require(_0x2076('0x0'));var path=require('path');var _=require('lodash');var moment=require(_0x2076('0x1'));var CronJobManager=require(_0x2076('0x2'));var jayson=require(_0x2076('0x3'));var BPromise=require(_0x2076('0x4'));var logger=require('../logger')(_0x2076('0x5'));var db=require(_0x2076('0x6'))['db'];var analyticCustomReportController=require('../../api/analyticCustomReport/analyticCustomReport.controller');var analyticDefaultReportController=require(_0x2076('0x7'));var client=jayson[_0x2076('0x8')][_0x2076('0x9')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x3f5f70,_0x115776){return function(){logger['info'](_0x2076('0xa'),_0x3f5f70[_0x2076('0xb')]);var _0x1cd426=!![];var _0x76fd37=_0x3f5f70[_0x2076('0xc')][_0x2076('0xd')]();var _0x176fd3={'account':_0x76fd37,'message':{'from':util[_0x2076('0xe')](_0x2076('0xf'),_0x3f5f70[_0x2076('0xc')]['name'],_0x3f5f70[_0x2076('0xc')][_0x2076('0xb')]||_0x3f5f70[_0x2076('0xc')][_0x2076('0x10')]['user']),'to':_0x3f5f70['email'],'cc':_0x3f5f70['cc'],'bcc':_0x3f5f70[_0x2076('0x11')],'subject':util[_0x2076('0xe')](_0x2076('0x12'),_0x115776[_0x2076('0x13')],_0x3f5f70[_0x2076('0x14')],_0x3f5f70[_0x2076('0x15')])}};var _0x37c332=path[_0x2076('0x16')](__dirname,_0x2076('0x17'));var _0x3cc945=_0x115776[_0x2076('0x18')];var _0xd10f78=util[_0x2076('0xe')]('%s.%s',path[_0x2076('0x19')](_0x115776[_0x2076('0x18')],path['extname'](_0x115776[_0x2076('0x18')])),_0x2076('0x1a'));var _0x3842cf=path[_0x2076('0x16')](_0x37c332,_0x3cc945);var _0x21785f=path['join'](_0x37c332,_0xd10f78);if(fs[_0x2076('0x1b')](_0x3842cf)){_0x115776['status']='Sent';_0x176fd3[_0x2076('0x1c')][_0x2076('0x1d')]=[{'filename':_0x3cc945,'path':_0x3842cf}];_0x176fd3[_0x2076('0x1c')][_0x2076('0x1e')]=util['format'](_0x2076('0x1f'),JSON[_0x2076('0x20')](_0x115776,null,0x2));}else if(fs[_0x2076('0x1b')](_0x21785f)){_0x115776[_0x2076('0x21')]=_0x2076('0x22');_0x176fd3[_0x2076('0x1c')][_0x2076('0x1d')]=[{'filename':_0xd10f78,'path':_0x21785f}];}else{_0x176fd3[_0x2076('0x1c')]['text']='Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a';if(!_0x3f5f70[_0x2076('0x23')]){_0x1cd426=![];logger[_0x2076('0x24')](_0x2076('0x25'));}}if(_0x1cd426){return client[_0x2076('0x26')](_0x2076('0x27'),_0x176fd3)[_0x2076('0x28')](function(_0x11a2b9){if(_0x11a2b9[_0x2076('0x29')]){return logger[_0x2076('0x29')](_0x2076('0x2a'),JSON[_0x2076('0x20')](_0x11a2b9));}return logger[_0x2076('0x24')](_0x2076('0x2b'));})[_0x2076('0x2c')](function(_0x2c7d1b){return logger['error'](_0x2076('0x2a'),JSON['stringify'](_0x2c7d1b));});}};}function handleError(){return function(_0x4347c2){return logger['error'](JSON[_0x2076('0x20')](_0x4347c2));};}function handleResult(_0x3345b1){return function(_0x49a2ab){logger[_0x2076('0x24')](_0x2076('0x2d'),JSON[_0x2076('0x20')](_0x49a2ab));if(_0x3345b1[_0x2076('0xc')]&&_0x3345b1[_0x2076('0xc')][_0x2076('0x10')]&&!_[_0x2076('0x2e')](_0x3345b1[_0x2076('0xb')])){setTimeout(handleSendEmail(_0x3345b1,_0x49a2ab),0x3c*0x3e8);}};}function handleJob(_0x4a75bb){return function(){try{if(_['isNil'](_0x4a75bb[_0x2076('0x14')])){return logger[_0x2076('0x24')](_0x2076('0x2f'));}if(_[_0x2076('0x2e')](_0x4a75bb[_0x2076('0x15')])){return logger[_0x2076('0x24')](_0x2076('0x30'));}var _0x4c9459={'startDate':moment()[_0x2076('0x31')](_0x4a75bb[_0x2076('0x14')],_0x4a75bb[_0x2076('0x15')])[_0x2076('0xe')]('YYYY-MM-DD\x20HH:mm:ss'),'endDate':moment()[_0x2076('0xe')](_0x2076('0x32')),'type':_0x2076('0x33'),'output':_0x4a75bb['output'],'name':_0x4a75bb[_0x2076('0x13')]};if(!_[_0x2076('0x2e')](_0x4a75bb['DefaultReportId'])){logger[_0x2076('0x24')](_0x2076('0x34'),_0x4a75bb['DefaultReportId']);return analyticDefaultReportController[_0x2076('0x35')]({'id':_0x4a75bb[_0x2076('0x36')]},_0x4c9459)[_0x2076('0x28')](handleResult(_0x4a75bb))[_0x2076('0x2c')](handleError());}if(!_[_0x2076('0x2e')](_0x4a75bb[_0x2076('0x37')])){logger[_0x2076('0x24')](_0x2076('0x38'),_0x4a75bb[_0x2076('0x37')]);return analyticCustomReportController[_0x2076('0x35')]({'id':_0x4a75bb[_0x2076('0x37')]},_0x4c9459)[_0x2076('0x28')](handleResult(_0x4a75bb))[_0x2076('0x2c')](handleError());}}catch(_0x5af485){logger[_0x2076('0x29')](JSON[_0x2076('0x20')](_0x5af485));}return logger[_0x2076('0x24')](_0x2076('0x39'));};}function getJobs(_0x25f36b){var _0x17d322={};if(_0x25f36b){_0x17d322['id']=_0x25f36b;}return db['Schedule'][_0x2076('0x3a')]({'where':_0x17d322,'include':[{'model':db['MailAccount'],'attributes':['id','name',_0x2076('0xb')],'include':[{'model':db[_0x2076('0x3b')],'as':_0x2076('0x10'),'include':[{'model':db[_0x2076('0x3c')],'as':_0x2076('0x3c')}]}]}]})['then'](function(_0x5db5d3){var _0x1e80f4=_['keys'](manager[_0x2076('0x3d')]);var _0x507e37=_['map'](_0x5db5d3,function(_0x146437){return _0x146437['id']['toString']();});var _0x361086=_[_0x2076('0x3e')](_0x5db5d3,function(_0x2e9e00){return _0x2e9e00['id'][_0x2076('0x3f')]();});var _0x531e75=_0x25f36b?_0x507e37:_[_0x2076('0x40')](_0x507e37,_0x1e80f4);var _0x245ab0=_[_0x2076('0x41')](_0x507e37,_0x1e80f4);var _0x2862d3=_[_0x2076('0x40')](_0x1e80f4,_0x507e37);var _0x4c9c8a;var _0x36c2e4;for(_0x4c9c8a=0x0;_0x4c9c8a<_0x2862d3[_0x2076('0x42')]&&!_0x25f36b;_0x4c9c8a+=0x1){_0x36c2e4=_0x2862d3[_0x4c9c8a][_0x2076('0x3f')]();if(manager[_0x2076('0x43')](_0x36c2e4)){manager['stop'](_0x36c2e4);manager[_0x2076('0x44')](_0x36c2e4);logger[_0x2076('0x24')](_0x2076('0x45'),_0x36c2e4);}}logger[_0x2076('0x24')](_0x2076('0x46'),JSON[_0x2076('0x20')](_0x531e75));for(_0x4c9c8a=0x0;_0x4c9c8a<_0x531e75['length'];_0x4c9c8a+=0x1){_0x36c2e4=_0x531e75[_0x4c9c8a][_0x2076('0x3f')]();logger[_0x2076('0x24')](_0x2076('0x47'),_0x36c2e4);if(_0x25f36b){logger[_0x2076('0x24')](_0x2076('0x48'),_0x25f36b);logger['info'](JSON[_0x2076('0x20')](_0x361086[_0x36c2e4]));BPromise[_0x2076('0x49')]()[_0x2076('0x28')](handleJob(_0x361086[_0x36c2e4]));logger[_0x2076('0x24')](_0x2076('0x4a'),_0x361086[_0x36c2e4][_0x2076('0x13')],_0x361086[_0x36c2e4]['cron']);}else if(_0x361086[_0x36c2e4][_0x2076('0x4b')]&&_0x361086[_0x36c2e4]['active']&&moment()[_0x2076('0x4c')](_0x361086[_0x36c2e4][_0x2076('0x4d')],_0x361086[_0x36c2e4][_0x2076('0x4e')])){manager[_0x2076('0x4f')](_0x36c2e4,_0x361086[_0x36c2e4]['cron'],handleJob(_0x361086[_0x36c2e4]));manager[_0x2076('0x50')](_0x36c2e4);logger['info'](_0x2076('0x51'),_0x361086[_0x36c2e4][_0x2076('0x13')],_0x361086[_0x36c2e4][_0x2076('0x4b')]);}else if(manager[_0x2076('0x43')](_0x36c2e4)){manager[_0x2076('0x52')](_0x36c2e4);manager[_0x2076('0x44')](_0x36c2e4);logger[_0x2076('0x24')](_0x2076('0x53'),_0x361086[_0x36c2e4][_0x2076('0x13')],_0x361086[_0x36c2e4][_0x2076('0x4b')]);}}for(_0x4c9c8a=0x0,_0x36c2e4;_0x4c9c8a<_0x245ab0['length']&&!_0x25f36b;_0x4c9c8a+=0x1){_0x36c2e4=_0x245ab0[_0x4c9c8a][_0x2076('0x3f')]();if(manager['exists'](_0x36c2e4)){if(_0x361086[_0x36c2e4][_0x2076('0x4b')]&&_0x361086[_0x36c2e4][_0x2076('0x54')]&&moment()[_0x2076('0x4c')](_0x361086[_0x36c2e4][_0x2076('0x4d')],_0x361086[_0x36c2e4]['endAt'])){manager[_0x2076('0x55')](_0x36c2e4,_0x361086[_0x36c2e4]['cron'],handleJob(_0x361086[_0x36c2e4]));logger[_0x2076('0x24')](_0x2076('0x56'),_0x361086[_0x36c2e4][_0x2076('0x13')],_0x361086[_0x36c2e4][_0x2076('0x4b')]);}else{manager[_0x2076('0x52')](_0x36c2e4);manager[_0x2076('0x44')](_0x36c2e4);logger[_0x2076('0x24')](_0x2076('0x53'),_0x361086[_0x36c2e4][_0x2076('0x13')],_0x361086[_0x36c2e4]['cron']);}}}})['catch'](function(_0x439a76){logger[_0x2076('0x29')](JSON[_0x2076('0x20')](_0x439a76));});}exports['run']=function(_0x28171b){return getJobs(_0x28171b);};exports[_0x2076('0x50')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0x550c=['email\x20sent','catch','data','Smtp','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','exec\x20defaul\x20report\x20id:%s','DefaultReportId','runReport','then','CustomReportId','exec\x20custom\x20report\x20id:%s','no\x20report\x20id','findAll','MailServerOut','CloudProvider','keyBy','toString','difference','intersection','exists','deleteJob','toRun','index','my\x20id','resolve','run\x20job','cron','isBetween','startAt','endAt','add','stop','active','update\x20cron','stop\x20cron','run','start','util','lodash','moment','bluebird','schedule','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info','Try\x20to\x20send\x20a\x20mail\x20to','email','getSmtpOptions','format','\x22%s\x22\x20<%s>','MailAccount','name','user','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','join','../../files/reports','savename','%s.%s','basename','extname','zip','existsSync','Sent','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','status','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','empty\x20file,\x20email\x20not\x20sent','request','SendMail','error','error\x20mail','stringify'];(function(_0x37c4d6,_0x2cd9f3){var _0x9ddcff=function(_0x6e908e){while(--_0x6e908e){_0x37c4d6['push'](_0x37c4d6['shift']());}};_0x9ddcff(++_0x2cd9f3);}(_0x550c,0x183));var _0xc550=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x550c[_0x3dd15e];return _0x231fd0;};'use strict';var fs=require('fs');var util=require(_0xc550('0x0'));var path=require('path');var _=require(_0xc550('0x1'));var moment=require(_0xc550('0x2'));var CronJobManager=require('cron-job-manager');var jayson=require('jayson/promise');var BPromise=require(_0xc550('0x3'));var logger=require('../logger')(_0xc550('0x4'));var db=require('../../mysqldb')['db'];var analyticCustomReportController=require(_0xc550('0x5'));var analyticDefaultReportController=require(_0xc550('0x6'));var client=jayson[_0xc550('0x7')][_0xc550('0x8')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x103ee7,_0x1fc570){return function(){logger[_0xc550('0x9')](_0xc550('0xa'),_0x103ee7[_0xc550('0xb')]);var _0x41f0b9=!![];var _0xfc3514=_0x103ee7['MailAccount'][_0xc550('0xc')]();var _0x44a268={'account':_0xfc3514,'message':{'from':util[_0xc550('0xd')](_0xc550('0xe'),_0x103ee7[_0xc550('0xf')][_0xc550('0x10')],_0x103ee7[_0xc550('0xf')][_0xc550('0xb')]||_0x103ee7[_0xc550('0xf')]['Smtp'][_0xc550('0x11')]),'to':_0x103ee7[_0xc550('0xb')],'cc':_0x103ee7['cc'],'bcc':_0x103ee7[_0xc550('0x12')],'subject':util[_0xc550('0xd')](_0xc550('0x13'),_0x1fc570['name'],_0x103ee7[_0xc550('0x14')],_0x103ee7[_0xc550('0x15')])}};var _0xff048d=path[_0xc550('0x16')](__dirname,_0xc550('0x17'));var _0x429f6c=_0x1fc570[_0xc550('0x18')];var _0x460d13=util[_0xc550('0xd')](_0xc550('0x19'),path[_0xc550('0x1a')](_0x1fc570[_0xc550('0x18')],path[_0xc550('0x1b')](_0x1fc570[_0xc550('0x18')])),_0xc550('0x1c'));var _0x420f38=path[_0xc550('0x16')](_0xff048d,_0x429f6c);var _0x5070f3=path['join'](_0xff048d,_0x460d13);if(fs[_0xc550('0x1d')](_0x420f38)){_0x1fc570['status']=_0xc550('0x1e');_0x44a268[_0xc550('0x1f')][_0xc550('0x20')]=[{'filename':_0x429f6c,'path':_0x420f38}];_0x44a268[_0xc550('0x1f')][_0xc550('0x21')]=util['format'](_0xc550('0x22'),JSON['stringify'](_0x1fc570,null,0x2));}else if(fs[_0xc550('0x1d')](_0x5070f3)){_0x1fc570[_0xc550('0x23')]=_0xc550('0x1e');_0x44a268[_0xc550('0x1f')][_0xc550('0x20')]=[{'filename':_0x460d13,'path':_0x5070f3}];}else{_0x44a268[_0xc550('0x1f')][_0xc550('0x21')]=_0xc550('0x24');if(!_0x103ee7['sendIfEmpty']){_0x41f0b9=![];logger[_0xc550('0x9')](_0xc550('0x25'));}}if(_0x41f0b9){return client[_0xc550('0x26')](_0xc550('0x27'),_0x44a268)['then'](function(_0xcb18a){if(_0xcb18a[_0xc550('0x28')]){return logger[_0xc550('0x28')](_0xc550('0x29'),JSON[_0xc550('0x2a')](_0xcb18a));}return logger[_0xc550('0x9')](_0xc550('0x2b'));})[_0xc550('0x2c')](function(_0x4a9f73){return logger[_0xc550('0x28')](_0xc550('0x29'),JSON[_0xc550('0x2a')](_0x4a9f73));});}};}function handleError(){return function(_0x2a322d){return logger[_0xc550('0x28')](JSON['stringify'](_0x2a322d));};}function handleResult(_0x2e803b){return function(_0x1fc40d){logger['info'](_0xc550('0x2d'),JSON[_0xc550('0x2a')](_0x1fc40d));if(_0x2e803b[_0xc550('0xf')]&&_0x2e803b[_0xc550('0xf')][_0xc550('0x2e')]&&!_[_0xc550('0x2f')](_0x2e803b[_0xc550('0xb')])){setTimeout(handleSendEmail(_0x2e803b,_0x1fc40d),0x3c*0x3e8);}};}function handleJob(_0xa294e5){return function(){try{if(_[_0xc550('0x2f')](_0xa294e5['subtractNumber'])){return logger[_0xc550('0x9')](_0xc550('0x30'));}if(_[_0xc550('0x2f')](_0xa294e5[_0xc550('0x15')])){return logger['info'](_0xc550('0x31'));}var _0x35d58d={'startDate':moment()[_0xc550('0x32')](_0xa294e5[_0xc550('0x14')],_0xa294e5[_0xc550('0x15')])[_0xc550('0xd')](_0xc550('0x33')),'endDate':moment()[_0xc550('0xd')](_0xc550('0x33')),'type':_0xc550('0x34'),'output':_0xa294e5[_0xc550('0x35')],'name':_0xa294e5[_0xc550('0x10')]};if(!_['isNil'](_0xa294e5['DefaultReportId'])){logger[_0xc550('0x9')](_0xc550('0x36'),_0xa294e5[_0xc550('0x37')]);return analyticDefaultReportController[_0xc550('0x38')]({'id':_0xa294e5[_0xc550('0x37')]},_0x35d58d)[_0xc550('0x39')](handleResult(_0xa294e5))['catch'](handleError());}if(!_['isNil'](_0xa294e5[_0xc550('0x3a')])){logger[_0xc550('0x9')](_0xc550('0x3b'),_0xa294e5[_0xc550('0x3a')]);return analyticCustomReportController[_0xc550('0x38')]({'id':_0xa294e5['CustomReportId']},_0x35d58d)[_0xc550('0x39')](handleResult(_0xa294e5))[_0xc550('0x2c')](handleError());}}catch(_0x5cae1e){logger['error'](JSON[_0xc550('0x2a')](_0x5cae1e));}return logger[_0xc550('0x9')](_0xc550('0x3c'));};}function getJobs(_0x2598f8){var _0x279a7e={};if(_0x2598f8){_0x279a7e['id']=_0x2598f8;}return db['Schedule'][_0xc550('0x3d')]({'where':_0x279a7e,'include':[{'model':db[_0xc550('0xf')],'attributes':['id',_0xc550('0x10'),_0xc550('0xb')],'include':[{'model':db[_0xc550('0x3e')],'as':_0xc550('0x2e'),'include':[{'model':db[_0xc550('0x3f')],'as':_0xc550('0x3f')}]}]}]})['then'](function(_0x33653f){var _0xf01d9f=_['keys'](manager['jobs']);var _0x2ad523=_['map'](_0x33653f,function(_0xec814c){return _0xec814c['id']['toString']();});var _0x390911=_[_0xc550('0x40')](_0x33653f,function(_0x4a042e){return _0x4a042e['id'][_0xc550('0x41')]();});var _0xfaab9=_0x2598f8?_0x2ad523:_[_0xc550('0x42')](_0x2ad523,_0xf01d9f);var _0x2ca865=_[_0xc550('0x43')](_0x2ad523,_0xf01d9f);var _0x294b26=_['difference'](_0xf01d9f,_0x2ad523);var _0x2d9c82;var _0x20c654;for(_0x2d9c82=0x0;_0x2d9c82<_0x294b26['length']&&!_0x2598f8;_0x2d9c82+=0x1){_0x20c654=_0x294b26[_0x2d9c82][_0xc550('0x41')]();if(manager[_0xc550('0x44')](_0x20c654)){manager['stop'](_0x20c654);manager[_0xc550('0x45')](_0x20c654);logger['info']('delete\x20cron',_0x20c654);}}logger['info'](_0xc550('0x46'),JSON[_0xc550('0x2a')](_0xfaab9));for(_0x2d9c82=0x0;_0x2d9c82<_0xfaab9['length'];_0x2d9c82+=0x1){_0x20c654=_0xfaab9[_0x2d9c82][_0xc550('0x41')]();logger['info'](_0xc550('0x47'),_0x20c654);if(_0x2598f8){logger[_0xc550('0x9')](_0xc550('0x48'),_0x2598f8);logger[_0xc550('0x9')](JSON[_0xc550('0x2a')](_0x390911[_0x20c654]));BPromise[_0xc550('0x49')]()['then'](handleJob(_0x390911[_0x20c654]));logger[_0xc550('0x9')](_0xc550('0x4a'),_0x390911[_0x20c654][_0xc550('0x10')],_0x390911[_0x20c654][_0xc550('0x4b')]);}else if(_0x390911[_0x20c654][_0xc550('0x4b')]&&_0x390911[_0x20c654]['active']&&moment()[_0xc550('0x4c')](_0x390911[_0x20c654][_0xc550('0x4d')],_0x390911[_0x20c654][_0xc550('0x4e')])){manager[_0xc550('0x4f')](_0x20c654,_0x390911[_0x20c654]['cron'],handleJob(_0x390911[_0x20c654]));manager['start'](_0x20c654);logger[_0xc550('0x9')]('add\x20cron',_0x390911[_0x20c654][_0xc550('0x10')],_0x390911[_0x20c654][_0xc550('0x4b')]);}else if(manager[_0xc550('0x44')](_0x20c654)){manager[_0xc550('0x50')](_0x20c654);manager[_0xc550('0x45')](_0x20c654);logger['info']('stop\x20cron',_0x390911[_0x20c654][_0xc550('0x10')],_0x390911[_0x20c654][_0xc550('0x4b')]);}}for(_0x2d9c82=0x0,_0x20c654;_0x2d9c82<_0x2ca865['length']&&!_0x2598f8;_0x2d9c82+=0x1){_0x20c654=_0x2ca865[_0x2d9c82][_0xc550('0x41')]();if(manager[_0xc550('0x44')](_0x20c654)){if(_0x390911[_0x20c654][_0xc550('0x4b')]&&_0x390911[_0x20c654][_0xc550('0x51')]&&moment()[_0xc550('0x4c')](_0x390911[_0x20c654]['startAt'],_0x390911[_0x20c654][_0xc550('0x4e')])){manager['update'](_0x20c654,_0x390911[_0x20c654][_0xc550('0x4b')],handleJob(_0x390911[_0x20c654]));logger[_0xc550('0x9')](_0xc550('0x52'),_0x390911[_0x20c654]['name'],_0x390911[_0x20c654][_0xc550('0x4b')]);}else{manager[_0xc550('0x50')](_0x20c654);manager[_0xc550('0x45')](_0x20c654);logger[_0xc550('0x9')](_0xc550('0x53'),_0x390911[_0x20c654][_0xc550('0x10')],_0x390911[_0x20c654][_0xc550('0x4b')]);}}}})[_0xc550('0x2c')](function(_0x2a03f7){logger[_0xc550('0x28')](JSON[_0xc550('0x2a')](_0x2a03f7));});}exports[_0xc550('0x54')]=function(_0x31b30b){return getJobs(_0x31b30b);};exports[_0xc550('0x55')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file diff --git a/server/config/schedule/transcribe.js b/server/config/schedule/transcribe.js index 4f87988..a6dea5b 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 _0xae87=['[RECORDING:%d]\x20Get\x20transcript','Transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentimentAccountId','language','bucket','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','CloudProvider','findOne','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','SentimentScore','Positive','Neutral','FAILED','resolve','sentiment','Cloud\x20Provider\x20not\x20available','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','sentimentRegion','Sentiment','Negative','name','SequelizeValidationError','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','VoiceRecording','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Settings\x20not\x20available','Transcribe\x20not\x20configured','transcribeAccountId','push','all','catch','error','inspect','start','bluebird','../../mysqldb','transcribe','TranscribeService','getTranscriptionJob','Comprehend','substring','info','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','data2','transcribeRegion','then','format','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJobStatus','fileText','COMPLETED','TranscriptionJob','TranscriptFileUri'];(function(_0x5bcec9,_0x135159){var _0x1a6f0d=function(_0x20fbdb){while(--_0x20fbdb){_0x5bcec9['push'](_0x5bcec9['shift']());}};_0x1a6f0d(++_0x135159);}(_0xae87,0x1ce));var _0x7ae8=function(_0x434783,_0xff395d){_0x434783=_0x434783-0x0;var _0x13efcf=_0xae87[_0x434783];return _0x13efcf;};var _=require('lodash');var AWS=require('aws-sdk');var rp=require('request-promise');var util=require('util');var BPromise=require(_0x7ae8('0x0'));var db=require(_0x7ae8('0x1'))['db'];var logger=require('../../config/logger')(_0x7ae8('0x2'));function getTranscriptionJob(_0x4a22a5,_0x4ca11e,_0x3b95c1,_0x33b313){return new Promise(function(_0x141978,_0x3b6a2d){var _0x57d2f2=new AWS[(_0x7ae8('0x3'))]({'accessKeyId':_0x4ca11e,'secretAccessKey':_0x4a22a5,'region':_0x3b95c1});_0x57d2f2[_0x7ae8('0x4')]({'TranscriptionJobName':_0x33b313},function(_0x26d4bb,_0x2aa2d5){if(_0x26d4bb){return _0x3b6a2d(_0x26d4bb);}else{return _0x141978(_0x2aa2d5);}});});}function sentiment(_0x1f049b,_0x45dfc2,_0x2138eb,_0x48d84d,_0x4a63d6){return new Promise(function(_0x2cc5f6,_0x334ae7){var _0x595760=new AWS[(_0x7ae8('0x5'))]({'accessKeyId':_0x45dfc2,'secretAccessKey':_0x1f049b,'region':_0x2138eb});_0x595760['detectSentiment']({'Text':_0x48d84d,'LanguageCode':_0x4a63d6[_0x7ae8('0x6')](0x0,0x2)},function(_0x5e7200,_0x24bddd){if(_0x5e7200){return _0x334ae7(_0x5e7200);}else{return _0x2cc5f6(_0x24bddd);}});});}function checkTranscribeJob(_0x4bf950,_0x218df1,_0x428e16){var _0x3e41c1;return new BPromise(function(_0x510852,_0x42af18){logger[_0x7ae8('0x7')](util['format'](_0x7ae8('0x8'),_0x4bf950['id'],_0x4bf950[_0x7ae8('0x9')]));return getTranscriptionJob(_0x428e16[_0x7ae8('0xa')],_0x428e16[_0x7ae8('0xb')],_0x218df1[_0x7ae8('0xc')],_0x4bf950[_0x7ae8('0x9')])[_0x7ae8('0xd')](function(_0x16fbcc){logger[_0x7ae8('0x7')](util[_0x7ae8('0xe')](_0x7ae8('0xf'),_0x4bf950['id'],_0x4bf950[_0x7ae8('0x9')],_0x16fbcc['TranscriptionJob'][_0x7ae8('0x10')]));if(!_0x4bf950[_0x7ae8('0x11')]){switch(_0x16fbcc['TranscriptionJob'][_0x7ae8('0x10')]){case _0x7ae8('0x12'):var _0x408e0b={'transcribeStatus':_0x16fbcc[_0x7ae8('0x13')]['TranscriptionJobStatus'],'fileUri':_0x16fbcc['TranscriptionJob']['Transcript'][_0x7ae8('0x14')]};logger[_0x7ae8('0x7')](util['format'](_0x7ae8('0x15'),_0x4bf950['id']));return rp({'uri':_0x16fbcc['TranscriptionJob'][_0x7ae8('0x16')][_0x7ae8('0x14')],'json':!![]})[_0x7ae8('0xd')](function(_0x35cbed){logger[_0x7ae8('0x7')](util[_0x7ae8('0xe')](_0x7ae8('0x17'),_0x4bf950['id']));if(_0x35cbed&&_0x35cbed[_0x7ae8('0x18')]&&_0x35cbed[_0x7ae8('0x18')][_0x7ae8('0x19')]&&_0x35cbed[_0x7ae8('0x18')][_0x7ae8('0x19')][_0x7ae8('0x1a')]){_0x408e0b[_0x7ae8('0x11')]='';for(var _0x2e11d9=0x0;_0x2e11d9<_0x35cbed['results']['transcripts'][_0x7ae8('0x1a')];_0x2e11d9++){_0x408e0b['fileText']+=_0x35cbed['results'][_0x7ae8('0x19')][_0x2e11d9]['transcript']+'';}}return _0x4bf950[_0x7ae8('0x1b')](_0x408e0b);})[_0x7ae8('0xd')](function(){logger['info'](util[_0x7ae8('0xe')](_0x7ae8('0x1c'),_0x4bf950['id']));if(!_0x4bf950[_0x7ae8('0x1d')]){throw new db[(_0x7ae8('0x1e'))][(_0x7ae8('0x1f'))](_0x7ae8('0x20'));}if(!_0x218df1['sentiment']||!_0x218df1[_0x7ae8('0x21')]||!_0x218df1['sentimentRegion']||!_0x218df1[_0x7ae8('0x22')]||!_0x218df1[_0x7ae8('0x23')]){throw new db[(_0x7ae8('0x1e'))]['ValidationError'](_0x7ae8('0x24'));}if(!_0x408e0b[_0x7ae8('0x11')]){throw new Error(_0x7ae8('0x25'));}if(_0x218df1['sentimentAccountId']===_0x428e16['id']){return _0x428e16;}else{return db[_0x7ae8('0x26')][_0x7ae8('0x27')]({'where':{'id':_settings[_0x7ae8('0x21')]}});}})[_0x7ae8('0xd')](function(_0x4d7c50){if(!_0x4d7c50){throw new db[(_0x7ae8('0x1e'))][(_0x7ae8('0x1f'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x4d7c50[_0x7ae8('0xa')]||!_0x4d7c50[_0x7ae8('0xb')]){throw new db[(_0x7ae8('0x1e'))]['ValidationError'](_0x7ae8('0x28'));}_0x3e41c1=_0x4d7c50;logger[_0x7ae8('0x7')](util[_0x7ae8('0xe')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x4bf950['id']));return sentiment(_0x3e41c1[_0x7ae8('0xa')],_0x3e41c1['data2'],_0x218df1['sentimentRegion'],_0x408e0b['fileText'],_0x218df1[_0x7ae8('0x22')]);})[_0x7ae8('0xd')](function(_0x533bf8){logger[_0x7ae8('0x7')](util[_0x7ae8('0xe')](_0x7ae8('0x29'),_0x4bf950['id']));return _0x4bf950[_0x7ae8('0x1b')]({'sentiment':_0x533bf8['Sentiment'],'sPositive':_0x533bf8[_0x7ae8('0x2a')][_0x7ae8('0x2b')],'sNegative':_0x533bf8[_0x7ae8('0x2a')]['Negative'],'sMixed':_0x533bf8[_0x7ae8('0x2a')]['Mixed'],'sNeutral':_0x533bf8[_0x7ae8('0x2a')][_0x7ae8('0x2c')]});})[_0x7ae8('0xd')](function(){logger[_0x7ae8('0x7')](util['format'](_0x7ae8('0x1c'),_0x4bf950['id']));_0x510852();});case _0x7ae8('0x2d'):return _0x4bf950[_0x7ae8('0x1b')]({'transcribeStatus':'FAILED','failureReason':_0x16fbcc[_0x7ae8('0x13')]['FailureReason']})['then'](function(){logger[_0x7ae8('0x7')](util['format']('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x4bf950['id']));_0x510852();});default:logger[_0x7ae8('0x7')](util[_0x7ae8('0xe')]('[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed',_0x4bf950['id']));break;}}else{return BPromise[_0x7ae8('0x2e')]()[_0x7ae8('0xd')](function(){if(!_0x4bf950[_0x7ae8('0x1d')]){throw new db['Sequelize'][(_0x7ae8('0x1f'))](_0x7ae8('0x20'));}if(!_0x218df1[_0x7ae8('0x2f')]||!_0x218df1[_0x7ae8('0x21')]||!_0x218df1['sentimentRegion']||!_0x218df1[_0x7ae8('0x22')]||!_0x218df1[_0x7ae8('0x23')]){throw new db[(_0x7ae8('0x1e'))][(_0x7ae8('0x1f'))](_0x7ae8('0x24'));}if(!_0x4bf950['fileText']){throw new Error('Transcript\x20not\x20available');}if(_0x218df1['sentimentAccountId']===_0x428e16['id']){return _0x428e16;}else{return db[_0x7ae8('0x26')][_0x7ae8('0x27')]({'where':{'id':_settings[_0x7ae8('0x21')]}});}})[_0x7ae8('0xd')](function(_0x4e2adb){if(!_0x4e2adb){throw new db[(_0x7ae8('0x1e'))][(_0x7ae8('0x1f'))](_0x7ae8('0x30'));}if(!_0x4e2adb[_0x7ae8('0xa')]||!_0x4e2adb[_0x7ae8('0xb')]){throw new db[(_0x7ae8('0x1e'))][(_0x7ae8('0x1f'))](_0x7ae8('0x28'));}_0x3e41c1=_0x4e2adb;logger[_0x7ae8('0x7')](util[_0x7ae8('0xe')](_0x7ae8('0x31'),_0x4bf950['id']));return sentiment(_0x3e41c1[_0x7ae8('0xa')],_0x3e41c1[_0x7ae8('0xb')],_0x218df1[_0x7ae8('0x32')],_0x4bf950[_0x7ae8('0x11')],_0x218df1[_0x7ae8('0x22')]);})[_0x7ae8('0xd')](function(_0x36f942){logger[_0x7ae8('0x7')](util['format'](_0x7ae8('0x29'),_0x4bf950['id']));return _0x4bf950['update']({'sentiment':_0x36f942[_0x7ae8('0x33')],'sPositive':_0x36f942[_0x7ae8('0x2a')][_0x7ae8('0x2b')],'sNegative':_0x36f942[_0x7ae8('0x2a')][_0x7ae8('0x34')],'sMixed':_0x36f942[_0x7ae8('0x2a')]['Mixed'],'sNeutral':_0x36f942[_0x7ae8('0x2a')][_0x7ae8('0x2c')],'transcribeStatus':_0x7ae8('0x12')});})[_0x7ae8('0xd')](function(){logger[_0x7ae8('0x7')](util[_0x7ae8('0xe')](_0x7ae8('0x1c'),_0x4bf950['id']));_0x510852();});}})['catch'](function(_0x5eee24){if(_0x5eee24){if(!_0x5eee24[_0x7ae8('0x35')]||_0x5eee24[_0x7ae8('0x35')]!==_0x7ae8('0x36')){logger['error'](util[_0x7ae8('0xe')](_0x7ae8('0x37'),_0x4bf950['id']),util['inspect'](_0x5eee24,{'showHidden':![],'depth':null}));}}_0x510852();});});}function checkTranscribe(){var _0x42ec4a;var _0x10e6b9;var _0x5c6435;return db[_0x7ae8('0x38')][_0x7ae8('0x39')]({'where':{'transcribeStatus':_0x7ae8('0x3a')}})['then'](function(_0x58f513){if(!_0x58f513||!_0x58f513['length']){throw new db['Sequelize'][(_0x7ae8('0x1f'))](_0x7ae8('0x3b'));}_0x42ec4a=_0x58f513;return db['Setting'][_0x7ae8('0x27')]({'where':{'id':0x1}});})[_0x7ae8('0xd')](function(_0x21dac6){if(!_0x21dac6){throw new db[(_0x7ae8('0x1e'))][(_0x7ae8('0x1f'))](_0x7ae8('0x3c'));}_0x10e6b9=_0x21dac6;if(!_0x10e6b9[_0x7ae8('0x2')]||!_0x10e6b9['transcribeAccountId']||!_0x10e6b9[_0x7ae8('0xc')]||!_0x10e6b9['language']||!_0x10e6b9[_0x7ae8('0x23')]){throw new db[(_0x7ae8('0x1e'))]['ValidationError'](_0x7ae8('0x3d'));}return db['CloudProvider'][_0x7ae8('0x27')]({'where':{'id':_0x10e6b9[_0x7ae8('0x3e')]}});})[_0x7ae8('0xd')](function(_0x2af06d){if(!_0x2af06d){throw new db[(_0x7ae8('0x1e'))]['ValidationError'](_0x7ae8('0x30'));}if(!_0x2af06d['data1']||!_0x2af06d[_0x7ae8('0xb')]){throw new db[(_0x7ae8('0x1e'))][(_0x7ae8('0x1f'))](_0x7ae8('0x28'));}_0x5c6435=_0x2af06d;var _0xf5e180=[];_0x42ec4a['forEach'](function(_0x5c2bae){_0xf5e180[_0x7ae8('0x3f')](checkTranscribeJob(_0x5c2bae,_0x10e6b9,_0x5c6435));});return BPromise[_0x7ae8('0x40')](_0xf5e180);})[_0x7ae8('0x41')](function(_0x1e6eb8){if(_0x1e6eb8){if(!_0x1e6eb8[_0x7ae8('0x35')]||_0x1e6eb8[_0x7ae8('0x35')]!==_0x7ae8('0x36')){logger[_0x7ae8('0x42')](util[_0x7ae8('0x43')](_0x1e6eb8,{'showHidden':![],'depth':null}));}}});}exports[_0x7ae8('0x44')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0x6c50=['resolve','sentiment','Transcript\x20not\x20available','Cloud\x20Provider\x20not\x20available','Negative','Neutral','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','VoiceRecording','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','findOne','Settings\x20not\x20available','bucket','Transcribe\x20not\x20configured','transcribeAccountId','forEach','all','catch','name','inspect','start','lodash','aws-sdk','request-promise','util','../../mysqldb','transcribe','TranscribeService','getTranscriptionJob','info','format','data1','data2','transcribeRegion','then','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','transcribeName','TranscriptionJob','TranscriptionJobStatus','fileText','COMPLETED','Transcript','TranscriptFileUri','results','transcripts','length','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentimentAccountId','sentimentRegion','language','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','Positive','Mixed','FAILED','FailureReason'];(function(_0x3873bf,_0x1c0241){var _0x9e86c9=function(_0x880895){while(--_0x880895){_0x3873bf['push'](_0x3873bf['shift']());}};_0x9e86c9(++_0x1c0241);}(_0x6c50,0xa4));var _0x06c5=function(_0x598d13,_0x3ad231){_0x598d13=_0x598d13-0x0;var _0x3dfd38=_0x6c50[_0x598d13];return _0x3dfd38;};var _=require(_0x06c5('0x0'));var AWS=require(_0x06c5('0x1'));var rp=require(_0x06c5('0x2'));var util=require(_0x06c5('0x3'));var BPromise=require('bluebird');var db=require(_0x06c5('0x4'))['db'];var logger=require('../../config/logger')(_0x06c5('0x5'));function getTranscriptionJob(_0x2853be,_0x434003,_0x443043,_0x3c050f){return new Promise(function(_0x463f4f,_0x3f5b56){var _0x427dd6=new AWS[(_0x06c5('0x6'))]({'accessKeyId':_0x434003,'secretAccessKey':_0x2853be,'region':_0x443043});_0x427dd6[_0x06c5('0x7')]({'TranscriptionJobName':_0x3c050f},function(_0x154b0a,_0x546ae5){if(_0x154b0a){return _0x3f5b56(_0x154b0a);}else{return _0x463f4f(_0x546ae5);}});});}function sentiment(_0xe263a,_0x222e05,_0x3010af,_0x18f1e9,_0x4e863c){return new Promise(function(_0x510444,_0x5ea57c){var _0x1dc67b=new AWS['Comprehend']({'accessKeyId':_0x222e05,'secretAccessKey':_0xe263a,'region':_0x3010af});_0x1dc67b['detectSentiment']({'Text':_0x18f1e9,'LanguageCode':_0x4e863c['substring'](0x0,0x2)},function(_0x236104,_0x5613a8){if(_0x236104){return _0x5ea57c(_0x236104);}else{return _0x510444(_0x5613a8);}});});}function checkTranscribeJob(_0x319710,_0x2d7502,_0x68194e){var _0x4ce581;return new BPromise(function(_0x6546e3,_0x3cb963){logger[_0x06c5('0x8')](util[_0x06c5('0x9')]('[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)',_0x319710['id'],_0x319710['transcribeName']));return getTranscriptionJob(_0x68194e[_0x06c5('0xa')],_0x68194e[_0x06c5('0xb')],_0x2d7502[_0x06c5('0xc')],_0x319710['transcribeName'])[_0x06c5('0xd')](function(_0x117371){logger['info'](util[_0x06c5('0x9')](_0x06c5('0xe'),_0x319710['id'],_0x319710[_0x06c5('0xf')],_0x117371[_0x06c5('0x10')][_0x06c5('0x11')]));if(!_0x319710[_0x06c5('0x12')]){switch(_0x117371[_0x06c5('0x10')][_0x06c5('0x11')]){case _0x06c5('0x13'):var _0x2b93ba={'transcribeStatus':_0x117371[_0x06c5('0x10')][_0x06c5('0x11')],'fileUri':_0x117371[_0x06c5('0x10')][_0x06c5('0x14')][_0x06c5('0x15')]};logger[_0x06c5('0x8')](util[_0x06c5('0x9')]('[RECORDING:%d]\x20Get\x20transcript',_0x319710['id']));return rp({'uri':_0x117371[_0x06c5('0x10')][_0x06c5('0x14')][_0x06c5('0x15')],'json':!![]})[_0x06c5('0xd')](function(_0xa3659b){logger[_0x06c5('0x8')](util[_0x06c5('0x9')]('[RECORDING:%d]\x20Transcript\x20downloaded',_0x319710['id']));if(_0xa3659b&&_0xa3659b[_0x06c5('0x16')]&&_0xa3659b[_0x06c5('0x16')][_0x06c5('0x17')]&&_0xa3659b[_0x06c5('0x16')][_0x06c5('0x17')][_0x06c5('0x18')]){_0x2b93ba[_0x06c5('0x12')]='';for(var _0x51f2a6=0x0;_0x51f2a6<_0xa3659b[_0x06c5('0x16')]['transcripts']['length'];_0x51f2a6++){_0x2b93ba['fileText']+=_0xa3659b['results'][_0x06c5('0x17')][_0x51f2a6][_0x06c5('0x19')]+'';}}return _0x319710[_0x06c5('0x1a')](_0x2b93ba);})[_0x06c5('0xd')](function(){logger[_0x06c5('0x8')](util['format'](_0x06c5('0x1b'),_0x319710['id']));if(!_0x319710[_0x06c5('0x1c')]){throw new db[(_0x06c5('0x1d'))][(_0x06c5('0x1e'))](_0x06c5('0x1f'));}if(!_0x2d7502['sentiment']||!_0x2d7502[_0x06c5('0x20')]||!_0x2d7502[_0x06c5('0x21')]||!_0x2d7502[_0x06c5('0x22')]||!_0x2d7502['bucket']){throw new db[(_0x06c5('0x1d'))][(_0x06c5('0x1e'))](_0x06c5('0x23'));}if(!_0x2b93ba['fileText']){throw new Error('Transcript\x20not\x20available');}if(_0x2d7502['sentimentAccountId']===_0x68194e['id']){return _0x68194e;}else{return db[_0x06c5('0x24')]['findOne']({'where':{'id':_settings[_0x06c5('0x20')]}});}})['then'](function(_0xb849b5){if(!_0xb849b5){throw new db['Sequelize'][(_0x06c5('0x1e'))]('Cloud\x20Provider\x20not\x20available');}if(!_0xb849b5['data1']||!_0xb849b5[_0x06c5('0xb')]){throw new db['Sequelize']['ValidationError'](_0x06c5('0x25'));}_0x4ce581=_0xb849b5;logger[_0x06c5('0x8')](util[_0x06c5('0x9')](_0x06c5('0x26'),_0x319710['id']));return sentiment(_0x4ce581[_0x06c5('0xa')],_0x4ce581[_0x06c5('0xb')],_0x2d7502[_0x06c5('0x21')],_0x2b93ba['fileText'],_0x2d7502[_0x06c5('0x22')]);})['then'](function(_0x49d825){logger[_0x06c5('0x8')](util[_0x06c5('0x9')](_0x06c5('0x27'),_0x319710['id']));return _0x319710[_0x06c5('0x1a')]({'sentiment':_0x49d825[_0x06c5('0x28')],'sPositive':_0x49d825[_0x06c5('0x29')][_0x06c5('0x2a')],'sNegative':_0x49d825['SentimentScore']['Negative'],'sMixed':_0x49d825[_0x06c5('0x29')][_0x06c5('0x2b')],'sNeutral':_0x49d825['SentimentScore']['Neutral']});})[_0x06c5('0xd')](function(){logger[_0x06c5('0x8')](util[_0x06c5('0x9')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x319710['id']));_0x6546e3();});case _0x06c5('0x2c'):return _0x319710[_0x06c5('0x1a')]({'transcribeStatus':_0x06c5('0x2c'),'failureReason':_0x117371['TranscriptionJob'][_0x06c5('0x2d')]})[_0x06c5('0xd')](function(){logger['info'](util['format'](_0x06c5('0x1b'),_0x319710['id']));_0x6546e3();});default:logger['info'](util[_0x06c5('0x9')]('[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed',_0x319710['id']));break;}}else{return BPromise[_0x06c5('0x2e')]()[_0x06c5('0xd')](function(){if(!_0x319710[_0x06c5('0x1c')]){throw new db[(_0x06c5('0x1d'))][(_0x06c5('0x1e'))](_0x06c5('0x1f'));}if(!_0x2d7502[_0x06c5('0x2f')]||!_0x2d7502['sentimentAccountId']||!_0x2d7502[_0x06c5('0x21')]||!_0x2d7502['language']||!_0x2d7502['bucket']){throw new db[(_0x06c5('0x1d'))][(_0x06c5('0x1e'))](_0x06c5('0x23'));}if(!_0x319710[_0x06c5('0x12')]){throw new Error(_0x06c5('0x30'));}if(_0x2d7502[_0x06c5('0x20')]===_0x68194e['id']){return _0x68194e;}else{return db[_0x06c5('0x24')]['findOne']({'where':{'id':_settings['sentimentAccountId']}});}})['then'](function(_0x2dd49b){if(!_0x2dd49b){throw new db['Sequelize'][(_0x06c5('0x1e'))](_0x06c5('0x31'));}if(!_0x2dd49b[_0x06c5('0xa')]||!_0x2dd49b['data2']){throw new db[(_0x06c5('0x1d'))][(_0x06c5('0x1e'))](_0x06c5('0x25'));}_0x4ce581=_0x2dd49b;logger[_0x06c5('0x8')](util[_0x06c5('0x9')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x319710['id']));return sentiment(_0x4ce581[_0x06c5('0xa')],_0x4ce581[_0x06c5('0xb')],_0x2d7502[_0x06c5('0x21')],_0x319710['fileText'],_0x2d7502[_0x06c5('0x22')]);})[_0x06c5('0xd')](function(_0x560156){logger[_0x06c5('0x8')](util[_0x06c5('0x9')](_0x06c5('0x27'),_0x319710['id']));return _0x319710['update']({'sentiment':_0x560156[_0x06c5('0x28')],'sPositive':_0x560156[_0x06c5('0x29')][_0x06c5('0x2a')],'sNegative':_0x560156[_0x06c5('0x29')][_0x06c5('0x32')],'sMixed':_0x560156['SentimentScore'][_0x06c5('0x2b')],'sNeutral':_0x560156[_0x06c5('0x29')][_0x06c5('0x33')],'transcribeStatus':_0x06c5('0x13')});})[_0x06c5('0xd')](function(){logger[_0x06c5('0x8')](util['format'](_0x06c5('0x1b'),_0x319710['id']));_0x6546e3();});}})['catch'](function(_0x2a228f){if(_0x2a228f){if(!_0x2a228f['name']||_0x2a228f['name']!==_0x06c5('0x34')){logger[_0x06c5('0x35')](util['format'](_0x06c5('0x36'),_0x319710['id']),util['inspect'](_0x2a228f,{'showHidden':![],'depth':null}));}}_0x6546e3();});});}function checkTranscribe(){var _0x536b44;var _0x364a2e;var _0x26a491;return db[_0x06c5('0x37')][_0x06c5('0x38')]({'where':{'transcribeStatus':_0x06c5('0x39')}})[_0x06c5('0xd')](function(_0x3865a0){if(!_0x3865a0||!_0x3865a0[_0x06c5('0x18')]){throw new db[(_0x06c5('0x1d'))][(_0x06c5('0x1e'))](_0x06c5('0x3a'));}_0x536b44=_0x3865a0;return db['Setting'][_0x06c5('0x3b')]({'where':{'id':0x1}});})[_0x06c5('0xd')](function(_0x5c4dff){if(!_0x5c4dff){throw new db[(_0x06c5('0x1d'))][(_0x06c5('0x1e'))](_0x06c5('0x3c'));}_0x364a2e=_0x5c4dff;if(!_0x364a2e[_0x06c5('0x5')]||!_0x364a2e['transcribeAccountId']||!_0x364a2e[_0x06c5('0xc')]||!_0x364a2e['language']||!_0x364a2e[_0x06c5('0x3d')]){throw new db['Sequelize']['ValidationError'](_0x06c5('0x3e'));}return db[_0x06c5('0x24')][_0x06c5('0x3b')]({'where':{'id':_0x364a2e[_0x06c5('0x3f')]}});})[_0x06c5('0xd')](function(_0x5cfac8){if(!_0x5cfac8){throw new db[(_0x06c5('0x1d'))]['ValidationError']('Cloud\x20Provider\x20not\x20available');}if(!_0x5cfac8[_0x06c5('0xa')]||!_0x5cfac8['data2']){throw new db[(_0x06c5('0x1d'))][(_0x06c5('0x1e'))](_0x06c5('0x25'));}_0x26a491=_0x5cfac8;var _0x478d58=[];_0x536b44[_0x06c5('0x40')](function(_0x5af034){_0x478d58['push'](checkTranscribeJob(_0x5af034,_0x364a2e,_0x26a491));});return BPromise[_0x06c5('0x41')](_0x478d58);})[_0x06c5('0x42')](function(_0x45b493){if(_0x45b493){if(!_0x45b493[_0x06c5('0x43')]||_0x45b493[_0x06c5('0x43')]!==_0x06c5('0x34')){logger[_0x06c5('0x35')](util[_0x06c5('0x44')](_0x45b493,{'showHidden':![],'depth':null}));}}});}exports[_0x06c5('0x45')]=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 5676b99..db91e08 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 _0x9271=['../../mysqldb','schedule','defaults','localhost','socket.io-emitter','redis','findAll','subtract','then','length','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','WhatsappInteraction','update','timeout','YYYY-MM-DD\x20HH:mm:ss','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','join','emit','whatsappInteraction:update','catch','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','lodash','util','../../config/environment'];(function(_0x4dd374,_0x2dfdde){var _0x5cc428=function(_0x19be59){while(--_0x19be59){_0x4dd374['push'](_0x4dd374['shift']());}};_0x5cc428(++_0x2dfdde);}(_0x9271,0x1e3));var _0x1927=function(_0x305e96,_0x46e8fc){_0x305e96=_0x305e96-0x0;var _0x5f11ad=_0x9271[_0x305e96];return _0x5f11ad;};'use strict';var _=require(_0x1927('0x0'));var moment=require('moment');var Redis=require('ioredis');var util=require(_0x1927('0x1'));var config=require(_0x1927('0x2'));var db=require(_0x1927('0x3'))['db'];var logger=require('../logger')(_0x1927('0x4'));config['redis']=_[_0x1927('0x5')](config['redis'],{'host':_0x1927('0x6'),'port':0x18eb});var io=require(_0x1927('0x7'))(new Redis(config[_0x1927('0x8')]));function closeInteractions(){var _0x4942e1=[];return db['WhatsappInteraction'][_0x1927('0x9')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x1927('0xa')](0x18,'hours')}}})[_0x1927('0xb')](function(_0x5e7e26){if(_0x5e7e26&&_0x5e7e26[_0x1927('0xc')]){_0x4942e1=_[_0x1927('0xd')](_0x5e7e26||[],'id');logger[_0x1927('0xe')](_0x1927('0xf'),_0x4942e1['join']());return db[_0x1927('0x10')][_0x1927('0x11')]({'closeReason':'system','disposition':_0x1927('0x12'),'closed':!![],'closedAt':moment()['format'](_0x1927('0x13'))},{'where':{'id':_0x4942e1}});}})[_0x1927('0xb')](function(){if(_0x4942e1&&_0x4942e1[_0x1927('0xc')]){logger['info'](_0x1927('0x14'),_0x4942e1[_0x1927('0x15')]());for(var _0x217a9f=0x0;_0x217a9f<_0x4942e1[_0x1927('0xc')];_0x217a9f++){io[_0x1927('0x16')](_0x1927('0x17'),{'id':_0x4942e1[_0x217a9f],'closed':!![]});}}})[_0x1927('0x18')](function(_0x21e8aa){logger['error'](_0x1927('0x19'),_0x21e8aa?util[_0x1927('0x1a')](_0x21e8aa,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x8c7a=['inspect','start','lodash','moment','ioredis','util','../../config/environment','redis','defaults','localhost','WhatsappInteraction','findAll','lastMsgAt','hours','then','length','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','update','system','timeout','YYYY-MM-DD\x20HH:mm:ss','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','error','[WHATSAPP]\x20Error\x20closing\x20interactions'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0x8c7a,0x197));var _0xa8c7=function(_0x16a760,_0x463f7f){_0x16a760=_0x16a760-0x0;var _0x223248=_0x8c7a[_0x16a760];return _0x223248;};'use strict';var _=require(_0xa8c7('0x0'));var moment=require(_0xa8c7('0x1'));var Redis=require(_0xa8c7('0x2'));var util=require(_0xa8c7('0x3'));var config=require(_0xa8c7('0x4'));var db=require('../../mysqldb')['db'];var logger=require('../logger')('schedule');config[_0xa8c7('0x5')]=_[_0xa8c7('0x6')](config[_0xa8c7('0x5')],{'host':_0xa8c7('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xa8c7('0x5')]));function closeInteractions(){var _0x373404=[];return db[_0xa8c7('0x8')][_0xa8c7('0x9')]({'raw':!![],'attributes':['id',_0xa8c7('0xa')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()['subtract'](0x18,_0xa8c7('0xb'))}}})[_0xa8c7('0xc')](function(_0x19d302){if(_0x19d302&&_0x19d302[_0xa8c7('0xd')]){_0x373404=_[_0xa8c7('0xe')](_0x19d302||[],'id');logger[_0xa8c7('0xf')](_0xa8c7('0x10'),_0x373404[_0xa8c7('0x11')]());return db[_0xa8c7('0x8')][_0xa8c7('0x12')]({'closeReason':_0xa8c7('0x13'),'disposition':_0xa8c7('0x14'),'closed':!![],'closedAt':moment()['format'](_0xa8c7('0x15'))},{'where':{'id':_0x373404}});}})['then'](function(){if(_0x373404&&_0x373404[_0xa8c7('0xd')]){logger['info'](_0xa8c7('0x16'),_0x373404['join']());for(var _0x3496cb=0x0;_0x3496cb<_0x373404['length'];_0x3496cb++){io['emit']('whatsappInteraction:update',{'id':_0x373404[_0x3496cb],'closed':!![]});}}})['catch'](function(_0xb8cd05){logger[_0xa8c7('0x17')](_0xa8c7('0x18'),_0xb8cd05?util[_0xa8c7('0x19')](_0xb8cd05,{'showHidden':![],'depth':null}):'');});}exports[_0xa8c7('0x1a')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/seedContact.js b/server/config/seedContact.js index 549c6f5..fb4b1d6 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7bdf=['util','../mysqldb','push','Innocenzo','Biondo','innocenzo.biondo','@xcally.com','now','CmContact','destroy','bulkCreate','then','log','finished\x20populating','contacts1','CmHopper','hopper1','hopper2'];(function(_0x63b6c3,_0x5c3125){var _0x1b01f9=function(_0x215a90){while(--_0x215a90){_0x63b6c3['push'](_0x63b6c3['shift']());}};_0x1b01f9(++_0x5c3125);}(_0x7bdf,0x1e6));var _0xf7bd=function(_0x4d3979,_0x5da18d){_0x4d3979=_0x4d3979-0x0;var _0x259c64=_0x7bdf[_0x4d3979];return _0x259c64;};'use strict';var util=require(_0xf7bd('0x0'));var db=require(_0xf7bd('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0xf7bd('0x2')]({'id':i,'firstName':_0xf7bd('0x3')+i,'lastName':_0xf7bd('0x4')+i,'phone':0xf879fb460+i,'email':_0xf7bd('0x5')+i+_0xf7bd('0x6')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0xf7bd('0x2')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xf7bd('0x7')](),'updatedAt':Date[_0xf7bd('0x7')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':_0xf7bd('0x3')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0xf7bd('0x5')+i+_0xf7bd('0x6')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2['push']({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xf7bd('0x7')](),'updatedAt':Date[_0xf7bd('0x7')]()});}db[_0xf7bd('0x8')][_0xf7bd('0x9')]({'where':{}})['then'](function(){return db[_0xf7bd('0x8')][_0xf7bd('0xa')](contacts);})[_0xf7bd('0xb')](function(){console[_0xf7bd('0xc')](_0xf7bd('0xd'),_0xf7bd('0xe'));return db[_0xf7bd('0xf')][_0xf7bd('0x9')]({'where':{}});})[_0xf7bd('0xb')](function(){return db['CmHopper'][_0xf7bd('0xa')](hopper);})[_0xf7bd('0xb')](function(){console[_0xf7bd('0xc')](_0xf7bd('0xd'),_0xf7bd('0x10'));return db[_0xf7bd('0x8')]['bulkCreate'](contacts2);})[_0xf7bd('0xb')](function(){console[_0xf7bd('0xc')]('finished\x20populating','contacts2');return db[_0xf7bd('0xf')][_0xf7bd('0xa')](hopper2);})['then'](function(){console[_0xf7bd('0xc')](_0xf7bd('0xd'),_0xf7bd('0x11'));})['catch'](function(_0x196d0f){console[_0xf7bd('0xc')](_0x196d0f);}); \ No newline at end of file +var _0x809c=['now','CmContact','destroy','then','bulkCreate','contacts1','CmHopper','log','finished\x20populating','contacts2','hopper2','util','../mysqldb','push','Innocenzo','Biondo','@xcally.com'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x809c,0xe8));var _0xc809=function(_0x17ef77,_0x2c091a){_0x17ef77=_0x17ef77-0x0;var _0x428621=_0x809c[_0x17ef77];return _0x428621;};'use strict';var util=require(_0xc809('0x0'));var db=require(_0xc809('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0xc809('0x2')]({'id':i,'firstName':_0xc809('0x3')+i,'lastName':_0xc809('0x4')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0xc809('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper['push']({'id':i,'active':![],'scheduledat':Date[_0xc809('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xc809('0x6')](),'updatedAt':Date[_0xc809('0x6')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0xc809('0x2')]({'id':i,'firstName':_0xc809('0x3')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0xc809('0x5')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xc809('0x2')]({'id':i,'active':![],'scheduledat':Date[_0xc809('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xc809('0x6')](),'updatedAt':Date['now']()});}db[_0xc809('0x7')][_0xc809('0x8')]({'where':{}})[_0xc809('0x9')](function(){return db[_0xc809('0x7')][_0xc809('0xa')](contacts);})['then'](function(){console['log']('finished\x20populating',_0xc809('0xb'));return db['CmHopper'][_0xc809('0x8')]({'where':{}});})[_0xc809('0x9')](function(){return db[_0xc809('0xc')][_0xc809('0xa')](hopper);})[_0xc809('0x9')](function(){console[_0xc809('0xd')](_0xc809('0xe'),'hopper1');return db[_0xc809('0x7')][_0xc809('0xa')](contacts2);})[_0xc809('0x9')](function(){console[_0xc809('0xd')](_0xc809('0xe'),_0xc809('0xf'));return db[_0xc809('0xc')][_0xc809('0xa')](hopper2);})['then'](function(){console[_0xc809('0xd')](_0xc809('0xe'),_0xc809('0x10'));})['catch'](function(_0x26c059){console[_0xc809('0xd')](_0x26c059);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index 2fb2c4f..abb9a02 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc053=['catch','util','../mysqldb','format','agent','%s%s@xcally.com','password','friend','wss','all','ulaw','%s%s','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>','User','bulkCreate','log','add\x20user'];(function(_0x2e4de4,_0x2d720b){var _0x427915=function(_0x3e4ae7){while(--_0x3e4ae7){_0x2e4de4['push'](_0x2e4de4['shift']());}};_0x427915(++_0x2d720b);}(_0xc053,0x1a5));var _0x3c05=function(_0x524c03,_0x43b170){_0x524c03=_0x524c03-0x0;var _0x42145e=_0xc053[_0x524c03];return _0x42145e;};'use strict';var util=require(_0x3c05('0x0'));var db=require(_0x3c05('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users['push']({'name':util[_0x3c05('0x2')]('%s%s',_0x3c05('0x3'),i),'fullname':util[_0x3c05('0x2')]('%s%s',_0x3c05('0x3'),i),'email':util[_0x3c05('0x2')](_0x3c05('0x4'),_0x3c05('0x3'),i),'role':'agent','password':_0x3c05('0x5'),'internal':0xfa0+i,'type':_0x3c05('0x6'),'transport':['udp','ws',_0x3c05('0x7')],'disallow':[_0x3c05('0x8')],'allow':[_0x3c05('0x9')],'defaultuser':util[_0x3c05('0x2')](_0x3c05('0xa'),_0x3c05('0x3'),i),'encryption':_0x3c05('0xb'),'avpf':_0x3c05('0xb'),'force_avp':_0x3c05('0xb'),'icesupport':_0x3c05('0xb'),'dtlsenable':_0x3c05('0xb'),'dtlsverify':'no','dtlscertfile':_0x3c05('0xc'),'dtlsprivatekey':_0x3c05('0xd'),'dtlssetup':_0x3c05('0xe'),'callerid':util[_0x3c05('0x2')](_0x3c05('0xf'),util[_0x3c05('0x2')](_0x3c05('0xa'),_0x3c05('0x3'),i),0xfa0+i)});}db[_0x3c05('0x10')][_0x3c05('0x11')](users)['then'](function(){console[_0x3c05('0x12')](_0x3c05('0x13'));})[_0x3c05('0x14')](function(_0x189429){console[_0x3c05('0x12')](_0x189429);}); \ No newline at end of file +var _0x0ed7=['format','%s%s','agent','%s%s@xcally.com','password','udp','wss','all','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>','User','bulkCreate','then','log','add\x20user','../mysqldb','push'];(function(_0x4bc0f3,_0x3912b4){var _0x54788c=function(_0x616380){while(--_0x616380){_0x4bc0f3['push'](_0x4bc0f3['shift']());}};_0x54788c(++_0x3912b4);}(_0x0ed7,0x9e));var _0x70ed=function(_0x4e7af4,_0x758572){_0x4e7af4=_0x4e7af4-0x0;var _0x2548f1=_0x0ed7[_0x4e7af4];return _0x2548f1;};'use strict';var util=require('util');var db=require(_0x70ed('0x0'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x70ed('0x1')]({'name':util[_0x70ed('0x2')](_0x70ed('0x3'),_0x70ed('0x4'),i),'fullname':util[_0x70ed('0x2')](_0x70ed('0x3'),'agent',i),'email':util[_0x70ed('0x2')](_0x70ed('0x5'),'agent',i),'role':_0x70ed('0x4'),'password':_0x70ed('0x6'),'internal':0xfa0+i,'type':'friend','transport':[_0x70ed('0x7'),'ws',_0x70ed('0x8')],'disallow':[_0x70ed('0x9')],'allow':['ulaw'],'defaultuser':util[_0x70ed('0x2')](_0x70ed('0x3'),_0x70ed('0x4'),i),'encryption':_0x70ed('0xa'),'avpf':_0x70ed('0xa'),'force_avp':'yes','icesupport':_0x70ed('0xa'),'dtlsenable':'yes','dtlsverify':'no','dtlscertfile':_0x70ed('0xb'),'dtlsprivatekey':_0x70ed('0xc'),'dtlssetup':_0x70ed('0xd'),'callerid':util['format'](_0x70ed('0xe'),util['format']('%s%s','agent',i),0xfa0+i)});}db[_0x70ed('0xf')][_0x70ed('0x10')](users)[_0x70ed('0x11')](function(){console[_0x70ed('0x12')](_0x70ed('0x13'));})['catch'](function(_0x26ba18){console[_0x70ed('0x12')](_0x26ba18);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index b5a8eb6..6980a6d 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x804d=['where','%s:queue:%s','format','handshake','query','find','userProfileId','ChatInteraction','MailInteraction','MailInteractions','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteractions','user:%s','voice:inbound','voice:outbound','hasOwnProperty','include','push','VoiceQueue','ChatQueue','FaxQueue','OpenchannelQueue','WhatsappQueue','Trunk','Campaign','user','VoiceQueues','SmsQueues','SmsQueue','MailQueue','WhatsappQueues','getVoiceQueues','getChatQueues','getSmsQueues','getWhatsappQueues','all','length','voice','chat','sms','openchannel','whatsapp','trunk:%s','leave','map','ChatInteractions','removeChatInteractions','user_has_chat_interactions:remove','removeMailInteractions','emit','user_has_mail_interactions:remove','FaxInteractions','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','default','connection','setMaxListeners','address','remoteAddress','request','remotePort','connectedAt','SocketIO\x20','disconnect','DISCONNECTED','CONNECTED','lodash','util','bluebird','../mysqldb','./environment','name','Agents','User','role','agent','telephone','type','ivr','UserProfileSection','findOne','then','ChatQueues','FaxQueues','MailQueues','OpenchannelQueues','findAll','Telephones','IvrCampaigns','UserProfileResource','resourceId'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x804d,0x116));var _0xd804=function(_0x5c6c2e,_0x86e980){_0x5c6c2e=_0x5c6c2e-0x0;var _0xd262ac=_0x804d[_0x5c6c2e];return _0xd262ac;};'use strict';var _=require(_0xd804('0x0'));var util=require(_0xd804('0x1'));var BPromise=require(_0xd804('0x2'));var db=require(_0xd804('0x3'))['db'];var config=require(_0xd804('0x4'));var queryQueues={'attributes':['id',_0xd804('0x5')],'include':[{'as':_0xd804('0x6'),'model':db[_0xd804('0x7')],'attributes':['id','name',_0xd804('0x8')],'raw':!![],'where':{'role':_0xd804('0x9')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0xd804('0x5')],'where':{'role':_0xd804('0xa')}};var queryTrunks={'raw':!![],'attributes':['id',_0xd804('0x5')]};var queryAgents={'raw':!![],'attributes':['id',_0xd804('0x5')],'where':{'role':_0xd804('0x9')}};var queryCampaigns={'raw':!![],'attributes':['id',_0xd804('0x5'),_0xd804('0xb')],'where':{'type':_0xd804('0xc')}};function getAssociatedResources(_0x1379b5,_0x1ebd40,_0x4d12bd){return db[_0xd804('0xd')][_0xd804('0xe')]({'where':{'name':_0x1379b5,'userProfileId':_0x1ebd40},'raw':!![]})[_0xd804('0xf')](function(_0xa48fe0){if(_0xa48fe0){if(_0xa48fe0['autoAssociation']){switch(_0x1379b5){case'VoiceQueues':case _0xd804('0x10'):case _0xd804('0x11'):case'SmsQueues':case _0xd804('0x12'):case _0xd804('0x13'):case'WhatsappQueues':return db[_0x4d12bd][_0xd804('0x14')](queryQueues);case _0xd804('0x15'):return db[_0x4d12bd][_0xd804('0x14')](queryTelephones);case'Trunks':return db[_0x4d12bd]['findAll'](queryTrunks);case _0xd804('0x16'):return db[_0x4d12bd][_0xd804('0x14')](queryCampaigns);}}else{return db[_0xd804('0x17')][_0xd804('0x14')]({'attributes':[_0xd804('0x18')],'where':{'sectionId':_0xa48fe0['id']},'raw':!![]})['then'](function(_0x18c4a0){if(_0x18c4a0){var _0x30be96={'where':{'id':_['map'](_0x18c4a0,_0xd804('0x18'))},'raw':!![]};switch(_0x4d12bd){case _0xd804('0x7'):_0x30be96[_0xd804('0x19')]['role']=_0xd804('0xa');break;case'Campaign':_0x30be96[_0xd804('0x19')][_0xd804('0xb')]=_0xd804('0xc');break;}return db[_0x4d12bd]['findAll'](_0x30be96);}else{return[];}});}}else{return[];}})[_0xd804('0xf')](function(_0x17aeee){return _0x17aeee;});}function joinOrLeaveQueues(_0x398f79,_0x2d881a,_0x13c0eb,_0x5d29d1){_0x398f79[_0x2d881a](util['format'](_0xd804('0x1a'),_0x13c0eb,_0x5d29d1['name']));if(_0x5d29d1[_0xd804('0x6')]){for(var _0x103f52=0x0;_0x103f52<_0x5d29d1[_0xd804('0x6')]['length'];_0x103f52+=0x1){_0x398f79[_0x2d881a](util[_0xd804('0x1b')]('user:%s',_0x5d29d1[_0xd804('0x6')][_0x103f52]['name']));}}}function joinOrLeave(_0x50ce5e,_0x52c85c,_0x51b191){var _0x2cde57;if(_0x50ce5e[_0xd804('0x1c')][_0xd804('0x1d')]['id']){db['User'][_0xd804('0x1e')]({'attributes':['id',_0xd804('0x5'),_0xd804('0x8'),_0xd804('0x1f')],'where':{'id':_0x50ce5e['handshake'][_0xd804('0x1d')]['id']},'include':[{'model':db[_0xd804('0x20')],'as':'ChatInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xd804('0x21')],'as':_0xd804('0x22'),'attributes':['id'],'raw':!![]},{'model':db['FaxInteraction'],'as':'FaxInteractions','attributes':['id'],'raw':!![]},{'model':db['SmsInteraction'],'as':_0xd804('0x23'),'attributes':['id'],'raw':!![]},{'model':db[_0xd804('0x24')],'as':_0xd804('0x25'),'attributes':['id'],'raw':!![]},{'model':db['WhatsappInteraction'],'as':_0xd804('0x26'),'attributes':['id'],'raw':!![]}]})[_0xd804('0xf')](function(_0x1858f0){if(_0x1858f0){_0x2cde57=_0x1858f0;_0x50ce5e[_0x52c85c](util[_0xd804('0x1b')](_0xd804('0x27'),_0x1858f0[_0xd804('0x5')]));var _0x11f19e=[];switch(_0x1858f0[_0xd804('0x8')]){case'admin':_0x50ce5e[_0x52c85c](_0xd804('0x28'));_0x50ce5e[_0x52c85c](_0xd804('0x29'));if(queryQueues[_0xd804('0x2a')](_0xd804('0x2b'))){delete queryQueues[_0xd804('0x2b')];}_0x11f19e[_0xd804('0x2c')](db[_0xd804('0x2d')][_0xd804('0x14')](queryQueues));_0x11f19e[_0xd804('0x2c')](db[_0xd804('0x2e')]['findAll'](queryQueues));_0x11f19e['push'](db[_0xd804('0x2f')][_0xd804('0x14')](queryQueues));_0x11f19e['push'](db['SmsQueue'][_0xd804('0x14')](queryQueues));_0x11f19e['push'](db['MailQueue'][_0xd804('0x14')](queryQueues));_0x11f19e[_0xd804('0x2c')](db[_0xd804('0x30')][_0xd804('0x14')](queryQueues));_0x11f19e[_0xd804('0x2c')](db[_0xd804('0x31')][_0xd804('0x14')](queryQueues));_0x11f19e[_0xd804('0x2c')](db['User'][_0xd804('0x14')](queryTelephones));_0x11f19e['push'](db[_0xd804('0x32')][_0xd804('0x14')](queryTrunks));_0x11f19e[_0xd804('0x2c')](db[_0xd804('0x33')][_0xd804('0x14')](queryCampaigns));_0x11f19e['push'](db['User']['findAll'](queryAgents));break;case _0xd804('0x34'):_0x50ce5e[_0x52c85c]('voice:inbound');_0x50ce5e[_0x52c85c](_0xd804('0x29'));_0x11f19e[_0xd804('0x2c')](getAssociatedResources(_0xd804('0x35'),_0x1858f0[_0xd804('0x1f')],_0xd804('0x2d')));_0x11f19e['push'](getAssociatedResources('ChatQueues',_0x1858f0[_0xd804('0x1f')],_0xd804('0x2e')));_0x11f19e[_0xd804('0x2c')](getAssociatedResources(_0xd804('0x11'),_0x1858f0['userProfileId'],'FaxQueue'));_0x11f19e[_0xd804('0x2c')](getAssociatedResources(_0xd804('0x36'),_0x1858f0[_0xd804('0x1f')],_0xd804('0x37')));_0x11f19e['push'](getAssociatedResources('MailQueues',_0x1858f0['userProfileId'],_0xd804('0x38')));_0x11f19e[_0xd804('0x2c')](getAssociatedResources(_0xd804('0x13'),_0x1858f0['userProfileId'],_0xd804('0x30')));_0x11f19e['push'](getAssociatedResources(_0xd804('0x39'),_0x1858f0[_0xd804('0x1f')],_0xd804('0x31')));_0x11f19e['push'](getAssociatedResources(_0xd804('0x15'),_0x1858f0[_0xd804('0x1f')],_0xd804('0x7')));_0x11f19e[_0xd804('0x2c')](getAssociatedResources('Trunks',_0x1858f0[_0xd804('0x1f')],_0xd804('0x32')));_0x11f19e[_0xd804('0x2c')](getAssociatedResources(_0xd804('0x16'),_0x1858f0[_0xd804('0x1f')],_0xd804('0x33')));_0x11f19e['push'](db['User'][_0xd804('0x14')](queryAgents));break;case'agent':_0x50ce5e[_0x52c85c](_0xd804('0x28'));_0x50ce5e[_0x52c85c](_0xd804('0x29'));_0x11f19e[_0xd804('0x2c')](_0x1858f0[_0xd804('0x3a')]({'attributes':['id',_0xd804('0x5')]}));_0x11f19e[_0xd804('0x2c')](_0x1858f0[_0xd804('0x3b')]({'attributes':['id',_0xd804('0x5')]}));_0x11f19e[_0xd804('0x2c')](_0x1858f0['getFaxQueues']({'attributes':['id','name']}));_0x11f19e[_0xd804('0x2c')](_0x1858f0[_0xd804('0x3c')]({'attributes':['id',_0xd804('0x5')]}));_0x11f19e[_0xd804('0x2c')](_0x1858f0['getMailQueues']({'attributes':['id','name']}));_0x11f19e[_0xd804('0x2c')](_0x1858f0['getOpenchannelQueues']({'attributes':['id',_0xd804('0x5')]}));_0x11f19e[_0xd804('0x2c')](_0x1858f0[_0xd804('0x3d')]({'attributes':['id',_0xd804('0x5')]}));break;}return BPromise[_0xd804('0x3e')](_0x11f19e);}})[_0xd804('0xf')](function(_0x38a454){if(_0x38a454&&_0x38a454[_0xd804('0x3f')]){for(var _0x4cf155=0x0;_0x4cf155<_0x38a454[_0xd804('0x3f')];_0x4cf155+=0x1){for(var _0x24a546=0x0;_0x24a546<_0x38a454[_0x4cf155]['length'];_0x24a546+=0x1){switch(_0x4cf155){case 0x0:joinOrLeaveQueues(_0x50ce5e,_0x52c85c,_0xd804('0x40'),_0x38a454[_0x4cf155][_0x24a546]);break;case 0x1:joinOrLeaveQueues(_0x50ce5e,_0x52c85c,_0xd804('0x41'),_0x38a454[_0x4cf155][_0x24a546]);break;case 0x2:joinOrLeaveQueues(_0x50ce5e,_0x52c85c,'fax',_0x38a454[_0x4cf155][_0x24a546]);break;case 0x3:joinOrLeaveQueues(_0x50ce5e,_0x52c85c,_0xd804('0x42'),_0x38a454[_0x4cf155][_0x24a546]);break;case 0x4:joinOrLeaveQueues(_0x50ce5e,_0x52c85c,'mail',_0x38a454[_0x4cf155][_0x24a546]);break;case 0x5:joinOrLeaveQueues(_0x50ce5e,_0x52c85c,_0xd804('0x43'),_0x38a454[_0x4cf155][_0x24a546]);break;case 0x6:joinOrLeaveQueues(_0x50ce5e,_0x52c85c,_0xd804('0x44'),_0x38a454[_0x4cf155][_0x24a546]);break;case 0x7:if(_0x2cde57['role']!==_0xd804('0x9'))_0x50ce5e[_0x52c85c](util[_0xd804('0x1b')]('telephone:%s',_0x38a454[_0x4cf155][_0x24a546][_0xd804('0x5')]));break;case 0x8:if(_0x2cde57[_0xd804('0x8')]!==_0xd804('0x9'))_0x50ce5e[_0x52c85c](util[_0xd804('0x1b')](_0xd804('0x45'),_0x38a454[_0x4cf155][_0x24a546][_0xd804('0x5')]));break;case 0x9:if(_0x2cde57[_0xd804('0x8')]!==_0xd804('0x9'))_0x50ce5e[_0x52c85c](util[_0xd804('0x1b')]('campaign:%s:%s',_0x38a454[_0x4cf155][_0x24a546][_0xd804('0xb')],_0x38a454[_0x4cf155][_0x24a546]['name']));break;case 0xa:_0x50ce5e[_0x52c85c](util[_0xd804('0x1b')](_0xd804('0x27'),_0x38a454[_0x4cf155][_0x24a546][_0xd804('0x5')]));break;}}}}})[_0xd804('0xf')](function(){if(_0x52c85c===_0xd804('0x46')){var _0xeb1408=_[_0xd804('0x47')](_0x2cde57[_0xd804('0x48')],'id');return _0x2cde57[_0xd804('0x49')](_0xeb1408)['then'](function(){for(var _0x465429=0x0;_0x465429<_0xeb1408[_0xd804('0x3f')];_0x465429+=0x1){_0x51b191['emit'](_0xd804('0x4a'),{'ChatInteractionId':Number(_0xeb1408[_0x465429]),'UserId':Number(_0x2cde57['id'])});}});}})[_0xd804('0xf')](function(){if(_0x52c85c===_0xd804('0x46')){var _0x5139ee=_[_0xd804('0x47')](_0x2cde57[_0xd804('0x22')],'id');return _0x2cde57[_0xd804('0x4b')](_0x5139ee)[_0xd804('0xf')](function(){for(var _0x5af81d=0x0;_0x5af81d<_0x5139ee['length'];_0x5af81d+=0x1){_0x51b191[_0xd804('0x4c')](_0xd804('0x4d'),{'MailInteractionId':Number(_0x5139ee[_0x5af81d]),'UserId':Number(_0x2cde57['id'])});}});}})[_0xd804('0xf')](function(){if(_0x52c85c===_0xd804('0x46')){var _0x37e174=_[_0xd804('0x47')](_0x2cde57[_0xd804('0x4e')],'id');return _0x2cde57[_0xd804('0x4f')](_0x37e174)[_0xd804('0xf')](function(){for(var _0x5947ce=0x0;_0x5947ce<_0x37e174[_0xd804('0x3f')];_0x5947ce+=0x1){_0x51b191['emit'](_0xd804('0x50'),{'FaxInteractionId':Number(_0x37e174[_0x5947ce]),'UserId':Number(_0x2cde57['id'])});}});}})[_0xd804('0xf')](function(){if(_0x52c85c===_0xd804('0x46')){var _0x9203e5=_['map'](_0x2cde57[_0xd804('0x23')],'id');return _0x2cde57[_0xd804('0x51')](_0x9203e5)[_0xd804('0xf')](function(){for(var _0x3c3405=0x0;_0x3c3405<_0x9203e5[_0xd804('0x3f')];_0x3c3405+=0x1){_0x51b191['emit'](_0xd804('0x52'),{'SmsInteractionId':Number(_0x9203e5[_0x3c3405]),'UserId':Number(_0x2cde57['id'])});}});}})[_0xd804('0xf')](function(){if(_0x52c85c===_0xd804('0x46')){var _0x46a608=_[_0xd804('0x47')](_0x2cde57[_0xd804('0x25')],'id');return _0x2cde57[_0xd804('0x53')](_0x46a608)['then'](function(){for(var _0x4b6327=0x0;_0x4b6327<_0x46a608[_0xd804('0x3f')];_0x4b6327+=0x1){_0x51b191[_0xd804('0x4c')](_0xd804('0x54'),{'OpenchannelInteractionId':Number(_0x46a608[_0x4b6327]),'UserId':Number(_0x2cde57['id'])});}});}})['then'](function(){if(_0x52c85c===_0xd804('0x46')){var _0x43bd48=_[_0xd804('0x47')](_0x2cde57[_0xd804('0x26')],'id');return _0x2cde57[_0xd804('0x55')](_0x43bd48)[_0xd804('0xf')](function(){for(var _0x2cccce=0x0;_0x2cccce<_0x43bd48['length'];_0x2cccce+=0x1){_0x51b191[_0xd804('0x4c')](_0xd804('0x56'),{'WhatsappInteractionId':Number(_0x43bd48[_0x2cccce]),'UserId':Number(_0x2cde57['id'])});}});}})[_0xd804('0x57')](function(_0x511456){_0x50ce5e[_0xd804('0x58')](_0x511456);});}}function onDisconnect(_0x141ea7,_0x266127){joinOrLeave(_0x141ea7,_0xd804('0x46'),_0x266127);}function onConnect(_0x2d14a9){joinOrLeave(_0x2d14a9,'join');}exports[_0xd804('0x59')]=function(_0x397c57){_0x397c57['on'](_0xd804('0x5a'),function(_0x5806cd){_0x5806cd[_0xd804('0x5b')](0x0);_0x5806cd[_0xd804('0x5c')]=_0x5806cd['request']['connection'][_0xd804('0x5d')]+':'+_0x5806cd[_0xd804('0x5e')][_0xd804('0x5a')][_0xd804('0x5f')];_0x5806cd[_0xd804('0x60')]=new Date();_0x5806cd[_0xd804('0x58')]=function(_0x37aa4d){console[_0xd804('0x58')](_0xd804('0x61')+_0x5806cd['nsp'][_0xd804('0x5')]+'['+_0x5806cd[_0xd804('0x5c')]+']',_0x37aa4d);};_0x5806cd['on'](_0xd804('0x62'),function(){onDisconnect(_0x5806cd,_0x397c57);_0x5806cd[_0xd804('0x58')](_0xd804('0x63'));});onConnect(_0x5806cd);_0x5806cd['log'](_0xd804('0x64'));});}; \ No newline at end of file +var _0x4c99=['VoiceQueues','ChatQueues','FaxQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll','Telephones','Trunks','resourceId','map','where','Campaign','format','length','user:%s','handshake','find','userProfileId','ChatInteraction','ChatInteractions','MailInteraction','FaxInteraction','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','admin','voice:inbound','hasOwnProperty','include','push','VoiceQueue','ChatQueue','SmsQueue','MailQueue','OpenchannelQueue','user','voice:outbound','FaxQueue','SmsQueues','WhatsappQueue','Trunk','IvrCampaigns','getVoiceQueues','getChatQueues','getSmsQueues','getOpenchannelQueues','getWhatsappQueues','all','voice','chat','fax','sms','mail','whatsapp','telephone:%s','trunk:%s','campaign:%s:%s','removeChatInteractions','emit','user_has_chat_interactions:remove','MailInteractions','user_has_mail_interactions:remove','leave','FaxInteractions','removeFaxInteractions','removeSmsInteractions','user_has_sms_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','log','join','default','connection','setMaxListeners','address','request','remoteAddress','remotePort','connectedAt','SocketIO\x20','nsp','disconnect','DISCONNECTED','lodash','bluebird','Agents','User','role','agent','telephone','name','type','ivr','UserProfileSection','findOne','then'];(function(_0x315180,_0x1178c7){var _0x10194a=function(_0x2cbc56){while(--_0x2cbc56){_0x315180['push'](_0x315180['shift']());}};_0x10194a(++_0x1178c7);}(_0x4c99,0x1ec));var _0x94c9=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x4c99[_0x46698a];return _0x356db0;};'use strict';var _=require(_0x94c9('0x0'));var util=require('util');var BPromise=require(_0x94c9('0x1'));var db=require('../mysqldb')['db'];var config=require('./environment');var queryQueues={'attributes':['id','name'],'include':[{'as':_0x94c9('0x2'),'model':db[_0x94c9('0x3')],'attributes':['id','name',_0x94c9('0x4')],'raw':!![],'where':{'role':_0x94c9('0x5')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id','name'],'where':{'role':_0x94c9('0x6')}};var queryTrunks={'raw':!![],'attributes':['id','name']};var queryAgents={'raw':!![],'attributes':['id','name'],'where':{'role':'agent'}};var queryCampaigns={'raw':!![],'attributes':['id',_0x94c9('0x7'),_0x94c9('0x8')],'where':{'type':_0x94c9('0x9')}};function getAssociatedResources(_0x53bd2d,_0xecc387,_0x1c0983){return db[_0x94c9('0xa')][_0x94c9('0xb')]({'where':{'name':_0x53bd2d,'userProfileId':_0xecc387},'raw':!![]})[_0x94c9('0xc')](function(_0x284f39){if(_0x284f39){if(_0x284f39['autoAssociation']){switch(_0x53bd2d){case _0x94c9('0xd'):case _0x94c9('0xe'):case _0x94c9('0xf'):case'SmsQueues':case _0x94c9('0x10'):case _0x94c9('0x11'):case _0x94c9('0x12'):return db[_0x1c0983][_0x94c9('0x13')](queryQueues);case _0x94c9('0x14'):return db[_0x1c0983][_0x94c9('0x13')](queryTelephones);case _0x94c9('0x15'):return db[_0x1c0983][_0x94c9('0x13')](queryTrunks);case'IvrCampaigns':return db[_0x1c0983]['findAll'](queryCampaigns);}}else{return db['UserProfileResource'][_0x94c9('0x13')]({'attributes':[_0x94c9('0x16')],'where':{'sectionId':_0x284f39['id']},'raw':!![]})['then'](function(_0x210709){if(_0x210709){var _0x3abfa5={'where':{'id':_[_0x94c9('0x17')](_0x210709,'resourceId')},'raw':!![]};switch(_0x1c0983){case'User':_0x3abfa5[_0x94c9('0x18')][_0x94c9('0x4')]=_0x94c9('0x6');break;case _0x94c9('0x19'):_0x3abfa5['where'][_0x94c9('0x8')]=_0x94c9('0x9');break;}return db[_0x1c0983][_0x94c9('0x13')](_0x3abfa5);}else{return[];}});}}else{return[];}})[_0x94c9('0xc')](function(_0x30a237){return _0x30a237;});}function joinOrLeaveQueues(_0xf48950,_0x443d7d,_0x564c99,_0x256614){_0xf48950[_0x443d7d](util[_0x94c9('0x1a')]('%s:queue:%s',_0x564c99,_0x256614[_0x94c9('0x7')]));if(_0x256614[_0x94c9('0x2')]){for(var _0x114828=0x0;_0x114828<_0x256614[_0x94c9('0x2')][_0x94c9('0x1b')];_0x114828+=0x1){_0xf48950[_0x443d7d](util[_0x94c9('0x1a')](_0x94c9('0x1c'),_0x256614[_0x94c9('0x2')][_0x114828][_0x94c9('0x7')]));}}}function joinOrLeave(_0x39890b,_0x553196,_0x2f20bd){var _0x50ee41;if(_0x39890b[_0x94c9('0x1d')]['query']['id']){db[_0x94c9('0x3')][_0x94c9('0x1e')]({'attributes':['id',_0x94c9('0x7'),_0x94c9('0x4'),_0x94c9('0x1f')],'where':{'id':_0x39890b[_0x94c9('0x1d')]['query']['id']},'include':[{'model':db[_0x94c9('0x20')],'as':_0x94c9('0x21'),'attributes':['id'],'raw':!![]},{'model':db[_0x94c9('0x22')],'as':'MailInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x94c9('0x23')],'as':'FaxInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x94c9('0x24')],'as':_0x94c9('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0x94c9('0x26')],'as':_0x94c9('0x27'),'attributes':['id'],'raw':!![]},{'model':db[_0x94c9('0x28')],'as':_0x94c9('0x29'),'attributes':['id'],'raw':!![]}]})['then'](function(_0x3ab136){if(_0x3ab136){_0x50ee41=_0x3ab136;_0x39890b[_0x553196](util[_0x94c9('0x1a')](_0x94c9('0x1c'),_0x3ab136['name']));var _0x3df4d6=[];switch(_0x3ab136[_0x94c9('0x4')]){case _0x94c9('0x2a'):_0x39890b[_0x553196](_0x94c9('0x2b'));_0x39890b[_0x553196]('voice:outbound');if(queryQueues[_0x94c9('0x2c')](_0x94c9('0x2d'))){delete queryQueues['include'];}_0x3df4d6[_0x94c9('0x2e')](db[_0x94c9('0x2f')][_0x94c9('0x13')](queryQueues));_0x3df4d6[_0x94c9('0x2e')](db[_0x94c9('0x30')][_0x94c9('0x13')](queryQueues));_0x3df4d6[_0x94c9('0x2e')](db['FaxQueue'][_0x94c9('0x13')](queryQueues));_0x3df4d6[_0x94c9('0x2e')](db[_0x94c9('0x31')][_0x94c9('0x13')](queryQueues));_0x3df4d6['push'](db[_0x94c9('0x32')][_0x94c9('0x13')](queryQueues));_0x3df4d6['push'](db[_0x94c9('0x33')][_0x94c9('0x13')](queryQueues));_0x3df4d6[_0x94c9('0x2e')](db['WhatsappQueue'][_0x94c9('0x13')](queryQueues));_0x3df4d6[_0x94c9('0x2e')](db['User'][_0x94c9('0x13')](queryTelephones));_0x3df4d6['push'](db['Trunk'][_0x94c9('0x13')](queryTrunks));_0x3df4d6['push'](db[_0x94c9('0x19')][_0x94c9('0x13')](queryCampaigns));_0x3df4d6[_0x94c9('0x2e')](db[_0x94c9('0x3')][_0x94c9('0x13')](queryAgents));break;case _0x94c9('0x34'):_0x39890b[_0x553196]('voice:inbound');_0x39890b[_0x553196](_0x94c9('0x35'));_0x3df4d6[_0x94c9('0x2e')](getAssociatedResources(_0x94c9('0xd'),_0x3ab136[_0x94c9('0x1f')],'VoiceQueue'));_0x3df4d6[_0x94c9('0x2e')](getAssociatedResources(_0x94c9('0xe'),_0x3ab136[_0x94c9('0x1f')],_0x94c9('0x30')));_0x3df4d6['push'](getAssociatedResources(_0x94c9('0xf'),_0x3ab136[_0x94c9('0x1f')],_0x94c9('0x36')));_0x3df4d6['push'](getAssociatedResources(_0x94c9('0x37'),_0x3ab136[_0x94c9('0x1f')],_0x94c9('0x31')));_0x3df4d6[_0x94c9('0x2e')](getAssociatedResources(_0x94c9('0x10'),_0x3ab136[_0x94c9('0x1f')],_0x94c9('0x32')));_0x3df4d6[_0x94c9('0x2e')](getAssociatedResources(_0x94c9('0x11'),_0x3ab136[_0x94c9('0x1f')],_0x94c9('0x33')));_0x3df4d6[_0x94c9('0x2e')](getAssociatedResources(_0x94c9('0x12'),_0x3ab136[_0x94c9('0x1f')],_0x94c9('0x38')));_0x3df4d6[_0x94c9('0x2e')](getAssociatedResources(_0x94c9('0x14'),_0x3ab136[_0x94c9('0x1f')],_0x94c9('0x3')));_0x3df4d6[_0x94c9('0x2e')](getAssociatedResources(_0x94c9('0x15'),_0x3ab136['userProfileId'],_0x94c9('0x39')));_0x3df4d6[_0x94c9('0x2e')](getAssociatedResources(_0x94c9('0x3a'),_0x3ab136['userProfileId'],_0x94c9('0x19')));_0x3df4d6['push'](db[_0x94c9('0x3')][_0x94c9('0x13')](queryAgents));break;case _0x94c9('0x5'):_0x39890b[_0x553196]('voice:inbound');_0x39890b[_0x553196](_0x94c9('0x35'));_0x3df4d6['push'](_0x3ab136[_0x94c9('0x3b')]({'attributes':['id',_0x94c9('0x7')]}));_0x3df4d6[_0x94c9('0x2e')](_0x3ab136[_0x94c9('0x3c')]({'attributes':['id',_0x94c9('0x7')]}));_0x3df4d6[_0x94c9('0x2e')](_0x3ab136['getFaxQueues']({'attributes':['id','name']}));_0x3df4d6['push'](_0x3ab136[_0x94c9('0x3d')]({'attributes':['id',_0x94c9('0x7')]}));_0x3df4d6[_0x94c9('0x2e')](_0x3ab136['getMailQueues']({'attributes':['id',_0x94c9('0x7')]}));_0x3df4d6['push'](_0x3ab136[_0x94c9('0x3e')]({'attributes':['id',_0x94c9('0x7')]}));_0x3df4d6[_0x94c9('0x2e')](_0x3ab136[_0x94c9('0x3f')]({'attributes':['id',_0x94c9('0x7')]}));break;}return BPromise[_0x94c9('0x40')](_0x3df4d6);}})[_0x94c9('0xc')](function(_0x52ca34){if(_0x52ca34&&_0x52ca34[_0x94c9('0x1b')]){for(var _0x4b68c5=0x0;_0x4b68c5<_0x52ca34[_0x94c9('0x1b')];_0x4b68c5+=0x1){for(var _0x3abb40=0x0;_0x3abb40<_0x52ca34[_0x4b68c5][_0x94c9('0x1b')];_0x3abb40+=0x1){switch(_0x4b68c5){case 0x0:joinOrLeaveQueues(_0x39890b,_0x553196,_0x94c9('0x41'),_0x52ca34[_0x4b68c5][_0x3abb40]);break;case 0x1:joinOrLeaveQueues(_0x39890b,_0x553196,_0x94c9('0x42'),_0x52ca34[_0x4b68c5][_0x3abb40]);break;case 0x2:joinOrLeaveQueues(_0x39890b,_0x553196,_0x94c9('0x43'),_0x52ca34[_0x4b68c5][_0x3abb40]);break;case 0x3:joinOrLeaveQueues(_0x39890b,_0x553196,_0x94c9('0x44'),_0x52ca34[_0x4b68c5][_0x3abb40]);break;case 0x4:joinOrLeaveQueues(_0x39890b,_0x553196,_0x94c9('0x45'),_0x52ca34[_0x4b68c5][_0x3abb40]);break;case 0x5:joinOrLeaveQueues(_0x39890b,_0x553196,'openchannel',_0x52ca34[_0x4b68c5][_0x3abb40]);break;case 0x6:joinOrLeaveQueues(_0x39890b,_0x553196,_0x94c9('0x46'),_0x52ca34[_0x4b68c5][_0x3abb40]);break;case 0x7:if(_0x50ee41[_0x94c9('0x4')]!==_0x94c9('0x5'))_0x39890b[_0x553196](util[_0x94c9('0x1a')](_0x94c9('0x47'),_0x52ca34[_0x4b68c5][_0x3abb40]['name']));break;case 0x8:if(_0x50ee41[_0x94c9('0x4')]!==_0x94c9('0x5'))_0x39890b[_0x553196](util['format'](_0x94c9('0x48'),_0x52ca34[_0x4b68c5][_0x3abb40]['name']));break;case 0x9:if(_0x50ee41[_0x94c9('0x4')]!=='agent')_0x39890b[_0x553196](util['format'](_0x94c9('0x49'),_0x52ca34[_0x4b68c5][_0x3abb40]['type'],_0x52ca34[_0x4b68c5][_0x3abb40][_0x94c9('0x7')]));break;case 0xa:_0x39890b[_0x553196](util['format'](_0x94c9('0x1c'),_0x52ca34[_0x4b68c5][_0x3abb40][_0x94c9('0x7')]));break;}}}}})[_0x94c9('0xc')](function(){if(_0x553196==='leave'){var _0x1651c6=_[_0x94c9('0x17')](_0x50ee41[_0x94c9('0x21')],'id');return _0x50ee41[_0x94c9('0x4a')](_0x1651c6)[_0x94c9('0xc')](function(){for(var _0x4de9b6=0x0;_0x4de9b6<_0x1651c6['length'];_0x4de9b6+=0x1){_0x2f20bd[_0x94c9('0x4b')](_0x94c9('0x4c'),{'ChatInteractionId':Number(_0x1651c6[_0x4de9b6]),'UserId':Number(_0x50ee41['id'])});}});}})[_0x94c9('0xc')](function(){if(_0x553196==='leave'){var _0x433b6e=_[_0x94c9('0x17')](_0x50ee41[_0x94c9('0x4d')],'id');return _0x50ee41['removeMailInteractions'](_0x433b6e)[_0x94c9('0xc')](function(){for(var _0x866e9b=0x0;_0x866e9b<_0x433b6e[_0x94c9('0x1b')];_0x866e9b+=0x1){_0x2f20bd[_0x94c9('0x4b')](_0x94c9('0x4e'),{'MailInteractionId':Number(_0x433b6e[_0x866e9b]),'UserId':Number(_0x50ee41['id'])});}});}})[_0x94c9('0xc')](function(){if(_0x553196===_0x94c9('0x4f')){var _0x658223=_['map'](_0x50ee41[_0x94c9('0x50')],'id');return _0x50ee41[_0x94c9('0x51')](_0x658223)[_0x94c9('0xc')](function(){for(var _0x58fee3=0x0;_0x58fee3<_0x658223['length'];_0x58fee3+=0x1){_0x2f20bd['emit']('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x658223[_0x58fee3]),'UserId':Number(_0x50ee41['id'])});}});}})['then'](function(){if(_0x553196===_0x94c9('0x4f')){var _0x262bc1=_[_0x94c9('0x17')](_0x50ee41[_0x94c9('0x25')],'id');return _0x50ee41[_0x94c9('0x52')](_0x262bc1)['then'](function(){for(var _0xe9cc6a=0x0;_0xe9cc6a<_0x262bc1[_0x94c9('0x1b')];_0xe9cc6a+=0x1){_0x2f20bd[_0x94c9('0x4b')](_0x94c9('0x53'),{'SmsInteractionId':Number(_0x262bc1[_0xe9cc6a]),'UserId':Number(_0x50ee41['id'])});}});}})[_0x94c9('0xc')](function(){if(_0x553196==='leave'){var _0x4a31b9=_['map'](_0x50ee41[_0x94c9('0x27')],'id');return _0x50ee41['removeOpenchannelInteractions'](_0x4a31b9)[_0x94c9('0xc')](function(){for(var _0x10c453=0x0;_0x10c453<_0x4a31b9[_0x94c9('0x1b')];_0x10c453+=0x1){_0x2f20bd[_0x94c9('0x4b')]('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0x4a31b9[_0x10c453]),'UserId':Number(_0x50ee41['id'])});}});}})[_0x94c9('0xc')](function(){if(_0x553196===_0x94c9('0x4f')){var _0xeb01fb=_[_0x94c9('0x17')](_0x50ee41[_0x94c9('0x29')],'id');return _0x50ee41[_0x94c9('0x54')](_0xeb01fb)[_0x94c9('0xc')](function(){for(var _0x20b881=0x0;_0x20b881<_0xeb01fb[_0x94c9('0x1b')];_0x20b881+=0x1){_0x2f20bd[_0x94c9('0x4b')](_0x94c9('0x55'),{'WhatsappInteractionId':Number(_0xeb01fb[_0x20b881]),'UserId':Number(_0x50ee41['id'])});}});}})[_0x94c9('0x56')](function(_0x226d18){_0x39890b[_0x94c9('0x57')](_0x226d18);});}}function onDisconnect(_0x189c3d,_0x535b43){joinOrLeave(_0x189c3d,_0x94c9('0x4f'),_0x535b43);}function onConnect(_0x7f4eb8){joinOrLeave(_0x7f4eb8,_0x94c9('0x58'));}exports[_0x94c9('0x59')]=function(_0x4728c0){_0x4728c0['on'](_0x94c9('0x5a'),function(_0x37b808){_0x37b808[_0x94c9('0x5b')](0x0);_0x37b808[_0x94c9('0x5c')]=_0x37b808[_0x94c9('0x5d')][_0x94c9('0x5a')][_0x94c9('0x5e')]+':'+_0x37b808[_0x94c9('0x5d')][_0x94c9('0x5a')][_0x94c9('0x5f')];_0x37b808[_0x94c9('0x60')]=new Date();_0x37b808['log']=function(_0x449592){console[_0x94c9('0x57')](_0x94c9('0x61')+_0x37b808[_0x94c9('0x62')]['name']+'['+_0x37b808['address']+']',_0x449592);};_0x37b808['on'](_0x94c9('0x63'),function(){onDisconnect(_0x37b808,_0x4728c0);_0x37b808[_0x94c9('0x57')](_0x94c9('0x64'));});onConnect(_0x37b808);_0x37b808[_0x94c9('0x57')]('CONNECTED');});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index a3041fe..28b2b76 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 _0x3f1b=['Sequelize','SELECT','contact','UserId','undefined','interface','name','agent','incomingmessage','outgoingmessage','AfterCreateMessage','event','opened','sequelize','QueryTypes','AfterCreate','changed','closed','substatus','format','SIP/%s','User','find','email','internal','default','length','model','hook','callback','toLowerCase','condition','util','../../mysqldb','jayson/promise','http','Chat','ChatInteraction','afterCreate','newinteraction','afterUpdate','closedinteraction','ChatMessage','newmessage','Sms','SmsInteraction','SmsMessage','Whatsapp','WhatsappInteraction','WhatsappMessage','Fax','FaxInteraction','FaxMessage','MailInteraction','Mail','MailMessage','Openchannel','OpenchannelInteraction','OpenchannelMessage','request','EventManager','then','info','Trigger,\x20%s','error','code','catch','get','channel','motionChannel','direction','resolve','ContactId','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','query'];(function(_0x597065,_0x453bfd){var _0xb8e1fb=function(_0x315563){while(--_0x315563){_0x597065['push'](_0x597065['shift']());}};_0xb8e1fb(++_0x453bfd);}(_0x3f1b,0x197));var _0xb3f1=function(_0x57109a,_0x1e04c5){_0x57109a=_0x57109a-0x0;var _0x10b296=_0x3f1b[_0x57109a];return _0x10b296;};'use strict';var util=require(_0xb3f1('0x0'));var db=require(_0xb3f1('0x1'))['db'];var jayson=require(_0xb3f1('0x2'));var logger=require('../logger')('triggers');var client=jayson['client'][_0xb3f1('0x3')]({'port':0x232a});var triggers=[{'channel':_0xb3f1('0x4'),'model':_0xb3f1('0x5'),'event':_0xb3f1('0x6'),'condition':_0xb3f1('0x7'),'callback':afterCreate},{'channel':_0xb3f1('0x4'),'model':_0xb3f1('0x5'),'event':_0xb3f1('0x8'),'condition':_0xb3f1('0x9'),'callback':afterUpdate},{'channel':_0xb3f1('0x4'),'model':_0xb3f1('0xa'),'event':_0xb3f1('0x6'),'condition':_0xb3f1('0xb'),'callback':afterCreateMessage},{'channel':_0xb3f1('0x4'),'model':'ChatOfflineMessage','event':_0xb3f1('0x6'),'condition':'newmessage','callback':afterCreateOfflineMessage},{'channel':_0xb3f1('0xc'),'model':_0xb3f1('0xd'),'event':_0xb3f1('0x6'),'condition':_0xb3f1('0x7'),'callback':afterCreate},{'channel':_0xb3f1('0xc'),'model':_0xb3f1('0xd'),'event':_0xb3f1('0x8'),'condition':_0xb3f1('0x9'),'callback':afterUpdate},{'channel':_0xb3f1('0xc'),'model':_0xb3f1('0xe'),'event':_0xb3f1('0x6'),'condition':_0xb3f1('0xb'),'callback':afterCreateMessage},{'channel':_0xb3f1('0xf'),'model':'WhatsappInteraction','event':_0xb3f1('0x6'),'condition':'newinteraction','callback':afterCreate},{'channel':_0xb3f1('0xf'),'model':_0xb3f1('0x10'),'event':_0xb3f1('0x8'),'condition':_0xb3f1('0x9'),'callback':afterUpdate},{'channel':_0xb3f1('0xf'),'model':_0xb3f1('0x11'),'event':'afterCreate','condition':_0xb3f1('0xb'),'callback':afterCreateMessage},{'channel':_0xb3f1('0x12'),'model':'FaxInteraction','event':'afterCreate','condition':_0xb3f1('0x7'),'callback':afterCreate},{'channel':'Fax','model':_0xb3f1('0x13'),'event':_0xb3f1('0x8'),'condition':_0xb3f1('0x9'),'callback':afterUpdate},{'channel':_0xb3f1('0x12'),'model':_0xb3f1('0x14'),'event':_0xb3f1('0x6'),'condition':_0xb3f1('0xb'),'callback':afterCreateMessage},{'channel':'Mail','model':_0xb3f1('0x15'),'event':_0xb3f1('0x6'),'condition':_0xb3f1('0x7'),'callback':afterCreate},{'channel':_0xb3f1('0x16'),'model':_0xb3f1('0x15'),'event':_0xb3f1('0x8'),'condition':_0xb3f1('0x9'),'callback':afterUpdate},{'channel':_0xb3f1('0x16'),'model':_0xb3f1('0x17'),'event':_0xb3f1('0x6'),'condition':_0xb3f1('0xb'),'callback':afterCreateMessage},{'channel':_0xb3f1('0x18'),'model':'OpenchannelInteraction','event':_0xb3f1('0x6'),'condition':_0xb3f1('0x7'),'callback':afterCreate},{'channel':_0xb3f1('0x18'),'model':_0xb3f1('0x19'),'event':_0xb3f1('0x8'),'condition':'closedinteraction','callback':afterUpdate},{'channel':'Openchannel','model':_0xb3f1('0x1a'),'event':'afterCreate','condition':'newmessage','callback':afterCreateMessage}];function request(_0x5ba788){return client[_0xb3f1('0x1b')](_0xb3f1('0x1c'),_0x5ba788)[_0xb3f1('0x1d')](function(_0xcdd8ad){logger[_0xb3f1('0x1e')](_0xb3f1('0x1f'),_0xb3f1('0x1c'),_0xcdd8ad);if(_0xcdd8ad[_0xb3f1('0x20')]){if(_0xcdd8ad[_0xb3f1('0x20')][_0xb3f1('0x21')]===0x1f4){logger['error']('Trigger,\x20%s',_0xb3f1('0x1c'),_0xcdd8ad['error']);}}})[_0xb3f1('0x22')](function(_0x38adb7){logger['error'](_0xb3f1('0x1f'),_0xb3f1('0x1c'),_0x38adb7);});}function afterCreateMessage(_0x10bccc){return function(_0x5196a7){_0x5196a7=_0x5196a7[_0xb3f1('0x23')]({'plain':!![]});_0x5196a7[_0xb3f1('0x24')]=_0x10bccc;_0x5196a7[_0xb3f1('0x25')]=_0x10bccc;_0x5196a7['event']=_0x5196a7[_0xb3f1('0x26')];Promise[_0xb3f1('0x27')]()['then'](function(){if(typeof _0x5196a7[_0xb3f1('0x28')]==='undefined')return null;var _0x4fd77b=_0xb3f1('0x29')+_0x5196a7[_0xb3f1('0x28')];return db['sequelize'][_0xb3f1('0x2a')](_0x4fd77b,{'type':db[_0xb3f1('0x2b')]['QueryTypes'][_0xb3f1('0x2c')],'raw':!![]});})[_0xb3f1('0x1d')](function(_0x30b33a){if(_0x30b33a){_0x5196a7[_0xb3f1('0x2d')]=_0x30b33a[0x0];}if(typeof _0x5196a7[_0xb3f1('0x2e')]===_0xb3f1('0x2f'))return;return getAgent(_0x5196a7[_0xb3f1('0x2e')]);})[_0xb3f1('0x1d')](function(_0x415509){if(_0x415509){_0x5196a7[_0xb3f1('0x30')]=util['format']('SIP/%s',_0x415509[_0xb3f1('0x31')]);_0x5196a7[_0xb3f1('0x32')]=_0x415509;_0x5196a7[_0xb3f1('0x24')]=_0x10bccc;return request({'event':_0xb3f1('0x33'),'message':_0x5196a7});}else{return request({'event':_0xb3f1('0x34'),'message':_0x5196a7});}})[_0xb3f1('0x22')](function(_0x20ce41){logger[_0xb3f1('0x20')]('Trigger,\x20%s',_0xb3f1('0x35'),_0x20ce41);});};}function afterCreateOfflineMessage(_0x4bf427){return function(_0x34ce2b){_0x34ce2b=_0x34ce2b[_0xb3f1('0x23')]({'plain':!![]});_0x34ce2b['channel']=_0x4bf427;_0x34ce2b[_0xb3f1('0x25')]=_0x4bf427;_0x34ce2b[_0xb3f1('0x36')]='offlineMessage';return request({'event':_0x34ce2b[_0xb3f1('0x36')],'message':_0x34ce2b});};}function afterCreate(_0x32fa85,_0x2a4429){return function(_0x5bb420){_0x5bb420=_0x5bb420[_0xb3f1('0x23')]({'plain':!![]});_0x5bb420[_0xb3f1('0x24')]=_0x32fa85;_0x5bb420[_0xb3f1('0x25')]=_0x32fa85;_0x5bb420[_0xb3f1('0x36')]=_0xb3f1('0x37');Promise[_0xb3f1('0x27')]()[_0xb3f1('0x1d')](function(){var _0x5cd540='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x5bb420[_0xb3f1('0x28')];return db[_0xb3f1('0x38')]['query'](_0x5cd540,{'type':db[_0xb3f1('0x2b')][_0xb3f1('0x39')][_0xb3f1('0x2c')],'raw':!![]});})[_0xb3f1('0x1d')](function(_0x300c95){if(_0x300c95){_0x5bb420[_0xb3f1('0x2d')]=_0x300c95[0x0];}if(typeof _0x5bb420[_0xb3f1('0x2e')]==='undefined')return;return getAgent(_0x5bb420[_0xb3f1('0x2e')]);})['then'](function(_0x31d820){if(_0x31d820){_0x5bb420[_0xb3f1('0x30')]=util['format']('SIP/%s',_0x31d820['name']);_0x5bb420['agent']=_0x31d820;}return request({'event':_0x2a4429,'message':_0x5bb420});})[_0xb3f1('0x22')](function(_0x3e017e){logger[_0xb3f1('0x20')](_0xb3f1('0x1f'),_0xb3f1('0x3a'),_0x3e017e);});};}function afterUpdate(_0x1c9b98){return function(_0x332a43){var _0x166e40=_0x332a43[_0xb3f1('0x3b')](_0xb3f1('0x3c'))&&_0x332a43[_0xb3f1('0x3c')];var _0x3d9b90=_0x332a43[_0xb3f1('0x3b')](_0xb3f1('0x3d'));if(_0x166e40||_0x3d9b90){var _0x49237a=_0x166e40?_0xb3f1('0x9'):_0xb3f1('0x3d');var _0x5b3e83=_0x332a43[_0xb3f1('0x23')]({'plain':!![]});_0x5b3e83[_0xb3f1('0x24')]=_0x1c9b98;_0x5b3e83[_0xb3f1('0x25')]=_0x1c9b98;_0x5b3e83['event']=_0x166e40?_0xb3f1('0x3c'):_0xb3f1('0x3d');var _0x1fff59='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x5b3e83['ContactId'];return db[_0xb3f1('0x38')][_0xb3f1('0x2a')](_0x1fff59,{'type':db['Sequelize'][_0xb3f1('0x39')]['SELECT'],'raw':!![]})[_0xb3f1('0x1d')](function(_0x5f292b){if(_0x5f292b){_0x5b3e83[_0xb3f1('0x2d')]=_0x5f292b[0x0];}if(typeof _0x5b3e83[_0xb3f1('0x2e')]===_0xb3f1('0x2f'))return;return getAgent(_0x5b3e83[_0xb3f1('0x2e')]);})[_0xb3f1('0x1d')](function(_0x1f981d){if(_0x1f981d){_0x5b3e83['interface']=util[_0xb3f1('0x3e')](_0xb3f1('0x3f'),_0x1f981d[_0xb3f1('0x31')]);_0x5b3e83[_0xb3f1('0x32')]=_0x1f981d;}return request({'event':_0x49237a,'message':_0x5b3e83});})[_0xb3f1('0x22')](function(_0x2662cf){logger[_0xb3f1('0x20')](_0xb3f1('0x1f'),'AfterUpdate',_0x2662cf);});}};}function getAgent(_0x3ca708){return db[_0xb3f1('0x40')][_0xb3f1('0x41')]({'where':{'id':_0x3ca708},'attributes':['id',_0xb3f1('0x31'),'fullname',_0xb3f1('0x42'),_0xb3f1('0x43')],'raw':!![]})[_0xb3f1('0x1d')](function(_0x24cdad){return _0x24cdad;});}exports[_0xb3f1('0x44')]=function(){for(var _0x36194f=0x0;_0x36194f=_0xb23abe[_0xa13a('0x13')]){throw Error(_0xa13a('0x14'));}_0x496ac1(_0x3a3233);})[_0xa13a('0x15')](function(_0x2ed011){_0x432f55(_0x2ed011);});});}; \ No newline at end of file +var _0xac2e=['mail','chat','fax','sms','whatsapp','getChannels','toLowerCase','clearBlockUser','blockedAt','updateAttributes','getLicense','role','User','count','agent','agents','bluebird'];(function(_0xbf50b6,_0x3e4c47){var _0xda241c=function(_0x288c33){while(--_0x288c33){_0xbf50b6['push'](_0xbf50b6['shift']());}};_0xda241c(++_0x3e4c47);}(_0xac2e,0x1db));var _0xeac2=function(_0x983aa6,_0x51be85){_0x983aa6=_0x983aa6-0x0;var _0x3e2673=_0xac2e[_0x983aa6];return _0x3e2673;};'use strict';var _=require('lodash');var BPromise=require(_0xeac2('0x0'));var db=require('../mysqldb')['db'];var util=require('./license/util');var channels=['voice',_0xeac2('0x1'),_0xeac2('0x2'),_0xeac2('0x3'),_0xeac2('0x4'),_0xeac2('0x5'),'openchannel'];exports[_0xeac2('0x6')]=function(){return channels;};exports['isValidChannel']=function(_0x48502f){_0x48502f=_0x48502f[_0xeac2('0x7')]();return _['includes'](channels,_0x48502f);};exports[_0xeac2('0x8')]=function(_0x34f4b5,_0x17df0c,_0x22f7ad,_0x258b10){var _0x8b9399={'loginAttempts':_0x17df0c,'blocked':_0x22f7ad};if(!_['isUndefined'](_0x258b10)){_0x8b9399[_0xeac2('0x9')]=_0x258b10;}return _0x34f4b5[_0xeac2('0xa')](_0x8b9399);};exports[_0xeac2('0xb')]=function(_0x4c0ae0){return new BPromise(function(_0x49410e,_0x3d5509){var _0x2c7254=0x0;if(_0x4c0ae0[_0xeac2('0xc')]!=='agent'){_0x49410e(_0x4c0ae0);}db[_0xeac2('0xd')][_0xeac2('0xe')]({'where':{'role':_0xeac2('0xf'),'online':!![],'id':{'$ne':_0x4c0ae0['id']}}})['then'](function(_0xde28a1){_0x2c7254=_0xde28a1;return util[_0xeac2('0xb')]();})['then'](function(_0x5e0804){if(_0x5e0804&&_0x5e0804[_0xeac2('0x10')]&&_0x2c7254>=_0x5e0804['agents']){throw Error('Maximum\x20login\x20has\x20been\x20reached');}_0x49410e(_0x4c0ae0);})['catch'](function(_0x46e968){_0x3d5509(_0x46e968);});});}; \ No newline at end of file diff --git a/server/errors/api.js b/server/errors/api.js index fcc9288..ff352cc 100644 --- a/server/errors/api.js +++ b/server/errors/api.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9bde=['exports','../config/logger','message','Internal\x20Server\x20Error','name','Error','inherits','Bad\x20Request','Entity\x20not\x20found','Not\x20Found','OutOfInterval','error','stack','send'];(function(_0x28947d,_0x4cc9c6){var _0x12d2ee=function(_0x3f38fc){while(--_0x3f38fc){_0x28947d['push'](_0x28947d['shift']());}};_0x12d2ee(++_0x4cc9c6);}(_0x9bde,0xe1));var _0xe9bd=function(_0x5c372b,_0x16da3c){_0x5c372b=_0x5c372b-0x0;var _0x453278=_0x9bde[_0x5c372b];return _0x453278;};'use strict';var util=require('util');var logger=require(_0xe9bd('0x0'))('api');var APIError=function(_0xc79e0b,_0x4c63ca){this[_0xe9bd('0x1')]=_0xc79e0b||_0xe9bd('0x2');this[_0xe9bd('0x3')]=_0x4c63ca||_0xe9bd('0x4');util[_0xe9bd('0x5')](APIError,Error);};var APIBadRequestError=function(_0x1a4d14){this[_0xe9bd('0x1')]=_0x1a4d14||'Bad\x20Request';this[_0xe9bd('0x3')]=_0xe9bd('0x6');util[_0xe9bd('0x5')](APIBadRequestError,APIError);};var APINotFoundError=function(_0xa66ae2){this[_0xe9bd('0x1')]=_0xa66ae2||_0xe9bd('0x7');this[_0xe9bd('0x3')]=_0xe9bd('0x8');util[_0xe9bd('0x5')](APINotFoundError,APIError);};function getStatusCode(_0x45c7ba){switch(_0x45c7ba){case'Bad\x20Request':return 0x190;case'Forbidden',_0xe9bd('0x9'):return 0x193;case _0xe9bd('0x8'):return 0x194;default:return 0x1f4;}}function handleError(_0x2601ac){return function(_0x581ab9){logger[_0xe9bd('0xa')](_0x581ab9[_0xe9bd('0xb')]);var _0x3339f9=getStatusCode(_0x581ab9[_0xe9bd('0x3')]);if(_0x581ab9['name'])delete _0x581ab9[_0xe9bd('0x3')];return _0x2601ac['status'](_0x3339f9)[_0xe9bd('0xc')](_0x581ab9);};}module[_0xe9bd('0xd')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APINotFoundError':APINotFoundError,'handleError':handleError}; \ No newline at end of file +var _0xc4aa=['stack','statusMessage','status','exports','util','../config/logger','api','message','inherits','Bad\x20Request','name','Not\x20Found','Message\x20sent\x20outside\x20a\x20valid\x20interval','Out\x20Of\x20Interval','error'];(function(_0xdbe16,_0x36dab3){var _0x57a920=function(_0x5c91c4){while(--_0x5c91c4){_0xdbe16['push'](_0xdbe16['shift']());}};_0x57a920(++_0x36dab3);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0xc4aa[_0x46698a];return _0x356db0;};'use strict';var util=require(_0xac4a('0x0'));var logger=require(_0xac4a('0x1'))(_0xac4a('0x2'));var APIError=function(_0x351dd5,_0x275161){this[_0xac4a('0x3')]=_0x351dd5||'Internal\x20Server\x20Error';this['name']=_0x275161||'Error';util[_0xac4a('0x4')](APIError,Error);};var APIBadRequestError=function(_0x15b967){this[_0xac4a('0x3')]=_0x15b967||_0xac4a('0x5');this[_0xac4a('0x6')]=_0xac4a('0x5');util[_0xac4a('0x4')](APIBadRequestError,APIError);};var APINotFoundError=function(_0x10525b){this['message']=_0x10525b||'Entity\x20not\x20found';this[_0xac4a('0x6')]=_0xac4a('0x7');util[_0xac4a('0x4')](APINotFoundError,APIError);};var APIOutOfIntervalError=function(_0x4f4146){this[_0xac4a('0x3')]=_0x4f4146||_0xac4a('0x8');this[_0xac4a('0x6')]='Out\x20Of\x20Interval';util[_0xac4a('0x4')](APIOutOfIntervalError,APIError);};function getStatusCode(_0x488e3c){switch(_0x488e3c){case _0xac4a('0x5'):return 0x190;case'Forbidden',_0xac4a('0x9'):return 0x193;case _0xac4a('0x7'):return 0x194;default:return 0x1f4;}}function getCustomStatusMessage(_0x24291d){if(_0x24291d==='Out\x20Of\x20Interval')return _0x24291d;return null;}function handleError(_0x21a79){return function(_0x68424a){logger[_0xac4a('0xa')](_0x68424a[_0xac4a('0xb')]);var _0x1b4313=getStatusCode(_0x68424a[_0xac4a('0x6')]);var _0x34bc01=getCustomStatusMessage(_0x68424a[_0xac4a('0x6')]);if(_0x68424a[_0xac4a('0x6')])delete _0x68424a[_0xac4a('0x6')];if(_0x34bc01)_0x21a79[_0xac4a('0xc')]=_0x34bc01;return _0x21a79[_0xac4a('0xd')](_0x1b4313)['send'](_0x68424a);};}module[_0xac4a('0xe')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APIOutOfIntervalError':APIOutOfIntervalError,'APINotFoundError':APINotFoundError,'handleError':handleError}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index fab09ed..45ddc18 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd7ff=['404','status','render','json','send','exports'];(function(_0x306100,_0x4e8ee9){var _0x57ff89=function(_0x17f303){while(--_0x17f303){_0x306100['push'](_0x306100['shift']());}};_0x57ff89(++_0x4e8ee9);}(_0xd7ff,0x6b));var _0xfd7f=function(_0x106629,_0x499504){_0x106629=_0x106629-0x0;var _0x770cfb=_0xd7ff[_0x106629];return _0x770cfb;};'use strict';module[_0xfd7f('0x0')][0x194]=function pageNotFound(_0x98068c,_0x322089){var _0x3446a0=_0xfd7f('0x1');var _0x58e02d=0x194;var _0x58184b={'status':_0x58e02d};_0x322089[_0xfd7f('0x2')](_0x58184b['status']);_0x322089[_0xfd7f('0x3')](_0x3446a0,{},function(_0x589f6d,_0x47eee3){if(_0x589f6d){return _0x322089[_0xfd7f('0x2')](_0x58184b[_0xfd7f('0x2')])[_0xfd7f('0x4')](_0x58184b);}_0x322089[_0xfd7f('0x5')](_0x47eee3);});}; \ No newline at end of file +var _0xf725=['404','status','send','exports'];(function(_0x137c1f,_0x118e7f){var _0x1d0f69=function(_0x363401){while(--_0x363401){_0x137c1f['push'](_0x137c1f['shift']());}};_0x1d0f69(++_0x118e7f);}(_0xf725,0x14f));var _0x5f72=function(_0x342c8,_0xbabf26){_0x342c8=_0x342c8-0x0;var _0x3e909d=_0xf725[_0x342c8];return _0x3e909d;};'use strict';module[_0x5f72('0x0')][0x194]=function pageNotFound(_0x427de8,_0x1a4f3c){var _0x14719d=_0x5f72('0x1');var _0x116110=0x194;var _0x424ac6={'status':_0x116110};_0x1a4f3c['status'](_0x424ac6[_0x5f72('0x2')]);_0x1a4f3c['render'](_0x14719d,{},function(_0x1edc48,_0x3b09f7){if(_0x1edc48){return _0x1a4f3c[_0x5f72('0x2')](_0x424ac6[_0x5f72('0x2')])['json'](_0x424ac6);}_0x1a4f3c[_0x5f72('0x3')](_0x3b09f7);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index bd873a4..eb88bc1 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','License','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','../api/cmList/cmList.model','VoicePrefix','UserProfile','UserProfileSection','UserProfileResource','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','hasOne','VoiceMail','userSetting','cascade','UserId','hasMany','VoiceRecording','Recordings','VoiceQueuesRt','Extensions','HopperFinals','CmHopperHistory','HopperHistory','OpenchannelInteractions','ChatInteractions','SmsInteractions','FaxInteraction','MailInteraction','MailInteractions','WhatsappInteractions','UserNotifications','SenderId','belongsToMany','Groups','chat_group_has_users','CmContact','Contacts','cm_user_has_contacts','Lists','cm_user_has_lists','Team','user_has_teams','user_has_mail_interactions','FaxInteractions','user_has_fax_interactions','user_has_sms_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueues','VoicePrefixes','ChatQueues','UserChatQueue','FaxQueues','SmsQueues','OpenchannelQueue','WhatsappQueues','CmList','ChatWebsites','user_has_chat_websites','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','ChanSpyId','VoiceContext','Applications','Sounds','moh_has_sounds','Members','VoiceQueueId','Hoppers','HopperBlacks','JscriptySessions','TrunkId','belongsTo','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPauseId','Teams','BlackLists','voice_queues_has_cm_blacklists','Messages','mailbox','mailboxuser','VoiceCallReport','QueueCalls','uniqueid','VoiceAgentReport','AgentReports','Contact','MailAccountId','CloudProviderId','MailServerOut','restrict','Imap','Smtp','Disposition','Dispositions','Answers','Interactions','MailApplication','List','ListId','TemplateId','mandatoryDispositionPause','Agents','team_has_mail_queues','ContactId','mail_interaction_has_tags','Tags','ThroughTags','Users','MailInteractionId','Attachments','Interaction','ChatWebsiteId','Interval','MailQueueReport','Dashboard','CannedAnswer','FaxAccountId','Exntensions','TagId','FaxInteractionId','Account','Owner','fax_interaction_has_tags','AttachmentId','team_has_fax_queues','SmsAccountId','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelQueueId','OpenchannelInteractionId','team_has_openchannel_queues','ChatProactiveAction','ProactiveActions','Agent','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','user_has_chat_interactions','ChatOfflineMessageId','team_has_chat_queues','ChatGroupId','CmContactId','HopperHistories','CmCompany','Company','cm_contact_has_tags','CmHopperAdditionalPhone','AdditionalPhones','CmHopperId','Campaign','OwnerId','CampaignId','All','OneAll','OneAny','Actions','ParentId','Intervals','MailApplications','ChatApplications','FaxApplications','SmsApplications','DefaultReportId','CustomReportId','openchannel_interaction_has_tags','whatsapp_interaction_has_tags','CmContactHasItem','ItemType','ItemTypeId','Hopper','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','AnalyticCustomReport','Fields','MetricId','Configurations','Subjects','DescriptionId','FieldId','AccountId','Subject','SubjectId','Description','Field','SugarcrmField','Descriptions','VariableId','DeskAccount','ZendeskConfiguration','int_zendesk_configuration_has_tags','FreshdeskAccount','FreshdeskConfiguration','int_freshdesk_configuration_has_tags','VtigerAccount','ServicenowField','ToId','JscriptyQuestionReport','JscriptyProject','ProjectId','MailQueues','OpenchannelQueues','team_has_whatsapp_queues','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','MailTransferReport','FromMailAccountId','FromAccount','FromAgent','ToUserId','ToAgent','ToMailAccountId','ToAccount','FromChatWebsiteId','FromUserId','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','ToFaxQueueId','ToQueue','FromSmsAccountId','CmCustomField','CustomFields','voice_queues_has_cm_lists','userProfileId','UserProfileSections','Resources','sectionId','WhatsappAccountId','WhatsappInteractionId','WhatsappTransferReport','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','UserSetting','user','../config/environment','sequelize','lodash','motion2','xcall','xC@LL1234','127.0.0.1','utf8mb4','name','utf8','defaultsDeep','mysql','username','password','options','database','sequelizeHistory','User','import','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','ScreenRecording','../api/screenRecording/screenRecording.model','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','Trunk','../api/trunk/trunk.model','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerOut/mailServerOut.model','MailAccount','MailQueue','MailSubstatus','MailMessage','../api/mailMessage/mailMessage.model','../api/mailApplication/mailApplication.model','../api/mailQueueReport/mailQueueReport.model','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','OpenchannelMessage','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','ChatApplication','ChatInteraction','ChatMessage','ChatOfflineMessage','ChatQueue','ChatGroup','../api/chatGroup/chatGroup.model','../api/chatProactiveAction/chatProactiveAction.model','../api/cmCompany/cmCompany.model','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','ReportAgentPreview','Action','../api/action/action.model','Automation','../api/automation/automation.model','../api/cannedAnswer/cannedAnswer.model','../api/disposition/disposition.model','Condition','../api/condition/condition.model','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','ContactItemType','../api/contactItemType/contactItemType.model','../api/cmContactHasItem/cmContactHasItem.model','Template','../api/template/template.model','Trigger','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','../api/integrationReport/integrationReport.model','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','SugarcrmAccount','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','../api/intSugarcrmField/intSugarcrmField.model','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','VtigerField','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','Dynamics365Account','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','../api/squareOdbc/squareOdbc.model','SquareProject'];(function(_0x32d457,_0x1a39c9){var _0x338386=function(_0x199d7a){while(--_0x199d7a){_0x32d457['push'](_0x32d457['shift']());}};_0x338386(++_0x1a39c9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0xa9e0[_0x55f8b4];return _0x2475f9;};'use strict';var config=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var jstz=require('jstz');var timezone=jstz['determine']();config[_0x0a9e('0x1')]=_['defaultsDeep'](config[_0x0a9e('0x1')],{'database':_0x0a9e('0x3'),'username':_0x0a9e('0x4'),'password':_0x0a9e('0x5'),'options':{'host':_0x0a9e('0x6'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0x0a9e('0x7')},'logging':![],'timezone':timezone[_0x0a9e('0x8')](),'define':{'charset':_0x0a9e('0x9'),'collate':'utf8_general_ci'}}});config['sequelizeHistory']=_[_0x0a9e('0xa')](config['sequelizeHistory'],{'database':'motion2','username':_0x0a9e('0x4'),'password':_0x0a9e('0x5'),'options':{'host':_0x0a9e('0x6'),'port':0xcea,'dialect':_0x0a9e('0xb'),'dialectOptions':{'charset':_0x0a9e('0x7')},'logging':![],'timezone':timezone[_0x0a9e('0x8')](),'define':{'charset':'utf8','collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelize']['database'],config[_0x0a9e('0x1')][_0x0a9e('0xc')],config[_0x0a9e('0x1')][_0x0a9e('0xd')],config[_0x0a9e('0x1')][_0x0a9e('0xe')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelizeHistory'][_0x0a9e('0xf')],config[_0x0a9e('0x10')][_0x0a9e('0xc')],config[_0x0a9e('0x10')][_0x0a9e('0xd')],config[_0x0a9e('0x10')]['options'])};db[_0x0a9e('0x11')]=db['sequelize'][_0x0a9e('0x12')]('../api/user/user.model');db[_0x0a9e('0x13')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x14'));db['VoiceContext']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x15'));db[_0x0a9e('0x16')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x17'));db[_0x0a9e('0x18')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x19'));db[_0x0a9e('0x1a')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x1b'));db['VoiceRecording']=db[_0x0a9e('0x1')]['import']('../api/voiceRecording/voiceRecording.model');db[_0x0a9e('0x1c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x1d'));db['VoiceMail']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x1e'));db[_0x0a9e('0x1f')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x20'));db['VoiceCallReport']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x21'));db[_0x0a9e('0x22')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x23'));db['VoiceAgentReport']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x24'));db[_0x0a9e('0x25')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x26'));db[_0x0a9e('0x27')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/memberReport/memberReport.model');db[_0x0a9e('0x28')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x29'));db['VoiceTransferReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x2a'));db[_0x0a9e('0x2b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x2c'));db[_0x0a9e('0x2d')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x2e'));db['UserChatQueue']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x2f'));db[_0x0a9e('0x30')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x31'));db[_0x0a9e('0x32')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x33'));db[_0x0a9e('0x34')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/userSmsQueue/userSmsQueue.model');db[_0x0a9e('0x35')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x36'));db[_0x0a9e('0x37')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x38'));db[_0x0a9e('0x39')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailServerIn/mailServerIn.model');db['MailServerOut']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x3a'));db[_0x0a9e('0x3b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailAccount/mailAccount.model');db[_0x0a9e('0x3c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailQueue/mailQueue.model');db[_0x0a9e('0x3d')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailSubstatus/mailSubstatus.model');db['MailInteraction']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailInteraction/mailInteraction.model');db[_0x0a9e('0x3e')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x3f'));db['MailApplication']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x40'));db['MailQueueReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x41'));db['Dashboard']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x42'));db[_0x0a9e('0x43')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x44'));db[_0x0a9e('0x45')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x46'));db[_0x0a9e('0x47')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x48'));db['FaxInteraction']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x49'));db[_0x0a9e('0x4a')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x4b'));db[_0x0a9e('0x4c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x4d'));db[_0x0a9e('0x4e')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x4f'));db[_0x0a9e('0x50')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x51'));db[_0x0a9e('0x52')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/smsApplication/smsApplication.model');db[_0x0a9e('0x53')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x54'));db[_0x0a9e('0x55')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x56'));db[_0x0a9e('0x57')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x58'));db[_0x0a9e('0x59')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x5a'));db[_0x0a9e('0x5b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x5c'));db[_0x0a9e('0x5d')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/openchannelInteraction/openchannelInteraction.model');db[_0x0a9e('0x5e')]=db[_0x0a9e('0x1')]['import']('../api/openchannelMessage/openchannelMessage.model');db['OpenchannelQueue']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x5f'));db[_0x0a9e('0x60')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x61'));db[_0x0a9e('0x62')]=db['sequelize']['import']('../api/openchannelQueueReport/openchannelQueueReport.model');db[_0x0a9e('0x63')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/chatApplication/chatApplication.model');db[_0x0a9e('0x64')]=db[_0x0a9e('0x1')]['import']('../api/chatInteraction/chatInteraction.model');db[_0x0a9e('0x65')]=db['sequelize'][_0x0a9e('0x12')]('../api/chatMessage/chatMessage.model');db[_0x0a9e('0x66')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/chatOfflineMessage/chatOfflineMessage.model');db[_0x0a9e('0x67')]=db[_0x0a9e('0x1')]['import']('../api/chatQueue/chatQueue.model');db[_0x0a9e('0x68')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x69'));db['ChatProactiveAction']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x6a'));db['CmCompany']=db['sequelize']['import'](_0x0a9e('0x6b'));db['CmContact']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x6c'));db[_0x0a9e('0x6d')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x6e'));db[_0x0a9e('0x6f')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x70'));db[_0x0a9e('0x71')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x72'));db['CmHopperHistory']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/cmHopperHistory/cmHopperHistory.model');db[_0x0a9e('0x73')]=db['sequelize'][_0x0a9e('0x12')]('../api/reportAgentPreview/reportAgentPreview.model');db['CmCustomField']=db['sequelize'][_0x0a9e('0x12')]('../api/cmCustomField/cmCustomField.model');db[_0x0a9e('0x74')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x75'));db[_0x0a9e('0x76')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x77'));db['CannedAnswer']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x78'));db['Disposition']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x79'));db[_0x0a9e('0x7a')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x7b'));db['Interval']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x7c'));db[_0x0a9e('0x7d')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x7e'));db[_0x0a9e('0x7f')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x80'));db['VoiceQueuesLog']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x81'));db[_0x0a9e('0x82')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x83'));db[_0x0a9e('0x84')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x85'));db[_0x0a9e('0x86')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x87'));db[_0x0a9e('0x88')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x89'));db['CmContactHasItem']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x8a'));db['CmHopperAdditionalPhone']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model');db[_0x0a9e('0x8b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x8c'));db[_0x0a9e('0x8d')]=db['sequelize']['import']('../api/trigger/trigger.model');db[_0x0a9e('0x8e')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x8f'));db[_0x0a9e('0x90')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x91'));db['IntegrationReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x92'));db['AnalyticCustomReport']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x93'));db[_0x0a9e('0x94')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x95'));db[_0x0a9e('0x96')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x97'));db[_0x0a9e('0x98')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/analyticMetric/analyticMetric.model');db[_0x0a9e('0x99')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9a'));db['AnalyticTreeReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9b'));db[_0x0a9e('0x9c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9d'));db[_0x0a9e('0x9e')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9f'));db[_0x0a9e('0xa0')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intSalesforceField/intSalesforceField.model');db[_0x0a9e('0xa1')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intSugarcrmAccount/intSugarcrmAccount.model');db[_0x0a9e('0xa2')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xa3'));db['SugarcrmField']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xa4'));db['DeskAccount']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xa5'));db[_0x0a9e('0xa6')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xa7'));db[_0x0a9e('0xa8')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xa9'));db[_0x0a9e('0xaa')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xab'));db[_0x0a9e('0xac')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xad'));db[_0x0a9e('0xae')]=db['sequelize'][_0x0a9e('0x12')]('../api/intZohoField/intZohoField.model');db[_0x0a9e('0xaf')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xb0'));db['ZendeskConfiguration']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xb1'));db[_0x0a9e('0xb2')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xb3'));db['FreshdeskAccount']=db['sequelize'][_0x0a9e('0x12')]('../api/intFreshdeskAccount/intFreshdeskAccount.model');db['FreshdeskConfiguration']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xb4'));db[_0x0a9e('0xb5')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xb6'));db['VtigerAccount']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xb7'));db[_0x0a9e('0xb8')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intVtigerConfiguration/intVtigerConfiguration.model');db[_0x0a9e('0xb9')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intVtigerField/intVtigerField.model');db[_0x0a9e('0xba')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xbb'));db[_0x0a9e('0xbc')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xbd'));db['ServicenowField']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intServicenowField/intServicenowField.model');db[_0x0a9e('0xbe')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intDynamics365Account/intDynamics365Account.model');db[_0x0a9e('0xbf')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xc0'));db[_0x0a9e('0xc1')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc2'));db[_0x0a9e('0xc3')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xc4'));db[_0x0a9e('0xc5')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc6'));db[_0x0a9e('0xc7')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc8'));db[_0x0a9e('0x90')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x91'));db['Network']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc9'));db[_0x0a9e('0xca')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xcb'));db[_0x0a9e('0xcc')]=db['sequelize'][_0x0a9e('0x12')]('../api/chatInternalMessage/chatInternalMessage.model');db[_0x0a9e('0xcd')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xce'));db['JscriptyQuestionReport']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xcf'));db[_0x0a9e('0xd0')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xd1'));db[_0x0a9e('0xd2')]=db['sequelize']['import'](_0x0a9e('0xd3'));db[_0x0a9e('0xd4')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xd5'));db[_0x0a9e('0xd6')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xd7'));db['JscriptyProject']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xd8'));db[_0x0a9e('0xd9')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xda'));db['SquareOdbc']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xdb'));db[_0x0a9e('0xdc')]=db[_0x0a9e('0x1')]['import']('../api/squareProject/squareProject.model');db[_0x0a9e('0xdd')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xde'));db[_0x0a9e('0xdf')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe0'));db['Team']=db['sequelize'][_0x0a9e('0x12')]('../api/team/team.model');db[_0x0a9e('0xe1')]=db['sequelize'][_0x0a9e('0x12')]('../api/license/license.model');db['Campaign']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/campaign/campaign.model');db[_0x0a9e('0xe2')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe3'));db[_0x0a9e('0xe4')]=db['sequelize']['import'](_0x0a9e('0xe5'));db[_0x0a9e('0xe6')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe7'));db['MailTransferReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailTransferReport/mailTransferReport.model');db[_0x0a9e('0xe8')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe9'));db[_0x0a9e('0xea')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xeb'));db[_0x0a9e('0xec')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xed'));db[_0x0a9e('0xee')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xef'));db['CmList']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xf0'));db[_0x0a9e('0xf1')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/voicePrefix/voicePrefix.model');db[_0x0a9e('0xf2')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/userProfile/userProfile.model');db[_0x0a9e('0xf3')]=db['sequelize'][_0x0a9e('0x12')]('../api/userProfileSection/userProfileSection.model');db[_0x0a9e('0xf4')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/userProfileResource/userProfileResource.model');db[_0x0a9e('0xf5')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xf6'));db[_0x0a9e('0xf7')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xf8'));db[_0x0a9e('0xf9')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xfa'));db[_0x0a9e('0xfb')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xfc'));db[_0x0a9e('0xfd')]=db[_0x0a9e('0x1')]['import']('../api/whatsappMessage/whatsappMessage.model');db[_0x0a9e('0xfe')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xff'));db['WhatsappTransferReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x100'));db[_0x0a9e('0x101')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x102'));db[_0x0a9e('0x103')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x104'));db[_0x0a9e('0x105')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x106'));db[_0x0a9e('0x107')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x108'));db[_0x0a9e('0x109')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x10a'));db['UserSetting']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/user-setting/user-setting.model');db[_0x0a9e('0x11')][_0x0a9e('0x10b')](db[_0x0a9e('0x10c')],{'as':'VoiceMail','onDelete':'cascade','foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x10b')](db['UserSetting'],{'as':_0x0a9e('0x10d'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x10f')});db['User'][_0x0a9e('0x110')](db[_0x0a9e('0x111')],{'as':_0x0a9e('0x112'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x2b')],{'as':_0x0a9e('0x113'),'foreignKey':_0x0a9e('0x10f')});db['User'][_0x0a9e('0x110')](db['VoiceExtension'],{'as':_0x0a9e('0x114'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x116')],{'as':_0x0a9e('0x117'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x5d')],{'as':_0x0a9e('0x118'),'foreignKey':_0x0a9e('0x10f')});db['User'][_0x0a9e('0x110')](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x119'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x53')],{'as':_0x0a9e('0x11a'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x11b')],{'as':'FaxInteractions','foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x11d'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0xfb')],{'as':_0x0a9e('0x11e'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0xf5')],{'as':_0x0a9e('0x11f'),'foreignKey':_0x0a9e('0x120')});db[_0x0a9e('0x11')]['belongsTo'](db[_0x0a9e('0xf2')],{'as':'UserProfile','foreignKey':'userProfileId'});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x68')],{'as':_0x0a9e('0x122'),'through':_0x0a9e('0x123')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x125'),'through':_0x0a9e('0x126')});db[_0x0a9e('0x11')]['belongsToMany'](db['CmList'],{'as':_0x0a9e('0x127'),'through':_0x0a9e('0x128')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x12a')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x11d'),'through':_0x0a9e('0x12b')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x119'),'through':'user_has_chat_interactions'});db['User']['belongsToMany'](db[_0x0a9e('0x11b')],{'as':_0x0a9e('0x12c'),'through':_0x0a9e('0x12d')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x53')],{'as':'SmsInteractions','through':_0x0a9e('0x12e')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db['OpenchannelInteraction'],{'as':_0x0a9e('0x118'),'through':_0x0a9e('0x12f')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0xfb')],{'as':'WhatsappInteractions','through':_0x0a9e('0x130')});db['User'][_0x0a9e('0x121')](db['VoiceQueue'],{'as':_0x0a9e('0x131'),'through':_0x0a9e('0x2d'),'required':![]});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0xf1')],{'as':_0x0a9e('0x132'),'through':_0x0a9e('0x109'),'required':![]});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x3c')],{'as':'MailQueues','through':_0x0a9e('0x30'),'required':![]});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x67')],{'as':_0x0a9e('0x133'),'through':_0x0a9e('0x134'),'required':![],'hooks':!![]});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x4c')],{'as':_0x0a9e('0x135'),'through':_0x0a9e('0x32'),'required':![]});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x57')],{'as':_0x0a9e('0x136'),'through':_0x0a9e('0x34'),'required':![]});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x137')],{'as':'OpenchannelQueues','through':_0x0a9e('0x35'),'required':![]});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x101')],{'as':_0x0a9e('0x138'),'through':_0x0a9e('0x37'),'required':![]});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'through':_0x0a9e('0x128')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x13a'),'through':_0x0a9e('0x13b')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x45')],{'as':'FaxAccounts','through':_0x0a9e('0x13c')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x3b')],{'as':_0x0a9e('0x13d'),'through':_0x0a9e('0x13e')});db[_0x0a9e('0x11')]['belongsToMany'](db['OpenchannelAccount'],{'as':_0x0a9e('0x13f'),'through':_0x0a9e('0x140')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x50')],{'as':_0x0a9e('0x141'),'through':_0x0a9e('0x142')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0xf7')],{'as':_0x0a9e('0x143'),'through':_0x0a9e('0x144')});db[_0x0a9e('0x13')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':'SpiedAgents','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x145')});db[_0x0a9e('0x146')]['hasMany'](db[_0x0a9e('0x16')],{'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x16')][_0x0a9e('0x110')](db['VoiceExtension'],{'as':_0x0a9e('0x147'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x18')][_0x0a9e('0x121')](db[_0x0a9e('0x84')],{'as':_0x0a9e('0x148'),'through':_0x0a9e('0x149')});db[_0x0a9e('0x1a')]['hasMany'](db[_0x0a9e('0x2b')],{'as':_0x0a9e('0x14a'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')]['hasMany'](db['CmHopper'],{'as':_0x0a9e('0x14c'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')]['hasMany'](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':'VoiceQueueId'});db[_0x0a9e('0x1a')]['hasMany'](db[_0x0a9e('0x116')],{'as':'HopperHistories','foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')][_0x0a9e('0x110')](db['CmHopperBlack'],{'as':_0x0a9e('0x14d'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')][_0x0a9e('0x110')](db[_0x0a9e('0xd0')],{'as':_0x0a9e('0x14e'),'foreignKey':_0x0a9e('0x14b')});db['VoiceQueue']['belongsTo'](db[_0x0a9e('0x28')],{'as':'Trunk','foreignKey':_0x0a9e('0x14f')});db[_0x0a9e('0x1a')][_0x0a9e('0x150')](db[_0x0a9e('0x28')],{'as':_0x0a9e('0x151'),'foreignKey':_0x0a9e('0x152')});db['VoiceQueue'][_0x0a9e('0x150')](db['Interval'],{'as':'Interval','foreignKey':_0x0a9e('0x153')});db['VoiceQueue'][_0x0a9e('0x150')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db['VoiceQueue'][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x127'),'through':'voice_queues_has_cm_lists'});db[_0x0a9e('0x1a')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':'UserVoiceQueue'});db[_0x0a9e('0x1a')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'as':_0x0a9e('0x155'),'through':_0x0a9e('0x105')});db[_0x0a9e('0x1a')][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x156'),'through':_0x0a9e('0x157')});db['VoiceRecording']['belongsTo'](db['User'],{'as':_0x0a9e('0x11'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x1c')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x10c')]['hasMany'](db['VoiceMailMessage'],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'mailboxuser','sourceKey':_0x0a9e('0x159')});db[_0x0a9e('0x1f')][_0x0a9e('0x150')](db[_0x0a9e('0x10c')],{'foreignKey':_0x0a9e('0x15a'),'targetKey':_0x0a9e('0x159')});db[_0x0a9e('0x15b')][_0x0a9e('0x110')](db[_0x0a9e('0x25')],{'as':_0x0a9e('0x15c'),'foreignKey':_0x0a9e('0x15d'),'constraints':![]});db[_0x0a9e('0x15b')]['hasMany'](db[_0x0a9e('0x15e')],{'as':_0x0a9e('0x15f'),'foreignKey':_0x0a9e('0x15d'),'constraints':![]});db[_0x0a9e('0x15b')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x15b')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':'ContactId'});db['MailServerIn'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':_0x0a9e('0x3b'),'foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x39')][_0x0a9e('0x150')](db[_0x0a9e('0x103')],{'as':'CloudProvider','foreignKey':_0x0a9e('0x162'),'onDelete':'restrict'});db[_0x0a9e('0x163')][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':_0x0a9e('0x3b'),'foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x163')][_0x0a9e('0x150')](db[_0x0a9e('0x103')],{'as':_0x0a9e('0x103'),'foreignKey':_0x0a9e('0x162'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x3b')][_0x0a9e('0x10b')](db[_0x0a9e('0x39')],{'as':_0x0a9e('0x165'),'onDelete':_0x0a9e('0x10e')});db['MailAccount']['hasOne'](db[_0x0a9e('0x163')],{'as':_0x0a9e('0x166'),'onDelete':'cascade'});db['MailAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':'MailAccountId','onDelete':_0x0a9e('0x10e')});db['MailAccount'][_0x0a9e('0x110')](db['CannedAnswer'],{'as':_0x0a9e('0x169'),'foreignKey':'MailAccountId'});db[_0x0a9e('0x3b')][_0x0a9e('0x110')](db[_0x0a9e('0x3e')],{'as':'Messages','foreignKey':_0x0a9e('0x161')});db['MailAccount']['hasMany'](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x3b')][_0x0a9e('0x110')](db[_0x0a9e('0x16b')],{'as':_0x0a9e('0x147'),'foreignKey':_0x0a9e('0x161'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x3b')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x3b')][_0x0a9e('0x150')](db[_0x0a9e('0x8b')],{'as':_0x0a9e('0x8b'),'foreignKey':_0x0a9e('0x16e')});db[_0x0a9e('0x3b')]['belongsTo'](db[_0x0a9e('0x7d')],{'as':_0x0a9e('0x16f'),'foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x3b')]['belongsToMany'](db['User'],{'as':'Agents','through':_0x0a9e('0x13e')});db['MailQueue'][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x30')});db[_0x0a9e('0x3c')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x171'),'as':_0x0a9e('0x155')});db[_0x0a9e('0x11c')]['hasMany'](db[_0x0a9e('0x3e')],{'as':'Messages','onDelete':_0x0a9e('0x10e'),'foreignKey':'MailInteractionId'});db[_0x0a9e('0x11c')][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':'Account','foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x11c')]['belongsTo'](db['CmContact'],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x11c')]['belongsTo'](db['User'],{'as':'Owner','foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11c')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x173'),'as':_0x0a9e('0x174')});db[_0x0a9e('0x11c')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x173'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x11c')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x12b'),'foreignKey':_0x0a9e('0x177')});db[_0x0a9e('0x3e')]['hasMany'](db[_0x0a9e('0xe4')],{'as':_0x0a9e('0x178'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x3e')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':'User'});db[_0x0a9e('0x3e')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160')});db[_0x0a9e('0x3e')][_0x0a9e('0x150')](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x179'),'foreignKey':'MailInteractionId'});db['MailMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':'Account','foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x3e')]['belongsTo'](db[_0x0a9e('0x60')],{'as':'ChatWebsite','foreignKey':_0x0a9e('0x17a')});db[_0x0a9e('0x3e')]['belongsTo'](db[_0x0a9e('0x66')],{'as':_0x0a9e('0x66'),'foreignKey':'ChatOfflineMessageId'});db[_0x0a9e('0x16b')][_0x0a9e('0x150')](db['User'],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x16b')][_0x0a9e('0x150')](db[_0x0a9e('0x3c')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x16b')]['belongsTo'](db[_0x0a9e('0x3b')],{'onDelete':_0x0a9e('0x164')});db['MailApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x16b')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':'restrict','foreignKey':'TagId'});db['MailQueueReport']['belongsTo'](db['MailAccount'],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db['CmList'],{'as':'List','foreignKey':_0x0a9e('0x16d')});db['MailQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db['MailInteraction'],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db['MailMessage'],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db[_0x0a9e('0x3c')],{});db[_0x0a9e('0x17d')]['hasMany'](db[_0x0a9e('0x43')],{'as':'Items','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x45')]['hasMany'](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':'FaxAccountId','onDelete':_0x0a9e('0x10e')});db['FaxAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x17e')],{'as':'Answers','foreignKey':_0x0a9e('0x17f')});db['FaxAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x11b')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x45')][_0x0a9e('0x110')](db[_0x0a9e('0x47')],{'as':_0x0a9e('0x147'),'foreignKey':'FaxAccountId','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x45')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':_0x0a9e('0x180'),'onDelete':'cascade'});db[_0x0a9e('0x45')]['hasMany'](db['FaxMessage'],{'as':_0x0a9e('0x158')});db['FaxAccount'][_0x0a9e('0x150')](db[_0x0a9e('0x28')],{'as':'Trunk'});db[_0x0a9e('0x45')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x45')][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':_0x0a9e('0x16f'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x0a9e('0x45')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'user_has_fax_accounts'});db[_0x0a9e('0x47')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':'restrict'});db[_0x0a9e('0x47')][_0x0a9e('0x150')](db[_0x0a9e('0x4c')],{'onDelete':'restrict'});db[_0x0a9e('0x47')]['belongsTo'](db[_0x0a9e('0x45')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x47')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x181')});db['FaxInteraction'][_0x0a9e('0x110')](db[_0x0a9e('0x4a')],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x182')});db[_0x0a9e('0x11b')][_0x0a9e('0x150')](db[_0x0a9e('0x45')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x17f')});db[_0x0a9e('0x11b')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x11b')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11b')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':'fax_interaction_has_tags','as':_0x0a9e('0x174')});db[_0x0a9e('0x11b')][_0x0a9e('0x121')](db['Tag'],{'through':_0x0a9e('0x185'),'as':'ThroughTags'});db[_0x0a9e('0x11b')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x12d'),'foreignKey':_0x0a9e('0x182')});db[_0x0a9e('0x4a')][_0x0a9e('0x150')](db['User'],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x11')});db['FaxMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x11b')],{'as':_0x0a9e('0x179'),'foreignKey':'FaxInteractionId'});db[_0x0a9e('0x4a')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':'Contact'});db[_0x0a9e('0x4a')][_0x0a9e('0x150')](db[_0x0a9e('0xe4')],{'as':_0x0a9e('0xe4'),'foreignKey':_0x0a9e('0x186')});db['FaxMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x45')],{'as':'Account','foreignKey':_0x0a9e('0x17f')});db[_0x0a9e('0x4c')][_0x0a9e('0x121')](db['User'],{'as':'Agents','through':_0x0a9e('0x32')});db[_0x0a9e('0x4c')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x187'),'as':_0x0a9e('0x155')});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db['FaxAccount'],{});db['FaxQueueReport'][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db['CmContact'],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db['FaxQueueReport'][_0x0a9e('0x150')](db['FaxInteraction'],{});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db[_0x0a9e('0x4a')],{});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db['FaxQueueReport'][_0x0a9e('0x150')](db['FaxQueue'],{});db[_0x0a9e('0x50')][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x188'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x50')]['hasMany'](db[_0x0a9e('0x17e')],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x188')});db[_0x0a9e('0x50')][_0x0a9e('0x110')](db['SmsMessage'],{'as':_0x0a9e('0x158'),'foreignKey':_0x0a9e('0x188')});db['SmsAccount']['hasMany'](db[_0x0a9e('0x53')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x50')][_0x0a9e('0x110')](db[_0x0a9e('0x52')],{'as':_0x0a9e('0x147'),'foreignKey':'SmsAccountId','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x50')][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x50')][_0x0a9e('0x150')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x50')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x142')});db[_0x0a9e('0x52')][_0x0a9e('0x150')](db['User'],{'onDelete':_0x0a9e('0x164')});db['SmsApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x57')],{'onDelete':_0x0a9e('0x164')});db['SmsApplication']['belongsTo'](db[_0x0a9e('0x50')],{'onDelete':'restrict'});db[_0x0a9e('0x52')]['belongsTo'](db['Interval'],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x52')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x181')});db[_0x0a9e('0x53')][_0x0a9e('0x110')](db[_0x0a9e('0x55')],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x189')});db['SmsInteraction']['belongsTo'](db[_0x0a9e('0x50')],{'as':'Account','foreignKey':_0x0a9e('0x188')});db[_0x0a9e('0x53')][_0x0a9e('0x150')](db['CmContact'],{'as':'Contact','foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x53')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x53')]['belongsToMany'](db[_0x0a9e('0x86')],{'through':'sms_interaction_has_tags','as':_0x0a9e('0x174')});db[_0x0a9e('0x53')]['belongsToMany'](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x18a'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x53')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Users','through':_0x0a9e('0x12e'),'foreignKey':_0x0a9e('0x189')});db[_0x0a9e('0x55')]['belongsTo'](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11')});db[_0x0a9e('0x55')]['belongsTo'](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160')});db[_0x0a9e('0x55')][_0x0a9e('0x150')](db[_0x0a9e('0x53')],{'onDelete':'cascade','as':'Interaction','foreignKey':_0x0a9e('0x189')});db[_0x0a9e('0x55')]['belongsTo'](db[_0x0a9e('0x50')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x188')});db[_0x0a9e('0x57')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':_0x0a9e('0x34'),'foreignKey':_0x0a9e('0x18b')});db[_0x0a9e('0x57')]['belongsToMany'](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x18c'),'as':_0x0a9e('0x155')});db[_0x0a9e('0x59')]['hasMany'](db['Disposition'],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x18d'),'onDelete':_0x0a9e('0x10e')});db['OpenchannelAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x17e')],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x18d')});db[_0x0a9e('0x59')][_0x0a9e('0x110')](db[_0x0a9e('0x5d')],{'as':_0x0a9e('0x16a'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x5e')],{'as':'Messages','foreignKey':_0x0a9e('0x18d')});db['OpenchannelAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x5b')],{'as':'Applications','foreignKey':_0x0a9e('0x18d'),'onDelete':_0x0a9e('0x10e')});db['OpenchannelAccount'][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x59')][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x59')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x140')});db[_0x0a9e('0x5b')]['belongsTo'](db['User'],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x5b')][_0x0a9e('0x150')](db['OpenchannelQueue'],{'onDelete':'restrict','foreignKey':_0x0a9e('0x18e')});db['OpenchannelApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x59')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x18d')});db[_0x0a9e('0x5b')][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x153')});db['OpenchannelApplication']['belongsTo'](db[_0x0a9e('0x86')],{'onDelete':'restrict','foreignKey':_0x0a9e('0x181')});db[_0x0a9e('0x5d')][_0x0a9e('0x110')](db[_0x0a9e('0x5e')],{'as':'Messages','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x18f')});db[_0x0a9e('0x5d')]['belongsTo'](db[_0x0a9e('0x59')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x18d')});db['OpenchannelInteraction'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x5d')][_0x0a9e('0x150')](db['User'],{'as':'Owner','foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x5d')][_0x0a9e('0x121')](db['Tag'],{'through':'openchannel_interaction_has_tags','as':_0x0a9e('0x174')});db[_0x0a9e('0x5d')][_0x0a9e('0x121')](db['Tag'],{'through':'openchannel_interaction_has_tags','as':_0x0a9e('0x175')});db[_0x0a9e('0x5d')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':'user_has_openchannel_interactions','foreignKey':_0x0a9e('0x18f')});db['OpenchannelMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':'cascade','as':_0x0a9e('0x11')});db['OpenchannelMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160')});db[_0x0a9e('0x5e')]['belongsTo'](db[_0x0a9e('0x5d')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x179'),'foreignKey':'OpenchannelInteractionId'});db[_0x0a9e('0x5e')]['belongsTo'](db[_0x0a9e('0xe4')],{'as':_0x0a9e('0xe4'),'foreignKey':_0x0a9e('0x186')});db['OpenchannelMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x59')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x18d')});db[_0x0a9e('0x137')][_0x0a9e('0x121')](db['User'],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x35'),'foreignKey':_0x0a9e('0x18e')});db[_0x0a9e('0x137')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x190'),'as':_0x0a9e('0x155')});db['ChatWebsite'][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x17a'),'onDelete':'cascade'});db[_0x0a9e('0x60')]['hasMany'](db[_0x0a9e('0x17e')],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x17a')});db['ChatWebsite'][_0x0a9e('0x110')](db[_0x0a9e('0x191')],{'as':_0x0a9e('0x192')});db[_0x0a9e('0x60')]['hasMany'](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x60')][_0x0a9e('0x110')](db[_0x0a9e('0x63')],{'as':_0x0a9e('0x147'),'foreignKey':_0x0a9e('0x17a'),'onDelete':'cascade'});db[_0x0a9e('0x60')][_0x0a9e('0x110')](db[_0x0a9e('0x65')],{'as':_0x0a9e('0x158')});db['ChatWebsite'][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x60')][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'as':_0x0a9e('0x17b'),'foreignKey':_0x0a9e('0x153')});db['ChatWebsite'][_0x0a9e('0x150')](db['MailAccount'],{'as':_0x0a9e('0x3b'),'foreignKey':_0x0a9e('0x161')});db['ChatWebsite'][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':_0x0a9e('0x16f'),'foreignKey':_0x0a9e('0x154')});db['ChatWebsite'][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':_0x0a9e('0x13b')});db['OpenchannelQueueReport']['belongsTo'](db['OpenchannelAccount'],{});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db['OpenchannelQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db[_0x0a9e('0x5d')],{});db['OpenchannelQueueReport'][_0x0a9e('0x150')](db['OpenchannelMessage'],{});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db[_0x0a9e('0x137')],{});db['ChatApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x193'),'foreignKey':'UserId','onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x63')][_0x0a9e('0x150')](db[_0x0a9e('0x67')],{'as':_0x0a9e('0x194'),'foreignKey':_0x0a9e('0x195'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x63')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x196'),'foreignKey':_0x0a9e('0x17a'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x63')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':'restrict','foreignKey':_0x0a9e('0x181')});db[_0x0a9e('0x64')][_0x0a9e('0x110')](db['ChatMessage'],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x197')});db[_0x0a9e('0x64')]['belongsTo'](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x17a')});db[_0x0a9e('0x64')]['belongsTo'](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x64')]['belongsTo'](db['User'],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x64')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x198'),'as':_0x0a9e('0x174')});db[_0x0a9e('0x64')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x198'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x64')][_0x0a9e('0x121')](db['User'],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x199'),'foreignKey':_0x0a9e('0x197')});db['ChatMessage']['belongsTo'](db[_0x0a9e('0x11')],{'onDelete':'cascade','as':_0x0a9e('0x11')});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':'cascade','as':'Contact','foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0x64')],{'onDelete':'cascade','as':_0x0a9e('0x179'),'foreignKey':_0x0a9e('0x197')});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0xe4')],{'as':'Attachment','foreignKey':'AttachmentId'});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x17a')});db[_0x0a9e('0x66')][_0x0a9e('0x110')](db['Attachment'],{'as':_0x0a9e('0x178'),'foreignKey':_0x0a9e('0x19a'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db['ChatOfflineMessage']['belongsTo'](db['CmContact'],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160'),'foreignKey':'ContactId'});db[_0x0a9e('0x66')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':'Account','foreignKey':'ChatWebsiteId'});db[_0x0a9e('0x67')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'UserChatQueue','hooks':!![]});db[_0x0a9e('0x67')]['belongsToMany'](db['Team'],{'through':_0x0a9e('0x19b'),'as':'Teams'});db[_0x0a9e('0x68')][_0x0a9e('0x110')](db[_0x0a9e('0xcc')],{'as':'Messages','foreignKey':_0x0a9e('0x19c'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x68')]['belongsToMany'](db['User'],{'as':_0x0a9e('0x14a'),'through':_0x0a9e('0x123')});db[_0x0a9e('0x191')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x196'),'foreignKey':'ChatWebsiteId'});db['CmCompany'][_0x0a9e('0x110')](db[_0x0a9e('0x124')],{'as':'Contacts','foreignKey':'CompanyId'});db['CmContact']['hasMany'](db['CmContactHasItem'],{'as':'Phones','foreignKey':_0x0a9e('0x19d')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0x6d')],{'as':_0x0a9e('0x14c'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':'HopperFinals','foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x116')],{'as':_0x0a9e('0x19e'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':_0x0a9e('0x172')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0xd0')],{'as':'JscriptySessions','foreignKey':_0x0a9e('0x172')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0x5d')],{'as':'OpenchannelInteractions','foreignKey':'ContactId','onDelete':_0x0a9e('0x164')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x119'),'foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x164')});db['CmContact'][_0x0a9e('0x110')](db['SmsInteraction'],{'as':'SmsInteractions','foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x11b')],{'as':'FaxInteractions','foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db['MailInteraction'],{'as':_0x0a9e('0x11d'),'foreignKey':_0x0a9e('0x172'),'onDelete':'restrict'});db[_0x0a9e('0x124')][_0x0a9e('0x150')](db[_0x0a9e('0x19f')],{'as':_0x0a9e('0x1a0'),'foreignKey':'CompanyId'});db[_0x0a9e('0x124')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d'),'onDelete':'cascade'});db[_0x0a9e('0x124')][_0x0a9e('0x121')](db['User'],{'as':_0x0a9e('0x176'),'through':'cm_user_has_contacts'});db[_0x0a9e('0x124')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'as':_0x0a9e('0x174'),'through':_0x0a9e('0x1a1')});db[_0x0a9e('0x124')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x1a1'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x6d')][_0x0a9e('0x110')](db[_0x0a9e('0x1a2')],{'as':_0x0a9e('0x1a3'),'foreignKey':_0x0a9e('0x1a4')});db['CmHopper'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':'List','foreignKey':'ListId','onDelete':'cascade'});db['CmHopper'][_0x0a9e('0x150')](db['User'],{'as':'Agent','foreignKey':'UserId'});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x1a')],{'as':_0x0a9e('0x194'),'foreignKey':'VoiceQueueId','onDelete':'cascade'});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x1a5')],{'as':_0x0a9e('0x1a5'),'foreignKey':'CampaignId','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x1a6')});db['CmHopperBlack'][_0x0a9e('0x150')](db['CmContact'],{'as':'Contact','foreignKey':_0x0a9e('0x172'),'onDelete':'cascade'});db[_0x0a9e('0x6f')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x6f')][_0x0a9e('0x150')](db[_0x0a9e('0x1a')],{'as':'Queue','foreignKey':_0x0a9e('0x14b'),'onDelete':_0x0a9e('0x10e')});db['CmHopperBlack'][_0x0a9e('0x150')](db[_0x0a9e('0x1a5')],{'as':_0x0a9e('0x1a5'),'foreignKey':_0x0a9e('0x1a7'),'onDelete':'cascade'});db[_0x0a9e('0x76')][_0x0a9e('0x110')](db[_0x0a9e('0x7a')],{'as':{'plural':_0x0a9e('0x1a8'),'singular':_0x0a9e('0x1a9')},'foreignKey':'AutomationAllId','onDelete':'cascade','hooks':!![]});db[_0x0a9e('0x76')]['hasMany'](db[_0x0a9e('0x7a')],{'as':{'plural':'Any','singular':_0x0a9e('0x1aa')},'foreignKey':'AutomationAnyId','onDelete':_0x0a9e('0x10e'),'hooks':!![]});db['Automation'][_0x0a9e('0x110')](db[_0x0a9e('0x74')],{'as':_0x0a9e('0x1ab'),'foreignKey':'AutomationId','onDelete':'cascade','hooks':!![]});db[_0x0a9e('0x167')]['hasMany'](db[_0x0a9e('0x167')],{'as':'Dispositions','foreignKey':_0x0a9e('0x1ac'),'onDelete':'cascade'});db[_0x0a9e('0x17b')][_0x0a9e('0x110')](db['Interval'],{'as':_0x0a9e('0x1ad'),'foreignKey':_0x0a9e('0x153'),'onDelete':_0x0a9e('0x10e'),'hooks':!![],'required':![]});db[_0x0a9e('0x17b')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':_0x0a9e('0x114'),'foreignKey':_0x0a9e('0x153'),'onDelete':_0x0a9e('0x164')});db['Interval'][_0x0a9e('0x110')](db[_0x0a9e('0x16b')],{'as':_0x0a9e('0x1ae'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x17b')]['hasMany'](db['ChatApplication'],{'as':_0x0a9e('0x1af'),'foreignKey':'IntervalId'});db[_0x0a9e('0x17b')]['hasMany'](db[_0x0a9e('0x47')],{'as':_0x0a9e('0x1b0'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x17b')][_0x0a9e('0x110')](db[_0x0a9e('0x52')],{'as':_0x0a9e('0x1b1'),'foreignKey':'IntervalId'});db['Schedule'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{});db['Schedule'][_0x0a9e('0x150')](db[_0x0a9e('0x94')],{'foreignKey':_0x0a9e('0x1b2')});db['Schedule']['belongsTo'](db['AnalyticCustomReport'],{'foreignKey':_0x0a9e('0x1b3')});db[_0x0a9e('0x84')][_0x0a9e('0x121')](db[_0x0a9e('0x18')],{'as':'Mohs','through':_0x0a9e('0x149'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x86')]['belongsToMany'](db[_0x0a9e('0x124')],{'through':'cm_contact_has_tags'});db['Tag'][_0x0a9e('0x121')](db[_0x0a9e('0x64')],{'through':'chat_interaction_has_tags'});db['Tag'][_0x0a9e('0x121')](db['MailInteraction'],{'through':_0x0a9e('0x173')});db['Tag'][_0x0a9e('0x121')](db[_0x0a9e('0x53')],{'through':_0x0a9e('0x18a')});db['Tag']['belongsToMany'](db[_0x0a9e('0x11b')],{'through':_0x0a9e('0x185')});db[_0x0a9e('0x86')][_0x0a9e('0x121')](db['OpenchannelInteraction'],{'through':_0x0a9e('0x1b4')});db[_0x0a9e('0x86')]['belongsToMany'](db[_0x0a9e('0xfb')],{'through':_0x0a9e('0x1b5')});db[_0x0a9e('0x1b6')]['belongsTo'](db[_0x0a9e('0x88')],{'as':_0x0a9e('0x1b7'),'foreignKey':_0x0a9e('0x1b8')});db[_0x0a9e('0x1a2')][_0x0a9e('0x150')](db[_0x0a9e('0x6d')],{'as':_0x0a9e('0x1b9'),'foreignKey':_0x0a9e('0x1a4')});db[_0x0a9e('0x1b6')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x19d')});db[_0x0a9e('0x8d')][_0x0a9e('0x110')](db[_0x0a9e('0x7a')],{'as':{'plural':_0x0a9e('0x1ba'),'singular':_0x0a9e('0x1bb')},'foreignKey':_0x0a9e('0x1bc'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x8d')][_0x0a9e('0x110')](db['Condition'],{'as':{'plural':_0x0a9e('0x1bd'),'singular':_0x0a9e('0x1be')},'foreignKey':_0x0a9e('0x1bf'),'onDelete':'cascade','hooks':!![]});db[_0x0a9e('0x8d')][_0x0a9e('0x110')](db[_0x0a9e('0x74')],{'as':_0x0a9e('0x1ab'),'foreignKey':'TriggerId','onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x1c0')]['hasMany'](db[_0x0a9e('0x99')],{'as':_0x0a9e('0x1c1'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'CustomReportId','hooks':!![]});db['AnalyticDefaultReport'][_0x0a9e('0x110')](db[_0x0a9e('0x99')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':'DefaultReportId'});db[_0x0a9e('0x98')][_0x0a9e('0x110')](db[_0x0a9e('0x99')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c2')});db['AnalyticFieldReport']['belongsTo'](db[_0x0a9e('0x98')],{'foreignKey':_0x0a9e('0x1c2')});db[_0x0a9e('0x9c')]['hasMany'](db[_0x0a9e('0x9e')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'AccountId'});db['SalesforceConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1c4'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0x0a9e('0x9e')]['hasMany'](db['SalesforceField'],{'as':'Descriptions','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x9e')]['hasMany'](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c6')});db['SalesforceConfiguration'][_0x0a9e('0x150')](db[_0x0a9e('0x9c')],{'as':'Account','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa0')][_0x0a9e('0x110')](db['SalesforceField'],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xa0')]['hasMany'](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['SalesforceField'][_0x0a9e('0x110')](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xa0')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':'VariableId'});db[_0x0a9e('0xa1')][_0x0a9e('0x110')](db[_0x0a9e('0xa2')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa2')]['hasMany'](db[_0x0a9e('0x1cc')],{'as':_0x0a9e('0x1c4'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xa2')][_0x0a9e('0x110')](db[_0x0a9e('0x1cc')],{'as':_0x0a9e('0x1cd'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c5')});db['SugarcrmConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0x1cc')],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c6')});db['SugarcrmConfiguration'][_0x0a9e('0x150')](db[_0x0a9e('0xa1')],{'as':'Account','foreignKey':_0x0a9e('0x1c7')});db['SugarcrmField']['hasMany'](db['SugarcrmField'],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db['SugarcrmField'][_0x0a9e('0x110')](db[_0x0a9e('0x1cc')],{'as':'Description','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x1cc')]['hasMany'](db[_0x0a9e('0x1cc')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db['SugarcrmField'][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0x1cf')]['hasMany'](db[_0x0a9e('0xa6')],{'as':'Configurations','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa6')][_0x0a9e('0x110')](db[_0x0a9e('0xa8')],{'as':_0x0a9e('0x1c4'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xa6')]['hasMany'](db[_0x0a9e('0xa8')],{'as':_0x0a9e('0x1cd'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'DescriptionId'});db['DeskConfiguration']['hasMany'](db['DeskField'],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':'FieldId'});db[_0x0a9e('0xa6')][_0x0a9e('0x150')](db[_0x0a9e('0x1cf')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa6')]['belongsToMany'](db[_0x0a9e('0x86')],{'through':'int_desk_configuration_has_tags'});db['DeskField'][_0x0a9e('0x110')](db['DeskField'],{'as':_0x0a9e('0x1c8'),'foreignKey':'SubjectId'});db[_0x0a9e('0xa8')][_0x0a9e('0x110')](db[_0x0a9e('0xa8')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['DeskField'][_0x0a9e('0x110')](db[_0x0a9e('0xa8')],{'as':'Field','foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xa8')]['belongsTo'](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0xaa')][_0x0a9e('0x110')](db[_0x0a9e('0xac')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xac')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':'Subjects','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xac')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1cd'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c5')});db['ZohoConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xac')][_0x0a9e('0x150')](db[_0x0a9e('0xaa')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xae')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1c8'),'foreignKey':'SubjectId'});db[_0x0a9e('0xae')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':'Description','foreignKey':'DescriptionId'});db[_0x0a9e('0xae')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xae')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':'VariableId'});db[_0x0a9e('0xaf')][_0x0a9e('0x110')](db['ZendeskConfiguration'],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'AccountId'});db['ZendeskConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0xb2')],{'as':_0x0a9e('0x1c4'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0x1d0')]['hasMany'](db[_0x0a9e('0xb2')],{'as':'Descriptions','foreignKey':'DescriptionId'});db['ZendeskConfiguration'][_0x0a9e('0x110')](db['ZendeskField'],{'as':'Fields','foreignKey':'FieldId'});db[_0x0a9e('0x1d0')][_0x0a9e('0x150')](db[_0x0a9e('0xaf')],{'as':_0x0a9e('0x183'),'foreignKey':'AccountId'});db[_0x0a9e('0x1d0')]['belongsToMany'](db['Tag'],{'through':_0x0a9e('0x1d1')});db[_0x0a9e('0xb2')][_0x0a9e('0x110')](db['ZendeskField'],{'as':'Subject','foreignKey':'SubjectId'});db[_0x0a9e('0xb2')][_0x0a9e('0x110')](db[_0x0a9e('0xb2')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['ZendeskField'][_0x0a9e('0x110')](db[_0x0a9e('0xb2')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb2')][_0x0a9e('0x150')](db['Variable'],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0x1d2')][_0x0a9e('0x110')](db[_0x0a9e('0x1d3')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0x1d3')][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':_0x0a9e('0x1c4'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0x1d3')][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':_0x0a9e('0x1cd'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x1d3')]['hasMany'](db['FreshdeskField'],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c6')});db['FreshdeskConfiguration'][_0x0a9e('0x150')](db[_0x0a9e('0x1d2')],{'as':'Account','foreignKey':_0x0a9e('0x1c7')});db['FreshdeskConfiguration'][_0x0a9e('0x121')](db['Tag'],{'through':_0x0a9e('0x1d4')});db[_0x0a9e('0xb5')][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':'Subject','foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xb5')][_0x0a9e('0x110')](db['FreshdeskField'],{'as':'Description','foreignKey':'DescriptionId'});db['FreshdeskField'][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb5')]['belongsTo'](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0x1d5')]['hasMany'](db[_0x0a9e('0xb8')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xb8')]['hasMany'](db[_0x0a9e('0xb9')],{'as':_0x0a9e('0x1c4'),'foreignKey':_0x0a9e('0x1c9')});db['VtigerConfiguration'][_0x0a9e('0x110')](db['VtigerField'],{'as':_0x0a9e('0x1cd'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xb8')][_0x0a9e('0x110')](db[_0x0a9e('0xb9')],{'as':'Fields','foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb8')][_0x0a9e('0x150')](db[_0x0a9e('0x1d5')],{'as':_0x0a9e('0x183'),'foreignKey':'AccountId'});db[_0x0a9e('0xb9')][_0x0a9e('0x110')](db[_0x0a9e('0xb9')],{'as':'Subject','foreignKey':_0x0a9e('0x1c9')});db['VtigerField']['hasMany'](db[_0x0a9e('0xb9')],{'as':'Description','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xb9')][_0x0a9e('0x110')](db['VtigerField'],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb9')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0xba')]['hasMany'](db[_0x0a9e('0xbc')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xbc')]['hasMany'](db['ServicenowField'],{'as':_0x0a9e('0x1c4'),'foreignKey':'SubjectId'});db[_0x0a9e('0xbc')][_0x0a9e('0x110')](db['ServicenowField'],{'as':_0x0a9e('0x1cd'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xbc')]['hasMany'](db[_0x0a9e('0x1d6')],{'as':_0x0a9e('0x1c1'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xbc')][_0x0a9e('0x150')](db[_0x0a9e('0xba')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db['ServicenowField'][_0x0a9e('0x110')](db[_0x0a9e('0x1d6')],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0x1d6')]['hasMany'](db[_0x0a9e('0x1d6')],{'as':'Description','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x1d6')][_0x0a9e('0x110')](db['ServicenowField'],{'as':_0x0a9e('0x1cb'),'foreignKey':'FieldId'});db[_0x0a9e('0x1d6')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':'VariableId'});db[_0x0a9e('0xbe')]['hasMany'](db[_0x0a9e('0xbf')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xbe')][_0x0a9e('0x150')](db['CloudProvider'],{'as':_0x0a9e('0x103'),'foreignKey':'CloudProviderId'});db[_0x0a9e('0xbf')][_0x0a9e('0x110')](db['Dynamics365Field'],{'as':'Subjects','onDelete':'cascade','foreignKey':'SubjectId'});db[_0x0a9e('0xbf')][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':_0x0a9e('0x1cd'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c5')});db['Dynamics365Configuration'][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xbf')][_0x0a9e('0x150')](db[_0x0a9e('0xbe')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db['Dynamics365Field'][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xc1')][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xc1')][_0x0a9e('0x110')](db['Dynamics365Field'],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xc1')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db['FreshsalesAccount'][_0x0a9e('0x110')](db[_0x0a9e('0xc5')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xc5')][_0x0a9e('0x110')](db['FreshsalesField'],{'as':'Subjects','foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xc5')][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1cd'),'foreignKey':'DescriptionId'});db[_0x0a9e('0xc5')]['hasMany'](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1c1'),'foreignKey':'FieldId'});db[_0x0a9e('0xc5')]['belongsTo'](db[_0x0a9e('0xc3')],{'as':_0x0a9e('0x183'),'foreignKey':'AccountId'});db[_0x0a9e('0xc7')][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':'Subject','foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xc7')][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['FreshsalesField'][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db['FreshsalesField']['belongsTo'](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db['ChatQueueReport']['belongsTo'](db[_0x0a9e('0x60')],{});db['ChatQueueReport']['belongsTo'](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':'ListId'});db[_0x0a9e('0xca')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db['ChatQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x64')],{});db['ChatQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x65')],{});db[_0x0a9e('0xca')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db['ChatQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x67')],{});db['ChatInternalMessage']['belongsTo'](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x10e'),'foreignKey':'FromId'});db['ChatInternalMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1d7')});db[_0x0a9e('0xd0')]['hasMany'](db[_0x0a9e('0x1d8')],{'foreignKey':'SessionId','onDelete':'cascade'});db[_0x0a9e('0xd0')]['hasMany'](db[_0x0a9e('0xcd')],{'foreignKey':'SessionId','onDelete':_0x0a9e('0x10e')});db['SmsQueueReport']['belongsTo'](db[_0x0a9e('0x50')],{});db[_0x0a9e('0xd2')][_0x0a9e('0x150')](db['CmList'],{'as':'List','foreignKey':'ListId'});db[_0x0a9e('0xd2')][_0x0a9e('0x150')](db['CmContact'],{'as':_0x0a9e('0x160'),'foreignKey':'ContactId'});db[_0x0a9e('0xd2')]['belongsTo'](db[_0x0a9e('0x53')],{});db[_0x0a9e('0xd2')]['belongsTo'](db['SmsMessage'],{});db['SmsQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db[_0x0a9e('0xd2')][_0x0a9e('0x150')](db[_0x0a9e('0x57')],{});db[_0x0a9e('0x1d9')][_0x0a9e('0x110')](db[_0x0a9e('0xd0')],{'foreignKey':_0x0a9e('0x1da')});db[_0x0a9e('0x1d9')][_0x0a9e('0x110')](db[_0x0a9e('0x1d8')],{'foreignKey':_0x0a9e('0x1da')});db[_0x0a9e('0x1d9')][_0x0a9e('0x110')](db['JscriptyAnswerReport'],{'foreignKey':'ProjectId'});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'user_has_teams'});db[_0x0a9e('0x129')]['belongsToMany'](db[_0x0a9e('0x1a')],{'through':'TeamVoiceQueue','as':_0x0a9e('0x131')});db['Team']['belongsToMany'](db[_0x0a9e('0x3c')],{'through':_0x0a9e('0x171'),'as':_0x0a9e('0x1db')});db[_0x0a9e('0x129')]['belongsToMany'](db['ChatQueue'],{'through':_0x0a9e('0x19b'),'as':'ChatQueues'});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db['FaxQueue'],{'through':_0x0a9e('0x187'),'as':'FaxQueues'});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x57')],{'through':_0x0a9e('0x18c'),'as':_0x0a9e('0x136')});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x137')],{'through':_0x0a9e('0x190'),'as':_0x0a9e('0x1dc')});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x101')],{'through':_0x0a9e('0x1dd'),'as':_0x0a9e('0x138')});db[_0x0a9e('0x129')]['belongsToMany'](db[_0x0a9e('0xf1')],{'through':_0x0a9e('0x107'),'as':_0x0a9e('0x132')});db['Campaign'][_0x0a9e('0x110')](db[_0x0a9e('0x6d')],{'as':_0x0a9e('0x14c'),'foreignKey':_0x0a9e('0x1a7')});db[_0x0a9e('0x1a5')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':_0x0a9e('0x1a7')});db[_0x0a9e('0x1a5')][_0x0a9e('0x110')](db['CmHopperHistory'],{'as':_0x0a9e('0x19e'),'foreignKey':_0x0a9e('0x1a7')});db[_0x0a9e('0x1a5')]['hasMany'](db[_0x0a9e('0x6f')],{'as':'HopperBlacks','foreignKey':'CampaignId'});db[_0x0a9e('0x1a5')]['belongsTo'](db[_0x0a9e('0x28')],{'as':'Trunk','foreignKey':_0x0a9e('0x14f')});db[_0x0a9e('0x1a5')][_0x0a9e('0x150')](db['Trunk'],{'as':_0x0a9e('0x151'),'foreignKey':'TrunkBackupId'});db['Campaign'][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'as':_0x0a9e('0x17b'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x1a5')][_0x0a9e('0x150')](db['SquareProject'],{'as':_0x0a9e('0xdc'),'foreignKey':_0x0a9e('0x1de')});db[_0x0a9e('0x1a5')][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':'Lists','through':_0x0a9e('0x1df')});db[_0x0a9e('0x1a5')][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x156'),'through':_0x0a9e('0x1e0')});db[_0x0a9e('0xe4')][_0x0a9e('0x150')](db[_0x0a9e('0x66')],{'as':_0x0a9e('0x66'),'foreignKey':_0x0a9e('0x19a')});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db['MailMessage'],{});db['MailTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0x11c')],{});db['MailTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'foreignKey':_0x0a9e('0x1e2'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0x1e1')]['belongsTo'](db['User'],{'foreignKey':'FromUserId','as':_0x0a9e('0x1e4')});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1e5'),'as':_0x0a9e('0x1e6')});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db[_0x0a9e('0x3c')],{'foreignKey':'ToMailQueueId','as':'ToQueue'});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'foreignKey':_0x0a9e('0x1e7'),'as':_0x0a9e('0x1e8')});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db[_0x0a9e('0x65')],{});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db['ChatInteraction'],{});db[_0x0a9e('0xe8')]['belongsTo'](db['ChatWebsite'],{'foreignKey':_0x0a9e('0x1e9'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1ea'),'as':_0x0a9e('0x1e4')});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db['User'],{'foreignKey':_0x0a9e('0x1e5'),'as':_0x0a9e('0x1e6')});db[_0x0a9e('0xe8')]['belongsTo'](db[_0x0a9e('0x67')],{'foreignKey':_0x0a9e('0x1eb'),'as':'ToQueue'});db['ChatTransferReport']['belongsTo'](db['ChatWebsite'],{'foreignKey':_0x0a9e('0x1ec'),'as':_0x0a9e('0x1e8')});db['FaxTransferReport'][_0x0a9e('0x150')](db['FaxMessage'],{});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x11b')],{});db['FaxTransferReport']['belongsTo'](db[_0x0a9e('0x45')],{'foreignKey':_0x0a9e('0x1ed'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1ea'),'as':_0x0a9e('0x1e4')});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':'ToUserId','as':_0x0a9e('0x1e6')});db[_0x0a9e('0xea')]['belongsTo'](db['FaxQueue'],{'foreignKey':_0x0a9e('0x1ee'),'as':_0x0a9e('0x1ef')});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x45')],{'foreignKey':'ToFaxAccountId','as':_0x0a9e('0x1e8')});db[_0x0a9e('0xec')]['belongsTo'](db[_0x0a9e('0x5e')],{});db['OpenchannelTransferReport']['belongsTo'](db['OpenchannelInteraction'],{});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db['OpenchannelAccount'],{'foreignKey':'FromOpenchannelAccountId','as':_0x0a9e('0x1e3')});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':'FromUserId','as':_0x0a9e('0x1e4')});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db['User'],{'foreignKey':_0x0a9e('0x1e5'),'as':_0x0a9e('0x1e6')});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db[_0x0a9e('0x137')],{'foreignKey':'ToOpenchannelQueueId','as':'ToQueue'});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db[_0x0a9e('0x59')],{'foreignKey':'ToOpenchannelAccountId','as':'ToAccount'});db['SmsTransferReport']['belongsTo'](db[_0x0a9e('0x55')],{});db[_0x0a9e('0xee')][_0x0a9e('0x150')](db[_0x0a9e('0x53')],{});db[_0x0a9e('0xee')]['belongsTo'](db[_0x0a9e('0x50')],{'foreignKey':_0x0a9e('0x1f0'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0xee')][_0x0a9e('0x150')](db['User'],{'foreignKey':_0x0a9e('0x1ea'),'as':_0x0a9e('0x1e4')});db[_0x0a9e('0xee')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':'ToUserId','as':_0x0a9e('0x1e6')});db[_0x0a9e('0xee')]['belongsTo'](db['SmsQueue'],{'foreignKey':'ToSmsQueueId','as':_0x0a9e('0x1ef')});db[_0x0a9e('0xee')]['belongsTo'](db[_0x0a9e('0x50')],{'foreignKey':'ToSmsAccountId','as':'ToAccount'});db['CmList']['hasMany'](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x16d'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db[_0x0a9e('0x1f1')],{'as':_0x0a9e('0x1f2'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db['CmContact'],{'as':_0x0a9e('0x125'),'onDelete':'cascade','foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db[_0x0a9e('0x116')],{'as':'HopperHistory','foreignKey':'ListId'});db['CmList'][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':'ListId'});db[_0x0a9e('0x139')][_0x0a9e('0x121')](db[_0x0a9e('0x1a')],{'as':'Queues','through':_0x0a9e('0x1f3')});db[_0x0a9e('0x139')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':_0x0a9e('0x128')});db[_0x0a9e('0xf1')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':_0x0a9e('0x114'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0xf1')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'UserVoicePrefix'});db[_0x0a9e('0xf1')]['belongsToMany'](db[_0x0a9e('0x129')],{'through':'TeamVoicePrefix','as':_0x0a9e('0x155')});db[_0x0a9e('0xf2')][_0x0a9e('0x110')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'foreignKey':_0x0a9e('0x1f4')});db['UserProfile'][_0x0a9e('0x110')](db['UserProfileSection'],{'as':_0x0a9e('0x1f5'),'foreignKey':_0x0a9e('0x1f4'),'onDelete':_0x0a9e('0x10e')});db['UserProfileSection']['hasMany'](db['UserProfileResource'],{'as':_0x0a9e('0x1f6'),'foreignKey':_0x0a9e('0x1f7'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0xf7')][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':'Dispositions','foreignKey':_0x0a9e('0x1f8'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0xf7')][_0x0a9e('0x110')](db['CannedAnswer'],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x1f8')});db['WhatsappAccount'][_0x0a9e('0x110')](db[_0x0a9e('0xfd')],{'as':_0x0a9e('0x158'),'foreignKey':'WhatsappAccountId'});db[_0x0a9e('0xf7')]['hasMany'](db[_0x0a9e('0xfb')],{'as':'Interactions'});db[_0x0a9e('0xf7')][_0x0a9e('0x110')](db['WhatsappApplication'],{'as':_0x0a9e('0x147'),'foreignKey':_0x0a9e('0x1f8'),'onDelete':_0x0a9e('0x10e')});db['WhatsappAccount'][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0xf7')][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0xf7')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x144')});db[_0x0a9e('0xf9')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0xf9')][_0x0a9e('0x150')](db[_0x0a9e('0x101')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0xf9')][_0x0a9e('0x150')](db['WhatsappAccount'],{'onDelete':_0x0a9e('0x164')});db['WhatsappApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'onDelete':'restrict','foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0xf9')]['belongsTo'](db[_0x0a9e('0x86')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x181')});db['WhatsappInteraction'][_0x0a9e('0x110')](db['WhatsappMessage'],{'as':'Messages','onDelete':'cascade','foreignKey':_0x0a9e('0x1f9')});db[_0x0a9e('0xfb')][_0x0a9e('0x150')](db[_0x0a9e('0xf7')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1f8')});db[_0x0a9e('0xfb')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0xfb')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0xfb')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x1b5'),'as':_0x0a9e('0x174')});db['WhatsappInteraction'][_0x0a9e('0x121')](db['Tag'],{'through':_0x0a9e('0x1b5'),'as':_0x0a9e('0x175')});db[_0x0a9e('0xfb')]['belongsToMany'](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x130'),'foreignKey':'WhatsappInteractionId'});db[_0x0a9e('0xfd')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11')});db[_0x0a9e('0xfd')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':'cascade','as':_0x0a9e('0x160')});db[_0x0a9e('0xfd')][_0x0a9e('0x150')](db['WhatsappInteraction'],{'onDelete':'cascade','as':_0x0a9e('0x179'),'foreignKey':_0x0a9e('0x1f9')});db[_0x0a9e('0xfd')]['belongsTo'](db[_0x0a9e('0xf7')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1f8')});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db[_0x0a9e('0xf7')],{});db['WhatsappQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db['WhatsappInteraction'],{});db['WhatsappQueueReport']['belongsTo'](db[_0x0a9e('0x101')],{});db[_0x0a9e('0xfe')]['belongsTo'](db['WhatsappMessage'],{});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db['User'],{});db['WhatsappTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0xfd')],{});db['WhatsappTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0xfb')],{});db[_0x0a9e('0x1fa')]['belongsTo'](db['WhatsappAccount'],{'foreignKey':_0x0a9e('0x1fb'),'as':_0x0a9e('0x1e3')});db['WhatsappTransferReport']['belongsTo'](db[_0x0a9e('0xf7')],{'foreignKey':_0x0a9e('0x1fc'),'as':'ToAccount'});db[_0x0a9e('0x1fa')]['belongsTo'](db['WhatsappQueue'],{'foreignKey':_0x0a9e('0x1fd'),'as':_0x0a9e('0x1ef')});db['WhatsappTransferReport']['belongsTo'](db['User'],{'foreignKey':_0x0a9e('0x1ea'),'as':'FromAgent'});db[_0x0a9e('0x1fa')][_0x0a9e('0x150')](db['User'],{'foreignKey':'ToUserId','as':_0x0a9e('0x1e6')});db[_0x0a9e('0x101')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x37'),'foreignKey':'WhatsappQueueId'});db[_0x0a9e('0x101')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x1dd'),'as':'Teams'});db[_0x0a9e('0x1fe')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x1ff'),'foreignKey':_0x0a9e('0x10f'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x103')][_0x0a9e('0x10b')](db['Dynamics365Account'],{'as':_0x0a9e('0xbe'),'onDelete':_0x0a9e('0x164')});db['CloudProvider'][_0x0a9e('0x10b')](db['MailServerIn'],{'as':'Imap','onDelete':_0x0a9e('0x164')});db['CloudProvider']['hasOne'](db['MailServerOut'],{'as':'Smtp','onDelete':_0x0a9e('0x164')});module['exports']={'db':db,'dbH':dbH}; \ No newline at end of file +var _0xa9e0=['SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','License','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','../api/cmList/cmList.model','VoicePrefix','UserProfile','UserProfileSection','UserProfileResource','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','hasOne','VoiceMail','userSetting','cascade','UserId','hasMany','VoiceRecording','Recordings','VoiceQueuesRt','Extensions','HopperFinals','CmHopperHistory','HopperHistory','OpenchannelInteractions','ChatInteractions','SmsInteractions','FaxInteraction','MailInteraction','MailInteractions','WhatsappInteractions','UserNotifications','SenderId','belongsToMany','Groups','chat_group_has_users','CmContact','Contacts','cm_user_has_contacts','Lists','cm_user_has_lists','Team','user_has_teams','user_has_mail_interactions','FaxInteractions','user_has_fax_interactions','user_has_sms_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueues','VoicePrefixes','ChatQueues','UserChatQueue','FaxQueues','SmsQueues','OpenchannelQueue','WhatsappQueues','CmList','ChatWebsites','user_has_chat_websites','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','ChanSpyId','VoiceContext','Applications','Sounds','moh_has_sounds','Members','VoiceQueueId','Hoppers','HopperBlacks','JscriptySessions','TrunkId','belongsTo','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPauseId','Teams','BlackLists','voice_queues_has_cm_blacklists','Messages','mailbox','mailboxuser','VoiceCallReport','QueueCalls','uniqueid','VoiceAgentReport','AgentReports','Contact','MailAccountId','CloudProviderId','MailServerOut','restrict','Imap','Smtp','Disposition','Dispositions','Answers','Interactions','MailApplication','List','ListId','TemplateId','mandatoryDispositionPause','Agents','team_has_mail_queues','ContactId','mail_interaction_has_tags','Tags','ThroughTags','Users','MailInteractionId','Attachments','Interaction','ChatWebsiteId','Interval','MailQueueReport','Dashboard','CannedAnswer','FaxAccountId','Exntensions','TagId','FaxInteractionId','Account','Owner','fax_interaction_has_tags','AttachmentId','team_has_fax_queues','SmsAccountId','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelQueueId','OpenchannelInteractionId','team_has_openchannel_queues','ChatProactiveAction','ProactiveActions','Agent','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','user_has_chat_interactions','ChatOfflineMessageId','team_has_chat_queues','ChatGroupId','CmContactId','HopperHistories','CmCompany','Company','cm_contact_has_tags','CmHopperAdditionalPhone','AdditionalPhones','CmHopperId','Campaign','OwnerId','CampaignId','All','OneAll','OneAny','Actions','ParentId','Intervals','MailApplications','ChatApplications','FaxApplications','SmsApplications','DefaultReportId','CustomReportId','openchannel_interaction_has_tags','whatsapp_interaction_has_tags','CmContactHasItem','ItemType','ItemTypeId','Hopper','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','AnalyticCustomReport','Fields','MetricId','Configurations','Subjects','DescriptionId','FieldId','AccountId','Subject','SubjectId','Description','Field','SugarcrmField','Descriptions','VariableId','DeskAccount','ZendeskConfiguration','int_zendesk_configuration_has_tags','FreshdeskAccount','FreshdeskConfiguration','int_freshdesk_configuration_has_tags','VtigerAccount','ServicenowField','ToId','JscriptyQuestionReport','JscriptyProject','ProjectId','MailQueues','OpenchannelQueues','team_has_whatsapp_queues','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','MailTransferReport','FromMailAccountId','FromAccount','FromAgent','ToUserId','ToAgent','ToMailAccountId','ToAccount','FromChatWebsiteId','FromUserId','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','ToFaxQueueId','ToQueue','FromSmsAccountId','CmCustomField','CustomFields','voice_queues_has_cm_lists','userProfileId','UserProfileSections','Resources','sectionId','WhatsappAccountId','WhatsappInteractionId','WhatsappTransferReport','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','UserSetting','user','../config/environment','sequelize','lodash','motion2','xcall','xC@LL1234','127.0.0.1','utf8mb4','name','utf8','defaultsDeep','mysql','username','password','options','database','sequelizeHistory','User','import','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','ScreenRecording','../api/screenRecording/screenRecording.model','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','Trunk','../api/trunk/trunk.model','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerOut/mailServerOut.model','MailAccount','MailQueue','MailSubstatus','MailMessage','../api/mailMessage/mailMessage.model','../api/mailApplication/mailApplication.model','../api/mailQueueReport/mailQueueReport.model','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','OpenchannelMessage','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','ChatApplication','ChatInteraction','ChatMessage','ChatOfflineMessage','ChatQueue','ChatGroup','../api/chatGroup/chatGroup.model','../api/chatProactiveAction/chatProactiveAction.model','../api/cmCompany/cmCompany.model','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','ReportAgentPreview','Action','../api/action/action.model','Automation','../api/automation/automation.model','../api/cannedAnswer/cannedAnswer.model','../api/disposition/disposition.model','Condition','../api/condition/condition.model','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','ContactItemType','../api/contactItemType/contactItemType.model','../api/cmContactHasItem/cmContactHasItem.model','Template','../api/template/template.model','Trigger','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','../api/integrationReport/integrationReport.model','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','SugarcrmAccount','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','../api/intSugarcrmField/intSugarcrmField.model','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','VtigerField','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','Dynamics365Account','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','../api/squareOdbc/squareOdbc.model','SquareProject'];(function(_0x47b15f,_0x103e93){var _0x55bf25=function(_0x51fe7f){while(--_0x51fe7f){_0x47b15f['push'](_0x47b15f['shift']());}};_0x55bf25(++_0x103e93);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0xa9e0[_0x4b7b62];return _0x2280df;};'use strict';var config=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var jstz=require('jstz');var timezone=jstz['determine']();config[_0x0a9e('0x1')]=_['defaultsDeep'](config[_0x0a9e('0x1')],{'database':_0x0a9e('0x3'),'username':_0x0a9e('0x4'),'password':_0x0a9e('0x5'),'options':{'host':_0x0a9e('0x6'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0x0a9e('0x7')},'logging':![],'timezone':timezone[_0x0a9e('0x8')](),'define':{'charset':_0x0a9e('0x9'),'collate':'utf8_general_ci'}}});config['sequelizeHistory']=_[_0x0a9e('0xa')](config['sequelizeHistory'],{'database':'motion2','username':_0x0a9e('0x4'),'password':_0x0a9e('0x5'),'options':{'host':_0x0a9e('0x6'),'port':0xcea,'dialect':_0x0a9e('0xb'),'dialectOptions':{'charset':_0x0a9e('0x7')},'logging':![],'timezone':timezone[_0x0a9e('0x8')](),'define':{'charset':'utf8','collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelize']['database'],config[_0x0a9e('0x1')][_0x0a9e('0xc')],config[_0x0a9e('0x1')][_0x0a9e('0xd')],config[_0x0a9e('0x1')][_0x0a9e('0xe')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelizeHistory'][_0x0a9e('0xf')],config[_0x0a9e('0x10')][_0x0a9e('0xc')],config[_0x0a9e('0x10')][_0x0a9e('0xd')],config[_0x0a9e('0x10')]['options'])};db[_0x0a9e('0x11')]=db['sequelize'][_0x0a9e('0x12')]('../api/user/user.model');db[_0x0a9e('0x13')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x14'));db['VoiceContext']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x15'));db[_0x0a9e('0x16')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x17'));db[_0x0a9e('0x18')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x19'));db[_0x0a9e('0x1a')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x1b'));db['VoiceRecording']=db[_0x0a9e('0x1')]['import']('../api/voiceRecording/voiceRecording.model');db[_0x0a9e('0x1c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x1d'));db['VoiceMail']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x1e'));db[_0x0a9e('0x1f')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x20'));db['VoiceCallReport']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x21'));db[_0x0a9e('0x22')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x23'));db['VoiceAgentReport']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x24'));db[_0x0a9e('0x25')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x26'));db[_0x0a9e('0x27')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/memberReport/memberReport.model');db[_0x0a9e('0x28')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x29'));db['VoiceTransferReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x2a'));db[_0x0a9e('0x2b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x2c'));db[_0x0a9e('0x2d')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x2e'));db['UserChatQueue']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x2f'));db[_0x0a9e('0x30')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x31'));db[_0x0a9e('0x32')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x33'));db[_0x0a9e('0x34')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/userSmsQueue/userSmsQueue.model');db[_0x0a9e('0x35')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x36'));db[_0x0a9e('0x37')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x38'));db[_0x0a9e('0x39')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailServerIn/mailServerIn.model');db['MailServerOut']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x3a'));db[_0x0a9e('0x3b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailAccount/mailAccount.model');db[_0x0a9e('0x3c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailQueue/mailQueue.model');db[_0x0a9e('0x3d')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailSubstatus/mailSubstatus.model');db['MailInteraction']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailInteraction/mailInteraction.model');db[_0x0a9e('0x3e')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x3f'));db['MailApplication']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x40'));db['MailQueueReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x41'));db['Dashboard']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x42'));db[_0x0a9e('0x43')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x44'));db[_0x0a9e('0x45')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x46'));db[_0x0a9e('0x47')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x48'));db['FaxInteraction']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x49'));db[_0x0a9e('0x4a')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x4b'));db[_0x0a9e('0x4c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x4d'));db[_0x0a9e('0x4e')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x4f'));db[_0x0a9e('0x50')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x51'));db[_0x0a9e('0x52')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/smsApplication/smsApplication.model');db[_0x0a9e('0x53')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x54'));db[_0x0a9e('0x55')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x56'));db[_0x0a9e('0x57')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x58'));db[_0x0a9e('0x59')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x5a'));db[_0x0a9e('0x5b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x5c'));db[_0x0a9e('0x5d')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/openchannelInteraction/openchannelInteraction.model');db[_0x0a9e('0x5e')]=db[_0x0a9e('0x1')]['import']('../api/openchannelMessage/openchannelMessage.model');db['OpenchannelQueue']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x5f'));db[_0x0a9e('0x60')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x61'));db[_0x0a9e('0x62')]=db['sequelize']['import']('../api/openchannelQueueReport/openchannelQueueReport.model');db[_0x0a9e('0x63')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/chatApplication/chatApplication.model');db[_0x0a9e('0x64')]=db[_0x0a9e('0x1')]['import']('../api/chatInteraction/chatInteraction.model');db[_0x0a9e('0x65')]=db['sequelize'][_0x0a9e('0x12')]('../api/chatMessage/chatMessage.model');db[_0x0a9e('0x66')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/chatOfflineMessage/chatOfflineMessage.model');db[_0x0a9e('0x67')]=db[_0x0a9e('0x1')]['import']('../api/chatQueue/chatQueue.model');db[_0x0a9e('0x68')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x69'));db['ChatProactiveAction']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x6a'));db['CmCompany']=db['sequelize']['import'](_0x0a9e('0x6b'));db['CmContact']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x6c'));db[_0x0a9e('0x6d')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x6e'));db[_0x0a9e('0x6f')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x70'));db[_0x0a9e('0x71')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x72'));db['CmHopperHistory']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/cmHopperHistory/cmHopperHistory.model');db[_0x0a9e('0x73')]=db['sequelize'][_0x0a9e('0x12')]('../api/reportAgentPreview/reportAgentPreview.model');db['CmCustomField']=db['sequelize'][_0x0a9e('0x12')]('../api/cmCustomField/cmCustomField.model');db[_0x0a9e('0x74')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x75'));db[_0x0a9e('0x76')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x77'));db['CannedAnswer']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x78'));db['Disposition']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x79'));db[_0x0a9e('0x7a')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x7b'));db['Interval']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x7c'));db[_0x0a9e('0x7d')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x7e'));db[_0x0a9e('0x7f')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x80'));db['VoiceQueuesLog']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x81'));db[_0x0a9e('0x82')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x83'));db[_0x0a9e('0x84')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x85'));db[_0x0a9e('0x86')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x87'));db[_0x0a9e('0x88')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x89'));db['CmContactHasItem']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x8a'));db['CmHopperAdditionalPhone']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model');db[_0x0a9e('0x8b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x8c'));db[_0x0a9e('0x8d')]=db['sequelize']['import']('../api/trigger/trigger.model');db[_0x0a9e('0x8e')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x8f'));db[_0x0a9e('0x90')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x91'));db['IntegrationReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x92'));db['AnalyticCustomReport']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x93'));db[_0x0a9e('0x94')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x95'));db[_0x0a9e('0x96')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x97'));db[_0x0a9e('0x98')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/analyticMetric/analyticMetric.model');db[_0x0a9e('0x99')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9a'));db['AnalyticTreeReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9b'));db[_0x0a9e('0x9c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9d'));db[_0x0a9e('0x9e')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9f'));db[_0x0a9e('0xa0')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intSalesforceField/intSalesforceField.model');db[_0x0a9e('0xa1')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intSugarcrmAccount/intSugarcrmAccount.model');db[_0x0a9e('0xa2')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xa3'));db['SugarcrmField']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xa4'));db['DeskAccount']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xa5'));db[_0x0a9e('0xa6')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xa7'));db[_0x0a9e('0xa8')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xa9'));db[_0x0a9e('0xaa')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xab'));db[_0x0a9e('0xac')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xad'));db[_0x0a9e('0xae')]=db['sequelize'][_0x0a9e('0x12')]('../api/intZohoField/intZohoField.model');db[_0x0a9e('0xaf')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xb0'));db['ZendeskConfiguration']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xb1'));db[_0x0a9e('0xb2')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xb3'));db['FreshdeskAccount']=db['sequelize'][_0x0a9e('0x12')]('../api/intFreshdeskAccount/intFreshdeskAccount.model');db['FreshdeskConfiguration']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xb4'));db[_0x0a9e('0xb5')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xb6'));db['VtigerAccount']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xb7'));db[_0x0a9e('0xb8')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intVtigerConfiguration/intVtigerConfiguration.model');db[_0x0a9e('0xb9')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intVtigerField/intVtigerField.model');db[_0x0a9e('0xba')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xbb'));db[_0x0a9e('0xbc')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xbd'));db['ServicenowField']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intServicenowField/intServicenowField.model');db[_0x0a9e('0xbe')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intDynamics365Account/intDynamics365Account.model');db[_0x0a9e('0xbf')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xc0'));db[_0x0a9e('0xc1')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc2'));db[_0x0a9e('0xc3')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xc4'));db[_0x0a9e('0xc5')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc6'));db[_0x0a9e('0xc7')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc8'));db[_0x0a9e('0x90')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x91'));db['Network']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc9'));db[_0x0a9e('0xca')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xcb'));db[_0x0a9e('0xcc')]=db['sequelize'][_0x0a9e('0x12')]('../api/chatInternalMessage/chatInternalMessage.model');db[_0x0a9e('0xcd')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xce'));db['JscriptyQuestionReport']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xcf'));db[_0x0a9e('0xd0')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xd1'));db[_0x0a9e('0xd2')]=db['sequelize']['import'](_0x0a9e('0xd3'));db[_0x0a9e('0xd4')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xd5'));db[_0x0a9e('0xd6')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xd7'));db['JscriptyProject']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xd8'));db[_0x0a9e('0xd9')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xda'));db['SquareOdbc']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xdb'));db[_0x0a9e('0xdc')]=db[_0x0a9e('0x1')]['import']('../api/squareProject/squareProject.model');db[_0x0a9e('0xdd')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xde'));db[_0x0a9e('0xdf')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe0'));db['Team']=db['sequelize'][_0x0a9e('0x12')]('../api/team/team.model');db[_0x0a9e('0xe1')]=db['sequelize'][_0x0a9e('0x12')]('../api/license/license.model');db['Campaign']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/campaign/campaign.model');db[_0x0a9e('0xe2')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe3'));db[_0x0a9e('0xe4')]=db['sequelize']['import'](_0x0a9e('0xe5'));db[_0x0a9e('0xe6')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe7'));db['MailTransferReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailTransferReport/mailTransferReport.model');db[_0x0a9e('0xe8')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe9'));db[_0x0a9e('0xea')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xeb'));db[_0x0a9e('0xec')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xed'));db[_0x0a9e('0xee')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xef'));db['CmList']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xf0'));db[_0x0a9e('0xf1')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/voicePrefix/voicePrefix.model');db[_0x0a9e('0xf2')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/userProfile/userProfile.model');db[_0x0a9e('0xf3')]=db['sequelize'][_0x0a9e('0x12')]('../api/userProfileSection/userProfileSection.model');db[_0x0a9e('0xf4')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/userProfileResource/userProfileResource.model');db[_0x0a9e('0xf5')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xf6'));db[_0x0a9e('0xf7')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xf8'));db[_0x0a9e('0xf9')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xfa'));db[_0x0a9e('0xfb')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xfc'));db[_0x0a9e('0xfd')]=db[_0x0a9e('0x1')]['import']('../api/whatsappMessage/whatsappMessage.model');db[_0x0a9e('0xfe')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xff'));db['WhatsappTransferReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x100'));db[_0x0a9e('0x101')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x102'));db[_0x0a9e('0x103')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x104'));db[_0x0a9e('0x105')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x106'));db[_0x0a9e('0x107')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x108'));db[_0x0a9e('0x109')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x10a'));db['UserSetting']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/user-setting/user-setting.model');db[_0x0a9e('0x11')][_0x0a9e('0x10b')](db[_0x0a9e('0x10c')],{'as':'VoiceMail','onDelete':'cascade','foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x10b')](db['UserSetting'],{'as':_0x0a9e('0x10d'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x10f')});db['User'][_0x0a9e('0x110')](db[_0x0a9e('0x111')],{'as':_0x0a9e('0x112'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x2b')],{'as':_0x0a9e('0x113'),'foreignKey':_0x0a9e('0x10f')});db['User'][_0x0a9e('0x110')](db['VoiceExtension'],{'as':_0x0a9e('0x114'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x116')],{'as':_0x0a9e('0x117'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x5d')],{'as':_0x0a9e('0x118'),'foreignKey':_0x0a9e('0x10f')});db['User'][_0x0a9e('0x110')](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x119'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x53')],{'as':_0x0a9e('0x11a'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x11b')],{'as':'FaxInteractions','foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x11d'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0xfb')],{'as':_0x0a9e('0x11e'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0xf5')],{'as':_0x0a9e('0x11f'),'foreignKey':_0x0a9e('0x120')});db[_0x0a9e('0x11')]['belongsTo'](db[_0x0a9e('0xf2')],{'as':'UserProfile','foreignKey':'userProfileId'});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x68')],{'as':_0x0a9e('0x122'),'through':_0x0a9e('0x123')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x125'),'through':_0x0a9e('0x126')});db[_0x0a9e('0x11')]['belongsToMany'](db['CmList'],{'as':_0x0a9e('0x127'),'through':_0x0a9e('0x128')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x12a')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x11d'),'through':_0x0a9e('0x12b')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x119'),'through':'user_has_chat_interactions'});db['User']['belongsToMany'](db[_0x0a9e('0x11b')],{'as':_0x0a9e('0x12c'),'through':_0x0a9e('0x12d')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x53')],{'as':'SmsInteractions','through':_0x0a9e('0x12e')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db['OpenchannelInteraction'],{'as':_0x0a9e('0x118'),'through':_0x0a9e('0x12f')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0xfb')],{'as':'WhatsappInteractions','through':_0x0a9e('0x130')});db['User'][_0x0a9e('0x121')](db['VoiceQueue'],{'as':_0x0a9e('0x131'),'through':_0x0a9e('0x2d'),'required':![]});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0xf1')],{'as':_0x0a9e('0x132'),'through':_0x0a9e('0x109'),'required':![]});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x3c')],{'as':'MailQueues','through':_0x0a9e('0x30'),'required':![]});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x67')],{'as':_0x0a9e('0x133'),'through':_0x0a9e('0x134'),'required':![],'hooks':!![]});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x4c')],{'as':_0x0a9e('0x135'),'through':_0x0a9e('0x32'),'required':![]});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x57')],{'as':_0x0a9e('0x136'),'through':_0x0a9e('0x34'),'required':![]});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x137')],{'as':'OpenchannelQueues','through':_0x0a9e('0x35'),'required':![]});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x101')],{'as':_0x0a9e('0x138'),'through':_0x0a9e('0x37'),'required':![]});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'through':_0x0a9e('0x128')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x13a'),'through':_0x0a9e('0x13b')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x45')],{'as':'FaxAccounts','through':_0x0a9e('0x13c')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x3b')],{'as':_0x0a9e('0x13d'),'through':_0x0a9e('0x13e')});db[_0x0a9e('0x11')]['belongsToMany'](db['OpenchannelAccount'],{'as':_0x0a9e('0x13f'),'through':_0x0a9e('0x140')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x50')],{'as':_0x0a9e('0x141'),'through':_0x0a9e('0x142')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0xf7')],{'as':_0x0a9e('0x143'),'through':_0x0a9e('0x144')});db[_0x0a9e('0x13')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':'SpiedAgents','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x145')});db[_0x0a9e('0x146')]['hasMany'](db[_0x0a9e('0x16')],{'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x16')][_0x0a9e('0x110')](db['VoiceExtension'],{'as':_0x0a9e('0x147'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x18')][_0x0a9e('0x121')](db[_0x0a9e('0x84')],{'as':_0x0a9e('0x148'),'through':_0x0a9e('0x149')});db[_0x0a9e('0x1a')]['hasMany'](db[_0x0a9e('0x2b')],{'as':_0x0a9e('0x14a'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')]['hasMany'](db['CmHopper'],{'as':_0x0a9e('0x14c'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')]['hasMany'](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':'VoiceQueueId'});db[_0x0a9e('0x1a')]['hasMany'](db[_0x0a9e('0x116')],{'as':'HopperHistories','foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')][_0x0a9e('0x110')](db['CmHopperBlack'],{'as':_0x0a9e('0x14d'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')][_0x0a9e('0x110')](db[_0x0a9e('0xd0')],{'as':_0x0a9e('0x14e'),'foreignKey':_0x0a9e('0x14b')});db['VoiceQueue']['belongsTo'](db[_0x0a9e('0x28')],{'as':'Trunk','foreignKey':_0x0a9e('0x14f')});db[_0x0a9e('0x1a')][_0x0a9e('0x150')](db[_0x0a9e('0x28')],{'as':_0x0a9e('0x151'),'foreignKey':_0x0a9e('0x152')});db['VoiceQueue'][_0x0a9e('0x150')](db['Interval'],{'as':'Interval','foreignKey':_0x0a9e('0x153')});db['VoiceQueue'][_0x0a9e('0x150')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db['VoiceQueue'][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x127'),'through':'voice_queues_has_cm_lists'});db[_0x0a9e('0x1a')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':'UserVoiceQueue'});db[_0x0a9e('0x1a')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'as':_0x0a9e('0x155'),'through':_0x0a9e('0x105')});db[_0x0a9e('0x1a')][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x156'),'through':_0x0a9e('0x157')});db['VoiceRecording']['belongsTo'](db['User'],{'as':_0x0a9e('0x11'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x1c')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x10c')]['hasMany'](db['VoiceMailMessage'],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'mailboxuser','sourceKey':_0x0a9e('0x159')});db[_0x0a9e('0x1f')][_0x0a9e('0x150')](db[_0x0a9e('0x10c')],{'foreignKey':_0x0a9e('0x15a'),'targetKey':_0x0a9e('0x159')});db[_0x0a9e('0x15b')][_0x0a9e('0x110')](db[_0x0a9e('0x25')],{'as':_0x0a9e('0x15c'),'foreignKey':_0x0a9e('0x15d'),'constraints':![]});db[_0x0a9e('0x15b')]['hasMany'](db[_0x0a9e('0x15e')],{'as':_0x0a9e('0x15f'),'foreignKey':_0x0a9e('0x15d'),'constraints':![]});db[_0x0a9e('0x15b')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x15b')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':'ContactId'});db['MailServerIn'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':_0x0a9e('0x3b'),'foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x39')][_0x0a9e('0x150')](db[_0x0a9e('0x103')],{'as':'CloudProvider','foreignKey':_0x0a9e('0x162'),'onDelete':'restrict'});db[_0x0a9e('0x163')][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':_0x0a9e('0x3b'),'foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x163')][_0x0a9e('0x150')](db[_0x0a9e('0x103')],{'as':_0x0a9e('0x103'),'foreignKey':_0x0a9e('0x162'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x3b')][_0x0a9e('0x10b')](db[_0x0a9e('0x39')],{'as':_0x0a9e('0x165'),'onDelete':_0x0a9e('0x10e')});db['MailAccount']['hasOne'](db[_0x0a9e('0x163')],{'as':_0x0a9e('0x166'),'onDelete':'cascade'});db['MailAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':'MailAccountId','onDelete':_0x0a9e('0x10e')});db['MailAccount'][_0x0a9e('0x110')](db['CannedAnswer'],{'as':_0x0a9e('0x169'),'foreignKey':'MailAccountId'});db[_0x0a9e('0x3b')][_0x0a9e('0x110')](db[_0x0a9e('0x3e')],{'as':'Messages','foreignKey':_0x0a9e('0x161')});db['MailAccount']['hasMany'](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x3b')][_0x0a9e('0x110')](db[_0x0a9e('0x16b')],{'as':_0x0a9e('0x147'),'foreignKey':_0x0a9e('0x161'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x3b')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x3b')][_0x0a9e('0x150')](db[_0x0a9e('0x8b')],{'as':_0x0a9e('0x8b'),'foreignKey':_0x0a9e('0x16e')});db[_0x0a9e('0x3b')]['belongsTo'](db[_0x0a9e('0x7d')],{'as':_0x0a9e('0x16f'),'foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x3b')]['belongsToMany'](db['User'],{'as':'Agents','through':_0x0a9e('0x13e')});db['MailQueue'][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x30')});db[_0x0a9e('0x3c')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x171'),'as':_0x0a9e('0x155')});db[_0x0a9e('0x11c')]['hasMany'](db[_0x0a9e('0x3e')],{'as':'Messages','onDelete':_0x0a9e('0x10e'),'foreignKey':'MailInteractionId'});db[_0x0a9e('0x11c')][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':'Account','foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x11c')]['belongsTo'](db['CmContact'],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x11c')]['belongsTo'](db['User'],{'as':'Owner','foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11c')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x173'),'as':_0x0a9e('0x174')});db[_0x0a9e('0x11c')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x173'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x11c')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x12b'),'foreignKey':_0x0a9e('0x177')});db[_0x0a9e('0x3e')]['hasMany'](db[_0x0a9e('0xe4')],{'as':_0x0a9e('0x178'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x3e')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':'User'});db[_0x0a9e('0x3e')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160')});db[_0x0a9e('0x3e')][_0x0a9e('0x150')](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x179'),'foreignKey':'MailInteractionId'});db['MailMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':'Account','foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x3e')]['belongsTo'](db[_0x0a9e('0x60')],{'as':'ChatWebsite','foreignKey':_0x0a9e('0x17a')});db[_0x0a9e('0x3e')]['belongsTo'](db[_0x0a9e('0x66')],{'as':_0x0a9e('0x66'),'foreignKey':'ChatOfflineMessageId'});db[_0x0a9e('0x16b')][_0x0a9e('0x150')](db['User'],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x16b')][_0x0a9e('0x150')](db[_0x0a9e('0x3c')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x16b')]['belongsTo'](db[_0x0a9e('0x3b')],{'onDelete':_0x0a9e('0x164')});db['MailApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x16b')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':'restrict','foreignKey':'TagId'});db['MailQueueReport']['belongsTo'](db['MailAccount'],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db['CmList'],{'as':'List','foreignKey':_0x0a9e('0x16d')});db['MailQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db['MailInteraction'],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db['MailMessage'],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db[_0x0a9e('0x3c')],{});db[_0x0a9e('0x17d')]['hasMany'](db[_0x0a9e('0x43')],{'as':'Items','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x45')]['hasMany'](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':'FaxAccountId','onDelete':_0x0a9e('0x10e')});db['FaxAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x17e')],{'as':'Answers','foreignKey':_0x0a9e('0x17f')});db['FaxAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x11b')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x45')][_0x0a9e('0x110')](db[_0x0a9e('0x47')],{'as':_0x0a9e('0x147'),'foreignKey':'FaxAccountId','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x45')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':_0x0a9e('0x180'),'onDelete':'cascade'});db[_0x0a9e('0x45')]['hasMany'](db['FaxMessage'],{'as':_0x0a9e('0x158')});db['FaxAccount'][_0x0a9e('0x150')](db[_0x0a9e('0x28')],{'as':'Trunk'});db[_0x0a9e('0x45')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x45')][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':_0x0a9e('0x16f'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x0a9e('0x45')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'user_has_fax_accounts'});db[_0x0a9e('0x47')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':'restrict'});db[_0x0a9e('0x47')][_0x0a9e('0x150')](db[_0x0a9e('0x4c')],{'onDelete':'restrict'});db[_0x0a9e('0x47')]['belongsTo'](db[_0x0a9e('0x45')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x47')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x181')});db['FaxInteraction'][_0x0a9e('0x110')](db[_0x0a9e('0x4a')],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x182')});db[_0x0a9e('0x11b')][_0x0a9e('0x150')](db[_0x0a9e('0x45')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x17f')});db[_0x0a9e('0x11b')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x11b')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11b')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':'fax_interaction_has_tags','as':_0x0a9e('0x174')});db[_0x0a9e('0x11b')][_0x0a9e('0x121')](db['Tag'],{'through':_0x0a9e('0x185'),'as':'ThroughTags'});db[_0x0a9e('0x11b')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x12d'),'foreignKey':_0x0a9e('0x182')});db[_0x0a9e('0x4a')][_0x0a9e('0x150')](db['User'],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x11')});db['FaxMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x11b')],{'as':_0x0a9e('0x179'),'foreignKey':'FaxInteractionId'});db[_0x0a9e('0x4a')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':'Contact'});db[_0x0a9e('0x4a')][_0x0a9e('0x150')](db[_0x0a9e('0xe4')],{'as':_0x0a9e('0xe4'),'foreignKey':_0x0a9e('0x186')});db['FaxMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x45')],{'as':'Account','foreignKey':_0x0a9e('0x17f')});db[_0x0a9e('0x4c')][_0x0a9e('0x121')](db['User'],{'as':'Agents','through':_0x0a9e('0x32')});db[_0x0a9e('0x4c')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x187'),'as':_0x0a9e('0x155')});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db['FaxAccount'],{});db['FaxQueueReport'][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db['CmContact'],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db['FaxQueueReport'][_0x0a9e('0x150')](db['FaxInteraction'],{});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db[_0x0a9e('0x4a')],{});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db['FaxQueueReport'][_0x0a9e('0x150')](db['FaxQueue'],{});db[_0x0a9e('0x50')][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x188'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x50')]['hasMany'](db[_0x0a9e('0x17e')],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x188')});db[_0x0a9e('0x50')][_0x0a9e('0x110')](db['SmsMessage'],{'as':_0x0a9e('0x158'),'foreignKey':_0x0a9e('0x188')});db['SmsAccount']['hasMany'](db[_0x0a9e('0x53')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x50')][_0x0a9e('0x110')](db[_0x0a9e('0x52')],{'as':_0x0a9e('0x147'),'foreignKey':'SmsAccountId','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x50')][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x50')][_0x0a9e('0x150')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x50')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x142')});db[_0x0a9e('0x52')][_0x0a9e('0x150')](db['User'],{'onDelete':_0x0a9e('0x164')});db['SmsApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x57')],{'onDelete':_0x0a9e('0x164')});db['SmsApplication']['belongsTo'](db[_0x0a9e('0x50')],{'onDelete':'restrict'});db[_0x0a9e('0x52')]['belongsTo'](db['Interval'],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x52')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x181')});db[_0x0a9e('0x53')][_0x0a9e('0x110')](db[_0x0a9e('0x55')],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x189')});db['SmsInteraction']['belongsTo'](db[_0x0a9e('0x50')],{'as':'Account','foreignKey':_0x0a9e('0x188')});db[_0x0a9e('0x53')][_0x0a9e('0x150')](db['CmContact'],{'as':'Contact','foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x53')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x53')]['belongsToMany'](db[_0x0a9e('0x86')],{'through':'sms_interaction_has_tags','as':_0x0a9e('0x174')});db[_0x0a9e('0x53')]['belongsToMany'](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x18a'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x53')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Users','through':_0x0a9e('0x12e'),'foreignKey':_0x0a9e('0x189')});db[_0x0a9e('0x55')]['belongsTo'](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11')});db[_0x0a9e('0x55')]['belongsTo'](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160')});db[_0x0a9e('0x55')][_0x0a9e('0x150')](db[_0x0a9e('0x53')],{'onDelete':'cascade','as':'Interaction','foreignKey':_0x0a9e('0x189')});db[_0x0a9e('0x55')]['belongsTo'](db[_0x0a9e('0x50')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x188')});db[_0x0a9e('0x57')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':_0x0a9e('0x34'),'foreignKey':_0x0a9e('0x18b')});db[_0x0a9e('0x57')]['belongsToMany'](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x18c'),'as':_0x0a9e('0x155')});db[_0x0a9e('0x59')]['hasMany'](db['Disposition'],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x18d'),'onDelete':_0x0a9e('0x10e')});db['OpenchannelAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x17e')],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x18d')});db[_0x0a9e('0x59')][_0x0a9e('0x110')](db[_0x0a9e('0x5d')],{'as':_0x0a9e('0x16a'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x5e')],{'as':'Messages','foreignKey':_0x0a9e('0x18d')});db['OpenchannelAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x5b')],{'as':'Applications','foreignKey':_0x0a9e('0x18d'),'onDelete':_0x0a9e('0x10e')});db['OpenchannelAccount'][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x59')][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x59')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x140')});db[_0x0a9e('0x5b')]['belongsTo'](db['User'],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x5b')][_0x0a9e('0x150')](db['OpenchannelQueue'],{'onDelete':'restrict','foreignKey':_0x0a9e('0x18e')});db['OpenchannelApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x59')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x18d')});db[_0x0a9e('0x5b')][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x153')});db['OpenchannelApplication']['belongsTo'](db[_0x0a9e('0x86')],{'onDelete':'restrict','foreignKey':_0x0a9e('0x181')});db[_0x0a9e('0x5d')][_0x0a9e('0x110')](db[_0x0a9e('0x5e')],{'as':'Messages','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x18f')});db[_0x0a9e('0x5d')]['belongsTo'](db[_0x0a9e('0x59')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x18d')});db['OpenchannelInteraction'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x5d')][_0x0a9e('0x150')](db['User'],{'as':'Owner','foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x5d')][_0x0a9e('0x121')](db['Tag'],{'through':'openchannel_interaction_has_tags','as':_0x0a9e('0x174')});db[_0x0a9e('0x5d')][_0x0a9e('0x121')](db['Tag'],{'through':'openchannel_interaction_has_tags','as':_0x0a9e('0x175')});db[_0x0a9e('0x5d')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':'user_has_openchannel_interactions','foreignKey':_0x0a9e('0x18f')});db['OpenchannelMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':'cascade','as':_0x0a9e('0x11')});db['OpenchannelMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160')});db[_0x0a9e('0x5e')]['belongsTo'](db[_0x0a9e('0x5d')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x179'),'foreignKey':'OpenchannelInteractionId'});db[_0x0a9e('0x5e')]['belongsTo'](db[_0x0a9e('0xe4')],{'as':_0x0a9e('0xe4'),'foreignKey':_0x0a9e('0x186')});db['OpenchannelMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x59')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x18d')});db[_0x0a9e('0x137')][_0x0a9e('0x121')](db['User'],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x35'),'foreignKey':_0x0a9e('0x18e')});db[_0x0a9e('0x137')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x190'),'as':_0x0a9e('0x155')});db['ChatWebsite'][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x17a'),'onDelete':'cascade'});db[_0x0a9e('0x60')]['hasMany'](db[_0x0a9e('0x17e')],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x17a')});db['ChatWebsite'][_0x0a9e('0x110')](db[_0x0a9e('0x191')],{'as':_0x0a9e('0x192')});db[_0x0a9e('0x60')]['hasMany'](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x60')][_0x0a9e('0x110')](db[_0x0a9e('0x63')],{'as':_0x0a9e('0x147'),'foreignKey':_0x0a9e('0x17a'),'onDelete':'cascade'});db[_0x0a9e('0x60')][_0x0a9e('0x110')](db[_0x0a9e('0x65')],{'as':_0x0a9e('0x158')});db['ChatWebsite'][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x60')][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'as':_0x0a9e('0x17b'),'foreignKey':_0x0a9e('0x153')});db['ChatWebsite'][_0x0a9e('0x150')](db['MailAccount'],{'as':_0x0a9e('0x3b'),'foreignKey':_0x0a9e('0x161')});db['ChatWebsite'][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':_0x0a9e('0x16f'),'foreignKey':_0x0a9e('0x154')});db['ChatWebsite'][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':_0x0a9e('0x13b')});db['OpenchannelQueueReport']['belongsTo'](db['OpenchannelAccount'],{});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db['OpenchannelQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db[_0x0a9e('0x5d')],{});db['OpenchannelQueueReport'][_0x0a9e('0x150')](db['OpenchannelMessage'],{});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db[_0x0a9e('0x137')],{});db['ChatApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x193'),'foreignKey':'UserId','onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x63')][_0x0a9e('0x150')](db[_0x0a9e('0x67')],{'as':_0x0a9e('0x194'),'foreignKey':_0x0a9e('0x195'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x63')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x196'),'foreignKey':_0x0a9e('0x17a'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x63')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':'restrict','foreignKey':_0x0a9e('0x181')});db[_0x0a9e('0x64')][_0x0a9e('0x110')](db['ChatMessage'],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x197')});db[_0x0a9e('0x64')]['belongsTo'](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x17a')});db[_0x0a9e('0x64')]['belongsTo'](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x64')]['belongsTo'](db['User'],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x64')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x198'),'as':_0x0a9e('0x174')});db[_0x0a9e('0x64')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x198'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x64')][_0x0a9e('0x121')](db['User'],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x199'),'foreignKey':_0x0a9e('0x197')});db['ChatMessage']['belongsTo'](db[_0x0a9e('0x11')],{'onDelete':'cascade','as':_0x0a9e('0x11')});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':'cascade','as':'Contact','foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0x64')],{'onDelete':'cascade','as':_0x0a9e('0x179'),'foreignKey':_0x0a9e('0x197')});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0xe4')],{'as':'Attachment','foreignKey':'AttachmentId'});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x17a')});db[_0x0a9e('0x66')][_0x0a9e('0x110')](db['Attachment'],{'as':_0x0a9e('0x178'),'foreignKey':_0x0a9e('0x19a'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db['ChatOfflineMessage']['belongsTo'](db['CmContact'],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160'),'foreignKey':'ContactId'});db[_0x0a9e('0x66')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':'Account','foreignKey':'ChatWebsiteId'});db[_0x0a9e('0x67')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'UserChatQueue','hooks':!![]});db[_0x0a9e('0x67')]['belongsToMany'](db['Team'],{'through':_0x0a9e('0x19b'),'as':'Teams'});db[_0x0a9e('0x68')][_0x0a9e('0x110')](db[_0x0a9e('0xcc')],{'as':'Messages','foreignKey':_0x0a9e('0x19c'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x68')]['belongsToMany'](db['User'],{'as':_0x0a9e('0x14a'),'through':_0x0a9e('0x123')});db[_0x0a9e('0x191')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x196'),'foreignKey':'ChatWebsiteId'});db['CmCompany'][_0x0a9e('0x110')](db[_0x0a9e('0x124')],{'as':'Contacts','foreignKey':'CompanyId'});db['CmContact']['hasMany'](db['CmContactHasItem'],{'as':'Phones','foreignKey':_0x0a9e('0x19d')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0x6d')],{'as':_0x0a9e('0x14c'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':'HopperFinals','foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x116')],{'as':_0x0a9e('0x19e'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':_0x0a9e('0x172')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0xd0')],{'as':'JscriptySessions','foreignKey':_0x0a9e('0x172')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0x5d')],{'as':'OpenchannelInteractions','foreignKey':'ContactId','onDelete':_0x0a9e('0x164')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x119'),'foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x164')});db['CmContact'][_0x0a9e('0x110')](db['SmsInteraction'],{'as':'SmsInteractions','foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x11b')],{'as':'FaxInteractions','foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db['MailInteraction'],{'as':_0x0a9e('0x11d'),'foreignKey':_0x0a9e('0x172'),'onDelete':'restrict'});db[_0x0a9e('0x124')][_0x0a9e('0x150')](db[_0x0a9e('0x19f')],{'as':_0x0a9e('0x1a0'),'foreignKey':'CompanyId'});db[_0x0a9e('0x124')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d'),'onDelete':'cascade'});db[_0x0a9e('0x124')][_0x0a9e('0x121')](db['User'],{'as':_0x0a9e('0x176'),'through':'cm_user_has_contacts'});db[_0x0a9e('0x124')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'as':_0x0a9e('0x174'),'through':_0x0a9e('0x1a1')});db[_0x0a9e('0x124')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x1a1'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x6d')][_0x0a9e('0x110')](db[_0x0a9e('0x1a2')],{'as':_0x0a9e('0x1a3'),'foreignKey':_0x0a9e('0x1a4')});db['CmHopper'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':'List','foreignKey':'ListId','onDelete':'cascade'});db['CmHopper'][_0x0a9e('0x150')](db['User'],{'as':'Agent','foreignKey':'UserId'});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x1a')],{'as':_0x0a9e('0x194'),'foreignKey':'VoiceQueueId','onDelete':'cascade'});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x1a5')],{'as':_0x0a9e('0x1a5'),'foreignKey':'CampaignId','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x1a6')});db['CmHopperBlack'][_0x0a9e('0x150')](db['CmContact'],{'as':'Contact','foreignKey':_0x0a9e('0x172'),'onDelete':'cascade'});db[_0x0a9e('0x6f')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x6f')][_0x0a9e('0x150')](db[_0x0a9e('0x1a')],{'as':'Queue','foreignKey':_0x0a9e('0x14b'),'onDelete':_0x0a9e('0x10e')});db['CmHopperBlack'][_0x0a9e('0x150')](db[_0x0a9e('0x1a5')],{'as':_0x0a9e('0x1a5'),'foreignKey':_0x0a9e('0x1a7'),'onDelete':'cascade'});db[_0x0a9e('0x76')][_0x0a9e('0x110')](db[_0x0a9e('0x7a')],{'as':{'plural':_0x0a9e('0x1a8'),'singular':_0x0a9e('0x1a9')},'foreignKey':'AutomationAllId','onDelete':'cascade','hooks':!![]});db[_0x0a9e('0x76')]['hasMany'](db[_0x0a9e('0x7a')],{'as':{'plural':'Any','singular':_0x0a9e('0x1aa')},'foreignKey':'AutomationAnyId','onDelete':_0x0a9e('0x10e'),'hooks':!![]});db['Automation'][_0x0a9e('0x110')](db[_0x0a9e('0x74')],{'as':_0x0a9e('0x1ab'),'foreignKey':'AutomationId','onDelete':'cascade','hooks':!![]});db[_0x0a9e('0x167')]['hasMany'](db[_0x0a9e('0x167')],{'as':'Dispositions','foreignKey':_0x0a9e('0x1ac'),'onDelete':'cascade'});db[_0x0a9e('0x17b')][_0x0a9e('0x110')](db['Interval'],{'as':_0x0a9e('0x1ad'),'foreignKey':_0x0a9e('0x153'),'onDelete':_0x0a9e('0x10e'),'hooks':!![],'required':![]});db[_0x0a9e('0x17b')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':_0x0a9e('0x114'),'foreignKey':_0x0a9e('0x153'),'onDelete':_0x0a9e('0x164')});db['Interval'][_0x0a9e('0x110')](db[_0x0a9e('0x16b')],{'as':_0x0a9e('0x1ae'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x17b')]['hasMany'](db['ChatApplication'],{'as':_0x0a9e('0x1af'),'foreignKey':'IntervalId'});db[_0x0a9e('0x17b')]['hasMany'](db[_0x0a9e('0x47')],{'as':_0x0a9e('0x1b0'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x17b')][_0x0a9e('0x110')](db[_0x0a9e('0x52')],{'as':_0x0a9e('0x1b1'),'foreignKey':'IntervalId'});db['Schedule'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{});db['Schedule'][_0x0a9e('0x150')](db[_0x0a9e('0x94')],{'foreignKey':_0x0a9e('0x1b2')});db['Schedule']['belongsTo'](db['AnalyticCustomReport'],{'foreignKey':_0x0a9e('0x1b3')});db[_0x0a9e('0x84')][_0x0a9e('0x121')](db[_0x0a9e('0x18')],{'as':'Mohs','through':_0x0a9e('0x149'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x86')]['belongsToMany'](db[_0x0a9e('0x124')],{'through':'cm_contact_has_tags'});db['Tag'][_0x0a9e('0x121')](db[_0x0a9e('0x64')],{'through':'chat_interaction_has_tags'});db['Tag'][_0x0a9e('0x121')](db['MailInteraction'],{'through':_0x0a9e('0x173')});db['Tag'][_0x0a9e('0x121')](db[_0x0a9e('0x53')],{'through':_0x0a9e('0x18a')});db['Tag']['belongsToMany'](db[_0x0a9e('0x11b')],{'through':_0x0a9e('0x185')});db[_0x0a9e('0x86')][_0x0a9e('0x121')](db['OpenchannelInteraction'],{'through':_0x0a9e('0x1b4')});db[_0x0a9e('0x86')]['belongsToMany'](db[_0x0a9e('0xfb')],{'through':_0x0a9e('0x1b5')});db[_0x0a9e('0x1b6')]['belongsTo'](db[_0x0a9e('0x88')],{'as':_0x0a9e('0x1b7'),'foreignKey':_0x0a9e('0x1b8')});db[_0x0a9e('0x1a2')][_0x0a9e('0x150')](db[_0x0a9e('0x6d')],{'as':_0x0a9e('0x1b9'),'foreignKey':_0x0a9e('0x1a4')});db[_0x0a9e('0x1b6')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x19d')});db[_0x0a9e('0x8d')][_0x0a9e('0x110')](db[_0x0a9e('0x7a')],{'as':{'plural':_0x0a9e('0x1ba'),'singular':_0x0a9e('0x1bb')},'foreignKey':_0x0a9e('0x1bc'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x8d')][_0x0a9e('0x110')](db['Condition'],{'as':{'plural':_0x0a9e('0x1bd'),'singular':_0x0a9e('0x1be')},'foreignKey':_0x0a9e('0x1bf'),'onDelete':'cascade','hooks':!![]});db[_0x0a9e('0x8d')][_0x0a9e('0x110')](db[_0x0a9e('0x74')],{'as':_0x0a9e('0x1ab'),'foreignKey':'TriggerId','onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x1c0')]['hasMany'](db[_0x0a9e('0x99')],{'as':_0x0a9e('0x1c1'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'CustomReportId','hooks':!![]});db['AnalyticDefaultReport'][_0x0a9e('0x110')](db[_0x0a9e('0x99')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':'DefaultReportId'});db[_0x0a9e('0x98')][_0x0a9e('0x110')](db[_0x0a9e('0x99')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c2')});db['AnalyticFieldReport']['belongsTo'](db[_0x0a9e('0x98')],{'foreignKey':_0x0a9e('0x1c2')});db[_0x0a9e('0x9c')]['hasMany'](db[_0x0a9e('0x9e')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'AccountId'});db['SalesforceConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1c4'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0x0a9e('0x9e')]['hasMany'](db['SalesforceField'],{'as':'Descriptions','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x9e')]['hasMany'](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c6')});db['SalesforceConfiguration'][_0x0a9e('0x150')](db[_0x0a9e('0x9c')],{'as':'Account','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa0')][_0x0a9e('0x110')](db['SalesforceField'],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xa0')]['hasMany'](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['SalesforceField'][_0x0a9e('0x110')](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xa0')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':'VariableId'});db[_0x0a9e('0xa1')][_0x0a9e('0x110')](db[_0x0a9e('0xa2')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa2')]['hasMany'](db[_0x0a9e('0x1cc')],{'as':_0x0a9e('0x1c4'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xa2')][_0x0a9e('0x110')](db[_0x0a9e('0x1cc')],{'as':_0x0a9e('0x1cd'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c5')});db['SugarcrmConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0x1cc')],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c6')});db['SugarcrmConfiguration'][_0x0a9e('0x150')](db[_0x0a9e('0xa1')],{'as':'Account','foreignKey':_0x0a9e('0x1c7')});db['SugarcrmField']['hasMany'](db['SugarcrmField'],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db['SugarcrmField'][_0x0a9e('0x110')](db[_0x0a9e('0x1cc')],{'as':'Description','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x1cc')]['hasMany'](db[_0x0a9e('0x1cc')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db['SugarcrmField'][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0x1cf')]['hasMany'](db[_0x0a9e('0xa6')],{'as':'Configurations','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa6')][_0x0a9e('0x110')](db[_0x0a9e('0xa8')],{'as':_0x0a9e('0x1c4'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xa6')]['hasMany'](db[_0x0a9e('0xa8')],{'as':_0x0a9e('0x1cd'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'DescriptionId'});db['DeskConfiguration']['hasMany'](db['DeskField'],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':'FieldId'});db[_0x0a9e('0xa6')][_0x0a9e('0x150')](db[_0x0a9e('0x1cf')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa6')]['belongsToMany'](db[_0x0a9e('0x86')],{'through':'int_desk_configuration_has_tags'});db['DeskField'][_0x0a9e('0x110')](db['DeskField'],{'as':_0x0a9e('0x1c8'),'foreignKey':'SubjectId'});db[_0x0a9e('0xa8')][_0x0a9e('0x110')](db[_0x0a9e('0xa8')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['DeskField'][_0x0a9e('0x110')](db[_0x0a9e('0xa8')],{'as':'Field','foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xa8')]['belongsTo'](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0xaa')][_0x0a9e('0x110')](db[_0x0a9e('0xac')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xac')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':'Subjects','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xac')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1cd'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c5')});db['ZohoConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xac')][_0x0a9e('0x150')](db[_0x0a9e('0xaa')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xae')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1c8'),'foreignKey':'SubjectId'});db[_0x0a9e('0xae')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':'Description','foreignKey':'DescriptionId'});db[_0x0a9e('0xae')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xae')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':'VariableId'});db[_0x0a9e('0xaf')][_0x0a9e('0x110')](db['ZendeskConfiguration'],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'AccountId'});db['ZendeskConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0xb2')],{'as':_0x0a9e('0x1c4'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0x1d0')]['hasMany'](db[_0x0a9e('0xb2')],{'as':'Descriptions','foreignKey':'DescriptionId'});db['ZendeskConfiguration'][_0x0a9e('0x110')](db['ZendeskField'],{'as':'Fields','foreignKey':'FieldId'});db[_0x0a9e('0x1d0')][_0x0a9e('0x150')](db[_0x0a9e('0xaf')],{'as':_0x0a9e('0x183'),'foreignKey':'AccountId'});db[_0x0a9e('0x1d0')]['belongsToMany'](db['Tag'],{'through':_0x0a9e('0x1d1')});db[_0x0a9e('0xb2')][_0x0a9e('0x110')](db['ZendeskField'],{'as':'Subject','foreignKey':'SubjectId'});db[_0x0a9e('0xb2')][_0x0a9e('0x110')](db[_0x0a9e('0xb2')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['ZendeskField'][_0x0a9e('0x110')](db[_0x0a9e('0xb2')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb2')][_0x0a9e('0x150')](db['Variable'],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0x1d2')][_0x0a9e('0x110')](db[_0x0a9e('0x1d3')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0x1d3')][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':_0x0a9e('0x1c4'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0x1d3')][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':_0x0a9e('0x1cd'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x1d3')]['hasMany'](db['FreshdeskField'],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c6')});db['FreshdeskConfiguration'][_0x0a9e('0x150')](db[_0x0a9e('0x1d2')],{'as':'Account','foreignKey':_0x0a9e('0x1c7')});db['FreshdeskConfiguration'][_0x0a9e('0x121')](db['Tag'],{'through':_0x0a9e('0x1d4')});db[_0x0a9e('0xb5')][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':'Subject','foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xb5')][_0x0a9e('0x110')](db['FreshdeskField'],{'as':'Description','foreignKey':'DescriptionId'});db['FreshdeskField'][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb5')]['belongsTo'](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0x1d5')]['hasMany'](db[_0x0a9e('0xb8')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xb8')]['hasMany'](db[_0x0a9e('0xb9')],{'as':_0x0a9e('0x1c4'),'foreignKey':_0x0a9e('0x1c9')});db['VtigerConfiguration'][_0x0a9e('0x110')](db['VtigerField'],{'as':_0x0a9e('0x1cd'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xb8')][_0x0a9e('0x110')](db[_0x0a9e('0xb9')],{'as':'Fields','foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb8')][_0x0a9e('0x150')](db[_0x0a9e('0x1d5')],{'as':_0x0a9e('0x183'),'foreignKey':'AccountId'});db[_0x0a9e('0xb9')][_0x0a9e('0x110')](db[_0x0a9e('0xb9')],{'as':'Subject','foreignKey':_0x0a9e('0x1c9')});db['VtigerField']['hasMany'](db[_0x0a9e('0xb9')],{'as':'Description','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xb9')][_0x0a9e('0x110')](db['VtigerField'],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb9')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0xba')]['hasMany'](db[_0x0a9e('0xbc')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xbc')]['hasMany'](db['ServicenowField'],{'as':_0x0a9e('0x1c4'),'foreignKey':'SubjectId'});db[_0x0a9e('0xbc')][_0x0a9e('0x110')](db['ServicenowField'],{'as':_0x0a9e('0x1cd'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xbc')]['hasMany'](db[_0x0a9e('0x1d6')],{'as':_0x0a9e('0x1c1'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xbc')][_0x0a9e('0x150')](db[_0x0a9e('0xba')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db['ServicenowField'][_0x0a9e('0x110')](db[_0x0a9e('0x1d6')],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0x1d6')]['hasMany'](db[_0x0a9e('0x1d6')],{'as':'Description','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x1d6')][_0x0a9e('0x110')](db['ServicenowField'],{'as':_0x0a9e('0x1cb'),'foreignKey':'FieldId'});db[_0x0a9e('0x1d6')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':'VariableId'});db[_0x0a9e('0xbe')]['hasMany'](db[_0x0a9e('0xbf')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xbe')][_0x0a9e('0x150')](db['CloudProvider'],{'as':_0x0a9e('0x103'),'foreignKey':'CloudProviderId'});db[_0x0a9e('0xbf')][_0x0a9e('0x110')](db['Dynamics365Field'],{'as':'Subjects','onDelete':'cascade','foreignKey':'SubjectId'});db[_0x0a9e('0xbf')][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':_0x0a9e('0x1cd'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c5')});db['Dynamics365Configuration'][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xbf')][_0x0a9e('0x150')](db[_0x0a9e('0xbe')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db['Dynamics365Field'][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xc1')][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xc1')][_0x0a9e('0x110')](db['Dynamics365Field'],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xc1')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db['FreshsalesAccount'][_0x0a9e('0x110')](db[_0x0a9e('0xc5')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xc5')][_0x0a9e('0x110')](db['FreshsalesField'],{'as':'Subjects','foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xc5')][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1cd'),'foreignKey':'DescriptionId'});db[_0x0a9e('0xc5')]['hasMany'](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1c1'),'foreignKey':'FieldId'});db[_0x0a9e('0xc5')]['belongsTo'](db[_0x0a9e('0xc3')],{'as':_0x0a9e('0x183'),'foreignKey':'AccountId'});db[_0x0a9e('0xc7')][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':'Subject','foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xc7')][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['FreshsalesField'][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db['FreshsalesField']['belongsTo'](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db['ChatQueueReport']['belongsTo'](db[_0x0a9e('0x60')],{});db['ChatQueueReport']['belongsTo'](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':'ListId'});db[_0x0a9e('0xca')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db['ChatQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x64')],{});db['ChatQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x65')],{});db[_0x0a9e('0xca')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db['ChatQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x67')],{});db['ChatInternalMessage']['belongsTo'](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x10e'),'foreignKey':'FromId'});db['ChatInternalMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1d7')});db[_0x0a9e('0xd0')]['hasMany'](db[_0x0a9e('0x1d8')],{'foreignKey':'SessionId','onDelete':'cascade'});db[_0x0a9e('0xd0')]['hasMany'](db[_0x0a9e('0xcd')],{'foreignKey':'SessionId','onDelete':_0x0a9e('0x10e')});db['SmsQueueReport']['belongsTo'](db[_0x0a9e('0x50')],{});db[_0x0a9e('0xd2')][_0x0a9e('0x150')](db['CmList'],{'as':'List','foreignKey':'ListId'});db[_0x0a9e('0xd2')][_0x0a9e('0x150')](db['CmContact'],{'as':_0x0a9e('0x160'),'foreignKey':'ContactId'});db[_0x0a9e('0xd2')]['belongsTo'](db[_0x0a9e('0x53')],{});db[_0x0a9e('0xd2')]['belongsTo'](db['SmsMessage'],{});db['SmsQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db[_0x0a9e('0xd2')][_0x0a9e('0x150')](db[_0x0a9e('0x57')],{});db[_0x0a9e('0x1d9')][_0x0a9e('0x110')](db[_0x0a9e('0xd0')],{'foreignKey':_0x0a9e('0x1da')});db[_0x0a9e('0x1d9')][_0x0a9e('0x110')](db[_0x0a9e('0x1d8')],{'foreignKey':_0x0a9e('0x1da')});db[_0x0a9e('0x1d9')][_0x0a9e('0x110')](db['JscriptyAnswerReport'],{'foreignKey':'ProjectId'});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'user_has_teams'});db[_0x0a9e('0x129')]['belongsToMany'](db[_0x0a9e('0x1a')],{'through':'TeamVoiceQueue','as':_0x0a9e('0x131')});db['Team']['belongsToMany'](db[_0x0a9e('0x3c')],{'through':_0x0a9e('0x171'),'as':_0x0a9e('0x1db')});db[_0x0a9e('0x129')]['belongsToMany'](db['ChatQueue'],{'through':_0x0a9e('0x19b'),'as':'ChatQueues'});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db['FaxQueue'],{'through':_0x0a9e('0x187'),'as':'FaxQueues'});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x57')],{'through':_0x0a9e('0x18c'),'as':_0x0a9e('0x136')});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x137')],{'through':_0x0a9e('0x190'),'as':_0x0a9e('0x1dc')});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x101')],{'through':_0x0a9e('0x1dd'),'as':_0x0a9e('0x138')});db[_0x0a9e('0x129')]['belongsToMany'](db[_0x0a9e('0xf1')],{'through':_0x0a9e('0x107'),'as':_0x0a9e('0x132')});db['Campaign'][_0x0a9e('0x110')](db[_0x0a9e('0x6d')],{'as':_0x0a9e('0x14c'),'foreignKey':_0x0a9e('0x1a7')});db[_0x0a9e('0x1a5')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':_0x0a9e('0x1a7')});db[_0x0a9e('0x1a5')][_0x0a9e('0x110')](db['CmHopperHistory'],{'as':_0x0a9e('0x19e'),'foreignKey':_0x0a9e('0x1a7')});db[_0x0a9e('0x1a5')]['hasMany'](db[_0x0a9e('0x6f')],{'as':'HopperBlacks','foreignKey':'CampaignId'});db[_0x0a9e('0x1a5')]['belongsTo'](db[_0x0a9e('0x28')],{'as':'Trunk','foreignKey':_0x0a9e('0x14f')});db[_0x0a9e('0x1a5')][_0x0a9e('0x150')](db['Trunk'],{'as':_0x0a9e('0x151'),'foreignKey':'TrunkBackupId'});db['Campaign'][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'as':_0x0a9e('0x17b'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x1a5')][_0x0a9e('0x150')](db['SquareProject'],{'as':_0x0a9e('0xdc'),'foreignKey':_0x0a9e('0x1de')});db[_0x0a9e('0x1a5')][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':'Lists','through':_0x0a9e('0x1df')});db[_0x0a9e('0x1a5')][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x156'),'through':_0x0a9e('0x1e0')});db[_0x0a9e('0xe4')][_0x0a9e('0x150')](db[_0x0a9e('0x66')],{'as':_0x0a9e('0x66'),'foreignKey':_0x0a9e('0x19a')});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db['MailMessage'],{});db['MailTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0x11c')],{});db['MailTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'foreignKey':_0x0a9e('0x1e2'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0x1e1')]['belongsTo'](db['User'],{'foreignKey':'FromUserId','as':_0x0a9e('0x1e4')});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1e5'),'as':_0x0a9e('0x1e6')});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db[_0x0a9e('0x3c')],{'foreignKey':'ToMailQueueId','as':'ToQueue'});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'foreignKey':_0x0a9e('0x1e7'),'as':_0x0a9e('0x1e8')});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db[_0x0a9e('0x65')],{});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db['ChatInteraction'],{});db[_0x0a9e('0xe8')]['belongsTo'](db['ChatWebsite'],{'foreignKey':_0x0a9e('0x1e9'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1ea'),'as':_0x0a9e('0x1e4')});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db['User'],{'foreignKey':_0x0a9e('0x1e5'),'as':_0x0a9e('0x1e6')});db[_0x0a9e('0xe8')]['belongsTo'](db[_0x0a9e('0x67')],{'foreignKey':_0x0a9e('0x1eb'),'as':'ToQueue'});db['ChatTransferReport']['belongsTo'](db['ChatWebsite'],{'foreignKey':_0x0a9e('0x1ec'),'as':_0x0a9e('0x1e8')});db['FaxTransferReport'][_0x0a9e('0x150')](db['FaxMessage'],{});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x11b')],{});db['FaxTransferReport']['belongsTo'](db[_0x0a9e('0x45')],{'foreignKey':_0x0a9e('0x1ed'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1ea'),'as':_0x0a9e('0x1e4')});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':'ToUserId','as':_0x0a9e('0x1e6')});db[_0x0a9e('0xea')]['belongsTo'](db['FaxQueue'],{'foreignKey':_0x0a9e('0x1ee'),'as':_0x0a9e('0x1ef')});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x45')],{'foreignKey':'ToFaxAccountId','as':_0x0a9e('0x1e8')});db[_0x0a9e('0xec')]['belongsTo'](db[_0x0a9e('0x5e')],{});db['OpenchannelTransferReport']['belongsTo'](db['OpenchannelInteraction'],{});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db['OpenchannelAccount'],{'foreignKey':'FromOpenchannelAccountId','as':_0x0a9e('0x1e3')});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':'FromUserId','as':_0x0a9e('0x1e4')});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db['User'],{'foreignKey':_0x0a9e('0x1e5'),'as':_0x0a9e('0x1e6')});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db[_0x0a9e('0x137')],{'foreignKey':'ToOpenchannelQueueId','as':'ToQueue'});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db[_0x0a9e('0x59')],{'foreignKey':'ToOpenchannelAccountId','as':'ToAccount'});db['SmsTransferReport']['belongsTo'](db[_0x0a9e('0x55')],{});db[_0x0a9e('0xee')][_0x0a9e('0x150')](db[_0x0a9e('0x53')],{});db[_0x0a9e('0xee')]['belongsTo'](db[_0x0a9e('0x50')],{'foreignKey':_0x0a9e('0x1f0'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0xee')][_0x0a9e('0x150')](db['User'],{'foreignKey':_0x0a9e('0x1ea'),'as':_0x0a9e('0x1e4')});db[_0x0a9e('0xee')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':'ToUserId','as':_0x0a9e('0x1e6')});db[_0x0a9e('0xee')]['belongsTo'](db['SmsQueue'],{'foreignKey':'ToSmsQueueId','as':_0x0a9e('0x1ef')});db[_0x0a9e('0xee')]['belongsTo'](db[_0x0a9e('0x50')],{'foreignKey':'ToSmsAccountId','as':'ToAccount'});db['CmList']['hasMany'](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x16d'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db[_0x0a9e('0x1f1')],{'as':_0x0a9e('0x1f2'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db['CmContact'],{'as':_0x0a9e('0x125'),'onDelete':'cascade','foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db[_0x0a9e('0x116')],{'as':'HopperHistory','foreignKey':'ListId'});db['CmList'][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':'ListId'});db[_0x0a9e('0x139')][_0x0a9e('0x121')](db[_0x0a9e('0x1a')],{'as':'Queues','through':_0x0a9e('0x1f3')});db[_0x0a9e('0x139')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':_0x0a9e('0x128')});db[_0x0a9e('0xf1')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':_0x0a9e('0x114'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0xf1')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'UserVoicePrefix'});db[_0x0a9e('0xf1')]['belongsToMany'](db[_0x0a9e('0x129')],{'through':'TeamVoicePrefix','as':_0x0a9e('0x155')});db[_0x0a9e('0xf2')][_0x0a9e('0x110')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'foreignKey':_0x0a9e('0x1f4')});db['UserProfile'][_0x0a9e('0x110')](db['UserProfileSection'],{'as':_0x0a9e('0x1f5'),'foreignKey':_0x0a9e('0x1f4'),'onDelete':_0x0a9e('0x10e')});db['UserProfileSection']['hasMany'](db['UserProfileResource'],{'as':_0x0a9e('0x1f6'),'foreignKey':_0x0a9e('0x1f7'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0xf7')][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':'Dispositions','foreignKey':_0x0a9e('0x1f8'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0xf7')][_0x0a9e('0x110')](db['CannedAnswer'],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x1f8')});db['WhatsappAccount'][_0x0a9e('0x110')](db[_0x0a9e('0xfd')],{'as':_0x0a9e('0x158'),'foreignKey':'WhatsappAccountId'});db[_0x0a9e('0xf7')]['hasMany'](db[_0x0a9e('0xfb')],{'as':'Interactions'});db[_0x0a9e('0xf7')][_0x0a9e('0x110')](db['WhatsappApplication'],{'as':_0x0a9e('0x147'),'foreignKey':_0x0a9e('0x1f8'),'onDelete':_0x0a9e('0x10e')});db['WhatsappAccount'][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0xf7')][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0xf7')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x144')});db[_0x0a9e('0xf9')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0xf9')][_0x0a9e('0x150')](db[_0x0a9e('0x101')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0xf9')][_0x0a9e('0x150')](db['WhatsappAccount'],{'onDelete':_0x0a9e('0x164')});db['WhatsappApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'onDelete':'restrict','foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0xf9')]['belongsTo'](db[_0x0a9e('0x86')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x181')});db['WhatsappInteraction'][_0x0a9e('0x110')](db['WhatsappMessage'],{'as':'Messages','onDelete':'cascade','foreignKey':_0x0a9e('0x1f9')});db[_0x0a9e('0xfb')][_0x0a9e('0x150')](db[_0x0a9e('0xf7')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1f8')});db[_0x0a9e('0xfb')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0xfb')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0xfb')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x1b5'),'as':_0x0a9e('0x174')});db['WhatsappInteraction'][_0x0a9e('0x121')](db['Tag'],{'through':_0x0a9e('0x1b5'),'as':_0x0a9e('0x175')});db[_0x0a9e('0xfb')]['belongsToMany'](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x130'),'foreignKey':'WhatsappInteractionId'});db[_0x0a9e('0xfd')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11')});db[_0x0a9e('0xfd')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':'cascade','as':_0x0a9e('0x160')});db[_0x0a9e('0xfd')][_0x0a9e('0x150')](db['WhatsappInteraction'],{'onDelete':'cascade','as':_0x0a9e('0x179'),'foreignKey':_0x0a9e('0x1f9')});db[_0x0a9e('0xfd')]['belongsTo'](db[_0x0a9e('0xf7')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1f8')});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db[_0x0a9e('0xf7')],{});db['WhatsappQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db['WhatsappInteraction'],{});db['WhatsappQueueReport']['belongsTo'](db[_0x0a9e('0x101')],{});db[_0x0a9e('0xfe')]['belongsTo'](db['WhatsappMessage'],{});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db['User'],{});db['WhatsappTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0xfd')],{});db['WhatsappTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0xfb')],{});db[_0x0a9e('0x1fa')]['belongsTo'](db['WhatsappAccount'],{'foreignKey':_0x0a9e('0x1fb'),'as':_0x0a9e('0x1e3')});db['WhatsappTransferReport']['belongsTo'](db[_0x0a9e('0xf7')],{'foreignKey':_0x0a9e('0x1fc'),'as':'ToAccount'});db[_0x0a9e('0x1fa')]['belongsTo'](db['WhatsappQueue'],{'foreignKey':_0x0a9e('0x1fd'),'as':_0x0a9e('0x1ef')});db['WhatsappTransferReport']['belongsTo'](db['User'],{'foreignKey':_0x0a9e('0x1ea'),'as':'FromAgent'});db[_0x0a9e('0x1fa')][_0x0a9e('0x150')](db['User'],{'foreignKey':'ToUserId','as':_0x0a9e('0x1e6')});db[_0x0a9e('0x101')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x37'),'foreignKey':'WhatsappQueueId'});db[_0x0a9e('0x101')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x1dd'),'as':'Teams'});db[_0x0a9e('0x1fe')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x1ff'),'foreignKey':_0x0a9e('0x10f'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x103')][_0x0a9e('0x10b')](db['Dynamics365Account'],{'as':_0x0a9e('0xbe'),'onDelete':_0x0a9e('0x164')});db['CloudProvider'][_0x0a9e('0x10b')](db['MailServerIn'],{'as':'Imap','onDelete':_0x0a9e('0x164')});db['CloudProvider']['hasOne'](db['MailServerOut'],{'as':'Smtp','onDelete':_0x0a9e('0x164')});module['exports']={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index 1595831..f2c913e 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3756=['sendFile','appPath','path','express','./errors','./config/environment','./utils/client-side-logger','setupLoggers','./api/client-side-logs','default','then','use','/api/users','./api/user','/api/voice/chanspy','./api/voiceChanSpy','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','/api/voice/queues','./api/voiceQueue','./api/voiceRecording','/api/screen/recordings','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','/api/members/reports','./api/memberReport','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','./api/mailQueue','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','./api/mailMessage','/api/mail/reports/queue','./api/mailQueueReport','./api/dashboard','/api/dashboards/items','/api/fax/accounts','./api/faxAccount','/api/fax/applications','/api/fax/interactions','./api/faxInteraction','./api/faxMessage','/api/fax/queues','./api/faxQueue','./api/faxQueueReport','/api/sms/accounts','/api/sms/applications','./api/smsApplication','./api/smsInteraction','/api/sms/messages','/api/sms/queues','./api/smsQueue','./api/openchannelAccount','/api/openchannel/applications','/api/openchannel/interactions','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','/api/chat/interactions','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','/api/actions','/api/automations','./api/automation','./api/cannedAnswer','/api/dispositions','./api/disposition','/api/conditions','./api/condition','/api/intervals','./api/interval','/api/pauses','./api/pause','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','./api/schedule','/api/sounds','./api/sound','/api/tags','./api/tag','/api/contact_item_types','./api/contactItemType','./api/cmContactHasItem','/api/cm_hopper_additional_phones','./api/template','/api/triggers','./api/trigger','/api/variables','/api/integrations','/api/integrations/reports','./api/integrationReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','/api/analytics/field_reports','/api/analytics/tree_reports','./api/analyticTreeReport','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','./api/intSugarcrmField','/api/integrations/desk/accounts','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/squareOdbc','/api/square/projects','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/teams','./api/team','/api/license','./api/license','/api/campaigns','./api/campaign','/api/migrations','./api/migration','/api/plugins','/api/mail/reports/transfer','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','/api/cm/lists','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileResource','/api/userNotifications','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/applications','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','/api/realtime','./api/realtime','/api/user-settings','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','/api/auth/activedirectory','./api/authActiveDirectory','/api/rpc','./api/rpc','/api/version','./api/version','/api/pm2','./api/pm2','./api/webbar','/api/logs','static','/apidoc','/www','root','/demo','/snippet','3.5.0','/plugins','join','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get'];(function(_0x1b4cda,_0x282199){var _0x1e130e=function(_0x381432){while(--_0x381432){_0x1b4cda['push'](_0x1b4cda['shift']());}};_0x1e130e(++_0x282199);}(_0x3756,0x116));var _0x6375=function(_0x25924c,_0x337b8f){_0x25924c=_0x25924c-0x0;var _0x49740c=_0x3756[_0x25924c];return _0x49740c;};'use strict';var path=require(_0x6375('0x0'));var express=require(_0x6375('0x1'));var errors=require(_0x6375('0x2'));var config=require(_0x6375('0x3'));var setupLoggers=require(_0x6375('0x4'))[_0x6375('0x5')];var clientSideLogs=require(_0x6375('0x6'));exports[_0x6375('0x7')]=function(_0x3f7d9a){return setupLoggers(_0x3f7d9a)[_0x6375('0x8')](function(){_0x3f7d9a[_0x6375('0x9')](_0x6375('0xa'),require(_0x6375('0xb')));_0x3f7d9a[_0x6375('0x9')](_0x6375('0xc'),require(_0x6375('0xd')));_0x3f7d9a['use']('/api/voice/contexts',require(_0x6375('0xe')));_0x3f7d9a[_0x6375('0x9')](_0x6375('0xf'),require(_0x6375('0x10')));_0x3f7d9a[_0x6375('0x9')]('/api/voice/mohs',require('./api/voiceMusicOnHold'));_0x3f7d9a[_0x6375('0x9')](_0x6375('0x11'),require(_0x6375('0x12')));_0x3f7d9a[_0x6375('0x9')]('/api/voice/recordings',require(_0x6375('0x13')));_0x3f7d9a[_0x6375('0x9')](_0x6375('0x14'),require('./api/screenRecording'));_0x3f7d9a[_0x6375('0x9')](_0x6375('0x15'),require(_0x6375('0x16')));_0x3f7d9a[_0x6375('0x9')](_0x6375('0x17'),require('./api/voiceMailMessage'));_0x3f7d9a[_0x6375('0x9')]('/api/voice/calls/reports',require(_0x6375('0x18')));_0x3f7d9a[_0x6375('0x9')](_0x6375('0x19'),require(_0x6375('0x1a')));_0x3f7d9a[_0x6375('0x9')](_0x6375('0x1b'),require(_0x6375('0x1c')));_0x3f7d9a[_0x6375('0x9')](_0x6375('0x1d'),require('./api/voiceQueueReport'));_0x3f7d9a['use'](_0x6375('0x1e'),require(_0x6375('0x1f')));_0x3f7d9a[_0x6375('0x9')]('/api/trunks',require('./api/trunk'));_0x3f7d9a[_0x6375('0x9')](_0x6375('0x20'),require(_0x6375('0x21')));_0x3f7d9a[_0x6375('0x9')](_0x6375('0x22'),require(_0x6375('0x23')));_0x3f7d9a[_0x6375('0x9')](_0x6375('0x24'),require(_0x6375('0x25')));_0x3f7d9a[_0x6375('0x9')]('/api/mail/queues',require(_0x6375('0x26')));_0x3f7d9a[_0x6375('0x9')]('/api/mail/substatuses',require(_0x6375('0x27')));_0x3f7d9a[_0x6375('0x9')](_0x6375('0x28'),require(_0x6375('0x29')));_0x3f7d9a[_0x6375('0x9')](_0x6375('0x2a'),require(_0x6375('0x2b')));_0x3f7d9a[_0x6375('0x9')]('/api/mail/applications',require('./api/mailApplication'));_0x3f7d9a[_0x6375('0x9')](_0x6375('0x2c'),require(_0x6375('0x2d')));_0x3f7d9a[_0x6375('0x9')]('/api/dashboards',require(_0x6375('0x2e')));_0x3f7d9a[_0x6375('0x9')](_0x6375('0x2f'),require('./api/dashboardItem'));_0x3f7d9a[_0x6375('0x9')](_0x6375('0x30'),require(_0x6375('0x31')));_0x3f7d9a['use'](_0x6375('0x32'),require('./api/faxApplication'));_0x3f7d9a[_0x6375('0x9')](_0x6375('0x33'),require(_0x6375('0x34')));_0x3f7d9a['use']('/api/fax/messages',require(_0x6375('0x35')));_0x3f7d9a[_0x6375('0x9')](_0x6375('0x36'),require(_0x6375('0x37')));_0x3f7d9a['use']('/api/fax/reports/queue',require(_0x6375('0x38')));_0x3f7d9a['use'](_0x6375('0x39'),require('./api/smsAccount'));_0x3f7d9a['use'](_0x6375('0x3a'),require(_0x6375('0x3b')));_0x3f7d9a[_0x6375('0x9')]('/api/sms/interactions',require(_0x6375('0x3c')));_0x3f7d9a[_0x6375('0x9')](_0x6375('0x3d'),require('./api/smsMessage'));_0x3f7d9a['use'](_0x6375('0x3e'),require(_0x6375('0x3f')));_0x3f7d9a[_0x6375('0x9')]('/api/openchannel/accounts',require(_0x6375('0x40')));_0x3f7d9a[_0x6375('0x9')](_0x6375('0x41'),require('./api/openchannelApplication'));_0x3f7d9a[_0x6375('0x9')](_0x6375('0x42'),require('./api/openchannelInteraction'));_0x3f7d9a[_0x6375('0x9')]('/api/openchannel/messages',require(_0x6375('0x43')));_0x3f7d9a[_0x6375('0x9')](_0x6375('0x44'),require(_0x6375('0x45')));_0x3f7d9a[_0x6375('0x9')](_0x6375('0x46'),require(_0x6375('0x47')));_0x3f7d9a[_0x6375('0x9')](_0x6375('0x48'),require(_0x6375('0x49')));_0x3f7d9a[_0x6375('0x9')](_0x6375('0x4a'),require('./api/chatApplication'));_0x3f7d9a[_0x6375('0x9')](_0x6375('0x4b'),require('./api/chatInteraction'));_0x3f7d9a['use'](_0x6375('0x4c'),require(_0x6375('0x4d')));_0x3f7d9a['use'](_0x6375('0x4e'),require(_0x6375('0x4f')));_0x3f7d9a[_0x6375('0x9')]('/api/chat/queues',require(_0x6375('0x50')));_0x3f7d9a[_0x6375('0x9')](_0x6375('0x51'),require(_0x6375('0x52')));_0x3f7d9a['use'](_0x6375('0x53'),require(_0x6375('0x54')));_0x3f7d9a['use'](_0x6375('0x55'),require(_0x6375('0x56')));_0x3f7d9a[_0x6375('0x9')](_0x6375('0x57'),require(_0x6375('0x58')));_0x3f7d9a[_0x6375('0x9')](_0x6375('0x59'),require('./api/cmHopper'));_0x3f7d9a[_0x6375('0x9')](_0x6375('0x5a'),require(_0x6375('0x5b')));_0x3f7d9a[_0x6375('0x9')](_0x6375('0x5c'),require(_0x6375('0x5d')));_0x3f7d9a['use']('/api/cm/hopper_history',require(_0x6375('0x5e')));_0x3f7d9a['use'](_0x6375('0x5f'),require(_0x6375('0x60')));_0x3f7d9a[_0x6375('0x9')](_0x6375('0x61'),require('./api/action'));_0x3f7d9a[_0x6375('0x9')](_0x6375('0x62'),require(_0x6375('0x63')));_0x3f7d9a[_0x6375('0x9')]('/api/canned_answers',require(_0x6375('0x64')));_0x3f7d9a[_0x6375('0x9')](_0x6375('0x65'),require(_0x6375('0x66')));_0x3f7d9a[_0x6375('0x9')](_0x6375('0x67'),require(_0x6375('0x68')));_0x3f7d9a['use'](_0x6375('0x69'),require(_0x6375('0x6a')));_0x3f7d9a[_0x6375('0x9')](_0x6375('0x6b'),require(_0x6375('0x6c')));_0x3f7d9a[_0x6375('0x9')]('/api/cdr',require(_0x6375('0x6d')));_0x3f7d9a['use'](_0x6375('0x6e'),require(_0x6375('0x6f')));_0x3f7d9a[_0x6375('0x9')]('/api/schedules',require(_0x6375('0x70')));_0x3f7d9a[_0x6375('0x9')](_0x6375('0x71'),require(_0x6375('0x72')));_0x3f7d9a[_0x6375('0x9')](_0x6375('0x73'),require(_0x6375('0x74')));_0x3f7d9a[_0x6375('0x9')](_0x6375('0x75'),require(_0x6375('0x76')));_0x3f7d9a[_0x6375('0x9')]('/api/cm_contact_has_items',require(_0x6375('0x77')));_0x3f7d9a[_0x6375('0x9')](_0x6375('0x78'),require('./api/cmHopperAdditionalPhone'));_0x3f7d9a['use']('/api/templates',require(_0x6375('0x79')));_0x3f7d9a[_0x6375('0x9')](_0x6375('0x7a'),require(_0x6375('0x7b')));_0x3f7d9a[_0x6375('0x9')](_0x6375('0x7c'),require('./api/variable'));_0x3f7d9a[_0x6375('0x9')](_0x6375('0x7d'),require('./api/integration'));_0x3f7d9a['use'](_0x6375('0x7e'),require(_0x6375('0x7f')));_0x3f7d9a[_0x6375('0x9')]('/api/analytics/custom_reports',require('./api/analyticCustomReport'));_0x3f7d9a['use']('/api/analytics/default_reports',require('./api/analyticDefaultReport'));_0x3f7d9a[_0x6375('0x9')](_0x6375('0x80'),require(_0x6375('0x81')));_0x3f7d9a[_0x6375('0x9')](_0x6375('0x82'),require('./api/analyticMetric'));_0x3f7d9a[_0x6375('0x9')](_0x6375('0x83'),require('./api/analyticFieldReport'));_0x3f7d9a[_0x6375('0x9')](_0x6375('0x84'),require(_0x6375('0x85')));_0x3f7d9a['use']('/api/integrations/salesforce/accounts',require(_0x6375('0x86')));_0x3f7d9a[_0x6375('0x9')](_0x6375('0x87'),require(_0x6375('0x88')));_0x3f7d9a[_0x6375('0x9')](_0x6375('0x89'),require(_0x6375('0x8a')));_0x3f7d9a[_0x6375('0x9')]('/api/integrations/sugarcrm/accounts',require(_0x6375('0x8b')));_0x3f7d9a['use'](_0x6375('0x8c'),require(_0x6375('0x8d')));_0x3f7d9a['use']('/api/integrations/sugarcrm/fields',require(_0x6375('0x8e')));_0x3f7d9a[_0x6375('0x9')](_0x6375('0x8f'),require('./api/intDeskAccount'));_0x3f7d9a[_0x6375('0x9')]('/api/integrations/desk/configurations',require('./api/intDeskConfiguration'));_0x3f7d9a['use'](_0x6375('0x90'),require(_0x6375('0x91')));_0x3f7d9a[_0x6375('0x9')]('/api/integrations/zoho/accounts',require('./api/intZohoAccount'));_0x3f7d9a['use'](_0x6375('0x92'),require(_0x6375('0x93')));_0x3f7d9a[_0x6375('0x9')](_0x6375('0x94'),require(_0x6375('0x95')));_0x3f7d9a['use'](_0x6375('0x96'),require(_0x6375('0x97')));_0x3f7d9a['use'](_0x6375('0x98'),require(_0x6375('0x99')));_0x3f7d9a[_0x6375('0x9')](_0x6375('0x9a'),require(_0x6375('0x9b')));_0x3f7d9a[_0x6375('0x9')](_0x6375('0x9c'),require(_0x6375('0x9d')));_0x3f7d9a[_0x6375('0x9')]('/api/integrations/freshdesk/configurations',require(_0x6375('0x9e')));_0x3f7d9a[_0x6375('0x9')](_0x6375('0x9f'),require(_0x6375('0xa0')));_0x3f7d9a['use']('/api/integrations/vtiger/accounts',require(_0x6375('0xa1')));_0x3f7d9a[_0x6375('0x9')](_0x6375('0xa2'),require(_0x6375('0xa3')));_0x3f7d9a['use'](_0x6375('0xa4'),require(_0x6375('0xa5')));_0x3f7d9a[_0x6375('0x9')](_0x6375('0xa6'),require(_0x6375('0xa7')));_0x3f7d9a[_0x6375('0x9')](_0x6375('0xa8'),require(_0x6375('0xa9')));_0x3f7d9a['use'](_0x6375('0xaa'),require('./api/intServicenowField'));_0x3f7d9a['use']('/api/integrations/dynamics365/accounts',require(_0x6375('0xab')));_0x3f7d9a[_0x6375('0x9')](_0x6375('0xac'),require(_0x6375('0xad')));_0x3f7d9a['use'](_0x6375('0xae'),require('./api/intDynamics365Field'));_0x3f7d9a[_0x6375('0x9')]('/api/integrations/freshsales/accounts',require(_0x6375('0xaf')));_0x3f7d9a[_0x6375('0x9')](_0x6375('0xb0'),require('./api/intFreshsalesConfiguration'));_0x3f7d9a['use'](_0x6375('0xb1'),require(_0x6375('0xb2')));_0x3f7d9a[_0x6375('0x9')](_0x6375('0xb3'),require(_0x6375('0xb4')));_0x3f7d9a[_0x6375('0x9')](_0x6375('0xb5'),require(_0x6375('0xb6')));_0x3f7d9a[_0x6375('0x9')](_0x6375('0xb7'),require(_0x6375('0xb8')));_0x3f7d9a[_0x6375('0x9')](_0x6375('0xb9'),require('./api/jscriptyAnswerReport'));_0x3f7d9a[_0x6375('0x9')](_0x6375('0xba'),require(_0x6375('0xbb')));_0x3f7d9a['use']('/api/jscripty/sessions/reports',require(_0x6375('0xbc')));_0x3f7d9a[_0x6375('0x9')](_0x6375('0xbd'),require(_0x6375('0xbe')));_0x3f7d9a[_0x6375('0x9')]('/api/square/reports',require(_0x6375('0xbf')));_0x3f7d9a[_0x6375('0x9')](_0x6375('0xc0'),require(_0x6375('0xc1')));_0x3f7d9a[_0x6375('0x9')](_0x6375('0xc2'),require(_0x6375('0xc3')));_0x3f7d9a[_0x6375('0x9')](_0x6375('0xc4'),require('./api/setting'));_0x3f7d9a[_0x6375('0x9')]('/api/square/odbc',require(_0x6375('0xc5')));_0x3f7d9a['use'](_0x6375('0xc6'),require(_0x6375('0xc7')));_0x3f7d9a[_0x6375('0x9')](_0x6375('0xc8'),require(_0x6375('0xc9')));_0x3f7d9a[_0x6375('0x9')](_0x6375('0xca'),require(_0x6375('0xcb')));_0x3f7d9a[_0x6375('0x9')](_0x6375('0xcc'),require(_0x6375('0xcd')));_0x3f7d9a[_0x6375('0x9')](_0x6375('0xce'),require(_0x6375('0xcf')));_0x3f7d9a['use'](_0x6375('0xd0'),require(_0x6375('0xd1')));_0x3f7d9a[_0x6375('0x9')](_0x6375('0xd2'),require(_0x6375('0xd3')));_0x3f7d9a['use']('/api/attachments',require('./api/attachment'));_0x3f7d9a['use'](_0x6375('0xd4'),require('./api/plugin'));_0x3f7d9a[_0x6375('0x9')](_0x6375('0xd5'),require('./api/mailTransferReport'));_0x3f7d9a['use'](_0x6375('0xd6'),require(_0x6375('0xd7')));_0x3f7d9a[_0x6375('0x9')](_0x6375('0xd8'),require(_0x6375('0xd9')));_0x3f7d9a[_0x6375('0x9')](_0x6375('0xda'),require(_0x6375('0xdb')));_0x3f7d9a['use'](_0x6375('0xdc'),require('./api/smsTransferReport'));_0x3f7d9a['use'](_0x6375('0xdd'),require(_0x6375('0xde')));_0x3f7d9a['use'](_0x6375('0xdf'),require(_0x6375('0xe0')));_0x3f7d9a[_0x6375('0x9')](_0x6375('0xe1'),require(_0x6375('0xe2')));_0x3f7d9a[_0x6375('0x9')](_0x6375('0xe3'),require('./api/userProfileSection'));_0x3f7d9a[_0x6375('0x9')]('/api/userProfile/resources',require(_0x6375('0xe4')));_0x3f7d9a['use'](_0x6375('0xe5'),require('./api/userNotification'));_0x3f7d9a[_0x6375('0x9')](_0x6375('0xe6'),require(_0x6375('0xe7')));_0x3f7d9a[_0x6375('0x9')](_0x6375('0xe8'),require('./api/whatsappApplication'));_0x3f7d9a[_0x6375('0x9')](_0x6375('0xe9'),require(_0x6375('0xea')));_0x3f7d9a['use'](_0x6375('0xeb'),require('./api/whatsappMessage'));_0x3f7d9a['use'](_0x6375('0xec'),require(_0x6375('0xed')));_0x3f7d9a[_0x6375('0x9')](_0x6375('0xee'),require(_0x6375('0xef')));_0x3f7d9a[_0x6375('0x9')](_0x6375('0xf0'),require(_0x6375('0xf1')));_0x3f7d9a['use'](_0x6375('0xf2'),require(_0x6375('0xf3')));_0x3f7d9a['use'](_0x6375('0xf4'),require(_0x6375('0xf5')));_0x3f7d9a[_0x6375('0x9')](_0x6375('0xf6'),require('./api/user-setting'));_0x3f7d9a['use'](_0x6375('0xf7'),require(_0x6375('0xf8')));_0x3f7d9a[_0x6375('0x9')](_0x6375('0xf9'),require(_0x6375('0xfa')));_0x3f7d9a['use'](_0x6375('0xfb'),require(_0x6375('0xfc')));_0x3f7d9a[_0x6375('0x9')]('/api/jira',require('./api/jira'));_0x3f7d9a['use'](_0x6375('0xfd'),require(_0x6375('0xfe')));_0x3f7d9a['use'](_0x6375('0xff'),require(_0x6375('0x100')));_0x3f7d9a['use']('/api/system',require('./api/system'));_0x3f7d9a[_0x6375('0x9')](_0x6375('0x101'),require(_0x6375('0x102')));_0x3f7d9a[_0x6375('0x9')]('/api/webbar',require(_0x6375('0x103')));_0x3f7d9a[_0x6375('0x9')](_0x6375('0x104'),clientSideLogs);_0x3f7d9a[_0x6375('0x9')]('/apidoc',express[_0x6375('0x105')](path['join'](config['root'],_0x6375('0x106'))));_0x3f7d9a[_0x6375('0x9')](_0x6375('0x107'),express['static'](path['join'](config['root'],_0x6375('0x107'))));_0x3f7d9a[_0x6375('0x9')]('/demo',express[_0x6375('0x105')](path['join'](config[_0x6375('0x108')],_0x6375('0x109'))));_0x3f7d9a[_0x6375('0x9')](_0x6375('0x10a'),express[_0x6375('0x105')](path['join'](config[_0x6375('0x108')],'snippet',_0x6375('0x10b'))));_0x3f7d9a['use'](_0x6375('0x10c'),express[_0x6375('0x105')](path[_0x6375('0x10d')](config['root'],_0x6375('0x10e'))));_0x3f7d9a[_0x6375('0x10f')](_0x6375('0x110'))['get'](errors[0x194]);_0x3f7d9a[_0x6375('0x10f')]('/*')[_0x6375('0x111')](function(_0x595040,_0x32d68c){_0x32d68c[_0x6375('0x112')](path['resolve'](_0x3f7d9a[_0x6375('0x111')](_0x6375('0x113'))+'/index.html'));});return _0x3f7d9a;});}; \ No newline at end of file +var _0x9f94=['/api/fax/accounts','./api/faxAccount','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueueReport','/api/sms/accounts','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','./api/smsMessage','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','/api/openchannel/interactions','./api/openchannelInteraction','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/offline_messages','./api/chatOfflineMessage','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopper','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','/api/cm/custom_fields','./api/cmCustomField','/api/actions','./api/action','/api/automations','/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/voiceQueuesLog','/api/schedules','./api/schedule','./api/sound','/api/tags','./api/tag','/api/contact_item_types','./api/contactItemType','/api/cm_contact_has_items','./api/cmContactHasItem','/api/cm_hopper_additional_phones','./api/cmHopperAdditionalPhone','/api/templates','./api/template','./api/trigger','/api/variables','./api/variable','/api/integrations','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','/api/integrations/freshdesk/fields','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','./api/network','/api/chat/reports/queue','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','./api/jscriptyQuestionReport','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','/api/square/odbc','./api/squareProject','./api/squareMessage','./api/team','./api/license','/api/campaigns','./api/campaign','./api/attachment','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','./api/faxTransferReport','./api/smsTransferReport','/api/cm/lists','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','/api/realtime','./api/realtime','/api/user-settings','/api/auth/local','./api/authLocal','/api/auth/google','/api/auth/activedirectory','./api/jira','/api/rpc','./api/rpc','/api/version','./api/version','./api/system','/api/pm2','/api/webbar','./api/webbar','/api/logs','/apidoc','static','join','root','/www','/demo','3.5.0','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','appPath','path','express','./errors','setupLoggers','./api/client-side-logs','default','then','/api/users','./api/user','use','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceCallReport','/api/voice/dials/reports','/api/voice/agents/reports','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','./api/mailAccount','/api/mail/queues','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','/api/mail/messages','./api/mailMessage','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','/api/dashboards/items','./api/dashboardItem'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x9f94,0x1e7));var _0x49f9=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x9f94[_0x20a584];return _0x4b41a8;};'use strict';var path=require(_0x49f9('0x0'));var express=require(_0x49f9('0x1'));var errors=require(_0x49f9('0x2'));var config=require('./config/environment');var setupLoggers=require('./utils/client-side-logger')[_0x49f9('0x3')];var clientSideLogs=require(_0x49f9('0x4'));exports[_0x49f9('0x5')]=function(_0x375856){return setupLoggers(_0x375856)[_0x49f9('0x6')](function(){_0x375856['use'](_0x49f9('0x7'),require(_0x49f9('0x8')));_0x375856[_0x49f9('0x9')](_0x49f9('0xa'),require(_0x49f9('0xb')));_0x375856[_0x49f9('0x9')](_0x49f9('0xc'),require(_0x49f9('0xd')));_0x375856['use']('/api/voice/extensions',require(_0x49f9('0xe')));_0x375856['use'](_0x49f9('0xf'),require(_0x49f9('0x10')));_0x375856[_0x49f9('0x9')]('/api/voice/queues',require(_0x49f9('0x11')));_0x375856['use'](_0x49f9('0x12'),require(_0x49f9('0x13')));_0x375856[_0x49f9('0x9')](_0x49f9('0x14'),require('./api/screenRecording'));_0x375856['use'](_0x49f9('0x15'),require(_0x49f9('0x16')));_0x375856[_0x49f9('0x9')](_0x49f9('0x17'),require('./api/voiceMailMessage'));_0x375856['use']('/api/voice/calls/reports',require(_0x49f9('0x18')));_0x375856['use'](_0x49f9('0x19'),require('./api/voiceDialReport'));_0x375856[_0x49f9('0x9')](_0x49f9('0x1a'),require('./api/voiceAgentReport'));_0x375856[_0x49f9('0x9')](_0x49f9('0x1b'),require(_0x49f9('0x1c')));_0x375856[_0x49f9('0x9')](_0x49f9('0x1d'),require(_0x49f9('0x1e')));_0x375856[_0x49f9('0x9')](_0x49f9('0x1f'),require(_0x49f9('0x20')));_0x375856[_0x49f9('0x9')](_0x49f9('0x21'),require(_0x49f9('0x22')));_0x375856[_0x49f9('0x9')](_0x49f9('0x23'),require(_0x49f9('0x24')));_0x375856['use']('/api/mail/accounts',require(_0x49f9('0x25')));_0x375856['use'](_0x49f9('0x26'),require('./api/mailQueue'));_0x375856['use'](_0x49f9('0x27'),require(_0x49f9('0x28')));_0x375856['use'](_0x49f9('0x29'),require('./api/mailInteraction'));_0x375856['use'](_0x49f9('0x2a'),require(_0x49f9('0x2b')));_0x375856['use'](_0x49f9('0x2c'),require(_0x49f9('0x2d')));_0x375856['use'](_0x49f9('0x2e'),require(_0x49f9('0x2f')));_0x375856[_0x49f9('0x9')](_0x49f9('0x30'),require('./api/dashboard'));_0x375856[_0x49f9('0x9')](_0x49f9('0x31'),require(_0x49f9('0x32')));_0x375856[_0x49f9('0x9')](_0x49f9('0x33'),require(_0x49f9('0x34')));_0x375856[_0x49f9('0x9')]('/api/fax/applications',require('./api/faxApplication'));_0x375856[_0x49f9('0x9')](_0x49f9('0x35'),require(_0x49f9('0x36')));_0x375856[_0x49f9('0x9')](_0x49f9('0x37'),require(_0x49f9('0x38')));_0x375856[_0x49f9('0x9')](_0x49f9('0x39'),require('./api/faxQueue'));_0x375856[_0x49f9('0x9')]('/api/fax/reports/queue',require(_0x49f9('0x3a')));_0x375856[_0x49f9('0x9')](_0x49f9('0x3b'),require('./api/smsAccount'));_0x375856[_0x49f9('0x9')](_0x49f9('0x3c'),require(_0x49f9('0x3d')));_0x375856[_0x49f9('0x9')](_0x49f9('0x3e'),require(_0x49f9('0x3f')));_0x375856[_0x49f9('0x9')](_0x49f9('0x40'),require(_0x49f9('0x41')));_0x375856[_0x49f9('0x9')](_0x49f9('0x42'),require(_0x49f9('0x43')));_0x375856[_0x49f9('0x9')](_0x49f9('0x44'),require(_0x49f9('0x45')));_0x375856[_0x49f9('0x9')](_0x49f9('0x46'),require('./api/openchannelApplication'));_0x375856[_0x49f9('0x9')](_0x49f9('0x47'),require(_0x49f9('0x48')));_0x375856[_0x49f9('0x9')]('/api/openchannel/messages',require('./api/openchannelMessage'));_0x375856[_0x49f9('0x9')]('/api/openchannel/queues',require(_0x49f9('0x49')));_0x375856[_0x49f9('0x9')](_0x49f9('0x4a'),require(_0x49f9('0x4b')));_0x375856[_0x49f9('0x9')](_0x49f9('0x4c'),require(_0x49f9('0x4d')));_0x375856['use'](_0x49f9('0x4e'),require(_0x49f9('0x4f')));_0x375856['use']('/api/chat/interactions',require('./api/chatInteraction'));_0x375856[_0x49f9('0x9')]('/api/chat/messages',require('./api/chatMessage'));_0x375856[_0x49f9('0x9')](_0x49f9('0x50'),require(_0x49f9('0x51')));_0x375856[_0x49f9('0x9')]('/api/chat/queues',require(_0x49f9('0x52')));_0x375856['use'](_0x49f9('0x53'),require(_0x49f9('0x54')));_0x375856[_0x49f9('0x9')](_0x49f9('0x55'),require(_0x49f9('0x56')));_0x375856[_0x49f9('0x9')]('/api/cm/companies',require('./api/cmCompany'));_0x375856[_0x49f9('0x9')](_0x49f9('0x57'),require(_0x49f9('0x58')));_0x375856['use'](_0x49f9('0x59'),require(_0x49f9('0x5a')));_0x375856['use']('/api/cm/hopper_black',require(_0x49f9('0x5b')));_0x375856[_0x49f9('0x9')](_0x49f9('0x5c'),require(_0x49f9('0x5d')));_0x375856['use'](_0x49f9('0x5e'),require('./api/cmHopperHistory'));_0x375856[_0x49f9('0x9')](_0x49f9('0x5f'),require(_0x49f9('0x60')));_0x375856[_0x49f9('0x9')](_0x49f9('0x61'),require(_0x49f9('0x62')));_0x375856[_0x49f9('0x9')](_0x49f9('0x63'),require('./api/automation'));_0x375856[_0x49f9('0x9')](_0x49f9('0x64'),require(_0x49f9('0x65')));_0x375856[_0x49f9('0x9')](_0x49f9('0x66'),require(_0x49f9('0x67')));_0x375856[_0x49f9('0x9')]('/api/conditions',require(_0x49f9('0x68')));_0x375856['use'](_0x49f9('0x69'),require(_0x49f9('0x6a')));_0x375856['use'](_0x49f9('0x6b'),require(_0x49f9('0x6c')));_0x375856['use'](_0x49f9('0x6d'),require(_0x49f9('0x6e')));_0x375856['use'](_0x49f9('0x6f'),require(_0x49f9('0x70')));_0x375856[_0x49f9('0x9')](_0x49f9('0x71'),require(_0x49f9('0x72')));_0x375856[_0x49f9('0x9')]('/api/sounds',require(_0x49f9('0x73')));_0x375856['use'](_0x49f9('0x74'),require(_0x49f9('0x75')));_0x375856['use'](_0x49f9('0x76'),require(_0x49f9('0x77')));_0x375856[_0x49f9('0x9')](_0x49f9('0x78'),require(_0x49f9('0x79')));_0x375856[_0x49f9('0x9')](_0x49f9('0x7a'),require(_0x49f9('0x7b')));_0x375856[_0x49f9('0x9')](_0x49f9('0x7c'),require(_0x49f9('0x7d')));_0x375856['use']('/api/triggers',require(_0x49f9('0x7e')));_0x375856[_0x49f9('0x9')](_0x49f9('0x7f'),require(_0x49f9('0x80')));_0x375856[_0x49f9('0x9')](_0x49f9('0x81'),require(_0x49f9('0x82')));_0x375856['use'](_0x49f9('0x83'),require(_0x49f9('0x84')));_0x375856[_0x49f9('0x9')](_0x49f9('0x85'),require(_0x49f9('0x86')));_0x375856['use']('/api/analytics/default_reports',require('./api/analyticDefaultReport'));_0x375856[_0x49f9('0x9')](_0x49f9('0x87'),require(_0x49f9('0x88')));_0x375856[_0x49f9('0x9')](_0x49f9('0x89'),require(_0x49f9('0x8a')));_0x375856['use'](_0x49f9('0x8b'),require('./api/analyticFieldReport'));_0x375856[_0x49f9('0x9')]('/api/analytics/tree_reports',require('./api/analyticTreeReport'));_0x375856[_0x49f9('0x9')]('/api/integrations/salesforce/accounts',require(_0x49f9('0x8c')));_0x375856[_0x49f9('0x9')](_0x49f9('0x8d'),require(_0x49f9('0x8e')));_0x375856[_0x49f9('0x9')](_0x49f9('0x8f'),require('./api/intSalesforceField'));_0x375856[_0x49f9('0x9')](_0x49f9('0x90'),require(_0x49f9('0x91')));_0x375856[_0x49f9('0x9')](_0x49f9('0x92'),require(_0x49f9('0x93')));_0x375856[_0x49f9('0x9')](_0x49f9('0x94'),require('./api/intSugarcrmField'));_0x375856[_0x49f9('0x9')]('/api/integrations/desk/accounts',require(_0x49f9('0x95')));_0x375856[_0x49f9('0x9')](_0x49f9('0x96'),require(_0x49f9('0x97')));_0x375856[_0x49f9('0x9')]('/api/integrations/desk/fields',require(_0x49f9('0x98')));_0x375856[_0x49f9('0x9')](_0x49f9('0x99'),require('./api/intZohoAccount'));_0x375856[_0x49f9('0x9')]('/api/integrations/zoho/configurations',require(_0x49f9('0x9a')));_0x375856[_0x49f9('0x9')](_0x49f9('0x9b'),require(_0x49f9('0x9c')));_0x375856['use'](_0x49f9('0x9d'),require('./api/intZendeskAccount'));_0x375856['use'](_0x49f9('0x9e'),require(_0x49f9('0x9f')));_0x375856[_0x49f9('0x9')](_0x49f9('0xa0'),require(_0x49f9('0xa1')));_0x375856[_0x49f9('0x9')](_0x49f9('0xa2'),require(_0x49f9('0xa3')));_0x375856[_0x49f9('0x9')](_0x49f9('0xa4'),require('./api/intFreshdeskConfiguration'));_0x375856[_0x49f9('0x9')](_0x49f9('0xa5'),require('./api/intFreshdeskField'));_0x375856[_0x49f9('0x9')](_0x49f9('0xa6'),require(_0x49f9('0xa7')));_0x375856[_0x49f9('0x9')](_0x49f9('0xa8'),require(_0x49f9('0xa9')));_0x375856['use'](_0x49f9('0xaa'),require(_0x49f9('0xab')));_0x375856[_0x49f9('0x9')](_0x49f9('0xac'),require(_0x49f9('0xad')));_0x375856[_0x49f9('0x9')](_0x49f9('0xae'),require(_0x49f9('0xaf')));_0x375856[_0x49f9('0x9')](_0x49f9('0xb0'),require(_0x49f9('0xb1')));_0x375856[_0x49f9('0x9')](_0x49f9('0xb2'),require(_0x49f9('0xb3')));_0x375856[_0x49f9('0x9')](_0x49f9('0xb4'),require(_0x49f9('0xb5')));_0x375856['use'](_0x49f9('0xb6'),require('./api/intDynamics365Field'));_0x375856['use'](_0x49f9('0xb7'),require(_0x49f9('0xb8')));_0x375856[_0x49f9('0x9')]('/api/integrations/freshsales/configurations',require('./api/intFreshsalesConfiguration'));_0x375856[_0x49f9('0x9')](_0x49f9('0xb9'),require(_0x49f9('0xba')));_0x375856['use'](_0x49f9('0xbb'),require(_0x49f9('0xbc')));_0x375856[_0x49f9('0x9')](_0x49f9('0xbd'),require('./api/chatQueueReport'));_0x375856[_0x49f9('0x9')]('/api/chat/internal/messages',require(_0x49f9('0xbe')));_0x375856[_0x49f9('0x9')](_0x49f9('0xbf'),require(_0x49f9('0xc0')));_0x375856[_0x49f9('0x9')]('/api/jscripty/questions/reports',require(_0x49f9('0xc1')));_0x375856[_0x49f9('0x9')]('/api/jscripty/sessions/reports',require(_0x49f9('0xc2')));_0x375856[_0x49f9('0x9')](_0x49f9('0xc3'),require(_0x49f9('0xc4')));_0x375856['use'](_0x49f9('0xc5'),require('./api/squareReport'));_0x375856[_0x49f9('0x9')](_0x49f9('0xc6'),require(_0x49f9('0xc7')));_0x375856[_0x49f9('0x9')](_0x49f9('0xc8'),require(_0x49f9('0xc9')));_0x375856[_0x49f9('0x9')](_0x49f9('0xca'),require('./api/setting'));_0x375856[_0x49f9('0x9')](_0x49f9('0xcb'),require('./api/squareOdbc'));_0x375856[_0x49f9('0x9')]('/api/square/projects',require(_0x49f9('0xcc')));_0x375856[_0x49f9('0x9')]('/api/square/recordings',require('./api/squareRecording'));_0x375856['use']('/api/square/messages',require(_0x49f9('0xcd')));_0x375856[_0x49f9('0x9')]('/api/teams',require(_0x49f9('0xce')));_0x375856['use']('/api/license',require(_0x49f9('0xcf')));_0x375856['use'](_0x49f9('0xd0'),require(_0x49f9('0xd1')));_0x375856['use']('/api/migrations',require('./api/migration'));_0x375856['use']('/api/attachments',require(_0x49f9('0xd2')));_0x375856[_0x49f9('0x9')]('/api/plugins',require(_0x49f9('0xd3')));_0x375856['use'](_0x49f9('0xd4'),require(_0x49f9('0xd5')));_0x375856[_0x49f9('0x9')]('/api/chat/reports/transfer',require('./api/chatTransferReport'));_0x375856[_0x49f9('0x9')]('/api/fax/reports/transfer',require(_0x49f9('0xd6')));_0x375856[_0x49f9('0x9')]('/api/openchannel/reports/transfer',require('./api/openchannelTransferReport'));_0x375856[_0x49f9('0x9')]('/api/sms/reports/transfer',require(_0x49f9('0xd7')));_0x375856[_0x49f9('0x9')](_0x49f9('0xd8'),require(_0x49f9('0xd9')));_0x375856['use'](_0x49f9('0xda'),require(_0x49f9('0xdb')));_0x375856[_0x49f9('0x9')](_0x49f9('0xdc'),require('./api/userProfile'));_0x375856[_0x49f9('0x9')](_0x49f9('0xdd'),require(_0x49f9('0xde')));_0x375856[_0x49f9('0x9')](_0x49f9('0xdf'),require('./api/userProfileResource'));_0x375856['use'](_0x49f9('0xe0'),require(_0x49f9('0xe1')));_0x375856[_0x49f9('0x9')](_0x49f9('0xe2'),require(_0x49f9('0xe3')));_0x375856[_0x49f9('0x9')](_0x49f9('0xe4'),require(_0x49f9('0xe5')));_0x375856[_0x49f9('0x9')]('/api/whatsapp/interactions',require('./api/whatsappInteraction'));_0x375856['use'](_0x49f9('0xe6'),require(_0x49f9('0xe7')));_0x375856['use'](_0x49f9('0xe8'),require('./api/whatsappQueueReport'));_0x375856['use'](_0x49f9('0xe9'),require(_0x49f9('0xea')));_0x375856[_0x49f9('0x9')](_0x49f9('0xeb'),require(_0x49f9('0xec')));_0x375856[_0x49f9('0x9')](_0x49f9('0xed'),require(_0x49f9('0xee')));_0x375856[_0x49f9('0x9')](_0x49f9('0xef'),require(_0x49f9('0xf0')));_0x375856[_0x49f9('0x9')](_0x49f9('0xf1'),require('./api/user-setting'));_0x375856[_0x49f9('0x9')](_0x49f9('0xf2'),require(_0x49f9('0xf3')));_0x375856[_0x49f9('0x9')](_0x49f9('0xf4'),require('./api/authGoogle'));_0x375856[_0x49f9('0x9')](_0x49f9('0xf5'),require('./api/authActiveDirectory'));_0x375856['use']('/api/jira',require(_0x49f9('0xf6')));_0x375856[_0x49f9('0x9')](_0x49f9('0xf7'),require(_0x49f9('0xf8')));_0x375856[_0x49f9('0x9')](_0x49f9('0xf9'),require(_0x49f9('0xfa')));_0x375856[_0x49f9('0x9')]('/api/system',require(_0x49f9('0xfb')));_0x375856['use'](_0x49f9('0xfc'),require('./api/pm2'));_0x375856['use'](_0x49f9('0xfd'),require(_0x49f9('0xfe')));_0x375856[_0x49f9('0x9')](_0x49f9('0xff'),clientSideLogs);_0x375856['use'](_0x49f9('0x100'),express[_0x49f9('0x101')](path['join'](config['root'],'/apidoc')));_0x375856['use']('/www',express[_0x49f9('0x101')](path[_0x49f9('0x102')](config[_0x49f9('0x103')],_0x49f9('0x104'))));_0x375856[_0x49f9('0x9')]('/demo',express[_0x49f9('0x101')](path[_0x49f9('0x102')](config[_0x49f9('0x103')],_0x49f9('0x105'))));_0x375856[_0x49f9('0x9')]('/snippet',express['static'](path[_0x49f9('0x102')](config['root'],'snippet',_0x49f9('0x106'))));_0x375856[_0x49f9('0x9')]('/plugins',express['static'](path[_0x49f9('0x102')](config[_0x49f9('0x103')],_0x49f9('0x107'))));_0x375856[_0x49f9('0x108')](_0x49f9('0x109'))[_0x49f9('0x10a')](errors[0x194]);_0x375856['route']('/*')[_0x49f9('0x10a')](function(_0x8b6230,_0x3fdc4c){_0x3fdc4c[_0x49f9('0x10b')](path['resolve'](_0x375856[_0x49f9('0x10a')](_0x49f9('0x10c'))+'/index.html'));});return _0x375856;});}; \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index e1aa943..13e6a1a 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2603=['default','RPC\x20listening\x20on\x20','../config/environment','listen','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','server','http','rpc','port','localhost','error','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers'];(function(_0x109b26,_0x3139b4){var _0x23e4d0=function(_0x8287af){while(--_0x8287af){_0x109b26['push'](_0x109b26['shift']());}};_0x23e4d0(++_0x3139b4);}(_0x2603,0x1ac));var _0x3260=function(_0x12e650,_0x33f29f){_0x12e650=_0x12e650-0x0;var _0x5b56b1=_0x2603[_0x12e650];return _0x5b56b1;};'use strict';var jayson=require('jayson/promise');var _=require('lodash');var config=require(_0x3260('0x0'));exports[_0x3260('0x1')]=function(){return new Promise(function(_0x4fe023,_0x391cdf){var _0xb34e46={};_0xb34e46=_[_0x3260('0x2')](_0xb34e46,require(_0x3260('0x3')));_0xb34e46=_[_0x3260('0x2')](_0xb34e46,require(_0x3260('0x4')));_0xb34e46=_['merge'](_0xb34e46,require('../api/voiceQueue/voiceQueue.rpc'));_0xb34e46=_[_0x3260('0x2')](_0xb34e46,require(_0x3260('0x5')));_0xb34e46=_[_0x3260('0x2')](_0xb34e46,require(_0x3260('0x6')));_0xb34e46=_[_0x3260('0x2')](_0xb34e46,require('../api/voiceDialReport/voiceDialReport.rpc'));_0xb34e46=_['merge'](_0xb34e46,require(_0x3260('0x7')));_0xb34e46=_['merge'](_0xb34e46,require(_0x3260('0x8')));_0xb34e46=_[_0x3260('0x2')](_0xb34e46,require('../api/memberReport/memberReport.rpc'));_0xb34e46=_[_0x3260('0x2')](_0xb34e46,require('../api/trunk/trunk.rpc'));_0xb34e46=_[_0x3260('0x2')](_0xb34e46,require(_0x3260('0x9')));_0xb34e46=_[_0x3260('0x2')](_0xb34e46,require(_0x3260('0xa')));_0xb34e46=_['merge'](_0xb34e46,require(_0x3260('0xb')));_0xb34e46=_[_0x3260('0x2')](_0xb34e46,require(_0x3260('0xc')));_0xb34e46=_[_0x3260('0x2')](_0xb34e46,require(_0x3260('0xd')));_0xb34e46=_[_0x3260('0x2')](_0xb34e46,require(_0x3260('0xe')));_0xb34e46=_['merge'](_0xb34e46,require(_0x3260('0xf')));_0xb34e46=_['merge'](_0xb34e46,require('../api/mailApplication/mailApplication.rpc'));_0xb34e46=_[_0x3260('0x2')](_0xb34e46,require(_0x3260('0x10')));_0xb34e46=_['merge'](_0xb34e46,require('../api/faxAccount/faxAccount.rpc'));_0xb34e46=_['merge'](_0xb34e46,require(_0x3260('0x11')));_0xb34e46=_[_0x3260('0x2')](_0xb34e46,require(_0x3260('0x12')));_0xb34e46=_['merge'](_0xb34e46,require(_0x3260('0x13')));_0xb34e46=_[_0x3260('0x2')](_0xb34e46,require(_0x3260('0x14')));_0xb34e46=_[_0x3260('0x2')](_0xb34e46,require(_0x3260('0x15')));_0xb34e46=_[_0x3260('0x2')](_0xb34e46,require(_0x3260('0x16')));_0xb34e46=_[_0x3260('0x2')](_0xb34e46,require(_0x3260('0x17')));_0xb34e46=_[_0x3260('0x2')](_0xb34e46,require(_0x3260('0x18')));_0xb34e46=_['merge'](_0xb34e46,require(_0x3260('0x19')));_0xb34e46=_[_0x3260('0x2')](_0xb34e46,require(_0x3260('0x1a')));_0xb34e46=_['merge'](_0xb34e46,require(_0x3260('0x1b')));_0xb34e46=_[_0x3260('0x2')](_0xb34e46,require(_0x3260('0x1c')));_0xb34e46=_[_0x3260('0x2')](_0xb34e46,require('../api/openchannelQueue/openchannelQueue.rpc'));_0xb34e46=_[_0x3260('0x2')](_0xb34e46,require(_0x3260('0x1d')));_0xb34e46=_[_0x3260('0x2')](_0xb34e46,require('../api/chatInteraction/chatInteraction.rpc'));_0xb34e46=_[_0x3260('0x2')](_0xb34e46,require('../api/chatMessage/chatMessage.rpc'));_0xb34e46=_[_0x3260('0x2')](_0xb34e46,require(_0x3260('0x1e')));_0xb34e46=_[_0x3260('0x2')](_0xb34e46,require(_0x3260('0x1f')));_0xb34e46=_[_0x3260('0x2')](_0xb34e46,require(_0x3260('0x20')));_0xb34e46=_[_0x3260('0x2')](_0xb34e46,require(_0x3260('0x21')));_0xb34e46=_['merge'](_0xb34e46,require(_0x3260('0x22')));_0xb34e46=_[_0x3260('0x2')](_0xb34e46,require(_0x3260('0x23')));_0xb34e46=_[_0x3260('0x2')](_0xb34e46,require(_0x3260('0x24')));_0xb34e46=_[_0x3260('0x2')](_0xb34e46,require(_0x3260('0x25')));_0xb34e46=_['merge'](_0xb34e46,require(_0x3260('0x26')));_0xb34e46=_[_0x3260('0x2')](_0xb34e46,require(_0x3260('0x27')));_0xb34e46=_[_0x3260('0x2')](_0xb34e46,require(_0x3260('0x28')));_0xb34e46=_[_0x3260('0x2')](_0xb34e46,require('../api/template/template.rpc'));_0xb34e46=_['merge'](_0xb34e46,require(_0x3260('0x29')));_0xb34e46=_['merge'](_0xb34e46,require(_0x3260('0x2a')));_0xb34e46=_[_0x3260('0x2')](_0xb34e46,require(_0x3260('0x2b')));_0xb34e46=_[_0x3260('0x2')](_0xb34e46,require(_0x3260('0x2c')));_0xb34e46=_['merge'](_0xb34e46,require(_0x3260('0x2d')));_0xb34e46=_[_0x3260('0x2')](_0xb34e46,require(_0x3260('0x2e')));_0xb34e46=_['merge'](_0xb34e46,require('../api/intZendeskAccount/intZendeskAccount.rpc'));_0xb34e46=_['merge'](_0xb34e46,require(_0x3260('0x2f')));_0xb34e46=_[_0x3260('0x2')](_0xb34e46,require('../api/intVtigerAccount/intVtigerAccount.rpc'));_0xb34e46=_['merge'](_0xb34e46,require(_0x3260('0x30')));_0xb34e46=_['merge'](_0xb34e46,require('../api/intDynamics365Account/intDynamics365Account.rpc'));_0xb34e46=_[_0x3260('0x2')](_0xb34e46,require('../api/intFreshsalesAccount/intFreshsalesAccount.rpc'));_0xb34e46=_['merge'](_0xb34e46,require(_0x3260('0x31')));_0xb34e46=_[_0x3260('0x2')](_0xb34e46,require(_0x3260('0x32')));_0xb34e46=_['merge'](_0xb34e46,require(_0x3260('0x33')));_0xb34e46=_[_0x3260('0x2')](_0xb34e46,require('../api/squareReportDetail/squareReportDetail.rpc'));_0xb34e46=_[_0x3260('0x2')](_0xb34e46,require('../api/setting/setting.rpc'));_0xb34e46=_[_0x3260('0x2')](_0xb34e46,require(_0x3260('0x34')));_0xb34e46=_['merge'](_0xb34e46,require(_0x3260('0x35')));_0xb34e46=_[_0x3260('0x2')](_0xb34e46,require('../api/squareRecording/squareRecording.rpc'));_0xb34e46=_[_0x3260('0x2')](_0xb34e46,require(_0x3260('0x36')));_0xb34e46=_[_0x3260('0x2')](_0xb34e46,require(_0x3260('0x37')));_0xb34e46=_['merge'](_0xb34e46,require(_0x3260('0x38')));_0xb34e46=_[_0x3260('0x2')](_0xb34e46,require(_0x3260('0x39')));_0xb34e46=_['merge'](_0xb34e46,require(_0x3260('0x3a')));_0xb34e46=_[_0x3260('0x2')](_0xb34e46,require('../api/whatsappInteraction/whatsappInteraction.rpc'));_0xb34e46=_[_0x3260('0x2')](_0xb34e46,require('../api/whatsappMessage/whatsappMessage.rpc'));_0xb34e46=_[_0x3260('0x2')](_0xb34e46,require(_0x3260('0x3b')));_0xb34e46=_[_0x3260('0x2')](_0xb34e46,require('../api/whatsappQueue/whatsappQueue.rpc'));var _0x51cb14=jayson[_0x3260('0x3c')](_0xb34e46)[_0x3260('0x3d')]();var _0x1a6bfa=config[_0x3260('0x3e')][_0x3260('0x3f')]||config[_0x3260('0x3f')]+0x1;var _0x3389b2=config[_0x3260('0x3e')]['ip']||_0x3260('0x40');_0x51cb14['on'](_0x3260('0x41'),function(_0x35ed33){return _0x391cdf(_0x35ed33);});_0x51cb14[_0x3260('0x1')](_0x1a6bfa,_0x3389b2,function(){console[_0x3260('0x42')](_0x3260('0x43'),_0x3389b2,_0x1a6bfa);require(_0x3260('0x44'))[_0x3260('0x45')]();return _0x4fe023(_0x3260('0x46')+_0x3389b2+':'+_0x1a6bfa);});});}; \ No newline at end of file +var _0x22e9=['../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueue/whatsappQueue.rpc','http','rpc','port','localhost','error','listen','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','RPC\x20listening\x20on\x20','jayson/promise','lodash','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x22e9,0x10e));var _0x922e=function(_0x4ff939,_0x5f54ea){_0x4ff939=_0x4ff939-0x0;var _0x3f8ba8=_0x22e9[_0x4ff939];return _0x3f8ba8;};'use strict';var jayson=require(_0x922e('0x0'));var _=require(_0x922e('0x1'));var config=require('../config/environment');exports['listen']=function(){return new Promise(function(_0x102b3b,_0x4ad6c8){var _0x1d8a6f={};_0x1d8a6f=_[_0x922e('0x2')](_0x1d8a6f,require(_0x922e('0x3')));_0x1d8a6f=_[_0x922e('0x2')](_0x1d8a6f,require(_0x922e('0x4')));_0x1d8a6f=_['merge'](_0x1d8a6f,require(_0x922e('0x5')));_0x1d8a6f=_[_0x922e('0x2')](_0x1d8a6f,require(_0x922e('0x6')));_0x1d8a6f=_[_0x922e('0x2')](_0x1d8a6f,require(_0x922e('0x7')));_0x1d8a6f=_[_0x922e('0x2')](_0x1d8a6f,require(_0x922e('0x8')));_0x1d8a6f=_[_0x922e('0x2')](_0x1d8a6f,require(_0x922e('0x9')));_0x1d8a6f=_[_0x922e('0x2')](_0x1d8a6f,require(_0x922e('0xa')));_0x1d8a6f=_['merge'](_0x1d8a6f,require(_0x922e('0xb')));_0x1d8a6f=_['merge'](_0x1d8a6f,require('../api/trunk/trunk.rpc'));_0x1d8a6f=_[_0x922e('0x2')](_0x1d8a6f,require(_0x922e('0xc')));_0x1d8a6f=_['merge'](_0x1d8a6f,require(_0x922e('0xd')));_0x1d8a6f=_[_0x922e('0x2')](_0x1d8a6f,require(_0x922e('0xe')));_0x1d8a6f=_[_0x922e('0x2')](_0x1d8a6f,require(_0x922e('0xf')));_0x1d8a6f=_[_0x922e('0x2')](_0x1d8a6f,require(_0x922e('0x10')));_0x1d8a6f=_[_0x922e('0x2')](_0x1d8a6f,require('../api/mailInteraction/mailInteraction.rpc'));_0x1d8a6f=_['merge'](_0x1d8a6f,require(_0x922e('0x11')));_0x1d8a6f=_[_0x922e('0x2')](_0x1d8a6f,require(_0x922e('0x12')));_0x1d8a6f=_['merge'](_0x1d8a6f,require(_0x922e('0x13')));_0x1d8a6f=_[_0x922e('0x2')](_0x1d8a6f,require(_0x922e('0x14')));_0x1d8a6f=_['merge'](_0x1d8a6f,require(_0x922e('0x15')));_0x1d8a6f=_[_0x922e('0x2')](_0x1d8a6f,require(_0x922e('0x16')));_0x1d8a6f=_[_0x922e('0x2')](_0x1d8a6f,require('../api/faxMessage/faxMessage.rpc'));_0x1d8a6f=_[_0x922e('0x2')](_0x1d8a6f,require(_0x922e('0x17')));_0x1d8a6f=_[_0x922e('0x2')](_0x1d8a6f,require(_0x922e('0x18')));_0x1d8a6f=_[_0x922e('0x2')](_0x1d8a6f,require(_0x922e('0x19')));_0x1d8a6f=_[_0x922e('0x2')](_0x1d8a6f,require(_0x922e('0x1a')));_0x1d8a6f=_['merge'](_0x1d8a6f,require(_0x922e('0x1b')));_0x1d8a6f=_['merge'](_0x1d8a6f,require(_0x922e('0x1c')));_0x1d8a6f=_[_0x922e('0x2')](_0x1d8a6f,require(_0x922e('0x1d')));_0x1d8a6f=_['merge'](_0x1d8a6f,require(_0x922e('0x1e')));_0x1d8a6f=_[_0x922e('0x2')](_0x1d8a6f,require(_0x922e('0x1f')));_0x1d8a6f=_[_0x922e('0x2')](_0x1d8a6f,require(_0x922e('0x20')));_0x1d8a6f=_[_0x922e('0x2')](_0x1d8a6f,require(_0x922e('0x21')));_0x1d8a6f=_[_0x922e('0x2')](_0x1d8a6f,require(_0x922e('0x22')));_0x1d8a6f=_[_0x922e('0x2')](_0x1d8a6f,require('../api/chatMessage/chatMessage.rpc'));_0x1d8a6f=_[_0x922e('0x2')](_0x1d8a6f,require(_0x922e('0x23')));_0x1d8a6f=_[_0x922e('0x2')](_0x1d8a6f,require(_0x922e('0x24')));_0x1d8a6f=_['merge'](_0x1d8a6f,require(_0x922e('0x25')));_0x1d8a6f=_[_0x922e('0x2')](_0x1d8a6f,require(_0x922e('0x26')));_0x1d8a6f=_[_0x922e('0x2')](_0x1d8a6f,require(_0x922e('0x27')));_0x1d8a6f=_[_0x922e('0x2')](_0x1d8a6f,require(_0x922e('0x28')));_0x1d8a6f=_[_0x922e('0x2')](_0x1d8a6f,require(_0x922e('0x29')));_0x1d8a6f=_[_0x922e('0x2')](_0x1d8a6f,require('../api/interval/interval.rpc'));_0x1d8a6f=_[_0x922e('0x2')](_0x1d8a6f,require(_0x922e('0x2a')));_0x1d8a6f=_[_0x922e('0x2')](_0x1d8a6f,require(_0x922e('0x2b')));_0x1d8a6f=_[_0x922e('0x2')](_0x1d8a6f,require(_0x922e('0x2c')));_0x1d8a6f=_[_0x922e('0x2')](_0x1d8a6f,require(_0x922e('0x2d')));_0x1d8a6f=_[_0x922e('0x2')](_0x1d8a6f,require(_0x922e('0x2e')));_0x1d8a6f=_[_0x922e('0x2')](_0x1d8a6f,require(_0x922e('0x2f')));_0x1d8a6f=_['merge'](_0x1d8a6f,require(_0x922e('0x30')));_0x1d8a6f=_[_0x922e('0x2')](_0x1d8a6f,require(_0x922e('0x31')));_0x1d8a6f=_[_0x922e('0x2')](_0x1d8a6f,require(_0x922e('0x32')));_0x1d8a6f=_[_0x922e('0x2')](_0x1d8a6f,require(_0x922e('0x33')));_0x1d8a6f=_[_0x922e('0x2')](_0x1d8a6f,require(_0x922e('0x34')));_0x1d8a6f=_[_0x922e('0x2')](_0x1d8a6f,require(_0x922e('0x35')));_0x1d8a6f=_[_0x922e('0x2')](_0x1d8a6f,require('../api/intVtigerAccount/intVtigerAccount.rpc'));_0x1d8a6f=_['merge'](_0x1d8a6f,require(_0x922e('0x36')));_0x1d8a6f=_[_0x922e('0x2')](_0x1d8a6f,require(_0x922e('0x37')));_0x1d8a6f=_[_0x922e('0x2')](_0x1d8a6f,require(_0x922e('0x38')));_0x1d8a6f=_[_0x922e('0x2')](_0x1d8a6f,require(_0x922e('0x39')));_0x1d8a6f=_[_0x922e('0x2')](_0x1d8a6f,require(_0x922e('0x3a')));_0x1d8a6f=_[_0x922e('0x2')](_0x1d8a6f,require(_0x922e('0x3b')));_0x1d8a6f=_[_0x922e('0x2')](_0x1d8a6f,require(_0x922e('0x3c')));_0x1d8a6f=_['merge'](_0x1d8a6f,require(_0x922e('0x3d')));_0x1d8a6f=_[_0x922e('0x2')](_0x1d8a6f,require('../api/squareOdbc/squareOdbc.rpc'));_0x1d8a6f=_[_0x922e('0x2')](_0x1d8a6f,require(_0x922e('0x3e')));_0x1d8a6f=_[_0x922e('0x2')](_0x1d8a6f,require(_0x922e('0x3f')));_0x1d8a6f=_[_0x922e('0x2')](_0x1d8a6f,require(_0x922e('0x40')));_0x1d8a6f=_[_0x922e('0x2')](_0x1d8a6f,require(_0x922e('0x41')));_0x1d8a6f=_[_0x922e('0x2')](_0x1d8a6f,require(_0x922e('0x42')));_0x1d8a6f=_[_0x922e('0x2')](_0x1d8a6f,require(_0x922e('0x43')));_0x1d8a6f=_['merge'](_0x1d8a6f,require(_0x922e('0x44')));_0x1d8a6f=_[_0x922e('0x2')](_0x1d8a6f,require(_0x922e('0x45')));_0x1d8a6f=_[_0x922e('0x2')](_0x1d8a6f,require(_0x922e('0x46')));_0x1d8a6f=_[_0x922e('0x2')](_0x1d8a6f,require('../api/whatsappQueueReport/whatsappQueueReport.rpc'));_0x1d8a6f=_[_0x922e('0x2')](_0x1d8a6f,require(_0x922e('0x47')));var _0x196a95=jayson['server'](_0x1d8a6f)[_0x922e('0x48')]();var _0x30c019=config[_0x922e('0x49')][_0x922e('0x4a')]||config['port']+0x1;var _0x21e89d=config[_0x922e('0x49')]['ip']||_0x922e('0x4b');_0x196a95['on'](_0x922e('0x4c'),function(_0x1a0b6e){return _0x4ad6c8(_0x1a0b6e);});_0x196a95[_0x922e('0x4d')](_0x30c019,_0x21e89d,function(){console[_0x922e('0x4e')](_0x922e('0x4f'),_0x21e89d,_0x30c019);require(_0x922e('0x50'))[_0x922e('0x51')]();return _0x102b3b(_0x922e('0x52')+_0x21e89d+':'+_0x30c019);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index abc2536..472d756 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 _0x8d63=['no\x20code','replace','result=','indexOf','substr','startsWith','split','length','error','E_AGI_SOCKET_ERROR','code','close','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','command','write','inherits','sendRequest','sync','answer','ANSWER','prototype','getData','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s','join','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20PRIORITY\x20%s','setVariable','isBoolean','isNumber','toString','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','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','AGI','wait','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','exports','util','lodash','events','EventEmitter','./error','call','utf8','setEncoding','headers','emit','line','toLowerCase','hangup','520-Invalid','520\x20End\x20of\x20proper','function','substring'];(function(_0x149ef4,_0x56cf46){var _0x8f0825=function(_0x53d8e2){while(--_0x53d8e2){_0x149ef4['push'](_0x149ef4['shift']());}};_0x8f0825(++_0x56cf46);}(_0x8d63,0xd9));var _0x38d6=function(_0x357301,_0x59dcf6){_0x357301=_0x357301-0x0;var _0x3cc84d=_0x8d63[_0x357301];return _0x3cc84d;};'use strict';var util=require(_0x38d6('0x0'));var _=require(_0x38d6('0x1'));var EventEmitter=require(_0x38d6('0x2'))[_0x38d6('0x3')];var AGIReply=require('./reply');var AGIError=require(_0x38d6('0x4'));function AGIChannel(_0x4d4642){var _0x4003cb=this,_0x1fda2c=new AGIReply(),_0x5554b1=![],_0x5a5172={};EventEmitter[_0x38d6('0x5')](_0x4003cb);_0x4d4642['setEncoding'](_0x38d6('0x6'));_0x4d4642['setTimeout'](0x8*0x3c*0x3c*0x3e8);_0x1fda2c[_0x38d6('0x7')](_0x38d6('0x6'));_0x1fda2c['on'](_0x38d6('0x8'),function(_0x1aeba8){for(var _0x2b6997 in _0x1aeba8){_0x4003cb[_0x2b6997]=_0x1aeba8[_0x2b6997];}_0x4003cb[_0x38d6('0x9')]('ready');});_0x1fda2c['on'](_0x38d6('0xa'),function(_0x464305){if(_0x464305[_0x38d6('0xb')]()==_0x38d6('0xc')){_0x4003cb[_0x38d6('0x9')](_0x38d6('0xc'));return;}if(_0x464305['substring'](0x0,0xb)==_0x38d6('0xd')){_0x5554b1=!![];}if(_0x5554b1){_0x5a5172['rx']+=_0x464305+'\x0a';if(_0x464305['search'](_0x38d6('0xe'))!=-0x1){_0x5554b1=![];}}else{_0x5a5172['rx']=_0x464305;}if(_0x5554b1){return;}if(typeof _0x5a5172['cb']==_0x38d6('0xf')){var _0x1561ce=_0x5a5172['rx'][_0x38d6('0x10')](0x0,0x3),_0x5369a6=null,_0x14bc04=null;_0x1561ce=parseInt(_0x1561ce);if(isNaN(_0x1561ce)){_0x5a5172['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x38d6('0x11')});return;}if(_0x1561ce!=0xc8){_0x5a5172['cb'](null,{'code':_0x1561ce,'result':-0x1,'extra':'KO'});return;}_0x5369a6=_0x5a5172['rx'][_0x38d6('0x10')](0x4)[_0x38d6('0x12')](_0x38d6('0x13'),'');if(_0x5369a6[_0x38d6('0x14')]('\x20')!=-0x1){_0x5369a6=_0x5369a6[_0x38d6('0x15')](0x0,_0x5369a6[_0x38d6('0x14')]('\x20'));}if(_[_0x38d6('0x16')](_0x5369a6,'-1')){_0x5369a6=parseInt(_0x5369a6);}_0x14bc04=_0x5a5172['rx'][_0x38d6('0x17')]('\x20');if(_0x14bc04[_0x38d6('0x18')]==0x3){_0x14bc04=_0x14bc04[0x2][_0x38d6('0x10')](0x1,_0x14bc04[0x2][_0x38d6('0x18')]-0x1);}else if(_0x14bc04['length']>0x3){var _0x16d65a=/\((.+)\)/;var _0x168934=_0x5a5172['rx']['match'](_0x16d65a);if(_0x168934){_0x14bc04=_0x168934[0x1];}else{_0x14bc04=null;}}else{_0x14bc04=null;}_0x5a5172['cb'](null,{'code':_0x1561ce,'result':_0x5369a6,'extra':_0x14bc04});}});_0x4d4642['on']('error',function(_0x47fa6d){_0x4003cb[_0x38d6('0x9')](_0x38d6('0x19'),new AGIError(_0x38d6('0x1a'),_0x47fa6d[_0x38d6('0x1b')]));});_0x4d4642['on'](_0x38d6('0x1c'),function(){_0x4003cb['emit']('close',new AGIError('E_AGI_SOCKET_CLOSE'));});_0x4d4642['on'](_0x38d6('0x1d'),function(){_0x4003cb[_0x38d6('0x9')](_0x38d6('0x1d'),new AGIError(_0x38d6('0x1e')));_0x4d4642[_0x38d6('0x1f')]();});_0x4d4642[_0x38d6('0x20')](_0x1fda2c);this[_0x38d6('0x21')]=function(_0x1edd18,_0x38cefb){var _0x1edd18=_0x1edd18||'',_0x38cefb=typeof _0x38cefb=='function'?_0x38cefb:new Function();_0x5a5172={'tx':_0x1edd18,'rx':'','cb':_0x38cefb};_0x4d4642[_0x38d6('0x22')](_0x1edd18+'\x0a');},this[_0x38d6('0x1c')]=function(){_0x4d4642[_0x38d6('0x1f')]();};}util[_0x38d6('0x23')](AGIChannel,EventEmitter);AGIChannel['prototype'][_0x38d6('0x24')]=function(_0x29cb7d){return this['command'][_0x38d6('0x25')](this,_0x29cb7d);};AGIChannel['prototype'][_0x38d6('0x26')]=function(){return this[_0x38d6('0x24')](_0x38d6('0x27'));};AGIChannel[_0x38d6('0x28')][_0x38d6('0x29')]=function(_0x29e626,_0x42dd26,_0xa93c3b){_0x29e626=_0x29e626===undefined?_0x38d6('0x2a'):_0x29e626;_0x42dd26=_0x42dd26===undefined?'5':_0x42dd26;_0xa93c3b=_0xa93c3b===undefined?'1':_0xa93c3b;return this[_0x38d6('0x24')](util[_0x38d6('0x2b')](_0x38d6('0x2c'),_0x29e626,_0x42dd26*0x3e8,_0xa93c3b));};AGIChannel[_0x38d6('0x28')][_0x38d6('0x2d')]=function(_0x30e530){_0x30e530=_0x30e530||'NO\x20MESSAGE';return this[_0x38d6('0x24')](util['format'](_0x38d6('0x2e'),_0x30e530));};AGIChannel[_0x38d6('0x28')][_0x38d6('0x2f')]=function(_0x4ffcc4,_0x122681){if(_[_0x38d6('0x30')](_0x122681)){return this[_0x38d6('0x24')](util[_0x38d6('0x2b')](_0x38d6('0x31'),_0x4ffcc4,_0x122681[_0x38d6('0x32')](',')));}return this[_0x38d6('0x24')](util[_0x38d6('0x2b')](_0x38d6('0x31'),_0x4ffcc4,_0x122681));};AGIChannel[_0x38d6('0x28')][_0x38d6('0x33')]=function(_0x2f8f74){return this[_0x38d6('0x24')](util[_0x38d6('0x2b')](_0x38d6('0x34'),_0x2f8f74));};AGIChannel[_0x38d6('0x28')][_0x38d6('0x35')]=function(_0x3e597f){return this[_0x38d6('0x24')](util[_0x38d6('0x2b')]('SET\x20EXTENSION\x20%s',_0x3e597f));};AGIChannel[_0x38d6('0x28')]['setPriority']=function(_0xf43032){return this[_0x38d6('0x24')](util[_0x38d6('0x2b')](_0x38d6('0x36'),_0xf43032));};AGIChannel[_0x38d6('0x28')][_0x38d6('0xc')]=function(){return this[_0x38d6('0x24')]('HANGUP');};AGIChannel[_0x38d6('0x28')][_0x38d6('0x37')]=function(_0x41f794,_0x51164e){var _0x45c23f=_[_0x38d6('0x38')](_0x51164e)||_[_0x38d6('0x39')](_0x51164e)?_0x51164e[_0x38d6('0x3a')]():_0x51164e;return this[_0x38d6('0x24')](util[_0x38d6('0x2b')]('SET\x20VARIABLE\x20%s\x20\x22%s\x22',_0x41f794,_0x45c23f?_0x45c23f[_0x38d6('0x3a')]()[_0x38d6('0x12')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x38d6('0x28')][_0x38d6('0x3b')]=function(_0x3f2e46,_0x4cd9d2){return this[_0x38d6('0x24')](util[_0x38d6('0x2b')]('SAY\x20NUMBER\x20%s\x20%s',_0x3f2e46,_0x4cd9d2));};AGIChannel[_0x38d6('0x28')][_0x38d6('0x3c')]=function(_0x1cbba5,_0x3778f9){return this[_0x38d6('0x24')](util[_0x38d6('0x2b')]('SAY\x20DIGITS\x20%s\x20%s',_0x1cbba5,_0x3778f9));};AGIChannel[_0x38d6('0x28')][_0x38d6('0x3d')]=function(_0x2ec02d,_0x5a3ff7){return this[_0x38d6('0x24')](util['format'](_0x38d6('0x3e'),_0x2ec02d,_0x5a3ff7));};AGIChannel[_0x38d6('0x28')][_0x38d6('0x3f')]=function(_0x4a6201,_0x269b42,_0x49ece2){_0x269b42=_0x269b42||this[_0x38d6('0x40')];_0x49ece2=_0x49ece2||0x1;this['setContext'](_0x4a6201);this['setExtension'](_0x269b42);this['setPriority'](_0x49ece2);return this['noop'](util['format'](_0x38d6('0x41'),_0x4a6201,_0x269b42,_0x49ece2));};AGIChannel[_0x38d6('0x28')][_0x38d6('0x42')]=function(_0x1cf4f6){return this[_0x38d6('0x24')](util[_0x38d6('0x2b')](_0x38d6('0x43'),_0x1cf4f6));};AGIChannel[_0x38d6('0x28')]['recordFile']=function(_0x443477,_0x464a41,_0x291c10,_0x48321d,_0x2ac3a4,_0x246d09){_0x464a41=_0x464a41||_0x38d6('0x44');_0x291c10=_0x291c10||'';_0x48321d=_0x48321d===undefined?-0x1:_0x48321d==='-1'?-0x1:_0x48321d*0x3e8;_0x2ac3a4=_0x2ac3a4===undefined?'':'s='+_0x2ac3a4;_0x246d09=_0x246d09?_0x38d6('0x45'):'';return this['sendRequest'](util[_0x38d6('0x2b')](_0x38d6('0x46'),_0x443477,_0x464a41,_0x291c10,_0x48321d,_0x246d09,_0x2ac3a4));};AGIChannel[_0x38d6('0x28')][_0x38d6('0x47')]=function(_0x56370c,_0x249747){_0x249747=_0x249747||'';return this[_0x38d6('0x24')](util[_0x38d6('0x2b')](_0x38d6('0x48'),_0x56370c,_0x249747));};AGIChannel[_0x38d6('0x28')][_0x38d6('0x49')]=function(_0x17503a){return this[_0x38d6('0x2f')](_0x38d6('0x4a'),_0x17503a);};AGIChannel['prototype'][_0x38d6('0x4b')]=function(_0xaf8fb8){return this[_0x38d6('0x2f')]('WAIT',_0xaf8fb8);};AGIChannel[_0x38d6('0x28')]['error']=function(_0x5bb54f,_0x53883a){this[_0x38d6('0x2d')](util['format'](_0x38d6('0x4c'),_0x5bb54f['id'],_0x5bb54f['label'],_0x53883a));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x38d6('0x4d')]=AGIChannel; \ No newline at end of file +var _0x71d5=['close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','write','inherits','sendRequest','command','prototype','answer','getData','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s','setContext','setExtension','setPriority','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isBoolean','isNumber','toString','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','GOTO\x20%s\x20%s\x20%s','getVariable','recordFile','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','exports','util','lodash','./reply','./error','call','setEncoding','setTimeout','utf8','headers','emit','ready','line','hangup','520-Invalid','520\x20End\x20of\x20proper','function','substring','no\x20code','replace','result=','indexOf','startsWith','split','length','match','error','E_AGI_SOCKET_ERROR'];(function(_0x193191,_0x108cfa){var _0x593a9e=function(_0x56c70b){while(--_0x56c70b){_0x193191['push'](_0x193191['shift']());}};_0x593a9e(++_0x108cfa);}(_0x71d5,0x109));var _0x571d=function(_0x1b1dff,_0x4c2de2){_0x1b1dff=_0x1b1dff-0x0;var _0x280d9d=_0x71d5[_0x1b1dff];return _0x280d9d;};'use strict';var util=require(_0x571d('0x0'));var _=require(_0x571d('0x1'));var EventEmitter=require('events')['EventEmitter'];var AGIReply=require(_0x571d('0x2'));var AGIError=require(_0x571d('0x3'));function AGIChannel(_0x99d7c1){var _0x35cc55=this,_0x342aea=new AGIReply(),_0x43309c=![],_0x249173={};EventEmitter[_0x571d('0x4')](_0x35cc55);_0x99d7c1[_0x571d('0x5')]('utf8');_0x99d7c1[_0x571d('0x6')](0x8*0x3c*0x3c*0x3e8);_0x342aea[_0x571d('0x5')](_0x571d('0x7'));_0x342aea['on'](_0x571d('0x8'),function(_0x18506e){for(var _0x2e8c89 in _0x18506e){_0x35cc55[_0x2e8c89]=_0x18506e[_0x2e8c89];}_0x35cc55[_0x571d('0x9')](_0x571d('0xa'));});_0x342aea['on'](_0x571d('0xb'),function(_0x1f564b){if(_0x1f564b['toLowerCase']()==_0x571d('0xc')){_0x35cc55[_0x571d('0x9')](_0x571d('0xc'));return;}if(_0x1f564b['substring'](0x0,0xb)==_0x571d('0xd')){_0x43309c=!![];}if(_0x43309c){_0x249173['rx']+=_0x1f564b+'\x0a';if(_0x1f564b['search'](_0x571d('0xe'))!=-0x1){_0x43309c=![];}}else{_0x249173['rx']=_0x1f564b;}if(_0x43309c){return;}if(typeof _0x249173['cb']==_0x571d('0xf')){var _0x1b8237=_0x249173['rx'][_0x571d('0x10')](0x0,0x3),_0x377392=null,_0x141828=null;_0x1b8237=parseInt(_0x1b8237);if(isNaN(_0x1b8237)){_0x249173['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x571d('0x11')});return;}if(_0x1b8237!=0xc8){_0x249173['cb'](null,{'code':_0x1b8237,'result':-0x1,'extra':'KO'});return;}_0x377392=_0x249173['rx'][_0x571d('0x10')](0x4)[_0x571d('0x12')](_0x571d('0x13'),'');if(_0x377392[_0x571d('0x14')]('\x20')!=-0x1){_0x377392=_0x377392['substr'](0x0,_0x377392[_0x571d('0x14')]('\x20'));}if(_[_0x571d('0x15')](_0x377392,'-1')){_0x377392=parseInt(_0x377392);}_0x141828=_0x249173['rx'][_0x571d('0x16')]('\x20');if(_0x141828[_0x571d('0x17')]==0x3){_0x141828=_0x141828[0x2][_0x571d('0x10')](0x1,_0x141828[0x2][_0x571d('0x17')]-0x1);}else if(_0x141828[_0x571d('0x17')]>0x3){var _0x49f2d6=/\((.+)\)/;var _0x70f187=_0x249173['rx'][_0x571d('0x18')](_0x49f2d6);if(_0x70f187){_0x141828=_0x70f187[0x1];}else{_0x141828=null;}}else{_0x141828=null;}_0x249173['cb'](null,{'code':_0x1b8237,'result':_0x377392,'extra':_0x141828});}});_0x99d7c1['on'](_0x571d('0x19'),function(_0x37b006){_0x35cc55['emit'](_0x571d('0x19'),new AGIError(_0x571d('0x1a'),_0x37b006['code']));});_0x99d7c1['on'](_0x571d('0x1b'),function(){_0x35cc55[_0x571d('0x9')](_0x571d('0x1b'),new AGIError(_0x571d('0x1c')));});_0x99d7c1['on'](_0x571d('0x1d'),function(){_0x35cc55[_0x571d('0x9')](_0x571d('0x1d'),new AGIError(_0x571d('0x1e')));_0x99d7c1[_0x571d('0x1f')]();});_0x99d7c1[_0x571d('0x20')](_0x342aea);this['command']=function(_0x595660,_0x5d710b){var _0x595660=_0x595660||'',_0x5d710b=typeof _0x5d710b=='function'?_0x5d710b:new Function();_0x249173={'tx':_0x595660,'rx':'','cb':_0x5d710b};_0x99d7c1[_0x571d('0x21')](_0x595660+'\x0a');},this['close']=function(){_0x99d7c1[_0x571d('0x1f')]();};}util[_0x571d('0x22')](AGIChannel,EventEmitter);AGIChannel['prototype'][_0x571d('0x23')]=function(_0x1daa30){return this[_0x571d('0x24')]['sync'](this,_0x1daa30);};AGIChannel[_0x571d('0x25')][_0x571d('0x26')]=function(){return this[_0x571d('0x23')]('ANSWER');};AGIChannel['prototype'][_0x571d('0x27')]=function(_0x53e5d1,_0x573b5e,_0x5cfdf6){_0x53e5d1=_0x53e5d1===undefined?_0x571d('0x28'):_0x53e5d1;_0x573b5e=_0x573b5e===undefined?'5':_0x573b5e;_0x5cfdf6=_0x5cfdf6===undefined?'1':_0x5cfdf6;return this[_0x571d('0x23')](util[_0x571d('0x29')](_0x571d('0x2a'),_0x53e5d1,_0x573b5e*0x3e8,_0x5cfdf6));};AGIChannel['prototype'][_0x571d('0x2b')]=function(_0x2a6764){_0x2a6764=_0x2a6764||_0x571d('0x2c');return this[_0x571d('0x23')](util['format'](_0x571d('0x2d'),_0x2a6764));};AGIChannel[_0x571d('0x25')][_0x571d('0x2e')]=function(_0x20dfdd,_0x529cb5){if(_[_0x571d('0x2f')](_0x529cb5)){return this[_0x571d('0x23')](util[_0x571d('0x29')](_0x571d('0x30'),_0x20dfdd,_0x529cb5['join'](',')));}return this[_0x571d('0x23')](util['format'](_0x571d('0x30'),_0x20dfdd,_0x529cb5));};AGIChannel[_0x571d('0x25')][_0x571d('0x31')]=function(_0x22e59e){return this[_0x571d('0x23')](util[_0x571d('0x29')]('SET\x20CONTEXT\x20%s',_0x22e59e));};AGIChannel[_0x571d('0x25')][_0x571d('0x32')]=function(_0x1f3d36){return this[_0x571d('0x23')](util[_0x571d('0x29')]('SET\x20EXTENSION\x20%s',_0x1f3d36));};AGIChannel[_0x571d('0x25')][_0x571d('0x33')]=function(_0x25e4a4){return this[_0x571d('0x23')](util[_0x571d('0x29')](_0x571d('0x34'),_0x25e4a4));};AGIChannel['prototype'][_0x571d('0xc')]=function(){return this['sendRequest'](_0x571d('0x35'));};AGIChannel[_0x571d('0x25')][_0x571d('0x36')]=function(_0x1bcbd0,_0x54cd21){var _0x3a447c=_[_0x571d('0x37')](_0x54cd21)||_[_0x571d('0x38')](_0x54cd21)?_0x54cd21['toString']():_0x54cd21;return this['sendRequest'](util[_0x571d('0x29')]('SET\x20VARIABLE\x20%s\x20\x22%s\x22',_0x1bcbd0,_0x3a447c?_0x3a447c[_0x571d('0x39')]()[_0x571d('0x12')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x571d('0x25')][_0x571d('0x3a')]=function(_0x44bd0d,_0x5041de){return this[_0x571d('0x23')](util['format'](_0x571d('0x3b'),_0x44bd0d,_0x5041de));};AGIChannel[_0x571d('0x25')][_0x571d('0x3c')]=function(_0x58cb55,_0x349b0c){return this[_0x571d('0x23')](util[_0x571d('0x29')]('SAY\x20DIGITS\x20%s\x20%s',_0x58cb55,_0x349b0c));};AGIChannel[_0x571d('0x25')][_0x571d('0x3d')]=function(_0x2b621e,_0x53fb1b){return this['sendRequest'](util[_0x571d('0x29')](_0x571d('0x3e'),_0x2b621e,_0x53fb1b));};AGIChannel[_0x571d('0x25')]['continueAt']=function(_0x325a77,_0x67ef44,_0x4db8fc){_0x67ef44=_0x67ef44||this['extension'];_0x4db8fc=_0x4db8fc||0x1;this['setContext'](_0x325a77);this[_0x571d('0x32')](_0x67ef44);this[_0x571d('0x33')](_0x4db8fc);return this[_0x571d('0x2b')](util[_0x571d('0x29')](_0x571d('0x3f'),_0x325a77,_0x67ef44,_0x4db8fc));};AGIChannel['prototype'][_0x571d('0x40')]=function(_0x286a42){return this['sendRequest'](util[_0x571d('0x29')]('GET\x20VARIABLE\x20\x22%s\x22',_0x286a42));};AGIChannel['prototype'][_0x571d('0x41')]=function(_0x3f83dc,_0x231026,_0x49b6dc,_0x39f2d6,_0x462306,_0x40cc91){_0x231026=_0x231026||'wav';_0x49b6dc=_0x49b6dc||'';_0x39f2d6=_0x39f2d6===undefined?-0x1:_0x39f2d6==='-1'?-0x1:_0x39f2d6*0x3e8;_0x462306=_0x462306===undefined?'':'s='+_0x462306;_0x40cc91=_0x40cc91?'BEEP':'';return this[_0x571d('0x23')](util['format']('RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s',_0x3f83dc,_0x231026,_0x49b6dc,_0x39f2d6,_0x40cc91,_0x462306));};AGIChannel['prototype'][_0x571d('0x42')]=function(_0x16aeb3,_0x4cdfba){_0x4cdfba=_0x4cdfba||'';return this[_0x571d('0x23')](util[_0x571d('0x29')](_0x571d('0x43'),_0x16aeb3,_0x4cdfba));};AGIChannel['prototype'][_0x571d('0x44')]=function(_0xa060d1){return this[_0x571d('0x2e')]('AGI',_0xa060d1);};AGIChannel[_0x571d('0x25')][_0x571d('0x45')]=function(_0x32568b){return this[_0x571d('0x2e')](_0x571d('0x46'),_0x32568b);};AGIChannel[_0x571d('0x25')][_0x571d('0x19')]=function(_0xb0d4de,_0x23dccf){this[_0x571d('0x2b')](util['format'](_0x571d('0x47'),_0xb0d4de['id'],_0xb0d4de['label'],_0x23dccf));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x571d('0x48')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index 4b7277e..fc480df 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 _0xcd41=['message','name','exports','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','format','apply'];(function(_0xb1ee0e,_0x2126df){var _0x376116=function(_0x44b7ad){while(--_0x44b7ad){_0xb1ee0e['push'](_0xb1ee0e['shift']());}};_0x376116(++_0x2126df);}(_0xcd41,0xa5));var _0x1cd4=function(_0x3320d3,_0x343207){_0x3320d3=_0x3320d3-0x0;var _0x412a73=_0xcd41[_0x3320d3];return _0x412a73;};'use strict';var util=require(_0x1cd4('0x0'));var error={'E_AGI_UNDEFINED':_0x1cd4('0x1'),'E_AGI_ARGUMENT_PORT':_0x1cd4('0x2'),'E_AGI_SERVER_ERROR':_0x1cd4('0x3'),'E_AGI_SERVER_CLOSE':'Server\x20closed.','E_AGI_SERVER_MAXCONNECTION':_0x1cd4('0x4'),'E_AGI_SERVER_VOICE_DISABLED':_0x1cd4('0x5'),'E_AGI_SOCKET_ERROR':_0x1cd4('0x6'),'E_AGI_SOCKET_CLOSE':_0x1cd4('0x7'),'E_AGI_SOCKET_TIMEOUT':_0x1cd4('0x8'),'E_AGI_COMMAND_EMPTY':_0x1cd4('0x9'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':'Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_IVR_ENTRY':_0x1cd4('0xa')};function AGIError(_0x4d1eb1){var _0x4d1eb1=_0x4d1eb1||null,_0x30de16=_0x30de16||[],_0x22285b=0x1,_0x4789ca='';if(!error[_0x4d1eb1]){_0x4d1eb1=_0x1cd4('0xb');}_0x30de16[_0x1cd4('0xc')](error[_0x4d1eb1]);while(arguments[_0x22285b]){_0x30de16[_0x1cd4('0xc')](arguments[_0x22285b]);_0x22285b++;}_0x4789ca=util[_0x1cd4('0xd')][_0x1cd4('0xe')](util,_0x30de16);this[_0x1cd4('0xf')]=_0x4789ca;this[_0x1cd4('0x10')]=_0x4d1eb1;}module[_0x1cd4('0x11')]=AGIError; \ No newline at end of file +var _0xfa8b=['message','name','exports','util','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.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','apply'];(function(_0x5b0da7,_0x52fc20){var _0x5075f1=function(_0x3c5429){while(--_0x3c5429){_0x5b0da7['push'](_0x5b0da7['shift']());}};_0x5075f1(++_0x52fc20);}(_0xfa8b,0x135));var _0xbfa8=function(_0x28e304,_0x56d96a){_0x28e304=_0x28e304-0x0;var _0x97f8b8=_0xfa8b[_0x28e304];return _0x97f8b8;};'use strict';var util=require(_0xbfa8('0x0'));var error={'E_AGI_UNDEFINED':'Undefined\x20error.','E_AGI_ARGUMENT_PORT':_0xbfa8('0x1'),'E_AGI_SERVER_ERROR':_0xbfa8('0x2'),'E_AGI_SERVER_CLOSE':_0xbfa8('0x3'),'E_AGI_SERVER_MAXCONNECTION':_0xbfa8('0x4'),'E_AGI_SERVER_VOICE_DISABLED':_0xbfa8('0x5'),'E_AGI_SOCKET_ERROR':_0xbfa8('0x6'),'E_AGI_SOCKET_CLOSE':_0xbfa8('0x7'),'E_AGI_SOCKET_TIMEOUT':_0xbfa8('0x8'),'E_AGI_COMMAND_EMPTY':_0xbfa8('0x9'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0xbfa8('0xa'),'E_AGI_IVR_ENTRY':_0xbfa8('0xb')};function AGIError(_0x13569c){var _0x13569c=_0x13569c||null,_0x156e14=_0x156e14||[],_0x471e7a=0x1,_0x11ba95='';if(!error[_0x13569c]){_0x13569c=_0xbfa8('0xc');}_0x156e14['push'](error[_0x13569c]);while(arguments[_0x471e7a]){_0x156e14[_0xbfa8('0xd')](arguments[_0x471e7a]);_0x471e7a++;}_0x11ba95=util['format'][_0xbfa8('0xe')](util,_0x156e14);this[_0xbfa8('0xf')]=_0x11ba95;this[_0xbfa8('0x10')]=_0x13569c;}module[_0xbfa8('0x11')]=AGIError; \ No newline at end of file diff --git a/server/services/agi/events.js b/server/services/agi/events.js index 309b99d..bfb7f45 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 _0x5d36=['localhost','subscribe','emit','error','E_AGI_SERVER_ERROR','message','agi','projectUpdate','exports','lodash','EventEmitter','ioredis','../../config/environment','redis','defaults'];(function(_0x169000,_0x2f694e){var _0x53cac6=function(_0x17ae6e){while(--_0x17ae6e){_0x169000['push'](_0x169000['shift']());}};_0x53cac6(++_0x2f694e);}(_0x5d36,0x180));var _0x65d3=function(_0x378487,_0x1fdc2c){_0x378487=_0x378487-0x0;var _0x3bb63b=_0x5d36[_0x378487];return _0x3bb63b;};'use strict';var _=require(_0x65d3('0x0'));var EventEmitter=require('events')[_0x65d3('0x1')];var Redis=require(_0x65d3('0x2'));var AGIError=require('./error');var config=require(_0x65d3('0x3'));config[_0x65d3('0x4')]=_[_0x65d3('0x5')](config['redis'],{'host':_0x65d3('0x6'),'port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0x65d3('0x4')]);sub[_0x65d3('0x7')]('agi',function(_0xa1c7ec){if(_0xa1c7ec)return eventEmitter[_0x65d3('0x8')](_0x65d3('0x9'),new AGIError(_0x65d3('0xa'),_0xa1c7ec));});sub['on'](_0x65d3('0xb'),function(_0x190d81,_0x53c562){if(_0x190d81!==_0x65d3('0xc'))return;try{var _0x21f7e7=JSON['parse'](_0x53c562);eventEmitter[_0x65d3('0x8')](_0x65d3('0xd'),_0x21f7e7);}catch(_0x1685db){eventEmitter[_0x65d3('0x8')](_0x65d3('0x9'),new AGIError(_0x65d3('0xa'),_0x1685db));}});module[_0x65d3('0xe')]={'EventEmitter':eventEmitter}; \ No newline at end of file +var _0xb969=['message','parse','emit','projectUpdate','error','lodash','events','EventEmitter','../../config/environment','redis','localhost','subscribe','agi','E_AGI_SERVER_ERROR'];(function(_0x2578dc,_0x1cc29f){var _0x6c6c9d=function(_0x27819d){while(--_0x27819d){_0x2578dc['push'](_0x2578dc['shift']());}};_0x6c6c9d(++_0x1cc29f);}(_0xb969,0x171));var _0x9b96=function(_0x6da70f,_0x4d05ce){_0x6da70f=_0x6da70f-0x0;var _0x95c51d=_0xb969[_0x6da70f];return _0x95c51d;};'use strict';var _=require(_0x9b96('0x0'));var EventEmitter=require(_0x9b96('0x1'))[_0x9b96('0x2')];var Redis=require('ioredis');var AGIError=require('./error');var config=require(_0x9b96('0x3'));config[_0x9b96('0x4')]=_['defaults'](config['redis'],{'host':_0x9b96('0x5'),'port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config['redis']);sub[_0x9b96('0x6')](_0x9b96('0x7'),function(_0x207cba){if(_0x207cba)return eventEmitter['emit']('error',new AGIError(_0x9b96('0x8'),_0x207cba));});sub['on'](_0x9b96('0x9'),function(_0x11197a,_0x2fd463){if(_0x11197a!==_0x9b96('0x7'))return;try{var _0x5bf8cb=JSON[_0x9b96('0xa')](_0x2fd463);eventEmitter[_0x9b96('0xb')](_0x9b96('0xc'),_0x5bf8cb);}catch(_0xcc30b2){eventEmitter[_0x9b96('0xb')](_0x9b96('0xd'),new AGIError(_0x9b96('0x8'),_0xcc30b2));}});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 705ca4b..e0753c7 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 _0xb381=['addVertex','addEdge','edges','push','numberOfEdges','size','getVertex','traverseBFS','info','length','condition','split','agicommand','vswitch','target','default','invalid','default\x20on\x20switch\x20not\x20found','includes','max\x20retry\x20reach','exports','lodash','../../../config/logger','menu','getdigits','getsecretdigits','vertices','prototype'];(function(_0x3ea196,_0x19f049){var _0xc8e6d3=function(_0x328cc5){while(--_0x328cc5){_0x3ea196['push'](_0x3ea196['shift']());}};_0xc8e6d3(++_0x19f049);}(_0xb381,0x19d));var _0x1b38=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0xb381[_0x298ed3];return _0x5aad28;};'use strict';var _=require(_0x1b38('0x0'));var logger=require(_0x1b38('0x1'))('agi');var verticesWithRetry=[_0x1b38('0x2'),_0x1b38('0x3'),_0x1b38('0x4')];var Graph=function(){this[_0x1b38('0x5')]={};this['edges']={};this['numberOfEdges']=0x0;};Graph[_0x1b38('0x6')][_0x1b38('0x7')]=function(_0xbd2e2d){this[_0x1b38('0x5')][_0xbd2e2d['id']]=_0xbd2e2d;this['edges'][_0xbd2e2d['id']]=[];};Graph[_0x1b38('0x6')][_0x1b38('0x8')]=function(_0x413fbc,_0x1f2b33,_0x445645){this[_0x1b38('0x9')][_0x413fbc][_0x1b38('0xa')]({'target':_0x1f2b33,'condition':_0x445645});this[_0x1b38('0xb')]+=0x1;};Graph[_0x1b38('0x6')]['size']=function(){return _[_0x1b38('0xc')](this['vertices']);};Graph[_0x1b38('0x6')]['relations']=function(){return this[_0x1b38('0xb')];};Graph[_0x1b38('0x6')][_0x1b38('0xd')]=function(_0x242395){return this[_0x1b38('0x5')][_0x242395];};Graph[_0x1b38('0x6')][_0x1b38('0xe')]=function(_0x1a39b5,_0x100e16){if(!this[_0x1b38('0x5')][_0x1a39b5]){return logger[_0x1b38('0xf')]('no\x20vertex\x20found');}var _0x58280a=_0x100e16(this[_0x1b38('0x5')][_0x1a39b5]);if(!_0x58280a){return logger[_0x1b38('0xf')]('stop\x20traverse');}if(this[_0x1b38('0x9')][_0x1a39b5][_0x1b38('0x10')]===0x0){return logger[_0x1b38('0xf')]('no\x20edge/s\x20available');}for(var _0x56e598=0x0,_0x96f5f1=[],_0x535d18=![];_0x56e598\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','dnid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','createSquareReport','then','catch','substring','debug','variables','stringify','callerid','close','timeout','handleNotFound','production','handleUnpublished','initialize','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','getAll','[LICENSE]','finally','./server'];(function(_0x242a4f,_0x369c57){var _0x122117=function(_0x55a797){while(--_0x55a797){_0x242a4f['push'](_0x242a4f['shift']());}};_0x122117(++_0x369c57);}(_0x2af4,0x1c9));var _0x42af=function(_0x3cb2c2,_0x1dca9c){_0x3cb2c2=_0x3cb2c2-0x0;var _0x1640cc=_0x2af4[_0x3cb2c2];return _0x1640cc;};'use strict';var _=require('lodash');var syncho=require(_0x42af('0x0'));var util=require(_0x42af('0x1'));var config=require(_0x42af('0x2'));var logger=require(_0x42af('0x3'))(_0x42af('0x4'));var utilLicense=require(_0x42af('0x5'));var rpc=require(_0x42af('0x6'));var Project=require('./project');var AGIEmitter=require(_0x42af('0x7'))['EventEmitter'];var projects=[];config['agi']=_[_0x42af('0x8')](config[_0x42af('0x4')],{'ip':_0x42af('0x9'),'port':0x11dd});AGIEmitter['on']('projectUpdate',projectUpdateHandler);function connectionHandler(_0x14b68e){process[_0x42af('0xa')](function(){syncho(function(){try{setChannelVariables(_0x14b68e);agiHandler(_0x14b68e);}catch(_0x368525){logger[_0x42af('0xb')](_0x368525['stack']);}});});}function projectUpdateHandler(_0x3a8709){try{var _0x5b162f=_[_0x42af('0xc')](projects,['id',_0x3a8709['id']]);if(_0x5b162f>-0x1){if(_0x3a8709[_0x42af('0xd')]===!![]){projects['splice'](_0x5b162f,0x1);}else{projects[_0x5b162f]=_0x3a8709;}}else{projects[_0x42af('0xe')](_0x3a8709);}}catch(_0x5da4c0){logger[_0x42af('0xb')](_0x5da4c0['stack']);}}function listeningHandler(){console[_0x42af('0xf')](_0x42af('0x10'),config[_0x42af('0x4')][_0x42af('0x11')]);logger[_0x42af('0x12')](util[_0x42af('0x13')](_0x42af('0x14'),config[_0x42af('0x4')]['ip'],config['agi'][_0x42af('0x11')]));}function errorHandler(_0x500b0d){if(_0x500b0d&&_0x500b0d[_0x42af('0x15')]&&_0x500b0d[_0x42af('0x16')]){logger['error'](util[_0x42af('0x13')](_0x42af('0x17'),_0x500b0d[_0x42af('0x15')],_0x500b0d['message']));}else{logger['error'](util[_0x42af('0x13')]('[ERROR]\x20%s',_0x500b0d[_0x42af('0x18')]));}}function closeHandler(){logger[_0x42af('0x12')](util[_0x42af('0x13')](_0x42af('0x19'),this['arg_1'],this[_0x42af('0x1a')],this['callerid'],this['dnid'],this[_0x42af('0x1b')]));try{createSquareReport(this);}catch(_0x4738ab){logger[_0x42af('0xb')](_0x4738ab[_0x42af('0x18')]);}}function timeoutHandler(){logger[_0x42af('0x12')](util[_0x42af('0x13')](_0x42af('0x1c'),this[_0x42af('0x1d')],this[_0x42af('0x1a')],this['callerid'],this[_0x42af('0x1e')],this[_0x42af('0x1b')]));}function hangupHandler(){logger['info'](util[_0x42af('0x13')](_0x42af('0x1f'),this[_0x42af('0x1d')],this['calleridname'],this['callerid'],this[_0x42af('0x1e')],this[_0x42af('0x1b')]));this[_0x42af('0x20')]=!![];}function createSquareReport(_0x5972b8,_0x39aea2){rpc[_0x42af('0x21')](_0x5972b8)[_0x42af('0x22')](function(_0x464419){if(_0x39aea2){_0x39aea2(null,_0x464419);}})[_0x42af('0x23')](function(_0x819903){if(_0x39aea2){_0x39aea2(null,_0x819903);}});}function setChannelVariables(_0x30b8ed){for(var _0x513e1d in _0x30b8ed){if(_0x30b8ed['hasOwnProperty'](_0x513e1d)){if(_0x513e1d['indexOf']('agi_')===0x0){_0x30b8ed[_0x513e1d[_0x42af('0x24')](0x4)]=_0x30b8ed[_0x513e1d];delete _0x30b8ed[_0x513e1d];}}}}function agiHandler(_0x3d11dc){logger[_0x42af('0x25')](_0x42af('0x26'),JSON[_0x42af('0x27')](_0x3d11dc,null,0x2));logger['info'](util['format']('[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x3d11dc[_0x42af('0x1d')],_0x3d11dc[_0x42af('0x1a')],_0x3d11dc[_0x42af('0x28')],_0x3d11dc['dnid'],_0x3d11dc[_0x42af('0x1b')]));_0x3d11dc['on'](_0x42af('0xb'),errorHandler);_0x3d11dc['on'](_0x42af('0x29'),closeHandler);_0x3d11dc['on'](_0x42af('0x2a'),timeoutHandler);_0x3d11dc[_0x42af('0x20')]=![];_0x3d11dc['on']('hangup',hangupHandler);var _0x58b189=_['find'](projects,['name',_0x3d11dc[_0x42af('0x1d')]]);if(!_0x58b189)return Project[_0x42af('0x2b')](_0x3d11dc);if(!_0x58b189[_0x42af('0x2c')])return Project[_0x42af('0x2d')](_0x3d11dc);return Project[_0x42af('0x2e')](_0x58b189,_0x3d11dc);}function main(){var _0x430132;return utilLicense['getLicense']()[_0x42af('0x22')](function(_0x29bd1e){if(!_0x29bd1e)return;if(_0x29bd1e[_0x42af('0x2f')]){if(_0x29bd1e[_0x42af('0x30')]&&_0x29bd1e[_0x42af('0x30')]>0x0){logger['info'](util['format'](_0x42af('0x31'),_0x29bd1e['callysquare']));_0x430132=_0x29bd1e[_0x42af('0x30')];}else{logger[_0x42af('0x12')](_0x42af('0x32'));}}else{logger[_0x42af('0x12')](_0x42af('0x33'));_0x430132=-0x1;}})[_0x42af('0x22')](function(){return Project[_0x42af('0x34')]();})[_0x42af('0x22')](function(_0x5c1813){projects=_0x5c1813;return;})[_0x42af('0x23')](function(_0x5ee641){logger[_0x42af('0xb')](_0x42af('0x35'),_0x5ee641['stack']);})[_0x42af('0x36')](function(){var _0x474518=require(_0x42af('0x37'))(config[_0x42af('0x4')]['port'],config[_0x42af('0x4')]['ip'],_0x430132);_0x474518['on'](_0x42af('0xb'),errorHandler);_0x474518['on']('listening',listeningHandler);_0x474518['on'](_0x42af('0x38'),connectionHandler);_0x474518['on']('close',closeHandler);});}main(); \ No newline at end of file +var _0x2387=['initialize','then','voice','callysquare','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','getAll','[LICENSE]','connection','close','lodash','syncho','util','../../config/environment','../../config/logger','agi','../../config/license/util','./rpc','./project','./events','defaults','127.0.0.1','projectUpdate','nextTick','error','stack','findIndex','deleted','push','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','port','name','message','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','dnid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','uniqueid','evtHangup','createSquareReport','hasOwnProperty','indexOf','agi_','substring','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','hangup','find','handleNotFound','production','handleUnpublished'];(function(_0x379396,_0x4353ae){var _0x391ba7=function(_0x5f5812){while(--_0x5f5812){_0x379396['push'](_0x379396['shift']());}};_0x391ba7(++_0x4353ae);}(_0x2387,0xf6));var _0x7238=function(_0x1d5928,_0x2eeeac){_0x1d5928=_0x1d5928-0x0;var _0xaef838=_0x2387[_0x1d5928];return _0xaef838;};'use strict';var _=require(_0x7238('0x0'));var syncho=require(_0x7238('0x1'));var util=require(_0x7238('0x2'));var config=require(_0x7238('0x3'));var logger=require(_0x7238('0x4'))(_0x7238('0x5'));var utilLicense=require(_0x7238('0x6'));var rpc=require(_0x7238('0x7'));var Project=require(_0x7238('0x8'));var AGIEmitter=require(_0x7238('0x9'))['EventEmitter'];var projects=[];config[_0x7238('0x5')]=_[_0x7238('0xa')](config[_0x7238('0x5')],{'ip':_0x7238('0xb'),'port':0x11dd});AGIEmitter['on'](_0x7238('0xc'),projectUpdateHandler);function connectionHandler(_0x3cab80){process[_0x7238('0xd')](function(){syncho(function(){try{setChannelVariables(_0x3cab80);agiHandler(_0x3cab80);}catch(_0x15ff13){logger[_0x7238('0xe')](_0x15ff13[_0x7238('0xf')]);}});});}function projectUpdateHandler(_0x515b40){try{var _0x422efd=_[_0x7238('0x10')](projects,['id',_0x515b40['id']]);if(_0x422efd>-0x1){if(_0x515b40[_0x7238('0x11')]===!![]){projects['splice'](_0x422efd,0x1);}else{projects[_0x422efd]=_0x515b40;}}else{projects[_0x7238('0x12')](_0x515b40);}}catch(_0x5a8db4){logger[_0x7238('0xe')](_0x5a8db4['stack']);}}function listeningHandler(){console[_0x7238('0x13')](_0x7238('0x14'),config[_0x7238('0x5')]['port']);logger[_0x7238('0x15')](util[_0x7238('0x16')](_0x7238('0x17'),config[_0x7238('0x5')]['ip'],config[_0x7238('0x5')][_0x7238('0x18')]));}function errorHandler(_0xcae1){if(_0xcae1&&_0xcae1[_0x7238('0x19')]&&_0xcae1[_0x7238('0x1a')]){logger[_0x7238('0xe')](util[_0x7238('0x16')]('[%s]\x20%s',_0xcae1[_0x7238('0x19')],_0xcae1['message']));}else{logger[_0x7238('0xe')](util[_0x7238('0x16')]('[ERROR]\x20%s',_0xcae1[_0x7238('0xf')]));}}function closeHandler(){logger[_0x7238('0x15')](util['format'](_0x7238('0x1b'),this[_0x7238('0x1c')],this[_0x7238('0x1d')],this[_0x7238('0x1e')],this[_0x7238('0x1f')],this['uniqueid']));try{createSquareReport(this);}catch(_0x5b9d89){logger[_0x7238('0xe')](_0x5b9d89['stack']);}}function timeoutHandler(){logger[_0x7238('0x15')](util[_0x7238('0x16')](_0x7238('0x20'),this[_0x7238('0x1c')],this['calleridname'],this['callerid'],this[_0x7238('0x1f')],this['uniqueid']));}function hangupHandler(){logger[_0x7238('0x15')](util[_0x7238('0x16')](_0x7238('0x21'),this[_0x7238('0x1c')],this['calleridname'],this[_0x7238('0x1e')],this[_0x7238('0x1f')],this[_0x7238('0x22')]));this[_0x7238('0x23')]=!![];}function createSquareReport(_0x41bdd4,_0x3b33dd){rpc[_0x7238('0x24')](_0x41bdd4)['then'](function(_0x2a305d){if(_0x3b33dd){_0x3b33dd(null,_0x2a305d);}})['catch'](function(_0x375dcd){if(_0x3b33dd){_0x3b33dd(null,_0x375dcd);}});}function setChannelVariables(_0x11f6e6){for(var _0x55fcb9 in _0x11f6e6){if(_0x11f6e6[_0x7238('0x25')](_0x55fcb9)){if(_0x55fcb9[_0x7238('0x26')](_0x7238('0x27'))===0x0){_0x11f6e6[_0x55fcb9[_0x7238('0x28')](0x4)]=_0x11f6e6[_0x55fcb9];delete _0x11f6e6[_0x55fcb9];}}}}function agiHandler(_0x4ff8fa){logger['debug'](_0x7238('0x29'),JSON[_0x7238('0x2a')](_0x4ff8fa,null,0x2));logger[_0x7238('0x15')](util[_0x7238('0x16')](_0x7238('0x2b'),_0x4ff8fa[_0x7238('0x1c')],_0x4ff8fa[_0x7238('0x1d')],_0x4ff8fa[_0x7238('0x1e')],_0x4ff8fa[_0x7238('0x1f')],_0x4ff8fa[_0x7238('0x22')]));_0x4ff8fa['on'](_0x7238('0xe'),errorHandler);_0x4ff8fa['on']('close',closeHandler);_0x4ff8fa['on']('timeout',timeoutHandler);_0x4ff8fa[_0x7238('0x23')]=![];_0x4ff8fa['on'](_0x7238('0x2c'),hangupHandler);var _0x7cd91b=_[_0x7238('0x2d')](projects,[_0x7238('0x19'),_0x4ff8fa[_0x7238('0x1c')]]);if(!_0x7cd91b)return Project[_0x7238('0x2e')](_0x4ff8fa);if(!_0x7cd91b[_0x7238('0x2f')])return Project[_0x7238('0x30')](_0x4ff8fa);return Project[_0x7238('0x31')](_0x7cd91b,_0x4ff8fa);}function main(){var _0x39807f;return utilLicense['getLicense']()[_0x7238('0x32')](function(_0x113d82){if(!_0x113d82)return;if(_0x113d82[_0x7238('0x33')]){if(_0x113d82[_0x7238('0x34')]&&_0x113d82[_0x7238('0x34')]>0x0){logger[_0x7238('0x15')](util[_0x7238('0x16')]('[LICENSE]\x20CHANNELS:\x20%s',_0x113d82[_0x7238('0x34')]));_0x39807f=_0x113d82['callysquare'];}else{logger[_0x7238('0x15')](_0x7238('0x35'));}}else{logger['info'](_0x7238('0x36'));_0x39807f=-0x1;}})[_0x7238('0x32')](function(){return Project[_0x7238('0x37')]();})['then'](function(_0x275aa3){projects=_0x275aa3;return;})['catch'](function(_0x293f3f){logger['error'](_0x7238('0x38'),_0x293f3f['stack']);})['finally'](function(){var _0x3a087e=require('./server')(config['agi'][_0x7238('0x18')],config[_0x7238('0x5')]['ip'],_0x39807f);_0x3a087e['on'](_0x7238('0xe'),errorHandler);_0x3a087e['on']('listening',listeningHandler);_0x3a087e['on'](_0x7238('0x39'),connectionHandler);_0x3a087e['on'](_0x7238('0x3a'),closeHandler);});}main(); \ No newline at end of file diff --git a/server/services/agi/mailRpc/index.js b/server/services/agi/mailRpc/index.js index da0f9e2..dd85df4 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 _0xa4c1=['then','error','message','result','catch','SendMail','bluebird','jayson/promise','client','http','request'];(function(_0x2134b7,_0x1eb5e2){var _0x6c5914=function(_0x1da201){while(--_0x1da201){_0x2134b7['push'](_0x2134b7['shift']());}};_0x6c5914(++_0x1eb5e2);}(_0xa4c1,0x12f));var _0x1a4c=function(_0x50e0b4,_0x1057f7){_0x50e0b4=_0x50e0b4-0x0;var _0x2fa8b0=_0xa4c1[_0x50e0b4];return _0x2fa8b0;};'use strict';var BPromise=require(_0x1a4c('0x0'));var jayson=require(_0x1a4c('0x1'));var client=jayson[_0x1a4c('0x2')][_0x1a4c('0x3')]({'port':0x232b});function request(_0x5bd10d,_0x3ac6f6){return new BPromise(function(_0x35c5b6,_0x4e01ce){return client[_0x1a4c('0x4')](_0x5bd10d,_0x3ac6f6)[_0x1a4c('0x5')](function(_0x91910e){if(_0x91910e[_0x1a4c('0x6')]){return _0x4e01ce(_0x91910e['error'][_0x1a4c('0x7')]);}else{return _0x35c5b6(_0x91910e[_0x1a4c('0x8')]);}})[_0x1a4c('0x9')](function(_0x1191e5){return _0x4e01ce(_0x1191e5);});});}exports['sendMailMessage']=function(_0x325f6f,_0x23353b){return request(_0x1a4c('0xa'),{'account':_0x325f6f,'message':_0x23353b});}; \ No newline at end of file +var _0x2bae=['SendMail','bluebird','jayson/promise','request','then','error','message','result','catch','sendMailMessage'];(function(_0x755816,_0x417c18){var _0x97892e=function(_0x26dc10){while(--_0x26dc10){_0x755816['push'](_0x755816['shift']());}};_0x97892e(++_0x417c18);}(_0x2bae,0x141));var _0xe2ba=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2bae[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require(_0xe2ba('0x0'));var jayson=require(_0xe2ba('0x1'));var client=jayson['client']['http']({'port':0x232b});function request(_0x3f09c3,_0x468536){return new BPromise(function(_0x301a9e,_0x146f35){return client[_0xe2ba('0x2')](_0x3f09c3,_0x468536)[_0xe2ba('0x3')](function(_0x13edde){if(_0x13edde[_0xe2ba('0x4')]){return _0x146f35(_0x13edde[_0xe2ba('0x4')][_0xe2ba('0x5')]);}else{return _0x301a9e(_0x13edde[_0xe2ba('0x6')]);}})[_0xe2ba('0x7')](function(_0x4fd9d7){return _0x146f35(_0x4fd9d7);});});}exports[_0xe2ba('0x8')]=function(_0x1d1c5a,_0x2f4e48){return request(_0xe2ba('0x9'),{'account':_0x1d1c5a,'message':_0x2f4e48});}; \ No newline at end of file diff --git a/server/services/agi/project.js b/server/services/agi/project.js index a093931..fc63cc0 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 _0x0f1b=['catch','error','Unable\x20to\x20download\x20CallySquare\x20projects','stack','agicommand','hasOwnProperty','retry','maxRetry','omit','mxCell','length','target','addEdge','source','value','root','start','debug','stringify','joinAt','format','YYYY-MM-DD\x20HH:mm:ss','info','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','dnid','uniqueid','clear','gotoc','context','extension','priority','response','code','result','evtHangup','isUndefined','agicommand\x20not\x20found','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','vertex','toString','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','close','Project\x20%s\x20not\x20found','continueAt','Project\x20%s\x20not\x20published','exports','lodash','util','../../config/logger','agi','./rpc','./mailRpc','./graph','getSquareProjects'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x0f1b,0x15a));var _0xb0f1=function(_0x24f31b,_0x44b8f3){_0x24f31b=_0x24f31b-0x0;var _0x488401=_0x0f1b[_0x24f31b];return _0x488401;};'use strict';var _=require(_0xb0f1('0x0'));var moment=require('moment');var parser=require('xml2json');var util=require(_0xb0f1('0x1'));var logger=require(_0xb0f1('0x2'))(_0xb0f1('0x3'));var rpc=require(_0xb0f1('0x4'));var mailRpc=require(_0xb0f1('0x5'));var Graph=require(_0xb0f1('0x6'));var Vertices=require('./vertices');var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0xb0f1('0x7')]()[_0xb0f1('0x8')](function(_0xd4201e){logger[_0xb0f1('0x9')](_0xb0f1('0xa'),_0xd4201e[_0xb0f1('0xb')]);return[];});}function addVertex(_0x5a6fec,_0x1abd51,_0x376c33){_0x1abd51[_0xb0f1('0xc')]=_0x376c33;if(_0x1abd51[_0xb0f1('0xd')](_0xb0f1('0xe'))){_0x1abd51[_0xb0f1('0xf')]=parseInt(_0x1abd51['retry'],0xa);}_0x5a6fec['addVertex'](_[_0xb0f1('0x10')](_0x1abd51,_0xb0f1('0x11')));}function initGraph(_0x3c7b90,_0x36eb03){var _0x323e36=new Graph();for(var _0x329909 in _0x3c7b90){if(_0x3c7b90[_0xb0f1('0xd')](_0x329909)){if(_['isArray'](_0x3c7b90[_0x329909])){for(var _0x4980fd=0x0;_0x4980fd<_0x3c7b90[_0x329909][_0xb0f1('0x12')];_0x4980fd+=0x1){addVertex(_0x323e36,_0x3c7b90[_0x329909][_0x4980fd],_0x329909);}}else{addVertex(_0x323e36,_0x3c7b90[_0x329909],_0x329909);}}}for(var _0x3c3c4e=0x0;_0x3c3c4e<_0x36eb03[_0xb0f1('0x12')];_0x3c3c4e+=0x1){if(_0x36eb03[_0x3c3c4e]['source']&&_0x36eb03[_0x3c3c4e][_0xb0f1('0x13')]){_0x323e36[_0xb0f1('0x14')](_0x36eb03[_0x3c3c4e][_0xb0f1('0x15')],_0x36eb03[_0x3c3c4e]['target'],_0x36eb03[_0x3c3c4e][_0xb0f1('0x16')]);}}return _0x323e36;}function getRoot(_0x4af65f){return parser['toJson'](_0x4af65f,{'object':!![]})['mxGraphModel'][_0xb0f1('0x17')];}function inspect(_0x3f950f){return util['inspect'](_0x3f950f,{'showHidden':![],'depth':null});}function initialize(_0x5984ed,_0x4515a1){var _0x13afba=getRoot(_0x5984ed['production']);if(!_0x13afba||!_0x13afba[_0xb0f1('0x18')])return;var _0x38e4fe,_0x294190,_0x32b3f6;logger[_0xb0f1('0x19')](_0xb0f1('0x17'),JSON[_0xb0f1('0x1a')](_0x13afba,null,0x2));_0x4515a1[_0xb0f1('0x1b')]=moment()[_0xb0f1('0x1c')](_0xb0f1('0x1d'));_0x38e4fe=initGraph(_['omit'](_0x13afba,_0xb0f1('0x11')),_0x13afba[_0xb0f1('0x11')]);_0x294190=new Vertices(_0x4515a1,rpc,mailRpc);logger[_0xb0f1('0x1e')](util[_0xb0f1('0x1c')](_0xb0f1('0x1f'),_0x4515a1[_0xb0f1('0x20')],_0x4515a1[_0xb0f1('0x21')],_0x4515a1[_0xb0f1('0x22')],_0x4515a1[_0xb0f1('0x23')],_0x4515a1[_0xb0f1('0x24')]));_0x38e4fe['traverseBFS'](_0x13afba[_0xb0f1('0x18')]['id'],function(_0x2885ca){try{_0x2885ca=_0x294190[_0xb0f1('0x25')](_0x2885ca);logger[_0xb0f1('0x19')]('vertex',JSON['stringify'](_0x2885ca,null,0x2));if(_0x2885ca[_0xb0f1('0xc')]===_0xb0f1('0x26')){logger[_0xb0f1('0x1e')]('gotoc\x20block\x20stop\x20traverse\x20BFS');_0x4515a1[_0xb0f1('0x27')]=_0x2885ca['context']||_0x4515a1[_0xb0f1('0x27')];_0x4515a1[_0xb0f1('0x28')]=_0x2885ca[_0xb0f1('0x28')];_0x4515a1[_0xb0f1('0x29')]=_0x2885ca['priority']?_0x2885ca[_0xb0f1('0x29')]-0x1:0x1;return null;}else if(_0x2885ca&&_0x294190[_0x2885ca[_0xb0f1('0xc')]]){_0x32b3f6=_0x294190[_0x2885ca[_0xb0f1('0xc')]](_0x2885ca);logger[_0xb0f1('0x1e')](_0xb0f1('0x2a'),JSON[_0xb0f1('0x1a')](_0x32b3f6,null,0x2));if(_0x32b3f6&&_0x32b3f6[_0xb0f1('0x2b')]===AGI_CODE_SUCCESS&&_0x32b3f6[_0xb0f1('0x2c')]!==AGI_RESULT_ERROR&&!_0x4515a1[_0xb0f1('0x2d')]){logger[_0xb0f1('0x19')](_0xb0f1('0x2a'),inspect(_0x32b3f6));return _[_0xb0f1('0x2e')](_0x32b3f6['result'])?null:_0x32b3f6[_0xb0f1('0x2c')]['toString']();}else{logger[_0xb0f1('0x9')](_0xb0f1('0x2a'),inspect(_0x32b3f6));return null;}}else{logger[_0xb0f1('0x9')](_0xb0f1('0x2f'));return null;}}catch(_0x2acf0b){logger[_0xb0f1('0x9')](_0x2acf0b[_0xb0f1('0xb')]);return null;}});if(_0x13afba[_0xb0f1('0x30')]){logger[_0xb0f1('0x1e')](util[_0xb0f1('0x1c')](_0xb0f1('0x31'),_0x4515a1[_0xb0f1('0x20')],_0x4515a1[_0xb0f1('0x21')],_0x4515a1['callerid'],_0x4515a1['dnid'],_0x4515a1[_0xb0f1('0x24')]));_0x38e4fe['traverseBFS'](_0x13afba['finally']['id'],function(_0x3240da){try{_0x3240da=_0x294190['clear'](_0x3240da);logger[_0xb0f1('0x19')](_0xb0f1('0x32'),JSON[_0xb0f1('0x1a')](_0x3240da,null,0x2));if(_0x3240da&&_0x294190[_0x3240da[_0xb0f1('0xc')]]){_0x32b3f6=_0x294190[_0x3240da[_0xb0f1('0xc')]](_0x3240da);if(_0x32b3f6){logger[_0xb0f1('0x19')](_0xb0f1('0x2a'),inspect(_0x32b3f6));return _[_0xb0f1('0x2e')](_0x32b3f6[_0xb0f1('0x2c')])?null:_0x32b3f6[_0xb0f1('0x2c')][_0xb0f1('0x33')]();}else{logger[_0xb0f1('0x9')](_0xb0f1('0x2a'),inspect(_0x32b3f6));return null;}}else{logger['error'](_0xb0f1('0x2f'));return null;}}catch(_0x342a49){logger[_0xb0f1('0x9')](_0x342a49[_0xb0f1('0xb')]);return null;}});}logger[_0xb0f1('0x1e')](util[_0xb0f1('0x1c')](_0xb0f1('0x34'),_0x4515a1['arg_1'],_0x4515a1['calleridname'],_0x4515a1[_0xb0f1('0x22')],_0x4515a1[_0xb0f1('0x23')],_0x4515a1[_0xb0f1('0x24')]));logger['info'](util[_0xb0f1('0x1c')](_0xb0f1('0x35'),_0x4515a1['context'],_0x4515a1[_0xb0f1('0x28')],parseInt(_0x4515a1[_0xb0f1('0x29')],0xa)+0x1));_0x4515a1['continueAt'](_0x4515a1['context'],_0x4515a1[_0xb0f1('0x28')],parseInt(_0x4515a1[_0xb0f1('0x29')],0xa)+0x1);_0x4515a1[_0xb0f1('0x36')]();}function handleNotFound(_0x462099){logger[_0xb0f1('0x9')](util[_0xb0f1('0x1c')](_0xb0f1('0x37'),_0x462099[_0xb0f1('0x20')]));_0x462099[_0xb0f1('0x38')](_0x462099[_0xb0f1('0x27')],_0x462099[_0xb0f1('0x28')],parseInt(_0x462099[_0xb0f1('0x29')],0xa)+0x1);_0x462099[_0xb0f1('0x36')]();}function handleUnpublished(_0x1647d2){logger[_0xb0f1('0x9')](util[_0xb0f1('0x1c')](_0xb0f1('0x39'),_0x1647d2[_0xb0f1('0x20')]));_0x1647d2['continueAt'](_0x1647d2[_0xb0f1('0x27')],_0x1647d2[_0xb0f1('0x28')],parseInt(_0x1647d2[_0xb0f1('0x29')],0xa)+0x1);_0x1647d2[_0xb0f1('0x36')]();}module[_0xb0f1('0x3a')]={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize}; \ No newline at end of file +var _0x6ab9=['[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','uniqueid','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','Project\x20%s\x20not\x20found','continueAt','Project\x20%s\x20not\x20published','exports','util','../../config/logger','agi','./rpc','./mailRpc','./graph','./vertices','getSquareProjects','catch','error','Unable\x20to\x20download\x20CallySquare\x20projects','stack','agicommand','retry','maxRetry','addVertex','omit','mxCell','hasOwnProperty','isArray','length','addEdge','source','target','value','mxGraphModel','root','production','start','debug','stringify','joinAt','YYYY-MM-DD\x20HH:mm:ss','format','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','callerid','dnid','traverseBFS','clear','vertex','gotoc','info','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','code','result','evtHangup','isUndefined','toString','agicommand\x20not\x20found','finally'];(function(_0x8697,_0x85c015){var _0x36f90b=function(_0x349aa0){while(--_0x349aa0){_0x8697['push'](_0x8697['shift']());}};_0x36f90b(++_0x85c015);}(_0x6ab9,0x109));var _0x96ab=function(_0x39e283,_0x247e6b){_0x39e283=_0x39e283-0x0;var _0x7de89f=_0x6ab9[_0x39e283];return _0x7de89f;};'use strict';var _=require('lodash');var moment=require('moment');var parser=require('xml2json');var util=require(_0x96ab('0x0'));var logger=require(_0x96ab('0x1'))(_0x96ab('0x2'));var rpc=require(_0x96ab('0x3'));var mailRpc=require(_0x96ab('0x4'));var Graph=require(_0x96ab('0x5'));var Vertices=require(_0x96ab('0x6'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0x96ab('0x7')]()[_0x96ab('0x8')](function(_0x499861){logger[_0x96ab('0x9')](_0x96ab('0xa'),_0x499861[_0x96ab('0xb')]);return[];});}function addVertex(_0x898f19,_0x317452,_0x210fc8){_0x317452[_0x96ab('0xc')]=_0x210fc8;if(_0x317452['hasOwnProperty'](_0x96ab('0xd'))){_0x317452[_0x96ab('0xe')]=parseInt(_0x317452[_0x96ab('0xd')],0xa);}_0x898f19[_0x96ab('0xf')](_[_0x96ab('0x10')](_0x317452,_0x96ab('0x11')));}function initGraph(_0x2b8349,_0x1113fd){var _0xce30a9=new Graph();for(var _0x8e4a29 in _0x2b8349){if(_0x2b8349[_0x96ab('0x12')](_0x8e4a29)){if(_[_0x96ab('0x13')](_0x2b8349[_0x8e4a29])){for(var _0x49b20e=0x0;_0x49b20e<_0x2b8349[_0x8e4a29][_0x96ab('0x14')];_0x49b20e+=0x1){addVertex(_0xce30a9,_0x2b8349[_0x8e4a29][_0x49b20e],_0x8e4a29);}}else{addVertex(_0xce30a9,_0x2b8349[_0x8e4a29],_0x8e4a29);}}}for(var _0x5d3a7f=0x0;_0x5d3a7f<_0x1113fd[_0x96ab('0x14')];_0x5d3a7f+=0x1){if(_0x1113fd[_0x5d3a7f]['source']&&_0x1113fd[_0x5d3a7f]['target']){_0xce30a9[_0x96ab('0x15')](_0x1113fd[_0x5d3a7f][_0x96ab('0x16')],_0x1113fd[_0x5d3a7f][_0x96ab('0x17')],_0x1113fd[_0x5d3a7f][_0x96ab('0x18')]);}}return _0xce30a9;}function getRoot(_0x4b0c1e){return parser['toJson'](_0x4b0c1e,{'object':!![]})[_0x96ab('0x19')][_0x96ab('0x1a')];}function inspect(_0x56a9ee){return util['inspect'](_0x56a9ee,{'showHidden':![],'depth':null});}function initialize(_0x55c803,_0x14a333){var _0xbcfafb=getRoot(_0x55c803[_0x96ab('0x1b')]);if(!_0xbcfafb||!_0xbcfafb[_0x96ab('0x1c')])return;var _0x2c1f8e,_0x358549,_0x5d9b72;logger[_0x96ab('0x1d')](_0x96ab('0x1a'),JSON[_0x96ab('0x1e')](_0xbcfafb,null,0x2));_0x14a333[_0x96ab('0x1f')]=moment()['format'](_0x96ab('0x20'));_0x2c1f8e=initGraph(_['omit'](_0xbcfafb,'mxCell'),_0xbcfafb['mxCell']);_0x358549=new Vertices(_0x14a333,rpc,mailRpc);logger['info'](util[_0x96ab('0x21')](_0x96ab('0x22'),_0x14a333['arg_1'],_0x14a333[_0x96ab('0x23')],_0x14a333[_0x96ab('0x24')],_0x14a333[_0x96ab('0x25')],_0x14a333['uniqueid']));_0x2c1f8e[_0x96ab('0x26')](_0xbcfafb['start']['id'],function(_0x3553f4){try{_0x3553f4=_0x358549[_0x96ab('0x27')](_0x3553f4);logger[_0x96ab('0x1d')](_0x96ab('0x28'),JSON[_0x96ab('0x1e')](_0x3553f4,null,0x2));if(_0x3553f4[_0x96ab('0xc')]===_0x96ab('0x29')){logger[_0x96ab('0x2a')](_0x96ab('0x2b'));_0x14a333['context']=_0x3553f4[_0x96ab('0x2c')]||_0x14a333[_0x96ab('0x2c')];_0x14a333[_0x96ab('0x2d')]=_0x3553f4['extension'];_0x14a333[_0x96ab('0x2e')]=_0x3553f4[_0x96ab('0x2e')]?_0x3553f4['priority']-0x1:0x1;return null;}else if(_0x3553f4&&_0x358549[_0x3553f4['agicommand']]){_0x5d9b72=_0x358549[_0x3553f4[_0x96ab('0xc')]](_0x3553f4);logger['info'](_0x96ab('0x2f'),JSON[_0x96ab('0x1e')](_0x5d9b72,null,0x2));if(_0x5d9b72&&_0x5d9b72[_0x96ab('0x30')]===AGI_CODE_SUCCESS&&_0x5d9b72[_0x96ab('0x31')]!==AGI_RESULT_ERROR&&!_0x14a333[_0x96ab('0x32')]){logger[_0x96ab('0x1d')](_0x96ab('0x2f'),inspect(_0x5d9b72));return _[_0x96ab('0x33')](_0x5d9b72[_0x96ab('0x31')])?null:_0x5d9b72[_0x96ab('0x31')][_0x96ab('0x34')]();}else{logger[_0x96ab('0x9')](_0x96ab('0x2f'),inspect(_0x5d9b72));return null;}}else{logger[_0x96ab('0x9')](_0x96ab('0x35'));return null;}}catch(_0x1e6cef){logger['error'](_0x1e6cef[_0x96ab('0xb')]);return null;}});if(_0xbcfafb[_0x96ab('0x36')]){logger[_0x96ab('0x2a')](util[_0x96ab('0x21')](_0x96ab('0x37'),_0x14a333[_0x96ab('0x38')],_0x14a333[_0x96ab('0x23')],_0x14a333[_0x96ab('0x24')],_0x14a333[_0x96ab('0x25')],_0x14a333[_0x96ab('0x39')]));_0x2c1f8e['traverseBFS'](_0xbcfafb[_0x96ab('0x36')]['id'],function(_0x53b658){try{_0x53b658=_0x358549[_0x96ab('0x27')](_0x53b658);logger[_0x96ab('0x1d')](_0x96ab('0x28'),JSON[_0x96ab('0x1e')](_0x53b658,null,0x2));if(_0x53b658&&_0x358549[_0x53b658[_0x96ab('0xc')]]){_0x5d9b72=_0x358549[_0x53b658[_0x96ab('0xc')]](_0x53b658);if(_0x5d9b72){logger['debug'](_0x96ab('0x2f'),inspect(_0x5d9b72));return _[_0x96ab('0x33')](_0x5d9b72[_0x96ab('0x31')])?null:_0x5d9b72[_0x96ab('0x31')][_0x96ab('0x34')]();}else{logger[_0x96ab('0x9')](_0x96ab('0x2f'),inspect(_0x5d9b72));return null;}}else{logger[_0x96ab('0x9')](_0x96ab('0x35'));return null;}}catch(_0x1a112e){logger[_0x96ab('0x9')](_0x1a112e[_0x96ab('0xb')]);return null;}});}logger['info'](util[_0x96ab('0x21')](_0x96ab('0x3a'),_0x14a333[_0x96ab('0x38')],_0x14a333['calleridname'],_0x14a333[_0x96ab('0x24')],_0x14a333[_0x96ab('0x25')],_0x14a333['uniqueid']));logger[_0x96ab('0x2a')](util['format']('[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s',_0x14a333[_0x96ab('0x2c')],_0x14a333[_0x96ab('0x2d')],parseInt(_0x14a333[_0x96ab('0x2e')],0xa)+0x1));_0x14a333['continueAt'](_0x14a333[_0x96ab('0x2c')],_0x14a333[_0x96ab('0x2d')],parseInt(_0x14a333[_0x96ab('0x2e')],0xa)+0x1);_0x14a333[_0x96ab('0x3b')]();}function handleNotFound(_0x3fe932){logger[_0x96ab('0x9')](util[_0x96ab('0x21')](_0x96ab('0x3c'),_0x3fe932[_0x96ab('0x38')]));_0x3fe932[_0x96ab('0x3d')](_0x3fe932[_0x96ab('0x2c')],_0x3fe932['extension'],parseInt(_0x3fe932['priority'],0xa)+0x1);_0x3fe932[_0x96ab('0x3b')]();}function handleUnpublished(_0x148ee1){logger[_0x96ab('0x9')](util[_0x96ab('0x21')](_0x96ab('0x3e'),_0x148ee1[_0x96ab('0x38')]));_0x148ee1[_0x96ab('0x3d')](_0x148ee1[_0x96ab('0x2c')],_0x148ee1['extension'],parseInt(_0x148ee1[_0x96ab('0x2e')],0xa)+0x1);_0x148ee1['close']();}module[_0x96ab('0x3f')]={'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 388124f..abc504f 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 _0xfb3f=['exports','util','stream','_inBody','prototype','_transform','\x0d\x0a\x0d\x0a','toString','_localBuffer','indexOf','substring','length','split','slice','trim','emit','headers','line'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xfb3f,0xd9));var _0xffb3=function(_0x51f825,_0x3eb3e5){_0x51f825=_0x51f825-0x0;var _0x4d0a14=_0xfb3f[_0x51f825];return _0x4d0a14;};'use strict';var util=require(_0xffb3('0x0'));var Transform=require(_0xffb3('0x1'))['Transform'];function AGIReply(_0x3b2630){Transform['call'](this,_0x3b2630);this['_localBuffer']='';this[_0xffb3('0x2')]=![];}util['inherits'](AGIReply,Transform);AGIReply[_0xffb3('0x3')][_0xffb3('0x4')]=function(_0xaecfd9,_0x15cb2c,_0x30d7f7){var _0x25261c='\x0a',_0x3868a6=['\x0a\x0a',_0xffb3('0x5')],_0x146133=-0x1,_0x5177aa=-0x1,_0x2e9697='',_0x250f0f=0x0,_0x39014a='',_0x1d9adc='';this['_localBuffer']+=_0xaecfd9[_0xffb3('0x6')]();_0x39014a=this[_0xffb3('0x7')];if(!this[_0xffb3('0x2')]){_0x250f0f=0x0;while(_0x3868a6[_0x250f0f]){while((_0x5177aa=_0x39014a[_0xffb3('0x8')](_0x3868a6[_0x250f0f]))!=-0x1){_0x2e9697=_0x3868a6[_0x250f0f];_0x1d9adc=_0x39014a[_0xffb3('0x9')](0x0,_0x5177aa);_0x39014a=_0x39014a[_0xffb3('0x9')](_0x5177aa+_0x2e9697[_0xffb3('0xa')]);var _0x5fd707=_0x1d9adc[_0xffb3('0xb')](_0x25261c),_0x545d98=0x0,_0x13c1c7={},_0x40c953='',_0x55192c='',_0x21924a=-0x1;while(_0x5fd707[_0x545d98]){_0x21924a=_0x5fd707[_0x545d98][_0xffb3('0x8')](':');if(_0x21924a!=-0x1){_0x40c953=_0x5fd707[_0x545d98][_0xffb3('0xc')](0x0,_0x21924a)[_0xffb3('0xd')]();_0x55192c=_0x5fd707[_0x545d98][_0xffb3('0xc')](_0x21924a+0x1)[_0xffb3('0xd')]();if(_0x40c953[_0xffb3('0xa')]>0x0){_0x13c1c7[_0x40c953]=_0x55192c;}}else{}_0x545d98++;}this[_0xffb3('0xe')](_0xffb3('0xf'),_0x13c1c7);this[_0xffb3('0x2')]=!![];}_0x250f0f++;}this[_0xffb3('0x7')]=_0x39014a;}else{while((_0x146133=_0x39014a['indexOf'](_0x25261c))!=-0x1){_0x1d9adc=_0x39014a[_0xffb3('0x9')](0x0,_0x146133);this[_0xffb3('0xe')](_0xffb3('0x10'),_0x1d9adc);_0x39014a=_0x39014a['substring'](_0x146133+_0x25261c['length']);}this[_0xffb3('0x7')]=_0x39014a;}_0x30d7f7();};module[_0xffb3('0x11')]=AGIReply; \ No newline at end of file +var _0x07eb=['substring','length','split','slice','trim','emit','headers','line','stream','Transform','call','_localBuffer','_inBody','inherits','prototype','_transform','toString','indexOf'];(function(_0x194542,_0x1b0ebe){var _0x322ada=function(_0x301931){while(--_0x301931){_0x194542['push'](_0x194542['shift']());}};_0x322ada(++_0x1b0ebe);}(_0x07eb,0x74));var _0xb07e=function(_0x3e25c1,_0x1d15f9){_0x3e25c1=_0x3e25c1-0x0;var _0x52e7f2=_0x07eb[_0x3e25c1];return _0x52e7f2;};'use strict';var util=require('util');var Transform=require(_0xb07e('0x0'))[_0xb07e('0x1')];function AGIReply(_0x32bb8e){Transform[_0xb07e('0x2')](this,_0x32bb8e);this[_0xb07e('0x3')]='';this[_0xb07e('0x4')]=![];}util[_0xb07e('0x5')](AGIReply,Transform);AGIReply[_0xb07e('0x6')][_0xb07e('0x7')]=function(_0x16a2ac,_0x5c2e7a,_0x4c43d3){var _0x2815c0='\x0a',_0x3579f2=['\x0a\x0a','\x0d\x0a\x0d\x0a'],_0x9ab3b8=-0x1,_0x4f9e54=-0x1,_0x2a7c3='',_0x8b1b80=0x0,_0x13fabf='',_0x25ddbc='';this[_0xb07e('0x3')]+=_0x16a2ac[_0xb07e('0x8')]();_0x13fabf=this[_0xb07e('0x3')];if(!this['_inBody']){_0x8b1b80=0x0;while(_0x3579f2[_0x8b1b80]){while((_0x4f9e54=_0x13fabf[_0xb07e('0x9')](_0x3579f2[_0x8b1b80]))!=-0x1){_0x2a7c3=_0x3579f2[_0x8b1b80];_0x25ddbc=_0x13fabf[_0xb07e('0xa')](0x0,_0x4f9e54);_0x13fabf=_0x13fabf[_0xb07e('0xa')](_0x4f9e54+_0x2a7c3[_0xb07e('0xb')]);var _0x130e20=_0x25ddbc[_0xb07e('0xc')](_0x2815c0),_0x205298=0x0,_0x1b8bea={},_0x499e8c='',_0x22a522='',_0x2b2efb=-0x1;while(_0x130e20[_0x205298]){_0x2b2efb=_0x130e20[_0x205298][_0xb07e('0x9')](':');if(_0x2b2efb!=-0x1){_0x499e8c=_0x130e20[_0x205298][_0xb07e('0xd')](0x0,_0x2b2efb)[_0xb07e('0xe')]();_0x22a522=_0x130e20[_0x205298][_0xb07e('0xd')](_0x2b2efb+0x1)[_0xb07e('0xe')]();if(_0x499e8c[_0xb07e('0xb')]>0x0){_0x1b8bea[_0x499e8c]=_0x22a522;}}else{}_0x205298++;}this[_0xb07e('0xf')](_0xb07e('0x10'),_0x1b8bea);this[_0xb07e('0x4')]=!![];}_0x8b1b80++;}this['_localBuffer']=_0x13fabf;}else{while((_0x9ab3b8=_0x13fabf['indexOf'](_0x2815c0))!=-0x1){_0x25ddbc=_0x13fabf[_0xb07e('0xa')](0x0,_0x9ab3b8);this['emit'](_0xb07e('0x11'),_0x25ddbc);_0x13fabf=_0x13fabf[_0xb07e('0xa')](_0x9ab3b8+_0x2815c0['length']);}this['_localBuffer']=_0x13fabf;}_0x4c43d3();};module['exports']=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index dfa8fcd..6a2b3ee 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 _0x6c84=['getUserById','ShowUser','getContactByPhone','GetContactByPhone','phone','getTrunkById','ShowTrunk','getSoundById','ShowSound','getIntervalById','Intervals','getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','arg_2','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','ListId','CreateCmContact','getPauseById','agentLogin','LoginUser','agentPause','PauseUser','UnpauseUser','LogoutUser','lodash','moment','jayson/promise','client','http','error','message','result','catch','getSquareProjects','name','ShowSquareProject','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','CloudProvider','getVoiceQueueById','ShowVoiceQueue','ShowVariable','getSquareOdbcById'];(function(_0xce9195,_0x1963e1){var _0x530fe6=function(_0x1b8055){while(--_0x1b8055){_0xce9195['push'](_0xce9195['shift']());}};_0x530fe6(++_0x1963e1);}(_0x6c84,0x112));var _0x46c8=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x6c84[_0x1cc8fe];return _0x230054;};'use strict';var _=require(_0x46c8('0x0'));var moment=require(_0x46c8('0x1'));var jayson=require(_0x46c8('0x2'));var client=jayson[_0x46c8('0x3')][_0x46c8('0x4')]({'port':0x2329});function request(_0x51d202,_0x187ef9){return new Promise(function(_0x4e8480,_0x2f4e36){return client['request'](_0x51d202,_0x187ef9)['then'](function(_0x2b0d13){if(_0x2b0d13[_0x46c8('0x5')]){return _0x2f4e36(_0x2b0d13[_0x46c8('0x5')][_0x46c8('0x6')]);}else{return _0x4e8480(_0x2b0d13[_0x46c8('0x7')]);}})[_0x46c8('0x8')](function(_0xfe26c8){return _0x2f4e36(_0xfe26c8);});});}exports[_0x46c8('0x9')]=function(){return request('GetSquareProjects',{'options':{'raw':![],'attributes':['id',_0x46c8('0xa'),'production']}});};exports['getSquareProject']=function(_0x527efe){return request(_0x46c8('0xb'),{'options':{'raw':![],'where':{'name':_0x527efe},'attributes':['production']}});};exports[_0x46c8('0xc')]=function(_0x38bd85){return request(_0x46c8('0xd'),{'options':{'raw':![],'where':{'id':_0x38bd85},'include':[{'model':_0x46c8('0xe'),'as':_0x46c8('0xf'),'include':[{'model':_0x46c8('0x10'),'as':_0x46c8('0x10')}]}],'attributes':['id','name','email'],'smtp':!![]}});};exports['getSquareProjectById']=function(_0x201cac){return request('ShowSquareProject',{'options':{'where':{'id':_0x201cac},'attributes':[_0x46c8('0xa')]}});};exports[_0x46c8('0x11')]=function(_0x30feb2){return request(_0x46c8('0x12'),{'options':{'where':{'id':_0x30feb2},'attributes':[_0x46c8('0xa')]}});};exports['getVariableById']=function(_0xb9f437){return request(_0x46c8('0x13'),{'options':{'where':{'id':_0xb9f437},'attributes':['name']}});};exports[_0x46c8('0x14')]=function(_0x279b28){return request('ShowSquareOdbc',{'options':{'where':{'id':_0x279b28},'attributes':['dsn']}});};exports[_0x46c8('0x15')]=function(_0x255a0e){return request(_0x46c8('0x16'),{'options':{'where':{'id':_0x255a0e},'attributes':[_0x46c8('0xa')]}});};exports[_0x46c8('0x17')]=function(_0x40ea2c){return request(_0x46c8('0x18'),{'options':{'where':{'phone':_0x40ea2c[_0x46c8('0x19')]},'attributes':['id']}});};exports[_0x46c8('0x1a')]=function(_0x56a560){return request(_0x46c8('0x1b'),{'options':{'where':{'id':_0x56a560},'attributes':[_0x46c8('0xa')]}});};exports[_0x46c8('0x1c')]=function(_0x298e3d){return request(_0x46c8('0x1d'),{'options':{'where':{'id':_0x298e3d},'attributes':['save_name']}});};exports[_0x46c8('0x1e')]=function(_0x3d1089){return request('ShowInterval',{'options':{'raw':![],'where':{'id':_0x3d1089},'include':[{'model':'Interval','as':_0x46c8('0x1f')}]}});};exports[_0x46c8('0x20')]=function(_0x509238){return request(_0x46c8('0x21'),{'options':{'where':{'id':_0x509238},'attributes':['id','name']}});};exports[_0x46c8('0x22')]=function(_0x1d724b){return request(_0x46c8('0x23'),{'body':_0x1d724b});};exports[_0x46c8('0x24')]=function(_0x450cd0){return request(_0x46c8('0x25'),{'body':_0x450cd0});};exports[_0x46c8('0x26')]=function(_0x44a796){return request(_0x46c8('0x27'),{'body':_[_0x46c8('0x28')](_0x44a796,{'project_name':_0x44a796[_0x46c8('0x29')],'prev_project_name':_0x44a796[_0x46c8('0x2a')]||'','is_subproject':_0x44a796[_0x46c8('0x2a')]?!![]:![],'leaveAt':moment()['format'](_0x46c8('0x2b'))})});};exports[_0x46c8('0x2c')]=function(_0x316602){return request(_0x46c8('0x2d'),{'body':_0x316602});};exports[_0x46c8('0x2e')]=function(_0x55a5f7){return request(_0x46c8('0x2f'),{'body':_0x55a5f7});};exports[_0x46c8('0x30')]=function(_0x840dac){return request(_0x46c8('0x31'),{'options':{'raw':![],'where':{'phone':_0x840dac[_0x46c8('0x19')],'ListId':_0x840dac[_0x46c8('0x32')]}}})['then'](function(_0x420556){if(_0x420556){return _0x420556;}return request(_0x46c8('0x33'),{'body':_0x840dac});});};exports[_0x46c8('0x34')]=function(_0x5c0ce0){return request('ShowPause',{'options':{'where':{'id':_0x5c0ce0},'attributes':[_0x46c8('0xa')]}});};exports[_0x46c8('0x35')]=function(_0x69eac8,_0x404335){return request(_0x46c8('0x36'),{'body':{'interface':_0x404335},'options':{'where':_0x69eac8}});};exports[_0x46c8('0x37')]=function(_0x762292,_0x2ddfa5,_0x24e0ab){return request(_0x46c8('0x38'),{'body':{'type':_0x2ddfa5,'uniqueid':_0x24e0ab},'options':{'where':_0x762292}});};exports['agentUnpause']=function(_0x57a515){return request(_0x46c8('0x39'),{'body':{},'options':{'where':_0x57a515}});};exports['agentLogout']=function(_0xa584be){return request(_0x46c8('0x3a'),{'body':{},'options':{'where':_0xa584be}});}; \ No newline at end of file +var _0x3164=['CreateSquareReport','merge','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','CreateSquareMessage','createCmContact','ShowCmHopper','phone','then','CreateCmContact','agentLogin','agentPause','PauseUser','agentUnpause','UnpauseUser','LogoutUser','lodash','moment','jayson/promise','client','http','error','message','result','catch','getSquareProjects','GetSquareProjects','name','production','getSquareProject','ShowSquareProject','getMailAccountById','ShowMailAccount','MailServerOut','CloudProvider','email','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','ShowUser','GetContactByPhone','ShowTrunk','getSoundById','save_name','getIntervalById','ShowInterval','Interval','Intervals','ShowSmsAccount','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport'];(function(_0x1790f2,_0x2f375f){var _0x3f5a01=function(_0x12151e){while(--_0x12151e){_0x1790f2['push'](_0x1790f2['shift']());}};_0x3f5a01(++_0x2f375f);}(_0x3164,0x182));var _0x4316=function(_0x6186a8,_0x5385c4){_0x6186a8=_0x6186a8-0x0;var _0xf72248=_0x3164[_0x6186a8];return _0xf72248;};'use strict';var _=require(_0x4316('0x0'));var moment=require(_0x4316('0x1'));var jayson=require(_0x4316('0x2'));var client=jayson[_0x4316('0x3')][_0x4316('0x4')]({'port':0x2329});function request(_0x588480,_0x2534d3){return new Promise(function(_0x2355a6,_0x1235d9){return client['request'](_0x588480,_0x2534d3)['then'](function(_0x27bfc8){if(_0x27bfc8[_0x4316('0x5')]){return _0x1235d9(_0x27bfc8[_0x4316('0x5')][_0x4316('0x6')]);}else{return _0x2355a6(_0x27bfc8[_0x4316('0x7')]);}})[_0x4316('0x8')](function(_0x1bcd38){return _0x1235d9(_0x1bcd38);});});}exports[_0x4316('0x9')]=function(){return request(_0x4316('0xa'),{'options':{'raw':![],'attributes':['id',_0x4316('0xb'),_0x4316('0xc')]}});};exports[_0x4316('0xd')]=function(_0xb370dc){return request(_0x4316('0xe'),{'options':{'raw':![],'where':{'name':_0xb370dc},'attributes':['production']}});};exports[_0x4316('0xf')]=function(_0x446361){return request(_0x4316('0x10'),{'options':{'raw':![],'where':{'id':_0x446361},'include':[{'model':_0x4316('0x11'),'as':'Smtp','include':[{'model':_0x4316('0x12'),'as':_0x4316('0x12')}]}],'attributes':['id',_0x4316('0xb'),_0x4316('0x13')],'smtp':!![]}});};exports['getSquareProjectById']=function(_0x2fdbee){return request('ShowSquareProject',{'options':{'where':{'id':_0x2fdbee},'attributes':['name']}});};exports['getVoiceQueueById']=function(_0x266777){return request(_0x4316('0x14'),{'options':{'where':{'id':_0x266777},'attributes':['name']}});};exports[_0x4316('0x15')]=function(_0x486a64){return request(_0x4316('0x16'),{'options':{'where':{'id':_0x486a64},'attributes':[_0x4316('0xb')]}});};exports[_0x4316('0x17')]=function(_0x1caa59){return request(_0x4316('0x18'),{'options':{'where':{'id':_0x1caa59},'attributes':[_0x4316('0x19')]}});};exports[_0x4316('0x1a')]=function(_0x38e68c){return request(_0x4316('0x1b'),{'options':{'where':{'id':_0x38e68c},'attributes':[_0x4316('0xb')]}});};exports['getContactByPhone']=function(_0x43069f){return request(_0x4316('0x1c'),{'options':{'where':{'phone':_0x43069f['phone']},'attributes':['id']}});};exports['getTrunkById']=function(_0x40f660){return request(_0x4316('0x1d'),{'options':{'where':{'id':_0x40f660},'attributes':[_0x4316('0xb')]}});};exports[_0x4316('0x1e')]=function(_0x247866){return request('ShowSound',{'options':{'where':{'id':_0x247866},'attributes':[_0x4316('0x1f')]}});};exports[_0x4316('0x20')]=function(_0x599c48){return request(_0x4316('0x21'),{'options':{'raw':![],'where':{'id':_0x599c48},'include':[{'model':_0x4316('0x22'),'as':_0x4316('0x23')}]}});};exports['getSmsAccountById']=function(_0x1736d0){return request(_0x4316('0x24'),{'options':{'where':{'id':_0x1736d0},'attributes':['id',_0x4316('0xb')]}});};exports['createSmsMessage']=function(_0x3b994a){return request(_0x4316('0x25'),{'body':_0x3b994a});};exports[_0x4316('0x26')]=function(_0x2d2bda){return request(_0x4316('0x27'),{'body':_0x2d2bda});};exports[_0x4316('0x28')]=function(_0x1f7e8d){return request(_0x4316('0x29'),{'body':_[_0x4316('0x2a')](_0x1f7e8d,{'project_name':_0x1f7e8d[_0x4316('0x2b')],'prev_project_name':_0x1f7e8d[_0x4316('0x2c')]||'','is_subproject':_0x1f7e8d[_0x4316('0x2c')]?!![]:![],'leaveAt':moment()[_0x4316('0x2d')](_0x4316('0x2e'))})});};exports[_0x4316('0x2f')]=function(_0x31cd5f){return request(_0x4316('0x30'),{'body':_0x31cd5f});};exports['createSquareMessage']=function(_0x522ced){return request(_0x4316('0x31'),{'body':_0x522ced});};exports[_0x4316('0x32')]=function(_0xa8dd01){return request(_0x4316('0x33'),{'options':{'raw':![],'where':{'phone':_0xa8dd01[_0x4316('0x34')],'ListId':_0xa8dd01['ListId']}}})[_0x4316('0x35')](function(_0x4b13aa){if(_0x4b13aa){return _0x4b13aa;}return request(_0x4316('0x36'),{'body':_0xa8dd01});});};exports['getPauseById']=function(_0x46df48){return request('ShowPause',{'options':{'where':{'id':_0x46df48},'attributes':[_0x4316('0xb')]}});};exports[_0x4316('0x37')]=function(_0x4f88a2,_0x22eedf){return request('LoginUser',{'body':{'interface':_0x22eedf},'options':{'where':_0x4f88a2}});};exports[_0x4316('0x38')]=function(_0x1b3db9,_0x2d7e64,_0x261908){return request(_0x4316('0x39'),{'body':{'type':_0x2d7e64,'uniqueid':_0x261908},'options':{'where':_0x1b3db9}});};exports[_0x4316('0x3a')]=function(_0x3bcbee){return request(_0x4316('0x3b'),{'body':{},'options':{'where':_0x3bcbee}});};exports['agentLogout']=function(_0x9bf1ff){return request(_0x4316('0x3c'),{'body':{},'options':{'where':_0x9bf1ff}});}; \ 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 21c63c4..f20a594 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 _0xbacd=['./lex','./polly'];(function(_0x55e08b,_0x421620){var _0xd1a7ff=function(_0x58c7ff){while(--_0x58c7ff){_0x55e08b['push'](_0x55e08b['shift']());}};_0xd1a7ff(++_0x421620);}(_0xbacd,0x1c5));var _0xdbac=function(_0x164ad3,_0x14ac81){_0x164ad3=_0x164ad3-0x0;var _0x4dfed9=_0xbacd[_0x164ad3];return _0x4dfed9;};var polly=require(_0xdbac('0x0'));var lex=require(_0xdbac('0x1'));module['exports']={'polly':polly,'lex':lex}; \ No newline at end of file +var _0x9b8e=['./polly','exports'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x9b8e,0x158));var _0xe9b8=function(_0x4743a7,_0xac271c){_0x4743a7=_0x4743a7-0x0;var _0x341564=_0x9b8e[_0x4743a7];return _0x341564;};var polly=require(_0xe9b8('0x0'));var lex=require('./lex');module[_0xe9b8('0x1')]={'polly':polly,'lex':lex}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/lex/index.js b/server/services/agi/scripts/aws/lex/index.js index f0ab758..04936c4 100644 --- a/server/services/agi/scripts/aws/lex/index.js +++ b/server/services/agi/scripts/aws/lex/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2750=['./lib/api'];(function(_0x870b62,_0x2143f9){var _0x2dcb39=function(_0x2fb63d){while(--_0x2fb63d){_0x870b62['push'](_0x870b62['shift']());}};_0x2dcb39(++_0x2143f9);}(_0x2750,0x13b));var _0x0275=function(_0x49bafc,_0x2dbc00){_0x49bafc=_0x49bafc-0x0;var _0x4479b2=_0x2750[_0x49bafc];return _0x4479b2;};'use strict';var lex=require(_0x0275('0x0'));module['exports']=function(_0xf4568,_0xf2ae71,_0x372744,_0x429a37,_0x101b26,_0x41ec06){return lex(_0xf4568,_0xf2ae71,_0x372744,_0x429a37,_0x101b26,_0x41ec06);}; \ No newline at end of file +var _0x3c81=['./lib/api','exports'];(function(_0x3ee883,_0xf98b0c){var _0x13f6f9=function(_0x6eb3bb){while(--_0x6eb3bb){_0x3ee883['push'](_0x3ee883['shift']());}};_0x13f6f9(++_0xf98b0c);}(_0x3c81,0x102));var _0x13c8=function(_0xb03198,_0x40233c){_0xb03198=_0xb03198-0x0;var _0x3e27c9=_0x3c81[_0xb03198];return _0x3e27c9;};'use strict';var lex=require(_0x13c8('0x0'));module[_0x13c8('0x1')]=function(_0x48c35b,_0x252f26,_0x131d0b,_0x4954c2,_0x5913e9,_0x5c3ba4){return lex(_0x48c35b,_0x252f26,_0x131d0b,_0x4954c2,_0x5913e9,_0x5c3ba4);}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/lex/lib/api.js b/server/services/agi/scripts/aws/lex/lib/api.js index 2191e27..48721ec 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(_0x4303b0,_0x6fa924){var _0x2cb89a=function(_0x241a40){while(--_0x241a40){_0x4303b0['push'](_0x4303b0['shift']());}};_0x2cb89a(++_0x6fa924);}(_0xa9e0,0x123));var _0x0a9e=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0xa9e0[_0x139a3c];return _0x2b375b;};'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(_0x5c536f,_0x47d86b){var _0x212833=function(_0x1bffd2){while(--_0x1bffd2){_0x5c536f['push'](_0x5c536f['shift']());}};_0x212833(++_0x47d86b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0xa9e0[_0x12d033];return _0x3b4e80;};'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 66cb58a..030d3e2 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 _0xa167=['./lib/api','exports'];(function(_0x4f3621,_0x28e265){var _0x3d6a2b=function(_0x21f37b){while(--_0x21f37b){_0x4f3621['push'](_0x4f3621['shift']());}};_0x3d6a2b(++_0x28e265);}(_0xa167,0x19e));var _0x7a16=function(_0x15f539,_0xa889c7){_0x15f539=_0x15f539-0x0;var _0x40dc9e=_0xa167[_0x15f539];return _0x40dc9e;};'use strict';var polly=require(_0x7a16('0x0'));module[_0x7a16('0x1')]=function(_0x1d4a27,_0x2e7885,_0x519bd8,_0x2b136f,_0x49b63c,_0x4cdf2c,_0x58ed29){return polly(_0x1d4a27,_0x2e7885,_0x519bd8,_0x2b136f,_0x49b63c,_0x4cdf2c,_0x58ed29);}; \ No newline at end of file +var _0xdae2=['exports','./lib/api'];(function(_0x37f073,_0x3e088e){var _0xea49d=function(_0x40320c){while(--_0x40320c){_0x37f073['push'](_0x37f073['shift']());}};_0xea49d(++_0x3e088e);}(_0xdae2,0x187));var _0x2dae=function(_0x26462c,_0xd20a35){_0x26462c=_0x26462c-0x0;var _0x509a42=_0xdae2[_0x26462c];return _0x509a42;};'use strict';var polly=require(_0x2dae('0x0'));module[_0x2dae('0x1')]=function(_0x567606,_0x46a004,_0x1053f4,_0x3adaf3,_0x3892b8,_0x19ee8c,_0x530464){return polly(_0x567606,_0x46a004,_0x1053f4,_0x3adaf3,_0x3892b8,_0x19ee8c,_0x530464);}; \ 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 82f5d64..e28c6d4 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 _0x85c9=['mp3','path','bluebird','randomstring','aws-sdk','synthesizeSpeech','AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','text'];(function(_0xfcb4ff,_0x414831){var _0x4175c9=function(_0x1e3d2a){while(--_0x1e3d2a){_0xfcb4ff['push'](_0xfcb4ff['shift']());}};_0x4175c9(++_0x414831);}(_0x85c9,0xcd));var _0x985c=function(_0x819464,_0x46fc91){_0x819464=_0x819464-0x0;var _0x49dcc0=_0x85c9[_0x819464];return _0x49dcc0;};'use strict';var fs=require('fs');var path=require(_0x985c('0x0'));var BPromise=require(_0x985c('0x1'));var rs=require(_0x985c('0x2'));var AWS=require(_0x985c('0x3'));function pollyResult(_0x57410b,_0x3ef82a,_0x1fdd2a){return new BPromise(function(_0x5a92d9,_0x2ffee9){_0x57410b[_0x985c('0x4')](_0x3ef82a,function(_0x2253d8,_0x30e008){if(_0x2253d8){_0x2ffee9(_0x2253d8);}else if(_0x30e008){if(_0x30e008[_0x985c('0x5')]instanceof Buffer){fs[_0x985c('0x6')](_0x1fdd2a,_0x30e008[_0x985c('0x5')],function(_0x292742){if(_0x292742){_0x2ffee9(_0x292742);}else{_0x5a92d9();}});}else{_0x2ffee9(new Error(_0x985c('0x7')));}}else{_0x2ffee9(new Error(_0x985c('0x8')));}});});}module[_0x985c('0x9')]=function(_0x505f39,_0x1945b3,_0x35f4a5,_0x41885e,_0x3abc98,_0x296c53,_0x424a93){var _0x24bf8b=new AWS['Polly']({'accessKeyId':_0x505f39,'secretAccessKey':_0x1945b3,'region':_0x35f4a5});var _0x511011={'Text':_0x3abc98,'TextType':_0x296c53||_0x985c('0xa'),'OutputFormat':_0x985c('0xb'),'VoiceId':_0x41885e};return pollyResult(_0x24bf8b,_0x511011,_0x424a93);}; \ No newline at end of file +var _0x7ca2=['path','bluebird','randomstring','aws-sdk','synthesizeSpeech','AudioStream','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','Polly','text','mp3'];(function(_0x2815b3,_0x5e085a){var _0x4c6510=function(_0x41d68d){while(--_0x41d68d){_0x2815b3['push'](_0x2815b3['shift']());}};_0x4c6510(++_0x5e085a);}(_0x7ca2,0x104));var _0x27ca=function(_0x1cd997,_0x1185b4){_0x1cd997=_0x1cd997-0x0;var _0x88f4ba=_0x7ca2[_0x1cd997];return _0x88f4ba;};'use strict';var fs=require('fs');var path=require(_0x27ca('0x0'));var BPromise=require(_0x27ca('0x1'));var rs=require(_0x27ca('0x2'));var AWS=require(_0x27ca('0x3'));function pollyResult(_0x49901f,_0xc7f70e,_0x371201){return new BPromise(function(_0x400a92,_0x247702){_0x49901f[_0x27ca('0x4')](_0xc7f70e,function(_0x24dbb8,_0x59b0b4){if(_0x24dbb8){_0x247702(_0x24dbb8);}else if(_0x59b0b4){if(_0x59b0b4['AudioStream']instanceof Buffer){fs['writeFile'](_0x371201,_0x59b0b4[_0x27ca('0x5')],function(_0x540712){if(_0x540712){_0x247702(_0x540712);}else{_0x400a92();}});}else{_0x247702(new Error(_0x27ca('0x6')));}}else{_0x247702(new Error('No\x20data\x20response\x20from\x20aws\x20Polly!'));}});});}module['exports']=function(_0x45c2c0,_0x4641bf,_0x330704,_0x444552,_0xdff3b6,_0x3fb3ea,_0x13c2a3){var _0x400447=new AWS[(_0x27ca('0x7'))]({'accessKeyId':_0x45c2c0,'secretAccessKey':_0x4641bf,'region':_0x330704});var _0x163481={'Text':_0xdff3b6,'TextType':_0x3fb3ea||_0x27ca('0x8'),'OutputFormat':_0x27ca('0x9'),'VoiceId':_0x444552};return pollyResult(_0x400447,_0x163481,_0x13c2a3);}; \ 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 1bd1b6a..dc56774 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 _0x1a07=['./lib/api','exports'];(function(_0x11ba21,_0x44fd71){var _0x53e8a6=function(_0x49babf){while(--_0x49babf){_0x11ba21['push'](_0x11ba21['shift']());}};_0x53e8a6(++_0x44fd71);}(_0x1a07,0x1b0));var _0x71a0=function(_0x382168,_0xe03b6a){_0x382168=_0x382168-0x0;var _0x3ecf7e=_0x1a07[_0x382168];return _0x3ecf7e;};'use strict';var asr=require(_0x71a0('0x0'));module[_0x71a0('0x1')]=function(_0x3c7ad4,_0x2c765b,_0xdbbd8e,_0xdc4aa3){return asr(_0x3c7ad4,_0x2c765b,_0xdbbd8e);}; \ No newline at end of file +var _0x2c1d=['exports'];(function(_0x2d3045,_0x5c25da){var _0x5386fa=function(_0x2416d0){while(--_0x2416d0){_0x2d3045['push'](_0x2d3045['shift']());}};_0x5386fa(++_0x5c25da);}(_0x2c1d,0x18b));var _0xd2c1=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x2c1d[_0x4a9fb1];return _0x348672;};'use strict';var asr=require('./lib/api');module[_0xd2c1('0x0')]=function(_0x4d4596,_0x11c736,_0x4e810a,_0x1dd49d){return asr(_0x4d4596,_0x11c736,_0x4e810a);}; \ 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 dbdae05..a719774 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 _0x2242=['/v1/speech:recognize?key=','LINEAR16','8000','url','bluebird','https://speech.googleapis.com','string','length','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','readFileSync','toString','base64','POST'];(function(_0x4ad807,_0x34531d){var _0x393359=function(_0x189674){while(--_0x189674){_0x4ad807['push'](_0x4ad807['shift']());}};_0x393359(++_0x34531d);}(_0x2242,0x1a3));var _0x2224=function(_0x3ae913,_0x2ee041){_0x3ae913=_0x3ae913-0x0;var _0x489c78=_0x2242[_0x3ae913];return _0x489c78;};'use strict';var url=require(_0x2224('0x0'));var BPromise=require(_0x2224('0x1'));var fs=require('fs');var host=_0x2224('0x2');module['exports']=function(_0x3180c8,_0x317565,_0x4acc10){return new BPromise(function(_0x1993b6,_0xb65b2f){var _0x4b2099;if(typeof _0x3180c8!==_0x2224('0x3')||_0x3180c8[_0x2224('0x4')]===0x0){return _0xb65b2f(_0x2224('0x5'));}if(typeof _0x317565!=='string'||_0x317565[_0x2224('0x4')]===0x0){return _0xb65b2f(_0x2224('0x6'));}if(typeof _0x4acc10!==_0x2224('0x7')&&(typeof _0x4acc10!==_0x2224('0x3')||_0x4acc10[_0x2224('0x4')]===0x0)){return _0xb65b2f(_0x2224('0x8'));}try{_0x4b2099=fs[_0x2224('0x9')](_0x3180c8)[_0x2224('0xa')](_0x2224('0xb'));}catch(_0x3a674f){return _0xb65b2f(_0x3a674f);}return _0x1993b6({'method':_0x2224('0xc'),'uri':host+_0x2224('0xd')+_0x317565,'body':{'config':{'encoding':_0x2224('0xe'),'sampleRateHertz':_0x2224('0xf'),'languageCode':_0x4acc10},'audio':{'content':_0x4b2099}},'json':!![]});});}; \ No newline at end of file +var _0x87f8=['length','key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','toString','POST','/v1/speech:recognize?key=','LINEAR16','exports','string'];(function(_0x4b2b7d,_0xc090b6){var _0x41b383=function(_0x43cb18){while(--_0x43cb18){_0x4b2b7d['push'](_0x4b2b7d['shift']());}};_0x41b383(++_0xc090b6);}(_0x87f8,0x152));var _0x887f=function(_0x57108b,_0x66d9b6){_0x57108b=_0x57108b-0x0;var _0x26f272=_0x87f8[_0x57108b];return _0x26f272;};'use strict';var url=require('url');var BPromise=require('bluebird');var fs=require('fs');var host='https://speech.googleapis.com';module[_0x887f('0x0')]=function(_0x13309f,_0x5be12b,_0x28ce3c){return new BPromise(function(_0x591ca0,_0x46a51e){var _0x3ce88c;if(typeof _0x13309f!==_0x887f('0x1')||_0x13309f[_0x887f('0x2')]===0x0){return _0x46a51e('filepath\x20should\x20be\x20a\x20string');}if(typeof _0x5be12b!==_0x887f('0x1')||_0x5be12b[_0x887f('0x2')]===0x0){return _0x46a51e(_0x887f('0x3'));}if(typeof _0x28ce3c!==_0x887f('0x4')&&(typeof _0x28ce3c!==_0x887f('0x1')||_0x28ce3c[_0x887f('0x2')]===0x0)){return _0x46a51e(_0x887f('0x5'));}try{_0x3ce88c=fs['readFileSync'](_0x13309f)[_0x887f('0x6')]('base64');}catch(_0x130293){return _0x46a51e(_0x130293);}return _0x591ca0({'method':_0x887f('0x7'),'uri':host+_0x887f('0x8')+_0x5be12b,'body':{'config':{'encoding':_0x887f('0x9'),'sampleRateHertz':'8000','languageCode':_0x28ce3c},'audio':{'content':_0x3ce88c}},'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 a6123c5..202e2bf 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 _0x74a9=['exports'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x74a9,0x6b));var _0x974a=function(_0x53c493,_0x425909){_0x53c493=_0x53c493-0x0;var _0x1478ab=_0x74a9[_0x53c493];return _0x1478ab;};var asr=require('./asr');module[_0x974a('0x0')]={'asr':asr}; \ No newline at end of file +var _0x8134=['exports','./asr'];(function(_0x5a1d9f,_0x1fff2a){var _0x55ca03=function(_0xcb32d){while(--_0xcb32d){_0x5a1d9f['push'](_0x5a1d9f['shift']());}};_0x55ca03(++_0x1fff2a);}(_0x8134,0x75));var _0x4813=function(_0x3f5d54,_0x2ab409){_0x3f5d54=_0x3f5d54-0x0;var _0x33d497=_0x8134[_0x3f5d54];return _0x33d497;};var asr=require(_0x4813('0x0'));module[_0x4813('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 7431915..701f37a 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 _0x24c0=['sestekNDA','nda','text','channelData','CustomAction','CustomActionData','AudioFromTts','Data','audiofile','dirName','apiai-promise','bluebird','dialogflow','http','https','path','querystring','randomstring','sox','google-tts-api','url','util','./aws','./google','../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','https:','host','WHAT_EVER','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','finish','info','finish\x20download\x20file','close','unlink','download\x20error','pipe','end','get','data','transcode','wav','error\x20convert','finish\x20to\x20convert','start','resolve','tmp','generate','base64','then','readFileSync','toString','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','MP3','text:synthesize','.mp3','from','audioContent','writeFile','777','chmodSync','googleCloudTTS\x20path','split','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','POST','f.req=','stringify','null','generic','slice','parse\x20response\x20failed:\x0a','text\x20length\x20limit\x20reached','lang\x20\x22','writeFileSync','.wav','goggleTTS\x20path','googleASR','asr','map','alternatives','transcript','join','results','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','name','message','googleDialogflow','textRequest','result','action','actionIncomplete','fulfillment','score','status','metadata','endConversation','isFallbackIntent','googleDialogflowV2','replace','SessionsClient','sessionPath','detectIntent','length','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','intent','isFallback','languageCode','queryText','responseId','intentDetectionConfidence','fulfillmentText','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','polly','awsLex','lex','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','parse'];(function(_0x2051cd,_0x553ea4){var _0x33eafd=function(_0x58cbab){while(--_0x58cbab){_0x2051cd['push'](_0x2051cd['shift']());}};_0x33eafd(++_0x553ea4);}(_0x24c0,0x12e));var _0x024c=function(_0x3bbd1f,_0x119571){_0x3bbd1f=_0x3bbd1f-0x0;var _0x4cb1fe=_0x24c0[_0x3bbd1f];return _0x4cb1fe;};'use strict';var apiai=require(_0x024c('0x0'));var BPromise=require(_0x024c('0x1'));var dialogflow=require(_0x024c('0x2'));var fs=require('fs');var http=require(_0x024c('0x3'));var https=require(_0x024c('0x4'));var md5=require('md5');var path=require(_0x024c('0x5'));var querystring=require(_0x024c('0x6'));var rp=require('request-promise');var rs=require(_0x024c('0x7'));var sox=require(_0x024c('0x8'));var tts=require(_0x024c('0x9'));var urlParse=require(_0x024c('0xa'))['parse'];var util=require(_0x024c('0xb'));var aws=require(_0x024c('0xc'));var google=require(_0x024c('0xd'));var sestek=require('./sestek');var tilde=require('./tilde');var logger=require(_0x024c('0xe'))(_0x024c('0xf'));var ISPEECH_API=_0x024c('0x10');function downloadFile(_0x5c8c9d,_0x39efa1){return new BPromise(function(_0x3bec48,_0x3ff1e8){var _0x57bd87=urlParse(_0x5c8c9d);var _0x1a23b7=_0x57bd87[_0x024c('0x11')]===_0x024c('0x12')?https:http;var _0x43ce21={'host':_0x57bd87[_0x024c('0x13')],'path':_0x57bd87['path'],'headers':{'user-agent':_0x024c('0x14')}};_0x1a23b7['get'](_0x43ce21,function(_0x28d879){if(_0x28d879[_0x024c('0x15')]!==0xc8){logger[_0x024c('0x16')](_0x024c('0x17')+_0x5c8c9d+_0x024c('0x18')+_0x28d879[_0x024c('0x15')]+'\x20('+_0x28d879[_0x024c('0x19')]+')');_0x3ff1e8(new Error(_0x024c('0x17')+_0x5c8c9d+_0x024c('0x18')+_0x28d879[_0x024c('0x15')]+'\x20('+_0x28d879[_0x024c('0x19')]+')'));return;}var _0x3c2ed3=fs[_0x024c('0x1a')](_0x39efa1);_0x3c2ed3['on'](_0x024c('0x1b'),function(){logger[_0x024c('0x1c')](_0x024c('0x1d'));_0x3c2ed3[_0x024c('0x1e')](_0x3bec48);});_0x3c2ed3['on']('error',function(_0x18d5f2){fs[_0x024c('0x1f')](_0x39efa1);logger[_0x024c('0x16')](_0x024c('0x20'),_0x18d5f2);_0x3ff1e8(_0x18d5f2);});_0x28d879[_0x024c('0x21')](_0x3c2ed3);})['on'](_0x024c('0x16'),function(_0x238ca8){logger['error'](_0x238ca8);_0x3ff1e8(_0x238ca8);})[_0x024c('0x22')]();});}function uploadFile(_0x59bbb1){return new BPromise(function(_0x595d31,_0x402174){var _0x5a8272=urlParse(_0x59bbb1);var _0x2ed228=_0x5a8272['protocol']==='https:'?https:http;var _0x4775a1={'host':_0x5a8272['host'],'path':_0x5a8272[_0x024c('0x5')],'headers':{'user-agent':_0x024c('0x14')}};_0x2ed228[_0x024c('0x23')](_0x4775a1,function(_0x52ef4b){if(_0x52ef4b[_0x024c('0x15')]!==0xc8){_0x402174(new Error('request\x20to\x20'+_0x59bbb1+'\x20failed,\x20status\x20code\x20=\x20'+_0x52ef4b[_0x024c('0x15')]+'\x20('+_0x52ef4b['statusMessage']+')'));return;}var _0x2acb0a='';_0x52ef4b['on'](_0x024c('0x24'),function(_0x3a01d5){_0x2acb0a+=_0x3a01d5;});_0x52ef4b['on'](_0x024c('0x22'),function(){_0x595d31(_0x2acb0a);});})['on'](_0x024c('0x16'),function(_0x2baf59){_0x402174(_0x2baf59);})[_0x024c('0x22')]();});}function convertFile(_0x4d6cdc,_0x449ffb){return new BPromise(function(_0x3c1a1e,_0x3ac4fa){var _0xd02d9d=sox[_0x024c('0x25')](_0x4d6cdc,_0x449ffb,{'sampleRate':0x1f40,'format':_0x024c('0x26'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0xd02d9d['on'](_0x024c('0x16'),function(_0x17fc66){logger[_0x024c('0x16')](_0x024c('0x27'),_0x17fc66);_0x3ac4fa(_0x17fc66);});_0xd02d9d['on']('end',function(){logger[_0x024c('0x1c')](_0x024c('0x28'));_0x3c1a1e();});_0xd02d9d[_0x024c('0x29')]();});}function base64Decode(_0x2df2a2,_0x4942f0){var _0x2f8ccd=path[_0x024c('0x2a')](__dirname,_0x024c('0x2b'),rs[_0x024c('0x2c')](0x4)+'.wav');fs['writeFileSync'](_0x2f8ccd,_0x2df2a2,_0x024c('0x2d'));return convertFile(_0x2f8ccd,_0x4942f0)[_0x024c('0x2e')](function(){try{fs['unlink'](_0x2f8ccd);fs['chmodSync'](_0x4942f0,'777');}catch(_0x86b89b){logger[_0x024c('0x16')](_0x86b89b);}return _0x4942f0['split']('.')[0x0];});}function base64Encode(_0x3539a0){var _0x4ef433=fs[_0x024c('0x2f')](_0x3539a0);return new Buffer(_0x4ef433)[_0x024c('0x30')]('base64');}exports[_0x024c('0x31')]=function(_0x403c82,_0x262800,_0x1b8587,_0x4fe733,_0x5cc429,_0x168ce6){var _0x511c47,_0x2b4882;var _0x33f86c=_0x024c('0x32');var _0x9c329b=_0x024c('0x33')+_0x403c82;var _0x9da44c={};if(_0x262800===_0x024c('0x34')){_0x9da44c[_0x024c('0x35')]={'ssml':_0x1b8587};}else{_0x9da44c['input']={'text':_0x1b8587};};_0x9da44c['voice']={'languageCode':_0x4fe733,'ssmlGender':_0x5cc429};_0x9da44c['audioConfig']={'audioEncoding':_0x024c('0x36'),'sampleRateHertz':0x1f40};var _0x2816fb={'url':_0x33f86c+_0x024c('0x37')+_0x9c329b,'method':'POST','json':!![],'body':_0x9da44c};return rp(_0x2816fb)[_0x024c('0x2e')](function(_0x2efc9d){return new BPromise(function(_0x3ea7dd,_0x32a030){_0x511c47=path['resolve'](__dirname,_0x024c('0x2b'),rs[_0x024c('0x2c')](0x4)+_0x024c('0x38'));var _0x4d54d4=Buffer[_0x024c('0x39')](_0x2efc9d[_0x024c('0x3a')],_0x024c('0x2d'));return fs[_0x024c('0x3b')](_0x511c47,_0x4d54d4,function(_0x256d6c){_0x32a030(_0x256d6c);},function(_0x26baae){fs['chmodSync'](_0x511c47,_0x024c('0x3c'));_0x3ea7dd(_0x26baae);});});})[_0x024c('0x2e')](function(_0x152c1d){_0x2b4882=path[_0x024c('0x2a')](__dirname,_0x024c('0x2b'),rs[_0x024c('0x2c')](0x4)+'.wav');return convertFile(_0x511c47,_0x2b4882);})[_0x024c('0x2e')](function(){try{fs[_0x024c('0x1f')](_0x511c47);fs[_0x024c('0x3d')](_0x2b4882,_0x024c('0x3c'));}catch(_0x184458){logger['error'](_0x184458);}logger['info'](_0x024c('0x3e'),_0x2b4882[_0x024c('0x3f')]('.')[0x0]);return _0x2b4882['split']('.')[0x0];});};exports[_0x024c('0x40')]=function(_0x331ea3,_0x587d6f){var _0x5def09=_0x024c('0x41');var _0x49a8cf,_0x44efe8;var _0x5268e3;var _0xe1bf72={'encoding':_0x024c('0x42'),'method':_0x024c('0x43'),'timeout':0x2710,'url':_0x5def09,'headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':_0x024c('0x44')+encodeURIComponent(JSON[_0x024c('0x45')]([[['jQ1olc',JSON[_0x024c('0x45')]([_0x331ea3,_0x587d6f||'en',![],_0x024c('0x46')]),null,_0x024c('0x47')]]]))};return rp(_0xe1bf72)['then'](function(_0x221c62){try{_0x5268e3=eval(_0x221c62[_0x024c('0x48')](0x5))[0x0][0x2];}catch(_0x544c0a){throw new Error(_0x024c('0x49')+_0x221c62[_0x024c('0x24')]);}if(!_0x5268e3){if(_0x331ea3['length']>0xc8){throw new Error(_0x024c('0x4a'));}else{throw new Error(_0x024c('0x4b')+_0x587d6f+'\x22\x20might\x20not\x20exist');}}try{_0x5268e3=eval(_0x5268e3)[0x0];}catch(_0x5e0d2e){throw new Error(_0x024c('0x49')+res[_0x024c('0x24')]);}const _0x4f5a56=_0x5268e3;_0x49a8cf=path[_0x024c('0x2a')](__dirname,_0x024c('0x2b'),rs['generate'](0x4)+_0x024c('0x38'));fs[_0x024c('0x4c')](_0x49a8cf,_0x5268e3,{'encoding':_0x024c('0x2d')});_0x44efe8=path[_0x024c('0x2a')](__dirname,_0x024c('0x2b'),rs[_0x024c('0x2c')](0x4)+_0x024c('0x4d'));return convertFile(_0x49a8cf,_0x44efe8);})[_0x024c('0x2e')](function(){try{fs['unlink'](_0x49a8cf);fs[_0x024c('0x3d')](_0x44efe8,_0x024c('0x3c'));}catch(_0x317bef){logger[_0x024c('0x16')](_0x317bef);}logger['info'](_0x024c('0x4e'),_0x44efe8[_0x024c('0x3f')]('.')[0x0]);return _0x44efe8[_0x024c('0x3f')]('.')[0x0];});};exports[_0x024c('0x4f')]=function(_0x21c9f5,_0x1f3fdd,_0x41bf8a){return google[_0x024c('0x50')](_0x21c9f5,_0x1f3fdd,_0x41bf8a)['then'](function(_0x4d6018){logger[_0x024c('0x1c')](_0x4d6018['uri']);return rp(_0x4d6018);})[_0x024c('0x2e')](function(_0x172525){var _0x4d247a='';var _0x590f88=0x0;try{fs[_0x024c('0x1f')](_0x21c9f5);}catch(_0x19fb24){logger['error'](_0x19fb24);}if(_0x172525&&_0x172525['results']){_0x4d247a=_0x172525['results'][_0x024c('0x51')](function(_0x2ed4ab){return _0x2ed4ab&&_0x2ed4ab[_0x024c('0x52')][0x0]&&_0x2ed4ab[_0x024c('0x52')][0x0][_0x024c('0x53')]?_0x2ed4ab[_0x024c('0x52')][0x0][_0x024c('0x53')]:'';})[_0x024c('0x54')]('\x0a');_0x590f88=_0x172525[_0x024c('0x55')][_0x024c('0x51')](function(_0x15ebe1){return _0x15ebe1&&_0x15ebe1[_0x024c('0x52')][0x0]&&_0x15ebe1['alternatives'][0x0]['confidence']?_0x15ebe1[_0x024c('0x52')][0x0][_0x024c('0x56')]:0x0;})['join']('\x0a');}logger[_0x024c('0x1c')](_0x024c('0x57'),_0x4d247a);logger[_0x024c('0x1c')](_0x024c('0x58'),_0x590f88);return{'transcript':_0x4d247a,'confidence':_0x590f88};})[_0x024c('0x59')](function(_0x5ebc80){logger['error']('[%s]\x20%s:%s',_0x5ebc80[_0x024c('0x15')],_0x5ebc80[_0x024c('0x5a')],_0x5ebc80[_0x024c('0x5b')]);});};exports[_0x024c('0x5c')]=function(_0x2fea26,_0x3753f9,_0xf9d32b,_0x4fc82c){var _0x3a0e83=apiai(_0x3753f9,{'language':_0x4fc82c||'en'});return _0x3a0e83[_0x024c('0x5d')](_0xf9d32b,{'sessionId':md5(_0x2fea26)})[_0x024c('0x2e')](function(_0x582f9b){logger[_0x024c('0x1c')](JSON[_0x024c('0x45')](_0x582f9b));return{'source':_0x582f9b[_0x024c('0x5e')]['source'],'resolvedQuery':_0x582f9b[_0x024c('0x5e')]['resolvedQuery'],'action':_0x582f9b[_0x024c('0x5e')][_0x024c('0x5f')],'actionIncomplete':_0x582f9b[_0x024c('0x5e')][_0x024c('0x60')],'speech':_0x582f9b[_0x024c('0x5e')][_0x024c('0x61')]['speech'],'score':_0x582f9b[_0x024c('0x5e')][_0x024c('0x62')],'statusCode':_0x582f9b[_0x024c('0x63')]['code'],'endConversation':_0x582f9b['result'][_0x024c('0x64')][_0x024c('0x65')]||![],'isFallbackIntent':_0x582f9b['result'][_0x024c('0x64')][_0x024c('0x66')]};});};exports[_0x024c('0x67')]=function(_0x256679,_0x10a960,_0x927441,_0x530cb6,_0x26e406,_0x4997c1){var _0x3a8b5a=_0x530cb6[_0x024c('0x68')](/\\n/g,'\x0a');var _0x2db7e={'credentials':{'private_key':_0x3a8b5a,'client_email':_0x927441}};var _0x3f85f2=new dialogflow[(_0x024c('0x69'))](_0x2db7e);var _0x4b5a00=_0x3f85f2[_0x024c('0x6a')](_0x10a960,md5(_0x256679));var _0x14d0d5={'session':_0x4b5a00,'queryInput':{'text':{'text':_0x26e406,'languageCode':_0x4997c1}}};return _0x3f85f2[_0x024c('0x6b')](_0x14d0d5)[_0x024c('0x2e')](function(_0xa11a4){if(_0xa11a4&&_0xa11a4[_0x024c('0x6c')]){logger[_0x024c('0x1c')](_0x024c('0x6d'),JSON['stringify'](_0xa11a4));var _0x3e6d08=_0xa11a4[0x0];if(_0x3e6d08){var _0x1ef812={'action':_0x3e6d08['queryResult'][_0x024c('0x5f')],'allRequiredParamsPresent':_0x3e6d08[_0x024c('0x6e')][_0x024c('0x6f')],'endConversation':_0x3e6d08[_0x024c('0x6e')][_0x024c('0x70')]&&_0x3e6d08['queryResult'][_0x024c('0x70')]['fields']?_0x3e6d08[_0x024c('0x6e')][_0x024c('0x70')][_0x024c('0x71')][_0x024c('0x72')][_0x024c('0x73')]:![],'fulfillmentText':_0x3e6d08[_0x024c('0x6e')]['fulfillmentText'],'intentName':_0x3e6d08[_0x024c('0x6e')][_0x024c('0x74')][_0x024c('0x5a')],'intentDisplayName':_0x3e6d08[_0x024c('0x6e')][_0x024c('0x74')]['displayName'],'isFallbackIntent':_0x3e6d08[_0x024c('0x6e')]['intent'][_0x024c('0x75')],'languageCode':_0x3e6d08[_0x024c('0x6e')][_0x024c('0x76')],'queryText':_0x3e6d08[_0x024c('0x6e')][_0x024c('0x77')],'responseId':_0x3e6d08[_0x024c('0x78')],'score':_0x3e6d08['queryResult'][_0x024c('0x79')],'speech':_0x3e6d08[_0x024c('0x6e')][_0x024c('0x7a')],'providerResponse':JSON[_0x024c('0x45')](_0xa11a4)};return _0x1ef812;}}});};exports[_0x024c('0x7b')]=function(_0xe20c1d,_0x1826b8,_0x52f7c0,_0x5a876d){return tilde[_0x024c('0x50')](_0xe20c1d,_0x1826b8,_0x52f7c0,_0x5a876d)[_0x024c('0x2e')](function(_0x78d2dd){try{fs['unlink'](_0xe20c1d);}catch(_0x285228){logger[_0x024c('0x16')](_0x285228);}logger[_0x024c('0x1c')](_0x024c('0x7c'),_0x78d2dd[_0x024c('0x53')]);logger[_0x024c('0x1c')](_0x024c('0x7d'),_0x78d2dd[_0x024c('0x56')]);return _0x78d2dd;});};exports[_0x024c('0x7e')]=function(_0x5527c4,_0x36581d,_0x4884be,_0x15b379,_0x2edb54,_0x2253e0){var _0x2727f8=path[_0x024c('0x2a')](__dirname,_0x024c('0x2b'),rs[_0x024c('0x2c')](0x4)+_0x024c('0x38'));var _0x3be47f;return aws[_0x024c('0x7f')](_0x5527c4,_0x36581d,_0x4884be,_0x15b379,_0x2edb54,_0x2253e0,_0x2727f8)[_0x024c('0x2e')](function(){_0x3be47f=path[_0x024c('0x2a')](__dirname,_0x024c('0x2b'),rs['generate'](0x4)+'.wav');return convertFile(_0x2727f8,_0x3be47f);})[_0x024c('0x2e')](function(){try{fs[_0x024c('0x1f')](_0x2727f8);fs['chmodSync'](_0x3be47f,'777');}catch(_0x275e63){logger[_0x024c('0x16')](_0x275e63);}return _0x3be47f[_0x024c('0x3f')]('.')[0x0];});};exports[_0x024c('0x80')]=function(_0x47d9df,_0x41f3e8,_0x125e15,_0x234e07,_0x5cdc23,_0x16129b){return aws[_0x024c('0x81')](_0x47d9df,_0x41f3e8,_0x125e15,_0x234e07,_0x5cdc23,_0x16129b)[_0x024c('0x2e')](function(_0x115f4a){logger[_0x024c('0x1c')](JSON['stringify'](_0x115f4a));return _0x115f4a;});};exports['ispeechTTS']=function(_0x229061,_0x4beee1,_0x438327,_0x8827e6){var _0x30db6d=util[_0x024c('0x82')](_0x024c('0x83'),ISPEECH_API,_0x229061,encodeURIComponent(_0x4beee1),_0x438327,_0x8827e6);var _0x4791e0=path[_0x024c('0x2a')](__dirname,_0x024c('0x2b'),rs[_0x024c('0x2c')](0x4)+_0x024c('0x38'));var _0x469d05;return downloadFile(_0x30db6d,_0x4791e0)['then'](function(){_0x469d05=path[_0x024c('0x2a')](__dirname,_0x024c('0x2b'),rs[_0x024c('0x2c')](0x4)+_0x024c('0x4d'));return convertFile(_0x4791e0,_0x469d05);})[_0x024c('0x2e')](function(){try{fs['unlink'](_0x4791e0);fs[_0x024c('0x3d')](_0x469d05,_0x024c('0x3c'));}catch(_0x3d132e){logger[_0x024c('0x16')](_0x3d132e);}return _0x469d05['split']('.')[0x0];});};exports[_0x024c('0x84')]=function(_0x2e9976,_0x171703,_0x5bf562,_0x318aa7){var _0x881c6f=util[_0x024c('0x82')](_0x024c('0x85'),ISPEECH_API,_0x171703,_0x5bf562,base64Encode(_0x2e9976),_0x318aa7?util[_0x024c('0x82')](_0x024c('0x86'),encodeURIComponent(_0x318aa7)):'freeform=3');return uploadFile(_0x881c6f)['then'](function(_0xeb670e){return querystring[_0x024c('0x87')](_0xeb670e);});};exports[_0x024c('0x88')]=function(_0x4b7e9a,_0xea6f60){return sestek[_0x024c('0x89')](_0x4b7e9a,_0xea6f60)[_0x024c('0x2e')](function(_0x13b238){logger[_0x024c('0x1c')](JSON[_0x024c('0x45')](_0x13b238));var _0x236109={'speech':_0x13b238[_0x024c('0x8a')],'action':_0x13b238[_0x024c('0x8b')]?_0x13b238['channelData'][_0x024c('0x8c')]:undefined,'actiondata':_0x13b238['channelData']?_0x13b238['channelData'][_0x024c('0x8d')]:undefined};if(_0x13b238['channelData']&&_0x13b238['channelData']['AudioFromTts']){return base64Decode(_0x13b238['channelData'][_0x024c('0x8e')][_0x024c('0x8f')],path[_0x024c('0x2a')](__dirname,_0x024c('0x2b'),rs['generate'](0x4)+_0x024c('0x4d')))[_0x024c('0x2e')](function(_0x2bc539){_0x236109[_0x024c('0x90')]=_0x2bc539;return _0x236109;});}return _0x236109;});};exports[_0x024c('0x91')]=function(){return __dirname;}; \ No newline at end of file +var _0x8fbd=['asr','uri','alternatives','transcript','results','confidence','join','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','googleDialogflow','textRequest','result','source','resolvedQuery','action','actionIncomplete','fulfillment','speech','score','status','code','metadata','endConversation','googleDialogflowV2','replace','SessionsClient','detectIntent','length','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','fulfillmentText','intent','displayName','isFallback','languageCode','queryText','intentDetectionConfidence','tildeASR','Tilde\x20ASR\x20confidence','awsPolly','polly','awsLex','lex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','sestekNDA','nda','channelData','CustomAction','AudioFromTts','audiofile','dirName','bluebird','http','https','md5','path','querystring','randomstring','sox','google-tts-api','url','parse','util','./google','./sestek','../../../config/logger','protocol','https:','host','WHAT_EVER','get','statusMessage','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','createWriteStream','finish','info','close','error','unlink','download\x20error','pipe','statusCode','data','end','transcode','error\x20convert','finish\x20to\x20convert','tmp','writeFileSync','base64','then','chmodSync','split','readFileSync','toString','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','voice','MP3','POST','resolve','.mp3','from','writeFile','777','generate','.wav','googleCloudTTS\x20path','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','jQ1olc','stringify','null','generic','parse\x20response\x20failed:\x0a','lang\x20\x22','\x22\x20might\x20not\x20exist','goggleTTS\x20path'];(function(_0x4460d1,_0x113046){var _0x52f94f=function(_0x3a4e5e){while(--_0x3a4e5e){_0x4460d1['push'](_0x4460d1['shift']());}};_0x52f94f(++_0x113046);}(_0x8fbd,0x14d));var _0xd8fb=function(_0x347be8,_0x156165){_0x347be8=_0x347be8-0x0;var _0x402d98=_0x8fbd[_0x347be8];return _0x402d98;};'use strict';var apiai=require('apiai-promise');var BPromise=require(_0xd8fb('0x0'));var dialogflow=require('dialogflow');var fs=require('fs');var http=require(_0xd8fb('0x1'));var https=require(_0xd8fb('0x2'));var md5=require(_0xd8fb('0x3'));var path=require(_0xd8fb('0x4'));var querystring=require(_0xd8fb('0x5'));var rp=require('request-promise');var rs=require(_0xd8fb('0x6'));var sox=require(_0xd8fb('0x7'));var tts=require(_0xd8fb('0x8'));var urlParse=require(_0xd8fb('0x9'))[_0xd8fb('0xa')];var util=require(_0xd8fb('0xb'));var aws=require('./aws');var google=require(_0xd8fb('0xc'));var sestek=require(_0xd8fb('0xd'));var tilde=require('./tilde');var logger=require(_0xd8fb('0xe'))('agi');var ISPEECH_API='https://api.ispeech.org/api/rest';function downloadFile(_0x419669,_0x49059f){return new BPromise(function(_0x2ad743,_0x523bc4){var _0x3089e9=urlParse(_0x419669);var _0x163b2c=_0x3089e9[_0xd8fb('0xf')]===_0xd8fb('0x10')?https:http;var _0x1533c1={'host':_0x3089e9[_0xd8fb('0x11')],'path':_0x3089e9[_0xd8fb('0x4')],'headers':{'user-agent':_0xd8fb('0x12')}};_0x163b2c[_0xd8fb('0x13')](_0x1533c1,function(_0x2dc444){if(_0x2dc444['statusCode']!==0xc8){logger['error']('request\x20to\x20'+_0x419669+'\x20failed,\x20status\x20code\x20=\x20'+_0x2dc444['statusCode']+'\x20('+_0x2dc444[_0xd8fb('0x14')]+')');_0x523bc4(new Error(_0xd8fb('0x15')+_0x419669+_0xd8fb('0x16')+_0x2dc444['statusCode']+'\x20('+_0x2dc444[_0xd8fb('0x14')]+')'));return;}var _0xa078ca=fs[_0xd8fb('0x17')](_0x49059f);_0xa078ca['on'](_0xd8fb('0x18'),function(){logger[_0xd8fb('0x19')]('finish\x20download\x20file');_0xa078ca[_0xd8fb('0x1a')](_0x2ad743);});_0xa078ca['on'](_0xd8fb('0x1b'),function(_0x55fce1){fs[_0xd8fb('0x1c')](_0x49059f);logger[_0xd8fb('0x1b')](_0xd8fb('0x1d'),_0x55fce1);_0x523bc4(_0x55fce1);});_0x2dc444[_0xd8fb('0x1e')](_0xa078ca);})['on'](_0xd8fb('0x1b'),function(_0x3f35cc){logger[_0xd8fb('0x1b')](_0x3f35cc);_0x523bc4(_0x3f35cc);})['end']();});}function uploadFile(_0x4b6a20){return new BPromise(function(_0x2b967b,_0x2bad34){var _0x5abb09=urlParse(_0x4b6a20);var _0xa1ce89=_0x5abb09['protocol']===_0xd8fb('0x10')?https:http;var _0x570d75={'host':_0x5abb09[_0xd8fb('0x11')],'path':_0x5abb09[_0xd8fb('0x4')],'headers':{'user-agent':_0xd8fb('0x12')}};_0xa1ce89['get'](_0x570d75,function(_0x5064a9){if(_0x5064a9['statusCode']!==0xc8){_0x2bad34(new Error(_0xd8fb('0x15')+_0x4b6a20+_0xd8fb('0x16')+_0x5064a9[_0xd8fb('0x1f')]+'\x20('+_0x5064a9['statusMessage']+')'));return;}var _0x2487e8='';_0x5064a9['on'](_0xd8fb('0x20'),function(_0x26d534){_0x2487e8+=_0x26d534;});_0x5064a9['on']('end',function(){_0x2b967b(_0x2487e8);});})['on']('error',function(_0x2b9548){_0x2bad34(_0x2b9548);})[_0xd8fb('0x21')]();});}function convertFile(_0x51c2fd,_0x154c06){return new BPromise(function(_0x333463,_0x3183b6){var _0x238507=sox[_0xd8fb('0x22')](_0x51c2fd,_0x154c06,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x238507['on'](_0xd8fb('0x1b'),function(_0x312323){logger[_0xd8fb('0x1b')](_0xd8fb('0x23'),_0x312323);_0x3183b6(_0x312323);});_0x238507['on'](_0xd8fb('0x21'),function(){logger[_0xd8fb('0x19')](_0xd8fb('0x24'));_0x333463();});_0x238507['start']();});}function base64Decode(_0x34493b,_0xfb1a27){var _0x3ed05b=path['resolve'](__dirname,_0xd8fb('0x25'),rs['generate'](0x4)+'.wav');fs[_0xd8fb('0x26')](_0x3ed05b,_0x34493b,_0xd8fb('0x27'));return convertFile(_0x3ed05b,_0xfb1a27)[_0xd8fb('0x28')](function(){try{fs['unlink'](_0x3ed05b);fs[_0xd8fb('0x29')](_0xfb1a27,'777');}catch(_0x5617b0){logger[_0xd8fb('0x1b')](_0x5617b0);}return _0xfb1a27[_0xd8fb('0x2a')]('.')[0x0];});}function base64Encode(_0x23b3bd){var _0x583945=fs[_0xd8fb('0x2b')](_0x23b3bd);return new Buffer(_0x583945)[_0xd8fb('0x2c')](_0xd8fb('0x27'));}exports[_0xd8fb('0x2d')]=function(_0x548c96,_0x1b1f12,_0x4080b3,_0x38c76c,_0x3a49a3,_0x257ea0){var _0x7aaeb6,_0x1cd01b;var _0x5b7ca0=_0xd8fb('0x2e');var _0x32926c=_0xd8fb('0x2f')+_0x548c96;var _0x5ce670={};if(_0x1b1f12===_0xd8fb('0x30')){_0x5ce670[_0xd8fb('0x31')]={'ssml':_0x4080b3};}else{_0x5ce670['input']={'text':_0x4080b3};};_0x5ce670[_0xd8fb('0x32')]={'languageCode':_0x38c76c,'ssmlGender':_0x3a49a3};_0x5ce670['audioConfig']={'audioEncoding':_0xd8fb('0x33'),'sampleRateHertz':0x1f40};var _0x4808c3={'url':_0x5b7ca0+'text:synthesize'+_0x32926c,'method':_0xd8fb('0x34'),'json':!![],'body':_0x5ce670};return rp(_0x4808c3)[_0xd8fb('0x28')](function(_0x4d5b8e){return new BPromise(function(_0x27139f,_0x2bd6d0){_0x7aaeb6=path[_0xd8fb('0x35')](__dirname,_0xd8fb('0x25'),rs['generate'](0x4)+_0xd8fb('0x36'));var _0x484026=Buffer[_0xd8fb('0x37')](_0x4d5b8e['audioContent'],_0xd8fb('0x27'));return fs[_0xd8fb('0x38')](_0x7aaeb6,_0x484026,function(_0x1a228b){_0x2bd6d0(_0x1a228b);},function(_0x260b66){fs[_0xd8fb('0x29')](_0x7aaeb6,_0xd8fb('0x39'));_0x27139f(_0x260b66);});});})[_0xd8fb('0x28')](function(_0xd24d14){_0x1cd01b=path[_0xd8fb('0x35')](__dirname,_0xd8fb('0x25'),rs[_0xd8fb('0x3a')](0x4)+_0xd8fb('0x3b'));return convertFile(_0x7aaeb6,_0x1cd01b);})[_0xd8fb('0x28')](function(){try{fs['unlink'](_0x7aaeb6);fs['chmodSync'](_0x1cd01b,_0xd8fb('0x39'));}catch(_0x167c84){logger[_0xd8fb('0x1b')](_0x167c84);}logger[_0xd8fb('0x19')](_0xd8fb('0x3c'),_0x1cd01b[_0xd8fb('0x2a')]('.')[0x0]);return _0x1cd01b[_0xd8fb('0x2a')]('.')[0x0];});};exports[_0xd8fb('0x3d')]=function(_0x563a0c,_0x5c5692){var _0x3e9c20=_0xd8fb('0x3e');var _0x32dd14,_0x59a970;var _0x2bceda;var _0x45b27b={'encoding':_0xd8fb('0x3f'),'method':_0xd8fb('0x34'),'timeout':0x2710,'url':_0x3e9c20,'headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':'f.req='+encodeURIComponent(JSON['stringify']([[[_0xd8fb('0x40'),JSON[_0xd8fb('0x41')]([_0x563a0c,_0x5c5692||'en',![],_0xd8fb('0x42')]),null,_0xd8fb('0x43')]]]))};return rp(_0x45b27b)[_0xd8fb('0x28')](function(_0x4d62e8){try{_0x2bceda=eval(_0x4d62e8['slice'](0x5))[0x0][0x2];}catch(_0x1cf7cd){throw new Error(_0xd8fb('0x44')+_0x4d62e8['data']);}if(!_0x2bceda){if(_0x563a0c['length']>0xc8){throw new Error('text\x20length\x20limit\x20reached');}else{throw new Error(_0xd8fb('0x45')+_0x5c5692+_0xd8fb('0x46'));}}try{_0x2bceda=eval(_0x2bceda)[0x0];}catch(_0x24eca3){throw new Error(_0xd8fb('0x44')+res[_0xd8fb('0x20')]);}const _0xda7316=_0x2bceda;_0x32dd14=path['resolve'](__dirname,'tmp',rs[_0xd8fb('0x3a')](0x4)+_0xd8fb('0x36'));fs[_0xd8fb('0x26')](_0x32dd14,_0x2bceda,{'encoding':_0xd8fb('0x27')});_0x59a970=path[_0xd8fb('0x35')](__dirname,_0xd8fb('0x25'),rs[_0xd8fb('0x3a')](0x4)+_0xd8fb('0x3b'));return convertFile(_0x32dd14,_0x59a970);})[_0xd8fb('0x28')](function(){try{fs[_0xd8fb('0x1c')](_0x32dd14);fs['chmodSync'](_0x59a970,'777');}catch(_0x478d2a){logger[_0xd8fb('0x1b')](_0x478d2a);}logger[_0xd8fb('0x19')](_0xd8fb('0x47'),_0x59a970[_0xd8fb('0x2a')]('.')[0x0]);return _0x59a970[_0xd8fb('0x2a')]('.')[0x0];});};exports['googleASR']=function(_0x4b89ba,_0x5979c7,_0x586f8b){return google[_0xd8fb('0x48')](_0x4b89ba,_0x5979c7,_0x586f8b)[_0xd8fb('0x28')](function(_0x4220e5){logger[_0xd8fb('0x19')](_0x4220e5[_0xd8fb('0x49')]);return rp(_0x4220e5);})['then'](function(_0x2df913){var _0x4ec8cc='';var _0x4fffdc=0x0;try{fs['unlink'](_0x4b89ba);}catch(_0x2fe1af){logger[_0xd8fb('0x1b')](_0x2fe1af);}if(_0x2df913&&_0x2df913['results']){_0x4ec8cc=_0x2df913['results']['map'](function(_0x4630e8){return _0x4630e8&&_0x4630e8['alternatives'][0x0]&&_0x4630e8[_0xd8fb('0x4a')][0x0][_0xd8fb('0x4b')]?_0x4630e8[_0xd8fb('0x4a')][0x0][_0xd8fb('0x4b')]:'';})['join']('\x0a');_0x4fffdc=_0x2df913[_0xd8fb('0x4c')]['map'](function(_0x593d90){return _0x593d90&&_0x593d90[_0xd8fb('0x4a')][0x0]&&_0x593d90[_0xd8fb('0x4a')][0x0][_0xd8fb('0x4d')]?_0x593d90[_0xd8fb('0x4a')][0x0][_0xd8fb('0x4d')]:0x0;})[_0xd8fb('0x4e')]('\x0a');}logger[_0xd8fb('0x19')](_0xd8fb('0x4f'),_0x4ec8cc);logger[_0xd8fb('0x19')](_0xd8fb('0x50'),_0x4fffdc);return{'transcript':_0x4ec8cc,'confidence':_0x4fffdc};})[_0xd8fb('0x51')](function(_0xee7ddc){logger[_0xd8fb('0x1b')](_0xd8fb('0x52'),_0xee7ddc['statusCode'],_0xee7ddc[_0xd8fb('0x53')],_0xee7ddc['message']);});};exports[_0xd8fb('0x54')]=function(_0x54ae4e,_0x305e63,_0x1d433d,_0x2ef9d8){var _0x27a410=apiai(_0x305e63,{'language':_0x2ef9d8||'en'});return _0x27a410[_0xd8fb('0x55')](_0x1d433d,{'sessionId':md5(_0x54ae4e)})[_0xd8fb('0x28')](function(_0x23a7b7){logger[_0xd8fb('0x19')](JSON['stringify'](_0x23a7b7));return{'source':_0x23a7b7[_0xd8fb('0x56')][_0xd8fb('0x57')],'resolvedQuery':_0x23a7b7[_0xd8fb('0x56')][_0xd8fb('0x58')],'action':_0x23a7b7[_0xd8fb('0x56')][_0xd8fb('0x59')],'actionIncomplete':_0x23a7b7['result'][_0xd8fb('0x5a')],'speech':_0x23a7b7['result'][_0xd8fb('0x5b')][_0xd8fb('0x5c')],'score':_0x23a7b7[_0xd8fb('0x56')][_0xd8fb('0x5d')],'statusCode':_0x23a7b7[_0xd8fb('0x5e')][_0xd8fb('0x5f')],'endConversation':_0x23a7b7[_0xd8fb('0x56')][_0xd8fb('0x60')][_0xd8fb('0x61')]||![],'isFallbackIntent':_0x23a7b7['result'][_0xd8fb('0x60')]['isFallbackIntent']};});};exports[_0xd8fb('0x62')]=function(_0x54c6ef,_0x71adfc,_0x3ee11f,_0x28e1e6,_0x27106c,_0x142dbb){var _0x85b4e3=_0x28e1e6[_0xd8fb('0x63')](/\\n/g,'\x0a');var _0x2c3aa5={'credentials':{'private_key':_0x85b4e3,'client_email':_0x3ee11f}};var _0x18ce20=new dialogflow[(_0xd8fb('0x64'))](_0x2c3aa5);var _0x234807=_0x18ce20['sessionPath'](_0x71adfc,md5(_0x54c6ef));var _0x45bfc8={'session':_0x234807,'queryInput':{'text':{'text':_0x27106c,'languageCode':_0x142dbb}}};return _0x18ce20[_0xd8fb('0x65')](_0x45bfc8)[_0xd8fb('0x28')](function(_0x23b5bd){if(_0x23b5bd&&_0x23b5bd[_0xd8fb('0x66')]){logger[_0xd8fb('0x19')](_0xd8fb('0x67'),JSON[_0xd8fb('0x41')](_0x23b5bd));var _0xde6664=_0x23b5bd[0x0];if(_0xde6664){var _0x5b7868={'action':_0xde6664[_0xd8fb('0x68')][_0xd8fb('0x59')],'allRequiredParamsPresent':_0xde6664['queryResult'][_0xd8fb('0x69')],'endConversation':_0xde6664['queryResult'][_0xd8fb('0x6a')]&&_0xde6664[_0xd8fb('0x68')][_0xd8fb('0x6a')][_0xd8fb('0x6b')]?_0xde6664['queryResult'][_0xd8fb('0x6a')][_0xd8fb('0x6b')][_0xd8fb('0x6c')]['boolValue']:![],'fulfillmentText':_0xde6664[_0xd8fb('0x68')][_0xd8fb('0x6d')],'intentName':_0xde6664[_0xd8fb('0x68')][_0xd8fb('0x6e')][_0xd8fb('0x53')],'intentDisplayName':_0xde6664[_0xd8fb('0x68')][_0xd8fb('0x6e')][_0xd8fb('0x6f')],'isFallbackIntent':_0xde6664[_0xd8fb('0x68')][_0xd8fb('0x6e')][_0xd8fb('0x70')],'languageCode':_0xde6664[_0xd8fb('0x68')][_0xd8fb('0x71')],'queryText':_0xde6664[_0xd8fb('0x68')][_0xd8fb('0x72')],'responseId':_0xde6664['responseId'],'score':_0xde6664[_0xd8fb('0x68')][_0xd8fb('0x73')],'speech':_0xde6664[_0xd8fb('0x68')][_0xd8fb('0x6d')],'providerResponse':JSON[_0xd8fb('0x41')](_0x23b5bd)};return _0x5b7868;}}});};exports[_0xd8fb('0x74')]=function(_0x10f34c,_0x418ef3,_0x553f34,_0x465a8a){return tilde['asr'](_0x10f34c,_0x418ef3,_0x553f34,_0x465a8a)['then'](function(_0x15d699){try{fs[_0xd8fb('0x1c')](_0x10f34c);}catch(_0x2c18ee){logger[_0xd8fb('0x1b')](_0x2c18ee);}logger['info']('Tilde\x20ASR\x20transcription',_0x15d699[_0xd8fb('0x4b')]);logger[_0xd8fb('0x19')](_0xd8fb('0x75'),_0x15d699[_0xd8fb('0x4d')]);return _0x15d699;});};exports[_0xd8fb('0x76')]=function(_0x3c4939,_0x4b434a,_0x48c1c1,_0x578bc5,_0x3c1b26,_0x53be59){var _0x2c4f54=path['resolve'](__dirname,_0xd8fb('0x25'),rs[_0xd8fb('0x3a')](0x4)+_0xd8fb('0x36'));var _0x367d64;return aws[_0xd8fb('0x77')](_0x3c4939,_0x4b434a,_0x48c1c1,_0x578bc5,_0x3c1b26,_0x53be59,_0x2c4f54)[_0xd8fb('0x28')](function(){_0x367d64=path[_0xd8fb('0x35')](__dirname,_0xd8fb('0x25'),rs[_0xd8fb('0x3a')](0x4)+_0xd8fb('0x3b'));return convertFile(_0x2c4f54,_0x367d64);})['then'](function(){try{fs[_0xd8fb('0x1c')](_0x2c4f54);fs[_0xd8fb('0x29')](_0x367d64,_0xd8fb('0x39'));}catch(_0x2c11d0){logger[_0xd8fb('0x1b')](_0x2c11d0);}return _0x367d64[_0xd8fb('0x2a')]('.')[0x0];});};exports[_0xd8fb('0x78')]=function(_0x39b71c,_0x225f23,_0x2becf3,_0x4df841,_0x3a4d13,_0x2a3f4e){return aws[_0xd8fb('0x79')](_0x39b71c,_0x225f23,_0x2becf3,_0x4df841,_0x3a4d13,_0x2a3f4e)[_0xd8fb('0x28')](function(_0x225a79){logger[_0xd8fb('0x19')](JSON['stringify'](_0x225a79));return _0x225a79;});};exports[_0xd8fb('0x7a')]=function(_0x396f83,_0x3159c3,_0xe36f6d,_0xf3cc80){var _0x542cb1=util[_0xd8fb('0x7b')](_0xd8fb('0x7c'),ISPEECH_API,_0x396f83,encodeURIComponent(_0x3159c3),_0xe36f6d,_0xf3cc80);var _0x511c77=path[_0xd8fb('0x35')](__dirname,_0xd8fb('0x25'),rs[_0xd8fb('0x3a')](0x4)+_0xd8fb('0x36'));var _0x5bf6f5;return downloadFile(_0x542cb1,_0x511c77)['then'](function(){_0x5bf6f5=path[_0xd8fb('0x35')](__dirname,_0xd8fb('0x25'),rs['generate'](0x4)+_0xd8fb('0x3b'));return convertFile(_0x511c77,_0x5bf6f5);})[_0xd8fb('0x28')](function(){try{fs[_0xd8fb('0x1c')](_0x511c77);fs['chmodSync'](_0x5bf6f5,'777');}catch(_0xbc728e){logger[_0xd8fb('0x1b')](_0xbc728e);}return _0x5bf6f5['split']('.')[0x0];});};exports[_0xd8fb('0x7d')]=function(_0x4e984e,_0x4abbf,_0xbefe95,_0x32ae9e){var _0x2908b8=util['format'](_0xd8fb('0x7e'),ISPEECH_API,_0x4abbf,_0xbefe95,base64Encode(_0x4e984e),_0x32ae9e?util[_0xd8fb('0x7b')](_0xd8fb('0x7f'),encodeURIComponent(_0x32ae9e)):'freeform=3');return uploadFile(_0x2908b8)['then'](function(_0x27c6a3){return querystring[_0xd8fb('0xa')](_0x27c6a3);});};exports[_0xd8fb('0x80')]=function(_0x5e6593,_0x34d98b){return sestek[_0xd8fb('0x81')](_0x5e6593,_0x34d98b)[_0xd8fb('0x28')](function(_0x5b4870){logger[_0xd8fb('0x19')](JSON['stringify'](_0x5b4870));var _0x38d943={'speech':_0x5b4870['text'],'action':_0x5b4870['channelData']?_0x5b4870[_0xd8fb('0x82')][_0xd8fb('0x83')]:undefined,'actiondata':_0x5b4870['channelData']?_0x5b4870[_0xd8fb('0x82')]['CustomActionData']:undefined};if(_0x5b4870[_0xd8fb('0x82')]&&_0x5b4870[_0xd8fb('0x82')][_0xd8fb('0x84')]){return base64Decode(_0x5b4870[_0xd8fb('0x82')][_0xd8fb('0x84')]['Data'],path[_0xd8fb('0x35')](__dirname,_0xd8fb('0x25'),rs[_0xd8fb('0x3a')](0x4)+_0xd8fb('0x3b')))['then'](function(_0x37e4ca){_0x38d943[_0xd8fb('0x85')]=_0x37e4ca;return _0x38d943;});}return _0x38d943;});};exports[_0xd8fb('0x86')]=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 cf213e9..0cc655e 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 _0x47e0=['exports','./nda'];(function(_0x16972f,_0x24951d){var _0x3e2509=function(_0x52339a){while(--_0x52339a){_0x16972f['push'](_0x16972f['shift']());}};_0x3e2509(++_0x24951d);}(_0x47e0,0x131));var _0x047e=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x47e0[_0x321bb2];return _0x9c12ed;};var nda=require(_0x047e('0x0'));module[_0x047e('0x1')]={'nda':nda}; \ No newline at end of file +var _0x128c=['exports','./nda'];(function(_0x12a315,_0x5bfa29){var _0x3e57db=function(_0x3da526){while(--_0x3da526){_0x12a315['push'](_0x12a315['shift']());}};_0x3e57db(++_0x5bfa29);}(_0x128c,0x71));var _0xc128=function(_0x4482ca,_0x42eabd){_0x4482ca=_0x4482ca-0x0;var _0xa7b9fb=_0x128c[_0x4482ca];return _0xa7b9fb;};var nda=require(_0xc128('0x0'));module[_0xc128('0x1')]={'nda':nda}; \ No newline at end of file diff --git a/server/services/agi/scripts/sestek/nda/index.js b/server/services/agi/scripts/sestek/nda/index.js index 03174df..44d3f26 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 _0x3402=['request-promise','../../../../../config/logger','agi','exports','POST','resolve','ndauth_url','/token','password','then','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda','callerid','calleridname','text','access_token','body','channelData','ProjectName','project','ndagenerate_audio','audio/wav','custom_action','CustomAction','custom_action_data','CustomActionData','info','stringify'];(function(_0x387583,_0x127b08){var _0x45d2f9=function(_0x1d82ac){while(--_0x1d82ac){_0x387583['push'](_0x387583['shift']());}};_0x45d2f9(++_0x127b08);}(_0x3402,0x1f0));var _0x2340=function(_0x38f337,_0x5ce560){_0x38f337=_0x38f337-0x0;var _0x30675e=_0x3402[_0x38f337];return _0x30675e;};'use strict';var rp=require(_0x2340('0x0'));var url=require('url');var logger=require(_0x2340('0x1'))(_0x2340('0x2'));module[_0x2340('0x3')]=function(_0x5eeb10,_0x5dce8b){var _0x277b67={'method':_0x2340('0x4'),'uri':url[_0x2340('0x5')](_0x5dce8b[_0x2340('0x6')],_0x2340('0x7')),'form':{'grant_type':'password','username':_0x5dce8b['username'],'password':_0x5dce8b[_0x2340('0x8')]},'json':!![]};return rp(_0x277b67)[_0x2340('0x9')](function(_0x16174f){var _0x225250={'method':_0x2340('0x4'),'uri':url['resolve'](_0x5dce8b[_0x2340('0xa')],_0x2340('0xb')),'body':{'type':_0x5dce8b[_0x2340('0xc')]||_0x2340('0xd'),'channelId':_0x2340('0xe'),'conversation':{'id':_0x5eeb10['uniqueid']},'from':{'id':_0x5eeb10[_0x2340('0xf')],'name':_0x5eeb10[_0x2340('0x10')]},'recipient':{'id':_0x5eeb10['dnid'],'name':_0x5eeb10['extension']},'text':_0x5dce8b[_0x2340('0x11')],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x16174f[_0x2340('0x12')]},'json':!![]};if(_0x5dce8b['project']){_0x225250[_0x2340('0x13')][_0x2340('0x14')][_0x2340('0x15')]=_0x5dce8b[_0x2340('0x16')];}if(_0x5dce8b[_0x2340('0x17')]=='1'){_0x225250[_0x2340('0x13')][_0x2340('0x14')]['AudioOutputSettings']={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x2340('0x18')};}if(_0x5dce8b[_0x2340('0x19')]){_0x225250[_0x2340('0x13')]['channelData'][_0x2340('0x1a')]=_0x5dce8b[_0x2340('0x19')];if(_0x5dce8b[_0x2340('0x1b')]){_0x225250[_0x2340('0x13')]['channelData'][_0x2340('0x1c')]=_0x5dce8b[_0x2340('0x1b')];}}logger[_0x2340('0x1d')](JSON[_0x2340('0x1e')](_0x225250));return rp(_0x225250);});}; \ No newline at end of file +var _0xc4dd=['text','body','channelData','ProjectName','ndagenerate_audio','audio/wav','CustomAction','custom_action','custom_action_data','CustomActionData','info','request-promise','url','../../../../../config/logger','exports','POST','/token','password','then','resolve','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','uniqueid','callerid','dnid'];(function(_0x54bc1c,_0x269933){var _0x10569c=function(_0x5c0eac){while(--_0x5c0eac){_0x54bc1c['push'](_0x54bc1c['shift']());}};_0x10569c(++_0x269933);}(_0xc4dd,0xad));var _0xdc4d=function(_0x3c8980,_0x5a6c30){_0x3c8980=_0x3c8980-0x0;var _0x57c950=_0xc4dd[_0x3c8980];return _0x57c950;};'use strict';var rp=require(_0xdc4d('0x0'));var url=require(_0xdc4d('0x1'));var logger=require(_0xdc4d('0x2'))('agi');module[_0xdc4d('0x3')]=function(_0x44ba4b,_0x3a5aec){var _0x43f85e={'method':_0xdc4d('0x4'),'uri':url['resolve'](_0x3a5aec['ndauth_url'],_0xdc4d('0x5')),'form':{'grant_type':_0xdc4d('0x6'),'username':_0x3a5aec['username'],'password':_0x3a5aec[_0xdc4d('0x6')]},'json':!![]};return rp(_0x43f85e)[_0xdc4d('0x7')](function(_0x566564){var _0x1c2e51={'method':_0xdc4d('0x4'),'uri':url[_0xdc4d('0x8')](_0x3a5aec[_0xdc4d('0x9')],_0xdc4d('0xa')),'body':{'type':_0x3a5aec[_0xdc4d('0xb')]||_0xdc4d('0xc'),'channelId':'Nda','conversation':{'id':_0x44ba4b[_0xdc4d('0xd')]},'from':{'id':_0x44ba4b[_0xdc4d('0xe')],'name':_0x44ba4b['calleridname']},'recipient':{'id':_0x44ba4b[_0xdc4d('0xf')],'name':_0x44ba4b['extension']},'text':_0x3a5aec[_0xdc4d('0x10')],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x566564['access_token']},'json':!![]};if(_0x3a5aec['project']){_0x1c2e51[_0xdc4d('0x11')][_0xdc4d('0x12')][_0xdc4d('0x13')]=_0x3a5aec['project'];}if(_0x3a5aec[_0xdc4d('0x14')]=='1'){_0x1c2e51[_0xdc4d('0x11')][_0xdc4d('0x12')]['AudioOutputSettings']={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xdc4d('0x15')};}if(_0x3a5aec['custom_action']){_0x1c2e51['body'][_0xdc4d('0x12')][_0xdc4d('0x16')]=_0x3a5aec[_0xdc4d('0x17')];if(_0x3a5aec[_0xdc4d('0x18')]){_0x1c2e51['body'][_0xdc4d('0x12')][_0xdc4d('0x19')]=_0x3a5aec[_0xdc4d('0x18')];}}logger[_0xdc4d('0x1a')](JSON['stringify'](_0x1c2e51));return rp(_0x1c2e51);});}; \ 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 0c2e6dc..0669b5a 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 _0xaa6f=['./lib/api','exports'];(function(_0x3dbbfc,_0x6669e){var _0x1f1734=function(_0x211d9c){while(--_0x211d9c){_0x3dbbfc['push'](_0x3dbbfc['shift']());}};_0x1f1734(++_0x6669e);}(_0xaa6f,0x6a));var _0xfaa6=function(_0x3519b9,_0x8ad5fb){_0x3519b9=_0x3519b9-0x0;var _0x3f2f2a=_0xaa6f[_0x3519b9];return _0x3f2f2a;};'use strict';var asr=require(_0xfaa6('0x0'));module[_0xfaa6('0x1')]=function(_0x5abea7,_0x29c5e5,_0x43ccbb,_0x135985){return asr(_0x5abea7,_0x29c5e5,_0x43ccbb,_0x135985);}; \ No newline at end of file +var _0xcbb1=['exports'];(function(_0x45c981,_0x2ad2d4){var _0x4f62c8=function(_0x55209b){while(--_0x55209b){_0x45c981['push'](_0x45c981['shift']());}};_0x4f62c8(++_0x2ad2d4);}(_0xcbb1,0x1d2));var _0x1cbb=function(_0x17f73a,_0x367a44){_0x17f73a=_0x17f73a-0x0;var _0x2f6b83=_0xcbb1[_0x17f73a];return _0x2f6b83;};'use strict';var asr=require('./lib/api');module[_0x1cbb('0x0')]=function(_0x5a19f2,_0x570b71,_0x2aa546,_0x2d2719){return asr(_0x5a19f2,_0x570b71,_0x2aa546,_0x2d2719);}; \ 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 a9a36ef..b8df448 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 _0x27b4=['message','bluebird','moment','crypto','../../../../../../config/logger','agi','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','update','hex','Open\x20Tilde\x20ASR\x20socket','unix','send','data','close','EOS','error','Tilde\x20ASR\x20send\x20error','stringify','terminate','parse','status','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','isObject'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0x27b4,0xbf));var _0x427b=function(_0x17c67c,_0xd2afec){_0x17c67c=_0x17c67c-0x0;var _0x550479=_0x27b4[_0x17c67c];return _0x550479;};'use strict';var BPromise=require(_0x427b('0x0'));var _=require('lodash');var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x427b('0x1'));var crypto=require(_0x427b('0x2'));var logger=require(_0x427b('0x3'))(_0x427b('0x4'));module['exports']=function(_0x1b44b7,_0x116c4e,_0x24df3e,_0xb7924c){return new BPromise(function(_0x3de49e,_0x483d46){logger[_0x427b('0x5')](_0x427b('0x6'),_0xb7924c||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE');var _0x23738d=new WebSocket(_0xb7924c||_0x427b('0x7'),{'perMessageDeflate':![]});var _0x32884f='';var _0x340dcb='0';var _0xc89ebe='1';var _0x351ec7=_0x427b('0x8');function _0x4c9092(_0x2c3f5d){var _0x4ce70f=crypto[_0x427b('0x9')]('sha1');_0x4ce70f[_0x427b('0xa')](_0x2c3f5d);return _0x4ce70f['digest'](_0x427b('0xb'));}function _0x4c203e(){try{logger['info'](_0x427b('0xc'));var _0x1d58ac=moment()[_0x427b('0xd')]();var _0x4a1e1b=_0x4c9092(_0x1d58ac+_0x116c4e+_0x24df3e);_0x23738d[_0x427b('0xe')](JSON['stringify']({'appID':_0x116c4e,'timestamp':_0x1d58ac,'appKey':_0x4a1e1b}));var _0x2dee7d=fs['createReadStream'](_0x1b44b7);_0x2dee7d['on'](_0x427b('0xf'),function(_0x5de00f){_0x23738d['send'](_0x5de00f);});_0x2dee7d['on'](_0x427b('0x10'),function(){_0x23738d[_0x427b('0xe')](_0x427b('0x11'));});}catch(_0x4720e1){logger[_0x427b('0x12')](_0x427b('0x13'),JSON[_0x427b('0x14')](_0x4720e1));_0x23738d[_0x427b('0x15')]();}}function _0x52cfb3(_0x5419d8){try{if(_0x5419d8){var _0x3592fa=JSON[_0x427b('0x16')](_0x5419d8);switch(_0x3592fa[_0x427b('0x17')]){case 0x0:if(_0x3592fa[_0x427b('0x18')]){if(_0x3592fa[_0x427b('0x18')]['final']){logger[_0x427b('0x5')]('Tilde\x20ASR\x20hypoteses',JSON['stringify'](_0x3592fa[_0x427b('0x18')][_0x427b('0x19')]));_0x32884f=_0x3592fa[_0x427b('0x18')][_0x427b('0x19')][0x0][_0x427b('0x1a')];_0x340dcb=_0x3592fa[_0x427b('0x18')][_0x427b('0x19')][0x0][_0x427b('0x1b')];_0xc89ebe='0';_0x351ec7=_0x427b('0x1c');_0x23738d['terminate']();}}break;case 0x1:logger['info'](_0x427b('0x8'));_0xc89ebe='1';_0x351ec7='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';break;case 0x2:logger[_0x427b('0x5')](_0x427b('0x1d'));_0xc89ebe='2';_0x351ec7=_0x427b('0x1d');break;case 0x9:logger['info'](_0x427b('0x1e'));_0xc89ebe='9';_0x351ec7=_0x427b('0x1e');break;case 0xa:logger[_0x427b('0x5')](_0x427b('0x1f'));_0xc89ebe='10';_0x351ec7=_0x427b('0x1f');break;case 0xb:logger[_0x427b('0x5')](_0x427b('0x20'));_0xc89ebe='11';_0x351ec7=_0x427b('0x20');}}}catch(_0x217c08){logger[_0x427b('0x12')](_0x427b('0x21'),JSON[_0x427b('0x14')](_0x217c08));_0x23738d['terminate']();}}function _0x366395(){logger[_0x427b('0x5')](_0x427b('0x22'));_0x3de49e({'transcript':_0x32884f,'confidence':_0x340dcb,'status':_0xc89ebe,'status_message':_0x351ec7});}function _0x3b5d0a(_0x5c5efc){logger[_0x427b('0x12')](_0x427b('0x23'));if(!_['isNil'](_0x5c5efc)){logger[_0x427b('0x12')](_[_0x427b('0x24')](_0x5c5efc)?JSON['stringify'](_0x5c5efc):_0x5c5efc);}}_0x23738d['on']('open',_0x4c203e);_0x23738d['on'](_0x427b('0x25'),_0x52cfb3);_0x23738d['on']('close',_0x366395);_0x23738d['on'](_0x427b('0x12'),_0x3b5d0a);});}; \ No newline at end of file +var _0xa0cd=['open','message','bluebird','lodash','moment','crypto','../../../../../../config/logger','agi','exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','sha1','update','hex','Open\x20Tilde\x20ASR\x20socket','unix','send','data','close','EOS','Tilde\x20ASR\x20send\x20error','stringify','terminate','parse','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','likelihood','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','error','isNil','isObject'];(function(_0x22cc16,_0x1f4fa2){var _0x399b70=function(_0x34d464){while(--_0x34d464){_0x22cc16['push'](_0x22cc16['shift']());}};_0x399b70(++_0x1f4fa2);}(_0xa0cd,0x19c));var _0xda0c=function(_0x26439d,_0x19e1ae){_0x26439d=_0x26439d-0x0;var _0xe2adde=_0xa0cd[_0x26439d];return _0xe2adde;};'use strict';var BPromise=require(_0xda0c('0x0'));var _=require(_0xda0c('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xda0c('0x2'));var crypto=require(_0xda0c('0x3'));var logger=require(_0xda0c('0x4'))(_0xda0c('0x5'));module[_0xda0c('0x6')]=function(_0x4c5727,_0x1ab106,_0x337fc4,_0x1d0165){return new BPromise(function(_0x2c8c67,_0x5610e5){logger[_0xda0c('0x7')](_0xda0c('0x8'),_0x1d0165||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE');var _0x3092a1=new WebSocket(_0x1d0165||_0xda0c('0x9'),{'perMessageDeflate':![]});var _0x27bf02='';var _0x154eda='0';var _0x143147='1';var _0x2688ad=_0xda0c('0xa');function _0x390814(_0x223a0c){var _0x415bb5=crypto[_0xda0c('0xb')](_0xda0c('0xc'));_0x415bb5[_0xda0c('0xd')](_0x223a0c);return _0x415bb5['digest'](_0xda0c('0xe'));}function _0x1d3e1e(){try{logger['info'](_0xda0c('0xf'));var _0x24fc33=moment()[_0xda0c('0x10')]();var _0x3e100b=_0x390814(_0x24fc33+_0x1ab106+_0x337fc4);_0x3092a1[_0xda0c('0x11')](JSON['stringify']({'appID':_0x1ab106,'timestamp':_0x24fc33,'appKey':_0x3e100b}));var _0x243058=fs['createReadStream'](_0x4c5727);_0x243058['on'](_0xda0c('0x12'),function(_0x20e181){_0x3092a1[_0xda0c('0x11')](_0x20e181);});_0x243058['on'](_0xda0c('0x13'),function(){_0x3092a1[_0xda0c('0x11')](_0xda0c('0x14'));});}catch(_0x3316d3){logger['error'](_0xda0c('0x15'),JSON[_0xda0c('0x16')](_0x3316d3));_0x3092a1[_0xda0c('0x17')]();}}function _0x18c5f2(_0x312d29){try{if(_0x312d29){var _0x529562=JSON[_0xda0c('0x18')](_0x312d29);switch(_0x529562['status']){case 0x0:if(_0x529562[_0xda0c('0x19')]){if(_0x529562['result'][_0xda0c('0x1a')]){logger[_0xda0c('0x7')](_0xda0c('0x1b'),JSON[_0xda0c('0x16')](_0x529562['result'][_0xda0c('0x1c')]));_0x27bf02=_0x529562[_0xda0c('0x19')][_0xda0c('0x1c')][0x0][_0xda0c('0x1d')];_0x154eda=_0x529562[_0xda0c('0x19')]['hypotheses'][0x0][_0xda0c('0x1e')];_0x143147='0';_0x2688ad=_0xda0c('0x1f');_0x3092a1[_0xda0c('0x17')]();}}break;case 0x1:logger['info'](_0xda0c('0xa'));_0x143147='1';_0x2688ad='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';break;case 0x2:logger[_0xda0c('0x7')](_0xda0c('0x20'));_0x143147='2';_0x2688ad='Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.';break;case 0x9:logger['info']('Not\x20available.\x20Max\x20load\x20limit\x20reached.');_0x143147='9';_0x2688ad=_0xda0c('0x21');break;case 0xa:logger['info'](_0xda0c('0x22'));_0x143147='10';_0x2688ad=_0xda0c('0x22');break;case 0xb:logger['info'](_0xda0c('0x23'));_0x143147='11';_0x2688ad=_0xda0c('0x23');}}}catch(_0x5418d9){logger[_0xda0c('0x24')]('Tilde\x20ASR\x20parse\x20error',JSON[_0xda0c('0x16')](_0x5418d9));_0x3092a1[_0xda0c('0x17')]();}}function _0x967e23(){logger[_0xda0c('0x7')]('Close\x20Tilde\x20ASR\x20socket');_0x2c8c67({'transcript':_0x27bf02,'confidence':_0x154eda,'status':_0x143147,'status_message':_0x2688ad});}function _0x2463b8(_0x1d13fc){logger[_0xda0c('0x24')]('Error\x20Tilde\x20ASR\x20socket');if(!_[_0xda0c('0x25')](_0x1d13fc)){logger[_0xda0c('0x24')](_[_0xda0c('0x26')](_0x1d13fc)?JSON[_0xda0c('0x16')](_0x1d13fc):_0x1d13fc);}}_0x3092a1['on'](_0xda0c('0x27'),_0x1d3e1e);_0x3092a1['on'](_0xda0c('0x28'),_0x18c5f2);_0x3092a1['on'](_0xda0c('0x13'),_0x967e23);_0x3092a1['on'](_0xda0c('0x24'),_0x2463b8);});}; \ 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 cc9b333..a56967a 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 _0x1ea6=['exports','./asr'];(function(_0x1d9d77,_0x1b137a){var _0x303531=function(_0x4636c4){while(--_0x4636c4){_0x1d9d77['push'](_0x1d9d77['shift']());}};_0x303531(++_0x1b137a);}(_0x1ea6,0x83));var _0x61ea=function(_0x30fc1b,_0x2cc105){_0x30fc1b=_0x30fc1b-0x0;var _0x3bb05c=_0x1ea6[_0x30fc1b];return _0x3bb05c;};var asr=require(_0x61ea('0x0'));module[_0x61ea('0x1')]={'asr':asr}; \ No newline at end of file +var _0xdff8=['exports'];(function(_0x17551f,_0x3d44dc){var _0x3e7c59=function(_0x4dfdb2){while(--_0x4dfdb2){_0x17551f['push'](_0x17551f['shift']());}};_0x3e7c59(++_0x3d44dc);}(_0xdff8,0x1d1));var _0x8dff=function(_0x21f88f,_0x48cfba){_0x21f88f=_0x21f88f-0x0;var _0x3b9ff5=_0xdff8[_0x21f88f];return _0x3b9ff5;};var asr=require('./asr');module[_0x8dff('0x0')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index d00b8eb..017ecd8 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(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0x9c44[_0x1694f5];return _0x5b4321;};'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 _0xe706=['connection','getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','close','nextTick','exports','util','net','events','./error','./channel','127.0.0.1','call','emit','error','E_AGI_ARGUMENT_PORT','createServer','listen','listening'];(function(_0x22b70f,_0x4c853f){var _0x100985=function(_0x18628e){while(--_0x18628e){_0x22b70f['push'](_0x22b70f['shift']());}};_0x100985(++_0x4c853f);}(_0xe706,0xa3));var _0x6e70=function(_0x11fd4e,_0x1a32ec){_0x11fd4e=_0x11fd4e-0x0;var _0x324371=_0xe706[_0x11fd4e];return _0x324371;};'use strict';var util=require(_0x6e70('0x0'));var net=require(_0x6e70('0x1'));var EventEmitter=require(_0x6e70('0x2'))['EventEmitter'];var AGIError=require(_0x6e70('0x3'));var AGIChannel=require(_0x6e70('0x4'));var AGIServer=function(_0x2ca810,_0x7dfbc3,_0x142c27){var _0x2164a4=this;var _0x376a8d=null;var _0x506db9=0x0;if(!_0x2ca810)_0x2ca810=0x11dd;if(!_0x7dfbc3)_0x7dfbc3=_0x6e70('0x5');EventEmitter[_0x6e70('0x6')](_0x2164a4);function _0x36357b(){if(!_0x2ca810){_0x2164a4[_0x6e70('0x7')](_0x6e70('0x8'),new AGIError(_0x6e70('0x9')));return![];}_0x376a8d=net[_0x6e70('0xa')]();_0x376a8d[_0x6e70('0xb')](_0x2ca810,_0x7dfbc3);_0x376a8d['on'](_0x6e70('0xc'),function(){_0x2164a4[_0x6e70('0x7')](_0x6e70('0xc'));});_0x376a8d['on'](_0x6e70('0xd'),function(_0x743eb5){_0x376a8d[_0x6e70('0xe')](function(_0x37b3e0,_0x4600f9){if(_0x37b3e0){_0x2164a4['emit']('error',new AGIError(_0x6e70('0xf'),_0x37b3e0));}else if(_0x142c27&&_0x142c27<0x0){_0x2164a4[_0x6e70('0x7')](_0x6e70('0x8'),new AGIError(_0x6e70('0x10')));_0x743eb5[_0x6e70('0x11')]();}else if(_0x142c27&&_0x142c27>0x0&&_0x142c27<_0x4600f9){_0x506db9+=0x1;_0x2164a4[_0x6e70('0x7')](_0x6e70('0x8'),new AGIError(_0x6e70('0x12'),_0x506db9));_0x743eb5['destroy']();}else{var _0x52737e=new AGIChannel(_0x743eb5);_0x52737e['on']('ready',function(){_0x2164a4[_0x6e70('0x7')]('connection',_0x52737e);});}});});_0x376a8d['on']('error',function(_0x304716){_0x2164a4[_0x6e70('0x7')]('error',new AGIError(_0x6e70('0xf'),_0x304716['code']));});_0x376a8d['on'](_0x6e70('0x13'),function(){_0x2164a4[_0x6e70('0x7')]('close',new AGIError('E_AGI_SERVER_CLOSE'));});}process[_0x6e70('0x14')](function(){_0x36357b();});};util['inherits'](AGIServer,EventEmitter);module[_0x6e70('0x15')]=function(_0x173afe,_0x53acdc,_0x497d61){return new AGIServer(_0x173afe,_0x53acdc,_0x497d61);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index 575bf5d..4a76cd5 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 _0xed95=['SIP/%s/%s','Executed\x20command\x20%s','finally','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','getSound','no\x20file\x20audio\x20found','getData','response','maxdigit','test','mindigit','generate','hiddendigitspos','first','substr','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','streamFile','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','message','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','NOBEEP','recordFile','google\x20%s\x20file\x20created','GoogleASR\x20Result\x20%s','tildeasr','%s/recordings/%s','beep','intKey','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','true','false','gotoiftime','interval_id','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Trying\x20ispeech\x20TTS\x20%s','ispeechTTS','ispeech\x20%s\x20file\x20created','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','Enter\x20in\x20MATH\x20(%s)\x20block','no\x20operation\x20configured','math\x20%s','operation','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','agentPause','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue_id','no\x20queue\x20selected','getVoiceQueue','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','macro','gosub','position','Executed\x20command\x20%s\x20%s','record','Enter\x20in\x20RECORD\x20(%s)\x20block','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','200','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','digits','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','Smtp','no\x20mail\x20account\x20found','email','user','subject','Trying\x20SendMail\x20with\x20account\x20%s','smtpOptions','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','no\x20sms\x20account\x20found','sms_text','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','variable_value','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','XMCS-UNIQUEID','yes','Answer','Skipped\x20Answer','no\x20subproject\x20selected','getSquareProject','project_id','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','host','127.0.0.1','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','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Google\x20TTS\x20%s\x20file\x20created','unpause','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','no\x20variable\x20selected','exports','util','lodash','shelljs','odbc','randomstring','moment','mustache','request-promise','../../config/logger','agi','../../config/environment','./scripts','rawBody','menu','getdigits','getsecretdigits','rpc','mailRpc','prototype','getVariable','getVariableById','then','catch','getSquareProjectById','getSquareOdbc','getSquareOdbcById','getUserById','name','getTrunk','getTrunkById','getSoundById','getSoundPath','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','interval','map','format','%s/sounds/converted/%s','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','Error\x20executing\x20query\x20%s','close','getSmsAccountById','createSmsMessage','createSquareDetailsReport','channel','label','arg_1','callerid','createSquareRecording','uniqueid','calleridname','context','extension','priority','accountcode','dnid','file','createSquareMessage','createCmContact','isNil','callback_','random','isEmpty','lastName','phone','list_id','scheduledAt','callback','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPause','agent','agentUnpause','agentLogout','internal','%s/%s@from-sip/n','LOCAL','shellCommand','exec','trim','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','en-US','ssmlGender','MALE','MP3','googleTTS','google_tts_language','restAPI','timeout','number','includes','POST','method','toUpperCase','body','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','rawHeaders','parse','computedVariables','sync','render','url','stringify','statusCode','statusMessage','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','dialogflowV2_language','sestekNDA','key','ispeech_tts_language','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','Amy','aws_text_type','awsLex','aws_secret_access_key','aws_lex_region','aws_bot_name','googleASR','tildeASR','appid','appsecret','uri','agicommand','hasOwnProperty','replaceAllVariables','recursiveNodeIndex','isArray','length','isString','saveRestApiResult','isPlainObject','%s.%s','setVariable','replaceObjectAllVariables','split','replaceAll','extra','getAndSetVariable','result','retry','maxRetry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','no\x20text\x20configured','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','no\x20list\x20selected','add','delay','minutes','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','no\x20grammar\x20configured','MRCPRecog','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','query','no\x20query\x20configured','replace','getQueryOdbc','no\x20variable\x20selected\x20for\x20the\x20result','variable_id','no\x20variable\x20found','forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','DIAL','SIP/%s','opts','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','DIALOGFLOW_%s','speech','out','dialogflow','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','dialogflowV2','no\x20project_id\x20configured','no\x20client_email\x20configured','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','password','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','unlink','.wav','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name'];(function(_0x8792a1,_0x5d2f49){var _0x2c380f=function(_0x5432b0){while(--_0x5432b0){_0x8792a1['push'](_0x8792a1['shift']());}};_0x2c380f(++_0x5d2f49);}(_0xed95,0xb9));var _0x5ed9=function(_0x46bbe7,_0x325560){_0x46bbe7=_0x46bbe7-0x0;var _0x26fb8c=_0xed95[_0x46bbe7];return _0x26fb8c;};'use strict';var fs=require('fs');var util=require(_0x5ed9('0x0'));var _=require(_0x5ed9('0x1'));var sh=require(_0x5ed9('0x2'));var odbc=require(_0x5ed9('0x3'))();var rs=require(_0x5ed9('0x4'));var moment=require(_0x5ed9('0x5'));var Mustache=require(_0x5ed9('0x6'));var rp=require(_0x5ed9('0x7'));var logger=require(_0x5ed9('0x8'))(_0x5ed9('0x9'));var config=require(_0x5ed9('0xa'));var scripts=require(_0x5ed9('0xb'));var FILES_PATH='/var/opt/motion2/server/files';var recursiveMapAttributes=['rawHeaders',_0x5ed9('0xc')];var verticesWithRetry=[_0x5ed9('0xd'),_0x5ed9('0xe'),_0x5ed9('0xf')];var AGIVertices=function(_0x2d5474,_0x40e8eb,_0x5b48b1){this['channel']=_0x2d5474;this[_0x5ed9('0x10')]=_0x40e8eb;this[_0x5ed9('0x11')]=_0x5b48b1;};AGIVertices[_0x5ed9('0x12')][_0x5ed9('0x13')]=function(_0x526924,_0x575782){this[_0x5ed9('0x10')][_0x5ed9('0x14')](_0x526924)[_0x5ed9('0x15')](function(_0x2ed72e){_0x575782(null,_0x2ed72e?_0x2ed72e['name']:![]);})[_0x5ed9('0x16')](function(_0x110d83){_0x575782(_0x110d83);});};AGIVertices[_0x5ed9('0x12')]['getVoiceQueue']=function(_0x56695a,_0x3de296){this[_0x5ed9('0x10')]['getVoiceQueueById'](_0x56695a)[_0x5ed9('0x15')](function(_0x34ed28){_0x3de296(null,_0x34ed28?_0x34ed28['name']:![]);})['catch'](function(_0x1d2d60){_0x3de296(_0x1d2d60);});};AGIVertices[_0x5ed9('0x12')]['getSquareProject']=function(_0x3de09e,_0x10b784){this['rpc'][_0x5ed9('0x17')](_0x3de09e)[_0x5ed9('0x15')](function(_0x54a570){_0x10b784(null,_0x54a570?_0x54a570['name']:![]);})['catch'](function(_0x510ffe){_0x10b784(_0x510ffe);});};AGIVertices[_0x5ed9('0x12')][_0x5ed9('0x18')]=function(_0x3892d8,_0x44b8ca){this['rpc'][_0x5ed9('0x19')](_0x3892d8)[_0x5ed9('0x15')](function(_0x5cb2c1){_0x44b8ca(null,_0x5cb2c1?_0x5cb2c1['dsn']:![]);})['catch'](function(_0x302ec1){_0x44b8ca(_0x302ec1);});};AGIVertices[_0x5ed9('0x12')]['getUser']=function(_0x5eda05,_0xe7680){this[_0x5ed9('0x10')][_0x5ed9('0x1a')](_0x5eda05)['then'](function(_0x18b8c8){_0xe7680(null,_0x18b8c8?_0x18b8c8[_0x5ed9('0x1b')]:![]);})[_0x5ed9('0x16')](function(_0x40244e){_0xe7680(_0x40244e);});};AGIVertices[_0x5ed9('0x12')][_0x5ed9('0x1c')]=function(_0x5da4d5,_0x492f36){this[_0x5ed9('0x10')][_0x5ed9('0x1d')](_0x5da4d5)[_0x5ed9('0x15')](function(_0x5b56df){_0x492f36(null,_0x5b56df?_0x5b56df['name']:![]);})[_0x5ed9('0x16')](function(_0x3a4968){_0x492f36(_0x3a4968);});};AGIVertices[_0x5ed9('0x12')]['getSound']=function(_0x1bc137,_0x7de1d2){var _0x389a73=this;this['rpc'][_0x5ed9('0x1e')](_0x1bc137)[_0x5ed9('0x15')](function(_0x411729){_0x7de1d2(null,_0x411729?_0x389a73[_0x5ed9('0x1f')](_0x411729['save_name']):![]);})['catch'](function(_0x43863c){_0x7de1d2(_0x43863c);});};AGIVertices['prototype'][_0x5ed9('0x20')]=function(_0xb39190,_0x1585e3){this[_0x5ed9('0x10')][_0x5ed9('0x21')](_0xb39190)[_0x5ed9('0x15')](function(_0xba5b97){_0x1585e3(null,_0xba5b97?_0xba5b97:![]);})['catch'](function(_0x58e2d0){_0x1585e3(_0x58e2d0);});};AGIVertices['prototype'][_0x5ed9('0x22')]=function(_0x36d050,_0x2cb3d2,_0x5da46e){this[_0x5ed9('0x11')]['sendMailMessage'](_0x36d050,_0x2cb3d2)[_0x5ed9('0x15')](function(){_0x5da46e(null);})[_0x5ed9('0x16')](function(_0x3061cd){_0x5da46e(_0x3061cd);});};AGIVertices[_0x5ed9('0x12')][_0x5ed9('0x23')]=function(_0x448778,_0x4a6567){this[_0x5ed9('0x10')][_0x5ed9('0x24')](_0x448778)[_0x5ed9('0x15')](function(_0x4c573e){if(_0x4c573e){if(_0x4c573e['IntervalId']){_0x4a6567(null,[_0x4c573e[_0x5ed9('0x25')]]);}else{_0x4a6567(null,_[_0x5ed9('0x26')](_0x4c573e['Intervals'],'interval'));}}else{_0x4a6567(null,![]);}})[_0x5ed9('0x16')](function(_0x1536c3){_0x4a6567(_0x1536c3);});};AGIVertices[_0x5ed9('0x12')][_0x5ed9('0x1f')]=function(_0x29346d){return util[_0x5ed9('0x27')](_0x5ed9('0x28'),FILES_PATH,_0x29346d);};AGIVertices[_0x5ed9('0x12')]['getQueryOdbc']=function(_0x4bfe28,_0x59896b,_0x4699a0){odbc[_0x5ed9('0x29')](_0x4bfe28,function(_0x4f261f){if(_0x4f261f){logger[_0x5ed9('0x2a')](_0x5ed9('0x2b'),_0x4f261f);_0x4699a0(_0x4f261f);}else{logger[_0x5ed9('0x2c')](_0x5ed9('0x2d'));odbc['query'](_0x59896b,function(_0x34e190,_0x89486e){if(_0x34e190){logger[_0x5ed9('0x2c')](_0x5ed9('0x2e'),_0x59896b);_0x4699a0(_0x34e190);}else{logger[_0x5ed9('0x2c')]('Query\x20executed\x20correctly\x20%s',_0x59896b);odbc[_0x5ed9('0x2f')](function(_0x2f728e){if(_0x2f728e){logger['error']('Error\x20closing\x20connection\x20to\x20odbc\x20%s',_0x2f728e);}_0x4699a0(null,_0x89486e);});}});}});};AGIVertices[_0x5ed9('0x12')]['getSmsAccount']=function(_0x4fedbe,_0x5a9287){this[_0x5ed9('0x10')][_0x5ed9('0x30')](_0x4fedbe)['then'](function(_0x5f20a1){_0x5a9287(null,_0x5f20a1?_0x5f20a1:![]);})[_0x5ed9('0x16')](function(_0xb6ac0d){_0x5a9287(_0xb6ac0d);});};AGIVertices[_0x5ed9('0x12')][_0x5ed9('0x31')]=function(_0x3c4bbe,_0x3e844b){this[_0x5ed9('0x10')][_0x5ed9('0x31')](_0x3c4bbe)[_0x5ed9('0x15')](function(_0xbc9f61){_0x3e844b(null,_0xbc9f61);})[_0x5ed9('0x16')](function(_0xba8cc){_0x3e844b(_0xba8cc);});};AGIVertices[_0x5ed9('0x12')][_0x5ed9('0x32')]=function(_0x5b61af,_0x4494d1,_0x18bf88){this[_0x5ed9('0x10')][_0x5ed9('0x32')]({'uniqueid':this[_0x5ed9('0x33')]['uniqueid'],'node':_0x5b61af[_0x5ed9('0x34')],'application':_0x5b61af['agicommand'],'data':_0x4494d1||null,'project_name':this[_0x5ed9('0x33')][_0x5ed9('0x35')],'callerid':this[_0x5ed9('0x33')][_0x5ed9('0x36')]})[_0x5ed9('0x15')](function(_0x38e960){if(_0x18bf88){_0x18bf88(null,_0x38e960);}})[_0x5ed9('0x16')](function(_0x53c64f){if(_0x18bf88){_0x18bf88(_0x53c64f);}});};AGIVertices['prototype'][_0x5ed9('0x37')]=function(_0x41a1bf,_0x5a0ea6,_0x39ea43,_0x290508){this['rpc']['createSquareRecording']({'uniqueid':this[_0x5ed9('0x33')][_0x5ed9('0x38')],'callerid':this['channel'][_0x5ed9('0x36')],'calleridname':this[_0x5ed9('0x33')][_0x5ed9('0x39')],'context':this[_0x5ed9('0x33')][_0x5ed9('0x3a')],'extension':this[_0x5ed9('0x33')][_0x5ed9('0x3b')],'priority':this[_0x5ed9('0x33')][_0x5ed9('0x3c')],'accountcode':this[_0x5ed9('0x33')][_0x5ed9('0x3d')],'dnid':this[_0x5ed9('0x33')][_0x5ed9('0x3e')],'projectName':this['channel'][_0x5ed9('0x35')],'saveName':_0x5a0ea6,'filename':_0x41a1bf[_0x5ed9('0x3f')]||_0x5a0ea6,'savePath':_0x39ea43})[_0x5ed9('0x15')](function(_0x5e6515){_0x290508(null,_0x5e6515);})[_0x5ed9('0x16')](function(_0x4e65ed){_0x290508(_0x4e65ed);});};AGIVertices[_0x5ed9('0x12')][_0x5ed9('0x40')]=function(_0x1acd7b,_0x77d6df,_0x24b54,_0x3717fb,_0x17c434){this[_0x5ed9('0x10')][_0x5ed9('0x40')]({'uniqueid':this[_0x5ed9('0x33')][_0x5ed9('0x38')],'body':_0x1acd7b,'direction':_0x77d6df,'providerName':_0x24b54,'providerResponse':_0x3717fb})[_0x5ed9('0x15')](function(_0x533510){if(_0x17c434){_0x17c434(null,_0x533510);}})[_0x5ed9('0x16')](function(_0x1b5ff9){if(_0x17c434){_0x17c434(_0x1b5ff9);}});};AGIVertices[_0x5ed9('0x12')][_0x5ed9('0x41')]=function(_0x2ca6d7,_0x550892){this['rpc']['createCmContact']({'firstName':_['isEmpty'](_0x2ca6d7['name'])||_[_0x5ed9('0x42')](_0x2ca6d7[_0x5ed9('0x1b')])?_0x5ed9('0x43')+Math[_0x5ed9('0x44')]():_0x2ca6d7[_0x5ed9('0x1b')],'lastName':_[_0x5ed9('0x45')](_0x2ca6d7[_0x5ed9('0x46')])||_[_0x5ed9('0x42')](_0x2ca6d7[_0x5ed9('0x46')])?null:_0x2ca6d7[_0x5ed9('0x46')],'phone':_0x2ca6d7[_0x5ed9('0x47')],'ListId':_0x2ca6d7[_0x5ed9('0x48')],'scheduledat':_0x2ca6d7[_0x5ed9('0x49')],'callbackUniqueid':this[_0x5ed9('0x33')]['uniqueid'],'tags':_0x5ed9('0x4a'),'description':_0x5ed9('0x4b')+_0x2ca6d7[_0x5ed9('0x49')][_0x5ed9('0x4c')](),'priority':_0x2ca6d7[_0x5ed9('0x4d')]})[_0x5ed9('0x15')](function(_0x5a090d){_0x550892(null,_0x5a090d);})[_0x5ed9('0x16')](function(_0x5dda6c){_0x550892(_0x5dda6c);});};AGIVertices['prototype'][_0x5ed9('0x4e')]=function(_0x53206f,_0x8fe239){this[_0x5ed9('0x10')]['getPauseById'](_0x53206f)[_0x5ed9('0x15')](function(_0x1bf047){_0x8fe239(null,_0x1bf047?_0x1bf047[_0x5ed9('0x1b')]:![]);})[_0x5ed9('0x16')](function(_0x573530){_0x8fe239(_0x573530);});};AGIVertices['prototype']['agentPause']=function(_0x354f7a,_0x2a66a6,_0x5f41d6){var _0x2e6f74={'role':_0x5ed9('0x4f')};_0x2e6f74[_0x354f7a]=this['channel'][_0x5ed9('0x36')];this[_0x5ed9('0x10')]['agentPause'](_0x2e6f74,_0x2a66a6,this[_0x5ed9('0x33')][_0x5ed9('0x38')])[_0x5ed9('0x15')](function(_0x4acc3d){_0x5f41d6(null,_[_0x5ed9('0x42')](_0x4acc3d)?![]:!![]);})[_0x5ed9('0x16')](function(_0x33f184){logger[_0x5ed9('0x2a')](_0x33f184);_0x5f41d6(null,![]);});};AGIVertices[_0x5ed9('0x12')][_0x5ed9('0x50')]=function(_0x21be65,_0xe72d99){var _0x59ecf6={'role':_0x5ed9('0x4f')};_0x59ecf6[_0x21be65]=this[_0x5ed9('0x33')][_0x5ed9('0x36')];this[_0x5ed9('0x10')][_0x5ed9('0x50')](_0x59ecf6)[_0x5ed9('0x15')](function(_0x252cac){_0xe72d99(null,_[_0x5ed9('0x42')](_0x252cac)?![]:!![]);})[_0x5ed9('0x16')](function(_0x1f6767){logger[_0x5ed9('0x2a')](_0x1f6767);_0xe72d99(null,![]);});};AGIVertices[_0x5ed9('0x12')][_0x5ed9('0x51')]=function(_0xa68a6c,_0x1e6c73){var _0x3d51b6={'role':'agent'};_0x3d51b6[_0xa68a6c]=this[_0x5ed9('0x33')][_0x5ed9('0x36')];this['rpc'][_0x5ed9('0x51')](_0x3d51b6)[_0x5ed9('0x15')](function(_0x15b345){_0x1e6c73(null,_[_0x5ed9('0x42')](_0x15b345)?![]:!![]);})[_0x5ed9('0x16')](function(_0x23e16d){logger[_0x5ed9('0x2a')](_0x23e16d);_0x1e6c73(null,![]);});};AGIVertices[_0x5ed9('0x12')]['agentLogin']=function(_0x30b77e,_0x575398){var _0x510c19={'role':_0x5ed9('0x4f')};_0x510c19[_0x30b77e]=this[_0x5ed9('0x33')][_0x5ed9('0x36')];var _0x570fc3=_0x30b77e!=_0x5ed9('0x52')?util[_0x5ed9('0x27')](_0x5ed9('0x53'),_0x5ed9('0x54'),this[_0x5ed9('0x33')][_0x5ed9('0x36')]):undefined;this[_0x5ed9('0x10')]['agentLogin'](_0x510c19,_0x570fc3)['then'](function(_0x4d387c){_0x575398(null,_[_0x5ed9('0x42')](_0x4d387c)?![]:!![]);})[_0x5ed9('0x16')](function(_0x5c15d3){logger[_0x5ed9('0x2a')](_0x5c15d3);_0x575398(null,![]);});};AGIVertices[_0x5ed9('0x12')][_0x5ed9('0x55')]=function(_0x31efd8,_0x18b411){sh[_0x5ed9('0x56')](_[_0x5ed9('0x57')](_0x31efd8),function(_0x279257,_0x1c0012){var _0x246763=_0x1c0012['replace'](/(\r\n|\n|\r)/gm,'');_0x18b411(null,_0x246763);});};AGIVertices[_0x5ed9('0x12')][_0x5ed9('0x58')]=function(_0x19d09c,_0x36768c){scripts[_0x5ed9('0x58')](_0x19d09c[_0x5ed9('0x59')],_0x19d09c[_0x5ed9('0x5a')]||_0x5ed9('0x5b'),_0x19d09c[_0x5ed9('0x5b')],_0x19d09c[_0x5ed9('0x5c')]||_0x5ed9('0x5d'),_0x19d09c[_0x5ed9('0x5e')]||_0x5ed9('0x5f'),_0x19d09c['audioEncoding']||_0x5ed9('0x60'))['then'](function(_0x28d100){_0x36768c(null,_0x28d100);})[_0x5ed9('0x16')](function(_0x5aa5a8){_0x36768c(_0x5aa5a8);});};AGIVertices['prototype']['googleTTS']=function(_0x1088ef,_0x29f0f3){scripts[_0x5ed9('0x61')](_0x1088ef[_0x5ed9('0x5b')],_0x1088ef[_0x5ed9('0x62')]||'en',0x1)['then'](function(_0x5c05a4){_0x29f0f3(null,_0x5c05a4);})[_0x5ed9('0x16')](function(_0x2dba3b){_0x29f0f3(_0x2dba3b);});};AGIVertices[_0x5ed9('0x12')][_0x5ed9('0x63')]=function(_0x55821c,_0x5bf1c0){var _0xbe0e06={'uri':_0x55821c['url'],'method':_0x55821c['method'],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x55821c[_0x5ed9('0x64')])===_0x5ed9('0x65')&&parseInt(_0x55821c[_0x5ed9('0x64')])>=0x1?parseInt(_0x55821c['timeout'])*0x3e8:0x5*0x3e8};if(_[_0x5ed9('0x66')]([_0x5ed9('0x67'),'PUT'],_0xbe0e06[_0x5ed9('0x68')][_0x5ed9('0x69')]())){try{_0xbe0e06[_0x5ed9('0x6a')]=_0x55821c[_0x5ed9('0xc')]?JSON['parse'](_0x55821c[_0x5ed9('0xc')]):{};}catch(_0x5bdb42){logger[_0x5ed9('0x2a')](_0x5ed9('0x6b'),_0x5bdb42);}}try{_0xbe0e06[_0x5ed9('0x6c')]=_0x55821c[_0x5ed9('0x6d')]?JSON[_0x5ed9('0x6e')](_0x55821c['rawHeaders']):{};}catch(_0x4d105e){logger['error']('An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function',_0x4d105e);}if(_0x55821c[_0x5ed9('0x6f')]){try{var _0xa3e738=require(_0x55821c[_0x5ed9('0x6f')])[_0x5ed9('0x70')](this,_0xbe0e06);_0xbe0e06['uri']=Mustache[_0x5ed9('0x71')](_0x55821c[_0x5ed9('0x72')],_0xa3e738,{},['$$','$$']);if(_0xbe0e06['headers']){_0xbe0e06[_0x5ed9('0x6c')]=JSON[_0x5ed9('0x6e')](Mustache[_0x5ed9('0x71')](JSON[_0x5ed9('0x73')](_0xbe0e06[_0x5ed9('0x6c')]),_0xa3e738,{},['$$','$$']));}if(_0xbe0e06['body']){_0xbe0e06[_0x5ed9('0x6a')]=JSON[_0x5ed9('0x6e')](Mustache[_0x5ed9('0x71')](JSON[_0x5ed9('0x73')](_0xbe0e06[_0x5ed9('0x6a')]),_0xa3e738,{},['$$','$$']));}}catch(_0x24d9fe){logger[_0x5ed9('0x2a')]('An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function',_0x24d9fe);}}rp(_0xbe0e06)[_0x5ed9('0x15')](function(_0x174a48){var _0x4200dd={'statusCode':_0x174a48[_0x5ed9('0x74')]||0xc8,'statusMessage':_0x174a48[_0x5ed9('0x75')]||'OK','headers':_0x174a48[_0x5ed9('0x6c')]||{},'body':_0x174a48['body']||{}};_0x5bf1c0(null,_0x4200dd);})[_0x5ed9('0x16')](function(_0x38176b){var _0x2fa06e={'statusCode':_0x38176b[_0x5ed9('0x74')]||0x1f4,'statusMessage':_0x38176b['message']||_0x5ed9('0x76'),'headers':_0x38176b['options'][_0x5ed9('0x6c')]||{},'body':_0x38176b[_0x5ed9('0x77')][_0x5ed9('0x6a')]||{}};_0x5bf1c0(null,_0x2fa06e);});};AGIVertices[_0x5ed9('0x12')][_0x5ed9('0x78')]=function(_0x5db252,_0x37b98a){scripts[_0x5ed9('0x78')](this[_0x5ed9('0x33')][_0x5ed9('0x38')],_0x5db252['key'],_0x5db252[_0x5ed9('0x5b')],_0x5db252[_0x5ed9('0x79')]||'en')[_0x5ed9('0x15')](function(_0x5d5ff3){_0x37b98a(null,_0x5d5ff3);})[_0x5ed9('0x16')](function(_0x44afb0){_0x37b98a(_0x44afb0);});};AGIVertices['prototype'][_0x5ed9('0x7a')]=function(_0x2d8868,_0x2164f1){scripts['googleDialogflowV2'](this[_0x5ed9('0x33')][_0x5ed9('0x38')],_0x2d8868[_0x5ed9('0x7b')],_0x2d8868[_0x5ed9('0x7c')],_0x2d8868[_0x5ed9('0x7d')],_0x2d8868[_0x5ed9('0x5b')],_0x2d8868[_0x5ed9('0x7e')]||'en')[_0x5ed9('0x15')](function(_0x43c8c7){_0x2164f1(null,_0x43c8c7);})[_0x5ed9('0x16')](function(_0x9a16d5){_0x2164f1(_0x9a16d5);});};AGIVertices[_0x5ed9('0x12')][_0x5ed9('0x7f')]=function(_0x548fee,_0x1185c8){scripts[_0x5ed9('0x7f')](this[_0x5ed9('0x33')],_0x548fee)[_0x5ed9('0x15')](function(_0x5bc97c){_0x1185c8(null,_0x5bc97c);})['catch'](function(_0x12fc45){_0x1185c8(_0x12fc45);});};AGIVertices[_0x5ed9('0x12')]['ispeechTTS']=function(_0x508e02,_0x1ddcc8){scripts['ispeechTTS'](_0x508e02[_0x5ed9('0x80')],_0x508e02[_0x5ed9('0x5b')],_0x508e02[_0x5ed9('0x81')]||_0x5ed9('0x5d'),_0x508e02[_0x5ed9('0x82')])[_0x5ed9('0x15')](function(_0x5d5d10){_0x1ddcc8(null,_0x5d5d10);})['catch'](function(_0x323e4f){_0x1ddcc8(_0x323e4f);});};AGIVertices[_0x5ed9('0x12')][_0x5ed9('0x83')]=function(_0x3fad48,_0x511069,_0x2da35f){scripts['ispeechASR'](_0x511069,_0x3fad48[_0x5ed9('0x80')],_0x3fad48[_0x5ed9('0x84')]||_0x5ed9('0x5d'),this[_0x5ed9('0x85')](_0x3fad48[_0x5ed9('0x86')])?_0x3fad48['model']:undefined)[_0x5ed9('0x15')](function(_0x1d8ce2){_0x2da35f(null,_0x1d8ce2);})[_0x5ed9('0x16')](function(_0x3994a0){_0x2da35f(_0x3994a0);});};AGIVertices['prototype']['awsPolly']=function(_0x4701a2,_0x4b84ad){scripts[_0x5ed9('0x87')](_0x4701a2[_0x5ed9('0x88')],_0x4701a2['aws_secret_access_key'],_0x4701a2['aws_polly_region'],_0x4701a2['aws_polly_voice']||_0x5ed9('0x89'),_0x4701a2[_0x5ed9('0x5b')],_0x4701a2[_0x5ed9('0x8a')]||'text')[_0x5ed9('0x15')](function(_0x4d438e){_0x4b84ad(null,_0x4d438e);})[_0x5ed9('0x16')](function(_0x46629f){_0x4b84ad(_0x46629f);});};AGIVertices[_0x5ed9('0x12')]['awsLex']=function(_0xa2b99e,_0x1481bf){scripts[_0x5ed9('0x8b')](this[_0x5ed9('0x33')][_0x5ed9('0x38')],_0xa2b99e[_0x5ed9('0x88')],_0xa2b99e[_0x5ed9('0x8c')],_0xa2b99e[_0x5ed9('0x8d')],_0xa2b99e[_0x5ed9('0x5b')],_0xa2b99e[_0x5ed9('0x8e')])[_0x5ed9('0x15')](function(_0x2b1032){_0x1481bf(null,_0x2b1032);})[_0x5ed9('0x16')](function(_0x308015){_0x1481bf(_0x308015);});};AGIVertices[_0x5ed9('0x12')]['googleASR']=function(_0x16c26e,_0xbd9ea,_0x5ad38f){scripts[_0x5ed9('0x8f')](_0xbd9ea,_0x16c26e[_0x5ed9('0x80')],_0x16c26e['google_asr_language']||_0x5ed9('0x5d'))['then'](function(_0x28a050){_0x5ad38f(null,_0x28a050);})[_0x5ed9('0x16')](function(_0x23f6dc){_0x5ad38f(_0x23f6dc);});};AGIVertices[_0x5ed9('0x12')]['tildeASR']=function(_0x3b9d38,_0x483aa0,_0x203dbd){scripts[_0x5ed9('0x90')](_0x483aa0,_0x3b9d38[_0x5ed9('0x91')],_0x3b9d38[_0x5ed9('0x92')],_0x3b9d38[_0x5ed9('0x93')])[_0x5ed9('0x15')](function(_0xda9d33){_0x203dbd(null,_0xda9d33);})[_0x5ed9('0x16')](function(_0x97d3aa){_0x203dbd(_0x97d3aa);});};AGIVertices[_0x5ed9('0x12')]['clear']=function(_0x2d4236){var _0x7d5055=_[_0x5ed9('0x66')](verticesWithRetry,_0x2d4236[_0x5ed9('0x94')])?_0x2d4236:_['clone'](_0x2d4236);for(var _0x482ff1 in _0x7d5055){if(_0x7d5055[_0x5ed9('0x95')](_0x482ff1)){if(_0x7d5055[_0x482ff1]&&_['isString'](_0x7d5055[_0x482ff1])){if(_[_0x5ed9('0x66')](recursiveMapAttributes,_0x482ff1)){_0x7d5055[_0x482ff1]=this['replaceObjectAllVariables'](_0x7d5055[_0x482ff1]);}else{_0x7d5055[_0x482ff1]=this[_0x5ed9('0x96')](_0x7d5055[_0x482ff1]);}}}}return _0x7d5055;};AGIVertices['prototype'][_0x5ed9('0x97')]=function(_0x28abb9){for(var _0x14b4c0 in _0x28abb9){if(_0x28abb9[_0x5ed9('0x95')](_0x14b4c0)){if(_['isPlainObject'](_0x28abb9[_0x14b4c0])){this['recursiveNodeIndex'](_0x28abb9[_0x14b4c0]);}else if(_[_0x5ed9('0x98')](_0x28abb9[_0x14b4c0])){for(var _0x4a8455=0x0;_0x4a8455<_0x28abb9[_0x14b4c0][_0x5ed9('0x99')];_0x4a8455++){this[_0x5ed9('0x97')](_0x28abb9[_0x14b4c0][_0x4a8455]);}}else if(_[_0x5ed9('0x9a')](_0x28abb9[_0x14b4c0])){_0x28abb9[_0x14b4c0]=this[_0x5ed9('0x96')](_0x28abb9[_0x14b4c0]);}}}};AGIVertices[_0x5ed9('0x12')][_0x5ed9('0x9b')]=function(_0x442c46,_0x5638d0){for(var _0xd776a7 in _0x442c46){if(_0x442c46[_0x5ed9('0x95')](_0xd776a7)){if(_[_0x5ed9('0x9c')](_0x442c46[_0xd776a7])){if(!_[_0x5ed9('0x45')](_0x442c46[_0xd776a7])){this[_0x5ed9('0x9b')](_0x442c46[_0xd776a7],util[_0x5ed9('0x27')](_0x5ed9('0x9d'),_0x5638d0,_0xd776a7));}}else if(_[_0x5ed9('0x98')](_0x442c46[_0xd776a7])){for(var _0xc7e0ae=0x0;_0xc7e0ae<_0x442c46[_0xd776a7][_0x5ed9('0x99')];_0xc7e0ae++){this[_0x5ed9('0x9b')](_0x442c46[_0xd776a7][_0xc7e0ae],util[_0x5ed9('0x27')]('%s.%s',_0x5638d0,_0xd776a7+'['+_0xc7e0ae+']'));}}else{if(!_[_0x5ed9('0x42')](_0x442c46[_0xd776a7])){this['channel'][_0x5ed9('0x9e')](util[_0x5ed9('0x27')](_0x5ed9('0x9d'),_0x5638d0,_0xd776a7),_0x442c46[_0xd776a7]);}}}}};AGIVertices[_0x5ed9('0x12')][_0x5ed9('0x9f')]=function(_0x27ebd5){try{var _0xfb4219=JSON[_0x5ed9('0x6e')](_0x27ebd5);this['recursiveNodeIndex'](_0xfb4219);return JSON['stringify'](_0xfb4219);}catch(_0x4a13f6){return this[_0x5ed9('0x96')](_0x27ebd5);}};AGIVertices[_0x5ed9('0x12')][_0x5ed9('0x96')]=function(_0x776c98){var _0xcd09fc=_0x776c98[_0x5ed9('0xa0')]('{');for(var _0x203b55=0x1;_0x203b55<_0xcd09fc[_0x5ed9('0x99')];_0x203b55+=0x1){var _0x437d69=_0xcd09fc[_0x203b55]['split']('}');if(_0x437d69[_0x5ed9('0x99')]>0x1){_0x776c98=_0x776c98[_0x5ed9('0xa1')]('{'+_0x437d69[0x0]+'}',this[_0x5ed9('0x33')][_0x5ed9('0x13')](_0x437d69[0x0])[_0x5ed9('0xa2')]||_0x437d69[0x0]);}}if(_0xcd09fc[_0x5ed9('0x99')]===0x1){return _0x776c98[_0x5ed9('0x4c')]();}return this['replaceAllVariables'](_0x776c98);};AGIVertices[_0x5ed9('0x12')][_0x5ed9('0xa3')]=function(_0x2e143f,_0x5e6f9f){var _0x5d6141=this[_0x5ed9('0x33')][_0x5ed9('0x13')](_0x2e143f);if(_0x5d6141[_0x5ed9('0xa4')]===-0x1){return _0x5d6141;}logger['info'](util['format']('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0x5e6f9f,_0x5d6141[_0x5ed9('0xa2')]));return this[_0x5ed9('0x33')][_0x5ed9('0x9e')](_0x5e6f9f,_0x5d6141[_0x5ed9('0xa2')]);};AGIVertices['prototype']['isConfigured']=function(_0x5d5b6d){return _0x5d5b6d&&_0x5d5b6d!=='0'&&_0x5d5b6d!=='-1'&&_0x5d5b6d!=='';};AGIVertices[_0x5ed9('0x12')]['maxRetry']=function(_0xee1a2d){this[_0x5ed9('0x32')]['sync'](this,_0xee1a2d,'-');_0xee1a2d[_0x5ed9('0xa5')]=_0xee1a2d[_0x5ed9('0xa6')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x5ed9('0x12')][_0x5ed9('0xa7')]=function(_0x261853){logger[_0x5ed9('0x2c')](util[_0x5ed9('0x27')](_0x5ed9('0xa8'),_0x261853[_0x5ed9('0x34')]));if(!this[_0x5ed9('0x85')](_0x261853['text'])){return this[_0x5ed9('0x33')][_0x5ed9('0xa9')](_0x5ed9('0xaa'));}var _0x30846e='\x22'+_0x261853[_0x5ed9('0x5b')]+'\x22';if(this[_0x5ed9('0x85')](_0x261853['options'])){_0x30846e+=','+_0x261853[_0x5ed9('0x77')];}var _0x1f6a3c=this[_0x5ed9('0x33')]['exec'](_0x5ed9('0xab'),_0x30846e);if(_0x1f6a3c[_0x5ed9('0xa4')]===-0x1){return _0x1f6a3c;}return this[_0x5ed9('0x33')][_0x5ed9('0xa9')](util[_0x5ed9('0x27')](_0x5ed9('0xac'),_0x30846e));};AGIVertices[_0x5ed9('0x12')]['mrcprecog']=function(_0x6fb15f){logger[_0x5ed9('0x2c')](util[_0x5ed9('0x27')](_0x5ed9('0xad'),_0x6fb15f[_0x5ed9('0x34')]));if(!this[_0x5ed9('0x85')](_0x6fb15f[_0x5ed9('0xae')])){return this[_0x5ed9('0x33')][_0x5ed9('0xa9')]('no\x20grammar\x20configured');}var _0x6d7e5e=_0x6fb15f['grammar'];if(this['isConfigured'](_0x6fb15f[_0x5ed9('0x77')])){_0x6d7e5e+=','+_0x6fb15f['options'];}var _0x5a714b=this[_0x5ed9('0x33')][_0x5ed9('0x56')]('MRCPRecog',_0x6d7e5e);if(_0x5a714b[_0x5ed9('0xa4')]===-0x1){return _0x5a714b;}var _0x4e3bd8=this[_0x5ed9('0xa3')](_0x5ed9('0xaf'),_0x5ed9('0xb0'));if(_0x4e3bd8['result']===-0x1){return _0x4e3bd8;}var _0x497fca=this['getAndSetVariable'](_0x5ed9('0xb1'),'MRCP_RECOG_TRANSCRIPT');if(_0x497fca['result']===-0x1){return _0x497fca;}var _0x5c0b01=this['getAndSetVariable'](_0x5ed9('0xb2'),_0x5ed9('0xb3'));if(_0x5c0b01[_0x5ed9('0xa4')]===-0x1){return _0x5c0b01;}return this[_0x5ed9('0x33')][_0x5ed9('0xa9')](util[_0x5ed9('0x27')]('Executed\x20command\x20MRCPRecog\x20%s',_0x6d7e5e));};AGIVertices[_0x5ed9('0x12')][_0x5ed9('0x9')]=function(_0x7ae298){logger[_0x5ed9('0x2c')](util[_0x5ed9('0x27')](_0x5ed9('0xb4'),_0x7ae298[_0x5ed9('0x34')]));return this[_0x5ed9('0x33')][_0x5ed9('0x9')]([_0x7ae298[_0x5ed9('0xb5')],_0x7ae298[_0x5ed9('0xb6')]]);};AGIVertices[_0x5ed9('0x12')][_0x5ed9('0xb7')]=function(_0x1dcc51){logger[_0x5ed9('0x2c')](util[_0x5ed9('0x27')](_0x5ed9('0xb8'),_0x1dcc51[_0x5ed9('0x34')]));if(this[_0x5ed9('0x85')](_0x1dcc51['timeout'])){logger[_0x5ed9('0x2c')](util['format'](_0x5ed9('0xb9'),_0x1dcc51[_0x5ed9('0x64')]));var _0x20d284=this[_0x5ed9('0x33')]['wait'](_0x1dcc51['timeout']);if(_0x20d284[_0x5ed9('0xa4')]===-0x1){return _0x20d284;}}return this['channel'][_0x5ed9('0xb7')]();};AGIVertices[_0x5ed9('0x12')][_0x5ed9('0x4a')]=function(_0x455a84){logger[_0x5ed9('0x2c')](util[_0x5ed9('0x27')]('Enter\x20in\x20CALLBACK\x20(%s)\x20block',_0x455a84[_0x5ed9('0x34')]));if(!this[_0x5ed9('0x85')](_0x455a84[_0x5ed9('0x48')])){return this[_0x5ed9('0x33')][_0x5ed9('0x2a')](_0x455a84,_0x5ed9('0xba'));}_0x455a84[_0x5ed9('0x49')]=moment();if(this[_0x5ed9('0x85')](_0x455a84['delay'])){_0x455a84[_0x5ed9('0x49')]=moment()[_0x5ed9('0xbb')](_0x455a84[_0x5ed9('0xbc')],_0x5ed9('0xbd'));}if(!this[_0x5ed9('0x85')](_0x455a84[_0x5ed9('0x4d')])){_0x455a84[_0x5ed9('0x4d')]=0x2;}this[_0x5ed9('0x41')][_0x5ed9('0x70')](this,_0x455a84);return this[_0x5ed9('0x33')][_0x5ed9('0xa9')](util[_0x5ed9('0x27')]('CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s',_0x455a84[_0x5ed9('0x47')],_0x455a84[_0x5ed9('0x48')],_0x455a84[_0x5ed9('0x49')]));};AGIVertices[_0x5ed9('0x12')][_0x5ed9('0xbe')]=function(_0x11fdcf){logger[_0x5ed9('0x2c')](util[_0x5ed9('0x27')](_0x5ed9('0xbf'),_0x11fdcf[_0x5ed9('0x34')]));var _0x87b220=this[_0x5ed9('0x33')]['exec'](_0x11fdcf[_0x5ed9('0xc0')],_0x11fdcf['options']);if(_0x87b220[_0x5ed9('0xa4')]===-0x1){return _0x87b220;}return this[_0x5ed9('0x33')][_0x5ed9('0xa9')](util[_0x5ed9('0x27')]('Executed\x20command\x20%s\x20%s',_0x11fdcf[_0x5ed9('0xc0')],_0x11fdcf[_0x5ed9('0x77')]));};AGIVertices[_0x5ed9('0x12')][_0x5ed9('0xc1')]=function(_0xacf47e){logger[_0x5ed9('0x2c')](util[_0x5ed9('0x27')](_0x5ed9('0xc2'),_0xacf47e[_0x5ed9('0x34')]));if(!this[_0x5ed9('0x85')](_0xacf47e['text'])){return this[_0x5ed9('0x33')][_0x5ed9('0xa9')](_0x5ed9('0xaa'));}var _0x416f88='\x22'+_0xacf47e['text']+'\x22';if(this[_0x5ed9('0x85')](_0xacf47e[_0x5ed9('0x77')])){_0x416f88+=','+_0xacf47e[_0x5ed9('0x77')];}var _0x436b73=this[_0x5ed9('0x33')][_0x5ed9('0x56')]('MRCPSynth',_0x416f88);if(_0x436b73[_0x5ed9('0xa4')]===-0x1){return _0x436b73;}return this[_0x5ed9('0x33')][_0x5ed9('0xa9')](util[_0x5ed9('0x27')]('Executed\x20command\x20MRCPSynth\x20%s',_0x416f88));};AGIVertices[_0x5ed9('0x12')][_0x5ed9('0xc3')]=function(_0x22b027){logger[_0x5ed9('0x2c')](util[_0x5ed9('0x27')](_0x5ed9('0xc4'),_0x22b027[_0x5ed9('0x34')]));if(!this[_0x5ed9('0x85')](_0x22b027['text'])){return this[_0x5ed9('0x33')][_0x5ed9('0xa9')](_0x5ed9('0xaa'));}var _0x3ca355='\x22'+_0x22b027['text']+'\x22';if(this[_0x5ed9('0x85')](_0x22b027[_0x5ed9('0x77')])){_0x3ca355+=','+_0x22b027['options'];}var _0x594af1=this['channel']['exec'](_0x5ed9('0xab'),_0x3ca355);if(_0x594af1['result']===-0x1){return _0x594af1;}return this[_0x5ed9('0x33')][_0x5ed9('0xa9')](util[_0x5ed9('0x27')](_0x5ed9('0xac'),_0x3ca355));};AGIVertices['prototype']['lumenvoxasr']=function(_0x2f079c){logger[_0x5ed9('0x2c')](util['format'](_0x5ed9('0xc5'),_0x2f079c[_0x5ed9('0x34')]));if(!this[_0x5ed9('0x85')](_0x2f079c['grammar'])){return this[_0x5ed9('0x33')][_0x5ed9('0xa9')](_0x5ed9('0xc6'));}var _0x5f0fc3=_0x2f079c[_0x5ed9('0xae')];if(this[_0x5ed9('0x85')](_0x2f079c[_0x5ed9('0x77')])){_0x5f0fc3+=','+_0x2f079c['options'];}var _0x552d8b=this[_0x5ed9('0x33')][_0x5ed9('0x56')](_0x5ed9('0xc7'),_0x5f0fc3);if(_0x552d8b[_0x5ed9('0xa4')]===-0x1){return _0x552d8b;}var _0x57a8f5=this[_0x5ed9('0xa3')](_0x5ed9('0xaf'),_0x5ed9('0xc8'));if(_0x57a8f5[_0x5ed9('0xa4')]===-0x1){return _0x57a8f5;}var _0x339976=this[_0x5ed9('0xa3')]('RECOG_INPUT()',_0x5ed9('0xc9'));if(_0x339976[_0x5ed9('0xa4')]===-0x1){return _0x339976;}var _0x48de82=this['getAndSetVariable'](_0x5ed9('0xb2'),_0x5ed9('0xca'));if(_0x48de82[_0x5ed9('0xa4')]===-0x1){return _0x48de82;}return this['channel'][_0x5ed9('0xa9')](util[_0x5ed9('0x27')](_0x5ed9('0xcb'),_0x5f0fc3));};AGIVertices[_0x5ed9('0x12')]['sestekasr']=function(_0x1b1be0){logger[_0x5ed9('0x2c')](util[_0x5ed9('0x27')](_0x5ed9('0xcc'),_0x1b1be0[_0x5ed9('0x34')]));if(!this['isConfigured'](_0x1b1be0['grammar'])){return this[_0x5ed9('0x33')][_0x5ed9('0xa9')](_0x5ed9('0xc6'));}var _0x52412c=_0x1b1be0[_0x5ed9('0xae')];if(this[_0x5ed9('0x85')](_0x1b1be0[_0x5ed9('0x77')])){_0x52412c+=','+_0x1b1be0[_0x5ed9('0x77')];}var _0x4b8d23=this[_0x5ed9('0x33')]['exec']('MRCPRecog',_0x52412c);if(_0x4b8d23[_0x5ed9('0xa4')]===-0x1){return _0x4b8d23;}var _0x51ef1f=this[_0x5ed9('0xa3')](_0x5ed9('0xaf'),_0x5ed9('0xcd'));if(_0x51ef1f[_0x5ed9('0xa4')]===-0x1){return _0x51ef1f;}var _0x5835e9=this[_0x5ed9('0xa3')](_0x5ed9('0xb1'),'SESTEK_ASR_TRANSCRIPT');if(_0x5835e9[_0x5ed9('0xa4')]===-0x1){return _0x5835e9;}var _0x38719c=this['getAndSetVariable']('RECOG_INSTANCE()','SESTEK_ASR_INSTANCE');if(_0x38719c['result']===-0x1){return _0x38719c;}return this[_0x5ed9('0x33')][_0x5ed9('0xa9')](util[_0x5ed9('0x27')](_0x5ed9('0xcb'),_0x52412c));};AGIVertices[_0x5ed9('0x12')][_0x5ed9('0xce')]=function(_0x42fefd){logger['info'](util[_0x5ed9('0x27')](_0x5ed9('0xcf'),_0x42fefd[_0x5ed9('0x34')]));if(!this[_0x5ed9('0x85')](_0x42fefd[_0x5ed9('0xd0')])){return this[_0x5ed9('0x33')][_0x5ed9('0x2a')](_0x42fefd,'no\x20database\x20selected');}var _0x3c86d9=this[_0x5ed9('0x18')][_0x5ed9('0x70')](this,_0x42fefd['odbc_id']);if(!_0x3c86d9){return this[_0x5ed9('0x33')][_0x5ed9('0x2a')](_0x42fefd,'no\x20odbc\x20database\x20found');}if(!this[_0x5ed9('0x85')](_0x42fefd[_0x5ed9('0xd1')])){return this['channel'][_0x5ed9('0x2a')](_0x42fefd,_0x5ed9('0xd2'));}var _0x4cb62c=_0x42fefd['query'][_0x5ed9('0xd3')](/(\r\n|\n|\r)/gm,'\x20');this['channel'][_0x5ed9('0xa9')](util['format']('query:\x20%s',_0x4cb62c));var _0x36205b=this[_0x5ed9('0xd4')][_0x5ed9('0x70')](this,_0x3c86d9,_0x4cb62c);this['createSquareDetailsReport']['sync'](this,_0x42fefd,_0x4cb62c);if(!this[_0x5ed9('0x85')](_0x42fefd['variable_id'])){return this[_0x5ed9('0x33')]['noop'](_0x5ed9('0xd5'));}var _0x18e11f=this[_0x5ed9('0x13')]['sync'](this,_0x42fefd[_0x5ed9('0xd6')]);if(!_0x18e11f){return this[_0x5ed9('0x33')][_0x5ed9('0x2a')](_0x42fefd,_0x5ed9('0xd7'));}var _0x21f0d2=this;_0x36205b[_0x5ed9('0xd8')](function(_0xb381c2,_0x583c90){Object[_0x5ed9('0xd9')](_0xb381c2)[_0x5ed9('0xd8')](function(_0x4c668f){_0x21f0d2[_0x5ed9('0x33')][_0x5ed9('0x9e')](util[_0x5ed9('0x27')](_0x5ed9('0xda'),_0x18e11f,_0x583c90,_0x4c668f),_0xb381c2[_0x4c668f]);});});this['channel'][_0x5ed9('0x9e')](util[_0x5ed9('0x27')](_0x5ed9('0xdb'),_0x18e11f),_0x36205b[_0x5ed9('0x99')]);return this[_0x5ed9('0x33')][_0x5ed9('0xa9')](util[_0x5ed9('0x27')](_0x5ed9('0xdc'),_0x18e11f));};AGIVertices[_0x5ed9('0x12')]['dial']=function(_0x3178af){logger[_0x5ed9('0xdd')](util[_0x5ed9('0x27')](_0x5ed9('0xde'),_0x3178af['label']));if(!this['isConfigured'](_0x3178af[_0x5ed9('0xdf')])){return this[_0x5ed9('0x33')][_0x5ed9('0x2a')](_0x3178af,_0x5ed9('0xe0'));}var _0x2d9594=this['getUser'][_0x5ed9('0x70')](this,_0x3178af[_0x5ed9('0xdf')]);if(!_0x2d9594){return this[_0x5ed9('0x33')][_0x5ed9('0x2a')](_0x3178af,'no\x20user\x20found');}var _0x330de6=this[_0x5ed9('0x33')][_0x5ed9('0x56')](_0x5ed9('0xe1'),[util[_0x5ed9('0x27')](_0x5ed9('0xe2'),_0x2d9594),_0x3178af[_0x5ed9('0x64')],_0x3178af[_0x5ed9('0xe3')],_0x3178af['url']]);if(_0x330de6[_0x5ed9('0xa4')]===-0x1){return _0x330de6;}return this[_0x5ed9('0x33')][_0x5ed9('0xa9')](util[_0x5ed9('0x27')]('Executed\x20command\x20%s','DIAL'));};AGIVertices['prototype']['dialogflow']=function(_0x572dc2){logger[_0x5ed9('0x2c')](util['format'](_0x5ed9('0xe4'),_0x572dc2[_0x5ed9('0x34')]));if(!this['isConfigured'](_0x572dc2[_0x5ed9('0x80')])){return this['channel'][_0x5ed9('0xa9')](_0x5ed9('0xe5'));}if(!this[_0x5ed9('0x85')](_0x572dc2[_0x5ed9('0x5b')])){return this[_0x5ed9('0x33')][_0x5ed9('0xa9')](_0x5ed9('0xaa'));}this[_0x5ed9('0x33')][_0x5ed9('0xe6')]=!![];this[_0x5ed9('0x32')](_0x572dc2);this[_0x5ed9('0x40')](_0x572dc2[_0x5ed9('0x5b')],'in','','');this[_0x5ed9('0x33')][_0x5ed9('0xa9')](util['format']('Trying\x20Dialogflow:\x20%s',_0x572dc2[_0x5ed9('0x5b')]));var _0x60630d=this[_0x5ed9('0x78')][_0x5ed9('0x70')](this,_0x572dc2);if(_0x60630d){for(var _0x1a0cf8 in _0x60630d){if(_0x60630d['hasOwnProperty'](_0x1a0cf8)){this[_0x5ed9('0x33')]['setVariable'](util['format'](_0x5ed9('0xe7'),_0x1a0cf8[_0x5ed9('0x69')]()),_0x60630d[_0x1a0cf8]);}}this['createSquareMessage'](_0x60630d[_0x5ed9('0xe8')],_0x5ed9('0xe9'),_0x5ed9('0xea'),'');return this[_0x5ed9('0x33')][_0x5ed9('0xa9')](util['format'](_0x5ed9('0xeb'),_0x60630d['speech']));}return this[_0x5ed9('0x33')][_0x5ed9('0x2a')](_0x572dc2,_0x5ed9('0xec'));};AGIVertices[_0x5ed9('0x12')][_0x5ed9('0xed')]=function(_0x323db1){logger[_0x5ed9('0x2c')](util[_0x5ed9('0x27')]('Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block',_0x323db1[_0x5ed9('0x34')]));if(!this[_0x5ed9('0x85')](_0x323db1[_0x5ed9('0x7b')])){return this[_0x5ed9('0x33')][_0x5ed9('0xa9')](_0x5ed9('0xee'));}if(!this[_0x5ed9('0x85')](_0x323db1[_0x5ed9('0x7c')])){return this[_0x5ed9('0x33')][_0x5ed9('0xa9')](_0x5ed9('0xef'));}if(!this[_0x5ed9('0x85')](_0x323db1[_0x5ed9('0x7d')])){return this[_0x5ed9('0x33')][_0x5ed9('0xa9')]('no\x20private_key\x20configured');}if(!this[_0x5ed9('0x85')](_0x323db1[_0x5ed9('0x7e')])){return this[_0x5ed9('0x33')][_0x5ed9('0xa9')](_0x5ed9('0xf0'));}if(!this[_0x5ed9('0x85')](_0x323db1[_0x5ed9('0x5b')])){return this['channel'][_0x5ed9('0xa9')](_0x5ed9('0xaa'));}this['channel'][_0x5ed9('0xe6')]=!![];this[_0x5ed9('0x32')](_0x323db1);this[_0x5ed9('0x40')](_0x323db1['text'],'in','','');this['channel'][_0x5ed9('0xa9')](util[_0x5ed9('0x27')](_0x5ed9('0xf1'),_0x323db1[_0x5ed9('0x5b')]));var _0x1eec46=this[_0x5ed9('0x7a')][_0x5ed9('0x70')](this,_0x323db1);if(_0x1eec46){for(var _0x24eed6 in _0x1eec46){if(_0x1eec46[_0x5ed9('0x95')](_0x24eed6)){if(_0x24eed6!==_0x5ed9('0xf2')){this[_0x5ed9('0x33')]['setVariable'](util[_0x5ed9('0x27')](_0x5ed9('0xe7'),_0x24eed6[_0x5ed9('0x69')]()),_0x1eec46[_0x24eed6]);}}}this[_0x5ed9('0x40')](_0x1eec46['speech'],'out',_0x5ed9('0xed'),_0x1eec46[_0x5ed9('0xf2')]);return this[_0x5ed9('0x33')][_0x5ed9('0xa9')](util['format'](_0x5ed9('0xf3'),_0x1eec46[_0x5ed9('0xe8')]));}return this['channel'][_0x5ed9('0x2a')](_0x323db1,_0x5ed9('0xf4'));};AGIVertices[_0x5ed9('0x12')][_0x5ed9('0xf5')]=function(_0x21dc3e){logger['info'](util[_0x5ed9('0x27')](_0x5ed9('0xf6'),_0x21dc3e['label']));if(!this[_0x5ed9('0x85')](_0x21dc3e[_0x5ed9('0xf7')])){return this[_0x5ed9('0x33')][_0x5ed9('0xa9')](_0x5ed9('0xf8'));}if(!this[_0x5ed9('0x85')](_0x21dc3e[_0x5ed9('0xf9')])){return this[_0x5ed9('0x33')][_0x5ed9('0xa9')](_0x5ed9('0xfa'));}if(!this[_0x5ed9('0x85')](_0x21dc3e[_0x5ed9('0xfb')])){return this[_0x5ed9('0x33')][_0x5ed9('0xa9')]('no\x20password\x20configured');}if(!this[_0x5ed9('0x85')](_0x21dc3e['ndassistant_url'])){return this[_0x5ed9('0x33')][_0x5ed9('0xa9')]('no\x20text\x20configured');}this[_0x5ed9('0x33')][_0x5ed9('0xe6')]=!![];this[_0x5ed9('0x32')](_0x21dc3e);this['createSquareMessage'](_0x21dc3e['text'],'in','','');this[_0x5ed9('0x33')][_0x5ed9('0xa9')](util[_0x5ed9('0x27')](_0x5ed9('0xfc'),_0x21dc3e[_0x5ed9('0x5b')]));var _0x49a0e8=this['sestekNDA']['sync'](this,_0x21dc3e);if(_0x49a0e8){for(var _0x4b95b7 in _0x49a0e8){if(_0x49a0e8[_0x5ed9('0x95')](_0x4b95b7)){this[_0x5ed9('0x33')]['setVariable'](util['format'](_0x5ed9('0xfd'),_0x4b95b7['toUpperCase']()),_0x49a0e8[_0x4b95b7]);}}this[_0x5ed9('0x40')](_0x49a0e8[_0x5ed9('0xe8')],_0x5ed9('0xe9'),_0x5ed9('0xf5'),'');if(_0x49a0e8[_0x5ed9('0xfe')]){this['channel'][_0x5ed9('0xa9')](util[_0x5ed9('0x27')](_0x5ed9('0xff'),_0x49a0e8[_0x5ed9('0xfe')]));var _0x547ebc=this[_0x5ed9('0x33')]['streamFile'](_0x49a0e8[_0x5ed9('0xfe')]);try{fs[_0x5ed9('0x100')](_0x49a0e8[_0x5ed9('0xfe')]+_0x5ed9('0x101'));}catch(_0x3dd1ea){logger[_0x5ed9('0x2a')](_0x3dd1ea);}return _0x547ebc;}else{return this['channel'][_0x5ed9('0xa9')](util[_0x5ed9('0x27')]('SestekNDA\x20Result\x20%s',_0x49a0e8['speech']));}}return this[_0x5ed9('0x33')][_0x5ed9('0x2a')](_0x21dc3e,_0x5ed9('0x102'));};AGIVertices[_0x5ed9('0x12')][_0x5ed9('0x103')]=function(_0x1b20a8){logger[_0x5ed9('0x2c')](util[_0x5ed9('0x27')](_0x5ed9('0x104'),_0x1b20a8[_0x5ed9('0x34')]));return this[_0x5ed9('0x33')][_0x5ed9('0xa9')](_0x5ed9('0x103'));};AGIVertices['prototype']['ext_dial']=function(_0x283620){logger['info'](util['format']('Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block',_0x283620[_0x5ed9('0x34')]));var _0x1eb44e='';if(_0x283620['trunk_id']){if(!this['isConfigured'](_0x283620[_0x5ed9('0x105')])){return this[_0x5ed9('0x33')][_0x5ed9('0x2a')](_0x283620,_0x5ed9('0x106'));}else{var _0x1350e7=parseInt(_0x283620[_0x5ed9('0x105')],0xa);if(isNaN(_0x1350e7)){_0x1eb44e=_0x283620[_0x5ed9('0x105')];}else{_0x1eb44e=this[_0x5ed9('0x1c')][_0x5ed9('0x70')](this,_0x283620['trunk_id']);if(!_0x1eb44e){return this[_0x5ed9('0x33')][_0x5ed9('0x2a')](_0x283620,_0x5ed9('0x107'));}}}}else if(_0x283620[_0x5ed9('0x108')]){_0x1eb44e=_0x283620['trunk_name'];}else{return this[_0x5ed9('0x33')][_0x5ed9('0x2a')](_0x283620,_0x5ed9('0x106'));}var _0x2e6cc0=this[_0x5ed9('0x33')][_0x5ed9('0x56')](_0x5ed9('0xe1'),[util['format'](_0x5ed9('0x109'),_0x1eb44e,_0x283620[_0x5ed9('0x47')]),_0x283620['timeout'],_0x283620[_0x5ed9('0xe3')],_0x283620[_0x5ed9('0x72')]]);if(_0x2e6cc0['result']===-0x1){return _0x2e6cc0;}return this[_0x5ed9('0x33')][_0x5ed9('0xa9')](util[_0x5ed9('0x27')](_0x5ed9('0x10a'),'DIAL'));};AGIVertices[_0x5ed9('0x12')][_0x5ed9('0x10b')]=function(_0x5700e1){logger[_0x5ed9('0x2c')](util[_0x5ed9('0x27')]('Enter\x20in\x20FINALLY\x20(%s)\x20block',_0x5700e1['label']));return this[_0x5ed9('0x33')][_0x5ed9('0xa9')]('finally');};AGIVertices[_0x5ed9('0x12')][_0x5ed9('0xe')]=function(_0x3c2e8c){logger[_0x5ed9('0x2c')](util[_0x5ed9('0x27')](_0x5ed9('0x10c'),_0x3c2e8c[_0x5ed9('0x34')]));if(_0x3c2e8c[_0x5ed9('0xa5')]===0x0){return this[_0x5ed9('0xa6')](_0x3c2e8c);}_0x3c2e8c[_0x5ed9('0xa5')]-=0x1;if(!this[_0x5ed9('0x85')](_0x3c2e8c[_0x5ed9('0x10d')])){return this[_0x5ed9('0x33')][_0x5ed9('0x2a')](_0x3c2e8c,_0x5ed9('0x10e'));}var _0x7f634f=this[_0x5ed9('0x10f')][_0x5ed9('0x70')](this,_0x3c2e8c['file_id']);if(!_0x7f634f){return this[_0x5ed9('0x33')][_0x5ed9('0x2a')](_0x3c2e8c,_0x5ed9('0x110'));}if(!this[_0x5ed9('0x85')](_0x3c2e8c[_0x5ed9('0xd6')])){return this[_0x5ed9('0x33')][_0x5ed9('0x2a')](_0x5ed9('0xd5'));}var _0x4d7fab=this[_0x5ed9('0x33')][_0x5ed9('0x111')](_0x7f634f,_0x3c2e8c[_0x5ed9('0x112')],_0x3c2e8c[_0x5ed9('0x113')]);var _0x27500b=_0x4d7fab['result']?_0x4d7fab[_0x5ed9('0xa4')][_0x5ed9('0x4c')]():'';logger['info'](_0x5ed9('0x114'),JSON[_0x5ed9('0x73')](_0x4d7fab));if(_0x4d7fab[_0x5ed9('0xa4')]===-0x1){this[_0x5ed9('0x32')]['sync'](this,_0x3c2e8c,_0x27500b);return _0x4d7fab;}else if(_0x4d7fab['extra']===_0x5ed9('0x64')){_0x4d7fab['result']=_0x27500b[_0x5ed9('0x99')]>=parseInt(_0x3c2e8c['mindigit'])?'x':'i';}else{_0x4d7fab[_0x5ed9('0xa4')]=_0x27500b[_0x5ed9('0x99')]>=parseInt(_0x3c2e8c[_0x5ed9('0x115')])&&_0x27500b['length']<=parseInt(_0x3c2e8c[_0x5ed9('0x113')])?'x':'i';}var _0x37efee=this[_0x5ed9('0x13')][_0x5ed9('0x70')](this,_0x3c2e8c[_0x5ed9('0xd6')]);if(!_0x37efee){return this['channel'][_0x5ed9('0x2a')](_0x3c2e8c,'no\x20variable\x20found');}this['channel'][_0x5ed9('0x9e')](_0x37efee,_0x27500b);if(this[_0x5ed9('0x85')](_0x3c2e8c['hiddendigitsnum'])){var _0x548288=parseInt(_0x3c2e8c['hiddendigitsnum'],0xa);var _0x15a414=rs[_0x5ed9('0x116')]({'charset':'*','length':_0x548288});var _0x4b0f73=_0x27500b[_0x5ed9('0x99')];if(_0x4b0f73>0x0){if(_0x4b0f73>_0x548288){this[_0x5ed9('0x32')][_0x5ed9('0x70')](this,_0x3c2e8c,_0x3c2e8c[_0x5ed9('0x117')]===_0x5ed9('0x118')?_0x15a414+_0x27500b['substr'](_0x548288):_0x27500b[_0x5ed9('0x119')](0x0,_0x4b0f73-_0x548288)+_0x15a414);}else{this[_0x5ed9('0x32')][_0x5ed9('0x70')](this,_0x3c2e8c,rs[_0x5ed9('0x116')]({'charset':'*','length':_0x4b0f73}));}}else{this[_0x5ed9('0x32')]['sync'](this,_0x3c2e8c,'');}}else{this[_0x5ed9('0x32')][_0x5ed9('0x70')](this,_0x3c2e8c,_0x27500b);}return _0x4d7fab;};AGIVertices[_0x5ed9('0x12')][_0x5ed9('0xf')]=function(_0x36ba69){logger['info'](util[_0x5ed9('0x27')]('Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block',_0x36ba69[_0x5ed9('0x34')]));return this[_0x5ed9('0xe')](_0x36ba69);};AGIVertices[_0x5ed9('0x12')]['goal']=function(_0x51a1ee){logger[_0x5ed9('0x2c')](util['format'](_0x5ed9('0x11a'),_0x51a1ee[_0x5ed9('0x34')]));this[_0x5ed9('0x32')][_0x5ed9('0x70')](this,_0x51a1ee,_0x51a1ee[_0x5ed9('0x11b')]);return this[_0x5ed9('0x33')][_0x5ed9('0xa9')](util[_0x5ed9('0x27')]('GOAL\x20%s',_0x51a1ee[_0x5ed9('0x11b')]));};AGIVertices[_0x5ed9('0x12')]['awspolly']=function(_0x222287){logger[_0x5ed9('0x2c')](util[_0x5ed9('0x27')](_0x5ed9('0x11c'),_0x222287['label']));if(!this[_0x5ed9('0x85')](_0x222287['aws_access_key_id'])||!this['isConfigured'](_0x222287[_0x5ed9('0x8c')])){return this[_0x5ed9('0x33')]['noop'](_0x5ed9('0x11d'));}if(!this['isConfigured'](_0x222287['text'])){return this['channel'][_0x5ed9('0xa9')](_0x5ed9('0xaa'));}this[_0x5ed9('0x33')]['noop'](util['format'](_0x5ed9('0x11e'),_0x222287['text']));var _0x54e644=this[_0x5ed9('0x87')][_0x5ed9('0x70')](this,_0x222287);if(_0x54e644){this[_0x5ed9('0x33')][_0x5ed9('0xa9')](util[_0x5ed9('0x27')]('aws\x20Polly\x20%s\x20file\x20created',_0x54e644));var _0x11bef2=this[_0x5ed9('0x33')][_0x5ed9('0x11f')](_0x54e644);try{fs[_0x5ed9('0x100')](_0x54e644+_0x5ed9('0x101'));}catch(_0x19ed70){logger[_0x5ed9('0x2a')](_0x19ed70);}return _0x11bef2;}return this[_0x5ed9('0x33')][_0x5ed9('0x2a')](_0x222287,_0x5ed9('0x120'));};AGIVertices[_0x5ed9('0x12')][_0x5ed9('0x121')]=function(_0x51aebd){logger[_0x5ed9('0x2c')](util[_0x5ed9('0x27')](_0x5ed9('0x122'),_0x51aebd[_0x5ed9('0x34')]));if(!this[_0x5ed9('0x85')](_0x51aebd[_0x5ed9('0x88')])||!this[_0x5ed9('0x85')](_0x51aebd[_0x5ed9('0x8c')])){return this['channel'][_0x5ed9('0xa9')](_0x5ed9('0x11d'));}if(!this['isConfigured'](_0x51aebd['aws_bot_name'])){return this[_0x5ed9('0x33')][_0x5ed9('0xa9')](_0x5ed9('0x123'));}if(!this[_0x5ed9('0x85')](_0x51aebd[_0x5ed9('0x5b')])){return this['channel'][_0x5ed9('0xa9')](_0x5ed9('0xaa'));}this[_0x5ed9('0x33')]['bot']=!![];this[_0x5ed9('0x32')](_0x51aebd);this[_0x5ed9('0x40')](_0x51aebd[_0x5ed9('0x5b')],'in','','');this['channel'][_0x5ed9('0xa9')](util[_0x5ed9('0x27')](_0x5ed9('0x124'),_0x51aebd[_0x5ed9('0x5b')]));var _0x3f2924=this[_0x5ed9('0x8b')]['sync'](this,_0x51aebd);if(_0x3f2924){for(var _0x1db916 in _0x3f2924){if(_0x3f2924[_0x5ed9('0x95')](_0x1db916)&&_[_0x5ed9('0x9a')](_0x3f2924[_0x1db916])){this['channel'][_0x5ed9('0x9e')](util['format']('AWS_LEX_%s',_0x1db916['toUpperCase']()),_0x3f2924[_0x1db916]);}}if(_[_0x5ed9('0x42')](_0x3f2924[_0x5ed9('0x125')])){return this['channel'][_0x5ed9('0xa9')](_0x5ed9('0x126'));}else{this['createSquareMessage'](_0x3f2924[_0x5ed9('0x125')],_0x5ed9('0xe9'),_0x5ed9('0x127'),'');return this['channel'][_0x5ed9('0xa9')](util[_0x5ed9('0x27')]('Amazon\x20Lex\x20Result\x20%s',_0x3f2924['message']));}}return this[_0x5ed9('0x33')][_0x5ed9('0x2a')](_0x51aebd,_0x5ed9('0x128'));};AGIVertices[_0x5ed9('0x12')][_0x5ed9('0x129')]=function(_0x38fcf9){logger[_0x5ed9('0x2c')](util[_0x5ed9('0x27')](_0x5ed9('0x12a'),_0x38fcf9['label'],_0x38fcf9[_0x5ed9('0x64')]));if(!this[_0x5ed9('0x85')](_0x38fcf9[_0x5ed9('0x80')])){return this[_0x5ed9('0x33')][_0x5ed9('0xa9')](_0x5ed9('0xe5'));}var _0x1d8ba7=_0x5ed9('0x12b');var _0x2f360c=util[_0x5ed9('0x27')]('%s/recordings/%s',FILES_PATH,rs[_0x5ed9('0x116')](0x4));var _0x5a8d33=util['format'](_0x5ed9('0x9d'),_0x2f360c,_0x1d8ba7);var _0x59ae5d=!![];if(_0x38fcf9['beep']===_0x5ed9('0x12c')){_0x59ae5d=![];}var _0x5306e6=this['channel'][_0x5ed9('0x12d')](_0x2f360c,_0x1d8ba7,_0x38fcf9['intKey'],_0x38fcf9[_0x5ed9('0x64')],undefined,_0x59ae5d);if(_0x5306e6[_0x5ed9('0xa4')]!==-0x1){this[_0x5ed9('0x33')][_0x5ed9('0xa9')](util[_0x5ed9('0x27')](_0x5ed9('0x12e'),_0x5a8d33));var _0x15f290=this['googleASR']['sync'](this,_0x38fcf9,_0x5a8d33);if(_0x15f290){for(var _0xba7ef1 in _0x15f290){if(_0x15f290[_0x5ed9('0x95')](_0xba7ef1)){this[_0x5ed9('0x33')][_0x5ed9('0x9e')](util[_0x5ed9('0x27')]('GOOGLE_ASR_%s',_0xba7ef1[_0x5ed9('0x69')]()),_0x15f290[_0xba7ef1]);}}return this['channel'][_0x5ed9('0xa9')](util[_0x5ed9('0x27')](_0x5ed9('0x12f'),JSON[_0x5ed9('0x73')](_0x15f290)));}}return _0x5306e6;};AGIVertices[_0x5ed9('0x12')][_0x5ed9('0x130')]=function(_0x402e3d){logger[_0x5ed9('0x2c')](util[_0x5ed9('0x27')]('Enter\x20in\x20TILDEASR\x20(%s)\x20block',_0x402e3d[_0x5ed9('0x34')]));if(!this[_0x5ed9('0x85')](_0x402e3d[_0x5ed9('0x91')])){return this[_0x5ed9('0x33')][_0x5ed9('0xa9')]('no\x20appid\x20configured');}if(!this[_0x5ed9('0x85')](_0x402e3d[_0x5ed9('0x92')])){return this['channel'][_0x5ed9('0xa9')]('no\x20appsecret\x20configured');}var _0x253951=_0x5ed9('0x12b');var _0x2e5cb6=util[_0x5ed9('0x27')](_0x5ed9('0x131'),FILES_PATH,rs[_0x5ed9('0x116')](0x4));var _0x5b569b=util[_0x5ed9('0x27')](_0x5ed9('0x9d'),_0x2e5cb6,_0x253951);var _0x5ce05c=!![];if(_0x402e3d[_0x5ed9('0x132')]===_0x5ed9('0x12c')){_0x5ce05c=![];}var _0x3b2384=this['channel'][_0x5ed9('0x12d')](_0x2e5cb6,_0x253951,_0x402e3d[_0x5ed9('0x133')],_0x402e3d['timeout'],undefined,_0x5ce05c);if(_0x3b2384[_0x5ed9('0xa4')]!==-0x1){this[_0x5ed9('0x33')]['noop'](util[_0x5ed9('0x27')](_0x5ed9('0x134'),_0x5b569b));var _0x35d9a4=this[_0x5ed9('0x90')][_0x5ed9('0x70')](this,_0x402e3d,_0x5b569b);if(_0x35d9a4){for(var _0xc9bb13 in _0x35d9a4){if(_0x35d9a4[_0x5ed9('0x95')](_0xc9bb13)){this[_0x5ed9('0x33')][_0x5ed9('0x9e')](util['format'](_0x5ed9('0x135'),_0xc9bb13[_0x5ed9('0x69')]()),_0x35d9a4[_0xc9bb13]);}}return this[_0x5ed9('0x33')][_0x5ed9('0xa9')](util[_0x5ed9('0x27')](_0x5ed9('0x136'),JSON[_0x5ed9('0x73')](_0x35d9a4)));}}return _0x3b2384;};AGIVertices['prototype'][_0x5ed9('0x137')]=function(_0x321796){logger[_0x5ed9('0x2c')](util['format'](_0x5ed9('0x138'),_0x321796[_0x5ed9('0x34')]));return this[_0x5ed9('0x33')][_0x5ed9('0x139')](_0x321796[_0x5ed9('0x3a')],_0x321796[_0x5ed9('0x3b')],_0x321796['priority']);};AGIVertices[_0x5ed9('0x12')][_0x5ed9('0x13a')]=function(_0x3070f4){logger[_0x5ed9('0x2c')](util[_0x5ed9('0x27')](_0x5ed9('0x13b'),_0x3070f4[_0x5ed9('0x34')]));if(!this[_0x5ed9('0x85')](_0x3070f4[_0x5ed9('0x13c')])){return this[_0x5ed9('0x33')][_0x5ed9('0x2a')](_0x3070f4,_0x5ed9('0x13d'));}try{var _0x28d63d=eval(_0x3070f4[_0x5ed9('0x13c')])?_0x5ed9('0x13e'):_0x5ed9('0x13f');this[_0x5ed9('0x33')][_0x5ed9('0xa9')](util['format']('EVAL\x20CONDITION\x20%s\x20%s',_0x3070f4[_0x5ed9('0x13c')],_0x28d63d));return{'code':0xc8,'result':_0x28d63d};}catch(_0x1e50d6){return{'code':0xc8,'result':_0x5ed9('0x13f')};}};AGIVertices[_0x5ed9('0x12')][_0x5ed9('0x140')]=function(_0x3dddbc){logger[_0x5ed9('0x2c')](util[_0x5ed9('0x27')]('Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block',_0x3dddbc[_0x5ed9('0x34')]));if(!this['isConfigured'](_0x3dddbc[_0x5ed9('0x141')])){return this[_0x5ed9('0x33')][_0x5ed9('0x2a')](_0x3dddbc,_0x5ed9('0x142'));}var _0x5a9989=this['getIntervals'][_0x5ed9('0x70')](this,_0x3dddbc[_0x5ed9('0x141')]);if(!_0x5a9989){return this[_0x5ed9('0x33')][_0x5ed9('0x2a')](_0x3dddbc,_0x5ed9('0x143'));}for(var _0xf96148=0x0;_0xf96148<_0x5a9989[_0x5ed9('0x99')];_0xf96148+=0x1){var _0x4d685b=this[_0x5ed9('0x33')][_0x5ed9('0x13')](util[_0x5ed9('0x27')](_0x5ed9('0x144'),_0x5a9989[_0xf96148]));if(_0x4d685b[_0x5ed9('0xa4')]===-0x1){return _0x4d685b;}logger[_0x5ed9('0x2c')](util[_0x5ed9('0x27')]('IFTIME\x20%s\x20%s',_0x5a9989[_0xf96148],_0x4d685b[_0x5ed9('0xa2')]));if(_0x4d685b[_0x5ed9('0xa2')]===_0x5ed9('0x13e')){logger[_0x5ed9('0x2c')](util[_0x5ed9('0x27')]('IFTIME\x20%s\x20%s',_0x5a9989[_0xf96148],_0x5ed9('0x13e')));this[_0x5ed9('0x33')]['noop'](util[_0x5ed9('0x27')]('IFTIME\x20%s\x20%s',_0x5a9989[_0xf96148],'true'));return{'code':0xc8,'result':'true'};}else{logger[_0x5ed9('0x2c')](util['format'](_0x5ed9('0x145'),_0x5a9989[_0xf96148],_0x5ed9('0x13f')));this[_0x5ed9('0x33')][_0x5ed9('0xa9')](util[_0x5ed9('0x27')](_0x5ed9('0x145'),_0x5a9989[_0xf96148],_0x5ed9('0x13f')));}}return{'code':0xc8,'result':'false'};};AGIVertices['prototype'][_0x5ed9('0x146')]=function(_0x325e39){logger['info'](util[_0x5ed9('0x27')]('Enter\x20in\x20HANGUP\x20(%s)\x20block',_0x325e39[_0x5ed9('0x34')]));return this['channel'][_0x5ed9('0x146')]();};AGIVertices[_0x5ed9('0x12')][_0x5ed9('0x147')]=function(_0x3f86b8){logger[_0x5ed9('0x2c')](util[_0x5ed9('0x27')](_0x5ed9('0x148'),_0x3f86b8[_0x5ed9('0x34')]));if(!this[_0x5ed9('0x85')](_0x3f86b8['key'])){return this[_0x5ed9('0x33')]['noop'](_0x5ed9('0xe5'));}var _0x17ddd9=_0x5ed9('0x12b');var _0x467271=util[_0x5ed9('0x27')](_0x5ed9('0x131'),FILES_PATH,rs[_0x5ed9('0x116')](0x4));var _0x5a7d12=util[_0x5ed9('0x27')](_0x5ed9('0x9d'),_0x467271,_0x17ddd9);var _0x5b4884=!![];if(_0x3f86b8[_0x5ed9('0x132')]===_0x5ed9('0x12c')){_0x5b4884=![];}var _0x2344a9=this[_0x5ed9('0x33')][_0x5ed9('0x12d')](_0x467271,_0x17ddd9,_0x3f86b8['intKey'],_0x3f86b8['timeout'],undefined,_0x5b4884);if(_0x2344a9['result']!==-0x1){this['channel'][_0x5ed9('0xa9')](util['format']('ispeech\x20%s\x20file\x20created',_0x5a7d12));var _0x2a0316=this['ispeechASR'][_0x5ed9('0x70')](this,_0x3f86b8,_0x5a7d12);if(_0x2a0316){for(var _0x46c75b in _0x2a0316){if(_0x2a0316[_0x5ed9('0x95')](_0x46c75b)){this[_0x5ed9('0x33')][_0x5ed9('0x9e')](util[_0x5ed9('0x27')](_0x5ed9('0x149'),_0x46c75b[_0x5ed9('0x69')]()),_0x2a0316[_0x46c75b]);}}return this[_0x5ed9('0x33')]['noop'](util[_0x5ed9('0x27')](_0x5ed9('0x14a'),JSON[_0x5ed9('0x73')](_0x2a0316)));}}return _0x2344a9;};AGIVertices[_0x5ed9('0x12')][_0x5ed9('0x14b')]=function(_0x37dc92){logger['info'](util[_0x5ed9('0x27')]('Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block',_0x37dc92[_0x5ed9('0x34')]));if(!this['isConfigured'](_0x37dc92[_0x5ed9('0x80')])){return this[_0x5ed9('0x33')][_0x5ed9('0xa9')]('no\x20key\x20configured');}if(!this['isConfigured'](_0x37dc92['text'])){return this[_0x5ed9('0x33')][_0x5ed9('0xa9')](_0x5ed9('0xaa'));}this[_0x5ed9('0x33')][_0x5ed9('0xa9')](util[_0x5ed9('0x27')](_0x5ed9('0x14c'),_0x37dc92[_0x5ed9('0x5b')]));var _0x55558f=this[_0x5ed9('0x14d')]['sync'](this,_0x37dc92);if(_0x55558f){this[_0x5ed9('0x33')]['noop'](util[_0x5ed9('0x27')](_0x5ed9('0x14e'),_0x55558f));var _0x30f6ad=this[_0x5ed9('0x33')]['streamFile'](_0x55558f,_0x37dc92[_0x5ed9('0x133')]);try{fs[_0x5ed9('0x100')](_0x55558f+_0x5ed9('0x101'));}catch(_0x1e687f){logger[_0x5ed9('0x2a')](_0x1e687f);}return _0x30f6ad;}return this[_0x5ed9('0x33')][_0x5ed9('0x2a')](_0x37dc92,_0x5ed9('0x14f'));};AGIVertices[_0x5ed9('0x12')][_0x5ed9('0x150')]=function(_0x5b7cf1){logger[_0x5ed9('0x2c')](util[_0x5ed9('0x27')](_0x5ed9('0x151'),_0x5b7cf1['label']));if(!this[_0x5ed9('0x85')](_0x5b7cf1[_0x5ed9('0x152')])){return this[_0x5ed9('0x33')][_0x5ed9('0x2a')](_0x5b7cf1,_0x5ed9('0x153'));}logger[_0x5ed9('0x2c')](util[_0x5ed9('0x27')](_0x5ed9('0x154'),this[_0x5ed9('0x33')][_0x5ed9('0x36')],_0x5b7cf1['findBy']));var _0x2658cb=this['agentLogin']['sync'](this,_0x5b7cf1[_0x5ed9('0x152')]);if(_0x2658cb){logger['info'](util[_0x5ed9('0x27')]('AGENT\x20%s\x20FOUND\x20BY',this['channel']['callerid'],_0x5b7cf1[_0x5ed9('0x152')]));this[_0x5ed9('0x33')][_0x5ed9('0xa9')](util[_0x5ed9('0x27')](_0x5ed9('0x155'),this['channel']['callerid'],_0x5b7cf1[_0x5ed9('0x152')]));return{'code':0xc8,'result':_0x5ed9('0x156')};}else{logger[_0x5ed9('0x2c')](util[_0x5ed9('0x27')](_0x5ed9('0x157'),this[_0x5ed9('0x33')][_0x5ed9('0x36')],_0x5b7cf1[_0x5ed9('0x152')]));this[_0x5ed9('0x33')][_0x5ed9('0xa9')](util[_0x5ed9('0x27')](_0x5ed9('0x157'),this[_0x5ed9('0x33')]['callerid'],_0x5b7cf1[_0x5ed9('0x152')]));return{'code':0xc8,'result':_0x5ed9('0x158')};}};AGIVertices[_0x5ed9('0x12')][_0x5ed9('0x159')]=function(_0x223af1){logger[_0x5ed9('0x2c')](util[_0x5ed9('0x27')](_0x5ed9('0x15a'),_0x223af1['label']));if(!this[_0x5ed9('0x85')](_0x223af1['findBy'])){return this[_0x5ed9('0x33')][_0x5ed9('0x2a')](_0x223af1,_0x5ed9('0x153'));}logger[_0x5ed9('0x2c')](util[_0x5ed9('0x27')](_0x5ed9('0x154'),this[_0x5ed9('0x33')][_0x5ed9('0x36')],_0x223af1['findBy']));var _0x4c1b1a=this[_0x5ed9('0x51')]['sync'](this,_0x223af1['findBy']);if(_0x4c1b1a){logger[_0x5ed9('0x2c')](util[_0x5ed9('0x27')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x5ed9('0x33')]['callerid'],_0x223af1[_0x5ed9('0x152')]));this[_0x5ed9('0x33')]['noop'](util[_0x5ed9('0x27')](_0x5ed9('0x155'),this[_0x5ed9('0x33')][_0x5ed9('0x36')],_0x223af1['findBy']));return{'code':0xc8,'result':_0x5ed9('0x156')};}else{logger['info'](util['format'](_0x5ed9('0x157'),this['channel'][_0x5ed9('0x36')],_0x223af1[_0x5ed9('0x152')]));this['channel'][_0x5ed9('0xa9')](util['format'](_0x5ed9('0x157'),this[_0x5ed9('0x33')][_0x5ed9('0x36')],_0x223af1[_0x5ed9('0x152')]));return{'code':0xc8,'result':_0x5ed9('0x158')};}};AGIVertices['prototype']['math']=function(_0x3f9fae){logger[_0x5ed9('0x2c')](util[_0x5ed9('0x27')](_0x5ed9('0x15b'),_0x3f9fae[_0x5ed9('0x34')]));if(!this[_0x5ed9('0x85')](_0x3f9fae['operation'])){return this[_0x5ed9('0x33')][_0x5ed9('0x2a')](_0x3f9fae,_0x5ed9('0x15c'));}this[_0x5ed9('0x33')][_0x5ed9('0xa9')](util[_0x5ed9('0x27')](_0x5ed9('0x15d'),_0x3f9fae[_0x5ed9('0x15e')]));var _0x4b3cc6=eval(_0x3f9fae[_0x5ed9('0x15e')]);if(!this['isConfigured'](_0x3f9fae[_0x5ed9('0xd6')])){return this[_0x5ed9('0x33')][_0x5ed9('0xa9')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x3f8f1e=this[_0x5ed9('0x13')]['sync'](this,_0x3f9fae['variable_id']);if(!_0x3f8f1e){return this[_0x5ed9('0x33')][_0x5ed9('0x2a')](_0x3f9fae,_0x5ed9('0xd7'));}if(_['isArray'](_0x4b3cc6)){var _0xdf7514=this;_0x4b3cc6[_0x5ed9('0xd8')](function(_0x45697b,_0x4ad1c4){_0xdf7514[_0x5ed9('0x33')][_0x5ed9('0x9e')](util[_0x5ed9('0x27')]('%s[%s]',_0x3f8f1e,_0x4ad1c4),_0x45697b);});return this[_0x5ed9('0x33')][_0x5ed9('0xa9')](util[_0x5ed9('0x27')](_0x5ed9('0x15f'),_0x3f8f1e));}else{return this[_0x5ed9('0x33')][_0x5ed9('0x9e')](_0x3f8f1e,_0x4b3cc6);}};AGIVertices[_0x5ed9('0x12')]['menu']=function(_0x387a20){logger[_0x5ed9('0x2c')](util['format'](_0x5ed9('0x160'),_0x387a20[_0x5ed9('0x34')]));if(_0x387a20[_0x5ed9('0xa5')]===0x0){return this[_0x5ed9('0xa6')](_0x387a20);}_0x387a20[_0x5ed9('0xa5')]-=0x1;if(!this[_0x5ed9('0x85')](_0x387a20[_0x5ed9('0x10d')])){return this['channel'][_0x5ed9('0x2a')](_0x387a20,_0x5ed9('0x10e'));}var _0x32c2d3=this[_0x5ed9('0x10f')][_0x5ed9('0x70')](this,_0x387a20['file_id']);if(!_0x32c2d3){return this[_0x5ed9('0x33')][_0x5ed9('0x2a')](_0x387a20,'no\x20file\x20audio\x20found');}var _0x180e50=this[_0x5ed9('0x33')][_0x5ed9('0x111')](_0x32c2d3,_0x387a20['response'],_0x387a20[_0x5ed9('0x161')]);var _0x2cebad=_0x180e50['result'];if(_0x180e50[_0x5ed9('0xa4')]===-0x1){this[_0x5ed9('0x32')][_0x5ed9('0x70')](this,_0x387a20,'-1');return _0x180e50;}else if(_0x180e50[_0x5ed9('0xa2')]===_0x5ed9('0x64')){_0x180e50[_0x5ed9('0xa4')]=_0x180e50[_0x5ed9('0xa4')]['length']>0x0?_0x180e50['result']:'t';}else if(_[_0x5ed9('0x45')](_0x180e50['result'])){_0x180e50[_0x5ed9('0xa4')]='#';_0x2cebad='#';}if(!this['isConfigured'](_0x387a20['variable_id'])){this[_0x5ed9('0x33')]['noop']('no\x20variable\x20selected\x20for\x20the\x20result');}else{var _0x78f076=this[_0x5ed9('0x13')]['sync'](this,_0x387a20[_0x5ed9('0xd6')]);if(!_0x78f076){return this['channel'][_0x5ed9('0x2a')](_0x387a20,_0x5ed9('0xd7'));}this[_0x5ed9('0x33')][_0x5ed9('0x9e')](_0x78f076,_0x2cebad);}this['createSquareDetailsReport'][_0x5ed9('0x70')](this,_0x387a20,_0x2cebad);return _0x180e50;};AGIVertices['prototype'][_0x5ed9('0xa9')]=function(_0x1458ec){logger[_0x5ed9('0x2c')](util[_0x5ed9('0x27')](_0x5ed9('0x162'),_0x1458ec['label']));return this['channel'][_0x5ed9('0xa9')](_0x1458ec[_0x5ed9('0x163')]||_0x1458ec[_0x5ed9('0x34')]);};AGIVertices[_0x5ed9('0x12')][_0x5ed9('0x164')]=function(_0x50d41e){logger[_0x5ed9('0x2c')](util[_0x5ed9('0x27')](_0x5ed9('0x165'),_0x50d41e['label']));if(!this[_0x5ed9('0x85')](_0x50d41e[_0x5ed9('0x152')])){return this[_0x5ed9('0x33')][_0x5ed9('0x2a')](_0x50d41e,_0x5ed9('0x153'));}logger[_0x5ed9('0x2c')](util[_0x5ed9('0x27')](_0x5ed9('0x154'),this[_0x5ed9('0x33')][_0x5ed9('0x36')],_0x50d41e[_0x5ed9('0x152')]));var _0x17a0ea=this[_0x5ed9('0x4e')][_0x5ed9('0x70')](this,_0x50d41e[_0x5ed9('0x166')]);var _0x284d87=this[_0x5ed9('0x167')]['sync'](this,_0x50d41e[_0x5ed9('0x152')],_0x17a0ea);if(_0x284d87){logger['info'](util[_0x5ed9('0x27')](_0x5ed9('0x155'),this[_0x5ed9('0x33')][_0x5ed9('0x36')],_0x50d41e[_0x5ed9('0x152')]));this['channel'][_0x5ed9('0xa9')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0x5ed9('0x33')][_0x5ed9('0x36')],_0x50d41e[_0x5ed9('0x152')]));return{'code':0xc8,'result':'success'};}else{logger[_0x5ed9('0x2c')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x5ed9('0x33')][_0x5ed9('0x36')],_0x50d41e[_0x5ed9('0x152')]));this[_0x5ed9('0x33')][_0x5ed9('0xa9')](util[_0x5ed9('0x27')](_0x5ed9('0x155'),this[_0x5ed9('0x33')][_0x5ed9('0x36')],_0x50d41e['findBy']));return{'code':0xc8,'result':_0x5ed9('0x158')};}};AGIVertices[_0x5ed9('0x12')][_0x5ed9('0x168')]=function(_0x4c504c){logger['info'](util[_0x5ed9('0x27')](_0x5ed9('0x169'),_0x4c504c[_0x5ed9('0x34')]));if(!this['isConfigured'](_0x4c504c['file_id'])){return this['channel']['error'](_0x4c504c,_0x5ed9('0x10e'));}var _0x38c90c=this[_0x5ed9('0x10f')]['sync'](this,_0x4c504c[_0x5ed9('0x10d')]);if(!_0x38c90c){return this['channel'][_0x5ed9('0x2a')](_0x4c504c,'no\x20file\x20audio\x20found');}var _0xa420e3=this['channel'][_0x5ed9('0x56')](_0x5ed9('0x16a'),[_0x38c90c,_0x4c504c['opts']]);if(_0xa420e3[_0x5ed9('0xa4')]===-0x1){return _0xa420e3;}return this[_0x5ed9('0x33')][_0x5ed9('0xa9')](util[_0x5ed9('0x27')]('Executed\x20command\x20%s\x20%s','PLAYBACK',_0x38c90c));};AGIVertices[_0x5ed9('0x12')]['queue']=function(_0xfc8e0e){logger['info'](util[_0x5ed9('0x27')]('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0xfc8e0e[_0x5ed9('0x34')]));if(!this[_0x5ed9('0x85')](_0xfc8e0e[_0x5ed9('0x16b')])){return this['channel']['error'](_0xfc8e0e,_0x5ed9('0x16c'));}var _0xddabbd='';var _0x2e0823=parseInt(_0xfc8e0e[_0x5ed9('0x16b')],0xa);if(isNaN(_0x2e0823)){_0xddabbd=_0xfc8e0e[_0x5ed9('0x16b')];}else{_0xddabbd=this[_0x5ed9('0x16d')][_0x5ed9('0x70')](this,_0xfc8e0e[_0x5ed9('0x16b')]);if(!_0xddabbd){return this[_0x5ed9('0x33')]['error'](_0xfc8e0e,'no\x20queue\x20found');}}var _0x5980d0='';if(this['isConfigured'](_0xfc8e0e['file_id'])){var _0x57a7e3=this[_0x5ed9('0x10f')][_0x5ed9('0x70')](this,_0xfc8e0e[_0x5ed9('0x10d')]);if(_0x57a7e3){_0x5980d0=_0x57a7e3;}}this[_0x5ed9('0x32')][_0x5ed9('0x70')](this,_0xfc8e0e,_0xddabbd);if(_0xfc8e0e[_0x5ed9('0xe3')][_0x5ed9('0x16e')]('x')<0x0){_0xfc8e0e[_0x5ed9('0xe3')]+='x';}if(_0xfc8e0e['opts'][_0x5ed9('0x16e')]('X')<0x0){_0xfc8e0e[_0x5ed9('0xe3')]+='X';}this[_0x5ed9('0x33')][_0x5ed9('0x9e')](_0x5ed9('0x16f'),_0xddabbd?_0xddabbd[_0x5ed9('0x170')]():'');var _0x54e3a9=this['channel'][_0x5ed9('0x56')](_0x5ed9('0x171'),[_0xddabbd,_0xfc8e0e['opts'],_0xfc8e0e[_0x5ed9('0x72')],_0x5980d0,_0xfc8e0e['timeout'],_0xfc8e0e[_0x5ed9('0x9')],_0xfc8e0e[_0x5ed9('0x172')],_0xfc8e0e[_0x5ed9('0x173')],'',_0xfc8e0e[_0x5ed9('0x174')]]);if(_0x54e3a9[_0x5ed9('0xa4')]===-0x1){return _0x54e3a9;}return this[_0x5ed9('0x33')][_0x5ed9('0xa9')](util[_0x5ed9('0x27')](_0x5ed9('0x175'),_0x5ed9('0x171'),_0xddabbd));};AGIVertices[_0x5ed9('0x12')][_0x5ed9('0x176')]=function(_0x28f044){logger[_0x5ed9('0x2c')](util[_0x5ed9('0x27')](_0x5ed9('0x177'),_0x28f044[_0x5ed9('0x34')]));var _0x1b7a87=_0x28f044['recordingFormat']||'wav';var _0x33abf2=util[_0x5ed9('0x27')]('%s_%s',this['channel']['uniqueid'],rs[_0x5ed9('0x116')](0x5));var _0xf8a790=util[_0x5ed9('0x27')](_0x5ed9('0x178'),FILES_PATH,_0x33abf2,_0x1b7a87);var _0x1bc5d7=util['format']('%s/recordings/%s',FILES_PATH,_0x33abf2);this['createSquareRecording'][_0x5ed9('0x70')](this,_0x28f044,_0x33abf2,_0xf8a790);this[_0x5ed9('0x33')][_0x5ed9('0x9e')](_0x5ed9('0x179'),_0x33abf2);logger[_0x5ed9('0x2c')](_0x5ed9('0x17a'),_0x1bc5d7,_0x1b7a87,_0x28f044[_0x5ed9('0x17b')],_0x28f044['timeout']);return this[_0x5ed9('0x33')][_0x5ed9('0x12d')](_0x1bc5d7,_0x1b7a87,_0x28f044[_0x5ed9('0x17b')],_0x28f044[_0x5ed9('0x64')],undefined,!![]);};AGIVertices[_0x5ed9('0x12')]['restapi']=function(_0x27a703){logger['info'](util[_0x5ed9('0x27')](_0x5ed9('0x17c'),_0x27a703['label']));if(!this[_0x5ed9('0x85')](_0x27a703['url'])){return this[_0x5ed9('0x33')]['noop'](_0x5ed9('0x17d'));}var _0x5596e5=this['restAPI'][_0x5ed9('0x70')](this,_0x27a703);logger[_0x5ed9('0x2c')](util[_0x5ed9('0x27')](_0x5ed9('0x17e'),util[_0x5ed9('0x17f')](_0x5596e5,{'showHidden':![],'depth':null})));if(!this[_0x5ed9('0x85')](_0x27a703[_0x5ed9('0xd6')])){return this[_0x5ed9('0x33')][_0x5ed9('0xa9')](_0x5ed9('0x180'));}var _0x48434a=this[_0x5ed9('0x13')]['sync'](this,_0x27a703[_0x5ed9('0xd6')]);if(!_0x48434a){return this[_0x5ed9('0x33')][_0x5ed9('0x2a')](_0x27a703,_0x5ed9('0xd7'));}this[_0x5ed9('0x33')][_0x5ed9('0x9e')](util['format']('%s_STATUS_CODE',_0x48434a),_0x5596e5[_0x5ed9('0x74')]?_0x5596e5['statusCode']:_0x5ed9('0x181'));this[_0x5ed9('0x33')]['setVariable'](util[_0x5ed9('0x27')](_0x5ed9('0x182'),_0x48434a),_0x5596e5['statusMessage']?_0x5596e5[_0x5ed9('0x75')]:'OK');if(_0x5596e5[_0x5ed9('0x6a')]){try{this['saveRestApiResult'](_0x5596e5['body'],_0x48434a);}catch(_0x413e07){logger['error'](util[_0x5ed9('0x27')](_0x5ed9('0x183'),_0x48434a));}}return this[_0x5ed9('0x33')][_0x5ed9('0xa9')](util['format']('variable\x20%s\x20set',_0x48434a));};AGIVertices[_0x5ed9('0x12')][_0x5ed9('0x184')]=function(_0xc10fce){logger['info'](util[_0x5ed9('0x27')](_0x5ed9('0x185'),_0xc10fce[_0x5ed9('0x34')]));return this[_0x5ed9('0x33')]['sayDigits'](_0xc10fce[_0x5ed9('0x186')]['replace'](/\s+/g,''),_0xc10fce['escape_digits']);};AGIVertices['prototype']['saynumber']=function(_0x3f219f){logger[_0x5ed9('0x2c')](util['format'](_0x5ed9('0x187'),_0x3f219f[_0x5ed9('0x34')]));return this[_0x5ed9('0x33')]['sayNumber'](_0x3f219f[_0x5ed9('0x65')]['replace'](/\s+/g,''),_0x3f219f[_0x5ed9('0x17b')]);};AGIVertices[_0x5ed9('0x12')][_0x5ed9('0x188')]=function(_0xfa8f32){logger['info'](util[_0x5ed9('0x27')](_0x5ed9('0x189'),_0xfa8f32[_0x5ed9('0x34')]));return this['channel']['sayPhonetic'](_0xfa8f32['text'],_0xfa8f32[_0x5ed9('0x17b')]);};AGIVertices[_0x5ed9('0x12')][_0x5ed9('0x18a')]=function(_0x2cbcd9){logger[_0x5ed9('0x2c')](util[_0x5ed9('0x27')](_0x5ed9('0x18b'),_0x2cbcd9[_0x5ed9('0x34')]));if(!this[_0x5ed9('0x85')](_0x2cbcd9[_0x5ed9('0x18c')])){return this[_0x5ed9('0x33')][_0x5ed9('0xa9')](_0x5ed9('0x18d'));}var _0x5d5ca2=this[_0x5ed9('0x20')]['sync'](this,_0x2cbcd9[_0x5ed9('0x18c')]);if(!_0x5d5ca2||!_0x5d5ca2[_0x5ed9('0x18e')]){return this[_0x5ed9('0x33')]['error'](_0x2cbcd9,_0x5ed9('0x18f'));}var _0x19647b={'from':util[_0x5ed9('0x27')]('\x22%s\x22\x20<%s>',_0x5d5ca2[_0x5ed9('0x1b')],_0x5d5ca2[_0x5ed9('0x190')]||_0x5d5ca2['Smtp'][_0x5ed9('0x191')]),'to':_0x2cbcd9['to']||'','cc':_0x2cbcd9['cc']||'','bcc':_0x2cbcd9['bcc']||'','subject':_0x2cbcd9[_0x5ed9('0x192')],'html':_0x2cbcd9[_0x5ed9('0x5b')],'text':_0x2cbcd9[_0x5ed9('0x5b')]};if(this[_0x5ed9('0x85')](_0x2cbcd9['template_id'])){}logger[_0x5ed9('0xdd')]('sendMail\x20message',JSON[_0x5ed9('0x73')](_0x19647b));this['createSquareDetailsReport'][_0x5ed9('0x70')](this,_0x2cbcd9,_0x2cbcd9['account_id']);this[_0x5ed9('0x33')][_0x5ed9('0xa9')](util[_0x5ed9('0x27')](_0x5ed9('0x193'),_0x5d5ca2[_0x5ed9('0x1b')]));this[_0x5ed9('0x22')][_0x5ed9('0x70')](this,_0x5d5ca2[_0x5ed9('0x194')],_0x19647b);return this['channel'][_0x5ed9('0xa9')]('Mail\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0x5ed9('0x12')][_0x5ed9('0x195')]=function(_0x162437){logger[_0x5ed9('0x2c')](util[_0x5ed9('0x27')](_0x5ed9('0x196'),_0x162437[_0x5ed9('0x34')]));return this['channel'][_0x5ed9('0xa9')](_0x5ed9('0x197'));};AGIVertices['prototype'][_0x5ed9('0x198')]=function(_0x3e5a70){logger['info'](util['format'](_0x5ed9('0x199'),_0x3e5a70[_0x5ed9('0x34')]));if(!this[_0x5ed9('0x85')](_0x3e5a70[_0x5ed9('0x19a')])){return this[_0x5ed9('0x33')][_0x5ed9('0xa9')](_0x5ed9('0x19b'));}var _0x12eaad=this['getSmsAccount'][_0x5ed9('0x70')](this,_0x3e5a70['sms_account_id']);if(!_0x12eaad){return this[_0x5ed9('0x33')][_0x5ed9('0x2a')](_0x3e5a70,_0x5ed9('0x19c'));}var _0x5766a3={'body':_0x3e5a70[_0x5ed9('0x19d')],'phone':_0x3e5a70['to']||'','SmsAccountId':_0x12eaad['id']};logger[_0x5ed9('0xdd')]('sendSMS\x20message',JSON[_0x5ed9('0x73')](_0x5766a3));this['createSquareDetailsReport']['sync'](this,_0x3e5a70,_0x3e5a70['sms_account_id']);this[_0x5ed9('0x33')][_0x5ed9('0xa9')](util[_0x5ed9('0x27')]('Trying\x20SendSMS\x20with\x20account\x20%s',_0x12eaad[_0x5ed9('0x1b')]));this['createSmsMessage']['sync'](this,_0x5766a3);return this[_0x5ed9('0x33')][_0x5ed9('0xa9')](_0x5ed9('0x19e'));};AGIVertices[_0x5ed9('0x12')][_0x5ed9('0x19f')]=function(_0x54f2ae){logger['info'](util[_0x5ed9('0x27')]('Enter\x20in\x20SET\x20(%s)\x20block',_0x54f2ae[_0x5ed9('0x34')]));if(!this[_0x5ed9('0x85')](_0x54f2ae['variable_id'])){return this[_0x5ed9('0x33')][_0x5ed9('0x2a')](_0x54f2ae,'no\x20variable\x20selected');}var _0x6c58c8=this[_0x5ed9('0x13')][_0x5ed9('0x70')](this,_0x54f2ae[_0x5ed9('0xd6')]);if(!_0x6c58c8){return this[_0x5ed9('0x33')]['error'](_0x54f2ae,_0x5ed9('0xd7'));}return this[_0x5ed9('0x33')]['setVariable'](_0x6c58c8,_0x54f2ae[_0x5ed9('0x1a0')]);};AGIVertices[_0x5ed9('0x12')]['start']=function(_0x1d29a4){logger[_0x5ed9('0x2c')](util[_0x5ed9('0x27')](_0x5ed9('0x1a1'),_0x1d29a4['label']));this['channel'][_0x5ed9('0xa9')](_0x5ed9('0x1a2'));var _0xc32db9=this['channel'][_0x5ed9('0x13')](_0x5ed9('0x1a3'));if(!_[_0x5ed9('0x45')](_0xc32db9[_0x5ed9('0xa2')])){this[_0x5ed9('0x33')][_0x5ed9('0x38')]=_0xc32db9[_0x5ed9('0xa2')];}if(_0x1d29a4[_0x5ed9('0xb7')]===_0x5ed9('0x1a4')){this['channel'][_0x5ed9('0xa9')](_0x5ed9('0x1a5'));return this['channel'][_0x5ed9('0xb7')]();}return this[_0x5ed9('0x33')][_0x5ed9('0xa9')](_0x5ed9('0x1a6'));};AGIVertices[_0x5ed9('0x12')]['subproject']=function(_0x4f3631){logger[_0x5ed9('0x2c')](util[_0x5ed9('0x27')]('Enter\x20in\x20SUBPROJECT\x20(%s)\x20block',_0x4f3631['label']));if(!this[_0x5ed9('0x85')](_0x4f3631['project_id'])){return this[_0x5ed9('0x33')][_0x5ed9('0x2a')](_0x4f3631,_0x5ed9('0x1a7'));}var _0x2993e8=this[_0x5ed9('0x1a8')][_0x5ed9('0x70')](this,_0x4f3631[_0x5ed9('0x1a9')]);if(!this['isConfigured'](_0x2993e8)){return this[_0x5ed9('0x33')][_0x5ed9('0x2a')](_0x4f3631,util[_0x5ed9('0x27')](_0x5ed9('0x1aa'),_0x4f3631[_0x5ed9('0x1a9')]));}if(_0x2993e8===this['channel'][_0x5ed9('0x35')]){return this[_0x5ed9('0x33')]['error'](_0x4f3631,_0x5ed9('0x1ab'));}this['createSquareDetailsReport'][_0x5ed9('0x70')](this,_0x4f3631,_0x2993e8);var _0x51e879=this[_0x5ed9('0x33')][_0x5ed9('0x56')](_0x5ed9('0x1ac'),util[_0x5ed9('0x27')](_0x5ed9('0x1ad'),config[_0x5ed9('0x9')][_0x5ed9('0x1ae')]||_0x5ed9('0x1af'),_0x2993e8,this[_0x5ed9('0x33')][_0x5ed9('0x35')]));if(_0x51e879[_0x5ed9('0xa4')]===-0x1){return _0x51e879;}return this[_0x5ed9('0x33')][_0x5ed9('0xa9')](util[_0x5ed9('0x27')]('Executed\x20command\x20%s\x20%s',_0x5ed9('0x1ac'),_0x2993e8));};AGIVertices[_0x5ed9('0x12')][_0x5ed9('0x1b0')]=function(_0x1cc206){logger[_0x5ed9('0x2c')](util[_0x5ed9('0x27')]('Enter\x20in\x20SYSTEM\x20(%s)\x20block',_0x1cc206['label']));var _0x30d98f=this[_0x5ed9('0x55')][_0x5ed9('0x70')](this,_0x1cc206[_0x5ed9('0xb5')]);this[_0x5ed9('0x32')][_0x5ed9('0x70')](this,_0x1cc206,_0x1cc206[_0x5ed9('0xb5')]);if(this[_0x5ed9('0x85')](_0x1cc206[_0x5ed9('0xd6')])){var _0x2ce58f=this[_0x5ed9('0x13')][_0x5ed9('0x70')](this,_0x1cc206['variable_id']);if(_0x2ce58f){this[_0x5ed9('0x33')][_0x5ed9('0x9e')](_0x2ce58f,_0x30d98f);return this[_0x5ed9('0x33')][_0x5ed9('0xa9')](util[_0x5ed9('0x27')](_0x5ed9('0x1b1'),_0x1cc206[_0x5ed9('0xb5')],_0x2ce58f));}}return this[_0x5ed9('0x33')][_0x5ed9('0xa9')](util[_0x5ed9('0x27')](_0x5ed9('0x1b2'),_0x1cc206[_0x5ed9('0xb5')]));};AGIVertices['prototype'][_0x5ed9('0x1b3')]=function(_0x2ed555){logger[_0x5ed9('0x2c')](util[_0x5ed9('0x27')](_0x5ed9('0x1b4'),_0x2ed555['label']));_0x2ed555[_0x5ed9('0x5b')]=_0x2ed555[_0x5ed9('0x5b')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x5ed9('0x85')](_0x2ed555['apiKey'])){return this[_0x5ed9('0x33')][_0x5ed9('0xa9')](_0x5ed9('0x1b5'));}if(!this['isConfigured'](_0x2ed555['text'])){return this[_0x5ed9('0x33')][_0x5ed9('0xa9')](_0x5ed9('0xaa'));}this[_0x5ed9('0x33')][_0x5ed9('0xa9')](util[_0x5ed9('0x27')]('Trying\x20Google\x20Cloud\x20TTS\x20%s',_0x2ed555[_0x5ed9('0x5b')]));var _0x54dd80=this[_0x5ed9('0x58')][_0x5ed9('0x70')](this,_0x2ed555);if(_0x54dd80){this[_0x5ed9('0x33')][_0x5ed9('0xa9')](util[_0x5ed9('0x27')](_0x5ed9('0x1b6'),_0x54dd80));var _0x3f7bbc=this[_0x5ed9('0x33')][_0x5ed9('0x11f')](_0x54dd80);try{fs[_0x5ed9('0x100')](_0x54dd80+'.wav');}catch(_0x17e409){logger[_0x5ed9('0x2a')](_0x17e409);}return _0x3f7bbc;}return this[_0x5ed9('0x33')][_0x5ed9('0x2a')](_0x2ed555,_0x5ed9('0x1b7'));};AGIVertices[_0x5ed9('0x12')][_0x5ed9('0x1b8')]=function(_0x4ad5df){logger['info'](util[_0x5ed9('0x27')](_0x5ed9('0x1b9'),_0x4ad5df[_0x5ed9('0x34')]));_0x4ad5df[_0x5ed9('0x5b')]=_0x4ad5df[_0x5ed9('0x5b')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x5ed9('0x85')](_0x4ad5df[_0x5ed9('0x5b')])){return this[_0x5ed9('0x33')][_0x5ed9('0xa9')]('no\x20text\x20configured');}this[_0x5ed9('0x33')][_0x5ed9('0xa9')](util['format']('Trying\x20Google\x20TTS\x20%s',_0x4ad5df['text']));var _0x1d1204=this['googleTTS'][_0x5ed9('0x70')](this,_0x4ad5df);if(_0x1d1204){this['channel']['noop'](util[_0x5ed9('0x27')](_0x5ed9('0x1ba'),_0x1d1204));var _0x567dcb=this['channel'][_0x5ed9('0x11f')](_0x1d1204);try{fs['unlink'](_0x1d1204+'.wav');}catch(_0x4dccb5){logger['error'](_0x4dccb5);}return _0x567dcb;}return this[_0x5ed9('0x33')][_0x5ed9('0x2a')](_0x4ad5df,'Google\x20TTS\x20is\x20unreachable');};AGIVertices[_0x5ed9('0x12')][_0x5ed9('0x1bb')]=function(_0x11d626){logger[_0x5ed9('0x2c')](util[_0x5ed9('0x27')]('Enter\x20in\x20UNPAUSE\x20(%s)\x20block',_0x11d626[_0x5ed9('0x34')]));if(!this['isConfigured'](_0x11d626[_0x5ed9('0x152')])){return this[_0x5ed9('0x33')][_0x5ed9('0x2a')](_0x11d626,_0x5ed9('0x153'));}logger[_0x5ed9('0x2c')](util[_0x5ed9('0x27')](_0x5ed9('0x154'),this[_0x5ed9('0x33')]['callerid'],_0x11d626[_0x5ed9('0x152')]));var _0x33da83=this[_0x5ed9('0x50')][_0x5ed9('0x70')](this,_0x11d626[_0x5ed9('0x152')]);if(_0x33da83){logger[_0x5ed9('0x2c')](util[_0x5ed9('0x27')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x5ed9('0x33')][_0x5ed9('0x36')],_0x11d626[_0x5ed9('0x152')]));this['channel']['noop'](util[_0x5ed9('0x27')](_0x5ed9('0x155'),this[_0x5ed9('0x33')]['callerid'],_0x11d626[_0x5ed9('0x152')]));return{'code':0xc8,'result':'success'};}else{logger[_0x5ed9('0x2c')](util[_0x5ed9('0x27')](_0x5ed9('0x157'),this[_0x5ed9('0x33')]['callerid'],_0x11d626['findBy']));this['channel'][_0x5ed9('0xa9')](util[_0x5ed9('0x27')](_0x5ed9('0x157'),this[_0x5ed9('0x33')][_0x5ed9('0x36')],_0x11d626[_0x5ed9('0x152')]));return{'code':0xc8,'result':_0x5ed9('0x158')};}};AGIVertices[_0x5ed9('0x12')]['voicemail']=function(_0x162790){logger[_0x5ed9('0x2c')](util[_0x5ed9('0x27')]('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0x162790[_0x5ed9('0x34')]));var _0xb01a74=this[_0x5ed9('0x33')][_0x5ed9('0x56')]('VOICEMAIL',[_0x162790['mailbox'],_0x162790[_0x5ed9('0x77')]]);if(_0xb01a74[_0x5ed9('0xa4')]===-0x1){return _0xb01a74;}return this[_0x5ed9('0x33')][_0x5ed9('0xa9')](util[_0x5ed9('0x27')]('Executed\x20command\x20%s\x20%s',_0x5ed9('0x1bc'),_0x162790[_0x5ed9('0x1bd')]));};AGIVertices[_0x5ed9('0x12')][_0x5ed9('0x1be')]=function(_0x43d948){logger[_0x5ed9('0x2c')](util[_0x5ed9('0x27')](_0x5ed9('0x1bf'),_0x43d948[_0x5ed9('0x34')]));if(!this[_0x5ed9('0x85')](_0x43d948[_0x5ed9('0xd6')])){return this[_0x5ed9('0x33')]['error'](_0x43d948,_0x5ed9('0x1c0'));}var _0x5343fb=this['getVariable']['sync'](this,_0x43d948[_0x5ed9('0xd6')]);if(!_0x5343fb){return this[_0x5ed9('0x33')][_0x5ed9('0x2a')](_0x43d948,_0x5ed9('0xd7'));}var _0x32f6b3=this[_0x5ed9('0x33')]['getVariable'](_0x5343fb);return{'code':0xc8,'result':_0x32f6b3['extra']?_0x32f6b3[_0x5ed9('0xa2')]:'-'};};String[_0x5ed9('0x12')][_0x5ed9('0xa1')]=function(_0x1118e6,_0x54db1c){return this['split'](_0x1118e6)['join'](_0x54db1c);};module[_0x5ed9('0x1c1')]=AGIVertices; \ No newline at end of file +var _0x06f4=['replaceAllVariables','recursiveNodeIndex','isArray','length','isString','saveRestApiResult','hasOwnProperty','%s.%s','setVariable','split','replaceAll','extra','getAndSetVariable','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','retry','maxRetry','noop','no\x20text\x20configured','result','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','MRCPRecog','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','RECOG_INSTANCE()','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','command','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','Enter\x20in\x20CALLBACK\x20(%s)\x20block','list_id','no\x20list\x20selected','delay','add','minutes','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','phone','custom_app','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','MRCPSynth','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','RECOG_CONFIDENCE()','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','sestekasr','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20query\x20configured','replace','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','%s[%s][%s]','variable\x20%s\x20set','sip_id','no\x20user\x20found','SIP/%s','opts','Executed\x20command\x20%s','DIAL','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','speech','out','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','no\x20client_email\x20configured','private_key','no\x20anguage\x20configured','bot','Trying\x20DialogflowV2:\x20%s','providerResponse','DIALOGFLOW_%s','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','password','no\x20password\x20configured','ndassistant_url','SESTEK_NDA_%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','Enter\x20in\x20END\x20(%s)\x20block','end','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','SIP/%s/%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','no\x20file\x20audio\x20selected','getSound','file_id','no\x20file\x20audio\x20found','response','mindigit','maxdigit','hiddendigitsnum','hiddendigitspos','first','substr','generate','Enter\x20in\x20GETSECRETDIGITS\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\x20%s\x20file\x20created','unlink','aws_bot_name','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','%s/recordings/%s','beep','NOBEEP','recordFile','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','no\x20appsecret\x20configured','wav','intKey','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','extension','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','no\x20condition\x20configured','condition','true','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','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','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','no\x20find\x20by\x20configured','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','math\x20%s','%s[%s]','menu','Enter\x20in\x20MENU\x20(%s)\x20block','getData','digit','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','no\x20queue\x20selected','queue_id','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','%s_STATUS_MESSAGE','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','number','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','escape_digits','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20found','email','Smtp','user','subject','template_id','debug','Trying\x20SendMail\x20with\x20account\x20%s','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','sendSMS\x20message','Sms\x20message\x20added\x20to\x20outgoing\x20process','Enter\x20in\x20SET\x20(%s)\x20block','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','XMCS-UNIQUEID','yes','Answer','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','arg_1','AGI','host','127.0.0.1','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','no\x20variable\x20selected','join','exports','util','lodash','odbc','randomstring','request-promise','agi','../../config/environment','./scripts','/var/opt/motion2/server/files','rawBody','getdigits','getsecretdigits','mailRpc','getVariable','getVariableById','then','name','catch','prototype','getVoiceQueue','rpc','getVoiceQueueById','getSquareOdbc','dsn','getUser','getUserById','getTrunk','getSoundById','getSoundPath','save_name','getMailAccount','sendMailMessage','getIntervals','getIntervalById','IntervalId','interval','map','Intervals','format','%s/sounds/converted/%s','getQueryOdbc','open','error','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','channel','uniqueid','label','agicommand','callerid','createSquareRecording','calleridname','context','priority','accountcode','file','createSquareMessage','createCmContact','isEmpty','callback_','random','lastName','isNil','scheduledAt','callback','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogout','internal','%s/%s@from-sip/n','LOCAL','agentLogin','shellCommand','exec','trim','googleCloudTTS','apiKey','text','en-US','ssmlGender','audioEncoding','googleTTS','google_tts_language','restAPI','url','timeout','includes','POST','PUT','method','toUpperCase','body','headers','rawHeaders','parse','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','sestekNDA','ispeechTTS','ispeech_tts_language','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_secret_access_key','aws_polly_region','aws_polly_voice','Amy','aws_text_type','awsLex','aws_access_key_id','aws_lex_region','googleASR','google_asr_language','tildeASR','appid','appsecret','clear','clone','replaceObjectAllVariables'];(function(_0x48fcee,_0x431a8b){var _0x28d65a=function(_0x28b4ad){while(--_0x28b4ad){_0x48fcee['push'](_0x48fcee['shift']());}};_0x28d65a(++_0x431a8b);}(_0x06f4,0x136));var _0x406f=function(_0x257e1c,_0x1e8d1a){_0x257e1c=_0x257e1c-0x0;var _0x3580e1=_0x06f4[_0x257e1c];return _0x3580e1;};'use strict';var fs=require('fs');var util=require(_0x406f('0x0'));var _=require(_0x406f('0x1'));var sh=require('shelljs');var odbc=require(_0x406f('0x2'))();var rs=require(_0x406f('0x3'));var moment=require('moment');var Mustache=require('mustache');var rp=require(_0x406f('0x4'));var logger=require('../../config/logger')(_0x406f('0x5'));var config=require(_0x406f('0x6'));var scripts=require(_0x406f('0x7'));var FILES_PATH=_0x406f('0x8');var recursiveMapAttributes=['rawHeaders',_0x406f('0x9')];var verticesWithRetry=['menu',_0x406f('0xa'),_0x406f('0xb')];var AGIVertices=function(_0xc2f682,_0x54eb68,_0x407936){this['channel']=_0xc2f682;this['rpc']=_0x54eb68;this[_0x406f('0xc')]=_0x407936;};AGIVertices['prototype'][_0x406f('0xd')]=function(_0x4e0e96,_0x18eb6f){this['rpc'][_0x406f('0xe')](_0x4e0e96)[_0x406f('0xf')](function(_0x506f9f){_0x18eb6f(null,_0x506f9f?_0x506f9f[_0x406f('0x10')]:![]);})[_0x406f('0x11')](function(_0x451592){_0x18eb6f(_0x451592);});};AGIVertices[_0x406f('0x12')][_0x406f('0x13')]=function(_0x21c376,_0x29aef9){this[_0x406f('0x14')][_0x406f('0x15')](_0x21c376)[_0x406f('0xf')](function(_0x2a3f3e){_0x29aef9(null,_0x2a3f3e?_0x2a3f3e['name']:![]);})[_0x406f('0x11')](function(_0x28fda6){_0x29aef9(_0x28fda6);});};AGIVertices[_0x406f('0x12')]['getSquareProject']=function(_0x18ffbb,_0x14b838){this['rpc']['getSquareProjectById'](_0x18ffbb)[_0x406f('0xf')](function(_0x4357e3){_0x14b838(null,_0x4357e3?_0x4357e3['name']:![]);})[_0x406f('0x11')](function(_0x57d93a){_0x14b838(_0x57d93a);});};AGIVertices[_0x406f('0x12')][_0x406f('0x16')]=function(_0x1da473,_0x12bb0f){this['rpc']['getSquareOdbcById'](_0x1da473)[_0x406f('0xf')](function(_0x5476d2){_0x12bb0f(null,_0x5476d2?_0x5476d2[_0x406f('0x17')]:![]);})['catch'](function(_0x38254b){_0x12bb0f(_0x38254b);});};AGIVertices[_0x406f('0x12')][_0x406f('0x18')]=function(_0x5201fb,_0x58c0d3){this['rpc'][_0x406f('0x19')](_0x5201fb)[_0x406f('0xf')](function(_0x1e3b13){_0x58c0d3(null,_0x1e3b13?_0x1e3b13['name']:![]);})[_0x406f('0x11')](function(_0x5961cc){_0x58c0d3(_0x5961cc);});};AGIVertices[_0x406f('0x12')][_0x406f('0x1a')]=function(_0x3bc17d,_0x2d9aea){this[_0x406f('0x14')]['getTrunkById'](_0x3bc17d)['then'](function(_0x81589c){_0x2d9aea(null,_0x81589c?_0x81589c['name']:![]);})[_0x406f('0x11')](function(_0xa240d8){_0x2d9aea(_0xa240d8);});};AGIVertices['prototype']['getSound']=function(_0x1b837d,_0x484f7c){var _0x377cb9=this;this[_0x406f('0x14')][_0x406f('0x1b')](_0x1b837d)[_0x406f('0xf')](function(_0x2c439b){_0x484f7c(null,_0x2c439b?_0x377cb9[_0x406f('0x1c')](_0x2c439b[_0x406f('0x1d')]):![]);})[_0x406f('0x11')](function(_0x5ec2ed){_0x484f7c(_0x5ec2ed);});};AGIVertices['prototype'][_0x406f('0x1e')]=function(_0x1a4567,_0x1ae022){this[_0x406f('0x14')]['getMailAccountById'](_0x1a4567)['then'](function(_0x504ce9){_0x1ae022(null,_0x504ce9?_0x504ce9:![]);})[_0x406f('0x11')](function(_0x4fb304){_0x1ae022(_0x4fb304);});};AGIVertices['prototype'][_0x406f('0x1f')]=function(_0x378cc3,_0x2e42fa,_0x2b8a15){this[_0x406f('0xc')][_0x406f('0x1f')](_0x378cc3,_0x2e42fa)[_0x406f('0xf')](function(){_0x2b8a15(null);})[_0x406f('0x11')](function(_0x29360b){_0x2b8a15(_0x29360b);});};AGIVertices[_0x406f('0x12')][_0x406f('0x20')]=function(_0x449c79,_0x23efaa){this['rpc'][_0x406f('0x21')](_0x449c79)[_0x406f('0xf')](function(_0x13fb61){if(_0x13fb61){if(_0x13fb61[_0x406f('0x22')]){_0x23efaa(null,[_0x13fb61[_0x406f('0x23')]]);}else{_0x23efaa(null,_[_0x406f('0x24')](_0x13fb61[_0x406f('0x25')],_0x406f('0x23')));}}else{_0x23efaa(null,![]);}})[_0x406f('0x11')](function(_0x3fdc25){_0x23efaa(_0x3fdc25);});};AGIVertices['prototype'][_0x406f('0x1c')]=function(_0x1062ef){return util[_0x406f('0x26')](_0x406f('0x27'),FILES_PATH,_0x1062ef);};AGIVertices[_0x406f('0x12')][_0x406f('0x28')]=function(_0x58108b,_0x52f878,_0x44c63a){odbc[_0x406f('0x29')](_0x58108b,function(_0x5be3de){if(_0x5be3de){logger[_0x406f('0x2a')]('Error\x20getting\x20ODBC\x20connection\x20%s',_0x5be3de);_0x44c63a(_0x5be3de);}else{logger[_0x406f('0x2b')](_0x406f('0x2c'));odbc[_0x406f('0x2d')](_0x52f878,function(_0x5f2a29,_0x14ca94){if(_0x5f2a29){logger[_0x406f('0x2b')](_0x406f('0x2e'),_0x52f878);_0x44c63a(_0x5f2a29);}else{logger[_0x406f('0x2b')](_0x406f('0x2f'),_0x52f878);odbc[_0x406f('0x30')](function(_0x7bcff3){if(_0x7bcff3){logger[_0x406f('0x2a')](_0x406f('0x31'),_0x7bcff3);}_0x44c63a(null,_0x14ca94);});}});}});};AGIVertices[_0x406f('0x12')][_0x406f('0x32')]=function(_0x37c4d2,_0x279e9e){this[_0x406f('0x14')][_0x406f('0x33')](_0x37c4d2)['then'](function(_0x55c759){_0x279e9e(null,_0x55c759?_0x55c759:![]);})['catch'](function(_0x2f67c1){_0x279e9e(_0x2f67c1);});};AGIVertices[_0x406f('0x12')][_0x406f('0x34')]=function(_0x4aef8f,_0x172c5c){this[_0x406f('0x14')][_0x406f('0x34')](_0x4aef8f)[_0x406f('0xf')](function(_0x1c079a){_0x172c5c(null,_0x1c079a);})[_0x406f('0x11')](function(_0x4e28b4){_0x172c5c(_0x4e28b4);});};AGIVertices[_0x406f('0x12')][_0x406f('0x35')]=function(_0x494a8f,_0xe4a559,_0x53fb67){this['rpc'][_0x406f('0x35')]({'uniqueid':this[_0x406f('0x36')][_0x406f('0x37')],'node':_0x494a8f[_0x406f('0x38')],'application':_0x494a8f[_0x406f('0x39')],'data':_0xe4a559||null,'project_name':this[_0x406f('0x36')]['arg_1'],'callerid':this['channel'][_0x406f('0x3a')]})[_0x406f('0xf')](function(_0x45c0c6){if(_0x53fb67){_0x53fb67(null,_0x45c0c6);}})[_0x406f('0x11')](function(_0x453289){if(_0x53fb67){_0x53fb67(_0x453289);}});};AGIVertices[_0x406f('0x12')][_0x406f('0x3b')]=function(_0x508a38,_0x146056,_0xda1e26,_0x351044){this[_0x406f('0x14')][_0x406f('0x3b')]({'uniqueid':this[_0x406f('0x36')][_0x406f('0x37')],'callerid':this[_0x406f('0x36')][_0x406f('0x3a')],'calleridname':this[_0x406f('0x36')][_0x406f('0x3c')],'context':this['channel'][_0x406f('0x3d')],'extension':this[_0x406f('0x36')]['extension'],'priority':this['channel'][_0x406f('0x3e')],'accountcode':this[_0x406f('0x36')][_0x406f('0x3f')],'dnid':this[_0x406f('0x36')]['dnid'],'projectName':this[_0x406f('0x36')]['arg_1'],'saveName':_0x146056,'filename':_0x508a38[_0x406f('0x40')]||_0x146056,'savePath':_0xda1e26})[_0x406f('0xf')](function(_0x5b1143){_0x351044(null,_0x5b1143);})['catch'](function(_0x1bdb59){_0x351044(_0x1bdb59);});};AGIVertices[_0x406f('0x12')][_0x406f('0x41')]=function(_0x3e09b7,_0x56339a,_0x331485,_0x35619c,_0x8ef14b){this[_0x406f('0x14')]['createSquareMessage']({'uniqueid':this['channel'][_0x406f('0x37')],'body':_0x3e09b7,'direction':_0x56339a,'providerName':_0x331485,'providerResponse':_0x35619c})[_0x406f('0xf')](function(_0x8a17e0){if(_0x8ef14b){_0x8ef14b(null,_0x8a17e0);}})[_0x406f('0x11')](function(_0x2a9a61){if(_0x8ef14b){_0x8ef14b(_0x2a9a61);}});};AGIVertices['prototype'][_0x406f('0x42')]=function(_0x23026d,_0x4a5a01){this['rpc'][_0x406f('0x42')]({'firstName':_[_0x406f('0x43')](_0x23026d[_0x406f('0x10')])||_['isNil'](_0x23026d[_0x406f('0x10')])?_0x406f('0x44')+Math[_0x406f('0x45')]():_0x23026d[_0x406f('0x10')],'lastName':_[_0x406f('0x43')](_0x23026d[_0x406f('0x46')])||_[_0x406f('0x47')](_0x23026d[_0x406f('0x46')])?null:_0x23026d[_0x406f('0x46')],'phone':_0x23026d['phone'],'ListId':_0x23026d['list_id'],'scheduledat':_0x23026d[_0x406f('0x48')],'callbackUniqueid':this[_0x406f('0x36')][_0x406f('0x37')],'tags':_0x406f('0x49'),'description':_0x406f('0x4a')+_0x23026d[_0x406f('0x48')][_0x406f('0x4b')](),'priority':_0x23026d[_0x406f('0x4c')]})[_0x406f('0xf')](function(_0x1bd758){_0x4a5a01(null,_0x1bd758);})['catch'](function(_0x5ef690){_0x4a5a01(_0x5ef690);});};AGIVertices[_0x406f('0x12')][_0x406f('0x4d')]=function(_0x3039a4,_0x17a796){this[_0x406f('0x14')][_0x406f('0x4e')](_0x3039a4)['then'](function(_0x1faac1){_0x17a796(null,_0x1faac1?_0x1faac1[_0x406f('0x10')]:![]);})[_0x406f('0x11')](function(_0x6e2d0b){_0x17a796(_0x6e2d0b);});};AGIVertices[_0x406f('0x12')][_0x406f('0x4f')]=function(_0x14d61c,_0x10db69,_0x573265){var _0x319cdb={'role':'agent'};_0x319cdb[_0x14d61c]=this[_0x406f('0x36')][_0x406f('0x3a')];this[_0x406f('0x14')]['agentPause'](_0x319cdb,_0x10db69,this[_0x406f('0x36')]['uniqueid'])['then'](function(_0x299ff4){_0x573265(null,_[_0x406f('0x47')](_0x299ff4)?![]:!![]);})['catch'](function(_0x30e4eb){logger['error'](_0x30e4eb);_0x573265(null,![]);});};AGIVertices[_0x406f('0x12')]['agentUnpause']=function(_0x2c3881,_0x48bca4){var _0x313eed={'role':_0x406f('0x50')};_0x313eed[_0x2c3881]=this['channel']['callerid'];this[_0x406f('0x14')][_0x406f('0x51')](_0x313eed)[_0x406f('0xf')](function(_0x34254b){_0x48bca4(null,_['isNil'](_0x34254b)?![]:!![]);})[_0x406f('0x11')](function(_0x3a41d3){logger[_0x406f('0x2a')](_0x3a41d3);_0x48bca4(null,![]);});};AGIVertices[_0x406f('0x12')][_0x406f('0x52')]=function(_0x13302b,_0x36bd31){var _0x5c1a91={'role':_0x406f('0x50')};_0x5c1a91[_0x13302b]=this['channel'][_0x406f('0x3a')];this[_0x406f('0x14')][_0x406f('0x52')](_0x5c1a91)['then'](function(_0x3b2bff){_0x36bd31(null,_[_0x406f('0x47')](_0x3b2bff)?![]:!![]);})['catch'](function(_0x5b11ae){logger[_0x406f('0x2a')](_0x5b11ae);_0x36bd31(null,![]);});};AGIVertices[_0x406f('0x12')]['agentLogin']=function(_0x5d6604,_0x4c0597){var _0x1b3935={'role':_0x406f('0x50')};_0x1b3935[_0x5d6604]=this[_0x406f('0x36')]['callerid'];var _0x54a066=_0x5d6604!=_0x406f('0x53')?util[_0x406f('0x26')](_0x406f('0x54'),_0x406f('0x55'),this[_0x406f('0x36')]['callerid']):undefined;this[_0x406f('0x14')][_0x406f('0x56')](_0x1b3935,_0x54a066)[_0x406f('0xf')](function(_0x3ce218){_0x4c0597(null,_[_0x406f('0x47')](_0x3ce218)?![]:!![]);})[_0x406f('0x11')](function(_0x62f317){logger[_0x406f('0x2a')](_0x62f317);_0x4c0597(null,![]);});};AGIVertices[_0x406f('0x12')][_0x406f('0x57')]=function(_0x44ca9a,_0x387941){sh[_0x406f('0x58')](_[_0x406f('0x59')](_0x44ca9a),function(_0x1283f2,_0x230267){var _0x2cac38=_0x230267['replace'](/(\r\n|\n|\r)/gm,'');_0x387941(null,_0x2cac38);});};AGIVertices[_0x406f('0x12')][_0x406f('0x5a')]=function(_0x2c7971,_0x58a0d0){scripts[_0x406f('0x5a')](_0x2c7971[_0x406f('0x5b')],_0x2c7971['google_cloud_tts_text_type']||_0x406f('0x5c'),_0x2c7971['text'],_0x2c7971['languageCode']||_0x406f('0x5d'),_0x2c7971[_0x406f('0x5e')]||'MALE',_0x2c7971[_0x406f('0x5f')]||'MP3')[_0x406f('0xf')](function(_0x3b1baa){_0x58a0d0(null,_0x3b1baa);})[_0x406f('0x11')](function(_0x35657d){_0x58a0d0(_0x35657d);});};AGIVertices[_0x406f('0x12')][_0x406f('0x60')]=function(_0x2543a3,_0x103780){scripts[_0x406f('0x60')](_0x2543a3['text'],_0x2543a3[_0x406f('0x61')]||'en',0x1)['then'](function(_0x3356c4){_0x103780(null,_0x3356c4);})['catch'](function(_0x5b989a){_0x103780(_0x5b989a);});};AGIVertices['prototype'][_0x406f('0x62')]=function(_0x3f0e29,_0x2bb105){var _0x156fa5={'uri':_0x3f0e29[_0x406f('0x63')],'method':_0x3f0e29['method'],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x3f0e29['timeout'])==='number'&&parseInt(_0x3f0e29[_0x406f('0x64')])>=0x1?parseInt(_0x3f0e29['timeout'])*0x3e8:0x5*0x3e8};if(_[_0x406f('0x65')]([_0x406f('0x66'),_0x406f('0x67')],_0x156fa5[_0x406f('0x68')][_0x406f('0x69')]())){try{_0x156fa5[_0x406f('0x6a')]=_0x3f0e29['rawBody']?JSON['parse'](_0x3f0e29[_0x406f('0x9')]):{};}catch(_0x33a98b){logger[_0x406f('0x2a')]('An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function',_0x33a98b);}}try{_0x156fa5[_0x406f('0x6b')]=_0x3f0e29[_0x406f('0x6c')]?JSON[_0x406f('0x6d')](_0x3f0e29[_0x406f('0x6c')]):{};}catch(_0x8d2b9f){logger['error'](_0x406f('0x6e'),_0x8d2b9f);}if(_0x3f0e29[_0x406f('0x6f')]){try{var _0x67200a=require(_0x3f0e29[_0x406f('0x6f')])[_0x406f('0x70')](this,_0x156fa5);_0x156fa5[_0x406f('0x71')]=Mustache[_0x406f('0x72')](_0x3f0e29[_0x406f('0x63')],_0x67200a,{},['$$','$$']);if(_0x156fa5['headers']){_0x156fa5['headers']=JSON['parse'](Mustache[_0x406f('0x72')](JSON['stringify'](_0x156fa5['headers']),_0x67200a,{},['$$','$$']));}if(_0x156fa5[_0x406f('0x6a')]){_0x156fa5[_0x406f('0x6a')]=JSON[_0x406f('0x6d')](Mustache[_0x406f('0x72')](JSON[_0x406f('0x73')](_0x156fa5['body']),_0x67200a,{},['$$','$$']));}}catch(_0x58206a){logger[_0x406f('0x2a')](_0x406f('0x74'),_0x58206a);}}rp(_0x156fa5)['then'](function(_0x3acdf3){var _0x4fbc53={'statusCode':_0x3acdf3[_0x406f('0x75')]||0xc8,'statusMessage':_0x3acdf3[_0x406f('0x76')]||'OK','headers':_0x3acdf3['headers']||{},'body':_0x3acdf3[_0x406f('0x6a')]||{}};_0x2bb105(null,_0x4fbc53);})[_0x406f('0x11')](function(_0x4c200a){var _0x1168bc={'statusCode':_0x4c200a[_0x406f('0x75')]||0x1f4,'statusMessage':_0x4c200a[_0x406f('0x77')]||_0x406f('0x78'),'headers':_0x4c200a[_0x406f('0x79')][_0x406f('0x6b')]||{},'body':_0x4c200a[_0x406f('0x79')][_0x406f('0x6a')]||{}};_0x2bb105(null,_0x1168bc);});};AGIVertices['prototype'][_0x406f('0x7a')]=function(_0x16791a,_0x169662){scripts[_0x406f('0x7a')](this[_0x406f('0x36')][_0x406f('0x37')],_0x16791a[_0x406f('0x7b')],_0x16791a[_0x406f('0x5c')],_0x16791a[_0x406f('0x7c')]||'en')['then'](function(_0x37a270){_0x169662(null,_0x37a270);})[_0x406f('0x11')](function(_0x517840){_0x169662(_0x517840);});};AGIVertices[_0x406f('0x12')][_0x406f('0x7d')]=function(_0x39fe38,_0x42a297){scripts[_0x406f('0x7d')](this[_0x406f('0x36')]['uniqueid'],_0x39fe38[_0x406f('0x7e')],_0x39fe38[_0x406f('0x7f')],_0x39fe38['private_key'],_0x39fe38[_0x406f('0x5c')],_0x39fe38['dialogflowV2_language']||'en')[_0x406f('0xf')](function(_0x436d0d){_0x42a297(null,_0x436d0d);})[_0x406f('0x11')](function(_0x24f19f){_0x42a297(_0x24f19f);});};AGIVertices[_0x406f('0x12')][_0x406f('0x80')]=function(_0x16940e,_0x11638c){scripts['sestekNDA'](this[_0x406f('0x36')],_0x16940e)[_0x406f('0xf')](function(_0x58a1aa){_0x11638c(null,_0x58a1aa);})[_0x406f('0x11')](function(_0x4f21cf){_0x11638c(_0x4f21cf);});};AGIVertices[_0x406f('0x12')]['ispeechTTS']=function(_0x170a34,_0x27d9ed){scripts[_0x406f('0x81')](_0x170a34[_0x406f('0x7b')],_0x170a34['text'],_0x170a34[_0x406f('0x82')]||_0x406f('0x5d'),_0x170a34[_0x406f('0x83')])[_0x406f('0xf')](function(_0x3752f2){_0x27d9ed(null,_0x3752f2);})['catch'](function(_0x4a237b){_0x27d9ed(_0x4a237b);});};AGIVertices[_0x406f('0x12')][_0x406f('0x84')]=function(_0x53f10f,_0xf69a70,_0x14b1ea){scripts['ispeechASR'](_0xf69a70,_0x53f10f['key'],_0x53f10f[_0x406f('0x85')]||_0x406f('0x5d'),this[_0x406f('0x86')](_0x53f10f[_0x406f('0x87')])?_0x53f10f[_0x406f('0x87')]:undefined)[_0x406f('0xf')](function(_0x1b9890){_0x14b1ea(null,_0x1b9890);})['catch'](function(_0x13478a){_0x14b1ea(_0x13478a);});};AGIVertices[_0x406f('0x12')][_0x406f('0x88')]=function(_0x2ade04,_0x1bc3a4){scripts[_0x406f('0x88')](_0x2ade04['aws_access_key_id'],_0x2ade04[_0x406f('0x89')],_0x2ade04[_0x406f('0x8a')],_0x2ade04[_0x406f('0x8b')]||_0x406f('0x8c'),_0x2ade04[_0x406f('0x5c')],_0x2ade04[_0x406f('0x8d')]||_0x406f('0x5c'))[_0x406f('0xf')](function(_0x4a7792){_0x1bc3a4(null,_0x4a7792);})[_0x406f('0x11')](function(_0x1fbbba){_0x1bc3a4(_0x1fbbba);});};AGIVertices[_0x406f('0x12')][_0x406f('0x8e')]=function(_0x5708bd,_0x249e39){scripts['awsLex'](this['channel'][_0x406f('0x37')],_0x5708bd[_0x406f('0x8f')],_0x5708bd[_0x406f('0x89')],_0x5708bd[_0x406f('0x90')],_0x5708bd[_0x406f('0x5c')],_0x5708bd['aws_bot_name'])[_0x406f('0xf')](function(_0x5cc431){_0x249e39(null,_0x5cc431);})['catch'](function(_0x1023fc){_0x249e39(_0x1023fc);});};AGIVertices['prototype'][_0x406f('0x91')]=function(_0x169e25,_0x38dc34,_0x59f6a2){scripts['googleASR'](_0x38dc34,_0x169e25[_0x406f('0x7b')],_0x169e25[_0x406f('0x92')]||'en-US')[_0x406f('0xf')](function(_0x5e80f9){_0x59f6a2(null,_0x5e80f9);})['catch'](function(_0x206caa){_0x59f6a2(_0x206caa);});};AGIVertices['prototype'][_0x406f('0x93')]=function(_0x1be2dd,_0x35d17d,_0x708018){scripts[_0x406f('0x93')](_0x35d17d,_0x1be2dd[_0x406f('0x94')],_0x1be2dd[_0x406f('0x95')],_0x1be2dd[_0x406f('0x71')])[_0x406f('0xf')](function(_0x5acfca){_0x708018(null,_0x5acfca);})[_0x406f('0x11')](function(_0x133504){_0x708018(_0x133504);});};AGIVertices[_0x406f('0x12')][_0x406f('0x96')]=function(_0x43fa25){var _0x12f400=_[_0x406f('0x65')](verticesWithRetry,_0x43fa25[_0x406f('0x39')])?_0x43fa25:_[_0x406f('0x97')](_0x43fa25);for(var _0x2055c3 in _0x12f400){if(_0x12f400['hasOwnProperty'](_0x2055c3)){if(_0x12f400[_0x2055c3]&&_['isString'](_0x12f400[_0x2055c3])){if(_[_0x406f('0x65')](recursiveMapAttributes,_0x2055c3)){_0x12f400[_0x2055c3]=this[_0x406f('0x98')](_0x12f400[_0x2055c3]);}else{_0x12f400[_0x2055c3]=this[_0x406f('0x99')](_0x12f400[_0x2055c3]);}}}}return _0x12f400;};AGIVertices[_0x406f('0x12')][_0x406f('0x9a')]=function(_0x22d24d){for(var _0x1d5c2f in _0x22d24d){if(_0x22d24d['hasOwnProperty'](_0x1d5c2f)){if(_['isPlainObject'](_0x22d24d[_0x1d5c2f])){this['recursiveNodeIndex'](_0x22d24d[_0x1d5c2f]);}else if(_[_0x406f('0x9b')](_0x22d24d[_0x1d5c2f])){for(var _0x42c11e=0x0;_0x42c11e<_0x22d24d[_0x1d5c2f][_0x406f('0x9c')];_0x42c11e++){this[_0x406f('0x9a')](_0x22d24d[_0x1d5c2f][_0x42c11e]);}}else if(_[_0x406f('0x9d')](_0x22d24d[_0x1d5c2f])){_0x22d24d[_0x1d5c2f]=this[_0x406f('0x99')](_0x22d24d[_0x1d5c2f]);}}}};AGIVertices[_0x406f('0x12')][_0x406f('0x9e')]=function(_0x207413,_0x2a772d){for(var _0x698c04 in _0x207413){if(_0x207413[_0x406f('0x9f')](_0x698c04)){if(_['isPlainObject'](_0x207413[_0x698c04])){if(!_[_0x406f('0x43')](_0x207413[_0x698c04])){this['saveRestApiResult'](_0x207413[_0x698c04],util[_0x406f('0x26')]('%s.%s',_0x2a772d,_0x698c04));}}else if(_[_0x406f('0x9b')](_0x207413[_0x698c04])){for(var _0x45d0a8=0x0;_0x45d0a8<_0x207413[_0x698c04][_0x406f('0x9c')];_0x45d0a8++){this[_0x406f('0x9e')](_0x207413[_0x698c04][_0x45d0a8],util[_0x406f('0x26')](_0x406f('0xa0'),_0x2a772d,_0x698c04+'['+_0x45d0a8+']'));}}else{if(!_[_0x406f('0x47')](_0x207413[_0x698c04])){this['channel'][_0x406f('0xa1')](util[_0x406f('0x26')]('%s.%s',_0x2a772d,_0x698c04),_0x207413[_0x698c04]);}}}}};AGIVertices[_0x406f('0x12')][_0x406f('0x98')]=function(_0x3312bf){try{var _0x28c144=JSON['parse'](_0x3312bf);this[_0x406f('0x9a')](_0x28c144);return JSON[_0x406f('0x73')](_0x28c144);}catch(_0x3c0747){return this['replaceAllVariables'](_0x3312bf);}};AGIVertices[_0x406f('0x12')][_0x406f('0x99')]=function(_0x3c7062){var _0x145a41=_0x3c7062[_0x406f('0xa2')]('{');for(var _0x414614=0x1;_0x414614<_0x145a41[_0x406f('0x9c')];_0x414614+=0x1){var _0xc958c9=_0x145a41[_0x414614]['split']('}');if(_0xc958c9['length']>0x1){_0x3c7062=_0x3c7062[_0x406f('0xa3')]('{'+_0xc958c9[0x0]+'}',this[_0x406f('0x36')][_0x406f('0xd')](_0xc958c9[0x0])[_0x406f('0xa4')]||_0xc958c9[0x0]);}}if(_0x145a41['length']===0x1){return _0x3c7062[_0x406f('0x4b')]();}return this[_0x406f('0x99')](_0x3c7062);};AGIVertices[_0x406f('0x12')][_0x406f('0xa5')]=function(_0x320910,_0x198e04){var _0x18a154=this[_0x406f('0x36')][_0x406f('0xd')](_0x320910);if(_0x18a154['result']===-0x1){return _0x18a154;}logger[_0x406f('0x2b')](util[_0x406f('0x26')](_0x406f('0xa6'),_0x198e04,_0x18a154[_0x406f('0xa4')]));return this[_0x406f('0x36')][_0x406f('0xa1')](_0x198e04,_0x18a154[_0x406f('0xa4')]);};AGIVertices[_0x406f('0x12')][_0x406f('0x86')]=function(_0x5bc700){return _0x5bc700&&_0x5bc700!=='0'&&_0x5bc700!=='-1'&&_0x5bc700!=='';};AGIVertices[_0x406f('0x12')]['maxRetry']=function(_0x302696){this[_0x406f('0x35')][_0x406f('0x70')](this,_0x302696,'-');_0x302696[_0x406f('0xa7')]=_0x302696[_0x406f('0xa8')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x406f('0x12')]['mrcpsynth']=function(_0x6c05ee){logger[_0x406f('0x2b')](util[_0x406f('0x26')]('Enter\x20in\x20MRCPSynth\x20(%s)\x20block',_0x6c05ee[_0x406f('0x38')]));if(!this[_0x406f('0x86')](_0x6c05ee[_0x406f('0x5c')])){return this[_0x406f('0x36')][_0x406f('0xa9')](_0x406f('0xaa'));}var _0x460797='\x22'+_0x6c05ee[_0x406f('0x5c')]+'\x22';if(this[_0x406f('0x86')](_0x6c05ee[_0x406f('0x79')])){_0x460797+=','+_0x6c05ee[_0x406f('0x79')];}var _0xdf7793=this[_0x406f('0x36')]['exec']('MRCPSynth',_0x460797);if(_0xdf7793[_0x406f('0xab')]===-0x1){return _0xdf7793;}return this[_0x406f('0x36')][_0x406f('0xa9')](util[_0x406f('0x26')](_0x406f('0xac'),_0x460797));};AGIVertices['prototype'][_0x406f('0xad')]=function(_0x2fa198){logger['info'](util[_0x406f('0x26')](_0x406f('0xae'),_0x2fa198[_0x406f('0x38')]));if(!this[_0x406f('0x86')](_0x2fa198[_0x406f('0xaf')])){return this[_0x406f('0x36')]['noop'](_0x406f('0xb0'));}var _0x29b39e=_0x2fa198['grammar'];if(this[_0x406f('0x86')](_0x2fa198[_0x406f('0x79')])){_0x29b39e+=','+_0x2fa198[_0x406f('0x79')];}var _0x3aaa13=this[_0x406f('0x36')]['exec'](_0x406f('0xb1'),_0x29b39e);if(_0x3aaa13[_0x406f('0xab')]===-0x1){return _0x3aaa13;}var _0x3ca82b=this['getAndSetVariable']('RECOG_CONFIDENCE()',_0x406f('0xb2'));if(_0x3ca82b[_0x406f('0xab')]===-0x1){return _0x3ca82b;}var _0x146e51=this[_0x406f('0xa5')](_0x406f('0xb3'),'MRCP_RECOG_TRANSCRIPT');if(_0x146e51['result']===-0x1){return _0x146e51;}var _0x4bc335=this['getAndSetVariable'](_0x406f('0xb4'),'MRCP_RECOG_INSTANCE');if(_0x4bc335[_0x406f('0xab')]===-0x1){return _0x4bc335;}return this[_0x406f('0x36')][_0x406f('0xa9')](util['format'](_0x406f('0xb5'),_0x29b39e));};AGIVertices[_0x406f('0x12')][_0x406f('0x5')]=function(_0x5c9a82){logger[_0x406f('0x2b')](util[_0x406f('0x26')](_0x406f('0xb6'),_0x5c9a82['label']));return this[_0x406f('0x36')]['agi']([_0x5c9a82[_0x406f('0xb7')],_0x5c9a82['args']]);};AGIVertices[_0x406f('0x12')][_0x406f('0xb8')]=function(_0x2e4a43){logger[_0x406f('0x2b')](util[_0x406f('0x26')](_0x406f('0xb9'),_0x2e4a43[_0x406f('0x38')]));if(this[_0x406f('0x86')](_0x2e4a43[_0x406f('0x64')])){logger[_0x406f('0x2b')](util[_0x406f('0x26')](_0x406f('0xba'),_0x2e4a43[_0x406f('0x64')]));var _0x147817=this[_0x406f('0x36')]['wait'](_0x2e4a43['timeout']);if(_0x147817[_0x406f('0xab')]===-0x1){return _0x147817;}}return this[_0x406f('0x36')][_0x406f('0xb8')]();};AGIVertices[_0x406f('0x12')]['callback']=function(_0x8d5961){logger[_0x406f('0x2b')](util['format'](_0x406f('0xbb'),_0x8d5961[_0x406f('0x38')]));if(!this[_0x406f('0x86')](_0x8d5961[_0x406f('0xbc')])){return this['channel'][_0x406f('0x2a')](_0x8d5961,_0x406f('0xbd'));}_0x8d5961['scheduledAt']=moment();if(this['isConfigured'](_0x8d5961[_0x406f('0xbe')])){_0x8d5961[_0x406f('0x48')]=moment()[_0x406f('0xbf')](_0x8d5961[_0x406f('0xbe')],_0x406f('0xc0'));}if(!this[_0x406f('0x86')](_0x8d5961[_0x406f('0x4c')])){_0x8d5961['callback_priority']=0x2;}this[_0x406f('0x42')]['sync'](this,_0x8d5961);return this['channel'][_0x406f('0xa9')](util[_0x406f('0x26')](_0x406f('0xc1'),_0x8d5961[_0x406f('0xc2')],_0x8d5961[_0x406f('0xbc')],_0x8d5961[_0x406f('0x48')]));};AGIVertices[_0x406f('0x12')][_0x406f('0xc3')]=function(_0x41feb2){logger[_0x406f('0x2b')](util['format']('Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block',_0x41feb2[_0x406f('0x38')]));var _0x2e0169=this[_0x406f('0x36')]['exec'](_0x41feb2[_0x406f('0xc4')],_0x41feb2['options']);if(_0x2e0169[_0x406f('0xab')]===-0x1){return _0x2e0169;}return this[_0x406f('0x36')][_0x406f('0xa9')](util[_0x406f('0x26')](_0x406f('0xc5'),_0x41feb2['application'],_0x41feb2['options']));};AGIVertices[_0x406f('0x12')][_0x406f('0xc6')]=function(_0x17aa1f){logger['info'](util[_0x406f('0x26')]('Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block',_0x17aa1f[_0x406f('0x38')]));if(!this[_0x406f('0x86')](_0x17aa1f['text'])){return this[_0x406f('0x36')][_0x406f('0xa9')](_0x406f('0xaa'));}var _0x5b2ccd='\x22'+_0x17aa1f[_0x406f('0x5c')]+'\x22';if(this['isConfigured'](_0x17aa1f['options'])){_0x5b2ccd+=','+_0x17aa1f[_0x406f('0x79')];}var _0x3eabdd=this[_0x406f('0x36')][_0x406f('0x58')](_0x406f('0xc7'),_0x5b2ccd);if(_0x3eabdd['result']===-0x1){return _0x3eabdd;}return this[_0x406f('0x36')][_0x406f('0xa9')](util[_0x406f('0x26')](_0x406f('0xac'),_0x5b2ccd));};AGIVertices[_0x406f('0x12')][_0x406f('0xc8')]=function(_0x370ed2){logger[_0x406f('0x2b')](util[_0x406f('0x26')](_0x406f('0xc9'),_0x370ed2[_0x406f('0x38')]));if(!this[_0x406f('0x86')](_0x370ed2[_0x406f('0x5c')])){return this[_0x406f('0x36')][_0x406f('0xa9')](_0x406f('0xaa'));}var _0x372616='\x22'+_0x370ed2['text']+'\x22';if(this[_0x406f('0x86')](_0x370ed2[_0x406f('0x79')])){_0x372616+=','+_0x370ed2[_0x406f('0x79')];}var _0x3b6d0e=this[_0x406f('0x36')][_0x406f('0x58')](_0x406f('0xc7'),_0x372616);if(_0x3b6d0e[_0x406f('0xab')]===-0x1){return _0x3b6d0e;}return this['channel'][_0x406f('0xa9')](util[_0x406f('0x26')]('Executed\x20command\x20MRCPSynth\x20%s',_0x372616));};AGIVertices[_0x406f('0x12')]['lumenvoxasr']=function(_0x37e25e){logger['info'](util['format'](_0x406f('0xca'),_0x37e25e[_0x406f('0x38')]));if(!this[_0x406f('0x86')](_0x37e25e['grammar'])){return this[_0x406f('0x36')][_0x406f('0xa9')]('no\x20grammar\x20configured');}var _0x1470cb=_0x37e25e[_0x406f('0xaf')];if(this['isConfigured'](_0x37e25e[_0x406f('0x79')])){_0x1470cb+=','+_0x37e25e[_0x406f('0x79')];}var _0x10a8d9=this[_0x406f('0x36')]['exec']('MRCPRecog',_0x1470cb);if(_0x10a8d9['result']===-0x1){return _0x10a8d9;}var _0x15554d=this['getAndSetVariable'](_0x406f('0xcb'),_0x406f('0xcc'));if(_0x15554d['result']===-0x1){return _0x15554d;}var _0x4e5e6e=this['getAndSetVariable'](_0x406f('0xb3'),_0x406f('0xcd'));if(_0x4e5e6e[_0x406f('0xab')]===-0x1){return _0x4e5e6e;}var _0x4b6e1b=this[_0x406f('0xa5')](_0x406f('0xb4'),_0x406f('0xce'));if(_0x4b6e1b[_0x406f('0xab')]===-0x1){return _0x4b6e1b;}return this['channel'][_0x406f('0xa9')](util[_0x406f('0x26')](_0x406f('0xb5'),_0x1470cb));};AGIVertices[_0x406f('0x12')][_0x406f('0xcf')]=function(_0xc5de5e){logger[_0x406f('0x2b')](util[_0x406f('0x26')]('Enter\x20in\x20SESTEKASR\x20(%s)\x20block',_0xc5de5e[_0x406f('0x38')]));if(!this[_0x406f('0x86')](_0xc5de5e[_0x406f('0xaf')])){return this[_0x406f('0x36')][_0x406f('0xa9')]('no\x20grammar\x20configured');}var _0x2d04fc=_0xc5de5e[_0x406f('0xaf')];if(this[_0x406f('0x86')](_0xc5de5e['options'])){_0x2d04fc+=','+_0xc5de5e[_0x406f('0x79')];}var _0x44c61e=this['channel'][_0x406f('0x58')](_0x406f('0xb1'),_0x2d04fc);if(_0x44c61e[_0x406f('0xab')]===-0x1){return _0x44c61e;}var _0x385821=this[_0x406f('0xa5')](_0x406f('0xcb'),_0x406f('0xd0'));if(_0x385821['result']===-0x1){return _0x385821;}var _0x2c6bea=this[_0x406f('0xa5')]('RECOG_INPUT()',_0x406f('0xd1'));if(_0x2c6bea[_0x406f('0xab')]===-0x1){return _0x2c6bea;}var _0x4dcbff=this[_0x406f('0xa5')](_0x406f('0xb4'),_0x406f('0xd2'));if(_0x4dcbff[_0x406f('0xab')]===-0x1){return _0x4dcbff;}return this[_0x406f('0x36')][_0x406f('0xa9')](util['format'](_0x406f('0xb5'),_0x2d04fc));};AGIVertices[_0x406f('0x12')][_0x406f('0xd3')]=function(_0x1666dd){logger[_0x406f('0x2b')](util[_0x406f('0x26')](_0x406f('0xd4'),_0x1666dd['label']));if(!this[_0x406f('0x86')](_0x1666dd[_0x406f('0xd5')])){return this[_0x406f('0x36')]['error'](_0x1666dd,'no\x20database\x20selected');}var _0x5e91f5=this[_0x406f('0x16')][_0x406f('0x70')](this,_0x1666dd[_0x406f('0xd5')]);if(!_0x5e91f5){return this[_0x406f('0x36')][_0x406f('0x2a')](_0x1666dd,'no\x20odbc\x20database\x20found');}if(!this[_0x406f('0x86')](_0x1666dd[_0x406f('0x2d')])){return this['channel']['error'](_0x1666dd,_0x406f('0xd6'));}var _0x3bc583=_0x1666dd[_0x406f('0x2d')][_0x406f('0xd7')](/(\r\n|\n|\r)/gm,'\x20');this[_0x406f('0x36')][_0x406f('0xa9')](util['format'](_0x406f('0xd8'),_0x3bc583));var _0x54fa56=this['getQueryOdbc']['sync'](this,_0x5e91f5,_0x3bc583);this['createSquareDetailsReport'][_0x406f('0x70')](this,_0x1666dd,_0x3bc583);if(!this['isConfigured'](_0x1666dd[_0x406f('0xd9')])){return this[_0x406f('0x36')][_0x406f('0xa9')](_0x406f('0xda'));}var _0x3bb5d8=this[_0x406f('0xd')][_0x406f('0x70')](this,_0x1666dd[_0x406f('0xd9')]);if(!_0x3bb5d8){return this[_0x406f('0x36')]['error'](_0x1666dd,_0x406f('0xdb'));}var _0x25cc38=this;_0x54fa56[_0x406f('0xdc')](function(_0xb580d4,_0x3a5bbf){Object['keys'](_0xb580d4)['forEach'](function(_0x4d391d){_0x25cc38[_0x406f('0x36')][_0x406f('0xa1')](util[_0x406f('0x26')](_0x406f('0xdd'),_0x3bb5d8,_0x3a5bbf,_0x4d391d),_0xb580d4[_0x4d391d]);});});this['channel'][_0x406f('0xa1')](util[_0x406f('0x26')]('%s_ROWS_COUNT',_0x3bb5d8),_0x54fa56[_0x406f('0x9c')]);return this['channel'][_0x406f('0xa9')](util[_0x406f('0x26')](_0x406f('0xde'),_0x3bb5d8));};AGIVertices[_0x406f('0x12')]['dial']=function(_0x13f100){logger['debug'](util[_0x406f('0x26')]('Enter\x20in\x20DIAL\x20(%s)\x20block',_0x13f100[_0x406f('0x38')]));if(!this[_0x406f('0x86')](_0x13f100[_0x406f('0xdf')])){return this[_0x406f('0x36')][_0x406f('0x2a')](_0x13f100,'no\x20user\x20selected');}var _0x1eea2b=this[_0x406f('0x18')]['sync'](this,_0x13f100['sip_id']);if(!_0x1eea2b){return this[_0x406f('0x36')]['error'](_0x13f100,_0x406f('0xe0'));}var _0x3dc244=this[_0x406f('0x36')]['exec']('DIAL',[util['format'](_0x406f('0xe1'),_0x1eea2b),_0x13f100['timeout'],_0x13f100[_0x406f('0xe2')],_0x13f100[_0x406f('0x63')]]);if(_0x3dc244[_0x406f('0xab')]===-0x1){return _0x3dc244;}return this[_0x406f('0x36')]['noop'](util[_0x406f('0x26')](_0x406f('0xe3'),_0x406f('0xe4')));};AGIVertices[_0x406f('0x12')][_0x406f('0xe5')]=function(_0xb0f097){logger[_0x406f('0x2b')](util[_0x406f('0x26')](_0x406f('0xe6'),_0xb0f097['label']));if(!this[_0x406f('0x86')](_0xb0f097[_0x406f('0x7b')])){return this['channel'][_0x406f('0xa9')](_0x406f('0xe7'));}if(!this['isConfigured'](_0xb0f097[_0x406f('0x5c')])){return this[_0x406f('0x36')]['noop'](_0x406f('0xaa'));}this[_0x406f('0x36')]['bot']=!![];this[_0x406f('0x35')](_0xb0f097);this['createSquareMessage'](_0xb0f097[_0x406f('0x5c')],'in','','');this[_0x406f('0x36')][_0x406f('0xa9')](util[_0x406f('0x26')]('Trying\x20Dialogflow:\x20%s',_0xb0f097[_0x406f('0x5c')]));var _0x27e5f3=this[_0x406f('0x7a')][_0x406f('0x70')](this,_0xb0f097);if(_0x27e5f3){for(var _0x3d66f6 in _0x27e5f3){if(_0x27e5f3[_0x406f('0x9f')](_0x3d66f6)){this[_0x406f('0x36')]['setVariable'](util['format']('DIALOGFLOW_%s',_0x3d66f6[_0x406f('0x69')]()),_0x27e5f3[_0x3d66f6]);}}this[_0x406f('0x41')](_0x27e5f3[_0x406f('0xe8')],_0x406f('0xe9'),_0x406f('0xe5'),'');return this[_0x406f('0x36')]['noop'](util[_0x406f('0x26')](_0x406f('0xea'),_0x27e5f3[_0x406f('0xe8')]));}return this[_0x406f('0x36')][_0x406f('0x2a')](_0xb0f097,_0x406f('0xeb'));};AGIVertices['prototype'][_0x406f('0xec')]=function(_0x974b40){logger[_0x406f('0x2b')](util[_0x406f('0x26')](_0x406f('0xed'),_0x974b40[_0x406f('0x38')]));if(!this['isConfigured'](_0x974b40[_0x406f('0x7e')])){return this['channel']['noop'](_0x406f('0xee'));}if(!this[_0x406f('0x86')](_0x974b40[_0x406f('0x7f')])){return this[_0x406f('0x36')][_0x406f('0xa9')](_0x406f('0xef'));}if(!this['isConfigured'](_0x974b40[_0x406f('0xf0')])){return this['channel']['noop']('no\x20private_key\x20configured');}if(!this[_0x406f('0x86')](_0x974b40['dialogflowV2_language'])){return this[_0x406f('0x36')][_0x406f('0xa9')](_0x406f('0xf1'));}if(!this['isConfigured'](_0x974b40[_0x406f('0x5c')])){return this[_0x406f('0x36')][_0x406f('0xa9')](_0x406f('0xaa'));}this['channel'][_0x406f('0xf2')]=!![];this[_0x406f('0x35')](_0x974b40);this[_0x406f('0x41')](_0x974b40[_0x406f('0x5c')],'in','','');this[_0x406f('0x36')]['noop'](util[_0x406f('0x26')](_0x406f('0xf3'),_0x974b40['text']));var _0x32dae4=this[_0x406f('0x7d')][_0x406f('0x70')](this,_0x974b40);if(_0x32dae4){for(var _0x770c44 in _0x32dae4){if(_0x32dae4[_0x406f('0x9f')](_0x770c44)){if(_0x770c44!==_0x406f('0xf4')){this['channel'][_0x406f('0xa1')](util['format'](_0x406f('0xf5'),_0x770c44[_0x406f('0x69')]()),_0x32dae4[_0x770c44]);}}}this[_0x406f('0x41')](_0x32dae4[_0x406f('0xe8')],_0x406f('0xe9'),_0x406f('0xec'),_0x32dae4[_0x406f('0xf4')]);return this[_0x406f('0x36')][_0x406f('0xa9')](util['format'](_0x406f('0xf6'),_0x32dae4[_0x406f('0xe8')]));}return this[_0x406f('0x36')]['error'](_0x974b40,_0x406f('0xf7'));};AGIVertices[_0x406f('0x12')][_0x406f('0xf8')]=function(_0x5238a7){logger['info'](util[_0x406f('0x26')](_0x406f('0xf9'),_0x5238a7[_0x406f('0x38')]));if(!this[_0x406f('0x86')](_0x5238a7[_0x406f('0xfa')])){return this[_0x406f('0x36')][_0x406f('0xa9')](_0x406f('0xfb'));}if(!this[_0x406f('0x86')](_0x5238a7[_0x406f('0xfc')])){return this[_0x406f('0x36')]['noop'](_0x406f('0xfd'));}if(!this[_0x406f('0x86')](_0x5238a7[_0x406f('0xfe')])){return this[_0x406f('0x36')][_0x406f('0xa9')](_0x406f('0xff'));}if(!this[_0x406f('0x86')](_0x5238a7[_0x406f('0x100')])){return this[_0x406f('0x36')][_0x406f('0xa9')](_0x406f('0xaa'));}this[_0x406f('0x36')][_0x406f('0xf2')]=!![];this[_0x406f('0x35')](_0x5238a7);this[_0x406f('0x41')](_0x5238a7[_0x406f('0x5c')],'in','','');this[_0x406f('0x36')][_0x406f('0xa9')](util['format']('Trying\x20SestekNDA:\x20%s',_0x5238a7[_0x406f('0x5c')]));var _0xee6868=this[_0x406f('0x80')][_0x406f('0x70')](this,_0x5238a7);if(_0xee6868){for(var _0x4961e3 in _0xee6868){if(_0xee6868[_0x406f('0x9f')](_0x4961e3)){this[_0x406f('0x36')][_0x406f('0xa1')](util[_0x406f('0x26')](_0x406f('0x101'),_0x4961e3['toUpperCase']()),_0xee6868[_0x4961e3]);}}this[_0x406f('0x41')](_0xee6868[_0x406f('0xe8')],'out','sesteknda','');if(_0xee6868[_0x406f('0x102')]){this[_0x406f('0x36')][_0x406f('0xa9')](util[_0x406f('0x26')](_0x406f('0x103'),_0xee6868['audiofile']));var _0x3936b8=this[_0x406f('0x36')][_0x406f('0x104')](_0xee6868[_0x406f('0x102')]);try{fs['unlink'](_0xee6868[_0x406f('0x102')]+_0x406f('0x105'));}catch(_0x4837ab){logger[_0x406f('0x2a')](_0x4837ab);}return _0x3936b8;}else{return this[_0x406f('0x36')][_0x406f('0xa9')](util[_0x406f('0x26')](_0x406f('0x106'),_0xee6868[_0x406f('0xe8')]));}}return this[_0x406f('0x36')][_0x406f('0x2a')](_0x5238a7,_0x406f('0x107'));};AGIVertices['prototype']['end']=function(_0x11467d){logger[_0x406f('0x2b')](util[_0x406f('0x26')](_0x406f('0x108'),_0x11467d[_0x406f('0x38')]));return this[_0x406f('0x36')]['noop'](_0x406f('0x109'));};AGIVertices[_0x406f('0x12')]['ext_dial']=function(_0x2b3899){logger[_0x406f('0x2b')](util[_0x406f('0x26')](_0x406f('0x10a'),_0x2b3899['label']));var _0x355c97='';if(_0x2b3899[_0x406f('0x10b')]){if(!this[_0x406f('0x86')](_0x2b3899[_0x406f('0x10b')])){return this[_0x406f('0x36')][_0x406f('0x2a')](_0x2b3899,_0x406f('0x10c'));}else{var _0x2198fa=parseInt(_0x2b3899[_0x406f('0x10b')],0xa);if(isNaN(_0x2198fa)){_0x355c97=_0x2b3899[_0x406f('0x10b')];}else{_0x355c97=this[_0x406f('0x1a')][_0x406f('0x70')](this,_0x2b3899['trunk_id']);if(!_0x355c97){return this[_0x406f('0x36')][_0x406f('0x2a')](_0x2b3899,_0x406f('0x10d'));}}}}else if(_0x2b3899[_0x406f('0x10e')]){_0x355c97=_0x2b3899[_0x406f('0x10e')];}else{return this[_0x406f('0x36')][_0x406f('0x2a')](_0x2b3899,'no\x20trunk\x20selected');}var _0x781636=this['channel'][_0x406f('0x58')](_0x406f('0xe4'),[util[_0x406f('0x26')](_0x406f('0x10f'),_0x355c97,_0x2b3899[_0x406f('0xc2')]),_0x2b3899['timeout'],_0x2b3899[_0x406f('0xe2')],_0x2b3899[_0x406f('0x63')]]);if(_0x781636[_0x406f('0xab')]===-0x1){return _0x781636;}return this[_0x406f('0x36')][_0x406f('0xa9')](util[_0x406f('0x26')]('Executed\x20command\x20%s',_0x406f('0xe4')));};AGIVertices['prototype'][_0x406f('0x110')]=function(_0xb1c96c){logger[_0x406f('0x2b')](util['format'](_0x406f('0x111'),_0xb1c96c[_0x406f('0x38')]));return this['channel'][_0x406f('0xa9')](_0x406f('0x110'));};AGIVertices['prototype'][_0x406f('0xa')]=function(_0x164339){logger[_0x406f('0x2b')](util['format'](_0x406f('0x112'),_0x164339[_0x406f('0x38')]));if(_0x164339[_0x406f('0xa7')]===0x0){return this[_0x406f('0xa8')](_0x164339);}_0x164339[_0x406f('0xa7')]-=0x1;if(!this[_0x406f('0x86')](_0x164339['file_id'])){return this[_0x406f('0x36')][_0x406f('0x2a')](_0x164339,_0x406f('0x113'));}var _0x2fdc27=this[_0x406f('0x114')][_0x406f('0x70')](this,_0x164339[_0x406f('0x115')]);if(!_0x2fdc27){return this['channel'][_0x406f('0x2a')](_0x164339,_0x406f('0x116'));}if(!this[_0x406f('0x86')](_0x164339['variable_id'])){return this['channel'][_0x406f('0x2a')](_0x406f('0xda'));}var _0x1cd7c9=this[_0x406f('0x36')]['getData'](_0x2fdc27,_0x164339[_0x406f('0x117')],_0x164339['maxdigit']);var _0xfd5120=_0x1cd7c9[_0x406f('0xab')]?_0x1cd7c9[_0x406f('0xab')]['toString']():'';logger[_0x406f('0x2b')]('test',JSON[_0x406f('0x73')](_0x1cd7c9));if(_0x1cd7c9['result']===-0x1){this[_0x406f('0x35')][_0x406f('0x70')](this,_0x164339,_0xfd5120);return _0x1cd7c9;}else if(_0x1cd7c9[_0x406f('0xa4')]==='timeout'){_0x1cd7c9['result']=_0xfd5120[_0x406f('0x9c')]>=parseInt(_0x164339[_0x406f('0x118')])?'x':'i';}else{_0x1cd7c9['result']=_0xfd5120[_0x406f('0x9c')]>=parseInt(_0x164339[_0x406f('0x118')])&&_0xfd5120[_0x406f('0x9c')]<=parseInt(_0x164339[_0x406f('0x119')])?'x':'i';}var _0x325a6d=this['getVariable'][_0x406f('0x70')](this,_0x164339[_0x406f('0xd9')]);if(!_0x325a6d){return this['channel']['error'](_0x164339,_0x406f('0xdb'));}this['channel'][_0x406f('0xa1')](_0x325a6d,_0xfd5120);if(this['isConfigured'](_0x164339[_0x406f('0x11a')])){var _0x2be2e2=parseInt(_0x164339[_0x406f('0x11a')],0xa);var _0x53a724=rs['generate']({'charset':'*','length':_0x2be2e2});var _0x3bd7af=_0xfd5120['length'];if(_0x3bd7af>0x0){if(_0x3bd7af>_0x2be2e2){this[_0x406f('0x35')][_0x406f('0x70')](this,_0x164339,_0x164339[_0x406f('0x11b')]===_0x406f('0x11c')?_0x53a724+_0xfd5120[_0x406f('0x11d')](_0x2be2e2):_0xfd5120[_0x406f('0x11d')](0x0,_0x3bd7af-_0x2be2e2)+_0x53a724);}else{this[_0x406f('0x35')][_0x406f('0x70')](this,_0x164339,rs[_0x406f('0x11e')]({'charset':'*','length':_0x3bd7af}));}}else{this[_0x406f('0x35')]['sync'](this,_0x164339,'');}}else{this[_0x406f('0x35')][_0x406f('0x70')](this,_0x164339,_0xfd5120);}return _0x1cd7c9;};AGIVertices[_0x406f('0x12')]['getsecretdigits']=function(_0x25e8e3){logger['info'](util[_0x406f('0x26')](_0x406f('0x11f'),_0x25e8e3['label']));return this[_0x406f('0xa')](_0x25e8e3);};AGIVertices[_0x406f('0x12')]['goal']=function(_0x4a26c4){logger[_0x406f('0x2b')](util[_0x406f('0x26')]('Enter\x20in\x20GOAL\x20(%s)\x20block',_0x4a26c4[_0x406f('0x38')]));this[_0x406f('0x35')][_0x406f('0x70')](this,_0x4a26c4,_0x4a26c4[_0x406f('0x120')]);return this[_0x406f('0x36')][_0x406f('0xa9')](util[_0x406f('0x26')](_0x406f('0x121'),_0x4a26c4[_0x406f('0x120')]));};AGIVertices[_0x406f('0x12')][_0x406f('0x122')]=function(_0x57f68){logger['info'](util[_0x406f('0x26')](_0x406f('0x123'),_0x57f68['label']));if(!this['isConfigured'](_0x57f68['aws_access_key_id'])||!this['isConfigured'](_0x57f68[_0x406f('0x89')])){return this[_0x406f('0x36')][_0x406f('0xa9')](_0x406f('0x124'));}if(!this[_0x406f('0x86')](_0x57f68[_0x406f('0x5c')])){return this[_0x406f('0x36')][_0x406f('0xa9')](_0x406f('0xaa'));}this[_0x406f('0x36')]['noop'](util[_0x406f('0x26')](_0x406f('0x125'),_0x57f68[_0x406f('0x5c')]));var _0x268c18=this[_0x406f('0x88')][_0x406f('0x70')](this,_0x57f68);if(_0x268c18){this[_0x406f('0x36')]['noop'](util['format'](_0x406f('0x126'),_0x268c18));var _0x2a6d31=this[_0x406f('0x36')][_0x406f('0x104')](_0x268c18);try{fs[_0x406f('0x127')](_0x268c18+'.wav');}catch(_0x27f246){logger[_0x406f('0x2a')](_0x27f246);}return _0x2a6d31;}return this[_0x406f('0x36')][_0x406f('0x2a')](_0x57f68,'aws\x20Polly\x20is\x20unreachable');};AGIVertices[_0x406f('0x12')]['awslex']=function(_0x4f6170){logger[_0x406f('0x2b')](util[_0x406f('0x26')]('Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block',_0x4f6170[_0x406f('0x38')]));if(!this[_0x406f('0x86')](_0x4f6170[_0x406f('0x8f')])||!this[_0x406f('0x86')](_0x4f6170['aws_secret_access_key'])){return this[_0x406f('0x36')]['noop'](_0x406f('0x124'));}if(!this[_0x406f('0x86')](_0x4f6170[_0x406f('0x128')])){return this[_0x406f('0x36')][_0x406f('0xa9')](_0x406f('0x129'));}if(!this[_0x406f('0x86')](_0x4f6170[_0x406f('0x5c')])){return this[_0x406f('0x36')]['noop']('no\x20text\x20configured');}this[_0x406f('0x36')][_0x406f('0xf2')]=!![];this[_0x406f('0x35')](_0x4f6170);this['createSquareMessage'](_0x4f6170[_0x406f('0x5c')],'in','','');this['channel'][_0x406f('0xa9')](util['format'](_0x406f('0x12a'),_0x4f6170[_0x406f('0x5c')]));var _0x5dbe34=this['awsLex']['sync'](this,_0x4f6170);if(_0x5dbe34){for(var _0x6b3c70 in _0x5dbe34){if(_0x5dbe34[_0x406f('0x9f')](_0x6b3c70)&&_[_0x406f('0x9d')](_0x5dbe34[_0x6b3c70])){this[_0x406f('0x36')][_0x406f('0xa1')](util[_0x406f('0x26')](_0x406f('0x12b'),_0x6b3c70[_0x406f('0x69')]()),_0x5dbe34[_0x6b3c70]);}}if(_[_0x406f('0x47')](_0x5dbe34[_0x406f('0x77')])){return this[_0x406f('0x36')]['noop'](_0x406f('0x12c'));}else{this[_0x406f('0x41')](_0x5dbe34[_0x406f('0x77')],_0x406f('0xe9'),_0x406f('0x12d'),'');return this[_0x406f('0x36')]['noop'](util[_0x406f('0x26')]('Amazon\x20Lex\x20Result\x20%s',_0x5dbe34['message']));}}return this['channel']['error'](_0x4f6170,_0x406f('0x12e'));};AGIVertices[_0x406f('0x12')][_0x406f('0x12f')]=function(_0x214518){logger['info'](util[_0x406f('0x26')](_0x406f('0x130'),_0x214518[_0x406f('0x38')],_0x214518[_0x406f('0x64')]));if(!this[_0x406f('0x86')](_0x214518[_0x406f('0x7b')])){return this[_0x406f('0x36')][_0x406f('0xa9')](_0x406f('0xe7'));}var _0x11362b='wav';var _0x17da58=util['format'](_0x406f('0x131'),FILES_PATH,rs[_0x406f('0x11e')](0x4));var _0x2999ac=util[_0x406f('0x26')](_0x406f('0xa0'),_0x17da58,_0x11362b);var _0x5582fb=!![];if(_0x214518[_0x406f('0x132')]===_0x406f('0x133')){_0x5582fb=![];}var _0x425927=this[_0x406f('0x36')][_0x406f('0x134')](_0x17da58,_0x11362b,_0x214518['intKey'],_0x214518[_0x406f('0x64')],undefined,_0x5582fb);if(_0x425927[_0x406f('0xab')]!==-0x1){this[_0x406f('0x36')][_0x406f('0xa9')](util[_0x406f('0x26')](_0x406f('0x135'),_0x2999ac));var _0x353124=this[_0x406f('0x91')][_0x406f('0x70')](this,_0x214518,_0x2999ac);if(_0x353124){for(var _0x362105 in _0x353124){if(_0x353124[_0x406f('0x9f')](_0x362105)){this[_0x406f('0x36')][_0x406f('0xa1')](util['format'](_0x406f('0x136'),_0x362105[_0x406f('0x69')]()),_0x353124[_0x362105]);}}return this['channel'][_0x406f('0xa9')](util[_0x406f('0x26')](_0x406f('0x137'),JSON[_0x406f('0x73')](_0x353124)));}}return _0x425927;};AGIVertices[_0x406f('0x12')]['tildeasr']=function(_0x502255){logger[_0x406f('0x2b')](util[_0x406f('0x26')](_0x406f('0x138'),_0x502255[_0x406f('0x38')]));if(!this['isConfigured'](_0x502255['appid'])){return this[_0x406f('0x36')]['noop'](_0x406f('0x139'));}if(!this[_0x406f('0x86')](_0x502255[_0x406f('0x95')])){return this[_0x406f('0x36')][_0x406f('0xa9')](_0x406f('0x13a'));}var _0x3174bb=_0x406f('0x13b');var _0x4e1234=util[_0x406f('0x26')](_0x406f('0x131'),FILES_PATH,rs[_0x406f('0x11e')](0x4));var _0x592947=util['format'](_0x406f('0xa0'),_0x4e1234,_0x3174bb);var _0x548768=!![];if(_0x502255[_0x406f('0x132')]===_0x406f('0x133')){_0x548768=![];}var _0x44aae7=this[_0x406f('0x36')][_0x406f('0x134')](_0x4e1234,_0x3174bb,_0x502255[_0x406f('0x13c')],_0x502255[_0x406f('0x64')],undefined,_0x548768);if(_0x44aae7[_0x406f('0xab')]!==-0x1){this[_0x406f('0x36')][_0x406f('0xa9')](util[_0x406f('0x26')](_0x406f('0x13d'),_0x592947));var _0x48e4e5=this[_0x406f('0x93')][_0x406f('0x70')](this,_0x502255,_0x592947);if(_0x48e4e5){for(var _0x2dd858 in _0x48e4e5){if(_0x48e4e5['hasOwnProperty'](_0x2dd858)){this[_0x406f('0x36')][_0x406f('0xa1')](util['format'](_0x406f('0x13e'),_0x2dd858[_0x406f('0x69')]()),_0x48e4e5[_0x2dd858]);}}return this[_0x406f('0x36')][_0x406f('0xa9')](util[_0x406f('0x26')](_0x406f('0x13f'),JSON[_0x406f('0x73')](_0x48e4e5)));}}return _0x44aae7;};AGIVertices[_0x406f('0x12')]['gotoc']=function(_0x24eff1){logger['info'](util[_0x406f('0x26')]('Enter\x20in\x20GOTO\x20(%s)\x20block',_0x24eff1[_0x406f('0x38')]));return this[_0x406f('0x36')]['continueAt'](_0x24eff1[_0x406f('0x3d')],_0x24eff1[_0x406f('0x140')],_0x24eff1['priority']);};AGIVertices[_0x406f('0x12')][_0x406f('0x141')]=function(_0x362142){logger[_0x406f('0x2b')](util[_0x406f('0x26')](_0x406f('0x142'),_0x362142['label']));if(!this[_0x406f('0x86')](_0x362142['condition'])){return this['channel'][_0x406f('0x2a')](_0x362142,_0x406f('0x143'));}try{var _0x7709bc=eval(_0x362142[_0x406f('0x144')])?_0x406f('0x145'):'false';this[_0x406f('0x36')][_0x406f('0xa9')](util[_0x406f('0x26')](_0x406f('0x146'),_0x362142['condition'],_0x7709bc));return{'code':0xc8,'result':_0x7709bc};}catch(_0x494d52){return{'code':0xc8,'result':'false'};}};AGIVertices[_0x406f('0x12')][_0x406f('0x147')]=function(_0x356f47){logger['info'](util[_0x406f('0x26')](_0x406f('0x148'),_0x356f47[_0x406f('0x38')]));if(!this[_0x406f('0x86')](_0x356f47[_0x406f('0x149')])){return this[_0x406f('0x36')][_0x406f('0x2a')](_0x356f47,_0x406f('0x14a'));}var _0x2393fd=this['getIntervals'][_0x406f('0x70')](this,_0x356f47[_0x406f('0x149')]);if(!_0x2393fd){return this[_0x406f('0x36')]['error'](_0x356f47,_0x406f('0x14b'));}for(var _0x4db19f=0x0;_0x4db19f<_0x2393fd[_0x406f('0x9c')];_0x4db19f+=0x1){var _0x528b93=this[_0x406f('0x36')][_0x406f('0xd')](util[_0x406f('0x26')]('IFTIME(%s?true:false)',_0x2393fd[_0x4db19f]));if(_0x528b93[_0x406f('0xab')]===-0x1){return _0x528b93;}logger['info'](util[_0x406f('0x26')](_0x406f('0x14c'),_0x2393fd[_0x4db19f],_0x528b93[_0x406f('0xa4')]));if(_0x528b93[_0x406f('0xa4')]===_0x406f('0x145')){logger[_0x406f('0x2b')](util['format'](_0x406f('0x14c'),_0x2393fd[_0x4db19f],'true'));this[_0x406f('0x36')][_0x406f('0xa9')](util[_0x406f('0x26')](_0x406f('0x14c'),_0x2393fd[_0x4db19f],_0x406f('0x145')));return{'code':0xc8,'result':_0x406f('0x145')};}else{logger[_0x406f('0x2b')](util[_0x406f('0x26')](_0x406f('0x14c'),_0x2393fd[_0x4db19f],_0x406f('0x14d')));this[_0x406f('0x36')][_0x406f('0xa9')](util[_0x406f('0x26')](_0x406f('0x14c'),_0x2393fd[_0x4db19f],'false'));}}return{'code':0xc8,'result':'false'};};AGIVertices['prototype'][_0x406f('0x14e')]=function(_0x50db2f){logger[_0x406f('0x2b')](util[_0x406f('0x26')](_0x406f('0x14f'),_0x50db2f[_0x406f('0x38')]));return this[_0x406f('0x36')]['hangup']();};AGIVertices[_0x406f('0x12')][_0x406f('0x150')]=function(_0x5cb44f){logger['info'](util[_0x406f('0x26')](_0x406f('0x151'),_0x5cb44f[_0x406f('0x38')]));if(!this[_0x406f('0x86')](_0x5cb44f[_0x406f('0x7b')])){return this[_0x406f('0x36')][_0x406f('0xa9')](_0x406f('0xe7'));}var _0x251156='wav';var _0x2da145=util[_0x406f('0x26')](_0x406f('0x131'),FILES_PATH,rs[_0x406f('0x11e')](0x4));var _0x107765=util[_0x406f('0x26')](_0x406f('0xa0'),_0x2da145,_0x251156);var _0x3ec33c=!![];if(_0x5cb44f[_0x406f('0x132')]===_0x406f('0x133')){_0x3ec33c=![];}var _0x1e902a=this[_0x406f('0x36')][_0x406f('0x134')](_0x2da145,_0x251156,_0x5cb44f[_0x406f('0x13c')],_0x5cb44f[_0x406f('0x64')],undefined,_0x3ec33c);if(_0x1e902a[_0x406f('0xab')]!==-0x1){this['channel']['noop'](util[_0x406f('0x26')](_0x406f('0x152'),_0x107765));var _0x56b72d=this[_0x406f('0x84')][_0x406f('0x70')](this,_0x5cb44f,_0x107765);if(_0x56b72d){for(var _0x55864c in _0x56b72d){if(_0x56b72d[_0x406f('0x9f')](_0x55864c)){this['channel'][_0x406f('0xa1')](util[_0x406f('0x26')](_0x406f('0x153'),_0x55864c['toUpperCase']()),_0x56b72d[_0x55864c]);}}return this[_0x406f('0x36')][_0x406f('0xa9')](util[_0x406f('0x26')](_0x406f('0x154'),JSON['stringify'](_0x56b72d)));}}return _0x1e902a;};AGIVertices[_0x406f('0x12')][_0x406f('0x155')]=function(_0xd99da2){logger[_0x406f('0x2b')](util['format']('Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block',_0xd99da2['label']));if(!this[_0x406f('0x86')](_0xd99da2[_0x406f('0x7b')])){return this[_0x406f('0x36')][_0x406f('0xa9')]('no\x20key\x20configured');}if(!this['isConfigured'](_0xd99da2['text'])){return this[_0x406f('0x36')]['noop']('no\x20text\x20configured');}this[_0x406f('0x36')][_0x406f('0xa9')](util[_0x406f('0x26')]('Trying\x20ispeech\x20TTS\x20%s',_0xd99da2['text']));var _0x1096c9=this[_0x406f('0x81')]['sync'](this,_0xd99da2);if(_0x1096c9){this[_0x406f('0x36')][_0x406f('0xa9')](util['format']('ispeech\x20%s\x20file\x20created',_0x1096c9));var _0x1f2d2f=this[_0x406f('0x36')][_0x406f('0x104')](_0x1096c9,_0xd99da2[_0x406f('0x13c')]);try{fs[_0x406f('0x127')](_0x1096c9+_0x406f('0x105'));}catch(_0x166ca9){logger[_0x406f('0x2a')](_0x166ca9);}return _0x1f2d2f;}return this[_0x406f('0x36')][_0x406f('0x2a')](_0xd99da2,_0x406f('0x156'));};AGIVertices[_0x406f('0x12')][_0x406f('0x157')]=function(_0x1a1d63){logger['info'](util[_0x406f('0x26')](_0x406f('0x158'),_0x1a1d63[_0x406f('0x38')]));if(!this[_0x406f('0x86')](_0x1a1d63[_0x406f('0x159')])){return this['channel'][_0x406f('0x2a')](_0x1a1d63,'no\x20find\x20by\x20configured');}logger[_0x406f('0x2b')](util['format'](_0x406f('0x15a'),this[_0x406f('0x36')][_0x406f('0x3a')],_0x1a1d63[_0x406f('0x159')]));var _0x5e72bf=this[_0x406f('0x56')][_0x406f('0x70')](this,_0x1a1d63[_0x406f('0x159')]);if(_0x5e72bf){logger['info'](util['format'](_0x406f('0x15b'),this[_0x406f('0x36')]['callerid'],_0x1a1d63[_0x406f('0x159')]));this[_0x406f('0x36')][_0x406f('0xa9')](util['format'](_0x406f('0x15b'),this['channel'][_0x406f('0x3a')],_0x1a1d63['findBy']));return{'code':0xc8,'result':_0x406f('0x15c')};}else{logger[_0x406f('0x2b')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x406f('0x36')][_0x406f('0x3a')],_0x1a1d63[_0x406f('0x159')]));this['channel'][_0x406f('0xa9')](util[_0x406f('0x26')](_0x406f('0x15d'),this[_0x406f('0x36')][_0x406f('0x3a')],_0x1a1d63[_0x406f('0x159')]));return{'code':0xc8,'result':_0x406f('0x15e')};}};AGIVertices['prototype'][_0x406f('0x15f')]=function(_0xdcfb4a){logger[_0x406f('0x2b')](util[_0x406f('0x26')](_0x406f('0x160'),_0xdcfb4a['label']));if(!this[_0x406f('0x86')](_0xdcfb4a[_0x406f('0x159')])){return this[_0x406f('0x36')]['error'](_0xdcfb4a,_0x406f('0x161'));}logger[_0x406f('0x2b')](util[_0x406f('0x26')](_0x406f('0x15a'),this[_0x406f('0x36')][_0x406f('0x3a')],_0xdcfb4a['findBy']));var _0x38ca6c=this[_0x406f('0x52')][_0x406f('0x70')](this,_0xdcfb4a[_0x406f('0x159')]);if(_0x38ca6c){logger['info'](util[_0x406f('0x26')](_0x406f('0x15b'),this[_0x406f('0x36')][_0x406f('0x3a')],_0xdcfb4a[_0x406f('0x159')]));this[_0x406f('0x36')]['noop'](util[_0x406f('0x26')](_0x406f('0x15b'),this[_0x406f('0x36')][_0x406f('0x3a')],_0xdcfb4a[_0x406f('0x159')]));return{'code':0xc8,'result':_0x406f('0x15c')};}else{logger[_0x406f('0x2b')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel']['callerid'],_0xdcfb4a[_0x406f('0x159')]));this[_0x406f('0x36')][_0x406f('0xa9')](util[_0x406f('0x26')](_0x406f('0x15d'),this[_0x406f('0x36')][_0x406f('0x3a')],_0xdcfb4a['findBy']));return{'code':0xc8,'result':_0x406f('0x15e')};}};AGIVertices[_0x406f('0x12')][_0x406f('0x162')]=function(_0x163a35){logger[_0x406f('0x2b')](util[_0x406f('0x26')](_0x406f('0x163'),_0x163a35[_0x406f('0x38')]));if(!this[_0x406f('0x86')](_0x163a35[_0x406f('0x164')])){return this[_0x406f('0x36')][_0x406f('0x2a')](_0x163a35,'no\x20operation\x20configured');}this['channel'][_0x406f('0xa9')](util[_0x406f('0x26')](_0x406f('0x165'),_0x163a35[_0x406f('0x164')]));var _0x16faf7=eval(_0x163a35[_0x406f('0x164')]);if(!this['isConfigured'](_0x163a35[_0x406f('0xd9')])){return this[_0x406f('0x36')][_0x406f('0xa9')](_0x406f('0xda'));}var _0x5c9b64=this['getVariable'][_0x406f('0x70')](this,_0x163a35[_0x406f('0xd9')]);if(!_0x5c9b64){return this[_0x406f('0x36')]['error'](_0x163a35,_0x406f('0xdb'));}if(_['isArray'](_0x16faf7)){var _0x5e35f9=this;_0x16faf7['forEach'](function(_0x1e12ef,_0x4b7b2a){_0x5e35f9[_0x406f('0x36')][_0x406f('0xa1')](util[_0x406f('0x26')](_0x406f('0x166'),_0x5c9b64,_0x4b7b2a),_0x1e12ef);});return this[_0x406f('0x36')][_0x406f('0xa9')](util[_0x406f('0x26')]('variable\x20%s[key]\x20set',_0x5c9b64));}else{return this[_0x406f('0x36')]['setVariable'](_0x5c9b64,_0x16faf7);}};AGIVertices['prototype'][_0x406f('0x167')]=function(_0x1eabdd){logger[_0x406f('0x2b')](util[_0x406f('0x26')](_0x406f('0x168'),_0x1eabdd[_0x406f('0x38')]));if(_0x1eabdd['retry']===0x0){return this[_0x406f('0xa8')](_0x1eabdd);}_0x1eabdd['retry']-=0x1;if(!this[_0x406f('0x86')](_0x1eabdd[_0x406f('0x115')])){return this[_0x406f('0x36')]['error'](_0x1eabdd,'no\x20file\x20audio\x20selected');}var _0xca4a9=this[_0x406f('0x114')]['sync'](this,_0x1eabdd[_0x406f('0x115')]);if(!_0xca4a9){return this[_0x406f('0x36')][_0x406f('0x2a')](_0x1eabdd,_0x406f('0x116'));}var _0x230249=this[_0x406f('0x36')][_0x406f('0x169')](_0xca4a9,_0x1eabdd[_0x406f('0x117')],_0x1eabdd[_0x406f('0x16a')]);var _0x5ac6ff=_0x230249[_0x406f('0xab')];if(_0x230249[_0x406f('0xab')]===-0x1){this[_0x406f('0x35')][_0x406f('0x70')](this,_0x1eabdd,'-1');return _0x230249;}else if(_0x230249['extra']===_0x406f('0x64')){_0x230249['result']=_0x230249[_0x406f('0xab')]['length']>0x0?_0x230249[_0x406f('0xab')]:'t';}else if(_['isEmpty'](_0x230249[_0x406f('0xab')])){_0x230249['result']='#';_0x5ac6ff='#';}if(!this[_0x406f('0x86')](_0x1eabdd[_0x406f('0xd9')])){this[_0x406f('0x36')][_0x406f('0xa9')](_0x406f('0xda'));}else{var _0x4312f6=this[_0x406f('0xd')]['sync'](this,_0x1eabdd[_0x406f('0xd9')]);if(!_0x4312f6){return this['channel'][_0x406f('0x2a')](_0x1eabdd,'no\x20variable\x20found');}this['channel'][_0x406f('0xa1')](_0x4312f6,_0x5ac6ff);}this['createSquareDetailsReport'][_0x406f('0x70')](this,_0x1eabdd,_0x5ac6ff);return _0x230249;};AGIVertices[_0x406f('0x12')]['noop']=function(_0x31b438){logger[_0x406f('0x2b')](util[_0x406f('0x26')]('Enter\x20in\x20NOOP\x20(%s)\x20block',_0x31b438[_0x406f('0x38')]));return this[_0x406f('0x36')][_0x406f('0xa9')](_0x31b438[_0x406f('0x16b')]||_0x31b438[_0x406f('0x38')]);};AGIVertices['prototype'][_0x406f('0x16c')]=function(_0x342e20){logger[_0x406f('0x2b')](util[_0x406f('0x26')](_0x406f('0x16d'),_0x342e20[_0x406f('0x38')]));if(!this[_0x406f('0x86')](_0x342e20[_0x406f('0x159')])){return this[_0x406f('0x36')][_0x406f('0x2a')](_0x342e20,_0x406f('0x161'));}logger[_0x406f('0x2b')](util['format'](_0x406f('0x15a'),this[_0x406f('0x36')]['callerid'],_0x342e20[_0x406f('0x159')]));var _0x4a2288=this[_0x406f('0x4d')][_0x406f('0x70')](this,_0x342e20[_0x406f('0x16e')]);var _0x302580=this[_0x406f('0x4f')][_0x406f('0x70')](this,_0x342e20[_0x406f('0x159')],_0x4a2288);if(_0x302580){logger[_0x406f('0x2b')](util[_0x406f('0x26')](_0x406f('0x15b'),this['channel'][_0x406f('0x3a')],_0x342e20[_0x406f('0x159')]));this[_0x406f('0x36')]['noop'](util[_0x406f('0x26')](_0x406f('0x15b'),this[_0x406f('0x36')][_0x406f('0x3a')],_0x342e20['findBy']));return{'code':0xc8,'result':'success'};}else{logger[_0x406f('0x2b')](util[_0x406f('0x26')](_0x406f('0x15d'),this[_0x406f('0x36')]['callerid'],_0x342e20[_0x406f('0x159')]));this[_0x406f('0x36')][_0x406f('0xa9')](util[_0x406f('0x26')](_0x406f('0x15b'),this[_0x406f('0x36')][_0x406f('0x3a')],_0x342e20[_0x406f('0x159')]));return{'code':0xc8,'result':_0x406f('0x15e')};}};AGIVertices[_0x406f('0x12')][_0x406f('0x16f')]=function(_0x4e5774){logger[_0x406f('0x2b')](util[_0x406f('0x26')](_0x406f('0x170'),_0x4e5774['label']));if(!this['isConfigured'](_0x4e5774[_0x406f('0x115')])){return this['channel'][_0x406f('0x2a')](_0x4e5774,_0x406f('0x113'));}var _0x2ecf86=this[_0x406f('0x114')][_0x406f('0x70')](this,_0x4e5774['file_id']);if(!_0x2ecf86){return this[_0x406f('0x36')][_0x406f('0x2a')](_0x4e5774,_0x406f('0x116'));}var _0xc89359=this['channel'][_0x406f('0x58')]('PLAYBACK',[_0x2ecf86,_0x4e5774['opts']]);if(_0xc89359[_0x406f('0xab')]===-0x1){return _0xc89359;}return this[_0x406f('0x36')][_0x406f('0xa9')](util['format'](_0x406f('0xc5'),_0x406f('0x171'),_0x2ecf86));};AGIVertices[_0x406f('0x12')][_0x406f('0x172')]=function(_0x17feb6){logger[_0x406f('0x2b')](util[_0x406f('0x26')]('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x17feb6['label']));if(!this[_0x406f('0x86')](_0x17feb6['queue_id'])){return this[_0x406f('0x36')][_0x406f('0x2a')](_0x17feb6,_0x406f('0x173'));}var _0x5e6248='';var _0x4d9fc7=parseInt(_0x17feb6[_0x406f('0x174')],0xa);if(isNaN(_0x4d9fc7)){_0x5e6248=_0x17feb6[_0x406f('0x174')];}else{_0x5e6248=this[_0x406f('0x13')][_0x406f('0x70')](this,_0x17feb6[_0x406f('0x174')]);if(!_0x5e6248){return this['channel'][_0x406f('0x2a')](_0x17feb6,_0x406f('0x175'));}}var _0x4bc003='';if(this[_0x406f('0x86')](_0x17feb6['file_id'])){var _0x509181=this['getSound'][_0x406f('0x70')](this,_0x17feb6[_0x406f('0x115')]);if(_0x509181){_0x4bc003=_0x509181;}}this['createSquareDetailsReport'][_0x406f('0x70')](this,_0x17feb6,_0x5e6248);if(_0x17feb6[_0x406f('0xe2')][_0x406f('0x176')]('x')<0x0){_0x17feb6[_0x406f('0xe2')]+='x';}if(_0x17feb6['opts'][_0x406f('0x176')]('X')<0x0){_0x17feb6['opts']+='X';}this['channel']['setVariable'](_0x406f('0x177'),_0x5e6248?_0x5e6248[_0x406f('0x178')]():'');var _0x4f6bb9=this['channel'][_0x406f('0x58')](_0x406f('0x179'),[_0x5e6248,_0x17feb6[_0x406f('0xe2')],_0x17feb6[_0x406f('0x63')],_0x4bc003,_0x17feb6[_0x406f('0x64')],_0x17feb6[_0x406f('0x5')],_0x17feb6['macro'],_0x17feb6['gosub'],'',_0x17feb6[_0x406f('0x17a')]]);if(_0x4f6bb9[_0x406f('0xab')]===-0x1){return _0x4f6bb9;}return this[_0x406f('0x36')][_0x406f('0xa9')](util[_0x406f('0x26')](_0x406f('0xc5'),_0x406f('0x179'),_0x5e6248));};AGIVertices[_0x406f('0x12')][_0x406f('0x17b')]=function(_0x2e7e11){logger[_0x406f('0x2b')](util[_0x406f('0x26')](_0x406f('0x17c'),_0x2e7e11['label']));var _0xbbe325=_0x2e7e11[_0x406f('0x17d')]||'wav';var _0x2be3bc=util[_0x406f('0x26')](_0x406f('0x17e'),this[_0x406f('0x36')]['uniqueid'],rs['generate'](0x5));var _0x54470a=util[_0x406f('0x26')](_0x406f('0x17f'),FILES_PATH,_0x2be3bc,_0xbbe325);var _0x2eb010=util[_0x406f('0x26')](_0x406f('0x131'),FILES_PATH,_0x2be3bc);this[_0x406f('0x3b')]['sync'](this,_0x2e7e11,_0x2be3bc,_0x54470a);this[_0x406f('0x36')][_0x406f('0xa1')](_0x406f('0x180'),_0x2be3bc);logger[_0x406f('0x2b')]('Recording\x20%s\x20%s\x20%s\x20%s',_0x2eb010,_0xbbe325,_0x2e7e11['escape_digits'],_0x2e7e11[_0x406f('0x64')]);return this[_0x406f('0x36')][_0x406f('0x134')](_0x2eb010,_0xbbe325,_0x2e7e11['escape_digits'],_0x2e7e11['timeout'],undefined,!![]);};AGIVertices[_0x406f('0x12')][_0x406f('0x181')]=function(_0x3e72e6){logger[_0x406f('0x2b')](util['format'](_0x406f('0x182'),_0x3e72e6[_0x406f('0x38')]));if(!this[_0x406f('0x86')](_0x3e72e6['url'])){return this[_0x406f('0x36')]['noop'](_0x406f('0x183'));}var _0x1f3a60=this[_0x406f('0x62')][_0x406f('0x70')](this,_0x3e72e6);logger[_0x406f('0x2b')](util[_0x406f('0x26')](_0x406f('0x184'),util[_0x406f('0x185')](_0x1f3a60,{'showHidden':![],'depth':null})));if(!this[_0x406f('0x86')](_0x3e72e6[_0x406f('0xd9')])){return this['channel'][_0x406f('0xa9')](_0x406f('0x186'));}var _0x26c4ee=this['getVariable']['sync'](this,_0x3e72e6[_0x406f('0xd9')]);if(!_0x26c4ee){return this[_0x406f('0x36')]['error'](_0x3e72e6,'no\x20variable\x20found');}this[_0x406f('0x36')][_0x406f('0xa1')](util[_0x406f('0x26')](_0x406f('0x187'),_0x26c4ee),_0x1f3a60[_0x406f('0x75')]?_0x1f3a60[_0x406f('0x75')]:'200');this['channel'][_0x406f('0xa1')](util[_0x406f('0x26')](_0x406f('0x188'),_0x26c4ee),_0x1f3a60[_0x406f('0x76')]?_0x1f3a60[_0x406f('0x76')]:'OK');if(_0x1f3a60['body']){try{this[_0x406f('0x9e')](_0x1f3a60[_0x406f('0x6a')],_0x26c4ee);}catch(_0x596fad){logger[_0x406f('0x2a')](util[_0x406f('0x26')]('Unable\x20to\x20set\x20result\x20in\x20variable\x20%s',_0x26c4ee));}}return this[_0x406f('0x36')][_0x406f('0xa9')](util[_0x406f('0x26')](_0x406f('0xde'),_0x26c4ee));};AGIVertices[_0x406f('0x12')][_0x406f('0x189')]=function(_0x3be4b1){logger[_0x406f('0x2b')](util['format'](_0x406f('0x18a'),_0x3be4b1[_0x406f('0x38')]));return this['channel'][_0x406f('0x18b')](_0x3be4b1[_0x406f('0x18c')][_0x406f('0xd7')](/\s+/g,''),_0x3be4b1['escape_digits']);};AGIVertices[_0x406f('0x12')][_0x406f('0x18d')]=function(_0x5db1fe){logger[_0x406f('0x2b')](util[_0x406f('0x26')](_0x406f('0x18e'),_0x5db1fe['label']));return this[_0x406f('0x36')][_0x406f('0x18f')](_0x5db1fe[_0x406f('0x190')]['replace'](/\s+/g,''),_0x5db1fe['escape_digits']);};AGIVertices[_0x406f('0x12')][_0x406f('0x191')]=function(_0x260f94){logger[_0x406f('0x2b')](util['format'](_0x406f('0x192'),_0x260f94[_0x406f('0x38')]));return this[_0x406f('0x36')]['sayPhonetic'](_0x260f94['text'],_0x260f94[_0x406f('0x193')]);};AGIVertices['prototype'][_0x406f('0x194')]=function(_0x1b215e){logger[_0x406f('0x2b')](util[_0x406f('0x26')](_0x406f('0x195'),_0x1b215e[_0x406f('0x38')]));if(!this['isConfigured'](_0x1b215e['account_id'])){return this[_0x406f('0x36')][_0x406f('0xa9')]('no\x20mail\x20account\x20configured');}var _0x712cf1=this['getMailAccount'][_0x406f('0x70')](this,_0x1b215e[_0x406f('0x196')]);if(!_0x712cf1||!_0x712cf1['Smtp']){return this[_0x406f('0x36')][_0x406f('0x2a')](_0x1b215e,_0x406f('0x197'));}var _0x5b90c5={'from':util[_0x406f('0x26')]('\x22%s\x22\x20<%s>',_0x712cf1[_0x406f('0x10')],_0x712cf1[_0x406f('0x198')]||_0x712cf1[_0x406f('0x199')][_0x406f('0x19a')]),'to':_0x1b215e['to']||'','cc':_0x1b215e['cc']||'','bcc':_0x1b215e['bcc']||'','subject':_0x1b215e[_0x406f('0x19b')],'html':_0x1b215e[_0x406f('0x5c')],'text':_0x1b215e[_0x406f('0x5c')]};if(this['isConfigured'](_0x1b215e[_0x406f('0x19c')])){}logger[_0x406f('0x19d')]('sendMail\x20message',JSON[_0x406f('0x73')](_0x5b90c5));this[_0x406f('0x35')][_0x406f('0x70')](this,_0x1b215e,_0x1b215e[_0x406f('0x196')]);this[_0x406f('0x36')][_0x406f('0xa9')](util[_0x406f('0x26')](_0x406f('0x19e'),_0x712cf1[_0x406f('0x10')]));this[_0x406f('0x1f')]['sync'](this,_0x712cf1['smtpOptions'],_0x5b90c5);return this[_0x406f('0x36')]['noop']('Mail\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0x406f('0x12')][_0x406f('0x19f')]=function(_0x3c491e){logger[_0x406f('0x2b')](util[_0x406f('0x26')](_0x406f('0x1a0'),_0x3c491e[_0x406f('0x38')]));return this[_0x406f('0x36')][_0x406f('0xa9')](_0x406f('0x1a1'));};AGIVertices[_0x406f('0x12')][_0x406f('0x1a2')]=function(_0x2a7d8e){logger[_0x406f('0x2b')](util[_0x406f('0x26')](_0x406f('0x1a3'),_0x2a7d8e[_0x406f('0x38')]));if(!this['isConfigured'](_0x2a7d8e[_0x406f('0x1a4')])){return this[_0x406f('0x36')]['noop']('no\x20sms\x20account\x20configured');}var _0x383f27=this[_0x406f('0x32')][_0x406f('0x70')](this,_0x2a7d8e['sms_account_id']);if(!_0x383f27){return this['channel'][_0x406f('0x2a')](_0x2a7d8e,'no\x20sms\x20account\x20found');}var _0x4e810a={'body':_0x2a7d8e['sms_text'],'phone':_0x2a7d8e['to']||'','SmsAccountId':_0x383f27['id']};logger[_0x406f('0x19d')](_0x406f('0x1a5'),JSON[_0x406f('0x73')](_0x4e810a));this[_0x406f('0x35')][_0x406f('0x70')](this,_0x2a7d8e,_0x2a7d8e[_0x406f('0x1a4')]);this[_0x406f('0x36')][_0x406f('0xa9')](util[_0x406f('0x26')]('Trying\x20SendSMS\x20with\x20account\x20%s',_0x383f27[_0x406f('0x10')]));this[_0x406f('0x34')]['sync'](this,_0x4e810a);return this[_0x406f('0x36')]['noop'](_0x406f('0x1a6'));};AGIVertices[_0x406f('0x12')]['set']=function(_0x376de8){logger[_0x406f('0x2b')](util[_0x406f('0x26')](_0x406f('0x1a7'),_0x376de8[_0x406f('0x38')]));if(!this[_0x406f('0x86')](_0x376de8[_0x406f('0xd9')])){return this[_0x406f('0x36')]['error'](_0x376de8,'no\x20variable\x20selected');}var _0x47b812=this[_0x406f('0xd')][_0x406f('0x70')](this,_0x376de8[_0x406f('0xd9')]);if(!_0x47b812){return this['channel'][_0x406f('0x2a')](_0x376de8,'no\x20variable\x20found');}return this['channel'][_0x406f('0xa1')](_0x47b812,_0x376de8[_0x406f('0x1a8')]);};AGIVertices[_0x406f('0x12')][_0x406f('0x1a9')]=function(_0x51fbd2){logger[_0x406f('0x2b')](util['format'](_0x406f('0x1aa'),_0x51fbd2['label']));this[_0x406f('0x36')]['noop'](_0x406f('0x1ab'));var _0x4a966e=this[_0x406f('0x36')][_0x406f('0xd')](_0x406f('0x1ac'));if(!_[_0x406f('0x43')](_0x4a966e['extra'])){this[_0x406f('0x36')][_0x406f('0x37')]=_0x4a966e['extra'];}if(_0x51fbd2[_0x406f('0xb8')]===_0x406f('0x1ad')){this[_0x406f('0x36')][_0x406f('0xa9')](_0x406f('0x1ae'));return this['channel'][_0x406f('0xb8')]();}return this[_0x406f('0x36')]['noop'](_0x406f('0x1af'));};AGIVertices[_0x406f('0x12')][_0x406f('0x1b0')]=function(_0x156d91){logger['info'](util[_0x406f('0x26')](_0x406f('0x1b1'),_0x156d91['label']));if(!this['isConfigured'](_0x156d91[_0x406f('0x1b2')])){return this[_0x406f('0x36')]['error'](_0x156d91,_0x406f('0x1b3'));}var _0x31b949=this['getSquareProject'][_0x406f('0x70')](this,_0x156d91[_0x406f('0x1b2')]);if(!this['isConfigured'](_0x31b949)){return this['channel']['error'](_0x156d91,util['format'](_0x406f('0x1b4'),_0x156d91[_0x406f('0x1b2')]));}if(_0x31b949===this[_0x406f('0x36')][_0x406f('0x1b5')]){return this[_0x406f('0x36')][_0x406f('0x2a')](_0x156d91,'project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project');}this[_0x406f('0x35')][_0x406f('0x70')](this,_0x156d91,_0x31b949);var _0x6ab4e9=this[_0x406f('0x36')][_0x406f('0x58')](_0x406f('0x1b6'),util[_0x406f('0x26')]('agi://%s/square,\x22%s\x22,\x22%s\x22',config[_0x406f('0x5')][_0x406f('0x1b7')]||_0x406f('0x1b8'),_0x31b949,this[_0x406f('0x36')][_0x406f('0x1b5')]));if(_0x6ab4e9[_0x406f('0xab')]===-0x1){return _0x6ab4e9;}return this['channel']['noop'](util['format'](_0x406f('0xc5'),'AGI',_0x31b949));};AGIVertices[_0x406f('0x12')][_0x406f('0x1b9')]=function(_0x17ecfa){logger[_0x406f('0x2b')](util[_0x406f('0x26')](_0x406f('0x1ba'),_0x17ecfa[_0x406f('0x38')]));var _0x101b27=this[_0x406f('0x57')]['sync'](this,_0x17ecfa[_0x406f('0xb7')]);this['createSquareDetailsReport'][_0x406f('0x70')](this,_0x17ecfa,_0x17ecfa[_0x406f('0xb7')]);if(this['isConfigured'](_0x17ecfa[_0x406f('0xd9')])){var _0x46b67f=this['getVariable'][_0x406f('0x70')](this,_0x17ecfa[_0x406f('0xd9')]);if(_0x46b67f){this[_0x406f('0x36')][_0x406f('0xa1')](_0x46b67f,_0x101b27);return this['channel'][_0x406f('0xa9')](util[_0x406f('0x26')]('sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s',_0x17ecfa[_0x406f('0xb7')],_0x46b67f));}}return this[_0x406f('0x36')][_0x406f('0xa9')](util[_0x406f('0x26')](_0x406f('0x1bb'),_0x17ecfa[_0x406f('0xb7')]));};AGIVertices['prototype'][_0x406f('0x1bc')]=function(_0x273eb4){logger[_0x406f('0x2b')](util[_0x406f('0x26')](_0x406f('0x1bd'),_0x273eb4['label']));_0x273eb4[_0x406f('0x5c')]=_0x273eb4[_0x406f('0x5c')][_0x406f('0xd7')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x273eb4[_0x406f('0x5b')])){return this[_0x406f('0x36')]['noop'](_0x406f('0x1be'));}if(!this[_0x406f('0x86')](_0x273eb4[_0x406f('0x5c')])){return this[_0x406f('0x36')][_0x406f('0xa9')]('no\x20text\x20configured');}this[_0x406f('0x36')][_0x406f('0xa9')](util[_0x406f('0x26')](_0x406f('0x1bf'),_0x273eb4[_0x406f('0x5c')]));var _0x1cfdb0=this[_0x406f('0x5a')][_0x406f('0x70')](this,_0x273eb4);if(_0x1cfdb0){this[_0x406f('0x36')][_0x406f('0xa9')](util[_0x406f('0x26')](_0x406f('0x1c0'),_0x1cfdb0));var _0x4b2a8d=this[_0x406f('0x36')][_0x406f('0x104')](_0x1cfdb0);try{fs[_0x406f('0x127')](_0x1cfdb0+_0x406f('0x105'));}catch(_0x442b63){logger[_0x406f('0x2a')](_0x442b63);}return _0x4b2a8d;}return this[_0x406f('0x36')][_0x406f('0x2a')](_0x273eb4,'Google\x20Cloud\x20TTS\x20is\x20unreachable');};AGIVertices[_0x406f('0x12')][_0x406f('0x1c1')]=function(_0x34cb51){logger[_0x406f('0x2b')](util[_0x406f('0x26')](_0x406f('0x1c2'),_0x34cb51[_0x406f('0x38')]));_0x34cb51[_0x406f('0x5c')]=_0x34cb51[_0x406f('0x5c')][_0x406f('0xd7')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x406f('0x86')](_0x34cb51[_0x406f('0x5c')])){return this['channel'][_0x406f('0xa9')](_0x406f('0xaa'));}this[_0x406f('0x36')][_0x406f('0xa9')](util[_0x406f('0x26')](_0x406f('0x1c3'),_0x34cb51['text']));var _0x25e964=this['googleTTS'][_0x406f('0x70')](this,_0x34cb51);if(_0x25e964){this[_0x406f('0x36')][_0x406f('0xa9')](util[_0x406f('0x26')]('Google\x20TTS\x20%s\x20file\x20created',_0x25e964));var _0xc28483=this['channel'][_0x406f('0x104')](_0x25e964);try{fs[_0x406f('0x127')](_0x25e964+_0x406f('0x105'));}catch(_0x1c0d35){logger[_0x406f('0x2a')](_0x1c0d35);}return _0xc28483;}return this[_0x406f('0x36')][_0x406f('0x2a')](_0x34cb51,_0x406f('0x1c4'));};AGIVertices[_0x406f('0x12')][_0x406f('0x1c5')]=function(_0x292fea){logger['info'](util[_0x406f('0x26')](_0x406f('0x1c6'),_0x292fea[_0x406f('0x38')]));if(!this['isConfigured'](_0x292fea['findBy'])){return this[_0x406f('0x36')][_0x406f('0x2a')](_0x292fea,_0x406f('0x161'));}logger[_0x406f('0x2b')](util[_0x406f('0x26')](_0x406f('0x15a'),this[_0x406f('0x36')][_0x406f('0x3a')],_0x292fea[_0x406f('0x159')]));var _0x4c17da=this[_0x406f('0x51')][_0x406f('0x70')](this,_0x292fea[_0x406f('0x159')]);if(_0x4c17da){logger['info'](util[_0x406f('0x26')](_0x406f('0x15b'),this[_0x406f('0x36')][_0x406f('0x3a')],_0x292fea[_0x406f('0x159')]));this[_0x406f('0x36')][_0x406f('0xa9')](util[_0x406f('0x26')](_0x406f('0x15b'),this[_0x406f('0x36')][_0x406f('0x3a')],_0x292fea[_0x406f('0x159')]));return{'code':0xc8,'result':_0x406f('0x15c')};}else{logger[_0x406f('0x2b')](util[_0x406f('0x26')](_0x406f('0x15d'),this['channel'][_0x406f('0x3a')],_0x292fea[_0x406f('0x159')]));this['channel'][_0x406f('0xa9')](util[_0x406f('0x26')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x406f('0x36')][_0x406f('0x3a')],_0x292fea['findBy']));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x406f('0x12')]['voicemail']=function(_0xae121d){logger[_0x406f('0x2b')](util['format'](_0x406f('0x1c7'),_0xae121d['label']));var _0x175d09=this[_0x406f('0x36')][_0x406f('0x58')](_0x406f('0x1c8'),[_0xae121d[_0x406f('0x1c9')],_0xae121d[_0x406f('0x79')]]);if(_0x175d09[_0x406f('0xab')]===-0x1){return _0x175d09;}return this['channel'][_0x406f('0xa9')](util[_0x406f('0x26')](_0x406f('0xc5'),'VOICEMAIL',_0xae121d[_0x406f('0x1c9')]));};AGIVertices[_0x406f('0x12')][_0x406f('0x1ca')]=function(_0x1ea90a){logger[_0x406f('0x2b')](util[_0x406f('0x26')](_0x406f('0x1cb'),_0x1ea90a[_0x406f('0x38')]));if(!this[_0x406f('0x86')](_0x1ea90a[_0x406f('0xd9')])){return this[_0x406f('0x36')][_0x406f('0x2a')](_0x1ea90a,_0x406f('0x1cc'));}var _0x172199=this[_0x406f('0xd')][_0x406f('0x70')](this,_0x1ea90a[_0x406f('0xd9')]);if(!_0x172199){return this[_0x406f('0x36')][_0x406f('0x2a')](_0x1ea90a,_0x406f('0xdb'));}var _0x5c15b0=this['channel'][_0x406f('0xd')](_0x172199);return{'code':0xc8,'result':_0x5c15b0[_0x406f('0xa4')]?_0x5c15b0[_0x406f('0xa4')]:'-'};};String[_0x406f('0x12')][_0x406f('0xa3')]=function(_0xc8d7e2,_0x475c53){return this['split'](_0xc8d7e2)[_0x406f('0x1cd')](_0x475c53);};module[_0x406f('0x1ce')]=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index a0d38e9..720452b 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 _0xfb65=['voicePause','info','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','[%s][START][AGENT:%s][QUEUE:%s]','attended','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','stopAcw','format','YYYY-MM-DD\x20HH:mm:ss','queue','[ACW][START]\x20%s','message','saveUnpause','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','startAcw','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','isNil','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','[%s][BLINDTRANSFER:LINKEDID]','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','autopause','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','moment','../ami','acw','../rpc/voiceAgentReport','voiceQueues','agents','channels','agentconnect','syncAgentConnect','bind','syncHangupRequest','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','prototype','updateAcw','lastPauseAt','timers','timer','update','uniqueid','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][UPDATE][ERRORS:%s]','finally','interface','ACW','mandatoryDisposition','mandatoryDispositionPause','name','resolve','getAgent','then'];(function(_0x19903c,_0x5192e4){var _0x222a6c=function(_0x2121ae){while(--_0x2121ae){_0x19903c['push'](_0x19903c['shift']());}};_0x222a6c(++_0x5192e4);}(_0xfb65,0x82));var _0x5fb6=function(_0x3b12d3,_0x4dcab2){_0x3b12d3=_0x3b12d3-0x0;var _0xf32064=_0xfb65[_0x3b12d3];return _0xf32064;};'use strict';var _=require('lodash');var moment=require(_0x5fb6('0x0'));var ami=require(_0x5fb6('0x1'));var logger=require('../../../config/logger')(_0x5fb6('0x2'));var RpcUser=require('../rpc/user');var RpcVoiceAgentReport=require(_0x5fb6('0x3'));function Acw(_0x15d15c){this[_0x5fb6('0x4')]=_0x15d15c[_0x5fb6('0x4')];this[_0x5fb6('0x5')]=_0x15d15c[_0x5fb6('0x5')];this['timers']=_0x15d15c['timers'];this[_0x5fb6('0x6')]={};ami['on'](_0x5fb6('0x7'),this[_0x5fb6('0x8')][_0x5fb6('0x9')](this));ami['on']('hanguprequest',this[_0x5fb6('0xa')][_0x5fb6('0x9')](this));ami['on'](_0x5fb6('0xb'),this[_0x5fb6('0xc')]['bind'](this));ami['on'](_0x5fb6('0xd'),this[_0x5fb6('0xe')]['bind'](this));ami['on'](_0x5fb6('0xf'),this[_0x5fb6('0x10')][_0x5fb6('0x9')](this));ami['on'](_0x5fb6('0x11'),this[_0x5fb6('0x12')]['bind'](this));ami['on'](_0x5fb6('0x13'),this[_0x5fb6('0x14')][_0x5fb6('0x9')](this));}function getDiff(_0x41d503){var _0x6b58a2=moment()[_0x5fb6('0x15')](0x0);var _0x1a391f=moment(_0x41d503)[_0x5fb6('0x15')](0x0);return _0x6b58a2['diff'](_0x1a391f,'seconds');}Acw[_0x5fb6('0x16')][_0x5fb6('0x17')]=function(_0x58febe,_0x1d57b1){var _0x21ddd3=this;var _0x11bb78=getDiff(_0x21ddd3['timers'][_0x58febe][_0x5fb6('0x18')]);clearTimeout(_0x21ddd3[_0x5fb6('0x19')][_0x58febe][_0x5fb6('0x1a')]);_0x21ddd3[_0x5fb6('0x19')][_0x58febe][_0x5fb6('0x1a')]=![];return RpcVoiceAgentReport[_0x5fb6('0x1b')]({'acwtime':_0x11bb78},_0x21ddd3['timers'][_0x58febe][_0x5fb6('0x1c')],_0x58febe)['then'](function(_0x32f58a){logger['info'](_0x5fb6('0x1d'),_0x1d57b1,_0x11bb78,_0x32f58a);})[_0x5fb6('0x1e')](function(_0x402e8a){logger[_0x5fb6('0x1f')](_0x5fb6('0x20'),_0x1d57b1,_0x402e8a);})[_0x5fb6('0x21')](function(){delete _0x21ddd3[_0x5fb6('0x19')][_0x58febe];});};Acw['prototype']['startAcw']=function(_0xfd8d78){try{var _0x39ace4=this;var _0x48a70e=this[_0x5fb6('0x6')][_0xfd8d78][_0x5fb6('0x22')];var _0x331bba=this[_0x5fb6('0x6')][_0xfd8d78]['queue'];var _0x2fca34=this[_0x5fb6('0x4')][_0x331bba];var _0x45b484=![];var _0x20de69=_0x5fb6('0x23');if(_0x2fca34[_0x5fb6('0x24')]&&_0x2fca34['mandatoryDispositionPause']['name']){_0x45b484=!![];_0x20de69=_0x2fca34[_0x5fb6('0x25')][_0x5fb6('0x26')];}if(!_0x39ace4[_0x5fb6('0x5')][_0x48a70e]){return Promise[_0x5fb6('0x27')]();}return RpcUser[_0x5fb6('0x28')](_0x39ace4[_0x5fb6('0x5')][_0x48a70e]['id'])[_0x5fb6('0x29')](function(_0x4d6e01){if(!_0x4d6e01||_0x4d6e01[_0x5fb6('0x2a')]){logger[_0x5fb6('0x2b')](_0x5fb6('0x2c'),_0xfd8d78,_0x48a70e,_0x331bba);return;}logger['info'](_0x5fb6('0x2d'),_0xfd8d78,_0x48a70e,_0x331bba);var _0x1b4ae4=_0x39ace4['channels'][_0xfd8d78][_0x5fb6('0x2e')]&&_0x39ace4[_0x5fb6('0x6')][_0xfd8d78]['destlinkedid']?_0x39ace4[_0x5fb6('0x6')][_0xfd8d78]['destlinkedid']:_0xfd8d78;return RpcUser[_0x5fb6('0x2f')](_0x39ace4['agents'][_0x48a70e],_0x20de69,_0x1b4ae4);})['then'](function(_0x159971){if(_0x45b484||!_0x159971){return;}_0x39ace4[_0x5fb6('0x19')][_0x48a70e]={};logger[_0x5fb6('0x2b')](_0x5fb6('0x30'),_0xfd8d78,_0x39ace4[_0x5fb6('0x4')][_0x331bba][_0x5fb6('0x31')],_0x48a70e,_0x331bba);_0x39ace4['timers'][_0x48a70e][_0x5fb6('0x1a')]=setTimeout(_0x39ace4[_0x5fb6('0x32')][_0x5fb6('0x9')](_0x39ace4,_0x48a70e),_0x39ace4[_0x5fb6('0x4')][_0x331bba][_0x5fb6('0x31')]*0x3e8);_0x39ace4[_0x5fb6('0x19')][_0x48a70e][_0x5fb6('0x18')]=moment()[_0x5fb6('0x33')](_0x5fb6('0x34'));_0x39ace4[_0x5fb6('0x19')][_0x48a70e][_0x5fb6('0x1c')]=_0xfd8d78;_0x39ace4['timers'][_0x48a70e][_0x5fb6('0x35')]=_0x331bba;_0x39ace4[_0x5fb6('0x19')][_0x48a70e]['updateAcw']=_0x39ace4[_0x5fb6('0x17')]['bind'](_0x39ace4,_0x48a70e,_0xfd8d78);})['catch'](function(){logger[_0x5fb6('0x1f')](_0x5fb6('0x30'),_0xfd8d78,_0x39ace4[_0x5fb6('0x4')][_0x331bba]['acwTimeout'],_0x48a70e,_0x331bba);})[_0x5fb6('0x21')](function(){delete _0x39ace4['channels'][_0xfd8d78];});}catch(_0x5c256c){logger[_0x5fb6('0x1f')](_0x5fb6('0x36'),_0x5c256c[_0x5fb6('0x37')]);}};Acw[_0x5fb6('0x16')][_0x5fb6('0x32')]=function(_0x1b96c0){try{var _0x3a6f88=this;if(_0x3a6f88[_0x5fb6('0x19')][_0x1b96c0]){_0x3a6f88[_0x5fb6('0x19')][_0x1b96c0][_0x5fb6('0x1a')]=![];var _0x8446db=_0x3a6f88[_0x5fb6('0x19')][_0x1b96c0]['uniqueid'];var _0x245ea0=_0x3a6f88[_0x5fb6('0x19')][_0x1b96c0][_0x5fb6('0x35')];var _0x5f1e64=_0x3a6f88[_0x5fb6('0x4')][_0x245ea0]['acwTimeout'];logger[_0x5fb6('0x2b')]('[%s][TIMER][STOP][AGENT:%s]',_0x8446db,_0x1b96c0);RpcUser[_0x5fb6('0x38')](this[_0x5fb6('0x5')][_0x1b96c0]);RpcVoiceAgentReport[_0x5fb6('0x1b')]({'acwtime':_0x5f1e64,'agentacw':!![]},_0x8446db,_0x1b96c0)[_0x5fb6('0x29')](function(_0x25c38d){logger['info'](_0x5fb6('0x1d'),_0x8446db,_0x5f1e64,_0x25c38d);})[_0x5fb6('0x1e')](function(_0x3ab41f){logger[_0x5fb6('0x1f')]('[%s][UPDATE][ERRORS:%s]',_0x8446db,_0x3ab41f);});}else{logger[_0x5fb6('0x1f')](_0x5fb6('0x39'),_0x1b96c0);if(_0x3a6f88[_0x5fb6('0x19')]){logger[_0x5fb6('0x2b')](_0x5fb6('0x3a'),JSON[_0x5fb6('0x3b')](_0x3a6f88['timers']));}}}catch(_0x10c242){logger[_0x5fb6('0x1f')](_0x5fb6('0x3c'),_0x10c242[_0x5fb6('0x37')]);}};Acw[_0x5fb6('0x16')][_0x5fb6('0x8')]=function(_0xd3245f){try{if(this[_0x5fb6('0x4')][_0xd3245f[_0x5fb6('0x35')]]&&(this[_0x5fb6('0x4')][_0xd3245f[_0x5fb6('0x35')]]['acw']||this[_0x5fb6('0x4')][_0xd3245f['queue']][_0x5fb6('0x24')])){if(this[_0x5fb6('0x5')][_0xd3245f['interface']]){this[_0x5fb6('0x6')][_0xd3245f[_0x5fb6('0x1c')]]={'queue':_0xd3245f[_0x5fb6('0x35')],'interface':_0xd3245f['interface'],'destlinkedid':_0xd3245f['destlinkedid']};}}}catch(_0x39280a){logger[_0x5fb6('0x1f')](_0x5fb6('0x3d'),_0x39280a[_0x5fb6('0x37')]);}};Acw[_0x5fb6('0x16')][_0x5fb6('0x14')]=function(_0x205234){try{if(this[_0x5fb6('0x4')][_0x205234[_0x5fb6('0x35')]]&&(this[_0x5fb6('0x4')][_0x205234[_0x5fb6('0x35')]]['acw']||this[_0x5fb6('0x4')][_0x205234['queue']]['mandatoryDisposition'])){if(this[_0x5fb6('0x5')][_0x205234[_0x5fb6('0x22')]]){this[_0x5fb6('0x6')][_0x205234[_0x5fb6('0x1c')]]={'queue':_0x205234[_0x5fb6('0x35')],'interface':_0x205234[_0x5fb6('0x22')]};}}}catch(_0x45ba31){logger['error'](_0x5fb6('0x3e'),_0x45ba31[_0x5fb6('0x37')]);}};Acw['prototype'][_0x5fb6('0xa')]=function(_0x7934fd){try{if(this[_0x5fb6('0x6')][_0x7934fd[_0x5fb6('0x1c')]]&&_[_0x5fb6('0x3f')](this[_0x5fb6('0x6')][_0x7934fd[_0x5fb6('0x1c')]][_0x5fb6('0x2e')])){logger['info'](_0x5fb6('0x40'),_0x7934fd[_0x5fb6('0x1c')]);this['startAcw'](_0x7934fd[_0x5fb6('0x1c')]);}else if(this[_0x5fb6('0x6')][_0x7934fd[_0x5fb6('0x41')]]&&_[_0x5fb6('0x3f')](this['channels'][_0x7934fd['linkedid']][_0x5fb6('0x2e')])){logger[_0x5fb6('0x2b')](_0x5fb6('0x42'),_0x7934fd['linkedid']);this[_0x5fb6('0x43')](_0x7934fd['linkedid']);}}catch(_0x3293ad){logger['error'](_0x5fb6('0x44'),_0x3293ad[_0x5fb6('0x37')]);}};Acw[_0x5fb6('0x16')]['syncHangup']=function(_0x242bdf){try{if(this[_0x5fb6('0x6')][_0x242bdf[_0x5fb6('0x1c')]]&&this[_0x5fb6('0x6')][_0x242bdf[_0x5fb6('0x1c')]][_0x5fb6('0x2e')]){logger[_0x5fb6('0x2b')](_0x5fb6('0x45'),_0x242bdf[_0x5fb6('0x1c')]);this[_0x5fb6('0x43')](_0x242bdf[_0x5fb6('0x1c')]);}else if(this['channels'][_0x242bdf[_0x5fb6('0x41')]]&&this['channels'][_0x242bdf[_0x5fb6('0x41')]][_0x5fb6('0x2e')]){logger[_0x5fb6('0x2b')](_0x5fb6('0x46'),_0x242bdf[_0x5fb6('0x41')]);this[_0x5fb6('0x43')](_0x242bdf['linkedid']);}}catch(_0x51bf91){logger['error']('[ACW][syncHangup]\x20%s',_0x51bf91[_0x5fb6('0x37')]);}};Acw[_0x5fb6('0x16')][_0x5fb6('0x10')]=function(_0x2fa95b){try{if(!_['isNil'](this[_0x5fb6('0x6')][_0x2fa95b[_0x5fb6('0x47')]])){this['startAcw'](_0x2fa95b[_0x5fb6('0x47')]);if(this['channels'][_0x2fa95b[_0x5fb6('0x48')]]){this[_0x5fb6('0x6')][_0x2fa95b['secondtransfereruniqueid']][_0x5fb6('0x2e')]=!![];this[_0x5fb6('0x6')][_0x2fa95b[_0x5fb6('0x49')]]=this[_0x5fb6('0x6')][_0x2fa95b[_0x5fb6('0x48')]];delete this[_0x5fb6('0x6')][_0x2fa95b[_0x5fb6('0x48')]];}}else if(!_[_0x5fb6('0x4a')](this[_0x5fb6('0x6')][_0x2fa95b[_0x5fb6('0x49')]])){this[_0x5fb6('0x43')](_0x2fa95b['transfertargetuniqueid']);if(this[_0x5fb6('0x6')][_0x2fa95b[_0x5fb6('0x4b')]]){this[_0x5fb6('0x6')][_0x2fa95b[_0x5fb6('0x4b')]][_0x5fb6('0x2e')]=!![];this[_0x5fb6('0x6')][_0x2fa95b['transfereeuniqueid']]=this[_0x5fb6('0x6')][_0x2fa95b['origtransfereruniqueid']];delete this[_0x5fb6('0x6')][_0x2fa95b[_0x5fb6('0x4b')]];}}}catch(_0x2c5c89){logger[_0x5fb6('0x1f')](_0x5fb6('0x4c'),_0x2c5c89[_0x5fb6('0x37')]);}};Acw[_0x5fb6('0x16')][_0x5fb6('0x12')]=function(_0x5d2342){try{if(this['channels'][_0x5d2342[_0x5fb6('0x4d')]]){logger[_0x5fb6('0x2b')](_0x5fb6('0x4e'),JSON[_0x5fb6('0x3b')](_0x5d2342['transfereruniqueid']));this['startAcw'](_0x5d2342[_0x5fb6('0x4d')]);}else if(this['channels'][_0x5d2342['transfererlinkedid']]){logger[_0x5fb6('0x2b')](_0x5fb6('0x4f'),JSON[_0x5fb6('0x3b')](_0x5d2342[_0x5fb6('0x50')]));this[_0x5fb6('0x43')](_0x5d2342['transfererlinkedid']);}}catch(_0x264980){logger['error'](_0x5fb6('0x51'),_0x264980[_0x5fb6('0x37')]);}};Acw[_0x5fb6('0x16')][_0x5fb6('0xe')]=function(_0x1a1476){try{if(this[_0x5fb6('0x4')][_0x1a1476['queue']]&&this[_0x5fb6('0x4')][_0x1a1476[_0x5fb6('0x35')]][_0x5fb6('0x52')]==='all'){if(this['agents'][_0x1a1476['interface']]){logger[_0x5fb6('0x2b')](_0x5fb6('0x53'),_0x1a1476[_0x5fb6('0x1c')],_0x1a1476[_0x5fb6('0x22')],_0x1a1476[_0x5fb6('0x35')]);return RpcUser[_0x5fb6('0x2f')](this[_0x5fb6('0x5')][_0x1a1476['interface']],_0x5fb6('0x54'),_0x1a1476[_0x5fb6('0x1c')]);}}}catch(_0x3c99d2){logger[_0x5fb6('0x1f')](_0x5fb6('0x55'),_0x3c99d2['message']);}};module['exports']=Acw; \ No newline at end of file +var _0xc4aa=['moment','../ami','../../../config/logger','acw','../rpc/user','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','syncHangupRequest','bind','hangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncBlindTransfer','custom:agentConnectPreview','milliseconds','diff','seconds','prototype','updateAcw','lastPauseAt','timer','update','then','info','catch','error','[%s][UPDATE][ERRORS:%s]','finally','startAcw','interface','queue','ACW','mandatoryDisposition','mandatoryDispositionPause','name','resolve','getAgent','voicePause','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','[%s][START][AGENT:%s][QUEUE:%s]','destlinkedid','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','[ACW][START]\x20%s','message','stopAcw','[%s][UPDATE][ACWTIME:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][STOP]\x20%s','[ACW][syncAgentConnect]\x20%s','syncAgentConnectPreview','[ACW][syncAgentConnectPreview]\x20%s','attended','[%s][HANGUP:UNIQUEID]','linkedid','isUndefined','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','syncHangup','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[ACW][syncHangup]\x20%s','syncAttendedTransfer','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','stringify','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','lodash'];(function(_0x47b1a9,_0x14e74f){var _0x1be6e2=function(_0x8c39be){while(--_0x8c39be){_0x47b1a9['push'](_0x47b1a9['shift']());}};_0x1be6e2(++_0x14e74f);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0xc4aa[_0x46698a];return _0x356db0;};'use strict';var _=require(_0xac4a('0x0'));var moment=require(_0xac4a('0x1'));var ami=require(_0xac4a('0x2'));var logger=require(_0xac4a('0x3'))(_0xac4a('0x4'));var RpcUser=require(_0xac4a('0x5'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');function Acw(_0x5cda73){this['voiceQueues']=_0x5cda73[_0xac4a('0x6')];this[_0xac4a('0x7')]=_0x5cda73[_0xac4a('0x7')];this[_0xac4a('0x8')]=_0x5cda73[_0xac4a('0x8')];this[_0xac4a('0x9')]={};ami['on'](_0xac4a('0xa'),this[_0xac4a('0xb')]['bind'](this));ami['on']('hanguprequest',this[_0xac4a('0xc')][_0xac4a('0xd')](this));ami['on'](_0xac4a('0xe'),this['syncHangup'][_0xac4a('0xd')](this));ami['on'](_0xac4a('0xf'),this[_0xac4a('0x10')]['bind'](this));ami['on'](_0xac4a('0x11'),this['syncAttendedTransfer'][_0xac4a('0xd')](this));ami['on']('blindtransfer',this[_0xac4a('0x12')][_0xac4a('0xd')](this));ami['on'](_0xac4a('0x13'),this['syncAgentConnectPreview'][_0xac4a('0xd')](this));}function getDiff(_0x68424a){var _0x247b78=moment()[_0xac4a('0x14')](0x0);var _0x1b4313=moment(_0x68424a)[_0xac4a('0x14')](0x0);return _0x247b78[_0xac4a('0x15')](_0x1b4313,_0xac4a('0x16'));}Acw[_0xac4a('0x17')][_0xac4a('0x18')]=function(_0x11e101,_0x26dbb8){var _0x4a2119=this;var _0x402fff=getDiff(_0x4a2119[_0xac4a('0x8')][_0x11e101][_0xac4a('0x19')]);clearTimeout(_0x4a2119[_0xac4a('0x8')][_0x11e101][_0xac4a('0x1a')]);_0x4a2119[_0xac4a('0x8')][_0x11e101][_0xac4a('0x1a')]=![];return RpcVoiceAgentReport[_0xac4a('0x1b')]({'acwtime':_0x402fff},_0x4a2119['timers'][_0x11e101]['uniqueid'],_0x11e101)[_0xac4a('0x1c')](function(_0x13c8eb){logger[_0xac4a('0x1d')]('[%s][UPDATE][ACWTIME:%s]',_0x26dbb8,_0x402fff,_0x13c8eb);})[_0xac4a('0x1e')](function(_0x15c223){logger[_0xac4a('0x1f')](_0xac4a('0x20'),_0x26dbb8,_0x15c223);})[_0xac4a('0x21')](function(){delete _0x4a2119[_0xac4a('0x8')][_0x11e101];});};Acw[_0xac4a('0x17')][_0xac4a('0x22')]=function(_0x534092){try{var _0x3d8f0a=this;var _0x3204ad=this['channels'][_0x534092][_0xac4a('0x23')];var _0x4169c0=this[_0xac4a('0x9')][_0x534092][_0xac4a('0x24')];var _0x4d2d6c=this[_0xac4a('0x6')][_0x4169c0];var _0x2503d8=![];var _0x15435c=_0xac4a('0x25');if(_0x4d2d6c[_0xac4a('0x26')]&&_0x4d2d6c[_0xac4a('0x27')][_0xac4a('0x28')]){_0x2503d8=!![];_0x15435c=_0x4d2d6c[_0xac4a('0x27')][_0xac4a('0x28')];}if(!_0x3d8f0a[_0xac4a('0x7')][_0x3204ad]){return Promise[_0xac4a('0x29')]();}return RpcUser[_0xac4a('0x2a')](_0x3d8f0a[_0xac4a('0x7')][_0x3204ad]['id'])[_0xac4a('0x1c')](function(_0x1c13dc){if(!_0x1c13dc||_0x1c13dc[_0xac4a('0x2b')]){logger['info'](_0xac4a('0x2c'),_0x534092,_0x3204ad,_0x4169c0);return;}logger[_0xac4a('0x1d')](_0xac4a('0x2d'),_0x534092,_0x3204ad,_0x4169c0);var _0x2772fe=_0x3d8f0a[_0xac4a('0x9')][_0x534092]['attended']&&_0x3d8f0a['channels'][_0x534092][_0xac4a('0x2e')]?_0x3d8f0a[_0xac4a('0x9')][_0x534092][_0xac4a('0x2e')]:_0x534092;return RpcUser['savePause'](_0x3d8f0a['agents'][_0x3204ad],_0x15435c,_0x2772fe);})[_0xac4a('0x1c')](function(_0x2896bc){if(_0x2503d8||!_0x2896bc){return;}_0x3d8f0a[_0xac4a('0x8')][_0x3204ad]={};logger[_0xac4a('0x1d')](_0xac4a('0x2f'),_0x534092,_0x3d8f0a['voiceQueues'][_0x4169c0][_0xac4a('0x30')],_0x3204ad,_0x4169c0);_0x3d8f0a['timers'][_0x3204ad][_0xac4a('0x1a')]=setTimeout(_0x3d8f0a['stopAcw'][_0xac4a('0xd')](_0x3d8f0a,_0x3204ad),_0x3d8f0a[_0xac4a('0x6')][_0x4169c0][_0xac4a('0x30')]*0x3e8);_0x3d8f0a[_0xac4a('0x8')][_0x3204ad][_0xac4a('0x19')]=moment()[_0xac4a('0x31')](_0xac4a('0x32'));_0x3d8f0a[_0xac4a('0x8')][_0x3204ad][_0xac4a('0x33')]=_0x534092;_0x3d8f0a[_0xac4a('0x8')][_0x3204ad][_0xac4a('0x24')]=_0x4169c0;_0x3d8f0a[_0xac4a('0x8')][_0x3204ad][_0xac4a('0x18')]=_0x3d8f0a[_0xac4a('0x18')]['bind'](_0x3d8f0a,_0x3204ad,_0x534092);})[_0xac4a('0x1e')](function(){logger[_0xac4a('0x1f')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x534092,_0x3d8f0a[_0xac4a('0x6')][_0x4169c0][_0xac4a('0x30')],_0x3204ad,_0x4169c0);})['finally'](function(){delete _0x3d8f0a['channels'][_0x534092];});}catch(_0x11f0be){logger[_0xac4a('0x1f')](_0xac4a('0x34'),_0x11f0be[_0xac4a('0x35')]);}};Acw['prototype'][_0xac4a('0x36')]=function(_0x2e56c6){try{var _0x4e7630=this;if(_0x4e7630[_0xac4a('0x8')][_0x2e56c6]){_0x4e7630[_0xac4a('0x8')][_0x2e56c6][_0xac4a('0x1a')]=![];var _0x5f0eb8=_0x4e7630[_0xac4a('0x8')][_0x2e56c6][_0xac4a('0x33')];var _0x1b5427=_0x4e7630['timers'][_0x2e56c6][_0xac4a('0x24')];var _0x2e76e3=_0x4e7630['voiceQueues'][_0x1b5427]['acwTimeout'];logger[_0xac4a('0x1d')]('[%s][TIMER][STOP][AGENT:%s]',_0x5f0eb8,_0x2e56c6);RpcUser['saveUnpause'](this['agents'][_0x2e56c6]);RpcVoiceAgentReport['update']({'acwtime':_0x2e76e3,'agentacw':!![]},_0x5f0eb8,_0x2e56c6)[_0xac4a('0x1c')](function(_0x2bf8e8){logger[_0xac4a('0x1d')](_0xac4a('0x37'),_0x5f0eb8,_0x2e76e3,_0x2bf8e8);})[_0xac4a('0x1e')](function(_0x415f31){logger[_0xac4a('0x1f')](_0xac4a('0x20'),_0x5f0eb8,_0x415f31);});}else{logger[_0xac4a('0x1f')](_0xac4a('0x38'),_0x2e56c6);if(_0x4e7630[_0xac4a('0x8')]){logger[_0xac4a('0x1d')]('[ACW][TIMERS]',JSON['stringify'](_0x4e7630['timers']));}}}catch(_0x1e1cc5){logger[_0xac4a('0x1f')](_0xac4a('0x39'),_0x1e1cc5[_0xac4a('0x35')]);}};Acw[_0xac4a('0x17')][_0xac4a('0xb')]=function(_0x8febf0){try{if(this[_0xac4a('0x6')][_0x8febf0[_0xac4a('0x24')]]&&(this[_0xac4a('0x6')][_0x8febf0['queue']][_0xac4a('0x4')]||this[_0xac4a('0x6')][_0x8febf0[_0xac4a('0x24')]][_0xac4a('0x26')])){if(this[_0xac4a('0x7')][_0x8febf0['interface']]){this[_0xac4a('0x9')][_0x8febf0[_0xac4a('0x33')]]={'queue':_0x8febf0['queue'],'interface':_0x8febf0[_0xac4a('0x23')],'destlinkedid':_0x8febf0['destlinkedid']};}}}catch(_0x3dd0f8){logger[_0xac4a('0x1f')](_0xac4a('0x3a'),_0x3dd0f8[_0xac4a('0x35')]);}};Acw[_0xac4a('0x17')][_0xac4a('0x3b')]=function(_0xe54edf){try{if(this[_0xac4a('0x6')][_0xe54edf[_0xac4a('0x24')]]&&(this[_0xac4a('0x6')][_0xe54edf[_0xac4a('0x24')]][_0xac4a('0x4')]||this['voiceQueues'][_0xe54edf[_0xac4a('0x24')]][_0xac4a('0x26')])){if(this[_0xac4a('0x7')][_0xe54edf['interface']]){this[_0xac4a('0x9')][_0xe54edf[_0xac4a('0x33')]]={'queue':_0xe54edf['queue'],'interface':_0xe54edf[_0xac4a('0x23')]};}}}catch(_0x5a7f6e){logger[_0xac4a('0x1f')](_0xac4a('0x3c'),_0x5a7f6e[_0xac4a('0x35')]);}};Acw['prototype']['syncHangupRequest']=function(_0x42fd9d){try{if(this['channels'][_0x42fd9d[_0xac4a('0x33')]]&&_['isUndefined'](this[_0xac4a('0x9')][_0x42fd9d['uniqueid']][_0xac4a('0x3d')])){logger[_0xac4a('0x1d')](_0xac4a('0x3e'),_0x42fd9d[_0xac4a('0x33')]);this['startAcw'](_0x42fd9d[_0xac4a('0x33')]);}else if(this[_0xac4a('0x9')][_0x42fd9d[_0xac4a('0x3f')]]&&_[_0xac4a('0x40')](this[_0xac4a('0x9')][_0x42fd9d[_0xac4a('0x3f')]][_0xac4a('0x3d')])){logger['info'](_0xac4a('0x41'),_0x42fd9d[_0xac4a('0x3f')]);this['startAcw'](_0x42fd9d[_0xac4a('0x3f')]);}}catch(_0x44dcb8){logger[_0xac4a('0x1f')](_0xac4a('0x42'),_0x44dcb8['message']);}};Acw[_0xac4a('0x17')][_0xac4a('0x43')]=function(_0x2d8db8){try{if(this[_0xac4a('0x9')][_0x2d8db8[_0xac4a('0x33')]]&&this['channels'][_0x2d8db8[_0xac4a('0x33')]]['attended']){logger[_0xac4a('0x1d')](_0xac4a('0x44'),_0x2d8db8['uniqueid']);this['startAcw'](_0x2d8db8[_0xac4a('0x33')]);}else if(this[_0xac4a('0x9')][_0x2d8db8['linkedid']]&&this[_0xac4a('0x9')][_0x2d8db8[_0xac4a('0x3f')]][_0xac4a('0x3d')]){logger[_0xac4a('0x1d')]('[%s][HANGUPATTENDEDTRANSFER:LINKEDID]',_0x2d8db8[_0xac4a('0x3f')]);this[_0xac4a('0x22')](_0x2d8db8[_0xac4a('0x3f')]);}}catch(_0xb5897b){logger[_0xac4a('0x1f')](_0xac4a('0x45'),_0xb5897b[_0xac4a('0x35')]);}};Acw['prototype'][_0xac4a('0x46')]=function(_0xef51d0){try{if(!_[_0xac4a('0x47')](this[_0xac4a('0x9')][_0xef51d0[_0xac4a('0x48')]])){this[_0xac4a('0x22')](_0xef51d0[_0xac4a('0x48')]);if(this[_0xac4a('0x9')][_0xef51d0[_0xac4a('0x49')]]){this[_0xac4a('0x9')][_0xef51d0[_0xac4a('0x49')]][_0xac4a('0x3d')]=!![];this[_0xac4a('0x9')][_0xef51d0[_0xac4a('0x4a')]]=this[_0xac4a('0x9')][_0xef51d0[_0xac4a('0x49')]];delete this['channels'][_0xef51d0[_0xac4a('0x49')]];}}else if(!_['isNil'](this[_0xac4a('0x9')][_0xef51d0['transfertargetuniqueid']])){this[_0xac4a('0x22')](_0xef51d0['transfertargetuniqueid']);if(this[_0xac4a('0x9')][_0xef51d0['origtransfereruniqueid']]){this['channels'][_0xef51d0[_0xac4a('0x4b')]][_0xac4a('0x3d')]=!![];this[_0xac4a('0x9')][_0xef51d0[_0xac4a('0x48')]]=this[_0xac4a('0x9')][_0xef51d0[_0xac4a('0x4b')]];delete this['channels'][_0xef51d0[_0xac4a('0x4b')]];}}}catch(_0x50dece){logger[_0xac4a('0x1f')]('[ACW][syncAttendedTransfer]\x20%s',_0x50dece[_0xac4a('0x35')]);}};Acw[_0xac4a('0x17')][_0xac4a('0x12')]=function(_0x1306c5){try{if(this[_0xac4a('0x9')][_0x1306c5[_0xac4a('0x4c')]]){logger[_0xac4a('0x1d')](_0xac4a('0x4d'),JSON[_0xac4a('0x4e')](_0x1306c5[_0xac4a('0x4c')]));this[_0xac4a('0x22')](_0x1306c5[_0xac4a('0x4c')]);}else if(this[_0xac4a('0x9')][_0x1306c5[_0xac4a('0x4f')]]){logger[_0xac4a('0x1d')](_0xac4a('0x50'),JSON[_0xac4a('0x4e')](_0x1306c5['transfererlinkedid']));this[_0xac4a('0x22')](_0x1306c5[_0xac4a('0x4f')]);}}catch(_0x4fb812){logger[_0xac4a('0x1f')](_0xac4a('0x51'),_0x4fb812[_0xac4a('0x35')]);}};Acw[_0xac4a('0x17')][_0xac4a('0x10')]=function(_0x4d1440){try{if(this['voiceQueues'][_0x4d1440[_0xac4a('0x24')]]&&this[_0xac4a('0x6')][_0x4d1440[_0xac4a('0x24')]][_0xac4a('0x52')]===_0xac4a('0x53')){if(this[_0xac4a('0x7')][_0x4d1440[_0xac4a('0x23')]]){logger[_0xac4a('0x1d')](_0xac4a('0x54'),_0x4d1440[_0xac4a('0x33')],_0x4d1440[_0xac4a('0x23')],_0x4d1440['queue']);return RpcUser['savePause'](this[_0xac4a('0x7')][_0x4d1440[_0xac4a('0x23')]],_0xac4a('0x55'),_0x4d1440[_0xac4a('0x33')]);}}}catch(_0x663a97){logger[_0xac4a('0x1f')](_0xac4a('0x56'),_0x663a97[_0xac4a('0x35')]);}};module[_0xac4a('0x57')]=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index 93fd11c..04daa54 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 _0x33a4=['ami','../../config/environment','port','asterisk','username','password','keepConnected','promisify','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','sipshowregistry','actionDeviceStateList','Action','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','actionCoreShowChannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','inspect','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','catch','exports','asterisk-manager','bluebird','util','../../config/logger'];(function(_0x1bfc54,_0x32f479){var _0x32d184=function(_0x2690ca){while(--_0x2690ca){_0x1bfc54['push'](_0x1bfc54['shift']());}};_0x32d184(++_0x32f479);}(_0x33a4,0x178));var _0x433a=function(_0xfcde,_0xae1e0e){_0xfcde=_0xfcde-0x0;var _0x5a0b4d=_0x33a4[_0xfcde];return _0x5a0b4d;};'use strict';var Manager=require(_0x433a('0x0'));var BPromise=require(_0x433a('0x1'));var util=require(_0x433a('0x2'));var logger=require(_0x433a('0x3'))(_0x433a('0x4'));var config=require(_0x433a('0x5'));var ami=new Manager(config['asterisk'][_0x433a('0x6')],config[_0x433a('0x7')]['ip'],config[_0x433a('0x7')][_0x433a('0x8')],config[_0x433a('0x7')][_0x433a('0x9')],!![]);ami[_0x433a('0xa')]();ami['Action']=BPromise[_0x433a('0xb')](ami[_0x433a('0xc')]);function error(_0x307d76){logger[_0x433a('0xd')](util[_0x433a('0xe')](_0x433a('0xf'),config[_0x433a('0x7')][_0x433a('0x8')],config[_0x433a('0x7')]['ip'],config[_0x433a('0x7')]['port'],util['inspect'](_0x307d76,![],null)));}function close(){logger[_0x433a('0xd')](util[_0x433a('0xe')](_0x433a('0x10'),config[_0x433a('0x7')][_0x433a('0x8')],config[_0x433a('0x7')]['ip'],config[_0x433a('0x7')][_0x433a('0x6')]));}ami[_0x433a('0x11')]=function(){return function(){return ami['Action']({'action':_0x433a('0x12')});};};ami[_0x433a('0x13')]=function(){return function(){return ami[_0x433a('0x14')]({'action':'devicestatelist'});};};ami[_0x433a('0x15')]=function(){return function(){return ami[_0x433a('0x14')]({'action':_0x433a('0x16')});};};ami[_0x433a('0x17')]=function(){return function(){return ami[_0x433a('0x14')]({'action':_0x433a('0x18')});};};ami[_0x433a('0x19')]=function(){return function(){return ami[_0x433a('0x14')]({'action':'coreshowchannels'});};};function connect(){logger[_0x433a('0x1a')](util['format'](_0x433a('0x1b'),config[_0x433a('0x7')][_0x433a('0x8')],config[_0x433a('0x7')]['ip'],config[_0x433a('0x7')][_0x433a('0x6')]));ami['once']('error',error);ami[_0x433a('0x1c')](_0x433a('0x1d'),close);}ami['on']('connect',connect);ami['on'](_0x433a('0x1e'),function(_0x473e0c){logger[_0x433a('0x1a')](util[_0x433a('0xe')](_0x433a('0x1f'),config[_0x433a('0x7')][_0x433a('0x8')],config['asterisk']['ip'],config[_0x433a('0x7')][_0x433a('0x6')],util[_0x433a('0x20')](_0x473e0c,![],null)));});ami['on']('fullybooted',function(){logger['info'](util['format'](_0x433a('0x21'),config[_0x433a('0x7')][_0x433a('0x8')],config[_0x433a('0x7')]['ip'],config['asterisk'][_0x433a('0x6')]));return Promise[_0x433a('0x22')]()[_0x433a('0x23')](ami[_0x433a('0x11')]())['then'](ami[_0x433a('0x13')]())[_0x433a('0x23')](ami[_0x433a('0x15')]())['then'](ami[_0x433a('0x17')]())[_0x433a('0x23')](ami[_0x433a('0x19')]())[_0x433a('0x24')](function(_0x28669c){logger[_0x433a('0xd')]('[ami.js][fullybooted]',util[_0x433a('0x20')](_0x28669c,{'showHidden':![],'depth':null}));});});ami[_0x433a('0x1c')](_0x433a('0xd'),error);ami[_0x433a('0x1c')](_0x433a('0x1d'),close);module[_0x433a('0x25')]=ami; \ No newline at end of file +var _0x00df=['[ami.js][fullybooted]','once','close','bluebird','util','../../config/logger','ami','../../config/environment','port','asterisk','username','keepConnected','promisify','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','Action','sipshowregistry','actionQueueSummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','then','actionDeviceStateList','catch'];(function(_0x5a7112,_0x1f9492){var _0x3147f7=function(_0x4d2329){while(--_0x4d2329){_0x5a7112['push'](_0x5a7112['shift']());}};_0x3147f7(++_0x1f9492);}(_0x00df,0x19b));var _0xf00d=function(_0x456df5,_0x215a5b){_0x456df5=_0x456df5-0x0;var _0x48adfd=_0x00df[_0x456df5];return _0x48adfd;};'use strict';var Manager=require('asterisk-manager');var BPromise=require(_0xf00d('0x0'));var util=require(_0xf00d('0x1'));var logger=require(_0xf00d('0x2'))(_0xf00d('0x3'));var config=require(_0xf00d('0x4'));var ami=new Manager(config['asterisk'][_0xf00d('0x5')],config[_0xf00d('0x6')]['ip'],config[_0xf00d('0x6')][_0xf00d('0x7')],config[_0xf00d('0x6')]['password'],!![]);ami[_0xf00d('0x8')]();ami['Action']=BPromise[_0xf00d('0x9')](ami[_0xf00d('0xa')]);function error(_0x3add53){logger[_0xf00d('0xb')](util[_0xf00d('0xc')](_0xf00d('0xd'),config[_0xf00d('0x6')]['username'],config[_0xf00d('0x6')]['ip'],config[_0xf00d('0x6')][_0xf00d('0x5')],util[_0xf00d('0xe')](_0x3add53,![],null)));}function close(){logger[_0xf00d('0xb')](util['format'](_0xf00d('0xf'),config[_0xf00d('0x6')][_0xf00d('0x7')],config['asterisk']['ip'],config['asterisk']['port']));}ami[_0xf00d('0x10')]=function(){return function(){return ami[_0xf00d('0x11')]({'action':_0xf00d('0x12')});};};ami['actionDeviceStateList']=function(){return function(){return ami[_0xf00d('0x11')]({'action':'devicestatelist'});};};ami['actionSipPeerStatus']=function(){return function(){return ami[_0xf00d('0x11')]({'action':'sippeerstatus'});};};ami[_0xf00d('0x13')]=function(){return function(){return ami['Action']({'action':'queuesummary'});};};ami[_0xf00d('0x14')]=function(){return function(){return ami[_0xf00d('0x11')]({'action':_0xf00d('0x15')});};};function connect(){logger[_0xf00d('0x16')](util[_0xf00d('0xc')](_0xf00d('0x17'),config['asterisk'][_0xf00d('0x7')],config[_0xf00d('0x6')]['ip'],config['asterisk'][_0xf00d('0x5')]));ami['once']('error',error);ami['once']('close',close);}ami['on']('connect',connect);ami['on'](_0xf00d('0x18'),function(_0xdabe07){logger['info'](util[_0xf00d('0xc')](_0xf00d('0x19'),config[_0xf00d('0x6')][_0xf00d('0x7')],config[_0xf00d('0x6')]['ip'],config[_0xf00d('0x6')][_0xf00d('0x5')],util['inspect'](_0xdabe07,![],null)));});ami['on'](_0xf00d('0x1a'),function(){logger['info'](util['format'](_0xf00d('0x1b'),config[_0xf00d('0x6')][_0xf00d('0x7')],config[_0xf00d('0x6')]['ip'],config[_0xf00d('0x6')][_0xf00d('0x5')]));return Promise['resolve']()[_0xf00d('0x1c')](ami['actionSipShowRegistry']())[_0xf00d('0x1c')](ami[_0xf00d('0x1d')]())['then'](ami['actionSipPeerStatus']())[_0xf00d('0x1c')](ami[_0xf00d('0x13')]())[_0xf00d('0x1c')](ami[_0xf00d('0x14')]())[_0xf00d('0x1e')](function(_0x543503){logger[_0xf00d('0xb')](_0xf00d('0x1f'),util[_0xf00d('0xe')](_0x543503,{'showHidden':![],'depth':null}));});});ami[_0xf00d('0x20')](_0xf00d('0xb'),error);ami[_0xf00d('0x20')](_0xf00d('0x21'),close);module['exports']=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index 34afd10..76d5f14 100644 --- a/server/services/ami/client.js +++ b/server/services/ami/client.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb43b=['catch','exports','jayson/promise','bluebird','ami','client','http','rpc','memberReport','error','message','result'];(function(_0x3b1aec,_0x4a66ff){var _0x574c45=function(_0x4c5495){while(--_0x4c5495){_0x3b1aec['push'](_0x3b1aec['shift']());}};_0x574c45(++_0x4a66ff);}(_0xb43b,0x1b2));var _0xbb43=function(_0x41285f,_0x1cc4c3){_0x41285f=_0x41285f-0x0;var _0x23cfc3=_0xb43b[_0x41285f];return _0x23cfc3;};'use strict';var jayson=require(_0xbb43('0x0'));var BPromise=require(_0xbb43('0x1'));var logger=require('../../config/logger')(_0xbb43('0x2'));var client=jayson[_0xbb43('0x3')][_0xbb43('0x4')]({'port':0x2329});client['Request']=function(_0x131e9e,_0x41aff6){return new BPromise(function(_0x351254,_0x16432a){return client['request'](_0x131e9e,_0x41aff6)['then'](function(_0x378df5){logger['debug'](_0xbb43('0x5'),_0xbb43('0x6'),_0x131e9e,_0x41aff6,_0x378df5);if(_0x378df5[_0xbb43('0x7')]){logger[_0xbb43('0x7')](_0xbb43('0x5'),'memberReport',_0x131e9e,_0x378df5[_0xbb43('0x7')][_0xbb43('0x8')],_0x41aff6);return _0x16432a(_0x378df5['error'][_0xbb43('0x8')]);}else{return _0x351254(_0x378df5[_0xbb43('0x9')]);}})[_0xbb43('0xa')](function(_0x5e3611){logger[_0xbb43('0x7')](_0xbb43('0x5'),'memberReport',_0x131e9e,_0x5e3611,_0x41aff6);return _0x16432a(_0x5e3611);});});};module[_0xbb43('0xb')]=client; \ No newline at end of file +var _0xaa88=['bluebird','../../config/logger','ami','http','Request','rpc','memberReport','error','message','result','catch','jayson/promise'];(function(_0x417b30,_0x2546e2){var _0x39eac5=function(_0x8c7a00){while(--_0x8c7a00){_0x417b30['push'](_0x417b30['shift']());}};_0x39eac5(++_0x2546e2);}(_0xaa88,0x137));var _0x8aa8=function(_0x58ae8a,_0x3c619e){_0x58ae8a=_0x58ae8a-0x0;var _0x2f0b6b=_0xaa88[_0x58ae8a];return _0x2f0b6b;};'use strict';var jayson=require(_0x8aa8('0x0'));var BPromise=require(_0x8aa8('0x1'));var logger=require(_0x8aa8('0x2'))(_0x8aa8('0x3'));var client=jayson['client'][_0x8aa8('0x4')]({'port':0x2329});client[_0x8aa8('0x5')]=function(_0x43f7e4,_0x3b2c88){return new BPromise(function(_0x3e3b70,_0x350e8b){return client['request'](_0x43f7e4,_0x3b2c88)['then'](function(_0x460042){logger['debug'](_0x8aa8('0x6'),_0x8aa8('0x7'),_0x43f7e4,_0x3b2c88,_0x460042);if(_0x460042[_0x8aa8('0x8')]){logger[_0x8aa8('0x8')]('rpc',_0x8aa8('0x7'),_0x43f7e4,_0x460042[_0x8aa8('0x8')][_0x8aa8('0x9')],_0x3b2c88);return _0x350e8b(_0x460042['error'][_0x8aa8('0x9')]);}else{return _0x3e3b70(_0x460042[_0x8aa8('0xa')]);}})[_0x8aa8('0xb')](function(_0x33cc5c){logger['error'](_0x8aa8('0x6'),_0x8aa8('0x7'),_0x43f7e4,_0x33cc5c,_0x3b2c88);return _0x350e8b(_0x33cc5c);});});};module['exports']=client; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index 8ebcfe0..d76e290 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 _0xbc2b=['stateGlobal','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','dialMachineRetryFrequency','HangupInAMD','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','countcongestionretry','[rescheduleContact][Machine]','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','AGI','moveContactManagedDialer','Unknow','running','isPreviewCampaign','statusMessage','available','inUse','talking','pTalking','ACTIVE','compareToOutboundQueue','queueSummaryCountersUpdated','assign','[syncQueueSummary]','syncQueueSummaryComplete','throttle','filter','dialPreviewRecallmeReminder','online','reachable','resolve','handlePreviewRecallNotifications','map','user:%s','user:dialPreviewRecallReminder','checkPreviewRecallReminder','clearZombieChannels','[uniqueid]','[actions]','undefined','No\x20such\x20channel','[Dialer][checkChannel][ivr]','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','originated','[updateOriginated]\x20is\x20null\x20or\x20undefined','emptyContact','notFound','UserId','[emptyContact][createHistory]','[emptyContact]','Agent','handleIvr','object','voiceQueue\x20is\x20undefine','phone','originate','contact\x20is\x20undefine','NONE','isOutboundQueue','\x22%s,%s%s,,,%s\x22','dialQueueOptions','dialQueueTimeout','XMD-AMDINITIALSILENCE','XMD-AMDGREETING','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','setXMDContactVariables','Contact','getCallerId','callerid','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','extractCalleridName','XMD-ORIGINATECALLERIDNUM','variables','dialPrefix','trim','dialCutDigit','substring','SIP/%s/%s%s','from-sip','dialOriginateTimeout','[originateError]:\x20%s','[originate][error]','checkRetriveMax','dialNoAnswerMaxRetry','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialAgentRejectMaxRetry','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','outboundNoSuchCallsDay','NoSuchNumber','custom:agentnosuchnumber','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','buildNoAnswerEventPayload','dialNoAnswerRetryFrequency','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','Busy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','Congestion','custom:agentcongestion','congestion','dialCongestionMaxRetry','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','dialAgentRejectRetryFrequency','custom:agentreject','agentreject','outboundUnknownCallsDay','Global','[moveContactManagedDialer][0]','dialPredictiveOptimizationPercentage','outboundDropCallsDayTimeout','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','round','predictiveIntervalMinThreshold','floor','predictiveIntervalMultiplicativeFactor','check\x20predictive\x20is\x20not\x20undefine','[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]','Drop\x20in\x20this\x20interval','avgHandleTime','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval',')\x20are\x20less\x20than\x20threshold\x20(','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20more\x20than\x20threshold\x20(','getDataPredictive','predictiveIntervalAnsweredCalls','predictiveIntervalHitRate','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','getDataPredictiveOld','loggedIn','outboundQueuePauses','[CatchErlangB]','predictiveIntervalPauses','check\x20failure','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','[booked][checkContactBlack]','queueStatusComplete:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','Queue:\x20','actionOriginate','scheduledat','voicePause','unlockContact','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','QUEUE_RECALL','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALL_TIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','BLACKLIST','Blacklist','[Originate][MoveBlacklist]','limitCalls','temp','getContactDialerIvr','checkContactEmpty','ivrTotalCallsDays','[actionOriginate]\x20','checkIsBlackListIvr','checkContactBlack','loggerHandler','[getContactCampaign2]','dialLimitQueue','not_inuse','getContactDialer','RUNNING','checkIsBlackList','tryOriginatePredictive','[handlePredictive][limitChannel]','countReScheduled','[countReScheduled]\x20','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','erlangb','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','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','lodash','uuid','moment','ioredis','./utils','./utils/hopper','../preview/util/util','../../../config/environment/','../../../config/logger','dialer','booked','predictive','predictiveCalls','syncQueueSummary','../ami','redis','defaults','localhost','socket.io-emitter','../rpc/interval','./models/action','./models/final','./models/agentComplete','./models/queueCallerAbandon','XCALLY_IP_AGI','prototype','enqueue','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','uniqueId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','queuesSummary','agentconnect','syncAgentConnect','bind','syncQueueCallerAbandon','originateresponse','agentcomplete','custom:queuesummary','syncHangup','syncNewExten','varset','syncVarSet','syncQueueMember','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','getSettings','then','previewRecallmeReminderInterval','emit','type','outbound','debug','inspect','format','voice:queue:%s','name','isEmpty','info','-----\x20Stats\x20Predictive\x20---','predictiveIntervalTotalCalls','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsTimeout','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','---------------------------','isUndefined','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCalls','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','merge','getSeconds','startProgressive\x20value\x20cleared','handlePredictive','error','stack','checkContactLowerLimitOriginate','contactsRescheduled','message','CAMPAIGN_STATUS','CONTACTS_RESCHEDULED','[getContactDialer2][ReScheduled]','contacts','NO_AVAILABLE_CONTACTS','[getContactDialer2][Empty]','state','statedesc','starttime','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','stringify','pick','Interval','NULL_INTERVAL','\x20INTERVAL_IS_NULL','Intervals','INACTIVE','\x20NOT\x20Active','isIVRCampaign','campaign:ivr:%s','campaign:save','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20not\x20active','is\x20disactive','[ifTime][Action]','Error','isTrunkReachable','active','SIP/%s','status','unmonitored','Trunk','TrunkBackup','TRUNK_NOT_REACHABLE','ifTimeIvr','checkIfTimeIntervals','ifTime','Failure','\x20Intervals\x20is\x20null\x20','EMPTY_INTERVAL','\x20Intervals\x20is\x20empty\x20','UNKNOWN_TIMEZONE','\x20Timezone\x20unknow\x20','isArray','length','push','Action','interval','timezones','content','indexOf','true','command','catch','all','some','OVERTIME_INTERVAL','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','resetActiveCalls','syncCampaigns','isIVRCampaignActive','checkIsTrunkReachable','checkIfTime','dialGlobalInterval','dialTimezone','launchHandleIvr','[syncCampaigns]','checkDialMethod','dialMethod','progressive','handlePower','dialPowerLevel','Queue','method\x20not\x20recognized','silly','Dialer::ifTime()','OVERTIME_GLOBAL_INTERVAL','Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:','AMI\x20IfTime','queue','uniqueid','ivr','updateOriginated','answertime','YYYY-MM-DD\x20HH:mm:ss','syncAgentComplete','outboundAnswerCallsDay','reason','agent','agiafterat','dialQueueProject2','createHistory','[syncAgentComplete][createHistory]','[syncAgentComplete]','droptime','responsetime','predictiveIntervalErlangCallsDroppedCalls','Drop','dropreason','countdropretry','countglobal','dialDropRetryFrequency','callAdditionalPhoneAfterMin','verifyAdditionalPhones','dialDropMaxRetry','queueCallerAbandonCreateState','rescheduleContact','add','minutes','ContactId','ListId','VoiceQueueId','[rescheduleContact][Drop]','calleridnum','[syncAgentComplete][createHistory][10]','swapAdditionalPhones','CALLEREXIT','countabandonedretry','dialAbandonedRetryFrequency','voiceQueue','dialAbandonedMaxRetry','additional','CampaignId','[rescheduleContact][Abandoned]','Abandoned','endtime','calleridname','[syncAgentComplete][createHistory][11]','channel','actionid','strategy','isNil','locked','paused','stateinterface','rrmemory','idHopper','roundrobin','run','[unlock][syncQueueStatusComplete]','_rr','[booked][RR]','Agent:\x20','unlockRR','contactAgent-idHopper:\x20','[Catch][Preview][syncQueueStatusComplete]','[booked][unlock]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','syncOriginateResponse','getQueue','response','Success','callProgressDetecting','[callProgressDetecting]\x20','amdstatus','exten','xcally-motion-dialer','dialAMDActive','value','HANGUP','outboundAnswerAgiCallsDay','membername','custom:amd','buildObj','saveInDb','[syncHangupInAMD]','MACHINE','Machine','AMD','amd','[syncAgentComplete][createHistory][0]','countbusyretry','countnoanswerretry','countnosuchnumberretry','countmachineretry','countagentrejectretry','dialGlobalMaxRetry'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0xbc2b,0xfa));var _0xbbc2=function(_0x192caf,_0x363f32){_0x192caf=_0x192caf-0x0;var _0x58fb05=_0xbc2b[_0x192caf];return _0x58fb05;};'use strict';var util=require(_0xbbc2('0x0'));var _=require(_0xbbc2('0x1'));var uuid=require(_0xbbc2('0x2'));var moment=require(_0xbbc2('0x3'));var rr=require('rr');var Redis=require(_0xbbc2('0x4'));var utils=require(_0xbbc2('0x5'));var hopperUtils=require(_0xbbc2('0x6'));var ut=require(_0xbbc2('0x7'));var config=require(_0xbbc2('0x8'));var logger=require(_0xbbc2('0x9'))(_0xbbc2('0xa'));var loggerBooked=require('../../../config/logger')(_0xbbc2('0xb'));var loggerPredictive=require('../../../config/logger')(_0xbbc2('0xc'));var loggerPredictiveCalls=require(_0xbbc2('0x9'))(_0xbbc2('0xd'));var loggerSyncQueueSummary=require(_0xbbc2('0x9'))(_0xbbc2('0xe'));var ami=require(_0xbbc2('0xf'));config[_0xbbc2('0x10')]=_[_0xbbc2('0x11')](config[_0xbbc2('0x10')],{'host':_0xbbc2('0x12'),'port':0x18eb});var io=require(_0xbbc2('0x13'))(new Redis(config[_0xbbc2('0x10')]));var cmHopper=require('../rpc/cmHopper');var voiceQueueRt=require('../rpc/voiceQueueRt');var RpcSetting=require('../rpc/setting');var Interval=require(_0xbbc2('0x14'));var Action=require(_0xbbc2('0x15'));var History=require('./models/history');var Final=require(_0xbbc2('0x16'));var AgentComplete=require(_0xbbc2('0x17'));var QueueCallerAbandon=require(_0xbbc2('0x18'));var Hangup=require('./models/hangup');var ipAgi=process['env'][_0xbbc2('0x19')]||'127.0.0.1';var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0xbbc2('0x1a')][_0xbbc2('0x1b')]=function(_0x1bf6ba){this[_0xbbc2('0x1c')]=this[_0xbbc2('0x1c')]?this[_0xbbc2('0x1c')][_0xbbc2('0x1d')](_0x1bf6ba):_0x1bf6ba();};function Dialer(_0x5cfa10,_0x1ef84a){this[_0xbbc2('0x1e')]=new Sequence();this[_0xbbc2('0x1f')]=_0x1ef84a;this[_0xbbc2('0x20')]=_0x5cfa10[_0xbbc2('0x20')];this[_0xbbc2('0x21')]=_0x5cfa10['campaigns'];this[_0xbbc2('0x22')]=_0x5cfa10[_0xbbc2('0x22')];this[_0xbbc2('0x23')]=_0x5cfa10[_0xbbc2('0x23')];this[_0xbbc2('0x24')]=config[_0xbbc2('0x24')]||0x2;this[_0xbbc2('0x25')]={};this[_0xbbc2('0x26')]={};this[_0xbbc2('0x27')]={};this[_0xbbc2('0x28')]={};this[_0xbbc2('0x29')]={};this[_0xbbc2('0x2a')]={};this[_0xbbc2('0x2b')]={};this[_0xbbc2('0x2c')]={};this[_0xbbc2('0x2d')]={};this[_0xbbc2('0x2e')]={};this[_0xbbc2('0x2f')]={};ami['on'](_0xbbc2('0x30'),this[_0xbbc2('0x31')][_0xbbc2('0x32')](this));ami['on']('queuecallerabandon',this[_0xbbc2('0x33')]['bind'](this));ami['on'](_0xbbc2('0x34'),this['syncOriginateResponse'][_0xbbc2('0x32')](this));ami['on'](_0xbbc2('0x35'),this['syncAgentComplete'][_0xbbc2('0x32')](this));ami['on'](_0xbbc2('0x36'),this['syncQueueSummary']['bind'](this));ami['on']('custom:queuesummarycomplete',this['syncQueueSummaryComplete'][_0xbbc2('0x32')](this));ami['on']('hangup',this[_0xbbc2('0x37')][_0xbbc2('0x32')](this));ami['on']('newexten',this[_0xbbc2('0x38')][_0xbbc2('0x32')](this));ami['on'](_0xbbc2('0x39'),this[_0xbbc2('0x3a')]['bind'](this));ami['on']('queuemember',this[_0xbbc2('0x3b')][_0xbbc2('0x32')](this));ami['on']('queuestatuscomplete',this[_0xbbc2('0x3c')]['bind'](this));this[_0xbbc2('0x3d')]();this[_0xbbc2('0x3e')]();RpcSetting[_0xbbc2('0x3f')]()[_0xbbc2('0x40')](function(_0x415a68){previewRecallmeReminderInterval=_0x415a68[_0xbbc2('0x41')];});}function isNotNull(_0x116997){return _0x116997!==null&&!_['isUndefined'](_0x116997);}function msgResponse(_0x39f9ea,_0x437ee7,_0x1e0797){return{'action':_0x39f9ea,'response':_0x437ee7,'message':_0x1e0797,'stack':_0x1e0797};}function emit(_0x117cbb,_0x46cbe2,_0x25a2dc){io['to'](_0x117cbb)[_0xbbc2('0x42')](_0x46cbe2,_0x25a2dc);}function emitOutboundVoiceQueueSummary(_0x2bd13f){if(_0x2bd13f[_0xbbc2('0x43')]===_0xbbc2('0x44')){logger[_0xbbc2('0x45')]('[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:',util[_0xbbc2('0x46')](_0x2bd13f,{'showHidden':![],'depth':null}));emit(util[_0xbbc2('0x47')](_0xbbc2('0x48'),_0x2bd13f[_0xbbc2('0x49')]),'voice_queue:save',_0x2bd13f);}}function checkGetDataPredictive(_0x3ebc56){if(isNotNull(_0x3ebc56)&&!_[_0xbbc2('0x4a')](_0x3ebc56)){loggerPredictive[_0xbbc2('0x4b')](_0xbbc2('0x4c'));loggerPredictive['info']('Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3ebc56[_0xbbc2('0x4d')]);loggerPredictive[_0xbbc2('0x4b')](_0xbbc2('0x4e'),_0x3ebc56['predictiveIntervalAnsweredCalls']);loggerPredictive['info'](_0xbbc2('0x4f'),_0x3ebc56[_0xbbc2('0x50')]);loggerPredictive[_0xbbc2('0x4b')](_0xbbc2('0x51'),_0x3ebc56[_0xbbc2('0x52')]);loggerPredictive[_0xbbc2('0x4b')]('AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3ebc56[_0xbbc2('0x53')]);loggerPredictive[_0xbbc2('0x4b')]('AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3ebc56[_0xbbc2('0x54')]);loggerPredictive[_0xbbc2('0x4b')](_0xbbc2('0x55'));if(_0x3ebc56[_0xbbc2('0x4d')]>0x0){if(!_[_0xbbc2('0x56')](_0x3ebc56[_0xbbc2('0x54')])&&_0x3ebc56[_0xbbc2('0x54')]>0x0){return!![];}loggerPredictive[_0xbbc2('0x4b')](_0xbbc2('0x57'));if(!_['isUndefined'](_0x3ebc56['predictiveIntervalAvgHoldtime'])&&_0x3ebc56['predictiveIntervalAvgHoldtime']>0x0){return!![];}loggerPredictive[_0xbbc2('0x4b')](_0xbbc2('0x58'));}else{loggerPredictive['info'](_0xbbc2('0x59'));}}else{loggerPredictive[_0xbbc2('0x4b')]('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0x37e74c){return function(_0x2f01cd){loggerPredictive[_0xbbc2('0x4b')]('---------\x20ErlangB\x20---------');loggerPredictive[_0xbbc2('0x4b')](_0xbbc2('0x5a'),_0x2f01cd[_0xbbc2('0x5b')]);loggerPredictive[_0xbbc2('0x4b')]('One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2f01cd[_0xbbc2('0x5c')]);loggerPredictive[_0xbbc2('0x4b')](_0xbbc2('0x5d'),_0x2f01cd[_0xbbc2('0x5e')]);loggerPredictive[_0xbbc2('0x4b')](_0xbbc2('0x5f'),_0x2f01cd['erlangBusyFactor']);loggerPredictive[_0xbbc2('0x4b')](_0xbbc2('0x5d'),_0x2f01cd[_0xbbc2('0x5e')]);loggerPredictive[_0xbbc2('0x4b')](_0xbbc2('0x55'));_[_0xbbc2('0x60')](_0x37e74c,_0x2f01cd);};}function ifInterval(_0x1107a0,_0x449934){if(_['isUndefined'](_0x449934)){return![];}return utils[_0xbbc2('0x61')](undefined,_0x449934)<_0x1107a0*0x3c;}function clearPredictiveAttributes(_0xc2294){if(_0xc2294[_0xbbc2('0x2b')]){_0xc2294[_0xbbc2('0x2b')]=undefined;loggerPredictive[_0xbbc2('0x45')](_0xc2294[_0xbbc2('0x49')],_0xbbc2('0x62'));}if(_0xc2294['startPredictive']){_0xc2294[_0xbbc2('0x2a')]=undefined;loggerPredictive[_0xbbc2('0x45')](_0xc2294[_0xbbc2('0x49')],'startPredictive\x20value\x20cleared');}if(_0xc2294['handlePredictive']){clearInterval(_0xc2294['handlePredictive']);_0xc2294[_0xbbc2('0x63')]=undefined;loggerPredictive[_0xbbc2('0x45')](_0xc2294[_0xbbc2('0x49')],'handlePredictive\x20interval\x20cleared');}}function loggerCatchPredictive(_0x1a0aef,_0x40646d){return function(_0x523101){loggerPredictive['error'](_0x40646d[_0xbbc2('0x49')],_0x1a0aef);loggerPredictive[_0xbbc2('0x64')](_0x523101[_0xbbc2('0x65')]);clearPredictiveAttributes(_0x40646d);};}function loggerCatch(_0x31ca5d){return function(_0x26184e){logger[_0xbbc2('0x64')](_0x31ca5d,util['inspect'](_0x26184e,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0x35c18b,_0x547a4d,_0x1a31f0){return function(_0x4e852d){utils[_0xbbc2('0x66')](_0x547a4d,_0x1a31f0,0x0);logger[_0xbbc2('0x64')](_0x35c18b,util[_0xbbc2('0x46')](_0x4e852d,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x16cb8c){return function(_0xf8bb13){if(isNotNull(_0xf8bb13)&&isNotNull(_0xf8bb13[0x0])){if(_0xf8bb13[0x0][_0xbbc2('0x67')]>0x0){_0x16cb8c[_0xbbc2('0x68')]=utils[_0xbbc2('0x69')][_0xbbc2('0x6a')];logger[_0xbbc2('0x4b')](_0xbbc2('0x6b')+_0x16cb8c[_0xbbc2('0x49')],_0xf8bb13[0x0][_0xbbc2('0x67')],_0xbbc2('0x6c'));}else{_0x16cb8c[_0xbbc2('0x68')]=utils[_0xbbc2('0x69')][_0xbbc2('0x6d')];logger[_0xbbc2('0x4b')](_0xbbc2('0x6e')+_0x16cb8c[_0xbbc2('0x49')]);}}};}function createObjHistory(_0x51fd44,_0x3b2fea,_0x95c8c9,_0x3dd94f,_0x24b16a){_0x51fd44['message']=_0x95c8c9;var _0xdf13c1=new Action(_0x51fd44,_0x3b2fea);var _0x2b718d=new History(_0xdf13c1);_0x2b718d[_0xbbc2('0x6f')]=_0x3dd94f;_0x2b718d[_0xbbc2('0x70')]=_0x24b16a;_0x2b718d['endtime']=_0xdf13c1[_0xbbc2('0x71')];return _0x2b718d;}function unlockQueueStatus(_0x29a487,_0x336670){setTimeout(function(){if(_[_0xbbc2('0x56')](_0x29a487[_0xbbc2('0x72')])){loggerBooked['error'](_0xbbc2('0x73'),_0x336670);}_0x29a487[_0xbbc2('0x72')]=!![];loggerBooked[_0xbbc2('0x4b')](_0xbbc2('0x74'),_0x336670,JSON[_0xbbc2('0x75')](_[_0xbbc2('0x76')](_0x29a487,[_0xbbc2('0x49'),_0xbbc2('0x72')])));},0x1f3);}function checkInterval(_0xf8af20){return function(){if(!isNotNull(_0xf8af20[_0xbbc2('0x77')])){_0xf8af20[_0xbbc2('0x68')]=utils[_0xbbc2('0x69')][_0xbbc2('0x78')];throw _0xf8af20[_0xbbc2('0x49')]+_0xbbc2('0x79');}if(!isNotNull(_0xf8af20[_0xbbc2('0x77')][_0xbbc2('0x7a')])){_0xf8af20[_0xbbc2('0x68')]=utils['CAMPAIGN_STATUS'][_0xbbc2('0x78')];throw _0xf8af20[_0xbbc2('0x49')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_[_0xbbc2('0x4a')](_0xf8af20[_0xbbc2('0x77')][_0xbbc2('0x7a')]))){_0xf8af20[_0xbbc2('0x68')]=utils[_0xbbc2('0x69')]['NULL_INTERVAL'];throw _0xf8af20[_0xbbc2('0x49')]+_0xbbc2('0x79');}};}function checkIsIVRCampaignActive(_0x1b1f1c){return function(){if(!utils['isIVRCampaignActive'](_0x1b1f1c)){_0x1b1f1c[_0xbbc2('0x68')]=utils['CAMPAIGN_STATUS'][_0xbbc2('0x7b')];throw _0x1b1f1c[_0xbbc2('0x49')]+_0xbbc2('0x7c');}};}function emitCampaignSummary(_0x388d22){if(utils[_0xbbc2('0x7d')](_0x388d22)){emit(util[_0xbbc2('0x47')](_0xbbc2('0x7e'),_0x388d22['name']),_0xbbc2('0x7f'),_0x388d22);}}function loggerCatchQueueSummary(_0x5045ad,_0x3e40b6){return function(_0x2dc05e){clearPredictiveAttributes(_0x3e40b6);emitCampaignSummary(_0x3e40b6);loggerSyncQueueSummary[_0xbbc2('0x45')](_0x5045ad,util[_0xbbc2('0x46')](_0x2dc05e,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0x2af0b6){if(_0x2af0b6[_0xbbc2('0x80')]){if(_0x2af0b6['originated']===0x0){_0x2af0b6[_0xbbc2('0x80')]=![];_0x2af0b6[_0xbbc2('0x68')]=utils['CAMPAIGN_STATUS'][_0xbbc2('0x7b')];loggerSyncQueueSummary[_0xbbc2('0x45')](_0xbbc2('0x81'),_0x2af0b6[_0xbbc2('0x49')],_0xbbc2('0x82'));}else{_0x2af0b6[_0xbbc2('0x68')]=utils['CAMPAIGN_STATUS']['DISACTIVED'];loggerSyncQueueSummary[_0xbbc2('0x45')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x2af0b6[_0xbbc2('0x49')],_0xbbc2('0x83'));}emitCampaignSummary(_0x2af0b6);}}function myreject(_0x7a0f74){return function(_0x3f18cb){return _0x7a0f74(msgResponse(_0xbbc2('0x84'),_0xbbc2('0x85'),JSON[_0xbbc2('0x75')](_0x3f18cb)));};}Dialer[_0xbbc2('0x1a')][_0xbbc2('0x86')]=function(_0x3c3ed1){return!_[_0xbbc2('0x56')](_0x3c3ed1)&&_0x3c3ed1&&!_[_0xbbc2('0x56')](_0x3c3ed1[_0xbbc2('0x49')])&&!_['isUndefined'](_0x3c3ed1[_0xbbc2('0x87')])&&_0x3c3ed1['active']&&(this[_0xbbc2('0x23')][util['format'](_0xbbc2('0x88'),_0x3c3ed1['name'])][_0xbbc2('0x89')]==='reachable'||this['trunks'][util['format'](_0xbbc2('0x88'),_0x3c3ed1[_0xbbc2('0x49')])][_0xbbc2('0x89')]===_0xbbc2('0x8a'));};Dialer[_0xbbc2('0x1a')]['checkIsTrunkReachable']=function(_0x120abf){var _0x31bc00=this;return function(){if(!_0x31bc00['isTrunkReachable'](_0x120abf[_0xbbc2('0x8b')])){if(!_0x31bc00[_0xbbc2('0x86')](_0x120abf[_0xbbc2('0x8c')])){_0x120abf[_0xbbc2('0x68')]=utils[_0xbbc2('0x69')][_0xbbc2('0x8d')];throw _0x120abf[_0xbbc2('0x49')]+'\x20trunk\x20is\x20not\x20reachable';}}};};Dialer['prototype']['checkIfTime']=function(_0x568a04,_0x45cf66,_0xf595c9,_0x5ae551){var _0x4625fc=this;return function(){var _0x2fa1bd=!![];return _0x4625fc[_0xbbc2('0x8e')](_0x568a04,_0x45cf66,_0xf595c9,_0x5ae551,_0x2fa1bd);};};Dialer['prototype'][_0xbbc2('0x8f')]=function(_0x2e0f21,_0x387369,_0x571e7e,_0x4701de){var _0x5e54e9=this;return function(){var _0x39d530=![];return _0x5e54e9[_0xbbc2('0x8e')](_0x2e0f21['Intervals'],_0x387369,_0x571e7e,_0x4701de,_0x39d530);};};Dialer[_0xbbc2('0x1a')][_0xbbc2('0x8e')]=function(_0x3d841c,_0x5aa710,_0x580716,_0x2f728b,_0x160886){var _0x1f3065=[];return new Promise(function(_0x5f20ec,_0x1564d7){if(!isNotNull(_0x3d841c)){_0x2f728b[_0xbbc2('0x68')]=utils[_0xbbc2('0x69')][_0xbbc2('0x78')];return _0x1564d7(msgResponse(_0xbbc2('0x90'),_0xbbc2('0x91'),_0x580716+_0xbbc2('0x92')));}if(_[_0xbbc2('0x4a')](_0x3d841c)){_0x2f728b[_0xbbc2('0x68')]=utils[_0xbbc2('0x69')][_0xbbc2('0x93')];return _0x1564d7(msgResponse(_0xbbc2('0x90'),_0xbbc2('0x91'),_0x580716+_0xbbc2('0x94')));}if(_0x5aa710&&_[_0xbbc2('0x56')](config['timezones'][_0x5aa710])){_0x2f728b[_0xbbc2('0x68')]=utils[_0xbbc2('0x69')][_0xbbc2('0x95')];return _0x1564d7(msgResponse(_0xbbc2('0x90'),_0xbbc2('0x91'),_0x580716+_0xbbc2('0x96')+_0x5aa710));}if(_[_0xbbc2('0x97')](_0x3d841c)){for(var _0x407aff=0x0;_0x407aff<_0x3d841c[_0xbbc2('0x98')];_0x407aff+=0x1){_0x1f3065[_0xbbc2('0x99')](ami[_0xbbc2('0x9a')]({'action':'command','command':util[_0xbbc2('0x47')]('iftime\x20%s,%s',_0x3d841c[_0x407aff][_0xbbc2('0x9b')],!_[_0xbbc2('0x56')](config[_0xbbc2('0x9c')][_0x5aa710])?_0x5aa710:'')})[_0xbbc2('0x40')](function(_0x3376f8){return _0x3376f8[_0xbbc2('0x9d')][_0xbbc2('0x9e')](_0xbbc2('0x9f'))>=0x0;})['catch'](myreject(_0x1564d7)));}}else{_0x1f3065[_0xbbc2('0x99')](ami[_0xbbc2('0x9a')]({'action':_0xbbc2('0xa0'),'command':util['format']('iftime\x20%s,%s',_0x3d841c,!_[_0xbbc2('0x56')](config[_0xbbc2('0x9c')][_0x5aa710])?_0x5aa710:'')})[_0xbbc2('0x40')](function(_0x2e0721){return _0x2e0721[_0xbbc2('0x9d')]['indexOf'](_0xbbc2('0x9f'))>=0x0;})[_0xbbc2('0xa1')](myreject(_0x1564d7)));}Promise[_0xbbc2('0xa2')](_0x1f3065)[_0xbbc2('0x40')](function(_0x300707){var _0x559a20=_[_0xbbc2('0xa3')](_0x300707);if(_0x559a20){return _0x5f20ec(_0x559a20);}else{_0x2f728b[_0xbbc2('0x68')]=_0x160886?utils[_0xbbc2('0x69')]['OVERTIME_GLOBAL_INTERVAL']:utils[_0xbbc2('0x69')][_0xbbc2('0xa4')];return _0x1564d7(msgResponse(_0xbbc2('0xa5'),_0xbbc2('0x91'),_0xbbc2('0xa6')+_0x160886+'\x20'+_0x580716+_0xbbc2('0xa7')+util[_0xbbc2('0x46')](_0x3d841c,{'showHidden':![],'depth':null})+_0xbbc2('0xa8')+_0x5aa710));}})[_0xbbc2('0xa1')](function(_0x306d49){return _0x1564d7(msgResponse('ifTime','Failure',JSON['stringify'](_0x306d49)));});});};Dialer[_0xbbc2('0x1a')][_0xbbc2('0x3d')]=function(){var _0x541966=this;return cmHopper[_0xbbc2('0xa9')]({'active':![]},{'where':{'active':!![]}})[_0xbbc2('0x40')](function(){setInterval(function(){_0x541966[_0xbbc2('0xaa')]();},0x3e8);});};Dialer[_0xbbc2('0x1a')][_0xbbc2('0xaa')]=function(){var _0x21d27e=this;var _0x267d69;for(var _0x5602a2 in this[_0xbbc2('0x21')]){if(typeof this[_0xbbc2('0x21')][_0x5602a2]!=='undefined'){_0x267d69=this[_0xbbc2('0x21')][_0x5602a2];if(utils[_0xbbc2('0x7d')](_0x267d69)&&utils[_0xbbc2('0xab')](_0x267d69)){_0x267d69['sendMessageOneNotActive']=!![];Promise['resolve']()[_0xbbc2('0x40')](checkIsIVRCampaignActive(_0x267d69))[_0xbbc2('0x40')](checkInterval(_0x267d69))['then'](_0x21d27e[_0xbbc2('0xac')](_0x267d69))[_0xbbc2('0x40')](_0x21d27e[_0xbbc2('0xad')](_0x267d69[_0xbbc2('0xae')],_0x267d69[_0xbbc2('0xaf')],_0x267d69[_0xbbc2('0x49')],_0x267d69))[_0xbbc2('0x40')](_0x21d27e[_0xbbc2('0x8f')](_0x267d69[_0xbbc2('0x77')],_0x267d69['dialTimezone'],_0x267d69[_0xbbc2('0x49')],_0x267d69))[_0xbbc2('0x40')](_0x21d27e[_0xbbc2('0xb0')](_0x267d69))[_0xbbc2('0xa1')](loggerCatchQueueSummary(_0xbbc2('0xb1'),_0x267d69));}else{notSendMessagesCampaign(_0x267d69);}}}};Dialer[_0xbbc2('0x1a')][_0xbbc2('0xb2')]=function(_0x15feda){if(_0x15feda[_0xbbc2('0xb3')]!==_0xbbc2('0xc')){clearPredictiveAttributes(_0x15feda);}switch(_0x15feda[_0xbbc2('0xb3')]){case _0xbbc2('0xb4'):this['handlePower'](_0x15feda,0x1);break;case'power':this[_0xbbc2('0xb5')](_0x15feda,_0x15feda[_0xbbc2('0xb6')]);break;case _0xbbc2('0xc'):this[_0xbbc2('0xc')](_0x15feda);break;case'booked':this[_0xbbc2('0xb5')](_0x15feda,0x1);break;default:logger[_0xbbc2('0x64')](_0xbbc2('0xb7'),_0x15feda['name'],_0xbbc2('0xb8'));}};Dialer[_0xbbc2('0x1a')][_0xbbc2('0x90')]=function(_0x2a0e4e,_0x516068){var _0x30d31a=_0x2a0e4e[_0xbbc2('0xaf')];var _0x593bcc=_0x516068?_0x2a0e4e[_0xbbc2('0xae')]:_0x2a0e4e['Interval'][_0xbbc2('0x7a')];logger[_0xbbc2('0xb9')](_0xbbc2('0xba'),_0x593bcc,_0x30d31a,_0x2a0e4e[_0xbbc2('0x49')],util[_0xbbc2('0x47')]('Voice\x20Queue\x20%s\x20$s',_0x2a0e4e[_0xbbc2('0x49')],_0x2a0e4e['id']));var _0x521a68=null;return Interval['intervalIftime'](_0x593bcc,_0x30d31a)['then'](function(_0x3aeabe){if(_0x3aeabe===!![]){return _0x3aeabe;}else{_0x2a0e4e[_0xbbc2('0x68')]=_0x516068?utils[_0xbbc2('0x69')][_0xbbc2('0xbb')]:utils['CAMPAIGN_STATUS'][_0xbbc2('0xa4')];_0x521a68=msgResponse(_0xbbc2('0xa5'),_0xbbc2('0x91'),_0xbbc2('0xa6')+_0x516068+'\x20'+_0x2a0e4e[_0xbbc2('0x49')]+_0xbbc2('0xa7')+util[_0xbbc2('0x46')](_0x593bcc,{'showHidden':![],'depth':null})+_0xbbc2('0xa8')+_0x30d31a);}if(_0x521a68!==null){logger[_0xbbc2('0xb9')](_0xbbc2('0xbc'),_0x521a68);_0x521a68['isGlobal']=_0x516068;throw _0x521a68;}})[_0xbbc2('0xa1')](function(_0x5d4818){logger['error'](_0xbbc2('0xbd'),_0x5d4818);throw msgResponse(_0xbbc2('0x84'),_0xbbc2('0x85'),util['inspect'](_0x5d4818,{'showHidden':![],'depth':null}));});};Dialer[_0xbbc2('0x1a')][_0xbbc2('0x31')]=function(_0x44c72c){if(this[_0xbbc2('0x20')][_0x44c72c[_0xbbc2('0xbe')]]){if(this[_0xbbc2('0x28')][_0x44c72c[_0xbbc2('0xbf')]]&&this['uniqueId'][_0x44c72c[_0xbbc2('0xbf')]][_0xbbc2('0x43')]!==_0xbbc2('0xc0')){this[_0xbbc2('0xc1')](this['voiceQueues'][_0x44c72c[_0xbbc2('0xbe')]]);this[_0xbbc2('0x28')][_0x44c72c[_0xbbc2('0xbf')]][_0xbbc2('0xc2')]=moment()[_0xbbc2('0x47')](_0xbbc2('0xc3'));}}};Dialer[_0xbbc2('0x1a')][_0xbbc2('0xc4')]=function(_0x153ece){var _0x53ebaf=this['uniqueId'][_0x153ece[_0xbbc2('0xbf')]];if(this['voiceQueues'][_0x153ece[_0xbbc2('0xbe')]]){if(_0x53ebaf&&_0x53ebaf[_0xbbc2('0x43')]!=='ivr'){delete this[_0xbbc2('0x28')][_0x153ece[_0xbbc2('0xbf')]];this[_0xbbc2('0x20')][_0x153ece[_0xbbc2('0xbe')]][_0xbbc2('0xc5')]+=0x1;var _0xcf664c=new AgentComplete(_0x53ebaf,_0x153ece);if(_0x153ece[_0xbbc2('0xc6')]===_0xbbc2('0xc7')){_0xcf664c[_0xbbc2('0xc8')]=this['voiceQueues'][_0x153ece[_0xbbc2('0xbe')]][_0xbbc2('0xc9')]&&this[_0xbbc2('0x20')][_0x153ece[_0xbbc2('0xbe')]]['dialAgiAfterHangupAgent']?moment()[_0xbbc2('0x47')](_0xbbc2('0xc3')):undefined;}hopperUtils[_0xbbc2('0xca')](_0xcf664c)[_0xbbc2('0xa1')](loggerCatch(_0xbbc2('0xcb')));hopperUtils['moveContactManagedDialer'](_0xcf664c)[_0xbbc2('0xa1')](loggerCatch(_0xbbc2('0xcc')));}}};Dialer['prototype'][_0xbbc2('0x33')]=function(_0x21e821){var _0x2cc9b8=this[_0xbbc2('0x28')][_0x21e821[_0xbbc2('0xbf')]];var _0x599a47=this;var _0x4e4959=![];var _0x5288c1;var _0x97ef9b;if(this[_0xbbc2('0x20')][_0x21e821[_0xbbc2('0xbe')]]){if(_0x2cc9b8&&_0x2cc9b8[_0xbbc2('0x43')]!==_0xbbc2('0xc0')){delete this['uniqueId'][_0x21e821[_0xbbc2('0xbf')]];this['updateOriginated'](this[_0xbbc2('0x20')][_0x21e821[_0xbbc2('0xbe')]]);_0x2cc9b8[_0xbbc2('0xcd')]=moment()[_0xbbc2('0x47')](_0xbbc2('0xc3'));var _0x261d69=new QueueCallerAbandon(_0x2cc9b8,_0x21e821);if(utils[_0xbbc2('0x61')](_0x2cc9b8[_0xbbc2('0xcd')],_0x2cc9b8[_0xbbc2('0xce')])>=_0x2cc9b8['dialQueueTimeout']){this[_0xbbc2('0x20')][_0x21e821[_0xbbc2('0xbe')]][_0xbbc2('0x50')]+=0x1;this['voiceQueues'][_0x21e821[_0xbbc2('0xbe')]]['outboundDropCallsDayTimeout']+=0x1;this[_0xbbc2('0x20')][_0x21e821['queue']][_0xbbc2('0xcf')]+=0x1;_0x261d69[_0xbbc2('0x6f')]=0xa;_0x261d69[_0xbbc2('0x70')]=_0xbbc2('0xd0');_0x261d69[_0xbbc2('0xd1')]='TIMEOUT';_0x261d69[_0xbbc2('0xc8')]=this[_0xbbc2('0x20')][_0x21e821[_0xbbc2('0xbe')]][_0xbbc2('0xc9')]?moment()['format'](_0xbbc2('0xc3')):undefined;_0x261d69[_0xbbc2('0xd2')]+=0x1;_0x261d69[_0xbbc2('0xd3')]+=0x1;_0x5288c1=this['voiceQueues'][_0x21e821['queue']][_0xbbc2('0xd4')];_0x97ef9b=this['voiceQueues'][_0x21e821[_0xbbc2('0xbe')]][_0xbbc2('0xd5')];hopperUtils[_0xbbc2('0xd6')](_0x261d69,_0x261d69['state'],_0x2cc9b8['voiceQueue'])[_0xbbc2('0x40')](function(_0x260c68){_0x4e4959=_0x260c68['additional']==0x1;if(_0x261d69[_0xbbc2('0xd2')]>=_0x599a47['voiceQueues'][_0x21e821[_0xbbc2('0xbe')]][_0xbbc2('0xd7')]){_0x599a47[_0xbbc2('0xd8')](_0x261d69,_0x260c68['additional']);}else{hopperUtils[_0xbbc2('0xd9')]({'active':![],'countdropretry':_0x261d69[_0xbbc2('0xd2')],'scheduledat':moment()[_0xbbc2('0xda')](_0x599a47[_0xbbc2('0x20')][_0x21e821[_0xbbc2('0xbe')]][_0xbbc2('0xd4')],_0xbbc2('0xdb'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x2cc9b8[_0xbbc2('0xdc')],'ListId':_0x2cc9b8[_0xbbc2('0xdd')],'VoiceQueueId':_0x2cc9b8[_0xbbc2('0xde')]||undefined,'CampaignId':_0x2cc9b8['CampaignId']||undefined})['catch'](loggerCatch(_0xbbc2('0xdf')));var _0x3c2be6=new History(_0x261d69);_0x3c2be6[_0xbbc2('0x6f')]=0xa;_0x3c2be6[_0xbbc2('0x70')]=_0xbbc2('0xd0');_0x3c2be6[_0xbbc2('0x71')]=moment()[_0xbbc2('0x47')](_0xbbc2('0xc3'));_0x3c2be6['endtime']=_0x3c2be6[_0xbbc2('0x71')];_0x3c2be6['calleridname']=_0x261d69['calleridname'];_0x3c2be6[_0xbbc2('0xe0')]=_0x261d69[_0xbbc2('0xe0')];hopperUtils['createHistory'](_0x3c2be6)[_0xbbc2('0xa1')](loggerCatch(_0xbbc2('0xe1')));}})[_0xbbc2('0x40')](function(){if(_0x4e4959)hopperUtils[_0xbbc2('0xe2')](_0x261d69,_0x5288c1,_0x97ef9b)[_0xbbc2('0x40')](function(){return 0x1;});});}else{this['voiceQueues'][_0x21e821['queue']]['predictiveIntervalDroppedCallsCallersExit']+=0x1;this['voiceQueues'][_0x21e821[_0xbbc2('0xbe')]]['outboundDropCallsDayCallersExit']+=0x1;_0x261d69[_0xbbc2('0x6f')]=0xb;_0x261d69[_0xbbc2('0x70')]='Abandoned';_0x261d69[_0xbbc2('0xd1')]=_0xbbc2('0xe3');_0x261d69[_0xbbc2('0xe4')]+=0x1;_0x261d69[_0xbbc2('0xd3')]+=0x1;_0x5288c1=this['voiceQueues'][_0x21e821[_0xbbc2('0xbe')]][_0xbbc2('0xe5')];_0x97ef9b=this[_0xbbc2('0x20')][_0x21e821[_0xbbc2('0xbe')]]['callAdditionalPhoneAfterMin'];hopperUtils[_0xbbc2('0xd6')](_0x261d69,_0x261d69['state'],_0x2cc9b8[_0xbbc2('0xe6')])[_0xbbc2('0x40')](function(_0x710716){if(_0x261d69['countabandonedretry']>=_0x599a47[_0xbbc2('0x20')][_0x21e821[_0xbbc2('0xbe')]][_0xbbc2('0xe7')]){_0x599a47['queueCallerAbandonCreateState'](_0x261d69,_0x710716[_0xbbc2('0xe8')]);}else{hopperUtils[_0xbbc2('0xd9')]({'active':![],'countabandonedretry':_0x261d69[_0xbbc2('0xe4')],'scheduledat':moment()[_0xbbc2('0xda')](_0x599a47[_0xbbc2('0x20')][_0x21e821[_0xbbc2('0xbe')]][_0xbbc2('0xe5')],_0xbbc2('0xdb'))[_0xbbc2('0x47')](_0xbbc2('0xc3')),'ContactId':_0x2cc9b8[_0xbbc2('0xdc')],'ListId':_0x2cc9b8[_0xbbc2('0xdd')],'VoiceQueueId':_0x2cc9b8[_0xbbc2('0xde')]||undefined,'CampaignId':_0x2cc9b8[_0xbbc2('0xe9')]||undefined})[_0xbbc2('0xa1')](loggerCatch(_0xbbc2('0xea')));var _0x5e7af7=new History(_0x261d69);_0x5e7af7[_0xbbc2('0x6f')]=0xb;_0x5e7af7['statedesc']=_0xbbc2('0xeb');_0x5e7af7[_0xbbc2('0x71')]=moment()[_0xbbc2('0x47')](_0xbbc2('0xc3'));_0x5e7af7[_0xbbc2('0xec')]=_0x5e7af7['starttime'];_0x5e7af7[_0xbbc2('0xed')]=_0x261d69[_0xbbc2('0xed')];_0x5e7af7[_0xbbc2('0xe0')]=_0x261d69[_0xbbc2('0xe0')];hopperUtils['createHistory'](_0x5e7af7)[_0xbbc2('0xa1')](loggerCatch(_0xbbc2('0xee')));}})[_0xbbc2('0x40')](function(){if(_0x4e4959)hopperUtils['swapAdditionalPhones'](_0x261d69,_0x5288c1,_0x97ef9b)[_0xbbc2('0x40')](function(){return 0x1;});});}}}};Dialer[_0xbbc2('0x1a')][_0xbbc2('0x38')]=function(_0x38fcae){if(this[_0xbbc2('0x26')][_0x38fcae[_0xbbc2('0xbf')]]){this[_0xbbc2('0x26')][_0x38fcae[_0xbbc2('0xbf')]]['channel']=_0x38fcae[_0xbbc2('0xef')];}if(this['uniqueId'][_0x38fcae[_0xbbc2('0xbf')]]){this[_0xbbc2('0x28')][_0x38fcae[_0xbbc2('0xbf')]]['channel']=_0x38fcae[_0xbbc2('0xef')];}};Dialer[_0xbbc2('0x1a')]['syncQueueMember']=function(_0x344e47){if(!this[_0xbbc2('0x26')][_0x344e47[_0xbbc2('0xf0')]]){return;}var _0x80a38e=this[_0xbbc2('0x20')][this[_0xbbc2('0x26')][_0x344e47[_0xbbc2('0xf0')]][_0xbbc2('0xbe')]][_0xbbc2('0xf1')]||'rrmemory';if(_0x80a38e==='roundrobin'){if(this[_0xbbc2('0x26')][_0x344e47['actionid']]&&_[_0xbbc2('0xf2')](this['actions'][_0x344e47[_0xbbc2('0xf0')]][_0xbbc2('0xf3')])&&_0x344e47[_0xbbc2('0x89')]==='1'&&_0x344e47[_0xbbc2('0xf4')]==='0'){if(this[_0xbbc2('0x22')][_0x344e47['stateinterface']]){if(!this[_0xbbc2('0x22')][_0x344e47[_0xbbc2('0xf5')]]['locked']){this['agents'][_0x344e47['stateinterface']][_0xbbc2('0xf3')]=!![];this['actions'][_0x344e47[_0xbbc2('0xf0')]]['locked']=!![];this['actions'][_0x344e47[_0xbbc2('0xf0')]][_0xbbc2('0xf5')]=_0x344e47[_0xbbc2('0xf5')];}}}}else if(_0x80a38e===_0xbbc2('0xf6')){if(this['actions'][_0x344e47[_0xbbc2('0xf0')]]){if(this['agents'][_0x344e47['stateinterface']]){this[_0xbbc2('0x26')][_0x344e47[_0xbbc2('0xf0')]][_0xbbc2('0xf5')]=_0x344e47[_0xbbc2('0xf5')];if(_[_0xbbc2('0xf2')](this['queueBooked'][this['actions'][_0x344e47[_0xbbc2('0xf0')]]['queue']])){this['queueBooked'][this['actions'][_0x344e47[_0xbbc2('0xf0')]]['queue']]=[];}this[_0xbbc2('0x2d')][this['actions'][_0x344e47['actionid']][_0xbbc2('0xbe')]][_0xbbc2('0x99')](_[_0xbbc2('0x60')](_[_0xbbc2('0x76')](this[_0xbbc2('0x26')][_0x344e47[_0xbbc2('0xf0')]],[_0xbbc2('0xf7'),'stateinterface']),{'status':_0x344e47[_0xbbc2('0x89')],'paused':_0x344e47[_0xbbc2('0xf4')]}));}}}};Dialer[_0xbbc2('0x1a')][_0xbbc2('0x3c')]=function(_0x59aab9){if(!this[_0xbbc2('0x26')][_0x59aab9[_0xbbc2('0xf0')]]){return;}var _0x4a7dbe=this;var _0x53f811=this[_0xbbc2('0x20')][this[_0xbbc2('0x26')][_0x59aab9['actionid']][_0xbbc2('0xbe')]];var _0x5c5918=_0x53f811[_0xbbc2('0xf1')]||_0xbbc2('0xf6');if(_0x5c5918===_0xbbc2('0xf8')){if(this[_0xbbc2('0x26')][_0x59aab9['actionid']]&&this['actions'][_0x59aab9[_0xbbc2('0xf0')]][_0xbbc2('0xf5')]){this['preview'][_0xbbc2('0xf9')](this['actions'][_0x59aab9['actionid']][_0xbbc2('0xf7')],this[_0xbbc2('0x26')][_0x59aab9[_0xbbc2('0xf0')]]['stateinterface'])[_0xbbc2('0xa1')](function(_0x5ce143){logger[_0xbbc2('0x64')]('[Catch][Preview][syncQueueStatusComplete]',util[_0xbbc2('0x46')](_0x5ce143,{'showHidden':![],'depth':null}));})[_0xbbc2('0x1d')](function(){_0x4a7dbe['updateOriginated'](_0x4a7dbe['voiceQueues'][_0x4a7dbe[_0xbbc2('0x26')][_0x59aab9[_0xbbc2('0xf0')]][_0xbbc2('0xbe')]]);_0x4a7dbe['agents'][_0x4a7dbe['actions'][_0x59aab9[_0xbbc2('0xf0')]][_0xbbc2('0xf5')]]['locked']=![];delete _0x4a7dbe['actions'][_0x59aab9[_0xbbc2('0xf0')]];unlockQueueStatus(_0x53f811);});}else{this[_0xbbc2('0xc1')](this[_0xbbc2('0x20')][this[_0xbbc2('0x26')][_0x59aab9[_0xbbc2('0xf0')]]['queue']]);hopperUtils['rescheduleContact']({'active':![],'ContactId':this[_0xbbc2('0x26')][_0x59aab9['actionid']][_0xbbc2('0xdc')],'ListId':this[_0xbbc2('0x26')][_0x59aab9[_0xbbc2('0xf0')]]['ListId'],'VoiceQueueId':this['actions'][_0x59aab9[_0xbbc2('0xf0')]][_0xbbc2('0xde')]||undefined,'CampaignId':this[_0xbbc2('0x26')][_0x59aab9[_0xbbc2('0xf0')]]['CampaignId']||undefined})['catch'](loggerCatch(_0xbbc2('0xfa')));delete this['actions'][_0x59aab9[_0xbbc2('0xf0')]];unlockQueueStatus(_0x53f811);}}else if(_0x5c5918===_0xbbc2('0xf6')){var _0x4dc564;if(this[_0xbbc2('0x26')][_0x59aab9[_0xbbc2('0xf0')]]&&!_[_0xbbc2('0x4a')](this[_0xbbc2('0x2d')][this[_0xbbc2('0x26')][_0x59aab9[_0xbbc2('0xf0')]][_0xbbc2('0xbe')]])){if(this['queueBookedRR'][_0x4a7dbe[_0xbbc2('0x26')][_0x59aab9[_0xbbc2('0xf0')]][_0xbbc2('0xbe')]]){this[_0xbbc2('0x2e')][_0x4a7dbe[_0xbbc2('0x26')][_0x59aab9[_0xbbc2('0xf0')]][_0xbbc2('0xbe')]]=this['queueBookedRR'][this[_0xbbc2('0x26')][_0x59aab9[_0xbbc2('0xf0')]][_0xbbc2('0xbe')]]?this[_0xbbc2('0x2e')][this[_0xbbc2('0x26')][_0x59aab9[_0xbbc2('0xf0')]][_0xbbc2('0xbe')]]:this['queueBooked'][this[_0xbbc2('0x26')][_0x59aab9['actionid']][_0xbbc2('0xbe')]]?this[_0xbbc2('0x2d')][this['actions'][_0x59aab9[_0xbbc2('0xf0')]][_0xbbc2('0xbe')]]['_rr']||0x0:0x0;}this['queueBooked'][this[_0xbbc2('0x26')][_0x59aab9[_0xbbc2('0xf0')]][_0xbbc2('0xbe')]][_0xbbc2('0xfb')]=this[_0xbbc2('0x2e')][this[_0xbbc2('0x26')][_0x59aab9[_0xbbc2('0xf0')]][_0xbbc2('0xbe')]];for(var _0x257245=0x0;_0x257245=_0x11b232[_0xbbc2('0x121')]){_0x3195cb[_0xbbc2('0x122')](_0x2f76a6,_0xb8c157,_0x38a1c4,_0xbbc2('0x123'));}else{if(_0x2f76a6[_0xbbc2('0x11f')]>=_0x11b232[_0xbbc2('0x124')]){_0x3195cb[_0xbbc2('0x125')](_0x2f76a6,_0xb8c157,_0x38a1c4,_0xbbc2('0x126'));}else{hopperUtils[_0xbbc2('0xd9')]({'active':![],'countmachineretry':_0x2f76a6[_0xbbc2('0x11f')],'scheduledat':moment()[_0xbbc2('0xda')](_0x11b232[_0xbbc2('0x127')],_0xbbc2('0xdb'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x2f76a6[_0xbbc2('0xdc')],'ListId':_0x2f76a6[_0xbbc2('0xdd')],'VoiceQueueId':_0x2f76a6['VoiceQueueId']||undefined,'CampaignId':_0x2f76a6[_0xbbc2('0xe9')]||undefined})[_0xbbc2('0xa1')](loggerCatch('[rescheduleContact][Machine]'));_0xb8c157({'reschedule':0x1});}}});}if(_0x1b341f[_0xbbc2('0x43')]===_0xbbc2('0xc0')&&this[_0xbbc2('0x21')][_0x1b341f[_0xbbc2('0xbe')]]['dialAMDActive']&&_0x1b1eeb[_0xbbc2('0x10f')]===_0xbbc2('0x110')){delete this[_0xbbc2('0x28')][_0x1b1eeb['uniqueid']];this[_0xbbc2('0xc1')](this[_0xbbc2('0x21')][_0x1b341f[_0xbbc2('0xbe')]]);_0xc882c2=new Hangup(_0x1b341f,_0x1b1eeb);_0xc882c2[_0xbbc2('0x6f')]=0x12;_0xc882c2['statedesc']=_0xbbc2('0x128');_0xc882c2[_0xbbc2('0x112')]=_0xbbc2('0x119');ami[_0xbbc2('0x42')]('custom:amd',ut[_0xbbc2('0x114')](_0xc882c2,_0xbbc2('0x11a')));this[_0xbbc2('0x115')](_0xc882c2,_0xbbc2('0x129'),_0xbbc2('0x12a'));}if(_0x1b341f['type']===_0xbbc2('0xc0')&&this[_0xbbc2('0x21')][_0x1b341f[_0xbbc2('0xbe')]][_0xbbc2('0x10e')]&&_0x1b1eeb['value']==='MACHINE'){return new Promise(function(_0x57906e,_0x91790d){delete _0x3195cb[_0xbbc2('0x28')][_0x1b1eeb[_0xbbc2('0xbf')]];_0x3195cb[_0xbbc2('0xc1')](_0x3195cb[_0xbbc2('0x21')][_0x1b341f[_0xbbc2('0xbe')]]);_0x3195cb[_0xbbc2('0x21')][_0x1b341f[_0xbbc2('0xbe')]]['outboundAnswerCallsDay']+=0x1;_0x3195cb[_0xbbc2('0x21')][_0x1b341f[_0xbbc2('0xbe')]][_0xbbc2('0x111')]+=0x1;var _0x26b034=_0x3195cb[_0xbbc2('0x21')][_0x1b341f[_0xbbc2('0xbe')]];var _0x4ca7f6=new Hangup(_0x1b341f,_0x1b1eeb);_0x4ca7f6[_0xbbc2('0x6f')]=0x13;_0x4ca7f6[_0xbbc2('0x70')]=_0xbbc2('0x118');_0x4ca7f6['membername']='AMD';_0x4ca7f6[_0xbbc2('0x11f')]+=0x1;_0x4ca7f6[_0xbbc2('0xd3')]+=0x1;_0x4ca7f6[_0xbbc2('0x11a')]=!![];ami['emit'](_0xbbc2('0x113'),ut[_0xbbc2('0x114')](_0x4ca7f6,_0xbbc2('0x11a')));hopperUtils[_0xbbc2('0xca')](_0x4ca7f6)[_0xbbc2('0xa1')](loggerCatch(_0xbbc2('0x11b')));if(_0x4ca7f6[_0xbbc2('0x11c')]+_0x4ca7f6[_0xbbc2('0x12b')]+_0x4ca7f6['countnoanswerretry']+_0x4ca7f6[_0xbbc2('0x11e')]+_0x4ca7f6[_0xbbc2('0xd2')]+_0x4ca7f6['countabandonedretry']+_0x4ca7f6['countmachineretry']+_0x4ca7f6[_0xbbc2('0x120')]>=_0x26b034[_0xbbc2('0x121')]){_0x3195cb[_0xbbc2('0x122')](_0x4ca7f6,_0x57906e,_0x91790d,_0xbbc2('0x123'));}else{if(_0x4ca7f6['countmachineretry']>=_0x26b034[_0xbbc2('0x124')]){_0x3195cb[_0xbbc2('0x125')](_0x4ca7f6,_0x57906e,_0x91790d,_0xbbc2('0x126'));}else{hopperUtils[_0xbbc2('0xd9')]({'active':![],'countmachineretry':_0x4ca7f6['countmachineretry'],'scheduledat':moment()['add'](_0x26b034[_0xbbc2('0x127')],_0xbbc2('0xdb'))[_0xbbc2('0x47')](_0xbbc2('0xc3')),'ContactId':_0x4ca7f6[_0xbbc2('0xdc')],'ListId':_0x4ca7f6[_0xbbc2('0xdd')],'VoiceQueueId':_0x4ca7f6['VoiceQueueId']||undefined,'CampaignId':_0x4ca7f6[_0xbbc2('0xe9')]||undefined})[_0xbbc2('0xa1')](loggerCatch(_0xbbc2('0x12c')));_0x57906e({'reschedule':0x1});}}});}}};Dialer[_0xbbc2('0x1a')][_0xbbc2('0x37')]=function(_0x892632){var _0x4e046b=this[_0xbbc2('0x28')][_0x892632[_0xbbc2('0xbf')]];var _0x4507b9;if(_0x4e046b&&_0x4e046b[_0xbbc2('0x43')]==='ivr'){delete this[_0xbbc2('0x28')][_0x892632[_0xbbc2('0xbf')]];this[_0xbbc2('0xc1')](this[_0xbbc2('0x21')][_0x4e046b[_0xbbc2('0xbe')]]);this['campaigns'][_0x4e046b['queue']]['ivrAnswerCallsDay']+=0x1;_0x4507b9=new Hangup(_0x4e046b,_0x892632);hopperUtils['createHistory'](_0x4507b9)[_0xbbc2('0xa1')](loggerCatch(_0xbbc2('0x12d')));hopperUtils['moveContactManagedDialer'](_0x4507b9)[_0xbbc2('0xa1')](loggerCatch(_0xbbc2('0x12e')));}if(_0x4e046b&&_0x4e046b[_0xbbc2('0x43')]!==_0xbbc2('0xc0')&&isNotNull(this[_0xbbc2('0x20')][_0x4e046b[_0xbbc2('0xbe')]][_0xbbc2('0x12f')])){delete this['uniqueId'][_0x892632[_0xbbc2('0xbf')]];this[_0xbbc2('0xc1')](this[_0xbbc2('0x20')][_0x4e046b[_0xbbc2('0xbe')]]);this['voiceQueues'][_0x4e046b[_0xbbc2('0xbe')]][_0xbbc2('0xc5')]+=0x1;this[_0xbbc2('0x20')][_0x4e046b[_0xbbc2('0xbe')]]['outboundAnswerAgiCallsDay']+=0x1;_0x4507b9=new Hangup(_0x4e046b,_0x892632);_0x4507b9[_0xbbc2('0x6f')]=0x10;_0x4507b9[_0xbbc2('0x70')]=_0xbbc2('0x130');_0x4507b9['membername']=_0xbbc2('0x131');hopperUtils[_0xbbc2('0xca')](_0x4507b9)[_0xbbc2('0xa1')](loggerCatch(_0xbbc2('0x12d')));hopperUtils[_0xbbc2('0x132')](_0x4507b9)[_0xbbc2('0xa1')](loggerCatch(_0xbbc2('0x12e')));}if(_0x4e046b&&_0x4e046b[_0xbbc2('0x43')]!==_0xbbc2('0xc0')&&!isNotNull(this[_0xbbc2('0x20')][_0x4e046b[_0xbbc2('0xbe')]][_0xbbc2('0x12f')])){delete this[_0xbbc2('0x28')][_0x892632[_0xbbc2('0xbf')]];this[_0xbbc2('0xc1')](this[_0xbbc2('0x20')][_0x4e046b['queue']]);this['voiceQueues'][_0x4e046b[_0xbbc2('0xbe')]]['outboundUnknownCallsDay']+=0x1;_0x4507b9=new Hangup(_0x4e046b,_0x892632);_0x4507b9[_0xbbc2('0x6f')]=0xc;_0x4507b9['statedesc']=_0x892632['cause-txt'];_0x4507b9[_0xbbc2('0x112')]=_0xbbc2('0x133');hopperUtils['createHistory'](_0x4507b9)[_0xbbc2('0xa1')](loggerCatch(_0xbbc2('0x12d')));hopperUtils['moveContactManagedDialer'](_0x4507b9)[_0xbbc2('0xa1')](loggerCatch('[syncHangupIvr]'));}};Dialer['prototype'][_0xbbc2('0xe')]=function(_0x5d4e6e){var _0x3e4cda=this;if(!_0x3e4cda['queuesSummary'][_0x5d4e6e['name']]){_0x3e4cda['queuesSummary'][_0x5d4e6e[_0xbbc2('0x49')]]={'running':![]};}else if(_0x3e4cda[_0xbbc2('0x2f')][_0x5d4e6e[_0xbbc2('0x49')]][_0xbbc2('0x134')]===!![]){return;}else if(_0x3e4cda[_0xbbc2('0x2f')][_0x5d4e6e['name']][_0xbbc2('0x134')]===![]){_0x3e4cda[_0xbbc2('0x2f')][_0x5d4e6e['name']][_0xbbc2('0x134')]=!![];}var _0x1382a0=_0x3e4cda[_0xbbc2('0x20')][_0x5d4e6e[_0xbbc2('0x49')]];var _0xbd10bc=_0x1382a0['message']!==utils[_0xbbc2('0x69')][_0xbbc2('0x7b')];var _0x554b42=utils[_0xbbc2('0x135')](_0x1382a0);_0x1382a0[_0xbbc2('0x136')]=utils['getQueueCampaignStatusMessage'](_0x1382a0,_0x3e4cda[_0xbbc2('0x23')]);Promise['resolve']()[_0xbbc2('0x40')](function(){if(_0x1382a0[_0xbbc2('0x136')]===utils[_0xbbc2('0x69')][_0xbbc2('0x7b')]){if(_0xbd10bc){clearPredictiveAttributes(_0x1382a0);_0x5d4e6e[_0xbbc2('0x2a')]=undefined;_0x5d4e6e['startProgressive']=undefined;}if(_0x1382a0[_0xbbc2('0x136')]===utils['CAMPAIGN_STATUS'][_0xbbc2('0x7b')]){_0x5d4e6e[_0xbbc2('0x137')]=0x0;_0x5d4e6e[_0xbbc2('0xf4')]=0x0;_0x5d4e6e[_0xbbc2('0x138')]=0x0;_0x5d4e6e[_0xbbc2('0x139')]=0x0;_0x5d4e6e[_0xbbc2('0x13a')]=0x0;}}else if(_0x1382a0['statusMessage']===utils[_0xbbc2('0x69')][_0xbbc2('0x13b')]&&!_0x554b42){return _0x3e4cda[_0xbbc2('0x90')](_0x1382a0,!![])[_0xbbc2('0x40')](function(){return _0x3e4cda['ifTime'](_0x1382a0,![]);})[_0xbbc2('0x40')](function(){return _0x3e4cda['checkDialMethod'](_0x1382a0);})['catch'](function(_0x3e9d4e){loggerSyncQueueSummary[_0xbbc2('0x45')]('[syncQueueSummary]',util['inspect'](_0x3e9d4e,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x1382a0);});}else{clearPredictiveAttributes(_0x1382a0);}})['then'](function(){var _0x324d5b=_0x5d4e6e[_0xbbc2('0x13c')](_0x1382a0);if(_0x324d5b||_0x1382a0[_0xbbc2('0x13d')]){_0x1382a0['queueSummaryCountersUpdated']=![];_0x5d4e6e['updateReportFromOutboundQueue'](_0x1382a0);Object[_0xbbc2('0x13e')](_0x1382a0,_0x5d4e6e);emitOutboundVoiceQueueSummary(_0x5d4e6e);}_0x3e4cda['queuesSummary'][_0x1382a0[_0xbbc2('0x49')]][_0xbbc2('0x134')]=![];})[_0xbbc2('0xa1')](function(_0x52cc9c){logger[_0xbbc2('0x64')](_0xbbc2('0x13f'),util['inspect'](_0x52cc9c,{'showHidden':![],'depth':null}));_0x3e4cda['queuesSummary'][_0x1382a0[_0xbbc2('0x49')]]['running']=![];});};Dialer[_0xbbc2('0x1a')][_0xbbc2('0x140')]=_[_0xbbc2('0x141')](function(){var _0x436ebf=_[_0xbbc2('0x142')](this[_0xbbc2('0x20')],function(_0x561759){return _0x561759[_0xbbc2('0x143')];});var _0x136fcd=_[_0xbbc2('0x142')](this[_0xbbc2('0x22')],function(_0x3d0588){return _0x3d0588[_0xbbc2('0x144')]&&_0x3d0588[_0xbbc2('0x89')]===_0xbbc2('0x145');});if(_0x436ebf[_0xbbc2('0x98')]>0x0&&_0x136fcd['length']>0x0){return Promise[_0xbbc2('0x146')]()[_0xbbc2('0x40')](cmHopper[_0xbbc2('0x147')](_[_0xbbc2('0x148')](_0x436ebf,'id'),previewRecallmeReminderInterval,_['map'](_0x136fcd,'id')))[_0xbbc2('0x40')](function(_0x54df6f){for(var _0x507ac0=0x0;_0x507ac0<_0x54df6f['length'];_0x507ac0++){var _0x2e60aa=_0x54df6f[_0x507ac0]['Agent'][_0xbbc2('0x49')];if(_0x2e60aa)io['to'](util[_0xbbc2('0x47')](_0xbbc2('0x149'),_0x2e60aa))['emit'](_0xbbc2('0x14a'),{'hopper':_0x54df6f[_0x507ac0]});}})[_0xbbc2('0xa1')](function(_0x83836b){logger[_0xbbc2('0x64')](_0xbbc2('0x14b'),_0x83836b);});}},0x3c*0x3e8,{'leading':!![]});Dialer['prototype']['loopClearZombieChannels']=function(){var _0x248583=this;setInterval(function(){_0x248583[_0xbbc2('0x14c')](_0x248583['uniqueId'],_0xbbc2('0x14d'));_0x248583[_0xbbc2('0x14c')](_0x248583[_0xbbc2('0x26')],_0xbbc2('0x14e'));},0x32c8);};Dialer[_0xbbc2('0x1a')]['clearZombieChannels']=function(_0x575a02,_0xce7c49){var _0x27e08a=this;for(var _0x4a5c31 in _0x575a02){if(typeof _0x575a02[_0x4a5c31]!==_0xbbc2('0x14f')){this['sequence']['enqueue'](function(){if(!_['isNil'](_0x575a02[_0x4a5c31])){return ami[_0xbbc2('0x9a')]({'action':_0xbbc2('0x89'),'channel':_0x575a02[_0x4a5c31]['channel']})[_0xbbc2('0xa1')](function(_0x248beb){if(_0x248beb[_0xbbc2('0x68')]===_0xbbc2('0x150')){setTimeout(function(){if(_0x575a02[_0x4a5c31]&&_0x575a02[_0x4a5c31]['type']!=='ivr'){_0x27e08a['updateOriginated'](_0x27e08a[_0xbbc2('0x20')][_0x575a02[_0x4a5c31][_0xbbc2('0xbe')]]);logger[_0xbbc2('0x64')]('[Dialer][checkChannel]',_0xce7c49,_0x4a5c31,_0x575a02[_0x4a5c31][_0xbbc2('0xbe')]);delete _0x575a02[_0x4a5c31];}if(_0x575a02[_0x4a5c31]&&_0x575a02[_0x4a5c31]['type']==='ivr'){_0x27e08a[_0xbbc2('0xc1')](_0x27e08a[_0xbbc2('0x21')][_0x575a02[_0x4a5c31][_0xbbc2('0xbe')]]);logger[_0xbbc2('0x64')](_0xbbc2('0x151'),_0xce7c49,_0x4a5c31,_0x575a02[_0x4a5c31]['queue']);delete _0x575a02[_0x4a5c31];}},0x2328);}});}});}}};Dialer[_0xbbc2('0x1a')][_0xbbc2('0x152')]=function(_0x2e5c7d){return Promise['resolve']()[_0xbbc2('0x40')](voiceQueueRt[_0xbbc2('0x152')](_0x2e5c7d))[_0xbbc2('0xa1')](loggerCatch(_0xbbc2('0x153')));};Dialer[_0xbbc2('0x1a')]['updateOriginated']=function(_0x3ac601){if(!_[_0xbbc2('0x56')](_0x3ac601)&&_0x3ac601!==null){if(typeof _0x3ac601['originated']!=='undefined'){if(_0x3ac601[_0xbbc2('0x154')]>0x0){_0x3ac601[_0xbbc2('0x154')]-=0x1;}else{logger[_0xbbc2('0x64')]('[updateOriginated]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0xbbc2('0x64')](_0xbbc2('0x155'));}};Dialer[_0xbbc2('0x1a')]['loggerHandler']=function(_0x4eb021,_0x193bb0){var _0x1d063d=this;return function(_0x2f3396){_0x1d063d[_0xbbc2('0xc1')](_0x193bb0);logger[_0xbbc2('0x64')](_0x4eb021,util[_0xbbc2('0x46')](_0x2f3396,{'showHidden':![],'depth':null}));};};Dialer[_0xbbc2('0x1a')][_0xbbc2('0x156')]=function(_0x230033,_0x13f506,_0x4edb7a){var _0x4235a2={'state':0x19,'statedesc':_0xbbc2('0x157')};this['updateOriginated'](_0x13f506);this['saveInDb'](_[_0xbbc2('0x60')](_0x4235a2,_[_0xbbc2('0x76')](_0x4edb7a,['ContactId',_0xbbc2('0xdd'),_0xbbc2('0x158'),'VoiceQueueId',_0xbbc2('0xe9')])),_0xbbc2('0x159'),_0xbbc2('0x15a'));logger['error'](_0x230033);};Dialer[_0xbbc2('0x1a')][_0xbbc2('0x115')]=function(_0x1c95f8,_0x277128,_0x558547){hopperUtils[_0xbbc2('0xca')](_0x1c95f8)['catch'](loggerCatch(_0x277128));hopperUtils['moveContactManagedDialer'](_0x1c95f8)[_0xbbc2('0xa1')](loggerCatch(_0x558547));};Dialer['prototype'][_0xbbc2('0xd8')]=function(_0x164619,_0x384d6f){hopperUtils[_0xbbc2('0xca')](_0x164619)[_0xbbc2('0xa1')](loggerCatch(_0xbbc2('0xcb')));if(_0x384d6f==0x0){hopperUtils[_0xbbc2('0x132')](_0x164619)[_0xbbc2('0xa1')](loggerCatch('[syncQueueCallerAbandon]\x20[Drop]'));}};Dialer[_0xbbc2('0x1a')][_0xbbc2('0x14b')]=function(_0x2f4690){return Promise[_0xbbc2('0x146')]()[_0xbbc2('0x40')](cmHopper['handlePreviewRecallNotifications'](_0x2f4690['id'],previewRecallmeReminderInterval))[_0xbbc2('0x40')](function(_0x43750e){for(var _0x814ed8=0x0;_0x814ed8<_0x43750e[_0xbbc2('0x98')];_0x814ed8++){var _0x29cf21=_0x43750e[_0x814ed8][_0xbbc2('0x15b')]['name'];if(_0x29cf21)io['to'](util['format'](_0xbbc2('0x149'),_0x29cf21))[_0xbbc2('0x42')](_0xbbc2('0x14a'),{'hopper':_0x43750e[_0x814ed8]});}})[_0xbbc2('0xa1')](function(){});};Dialer[_0xbbc2('0x1a')][_0xbbc2('0xb0')]=function(_0x302ddf){var _0x383e16=this;return function(){_0x383e16[_0xbbc2('0x15c')](_0x302ddf);};};Dialer[_0xbbc2('0x1a')]['actionOriginate']=function(_0x5dfd0a,_0x3ab023){var _0x202103=this;var _0x919ec8=uuid['v4']();this[_0xbbc2('0x26')][_0x919ec8]=new Action(_0x5dfd0a,_0x3ab023,_0x919ec8);return new Promise(function(_0x3c429f,_0x419f25){if(_[_0xbbc2('0x56')](_0x5dfd0a)&&typeof _0x5dfd0a!==_0xbbc2('0x15d')){return _0x419f25(msgResponse('originate',_0xbbc2('0x91'),_0xbbc2('0x15e')));}if(_['isUndefined'](_0x3ab023[_0xbbc2('0x15f')])||_0x3ab023[_0xbbc2('0x15f')]===null){return _0x419f25(msgResponse(_0xbbc2('0x160'),_0xbbc2('0x91'),_0xbbc2('0x161')));}var _0x4846e0={'XMD-CALLERID':_0x202103['actions'][_0x919ec8]['getCaller'](),'XMD-AGI':_0x5dfd0a['dialQueueProject']?util[_0xbbc2('0x47')]('\x22agi://%s/square,%s\x22',ipAgi,_0x5dfd0a['dialQueueProject']):_0xbbc2('0x162'),'XMD-AGIAFTER':_0x5dfd0a[_0xbbc2('0xc9')]?util['format']('\x22agi://%s/square,%s\x22',ipAgi,_0x5dfd0a[_0xbbc2('0xc9')]):_0xbbc2('0x162'),'XMD-QUEUE':utils[_0xbbc2('0x163')](_0x5dfd0a)?util[_0xbbc2('0x47')](_0xbbc2('0x164'),_0x5dfd0a['name'],_0x5dfd0a[_0xbbc2('0x165')]||'',_0x5dfd0a['dialAgiAfterHangupAgent']?'c':'',_0x5dfd0a[_0xbbc2('0x166')]||0x3):_0xbbc2('0x162'),'XMD-CONTACTID':_0x3ab023[_0xbbc2('0xdc')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x202103[_0xbbc2('0x26')][_0x919ec8]['getCaller'](),'XMD-AMD':_0x5dfd0a['dialAMDActive']?_0xbbc2('0x13b'):_0xbbc2('0x162'),'XMD-DESTINATION':_0xbbc2('0x10d')};if(_0x5dfd0a[_0xbbc2('0x10e')]){_0x4846e0[_0xbbc2('0x167')]=_0x5dfd0a['dialAMDInitialSilence']||0x9c4;_0x4846e0[_0xbbc2('0x168')]=_0x5dfd0a['dialAMDGreeting']||0x5dc;_0x4846e0[_0xbbc2('0x169')]=_0x5dfd0a[_0xbbc2('0x16a')]||0x320;_0x4846e0[_0xbbc2('0x16b')]=_0x5dfd0a['dialAMDTotalAnalysisTime']||0x1388;_0x4846e0[_0xbbc2('0x16c')]=_0x5dfd0a[_0xbbc2('0x16d')]||0x64;_0x4846e0['XMD-AMDBETWEENWORDSSILENCE']=_0x5dfd0a[_0xbbc2('0x16e')]||0x32;_0x4846e0[_0xbbc2('0x16f')]=_0x5dfd0a[_0xbbc2('0x170')]||0x3;_0x4846e0['XMD-AMDSILENCETHRESHOLD']=_0x5dfd0a[_0xbbc2('0x171')]||0x100;_0x4846e0[_0xbbc2('0x172')]=_0x5dfd0a['dialAMDMaximumWordLength']||0x1388;}if(utils[_0xbbc2('0x163')](_0x5dfd0a)){_0x4846e0[_0xbbc2('0x173')]=_0x3ab023[_0xbbc2('0xde')];}else{_0x4846e0[_0xbbc2('0x174')]=_0x3ab023[_0xbbc2('0xe9')];}var _0x370526=utils[_0xbbc2('0x175')](_0x3ab023[_0xbbc2('0x176')]);Object['assign'](_0x4846e0,_0x370526);var _0x371187=_0x202103['isTrunkReachable'](_0x5dfd0a[_0xbbc2('0x8b')])?utils[_0xbbc2('0x177')](_0x5dfd0a[_0xbbc2('0x8b')][_0xbbc2('0x178')],_0x5dfd0a['dialOriginateCallerIdName'],_0x5dfd0a[_0xbbc2('0x179')]>0x0?utils[_0xbbc2('0x17a')](_0x5dfd0a['dialOriginateCallerIdNumber'],_0x5dfd0a['dialRandomLastDigitCallerIdNumber']):_0x5dfd0a[_0xbbc2('0x17b')]):utils[_0xbbc2('0x177')](_[_0xbbc2('0xf2')](_0x5dfd0a[_0xbbc2('0x8c')])?_0x5dfd0a['Trunk']['callerid']:_0x5dfd0a[_0xbbc2('0x8c')]['callerid'],_0x5dfd0a['dialOriginateCallerIdName'],_0x5dfd0a['dialRandomLastDigitCallerIdNumber']>0x0?utils[_0xbbc2('0x17a')](_0x5dfd0a[_0xbbc2('0x17b')],_0x5dfd0a[_0xbbc2('0x179')]):_0x5dfd0a[_0xbbc2('0x17b')]);if(_0x371187){_0x4846e0[_0xbbc2('0x17c')]=_0x202103[_0xbbc2('0x26')][_0x919ec8][_0xbbc2('0x17d')]=utils[_0xbbc2('0x17e')](_0x371187);_0x4846e0[_0xbbc2('0x17f')]=_0x3ab023[_0xbbc2('0x15f')];}_0x5dfd0a[_0xbbc2('0x180')]=_0x4846e0;return ami[_0xbbc2('0x9a')]({'actionid':_0x919ec8,'action':'originate','channel':_0x202103['isTrunkReachable'](_0x5dfd0a['Trunk'])?util['format']('SIP/%s/%s%s',_0x5dfd0a[_0xbbc2('0x8b')][_0xbbc2('0x49')],isNotNull(_0x5dfd0a[_0xbbc2('0x181')])?_0x5dfd0a[_0xbbc2('0x181')][_0xbbc2('0x182')]()||'':'',_0x5dfd0a[_0xbbc2('0x183')]>0x0?_0x3ab023[_0xbbc2('0x15f')][_0xbbc2('0x184')](_0x5dfd0a[_0xbbc2('0x183')]):_0x3ab023['phone']):util[_0xbbc2('0x47')](_0xbbc2('0x185'),_[_0xbbc2('0xf2')](_0x5dfd0a[_0xbbc2('0x8c')])?_0x5dfd0a[_0xbbc2('0x8b')][_0xbbc2('0x49')]:_0x5dfd0a['TrunkBackup']['name'],isNotNull(_0x5dfd0a[_0xbbc2('0x181')])?_0x5dfd0a['dialPrefix'][_0xbbc2('0x182')]()||'':'',_0x5dfd0a[_0xbbc2('0x183')]>0x0?_0x3ab023[_0xbbc2('0x15f')][_0xbbc2('0x184')](_0x5dfd0a[_0xbbc2('0x183')]):_0x3ab023[_0xbbc2('0x15f')]),'callerid':_0x371187,'Exten':'xcally-motion-dialer','Context':_0xbbc2('0x186'),'Priority':'1','variable':_0x4846e0,'timeout':(_0x5dfd0a[_0xbbc2('0x187')]||0x1e)*0x3e8,'async':!![],'channelid':_0x919ec8})[_0xbbc2('0x40')](function(_0x22b3fc){return _0x3c429f(_0x22b3fc);})[_0xbbc2('0xa1')](function(_0x4a16f0){_0x5dfd0a['outboundOriginateFailureCallsDay']+=0x1;var _0x1fdb69=new History(_0x202103['actions'][_0x919ec8]);logger[_0xbbc2('0x64')](util[_0xbbc2('0x47')](_0xbbc2('0x188'),JSON[_0xbbc2('0x75')](_0x4a16f0)));_0x1fdb69[_0xbbc2('0x6f')]=0xe;_0x1fdb69[_0xbbc2('0x70')]='OriginateError';_0x1fdb69[_0xbbc2('0x71')]=moment()[_0xbbc2('0x47')](_0xbbc2('0xc3'));_0x1fdb69[_0xbbc2('0xec')]=_0x1fdb69[_0xbbc2('0x71')];hopperUtils[_0xbbc2('0xca')](_0x1fdb69)[_0xbbc2('0xa1')](loggerCatch(_0xbbc2('0x189')));_0x202103[_0xbbc2('0x132')](_0x1fdb69)['catch'](loggerCatch(_0xbbc2('0x189')))[_0xbbc2('0x1d')](function(){delete _0x202103[_0xbbc2('0x26')][_0x919ec8];return _0x419f25(msgResponse('originate','Error','originate\x20action\x20Error'));});});});};Dialer['prototype'][_0xbbc2('0x18a')]=function(_0x1cb9ce,_0x58af96,_0x586f60){var _0x3146f3=new History(_0x58af96);if(_0x3146f3[_0xbbc2('0x11c')]+_0x3146f3[_0xbbc2('0x12b')]+_0x3146f3['countnoanswerretry']+_0x3146f3[_0xbbc2('0x11e')]+_0x3146f3[_0xbbc2('0xd2')]+_0x3146f3[_0xbbc2('0xe4')]+_0x3146f3['countmachineretry']+_0x3146f3[_0xbbc2('0x120')]>=_0x586f60['dialGlobalMaxRetry']-0x1){return!![];}switch(_0x1cb9ce){case 0x3:if(_0x3146f3[_0xbbc2('0x11d')]>=_0x586f60[_0xbbc2('0x18b')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countnoanswerretry':_0x3146f3['countnoanswerretry']+=0x1,'scheduledat':moment()[_0xbbc2('0xda')](_0x586f60['dialNoAnswerRetryFrequency'],_0xbbc2('0xdb'))[_0xbbc2('0x47')](_0xbbc2('0xc3')),'ContactId':_0x3146f3['ContactId'],'ListId':_0x3146f3[_0xbbc2('0xdd')],'VoiceQueueId':_0x3146f3[_0xbbc2('0xde')]||undefined,'CampaignId':_0x3146f3[_0xbbc2('0xe9')]||undefined})[_0xbbc2('0xa1')](loggerCatch(_0xbbc2('0x18c')));break;case 0x5:if(_0x3146f3[_0xbbc2('0x11c')]>=_0x586f60[_0xbbc2('0x18d')]-0x1){return!![];}hopperUtils[_0xbbc2('0xd9')]({'active':![],'countbusyretry':_0x3146f3[_0xbbc2('0x11c')]+=0x1,'scheduledat':moment()[_0xbbc2('0xda')](_0x586f60[_0xbbc2('0x18e')],_0xbbc2('0xdb'))[_0xbbc2('0x47')](_0xbbc2('0xc3')),'ContactId':_0x3146f3[_0xbbc2('0xdc')],'ListId':_0x3146f3[_0xbbc2('0xdd')],'VoiceQueueId':_0x3146f3[_0xbbc2('0xde')]||undefined,'CampaignId':_0x3146f3['CampaignId']||undefined})[_0xbbc2('0xa1')](loggerCatch(_0xbbc2('0x18f')));break;case 0x8:if(_0x3146f3[_0xbbc2('0x12b')]>=_0x586f60['dialCongestionMaxRetry']-0x1){return!![];}hopperUtils[_0xbbc2('0xd9')]({'active':![],'countcongestionretry':_0x3146f3['countcongestionretry']+=0x1,'scheduledat':moment()[_0xbbc2('0xda')](_0x586f60[_0xbbc2('0x190')],_0xbbc2('0xdb'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x3146f3['ContactId'],'ListId':_0x3146f3[_0xbbc2('0xdd')],'VoiceQueueId':_0x3146f3[_0xbbc2('0xde')]||undefined,'CampaignId':_0x3146f3[_0xbbc2('0xe9')]||undefined})['catch'](loggerCatch(_0xbbc2('0x191')));break;case 0x0:if(_0x3146f3[_0xbbc2('0x11e')]>=_0x586f60[_0xbbc2('0x192')]-0x1){return!![];}else{hopperUtils[_0xbbc2('0xd9')]({'active':![],'countnosuchnumberretry':_0x3146f3['countnosuchnumberretry']+=0x1,'scheduledat':moment()['add'](_0x586f60[_0xbbc2('0x193')],_0xbbc2('0xdb'))[_0xbbc2('0x47')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x3146f3[_0xbbc2('0xdc')],'ListId':_0x3146f3[_0xbbc2('0xdd')],'VoiceQueueId':_0x3146f3['VoiceQueueId']||undefined,'CampaignId':_0x3146f3[_0xbbc2('0xe9')]||undefined})[_0xbbc2('0xa1')](loggerCatch(_0xbbc2('0x194')));}break;case 0xa:if(_0x3146f3[_0xbbc2('0xd2')]>=_0x586f60[_0xbbc2('0xd7')]-0x1){return!![];}hopperUtils[_0xbbc2('0xd9')]({'active':![],'countdropretry':_0x3146f3[_0xbbc2('0xd2')]+=0x1,'scheduledat':moment()[_0xbbc2('0xda')](_0x586f60['dialDropRetryFrequency'],_0xbbc2('0xdb'))[_0xbbc2('0x47')](_0xbbc2('0xc3')),'ContactId':_0x3146f3[_0xbbc2('0xdc')],'ListId':_0x3146f3['ListId'],'VoiceQueueId':_0x3146f3[_0xbbc2('0xde')]||undefined,'CampaignId':_0x3146f3[_0xbbc2('0xe9')]||undefined})['catch'](loggerCatch(_0xbbc2('0xdf')));break;case 0xb:if(_0x3146f3['countabandonedretry']>=_0x586f60['dialAbandonedMaxRetry']-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countabandonedretry':_0x3146f3[_0xbbc2('0xe4')]+=0x1,'scheduledat':moment()[_0xbbc2('0xda')](_0x586f60['dialAbandonedRetryFrequency'],_0xbbc2('0xdb'))[_0xbbc2('0x47')](_0xbbc2('0xc3')),'ContactId':_0x3146f3[_0xbbc2('0xdc')],'ListId':_0x3146f3[_0xbbc2('0xdd')],'VoiceQueueId':_0x3146f3[_0xbbc2('0xde')]||undefined,'CampaignId':_0x3146f3['CampaignId']||undefined})[_0xbbc2('0xa1')](loggerCatch('[rescheduleContact][Abandoned]'));break;case 0x13:if(_0x3146f3[_0xbbc2('0x11f')]>=_0x586f60['dialMachineMaxRetry']-0x1){return!![];}hopperUtils[_0xbbc2('0xd9')]({'active':![],'countmachineretry':_0x3146f3[_0xbbc2('0x11f')]+=0x1,'scheduledat':moment()[_0xbbc2('0xda')](_0x586f60[_0xbbc2('0x127')],_0xbbc2('0xdb'))[_0xbbc2('0x47')](_0xbbc2('0xc3')),'ContactId':_0x3146f3[_0xbbc2('0xdc')],'ListId':_0x3146f3['ListId'],'VoiceQueueId':_0x3146f3['VoiceQueueId']||undefined,'CampaignId':_0x3146f3[_0xbbc2('0xe9')]||undefined})[_0xbbc2('0xa1')](loggerCatch(_0xbbc2('0x12c')));break;case 0x14:if(_0x3146f3[_0xbbc2('0x120')]>=_0x586f60[_0xbbc2('0x195')]-0x1){return!![];}hopperUtils[_0xbbc2('0xd9')]({'active':![],'countagentrejectretry':_0x3146f3[_0xbbc2('0x120')]+=0x1,'scheduledat':moment()[_0xbbc2('0xda')](_0x586f60['dialAgentRejectRetryFrequency'],_0xbbc2('0xdb'))[_0xbbc2('0x47')](_0xbbc2('0xc3')),'ContactId':_0x3146f3['ContactId'],'ListId':_0x3146f3['ListId'],'VoiceQueueId':_0x3146f3[_0xbbc2('0xde')]||undefined,'CampaignId':_0x3146f3[_0xbbc2('0xe9')]||undefined})[_0xbbc2('0xa1')](loggerCatch('[rescheduleContact][AgentReject]'));break;default:return!![];}};Dialer['prototype'][_0xbbc2('0x109')]=function(_0x43ee4c,_0x2f0742,_0x44a8c4){var _0xaf5155=this;var _0x305f32=new History(_0x43ee4c);var _0x37f910=![];var _0x2ceb7a;var _0x144a99;return new Promise(function(_0x5a4be9,_0x4f23b6){if(_[_0xbbc2('0x56')](_0x2f0742)&&typeof _0x2f0742!==_0xbbc2('0x15d')){return _0x4f23b6(msgResponse(_0xbbc2('0x196'),_0xbbc2('0x91'),_0xbbc2('0x197')));}if(_[_0xbbc2('0x56')](_0x44a8c4)&&typeof _0x44a8c4!=='object'){return _0x4f23b6(msgResponse(_0xbbc2('0x196'),_0xbbc2('0x91'),_0xbbc2('0x198')));}hopperUtils[_0xbbc2('0xd6')](_0x305f32,_0x44a8c4['reason'],_0x2f0742)[_0xbbc2('0x40')](function(_0x729422){if(_0x729422['additional']==0x1)_0x37f910=!![];switch(_0x44a8c4['reason']){case'0':_0x2f0742[_0xbbc2('0x199')]+=0x1;_0x305f32[_0xbbc2('0x6f')]=0x0;_0x305f32[_0xbbc2('0x70')]=_0xbbc2('0x19a');_0x305f32[_0xbbc2('0x11e')]+=0x1;_0x305f32['countglobal']+=0x1;ami[_0xbbc2('0x42')](_0xbbc2('0x19b'),ut[_0xbbc2('0x114')](_0x43ee4c,'nosuchnumber'));_0x2ceb7a=_0x2f0742['dialNoSuchNumberRetryFrequency'];_0x144a99=_0x2f0742[_0xbbc2('0xd5')];hopperUtils['createHistory'](_0x305f32)[_0xbbc2('0xa1')](loggerCatch(_0xbbc2('0x11b')));if(_0xaf5155[_0xbbc2('0x18a')](0x0,_0x43ee4c,_0x2f0742)&&!_0x37f910){if(_0x305f32[_0xbbc2('0x11e')]>=_0x2f0742[_0xbbc2('0x192')]){_0xaf5155[_0xbbc2('0x125')](_0x305f32,_0x5a4be9,_0x4f23b6,_0xbbc2('0x19c'));}else{_0xaf5155[_0xbbc2('0x122')](_0x305f32,_0x5a4be9,_0x4f23b6,'reason\x200\x20no\x20such\x20number....');}}break;case'3':_0x2f0742[_0xbbc2('0x19d')]+=0x1;_0x305f32[_0xbbc2('0x6f')]=0x3;_0x305f32[_0xbbc2('0x70')]='NoAnswer';_0x305f32[_0xbbc2('0x11d')]+=0x1;_0x305f32[_0xbbc2('0xd3')]+=0x1;var _0x385850=ut[_0xbbc2('0x19e')](_0x43ee4c,_0x2f0742);ami[_0xbbc2('0x42')]('custom:agentnoanswer',_0x385850);_0x2ceb7a=_0x2f0742[_0xbbc2('0x19f')];_0x144a99=_0x2f0742['callAdditionalPhoneAfterMin'];hopperUtils[_0xbbc2('0xca')](_0x305f32)['catch'](loggerCatch('[syncAgentComplete][createHistory][3]'));if(_0xaf5155[_0xbbc2('0x18a')](0x3,_0x43ee4c,_0x2f0742)&&!_0x37f910){if(_0x305f32['countnoanswerretry']>=_0x2f0742['dialNoAnswerMaxRetry']){_0xaf5155['createStateFinal'](_0x305f32,_0x5a4be9,_0x4f23b6,_0xbbc2('0x1a0'));}else{_0xaf5155['stateGlobal'](_0x305f32,_0x5a4be9,_0x4f23b6,'reason\x203\x20ringing\x20no\x20answer');}}break;case'5':_0x2f0742[_0xbbc2('0x1a1')]+=0x1;_0x305f32[_0xbbc2('0x6f')]=0x5;_0x305f32[_0xbbc2('0x70')]=_0xbbc2('0x1a2');_0x305f32['countbusyretry']+=0x1;_0x305f32[_0xbbc2('0xd3')]+=0x1;ami[_0xbbc2('0x42')]('custom:agentbusy',ut[_0xbbc2('0x114')](_0x43ee4c,_0xbbc2('0x1a3')));_0x2ceb7a=_0x2f0742['dialBusyRetryFrequency'];_0x144a99=_0x2f0742[_0xbbc2('0xd5')];hopperUtils[_0xbbc2('0xca')](_0x305f32)[_0xbbc2('0xa1')](loggerCatch(_0xbbc2('0x1a4')));if(_0xaf5155['checkRetriveMax'](0x5,_0x43ee4c,_0x2f0742)&&!_0x37f910){if(_0x305f32[_0xbbc2('0x11c')]>=_0x2f0742['dialBusyMaxRetry']){_0xaf5155[_0xbbc2('0x125')](_0x305f32,_0x5a4be9,_0x4f23b6,'reason\x205\x20busy');}else{_0xaf5155['stateGlobal'](_0x305f32,_0x5a4be9,_0x4f23b6,_0xbbc2('0x1a5'));}}break;case'8':_0x2f0742['outboundCongestionCallsDay']+=0x1;_0x305f32[_0xbbc2('0x6f')]=0x8;_0x305f32['statedesc']=_0xbbc2('0x1a6');_0x305f32[_0xbbc2('0x12b')]+=0x1;_0x305f32[_0xbbc2('0xd3')]+=0x1;_0x2ceb7a=_0x2f0742[_0xbbc2('0x190')];_0x144a99=_0x2f0742[_0xbbc2('0xd5')];ami[_0xbbc2('0x42')](_0xbbc2('0x1a7'),ut[_0xbbc2('0x114')](_0x43ee4c,_0xbbc2('0x1a8')));hopperUtils['createHistory'](_0x305f32)[_0xbbc2('0xa1')](loggerCatch('[syncAgentComplete][createHistory][8]'));if(_0xaf5155[_0xbbc2('0x18a')](0x8,_0x43ee4c,_0x2f0742)&&!_0x37f910){if(_0x305f32['countcongestionretry']>=_0x2f0742[_0xbbc2('0x1a9')]){_0xaf5155[_0xbbc2('0x125')](_0x305f32,_0x5a4be9,_0x4f23b6,_0xbbc2('0x1aa'));}else{_0xaf5155['stateGlobal'](_0x305f32,_0x5a4be9,_0x4f23b6,_0xbbc2('0x1aa'));}}break;case'11':_0x2f0742[_0xbbc2('0x1ab')]+=0x1;_0x305f32[_0xbbc2('0x6f')]=0xb;_0x305f32[_0xbbc2('0x70')]=_0xbbc2('0xeb');_0x305f32[_0xbbc2('0xe4')]+=0x1;_0x305f32['countglobal']+=0x1;_0x2ceb7a=_0x2f0742[_0xbbc2('0xe5')];_0x144a99=_0x2f0742[_0xbbc2('0xd5')];hopperUtils[_0xbbc2('0xca')](_0x305f32)[_0xbbc2('0xa1')](loggerCatch('[syncAgentComplete][createHistory][11]'));if(_0xaf5155['checkRetriveMax'](0xb,_0x43ee4c,_0x2f0742)&&!_0x37f910){if(_0x305f32[_0xbbc2('0xe4')]>=_0x2f0742[_0xbbc2('0xe7')]){_0xaf5155[_0xbbc2('0x125')](_0x305f32,_0x5a4be9,_0x4f23b6,_0xbbc2('0x1ac'));}else{_0xaf5155[_0xbbc2('0x122')](_0x305f32,_0x5a4be9,_0x4f23b6,_0xbbc2('0x1ac'));}}break;case'20':_0x2f0742['outboundRejectCallsDay']+=0x1;_0x305f32[_0xbbc2('0x6f')]=0x14;_0x305f32[_0xbbc2('0x70')]='AgentReject';_0x305f32[_0xbbc2('0x120')]+=0x1;_0x305f32[_0xbbc2('0xd3')]+=0x1;_0x2ceb7a=_0x2f0742[_0xbbc2('0x1ad')];_0x144a99=_0x2f0742[_0xbbc2('0xd5')];ami['emit'](_0xbbc2('0x1ae'),ut[_0xbbc2('0x114')](_0x43ee4c,_0xbbc2('0x1af')));hopperUtils[_0xbbc2('0xca')](_0x305f32)[_0xbbc2('0xa1')](loggerCatch('[syncAgentComplete][createHistory][20]'));if(_0xaf5155[_0xbbc2('0x18a')](0x14,_0x43ee4c,_0x2f0742)&&!_0x37f910){if(_0x305f32[_0xbbc2('0x120')]>=_0x2f0742[_0xbbc2('0x195')]){_0xaf5155[_0xbbc2('0x125')](_0x305f32,_0x5a4be9,_0x4f23b6,'reason\x2020\x20agentreject');}else{_0xaf5155[_0xbbc2('0x122')](_0x305f32,_0x5a4be9,_0x4f23b6,'reason\x2020\x20agentreject');}}break;default:_0x2f0742[_0xbbc2('0x1b0')]+=0x1;_0x305f32[_0xbbc2('0x6f')]=0xc;_0x305f32['statedesc']=_0x44a8c4[_0xbbc2('0xc6')];_0x2ceb7a=_0x2f0742[_0xbbc2('0x1ad')];_0x144a99=_0x2f0742[_0xbbc2('0xd5')];hopperUtils[_0xbbc2('0xca')](_0x305f32)['catch'](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0xaf5155['checkRetriveMax'](_0x44a8c4[_0xbbc2('0xc6')],_0x43ee4c,_0x2f0742)&&!_0x37f910){if(_0x305f32['countbusyretry']+_0x305f32[_0xbbc2('0x12b')]+_0x305f32[_0xbbc2('0x11d')]+_0x305f32['countnosuchnumberretry']+_0x305f32[_0xbbc2('0xd2')]+_0x305f32[_0xbbc2('0xe4')]+_0x305f32[_0xbbc2('0x11f')]+_0x305f32[_0xbbc2('0x120')]>=_0x2f0742[_0xbbc2('0x121')]){_0xaf5155[_0xbbc2('0x122')](_0x305f32,_0x5a4be9,_0x4f23b6,_0x44a8c4[_0xbbc2('0xc6')]);}else{_0xaf5155[_0xbbc2('0x125')](_0x305f32,_0x5a4be9,_0x4f23b6,_0x44a8c4[_0xbbc2('0xc6')]);}}}})[_0xbbc2('0x40')](function(){if(_0x37f910){hopperUtils[_0xbbc2('0xe2')](_0x305f32,_0x2ceb7a,_0x144a99)[_0xbbc2('0x40')](function(){return _0x5a4be9(0x1);});}});});};Dialer[_0xbbc2('0x1a')]['stateGlobal']=function(_0x3418fe,_0x4066b8,_0x3c2176,_0x3659a9){var _0x591712=new Final(_0x3418fe);_0x591712['state']=0xf;_0x591712[_0xbbc2('0x70')]=_0xbbc2('0x1b1');this[_0xbbc2('0x125')](_0x591712,_0x4066b8,_0x3c2176,_0x3659a9);};Dialer['prototype'][_0xbbc2('0x125')]=function(_0x140018,_0x3a33b8,_0x414a13,_0x43252c){hopperUtils['moveContactManagedDialer'](_0x140018)[_0xbbc2('0x40')](function(){return _0x3a33b8(msgResponse(_0xbbc2('0x196'),_0xbbc2('0x108'),_0x43252c));})[_0xbbc2('0xa1')](function(){return _0x414a13(msgResponse(_0xbbc2('0x1b2'),_0xbbc2('0x91'),'contact\x20not\x20moved'));});};Dialer[_0xbbc2('0x1a')][_0xbbc2('0xc')]=function(_0x496854){var _0x4989fc=_0x496854[_0xbbc2('0x1b3')]/0x64;var _0x514653=_0x496854['outboundDropCallsDayTimeout']/(_0x496854[_0xbbc2('0x1b4')]+_0x496854[_0xbbc2('0xc5')]);var _0x179645=Math['round'](_0x496854[_0xbbc2('0x1b5')]*(_0x496854[_0xbbc2('0x1b6')]/0x64));var _0x4d7d18=Math[_0xbbc2('0x1b7')](_0x496854[_0xbbc2('0x1b5')]*(_0x496854[_0xbbc2('0x1b8')]/0x64));var _0x2498e6=_0x496854[_0xbbc2('0x137')]+_0x496854['talking'];var _0x58fa0c=Math[_0xbbc2('0x1b9')](_0x496854[_0xbbc2('0x5b')]*_0x496854[_0xbbc2('0x5e')]*_0x496854['predictiveIntervalHitRate']*_0x496854[_0xbbc2('0x1ba')]);if(_['isUndefined'](_0x496854[_0xbbc2('0x2b')])){if(!_[_0xbbc2('0x56')](_0x496854['startPredictive'])){_0x496854[_0xbbc2('0x2a')]=undefined;loggerPredictive[_0xbbc2('0x64')]('[startMethodPredictive][StartProgressive]',_0xbbc2('0x1bb'));}if(!_['isUndefined'](_0x496854[_0xbbc2('0x63')])){loggerPredictive[_0xbbc2('0x64')](_0xbbc2('0x1bc'),_0xbbc2('0x1bd'));clearInterval(_0x496854[_0xbbc2('0x63')]);_0x496854[_0xbbc2('0x63')]=undefined;}_0x496854['startProgressive']=moment()['format'](_0xbbc2('0xc3'));loggerPredictive[_0xbbc2('0x4b')](_0x496854[_0xbbc2('0x49')],_0xbbc2('0x1be'),_0x496854[_0xbbc2('0x2b')]);this[_0xbbc2('0xb5')](_0x496854,0x1);}else if(ifInterval(_0x496854[_0xbbc2('0x1bf')],_0x496854[_0xbbc2('0x2b')])){this[_0xbbc2('0xb5')](_0x496854,0x1);loggerPredictiveCalls[_0xbbc2('0x4b')](_0xbbc2('0x1c0'),_0x496854[_0xbbc2('0x2b')],_0x496854[_0xbbc2('0x49')]);_0x496854['erlangCalls']=0x0;_0x496854[_0xbbc2('0xcf')]=0x0;}else if(_0x4989fc<_0x514653&&_0x496854[_0xbbc2('0x1c1')]===_0xbbc2('0x1c2')){clearPredictiveAttributes(_0x496854);loggerPredictive['info'](_0xbbc2('0x1c3'),_0xbbc2('0x1c4'),_0x514653,_0xbbc2('0x2b'),_0x496854[_0xbbc2('0x49')]);}else if(_0x58fa0c<_0x496854[_0xbbc2('0xcf')]&&_0x496854[_0xbbc2('0x1c1')]==='dropRate'){clearPredictiveAttributes(_0x496854);loggerPredictive[_0xbbc2('0x4b')](_0xbbc2('0x1c5'),'Max\x20Drop\x20',_0x58fa0c,_0xbbc2('0x1c6'),_0x496854[_0xbbc2('0xcf')],_0xbbc2('0x2b'),_0x496854[_0xbbc2('0x49')]);}else if(!ifInterval(_0x496854[_0xbbc2('0x1bf')],_0x496854[_0xbbc2('0x2b')])&&_[_0xbbc2('0x56')](_0x496854[_0xbbc2('0x2a')])&&!_[_0xbbc2('0x56')](_0x496854[_0xbbc2('0x2b')])){_0x496854[_0xbbc2('0x2a')]=moment()[_0xbbc2('0x47')](_0xbbc2('0xc3'));loggerPredictive[_0xbbc2('0x4b')](_0x496854[_0xbbc2('0x49')],'started\x20in\x20predictive\x20at',_0x496854['startPredictive']);hopperUtils[_0xbbc2('0x1c7')](_0x496854[_0xbbc2('0x1bf')])['then'](this['getDataPredictive'](_0x496854))['then'](mergeDataErlangB(_0x496854))[_0xbbc2('0x40')](this[_0xbbc2('0x1c8')](_0x496854))[_0xbbc2('0xa1')](loggerCatchPredictive(_0xbbc2('0x1c9'),_0x496854));}else if(!ifInterval(_0x496854['dialPredictiveInterval'],_0x496854[_0xbbc2('0x2a')])){_0x496854['predictiveIntervalErlangCallsDroppedCalls']=0x0;_0x496854[_0xbbc2('0x2a')]=moment()[_0xbbc2('0x47')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0xbbc2('0x4b')](_0x496854['name'],_0xbbc2('0x1ca'),_0x496854[_0xbbc2('0x2a')]);clearInterval(_0x496854['handlePredictive']);_0x496854[_0xbbc2('0x63')]=undefined;hopperUtils['avgHandleTime'](_0x496854[_0xbbc2('0x1bf')])[_0xbbc2('0x40')](this['getDataPredictive'](_0x496854))[_0xbbc2('0x40')](mergeDataErlangB(_0x496854))[_0xbbc2('0x40')](this[_0xbbc2('0x1c8')](_0x496854))[_0xbbc2('0xa1')](loggerCatchPredictive(_0xbbc2('0x1cb'),_0x496854));}else if(_0x496854[_0xbbc2('0x1b5')]&&_0x2498e6<_0x496854[_0xbbc2('0x1b5')]-_0x4d7d18){clearPredictiveAttributes(_0x496854);loggerPredictive['info'](_0x496854[_0xbbc2('0x49')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x2498e6,_0xbbc2('0x1cc'),_0x496854[_0xbbc2('0x1b5')],'-',_0x4d7d18,'=',_0x496854[_0xbbc2('0x1b5')]-_0x4d7d18,')');}else if(_0x496854[_0xbbc2('0x1b5')]&&_0x2498e6>_0x496854[_0xbbc2('0x1b5')]+_0x179645){clearPredictiveAttributes(_0x496854);loggerPredictive[_0xbbc2('0x4b')](_0x496854[_0xbbc2('0x49')],_0xbbc2('0x1cd'),_0x2498e6,_0xbbc2('0x1ce'),_0x496854[_0xbbc2('0x1b5')],'+',_0x179645,'=',_0x496854[_0xbbc2('0x1b5')]+_0x179645,')');}};Dialer[_0xbbc2('0x1a')][_0xbbc2('0x1cf')]=function(_0x5a8aed){var _0x4c2408=this;return function(_0xc982){return new Promise(function(_0x325010,_0x1ec551){_[_0xbbc2('0x60')](_0x5a8aed,_0xc982[0x0]);if(checkGetDataPredictive(_0xc982[0x0])){var _0x4425fc=_0x5a8aed[_0xbbc2('0x1b5')]=_0x5a8aed[_0xbbc2('0x139')]+_0x5a8aed['available'];var _0x1c96d1=_0x5a8aed['dialPredictiveInterval']*0x3c;var _0x42061b=_0xc982[0x0][_0xbbc2('0x54')]+_0xc982[0x0][_0xbbc2('0x53')];var _0xf1d84e=(_0xc982[0x0][_0xbbc2('0x1d0')]+_0xc982[0x0][_0xbbc2('0x50')]+_0xc982[0x0][_0xbbc2('0x52')])/_0xc982[0x0][_0xbbc2('0x4d')];_0x5a8aed[_0xbbc2('0x1d1')]=_0xf1d84e>0x0?_0xf1d84e:0x1;switch(_0x5a8aed[_0xbbc2('0x1c1')]){case'dropRate':var _0x39bf95=_0x5a8aed[_0xbbc2('0x1b3')]/0x64;return _0x4c2408[_0xbbc2('0x1d2')](_0x4425fc,_0x1c96d1,_0x42061b,_0xf1d84e,_0x39bf95)['then'](function(_0xf63b47){return _0x325010(_0xf63b47);});case _0xbbc2('0x1d3'):var _0x43decf=_0x5a8aed[_0xbbc2('0x1b3')]/0x64;return _0x4c2408[_0xbbc2('0x1d4')](_0x4425fc,_0x1c96d1,_0x42061b,_0xf1d84e,_0x43decf)[_0xbbc2('0x40')](function(_0x16c606){return _0x325010(_0x16c606);});default:return _0x1ec551(msgResponse(_0xbbc2('0x1d5'),_0xbbc2('0x91'),_0xbbc2('0x1d6')));}}else{return _0x1ec551(msgResponse(_0xbbc2('0x1d5'),'Failure','check\x20failure'));}});};};Dialer[_0xbbc2('0x1a')][_0xbbc2('0x1d7')]=function(_0x12ec03){var _0x3df1f8=this;return function(_0x4fa332){return new Promise(function(_0x338dc8,_0x307bf4){_[_0xbbc2('0x60')](_0x12ec03,_0x4fa332[0x0]);if(checkGetDataPredictive(_0x4fa332[0x0])){loggerPredictive[_0xbbc2('0x4b')](JSON[_0xbbc2('0x75')](_0x4fa332[0x0]));if(_0x12ec03[_0xbbc2('0x1c1')]===_0xbbc2('0x1c2')){return _0x3df1f8[_0xbbc2('0x152')](_0x12ec03['id'])['then'](function(_0x1ad30b){var _0x47aedb=_0x12ec03[_0xbbc2('0x1d8')]-_0x1ad30b[0x0][_0xbbc2('0x1d9')];var _0xe108e1=_0x12ec03[_0xbbc2('0x1bf')]*0x3c;var _0x4d8c30=_0x4fa332[0x0][_0xbbc2('0x54')]+_0x4fa332[0x0][_0xbbc2('0x53')];var _0x532aae=(_0x4fa332[0x0][_0xbbc2('0x1d0')]+_0x4fa332[0x0][_0xbbc2('0x50')]+_0x4fa332[0x0][_0xbbc2('0x52')])/_0x4fa332[0x0][_0xbbc2('0x4d')];var _0x17e51e=_0x12ec03['dialPredictiveOptimizationPercentage']/0x64;_0x12ec03['predictiveIntervalPauses']=_0x1ad30b[0x0][_0xbbc2('0x1d9')]||0x0;_0x12ec03[_0xbbc2('0x1d1')]=_0x532aae>0x0?_0x532aae:0x1;return _0x3df1f8[_0xbbc2('0x1d2')](_0x47aedb,_0xe108e1,_0x4d8c30,_0x532aae,_0x17e51e);})[_0xbbc2('0x40')](function(_0x3993f8){return _0x338dc8(_0x3993f8);})[_0xbbc2('0xa1')](function(_0x12dd47){return _0x307bf4(msgResponse(_0xbbc2('0x1da'),'Failure',JSON[_0xbbc2('0x75')](_0x12dd47)));});}if(_0x12ec03[_0xbbc2('0x1c1')]===_0xbbc2('0x1d3')){return _0x3df1f8[_0xbbc2('0x152')](_0x12ec03['id'])[_0xbbc2('0x40')](function(_0x9e9f2d){var _0xff52e4=_0x12ec03[_0xbbc2('0x1d8')]-_0x9e9f2d[0x0][_0xbbc2('0x1d9')];var _0x2bf2c4=_0x12ec03['dialPredictiveInterval']*0x3c;var _0x1fc1c0=_0x4fa332[0x0][_0xbbc2('0x54')]+_0x4fa332[0x0][_0xbbc2('0x53')];var _0x34e637=(_0x4fa332[0x0][_0xbbc2('0x1d0')]+_0x4fa332[0x0][_0xbbc2('0x50')]+_0x4fa332[0x0][_0xbbc2('0x52')])/_0x4fa332[0x0][_0xbbc2('0x4d')];var _0x2f1f48=_0x12ec03[_0xbbc2('0x1b3')]/0x64;_0x12ec03[_0xbbc2('0x1db')]=_0x9e9f2d[0x0][_0xbbc2('0x1d9')]||0x0;_0x12ec03['predictiveIntervalHitRate']=_0x34e637>0x0?_0x34e637:0x1;return _0x3df1f8[_0xbbc2('0x1d4')](_0xff52e4,_0x2bf2c4,_0x1fc1c0,_0x34e637,_0x2f1f48);})[_0xbbc2('0x40')](function(_0x1af033){return _0x338dc8(_0x1af033);})[_0xbbc2('0xa1')](function(_0x33f831){return _0x307bf4(msgResponse(_0xbbc2('0x1da'),_0xbbc2('0x91'),JSON[_0xbbc2('0x75')](_0x33f831)));});}}else{return _0x307bf4(msgResponse('[getDataPredictive]',_0xbbc2('0x91'),_0xbbc2('0x1dc')));}});};};Dialer[_0xbbc2('0x1a')][_0xbbc2('0x1c8')]=function(_0x3071c4){var _0x2b3a4e=this;return function(){var _0x5c3544=0x0;var _0x4cbf87=Math[_0xbbc2('0x1b9')](_0x3071c4['erlangCallToSecond']*0x3e8);if(_0x4cbf87>0x0){_0x4cbf87=_0x4cbf87<0x64?0x64:_0x4cbf87;loggerPredictive[_0xbbc2('0x4b')](_0x3071c4['name'],_0xbbc2('0x1dd'),_0x4cbf87,'milliseconds');_0x3071c4['handlePredictive']=setInterval(function(){_0x2b3a4e['handlePredictive'](_0x3071c4);loggerPredictiveCalls[_0xbbc2('0x4b')](_0xbbc2('0x1de'),_0x5c3544+=0x1);},_0x4cbf87);}else{loggerPredictive[_0xbbc2('0x4b')](_0x3071c4['name'],_0xbbc2('0x1df'));}};};Dialer[_0xbbc2('0x1a')]['checkContactBlack']=function(_0x384d51,_0xfba033){var _0x2d4a18=this;return function(_0x30cc98){if(_[_0xbbc2('0x4a')](_0x30cc98)){if(_[_0xbbc2('0xf2')](_0xfba033[_0xbbc2('0x158')])||!_0xfba033['recallme']){if(_0x384d51[_0xbbc2('0xb3')]==='booked'){_0x384d51[_0xbbc2('0x72')]=_[_0xbbc2('0x56')](_0x384d51[_0xbbc2('0x72')])?!![]:_0x384d51[_0xbbc2('0x72')];var _0x39be3f=uuid['v4']();_0x2d4a18[_0xbbc2('0x26')][_0x39be3f]=new Action(_0x384d51,_0xfba033,_0x39be3f);loggerBooked['info'](_0xbbc2('0x1e0'),_0x39be3f,_0xbbc2('0x1e1'),JSON[_0xbbc2('0x75')](_0x384d51[_0xbbc2('0x72')]),'Queue:\x20',_0x384d51['name']);if(_0x384d51[_0xbbc2('0x72')]){_0x384d51[_0xbbc2('0x72')]=![];_0x2d4a18[_0xbbc2('0x2d')][_0x2d4a18['actions'][_0x39be3f][_0xbbc2('0xbe')]]=[];ami['Action']({'actionid':_0x39be3f,'action':_0xbbc2('0x1e2'),'queue':_0x384d51[_0xbbc2('0x49')]})[_0xbbc2('0xa1')](function(){_0x2d4a18[_0xbbc2('0xc1')](_0x384d51);hopperUtils[_0xbbc2('0xd9')]({'active':![],'ContactId':_0x2d4a18[_0xbbc2('0x26')][_0x39be3f][_0xbbc2('0xdc')],'ListId':_0x2d4a18[_0xbbc2('0x26')][_0x39be3f][_0xbbc2('0xdd')],'VoiceQueueId':_0x2d4a18[_0xbbc2('0x26')][_0x39be3f][_0xbbc2('0xde')]||undefined,'CampaignId':_0x2d4a18[_0xbbc2('0x26')][_0x39be3f][_0xbbc2('0xe9')]||undefined})['catch'](loggerCatch(_0xbbc2('0x1e3')));delete _0x2d4a18[_0xbbc2('0x26')][_0x39be3f];});}else{loggerBooked['info'](_0xbbc2('0x1e4'),JSON[_0xbbc2('0x75')](_0x384d51[_0xbbc2('0x72')]),_0xbbc2('0x1e5'),_0x384d51['name']);_0x2d4a18['updateOriginated'](_0x384d51);hopperUtils[_0xbbc2('0xd9')]({'active':![],'ContactId':_0x2d4a18['actions'][_0x39be3f][_0xbbc2('0xdc')],'ListId':_0x2d4a18['actions'][_0x39be3f]['ListId'],'VoiceQueueId':_0x2d4a18[_0xbbc2('0x26')][_0x39be3f][_0xbbc2('0xde')]||undefined,'CampaignId':_0x2d4a18['actions'][_0x39be3f][_0xbbc2('0xe9')]||undefined})[_0xbbc2('0xa1')](loggerCatch(_0xbbc2('0x1e3')));delete _0x2d4a18[_0xbbc2('0x26')][_0x39be3f];}}else{return _0x2d4a18[_0xbbc2('0x1e6')](_0x384d51,_0xfba033);}}else{if(utils[_0xbbc2('0x61')](undefined,_0xfba033[_0xbbc2('0x1e7')])<_0x384d51['dialRecallMeTimeout']*0x3c){if(_0xfba033[_0xbbc2('0x15b')]&&!_0xfba033[_0xbbc2('0x15b')][_0xbbc2('0x1e8')]){_0x2d4a18[_0xbbc2('0x1f')]['run'](_0xfba033['id'])['finally'](function(){_0x2d4a18['updateOriginated'](_0x384d51);});}else{hopperUtils[_0xbbc2('0x1e9')]({'active':![]},_0xfba033['id'],0x1)[_0xbbc2('0x1d')](function(){_0x2d4a18[_0xbbc2('0xc1')](_0x384d51);});}}else{_0x384d51['outboundReCallsDay']+=0x1;_0x2d4a18[_0xbbc2('0xc1')](_0x384d51);if(_0x384d51[_0xbbc2('0x1ea')]){hopperUtils[_0xbbc2('0xd9')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0xfba033['ContactId'],'ListId':_0xfba033[_0xbbc2('0xdd')],'VoiceQueueId':_0xfba033[_0xbbc2('0xde')]||undefined,'CampaignId':_0xfba033[_0xbbc2('0xe9')]||undefined})[_0xbbc2('0xa1')](loggerCatch(_0xbbc2('0x1eb')));hopperUtils[_0xbbc2('0xca')](createObjHistory(_0x384d51,_0xfba033,utils['CAMPAIGN_STATUS'][_0xbbc2('0x1ec')],0x17,_0xbbc2('0x1ed')))['catch'](loggerCatch(_0xbbc2('0x1ee')));}else{_0x2d4a18[_0xbbc2('0x115')](createObjHistory(_0x384d51,_0xfba033,utils[_0xbbc2('0x69')][_0xbbc2('0x1ef')],0x16,_0xbbc2('0x1f0')),_0xbbc2('0x1f1'),_0xbbc2('0x1f2'));}}}}else{_0x384d51[_0xbbc2('0x1f3')]+=0x1;_0x2d4a18[_0xbbc2('0x115')](createObjHistory(_0x384d51,_0xfba033,utils[_0xbbc2('0x69')][_0xbbc2('0x1f4')],0xd,_0xbbc2('0x1f5')),'[Originate][historyBlacklist]',_0xbbc2('0x1f6'));throw'inBlackList';}};};Dialer['prototype'][_0xbbc2('0x15c')]=function(_0x18c850){var _0x27a72e=this;var _0x158c15=_0x18c850[_0xbbc2('0x1f7')]-_0x18c850[_0xbbc2('0x154')];emitCampaignSummary(_0x18c850);if(_0x158c15>0x0&&_0x18c850[_0xbbc2('0x1f8')]==0x0){if(_0x158c15>this[_0xbbc2('0x24')]){_0x158c15=this[_0xbbc2('0x24')];}_0x18c850[_0xbbc2('0x1f8')]=0x1;hopperUtils[_0xbbc2('0x1f9')](_0x18c850,_0x158c15)[_0xbbc2('0x40')](function(_0x94facd){_0x18c850[_0xbbc2('0x1f8')]=0x0;if(_0x94facd){if(!utils[_0xbbc2('0x1fa')](_0x94facd)){_0x18c850[_0xbbc2('0x68')]=utils[_0xbbc2('0x69')][_0xbbc2('0x6d')];logger['info']('[getContactCampaign2][Empty]'+_0x18c850[_0xbbc2('0x49')]);}else{_0x18c850[_0xbbc2('0x154')]+=_0x94facd[_0xbbc2('0x98')];_0x18c850[_0xbbc2('0x68')]=utils['CAMPAIGN_STATUS']['RUNNING'];for(var _0x9612b7=0x0;_0x9612b7<_0x94facd[_0xbbc2('0x98')];_0x9612b7+=0x1){_0x18c850[_0xbbc2('0x1fb')]+=0x1;if(_['isNil'](_0x94facd[_0x9612b7])||_[_0xbbc2('0xf2')](_0x94facd[_0x9612b7]['Contact'])||_[_0xbbc2('0xf2')](_0x94facd[_0x9612b7]['phone'])){_0x27a72e[_0xbbc2('0x156')](_0xbbc2('0x1fc'),_0x18c850,_0x94facd[_0x9612b7]);}else{hopperUtils[_0xbbc2('0x1fd')](_['pick'](_0x94facd[_0x9612b7],[_0xbbc2('0xe9'),_0xbbc2('0x15f')]))[_0xbbc2('0x40')](_0x27a72e[_0xbbc2('0x1fe')](_0x18c850,_0x94facd[_0x9612b7]))[_0xbbc2('0xa1')](_0x27a72e[_0xbbc2('0x1ff')]('[actionOriginateIvr]\x20',_0x18c850));}}}}})['catch'](loggerGetContactDialer(_0xbbc2('0x200'),_0x18c850,_0x158c15));}};Dialer[_0xbbc2('0x1a')][_0xbbc2('0xb5')]=function(_0x3d4605,_0x3bfe5b){var _0x1f340a=this;var _0x195352=[];if(_0x3bfe5b<0x1||_0x3d4605[_0xbbc2('0xb3')]===_0xbbc2('0xb')){_0x3bfe5b=0x1;}var _0xf0346=Math[_0xbbc2('0x1b9')](_0x3d4605[_0xbbc2('0x137')]*_0x3bfe5b)-_0x3d4605['originated'];if(_0x3d4605[_0xbbc2('0x201')]>0x0){var _0x7eb82b=_0x3d4605[_0xbbc2('0x201')]-_0x3d4605[_0xbbc2('0x154')]-_0x3d4605[_0xbbc2('0x139')]-_0x3d4605[_0xbbc2('0x13a')];if(_0xf0346>_0x7eb82b){_0xf0346=_0x7eb82b;}}if(_0xf0346>0x0&&_0x3d4605[_0xbbc2('0x1f8')]==0x0){if(_0x3d4605[_0xbbc2('0xb3')]===_0xbbc2('0xb')){_0xf0346=0x1;}if(_0xf0346>this['maxNumberOriginate']){_0xf0346=this[_0xbbc2('0x24')];}for(var _0x433fc8 in this[_0xbbc2('0x22')]){if(typeof this[_0xbbc2('0x22')][_0x433fc8]!==_0xbbc2('0x14f')){if(this[_0xbbc2('0x22')][_0x433fc8][_0xbbc2('0x6f')]===_0xbbc2('0x202')&&this[_0xbbc2('0x22')][_0x433fc8][_0xbbc2('0x89')]===_0xbbc2('0x145')){_0x195352['push'](this[_0xbbc2('0x22')][_0x433fc8]['id']);}}}_0x3d4605[_0xbbc2('0x1f8')]=0x1;hopperUtils[_0xbbc2('0x203')](_0x3d4605,_0x195352,_0xf0346)[_0xbbc2('0x40')](function(_0x25e2ed){_0x3d4605[_0xbbc2('0x1f8')]=0x0;if(_0x25e2ed){if(!utils[_0xbbc2('0x1fa')](_0x25e2ed)){hopperUtils['countReScheduled'](_0x3d4605)[_0xbbc2('0x40')](sendMessageReschedule(_0x3d4605))[_0xbbc2('0xa1')](loggerCatch('[countReScheduled]\x20'));}else{_0x3d4605[_0xbbc2('0x154')]+=_0x25e2ed[_0xbbc2('0x98')];_0x3d4605[_0xbbc2('0x68')]=_0x3d4605[_0xbbc2('0xb3')]===_0xbbc2('0xb')?utils[_0xbbc2('0x69')][_0xbbc2('0x13b')]:utils['CAMPAIGN_STATUS'][_0xbbc2('0x204')];for(var _0x58d1de=0x0;_0x58d1de<_0x25e2ed[_0xbbc2('0x98')];_0x58d1de+=0x1){if(_['isNil'](_0x25e2ed[_0x58d1de])||_[_0xbbc2('0xf2')](_0x25e2ed[_0x58d1de][_0xbbc2('0x176')])||_[_0xbbc2('0xf2')](_0x25e2ed[_0x58d1de]['phone'])){_0x1f340a[_0xbbc2('0x156')](_0xbbc2('0x1fc'),_0x3d4605,_0x25e2ed[_0x58d1de]);}else{hopperUtils[_0xbbc2('0x205')](_['pick'](_0x25e2ed[_0x58d1de],[_0xbbc2('0xde'),_0xbbc2('0x15f')]))[_0xbbc2('0x40')](_0x1f340a[_0xbbc2('0x1fe')](_0x3d4605,_0x25e2ed[_0x58d1de]))[_0xbbc2('0xa1')](_0x1f340a[_0xbbc2('0x1ff')](_0xbbc2('0x1fc'),_0x3d4605));}}}}})['catch'](loggerGetContactDialer('[getContactDialer2]',_0x3d4605,_0xf0346));}};Dialer[_0xbbc2('0x1a')]['handlePredictive']=function(_0x978adf){if(_0x978adf[_0xbbc2('0x201')]>0x0){var _0x30280=_0x978adf[_0xbbc2('0x201')]-_0x978adf[_0xbbc2('0x154')]-_0x978adf[_0xbbc2('0x139')];if(_0x30280>0x0&&_0x978adf[_0xbbc2('0x1f8')]==0x0){this[_0xbbc2('0x206')](_0x978adf);}else{loggerPredictiveCalls[_0xbbc2('0x4b')](_0xbbc2('0x207'));}}else{this['tryOriginatePredictive'](_0x978adf);}};Dialer[_0xbbc2('0x1a')]['tryOriginatePredictive']=function(_0x418a11){var _0x39328d=this;var _0x26ca57=[];_0x418a11[_0xbbc2('0x154')]+=0x1;for(var _0x14a26e in this['agents']){if(typeof this[_0xbbc2('0x22')][_0x14a26e]!==_0xbbc2('0x14f')){if(this['agents'][_0x14a26e]['state']===_0xbbc2('0x202')&&this[_0xbbc2('0x22')][_0x14a26e]['status']===_0xbbc2('0x145')){_0x26ca57[_0xbbc2('0x99')](this['agents'][_0x14a26e]['id']);}}}_0x418a11[_0xbbc2('0x1f8')]=0x1;return this[_0xbbc2('0x203')](_0x418a11['id'],_0x26ca57,0x1,_0x418a11['dialOrderByScheduledAt'],_0x418a11)[_0xbbc2('0x40')](function(_0x1b310d){_0x418a11[_0xbbc2('0x1f8')]=0x1;if(_0x1b310d){if(!utils[_0xbbc2('0x1fa')](_0x1b310d)){utils[_0xbbc2('0x66')](_0x418a11,0x1,0x0);return hopperUtils[_0xbbc2('0x208')](_0x418a11)[_0xbbc2('0x40')](sendMessageReschedule(_0x418a11))['catch'](loggerCatch(_0xbbc2('0x209')));}else{_0x418a11['message']=utils[_0xbbc2('0x69')][_0xbbc2('0x204')];if(_[_0xbbc2('0xf2')](_0x1b310d[0x0])||_[_0xbbc2('0xf2')](_0x1b310d[0x0][_0xbbc2('0x176')])||_['isNil'](_0x1b310d[0x0]['phone'])){_0x39328d[_0xbbc2('0x156')]('[actionOriginate]\x20',_0x418a11,_0x1b310d[0x0]);}else{return hopperUtils['checkIsBlackList'](_[_0xbbc2('0x76')](_0x1b310d[0x0],[_0xbbc2('0xde'),_0xbbc2('0x15f')]))[_0xbbc2('0x40')](_0x39328d['checkContactBlack'](_0x418a11,_0x1b310d[0x0]))[_0xbbc2('0xa1')](_0x39328d[_0xbbc2('0x1ff')](_0xbbc2('0x20a'),_0x418a11));}}}})[_0xbbc2('0xa1')](loggerGetContactDialer(_0xbbc2('0x20b'),_0x418a11,0x1));};Dialer[_0xbbc2('0x1a')][_0xbbc2('0x1d2')]=function(_0x3d2e9d,_0x364b76,_0xf57cbd,_0x410a4b,_0x1f7089,_0x9935a7){loggerPredictive[_0xbbc2('0x4b')](_0xbbc2('0x20c'));loggerPredictive[_0xbbc2('0x4b')](_0xbbc2('0x20d'),_0x3d2e9d);loggerPredictive['info']('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x364b76);loggerPredictive[_0xbbc2('0x4b')]('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',_0xf57cbd);loggerPredictive['info'](_0xbbc2('0x20e'),_0x410a4b);loggerPredictive[_0xbbc2('0x4b')]('Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1f7089);loggerPredictive[_0xbbc2('0x4b')](_0xbbc2('0x55'));return new Promise(function(_0x152059,_0x246728){if(_0x3d2e9d<=0x0||isNaN(_0x3d2e9d)){return _0x246728(msgResponse(_0xbbc2('0x20f'),'Error',_0xbbc2('0x210')+_0x3d2e9d));}if(_0xf57cbd<=0x0||isNaN(_0xf57cbd)){return _0x246728(msgResponse(_0xbbc2('0x20f'),'Error',_0xbbc2('0x211')+_0xf57cbd));}if(_0x410a4b<=0x0||isNaN(_0x410a4b)){return _0x246728(msgResponse(_0xbbc2('0x20f'),_0xbbc2('0x85'),_0xbbc2('0x212')+_0x410a4b));}if(_0x364b76<=0x0||isNaN(_0x364b76)){return _0x246728(msgResponse(_0xbbc2('0x20f'),_0xbbc2('0x85'),_0xbbc2('0x213')+_0x364b76));}if(_0x1f7089<=0x0||isNaN(_0x1f7089)){return _0x246728(msgResponse(_0xbbc2('0x20f'),'Error',_0xbbc2('0x214')+_0x1f7089));}_0x9935a7=_0x9935a7||0x0;var _0x25e5e0=0x1/_0xf57cbd;var _0x564ad2=0x0;var _0x5da126=0x0;var _0x55a62a=0x0;var _0x65f991=0x0;for(var _0x2d96a8=0x0;_0x55a62a<_0x1f7089;_0x2d96a8+=0x1){_0x5da126=_0x2d96a8/_0x364b76;_0x564ad2=(_0x410a4b*_0x5da126+_0x9935a7)/_0x25e5e0;_0x55a62a=utils[_0xbbc2('0x215')](_0x564ad2,_0x3d2e9d);_0x65f991=_0x564ad2/_0x3d2e9d*(0x1-utils[_0xbbc2('0x215')](_0x564ad2,_0x3d2e9d));}return _0x152059({'erlangCalls':_0x2d96a8,'erlangCallToSecond':_0x364b76/_0x2d96a8,'erlangAbandonmentRate':_0x55a62a,'erlangBusyFactor':_0x65f991});});};Dialer['prototype'][_0xbbc2('0x1d4')]=function(_0x44195d,_0x289f35,_0x2b8a6c,_0x7f512b,_0x567087,_0x520026){loggerPredictive[_0xbbc2('0x4b')]('----\x20Agent\x20Busy\x20Factor\x20----');loggerPredictive[_0xbbc2('0x4b')]('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',_0x44195d);loggerPredictive['info'](_0xbbc2('0x216'),_0x289f35);loggerPredictive[_0xbbc2('0x4b')](_0xbbc2('0x217'),_0x2b8a6c);loggerPredictive['info']('P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x7f512b);loggerPredictive[_0xbbc2('0x4b')](_0xbbc2('0x218'),_0x567087);loggerPredictive[_0xbbc2('0x4b')](_0xbbc2('0x55'));return new Promise(function(_0x5f37a4,_0x32ac10){if(_0x44195d<=0x0||isNaN(_0x44195d)){return _0x32ac10(msgResponse('[busyFactor]',_0xbbc2('0x85'),'m\x20=\x20'+_0x44195d));}if(_0x2b8a6c<=0x0||isNaN(_0x2b8a6c)){return _0x32ac10(msgResponse(_0xbbc2('0x219'),'Error',_0xbbc2('0x211')+_0x2b8a6c));}if(_0x7f512b<=0x0||isNaN(_0x7f512b)){return _0x32ac10(msgResponse('[busyFactor]',_0xbbc2('0x85'),_0xbbc2('0x212')+_0x7f512b));}if(_0x289f35<=0x0||isNaN(_0x289f35)){return _0x32ac10(msgResponse('[busyFactor]',_0xbbc2('0x85'),'interval\x20=\x20'+_0x289f35));}if(_0x567087<=0x0||isNaN(_0x567087)){return _0x32ac10(msgResponse(_0xbbc2('0x219'),'Error',_0xbbc2('0x21a')+_0x567087));}_0x520026=_0x520026||0x0;var _0x2a71d4=0x1/_0x2b8a6c;var _0x2d2c83=0x0;var _0x26da59=0x0;var _0x5c30b9=0x0;var _0x13dede=0x0;for(var _0x142784=0x0;_0x13dede<_0x567087;_0x142784+=0x1){_0x26da59=_0x142784/_0x289f35;_0x2d2c83=(_0x7f512b*_0x26da59+_0x520026)/_0x2a71d4;_0x5c30b9=utils[_0xbbc2('0x215')](_0x2d2c83,_0x44195d);_0x13dede=_0x2d2c83/_0x44195d*(0x1-utils[_0xbbc2('0x215')](_0x2d2c83,_0x44195d));}return _0x5f37a4({'erlangCalls':_0x142784,'erlangCallToSecond':_0x289f35/_0x142784,'erlangAbandonmentRate':_0x5c30b9,'erlangBusyFactor':_0x13dede});});};module[_0xbbc2('0x21b')]=Dialer; \ No newline at end of file +var _0x3218=['predictiveIntervalAvgTalktime','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCalls','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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\x20value\x20cleared','startPredictive','name','handlePredictive','handlePredictive\x20interval\x20cleared','error','stack','contactsRescheduled','message','CONTACTS_RESCHEDULED','[getContactDialer2][ReScheduled]','contacts','CAMPAIGN_STATUS','statedesc','endtime','starttime','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','stringify','pick','Interval','NULL_INTERVAL','\x20INTERVAL_IS_NULL','Intervals','INACTIVE','\x20NOT\x20Active','isIVRCampaign','campaign:ivr:%s','campaign:save','sendMessageOneNotActive','originated','is\x20not\x20active','DISACTIVED','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20disactive','[ifTime][Action]','Error','isTrunkReachable','active','format','SIP/%s','status','reachable','unmonitored','checkIsTrunkReachable','Trunk','TRUNK_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','checkIfTimeIntervals','ifTimeIvr','ifTime','Failure','EMPTY_INTERVAL','timezones','UNKNOWN_TIMEZONE','isArray','length','push','Action','command','iftime\x20%s,%s','indexOf','true','catch','content','all','OVERTIME_INTERVAL','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','resetActiveCalls','syncCampaigns','campaigns','undefined','isIVRCampaignActive','resolve','dialGlobalInterval','dialTimezone','launchHandleIvr','[syncCampaigns]','checkDialMethod','dialMethod','progressive','handlePower','power','dialPowerLevel','OVERTIME_GLOBAL_INTERVAL','silly','Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:','isGlobal','queue','uniqueid','ivr','answertime','YYYY-MM-DD\x20HH:mm:ss','outboundAnswerCallsDay','reason','agent','dialAgiAfterHangupAgent','createHistory','[syncAgentComplete][createHistory]','moveContactManagedDialer','[syncAgentComplete]','syncQueueCallerAbandon','updateOriginated','droptime','getSeconds','responsetime','dialQueueTimeout','predictiveIntervalDroppedCallsTimeout','Drop','dropreason','TIMEOUT','dialQueueProject2','countdropretry','countglobal','callAdditionalPhoneAfterMin','state','additional','dialDropMaxRetry','rescheduleContact','dialDropRetryFrequency','minutes','ContactId','ListId','VoiceQueueId','CampaignId','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','swapAdditionalPhones','Abandoned','CALLEREXIT','countabandonedretry','dialAbandonedRetryFrequency','verifyAdditionalPhones','voiceQueue','dialAbandonedMaxRetry','add','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','syncNewExten','actions','channel','rrmemory','actionid','locked','stateinterface','isNil','idHopper','paused','strategy','roundrobin','run','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','Agent:\x20','[booked][RR][finaly]','contactAgent-idHopper:\x20','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','getQueue','response','Success','callProgressDetecting','[callProgressDetecting]\x20','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','value','HANGUP','outboundAnswerAgiCallsDay','HangupInAMD','membername','AMD','custom:amd','buildObj','amd','saveInDb','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','MACHINE','Machine','countmachineretry','countbusyretry','countcongestionretry','countnosuchnumberretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','[syncHangupInAMDIvr]','[syncAgentComplete][createHistory][0]','countnoanswerretry','reason\x2019\x20machine....','[rescheduleContact][Machine]','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','AGI','outboundUnknownCallsDay','cause-txt','running','isPreviewCampaign','getQueueCampaignStatusMessage','statusMessage','inUse','talking','pTalking','ACTIVE','[syncQueueSummary]','queueSummaryCountersUpdated','assign','throttle','filter','dialPreviewRecallmeReminder','handlePreviewRecallNotifications','map','Agent','user:%s','user:dialPreviewRecallReminder','checkPreviewRecallReminder','clearZombieChannels','[uniqueid]','[actions]','No\x20such\x20channel','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','UserId','[emptyContact]','queueCallerAbandonCreateState','handleIvr','object','voiceQueue\x20is\x20undefine','phone','originate','contact\x20is\x20undefine','getCaller','NONE','\x22agi://%s/square,%s\x22','dialQueueOptions','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','setXMDContactVariables','Contact','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','getCallerId','TrunkBackup','originatecalleridname','extractCalleridName','XMD-ORIGINATECALLERIDNUM','variables','trim','dialCutDigit','dialPrefix','dialOriginateTimeout','outboundOriginateFailureCallsDay','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','dialNoAnswerMaxRetry','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','[rescheduleContact][Drop]','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','checkRetriveMax','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','NoAnswer','custom:agentnoanswer','dialNoAnswerRetryFrequency','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','Busy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','outboundCongestionCallsDay','Congestion','dialCongestionRetryFrequency','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','outboundRejectCallsDay','AgentReject','custom:agentreject','agentreject','reason\x2020\x20agentreject','Global','[moveContactManagedDialer][0]','dialPredictiveOptimizationPercentage','outboundDropCallsDayTimeout','predictiveIntervalAvailable','round','predictiveIntervalMinThreshold','available','floor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','predictiveIntervalErlangCallsDroppedCalls','dialPredictiveOptimization','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','dialPredictiveInterval','started\x20in\x20predictive\x20at','avgHandleTime','getDataPredictive','recalculate\x20predictive\x20at','startMethodPredictive','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(','predictiveIntervalHitRate','dropRate','abandonmentRate','agentBusyFactor','Unknown\x20Predictive','check\x20failure','loggedIn','outboundQueuePauses','[CatchErlangB]','predictiveIntervalPauses','[getDataPredictive]','erlangCallToSecond','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','actionOriginate','scheduledat','dialRecallMeTimeout','unlockContact','outboundReCallsDay','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','QUEUE_RECALL','[Originate][HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','limitCalls','temp','checkContactEmpty','NO_AVAILABLE_CONTACTS','[getContactCampaign2][Empty]','ivrTotalCallsDays','[actionOriginate]\x20','checkIsBlackListIvr','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','countReScheduled','tryOriginatePredictive','[handlePredictive][limitChannel]','getContactDialer','dialOrderByScheduledAt','checkIsBlackList','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','Ts\x20=\x20','interval\x20=\x20','Amax\x20=\x20','erlangb','busyFactor','----\x20Agent\x20Busy\x20Factor\x20----','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','m\x20=\x20','Umin\x20=\x20','util','uuid','../preview/util/util','../../../config/environment/','../../../config/logger','dialer','booked','predictive','syncQueueSummary','redis','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/voiceQueueRt','../rpc/setting','../rpc/interval','./models/action','./models/final','./models/queueCallerAbandon','./models/hangup','env','XCALLY_IP_AGI','127.0.0.1','prototype','enqueue','tail','finally','sequence','preview','voiceQueues','agents','trunks','maxNumberOriginate','channels','uniqueId','optionPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','queuesSummary','bind','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','syncQueueSummaryComplete','syncHangup','newexten','varset','syncVarSet','queuemember','syncQueueMember','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','getSettings','then','isUndefined','emit','type','debug','inspect','voice_queue:save','isEmpty','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalTotalCalls','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAnsweredCalls','info','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsCallersExit','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgHoldtime','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------'];(function(_0x11269e,_0x60b611){var _0x7f8716=function(_0x3b8ef5){while(--_0x3b8ef5){_0x11269e['push'](_0x11269e['shift']());}};_0x7f8716(++_0x60b611);}(_0x3218,0x1cd));var _0x8321=function(_0x2d9e27,_0x5965b2){_0x2d9e27=_0x2d9e27-0x0;var _0xd35381=_0x3218[_0x2d9e27];return _0xd35381;};'use strict';var util=require(_0x8321('0x0'));var _=require('lodash');var uuid=require(_0x8321('0x1'));var moment=require('moment');var rr=require('rr');var Redis=require('ioredis');var utils=require('./utils');var hopperUtils=require('./utils/hopper');var ut=require(_0x8321('0x2'));var config=require(_0x8321('0x3'));var logger=require(_0x8321('0x4'))(_0x8321('0x5'));var loggerBooked=require(_0x8321('0x4'))(_0x8321('0x6'));var loggerPredictive=require(_0x8321('0x4'))(_0x8321('0x7'));var loggerPredictiveCalls=require('../../../config/logger')('predictiveCalls');var loggerSyncQueueSummary=require('../../../config/logger')(_0x8321('0x8'));var ami=require('../ami');config[_0x8321('0x9')]=_['defaults'](config[_0x8321('0x9')],{'host':_0x8321('0xa'),'port':0x18eb});var io=require(_0x8321('0xb'))(new Redis(config[_0x8321('0x9')]));var cmHopper=require(_0x8321('0xc'));var voiceQueueRt=require(_0x8321('0xd'));var RpcSetting=require(_0x8321('0xe'));var Interval=require(_0x8321('0xf'));var Action=require(_0x8321('0x10'));var History=require('./models/history');var Final=require(_0x8321('0x11'));var AgentComplete=require('./models/agentComplete');var QueueCallerAbandon=require(_0x8321('0x12'));var Hangup=require(_0x8321('0x13'));var ipAgi=process[_0x8321('0x14')][_0x8321('0x15')]||_0x8321('0x16');var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x8321('0x17')][_0x8321('0x18')]=function(_0x106e07){this['tail']=this[_0x8321('0x19')]?this[_0x8321('0x19')][_0x8321('0x1a')](_0x106e07):_0x106e07();};function Dialer(_0x3b823e,_0x2f3dad){this[_0x8321('0x1b')]=new Sequence();this[_0x8321('0x1c')]=_0x2f3dad;this['voiceQueues']=_0x3b823e[_0x8321('0x1d')];this['campaigns']=_0x3b823e['campaigns'];this[_0x8321('0x1e')]=_0x3b823e[_0x8321('0x1e')];this['trunks']=_0x3b823e[_0x8321('0x1f')];this[_0x8321('0x20')]=config[_0x8321('0x20')]||0x2;this[_0x8321('0x21')]={};this['actions']={};this['contactsId']={};this[_0x8321('0x22')]={};this[_0x8321('0x23')]={};this['startPredictive']={};this[_0x8321('0x24')]={};this[_0x8321('0x25')]={};this[_0x8321('0x26')]={};this[_0x8321('0x27')]={};this[_0x8321('0x28')]={};ami['on']('agentconnect',this['syncAgentConnect'][_0x8321('0x29')](this));ami['on']('queuecallerabandon',this['syncQueueCallerAbandon'][_0x8321('0x29')](this));ami['on'](_0x8321('0x2a'),this[_0x8321('0x2b')][_0x8321('0x29')](this));ami['on'](_0x8321('0x2c'),this[_0x8321('0x2d')][_0x8321('0x29')](this));ami['on'](_0x8321('0x2e'),this[_0x8321('0x8')]['bind'](this));ami['on']('custom:queuesummarycomplete',this[_0x8321('0x2f')][_0x8321('0x29')](this));ami['on']('hangup',this[_0x8321('0x30')]['bind'](this));ami['on'](_0x8321('0x31'),this['syncNewExten'][_0x8321('0x29')](this));ami['on'](_0x8321('0x32'),this[_0x8321('0x33')][_0x8321('0x29')](this));ami['on'](_0x8321('0x34'),this[_0x8321('0x35')][_0x8321('0x29')](this));ami['on']('queuestatuscomplete',this[_0x8321('0x36')][_0x8321('0x29')](this));this[_0x8321('0x37')]();this[_0x8321('0x38')]();RpcSetting[_0x8321('0x39')]()[_0x8321('0x3a')](function(_0x2fbbba){previewRecallmeReminderInterval=_0x2fbbba['previewRecallmeReminderInterval'];});}function isNotNull(_0x11a74d){return _0x11a74d!==null&&!_[_0x8321('0x3b')](_0x11a74d);}function msgResponse(_0x564b62,_0x4296a6,_0x4b8539){return{'action':_0x564b62,'response':_0x4296a6,'message':_0x4b8539,'stack':_0x4b8539};}function emit(_0x18ab3e,_0x4abc83,_0xc27a9c){io['to'](_0x18ab3e)[_0x8321('0x3c')](_0x4abc83,_0xc27a9c);}function emitOutboundVoiceQueueSummary(_0x10788a){if(_0x10788a[_0x8321('0x3d')]==='outbound'){logger[_0x8321('0x3e')]('[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:',util[_0x8321('0x3f')](_0x10788a,{'showHidden':![],'depth':null}));emit(util['format']('voice:queue:%s',_0x10788a['name']),_0x8321('0x40'),_0x10788a);}}function checkGetDataPredictive(_0x1e7460){if(isNotNull(_0x1e7460)&&!_[_0x8321('0x41')](_0x1e7460)){loggerPredictive['info'](_0x8321('0x42'));loggerPredictive['info'](_0x8321('0x43'),_0x1e7460[_0x8321('0x44')]);loggerPredictive['info'](_0x8321('0x45'),_0x1e7460[_0x8321('0x46')]);loggerPredictive[_0x8321('0x47')]('Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1e7460['predictiveIntervalDroppedCallsTimeout']);loggerPredictive[_0x8321('0x47')](_0x8321('0x48'),_0x1e7460[_0x8321('0x49')]);loggerPredictive['info'](_0x8321('0x4a'),_0x1e7460[_0x8321('0x4b')]);loggerPredictive[_0x8321('0x47')](_0x8321('0x4c'),_0x1e7460['predictiveIntervalAvgTalktime']);loggerPredictive[_0x8321('0x47')](_0x8321('0x4d'));if(_0x1e7460[_0x8321('0x44')]>0x0){if(!_['isUndefined'](_0x1e7460['predictiveIntervalAvgTalktime'])&&_0x1e7460[_0x8321('0x4e')]>0x0){return!![];}loggerPredictive[_0x8321('0x47')](_0x8321('0x4f'));if(!_[_0x8321('0x3b')](_0x1e7460[_0x8321('0x4b')])&&_0x1e7460[_0x8321('0x4b')]>0x0){return!![];}loggerPredictive[_0x8321('0x47')](_0x8321('0x50'));}else{loggerPredictive[_0x8321('0x47')](_0x8321('0x51'));}}else{loggerPredictive[_0x8321('0x47')](_0x8321('0x52'));}return![];}function mergeDataErlangB(_0x1034fb){return function(_0x3a994c){loggerPredictive['info'](_0x8321('0x53'));loggerPredictive[_0x8321('0x47')](_0x8321('0x54'),_0x3a994c[_0x8321('0x55')]);loggerPredictive[_0x8321('0x47')](_0x8321('0x56'),_0x3a994c['erlangCallToSecond']);loggerPredictive[_0x8321('0x47')](_0x8321('0x57'),_0x3a994c[_0x8321('0x58')]);loggerPredictive['info'](_0x8321('0x59'),_0x3a994c[_0x8321('0x5a')]);loggerPredictive[_0x8321('0x47')](_0x8321('0x57'),_0x3a994c[_0x8321('0x58')]);loggerPredictive[_0x8321('0x47')]('---------------------------');_[_0x8321('0x5b')](_0x1034fb,_0x3a994c);};}function ifInterval(_0x22ceff,_0x11bcd5){if(_[_0x8321('0x3b')](_0x11bcd5)){return![];}return utils['getSeconds'](undefined,_0x11bcd5)<_0x22ceff*0x3c;}function clearPredictiveAttributes(_0x1a94f9){if(_0x1a94f9[_0x8321('0x24')]){_0x1a94f9[_0x8321('0x24')]=undefined;loggerPredictive[_0x8321('0x3e')](_0x1a94f9['name'],_0x8321('0x5c'));}if(_0x1a94f9['startPredictive']){_0x1a94f9[_0x8321('0x5d')]=undefined;loggerPredictive['debug'](_0x1a94f9[_0x8321('0x5e')],'startPredictive\x20value\x20cleared');}if(_0x1a94f9['handlePredictive']){clearInterval(_0x1a94f9[_0x8321('0x5f')]);_0x1a94f9[_0x8321('0x5f')]=undefined;loggerPredictive['debug'](_0x1a94f9[_0x8321('0x5e')],_0x8321('0x60'));}}function loggerCatchPredictive(_0x45ff24,_0x5f02d4){return function(_0x3d76a3){loggerPredictive[_0x8321('0x61')](_0x5f02d4['name'],_0x45ff24);loggerPredictive[_0x8321('0x61')](_0x3d76a3[_0x8321('0x62')]);clearPredictiveAttributes(_0x5f02d4);};}function loggerCatch(_0x36bc4d){return function(_0x3a760f){logger[_0x8321('0x61')](_0x36bc4d,util['inspect'](_0x3a760f,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0x51793b,_0x48a362,_0x17b1ad){return function(_0x4b0924){utils['checkContactLowerLimitOriginate'](_0x48a362,_0x17b1ad,0x0);_0x48a362['temp']=0x0;logger[_0x8321('0x61')](_0x51793b,util[_0x8321('0x3f')](_0x4b0924,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x49bd4c){return function(_0x3c6180){if(isNotNull(_0x3c6180)&&isNotNull(_0x3c6180[0x0])){if(_0x3c6180[0x0][_0x8321('0x63')]>0x0){_0x49bd4c[_0x8321('0x64')]=utils['CAMPAIGN_STATUS'][_0x8321('0x65')];logger[_0x8321('0x47')](_0x8321('0x66')+_0x49bd4c[_0x8321('0x5e')],_0x3c6180[0x0][_0x8321('0x63')],_0x8321('0x67'));}else{_0x49bd4c['message']=utils[_0x8321('0x68')]['NO_AVAILABLE_CONTACTS'];logger[_0x8321('0x47')]('[getContactDialer2][Empty]'+_0x49bd4c[_0x8321('0x5e')]);}}};}function createObjHistory(_0x386d07,_0x1d7e9c,_0x5e87e8,_0x24d0ae,_0x2e43c5){_0x386d07[_0x8321('0x64')]=_0x5e87e8;var _0x2a4196=new Action(_0x386d07,_0x1d7e9c);var _0x355ea6=new History(_0x2a4196);_0x355ea6['state']=_0x24d0ae;_0x355ea6[_0x8321('0x69')]=_0x2e43c5;_0x355ea6[_0x8321('0x6a')]=_0x2a4196[_0x8321('0x6b')];return _0x355ea6;}function unlockQueueStatus(_0x1c0bea,_0x5d3371){setTimeout(function(){if(_[_0x8321('0x3b')](_0x1c0bea[_0x8321('0x6c')])){loggerBooked[_0x8321('0x61')](_0x8321('0x6d'),_0x5d3371);}_0x1c0bea[_0x8321('0x6c')]=!![];loggerBooked['info'](_0x8321('0x6e'),_0x5d3371,JSON[_0x8321('0x6f')](_[_0x8321('0x70')](_0x1c0bea,[_0x8321('0x5e'),_0x8321('0x6c')])));},0x1f3);}function checkInterval(_0x52a1d8){return function(){if(!isNotNull(_0x52a1d8[_0x8321('0x71')])){_0x52a1d8[_0x8321('0x64')]=utils[_0x8321('0x68')][_0x8321('0x72')];throw _0x52a1d8[_0x8321('0x5e')]+_0x8321('0x73');}if(!isNotNull(_0x52a1d8[_0x8321('0x71')][_0x8321('0x74')])){_0x52a1d8[_0x8321('0x64')]=utils[_0x8321('0x68')][_0x8321('0x72')];throw _0x52a1d8[_0x8321('0x5e')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_['isEmpty'](_0x52a1d8[_0x8321('0x71')][_0x8321('0x74')]))){_0x52a1d8[_0x8321('0x64')]=utils[_0x8321('0x68')]['NULL_INTERVAL'];throw _0x52a1d8[_0x8321('0x5e')]+_0x8321('0x73');}};}function checkIsIVRCampaignActive(_0x50f0c7){return function(){if(!utils['isIVRCampaignActive'](_0x50f0c7)){_0x50f0c7[_0x8321('0x64')]=utils['CAMPAIGN_STATUS'][_0x8321('0x75')];throw _0x50f0c7[_0x8321('0x5e')]+_0x8321('0x76');}};}function emitCampaignSummary(_0x4764ef){if(utils[_0x8321('0x77')](_0x4764ef)){emit(util['format'](_0x8321('0x78'),_0x4764ef[_0x8321('0x5e')]),_0x8321('0x79'),_0x4764ef);}}function loggerCatchQueueSummary(_0xcdae4b,_0xb8a95b){return function(_0x9cb036){clearPredictiveAttributes(_0xb8a95b);emitCampaignSummary(_0xb8a95b);loggerSyncQueueSummary[_0x8321('0x3e')](_0xcdae4b,util[_0x8321('0x3f')](_0x9cb036,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0x6434b3){if(_0x6434b3[_0x8321('0x7a')]){if(_0x6434b3[_0x8321('0x7b')]===0x0){_0x6434b3[_0x8321('0x7a')]=![];_0x6434b3['message']=utils[_0x8321('0x68')]['INACTIVE'];loggerSyncQueueSummary['debug']('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x6434b3['name'],_0x8321('0x7c'));}else{_0x6434b3['message']=utils[_0x8321('0x68')][_0x8321('0x7d')];loggerSyncQueueSummary['debug'](_0x8321('0x7e'),_0x6434b3['name'],_0x8321('0x7f'));}emitCampaignSummary(_0x6434b3);}}function myreject(_0x2bcf6d){return function(_0x5f4149){return _0x2bcf6d(msgResponse(_0x8321('0x80'),_0x8321('0x81'),JSON[_0x8321('0x6f')](_0x5f4149)));};}Dialer[_0x8321('0x17')][_0x8321('0x82')]=function(_0x5ea4ea){return!_['isUndefined'](_0x5ea4ea)&&_0x5ea4ea&&!_[_0x8321('0x3b')](_0x5ea4ea['name'])&&!_[_0x8321('0x3b')](_0x5ea4ea[_0x8321('0x83')])&&_0x5ea4ea[_0x8321('0x83')]&&(this['trunks'][util[_0x8321('0x84')](_0x8321('0x85'),_0x5ea4ea[_0x8321('0x5e')])][_0x8321('0x86')]===_0x8321('0x87')||this[_0x8321('0x1f')][util['format'](_0x8321('0x85'),_0x5ea4ea['name'])]['status']===_0x8321('0x88'));};Dialer[_0x8321('0x17')][_0x8321('0x89')]=function(_0x1760f7){var _0x4b1958=this;return function(){if(!_0x4b1958[_0x8321('0x82')](_0x1760f7[_0x8321('0x8a')])){if(!_0x4b1958[_0x8321('0x82')](_0x1760f7['TrunkBackup'])){_0x1760f7[_0x8321('0x64')]=utils[_0x8321('0x68')][_0x8321('0x8b')];throw _0x1760f7['name']+_0x8321('0x8c');}}};};Dialer[_0x8321('0x17')][_0x8321('0x8d')]=function(_0x18d262,_0x41059b,_0x33a09a,_0x2ee856){var _0x3f126c=this;return function(){var _0x3e7ae1=!![];return _0x3f126c['ifTimeIvr'](_0x18d262,_0x41059b,_0x33a09a,_0x2ee856,_0x3e7ae1);};};Dialer[_0x8321('0x17')][_0x8321('0x8e')]=function(_0x3db185,_0x2e1910,_0x33a634,_0x34980a){var _0x2d6757=this;return function(){var _0xc86f5c=![];return _0x2d6757[_0x8321('0x8f')](_0x3db185[_0x8321('0x74')],_0x2e1910,_0x33a634,_0x34980a,_0xc86f5c);};};Dialer[_0x8321('0x17')][_0x8321('0x8f')]=function(_0x52034c,_0x4508f8,_0x20fec3,_0x58815e,_0x25a06b){var _0x41cd46=[];return new Promise(function(_0x157c20,_0x5dadb0){if(!isNotNull(_0x52034c)){_0x58815e[_0x8321('0x64')]=utils[_0x8321('0x68')]['NULL_INTERVAL'];return _0x5dadb0(msgResponse(_0x8321('0x90'),_0x8321('0x91'),_0x20fec3+'\x20Intervals\x20is\x20null\x20'));}if(_['isEmpty'](_0x52034c)){_0x58815e['message']=utils[_0x8321('0x68')][_0x8321('0x92')];return _0x5dadb0(msgResponse('ifTime',_0x8321('0x91'),_0x20fec3+'\x20Intervals\x20is\x20empty\x20'));}if(_0x4508f8&&_['isUndefined'](config[_0x8321('0x93')][_0x4508f8])){_0x58815e['message']=utils[_0x8321('0x68')][_0x8321('0x94')];return _0x5dadb0(msgResponse('ifTime',_0x8321('0x91'),_0x20fec3+'\x20Timezone\x20unknow\x20'+_0x4508f8));}if(_[_0x8321('0x95')](_0x52034c)){for(var _0x528b5c=0x0;_0x528b5c<_0x52034c[_0x8321('0x96')];_0x528b5c+=0x1){_0x41cd46[_0x8321('0x97')](ami[_0x8321('0x98')]({'action':_0x8321('0x99'),'command':util['format'](_0x8321('0x9a'),_0x52034c[_0x528b5c]['interval'],!_['isUndefined'](config[_0x8321('0x93')][_0x4508f8])?_0x4508f8:'')})[_0x8321('0x3a')](function(_0x13ead7){return _0x13ead7['content'][_0x8321('0x9b')](_0x8321('0x9c'))>=0x0;})[_0x8321('0x9d')](myreject(_0x5dadb0)));}}else{_0x41cd46[_0x8321('0x97')](ami[_0x8321('0x98')]({'action':_0x8321('0x99'),'command':util[_0x8321('0x84')](_0x8321('0x9a'),_0x52034c,!_[_0x8321('0x3b')](config[_0x8321('0x93')][_0x4508f8])?_0x4508f8:'')})[_0x8321('0x3a')](function(_0x32ebcf){return _0x32ebcf[_0x8321('0x9e')][_0x8321('0x9b')](_0x8321('0x9c'))>=0x0;})['catch'](myreject(_0x5dadb0)));}Promise[_0x8321('0x9f')](_0x41cd46)['then'](function(_0x35ebda){var _0x56e08a=_['some'](_0x35ebda);if(_0x56e08a){return _0x157c20(_0x56e08a);}else{_0x58815e[_0x8321('0x64')]=_0x25a06b?utils[_0x8321('0x68')]['OVERTIME_GLOBAL_INTERVAL']:utils[_0x8321('0x68')][_0x8321('0xa0')];return _0x5dadb0(msgResponse(_0x8321('0xa1'),_0x8321('0x91'),_0x8321('0xa2')+_0x25a06b+'\x20'+_0x20fec3+_0x8321('0xa3')+util[_0x8321('0x3f')](_0x52034c,{'showHidden':![],'depth':null})+_0x8321('0xa4')+_0x4508f8));}})[_0x8321('0x9d')](function(_0x21082f){return _0x5dadb0(msgResponse(_0x8321('0x90'),_0x8321('0x91'),JSON[_0x8321('0x6f')](_0x21082f)));});});};Dialer[_0x8321('0x17')][_0x8321('0x37')]=function(){var _0x3c70e5=this;return cmHopper[_0x8321('0xa5')]({'active':![]},{'where':{'active':!![]}})[_0x8321('0x3a')](function(){setInterval(function(){_0x3c70e5[_0x8321('0xa6')]();},0x3e8);});};Dialer[_0x8321('0x17')]['syncCampaigns']=function(){var _0x3a4e33=this;var _0x20b556;for(var _0x3a673b in this[_0x8321('0xa7')]){if(typeof this['campaigns'][_0x3a673b]!==_0x8321('0xa8')){_0x20b556=this[_0x8321('0xa7')][_0x3a673b];if(utils[_0x8321('0x77')](_0x20b556)&&utils[_0x8321('0xa9')](_0x20b556)){_0x20b556[_0x8321('0x7a')]=!![];Promise[_0x8321('0xaa')]()['then'](checkIsIVRCampaignActive(_0x20b556))['then'](checkInterval(_0x20b556))[_0x8321('0x3a')](_0x3a4e33[_0x8321('0x89')](_0x20b556))[_0x8321('0x3a')](_0x3a4e33[_0x8321('0x8d')](_0x20b556[_0x8321('0xab')],_0x20b556['dialTimezone'],_0x20b556[_0x8321('0x5e')],_0x20b556))[_0x8321('0x3a')](_0x3a4e33[_0x8321('0x8e')](_0x20b556[_0x8321('0x71')],_0x20b556[_0x8321('0xac')],_0x20b556[_0x8321('0x5e')],_0x20b556))['then'](_0x3a4e33[_0x8321('0xad')](_0x20b556))[_0x8321('0x9d')](loggerCatchQueueSummary(_0x8321('0xae'),_0x20b556));}else{notSendMessagesCampaign(_0x20b556);}}}};Dialer['prototype'][_0x8321('0xaf')]=function(_0x1e4a80){if(_0x1e4a80[_0x8321('0xb0')]!==_0x8321('0x7')){clearPredictiveAttributes(_0x1e4a80);}switch(_0x1e4a80[_0x8321('0xb0')]){case _0x8321('0xb1'):this[_0x8321('0xb2')](_0x1e4a80,0x1);break;case _0x8321('0xb3'):this[_0x8321('0xb2')](_0x1e4a80,_0x1e4a80[_0x8321('0xb4')]);break;case _0x8321('0x7'):this[_0x8321('0x7')](_0x1e4a80);break;case _0x8321('0x6'):this['handlePower'](_0x1e4a80,0x1);break;default:logger[_0x8321('0x61')]('Queue',_0x1e4a80[_0x8321('0x5e')],'method\x20not\x20recognized');}};Dialer['prototype'][_0x8321('0x90')]=function(_0x26d5a6,_0x27dfa6){var _0x30f441=_0x26d5a6[_0x8321('0xac')];var _0x47f017=_0x27dfa6?_0x26d5a6[_0x8321('0xab')]:_0x26d5a6[_0x8321('0x71')][_0x8321('0x74')];logger['silly']('Dialer::ifTime()',_0x47f017,_0x30f441,_0x26d5a6[_0x8321('0x5e')],util[_0x8321('0x84')]('Voice\x20Queue\x20%s\x20$s',_0x26d5a6['name'],_0x26d5a6['id']));var _0x1713d0=null;return Interval['intervalIftime'](_0x47f017,_0x30f441)[_0x8321('0x3a')](function(_0x29c60f){if(_0x29c60f===!![]){return _0x29c60f;}else{_0x26d5a6[_0x8321('0x64')]=_0x27dfa6?utils[_0x8321('0x68')][_0x8321('0xb5')]:utils[_0x8321('0x68')][_0x8321('0xa0')];_0x1713d0=msgResponse(_0x8321('0xa1'),'Failure',_0x8321('0xa2')+_0x27dfa6+'\x20'+_0x26d5a6[_0x8321('0x5e')]+_0x8321('0xa3')+util[_0x8321('0x3f')](_0x47f017,{'showHidden':![],'depth':null})+_0x8321('0xa4')+_0x30f441);}if(_0x1713d0!==null){logger[_0x8321('0xb6')](_0x8321('0xb7'),_0x1713d0);_0x1713d0[_0x8321('0xb8')]=_0x27dfa6;throw _0x1713d0;}})[_0x8321('0x9d')](function(_0x155187){logger[_0x8321('0x61')]('AMI\x20IfTime',_0x155187);throw msgResponse(_0x8321('0x80'),'Error',util[_0x8321('0x3f')](_0x155187,{'showHidden':![],'depth':null}));});};Dialer[_0x8321('0x17')]['syncAgentConnect']=function(_0x2044a9){if(this[_0x8321('0x1d')][_0x2044a9[_0x8321('0xb9')]]){if(this[_0x8321('0x22')][_0x2044a9[_0x8321('0xba')]]&&this[_0x8321('0x22')][_0x2044a9[_0x8321('0xba')]]['type']!==_0x8321('0xbb')){this['updateOriginated'](this[_0x8321('0x1d')][_0x2044a9[_0x8321('0xb9')]]);this['uniqueId'][_0x2044a9['uniqueid']][_0x8321('0xbc')]=moment()[_0x8321('0x84')](_0x8321('0xbd'));}}};Dialer[_0x8321('0x17')][_0x8321('0x2d')]=function(_0x512889){var _0x16c485=this['uniqueId'][_0x512889[_0x8321('0xba')]];if(this['voiceQueues'][_0x512889[_0x8321('0xb9')]]){if(_0x16c485&&_0x16c485['type']!==_0x8321('0xbb')){delete this['uniqueId'][_0x512889['uniqueid']];this['voiceQueues'][_0x512889[_0x8321('0xb9')]][_0x8321('0xbe')]+=0x1;var _0x13e2c8=new AgentComplete(_0x16c485,_0x512889);if(_0x512889[_0x8321('0xbf')]===_0x8321('0xc0')){_0x13e2c8['agiafterat']=this[_0x8321('0x1d')][_0x512889[_0x8321('0xb9')]]['dialQueueProject2']&&this[_0x8321('0x1d')][_0x512889[_0x8321('0xb9')]][_0x8321('0xc1')]?moment()[_0x8321('0x84')](_0x8321('0xbd')):undefined;}hopperUtils[_0x8321('0xc2')](_0x13e2c8)[_0x8321('0x9d')](loggerCatch(_0x8321('0xc3')));hopperUtils[_0x8321('0xc4')](_0x13e2c8)[_0x8321('0x9d')](loggerCatch(_0x8321('0xc5')));}}};Dialer['prototype'][_0x8321('0xc6')]=function(_0x468e9a){var _0x57ff78=this[_0x8321('0x22')][_0x468e9a['uniqueid']];var _0x20f0d6=this;var _0x42be6d=![];var _0x595f92;var _0x584269;if(this[_0x8321('0x1d')][_0x468e9a['queue']]){if(_0x57ff78&&_0x57ff78[_0x8321('0x3d')]!=='ivr'){delete this['uniqueId'][_0x468e9a[_0x8321('0xba')]];this[_0x8321('0xc7')](this[_0x8321('0x1d')][_0x468e9a[_0x8321('0xb9')]]);_0x57ff78[_0x8321('0xc8')]=moment()[_0x8321('0x84')](_0x8321('0xbd'));var _0xa643ea=new QueueCallerAbandon(_0x57ff78,_0x468e9a);if(utils[_0x8321('0xc9')](_0x57ff78[_0x8321('0xc8')],_0x57ff78[_0x8321('0xca')])>=_0x57ff78[_0x8321('0xcb')]){this[_0x8321('0x1d')][_0x468e9a['queue']][_0x8321('0xcc')]+=0x1;this[_0x8321('0x1d')][_0x468e9a[_0x8321('0xb9')]]['outboundDropCallsDayTimeout']+=0x1;this['voiceQueues'][_0x468e9a[_0x8321('0xb9')]]['predictiveIntervalErlangCallsDroppedCalls']+=0x1;_0xa643ea['state']=0xa;_0xa643ea['statedesc']=_0x8321('0xcd');_0xa643ea[_0x8321('0xce')]=_0x8321('0xcf');_0xa643ea['agiafterat']=this[_0x8321('0x1d')][_0x468e9a['queue']][_0x8321('0xd0')]?moment()[_0x8321('0x84')](_0x8321('0xbd')):undefined;_0xa643ea[_0x8321('0xd1')]+=0x1;_0xa643ea[_0x8321('0xd2')]+=0x1;_0x595f92=this[_0x8321('0x1d')][_0x468e9a[_0x8321('0xb9')]]['dialDropRetryFrequency'];_0x584269=this[_0x8321('0x1d')][_0x468e9a[_0x8321('0xb9')]][_0x8321('0xd3')];hopperUtils['verifyAdditionalPhones'](_0xa643ea,_0xa643ea[_0x8321('0xd4')],_0x57ff78['voiceQueue'])[_0x8321('0x3a')](function(_0x35b95c){_0x42be6d=_0x35b95c[_0x8321('0xd5')]==0x1;if(_0xa643ea[_0x8321('0xd1')]>=_0x20f0d6[_0x8321('0x1d')][_0x468e9a[_0x8321('0xb9')]][_0x8321('0xd6')]){_0x20f0d6['queueCallerAbandonCreateState'](_0xa643ea,_0x35b95c[_0x8321('0xd5')]);}else{hopperUtils[_0x8321('0xd7')]({'active':![],'countdropretry':_0xa643ea[_0x8321('0xd1')],'scheduledat':moment()['add'](_0x20f0d6[_0x8321('0x1d')][_0x468e9a[_0x8321('0xb9')]][_0x8321('0xd8')],_0x8321('0xd9'))[_0x8321('0x84')](_0x8321('0xbd')),'ContactId':_0x57ff78[_0x8321('0xda')],'ListId':_0x57ff78[_0x8321('0xdb')],'VoiceQueueId':_0x57ff78[_0x8321('0xdc')]||undefined,'CampaignId':_0x57ff78[_0x8321('0xdd')]||undefined})[_0x8321('0x9d')](loggerCatch('[rescheduleContact][Drop]'));var _0x1f6d4f=new History(_0xa643ea);_0x1f6d4f['state']=0xa;_0x1f6d4f[_0x8321('0x69')]=_0x8321('0xcd');_0x1f6d4f[_0x8321('0x6b')]=moment()['format'](_0x8321('0xbd'));_0x1f6d4f[_0x8321('0x6a')]=_0x1f6d4f['starttime'];_0x1f6d4f[_0x8321('0xde')]=_0xa643ea['calleridname'];_0x1f6d4f[_0x8321('0xdf')]=_0xa643ea['calleridnum'];hopperUtils[_0x8321('0xc2')](_0x1f6d4f)[_0x8321('0x9d')](loggerCatch(_0x8321('0xe0')));}})[_0x8321('0x3a')](function(){if(_0x42be6d)hopperUtils[_0x8321('0xe1')](_0xa643ea,_0x595f92,_0x584269)[_0x8321('0x3a')](function(){return 0x1;});});}else{this[_0x8321('0x1d')][_0x468e9a[_0x8321('0xb9')]]['predictiveIntervalDroppedCallsCallersExit']+=0x1;this[_0x8321('0x1d')][_0x468e9a[_0x8321('0xb9')]]['outboundDropCallsDayCallersExit']+=0x1;_0xa643ea['state']=0xb;_0xa643ea[_0x8321('0x69')]=_0x8321('0xe2');_0xa643ea['dropreason']=_0x8321('0xe3');_0xa643ea[_0x8321('0xe4')]+=0x1;_0xa643ea['countglobal']+=0x1;_0x595f92=this[_0x8321('0x1d')][_0x468e9a[_0x8321('0xb9')]][_0x8321('0xe5')];_0x584269=this[_0x8321('0x1d')][_0x468e9a[_0x8321('0xb9')]][_0x8321('0xd3')];hopperUtils[_0x8321('0xe6')](_0xa643ea,_0xa643ea[_0x8321('0xd4')],_0x57ff78[_0x8321('0xe7')])[_0x8321('0x3a')](function(_0x29d956){if(_0xa643ea['countabandonedretry']>=_0x20f0d6[_0x8321('0x1d')][_0x468e9a[_0x8321('0xb9')]][_0x8321('0xe8')]){_0x20f0d6['queueCallerAbandonCreateState'](_0xa643ea,_0x29d956[_0x8321('0xd5')]);}else{hopperUtils['rescheduleContact']({'active':![],'countabandonedretry':_0xa643ea['countabandonedretry'],'scheduledat':moment()[_0x8321('0xe9')](_0x20f0d6[_0x8321('0x1d')][_0x468e9a[_0x8321('0xb9')]][_0x8321('0xe5')],_0x8321('0xd9'))['format'](_0x8321('0xbd')),'ContactId':_0x57ff78[_0x8321('0xda')],'ListId':_0x57ff78[_0x8321('0xdb')],'VoiceQueueId':_0x57ff78[_0x8321('0xdc')]||undefined,'CampaignId':_0x57ff78[_0x8321('0xdd')]||undefined})[_0x8321('0x9d')](loggerCatch(_0x8321('0xea')));var _0x1a239f=new History(_0xa643ea);_0x1a239f[_0x8321('0xd4')]=0xb;_0x1a239f[_0x8321('0x69')]=_0x8321('0xe2');_0x1a239f[_0x8321('0x6b')]=moment()[_0x8321('0x84')](_0x8321('0xbd'));_0x1a239f[_0x8321('0x6a')]=_0x1a239f['starttime'];_0x1a239f[_0x8321('0xde')]=_0xa643ea['calleridname'];_0x1a239f[_0x8321('0xdf')]=_0xa643ea[_0x8321('0xdf')];hopperUtils['createHistory'](_0x1a239f)[_0x8321('0x9d')](loggerCatch(_0x8321('0xeb')));}})[_0x8321('0x3a')](function(){if(_0x42be6d)hopperUtils[_0x8321('0xe1')](_0xa643ea,_0x595f92,_0x584269)[_0x8321('0x3a')](function(){return 0x1;});});}}}};Dialer[_0x8321('0x17')][_0x8321('0xec')]=function(_0x713d55){if(this[_0x8321('0xed')][_0x713d55[_0x8321('0xba')]]){this[_0x8321('0xed')][_0x713d55[_0x8321('0xba')]][_0x8321('0xee')]=_0x713d55[_0x8321('0xee')];}if(this[_0x8321('0x22')][_0x713d55[_0x8321('0xba')]]){this[_0x8321('0x22')][_0x713d55[_0x8321('0xba')]][_0x8321('0xee')]=_0x713d55[_0x8321('0xee')];}};Dialer[_0x8321('0x17')][_0x8321('0x35')]=function(_0x3ca947){if(!this[_0x8321('0xed')][_0x3ca947['actionid']]){return;}var _0x94939f=this[_0x8321('0x1d')][this[_0x8321('0xed')][_0x3ca947['actionid']][_0x8321('0xb9')]]['strategy']||_0x8321('0xef');if(_0x94939f==='roundrobin'){if(this[_0x8321('0xed')][_0x3ca947[_0x8321('0xf0')]]&&_['isNil'](this[_0x8321('0xed')][_0x3ca947['actionid']][_0x8321('0xf1')])&&_0x3ca947[_0x8321('0x86')]==='1'&&_0x3ca947['paused']==='0'){if(this[_0x8321('0x1e')][_0x3ca947[_0x8321('0xf2')]]){if(!this['agents'][_0x3ca947[_0x8321('0xf2')]][_0x8321('0xf1')]){this[_0x8321('0x1e')][_0x3ca947['stateinterface']][_0x8321('0xf1')]=!![];this['actions'][_0x3ca947[_0x8321('0xf0')]]['locked']=!![];this[_0x8321('0xed')][_0x3ca947[_0x8321('0xf0')]][_0x8321('0xf2')]=_0x3ca947[_0x8321('0xf2')];}}}}else if(_0x94939f===_0x8321('0xef')){if(this[_0x8321('0xed')][_0x3ca947[_0x8321('0xf0')]]){if(this[_0x8321('0x1e')][_0x3ca947['stateinterface']]){this[_0x8321('0xed')][_0x3ca947[_0x8321('0xf0')]][_0x8321('0xf2')]=_0x3ca947['stateinterface'];if(_[_0x8321('0xf3')](this[_0x8321('0x26')][this[_0x8321('0xed')][_0x3ca947[_0x8321('0xf0')]][_0x8321('0xb9')]])){this['queueBooked'][this['actions'][_0x3ca947[_0x8321('0xf0')]][_0x8321('0xb9')]]=[];}this['queueBooked'][this[_0x8321('0xed')][_0x3ca947['actionid']][_0x8321('0xb9')]][_0x8321('0x97')](_['merge'](_[_0x8321('0x70')](this[_0x8321('0xed')][_0x3ca947['actionid']],[_0x8321('0xf4'),_0x8321('0xf2')]),{'status':_0x3ca947[_0x8321('0x86')],'paused':_0x3ca947[_0x8321('0xf5')]}));}}}};Dialer[_0x8321('0x17')][_0x8321('0x36')]=function(_0x4f42bb){if(!this[_0x8321('0xed')][_0x4f42bb[_0x8321('0xf0')]]){return;}var _0x502843=this;var _0x1ddffc=this['voiceQueues'][this[_0x8321('0xed')][_0x4f42bb[_0x8321('0xf0')]]['queue']];var _0x561ce7=_0x1ddffc[_0x8321('0xf6')]||_0x8321('0xef');if(_0x561ce7===_0x8321('0xf7')){if(this['actions'][_0x4f42bb[_0x8321('0xf0')]]&&this[_0x8321('0xed')][_0x4f42bb[_0x8321('0xf0')]]['stateinterface']){this[_0x8321('0x1c')][_0x8321('0xf8')](this['actions'][_0x4f42bb[_0x8321('0xf0')]][_0x8321('0xf4')],this[_0x8321('0xed')][_0x4f42bb[_0x8321('0xf0')]]['stateinterface'])[_0x8321('0x9d')](function(_0x2410df){logger[_0x8321('0x61')](_0x8321('0xf9'),util[_0x8321('0x3f')](_0x2410df,{'showHidden':![],'depth':null}));})[_0x8321('0x1a')](function(){_0x502843[_0x8321('0xc7')](_0x502843[_0x8321('0x1d')][_0x502843[_0x8321('0xed')][_0x4f42bb[_0x8321('0xf0')]][_0x8321('0xb9')]]);_0x502843[_0x8321('0x1e')][_0x502843[_0x8321('0xed')][_0x4f42bb[_0x8321('0xf0')]][_0x8321('0xf2')]][_0x8321('0xf1')]=![];delete _0x502843['actions'][_0x4f42bb['actionid']];unlockQueueStatus(_0x1ddffc);});}else{this[_0x8321('0xc7')](this['voiceQueues'][this[_0x8321('0xed')][_0x4f42bb[_0x8321('0xf0')]]['queue']]);hopperUtils['rescheduleContact']({'active':![],'ContactId':this[_0x8321('0xed')][_0x4f42bb['actionid']][_0x8321('0xda')],'ListId':this[_0x8321('0xed')][_0x4f42bb[_0x8321('0xf0')]][_0x8321('0xdb')],'VoiceQueueId':this[_0x8321('0xed')][_0x4f42bb['actionid']][_0x8321('0xdc')]||undefined,'CampaignId':this[_0x8321('0xed')][_0x4f42bb[_0x8321('0xf0')]]['CampaignId']||undefined})[_0x8321('0x9d')](loggerCatch(_0x8321('0xfa')));delete this['actions'][_0x4f42bb[_0x8321('0xf0')]];unlockQueueStatus(_0x1ddffc);}}else if(_0x561ce7===_0x8321('0xef')){var _0x33e9d8;if(this[_0x8321('0xed')][_0x4f42bb[_0x8321('0xf0')]]&&!_['isEmpty'](this[_0x8321('0x26')][this[_0x8321('0xed')][_0x4f42bb[_0x8321('0xf0')]]['queue']])){if(this['queueBookedRR'][_0x502843['actions'][_0x4f42bb['actionid']]['queue']]){this[_0x8321('0x27')][_0x502843[_0x8321('0xed')][_0x4f42bb[_0x8321('0xf0')]][_0x8321('0xb9')]]=this['queueBookedRR'][this[_0x8321('0xed')][_0x4f42bb['actionid']][_0x8321('0xb9')]]?this[_0x8321('0x27')][this[_0x8321('0xed')][_0x4f42bb['actionid']][_0x8321('0xb9')]]:this['queueBooked'][this[_0x8321('0xed')][_0x4f42bb[_0x8321('0xf0')]][_0x8321('0xb9')]]?this[_0x8321('0x26')][this['actions'][_0x4f42bb[_0x8321('0xf0')]][_0x8321('0xb9')]][_0x8321('0xfb')]||0x0:0x0;}this[_0x8321('0x26')][this['actions'][_0x4f42bb['actionid']]['queue']][_0x8321('0xfb')]=this[_0x8321('0x27')][this['actions'][_0x4f42bb[_0x8321('0xf0')]]['queue']];for(var _0x530d6f=0x0;_0x530d6f=_0x59b47f[_0x8321('0x123')]){_0x5a4ec5[_0x8321('0x124')](_0x557a69,_0x55d8ac,_0x20e4dc,_0x8321('0x125'));}else{if(_0x557a69[_0x8321('0x11e')]>=_0x59b47f[_0x8321('0x126')]){_0x5a4ec5[_0x8321('0x127')](_0x557a69,_0x55d8ac,_0x20e4dc,'reason\x2019\x20machine....');}else{hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0x557a69[_0x8321('0x11e')],'scheduledat':moment()['add'](_0x59b47f['dialMachineRetryFrequency'],'minutes')[_0x8321('0x84')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x557a69[_0x8321('0xda')],'ListId':_0x557a69[_0x8321('0xdb')],'VoiceQueueId':_0x557a69[_0x8321('0xdc')]||undefined,'CampaignId':_0x557a69[_0x8321('0xdd')]||undefined})[_0x8321('0x9d')](loggerCatch('[rescheduleContact][Machine]'));_0x55d8ac({'reschedule':0x1});}}});}if(_0x483717[_0x8321('0x3d')]===_0x8321('0xbb')&&this[_0x8321('0xa7')][_0x483717[_0x8321('0xb9')]][_0x8321('0x10f')]&&_0x102f94[_0x8321('0x110')]===_0x8321('0x111')){delete this['uniqueId'][_0x102f94['uniqueid']];this[_0x8321('0xc7')](this[_0x8321('0xa7')][_0x483717[_0x8321('0xb9')]]);_0x4831ba=new Hangup(_0x483717,_0x102f94);_0x4831ba['state']=0x12;_0x4831ba['statedesc']='HangupInAMD';_0x4831ba[_0x8321('0x114')]='AMD';ami[_0x8321('0x3c')](_0x8321('0x116'),ut[_0x8321('0x117')](_0x4831ba,_0x8321('0x118')));this['saveInDb'](_0x4831ba,'[syncHangupInAMDIvr][createHistory]',_0x8321('0x128'));}if(_0x483717[_0x8321('0x3d')]===_0x8321('0xbb')&&this['campaigns'][_0x483717[_0x8321('0xb9')]][_0x8321('0x10f')]&&_0x102f94[_0x8321('0x110')]===_0x8321('0x11c')){return new Promise(function(_0x1f03a2,_0x121756){delete _0x5a4ec5[_0x8321('0x22')][_0x102f94['uniqueid']];_0x5a4ec5[_0x8321('0xc7')](_0x5a4ec5[_0x8321('0xa7')][_0x483717['queue']]);_0x5a4ec5[_0x8321('0xa7')][_0x483717[_0x8321('0xb9')]][_0x8321('0xbe')]+=0x1;_0x5a4ec5[_0x8321('0xa7')][_0x483717[_0x8321('0xb9')]][_0x8321('0x112')]+=0x1;var _0x539dfb=_0x5a4ec5[_0x8321('0xa7')][_0x483717['queue']];var _0x546c3c=new Hangup(_0x483717,_0x102f94);_0x546c3c[_0x8321('0xd4')]=0x13;_0x546c3c['statedesc']=_0x8321('0x11d');_0x546c3c['membername']='AMD';_0x546c3c[_0x8321('0x11e')]+=0x1;_0x546c3c[_0x8321('0xd2')]+=0x1;_0x546c3c[_0x8321('0x118')]=!![];ami[_0x8321('0x3c')](_0x8321('0x116'),ut[_0x8321('0x117')](_0x546c3c,_0x8321('0x118')));hopperUtils[_0x8321('0xc2')](_0x546c3c)[_0x8321('0x9d')](loggerCatch(_0x8321('0x129')));if(_0x546c3c[_0x8321('0x11f')]+_0x546c3c['countcongestionretry']+_0x546c3c[_0x8321('0x12a')]+_0x546c3c[_0x8321('0x121')]+_0x546c3c[_0x8321('0xd1')]+_0x546c3c[_0x8321('0xe4')]+_0x546c3c[_0x8321('0x11e')]+_0x546c3c[_0x8321('0x122')]>=_0x539dfb['dialGlobalMaxRetry']){_0x5a4ec5[_0x8321('0x124')](_0x546c3c,_0x1f03a2,_0x121756,_0x8321('0x125'));}else{if(_0x546c3c['countmachineretry']>=_0x539dfb[_0x8321('0x126')]){_0x5a4ec5[_0x8321('0x127')](_0x546c3c,_0x1f03a2,_0x121756,_0x8321('0x12b'));}else{hopperUtils[_0x8321('0xd7')]({'active':![],'countmachineretry':_0x546c3c['countmachineretry'],'scheduledat':moment()['add'](_0x539dfb['dialMachineRetryFrequency'],_0x8321('0xd9'))[_0x8321('0x84')](_0x8321('0xbd')),'ContactId':_0x546c3c[_0x8321('0xda')],'ListId':_0x546c3c[_0x8321('0xdb')],'VoiceQueueId':_0x546c3c[_0x8321('0xdc')]||undefined,'CampaignId':_0x546c3c[_0x8321('0xdd')]||undefined})[_0x8321('0x9d')](loggerCatch(_0x8321('0x12c')));_0x1f03a2({'reschedule':0x1});}}});}}};Dialer[_0x8321('0x17')][_0x8321('0x30')]=function(_0x42da2c){var _0x581914=this[_0x8321('0x22')][_0x42da2c[_0x8321('0xba')]];var _0x75d941;if(_0x581914&&_0x581914[_0x8321('0x3d')]==='ivr'){delete this[_0x8321('0x22')][_0x42da2c[_0x8321('0xba')]];this[_0x8321('0xc7')](this[_0x8321('0xa7')][_0x581914[_0x8321('0xb9')]]);this[_0x8321('0xa7')][_0x581914[_0x8321('0xb9')]]['ivrAnswerCallsDay']+=0x1;_0x75d941=new Hangup(_0x581914,_0x42da2c);hopperUtils[_0x8321('0xc2')](_0x75d941)[_0x8321('0x9d')](loggerCatch(_0x8321('0x12d')));hopperUtils[_0x8321('0xc4')](_0x75d941)[_0x8321('0x9d')](loggerCatch(_0x8321('0x12e')));}if(_0x581914&&_0x581914['type']!=='ivr'&&isNotNull(this[_0x8321('0x1d')][_0x581914['queue']][_0x8321('0x12f')])){delete this['uniqueId'][_0x42da2c[_0x8321('0xba')]];this['updateOriginated'](this['voiceQueues'][_0x581914['queue']]);this['voiceQueues'][_0x581914['queue']][_0x8321('0xbe')]+=0x1;this[_0x8321('0x1d')][_0x581914[_0x8321('0xb9')]][_0x8321('0x112')]+=0x1;_0x75d941=new Hangup(_0x581914,_0x42da2c);_0x75d941[_0x8321('0xd4')]=0x10;_0x75d941[_0x8321('0x69')]=_0x8321('0x130');_0x75d941[_0x8321('0x114')]=_0x8321('0x131');hopperUtils[_0x8321('0xc2')](_0x75d941)[_0x8321('0x9d')](loggerCatch(_0x8321('0x12d')));hopperUtils[_0x8321('0xc4')](_0x75d941)[_0x8321('0x9d')](loggerCatch(_0x8321('0x12e')));}if(_0x581914&&_0x581914[_0x8321('0x3d')]!=='ivr'&&!isNotNull(this[_0x8321('0x1d')][_0x581914[_0x8321('0xb9')]][_0x8321('0x12f')])){delete this['uniqueId'][_0x42da2c[_0x8321('0xba')]];this['updateOriginated'](this[_0x8321('0x1d')][_0x581914['queue']]);this[_0x8321('0x1d')][_0x581914[_0x8321('0xb9')]][_0x8321('0x132')]+=0x1;_0x75d941=new Hangup(_0x581914,_0x42da2c);_0x75d941['state']=0xc;_0x75d941[_0x8321('0x69')]=_0x42da2c[_0x8321('0x133')];_0x75d941[_0x8321('0x114')]='Unknow';hopperUtils['createHistory'](_0x75d941)[_0x8321('0x9d')](loggerCatch(_0x8321('0x12d')));hopperUtils[_0x8321('0xc4')](_0x75d941)[_0x8321('0x9d')](loggerCatch('[syncHangupIvr]'));}};Dialer[_0x8321('0x17')][_0x8321('0x8')]=function(_0x484d4a){var _0x5b60f8=this;if(!_0x5b60f8[_0x8321('0x28')][_0x484d4a[_0x8321('0x5e')]]){_0x5b60f8[_0x8321('0x28')][_0x484d4a[_0x8321('0x5e')]]={'running':![]};}else if(_0x5b60f8[_0x8321('0x28')][_0x484d4a[_0x8321('0x5e')]]['running']===!![]){return;}else if(_0x5b60f8['queuesSummary'][_0x484d4a[_0x8321('0x5e')]][_0x8321('0x134')]===![]){_0x5b60f8[_0x8321('0x28')][_0x484d4a['name']][_0x8321('0x134')]=!![];}var _0x56a28d=_0x5b60f8[_0x8321('0x1d')][_0x484d4a[_0x8321('0x5e')]];var _0x5d2f52=_0x56a28d[_0x8321('0x64')]!==utils[_0x8321('0x68')][_0x8321('0x75')];var _0x1266bf=utils[_0x8321('0x135')](_0x56a28d);_0x56a28d['statusMessage']=utils[_0x8321('0x136')](_0x56a28d,_0x5b60f8[_0x8321('0x1f')]);Promise[_0x8321('0xaa')]()[_0x8321('0x3a')](function(){if(_0x56a28d[_0x8321('0x137')]===utils[_0x8321('0x68')][_0x8321('0x75')]){if(_0x5d2f52){clearPredictiveAttributes(_0x56a28d);_0x484d4a['startPredictive']=undefined;_0x484d4a[_0x8321('0x24')]=undefined;}if(_0x56a28d[_0x8321('0x137')]===utils[_0x8321('0x68')]['INACTIVE']){_0x484d4a['available']=0x0;_0x484d4a[_0x8321('0xf5')]=0x0;_0x484d4a[_0x8321('0x138')]=0x0;_0x484d4a[_0x8321('0x139')]=0x0;_0x484d4a[_0x8321('0x13a')]=0x0;}}else if(_0x56a28d['statusMessage']===utils[_0x8321('0x68')][_0x8321('0x13b')]&&!_0x1266bf){return _0x5b60f8[_0x8321('0x90')](_0x56a28d,!![])[_0x8321('0x3a')](function(){return _0x5b60f8[_0x8321('0x90')](_0x56a28d,![]);})[_0x8321('0x3a')](function(){return _0x5b60f8[_0x8321('0xaf')](_0x56a28d);})[_0x8321('0x9d')](function(_0x26d2bd){loggerSyncQueueSummary['debug'](_0x8321('0x13c'),util[_0x8321('0x3f')](_0x26d2bd,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x56a28d);});}else{clearPredictiveAttributes(_0x56a28d);}})['then'](function(){var _0x218450=_0x484d4a['compareToOutboundQueue'](_0x56a28d);if(_0x218450||_0x56a28d[_0x8321('0x13d')]){_0x56a28d[_0x8321('0x13d')]=![];_0x484d4a['updateReportFromOutboundQueue'](_0x56a28d);Object[_0x8321('0x13e')](_0x56a28d,_0x484d4a);emitOutboundVoiceQueueSummary(_0x484d4a);}_0x5b60f8[_0x8321('0x28')][_0x56a28d[_0x8321('0x5e')]][_0x8321('0x134')]=![];})[_0x8321('0x9d')](function(_0x3c8035){logger[_0x8321('0x61')](_0x8321('0x13c'),util[_0x8321('0x3f')](_0x3c8035,{'showHidden':![],'depth':null}));_0x5b60f8[_0x8321('0x28')][_0x56a28d['name']][_0x8321('0x134')]=![];});};Dialer[_0x8321('0x17')][_0x8321('0x2f')]=_[_0x8321('0x13f')](function(){var _0x453c94=_[_0x8321('0x140')](this['voiceQueues'],function(_0x3e1cb0){return _0x3e1cb0[_0x8321('0x141')];});var _0x42ba11=_[_0x8321('0x140')](this[_0x8321('0x1e')],function(_0x8dbbab){return _0x8dbbab['online']&&_0x8dbbab[_0x8321('0x86')]==='reachable';});if(_0x453c94['length']>0x0&&_0x42ba11[_0x8321('0x96')]>0x0){return Promise[_0x8321('0xaa')]()[_0x8321('0x3a')](cmHopper[_0x8321('0x142')](_[_0x8321('0x143')](_0x453c94,'id'),previewRecallmeReminderInterval,_[_0x8321('0x143')](_0x42ba11,'id')))[_0x8321('0x3a')](function(_0x80d84b){for(var _0x1eddf4=0x0;_0x1eddf4<_0x80d84b[_0x8321('0x96')];_0x1eddf4++){var _0x41120a=_0x80d84b[_0x1eddf4][_0x8321('0x144')][_0x8321('0x5e')];if(_0x41120a)io['to'](util[_0x8321('0x84')](_0x8321('0x145'),_0x41120a))[_0x8321('0x3c')](_0x8321('0x146'),{'hopper':_0x80d84b[_0x1eddf4]});}})[_0x8321('0x9d')](function(_0x360e72){logger['error'](_0x8321('0x147'),_0x360e72);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0x8321('0x17')][_0x8321('0x38')]=function(){var _0x432180=this;setInterval(function(){_0x432180[_0x8321('0x148')](_0x432180[_0x8321('0x22')],_0x8321('0x149'));_0x432180[_0x8321('0x148')](_0x432180[_0x8321('0xed')],_0x8321('0x14a'));},0x32c8);};Dialer[_0x8321('0x17')]['clearZombieChannels']=function(_0x5d99e1,_0xc58f99){var _0xdd38e9=this;for(var _0x45e405 in _0x5d99e1){if(typeof _0x5d99e1[_0x45e405]!=='undefined'){this[_0x8321('0x1b')][_0x8321('0x18')](function(){if(!_[_0x8321('0xf3')](_0x5d99e1[_0x45e405])){return ami[_0x8321('0x98')]({'action':_0x8321('0x86'),'channel':_0x5d99e1[_0x45e405][_0x8321('0xee')]})[_0x8321('0x9d')](function(_0x235cd5){if(_0x235cd5[_0x8321('0x64')]===_0x8321('0x14b')){setTimeout(function(){if(_0x5d99e1[_0x45e405]&&_0x5d99e1[_0x45e405][_0x8321('0x3d')]!==_0x8321('0xbb')){_0xdd38e9[_0x8321('0xc7')](_0xdd38e9['voiceQueues'][_0x5d99e1[_0x45e405][_0x8321('0xb9')]]);logger[_0x8321('0x61')](_0x8321('0x14c'),_0xc58f99,_0x45e405,_0x5d99e1[_0x45e405][_0x8321('0xb9')]);delete _0x5d99e1[_0x45e405];}if(_0x5d99e1[_0x45e405]&&_0x5d99e1[_0x45e405][_0x8321('0x3d')]===_0x8321('0xbb')){_0xdd38e9[_0x8321('0xc7')](_0xdd38e9[_0x8321('0xa7')][_0x5d99e1[_0x45e405][_0x8321('0xb9')]]);logger['error'](_0x8321('0x14d'),_0xc58f99,_0x45e405,_0x5d99e1[_0x45e405]['queue']);delete _0x5d99e1[_0x45e405];}},0x2328);}});}});}}};Dialer[_0x8321('0x17')]['getVoiceQueueRtPauses']=function(_0xfe5365){return Promise[_0x8321('0xaa')]()[_0x8321('0x3a')](voiceQueueRt[_0x8321('0x14e')](_0xfe5365))[_0x8321('0x9d')](loggerCatch(_0x8321('0x14f')));};Dialer[_0x8321('0x17')][_0x8321('0xc7')]=function(_0x54d722){if(!_[_0x8321('0x3b')](_0x54d722)&&_0x54d722!==null){if(typeof _0x54d722[_0x8321('0x7b')]!==_0x8321('0xa8')){if(_0x54d722['originated']>0x0){_0x54d722[_0x8321('0x7b')]-=0x1;}else{logger[_0x8321('0x61')](_0x8321('0x150'));}}}else{logger[_0x8321('0x61')](_0x8321('0x151'));}};Dialer[_0x8321('0x17')][_0x8321('0x152')]=function(_0x555b02,_0x61edcb){var _0x5f19e1=this;return function(_0x2957e1){_0x5f19e1[_0x8321('0xc7')](_0x61edcb);logger[_0x8321('0x61')](_0x555b02,util[_0x8321('0x3f')](_0x2957e1,{'showHidden':![],'depth':null}));};};Dialer[_0x8321('0x17')][_0x8321('0x153')]=function(_0x3e6beb,_0x9d8afd,_0x1bd43b){var _0x190311={'state':0x19,'statedesc':'notFound'};this['updateOriginated'](_0x9d8afd);this[_0x8321('0x119')](_[_0x8321('0x5b')](_0x190311,_['pick'](_0x1bd43b,[_0x8321('0xda'),_0x8321('0xdb'),_0x8321('0x154'),_0x8321('0xdc'),_0x8321('0xdd')])),'[emptyContact][createHistory]',_0x8321('0x155'));logger[_0x8321('0x61')](_0x3e6beb);};Dialer[_0x8321('0x17')][_0x8321('0x119')]=function(_0x2c8654,_0x5597cb,_0xb9c97){hopperUtils[_0x8321('0xc2')](_0x2c8654)[_0x8321('0x9d')](loggerCatch(_0x5597cb));hopperUtils[_0x8321('0xc4')](_0x2c8654)[_0x8321('0x9d')](loggerCatch(_0xb9c97));};Dialer['prototype'][_0x8321('0x156')]=function(_0x3c64bf,_0x5877c8){hopperUtils[_0x8321('0xc2')](_0x3c64bf)[_0x8321('0x9d')](loggerCatch(_0x8321('0xc3')));if(_0x5877c8==0x0){hopperUtils[_0x8321('0xc4')](_0x3c64bf)[_0x8321('0x9d')](loggerCatch('[syncQueueCallerAbandon]\x20[Drop]'));}};Dialer[_0x8321('0x17')][_0x8321('0x147')]=function(_0x2b7850){return Promise['resolve']()[_0x8321('0x3a')](cmHopper[_0x8321('0x142')](_0x2b7850['id'],previewRecallmeReminderInterval))[_0x8321('0x3a')](function(_0x2b731a){for(var _0x1ff915=0x0;_0x1ff915<_0x2b731a[_0x8321('0x96')];_0x1ff915++){var _0x2034cf=_0x2b731a[_0x1ff915][_0x8321('0x144')][_0x8321('0x5e')];if(_0x2034cf)io['to'](util[_0x8321('0x84')]('user:%s',_0x2034cf))[_0x8321('0x3c')](_0x8321('0x146'),{'hopper':_0x2b731a[_0x1ff915]});}})['catch'](function(){});};Dialer[_0x8321('0x17')]['launchHandleIvr']=function(_0x214c92){var _0x4fa077=this;return function(){_0x4fa077[_0x8321('0x157')](_0x214c92);};};Dialer['prototype']['actionOriginate']=function(_0x5c3933,_0x46aa4e){var _0x30137c=this;var _0x4f96c4=uuid['v4']();this[_0x8321('0xed')][_0x4f96c4]=new Action(_0x5c3933,_0x46aa4e,_0x4f96c4);return new Promise(function(_0x220d4a,_0x4527ac){if(_[_0x8321('0x3b')](_0x5c3933)&&typeof _0x5c3933!==_0x8321('0x158')){return _0x4527ac(msgResponse('originate',_0x8321('0x91'),_0x8321('0x159')));}if(_[_0x8321('0x3b')](_0x46aa4e[_0x8321('0x15a')])||_0x46aa4e['phone']===null){return _0x4527ac(msgResponse(_0x8321('0x15b'),_0x8321('0x91'),_0x8321('0x15c')));}var _0x2f5876={'XMD-CALLERID':_0x30137c[_0x8321('0xed')][_0x4f96c4][_0x8321('0x15d')](),'XMD-AGI':_0x5c3933[_0x8321('0x12f')]?util[_0x8321('0x84')]('\x22agi://%s/square,%s\x22',ipAgi,_0x5c3933[_0x8321('0x12f')]):_0x8321('0x15e'),'XMD-AGIAFTER':_0x5c3933[_0x8321('0xd0')]?util[_0x8321('0x84')](_0x8321('0x15f'),ipAgi,_0x5c3933[_0x8321('0xd0')]):_0x8321('0x15e'),'XMD-QUEUE':utils['isOutboundQueue'](_0x5c3933)?util[_0x8321('0x84')]('\x22%s,%s%s,,,%s\x22',_0x5c3933[_0x8321('0x5e')],_0x5c3933[_0x8321('0x160')]||'',_0x5c3933[_0x8321('0xc1')]?'c':'',_0x5c3933[_0x8321('0xcb')]||0x3):'NONE','XMD-CONTACTID':_0x46aa4e[_0x8321('0xda')],'XMD-CDRTYPE':_0x8321('0x5'),'CALLERID(all)':_0x30137c[_0x8321('0xed')][_0x4f96c4]['getCaller'](),'XMD-AMD':_0x5c3933[_0x8321('0x10f')]?_0x8321('0x13b'):'NONE','XMD-DESTINATION':_0x8321('0x10e')};if(_0x5c3933[_0x8321('0x10f')]){_0x2f5876[_0x8321('0x161')]=_0x5c3933[_0x8321('0x162')]||0x9c4;_0x2f5876[_0x8321('0x163')]=_0x5c3933[_0x8321('0x164')]||0x5dc;_0x2f5876[_0x8321('0x165')]=_0x5c3933[_0x8321('0x166')]||0x320;_0x2f5876[_0x8321('0x167')]=_0x5c3933['dialAMDTotalAnalysisTime']||0x1388;_0x2f5876['XMD-AMDMINWORDLENGTH']=_0x5c3933['dialAMDMinWordLength']||0x64;_0x2f5876[_0x8321('0x168')]=_0x5c3933[_0x8321('0x169')]||0x32;_0x2f5876[_0x8321('0x16a')]=_0x5c3933[_0x8321('0x16b')]||0x3;_0x2f5876[_0x8321('0x16c')]=_0x5c3933[_0x8321('0x16d')]||0x100;_0x2f5876[_0x8321('0x16e')]=_0x5c3933['dialAMDMaximumWordLength']||0x1388;}if(utils['isOutboundQueue'](_0x5c3933)){_0x2f5876[_0x8321('0x16f')]=_0x46aa4e['VoiceQueueId'];}else{_0x2f5876[_0x8321('0x170')]=_0x46aa4e[_0x8321('0xdd')];}var _0x2ffcdf=utils[_0x8321('0x171')](_0x46aa4e[_0x8321('0x172')]);Object['assign'](_0x2f5876,_0x2ffcdf);var _0x2567b3=_0x30137c[_0x8321('0x82')](_0x5c3933[_0x8321('0x8a')])?utils['getCallerId'](_0x5c3933[_0x8321('0x8a')][_0x8321('0x173')],_0x5c3933[_0x8321('0x174')],_0x5c3933[_0x8321('0x175')]>0x0?utils[_0x8321('0x176')](_0x5c3933[_0x8321('0x177')],_0x5c3933[_0x8321('0x175')]):_0x5c3933[_0x8321('0x177')]):utils[_0x8321('0x178')](_['isNil'](_0x5c3933['TrunkBackup'])?_0x5c3933[_0x8321('0x8a')]['callerid']:_0x5c3933[_0x8321('0x179')]['callerid'],_0x5c3933[_0x8321('0x174')],_0x5c3933['dialRandomLastDigitCallerIdNumber']>0x0?utils[_0x8321('0x176')](_0x5c3933[_0x8321('0x177')],_0x5c3933[_0x8321('0x175')]):_0x5c3933['dialOriginateCallerIdNumber']);if(_0x2567b3){_0x2f5876['XMD-ORIGINATECALLERIDNAME']=_0x30137c[_0x8321('0xed')][_0x4f96c4][_0x8321('0x17a')]=utils[_0x8321('0x17b')](_0x2567b3);_0x2f5876[_0x8321('0x17c')]=_0x46aa4e[_0x8321('0x15a')];}_0x5c3933[_0x8321('0x17d')]=_0x2f5876;return ami['Action']({'actionid':_0x4f96c4,'action':_0x8321('0x15b'),'channel':_0x30137c['isTrunkReachable'](_0x5c3933['Trunk'])?util['format']('SIP/%s/%s%s',_0x5c3933['Trunk'][_0x8321('0x5e')],isNotNull(_0x5c3933['dialPrefix'])?_0x5c3933['dialPrefix'][_0x8321('0x17e')]()||'':'',_0x5c3933[_0x8321('0x17f')]>0x0?_0x46aa4e[_0x8321('0x15a')]['substring'](_0x5c3933[_0x8321('0x17f')]):_0x46aa4e[_0x8321('0x15a')]):util['format']('SIP/%s/%s%s',_[_0x8321('0xf3')](_0x5c3933['TrunkBackup'])?_0x5c3933[_0x8321('0x8a')]['name']:_0x5c3933['TrunkBackup']['name'],isNotNull(_0x5c3933[_0x8321('0x180')])?_0x5c3933[_0x8321('0x180')][_0x8321('0x17e')]()||'':'',_0x5c3933['dialCutDigit']>0x0?_0x46aa4e[_0x8321('0x15a')]['substring'](_0x5c3933[_0x8321('0x17f')]):_0x46aa4e[_0x8321('0x15a')]),'callerid':_0x2567b3,'Exten':_0x8321('0x10e'),'Context':'from-sip','Priority':'1','variable':_0x2f5876,'timeout':(_0x5c3933[_0x8321('0x181')]||0x1e)*0x3e8,'async':!![],'channelid':_0x4f96c4})[_0x8321('0x3a')](function(_0x1131af){return _0x220d4a(_0x1131af);})[_0x8321('0x9d')](function(_0x49831d){_0x5c3933[_0x8321('0x182')]+=0x1;var _0x25936c=new History(_0x30137c[_0x8321('0xed')][_0x4f96c4]);logger[_0x8321('0x61')](util[_0x8321('0x84')](_0x8321('0x183'),JSON[_0x8321('0x6f')](_0x49831d)));_0x25936c[_0x8321('0xd4')]=0xe;_0x25936c[_0x8321('0x69')]=_0x8321('0x184');_0x25936c['starttime']=moment()[_0x8321('0x84')]('YYYY-MM-DD\x20HH:mm:ss');_0x25936c[_0x8321('0x6a')]=_0x25936c['starttime'];hopperUtils[_0x8321('0xc2')](_0x25936c)['catch'](loggerCatch(_0x8321('0x185')));_0x30137c['moveContactManagedDialer'](_0x25936c)[_0x8321('0x9d')](loggerCatch(_0x8321('0x185')))[_0x8321('0x1a')](function(){delete _0x30137c[_0x8321('0xed')][_0x4f96c4];return _0x4527ac(msgResponse('originate',_0x8321('0x81'),_0x8321('0x186')));});});});};Dialer[_0x8321('0x17')]['checkRetriveMax']=function(_0x443b49,_0x5cbe21,_0x4ead77){var _0x1546f2=new History(_0x5cbe21);if(_0x1546f2['countbusyretry']+_0x1546f2['countcongestionretry']+_0x1546f2[_0x8321('0x12a')]+_0x1546f2[_0x8321('0x121')]+_0x1546f2['countdropretry']+_0x1546f2[_0x8321('0xe4')]+_0x1546f2[_0x8321('0x11e')]+_0x1546f2[_0x8321('0x122')]>=_0x4ead77[_0x8321('0x123')]-0x1){return!![];}switch(_0x443b49){case 0x3:if(_0x1546f2['countnoanswerretry']>=_0x4ead77[_0x8321('0x187')]-0x1){return!![];}hopperUtils[_0x8321('0xd7')]({'active':![],'countnoanswerretry':_0x1546f2[_0x8321('0x12a')]+=0x1,'scheduledat':moment()[_0x8321('0xe9')](_0x4ead77['dialNoAnswerRetryFrequency'],_0x8321('0xd9'))[_0x8321('0x84')](_0x8321('0xbd')),'ContactId':_0x1546f2['ContactId'],'ListId':_0x1546f2['ListId'],'VoiceQueueId':_0x1546f2[_0x8321('0xdc')]||undefined,'CampaignId':_0x1546f2[_0x8321('0xdd')]||undefined})['catch'](loggerCatch(_0x8321('0x188')));break;case 0x5:if(_0x1546f2[_0x8321('0x11f')]>=_0x4ead77[_0x8321('0x189')]-0x1){return!![];}hopperUtils[_0x8321('0xd7')]({'active':![],'countbusyretry':_0x1546f2[_0x8321('0x11f')]+=0x1,'scheduledat':moment()[_0x8321('0xe9')](_0x4ead77[_0x8321('0x18a')],'minutes')['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x1546f2[_0x8321('0xda')],'ListId':_0x1546f2[_0x8321('0xdb')],'VoiceQueueId':_0x1546f2[_0x8321('0xdc')]||undefined,'CampaignId':_0x1546f2[_0x8321('0xdd')]||undefined})[_0x8321('0x9d')](loggerCatch(_0x8321('0x18b')));break;case 0x8:if(_0x1546f2[_0x8321('0x120')]>=_0x4ead77[_0x8321('0x18c')]-0x1){return!![];}hopperUtils[_0x8321('0xd7')]({'active':![],'countcongestionretry':_0x1546f2[_0x8321('0x120')]+=0x1,'scheduledat':moment()[_0x8321('0xe9')](_0x4ead77['dialCongestionRetryFrequency'],'minutes')[_0x8321('0x84')](_0x8321('0xbd')),'ContactId':_0x1546f2[_0x8321('0xda')],'ListId':_0x1546f2[_0x8321('0xdb')],'VoiceQueueId':_0x1546f2[_0x8321('0xdc')]||undefined,'CampaignId':_0x1546f2['CampaignId']||undefined})[_0x8321('0x9d')](loggerCatch(_0x8321('0x18d')));break;case 0x0:if(_0x1546f2[_0x8321('0x121')]>=_0x4ead77[_0x8321('0x18e')]-0x1){return!![];}else{hopperUtils['rescheduleContact']({'active':![],'countnosuchnumberretry':_0x1546f2[_0x8321('0x121')]+=0x1,'scheduledat':moment()['add'](_0x4ead77[_0x8321('0x18f')],_0x8321('0xd9'))[_0x8321('0x84')](_0x8321('0xbd')),'ContactId':_0x1546f2['ContactId'],'ListId':_0x1546f2[_0x8321('0xdb')],'VoiceQueueId':_0x1546f2[_0x8321('0xdc')]||undefined,'CampaignId':_0x1546f2[_0x8321('0xdd')]||undefined})['catch'](loggerCatch(_0x8321('0x190')));}break;case 0xa:if(_0x1546f2['countdropretry']>=_0x4ead77[_0x8321('0xd6')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countdropretry':_0x1546f2[_0x8321('0xd1')]+=0x1,'scheduledat':moment()[_0x8321('0xe9')](_0x4ead77['dialDropRetryFrequency'],'minutes')[_0x8321('0x84')](_0x8321('0xbd')),'ContactId':_0x1546f2['ContactId'],'ListId':_0x1546f2[_0x8321('0xdb')],'VoiceQueueId':_0x1546f2[_0x8321('0xdc')]||undefined,'CampaignId':_0x1546f2[_0x8321('0xdd')]||undefined})['catch'](loggerCatch(_0x8321('0x191')));break;case 0xb:if(_0x1546f2[_0x8321('0xe4')]>=_0x4ead77['dialAbandonedMaxRetry']-0x1){return!![];}hopperUtils[_0x8321('0xd7')]({'active':![],'countabandonedretry':_0x1546f2['countabandonedretry']+=0x1,'scheduledat':moment()[_0x8321('0xe9')](_0x4ead77[_0x8321('0xe5')],_0x8321('0xd9'))[_0x8321('0x84')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x1546f2[_0x8321('0xda')],'ListId':_0x1546f2['ListId'],'VoiceQueueId':_0x1546f2[_0x8321('0xdc')]||undefined,'CampaignId':_0x1546f2['CampaignId']||undefined})[_0x8321('0x9d')](loggerCatch(_0x8321('0xea')));break;case 0x13:if(_0x1546f2[_0x8321('0x11e')]>=_0x4ead77[_0x8321('0x126')]-0x1){return!![];}hopperUtils[_0x8321('0xd7')]({'active':![],'countmachineretry':_0x1546f2[_0x8321('0x11e')]+=0x1,'scheduledat':moment()['add'](_0x4ead77[_0x8321('0x192')],_0x8321('0xd9'))['format'](_0x8321('0xbd')),'ContactId':_0x1546f2[_0x8321('0xda')],'ListId':_0x1546f2[_0x8321('0xdb')],'VoiceQueueId':_0x1546f2[_0x8321('0xdc')]||undefined,'CampaignId':_0x1546f2[_0x8321('0xdd')]||undefined})[_0x8321('0x9d')](loggerCatch(_0x8321('0x12c')));break;case 0x14:if(_0x1546f2[_0x8321('0x122')]>=_0x4ead77[_0x8321('0x193')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countagentrejectretry':_0x1546f2['countagentrejectretry']+=0x1,'scheduledat':moment()[_0x8321('0xe9')](_0x4ead77[_0x8321('0x194')],_0x8321('0xd9'))[_0x8321('0x84')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x1546f2['ContactId'],'ListId':_0x1546f2[_0x8321('0xdb')],'VoiceQueueId':_0x1546f2[_0x8321('0xdc')]||undefined,'CampaignId':_0x1546f2['CampaignId']||undefined})[_0x8321('0x9d')](loggerCatch('[rescheduleContact][AgentReject]'));break;default:return!![];}};Dialer['prototype']['callProgressDetecting']=function(_0xea73c8,_0x3c2e85,_0x161521){var _0x5cf3d0=this;var _0xb8ce31=new History(_0xea73c8);var _0x3494d6=![];var _0x522565;var _0x2eeb29;return new Promise(function(_0x1fce25,_0x322302){if(_['isUndefined'](_0x3c2e85)&&typeof _0x3c2e85!==_0x8321('0x158')){return _0x322302(msgResponse(_0x8321('0x195'),_0x8321('0x91'),_0x8321('0x196')));}if(_['isUndefined'](_0x161521)&&typeof _0x161521!=='object'){return _0x322302(msgResponse('[callProgressDetecting]',_0x8321('0x91'),_0x8321('0x197')));}hopperUtils[_0x8321('0xe6')](_0xb8ce31,_0x161521[_0x8321('0xbf')],_0x3c2e85)[_0x8321('0x3a')](function(_0x2ea34a){if(_0x2ea34a['additional']==0x1)_0x3494d6=!![];switch(_0x161521[_0x8321('0xbf')]){case'0':_0x3c2e85['outboundNoSuchCallsDay']+=0x1;_0xb8ce31[_0x8321('0xd4')]=0x0;_0xb8ce31[_0x8321('0x69')]=_0x8321('0x198');_0xb8ce31[_0x8321('0x121')]+=0x1;_0xb8ce31[_0x8321('0xd2')]+=0x1;ami[_0x8321('0x3c')](_0x8321('0x199'),ut[_0x8321('0x117')](_0xea73c8,_0x8321('0x19a')));_0x522565=_0x3c2e85['dialNoSuchNumberRetryFrequency'];_0x2eeb29=_0x3c2e85[_0x8321('0xd3')];hopperUtils['createHistory'](_0xb8ce31)['catch'](loggerCatch(_0x8321('0x129')));if(_0x5cf3d0[_0x8321('0x19b')](0x0,_0xea73c8,_0x3c2e85)&&!_0x3494d6){if(_0xb8ce31[_0x8321('0x121')]>=_0x3c2e85[_0x8321('0x18e')]){_0x5cf3d0[_0x8321('0x127')](_0xb8ce31,_0x1fce25,_0x322302,_0x8321('0x19c'));}else{_0x5cf3d0[_0x8321('0x124')](_0xb8ce31,_0x1fce25,_0x322302,_0x8321('0x19c'));}}break;case'3':_0x3c2e85[_0x8321('0x19d')]+=0x1;_0xb8ce31[_0x8321('0xd4')]=0x3;_0xb8ce31[_0x8321('0x69')]=_0x8321('0x19e');_0xb8ce31[_0x8321('0x12a')]+=0x1;_0xb8ce31[_0x8321('0xd2')]+=0x1;var _0xd4b5b9=ut['buildNoAnswerEventPayload'](_0xea73c8,_0x3c2e85);ami[_0x8321('0x3c')](_0x8321('0x19f'),_0xd4b5b9);_0x522565=_0x3c2e85[_0x8321('0x1a0')];_0x2eeb29=_0x3c2e85[_0x8321('0xd3')];hopperUtils[_0x8321('0xc2')](_0xb8ce31)['catch'](loggerCatch(_0x8321('0x1a1')));if(_0x5cf3d0[_0x8321('0x19b')](0x3,_0xea73c8,_0x3c2e85)&&!_0x3494d6){if(_0xb8ce31[_0x8321('0x12a')]>=_0x3c2e85['dialNoAnswerMaxRetry']){_0x5cf3d0[_0x8321('0x127')](_0xb8ce31,_0x1fce25,_0x322302,_0x8321('0x1a2'));}else{_0x5cf3d0['stateGlobal'](_0xb8ce31,_0x1fce25,_0x322302,_0x8321('0x1a2'));}}break;case'5':_0x3c2e85[_0x8321('0x1a3')]+=0x1;_0xb8ce31['state']=0x5;_0xb8ce31[_0x8321('0x69')]=_0x8321('0x1a4');_0xb8ce31[_0x8321('0x11f')]+=0x1;_0xb8ce31['countglobal']+=0x1;ami[_0x8321('0x3c')]('custom:agentbusy',ut[_0x8321('0x117')](_0xea73c8,_0x8321('0x1a5')));_0x522565=_0x3c2e85['dialBusyRetryFrequency'];_0x2eeb29=_0x3c2e85[_0x8321('0xd3')];hopperUtils[_0x8321('0xc2')](_0xb8ce31)['catch'](loggerCatch(_0x8321('0x1a6')));if(_0x5cf3d0['checkRetriveMax'](0x5,_0xea73c8,_0x3c2e85)&&!_0x3494d6){if(_0xb8ce31['countbusyretry']>=_0x3c2e85[_0x8321('0x189')]){_0x5cf3d0[_0x8321('0x127')](_0xb8ce31,_0x1fce25,_0x322302,_0x8321('0x1a7'));}else{_0x5cf3d0['stateGlobal'](_0xb8ce31,_0x1fce25,_0x322302,_0x8321('0x1a7'));}}break;case'8':_0x3c2e85[_0x8321('0x1a8')]+=0x1;_0xb8ce31[_0x8321('0xd4')]=0x8;_0xb8ce31[_0x8321('0x69')]=_0x8321('0x1a9');_0xb8ce31[_0x8321('0x120')]+=0x1;_0xb8ce31[_0x8321('0xd2')]+=0x1;_0x522565=_0x3c2e85[_0x8321('0x1aa')];_0x2eeb29=_0x3c2e85[_0x8321('0xd3')];ami[_0x8321('0x3c')](_0x8321('0x1ab'),ut['buildObj'](_0xea73c8,_0x8321('0x1ac')));hopperUtils[_0x8321('0xc2')](_0xb8ce31)[_0x8321('0x9d')](loggerCatch(_0x8321('0x1ad')));if(_0x5cf3d0[_0x8321('0x19b')](0x8,_0xea73c8,_0x3c2e85)&&!_0x3494d6){if(_0xb8ce31[_0x8321('0x120')]>=_0x3c2e85['dialCongestionMaxRetry']){_0x5cf3d0[_0x8321('0x127')](_0xb8ce31,_0x1fce25,_0x322302,_0x8321('0x1ae'));}else{_0x5cf3d0[_0x8321('0x124')](_0xb8ce31,_0x1fce25,_0x322302,'reason\x208\x20congestion');}}break;case'11':_0x3c2e85[_0x8321('0x1af')]+=0x1;_0xb8ce31['state']=0xb;_0xb8ce31[_0x8321('0x69')]='Abandoned';_0xb8ce31[_0x8321('0xe4')]+=0x1;_0xb8ce31[_0x8321('0xd2')]+=0x1;_0x522565=_0x3c2e85['dialAbandonedRetryFrequency'];_0x2eeb29=_0x3c2e85[_0x8321('0xd3')];hopperUtils[_0x8321('0xc2')](_0xb8ce31)[_0x8321('0x9d')](loggerCatch(_0x8321('0xeb')));if(_0x5cf3d0['checkRetriveMax'](0xb,_0xea73c8,_0x3c2e85)&&!_0x3494d6){if(_0xb8ce31[_0x8321('0xe4')]>=_0x3c2e85['dialAbandonedMaxRetry']){_0x5cf3d0[_0x8321('0x127')](_0xb8ce31,_0x1fce25,_0x322302,_0x8321('0x1b0'));}else{_0x5cf3d0[_0x8321('0x124')](_0xb8ce31,_0x1fce25,_0x322302,'reason\x2011\x20abandoned');}}break;case'20':_0x3c2e85[_0x8321('0x1b1')]+=0x1;_0xb8ce31[_0x8321('0xd4')]=0x14;_0xb8ce31['statedesc']=_0x8321('0x1b2');_0xb8ce31[_0x8321('0x122')]+=0x1;_0xb8ce31[_0x8321('0xd2')]+=0x1;_0x522565=_0x3c2e85[_0x8321('0x194')];_0x2eeb29=_0x3c2e85[_0x8321('0xd3')];ami[_0x8321('0x3c')](_0x8321('0x1b3'),ut[_0x8321('0x117')](_0xea73c8,_0x8321('0x1b4')));hopperUtils['createHistory'](_0xb8ce31)[_0x8321('0x9d')](loggerCatch('[syncAgentComplete][createHistory][20]'));if(_0x5cf3d0[_0x8321('0x19b')](0x14,_0xea73c8,_0x3c2e85)&&!_0x3494d6){if(_0xb8ce31[_0x8321('0x122')]>=_0x3c2e85[_0x8321('0x193')]){_0x5cf3d0[_0x8321('0x127')](_0xb8ce31,_0x1fce25,_0x322302,_0x8321('0x1b5'));}else{_0x5cf3d0[_0x8321('0x124')](_0xb8ce31,_0x1fce25,_0x322302,_0x8321('0x1b5'));}}break;default:_0x3c2e85[_0x8321('0x132')]+=0x1;_0xb8ce31[_0x8321('0xd4')]=0xc;_0xb8ce31['statedesc']=_0x161521[_0x8321('0xbf')];_0x522565=_0x3c2e85[_0x8321('0x194')];_0x2eeb29=_0x3c2e85[_0x8321('0xd3')];hopperUtils[_0x8321('0xc2')](_0xb8ce31)['catch'](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0x5cf3d0[_0x8321('0x19b')](_0x161521[_0x8321('0xbf')],_0xea73c8,_0x3c2e85)&&!_0x3494d6){if(_0xb8ce31[_0x8321('0x11f')]+_0xb8ce31[_0x8321('0x120')]+_0xb8ce31[_0x8321('0x12a')]+_0xb8ce31[_0x8321('0x121')]+_0xb8ce31[_0x8321('0xd1')]+_0xb8ce31[_0x8321('0xe4')]+_0xb8ce31[_0x8321('0x11e')]+_0xb8ce31[_0x8321('0x122')]>=_0x3c2e85[_0x8321('0x123')]){_0x5cf3d0['stateGlobal'](_0xb8ce31,_0x1fce25,_0x322302,_0x161521['reason']);}else{_0x5cf3d0[_0x8321('0x127')](_0xb8ce31,_0x1fce25,_0x322302,_0x161521[_0x8321('0xbf')]);}}}})[_0x8321('0x3a')](function(){if(_0x3494d6){hopperUtils[_0x8321('0xe1')](_0xb8ce31,_0x522565,_0x2eeb29)[_0x8321('0x3a')](function(){return _0x1fce25(0x1);});}});});};Dialer[_0x8321('0x17')][_0x8321('0x124')]=function(_0x46f547,_0x29af04,_0x29b965,_0xa2cf29){var _0x3dab29=new Final(_0x46f547);_0x3dab29['state']=0xf;_0x3dab29[_0x8321('0x69')]=_0x8321('0x1b6');this['createStateFinal'](_0x3dab29,_0x29af04,_0x29b965,_0xa2cf29);};Dialer[_0x8321('0x17')][_0x8321('0x127')]=function(_0x4958d8,_0x1be062,_0x44516f,_0x9e9de2){hopperUtils[_0x8321('0xc4')](_0x4958d8)[_0x8321('0x3a')](function(){return _0x1be062(msgResponse(_0x8321('0x195'),'Success',_0x9e9de2));})[_0x8321('0x9d')](function(){return _0x44516f(msgResponse(_0x8321('0x1b7'),_0x8321('0x91'),'contact\x20not\x20moved'));});};Dialer[_0x8321('0x17')][_0x8321('0x7')]=function(_0x485ece){var _0x2e0504=_0x485ece[_0x8321('0x1b8')]/0x64;var _0xc84b50=_0x485ece[_0x8321('0x1b9')]/(_0x485ece[_0x8321('0x1b9')]+_0x485ece[_0x8321('0xbe')]);var _0x4bcf91=Math['round'](_0x485ece[_0x8321('0x1ba')]*(_0x485ece['predictiveIntervalMaxThreshold']/0x64));var _0x1eea4c=Math[_0x8321('0x1bb')](_0x485ece[_0x8321('0x1ba')]*(_0x485ece[_0x8321('0x1bc')]/0x64));var _0x50b47c=_0x485ece[_0x8321('0x1bd')]+_0x485ece[_0x8321('0x139')];var _0x3e7392=Math[_0x8321('0x1be')](_0x485ece['erlangCalls']*_0x485ece[_0x8321('0x58')]*_0x485ece['predictiveIntervalHitRate']*_0x485ece['predictiveIntervalMultiplicativeFactor']);if(_[_0x8321('0x3b')](_0x485ece[_0x8321('0x24')])){if(!_[_0x8321('0x3b')](_0x485ece[_0x8321('0x5d')])){_0x485ece['startPredictive']=undefined;loggerPredictive[_0x8321('0x61')](_0x8321('0x1bf'),_0x8321('0x1c0'));}if(!_['isUndefined'](_0x485ece[_0x8321('0x5f')])){loggerPredictive[_0x8321('0x61')](_0x8321('0x1bf'),_0x8321('0x1c1'));clearInterval(_0x485ece[_0x8321('0x5f')]);_0x485ece[_0x8321('0x5f')]=undefined;}_0x485ece[_0x8321('0x24')]=moment()[_0x8321('0x84')](_0x8321('0xbd'));loggerPredictive[_0x8321('0x47')](_0x485ece[_0x8321('0x5e')],_0x8321('0x1c2'),_0x485ece['startProgressive']);this[_0x8321('0xb2')](_0x485ece,0x1);}else if(ifInterval(_0x485ece['dialPredictiveInterval'],_0x485ece[_0x8321('0x24')])){this[_0x8321('0xb2')](_0x485ece,0x1);loggerPredictiveCalls['info']('[startMethodPredictive][StartProgressive][Loop]',_0x485ece[_0x8321('0x24')],_0x485ece['name']);_0x485ece[_0x8321('0x55')]=0x0;_0x485ece['predictiveIntervalErlangCallsDroppedCalls']=0x0;}else if(_0x2e0504<_0xc84b50&&_0x485ece['dialPredictiveOptimization']==='dropRate'){clearPredictiveAttributes(_0x485ece);loggerPredictive[_0x8321('0x47')](_0x8321('0x1c3'),'Dropped\x20calls\x20day',_0xc84b50,_0x8321('0x24'),_0x485ece[_0x8321('0x5e')]);}else if(_0x3e7392<_0x485ece[_0x8321('0x1c4')]&&_0x485ece[_0x8321('0x1c5')]==='dropRate'){clearPredictiveAttributes(_0x485ece);loggerPredictive[_0x8321('0x47')](_0x8321('0x1c6'),_0x8321('0x1c7'),_0x3e7392,_0x8321('0x1c8'),_0x485ece[_0x8321('0x1c4')],_0x8321('0x24'),_0x485ece[_0x8321('0x5e')]);}else if(!ifInterval(_0x485ece[_0x8321('0x1c9')],_0x485ece[_0x8321('0x24')])&&_['isUndefined'](_0x485ece['startPredictive'])&&!_[_0x8321('0x3b')](_0x485ece['startProgressive'])){_0x485ece[_0x8321('0x5d')]=moment()[_0x8321('0x84')](_0x8321('0xbd'));loggerPredictive[_0x8321('0x47')](_0x485ece['name'],_0x8321('0x1ca'),_0x485ece['startPredictive']);hopperUtils[_0x8321('0x1cb')](_0x485ece[_0x8321('0x1c9')])[_0x8321('0x3a')](this[_0x8321('0x1cc')](_0x485ece))[_0x8321('0x3a')](mergeDataErlangB(_0x485ece))[_0x8321('0x3a')](this['startMethodPredictive'](_0x485ece))['catch'](loggerCatchPredictive('Predictive\x20after\x20first\x20interval',_0x485ece));}else if(!ifInterval(_0x485ece[_0x8321('0x1c9')],_0x485ece[_0x8321('0x5d')])){_0x485ece[_0x8321('0x1c4')]=0x0;_0x485ece[_0x8321('0x5d')]=moment()[_0x8321('0x84')](_0x8321('0xbd'));loggerPredictive['info'](_0x485ece['name'],_0x8321('0x1cd'),_0x485ece[_0x8321('0x5d')]);clearInterval(_0x485ece[_0x8321('0x5f')]);_0x485ece[_0x8321('0x5f')]=undefined;hopperUtils[_0x8321('0x1cb')](_0x485ece['dialPredictiveInterval'])[_0x8321('0x3a')](this[_0x8321('0x1cc')](_0x485ece))[_0x8321('0x3a')](mergeDataErlangB(_0x485ece))[_0x8321('0x3a')](this[_0x8321('0x1ce')](_0x485ece))[_0x8321('0x9d')](loggerCatchPredictive('Predictive\x20for\x20every\x20interval',_0x485ece));}else if(_0x485ece[_0x8321('0x1ba')]&&_0x50b47c<_0x485ece[_0x8321('0x1ba')]-_0x1eea4c){clearPredictiveAttributes(_0x485ece);loggerPredictive['info'](_0x485ece[_0x8321('0x5e')],_0x8321('0x1cf'),_0x50b47c,_0x8321('0x1d0'),_0x485ece[_0x8321('0x1ba')],'-',_0x1eea4c,'=',_0x485ece['predictiveIntervalAvailable']-_0x1eea4c,')');}else if(_0x485ece['predictiveIntervalAvailable']&&_0x50b47c>_0x485ece['predictiveIntervalAvailable']+_0x4bcf91){clearPredictiveAttributes(_0x485ece);loggerPredictive[_0x8321('0x47')](_0x485ece['name'],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x50b47c,')\x20are\x20more\x20than\x20threshold\x20(',_0x485ece[_0x8321('0x1ba')],'+',_0x4bcf91,'=',_0x485ece[_0x8321('0x1ba')]+_0x4bcf91,')');}};Dialer[_0x8321('0x17')][_0x8321('0x1cc')]=function(_0x12f740){var _0x117dde=this;return function(_0x14d7cc){return new Promise(function(_0x362d51,_0x372f4d){_[_0x8321('0x5b')](_0x12f740,_0x14d7cc[0x0]);if(checkGetDataPredictive(_0x14d7cc[0x0])){var _0x466cd7=_0x12f740[_0x8321('0x1ba')]=_0x12f740[_0x8321('0x139')]+_0x12f740['available'];var _0x4bd7d2=_0x12f740[_0x8321('0x1c9')]*0x3c;var _0x220d32=_0x14d7cc[0x0]['predictiveIntervalAvgTalktime']+_0x14d7cc[0x0]['predictiveIntervalAvgHoldtime'];var _0x2f1522=(_0x14d7cc[0x0][_0x8321('0x46')]+_0x14d7cc[0x0][_0x8321('0xcc')]+_0x14d7cc[0x0][_0x8321('0x49')])/_0x14d7cc[0x0][_0x8321('0x44')];_0x12f740[_0x8321('0x1d1')]=_0x2f1522>0x0?_0x2f1522:0x1;switch(_0x12f740[_0x8321('0x1c5')]){case _0x8321('0x1d2'):var _0x4d5fad=_0x12f740[_0x8321('0x1b8')]/0x64;return _0x117dde[_0x8321('0x1d3')](_0x466cd7,_0x4bd7d2,_0x220d32,_0x2f1522,_0x4d5fad)[_0x8321('0x3a')](function(_0x3f1873){return _0x362d51(_0x3f1873);});case _0x8321('0x1d4'):var _0x1d4dae=_0x12f740['dialPredictiveOptimizationPercentage']/0x64;return _0x117dde['busyFactor'](_0x466cd7,_0x4bd7d2,_0x220d32,_0x2f1522,_0x1d4dae)[_0x8321('0x3a')](function(_0x45c337){return _0x362d51(_0x45c337);});default:return _0x372f4d(msgResponse('[getDataPredictive]',_0x8321('0x91'),_0x8321('0x1d5')));}}else{return _0x372f4d(msgResponse('[getDataPredictive]',_0x8321('0x91'),_0x8321('0x1d6')));}});};};Dialer[_0x8321('0x17')]['getDataPredictiveOld']=function(_0x52f95f){var _0x1b3a51=this;return function(_0x128ff1){return new Promise(function(_0x40cdd2,_0x8a84f0){_[_0x8321('0x5b')](_0x52f95f,_0x128ff1[0x0]);if(checkGetDataPredictive(_0x128ff1[0x0])){loggerPredictive[_0x8321('0x47')](JSON[_0x8321('0x6f')](_0x128ff1[0x0]));if(_0x52f95f[_0x8321('0x1c5')]==='dropRate'){return _0x1b3a51[_0x8321('0x14e')](_0x52f95f['id'])[_0x8321('0x3a')](function(_0x2b05f2){var _0x1745d4=_0x52f95f[_0x8321('0x1d7')]-_0x2b05f2[0x0]['outboundQueuePauses'];var _0xe8803e=_0x52f95f[_0x8321('0x1c9')]*0x3c;var _0x5236c6=_0x128ff1[0x0][_0x8321('0x4e')]+_0x128ff1[0x0][_0x8321('0x4b')];var _0x5a31b1=(_0x128ff1[0x0][_0x8321('0x46')]+_0x128ff1[0x0][_0x8321('0xcc')]+_0x128ff1[0x0][_0x8321('0x49')])/_0x128ff1[0x0]['predictiveIntervalTotalCalls'];var _0x4a4e2d=_0x52f95f[_0x8321('0x1b8')]/0x64;_0x52f95f['predictiveIntervalPauses']=_0x2b05f2[0x0][_0x8321('0x1d8')]||0x0;_0x52f95f[_0x8321('0x1d1')]=_0x5a31b1>0x0?_0x5a31b1:0x1;return _0x1b3a51[_0x8321('0x1d3')](_0x1745d4,_0xe8803e,_0x5236c6,_0x5a31b1,_0x4a4e2d);})[_0x8321('0x3a')](function(_0x596fb2){return _0x40cdd2(_0x596fb2);})[_0x8321('0x9d')](function(_0x48fa3c){return _0x8a84f0(msgResponse(_0x8321('0x1d9'),_0x8321('0x91'),JSON[_0x8321('0x6f')](_0x48fa3c)));});}if(_0x52f95f['dialPredictiveOptimization']===_0x8321('0x1d4')){return _0x1b3a51[_0x8321('0x14e')](_0x52f95f['id'])[_0x8321('0x3a')](function(_0x5ca4fc){var _0x501dbb=_0x52f95f['loggedIn']-_0x5ca4fc[0x0][_0x8321('0x1d8')];var _0x41fb2d=_0x52f95f[_0x8321('0x1c9')]*0x3c;var _0x5bdab9=_0x128ff1[0x0][_0x8321('0x4e')]+_0x128ff1[0x0][_0x8321('0x4b')];var _0x2efe9b=(_0x128ff1[0x0][_0x8321('0x46')]+_0x128ff1[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x128ff1[0x0][_0x8321('0x49')])/_0x128ff1[0x0][_0x8321('0x44')];var _0x29a875=_0x52f95f[_0x8321('0x1b8')]/0x64;_0x52f95f[_0x8321('0x1da')]=_0x5ca4fc[0x0]['outboundQueuePauses']||0x0;_0x52f95f[_0x8321('0x1d1')]=_0x2efe9b>0x0?_0x2efe9b:0x1;return _0x1b3a51['busyFactor'](_0x501dbb,_0x41fb2d,_0x5bdab9,_0x2efe9b,_0x29a875);})[_0x8321('0x3a')](function(_0x2200b5){return _0x40cdd2(_0x2200b5);})['catch'](function(_0x1aad5d){return _0x8a84f0(msgResponse(_0x8321('0x1d9'),'Failure',JSON[_0x8321('0x6f')](_0x1aad5d)));});}}else{return _0x8a84f0(msgResponse(_0x8321('0x1db'),_0x8321('0x91'),'check\x20failure'));}});};};Dialer[_0x8321('0x17')][_0x8321('0x1ce')]=function(_0x5219d7){var _0x34b1eb=this;return function(){var _0x3a528c=0x0;var _0x1db701=Math[_0x8321('0x1be')](_0x5219d7[_0x8321('0x1dc')]*0x3e8);if(_0x1db701>0x0){_0x1db701=_0x1db701<0x64?0x64:_0x1db701;loggerPredictive[_0x8321('0x47')](_0x5219d7['name'],'one\x20call\x20every:',_0x1db701,'milliseconds');_0x5219d7[_0x8321('0x5f')]=setInterval(function(){_0x34b1eb[_0x8321('0x5f')](_0x5219d7);loggerPredictiveCalls[_0x8321('0x47')](_0x8321('0x1dd'),_0x3a528c+=0x1);},_0x1db701);}else{loggerPredictive[_0x8321('0x47')](_0x5219d7['name'],_0x8321('0x1de'));}};};Dialer[_0x8321('0x17')][_0x8321('0x1df')]=function(_0x9c89ff,_0x363268){var _0x4ba091=this;return function(_0x4c7f25){if(_['isEmpty'](_0x4c7f25)){if(_[_0x8321('0xf3')](_0x363268[_0x8321('0x154')])||!_0x363268[_0x8321('0x1e0')]){if(_0x9c89ff[_0x8321('0xb0')]===_0x8321('0x6')){_0x9c89ff[_0x8321('0x6c')]=_['isUndefined'](_0x9c89ff[_0x8321('0x6c')])?!![]:_0x9c89ff['queueStatusComplete'];var _0x65f61f=uuid['v4']();_0x4ba091['actions'][_0x65f61f]=new Action(_0x9c89ff,_0x363268,_0x65f61f);loggerBooked[_0x8321('0x47')](_0x8321('0x1e1'),_0x65f61f,_0x8321('0x1e2'),JSON[_0x8321('0x6f')](_0x9c89ff[_0x8321('0x6c')]),_0x8321('0x1e3'),_0x9c89ff[_0x8321('0x5e')]);if(_0x9c89ff[_0x8321('0x6c')]){_0x9c89ff[_0x8321('0x6c')]=![];_0x4ba091[_0x8321('0x26')][_0x4ba091[_0x8321('0xed')][_0x65f61f]['queue']]=[];ami[_0x8321('0x98')]({'actionid':_0x65f61f,'action':'queuestatus','queue':_0x9c89ff[_0x8321('0x5e')]})['catch'](function(){_0x4ba091[_0x8321('0xc7')](_0x9c89ff);hopperUtils[_0x8321('0xd7')]({'active':![],'ContactId':_0x4ba091[_0x8321('0xed')][_0x65f61f]['ContactId'],'ListId':_0x4ba091[_0x8321('0xed')][_0x65f61f][_0x8321('0xdb')],'VoiceQueueId':_0x4ba091[_0x8321('0xed')][_0x65f61f][_0x8321('0xdc')]||undefined,'CampaignId':_0x4ba091[_0x8321('0xed')][_0x65f61f]['CampaignId']||undefined})[_0x8321('0x9d')](loggerCatch(_0x8321('0x1e4')));delete _0x4ba091[_0x8321('0xed')][_0x65f61f];});}else{loggerBooked[_0x8321('0x47')](_0x8321('0x1e5'),JSON[_0x8321('0x6f')](_0x9c89ff[_0x8321('0x6c')]),_0x8321('0x1e3'),_0x9c89ff['name']);_0x4ba091[_0x8321('0xc7')](_0x9c89ff);hopperUtils['rescheduleContact']({'active':![],'ContactId':_0x4ba091[_0x8321('0xed')][_0x65f61f][_0x8321('0xda')],'ListId':_0x4ba091[_0x8321('0xed')][_0x65f61f][_0x8321('0xdb')],'VoiceQueueId':_0x4ba091['actions'][_0x65f61f]['VoiceQueueId']||undefined,'CampaignId':_0x4ba091[_0x8321('0xed')][_0x65f61f][_0x8321('0xdd')]||undefined})[_0x8321('0x9d')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x4ba091[_0x8321('0xed')][_0x65f61f];}}else{return _0x4ba091[_0x8321('0x1e6')](_0x9c89ff,_0x363268);}}else{if(utils[_0x8321('0xc9')](undefined,_0x363268[_0x8321('0x1e7')])<_0x9c89ff[_0x8321('0x1e8')]*0x3c){if(_0x363268[_0x8321('0x144')]&&!_0x363268[_0x8321('0x144')]['voicePause']){_0x4ba091[_0x8321('0x1c')][_0x8321('0xf8')](_0x363268['id'])[_0x8321('0x1a')](function(){_0x4ba091[_0x8321('0xc7')](_0x9c89ff);});}else{hopperUtils[_0x8321('0x1e9')]({'active':![]},_0x363268['id'],0x1)[_0x8321('0x1a')](function(){_0x4ba091['updateOriginated'](_0x9c89ff);});}}else{_0x9c89ff[_0x8321('0x1ea')]+=0x1;_0x4ba091[_0x8321('0xc7')](_0x9c89ff);if(_0x9c89ff[_0x8321('0x1eb')]){hopperUtils[_0x8321('0xd7')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x363268[_0x8321('0xda')],'ListId':_0x363268[_0x8321('0xdb')],'VoiceQueueId':_0x363268[_0x8321('0xdc')]||undefined,'CampaignId':_0x363268[_0x8321('0xdd')]||undefined})[_0x8321('0x9d')](loggerCatch(_0x8321('0x1ec')));hopperUtils[_0x8321('0xc2')](createObjHistory(_0x9c89ff,_0x363268,utils[_0x8321('0x68')][_0x8321('0x1ed')],0x17,'RecallInQueue'))[_0x8321('0x9d')](loggerCatch(_0x8321('0x1ee')));}else{_0x4ba091['saveInDb'](createObjHistory(_0x9c89ff,_0x363268,utils[_0x8321('0x68')]['RECALL_TIMEOUT'],0x16,_0x8321('0x1ef')),_0x8321('0x1f0'),_0x8321('0x1f1'));}}}}else{_0x9c89ff[_0x8321('0x1f2')]+=0x1;_0x4ba091[_0x8321('0x119')](createObjHistory(_0x9c89ff,_0x363268,utils[_0x8321('0x68')]['BLACKLIST'],0xd,_0x8321('0x1f3')),_0x8321('0x1f4'),_0x8321('0x1f5'));throw _0x8321('0x1f6');}};};Dialer['prototype'][_0x8321('0x157')]=function(_0x200b4e){var _0x33e778=this;var _0x1a7317=_0x200b4e[_0x8321('0x1f7')]-_0x200b4e[_0x8321('0x7b')];emitCampaignSummary(_0x200b4e);if(_0x1a7317>0x0&&_0x200b4e[_0x8321('0x1f8')]==0x0){if(_0x1a7317>this['maxNumberOriginate']){_0x1a7317=this[_0x8321('0x20')];}_0x200b4e[_0x8321('0x1f8')]=0x1;hopperUtils['getContactDialerIvr'](_0x200b4e,_0x1a7317)['then'](function(_0xb5f663){_0x200b4e[_0x8321('0x1f8')]=0x0;if(_0xb5f663){if(!utils[_0x8321('0x1f9')](_0xb5f663)){_0x200b4e[_0x8321('0x64')]=utils['CAMPAIGN_STATUS'][_0x8321('0x1fa')];logger[_0x8321('0x47')](_0x8321('0x1fb')+_0x200b4e[_0x8321('0x5e')]);}else{_0x200b4e[_0x8321('0x7b')]+=_0xb5f663[_0x8321('0x96')];_0x200b4e[_0x8321('0x64')]=utils[_0x8321('0x68')]['RUNNING'];for(var _0x297fe9=0x0;_0x297fe9<_0xb5f663['length'];_0x297fe9+=0x1){_0x200b4e[_0x8321('0x1fc')]+=0x1;if(_[_0x8321('0xf3')](_0xb5f663[_0x297fe9])||_[_0x8321('0xf3')](_0xb5f663[_0x297fe9][_0x8321('0x172')])||_[_0x8321('0xf3')](_0xb5f663[_0x297fe9][_0x8321('0x15a')])){_0x33e778[_0x8321('0x153')](_0x8321('0x1fd'),_0x200b4e,_0xb5f663[_0x297fe9]);}else{hopperUtils[_0x8321('0x1fe')](_[_0x8321('0x70')](_0xb5f663[_0x297fe9],['CampaignId',_0x8321('0x15a')]))[_0x8321('0x3a')](_0x33e778[_0x8321('0x1df')](_0x200b4e,_0xb5f663[_0x297fe9]))[_0x8321('0x9d')](_0x33e778[_0x8321('0x152')](_0x8321('0x1ff'),_0x200b4e));}}}}})[_0x8321('0x9d')](loggerGetContactDialer(_0x8321('0x200'),_0x200b4e,_0x1a7317));}};Dialer['prototype'][_0x8321('0xb2')]=function(_0x45ac60,_0x219093){var _0x8e679b=this;var _0x411253=[];if(_0x219093<0x1||_0x45ac60[_0x8321('0xb0')]===_0x8321('0x6')){_0x219093=0x1;}var _0x379468=Math[_0x8321('0x1be')](_0x45ac60[_0x8321('0x1bd')]*_0x219093)-_0x45ac60[_0x8321('0x7b')];if(_0x45ac60[_0x8321('0x201')]>0x0){var _0x3cd21c=_0x45ac60[_0x8321('0x201')]-_0x45ac60['originated']-_0x45ac60[_0x8321('0x139')]-_0x45ac60[_0x8321('0x13a')];if(_0x379468>_0x3cd21c){_0x379468=_0x3cd21c;}}if(_0x379468>0x0&&_0x45ac60[_0x8321('0x1f8')]==0x0){if(_0x45ac60[_0x8321('0xb0')]===_0x8321('0x6')){_0x379468=0x1;}if(_0x379468>this[_0x8321('0x20')]){_0x379468=this['maxNumberOriginate'];}for(var _0x34145e in this[_0x8321('0x1e')]){if(typeof this['agents'][_0x34145e]!=='undefined'){if(this['agents'][_0x34145e][_0x8321('0xd4')]===_0x8321('0x202')&&this[_0x8321('0x1e')][_0x34145e]['status']===_0x8321('0x87')){_0x411253[_0x8321('0x97')](this[_0x8321('0x1e')][_0x34145e]['id']);}}}_0x45ac60[_0x8321('0x1f8')]=0x1;hopperUtils['getContactDialer'](_0x45ac60,_0x411253,_0x379468)[_0x8321('0x3a')](function(_0x810ba4){_0x45ac60[_0x8321('0x1f8')]=0x0;if(_0x810ba4){if(!utils[_0x8321('0x1f9')](_0x810ba4)){hopperUtils[_0x8321('0x203')](_0x45ac60)[_0x8321('0x3a')](sendMessageReschedule(_0x45ac60))[_0x8321('0x9d')](loggerCatch('[countReScheduled]\x20'));}else{_0x45ac60[_0x8321('0x7b')]+=_0x810ba4[_0x8321('0x96')];_0x45ac60[_0x8321('0x64')]=_0x45ac60[_0x8321('0xb0')]==='booked'?utils['CAMPAIGN_STATUS']['ACTIVE']:utils[_0x8321('0x68')]['RUNNING'];for(var _0x26b98d=0x0;_0x26b98d<_0x810ba4[_0x8321('0x96')];_0x26b98d+=0x1){if(_['isNil'](_0x810ba4[_0x26b98d])||_[_0x8321('0xf3')](_0x810ba4[_0x26b98d][_0x8321('0x172')])||_[_0x8321('0xf3')](_0x810ba4[_0x26b98d][_0x8321('0x15a')])){_0x8e679b['emptyContact'](_0x8321('0x1fd'),_0x45ac60,_0x810ba4[_0x26b98d]);}else{hopperUtils['checkIsBlackList'](_[_0x8321('0x70')](_0x810ba4[_0x26b98d],['VoiceQueueId',_0x8321('0x15a')]))[_0x8321('0x3a')](_0x8e679b['checkContactBlack'](_0x45ac60,_0x810ba4[_0x26b98d]))[_0x8321('0x9d')](_0x8e679b['loggerHandler']('[actionOriginate]\x20',_0x45ac60));}}}}})[_0x8321('0x9d')](loggerGetContactDialer('[getContactDialer2]',_0x45ac60,_0x379468));}};Dialer[_0x8321('0x17')][_0x8321('0x5f')]=function(_0x385094){if(_0x385094[_0x8321('0x201')]>0x0){var _0x430d19=_0x385094['dialLimitQueue']-_0x385094[_0x8321('0x7b')]-_0x385094['talking'];if(_0x430d19>0x0&&_0x385094['temp']==0x0){this[_0x8321('0x204')](_0x385094);}else{loggerPredictiveCalls[_0x8321('0x47')](_0x8321('0x205'));}}else{this['tryOriginatePredictive'](_0x385094);}};Dialer['prototype'][_0x8321('0x204')]=function(_0x380b62){var _0x3050db=this;var _0xfa4a70=[];_0x380b62['originated']+=0x1;for(var _0x58174a in this[_0x8321('0x1e')]){if(typeof this[_0x8321('0x1e')][_0x58174a]!==_0x8321('0xa8')){if(this[_0x8321('0x1e')][_0x58174a]['state']===_0x8321('0x202')&&this[_0x8321('0x1e')][_0x58174a]['status']===_0x8321('0x87')){_0xfa4a70[_0x8321('0x97')](this[_0x8321('0x1e')][_0x58174a]['id']);}}}_0x380b62['temp']=0x1;return this[_0x8321('0x206')](_0x380b62['id'],_0xfa4a70,0x1,_0x380b62[_0x8321('0x207')],_0x380b62)[_0x8321('0x3a')](function(_0x253a6c){_0x380b62['temp']=0x1;if(_0x253a6c){if(!utils[_0x8321('0x1f9')](_0x253a6c)){utils['checkContactLowerLimitOriginate'](_0x380b62,0x1,0x0);return hopperUtils[_0x8321('0x203')](_0x380b62)[_0x8321('0x3a')](sendMessageReschedule(_0x380b62))[_0x8321('0x9d')](loggerCatch('[countReScheduled]\x20'));}else{_0x380b62['message']=utils[_0x8321('0x68')]['RUNNING'];if(_['isNil'](_0x253a6c[0x0])||_[_0x8321('0xf3')](_0x253a6c[0x0][_0x8321('0x172')])||_[_0x8321('0xf3')](_0x253a6c[0x0][_0x8321('0x15a')])){_0x3050db[_0x8321('0x153')](_0x8321('0x1fd'),_0x380b62,_0x253a6c[0x0]);}else{return hopperUtils[_0x8321('0x208')](_[_0x8321('0x70')](_0x253a6c[0x0],[_0x8321('0xdc'),_0x8321('0x15a')]))[_0x8321('0x3a')](_0x3050db[_0x8321('0x1df')](_0x380b62,_0x253a6c[0x0]))[_0x8321('0x9d')](_0x3050db[_0x8321('0x152')](_0x8321('0x209'),_0x380b62));}}}})['catch'](loggerGetContactDialer(_0x8321('0x20a'),_0x380b62,0x1));};Dialer[_0x8321('0x17')][_0x8321('0x1d3')]=function(_0x44b42a,_0x3e8c11,_0xb4198a,_0x3b8f8d,_0x43d639,_0xaeb328){loggerPredictive['info'](_0x8321('0x20b'));loggerPredictive[_0x8321('0x47')](_0x8321('0x20c'),_0x44b42a);loggerPredictive['info'](_0x8321('0x20d'),_0x3e8c11);loggerPredictive[_0x8321('0x47')](_0x8321('0x20e'),_0xb4198a);loggerPredictive[_0x8321('0x47')](_0x8321('0x20f'),_0x3b8f8d);loggerPredictive[_0x8321('0x47')]('Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x43d639);loggerPredictive['info'](_0x8321('0x4d'));return new Promise(function(_0x46c982,_0x30bfe7){if(_0x44b42a<=0x0||isNaN(_0x44b42a)){return _0x30bfe7(msgResponse(_0x8321('0x210'),_0x8321('0x81'),'m\x20=\x20'+_0x44b42a));}if(_0xb4198a<=0x0||isNaN(_0xb4198a)){return _0x30bfe7(msgResponse(_0x8321('0x210'),'Error',_0x8321('0x211')+_0xb4198a));}if(_0x3b8f8d<=0x0||isNaN(_0x3b8f8d)){return _0x30bfe7(msgResponse(_0x8321('0x210'),_0x8321('0x81'),'p\x20=\x20'+_0x3b8f8d));}if(_0x3e8c11<=0x0||isNaN(_0x3e8c11)){return _0x30bfe7(msgResponse(_0x8321('0x210'),_0x8321('0x81'),_0x8321('0x212')+_0x3e8c11));}if(_0x43d639<=0x0||isNaN(_0x43d639)){return _0x30bfe7(msgResponse('[abandonmentRate]',_0x8321('0x81'),_0x8321('0x213')+_0x43d639));}_0xaeb328=_0xaeb328||0x0;var _0x3507de=0x1/_0xb4198a;var _0x124de1=0x0;var _0x511989=0x0;var _0x40a7e3=0x0;var _0x585910=0x0;for(var _0x22006b=0x0;_0x40a7e3<_0x43d639;_0x22006b+=0x1){_0x511989=_0x22006b/_0x3e8c11;_0x124de1=(_0x3b8f8d*_0x511989+_0xaeb328)/_0x3507de;_0x40a7e3=utils[_0x8321('0x214')](_0x124de1,_0x44b42a);_0x585910=_0x124de1/_0x44b42a*(0x1-utils['erlangb'](_0x124de1,_0x44b42a));}return _0x46c982({'erlangCalls':_0x22006b,'erlangCallToSecond':_0x3e8c11/_0x22006b,'erlangAbandonmentRate':_0x40a7e3,'erlangBusyFactor':_0x585910});});};Dialer['prototype'][_0x8321('0x215')]=function(_0xc71b22,_0x2d232e,_0x2f4c3a,_0x2e4c5e,_0x44b728,_0x470795){loggerPredictive['info'](_0x8321('0x216'));loggerPredictive[_0x8321('0x47')](_0x8321('0x20c'),_0xc71b22);loggerPredictive['info'](_0x8321('0x20d'),_0x2d232e);loggerPredictive['info'](_0x8321('0x20e'),_0x2f4c3a);loggerPredictive['info'](_0x8321('0x20f'),_0x2e4c5e);loggerPredictive[_0x8321('0x47')](_0x8321('0x217'),_0x44b728);loggerPredictive[_0x8321('0x47')](_0x8321('0x4d'));return new Promise(function(_0x48a3c9,_0x516862){if(_0xc71b22<=0x0||isNaN(_0xc71b22)){return _0x516862(msgResponse(_0x8321('0x218'),_0x8321('0x81'),_0x8321('0x219')+_0xc71b22));}if(_0x2f4c3a<=0x0||isNaN(_0x2f4c3a)){return _0x516862(msgResponse('[busyFactor]','Error',_0x8321('0x211')+_0x2f4c3a));}if(_0x2e4c5e<=0x0||isNaN(_0x2e4c5e)){return _0x516862(msgResponse('[busyFactor]',_0x8321('0x81'),'p\x20=\x20'+_0x2e4c5e));}if(_0x2d232e<=0x0||isNaN(_0x2d232e)){return _0x516862(msgResponse(_0x8321('0x218'),'Error',_0x8321('0x212')+_0x2d232e));}if(_0x44b728<=0x0||isNaN(_0x44b728)){return _0x516862(msgResponse('[busyFactor]',_0x8321('0x81'),_0x8321('0x21a')+_0x44b728));}_0x470795=_0x470795||0x0;var _0x30b485=0x1/_0x2f4c3a;var _0x258321=0x0;var _0x3067f7=0x0;var _0x275d83=0x0;var _0x25ab37=0x0;for(var _0x4905c7=0x0;_0x25ab37<_0x44b728;_0x4905c7+=0x1){_0x3067f7=_0x4905c7/_0x2d232e;_0x258321=(_0x2e4c5e*_0x3067f7+_0x470795)/_0x30b485;_0x275d83=utils[_0x8321('0x214')](_0x258321,_0xc71b22);_0x25ab37=_0x258321/_0xc71b22*(0x1-utils[_0x8321('0x214')](_0x258321,_0xc71b22));}return _0x48a3c9({'erlangCalls':_0x4905c7,'erlangCallToSecond':_0x2d232e/_0x4905c7,'erlangAbandonmentRate':_0x275d83,'erlangBusyFactor':_0x25ab37});});};module['exports']=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/models/action.js b/server/services/ami/dialer/models/action.js index 6dc312d..4f1f4e9 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 _0xe767=['active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','firstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','prototype','\x22%s\x22\x20<%s>','voiceQueue','dialCutDigit','number','substring','getQueue','exports','util','lodash','moment','isNil','string','uniqueid','name','Contact','lastName','phone','queue'];(function(_0x34ea3d,_0x1929e9){var _0x406193=function(_0x25bf2a){while(--_0x25bf2a){_0x34ea3d['push'](_0x34ea3d['shift']());}};_0x406193(++_0x1929e9);}(_0xe767,0x1c1));var _0x7e76=function(_0x22f048,_0x98c8b7){_0x22f048=_0x22f048-0x0;var _0x49ef43=_0xe767[_0x22f048];return _0x49ef43;};'use strict';var util=require(_0x7e76('0x0'));var _=require(_0x7e76('0x1'));var moment=require(_0x7e76('0x2'));function checkNameSurname(_0x93b78f,_0x151e86,_0x500a3d){var _0x25ac5d='';if(!_[_0x7e76('0x3')](_0x151e86)&&_0x7e76('0x4')===typeof _0x151e86){_0x25ac5d+=_0x151e86;}if(!_[_0x7e76('0x3')](_0x500a3d)&&'string'===typeof _0x500a3d){_0x25ac5d+='\x20'+_0x500a3d;}if(_0x25ac5d!==''){return _0x25ac5d;}return _0x93b78f;}function Action(_0x406830,_0x4fbe9c,_0x605311){this['voiceQueue']=_0x406830;this[_0x7e76('0x5')]=_0x605311||undefined;this[_0x7e76('0x6')]=checkNameSurname(_0x4fbe9c['Contact']['phone'],_0x4fbe9c[_0x7e76('0x7')]['firstName'],_0x4fbe9c[_0x7e76('0x7')][_0x7e76('0x8')]);this['number']=_0x4fbe9c[_0x7e76('0x9')];this[_0x7e76('0xa')]=_0x406830[_0x7e76('0x6')];this[_0x7e76('0xb')]=_0x4fbe9c[_0x7e76('0xb')]||![];this[_0x7e76('0xc')]=_0x406830[_0x7e76('0xc')];this[_0x7e76('0xd')]=_0x406830[_0x7e76('0xd')]||0x3;this['scheduledat']=_0x4fbe9c[_0x7e76('0xe')];this[_0x7e76('0xf')]=_0x4fbe9c[_0x7e76('0xf')];this[_0x7e76('0x10')]=_0x4fbe9c[_0x7e76('0x10')];this['countnoanswerretry']=_0x4fbe9c[_0x7e76('0x11')];this['countnosuchnumberretry']=_0x4fbe9c[_0x7e76('0x12')];this[_0x7e76('0x13')]=_0x4fbe9c['countdropretry'];this['countabandonedretry']=_0x4fbe9c[_0x7e76('0x14')];this[_0x7e76('0x15')]=_0x4fbe9c['countmachineretry'];this[_0x7e76('0x16')]=_0x4fbe9c['countagentrejectretry'];this['ContactId']=_0x4fbe9c['ContactId'];this[_0x7e76('0x17')]=_0x4fbe9c[_0x7e76('0x17')];this[_0x7e76('0x18')]=_0x4fbe9c[_0x7e76('0x18')];this[_0x7e76('0x19')]=_0x4fbe9c['VoiceQueueId'];this[_0x7e76('0x1a')]=_0x4fbe9c[_0x7e76('0x1a')];this[_0x7e76('0x1b')]=_0x4fbe9c['id'];this[_0x7e76('0x1c')]=_0x4fbe9c[_0x7e76('0x7')][_0x7e76('0x1d')]||'';this[_0x7e76('0x1e')]=moment()[_0x7e76('0x1f')](_0x7e76('0x20'));this[_0x7e76('0x21')]=_0x4fbe9c[_0x7e76('0x21')];this[_0x7e76('0x22')]=_0x4fbe9c[_0x7e76('0x22')];this[_0x7e76('0x23')]=_0x4fbe9c[_0x7e76('0x23')];this[_0x7e76('0x24')]=_0x4fbe9c[_0x7e76('0x24')];this[_0x7e76('0x25')]='';this['originatecalleridname']='';}Action[_0x7e76('0x26')]['getCaller']=function(){return util[_0x7e76('0x1f')](_0x7e76('0x27'),this[_0x7e76('0x6')],this[_0x7e76('0x28')][_0x7e76('0x29')]>0x0?this[_0x7e76('0x2a')][_0x7e76('0x2b')](this[_0x7e76('0x28')][_0x7e76('0x29')]):this[_0x7e76('0x2a')]);};Action[_0x7e76('0x26')][_0x7e76('0x2c')]=function(){return this['queue'];};module[_0x7e76('0x2d')]=Action; \ No newline at end of file +var _0x0187=['active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','firstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridname','prototype','getCaller','dialCutDigit','substring','getQueue','exports','isNil','string','uniqueid','name','Contact','phone','number'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0x0187,0x189));var _0x7018=function(_0x548627,_0x4ec392){_0x548627=_0x548627-0x0;var _0x844a84=_0x0187[_0x548627];return _0x844a84;};'use strict';var util=require('util');var _=require('lodash');var moment=require('moment');function checkNameSurname(_0x4f065,_0x33a2a2,_0x5303fc){var _0x355029='';if(!_[_0x7018('0x0')](_0x33a2a2)&&_0x7018('0x1')===typeof _0x33a2a2){_0x355029+=_0x33a2a2;}if(!_['isNil'](_0x5303fc)&&_0x7018('0x1')===typeof _0x5303fc){_0x355029+='\x20'+_0x5303fc;}if(_0x355029!==''){return _0x355029;}return _0x4f065;}function Action(_0x5e4d04,_0x2e0a8e,_0x225e96){this['voiceQueue']=_0x5e4d04;this[_0x7018('0x2')]=_0x225e96||undefined;this[_0x7018('0x3')]=checkNameSurname(_0x2e0a8e[_0x7018('0x4')][_0x7018('0x5')],_0x2e0a8e[_0x7018('0x4')]['firstName'],_0x2e0a8e[_0x7018('0x4')]['lastName']);this[_0x7018('0x6')]=_0x2e0a8e[_0x7018('0x5')];this['queue']=_0x5e4d04['name'];this[_0x7018('0x7')]=_0x2e0a8e[_0x7018('0x7')]||![];this[_0x7018('0x8')]=_0x5e4d04[_0x7018('0x8')];this[_0x7018('0x9')]=_0x5e4d04['dialQueueTimeout']||0x3;this[_0x7018('0xa')]=_0x2e0a8e[_0x7018('0xa')];this[_0x7018('0xb')]=_0x2e0a8e[_0x7018('0xb')];this[_0x7018('0xc')]=_0x2e0a8e[_0x7018('0xc')];this[_0x7018('0xd')]=_0x2e0a8e[_0x7018('0xd')];this['countnosuchnumberretry']=_0x2e0a8e[_0x7018('0xe')];this[_0x7018('0xf')]=_0x2e0a8e['countdropretry'];this['countabandonedretry']=_0x2e0a8e['countabandonedretry'];this[_0x7018('0x10')]=_0x2e0a8e[_0x7018('0x10')];this[_0x7018('0x11')]=_0x2e0a8e[_0x7018('0x11')];this[_0x7018('0x12')]=_0x2e0a8e['ContactId'];this[_0x7018('0x13')]=_0x2e0a8e[_0x7018('0x13')];this[_0x7018('0x14')]=_0x2e0a8e['UserId'];this['VoiceQueueId']=_0x2e0a8e[_0x7018('0x15')];this['CampaignId']=_0x2e0a8e[_0x7018('0x16')];this[_0x7018('0x17')]=_0x2e0a8e['id'];this[_0x7018('0x18')]=_0x2e0a8e[_0x7018('0x4')][_0x7018('0x19')]||'';this[_0x7018('0x1a')]=moment()[_0x7018('0x1b')](_0x7018('0x1c'));this[_0x7018('0x1d')]=_0x2e0a8e[_0x7018('0x1d')];this[_0x7018('0x1e')]=_0x2e0a8e[_0x7018('0x1e')];this[_0x7018('0x1f')]=_0x2e0a8e[_0x7018('0x1f')];this[_0x7018('0x20')]=_0x2e0a8e['recallme'];this['originatecalleridnum']='';this[_0x7018('0x21')]='';}Action[_0x7018('0x22')][_0x7018('0x23')]=function(){return util[_0x7018('0x1b')]('\x22%s\x22\x20<%s>',this[_0x7018('0x3')],this['voiceQueue'][_0x7018('0x24')]>0x0?this['number'][_0x7018('0x25')](this['voiceQueue'][_0x7018('0x24')]):this[_0x7018('0x6')]);};Action[_0x7018('0x22')][_0x7018('0x26')]=function(){return this['queue'];};module[_0x7018('0x27')]=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 e9ff3a0..498fe0e 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 _0x2dac=['type','outbound','queue','countbusyretry','countnoanswerretry','countglobal','countcongestionretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','uniqueid','calleridname','name','calleridnum','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','getSeconds','holdtime','talktime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','moment','../utils','state','scheduledat'];(function(_0x5207a2,_0x316913){var _0x314716=function(_0x2ca663){while(--_0x2ca663){_0x5207a2['push'](_0x5207a2['shift']());}};_0x314716(++_0x316913);}(_0x2dac,0x1e0));var _0xc2da=function(_0x4cd74e,_0x312dc6){_0x4cd74e=_0x4cd74e-0x0;var _0x479c40=_0x2dac[_0x4cd74e];return _0x479c40;};'use strict';var moment=require(_0xc2da('0x0'));var utils=require(_0xc2da('0x1'));function AgentComplete(_0x3156d4,_0x5295d8){this[_0xc2da('0x2')]=0x4;this['statedesc']='Answer';this[_0xc2da('0x3')]=_0x3156d4[_0xc2da('0x3')];this[_0xc2da('0x4')]=_0x3156d4[_0xc2da('0x4')];this['campaigntype']=_0x3156d4[_0xc2da('0x4')]===_0xc2da('0x5')?_0xc2da('0x6'):_0x3156d4[_0xc2da('0x4')];this[_0xc2da('0x7')]=_0x3156d4[_0xc2da('0x7')];this['countcongestionretry']=_0x3156d4['countcongestionretry'];this[_0xc2da('0x8')]=_0x3156d4['countnoanswerretry'];this[_0xc2da('0x9')]=_0x3156d4[_0xc2da('0x7')]+_0x3156d4[_0xc2da('0xa')]+_0x3156d4['countnoanswerretry']+_0x3156d4[_0xc2da('0xb')]+_0x3156d4[_0xc2da('0xc')]+_0x3156d4[_0xc2da('0xd')]+_0x3156d4['countmachineretry']+_0x3156d4[_0xc2da('0xe')];this[_0xc2da('0xb')]=_0x3156d4[_0xc2da('0xb')];this[_0xc2da('0xc')]=_0x3156d4[_0xc2da('0xc')];this[_0xc2da('0xd')]=_0x3156d4[_0xc2da('0xd')];this[_0xc2da('0xf')]=_0x3156d4['countmachineretry'];this[_0xc2da('0xe')]=_0x3156d4[_0xc2da('0xe')];this['uniqueid']=_0x5295d8[_0xc2da('0x10')];this[_0xc2da('0x11')]=_0x3156d4[_0xc2da('0x12')];this[_0xc2da('0x13')]=_0x3156d4['number'];this['starttime']=_0x3156d4[_0xc2da('0x14')];this[_0xc2da('0x15')]=_0x3156d4['responsetime'];this[_0xc2da('0x16')]=_0x3156d4[_0xc2da('0x16')];this[_0xc2da('0x17')]=moment()[_0xc2da('0x18')](_0xc2da('0x19'));this[_0xc2da('0x1a')]=utils[_0xc2da('0x1b')](_0x3156d4['responsetime'],_0x3156d4[_0xc2da('0x14')]);this[_0xc2da('0x1c')]=utils[_0xc2da('0x1b')](_0x3156d4[_0xc2da('0x16')],_0x3156d4[_0xc2da('0x15')]);this[_0xc2da('0x1d')]=utils[_0xc2da('0x1b')](this['endtime'],_0x3156d4[_0xc2da('0x16')]);this[_0xc2da('0x6')]=_0x5295d8[_0xc2da('0x6')];this['membername']=_0x5295d8[_0xc2da('0x1e')];this['reason']=_0x5295d8[_0xc2da('0x1f')];this[_0xc2da('0x20')]=_0x3156d4[_0xc2da('0x20')];this[_0xc2da('0x21')]=_0x3156d4[_0xc2da('0x21')];this[_0xc2da('0x22')]=_0x3156d4[_0xc2da('0x22')];this[_0xc2da('0x23')]=_0x3156d4[_0xc2da('0x23')];this[_0xc2da('0x24')]=_0x3156d4[_0xc2da('0x24')];this[_0xc2da('0x25')]=_0x3156d4['ListId'];this[_0xc2da('0x26')]=_0x3156d4[_0xc2da('0x26')];this[_0xc2da('0x27')]=_0x3156d4[_0xc2da('0x27')];this[_0xc2da('0x28')]=_0x3156d4['CampaignId'];this[_0xc2da('0x29')]=_0x3156d4['originatecalleridnum']||'';this[_0xc2da('0x2a')]=_0x3156d4[_0xc2da('0x2a')]||'';this['agiafterat']=_0x3156d4['agiafterat'];}module[_0xc2da('0x2b')]=AgentComplete; \ No newline at end of file +var _0x99cc=['holdtime','talktime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','exports','moment','state','statedesc','Answer','scheduledat','campaigntype','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countnosuchnumberretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','getSeconds'];(function(_0x65aa2a,_0x22967c){var _0x257190=function(_0x50aab4){while(--_0x50aab4){_0x65aa2a['push'](_0x65aa2a['shift']());}};_0x257190(++_0x22967c);}(_0x99cc,0x1f1));var _0xc99c=function(_0x2c43a1,_0x41b272){_0x2c43a1=_0x2c43a1-0x0;var _0x20ea80=_0x99cc[_0x2c43a1];return _0x20ea80;};'use strict';var moment=require(_0xc99c('0x0'));var utils=require('../utils');function AgentComplete(_0x2e567e,_0x5e1f58){this[_0xc99c('0x1')]=0x4;this[_0xc99c('0x2')]=_0xc99c('0x3');this['scheduledat']=_0x2e567e[_0xc99c('0x4')];this['type']=_0x2e567e['type'];this[_0xc99c('0x5')]=_0x2e567e[_0xc99c('0x6')]===_0xc99c('0x7')?_0xc99c('0x8'):_0x2e567e[_0xc99c('0x6')];this[_0xc99c('0x9')]=_0x2e567e[_0xc99c('0x9')];this[_0xc99c('0xa')]=_0x2e567e[_0xc99c('0xa')];this[_0xc99c('0xb')]=_0x2e567e[_0xc99c('0xb')];this[_0xc99c('0xc')]=_0x2e567e['countbusyretry']+_0x2e567e[_0xc99c('0xa')]+_0x2e567e[_0xc99c('0xb')]+_0x2e567e['countnosuchnumberretry']+_0x2e567e[_0xc99c('0xd')]+_0x2e567e[_0xc99c('0xe')]+_0x2e567e[_0xc99c('0xf')]+_0x2e567e['countagentrejectretry'];this[_0xc99c('0x10')]=_0x2e567e[_0xc99c('0x10')];this[_0xc99c('0xd')]=_0x2e567e[_0xc99c('0xd')];this[_0xc99c('0xe')]=_0x2e567e[_0xc99c('0xe')];this[_0xc99c('0xf')]=_0x2e567e[_0xc99c('0xf')];this[_0xc99c('0x11')]=_0x2e567e['countagentrejectretry'];this[_0xc99c('0x12')]=_0x5e1f58[_0xc99c('0x12')];this[_0xc99c('0x13')]=_0x2e567e[_0xc99c('0x14')];this[_0xc99c('0x15')]=_0x2e567e[_0xc99c('0x16')];this['starttime']=_0x2e567e[_0xc99c('0x17')];this[_0xc99c('0x18')]=_0x2e567e['responsetime'];this[_0xc99c('0x19')]=_0x2e567e[_0xc99c('0x19')];this[_0xc99c('0x1a')]=moment()[_0xc99c('0x1b')](_0xc99c('0x1c'));this[_0xc99c('0x1d')]=utils[_0xc99c('0x1e')](_0x2e567e[_0xc99c('0x18')],_0x2e567e[_0xc99c('0x17')]);this[_0xc99c('0x1f')]=utils['getSeconds'](_0x2e567e[_0xc99c('0x19')],_0x2e567e[_0xc99c('0x18')]);this[_0xc99c('0x20')]=utils[_0xc99c('0x1e')](this[_0xc99c('0x1a')],_0x2e567e[_0xc99c('0x19')]);this['queue']=_0x5e1f58['queue'];this[_0xc99c('0x21')]=_0x5e1f58['membername'];this[_0xc99c('0x22')]=_0x5e1f58[_0xc99c('0x22')];this[_0xc99c('0x23')]=_0x2e567e[_0xc99c('0x23')];this[_0xc99c('0x24')]=_0x2e567e[_0xc99c('0x24')];this[_0xc99c('0x25')]=_0x2e567e['callbackat'];this[_0xc99c('0x26')]=_0x2e567e[_0xc99c('0x26')];this['ContactId']=_0x2e567e[_0xc99c('0x27')];this[_0xc99c('0x28')]=_0x2e567e[_0xc99c('0x28')];this[_0xc99c('0x29')]=_0x2e567e[_0xc99c('0x29')];this[_0xc99c('0x2a')]=_0x2e567e[_0xc99c('0x2a')];this[_0xc99c('0x2b')]=_0x2e567e[_0xc99c('0x2b')];this[_0xc99c('0x2c')]=_0x2e567e['originatecalleridnum']||'';this[_0xc99c('0x2d')]=_0x2e567e[_0xc99c('0x2d')]||'';this[_0xc99c('0x2e')]=_0x2e567e[_0xc99c('0x2e')];}module[_0xc99c('0x2f')]=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 2bb5671..e1459f7 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 _0xcabe=['countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countagentrejectretry','countdropretry','countabandonedretry','countmachineretry','calleridname','calleridnum','starttime','responsetime','ringtime','talktime','callback','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','exports','scheduledat','type','campaigntype','outbound','queue','countbusyretry'];(function(_0x2c6281,_0x29effb){var _0x4e988b=function(_0x3decdd){while(--_0x3decdd){_0x2c6281['push'](_0x2c6281['shift']());}};_0x4e988b(++_0x29effb);}(_0xcabe,0x11a));var _0xecab=function(_0x7630eb,_0x190c23){_0x7630eb=_0x7630eb-0x0;var _0x2e129f=_0xcabe[_0x7630eb];return _0x2e129f;};'use strict';function Final(_0x4e5988){this['uniqueid']=_0x4e5988['uniqueid'];this[_0xecab('0x0')]=_0x4e5988[_0xecab('0x0')];this[_0xecab('0x1')]=_0x4e5988[_0xecab('0x1')];this[_0xecab('0x2')]=_0x4e5988[_0xecab('0x1')]===_0xecab('0x3')?_0xecab('0x4'):_0x4e5988[_0xecab('0x1')];this[_0xecab('0x5')]=_0x4e5988[_0xecab('0x5')];this[_0xecab('0x6')]=_0x4e5988['countcongestionretry'];this[_0xecab('0x7')]=_0x4e5988[_0xecab('0x7')];this[_0xecab('0x8')]=_0x4e5988[_0xecab('0x5')]+_0x4e5988[_0xecab('0x6')]+_0x4e5988[_0xecab('0x7')]+_0x4e5988[_0xecab('0x9')]+_0x4e5988['countdropretry']+_0x4e5988['countabandonedretry']+_0x4e5988['countmachineretry']+_0x4e5988[_0xecab('0xa')];this['countnosuchnumberretry']=_0x4e5988[_0xecab('0x9')];this[_0xecab('0xb')]=_0x4e5988[_0xecab('0xb')];this[_0xecab('0xc')]=_0x4e5988[_0xecab('0xc')];this[_0xecab('0xd')]=_0x4e5988[_0xecab('0xd')];this[_0xecab('0xa')]=_0x4e5988['countagentrejectretry'];this['queue']=_0x4e5988[_0xecab('0x4')];this['calleridname']=_0x4e5988[_0xecab('0xe')];this['calleridnum']=_0x4e5988[_0xecab('0xf')];this[_0xecab('0x10')]=_0x4e5988[_0xecab('0x10')];this[_0xecab('0x11')]=_0x4e5988[_0xecab('0x11')];this['endtime']=_0x4e5988['responsetime'];this[_0xecab('0x12')]=_0x4e5988[_0xecab('0x12')]||0x0;this['holdtime']=_0x4e5988['holdtime']||0x0;this[_0xecab('0x13')]=_0x4e5988[_0xecab('0x13')]||0x0;this[_0xecab('0x14')]=_0x4e5988[_0xecab('0x14')];this['callbackuniqueid']=_0x4e5988['callbackuniqueid'];this[_0xecab('0x15')]=_0x4e5988[_0xecab('0x15')];this[_0xecab('0x16')]=_0x4e5988[_0xecab('0x16')];this['ContactId']=_0x4e5988[_0xecab('0x17')];this[_0xecab('0x18')]=_0x4e5988['ListId'];this[_0xecab('0x19')]=_0x4e5988['UserId'];this[_0xecab('0x1a')]=_0x4e5988['VoiceQueueId'];this[_0xecab('0x1b')]=_0x4e5988[_0xecab('0x1b')];this[_0xecab('0x1c')]=_0x4e5988['originatecalleridnum']||'';this[_0xecab('0x1d')]=_0x4e5988[_0xecab('0x1d')]||'';this[_0xecab('0x1e')]=_0x4e5988[_0xecab('0x1e')];this['statedesc']=_0x4e5988['statedesc'];}module[_0xecab('0x1f')]=Final; \ No newline at end of file +var _0xf40b=['countabandonedretry','countmachineretry','countagentrejectretry','queue','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','exports','uniqueid','scheduledat','type','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry'];(function(_0x1168a1,_0xa0d8c9){var _0xcc5ad8=function(_0x217dc3){while(--_0x217dc3){_0x1168a1['push'](_0x1168a1['shift']());}};_0xcc5ad8(++_0xa0d8c9);}(_0xf40b,0x18f));var _0xbf40=function(_0x4cd226,_0x489a22){_0x4cd226=_0x4cd226-0x0;var _0x19c008=_0xf40b[_0x4cd226];return _0x19c008;};'use strict';function Final(_0x4fd8a0){this[_0xbf40('0x0')]=_0x4fd8a0['uniqueid'];this[_0xbf40('0x1')]=_0x4fd8a0[_0xbf40('0x1')];this[_0xbf40('0x2')]=_0x4fd8a0[_0xbf40('0x2')];this['campaigntype']=_0x4fd8a0[_0xbf40('0x2')]===_0xbf40('0x3')?'queue':_0x4fd8a0['type'];this[_0xbf40('0x4')]=_0x4fd8a0[_0xbf40('0x4')];this[_0xbf40('0x5')]=_0x4fd8a0['countcongestionretry'];this[_0xbf40('0x6')]=_0x4fd8a0[_0xbf40('0x6')];this['countglobal']=_0x4fd8a0[_0xbf40('0x4')]+_0x4fd8a0[_0xbf40('0x5')]+_0x4fd8a0[_0xbf40('0x6')]+_0x4fd8a0[_0xbf40('0x7')]+_0x4fd8a0[_0xbf40('0x8')]+_0x4fd8a0['countabandonedretry']+_0x4fd8a0['countmachineretry']+_0x4fd8a0['countagentrejectretry'];this[_0xbf40('0x7')]=_0x4fd8a0[_0xbf40('0x7')];this[_0xbf40('0x8')]=_0x4fd8a0[_0xbf40('0x8')];this[_0xbf40('0x9')]=_0x4fd8a0[_0xbf40('0x9')];this[_0xbf40('0xa')]=_0x4fd8a0[_0xbf40('0xa')];this[_0xbf40('0xb')]=_0x4fd8a0[_0xbf40('0xb')];this[_0xbf40('0xc')]=_0x4fd8a0['queue'];this['calleridname']=_0x4fd8a0[_0xbf40('0xd')];this['calleridnum']=_0x4fd8a0[_0xbf40('0xe')];this[_0xbf40('0xf')]=_0x4fd8a0['starttime'];this[_0xbf40('0x10')]=_0x4fd8a0['responsetime'];this[_0xbf40('0x11')]=_0x4fd8a0[_0xbf40('0x10')];this['ringtime']=_0x4fd8a0[_0xbf40('0x12')]||0x0;this[_0xbf40('0x13')]=_0x4fd8a0[_0xbf40('0x13')]||0x0;this[_0xbf40('0x14')]=_0x4fd8a0[_0xbf40('0x14')]||0x0;this[_0xbf40('0x15')]=_0x4fd8a0[_0xbf40('0x15')];this[_0xbf40('0x16')]=_0x4fd8a0[_0xbf40('0x16')];this['callbackat']=_0x4fd8a0['callbackat'];this[_0xbf40('0x17')]=_0x4fd8a0[_0xbf40('0x17')];this[_0xbf40('0x18')]=_0x4fd8a0[_0xbf40('0x18')];this[_0xbf40('0x19')]=_0x4fd8a0[_0xbf40('0x19')];this[_0xbf40('0x1a')]=_0x4fd8a0['UserId'];this[_0xbf40('0x1b')]=_0x4fd8a0[_0xbf40('0x1b')];this['CampaignId']=_0x4fd8a0[_0xbf40('0x1c')];this['originatecalleridnum']=_0x4fd8a0[_0xbf40('0x1d')]||'';this[_0xbf40('0x1e')]=_0x4fd8a0['originatecalleridname']||'';this['state']=_0x4fd8a0[_0xbf40('0x1f')];this[_0xbf40('0x20')]=_0x4fd8a0[_0xbf40('0x20')];}module[_0xbf40('0x21')]=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 de50670..c7a8fab 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 _0x0f6c=['countmachineretry','countagentrejectretry','uniqueid','calleridname','calleridnum','starttime','responsetime','endtime','YYYY-MM-DD\x20HH:mm:ss','ringtime','getSeconds','holdtime','talktime','membername','IVR','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','moment','../utils','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','amd','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry'];(function(_0x2d699b,_0x135cd2){var _0x474b24=function(_0x4827d6){while(--_0x4827d6){_0x2d699b['push'](_0x2d699b['shift']());}};_0x474b24(++_0x135cd2);}(_0x0f6c,0x1bd));var _0xc0f6=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x0f6c[_0x5b644e];return _0x49c6bf;};'use strict';var moment=require(_0xc0f6('0x0'));var utils=require(_0xc0f6('0x1'));function Hangup(_0x1d5d5a,_0x58cda2){this['state']=0x4;this[_0xc0f6('0x2')]=_0xc0f6('0x3');this[_0xc0f6('0x4')]=_0x1d5d5a['scheduledat'];this[_0xc0f6('0x5')]=_0x1d5d5a['type'];this[_0xc0f6('0x6')]=_0x1d5d5a[_0xc0f6('0x5')]===_0xc0f6('0x7')?_0xc0f6('0x8'):_0x1d5d5a['type'];this[_0xc0f6('0x9')]=_0x1d5d5a['amd']||![];this['countbusyretry']=_0x1d5d5a[_0xc0f6('0xa')];this[_0xc0f6('0xb')]=_0x1d5d5a[_0xc0f6('0xb')];this[_0xc0f6('0xc')]=_0x1d5d5a['countnoanswerretry'];this[_0xc0f6('0xd')]=_0x1d5d5a['countbusyretry']+_0x1d5d5a['countcongestionretry']+_0x1d5d5a[_0xc0f6('0xc')]+_0x1d5d5a[_0xc0f6('0xe')]+_0x1d5d5a[_0xc0f6('0xf')]+_0x1d5d5a[_0xc0f6('0x10')]+_0x1d5d5a[_0xc0f6('0x11')]+_0x1d5d5a['countagentrejectretry'];this['countnosuchnumberretry']=_0x1d5d5a[_0xc0f6('0xe')];this['countdropretry']=_0x1d5d5a[_0xc0f6('0xf')];this[_0xc0f6('0x10')]=_0x1d5d5a[_0xc0f6('0x10')];this[_0xc0f6('0x11')]=_0x1d5d5a['countmachineretry'];this[_0xc0f6('0x12')]=_0x1d5d5a['countagentrejectretry'];this['uniqueid']=_0x58cda2[_0xc0f6('0x13')];this[_0xc0f6('0x14')]=_0x1d5d5a['name'];this[_0xc0f6('0x15')]=_0x1d5d5a['number'];this[_0xc0f6('0x16')]=_0x1d5d5a[_0xc0f6('0x16')];this[_0xc0f6('0x17')]=_0x1d5d5a['responsetime'];this[_0xc0f6('0x18')]=moment()['format'](_0xc0f6('0x19'));this[_0xc0f6('0x1a')]=utils[_0xc0f6('0x1b')](_0x1d5d5a[_0xc0f6('0x17')],_0x1d5d5a[_0xc0f6('0x16')]);this[_0xc0f6('0x1c')]=0x0;this[_0xc0f6('0x1d')]=utils[_0xc0f6('0x1b')](this['endtime'],_0x1d5d5a[_0xc0f6('0x17')]);this[_0xc0f6('0x8')]=_0x1d5d5a[_0xc0f6('0x8')];this[_0xc0f6('0x1e')]=_0xc0f6('0x1f');this[_0xc0f6('0x20')]=_0x58cda2['cause-txt'];this[_0xc0f6('0x21')]=_0x1d5d5a[_0xc0f6('0x21')];this[_0xc0f6('0x22')]=_0x1d5d5a[_0xc0f6('0x22')];this[_0xc0f6('0x23')]=_0x1d5d5a[_0xc0f6('0x23')];this['recallme']=_0x1d5d5a[_0xc0f6('0x24')];this['ContactId']=_0x1d5d5a[_0xc0f6('0x25')];this[_0xc0f6('0x26')]=_0x1d5d5a[_0xc0f6('0x26')];this[_0xc0f6('0x27')]=_0x1d5d5a[_0xc0f6('0x27')];this['VoiceQueueId']=_0x1d5d5a[_0xc0f6('0x28')];this[_0xc0f6('0x29')]=_0x1d5d5a[_0xc0f6('0x29')];}module['exports']=Hangup; \ No newline at end of file +var _0x4863=['queue','amd','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countagentrejectretry','countabandonedretry','countmachineretry','calleridname','name','calleridnum','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','getSeconds','talktime','callback','callbackuniqueid','callbackat','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','moment','../utils','state','statedesc','Answer','scheduledat','type','campaigntype','outbound'];(function(_0x879e31,_0x139d02){var _0x3467e8=function(_0x544fc6){while(--_0x544fc6){_0x879e31['push'](_0x879e31['shift']());}};_0x3467e8(++_0x139d02);}(_0x4863,0x17d));var _0x3486=function(_0x118e79,_0x1e2497){_0x118e79=_0x118e79-0x0;var _0x14362e=_0x4863[_0x118e79];return _0x14362e;};'use strict';var moment=require(_0x3486('0x0'));var utils=require(_0x3486('0x1'));function Hangup(_0xc5c585,_0x2e2ec7){this[_0x3486('0x2')]=0x4;this[_0x3486('0x3')]=_0x3486('0x4');this[_0x3486('0x5')]=_0xc5c585[_0x3486('0x5')];this['type']=_0xc5c585[_0x3486('0x6')];this[_0x3486('0x7')]=_0xc5c585['type']===_0x3486('0x8')?_0x3486('0x9'):_0xc5c585[_0x3486('0x6')];this[_0x3486('0xa')]=_0xc5c585[_0x3486('0xa')]||![];this['countbusyretry']=_0xc5c585[_0x3486('0xb')];this[_0x3486('0xc')]=_0xc5c585[_0x3486('0xc')];this[_0x3486('0xd')]=_0xc5c585[_0x3486('0xd')];this[_0x3486('0xe')]=_0xc5c585[_0x3486('0xb')]+_0xc5c585[_0x3486('0xc')]+_0xc5c585[_0x3486('0xd')]+_0xc5c585[_0x3486('0xf')]+_0xc5c585[_0x3486('0x10')]+_0xc5c585['countabandonedretry']+_0xc5c585['countmachineretry']+_0xc5c585[_0x3486('0x11')];this[_0x3486('0xf')]=_0xc5c585['countnosuchnumberretry'];this[_0x3486('0x10')]=_0xc5c585[_0x3486('0x10')];this[_0x3486('0x12')]=_0xc5c585[_0x3486('0x12')];this[_0x3486('0x13')]=_0xc5c585[_0x3486('0x13')];this[_0x3486('0x11')]=_0xc5c585['countagentrejectretry'];this['uniqueid']=_0x2e2ec7['uniqueid'];this[_0x3486('0x14')]=_0xc5c585[_0x3486('0x15')];this[_0x3486('0x16')]=_0xc5c585['number'];this[_0x3486('0x17')]=_0xc5c585['starttime'];this['responsetime']=_0xc5c585[_0x3486('0x18')];this[_0x3486('0x19')]=moment()[_0x3486('0x1a')](_0x3486('0x1b'));this['ringtime']=utils[_0x3486('0x1c')](_0xc5c585[_0x3486('0x18')],_0xc5c585[_0x3486('0x17')]);this['holdtime']=0x0;this[_0x3486('0x1d')]=utils[_0x3486('0x1c')](this['endtime'],_0xc5c585['responsetime']);this['queue']=_0xc5c585[_0x3486('0x9')];this['membername']='IVR';this['reason']=_0x2e2ec7['cause-txt'];this[_0x3486('0x1e')]=_0xc5c585['callback'];this[_0x3486('0x1f')]=_0xc5c585[_0x3486('0x1f')];this[_0x3486('0x20')]=_0xc5c585[_0x3486('0x20')];this['recallme']=_0xc5c585['recallme'];this[_0x3486('0x21')]=_0xc5c585[_0x3486('0x21')];this['ListId']=_0xc5c585[_0x3486('0x22')];this[_0x3486('0x23')]=_0xc5c585[_0x3486('0x23')];this[_0x3486('0x24')]=_0xc5c585[_0x3486('0x24')];this[_0x3486('0x25')]=_0xc5c585[_0x3486('0x25')];}module[_0x3486('0x26')]=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 5afd9d3..2235d86 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 _0xaf8b=['callbackuniqueid','callbackat','recallme','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridname','state','statedesc','exports','../utils','uniqueid','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countglobal','countnoanswerretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','calleridname','name','calleridnum','number','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback'];(function(_0x30ad75,_0x4c92e1){var _0x1993b5=function(_0x532dc0){while(--_0x532dc0){_0x30ad75['push'](_0x30ad75['shift']());}};_0x1993b5(++_0x4c92e1);}(_0xaf8b,0x1bb));var _0xbaf8=function(_0x3864b4,_0x966f05){_0x3864b4=_0x3864b4-0x0;var _0x14c62f=_0xaf8b[_0x3864b4];return _0x14c62f;};'use strict';var utils=require(_0xbaf8('0x0'));function History(_0x2519a9){this['uniqueid']=_0x2519a9[_0xbaf8('0x1')];this[_0xbaf8('0x2')]=_0x2519a9[_0xbaf8('0x2')]||undefined;this[_0xbaf8('0x3')]=_0x2519a9[_0xbaf8('0x3')];this[_0xbaf8('0x4')]=_0x2519a9[_0xbaf8('0x3')]==='outbound'?_0xbaf8('0x5'):_0x2519a9[_0xbaf8('0x3')];this[_0xbaf8('0x6')]=_0x2519a9[_0xbaf8('0x6')];this['countcongestionretry']=_0x2519a9[_0xbaf8('0x7')];this['countnoanswerretry']=_0x2519a9['countnoanswerretry'];this[_0xbaf8('0x8')]=_0x2519a9[_0xbaf8('0x6')]+_0x2519a9[_0xbaf8('0x7')]+_0x2519a9[_0xbaf8('0x9')]+_0x2519a9['countnosuchnumberretry']+_0x2519a9[_0xbaf8('0xa')]+_0x2519a9['countabandonedretry']+_0x2519a9[_0xbaf8('0xb')]+_0x2519a9[_0xbaf8('0xc')];this['countnosuchnumberretry']=_0x2519a9['countnosuchnumberretry'];this[_0xbaf8('0xa')]=_0x2519a9[_0xbaf8('0xa')];this['countabandonedretry']=_0x2519a9[_0xbaf8('0xd')];this[_0xbaf8('0xb')]=_0x2519a9['countmachineretry'];this['countagentrejectretry']=_0x2519a9['countagentrejectretry'];this[_0xbaf8('0x5')]=_0x2519a9['queue'];this[_0xbaf8('0xe')]=_0x2519a9[_0xbaf8('0xf')];this[_0xbaf8('0x10')]=_0x2519a9[_0xbaf8('0x11')];this[_0xbaf8('0x12')]=_0x2519a9[_0xbaf8('0x12')];this[_0xbaf8('0x13')]=_0x2519a9['responsetime'];this[_0xbaf8('0x14')]=_0x2519a9['responsetime'];this[_0xbaf8('0x15')]=utils['getSeconds'](_0x2519a9['responsetime'],_0x2519a9['starttime']);this[_0xbaf8('0x16')]=0x0;this[_0xbaf8('0x17')]=0x0;this[_0xbaf8('0x18')]=_0x2519a9['callback'];this[_0xbaf8('0x19')]=_0x2519a9[_0xbaf8('0x19')];this[_0xbaf8('0x1a')]=_0x2519a9['callbackat'];this[_0xbaf8('0x1b')]=_0x2519a9[_0xbaf8('0x1b')];this['ContactId']=_0x2519a9['ContactId'];this[_0xbaf8('0x1c')]=_0x2519a9[_0xbaf8('0x1c')];this[_0xbaf8('0x1d')]=_0x2519a9[_0xbaf8('0x1d')];this['VoiceQueueId']=_0x2519a9[_0xbaf8('0x1e')];this['CampaignId']=_0x2519a9[_0xbaf8('0x1f')];this['originatecalleridnum']=_0x2519a9['originatecalleridnum']||'';this[_0xbaf8('0x20')]=_0x2519a9[_0xbaf8('0x20')]||'';this[_0xbaf8('0x21')]=_0x2519a9[_0xbaf8('0x21')];this[_0xbaf8('0x22')]=_0x2519a9[_0xbaf8('0x22')];}module[_0xbaf8('0x23')]=History; \ No newline at end of file +var _0x88e4=['countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','name','calleridnum','number','starttime','responsetime','endtime','ringtime','callbackuniqueid','callbackat','recallme','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','exports','../utils','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countdropretry'];(function(_0x5d59f3,_0x4668ad){var _0x6b14d3=function(_0x4763ad){while(--_0x4763ad){_0x5d59f3['push'](_0x5d59f3['shift']());}};_0x6b14d3(++_0x4668ad);}(_0x88e4,0x127));var _0x488e=function(_0x3826ad,_0x49a30d){_0x3826ad=_0x3826ad-0x0;var _0x17b900=_0x88e4[_0x3826ad];return _0x17b900;};'use strict';var utils=require(_0x488e('0x0'));function History(_0x1dbd34){this['uniqueid']=_0x1dbd34[_0x488e('0x1')];this['scheduledat']=_0x1dbd34[_0x488e('0x2')]||undefined;this[_0x488e('0x3')]=_0x1dbd34[_0x488e('0x3')];this[_0x488e('0x4')]=_0x1dbd34['type']===_0x488e('0x5')?_0x488e('0x6'):_0x1dbd34[_0x488e('0x3')];this['countbusyretry']=_0x1dbd34[_0x488e('0x7')];this['countcongestionretry']=_0x1dbd34[_0x488e('0x8')];this[_0x488e('0x9')]=_0x1dbd34['countnoanswerretry'];this['countglobal']=_0x1dbd34[_0x488e('0x7')]+_0x1dbd34['countcongestionretry']+_0x1dbd34['countnoanswerretry']+_0x1dbd34['countnosuchnumberretry']+_0x1dbd34[_0x488e('0xa')]+_0x1dbd34[_0x488e('0xb')]+_0x1dbd34[_0x488e('0xc')]+_0x1dbd34[_0x488e('0xd')];this[_0x488e('0xe')]=_0x1dbd34[_0x488e('0xe')];this[_0x488e('0xa')]=_0x1dbd34[_0x488e('0xa')];this[_0x488e('0xb')]=_0x1dbd34[_0x488e('0xb')];this[_0x488e('0xc')]=_0x1dbd34[_0x488e('0xc')];this[_0x488e('0xd')]=_0x1dbd34[_0x488e('0xd')];this[_0x488e('0x6')]=_0x1dbd34['queue'];this['calleridname']=_0x1dbd34[_0x488e('0xf')];this[_0x488e('0x10')]=_0x1dbd34[_0x488e('0x11')];this[_0x488e('0x12')]=_0x1dbd34['starttime'];this[_0x488e('0x13')]=_0x1dbd34[_0x488e('0x13')];this[_0x488e('0x14')]=_0x1dbd34[_0x488e('0x13')];this[_0x488e('0x15')]=utils['getSeconds'](_0x1dbd34[_0x488e('0x13')],_0x1dbd34['starttime']);this['holdtime']=0x0;this['talktime']=0x0;this['callback']=_0x1dbd34['callback'];this[_0x488e('0x16')]=_0x1dbd34[_0x488e('0x16')];this[_0x488e('0x17')]=_0x1dbd34[_0x488e('0x17')];this[_0x488e('0x18')]=_0x1dbd34[_0x488e('0x18')];this['ContactId']=_0x1dbd34['ContactId'];this[_0x488e('0x19')]=_0x1dbd34[_0x488e('0x19')];this[_0x488e('0x1a')]=_0x1dbd34[_0x488e('0x1a')];this[_0x488e('0x1b')]=_0x1dbd34['VoiceQueueId'];this[_0x488e('0x1c')]=_0x1dbd34[_0x488e('0x1c')];this[_0x488e('0x1d')]=_0x1dbd34[_0x488e('0x1d')]||'';this[_0x488e('0x1e')]=_0x1dbd34[_0x488e('0x1e')]||'';this['state']=_0x1dbd34[_0x488e('0x1f')];this[_0x488e('0x20')]=_0x1dbd34[_0x488e('0x20')];}module[_0x488e('0x21')]=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 afbe3a9..2a81adc 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 _0xd270=['getSeconds','holdtime','talktime','queue','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','state','statedesc','exports','../utils','scheduledat','type','campaigntype','outbound','countcongestionretry','countnoanswerretry','countglobal','countbusyretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','number','starttime','responsetime','droptime','dropreason','ringtime'];(function(_0x2c3d4f,_0x448a69){var _0x2dddb6=function(_0x35974e){while(--_0x35974e){_0x2c3d4f['push'](_0x2c3d4f['shift']());}};_0x2dddb6(++_0x448a69);}(_0xd270,0xf2));var _0x0d27=function(_0x4f14ec,_0x3e7175){_0x4f14ec=_0x4f14ec-0x0;var _0x212bb2=_0xd270[_0x4f14ec];return _0x212bb2;};'use strict';var utils=require(_0x0d27('0x0'));function QueueCallerAbandon(_0x31cd15,_0x42d2b5){this[_0x0d27('0x1')]=_0x31cd15[_0x0d27('0x1')];this[_0x0d27('0x2')]=_0x31cd15[_0x0d27('0x2')];this[_0x0d27('0x3')]=_0x31cd15[_0x0d27('0x2')]===_0x0d27('0x4')?'queue':_0x31cd15[_0x0d27('0x2')];this['countbusyretry']=_0x31cd15['countbusyretry'];this[_0x0d27('0x5')]=_0x31cd15[_0x0d27('0x5')];this[_0x0d27('0x6')]=_0x31cd15[_0x0d27('0x6')];this[_0x0d27('0x7')]=_0x31cd15[_0x0d27('0x8')]+_0x31cd15[_0x0d27('0x5')]+_0x31cd15['countnoanswerretry']+_0x31cd15[_0x0d27('0x9')]+_0x31cd15[_0x0d27('0xa')]+_0x31cd15[_0x0d27('0xb')]+_0x31cd15[_0x0d27('0xc')]+_0x31cd15[_0x0d27('0xd')];this[_0x0d27('0x9')]=_0x31cd15[_0x0d27('0x9')];this[_0x0d27('0xa')]=_0x31cd15[_0x0d27('0xa')];this[_0x0d27('0xb')]=_0x31cd15[_0x0d27('0xb')];this[_0x0d27('0xc')]=_0x31cd15['countmachineretry'];this[_0x0d27('0xd')]=_0x31cd15[_0x0d27('0xd')];this[_0x0d27('0xe')]=_0x42d2b5[_0x0d27('0xe')];this[_0x0d27('0xf')]=_0x31cd15['name'];this['calleridnum']=_0x31cd15[_0x0d27('0x10')];this[_0x0d27('0x11')]=_0x31cd15['starttime'];this['responsetime']=_0x31cd15[_0x0d27('0x12')];this[_0x0d27('0x13')]=_0x31cd15['droptime'];this[_0x0d27('0x14')]=_0x31cd15[_0x0d27('0x14')];this['endtime']=this[_0x0d27('0x13')];this[_0x0d27('0x15')]=utils[_0x0d27('0x16')](_0x31cd15['responsetime'],_0x31cd15['starttime']);this[_0x0d27('0x17')]=utils[_0x0d27('0x16')](this[_0x0d27('0x13')],_0x31cd15['responsetime']);this[_0x0d27('0x18')]=0x0;this['queue']=_0x42d2b5[_0x0d27('0x19')];this[_0x0d27('0x1a')]=_0x42d2b5[_0x0d27('0x1b')];this[_0x0d27('0x1c')]=_0x42d2b5[_0x0d27('0x1c')];this[_0x0d27('0x1d')]=_0x31cd15['callback'];this[_0x0d27('0x1e')]=_0x31cd15[_0x0d27('0x1e')];this[_0x0d27('0x1f')]=_0x31cd15[_0x0d27('0x1f')];this[_0x0d27('0x20')]=_0x31cd15['recallme'];this[_0x0d27('0x21')]=_0x31cd15['ContactId'];this['ListId']=_0x31cd15[_0x0d27('0x22')];this[_0x0d27('0x23')]=_0x31cd15[_0x0d27('0x23')];this[_0x0d27('0x24')]=_0x31cd15[_0x0d27('0x24')];this['CampaignId']=_0x31cd15[_0x0d27('0x25')];this[_0x0d27('0x26')]=_0x31cd15[_0x0d27('0x26')]||'';this[_0x0d27('0x27')]=_0x31cd15[_0x0d27('0x27')]||'';this[_0x0d27('0x28')]=_0x31cd15[_0x0d27('0x28')];this[_0x0d27('0x29')]=_0x31cd15[_0x0d27('0x29')];this[_0x0d27('0x2a')]=_0x31cd15[_0x0d27('0x2a')];}module[_0x0d27('0x2b')]=QueueCallerAbandon; \ No newline at end of file +var _0x7160=['membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','state','statedesc','exports','../utils','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','uniqueid','name','calleridnum','starttime','droptime','dropreason','endtime','ringtime','getSeconds','responsetime','holdtime','talktime'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7160,0x8f));var _0x0716=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0x7160[_0x56482c];return _0x5aae7a;};'use strict';var utils=require(_0x0716('0x0'));function QueueCallerAbandon(_0x48cf,_0x4a2042){this['scheduledat']=_0x48cf['scheduledat'];this[_0x0716('0x1')]=_0x48cf[_0x0716('0x1')];this[_0x0716('0x2')]=_0x48cf['type']==='outbound'?_0x0716('0x3'):_0x48cf[_0x0716('0x1')];this[_0x0716('0x4')]=_0x48cf[_0x0716('0x4')];this[_0x0716('0x5')]=_0x48cf[_0x0716('0x5')];this[_0x0716('0x6')]=_0x48cf[_0x0716('0x6')];this[_0x0716('0x7')]=_0x48cf[_0x0716('0x4')]+_0x48cf[_0x0716('0x5')]+_0x48cf['countnoanswerretry']+_0x48cf['countnosuchnumberretry']+_0x48cf[_0x0716('0x8')]+_0x48cf[_0x0716('0x9')]+_0x48cf[_0x0716('0xa')]+_0x48cf[_0x0716('0xb')];this[_0x0716('0xc')]=_0x48cf['countnosuchnumberretry'];this[_0x0716('0x8')]=_0x48cf['countdropretry'];this[_0x0716('0x9')]=_0x48cf[_0x0716('0x9')];this[_0x0716('0xa')]=_0x48cf[_0x0716('0xa')];this[_0x0716('0xb')]=_0x48cf[_0x0716('0xb')];this[_0x0716('0xd')]=_0x4a2042[_0x0716('0xd')];this['calleridname']=_0x48cf[_0x0716('0xe')];this[_0x0716('0xf')]=_0x48cf['number'];this[_0x0716('0x10')]=_0x48cf[_0x0716('0x10')];this['responsetime']=_0x48cf['responsetime'];this[_0x0716('0x11')]=_0x48cf[_0x0716('0x11')];this[_0x0716('0x12')]=_0x48cf['dropreason'];this[_0x0716('0x13')]=this[_0x0716('0x11')];this[_0x0716('0x14')]=utils[_0x0716('0x15')](_0x48cf[_0x0716('0x16')],_0x48cf[_0x0716('0x10')]);this[_0x0716('0x17')]=utils[_0x0716('0x15')](this[_0x0716('0x11')],_0x48cf[_0x0716('0x16')]);this[_0x0716('0x18')]=0x0;this[_0x0716('0x3')]=_0x4a2042[_0x0716('0x3')];this[_0x0716('0x19')]=_0x4a2042[_0x0716('0x1a')];this['reason']=_0x4a2042[_0x0716('0x1b')];this['callback']=_0x48cf[_0x0716('0x1c')];this[_0x0716('0x1d')]=_0x48cf[_0x0716('0x1d')];this['callbackat']=_0x48cf[_0x0716('0x1e')];this[_0x0716('0x1f')]=_0x48cf['recallme'];this['ContactId']=_0x48cf[_0x0716('0x20')];this[_0x0716('0x21')]=_0x48cf[_0x0716('0x21')];this['UserId']=_0x48cf['UserId'];this[_0x0716('0x22')]=_0x48cf[_0x0716('0x22')];this[_0x0716('0x23')]=_0x48cf[_0x0716('0x23')];this['originatecalleridnum']=_0x48cf[_0x0716('0x24')]||'';this[_0x0716('0x25')]=_0x48cf[_0x0716('0x25')]||'';this[_0x0716('0x26')]=_0x48cf[_0x0716('0x26')];this[_0x0716('0x27')]=_0x48cf[_0x0716('0x27')];this[_0x0716('0x28')]=_0x48cf['statedesc'];}module[_0x0716('0x29')]=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 03a36d6..ab9d0f5 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 _0xf61e=['dialer','../../rpc/cmHopper','../../rpc/cmHopperAdditionalPhone','../../rpc/cmHopperBlack','../../rpc/cmHopperHistory','inspect','dialOrderByScheduledAt','catch','temp','error','[getContactDialer]','getContactDialerIvr','[getContactDialerIvr]','countReScheduled','rescheduleContact','[unlockContact]','unlockContact','moveContactManagedDialer','[checkIsBlackList]','checkIsBlackList','checkIsBlackListIvr','[verifyAdditionalPhone]','verifyAdditionalPhones','swapAdditionalPhones','[swapAdditionalPhone]','avgHandleTime','[avgHandleTime]','createHistory','[createHistory]','util','../../../../config/logger'];(function(_0x1b349a,_0x22222c){var _0x5d1f7c=function(_0x368d7c){while(--_0x368d7c){_0x1b349a['push'](_0x1b349a['shift']());}};_0x5d1f7c(++_0x22222c);}(_0xf61e,0x191));var _0xef61=function(_0xdd6e6c,_0x377421){_0xdd6e6c=_0xdd6e6c-0x0;var _0xe6dfaa=_0xf61e[_0xdd6e6c];return _0xe6dfaa;};'use strict';var util=require(_0xef61('0x0'));var logger=require(_0xef61('0x1'))(_0xef61('0x2'));var cmHopper=require(_0xef61('0x3'));var cmHopperAdditionalPhone=require(_0xef61('0x4'));var cmHopperBlack=require(_0xef61('0x5'));var cmHopperHistory=require(_0xef61('0x6'));function inspectError(_0x40509e){return util[_0xef61('0x7')](_0x40509e,{'showHidden':![],'depth':null});}function getContactDialer(_0x14122a,_0x239fa9,_0x45a18d){return cmHopper['getContactDialer'](_0x14122a['id'],_0x239fa9,_0x45a18d,_0x14122a[_0xef61('0x8')])[_0xef61('0x9')](function(_0x4f0cc5){_0x14122a[_0xef61('0xa')]=0x0;logger[_0xef61('0xb')](_0xef61('0xc'),inspectError(_0x4f0cc5));});}exports['getContactDialer']=getContactDialer;function getContactDialerIvr(_0x47d0a7,_0x188894){return cmHopper[_0xef61('0xd')](_0x47d0a7['id'],_0x188894,_0x47d0a7[_0xef61('0x8')])[_0xef61('0x9')](function(_0x2af74c){_0x47d0a7[_0xef61('0xa')]=0x0;logger[_0xef61('0xb')](_0xef61('0xe'),inspectError(_0x2af74c));});}exports[_0xef61('0xd')]=getContactDialerIvr;function countReScheduled(_0x66e7b2){return cmHopper[_0xef61('0xf')](_0x66e7b2)[_0xef61('0x9')](function(_0x114e1f){logger[_0xef61('0xb')]('[countReScheduled]',inspectError(_0x114e1f));});}exports[_0xef61('0xf')]=countReScheduled;function rescheduleContact(_0x58d9a0){return cmHopper[_0xef61('0x10')](_0x58d9a0)[_0xef61('0x9')](function(_0x370ee0){logger[_0xef61('0xb')]('[rescheduleContact]',inspectError(_0x370ee0));});}exports[_0xef61('0x10')]=rescheduleContact;function unlockContact(_0x435beb,_0x1224c2,_0x78ff22){return cmHopper['unlockContact'](_0x435beb,_0x1224c2,_0x78ff22)[_0xef61('0x9')](function(_0xbe23a7){logger['error'](_0xef61('0x11'),inspectError(_0xbe23a7));});}exports[_0xef61('0x12')]=unlockContact;function moveContactManagedDialer(_0x36f558){return cmHopper[_0xef61('0x13')](_0x36f558)[_0xef61('0x9')](function(_0x28315a){logger[_0xef61('0xb')]('[moveContactManagedDialer]',inspectError(_0x28315a));});}exports[_0xef61('0x13')]=moveContactManagedDialer;function checkIsBlackList(_0x2c8dad){return cmHopperBlack['checkIsBlackList'](_0x2c8dad)[_0xef61('0x9')](function(_0x36966a){logger[_0xef61('0xb')](_0xef61('0x14'),inspectError(_0x36966a));});}exports[_0xef61('0x15')]=checkIsBlackList;function checkIsBlackListIvr(_0x2ed61e){return cmHopperBlack[_0xef61('0x16')](_0x2ed61e)['catch'](function(_0x536e9e){logger[_0xef61('0xb')]('[checkIsBlackListIvr]',inspectError(_0x536e9e));});}exports[_0xef61('0x16')]=checkIsBlackListIvr;function verifyAdditionalPhones(_0x5ae7a2,_0x488b47,_0x2f0569){return cmHopperAdditionalPhone['verifyAdditionalPhones'](_0x5ae7a2,_0x488b47,_0x2f0569)['catch'](function(_0xfbee94){logger[_0xef61('0xb')](_0xef61('0x17'),inspectError(_0xfbee94));});}exports[_0xef61('0x18')]=verifyAdditionalPhones;function swapAdditionalPhones(_0x5e56da,_0x16b144,_0x4e738f){return cmHopperAdditionalPhone[_0xef61('0x19')](_0x5e56da,_0x16b144,_0x4e738f)[_0xef61('0x9')](function(_0x2419a9){logger[_0xef61('0xb')](_0xef61('0x1a'),inspectError(_0x2419a9));});}exports[_0xef61('0x19')]=swapAdditionalPhones;function avgHandleTime(_0x258b5a){return cmHopperHistory[_0xef61('0x1b')](_0x258b5a)[_0xef61('0x9')](function(_0x1ee27b){logger[_0xef61('0xb')](_0xef61('0x1c'),inspectError(_0x1ee27b));});}exports[_0xef61('0x1b')]=avgHandleTime;function createHistory(_0x63edd4){return cmHopperHistory[_0xef61('0x1d')](_0x63edd4)[_0xef61('0x9')](function(_0x39c15e){logger[_0xef61('0xb')](_0xef61('0x1e'),inspectError(_0x39c15e));});}exports[_0xef61('0x1d')]=createHistory; \ No newline at end of file +var _0xf072=['dialer','../../rpc/cmHopperAdditionalPhone','../../rpc/cmHopperHistory','inspect','getContactDialer','dialOrderByScheduledAt','catch','temp','error','[getContactDialer]','getContactDialerIvr','[getContactDialerIvr]','[countReScheduled]','countReScheduled','[rescheduleContact]','rescheduleContact','[unlockContact]','unlockContact','moveContactManagedDialer','checkIsBlackList','[checkIsBlackList]','checkIsBlackListIvr','verifyAdditionalPhones','swapAdditionalPhones','[swapAdditionalPhone]','avgHandleTime','[avgHandleTime]','createHistory','[createHistory]','util','../../../../config/logger'];(function(_0x289187,_0x5b6795){var _0x5c4db4=function(_0x1e4618){while(--_0x1e4618){_0x289187['push'](_0x289187['shift']());}};_0x5c4db4(++_0x5b6795);}(_0xf072,0x1cf));var _0x2f07=function(_0x4e8880,_0x2505ef){_0x4e8880=_0x4e8880-0x0;var _0x3688ae=_0xf072[_0x4e8880];return _0x3688ae;};'use strict';var util=require(_0x2f07('0x0'));var logger=require(_0x2f07('0x1'))(_0x2f07('0x2'));var cmHopper=require('../../rpc/cmHopper');var cmHopperAdditionalPhone=require(_0x2f07('0x3'));var cmHopperBlack=require('../../rpc/cmHopperBlack');var cmHopperHistory=require(_0x2f07('0x4'));function inspectError(_0x432696){return util[_0x2f07('0x5')](_0x432696,{'showHidden':![],'depth':null});}function getContactDialer(_0x48d7b6,_0x1d5a33,_0x14d6e6){return cmHopper[_0x2f07('0x6')](_0x48d7b6['id'],_0x1d5a33,_0x14d6e6,_0x48d7b6[_0x2f07('0x7')])[_0x2f07('0x8')](function(_0xf73d1a){_0x48d7b6[_0x2f07('0x9')]=0x0;logger[_0x2f07('0xa')](_0x2f07('0xb'),inspectError(_0xf73d1a));});}exports[_0x2f07('0x6')]=getContactDialer;function getContactDialerIvr(_0x30c638,_0x2e372c){return cmHopper[_0x2f07('0xc')](_0x30c638['id'],_0x2e372c,_0x30c638[_0x2f07('0x7')])[_0x2f07('0x8')](function(_0x564260){_0x30c638[_0x2f07('0x9')]=0x0;logger[_0x2f07('0xa')](_0x2f07('0xd'),inspectError(_0x564260));});}exports[_0x2f07('0xc')]=getContactDialerIvr;function countReScheduled(_0x496d87){return cmHopper['countReScheduled'](_0x496d87)[_0x2f07('0x8')](function(_0x1e291d){logger['error'](_0x2f07('0xe'),inspectError(_0x1e291d));});}exports[_0x2f07('0xf')]=countReScheduled;function rescheduleContact(_0x26edfa){return cmHopper['rescheduleContact'](_0x26edfa)[_0x2f07('0x8')](function(_0x443fdc){logger[_0x2f07('0xa')](_0x2f07('0x10'),inspectError(_0x443fdc));});}exports[_0x2f07('0x11')]=rescheduleContact;function unlockContact(_0x309908,_0x5d32d6,_0x8475cf){return cmHopper['unlockContact'](_0x309908,_0x5d32d6,_0x8475cf)[_0x2f07('0x8')](function(_0xe8cf4d){logger[_0x2f07('0xa')](_0x2f07('0x12'),inspectError(_0xe8cf4d));});}exports[_0x2f07('0x13')]=unlockContact;function moveContactManagedDialer(_0x46c9b4){return cmHopper[_0x2f07('0x14')](_0x46c9b4)[_0x2f07('0x8')](function(_0x55bd60){logger[_0x2f07('0xa')]('[moveContactManagedDialer]',inspectError(_0x55bd60));});}exports[_0x2f07('0x14')]=moveContactManagedDialer;function checkIsBlackList(_0x2df6ed){return cmHopperBlack[_0x2f07('0x15')](_0x2df6ed)[_0x2f07('0x8')](function(_0x2ef47d){logger['error'](_0x2f07('0x16'),inspectError(_0x2ef47d));});}exports['checkIsBlackList']=checkIsBlackList;function checkIsBlackListIvr(_0x5db56b){return cmHopperBlack['checkIsBlackListIvr'](_0x5db56b)[_0x2f07('0x8')](function(_0x51c285){logger[_0x2f07('0xa')]('[checkIsBlackListIvr]',inspectError(_0x51c285));});}exports[_0x2f07('0x17')]=checkIsBlackListIvr;function verifyAdditionalPhones(_0x2c495f,_0x12a2a5,_0x307888){return cmHopperAdditionalPhone['verifyAdditionalPhones'](_0x2c495f,_0x12a2a5,_0x307888)[_0x2f07('0x8')](function(_0x428d8c){logger[_0x2f07('0xa')]('[verifyAdditionalPhone]',inspectError(_0x428d8c));});}exports[_0x2f07('0x18')]=verifyAdditionalPhones;function swapAdditionalPhones(_0x113916,_0x522006,_0x1dcedc){return cmHopperAdditionalPhone[_0x2f07('0x19')](_0x113916,_0x522006,_0x1dcedc)['catch'](function(_0x427e13){logger['error'](_0x2f07('0x1a'),inspectError(_0x427e13));});}exports[_0x2f07('0x19')]=swapAdditionalPhones;function avgHandleTime(_0x27bd72){return cmHopperHistory[_0x2f07('0x1b')](_0x27bd72)[_0x2f07('0x8')](function(_0x139ea8){logger[_0x2f07('0xa')](_0x2f07('0x1c'),inspectError(_0x139ea8));});}exports[_0x2f07('0x1b')]=avgHandleTime;function createHistory(_0x468cd8){return cmHopperHistory[_0x2f07('0x1d')](_0x468cd8)[_0x2f07('0x8')](function(_0x4c607a){logger[_0x2f07('0xa')](_0x2f07('0x1e'),inspectError(_0x4c607a));});}exports[_0x2f07('0x1d')]=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 ce588b0..4341b15 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 _0xbfe9=['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','preview','isPreviewCampaign','type','ivr','outbound','isOutboundQueue','dialActive','isQueueCampaignActive','active','isIVRCampaignActive','seconds','getSeconds','dialMethod','message','available','loggedIn','loggedInDb','paused','talking','pTalking','waiting','inUse','originated','Trunk','name','hasQueueCampaignDataChanged','dialTimezone','isNil','dialGlobalInterval','Interval','NULL_INTERVAL','isEmpty','Intervals','EMPTY_INTERVAL','UNKNOWN_TIMEZONE','SIP/','includes','TrunkBackup','status','INACTIVE','DISACTIVED','NO_AGENTS_LOGGED','getQueueCampaignActiveStatusMessage','match','isUndefined','string','\x22%s\x22\x20<%s>','format','\x22\x22\x20<>','getCallerId','\x5cw{0,','pow','replace','random','error','[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative','decrementOriginate','length','checkContactEmpty','erlangb','checkContactLowerLimitOriginate','createdAt','tags','%s%s','XMD-','lodash','moment','util','../../../../config/logger','dialer','../../../../config/environment/shared','ACTIVE','BLACKLIST','RESCHEDULED_CONTACTS','DEACTIVATED'];(function(_0x40959a,_0x30a483){var _0x3f5b61=function(_0x31944){while(--_0x31944){_0x40959a['push'](_0x40959a['shift']());}};_0x3f5b61(++_0x30a483);}(_0xbfe9,0xa4));var _0x9bfe=function(_0x51be01,_0x46add5){_0x51be01=_0x51be01-0x0;var _0x2606e1=_0xbfe9[_0x51be01];return _0x2606e1;};'use strict';var _=require(_0x9bfe('0x0'));var moment=require(_0x9bfe('0x1'));var util=require(_0x9bfe('0x2'));var logger=require(_0x9bfe('0x3'))(_0x9bfe('0x4'));var timezones=require(_0x9bfe('0x5'))['timezones'];var CAMPAIGN_STATUS={'ACTIVE':_0x9bfe('0x6'),'BLACKLIST':_0x9bfe('0x7'),'CONTACTS_RESCHEDULED':_0x9bfe('0x8'),'DEACTIVATED':_0x9bfe('0x9'),'DISACTIVED':_0x9bfe('0xa'),'EMPTY_INTERVAL':_0x9bfe('0xb'),'INACTIVE':_0x9bfe('0xc'),'NO_AGENTS_LOGGED':_0x9bfe('0xd'),'NO_AVAILABLE_CONTACTS':_0x9bfe('0xe'),'NULL_INTERVAL':_0x9bfe('0xf'),'OVERTIME_INTERVAL':_0x9bfe('0x10'),'OVERTIME_GLOBAL_INTERVAL':_0x9bfe('0x11'),'QUEUE_RECALL':_0x9bfe('0x12'),'RECALL_TIMEOUT':'RECALLFAILEDTIMEOUT','RUNNING':'RUNNING','UNKNOWN_TIMEZONE':_0x9bfe('0x13'),'UNREACHABLE_TRUNK':_0x9bfe('0x14')};exports[_0x9bfe('0x15')]=CAMPAIGN_STATUS;function isPreviewCampaign(_0xa4545e){return _0xa4545e['dialMethod']===_0x9bfe('0x16');}exports[_0x9bfe('0x17')]=isPreviewCampaign;function isIVRCampaign(_0x4babe4){return _0x4babe4[_0x9bfe('0x18')]===_0x9bfe('0x19');}exports['isIVRCampaign']=isIVRCampaign;function isOutboundQueue(_0x374b5a){return _0x374b5a[_0x9bfe('0x18')]===_0x9bfe('0x1a');}exports[_0x9bfe('0x1b')]=isOutboundQueue;function isQueueCampaignActive(_0x31eb2b){return _0x31eb2b[_0x9bfe('0x1c')];}exports[_0x9bfe('0x1d')]=isQueueCampaignActive;function isIVRCampaignActive(_0x22bf58){return _0x22bf58[_0x9bfe('0x1e')];}exports[_0x9bfe('0x1f')]=isIVRCampaignActive;function getSeconds(_0x181cf5,_0x24e75a){var _0x5a64dc=moment(_0x181cf5)['milliseconds'](0x0);var _0x437e0e=moment(_0x24e75a)['milliseconds'](0x0);return _0x5a64dc['diff'](_0x437e0e,_0x9bfe('0x20'));}exports[_0x9bfe('0x21')]=getSeconds;function hasQueueCampaignDataChanged(_0x5ee4d6,_0x14f791){var _0x1c80e6=![];var _0x39fc8a=_0x5ee4d6[_0x9bfe('0x22')]!==_0x14f791['dialMethod']||_0x5ee4d6[_0x9bfe('0x1c')]!==_0x14f791['dialActive']||_0x5ee4d6['message']!==_0x14f791[_0x9bfe('0x23')];var _0x366e5a=_0x5ee4d6['available']!==_0x14f791[_0x9bfe('0x24')]||_0x5ee4d6[_0x9bfe('0x25')]!==_0x14f791[_0x9bfe('0x25')]||_0x5ee4d6[_0x9bfe('0x26')]!==_0x14f791[_0x9bfe('0x26')]||_0x5ee4d6[_0x9bfe('0x27')]!==_0x14f791['paused']||_0x5ee4d6[_0x9bfe('0x28')]!==_0x14f791['talking']||_0x5ee4d6['pTalking']!==_0x14f791[_0x9bfe('0x29')]||_0x5ee4d6['waiting']!==_0x14f791[_0x9bfe('0x2a')]||_0x5ee4d6[_0x9bfe('0x2b')]!==_0x14f791['inUse']||_0x5ee4d6[_0x9bfe('0x2c')]!==_0x14f791[_0x9bfe('0x2c')];if(_0x5ee4d6['Trunk']&&_0x14f791['Trunk']){_0x1c80e6=_0x5ee4d6[_0x9bfe('0x2d')][_0x9bfe('0x2e')]!==_0x14f791[_0x9bfe('0x2d')][_0x9bfe('0x2e')]||_0x5ee4d6[_0x9bfe('0x2d')][_0x9bfe('0x1e')]!==_0x14f791[_0x9bfe('0x2d')][_0x9bfe('0x1e')];}return _0x39fc8a||_0x366e5a||_0x1c80e6;}exports[_0x9bfe('0x2f')]=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0x116cf1){var _0x9f8e1b=null;var _0xf7c3b9=_0x116cf1[_0x9bfe('0x30')];if(_[_0x9bfe('0x31')](_0x116cf1[_0x9bfe('0x32')])||_[_0x9bfe('0x31')](_0x116cf1[_0x9bfe('0x33')])||_[_0x9bfe('0x31')](_0x116cf1['Interval']['Intervals'])){_0x9f8e1b=CAMPAIGN_STATUS[_0x9bfe('0x34')];}else if(_[_0x9bfe('0x35')](_0x116cf1['dialGlobalInterval'])||_[_0x9bfe('0x35')](_0x116cf1[_0x9bfe('0x33')][_0x9bfe('0x36')])){_0x9f8e1b=CAMPAIGN_STATUS[_0x9bfe('0x37')];}else if(_0xf7c3b9&&!timezones[_0xf7c3b9]){_0x9f8e1b=CAMPAIGN_STATUS[_0x9bfe('0x38')];}return _0x9f8e1b;}function checkAnyValidTrunk(_0x2e54b7,_0x36c3c8){var _0x2caf1e=null;var _0x5a536d=_0x9bfe('0x39');var _0x5110a7=['reachable','unmonitored'];var _0x2851fb=!![];if(_0x2e54b7[_0x9bfe('0x2d')]&&_0x2e54b7[_0x9bfe('0x2d')][_0x9bfe('0x1e')]){_0x5a536d+=_0x2e54b7[_0x9bfe('0x2d')][_0x9bfe('0x2e')];_0x2caf1e=_0x36c3c8[_0x5a536d];_0x2851fb=_0x5110a7[_0x9bfe('0x3a')](_0x2caf1e['status']);}else if(_0x2e54b7[_0x9bfe('0x3b')]&&_0x2e54b7[_0x9bfe('0x3b')][_0x9bfe('0x1e')]){_0x5a536d+=_0x2e54b7['TrunkBackup'][_0x9bfe('0x2e')];_0x2caf1e=_0x36c3c8[_0x5a536d];_0x2851fb=_0x5110a7[_0x9bfe('0x3a')](_0x2caf1e[_0x9bfe('0x3c')]);}return _0x2851fb;}function getQueueCampaignStatusMessage(_0x2ea48d,_0x5097ad){var _0x46ce02=CAMPAIGN_STATUS['ACTIVE'];var _0xa06fb2=isPreviewCampaign(_0x2ea48d);if(!isQueueCampaignActive(_0x2ea48d)){if(_0xa06fb2){_0x46ce02=CAMPAIGN_STATUS[_0x9bfe('0x3d')];}else{if(_0x2ea48d['originated']===0x0&&_0x2ea48d[_0x9bfe('0x28')]===0x0&&_0x2ea48d[_0x9bfe('0x2a')]===0x0&&(_0x2ea48d['pTalking']||0x0)===0x0){_0x46ce02=CAMPAIGN_STATUS['INACTIVE'];}else{_0x46ce02=CAMPAIGN_STATUS[_0x9bfe('0x3e')];}}}else if(_0x2ea48d['loggedIn']===0x0){_0x46ce02=CAMPAIGN_STATUS[_0x9bfe('0x3f')];}else if(!checkAnyValidTrunk(_0x2ea48d,_0x5097ad)){_0x46ce02=CAMPAIGN_STATUS['UNREACHABLE_TRUNK'];}else if(!isPreviewCampaign(_0x2ea48d)){var _0x5cc615=checkAnyValidQueueCampaignInterval(_0x2ea48d);if(_0x5cc615){_0x46ce02=_0x5cc615;}}return _0x46ce02;}exports['getQueueCampaignStatusMessage']=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0x320945){var _0x5c0245=CAMPAIGN_STATUS[_0x9bfe('0x3e')];if(_0x320945['originated']===0x0&&_0x320945[_0x9bfe('0x28')]===0x0&&_0x320945['waiting']===0x0&&(_0x320945[_0x9bfe('0x29')]||0x0)===0x0){_0x5c0245=CAMPAIGN_STATUS['INACTIVE'];}return _0x5c0245;}exports[_0x9bfe('0x40')]=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0x4f9b3c){var _0x179d70=_0x4f9b3c[_0x9bfe('0x41')](/"(.*?)"/);return _0x179d70?_0x179d70[0x1]:_0x4f9b3c;}exports['extractCalleridName']=extractCalleridName;function getCallerId(_0x44231d,_0xd89be6,_0xe0f034){if(!_[_0x9bfe('0x42')](_0xe0f034)&&typeof _0xe0f034==='string'&&!_[_0x9bfe('0x35')](_0xe0f034)){if(!_[_0x9bfe('0x42')](_0xd89be6)&&typeof _0xd89be6===_0x9bfe('0x43')&&!_[_0x9bfe('0x35')](_0xd89be6)){return util['format'](_0x9bfe('0x44'),_0xd89be6,_0xe0f034);}return util[_0x9bfe('0x45')](_0x9bfe('0x44'),_0xe0f034,_0xe0f034);}if(!_['isUndefined'](_0x44231d)&&typeof _0x44231d==='string'&&!_[_0x9bfe('0x35')](_0x44231d)){return _0x44231d;}return _0x9bfe('0x46');}exports[_0x9bfe('0x47')]=getCallerId;function getCallerIdRandom(_0x4b0136,_0x1a33be){var _0x5e7e6e;var _0xffb04b;var _0xad2f9d;if(_0x1a33be<=0x0){_0x1a33be=0x1;}_0x5e7e6e=new RegExp(_0x9bfe('0x48')+_0x1a33be+'}$');_0xffb04b=Math[_0x9bfe('0x49')](0xa,_0x1a33be-0x1);_0xad2f9d=Math[_0x9bfe('0x49')](0xa,_0x1a33be)-0x1;return util['format']('%s',_[_0x9bfe('0x4a')](_0x4b0136,_0x5e7e6e,_[_0x9bfe('0x4b')](_0xffb04b,_0xad2f9d)['toString']()));}exports['getCallerIdRandom']=getCallerIdRandom;function decrementOriginate(_0x243382){if(_0x243382[_0x9bfe('0x2c')]&&_0x243382['originated']>0x0){_0x243382[_0x9bfe('0x2c')]-=0x1;}else{logger[_0x9bfe('0x4c')](_0x9bfe('0x4d'));}}exports[_0x9bfe('0x4e')]=decrementOriginate;function checkContactEmpty(_0x4abdf9){return _0x4abdf9&&_0x4abdf9[_0x9bfe('0x4f')]>0x0;}exports[_0x9bfe('0x50')]=checkContactEmpty;function erlangb(_0x4c28bd,_0x551967){if(_0x551967===0x0){return 0x0;}var _0x262e26=0x1;for(var _0x4c7597=0x1;_0x4c7597<=_0x551967;_0x4c7597+=0x1){_0x262e26=0x1+_0x262e26*_0x4c7597/_0x4c28bd;}return 0x1/_0x262e26;}exports[_0x9bfe('0x51')]=erlangb;function checkContactLowerLimitOriginate(_0x56365e,_0x8043a8,_0x2ed0bc){if(_0x8043a8>_0x2ed0bc){for(var _0x7e4e4d=0x0;_0x7e4e4d<_0x8043a8-_0x2ed0bc;_0x7e4e4d+=0x1){decrementOriginate(_0x56365e);}}}exports[_0x9bfe('0x52')]=checkContactLowerLimitOriginate;function setXMDContactVariables(_0x4bf713){var _0x12a111={};var _0x7c83cd=['id',_0x9bfe('0x53'),'description',_0x9bfe('0x54'),'updatedAt'];if(_0x4bf713){for(var _0x554695 in _0x4bf713){if(typeof _0x4bf713[_0x554695]!=='undefined'){if(!_[_0x9bfe('0x31')](_0x4bf713[_0x554695])&&!_0x7c83cd[_0x9bfe('0x3a')](_0x554695)){_0x12a111[util[_0x9bfe('0x45')](_0x9bfe('0x55'),_0x9bfe('0x56'),_0x554695['toUpperCase']())]=_0x4bf713[_0x554695];}}}}return _0x12a111;}exports['setXMDContactVariables']=setXMDContactVariables; \ No newline at end of file +var _0xe7d9=['pTalking','waiting','inUse','originated','Trunk','name','hasQueueCampaignDataChanged','dialTimezone','isNil','dialGlobalInterval','Interval','Intervals','NULL_INTERVAL','isEmpty','EMPTY_INTERVAL','UNKNOWN_TIMEZONE','SIP/','reachable','status','TrunkBackup','includes','INACTIVE','NO_AGENTS_LOGGED','UNREACHABLE_TRUNK','match','extractCalleridName','isUndefined','string','format','\x22%s\x22\x20<%s>','getCallerId','\x5cw{0,','pow','replace','random','toString','getCallerIdRandom','[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative','checkContactEmpty','erlangb','checkContactLowerLimitOriginate','createdAt','description','updatedAt','undefined','%s%s','XMD-','toUpperCase','lodash','moment','util','../../../../config/logger','dialer','../../../../config/environment/shared','timezones','BLACKLIST','RESCHEDULED_CONTACTS','DEACTIVATED','IS_DISACTIVED','INTERVAL_IS_EMPTY','AGENTS_NOT_LOGGED','AVAILABLE_CONTACTS_FINISHED','INTERVAL_IS_NULL','RECALLINQUEUE','RECALLFAILEDTIMEOUT','RUNNING','TIMEZONE_UNKNOW','TRUNK_IS_NOT_REACHABLE','dialMethod','preview','ivr','isIVRCampaign','outbound','isOutboundQueue','dialActive','isQueueCampaignActive','active','isIVRCampaignActive','milliseconds','diff','seconds','getSeconds','message','available','loggedIn','loggedInDb','paused','talking'];(function(_0x867b0a,_0x587ccf){var _0x137438=function(_0xbeafa6){while(--_0xbeafa6){_0x867b0a['push'](_0x867b0a['shift']());}};_0x137438(++_0x587ccf);}(_0xe7d9,0xe0));var _0x9e7d=function(_0xdc7463,_0x48e676){_0xdc7463=_0xdc7463-0x0;var _0x7c4a2d=_0xe7d9[_0xdc7463];return _0x7c4a2d;};'use strict';var _=require(_0x9e7d('0x0'));var moment=require(_0x9e7d('0x1'));var util=require(_0x9e7d('0x2'));var logger=require(_0x9e7d('0x3'))(_0x9e7d('0x4'));var timezones=require(_0x9e7d('0x5'))[_0x9e7d('0x6')];var CAMPAIGN_STATUS={'ACTIVE':'ACTIVE','BLACKLIST':_0x9e7d('0x7'),'CONTACTS_RESCHEDULED':_0x9e7d('0x8'),'DEACTIVATED':_0x9e7d('0x9'),'DISACTIVED':_0x9e7d('0xa'),'EMPTY_INTERVAL':_0x9e7d('0xb'),'INACTIVE':'NOT_ACTIVE','NO_AGENTS_LOGGED':_0x9e7d('0xc'),'NO_AVAILABLE_CONTACTS':_0x9e7d('0xd'),'NULL_INTERVAL':_0x9e7d('0xe'),'OVERTIME_INTERVAL':'INTERVAL_IS_OVERTIME','OVERTIME_GLOBAL_INTERVAL':'GLOBAL_INTERVAL_IS_OVERTIME','QUEUE_RECALL':_0x9e7d('0xf'),'RECALL_TIMEOUT':_0x9e7d('0x10'),'RUNNING':_0x9e7d('0x11'),'UNKNOWN_TIMEZONE':_0x9e7d('0x12'),'UNREACHABLE_TRUNK':_0x9e7d('0x13')};exports['CAMPAIGN_STATUS']=CAMPAIGN_STATUS;function isPreviewCampaign(_0x2d578f){return _0x2d578f[_0x9e7d('0x14')]===_0x9e7d('0x15');}exports['isPreviewCampaign']=isPreviewCampaign;function isIVRCampaign(_0x369ed6){return _0x369ed6['type']===_0x9e7d('0x16');}exports[_0x9e7d('0x17')]=isIVRCampaign;function isOutboundQueue(_0x378783){return _0x378783['type']===_0x9e7d('0x18');}exports[_0x9e7d('0x19')]=isOutboundQueue;function isQueueCampaignActive(_0x122dde){return _0x122dde[_0x9e7d('0x1a')];}exports[_0x9e7d('0x1b')]=isQueueCampaignActive;function isIVRCampaignActive(_0x39b995){return _0x39b995[_0x9e7d('0x1c')];}exports[_0x9e7d('0x1d')]=isIVRCampaignActive;function getSeconds(_0x5a77ae,_0x34812c){var _0xc829f9=moment(_0x5a77ae)['milliseconds'](0x0);var _0x43e991=moment(_0x34812c)[_0x9e7d('0x1e')](0x0);return _0xc829f9[_0x9e7d('0x1f')](_0x43e991,_0x9e7d('0x20'));}exports[_0x9e7d('0x21')]=getSeconds;function hasQueueCampaignDataChanged(_0x3e6a81,_0x2a8887){var _0x581b0e=![];var _0x4e6eca=_0x3e6a81[_0x9e7d('0x14')]!==_0x2a8887['dialMethod']||_0x3e6a81[_0x9e7d('0x1a')]!==_0x2a8887['dialActive']||_0x3e6a81['message']!==_0x2a8887[_0x9e7d('0x22')];var _0x3e1e64=_0x3e6a81[_0x9e7d('0x23')]!==_0x2a8887[_0x9e7d('0x23')]||_0x3e6a81['loggedIn']!==_0x2a8887[_0x9e7d('0x24')]||_0x3e6a81[_0x9e7d('0x25')]!==_0x2a8887[_0x9e7d('0x25')]||_0x3e6a81['paused']!==_0x2a8887[_0x9e7d('0x26')]||_0x3e6a81[_0x9e7d('0x27')]!==_0x2a8887['talking']||_0x3e6a81[_0x9e7d('0x28')]!==_0x2a8887[_0x9e7d('0x28')]||_0x3e6a81['waiting']!==_0x2a8887[_0x9e7d('0x29')]||_0x3e6a81['inUse']!==_0x2a8887[_0x9e7d('0x2a')]||_0x3e6a81['originated']!==_0x2a8887[_0x9e7d('0x2b')];if(_0x3e6a81[_0x9e7d('0x2c')]&&_0x2a8887['Trunk']){_0x581b0e=_0x3e6a81[_0x9e7d('0x2c')][_0x9e7d('0x2d')]!==_0x2a8887[_0x9e7d('0x2c')][_0x9e7d('0x2d')]||_0x3e6a81[_0x9e7d('0x2c')]['active']!==_0x2a8887['Trunk']['active'];}return _0x4e6eca||_0x3e1e64||_0x581b0e;}exports[_0x9e7d('0x2e')]=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0x18d67e){var _0x624136=null;var _0x36229b=_0x18d67e[_0x9e7d('0x2f')];if(_[_0x9e7d('0x30')](_0x18d67e[_0x9e7d('0x31')])||_['isNil'](_0x18d67e[_0x9e7d('0x32')])||_[_0x9e7d('0x30')](_0x18d67e[_0x9e7d('0x32')][_0x9e7d('0x33')])){_0x624136=CAMPAIGN_STATUS[_0x9e7d('0x34')];}else if(_[_0x9e7d('0x35')](_0x18d67e[_0x9e7d('0x31')])||_[_0x9e7d('0x35')](_0x18d67e[_0x9e7d('0x32')][_0x9e7d('0x33')])){_0x624136=CAMPAIGN_STATUS[_0x9e7d('0x36')];}else if(_0x36229b&&!timezones[_0x36229b]){_0x624136=CAMPAIGN_STATUS[_0x9e7d('0x37')];}return _0x624136;}function checkAnyValidTrunk(_0x245580,_0x5184de){var _0x13202f=null;var _0x490921=_0x9e7d('0x38');var _0x56d0e6=[_0x9e7d('0x39'),'unmonitored'];var _0x2c1416=!![];if(_0x245580[_0x9e7d('0x2c')]&&_0x245580[_0x9e7d('0x2c')][_0x9e7d('0x1c')]){_0x490921+=_0x245580[_0x9e7d('0x2c')][_0x9e7d('0x2d')];_0x13202f=_0x5184de[_0x490921];_0x2c1416=_0x56d0e6['includes'](_0x13202f[_0x9e7d('0x3a')]);}else if(_0x245580[_0x9e7d('0x3b')]&&_0x245580['TrunkBackup']['active']){_0x490921+=_0x245580[_0x9e7d('0x3b')][_0x9e7d('0x2d')];_0x13202f=_0x5184de[_0x490921];_0x2c1416=_0x56d0e6[_0x9e7d('0x3c')](_0x13202f[_0x9e7d('0x3a')]);}return _0x2c1416;}function getQueueCampaignStatusMessage(_0x450b02,_0xc3a6a8){var _0x4457c5=CAMPAIGN_STATUS['ACTIVE'];var _0x4e26da=isPreviewCampaign(_0x450b02);if(!isQueueCampaignActive(_0x450b02)){if(_0x4e26da){_0x4457c5=CAMPAIGN_STATUS[_0x9e7d('0x3d')];}else{if(_0x450b02['originated']===0x0&&_0x450b02[_0x9e7d('0x27')]===0x0&&_0x450b02[_0x9e7d('0x29')]===0x0&&(_0x450b02['pTalking']||0x0)===0x0){_0x4457c5=CAMPAIGN_STATUS[_0x9e7d('0x3d')];}else{_0x4457c5=CAMPAIGN_STATUS['DISACTIVED'];}}}else if(_0x450b02[_0x9e7d('0x24')]===0x0){_0x4457c5=CAMPAIGN_STATUS[_0x9e7d('0x3e')];}else if(!checkAnyValidTrunk(_0x450b02,_0xc3a6a8)){_0x4457c5=CAMPAIGN_STATUS[_0x9e7d('0x3f')];}else if(!isPreviewCampaign(_0x450b02)){var _0xef511b=checkAnyValidQueueCampaignInterval(_0x450b02);if(_0xef511b){_0x4457c5=_0xef511b;}}return _0x4457c5;}exports['getQueueCampaignStatusMessage']=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0x156a24){var _0x2ec48e=CAMPAIGN_STATUS['DISACTIVED'];if(_0x156a24[_0x9e7d('0x2b')]===0x0&&_0x156a24[_0x9e7d('0x27')]===0x0&&_0x156a24[_0x9e7d('0x29')]===0x0&&(_0x156a24[_0x9e7d('0x28')]||0x0)===0x0){_0x2ec48e=CAMPAIGN_STATUS[_0x9e7d('0x3d')];}return _0x2ec48e;}exports['getQueueCampaignActiveStatusMessage']=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0x42eddf){var _0x1c12f6=_0x42eddf[_0x9e7d('0x40')](/"(.*?)"/);return _0x1c12f6?_0x1c12f6[0x1]:_0x42eddf;}exports[_0x9e7d('0x41')]=extractCalleridName;function getCallerId(_0x16a3df,_0x5709b3,_0x388e95){if(!_[_0x9e7d('0x42')](_0x388e95)&&typeof _0x388e95===_0x9e7d('0x43')&&!_[_0x9e7d('0x35')](_0x388e95)){if(!_['isUndefined'](_0x5709b3)&&typeof _0x5709b3===_0x9e7d('0x43')&&!_[_0x9e7d('0x35')](_0x5709b3)){return util[_0x9e7d('0x44')]('\x22%s\x22\x20<%s>',_0x5709b3,_0x388e95);}return util[_0x9e7d('0x44')](_0x9e7d('0x45'),_0x388e95,_0x388e95);}if(!_[_0x9e7d('0x42')](_0x16a3df)&&typeof _0x16a3df===_0x9e7d('0x43')&&!_[_0x9e7d('0x35')](_0x16a3df)){return _0x16a3df;}return'\x22\x22\x20<>';}exports[_0x9e7d('0x46')]=getCallerId;function getCallerIdRandom(_0x1e565f,_0x498807){var _0x4c4667;var _0x6493e7;var _0xf85035;if(_0x498807<=0x0){_0x498807=0x1;}_0x4c4667=new RegExp(_0x9e7d('0x47')+_0x498807+'}$');_0x6493e7=Math[_0x9e7d('0x48')](0xa,_0x498807-0x1);_0xf85035=Math[_0x9e7d('0x48')](0xa,_0x498807)-0x1;return util[_0x9e7d('0x44')]('%s',_[_0x9e7d('0x49')](_0x1e565f,_0x4c4667,_[_0x9e7d('0x4a')](_0x6493e7,_0xf85035)[_0x9e7d('0x4b')]()));}exports[_0x9e7d('0x4c')]=getCallerIdRandom;function decrementOriginate(_0x3f67d6){if(_0x3f67d6[_0x9e7d('0x2b')]&&_0x3f67d6[_0x9e7d('0x2b')]>0x0){_0x3f67d6['originated']-=0x1;}else{logger['error'](_0x9e7d('0x4d'));}}exports['decrementOriginate']=decrementOriginate;function checkContactEmpty(_0x3bda64){return _0x3bda64&&_0x3bda64['length']>0x0;}exports[_0x9e7d('0x4e')]=checkContactEmpty;function erlangb(_0x992644,_0x5e7fc5){if(_0x5e7fc5===0x0){return 0x0;}var _0x272d7e=0x1;for(var _0x332d8f=0x1;_0x332d8f<=_0x5e7fc5;_0x332d8f+=0x1){_0x272d7e=0x1+_0x272d7e*_0x332d8f/_0x992644;}return 0x1/_0x272d7e;}exports[_0x9e7d('0x4f')]=erlangb;function checkContactLowerLimitOriginate(_0x30fb49,_0x1e01b3,_0x4da3e3){if(_0x1e01b3>_0x4da3e3){for(var _0x149e83=0x0;_0x149e83<_0x1e01b3-_0x4da3e3;_0x149e83+=0x1){decrementOriginate(_0x30fb49);}}}exports[_0x9e7d('0x50')]=checkContactLowerLimitOriginate;function setXMDContactVariables(_0xb8ef51){var _0x27ed98={};var _0x527690=['id',_0x9e7d('0x51'),_0x9e7d('0x52'),'tags',_0x9e7d('0x53')];if(_0xb8ef51){for(var _0x2adcc4 in _0xb8ef51){if(typeof _0xb8ef51[_0x2adcc4]!==_0x9e7d('0x54')){if(!_[_0x9e7d('0x30')](_0xb8ef51[_0x2adcc4])&&!_0x527690[_0x9e7d('0x3c')](_0x2adcc4)){_0x27ed98[util[_0x9e7d('0x44')](_0x9e7d('0x55'),_0x9e7d('0x56'),_0x2adcc4[_0x9e7d('0x57')]())]=_0xb8ef51[_0x2adcc4];}}}}return _0x27ed98;}exports['setXMDContactVariables']=setXMDContactVariables; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index d1fdfc1..22f2da9 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(_0x11d8cf,_0x404f6a){var _0x3288f6=function(_0x41e33e){while(--_0x41e33e){_0x11d8cf['push'](_0x11d8cf['shift']());}};_0x3288f6(++_0x404f6a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xa9e0[_0x5ddb1c];return _0x354adc;};'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(_0x4a8f59,_0x116da5){var _0x3b6afc=function(_0x14bf18){while(--_0x14bf18){_0x4a8f59['push'](_0x4a8f59['shift']());}};_0x3b6afc(++_0x116da5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xa9e0[_0x4dbaad];return _0x226c72;};'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 bef6f7f..db09c5c 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 _0xaa2d=['\x20result\x20conversion\x20file\x20','message','parse','.pdf','application/pdf','notify','catch','\x20notify\x20','stringify','error','\x20receiveFax\x20','merge','pick','reason','AttachmentId','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','then','[Fax][Message][Updated]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','send','FaxAccountId','Fax\x20received','[Fax][execOriginate][failure]','checkTrunk','Trunk','isValid','Trunk\x20Reachable','format','execute','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','execOriginate','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','reachable','[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports','lodash','path','tiff2pdf','./util/gs','fax','../ami','./rpcDb','./action','../rpc/attachment','../rpc/faxMessage','faxAccounts','trunks','actions','newchannel','varset','syncNewState','bind','syncNewExten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','hangup','syncHangup','originateresponse','syncOriginateResponse','prototype','syncNewchannel','context','hasOwnProperty','exten','localstationid','channels','uniqueid','channel','name','\x20syncNewchannel\x20','info','syncVarSet','variable','value','channelstate','channelstatedesc','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum'];(function(_0x1a0471,_0x2de8ce){var _0x47b336=function(_0x4ae51b){while(--_0x4ae51b){_0x1a0471['push'](_0x1a0471['shift']());}};_0x47b336(++_0x2de8ce);}(_0xaa2d,0x11c));var _0xdaa2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xaa2d[_0x3dd15e];return _0x231fd0;};'use strict';var util=require('util');var _=require(_0xdaa2('0x0'));var BPromise=require('bluebird');var uuid=require('uuid');var moment=require('moment');var path=require(_0xdaa2('0x1'));var tiff2pdf=require(_0xdaa2('0x2'));var gs=require(_0xdaa2('0x3'));var logger=require('../../../config/logger')(_0xdaa2('0x4'));var ami=require(_0xdaa2('0x5'));var rpcDb=require(_0xdaa2('0x6'));var Channel=require('./channel');var ut=require('./util/util');var Action=require(_0xdaa2('0x7'));var faxAccount=require('../rpc/faxAccount');var attachment=require(_0xdaa2('0x8'));var faxMessage=require(_0xdaa2('0x9'));function Fax(_0x259599){this['channels']={};this[_0xdaa2('0xa')]=_0x259599[_0xdaa2('0xa')];this[_0xdaa2('0xb')]=_0x259599[_0xdaa2('0xb')];this[_0xdaa2('0xc')]={};ami['on'](_0xdaa2('0xd'),this['syncNewchannel']['bind'](this));ami['on'](_0xdaa2('0xe'),this['syncVarSet']['bind'](this));ami['on']('newstate',this[_0xdaa2('0xf')][_0xdaa2('0x10')](this));ami['on']('newexten',this[_0xdaa2('0x11')][_0xdaa2('0x10')](this));ami['on'](_0xdaa2('0x12'),this[_0xdaa2('0x13')][_0xdaa2('0x10')](this));ami['on'](_0xdaa2('0x14'),this[_0xdaa2('0x15')][_0xdaa2('0x10')](this));ami['on'](_0xdaa2('0x16'),this[_0xdaa2('0x17')][_0xdaa2('0x10')](this));ami['on'](_0xdaa2('0x18'),this[_0xdaa2('0x19')][_0xdaa2('0x10')](this));}Fax[_0xdaa2('0x1a')][_0xdaa2('0x1b')]=function(_0x5d24b7){if(_0x5d24b7[_0xdaa2('0x1c')]==='from-voip-provider'){for(var _0x303391 in this['faxAccounts']){if(this[_0xdaa2('0xa')][_0xdaa2('0x1d')](_0x303391)){if(_0x5d24b7[_0xdaa2('0x1e')]===this['faxAccounts'][_0x303391][_0xdaa2('0x1f')]){this[_0xdaa2('0x20')][_0x5d24b7[_0xdaa2('0x21')]]={};this[_0xdaa2('0x20')][_0x5d24b7[_0xdaa2('0x21')]][_0xdaa2('0x22')]=_0x5d24b7[_0xdaa2('0x22')];this[_0xdaa2('0x20')][_0x5d24b7['uniqueid']]['id']=this[_0xdaa2('0xa')][_0x303391]['id'];this[_0xdaa2('0x20')][_0x5d24b7[_0xdaa2('0x21')]][_0xdaa2('0x23')]=this['faxAccounts'][_0x303391][_0xdaa2('0x23')];logger['info'](_0x5d24b7[_0xdaa2('0x21')],_0xdaa2('0x24'));}}}}if(this[_0xdaa2('0xc')][_0x5d24b7[_0xdaa2('0x21')]]){this[_0xdaa2('0x20')][_0x5d24b7[_0xdaa2('0x21')]]={};this[_0xdaa2('0x20')][_0x5d24b7[_0xdaa2('0x21')]]['channel']=_0x5d24b7[_0xdaa2('0x22')];logger[_0xdaa2('0x25')](_0x5d24b7['uniqueid'],_0xdaa2('0x24'));}};Fax[_0xdaa2('0x1a')][_0xdaa2('0x26')]=function(_0x212f1a){if(this['channels'][_0x212f1a[_0xdaa2('0x21')]]){for(var _0xfc982d in _0x212f1a[_0xdaa2('0x27')]){if(_0x212f1a['variable']['hasOwnProperty'](_0xfc982d)){this['channels'][_0x212f1a['uniqueid']][_0xfc982d]=_0x212f1a[_0xdaa2('0x28')];}}}};Fax[_0xdaa2('0x1a')][_0xdaa2('0xf')]=function(_0x3a8071){if(this['channels'][_0x3a8071[_0xdaa2('0x21')]]){this['channels'][_0x3a8071['uniqueid']][_0xdaa2('0x29')]=_0x3a8071[_0xdaa2('0x29')];this[_0xdaa2('0x20')][_0x3a8071[_0xdaa2('0x21')]]['channelstatedesc']=_0x3a8071[_0xdaa2('0x2a')];}};Fax[_0xdaa2('0x1a')]['syncNewExten']=function(_0x3c513a){if(this[_0xdaa2('0x20')][_0x3c513a['uniqueid']]){for(var _0x5b00a2 in _0x3c513a[_0xdaa2('0x27')]){if(_0x3c513a[_0xdaa2('0x27')][_0xdaa2('0x1d')](_0x5b00a2)){this['channels'][_0x3c513a[_0xdaa2('0x21')]][_0x5b00a2]=_0x3c513a[_0xdaa2('0x28')];}}}};Fax['prototype'][_0xdaa2('0x13')]=function(_0x253356){if(this['channels'][_0x253356['uniqueid']]){this['channels'][_0x253356[_0xdaa2('0x21')]][_0xdaa2('0x2b')]=_0x253356[_0xdaa2('0x2b')];this['channels'][_0x253356['uniqueid']][_0xdaa2('0x2c')]=_0x253356['status'];this[_0xdaa2('0x20')][_0x253356[_0xdaa2('0x21')]]['localstationid']=_0x253356[_0xdaa2('0x1f')];this[_0xdaa2('0x20')][_0x253356[_0xdaa2('0x21')]][_0xdaa2('0x2d')]=_0x253356[_0xdaa2('0x2d')];logger[_0xdaa2('0x25')](_0x253356[_0xdaa2('0x21')],_0xdaa2('0x2e'));}};Fax[_0xdaa2('0x1a')]['syncReceiveFax']=function(_0x332076){var _0x417390=this;if(this['channels'][_0x332076['uniqueid']]){var _0x1f36ba=this[_0xdaa2('0x20')][_0x332076[_0xdaa2('0x21')]]['id'];this[_0xdaa2('0x20')][_0x332076[_0xdaa2('0x21')]][_0xdaa2('0x2f')]=_0x332076[_0xdaa2('0x2f')];this['channels'][_0x332076[_0xdaa2('0x21')]][_0xdaa2('0x30')]=_0x332076[_0xdaa2('0x30')];this[_0xdaa2('0x20')][_0x332076[_0xdaa2('0x21')]][_0xdaa2('0x1f')]=_0x332076['localstationid'];this[_0xdaa2('0x20')][_0x332076[_0xdaa2('0x21')]]['resolution']=_0x332076[_0xdaa2('0x31')];this[_0xdaa2('0x20')][_0x332076[_0xdaa2('0x21')]][_0xdaa2('0x32')]=_0x332076[_0xdaa2('0x32')];this[_0xdaa2('0x20')][_0x332076['uniqueid']][_0xdaa2('0x2d')]=_0x332076['filename'];this[_0xdaa2('0x20')][_0x332076[_0xdaa2('0x21')]][_0xdaa2('0x33')]=_0x332076['calleridnum'];if(this[_0xdaa2('0x20')][_0x332076[_0xdaa2('0x21')]][_0xdaa2('0x30')]>0x0){tiff2pdf(_0x332076['filename'],'/var/opt/motion2/server/files/attachments/',function(_0x269e98){logger[_0xdaa2('0x25')](_0x332076[_0xdaa2('0x21')],_0xdaa2('0x34'),_0x269e98[_0xdaa2('0x35')]);attachment['create']({'name':path[_0xdaa2('0x36')](_0x332076['filename'])[_0xdaa2('0x23')],'basename':path[_0xdaa2('0x36')](_0x332076[_0xdaa2('0x2d')])[_0xdaa2('0x23')]+_0xdaa2('0x37'),'type':_0xdaa2('0x38')})['then'](function(_0x4f820b){faxAccount[_0xdaa2('0x39')](_0x1f36ba,{'from':_0x332076[_0xdaa2('0x33')],'mapKey':_0xdaa2('0x4'),'body':path['parse'](_0x332076[_0xdaa2('0x2d')])['name']+_0xdaa2('0x37'),'AttachmentId':_0x4f820b['id']})[_0xdaa2('0x3a')](function(_0xb7d60f){logger['error'](_0x332076[_0xdaa2('0x21')],_0xdaa2('0x3b'),JSON[_0xdaa2('0x3c')](_0xb7d60f));});})['catch'](function(_0x3f10fa){logger[_0xdaa2('0x3d')](_0x332076[_0xdaa2('0x21')],'\x20receiveFax\x20',JSON[_0xdaa2('0x3c')](_0x3f10fa));});});}logger[_0xdaa2('0x25')](_0x332076[_0xdaa2('0x21')],_0xdaa2('0x3e'));}};Fax['prototype'][_0xdaa2('0x19')]=function(_0x1966ad){if(this[_0xdaa2('0xc')][_0x1966ad[_0xdaa2('0x21')]]){_[_0xdaa2('0x3f')](this['channels'][_0x1966ad[_0xdaa2('0x21')]],_[_0xdaa2('0x40')](_0x1966ad,['response',_0xdaa2('0x41')]));}};function updateStatus(_0x37d992){if(_0x37d992[_0xdaa2('0x42')]){faxMessage['update'](_0x37d992[_0xdaa2('0x42')],{'failMessage':_0xdaa2('0x43')})['then'](function(_0x290610){ut[_0xdaa2('0x44')](_0xdaa2('0x45'),_0x290610);})[_0xdaa2('0x3a')](function(_0x423e32){ut[_0xdaa2('0x44')](_0xdaa2('0x46'),_0x423e32);});}else{ut[_0xdaa2('0x44')](_0xdaa2('0x47'));}}Fax[_0xdaa2('0x1a')][_0xdaa2('0x48')]=function(_0x52d24d,_0x46e27c,_0x26f69b){var _0x211b10=this;var _0x4db97f={};if(_0x46e27c){_0x4db97f={'read':_0x46e27c};}else{_0x4db97f={'failMessage':_0x26f69b};}if(this['actions'][_0x52d24d][_0xdaa2('0x42')]){faxMessage['update'](this['actions'][_0x52d24d]['AttachmentId'],_0x4db97f)[_0xdaa2('0x49')](function(_0x239fb1){ut[_0xdaa2('0x44')](_0xdaa2('0x4a'),_0x239fb1);})['catch'](function(_0x5dd2ed){ut[_0xdaa2('0x44')]('[Fax][Message][NoUpdate1]',_0x5dd2ed);})[_0xdaa2('0x4b')](function(){delete _0x211b10[_0xdaa2('0x20')][_0x52d24d];delete _0x211b10[_0xdaa2('0xc')][_0x52d24d];});}else{ut[_0xdaa2('0x44')](_0xdaa2('0x4c'));delete this['channels'][_0x52d24d];delete this[_0xdaa2('0xc')][_0x52d24d];}};Fax[_0xdaa2('0x1a')][_0xdaa2('0x17')]=function(_0x2b5b74){var _0x1c48b7=this;if(this[_0xdaa2('0x20')][_0x2b5b74[_0xdaa2('0x21')]]){if(this[_0xdaa2('0xc')][_0x2b5b74[_0xdaa2('0x21')]]){this[_0xdaa2('0x20')][_0x2b5b74[_0xdaa2('0x21')]]['id']=this[_0xdaa2('0xc')][_0x2b5b74[_0xdaa2('0x21')]]['id'];this[_0xdaa2('0x20')][_0x2b5b74[_0xdaa2('0x21')]][_0xdaa2('0x23')]=this[_0xdaa2('0xc')][_0x2b5b74[_0xdaa2('0x21')]][_0xdaa2('0x23')];}logger[_0xdaa2('0x25')](_0x2b5b74[_0xdaa2('0x21')],this[_0xdaa2('0xc')][_0x2b5b74[_0xdaa2('0x21')]]?_0xdaa2('0x4d'):'\x20hangup\x20faxRiceive\x20',JSON[_0xdaa2('0x3c')](this[_0xdaa2('0x20')][_0x2b5b74[_0xdaa2('0x21')]]));if(this[_0xdaa2('0xc')][_0x2b5b74[_0xdaa2('0x21')]]){if(this[_0xdaa2('0x20')][_0x2b5b74[_0xdaa2('0x21')]]['faxpages']>0x0&&this[_0xdaa2('0x20')][_0x2b5b74[_0xdaa2('0x21')]][_0xdaa2('0x12')]===_0xdaa2('0x4e')){this[_0xdaa2('0x48')](_0x2b5b74['uniqueid'],!![]);}else{this[_0xdaa2('0x48')](_0x2b5b74[_0xdaa2('0x21')],![],this[_0xdaa2('0x20')][_0x2b5b74[_0xdaa2('0x21')]][_0xdaa2('0x4f')]?_0xdaa2('0x50')+this[_0xdaa2('0x20')][_0x2b5b74['uniqueid']][_0xdaa2('0x4f')]:'SENDING\x20FAILED');}}}};Fax['prototype'][_0xdaa2('0x51')]=function(_0x2428b3){var _0x45052e=this;return new BPromise(function(_0xa382fe,_0x4531a7){_0x45052e['execOriginate'](_0x2428b3,_0x45052e[_0xdaa2('0xa')][_0x2428b3[_0xdaa2('0x52')]])[_0xdaa2('0x49')](function(_0x457752){ut['logger']('[Fax][execOriginate][success]',_0x457752);_0xa382fe(ut['message'](_0xdaa2('0x53')));})[_0xdaa2('0x3a')](function(_0x296a3a){ut[_0xdaa2('0x44')](_0xdaa2('0x54'),_0x296a3a);updateStatus(_0x2428b3);_0x4531a7(ut[_0xdaa2('0x35')]('Fax\x20failed'));});});};Fax[_0xdaa2('0x1a')]['checkAfterSend']=function(_0x498a20){var _0x30b289=this;return new BPromise(function(_0x3f33ff,_0x46ba1c){var _0x26321d=_0x30b289[_0xdaa2('0x55')](_0x30b289[_0xdaa2('0xa')][_0x498a20[_0xdaa2('0x52')]][_0xdaa2('0x56')],_0x498a20);if(_0x26321d[_0xdaa2('0x57')]){_0x3f33ff(ut[_0xdaa2('0x35')](_0xdaa2('0x58')));}else{_0x46ba1c(ut['message'](_0x26321d[_0xdaa2('0x35')]));}});};function originate(_0x59bb12,_0xfa2648,_0x2fa64b){return new BPromise(function(_0x22a8cb,_0x52e245){if(_0x2fa64b){var _0x51c5be=util[_0xdaa2('0x59')]('gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit',path[_0xdaa2('0x36')](_0x59bb12[_0xdaa2('0x1')])[_0xdaa2('0x23')],_0x59bb12[_0xdaa2('0x1')]);gs[_0xdaa2('0x5a')](_0x51c5be)[_0xdaa2('0x49')](function(){_0x59bb12['path']=util[_0xdaa2('0x59')]('%s/%s.tif',path[_0xdaa2('0x36')](_0x59bb12['path'])['dir'],path['parse'](_0x59bb12['path'])[_0xdaa2('0x23')]);_0xfa2648[_0xdaa2('0x5b')]=_0x59bb12['path'];ut['logger'](_0xdaa2('0x5c'),'');ami[_0xdaa2('0x5d')](ut[_0xdaa2('0x5e')](_0x59bb12,_0xfa2648))['then'](function(_0x37fbcb){_0x22a8cb(_0x37fbcb);})['catch'](function(_0x4f19fe){_0x52e245(_0x4f19fe);});})['catch'](function(_0x543957){_0x52e245(_0x543957);});}else{ami[_0xdaa2('0x5d')](ut['variablesAction'](_0x59bb12,_0xfa2648))[_0xdaa2('0x49')](function(_0x15da90){_0x22a8cb(_0x15da90);})[_0xdaa2('0x3a')](function(_0x43aac7){_0x52e245(_0x43aac7);});}});}Fax[_0xdaa2('0x1a')][_0xdaa2('0x5f')]=function(_0x4a08e9,_0x37de8a){var _0x47b18f=this;return new BPromise(function(_0x17900f,_0x2df84e){var _0xf9089e=uuid['v4']();var _0x186ab8=ut[_0xdaa2('0x60')](_0x4a08e9,_0x37de8a);_0x47b18f[_0xdaa2('0xc')][_0xf9089e]=new Action(_0xf9089e,_0x37de8a,_0x4a08e9);var _0x480efe=_0x47b18f[_0xdaa2('0xc')][_0xf9089e];if(path[_0xdaa2('0x36')](_0x4a08e9[_0xdaa2('0x1')])[_0xdaa2('0x61')]===_0xdaa2('0x37')){originate(_0x480efe,_0x186ab8,!![])[_0xdaa2('0x49')](function(_0x361f0a){_0x17900f(_0x361f0a);})['catch'](function(_0x3725b1){_0x2df84e(_0x3725b1);});}else{originate(_0x480efe,_0x186ab8,![])['then'](function(_0x2309d7){_0x17900f(_0x2309d7);})[_0xdaa2('0x3a')](function(_0xab2b13){_0x2df84e(_0xab2b13);});}});};Fax['prototype'][_0xdaa2('0x62')]=function(_0x239b56){return!_[_0xdaa2('0x63')](_0x239b56)&&!_[_0xdaa2('0x63')](_0x239b56['name'])&&!_[_0xdaa2('0x63')](_0x239b56[_0xdaa2('0x64')])&&_0x239b56[_0xdaa2('0x64')]&&!_[_0xdaa2('0x63')](this['trunks'][util[_0xdaa2('0x59')]('SIP/%s',_0x239b56[_0xdaa2('0x23')])])&&!_['isNil'](this[_0xdaa2('0xb')][util[_0xdaa2('0x59')](_0xdaa2('0x65'),_0x239b56[_0xdaa2('0x23')])][_0xdaa2('0x2c')])&&(this[_0xdaa2('0xb')][util[_0xdaa2('0x59')]('SIP/%s',_0x239b56[_0xdaa2('0x23')])][_0xdaa2('0x2c')]===_0xdaa2('0x66')||this['trunks'][util[_0xdaa2('0x59')](_0xdaa2('0x65'),_0x239b56['name'])][_0xdaa2('0x2c')]==='unmonitored');};Fax[_0xdaa2('0x1a')]['checkTrunk']=function(_0x41502d,_0x30277e){if(!this[_0xdaa2('0x62')](_0x41502d)){ut[_0xdaa2('0x44')](_0xdaa2('0x67'),_['isNil'](_0x41502d)?'':_0x41502d['name']+_0xdaa2('0x68'));return{'isValid':![],'message':_0xdaa2('0x69')};}if(_[_0xdaa2('0x63')](_0x30277e[_0xdaa2('0x4')])){ut[_0xdaa2('0x44')](_0xdaa2('0x6a'),JSON['stringify'](_0x30277e));return{'isValid':![],'message':_0xdaa2('0x6b')};}if(_['isNil'](_0x30277e[_0xdaa2('0x1')])){ut[_0xdaa2('0x44')](_0xdaa2('0x6c'),JSON[_0xdaa2('0x3c')](_0x30277e));return{'isValid':![],'message':_0xdaa2('0x6d')};}return{'isValid':!![],'message':_0xdaa2('0x6e')};};module[_0xdaa2('0x6f')]=Fax; \ No newline at end of file +var _0xb5da=['originateresponse','context','from-voip-provider','hasOwnProperty','exten','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','prototype','variable','value','channelstate','channelstatedesc','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','\x20result\x20conversion\x20file\x20','message','create','parse','.pdf','application/pdf','then','notify','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','syncOriginateResponse','response','reason','update','AttachmentId','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','[Fax][Message][NoUpdate2]','\x20hangup\x20faxRiceive\x20','faxpages','SUCCESS','updateStatus','faxstatusstring','SENDING\x20FAILED','send','execOriginate','FaxAccountId','[Fax][execOriginate][success]','Fax\x20received','Trunk','isValid','Trunk\x20Reachable','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','variablesAction','addVariables','isTrunkReachable','isNil','active','SIP/%s','unmonitored','checkTrunk','[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Is\x20Valid','exports','lodash','bluebird','uuid','moment','path','tiff2pdf','./util/gs','../../../config/logger','fax','../ami','./rpcDb','./channel','./util/util','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','syncVarSet','newstate','syncNewState','newexten','syncNewExten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','syncHangup'];(function(_0x3cc961,_0x18ebf6){var _0x3bd6de=function(_0x425ad9){while(--_0x425ad9){_0x3cc961['push'](_0x3cc961['shift']());}};_0x3bd6de(++_0x18ebf6);}(_0xb5da,0x14c));var _0xab5d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb5da[_0x20a584];return _0x4b41a8;};'use strict';var util=require('util');var _=require(_0xab5d('0x0'));var BPromise=require(_0xab5d('0x1'));var uuid=require(_0xab5d('0x2'));var moment=require(_0xab5d('0x3'));var path=require(_0xab5d('0x4'));var tiff2pdf=require(_0xab5d('0x5'));var gs=require(_0xab5d('0x6'));var logger=require(_0xab5d('0x7'))(_0xab5d('0x8'));var ami=require(_0xab5d('0x9'));var rpcDb=require(_0xab5d('0xa'));var Channel=require(_0xab5d('0xb'));var ut=require(_0xab5d('0xc'));var Action=require(_0xab5d('0xd'));var faxAccount=require(_0xab5d('0xe'));var attachment=require(_0xab5d('0xf'));var faxMessage=require(_0xab5d('0x10'));function Fax(_0x4d7400){this[_0xab5d('0x11')]={};this['faxAccounts']=_0x4d7400[_0xab5d('0x12')];this['trunks']=_0x4d7400[_0xab5d('0x13')];this[_0xab5d('0x14')]={};ami['on'](_0xab5d('0x15'),this[_0xab5d('0x16')][_0xab5d('0x17')](this));ami['on']('varset',this[_0xab5d('0x18')]['bind'](this));ami['on'](_0xab5d('0x19'),this[_0xab5d('0x1a')]['bind'](this));ami['on'](_0xab5d('0x1b'),this[_0xab5d('0x1c')][_0xab5d('0x17')](this));ami['on'](_0xab5d('0x1d'),this[_0xab5d('0x1e')][_0xab5d('0x17')](this));ami['on'](_0xab5d('0x1f'),this[_0xab5d('0x20')][_0xab5d('0x17')](this));ami['on']('hangup',this[_0xab5d('0x21')][_0xab5d('0x17')](this));ami['on'](_0xab5d('0x22'),this['syncOriginateResponse'][_0xab5d('0x17')](this));}Fax['prototype']['syncNewchannel']=function(_0x18155e){if(_0x18155e[_0xab5d('0x23')]===_0xab5d('0x24')){for(var _0x5d60de in this[_0xab5d('0x12')]){if(this[_0xab5d('0x12')][_0xab5d('0x25')](_0x5d60de)){if(_0x18155e[_0xab5d('0x26')]===this['faxAccounts'][_0x5d60de][_0xab5d('0x27')]){this[_0xab5d('0x11')][_0x18155e[_0xab5d('0x28')]]={};this[_0xab5d('0x11')][_0x18155e['uniqueid']][_0xab5d('0x29')]=_0x18155e[_0xab5d('0x29')];this[_0xab5d('0x11')][_0x18155e[_0xab5d('0x28')]]['id']=this[_0xab5d('0x12')][_0x5d60de]['id'];this[_0xab5d('0x11')][_0x18155e[_0xab5d('0x28')]][_0xab5d('0x2a')]=this[_0xab5d('0x12')][_0x5d60de][_0xab5d('0x2a')];logger[_0xab5d('0x2b')](_0x18155e[_0xab5d('0x28')],_0xab5d('0x2c'));}}}}if(this[_0xab5d('0x14')][_0x18155e[_0xab5d('0x28')]]){this[_0xab5d('0x11')][_0x18155e[_0xab5d('0x28')]]={};this[_0xab5d('0x11')][_0x18155e[_0xab5d('0x28')]][_0xab5d('0x29')]=_0x18155e[_0xab5d('0x29')];logger[_0xab5d('0x2b')](_0x18155e[_0xab5d('0x28')],_0xab5d('0x2c'));}};Fax[_0xab5d('0x2d')][_0xab5d('0x18')]=function(_0x41f21d){if(this[_0xab5d('0x11')][_0x41f21d['uniqueid']]){for(var _0x214a9b in _0x41f21d['variable']){if(_0x41f21d[_0xab5d('0x2e')]['hasOwnProperty'](_0x214a9b)){this['channels'][_0x41f21d[_0xab5d('0x28')]][_0x214a9b]=_0x41f21d[_0xab5d('0x2f')];}}}};Fax[_0xab5d('0x2d')][_0xab5d('0x1a')]=function(_0x2bb3a8){if(this[_0xab5d('0x11')][_0x2bb3a8[_0xab5d('0x28')]]){this[_0xab5d('0x11')][_0x2bb3a8[_0xab5d('0x28')]][_0xab5d('0x30')]=_0x2bb3a8[_0xab5d('0x30')];this[_0xab5d('0x11')][_0x2bb3a8['uniqueid']][_0xab5d('0x31')]=_0x2bb3a8[_0xab5d('0x31')];}};Fax[_0xab5d('0x2d')][_0xab5d('0x1c')]=function(_0x32fe0a){if(this[_0xab5d('0x11')][_0x32fe0a['uniqueid']]){for(var _0x5df76d in _0x32fe0a[_0xab5d('0x2e')]){if(_0x32fe0a[_0xab5d('0x2e')]['hasOwnProperty'](_0x5df76d)){this[_0xab5d('0x11')][_0x32fe0a[_0xab5d('0x28')]][_0x5df76d]=_0x32fe0a[_0xab5d('0x2f')];}}}};Fax[_0xab5d('0x2d')][_0xab5d('0x1e')]=function(_0x5e1b80){if(this[_0xab5d('0x11')][_0x5e1b80['uniqueid']]){this['channels'][_0x5e1b80[_0xab5d('0x28')]][_0xab5d('0x32')]=_0x5e1b80[_0xab5d('0x32')];this[_0xab5d('0x11')][_0x5e1b80[_0xab5d('0x28')]]['status']=_0x5e1b80[_0xab5d('0x33')];this['channels'][_0x5e1b80[_0xab5d('0x28')]]['localstationid']=_0x5e1b80[_0xab5d('0x27')];this[_0xab5d('0x11')][_0x5e1b80[_0xab5d('0x28')]][_0xab5d('0x34')]=_0x5e1b80[_0xab5d('0x34')];logger[_0xab5d('0x2b')](_0x5e1b80[_0xab5d('0x28')],_0xab5d('0x35'));}};Fax['prototype'][_0xab5d('0x20')]=function(_0x1d066b){var _0x828d21=this;if(this[_0xab5d('0x11')][_0x1d066b['uniqueid']]){var _0x2adaae=this[_0xab5d('0x11')][_0x1d066b[_0xab5d('0x28')]]['id'];this[_0xab5d('0x11')][_0x1d066b[_0xab5d('0x28')]][_0xab5d('0x36')]=_0x1d066b['remotestationid'];this[_0xab5d('0x11')][_0x1d066b['uniqueid']][_0xab5d('0x37')]=_0x1d066b['pagestransferred'];this['channels'][_0x1d066b[_0xab5d('0x28')]][_0xab5d('0x27')]=_0x1d066b['localstationid'];this[_0xab5d('0x11')][_0x1d066b[_0xab5d('0x28')]]['resolution']=_0x1d066b[_0xab5d('0x38')];this['channels'][_0x1d066b[_0xab5d('0x28')]]['transferrate']=_0x1d066b[_0xab5d('0x39')];this['channels'][_0x1d066b[_0xab5d('0x28')]][_0xab5d('0x34')]=_0x1d066b[_0xab5d('0x34')];this[_0xab5d('0x11')][_0x1d066b['uniqueid']][_0xab5d('0x3a')]=_0x1d066b['calleridnum'];if(this[_0xab5d('0x11')][_0x1d066b[_0xab5d('0x28')]][_0xab5d('0x37')]>0x0){tiff2pdf(_0x1d066b[_0xab5d('0x34')],'/var/opt/motion2/server/files/attachments/',function(_0x4672c4){logger['info'](_0x1d066b[_0xab5d('0x28')],_0xab5d('0x3b'),_0x4672c4[_0xab5d('0x3c')]);attachment[_0xab5d('0x3d')]({'name':path['parse'](_0x1d066b[_0xab5d('0x34')])[_0xab5d('0x2a')],'basename':path[_0xab5d('0x3e')](_0x1d066b[_0xab5d('0x34')])[_0xab5d('0x2a')]+_0xab5d('0x3f'),'type':_0xab5d('0x40')})[_0xab5d('0x41')](function(_0x528329){faxAccount[_0xab5d('0x42')](_0x2adaae,{'from':_0x1d066b['calleridnum'],'mapKey':_0xab5d('0x8'),'body':path[_0xab5d('0x3e')](_0x1d066b[_0xab5d('0x34')])[_0xab5d('0x2a')]+_0xab5d('0x3f'),'AttachmentId':_0x528329['id']})[_0xab5d('0x43')](function(_0x17c126){logger[_0xab5d('0x44')](_0x1d066b[_0xab5d('0x28')],_0xab5d('0x45'),JSON[_0xab5d('0x46')](_0x17c126));});})['catch'](function(_0x5648fc){logger[_0xab5d('0x44')](_0x1d066b[_0xab5d('0x28')],_0xab5d('0x47'),JSON[_0xab5d('0x46')](_0x5648fc));});});}logger[_0xab5d('0x2b')](_0x1d066b['uniqueid'],_0xab5d('0x47'));}};Fax[_0xab5d('0x2d')][_0xab5d('0x48')]=function(_0x2c21ca){if(this[_0xab5d('0x14')][_0x2c21ca[_0xab5d('0x28')]]){_['merge'](this[_0xab5d('0x11')][_0x2c21ca[_0xab5d('0x28')]],_['pick'](_0x2c21ca,[_0xab5d('0x49'),_0xab5d('0x4a')]));}};function updateStatus(_0x1b7a45){if(_0x1b7a45['AttachmentId']){faxMessage[_0xab5d('0x4b')](_0x1b7a45[_0xab5d('0x4c')],{'failMessage':_0xab5d('0x4d')})[_0xab5d('0x41')](function(_0x265850){ut[_0xab5d('0x4e')](_0xab5d('0x4f'),_0x265850);})[_0xab5d('0x43')](function(_0x4af34f){ut[_0xab5d('0x4e')](_0xab5d('0x50'),_0x4af34f);});}else{ut[_0xab5d('0x4e')](_0xab5d('0x51'));}}Fax['prototype']['updateStatus']=function(_0x346a0c,_0x15df3f,_0x3e345c){var _0x28553b=this;var _0x18ccc2={};if(_0x15df3f){_0x18ccc2={'read':_0x15df3f};}else{_0x18ccc2={'failMessage':_0x3e345c};}if(this[_0xab5d('0x14')][_0x346a0c][_0xab5d('0x4c')]){faxMessage[_0xab5d('0x4b')](this[_0xab5d('0x14')][_0x346a0c][_0xab5d('0x4c')],_0x18ccc2)[_0xab5d('0x41')](function(_0x3b1e58){ut[_0xab5d('0x4e')](_0xab5d('0x52'),_0x3b1e58);})[_0xab5d('0x43')](function(_0xa0c240){ut[_0xab5d('0x4e')](_0xab5d('0x53'),_0xa0c240);})['finally'](function(){delete _0x28553b[_0xab5d('0x11')][_0x346a0c];delete _0x28553b[_0xab5d('0x14')][_0x346a0c];});}else{ut['logger'](_0xab5d('0x54'));delete this[_0xab5d('0x11')][_0x346a0c];delete this['actions'][_0x346a0c];}};Fax['prototype']['syncHangup']=function(_0x432ce4){var _0x394d7c=this;if(this['channels'][_0x432ce4[_0xab5d('0x28')]]){if(this['actions'][_0x432ce4[_0xab5d('0x28')]]){this[_0xab5d('0x11')][_0x432ce4[_0xab5d('0x28')]]['id']=this['actions'][_0x432ce4[_0xab5d('0x28')]]['id'];this[_0xab5d('0x11')][_0x432ce4[_0xab5d('0x28')]][_0xab5d('0x2a')]=this[_0xab5d('0x14')][_0x432ce4[_0xab5d('0x28')]][_0xab5d('0x2a')];}logger['info'](_0x432ce4[_0xab5d('0x28')],this['actions'][_0x432ce4[_0xab5d('0x28')]]?'\x20hangup\x20sendFile\x20':_0xab5d('0x55'),JSON[_0xab5d('0x46')](this[_0xab5d('0x11')][_0x432ce4[_0xab5d('0x28')]]));if(this[_0xab5d('0x14')][_0x432ce4[_0xab5d('0x28')]]){if(this[_0xab5d('0x11')][_0x432ce4[_0xab5d('0x28')]][_0xab5d('0x56')]>0x0&&this[_0xab5d('0x11')][_0x432ce4['uniqueid']][_0xab5d('0x1d')]===_0xab5d('0x57')){this[_0xab5d('0x58')](_0x432ce4[_0xab5d('0x28')],!![]);}else{this['updateStatus'](_0x432ce4[_0xab5d('0x28')],![],this[_0xab5d('0x11')][_0x432ce4['uniqueid']][_0xab5d('0x59')]?'SENDING\x20FAILED:\x20'+this['channels'][_0x432ce4[_0xab5d('0x28')]][_0xab5d('0x59')]:_0xab5d('0x5a'));}}}};Fax['prototype'][_0xab5d('0x5b')]=function(_0x45a75e){var _0x2608bf=this;return new BPromise(function(_0x2e2236,_0x5d4226){_0x2608bf[_0xab5d('0x5c')](_0x45a75e,_0x2608bf['faxAccounts'][_0x45a75e[_0xab5d('0x5d')]])[_0xab5d('0x41')](function(_0x395c2f){ut[_0xab5d('0x4e')](_0xab5d('0x5e'),_0x395c2f);_0x2e2236(ut[_0xab5d('0x3c')](_0xab5d('0x5f')));})[_0xab5d('0x43')](function(_0x8f139f){ut[_0xab5d('0x4e')]('[Fax][execOriginate][failure]',_0x8f139f);updateStatus(_0x45a75e);_0x5d4226(ut[_0xab5d('0x3c')]('Fax\x20failed'));});});};Fax['prototype']['checkAfterSend']=function(_0xb73bb4){var _0x642d6b=this;return new BPromise(function(_0x2a0c5d,_0x9ac782){var _0x1c1165=_0x642d6b['checkTrunk'](_0x642d6b['faxAccounts'][_0xb73bb4[_0xab5d('0x5d')]][_0xab5d('0x60')],_0xb73bb4);if(_0x1c1165[_0xab5d('0x61')]){_0x2a0c5d(ut[_0xab5d('0x3c')](_0xab5d('0x62')));}else{_0x9ac782(ut[_0xab5d('0x3c')](_0x1c1165[_0xab5d('0x3c')]));}});};function originate(_0x293ace,_0x3ce86c,_0x425d0d){return new BPromise(function(_0x4ee55a,_0x4feee5){if(_0x425d0d){var _0x10eb09=util[_0xab5d('0x63')](_0xab5d('0x64'),path[_0xab5d('0x3e')](_0x293ace[_0xab5d('0x4')])[_0xab5d('0x2a')],_0x293ace[_0xab5d('0x4')]);gs[_0xab5d('0x65')](_0x10eb09)['then'](function(){_0x293ace['path']=util[_0xab5d('0x63')](_0xab5d('0x66'),path[_0xab5d('0x3e')](_0x293ace[_0xab5d('0x4')])[_0xab5d('0x67')],path[_0xab5d('0x3e')](_0x293ace['path'])[_0xab5d('0x2a')]);_0x3ce86c[_0xab5d('0x68')]=_0x293ace[_0xab5d('0x4')];ut['logger'](_0xab5d('0x69'),'');ami['Action'](ut[_0xab5d('0x6a')](_0x293ace,_0x3ce86c))[_0xab5d('0x41')](function(_0x4e4549){_0x4ee55a(_0x4e4549);})['catch'](function(_0x243dbc){_0x4feee5(_0x243dbc);});})[_0xab5d('0x43')](function(_0x199c34){_0x4feee5(_0x199c34);});}else{ami['Action'](ut[_0xab5d('0x6a')](_0x293ace,_0x3ce86c))['then'](function(_0x4ddf2d){_0x4ee55a(_0x4ddf2d);})['catch'](function(_0xf4c75d){_0x4feee5(_0xf4c75d);});}});}Fax[_0xab5d('0x2d')][_0xab5d('0x5c')]=function(_0x51e7a0,_0x5decc9){var _0x435797=this;return new BPromise(function(_0x5c2415,_0x58017c){var _0x164f0a=uuid['v4']();var _0x3aa7d9=ut[_0xab5d('0x6b')](_0x51e7a0,_0x5decc9);_0x435797[_0xab5d('0x14')][_0x164f0a]=new Action(_0x164f0a,_0x5decc9,_0x51e7a0);var _0x3b8d72=_0x435797[_0xab5d('0x14')][_0x164f0a];if(path[_0xab5d('0x3e')](_0x51e7a0[_0xab5d('0x4')])['ext']==='.pdf'){originate(_0x3b8d72,_0x3aa7d9,!![])[_0xab5d('0x41')](function(_0x1b351e){_0x5c2415(_0x1b351e);})[_0xab5d('0x43')](function(_0x10528a){_0x58017c(_0x10528a);});}else{originate(_0x3b8d72,_0x3aa7d9,![])[_0xab5d('0x41')](function(_0x486cc2){_0x5c2415(_0x486cc2);})['catch'](function(_0x31609b){_0x58017c(_0x31609b);});}});};Fax['prototype'][_0xab5d('0x6c')]=function(_0x429f8d){return!_[_0xab5d('0x6d')](_0x429f8d)&&!_[_0xab5d('0x6d')](_0x429f8d[_0xab5d('0x2a')])&&!_[_0xab5d('0x6d')](_0x429f8d[_0xab5d('0x6e')])&&_0x429f8d[_0xab5d('0x6e')]&&!_[_0xab5d('0x6d')](this['trunks'][util[_0xab5d('0x63')](_0xab5d('0x6f'),_0x429f8d[_0xab5d('0x2a')])])&&!_[_0xab5d('0x6d')](this[_0xab5d('0x13')][util[_0xab5d('0x63')]('SIP/%s',_0x429f8d[_0xab5d('0x2a')])][_0xab5d('0x33')])&&(this['trunks'][util[_0xab5d('0x63')](_0xab5d('0x6f'),_0x429f8d[_0xab5d('0x2a')])][_0xab5d('0x33')]==='reachable'||this[_0xab5d('0x13')][util[_0xab5d('0x63')](_0xab5d('0x6f'),_0x429f8d[_0xab5d('0x2a')])][_0xab5d('0x33')]===_0xab5d('0x70'));};Fax['prototype'][_0xab5d('0x71')]=function(_0x3a9213,_0x262fc6){if(!this[_0xab5d('0x6c')](_0x3a9213)){ut[_0xab5d('0x4e')](_0xab5d('0x72'),_[_0xab5d('0x6d')](_0x3a9213)?'':_0x3a9213[_0xab5d('0x2a')]+_0xab5d('0x73'));return{'isValid':![],'message':_0xab5d('0x74')};}if(_[_0xab5d('0x6d')](_0x262fc6[_0xab5d('0x8')])){ut[_0xab5d('0x4e')](_0xab5d('0x75'),JSON[_0xab5d('0x46')](_0x262fc6));return{'isValid':![],'message':_0xab5d('0x76')};}if(_[_0xab5d('0x6d')](_0x262fc6[_0xab5d('0x4')])){ut[_0xab5d('0x4e')](_0xab5d('0x77'),JSON[_0xab5d('0x46')](_0x262fc6));return{'isValid':![],'message':'Empty\x20path'};}return{'isValid':!![],'message':_0xab5d('0x78')};};module[_0xab5d('0x79')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index e30b309..7ca3823 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 _0xdb7c=['util','bluebird','../../../config/logger','preview','lodash','error','inspect','resolve','then','notify','catch','[Notify]\x20'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xdb7c,0xb4));var _0xcdb7=function(_0x403fc7,_0x32931a){_0x403fc7=_0x403fc7-0x0;var _0x5d0827=_0xdb7c[_0x403fc7];return _0x5d0827;};'use strict';var util=require(_0xcdb7('0x0'));var BPromise=require(_0xcdb7('0x1'));var logger=require(_0xcdb7('0x2'))(_0xcdb7('0x3'));var _=require(_0xcdb7('0x4'));var faxAccount=require('../rpc/faxAccount');function loggerCatch(_0x5d68eb){return function(_0x40e70d){logger[_0xcdb7('0x5')](_0x5d68eb,util[_0xcdb7('0x6')](_0x40e70d,{'showHidden':![],'depth':null}));};}exports['notify']=function(_0x157adb,_0x5c974e){return BPromise[_0xcdb7('0x7')]()[_0xcdb7('0x8')](faxAccount[_0xcdb7('0x9')](_0x157adb,_0x5c974e))[_0xcdb7('0xa')](loggerCatch(_0xcdb7('0xb')));}; \ No newline at end of file +var _0x3726=['lodash','../rpc/faxAccount','error','inspect','notify','then','[Notify]\x20','util','bluebird','../../../config/logger','preview'];(function(_0x266081,_0x234cde){var _0x5ddece=function(_0x485d78){while(--_0x485d78){_0x266081['push'](_0x266081['shift']());}};_0x5ddece(++_0x234cde);}(_0x3726,0x6a));var _0x6372=function(_0x3ac6a7,_0x39aca2){_0x3ac6a7=_0x3ac6a7-0x0;var _0x274542=_0x3726[_0x3ac6a7];return _0x274542;};'use strict';var util=require(_0x6372('0x0'));var BPromise=require(_0x6372('0x1'));var logger=require(_0x6372('0x2'))(_0x6372('0x3'));var _=require(_0x6372('0x4'));var faxAccount=require(_0x6372('0x5'));function loggerCatch(_0x362d8a){return function(_0x2e7b19){logger[_0x6372('0x6')](_0x362d8a,util[_0x6372('0x7')](_0x2e7b19,{'showHidden':![],'depth':null}));};}exports[_0x6372('0x8')]=function(_0x4ce9c9,_0x2f92c2){return BPromise['resolve']()[_0x6372('0x9')](faxAccount[_0x6372('0x8')](_0x4ce9c9,_0x2f92c2))['catch'](loggerCatch(_0x6372('0xa')));}; \ 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 dd61c21..a8979af 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 _0x2eff=['Exec\x20gs','\x20Error\x20:','inspect','util','fax','bluebird','exec','execute','info'];(function(_0x5f3f24,_0x44366c){var _0x3f7072=function(_0x3c13d2){while(--_0x3c13d2){_0x5f3f24['push'](_0x5f3f24['shift']());}};_0x3f7072(++_0x44366c);}(_0x2eff,0x1d7));var _0xf2ef=function(_0xc988e4,_0x4e3b13){_0xc988e4=_0xc988e4-0x0;var _0x2c9d58=_0x2eff[_0xc988e4];return _0x2c9d58;};'use strict';var util=require(_0xf2ef('0x0'));var logger=require('../../../../config/logger')(_0xf2ef('0x1'));var BPromise=require(_0xf2ef('0x2'));var exec=require('child_process')[_0xf2ef('0x3')];exports[_0xf2ef('0x4')]=function(_0x609692){return new BPromise(function(_0x282587,_0x1d7a83){exec(_0x609692,function(_0x1b46b0,_0x5b7f2d,_0x399838){logger[_0xf2ef('0x5')](_0xf2ef('0x6'),_0x5b7f2d);if(_0x1b46b0){logger[_0xf2ef('0x5')](_0xf2ef('0x6'),_0xf2ef('0x7'),util[_0xf2ef('0x8')](_0x1b46b0,{'showHidden':![],'depth':null}),_0x5b7f2d,_0x399838);_0x1d7a83(_0x1b46b0);}_0x282587(_0x5b7f2d);});});}; \ No newline at end of file +var _0xa0d0=['util','../../../../config/logger','fax','bluebird','child_process','exec','execute','Exec\x20gs','inspect'];(function(_0x553502,_0x4d2c0c){var _0x246c37=function(_0x36698a){while(--_0x36698a){_0x553502['push'](_0x553502['shift']());}};_0x246c37(++_0x4d2c0c);}(_0xa0d0,0x7e));var _0x0a0d=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0xa0d0[_0x1035c1];return _0x308d67;};'use strict';var util=require(_0x0a0d('0x0'));var logger=require(_0x0a0d('0x1'))(_0x0a0d('0x2'));var BPromise=require(_0x0a0d('0x3'));var exec=require(_0x0a0d('0x4'))[_0x0a0d('0x5')];exports[_0x0a0d('0x6')]=function(_0x5207be){return new BPromise(function(_0x15fa44,_0x4df9c6){exec(_0x5207be,function(_0xa64b98,_0xbf00a5,_0xe2dfa6){logger['info'](_0x0a0d('0x7'),_0xbf00a5);if(_0xa64b98){logger['info']('Exec\x20gs','\x20Error\x20:',util[_0x0a0d('0x8')](_0xa64b98,{'showHidden':![],'depth':null}),_0xbf00a5,_0xe2dfa6);_0x4df9c6(_0xa64b98);}_0x15fa44(_0xbf00a5);});});}; \ 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 3ee38a4..37b0f42 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 _0x1d21=['inspect','ecm','headerinfo','minrate','maxrate','format','modem','gateway','faxdetect','localstationid','path','variablesAction','originate','channel','xcally-motion-fax','\x22%s\x22\x20<%s>','lodash','moment','../../../../config/logger','fax','message','info'];(function(_0x32b542,_0x4512fa){var _0x554d54=function(_0x35cdfc){while(--_0x35cdfc){_0x32b542['push'](_0x32b542['shift']());}};_0x554d54(++_0x4512fa);}(_0x1d21,0xaa));var _0x11d2=function(_0xae282f,_0x2d9368){_0xae282f=_0xae282f-0x0;var _0x5f46d4=_0x1d21[_0xae282f];return _0x5f46d4;};'use strict';var util=require('util');var _=require(_0x11d2('0x0'));var moment=require(_0x11d2('0x1'));var logger=require(_0x11d2('0x2'))(_0x11d2('0x3'));exports[_0x11d2('0x4')]=function(_0x23fedf){return{'message':_0x23fedf};};exports['logger']=function(_0x427df5,_0x17b79e){logger[_0x11d2('0x5')](_0x427df5,util[_0x11d2('0x6')](_0x17b79e,{'showHidden':![],'depth':null}));};exports['addVariables']=function(_0x5045d7,_0x551dea){var _0x35fc37={'XMF-ECM':_0x551dea[_0x11d2('0x7')],'XMF-HEADERINFO':_0x551dea[_0x11d2('0x8')],'XMF-MINRATE':_0x551dea[_0x11d2('0x9')],'XMF-MAXRATE':_0x551dea[_0x11d2('0xa')],'XMF-MODEM':util[_0x11d2('0xb')]('\x22%s\x22',_0x551dea[_0x11d2('0xc')]),'XMF-GATEWAY':_0x551dea[_0x11d2('0xd')],'XMF-FAXDETECT':_0x551dea[_0x11d2('0xe')],'XMF-T38TIMEOUT':_0x551dea['t38timeout'],'XMF-LOCALSTATIONID':_0x551dea[_0x11d2('0xf')],'XMF-PATH':_0x5045d7[_0x11d2('0x10')]};return _0x35fc37;};exports[_0x11d2('0x11')]=function(_0x3a11bf,_0x53d656){return{'actionid':_0x3a11bf['uniqueid'],'action':_0x11d2('0x12'),'channel':_0x3a11bf[_0x11d2('0x13')],'Exten':_0x11d2('0x14'),'Context':'from-sip','Priority':'1','callerid':util['format'](_0x11d2('0x15'),_0x3a11bf[_0x11d2('0x8')]?_0x3a11bf['headerinfo']:'',_0x3a11bf[_0x11d2('0xf')]),'variable':_0x53d656,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x3a11bf['uniqueid']};}; \ No newline at end of file +var _0x2d6a=['info','inspect','addVariables','ecm','headerinfo','maxrate','format','\x22%s\x22','faxdetect','localstationid','path','uniqueid','originate','channel','xcally-motion-fax','from-sip','\x22%s\x22\x20<%s>','util','lodash','moment','../../../../config/logger','fax','logger'];(function(_0x54d52,_0x2473ba){var _0x968345=function(_0x3fcd06){while(--_0x3fcd06){_0x54d52['push'](_0x54d52['shift']());}};_0x968345(++_0x2473ba);}(_0x2d6a,0x16a));var _0xa2d6=function(_0x2b3e14,_0x139329){_0x2b3e14=_0x2b3e14-0x0;var _0x2d0eda=_0x2d6a[_0x2b3e14];return _0x2d0eda;};'use strict';var util=require(_0xa2d6('0x0'));var _=require(_0xa2d6('0x1'));var moment=require(_0xa2d6('0x2'));var logger=require(_0xa2d6('0x3'))(_0xa2d6('0x4'));exports['message']=function(_0x21e703){return{'message':_0x21e703};};exports[_0xa2d6('0x5')]=function(_0x13d93d,_0xc802a1){logger[_0xa2d6('0x6')](_0x13d93d,util[_0xa2d6('0x7')](_0xc802a1,{'showHidden':![],'depth':null}));};exports[_0xa2d6('0x8')]=function(_0x1b1814,_0xa7725d){var _0x1d0a21={'XMF-ECM':_0xa7725d[_0xa2d6('0x9')],'XMF-HEADERINFO':_0xa7725d[_0xa2d6('0xa')],'XMF-MINRATE':_0xa7725d['minrate'],'XMF-MAXRATE':_0xa7725d[_0xa2d6('0xb')],'XMF-MODEM':util[_0xa2d6('0xc')](_0xa2d6('0xd'),_0xa7725d['modem']),'XMF-GATEWAY':_0xa7725d['gateway'],'XMF-FAXDETECT':_0xa7725d[_0xa2d6('0xe')],'XMF-T38TIMEOUT':_0xa7725d['t38timeout'],'XMF-LOCALSTATIONID':_0xa7725d[_0xa2d6('0xf')],'XMF-PATH':_0x1b1814[_0xa2d6('0x10')]};return _0x1d0a21;};exports['variablesAction']=function(_0xea4d8,_0xaf688b){return{'actionid':_0xea4d8[_0xa2d6('0x11')],'action':_0xa2d6('0x12'),'channel':_0xea4d8[_0xa2d6('0x13')],'Exten':_0xa2d6('0x14'),'Context':_0xa2d6('0x15'),'Priority':'1','callerid':util[_0xa2d6('0xc')](_0xa2d6('0x16'),_0xea4d8['headerinfo']?_0xea4d8[_0xa2d6('0xa')]:'',_0xea4d8[_0xa2d6('0xf')]),'variable':_0xaf688b,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0xea4d8[_0xa2d6('0x11')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index c128959..f921e08 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 _0x3dac=['getFaxAccounts','initFaxAccounts','getVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','catch','[index.js][initParams]','inspect','sync','[index.js][main]','util','./server','./realtime','./report','./acw','./trigger','./dialer','./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/campaign','./rpc/voiceExtension','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/dynamics365','../../config/logger','ami','get','hour','resolve','then','getAgents','getTelephones','initTelephones','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTemplates','initZendeskAccounts','getSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initCampaigns','getVoiceExtensions','initVoiceExtensions'];(function(_0x532a08,_0x1079ab){var _0xd9c5ee=function(_0x1ce50c){while(--_0x1ce50c){_0x532a08['push'](_0x532a08['shift']());}};_0xd9c5ee(++_0x1079ab);}(_0x3dac,0x161));var _0xc3da=function(_0x1572af,_0x3591b1){_0x1572af=_0x1572af-0x0;var _0x26a867=_0x3dac[_0x1572af];return _0x26a867;};'use strict';var util=require(_0xc3da('0x0'));var moment=require('moment');var server=require(_0xc3da('0x1'));var Realtime=require(_0xc3da('0x2'));var Report=require(_0xc3da('0x3'));var Acw=require(_0xc3da('0x4'));var Trigger=require(_0xc3da('0x5'));var Dialer=require(_0xc3da('0x6'));var Preview=require(_0xc3da('0x7'));var Fax=require(_0xc3da('0x8'));var user=require(_0xc3da('0x9'));var voiceQueue=require(_0xc3da('0xa'));var voiceQueueReport=require(_0xc3da('0xb'));var voiceCallReport=require(_0xc3da('0xc'));var trunk=require('./rpc/trunk');var trigger=require('./rpc/trigger');var template=require('./rpc/template');var cmHopperHistory=require('./rpc/cmHopperHistory');var campaign=require(_0xc3da('0xd'));var voiceExtension=require(_0xc3da('0xe'));var faxAccount=require('./rpc/faxAccount');var zendesk=require(_0xc3da('0xf'));var salesforce=require(_0xc3da('0x10'));var sugarcrm=require(_0xc3da('0x11'));var freshdesk=require(_0xc3da('0x12'));var desk=require(_0xc3da('0x13'));var zoho=require(_0xc3da('0x14'));var vtiger=require(_0xc3da('0x15'));var freshsales=require(_0xc3da('0x16'));var servicenow=require('./rpc/integrations/servicenow');var dynamics365=require(_0xc3da('0x17'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require(_0xc3da('0x18'))(_0xc3da('0x19'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0xc3da('0x1a')](_0xc3da('0x1b'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0xc3da('0x1a')](_0xc3da('0x1b'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return Promise[_0xc3da('0x1c')]()[_0xc3da('0x1d')](user[_0xc3da('0x1e')]())[_0xc3da('0x1d')](realtime['initAgents']())[_0xc3da('0x1d')](user[_0xc3da('0x1f')]())[_0xc3da('0x1d')](realtime[_0xc3da('0x20')]())[_0xc3da('0x1d')](trunk['getTrunks']())[_0xc3da('0x1d')](realtime[_0xc3da('0x21')]())[_0xc3da('0x1d')](voiceQueue[_0xc3da('0x22')]())[_0xc3da('0x1d')](realtime[_0xc3da('0x23')]())[_0xc3da('0x1d')](trigger[_0xc3da('0x24')]())[_0xc3da('0x1d')](realtime['initTriggers']())[_0xc3da('0x1d')](template['getTemplates']())['then'](realtime[_0xc3da('0x25')]())[_0xc3da('0x1d')](zendesk['getZendeskAccounts']())[_0xc3da('0x1d')](realtime[_0xc3da('0x26')]())[_0xc3da('0x1d')](salesforce[_0xc3da('0x27')]())[_0xc3da('0x1d')](realtime['initSalesforceAccounts']())[_0xc3da('0x1d')](sugarcrm[_0xc3da('0x28')]())[_0xc3da('0x1d')](realtime[_0xc3da('0x29')]())[_0xc3da('0x1d')](freshdesk[_0xc3da('0x2a')]())[_0xc3da('0x1d')](realtime[_0xc3da('0x2b')]())[_0xc3da('0x1d')](desk[_0xc3da('0x2c')]())[_0xc3da('0x1d')](realtime[_0xc3da('0x2d')]())[_0xc3da('0x1d')](zoho['getZohoAccounts']())[_0xc3da('0x1d')](realtime['initZohoAccounts']())['then'](vtiger[_0xc3da('0x2e')]())[_0xc3da('0x1d')](realtime[_0xc3da('0x2f')]())['then'](freshsales[_0xc3da('0x30')]())[_0xc3da('0x1d')](realtime['initFreshsalesAccounts']())[_0xc3da('0x1d')](servicenow[_0xc3da('0x31')]())['then'](realtime[_0xc3da('0x32')]())[_0xc3da('0x1d')](dynamics365[_0xc3da('0x33')]())[_0xc3da('0x1d')](realtime['initDynamics365Accounts']())[_0xc3da('0x1d')](campaign['getCampaigns']())[_0xc3da('0x1d')](realtime[_0xc3da('0x34')]())[_0xc3da('0x1d')](voiceExtension[_0xc3da('0x35')]())['then'](realtime[_0xc3da('0x36')]())['then'](faxAccount[_0xc3da('0x37')]())['then'](realtime[_0xc3da('0x38')]())[_0xc3da('0x1d')](function(){return realtime;});}function initParams(){return Promise[_0xc3da('0x1c')]()[_0xc3da('0x1d')](voiceQueueReport[_0xc3da('0x39')]())[_0xc3da('0x1d')](realtime['initVoiceQueueReports']())['then'](cmHopperHistory[_0xc3da('0x3a')]())[_0xc3da('0x1d')](realtime[_0xc3da('0x3b')]())[_0xc3da('0x1d')](cmHopperHistory[_0xc3da('0x3c')]())[_0xc3da('0x1d')](realtime[_0xc3da('0x3d')]())[_0xc3da('0x1d')](voiceCallReport[_0xc3da('0x3e')]())[_0xc3da('0x1d')](realtime['initVoiceCallReports']())[_0xc3da('0x3f')](function(_0x8b9c7){logger['error'](_0xc3da('0x40'),util[_0xc3da('0x41')](_0x8b9c7,{'showHidden':![],'depth':null}));});}function main(){return server['listen'](realtime,preview,fax)[_0xc3da('0x1d')](function(){return initRealtime();})[_0xc3da('0x1d')](function(){return initParams();})[_0xc3da('0x1d')](function(){report[_0xc3da('0x42')]();setInterval(initRealtime,0x1388);})[_0xc3da('0x3f')](function(_0x41efce){logger['error'](_0xc3da('0x43'),util['inspect'](_0x41efce,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file +var _0x05f1=['initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initZendeskAccounts','getSalesforceAccounts','getSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','[index.js][initParams]','inspect','listen','sync','error','[index.js][main]','util','moment','./server','./realtime','./trigger','./dialer','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','../../config/logger','get','hour','resolve','getAgents','then','initAgents','initTelephones','getTrunks'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x05f1,0xb4));var _0x105f=function(_0x4a53d,_0x58a95e){_0x4a53d=_0x4a53d-0x0;var _0x27410e=_0x05f1[_0x4a53d];return _0x27410e;};'use strict';var util=require(_0x105f('0x0'));var moment=require(_0x105f('0x1'));var server=require(_0x105f('0x2'));var Realtime=require(_0x105f('0x3'));var Report=require('./report');var Acw=require('./acw');var Trigger=require(_0x105f('0x4'));var Dialer=require(_0x105f('0x5'));var Preview=require('./preview');var Fax=require('./fax');var user=require(_0x105f('0x6'));var voiceQueue=require(_0x105f('0x7'));var voiceQueueReport=require(_0x105f('0x8'));var voiceCallReport=require('./rpc/voiceCallReport');var trunk=require(_0x105f('0x9'));var trigger=require(_0x105f('0xa'));var template=require(_0x105f('0xb'));var cmHopperHistory=require(_0x105f('0xc'));var campaign=require(_0x105f('0xd'));var voiceExtension=require(_0x105f('0xe'));var faxAccount=require('./rpc/faxAccount');var zendesk=require(_0x105f('0xf'));var salesforce=require(_0x105f('0x10'));var sugarcrm=require(_0x105f('0x11'));var freshdesk=require(_0x105f('0x12'));var desk=require('./rpc/integrations/desk');var zoho=require(_0x105f('0x13'));var vtiger=require(_0x105f('0x14'));var freshsales=require(_0x105f('0x15'));var servicenow=require(_0x105f('0x16'));var dynamics365=require(_0x105f('0x17'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require(_0x105f('0x18'))('ami');var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x105f('0x19')](_0x105f('0x1a'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x105f('0x19')](_0x105f('0x1a'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return Promise[_0x105f('0x1b')]()['then'](user[_0x105f('0x1c')]())[_0x105f('0x1d')](realtime[_0x105f('0x1e')]())['then'](user['getTelephones']())[_0x105f('0x1d')](realtime[_0x105f('0x1f')]())[_0x105f('0x1d')](trunk[_0x105f('0x20')]())['then'](realtime[_0x105f('0x21')]())[_0x105f('0x1d')](voiceQueue[_0x105f('0x22')]())[_0x105f('0x1d')](realtime[_0x105f('0x23')]())[_0x105f('0x1d')](trigger[_0x105f('0x24')]())[_0x105f('0x1d')](realtime['initTriggers']())[_0x105f('0x1d')](template['getTemplates']())[_0x105f('0x1d')](realtime['initTemplates']())[_0x105f('0x1d')](zendesk['getZendeskAccounts']())[_0x105f('0x1d')](realtime[_0x105f('0x25')]())[_0x105f('0x1d')](salesforce[_0x105f('0x26')]())['then'](realtime['initSalesforceAccounts']())['then'](sugarcrm[_0x105f('0x27')]())[_0x105f('0x1d')](realtime['initSugarcrmAccounts']())[_0x105f('0x1d')](freshdesk[_0x105f('0x28')]())[_0x105f('0x1d')](realtime[_0x105f('0x29')]())[_0x105f('0x1d')](desk[_0x105f('0x2a')]())['then'](realtime['initDeskAccounts']())[_0x105f('0x1d')](zoho[_0x105f('0x2b')]())['then'](realtime[_0x105f('0x2c')]())[_0x105f('0x1d')](vtiger[_0x105f('0x2d')]())[_0x105f('0x1d')](realtime[_0x105f('0x2e')]())[_0x105f('0x1d')](freshsales[_0x105f('0x2f')]())[_0x105f('0x1d')](realtime['initFreshsalesAccounts']())[_0x105f('0x1d')](servicenow[_0x105f('0x30')]())['then'](realtime[_0x105f('0x31')]())[_0x105f('0x1d')](dynamics365[_0x105f('0x32')]())[_0x105f('0x1d')](realtime[_0x105f('0x33')]())[_0x105f('0x1d')](campaign[_0x105f('0x34')]())['then'](realtime[_0x105f('0x35')]())['then'](voiceExtension[_0x105f('0x36')]())[_0x105f('0x1d')](realtime[_0x105f('0x37')]())[_0x105f('0x1d')](faxAccount[_0x105f('0x38')]())[_0x105f('0x1d')](realtime[_0x105f('0x39')]())[_0x105f('0x1d')](function(){return realtime;});}function initParams(){return Promise[_0x105f('0x1b')]()[_0x105f('0x1d')](voiceQueueReport[_0x105f('0x3a')]())[_0x105f('0x1d')](realtime[_0x105f('0x3b')]())[_0x105f('0x1d')](cmHopperHistory['getVoiceQueueHopperHistory']())[_0x105f('0x1d')](realtime['initVoiceQueueHopperHistory']())[_0x105f('0x1d')](cmHopperHistory[_0x105f('0x3c')]())[_0x105f('0x1d')](realtime[_0x105f('0x3d')]())['then'](voiceCallReport[_0x105f('0x3e')]())[_0x105f('0x1d')](realtime[_0x105f('0x3f')]())[_0x105f('0x40')](function(_0x55f6f8){logger['error'](_0x105f('0x41'),util[_0x105f('0x42')](_0x55f6f8,{'showHidden':![],'depth':null}));});}function main(){return server[_0x105f('0x43')](realtime,preview,fax)['then'](function(){return initRealtime();})[_0x105f('0x1d')](function(){return initParams();})['then'](function(){report[_0x105f('0x44')]();setInterval(initRealtime,0x1388);})['catch'](function(_0x143311){logger[_0x105f('0x45')](_0x105f('0x46'),util[_0x105f('0x42')](_0x143311,{'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 b9b3826..f1ae0c7 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 _0x24ca=['state','stateTime','status','unknown','address','phone','mobile','interface','online','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','local','prototype','updateStatusRealtime','not_inuse','idle','voiceStatus','statePause','format','onhold','user:%s','emit','user:ami:update','user:presence','exports','lodash','moment','ioredis','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','email','accountcode','fullname'];(function(_0x421ec4,_0x3cae81){var _0x3cab77=function(_0x12ee94){while(--_0x12ee94){_0x421ec4['push'](_0x421ec4['shift']());}};_0x3cab77(++_0x3cae81);}(_0x24ca,0x1bc));var _0xa24c=function(_0x15bc81,_0x4d4f77){_0x15bc81=_0x15bc81-0x0;var _0x59440e=_0x24ca[_0x15bc81];return _0x59440e;};'use strict';var _=require(_0xa24c('0x0'));var util=require('util');var moment=require(_0xa24c('0x1'));var Redis=require(_0xa24c('0x2'));var config=require(_0xa24c('0x3'));config['redis']=_[_0xa24c('0x4')](config[_0xa24c('0x5')],{'host':_0xa24c('0x6'),'port':0x18eb});var io=require(_0xa24c('0x7'))(new Redis(config[_0xa24c('0x5')]));function Agent(_0x15a5cd){this['id']=_0x15a5cd['id']||0x0;this[_0xa24c('0x8')]=_0x15a5cd[_0xa24c('0x8')]||'';this[_0xa24c('0x9')]=_0x15a5cd[_0xa24c('0x9')]||'';this[_0xa24c('0xa')]=_0x15a5cd['accountcode']||'';this[_0xa24c('0xb')]=_0x15a5cd[_0xa24c('0xb')]||'';this[_0xa24c('0xc')]='unknown';this[_0xa24c('0xd')]=0x0;this[_0xa24c('0xe')]=_0xa24c('0xf');this[_0xa24c('0x10')]='';this[_0xa24c('0x11')]='';this[_0xa24c('0x12')]='';this[_0xa24c('0x13')]='';this[_0xa24c('0x14')]=_0x15a5cd[_0xa24c('0x14')]||![];this['voiceStatus']=_0xa24c('0xf');this[_0xa24c('0x15')]=0x0;this[_0xa24c('0x16')]='';this[_0xa24c('0x17')]='';this['onhold']=![];this[_0xa24c('0x18')]=![];}Agent[_0xa24c('0x19')][_0xa24c('0x1a')]=function(_0x2fcd8b){if(!_0x2fcd8b[_0xa24c('0xc')]){return;}var _0x2d185c=null;var _0x448275=_0x2fcd8b['state']['toLowerCase']();switch(_0x448275){case _0xa24c('0x1b'):_0x448275=_0xa24c('0x1c');break;case'inuse':_0x448275='talking';break;}if(this[_0xa24c('0x1d')]!==_0x448275||_0x2fcd8b[_0xa24c('0x1e')]){_0x2d185c=_['toNumber'](moment()[_0xa24c('0x1f')]('x'));}var _0x5de3e6={'id':this['id'],'name':this[_0xa24c('0x8')],'email':this[_0xa24c('0x9')],'accountcode':this[_0xa24c('0xa')],'fullname':this[_0xa24c('0xb')],'state':this['state'],'stateTime':this[_0xa24c('0xd')],'status':this[_0xa24c('0xe')],'address':this[_0xa24c('0x10')],'voiceStatus':_0x448275||this['voiceStatus'],'voiceStatusTime':_0x2d185c||this['voiceStatusTime'],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this['voiceStatusQueue'],'interface':this[_0xa24c('0x13')],'onhold':this[_0xa24c('0x20')]};if(this[_0xa24c('0x1d')]!==_0x448275){this[_0xa24c('0x1d')]=_0x448275;io['to'](util['format'](_0xa24c('0x21'),_0x5de3e6['name']))[_0xa24c('0x22')](_0xa24c('0x23'),_0x5de3e6);io['emit'](_0xa24c('0x24'),_0x5de3e6);}};module[_0xa24c('0x25')]=Agent; \ No newline at end of file +var _0x6aa7=['redis','localhost','socket.io-emitter','name','email','accountcode','fullname','state','stateTime','status','unknown','address','phone','mobile','interface','online','voiceStatus','voiceStatusTime','voiceStatusQueue','onhold','local','prototype','updateStatusRealtime','toLowerCase','idle','talking','statePause','toNumber','format','voiceStatusCallerIdNumber','emit','user:ami:update','user:presence','exports','lodash','moment','ioredis','../../../config/environment'];(function(_0x2a8b2c,_0x4a7d7c){var _0x1a108b=function(_0x2ce91d){while(--_0x2ce91d){_0x2a8b2c['push'](_0x2a8b2c['shift']());}};_0x1a108b(++_0x4a7d7c);}(_0x6aa7,0x178));var _0x76aa=function(_0x50acac,_0x23aa9a){_0x50acac=_0x50acac-0x0;var _0x5725ce=_0x6aa7[_0x50acac];return _0x5725ce;};'use strict';var _=require(_0x76aa('0x0'));var util=require('util');var moment=require(_0x76aa('0x1'));var Redis=require(_0x76aa('0x2'));var config=require(_0x76aa('0x3'));config[_0x76aa('0x4')]=_['defaults'](config[_0x76aa('0x4')],{'host':_0x76aa('0x5'),'port':0x18eb});var io=require(_0x76aa('0x6'))(new Redis(config['redis']));function Agent(_0x588e62){this['id']=_0x588e62['id']||0x0;this[_0x76aa('0x7')]=_0x588e62['name']||'';this[_0x76aa('0x8')]=_0x588e62[_0x76aa('0x8')]||'';this[_0x76aa('0x9')]=_0x588e62['accountcode']||'';this[_0x76aa('0xa')]=_0x588e62[_0x76aa('0xa')]||'';this[_0x76aa('0xb')]='unknown';this[_0x76aa('0xc')]=0x0;this[_0x76aa('0xd')]=_0x76aa('0xe');this[_0x76aa('0xf')]='';this[_0x76aa('0x10')]='';this[_0x76aa('0x11')]='';this[_0x76aa('0x12')]='';this[_0x76aa('0x13')]=_0x588e62[_0x76aa('0x13')]||![];this[_0x76aa('0x14')]='unknown';this[_0x76aa('0x15')]=0x0;this['voiceStatusCallerIdNumber']='';this[_0x76aa('0x16')]='';this[_0x76aa('0x17')]=![];this[_0x76aa('0x18')]=![];}Agent[_0x76aa('0x19')][_0x76aa('0x1a')]=function(_0x4e309f){if(!_0x4e309f['state']){return;}var _0x2b3b4f=null;var _0x4cfc34=_0x4e309f[_0x76aa('0xb')][_0x76aa('0x1b')]();switch(_0x4cfc34){case'not_inuse':_0x4cfc34=_0x76aa('0x1c');break;case'inuse':_0x4cfc34=_0x76aa('0x1d');break;}if(this['voiceStatus']!==_0x4cfc34||_0x4e309f[_0x76aa('0x1e')]){_0x2b3b4f=_[_0x76aa('0x1f')](moment()[_0x76aa('0x20')]('x'));}var _0x21c16d={'id':this['id'],'name':this[_0x76aa('0x7')],'email':this[_0x76aa('0x8')],'accountcode':this['accountcode'],'fullname':this['fullname'],'state':this[_0x76aa('0xb')],'stateTime':this[_0x76aa('0xc')],'status':this[_0x76aa('0xd')],'address':this[_0x76aa('0xf')],'voiceStatus':_0x4cfc34||this[_0x76aa('0x14')],'voiceStatusTime':_0x2b3b4f||this[_0x76aa('0x15')],'voiceStatusCallerIdNumber':this[_0x76aa('0x21')],'voiceStatusQueue':this[_0x76aa('0x16')],'interface':this[_0x76aa('0x12')],'onhold':this['onhold']};if(this[_0x76aa('0x14')]!==_0x4cfc34){this[_0x76aa('0x14')]=_0x4cfc34;io['to'](util[_0x76aa('0x20')]('user:%s',_0x21c16d[_0x76aa('0x7')]))[_0x76aa('0x22')](_0x76aa('0x23'),_0x21c16d);io[_0x76aa('0x22')](_0x76aa('0x24'),_0x21c16d);}};module[_0x76aa('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 d6733f6..80c597a 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 _0xd88a=['message','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','temp','ivrTotalCallsDays'];(function(_0x2911f5,_0x237d41){var _0x108843=function(_0x513785){while(--_0x513785){_0x2911f5['push'](_0x2911f5['shift']());}};_0x108843(++_0x237d41);}(_0xd88a,0x14b));var _0xad88=function(_0x31b11d,_0x5d7fa9){_0x31b11d=_0x31b11d-0x0;var _0x1c1668=_0xd88a[_0x31b11d];return _0x1c1668;};'use strict';function Campaign(_0xf3cf62){this['id']=_0xf3cf62['id']||0x0;this[_0xad88('0x0')]=_0xf3cf62[_0xad88('0x0')]||'';this['type']=_0xf3cf62[_0xad88('0x1')]||_0xad88('0x2');this['originated']=0x0;this[_0xad88('0x3')]=0x0;this['ivrAnswerCallsDay']=0x0;this[_0xad88('0x4')]=0x0;this[_0xad88('0x5')]='';this['sendMessageOneNotActive']=!![];this[_0xad88('0x6')]=_0xf3cf62[_0xad88('0x6')];this[_0xad88('0x7')]=_0xf3cf62[_0xad88('0x7')];this[_0xad88('0x8')]=_0xf3cf62[_0xad88('0x8')]||null;this[_0xad88('0x9')]=_0xf3cf62[_0xad88('0x9')]?_0xf3cf62[_0xad88('0x9')]:null;this['dialOriginateCallerIdName']=_0xf3cf62['dialOriginateCallerIdName'];this[_0xad88('0xa')]=_0xf3cf62[_0xad88('0xa')];this[_0xad88('0xb')]=_0xf3cf62[_0xad88('0xb')]||0x1e;this[_0xad88('0xc')]=_0xf3cf62[_0xad88('0xc')];this[_0xad88('0xd')]=_0xf3cf62[_0xad88('0xd')];this[_0xad88('0xe')]=_0xf3cf62['dialBusyMaxRetry'];this[_0xad88('0xf')]=_0xf3cf62[_0xad88('0xf')];this[_0xad88('0x10')]=_0xf3cf62['dialNoAnswerMaxRetry'];this[_0xad88('0x11')]=_0xf3cf62[_0xad88('0x11')];this[_0xad88('0x12')]=_0xf3cf62[_0xad88('0x12')];this['dialNoSuchNumberMaxRetry']=_0xf3cf62[_0xad88('0x13')]||0x3;this[_0xad88('0x14')]=_0xf3cf62[_0xad88('0x14')]||0x96;this['dialDropMaxRetry']=_0xf3cf62[_0xad88('0x15')]||0x3;this[_0xad88('0x16')]=_0xf3cf62[_0xad88('0x16')]||0x96;this['dialAbandonedMaxRetry']=_0xf3cf62['dialAbandonedMaxRetry']||0x3;this[_0xad88('0x17')]=_0xf3cf62['dialAbandonedRetryFrequency']||0x96;this['dialMachineMaxRetry']=_0xf3cf62[_0xad88('0x18')]||0x3;this[_0xad88('0x19')]=_0xf3cf62[_0xad88('0x19')]||0x96;this['dialAgentRejectMaxRetry']=_0xf3cf62[_0xad88('0x1a')]||0x3;this[_0xad88('0x1b')]=_0xf3cf62[_0xad88('0x1b')]||0x96;this['dialOrderByScheduledAt']=_0xf3cf62[_0xad88('0x1c')]||_0xad88('0x1d');this[_0xad88('0x1e')]=_0xf3cf62['dialPrefix']||undefined;this[_0xad88('0x1f')]=_0xf3cf62['dialRandomLastDigitCallerIdNumber']||undefined;this[_0xad88('0x20')]=_0xf3cf62[_0xad88('0x20')]||undefined;this[_0xad88('0x21')]=_0xf3cf62[_0xad88('0x21')]?_0xf3cf62['TrunkBackup']:undefined;this[_0xad88('0x22')]=_0xf3cf62[_0xad88('0x22')]?_0xf3cf62[_0xad88('0x22')]:undefined;this[_0xad88('0x23')]=_0xf3cf62[_0xad88('0x23')]?_0xf3cf62['Interval']:undefined;this[_0xad88('0x24')]=_0xf3cf62[_0xad88('0x24')]?_0xf3cf62[_0xad88('0x24')]:undefined;this[_0xad88('0x25')]=_0xf3cf62[_0xad88('0x24')]?_0xf3cf62['SquareProject']['name']:undefined;this['dialAMDActive']=_0xf3cf62['dialAMDActive']||![];this[_0xad88('0x26')]=_0xf3cf62[_0xad88('0x26')];this['dialAMDGreeting']=_0xf3cf62[_0xad88('0x27')];this[_0xad88('0x28')]=_0xf3cf62[_0xad88('0x28')];this[_0xad88('0x29')]=_0xf3cf62[_0xad88('0x29')];this[_0xad88('0x2a')]=_0xf3cf62[_0xad88('0x2a')];this[_0xad88('0x2b')]=_0xf3cf62[_0xad88('0x2b')];this[_0xad88('0x2c')]=_0xf3cf62[_0xad88('0x2c')];this[_0xad88('0x2d')]=_0xf3cf62[_0xad88('0x2d')];this[_0xad88('0x2e')]=_0xf3cf62['dialAMDMaximumWordLength'];}module[_0xad88('0x2f')]=Campaign; \ No newline at end of file +var _0x3d01=['dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','name','type','campaign','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateTimeout','dialCongestionMaxRetry'];(function(_0xc7b78b,_0x1f852e){var _0x4b5e17=function(_0x2383a2){while(--_0x2383a2){_0xc7b78b['push'](_0xc7b78b['shift']());}};_0x4b5e17(++_0x1f852e);}(_0x3d01,0x1a1));var _0x13d0=function(_0x20a137,_0x4d9549){_0x20a137=_0x20a137-0x0;var _0x3dc414=_0x3d01[_0x20a137];return _0x3dc414;};'use strict';function Campaign(_0x349419){this['id']=_0x349419['id']||0x0;this[_0x13d0('0x0')]=_0x349419['name']||'';this[_0x13d0('0x1')]=_0x349419[_0x13d0('0x1')]||_0x13d0('0x2');this['originated']=0x0;this[_0x13d0('0x3')]=0x0;this[_0x13d0('0x4')]=0x0;this[_0x13d0('0x5')]=0x0;this[_0x13d0('0x6')]='';this[_0x13d0('0x7')]=!![];this['active']=_0x349419[_0x13d0('0x8')];this[_0x13d0('0x9')]=_0x349419[_0x13d0('0x9')];this[_0x13d0('0xa')]=_0x349419[_0x13d0('0xa')]||null;this[_0x13d0('0xb')]=_0x349419[_0x13d0('0xb')]?_0x349419[_0x13d0('0xb')]:null;this[_0x13d0('0xc')]=_0x349419[_0x13d0('0xc')];this['dialOriginateCallerIdNumber']=_0x349419['dialOriginateCallerIdNumber'];this['dialOriginateTimeout']=_0x349419[_0x13d0('0xd')]||0x1e;this[_0x13d0('0xe')]=_0x349419[_0x13d0('0xe')];this[_0x13d0('0xf')]=_0x349419[_0x13d0('0xf')];this[_0x13d0('0x10')]=_0x349419[_0x13d0('0x10')];this[_0x13d0('0x11')]=_0x349419[_0x13d0('0x11')];this[_0x13d0('0x12')]=_0x349419[_0x13d0('0x12')];this[_0x13d0('0x13')]=_0x349419[_0x13d0('0x13')];this[_0x13d0('0x14')]=_0x349419['dialGlobalMaxRetry'];this['dialNoSuchNumberMaxRetry']=_0x349419[_0x13d0('0x15')]||0x3;this[_0x13d0('0x16')]=_0x349419['dialNoSuchNumberRetryFrequency']||0x96;this['dialDropMaxRetry']=_0x349419[_0x13d0('0x17')]||0x3;this[_0x13d0('0x18')]=_0x349419[_0x13d0('0x18')]||0x96;this['dialAbandonedMaxRetry']=_0x349419['dialAbandonedMaxRetry']||0x3;this['dialAbandonedRetryFrequency']=_0x349419[_0x13d0('0x19')]||0x96;this[_0x13d0('0x1a')]=_0x349419[_0x13d0('0x1a')]||0x3;this[_0x13d0('0x1b')]=_0x349419[_0x13d0('0x1b')]||0x96;this[_0x13d0('0x1c')]=_0x349419[_0x13d0('0x1c')]||0x3;this[_0x13d0('0x1d')]=_0x349419[_0x13d0('0x1d')]||0x96;this[_0x13d0('0x1e')]=_0x349419[_0x13d0('0x1e')]||'DESC';this[_0x13d0('0x1f')]=_0x349419[_0x13d0('0x1f')]||undefined;this[_0x13d0('0x20')]=_0x349419[_0x13d0('0x20')]||undefined;this[_0x13d0('0x21')]=_0x349419[_0x13d0('0x21')]||undefined;this[_0x13d0('0x22')]=_0x349419[_0x13d0('0x22')]?_0x349419[_0x13d0('0x22')]:undefined;this[_0x13d0('0x23')]=_0x349419[_0x13d0('0x23')]?_0x349419[_0x13d0('0x23')]:undefined;this['Interval']=_0x349419['Interval']?_0x349419[_0x13d0('0x24')]:undefined;this[_0x13d0('0x25')]=_0x349419[_0x13d0('0x25')]?_0x349419[_0x13d0('0x25')]:undefined;this[_0x13d0('0x26')]=_0x349419[_0x13d0('0x25')]?_0x349419[_0x13d0('0x25')][_0x13d0('0x0')]:undefined;this['dialAMDActive']=_0x349419['dialAMDActive']||![];this[_0x13d0('0x27')]=_0x349419['dialAMDInitialSilence'];this[_0x13d0('0x28')]=_0x349419[_0x13d0('0x28')];this['dialAMDAfterGreetingSilence']=_0x349419[_0x13d0('0x29')];this['dialAMDTotalAnalysisTime']=_0x349419[_0x13d0('0x2a')];this[_0x13d0('0x2b')]=_0x349419[_0x13d0('0x2b')];this['dialAMDBetweenWordsSilence']=_0x349419[_0x13d0('0x2c')];this[_0x13d0('0x2d')]=_0x349419[_0x13d0('0x2d')];this[_0x13d0('0x2e')]=_0x349419[_0x13d0('0x2e')];this[_0x13d0('0x2f')]=_0x349419[_0x13d0('0x2f')];}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 2651da0..9ec2151 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 _0xa693=['exports','starttime','channel','destinationchannel','calleridnum','calleridname','connectedlinenum','uniqueid','linkedid','exten','answered','answertime','endtime','unmanaged','lastapplication','lastdata','type','disposition','monitor','monitorFilename','queue','monitors','transferconnectedlinenum','transferType'];(function(_0x55daf2,_0x1b48de){var _0x1c8500=function(_0x4686b5){while(--_0x4686b5){_0x55daf2['push'](_0x55daf2['shift']());}};_0x1c8500(++_0x1b48de);}(_0xa693,0xf1));var _0x3a69=function(_0x52f1e6,_0xf70489){_0x52f1e6=_0x52f1e6-0x0;var _0x21f104=_0xa693[_0x52f1e6];return _0x21f104;};'use strict';function Channel(){this[_0x3a69('0x0')]=null;this[_0x3a69('0x1')]='';this[_0x3a69('0x2')]='';this[_0x3a69('0x3')]=0x0;this[_0x3a69('0x4')]='';this[_0x3a69('0x5')]=undefined;this['connectedlinename']=undefined;this['accountcode']=0x0;this['context']='';this[_0x3a69('0x6')]=0x0;this[_0x3a69('0x7')]=0x0;this[_0x3a69('0x8')]=0x0;this[_0x3a69('0x9')]=![];this[_0x3a69('0xa')]=null;this[_0x3a69('0xb')]=null;this[_0x3a69('0xc')]=![];this['abandoned']=![];this[_0x3a69('0xd')]='';this[_0x3a69('0xe')]='';this['duration']=0x0;this['billableseconds']=0x0;this['holdtime']=0x0;this[_0x3a69('0xf')]=null;this['tag']=null;this[_0x3a69('0x10')]=null;this[_0x3a69('0x11')]=![];this[_0x3a69('0x12')]=null;this[_0x3a69('0x13')]=null;this[_0x3a69('0x14')]=[];this['transfercalleridnum']=undefined;this[_0x3a69('0x15')]=undefined;this[_0x3a69('0x16')]=undefined;this['mohtime']=0x0;}module[_0x3a69('0x17')]=Channel; \ No newline at end of file +var _0x9123=['lastapplication','duration','billableseconds','holdtime','type','disposition','monitor','queue','monitors','transfercalleridnum','transferconnectedlinenum','transferType','starttime','calleridname','connectedlinename','accountcode','context','uniqueid','exten','answered','unmanaged','abandoned'];(function(_0x4ae77e,_0x2da9ed){var _0x33616b=function(_0x536b7a){while(--_0x536b7a){_0x4ae77e['push'](_0x4ae77e['shift']());}};_0x33616b(++_0x2da9ed);}(_0x9123,0x140));var _0x3912=function(_0xf8d789,_0x54e791){_0xf8d789=_0xf8d789-0x0;var _0xcf0c80=_0x9123[_0xf8d789];return _0xcf0c80;};'use strict';function Channel(){this[_0x3912('0x0')]=null;this['channel']='';this['destinationchannel']='';this['calleridnum']=0x0;this[_0x3912('0x1')]='';this['connectedlinenum']=undefined;this[_0x3912('0x2')]=undefined;this[_0x3912('0x3')]=0x0;this[_0x3912('0x4')]='';this[_0x3912('0x5')]=0x0;this['linkedid']=0x0;this[_0x3912('0x6')]=0x0;this[_0x3912('0x7')]=![];this['answertime']=null;this['endtime']=null;this[_0x3912('0x8')]=![];this[_0x3912('0x9')]=![];this[_0x3912('0xa')]='';this['lastdata']='';this[_0x3912('0xb')]=0x0;this[_0x3912('0xc')]=0x0;this[_0x3912('0xd')]=0x0;this[_0x3912('0xe')]=null;this['tag']=null;this[_0x3912('0xf')]=null;this[_0x3912('0x10')]=![];this['monitorFilename']=null;this[_0x3912('0x11')]=null;this[_0x3912('0x12')]=[];this[_0x3912('0x13')]=undefined;this[_0x3912('0x14')]=undefined;this[_0x3912('0x15')]=undefined;this['mohtime']=0x0;}module['exports']=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index c25c063..23108bb 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 _0xbfc0=['type','serverUrl','Configurations','name','username','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret'];(function(_0x15c972,_0x13a7d4){var _0x2b6451=function(_0x2d62e5){while(--_0x2d62e5){_0x15c972['push'](_0x15c972['shift']());}};_0x2b6451(++_0x13a7d4);}(_0xbfc0,0x1cb));var _0x0bfc=function(_0x25e109,_0x6ab24c){_0x25e109=_0x25e109-0x0;var _0xc0f7d6=_0xbfc0[_0x25e109];return _0xc0f7d6;};'use strict';function DeskAccount(_0x131d68){this['id']=_0x131d68['id']||0x0;this['name']=_0x131d68[_0x0bfc('0x0')]||'';this['username']=_0x131d68[_0x0bfc('0x1')]||'';this[_0x0bfc('0x2')]=_0x131d68['remoteUri']||'';this[_0x0bfc('0x3')]=_0x131d68[_0x0bfc('0x3')]||'';this[_0x0bfc('0x4')]=_0x131d68[_0x0bfc('0x4')]||'';this[_0x0bfc('0x5')]=_0x131d68['consumerKey']||'';this[_0x0bfc('0x6')]=_0x131d68[_0x0bfc('0x6')]||'';this['token']=_0x131d68[_0x0bfc('0x7')]||'';this[_0x0bfc('0x8')]=_0x131d68['tokenSecret']||'';this[_0x0bfc('0x9')]=_0x131d68['type']||'';this[_0x0bfc('0xa')]=_0x131d68[_0x0bfc('0xa')]||'';this[_0x0bfc('0xb')]=_0x131d68['Configurations']||{};}module['exports']=DeskAccount; \ No newline at end of file +var _0xa833=['serverUrl','Configurations','username','remoteUri','password','consumerKey','consumerSecret','token','tokenSecret','type'];(function(_0xa1eb2e,_0x2f4b19){var _0x55f5ff=function(_0x312ff9){while(--_0x312ff9){_0xa1eb2e['push'](_0xa1eb2e['shift']());}};_0x55f5ff(++_0x2f4b19);}(_0xa833,0x156));var _0x3a83=function(_0x11db31,_0x526792){_0x11db31=_0x11db31-0x0;var _0x132511=_0xa833[_0x11db31];return _0x132511;};'use strict';function DeskAccount(_0xf48f88){this['id']=_0xf48f88['id']||0x0;this['name']=_0xf48f88['name']||'';this[_0x3a83('0x0')]=_0xf48f88[_0x3a83('0x0')]||'';this[_0x3a83('0x1')]=_0xf48f88[_0x3a83('0x1')]||'';this['authType']=_0xf48f88['authType']||'';this[_0x3a83('0x2')]=_0xf48f88[_0x3a83('0x2')]||'';this[_0x3a83('0x3')]=_0xf48f88[_0x3a83('0x3')]||'';this[_0x3a83('0x4')]=_0xf48f88[_0x3a83('0x4')]||'';this[_0x3a83('0x5')]=_0xf48f88[_0x3a83('0x5')]||'';this[_0x3a83('0x6')]=_0xf48f88[_0x3a83('0x6')]||'';this[_0x3a83('0x7')]=_0xf48f88[_0x3a83('0x7')]||'';this['serverUrl']=_0xf48f88[_0x3a83('0x8')]||'';this['Configurations']=_0xf48f88[_0x3a83('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 dbc8725..2498b73 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 _0x04f1=['name','username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl','modernAuthentication','Configurations','CloudProvider','exports'];(function(_0x5ae0bf,_0x395a8b){var _0x122f56=function(_0x2d8546){while(--_0x2d8546){_0x5ae0bf['push'](_0x5ae0bf['shift']());}};_0x122f56(++_0x395a8b);}(_0x04f1,0x1b0));var _0x104f=function(_0x1261b4,_0x898a27){_0x1261b4=_0x1261b4-0x0;var _0x37e8ce=_0x04f1[_0x1261b4];return _0x37e8ce;};'use strict';function Dynamics365Account(_0x3ccf95){this['id']=_0x3ccf95['id']||0x0;this[_0x104f('0x0')]=_0x3ccf95[_0x104f('0x0')]||'';this[_0x104f('0x1')]=_0x3ccf95[_0x104f('0x1')]||'';this[_0x104f('0x2')]=_0x3ccf95[_0x104f('0x2')]||'';this[_0x104f('0x3')]=_0x3ccf95[_0x104f('0x3')]||'';this['tenantId']=_0x3ccf95[_0x104f('0x4')]||'';this[_0x104f('0x5')]=_0x3ccf95['clientId']||'';this[_0x104f('0x6')]=_0x3ccf95['clientSecret']||{};this[_0x104f('0x7')]=_0x3ccf95[_0x104f('0x7')]||'';this[_0x104f('0x8')]=_0x3ccf95[_0x104f('0x8')]||![];this[_0x104f('0x9')]=_0x3ccf95['Configurations']||{};this[_0x104f('0xa')]=_0x3ccf95['CloudProvider']||{};}module[_0x104f('0xb')]=Dynamics365Account; \ No newline at end of file +var _0xa2f1=['username','password','remoteUri','tenantId','clientSecret','serverUrl','modernAuthentication','Configurations','CloudProvider','exports','name'];(function(_0x122bf1,_0x3da7c1){var _0x367fe4=function(_0x5d2ee4){while(--_0x5d2ee4){_0x122bf1['push'](_0x122bf1['shift']());}};_0x367fe4(++_0x3da7c1);}(_0xa2f1,0x1ac));var _0x1a2f=function(_0x13e8cb,_0x585332){_0x13e8cb=_0x13e8cb-0x0;var _0x4016a1=_0xa2f1[_0x13e8cb];return _0x4016a1;};'use strict';function Dynamics365Account(_0x5ddc82){this['id']=_0x5ddc82['id']||0x0;this['name']=_0x5ddc82[_0x1a2f('0x0')]||'';this[_0x1a2f('0x1')]=_0x5ddc82[_0x1a2f('0x1')]||'';this['password']=_0x5ddc82[_0x1a2f('0x2')]||'';this[_0x1a2f('0x3')]=_0x5ddc82['remoteUri']||'';this[_0x1a2f('0x4')]=_0x5ddc82['tenantId']||'';this['clientId']=_0x5ddc82['clientId']||'';this[_0x1a2f('0x5')]=_0x5ddc82[_0x1a2f('0x5')]||{};this['serverUrl']=_0x5ddc82[_0x1a2f('0x6')]||'';this[_0x1a2f('0x7')]=_0x5ddc82[_0x1a2f('0x7')]||![];this[_0x1a2f('0x8')]=_0x5ddc82[_0x1a2f('0x8')]||{};this[_0x1a2f('0x9')]=_0x5ddc82[_0x1a2f('0x9')]||{};}module[_0x1a2f('0xa')]=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index 290859a..a77fbe0 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 _0x218c=['modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','Trunk','ListId','key','exports','name','description','ecm','headerinfo','localstationid','minrate','maxrate'];(function(_0x2e6544,_0x168aef){var _0x8dceb5=function(_0x54d448){while(--_0x54d448){_0x2e6544['push'](_0x2e6544['shift']());}};_0x8dceb5(++_0x168aef);}(_0x218c,0x92));var _0xc218=function(_0x20edcb,_0x4d49a8){_0x20edcb=_0x20edcb-0x0;var _0x1ced78=_0x218c[_0x20edcb];return _0x1ced78;};'use strict';function FaxAccount(_0x382761){this['id']=_0x382761['id']||0x0;this['name']=_0x382761[_0xc218('0x0')]||'';this[_0xc218('0x1')]=_0x382761[_0xc218('0x1')];this[_0xc218('0x2')]=_0x382761[_0xc218('0x2')];this[_0xc218('0x3')]=_0x382761['headerinfo'];this[_0xc218('0x4')]=_0x382761[_0xc218('0x4')];this['minrate']=_0x382761[_0xc218('0x5')]||0x960;this[_0xc218('0x6')]=_0x382761[_0xc218('0x6')]||0x3840;this[_0xc218('0x7')]=_0x382761[_0xc218('0x7')]||_0xc218('0x8');this[_0xc218('0x9')]=_0x382761[_0xc218('0x9')]||'no';this[_0xc218('0xa')]=_0x382761[_0xc218('0xa')]||'no';this[_0xc218('0xb')]=_0x382761['t38timeout']||0x1388;this['tech']=_0x382761[_0xc218('0xc')]||'SIP';this['Trunk']=_0x382761['Trunk']?_0x382761[_0xc218('0xd')]:undefined;this[_0xc218('0xe')]=_0x382761[_0xc218('0xe')];this[_0xc218('0xf')]=_0x382761[_0xc218('0xf')];}module[_0xc218('0x10')]=FaxAccount; \ No newline at end of file +var _0x9cd1=['maxrate','modem','gateway','faxdetect','t38timeout','tech','Trunk','ListId','key','exports','name','description','ecm','headerinfo','localstationid','minrate'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x9cd1,0xaa));var _0x19cd=function(_0x3b7bc9,_0x30faed){_0x3b7bc9=_0x3b7bc9-0x0;var _0x457988=_0x9cd1[_0x3b7bc9];return _0x457988;};'use strict';function FaxAccount(_0x32bbcc){this['id']=_0x32bbcc['id']||0x0;this['name']=_0x32bbcc[_0x19cd('0x0')]||'';this['description']=_0x32bbcc[_0x19cd('0x1')];this[_0x19cd('0x2')]=_0x32bbcc[_0x19cd('0x2')];this[_0x19cd('0x3')]=_0x32bbcc[_0x19cd('0x3')];this[_0x19cd('0x4')]=_0x32bbcc['localstationid'];this[_0x19cd('0x5')]=_0x32bbcc['minrate']||0x960;this['maxrate']=_0x32bbcc[_0x19cd('0x6')]||0x3840;this[_0x19cd('0x7')]=_0x32bbcc[_0x19cd('0x7')]||'v17,v27,v29';this[_0x19cd('0x8')]=_0x32bbcc[_0x19cd('0x8')]||'no';this[_0x19cd('0x9')]=_0x32bbcc[_0x19cd('0x9')]||'no';this[_0x19cd('0xa')]=_0x32bbcc['t38timeout']||0x1388;this[_0x19cd('0xb')]=_0x32bbcc[_0x19cd('0xb')]||'SIP';this[_0x19cd('0xc')]=_0x32bbcc[_0x19cd('0xc')]?_0x32bbcc[_0x19cd('0xc')]:undefined;this[_0x19cd('0xd')]=_0x32bbcc[_0x19cd('0xd')];this[_0x19cd('0xe')]=_0x32bbcc[_0x19cd('0xe')];}module[_0x19cd('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 994957f..c92c6c0 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 _0x0e06=['Configurations','exports','name','username','apiKey','token','remoteUri','serverUrl'];(function(_0x30efb4,_0x2dfa9d){var _0x5461d1=function(_0x33ce56){while(--_0x33ce56){_0x30efb4['push'](_0x30efb4['shift']());}};_0x5461d1(++_0x2dfa9d);}(_0x0e06,0x11a));var _0x60e0=function(_0x55b25f,_0xad5c1a){_0x55b25f=_0x55b25f-0x0;var _0xbb8f9d=_0x0e06[_0x55b25f];return _0xbb8f9d;};'use strict';function FreshdeskAccount(_0x34bf12){this['id']=_0x34bf12['id']||0x0;this['name']=_0x34bf12[_0x60e0('0x0')]||'';this[_0x60e0('0x1')]=_0x34bf12['username']||'';this[_0x60e0('0x2')]=_0x34bf12[_0x60e0('0x3')]||'';this['remoteUri']=_0x34bf12[_0x60e0('0x4')]||'';this[_0x60e0('0x5')]=_0x34bf12[_0x60e0('0x5')]||'';this[_0x60e0('0x6')]=_0x34bf12[_0x60e0('0x6')]||{};}module[_0x60e0('0x7')]=FreshdeskAccount; \ No newline at end of file +var _0x952a=['serverUrl','Configurations','exports','username','apiKey','token','remoteUri'];(function(_0x239494,_0x33dd6c){var _0x442774=function(_0x2311cd){while(--_0x2311cd){_0x239494['push'](_0x239494['shift']());}};_0x442774(++_0x33dd6c);}(_0x952a,0x13e));var _0xa952=function(_0xcd6714,_0x1770a3){_0xcd6714=_0xcd6714-0x0;var _0x109bd7=_0x952a[_0xcd6714];return _0x109bd7;};'use strict';function FreshdeskAccount(_0x3f6c1a){this['id']=_0x3f6c1a['id']||0x0;this['name']=_0x3f6c1a['name']||'';this[_0xa952('0x0')]=_0x3f6c1a[_0xa952('0x0')]||'';this[_0xa952('0x1')]=_0x3f6c1a[_0xa952('0x2')]||'';this[_0xa952('0x3')]=_0x3f6c1a[_0xa952('0x3')]||'';this['serverUrl']=_0x3f6c1a[_0xa952('0x4')]||'';this[_0xa952('0x5')]=_0x3f6c1a[_0xa952('0x5')]||{};}module[_0xa952('0x6')]=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshsalesAccount.js b/server/services/ami/model/freshsalesAccount.js index 29ab07d..b49342c 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 _0x4250=['apiKey','token','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x510b98,_0x4c4cbb){var _0x45e775=function(_0x29ec11){while(--_0x29ec11){_0x510b98['push'](_0x510b98['shift']());}};_0x45e775(++_0x4c4cbb);}(_0x4250,0x146));var _0x0425=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0x4250[_0x37bd26];return _0xe83dc4;};'use strict';function FreshsalesAccount(_0x5134b5){this['id']=_0x5134b5['id']||0x0;this[_0x0425('0x0')]=_0x5134b5[_0x0425('0x0')]||'';this[_0x0425('0x1')]=_0x5134b5['username']||'';this[_0x0425('0x2')]=_0x5134b5[_0x0425('0x3')]||'';this[_0x0425('0x4')]=_0x5134b5['remoteUri']||'';this[_0x0425('0x5')]=_0x5134b5[_0x0425('0x5')]||'';this[_0x0425('0x6')]=_0x5134b5[_0x0425('0x6')]||{};}module[_0x0425('0x7')]=FreshsalesAccount; \ No newline at end of file +var _0x3baf=['username','apiKey','token','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x15760a,_0x2dcd9a){var _0xf7d0f7=function(_0x3b4bb5){while(--_0x3b4bb5){_0x15760a['push'](_0x15760a['shift']());}};_0xf7d0f7(++_0x2dcd9a);}(_0x3baf,0xf7));var _0xf3ba=function(_0x46c584,_0x3b0b77){_0x46c584=_0x46c584-0x0;var _0xf55ebc=_0x3baf[_0x46c584];return _0xf55ebc;};'use strict';function FreshsalesAccount(_0x339d9f){this['id']=_0x339d9f['id']||0x0;this[_0xf3ba('0x0')]=_0x339d9f[_0xf3ba('0x0')]||'';this[_0xf3ba('0x1')]=_0x339d9f[_0xf3ba('0x1')]||'';this[_0xf3ba('0x2')]=_0x339d9f[_0xf3ba('0x3')]||'';this[_0xf3ba('0x4')]=_0x339d9f[_0xf3ba('0x4')]||'';this[_0xf3ba('0x5')]=_0x339d9f[_0xf3ba('0x5')]||'';this[_0xf3ba('0x6')]=_0x339d9f[_0xf3ba('0x6')]||{};}module[_0xf3ba('0x7')]=FreshsalesAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index be9bfe3..508dc43 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 _0xcd38=['voice','routealias','variables','exports','inbound','uniqueid','calleridnum','calleridname','queue','queuecallerleaveAt','queuecallerabandonAt','queuecallercomplete','queuecallerexit','queuecallerexitAt','originalposition','channel','connectedlinenum','connectedlinename','context','exten','priority','holdtime','assigned','lastAssignedTo'];(function(_0x249ee5,_0x26a0bd){var _0x2d520d=function(_0x94a08c){while(--_0x94a08c){_0x249ee5['push'](_0x249ee5['shift']());}};_0x2d520d(++_0x26a0bd);}(_0xcd38,0x124));var _0x8cd3=function(_0x8a56df,_0xb003fa){_0x8a56df=_0x8a56df-0x0;var _0x35e0a7=_0xcd38[_0x8a56df];return _0x35e0a7;};'use strict';function QueueReport(){this['type']=_0x8cd3('0x0');this[_0x8cd3('0x1')]='';this[_0x8cd3('0x2')]='';this[_0x8cd3('0x3')]='';this[_0x8cd3('0x4')]='';this['queuecallerjoinAt']=null;this[_0x8cd3('0x5')]=null;this['position']=0x1;this['count']=0x1;this['queuecallerabandon']=![];this[_0x8cd3('0x6')]=null;this[_0x8cd3('0x7')]=![];this['queuecallercompleteAt']=null;this[_0x8cd3('0x8')]=![];this[_0x8cd3('0x9')]=null;this[_0x8cd3('0xa')]=0x1;this[_0x8cd3('0xb')]='';this[_0x8cd3('0xc')]='';this[_0x8cd3('0xd')]='';this['accountcode']='';this[_0x8cd3('0xe')]='';this[_0x8cd3('0xf')]='';this[_0x8cd3('0x10')]='';this[_0x8cd3('0x11')]=0x0;this[_0x8cd3('0x12')]=![];this[_0x8cd3('0x13')]='';this['motionChannel']=_0x8cd3('0x14');this[_0x8cd3('0x15')]=null;this['mohtime']=0x0;this[_0x8cd3('0x16')]={};}module[_0x8cd3('0x17')]=QueueReport; \ No newline at end of file +var _0x45e8=['lastAssignedTo','motionChannel','voice','variables','exports','type','inbound','queue','queuecallerleaveAt','position','count','queuecallerabandon','queuecallercomplete','queuecallercompleteAt','originalposition','channel','connectedlinenum','connectedlinename','accountcode','exten','holdtime','assigned'];(function(_0x26f7b4,_0x569864){var _0x401c41=function(_0x126375){while(--_0x126375){_0x26f7b4['push'](_0x26f7b4['shift']());}};_0x401c41(++_0x569864);}(_0x45e8,0x191));var _0x845e=function(_0x3d2e4b,_0x1f6653){_0x3d2e4b=_0x3d2e4b-0x0;var _0x509e78=_0x45e8[_0x3d2e4b];return _0x509e78;};'use strict';function QueueReport(){this[_0x845e('0x0')]=_0x845e('0x1');this['uniqueid']='';this['calleridnum']='';this['calleridname']='';this[_0x845e('0x2')]='';this['queuecallerjoinAt']=null;this[_0x845e('0x3')]=null;this[_0x845e('0x4')]=0x1;this[_0x845e('0x5')]=0x1;this[_0x845e('0x6')]=![];this['queuecallerabandonAt']=null;this[_0x845e('0x7')]=![];this[_0x845e('0x8')]=null;this['queuecallerexit']=![];this['queuecallerexitAt']=null;this[_0x845e('0x9')]=0x1;this[_0x845e('0xa')]='';this[_0x845e('0xb')]='';this[_0x845e('0xc')]='';this[_0x845e('0xd')]='';this['context']='';this[_0x845e('0xe')]='';this['priority']='';this[_0x845e('0xf')]=0x0;this[_0x845e('0x10')]=![];this[_0x845e('0x11')]='';this[_0x845e('0x12')]=_0x845e('0x13');this['routealias']=null;this['mohtime']=0x0;this[_0x845e('0x14')]={};}module[_0x845e('0x15')]=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index d8b136e..b3948b7 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 _0x6946=['securityToken','type','integrationTab','Configurations','exports','name','username','remoteUri','clientId','clientSecret'];(function(_0x2028ae,_0x272151){var _0x5d5b36=function(_0x74bcc){while(--_0x74bcc){_0x2028ae['push'](_0x2028ae['shift']());}};_0x5d5b36(++_0x272151);}(_0x6946,0x1b3));var _0x6694=function(_0x29586d,_0xdb79f0){_0x29586d=_0x29586d-0x0;var _0x2dd375=_0x6946[_0x29586d];return _0x2dd375;};'use strict';function SalesforceAccount(_0x15cf09){this['id']=_0x15cf09['id']||0x0;this[_0x6694('0x0')]=_0x15cf09[_0x6694('0x0')]||'';this[_0x6694('0x1')]=_0x15cf09[_0x6694('0x1')]||'';this[_0x6694('0x2')]=_0x15cf09[_0x6694('0x2')]||'';this['password']=_0x15cf09['password']||'';this[_0x6694('0x3')]=_0x15cf09[_0x6694('0x3')]||'';this[_0x6694('0x4')]=_0x15cf09[_0x6694('0x4')]||'';this[_0x6694('0x5')]=_0x15cf09[_0x6694('0x5')]||'';this[_0x6694('0x6')]=_0x15cf09[_0x6694('0x6')]||_0x6694('0x7');this['serverUrl']=_0x15cf09['serverUrl']||'';this[_0x6694('0x8')]=_0x15cf09[_0x6694('0x8')]||{};}module[_0x6694('0x9')]=SalesforceAccount; \ No newline at end of file +var _0x6c0c=['integrationTab','serverUrl','Configurations','name','username','remoteUri','password','clientId','clientSecret','securityToken','type'];(function(_0x27b16a,_0x1518f6){var _0x1072d7=function(_0x5b7a86){while(--_0x5b7a86){_0x27b16a['push'](_0x27b16a['shift']());}};_0x1072d7(++_0x1518f6);}(_0x6c0c,0x18f));var _0xc6c0=function(_0x8580d,_0x44e4ca){_0x8580d=_0x8580d-0x0;var _0x1cccb2=_0x6c0c[_0x8580d];return _0x1cccb2;};'use strict';function SalesforceAccount(_0x5cd58b){this['id']=_0x5cd58b['id']||0x0;this[_0xc6c0('0x0')]=_0x5cd58b['name']||'';this['username']=_0x5cd58b[_0xc6c0('0x1')]||'';this['remoteUri']=_0x5cd58b[_0xc6c0('0x2')]||'';this[_0xc6c0('0x3')]=_0x5cd58b[_0xc6c0('0x3')]||'';this[_0xc6c0('0x4')]=_0x5cd58b['clientId']||'';this['clientSecret']=_0x5cd58b[_0xc6c0('0x5')]||'';this[_0xc6c0('0x6')]=_0x5cd58b[_0xc6c0('0x6')]||'';this[_0xc6c0('0x7')]=_0x5cd58b[_0xc6c0('0x7')]||_0xc6c0('0x8');this[_0xc6c0('0x9')]=_0x5cd58b[_0xc6c0('0x9')]||'';this[_0xc6c0('0xa')]=_0x5cd58b['Configurations']||{};}module['exports']=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index 60a0a55..73c9bb2 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 _0x2222=['password','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x453460,_0x48fb09){var _0x159b53=function(_0x511d73){while(--_0x511d73){_0x453460['push'](_0x453460['shift']());}};_0x159b53(++_0x48fb09);}(_0x2222,0xad));var _0x2222=function(_0x5d5649,_0x4578c4){_0x5d5649=_0x5d5649-0x0;var _0x591c21=_0x2222[_0x5d5649];return _0x591c21;};'use strict';function ServicenowAccount(_0x28eb7d){this['id']=_0x28eb7d['id']||0x0;this['name']=_0x28eb7d[_0x2222('0x0')]||'';this['username']=_0x28eb7d[_0x2222('0x1')]||'';this[_0x2222('0x2')]=_0x28eb7d[_0x2222('0x2')]||'';this[_0x2222('0x3')]=_0x28eb7d['remoteUri']||'';this['serverUrl']=_0x28eb7d[_0x2222('0x4')]||'';this[_0x2222('0x5')]=_0x28eb7d[_0x2222('0x5')]||{};}module[_0x2222('0x6')]=ServicenowAccount; \ No newline at end of file +var _0x8630=['serverUrl','Configurations','name','username','password','remoteUri'];(function(_0x335eca,_0x23bee1){var _0x4a9e78=function(_0x5ef1ec){while(--_0x5ef1ec){_0x335eca['push'](_0x335eca['shift']());}};_0x4a9e78(++_0x23bee1);}(_0x8630,0x122));var _0x0863=function(_0x34c07f,_0x23a690){_0x34c07f=_0x34c07f-0x0;var _0x4d4036=_0x8630[_0x34c07f];return _0x4d4036;};'use strict';function ServicenowAccount(_0x224179){this['id']=_0x224179['id']||0x0;this[_0x0863('0x0')]=_0x224179[_0x0863('0x0')]||'';this[_0x0863('0x1')]=_0x224179[_0x0863('0x1')]||'';this[_0x0863('0x2')]=_0x224179[_0x0863('0x2')]||'';this[_0x0863('0x3')]=_0x224179[_0x0863('0x3')]||'';this['serverUrl']=_0x224179[_0x0863('0x4')]||'';this[_0x0863('0x5')]=_0x224179[_0x0863('0x5')]||{};}module['exports']=ServicenowAccount; \ No newline at end of file diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js index 2758fd2..6d24ccd 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 _0x8264=['username','password','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x1a379a,_0x2868e0){var _0x528c58=function(_0x25a00a){while(--_0x25a00a){_0x1a379a['push'](_0x1a379a['shift']());}};_0x528c58(++_0x2868e0);}(_0x8264,0x1e9));var _0x4826=function(_0x4f8d61,_0x29eff0){_0x4f8d61=_0x4f8d61-0x0;var _0x3bc078=_0x8264[_0x4f8d61];return _0x3bc078;};'use strict';function SugarcrmAccount(_0x196b38){this['id']=_0x196b38['id']||0x0;this[_0x4826('0x0')]=_0x196b38[_0x4826('0x0')]||'';this[_0x4826('0x1')]=_0x196b38['username']||'';this[_0x4826('0x2')]=_0x196b38[_0x4826('0x2')]||'';this[_0x4826('0x3')]=_0x196b38[_0x4826('0x3')]||'';this[_0x4826('0x4')]=_0x196b38[_0x4826('0x4')]||'';this[_0x4826('0x5')]=_0x196b38[_0x4826('0x5')]||{};}module[_0x4826('0x6')]=SugarcrmAccount; \ No newline at end of file +var _0x8626=['Configurations','name','username','password','remoteUri','serverUrl'];(function(_0x484c37,_0x1abc7f){var _0x39b822=function(_0x342591){while(--_0x342591){_0x484c37['push'](_0x484c37['shift']());}};_0x39b822(++_0x1abc7f);}(_0x8626,0xd9));var _0x6862=function(_0x2a8ad3,_0x1fd126){_0x2a8ad3=_0x2a8ad3-0x0;var _0x388956=_0x8626[_0x2a8ad3];return _0x388956;};'use strict';function SugarcrmAccount(_0x2958d5){this['id']=_0x2958d5['id']||0x0;this[_0x6862('0x0')]=_0x2958d5[_0x6862('0x0')]||'';this[_0x6862('0x1')]=_0x2958d5[_0x6862('0x1')]||'';this[_0x6862('0x2')]=_0x2958d5[_0x6862('0x2')]||'';this[_0x6862('0x3')]=_0x2958d5[_0x6862('0x3')]||'';this[_0x6862('0x4')]=_0x2958d5['serverUrl']||'';this[_0x6862('0x5')]=_0x2958d5[_0x6862('0x5')]||{};}module['exports']=SugarcrmAccount; \ No newline at end of file diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index 284227b..c5870c7 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 _0x4574=['status','exports','name','accountcode','state','unknown'];(function(_0x5863bd,_0x26d618){var _0x43fb16=function(_0x392da4){while(--_0x392da4){_0x5863bd['push'](_0x5863bd['shift']());}};_0x43fb16(++_0x26d618);}(_0x4574,0xbc));var _0x4457=function(_0x1eff33,_0x562ab8){_0x1eff33=_0x1eff33-0x0;var _0x38d024=_0x4574[_0x1eff33];return _0x38d024;};'use strict';function Telephone(_0x5b64bd){this['id']=_0x5b64bd['id']||0x0;this['name']=_0x5b64bd[_0x4457('0x0')]||'';this[_0x4457('0x1')]=_0x5b64bd['accountcode']||'';this[_0x4457('0x2')]=_0x4457('0x3');this['stateTime']=0x0;this[_0x4457('0x4')]=_0x4457('0x3');this['address']='';}module[_0x4457('0x5')]=Telephone; \ No newline at end of file +var _0xbfcc=['exports','accountcode','state','unknown'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xbfcc,0x1dd));var _0xcbfc=function(_0x5f1617,_0x46277b){_0x5f1617=_0x5f1617-0x0;var _0x3af5da=_0xbfcc[_0x5f1617];return _0x3af5da;};'use strict';function Telephone(_0x271987){this['id']=_0x271987['id']||0x0;this['name']=_0x271987['name']||'';this[_0xcbfc('0x0')]=_0x271987[_0xcbfc('0x0')]||'';this[_0xcbfc('0x1')]=_0xcbfc('0x2');this['stateTime']=0x0;this['status']='unknown';this['address']='';}module[_0xcbfc('0x3')]=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index 3931ade..b8c44a2 100644 --- a/server/services/ami/model/template.js +++ b/server/services/ami/model/template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['exports','name'];(function(_0x297735,_0x54acc7){var _0x32b693=function(_0x473ebb){while(--_0x473ebb){_0x297735['push'](_0x297735['shift']());}};_0x32b693(++_0x54acc7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0xa9e0[_0x376b45];return _0x2341b3;};'use strict';function template(_0x1f0015){this['id']=_0x1f0015['id']||0x0;this[_0x0a9e('0x0')]=_0x1f0015[_0x0a9e('0x0')]||'';this['html']=_0x1f0015['html']||'';}module[_0x0a9e('0x1')]=template; \ No newline at end of file +var _0xb10b=['name','html'];(function(_0x5c6fc8,_0x34e1f6){var _0x2d4a18=function(_0x458145){while(--_0x458145){_0x5c6fc8['push'](_0x5c6fc8['shift']());}};_0x2d4a18(++_0x34e1f6);}(_0xb10b,0x12a));var _0xbb10=function(_0x7d261d,_0x4e1d2f){_0x7d261d=_0x7d261d-0x0;var _0x1a992a=_0xb10b[_0x7d261d];return _0x1a992a;};'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 67bed61..6557583 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 _0xb7e7=['Actions','exports','name','channel','status','AllConditions','AnyConditions'];(function(_0x214a3c,_0x48bd33){var _0x3743dc=function(_0x559994){while(--_0x559994){_0x214a3c['push'](_0x214a3c['shift']());}};_0x3743dc(++_0x48bd33);}(_0xb7e7,0x121));var _0x7b7e=function(_0x2f1762,_0xab43df){_0x2f1762=_0x2f1762-0x0;var _0x8ab21=_0xb7e7[_0x2f1762];return _0x8ab21;};'use strict';function Trigger(_0x2e5e07){this['id']=_0x2e5e07['id']||0x0;this['name']=_0x2e5e07[_0x7b7e('0x0')]||'';this['channel']=_0x2e5e07[_0x7b7e('0x1')]||'voice';this[_0x7b7e('0x2')]=_0x2e5e07['status']||![];this[_0x7b7e('0x3')]=_0x2e5e07[_0x7b7e('0x3')]||[];this[_0x7b7e('0x4')]=_0x2e5e07['AnyConditions']||[];this['Actions']=_0x2e5e07[_0x7b7e('0x5')]||[];}module[_0x7b7e('0x6')]=Trigger; \ No newline at end of file +var _0x4fc2=['name','channel','voice','status','AllConditions','AnyConditions','Actions'];(function(_0x4583f5,_0x48986e){var _0x16513b=function(_0x324230){while(--_0x324230){_0x4583f5['push'](_0x4583f5['shift']());}};_0x16513b(++_0x48986e);}(_0x4fc2,0x111));var _0x24fc=function(_0x3213b4,_0x3cddd0){_0x3213b4=_0x3213b4-0x0;var _0xa97785=_0x4fc2[_0x3213b4];return _0xa97785;};'use strict';function Trigger(_0x5ea3ab){this['id']=_0x5ea3ab['id']||0x0;this[_0x24fc('0x0')]=_0x5ea3ab[_0x24fc('0x0')]||'';this[_0x24fc('0x1')]=_0x5ea3ab['channel']||_0x24fc('0x2');this[_0x24fc('0x3')]=_0x5ea3ab[_0x24fc('0x3')]||![];this['AllConditions']=_0x5ea3ab[_0x24fc('0x4')]||[];this[_0x24fc('0x5')]=_0x5ea3ab['AnyConditions']||[];this[_0x24fc('0x6')]=_0x5ea3ab[_0x24fc('0x6')]||[];}module['exports']=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index 92bccd5..cd31cda 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 _0xf7f4=['port','stateRegistry','address','defaultuser','exports','active','name','state','stateTime','status','unknown','registry','split','host'];(function(_0x259d53,_0x45422c){var _0x53d123=function(_0x5ec56f){while(--_0x5ec56f){_0x259d53['push'](_0x259d53['shift']());}};_0x53d123(++_0x45422c);}(_0xf7f4,0x9f));var _0x4f7f=function(_0x450413,_0xece709){_0x450413=_0x450413-0x0;var _0x39dbc3=_0xf7f4[_0x450413];return _0x39dbc3;};'use strict';function Trunk(_0x2dba9b){this['id']=_0x2dba9b['id']||0x0;this[_0x4f7f('0x0')]=_0x2dba9b['active']||![];this[_0x4f7f('0x1')]=_0x2dba9b[_0x4f7f('0x1')]||'';this[_0x4f7f('0x2')]='unknown';this[_0x4f7f('0x3')]=0x0;this[_0x4f7f('0x4')]=_0x4f7f('0x5');this[_0x4f7f('0x6')]=_0x2dba9b[_0x4f7f('0x6')]&&_0x2dba9b[_0x4f7f('0x6')]['indexOf'](':')?_0x2dba9b['registry'][_0x4f7f('0x7')](':')[0x0]:'';this[_0x4f7f('0x8')]='';this[_0x4f7f('0x9')]='';this['domain']='';this['domainport']='';this['refresh']='';this[_0x4f7f('0xa')]=_0x4f7f('0x5');this['registrationtime']='';this[_0x4f7f('0xb')]='';this['defaultuser']=_0x2dba9b[_0x4f7f('0xc')]||'';}module[_0x4f7f('0xd')]=Trunk; \ No newline at end of file +var _0xb135=['port','domain','domainport','refresh','stateRegistry','registrationtime','address','defaultuser','exports','active','name','state','status','unknown','registry','indexOf','split','host'];(function(_0x32e851,_0xc61922){var _0x1982b0=function(_0x362590){while(--_0x362590){_0x32e851['push'](_0x32e851['shift']());}};_0x1982b0(++_0xc61922);}(_0xb135,0x87));var _0x5b13=function(_0x46ec30,_0x4e0ecb){_0x46ec30=_0x46ec30-0x0;var _0x2f662c=_0xb135[_0x46ec30];return _0x2f662c;};'use strict';function Trunk(_0x1c8093){this['id']=_0x1c8093['id']||0x0;this[_0x5b13('0x0')]=_0x1c8093[_0x5b13('0x0')]||![];this[_0x5b13('0x1')]=_0x1c8093['name']||'';this[_0x5b13('0x2')]='unknown';this['stateTime']=0x0;this[_0x5b13('0x3')]=_0x5b13('0x4');this[_0x5b13('0x5')]=_0x1c8093[_0x5b13('0x5')]&&_0x1c8093[_0x5b13('0x5')][_0x5b13('0x6')](':')?_0x1c8093['registry'][_0x5b13('0x7')](':')[0x0]:'';this[_0x5b13('0x8')]='';this[_0x5b13('0x9')]='';this[_0x5b13('0xa')]='';this[_0x5b13('0xb')]='';this[_0x5b13('0xc')]='';this[_0x5b13('0xd')]=_0x5b13('0x4');this[_0x5b13('0xe')]='';this[_0x5b13('0xf')]='';this[_0x5b13('0x10')]=_0x1c8093[_0x5b13('0x10')]||'';}module[_0x5b13('0x11')]=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index 558f959..fd0499c 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 _0xa386=['mandatoryDisposition','exports','exten','recordingFormat','none'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa386,0xb1));var _0x6a38=function(_0xdb0cc5,_0x33653a){_0xdb0cc5=_0xdb0cc5-0x0;var _0x153aa=_0xa386[_0xdb0cc5];return _0x153aa;};'use strict';function voiceExtension(_0xa18cc3){this['id']=_0xa18cc3['id']||0x0;this[_0x6a38('0x0')]=_0xa18cc3[_0x6a38('0x0')]||'';this[_0x6a38('0x1')]=_0xa18cc3[_0x6a38('0x1')]||_0x6a38('0x2');this[_0x6a38('0x3')]=_0xa18cc3[_0x6a38('0x3')]||![];}module[_0x6a38('0x4')]=voiceExtension; \ No newline at end of file +var _0x32c7=['mandatoryDisposition','exten','recordingFormat'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x32c7,0x151));var _0x732c=function(_0x4402b7,_0x5cce0a){_0x4402b7=_0x4402b7-0x0;var _0xa0c415=_0x32c7[_0x4402b7];return _0xa0c415;};'use strict';function voiceExtension(_0x52ed94){this['id']=_0x52ed94['id']||0x0;this[_0x732c('0x0')]=_0x52ed94[_0x732c('0x0')]||'';this[_0x732c('0x1')]=_0x52ed94['recordingFormat']||'none';this[_0x732c('0x2')]=_0x52ed94[_0x732c('0x2')]||![];}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 294b051..1263de4 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 _0x1bce=['rrmemory','rrordered','wrandom','name','monitor_format','type','inbound','total','sumDuration','sumHoldTime','sumBillable','abandoned','available','inUse','invalid','onHold','paused','ringing','unavailable','unknown','acw','acwTimeout','autopause','message','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startPredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalAvailable','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDispositionPause','queueSummaryCountersUpdated','exports','wav','wav49','fewestcalls','leastrecent','linear','random','ringall','roundrobin'];(function(_0x304ad1,_0x3bf97d){var _0x5ab805=function(_0x209875){while(--_0x209875){_0x304ad1['push'](_0x304ad1['shift']());}};_0x5ab805(++_0x3bf97d);}(_0x1bce,0x73));var _0xe1bc=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x1bce[_0x122ef9];return _0x42fba0;};'use strict';var monitorFormat={'wav':_0xe1bc('0x0'),'wav49':_0xe1bc('0x1'),'gsm':'gsm'};var strategy={'fewestcalls':_0xe1bc('0x2'),'leastrecent':_0xe1bc('0x3'),'linear':_0xe1bc('0x4'),'random':_0xe1bc('0x5'),'ringall':_0xe1bc('0x6'),'rr':_0xe1bc('0x7'),'rrmemory':_0xe1bc('0x8'),'rrordered':_0xe1bc('0x9'),'wrandom':_0xe1bc('0xa')};function VoiceQueue(_0x57ebd4){this['id']=_0x57ebd4['id']||0x0;this['name']=_0x57ebd4[_0xe1bc('0xb')]||'';this[_0xe1bc('0xc')]=_0x57ebd4[_0xe1bc('0xc')]||'';this[_0xe1bc('0xd')]=_0x57ebd4[_0xe1bc('0xd')]||_0xe1bc('0xe');this['waiting']=0x0;this[_0xe1bc('0xf')]=0x0;this['answered']=0x0;this[_0xe1bc('0x10')]=0x0;this[_0xe1bc('0x11')]=0x0;this[_0xe1bc('0x12')]=0x0;this['unmanaged']=0x0;this[_0xe1bc('0x13')]=0x0;this[_0xe1bc('0x14')]=0x0;this['busy']=0x0;this[_0xe1bc('0x15')]=0x0;this[_0xe1bc('0x16')]=0x0;this['loggedIn']=0x0;this['notInUse']=0x0;this[_0xe1bc('0x17')]=0x0;this[_0xe1bc('0x18')]=0x0;this[_0xe1bc('0x19')]=0x0;this['ringInUse']=0x0;this['talking']=0x0;this[_0xe1bc('0x1a')]=0x0;this[_0xe1bc('0x1b')]=0x0;this[_0xe1bc('0x1c')]=_0x57ebd4['acw']||![];this[_0xe1bc('0x1d')]=_0x57ebd4[_0xe1bc('0x1d')]||0xa;this[_0xe1bc('0x1e')]=_0x57ebd4[_0xe1bc('0x1e')]||'no';this['sendMessageOneNotActive']=!![];this[_0xe1bc('0x1f')]='';this['statusMessage']='';this[_0xe1bc('0x20')]=0x0;this[_0xe1bc('0x21')]=0x0;this['dialTimezone']=_0x57ebd4[_0xe1bc('0x22')]||null;this[_0xe1bc('0x23')]=_0x57ebd4[_0xe1bc('0x23')]?_0x57ebd4[_0xe1bc('0x23')]:null;this[_0xe1bc('0x24')]=_0x57ebd4[_0xe1bc('0x24')];this['dialMethod']=_0x57ebd4[_0xe1bc('0x25')]||'progressive';this[_0xe1bc('0x26')]=_0x57ebd4[_0xe1bc('0x26')]||0x0;this[_0xe1bc('0x27')]=_0x57ebd4[_0xe1bc('0x27')]||0x0;this[_0xe1bc('0x28')]=_0x57ebd4['dialPowerLevel']||0x1;this[_0xe1bc('0x29')]=_0x57ebd4['dialPredictiveOptimization']||'dropRate';this[_0xe1bc('0x2a')]=_0x57ebd4[_0xe1bc('0x2a')]||0.03;this['dialPredictiveInterval']=_0x57ebd4['dialPredictiveInterval']||0x258;this[_0xe1bc('0x2b')]=_0x57ebd4[_0xe1bc('0x2b')]||_0xe1bc('0x2c');this[_0xe1bc('0x2d')]=_0x57ebd4[_0xe1bc('0x2d')]||_0xe1bc('0x2c');this[_0xe1bc('0x2e')]=_0x57ebd4[_0xe1bc('0x2e')]||0x1e;this[_0xe1bc('0x2f')]=_0x57ebd4[_0xe1bc('0x2f')]||_0xe1bc('0x30');this[_0xe1bc('0x31')]=_0x57ebd4[_0xe1bc('0x31')]||0x3;this['dialQueueProject']=_0x57ebd4['dialQueueProject']||undefined;this[_0xe1bc('0x32')]=_0x57ebd4['dialCongestionMaxRetry']||0x3;this[_0xe1bc('0x33')]=_0x57ebd4['dialCongestionRetryFrequency']||0x96;this[_0xe1bc('0x34')]=_0x57ebd4['dialBusyMaxRetry']||0x3;this['dialBusyRetryFrequency']=_0x57ebd4[_0xe1bc('0x35')]||0x96;this[_0xe1bc('0x36')]=_0x57ebd4['dialNoAnswerMaxRetry']||0x3;this['dialNoAnswerRetryFrequency']=_0x57ebd4[_0xe1bc('0x37')]||0x96;this[_0xe1bc('0x38')]=_0x57ebd4[_0xe1bc('0x38')]||0x3;this[_0xe1bc('0x39')]=_0x57ebd4[_0xe1bc('0x39')]||0x96;this[_0xe1bc('0x3a')]=_0x57ebd4[_0xe1bc('0x3a')]||0x3;this[_0xe1bc('0x3b')]=_0x57ebd4[_0xe1bc('0x3b')]||0x96;this['dialAbandonedMaxRetry']=_0x57ebd4[_0xe1bc('0x3c')]||0x3;this[_0xe1bc('0x3d')]=_0x57ebd4[_0xe1bc('0x3d')]||0x96;this['dialMachineMaxRetry']=_0x57ebd4[_0xe1bc('0x3e')]||0x3;this[_0xe1bc('0x3f')]=_0x57ebd4[_0xe1bc('0x3f')]||0x96;this[_0xe1bc('0x40')]=_0x57ebd4[_0xe1bc('0x40')]||0x3;this['dialAgentRejectRetryFrequency']=_0x57ebd4[_0xe1bc('0x41')]||0x96;this['callAdditionalPhoneAfterMin']=_0x57ebd4['callAdditionalPhoneAfterMin']||0x3;this[_0xe1bc('0x42')]=_0x57ebd4[_0xe1bc('0x42')]||0x4;this[_0xe1bc('0x43')]=_0x57ebd4['Trunk']?_0x57ebd4[_0xe1bc('0x43')]:undefined;this[_0xe1bc('0x44')]=_0x57ebd4['TrunkBackup']?_0x57ebd4[_0xe1bc('0x44')]:undefined;this[_0xe1bc('0x45')]=_0x57ebd4[_0xe1bc('0x45')]||undefined;this[_0xe1bc('0x46')]=_0x57ebd4[_0xe1bc('0x46')]?_0x57ebd4[_0xe1bc('0x46')]:undefined;this['dialOrderByScheduledAt']=_0x57ebd4[_0xe1bc('0x47')]||_0xe1bc('0x48');this['dialRandomLastDigitCallerIdNumber']=_0x57ebd4[_0xe1bc('0x49')]||undefined;this['dialCutDigit']=_0x57ebd4[_0xe1bc('0x4a')]||undefined;this[_0xe1bc('0x4b')]=strategy[_0x57ebd4[_0xe1bc('0x4b')]];this[_0xe1bc('0x4c')]=!![];this['dialAMDActive']=_0x57ebd4[_0xe1bc('0x4d')]||![];this[_0xe1bc('0x4e')]=_0x57ebd4[_0xe1bc('0x4e')];this[_0xe1bc('0x4f')]=_0x57ebd4[_0xe1bc('0x4f')];this[_0xe1bc('0x50')]=_0x57ebd4[_0xe1bc('0x50')];this[_0xe1bc('0x51')]=_0x57ebd4[_0xe1bc('0x51')];this[_0xe1bc('0x52')]=_0x57ebd4[_0xe1bc('0x52')];this[_0xe1bc('0x53')]=_0x57ebd4[_0xe1bc('0x53')];this[_0xe1bc('0x54')]=_0x57ebd4['dialAMDMaximumNumberOfWords'];this[_0xe1bc('0x55')]=_0x57ebd4[_0xe1bc('0x55')];this['dialAMDMaximumWordLength']=_0x57ebd4[_0xe1bc('0x56')];this['outboundRejectCallsDay']=0x0;this[_0xe1bc('0x57')]=0x0;this[_0xe1bc('0x58')]=_0x57ebd4[_0xe1bc('0x58')];this[_0xe1bc('0x59')]=0x0;this[_0xe1bc('0x5a')]=0x0;this['outboundNoAnswerCallsDay']=0x0;this['outboundBusyCallsDay']=0x0;this[_0xe1bc('0x5b')]=0x0;this[_0xe1bc('0x5c')]=0x0;this[_0xe1bc('0x5d')]=0x0;this[_0xe1bc('0x5e')]=0x0;this[_0xe1bc('0x5f')]=0x0;this[_0xe1bc('0x60')]=0x0;this['outboundDropCallsDayTimeout']=0x0;this[_0xe1bc('0x61')]=0x0;this[_0xe1bc('0x62')]=0x0;this[_0xe1bc('0x63')]=0x0;this['startProgressive']=undefined;this[_0xe1bc('0x64')]=undefined;this['handlePredictive']=undefined;this[_0xe1bc('0x65')]=1.05;this[_0xe1bc('0x66')]=0x0;this[_0xe1bc('0x67')]=0x0;this['predictiveIntervalDroppedCallsCallersExit']=0x0;this[_0xe1bc('0x68')]=0x0;this[_0xe1bc('0x69')]=0x0;this[_0xe1bc('0x6a')]=0x0;this['predictiveIntervalPauses']=0x0;this[_0xe1bc('0x6b')]=0x0;this['predictiveIntervalMaxThreshold']=_0x57ebd4['dialPredictiveIntervalMaxThreshold']||0x14;this['predictiveIntervalMinThreshold']=_0x57ebd4['dialPredictiveIntervalMaxThreshold']||0xa;this['predictiveIntervalErlangCalls']=0x0;this['predictiveIntervalErlangCallsDroppedCalls']=0x0;this[_0xe1bc('0x6c')]=0x1;this[_0xe1bc('0x6d')]=0x0;this[_0xe1bc('0x6e')]=0x0;this[_0xe1bc('0x6f')]=0x0;this[_0xe1bc('0x70')]=0x0;this[_0xe1bc('0x71')]=_0x57ebd4['dialRecallMeTimeout']||0x1e;this[_0xe1bc('0x72')]=_0x57ebd4[_0xe1bc('0x72')]||![];this[_0xe1bc('0x73')]=!!_0x57ebd4[_0xe1bc('0x73')]||![];this[_0xe1bc('0x74')]=!!_0x57ebd4['dialPreviewRecallmeReminder']||![];this[_0xe1bc('0x75')]=_0x57ebd4[_0xe1bc('0x75')]||undefined;this['dialAgiAfterHangupClient']=_0x57ebd4[_0xe1bc('0x76')]||![];this[_0xe1bc('0x77')]=_0x57ebd4['dialAgiAfterHangupAgent']||![];this[_0xe1bc('0xc')]=monitorFormat[_0x57ebd4['monitor_format']]?monitorFormat[_0x57ebd4[_0xe1bc('0xc')]]:undefined;this['mandatoryDisposition']=_0x57ebd4['mandatoryDisposition']||![];this[_0xe1bc('0x78')]=_0x57ebd4[_0xe1bc('0x78')]?_0x57ebd4[_0xe1bc('0x78')]:undefined;this[_0xe1bc('0x79')]=![];}module[_0xe1bc('0x7a')]=VoiceQueue; \ No newline at end of file +var _0xa680=['DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayACS','outboundReCallsDay','startProgressive','startPredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','queueSummaryCountersUpdated','exports','wav','wav49','leastrecent','linear','random','ringall','rrmemory','name','monitor_format','type','inbound','answered','sumDuration','sumHoldTime','sumBillable','unmanaged','abandoned','available','busy','inUse','loggedIn','notInUse','onHold','paused','ringing','ringInUse','talking','unavailable','acw','acwTimeout','autopause','message','statusMessage','temp','dialTimezone','dialGlobalInterval','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','anonymous','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt'];(function(_0x386b33,_0x484510){var _0x2095a0=function(_0x208ed9){while(--_0x208ed9){_0x386b33['push'](_0x386b33['shift']());}};_0x2095a0(++_0x484510);}(_0xa680,0xb0));var _0x0a68=function(_0x2c7cb4,_0x53bda2){_0x2c7cb4=_0x2c7cb4-0x0;var _0x54bf50=_0xa680[_0x2c7cb4];return _0x54bf50;};'use strict';var monitorFormat={'wav':_0x0a68('0x0'),'wav49':_0x0a68('0x1'),'gsm':'gsm'};var strategy={'fewestcalls':'fewestcalls','leastrecent':_0x0a68('0x2'),'linear':_0x0a68('0x3'),'random':_0x0a68('0x4'),'ringall':_0x0a68('0x5'),'rr':'roundrobin','rrmemory':_0x0a68('0x6'),'rrordered':'rrordered','wrandom':'wrandom'};function VoiceQueue(_0x588889){this['id']=_0x588889['id']||0x0;this[_0x0a68('0x7')]=_0x588889[_0x0a68('0x7')]||'';this[_0x0a68('0x8')]=_0x588889[_0x0a68('0x8')]||'';this[_0x0a68('0x9')]=_0x588889[_0x0a68('0x9')]||_0x0a68('0xa');this['waiting']=0x0;this['total']=0x0;this[_0x0a68('0xb')]=0x0;this[_0x0a68('0xc')]=0x0;this[_0x0a68('0xd')]=0x0;this[_0x0a68('0xe')]=0x0;this[_0x0a68('0xf')]=0x0;this[_0x0a68('0x10')]=0x0;this[_0x0a68('0x11')]=0x0;this[_0x0a68('0x12')]=0x0;this[_0x0a68('0x13')]=0x0;this['invalid']=0x0;this[_0x0a68('0x14')]=0x0;this[_0x0a68('0x15')]=0x0;this[_0x0a68('0x16')]=0x0;this[_0x0a68('0x17')]=0x0;this[_0x0a68('0x18')]=0x0;this[_0x0a68('0x19')]=0x0;this[_0x0a68('0x1a')]=0x0;this[_0x0a68('0x1b')]=0x0;this['unknown']=0x0;this['acw']=_0x588889[_0x0a68('0x1c')]||![];this[_0x0a68('0x1d')]=_0x588889[_0x0a68('0x1d')]||0xa;this['autopause']=_0x588889[_0x0a68('0x1e')]||'no';this['sendMessageOneNotActive']=!![];this[_0x0a68('0x1f')]='';this[_0x0a68('0x20')]='';this['originated']=0x0;this[_0x0a68('0x21')]=0x0;this[_0x0a68('0x22')]=_0x588889[_0x0a68('0x22')]||null;this[_0x0a68('0x23')]=_0x588889[_0x0a68('0x23')]?_0x588889[_0x0a68('0x23')]:null;this['dialActive']=_0x588889['dialActive'];this['dialMethod']=_0x588889[_0x0a68('0x24')]||_0x0a68('0x25');this[_0x0a68('0x26')]=_0x588889['dialLimitChannel']||0x0;this['dialLimitQueue']=_0x588889[_0x0a68('0x27')]||0x0;this[_0x0a68('0x28')]=_0x588889[_0x0a68('0x28')]||0x1;this[_0x0a68('0x29')]=_0x588889['dialPredictiveOptimization']||_0x0a68('0x2a');this[_0x0a68('0x2b')]=_0x588889[_0x0a68('0x2b')]||0.03;this['dialPredictiveInterval']=_0x588889[_0x0a68('0x2c')]||0x258;this[_0x0a68('0x2d')]=_0x588889['dialOriginateCallerIdName']||'anonymous';this['dialOriginateCallerIdNumber']=_0x588889[_0x0a68('0x2e')]||_0x0a68('0x2f');this['dialOriginateTimeout']=_0x588889['dialOriginateTimeout']||0x1e;this[_0x0a68('0x30')]=_0x588889['dialQueueOptions']||_0x0a68('0x31');this['dialQueueTimeout']=_0x588889[_0x0a68('0x32')]||0x3;this[_0x0a68('0x33')]=_0x588889[_0x0a68('0x33')]||undefined;this[_0x0a68('0x34')]=_0x588889[_0x0a68('0x34')]||0x3;this['dialCongestionRetryFrequency']=_0x588889[_0x0a68('0x35')]||0x96;this[_0x0a68('0x36')]=_0x588889[_0x0a68('0x36')]||0x3;this['dialBusyRetryFrequency']=_0x588889[_0x0a68('0x37')]||0x96;this[_0x0a68('0x38')]=_0x588889['dialNoAnswerMaxRetry']||0x3;this[_0x0a68('0x39')]=_0x588889[_0x0a68('0x39')]||0x96;this['dialNoSuchNumberMaxRetry']=_0x588889[_0x0a68('0x3a')]||0x3;this[_0x0a68('0x3b')]=_0x588889[_0x0a68('0x3b')]||0x96;this[_0x0a68('0x3c')]=_0x588889['dialDropMaxRetry']||0x3;this['dialDropRetryFrequency']=_0x588889[_0x0a68('0x3d')]||0x96;this['dialAbandonedMaxRetry']=_0x588889['dialAbandonedMaxRetry']||0x3;this[_0x0a68('0x3e')]=_0x588889[_0x0a68('0x3e')]||0x96;this[_0x0a68('0x3f')]=_0x588889[_0x0a68('0x3f')]||0x3;this['dialMachineRetryFrequency']=_0x588889['dialMachineRetryFrequency']||0x96;this[_0x0a68('0x40')]=_0x588889[_0x0a68('0x40')]||0x3;this[_0x0a68('0x41')]=_0x588889[_0x0a68('0x41')]||0x96;this[_0x0a68('0x42')]=_0x588889['callAdditionalPhoneAfterMin']||0x3;this['dialGlobalMaxRetry']=_0x588889['dialGlobalMaxRetry']||0x4;this[_0x0a68('0x43')]=_0x588889[_0x0a68('0x43')]?_0x588889[_0x0a68('0x43')]:undefined;this[_0x0a68('0x44')]=_0x588889[_0x0a68('0x44')]?_0x588889['TrunkBackup']:undefined;this['dialPrefix']=_0x588889[_0x0a68('0x45')]||undefined;this[_0x0a68('0x46')]=_0x588889[_0x0a68('0x46')]?_0x588889[_0x0a68('0x46')]:undefined;this['dialOrderByScheduledAt']=_0x588889[_0x0a68('0x47')]||_0x0a68('0x48');this[_0x0a68('0x49')]=_0x588889[_0x0a68('0x49')]||undefined;this[_0x0a68('0x4a')]=_0x588889[_0x0a68('0x4a')]||undefined;this[_0x0a68('0x4b')]=strategy[_0x588889['strategy']];this[_0x0a68('0x4c')]=!![];this[_0x0a68('0x4d')]=_0x588889[_0x0a68('0x4d')]||![];this[_0x0a68('0x4e')]=_0x588889[_0x0a68('0x4e')];this[_0x0a68('0x4f')]=_0x588889[_0x0a68('0x4f')];this[_0x0a68('0x50')]=_0x588889['dialAMDAfterGreetingSilence'];this[_0x0a68('0x51')]=_0x588889[_0x0a68('0x51')];this[_0x0a68('0x52')]=_0x588889[_0x0a68('0x52')];this[_0x0a68('0x53')]=_0x588889[_0x0a68('0x53')];this['dialAMDMaximumNumberOfWords']=_0x588889[_0x0a68('0x54')];this[_0x0a68('0x55')]=_0x588889[_0x0a68('0x55')];this[_0x0a68('0x56')]=_0x588889[_0x0a68('0x56')];this[_0x0a68('0x57')]=0x0;this[_0x0a68('0x58')]=0x0;this[_0x0a68('0x59')]=_0x588889[_0x0a68('0x59')];this[_0x0a68('0x5a')]=0x0;this['outboundAnswerAgiCallsDay']=0x0;this[_0x0a68('0x5b')]=0x0;this['outboundBusyCallsDay']=0x0;this['outboundCongestionCallsDay']=0x0;this[_0x0a68('0x5c')]=0x0;this['outboundUnknownCallsDay']=0x0;this[_0x0a68('0x5d')]=0x0;this[_0x0a68('0x5e')]=0x0;this[_0x0a68('0x5f')]=0x0;this['outboundDropCallsDayTimeout']=0x0;this[_0x0a68('0x60')]=0x0;this[_0x0a68('0x61')]=0x0;this['outboundAbandonedDay']=0x0;this[_0x0a68('0x62')]=undefined;this[_0x0a68('0x63')]=undefined;this['handlePredictive']=undefined;this[_0x0a68('0x64')]=1.05;this[_0x0a68('0x65')]=0x0;this[_0x0a68('0x66')]=0x0;this['predictiveIntervalDroppedCallsCallersExit']=0x0;this['predictiveIntervalDroppedCallsTimeout']=0x0;this[_0x0a68('0x67')]=0x0;this[_0x0a68('0x68')]=0x0;this[_0x0a68('0x69')]=0x0;this[_0x0a68('0x6a')]=0x0;this['predictiveIntervalMaxThreshold']=_0x588889[_0x0a68('0x6b')]||0x14;this['predictiveIntervalMinThreshold']=_0x588889['dialPredictiveIntervalMaxThreshold']||0xa;this[_0x0a68('0x6c')]=0x0;this[_0x0a68('0x6d')]=0x0;this[_0x0a68('0x6e')]=0x1;this[_0x0a68('0x6f')]=0x0;this['erlangCallToSecond']=0x0;this[_0x0a68('0x70')]=0x0;this[_0x0a68('0x71')]=0x0;this[_0x0a68('0x72')]=_0x588889[_0x0a68('0x72')]||0x1e;this['dialRecallInQueue']=_0x588889['dialRecallInQueue']||![];this[_0x0a68('0x73')]=!!_0x588889[_0x0a68('0x73')]||![];this['dialPreviewRecallmeReminder']=!!_0x588889[_0x0a68('0x74')]||![];this[_0x0a68('0x75')]=_0x588889[_0x0a68('0x75')]||undefined;this[_0x0a68('0x76')]=_0x588889[_0x0a68('0x76')]||![];this[_0x0a68('0x77')]=_0x588889[_0x0a68('0x77')]||![];this[_0x0a68('0x8')]=monitorFormat[_0x588889[_0x0a68('0x8')]]?monitorFormat[_0x588889[_0x0a68('0x8')]]:undefined;this[_0x0a68('0x78')]=_0x588889[_0x0a68('0x78')]||![];this[_0x0a68('0x79')]=_0x588889[_0x0a68('0x79')]?_0x588889[_0x0a68('0x79')]:undefined;this[_0x0a68('0x7a')]=![];}module[_0x0a68('0x7b')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueueSummary.js b/server/services/ami/model/voiceQueueSummary.js index 31a9d77..dc9a421 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 _0x0a9f=['includes','status','booked','keys','queue','dialer','xcally-motion-preview','compareToInboundQueue','some','compareToOutboundQueue','preview','loggedIn','loggedInDb','talking','available','originated','outboundAbandonedCallsDay','outboundBlacklistCallsDay','outboundCongestionCallsDay','outboundNoAnswerCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','pTalking','sumBillable','sumDuration','total','waiting','name','strategy','answered','busy','inUse','invalid','onHold','notInUse','paused','ringing','ringInUse','sumHoldTime','type','unavailable','unknown','unmanaged','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','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','prototype','createReport','loggedin','callers','length','SIP/','online','incall'];(function(_0x3e9819,_0x6a5a11){var _0x2e836a=function(_0x1364e2){while(--_0x1364e2){_0x3e9819['push'](_0x3e9819['shift']());}};_0x2e836a(++_0x6a5a11);}(_0x0a9f,0x64));var _0xf0a9=function(_0xf1bf12,_0x4558e4){_0xf1bf12=_0xf1bf12-0x0;var _0x340ce8=_0x0a9f[_0xf1bf12];return _0x340ce8;};'use strict';var INBOUND_COUNTERS=['available',_0xf0a9('0x0'),_0xf0a9('0x1'),'paused','ringing',_0xf0a9('0x2'),'waiting'];var OUTBOUND_COUNTERS=[_0xf0a9('0x3'),'answered','inUse','loggedIn','loggedInDb',_0xf0a9('0x4'),_0xf0a9('0x5'),'outboundAnswerCallsDay',_0xf0a9('0x6'),'outboundBusyCallsDay',_0xf0a9('0x7'),_0xf0a9('0x8'),'outboundNoSuchCallsDay',_0xf0a9('0x9'),_0xf0a9('0xa'),_0xf0a9('0xb'),'paused',_0xf0a9('0xc'),'talking',_0xf0a9('0xd'),_0xf0a9('0xe'),_0xf0a9('0xf'),_0xf0a9('0x10')];function VoiceQueueSummary(_0x4ecd0c){this['id']=_0x4ecd0c['id'];this[_0xf0a9('0x11')]=_0x4ecd0c[_0xf0a9('0x11')];this[_0xf0a9('0x12')]=_0x4ecd0c[_0xf0a9('0x12')];this['abandoned']=_0x4ecd0c['abandoned']||0x0;this[_0xf0a9('0x13')]=_0x4ecd0c[_0xf0a9('0x13')]||0x0;this[_0xf0a9('0x3')]=_0x4ecd0c[_0xf0a9('0x3')]||0x0;this[_0xf0a9('0x14')]=_0x4ecd0c[_0xf0a9('0x14')]||0x0;this[_0xf0a9('0x15')]=_0x4ecd0c['inUse']||0x0;this[_0xf0a9('0x16')]=_0x4ecd0c[_0xf0a9('0x16')]||0x0;this[_0xf0a9('0x0')]=_0x4ecd0c['loggedIn']||0x0;this[_0xf0a9('0x1')]=_0x4ecd0c['loggedInDb']||0x0;this[_0xf0a9('0x17')]=_0x4ecd0c[_0xf0a9('0x17')]||0x0;this[_0xf0a9('0x18')]=_0x4ecd0c[_0xf0a9('0x18')]||0x0;this[_0xf0a9('0x19')]=_0x4ecd0c[_0xf0a9('0x19')]||0x0;this[_0xf0a9('0x1a')]=_0x4ecd0c[_0xf0a9('0x1a')]||0x0;this[_0xf0a9('0x1b')]=_0x4ecd0c['ringInUse'];this[_0xf0a9('0xd')]=_0x4ecd0c[_0xf0a9('0xd')];this[_0xf0a9('0xe')]=_0x4ecd0c['sumDuration'];this[_0xf0a9('0x1c')]=_0x4ecd0c['sumHoldTime']||0x0;this[_0xf0a9('0x2')]=_0x4ecd0c[_0xf0a9('0x2')]||0x0;this['total']=_0x4ecd0c[_0xf0a9('0xf')]||0x0;this[_0xf0a9('0x1d')]=_0x4ecd0c[_0xf0a9('0x1d')];this['unavailable']=_0x4ecd0c[_0xf0a9('0x1e')]||0x0;this[_0xf0a9('0x1f')]=_0x4ecd0c[_0xf0a9('0x1f')]||0x0;this[_0xf0a9('0x20')]=_0x4ecd0c[_0xf0a9('0x20')]||0x0;this[_0xf0a9('0x10')]=_0x4ecd0c[_0xf0a9('0x10')]||0x0;if(_0x4ecd0c['type']==='outbound'){this['pTalking']=_0x4ecd0c[_0xf0a9('0xc')]||0x0;this[_0xf0a9('0x21')]=_0x4ecd0c[_0xf0a9('0x21')];this['dialMethod']=_0x4ecd0c[_0xf0a9('0x22')];this[_0xf0a9('0x23')]=_0x4ecd0c[_0xf0a9('0x23')];this[_0xf0a9('0x24')]=_0x4ecd0c[_0xf0a9('0x24')];this[_0xf0a9('0x25')]=_0x4ecd0c['dialOriginateTimeout'];this[_0xf0a9('0x26')]=_0x4ecd0c[_0xf0a9('0x26')];this[_0xf0a9('0x27')]=_0x4ecd0c[_0xf0a9('0x27')];this[_0xf0a9('0x28')]=_0x4ecd0c['outboundAnswerAgiCallsDay'];this[_0xf0a9('0x29')]=_0x4ecd0c['outboundAnswerCallsDay'];this['outboundBlacklistCallsDay']=_0x4ecd0c['outboundBlacklistCallsDay'];this['outboundBusyCallsDay']=_0x4ecd0c[_0xf0a9('0x2a')];this[_0xf0a9('0x7')]=_0x4ecd0c[_0xf0a9('0x7')];this['outboundDropCallsDayACS']=_0x4ecd0c[_0xf0a9('0x2b')];this['outboundDropCallsDayCallersExit']=_0x4ecd0c[_0xf0a9('0x2c')];this[_0xf0a9('0x2d')]=_0x4ecd0c['outboundDropCallsDayTimeout'];this[_0xf0a9('0x8')]=_0x4ecd0c[_0xf0a9('0x8')];this[_0xf0a9('0x2e')]=_0x4ecd0c[_0xf0a9('0x2e')];this[_0xf0a9('0x2f')]=_0x4ecd0c[_0xf0a9('0x2f')];this['outboundReCallsDay']=_0x4ecd0c['outboundReCallsDay'];this['outboundRejectCallsDay']=_0x4ecd0c['outboundRejectCallsDay'];this[_0xf0a9('0xb')]=_0x4ecd0c['outboundUnknownCallsDay'];this[_0xf0a9('0x30')]=_0x4ecd0c[_0xf0a9('0x30')];this[_0xf0a9('0x31')]=_0x4ecd0c[_0xf0a9('0x31')];this[_0xf0a9('0x32')]=_0x4ecd0c['predictiveIntervalAvgTalktime'];this[_0xf0a9('0x33')]=_0x4ecd0c[_0xf0a9('0x33')];this[_0xf0a9('0x34')]=_0x4ecd0c['predictiveIntervalDroppedCallsTimeout'];this[_0xf0a9('0x35')]=_0x4ecd0c['predictiveIntervalErlangCalls'];this[_0xf0a9('0x36')]=_0x4ecd0c[_0xf0a9('0x36')];this[_0xf0a9('0x37')]=_0x4ecd0c[_0xf0a9('0x37')];this[_0xf0a9('0x38')]=_0x4ecd0c[_0xf0a9('0x38')];this['predictiveIntervalPauses']=_0x4ecd0c[_0xf0a9('0x39')];this['predictiveIntervalAvailable']=_0x4ecd0c[_0xf0a9('0x3a')];this[_0xf0a9('0x3b')]=_0x4ecd0c[_0xf0a9('0x3b')];this[_0xf0a9('0x4')]=_0x4ecd0c[_0xf0a9('0x4')];this[_0xf0a9('0x3c')]=_0x4ecd0c[_0xf0a9('0x3c')];this[_0xf0a9('0x3d')]=_0x4ecd0c['erlangCallToSecond'];this['erlangAbandonmentRate']=_0x4ecd0c[_0xf0a9('0x3e')];this['erlangBusyFactor']=_0x4ecd0c[_0xf0a9('0x3f')];this[_0xf0a9('0x40')]=_0x4ecd0c[_0xf0a9('0x40')];this['startProgressive']=_0x4ecd0c[_0xf0a9('0x41')];this[_0xf0a9('0x42')]=_0x4ecd0c[_0xf0a9('0x42')];this[_0xf0a9('0x43')]=_0x4ecd0c[_0xf0a9('0x43')];}if(_0x4ecd0c['Trunk']){this['Trunk']={'id':_0x4ecd0c[_0xf0a9('0x44')]['id'],'name':_0x4ecd0c['Trunk'][_0xf0a9('0x11')],'active':_0x4ecd0c[_0xf0a9('0x44')][_0xf0a9('0x45')],'callerid':_0x4ecd0c[_0xf0a9('0x44')]['callerid']};}}VoiceQueueSummary[_0xf0a9('0x46')][_0xf0a9('0x47')]=function(_0x39978a,_0x27979f,_0xbfb1cc,_0x3f87d6){this[_0xf0a9('0x1')]=0x0;this[_0xf0a9('0x2')]=0x0;this[_0xf0a9('0x19')]=0x0;this[_0xf0a9('0x1f')]=0x0;this['notInUse']=0x0;this['inUse']=0x0;this['busy']=0x0;this[_0xf0a9('0x16')]=0x0;this[_0xf0a9('0x1e')]=0x0;this[_0xf0a9('0x1a')]=0x0;this[_0xf0a9('0x1b')]=0x0;this[_0xf0a9('0x17')]=0x0;if(_0xbfb1cc){if(_0xbfb1cc[_0xf0a9('0x3')]){this[_0xf0a9('0x3')]=Number(_0xbfb1cc[_0xf0a9('0x3')]);}if(_0xbfb1cc[_0xf0a9('0x48')]){this[_0xf0a9('0x0')]=Number(_0xbfb1cc[_0xf0a9('0x48')]);}if(_0xbfb1cc[_0xf0a9('0x49')]){this['waiting']=Number(_0xbfb1cc['callers']);}}for(var _0x2cd881=0x0;_0x2cd881<_0x39978a[_0xf0a9('0x4a')];_0x2cd881++){var _0x10fb4e=_0x27979f[_0xf0a9('0x4b')+_0x39978a[_0x2cd881]['name']];if(_0x10fb4e&&_0x10fb4e[_0xf0a9('0x4c')]){this[_0xf0a9('0x1')]+=0x1;}if(_0x39978a[_0x2cd881][_0xf0a9('0x4d')]==='1'){this[_0xf0a9('0x2')]+=0x1;}if(_0x39978a[_0x2cd881][_0xf0a9('0x19')]==='1'&&!['2','7','8'][_0xf0a9('0x4e')](_0x39978a[_0x2cd881][_0xf0a9('0x4f')])){this[_0xf0a9('0x19')]+=0x1;}switch(_0x39978a[_0x2cd881]['status']){case'0':this['unknown']+=0x1;break;case'1':this[_0xf0a9('0x18')]+=0x1;break;case'2':this[_0xf0a9('0x15')]+=0x1;break;case'3':this[_0xf0a9('0x14')]+=0x1;break;case'4':this[_0xf0a9('0x16')]+=0x1;break;case'5':this[_0xf0a9('0x1e')]+=0x1;break;case'6':this['ringing']+=0x1;break;case'7':this['ringInUse']+=0x1;break;case'8':this[_0xf0a9('0x17')]+=0x1;break;}}if(this[_0xf0a9('0x22')]===_0xf0a9('0x50')){var _0x1cf00e=Object[_0xf0a9('0x51')](_0x3f87d6);for(var _0x292a9e=0x0;_0x292a9e<_0x1cf00e[_0xf0a9('0x4a')];_0x292a9e++){var _0x584d2e=_0x1cf00e[_0x292a9e];var _0x2a2fdd=_0x3f87d6[_0x584d2e];if(_0x2a2fdd[_0xf0a9('0x52')]===this[_0xf0a9('0x11')]&&_0x2a2fdd[_0xf0a9('0x1d')]===_0xf0a9('0x53')&&_0x2a2fdd['exten']===_0xf0a9('0x54')){this[_0xf0a9('0x2')]+=0x1;}}if(this[_0xf0a9('0x2')]>this[_0xf0a9('0x15')]){this[_0xf0a9('0x2')]=this[_0xf0a9('0x15')];}this['pTalking']=0x0;}return this;};VoiceQueueSummary[_0xf0a9('0x46')][_0xf0a9('0x55')]=function(_0x4cb976){var _0x51e847=![];if(_0x4cb976){_0x51e847=INBOUND_COUNTERS[_0xf0a9('0x56')](function(_0x240b1b){return this[_0x240b1b]!==_0x4cb976[_0x240b1b];},this);}return _0x51e847;};VoiceQueueSummary['prototype'][_0xf0a9('0x57')]=function(_0x2ab20c){var _0x2ee2a6=![];var _0x269731=![];var _0x54fe07=![];if(_0x2ab20c){_0x2ee2a6=this[_0xf0a9('0x22')]!==_0x2ab20c[_0xf0a9('0x22')]||this[_0xf0a9('0x21')]!==_0x2ab20c[_0xf0a9('0x21')]||this[_0xf0a9('0x42')]!==_0x2ab20c[_0xf0a9('0x42')]||this['statusMessage']!==_0x2ab20c['statusMessage'];_0x269731=OUTBOUND_COUNTERS[_0xf0a9('0x56')](function(_0x6828e0){return this[_0x6828e0]!==_0x2ab20c[_0x6828e0];},this);if(this[_0xf0a9('0x44')]&&_0x2ab20c['Trunk']){_0x54fe07=this[_0xf0a9('0x44')][_0xf0a9('0x11')]!==_0x2ab20c[_0xf0a9('0x44')]['name']||this['Trunk'][_0xf0a9('0x45')]!==_0x2ab20c['Trunk'][_0xf0a9('0x45')];}}return _0x2ee2a6||_0x269731||_0x54fe07;};VoiceQueueSummary[_0xf0a9('0x46')]['updateReportFromOutboundQueue']=function(_0x59f7c1){this[_0xf0a9('0x13')]=_0x59f7c1[_0xf0a9('0x13')];this[_0xf0a9('0x42')]=_0x59f7c1[_0xf0a9('0x42')];this[_0xf0a9('0x43')]=_0x59f7c1[_0xf0a9('0x43')];this[_0xf0a9('0x4')]=_0x59f7c1['originated'];this[_0xf0a9('0x5')]=_0x59f7c1['outboundAbandonedCallsDay'];this['outboundAnswerCallsDay']=_0x59f7c1[_0xf0a9('0x29')];this[_0xf0a9('0x6')]=_0x59f7c1['outboundBlacklistCallsDay'];this[_0xf0a9('0x2a')]=_0x59f7c1[_0xf0a9('0x2a')];this[_0xf0a9('0x7')]=_0x59f7c1[_0xf0a9('0x7')];this[_0xf0a9('0x8')]=_0x59f7c1[_0xf0a9('0x8')];this[_0xf0a9('0x2e')]=_0x59f7c1['outboundNoSuchCallsDay'];this[_0xf0a9('0x9')]=_0x59f7c1[_0xf0a9('0x9')];this[_0xf0a9('0xa')]=_0x59f7c1[_0xf0a9('0xa')];this[_0xf0a9('0xb')]=_0x59f7c1[_0xf0a9('0xb')];this['sumBillable']=_0x59f7c1[_0xf0a9('0xd')];this[_0xf0a9('0xe')]=_0x59f7c1[_0xf0a9('0xe')];this['total']=_0x59f7c1[_0xf0a9('0xf')];if(this[_0xf0a9('0x22')]===_0xf0a9('0x58')){this[_0xf0a9('0xc')]=_0x59f7c1[_0xf0a9('0xc')];}};module['exports']=VoiceQueueSummary; \ No newline at end of file +var _0x72a2=['exports','loggedIn','loggedInDb','paused','ringing','talking','available','inUse','outboundAbandonedCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundRejectCallsDay','pTalking','sumBillable','waiting','name','strategy','abandoned','answered','busy','onHold','notInUse','ringInUse','sumDuration','sumHoldTime','total','type','unavailable','unknown','unmanaged','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','message','statusMessage','Trunk','active','callerid','prototype','createReport','invalid','loggedin','callers','length','online','status','booked','queue','dialer','exten','xcally-motion-preview','some','updateReportFromOutboundQueue','outboundCongestionCallsDay','preview'];(function(_0x34b87f,_0x28aef2){var _0x449805=function(_0x3735b7){while(--_0x3735b7){_0x34b87f['push'](_0x34b87f['shift']());}};_0x449805(++_0x28aef2);}(_0x72a2,0x161));var _0x272a=function(_0x38a166,_0x2fb80){_0x38a166=_0x38a166-0x0;var _0x59f6c2=_0x72a2[_0x38a166];return _0x59f6c2;};'use strict';var INBOUND_COUNTERS=['available',_0x272a('0x0'),_0x272a('0x1'),_0x272a('0x2'),_0x272a('0x3'),_0x272a('0x4'),'waiting'];var OUTBOUND_COUNTERS=[_0x272a('0x5'),'answered',_0x272a('0x6'),'loggedIn','loggedInDb','originated',_0x272a('0x7'),_0x272a('0x8'),_0x272a('0x9'),_0x272a('0xa'),'outboundCongestionCallsDay','outboundNoAnswerCallsDay',_0x272a('0xb'),'outboundReCallsDay',_0x272a('0xc'),'outboundUnknownCallsDay',_0x272a('0x2'),_0x272a('0xd'),_0x272a('0x4'),_0x272a('0xe'),'sumDuration','total',_0x272a('0xf')];function VoiceQueueSummary(_0x145320){this['id']=_0x145320['id'];this['name']=_0x145320[_0x272a('0x10')];this[_0x272a('0x11')]=_0x145320[_0x272a('0x11')];this[_0x272a('0x12')]=_0x145320[_0x272a('0x12')]||0x0;this['answered']=_0x145320[_0x272a('0x13')]||0x0;this[_0x272a('0x5')]=_0x145320[_0x272a('0x5')]||0x0;this[_0x272a('0x14')]=_0x145320['busy']||0x0;this[_0x272a('0x6')]=_0x145320[_0x272a('0x6')]||0x0;this['invalid']=_0x145320['invalid']||0x0;this['loggedIn']=_0x145320['loggedIn']||0x0;this['loggedInDb']=_0x145320['loggedInDb']||0x0;this[_0x272a('0x15')]=_0x145320['onHold']||0x0;this[_0x272a('0x16')]=_0x145320[_0x272a('0x16')]||0x0;this[_0x272a('0x2')]=_0x145320[_0x272a('0x2')]||0x0;this['ringing']=_0x145320[_0x272a('0x3')]||0x0;this[_0x272a('0x17')]=_0x145320[_0x272a('0x17')];this[_0x272a('0xe')]=_0x145320[_0x272a('0xe')];this[_0x272a('0x18')]=_0x145320[_0x272a('0x18')];this['sumHoldTime']=_0x145320[_0x272a('0x19')]||0x0;this[_0x272a('0x4')]=_0x145320[_0x272a('0x4')]||0x0;this[_0x272a('0x1a')]=_0x145320[_0x272a('0x1a')]||0x0;this[_0x272a('0x1b')]=_0x145320['type'];this[_0x272a('0x1c')]=_0x145320['unavailable']||0x0;this[_0x272a('0x1d')]=_0x145320['unknown']||0x0;this[_0x272a('0x1e')]=_0x145320['unmanaged']||0x0;this[_0x272a('0xf')]=_0x145320[_0x272a('0xf')]||0x0;if(_0x145320[_0x272a('0x1b')]===_0x272a('0x1f')){this[_0x272a('0xd')]=_0x145320[_0x272a('0xd')]||0x0;this[_0x272a('0x20')]=_0x145320[_0x272a('0x20')];this[_0x272a('0x21')]=_0x145320['dialMethod'];this[_0x272a('0x22')]=_0x145320[_0x272a('0x22')];this[_0x272a('0x23')]=_0x145320[_0x272a('0x23')];this[_0x272a('0x24')]=_0x145320['dialOriginateTimeout'];this['dialPrefix']=_0x145320[_0x272a('0x25')];this[_0x272a('0x26')]=_0x145320[_0x272a('0x26')];this[_0x272a('0x27')]=_0x145320[_0x272a('0x27')];this[_0x272a('0x8')]=_0x145320[_0x272a('0x8')];this[_0x272a('0x9')]=_0x145320[_0x272a('0x9')];this[_0x272a('0xa')]=_0x145320[_0x272a('0xa')];this['outboundCongestionCallsDay']=_0x145320['outboundCongestionCallsDay'];this['outboundDropCallsDayACS']=_0x145320[_0x272a('0x28')];this['outboundDropCallsDayCallersExit']=_0x145320[_0x272a('0x29')];this[_0x272a('0x2a')]=_0x145320['outboundDropCallsDayTimeout'];this[_0x272a('0x2b')]=_0x145320[_0x272a('0x2b')];this[_0x272a('0xb')]=_0x145320[_0x272a('0xb')];this[_0x272a('0x2c')]=_0x145320[_0x272a('0x2c')];this[_0x272a('0x2d')]=_0x145320[_0x272a('0x2d')];this['outboundRejectCallsDay']=_0x145320[_0x272a('0xc')];this[_0x272a('0x2e')]=_0x145320[_0x272a('0x2e')];this['predictiveIntervalAnsweredCalls']=_0x145320[_0x272a('0x2f')];this['predictiveIntervalAvgHoldtime']=_0x145320['predictiveIntervalAvgHoldtime'];this[_0x272a('0x30')]=_0x145320['predictiveIntervalAvgTalktime'];this[_0x272a('0x31')]=_0x145320[_0x272a('0x31')];this[_0x272a('0x32')]=_0x145320[_0x272a('0x32')];this[_0x272a('0x33')]=_0x145320[_0x272a('0x33')];this['predictiveIntervalErlangCallsDroppedCalls']=_0x145320[_0x272a('0x34')];this[_0x272a('0x35')]=_0x145320[_0x272a('0x35')];this[_0x272a('0x36')]=_0x145320[_0x272a('0x36')];this[_0x272a('0x37')]=_0x145320[_0x272a('0x37')];this['predictiveIntervalAvailable']=_0x145320[_0x272a('0x38')];this[_0x272a('0x39')]=_0x145320[_0x272a('0x39')];this[_0x272a('0x3a')]=_0x145320[_0x272a('0x3a')];this[_0x272a('0x3b')]=_0x145320['erlangCalls'];this['erlangCallToSecond']=_0x145320[_0x272a('0x3c')];this[_0x272a('0x3d')]=_0x145320[_0x272a('0x3d')];this[_0x272a('0x3e')]=_0x145320[_0x272a('0x3e')];this[_0x272a('0x3f')]=_0x145320[_0x272a('0x3f')];this[_0x272a('0x40')]=_0x145320[_0x272a('0x40')];this[_0x272a('0x41')]=_0x145320[_0x272a('0x41')];this[_0x272a('0x42')]=_0x145320[_0x272a('0x42')];}if(_0x145320[_0x272a('0x43')]){this[_0x272a('0x43')]={'id':_0x145320['Trunk']['id'],'name':_0x145320[_0x272a('0x43')][_0x272a('0x10')],'active':_0x145320['Trunk'][_0x272a('0x44')],'callerid':_0x145320[_0x272a('0x43')][_0x272a('0x45')]};}}VoiceQueueSummary[_0x272a('0x46')][_0x272a('0x47')]=function(_0x357712,_0x336f37,_0x52e45e,_0x24ad25){this[_0x272a('0x1')]=0x0;this['talking']=0x0;this['paused']=0x0;this[_0x272a('0x1d')]=0x0;this['notInUse']=0x0;this[_0x272a('0x6')]=0x0;this[_0x272a('0x14')]=0x0;this[_0x272a('0x48')]=0x0;this[_0x272a('0x1c')]=0x0;this[_0x272a('0x3')]=0x0;this[_0x272a('0x17')]=0x0;this['onHold']=0x0;if(_0x52e45e){if(_0x52e45e[_0x272a('0x5')]){this[_0x272a('0x5')]=Number(_0x52e45e['available']);}if(_0x52e45e[_0x272a('0x49')]){this[_0x272a('0x0')]=Number(_0x52e45e['loggedin']);}if(_0x52e45e[_0x272a('0x4a')]){this[_0x272a('0xf')]=Number(_0x52e45e[_0x272a('0x4a')]);}}for(var _0x1ccd57=0x0;_0x1ccd57<_0x357712[_0x272a('0x4b')];_0x1ccd57++){var _0x1287ff=_0x336f37['SIP/'+_0x357712[_0x1ccd57][_0x272a('0x10')]];if(_0x1287ff&&_0x1287ff[_0x272a('0x4c')]){this[_0x272a('0x1')]+=0x1;}if(_0x357712[_0x1ccd57]['incall']==='1'){this[_0x272a('0x4')]+=0x1;}if(_0x357712[_0x1ccd57][_0x272a('0x2')]==='1'&&!['2','7','8']['includes'](_0x357712[_0x1ccd57][_0x272a('0x4d')])){this[_0x272a('0x2')]+=0x1;}switch(_0x357712[_0x1ccd57][_0x272a('0x4d')]){case'0':this[_0x272a('0x1d')]+=0x1;break;case'1':this[_0x272a('0x16')]+=0x1;break;case'2':this[_0x272a('0x6')]+=0x1;break;case'3':this[_0x272a('0x14')]+=0x1;break;case'4':this['invalid']+=0x1;break;case'5':this['unavailable']+=0x1;break;case'6':this['ringing']+=0x1;break;case'7':this['ringInUse']+=0x1;break;case'8':this[_0x272a('0x15')]+=0x1;break;}}if(this[_0x272a('0x21')]===_0x272a('0x4e')){var _0x6704b0=Object['keys'](_0x24ad25);for(var _0x96d803=0x0;_0x96d803<_0x6704b0[_0x272a('0x4b')];_0x96d803++){var _0x55fab9=_0x6704b0[_0x96d803];var _0x8eb385=_0x24ad25[_0x55fab9];if(_0x8eb385[_0x272a('0x4f')]===this[_0x272a('0x10')]&&_0x8eb385[_0x272a('0x1b')]===_0x272a('0x50')&&_0x8eb385[_0x272a('0x51')]===_0x272a('0x52')){this[_0x272a('0x4')]+=0x1;}}if(this[_0x272a('0x4')]>this[_0x272a('0x6')]){this[_0x272a('0x4')]=this['inUse'];}this['pTalking']=0x0;}return this;};VoiceQueueSummary[_0x272a('0x46')]['compareToInboundQueue']=function(_0x230100){var _0x3e183a=![];if(_0x230100){_0x3e183a=INBOUND_COUNTERS[_0x272a('0x53')](function(_0xc9e362){return this[_0xc9e362]!==_0x230100[_0xc9e362];},this);}return _0x3e183a;};VoiceQueueSummary[_0x272a('0x46')]['compareToOutboundQueue']=function(_0x490427){var _0x429a5a=![];var _0x5822cb=![];var _0x36e154=![];if(_0x490427){_0x429a5a=this[_0x272a('0x21')]!==_0x490427[_0x272a('0x21')]||this[_0x272a('0x20')]!==_0x490427[_0x272a('0x20')]||this[_0x272a('0x41')]!==_0x490427['message']||this[_0x272a('0x42')]!==_0x490427['statusMessage'];_0x5822cb=OUTBOUND_COUNTERS['some'](function(_0x2177fe){return this[_0x2177fe]!==_0x490427[_0x2177fe];},this);if(this['Trunk']&&_0x490427['Trunk']){_0x36e154=this[_0x272a('0x43')][_0x272a('0x10')]!==_0x490427[_0x272a('0x43')]['name']||this[_0x272a('0x43')][_0x272a('0x44')]!==_0x490427[_0x272a('0x43')]['active'];}}return _0x429a5a||_0x5822cb||_0x36e154;};VoiceQueueSummary[_0x272a('0x46')][_0x272a('0x54')]=function(_0x1d41af){this[_0x272a('0x13')]=_0x1d41af['answered'];this[_0x272a('0x41')]=_0x1d41af[_0x272a('0x41')];this[_0x272a('0x42')]=_0x1d41af[_0x272a('0x42')];this['originated']=_0x1d41af[_0x272a('0x3a')];this[_0x272a('0x7')]=_0x1d41af[_0x272a('0x7')];this[_0x272a('0x8')]=_0x1d41af[_0x272a('0x8')];this[_0x272a('0x9')]=_0x1d41af[_0x272a('0x9')];this[_0x272a('0xa')]=_0x1d41af[_0x272a('0xa')];this[_0x272a('0x55')]=_0x1d41af[_0x272a('0x55')];this['outboundNoAnswerCallsDay']=_0x1d41af[_0x272a('0x2b')];this[_0x272a('0xb')]=_0x1d41af[_0x272a('0xb')];this[_0x272a('0x2d')]=_0x1d41af[_0x272a('0x2d')];this['outboundRejectCallsDay']=_0x1d41af[_0x272a('0xc')];this[_0x272a('0x2e')]=_0x1d41af[_0x272a('0x2e')];this[_0x272a('0xe')]=_0x1d41af[_0x272a('0xe')];this[_0x272a('0x18')]=_0x1d41af[_0x272a('0x18')];this[_0x272a('0x1a')]=_0x1d41af[_0x272a('0x1a')];if(this[_0x272a('0x21')]===_0x272a('0x56')){this['pTalking']=_0x1d41af['pTalking'];}};module[_0x272a('0x57')]=VoiceQueueSummary; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index 1b249d7..35ce134 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 _0x2530=['username','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x2530,0x107));var _0x0253=function(_0x42de85,_0x3ea9a9){_0x42de85=_0x42de85-0x0;var _0x5dfa56=_0x2530[_0x42de85];return _0x5dfa56;};'use strict';function VtigerAccount(_0x3c0fb4){this['id']=_0x3c0fb4['id']||0x0;this[_0x0253('0x0')]=_0x3c0fb4[_0x0253('0x0')]||'';this[_0x0253('0x1')]=_0x3c0fb4[_0x0253('0x1')]||'';this['accessKey']=_0x3c0fb4['accessKey']||'';this['remoteUri']=_0x3c0fb4[_0x0253('0x2')]||'';this[_0x0253('0x3')]=_0x3c0fb4[_0x0253('0x3')]||'';this[_0x0253('0x4')]=_0x3c0fb4['Configurations']||{};}module[_0x0253('0x5')]=VtigerAccount; \ No newline at end of file +var _0x18ee=['accessKey','remoteUri','serverUrl','Configurations','exports','username'];(function(_0x24b00f,_0x5cb40c){var _0x2d816d=function(_0x59f49c){while(--_0x59f49c){_0x24b00f['push'](_0x24b00f['shift']());}};_0x2d816d(++_0x5cb40c);}(_0x18ee,0xa1));var _0xe18e=function(_0x3135b2,_0x57f4c3){_0x3135b2=_0x3135b2-0x0;var _0xe7e77c=_0x18ee[_0x3135b2];return _0xe7e77c;};'use strict';function VtigerAccount(_0x340258){this['id']=_0x340258['id']||0x0;this['name']=_0x340258['name']||'';this[_0xe18e('0x0')]=_0x340258[_0xe18e('0x0')]||'';this[_0xe18e('0x1')]=_0x340258[_0xe18e('0x1')]||'';this[_0xe18e('0x2')]=_0x340258[_0xe18e('0x2')]||'';this[_0xe18e('0x3')]=_0x340258[_0xe18e('0x3')]||'';this[_0xe18e('0x4')]=_0x340258['Configurations']||{};}module[_0xe18e('0x5')]=VtigerAccount; \ No newline at end of file diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js index da2e7e9..bcc88e5 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 _0x6c65=['authType','type','integrationTab','serverUrl','Configurations','exports','name','username','password','token','remoteUri'];(function(_0x498ceb,_0x5e0184){var _0x367699=function(_0x165a35){while(--_0x165a35){_0x498ceb['push'](_0x498ceb['shift']());}};_0x367699(++_0x5e0184);}(_0x6c65,0x10e));var _0x56c6=function(_0x483afe,_0x4f6d9c){_0x483afe=_0x483afe-0x0;var _0x2303e5=_0x6c65[_0x483afe];return _0x2303e5;};'use strict';function ZendeskAccount(_0x188582){this['id']=_0x188582['id']||0x0;this[_0x56c6('0x0')]=_0x188582[_0x56c6('0x0')]||'';this[_0x56c6('0x1')]=_0x188582['username']||'';this[_0x56c6('0x2')]=_0x188582['password']||'';this[_0x56c6('0x3')]=_0x188582[_0x56c6('0x3')]||'';this[_0x56c6('0x4')]=_0x188582[_0x56c6('0x4')]||'';this[_0x56c6('0x5')]=_0x188582[_0x56c6('0x5')]||'';this[_0x56c6('0x6')]=_0x188582[_0x56c6('0x6')]||_0x56c6('0x7');this[_0x56c6('0x8')]=_0x188582['serverUrl']||'';this['Configurations']=_0x188582[_0x56c6('0x9')]||{};}module[_0x56c6('0xa')]=ZendeskAccount; \ No newline at end of file +var _0x4416=['Configurations','name','username','password','token','remoteUri','authType','type','integrationTab','serverUrl'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x4416,0x1b9));var _0x6441=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0x4416[_0x32f7d7];return _0x133d09;};'use strict';function ZendeskAccount(_0x2091aa){this['id']=_0x2091aa['id']||0x0;this[_0x6441('0x0')]=_0x2091aa[_0x6441('0x0')]||'';this[_0x6441('0x1')]=_0x2091aa[_0x6441('0x1')]||'';this['password']=_0x2091aa[_0x6441('0x2')]||'';this[_0x6441('0x3')]=_0x2091aa[_0x6441('0x3')]||'';this[_0x6441('0x4')]=_0x2091aa[_0x6441('0x4')]||'';this['authType']=_0x2091aa[_0x6441('0x5')]||'';this[_0x6441('0x6')]=_0x2091aa[_0x6441('0x6')]||_0x6441('0x7');this[_0x6441('0x8')]=_0x2091aa[_0x6441('0x8')]||'';this[_0x6441('0x9')]=_0x2091aa[_0x6441('0x9')]||{};}module['exports']=ZendeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index 8b37818..74ab333 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 _0x967f=['name','description','host','zone','clientId','clientSecret','serverUrl','code','refreshToken','Configurations','exports'];(function(_0x4b47fa,_0x5816d1){var _0x49fb27=function(_0x31d1a9){while(--_0x31d1a9){_0x4b47fa['push'](_0x4b47fa['shift']());}};_0x49fb27(++_0x5816d1);}(_0x967f,0xd1));var _0xf967=function(_0x45557e,_0x15c22c){_0x45557e=_0x45557e-0x0;var _0x2a468e=_0x967f[_0x45557e];return _0x2a468e;};'use strict';function ZohoAccount(_0xa7a2bc){this['id']=_0xa7a2bc['id']||0x0;this[_0xf967('0x0')]=_0xa7a2bc[_0xf967('0x0')]||'';this['description']=_0xa7a2bc[_0xf967('0x1')]||'';this[_0xf967('0x2')]=_0xa7a2bc[_0xf967('0x2')]||'';this[_0xf967('0x3')]=_0xa7a2bc[_0xf967('0x3')]||'';this[_0xf967('0x4')]=_0xa7a2bc[_0xf967('0x4')]||'';this[_0xf967('0x5')]=_0xa7a2bc[_0xf967('0x5')]||'';this[_0xf967('0x6')]=_0xa7a2bc[_0xf967('0x6')]||'';this[_0xf967('0x7')]=_0xa7a2bc[_0xf967('0x7')]||'';this[_0xf967('0x8')]=_0xa7a2bc[_0xf967('0x8')]||'';this['Configurations']=_0xa7a2bc[_0xf967('0x9')]||{};}module[_0xf967('0xa')]=ZohoAccount; \ No newline at end of file +var _0x6e43=['clientSecret','serverUrl','code','refreshToken','Configurations','exports','name','description','host','zone'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x6e43,0xe2));var _0x36e4=function(_0x25d5e5,_0x19352e){_0x25d5e5=_0x25d5e5-0x0;var _0xc10280=_0x6e43[_0x25d5e5];return _0xc10280;};'use strict';function ZohoAccount(_0x504634){this['id']=_0x504634['id']||0x0;this[_0x36e4('0x0')]=_0x504634['name']||'';this[_0x36e4('0x1')]=_0x504634[_0x36e4('0x1')]||'';this[_0x36e4('0x2')]=_0x504634['host']||'';this[_0x36e4('0x3')]=_0x504634[_0x36e4('0x3')]||'';this['clientId']=_0x504634['clientId']||'';this[_0x36e4('0x4')]=_0x504634[_0x36e4('0x4')]||'';this[_0x36e4('0x5')]=_0x504634[_0x36e4('0x5')]||'';this[_0x36e4('0x6')]=_0x504634[_0x36e4('0x6')]||'';this[_0x36e4('0x7')]=_0x504634[_0x36e4('0x7')]||'';this[_0x36e4('0x8')]=_0x504634['Configurations']||{};}module[_0x36e4('0x9')]=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index 936df79..09616cf 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 _0xcf66=['membername','calleridname','Contact','phone','active','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','getCaller','number','exports','util','lodash','moment','string','isNil','uniqueid','idContact','queue','name','type','dialAnswer','Agent','SIP/%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcf66,0x71));var _0x6cf6=function(_0x325681,_0x1ead05){_0x325681=_0x325681-0x0;var _0x198068=_0xcf66[_0x325681];return _0x198068;};'use strict';var util=require(_0x6cf6('0x0'));var _=require(_0x6cf6('0x1'));var moment=require(_0x6cf6('0x2'));function checkNameSurname(_0x56f1fd,_0x7ed4c0,_0x1af283){var _0x49ce88='';if(!_['isNil'](_0x7ed4c0)&&_0x6cf6('0x3')===typeof _0x7ed4c0){_0x49ce88+=_0x7ed4c0;}if(!_[_0x6cf6('0x4')](_0x1af283)&&'string'===typeof _0x1af283){_0x49ce88+='\x20'+_0x1af283;}if(_0x49ce88!==''){return _0x49ce88;}return _0x56f1fd;}function Action(_0x39f1d6,_0x1fbedd,_0x2a573e,_0x5eb082,_0x94c6a9){this[_0x6cf6('0x5')]=_0x2a573e||undefined;this[_0x6cf6('0x6')]=_0x39f1d6['id'];this[_0x6cf6('0x7')]=_0x1fbedd[_0x6cf6('0x8')];this[_0x6cf6('0x9')]=_0x1fbedd['type'];this['campaigntype']='queue';this[_0x6cf6('0xa')]=![];this['membername']=_[_0x6cf6('0x4')](_0x39f1d6[_0x6cf6('0xb')])?undefined:_0x39f1d6[_0x6cf6('0xb')][_0x6cf6('0x8')];this['channelAgent']=this['membername']?util['format'](_0x6cf6('0xc'),this[_0x6cf6('0xd')]):_0x5eb082||undefined;this[_0x6cf6('0xe')]=checkNameSurname(_0x39f1d6[_0x6cf6('0xf')][_0x6cf6('0x10')],_0x39f1d6[_0x6cf6('0xf')]['firstName'],_0x39f1d6[_0x6cf6('0xf')]['lastName']);this[_0x6cf6('0x11')]=_0x39f1d6[_0x6cf6('0x11')]||![];this['calleridnum']=_0x39f1d6[_0x6cf6('0x10')];this[_0x6cf6('0x12')]=_0x39f1d6[_0x6cf6('0x12')];this[_0x6cf6('0x13')]=_0x39f1d6[_0x6cf6('0x13')]||0x0;this[_0x6cf6('0x14')]=_0x39f1d6[_0x6cf6('0x14')]||0x0;this[_0x6cf6('0x15')]=_0x39f1d6[_0x6cf6('0x15')]||0x0;this[_0x6cf6('0x16')]=(_0x39f1d6['countbusyretry']||0x0)+(_0x39f1d6[_0x6cf6('0x14')]||0x0)+(_0x39f1d6[_0x6cf6('0x15')]||0x0)+(_0x39f1d6[_0x6cf6('0x17')]||0x0)+(_0x39f1d6['countdropretry']||0x0)+(_0x39f1d6[_0x6cf6('0x18')]||0x0)+(_0x39f1d6[_0x6cf6('0x19')]||0x0)+(_0x39f1d6[_0x6cf6('0x1a')]||0x0);this[_0x6cf6('0x17')]=_0x39f1d6[_0x6cf6('0x17')]||0x0;this[_0x6cf6('0x1b')]=_0x39f1d6[_0x6cf6('0x1b')]||0x0;this['countabandonedretry']=_0x39f1d6[_0x6cf6('0x18')]||0x0;this[_0x6cf6('0x19')]=_0x39f1d6[_0x6cf6('0x19')]||0x0;this[_0x6cf6('0x1a')]=_0x39f1d6[_0x6cf6('0x1a')]||0x0;this[_0x6cf6('0x1c')]=_0x39f1d6[_0x6cf6('0x1c')];this[_0x6cf6('0x1d')]=_0x39f1d6['callbackuniqueid'];this['callbackat']=_0x39f1d6[_0x6cf6('0x1e')];this['recallme']=_0x39f1d6[_0x6cf6('0x1f')];this[_0x6cf6('0x20')]=_0x39f1d6[_0x6cf6('0x20')];this[_0x6cf6('0x21')]=_0x39f1d6[_0x6cf6('0x21')];this[_0x6cf6('0x22')]=_[_0x6cf6('0x4')](_0x39f1d6['Agent'])?_0x39f1d6[_0x6cf6('0x22')]:_0x39f1d6[_0x6cf6('0xb')]['id'];this[_0x6cf6('0x23')]=_0x39f1d6['VoiceQueueId'];this[_0x6cf6('0x24')]='';this[_0x6cf6('0x25')]='';}Action[_0x6cf6('0x26')][_0x6cf6('0x27')]=function(){return util['format']('\x22%s\x22\x20<%s>',this[_0x6cf6('0xe')],this[_0x6cf6('0x28')]);};module[_0x6cf6('0x29')]=Action; \ No newline at end of file +var _0x5430=['ContactId','ListId','UserId','isNil','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','\x22%s\x22\x20<%s>','number','util','lodash','moment','string','idContact','queue','name','type','campaigntype','dialAnswer','membername','Agent','channelAgent','format','SIP/%s','calleridname','Contact','phone','lastName','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countmachineretry','countagentrejectretry','countdropretry','countabandonedretry','callback','callbackuniqueid','recallme'];(function(_0x15a5c1,_0x177ad3){var _0x19cb2e=function(_0xacdb01){while(--_0xacdb01){_0x15a5c1['push'](_0x15a5c1['shift']());}};_0x19cb2e(++_0x177ad3);}(_0x5430,0x10c));var _0x0543=function(_0x4971ae,_0x38df33){_0x4971ae=_0x4971ae-0x0;var _0x4683dc=_0x5430[_0x4971ae];return _0x4683dc;};'use strict';var util=require(_0x0543('0x0'));var _=require(_0x0543('0x1'));var moment=require(_0x0543('0x2'));function checkNameSurname(_0x4078bf,_0x114bf2,_0x3b93d7){var _0x5518f8='';if(!_['isNil'](_0x114bf2)&&_0x0543('0x3')===typeof _0x114bf2){_0x5518f8+=_0x114bf2;}if(!_['isNil'](_0x3b93d7)&&'string'===typeof _0x3b93d7){_0x5518f8+='\x20'+_0x3b93d7;}if(_0x5518f8!==''){return _0x5518f8;}return _0x4078bf;}function Action(_0xce0b65,_0x45b909,_0x9754ba,_0x319568,_0x46bca7){this['uniqueid']=_0x9754ba||undefined;this[_0x0543('0x4')]=_0xce0b65['id'];this[_0x0543('0x5')]=_0x45b909[_0x0543('0x6')];this[_0x0543('0x7')]=_0x45b909[_0x0543('0x7')];this[_0x0543('0x8')]='queue';this[_0x0543('0x9')]=![];this[_0x0543('0xa')]=_['isNil'](_0xce0b65[_0x0543('0xb')])?undefined:_0xce0b65[_0x0543('0xb')][_0x0543('0x6')];this[_0x0543('0xc')]=this[_0x0543('0xa')]?util[_0x0543('0xd')](_0x0543('0xe'),this[_0x0543('0xa')]):_0x319568||undefined;this[_0x0543('0xf')]=checkNameSurname(_0xce0b65[_0x0543('0x10')][_0x0543('0x11')],_0xce0b65[_0x0543('0x10')]['firstName'],_0xce0b65[_0x0543('0x10')][_0x0543('0x12')]);this['active']=_0xce0b65['active']||![];this[_0x0543('0x13')]=_0xce0b65[_0x0543('0x11')];this[_0x0543('0x14')]=_0xce0b65[_0x0543('0x14')];this[_0x0543('0x15')]=_0xce0b65['countbusyretry']||0x0;this[_0x0543('0x16')]=_0xce0b65[_0x0543('0x16')]||0x0;this[_0x0543('0x17')]=_0xce0b65[_0x0543('0x17')]||0x0;this[_0x0543('0x18')]=(_0xce0b65[_0x0543('0x15')]||0x0)+(_0xce0b65[_0x0543('0x16')]||0x0)+(_0xce0b65['countnoanswerretry']||0x0)+(_0xce0b65[_0x0543('0x19')]||0x0)+(_0xce0b65['countdropretry']||0x0)+(_0xce0b65['countabandonedretry']||0x0)+(_0xce0b65[_0x0543('0x1a')]||0x0)+(_0xce0b65[_0x0543('0x1b')]||0x0);this[_0x0543('0x19')]=_0xce0b65['countnosuchnumberretry']||0x0;this[_0x0543('0x1c')]=_0xce0b65['countdropretry']||0x0;this[_0x0543('0x1d')]=_0xce0b65[_0x0543('0x1d')]||0x0;this['countmachineretry']=_0xce0b65[_0x0543('0x1a')]||0x0;this[_0x0543('0x1b')]=_0xce0b65[_0x0543('0x1b')]||0x0;this[_0x0543('0x1e')]=_0xce0b65[_0x0543('0x1e')];this[_0x0543('0x1f')]=_0xce0b65['callbackuniqueid'];this['callbackat']=_0xce0b65['callbackat'];this[_0x0543('0x20')]=_0xce0b65[_0x0543('0x20')];this[_0x0543('0x21')]=_0xce0b65[_0x0543('0x21')];this[_0x0543('0x22')]=_0xce0b65[_0x0543('0x22')];this[_0x0543('0x23')]=_[_0x0543('0x24')](_0xce0b65[_0x0543('0xb')])?_0xce0b65[_0x0543('0x23')]:_0xce0b65[_0x0543('0xb')]['id'];this[_0x0543('0x25')]=_0xce0b65['VoiceQueueId'];this[_0x0543('0x26')]='';this[_0x0543('0x27')]='';}Action[_0x0543('0x28')]['getCaller']=function(){return util[_0x0543('0xd')](_0x0543('0x29'),this[_0x0543('0xf')],this[_0x0543('0x2a')]);};module['exports']=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index 38ad343..5bac344 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 _0xe84a=['message','CAMPAIGN_STATUS','INACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','loopCampaigns','syncCampaigns','hasOwnProperty','dialMethod','booked','type','outbound','clearZombieChannels','dialActive','setMessage','dialPreviewAutoRecallMe','clearZombieChannel','isNil','actions','info','[clearZombieChannels][talking]','Queue','queue','originated:\x20','pTalking:\x20','dialAnswer','pick','contactId','UserId','VoiceQueueId','Action','status','channel','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','decrementTalkink','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','[action]','getContactRecallMe','agentReadyId','agents','length','getDiff','scheduledat','dialRecallMeTimeout','Agent','voicePause','run','then','logger2','catch','disableContact','starttime','outboundReCallsDay','RecallInQueue','dialRecallInQueue','createBody','[HistoryDialRecallInQueue][historyCatch]','createCustomerHistory','IsNotLoggedIn','NO_AGENTS_LOGGED','isActive','Trunk','isTrunkReachable','TrunkBackup','UNREACHABLE_TRUNK','ACTIVE','countnosuchnumberretry','countglobal','totalGlobal','logCustomer','emit','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','verifyAdditionalPhones','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','rescheduleContact','scheduledAt','unlockAgent','linkedid','idContact','incrementPreviewCounters','swapAdditionalPhones','ANSWER','responsetime','answertime','[syncHangup][talking][increment]','\x20Queue','custom:agentconnect','acw','buildAcw','custom:agentcomplete','complete','outboundAnswerCallsDay','total','[16]','Answer','[callProgressDetectingCustomer][logAnswer]','createCustomerFinal','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','[syncHangup][talking][decrement]','uniqueid','BUSY','outboundBusyCallsDay','countbusyretry','Busy','dialBusyRetryFrequency','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','additional','dialBusyMaxRetry','activeContact','NOANSWER','countnoanswerretry','dialNoAnswerRetryFrequency','custom:agentnoanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','CONGESTION','outboundCongestionCallsDay','Congestion','dialCongestionRetryFrequency','custom:agentcongestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','countcongestionretry','CANCEL','outboundRejectCallsDay','countagentrejectretry','AgentReject','dialAgentRejectRetryFrequency','custom:agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','ABANDONED','outboundAbandonedCallsDay','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','countabandonedretry','dialAbandonedRetryFrequency','countmachineretry','cause-txt','dialstatus','custom:amd','[callProgressDetectingCustomer][hangupInAMD]','outboundUnknownCallsDay','amd','[callProgressDetectingCustomer][machine]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','destlinkedid','queueSummaryCountersUpdated','callProgressDetectingAgent','object','isUndefined','reason','logAgent','NoSuchNumber','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','NoAnswer','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','[verifyAdditionalPhone]\x20','[swapAdditionalPhone]\x20','[incrementPreviewCounters]\x20','Contact\x20is\x20undefined','lookAgent','isEmpty','execCall','[Preview][execCall][success]','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','logBlacklist','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','active','SIP/%s','unmonitored','execRun','unlock','getContactPreview','recallme','isValid','checkIsBlackList','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','validateContact','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','campaign\x20Name:\x20','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','dialPrefix','dialCutDigit','phone','trim','substring','getCallerId','callerid','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','dialOriginateCallerIdName','extractCalleridName','originatecalleridnum','extractCalleridNumber','setXMDContactVariables','Contact','assign','merge','toLowerVariables','variables','variablesAction','OriginateError','[originateFailure][logOriginateFailure]','actionid','logLookAgent','clone','YYYY-MM-DD\x20HH:mm:ss','unlockContact','custom:agentringnoanswer','rejected','[syncHangup][talking]','cause','callProgressDetectingCustomer','statedesc','channelstate','transfer','[syncHangup][talking][transfer]','[syncHangup][talking][cause]','addVariable','filterKey','keys','variable','value','error','[syncVarSet][Preview]','inspect','syncAttendedTransfer','transfertargetlinkedid','syncBlindTransfer','transfererlinkedid','exports','util','lodash','uuid','moment','ioredis','../../../config/environment','../../../config/logger','preview','actionPreview','./rpcDb','./action','./util/util','redis','defaults','socket.io-emitter','prototype','tail','finally','sequence','campaignsPreview','voiceQueues','trunks','clockClearZombieChannels','originateresponse','syncOriginateResponse','hangup','syncHangup','hanguprequest','syncHangupRequest','dialend','syncDialEnd','bind','newexten','syncNewExten','varset','syncVarSet','blindtransfer','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','stringify','format','voice:queue:%s','name','voice_queue_channel:remove','sendMessageOneNotActive','originated','pTalking','available','paused'];(function(_0x7729b1,_0x468322){var _0x349504=function(_0x401cee){while(--_0x401cee){_0x7729b1['push'](_0x7729b1['shift']());}};_0x349504(++_0x468322);}(_0xe84a,0x113));var _0xae84=function(_0xc890e2,_0x18a3e1){_0xc890e2=_0xc890e2-0x0;var _0x581dff=_0xe84a[_0xc890e2];return _0x581dff;};'use strict';var util=require(_0xae84('0x0'));var _=require(_0xae84('0x1'));var uuid=require(_0xae84('0x2'));var moment=require(_0xae84('0x3'));var Redis=require(_0xae84('0x4'));var config=require(_0xae84('0x5'));var logger=require(_0xae84('0x6'))(_0xae84('0x7'));var loggerAction=require(_0xae84('0x6'))(_0xae84('0x8'));var ami=require('../ami');var rpcDb=require(_0xae84('0x9'));var cmHopperAdditionalPhone=require('../rpc/cmHopperAdditionalPhone');var Action=require(_0xae84('0xa'));var ut=require(_0xae84('0xb'));var utils=require('../dialer/utils');config[_0xae84('0xc')]=_[_0xae84('0xd')](config[_0xae84('0xc')],{'host':'localhost','port':0x18eb});var io=require(_0xae84('0xe'))(new Redis(config['redis']));var Sequence=function(){};Sequence[_0xae84('0xf')]['enqueue']=function(_0x2090e8){this['tail']=this[_0xae84('0x10')]?this[_0xae84('0x10')][_0xae84('0x11')](_0x2090e8):_0x2090e8();};function Preview(_0x2134a8){this[_0xae84('0x12')]=new Sequence();this[_0xae84('0x13')]=_0x2134a8[_0xae84('0x14')];this[_0xae84('0x15')]=_0x2134a8[_0xae84('0x15')];this['actions']={};this['agents']=_0x2134a8['agents'];this[_0xae84('0x16')]=0x0;ami['on'](_0xae84('0x17'),this[_0xae84('0x18')]['bind'](this));ami['on'](_0xae84('0x19'),this[_0xae84('0x1a')]['bind'](this));ami['on'](_0xae84('0x1b'),this[_0xae84('0x1c')]['bind'](this));ami['on'](_0xae84('0x1d'),this[_0xae84('0x1e')][_0xae84('0x1f')](this));ami['on'](_0xae84('0x20'),this[_0xae84('0x21')]['bind'](this));ami['on'](_0xae84('0x22'),this[_0xae84('0x23')][_0xae84('0x1f')](this));ami['on']('attendedtransfer',this['syncAttendedTransfer'][_0xae84('0x1f')](this));ami['on'](_0xae84('0x24'),this['syncBlindTransfer']['bind'](this));this['loopCampaigns'](this[_0xae84('0x13')]);}function emit(_0x28a395,_0x2214f2,_0x254b72){io['to'](_0x28a395)['emit'](_0x2214f2,_0x254b72);}function emitVoiceQueueChannelRemove(_0x46c8f3){logger['info'](_0xae84('0x25'),JSON[_0xae84('0x26')](_0x46c8f3));emit(util[_0xae84('0x27')](_0xae84('0x28'),_0x46c8f3[_0xae84('0x29')]),_0xae84('0x2a'),_0x46c8f3);io['emit']('voice_queue_presence:remove',_0x46c8f3);}function notSendMessagesQueue(_0x557080){if(_0x557080[_0xae84('0x2b')]){if(_0x557080[_0xae84('0x2c')]===0x0&&_0x557080[_0xae84('0x2d')]===0x0){_0x557080['sendMessageOneNotActive']=![];_0x557080[_0xae84('0x2e')]=0x0;_0x557080[_0xae84('0x2f')]=0x0;_0x557080[_0xae84('0x30')]=utils[_0xae84('0x31')][_0xae84('0x32')];ut[_0xae84('0x33')](_0xae84('0x34'),_0x557080[_0xae84('0x29')]+_0xae84('0x35'));}else{_0x557080[_0xae84('0x30')]=utils[_0xae84('0x31')]['DEACTIVATED'];ut['logger'](_0xae84('0x34'),_0x557080['name']+'\x20is\x20deactivated');}}}Preview[_0xae84('0xf')][_0xae84('0x36')]=function(){var _0x3252e6=this;setInterval(function(){_0x3252e6[_0xae84('0x37')]();},0x7cf);};Preview['prototype'][_0xae84('0x37')]=function(){var _0x390526=this[_0xae84('0x13')];this[_0xae84('0x16')]+=0x1;for(var _0x4b8cc1 in _0x390526){if(_0x390526[_0xae84('0x38')](_0x4b8cc1)&&(_0x390526[_0x4b8cc1][_0xae84('0x39')]===_0xae84('0x7')||_0x390526[_0x4b8cc1][_0xae84('0x39')]===_0xae84('0x3a'))&&_0x390526[_0x4b8cc1][_0xae84('0x3b')]===_0xae84('0x3c')){if(this['clockClearZombieChannels']>0x7){this[_0xae84('0x16')]=0x0;this[_0xae84('0x3d')]();}}if(_0x390526[_0xae84('0x38')](_0x4b8cc1)&&_0x390526[_0x4b8cc1]['dialMethod']==='preview'&&_0x390526[_0x4b8cc1][_0xae84('0x3b')]===_0xae84('0x3c')){if(_0x390526[_0x4b8cc1][_0xae84('0x3e')]){this[_0xae84('0x3f')](_0x390526[_0x4b8cc1]);if(_0x390526[_0x4b8cc1][_0xae84('0x40')])this['recallMe'](_0x390526[_0x4b8cc1]);}else{notSendMessagesQueue(_0x390526[_0x4b8cc1]);}}}};Preview['prototype'][_0xae84('0x41')]=function(_0x3da16d){var _0x33f7d0=this;this[_0xae84('0x12')]['enqueue'](function(){if(!_[_0xae84('0x42')](_0x33f7d0[_0xae84('0x43')][_0x3da16d])){loggerAction[_0xae84('0x44')](_0xae84('0x45'),_0x3da16d,_0xae84('0x46'),_0x33f7d0[_0xae84('0x43')][_0x3da16d][_0xae84('0x47')],_0xae84('0x48'),JSON[_0xae84('0x26')](_0x33f7d0[_0xae84('0x13')][_0x33f7d0[_0xae84('0x43')][_0x3da16d][_0xae84('0x47')]][_0xae84('0x2c')]),_0xae84('0x49'),JSON['stringify'](_0x33f7d0['campaignsPreview'][_0x33f7d0['actions'][_0x3da16d][_0xae84('0x47')]][_0xae84('0x2d')]),JSON['stringify'](_0x33f7d0[_0xae84('0x43')][_0x3da16d][_0xae84('0x4a')]),JSON[_0xae84('0x26')](_[_0xae84('0x4b')](_0x33f7d0['actions'][_0x3da16d],[_0xae84('0x4c'),_0xae84('0x4d'),_0xae84('0x4e'),'ListId'])));return ami[_0xae84('0x4f')]({'action':_0xae84('0x50'),'channel':_0x33f7d0[_0xae84('0x43')][_0x3da16d][_0xae84('0x51')]})['catch'](function(_0x485a1a){if(_0x485a1a[_0xae84('0x30')]===_0xae84('0x52')){setTimeout(function(){if(_0x33f7d0[_0xae84('0x43')][_0x3da16d]){ut[_0xae84('0x53')](_0x33f7d0[_0xae84('0x13')][_0x33f7d0[_0xae84('0x43')][_0x3da16d]['queue']],_0xae84('0x54'));if(_0x33f7d0[_0xae84('0x43')][_0x3da16d]['dialAnswer']===!![]){ut[_0xae84('0x55')](_0x33f7d0['campaignsPreview'][_0x33f7d0[_0xae84('0x43')][_0x3da16d][_0xae84('0x47')]],_0xae84('0x54'));ut[_0xae84('0x56')](_0xae84('0x57')+_0x3da16d,_0x33f7d0['actions'][_0x3da16d]['queue']);}ut['loggerError'](_0xae84('0x58')+_0x3da16d,_0x33f7d0[_0xae84('0x43')][_0x3da16d][_0xae84('0x47')]);delete _0x33f7d0['actions'][_0x3da16d];}},0x2328);}});}});};Preview[_0xae84('0xf')]['clearZombieChannels']=function(){var _0x54e305=this;loggerAction[_0xae84('0x44')](_0xae84('0x59'),_['size'](this[_0xae84('0x43')]));for(var _0x29aa51 in this['actions']){if(_0x54e305[_0xae84('0x43')][_0xae84('0x38')](_0x29aa51)){_0x54e305[_0xae84('0x41')](_0x29aa51);}}};Preview[_0xae84('0xf')]['recallMe']=function(_0x4182c8){var _0x3eef77=this;rpcDb[_0xae84('0x5a')](_0x4182c8['id'],ut[_0xae84('0x5b')](this[_0xae84('0x5c')]))['then'](function(_0x28a2da){if(!_['isNil'](_0x28a2da)){for(var _0x44835f=0x0;_0x44835f<_0x28a2da[_0xae84('0x5d')];_0x44835f+=0x1){if(ut[_0xae84('0x5e')](_0x28a2da[_0x44835f][_0xae84('0x5f')])<_0x4182c8[_0xae84('0x60')]*0x3c){if(_0x28a2da[_0x44835f][_0xae84('0x61')]&&!_0x28a2da[_0x44835f][_0xae84('0x61')][_0xae84('0x62')]){_0x3eef77[_0xae84('0x63')](_0x28a2da[_0x44835f]['id'])[_0xae84('0x64')](ut[_0xae84('0x65')]('[RecallMe]'))[_0xae84('0x66')](ut[_0xae84('0x65')]('[RecallMe]'));}else{rpcDb[_0xae84('0x67')](_0x28a2da[_0x44835f]['id']);}}else{var _0x12542f=new Action(_0x28a2da[_0x44835f],_0x4182c8);_0x12542f[_0xae84('0x68')]=moment()[_0xae84('0x27')]('YYYY-MM-DD\x20HH:mm:ss');_0x4182c8[_0xae84('0x69')]+=0x1;ut['logCustomer'](_0x12542f,0x17,_0xae84('0x6a'));if(_0x4182c8[_0xae84('0x6b')]){rpcDb['rescheduleContactInQueue'](ut[_0xae84('0x6c')](_0x28a2da[_0x44835f]));rpcDb['createCustomerHistory'](_0x12542f,_0xae84('0x6d'));}else{ut['logCustomer'](_0x12542f,0x16,'RecallFailedTimeout');rpcDb[_0xae84('0x6e')](_0x12542f,'[HistoryRecallClose]');rpcDb['createCustomerFinal'](_0x12542f,'[HistoryRecallClose]');}}}}})[_0xae84('0x66')](ut['logger2']('[getContactRecallMe]'));};Preview[_0xae84('0xf')][_0xae84('0x3f')]=function(_0x3c85c2){_0x3c85c2[_0xae84('0x2b')]=!![];if(ut[_0xae84('0x6f')](_0x3c85c2['loggedIn'])){_0x3c85c2['message']=utils[_0xae84('0x31')][_0xae84('0x70')];}else if(!ut[_0xae84('0x71')](_0x3c85c2[_0xae84('0x3e')])){_0x3c85c2[_0xae84('0x30')]=utils[_0xae84('0x31')][_0xae84('0x32')];}else if(!this['isTrunkReachable'](_0x3c85c2[_0xae84('0x72')])){if(!this[_0xae84('0x73')](_0x3c85c2[_0xae84('0x74')])){_0x3c85c2[_0xae84('0x30')]=utils[_0xae84('0x31')][_0xae84('0x75')];}else{_0x3c85c2[_0xae84('0x30')]=utils[_0xae84('0x31')][_0xae84('0x76')];}}else{_0x3c85c2['message']=utils[_0xae84('0x31')]['ACTIVE'];}};Preview[_0xae84('0xf')]['callProgressDetectingCustomer']=function(_0x5712d8,_0x2c18d3,_0x552322){var _0x4e57ec=this;var _0x5067e9=this[_0xae84('0x43')][_0x2c18d3];var _0x15e088=this[_0xae84('0x13')][_0x5067e9[_0xae84('0x47')]];var _0x9161df;var _0x31e379=![];var _0x160c4f=0x2;var _0x30f409=0x3;if(_0x15e088){switch(_0x552322){case'1':_0x15e088['outboundNoSuchCallsDay']+=0x1;_0x5067e9[_0xae84('0x77')]+=0x1;_0x5067e9[_0xae84('0x78')]=ut[_0xae84('0x79')](_0x5067e9);ut[_0xae84('0x7a')](_0x5067e9,0x0,'NoSuchNumber');ami[_0xae84('0x7b')]('custom:agentnosuchnumber',ut[_0xae84('0x7c')](_0x5067e9,_0xae84('0x7d')));rpcDb[_0xae84('0x6e')](_0x5067e9,_0xae84('0x7e'));_0x4e57ec[_0xae84('0x7f')](_0x5067e9,'0',_0x15e088)[_0xae84('0x64')](function(_0x18893a){_0x31e379=_0x18893a['additional']==0x1;_0x160c4f=_0x15e088['dialNoSuchNumberRetryFrequency'];_0x30f409=_0x15e088[_0xae84('0x80')];if(!_0x31e379){if(ut[_0xae84('0x79')](_0x5067e9)>=_0x15e088[_0xae84('0x81')]){_0x9161df=ut[_0xae84('0x82')](_0x5067e9,0xf,_0xae84('0x83'));rpcDb['createCustomerFinal'](_0x9161df,_0xae84('0x84'));}else{if(_0x5067e9[_0xae84('0x77')]>=_0x15e088[_0xae84('0x85')]){rpcDb['createCustomerFinal'](_0x5067e9,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{rpcDb[_0xae84('0x86')](ut[_0xae84('0x87')](_0x5067e9,'countnosuchnumberretry',_0x15e088['dialNoSuchNumberRetryFrequency']),_0x5067e9[_0xae84('0x88')],_0x5067e9['activeContact']);}}delete this[_0xae84('0x43')][_0x5712d8[_0xae84('0x89')]];}else{_0x5067e9[_0xae84('0x77')]++;logger['info']('actioncountonusuch',_0x5067e9[_0xae84('0x77')]);logger['info']('id',_0x5067e9[_0xae84('0x8a')]);_0x4e57ec[_0xae84('0x8b')]({'id':_0x5067e9[_0xae84('0x8a')],'field':{'countnosuchnumberretry':_0x5067e9[_0xae84('0x77')]}})['then'](function(){_0x4e57ec[_0xae84('0x8c')](_0x5067e9,_0x160c4f,_0x30f409)[_0xae84('0x64')](function(){});});}});break;case _0xae84('0x8d'):var _0x386ea2=moment()[_0xae84('0x27')]('YYYY-MM-DD\x20HH:mm:ss');_0x5067e9[_0xae84('0x8e')]=_0x386ea2;_0x5067e9[_0xae84('0x8f')]=_0x386ea2;_0x5067e9['dialAnswer']=!![];_0x15e088[_0xae84('0x2d')]+=0x1;logger['info'](_0xae84('0x90'),_0x5067e9['uniqueid'],_0xae84('0x91'),_0x15e088[_0xae84('0x29')],_0xae84('0x49'),_0x15e088['pTalking']);ami[_0xae84('0x7b')](_0xae84('0x92'),ut[_0xae84('0x7c')](_0x5067e9,'connect',this['campaignsPreview'][_0x5067e9[_0xae84('0x47')]]));if(_0x15e088[_0xae84('0x93')]){ami[_0xae84('0x7b')]('custom:agentConnectPreview',ut[_0xae84('0x94')](_0x5067e9));}break;case'16':ami[_0xae84('0x7b')](_0xae84('0x95'),ut[_0xae84('0x7c')](_0x5067e9,_0xae84('0x96'),this[_0xae84('0x13')][_0x5067e9['queue']]));emitVoiceQueueChannelRemove(ut[_0xae84('0x7c')](_0x5067e9,_0xae84('0x96')));_0x15e088[_0xae84('0x97')]+=0x1;_0x15e088[_0xae84('0x98')]+=0x1;_0x15e088['answered']+=0x1;ut[_0xae84('0x55')](_0x15e088,_0xae84('0x99'));_0x5067e9['countglobal']=ut[_0xae84('0x79')](_0x5067e9);ut[_0xae84('0x7a')](_0x5067e9,0x4,_0xae84('0x9a'));rpcDb['createCustomerHistory'](_0x5067e9,_0xae84('0x9b'));rpcDb[_0xae84('0x9c')](_0x5067e9,_0xae84('0x9d'));rpcDb[_0xae84('0x9e')](_0x5067e9);_0x15e088['sumDuration']+=_0x5067e9[_0xae84('0x9f')];_0x15e088['sumBillable']+=_0x5067e9[_0xae84('0x9f')];logger[_0xae84('0x44')](_0xae84('0xa0'),_0x5067e9[_0xae84('0xa1')],_0xae84('0x91'),_0x15e088[_0xae84('0x29')],_0xae84('0x49'),_0x15e088[_0xae84('0x2d')]);delete this[_0xae84('0x43')][_0x5712d8[_0xae84('0x89')]];break;case _0xae84('0xa2'):_0x15e088[_0xae84('0xa3')]+=0x1;_0x5067e9[_0xae84('0xa4')]+=0x1;_0x5067e9[_0xae84('0x78')]=ut['totalGlobal'](_0x5067e9);ut[_0xae84('0x7a')](_0x5067e9,0x5,_0xae84('0xa5'));_0x160c4f=_0x15e088[_0xae84('0xa6')];_0x30f409=_0x15e088[_0xae84('0x80')];ami['emit'](_0xae84('0xa7'),ut[_0xae84('0x7c')](_0x5067e9,_0xae84('0xa8')));rpcDb[_0xae84('0x6e')](_0x5067e9,_0xae84('0xa9'));_0x4e57ec[_0xae84('0x7f')](_0x5067e9,'5',_0x15e088)['then'](function(_0x4e7a03){_0x31e379=_0x4e7a03[_0xae84('0xaa')]==0x1;if(!_0x31e379){if(ut['totalGlobal'](_0x5067e9)>=_0x15e088[_0xae84('0x81')]){_0x9161df=ut['cloneAction'](_0x5067e9,0xf,_0xae84('0x83'));rpcDb['createCustomerFinal'](_0x9161df,'[callProgressDetectingCustomer][logBusyGlobal]');}else{if(_0x5067e9[_0xae84('0xa4')]>=_0x15e088[_0xae84('0xab')]){rpcDb[_0xae84('0x9c')](_0x5067e9,'[callProgressDetectingCustomer][logBusy]');}else{rpcDb[_0xae84('0x86')](ut[_0xae84('0x87')](_0x5067e9,_0xae84('0xa4'),_0x15e088[_0xae84('0xa6')]),_0x5067e9[_0xae84('0x88')],_0x5067e9[_0xae84('0xac')]);}}}else{_0x5067e9[_0xae84('0xa4')]++;_0x4e57ec[_0xae84('0x8b')]({'id':_0x5067e9['idContact'],'field':{'countbusyretry':_0x5067e9[_0xae84('0xa4')]}})[_0xae84('0x64')](function(){_0x4e57ec['swapAdditionalPhones'](_0x5067e9,_0x160c4f,_0x30f409)[_0xae84('0x64')](function(){});});}});break;case _0xae84('0xad'):_0x15e088['outboundNoAnswerCallsDay']+=0x1;_0x5067e9[_0xae84('0xae')]+=0x1;_0x5067e9[_0xae84('0x78')]=ut[_0xae84('0x79')](_0x5067e9);ut[_0xae84('0x7a')](_0x5067e9,0x3,'NoAnswer');_0x160c4f=_0x15e088[_0xae84('0xaf')];_0x30f409=_0x15e088[_0xae84('0x80')];var _0x32ce4c=ut['buildNoAnswerEventPayload'](_0x5067e9,_0x15e088);ami[_0xae84('0x7b')](_0xae84('0xb0'),_0x32ce4c);rpcDb[_0xae84('0x6e')](_0x5067e9,_0xae84('0xb1'));_0x4e57ec[_0xae84('0x7f')](_0x5067e9,'3',_0x15e088)[_0xae84('0x64')](function(_0x4dbd0c){_0x31e379=_0x4dbd0c[_0xae84('0xaa')]==0x1;if(!_0x31e379){if(ut['totalGlobal'](_0x5067e9)>=_0x15e088[_0xae84('0x81')]){_0x9161df=ut[_0xae84('0x82')](_0x5067e9,0xf,_0xae84('0x83'));rpcDb[_0xae84('0x9c')](_0x9161df,_0xae84('0xb2'));}else{if(_0x5067e9[_0xae84('0xae')]>=_0x15e088[_0xae84('0xb3')]){rpcDb[_0xae84('0x9c')](_0x5067e9,_0xae84('0xb1'));}else{rpcDb[_0xae84('0x86')](ut['scheduledAt'](_0x5067e9,_0xae84('0xae'),_0x15e088[_0xae84('0xaf')]),_0x5067e9['unlockAgent'],_0x5067e9[_0xae84('0xac')]);}}}else{_0x5067e9[_0xae84('0xae')]++;_0x4e57ec['incrementPreviewCounters']({'id':_0x5067e9[_0xae84('0x8a')],'field':{'countnoanswerretry':_0x5067e9['countnoanswerretry']}})[_0xae84('0x64')](function(){_0x4e57ec[_0xae84('0x8c')](_0x5067e9,_0x160c4f,_0x30f409)[_0xae84('0x64')](function(){});});}});break;case _0xae84('0xb4'):_0x15e088[_0xae84('0xb5')]+=0x1;_0x5067e9['countcongestionretry']+=0x1;_0x5067e9[_0xae84('0x78')]=ut[_0xae84('0x79')](_0x5067e9);ut[_0xae84('0x7a')](_0x5067e9,0x8,_0xae84('0xb6'));_0x160c4f=_0x15e088[_0xae84('0xb7')];_0x30f409=_0x15e088[_0xae84('0x80')];ami[_0xae84('0x7b')](_0xae84('0xb8'),ut[_0xae84('0x7c')](_0x5067e9,'congestion'));rpcDb[_0xae84('0x6e')](_0x5067e9,_0xae84('0xb9'));_0x4e57ec[_0xae84('0x7f')](_0x5067e9,'8',_0x15e088)[_0xae84('0x64')](function(_0xf074d3){_0x31e379=_0xf074d3[_0xae84('0xaa')]==0x1;if(!_0x31e379){if(ut['totalGlobal'](_0x5067e9)>=_0x15e088[_0xae84('0x81')]){_0x9161df=ut[_0xae84('0x82')](_0x5067e9,0xf,'Global');rpcDb[_0xae84('0x9c')](_0x9161df,_0xae84('0xba'));}else{if(_0x5067e9['countcongestionretry']>=_0x15e088['dialCongestionMaxRetry']){rpcDb[_0xae84('0x9c')](_0x5067e9,_0xae84('0xb9'));}else{rpcDb[_0xae84('0x86')](ut['scheduledAt'](_0x5067e9,_0xae84('0xbb'),_0x15e088['dialBusyRetryFrequency']),_0x5067e9[_0xae84('0x88')],_0x5067e9['activeContact']);}}}else{_0x5067e9[_0xae84('0xbb')]++;_0x4e57ec['incrementPreviewCounters']({'id':_0x5067e9[_0xae84('0x8a')],'field':{'countcongestionretry':_0x5067e9['countcongestionretry']}})[_0xae84('0x64')](function(){_0x4e57ec['swapAdditionalPhones'](_0x5067e9,_0x160c4f,_0x30f409)[_0xae84('0x64')](function(){});});}});break;case _0xae84('0xbc'):_0x15e088[_0xae84('0xbd')]+=0x1;_0x5067e9[_0xae84('0xbe')]+=0x1;_0x5067e9['countglobal']=ut['totalGlobal'](_0x5067e9);ut[_0xae84('0x7a')](_0x5067e9,0x14,_0xae84('0xbf'));_0x160c4f=_0x15e088[_0xae84('0xc0')];_0x30f409=_0x15e088[_0xae84('0x80')];ami[_0xae84('0x7b')](_0xae84('0xc1'),ut[_0xae84('0x7c')](_0x5067e9,'agentreject'));rpcDb['createCustomerHistory'](_0x5067e9,_0xae84('0xc2'));_0x4e57ec['verifyAdditionalPhones'](_0x5067e9,'20',_0x15e088)['then'](function(_0x3c7b25){_0x31e379=_0x3c7b25[_0xae84('0xaa')]==0x1;if(!_0x31e379){if(ut[_0xae84('0x79')](_0x5067e9)>=_0x15e088[_0xae84('0x81')]){_0x9161df=ut[_0xae84('0x82')](_0x5067e9,0x14,_0xae84('0xbf'));rpcDb[_0xae84('0x9c')](_0x9161df,_0xae84('0xc3'));}else{if(_0x5067e9[_0xae84('0xbe')]>=_0x15e088[_0xae84('0xc4')]){rpcDb[_0xae84('0x9c')](_0x5067e9,_0xae84('0xc3'));}else{rpcDb[_0xae84('0x86')](ut['scheduledAt'](_0x5067e9,_0xae84('0xbe'),_0x15e088['dialAgentRejectRetryFrequency']),_0x5067e9[_0xae84('0x88')],_0x5067e9[_0xae84('0xac')]);}}}else{_0x5067e9[_0xae84('0xae')]++;_0x4e57ec[_0xae84('0x8b')]({'id':_0x5067e9['idContact'],'field':{'countnoanswerretry':_0x5067e9['countnoanswerretry']}})['then'](function(){_0x4e57ec[_0xae84('0x8c')](_0x5067e9,_0x160c4f,_0x30f409)[_0xae84('0x64')](function(){});});}});break;case _0xae84('0xc5'):_0x15e088[_0xae84('0xc6')]+=0x1;_0x5067e9['countabandonedretry']+=0x1;_0x5067e9[_0xae84('0x78')]=ut[_0xae84('0x79')](_0x5067e9);ut[_0xae84('0x7a')](_0x5067e9,0xb,_0xae84('0xc7'));rpcDb[_0xae84('0x6e')](_0x5067e9,_0xae84('0xc8'));_0x4e57ec[_0xae84('0x7f')](_0x5067e9,'11',_0x15e088)['then'](function(_0x5ecff9){_0x31e379=_0x5ecff9[_0xae84('0xaa')]==0x1;if(!_0x31e379){if(ut[_0xae84('0x79')](_0x5067e9)>=_0x15e088[_0xae84('0x81')]){_0x9161df=ut[_0xae84('0x82')](_0x5067e9,0xf,_0xae84('0x83'));rpcDb[_0xae84('0x9c')](_0x9161df,'[callProgressDetectingCustomer][logAbandoned]');}else{if(_0x5067e9[_0xae84('0xc9')]>=_0x15e088['dialAbandonedMaxRety']){rpcDb[_0xae84('0x9c')](_0x5067e9,_0xae84('0xc8'));}else{rpcDb[_0xae84('0x86')](ut[_0xae84('0x87')](_0x5067e9,_0xae84('0xca'),_0x15e088[_0xae84('0xcb')]),_0x5067e9[_0xae84('0x88')],_0x5067e9[_0xae84('0xac')]);}}}else{_0x5067e9[_0xae84('0xae')]++;_0x4e57ec[_0xae84('0x8b')]({'id':_0x5067e9[_0xae84('0x8a')],'field':{'countnoanswerretry':_0x5067e9[_0xae84('0xae')]}})[_0xae84('0x64')](function(){_0x4e57ec[_0xae84('0x8c')](_0x5067e9,_0x160c4f,_0x30f409)[_0xae84('0x64')](function(){});});}});break;case'18':_0x15e088['outboundUnknownCallsDay']+=0x1;_0x5067e9[_0xae84('0xcc')]+=0x1;_0x5067e9[_0xae84('0x78')]=ut['totalGlobal'](_0x5067e9);ut[_0xae84('0x7a')](_0x5067e9,0x12,_0x5712d8[_0xae84('0xcd')]||_0x5712d8[_0xae84('0xce')]);ami[_0xae84('0x7b')](_0xae84('0xcf'),ut[_0xae84('0x7c')](_0x5067e9,'amd'));rpcDb[_0xae84('0x6e')](_0x5067e9,_0xae84('0xd0'));_0x4e57ec[_0xae84('0x7f')](_0x5067e9,'18',_0x15e088)['then'](function(_0x37d32c){_0x31e379=_0x37d32c['additional']==0x1;if(!_0x31e379){if(ut['totalGlobal'](_0x5067e9)>=_0x15e088[_0xae84('0x81')]){_0x9161df=ut[_0xae84('0x82')](_0x5067e9,0x12,_0xae84('0x83'));rpcDb[_0xae84('0x9c')](_0x9161df,_0xae84('0xd0'));}else{rpcDb[_0xae84('0x9c')](_0x5067e9,_0xae84('0xd0'));}}else{_0x5067e9[_0xae84('0xae')]++;_0x4e57ec[_0xae84('0x8b')]({'id':_0x5067e9[_0xae84('0x8a')],'field':{'countnoanswerretry':_0x5067e9[_0xae84('0xae')]}})[_0xae84('0x64')](function(){_0x4e57ec['swapAdditionalPhones'](_0x5067e9,_0x160c4f,_0x30f409)['then'](function(){});});}});delete this['actions'][_0x5712d8[_0xae84('0x89')]];break;case'19':_0x15e088[_0xae84('0xd1')]+=0x1;_0x5067e9[_0xae84('0x78')]=ut[_0xae84('0x79')](_0x5067e9);ut[_0xae84('0x7a')](_0x5067e9,0x13,_0x5712d8[_0xae84('0xcd')]||_0x5712d8[_0xae84('0xce')]);ami['emit'](_0xae84('0xcf'),ut['buildObj'](_0x5067e9,_0xae84('0xd2')));rpcDb['createCustomerHistory'](_0x5067e9,_0xae84('0xd3'));_0x4e57ec[_0xae84('0x7f')](_0x5067e9,'18',_0x15e088)[_0xae84('0x64')](function(_0x5cbbe3){_0x31e379=_0x5cbbe3[_0xae84('0xaa')]==0x1;if(!_0x31e379){if(ut[_0xae84('0x79')](_0x5067e9)>=_0x15e088[_0xae84('0x81')]){_0x9161df=ut[_0xae84('0x82')](_0x5067e9,0xf,_0xae84('0x83'));rpcDb[_0xae84('0x9c')](_0x9161df,_0xae84('0xd3'));}else{rpcDb[_0xae84('0x9c')](_0x5067e9,_0xae84('0xd3'));}}else{_0x5067e9[_0xae84('0xae')]++;_0x4e57ec[_0xae84('0x8b')]({'id':_0x5067e9[_0xae84('0x8a')],'field':{'countnoanswerretry':_0x5067e9[_0xae84('0xae')]}})['then'](function(){_0x4e57ec[_0xae84('0x8c')](_0x5067e9,_0x160c4f,_0x30f409)[_0xae84('0x64')](function(){});});}});delete this[_0xae84('0x43')][_0x5712d8['linkedid']];break;default:if(_0x5067e9['dialAnswer']){ut[_0xae84('0x55')](_0x15e088,'[default]');ut[_0xae84('0x56')]('[Dialer][decrementTalkink][no\x20Hangup][Preview]'+_0x15e088[_0xae84('0x29')],_0x5712d8);}_0x15e088['outboundUnknownCallsDay']+=0x1;_0x5067e9[_0xae84('0x78')]=ut[_0xae84('0x79')](_0x5067e9);ut['logCustomer'](_0x5067e9,0xc,_0x5712d8['cause-txt']||_0x5712d8['dialstatus']);_0x160c4f=_0x15e088[_0xae84('0xc0')];_0x30f409=_0x15e088[_0xae84('0x80')];rpcDb['createCustomerHistory'](_0x5067e9,_0xae84('0xd4'));_0x4e57ec[_0xae84('0x7f')](_0x5067e9,'20',_0x15e088)[_0xae84('0x64')](function(_0x2f5250){_0x31e379=_0x2f5250[_0xae84('0xaa')]==0x1;if(!_0x31e379){if(ut[_0xae84('0x79')](_0x5067e9)>=_0x15e088[_0xae84('0x81')]){_0x9161df=ut[_0xae84('0x82')](_0x5067e9,0xf,_0xae84('0x83'));rpcDb[_0xae84('0x9c')](_0x9161df,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb[_0xae84('0x9c')](_0x5067e9,_0xae84('0xd5'));}delete this['actions'][_0x5712d8[_0xae84('0x89')]];}else{_0x4e57ec[_0xae84('0x8c')](_0x5067e9,_0x160c4f,_0x30f409)[_0xae84('0x64')](function(){});}});}if(!(_0x5067e9[_0xae84('0x4a')]&&_0x552322==='16')){ut['updateOriginated'](_0x15e088,_0xae84('0xd6'));logger[_0xae84('0x44')]('[originated][decrement][callProgressDetectingCustomer]',_0x5067e9['uniqueid'],_0xae84('0x91'),_0x15e088[_0xae84('0x29')],'originated:\x20',_0x15e088[_0xae84('0x2c')]);}if(_0x552322!=='ANSWER'){delete this[_0xae84('0x43')][_0x5712d8['linkedid']];delete this[_0xae84('0x43')][_0x5712d8[_0xae84('0xd7')]];}_0x15e088[_0xae84('0xd8')]=!![];}};Preview[_0xae84('0xf')][_0xae84('0xd9')]=function(_0x12ddb2,_0x4b799e,_0x128408){if(_['isUndefined'](_0x4b799e)&&_0xae84('0xda')!==typeof _0x4b799e){return;}if(_[_0xae84('0xdb')](_0x128408)&&_0xae84('0xda')!==typeof _0x128408){return;}switch(_0x128408[_0xae84('0xdc')]){case'0':ut[_0xae84('0xdd')](_0x12ddb2,0x0,_0xae84('0xde'));rpcDb[_0xae84('0xdf')](_0x12ddb2,_0xae84('0xe0'));break;case'3':ut[_0xae84('0xdd')](_0x12ddb2,0x3,_0xae84('0xe1'));rpcDb[_0xae84('0xdf')](_0x12ddb2,_0xae84('0xe2'));break;case'5':ut[_0xae84('0xdd')](_0x12ddb2,0x5,'Busy');rpcDb['createAgentHistory'](_0x12ddb2,'[callProgressDetectingAgent][logBusy]');break;case'8':ut[_0xae84('0xdd')](_0x12ddb2,0x8,_0xae84('0xb6'));rpcDb[_0xae84('0xdf')](_0x12ddb2,_0xae84('0xe3'));break;case'22':ut['logAgent'](_0x12ddb2,0x16,_0xae84('0xe4'));rpcDb[_0xae84('0xdf')](_0x12ddb2,_0xae84('0xe5'));break;default:ut[_0xae84('0xdd')](_0x12ddb2,0xc,_0x128408['reason']);rpcDb['createAgentHistory'](_0x12ddb2,_0xae84('0xe3'));}ut['updateOriginated'](_0x4b799e,_0xae84('0xe6'));logger[_0xae84('0x44')](_0xae84('0xe7'),_0x12ddb2[_0xae84('0xa1')],_0xae84('0x91'),_0x4b799e[_0xae84('0x29')],_0xae84('0x48'),_0x4b799e[_0xae84('0x2c')]);delete this['actions'][_0x12ddb2['uniqueid']];};Preview[_0xae84('0xf')]['verifyAdditionalPhones']=function(_0x49e704,_0x28d1e4,_0xf4a1f){return cmHopperAdditionalPhone[_0xae84('0x7f')](_0x49e704,_0x28d1e4,_0xf4a1f)['catch'](logger['info'](_0xae84('0xe8')));};Preview['prototype'][_0xae84('0x8c')]=function(_0x5b34a5,_0x541b58,_0x560846){return cmHopperAdditionalPhone[_0xae84('0x8c')](_0x5b34a5,_0x541b58,_0x560846)[_0xae84('0x66')](logger[_0xae84('0x44')](_0xae84('0xe9')));};Preview[_0xae84('0xf')]['incrementPreviewCounters']=function(_0x2f9597){return Promise['resolve']()[_0xae84('0x64')](cmHopperAdditionalPhone[_0xae84('0x8b')](_0x2f9597))[_0xae84('0x66')](logger['info'](_0xae84('0xea')));};Preview[_0xae84('0xf')]['checkInBlack']=function(_0x4f3110,_0x37acd2,_0x2fbb90,_0x26146e,_0x3aecbe){var _0x2fe987=this;return new Promise(function(_0x2f801f,_0x117e9e){if(_[_0xae84('0x42')](_0x37acd2)||_['isNil'](_0x37acd2['Contact'])||_[_0xae84('0x42')](_0x37acd2['phone'])||_['isNil'](_0x37acd2[_0xae84('0x4e')])){_0x117e9e(ut['message'](_0xae84('0xeb'),_0x26146e,_0x3aecbe));return;}var _0x2b8a9a=uuid['v4']();var _0x911217=_0x2fe987[_0xae84('0x13')][_0x37acd2['Queue']['name']];var _0x346274=_0x2fbb90?_0x2fe987[_0xae84('0x5c')][_0x2fbb90]['id']:undefined;_0x2fe987['actions'][_0x2b8a9a]=new Action(_0x37acd2,_0x911217,_0x2b8a9a,_0x2fbb90,_0x346274);var _0x3729f7=_0x2fe987[_0xae84('0x43')][_0x2b8a9a];_0x3729f7[_0xae84('0x88')]=_0x26146e;_0x3729f7['activeContact']=_0x3aecbe;_0x3729f7[_0xae84('0xec')]=_0x2fbb90;if(_[_0xae84('0xed')](_0x4f3110)){_0x2fe987[_0xae84('0xee')](_0x3729f7,_0x911217,_0x37acd2,_0x2fbb90)[_0xae84('0x64')](function(_0x1986b9){logger[_0xae84('0x44')](_0xae84('0xef'),'Queue:\x20'+_0x3729f7['queue']+'\x20IdHopper:\x20'+_0x3729f7[_0xae84('0x8a')],JSON[_0xae84('0x26')](_0x1986b9));ami[_0xae84('0x7b')](_0xae84('0xf0'),ut[_0xae84('0x7c')](_0x3729f7,_0xae84('0xf1'),_0x2fe987[_0xae84('0x13')][_0x3729f7[_0xae84('0x47')]]));_0x2f801f(ut['message'](_0xae84('0xf2')));})['catch'](function(_0x26dbf5){ut[_0xae84('0x33')](_0xae84('0xf3'),_0x26dbf5);_0x117e9e(ut[_0xae84('0x30')](_0xae84('0xf4'),_0x26146e,_0x3aecbe));});}else{_0x911217['outboundBlacklistCallsDay']+=0x1;ut[_0xae84('0xf5')](_0x3729f7);rpcDb[_0xae84('0xf6')](_0x3729f7,_0xae84('0xf7'));delete _0x2fe987[_0xae84('0x43')][_0x2b8a9a];_0x117e9e(ut[_0xae84('0x30')](_0xae84('0xf8'),_0x26146e,_0x3aecbe));}});};Preview[_0xae84('0xf')][_0xae84('0x73')]=function(_0x4f7b84){return!_[_0xae84('0x42')](_0x4f7b84)&&!_['isNil'](_0x4f7b84[_0xae84('0x29')])&&!_[_0xae84('0x42')](_0x4f7b84[_0xae84('0xf9')])&&_0x4f7b84[_0xae84('0xf9')]&&!_[_0xae84('0x42')](this[_0xae84('0x15')][util[_0xae84('0x27')](_0xae84('0xfa'),_0x4f7b84['name'])])&&!_[_0xae84('0x42')](this[_0xae84('0x15')][util[_0xae84('0x27')](_0xae84('0xfa'),_0x4f7b84[_0xae84('0x29')])][_0xae84('0x50')])&&(this['trunks'][util[_0xae84('0x27')](_0xae84('0xfa'),_0x4f7b84['name'])]['status']==='reachable'||this[_0xae84('0x15')][util[_0xae84('0x27')](_0xae84('0xfa'),_0x4f7b84[_0xae84('0x29')])]['status']===_0xae84('0xfb'));};Preview[_0xae84('0xf')][_0xae84('0x63')]=function(_0x5a1a59,_0x2a1967){return this[_0xae84('0xfc')](_0x5a1a59,_0x2a1967)[_0xae84('0x64')](function(_0x1ddfb0){return _[_0xae84('0x4b')](_0x1ddfb0,['message']);})[_0xae84('0x66')](function(_0x5bf8a6){if(_0x5bf8a6[_0xae84('0xfd')]){rpcDb['unlockContact'](_0x5a1a59);}if(_0x5bf8a6['active']){rpcDb[_0xae84('0x67')](_0x5a1a59);}throw _[_0xae84('0x4b')](_0x5bf8a6,[_0xae84('0x30')]);});};Preview[_0xae84('0xf')]['execRun']=function(_0x15fa90,_0xab794){var _0x1a4fa2=this;var _0x37be84,_0x29a6b9;return rpcDb[_0xae84('0xfe')](_0x15fa90)[_0xae84('0x64')](function(_0x350cff){if(!_[_0xae84('0x42')](_0x350cff[0x0])){_0x29a6b9=_0x350cff[0x0]['recallme']?![]:!![];_0x37be84=_0x350cff[0x0][_0xae84('0xff')]?!![]:![];_0x37be84=_0xab794?!![]:_0x37be84;}var _0xa2d285=_0x1a4fa2['validateContact'](_0x350cff);if(_0xa2d285[_0xae84('0x100')]){rpcDb[_0xae84('0x101')](_[_0xae84('0x4b')](_0x350cff[0x0],[_0xae84('0x4e'),'phone']))['then'](function(_0x5e5eb7){_0x1a4fa2['checkInBlack'](_0x5e5eb7,_0x350cff[0x0],_0xab794,_0x29a6b9,_0x37be84)[_0xae84('0x64')](function(_0x261226){return _0x261226;})[_0xae84('0x66')](function(_0x339b8e){throw _0x339b8e;});})[_0xae84('0x66')](function(_0x14d29a){ut[_0xae84('0x33')](_0xae84('0x102'),_0x14d29a);throw ut[_0xae84('0x30')](_0xae84('0x103'),_0x29a6b9,_0x37be84);});}else{throw ut[_0xae84('0x30')](_0xa2d285[_0xae84('0x30')],_0x29a6b9,_0x37be84);}})['catch'](function(_0x233c55){ut[_0xae84('0x33')](_0xae84('0x104'),_0x233c55);throw ut[_0xae84('0x30')](_0xae84('0x103'),![],!![]);});};Preview[_0xae84('0xf')][_0xae84('0x105')]=function(_0x2f5fd6){if(_[_0xae84('0x42')](_0x2f5fd6)||_[_0xae84('0xed')](_0x2f5fd6)||!_['isNil'](_0x2f5fd6[0x0][_0xae84('0x61')])&&_[_0xae84('0x42')](_0x2f5fd6[0x0]['Agent']['name'])){ut['logger'](_0xae84('0x106'),_0x2f5fd6);return{'isValid':![],'message':_0xae84('0x107')};}var _0x1b19a5=this[_0xae84('0x13')][_0x2f5fd6[0x0]['Queue'][_0xae84('0x29')]];_0x1b19a5[_0xae84('0x30')]=utils['CAMPAIGN_STATUS'][_0xae84('0x76')];if(_['isNil'](_0x1b19a5)){ut[_0xae84('0x33')]('[Preview][validateContact][Empty\x20Campaign]',_0x1b19a5);return{'isValid':![],'message':'Empty\x20Campaign'};}if(!this['isTrunkReachable'](_0x1b19a5['Trunk'])){ut[_0xae84('0x33')](_0xae84('0x108'),_0xae84('0x109')+_0x1b19a5[_0xae84('0x29')]+'\x20Trunk\x20is\x20not\x20active');if(!this['isTrunkReachable'](_0x1b19a5[_0xae84('0x74')])){ut[_0xae84('0x33')]('[Preview][validateContact][Trunk\x20not\x20working\x20correctly]',_0x1b19a5['name']+_0xae84('0x10a'));return{'isValid':![],'message':_0xae84('0x10b')};}}if(!ut[_0xae84('0x71')](_0x1b19a5['dialActive'])){ut[_0xae84('0x33')](_0xae84('0x10c'),_0x1b19a5[_0xae84('0x29')]+_0xae84('0x10d'));return{'isValid':![],'message':_0xae84('0x109')+_0x1b19a5[_0xae84('0x29')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':_0xae84('0x10e')};};Preview[_0xae84('0xf')]['execCall']=function(_0x80450b,_0x1a303f,_0x300067,_0x3afe17){var _0x5275b2=this;return new Promise(function(_0x12fbfa,_0x2e39d1){var _0x528390=_0x80450b[_0xae84('0xa1')];var _0x45a104=_0x5275b2['isTrunkReachable'](_0x1a303f[_0xae84('0x72')])?util[_0xae84('0x27')](_0xae84('0x10f'),_0x1a303f['Trunk'][_0xae84('0x29')],_[_0xae84('0x42')](_0x1a303f[_0xae84('0x110')])?'':_0x1a303f[_0xae84('0x110')]['trim']()||'',_0x1a303f[_0xae84('0x111')]>0x0?_0x300067[_0xae84('0x112')]['substring'](_0x1a303f[_0xae84('0x111')]):_0x300067[_0xae84('0x112')]):util[_0xae84('0x27')](_0xae84('0x10f'),_[_0xae84('0x42')](_0x1a303f['TrunkBackup'])?_0x1a303f[_0xae84('0x72')][_0xae84('0x29')]:_0x1a303f[_0xae84('0x74')]['name'],_['isNil'](_0x1a303f[_0xae84('0x110')])?'':_0x1a303f[_0xae84('0x110')][_0xae84('0x113')]()||'',_0x1a303f[_0xae84('0x111')]>0x0?_0x300067[_0xae84('0x112')][_0xae84('0x114')](_0x1a303f[_0xae84('0x111')]):_0x300067[_0xae84('0x112')]);var _0xb4b8c6=_0x5275b2[_0xae84('0x73')](_0x1a303f[_0xae84('0x72')])?ut[_0xae84('0x115')](_0x1a303f[_0xae84('0x72')][_0xae84('0x116')],_0x1a303f['dialOriginateCallerIdName'],_0x1a303f[_0xae84('0x117')]>0x0?ut[_0xae84('0x118')](_0x1a303f['dialOriginateCallerIdNumber'],_0x1a303f['dialRandomLastDigitCallerIdNumber']):_0x1a303f[_0xae84('0x119')]):ut[_0xae84('0x115')](_[_0xae84('0x42')](_0x1a303f[_0xae84('0x74')])?_0x1a303f['Trunk']['callerid']:_0x1a303f[_0xae84('0x74')][_0xae84('0x116')],_0x1a303f[_0xae84('0x11a')],_0x1a303f[_0xae84('0x117')]>0x0?ut[_0xae84('0x118')](_0x1a303f[_0xae84('0x119')],_0x1a303f[_0xae84('0x117')]):_0x1a303f[_0xae84('0x119')]);if(_0xb4b8c6){_0x80450b['originatecalleridname']=ut[_0xae84('0x11b')](_0xb4b8c6);_0x80450b[_0xae84('0x11c')]=ut[_0xae84('0x11d')](_0xb4b8c6);}var _0x1c22eb=ut['addVariables'](_0x1a303f,_0x300067,_0x45a104,_0xb4b8c6,_0x528390,_0x80450b);var _0x5f1663=utils[_0xae84('0x11e')](_0x300067[_0xae84('0x11f')]);Object[_0xae84('0x120')](_0x1c22eb,_0x5f1663);_[_0xae84('0x121')](_0x80450b,ut[_0xae84('0x122')](_0x1c22eb));_0x80450b['starttime']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x1a303f[_0xae84('0x123')]=_0x1c22eb;var _0x284f56=ut[_0xae84('0x124')](_0x80450b,_0x1a303f,_0x1c22eb,_0x80450b[_0xae84('0xac')],_0x3afe17);return ami[_0xae84('0x4f')](_0x284f56)['then'](function(_0x14bffc){_0x1a303f[_0xae84('0x2c')]+=0x1;logger[_0xae84('0x44')]('[originated][increment]',_0x528390,_0xae84('0x91'),_0x1a303f[_0xae84('0x29')],_0xae84('0x48'),_0x1a303f[_0xae84('0x2c')]);_0x12fbfa(_0x14bffc);})[_0xae84('0x66')](function(_0x420903){ut['logAgent'](_0x80450b,0xe,_0xae84('0x125'));rpcDb['createAgentHistory'](_0x80450b,_0xae84('0x126'));_0x2e39d1(_0x420903);});});};Preview[_0xae84('0xf')][_0xae84('0x21')]=function(_0x8e85b0){if(this[_0xae84('0x43')][_0x8e85b0['linkedid']]){this[_0xae84('0x43')][_0x8e85b0[_0xae84('0x89')]][_0xae84('0x51')]=_0x8e85b0['channel'];}};Preview[_0xae84('0xf')]['syncOriginateResponse']=function(_0x227bd0){var _0x4b9484=this;var _0x4f37e7=this['actions'][_0x227bd0[_0xae84('0x127')]];if(_0x4f37e7){if(_0x4f37e7[_0xae84('0xec')]&&this[_0xae84('0x5c')][_0x4f37e7[_0xae84('0xec')]]){ut[_0xae84('0x128')](_0x4f37e7,this[_0xae84('0x5c')][_0x4f37e7[_0xae84('0xec')]][_0xae84('0x29')],this[_0xae84('0x5c')][_0x4f37e7[_0xae84('0xec')]]['id']);}var _0x1fd2e6=_[_0xae84('0x129')](_0x4f37e7);_0x1fd2e6[_0xae84('0x8e')]=moment()[_0xae84('0x27')](_0xae84('0x12a'));var _0x33b2d4=_0x4b9484['campaignsPreview'][_0x4f37e7[_0xae84('0x47')]];if(ut['isFailure'](_0x227bd0['response'])){if(_0x4f37e7[_0xae84('0x88')]){rpcDb[_0xae84('0x12b')](_0x4f37e7['idContact']);}if(_0x4f37e7['activeContact']){rpcDb['disableContact'](_0x4f37e7[_0xae84('0x8a')]);}ami[_0xae84('0x7b')](_0xae84('0x12c'),ut['buildObj'](_0x4f37e7,_0xae84('0x12d'),this[_0xae84('0x13')][_0x4f37e7['queue']]));this[_0xae84('0xd9')](_0x1fd2e6,_0x33b2d4,_0x227bd0);}else{_0x4f37e7[_0xae84('0x68')]=moment()[_0xae84('0x27')](_0xae84('0x12a'));ut[_0xae84('0xdd')](_0x1fd2e6,0x4,_0xae84('0x9a'));rpcDb['createAgentHistory'](_0x1fd2e6,'[callProgressDetectingAgent][logAnswer]');}}};Preview[_0xae84('0xf')][_0xae84('0x1a')]=function(_0x24a410){var _0xfde7e5=this['actions'][_0x24a410[_0xae84('0x89')]];var _0x17a703;if(_0xfde7e5){_0x17a703=this['campaignsPreview'][_0xfde7e5['queue']];logger[_0xae84('0x44')](_0xae84('0x12e'),_0x24a410[_0xae84('0x89')],_0xae84('0x91'),_0x17a703['name'],'pTalking:\x20',_0x17a703[_0xae84('0x2d')]);}if(this['actions'][_0x24a410['linkedid']]&&_0x24a410['linkedid']!==_0x24a410[_0xae84('0xa1')]){if(_0x24a410[_0xae84('0x12f')]==='16'&&this[_0xae84('0x43')][_0x24a410[_0xae84('0x89')]][_0xae84('0x4a')]){this['callProgressDetectingCustomer'](_0x24a410,_0x24a410[_0xae84('0x89')],_0x24a410[_0xae84('0x12f')]);}else if(this[_0xae84('0x43')][_0x24a410[_0xae84('0x89')]][_0xae84('0x4a')]){logger['info']('[syncHangup][talking][cause]',_0x24a410[_0xae84('0x89')],_0x24a410[_0xae84('0x12f')],_0xae84('0x91'),_0x17a703['name'],_0xae84('0x49'),_0x17a703[_0xae84('0x2d')]);this[_0xae84('0x130')](_0x24a410,_0x24a410[_0xae84('0x89')],_0x24a410[_0xae84('0x12f')]);}}else if(_0xfde7e5&&_[_0xae84('0x42')](_0xfde7e5[_0xae84('0x131')])&&_0x17a703['dialQueueProject']&&_0x24a410[_0xae84('0x89')]===_0x24a410['uniqueid']&&_[_0xae84('0x42')](_0x24a410[_0xae84('0xdc')])&&_0x24a410[_0xae84('0x12f')]==='16'&&_0x24a410[_0xae84('0x132')]==='6'&&_['isUndefined'](_0xfde7e5[_0xae84('0x133')])){if(_0xfde7e5['unlockAgent']){rpcDb[_0xae84('0x12b')](_0xfde7e5[_0xae84('0x8a')]);}if(_0xfde7e5[_0xae84('0xac')]){rpcDb[_0xae84('0x67')](_0xfde7e5[_0xae84('0x8a')]);}_0x24a410[_0xae84('0xdc')]='22';this[_0xae84('0xd9')](_0xfde7e5,_0x17a703,_0x24a410);}else if(_0xfde7e5&&_0xfde7e5[_0xae84('0x133')]){if(_0x24a410[_0xae84('0x12f')]==='16'&&this['actions'][_0x24a410[_0xae84('0x89')]][_0xae84('0x4a')]){logger['info'](_0xae84('0x134'),_0x24a410[_0xae84('0x89')],_0x24a410[_0xae84('0x12f')],'\x20Queue',_0x17a703[_0xae84('0x29')],'pTalking:\x20',_0x17a703[_0xae84('0x2d')]);this[_0xae84('0x130')](_0x24a410,_0x24a410['linkedid'],_0x24a410[_0xae84('0x12f')]);}else if(this[_0xae84('0x43')][_0x24a410[_0xae84('0x89')]]['dialAnswer']){logger['info'](_0xae84('0x135'),_0x24a410['linkedid'],_0x24a410[_0xae84('0x12f')],_0xae84('0x91'),_0x17a703[_0xae84('0x29')],_0xae84('0x49'),_0x17a703[_0xae84('0x2d')]);this[_0xae84('0x130')](_0x24a410,_0x24a410[_0xae84('0x89')],_0x24a410[_0xae84('0x12f')]);}}};Preview[_0xae84('0xf')][_0xae84('0x1e')]=function(_0x4f55ef){if(this[_0xae84('0x43')][_0x4f55ef[_0xae84('0xd7')]]&&_0x4f55ef['destlinkedid']!==_0x4f55ef['destuniqueid']){this[_0xae84('0x130')](_0x4f55ef,_0x4f55ef[_0xae84('0xd7')],_0x4f55ef[_0xae84('0xce')]);}};Preview[_0xae84('0xf')][_0xae84('0x1c')]=function(_0x1a8f99){if(this['actions'][_0x1a8f99['linkedid']]&&_0x1a8f99[_0xae84('0x89')]!==_0x1a8f99[_0xae84('0xa1')]&&!this['actions'][_0x1a8f99['linkedid']][_0xae84('0x4a')]){if(_0x1a8f99[_0xae84('0x12f')]==='1'){this[_0xae84('0x130')](_0x1a8f99,_0x1a8f99['linkedid'],_0x1a8f99[_0xae84('0x12f')]);}}};Preview[_0xae84('0xf')][_0xae84('0x136')]=function(_0xb7952d,_0x1fe964,_0x5175fe){if(this[_0xae84('0x43')][_0xb7952d]){if(_[_0xae84('0x42')](this[_0xae84('0x43')][_0xb7952d]['variables'])){this[_0xae84('0x43')][_0xb7952d][_0xae84('0x123')]={};}this[_0xae84('0x43')][_0xb7952d][_0xae84('0x123')][_0x1fe964]=_0x5175fe;}};Preview[_0xae84('0xf')][_0xae84('0x23')]=function(_0x522c0c){try{if(!_[_0xae84('0x42')](_0x522c0c)){if(ut[_0xae84('0x137')](_[_0xae84('0x138')](_0x522c0c[_0xae84('0x139')])[0x0])){this[_0xae84('0x136')](_0x522c0c[_0xae84('0xa1')],_[_0xae84('0x138')](_0x522c0c['variable'])[0x0],_0x522c0c[_0xae84('0x13a')]);}}}catch(_0x1af6a7){logger[_0xae84('0x13b')](_0xae84('0x13c'),util[_0xae84('0x13d')](_0x1af6a7,{'showHidden':![],'depth':null}));}};Preview[_0xae84('0xf')][_0xae84('0x13e')]=function(_0x133676){if(_0x133676){if(this[_0xae84('0x43')][_0x133676['transfertargetlinkedid']]){this[_0xae84('0x43')][_0x133676[_0xae84('0x13f')]][_0xae84('0x133')]=!![];}}};Preview[_0xae84('0xf')][_0xae84('0x140')]=function(_0x1ca0ba){if(_0x1ca0ba){if(this['actions'][_0x1ca0ba[_0xae84('0x141')]]){this[_0xae84('0x43')][_0x1ca0ba[_0xae84('0x141')]][_0xae84('0x133')]=!![];}}};module[_0xae84('0x142')]=Preview; \ No newline at end of file +var _0x07e5=['localhost','prototype','enqueue','tail','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','hangup','syncHangup','bind','syncHangupRequest','newexten','varset','syncVarSet','blindtransfer','syncBlindTransfer','loopCampaigns','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','format','voice:queue:%s','name','voice_queue_channel:remove','emit','voice_queue_presence:remove','originated','pTalking','sendMessageOneNotActive','available','paused','message','INACTIVE','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','CAMPAIGN_STATUS','logger','\x20is\x20deactivated','syncCampaigns','hasOwnProperty','dialMethod','preview','type','clearZombieChannels','outbound','dialActive','setMessage','clearZombieChannel','sequence','isNil','Queue','queue','originated:\x20','pTalking:\x20','dialAnswer','stringify','contactId','UserId','ListId','Action','status','updateOriginated','decrementTalkink','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','size','recallMe','getContactRecallMe','agentReadyId','length','getDiff','scheduledat','dialRecallMeTimeout','Agent','voicePause','run','then','logger2','[RecallMe]','catch','YYYY-MM-DD\x20HH:mm:ss','outboundReCallsDay','logCustomer','RecallInQueue','dialRecallInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','IsNotLoggedIn','isActive','isTrunkReachable','TrunkBackup','UNREACHABLE_TRUNK','ACTIVE','outboundNoSuchCallsDay','countnosuchnumberretry','countglobal','custom:agentnosuchnumber','nosuchnumber','verifyAdditionalPhones','dialNoSuchNumberRetryFrequency','callAdditionalPhoneAfterMin','totalGlobal','dialGlobalMaxRetry','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','scheduledAt','unlockAgent','linkedid','actioncountonusuch','idContact','incrementPreviewCounters','swapAdditionalPhones','ANSWER','responsetime','answertime','uniqueid','\x20Queue','custom:agentconnect','buildObj','connect','acw','custom:agentConnectPreview','buildAcw','complete','outboundAnswerCallsDay','[16]','sumBillable','talktime','[syncHangup][talking][decrement]','BUSY','countbusyretry','Busy','dialBusyRetryFrequency','custom:agentbusy','busy','cloneAction','dialBusyMaxRetry','[callProgressDetectingCustomer][logBusy]','rescheduleContact','activeContact','NOANSWER','outboundNoAnswerCallsDay','NoAnswer','dialNoAnswerRetryFrequency','buildNoAnswerEventPayload','custom:agentnoanswer','dialNoAnswerMaxRetry','[callProgressDetectingCustomer][logNoAnswer]','countnoanswerretry','CONGESTION','outboundCongestionCallsDay','countcongestionretry','Congestion','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','additional','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','CANCEL','outboundRejectCallsDay','countagentrejectretry','AgentReject','dialAgentRejectRetryFrequency','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','ABANDONED','outboundAbandonedCallsDay','countabandonedretry','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','dialAbandonedRetryFrequency','outboundUnknownCallsDay','countmachineretry','cause-txt','dialstatus','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','isUndefined','object','reason','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','[callProgressDetectingAgent][logNoAnswer]','logAgent','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent][logCongestion]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','resolve','[incrementPreviewCounters]\x20','checkInBlack','Contact','Contact\x20is\x20undefined','lookAgent','execCall','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','called','Call\x20failed','outboundBlacklistCallsDay','logBlacklist','createHistory','[Blacklist][error]','active','SIP/%s','pick','unlock','unlockContact','disableContact','execRun','getContactPreview','recallme','validateContact','isValid','checkIsBlackList','VoiceQueueId','phone','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','isEmpty','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','Empty\x20Campaign','Trunk','\x20Trunk\x20is\x20not\x20active','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','getCallerId','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','originatecalleridname','extractCalleridName','extractCalleridNumber','addVariables','setXMDContactVariables','assign','toLowerVariables','variables','[originated][increment]','[originateFailure][logOriginateFailure]','syncNewExten','channel','logLookAgent','clone','isFailure','rejected','starttime','Answer','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','callProgressDetectingCustomer','cause','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','[syncHangup][talking][cause]','syncDialEnd','destuniqueid','addVariable','filterKey','keys','variable','value','error','[syncVarSet][Preview]','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','uuid','moment','../../../config/environment','../../../config/logger','../ami','./rpcDb','../rpc/cmHopperAdditionalPhone','./action','./util/util','../dialer/utils','redis'];(function(_0x2330cf,_0x5add9f){var _0x5e230f=function(_0x1f44f7){while(--_0x1f44f7){_0x2330cf['push'](_0x2330cf['shift']());}};_0x5e230f(++_0x5add9f);}(_0x07e5,0x133));var _0x507e=function(_0x10a26a,_0xe95601){_0x10a26a=_0x10a26a-0x0;var _0x2308d9=_0x07e5[_0x10a26a];return _0x2308d9;};'use strict';var util=require(_0x507e('0x0'));var _=require(_0x507e('0x1'));var uuid=require(_0x507e('0x2'));var moment=require(_0x507e('0x3'));var Redis=require('ioredis');var config=require(_0x507e('0x4'));var logger=require(_0x507e('0x5'))('preview');var loggerAction=require('../../../config/logger')('actionPreview');var ami=require(_0x507e('0x6'));var rpcDb=require(_0x507e('0x7'));var cmHopperAdditionalPhone=require(_0x507e('0x8'));var Action=require(_0x507e('0x9'));var ut=require(_0x507e('0xa'));var utils=require(_0x507e('0xb'));config['redis']=_['defaults'](config[_0x507e('0xc')],{'host':_0x507e('0xd'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x507e('0xc')]));var Sequence=function(){};Sequence[_0x507e('0xe')][_0x507e('0xf')]=function(_0x4d2984){this[_0x507e('0x10')]=this['tail']?this[_0x507e('0x10')]['finally'](_0x4d2984):_0x4d2984();};function Preview(_0x5be672){this['sequence']=new Sequence();this[_0x507e('0x11')]=_0x5be672[_0x507e('0x12')];this[_0x507e('0x13')]=_0x5be672[_0x507e('0x13')];this[_0x507e('0x14')]={};this['agents']=_0x5be672[_0x507e('0x15')];this[_0x507e('0x16')]=0x0;ami['on'](_0x507e('0x17'),this[_0x507e('0x18')]['bind'](this));ami['on'](_0x507e('0x19'),this[_0x507e('0x1a')][_0x507e('0x1b')](this));ami['on']('hanguprequest',this[_0x507e('0x1c')][_0x507e('0x1b')](this));ami['on']('dialend',this['syncDialEnd']['bind'](this));ami['on'](_0x507e('0x1d'),this['syncNewExten'][_0x507e('0x1b')](this));ami['on'](_0x507e('0x1e'),this[_0x507e('0x1f')][_0x507e('0x1b')](this));ami['on']('attendedtransfer',this['syncAttendedTransfer']['bind'](this));ami['on'](_0x507e('0x20'),this[_0x507e('0x21')][_0x507e('0x1b')](this));this[_0x507e('0x22')](this[_0x507e('0x11')]);}function emit(_0x33cf28,_0x196c00,_0x49b257){io['to'](_0x33cf28)['emit'](_0x196c00,_0x49b257);}function emitVoiceQueueChannelRemove(_0x1cd7ee){logger[_0x507e('0x23')](_0x507e('0x24'),JSON['stringify'](_0x1cd7ee));emit(util[_0x507e('0x25')](_0x507e('0x26'),_0x1cd7ee[_0x507e('0x27')]),_0x507e('0x28'),_0x1cd7ee);io[_0x507e('0x29')](_0x507e('0x2a'),_0x1cd7ee);}function notSendMessagesQueue(_0x1c52d9){if(_0x1c52d9['sendMessageOneNotActive']){if(_0x1c52d9[_0x507e('0x2b')]===0x0&&_0x1c52d9[_0x507e('0x2c')]===0x0){_0x1c52d9[_0x507e('0x2d')]=![];_0x1c52d9[_0x507e('0x2e')]=0x0;_0x1c52d9[_0x507e('0x2f')]=0x0;_0x1c52d9[_0x507e('0x30')]=utils['CAMPAIGN_STATUS'][_0x507e('0x31')];ut['logger'](_0x507e('0x32'),_0x1c52d9[_0x507e('0x27')]+_0x507e('0x33'));}else{_0x1c52d9[_0x507e('0x30')]=utils[_0x507e('0x34')]['DEACTIVATED'];ut[_0x507e('0x35')](_0x507e('0x32'),_0x1c52d9['name']+_0x507e('0x36'));}}}Preview[_0x507e('0xe')][_0x507e('0x22')]=function(){var _0x4befde=this;setInterval(function(){_0x4befde[_0x507e('0x37')]();},0x7cf);};Preview['prototype'][_0x507e('0x37')]=function(){var _0x30f3e6=this['campaignsPreview'];this['clockClearZombieChannels']+=0x1;for(var _0xd65ab1 in _0x30f3e6){if(_0x30f3e6[_0x507e('0x38')](_0xd65ab1)&&(_0x30f3e6[_0xd65ab1][_0x507e('0x39')]===_0x507e('0x3a')||_0x30f3e6[_0xd65ab1]['dialMethod']==='booked')&&_0x30f3e6[_0xd65ab1][_0x507e('0x3b')]==='outbound'){if(this['clockClearZombieChannels']>0x7){this[_0x507e('0x16')]=0x0;this[_0x507e('0x3c')]();}}if(_0x30f3e6['hasOwnProperty'](_0xd65ab1)&&_0x30f3e6[_0xd65ab1][_0x507e('0x39')]===_0x507e('0x3a')&&_0x30f3e6[_0xd65ab1][_0x507e('0x3b')]===_0x507e('0x3d')){if(_0x30f3e6[_0xd65ab1][_0x507e('0x3e')]){this[_0x507e('0x3f')](_0x30f3e6[_0xd65ab1]);if(_0x30f3e6[_0xd65ab1]['dialPreviewAutoRecallMe'])this['recallMe'](_0x30f3e6[_0xd65ab1]);}else{notSendMessagesQueue(_0x30f3e6[_0xd65ab1]);}}}};Preview['prototype'][_0x507e('0x40')]=function(_0x3bcb08){var _0x1490e4=this;this[_0x507e('0x41')][_0x507e('0xf')](function(){if(!_[_0x507e('0x42')](_0x1490e4[_0x507e('0x14')][_0x3bcb08])){loggerAction['info']('[clearZombieChannels][talking]',_0x3bcb08,_0x507e('0x43'),_0x1490e4[_0x507e('0x14')][_0x3bcb08][_0x507e('0x44')],_0x507e('0x45'),JSON['stringify'](_0x1490e4[_0x507e('0x11')][_0x1490e4[_0x507e('0x14')][_0x3bcb08][_0x507e('0x44')]][_0x507e('0x2b')]),_0x507e('0x46'),JSON['stringify'](_0x1490e4['campaignsPreview'][_0x1490e4[_0x507e('0x14')][_0x3bcb08]['queue']]['pTalking']),JSON['stringify'](_0x1490e4['actions'][_0x3bcb08][_0x507e('0x47')]),JSON[_0x507e('0x48')](_['pick'](_0x1490e4[_0x507e('0x14')][_0x3bcb08],[_0x507e('0x49'),_0x507e('0x4a'),'VoiceQueueId',_0x507e('0x4b')])));return ami[_0x507e('0x4c')]({'action':_0x507e('0x4d'),'channel':_0x1490e4['actions'][_0x3bcb08]['channel']})['catch'](function(_0x7e6f3b){if(_0x7e6f3b[_0x507e('0x30')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x1490e4[_0x507e('0x14')][_0x3bcb08]){ut[_0x507e('0x4e')](_0x1490e4[_0x507e('0x11')][_0x1490e4['actions'][_0x3bcb08][_0x507e('0x44')]],'[clearZombieChannel]');if(_0x1490e4['actions'][_0x3bcb08][_0x507e('0x47')]===!![]){ut[_0x507e('0x4f')](_0x1490e4[_0x507e('0x11')][_0x1490e4[_0x507e('0x14')][_0x3bcb08][_0x507e('0x44')]],'[clearZombieChannel]');ut[_0x507e('0x50')](_0x507e('0x51')+_0x3bcb08,_0x1490e4['actions'][_0x3bcb08][_0x507e('0x44')]);}ut[_0x507e('0x50')](_0x507e('0x52')+_0x3bcb08,_0x1490e4[_0x507e('0x14')][_0x3bcb08]['queue']);delete _0x1490e4[_0x507e('0x14')][_0x3bcb08];}},0x2328);}});}});};Preview[_0x507e('0xe')][_0x507e('0x3c')]=function(){var _0x1c42fe=this;loggerAction[_0x507e('0x23')]('[action]',_[_0x507e('0x53')](this[_0x507e('0x14')]));for(var _0x5a9ad7 in this[_0x507e('0x14')]){if(_0x1c42fe[_0x507e('0x14')][_0x507e('0x38')](_0x5a9ad7)){_0x1c42fe[_0x507e('0x40')](_0x5a9ad7);}}};Preview[_0x507e('0xe')][_0x507e('0x54')]=function(_0x113a56){var _0x4c640c=this;rpcDb[_0x507e('0x55')](_0x113a56['id'],ut[_0x507e('0x56')](this[_0x507e('0x15')]))['then'](function(_0x1f048e){if(!_[_0x507e('0x42')](_0x1f048e)){for(var _0x420844=0x0;_0x420844<_0x1f048e[_0x507e('0x57')];_0x420844+=0x1){if(ut[_0x507e('0x58')](_0x1f048e[_0x420844][_0x507e('0x59')])<_0x113a56[_0x507e('0x5a')]*0x3c){if(_0x1f048e[_0x420844][_0x507e('0x5b')]&&!_0x1f048e[_0x420844][_0x507e('0x5b')][_0x507e('0x5c')]){_0x4c640c[_0x507e('0x5d')](_0x1f048e[_0x420844]['id'])[_0x507e('0x5e')](ut[_0x507e('0x5f')](_0x507e('0x60')))[_0x507e('0x61')](ut[_0x507e('0x5f')]('[RecallMe]'));}else{rpcDb['disableContact'](_0x1f048e[_0x420844]['id']);}}else{var _0x214e5a=new Action(_0x1f048e[_0x420844],_0x113a56);_0x214e5a['starttime']=moment()[_0x507e('0x25')](_0x507e('0x62'));_0x113a56[_0x507e('0x63')]+=0x1;ut[_0x507e('0x64')](_0x214e5a,0x17,_0x507e('0x65'));if(_0x113a56[_0x507e('0x66')]){rpcDb['rescheduleContactInQueue'](ut[_0x507e('0x67')](_0x1f048e[_0x420844]));rpcDb[_0x507e('0x68')](_0x214e5a,_0x507e('0x69'));}else{ut[_0x507e('0x64')](_0x214e5a,0x16,'RecallFailedTimeout');rpcDb[_0x507e('0x68')](_0x214e5a,_0x507e('0x6a'));rpcDb[_0x507e('0x6b')](_0x214e5a,_0x507e('0x6a'));}}}}})[_0x507e('0x61')](ut['logger2'](_0x507e('0x6c')));};Preview[_0x507e('0xe')][_0x507e('0x3f')]=function(_0x19e120){_0x19e120[_0x507e('0x2d')]=!![];if(ut[_0x507e('0x6d')](_0x19e120['loggedIn'])){_0x19e120[_0x507e('0x30')]=utils[_0x507e('0x34')]['NO_AGENTS_LOGGED'];}else if(!ut[_0x507e('0x6e')](_0x19e120[_0x507e('0x3e')])){_0x19e120[_0x507e('0x30')]=utils[_0x507e('0x34')][_0x507e('0x31')];}else if(!this[_0x507e('0x6f')](_0x19e120['Trunk'])){if(!this[_0x507e('0x6f')](_0x19e120[_0x507e('0x70')])){_0x19e120['message']=utils['CAMPAIGN_STATUS'][_0x507e('0x71')];}else{_0x19e120[_0x507e('0x30')]=utils[_0x507e('0x34')][_0x507e('0x72')];}}else{_0x19e120['message']=utils[_0x507e('0x34')][_0x507e('0x72')];}};Preview[_0x507e('0xe')]['callProgressDetectingCustomer']=function(_0x5c80a5,_0x37eed0,_0x1ff992){var _0x52c075=this;var _0x4e72d6=this[_0x507e('0x14')][_0x37eed0];var _0x412bc3=this[_0x507e('0x11')][_0x4e72d6[_0x507e('0x44')]];var _0x35d886;var _0x4162d1=![];var _0x1c4420=0x2;var _0x271415=0x3;if(_0x412bc3){switch(_0x1ff992){case'1':_0x412bc3[_0x507e('0x73')]+=0x1;_0x4e72d6[_0x507e('0x74')]+=0x1;_0x4e72d6[_0x507e('0x75')]=ut['totalGlobal'](_0x4e72d6);ut['logCustomer'](_0x4e72d6,0x0,'NoSuchNumber');ami[_0x507e('0x29')](_0x507e('0x76'),ut['buildObj'](_0x4e72d6,_0x507e('0x77')));rpcDb['createCustomerHistory'](_0x4e72d6,'[callProgressDetectingCustomer][logNoSuch]');_0x52c075[_0x507e('0x78')](_0x4e72d6,'0',_0x412bc3)[_0x507e('0x5e')](function(_0x1575bd){_0x4162d1=_0x1575bd['additional']==0x1;_0x1c4420=_0x412bc3[_0x507e('0x79')];_0x271415=_0x412bc3[_0x507e('0x7a')];if(!_0x4162d1){if(ut[_0x507e('0x7b')](_0x4e72d6)>=_0x412bc3[_0x507e('0x7c')]){_0x35d886=ut['cloneAction'](_0x4e72d6,0xf,_0x507e('0x7d'));rpcDb[_0x507e('0x6b')](_0x35d886,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{if(_0x4e72d6[_0x507e('0x74')]>=_0x412bc3['dialNoSuchNumberMaxRetry']){rpcDb[_0x507e('0x6b')](_0x4e72d6,_0x507e('0x7e'));}else{rpcDb['rescheduleContact'](ut[_0x507e('0x7f')](_0x4e72d6,_0x507e('0x74'),_0x412bc3[_0x507e('0x79')]),_0x4e72d6[_0x507e('0x80')],_0x4e72d6['activeContact']);}}delete this['actions'][_0x5c80a5[_0x507e('0x81')]];}else{_0x4e72d6[_0x507e('0x74')]++;logger[_0x507e('0x23')](_0x507e('0x82'),_0x4e72d6['countnosuchnumberretry']);logger[_0x507e('0x23')]('id',_0x4e72d6[_0x507e('0x83')]);_0x52c075[_0x507e('0x84')]({'id':_0x4e72d6[_0x507e('0x83')],'field':{'countnosuchnumberretry':_0x4e72d6[_0x507e('0x74')]}})['then'](function(){_0x52c075[_0x507e('0x85')](_0x4e72d6,_0x1c4420,_0x271415)['then'](function(){});});}});break;case _0x507e('0x86'):var _0x2b44ba=moment()[_0x507e('0x25')](_0x507e('0x62'));_0x4e72d6[_0x507e('0x87')]=_0x2b44ba;_0x4e72d6[_0x507e('0x88')]=_0x2b44ba;_0x4e72d6[_0x507e('0x47')]=!![];_0x412bc3[_0x507e('0x2c')]+=0x1;logger[_0x507e('0x23')]('[syncHangup][talking][increment]',_0x4e72d6[_0x507e('0x89')],_0x507e('0x8a'),_0x412bc3[_0x507e('0x27')],_0x507e('0x46'),_0x412bc3[_0x507e('0x2c')]);ami['emit'](_0x507e('0x8b'),ut[_0x507e('0x8c')](_0x4e72d6,_0x507e('0x8d'),this[_0x507e('0x11')][_0x4e72d6[_0x507e('0x44')]]));if(_0x412bc3[_0x507e('0x8e')]){ami[_0x507e('0x29')](_0x507e('0x8f'),ut[_0x507e('0x90')](_0x4e72d6));}break;case'16':ami[_0x507e('0x29')]('custom:agentcomplete',ut[_0x507e('0x8c')](_0x4e72d6,_0x507e('0x91'),this[_0x507e('0x11')][_0x4e72d6['queue']]));emitVoiceQueueChannelRemove(ut[_0x507e('0x8c')](_0x4e72d6,'complete'));_0x412bc3[_0x507e('0x92')]+=0x1;_0x412bc3['total']+=0x1;_0x412bc3['answered']+=0x1;ut[_0x507e('0x4f')](_0x412bc3,_0x507e('0x93'));_0x4e72d6[_0x507e('0x75')]=ut[_0x507e('0x7b')](_0x4e72d6);ut[_0x507e('0x64')](_0x4e72d6,0x4,'Answer');rpcDb[_0x507e('0x68')](_0x4e72d6,'[callProgressDetectingCustomer][logAnswer]');rpcDb[_0x507e('0x6b')](_0x4e72d6,'[callProgressDetectingCustomer][logAnswerGlobal]');rpcDb['crateCustomerReportQueue'](_0x4e72d6);_0x412bc3['sumDuration']+=_0x4e72d6['talktime'];_0x412bc3[_0x507e('0x94')]+=_0x4e72d6[_0x507e('0x95')];logger[_0x507e('0x23')](_0x507e('0x96'),_0x4e72d6['uniqueid'],_0x507e('0x8a'),_0x412bc3['name'],_0x507e('0x46'),_0x412bc3[_0x507e('0x2c')]);delete this[_0x507e('0x14')][_0x5c80a5[_0x507e('0x81')]];break;case _0x507e('0x97'):_0x412bc3['outboundBusyCallsDay']+=0x1;_0x4e72d6[_0x507e('0x98')]+=0x1;_0x4e72d6[_0x507e('0x75')]=ut[_0x507e('0x7b')](_0x4e72d6);ut[_0x507e('0x64')](_0x4e72d6,0x5,_0x507e('0x99'));_0x1c4420=_0x412bc3[_0x507e('0x9a')];_0x271415=_0x412bc3[_0x507e('0x7a')];ami[_0x507e('0x29')](_0x507e('0x9b'),ut[_0x507e('0x8c')](_0x4e72d6,_0x507e('0x9c')));rpcDb[_0x507e('0x68')](_0x4e72d6,'[callProgressDetectingCustomer][logBusy]');_0x52c075['verifyAdditionalPhones'](_0x4e72d6,'5',_0x412bc3)['then'](function(_0x385690){_0x4162d1=_0x385690['additional']==0x1;if(!_0x4162d1){if(ut['totalGlobal'](_0x4e72d6)>=_0x412bc3['dialGlobalMaxRetry']){_0x35d886=ut[_0x507e('0x9d')](_0x4e72d6,0xf,_0x507e('0x7d'));rpcDb[_0x507e('0x6b')](_0x35d886,'[callProgressDetectingCustomer][logBusyGlobal]');}else{if(_0x4e72d6[_0x507e('0x98')]>=_0x412bc3[_0x507e('0x9e')]){rpcDb[_0x507e('0x6b')](_0x4e72d6,_0x507e('0x9f'));}else{rpcDb[_0x507e('0xa0')](ut[_0x507e('0x7f')](_0x4e72d6,_0x507e('0x98'),_0x412bc3[_0x507e('0x9a')]),_0x4e72d6[_0x507e('0x80')],_0x4e72d6[_0x507e('0xa1')]);}}}else{_0x4e72d6[_0x507e('0x98')]++;_0x52c075[_0x507e('0x84')]({'id':_0x4e72d6[_0x507e('0x83')],'field':{'countbusyretry':_0x4e72d6[_0x507e('0x98')]}})[_0x507e('0x5e')](function(){_0x52c075[_0x507e('0x85')](_0x4e72d6,_0x1c4420,_0x271415)[_0x507e('0x5e')](function(){});});}});break;case _0x507e('0xa2'):_0x412bc3[_0x507e('0xa3')]+=0x1;_0x4e72d6['countnoanswerretry']+=0x1;_0x4e72d6[_0x507e('0x75')]=ut[_0x507e('0x7b')](_0x4e72d6);ut[_0x507e('0x64')](_0x4e72d6,0x3,_0x507e('0xa4'));_0x1c4420=_0x412bc3[_0x507e('0xa5')];_0x271415=_0x412bc3[_0x507e('0x7a')];var _0x338a1e=ut[_0x507e('0xa6')](_0x4e72d6,_0x412bc3);ami[_0x507e('0x29')](_0x507e('0xa7'),_0x338a1e);rpcDb[_0x507e('0x68')](_0x4e72d6,'[callProgressDetectingCustomer][logNoAnswer]');_0x52c075[_0x507e('0x78')](_0x4e72d6,'3',_0x412bc3)[_0x507e('0x5e')](function(_0x3386ce){_0x4162d1=_0x3386ce['additional']==0x1;if(!_0x4162d1){if(ut[_0x507e('0x7b')](_0x4e72d6)>=_0x412bc3['dialGlobalMaxRetry']){_0x35d886=ut[_0x507e('0x9d')](_0x4e72d6,0xf,_0x507e('0x7d'));rpcDb[_0x507e('0x6b')](_0x35d886,'[callProgressDetectingCustomer][logNoAnswerGlobal]');}else{if(_0x4e72d6['countnoanswerretry']>=_0x412bc3[_0x507e('0xa8')]){rpcDb[_0x507e('0x6b')](_0x4e72d6,_0x507e('0xa9'));}else{rpcDb[_0x507e('0xa0')](ut[_0x507e('0x7f')](_0x4e72d6,_0x507e('0xaa'),_0x412bc3[_0x507e('0xa5')]),_0x4e72d6[_0x507e('0x80')],_0x4e72d6['activeContact']);}}}else{_0x4e72d6[_0x507e('0xaa')]++;_0x52c075['incrementPreviewCounters']({'id':_0x4e72d6[_0x507e('0x83')],'field':{'countnoanswerretry':_0x4e72d6[_0x507e('0xaa')]}})[_0x507e('0x5e')](function(){_0x52c075[_0x507e('0x85')](_0x4e72d6,_0x1c4420,_0x271415)[_0x507e('0x5e')](function(){});});}});break;case _0x507e('0xab'):_0x412bc3[_0x507e('0xac')]+=0x1;_0x4e72d6[_0x507e('0xad')]+=0x1;_0x4e72d6[_0x507e('0x75')]=ut[_0x507e('0x7b')](_0x4e72d6);ut[_0x507e('0x64')](_0x4e72d6,0x8,_0x507e('0xae'));_0x1c4420=_0x412bc3['dialCongestionRetryFrequency'];_0x271415=_0x412bc3[_0x507e('0x7a')];ami['emit'](_0x507e('0xaf'),ut['buildObj'](_0x4e72d6,_0x507e('0xb0')));rpcDb[_0x507e('0x68')](_0x4e72d6,_0x507e('0xb1'));_0x52c075[_0x507e('0x78')](_0x4e72d6,'8',_0x412bc3)[_0x507e('0x5e')](function(_0x234922){_0x4162d1=_0x234922[_0x507e('0xb2')]==0x1;if(!_0x4162d1){if(ut[_0x507e('0x7b')](_0x4e72d6)>=_0x412bc3['dialGlobalMaxRetry']){_0x35d886=ut[_0x507e('0x9d')](_0x4e72d6,0xf,'Global');rpcDb[_0x507e('0x6b')](_0x35d886,_0x507e('0xb3'));}else{if(_0x4e72d6[_0x507e('0xad')]>=_0x412bc3[_0x507e('0xb4')]){rpcDb[_0x507e('0x6b')](_0x4e72d6,_0x507e('0xb1'));}else{rpcDb[_0x507e('0xa0')](ut[_0x507e('0x7f')](_0x4e72d6,_0x507e('0xad'),_0x412bc3[_0x507e('0x9a')]),_0x4e72d6[_0x507e('0x80')],_0x4e72d6[_0x507e('0xa1')]);}}}else{_0x4e72d6['countcongestionretry']++;_0x52c075[_0x507e('0x84')]({'id':_0x4e72d6[_0x507e('0x83')],'field':{'countcongestionretry':_0x4e72d6[_0x507e('0xad')]}})[_0x507e('0x5e')](function(){_0x52c075[_0x507e('0x85')](_0x4e72d6,_0x1c4420,_0x271415)[_0x507e('0x5e')](function(){});});}});break;case _0x507e('0xb5'):_0x412bc3[_0x507e('0xb6')]+=0x1;_0x4e72d6[_0x507e('0xb7')]+=0x1;_0x4e72d6[_0x507e('0x75')]=ut[_0x507e('0x7b')](_0x4e72d6);ut[_0x507e('0x64')](_0x4e72d6,0x14,_0x507e('0xb8'));_0x1c4420=_0x412bc3[_0x507e('0xb9')];_0x271415=_0x412bc3['callAdditionalPhoneAfterMin'];ami[_0x507e('0x29')](_0x507e('0xba'),ut['buildObj'](_0x4e72d6,_0x507e('0xbb')));rpcDb[_0x507e('0x68')](_0x4e72d6,_0x507e('0xbc'));_0x52c075[_0x507e('0x78')](_0x4e72d6,'20',_0x412bc3)[_0x507e('0x5e')](function(_0x21be8e){_0x4162d1=_0x21be8e[_0x507e('0xb2')]==0x1;if(!_0x4162d1){if(ut['totalGlobal'](_0x4e72d6)>=_0x412bc3['dialGlobalMaxRetry']){_0x35d886=ut[_0x507e('0x9d')](_0x4e72d6,0x14,_0x507e('0xb8'));rpcDb[_0x507e('0x6b')](_0x35d886,_0x507e('0xbd'));}else{if(_0x4e72d6[_0x507e('0xb7')]>=_0x412bc3[_0x507e('0xbe')]){rpcDb[_0x507e('0x6b')](_0x4e72d6,_0x507e('0xbd'));}else{rpcDb['rescheduleContact'](ut[_0x507e('0x7f')](_0x4e72d6,_0x507e('0xb7'),_0x412bc3['dialAgentRejectRetryFrequency']),_0x4e72d6[_0x507e('0x80')],_0x4e72d6['activeContact']);}}}else{_0x4e72d6[_0x507e('0xaa')]++;_0x52c075[_0x507e('0x84')]({'id':_0x4e72d6[_0x507e('0x83')],'field':{'countnoanswerretry':_0x4e72d6[_0x507e('0xaa')]}})['then'](function(){_0x52c075[_0x507e('0x85')](_0x4e72d6,_0x1c4420,_0x271415)[_0x507e('0x5e')](function(){});});}});break;case _0x507e('0xbf'):_0x412bc3[_0x507e('0xc0')]+=0x1;_0x4e72d6[_0x507e('0xc1')]+=0x1;_0x4e72d6[_0x507e('0x75')]=ut[_0x507e('0x7b')](_0x4e72d6);ut['logCustomer'](_0x4e72d6,0xb,'Abandoned');rpcDb['createCustomerHistory'](_0x4e72d6,'[callProgressDetectingCustomer][logAbandoned]');_0x52c075[_0x507e('0x78')](_0x4e72d6,'11',_0x412bc3)[_0x507e('0x5e')](function(_0x5dbf7f){_0x4162d1=_0x5dbf7f[_0x507e('0xb2')]==0x1;if(!_0x4162d1){if(ut['totalGlobal'](_0x4e72d6)>=_0x412bc3[_0x507e('0x7c')]){_0x35d886=ut[_0x507e('0x9d')](_0x4e72d6,0xf,_0x507e('0x7d'));rpcDb[_0x507e('0x6b')](_0x35d886,_0x507e('0xc2'));}else{if(_0x4e72d6[_0x507e('0xc3')]>=_0x412bc3[_0x507e('0xc4')]){rpcDb['createCustomerFinal'](_0x4e72d6,'[callProgressDetectingCustomer][logAbandoned]');}else{rpcDb['rescheduleContact'](ut[_0x507e('0x7f')](_0x4e72d6,_0x507e('0xc1'),_0x412bc3[_0x507e('0xc5')]),_0x4e72d6['unlockAgent'],_0x4e72d6['activeContact']);}}}else{_0x4e72d6[_0x507e('0xaa')]++;_0x52c075[_0x507e('0x84')]({'id':_0x4e72d6[_0x507e('0x83')],'field':{'countnoanswerretry':_0x4e72d6[_0x507e('0xaa')]}})[_0x507e('0x5e')](function(){_0x52c075[_0x507e('0x85')](_0x4e72d6,_0x1c4420,_0x271415)[_0x507e('0x5e')](function(){});});}});break;case'18':_0x412bc3[_0x507e('0xc6')]+=0x1;_0x4e72d6[_0x507e('0xc7')]+=0x1;_0x4e72d6[_0x507e('0x75')]=ut[_0x507e('0x7b')](_0x4e72d6);ut[_0x507e('0x64')](_0x4e72d6,0x12,_0x5c80a5[_0x507e('0xc8')]||_0x5c80a5[_0x507e('0xc9')]);ami[_0x507e('0x29')](_0x507e('0xca'),ut[_0x507e('0x8c')](_0x4e72d6,_0x507e('0xcb')));rpcDb['createCustomerHistory'](_0x4e72d6,_0x507e('0xcc'));_0x52c075[_0x507e('0x78')](_0x4e72d6,'18',_0x412bc3)[_0x507e('0x5e')](function(_0x455c1b){_0x4162d1=_0x455c1b[_0x507e('0xb2')]==0x1;if(!_0x4162d1){if(ut[_0x507e('0x7b')](_0x4e72d6)>=_0x412bc3[_0x507e('0x7c')]){_0x35d886=ut[_0x507e('0x9d')](_0x4e72d6,0x12,'Global');rpcDb[_0x507e('0x6b')](_0x35d886,'[callProgressDetectingCustomer][hangupInAMD]');}else{rpcDb['createCustomerFinal'](_0x4e72d6,'[callProgressDetectingCustomer][hangupInAMD]');}}else{_0x4e72d6['countnoanswerretry']++;_0x52c075['incrementPreviewCounters']({'id':_0x4e72d6[_0x507e('0x83')],'field':{'countnoanswerretry':_0x4e72d6[_0x507e('0xaa')]}})[_0x507e('0x5e')](function(){_0x52c075['swapAdditionalPhones'](_0x4e72d6,_0x1c4420,_0x271415)[_0x507e('0x5e')](function(){});});}});delete this[_0x507e('0x14')][_0x5c80a5[_0x507e('0x81')]];break;case'19':_0x412bc3['outboundUnknownCallsDay']+=0x1;_0x4e72d6['countglobal']=ut[_0x507e('0x7b')](_0x4e72d6);ut[_0x507e('0x64')](_0x4e72d6,0x13,_0x5c80a5[_0x507e('0xc8')]||_0x5c80a5[_0x507e('0xc9')]);ami[_0x507e('0x29')]('custom:amd',ut['buildObj'](_0x4e72d6,_0x507e('0xcb')));rpcDb[_0x507e('0x68')](_0x4e72d6,_0x507e('0xcd'));_0x52c075[_0x507e('0x78')](_0x4e72d6,'18',_0x412bc3)[_0x507e('0x5e')](function(_0x3516e6){_0x4162d1=_0x3516e6['additional']==0x1;if(!_0x4162d1){if(ut[_0x507e('0x7b')](_0x4e72d6)>=_0x412bc3[_0x507e('0x7c')]){_0x35d886=ut[_0x507e('0x9d')](_0x4e72d6,0xf,_0x507e('0x7d'));rpcDb[_0x507e('0x6b')](_0x35d886,'[callProgressDetectingCustomer][machine]');}else{rpcDb['createCustomerFinal'](_0x4e72d6,_0x507e('0xcd'));}}else{_0x4e72d6['countnoanswerretry']++;_0x52c075[_0x507e('0x84')]({'id':_0x4e72d6[_0x507e('0x83')],'field':{'countnoanswerretry':_0x4e72d6[_0x507e('0xaa')]}})['then'](function(){_0x52c075[_0x507e('0x85')](_0x4e72d6,_0x1c4420,_0x271415)[_0x507e('0x5e')](function(){});});}});delete this['actions'][_0x5c80a5[_0x507e('0x81')]];break;default:if(_0x4e72d6[_0x507e('0x47')]){ut['decrementTalkink'](_0x412bc3,_0x507e('0xce'));ut['loggerError'](_0x507e('0xcf')+_0x412bc3[_0x507e('0x27')],_0x5c80a5);}_0x412bc3[_0x507e('0xc6')]+=0x1;_0x4e72d6[_0x507e('0x75')]=ut[_0x507e('0x7b')](_0x4e72d6);ut['logCustomer'](_0x4e72d6,0xc,_0x5c80a5[_0x507e('0xc8')]||_0x5c80a5[_0x507e('0xc9')]);_0x1c4420=_0x412bc3[_0x507e('0xb9')];_0x271415=_0x412bc3['callAdditionalPhoneAfterMin'];rpcDb['createCustomerHistory'](_0x4e72d6,'[callProgressDetectingCustomer][logUnknown]');_0x52c075['verifyAdditionalPhones'](_0x4e72d6,'20',_0x412bc3)[_0x507e('0x5e')](function(_0x494e0e){_0x4162d1=_0x494e0e[_0x507e('0xb2')]==0x1;if(!_0x4162d1){if(ut[_0x507e('0x7b')](_0x4e72d6)>=_0x412bc3[_0x507e('0x7c')]){_0x35d886=ut[_0x507e('0x9d')](_0x4e72d6,0xf,'Global');rpcDb[_0x507e('0x6b')](_0x35d886,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb[_0x507e('0x6b')](_0x4e72d6,_0x507e('0xd0'));}delete this['actions'][_0x5c80a5[_0x507e('0x81')]];}else{_0x52c075[_0x507e('0x85')](_0x4e72d6,_0x1c4420,_0x271415)[_0x507e('0x5e')](function(){});}});}if(!(_0x4e72d6[_0x507e('0x47')]&&_0x1ff992==='16')){ut[_0x507e('0x4e')](_0x412bc3,_0x507e('0xd1'));logger[_0x507e('0x23')](_0x507e('0xd2'),_0x4e72d6['uniqueid'],_0x507e('0x8a'),_0x412bc3[_0x507e('0x27')],_0x507e('0x45'),_0x412bc3[_0x507e('0x2b')]);}if(_0x1ff992!==_0x507e('0x86')){delete this[_0x507e('0x14')][_0x5c80a5[_0x507e('0x81')]];delete this[_0x507e('0x14')][_0x5c80a5[_0x507e('0xd3')]];}_0x412bc3['queueSummaryCountersUpdated']=!![];}};Preview[_0x507e('0xe')][_0x507e('0xd4')]=function(_0x1f973f,_0x5ce668,_0x394151){if(_[_0x507e('0xd5')](_0x5ce668)&&_0x507e('0xd6')!==typeof _0x5ce668){return;}if(_[_0x507e('0xd5')](_0x394151)&&_0x507e('0xd6')!==typeof _0x394151){return;}switch(_0x394151[_0x507e('0xd7')]){case'0':ut['logAgent'](_0x1f973f,0x0,'NoSuchNumber');rpcDb[_0x507e('0xd8')](_0x1f973f,_0x507e('0xd9'));break;case'3':ut['logAgent'](_0x1f973f,0x3,_0x507e('0xa4'));rpcDb['createAgentHistory'](_0x1f973f,_0x507e('0xda'));break;case'5':ut[_0x507e('0xdb')](_0x1f973f,0x5,_0x507e('0x99'));rpcDb['createAgentHistory'](_0x1f973f,'[callProgressDetectingAgent][logBusy]');break;case'8':ut['logAgent'](_0x1f973f,0x8,_0x507e('0xae'));rpcDb['createAgentHistory'](_0x1f973f,'[callProgressDetectingAgent][logCongestion]');break;case'22':ut[_0x507e('0xdb')](_0x1f973f,0x16,_0x507e('0xdc'));rpcDb[_0x507e('0xd8')](_0x1f973f,_0x507e('0xdd'));break;default:ut['logAgent'](_0x1f973f,0xc,_0x394151[_0x507e('0xd7')]);rpcDb[_0x507e('0xd8')](_0x1f973f,_0x507e('0xde'));}ut[_0x507e('0x4e')](_0x5ce668,_0x507e('0xdf'));logger[_0x507e('0x23')](_0x507e('0xe0'),_0x1f973f[_0x507e('0x89')],_0x507e('0x8a'),_0x5ce668[_0x507e('0x27')],'originated:\x20',_0x5ce668['originated']);delete this[_0x507e('0x14')][_0x1f973f[_0x507e('0x89')]];};Preview[_0x507e('0xe')]['verifyAdditionalPhones']=function(_0x2f6e6e,_0x3984ee,_0x5b4c7a){return cmHopperAdditionalPhone[_0x507e('0x78')](_0x2f6e6e,_0x3984ee,_0x5b4c7a)[_0x507e('0x61')](logger[_0x507e('0x23')]('[verifyAdditionalPhone]\x20'));};Preview[_0x507e('0xe')][_0x507e('0x85')]=function(_0x3d13e5,_0x3fb927,_0x10e537){return cmHopperAdditionalPhone[_0x507e('0x85')](_0x3d13e5,_0x3fb927,_0x10e537)[_0x507e('0x61')](logger[_0x507e('0x23')]('[swapAdditionalPhone]\x20'));};Preview[_0x507e('0xe')][_0x507e('0x84')]=function(_0x268d25){return Promise[_0x507e('0xe1')]()[_0x507e('0x5e')](cmHopperAdditionalPhone[_0x507e('0x84')](_0x268d25))[_0x507e('0x61')](logger[_0x507e('0x23')](_0x507e('0xe2')));};Preview[_0x507e('0xe')][_0x507e('0xe3')]=function(_0x24702e,_0x55b419,_0x30dcd5,_0x504f22,_0x26c435){var _0x34fdd3=this;return new Promise(function(_0xe2f459,_0xf1362d){if(_[_0x507e('0x42')](_0x55b419)||_['isNil'](_0x55b419[_0x507e('0xe4')])||_[_0x507e('0x42')](_0x55b419['phone'])||_[_0x507e('0x42')](_0x55b419['VoiceQueueId'])){_0xf1362d(ut['message'](_0x507e('0xe5'),_0x504f22,_0x26c435));return;}var _0x3c6497=uuid['v4']();var _0x14c70c=_0x34fdd3[_0x507e('0x11')][_0x55b419[_0x507e('0x43')][_0x507e('0x27')]];var _0x4ba39b=_0x30dcd5?_0x34fdd3[_0x507e('0x15')][_0x30dcd5]['id']:undefined;_0x34fdd3[_0x507e('0x14')][_0x3c6497]=new Action(_0x55b419,_0x14c70c,_0x3c6497,_0x30dcd5,_0x4ba39b);var _0x191520=_0x34fdd3[_0x507e('0x14')][_0x3c6497];_0x191520[_0x507e('0x80')]=_0x504f22;_0x191520[_0x507e('0xa1')]=_0x26c435;_0x191520[_0x507e('0xe6')]=_0x30dcd5;if(_['isEmpty'](_0x24702e)){_0x34fdd3[_0x507e('0xe7')](_0x191520,_0x14c70c,_0x55b419,_0x30dcd5)[_0x507e('0x5e')](function(_0x4bdb28){logger[_0x507e('0x23')](_0x507e('0xe8'),_0x507e('0xe9')+_0x191520[_0x507e('0x44')]+_0x507e('0xea')+_0x191520[_0x507e('0x83')],JSON[_0x507e('0x48')](_0x4bdb28));ami[_0x507e('0x29')]('custom:agentcalled',ut[_0x507e('0x8c')](_0x191520,_0x507e('0xeb'),_0x34fdd3[_0x507e('0x11')][_0x191520[_0x507e('0x44')]]));_0xe2f459(ut['message']('Calling'));})[_0x507e('0x61')](function(_0x2a5263){ut[_0x507e('0x35')]('[Preview][execCall][failure]',_0x2a5263);_0xf1362d(ut['message'](_0x507e('0xec'),_0x504f22,_0x26c435));});}else{_0x14c70c[_0x507e('0xed')]+=0x1;ut[_0x507e('0xee')](_0x191520);rpcDb[_0x507e('0xef')](_0x191520,_0x507e('0xf0'));delete _0x34fdd3[_0x507e('0x14')][_0x3c6497];_0xf1362d(ut['message']('Contact\x20in\x20black\x20List',_0x504f22,_0x26c435));}});};Preview[_0x507e('0xe')][_0x507e('0x6f')]=function(_0x2fa33a){return!_[_0x507e('0x42')](_0x2fa33a)&&!_[_0x507e('0x42')](_0x2fa33a[_0x507e('0x27')])&&!_['isNil'](_0x2fa33a[_0x507e('0xf1')])&&_0x2fa33a[_0x507e('0xf1')]&&!_[_0x507e('0x42')](this[_0x507e('0x13')][util[_0x507e('0x25')](_0x507e('0xf2'),_0x2fa33a['name'])])&&!_[_0x507e('0x42')](this[_0x507e('0x13')][util[_0x507e('0x25')](_0x507e('0xf2'),_0x2fa33a['name'])]['status'])&&(this[_0x507e('0x13')][util[_0x507e('0x25')](_0x507e('0xf2'),_0x2fa33a[_0x507e('0x27')])]['status']==='reachable'||this['trunks'][util[_0x507e('0x25')](_0x507e('0xf2'),_0x2fa33a[_0x507e('0x27')])][_0x507e('0x4d')]==='unmonitored');};Preview[_0x507e('0xe')][_0x507e('0x5d')]=function(_0x343dd1,_0x3f10c8){return this['execRun'](_0x343dd1,_0x3f10c8)[_0x507e('0x5e')](function(_0x37013f){return _[_0x507e('0xf3')](_0x37013f,[_0x507e('0x30')]);})[_0x507e('0x61')](function(_0x5ecf90){if(_0x5ecf90[_0x507e('0xf4')]){rpcDb[_0x507e('0xf5')](_0x343dd1);}if(_0x5ecf90[_0x507e('0xf1')]){rpcDb[_0x507e('0xf6')](_0x343dd1);}throw _[_0x507e('0xf3')](_0x5ecf90,[_0x507e('0x30')]);});};Preview['prototype'][_0x507e('0xf7')]=function(_0x4ee52b,_0x18f007){var _0x1ceeaf=this;var _0x13ab2b,_0x338c7f;return rpcDb[_0x507e('0xf8')](_0x4ee52b)['then'](function(_0x2ad6ec){if(!_[_0x507e('0x42')](_0x2ad6ec[0x0])){_0x338c7f=_0x2ad6ec[0x0][_0x507e('0xf9')]?![]:!![];_0x13ab2b=_0x2ad6ec[0x0][_0x507e('0xf9')]?!![]:![];_0x13ab2b=_0x18f007?!![]:_0x13ab2b;}var _0x19a57a=_0x1ceeaf[_0x507e('0xfa')](_0x2ad6ec);if(_0x19a57a[_0x507e('0xfb')]){rpcDb[_0x507e('0xfc')](_['pick'](_0x2ad6ec[0x0],[_0x507e('0xfd'),_0x507e('0xfe')]))[_0x507e('0x5e')](function(_0x52e990){_0x1ceeaf[_0x507e('0xe3')](_0x52e990,_0x2ad6ec[0x0],_0x18f007,_0x338c7f,_0x13ab2b)[_0x507e('0x5e')](function(_0x220033){return _0x220033;})[_0x507e('0x61')](function(_0x1ff1f8){throw _0x1ff1f8;});})[_0x507e('0x61')](function(_0x164768){ut[_0x507e('0x35')](_0x507e('0xff'),_0x164768);throw ut[_0x507e('0x30')](_0x507e('0x100'),_0x338c7f,_0x13ab2b);});}else{throw ut[_0x507e('0x30')](_0x19a57a[_0x507e('0x30')],_0x338c7f,_0x13ab2b);}})[_0x507e('0x61')](function(_0x1ef855){ut[_0x507e('0x35')](_0x507e('0x101'),_0x1ef855);throw ut[_0x507e('0x30')](_0x507e('0x100'),![],!![]);});};Preview[_0x507e('0xe')]['validateContact']=function(_0x194652){if(_[_0x507e('0x42')](_0x194652)||_[_0x507e('0x102')](_0x194652)||!_[_0x507e('0x42')](_0x194652[0x0][_0x507e('0x5b')])&&_['isNil'](_0x194652[0x0][_0x507e('0x5b')][_0x507e('0x27')])){ut[_0x507e('0x35')](_0x507e('0x103'),_0x194652);return{'isValid':![],'message':_0x507e('0x104')};}var _0xfda35c=this[_0x507e('0x11')][_0x194652[0x0]['Queue'][_0x507e('0x27')]];_0xfda35c['message']=utils['CAMPAIGN_STATUS']['ACTIVE'];if(_[_0x507e('0x42')](_0xfda35c)){ut[_0x507e('0x35')]('[Preview][validateContact][Empty\x20Campaign]',_0xfda35c);return{'isValid':![],'message':_0x507e('0x105')};}if(!this[_0x507e('0x6f')](_0xfda35c[_0x507e('0x106')])){ut['logger']('[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','campaign\x20Name:\x20'+_0xfda35c['name']+_0x507e('0x107'));if(!this[_0x507e('0x6f')](_0xfda35c[_0x507e('0x70')])){ut[_0x507e('0x35')](_0x507e('0x108'),_0xfda35c['name']+_0x507e('0x109'));return{'isValid':![],'message':_0x507e('0x10a')};}}if(!ut[_0x507e('0x6e')](_0xfda35c[_0x507e('0x3e')])){ut[_0x507e('0x35')](_0x507e('0x10b'),_0xfda35c[_0x507e('0x27')]+_0x507e('0x10c'));return{'isValid':![],'message':'campaign\x20Name:\x20'+_0xfda35c[_0x507e('0x27')]+_0x507e('0x10c')};}return{'isValid':!![],'message':_0x507e('0x10d')};};Preview[_0x507e('0xe')][_0x507e('0xe7')]=function(_0x17a3ba,_0x3cb4f6,_0x475047,_0x29960f){var _0x262b5a=this;return new Promise(function(_0x36390a,_0x2ba000){var _0x31dc3e=_0x17a3ba[_0x507e('0x89')];var _0x40efb5=_0x262b5a[_0x507e('0x6f')](_0x3cb4f6[_0x507e('0x106')])?util['format'](_0x507e('0x10e'),_0x3cb4f6[_0x507e('0x106')][_0x507e('0x27')],_[_0x507e('0x42')](_0x3cb4f6[_0x507e('0x10f')])?'':_0x3cb4f6[_0x507e('0x10f')][_0x507e('0x110')]()||'',_0x3cb4f6[_0x507e('0x111')]>0x0?_0x475047[_0x507e('0xfe')][_0x507e('0x112')](_0x3cb4f6[_0x507e('0x111')]):_0x475047['phone']):util['format'](_0x507e('0x10e'),_[_0x507e('0x42')](_0x3cb4f6[_0x507e('0x70')])?_0x3cb4f6[_0x507e('0x106')]['name']:_0x3cb4f6[_0x507e('0x70')][_0x507e('0x27')],_[_0x507e('0x42')](_0x3cb4f6[_0x507e('0x10f')])?'':_0x3cb4f6[_0x507e('0x10f')][_0x507e('0x110')]()||'',_0x3cb4f6['dialCutDigit']>0x0?_0x475047[_0x507e('0xfe')][_0x507e('0x112')](_0x3cb4f6['dialCutDigit']):_0x475047[_0x507e('0xfe')]);var _0x45ec9b=_0x262b5a['isTrunkReachable'](_0x3cb4f6[_0x507e('0x106')])?ut[_0x507e('0x113')](_0x3cb4f6[_0x507e('0x106')][_0x507e('0x114')],_0x3cb4f6[_0x507e('0x115')],_0x3cb4f6[_0x507e('0x116')]>0x0?ut[_0x507e('0x117')](_0x3cb4f6[_0x507e('0x118')],_0x3cb4f6[_0x507e('0x116')]):_0x3cb4f6[_0x507e('0x118')]):ut[_0x507e('0x113')](_[_0x507e('0x42')](_0x3cb4f6[_0x507e('0x70')])?_0x3cb4f6[_0x507e('0x106')]['callerid']:_0x3cb4f6[_0x507e('0x70')][_0x507e('0x114')],_0x3cb4f6['dialOriginateCallerIdName'],_0x3cb4f6[_0x507e('0x116')]>0x0?ut[_0x507e('0x117')](_0x3cb4f6[_0x507e('0x118')],_0x3cb4f6[_0x507e('0x116')]):_0x3cb4f6[_0x507e('0x118')]);if(_0x45ec9b){_0x17a3ba[_0x507e('0x119')]=ut[_0x507e('0x11a')](_0x45ec9b);_0x17a3ba['originatecalleridnum']=ut[_0x507e('0x11b')](_0x45ec9b);}var _0x326d99=ut[_0x507e('0x11c')](_0x3cb4f6,_0x475047,_0x40efb5,_0x45ec9b,_0x31dc3e,_0x17a3ba);var _0x284bc0=utils[_0x507e('0x11d')](_0x475047[_0x507e('0xe4')]);Object[_0x507e('0x11e')](_0x326d99,_0x284bc0);_['merge'](_0x17a3ba,ut[_0x507e('0x11f')](_0x326d99));_0x17a3ba['starttime']=moment()[_0x507e('0x25')](_0x507e('0x62'));_0x3cb4f6[_0x507e('0x120')]=_0x326d99;var _0x1b1d51=ut['variablesAction'](_0x17a3ba,_0x3cb4f6,_0x326d99,_0x17a3ba[_0x507e('0xa1')],_0x29960f);return ami[_0x507e('0x4c')](_0x1b1d51)[_0x507e('0x5e')](function(_0x5b0bd0){_0x3cb4f6[_0x507e('0x2b')]+=0x1;logger[_0x507e('0x23')](_0x507e('0x121'),_0x31dc3e,_0x507e('0x8a'),_0x3cb4f6['name'],'originated:\x20',_0x3cb4f6[_0x507e('0x2b')]);_0x36390a(_0x5b0bd0);})[_0x507e('0x61')](function(_0x13a21d){ut[_0x507e('0xdb')](_0x17a3ba,0xe,'OriginateError');rpcDb[_0x507e('0xd8')](_0x17a3ba,_0x507e('0x122'));_0x2ba000(_0x13a21d);});});};Preview[_0x507e('0xe')][_0x507e('0x123')]=function(_0x3b9ede){if(this[_0x507e('0x14')][_0x3b9ede[_0x507e('0x81')]]){this[_0x507e('0x14')][_0x3b9ede[_0x507e('0x81')]][_0x507e('0x124')]=_0x3b9ede[_0x507e('0x124')];}};Preview[_0x507e('0xe')][_0x507e('0x18')]=function(_0x422bf7){var _0x1e526c=this;var _0x2b32ac=this['actions'][_0x422bf7['actionid']];if(_0x2b32ac){if(_0x2b32ac[_0x507e('0xe6')]&&this[_0x507e('0x15')][_0x2b32ac['lookAgent']]){ut[_0x507e('0x125')](_0x2b32ac,this[_0x507e('0x15')][_0x2b32ac[_0x507e('0xe6')]][_0x507e('0x27')],this[_0x507e('0x15')][_0x2b32ac[_0x507e('0xe6')]]['id']);}var _0x150fe9=_[_0x507e('0x126')](_0x2b32ac);_0x150fe9[_0x507e('0x87')]=moment()[_0x507e('0x25')](_0x507e('0x62'));var _0x343a0b=_0x1e526c['campaignsPreview'][_0x2b32ac['queue']];if(ut[_0x507e('0x127')](_0x422bf7['response'])){if(_0x2b32ac['unlockAgent']){rpcDb[_0x507e('0xf5')](_0x2b32ac['idContact']);}if(_0x2b32ac[_0x507e('0xa1')]){rpcDb['disableContact'](_0x2b32ac[_0x507e('0x83')]);}ami[_0x507e('0x29')]('custom:agentringnoanswer',ut['buildObj'](_0x2b32ac,_0x507e('0x128'),this['campaignsPreview'][_0x2b32ac[_0x507e('0x44')]]));this[_0x507e('0xd4')](_0x150fe9,_0x343a0b,_0x422bf7);}else{_0x2b32ac[_0x507e('0x129')]=moment()[_0x507e('0x25')](_0x507e('0x62'));ut['logAgent'](_0x150fe9,0x4,_0x507e('0x12a'));rpcDb[_0x507e('0xd8')](_0x150fe9,_0x507e('0x12b'));}}};Preview[_0x507e('0xe')][_0x507e('0x1a')]=function(_0x16a18e){var _0x3924df=this[_0x507e('0x14')][_0x16a18e[_0x507e('0x81')]];var _0x1c10fc;if(_0x3924df){_0x1c10fc=this[_0x507e('0x11')][_0x3924df['queue']];logger[_0x507e('0x23')](_0x507e('0x12c'),_0x16a18e[_0x507e('0x81')],_0x507e('0x8a'),_0x1c10fc['name'],_0x507e('0x46'),_0x1c10fc[_0x507e('0x2c')]);}if(this[_0x507e('0x14')][_0x16a18e['linkedid']]&&_0x16a18e[_0x507e('0x81')]!==_0x16a18e[_0x507e('0x89')]){if(_0x16a18e['cause']==='16'&&this[_0x507e('0x14')][_0x16a18e[_0x507e('0x81')]]['dialAnswer']){this[_0x507e('0x12d')](_0x16a18e,_0x16a18e[_0x507e('0x81')],_0x16a18e[_0x507e('0x12e')]);}else if(this[_0x507e('0x14')][_0x16a18e['linkedid']]['dialAnswer']){logger['info']('[syncHangup][talking][cause]',_0x16a18e[_0x507e('0x81')],_0x16a18e[_0x507e('0x12e')],_0x507e('0x8a'),_0x1c10fc['name'],_0x507e('0x46'),_0x1c10fc[_0x507e('0x2c')]);this[_0x507e('0x12d')](_0x16a18e,_0x16a18e[_0x507e('0x81')],_0x16a18e[_0x507e('0x12e')]);}}else if(_0x3924df&&_[_0x507e('0x42')](_0x3924df['statedesc'])&&_0x1c10fc[_0x507e('0x12f')]&&_0x16a18e[_0x507e('0x81')]===_0x16a18e[_0x507e('0x89')]&&_[_0x507e('0x42')](_0x16a18e[_0x507e('0xd7')])&&_0x16a18e['cause']==='16'&&_0x16a18e[_0x507e('0x130')]==='6'&&_[_0x507e('0xd5')](_0x3924df[_0x507e('0x131')])){if(_0x3924df[_0x507e('0x80')]){rpcDb['unlockContact'](_0x3924df['idContact']);}if(_0x3924df[_0x507e('0xa1')]){rpcDb[_0x507e('0xf6')](_0x3924df[_0x507e('0x83')]);}_0x16a18e[_0x507e('0xd7')]='22';this['callProgressDetectingAgent'](_0x3924df,_0x1c10fc,_0x16a18e);}else if(_0x3924df&&_0x3924df[_0x507e('0x131')]){if(_0x16a18e[_0x507e('0x12e')]==='16'&&this[_0x507e('0x14')][_0x16a18e['linkedid']]['dialAnswer']){logger[_0x507e('0x23')](_0x507e('0x132'),_0x16a18e[_0x507e('0x81')],_0x16a18e[_0x507e('0x12e')],'\x20Queue',_0x1c10fc[_0x507e('0x27')],'pTalking:\x20',_0x1c10fc[_0x507e('0x2c')]);this[_0x507e('0x12d')](_0x16a18e,_0x16a18e[_0x507e('0x81')],_0x16a18e[_0x507e('0x12e')]);}else if(this[_0x507e('0x14')][_0x16a18e[_0x507e('0x81')]][_0x507e('0x47')]){logger[_0x507e('0x23')](_0x507e('0x133'),_0x16a18e[_0x507e('0x81')],_0x16a18e[_0x507e('0x12e')],_0x507e('0x8a'),_0x1c10fc[_0x507e('0x27')],'pTalking:\x20',_0x1c10fc[_0x507e('0x2c')]);this[_0x507e('0x12d')](_0x16a18e,_0x16a18e[_0x507e('0x81')],_0x16a18e['cause']);}}};Preview['prototype'][_0x507e('0x134')]=function(_0x3faaab){if(this[_0x507e('0x14')][_0x3faaab[_0x507e('0xd3')]]&&_0x3faaab[_0x507e('0xd3')]!==_0x3faaab[_0x507e('0x135')]){this[_0x507e('0x12d')](_0x3faaab,_0x3faaab[_0x507e('0xd3')],_0x3faaab['dialstatus']);}};Preview[_0x507e('0xe')][_0x507e('0x1c')]=function(_0x30008b){if(this[_0x507e('0x14')][_0x30008b[_0x507e('0x81')]]&&_0x30008b[_0x507e('0x81')]!==_0x30008b[_0x507e('0x89')]&&!this[_0x507e('0x14')][_0x30008b[_0x507e('0x81')]][_0x507e('0x47')]){if(_0x30008b[_0x507e('0x12e')]==='1'){this[_0x507e('0x12d')](_0x30008b,_0x30008b[_0x507e('0x81')],_0x30008b[_0x507e('0x12e')]);}}};Preview[_0x507e('0xe')][_0x507e('0x136')]=function(_0x53975f,_0x430563,_0xa0943f){if(this[_0x507e('0x14')][_0x53975f]){if(_[_0x507e('0x42')](this[_0x507e('0x14')][_0x53975f]['variables'])){this[_0x507e('0x14')][_0x53975f]['variables']={};}this[_0x507e('0x14')][_0x53975f][_0x507e('0x120')][_0x430563]=_0xa0943f;}};Preview[_0x507e('0xe')][_0x507e('0x1f')]=function(_0x4e490d){try{if(!_['isNil'](_0x4e490d)){if(ut[_0x507e('0x137')](_[_0x507e('0x138')](_0x4e490d[_0x507e('0x139')])[0x0])){this['addVariable'](_0x4e490d[_0x507e('0x89')],_[_0x507e('0x138')](_0x4e490d[_0x507e('0x139')])[0x0],_0x4e490d[_0x507e('0x13a')]);}}}catch(_0x387d38){logger[_0x507e('0x13b')](_0x507e('0x13c'),util['inspect'](_0x387d38,{'showHidden':![],'depth':null}));}};Preview[_0x507e('0xe')]['syncAttendedTransfer']=function(_0x49608d){if(_0x49608d){if(this[_0x507e('0x14')][_0x49608d['transfertargetlinkedid']]){this[_0x507e('0x14')][_0x49608d[_0x507e('0x13d')]][_0x507e('0x131')]=!![];}}};Preview[_0x507e('0xe')][_0x507e('0x21')]=function(_0x306e14){if(_0x306e14){if(this[_0x507e('0x14')][_0x306e14[_0x507e('0x13e')]]){this['actions'][_0x306e14['transfererlinkedid']]['transfer']=!![];}}};module[_0x507e('0x13f')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index bf2c305..76e3acf 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 _0xdadc=['[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercompleteAt','endtime','connectedlinename','membername','exten','holdtime','assigned','lastAssignedTo','queuecallerexitreason','COMPLETED','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','preview','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/agentReportPreview','../rpc/voiceQueueReport','inspect','catch','[createHistory]\x20','resolve','then','createHistory','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','createAgentHistory','rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled','unlockContact','disableContact'];(function(_0x3de5d0,_0x17eb94){var _0x7c4432=function(_0x5341fa){while(--_0x5341fa){_0x3de5d0['push'](_0x3de5d0['shift']());}};_0x7c4432(++_0x17eb94);}(_0xdadc,0x122));var _0xcdad=function(_0x33d766,_0x5b2d9a){_0x33d766=_0x33d766-0x0;var _0x5117e0=_0xdadc[_0x33d766];return _0x5117e0;};'use strict';var util=require(_0xcdad('0x0'));var BPromise=require(_0xcdad('0x1'));var logger=require(_0xcdad('0x2'))(_0xcdad('0x3'));var cmHopper=require(_0xcdad('0x4'));var cmHopperHistory=require(_0xcdad('0x5'));var cmHopperBlack=require(_0xcdad('0x6'));var agentReportPreview=require(_0xcdad('0x7'));var voiceQueueReport=require(_0xcdad('0x8'));function loggerCatch(_0x539875){return function(_0x44fb83){logger['error'](_0x539875,util[_0xcdad('0x9')](_0x44fb83,{'showHidden':![],'depth':null}));};}function create(_0x3e08e5){return cmHopperHistory['createHistory'](_0x3e08e5)[_0xcdad('0xa')](loggerCatch(_0xcdad('0xb')));}function createAgent(_0xa1ff80){return BPromise[_0xcdad('0xc')]()[_0xcdad('0xd')](agentReportPreview[_0xcdad('0xe')](_0xa1ff80))['catch'](loggerCatch(_0xcdad('0xb')));}function moveContact(_0x402771){return cmHopper[_0xcdad('0xf')](_0x402771,!![])[_0xcdad('0xa')](loggerCatch(_0xcdad('0x10')));}exports[_0xcdad('0x11')]=function(_0x1166cf){return cmHopperBlack['checkIsBlackList'](_0x1166cf)[_0xcdad('0xa')](loggerCatch(_0xcdad('0x12')));};exports[_0xcdad('0x13')]=function(_0x99c2a2){return BPromise[_0xcdad('0xc')]()['then'](cmHopper[_0xcdad('0x13')](_0x99c2a2))[_0xcdad('0xa')](loggerCatch('[getContactPreview]\x20'));};exports[_0xcdad('0xe')]=function(_0x48f594,_0x2e5d77){create(_0x48f594)[_0xcdad('0xa')](loggerCatch(_0x2e5d77));moveContact(_0x48f594)[_0xcdad('0xa')](loggerCatch(_0x2e5d77));};exports[_0xcdad('0x14')]=function(_0x40e34d,_0x4bb4c1){createAgent(_0x40e34d)['catch'](loggerCatch(_0x4bb4c1));};exports['createCustomerHistory']=function(_0x44cd36,_0x39da97){create(_0x44cd36)[_0xcdad('0xa')](loggerCatch(_0x39da97));};exports['createCustomerFinal']=function(_0xc15f55,_0x5c3518){moveContact(_0xc15f55)[_0xcdad('0xa')](loggerCatch(_0x5c3518));};exports[_0xcdad('0x15')]=function(_0x3e4461,_0x4d9093,_0x529dd2){if(_0x4d9093){_0x3e4461[_0xcdad('0x16')]=null;}if(_0x529dd2){_0x3e4461[_0xcdad('0x17')]=![];}return cmHopper['rescheduleContact'](_0x3e4461)[_0xcdad('0xa')](loggerCatch(_0xcdad('0x18')));};exports[_0xcdad('0x19')]=function(_0x24169b){return cmHopper['countReScheduled'](_0x24169b)['catch'](loggerCatch('[countReScheduled]\x20'));};exports[_0xcdad('0x1a')]=function(_0xe4551c){return cmHopper[_0xcdad('0x1a')]({'UserId':null},_0xe4551c,0x1)[_0xcdad('0xa')](loggerCatch('[unlockContact]\x20'));};exports[_0xcdad('0x1b')]=function(_0x2f2e03){return cmHopper[_0xcdad('0x1a')]({'active':![]},_0x2f2e03,0x1)[_0xcdad('0xa')](loggerCatch(_0xcdad('0x1c')));};exports[_0xcdad('0x1d')]=function(_0x105323){var _0x3f9c23={};_0x3f9c23['type']=_0x105323[_0xcdad('0x1e')];_0x3f9c23[_0xcdad('0x1f')]=_0x105323[_0xcdad('0x1f')];_0x3f9c23['calleridnum']=_0x105323[_0xcdad('0x20')];_0x3f9c23['calleridname']=_0x105323[_0xcdad('0x21')];_0x3f9c23[_0xcdad('0x22')]=_0x105323['queue'];_0x3f9c23[_0xcdad('0x23')]=_0x105323[_0xcdad('0x24')];_0x3f9c23[_0xcdad('0x25')]=_0x105323['answertime'];_0x3f9c23['queuecallercomplete']=0x1;_0x3f9c23[_0xcdad('0x26')]=_0x105323[_0xcdad('0x27')];_0x3f9c23[_0xcdad('0x28')]=_0x105323[_0xcdad('0x29')];_0x3f9c23['context']='from-sip';_0x3f9c23[_0xcdad('0x2a')]='xcally-motion-preview';_0x3f9c23[_0xcdad('0x2b')]=0x0;_0x3f9c23[_0xcdad('0x2c')]=0x1;_0x3f9c23[_0xcdad('0x2d')]=_0x105323[_0xcdad('0x29')];_0x3f9c23[_0xcdad('0x2e')]=_0xcdad('0x2f');return BPromise[_0xcdad('0xc')]()[_0xcdad('0xd')](voiceQueueReport['create'](_0x3f9c23))[_0xcdad('0xa')](loggerCatch(_0xcdad('0x30')));};exports[_0xcdad('0x31')]=function(_0x30a392,_0x77c588){return BPromise['resolve']()[_0xcdad('0xd')](cmHopper['getContactRecallMe'](_0x30a392,_0x77c588))['catch'](loggerCatch(_0xcdad('0x32')));};exports[_0xcdad('0x33')]=function(_0x2e4fbd){return cmHopper['rescheduleContact'](_0x2e4fbd,!![],!![])[_0xcdad('0xa')](loggerCatch(_0xcdad('0x34')));}; \ No newline at end of file +var _0x5340=['context','assigned','lastAssignedTo','queuecallerexitreason','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueReport','error','inspect','createHistory','[createHistory]\x20','resolve','then','moveContactManagedDialer','catch','[moveContactManagedDialer]\x20','checkIsBlackList','getContactPreview','createAgentHistory','rescheduleContact','UserId','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','[activeContact]\x20','crateCustomerReportQueue','type','calleridnum','calleridname','queue','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','membername'];(function(_0x3bd99a,_0x200ade){var _0x135998=function(_0x446964){while(--_0x446964){_0x3bd99a['push'](_0x3bd99a['shift']());}};_0x135998(++_0x200ade);}(_0x5340,0x69));var _0x0534=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5340[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x0534('0x0'));var BPromise=require(_0x0534('0x1'));var logger=require(_0x0534('0x2'))('preview');var cmHopper=require(_0x0534('0x3'));var cmHopperHistory=require(_0x0534('0x4'));var cmHopperBlack=require(_0x0534('0x5'));var agentReportPreview=require('../rpc/agentReportPreview');var voiceQueueReport=require(_0x0534('0x6'));function loggerCatch(_0x13b0e5){return function(_0x56ac91){logger[_0x0534('0x7')](_0x13b0e5,util[_0x0534('0x8')](_0x56ac91,{'showHidden':![],'depth':null}));};}function create(_0x32f2a2){return cmHopperHistory[_0x0534('0x9')](_0x32f2a2)['catch'](loggerCatch(_0x0534('0xa')));}function createAgent(_0x554597){return BPromise[_0x0534('0xb')]()[_0x0534('0xc')](agentReportPreview[_0x0534('0x9')](_0x554597))['catch'](loggerCatch(_0x0534('0xa')));}function moveContact(_0x4223ee){return cmHopper[_0x0534('0xd')](_0x4223ee,!![])[_0x0534('0xe')](loggerCatch(_0x0534('0xf')));}exports[_0x0534('0x10')]=function(_0x2ef23c){return cmHopperBlack['checkIsBlackList'](_0x2ef23c)['catch'](loggerCatch('[checkIsBlackList]\x20'));};exports[_0x0534('0x11')]=function(_0x26a82b){return BPromise['resolve']()[_0x0534('0xc')](cmHopper['getContactPreview'](_0x26a82b))[_0x0534('0xe')](loggerCatch('[getContactPreview]\x20'));};exports['createHistory']=function(_0x700ad2,_0x4076dd){create(_0x700ad2)[_0x0534('0xe')](loggerCatch(_0x4076dd));moveContact(_0x700ad2)[_0x0534('0xe')](loggerCatch(_0x4076dd));};exports[_0x0534('0x12')]=function(_0x28c6a4,_0x56721a){createAgent(_0x28c6a4)[_0x0534('0xe')](loggerCatch(_0x56721a));};exports['createCustomerHistory']=function(_0x4130c3,_0x265bd1){create(_0x4130c3)[_0x0534('0xe')](loggerCatch(_0x265bd1));};exports['createCustomerFinal']=function(_0x514cc7,_0x254d25){moveContact(_0x514cc7)[_0x0534('0xe')](loggerCatch(_0x254d25));};exports[_0x0534('0x13')]=function(_0x58bedc,_0x2a657d,_0x19522f){if(_0x2a657d){_0x58bedc[_0x0534('0x14')]=null;}if(_0x19522f){_0x58bedc['active']=![];}return cmHopper[_0x0534('0x13')](_0x58bedc)[_0x0534('0xe')](loggerCatch(_0x0534('0x15')));};exports[_0x0534('0x16')]=function(_0x4c9da6){return cmHopper[_0x0534('0x16')](_0x4c9da6)[_0x0534('0xe')](loggerCatch(_0x0534('0x17')));};exports[_0x0534('0x18')]=function(_0x2de81a){return cmHopper[_0x0534('0x18')]({'UserId':null},_0x2de81a,0x1)[_0x0534('0xe')](loggerCatch(_0x0534('0x19')));};exports['disableContact']=function(_0x24fbd2){return cmHopper['unlockContact']({'active':![]},_0x24fbd2,0x1)['catch'](loggerCatch(_0x0534('0x1a')));};exports[_0x0534('0x1b')]=function(_0xfb718c){var _0x4de9ef={};_0x4de9ef[_0x0534('0x1c')]=_0xfb718c[_0x0534('0x1c')];_0x4de9ef['uniqueid']=_0xfb718c['uniqueid'];_0x4de9ef[_0x0534('0x1d')]=_0xfb718c['calleridnum'];_0x4de9ef[_0x0534('0x1e')]=_0xfb718c[_0x0534('0x1e')];_0x4de9ef[_0x0534('0x1f')]=_0xfb718c[_0x0534('0x1f')];_0x4de9ef['queuecallerjoinAt']=_0xfb718c[_0x0534('0x20')];_0x4de9ef[_0x0534('0x21')]=_0xfb718c[_0x0534('0x20')];_0x4de9ef[_0x0534('0x22')]=0x1;_0x4de9ef[_0x0534('0x23')]=_0xfb718c[_0x0534('0x24')];_0x4de9ef[_0x0534('0x25')]=_0xfb718c[_0x0534('0x26')];_0x4de9ef[_0x0534('0x27')]='from-sip';_0x4de9ef['exten']='xcally-motion-preview';_0x4de9ef['holdtime']=0x0;_0x4de9ef[_0x0534('0x28')]=0x1;_0x4de9ef[_0x0534('0x29')]=_0xfb718c[_0x0534('0x26')];_0x4de9ef[_0x0534('0x2a')]='COMPLETED';return BPromise[_0x0534('0xb')]()[_0x0534('0xc')](voiceQueueReport['create'](_0x4de9ef))[_0x0534('0xe')](loggerCatch(_0x0534('0x2b')));};exports[_0x0534('0x2c')]=function(_0x48c841,_0x43f89a){return BPromise['resolve']()[_0x0534('0xc')](cmHopper[_0x0534('0x2c')](_0x48c841,_0x43f89a))['catch'](loggerCatch(_0x0534('0x2d')));};exports[_0x0534('0x2e')]=function(_0x59aeaa){return cmHopper[_0x0534('0x13')](_0x59aeaa,!![],!![])['catch'](loggerCatch(_0x0534('0x2f')));}; \ 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 d8d73b6..0b00364 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 _0x444e=['forEach','toLowerCase','lodash','preview','env','XCALLY_IP_AGI','127.0.0.1','inspect','loggerError','logger2','info','message','getCallerId','string','isUndefined','isEmpty','format','\x22\x22\x20<>','isActive','isNil','addVariables','Queue','name','\x22%s\x22\x20<%s>','calleridname','calleridnum','VoiceQueueId','dialOriginateTimeout','dialQueueProject2','monitor_format','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','toLower','updateOriginated','hasOwnProperty','originated','error','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','starttime','responsetime','ringtime','getSeconds','logLookAgent','membername','UserId','logCustomer','endtime','talktime','answertime','isFailure','Failure','variablesAction','BOOKED','uniqueid','originate','channelAgent','from-sip','timeout','countbusyretry','countcongestionretry','countagentrejectretry','countnosuchnumberretry','cloneAction','clone','scheduledAt','active','scheduledat','minutes','ContactId','ListId','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','lastevent','queue','motionChannel','voice','mandatoryDisposition','buildObj','agentReadyId','not_inuse','status','milliseconds','diff','seconds','createBody','CampaignId','filterKey','type','campaigntype','countglobal','callback','callbackuniqueid','callbackat','recallme','sipcallid','xmd-voicequeueid','xmd-listid','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqosbridged','rtpaudioqoslossbridged','bridgepeer','bridgepvtcallid','getCallerIdRandom','pow','replace','random','extractCalleridName','match','noanswer','variables','keys'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x444e,0x1a0));var _0xe444=function(_0x3e8eaf,_0x1a7c57){_0x3e8eaf=_0x3e8eaf-0x0;var _0x6b76e6=_0x444e[_0x3e8eaf];return _0x6b76e6;};'use strict';var util=require('util');var _=require(_0xe444('0x0'));var moment=require('moment');var logger=require('../../../../config/logger')(_0xe444('0x1'));var ipAgi=process[_0xe444('0x2')][_0xe444('0x3')]||_0xe444('0x4');var utils=require('../../dialer/utils');exports['loggerCatch']=function(_0xbeb51b){return function(_0x553294){logger['error'](_0xbeb51b,util[_0xe444('0x5')](_0x553294,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0x132717,_0x527e9a){logger['info'](_0x132717,util[_0xe444('0x5')](_0x527e9a,{'showHidden':![],'depth':null}));};exports[_0xe444('0x6')]=function(_0xa2578a,_0x54c3f5){logger['error'](_0xa2578a,util[_0xe444('0x5')](_0x54c3f5,{'showHidden':![],'depth':null}));};exports[_0xe444('0x7')]=function(_0x141601){return function(_0x5349dd){logger[_0xe444('0x8')](_0x141601,util[_0xe444('0x5')](_0x5349dd,{'showHidden':![],'depth':null}));};};exports[_0xe444('0x9')]=function(_0x3b710d,_0x122ab4,_0x57fe8b){return{'message':_0x3b710d,'unlock':_0x122ab4,'active':_0x57fe8b};};exports[_0xe444('0xa')]=function(_0x5b4d55,_0x3f5dad,_0x420726){if(!_['isUndefined'](_0x420726)&&_0xe444('0xb')===typeof _0x420726&&!_['isEmpty'](_0x420726)){if(!_[_0xe444('0xc')](_0x3f5dad)&&_0xe444('0xb')===typeof _0x3f5dad&&!_[_0xe444('0xd')](_0x3f5dad)){return util['format']('\x22%s\x22\x20<%s>',_0x3f5dad,_0x420726);}return util[_0xe444('0xe')]('\x22%s\x22\x20<%s>',_0x420726,_0x420726);}if(!_[_0xe444('0xc')](_0x5b4d55)&&_0xe444('0xb')===typeof _0x5b4d55&&!_[_0xe444('0xd')](_0x5b4d55)){return _0x5b4d55;}return _0xe444('0xf');};exports[_0xe444('0x10')]=function(_0x5e9d98){if(_[_0xe444('0x11')](_0x5e9d98)){return![];}return _0x5e9d98;};exports[_0xe444('0x12')]=function(_0x2a2365,_0x234f75,_0x27057f,_0x2a7d40,_0x2a5d11,_0x32edd1){var _0x356152={'XMD-QUEUE':_0x234f75[_0xe444('0x13')]?_0x234f75[_0xe444('0x13')][_0xe444('0x14')]:'','XMD-CALLERID':_0x2a7d40,'XMD-CALLERID-PREVIEW':_0x32edd1?util[_0xe444('0xe')](_0xe444('0x15'),_0x32edd1[_0xe444('0x16')],_0x32edd1[_0xe444('0x17')]):_0x2a7d40,'XMD-DIALID':_0x2a5d11,'XMD-CONTACTID':_0x234f75['ContactId'],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x2a7d40,'XMD-VOICEQUEUEID':_0x234f75[_0xe444('0x18')],'XMD-DIALCHANNEL':_0x27057f,'XMD-DIALTIMEOUT':_0x2a2365[_0xe444('0x19')]||0x1e,'XMD-DIALOPTIONS':util['format']('\x22rtTxX%s%s\x22',_0x2a2365[_0xe444('0x1a')]?'g':'',_['isEmpty'](_0x2a2365[_0xe444('0x1b')])?'':'U(xcally-mixmonitor-context)'),'XMD-DIALURL':_0x2a2365[_0xe444('0x1c')]||'','XMD-AGI':_0x2a2365[_0xe444('0x1d')]?util[_0xe444('0xe')](_0xe444('0x1e'),ipAgi,_0x2a2365[_0xe444('0x1d')]):_0xe444('0x1f'),'XMD-AGIAFTER':_0x2a2365[_0xe444('0x1a')]?util['format']('\x22agi://%s/square,%s\x22',ipAgi,_0x2a2365[_0xe444('0x1a')]):_0xe444('0x1f'),'XMD-ORIGINATECALLERIDNUM':_0x32edd1?_0x32edd1[_0xe444('0x20')]:'','XMD-ORIGINATECALLERIDNAME':_0x32edd1?_0x32edd1[_0xe444('0x21')]:'','XMD-DESTINATION':_0xe444('0x22'),'SIPADDHEADER':_0xe444('0x23')};if(!_[_0xe444('0xd')](_0x2a2365[_0xe444('0x1b')])){_0x356152[util[_0xe444('0xe')]('%s',_0xe444('0x24'))]=_0x2a2365[_0xe444('0x1b')];_0x356152[util[_0xe444('0xe')]('%s',_0xe444('0x25'))]=_0x2a5d11;}return _0x356152;};exports['toLowerVariables']=function(_0x125cba){var _0x1d01ec={};for(var _0x116620 in _0x125cba){if(_0x125cba['hasOwnProperty'](_0x116620)){_0x1d01ec[util[_0xe444('0xe')]('%s',_[_0xe444('0x26')](_0x116620))]=_0x125cba[_0x116620];}}return{'variables':_0x1d01ec};};exports[_0xe444('0x27')]=function(_0x4bb762,_0x4213d1){if(!_[_0xe444('0x11')](_0x4bb762)){if(_0x4bb762[_0xe444('0x28')]('originated')){if(_0x4bb762[_0xe444('0x29')]>0x0){_0x4bb762[_0xe444('0x29')]-=0x1;}else{logger[_0xe444('0x2a')](_0xe444('0x2b'),_0x4213d1);}}}else{logger[_0xe444('0x2a')](_0xe444('0x2c'),_0x4213d1);}};exports[_0xe444('0x2d')]=function(_0x122cf){var _0x571bce=moment()['format'](_0xe444('0x2e'));_0x122cf[_0xe444('0x2f')]=0xd;_0x122cf[_0xe444('0x30')]=_0xe444('0x31');_0x122cf[_0xe444('0x32')]=_0x571bce;_0x122cf[_0xe444('0x33')]=_0x571bce;_0x122cf['endtime']=_0x571bce;};exports['logAgent']=function(_0x5c9f0e,_0x19bb34,_0x328b51){var _0x10f053=moment()[_0xe444('0xe')](_0xe444('0x2e'));_0x5c9f0e[_0xe444('0x2f')]=_0x19bb34;_0x5c9f0e[_0xe444('0x30')]=_0x328b51;_0x5c9f0e[_0xe444('0x33')]=_0x10f053;_0x5c9f0e[_0xe444('0x34')]=utils[_0xe444('0x35')](_0x5c9f0e[_0xe444('0x33')],_0x5c9f0e[_0xe444('0x32')]);};exports[_0xe444('0x36')]=function(_0x3e6420,_0x59e9aa,_0x1a13ab){_0x3e6420[_0xe444('0x37')]=_0x59e9aa;_0x3e6420[_0xe444('0x38')]=_0x1a13ab;};exports[_0xe444('0x39')]=function(_0x661284,_0x41e68c,_0x5652c1){var _0x46c9d4=moment()[_0xe444('0xe')](_0xe444('0x2e'));_0x661284['state']=_0x41e68c;_0x661284['statedesc']=_0x5652c1;_0x661284[_0xe444('0x33')]=_0x661284[_0xe444('0x33')]?_0x661284['responsetime']:_0x46c9d4;_0x661284[_0xe444('0x3a')]=_0x661284[_0xe444('0x3a')]?_0x661284[_0xe444('0x3a')]:_0x46c9d4;_0x661284['ringtime']=utils['getSeconds'](_0x661284['responsetime']||0x0,_0x661284[_0xe444('0x32')]||0x0);_0x661284[_0xe444('0x3b')]=_0x661284[_0xe444('0x3c')]?utils[_0xe444('0x35')](_0x661284[_0xe444('0x3a')],_0x661284[_0xe444('0x3c')]):0x0;};exports[_0xe444('0x3d')]=function(_0x5dcdb7){return _0x5dcdb7===_0xe444('0x3e');};exports[_0xe444('0x3f')]=function(_0x11679e,_0x26ba25,_0x4a063f,_0xb72504,_0x10951b){var _0x150ee6=_0xb72504?'RECALL':_0x11679e['calleridname'];_0x150ee6=_0x10951b?_0xe444('0x40'):_0x150ee6;return{'actionid':_0x11679e[_0xe444('0x41')],'action':_0xe444('0x42'),'channel':_0x11679e[_0xe444('0x43')],'callerid':util[_0xe444('0xe')](_0xe444('0x15'),_0x150ee6,_0x11679e[_0xe444('0x17')]),'Exten':_0xe444('0x22'),'Context':_0xe444('0x44'),'Priority':'1','variable':_0x4a063f,'timeout':(_0x26ba25[_0xe444('0x45')]||0x1e)*0x3e8,'async':!![],'channelid':_0x11679e[_0xe444('0x41')]};};exports['totalGlobal']=function(_0x506c1d){return _0x506c1d[_0xe444('0x46')]+_0x506c1d[_0xe444('0x47')]+_0x506c1d['countnoanswerretry']+_0x506c1d[_0xe444('0x48')]+_0x506c1d[_0xe444('0x49')];};exports[_0xe444('0x4a')]=function(_0x4dfb89){var _0x114902=_[_0xe444('0x4b')](_0x4dfb89);_0x114902[_0xe444('0x2f')]=0xf;_0x114902['statedesc']='Global';return _0x114902;};exports[_0xe444('0x4c')]=function(_0x4f0379,_0x537809,_0x4c0559){var _0x4f1fe2={};_0x4f1fe2[_0x537809]=_0x4f0379[_0x537809];_0x4f1fe2[_0xe444('0x4d')]=![];_0x4f1fe2[_0xe444('0x4e')]=moment()['add'](_0x4c0559,_0xe444('0x4f'))[_0xe444('0xe')]('YYYY-MM-DD\x20HH:mm:ss');_0x4f1fe2[_0xe444('0x50')]=_0x4f0379[_0xe444('0x50')];_0x4f1fe2[_0xe444('0x51')]=_0x4f0379[_0xe444('0x51')];_0x4f1fe2[_0xe444('0x18')]=_0x4f0379[_0xe444('0x18')]||undefined;return _0x4f1fe2;};exports['decrementTalkink']=function(_0x59ed95,_0x170070){if(!_[_0xe444('0x11')](_0x59ed95)){if(_0x59ed95[_0xe444('0x52')]>0x0){_0x59ed95[_0xe444('0x52')]-=0x1;}else{logger[_0xe444('0x2a')](_0x170070,_0xe444('0x53'));}}else{logger['error'](_0x170070,_0xe444('0x54'));}};exports['IsNotLoggedIn']=function(_0x1857a8){if(_0x1857a8<=0x0){return!![];}return![];};function buildObj(_0x2e416e,_0x249f80,_0x144ab4){_0x2e416e[_0xe444('0x55')]=_0x249f80;_0x2e416e[_0xe444('0x14')]=_0x2e416e[_0xe444('0x56')];_0x2e416e['interface']=_0x2e416e[_0xe444('0x43')];_0x2e416e[_0xe444('0x57')]=_0xe444('0x58');if(_0x144ab4){_0x2e416e[_0xe444('0x59')]=_0x144ab4[_0xe444('0x59')];}return _0x2e416e;}exports[_0xe444('0x5a')]=buildObj;exports['buildAcw']=function(_0x447f7a){var _0x8f64ae={};_0x8f64ae[_0xe444('0x56')]=_0x447f7a[_0xe444('0x56')];_0x8f64ae['interface']=_0x447f7a[_0xe444('0x43')];_0x8f64ae[_0xe444('0x41')]=_0x447f7a['uniqueid'];return _0x8f64ae;};exports[_0xe444('0x5b')]=function(_0x2acdac){var _0xc02849=[];for(var _0x248aaf in _0x2acdac){if(_0x2acdac[_0xe444('0x28')](_0x248aaf)){if(!_[_0xe444('0x11')](_0x2acdac[_0x248aaf])&&_0x2acdac[_0x248aaf]['state']===_0xe444('0x5c')&&_0x2acdac[_0x248aaf][_0xe444('0x5d')]==='reachable'){_0xc02849['push'](_0x2acdac[_0x248aaf]['id']);}}}return _0xc02849;};exports['getDiff']=function(_0x8acfb5){var _0x1360df=moment()[_0xe444('0x5e')](0x0);var _0x146c2d=moment(_0x8acfb5)[_0xe444('0x5e')](0x0);return _0x1360df[_0xe444('0x5f')](_0x146c2d,_0xe444('0x60'));};exports[_0xe444('0x61')]=function(_0x515388){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x515388['ContactId'],'ListId':_0x515388[_0xe444('0x51')],'VoiceQueueId':_0x515388['VoiceQueueId']||undefined,'CampaignId':_0x515388[_0xe444('0x62')]||undefined};};exports[_0xe444('0x63')]=function(_0x56a6cf){if(_0x56a6cf===_0xe444('0x41')||_0x56a6cf==='idContact'||_0x56a6cf===_0xe444('0x56')||_0x56a6cf===_0xe444('0x64')||_0x56a6cf===_0xe444('0x65')||_0x56a6cf==='dialAnswer'||_0x56a6cf==='membername'||_0x56a6cf===_0xe444('0x43')||_0x56a6cf===_0xe444('0x16')||_0x56a6cf===_0xe444('0x4d')||_0x56a6cf===_0xe444('0x17')||_0x56a6cf==='scheduledat'||_0x56a6cf===_0xe444('0x46')||_0x56a6cf===_0xe444('0x47')||_0x56a6cf==='countnoanswerretry'||_0x56a6cf===_0xe444('0x66')||_0x56a6cf===_0xe444('0x67')||_0x56a6cf===_0xe444('0x68')||_0x56a6cf===_0xe444('0x69')||_0x56a6cf===_0xe444('0x6a')||_0x56a6cf===_0xe444('0x50')||_0x56a6cf===_0xe444('0x51')||_0x56a6cf===_0xe444('0x38')||_0x56a6cf==='VoiceQueueId'||_0x56a6cf===_0xe444('0x6b')||_0x56a6cf===_0xe444('0x6c')||_0x56a6cf==='xmd-queue'||_0x56a6cf==='xmd-phone'||_0x56a6cf===_0xe444('0x6d')||_0x56a6cf==='xmd-dialurl'||_0x56a6cf==='xmd-dialtimeout'||_0x56a6cf===_0xe444('0x6e')||_0x56a6cf===_0xe444('0x6f')||_0x56a6cf===_0xe444('0x70')||_0x56a6cf===_0xe444('0x71')||_0x56a6cf===_0xe444('0x72')||_0x56a6cf===_0xe444('0x73')||_0x56a6cf===_0xe444('0x74')||_0x56a6cf==='xmd-agi'||_0x56a6cf===_0xe444('0x75')||_0x56a6cf==='rtpaudioqosbridged'||_0x56a6cf===_0xe444('0x76')||_0x56a6cf===_0xe444('0x77')||_0x56a6cf===_0xe444('0x78')||_0x56a6cf==='rtpaudioqoslossbridged'||_0x56a6cf===_0xe444('0x79')||_0x56a6cf===_0xe444('0x7a')||_0x56a6cf===_0xe444('0x75')||_0x56a6cf===_0xe444('0x7b')||_0x56a6cf===_0xe444('0x76')||_0x56a6cf===_0xe444('0x77')||_0x56a6cf===_0xe444('0x78')||_0x56a6cf===_0xe444('0x7c')||_0x56a6cf==='rtpaudioqosrtt'||_0x56a6cf===_0xe444('0x7a')||_0x56a6cf===_0xe444('0x7d')||_0x56a6cf===_0xe444('0x7e')||_0x56a6cf===_0xe444('0x2f')||_0x56a6cf===_0xe444('0x30')){return![];}return!![];};exports[_0xe444('0x7f')]=function(_0x46c627,_0x54ad1c){var _0x3b1019,_0x1cb252,_0x10367d;if(_0x54ad1c<=0x0){_0x54ad1c=0x1;}_0x3b1019=new RegExp('\x5cw{0,'+_0x54ad1c+'}$');_0x1cb252=Math[_0xe444('0x80')](0xa,_0x54ad1c-0x1);_0x10367d=Math[_0xe444('0x80')](0xa,_0x54ad1c)-0x1;return util[_0xe444('0xe')]('%s',_[_0xe444('0x81')](_0x46c627,_0x3b1019,_[_0xe444('0x82')](_0x1cb252,_0x10367d)));};exports[_0xe444('0x83')]=function(_0x190dc9){var _0x5c0500=_0x190dc9[_0xe444('0x84')](/"(.*?)"/);return _0x5c0500?_0x5c0500[0x1]:_0x190dc9;};exports['extractCalleridNumber']=function(_0x409e33){var _0x2cb62c=_0x409e33[_0xe444('0x84')](/<(.*?)>/);return _0x2cb62c?_0x2cb62c[0x1]:_0x409e33;};function buildNoAnswerEventPayload(_0x37de49,_0x23a2a7){var _0x844300=buildObj(_0x37de49,_0xe444('0x85'));if(!_[_0xe444('0xd')](_0x23a2a7[_0xe444('0x86')])){Object[_0xe444('0x87')](_0x23a2a7['variables'])[_0xe444('0x88')](function(_0x4edf84){_0x844300[_0x4edf84[_0xe444('0x89')]()]=_0x23a2a7[_0xe444('0x86')][_0x4edf84];});}return _0x844300;}exports['buildNoAnswerEventPayload']=buildNoAnswerEventPayload; \ No newline at end of file +var _0x08e2=['dialQueueProject2','originatecalleridnum','originatecalleridname','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','hasOwnProperty','updateOriginated','originated','logBlacklist','state','statedesc','Blacklist','endtime','logAgent','responsetime','ringtime','getSeconds','logLookAgent','membername','YYYY-MM-DD\x20HH:mm:ss','starttime','talktime','answertime','isFailure','RECALL','BOOKED','xcally-motion-preview','from-sip','timeout','uniqueid','totalGlobal','countcongestionretry','countnoanswerretry','countnosuchnumberretry','clone','Global','scheduledAt','active','add','minutes','ListId','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','lastevent','name','queue','channelAgent','voice','mandatoryDisposition','buildAcw','not_inuse','status','push','milliseconds','diff','createBody','CampaignId','idContact','type','dialAnswer','countbusyretry','countglobal','callback','callbackuniqueid','callbackat','recallme','sipcallid','xmd-voicequeueid','xmd-queue','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','rtpaudioqos','rtpaudioqosbridged','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','bridgepeer','bridgepvtcallid','pow','random','extractCalleridName','extractCalleridNumber','match','noanswer','variables','keys','buildNoAnswerEventPayload','util','lodash','moment','../../../../config/logger','env','XCALLY_IP_AGI','127.0.0.1','../../dialer/utils','loggerCatch','error','inspect','logger','loggerError','info','getCallerId','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','isNil','addVariables','Queue','calleridname','calleridnum','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE'];(function(_0x3447eb,_0x28cb0f){var _0x7a9099=function(_0x242528){while(--_0x242528){_0x3447eb['push'](_0x3447eb['shift']());}};_0x7a9099(++_0x28cb0f);}(_0x08e2,0xe6));var _0x208e=function(_0x3143a4,_0x3de938){_0x3143a4=_0x3143a4-0x0;var _0x574a04=_0x08e2[_0x3143a4];return _0x574a04;};'use strict';var util=require(_0x208e('0x0'));var _=require(_0x208e('0x1'));var moment=require(_0x208e('0x2'));var logger=require(_0x208e('0x3'))('preview');var ipAgi=process[_0x208e('0x4')][_0x208e('0x5')]||_0x208e('0x6');var utils=require(_0x208e('0x7'));exports[_0x208e('0x8')]=function(_0x2d4a0d){return function(_0x5e7a8d){logger[_0x208e('0x9')](_0x2d4a0d,util[_0x208e('0xa')](_0x5e7a8d,{'showHidden':![],'depth':null}));};};exports[_0x208e('0xb')]=function(_0x48e76f,_0x108db8){logger['info'](_0x48e76f,util[_0x208e('0xa')](_0x108db8,{'showHidden':![],'depth':null}));};exports[_0x208e('0xc')]=function(_0x56274f,_0x324e11){logger[_0x208e('0x9')](_0x56274f,util['inspect'](_0x324e11,{'showHidden':![],'depth':null}));};exports['logger2']=function(_0x4862b2){return function(_0x36f80c){logger[_0x208e('0xd')](_0x4862b2,util['inspect'](_0x36f80c,{'showHidden':![],'depth':null}));};};exports['message']=function(_0x42b395,_0x3b44a2,_0x4fcd13){return{'message':_0x42b395,'unlock':_0x3b44a2,'active':_0x4fcd13};};exports[_0x208e('0xe')]=function(_0x50c012,_0x4edc4e,_0x4c2614){if(!_[_0x208e('0xf')](_0x4c2614)&&_0x208e('0x10')===typeof _0x4c2614&&!_[_0x208e('0x11')](_0x4c2614)){if(!_[_0x208e('0xf')](_0x4edc4e)&&'string'===typeof _0x4edc4e&&!_['isEmpty'](_0x4edc4e)){return util[_0x208e('0x12')](_0x208e('0x13'),_0x4edc4e,_0x4c2614);}return util[_0x208e('0x12')]('\x22%s\x22\x20<%s>',_0x4c2614,_0x4c2614);}if(!_[_0x208e('0xf')](_0x50c012)&&'string'===typeof _0x50c012&&!_[_0x208e('0x11')](_0x50c012)){return _0x50c012;}return'\x22\x22\x20<>';};exports['isActive']=function(_0x59f4d3){if(_[_0x208e('0x14')](_0x59f4d3)){return![];}return _0x59f4d3;};exports[_0x208e('0x15')]=function(_0x1d9452,_0x4a75d3,_0x2dc934,_0x18afd3,_0x3f598a,_0x55f14e){var _0x21b1c4={'XMD-QUEUE':_0x4a75d3[_0x208e('0x16')]?_0x4a75d3[_0x208e('0x16')]['name']:'','XMD-CALLERID':_0x18afd3,'XMD-CALLERID-PREVIEW':_0x55f14e?util[_0x208e('0x12')](_0x208e('0x13'),_0x55f14e[_0x208e('0x17')],_0x55f14e[_0x208e('0x18')]):_0x18afd3,'XMD-DIALID':_0x3f598a,'XMD-CONTACTID':_0x4a75d3[_0x208e('0x19')],'XMD-CDRTYPE':_0x208e('0x1a'),'CALLERID(all)':_0x18afd3,'XMD-VOICEQUEUEID':_0x4a75d3[_0x208e('0x1b')],'XMD-DIALCHANNEL':_0x2dc934,'XMD-DIALTIMEOUT':_0x1d9452[_0x208e('0x1c')]||0x1e,'XMD-DIALOPTIONS':util[_0x208e('0x12')](_0x208e('0x1d'),_0x1d9452['dialQueueProject2']?'g':'',_[_0x208e('0x11')](_0x1d9452[_0x208e('0x1e')])?'':_0x208e('0x1f')),'XMD-DIALURL':_0x1d9452[_0x208e('0x20')]||'','XMD-AGI':_0x1d9452[_0x208e('0x21')]?util[_0x208e('0x12')](_0x208e('0x22'),ipAgi,_0x1d9452[_0x208e('0x21')]):_0x208e('0x23'),'XMD-AGIAFTER':_0x1d9452['dialQueueProject2']?util['format'](_0x208e('0x22'),ipAgi,_0x1d9452[_0x208e('0x24')]):_0x208e('0x23'),'XMD-ORIGINATECALLERIDNUM':_0x55f14e?_0x55f14e[_0x208e('0x25')]:'','XMD-ORIGINATECALLERIDNAME':_0x55f14e?_0x55f14e[_0x208e('0x26')]:'','XMD-DESTINATION':'xcally-motion-preview','SIPADDHEADER':'Call-Type:\x20PREVIEW'};if(!_['isEmpty'](_0x1d9452[_0x208e('0x1e')])){_0x21b1c4[util['format']('%s',_0x208e('0x27'))]=_0x1d9452[_0x208e('0x1e')];_0x21b1c4[util['format']('%s',_0x208e('0x28'))]=_0x3f598a;}return _0x21b1c4;};exports['toLowerVariables']=function(_0x30e179){var _0x424e5e={};for(var _0x32ba01 in _0x30e179){if(_0x30e179[_0x208e('0x29')](_0x32ba01)){_0x424e5e[util[_0x208e('0x12')]('%s',_['toLower'](_0x32ba01))]=_0x30e179[_0x32ba01];}}return{'variables':_0x424e5e};};exports[_0x208e('0x2a')]=function(_0x1c0461,_0x1a7ff1){if(!_[_0x208e('0x14')](_0x1c0461)){if(_0x1c0461[_0x208e('0x29')](_0x208e('0x2b'))){if(_0x1c0461['originated']>0x0){_0x1c0461[_0x208e('0x2b')]-=0x1;}else{logger['error']('[updateOriginated]\x20object\x20originated\x20is\x20negative',_0x1a7ff1);}}}else{logger[_0x208e('0x9')]('[updateOriginated]\x20is\x20null\x20or\x20undefined',_0x1a7ff1);}};exports[_0x208e('0x2c')]=function(_0x43982f){var _0x426f2f=moment()[_0x208e('0x12')]('YYYY-MM-DD\x20HH:mm:ss');_0x43982f[_0x208e('0x2d')]=0xd;_0x43982f[_0x208e('0x2e')]=_0x208e('0x2f');_0x43982f['starttime']=_0x426f2f;_0x43982f['responsetime']=_0x426f2f;_0x43982f[_0x208e('0x30')]=_0x426f2f;};exports[_0x208e('0x31')]=function(_0x129788,_0x4c97e5,_0x389075){var _0x47b1bf=moment()[_0x208e('0x12')]('YYYY-MM-DD\x20HH:mm:ss');_0x129788['state']=_0x4c97e5;_0x129788[_0x208e('0x2e')]=_0x389075;_0x129788[_0x208e('0x32')]=_0x47b1bf;_0x129788[_0x208e('0x33')]=utils[_0x208e('0x34')](_0x129788[_0x208e('0x32')],_0x129788['starttime']);};exports[_0x208e('0x35')]=function(_0x13cf94,_0x47ed7d,_0x466e37){_0x13cf94[_0x208e('0x36')]=_0x47ed7d;_0x13cf94['UserId']=_0x466e37;};exports['logCustomer']=function(_0xd29731,_0x44dac4,_0x1a14e5){var _0x1cce2d=moment()[_0x208e('0x12')](_0x208e('0x37'));_0xd29731[_0x208e('0x2d')]=_0x44dac4;_0xd29731[_0x208e('0x2e')]=_0x1a14e5;_0xd29731[_0x208e('0x32')]=_0xd29731['responsetime']?_0xd29731[_0x208e('0x32')]:_0x1cce2d;_0xd29731[_0x208e('0x30')]=_0xd29731[_0x208e('0x30')]?_0xd29731[_0x208e('0x30')]:_0x1cce2d;_0xd29731['ringtime']=utils[_0x208e('0x34')](_0xd29731[_0x208e('0x32')]||0x0,_0xd29731[_0x208e('0x38')]||0x0);_0xd29731[_0x208e('0x39')]=_0xd29731['answertime']?utils[_0x208e('0x34')](_0xd29731[_0x208e('0x30')],_0xd29731[_0x208e('0x3a')]):0x0;};exports[_0x208e('0x3b')]=function(_0x4c443f){return _0x4c443f==='Failure';};exports['variablesAction']=function(_0x40509e,_0x206bfb,_0x2e04fc,_0xd53afa,_0x4eb473){var _0x4251fd=_0xd53afa?_0x208e('0x3c'):_0x40509e[_0x208e('0x17')];_0x4251fd=_0x4eb473?_0x208e('0x3d'):_0x4251fd;return{'actionid':_0x40509e['uniqueid'],'action':'originate','channel':_0x40509e['channelAgent'],'callerid':util['format'](_0x208e('0x13'),_0x4251fd,_0x40509e[_0x208e('0x18')]),'Exten':_0x208e('0x3e'),'Context':_0x208e('0x3f'),'Priority':'1','variable':_0x2e04fc,'timeout':(_0x206bfb[_0x208e('0x40')]||0x1e)*0x3e8,'async':!![],'channelid':_0x40509e[_0x208e('0x41')]};};exports[_0x208e('0x42')]=function(_0x52af92){return _0x52af92['countbusyretry']+_0x52af92[_0x208e('0x43')]+_0x52af92[_0x208e('0x44')]+_0x52af92['countagentrejectretry']+_0x52af92[_0x208e('0x45')];};exports['cloneAction']=function(_0x2d818b){var _0x492105=_[_0x208e('0x46')](_0x2d818b);_0x492105[_0x208e('0x2d')]=0xf;_0x492105['statedesc']=_0x208e('0x47');return _0x492105;};exports[_0x208e('0x48')]=function(_0x2c2974,_0x327bba,_0x357e75){var _0x493f0c={};_0x493f0c[_0x327bba]=_0x2c2974[_0x327bba];_0x493f0c[_0x208e('0x49')]=![];_0x493f0c['scheduledat']=moment()[_0x208e('0x4a')](_0x357e75,_0x208e('0x4b'))[_0x208e('0x12')](_0x208e('0x37'));_0x493f0c[_0x208e('0x19')]=_0x2c2974[_0x208e('0x19')];_0x493f0c[_0x208e('0x4c')]=_0x2c2974[_0x208e('0x4c')];_0x493f0c[_0x208e('0x1b')]=_0x2c2974[_0x208e('0x1b')]||undefined;return _0x493f0c;};exports['decrementTalkink']=function(_0x43c178,_0x1ad053){if(!_[_0x208e('0x14')](_0x43c178)){if(_0x43c178[_0x208e('0x4d')]>0x0){_0x43c178['pTalking']-=0x1;}else{logger[_0x208e('0x9')](_0x1ad053,_0x208e('0x4e'));}}else{logger[_0x208e('0x9')](_0x1ad053,_0x208e('0x4f'));}};exports[_0x208e('0x50')]=function(_0x2e036c){if(_0x2e036c<=0x0){return!![];}return![];};function buildObj(_0x424918,_0x33eb46,_0x5f13f2){_0x424918[_0x208e('0x51')]=_0x33eb46;_0x424918[_0x208e('0x52')]=_0x424918[_0x208e('0x53')];_0x424918['interface']=_0x424918[_0x208e('0x54')];_0x424918['motionChannel']=_0x208e('0x55');if(_0x5f13f2){_0x424918[_0x208e('0x56')]=_0x5f13f2['mandatoryDisposition'];}return _0x424918;}exports['buildObj']=buildObj;exports[_0x208e('0x57')]=function(_0x594fe0){var _0x302cec={};_0x302cec[_0x208e('0x53')]=_0x594fe0[_0x208e('0x53')];_0x302cec['interface']=_0x594fe0[_0x208e('0x54')];_0x302cec['uniqueid']=_0x594fe0['uniqueid'];return _0x302cec;};exports['agentReadyId']=function(_0x3a448c){var _0x40c665=[];for(var _0x332cff in _0x3a448c){if(_0x3a448c[_0x208e('0x29')](_0x332cff)){if(!_[_0x208e('0x14')](_0x3a448c[_0x332cff])&&_0x3a448c[_0x332cff][_0x208e('0x2d')]===_0x208e('0x58')&&_0x3a448c[_0x332cff][_0x208e('0x59')]==='reachable'){_0x40c665[_0x208e('0x5a')](_0x3a448c[_0x332cff]['id']);}}}return _0x40c665;};exports['getDiff']=function(_0x3bb2c9){var _0x3699e8=moment()['milliseconds'](0x0);var _0x342c08=moment(_0x3bb2c9)[_0x208e('0x5b')](0x0);return _0x3699e8[_0x208e('0x5c')](_0x342c08,'seconds');};exports[_0x208e('0x5d')]=function(_0x4b68d3){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x4b68d3[_0x208e('0x19')],'ListId':_0x4b68d3['ListId'],'VoiceQueueId':_0x4b68d3[_0x208e('0x1b')]||undefined,'CampaignId':_0x4b68d3[_0x208e('0x5e')]||undefined};};exports['filterKey']=function(_0x23d774){if(_0x23d774==='uniqueid'||_0x23d774===_0x208e('0x5f')||_0x23d774==='queue'||_0x23d774===_0x208e('0x60')||_0x23d774==='campaigntype'||_0x23d774===_0x208e('0x61')||_0x23d774==='membername'||_0x23d774==='channelAgent'||_0x23d774===_0x208e('0x17')||_0x23d774===_0x208e('0x49')||_0x23d774===_0x208e('0x18')||_0x23d774==='scheduledat'||_0x23d774===_0x208e('0x62')||_0x23d774===_0x208e('0x43')||_0x23d774===_0x208e('0x44')||_0x23d774===_0x208e('0x63')||_0x23d774===_0x208e('0x64')||_0x23d774===_0x208e('0x65')||_0x23d774===_0x208e('0x66')||_0x23d774===_0x208e('0x67')||_0x23d774===_0x208e('0x19')||_0x23d774===_0x208e('0x4c')||_0x23d774==='UserId'||_0x23d774===_0x208e('0x1b')||_0x23d774===_0x208e('0x68')||_0x23d774===_0x208e('0x69')||_0x23d774===_0x208e('0x6a')||_0x23d774==='xmd-phone'||_0x23d774==='xmd-listid'||_0x23d774==='xmd-dialurl'||_0x23d774===_0x208e('0x6b')||_0x23d774===_0x208e('0x6c')||_0x23d774===_0x208e('0x6d')||_0x23d774===_0x208e('0x6e')||_0x23d774===_0x208e('0x6f')||_0x23d774===_0x208e('0x70')||_0x23d774===_0x208e('0x71')||_0x23d774===_0x208e('0x72')||_0x23d774==='xmd-agi'||_0x23d774===_0x208e('0x73')||_0x23d774===_0x208e('0x74')||_0x23d774==='rtpaudioqosjitter'||_0x23d774==='rtpaudioqosjitterbridged'||_0x23d774==='rtpaudioqosloss'||_0x23d774===_0x208e('0x75')||_0x23d774===_0x208e('0x76')||_0x23d774===_0x208e('0x77')||_0x23d774==='rtpaudioqos'||_0x23d774===_0x208e('0x74')||_0x23d774==='rtpaudioqosjitter'||_0x23d774===_0x208e('0x78')||_0x23d774===_0x208e('0x79')||_0x23d774===_0x208e('0x75')||_0x23d774===_0x208e('0x76')||_0x23d774==='rtpaudioqosrttbridged'||_0x23d774===_0x208e('0x7a')||_0x23d774===_0x208e('0x7b')||_0x23d774===_0x208e('0x2d')||_0x23d774===_0x208e('0x2e')){return![];}return!![];};exports['getCallerIdRandom']=function(_0x573f97,_0x168238){var _0x18b6eb,_0x1b985b,_0x59a0d3;if(_0x168238<=0x0){_0x168238=0x1;}_0x18b6eb=new RegExp('\x5cw{0,'+_0x168238+'}$');_0x1b985b=Math[_0x208e('0x7c')](0xa,_0x168238-0x1);_0x59a0d3=Math[_0x208e('0x7c')](0xa,_0x168238)-0x1;return util[_0x208e('0x12')]('%s',_['replace'](_0x573f97,_0x18b6eb,_[_0x208e('0x7d')](_0x1b985b,_0x59a0d3)));};exports[_0x208e('0x7e')]=function(_0x4c1c73){var _0x3cb8a0=_0x4c1c73['match'](/"(.*?)"/);return _0x3cb8a0?_0x3cb8a0[0x1]:_0x4c1c73;};exports[_0x208e('0x7f')]=function(_0x1cc886){var _0x21bc55=_0x1cc886[_0x208e('0x80')](/<(.*?)>/);return _0x21bc55?_0x21bc55[0x1]:_0x1cc886;};function buildNoAnswerEventPayload(_0x41528f,_0x4d97cc){var _0x3dd4b8=buildObj(_0x41528f,_0x208e('0x81'));if(!_[_0x208e('0x11')](_0x4d97cc[_0x208e('0x82')])){Object[_0x208e('0x83')](_0x4d97cc['variables'])['forEach'](function(_0x29e461){_0x3dd4b8[_0x29e461['toLowerCase']()]=_0x4d97cc[_0x208e('0x82')][_0x29e461];});}return _0x3dd4b8;}exports[_0x208e('0x84')]=buildNoAnswerEventPayload; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index d9313f0..fd7e994 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 _0x36c9=['queuepause','reload','voicequeuechannel','voicechannel','voicequeuechannelhangup','voicequeuechannelredirect','string','boolean'];(function(_0x235a41,_0x4f4e5d){var _0x2a5977=function(_0x5c12e3){while(--_0x5c12e3){_0x235a41['push'](_0x235a41['shift']());}};_0x2a5977(++_0x4f4e5d);}(_0x36c9,0x1be));var _0x936c=function(_0x2d632b,_0x5ada10){_0x2d632b=_0x2d632b-0x0;var _0x3bd47a=_0x36c9[_0x2d632b];return _0x3bd47a;};'use strict';exports['queueadd']={'queue':{'type':_0x936c('0x0'),'required':!![]},'interface':{'type':_0x936c('0x0'),'required':!![]},'membername':{'type':'string','required':!![]},'penalty':{'type':'number','required':![]},'paused':{'type':_0x936c('0x1'),'required':![]}};exports['queueremove']={'queue':{'type':'string','required':!![]},'interface':{'type':_0x936c('0x0'),'required':!![]}};exports[_0x936c('0x2')]={'interface':{'type':_0x936c('0x0'),'required':!![]},'paused':{'type':_0x936c('0x1')},'reason':{'type':_0x936c('0x0'),'required':![]}};exports[_0x936c('0x3')]={'module':{'type':_0x936c('0x0'),'required':![]}};exports[_0x936c('0x4')]={'uniqueid':{'type':_0x936c('0x0'),'required':!![]}};exports[_0x936c('0x5')]={'uniqueid':{'type':_0x936c('0x0'),'required':!![]},'filename':{'type':_0x936c('0x0')},'format':{'type':_0x936c('0x0')},'mixmonitorid':{'type':'string'}};exports[_0x936c('0x6')]={'uniqueid':{'type':_0x936c('0x0'),'required':!![]}};exports[_0x936c('0x7')]={'uniqueid':{'type':_0x936c('0x0'),'required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':_0x936c('0x0')}}; \ No newline at end of file +var _0x95d0=['voicequeuechannelhangup','voicequeuechannelredirect','queueadd','string','number','boolean','queueremove','queuepause','reload','voicequeuechannel','voicechannel'];(function(_0x29667a,_0x33d274){var _0x2d065a=function(_0x365f68){while(--_0x365f68){_0x29667a['push'](_0x29667a['shift']());}};_0x2d065a(++_0x33d274);}(_0x95d0,0x115));var _0x095d=function(_0x2544f0,_0x87c1e7){_0x2544f0=_0x2544f0-0x0;var _0xa0f173=_0x95d0[_0x2544f0];return _0xa0f173;};'use strict';exports[_0x095d('0x0')]={'queue':{'type':_0x095d('0x1'),'required':!![]},'interface':{'type':'string','required':!![]},'membername':{'type':_0x095d('0x1'),'required':!![]},'penalty':{'type':_0x095d('0x2'),'required':![]},'paused':{'type':_0x095d('0x3'),'required':![]}};exports[_0x095d('0x4')]={'queue':{'type':'string','required':!![]},'interface':{'type':_0x095d('0x1'),'required':!![]}};exports[_0x095d('0x5')]={'interface':{'type':_0x095d('0x1'),'required':!![]},'paused':{'type':_0x095d('0x3')},'reason':{'type':_0x095d('0x1'),'required':![]}};exports[_0x095d('0x6')]={'module':{'type':_0x095d('0x1'),'required':![]}};exports[_0x095d('0x7')]={'uniqueid':{'type':_0x095d('0x1'),'required':!![]}};exports[_0x095d('0x8')]={'uniqueid':{'type':_0x095d('0x1'),'required':!![]},'filename':{'type':_0x095d('0x1')},'format':{'type':_0x095d('0x1')},'mixmonitorid':{'type':_0x095d('0x1')}};exports[_0x095d('0x9')]={'uniqueid':{'type':_0x095d('0x1'),'required':!![]}};exports[_0x095d('0xa')]={'uniqueid':{'type':_0x095d('0x1'),'required':!![]},'exten':{'type':_0x095d('0x1'),'required':!![]},'context':{'type':_0x095d('0x1')}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index 6030284..92c486c 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 _0x0b0e=['total','sumHoldTime','sumBillable','isEmpty','ivrAnswerCallsDay','unmanaged','abandoned','sumDuration','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','mergeFromDatabase','initAgents','length','isNil','SIP/%s','isUndefined','prototype','initTelephones','initTrunks','trunks','initTriggers','initTemplates','salesforceAccounts','initZohoAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','servicenowAccounts','initFreshsalesAccounts','freshsalesAccounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','groupBy','queue','queuecallerabandon','queuecallerleaveAt','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerabandonAt','diff','queuecallercomplete','answered','initVoiceCallReports','duration','disposition','ANSWERED','billableseconds','campaigns','dialQueueProject','SquareProject','initVoiceExtensions','initCampaignHopperHistory','initFaxAccounts','initVoiceQueues','exports','lodash','util','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/template','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','agents','telephones','voiceQueues','triggers','templates','outbound','voiceExtensions','queueChannels','outboundChannels','timers','settings','zendeskAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','dynamics365Accounts','faxAccounts','mapKeys','name','hasOwnProperty','format','interface'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x0b0e,0x187));var _0xe0b0=function(_0x137da3,_0xa6277a){_0x137da3=_0x137da3-0x0;var _0x1ac46c=_0x0b0e[_0x137da3];return _0x1ac46c;};'use strict';var _=require(_0xe0b0('0x0'));var moment=require('moment');var util=require(_0xe0b0('0x1'));var Agent=require('../model/agent');var Telephone=require(_0xe0b0('0x2'));var Trunk=require(_0xe0b0('0x3'));var VoiceQueue=require(_0xe0b0('0x4'));var Trigger=require(_0xe0b0('0x5'));var Template=require(_0xe0b0('0x6'));var Campaign=require(_0xe0b0('0x7'));var VoiceExtension=require(_0xe0b0('0x8'));var ZendeskAccount=require(_0xe0b0('0x9'));var SalesforceAccount=require(_0xe0b0('0xa'));var FreshdeskAccount=require(_0xe0b0('0xb'));var SugarcrmAccount=require(_0xe0b0('0xc'));var ZohoAccount=require('../model/zohoAccount');var DeskAccount=require('../model/deskAccount');var VtigerAccount=require(_0xe0b0('0xd'));var ServicenowAccount=require(_0xe0b0('0xe'));var Dynamics365Account=require(_0xe0b0('0xf'));var FreshsalesAccount=require(_0xe0b0('0x10'));var FaxAccount=require('../model/faxAccount');function Realtime(){this[_0xe0b0('0x11')]={};this[_0xe0b0('0x12')]={};this['trunks']={};this[_0xe0b0('0x13')]={};this[_0xe0b0('0x14')]={};this['campaigns']={};this[_0xe0b0('0x15')]={};this[_0xe0b0('0x16')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0xe0b0('0x17')]={};this['channels']={};this[_0xe0b0('0x18')]={};this[_0xe0b0('0x19')]={};this[_0xe0b0('0x1a')]={};this[_0xe0b0('0x1b')]={};this[_0xe0b0('0x1c')]={};this['salesforceAccounts']={};this[_0xe0b0('0x1d')]={};this[_0xe0b0('0x1e')]={};this[_0xe0b0('0x1f')]={};this[_0xe0b0('0x20')]={};this[_0xe0b0('0x21')]={};this['servicenowAccounts']={};this[_0xe0b0('0x22')]={};this['freshsalesAccounts']={};this[_0xe0b0('0x23')]={};}function freeIsNotKey(_0xadee6e,_0x519ae8,_0x11fdca){var _0x4a4cc0=_[_0xe0b0('0x24')](_0xadee6e,function(_0x100204){return _0x100204[_0x11fdca];});for(var _0x56bcc7 in _0x519ae8){if(_0x519ae8['hasOwnProperty'](_0x56bcc7)){if(!_0x4a4cc0[_0x56bcc7]){delete _0x519ae8[_0x56bcc7];}}}}function freeIsNotKeySip(_0x46bb44,_0x50a441){var _0x4df8da=_['mapKeys'](_0x46bb44,function(_0x1920ee){return util['format']('SIP/%s',_0x1920ee[_0xe0b0('0x25')]);});for(var _0x59dff5 in _0x50a441){if(_0x50a441[_0xe0b0('0x26')](_0x59dff5)){if(!_0x4df8da[_0x59dff5]){delete _0x50a441[_0x59dff5];}}}}function freeIsNotKeyAgent(_0x5dba2f,_0x2c84cc){var _0x1cd7c4=_[_0xe0b0('0x24')](_0x5dba2f,function(_0x310a6d){var _0x2cf6a1=_['isNil'](_0x310a6d['interface'])?util[_0xe0b0('0x27')]('SIP/%s',_0x310a6d[_0xe0b0('0x25')]):_0x310a6d[_0xe0b0('0x28')];return _0x2cf6a1;});for(var _0x513e63 in _0x2c84cc){if(_0x2c84cc[_0xe0b0('0x26')](_0x513e63)){if(!_0x1cd7c4[_0x513e63]){delete _0x2c84cc[_0x513e63];}}}}function clearVoiceCallReports(_0x503883){_0x503883[_0xe0b0('0x29')]=0x0;_0x503883['answered']=0x0;_0x503883[_0xe0b0('0x2a')]=0x0;_0x503883['sumDuration']=0x0;_0x503883[_0xe0b0('0x2b')]=0x0;}function clearCampaigns(_0x4de537){if(!_[_0xe0b0('0x2c')](_0x4de537)){for(var _0x4aafbe in _0x4de537){if(_0x4de537[_0xe0b0('0x26')](_0x4aafbe)){_0x4de537[_0x4aafbe]['ivrTotalCallsDays']=0x0;_0x4de537[_0x4aafbe][_0xe0b0('0x2d')]=0x0;}}}}function clearVoiceQueues(_0x3c3bc2){if(!_[_0xe0b0('0x2c')](_0x3c3bc2)){for(var _0x1d91ad in _0x3c3bc2){if(_0x3c3bc2[_0xe0b0('0x26')](_0x1d91ad)){_0x3c3bc2[_0x1d91ad][_0xe0b0('0x29')]=0x0;_0x3c3bc2[_0x1d91ad]['answered']=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x2e')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x2f')]=0x0;_0x3c3bc2[_0x1d91ad]['sumHoldTime']=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x30')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x2b')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x31')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x32')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x33')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x34')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x35')]=0x0;_0x3c3bc2[_0x1d91ad]['outboundUnknownCallsDay']=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x36')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x37')]=0x0;_0x3c3bc2[_0x1d91ad]['outboundBlacklistCallsDay']=0x0;_0x3c3bc2[_0x1d91ad]['outboundOriginateFailureCallsDay']=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x38')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x39')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x31')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x3a')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x3b')]=!![];}}}}Realtime['prototype'][_0xe0b0('0x3c')]=function(_0x3231fc,_0x7867c4){for(var _0x29d725 in _0x7867c4){if(_0x3231fc[_0xe0b0('0x26')](_0x29d725)){_0x3231fc[_0x29d725]=_0x7867c4[_0x29d725];}}};Realtime['prototype'][_0xe0b0('0x3d')]=function(){var _0x208945=this;return function(_0xfc51d3){if(_0xfc51d3){freeIsNotKeyAgent(_0xfc51d3,_0x208945[_0xe0b0('0x11')]);for(var _0x3575bc=0x0,_0x12eeb8={};_0x3575bc<_0xfc51d3[_0xe0b0('0x3e')];_0x3575bc+=0x1){_0x12eeb8=_0xfc51d3[_0x3575bc];var _0x20908f=_[_0xe0b0('0x3f')](_0x12eeb8[_0xe0b0('0x28')])?util[_0xe0b0('0x27')](_0xe0b0('0x40'),_0x12eeb8[_0xe0b0('0x25')]):_0x12eeb8[_0xe0b0('0x28')];if(_[_0xe0b0('0x41')](_0x208945['agents'][_0x20908f])){_0x208945[_0xe0b0('0x11')][_0x20908f]=new Agent(_0x12eeb8);}else{_0x208945[_0xe0b0('0x3c')](_0x208945[_0xe0b0('0x11')][_0x20908f],_0x12eeb8);}}}return _0x208945[_0xe0b0('0x11')];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x43')]=function(){var _0x12024d=this;return function(_0x533fc7){if(_0x533fc7){freeIsNotKeySip(_0x533fc7,_0x12024d['telephones']);for(var _0x549d9a=0x0,_0x5317df={};_0x549d9a<_0x533fc7[_0xe0b0('0x3e')];_0x549d9a+=0x1){_0x5317df=_0x533fc7[_0x549d9a];if(_[_0xe0b0('0x41')](_0x12024d[_0xe0b0('0x12')][util['format'](_0xe0b0('0x40'),_0x5317df[_0xe0b0('0x25')])])){_0x12024d[_0xe0b0('0x12')][util[_0xe0b0('0x27')]('SIP/%s',_0x5317df[_0xe0b0('0x25')])]=new Telephone(_0x5317df);}else{_0x12024d[_0xe0b0('0x3c')](_0x12024d[_0xe0b0('0x12')][util[_0xe0b0('0x27')](_0xe0b0('0x40'),_0x5317df[_0xe0b0('0x25')])],_0x5317df);}}}return _0x12024d[_0xe0b0('0x12')];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x44')]=function(){var _0x54f251=this;return function(_0x3e349b){if(_0x3e349b){freeIsNotKeySip(_0x3e349b,_0x54f251['trunks']);for(var _0x34178d=0x0,_0x2d5f47={};_0x34178d<_0x3e349b[_0xe0b0('0x3e')];_0x34178d+=0x1){_0x2d5f47=_0x3e349b[_0x34178d];if(_[_0xe0b0('0x41')](_0x54f251['trunks'][util[_0xe0b0('0x27')](_0xe0b0('0x40'),_0x2d5f47[_0xe0b0('0x25')])])){_0x54f251[_0xe0b0('0x45')][util[_0xe0b0('0x27')](_0xe0b0('0x40'),_0x2d5f47[_0xe0b0('0x25')])]=new Trunk(_0x2d5f47);}else{_0x54f251[_0xe0b0('0x3c')](_0x54f251['trunks'][util[_0xe0b0('0x27')](_0xe0b0('0x40'),_0x2d5f47['name'])],_0x2d5f47);}}}return _0x54f251['trunks'];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x46')]=function(){var _0x56e7df=this;return function(_0x18a59d){if(_0x18a59d){freeIsNotKey(_0x18a59d,_0x56e7df[_0xe0b0('0x14')],'id');for(var _0x6bca5c=0x0,_0x1c869d={};_0x6bca5c<_0x18a59d[_0xe0b0('0x3e')];_0x6bca5c+=0x1){_0x1c869d=_0x18a59d[_0x6bca5c];if(_['isUndefined'](_0x56e7df['triggers'][_0x1c869d['id']])){_0x56e7df['triggers'][_0x1c869d['id']]=new Trigger(_0x1c869d);}else{_0x56e7df[_0xe0b0('0x3c')](_0x56e7df[_0xe0b0('0x14')][_0x1c869d['id']],_0x1c869d);}}}return _0x56e7df['triggers'];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x47')]=function(){var _0x14197b=this;return function(_0x5f037d){if(_0x5f037d){freeIsNotKey(_0x5f037d,_0x14197b[_0xe0b0('0x15')],'id');for(var _0x5c6f94=0x0,_0x57d4b0={};_0x5c6f94<_0x5f037d[_0xe0b0('0x3e')];_0x5c6f94+=0x1){_0x57d4b0=_0x5f037d[_0x5c6f94];if(_[_0xe0b0('0x41')](_0x14197b[_0xe0b0('0x15')][_0x57d4b0['id']])){_0x14197b[_0xe0b0('0x15')][_0x57d4b0['id']]=new Template(_0x57d4b0);}else{_0x14197b[_0xe0b0('0x3c')](_0x14197b['templates'][_0x57d4b0['id']],_0x57d4b0);}}}return _0x14197b[_0xe0b0('0x15')];};};Realtime[_0xe0b0('0x42')]['initZendeskAccounts']=function(){var _0x50c805=this;return function(_0x5ddad1){if(_0x5ddad1){freeIsNotKey(_0x5ddad1,_0x50c805[_0xe0b0('0x1c')],'id');for(var _0x2184d3=0x0,_0x2419ce={};_0x2184d3<_0x5ddad1[_0xe0b0('0x3e')];_0x2184d3+=0x1){_0x2419ce=_0x5ddad1[_0x2184d3];if(_['isUndefined'](_0x50c805[_0xe0b0('0x1c')][_0x2419ce['id']])){_0x50c805[_0xe0b0('0x1c')][_0x2419ce['id']]=new ZendeskAccount(_0x2419ce);}else{_0x50c805['mergeFromDatabase'](_0x50c805['zendeskAccounts'][_0x2419ce['id']],_0x2419ce);}}}return _0x50c805[_0xe0b0('0x1c')];};};Realtime[_0xe0b0('0x42')]['initSalesforceAccounts']=function(){var _0x2b1917=this;return function(_0x27fd31){if(_0x27fd31){freeIsNotKey(_0x27fd31,_0x2b1917['salesforceAccounts'],'id');for(var _0x5cb2b6=0x0,_0x123ad2={};_0x5cb2b6<_0x27fd31['length'];_0x5cb2b6+=0x1){_0x123ad2=_0x27fd31[_0x5cb2b6];if(_[_0xe0b0('0x41')](_0x2b1917[_0xe0b0('0x48')][_0x123ad2['id']])){_0x2b1917[_0xe0b0('0x48')][_0x123ad2['id']]=new SalesforceAccount(_0x123ad2);}else{_0x2b1917[_0xe0b0('0x3c')](_0x2b1917[_0xe0b0('0x48')][_0x123ad2['id']],_0x123ad2);}}}return _0x2b1917[_0xe0b0('0x48')];};};Realtime['prototype']['initFreshdeskAccounts']=function(){var _0x2ef908=this;return function(_0x5d380a){if(_0x5d380a){freeIsNotKey(_0x5d380a,_0x2ef908['freshdeskAccounts'],'id');for(var _0x249d9a=0x0,_0x222174={};_0x249d9a<_0x5d380a['length'];_0x249d9a+=0x1){_0x222174=_0x5d380a[_0x249d9a];if(_['isUndefined'](_0x2ef908[_0xe0b0('0x1e')][_0x222174['id']])){_0x2ef908[_0xe0b0('0x1e')][_0x222174['id']]=new FreshdeskAccount(_0x222174);}else{_0x2ef908[_0xe0b0('0x3c')](_0x2ef908[_0xe0b0('0x1e')][_0x222174['id']],_0x222174);}}}return _0x2ef908[_0xe0b0('0x1e')];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x49')]=function(){var _0x4ebb0f=this;return function(_0x22c7bc){if(_0x22c7bc){freeIsNotKey(_0x22c7bc,_0x4ebb0f['zohoAccounts'],'id');for(var _0x17b3d4=0x0,_0x54106c={};_0x17b3d4<_0x22c7bc['length'];_0x17b3d4+=0x1){_0x54106c=_0x22c7bc[_0x17b3d4];if(_[_0xe0b0('0x41')](_0x4ebb0f[_0xe0b0('0x1f')][_0x54106c['id']])){_0x4ebb0f[_0xe0b0('0x1f')][_0x54106c['id']]=new ZohoAccount(_0x54106c);}else{_0x4ebb0f[_0xe0b0('0x3c')](_0x4ebb0f[_0xe0b0('0x1f')][_0x54106c['id']],_0x54106c);}}}return _0x4ebb0f[_0xe0b0('0x1f')];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x4a')]=function(){var _0x2e1c9b=this;return function(_0x4e0d87){if(_0x4e0d87){freeIsNotKey(_0x4e0d87,_0x2e1c9b[_0xe0b0('0x20')],'id');for(var _0x57ccc9=0x0,_0x2b5553={};_0x57ccc9<_0x4e0d87[_0xe0b0('0x3e')];_0x57ccc9+=0x1){_0x2b5553=_0x4e0d87[_0x57ccc9];if(_[_0xe0b0('0x41')](_0x2e1c9b[_0xe0b0('0x20')][_0x2b5553['id']])){_0x2e1c9b[_0xe0b0('0x20')][_0x2b5553['id']]=new DeskAccount(_0x2b5553);}else{_0x2e1c9b[_0xe0b0('0x3c')](_0x2e1c9b['deskAccounts'][_0x2b5553['id']],_0x2b5553);}}}return _0x2e1c9b[_0xe0b0('0x20')];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x4b')]=function(){var _0x271445=this;return function(_0x3bb6d6){if(_0x3bb6d6){freeIsNotKey(_0x3bb6d6,_0x271445[_0xe0b0('0x1d')],'id');for(var _0x234cb7=0x0,_0x1a60d2={};_0x234cb7<_0x3bb6d6[_0xe0b0('0x3e')];_0x234cb7+=0x1){_0x1a60d2=_0x3bb6d6[_0x234cb7];if(_[_0xe0b0('0x41')](_0x271445[_0xe0b0('0x1d')][_0x1a60d2['id']])){_0x271445[_0xe0b0('0x1d')][_0x1a60d2['id']]=new SugarcrmAccount(_0x1a60d2);}else{_0x271445[_0xe0b0('0x3c')](_0x271445[_0xe0b0('0x1d')][_0x1a60d2['id']],_0x1a60d2);}}}return _0x271445[_0xe0b0('0x1d')];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x4c')]=function(){var _0x155738=this;return function(_0x5aa79b){if(_0x5aa79b){freeIsNotKey(_0x5aa79b,_0x155738[_0xe0b0('0x21')],'id');for(var _0xe7fbac=0x0,_0x1182dc={};_0xe7fbac<_0x5aa79b[_0xe0b0('0x3e')];_0xe7fbac+=0x1){_0x1182dc=_0x5aa79b[_0xe7fbac];if(_[_0xe0b0('0x41')](_0x155738[_0xe0b0('0x21')][_0x1182dc['id']])){_0x155738[_0xe0b0('0x21')][_0x1182dc['id']]=new VtigerAccount(_0x1182dc);}else{_0x155738['mergeFromDatabase'](_0x155738['vtigerAccounts'][_0x1182dc['id']],_0x1182dc);}}}return _0x155738[_0xe0b0('0x21')];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x4d')]=function(){var _0x47ecc1=this;return function(_0x117d20){if(_0x117d20){freeIsNotKey(_0x117d20,_0x47ecc1[_0xe0b0('0x4e')],'id');for(var _0x309efb=0x0,_0x3d820c={};_0x309efb<_0x117d20[_0xe0b0('0x3e')];_0x309efb+=0x1){_0x3d820c=_0x117d20[_0x309efb];if(_['isUndefined'](_0x47ecc1[_0xe0b0('0x4e')][_0x3d820c['id']])){_0x47ecc1[_0xe0b0('0x4e')][_0x3d820c['id']]=new ServicenowAccount(_0x3d820c);}else{_0x47ecc1[_0xe0b0('0x3c')](_0x47ecc1['servicenowAccounts'][_0x3d820c['id']],_0x3d820c);}}}return _0x47ecc1[_0xe0b0('0x4e')];};};Realtime[_0xe0b0('0x42')]['initDynamics365Accounts']=function(){var _0x1bd249=this;return function(_0x4c5478){if(_0x4c5478){freeIsNotKey(_0x4c5478,_0x1bd249['dynamics365Accounts'],'id');for(var _0x4474ac=0x0,_0x57b51e={};_0x4474ac<_0x4c5478['length'];_0x4474ac+=0x1){_0x57b51e=_0x4c5478[_0x4474ac];if(_[_0xe0b0('0x41')](_0x1bd249[_0xe0b0('0x22')][_0x57b51e['id']])){_0x1bd249[_0xe0b0('0x22')][_0x57b51e['id']]=new Dynamics365Account(_0x57b51e);}else{_0x1bd249[_0xe0b0('0x3c')](_0x1bd249['dynamics365Accounts'][_0x57b51e['id']],_0x57b51e);}}}return _0x1bd249[_0xe0b0('0x22')];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x4f')]=function(){var _0x41ec8e=this;return function(_0x1b29c){if(_0x1b29c){freeIsNotKey(_0x1b29c,_0x41ec8e[_0xe0b0('0x50')],'id');for(var _0xc5e88c=0x0,_0x224f1e={};_0xc5e88c<_0x1b29c['length'];_0xc5e88c+=0x1){_0x224f1e=_0x1b29c[_0xc5e88c];if(_['isUndefined'](_0x41ec8e[_0xe0b0('0x50')][_0x224f1e['id']])){_0x41ec8e[_0xe0b0('0x50')][_0x224f1e['id']]=new FreshsalesAccount(_0x224f1e);}else{_0x41ec8e[_0xe0b0('0x3c')](_0x41ec8e['freshsalesAccounts'][_0x224f1e['id']],_0x224f1e);}}}return _0x41ec8e['freshsalesAccounts'];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x51')]=function(){var _0x5d7cf4=this;return function(_0x5eca3d){for(var _0x691136=0x0;_0x691136<_0x5eca3d[_0xe0b0('0x3e')];_0x691136+=0x1){_[_0xe0b0('0x52')](_0x5d7cf4[_0xe0b0('0x13')][_0x5eca3d[_0x691136][_0xe0b0('0x25')]],_0x5eca3d[_0x691136]);}return _0x5d7cf4[_0xe0b0('0x13')];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x53')]=function(){var _0x51f209=this;return function(_0x1daff7){clearVoiceQueues(_0x51f209[_0xe0b0('0x13')]);if(_0x1daff7){_0x1daff7=_[_0xe0b0('0x54')](_0x1daff7,'uniqueid');for(var _0x4fbf44 in _0x1daff7){if(_0x1daff7['hasOwnProperty'](_0x4fbf44)){for(var _0x56ee83=0x0;_0x56ee83<_0x1daff7[_0x4fbf44]['length'];_0x56ee83+=0x1){var _0x567c06=_0x1daff7[_0x4fbf44][_0x56ee83][_0xe0b0('0x55')];if(_0x51f209['voiceQueues'][_0x567c06]){if(_0x1daff7[_0x4fbf44][_0x56ee83]['queuecallerexit']){_0x51f209[_0xe0b0('0x13')][_0x567c06][_0xe0b0('0x2e')]+=0x1;}if(_0x1daff7[_0x4fbf44][_0x56ee83][_0xe0b0('0x56')]){_0x51f209[_0xe0b0('0x13')][_0x567c06][_0xe0b0('0x2f')]+=0x1;}_0x51f209[_0xe0b0('0x13')][_0x567c06][_0xe0b0('0x2a')]+=moment(_0x1daff7[_0x4fbf44][_0x56ee83][_0xe0b0('0x57')])['diff'](moment(_0x1daff7[_0x4fbf44][_0x56ee83][_0xe0b0('0x58')]),_0xe0b0('0x59'))||0x0;if(_0x56ee83===_0x1daff7[_0x4fbf44][_0xe0b0('0x3e')]-0x1){_0x51f209[_0xe0b0('0x13')][_0x567c06][_0xe0b0('0x30')]+=moment(_0x1daff7[_0x4fbf44][_0x56ee83][_0xe0b0('0x5a')]||_0x1daff7[_0x4fbf44][_0x56ee83][_0xe0b0('0x5b')]||_0x1daff7[_0x4fbf44][_0x56ee83]['queuecallerexitAt'])[_0xe0b0('0x5c')](moment(_0x1daff7[_0x4fbf44][_0x56ee83]['queuecallerjoinAt']),_0xe0b0('0x59'))||0x0;_0x51f209[_0xe0b0('0x13')][_0x567c06][_0xe0b0('0x29')]+=0x1;if(_0x1daff7[_0x4fbf44][_0x56ee83][_0xe0b0('0x5d')]){_0x51f209['voiceQueues'][_0x567c06][_0xe0b0('0x5e')]+=0x1;_0x51f209[_0xe0b0('0x13')][_0x567c06]['sumBillable']+=moment(_0x1daff7[_0x4fbf44][_0x56ee83]['queuecallercompleteAt'])[_0xe0b0('0x5c')](moment(_0x1daff7[_0x4fbf44][_0x56ee83][_0xe0b0('0x57')]),_0xe0b0('0x59'))||0x0;}}else{_0x51f209[_0xe0b0('0x13')][_0x567c06][_0xe0b0('0x30')]+=_0x51f209[_0xe0b0('0x13')][_0x567c06][_0xe0b0('0x2a')]||0x0;}}}}}}return _0x51f209[_0xe0b0('0x13')];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x5f')]=function(){var _0x5a63e6=this;return function(_0x4c512b){clearVoiceCallReports(_0x5a63e6[_0xe0b0('0x16')]);if(_0x4c512b){for(var _0x4880d5=0x0;_0x4880d5<_0x4c512b['length'];_0x4880d5+=0x1){_0x5a63e6['outbound']['total']+=0x1;_0x5a63e6[_0xe0b0('0x16')]['sumDuration']+=_0x4c512b[_0x4880d5][_0xe0b0('0x60')];if(_0x4c512b[_0x4880d5][_0xe0b0('0x61')]===_0xe0b0('0x62')){_0x5a63e6[_0xe0b0('0x16')]['answered']+=0x1;_0x5a63e6[_0xe0b0('0x16')][_0xe0b0('0x2a')]+=_0x4c512b[_0x4880d5]['duration']-_0x4c512b[_0x4880d5][_0xe0b0('0x63')]||0x0;_0x5a63e6[_0xe0b0('0x16')][_0xe0b0('0x2b')]+=_0x4c512b[_0x4880d5][_0xe0b0('0x63')];}}}return _0x5a63e6[_0xe0b0('0x16')];};};Realtime['prototype']['initCampaigns']=function(){var _0x55aef7=this;return function(_0x545694){if(_0x545694){freeIsNotKey(_0x545694,_0x55aef7['campaigns'],_0xe0b0('0x25'));for(var _0x567e1a=0x0,_0x3c09af={};_0x567e1a<_0x545694['length'];_0x567e1a+=0x1){_0x3c09af=_0x545694[_0x567e1a];if(_[_0xe0b0('0x41')](_0x55aef7[_0xe0b0('0x64')][_0x3c09af[_0xe0b0('0x25')]])){_0x55aef7[_0xe0b0('0x64')][_0x3c09af[_0xe0b0('0x25')]]=new Campaign(_0x3c09af);}else{_0x55aef7[_0xe0b0('0x3c')](_0x55aef7['campaigns'][_0x3c09af['name']],_0x3c09af);_0x55aef7['campaigns'][_0x3c09af['name']][_0xe0b0('0x65')]=_0x3c09af[_0xe0b0('0x66')]?_0x3c09af[_0xe0b0('0x66')][_0xe0b0('0x25')]:undefined;}}}return _0x55aef7[_0xe0b0('0x64')];};};Realtime['prototype'][_0xe0b0('0x67')]=function(){var _0x39a07b=this;return function(_0xf77616){if(_0xf77616){freeIsNotKey(_0xf77616,_0x39a07b[_0xe0b0('0x17')],'id');for(var _0x154e6d=0x0,_0x2a5082={};_0x154e6d<_0xf77616[_0xe0b0('0x3e')];_0x154e6d+=0x1){_0x2a5082=_0xf77616[_0x154e6d];if(_[_0xe0b0('0x41')](_0x39a07b[_0xe0b0('0x17')][_0x2a5082['id']])){_0x39a07b['voiceExtensions'][_0x2a5082['id']]=new VoiceExtension(_0x2a5082);}else{_0x39a07b['mergeFromDatabase'](_0x39a07b[_0xe0b0('0x17')][_0x2a5082['id']],_0x2a5082);}}}return _0x39a07b[_0xe0b0('0x17')];};};Realtime['prototype'][_0xe0b0('0x68')]=function(){var _0x4593f1=this;return function(_0x44c475){clearCampaigns(_0x4593f1[_0xe0b0('0x64')]);for(var _0x7358ce=0x0;_0x7358ce<_0x44c475[_0xe0b0('0x3e')];_0x7358ce+=0x1){_[_0xe0b0('0x52')](_0x4593f1[_0xe0b0('0x64')][_0x44c475[_0x7358ce]['name']],_0x44c475[_0x7358ce]);}return _0x4593f1['campaigns'];};};Realtime['prototype'][_0xe0b0('0x69')]=function(){var _0x90d471=this;return function(_0x5d2365){if(_0x5d2365){freeIsNotKey(_0x5d2365,_0x90d471[_0xe0b0('0x23')],'id');for(var _0x448694=0x0,_0x396eec={};_0x448694<_0x5d2365[_0xe0b0('0x3e')];_0x448694+=0x1){_0x396eec=_0x5d2365[_0x448694];if(_['isUndefined'](_0x90d471['faxAccounts'][_0x396eec['id']])){_0x90d471['faxAccounts'][_0x396eec['id']]=new FaxAccount(_0x396eec);}else{_0x90d471[_0xe0b0('0x3c')](_0x90d471[_0xe0b0('0x23')][_0x396eec['id']],_0x396eec);}}}return _0x90d471['faxAccounts'];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x6a')]=function(){var _0x5547ee=this;return function(_0x576482){if(_0x576482){freeIsNotKey(_0x576482,_0x5547ee[_0xe0b0('0x13')],'name');for(var _0x251195=0x0,_0x5f06c0={};_0x251195<_0x576482[_0xe0b0('0x3e')];_0x251195+=0x1){_0x5f06c0=_0x576482[_0x251195];if(_[_0xe0b0('0x41')](_0x5547ee[_0xe0b0('0x13')][_0x5f06c0[_0xe0b0('0x25')]])){_0x5547ee[_0xe0b0('0x13')][_0x5f06c0[_0xe0b0('0x25')]]=new VoiceQueue(_0x5f06c0);}else{_0x5547ee[_0xe0b0('0x3c')](_0x5547ee[_0xe0b0('0x13')][_0x5f06c0[_0xe0b0('0x25')]],_0x5f06c0);}}}return _0x5547ee['voiceQueues'];};};module[_0xe0b0('0x6b')]=Realtime; \ No newline at end of file +var _0x5f2f=['initCampaignHopperHistory','merge','initFaxAccounts','initVoiceQueues','exports','lodash','moment','util','../model/agent','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/faxAccount','agents','telephones','voiceQueues','templates','outbound','channels','queueChannels','outboundChannels','timers','settings','zendeskAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','hasOwnProperty','format','name','isNil','interface','sumHoldTime','sumDuration','sumBillable','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','total','answered','unmanaged','outboundAnswerAgiCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundRejectCallsDay','queueStatusComplete','prototype','mergeFromDatabase','length','isUndefined','initTelephones','SIP/%s','trunks','initTriggers','triggers','initTemplates','initZendeskAccounts','initSalesforceAccounts','salesforceAccounts','initFreshdeskAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','servicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','initVoiceQueueReports','groupBy','uniqueid','queue','queuecallerexit','abandoned','queuecallerleaveAt','diff','seconds','queuecallercompleteAt','queuecallerexitAt','queuecallercomplete','initVoiceCallReports','duration','disposition','ANSWERED','billableseconds','initCampaigns','campaigns','dialQueueProject','SquareProject','initVoiceExtensions','voiceExtensions'];(function(_0x536bf1,_0xcef6ea){var _0x2ef863=function(_0x406540){while(--_0x406540){_0x536bf1['push'](_0x536bf1['shift']());}};_0x2ef863(++_0xcef6ea);}(_0x5f2f,0x73));var _0xf5f2=function(_0x5c0368,_0x423cf2){_0x5c0368=_0x5c0368-0x0;var _0x5b31b9=_0x5f2f[_0x5c0368];return _0x5b31b9;};'use strict';var _=require(_0xf5f2('0x0'));var moment=require(_0xf5f2('0x1'));var util=require(_0xf5f2('0x2'));var Agent=require(_0xf5f2('0x3'));var Telephone=require(_0xf5f2('0x4'));var Trunk=require(_0xf5f2('0x5'));var VoiceQueue=require(_0xf5f2('0x6'));var Trigger=require(_0xf5f2('0x7'));var Template=require('../model/template');var Campaign=require('../model/campaign');var VoiceExtension=require(_0xf5f2('0x8'));var ZendeskAccount=require(_0xf5f2('0x9'));var SalesforceAccount=require(_0xf5f2('0xa'));var FreshdeskAccount=require(_0xf5f2('0xb'));var SugarcrmAccount=require(_0xf5f2('0xc'));var ZohoAccount=require(_0xf5f2('0xd'));var DeskAccount=require('../model/deskAccount');var VtigerAccount=require(_0xf5f2('0xe'));var ServicenowAccount=require(_0xf5f2('0xf'));var Dynamics365Account=require(_0xf5f2('0x10'));var FreshsalesAccount=require('../model/freshsalesAccount');var FaxAccount=require(_0xf5f2('0x11'));function Realtime(){this[_0xf5f2('0x12')]={};this[_0xf5f2('0x13')]={};this['trunks']={};this[_0xf5f2('0x14')]={};this['triggers']={};this['campaigns']={};this[_0xf5f2('0x15')]={};this[_0xf5f2('0x16')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0xf5f2('0x17')]={};this[_0xf5f2('0x18')]={};this[_0xf5f2('0x19')]={};this[_0xf5f2('0x1a')]={};this[_0xf5f2('0x1b')]={};this[_0xf5f2('0x1c')]={};this['salesforceAccounts']={};this[_0xf5f2('0x1d')]={};this[_0xf5f2('0x1e')]={};this[_0xf5f2('0x1f')]={};this[_0xf5f2('0x20')]={};this[_0xf5f2('0x21')]={};this['servicenowAccounts']={};this[_0xf5f2('0x22')]={};this[_0xf5f2('0x23')]={};this[_0xf5f2('0x24')]={};}function freeIsNotKey(_0x1b6dd2,_0x23e23a,_0x3a9dbb){var _0xdb61b3=_[_0xf5f2('0x25')](_0x1b6dd2,function(_0x11f702){return _0x11f702[_0x3a9dbb];});for(var _0x228ace in _0x23e23a){if(_0x23e23a[_0xf5f2('0x26')](_0x228ace)){if(!_0xdb61b3[_0x228ace]){delete _0x23e23a[_0x228ace];}}}}function freeIsNotKeySip(_0x28e097,_0x4ff59b){var _0x3ee69=_[_0xf5f2('0x25')](_0x28e097,function(_0x626999){return util[_0xf5f2('0x27')]('SIP/%s',_0x626999[_0xf5f2('0x28')]);});for(var _0x47101e in _0x4ff59b){if(_0x4ff59b['hasOwnProperty'](_0x47101e)){if(!_0x3ee69[_0x47101e]){delete _0x4ff59b[_0x47101e];}}}}function freeIsNotKeyAgent(_0x47acfc,_0x2d2805){var _0x388e6c=_['mapKeys'](_0x47acfc,function(_0x45b74f){var _0x170042=_[_0xf5f2('0x29')](_0x45b74f[_0xf5f2('0x2a')])?util[_0xf5f2('0x27')]('SIP/%s',_0x45b74f[_0xf5f2('0x28')]):_0x45b74f[_0xf5f2('0x2a')];return _0x170042;});for(var _0x4e8bda in _0x2d2805){if(_0x2d2805[_0xf5f2('0x26')](_0x4e8bda)){if(!_0x388e6c[_0x4e8bda]){delete _0x2d2805[_0x4e8bda];}}}}function clearVoiceCallReports(_0x287ad5){_0x287ad5['total']=0x0;_0x287ad5['answered']=0x0;_0x287ad5[_0xf5f2('0x2b')]=0x0;_0x287ad5[_0xf5f2('0x2c')]=0x0;_0x287ad5[_0xf5f2('0x2d')]=0x0;}function clearCampaigns(_0x1a5bb3){if(!_[_0xf5f2('0x2e')](_0x1a5bb3)){for(var _0x788a8d in _0x1a5bb3){if(_0x1a5bb3[_0xf5f2('0x26')](_0x788a8d)){_0x1a5bb3[_0x788a8d][_0xf5f2('0x2f')]=0x0;_0x1a5bb3[_0x788a8d][_0xf5f2('0x30')]=0x0;}}}}function clearVoiceQueues(_0x4ab014){if(!_[_0xf5f2('0x2e')](_0x4ab014)){for(var _0x102449 in _0x4ab014){if(_0x4ab014[_0xf5f2('0x26')](_0x102449)){_0x4ab014[_0x102449][_0xf5f2('0x31')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x32')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x33')]=0x0;_0x4ab014[_0x102449]['abandoned']=0x0;_0x4ab014[_0x102449]['sumHoldTime']=0x0;_0x4ab014[_0x102449][_0xf5f2('0x2c')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x2d')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x34')]=0x0;_0x4ab014[_0x102449]['outboundNoAnswerCallsDay']=0x0;_0x4ab014[_0x102449]['outboundBusyCallsDay']=0x0;_0x4ab014[_0x102449][_0xf5f2('0x35')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x36')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x37')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x38')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x39')]=0x0;_0x4ab014[_0x102449]['outboundBlacklistCallsDay']=0x0;_0x4ab014[_0x102449]['outboundOriginateFailureCallsDay']=0x0;_0x4ab014[_0x102449][_0xf5f2('0x3a')]=0x0;_0x4ab014[_0x102449]['outboundReCallsDay']=0x0;_0x4ab014[_0x102449][_0xf5f2('0x34')]=0x0;_0x4ab014[_0x102449]['outboundAnswerCallsDay']=0x0;_0x4ab014[_0x102449][_0xf5f2('0x3b')]=!![];}}}}Realtime[_0xf5f2('0x3c')][_0xf5f2('0x3d')]=function(_0x428770,_0x256bd9){for(var _0x277eee in _0x256bd9){if(_0x428770[_0xf5f2('0x26')](_0x277eee)){_0x428770[_0x277eee]=_0x256bd9[_0x277eee];}}};Realtime[_0xf5f2('0x3c')]['initAgents']=function(){var _0x4149e6=this;return function(_0x43e4ff){if(_0x43e4ff){freeIsNotKeyAgent(_0x43e4ff,_0x4149e6[_0xf5f2('0x12')]);for(var _0x43c77d=0x0,_0x1408b9={};_0x43c77d<_0x43e4ff[_0xf5f2('0x3e')];_0x43c77d+=0x1){_0x1408b9=_0x43e4ff[_0x43c77d];var _0x297c0c=_['isNil'](_0x1408b9[_0xf5f2('0x2a')])?util[_0xf5f2('0x27')]('SIP/%s',_0x1408b9[_0xf5f2('0x28')]):_0x1408b9['interface'];if(_[_0xf5f2('0x3f')](_0x4149e6[_0xf5f2('0x12')][_0x297c0c])){_0x4149e6[_0xf5f2('0x12')][_0x297c0c]=new Agent(_0x1408b9);}else{_0x4149e6[_0xf5f2('0x3d')](_0x4149e6['agents'][_0x297c0c],_0x1408b9);}}}return _0x4149e6['agents'];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x40')]=function(){var _0x20eb74=this;return function(_0x4ec8fb){if(_0x4ec8fb){freeIsNotKeySip(_0x4ec8fb,_0x20eb74[_0xf5f2('0x13')]);for(var _0x4f7f80=0x0,_0x9da533={};_0x4f7f80<_0x4ec8fb['length'];_0x4f7f80+=0x1){_0x9da533=_0x4ec8fb[_0x4f7f80];if(_[_0xf5f2('0x3f')](_0x20eb74[_0xf5f2('0x13')][util['format'](_0xf5f2('0x41'),_0x9da533[_0xf5f2('0x28')])])){_0x20eb74[_0xf5f2('0x13')][util[_0xf5f2('0x27')]('SIP/%s',_0x9da533['name'])]=new Telephone(_0x9da533);}else{_0x20eb74[_0xf5f2('0x3d')](_0x20eb74[_0xf5f2('0x13')][util[_0xf5f2('0x27')](_0xf5f2('0x41'),_0x9da533[_0xf5f2('0x28')])],_0x9da533);}}}return _0x20eb74[_0xf5f2('0x13')];};};Realtime[_0xf5f2('0x3c')]['initTrunks']=function(){var _0x110fe5=this;return function(_0x3b4ea6){if(_0x3b4ea6){freeIsNotKeySip(_0x3b4ea6,_0x110fe5['trunks']);for(var _0xc6a1ae=0x0,_0x3f3895={};_0xc6a1ae<_0x3b4ea6[_0xf5f2('0x3e')];_0xc6a1ae+=0x1){_0x3f3895=_0x3b4ea6[_0xc6a1ae];if(_[_0xf5f2('0x3f')](_0x110fe5[_0xf5f2('0x42')][util[_0xf5f2('0x27')](_0xf5f2('0x41'),_0x3f3895[_0xf5f2('0x28')])])){_0x110fe5['trunks'][util[_0xf5f2('0x27')](_0xf5f2('0x41'),_0x3f3895[_0xf5f2('0x28')])]=new Trunk(_0x3f3895);}else{_0x110fe5['mergeFromDatabase'](_0x110fe5['trunks'][util['format'](_0xf5f2('0x41'),_0x3f3895[_0xf5f2('0x28')])],_0x3f3895);}}}return _0x110fe5['trunks'];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x43')]=function(){var _0x28e33f=this;return function(_0x31f86c){if(_0x31f86c){freeIsNotKey(_0x31f86c,_0x28e33f[_0xf5f2('0x44')],'id');for(var _0x2b3b1c=0x0,_0x1a6ec1={};_0x2b3b1c<_0x31f86c[_0xf5f2('0x3e')];_0x2b3b1c+=0x1){_0x1a6ec1=_0x31f86c[_0x2b3b1c];if(_[_0xf5f2('0x3f')](_0x28e33f[_0xf5f2('0x44')][_0x1a6ec1['id']])){_0x28e33f[_0xf5f2('0x44')][_0x1a6ec1['id']]=new Trigger(_0x1a6ec1);}else{_0x28e33f[_0xf5f2('0x3d')](_0x28e33f[_0xf5f2('0x44')][_0x1a6ec1['id']],_0x1a6ec1);}}}return _0x28e33f[_0xf5f2('0x44')];};};Realtime['prototype'][_0xf5f2('0x45')]=function(){var _0x578c93=this;return function(_0x3d62c1){if(_0x3d62c1){freeIsNotKey(_0x3d62c1,_0x578c93[_0xf5f2('0x15')],'id');for(var _0x218def=0x0,_0x36a4b0={};_0x218def<_0x3d62c1[_0xf5f2('0x3e')];_0x218def+=0x1){_0x36a4b0=_0x3d62c1[_0x218def];if(_[_0xf5f2('0x3f')](_0x578c93['templates'][_0x36a4b0['id']])){_0x578c93[_0xf5f2('0x15')][_0x36a4b0['id']]=new Template(_0x36a4b0);}else{_0x578c93[_0xf5f2('0x3d')](_0x578c93[_0xf5f2('0x15')][_0x36a4b0['id']],_0x36a4b0);}}}return _0x578c93[_0xf5f2('0x15')];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x46')]=function(){var _0xf638ff=this;return function(_0x297f07){if(_0x297f07){freeIsNotKey(_0x297f07,_0xf638ff['zendeskAccounts'],'id');for(var _0x35dece=0x0,_0x33ec29={};_0x35dece<_0x297f07[_0xf5f2('0x3e')];_0x35dece+=0x1){_0x33ec29=_0x297f07[_0x35dece];if(_['isUndefined'](_0xf638ff[_0xf5f2('0x1c')][_0x33ec29['id']])){_0xf638ff[_0xf5f2('0x1c')][_0x33ec29['id']]=new ZendeskAccount(_0x33ec29);}else{_0xf638ff[_0xf5f2('0x3d')](_0xf638ff['zendeskAccounts'][_0x33ec29['id']],_0x33ec29);}}}return _0xf638ff['zendeskAccounts'];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x47')]=function(){var _0x5db519=this;return function(_0x14aa81){if(_0x14aa81){freeIsNotKey(_0x14aa81,_0x5db519['salesforceAccounts'],'id');for(var _0x740321=0x0,_0x497eb8={};_0x740321<_0x14aa81[_0xf5f2('0x3e')];_0x740321+=0x1){_0x497eb8=_0x14aa81[_0x740321];if(_['isUndefined'](_0x5db519[_0xf5f2('0x48')][_0x497eb8['id']])){_0x5db519[_0xf5f2('0x48')][_0x497eb8['id']]=new SalesforceAccount(_0x497eb8);}else{_0x5db519[_0xf5f2('0x3d')](_0x5db519[_0xf5f2('0x48')][_0x497eb8['id']],_0x497eb8);}}}return _0x5db519['salesforceAccounts'];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x49')]=function(){var _0x4f6b01=this;return function(_0x58213b){if(_0x58213b){freeIsNotKey(_0x58213b,_0x4f6b01[_0xf5f2('0x1e')],'id');for(var _0x3dc0c4=0x0,_0x57782c={};_0x3dc0c4<_0x58213b[_0xf5f2('0x3e')];_0x3dc0c4+=0x1){_0x57782c=_0x58213b[_0x3dc0c4];if(_[_0xf5f2('0x3f')](_0x4f6b01[_0xf5f2('0x1e')][_0x57782c['id']])){_0x4f6b01[_0xf5f2('0x1e')][_0x57782c['id']]=new FreshdeskAccount(_0x57782c);}else{_0x4f6b01['mergeFromDatabase'](_0x4f6b01['freshdeskAccounts'][_0x57782c['id']],_0x57782c);}}}return _0x4f6b01[_0xf5f2('0x1e')];};};Realtime[_0xf5f2('0x3c')]['initZohoAccounts']=function(){var _0x40eef=this;return function(_0x43fc49){if(_0x43fc49){freeIsNotKey(_0x43fc49,_0x40eef[_0xf5f2('0x1f')],'id');for(var _0x14029e=0x0,_0x2b038e={};_0x14029e<_0x43fc49[_0xf5f2('0x3e')];_0x14029e+=0x1){_0x2b038e=_0x43fc49[_0x14029e];if(_[_0xf5f2('0x3f')](_0x40eef['zohoAccounts'][_0x2b038e['id']])){_0x40eef['zohoAccounts'][_0x2b038e['id']]=new ZohoAccount(_0x2b038e);}else{_0x40eef[_0xf5f2('0x3d')](_0x40eef[_0xf5f2('0x1f')][_0x2b038e['id']],_0x2b038e);}}}return _0x40eef[_0xf5f2('0x1f')];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x4a')]=function(){var _0x5a861d=this;return function(_0xdb1106){if(_0xdb1106){freeIsNotKey(_0xdb1106,_0x5a861d[_0xf5f2('0x20')],'id');for(var _0x18b124=0x0,_0x519c24={};_0x18b124<_0xdb1106[_0xf5f2('0x3e')];_0x18b124+=0x1){_0x519c24=_0xdb1106[_0x18b124];if(_['isUndefined'](_0x5a861d[_0xf5f2('0x20')][_0x519c24['id']])){_0x5a861d[_0xf5f2('0x20')][_0x519c24['id']]=new DeskAccount(_0x519c24);}else{_0x5a861d[_0xf5f2('0x3d')](_0x5a861d[_0xf5f2('0x20')][_0x519c24['id']],_0x519c24);}}}return _0x5a861d['deskAccounts'];};};Realtime['prototype'][_0xf5f2('0x4b')]=function(){var _0x4de303=this;return function(_0xa39c65){if(_0xa39c65){freeIsNotKey(_0xa39c65,_0x4de303[_0xf5f2('0x1d')],'id');for(var _0x572ec1=0x0,_0x3f0579={};_0x572ec1<_0xa39c65[_0xf5f2('0x3e')];_0x572ec1+=0x1){_0x3f0579=_0xa39c65[_0x572ec1];if(_[_0xf5f2('0x3f')](_0x4de303['sugarcrmAccounts'][_0x3f0579['id']])){_0x4de303[_0xf5f2('0x1d')][_0x3f0579['id']]=new SugarcrmAccount(_0x3f0579);}else{_0x4de303[_0xf5f2('0x3d')](_0x4de303[_0xf5f2('0x1d')][_0x3f0579['id']],_0x3f0579);}}}return _0x4de303[_0xf5f2('0x1d')];};};Realtime['prototype'][_0xf5f2('0x4c')]=function(){var _0x506fe5=this;return function(_0x2cbe1e){if(_0x2cbe1e){freeIsNotKey(_0x2cbe1e,_0x506fe5[_0xf5f2('0x21')],'id');for(var _0x2e6f5d=0x0,_0x380c08={};_0x2e6f5d<_0x2cbe1e[_0xf5f2('0x3e')];_0x2e6f5d+=0x1){_0x380c08=_0x2cbe1e[_0x2e6f5d];if(_['isUndefined'](_0x506fe5[_0xf5f2('0x21')][_0x380c08['id']])){_0x506fe5[_0xf5f2('0x21')][_0x380c08['id']]=new VtigerAccount(_0x380c08);}else{_0x506fe5[_0xf5f2('0x3d')](_0x506fe5[_0xf5f2('0x21')][_0x380c08['id']],_0x380c08);}}}return _0x506fe5[_0xf5f2('0x21')];};};Realtime['prototype'][_0xf5f2('0x4d')]=function(){var _0x5ee6bc=this;return function(_0x4c96ee){if(_0x4c96ee){freeIsNotKey(_0x4c96ee,_0x5ee6bc[_0xf5f2('0x4e')],'id');for(var _0x4802c5=0x0,_0x10f2b8={};_0x4802c5<_0x4c96ee[_0xf5f2('0x3e')];_0x4802c5+=0x1){_0x10f2b8=_0x4c96ee[_0x4802c5];if(_[_0xf5f2('0x3f')](_0x5ee6bc[_0xf5f2('0x4e')][_0x10f2b8['id']])){_0x5ee6bc['servicenowAccounts'][_0x10f2b8['id']]=new ServicenowAccount(_0x10f2b8);}else{_0x5ee6bc[_0xf5f2('0x3d')](_0x5ee6bc[_0xf5f2('0x4e')][_0x10f2b8['id']],_0x10f2b8);}}}return _0x5ee6bc[_0xf5f2('0x4e')];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x4f')]=function(){var _0x35d868=this;return function(_0x158768){if(_0x158768){freeIsNotKey(_0x158768,_0x35d868['dynamics365Accounts'],'id');for(var _0x1f55af=0x0,_0x2d171d={};_0x1f55af<_0x158768[_0xf5f2('0x3e')];_0x1f55af+=0x1){_0x2d171d=_0x158768[_0x1f55af];if(_[_0xf5f2('0x3f')](_0x35d868['dynamics365Accounts'][_0x2d171d['id']])){_0x35d868[_0xf5f2('0x22')][_0x2d171d['id']]=new Dynamics365Account(_0x2d171d);}else{_0x35d868['mergeFromDatabase'](_0x35d868[_0xf5f2('0x22')][_0x2d171d['id']],_0x2d171d);}}}return _0x35d868[_0xf5f2('0x22')];};};Realtime['prototype'][_0xf5f2('0x50')]=function(){var _0x975bd8=this;return function(_0xa0c139){if(_0xa0c139){freeIsNotKey(_0xa0c139,_0x975bd8[_0xf5f2('0x23')],'id');for(var _0x146462=0x0,_0x4bd113={};_0x146462<_0xa0c139[_0xf5f2('0x3e')];_0x146462+=0x1){_0x4bd113=_0xa0c139[_0x146462];if(_[_0xf5f2('0x3f')](_0x975bd8[_0xf5f2('0x23')][_0x4bd113['id']])){_0x975bd8[_0xf5f2('0x23')][_0x4bd113['id']]=new FreshsalesAccount(_0x4bd113);}else{_0x975bd8[_0xf5f2('0x3d')](_0x975bd8[_0xf5f2('0x23')][_0x4bd113['id']],_0x4bd113);}}}return _0x975bd8['freshsalesAccounts'];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x51')]=function(){var _0x4800fe=this;return function(_0x3f677e){for(var _0x36503c=0x0;_0x36503c<_0x3f677e[_0xf5f2('0x3e')];_0x36503c+=0x1){_['merge'](_0x4800fe['voiceQueues'][_0x3f677e[_0x36503c]['name']],_0x3f677e[_0x36503c]);}return _0x4800fe[_0xf5f2('0x14')];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x52')]=function(){var _0x450691=this;return function(_0x55da4d){clearVoiceQueues(_0x450691['voiceQueues']);if(_0x55da4d){_0x55da4d=_[_0xf5f2('0x53')](_0x55da4d,_0xf5f2('0x54'));for(var _0xc10cf3 in _0x55da4d){if(_0x55da4d[_0xf5f2('0x26')](_0xc10cf3)){for(var _0x794e0c=0x0;_0x794e0c<_0x55da4d[_0xc10cf3][_0xf5f2('0x3e')];_0x794e0c+=0x1){var _0x11c302=_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x55')];if(_0x450691[_0xf5f2('0x14')][_0x11c302]){if(_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x56')]){_0x450691[_0xf5f2('0x14')][_0x11c302]['unmanaged']+=0x1;}if(_0x55da4d[_0xc10cf3][_0x794e0c]['queuecallerabandon']){_0x450691['voiceQueues'][_0x11c302][_0xf5f2('0x57')]+=0x1;}_0x450691[_0xf5f2('0x14')][_0x11c302][_0xf5f2('0x2b')]+=moment(_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x58')])[_0xf5f2('0x59')](moment(_0x55da4d[_0xc10cf3][_0x794e0c]['queuecallerjoinAt']),_0xf5f2('0x5a'))||0x0;if(_0x794e0c===_0x55da4d[_0xc10cf3][_0xf5f2('0x3e')]-0x1){_0x450691[_0xf5f2('0x14')][_0x11c302][_0xf5f2('0x2c')]+=moment(_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x5b')]||_0x55da4d[_0xc10cf3][_0x794e0c]['queuecallerabandonAt']||_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x5c')])[_0xf5f2('0x59')](moment(_0x55da4d[_0xc10cf3][_0x794e0c]['queuecallerjoinAt']),_0xf5f2('0x5a'))||0x0;_0x450691[_0xf5f2('0x14')][_0x11c302][_0xf5f2('0x31')]+=0x1;if(_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x5d')]){_0x450691['voiceQueues'][_0x11c302][_0xf5f2('0x32')]+=0x1;_0x450691[_0xf5f2('0x14')][_0x11c302][_0xf5f2('0x2d')]+=moment(_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x5b')])[_0xf5f2('0x59')](moment(_0x55da4d[_0xc10cf3][_0x794e0c]['queuecallerleaveAt']),'seconds')||0x0;}}else{_0x450691[_0xf5f2('0x14')][_0x11c302][_0xf5f2('0x2c')]+=_0x450691[_0xf5f2('0x14')][_0x11c302][_0xf5f2('0x2b')]||0x0;}}}}}}return _0x450691['voiceQueues'];};};Realtime['prototype'][_0xf5f2('0x5e')]=function(){var _0x4f2fcc=this;return function(_0x4c4420){clearVoiceCallReports(_0x4f2fcc['outbound']);if(_0x4c4420){for(var _0x57cb18=0x0;_0x57cb18<_0x4c4420[_0xf5f2('0x3e')];_0x57cb18+=0x1){_0x4f2fcc[_0xf5f2('0x16')][_0xf5f2('0x31')]+=0x1;_0x4f2fcc[_0xf5f2('0x16')][_0xf5f2('0x2c')]+=_0x4c4420[_0x57cb18][_0xf5f2('0x5f')];if(_0x4c4420[_0x57cb18][_0xf5f2('0x60')]===_0xf5f2('0x61')){_0x4f2fcc[_0xf5f2('0x16')][_0xf5f2('0x32')]+=0x1;_0x4f2fcc[_0xf5f2('0x16')][_0xf5f2('0x2b')]+=_0x4c4420[_0x57cb18][_0xf5f2('0x5f')]-_0x4c4420[_0x57cb18][_0xf5f2('0x62')]||0x0;_0x4f2fcc[_0xf5f2('0x16')][_0xf5f2('0x2d')]+=_0x4c4420[_0x57cb18][_0xf5f2('0x62')];}}}return _0x4f2fcc[_0xf5f2('0x16')];};};Realtime['prototype'][_0xf5f2('0x63')]=function(){var _0x35299d=this;return function(_0x21043b){if(_0x21043b){freeIsNotKey(_0x21043b,_0x35299d[_0xf5f2('0x64')],_0xf5f2('0x28'));for(var _0x308220=0x0,_0x16491c={};_0x308220<_0x21043b[_0xf5f2('0x3e')];_0x308220+=0x1){_0x16491c=_0x21043b[_0x308220];if(_['isUndefined'](_0x35299d[_0xf5f2('0x64')][_0x16491c['name']])){_0x35299d['campaigns'][_0x16491c['name']]=new Campaign(_0x16491c);}else{_0x35299d['mergeFromDatabase'](_0x35299d['campaigns'][_0x16491c['name']],_0x16491c);_0x35299d[_0xf5f2('0x64')][_0x16491c[_0xf5f2('0x28')]][_0xf5f2('0x65')]=_0x16491c[_0xf5f2('0x66')]?_0x16491c[_0xf5f2('0x66')][_0xf5f2('0x28')]:undefined;}}}return _0x35299d['campaigns'];};};Realtime['prototype'][_0xf5f2('0x67')]=function(){var _0x578a22=this;return function(_0x418ece){if(_0x418ece){freeIsNotKey(_0x418ece,_0x578a22[_0xf5f2('0x68')],'id');for(var _0x59161c=0x0,_0x4f3ad4={};_0x59161c<_0x418ece[_0xf5f2('0x3e')];_0x59161c+=0x1){_0x4f3ad4=_0x418ece[_0x59161c];if(_[_0xf5f2('0x3f')](_0x578a22['voiceExtensions'][_0x4f3ad4['id']])){_0x578a22[_0xf5f2('0x68')][_0x4f3ad4['id']]=new VoiceExtension(_0x4f3ad4);}else{_0x578a22[_0xf5f2('0x3d')](_0x578a22['voiceExtensions'][_0x4f3ad4['id']],_0x4f3ad4);}}}return _0x578a22[_0xf5f2('0x68')];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x69')]=function(){var _0x4c1678=this;return function(_0x33e9ad){clearCampaigns(_0x4c1678[_0xf5f2('0x64')]);for(var _0x14db86=0x0;_0x14db86<_0x33e9ad[_0xf5f2('0x3e')];_0x14db86+=0x1){_[_0xf5f2('0x6a')](_0x4c1678[_0xf5f2('0x64')][_0x33e9ad[_0x14db86][_0xf5f2('0x28')]],_0x33e9ad[_0x14db86]);}return _0x4c1678[_0xf5f2('0x64')];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x6b')]=function(){var _0x191af3=this;return function(_0x2601aa){if(_0x2601aa){freeIsNotKey(_0x2601aa,_0x191af3[_0xf5f2('0x24')],'id');for(var _0x407dd8=0x0,_0xe900ea={};_0x407dd8<_0x2601aa[_0xf5f2('0x3e')];_0x407dd8+=0x1){_0xe900ea=_0x2601aa[_0x407dd8];if(_[_0xf5f2('0x3f')](_0x191af3[_0xf5f2('0x24')][_0xe900ea['id']])){_0x191af3[_0xf5f2('0x24')][_0xe900ea['id']]=new FaxAccount(_0xe900ea);}else{_0x191af3[_0xf5f2('0x3d')](_0x191af3[_0xf5f2('0x24')][_0xe900ea['id']],_0xe900ea);}}}return _0x191af3['faxAccounts'];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x6c')]=function(){var _0x5d6c6e=this;return function(_0x2e49ce){if(_0x2e49ce){freeIsNotKey(_0x2e49ce,_0x5d6c6e[_0xf5f2('0x14')],'name');for(var _0xb56304=0x0,_0x2f54eb={};_0xb56304<_0x2e49ce[_0xf5f2('0x3e')];_0xb56304+=0x1){_0x2f54eb=_0x2e49ce[_0xb56304];if(_['isUndefined'](_0x5d6c6e['voiceQueues'][_0x2f54eb[_0xf5f2('0x28')]])){_0x5d6c6e[_0xf5f2('0x14')][_0x2f54eb[_0xf5f2('0x28')]]=new VoiceQueue(_0x2f54eb);}else{_0x5d6c6e['mergeFromDatabase'](_0x5d6c6e['voiceQueues'][_0x2f54eb[_0xf5f2('0x28')]],_0x2f54eb);}}}return _0x5d6c6e[_0xf5f2('0x14')];};};module[_0xf5f2('0x6d')]=Realtime; \ No newline at end of file diff --git a/server/services/ami/realtime/utils.js b/server/services/ami/realtime/utils.js index ea87f39..b02928e 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 _0x1c93=['hasOwnProperty','mergeDBDataToRealtime','assign'];(function(_0x4bf1cc,_0x279292){var _0x5e9db6=function(_0x4536ef){while(--_0x4536ef){_0x4bf1cc['push'](_0x4bf1cc['shift']());}};_0x5e9db6(++_0x279292);}(_0x1c93,0xec));var _0x31c9=function(_0x2bedf3,_0x248a47){_0x2bedf3=_0x2bedf3-0x0;var _0x3cc140=_0x1c93[_0x2bedf3];return _0x3cc140;};'use strict';function mergeDBDataToRealtime(_0x220d57,_0x248440){var _0x5912f7=Object[_0x31c9('0x0')]({},_0x220d57);for(var _0xe95d85 in _0x248440){if(_0x5912f7[_0x31c9('0x1')](_0xe95d85)){_0x5912f7[_0xe95d85]=_0x248440[_0xe95d85];}}return _0x5912f7;}exports[_0x31c9('0x2')]=mergeDBDataToRealtime; \ No newline at end of file +var _0xdd1e=['mergeDBDataToRealtime','assign','hasOwnProperty'];(function(_0x1932a4,_0x2d7b33){var _0x192d8d=function(_0x233dbe){while(--_0x233dbe){_0x1932a4['push'](_0x1932a4['shift']());}};_0x192d8d(++_0x2d7b33);}(_0xdd1e,0x103));var _0xedd1=function(_0x38d93e,_0x3e5db6){_0x38d93e=_0x38d93e-0x0;var _0x4fa2ad=_0xdd1e[_0x38d93e];return _0x4fa2ad;};'use strict';function mergeDBDataToRealtime(_0x1ef1e3,_0x4e0caa){var _0x1163cc=Object[_0xedd1('0x0')]({},_0x1ef1e3);for(var _0x30347f in _0x4e0caa){if(_0x1163cc[_0xedd1('0x1')](_0x30347f)){_0x1163cc[_0x30347f]=_0x4e0caa[_0x30347f];}}return _0x1163cc;}exports[_0xedd1('0x2')]=mergeDBDataToRealtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index 4601cfd..ac89bee 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 _0xa8ff=['originatecalleridnum','destinationchannel','disposition','ANSWERED','calleridname','transfers','linkedid','uniqueid','monitor','filename','createdAt','connectedlinename','membername','isArray','forEach','indexOf','mobile','phone','substring','lastIndexOf','transfererlinkedid','attendedTransfer','exports','lodash','util','../ami','../rpc/voiceAgentReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceRecording','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./userReport','realtime','agents','telephones','prototype','sync','xdr','custom:voiceQueueReport','voiceQueueReport','voiceCallReport','bind','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','blindTransfer','attendedtransfer','findAgent','find','accountcode','name','interface','format','connectedlinenum','assigned','lastAssignedTo','isNil','SIP/%s','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','create','match','getAgentByInternal','keys','length','getCallType','channel','split','destination','exten','type','dialer','queue','lastdata','context','from-voip-provider','callerid','from-sip','xcally-motion-preview','calleridpreview','calleridnum'];(function(_0x3bfbe9,_0x52821c){var _0x447485=function(_0x292d03){while(--_0x292d03){_0x3bfbe9['push'](_0x3bfbe9['shift']());}};_0x447485(++_0x52821c);}(_0xa8ff,0x11f));var _0xfa8f=function(_0x29d915,_0x54a040){_0x29d915=_0x29d915-0x0;var _0x160f86=_0xa8ff[_0x29d915];return _0x160f86;};'use strict';var _=require(_0xfa8f('0x0'));var moment=require('moment');var util=require(_0xfa8f('0x1'));var config=require('../../../config/environment');var ami=require(_0xfa8f('0x2'));var RpcVoiceAgentReport=require(_0xfa8f('0x3'));var RpcVoiceCallReport=require('../rpc/voiceCallReport');var RpcVoiceDialReport=require(_0xfa8f('0x4'));var RpcMemberReport=require(_0xfa8f('0x5'));var RpcVoiceQueueReport=require('../rpc/voiceQueueReport');var RpcVoiceRecording=require(_0xfa8f('0x6'));var RpcVoiceTransferReport=require('../rpc/voiceTransferReport');var VoiceQueueReport=require(_0xfa8f('0x7'));var VoiceCallReport=require(_0xfa8f('0x8'));var VoiceAgentReport=require(_0xfa8f('0x9'));var VoiceDialReport=require('./voiceDialReport');var UserReport=require(_0xfa8f('0xa'));function Report(_0x208c21){this[_0xfa8f('0xb')]=_0x208c21;this['agents']=_0x208c21[_0xfa8f('0xc')];this['telephones']=_0x208c21[_0xfa8f('0xd')];}Report[_0xfa8f('0xe')][_0xfa8f('0xf')]=function(_0x15a91f){var _0x13bda8=new VoiceQueueReport(this['realtime']);var _0x4ec085=new VoiceAgentReport(this[_0xfa8f('0xb')]);var _0x294485=new VoiceDialReport(this[_0xfa8f('0xb')]);var _0x192fb0=new VoiceCallReport(this[_0xfa8f('0xb')]);var _0x4944af=new UserReport(this[_0xfa8f('0xb')]);if(config[_0xfa8f('0x10')]&&config['xdr']['disabled']){ami['on'](_0xfa8f('0x11'),this[_0xfa8f('0x12')]['bind'](this));ami['on']('custom:voiceCallReport',this[_0xfa8f('0x13')][_0xfa8f('0x14')](this));ami['on'](_0xfa8f('0x15'),this[_0xfa8f('0x16')][_0xfa8f('0x14')](this));ami['on'](_0xfa8f('0x17'),this[_0xfa8f('0x18')][_0xfa8f('0x14')](this));ami['on'](_0xfa8f('0x19'),this[_0xfa8f('0x1a')]['bind'](this));ami['on'](_0xfa8f('0x1b'),this['attendedTransfer']['bind'](this));}};Report[_0xfa8f('0xe')][_0xfa8f('0x1c')]=function(_0x40fa43){var _0x1079a3;_0x1079a3=_[_0xfa8f('0x1d')](this[_0xfa8f('0xc')],function(_0xf10aec){return _0xf10aec[_0xfa8f('0x1e')]==_0x40fa43||_0xf10aec[_0xfa8f('0x1f')]==_0x40fa43;});if(_['isNil'](_0x1079a3)){var _0x183257=_['find'](this[_0xfa8f('0xd')],function(_0x40ad37){return _0x40ad37[_0xfa8f('0x1e')]==_0x40fa43||_0x40ad37['name']==_0x40fa43;});if(_0x183257){_0x1079a3=_[_0xfa8f('0x1d')](this[_0xfa8f('0xc')],function(_0x59b42f){return _0x59b42f[_0xfa8f('0x20')]==util[_0xfa8f('0x21')]('SIP/%s',_0x183257['name']);});}}return _0x1079a3;};Report[_0xfa8f('0xe')][_0xfa8f('0x12')]=function(_0x1c638d){for(var _0x37fa1a=0x0;_0x37fa1a<_0x1c638d['length'];_0x37fa1a+=0x1){var _0xbeff49=this[_0xfa8f('0x1c')](_0x1c638d[_0x37fa1a][_0xfa8f('0x22')]);if(_0xbeff49){_0x1c638d[_0x37fa1a][_0xfa8f('0x1e')]=_0xbeff49[_0xfa8f('0x1e')];_0x1c638d[_0x37fa1a][_0xfa8f('0x23')]=!![];_0x1c638d[_0x37fa1a][_0xfa8f('0x24')]=_0xbeff49[_0xfa8f('0x1f')];_0x1c638d[_0x37fa1a][_0xfa8f('0x20')]=_[_0xfa8f('0x25')](_0xbeff49[_0xfa8f('0x20')])?util[_0xfa8f('0x21')](_0xfa8f('0x26'),_0xbeff49['name']):_0xbeff49[_0xfa8f('0x20')];if(_0x1c638d[_0x37fa1a][_0xfa8f('0x27')]){_0x1c638d[_0x37fa1a][_0xfa8f('0x28')]=moment()['format'](_0xfa8f('0x29'));}if(_0x1c638d[_0x37fa1a][_0xfa8f('0x2a')]){_0x1c638d[_0x37fa1a][_0xfa8f('0x2b')]=moment()['format'](_0xfa8f('0x29'));}RpcMemberReport['voiceQueueReport'](_0x1c638d[_0x37fa1a]);}RpcVoiceQueueReport[_0xfa8f('0x2c')](_0x1c638d[_0x37fa1a]);}};function extractCalleridNumber(_0x33ac2a){var _0x3ac4a1=_0x33ac2a[_0xfa8f('0x2d')](/<(.*?)>/);return _0x3ac4a1?_0x3ac4a1[0x1]:_0x33ac2a;}Report[_0xfa8f('0xe')][_0xfa8f('0x2e')]=function(_0x3690f0){for(var _0x938d7f=0x0;_0x938d7f',_0xf75556[_0xfa8f('0x45')],_0xf75556[_0xfa8f('0x40')]);}if(RpcVoiceTransferReport[_0xfa8f('0x46')][_0xf75556[_0xfa8f('0x47')]]){var _0x22ac63=RpcVoiceTransferReport['transfers'][_0xf75556[_0xfa8f('0x47')]];_0x22ac63['transfereelinkedid']=_0xf75556[_0xfa8f('0x48')];RpcVoiceTransferReport['blindTransfer'](_0x22ac63);delete RpcVoiceTransferReport[_0xfa8f('0x46')][_0xf75556['linkedid']];}if(_[_0xfa8f('0x25')](_0xf75556['type'])){_0xf75556['type']=this[_0xfa8f('0x31')](_0xf75556);}if(_[_0xfa8f('0x25')](_0xf75556['UserId'])){var _0x40bbc7=_0xf75556[_0xfa8f('0x32')][_0xfa8f('0x33')]('-')[0x0];var _0x2e19c5=this[_0xfa8f('0xc')][_0x40bbc7];if(!_0x2e19c5)_0x2e19c5=this[_0xfa8f('0x2e')](_0xf75556[_0xfa8f('0x1e')]);if(_0x2e19c5){_0xf75556['UserId']=_0x2e19c5['id'];_0xf75556['membername']=_0x2e19c5[_0xfa8f('0x1f')];}}RpcVoiceCallReport[_0xfa8f('0x2c')](_0xf75556);if(_0xf75556[_0xfa8f('0x49')]){for(var _0x132566=0x0;_0x132566<_0xf75556['monitors'][_0xfa8f('0x30')];_0x132566+=0x1){_0xf75556['monitorFilename']=_0xf75556['monitors'][_0x132566][_0xfa8f('0x4a')];_0xf75556[_0xfa8f('0x4b')]=_0xf75556['monitors'][_0x132566][_0xfa8f('0x4b')];if(_0xf75556[_0xfa8f('0x35')]=='xcally-motion-preview'){_0xf75556[_0xfa8f('0x40')]=_0xf75556[_0xfa8f('0x22')];_0xf75556[_0xfa8f('0x45')]=_0xf75556[_0xfa8f('0x4c')];_0xf75556[_0xfa8f('0x22')]=_0xf75556['accountcode'];_0xf75556[_0xfa8f('0x4c')]=_0xf75556[_0xfa8f('0x4d')];_0xf75556['exten']=_0xf75556[_0xfa8f('0x41')];}else if(_0xf75556['exten']=='xcally-motion-dialer'){_0xf75556[_0xfa8f('0x40')]=_0xf75556['destination'];_0xf75556[_0xfa8f('0x35')]=_0xf75556[_0xfa8f('0x41')];}RpcVoiceRecording[_0xfa8f('0x2c')](_0xf75556);}}};Report[_0xfa8f('0xe')][_0xfa8f('0x16')]=function(_0x4c38b8){if(_[_0xfa8f('0x4e')](_0x4c38b8)){_0x4c38b8[_0xfa8f('0x4f')](function(_0xa997cb){RpcVoiceAgentReport['create'](_0xa997cb);});}else{RpcVoiceAgentReport[_0xfa8f('0x2c')](_0x4c38b8);}};Report[_0xfa8f('0xe')][_0xfa8f('0x18')]=function(_0x36c303){RpcVoiceDialReport['create'](_0x36c303);var _0x581e7c;var _0x175c31;var _0x379ed1=_0x36c303[_0xfa8f('0x32')];if(_['startsWith'](_0x379ed1,'Local')){_0x175c31=_0x379ed1['substring'](_0x379ed1[_0xfa8f('0x50')]('/')+0x1,_0x379ed1['indexOf']('@'));_0x581e7c=_[_0xfa8f('0x1d')](this[_0xfa8f('0xc')],function(_0xeff3b){return _0xeff3b[_0xfa8f('0x51')]==_0x175c31||_0xeff3b[_0xfa8f('0x52')]==_0x175c31||_0xeff3b['accountcode']==_0x175c31;});}else{_0x175c31=_0x379ed1[_0xfa8f('0x53')](_0x379ed1[_0xfa8f('0x50')]('/')+0x1,_0x379ed1[_0xfa8f('0x54')]('-'));_0x581e7c=this[_0xfa8f('0x1c')](_0x175c31);}if(_0x581e7c){_0x36c303[_0xfa8f('0x20')]=_[_0xfa8f('0x25')](_0x581e7c[_0xfa8f('0x20')])?util[_0xfa8f('0x21')](_0xfa8f('0x26'),_0x581e7c['name']):_0x581e7c[_0xfa8f('0x20')];_0x36c303[_0xfa8f('0x4d')]=_0x581e7c['name'];_0x36c303[_0xfa8f('0x1e')]=_0x581e7c['accountcode'];RpcMemberReport[_0xfa8f('0x18')](_0x36c303);}};Report[_0xfa8f('0xe')][_0xfa8f('0x1a')]=function(_0x13c8a4){RpcVoiceTransferReport['transfers'][_0x13c8a4[_0xfa8f('0x55')]]=_0x13c8a4;};Report[_0xfa8f('0xe')][_0xfa8f('0x56')]=function(_0x36ea7a){RpcVoiceTransferReport[_0xfa8f('0x56')](_0x36ea7a);};module[_0xfa8f('0x57')]=Report; \ No newline at end of file +var _0xba89=['createdAt','exten','xcally-motion-preview','connectedlinename','xcally-motion-dialer','isArray','substring','indexOf','mobile','phone','lastIndexOf','exports','lodash','moment','util','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/voiceDialReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceDialReport','./userReport','realtime','agents','telephones','prototype','sync','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','bind','custom:voiceCallReport','voiceCallReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','blindTransfer','attendedtransfer','attendedTransfer','findAgent','find','accountcode','name','isNil','interface','format','SIP/%s','length','connectedlinenum','assigned','lastAssignedTo','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','create','keys','channel','split','calleridnum','outbound','internal','destination','type','lastapplication','queue','lastdata','context','from-voip-provider','callerid','from-sip','calleridpreview','originatecalleridnum','destinationchannel','disposition','ANSWERED','\x22%s\x22\x20<%s>','calleridname','transfers','linkedid','transfereelinkedid','getCallType','UserId','getAgentByInternal','membername','monitors','monitorFilename','filename'];(function(_0x44d54c,_0x21c7ff){var _0x287de2=function(_0x531f21){while(--_0x531f21){_0x44d54c['push'](_0x44d54c['shift']());}};_0x287de2(++_0x21c7ff);}(_0xba89,0x1dd));var _0x9ba8=function(_0x45b900,_0x2d7019){_0x45b900=_0x45b900-0x0;var _0x40233d=_0xba89[_0x45b900];return _0x40233d;};'use strict';var _=require(_0x9ba8('0x0'));var moment=require(_0x9ba8('0x1'));var util=require(_0x9ba8('0x2'));var config=require(_0x9ba8('0x3'));var ami=require(_0x9ba8('0x4'));var RpcVoiceAgentReport=require(_0x9ba8('0x5'));var RpcVoiceCallReport=require('../rpc/voiceCallReport');var RpcVoiceDialReport=require(_0x9ba8('0x6'));var RpcMemberReport=require('../rpc/memberReport');var RpcVoiceQueueReport=require(_0x9ba8('0x7'));var RpcVoiceRecording=require(_0x9ba8('0x8'));var RpcVoiceTransferReport=require(_0x9ba8('0x9'));var VoiceQueueReport=require(_0x9ba8('0xa'));var VoiceCallReport=require(_0x9ba8('0xb'));var VoiceAgentReport=require('./voiceAgentReport');var VoiceDialReport=require(_0x9ba8('0xc'));var UserReport=require(_0x9ba8('0xd'));function Report(_0x435f96){this[_0x9ba8('0xe')]=_0x435f96;this['agents']=_0x435f96[_0x9ba8('0xf')];this[_0x9ba8('0x10')]=_0x435f96[_0x9ba8('0x10')];}Report[_0x9ba8('0x11')][_0x9ba8('0x12')]=function(_0x484c67){var _0xe61a26=new VoiceQueueReport(this['realtime']);var _0x5b1eaf=new VoiceAgentReport(this['realtime']);var _0x2214a9=new VoiceDialReport(this[_0x9ba8('0xe')]);var _0x317453=new VoiceCallReport(this[_0x9ba8('0xe')]);var _0x266f37=new UserReport(this[_0x9ba8('0xe')]);if(config[_0x9ba8('0x13')]&&config[_0x9ba8('0x13')][_0x9ba8('0x14')]){ami['on'](_0x9ba8('0x15'),this[_0x9ba8('0x16')][_0x9ba8('0x17')](this));ami['on'](_0x9ba8('0x18'),this[_0x9ba8('0x19')][_0x9ba8('0x17')](this));ami['on']('custom:voiceAgentReport',this[_0x9ba8('0x1a')]['bind'](this));ami['on'](_0x9ba8('0x1b'),this[_0x9ba8('0x1c')][_0x9ba8('0x17')](this));ami['on'](_0x9ba8('0x1d'),this[_0x9ba8('0x1e')][_0x9ba8('0x17')](this));ami['on'](_0x9ba8('0x1f'),this[_0x9ba8('0x20')][_0x9ba8('0x17')](this));}};Report['prototype'][_0x9ba8('0x21')]=function(_0x44ee3b){var _0x1ed65d;_0x1ed65d=_[_0x9ba8('0x22')](this[_0x9ba8('0xf')],function(_0x5c8659){return _0x5c8659[_0x9ba8('0x23')]==_0x44ee3b||_0x5c8659[_0x9ba8('0x24')]==_0x44ee3b;});if(_[_0x9ba8('0x25')](_0x1ed65d)){var _0x5f4fcf=_['find'](this[_0x9ba8('0x10')],function(_0x4b457f){return _0x4b457f['accountcode']==_0x44ee3b||_0x4b457f[_0x9ba8('0x24')]==_0x44ee3b;});if(_0x5f4fcf){_0x1ed65d=_[_0x9ba8('0x22')](this['agents'],function(_0x5df792){return _0x5df792[_0x9ba8('0x26')]==util[_0x9ba8('0x27')](_0x9ba8('0x28'),_0x5f4fcf[_0x9ba8('0x24')]);});}}return _0x1ed65d;};Report[_0x9ba8('0x11')][_0x9ba8('0x16')]=function(_0x2e97bb){for(var _0x2c10b9=0x0;_0x2c10b9<_0x2e97bb[_0x9ba8('0x29')];_0x2c10b9+=0x1){var _0x47d504=this[_0x9ba8('0x21')](_0x2e97bb[_0x2c10b9][_0x9ba8('0x2a')]);if(_0x47d504){_0x2e97bb[_0x2c10b9][_0x9ba8('0x23')]=_0x47d504[_0x9ba8('0x23')];_0x2e97bb[_0x2c10b9][_0x9ba8('0x2b')]=!![];_0x2e97bb[_0x2c10b9][_0x9ba8('0x2c')]=_0x47d504[_0x9ba8('0x24')];_0x2e97bb[_0x2c10b9]['interface']=_[_0x9ba8('0x25')](_0x47d504['interface'])?util[_0x9ba8('0x27')](_0x9ba8('0x28'),_0x47d504[_0x9ba8('0x24')]):_0x47d504[_0x9ba8('0x26')];if(_0x2e97bb[_0x2c10b9]['queuecallercomplete']){_0x2e97bb[_0x2c10b9][_0x9ba8('0x2d')]=moment()[_0x9ba8('0x27')](_0x9ba8('0x2e'));}if(_0x2e97bb[_0x2c10b9][_0x9ba8('0x2f')]){_0x2e97bb[_0x2c10b9]['queuecallerexitAt']=moment()[_0x9ba8('0x27')](_0x9ba8('0x2e'));}RpcMemberReport[_0x9ba8('0x16')](_0x2e97bb[_0x2c10b9]);}RpcVoiceQueueReport[_0x9ba8('0x30')](_0x2e97bb[_0x2c10b9]);}};function extractCalleridNumber(_0x34d11c){var _0x1e29d7=_0x34d11c['match'](/<(.*?)>/);return _0x1e29d7?_0x1e29d7[0x1]:_0x34d11c;}Report['prototype']['getAgentByInternal']=function(_0x37c755){for(var _0x2c7feb=0x0;_0x2c7feb0x0?!![]:![];if(!_0x2227ba){return this[_0x4ede('0x1c')](this[_0x4ede('0x16')][_0x4ede('0x70')]);}};VoiceQueueReport[_0x4ede('0xd')][_0x4ede('0x1e')]=function(_0xbbe306){var _0x49e116=this[_0x4ede('0x16')]['id'];if(this[_0x4ede('0x16')][_0x4ede('0x63')][_0x49e116]&&this[_0x4ede('0x16')][_0x4ede('0x63')][_0x49e116][_0xbbe306[_0x4ede('0x71')]]){this[_0x4ede('0x16')][_0x4ede('0x63')][_0x49e116][_0xbbe306['actionid']]['agents'][_0x4ede('0x72')](_0xbbe306);}};VoiceQueueReport[_0x4ede('0xd')][_0x4ede('0x19')]=function(_0x370696){var _0x15adab=this;try{if(this[_0x4ede('0x5d')](_0x370696)&&this['isNotNull'](_0x370696[_0x4ede('0x6b')])){logger[_0x4ede('0x53')](_0x4ede('0x73'),util[_0x4ede('0x45')](_0x370696,{'showHidden':![],'depth':null}));var _0x61c788=this[_0x4ede('0x14')][_0x370696[_0x4ede('0x6b')]];if(_0x61c788){logger['debug'](_0x4ede('0x74'),_0x61c788['name']);this[_0x4ede('0x16')]['queues'][_0x61c788[_0x4ede('0x5b')]]={'summaryEvent':_0x370696};this[_0x4ede('0x16')][_0x4ede('0x6f')]+=0x1;return ami[_0x4ede('0x3f')]({'action':_0x4ede('0x63'),'queue':_0x61c788[_0x4ede('0x5b')]})['then'](function(_0xe5c732){if(!_0x15adab[_0x4ede('0x16')][_0x4ede('0x63')][_0x370696['actionid']]){_0x15adab[_0x4ede('0x16')][_0x4ede('0x63')][_0x370696['actionid']]={};}_0x15adab[_0x4ede('0x16')][_0x4ede('0x63')][_0x370696[_0x4ede('0x71')]][_0xe5c732[_0x4ede('0x71')]]={'queue':_0x61c788[_0x4ede('0x5b')],'agents':[]};})[_0x4ede('0x42')](function(_0x448f75){throw _0x448f75;});}}}catch(_0x870fb8){logger['error']('[voiceQueueReport][queuesummary]',util[_0x4ede('0x45')](_0x870fb8,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x4ede('0x1c')]=function(_0x3869c0){if(this[_0x4ede('0x16')][_0x4ede('0x6f')]>0x0){this['summary']['completeEvent']=_0x3869c0;return;}logger[_0x4ede('0x53')](_0x4ede('0x75'),util['inspect'](_0x3869c0,{'showHidden':![],'depth':null}));this[_0x4ede('0x16')]=initializeSummary();ami['emit']('custom:queuesummarycomplete',{});};VoiceQueueReport[_0x4ede('0xd')][_0x4ede('0x20')]=function(_0x8fbfee){try{if(this[_0x4ede('0x5d')](_0x8fbfee)){logger[_0x4ede('0x53')]('[%s][voiceQueueReport][queuecallerjoin]',_0x8fbfee[_0x4ede('0x4f')],util['inspect'](_0x8fbfee,{'showHidden':![],'depth':null}));if(_[_0x4ede('0x5e')](this['queueReports'][_0x8fbfee['uniqueid']])){this[_0x4ede('0x46')][_0x8fbfee[_0x4ede('0x4f')]]=[];}if(_[_0x4ede('0x5e')](this[_0x4ede('0x12')][_0x8fbfee[_0x4ede('0x4f')]])){this[_0x4ede('0x12')][_0x8fbfee[_0x4ede('0x4f')]]={};}var _0x4efe54=new QueueReport();_0x4efe54['queue']=_0x8fbfee['queue'];_0x4efe54['type']=this[_0x4ede('0x14')][_0x4efe54[_0x4ede('0x6b')]]&&this[_0x4ede('0x14')][_0x4efe54[_0x4ede('0x6b')]]['type']?this[_0x4ede('0x14')][_0x4efe54[_0x4ede('0x6b')]]['type']||'inbound':_0x4ede('0x6c');_0x4efe54[_0x4ede('0x76')]=moment()[_0x4ede('0x50')](_0x4ede('0x77'));_0x4efe54['position']=_0x8fbfee[_0x4ede('0x78')];_0x4efe54[_0x4ede('0x79')]=_0x8fbfee[_0x4ede('0x79')];_0x4efe54[_0x4ede('0x4f')]=_0x8fbfee[_0x4ede('0x4f')];_0x4efe54[_0x4ede('0x7a')]=this[_0x4ede('0x12')][_0x8fbfee[_0x4ede('0x4f')]][_0x4ede('0x7a')];logger['info']('[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s',_0x4efe54[_0x4ede('0x6b')],_0x4efe54[_0x4ede('0x5a')]);Object[_0x4ede('0x69')](_0x4efe54,_[_0x4ede('0x7b')](_0x8fbfee,_[_0x4ede('0x7c')](_0x4efe54)));this[_0x4ede('0x46')][_0x8fbfee[_0x4ede('0x4f')]][_0x4ede('0x72')](_0x4efe54);this[_0x4ede('0x12')][_0x8fbfee['uniqueid']]=_0x4efe54;this['emitVoiceQueueChannelSave'](_0x4efe54,_0x4ede('0x7d'));}}catch(_0xeac351){logger[_0x4ede('0x44')](_0x4ede('0x7e'),_0x8fbfee[_0x4ede('0x4f')],util[_0x4ede('0x45')](_0xeac351,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x4ede('0xd')][_0x4ede('0x21')]=function(_0x2b1cca){try{if(this[_0x4ede('0x5d')](_0x2b1cca)){logger[_0x4ede('0x53')](_0x4ede('0x7f'),_0x2b1cca[_0x4ede('0x4f')],util[_0x4ede('0x45')](_0x2b1cca,{'showHidden':![],'depth':null}));if(this[_0x4ede('0x46')][_0x2b1cca[_0x4ede('0x4f')]]){var _0x1a38ed=_[_0x4ede('0x80')](this['queueReports'][_0x2b1cca[_0x4ede('0x4f')]]);_0x1a38ed['queuecallercomplete']=![];_0x1a38ed['queuecallercompleteAt']=null;_0x1a38ed[_0x4ede('0x81')]=_0x2b1cca['holdtime'];_0x1a38ed[_0x4ede('0x82')]=_0x2b1cca[_0x4ede('0x82')];_0x1a38ed[_0x4ede('0x83')]=!![];_0x1a38ed[_0x4ede('0x84')]=moment()[_0x4ede('0x50')](_0x4ede('0x77'));_0x1a38ed[_0x4ede('0x55')]=_0x4ede('0x85');_0x1a38ed['lastAssignedTo']=null;logger[_0x4ede('0x86')]('[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s',_0x1a38ed[_0x4ede('0x6b')],_0x1a38ed[_0x4ede('0x5a')]);this[_0x4ede('0x12')][_0x2b1cca[_0x4ede('0x4f')]]=_0x1a38ed;this[_0x4ede('0x87')](_0x1a38ed,_0x4ede('0x83'));}}}catch(_0x4828e8){logger[_0x4ede('0x44')]('[%s][voiceQueueReport][queuecallerabandon]',_0x2b1cca[_0x4ede('0x4f')],util[_0x4ede('0x45')](_0x4828e8,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x4ede('0xd')]['syncQueueCallerLeave']=function(_0x3399a5){try{if(this[_0x4ede('0x5d')](_0x3399a5)){logger['debug'](_0x4ede('0x88'),_0x3399a5[_0x4ede('0x4f')],util[_0x4ede('0x45')](_0x3399a5,{'showHidden':![],'depth':null}));if(this[_0x4ede('0x46')][_0x3399a5[_0x4ede('0x4f')]]){var _0x507c47=_[_0x4ede('0x80')](this['queueReports'][_0x3399a5['uniqueid']]);_0x507c47['queuecallerleaveAt']=moment()[_0x4ede('0x50')]('YYYY-MM-DD\x20HH:mm:ss');_0x507c47[_0x4ede('0x89')]=_0x3399a5['connectedlinenum'];_0x507c47[_0x4ede('0x8a')]=_0x3399a5[_0x4ede('0x8a')];logger[_0x4ede('0x86')](_0x4ede('0x8b'),_0x507c47['queue'],_0x507c47[_0x4ede('0x5a')],_0x3399a5['connectedlinenum'],_0x3399a5['connectedlinename']);this['channels'][_0x3399a5['uniqueid']]=_0x507c47;this[_0x4ede('0x8c')](_0x507c47,'queuecallerleave');}}}catch(_0x1644b1){logger[_0x4ede('0x44')](_0x4ede('0x88'),_0x3399a5[_0x4ede('0x4f')],util[_0x4ede('0x45')](_0x1644b1,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x4ede('0xd')][_0x4ede('0x26')]=function(_0xcc2a25){try{if(this[_0x4ede('0x5d')](_0xcc2a25)){logger[_0x4ede('0x53')](_0x4ede('0x8d'),_0xcc2a25[_0x4ede('0x4f')],util['inspect'](_0xcc2a25,{'showHidden':![],'depth':null}));if(this['queueReports'][_0xcc2a25['uniqueid']]){var _0x2599a0=_[_0x4ede('0x80')](this['queueReports'][_0xcc2a25[_0x4ede('0x4f')]]);_0x2599a0[_0x4ede('0x3b')]=!![];_0x2599a0[_0x4ede('0x55')]=_0x4ede('0x8e');logger[_0x4ede('0x86')](_0x4ede('0x8f'),_0x2599a0['queue'],_0x2599a0[_0x4ede('0x5a')]);}}}catch(_0x100e90){logger[_0x4ede('0x44')]('[%s][voiceQueueReport][agentconnect]',_0xcc2a25[_0x4ede('0x4f')],util[_0x4ede('0x45')](_0x100e90,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x4ede('0xd')]['syncAgentComplete']=function(_0x441972){try{if(this[_0x4ede('0x5d')](_0x441972)){logger['debug'](_0x4ede('0x90'),_0x441972[_0x4ede('0x4f')],util[_0x4ede('0x45')](_0x441972,{'showHidden':![],'depth':null}));if(this[_0x4ede('0x46')][_0x441972[_0x4ede('0x4f')]]){var _0x48a8e3=_[_0x4ede('0x80')](this['queueReports'][_0x441972[_0x4ede('0x4f')]]);_0x48a8e3['queuecallerabandon']=![];_0x48a8e3[_0x4ede('0x84')]=null;_0x48a8e3['assigned']=!![];_0x48a8e3[_0x4ede('0x91')]=_0x441972[_0x4ede('0x92')];_0x48a8e3[_0x4ede('0x81')]=_0x441972[_0x4ede('0x81')];_0x48a8e3['queuecallercomplete']=!![];_0x48a8e3['queuecallerexit']=![];_0x48a8e3['queuecallerexitAt']=null;if(!_0x48a8e3['transfer']){if(_0x441972['reason']==_0x4ede('0x93')){_0x48a8e3[_0x4ede('0x55')]=_0x4ede('0x94');logger[_0x4ede('0x86')](_0x4ede('0x95'),_0x48a8e3['queue'],_0x48a8e3['type']);}else{if(_[_0x4ede('0x96')](_0x441972[_0x4ede('0x41')]['toLowerCase'](),'local/')){if(this[_0x4ede('0x46')][_0x441972[_0x4ede('0x97')]]){var _0x471d69=_['last'](this[_0x4ede('0x46')][_0x441972[_0x4ede('0x97')]]);_0x471d69[_0x4ede('0x3b')]=![];_0x471d69[_0x4ede('0x98')]=!![];_0x471d69[_0x4ede('0x99')]=moment(_0x48a8e3[_0x4ede('0x76')])[_0x4ede('0x9a')](_0x441972[_0x4ede('0x81')],_0x4ede('0x9b'))[_0x4ede('0x50')](_0x4ede('0x77'));_0x471d69[_0x4ede('0x55')]='FORWARDTRANSFER';_0x471d69[_0x4ede('0x93')]=!![];_0x471d69['transfertype']=_0x4ede('0x9c');_0x471d69[_0x4ede('0x9d')]=_0x441972[_0x4ede('0x9e')];_0x471d69['transferuniqueid']=_0x441972['uniqueid'];logger[_0x4ede('0x86')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER',_0x471d69[_0x4ede('0x6b')],_0x471d69[_0x4ede('0x5a')]);var _0x463bf5=this[_0x4ede('0x46')][_0x441972[_0x4ede('0x97')]];this[_0x4ede('0x46')][_0x441972[_0x4ede('0x97')]]=this['queueReports'][_0x441972[_0x4ede('0x4f')]];this[_0x4ede('0x46')][_0x441972[_0x4ede('0x4f')]]=_0x463bf5;}}else{_0x48a8e3['queuecallerexitreason']=_0x4ede('0x9f')+_0x441972['reason'][_0x4ede('0xa0')]();logger[_0x4ede('0x86')](_0x4ede('0xa1'),_0x48a8e3[_0x4ede('0x6b')],_0x48a8e3[_0x4ede('0x5a')],_0x48a8e3[_0x4ede('0x55')]);}}}this[_0x4ede('0x12')][_0x441972[_0x4ede('0x4f')]]=_0x48a8e3;}}}catch(_0x427370){logger['error'](_0x4ede('0x90'),_0x441972[_0x4ede('0x4f')],util[_0x4ede('0x45')](_0x427370,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x4ede('0xd')][_0x4ede('0x28')]=function(_0x71c4f1){try{if(this['isNotNull'](_0x71c4f1)){logger[_0x4ede('0x53')](_0x4ede('0xa2'),_0x71c4f1['uniqueid'],util[_0x4ede('0x45')](_0x71c4f1,{'showHidden':![],'depth':null}));this[_0x4ede('0xa3')](_0x71c4f1[_0x4ede('0x4f')],_[_0x4ede('0x7c')](_0x71c4f1[_0x4ede('0xa4')])[0x0],_0x71c4f1['value']);if(this[_0x4ede('0x46')][_0x71c4f1[_0x4ede('0x4f')]]){var _0x707d08=_[_0x4ede('0x80')](this[_0x4ede('0x46')][_0x71c4f1['uniqueid']]);if(_0x707d08){if(this[_0x4ede('0x5d')](_0x71c4f1['variable'])&&this[_0x4ede('0x5d')](_0x71c4f1[_0x4ede('0xa4')][_0x4ede('0x63')])){switch(_0x71c4f1[_0x4ede('0xa5')]){case _0x4ede('0xa6'):_0x707d08[_0x4ede('0x98')]=![];_0x707d08[_0x4ede('0x99')]=null;break;case _0x4ede('0xa7'):_0x707d08[_0x4ede('0xa8')]=_0x4ede('0xa9');_0x707d08[_0x4ede('0x98')]=!![];_0x707d08[_0x4ede('0x99')]=moment()[_0x4ede('0x50')](_0x4ede('0x77'));_0x707d08[_0x4ede('0xaa')]=moment()['format'](_0x4ede('0x77'));logger['debug'](_0x4ede('0xab'),_0x71c4f1[_0x4ede('0x4f')],util[_0x4ede('0x45')](_0x707d08,{'showHidden':![],'depth':null}));ami[_0x4ede('0x4c')](_0x4ede('0xac'),_0x707d08);break;default:_0x707d08['queuecallerexit']=!![];_0x707d08[_0x4ede('0x99')]=moment()['format'](_0x4ede('0x77'));_0x707d08[_0x4ede('0xaa')]=moment()[_0x4ede('0x50')](_0x4ede('0x77'));}_0x707d08[_0x4ede('0x83')]=![];_0x707d08[_0x4ede('0x84')]=null;_0x707d08[_0x4ede('0x55')]=_0x71c4f1[_0x4ede('0xa5')];this[_0x4ede('0x12')][_0x71c4f1[_0x4ede('0x4f')]]=_0x707d08;this[_0x4ede('0x87')](_0x707d08,_0x4ede('0x27'));}else if(this[_0x4ede('0x5d')](_0x71c4f1[_0x4ede('0xa4')])&&this[_0x4ede('0x5d')](_0x71c4f1[_0x4ede('0xa4')][_0x4ede('0xad')])){if(!_0x707d08[_0x4ede('0x83')]){_0x707d08[_0x4ede('0x98')]=!![];_0x707d08[_0x4ede('0x99')]=moment()[_0x4ede('0x50')](_0x4ede('0x77'));_0x707d08[_0x4ede('0x55')]=_0x4ede('0xae');_0x707d08[_0x4ede('0xaa')]=moment()[_0x4ede('0x50')](_0x4ede('0x77'));this['channels'][_0x71c4f1[_0x4ede('0x4f')]]=_0x707d08;}}logger[_0x4ede('0x86')](_0x4ede('0xaf'),_0x71c4f1[_0x4ede('0x4f')],_0x707d08[_0x4ede('0x6b')],_0x707d08[_0x4ede('0x5a')],_[_0x4ede('0x7c')](_0x71c4f1['variable'])[0x0],_0x71c4f1[_0x4ede('0xa5')]);_0x707d08['variables']=this[_0x4ede('0x17')][_0x71c4f1['uniqueid']];}}}}catch(_0xff71eb){logger[_0x4ede('0x44')](_0x4ede('0xa2'),_0x71c4f1[_0x4ede('0x4f')],util[_0x4ede('0x45')](_0xff71eb,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x4ede('0xd')]['addVariable']=function(_0x68ec49,_0x3539ef,_0xa54937){var _0x31065a=[_0x4ede('0xb0'),_0x4ede('0xb1'),_0x4ede('0xb2'),_0x4ede('0xb3'),_0x4ede('0xb4'),_0x4ede('0xb5'),_0x4ede('0xb6'),_0x4ede('0xb7'),_0x4ede('0xb8'),'sipuri','bridgepeer',_0x4ede('0xb9'),'membercalls','memberdynamic','memberinterface',_0x4ede('0xba'),_0x4ede('0x92'),_0x4ede('0xbb'),_0x4ede('0xbc')];if(!_[_0x4ede('0x3e')](_0x3539ef)&&!_[_0x4ede('0xbd')](_0x31065a,_0x3539ef)){if(_[_0x4ede('0x5e')](this[_0x4ede('0x17')][_0x68ec49])){this[_0x4ede('0x17')][_0x68ec49]={};}this['variables'][_0x68ec49][_0x3539ef]=_0xa54937;}};VoiceQueueReport['prototype'][_0x4ede('0xbe')]=function(_0x351946,_0x5cff03,_0x246f8e){try{var _0x4b6973={};if(this[_0x4ede('0x46')][_0x351946]){for(var _0xb32aa1=0x0;_0xb32aa10x0?!![]:![];if(!_0x15261d){return this[_0xbd01('0x19')](this[_0xbd01('0x46')]['completeEvent']);}};VoiceQueueReport[_0xbd01('0x3a')]['syncQueueMember']=function(_0x693d99){var _0x1e0dbf=this[_0xbd01('0x46')]['id'];if(this[_0xbd01('0x46')][_0xbd01('0x63')][_0x1e0dbf]&&this[_0xbd01('0x46')]['queuestatus'][_0x1e0dbf][_0x693d99[_0xbd01('0x62')]]){this[_0xbd01('0x46')][_0xbd01('0x63')][_0x1e0dbf][_0x693d99[_0xbd01('0x62')]]['agents'][_0xbd01('0x6c')](_0x693d99);}};VoiceQueueReport[_0xbd01('0x3a')]['syncQueueSummary']=function(_0x57d1be){var _0x4d7549=this;try{if(this[_0xbd01('0x5e')](_0x57d1be)&&this[_0xbd01('0x5e')](_0x57d1be[_0xbd01('0x4f')])){logger[_0xbd01('0x52')]('[voiceQueueReport][queuesummary]\x20event:',util[_0xbd01('0x43')](_0x57d1be,{'showHidden':![],'depth':null}));var _0x2e3dff=this[_0xbd01('0x13')][_0x57d1be['queue']];if(_0x2e3dff){logger[_0xbd01('0x52')]('[voiceQueueReport][queuesummary]\x20name:%s',_0x2e3dff[_0xbd01('0x5c')]);this[_0xbd01('0x46')][_0xbd01('0x5f')][_0x2e3dff[_0xbd01('0x5c')]]={'summaryEvent':_0x57d1be};this[_0xbd01('0x46')]['statusRequests']+=0x1;return ami['Action']({'action':_0xbd01('0x63'),'queue':_0x2e3dff[_0xbd01('0x5c')]})[_0xbd01('0x6d')](function(_0x107249){if(!_0x4d7549[_0xbd01('0x46')][_0xbd01('0x63')][_0x57d1be[_0xbd01('0x62')]]){_0x4d7549[_0xbd01('0x46')][_0xbd01('0x63')][_0x57d1be[_0xbd01('0x62')]]={};}_0x4d7549[_0xbd01('0x46')][_0xbd01('0x63')][_0x57d1be[_0xbd01('0x62')]][_0x107249[_0xbd01('0x62')]]={'queue':_0x2e3dff[_0xbd01('0x5c')],'agents':[]};})[_0xbd01('0x60')](function(_0x9719ff){throw _0x9719ff;});}}}catch(_0x541b46){logger[_0xbd01('0x41')](_0xbd01('0x6e'),util[_0xbd01('0x43')](_0x541b46,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xbd01('0x3a')][_0xbd01('0x19')]=function(_0x3c6db2){if(this['summary'][_0xbd01('0x6b')]>0x0){this[_0xbd01('0x46')][_0xbd01('0x6f')]=_0x3c6db2;return;}logger['debug'](_0xbd01('0x70'),util[_0xbd01('0x43')](_0x3c6db2,{'showHidden':![],'depth':null}));this[_0xbd01('0x46')]=initializeSummary();ami[_0xbd01('0x4a')]('custom:queuesummarycomplete',{});};VoiceQueueReport[_0xbd01('0x3a')][_0xbd01('0x1e')]=function(_0x52f9f9){try{if(this[_0xbd01('0x5e')](_0x52f9f9)){logger[_0xbd01('0x52')](_0xbd01('0x71'),_0x52f9f9['uniqueid'],util[_0xbd01('0x43')](_0x52f9f9,{'showHidden':![],'depth':null}));if(_[_0xbd01('0x72')](this[_0xbd01('0x44')][_0x52f9f9[_0xbd01('0x4c')]])){this[_0xbd01('0x44')][_0x52f9f9[_0xbd01('0x4c')]]=[];}if(_['isUndefined'](this['channels'][_0x52f9f9[_0xbd01('0x4c')]])){this[_0xbd01('0x3c')][_0x52f9f9[_0xbd01('0x4c')]]={};}var _0x2660a2=new QueueReport();_0x2660a2[_0xbd01('0x4f')]=_0x52f9f9['queue'];_0x2660a2['type']=this[_0xbd01('0x13')][_0x2660a2[_0xbd01('0x4f')]]&&this['voiceQueues'][_0x2660a2[_0xbd01('0x4f')]][_0xbd01('0x59')]?this[_0xbd01('0x13')][_0x2660a2[_0xbd01('0x4f')]][_0xbd01('0x59')]||_0xbd01('0x5a'):_0xbd01('0x5a');_0x2660a2[_0xbd01('0x73')]=moment()[_0xbd01('0x4d')](_0xbd01('0x74'));_0x2660a2[_0xbd01('0x75')]=_0x52f9f9[_0xbd01('0x75')];_0x2660a2[_0xbd01('0x76')]=_0x52f9f9[_0xbd01('0x76')];_0x2660a2[_0xbd01('0x4c')]=_0x52f9f9[_0xbd01('0x4c')];_0x2660a2[_0xbd01('0x77')]=this[_0xbd01('0x3c')][_0x52f9f9[_0xbd01('0x4c')]][_0xbd01('0x77')];logger[_0xbd01('0x78')](_0xbd01('0x79'),_0x2660a2[_0xbd01('0x4f')],_0x2660a2[_0xbd01('0x59')]);Object['assign'](_0x2660a2,_[_0xbd01('0x7a')](_0x52f9f9,_['keys'](_0x2660a2)));this[_0xbd01('0x44')][_0x52f9f9[_0xbd01('0x4c')]]['push'](_0x2660a2);this[_0xbd01('0x3c')][_0x52f9f9[_0xbd01('0x4c')]]=_0x2660a2;this['emitVoiceQueueChannelSave'](_0x2660a2,_0xbd01('0x7b'));}}catch(_0x1eb9d1){logger['error'](_0xbd01('0x71'),_0x52f9f9[_0xbd01('0x4c')],util[_0xbd01('0x43')](_0x1eb9d1,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xbd01('0x3a')]['syncQueueCallerAbandon']=function(_0x12f065){try{if(this[_0xbd01('0x5e')](_0x12f065)){logger[_0xbd01('0x52')](_0xbd01('0x7c'),_0x12f065[_0xbd01('0x4c')],util['inspect'](_0x12f065,{'showHidden':![],'depth':null}));if(this[_0xbd01('0x44')][_0x12f065[_0xbd01('0x4c')]]){var _0x2931f9=_['last'](this[_0xbd01('0x44')][_0x12f065['uniqueid']]);_0x2931f9[_0xbd01('0x39')]=![];_0x2931f9[_0xbd01('0x7d')]=null;_0x2931f9[_0xbd01('0x7e')]=_0x12f065['holdtime'];_0x2931f9[_0xbd01('0x7f')]=_0x12f065[_0xbd01('0x7f')];_0x2931f9['queuecallerabandon']=!![];_0x2931f9[_0xbd01('0x80')]=moment()[_0xbd01('0x4d')](_0xbd01('0x74'));_0x2931f9[_0xbd01('0x81')]=_0xbd01('0x82');_0x2931f9[_0xbd01('0x83')]=null;logger[_0xbd01('0x78')](_0xbd01('0x84'),_0x2931f9[_0xbd01('0x4f')],_0x2931f9['type']);this[_0xbd01('0x3c')][_0x12f065[_0xbd01('0x4c')]]=_0x2931f9;this['emitVoiceQueueChannelRemove'](_0x2931f9,'queuecallerabandon');}}}catch(_0x2ffbc1){logger[_0xbd01('0x41')](_0xbd01('0x7c'),_0x12f065[_0xbd01('0x4c')],util[_0xbd01('0x43')](_0x2ffbc1,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xbd01('0x21')]=function(_0x50e449){try{if(this[_0xbd01('0x5e')](_0x50e449)){logger[_0xbd01('0x52')](_0xbd01('0x85'),_0x50e449[_0xbd01('0x4c')],util['inspect'](_0x50e449,{'showHidden':![],'depth':null}));if(this[_0xbd01('0x44')][_0x50e449['uniqueid']]){var _0x4636b4=_['last'](this[_0xbd01('0x44')][_0x50e449[_0xbd01('0x4c')]]);_0x4636b4[_0xbd01('0x86')]=moment()[_0xbd01('0x4d')](_0xbd01('0x74'));_0x4636b4[_0xbd01('0x87')]=_0x50e449['connectedlinenum'];_0x4636b4[_0xbd01('0x88')]=_0x50e449[_0xbd01('0x88')];logger[_0xbd01('0x78')](_0xbd01('0x89'),_0x4636b4[_0xbd01('0x4f')],_0x4636b4[_0xbd01('0x59')],_0x50e449[_0xbd01('0x87')],_0x50e449[_0xbd01('0x88')]);this[_0xbd01('0x3c')][_0x50e449[_0xbd01('0x4c')]]=_0x4636b4;this['emitVoiceQueueChannelSave'](_0x4636b4,'queuecallerleave');}}}catch(_0x4eb1a3){logger[_0xbd01('0x41')](_0xbd01('0x85'),_0x50e449[_0xbd01('0x4c')],util['inspect'](_0x4eb1a3,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xbd01('0x3a')][_0xbd01('0x23')]=function(_0x2ee119){try{if(this[_0xbd01('0x5e')](_0x2ee119)){logger[_0xbd01('0x52')](_0xbd01('0x8a'),_0x2ee119[_0xbd01('0x4c')],util[_0xbd01('0x43')](_0x2ee119,{'showHidden':![],'depth':null}));if(this[_0xbd01('0x44')][_0x2ee119['uniqueid']]){var _0x5289ac=_[_0xbd01('0x8b')](this[_0xbd01('0x44')][_0x2ee119['uniqueid']]);_0x5289ac[_0xbd01('0x39')]=!![];_0x5289ac[_0xbd01('0x81')]='COMPLETEDBYAGENT';logger[_0xbd01('0x78')]('[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT',_0x5289ac[_0xbd01('0x4f')],_0x5289ac['type']);}}}catch(_0x11b02e){logger[_0xbd01('0x41')](_0xbd01('0x8a'),_0x2ee119[_0xbd01('0x4c')],util[_0xbd01('0x43')](_0x11b02e,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xbd01('0x3a')]['syncAgentComplete']=function(_0x5d544a){try{if(this[_0xbd01('0x5e')](_0x5d544a)){logger['debug'](_0xbd01('0x8c'),_0x5d544a[_0xbd01('0x4c')],util[_0xbd01('0x43')](_0x5d544a,{'showHidden':![],'depth':null}));if(this[_0xbd01('0x44')][_0x5d544a[_0xbd01('0x4c')]]){var _0x3e352f=_[_0xbd01('0x8b')](this[_0xbd01('0x44')][_0x5d544a[_0xbd01('0x4c')]]);_0x3e352f['queuecallerabandon']=![];_0x3e352f['queuecallerabandonAt']=null;_0x3e352f[_0xbd01('0x8d')]=!![];_0x3e352f[_0xbd01('0x83')]=_0x5d544a[_0xbd01('0x8e')];_0x3e352f[_0xbd01('0x7e')]=_0x5d544a[_0xbd01('0x7e')];_0x3e352f[_0xbd01('0x39')]=!![];_0x3e352f['queuecallerexit']=![];_0x3e352f[_0xbd01('0x8f')]=null;if(!_0x3e352f[_0xbd01('0x90')]){if(_0x5d544a['reason']==_0xbd01('0x90')){_0x3e352f['queuecallerexitreason']=_0xbd01('0x91');logger[_0xbd01('0x78')](_0xbd01('0x92'),_0x3e352f[_0xbd01('0x4f')],_0x3e352f[_0xbd01('0x59')]);}else{if(_[_0xbd01('0x93')](_0x5d544a[_0xbd01('0x3f')][_0xbd01('0x94')](),_0xbd01('0x95'))){if(this[_0xbd01('0x44')][_0x5d544a[_0xbd01('0x96')]]){var _0x1d732a=_['last'](this[_0xbd01('0x44')][_0x5d544a[_0xbd01('0x96')]]);_0x1d732a[_0xbd01('0x39')]=![];_0x1d732a[_0xbd01('0x97')]=!![];_0x1d732a['queuecallerexitAt']=moment(_0x3e352f['queuecallerjoinAt'])[_0xbd01('0x98')](_0x5d544a[_0xbd01('0x7e')],_0xbd01('0x99'))[_0xbd01('0x4d')](_0xbd01('0x74'));_0x1d732a['queuecallerexitreason']=_0xbd01('0x9a');_0x1d732a[_0xbd01('0x90')]=!![];_0x1d732a[_0xbd01('0x9b')]=_0xbd01('0x9c');_0x1d732a[_0xbd01('0x9d')]=_0x5d544a[_0xbd01('0x9e')];_0x1d732a['transferuniqueid']=_0x5d544a[_0xbd01('0x4c')];logger['info'](_0xbd01('0x9f'),_0x1d732a['queue'],_0x1d732a[_0xbd01('0x59')]);var _0x4ca86e=this[_0xbd01('0x44')][_0x5d544a[_0xbd01('0x96')]];this['queueReports'][_0x5d544a[_0xbd01('0x96')]]=this['queueReports'][_0x5d544a[_0xbd01('0x4c')]];this['queueReports'][_0x5d544a[_0xbd01('0x4c')]]=_0x4ca86e;}}else{_0x3e352f[_0xbd01('0x81')]=_0xbd01('0xa0')+_0x5d544a[_0xbd01('0xa1')][_0xbd01('0xa2')]();logger[_0xbd01('0x78')](_0xbd01('0xa3'),_0x3e352f[_0xbd01('0x4f')],_0x3e352f[_0xbd01('0x59')],_0x3e352f[_0xbd01('0x81')]);}}}this[_0xbd01('0x3c')][_0x5d544a[_0xbd01('0x4c')]]=_0x3e352f;}}}catch(_0x48d265){logger['error'](_0xbd01('0x8c'),_0x5d544a[_0xbd01('0x4c')],util[_0xbd01('0x43')](_0x48d265,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncVarSet']=function(_0x319a0b){try{if(this[_0xbd01('0x5e')](_0x319a0b)){logger['debug']('[%s][voiceQueueReport][varset]',_0x319a0b[_0xbd01('0x4c')],util[_0xbd01('0x43')](_0x319a0b,{'showHidden':![],'depth':null}));this[_0xbd01('0xa4')](_0x319a0b[_0xbd01('0x4c')],_[_0xbd01('0xa5')](_0x319a0b['variable'])[0x0],_0x319a0b[_0xbd01('0xa6')]);if(this[_0xbd01('0x44')][_0x319a0b[_0xbd01('0x4c')]]){var _0x18b3be=_[_0xbd01('0x8b')](this['queueReports'][_0x319a0b[_0xbd01('0x4c')]]);if(_0x18b3be){if(this['isNotNull'](_0x319a0b[_0xbd01('0xa7')])&&this[_0xbd01('0x5e')](_0x319a0b[_0xbd01('0xa7')][_0xbd01('0x63')])){switch(_0x319a0b[_0xbd01('0xa6')]){case _0xbd01('0xa8'):_0x18b3be[_0xbd01('0x97')]=![];_0x18b3be['queuecallerexitAt']=null;break;case _0xbd01('0xa9'):_0x18b3be[_0xbd01('0xaa')]='timeout';_0x18b3be['queuecallerexit']=!![];_0x18b3be[_0xbd01('0x8f')]=moment()[_0xbd01('0x4d')](_0xbd01('0x74'));_0x18b3be[_0xbd01('0x86')]=moment()[_0xbd01('0x4d')](_0xbd01('0x74'));logger[_0xbd01('0x52')](_0xbd01('0xab'),_0x319a0b[_0xbd01('0x4c')],util[_0xbd01('0x43')](_0x18b3be,{'showHidden':![],'depth':null}));ami[_0xbd01('0x4a')](_0xbd01('0xac'),_0x18b3be);break;default:_0x18b3be['queuecallerexit']=!![];_0x18b3be[_0xbd01('0x8f')]=moment()[_0xbd01('0x4d')]('YYYY-MM-DD\x20HH:mm:ss');_0x18b3be[_0xbd01('0x86')]=moment()[_0xbd01('0x4d')](_0xbd01('0x74'));}_0x18b3be[_0xbd01('0x1f')]=![];_0x18b3be[_0xbd01('0x80')]=null;_0x18b3be[_0xbd01('0x81')]=_0x319a0b[_0xbd01('0xa6')];this[_0xbd01('0x3c')][_0x319a0b[_0xbd01('0x4c')]]=_0x18b3be;this[_0xbd01('0x48')](_0x18b3be,_0xbd01('0x24'));}else if(this['isNotNull'](_0x319a0b[_0xbd01('0xa7')])&&this[_0xbd01('0x5e')](_0x319a0b[_0xbd01('0xa7')][_0xbd01('0xad')])){if(!_0x18b3be[_0xbd01('0x1f')]){_0x18b3be[_0xbd01('0x97')]=!![];_0x18b3be[_0xbd01('0x8f')]=moment()[_0xbd01('0x4d')](_0xbd01('0x74'));_0x18b3be['queuecallerexitreason']='EXITWITHKEY';_0x18b3be[_0xbd01('0x86')]=moment()['format'](_0xbd01('0x74'));this[_0xbd01('0x3c')][_0x319a0b[_0xbd01('0x4c')]]=_0x18b3be;}}logger[_0xbd01('0x78')](_0xbd01('0xae'),_0x319a0b[_0xbd01('0x4c')],_0x18b3be[_0xbd01('0x4f')],_0x18b3be[_0xbd01('0x59')],_[_0xbd01('0xa5')](_0x319a0b[_0xbd01('0xa7')])[0x0],_0x319a0b[_0xbd01('0xa6')]);_0x18b3be[_0xbd01('0x14')]=this['variables'][_0x319a0b[_0xbd01('0x4c')]];}}}}catch(_0x20caac){logger['error'](_0xbd01('0xaf'),_0x319a0b[_0xbd01('0x4c')],util[_0xbd01('0x43')](_0x20caac,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xbd01('0xa4')]=function(_0xffd192,_0x4dc492,_0x5dd509){var _0x109dba=[_0xbd01('0xb0'),'rtpaudioqosbridged',_0xbd01('0xb1'),_0xbd01('0xb2'),_0xbd01('0xb3'),'rtpaudioqoslossbridged',_0xbd01('0xb4'),_0xbd01('0xb5'),_0xbd01('0xb6'),_0xbd01('0xb7'),'bridgepeer',_0xbd01('0xb8'),_0xbd01('0xb9'),'memberdynamic',_0xbd01('0xba'),_0xbd01('0xbb'),_0xbd01('0x8e'),'memberpenalty',_0xbd01('0xbc')];if(!_[_0xbd01('0xbd')](_0x4dc492)&&!_[_0xbd01('0xbe')](_0x109dba,_0x4dc492)){if(_[_0xbd01('0x72')](this['variables'][_0xffd192])){this[_0xbd01('0x14')][_0xffd192]={};}this[_0xbd01('0x14')][_0xffd192][_0x4dc492]=_0x5dd509;}};VoiceQueueReport[_0xbd01('0x3a')][_0xbd01('0xbf')]=function(_0x204366,_0x5e3758,_0x3a624c){try{var _0x1320ef={};if(this[_0xbd01('0x44')][_0x204366]){for(var _0x5e90ba=0x0;_0x5e90ba=0x0?moment(_0x5cf647['endtime'])['diff'](_0x5cf647[_0xa6f2('0x17')],_0xa6f2('0xe')):null,'data1':_0xa6f2('0x18'),'data2':_0x5cf647['accountcode'],'data3':_0x5cf647['exten'],'data4':_0x5cf647['dialstring']||null,'role':_0xa6f2('0x11'),'internal':_0x5cf647[_0xa6f2('0x12')]?_[_0xa6f2('0x13')](_0x5cf647['accountcode']):undefined,'uniqueid':_0x5cf647[_0xa6f2('0x14')]},'log':'CreateMemberReport'});}; \ No newline at end of file +var _0x7559=['voiceQueueReport','queuecallercompleteAt','queuecallerexitAt','Request','CreateMemberReport','voice','lastAssignedTo','isNil','interface','SIP/%s','TALKING','queuecallerleaveAt','diff','exten','queue','accountcode','toNumber','uniqueid','voiceDialReport','membername','starttime','endtime','seconds','outbound','moment','lodash','util','../client'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7559,0xc0));var _0x9755=function(_0x301ad1,_0x2e4023){_0x301ad1=_0x301ad1-0x0;var _0x39e0e2=_0x7559[_0x301ad1];return _0x39e0e2;};'use strict';var moment=require(_0x9755('0x0'));var _=require(_0x9755('0x1'));var util=require(_0x9755('0x2'));var client=require(_0x9755('0x3'));exports[_0x9755('0x4')]=function(_0x33ccc5){var _0x129c9c=_0x33ccc5[_0x9755('0x5')]||_0x33ccc5[_0x9755('0x6')];return client[_0x9755('0x7')](_0x9755('0x8'),{'body':{'channel':_0x9755('0x9'),'membername':_0x33ccc5[_0x9755('0xa')],'interface':_[_0x9755('0xb')](_0x33ccc5[_0x9755('0xc')])?util['format'](_0x9755('0xd'),_0x33ccc5[_0x9755('0xa')]):_0x33ccc5[_0x9755('0xc')],'type':_0x9755('0xe'),'enterAt':_0x33ccc5[_0x9755('0xf')],'exitAt':_0x129c9c,'duration':moment(_0x129c9c)[_0x9755('0x10')](_0x33ccc5[_0x9755('0xf')],'seconds'),'data1':'inbound','data2':_0x33ccc5['calleridnum'],'data3':_0x33ccc5[_0x9755('0x11')],'data4':null,'data5':_0x33ccc5[_0x9755('0x12')],'role':'agent','internal':_0x33ccc5[_0x9755('0x13')]?_[_0x9755('0x14')](_0x33ccc5[_0x9755('0x13')]):undefined,'uniqueid':_0x33ccc5[_0x9755('0x15')]},'log':'CreateMemberReport'});};exports[_0x9755('0x16')]=function(_0x56fcd4){return client[_0x9755('0x7')](_0x9755('0x8'),{'body':{'channel':_0x9755('0x9'),'membername':_0x56fcd4[_0x9755('0x17')],'interface':_0x56fcd4[_0x9755('0xc')],'type':_0x9755('0xe'),'enterAt':_0x56fcd4[_0x9755('0x18')],'exitAt':_0x56fcd4[_0x9755('0x19')],'duration':moment(_0x56fcd4[_0x9755('0x19')])[_0x9755('0x10')](_0x56fcd4[_0x9755('0x18')],'seconds')>=0x0?moment(_0x56fcd4['endtime'])['diff'](_0x56fcd4[_0x9755('0x18')],_0x9755('0x1a')):null,'data1':_0x9755('0x1b'),'data2':_0x56fcd4['accountcode'],'data3':_0x56fcd4['exten'],'data4':_0x56fcd4['dialstring']||null,'role':'agent','internal':_0x56fcd4['accountcode']?_[_0x9755('0x14')](_0x56fcd4[_0x9755('0x13')]):undefined,'uniqueid':_0x56fcd4[_0x9755('0x15')]},'log':_0x9755('0x8')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index a41a652..afda326 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 _0x6257=['../client','Request','previewRecallmeReminderInterval','GetSettings'];(function(_0x4686f8,_0x135c71){var _0x2d4bdc=function(_0x42dd52){while(--_0x42dd52){_0x4686f8['push'](_0x4686f8['shift']());}};_0x2d4bdc(++_0x135c71);}(_0x6257,0x1d4));var _0x7625=function(_0x4b03de,_0x2f8336){_0x4b03de=_0x4b03de-0x0;var _0x2b8ea8=_0x6257[_0x4b03de];return _0x2b8ea8;};'use strict';var client=require(_0x7625('0x0'));exports['getSettings']=function(){return client[_0x7625('0x1')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':['stopRecordingOnTransfer',_0x7625('0x2')]},'log':_0x7625('0x3')});}; \ No newline at end of file +var _0xc933=['ShowSetting','stopRecordingOnTransfer','GetSettings','../client','getSettings','Request'];(function(_0x14a44e,_0xa4af45){var _0x4e7b79=function(_0x2998ca){while(--_0x2998ca){_0x14a44e['push'](_0x14a44e['shift']());}};_0x4e7b79(++_0xa4af45);}(_0xc933,0xf9));var _0x3c93=function(_0x5e1821,_0x5f2d13){_0x5e1821=_0x5e1821-0x0;var _0x3c6c2f=_0xc933[_0x5e1821];return _0x3c6c2f;};'use strict';var client=require(_0x3c93('0x0'));exports[_0x3c93('0x1')]=function(){return client[_0x3c93('0x2')](_0x3c93('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x3c93('0x4'),'previewRecallmeReminderInterval']},'log':_0x3c93('0x5')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index ab5c70c..85a2178 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 _0x37e9=['getTemplates','Request','GetTemplate','name'];(function(_0x493079,_0x3657e1){var _0x4ffb5f=function(_0x3a2263){while(--_0x3a2263){_0x493079['push'](_0x493079['shift']());}};_0x4ffb5f(++_0x3657e1);}(_0x37e9,0x1f4));var _0x937e=function(_0x4aa0c4,_0x375647){_0x4aa0c4=_0x4aa0c4-0x0;var _0x4b701b=_0x37e9[_0x4aa0c4];return _0x4b701b;};'use strict';var client=require('../client');exports[_0x937e('0x0')]=function(_0x648221){return function(_0x13ef09){return client[_0x937e('0x1')](_0x937e('0x2'),{'options':{'raw':!![],'attributes':['id',_0x937e('0x3'),'html']},'log':_0x937e('0x2')});};}; \ No newline at end of file +var _0x05bf=['html','../client','getTemplates','Request','GetTemplate','name'];(function(_0x3cf4d3,_0x48065e){var _0x4e547b=function(_0x28f85a){while(--_0x28f85a){_0x3cf4d3['push'](_0x3cf4d3['shift']());}};_0x4e547b(++_0x48065e);}(_0x05bf,0xe5));var _0xf05b=function(_0x37c3ce,_0xe10a8a){_0x37c3ce=_0x37c3ce-0x0;var _0x30d6a4=_0x05bf[_0x37c3ce];return _0x30d6a4;};'use strict';var client=require(_0xf05b('0x0'));exports[_0xf05b('0x1')]=function(_0x1a73d4){return function(_0x11ad27){return client[_0xf05b('0x2')](_0xf05b('0x3'),{'options':{'raw':!![],'attributes':['id',_0xf05b('0x4'),_0xf05b('0x5')]},'log':_0xf05b('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index 1d73cde..b150e02 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 _0x651e=['data3','data4','data6','data7','../client','getTriggers','Request','GetTrigger','name','Condition','AllConditions','field','operator','value','AnyConditions','Action','action','data1','data2'];(function(_0x5c4587,_0x37f2a4){var _0x209263=function(_0x46ba5f){while(--_0x46ba5f){_0x5c4587['push'](_0x5c4587['shift']());}};_0x209263(++_0x37f2a4);}(_0x651e,0xd5));var _0xe651=function(_0x58b167,_0x4ae4c1){_0x58b167=_0x58b167-0x0;var _0x323de9=_0x651e[_0x58b167];return _0x323de9;};'use strict';var client=require(_0xe651('0x0'));exports[_0xe651('0x1')]=function(_0x201390){return function(_0x30fd5a){return client[_0xe651('0x2')](_0xe651('0x3'),{'options':{'raw':![],'attributes':['id',_0xe651('0x4'),'channel','status'],'include':[{'model':_0xe651('0x5'),'as':_0xe651('0x6'),'attributes':['id',_0xe651('0x7'),_0xe651('0x8'),_0xe651('0x9')]},{'model':_0xe651('0x5'),'as':_0xe651('0xa'),'attributes':['id','field','operator',_0xe651('0x9')]},{'model':_0xe651('0xb'),'as':'Actions','attributes':['id',_0xe651('0xc'),_0xe651('0xd'),_0xe651('0xe'),_0xe651('0xf'),_0xe651('0x10'),'data5',_0xe651('0x11'),_0xe651('0x12')]}]},'log':'GetTrigger'});};}; \ No newline at end of file +var _0xfe76=['name','status','Condition','AllConditions','field','operator','value','AnyConditions','Actions','action','data2','data4','Request','GetTrigger'];(function(_0x31ad86,_0x2fce0e){var _0x5e3989=function(_0x5bc82c){while(--_0x5bc82c){_0x31ad86['push'](_0x31ad86['shift']());}};_0x5e3989(++_0x2fce0e);}(_0xfe76,0x14e));var _0x6fe7=function(_0x37e845,_0x219f9f){_0x37e845=_0x37e845-0x0;var _0x59e55b=_0xfe76[_0x37e845];return _0x59e55b;};'use strict';var client=require('../client');exports['getTriggers']=function(_0x2027a9){return function(_0x477f04){return client[_0x6fe7('0x0')](_0x6fe7('0x1'),{'options':{'raw':![],'attributes':['id',_0x6fe7('0x2'),'channel',_0x6fe7('0x3')],'include':[{'model':_0x6fe7('0x4'),'as':_0x6fe7('0x5'),'attributes':['id',_0x6fe7('0x6'),_0x6fe7('0x7'),_0x6fe7('0x8')]},{'model':_0x6fe7('0x4'),'as':_0x6fe7('0x9'),'attributes':['id','field','operator',_0x6fe7('0x8')]},{'model':'Action','as':_0x6fe7('0xa'),'attributes':['id',_0x6fe7('0xb'),'data1',_0x6fe7('0xc'),'data3',_0x6fe7('0xd'),'data5','data6','data7']}]},'log':_0x6fe7('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index 8b95a92..c19ffd5 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 _0x925e=['name','registry','defaultuser','GetTrunk','Request'];(function(_0xde8187,_0x47e993){var _0x3c5a4d=function(_0x3a49ee){while(--_0x3a49ee){_0xde8187['push'](_0xde8187['shift']());}};_0x3c5a4d(++_0x47e993);}(_0x925e,0x199));var _0xe925=function(_0x4bac76,_0x526f97){_0x4bac76=_0x4bac76-0x0;var _0x12bf53=_0x925e[_0x4bac76];return _0x12bf53;};'use strict';var client=require('../client');exports['getTrunks']=function(_0x393167){return function(_0x28a99a){return client[_0xe925('0x0')]('GetTrunk',{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0xe925('0x1'),_0xe925('0x2'),_0xe925('0x3')]},'log':_0xe925('0x4')});};}; \ No newline at end of file +var _0x34c6=['defaultuser','../client','Request','GetTrunk'];(function(_0x2eb95e,_0x1b26c2){var _0x1ab9d4=function(_0x1666d3){while(--_0x1666d3){_0x2eb95e['push'](_0x2eb95e['shift']());}};_0x1ab9d4(++_0x1b26c2);}(_0x34c6,0x1cd));var _0x634c=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x34c6[_0x19950b];return _0x3c6b41;};'use strict';var client=require(_0x634c('0x0'));exports['getTrunks']=function(_0xa8d011){return function(_0x3a4eed){return client[_0x634c('0x1')](_0x634c('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id','name','registry',_0x634c('0x3')]},'log':_0x634c('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index 866b14e..a527a56 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 _0x9c44=['online','pauseType','Request','GetUser','agent','name','email','accountcode','lastLoginAt','lastPauseAt','voicePause','phone','mobile','interface','getTelephones','telephone','internal','PauseUser','savePause','getAgent','ShowUser','fullname'];(function(_0x1fd545,_0x41d46f){var _0x52f7b3=function(_0x362a44){while(--_0x362a44){_0x1fd545['push'](_0x1fd545['shift']());}};_0x52f7b3(++_0x41d46f);}(_0x9c44,0x178));var _0x49c4=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0x9c44[_0x36c5b0];return _0xf19333;};'use strict';var client=require('../client');exports['getAgents']=function(){return function(){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'options':{'raw':![],'where':{'role':_0x49c4('0x2')},'attributes':['id',_0x49c4('0x3'),_0x49c4('0x4'),_0x49c4('0x5'),'fullname','online',_0x49c4('0x6'),'pauseType',_0x49c4('0x7'),_0x49c4('0x8'),_0x49c4('0x9'),_0x49c4('0xa'),_0x49c4('0xb')]},'log':'getAgents'});};};exports[_0x49c4('0xc')]=function(){return function(){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'options':{'raw':!![],'where':{'role':_0x49c4('0xd')},'attributes':['id','name','accountcode',_0x49c4('0xe')]},'log':_0x49c4('0xc')});};};exports['savePause']=function(_0xb611a1,_0x459d09,_0x4adb3c){return client['Request'](_0x49c4('0xf'),{'body':{'type':_0x459d09,'uniqueid':_0x4adb3c},'options':{'where':{'id':_0xb611a1['id']}},'log':_0x49c4('0x10')});};exports['saveUnpause']=function(_0x7df3a9){return client[_0x49c4('0x0')]('UnpauseUser',{'body':{},'options':{'where':{'id':_0x7df3a9['id']}},'log':_0x49c4('0x10')});};exports[_0x49c4('0x11')]=function(_0x21f15a){return client[_0x49c4('0x0')](_0x49c4('0x12'),{'options':{'raw':![],'where':{'role':_0x49c4('0x2'),'id':_0x21f15a},'attributes':['id',_0x49c4('0x3'),_0x49c4('0x4'),'accountcode',_0x49c4('0x13'),_0x49c4('0x14'),_0x49c4('0x6'),_0x49c4('0x15'),_0x49c4('0x7'),'voicePause',_0x49c4('0xb')]},'log':_0x49c4('0x11')});}; \ 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(_0x68dbcf,_0x53a9b7){var _0x2ec635=function(_0xe7eba3){while(--_0xe7eba3){_0x68dbcf['push'](_0x68dbcf['shift']());}};_0x2ec635(++_0x53a9b7);}(_0x70e0,0x17b));var _0x070e=function(_0x21f256,_0x4ce2c9){_0x21f256=_0x21f256-0x0;var _0x222c0b=_0x70e0[_0x21f256];return _0x222c0b;};'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 73324a8..5738b69 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 _0x9e31=['CreateVoiceAgentReport','UpdateVoiceAgentReport','../client','create','Request'];(function(_0x3fe139,_0x34ddcd){var _0x9b11ca=function(_0x3a328c){while(--_0x3a328c){_0x3fe139['push'](_0x3fe139['shift']());}};_0x9b11ca(++_0x34ddcd);}(_0x9e31,0x1ba));var _0x19e3=function(_0x1e43a7,_0x1c895b){_0x1e43a7=_0x1e43a7-0x0;var _0x6256e0=_0x9e31[_0x1e43a7];return _0x6256e0;};'use strict';var client=require(_0x19e3('0x0'));exports[_0x19e3('0x1')]=function(_0x12de5b){return client[_0x19e3('0x2')]('CreateVoiceAgentReport',{'body':_0x12de5b,'log':_0x19e3('0x3')});};exports['update']=function(_0x217921,_0x53f077,_0x4c067c){return client[_0x19e3('0x2')](_0x19e3('0x4'),{'body':_0x217921,'options':{'where':{'uniqueid':_0x53f077,'interface':_0x4c067c,'agentcomplete':!![]}},'log':_0x19e3('0x4')});}; \ No newline at end of file +var _0x18fc=['update','UpdateVoiceAgentReport','../client','create','Request','CreateVoiceAgentReport'];(function(_0xc1263e,_0x56d738){var _0x471f07=function(_0x2e6c55){while(--_0x2e6c55){_0xc1263e['push'](_0xc1263e['shift']());}};_0x471f07(++_0x56d738);}(_0x18fc,0x8c));var _0xc18f=function(_0x36b037,_0x2b234e){_0x36b037=_0x36b037-0x0;var _0x409194=_0x18fc[_0x36b037];return _0x409194;};'use strict';var client=require(_0xc18f('0x0'));exports[_0xc18f('0x1')]=function(_0x28cd1f){return client[_0xc18f('0x2')](_0xc18f('0x3'),{'body':_0x28cd1f,'log':_0xc18f('0x3')});};exports[_0xc18f('0x4')]=function(_0x41b42e,_0x111ee5,_0x45704e){return client[_0xc18f('0x2')](_0xc18f('0x5'),{'body':_0x41b42e,'options':{'where':{'uniqueid':_0x111ee5,'interface':_0x45704e,'agentcomplete':!![]}},'log':_0xc18f('0x5')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index 5b36956..cea23ce 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 _0x6781=['callerid','DOCUMENTATION','GetVoiceCallReport','outbound','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','disposition','duration','billableseconds','GetVoiceCallReports','lodash','../client','create','Request','CreateVoiceCallReport','merge','calleridnum'];(function(_0x5accad,_0x5791e0){var _0x5768c7=function(_0x701df9){while(--_0x701df9){_0x5accad['push'](_0x5accad['shift']());}};_0x5768c7(++_0x5791e0);}(_0x6781,0x162));var _0x1678=function(_0x20fff2,_0xb25962){_0x20fff2=_0x20fff2-0x0;var _0x179193=_0x6781[_0x20fff2];return _0x179193;};'use strict';var moment=require('moment');var util=require('util');var _=require(_0x1678('0x0'));var client=require(_0x1678('0x1'));exports[_0x1678('0x2')]=function(_0x50ebb9){return client[_0x1678('0x3')](_0x1678('0x4'),{'body':_[_0x1678('0x5')](_0x50ebb9,{'source':_0x50ebb9[_0x1678('0x6')],'destinationcontext':_0x50ebb9['context'],'callerid':_0x50ebb9[_0x1678('0x7')],'amaflags':_0x1678('0x8')}),'log':_0x1678('0x4')});};exports['getVoiceCallReports']=function(){return function(){return client[_0x1678('0x3')](_0x1678('0x9'),{'options':{'where':{'type':[_0x1678('0xa')],'createdAt':{'$between':[moment()[_0x1678('0xb')](_0x1678('0xc'))[_0x1678('0xd')](_0x1678('0xe')),moment()['endOf']('day')[_0x1678('0xd')](_0x1678('0xe'))]}},'attributes':['type',_0x1678('0xf'),_0x1678('0x10'),_0x1678('0x11')]},'log':_0x1678('0x12')});};}; \ No newline at end of file +var _0x776c=['startOf','format','YYYY-MM-DD\x20HH:mm:ss','endOf','day','type','disposition','billableseconds','moment','util','../client','create','Request','merge','calleridnum','context','DOCUMENTATION','CreateVoiceCallReport','GetVoiceCallReport','outbound'];(function(_0xb2c83b,_0x5d7a19){var _0x54f3e2=function(_0x484113){while(--_0x484113){_0xb2c83b['push'](_0xb2c83b['shift']());}};_0x54f3e2(++_0x5d7a19);}(_0x776c,0x80));var _0xc776=function(_0x474a80,_0x1a3a77){_0x474a80=_0x474a80-0x0;var _0x51155c=_0x776c[_0x474a80];return _0x51155c;};'use strict';var moment=require(_0xc776('0x0'));var util=require(_0xc776('0x1'));var _=require('lodash');var client=require(_0xc776('0x2'));exports[_0xc776('0x3')]=function(_0x53d7b7){return client[_0xc776('0x4')]('CreateVoiceCallReport',{'body':_[_0xc776('0x5')](_0x53d7b7,{'source':_0x53d7b7[_0xc776('0x6')],'destinationcontext':_0x53d7b7[_0xc776('0x7')],'callerid':_0x53d7b7['callerid'],'amaflags':_0xc776('0x8')}),'log':_0xc776('0x9')});};exports['getVoiceCallReports']=function(){return function(){return client['Request'](_0xc776('0xa'),{'options':{'where':{'type':[_0xc776('0xb')],'createdAt':{'$between':[moment()[_0xc776('0xc')]('day')[_0xc776('0xd')](_0xc776('0xe')),moment()[_0xc776('0xf')](_0xc776('0x10'))[_0xc776('0xd')]('YYYY-MM-DD\x20HH:mm:ss')]}},'attributes':[_0xc776('0x11'),_0xc776('0x12'),'duration',_0xc776('0x13')]},'log':'GetVoiceCallReports'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index b74cbd0..8477904 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 _0xb3fe=['../client','Request','CreateVoiceDialReport'];(function(_0x42e1db,_0x25d99d){var _0x5c96b5=function(_0x100c29){while(--_0x100c29){_0x42e1db['push'](_0x42e1db['shift']());}};_0x5c96b5(++_0x25d99d);}(_0xb3fe,0x1a7));var _0xeb3f=function(_0x1dc7c4,_0x803bb1){_0x1dc7c4=_0x1dc7c4-0x0;var _0xded053=_0xb3fe[_0x1dc7c4];return _0xded053;};'use strict';var client=require(_0xeb3f('0x0'));exports['create']=function(_0xac787c){return client[_0xeb3f('0x1')]('CreateVoiceDialReport',{'body':_0xac787c,'log':_0xeb3f('0x2')});}; \ No newline at end of file +var _0x0602=['Request','CreateVoiceDialReport','create'];(function(_0x1013a7,_0x3124be){var _0x5e413c=function(_0x19ec9d){while(--_0x19ec9d){_0x1013a7['push'](_0x1013a7['shift']());}};_0x5e413c(++_0x3124be);}(_0x0602,0x16d));var _0x2060=function(_0x49159d,_0x348179){_0x49159d=_0x49159d-0x0;var _0x48dc11=_0x0602[_0x49159d];return _0x48dc11;};'use strict';var client=require('../client');exports[_0x2060('0x0')]=function(_0x85b2d0){return client[_0x2060('0x1')](_0x2060('0x2'),{'body':_0x85b2d0,'log':_0x2060('0x2')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index 39b7fc9..adc1a08 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 _0x0c5d=['../client','getVoiceExtensions','GetVoiceExtension','recordingFormat'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0c5d,0x6c));var _0xd0c5=function(_0xf0d4da,_0x4f8e3c){_0xf0d4da=_0xf0d4da-0x0;var _0xd615e2=_0x0c5d[_0xf0d4da];return _0xd615e2;};'use strict';var client=require(_0xd0c5('0x0'));exports[_0xd0c5('0x1')]=function(){return function(){return client['Request'](_0xd0c5('0x2'),{'options':{'raw':!![],'attributes':['id','exten',_0xd0c5('0x3')],'where':{'VoiceExtensionId':null}},'log':_0xd0c5('0x1')});};}; \ No newline at end of file +var _0x13c0=['GetVoiceExtension','../client','getVoiceExtensions','Request'];(function(_0x3fcb50,_0x25e49f){var _0x49ecb3=function(_0x2b42f0){while(--_0x2b42f0){_0x3fcb50['push'](_0x3fcb50['shift']());}};_0x49ecb3(++_0x25e49f);}(_0x13c0,0x79));var _0x013c=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0x13c0[_0x5b78e8];return _0xf2c321;};'use strict';var client=require(_0x013c('0x0'));exports[_0x013c('0x1')]=function(){return function(){return client[_0x013c('0x2')](_0x013c('0x3'),{'options':{'raw':!![],'attributes':['id','exten','recordingFormat'],'where':{'VoiceExtensionId':null}},'log':'getVoiceExtensions'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index 6f4e571..a4f93a6 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 _0x8b97=['TrunkBackup','Interval','interval','getVoiceQueues','../client','Request','GetVoiceQueue','name','acw','acwTimeout','autopause','type','dialActive','dialLimitChannel','dialLimitQueue','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','monitor_format','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','Trunk','callerid','active','mandatoryDispositionPause'];(function(_0x35fa47,_0x1298ac){var _0x467b4b=function(_0x5a045f){while(--_0x5a045f){_0x35fa47['push'](_0x35fa47['shift']());}};_0x467b4b(++_0x1298ac);}(_0x8b97,0x1d9));var _0x78b9=function(_0x4ea090,_0x164bfb){_0x4ea090=_0x4ea090-0x0;var _0x115504=_0x8b97[_0x4ea090];return _0x115504;};'use strict';var client=require(_0x78b9('0x0'));exports['getVoiceQueues']=function(){return function(){return client[_0x78b9('0x1')](_0x78b9('0x2'),{'options':{'raw':![],'attributes':['id',_0x78b9('0x3'),_0x78b9('0x4'),_0x78b9('0x5'),_0x78b9('0x6'),'monitor_format',_0x78b9('0x7'),_0x78b9('0x8'),'dialMethod',_0x78b9('0x9'),_0x78b9('0xa'),'dialPowerLevel',_0x78b9('0xb'),_0x78b9('0xc'),_0x78b9('0xd'),_0x78b9('0xe'),_0x78b9('0xf'),_0x78b9('0x10'),_0x78b9('0x11'),_0x78b9('0x12'),_0x78b9('0x13'),_0x78b9('0x14'),_0x78b9('0x15'),_0x78b9('0x16'),_0x78b9('0x17'),'dialNoAnswerMaxRetry',_0x78b9('0x18'),_0x78b9('0x19'),_0x78b9('0x1a'),'dialGlobalInterval',_0x78b9('0x1b'),_0x78b9('0x1c'),_0x78b9('0x1d'),_0x78b9('0x1e'),_0x78b9('0x1f'),_0x78b9('0x20'),_0x78b9('0x21'),_0x78b9('0x22'),_0x78b9('0x23'),_0x78b9('0x24'),_0x78b9('0x25'),_0x78b9('0x26'),_0x78b9('0x27'),_0x78b9('0x28'),_0x78b9('0x29'),_0x78b9('0x2a'),_0x78b9('0x2b'),_0x78b9('0x2c'),_0x78b9('0x2d'),_0x78b9('0x2e'),'strategy',_0x78b9('0x2f'),_0x78b9('0x30'),_0x78b9('0x31'),_0x78b9('0x32'),_0x78b9('0x33'),_0x78b9('0x34'),_0x78b9('0x35'),_0x78b9('0x36'),'dialMachineMaxRetry','dialMachineRetryFrequency',_0x78b9('0x37'),_0x78b9('0x38'),'mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold',_0x78b9('0x39'),_0x78b9('0x3a')],'include':[{'model':_0x78b9('0x3b'),'as':_0x78b9('0x3b'),'attributes':['id',_0x78b9('0x3'),_0x78b9('0x3c'),_0x78b9('0x3d')]},{'model':'Pause','as':_0x78b9('0x3e'),'attributes':['id',_0x78b9('0x3')]},{'model':_0x78b9('0x3b'),'as':_0x78b9('0x3f'),'attributes':['id',_0x78b9('0x3'),_0x78b9('0x3c'),_0x78b9('0x3d')]},{'model':_0x78b9('0x40'),'as':'Interval','attributes':['id',_0x78b9('0x3')],'include':[{'model':_0x78b9('0x40'),'as':'Intervals','attributes':['id','name',_0x78b9('0x41')]}]}]},'log':_0x78b9('0x42')});};}; \ No newline at end of file +var _0x6d94=['dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialQueueProject2','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','Trunk','callerid','mandatoryDispositionPause','TrunkBackup','active','Interval','../client','getVoiceQueues','Request','GetVoiceQueue','name','autopause','monitor_format','type','dialActive','dialLimitChannel','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyRetryFrequency','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialCheckDuplicateType','dialAMDActive','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime'];(function(_0x3562e8,_0x44b6ce){var _0x51c375=function(_0x4a72c5){while(--_0x4a72c5){_0x3562e8['push'](_0x3562e8['shift']());}};_0x51c375(++_0x44b6ce);}(_0x6d94,0x14b));var _0x46d9=function(_0xe449b9,_0xea748a){_0xe449b9=_0xe449b9-0x0;var _0x25970f=_0x6d94[_0xe449b9];return _0x25970f;};'use strict';var client=require(_0x46d9('0x0'));exports[_0x46d9('0x1')]=function(){return function(){return client[_0x46d9('0x2')](_0x46d9('0x3'),{'options':{'raw':![],'attributes':['id',_0x46d9('0x4'),'acw','acwTimeout',_0x46d9('0x5'),_0x46d9('0x6'),_0x46d9('0x7'),_0x46d9('0x8'),'dialMethod',_0x46d9('0x9'),'dialLimitQueue',_0x46d9('0xa'),_0x46d9('0xb'),_0x46d9('0xc'),_0x46d9('0xd'),_0x46d9('0xe'),_0x46d9('0xf'),_0x46d9('0x10'),_0x46d9('0x11'),'dialQueueTimeout','dialQueueProject',_0x46d9('0x12'),_0x46d9('0x13'),'dialBusyMaxRetry',_0x46d9('0x14'),'dialNoAnswerMaxRetry',_0x46d9('0x15'),_0x46d9('0x16'),_0x46d9('0x17'),_0x46d9('0x18'),'dialPrefix',_0x46d9('0x19'),_0x46d9('0x1a'),'dialAMDInitialSilence','dialAMDGreeting',_0x46d9('0x1b'),_0x46d9('0x1c'),_0x46d9('0x1d'),_0x46d9('0x1e'),_0x46d9('0x1f'),_0x46d9('0x20'),_0x46d9('0x21'),_0x46d9('0x22'),_0x46d9('0x23'),_0x46d9('0x24'),_0x46d9('0x25'),_0x46d9('0x26'),'dialAgiAfterHangupClient',_0x46d9('0x27'),_0x46d9('0x6'),'strategy',_0x46d9('0x28'),_0x46d9('0x29'),_0x46d9('0x2a'),_0x46d9('0x2b'),_0x46d9('0x2c'),_0x46d9('0x2d'),'dialAbandonedMaxRetry',_0x46d9('0x2e'),_0x46d9('0x2f'),_0x46d9('0x30'),'dialAgentRejectMaxRetry',_0x46d9('0x31'),_0x46d9('0x32'),_0x46d9('0x33'),_0x46d9('0x34'),_0x46d9('0x35'),'dialPreviewRecallmeReminder'],'include':[{'model':'Trunk','as':_0x46d9('0x36'),'attributes':['id','name',_0x46d9('0x37'),'active']},{'model':'Pause','as':_0x46d9('0x38'),'attributes':['id',_0x46d9('0x4')]},{'model':_0x46d9('0x36'),'as':_0x46d9('0x39'),'attributes':['id',_0x46d9('0x4'),_0x46d9('0x37'),_0x46d9('0x3a')]},{'model':_0x46d9('0x3b'),'as':'Interval','attributes':['id',_0x46d9('0x4')],'include':[{'model':_0x46d9('0x3b'),'as':'Intervals','attributes':['id','name','interval']}]}]},'log':_0x46d9('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index 11a4a23..1658053 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(_0x1b1f9c,_0x43783d){var _0x1ccf2e=function(_0x20baad){while(--_0x20baad){_0x1b1f9c['push'](_0x1b1f9c['shift']());}};_0x1ccf2e(++_0x43783d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0xa9e0[_0x4b7b62];return _0x2280df;};'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(_0x4ce994,_0x3b727b){var _0x5a3f6c=function(_0x40cbbd){while(--_0x40cbbd){_0x4ce994['push'](_0x4ce994['shift']());}};_0x5a3f6c(++_0x3b727b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0xa9e0[_0x9aada2];return _0x196dff;};'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 eb62d7d..b670945 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 _0x86dd=['../client','getVoiceQueueRtPauses','GetVoiceQueueRtPauses'];(function(_0xd8faf7,_0xde4abe){var _0x2c4a80=function(_0x2265c0){while(--_0x2265c0){_0xd8faf7['push'](_0xd8faf7['shift']());}};_0x2c4a80(++_0xde4abe);}(_0x86dd,0x195));var _0xd86d=function(_0x18063c,_0xaf71b2){_0x18063c=_0x18063c-0x0;var _0x5a77fb=_0x86dd[_0x18063c];return _0x5a77fb;};'use strict';var client=require(_0xd86d('0x0'));exports[_0xd86d('0x1')]=function(_0x4df4a5){return function(){return client['Request'](_0xd86d('0x2'),{'options':{'where':{'VoiceQueueId':_0x4df4a5,'paused':!![]},'raw':!![]},'log':_0xd86d('0x1')});};}; \ No newline at end of file +var _0x2a14=['../client','getVoiceQueueRtPauses','Request'];(function(_0x19df51,_0x59637e){var _0x3a9c7e=function(_0x5137fe){while(--_0x5137fe){_0x19df51['push'](_0x19df51['shift']());}};_0x3a9c7e(++_0x59637e);}(_0x2a14,0x1aa));var _0x42a1=function(_0x5cb060,_0x21c48d){_0x5cb060=_0x5cb060-0x0;var _0x137d35=_0x2a14[_0x5cb060];return _0x137d35;};'use strict';var client=require(_0x42a1('0x0'));exports[_0x42a1('0x1')]=function(_0x19af76){return function(){return client[_0x42a1('0x2')]('GetVoiceQueueRtPauses',{'options':{'where':{'VoiceQueueId':_0x19af76,'paused':!![]},'raw':!![]},'log':_0x42a1('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index b10e1fd..c17467d 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(_0x373d04,_0x1beccf){var _0x453268=function(_0x309f84){while(--_0x309f84){_0x373d04['push'](_0x373d04['shift']());}};_0x453268(++_0x1beccf);}(_0x7a54,0x106));var _0x47a5=function(_0x516f11,_0xecc180){_0x516f11=_0x516f11-0x0;var _0x2ee6ad=_0x7a54[_0x516f11];return _0x2ee6ad;};'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(_0x37d7fe,_0x4b3df6){var _0x5393db=function(_0x52e0b2){while(--_0x52e0b2){_0x37d7fe['push'](_0x37d7fe['shift']());}};_0x5393db(++_0x4b3df6);}(_0x7a54,0x106));var _0x47a5=function(_0x42e06a,_0x12f4dc){_0x42e06a=_0x42e06a-0x0;var _0xbb156d=_0x7a54[_0x42e06a];return _0xbb156d;};'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 138d5df..37259af 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 _0xc10c=['origtransferercalleridname','secondtransfererconnectedlinenum','secondtransferercontext','secondtransfererexten','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','isexternal','origtransferercontext','../client','transfers','blindTransfer','CreateVoiceTransferReport','result','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transferercontext','transfererlinkedid','transfereechannel','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeexten','context','blind','attendedTransfer','origtransfererchannel'];(function(_0x5ca5bc,_0x5b8a9d){var _0x26ca86=function(_0x1ad9a6){while(--_0x1ad9a6){_0x5ca5bc['push'](_0x5ca5bc['shift']());}};_0x26ca86(++_0x5b8a9d);}(_0xc10c,0x11d));var _0xcc10=function(_0x503d00,_0x323df1){_0x503d00=_0x503d00-0x0;var _0x2263d8=_0xc10c[_0x503d00];return _0x2263d8;};'use strict';var client=require(_0xcc10('0x0'));exports[_0xcc10('0x1')]={};exports[_0xcc10('0x2')]=function(_0x39ce07){return client['Request'](_0xcc10('0x3'),{'body':{'result':_0x39ce07[_0xcc10('0x4')],'transfererchannel':_0x39ce07[_0xcc10('0x5')],'transferercalleridnum':_0x39ce07[_0xcc10('0x6')],'transferercalleridname':_0x39ce07[_0xcc10('0x7')],'transfererconnectedlinenum':_0x39ce07[_0xcc10('0x8')],'transfererconnectedlinename':_0x39ce07[_0xcc10('0x9')],'transfereraccountcode':_0x39ce07['transfereraccountcode'],'transferercontext':_0x39ce07[_0xcc10('0xa')],'transfererexten':_0x39ce07['transfererexten'],'transfererlinkedid':_0x39ce07[_0xcc10('0xb')],'transfereechannel':_0x39ce07[_0xcc10('0xc')],'transfereecalleridnum':_0x39ce07['transfereecalleridnum'],'transfereecalleridname':_0x39ce07[_0xcc10('0xd')],'transfereeconnectedlinenum':_0x39ce07[_0xcc10('0xe')],'transfereeconnectedlinename':_0x39ce07[_0xcc10('0xf')],'transfereeaccountcode':_0x39ce07['transfereeaccountcode'],'transfereecontext':_0x39ce07['transfereecontext'],'transfereeexten':_0x39ce07[_0xcc10('0x10')],'transfereelinkedid':_0x39ce07['transfereelinkedid'],'isexternal':_0x39ce07['isexternal'],'context':_0x39ce07[_0xcc10('0x11')],'extension':_0x39ce07['extension'],'type':_0xcc10('0x12')},'log':_0xcc10('0x3')});};exports[_0xcc10('0x13')]=function(_0x2fdd3d){return client['Request'](_0xcc10('0x3'),{'body':{'result':_0x2fdd3d['result'],'transfererchannel':_0x2fdd3d[_0xcc10('0x14')],'transferercalleridnum':_0x2fdd3d['origtransferercalleridnum'],'transferercalleridname':_0x2fdd3d[_0xcc10('0x15')],'transfererconnectedlinenum':_0x2fdd3d[_0xcc10('0x16')],'transfererconnectedlinename':_0x2fdd3d['secondtransfererconnectedlinename'],'transfereraccountcode':_0x2fdd3d['origtransfereraccountcode'],'transferercontext':_0x2fdd3d[_0xcc10('0x17')],'transfererexten':_0x2fdd3d[_0xcc10('0x18')],'transfererlinkedid':_0x2fdd3d['origtransfererlinkedid'],'transfereechannel':_0x2fdd3d[_0xcc10('0x19')],'transfereecalleridnum':_0x2fdd3d[_0xcc10('0x1a')],'transfereecalleridname':_0x2fdd3d[_0xcc10('0x1b')],'transfereeconnectedlinenum':_0x2fdd3d['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x2fdd3d[_0xcc10('0x1c')],'transfereeaccountcode':_0x2fdd3d[_0xcc10('0x1d')],'transfereecontext':_0x2fdd3d[_0xcc10('0x1e')],'transfereeexten':_0x2fdd3d[_0xcc10('0x1f')],'transfereelinkedid':_0x2fdd3d['transfertargetlinkedid'],'isexternal':_0x2fdd3d[_0xcc10('0x20')],'context':_0x2fdd3d[_0xcc10('0x21')],'extension':_0x2fdd3d['origtransfererexten'],'type':'attended'},'log':_0xcc10('0x3')});}; \ No newline at end of file +var _0xae0e=['transfertargetcontext','transfertargetlinkedid','isexternal','origtransferercontext','origtransfererexten','blindTransfer','Request','CreateVoiceTransferReport','result','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transfereechannel','transfereecalleridnum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereelinkedid','context','blind','attendedTransfer','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode'];(function(_0x587107,_0x2d8f6f){var _0x42f3f2=function(_0x5930cd){while(--_0x5930cd){_0x587107['push'](_0x587107['shift']());}};_0x42f3f2(++_0x2d8f6f);}(_0xae0e,0x19c));var _0xeae0=function(_0x306489,_0x4d74b2){_0x306489=_0x306489-0x0;var _0x5f1338=_0xae0e[_0x306489];return _0x5f1338;};'use strict';var client=require('../client');exports['transfers']={};exports[_0xeae0('0x0')]=function(_0x1a83e2){return client[_0xeae0('0x1')](_0xeae0('0x2'),{'body':{'result':_0x1a83e2[_0xeae0('0x3')],'transfererchannel':_0x1a83e2[_0xeae0('0x4')],'transferercalleridnum':_0x1a83e2[_0xeae0('0x5')],'transferercalleridname':_0x1a83e2[_0xeae0('0x6')],'transfererconnectedlinenum':_0x1a83e2[_0xeae0('0x7')],'transfererconnectedlinename':_0x1a83e2[_0xeae0('0x8')],'transfereraccountcode':_0x1a83e2[_0xeae0('0x9')],'transferercontext':_0x1a83e2['transferercontext'],'transfererexten':_0x1a83e2['transfererexten'],'transfererlinkedid':_0x1a83e2['transfererlinkedid'],'transfereechannel':_0x1a83e2[_0xeae0('0xa')],'transfereecalleridnum':_0x1a83e2[_0xeae0('0xb')],'transfereecalleridname':_0x1a83e2['transfereecalleridname'],'transfereeconnectedlinenum':_0x1a83e2['transfereeconnectedlinenum'],'transfereeconnectedlinename':_0x1a83e2[_0xeae0('0xc')],'transfereeaccountcode':_0x1a83e2[_0xeae0('0xd')],'transfereecontext':_0x1a83e2[_0xeae0('0xe')],'transfereeexten':_0x1a83e2['transfereeexten'],'transfereelinkedid':_0x1a83e2[_0xeae0('0xf')],'isexternal':_0x1a83e2['isexternal'],'context':_0x1a83e2[_0xeae0('0x10')],'extension':_0x1a83e2['extension'],'type':_0xeae0('0x11')},'log':_0xeae0('0x2')});};exports[_0xeae0('0x12')]=function(_0x443b49){return client['Request'](_0xeae0('0x2'),{'body':{'result':_0x443b49[_0xeae0('0x3')],'transfererchannel':_0x443b49['origtransfererchannel'],'transferercalleridnum':_0x443b49['origtransferercalleridnum'],'transferercalleridname':_0x443b49[_0xeae0('0x13')],'transfererconnectedlinenum':_0x443b49[_0xeae0('0x14')],'transfererconnectedlinename':_0x443b49[_0xeae0('0x15')],'transfereraccountcode':_0x443b49[_0xeae0('0x16')],'transferercontext':_0x443b49[_0xeae0('0x17')],'transfererexten':_0x443b49[_0xeae0('0x18')],'transfererlinkedid':_0x443b49[_0xeae0('0x19')],'transfereechannel':_0x443b49[_0xeae0('0x1a')],'transfereecalleridnum':_0x443b49[_0xeae0('0x1b')],'transfereecalleridname':_0x443b49[_0xeae0('0x1c')],'transfereeconnectedlinenum':_0x443b49[_0xeae0('0x1d')],'transfereeconnectedlinename':_0x443b49[_0xeae0('0x1e')],'transfereeaccountcode':_0x443b49[_0xeae0('0x1f')],'transfereecontext':_0x443b49[_0xeae0('0x20')],'transfereeexten':_0x443b49['transfertargetexten'],'transfereelinkedid':_0x443b49[_0xeae0('0x21')],'isexternal':_0x443b49[_0xeae0('0x22')],'context':_0x443b49[_0xeae0('0x23')],'extension':_0x443b49[_0xeae0('0x24')],'type':'attended'},'log':_0xeae0('0x2')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index e9933fb..bc76774 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(_0x37312b,_0x23e200){var _0x20f532=function(_0x17a33f){while(--_0x17a33f){_0x37312b['push'](_0x37312b['shift']());}};_0x20f532(++_0x23e200);}(_0x7a54,0x106));var _0x47a5=function(_0x4e2555,_0x1265f6){_0x4e2555=_0x4e2555-0x0;var _0x4fc49f=_0x7a54[_0x4e2555];return _0x4fc49f;};'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 _0xb10b=['type','Invalid\x20type\x20parameter.\x20Allowed\x20values:\x20inbound,\x20outbound','filter','count','rows','voicequeuechannel','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','Redirect','telephones','trunks','run','event','Event\x20name\x20mandatory','faxAccounts','send','checkAfterSend','server','http','127.0.0.1','RPC\x20listening\x20on\x20port:','lodash','jayson/promise','validate','moment','../properties','../ami','../model/voiceQueueSummary','listen','format','%s/%s','SIP','name','timers','timer','updateAcw','agents','voiceStatus','pause','QueuePause','isConnected','error','asterisk','username','ami\x20disconnected','join','pick','keys','module','action','Reload','Action','then','message','catch','command','Command','content','voiceQueues','hasOwnProperty','push','length','find','omit','undefined','values','voicechannel','map','channels','uniqueid','channel','%s.%s','filename','wav','ai(mixmonitorid)','/var/spool/asterisk/monitor/','toLowerCase','mixmonitorid','rec','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','resolve','StopMixMonitor','destinationchannel','monitors','stop','queueChannels','inbound','outbound','includes'];(function(_0x13658a,_0x87bb73){var _0x575814=function(_0x13fb71){while(--_0x13fb71){_0x13658a['push'](_0x13658a['shift']());}};_0x575814(++_0x87bb73);}(_0xb10b,0x12a));var _0xbb10=function(_0x1c2421,_0x1c152c){_0x1c2421=_0x1c2421-0x0;var _0x5867b2=_0xb10b[_0x1c2421];return _0x5867b2;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var jayson=require(_0xbb10('0x1'));var schema=require(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var config=require('../../../config/environment');var properties=require(_0xbb10('0x4'));var ami=require(_0xbb10('0x5'));var VoiceQueueSummary=require(_0xbb10('0x6'));exports[_0xbb10('0x7')]=function(_0x49baf4,_0x312b72,_0x481979){return new Promise(function(_0x328583,_0x3cdd53){var _0x513741={'QueuePause':function(_0x1b9e94){return new Promise(function(_0x3fb675){var _0x21370f=util[_0xbb10('0x8')](_0xbb10('0x9'),_0xbb10('0xa'),_0x1b9e94[_0xbb10('0xb')]);if(_0x49baf4[_0xbb10('0xc')]&&_0x49baf4['timers'][_0x21370f]&&_0x49baf4['timers'][_0x21370f][_0xbb10('0xd')]){_0x49baf4[_0xbb10('0xc')][_0x21370f][_0xbb10('0xe')]();}if(_0x49baf4['agents'][_0x21370f]){_0x49baf4[_0xbb10('0xf')][_0x21370f]['updateStatusRealtime']({'state':_0x49baf4[_0xbb10('0xf')][_0x21370f][_0xbb10('0x10')],'statePause':_0x1b9e94[_0xbb10('0x11')]?!![]:![]});}_0x3fb675({'code':0xc8,'message':_0xbb10('0x12')});});},'Reload':function(_0x442548){var _0x147230=this;return new Promise(function(_0x58a612,_0x26e021){if(ami[_0xbb10('0x13')]()==![]){return _0x26e021(_0x147230[_0xbb10('0x14')](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],_0xbb10('0x17')][_0xbb10('0x18')]('\x20')));}_0x442548=_[_0xbb10('0x19')](_0x442548,_[_0xbb10('0x1a')](properties['reload'][_0xbb10('0x1b')]));_0x442548[_0xbb10('0x1c')]=_0xbb10('0x1d');return ami[_0xbb10('0x1e')](_0x442548)[_0xbb10('0x1f')](function(_0x1682a4){_0x58a612({'code':0xc8,'message':_0x1682a4[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0xbf2906){_0x26e021(_0x147230[_0xbb10('0x14')](0x1f5,_0xbf2906['message']));});});},'Command':function(_0x5ff0cf){var _0x19f48d=this;return new Promise(function(_0x388fab,_0x109908){if(ami[_0xbb10('0x13')]()==![]){return _0x109908(_0x19f48d[_0xbb10('0x14')](0x1f4,[config['asterisk']['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],'ami\x20disconnected']['join']('\x20')));}_0x5ff0cf=_[_0xbb10('0x19')](_0x5ff0cf,_0xbb10('0x22'));_0x5ff0cf[_0xbb10('0x1c')]=_0xbb10('0x23');return ami[_0xbb10('0x1e')](_0x5ff0cf)[_0xbb10('0x1f')](function(_0x407cb4){_0x388fab({'code':0xc8,'message':_0x407cb4[_0xbb10('0x24')]});})[_0xbb10('0x21')](function(_0x395404){_0x109908(_0x19f48d[_0xbb10('0x14')](0x1f5,_0x395404[_0xbb10('0x20')]));});});},'VoiceQueues':function(){return new Promise(function(_0x537898){var _0x4fedac=[];for(var _0x4fb5e0 in _0x49baf4[_0xbb10('0x25')]){if(_0x49baf4[_0xbb10('0x25')][_0xbb10('0x26')](_0x4fb5e0)){var _0x4e25ff=_0x49baf4[_0xbb10('0x25')][_0x4fb5e0];var _0x24d586=new VoiceQueueSummary(_0x4e25ff);_0x4fedac[_0xbb10('0x27')](_0x24d586);}}_0x537898({'count':_0x4fedac[_0xbb10('0x28')],'rows':_0x4fedac});});},'UpdateVoiceQueue':function(_0x1acce9){return new Promise(function(_0x20d946,_0x2a0e8b){var _0x4aabb9=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x25')],{'id':parseInt(_0x1acce9['id'])});var _0xfc3595=_[_0xbb10('0x2a')](_0x1acce9,['id']);if(_0x4aabb9){for(var _0x1d30aa in _0xfc3595){if(typeof _0xfc3595[_0x1d30aa]!==_0xbb10('0x2b')&&typeof _0x4aabb9[_0x1d30aa]!=='undefined'){_0x4aabb9[_0x1d30aa]=_0xfc3595[_0x1d30aa];}}_0x20d946(_0x4aabb9);}else{_0x2a0e8b();}});},'VoiceChannels':function(){return new Promise(function(_0x221624){var _0x4ee02e=_[_0xbb10('0x2c')](_0x49baf4['channels']);_0x221624({'count':_0x4ee02e[_0xbb10('0x28')],'rows':_0x4ee02e});});},'VoiceChannelMixMonitor':function(_0x1dcc9c){var _0x1b59f9=this;return new Promise(function(_0x491db4,_0x518d47){if(ami[_0xbb10('0x13')]()==![]){return _0x518d47(_0x1b59f9[_0xbb10('0x14')](0x1f4,[config['asterisk']['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],_0xbb10('0x17')][_0xbb10('0x18')]('\x20')));}var _0x37a83f=schema(properties[_0xbb10('0x2d')])[_0xbb10('0x2')](_0x1dcc9c);if(_0x37a83f['length']>0x0){return _0x518d47(_0x1b59f9[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x37a83f,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0xfb2c5e=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x2f')],{'uniqueid':_0x1dcc9c[_0xbb10('0x30')]});if(_0xfb2c5e&&_0xfb2c5e[_0xbb10('0x31')]){var _0x56943c=util[_0xbb10('0x8')](_0xbb10('0x32'),_0x1dcc9c[_0xbb10('0x33')]||_0x1dcc9c[_0xbb10('0x30')],_0x1dcc9c['format']||_0xbb10('0x34'));return ami['Action']({'action':'MixMonitor','channel':_0xfb2c5e[_0xbb10('0x31')],'file':_0x56943c,'options':_0xbb10('0x35')})[_0xbb10('0x1f')](function(_0x120d21){var _0x15d895=_[_0xbb10('0x29')](_0xfb2c5e['monitors'],{'filename':_0xbb10('0x36')+_0x56943c[_0xbb10('0x37')]()});if(_['isNil'](_0x15d895)){_0xfb2c5e['monitors']['push']({'filename':_0xbb10('0x36')+_0x56943c[_0xbb10('0x37')](),'createdAt':moment()[_0xbb10('0x8')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x120d21[_0xbb10('0x38')],'status':_0xbb10('0x39')});}else{_0x15d895[_0xbb10('0x38')]=_0x120d21['mixmonitorid'];_0x15d895[_0xbb10('0x3a')]=_0xbb10('0x39');}_0x491db4({'code':0xc8,'message':[_0x1dcc9c[_0xbb10('0x30')],_0xbb10('0x3b'),_0x120d21['mixmonitorid']][_0xbb10('0x18')]('\x20'),'mixmonitorid':_0x120d21[_0xbb10('0x38')]});})['catch'](function(_0xe2040f){_0x518d47(_0x1b59f9[_0xbb10('0x14')](0x1f5,[_0x1dcc9c[_0xbb10('0x30')],_0xe2040f[_0xbb10('0x20')][_0xbb10('0x37')]()][_0xbb10('0x18')]('\x20')));});}else{return _0x518d47(_0x1b59f9['error'](0x1f5,_0xbb10('0x3c')));}});},'VoiceChannelStopMixMonitor':function(_0x1c7fae){var _0x3e7b4c=this;return new Promise(function(_0x3d3c41,_0x4943d9){if(ami[_0xbb10('0x13')]()==![]){return _0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')]['username'],_0xbb10('0x17')][_0xbb10('0x18')]('\x20')));}var _0x54ac18=schema(properties['voicechannel'])[_0xbb10('0x2')](_0x1c7fae);if(_0x54ac18['length']>0x0){return _0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x54ac18,'message')[_0xbb10('0x18')](',\x20')));}var _0x1d82bf=_[_0xbb10('0x29')](_0x49baf4['channels'],{'uniqueid':_0x1c7fae[_0xbb10('0x30')]});if(_0x1d82bf){return Promise[_0xbb10('0x3d')]()[_0xbb10('0x1f')](function(){if(_0x1d82bf[_0xbb10('0x31')]){return ami[_0xbb10('0x1e')]({'action':_0xbb10('0x3e'),'channel':_0x1d82bf[_0xbb10('0x31')],'mixmonitorid':_0x1c7fae[_0xbb10('0x38')]})[_0xbb10('0x21')](function(){});}})[_0xbb10('0x1f')](function(){if(_0x1d82bf[_0xbb10('0x3f')]){return ami[_0xbb10('0x1e')]({'action':'StopMixMonitor','channel':_0x1d82bf[_0xbb10('0x3f')],'mixmonitorid':_0x1c7fae[_0xbb10('0x38')]})['catch'](function(){});}})[_0xbb10('0x1f')](function(){var _0x2f5027=_[_0xbb10('0x29')](_0x1d82bf[_0xbb10('0x40')],{'mixmonitorid':_0x1c7fae[_0xbb10('0x38')]});if(_0x2f5027){_0x2f5027[_0xbb10('0x3a')]=_0xbb10('0x41');}})['then'](function(){var _0x4a9793=util[_0xbb10('0x8')](_0xbb10('0x32'),_0x1c7fae[_0xbb10('0x33')]||_0x1c7fae['uniqueid'],_0x1c7fae['format']||_0xbb10('0x34'));var _0x34cf4e=_[_0xbb10('0x29')](_0x1d82bf[_0xbb10('0x40')],{'filename':_0xbb10('0x36')+_0x4a9793[_0xbb10('0x37')]()});if(_0x34cf4e){_0x34cf4e[_0xbb10('0x3a')]=_0xbb10('0x41');}})[_0xbb10('0x1f')](function(){_0x3d3c41({'code':0xc8,'message':[_0x1c7fae[_0xbb10('0x30')],'StopMixMonitor\x20Success']['join']('\x20')});})[_0xbb10('0x21')](function(_0x467dba){_0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f5,[_0x1c7fae[_0xbb10('0x30')],_0x467dba[_0xbb10('0x20')][_0xbb10('0x37')]()][_0xbb10('0x18')]('\x20')));});}else{return _0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'VoiceQueuesChannels':function(_0x1214f7){var _0x19ca3e=this;return new Promise(function(_0x20e18a){var _0x61e689=_[_0xbb10('0x2c')](_0x49baf4[_0xbb10('0x42')]);var _0x547a7a={'count':_0x61e689[_0xbb10('0x28')],'rows':_0x61e689};if(_0x1214f7&&_0x1214f7['type']){if(![_0xbb10('0x43'),_0xbb10('0x44')][_0xbb10('0x45')](_0x1214f7[_0xbb10('0x46')])){return _0x3cdd53(_0x19ca3e[_0xbb10('0x14')](0x190,_0xbb10('0x47')));}var _0x2e3326=_[_0xbb10('0x48')](_0x61e689,function(_0x180400){return _0x180400[_0xbb10('0x46')]===_0x1214f7[_0xbb10('0x46')];});_0x547a7a[_0xbb10('0x49')]=_0x2e3326[_0xbb10('0x28')];_0x547a7a[_0xbb10('0x4a')]=_0x2e3326;}_0x20e18a(_0x547a7a);});},'VoiceQueuesChannel':function(_0x4475e1){var _0x5de0cc=this;return new Promise(function(_0x4571b6,_0x466eb7){var _0x1b83a9=schema(properties[_0xbb10('0x4b')])[_0xbb10('0x2')](_0x4475e1);if(_0x1b83a9[_0xbb10('0x28')]>0x0){return _0x466eb7(_0x5de0cc['error'](0x1f4,_[_0xbb10('0x2e')](_0x1b83a9,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0x14fed3=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x42')],{'uniqueid':_0x4475e1[_0xbb10('0x30')]});if(_0x14fed3){_0x4571b6(_0x14fed3);}else{return _0x466eb7(_0x5de0cc[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'VoiceQueuesChannelHangup':function(_0x40c4fb){var _0x2eb05a=this;return new Promise(function(_0x2a1ce1,_0x16932f){if(ami['isConnected']()==![]){return _0x16932f(_0x2eb05a['error'](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],_0xbb10('0x17')]['join']('\x20')));}var _0x506498=schema(properties[_0xbb10('0x4c')])[_0xbb10('0x2')](_0x40c4fb);if(_0x506498[_0xbb10('0x28')]>0x0){return _0x16932f(_0x2eb05a[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x506498,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0x4a5fb9=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x42')],{'uniqueid':_0x40c4fb['uniqueid']});if(_0x4a5fb9&&_0x4a5fb9['channel']){return ami['Action']({'action':_0xbb10('0x4d'),'channel':_0x4a5fb9[_0xbb10('0x31')]})[_0xbb10('0x1f')](function(_0x5bd1c0){_0x2a1ce1({'code':0xc8,'message':[_0x40c4fb['uniqueid'],_0x5bd1c0['message'][_0xbb10('0x37')]()][_0xbb10('0x18')]('\x20')});})[_0xbb10('0x21')](function(_0x4e9fbd){_0x16932f(_0x2eb05a[_0xbb10('0x14')](0x1f5,[_0x40c4fb[_0xbb10('0x30')],_0x4e9fbd['message']['toLowerCase']()][_0xbb10('0x18')]('\x20')));});}else{return _0x16932f(_0x2eb05a[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'VoiceQueuesChannelRedirect':function(_0x237246){var _0x54b7c5=this;return new Promise(function(_0x43eaec,_0xec48ac){if(ami[_0xbb10('0x13')]()==![]){return _0xec48ac(_0x54b7c5['error'](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],'ami\x20disconnected'][_0xbb10('0x18')]('\x20')));}var _0x31e85e=schema(properties[_0xbb10('0x4e')])[_0xbb10('0x2')](_0x237246);if(_0x31e85e['length']>0x0){return _0xec48ac(_0x54b7c5[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x31e85e,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0x56b3a3=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x42')],{'uniqueid':_0x237246[_0xbb10('0x30')]});if(_0x56b3a3&&_0x56b3a3[_0xbb10('0x31')]){return ami[_0xbb10('0x1e')]({'action':_0xbb10('0x4f'),'channel':_0x56b3a3[_0xbb10('0x31')],'exten':_0x237246['exten'],'context':_0x237246['context']||_0x56b3a3['context'],'priority':0x1})[_0xbb10('0x1f')](function(_0x9c672d){_0x43eaec({'code':0xc8,'message':[_0x237246[_0xbb10('0x30')],_0x9c672d['message']['toLowerCase']()][_0xbb10('0x18')]('\x20')});})[_0xbb10('0x21')](function(_0xd9e743){_0xec48ac(_0x54b7c5[_0xbb10('0x14')](0x1f5,[_0x237246[_0xbb10('0x30')],_0xd9e743[_0xbb10('0x20')]['toLowerCase']()][_0xbb10('0x18')]('\x20')));});}else{return _0xec48ac(_0x54b7c5[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'Agents':function(_0x14f16b){return new Promise(function(_0x2aaaa6){var _0x5bfc68=_['values'](_0x49baf4['agents']);if(_0x14f16b&&_0x14f16b['id']){var _0x329da7=_[_0xbb10('0x29')](_0x5bfc68,function(_0x36917f){return _0x36917f['id']===_0x14f16b['id'];});_0x2aaaa6(_0x329da7);}else{_0x2aaaa6({'count':_0x5bfc68[_0xbb10('0x28')],'rows':_0x5bfc68});}});},'Telephones':function(){return new Promise(function(_0x2f7d2a){var _0x1d40b8=_['values'](_0x49baf4[_0xbb10('0x50')]);_0x2f7d2a({'count':_0x1d40b8['length'],'rows':_0x1d40b8});});},'Trunks':function(){return new Promise(function(_0x4fe3b5){var _0x519a54=_[_0xbb10('0x2c')](_0x49baf4[_0xbb10('0x51')]);_0x4fe3b5({'count':_0x519a54[_0xbb10('0x28')],'rows':_0x519a54});});},'OutboundChannels':function(){return new Promise(function(_0x108f99){var _0x5ce94f=_[_0xbb10('0x2c')](_0x49baf4['outboundChannels']);_0x108f99({'count':_0x5ce94f['length'],'rows':_0x5ce94f});});},'Outbound':function(){return new Promise(function(_0x165fe9){_0x165fe9(_0x49baf4[_0xbb10('0x44')]);});},'Campaigns':function(){return new Promise(function(_0x29529c){var _0x2bd2ab=_[_0xbb10('0x2c')](_0x49baf4['campaigns']);_0x29529c({'count':_0x2bd2ab[_0xbb10('0x28')],'rows':_0x2bd2ab});});},'VoiceQueuesPreview':function(_0x19fcec){var _0x2c6429=this;return new Promise(function(_0x3f3d38,_0x43cdb7){_0x312b72[_0xbb10('0x52')](_0x19fcec['id'])[_0xbb10('0x1f')](function(_0x53fa98){_0x3f3d38({'code':0xc8,'message':_0x53fa98[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0x30f3ea){_0x43cdb7(_0x2c6429[_0xbb10('0x14')](0x1f4,_0x30f3ea[_0xbb10('0x20')]));});});},'EventManager':function(_0x172be3){var _0xa3b23=this;return new Promise(function(_0x312a08,_0x5a4429){if(!_0x172be3[_0xbb10('0x53')]){return _0x5a4429(_0xa3b23[_0xbb10('0x14')](0x1f4,_0xbb10('0x54')));}ami['emit']('custom:'+_0x172be3['event'],_0x172be3[_0xbb10('0x20')]);_0x312a08({'code':0xc8,'message':_0x172be3});});},'FaxAccounts':function(){return new Promise(function(_0x5a3c44){var _0x4e3d6a=_[_0xbb10('0x2c')](_0x49baf4[_0xbb10('0x55')]);_0x5a3c44({'count':_0x4e3d6a[_0xbb10('0x28')],'rows':_0x4e3d6a});});},'SendFax':function(_0x12ed63){var _0x32ec27=this;return new Promise(function(_0x24dca6,_0x33116){_0x481979[_0xbb10('0x56')](_0x12ed63)[_0xbb10('0x1f')](function(_0x5206e1){_0x24dca6({'code':0xc8,'message':_0x5206e1[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0x46b6d2){_0x33116(_0x32ec27[_0xbb10('0x14')](0x1f4,_0x46b6d2['message']));});});},'CheckAfterSend':function(_0x4c0795){var _0x3547a3=this;return new Promise(function(_0x2280bd,_0x30f0a4){_0x481979[_0xbb10('0x57')](_0x4c0795)['then'](function(_0x17d596){_0x2280bd({'code':0xc8,'message':_0x17d596[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0xf7b3e1){_0x30f0a4(_0x3547a3[_0xbb10('0x14')](0x1f4,_0xf7b3e1['message']));});});}};var _0x5f0691=jayson[_0xbb10('0x58')](_0x513741)[_0xbb10('0x59')]();_0x5f0691['on'](_0xbb10('0x14'),function(_0x5239da){return _0x3cdd53(_0x5239da);});_0x5f0691[_0xbb10('0x7')](0x232a,_0xbb10('0x5a'),function(){console['log']('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x328583(_0xbb10('0x5b')+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 51842b1..aedf25f 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 _0xfbeb=['data3','split','$or','map','routeId','destcalleridnum','calleridnum','lastName','phone','mobile','createdAt','scheduledAt','updatedAt','union','resolve','then','isEmpty','length','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','info','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','firstName','calleridname','','destcalleridname','Unknown','push','[CM][%s][%s]\x20Contact\x20created:%s','format','user:%s','name','trigger:%s','action','merge','bluebird','ioredis','util','../../../../config/environment','trigger','../../rpc/cmContact','redis','defaults','localhost','socket.io-emitter','stringify','emit','data1','data2','isNil','data5','xmd-contactid','ListId'];(function(_0xcb0159,_0xa3584d){var _0x2ecd83=function(_0x11c504){while(--_0x11c504){_0xcb0159['push'](_0xcb0159['shift']());}};_0x2ecd83(++_0xa3584d);}(_0xfbeb,0x1b6));var _0xbfbe=function(_0x53e29e,_0x17c540){_0x53e29e=_0x53e29e-0x0;var _0x54c118=_0xfbeb[_0x53e29e];return _0x54c118;};'use strict';var _=require('lodash');var BPromise=require(_0xbfbe('0x0'));var Redis=require(_0xbfbe('0x1'));var util=require(_0xbfbe('0x2'));var config=require(_0xbfbe('0x3'));var logger=require('../../../../config/logger')(_0xbfbe('0x4'));var cmContactRpc=require(_0xbfbe('0x5'));config[_0xbfbe('0x6')]=_[_0xbfbe('0x7')](config['redis'],{'host':_0xbfbe('0x8'),'port':0x18eb});var io=require(_0xbfbe('0x9'))(new Redis(config[_0xbfbe('0x6')]));function emit(_0x5c7c34,_0x35d37f,_0x3c8d26,_0x3b51f9,_0x416886){logger['info']('[CM][%s][%s]',_0x5c7c34,_0x35d37f['id'],_0x3c8d26,_0x3b51f9,JSON[_0xbfbe('0xa')](_0x416886));io['to'](_0x3c8d26)[_0xbfbe('0xb')](_0x3b51f9,_0x416886);}exports['exec']=function(_0x2de902,_0x140882,_0x16a4ff,_0x573968){var _0x3c00da,_0x3092f8;var _0x43f4f3={};var _0x3293b8;var _0x3e6710=Number(_0x16a4ff[_0xbfbe('0xc')]);var _0x58cf55=_0x16a4ff['data2']?Boolean(Number(_0x16a4ff[_0xbfbe('0xd')])):![];var _0x599b54;var _0x567039=![];if(!_[_0xbfbe('0xe')](_0x16a4ff[_0xbfbe('0xf')])){if(_0x16a4ff[_0xbfbe('0xf')]=='1')_0x567039=!![];}if(!_0x567039){if(_0x573968[_0xbfbe('0x10')]){_0x43f4f3['id']=_0x573968['xmd-contactid'];}}if(!_0x43f4f3['id']){_0x43f4f3[_0xbfbe('0x11')]=_0x3e6710;_0x599b54=_0x16a4ff[_0xbfbe('0x12')]&&_0x16a4ff['data3']!=='0'?_0x16a4ff[_0xbfbe('0x12')][_0xbfbe('0x13')](','):['phone'];_0x43f4f3[_0xbfbe('0x14')]=_[_0xbfbe('0x15')](_0x599b54,function(_0x50cb27){var _0xd96a39={};_0xd96a39[_0x50cb27]=_0x573968[_0xbfbe('0x16')]?_0x573968[_0xbfbe('0x17')]:_0x573968[_0xbfbe('0x18')];return _0xd96a39;});_0x3293b8=_0x573968[_0xbfbe('0x16')]?_0x573968[_0xbfbe('0x17')]:_0x573968[_0xbfbe('0x18')];}var _0x2a2c44=['id','firstName',_0xbfbe('0x19'),_0xbfbe('0x1a'),_0xbfbe('0x1b'),'fax',_0xbfbe('0x11'),_0xbfbe('0x1c'),_0xbfbe('0x1d'),_0xbfbe('0x1e')];var _0x240973=_[_0xbfbe('0x1f')](_0x2a2c44,_0x599b54);BPromise[_0xbfbe('0x20')]()[_0xbfbe('0x21')](cmContactRpc['getContacts']({'attributes':_0x240973,'where':_0x43f4f3,'phone':_0x3293b8}))['then'](function(_0x10f485){_0x3092f8=_0x10f485;if(!_[_0xbfbe('0x22')](_0x3092f8)){if(_0x3092f8[_0xbfbe('0x23')]===0x1){_0x3c00da=_0x3092f8[0x0];logger['info'](_0xbfbe('0x24'),_0x573968[_0xbfbe('0x25')],_0x140882['id'],_0x3c00da['id']);}else{logger[_0xbfbe('0x26')](_0xbfbe('0x27'),_0x573968[_0xbfbe('0x25')],_0x140882['id'],_['map'](_0x3092f8,'id')[_0xbfbe('0x28')](','));}return;}else{logger[_0xbfbe('0x26')](_0xbfbe('0x29'),_0x573968[_0xbfbe('0x25')],_0x140882['id']);var _0x45f4d1={'ListId':_0x3e6710};var _0x22f6ba=_0x16a4ff['data4']&&_0x16a4ff[_0xbfbe('0x2a')]!=='0'?_0x16a4ff[_0xbfbe('0x2a')]:_0xbfbe('0x1a');if(_0x58cf55){logger[_0xbfbe('0x26')](_0xbfbe('0x2b'),_0x573968[_0xbfbe('0x25')],_0x140882['id']);_0x45f4d1[_0x22f6ba]=_[_0xbfbe('0xe')](_0x573968[_0xbfbe('0x16')])?_0x573968[_0xbfbe('0x18')]:_0x573968[_0xbfbe('0x17')];if(_[_0xbfbe('0xe')](_0x573968[_0xbfbe('0x16')])){_0x45f4d1[_0xbfbe('0x2c')]=_0x573968[_0xbfbe('0x2d')]&&_0x573968[_0xbfbe('0x2d')]!==_0xbfbe('0x2e')?_0x573968[_0xbfbe('0x2d')]:'Unknown';}else{_0x45f4d1['firstName']=_0x573968[_0xbfbe('0x2f')]&&_0x573968[_0xbfbe('0x2f')]!==''?_0x573968['destcalleridname']:_0xbfbe('0x30');}return BPromise[_0xbfbe('0x20')]()[_0xbfbe('0x21')](cmContactRpc['createContact'](_0x45f4d1))[_0xbfbe('0x21')](function(_0x2bf884){_0x3c00da=_0x2bf884;_0x3092f8[_0xbfbe('0x31')](_0x2bf884);if(_0x3c00da){logger['info'](_0xbfbe('0x32'),_0x573968['uniqueid'],_0x140882['id'],_0x3c00da['id']);}return;});}else{logger['info']('[CM][%s][%s]\x20Autocreate\x20disabled',_0x573968[_0xbfbe('0x25')],_0x140882['id']);_0x45f4d1[_0x22f6ba]=_[_0xbfbe('0xe')](_0x573968[_0xbfbe('0x16')])?_0x573968[_0xbfbe('0x18')]:_0x573968[_0xbfbe('0x17')];if(_[_0xbfbe('0xe')](_0x573968[_0xbfbe('0x16')])){_0x45f4d1['firstName']=_0x573968[_0xbfbe('0x2d')]&&_0x573968[_0xbfbe('0x2d')]!==_0xbfbe('0x2e')?_0x573968['calleridname']:_0xbfbe('0x30');}else{_0x45f4d1[_0xbfbe('0x2c')]=_0x573968['destcalleridname']&&_0x573968[_0xbfbe('0x2f')]!==_0xbfbe('0x2e')?_0x573968[_0xbfbe('0x2f')]:_0xbfbe('0x30');}_0x3c00da=_0x45f4d1;_0x3092f8['push'](_0x45f4d1);return;}}})[_0xbfbe('0x21')](function(){if(_0x2de902){emit(_0x573968[_0xbfbe('0x25')],_0x140882,util[_0xbfbe('0x33')](_0xbfbe('0x34'),_0x2de902[_0xbfbe('0x35')]),util[_0xbfbe('0x33')](_0xbfbe('0x36'),_0x16a4ff[_0xbfbe('0x37')]['toLowerCase']()),{'evt':_[_0xbfbe('0x38')](_0x573968,{'autoCreate':_0x58cf55}),'contact':_0x3c00da===undefined?{}:_0x3c00da,'contacts':_0x3092f8[_0xbfbe('0x23')]===0x0?undefined:_0x3092f8});}});}; \ No newline at end of file +var _0x004d=['union','resolve','then','getContacts','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','calleridname','Unknown','destcalleridname','','createContact','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','push','format','user:%s','name','trigger:%s','action','toLowerCase','merge','lodash','ioredis','util','../../../../config/environment','../../../../config/logger','trigger','redis','defaults','socket.io-emitter','info','[CM][%s][%s]','stringify','data1','data2','isNil','data5','xmd-contactid','data3','phone','map','routeId','calleridnum','firstName','mobile','fax','createdAt','scheduledAt'];(function(_0x266140,_0x19bd8d){var _0x288715=function(_0x3d03f3){while(--_0x3d03f3){_0x266140['push'](_0x266140['shift']());}};_0x288715(++_0x19bd8d);}(_0x004d,0xc1));var _0xd004=function(_0x4823d6,_0x2a015d){_0x4823d6=_0x4823d6-0x0;var _0x147e8c=_0x004d[_0x4823d6];return _0x147e8c;};'use strict';var _=require(_0xd004('0x0'));var BPromise=require('bluebird');var Redis=require(_0xd004('0x1'));var util=require(_0xd004('0x2'));var config=require(_0xd004('0x3'));var logger=require(_0xd004('0x4'))(_0xd004('0x5'));var cmContactRpc=require('../../rpc/cmContact');config[_0xd004('0x6')]=_[_0xd004('0x7')](config[_0xd004('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0xd004('0x8'))(new Redis(config[_0xd004('0x6')]));function emit(_0x25d7ec,_0x4d5297,_0x56f9c4,_0x8483ba,_0x3ed7b0){logger[_0xd004('0x9')](_0xd004('0xa'),_0x25d7ec,_0x4d5297['id'],_0x56f9c4,_0x8483ba,JSON[_0xd004('0xb')](_0x3ed7b0));io['to'](_0x56f9c4)['emit'](_0x8483ba,_0x3ed7b0);}exports['exec']=function(_0x452948,_0x96943d,_0x330fd5,_0x15b775){var _0x24efe6,_0x49f4ee;var _0x41bc3b={};var _0x2c7169;var _0x4df5e3=Number(_0x330fd5[_0xd004('0xc')]);var _0x278068=_0x330fd5[_0xd004('0xd')]?Boolean(Number(_0x330fd5['data2'])):![];var _0x320bba;var _0x237d21=![];if(!_[_0xd004('0xe')](_0x330fd5[_0xd004('0xf')])){if(_0x330fd5[_0xd004('0xf')]=='1')_0x237d21=!![];}if(!_0x237d21){if(_0x15b775[_0xd004('0x10')]){_0x41bc3b['id']=_0x15b775[_0xd004('0x10')];}}if(!_0x41bc3b['id']){_0x41bc3b['ListId']=_0x4df5e3;_0x320bba=_0x330fd5[_0xd004('0x11')]&&_0x330fd5[_0xd004('0x11')]!=='0'?_0x330fd5['data3']['split'](','):[_0xd004('0x12')];_0x41bc3b['$or']=_[_0xd004('0x13')](_0x320bba,function(_0x152cff){var _0x10f112={};_0x10f112[_0x152cff]=_0x15b775[_0xd004('0x14')]?_0x15b775['destcalleridnum']:_0x15b775[_0xd004('0x15')];return _0x10f112;});_0x2c7169=_0x15b775[_0xd004('0x14')]?_0x15b775['destcalleridnum']:_0x15b775['calleridnum'];}var _0x4132e0=['id',_0xd004('0x16'),'lastName',_0xd004('0x12'),_0xd004('0x17'),_0xd004('0x18'),'ListId',_0xd004('0x19'),_0xd004('0x1a'),'updatedAt'];var _0x3fc8da=_[_0xd004('0x1b')](_0x4132e0,_0x320bba);BPromise[_0xd004('0x1c')]()[_0xd004('0x1d')](cmContactRpc[_0xd004('0x1e')]({'attributes':_0x3fc8da,'where':_0x41bc3b,'phone':_0x2c7169}))[_0xd004('0x1d')](function(_0x21959a){_0x49f4ee=_0x21959a;if(!_[_0xd004('0x1f')](_0x49f4ee)){if(_0x49f4ee[_0xd004('0x20')]===0x1){_0x24efe6=_0x49f4ee[0x0];logger[_0xd004('0x9')](_0xd004('0x21'),_0x15b775[_0xd004('0x22')],_0x96943d['id'],_0x24efe6['id']);}else{logger[_0xd004('0x9')](_0xd004('0x23'),_0x15b775[_0xd004('0x22')],_0x96943d['id'],_['map'](_0x49f4ee,'id')[_0xd004('0x24')](','));}return;}else{logger['info'](_0xd004('0x25'),_0x15b775[_0xd004('0x22')],_0x96943d['id']);var _0x118883={'ListId':_0x4df5e3};var _0x4e985c=_0x330fd5[_0xd004('0x26')]&&_0x330fd5[_0xd004('0x26')]!=='0'?_0x330fd5['data4']:_0xd004('0x12');if(_0x278068){logger[_0xd004('0x9')](_0xd004('0x27'),_0x15b775[_0xd004('0x22')],_0x96943d['id']);_0x118883[_0x4e985c]=_[_0xd004('0xe')](_0x15b775[_0xd004('0x14')])?_0x15b775[_0xd004('0x15')]:_0x15b775['destcalleridnum'];if(_[_0xd004('0xe')](_0x15b775[_0xd004('0x14')])){_0x118883[_0xd004('0x16')]=_0x15b775[_0xd004('0x28')]&&_0x15b775[_0xd004('0x28')]!==''?_0x15b775['calleridname']:_0xd004('0x29');}else{_0x118883[_0xd004('0x16')]=_0x15b775[_0xd004('0x2a')]&&_0x15b775[_0xd004('0x2a')]!==_0xd004('0x2b')?_0x15b775[_0xd004('0x2a')]:'Unknown';}return BPromise[_0xd004('0x1c')]()[_0xd004('0x1d')](cmContactRpc[_0xd004('0x2c')](_0x118883))[_0xd004('0x1d')](function(_0x541110){_0x24efe6=_0x541110;_0x49f4ee['push'](_0x541110);if(_0x24efe6){logger[_0xd004('0x9')](_0xd004('0x2d'),_0x15b775[_0xd004('0x22')],_0x96943d['id'],_0x24efe6['id']);}return;});}else{logger[_0xd004('0x9')](_0xd004('0x2e'),_0x15b775[_0xd004('0x22')],_0x96943d['id']);_0x118883[_0x4e985c]=_[_0xd004('0xe')](_0x15b775[_0xd004('0x14')])?_0x15b775[_0xd004('0x15')]:_0x15b775['destcalleridnum'];if(_['isNil'](_0x15b775[_0xd004('0x14')])){_0x118883[_0xd004('0x16')]=_0x15b775[_0xd004('0x28')]&&_0x15b775[_0xd004('0x28')]!==''?_0x15b775['calleridname']:_0xd004('0x29');}else{_0x118883[_0xd004('0x16')]=_0x15b775[_0xd004('0x2a')]&&_0x15b775[_0xd004('0x2a')]!==_0xd004('0x2b')?_0x15b775[_0xd004('0x2a')]:'Unknown';}_0x24efe6=_0x118883;_0x49f4ee[_0xd004('0x2f')](_0x118883);return;}}})[_0xd004('0x1d')](function(){if(_0x452948){emit(_0x15b775[_0xd004('0x22')],_0x96943d,util[_0xd004('0x30')](_0xd004('0x31'),_0x452948[_0xd004('0x32')]),util[_0xd004('0x30')](_0xd004('0x33'),_0x330fd5[_0xd004('0x34')][_0xd004('0x35')]()),{'evt':_[_0xd004('0x36')](_0x15b775,{'autoCreate':_0x278068}),'contact':_0x24efe6===undefined?{}:_0x24efe6,'contacts':_0x49f4ee[_0xd004('0x20')]===0x0?undefined:_0x49f4ee});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index 54c6382..1aff807 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 _0xdd66=['custom:dialbegin','custom:dialconnect','syncAgentDial','custom:dialend','custom:closedinteraction','custom:substatus','custom:outgoingmessage','custom:acceptmessage','custom:rejectmessage','prototype','emit','info','clone','motionChannel','undefined','voice','debug','inspect','interface','checkTriggers','status','checkTrigger','merge','variables','Actions','action','toLowerCase','contactmanager','motionbar','browser','data1','TemplateId','data2','html','render','template\x20not\x20found','uri','buildUri','isNil','data3','data4','location','uriLocation','windowWidth','data5','800','windowHeight','data6','winApplication','winArguments','format','user:%s','name','trigger:%s:%s','jscripty','trigger:%s','exec','integration','queue','script','parse','query','search','AllConditions','length','checkConditions','channel','AnyConditions','some','checkTrigger:\x20trigger','field','ChatWebsiteId','value','upperFirst','AccountId','operator','message','event','agent','membername','lastevent','routeId','null','substatus','offlineMessage','exports','lodash','url','mustache','./urlforward','./integration','./script','../../../config/environment','../../../config/logger','trigger','redis','localhost','socket.io-emitter','popup','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','custom:agentcalled','custom:agentconnect','custom:agentringnoanswer','bind','syncCustomEvent','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentbusy','custom:agentcongestion','custom:agentreject','custom:amd','custom:queuecallerabandon'];(function(_0x43ea68,_0x1da2a0){var _0x1f7293=function(_0x26b878){while(--_0x26b878){_0x43ea68['push'](_0x43ea68['shift']());}};_0x1f7293(++_0x1da2a0);}(_0xdd66,0xd6));var _0x6dd6=function(_0x4a4afc,_0xba2897){_0x4a4afc=_0x4a4afc-0x0;var _0x42a11b=_0xdd66[_0x4a4afc];return _0x42a11b;};'use strict';var util=require('util');var _=require(_0x6dd6('0x0'));var url=require(_0x6dd6('0x1'));var Mustache=require(_0x6dd6('0x2'));var Redis=require('ioredis');var urlforward=require(_0x6dd6('0x3'));var integration=require(_0x6dd6('0x4'));var cmContact=require('./cmContact');var script=require(_0x6dd6('0x5'));var config=require(_0x6dd6('0x6'));var logger=require(_0x6dd6('0x7'))(_0x6dd6('0x8'));var ami=require('../ami');config['redis']=_['defaults'](config[_0x6dd6('0x9')],{'host':_0x6dd6('0xa'),'port':0x18eb});var io=require(_0x6dd6('0xb'))(new Redis(config[_0x6dd6('0x9')]));var operators={'equals':function(_0x1debc6,_0xecaa79){return _0x1debc6==_0xecaa79;},'not_equals':function(_0x17a2d0,_0xd44831){return _0x17a2d0!=_0xd44831;}};var barAndWebActions=[_0x6dd6('0xc'),'url',_0x6dd6('0xd')];function Trigger(_0x5ba86a){this[_0x6dd6('0xe')]=_0x5ba86a[_0x6dd6('0xe')];this[_0x6dd6('0xf')]=_0x5ba86a[_0x6dd6('0xf')];this[_0x6dd6('0x10')]=_0x5ba86a['voiceQueues'];this[_0x6dd6('0x11')]=_0x5ba86a['templates'];this['voiceExtensions']=_0x5ba86a[_0x6dd6('0x12')];this[_0x6dd6('0x13')]=_0x5ba86a[_0x6dd6('0x13')];this[_0x6dd6('0x14')]=_0x5ba86a['freshdeskAccounts'];this[_0x6dd6('0x15')]=_0x5ba86a[_0x6dd6('0x15')];this[_0x6dd6('0x16')]=_0x5ba86a[_0x6dd6('0x16')];this[_0x6dd6('0x17')]=_0x5ba86a[_0x6dd6('0x17')];this[_0x6dd6('0x18')]=_0x5ba86a[_0x6dd6('0x18')];this[_0x6dd6('0x19')]=_0x5ba86a[_0x6dd6('0x19')];this[_0x6dd6('0x1a')]=_0x5ba86a[_0x6dd6('0x1a')];this[_0x6dd6('0x1b')]=_0x5ba86a[_0x6dd6('0x1b')];this[_0x6dd6('0x1c')]=_0x5ba86a[_0x6dd6('0x1c')];this[_0x6dd6('0x1d')]={'zendesk':this[_0x6dd6('0x13')],'salesforce':this[_0x6dd6('0x15')],'freshdesk':this[_0x6dd6('0x14')],'sugarcrm':this[_0x6dd6('0x16')],'zoho':this[_0x6dd6('0x17')],'desk':this[_0x6dd6('0x18')],'vtiger':this[_0x6dd6('0x19')],'dynamics365':this['dynamics365Accounts'],'freshsales':this['freshsalesAccounts'],'servicenow':this[_0x6dd6('0x1a')]};ami['on'](_0x6dd6('0x1e'),this['syncCustomEvent']['bind'](this));ami['on'](_0x6dd6('0x1f'),this['syncCustomEvent']['bind'](this));ami['on'](_0x6dd6('0x20'),this['syncCustomEvent'][_0x6dd6('0x21')](this));ami['on']('custom:agentcomplete',this[_0x6dd6('0x22')]['bind'](this));ami['on'](_0x6dd6('0x23'),this[_0x6dd6('0x22')]['bind'](this));ami['on'](_0x6dd6('0x24'),this[_0x6dd6('0x22')]['bind'](this));ami['on'](_0x6dd6('0x25'),this[_0x6dd6('0x22')][_0x6dd6('0x21')](this));ami['on'](_0x6dd6('0x26'),this['syncCustomEvent'][_0x6dd6('0x21')](this));ami['on'](_0x6dd6('0x27'),this[_0x6dd6('0x22')][_0x6dd6('0x21')](this));ami['on'](_0x6dd6('0x28'),this[_0x6dd6('0x22')][_0x6dd6('0x21')](this));ami['on'](_0x6dd6('0x29'),this['syncCustomEvent']['bind'](this));ami['on']('custom:timeout',this['syncCustomEvent'][_0x6dd6('0x21')](this));ami['on'](_0x6dd6('0x2a'),this['syncAgentDial'][_0x6dd6('0x21')](this));ami['on'](_0x6dd6('0x2b'),this[_0x6dd6('0x2c')]['bind'](this));ami['on'](_0x6dd6('0x2d'),this['syncAgentDial'][_0x6dd6('0x21')](this));ami['on']('custom:newinteraction',this['syncCustomEvent']['bind'](this));ami['on'](_0x6dd6('0x2e'),this['syncCustomEvent'][_0x6dd6('0x21')](this));ami['on'](_0x6dd6('0x2f'),this['syncCustomEvent'][_0x6dd6('0x21')](this));ami['on']('custom:incomingmessage',this[_0x6dd6('0x22')][_0x6dd6('0x21')](this));ami['on'](_0x6dd6('0x30'),this['syncCustomEvent'][_0x6dd6('0x21')](this));ami['on'](_0x6dd6('0x31'),this[_0x6dd6('0x22')]['bind'](this));ami['on'](_0x6dd6('0x32'),this[_0x6dd6('0x22')][_0x6dd6('0x21')](this));ami['on']('custom:offlineMessage',this[_0x6dd6('0x22')]['bind'](this));}Trigger[_0x6dd6('0x33')][_0x6dd6('0x34')]=function(_0x22d4ca,_0x5b8633,_0x45b778){logger[_0x6dd6('0x35')](_0x22d4ca,_0x5b8633,JSON['stringify'](_0x45b778));io['to'](_0x22d4ca)['emit'](_0x5b8633,_0x45b778);};Trigger[_0x6dd6('0x33')][_0x6dd6('0x22')]=function(_0x3dfaac){var _0x17c40b=_[_0x6dd6('0x36')](_0x3dfaac);if(typeof _0x17c40b[_0x6dd6('0x37')]===_0x6dd6('0x38')){_0x17c40b['motionChannel']=_0x6dd6('0x39');}logger[_0x6dd6('0x3a')](_0x6dd6('0x22'),util[_0x6dd6('0x3b')](_0x17c40b,{'showHidden':!![],'depth':null}));this['checkTriggers'](_0x17c40b);};Trigger['prototype']['syncAgentDial']=function(_0x3c7ec8){if(this['agents'][_0x3c7ec8[_0x6dd6('0x3c')]]){this['syncCustomEvent'](_0x3c7ec8);}};Trigger[_0x6dd6('0x33')][_0x6dd6('0x3d')]=function(_0x3dde02){var _0x1be198;for(var _0x1f725e in this[_0x6dd6('0xe')]){if(this['triggers']['hasOwnProperty'](_0x1f725e)){if(this[_0x6dd6('0xe')][_0x1f725e][_0x6dd6('0x3e')]){_0x1be198=this[_0x6dd6('0x3f')](this[_0x6dd6('0xe')][_0x1f725e],_0x3dde02);if(_0x1be198){_[_0x6dd6('0x40')](_0x3dde02,_0x3dde02[_0x6dd6('0x41')]);for(var _0x37bd4a=0x0,_0x4e9ec0,_0x244e51,_0x170194;_0x37bd4a0x0){_0x11c1eb=_[_0x7995('0x2b')](_0xf16cc2,_0x132a42);}return _0x11c1eb;}function getCustomFields(_0x514445,_0x456a28){var _0x3250e0=[];var _0x4253e5={'custom_fields':{}};if(_0x514445['length']>0x0){_['forEach'](_0x514445,function(_0x48e573){if(_[_0x7995('0x2c')]([_0x7995('0x2d'),_0x7995('0x2e')],_0x48e573[_0x7995('0x2f')])&&_0x48e573[_0x7995('0x30')]&&!_0x48e573[_0x7995('0x31')]){_0x4253e5[_0x48e573['nameField']['toLowerCase']()]=_0x48e573[_0x7995('0x32')]['toString']();}else if(_[_0x7995('0x2c')]([_0x7995('0x2d'),_0x7995('0x2e')],_0x48e573[_0x7995('0x2f')])&&_0x48e573[_0x7995('0x33')]&&_0x48e573['customField']){_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x48e573['content']['toString']();}else if(_0x48e573['type']===_0x7995('0x35')&&_0x48e573[_0x7995('0x36')]&&_0x48e573['idField']&&_0x48e573[_0x7995('0x31')]){_0x456a28[_0x48e573['variableName']]&&(_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x456a28[_0x48e573[_0x7995('0x36')]]['toString']());}else if(_0x48e573['type']===_0x7995('0x37')&&_0x48e573['Variable']&&_0x48e573['Variable'][_0x7995('0x38')]&&_0x48e573[_0x7995('0x33')]&&_0x48e573['customField']){_0x456a28[_0x48e573[_0x7995('0x39')][_0x7995('0x38')][_0x7995('0x3a')]()]&&(_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x456a28[_0x48e573['Variable'][_0x7995('0x38')][_0x7995('0x3a')]()][_0x7995('0x22')]());}});}if(_0x4253e5[_0x7995('0x3b')]){_0x4253e5['priority']=Number(_0x4253e5[_0x7995('0x3b')]);}return _0x4253e5;}function getTicket(_0x235df7,_0x3eb04f,_0xe5ea43,_0x1f5bee,_0x1035dc){logger['info'](_0x7995('0x3c'));var _0x3be298=_[_0x7995('0x3d')]({'subject':intUtil[_0x7995('0x3e')](_0x1f5bee[_0x7995('0x3f')],_0x1035dc,'\x20'),'type':_0x7995('0x40'),'status':_0x7995('0x41'),'labels':[_0x7995('0x42'),_0x7995('0x43'),_0x7995('0x44')][_0x7995('0x45')](getTags(_0x1f5bee[_0x7995('0x46')],_0x7995('0x38'))),'description':intUtil['getString'](_0x1f5bee['Descriptions'],_0x1035dc,'\x0a'),'_links':{'assigned_user':{'href':util[_0x7995('0x11')](_0x7995('0x47'),_0x3eb04f['id']),'class':'user'}},'message':{'direction':'in','body':intUtil['getString'](_0x1f5bee[_0x7995('0x48')],_0x1035dc,'\x0a')}},getCustomFields(_0x1f5bee['Fields'],_0x1035dc));return request({'uri':util['format'](_0x7995('0x49'),_0x235df7[_0x7995('0x12')],_0xe5ea43['id']),'method':_0x7995('0x29'),'body':_0x3be298});}exports['queue']=function(_0x46ac4f,_0x5e85b9,_0x3993b5,_0x5a8881,_0x493066,_0x39c5b8){var _0x403f54,_0xc04e5;_0x39c5b8[_0x7995('0x12')]=intUtil['stripTrailingSlash'](_0x39c5b8[_0x7995('0x12')]);_0x39c5b8[_0x7995('0x4a')]=intUtil[_0x7995('0x4b')](_0x39c5b8[_0x7995('0x4a')]);if(_0x493066&&_0x493066['monitor_format']){logger['info'](_0x7995('0x4c'),'Recording\x20is\x20enabled!');_0x5e85b9[_0x7995('0x4d')]=util['format'](_0x7995('0x4e'),_0x39c5b8['serverUrl'],_0x5e85b9[_0x7995('0x4f')],md5(_0x5e85b9[_0x7995('0x4f')]));}else{_0x5e85b9['recordingURL']='';}headers[_0x7995('0x50')]=getAuth(_0x39c5b8);return getUser(_0x39c5b8,_0x5a8881[_0x7995('0x51')])[_0x7995('0x13')](function(_0xb70a51){_0x403f54=_0xb70a51;logger['info'](_0x7995('0x52'),_0x403f54['id']);return getEndUser(_0x39c5b8,_0x5e85b9[_0x7995('0x53')],_0x5e85b9[_0x7995('0x54')]);})['then'](function(_0xe228a5){_0xc04e5=_0xe228a5;logger[_0x7995('0xf')](_0x7995('0x55'),_0xc04e5['id']);return getTicket(_0x39c5b8,_0x403f54,_0xc04e5,_0x3993b5,_0x5e85b9);})[_0x7995('0x13')](function(_0x255313){if(_0x255313){logger['info'](_0x7995('0x56'));logger[_0x7995('0xf')]('The\x20Ticket\x20ID\x20is:',_0x255313['id']);switch(_0x39c5b8[_0x7995('0x2f')]){case'integrationTab':logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x57'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x5a8881[_0x7995('0x38')]),_0x7995('0x59'),{'recordId':_0x255313['id']});break;case'newTab':logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x5a'));emit(util['format'](_0x7995('0x58'),_0x5a8881[_0x7995('0x38')]),_0x7995('0x5b'),{'uri':util['format']('https://xcally.desk.com/web/agent/case/%d',_0x255313['id'])});break;default:logger['error'](_0x7995('0x4c'),_0x7995('0x5c'));}}})['catch'](function(_0x1cd85){console[_0x7995('0x5d')](_0x1cd85);logger[_0x7995('0x5d')](_0x7995('0x4c'),JSON[_0x7995('0x1c')](_0x1cd85));});};exports['outbound']=function(_0x29ee32,_0x4ab09f,_0x14fe7f,_0x33c801,_0x206d2a,_0x50c7b5,_0x5e1f34){var _0x54e2b1,_0x563f8e;_0x50c7b5[_0x7995('0x12')]=intUtil[_0x7995('0x4b')](_0x50c7b5[_0x7995('0x12')]);_0x50c7b5[_0x7995('0x4a')]=intUtil[_0x7995('0x4b')](_0x50c7b5[_0x7995('0x4a')]);if(_0x5e1f34&&_0x5e1f34[_0x7995('0x5e')]&&_0x5e1f34[_0x7995('0x5e')]!==_0x7995('0x5f')){logger[_0x7995('0xf')](_0x7995('0x60'),_0x7995('0x61'));_0x4ab09f[_0x7995('0x4d')]=util[_0x7995('0x11')](_0x7995('0x4e'),_0x50c7b5[_0x7995('0x4a')],_0x4ab09f[_0x7995('0x4f')],md5(_0x4ab09f[_0x7995('0x4f')]));}headers[_0x7995('0x50')]=getAuth(_0x50c7b5);return getUser(_0x50c7b5,_0x33c801['email'])[_0x7995('0x13')](function(_0x630737){_0x54e2b1=_0x630737;logger[_0x7995('0xf')](_0x7995('0x52'),_0x54e2b1['id']);return getEndUser(_0x50c7b5,_0x4ab09f['destcalleridname'],_0x4ab09f['destcalleridnum']);})[_0x7995('0x13')](function(_0x197b52){_0x563f8e=_0x197b52;logger[_0x7995('0xf')](_0x7995('0x55'),_0x563f8e['id']);return getTicket(_0x50c7b5,_0x54e2b1,_0x563f8e,_0x14fe7f,_0x4ab09f);})['then'](function(_0x13cd7b){if(_0x13cd7b){logger[_0x7995('0xf')](_0x7995('0x56'));logger[_0x7995('0xf')]('The\x20Ticket\x20ID\x20is:',_0x13cd7b['id']);switch(_0x50c7b5['type']){case _0x7995('0x62'):logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x57'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x33c801[_0x7995('0x38')]),_0x7995('0x59'),{'recordId':_0x13cd7b['id']});break;case _0x7995('0x63'):logger['info'](_0x7995('0x4c'),_0x7995('0x5a'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x33c801['name']),'trigger:browser:url',{'uri':util[_0x7995('0x11')](_0x7995('0x64'),_0x50c7b5['remoteUri'],_0x13cd7b['id'])});break;default:logger[_0x7995('0x5d')](_0x7995('0x60'),_0x7995('0x5c'));}}})[_0x7995('0x65')](function(_0x32cb04){logger['error'](_0x7995('0x60'),JSON['stringify'](_0x32cb04));});};exports[_0x7995('0x66')]=function(_0xe31dcb,_0x1722e2,_0x25b534,_0x4388c1,_0xeb8920,_0x2b3c1d){var _0x44372a,_0x10f012;_0x2b3c1d[_0x7995('0x12')]=intUtil[_0x7995('0x4b')](_0x2b3c1d[_0x7995('0x12')]);_0x2b3c1d['serverUrl']=intUtil[_0x7995('0x4b')](_0x2b3c1d[_0x7995('0x4a')]);if(_0xeb8920&&_0xeb8920[_0x7995('0x67')]){logger[_0x7995('0xf')]('['+_0x1722e2[_0x7995('0x68')]['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x1722e2[_0x7995('0x4d')]=util[_0x7995('0x11')](_0x7995('0x4e'),_0x2b3c1d[_0x7995('0x4a')],_0x1722e2['uniqueid'],md5(_0x1722e2[_0x7995('0x4f')]));}else{_0x1722e2['recordingURL']='';}headers['Authorization']=getAuth(_0x2b3c1d);return getUser(_0x2b3c1d)[_0x7995('0x13')](function(_0x36d27d){_0x44372a=_0x36d27d;logger[_0x7995('0xf')](_0x7995('0x52'),_0x44372a['id']);return getEndUser(_0x2b3c1d,_0x1722e2[_0x7995('0x53')],_0x1722e2[_0x7995('0x54')]);})[_0x7995('0x13')](function(_0x13dc73){_0x10f012=_0x13dc73;logger[_0x7995('0xf')](_0x7995('0x55'),_0x10f012['id']);return getTicket(_0x2b3c1d,_0x44372a,_0x10f012,_0x25b534,_0x1722e2);})['then'](function(_0x2dc1f7){if(_0x2dc1f7){logger[_0x7995('0xf')](_0x7995('0x56'));logger['info'](_0x7995('0x69'),_0x2dc1f7['id']);}})[_0x7995('0x65')](function(_0x705f0){logger[_0x7995('0x5d')]('['+_0x1722e2[_0x7995('0x68')][_0x7995('0x6a')]()+']',JSON[_0x7995('0x1c')](_0x705f0));});}; \ No newline at end of file +var _0x814b=['calleridname','toUpperCase','lodash','request-promise','md5','util','ioredis','./util','../../../../config/logger','desk','redis','defaults','localhost','emit','application/json','validateEmail','info','Getting\x20agent\x20with\x20email','format','%s/users','then','total_entries','find','_embedded','entries','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me','remoteUri','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','debug','[HTTP]','%s:%s','authType','token','username','Basic\x20%s','toString','base64','Searching\x20enduser\x20with\x20phone','%s/customers/search','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/customers','POST','work','map','length','string','nameField','toLowerCase','content','picklist','idField','customField','custom_fields','type','variableName','customVariable','Variable','name','priority','merge','getString','Subjects','xCALLY','CTI','concat','Tags','Descriptions','/api/v2/users/%d','user','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','Authorization','email','The\x20User\x20ID\x20is:','calleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','integrationTab','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','catch','error','stringify','recordingFormat','none','[OUTBOUND]','destcalleridnum','Displaying\x20ticket\x20to\x20agent...','unmanaged','lastevent'];(function(_0x2c8ef6,_0x107f56){var _0x143f3f=function(_0x678c8a){while(--_0x678c8a){_0x2c8ef6['push'](_0x2c8ef6['shift']());}};_0x143f3f(++_0x107f56);}(_0x814b,0x1a2));var _0xb814=function(_0x3bc82d,_0x59187f){_0x3bc82d=_0x3bc82d-0x0;var _0x2cfb3d=_0x814b[_0x3bc82d];return _0x2cfb3d;};'use strict';var _=require(_0xb814('0x0'));var rp=require(_0xb814('0x1'));var md5=require(_0xb814('0x2'));var util=require(_0xb814('0x3'));var Redis=require(_0xb814('0x4'));var intUtil=require(_0xb814('0x5'));var config=require('../../../../config/environment');var logger=require(_0xb814('0x6'))(_0xb814('0x7'));config[_0xb814('0x8')]=_[_0xb814('0x9')](config[_0xb814('0x8')],{'host':_0xb814('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xb814('0x8')]));function emit(_0x2e6272,_0x5c8539,_0x271af9){io['to'](_0x2e6272)[_0xb814('0xb')](_0x5c8539,_0x271af9);}var headers={'Content-Type':_0xb814('0xc'),'Accept':_0xb814('0xc')};function getUser(_0x1fea33,_0x21d4a5){if(intUtil[_0xb814('0xd')](_0x21d4a5)===!![]){logger[_0xb814('0xe')](_0xb814('0xf'),_0x21d4a5);return request({'uri':util[_0xb814('0x10')](_0xb814('0x11'),_0x1fea33['remoteUri'])})[_0xb814('0x12')](function(_0x56278f){if(_0x56278f[_0xb814('0x13')]){return _[_0xb814('0x14')](_0x56278f[_0xb814('0x15')][_0xb814('0x16')],{'email':_0x21d4a5});}})[_0xb814('0x12')](function(_0x3bde14){if(_0x3bde14){logger[_0xb814('0xe')](_0xb814('0x17'));return _0x3bde14;}else{logger[_0xb814('0xe')](_0xb814('0x18'));return request({'uri':util[_0xb814('0x10')](_0xb814('0x19'),_0x1fea33[_0xb814('0x1a')])});}});}else{logger[_0xb814('0xe')](_0xb814('0x1b'));return request({'uri':util[_0xb814('0x10')](_0xb814('0x19'),_0x1fea33[_0xb814('0x1a')])});}}function request(_0x125ce2){logger[_0xb814('0x1c')](_0xb814('0x1d'),JSON['stringify'](_0x125ce2));return rp(_[_0xb814('0x9')](_0x125ce2,{'method':'GET','headers':headers,'json':!![]}));}function getAuth(_0x270598){var _0xfac75b;if(_0x270598['authType']==='basic'){_0xfac75b=util['format'](_0xb814('0x1e'),_0x270598['username'],_0x270598['password']);}else if(_0x270598[_0xb814('0x1f')]===_0xb814('0x20')){_0xfac75b=util[_0xb814('0x10')]('%s/token:%s',_0x270598[_0xb814('0x21')],_0x270598['token']);}return util[_0xb814('0x10')](_0xb814('0x22'),new Buffer(_0xfac75b)[_0xb814('0x23')](_0xb814('0x24')));}function getEndUser(_0x27352e,_0x2bd039,_0x1f5d40){logger['info'](_0xb814('0x25'),_0x1f5d40);return request({'uri':util['format'](_0xb814('0x26'),_0x27352e[_0xb814('0x1a')]),'qs':{'phone':_0x1f5d40}})[_0xb814('0x12')](function(_0x208927){if(_0x208927[_0xb814('0x13')]){logger[_0xb814('0xe')](_0xb814('0x27'));return _0x208927['_embedded'][_0xb814('0x16')][0x0];}else{logger[_0xb814('0xe')](_0xb814('0x28'));return request({'uri':util[_0xb814('0x10')](_0xb814('0x29'),_0x27352e[_0xb814('0x1a')]),'method':_0xb814('0x2a'),'body':{'first_name':_0x2bd039,'title':_0x2bd039,'phone_numbers':[{'type':_0xb814('0x2b'),'value':_0x1f5d40}]}});}});}function getTags(_0x5a6291,_0x271aa8){var _0x328a08=[];if(_0x5a6291&&_0x5a6291['length']>0x0){_0x328a08=_[_0xb814('0x2c')](_0x5a6291,_0x271aa8);}return _0x328a08;}function getCustomFields(_0x37d24d,_0x530744){var _0x499f22=[];var _0x20577b={'custom_fields':{}};if(_0x37d24d[_0xb814('0x2d')]>0x0){_['forEach'](_0x37d24d,function(_0x338a28){if(_['includes']([_0xb814('0x2e'),'picklist'],_0x338a28['type'])&&_0x338a28[_0xb814('0x2f')]&&!_0x338a28['customField']){_0x20577b[_0x338a28[_0xb814('0x2f')][_0xb814('0x30')]()]=_0x338a28[_0xb814('0x31')]['toString']();}else if(_['includes']([_0xb814('0x2e'),_0xb814('0x32')],_0x338a28['type'])&&_0x338a28[_0xb814('0x33')]&&_0x338a28[_0xb814('0x34')]){_0x20577b[_0xb814('0x35')][_0x338a28[_0xb814('0x33')]]=_0x338a28[_0xb814('0x31')][_0xb814('0x23')]();}else if(_0x338a28[_0xb814('0x36')]==='variable'&&_0x338a28[_0xb814('0x37')]&&_0x338a28[_0xb814('0x33')]&&_0x338a28[_0xb814('0x34')]){_0x530744[_0x338a28[_0xb814('0x37')]]&&(_0x20577b[_0xb814('0x35')][_0x338a28['idField']]=_0x530744[_0x338a28[_0xb814('0x37')]]['toString']());}else if(_0x338a28[_0xb814('0x36')]===_0xb814('0x38')&&_0x338a28[_0xb814('0x39')]&&_0x338a28['Variable'][_0xb814('0x3a')]&&_0x338a28[_0xb814('0x33')]&&_0x338a28['customField']){_0x530744[_0x338a28[_0xb814('0x39')][_0xb814('0x3a')][_0xb814('0x30')]()]&&(_0x20577b[_0xb814('0x35')][_0x338a28[_0xb814('0x33')]]=_0x530744[_0x338a28[_0xb814('0x39')]['name'][_0xb814('0x30')]()]['toString']());}});}if(_0x20577b[_0xb814('0x3b')]){_0x20577b['priority']=Number(_0x20577b[_0xb814('0x3b')]);}return _0x20577b;}function getTicket(_0x4b9233,_0x2f8a2e,_0x26675a,_0x54a7fb,_0x4d308a){logger['info']('Creating\x20new\x20ticket...');var _0x17549e=_[_0xb814('0x3c')]({'subject':intUtil[_0xb814('0x3d')](_0x54a7fb[_0xb814('0x3e')],_0x4d308a,'\x20'),'type':'phone','status':'new','labels':[_0xb814('0x3f'),'Motion',_0xb814('0x40')][_0xb814('0x41')](getTags(_0x54a7fb[_0xb814('0x42')],_0xb814('0x3a'))),'description':intUtil[_0xb814('0x3d')](_0x54a7fb[_0xb814('0x43')],_0x4d308a,'\x0a'),'_links':{'assigned_user':{'href':util[_0xb814('0x10')](_0xb814('0x44'),_0x2f8a2e['id']),'class':_0xb814('0x45')}},'message':{'direction':'in','body':intUtil['getString'](_0x54a7fb['Descriptions'],_0x4d308a,'\x0a')}},getCustomFields(_0x54a7fb['Fields'],_0x4d308a));return request({'uri':util[_0xb814('0x10')]('%s/customers/%d/cases',_0x4b9233[_0xb814('0x1a')],_0x26675a['id']),'method':'POST','body':_0x17549e});}exports[_0xb814('0x46')]=function(_0x44ff56,_0x9ef639,_0x2e97cc,_0x4fae23,_0x30fc57,_0x15f01a){var _0x2b23c7,_0x22cf27;_0x15f01a[_0xb814('0x1a')]=intUtil[_0xb814('0x47')](_0x15f01a['remoteUri']);_0x15f01a[_0xb814('0x48')]=intUtil[_0xb814('0x47')](_0x15f01a[_0xb814('0x48')]);if(_0x30fc57&&_0x30fc57[_0xb814('0x49')]){logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x4b'));_0x9ef639['recordingURL']=util['format'](_0xb814('0x4c'),_0x15f01a[_0xb814('0x48')],_0x9ef639[_0xb814('0x4d')],md5(_0x9ef639[_0xb814('0x4d')]));}else{_0x9ef639[_0xb814('0x4e')]='';}headers[_0xb814('0x4f')]=getAuth(_0x15f01a);return getUser(_0x15f01a,_0x4fae23[_0xb814('0x50')])[_0xb814('0x12')](function(_0x2eb9b6){_0x2b23c7=_0x2eb9b6;logger[_0xb814('0xe')](_0xb814('0x51'),_0x2b23c7['id']);return getEndUser(_0x15f01a,_0x9ef639['calleridname'],_0x9ef639[_0xb814('0x52')]);})[_0xb814('0x12')](function(_0x4a76bb){_0x22cf27=_0x4a76bb;logger[_0xb814('0xe')]('The\x20Enduser\x20ID\x20is:',_0x22cf27['id']);return getTicket(_0x15f01a,_0x2b23c7,_0x22cf27,_0x2e97cc,_0x9ef639);})[_0xb814('0x12')](function(_0x37866f){if(_0x37866f){logger[_0xb814('0xe')](_0xb814('0x53'));logger[_0xb814('0xe')](_0xb814('0x54'),_0x37866f['id']);switch(_0x15f01a[_0xb814('0x36')]){case _0xb814('0x55'):logger[_0xb814('0xe')](_0xb814('0x4a'),'Displaying\x20ticket\x20to\x20agent...');emit(util['format'](_0xb814('0x56'),_0x4fae23[_0xb814('0x3a')]),_0xb814('0x57'),{'recordId':_0x37866f['id']});break;case _0xb814('0x58'):logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x59'));emit(util['format'](_0xb814('0x56'),_0x4fae23[_0xb814('0x3a')]),_0xb814('0x5a'),{'uri':util['format'](_0xb814('0x5b'),_0x37866f['id'])});break;default:logger['error'](_0xb814('0x4a'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0xb814('0x5c')](function(_0x3cf8f8){console['error'](_0x3cf8f8);logger[_0xb814('0x5d')](_0xb814('0x4a'),JSON[_0xb814('0x5e')](_0x3cf8f8));});};exports['outbound']=function(_0x3da050,_0x5f0e58,_0x13bdcf,_0x158893,_0x4aed78,_0x39952d,_0x4a3f84){var _0x539be7,_0x3b9709;_0x39952d[_0xb814('0x1a')]=intUtil[_0xb814('0x47')](_0x39952d['remoteUri']);_0x39952d[_0xb814('0x48')]=intUtil['stripTrailingSlash'](_0x39952d[_0xb814('0x48')]);if(_0x4a3f84&&_0x4a3f84[_0xb814('0x5f')]&&_0x4a3f84['recordingFormat']!==_0xb814('0x60')){logger['info'](_0xb814('0x61'),_0xb814('0x4b'));_0x5f0e58[_0xb814('0x4e')]=util[_0xb814('0x10')](_0xb814('0x4c'),_0x39952d[_0xb814('0x48')],_0x5f0e58[_0xb814('0x4d')],md5(_0x5f0e58[_0xb814('0x4d')]));}headers['Authorization']=getAuth(_0x39952d);return getUser(_0x39952d,_0x158893[_0xb814('0x50')])[_0xb814('0x12')](function(_0x5d71d5){_0x539be7=_0x5d71d5;logger[_0xb814('0xe')](_0xb814('0x51'),_0x539be7['id']);return getEndUser(_0x39952d,_0x5f0e58['destcalleridname'],_0x5f0e58[_0xb814('0x62')]);})['then'](function(_0x48362c){_0x3b9709=_0x48362c;logger[_0xb814('0xe')]('The\x20Enduser\x20ID\x20is:',_0x3b9709['id']);return getTicket(_0x39952d,_0x539be7,_0x3b9709,_0x13bdcf,_0x5f0e58);})[_0xb814('0x12')](function(_0xd1cd8b){if(_0xd1cd8b){logger[_0xb814('0xe')]('Ticket\x20created!');logger[_0xb814('0xe')]('The\x20Ticket\x20ID\x20is:',_0xd1cd8b['id']);switch(_0x39952d[_0xb814('0x36')]){case _0xb814('0x55'):logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x63'));emit(util[_0xb814('0x10')](_0xb814('0x56'),_0x158893[_0xb814('0x3a')]),_0xb814('0x57'),{'recordId':_0xd1cd8b['id']});break;case'newTab':logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x59'));emit(util[_0xb814('0x10')](_0xb814('0x56'),_0x158893[_0xb814('0x3a')]),'trigger:browser:url',{'uri':util[_0xb814('0x10')]('%s/agent/tickets/%s',_0x39952d[_0xb814('0x1a')],_0xd1cd8b['id'])});break;default:logger[_0xb814('0x5d')](_0xb814('0x61'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0xb814('0x5c')](function(_0x579351){logger[_0xb814('0x5d')]('[OUTBOUND]',JSON[_0xb814('0x5e')](_0x579351));});};exports[_0xb814('0x64')]=function(_0xa03cd2,_0x1b024f,_0x3377d4,_0x167d82,_0x143518,_0x4d44e3){var _0x44088d,_0x51ca51;_0x4d44e3[_0xb814('0x1a')]=intUtil[_0xb814('0x47')](_0x4d44e3[_0xb814('0x1a')]);_0x4d44e3[_0xb814('0x48')]=intUtil[_0xb814('0x47')](_0x4d44e3[_0xb814('0x48')]);if(_0x143518&&_0x143518['monitor_format']){logger[_0xb814('0xe')]('['+_0x1b024f[_0xb814('0x65')]['toUpperCase']()+']',_0xb814('0x4b'));_0x1b024f[_0xb814('0x4e')]=util[_0xb814('0x10')](_0xb814('0x4c'),_0x4d44e3[_0xb814('0x48')],_0x1b024f['uniqueid'],md5(_0x1b024f[_0xb814('0x4d')]));}else{_0x1b024f['recordingURL']='';}headers[_0xb814('0x4f')]=getAuth(_0x4d44e3);return getUser(_0x4d44e3)[_0xb814('0x12')](function(_0x2645f6){_0x44088d=_0x2645f6;logger[_0xb814('0xe')](_0xb814('0x51'),_0x44088d['id']);return getEndUser(_0x4d44e3,_0x1b024f[_0xb814('0x66')],_0x1b024f['calleridnum']);})['then'](function(_0x5d064b){_0x51ca51=_0x5d064b;logger[_0xb814('0xe')]('The\x20Enduser\x20ID\x20is:',_0x51ca51['id']);return getTicket(_0x4d44e3,_0x44088d,_0x51ca51,_0x3377d4,_0x1b024f);})[_0xb814('0x12')](function(_0x1d3954){if(_0x1d3954){logger[_0xb814('0xe')]('Ticket\x20created!');logger[_0xb814('0xe')](_0xb814('0x54'),_0x1d3954['id']);}})[_0xb814('0x5c')](function(_0x5aabbe){logger[_0xb814('0x5d')]('['+_0x1b024f[_0xb814('0x65')][_0xb814('0x67')]()+']',JSON[_0xb814('0x5e')](_0x5aabbe));});}; \ 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 5b17cc8..a26fd15 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 _0x39ff=['Subjects','Descriptions','/contacts(','/systemusers(','Fields','phonecall','callDirection','queue','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','modernAuthentication','stripTrailingSlash','CloudProvider','serverUrl','unmanaged','%s/api/data/v9.0/','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','recordingURL',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:','moduleCreate','additionalSearchContact',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','openNewTab','name','Error\x20running\x20Dynamics365\x20integration','request-promise','util','./util','md5','ioredis','dynamics365','../../../../config/environment','redis','defaults','data7','tenantId','resolve','data5','POST','remoteUri','username','password','clientSecret','then','access_token','catch','error','toUpperCase',']\x20Wrong\x20credentials!','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','value','isNil','validateEmail','email','userEmail','length','internalemailaddress','isdisabled','info',']\x20Agent\x20found\x20','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','toLowerCase','outbound','destcalleridnum','calleridnum','contacts','body','headers','odata-entityid','substring','lastIndexOf','message','telephone1','contacts?$select=','\x20eq\x20\x27','replace','%2b','enduserId','contactid','nothing','forEach','includes','picklist','type','nameField','indexOf','content','ticketType','assign','getString'];(function(_0x5e1938,_0x3f8e97){var _0x278ee7=function(_0x26873a){while(--_0x26873a){_0x5e1938['push'](_0x5e1938['shift']());}};_0x278ee7(++_0x3f8e97);}(_0x39ff,0x90));var _0xf39f=function(_0x4ce0b9,_0x4e1112){_0x4ce0b9=_0x4ce0b9-0x0;var _0x3b750c=_0x39ff[_0x4ce0b9];return _0x3b750c;};'use strict';var _=require('lodash');var rp=require(_0xf39f('0x0'));var util=require(_0xf39f('0x1'));var intUtil=require(_0xf39f('0x2'));var md5=require(_0xf39f('0x3'));var Redis=require(_0xf39f('0x4'));var logger=require('../../../../config/logger')(_0xf39f('0x5'));var config=require(_0xf39f('0x6'));config[_0xf39f('0x7')]=_[_0xf39f('0x8')](config[_0xf39f('0x7')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xf39f('0x7')]));function getAuthToken(_0x4a3c5c,_0x484166,_0x5f4c8a){if(_0x4a3c5c['modernAuthentication']){_0x4a3c5c['remoteUri']=_0x4a3c5c['CloudProvider'][_0xf39f('0x9')];_0x4a3c5c[_0xf39f('0xa')]=_0x4a3c5c['CloudProvider']['data2'];return Promise[_0xf39f('0xb')](_0x4a3c5c['CloudProvider'][_0xf39f('0xc')]);}var _0x17bc38={'method':_0xf39f('0xd'),'uri':_0x484166,'form':{'client_id':_0x4a3c5c['clientId'],'resource':_0x4a3c5c[_0xf39f('0xe')],'username':_0x4a3c5c[_0xf39f('0xf')],'password':_0x4a3c5c[_0xf39f('0x10')],'grant_type':_0xf39f('0x10'),'client_secret':_0x4a3c5c[_0xf39f('0x11')]},'json':!![]};return rp(_0x17bc38)[_0xf39f('0x12')](function(_0xe7df47){return _0xe7df47[_0xf39f('0x13')];})[_0xf39f('0x14')](function(_0x14d144){logger[_0xf39f('0x15')]('['+[_0x5f4c8a[_0xf39f('0x16')]()]+_0xf39f('0x17'));return _0x14d144['message'];});}function getUser(_0x383e53,_0x56f301,_0x9bee23,_0x3c92bc,_0x452a3c,_0x484e8c){return new Promise(function(_0x5ecc00,_0x1ff570){return getAuthToken(_0x56f301,_0x3c92bc,_0x484e8c)[_0xf39f('0x12')](function(_0xe15316){var _0x38158d={'method':_0xf39f('0x18'),'uri':_0x452a3c+_0xf39f('0x19'),'headers':{'Authorization':_0xf39f('0x1a')+_0xe15316,'OData-Version':_0xf39f('0x1b')},'json':!![]};return rp(_0x38158d);})[_0xf39f('0x12')](function(_0x393747){var _0x39b837=_0x393747[_0xf39f('0x1c')];var _0x895273=![];var _0x1d7600=null;if(!_[_0xf39f('0x1d')](_0x9bee23)){if(intUtil[_0xf39f('0x1e')](_0x9bee23[_0xf39f('0x1f')])){_0x383e53[_0xf39f('0x20')]=_0x9bee23[_0xf39f('0x1f')];for(_0x1d7600=0x0;_0x1d7600<_0x39b837[_0xf39f('0x21')];_0x1d7600++){if(_0x39b837[_0x1d7600][_0xf39f('0x22')]===_0x9bee23['email']&&!_0x39b837[_0x1d7600][_0xf39f('0x23')]){_0x895273=!![];logger[_0xf39f('0x24')]('['+[_0x484e8c['toUpperCase']()]+_0xf39f('0x25')+_0x39b837[_0x1d7600][_0xf39f('0x26')]+'!');_0x383e53[_0xf39f('0x27')]=_0x39b837[_0x1d7600]['systemuserid'];}}}}if(!_0x895273){logger[_0xf39f('0x24')]('['+[_0x484e8c[_0xf39f('0x16')]()]+_0xf39f('0x28'));_0x383e53[_0xf39f('0x20')]=_0x56f301[_0xf39f('0xf')];for(_0x1d7600=0x0;_0x1d7600<_0x39b837[_0xf39f('0x21')];_0x1d7600++){if(_0x39b837[_0x1d7600][_0xf39f('0x22')]===_0x56f301[_0xf39f('0xf')]){_0x383e53['userId']=_0x39b837[_0x1d7600][_0xf39f('0x26')];}}}_0x5ecc00(_0x383e53);})[_0xf39f('0x14')](function(_0x5c4f68){_0x1ff570(_0x5c4f68['message']);});});}function createEndUser(_0x3e5ffa,_0x199ed5,_0x5ac17f,_0x23a182,_0x313b80,_0x47652c,_0x376360){return new Promise(function(_0x468efc,_0x520ab3){return getAuthToken(_0x199ed5,_0x5ac17f,_0x47652c)[_0xf39f('0x12')](function(_0x44f4cb){var _0x134029=_0x47652c[_0xf39f('0x29')]()===_0xf39f('0x2a')?_0x313b80[_0xf39f('0x2b')]:_0x313b80[_0xf39f('0x2c')];var _0x21b385={'method':'POST','uri':_0x23a182+_0xf39f('0x2d'),'body':{'fullname':_0x134029,'firstname':_0x134029,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':'/systemusers('+_0x3e5ffa[_0xf39f('0x27')]+')'},'headers':{'Authorization':_0xf39f('0x1a')+_0x44f4cb,'OData-Version':_0xf39f('0x1b')},'json':!![],'resolveWithFullResponse':!![]};_0x21b385[_0xf39f('0x2e')][_0x376360]=_0x134029;return rp(_0x21b385);})[_0xf39f('0x12')](function(_0x3d53d1){var _0x3a0994=_0x3d53d1[_0xf39f('0x2f')][_0xf39f('0x30')];var _0xfaf07b=_0x3a0994[_0xf39f('0x31')](_0x3a0994[_0xf39f('0x32')]('(')+0x1,_0x3a0994['lastIndexOf'](')'));_0x3e5ffa['enduserId']=_0xfaf07b;_0x468efc(_0x3e5ffa);})[_0xf39f('0x14')](function(_0x20c2b2){_0x520ab3(_0x20c2b2[_0xf39f('0x33')]);});});}function getEndUser(_0x58e898,_0x3ee325,_0x1e91e0,_0x347045,_0x5ca147,_0x47b9b5,_0x342768,_0x4337ca){var _0x4e91a3=_0x47b9b5['toLowerCase']()==='outbound'?_0x5ca147[_0xf39f('0x2b')]:_0x5ca147['calleridnum'];return getAuthToken(_0x3ee325,_0x1e91e0,_0x47b9b5)[_0xf39f('0x12')](function(_0x7a27bf){_0x4337ca=_0x4337ca?_0x4337ca:_0xf39f('0x34');var _0x231b5a={'method':'GET','uri':_0x347045+_0xf39f('0x35')+_0x4337ca+'&$filter='+_0x4337ca+_0xf39f('0x36')+_0x4e91a3[_0xf39f('0x37')]('+',_0xf39f('0x38'))+'\x27','headers':{'Authorization':'Bearer\x20'+_0x7a27bf,'If-None-Match':null,'OData-Version':_0xf39f('0x1b')},'json':!![]};return rp(_0x231b5a);})[_0xf39f('0x12')](function(_0x2d8551){var _0x11a653=![];if(!_0x2d8551)return _0x11a653;var _0x4bca0f=_0x2d8551[_0xf39f('0x1c')];for(var _0x39d72e=0x0;_0x39d72e<_0x4bca0f[_0xf39f('0x21')];_0x39d72e++){if(_0x4bca0f[_0x39d72e][_0x4337ca]===_0x4e91a3){_0x11a653=!![];_0x58e898[_0xf39f('0x39')]=_0x4bca0f[_0x39d72e][_0xf39f('0x3a')];}}return _0x11a653;})['then'](function(_0x38eac9){if(_0x38eac9)return _0x58e898;if(_0x342768===_0xf39f('0x3b')){logger[_0xf39f('0x24')]('['+[_0x47b9b5[_0xf39f('0x16')]()]+']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing');return _0x58e898;}return createEndUser(_0x58e898,_0x3ee325,_0x1e91e0,_0x347045,_0x5ca147,_0x47b9b5,_0x4337ca)['then'](function(_0x21c8d8){logger['info']('['+[_0x47b9b5[_0xf39f('0x16')]()]+']\x20Enduser\x20created!',_0x21c8d8[_0xf39f('0x39')]);return _0x21c8d8;});});}function getCustomFields(_0x345d1b,_0x48cc02,_0x345425){var _0x194bcb={};if(_0x345d1b['length']>0x0){_[_0xf39f('0x3c')](_0x345d1b,function(_0x5a7a17){if(_[_0xf39f('0x3d')](['string',_0xf39f('0x3e')],_0x5a7a17[_0xf39f('0x3f')])&&_0x5a7a17[_0xf39f('0x40')]&&!_0x5a7a17['customField']){var _0x213a0f=_0x5a7a17['idField'][_0xf39f('0x29')]();var _0x66b380=_0x213a0f[_0xf39f('0x31')](0x0,_0x213a0f[_0xf39f('0x41')]('_'));var _0x8fd47f=_0x213a0f[_0xf39f('0x31')](_0x213a0f[_0xf39f('0x41')]('_')+0x1);if(_0x66b380===_0x345425){_0x194bcb[_0x8fd47f]=_0x5a7a17[_0xf39f('0x42')];}}});}return _0x194bcb;}function getTicket(_0x1d3866,_0x46e68a,_0x43eef8,_0x52aace,_0x5bc899,_0x43fbf5,_0x1540ac){return new Promise(function(_0x4c1677,_0x6b84){var _0x43ec3a;return getAuthToken(_0x46e68a,_0x43eef8,_0x1540ac)[_0xf39f('0x12')](function(_0x523168){if(_0x43fbf5[_0xf39f('0x43')]==='incident'){_0x43ec3a={'method':_0xf39f('0xd'),'uri':_0x52aace+'incidents','body':Object[_0xf39f('0x44')]({},{'title':intUtil[_0xf39f('0x45')](_0x43fbf5[_0xf39f('0x46')],_0x5bc899,'\x20'),'description':intUtil['getString'](_0x43fbf5[_0xf39f('0x47')],_0x5bc899,'\x0a'),'customerid_contact@odata.bind':_0x1d3866[_0xf39f('0x39')]?_0xf39f('0x48')+_0x1d3866[_0xf39f('0x39')]+')':undefined,'ownerid@odata.bind':_0xf39f('0x49')+_0x1d3866[_0xf39f('0x27')]+')','caseorigincode':'1'},getCustomFields(_0x43fbf5[_0xf39f('0x4a')],_0x5bc899,_0x43fbf5[_0xf39f('0x43')])),'headers':{'Authorization':_0xf39f('0x1a')+_0x523168,'OData-Version':_0xf39f('0x1b')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x43fbf5['ticketType']===_0xf39f('0x4b')){var _0x21821d=_0x1d3866[_0xf39f('0x39')]?[{'partyid_systemuser@odata.bind':_0xf39f('0x49')+_0x1d3866[_0xf39f('0x27')]+')','participationtypemask':_0x1d3866[_0xf39f('0x4c')]===_0xf39f('0x4d')?0x2:0x1},{'partyid_contact@odata.bind':_0xf39f('0x48')+_0x1d3866[_0xf39f('0x39')]+')','participationtypemask':_0x1d3866[_0xf39f('0x4c')]===_0xf39f('0x4d')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':'/systemusers('+_0x1d3866[_0xf39f('0x27')]+')','participationtypemask':_0x1d3866[_0xf39f('0x4c')]==='queue'?0x2:0x1}];_0x43ec3a={'method':_0xf39f('0xd'),'uri':_0x52aace+'phonecalls','body':Object['assign']({},{'subject':intUtil[_0xf39f('0x45')](_0x43fbf5['Subjects'],_0x5bc899,'\x20'),'phonenumber':String(_0x5bc899[_0xf39f('0x2c')]),'description':intUtil[_0xf39f('0x45')](_0x43fbf5['Descriptions'],_0x5bc899,'\x0a'),'regardingobjectid_contact@odata.bind':_0x1d3866[_0xf39f('0x39')]?'/contacts('+_0x1d3866[_0xf39f('0x39')]+')':undefined,'ownerid@odata.bind':_0xf39f('0x49')+_0x1d3866[_0xf39f('0x27')]+')','directioncode':_0x1d3866['callDirection']===_0xf39f('0x4d')?![]:!![],'phonecall_activity_parties':_0x21821d},getCustomFields(_0x43fbf5[_0xf39f('0x4a')],_0x5bc899,_0x43fbf5['ticketType'])),'headers':{'Authorization':_0xf39f('0x1a')+_0x523168,'OData-Version':_0xf39f('0x1b')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x43ec3a);})['then'](function(_0x42d9b7){var _0x49867f=_0x42d9b7['headers'][_0xf39f('0x30')];var _0x299b7b=_0x49867f[_0xf39f('0x31')](_0x49867f['lastIndexOf']('(')+0x1,_0x49867f[_0xf39f('0x32')](')'));_0x1d3866[_0xf39f('0x4e')]=_0x299b7b;_0x4c1677(_0x1d3866);})[_0xf39f('0x14')](function(_0x2323b6){_0x6b84(_0x2323b6['message']);});});}function emit(_0x2ae307,_0x5bb307,_0x35c236,_0x1b44d8){var _0x184251={'uri':util[_0xf39f('0x4f')](_0xf39f('0x50'),_0x2ae307,_0x35c236,_0x1b44d8)};io['to'](util[_0xf39f('0x4f')](_0xf39f('0x51'),_0x5bb307))['emit']('trigger:browser:url',_0x184251);}exports['cs']=function(_0x10e63c,_0x5023ca,_0x13691c,_0x435374,_0x122f41,_0x566ce4,_0x4ee236,_0x3e4ca9){var _0x2e557a={};_0x566ce4['remoteUri']=_0x566ce4[_0xf39f('0x52')]?intUtil[_0xf39f('0x53')](_0x566ce4[_0xf39f('0x54')][_0xf39f('0x9')]):intUtil[_0xf39f('0x53')](_0x566ce4[_0xf39f('0xe')]);_0x566ce4[_0xf39f('0x55')]=intUtil[_0xf39f('0x53')](_0x566ce4[_0xf39f('0x55')]);_0x2e557a[_0xf39f('0x4c')]=_0x3e4ca9===_0xf39f('0x4d')||_0x3e4ca9===_0xf39f('0x56')?_0xf39f('0x4d'):'outbound';var _0x30d235=_0x566ce4[_0xf39f('0x52')]?util[_0xf39f('0x4f')]('%s/api/data/v9.0/',_0x566ce4[_0xf39f('0x54')][_0xf39f('0x9')]):util[_0xf39f('0x4f')](_0xf39f('0x57'),_0x566ce4['remoteUri']);var _0x25b6e0=util[_0xf39f('0x4f')]('https://login.microsoftonline.com/%s/oauth2/token',_0x566ce4[_0xf39f('0xa')]);var _0x2daea7=util[_0xf39f('0x4f')](_0xf39f('0x58'),_0x566ce4[_0xf39f('0x55')],_0x5023ca['uniqueid'],md5(_0x5023ca[_0xf39f('0x59')]));if(_0x122f41&&_0x122f41[_0xf39f('0x5a')]){logger[_0xf39f('0x24')](_0xf39f('0x5b'),_0xf39f('0x5c'));_0x5023ca['recordingURL']=_0x2daea7;}else if(_0x4ee236&&_0x4ee236[_0xf39f('0x5d')]&&_0x4ee236[_0xf39f('0x5d')]!==_0xf39f('0x5e')){logger[_0xf39f('0x24')]('[OUTBOUND]',_0xf39f('0x5c'));_0x5023ca[_0xf39f('0x5f')]=_0x2daea7;}else{_0x5023ca[_0xf39f('0x5f')]='';}return getUser(_0x2e557a,_0x566ce4,_0x435374,_0x25b6e0,_0x30d235,_0x3e4ca9)[_0xf39f('0x12')](function(_0x497d57){logger[_0xf39f('0x24')]('['+_0x3e4ca9[_0xf39f('0x16')]()+_0xf39f('0x60'),_0x497d57[_0xf39f('0x27')]);logger[_0xf39f('0x24')]('['+_0x3e4ca9[_0xf39f('0x16')]()+_0xf39f('0x61'),_0x497d57[_0xf39f('0x20')]);return getEndUser(_0x497d57,_0x566ce4,_0x25b6e0,_0x30d235,_0x5023ca,_0x3e4ca9,_0x13691c[_0xf39f('0x62')],_0x13691c[_0xf39f('0x63')]);})[_0xf39f('0x12')](function(_0x9e8c61){logger['info']('['+_0x3e4ca9[_0xf39f('0x16')]()+_0xf39f('0x64'),_0x9e8c61[_0xf39f('0x39')]);logger['info']('['+_0x3e4ca9[_0xf39f('0x16')]()+_0xf39f('0x65'),_0x5023ca['calleridnum']);return getTicket(_0x9e8c61,_0x566ce4,_0x25b6e0,_0x30d235,_0x5023ca,_0x13691c,_0x3e4ca9);})[_0xf39f('0x12')](function(_0x4fbd7d){logger[_0xf39f('0x24')](util[_0xf39f('0x4f')]('['+_0x3e4ca9[_0xf39f('0x16')]()+_0xf39f('0x66'),_0x13691c[_0xf39f('0x43')],_0x4fbd7d[_0xf39f('0x4e')]));logger[_0xf39f('0x24')](util['format']('['+_0x3e4ca9[_0xf39f('0x16')]()+_0xf39f('0x67'),_0x3e4ca9));if(_0x3e4ca9!=='unmanaged'&&_0x13691c[_0xf39f('0x68')]){logger['info']('['+_0x3e4ca9[_0xf39f('0x16')]()+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x566ce4[_0xf39f('0xe')],_0x435374[_0xf39f('0x69')],_0x13691c['ticketType'],_0x4fbd7d[_0xf39f('0x4e')]);}})['catch'](function(_0x3a5bf8){logger[_0xf39f('0x15')]('['+_0x3e4ca9['toUpperCase']()+']\x20Error\x20running\x20Dynamics365\x20integration',_0x3a5bf8[_0xf39f('0x33')]);console['error'](_0xf39f('0x6a'),_0x3a5bf8);});}; \ No newline at end of file +var _0x3cd5=['defaults','socket.io-emitter','remoteUri','data7','tenantId','CloudProvider','data2','resolve','POST','clientId','username','password','clientSecret','access_token','catch','error','toUpperCase','message','then','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','4.0','isNil','email','userEmail','length','isdisabled','info',']\x20Agent\x20found\x20','systemuserid','userId','toLowerCase','destcalleridnum','contacts','/systemusers(','Bearer\x20','odata-entityid','substring','enduserId','outbound','telephone1','contacts?$select=','&$filter=','\x20eq\x20\x27','replace','%2b','value','contactid','nothing',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing','forEach','string','type','idField','indexOf','content','ticketType','incident','getString','Subjects','Descriptions','/contacts(','Fields','phonecall','queue','callDirection','phonecalls','assign','calleridnum','headers','lastIndexOf','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','modernAuthentication','stripTrailingSlash','serverUrl','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:','moduleCreate','additionalSearchContact',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:','openNewTab','Displaying\x20call\x20in\x20a\x20new\x20tab...','name','ticketId',']\x20Error\x20running\x20Dynamics365\x20integration','Error\x20running\x20Dynamics365\x20integration','request-promise','util','md5','ioredis','../../../../config/logger','../../../../config/environment','redis'];(function(_0x2adbeb,_0x5581be){var _0x5e18a6=function(_0x84e42b){while(--_0x84e42b){_0x2adbeb['push'](_0x2adbeb['shift']());}};_0x5e18a6(++_0x5581be);}(_0x3cd5,0x1a5));var _0x53cd=function(_0x114b7c,_0xc4b93b){_0x114b7c=_0x114b7c-0x0;var _0x47185f=_0x3cd5[_0x114b7c];return _0x47185f;};'use strict';var _=require('lodash');var rp=require(_0x53cd('0x0'));var util=require(_0x53cd('0x1'));var intUtil=require('./util');var md5=require(_0x53cd('0x2'));var Redis=require(_0x53cd('0x3'));var logger=require(_0x53cd('0x4'))('dynamics365');var config=require(_0x53cd('0x5'));config[_0x53cd('0x6')]=_[_0x53cd('0x7')](config[_0x53cd('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x53cd('0x8'))(new Redis(config['redis']));function getAuthToken(_0x33dd80,_0x1995c3,_0x5b3772){if(_0x33dd80['modernAuthentication']){_0x33dd80[_0x53cd('0x9')]=_0x33dd80['CloudProvider'][_0x53cd('0xa')];_0x33dd80[_0x53cd('0xb')]=_0x33dd80[_0x53cd('0xc')][_0x53cd('0xd')];return Promise[_0x53cd('0xe')](_0x33dd80[_0x53cd('0xc')]['data5']);}var _0x2dfd9a={'method':_0x53cd('0xf'),'uri':_0x1995c3,'form':{'client_id':_0x33dd80[_0x53cd('0x10')],'resource':_0x33dd80[_0x53cd('0x9')],'username':_0x33dd80[_0x53cd('0x11')],'password':_0x33dd80[_0x53cd('0x12')],'grant_type':_0x53cd('0x12'),'client_secret':_0x33dd80[_0x53cd('0x13')]},'json':!![]};return rp(_0x2dfd9a)['then'](function(_0x41a262){return _0x41a262[_0x53cd('0x14')];})[_0x53cd('0x15')](function(_0x4e12b7){logger[_0x53cd('0x16')]('['+[_0x5b3772[_0x53cd('0x17')]()]+']\x20Wrong\x20credentials!');return _0x4e12b7[_0x53cd('0x18')];});}function getUser(_0x478a06,_0x2ba2fd,_0x2aed2c,_0x3cffc5,_0x2a2c02,_0xddda1d){return new Promise(function(_0x1d8623,_0x39fe4e){return getAuthToken(_0x2ba2fd,_0x3cffc5,_0xddda1d)[_0x53cd('0x19')](function(_0x36edf4){var _0x1d4f3c={'method':_0x53cd('0x1a'),'uri':_0x2a2c02+_0x53cd('0x1b'),'headers':{'Authorization':'Bearer\x20'+_0x36edf4,'OData-Version':_0x53cd('0x1c')},'json':!![]};return rp(_0x1d4f3c);})[_0x53cd('0x19')](function(_0x2d933b){var _0x2e8456=_0x2d933b['value'];var _0x26b505=![];var _0xe0d835=null;if(!_[_0x53cd('0x1d')](_0x2aed2c)){if(intUtil['validateEmail'](_0x2aed2c[_0x53cd('0x1e')])){_0x478a06[_0x53cd('0x1f')]=_0x2aed2c[_0x53cd('0x1e')];for(_0xe0d835=0x0;_0xe0d835<_0x2e8456[_0x53cd('0x20')];_0xe0d835++){if(_0x2e8456[_0xe0d835]['internalemailaddress']===_0x2aed2c[_0x53cd('0x1e')]&&!_0x2e8456[_0xe0d835][_0x53cd('0x21')]){_0x26b505=!![];logger[_0x53cd('0x22')]('['+[_0xddda1d['toUpperCase']()]+_0x53cd('0x23')+_0x2e8456[_0xe0d835][_0x53cd('0x24')]+'!');_0x478a06[_0x53cd('0x25')]=_0x2e8456[_0xe0d835][_0x53cd('0x24')];}}}}if(!_0x26b505){logger[_0x53cd('0x22')]('['+[_0xddda1d[_0x53cd('0x17')]()]+']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');_0x478a06['userEmail']=_0x2ba2fd['username'];for(_0xe0d835=0x0;_0xe0d835<_0x2e8456[_0x53cd('0x20')];_0xe0d835++){if(_0x2e8456[_0xe0d835]['internalemailaddress']===_0x2ba2fd[_0x53cd('0x11')]){_0x478a06['userId']=_0x2e8456[_0xe0d835]['systemuserid'];}}}_0x1d8623(_0x478a06);})['catch'](function(_0x1114e4){_0x39fe4e(_0x1114e4[_0x53cd('0x18')]);});});}function createEndUser(_0xea6516,_0x260c1e,_0xc7999f,_0x1b9b5b,_0xe7c734,_0x4c7914,_0x4c7053){return new Promise(function(_0x545945,_0x475f10){return getAuthToken(_0x260c1e,_0xc7999f,_0x4c7914)[_0x53cd('0x19')](function(_0x99fb2f){var _0x50d9b6=_0x4c7914[_0x53cd('0x26')]()==='outbound'?_0xe7c734[_0x53cd('0x27')]:_0xe7c734['calleridnum'];var _0x1c6e66={'method':_0x53cd('0xf'),'uri':_0x1b9b5b+_0x53cd('0x28'),'body':{'fullname':_0x50d9b6,'firstname':_0x50d9b6,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x53cd('0x29')+_0xea6516[_0x53cd('0x25')]+')'},'headers':{'Authorization':_0x53cd('0x2a')+_0x99fb2f,'OData-Version':_0x53cd('0x1c')},'json':!![],'resolveWithFullResponse':!![]};_0x1c6e66['body'][_0x4c7053]=_0x50d9b6;return rp(_0x1c6e66);})[_0x53cd('0x19')](function(_0x4674c4){var _0x364d4e=_0x4674c4['headers'][_0x53cd('0x2b')];var _0x30de31=_0x364d4e[_0x53cd('0x2c')](_0x364d4e['lastIndexOf']('(')+0x1,_0x364d4e['lastIndexOf'](')'));_0xea6516[_0x53cd('0x2d')]=_0x30de31;_0x545945(_0xea6516);})['catch'](function(_0x1d70d3){_0x475f10(_0x1d70d3[_0x53cd('0x18')]);});});}function getEndUser(_0x8f46d9,_0x209a15,_0x4be2c0,_0x69ab25,_0x2f2996,_0x320d14,_0x21f9e1,_0x4684d5){var _0x464739=_0x320d14['toLowerCase']()===_0x53cd('0x2e')?_0x2f2996['destcalleridnum']:_0x2f2996['calleridnum'];return getAuthToken(_0x209a15,_0x4be2c0,_0x320d14)[_0x53cd('0x19')](function(_0x33dbc0){_0x4684d5=_0x4684d5?_0x4684d5:_0x53cd('0x2f');var _0x3d21a7={'method':_0x53cd('0x1a'),'uri':_0x69ab25+_0x53cd('0x30')+_0x4684d5+_0x53cd('0x31')+_0x4684d5+_0x53cd('0x32')+_0x464739[_0x53cd('0x33')]('+',_0x53cd('0x34'))+'\x27','headers':{'Authorization':'Bearer\x20'+_0x33dbc0,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x3d21a7);})[_0x53cd('0x19')](function(_0x564d41){var _0x1297de=![];if(!_0x564d41)return _0x1297de;var _0x1c2f55=_0x564d41[_0x53cd('0x35')];for(var _0x3a6327=0x0;_0x3a6327<_0x1c2f55[_0x53cd('0x20')];_0x3a6327++){if(_0x1c2f55[_0x3a6327][_0x4684d5]===_0x464739){_0x1297de=!![];_0x8f46d9[_0x53cd('0x2d')]=_0x1c2f55[_0x3a6327][_0x53cd('0x36')];}}return _0x1297de;})[_0x53cd('0x19')](function(_0x290127){if(_0x290127)return _0x8f46d9;if(_0x21f9e1===_0x53cd('0x37')){logger[_0x53cd('0x22')]('['+[_0x320d14[_0x53cd('0x17')]()]+_0x53cd('0x38'));return _0x8f46d9;}return createEndUser(_0x8f46d9,_0x209a15,_0x4be2c0,_0x69ab25,_0x2f2996,_0x320d14,_0x4684d5)[_0x53cd('0x19')](function(_0x3c8e2c){logger[_0x53cd('0x22')]('['+[_0x320d14[_0x53cd('0x17')]()]+']\x20Enduser\x20created!',_0x3c8e2c[_0x53cd('0x2d')]);return _0x3c8e2c;});});}function getCustomFields(_0x50326f,_0x5c6eb3,_0x10ad10){var _0x26c9ef={};if(_0x50326f[_0x53cd('0x20')]>0x0){_[_0x53cd('0x39')](_0x50326f,function(_0x159860){if(_['includes']([_0x53cd('0x3a'),'picklist'],_0x159860[_0x53cd('0x3b')])&&_0x159860['nameField']&&!_0x159860['customField']){var _0x1a36d6=_0x159860[_0x53cd('0x3c')][_0x53cd('0x26')]();var _0x26e517=_0x1a36d6[_0x53cd('0x2c')](0x0,_0x1a36d6[_0x53cd('0x3d')]('_'));var _0x125640=_0x1a36d6['substring'](_0x1a36d6['indexOf']('_')+0x1);if(_0x26e517===_0x10ad10){_0x26c9ef[_0x125640]=_0x159860[_0x53cd('0x3e')];}}});}return _0x26c9ef;}function getTicket(_0xa746d8,_0x112219,_0x588991,_0x5200e6,_0x2aff56,_0x1486a2,_0x1ebc24){return new Promise(function(_0x52c06d,_0x4f8a64){var _0x152fc2;return getAuthToken(_0x112219,_0x588991,_0x1ebc24)[_0x53cd('0x19')](function(_0x9e739f){if(_0x1486a2[_0x53cd('0x3f')]===_0x53cd('0x40')){_0x152fc2={'method':_0x53cd('0xf'),'uri':_0x5200e6+'incidents','body':Object['assign']({},{'title':intUtil[_0x53cd('0x41')](_0x1486a2[_0x53cd('0x42')],_0x2aff56,'\x20'),'description':intUtil['getString'](_0x1486a2[_0x53cd('0x43')],_0x2aff56,'\x0a'),'customerid_contact@odata.bind':_0xa746d8[_0x53cd('0x2d')]?_0x53cd('0x44')+_0xa746d8['enduserId']+')':undefined,'ownerid@odata.bind':_0x53cd('0x29')+_0xa746d8[_0x53cd('0x25')]+')','caseorigincode':'1'},getCustomFields(_0x1486a2[_0x53cd('0x45')],_0x2aff56,_0x1486a2['ticketType'])),'headers':{'Authorization':_0x53cd('0x2a')+_0x9e739f,'OData-Version':_0x53cd('0x1c')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x1486a2[_0x53cd('0x3f')]===_0x53cd('0x46')){var _0x17810d=_0xa746d8[_0x53cd('0x2d')]?[{'partyid_systemuser@odata.bind':_0x53cd('0x29')+_0xa746d8['userId']+')','participationtypemask':_0xa746d8['callDirection']===_0x53cd('0x47')?0x2:0x1},{'partyid_contact@odata.bind':'/contacts('+_0xa746d8[_0x53cd('0x2d')]+')','participationtypemask':_0xa746d8[_0x53cd('0x48')]==='queue'?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0x53cd('0x29')+_0xa746d8[_0x53cd('0x25')]+')','participationtypemask':_0xa746d8['callDirection']==='queue'?0x2:0x1}];_0x152fc2={'method':_0x53cd('0xf'),'uri':_0x5200e6+_0x53cd('0x49'),'body':Object[_0x53cd('0x4a')]({},{'subject':intUtil[_0x53cd('0x41')](_0x1486a2[_0x53cd('0x42')],_0x2aff56,'\x20'),'phonenumber':String(_0x2aff56[_0x53cd('0x4b')]),'description':intUtil[_0x53cd('0x41')](_0x1486a2['Descriptions'],_0x2aff56,'\x0a'),'regardingobjectid_contact@odata.bind':_0xa746d8[_0x53cd('0x2d')]?_0x53cd('0x44')+_0xa746d8[_0x53cd('0x2d')]+')':undefined,'ownerid@odata.bind':_0x53cd('0x29')+_0xa746d8[_0x53cd('0x25')]+')','directioncode':_0xa746d8[_0x53cd('0x48')]==='queue'?![]:!![],'phonecall_activity_parties':_0x17810d},getCustomFields(_0x1486a2[_0x53cd('0x45')],_0x2aff56,_0x1486a2[_0x53cd('0x3f')])),'headers':{'Authorization':_0x53cd('0x2a')+_0x9e739f,'OData-Version':_0x53cd('0x1c')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x152fc2);})[_0x53cd('0x19')](function(_0x563afe){var _0x65b181=_0x563afe[_0x53cd('0x4c')][_0x53cd('0x2b')];var _0x191f9d=_0x65b181[_0x53cd('0x2c')](_0x65b181[_0x53cd('0x4d')]('(')+0x1,_0x65b181['lastIndexOf'](')'));_0xa746d8['ticketId']=_0x191f9d;_0x52c06d(_0xa746d8);})['catch'](function(_0x47ac0a){_0x4f8a64(_0x47ac0a[_0x53cd('0x18')]);});});}function emit(_0x275eb3,_0x55a1bf,_0x167682,_0x5a3bf2){var _0x487b26={'uri':util[_0x53cd('0x4e')](_0x53cd('0x4f'),_0x275eb3,_0x167682,_0x5a3bf2)};io['to'](util[_0x53cd('0x4e')](_0x53cd('0x50'),_0x55a1bf))[_0x53cd('0x51')]('trigger:browser:url',_0x487b26);}exports['cs']=function(_0xf0a464,_0x1750fa,_0x51ccec,_0x2e7852,_0x348baa,_0x375534,_0x4012fe,_0x318f78){var _0x999f38={};_0x375534['remoteUri']=_0x375534[_0x53cd('0x52')]?intUtil['stripTrailingSlash'](_0x375534[_0x53cd('0xc')]['data7']):intUtil[_0x53cd('0x53')](_0x375534[_0x53cd('0x9')]);_0x375534['serverUrl']=intUtil[_0x53cd('0x53')](_0x375534[_0x53cd('0x54')]);_0x999f38[_0x53cd('0x48')]=_0x318f78===_0x53cd('0x47')||_0x318f78==='unmanaged'?'queue':_0x53cd('0x2e');var _0x312b29=_0x375534[_0x53cd('0x52')]?util['format'](_0x53cd('0x55'),_0x375534['CloudProvider']['data7']):util['format']('%s/api/data/v9.0/',_0x375534[_0x53cd('0x9')]);var _0x240031=util['format'](_0x53cd('0x56'),_0x375534[_0x53cd('0xb')]);var _0x41c492=util['format'](_0x53cd('0x57'),_0x375534[_0x53cd('0x54')],_0x1750fa[_0x53cd('0x58')],md5(_0x1750fa[_0x53cd('0x58')]));if(_0x348baa&&_0x348baa['monitor_format']){logger[_0x53cd('0x22')](_0x53cd('0x59'),_0x53cd('0x5a'));_0x1750fa['recordingURL']=_0x41c492;}else if(_0x4012fe&&_0x4012fe['recordingFormat']&&_0x4012fe[_0x53cd('0x5b')]!==_0x53cd('0x5c')){logger[_0x53cd('0x22')](_0x53cd('0x5d'),_0x53cd('0x5a'));_0x1750fa[_0x53cd('0x5e')]=_0x41c492;}else{_0x1750fa[_0x53cd('0x5e')]='';}return getUser(_0x999f38,_0x375534,_0x2e7852,_0x240031,_0x312b29,_0x318f78)['then'](function(_0x319e96){logger[_0x53cd('0x22')]('['+_0x318f78[_0x53cd('0x17')]()+_0x53cd('0x5f'),_0x319e96[_0x53cd('0x25')]);logger[_0x53cd('0x22')]('['+_0x318f78[_0x53cd('0x17')]()+_0x53cd('0x60'),_0x319e96[_0x53cd('0x1f')]);return getEndUser(_0x319e96,_0x375534,_0x240031,_0x312b29,_0x1750fa,_0x318f78,_0x51ccec[_0x53cd('0x61')],_0x51ccec[_0x53cd('0x62')]);})['then'](function(_0x120191){logger[_0x53cd('0x22')]('['+_0x318f78['toUpperCase']()+_0x53cd('0x63'),_0x120191['enduserId']);logger[_0x53cd('0x22')]('['+_0x318f78['toUpperCase']()+_0x53cd('0x64'),_0x1750fa[_0x53cd('0x4b')]);return getTicket(_0x120191,_0x375534,_0x240031,_0x312b29,_0x1750fa,_0x51ccec,_0x318f78);})[_0x53cd('0x19')](function(_0x2ac75b){logger[_0x53cd('0x22')](util[_0x53cd('0x4e')]('['+_0x318f78['toUpperCase']()+']\x20The\x20%s\x20ID\x20is:\x20%s',_0x51ccec[_0x53cd('0x3f')],_0x2ac75b['ticketId']));logger[_0x53cd('0x22')](util[_0x53cd('0x4e')]('['+_0x318f78[_0x53cd('0x17')]()+']\x20Call\x20direction:\x20%s',_0x318f78));if(_0x318f78!=='unmanaged'&&_0x51ccec[_0x53cd('0x65')]){logger[_0x53cd('0x22')]('['+_0x318f78[_0x53cd('0x17')]()+']',_0x53cd('0x66'));emit(_0x375534[_0x53cd('0x9')],_0x2e7852[_0x53cd('0x67')],_0x51ccec[_0x53cd('0x3f')],_0x2ac75b[_0x53cd('0x68')]);}})[_0x53cd('0x15')](function(_0x112ad4){logger[_0x53cd('0x16')]('['+_0x318f78[_0x53cd('0x17')]()+_0x53cd('0x69'),_0x112ad4[_0x53cd('0x18')]);console[_0x53cd('0x16')](_0x53cd('0x6a'),_0x112ad4);});}; \ 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 fd39aa3..eda4662 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 _0x260c=['stringify','GET','map','picklist','type','nameField','customField','toLowerCase','content','includes','push','idField','variable','variableName','customVariable','Variable','name','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','error','outbound','recordingFormat','none','[OUTBOUND]','Authorization','destcalleridname','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','catch','lastevent','toUpperCase','lodash','request-promise','md5','ioredis','./util','../../../../config/environment','freshdesk','redis','defaults','localhost','socket.io-emitter','application/json','info','Creating\x20new\x20ticket...','merge','format','calleridnum','getString','Subjects','
','Tags','custom_fields','mapValues','keyBy','value','remoteUri','POST','then','Ticket\x20created!','validateEmail','%s/api/v2/agents','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\x20created.','toString','debug'];(function(_0x18f532,_0x1119e5){var _0x222579=function(_0x57af8a){while(--_0x57af8a){_0x18f532['push'](_0x18f532['shift']());}};_0x222579(++_0x1119e5);}(_0x260c,0x12f));var _0xc260=function(_0x593c9c,_0x12a4cd){_0x593c9c=_0x593c9c-0x0;var _0x481128=_0x260c[_0x593c9c];return _0x481128;};'use strict';var _=require(_0xc260('0x0'));var rp=require(_0xc260('0x1'));var md5=require(_0xc260('0x2'));var util=require('util');var Redis=require(_0xc260('0x3'));var intUtil=require(_0xc260('0x4'));var config=require(_0xc260('0x5'));var logger=require('../../../../config/logger')(_0xc260('0x6'));config[_0xc260('0x7')]=_[_0xc260('0x8')](config[_0xc260('0x7')],{'host':_0xc260('0x9'),'port':0x18eb});var io=require(_0xc260('0xa'))(new Redis(config['redis']));var headers={'Content-Type':_0xc260('0xb'),'Accept':_0xc260('0xb')};function emit(_0x4d2f7e,_0x587970,_0x33c092){io['to'](_0x4d2f7e)['emit'](_0x587970,_0x33c092);}function getTicket(_0xa936d,_0x1e5dd7,_0x2119f,_0x5567dd,_0x39a0c1){logger[_0xc260('0xc')](_0xc260('0xd'));var _0x3a6095=_[_0xc260('0xe')]({'responder_id':_0x1e5dd7['id'],'requester_id':_0x2119f['id'],'name':util[_0xc260('0xf')]('Caller\x20-\x20%s',_0x39a0c1['calleridname']),'phone':_0x39a0c1[_0xc260('0x10')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xc260('0x11')](_0x5567dd[_0xc260('0x12')],_0x39a0c1,'\x20'),'description':intUtil[_0xc260('0x11')](_0x5567dd['Descriptions'],_0x39a0c1,_0xc260('0x13')),'tags':getTags(_0x5567dd[_0xc260('0x14')],'name')},getCustomFields(_0x5567dd['Fields'],_0x39a0c1));_0x3a6095[_0xc260('0x15')]=_[_0xc260('0x16')](_[_0xc260('0x17')](_0x3a6095['custom_fields'],'id'),_0xc260('0x18'));return request({'uri':util[_0xc260('0xf')]('%s/api/v2/tickets',_0xa936d[_0xc260('0x19')]),'method':_0xc260('0x1a'),'body':_0x3a6095})[_0xc260('0x1b')](function(_0x5665aa){logger[_0xc260('0xc')](_0xc260('0x1c'));return _0x5665aa;});}function getUser(_0x3f2b5d,_0x4f507b){if(intUtil[_0xc260('0x1d')](_0x4f507b)){return request({'uri':util[_0xc260('0xf')](_0xc260('0x1e'),_0x3f2b5d[_0xc260('0x19')]),'qs':{'email':_0x4f507b}})[_0xc260('0x1b')](function(_0x13d8f7){if(_0x13d8f7[_0xc260('0x1f')]){logger[_0xc260('0xc')](_0xc260('0x20'));return _[_0xc260('0x21')](_0x13d8f7,function(_0x42a325){return _0x42a325[_0xc260('0x22')][_0xc260('0x23')]===_0x4f507b;});}else{logger[_0xc260('0xc')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xc260('0xf')](_0xc260('0x24'),_0x3f2b5d[_0xc260('0x19')])})[_0xc260('0x1b')](function(_0x1e5cc4){logger['info'](_0xc260('0x25'));return _0x1e5cc4;});}});}else{logger['info'](_0xc260('0x26'));return request({'uri':util[_0xc260('0xf')](_0xc260('0x24'),_0x3f2b5d[_0xc260('0x19')])})['then'](function(_0x90607a){logger[_0xc260('0xc')](_0xc260('0x25'));return _0x90607a;});}}function getEndUser(_0x5496b1,_0x35d4b6,_0x45a2eb){logger[_0xc260('0xc')](_0xc260('0x27'),_0x45a2eb);return request({'uri':util[_0xc260('0xf')](_0xc260('0x28'),_0x5496b1[_0xc260('0x19')]),'qs':{'phone':_0x45a2eb}})['then'](function(_0xc38663){if(_0xc38663[_0xc260('0x1f')]){logger['info'](_0xc260('0x29'));return _[_0xc260('0x21')](_0xc38663,{'phone':_0x45a2eb});}else{logger[_0xc260('0xc')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0xc260('0xf')](_0xc260('0x28'),_0x5496b1[_0xc260('0x19')]),'method':_0xc260('0x1a'),'body':{'name':_0x35d4b6,'phone':_0x45a2eb}})[_0xc260('0x1b')](function(_0x3fb306){logger['info'](_0xc260('0x2a'));return _0x3fb306;});}});}function getAuth(_0x130c34){return util[_0xc260('0xf')]('Basic\x20%s',new Buffer(_0x130c34['apiKey']+':X')[_0xc260('0x2b')]('base64'));}function request(_0x322bed){logger[_0xc260('0x2c')]('[HTTP]',JSON[_0xc260('0x2d')](_0x322bed));return rp(_[_0xc260('0x8')](_0x322bed,{'method':_0xc260('0x2e'),'headers':headers,'json':!![]}));}function getTags(_0x2416b9,_0x4fbf5d){var _0x54db3b=[];if(_0x2416b9&&_0x2416b9[_0xc260('0x1f')]>0x0){_0x54db3b=_[_0xc260('0x2f')](_0x2416b9,_0x4fbf5d);}return _0x54db3b;}function getCustomFields(_0x197201,_0x2fbe6f){var _0x370891=[];var _0x577ca7={'custom_fields':[]};if(_0x197201['length']>0x0){_['forEach'](_0x197201,function(_0x41c58b){if(_['includes'](['string',_0xc260('0x30')],_0x41c58b[_0xc260('0x31')])&&_0x41c58b[_0xc260('0x32')]&&!_0x41c58b[_0xc260('0x33')]){_0x577ca7[_0x41c58b['nameField'][_0xc260('0x34')]()]=_0x41c58b[_0xc260('0x35')][_0xc260('0x2b')]();}else if(_[_0xc260('0x36')](['string',_0xc260('0x30')],_0x41c58b[_0xc260('0x31')])&&_0x41c58b['idField']&&_0x41c58b['customField']){_0x577ca7['custom_fields'][_0xc260('0x37')]({'id':_0x41c58b[_0xc260('0x38')],'value':_0x41c58b['content'][_0xc260('0x2b')]()});}else if(_0x41c58b['type']===_0xc260('0x39')&&_0x41c58b['variableName']&&_0x41c58b[_0xc260('0x38')]&&_0x41c58b[_0xc260('0x33')]){_0x2fbe6f[_0x41c58b['variableName']]&&_0x577ca7[_0xc260('0x15')][_0xc260('0x37')]({'id':_0x41c58b[_0xc260('0x38')],'value':_0x2fbe6f[_0x41c58b[_0xc260('0x3a')]][_0xc260('0x2b')]()});}else if(_0x41c58b[_0xc260('0x31')]===_0xc260('0x3b')&&_0x41c58b[_0xc260('0x3c')]&&_0x41c58b[_0xc260('0x3c')]['name']&&_0x41c58b[_0xc260('0x38')]&&_0x41c58b[_0xc260('0x33')]){_0x2fbe6f[_0x41c58b[_0xc260('0x3c')]['name']['toLowerCase']()]&&_0x577ca7[_0xc260('0x15')][_0xc260('0x37')]({'id':_0x41c58b[_0xc260('0x38')],'value':_0x2fbe6f[_0x41c58b[_0xc260('0x3c')][_0xc260('0x3d')][_0xc260('0x34')]()][_0xc260('0x2b')]()});}});}return _0x577ca7;}exports[_0xc260('0x3e')]=function(_0x33a27f,_0x251978,_0x1445f0,_0x5f2e3d,_0x2df0d7,_0x1ae374){var _0x2d9d51,_0x4803b6;_0x1ae374[_0xc260('0x19')]=intUtil[_0xc260('0x3f')](_0x1ae374[_0xc260('0x19')]);_0x1ae374[_0xc260('0x40')]=intUtil['stripTrailingSlash'](_0x1ae374[_0xc260('0x40')]);if(_0x2df0d7&&_0x2df0d7[_0xc260('0x41')]){logger[_0xc260('0xc')](_0xc260('0x42'),_0xc260('0x43'));_0x251978['recordingURL']=util[_0xc260('0xf')](_0xc260('0x44'),_0x1ae374[_0xc260('0x40')],_0x251978[_0xc260('0x45')],md5(_0x251978[_0xc260('0x45')]));}else{_0x251978[_0xc260('0x46')]='';}headers['Authorization']=getAuth(_0x1ae374);return getUser(_0x1ae374,_0x5f2e3d[_0xc260('0x23')])[_0xc260('0x1b')](function(_0x521036){_0x2d9d51=_0x521036;logger[_0xc260('0xc')](_0xc260('0x47'),_0x2d9d51['id']);return getEndUser(_0x1ae374,_0x251978[_0xc260('0x48')],_0x251978['calleridnum']);})[_0xc260('0x1b')](function(_0x46d5f2){_0x4803b6=_0x46d5f2;logger['info'](_0xc260('0x49'),_0x4803b6['id']);return getTicket(_0x1ae374,_0x2d9d51,_0x4803b6,_0x1445f0,_0x251978);})[_0xc260('0x1b')](function(_0x1c7330){if(_0x1c7330&&_0x1c7330['id']){logger[_0xc260('0xc')]('Ticket\x20created!');logger['info']('The\x20Ticket\x20ID\x20is:',_0x1c7330['id']);logger[_0xc260('0xc')](_0xc260('0x42'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format']('user:%s',_0x5f2e3d['name']),'trigger:browser:url',{'uri':util[_0xc260('0xf')]('%s/helpdesk/tickets/%d',_0x1ae374['remoteUri'],_0x1c7330['id'])});}})['catch'](function(_0x1f1afa){logger[_0xc260('0x4a')]('[QUEUE]',JSON[_0xc260('0x2d')](_0x1f1afa));});};exports[_0xc260('0x4b')]=function(_0x5cd0bf,_0xc75fcf,_0x51b224,_0x2b7434,_0x2398ea,_0x5104ae,_0x598bcc){var _0x25c4f4,_0x3bbb77;_0x5104ae[_0xc260('0x19')]=intUtil['stripTrailingSlash'](_0x5104ae[_0xc260('0x19')]);_0x5104ae[_0xc260('0x40')]=intUtil[_0xc260('0x3f')](_0x5104ae[_0xc260('0x40')]);if(_0x598bcc&&_0x598bcc['recordingFormat']&&_0x598bcc[_0xc260('0x4c')]!==_0xc260('0x4d')){logger[_0xc260('0xc')](_0xc260('0x4e'),_0xc260('0x43'));_0xc75fcf['recordingURL']=util[_0xc260('0xf')](_0xc260('0x44'),_0x5104ae[_0xc260('0x40')],_0xc75fcf['uniqueid'],md5(_0xc75fcf[_0xc260('0x45')]));}headers[_0xc260('0x4f')]=getAuth(_0x5104ae);return getUser(_0x5104ae,_0x2b7434['email'])[_0xc260('0x1b')](function(_0x12dbb1){_0x25c4f4=_0x12dbb1;logger[_0xc260('0xc')](_0xc260('0x47'),_0x25c4f4['id']);return getEndUser(_0x5104ae,_0xc75fcf[_0xc260('0x50')],_0xc75fcf['destcalleridnum']);})[_0xc260('0x1b')](function(_0x2dfc39){_0x3bbb77=_0x2dfc39;logger[_0xc260('0xc')](_0xc260('0x49'),_0x3bbb77['id']);return getTicket(_0x5104ae,_0x25c4f4,_0x3bbb77,_0x51b224,_0xc75fcf);})[_0xc260('0x1b')](function(_0x282aab){if(_0x282aab&&_0x282aab['id']){logger[_0xc260('0xc')](_0xc260('0x1c'));logger[_0xc260('0xc')](_0xc260('0x51'),_0x282aab['id']);logger[_0xc260('0xc')](_0xc260('0x4e'),_0xc260('0x52'));emit(util[_0xc260('0xf')]('user:%s',_0x2b7434[_0xc260('0x3d')]),_0xc260('0x53'),{'uri':util[_0xc260('0xf')]('%s/helpdesk/tickets/%d',_0x5104ae[_0xc260('0x19')],_0x282aab['id'])});}})[_0xc260('0x54')](function(_0xee5290){logger[_0xc260('0x4a')](_0xc260('0x4e'),JSON['stringify'](_0xee5290));});};exports['unmanaged']=function(_0x4f1cf7,_0x34ef41,_0x4fd64e,_0x10977b,_0x175f2d,_0x31566a){var _0x204bf5,_0x7a529a;_0x31566a[_0xc260('0x19')]=intUtil[_0xc260('0x3f')](_0x31566a[_0xc260('0x19')]);_0x31566a[_0xc260('0x40')]=intUtil[_0xc260('0x3f')](_0x31566a['serverUrl']);if(_0x175f2d&&_0x175f2d[_0xc260('0x41')]){logger[_0xc260('0xc')]('['+_0x34ef41[_0xc260('0x55')][_0xc260('0x56')]()+']',_0xc260('0x43'));_0x34ef41[_0xc260('0x46')]=util[_0xc260('0xf')](_0xc260('0x44'),_0x31566a['serverUrl'],_0x34ef41[_0xc260('0x45')],md5(_0x34ef41[_0xc260('0x45')]));}else{_0x34ef41[_0xc260('0x46')]='';}headers['Authorization']=getAuth(_0x31566a);return getUser(_0x31566a,'')['then'](function(_0x5b31bc){_0x204bf5=_0x5b31bc;logger[_0xc260('0xc')](_0xc260('0x47'),_0x204bf5['id']);return getEndUser(_0x31566a,_0x34ef41[_0xc260('0x48')],_0x34ef41[_0xc260('0x10')]);})[_0xc260('0x1b')](function(_0x4da93f){_0x7a529a=_0x4da93f;logger[_0xc260('0xc')]('The\x20Enduser\x20ID\x20is:',_0x7a529a['id']);return getTicket(_0x31566a,_0x204bf5,_0x7a529a,_0x4fd64e,_0x34ef41);})[_0xc260('0x1b')](function(_0x4fdfae){if(_0x4fdfae){logger[_0xc260('0xc')](_0xc260('0x1c'));logger[_0xc260('0xc')](_0xc260('0x51'),_0x4fdfae['id']);}})[_0xc260('0x54')](function(_0x4c5bf4){logger['error']('['+_0x34ef41[_0xc260('0x55')][_0xc260('0x56')]()+']',JSON[_0xc260('0x2d')](_0x4c5bf4));});}; \ No newline at end of file +var _0xbddb=['trigger:browser:url','%s/helpdesk/tickets/%d','recordingFormat','none','destcalleridname','destcalleridnum','[OUTBOUND]','catch','error','unmanaged','lastevent','toUpperCase','lodash','util','ioredis','./util','../../../../config/environment','../../../../config/logger','freshdesk','redis','defaults','socket.io-emitter','application/json','emit','info','Creating\x20new\x20ticket...','merge','format','calleridname','calleridnum','getString','Subjects','Descriptions','Tags','mapValues','keyBy','custom_fields','value','%s/api/v2/tickets','remoteUri','POST','then','Ticket\x20created!','validateEmail','%s/api/v2/agents','length','Agent\x20found!','find','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','%s/api/v2/contacts','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','apiKey','toString','base64','debug','stringify','GET','map','includes','string','nameField','content','type','idField','customField','push','variable','variableName','Variable','name','toLowerCase','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s'];(function(_0x36d7c9,_0x105774){var _0x1e6d72=function(_0x58d657){while(--_0x58d657){_0x36d7c9['push'](_0x36d7c9['shift']());}};_0x1e6d72(++_0x105774);}(_0xbddb,0x174));var _0xbbdd=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xbddb[_0x2641f9];return _0x585741;};'use strict';var _=require(_0xbbdd('0x0'));var rp=require('request-promise');var md5=require('md5');var util=require(_0xbbdd('0x1'));var Redis=require(_0xbbdd('0x2'));var intUtil=require(_0xbbdd('0x3'));var config=require(_0xbbdd('0x4'));var logger=require(_0xbbdd('0x5'))(_0xbbdd('0x6'));config[_0xbbdd('0x7')]=_[_0xbbdd('0x8')](config[_0xbbdd('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0xbbdd('0x9'))(new Redis(config[_0xbbdd('0x7')]));var headers={'Content-Type':_0xbbdd('0xa'),'Accept':'application/json'};function emit(_0x277784,_0x314f07,_0x1fc412){io['to'](_0x277784)[_0xbbdd('0xb')](_0x314f07,_0x1fc412);}function getTicket(_0x349e83,_0x5eb363,_0x5b124a,_0xacc578,_0x4a6295){logger[_0xbbdd('0xc')](_0xbbdd('0xd'));var _0x42fbf9=_[_0xbbdd('0xe')]({'responder_id':_0x5eb363['id'],'requester_id':_0x5b124a['id'],'name':util[_0xbbdd('0xf')]('Caller\x20-\x20%s',_0x4a6295[_0xbbdd('0x10')]),'phone':_0x4a6295[_0xbbdd('0x11')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xbbdd('0x12')](_0xacc578[_0xbbdd('0x13')],_0x4a6295,'\x20'),'description':intUtil[_0xbbdd('0x12')](_0xacc578[_0xbbdd('0x14')],_0x4a6295,'
'),'tags':getTags(_0xacc578[_0xbbdd('0x15')],'name')},getCustomFields(_0xacc578['Fields'],_0x4a6295));_0x42fbf9['custom_fields']=_[_0xbbdd('0x16')](_[_0xbbdd('0x17')](_0x42fbf9[_0xbbdd('0x18')],'id'),_0xbbdd('0x19'));return request({'uri':util[_0xbbdd('0xf')](_0xbbdd('0x1a'),_0x349e83[_0xbbdd('0x1b')]),'method':_0xbbdd('0x1c'),'body':_0x42fbf9})[_0xbbdd('0x1d')](function(_0xd79572){logger[_0xbbdd('0xc')](_0xbbdd('0x1e'));return _0xd79572;});}function getUser(_0x3b2dae,_0x3b61f4){if(intUtil[_0xbbdd('0x1f')](_0x3b61f4)){return request({'uri':util[_0xbbdd('0xf')](_0xbbdd('0x20'),_0x3b2dae[_0xbbdd('0x1b')]),'qs':{'email':_0x3b61f4}})[_0xbbdd('0x1d')](function(_0xb9d197){if(_0xb9d197[_0xbbdd('0x21')]){logger[_0xbbdd('0xc')](_0xbbdd('0x22'));return _[_0xbbdd('0x23')](_0xb9d197,function(_0x59996f){return _0x59996f[_0xbbdd('0x24')][_0xbbdd('0x25')]===_0x3b61f4;});}else{logger['info'](_0xbbdd('0x26'));return request({'uri':util[_0xbbdd('0xf')](_0xbbdd('0x27'),_0x3b2dae[_0xbbdd('0x1b')])})[_0xbbdd('0x1d')](function(_0x45e125){logger[_0xbbdd('0xc')]('Admin\x20account\x20selected.');return _0x45e125;});}});}else{logger['info']('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xbbdd('0xf')](_0xbbdd('0x27'),_0x3b2dae[_0xbbdd('0x1b')])})[_0xbbdd('0x1d')](function(_0x291483){logger[_0xbbdd('0xc')](_0xbbdd('0x28'));return _0x291483;});}}function getEndUser(_0x5f08a6,_0x22261f,_0x15696a){logger['info']('Searching\x20enduser\x20with\x20phone',_0x15696a);return request({'uri':util['format'](_0xbbdd('0x29'),_0x5f08a6[_0xbbdd('0x1b')]),'qs':{'phone':_0x15696a}})[_0xbbdd('0x1d')](function(_0x157a39){if(_0x157a39['length']){logger[_0xbbdd('0xc')]('Enduser\x20found!');return _[_0xbbdd('0x23')](_0x157a39,{'phone':_0x15696a});}else{logger[_0xbbdd('0xc')](_0xbbdd('0x2a'));return request({'uri':util[_0xbbdd('0xf')](_0xbbdd('0x29'),_0x5f08a6[_0xbbdd('0x1b')]),'method':_0xbbdd('0x1c'),'body':{'name':_0x22261f,'phone':_0x15696a}})[_0xbbdd('0x1d')](function(_0x26bc94){logger[_0xbbdd('0xc')](_0xbbdd('0x2b'));return _0x26bc94;});}});}function getAuth(_0x764258){return util[_0xbbdd('0xf')]('Basic\x20%s',new Buffer(_0x764258[_0xbbdd('0x2c')]+':X')[_0xbbdd('0x2d')](_0xbbdd('0x2e')));}function request(_0x1856e3){logger[_0xbbdd('0x2f')]('[HTTP]',JSON[_0xbbdd('0x30')](_0x1856e3));return rp(_[_0xbbdd('0x8')](_0x1856e3,{'method':_0xbbdd('0x31'),'headers':headers,'json':!![]}));}function getTags(_0x2324a5,_0x496883){var _0x5f5132=[];if(_0x2324a5&&_0x2324a5['length']>0x0){_0x5f5132=_[_0xbbdd('0x32')](_0x2324a5,_0x496883);}return _0x5f5132;}function getCustomFields(_0x5a2e98,_0x2f3931){var _0x345180=[];var _0x442974={'custom_fields':[]};if(_0x5a2e98['length']>0x0){_['forEach'](_0x5a2e98,function(_0x1594af){if(_[_0xbbdd('0x33')]([_0xbbdd('0x34'),'picklist'],_0x1594af['type'])&&_0x1594af[_0xbbdd('0x35')]&&!_0x1594af['customField']){_0x442974[_0x1594af[_0xbbdd('0x35')]['toLowerCase']()]=_0x1594af[_0xbbdd('0x36')]['toString']();}else if(_[_0xbbdd('0x33')]([_0xbbdd('0x34'),'picklist'],_0x1594af[_0xbbdd('0x37')])&&_0x1594af[_0xbbdd('0x38')]&&_0x1594af[_0xbbdd('0x39')]){_0x442974['custom_fields'][_0xbbdd('0x3a')]({'id':_0x1594af[_0xbbdd('0x38')],'value':_0x1594af[_0xbbdd('0x36')]['toString']()});}else if(_0x1594af[_0xbbdd('0x37')]===_0xbbdd('0x3b')&&_0x1594af[_0xbbdd('0x3c')]&&_0x1594af[_0xbbdd('0x38')]&&_0x1594af[_0xbbdd('0x39')]){_0x2f3931[_0x1594af['variableName']]&&_0x442974[_0xbbdd('0x18')][_0xbbdd('0x3a')]({'id':_0x1594af[_0xbbdd('0x38')],'value':_0x2f3931[_0x1594af['variableName']][_0xbbdd('0x2d')]()});}else if(_0x1594af['type']==='customVariable'&&_0x1594af[_0xbbdd('0x3d')]&&_0x1594af['Variable'][_0xbbdd('0x3e')]&&_0x1594af['idField']&&_0x1594af[_0xbbdd('0x39')]){_0x2f3931[_0x1594af['Variable'][_0xbbdd('0x3e')][_0xbbdd('0x3f')]()]&&_0x442974['custom_fields'][_0xbbdd('0x3a')]({'id':_0x1594af[_0xbbdd('0x38')],'value':_0x2f3931[_0x1594af[_0xbbdd('0x3d')][_0xbbdd('0x3e')][_0xbbdd('0x3f')]()][_0xbbdd('0x2d')]()});}});}return _0x442974;}exports['queue']=function(_0x5c81a5,_0x340d52,_0x128b0b,_0x3621b9,_0x3d6b27,_0x104ce0){var _0x3e1707,_0x517703;_0x104ce0['remoteUri']=intUtil[_0xbbdd('0x40')](_0x104ce0['remoteUri']);_0x104ce0['serverUrl']=intUtil['stripTrailingSlash'](_0x104ce0[_0xbbdd('0x41')]);if(_0x3d6b27&&_0x3d6b27[_0xbbdd('0x42')]){logger['info'](_0xbbdd('0x43'),_0xbbdd('0x44'));_0x340d52[_0xbbdd('0x45')]=util[_0xbbdd('0xf')](_0xbbdd('0x46'),_0x104ce0[_0xbbdd('0x41')],_0x340d52[_0xbbdd('0x47')],md5(_0x340d52[_0xbbdd('0x47')]));}else{_0x340d52['recordingURL']='';}headers[_0xbbdd('0x48')]=getAuth(_0x104ce0);return getUser(_0x104ce0,_0x3621b9[_0xbbdd('0x25')])[_0xbbdd('0x1d')](function(_0x337d32){_0x3e1707=_0x337d32;logger['info'](_0xbbdd('0x49'),_0x3e1707['id']);return getEndUser(_0x104ce0,_0x340d52[_0xbbdd('0x10')],_0x340d52[_0xbbdd('0x11')]);})[_0xbbdd('0x1d')](function(_0x1f38ba){_0x517703=_0x1f38ba;logger[_0xbbdd('0xc')](_0xbbdd('0x4a'),_0x517703['id']);return getTicket(_0x104ce0,_0x3e1707,_0x517703,_0x128b0b,_0x340d52);})[_0xbbdd('0x1d')](function(_0x290d64){if(_0x290d64&&_0x290d64['id']){logger[_0xbbdd('0xc')](_0xbbdd('0x1e'));logger[_0xbbdd('0xc')](_0xbbdd('0x4b'),_0x290d64['id']);logger[_0xbbdd('0xc')]('[QUEUE]',_0xbbdd('0x4c'));emit(util[_0xbbdd('0xf')](_0xbbdd('0x4d'),_0x3621b9[_0xbbdd('0x3e')]),_0xbbdd('0x4e'),{'uri':util[_0xbbdd('0xf')](_0xbbdd('0x4f'),_0x104ce0[_0xbbdd('0x1b')],_0x290d64['id'])});}})['catch'](function(_0x34caf5){logger['error']('[QUEUE]',JSON['stringify'](_0x34caf5));});};exports['outbound']=function(_0x34b97b,_0x1b5b36,_0x180b04,_0x437b1e,_0x4b79f6,_0x35a40c,_0x3cf67d){var _0x4f4bcf,_0x49ed69;_0x35a40c[_0xbbdd('0x1b')]=intUtil['stripTrailingSlash'](_0x35a40c['remoteUri']);_0x35a40c[_0xbbdd('0x41')]=intUtil[_0xbbdd('0x40')](_0x35a40c[_0xbbdd('0x41')]);if(_0x3cf67d&&_0x3cf67d[_0xbbdd('0x50')]&&_0x3cf67d['recordingFormat']!==_0xbbdd('0x51')){logger[_0xbbdd('0xc')]('[OUTBOUND]',_0xbbdd('0x44'));_0x1b5b36[_0xbbdd('0x45')]=util[_0xbbdd('0xf')](_0xbbdd('0x46'),_0x35a40c['serverUrl'],_0x1b5b36['uniqueid'],md5(_0x1b5b36[_0xbbdd('0x47')]));}headers[_0xbbdd('0x48')]=getAuth(_0x35a40c);return getUser(_0x35a40c,_0x437b1e[_0xbbdd('0x25')])['then'](function(_0x5a8996){_0x4f4bcf=_0x5a8996;logger[_0xbbdd('0xc')](_0xbbdd('0x49'),_0x4f4bcf['id']);return getEndUser(_0x35a40c,_0x1b5b36[_0xbbdd('0x52')],_0x1b5b36[_0xbbdd('0x53')]);})[_0xbbdd('0x1d')](function(_0x29f6ad){_0x49ed69=_0x29f6ad;logger[_0xbbdd('0xc')](_0xbbdd('0x4a'),_0x49ed69['id']);return getTicket(_0x35a40c,_0x4f4bcf,_0x49ed69,_0x180b04,_0x1b5b36);})[_0xbbdd('0x1d')](function(_0x5d1788){if(_0x5d1788&&_0x5d1788['id']){logger[_0xbbdd('0xc')](_0xbbdd('0x1e'));logger[_0xbbdd('0xc')](_0xbbdd('0x4b'),_0x5d1788['id']);logger[_0xbbdd('0xc')](_0xbbdd('0x54'),_0xbbdd('0x4c'));emit(util[_0xbbdd('0xf')](_0xbbdd('0x4d'),_0x437b1e[_0xbbdd('0x3e')]),_0xbbdd('0x4e'),{'uri':util['format'](_0xbbdd('0x4f'),_0x35a40c['remoteUri'],_0x5d1788['id'])});}})[_0xbbdd('0x55')](function(_0x57df67){logger[_0xbbdd('0x56')](_0xbbdd('0x54'),JSON[_0xbbdd('0x30')](_0x57df67));});};exports[_0xbbdd('0x57')]=function(_0x154a19,_0x4d9011,_0x51d8a0,_0x380c99,_0x248daf,_0x35dfeb){var _0x3f8bba,_0x40f0d5;_0x35dfeb[_0xbbdd('0x1b')]=intUtil[_0xbbdd('0x40')](_0x35dfeb[_0xbbdd('0x1b')]);_0x35dfeb[_0xbbdd('0x41')]=intUtil['stripTrailingSlash'](_0x35dfeb[_0xbbdd('0x41')]);if(_0x248daf&&_0x248daf[_0xbbdd('0x42')]){logger[_0xbbdd('0xc')]('['+_0x4d9011[_0xbbdd('0x58')][_0xbbdd('0x59')]()+']',_0xbbdd('0x44'));_0x4d9011[_0xbbdd('0x45')]=util[_0xbbdd('0xf')](_0xbbdd('0x46'),_0x35dfeb[_0xbbdd('0x41')],_0x4d9011[_0xbbdd('0x47')],md5(_0x4d9011[_0xbbdd('0x47')]));}else{_0x4d9011[_0xbbdd('0x45')]='';}headers[_0xbbdd('0x48')]=getAuth(_0x35dfeb);return getUser(_0x35dfeb,'')[_0xbbdd('0x1d')](function(_0x33c3aa){_0x3f8bba=_0x33c3aa;logger[_0xbbdd('0xc')]('The\x20User\x20ID\x20is:',_0x3f8bba['id']);return getEndUser(_0x35dfeb,_0x4d9011[_0xbbdd('0x10')],_0x4d9011[_0xbbdd('0x11')]);})[_0xbbdd('0x1d')](function(_0x17e849){_0x40f0d5=_0x17e849;logger[_0xbbdd('0xc')]('The\x20Enduser\x20ID\x20is:',_0x40f0d5['id']);return getTicket(_0x35dfeb,_0x3f8bba,_0x40f0d5,_0x51d8a0,_0x4d9011);})['then'](function(_0x35c238){if(_0x35c238){logger[_0xbbdd('0xc')]('Ticket\x20created!');logger[_0xbbdd('0xc')](_0xbbdd('0x4b'),_0x35c238['id']);}})['catch'](function(_0x5e4ead){logger[_0xbbdd('0x56')]('['+_0x4d9011[_0xbbdd('0x58')][_0xbbdd('0x59')]()+']',JSON[_0xbbdd('0x30')](_0x5e4ead));});}; \ 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 72588fc..10afc5c 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 _0xc5c5=['Requested\x20Resource\x20not\x20Found','error','toUpperCase','message','Getting\x20user\x20list','userId','User\x20found:','userEmail','/api/lookup?q=','&f=','&entities=contact','find','contacts','catch','format','contactNumber','endUserId','Contact\x20found\x20mobile_number:','Contact\x20found\x20work_number:','Contact\x20created:','/api/contacts','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','POST','/api/tasks','Contact','YYYY-MM-DDTHH:mm:ss','ticketId','Task\x20created:','user:%s','emit','trigger:browser:url','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','serverUrl','username','toLowerCase','outbound','destcalleridnum','calleridnum','queue','unmanaged','agentEmail','email','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','request-promise','util','moment','./util','../../../../config/environment','../../../../config/logger','freshsales','redis','localhost','socket.io-emitter','GET','/api/selector/owners','headers','info','Getting\x20admin\x20information','then','users','length','adminEmail','adminId','Admin\x20found:'];(function(_0x596c43,_0x28647a){var _0x4e1315=function(_0x58e910){while(--_0x58e910){_0x596c43['push'](_0x596c43['shift']());}};_0x4e1315(++_0x28647a);}(_0xc5c5,0x1ca));var _0x5c5c=function(_0x4bd737,_0x2eaea5){_0x4bd737=_0x4bd737-0x0;var _0x5e170a=_0xc5c5[_0x4bd737];return _0x5e170a;};'use strict';var _=require(_0x5c5c('0x0'));var rp=require(_0x5c5c('0x1'));var md5=require('md5');var util=require(_0x5c5c('0x2'));var moment=require(_0x5c5c('0x3'));var Promise=require('bluebird');var Redis=require('ioredis');var intUtil=require(_0x5c5c('0x4'));var config=require(_0x5c5c('0x5'));var logger=require(_0x5c5c('0x6'))(_0x5c5c('0x7'));config[_0x5c5c('0x8')]=_['defaults'](config['redis'],{'host':_0x5c5c('0x9'),'port':0x18eb});var io=require(_0x5c5c('0xa'))(new Redis(config[_0x5c5c('0x8')]));function getAdminId(_0x3b8390,_0x47abcc,_0x34335e,_0xd63a7d){return new Promise(function(_0x47d2c1,_0x401955){var _0x11378a=![];var _0x13b5fe={'method':_0x5c5c('0xb'),'uri':_0xd63a7d+_0x5c5c('0xc'),'json':!![]};_0x13b5fe[_0x5c5c('0xd')]=_0x34335e;logger[_0x5c5c('0xe')](_0x5c5c('0xf'));return rp(_0x13b5fe)[_0x5c5c('0x10')](function(_0x3df757){if(_0x3df757){var _0x3a7cdb=_0x3df757[_0x5c5c('0x11')];var _0x155f4b=null;for(_0x155f4b=0x0;_0x155f4b<_0x3a7cdb[_0x5c5c('0x12')];_0x155f4b++){if(_0x3a7cdb[_0x155f4b]['email']===_0x3b8390[_0x5c5c('0x13')]){_0x3b8390[_0x5c5c('0x14')]=_0x3a7cdb[_0x155f4b]['id'];_0x11378a=!![];}}if(_0x11378a){logger['info'](_0x5c5c('0x15'),_0x3b8390['adminId']);_0x47d2c1(_0x3b8390);}else{_0x401955({'statusCode':0x194,'message':_0x5c5c('0x16')});}}else{_0x401955({'statusCode':0x194,'message':_0x5c5c('0x16')});}})['catch'](function(_0x410c77){logger[_0x5c5c('0x17')]('['+[_0x47abcc[_0x5c5c('0x18')]()]+']',_0x410c77[_0x5c5c('0x19')]);_0x401955(_0x410c77);});});}function getUser(_0x4cc445,_0x51d925,_0x214498){return function(_0x400b2e){return new Promise(function(_0x30d73b,_0x3dee9e){var _0x108f84={'method':_0x5c5c('0xb'),'uri':_0x214498+_0x5c5c('0xc'),'json':!![]};_0x108f84[_0x5c5c('0xd')]=_0x51d925;logger['info'](_0x5c5c('0x1a'));return rp(_0x108f84)[_0x5c5c('0x10')](function(_0x12f481){if(_0x12f481){var _0x515550=_0x12f481[_0x5c5c('0x11')];var _0xc0014=![];var _0x11187e=null;if(_0x400b2e['agentEmail']!==null){logger[_0x5c5c('0xe')]('Getting\x20user\x20with\x20email',_0x400b2e['agentEmail']);_0x400b2e['userEmail']=_0x400b2e['agentEmail'];for(_0x11187e=0x0;_0x11187e<_0x515550[_0x5c5c('0x12')];_0x11187e++){if(_0x515550[_0x11187e]['email']===_0x400b2e['agentEmail']){_0xc0014=!![];_0x400b2e[_0x5c5c('0x1b')]=_0x515550[_0x11187e]['id'];logger[_0x5c5c('0xe')](_0x5c5c('0x1c'),_0x400b2e[_0x5c5c('0x1b')]);}}}if(!_0xc0014){logger[_0x5c5c('0xe')]('Admin\x20selected');_0x400b2e[_0x5c5c('0x1d')]=_0x400b2e['adminEmail'];_0x400b2e[_0x5c5c('0x1b')]=_0x400b2e[_0x5c5c('0x14')];_0xc0014=!![];}if(_0xc0014){_0x30d73b(_0x400b2e);}else{_0x3dee9e({'statusCode':0x194,'message':_0x5c5c('0x16')});}}else{_0x3dee9e({'statusCode':0x194,'message':_0x5c5c('0x16')});}})['catch'](function(_0x5c79d6){logger['error']('['+[_0x4cc445[_0x5c5c('0x18')]()]+']',_0x5c79d6[_0x5c5c('0x19')]);_0x3dee9e(_0x5c79d6);});});};}function searchContact(_0x218d7c,_0x4f5767,_0x1976a2,_0x2c9ef6){return new Promise(function(_0x1773f6,_0xd7fe28){var _0x2a0c23={'method':_0x5c5c('0xb'),'headers':_0x4f5767,'uri':_0x218d7c+_0x5c5c('0x1e')+_0x2c9ef6+_0x5c5c('0x1f')+_0x1976a2+_0x5c5c('0x20'),'json':!![]};rp(_0x2a0c23)['then'](function(_0x1703cf){var _0x2aa602=_[_0x5c5c('0x21')](_0x1703cf[_0x5c5c('0x22')][_0x5c5c('0x22')],[_0x1976a2,_0x2c9ef6]);_0x1773f6(_0x2aa602);})[_0x5c5c('0x23')](function(_0x4c9d16){_0xd7fe28(_0x4c9d16);});});}function getEndUser(_0x54da62,_0x6b77dc,_0x45f7e3){return function(_0x2e1c2a){return new Promise(function(_0xeb1788,_0xfff15e){logger[_0x5c5c('0xe')](util[_0x5c5c('0x24')]('Searching\x20contact\x20with\x20phone\x20%s',_0x2e1c2a[_0x5c5c('0x25')]));searchContact(_0x45f7e3,_0x6b77dc,'mobile_number',_0x2e1c2a['contactNumber'])[_0x5c5c('0x10')](function(_0x2dd1e0){if(_0x2dd1e0){_0x2e1c2a[_0x5c5c('0x26')]=_0x2dd1e0['id'];logger[_0x5c5c('0xe')](_0x5c5c('0x27'),_0x2e1c2a[_0x5c5c('0x26')]);return _0xeb1788(_0x2e1c2a);}searchContact(_0x45f7e3,_0x6b77dc,'work_number',_0x2e1c2a[_0x5c5c('0x25')])[_0x5c5c('0x10')](function(_0x38a1b6){if(_0x38a1b6){_0x2e1c2a[_0x5c5c('0x26')]=_0x38a1b6['id'];logger[_0x5c5c('0xe')](_0x5c5c('0x28'),_0x2e1c2a[_0x5c5c('0x26')]);return _0xeb1788(_0x2e1c2a);}createEndUser(_0x2e1c2a,_0x54da62,_0x6b77dc,_0x45f7e3)['then'](function(_0xaff60b){logger['info'](_0x5c5c('0x29'),_0xaff60b[_0x5c5c('0x26')]);return _0xeb1788(_0xaff60b);});});})['catch'](function(_0xc12c69){_0xfff15e(_0xc12c69);});});};}function createEndUser(_0x1a62b2,_0x2c1e13,_0x4b0955,_0x595615){return new Promise(function(_0x3bf05c,_0x57ea8d){var _0x187e5d=moment();var _0x8d9271={'method':'POST','uri':_0x595615+_0x5c5c('0x2a'),'body':{'contact':{'last_name':_0x1a62b2[_0x5c5c('0x25')],'work_number':_0x1a62b2[_0x5c5c('0x25')],'mobile_number':_0x1a62b2[_0x5c5c('0x25')],'owner_id':_0x1a62b2[_0x5c5c('0x1b')],'created_at':_0x187e5d[_0x5c5c('0x24')]('YYYY-MM-DDTHH:mm:ss')}},'json':!![]};_0x8d9271[_0x5c5c('0xd')]=_0x4b0955;logger[_0x5c5c('0xe')](_0x5c5c('0x2b'));return rp(_0x8d9271)[_0x5c5c('0x10')](function(_0x1084e0){_0x1a62b2[_0x5c5c('0x26')]=_0x1084e0[_0x5c5c('0x2c')]['id'];_0x3bf05c(_0x1a62b2);})[_0x5c5c('0x23')](function(_0x160adb){logger[_0x5c5c('0x17')]('['+[_0x2c1e13[_0x5c5c('0x18')]()]+']',_0x160adb[_0x5c5c('0x19')]);_0x57ea8d(_0x160adb[_0x5c5c('0x19')]);});});}function getTicket(_0x24ad53,_0x35c1fd,_0x3ae4b3,_0x55a25d,_0x3112a5){return function(_0x92f42e){logger[_0x5c5c('0xe')]('Creating\x20new\x20task');return new Promise(function(_0x3fcdfb,_0xf72de5){var _0x30bc7a=moment();var _0x1e4319={'method':_0x5c5c('0x2d'),'uri':_0x3ae4b3+_0x5c5c('0x2e'),'body':{'title':intUtil['getString'](_0x55a25d['Subjects'],_0x3112a5,'\x20'),'description':intUtil['getString'](_0x55a25d['Descriptions'],_0x3112a5,'\x0a'),'owner_id':_0x92f42e[_0x5c5c('0x1b')],'creater_id':_0x92f42e['adminId'],'targetable_id':_0x92f42e['endUserId'],'targetable_type':_0x5c5c('0x2f'),'created_at':_0x30bc7a[_0x5c5c('0x24')](_0x5c5c('0x30')),'due_date':_0x30bc7a['add'](0x1e,'m')['format'](_0x5c5c('0x30'))},'json':!![]};_0x1e4319[_0x5c5c('0xd')]=_0x35c1fd;return rp(_0x1e4319)[_0x5c5c('0x10')](function(_0x5d1ea3){_0x92f42e[_0x5c5c('0x31')]=_0x5d1ea3['task']['id'];logger[_0x5c5c('0xe')](_0x5c5c('0x32'),_0x92f42e['ticketId']);_0x3fcdfb(_0x92f42e);})[_0x5c5c('0x23')](function(_0x4bdf5b){logger[_0x5c5c('0x17')]('['+[_0x24ad53[_0x5c5c('0x18')]()]+']',_0x4bdf5b['message']);_0xf72de5(_0x4bdf5b[_0x5c5c('0x19')]);});});};}function emit(_0x2a3e80,_0x1889ba,_0x37264e){var _0x52b2c4={'uri':_0x2a3e80+'/contacts/'+_0x37264e};io['to'](util[_0x5c5c('0x24')](_0x5c5c('0x33'),_0x1889ba))[_0x5c5c('0x34')](_0x5c5c('0x35'),_0x52b2c4);}exports['cs']=function(_0x5482e6,_0x18356d,_0x13c557,_0x35eb19,_0x3b52bb,_0x2501af,_0x55b586,_0x16f445){var _0x2bdf49={};var _0x4b3798={'Authorization':_0x5c5c('0x36')+_0x2501af[_0x5c5c('0x37')]};_0x2501af[_0x5c5c('0x38')]=intUtil[_0x5c5c('0x39')](_0x2501af['remoteUri']);_0x2501af['serverUrl']=intUtil[_0x5c5c('0x39')](_0x2501af[_0x5c5c('0x3a')]);var _0xab3725=_0x2501af[_0x5c5c('0x38')];_0x2bdf49[_0x5c5c('0x13')]=_0x2501af[_0x5c5c('0x3b')];_0x2bdf49[_0x5c5c('0x25')]=_0x16f445[_0x5c5c('0x3c')]()===_0x5c5c('0x3d')?_0x18356d[_0x5c5c('0x3e')]:_0x18356d[_0x5c5c('0x3f')];_0x2bdf49['callDirection']=_0x16f445===_0x5c5c('0x40')||_0x16f445===_0x5c5c('0x41')?'queue':'outbound';if(_0x35eb19){_0x2bdf49[_0x5c5c('0x42')]=_0x35eb19[_0x5c5c('0x43')];}var _0xb22fe1=util[_0x5c5c('0x24')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2501af[_0x5c5c('0x3a')],_0x18356d[_0x5c5c('0x44')],md5(_0x18356d[_0x5c5c('0x44')]));if(_0x3b52bb&&_0x3b52bb['monitor_format']){logger[_0x5c5c('0xe')](_0x5c5c('0x45'),_0x5c5c('0x46'));_0x18356d[_0x5c5c('0x47')]=_0xb22fe1;}else if(_0x55b586&&_0x55b586[_0x5c5c('0x48')]&&_0x55b586['recordingFormat']!==_0x5c5c('0x49')){logger['info'](_0x5c5c('0x4a'),_0x5c5c('0x46'));_0x18356d[_0x5c5c('0x47')]=_0xb22fe1;}else{_0x18356d[_0x5c5c('0x47')]='';}return getAdminId(_0x2bdf49,_0x16f445,_0x4b3798,_0xab3725)[_0x5c5c('0x10')](getUser(_0x16f445,_0x4b3798,_0xab3725))['then'](getEndUser(_0x16f445,_0x4b3798,_0xab3725))[_0x5c5c('0x10')](getTicket(_0x16f445,_0x4b3798,_0xab3725,_0x13c557,_0x18356d))[_0x5c5c('0x10')](function(_0x2869cc){logger[_0x5c5c('0xe')](util[_0x5c5c('0x24')](_0x5c5c('0x4b'),_0x2869cc['ticketId']));if(_0x16f445!==_0x5c5c('0x41')){logger[_0x5c5c('0xe')]('['+[_0x16f445[_0x5c5c('0x18')]()]+']',_0x5c5c('0x4c'));emit(_0xab3725,_0x35eb19[_0x5c5c('0x4d')],_0x2869cc[_0x5c5c('0x26')]);}})[_0x5c5c('0x23')](function(_0x4fa238){logger[_0x5c5c('0x17')]('['+[_0x16f445[_0x5c5c('0x18')]()]+_0x5c5c('0x4e'),util[_0x5c5c('0x4f')](_0x4fa238,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xbaac=['Token\x20token=','apiKey','remoteUri','stripTrailingSlash','serverUrl','toLowerCase','outbound','destcalleridnum','callDirection','queue','unmanaged','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','request-promise','md5','util','bluebird','ioredis','./util','../../../../config/environment','../../../../config/logger','freshsales','redis','defaults','localhost','GET','/api/selector/owners','length','email','adminId','info','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','error','message','headers','Getting\x20user\x20list','users','Getting\x20user\x20with\x20email','agentEmail','userEmail','userId','User\x20found:','Admin\x20selected','adminEmail','toUpperCase','/api/lookup?q=','&f=','&entities=contact','find','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','then','endUserId','work_number','Contact\x20found\x20work_number:','POST','/api/contacts','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','/api/tasks','getString','Subjects','Descriptions','Contact','add','ticketId','task','/contacts/','user:%s','emit','trigger:browser:url'];(function(_0x464203,_0x15ece3){var _0x2e220a=function(_0x2d61d9){while(--_0x2d61d9){_0x464203['push'](_0x464203['shift']());}};_0x2e220a(++_0x15ece3);}(_0xbaac,0x168));var _0xcbaa=function(_0x1e5de7,_0x43cf47){_0x1e5de7=_0x1e5de7-0x0;var _0x1fcccc=_0xbaac[_0x1e5de7];return _0x1fcccc;};'use strict';var _=require(_0xcbaa('0x0'));var rp=require(_0xcbaa('0x1'));var md5=require(_0xcbaa('0x2'));var util=require(_0xcbaa('0x3'));var moment=require('moment');var Promise=require(_0xcbaa('0x4'));var Redis=require(_0xcbaa('0x5'));var intUtil=require(_0xcbaa('0x6'));var config=require(_0xcbaa('0x7'));var logger=require(_0xcbaa('0x8'))(_0xcbaa('0x9'));config[_0xcbaa('0xa')]=_[_0xcbaa('0xb')](config[_0xcbaa('0xa')],{'host':_0xcbaa('0xc'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xcbaa('0xa')]));function getAdminId(_0x31c8a9,_0x4ade27,_0x3f3aa9,_0x405062){return new Promise(function(_0x45e957,_0x4f05e9){var _0x1172b9=![];var _0x29ef50={'method':_0xcbaa('0xd'),'uri':_0x405062+_0xcbaa('0xe'),'json':!![]};_0x29ef50['headers']=_0x3f3aa9;logger['info']('Getting\x20admin\x20information');return rp(_0x29ef50)['then'](function(_0x373c00){if(_0x373c00){var _0x52c155=_0x373c00['users'];var _0x12ff0c=null;for(_0x12ff0c=0x0;_0x12ff0c<_0x52c155[_0xcbaa('0xf')];_0x12ff0c++){if(_0x52c155[_0x12ff0c][_0xcbaa('0x10')]===_0x31c8a9['adminEmail']){_0x31c8a9[_0xcbaa('0x11')]=_0x52c155[_0x12ff0c]['id'];_0x1172b9=!![];}}if(_0x1172b9){logger[_0xcbaa('0x12')](_0xcbaa('0x13'),_0x31c8a9[_0xcbaa('0x11')]);_0x45e957(_0x31c8a9);}else{_0x4f05e9({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x4f05e9({'statusCode':0x194,'message':_0xcbaa('0x14')});}})[_0xcbaa('0x15')](function(_0x4092dd){logger[_0xcbaa('0x16')]('['+[_0x4ade27['toUpperCase']()]+']',_0x4092dd[_0xcbaa('0x17')]);_0x4f05e9(_0x4092dd);});});}function getUser(_0x14eb10,_0x241b78,_0x19ef58){return function(_0x744b20){return new Promise(function(_0x3d464c,_0x198974){var _0x4182ec={'method':'GET','uri':_0x19ef58+_0xcbaa('0xe'),'json':!![]};_0x4182ec[_0xcbaa('0x18')]=_0x241b78;logger[_0xcbaa('0x12')](_0xcbaa('0x19'));return rp(_0x4182ec)['then'](function(_0x29f8b5){if(_0x29f8b5){var _0x32111b=_0x29f8b5[_0xcbaa('0x1a')];var _0x484015=![];var _0x1e7907=null;if(_0x744b20['agentEmail']!==null){logger[_0xcbaa('0x12')](_0xcbaa('0x1b'),_0x744b20[_0xcbaa('0x1c')]);_0x744b20[_0xcbaa('0x1d')]=_0x744b20[_0xcbaa('0x1c')];for(_0x1e7907=0x0;_0x1e7907<_0x32111b['length'];_0x1e7907++){if(_0x32111b[_0x1e7907][_0xcbaa('0x10')]===_0x744b20[_0xcbaa('0x1c')]){_0x484015=!![];_0x744b20[_0xcbaa('0x1e')]=_0x32111b[_0x1e7907]['id'];logger[_0xcbaa('0x12')](_0xcbaa('0x1f'),_0x744b20[_0xcbaa('0x1e')]);}}}if(!_0x484015){logger[_0xcbaa('0x12')](_0xcbaa('0x20'));_0x744b20[_0xcbaa('0x1d')]=_0x744b20[_0xcbaa('0x21')];_0x744b20['userId']=_0x744b20['adminId'];_0x484015=!![];}if(_0x484015){_0x3d464c(_0x744b20);}else{_0x198974({'statusCode':0x194,'message':_0xcbaa('0x14')});}}else{_0x198974({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0xcbaa('0x15')](function(_0x420214){logger[_0xcbaa('0x16')]('['+[_0x14eb10[_0xcbaa('0x22')]()]+']',_0x420214[_0xcbaa('0x17')]);_0x198974(_0x420214);});});};}function searchContact(_0x3d4d3e,_0x392566,_0x1de6c1,_0x413c33){return new Promise(function(_0x5b59b5,_0x374272){var _0x58869b={'method':'GET','headers':_0x392566,'uri':_0x3d4d3e+_0xcbaa('0x23')+_0x413c33+_0xcbaa('0x24')+_0x1de6c1+_0xcbaa('0x25'),'json':!![]};rp(_0x58869b)['then'](function(_0x5bd6d5){var _0x51721a=_[_0xcbaa('0x26')](_0x5bd6d5[_0xcbaa('0x27')][_0xcbaa('0x27')],[_0x1de6c1,_0x413c33]);_0x5b59b5(_0x51721a);})[_0xcbaa('0x15')](function(_0x3228eb){_0x374272(_0x3228eb);});});}function getEndUser(_0x4bd1c9,_0x7d4986,_0x2264b7){return function(_0x2bff6e){return new Promise(function(_0x3d3217,_0x44b3e6){logger[_0xcbaa('0x12')](util[_0xcbaa('0x28')](_0xcbaa('0x29'),_0x2bff6e[_0xcbaa('0x2a')]));searchContact(_0x2264b7,_0x7d4986,_0xcbaa('0x2b'),_0x2bff6e[_0xcbaa('0x2a')])[_0xcbaa('0x2c')](function(_0x230ea3){if(_0x230ea3){_0x2bff6e[_0xcbaa('0x2d')]=_0x230ea3['id'];logger[_0xcbaa('0x12')]('Contact\x20found\x20mobile_number:',_0x2bff6e['endUserId']);return _0x3d3217(_0x2bff6e);}searchContact(_0x2264b7,_0x7d4986,_0xcbaa('0x2e'),_0x2bff6e['contactNumber'])[_0xcbaa('0x2c')](function(_0x545604){if(_0x545604){_0x2bff6e[_0xcbaa('0x2d')]=_0x545604['id'];logger['info'](_0xcbaa('0x2f'),_0x2bff6e[_0xcbaa('0x2d')]);return _0x3d3217(_0x2bff6e);}createEndUser(_0x2bff6e,_0x4bd1c9,_0x7d4986,_0x2264b7)[_0xcbaa('0x2c')](function(_0x1beac6){logger['info']('Contact\x20created:',_0x1beac6[_0xcbaa('0x2d')]);return _0x3d3217(_0x1beac6);});});})[_0xcbaa('0x15')](function(_0x277597){_0x44b3e6(_0x277597);});});};}function createEndUser(_0x57c7a8,_0x2c614a,_0x423b98,_0xff00b7){return new Promise(function(_0x838aa2,_0x1252f1){var _0x1e1821=moment();var _0x402716={'method':_0xcbaa('0x30'),'uri':_0xff00b7+_0xcbaa('0x31'),'body':{'contact':{'last_name':_0x57c7a8['contactNumber'],'work_number':_0x57c7a8['contactNumber'],'mobile_number':_0x57c7a8[_0xcbaa('0x2a')],'owner_id':_0x57c7a8[_0xcbaa('0x1e')],'created_at':_0x1e1821['format'](_0xcbaa('0x32'))}},'json':!![]};_0x402716[_0xcbaa('0x18')]=_0x423b98;logger[_0xcbaa('0x12')](_0xcbaa('0x33'));return rp(_0x402716)[_0xcbaa('0x2c')](function(_0xe4457a){_0x57c7a8['endUserId']=_0xe4457a[_0xcbaa('0x34')]['id'];_0x838aa2(_0x57c7a8);})['catch'](function(_0x229cf5){logger['error']('['+[_0x2c614a[_0xcbaa('0x22')]()]+']',_0x229cf5[_0xcbaa('0x17')]);_0x1252f1(_0x229cf5[_0xcbaa('0x17')]);});});}function getTicket(_0x584e8a,_0x512eb4,_0x24a31a,_0x3c0406,_0x558c2d){return function(_0xd89f46){logger['info']('Creating\x20new\x20task');return new Promise(function(_0x38d434,_0x2b2fb4){var _0x21ead1=moment();var _0x507d6e={'method':_0xcbaa('0x30'),'uri':_0x24a31a+_0xcbaa('0x35'),'body':{'title':intUtil[_0xcbaa('0x36')](_0x3c0406[_0xcbaa('0x37')],_0x558c2d,'\x20'),'description':intUtil[_0xcbaa('0x36')](_0x3c0406[_0xcbaa('0x38')],_0x558c2d,'\x0a'),'owner_id':_0xd89f46[_0xcbaa('0x1e')],'creater_id':_0xd89f46[_0xcbaa('0x11')],'targetable_id':_0xd89f46[_0xcbaa('0x2d')],'targetable_type':_0xcbaa('0x39'),'created_at':_0x21ead1[_0xcbaa('0x28')](_0xcbaa('0x32')),'due_date':_0x21ead1[_0xcbaa('0x3a')](0x1e,'m')[_0xcbaa('0x28')]('YYYY-MM-DDTHH:mm:ss')},'json':!![]};_0x507d6e[_0xcbaa('0x18')]=_0x512eb4;return rp(_0x507d6e)[_0xcbaa('0x2c')](function(_0x1e0cf4){_0xd89f46[_0xcbaa('0x3b')]=_0x1e0cf4[_0xcbaa('0x3c')]['id'];logger[_0xcbaa('0x12')]('Task\x20created:',_0xd89f46['ticketId']);_0x38d434(_0xd89f46);})[_0xcbaa('0x15')](function(_0x535565){logger[_0xcbaa('0x16')]('['+[_0x584e8a[_0xcbaa('0x22')]()]+']',_0x535565[_0xcbaa('0x17')]);_0x2b2fb4(_0x535565['message']);});});};}function emit(_0x1f67db,_0x116126,_0x4c943e){var _0x507709={'uri':_0x1f67db+_0xcbaa('0x3d')+_0x4c943e};io['to'](util[_0xcbaa('0x28')](_0xcbaa('0x3e'),_0x116126))[_0xcbaa('0x3f')](_0xcbaa('0x40'),_0x507709);}exports['cs']=function(_0x3afb6f,_0x15404f,_0x10263a,_0x5db0f2,_0xcb0ea8,_0x41f14d,_0x5a0b5b,_0x4ee924){var _0x1bd44e={};var _0x10f971={'Authorization':_0xcbaa('0x41')+_0x41f14d[_0xcbaa('0x42')]};_0x41f14d[_0xcbaa('0x43')]=intUtil[_0xcbaa('0x44')](_0x41f14d[_0xcbaa('0x43')]);_0x41f14d['serverUrl']=intUtil[_0xcbaa('0x44')](_0x41f14d[_0xcbaa('0x45')]);var _0x4d85c6=_0x41f14d[_0xcbaa('0x43')];_0x1bd44e['adminEmail']=_0x41f14d['username'];_0x1bd44e[_0xcbaa('0x2a')]=_0x4ee924[_0xcbaa('0x46')]()===_0xcbaa('0x47')?_0x15404f[_0xcbaa('0x48')]:_0x15404f['calleridnum'];_0x1bd44e[_0xcbaa('0x49')]=_0x4ee924===_0xcbaa('0x4a')||_0x4ee924===_0xcbaa('0x4b')?_0xcbaa('0x4a'):_0xcbaa('0x47');if(_0x5db0f2){_0x1bd44e[_0xcbaa('0x1c')]=_0x5db0f2['email'];}var _0x68532a=util[_0xcbaa('0x28')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x41f14d[_0xcbaa('0x45')],_0x15404f['uniqueid'],md5(_0x15404f[_0xcbaa('0x4c')]));if(_0xcb0ea8&&_0xcb0ea8['monitor_format']){logger['info'](_0xcbaa('0x4d'),_0xcbaa('0x4e'));_0x15404f[_0xcbaa('0x4f')]=_0x68532a;}else if(_0x5a0b5b&&_0x5a0b5b[_0xcbaa('0x50')]&&_0x5a0b5b[_0xcbaa('0x50')]!==_0xcbaa('0x51')){logger[_0xcbaa('0x12')](_0xcbaa('0x52'),_0xcbaa('0x4e'));_0x15404f[_0xcbaa('0x4f')]=_0x68532a;}else{_0x15404f['recordingURL']='';}return getAdminId(_0x1bd44e,_0x4ee924,_0x10f971,_0x4d85c6)[_0xcbaa('0x2c')](getUser(_0x4ee924,_0x10f971,_0x4d85c6))[_0xcbaa('0x2c')](getEndUser(_0x4ee924,_0x10f971,_0x4d85c6))[_0xcbaa('0x2c')](getTicket(_0x4ee924,_0x10f971,_0x4d85c6,_0x10263a,_0x15404f))[_0xcbaa('0x2c')](function(_0x42c6cc){logger[_0xcbaa('0x12')](util[_0xcbaa('0x28')]('The\x20ticket\x20ID\x20is:\x20%s',_0x42c6cc[_0xcbaa('0x3b')]));if(_0x4ee924!==_0xcbaa('0x4b')){logger['info']('['+[_0x4ee924[_0xcbaa('0x22')]()]+']','Displaying\x20task\x20in\x20a\x20new\x20tab...');emit(_0x4d85c6,_0x5db0f2['name'],_0x42c6cc['endUserId']);}})[_0xcbaa('0x15')](function(_0xb9f171){logger['error']('['+[_0x4ee924[_0xcbaa('0x22')]()]+_0xcbaa('0x53'),util[_0xcbaa('0x54')](_0xb9f171,{'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 cbe6886..7aa2e9c 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 _0xe899=['log','EVENT\x20UNKNOWN','data1','zendesk','salesforce','zoho','../../../../config/logger','error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','%s\x20account\x20#%s\x20not\x20found','util','./sugarcrm','./freshdesk','./zoho','./vtiger','./servicenow','./dynamics365','sugarcrm','desk','vtiger','dynamics365','freshsales','servicenow','includes','toLowerCase','data2','find','Configurations','data3','queue','routeId'];(function(_0x20a695,_0x7a391c){var _0x259658=function(_0x43d62a){while(--_0x43d62a){_0x20a695['push'](_0x20a695['shift']());}};_0x259658(++_0x7a391c);}(_0xe899,0xf3));var _0x9e89=function(_0x380a3f,_0x202483){_0x380a3f=_0x380a3f-0x0;var _0x2b4eca=_0xe899[_0x380a3f];return _0x2b4eca;};'use strict';var _=require('lodash');var util=require(_0x9e89('0x0'));var zendesk=require('./zendesk');var salesforce=require('./salesforce');var sugarcrm=require(_0x9e89('0x1'));var freshdesk=require(_0x9e89('0x2'));var zoho=require(_0x9e89('0x3'));var desk=require('./desk');var vtiger=require(_0x9e89('0x4'));var servicenow=require(_0x9e89('0x5'));var dynamics365=require(_0x9e89('0x6'));var freshsales=require('./freshsales');var integrations=['zendesk','salesforce',_0x9e89('0x7'),'freshdesk','zoho',_0x9e89('0x8'),_0x9e89('0x9'),_0x9e89('0xa'),_0x9e89('0xb'),_0x9e89('0xc')];exports['exec']=function(_0x51bb35,_0x545073,_0x344a1e,_0x15392e,_0xf0edf1,_0x343088){if(_0x344a1e){if(_[_0x9e89('0xd')](integrations,_0x51bb35['data1'][_0x9e89('0xe')]())){try{var _0x5e0d06=null;var _0x3f83a5='';var _0x17dbfd=_0x344a1e[_0x51bb35['data1'][_0x9e89('0xe')]()];if(_0x17dbfd){var _0x20b6b4=_0x17dbfd[_0x51bb35[_0x9e89('0xf')]];if(_0x20b6b4){var _0x149fde=_[_0x9e89('0x10')](_0x20b6b4[_0x9e89('0x11')],{'id':parseInt(_0x51bb35[_0x9e89('0x12')],0xa)});if(_0x149fde){if(_0x15392e){if(_0xf0edf1&&_0x545073[_0x9e89('0x13')]){_0x3f83a5=_0x9e89('0x13');}else if(_0x545073[_0x9e89('0x14')]){_0x3f83a5='outbound';}else{console[_0x9e89('0x15')](_0x9e89('0x16'),_0x545073);}}else{_0x3f83a5='unmanaged';}switch(_0x51bb35[_0x9e89('0x17')]['toLowerCase']()){case _0x9e89('0x18'):zendesk[_0x3f83a5](_0x51bb35,_0x545073,_0x149fde,_0x15392e,_0xf0edf1,_0x20b6b4,_0x343088);break;case _0x9e89('0x19'):salesforce[_0x3f83a5](_0x51bb35,_0x545073,_0x149fde,_0x15392e,_0xf0edf1,_0x20b6b4,_0x343088);break;case _0x9e89('0x7'):sugarcrm[_0x3f83a5](_0x51bb35,_0x545073,_0x149fde,_0x15392e,_0xf0edf1,_0x20b6b4,_0x343088);break;case'freshdesk':freshdesk[_0x3f83a5](_0x51bb35,_0x545073,_0x149fde,_0x15392e,_0xf0edf1,_0x20b6b4,_0x343088);break;case _0x9e89('0x1a'):zoho[_0x3f83a5](_0x51bb35,_0x545073,_0x149fde,_0x15392e,_0xf0edf1,_0x20b6b4,_0x343088);break;case _0x9e89('0x8'):desk[_0x3f83a5](_0x51bb35,_0x545073,_0x149fde,_0x15392e,_0xf0edf1,_0x20b6b4,_0x343088);break;case _0x9e89('0x9'):vtiger[_0x3f83a5](_0x51bb35,_0x545073,_0x149fde,_0x15392e,_0xf0edf1,_0x20b6b4,_0x343088);break;case _0x9e89('0xb'):freshsales['cs'](_0x51bb35,_0x545073,_0x149fde,_0x15392e,_0xf0edf1,_0x20b6b4,_0x343088,_0x3f83a5);break;case'servicenow':servicenow['cs'](_0x51bb35,_0x545073,_0x149fde,_0x15392e,_0xf0edf1,_0x20b6b4,_0x343088,_0x3f83a5);break;case _0x9e89('0xa'):dynamics365['cs'](_0x51bb35,_0x545073,_0x149fde,_0x15392e,_0xf0edf1,_0x20b6b4,_0x343088,_0x3f83a5);break;default:console['log']('unknown\x20integration');}}else{_0x5e0d06=require(_0x9e89('0x1b'))(_0x51bb35[_0x9e89('0x17')][_0x9e89('0xe')]());_0x5e0d06[_0x9e89('0x1c')](_0x9e89('0x1d'),util[_0x9e89('0x1e')](_0x9e89('0x1f'),_0x51bb35[_0x9e89('0x17')][_0x9e89('0xe')](),_0x51bb35[_0x9e89('0x12')]));}}else{_0x5e0d06=require(_0x9e89('0x1b'))(_0x51bb35['data1'][_0x9e89('0xe')]());_0x5e0d06['error'](_0x9e89('0x1d'),util[_0x9e89('0x1e')](_0x9e89('0x20'),_0x51bb35[_0x9e89('0x17')][_0x9e89('0xe')](),_0x51bb35[_0x9e89('0xf')]));}}else{}}catch(_0x105f03){console[_0x9e89('0x1c')](_0x105f03);}}}}; \ No newline at end of file +var _0x5582=['log','unmanaged','zendesk','sugarcrm','servicenow','unknown\x20integration','error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','data3','../../../../config/logger','%s\x20account\x20#%s\x20not\x20found','data2','lodash','util','./zendesk','./zoho','./vtiger','./servicenow','./dynamics365','./freshsales','salesforce','freshdesk','zoho','desk','vtiger','dynamics365','freshsales','exec','includes','toLowerCase','data1','find','Configurations','queue','routeId','outbound'];(function(_0x387777,_0x356171){var _0x3f84c0=function(_0x4d4423){while(--_0x4d4423){_0x387777['push'](_0x387777['shift']());}};_0x3f84c0(++_0x356171);}(_0x5582,0x118));var _0x2558=function(_0x55445b,_0x164097){_0x55445b=_0x55445b-0x0;var _0x18ef20=_0x5582[_0x55445b];return _0x18ef20;};'use strict';var _=require(_0x2558('0x0'));var util=require(_0x2558('0x1'));var zendesk=require(_0x2558('0x2'));var salesforce=require('./salesforce');var sugarcrm=require('./sugarcrm');var freshdesk=require('./freshdesk');var zoho=require(_0x2558('0x3'));var desk=require('./desk');var vtiger=require(_0x2558('0x4'));var servicenow=require(_0x2558('0x5'));var dynamics365=require(_0x2558('0x6'));var freshsales=require(_0x2558('0x7'));var integrations=['zendesk',_0x2558('0x8'),'sugarcrm',_0x2558('0x9'),_0x2558('0xa'),_0x2558('0xb'),_0x2558('0xc'),_0x2558('0xd'),_0x2558('0xe'),'servicenow'];exports[_0x2558('0xf')]=function(_0x2ed98e,_0x54e78d,_0x57c5a9,_0x27c1bc,_0x5846bc,_0x23ee25){if(_0x57c5a9){if(_[_0x2558('0x10')](integrations,_0x2ed98e['data1'][_0x2558('0x11')]())){try{var _0x3287b6=null;var _0xadd277='';var _0x1bba42=_0x57c5a9[_0x2ed98e[_0x2558('0x12')]['toLowerCase']()];if(_0x1bba42){var _0x5643d8=_0x1bba42[_0x2ed98e['data2']];if(_0x5643d8){var _0x3a4912=_[_0x2558('0x13')](_0x5643d8[_0x2558('0x14')],{'id':parseInt(_0x2ed98e['data3'],0xa)});if(_0x3a4912){if(_0x27c1bc){if(_0x5846bc&&_0x54e78d['queue']){_0xadd277=_0x2558('0x15');}else if(_0x54e78d[_0x2558('0x16')]){_0xadd277=_0x2558('0x17');}else{console[_0x2558('0x18')]('EVENT\x20UNKNOWN',_0x54e78d);}}else{_0xadd277=_0x2558('0x19');}switch(_0x2ed98e['data1'][_0x2558('0x11')]()){case _0x2558('0x1a'):zendesk[_0xadd277](_0x2ed98e,_0x54e78d,_0x3a4912,_0x27c1bc,_0x5846bc,_0x5643d8,_0x23ee25);break;case'salesforce':salesforce[_0xadd277](_0x2ed98e,_0x54e78d,_0x3a4912,_0x27c1bc,_0x5846bc,_0x5643d8,_0x23ee25);break;case _0x2558('0x1b'):sugarcrm[_0xadd277](_0x2ed98e,_0x54e78d,_0x3a4912,_0x27c1bc,_0x5846bc,_0x5643d8,_0x23ee25);break;case _0x2558('0x9'):freshdesk[_0xadd277](_0x2ed98e,_0x54e78d,_0x3a4912,_0x27c1bc,_0x5846bc,_0x5643d8,_0x23ee25);break;case _0x2558('0xa'):zoho[_0xadd277](_0x2ed98e,_0x54e78d,_0x3a4912,_0x27c1bc,_0x5846bc,_0x5643d8,_0x23ee25);break;case'desk':desk[_0xadd277](_0x2ed98e,_0x54e78d,_0x3a4912,_0x27c1bc,_0x5846bc,_0x5643d8,_0x23ee25);break;case _0x2558('0xc'):vtiger[_0xadd277](_0x2ed98e,_0x54e78d,_0x3a4912,_0x27c1bc,_0x5846bc,_0x5643d8,_0x23ee25);break;case _0x2558('0xe'):freshsales['cs'](_0x2ed98e,_0x54e78d,_0x3a4912,_0x27c1bc,_0x5846bc,_0x5643d8,_0x23ee25,_0xadd277);break;case _0x2558('0x1c'):servicenow['cs'](_0x2ed98e,_0x54e78d,_0x3a4912,_0x27c1bc,_0x5846bc,_0x5643d8,_0x23ee25,_0xadd277);break;case _0x2558('0xd'):dynamics365['cs'](_0x2ed98e,_0x54e78d,_0x3a4912,_0x27c1bc,_0x5846bc,_0x5643d8,_0x23ee25,_0xadd277);break;default:console[_0x2558('0x18')](_0x2558('0x1d'));}}else{_0x3287b6=require('../../../../config/logger')(_0x2ed98e['data1']['toLowerCase']());_0x3287b6[_0x2558('0x1e')](_0x2558('0x1f'),util[_0x2558('0x20')](_0x2558('0x21'),_0x2ed98e[_0x2558('0x12')][_0x2558('0x11')](),_0x2ed98e[_0x2558('0x22')]));}}else{_0x3287b6=require(_0x2558('0x23'))(_0x2ed98e['data1'][_0x2558('0x11')]());_0x3287b6[_0x2558('0x1e')](_0x2558('0x1f'),util[_0x2558('0x20')](_0x2558('0x24'),_0x2ed98e[_0x2558('0x12')]['toLowerCase'](),_0x2ed98e[_0x2558('0x25')]));}}else{}}catch(_0xad89f7){console['error'](_0xad89f7);}}}}; \ 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 5abf625..050062d 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 _0xe4a0=['md5','jsforce','util','ioredis','../../../../config/environment','salesforce','redis','defaults','localhost','socket.io-emitter','emit','getString','Subjects','Descriptions','ticketType','Task','utc','IsReminderSet','IsRecurrence','endUserType','lead','WhoId','account','WhatId','contact','ContactId','leadId','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','isNil','User','find','execute','then','length','Email','resolve','info','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','user_id','display_name','moduleSearch','contact_lead','additionalSearchContact','$or','cloneDeep','additionalSearchLead','merge','Lead','account_contact_lead','additionalSearchAccount','Contact','first','Phone','attributes','type','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','','format','Caller\x20-\x20%s','Company','No\x20Company','Name','upperFirst','includes','string','picklist','idField','variableName','Variable','name','toLowerCase','toString','password','securityToken','remoteUri','clientId','login','username','Connection\x20established.','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','calleridnum','queue','[QUEUE]\x20Ticket\x20%s\x20created','user:%s','newTab','trigger:browser:url','instanceUrl','error','catch','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','Fields','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','lastevent','toUpperCase','request-promise','moment'];(function(_0x507996,_0x16eaba){var _0xa0ff4c=function(_0x3155ef){while(--_0x3155ef){_0x507996['push'](_0x507996['shift']());}};_0xa0ff4c(++_0x16eaba);}(_0xe4a0,0x163));var _0x0e4a=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xe4a0[_0x397e5f];return _0x5302b8;};'use strict';var _=require('lodash');var rp=require(_0x0e4a('0x0'));var moment=require(_0x0e4a('0x1'));var BPromise=require('bluebird');var md5=require(_0x0e4a('0x2'));var jsforce=require(_0x0e4a('0x3'));var util=require(_0x0e4a('0x4'));var Redis=require(_0x0e4a('0x5'));var intUtil=require('./util');var config=require(_0x0e4a('0x6'));var logger=require('../../../../config/logger')(_0x0e4a('0x7'));config[_0x0e4a('0x8')]=_[_0x0e4a('0x9')](config['redis'],{'host':_0x0e4a('0xa'),'port':0x18eb});var io=require(_0x0e4a('0xb'))(new Redis(config['redis']));function emit(_0x1e5302,_0x46bff3,_0x4f9816){io['to'](_0x1e5302)[_0x0e4a('0xc')](_0x46bff3,_0x4f9816);}function getTicket(_0x3d61fe,_0x510ee1,_0xedc8a1,_0x59da5e,_0x53828d,_0x128b02,_0x43a14b,_0x41b3f9){var _0x14dedd=Object['assign']({},{'OwnerId':_0x510ee1['id'],'Subject':intUtil[_0x0e4a('0xd')](_0x59da5e[_0x0e4a('0xe')],_0x53828d,'\x20'),'Description':intUtil[_0x0e4a('0xd')](_0x59da5e[_0x0e4a('0xf')],_0x53828d,'\x0a')},getCustomFields(_0x128b02,_0x53828d));if(_0xedc8a1){if(_0x59da5e[_0x0e4a('0x10')]===_0x0e4a('0x11')){_0x14dedd['ActivityDate']=moment[_0x0e4a('0x12')]();_0x14dedd[_0x0e4a('0x13')]=![];_0x14dedd[_0x0e4a('0x14')]=![];if(_0xedc8a1[_0x0e4a('0x15')]==='contact'||_0xedc8a1[_0x0e4a('0x15')]===_0x0e4a('0x16')){_0x14dedd[_0x0e4a('0x17')]=_0xedc8a1['id'];}else if(_0xedc8a1[_0x0e4a('0x15')]===_0x0e4a('0x18')){_0x14dedd[_0x0e4a('0x19')]=_0xedc8a1['id'];}}else if(_0x59da5e[_0x0e4a('0x10')]==='Case'){if(_0xedc8a1['endUserType']===_0x0e4a('0x1a')){_0x14dedd[_0x0e4a('0x1b')]=_0xedc8a1['id'];}else if(_0xedc8a1[_0x0e4a('0x15')]===_0x0e4a('0x18')){_0x14dedd['AccountId']=_0xedc8a1['id'];}else if(_0xedc8a1[_0x0e4a('0x15')]===_0x0e4a('0x16')&&_0x59da5e[_0x0e4a('0x1c')]){_0x14dedd[_0x59da5e[_0x0e4a('0x1c')]]=_0xedc8a1['id'];}else{logger['info'](_0x0e4a('0x1d'));}}}return _0x43a14b[_0x0e4a('0x1e')](_0x59da5e[_0x0e4a('0x10')])[_0x0e4a('0x1f')](_0x14dedd);}function getUser(_0xd1599a,_0x4759a1,_0x198b9a){if(!_[_0x0e4a('0x20')](_0x4759a1)&&intUtil['validateEmail'](_0x4759a1)){var _0x5a5773={'Email':_0x4759a1};var _0x49c142={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x198b9a['sobject'](_0x0e4a('0x21'))[_0x0e4a('0x22')](_0x5a5773,_0x49c142)[_0x0e4a('0x23')]()[_0x0e4a('0x24')](function(_0x47d472){if(_0x47d472[_0x0e4a('0x25')]){var _0x43f01b=_[_0x0e4a('0x22')](_0x47d472,function(_0x411490){return _0x411490[_0x0e4a('0x26')]===_0x4759a1;});if(_0x43f01b){logger['info']('Agent\x20%s\x20found.',_0x4759a1);return BPromise[_0x0e4a('0x27')]({'id':_0x43f01b['Id'],'name':_0x43f01b['Name']});}}else{logger[_0x0e4a('0x28')](_0x0e4a('0x29'),_0x4759a1);return _0x198b9a[_0x0e4a('0x2a')]()[_0x0e4a('0x24')](function(_0xfbe864){return BPromise[_0x0e4a('0x27')]({'id':_0xfbe864[_0x0e4a('0x2b')],'name':_0xfbe864[_0x0e4a('0x2c')]});});}});}else{logger['info'](_0x0e4a('0x29'),_0x4759a1);return _0x198b9a[_0x0e4a('0x2a')]()[_0x0e4a('0x24')](function(_0x67b719){return BPromise[_0x0e4a('0x27')]({'id':_0x67b719[_0x0e4a('0x2b')],'name':_0x67b719[_0x0e4a('0x2c')]});});}}function getEndUser(_0x3e5971,_0x2b1a0a,_0x8af41,_0x39ae29,_0x1129f2){var _0x53b1f3={'$or':{'Phone':_0x39ae29}};var _0x35be72={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x0e4a('0x27')]()[_0x0e4a('0x24')](function(){logger[_0x0e4a('0x28')]('Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.',_0x39ae29,_0x2b1a0a[_0x0e4a('0x2d')]);switch(_0x2b1a0a[_0x0e4a('0x2d')]){case _0x0e4a('0x2e'):var _0x222a01=_['cloneDeep'](_0x53b1f3);if(_0x2b1a0a['additionalSearchContact']){var _0x149ae0={};_0x149ae0[_0x2b1a0a[_0x0e4a('0x2f')]]=_0x39ae29;_['merge'](_0x222a01[_0x0e4a('0x30')],_0x149ae0);}return _0x1129f2[_0x0e4a('0x1e')]('Contact')[_0x0e4a('0x22')](_0x222a01,_0x35be72)[_0x0e4a('0x23')]()[_0x0e4a('0x24')](function(_0x5653e7){if(_0x5653e7&&_0x5653e7[_0x0e4a('0x25')]){return _0x5653e7;}else{var _0x2d7fd3=_[_0x0e4a('0x31')](_0x53b1f3);if(_0x2b1a0a['additionalSearchLead']){var _0x39aa93={};_0x39aa93[_0x2b1a0a[_0x0e4a('0x32')]]=_0x39ae29;_[_0x0e4a('0x33')](_0x2d7fd3[_0x0e4a('0x30')],_0x39aa93);}return _0x1129f2['sobject'](_0x0e4a('0x34'))['find'](_0x2d7fd3,_0x35be72);}});case _0x0e4a('0x35'):var _0x4746b0=_['cloneDeep'](_0x53b1f3);if(_0x2b1a0a[_0x0e4a('0x36')]){var _0x149ae0={};_0x149ae0[_0x2b1a0a[_0x0e4a('0x36')]]=_0x39ae29;_[_0x0e4a('0x33')](_0x4746b0[_0x0e4a('0x30')],_0x149ae0);}return _0x1129f2[_0x0e4a('0x1e')]('Account')[_0x0e4a('0x22')](_0x4746b0,_0x35be72)[_0x0e4a('0x23')]()[_0x0e4a('0x24')](function(_0x1206c9){if(_0x1206c9&&_0x1206c9[_0x0e4a('0x25')]){return _0x1206c9;}else{var _0x1f1bce=_[_0x0e4a('0x31')](_0x53b1f3);if(_0x2b1a0a['additionalSearchContact']){var _0xc0ecd7={};_0xc0ecd7[_0x2b1a0a['additionalSearchContact']]=_0x39ae29;_['merge'](_0x1f1bce[_0x0e4a('0x30')],_0xc0ecd7);}return _0x1129f2[_0x0e4a('0x1e')](_0x0e4a('0x37'))[_0x0e4a('0x22')](_0x1f1bce,_0x35be72)[_0x0e4a('0x24')](function(_0x4f434c){if(_0x4f434c&&_0x4f434c[_0x0e4a('0x25')]){return _0x4f434c;}else{var _0x478123=_['cloneDeep'](_0x53b1f3);if(_0x2b1a0a['additionalSearchLead']){var _0x11707d={};_0x11707d[_0x2b1a0a[_0x0e4a('0x32')]]=_0x39ae29;_[_0x0e4a('0x33')](_0x478123[_0x0e4a('0x30')],_0x11707d);}return _0x1129f2[_0x0e4a('0x1e')](_0x0e4a('0x34'))[_0x0e4a('0x22')](_0x478123,_0x35be72);}});}});case _0x0e4a('0x1a'):var _0x222a01=_['cloneDeep'](_0x53b1f3);if(_0x2b1a0a[_0x0e4a('0x2f')]){var _0x149ae0={};_0x149ae0[_0x2b1a0a[_0x0e4a('0x2f')]]=_0x39ae29;_['merge'](_0x222a01[_0x0e4a('0x30')],_0x149ae0);}return _0x1129f2['sobject']('Contact')[_0x0e4a('0x22')](_0x222a01,_0x35be72)['execute']();case _0x0e4a('0x16'):var _0x5ddb3f=_[_0x0e4a('0x31')](_0x53b1f3);if(_0x2b1a0a[_0x0e4a('0x32')]){var _0x149ae0={};_0x149ae0[_0x2b1a0a[_0x0e4a('0x32')]]=_0x39ae29;_[_0x0e4a('0x33')](_0x5ddb3f[_0x0e4a('0x30')],_0x149ae0);}return _0x1129f2[_0x0e4a('0x1e')](_0x0e4a('0x34'))[_0x0e4a('0x22')](_0x5ddb3f,_0x35be72);case _0x0e4a('0x18'):var _0x4746b0=_[_0x0e4a('0x31')](_0x53b1f3);if(_0x2b1a0a[_0x0e4a('0x36')]){var _0x149ae0={};_0x149ae0[_0x2b1a0a[_0x0e4a('0x36')]]=_0x39ae29;_[_0x0e4a('0x33')](_0x4746b0[_0x0e4a('0x30')],_0x149ae0);}return _0x1129f2[_0x0e4a('0x1e')]('Account')[_0x0e4a('0x22')](_0x4746b0,_0x35be72);default:return null;}})[_0x0e4a('0x24')](function(_0x16367e){if(_0x16367e&&_0x16367e[_0x0e4a('0x25')]){var _0x149c3e=_[_0x0e4a('0x38')](_0x16367e);if(_0x149c3e){return BPromise[_0x0e4a('0x27')]({'id':_0x149c3e['Id'],'name':_0x149c3e['Name'],'phone':_0x149c3e[_0x0e4a('0x39')],'endUserType':_0x149c3e[_0x0e4a('0x3a')][_0x0e4a('0x3b')]['toLowerCase']()});}}})[_0x0e4a('0x24')](function(_0x355b29){if(_0x355b29){logger[_0x0e4a('0x28')]('Enduser\x20(%s)\x20with\x20phone\x20%s\x20found',_0x355b29[_0x0e4a('0x15')],_0x39ae29);return BPromise['resolve'](_0x355b29);}else{logger[_0x0e4a('0x28')](_0x0e4a('0x3c'),_0x39ae29);var _0xed73d={'Phone':_0x39ae29};if(_0x2b1a0a['moduleCreate']){if(_0x2b1a0a[_0x0e4a('0x3d')]===_0x0e4a('0x1a')){logger[_0x0e4a('0x28')](_0x0e4a('0x3e'),_0x39ae29,_0x2b1a0a[_0x0e4a('0x3d')]);_0xed73d[_0x0e4a('0x3f')]=_0x8af41!==_0x0e4a('0x40')?_0x8af41:util[_0x0e4a('0x41')](_0x0e4a('0x42'),_0x39ae29);}else if(_0x2b1a0a[_0x0e4a('0x3d')]==='lead'){logger['info']('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x39ae29,_0x2b1a0a[_0x0e4a('0x3d')]);_0xed73d[_0x0e4a('0x3f')]=_0x8af41!==_0x0e4a('0x40')?_0x8af41:util[_0x0e4a('0x41')]('Caller\x20-\x20%s',_0x39ae29);_0xed73d[_0x0e4a('0x43')]=_0x0e4a('0x44');}else if(_0x2b1a0a[_0x0e4a('0x3d')]===_0x0e4a('0x18')){logger['info'](_0x0e4a('0x3e'),_0x39ae29,_0x2b1a0a[_0x0e4a('0x3d')]);_0xed73d[_0x0e4a('0x45')]=_0x8af41!==_0x0e4a('0x40')?_0x8af41:util[_0x0e4a('0x41')]('Caller\x20-\x20%s',_0x39ae29);}else{return null;}}return _0x1129f2[_0x0e4a('0x1e')](_[_0x0e4a('0x46')](_0x2b1a0a[_0x0e4a('0x3d')]))[_0x0e4a('0x1f')](_0xed73d)[_0x0e4a('0x24')](function(_0x16edfe){return BPromise[_0x0e4a('0x27')]({'id':_0x16edfe['id'],'endUserType':_0x2b1a0a[_0x0e4a('0x3d')]});});}});}function getCustomFields(_0x3feb77,_0x334f86){var _0x3e2ac9={};if(_0x3feb77[_0x0e4a('0x25')]>0x0){_['forEach'](_0x3feb77,function(_0x58624b){if(_[_0x0e4a('0x47')]([_0x0e4a('0x48'),_0x0e4a('0x49')],_0x58624b[_0x0e4a('0x3b')])&&_0x58624b['idField']){_0x3e2ac9[_0x58624b[_0x0e4a('0x4a')]]=_0x58624b['content']['toString']();}else if(_0x58624b[_0x0e4a('0x3b')]==='variable'&&_0x58624b[_0x0e4a('0x4b')]&&_0x58624b['idField']){_0x334f86[_0x58624b[_0x0e4a('0x4b')]]&&(_0x3e2ac9[_0x58624b[_0x0e4a('0x4a')]]=_0x334f86[_0x58624b[_0x0e4a('0x4b')]]['toString']());}else if(_0x58624b[_0x0e4a('0x3b')]==='customVariable'&&_0x58624b[_0x0e4a('0x4c')]&&_0x58624b[_0x0e4a('0x4c')]['name']&&_0x58624b[_0x0e4a('0x4a')]){_0x334f86[_0x58624b['Variable'][_0x0e4a('0x4d')][_0x0e4a('0x4e')]()]&&(_0x3e2ac9[_0x58624b[_0x0e4a('0x4a')]]=_0x334f86[_0x58624b['Variable']['name'][_0x0e4a('0x4e')]()][_0x0e4a('0x4f')]());}});}return _0x3e2ac9;}function getConnection(_0x3f15a3){var _0x46b83c=_0x3f15a3[_0x0e4a('0x50')]['concat'](_0x3f15a3[_0x0e4a('0x51')]);var _0x323472=new jsforce['Connection']({'oauth2':{'loginUrl':_0x3f15a3[_0x0e4a('0x52')]||'https://login.salesforce.com','clientId':_0x3f15a3[_0x0e4a('0x53')],'clientSecret':_0x3f15a3['clientSecret']}});return _0x323472[_0x0e4a('0x54')](_0x3f15a3[_0x0e4a('0x55')],_0x46b83c)[_0x0e4a('0x24')](function(){logger['info'](_0x0e4a('0x56'));return _0x323472;});}exports['queue']=function(_0x489d52,_0x4fc321,_0x2ec740,_0x1bfccc,_0x2315ab,_0x40874b){var _0x1d2335,_0x2ee7e6,_0x1e2c08,_0x4198e6;_0x40874b['serverUrl']=intUtil[_0x0e4a('0x57')](_0x40874b[_0x0e4a('0x58')]);_0x40874b[_0x0e4a('0x52')]=intUtil['stripTrailingSlash'](_0x40874b[_0x0e4a('0x52')]);if(_0x2315ab&&_0x2315ab[_0x0e4a('0x59')]){logger[_0x0e4a('0x28')](_0x0e4a('0x5a'),_0x0e4a('0x5b'));_0x4fc321[_0x0e4a('0x5c')]=util[_0x0e4a('0x41')](_0x0e4a('0x5d'),_0x40874b[_0x0e4a('0x58')],_0x4fc321[_0x0e4a('0x5e')],md5(_0x4fc321[_0x0e4a('0x5e')]));}else{_0x4fc321[_0x0e4a('0x5c')]='';}return getConnection(_0x40874b)[_0x0e4a('0x24')](function(_0xefb4c1){_0x4198e6=_0xefb4c1;return getUser(_0x40874b,_0x1bfccc[_0x0e4a('0x5f')],_0x4198e6);})[_0x0e4a('0x24')](function(_0x454a6b){_0x1d2335=_0x454a6b;return getEndUser(_0x40874b,_0x2ec740,_0x4fc321[_0x0e4a('0x60')],_0x4fc321[_0x0e4a('0x61')],_0x4198e6);})['then'](function(_0x142a26){_0x2ee7e6=_0x142a26;return getTicket(_0x40874b,_0x1d2335,_0x2ee7e6,_0x2ec740,_0x4fc321,_0x2ec740['Fields'],_0x4198e6,_0x0e4a('0x62'));})[_0x0e4a('0x24')](function(_0x2e652c){_0x1e2c08=_0x2e652c;logger[_0x0e4a('0x28')](_0x0e4a('0x63'),_0x1e2c08['id']);logger[_0x0e4a('0x28')]('[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x1e2c08['id'],_0x1bfccc[_0x0e4a('0x4d')],_0x40874b[_0x0e4a('0x3b')]);switch(_0x40874b[_0x0e4a('0x3b')]){case'integrationTab':emit(util[_0x0e4a('0x41')](_0x0e4a('0x64'),_0x1bfccc[_0x0e4a('0x4d')]),'trigger:salesforce:display',{'recordId':_0x1e2c08['id']});break;case _0x0e4a('0x65'):emit(util[_0x0e4a('0x41')](_0x0e4a('0x64'),_0x1bfccc[_0x0e4a('0x4d')]),_0x0e4a('0x66'),{'uri':util['format']('%s/%s/e',_0x4198e6[_0x0e4a('0x67')],_0x1e2c08['id'])});break;default:logger[_0x0e4a('0x68')]('[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.');}})[_0x0e4a('0x69')](function(_0x485645){logger[_0x0e4a('0x68')]('[QUEUE]',_0x485645);});};exports['outbound']=function(_0x2fbc1e,_0x64134e,_0x28d2d6,_0x333941,_0x448713,_0x5930a4,_0x3f3556){var _0x45dd45,_0x9b8d60,_0xb0aa8e,_0x5ad5a1;_0x5930a4[_0x0e4a('0x58')]=intUtil[_0x0e4a('0x57')](_0x5930a4['serverUrl']);_0x5930a4[_0x0e4a('0x52')]=intUtil[_0x0e4a('0x57')](_0x5930a4[_0x0e4a('0x52')]);if(_0x3f3556&&_0x3f3556['recordingFormat']&&_0x3f3556[_0x0e4a('0x6a')]!==_0x0e4a('0x6b')){logger[_0x0e4a('0x28')](_0x0e4a('0x6c'),'Recording\x20is\x20enabled!');_0x64134e[_0x0e4a('0x5c')]=util['format'](_0x0e4a('0x5d'),_0x5930a4[_0x0e4a('0x58')],_0x64134e[_0x0e4a('0x5e')],md5(_0x64134e[_0x0e4a('0x5e')]));}return getConnection(_0x5930a4)[_0x0e4a('0x24')](function(_0x1e834d){_0x5ad5a1=_0x1e834d;return getUser(_0x5930a4,_0x333941['email'],_0x5ad5a1);})['then'](function(_0xa1039c){_0x45dd45=_0xa1039c;return getEndUser(_0x5930a4,_0x28d2d6,_0x64134e[_0x0e4a('0x6d')],_0x64134e[_0x0e4a('0x6e')],_0x5ad5a1);})[_0x0e4a('0x24')](function(_0x3e3af0){_0x9b8d60=_0x3e3af0;return getTicket(_0x5930a4,_0x45dd45,_0x9b8d60,_0x28d2d6,_0x64134e,_0x28d2d6[_0x0e4a('0x6f')],_0x5ad5a1,'outbound');})[_0x0e4a('0x24')](function(_0x323d89){_0xb0aa8e=_0x323d89;logger['info'](_0x0e4a('0x70'),_0xb0aa8e['id']);logger['info'](_0x0e4a('0x71'),_0xb0aa8e['id'],_0x333941[_0x0e4a('0x4d')],_0x5930a4[_0x0e4a('0x3b')]);switch(_0x5930a4[_0x0e4a('0x3b')]){case _0x0e4a('0x72'):emit(util[_0x0e4a('0x41')](_0x0e4a('0x64'),_0x333941[_0x0e4a('0x4d')]),'trigger:salesforce:display',{'recordId':_0xb0aa8e['id']});break;case _0x0e4a('0x65'):emit(util['format']('user:%s',_0x333941[_0x0e4a('0x4d')]),'trigger:browser:url',{'uri':util['format']('%s/%s/e',_0x5ad5a1[_0x0e4a('0x67')],_0xb0aa8e['id'])});break;default:logger[_0x0e4a('0x68')](_0x0e4a('0x6c'),_0x0e4a('0x73'));}})[_0x0e4a('0x69')](function(_0x4af172){logger[_0x0e4a('0x68')](_0x0e4a('0x6c'),_0x4af172);});};exports[_0x0e4a('0x74')]=function(_0x43ee81,_0x588798,_0x13770b,_0x31b0ed,_0x53c33c,_0x2b51cc){var _0x4afe26,_0x28af58,_0x4306bc,_0x3f53ae;_0x2b51cc[_0x0e4a('0x58')]=intUtil[_0x0e4a('0x57')](_0x2b51cc[_0x0e4a('0x58')]);_0x2b51cc[_0x0e4a('0x52')]=intUtil[_0x0e4a('0x57')](_0x2b51cc[_0x0e4a('0x52')]);if(_0x53c33c&&_0x53c33c['monitor_format']){logger['info']('['+_0x588798[_0x0e4a('0x75')][_0x0e4a('0x76')]()+']',_0x0e4a('0x5b'));_0x588798[_0x0e4a('0x5c')]=util[_0x0e4a('0x41')](_0x0e4a('0x5d'),_0x2b51cc['serverUrl'],_0x588798[_0x0e4a('0x5e')],md5(_0x588798['uniqueid']));}else{_0x588798[_0x0e4a('0x5c')]='';}return getConnection(_0x2b51cc)['then'](function(_0x351304){_0x3f53ae=_0x351304;if(!_[_0x0e4a('0x20')](_0x31b0ed)){return getUser(_0x2b51cc,_0x31b0ed[_0x0e4a('0x4d')],_0x3f53ae);}else{return getUser(_0x2b51cc,null,_0x3f53ae);}})['then'](function(_0x440a0a){_0x4afe26=_0x440a0a;return getEndUser(_0x2b51cc,_0x13770b,_0x588798[_0x0e4a('0x60')],_0x588798[_0x0e4a('0x61')],_0x3f53ae);})[_0x0e4a('0x24')](function(_0x59c536){_0x28af58=_0x59c536;return getTicket(_0x2b51cc,_0x4afe26,_0x28af58,_0x13770b,_0x588798,_0x13770b[_0x0e4a('0x6f')],_0x3f53ae);})[_0x0e4a('0x24')](function(_0x35909d){_0x4306bc=_0x35909d;logger[_0x0e4a('0x28')]('['+_0x588798[_0x0e4a('0x75')][_0x0e4a('0x76')]()+']\x20Ticket\x20%s\x20created.',_0x4306bc['id']);logger[_0x0e4a('0x28')]('['+_0x588798[_0x0e4a('0x75')][_0x0e4a('0x76')]()+']\x20Integration\x20account\x20type\x20%s.',_0x2b51cc['type']);})[_0x0e4a('0x69')](function(_0x56e671){logger[_0x0e4a('0x68')]('['+_0x588798[_0x0e4a('0x75')]['toUpperCase']()+']',_0x56e671);});}; \ No newline at end of file +var _0x9bec=['variableName','customVariable','Variable','name','concat','securityToken','Connection','remoteUri','https://login.salesforce.com','clientSecret','username','Connection\x20established.','queue','serverUrl','stripTrailingSlash','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','email','calleridname','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','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','[QUEUE]','outbound','recordingFormat','none','[OUTBOUND]','uniqueid','destcalleridname','[OUTBOUND]\x20Ticket\x20%s\x20created.','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','lastevent','isNil','calleridnum','toUpperCase',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','request-promise','jsforce','ioredis','./util','../../../../config/environment','salesforce','localhost','socket.io-emitter','redis','emit','assign','Subjects','getString','Descriptions','ticketType','Task','ActivityDate','IsReminderSet','endUserType','lead','WhatId','Case','contact','ContactId','account','AccountId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','validateEmail','User','find','execute','length','Agent\x20%s\x20found.','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','then','resolve','user_id','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','cloneDeep','additionalSearchContact','merge','$or','Contact','additionalSearchLead','Lead','account_contact_lead','additionalSearchAccount','Account','first','Phone','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','','format','Caller\x20-\x20%s','LastName','Company','No\x20Company','upperFirst','includes','string','picklist','idField','content','toString','variable'];(function(_0xd6d6f9,_0x38d743){var _0x38fcbb=function(_0x2e117a){while(--_0x2e117a){_0xd6d6f9['push'](_0xd6d6f9['shift']());}};_0x38fcbb(++_0x38d743);}(_0x9bec,0xb2));var _0xc9be=function(_0x47aa64,_0xfb8a07){_0x47aa64=_0x47aa64-0x0;var _0x549c7a=_0x9bec[_0x47aa64];return _0x549c7a;};'use strict';var _=require('lodash');var rp=require(_0xc9be('0x0'));var moment=require('moment');var BPromise=require('bluebird');var md5=require('md5');var jsforce=require(_0xc9be('0x1'));var util=require('util');var Redis=require(_0xc9be('0x2'));var intUtil=require(_0xc9be('0x3'));var config=require(_0xc9be('0x4'));var logger=require('../../../../config/logger')(_0xc9be('0x5'));config['redis']=_['defaults'](config['redis'],{'host':_0xc9be('0x6'),'port':0x18eb});var io=require(_0xc9be('0x7'))(new Redis(config[_0xc9be('0x8')]));function emit(_0x168058,_0x2abd7c,_0x55aa7d){io['to'](_0x168058)[_0xc9be('0x9')](_0x2abd7c,_0x55aa7d);}function getTicket(_0x509a09,_0x421170,_0x105662,_0x9d31a9,_0x259209,_0x215239,_0x5d32c1,_0x49baee){var _0x462873=Object[_0xc9be('0xa')]({},{'OwnerId':_0x421170['id'],'Subject':intUtil['getString'](_0x9d31a9[_0xc9be('0xb')],_0x259209,'\x20'),'Description':intUtil[_0xc9be('0xc')](_0x9d31a9[_0xc9be('0xd')],_0x259209,'\x0a')},getCustomFields(_0x215239,_0x259209));if(_0x105662){if(_0x9d31a9[_0xc9be('0xe')]===_0xc9be('0xf')){_0x462873[_0xc9be('0x10')]=moment['utc']();_0x462873[_0xc9be('0x11')]=![];_0x462873['IsRecurrence']=![];if(_0x105662[_0xc9be('0x12')]==='contact'||_0x105662['endUserType']===_0xc9be('0x13')){_0x462873['WhoId']=_0x105662['id'];}else if(_0x105662[_0xc9be('0x12')]==='account'){_0x462873[_0xc9be('0x14')]=_0x105662['id'];}}else if(_0x9d31a9[_0xc9be('0xe')]===_0xc9be('0x15')){if(_0x105662[_0xc9be('0x12')]===_0xc9be('0x16')){_0x462873[_0xc9be('0x17')]=_0x105662['id'];}else if(_0x105662[_0xc9be('0x12')]===_0xc9be('0x18')){_0x462873[_0xc9be('0x19')]=_0x105662['id'];}else if(_0x105662[_0xc9be('0x12')]==='lead'&&_0x9d31a9[_0xc9be('0x1a')]){_0x462873[_0x9d31a9[_0xc9be('0x1a')]]=_0x105662['id'];}else{logger[_0xc9be('0x1b')](_0xc9be('0x1c'));}}}return _0x5d32c1[_0xc9be('0x1d')](_0x9d31a9[_0xc9be('0xe')])[_0xc9be('0x1e')](_0x462873);}function getUser(_0x311c39,_0x2328b8,_0x3a3a37){if(!_['isNil'](_0x2328b8)&&intUtil[_0xc9be('0x1f')](_0x2328b8)){var _0x23840a={'Email':_0x2328b8};var _0xc6ccf1={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x3a3a37[_0xc9be('0x1d')](_0xc9be('0x20'))[_0xc9be('0x21')](_0x23840a,_0xc6ccf1)[_0xc9be('0x22')]()['then'](function(_0x368b83){if(_0x368b83[_0xc9be('0x23')]){var _0x5d8ebf=_[_0xc9be('0x21')](_0x368b83,function(_0x4db6df){return _0x4db6df['Email']===_0x2328b8;});if(_0x5d8ebf){logger[_0xc9be('0x1b')](_0xc9be('0x24'),_0x2328b8);return BPromise['resolve']({'id':_0x5d8ebf['Id'],'name':_0x5d8ebf[_0xc9be('0x25')]});}}else{logger[_0xc9be('0x1b')](_0xc9be('0x26'),_0x2328b8);return _0x3a3a37[_0xc9be('0x27')]()[_0xc9be('0x28')](function(_0x56c837){return BPromise[_0xc9be('0x29')]({'id':_0x56c837[_0xc9be('0x2a')],'name':_0x56c837['display_name']});});}});}else{logger['info'](_0xc9be('0x26'),_0x2328b8);return _0x3a3a37['identity']()[_0xc9be('0x28')](function(_0x518346){return BPromise[_0xc9be('0x29')]({'id':_0x518346[_0xc9be('0x2a')],'name':_0x518346[_0xc9be('0x2b')]});});}}function getEndUser(_0x9dcdbd,_0x39273c,_0x3f468f,_0x2b477a,_0x2114bf){var _0x2ef487={'$or':{'Phone':_0x2b477a}};var _0x372491={'Id':!![],'Name':!![],'Phone':!![]};return BPromise['resolve']()[_0xc9be('0x28')](function(){logger['info'](_0xc9be('0x2c'),_0x2b477a,_0x39273c[_0xc9be('0x2d')]);switch(_0x39273c[_0xc9be('0x2d')]){case'contact_lead':var _0x10dee3=_[_0xc9be('0x2e')](_0x2ef487);if(_0x39273c[_0xc9be('0x2f')]){var _0x1da2ce={};_0x1da2ce[_0x39273c[_0xc9be('0x2f')]]=_0x2b477a;_[_0xc9be('0x30')](_0x10dee3[_0xc9be('0x31')],_0x1da2ce);}return _0x2114bf[_0xc9be('0x1d')](_0xc9be('0x32'))[_0xc9be('0x21')](_0x10dee3,_0x372491)[_0xc9be('0x22')]()[_0xc9be('0x28')](function(_0x364ddc){if(_0x364ddc&&_0x364ddc['length']){return _0x364ddc;}else{var _0x27046c=_[_0xc9be('0x2e')](_0x2ef487);if(_0x39273c[_0xc9be('0x33')]){var _0x596b56={};_0x596b56[_0x39273c[_0xc9be('0x33')]]=_0x2b477a;_[_0xc9be('0x30')](_0x27046c[_0xc9be('0x31')],_0x596b56);}return _0x2114bf[_0xc9be('0x1d')](_0xc9be('0x34'))[_0xc9be('0x21')](_0x27046c,_0x372491);}});case _0xc9be('0x35'):var _0x47f077=_[_0xc9be('0x2e')](_0x2ef487);if(_0x39273c[_0xc9be('0x36')]){var _0x1da2ce={};_0x1da2ce[_0x39273c[_0xc9be('0x36')]]=_0x2b477a;_[_0xc9be('0x30')](_0x47f077[_0xc9be('0x31')],_0x1da2ce);}return _0x2114bf[_0xc9be('0x1d')]('Account')[_0xc9be('0x21')](_0x47f077,_0x372491)[_0xc9be('0x22')]()[_0xc9be('0x28')](function(_0x2f7b48){if(_0x2f7b48&&_0x2f7b48[_0xc9be('0x23')]){return _0x2f7b48;}else{var _0x255c98=_[_0xc9be('0x2e')](_0x2ef487);if(_0x39273c[_0xc9be('0x2f')]){var _0x4b095e={};_0x4b095e[_0x39273c[_0xc9be('0x2f')]]=_0x2b477a;_[_0xc9be('0x30')](_0x255c98[_0xc9be('0x31')],_0x4b095e);}return _0x2114bf['sobject'](_0xc9be('0x32'))[_0xc9be('0x21')](_0x255c98,_0x372491)[_0xc9be('0x28')](function(_0x1abc76){if(_0x1abc76&&_0x1abc76['length']){return _0x1abc76;}else{var _0x37f4fe=_[_0xc9be('0x2e')](_0x2ef487);if(_0x39273c[_0xc9be('0x33')]){var _0x145e71={};_0x145e71[_0x39273c['additionalSearchLead']]=_0x2b477a;_[_0xc9be('0x30')](_0x37f4fe[_0xc9be('0x31')],_0x145e71);}return _0x2114bf['sobject'](_0xc9be('0x34'))['find'](_0x37f4fe,_0x372491);}});}});case _0xc9be('0x16'):var _0x10dee3=_[_0xc9be('0x2e')](_0x2ef487);if(_0x39273c[_0xc9be('0x2f')]){var _0x1da2ce={};_0x1da2ce[_0x39273c[_0xc9be('0x2f')]]=_0x2b477a;_[_0xc9be('0x30')](_0x10dee3[_0xc9be('0x31')],_0x1da2ce);}return _0x2114bf[_0xc9be('0x1d')](_0xc9be('0x32'))[_0xc9be('0x21')](_0x10dee3,_0x372491)['execute']();case _0xc9be('0x13'):var _0x2e7d9c=_[_0xc9be('0x2e')](_0x2ef487);if(_0x39273c[_0xc9be('0x33')]){var _0x1da2ce={};_0x1da2ce[_0x39273c[_0xc9be('0x33')]]=_0x2b477a;_['merge'](_0x2e7d9c[_0xc9be('0x31')],_0x1da2ce);}return _0x2114bf[_0xc9be('0x1d')](_0xc9be('0x34'))[_0xc9be('0x21')](_0x2e7d9c,_0x372491);case'account':var _0x47f077=_[_0xc9be('0x2e')](_0x2ef487);if(_0x39273c[_0xc9be('0x36')]){var _0x1da2ce={};_0x1da2ce[_0x39273c[_0xc9be('0x36')]]=_0x2b477a;_[_0xc9be('0x30')](_0x47f077[_0xc9be('0x31')],_0x1da2ce);}return _0x2114bf[_0xc9be('0x1d')](_0xc9be('0x37'))[_0xc9be('0x21')](_0x47f077,_0x372491);default:return null;}})['then'](function(_0x408dc5){if(_0x408dc5&&_0x408dc5[_0xc9be('0x23')]){var _0x52065c=_[_0xc9be('0x38')](_0x408dc5);if(_0x52065c){return BPromise[_0xc9be('0x29')]({'id':_0x52065c['Id'],'name':_0x52065c[_0xc9be('0x25')],'phone':_0x52065c[_0xc9be('0x39')],'endUserType':_0x52065c['attributes'][_0xc9be('0x3a')][_0xc9be('0x3b')]()});}}})['then'](function(_0x2e1054){if(_0x2e1054){logger[_0xc9be('0x1b')](_0xc9be('0x3c'),_0x2e1054[_0xc9be('0x12')],_0x2b477a);return BPromise['resolve'](_0x2e1054);}else{logger[_0xc9be('0x1b')](_0xc9be('0x3d'),_0x2b477a);var _0x454876={'Phone':_0x2b477a};if(_0x39273c[_0xc9be('0x3e')]){if(_0x39273c[_0xc9be('0x3e')]===_0xc9be('0x16')){logger[_0xc9be('0x1b')](_0xc9be('0x3f'),_0x2b477a,_0x39273c[_0xc9be('0x3e')]);_0x454876['LastName']=_0x3f468f!==_0xc9be('0x40')?_0x3f468f:util[_0xc9be('0x41')](_0xc9be('0x42'),_0x2b477a);}else if(_0x39273c['moduleCreate']===_0xc9be('0x13')){logger[_0xc9be('0x1b')](_0xc9be('0x3f'),_0x2b477a,_0x39273c[_0xc9be('0x3e')]);_0x454876[_0xc9be('0x43')]=_0x3f468f!==_0xc9be('0x40')?_0x3f468f:util[_0xc9be('0x41')](_0xc9be('0x42'),_0x2b477a);_0x454876[_0xc9be('0x44')]=_0xc9be('0x45');}else if(_0x39273c[_0xc9be('0x3e')]==='account'){logger[_0xc9be('0x1b')](_0xc9be('0x3f'),_0x2b477a,_0x39273c[_0xc9be('0x3e')]);_0x454876[_0xc9be('0x25')]=_0x3f468f!==_0xc9be('0x40')?_0x3f468f:util[_0xc9be('0x41')](_0xc9be('0x42'),_0x2b477a);}else{return null;}}return _0x2114bf[_0xc9be('0x1d')](_[_0xc9be('0x46')](_0x39273c['moduleCreate']))['create'](_0x454876)[_0xc9be('0x28')](function(_0x526568){return BPromise['resolve']({'id':_0x526568['id'],'endUserType':_0x39273c[_0xc9be('0x3e')]});});}});}function getCustomFields(_0x1fcffb,_0x34df46){var _0x7f4437={};if(_0x1fcffb[_0xc9be('0x23')]>0x0){_['forEach'](_0x1fcffb,function(_0x532ab1){if(_[_0xc9be('0x47')]([_0xc9be('0x48'),_0xc9be('0x49')],_0x532ab1[_0xc9be('0x3a')])&&_0x532ab1[_0xc9be('0x4a')]){_0x7f4437[_0x532ab1[_0xc9be('0x4a')]]=_0x532ab1[_0xc9be('0x4b')][_0xc9be('0x4c')]();}else if(_0x532ab1[_0xc9be('0x3a')]===_0xc9be('0x4d')&&_0x532ab1[_0xc9be('0x4e')]&&_0x532ab1[_0xc9be('0x4a')]){_0x34df46[_0x532ab1[_0xc9be('0x4e')]]&&(_0x7f4437[_0x532ab1['idField']]=_0x34df46[_0x532ab1[_0xc9be('0x4e')]][_0xc9be('0x4c')]());}else if(_0x532ab1[_0xc9be('0x3a')]===_0xc9be('0x4f')&&_0x532ab1[_0xc9be('0x50')]&&_0x532ab1['Variable'][_0xc9be('0x51')]&&_0x532ab1['idField']){_0x34df46[_0x532ab1['Variable'][_0xc9be('0x51')]['toLowerCase']()]&&(_0x7f4437[_0x532ab1[_0xc9be('0x4a')]]=_0x34df46[_0x532ab1['Variable'][_0xc9be('0x51')][_0xc9be('0x3b')]()][_0xc9be('0x4c')]());}});}return _0x7f4437;}function getConnection(_0x3f19eb){var _0x392c25=_0x3f19eb['password'][_0xc9be('0x52')](_0x3f19eb[_0xc9be('0x53')]);var _0x1bd0f2=new jsforce[(_0xc9be('0x54'))]({'oauth2':{'loginUrl':_0x3f19eb[_0xc9be('0x55')]||_0xc9be('0x56'),'clientId':_0x3f19eb['clientId'],'clientSecret':_0x3f19eb[_0xc9be('0x57')]}});return _0x1bd0f2['login'](_0x3f19eb[_0xc9be('0x58')],_0x392c25)['then'](function(){logger['info'](_0xc9be('0x59'));return _0x1bd0f2;});}exports[_0xc9be('0x5a')]=function(_0x5248bd,_0x4129d6,_0x385879,_0x201bf1,_0x2217d3,_0x1697f5){var _0x560e90,_0x3902d7,_0x187e75,_0x1bb8ba;_0x1697f5[_0xc9be('0x5b')]=intUtil[_0xc9be('0x5c')](_0x1697f5['serverUrl']);_0x1697f5[_0xc9be('0x55')]=intUtil[_0xc9be('0x5c')](_0x1697f5['remoteUri']);if(_0x2217d3&&_0x2217d3[_0xc9be('0x5d')]){logger['info']('[QUEUE]',_0xc9be('0x5e'));_0x4129d6[_0xc9be('0x5f')]=util[_0xc9be('0x41')](_0xc9be('0x60'),_0x1697f5[_0xc9be('0x5b')],_0x4129d6['uniqueid'],md5(_0x4129d6['uniqueid']));}else{_0x4129d6[_0xc9be('0x5f')]='';}return getConnection(_0x1697f5)[_0xc9be('0x28')](function(_0x3bfada){_0x1bb8ba=_0x3bfada;return getUser(_0x1697f5,_0x201bf1[_0xc9be('0x61')],_0x1bb8ba);})['then'](function(_0x6ec31c){_0x560e90=_0x6ec31c;return getEndUser(_0x1697f5,_0x385879,_0x4129d6[_0xc9be('0x62')],_0x4129d6['calleridnum'],_0x1bb8ba);})[_0xc9be('0x28')](function(_0x4755ad){_0x3902d7=_0x4755ad;return getTicket(_0x1697f5,_0x560e90,_0x3902d7,_0x385879,_0x4129d6,_0x385879[_0xc9be('0x63')],_0x1bb8ba,'queue');})['then'](function(_0x373ad9){_0x187e75=_0x373ad9;logger[_0xc9be('0x1b')](_0xc9be('0x64'),_0x187e75['id']);logger[_0xc9be('0x1b')](_0xc9be('0x65'),_0x187e75['id'],_0x201bf1[_0xc9be('0x51')],_0x1697f5['type']);switch(_0x1697f5[_0xc9be('0x3a')]){case _0xc9be('0x66'):emit(util[_0xc9be('0x41')](_0xc9be('0x67'),_0x201bf1['name']),_0xc9be('0x68'),{'recordId':_0x187e75['id']});break;case _0xc9be('0x69'):emit(util[_0xc9be('0x41')](_0xc9be('0x67'),_0x201bf1['name']),_0xc9be('0x6a'),{'uri':util[_0xc9be('0x41')](_0xc9be('0x6b'),_0x1bb8ba[_0xc9be('0x6c')],_0x187e75['id'])});break;default:logger[_0xc9be('0x6d')](_0xc9be('0x6e'));}})[_0xc9be('0x6f')](function(_0x47cf79){logger[_0xc9be('0x6d')](_0xc9be('0x70'),_0x47cf79);});};exports[_0xc9be('0x71')]=function(_0x39ce14,_0x3315cc,_0x2674a8,_0x560711,_0x5d9a27,_0x3620a8,_0x10e9ad){var _0x50edfc,_0x81beb9,_0x1fcb71,_0x496e4d;_0x3620a8[_0xc9be('0x5b')]=intUtil['stripTrailingSlash'](_0x3620a8['serverUrl']);_0x3620a8['remoteUri']=intUtil[_0xc9be('0x5c')](_0x3620a8[_0xc9be('0x55')]);if(_0x10e9ad&&_0x10e9ad['recordingFormat']&&_0x10e9ad[_0xc9be('0x72')]!==_0xc9be('0x73')){logger[_0xc9be('0x1b')](_0xc9be('0x74'),_0xc9be('0x5e'));_0x3315cc[_0xc9be('0x5f')]=util[_0xc9be('0x41')](_0xc9be('0x60'),_0x3620a8[_0xc9be('0x5b')],_0x3315cc['uniqueid'],md5(_0x3315cc[_0xc9be('0x75')]));}return getConnection(_0x3620a8)[_0xc9be('0x28')](function(_0x2c7183){_0x496e4d=_0x2c7183;return getUser(_0x3620a8,_0x560711[_0xc9be('0x61')],_0x496e4d);})[_0xc9be('0x28')](function(_0x743beb){_0x50edfc=_0x743beb;return getEndUser(_0x3620a8,_0x2674a8,_0x3315cc[_0xc9be('0x76')],_0x3315cc['destcalleridnum'],_0x496e4d);})[_0xc9be('0x28')](function(_0x4b5040){_0x81beb9=_0x4b5040;return getTicket(_0x3620a8,_0x50edfc,_0x81beb9,_0x2674a8,_0x3315cc,_0x2674a8[_0xc9be('0x63')],_0x496e4d,'outbound');})[_0xc9be('0x28')](function(_0x24c250){_0x1fcb71=_0x24c250;logger['info'](_0xc9be('0x77'),_0x1fcb71['id']);logger[_0xc9be('0x1b')]('[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x1fcb71['id'],_0x560711[_0xc9be('0x51')],_0x3620a8[_0xc9be('0x3a')]);switch(_0x3620a8[_0xc9be('0x3a')]){case _0xc9be('0x66'):emit(util[_0xc9be('0x41')](_0xc9be('0x67'),_0x560711[_0xc9be('0x51')]),_0xc9be('0x68'),{'recordId':_0x1fcb71['id']});break;case'newTab':emit(util[_0xc9be('0x41')](_0xc9be('0x67'),_0x560711[_0xc9be('0x51')]),_0xc9be('0x6a'),{'uri':util[_0xc9be('0x41')](_0xc9be('0x6b'),_0x496e4d[_0xc9be('0x6c')],_0x1fcb71['id'])});break;default:logger[_0xc9be('0x6d')](_0xc9be('0x74'),_0xc9be('0x78'));}})[_0xc9be('0x6f')](function(_0x298fbd){logger[_0xc9be('0x6d')](_0xc9be('0x74'),_0x298fbd);});};exports[_0xc9be('0x79')]=function(_0x3d68ef,_0x48be7c,_0x64650d,_0x31b7f2,_0x5ee6ea,_0x2908b2){var _0x45c10,_0x3c3dd3,_0xa72d21,_0x276a4b;_0x2908b2[_0xc9be('0x5b')]=intUtil['stripTrailingSlash'](_0x2908b2[_0xc9be('0x5b')]);_0x2908b2[_0xc9be('0x55')]=intUtil[_0xc9be('0x5c')](_0x2908b2[_0xc9be('0x55')]);if(_0x5ee6ea&&_0x5ee6ea[_0xc9be('0x5d')]){logger[_0xc9be('0x1b')]('['+_0x48be7c[_0xc9be('0x7a')]['toUpperCase']()+']',_0xc9be('0x5e'));_0x48be7c[_0xc9be('0x5f')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2908b2[_0xc9be('0x5b')],_0x48be7c[_0xc9be('0x75')],md5(_0x48be7c['uniqueid']));}else{_0x48be7c[_0xc9be('0x5f')]='';}return getConnection(_0x2908b2)[_0xc9be('0x28')](function(_0x1f948e){_0x276a4b=_0x1f948e;if(!_[_0xc9be('0x7b')](_0x31b7f2)){return getUser(_0x2908b2,_0x31b7f2[_0xc9be('0x51')],_0x276a4b);}else{return getUser(_0x2908b2,null,_0x276a4b);}})[_0xc9be('0x28')](function(_0x5664a1){_0x45c10=_0x5664a1;return getEndUser(_0x2908b2,_0x64650d,_0x48be7c[_0xc9be('0x62')],_0x48be7c[_0xc9be('0x7c')],_0x276a4b);})[_0xc9be('0x28')](function(_0x18ef43){_0x3c3dd3=_0x18ef43;return getTicket(_0x2908b2,_0x45c10,_0x3c3dd3,_0x64650d,_0x48be7c,_0x64650d[_0xc9be('0x63')],_0x276a4b);})['then'](function(_0x155a75){_0xa72d21=_0x155a75;logger[_0xc9be('0x1b')]('['+_0x48be7c[_0xc9be('0x7a')][_0xc9be('0x7d')]()+_0xc9be('0x7e'),_0xa72d21['id']);logger[_0xc9be('0x1b')]('['+_0x48be7c[_0xc9be('0x7a')][_0xc9be('0x7d')]()+_0xc9be('0x7f'),_0x2908b2['type']);})[_0xc9be('0x6f')](function(_0x2e05c9){logger[_0xc9be('0x6d')]('['+_0x48be7c[_0xc9be('0x7a')][_0xc9be('0x7d')]()+']',_0x2e05c9);});}; \ 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 419d7dc..ddbcfcf 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 _0xefe6=['outbound','incident','assign','getString','Subjects','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','label_entry','Incident','Incident\x20-\x20','forEach','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','emit','trigger:browser:url','username','password','sysparm_limit=1','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','email','destcalleridnum','calleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','recordingURL','recordingFormat','none','Recording\x20is\x20enabled!','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','bluebird','request-promise','util','md5','ioredis','../../../../config/environment','../../../../config/logger','servicenow','redis','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','length','adminId','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','catch','error','message','validateEmail','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','active','true','userId','userEmail','adminEmail',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','user','System','],\x20EndUser\x20schema','sys_user?sysparm_query=phone%3D','],\x20createEndUser\x20crm','string','picklist','nameField','customField','toLowerCase','includes','type','idField','content','toString','variable','variableName','customVariable','name',']\x20getTicket\x20input\x20crm'];(function(_0x2da1ef,_0x4c0fbd){var _0x5900a4=function(_0x51212c){while(--_0x51212c){_0x2da1ef['push'](_0x2da1ef['shift']());}};_0x5900a4(++_0x4c0fbd);}(_0xefe6,0x1ee));var _0x6efe=function(_0x49e66,_0x43f4b9){_0x49e66=_0x49e66-0x0;var _0x545549=_0xefe6[_0x49e66];return _0x545549;};'use strict';var _=require(_0x6efe('0x0'));var Promise=require(_0x6efe('0x1'));var rp=require(_0x6efe('0x2'));var util=require(_0x6efe('0x3'));var md5=require(_0x6efe('0x4'));var Redis=require(_0x6efe('0x5'));var intUtil=require('./util');var config=require(_0x6efe('0x6'));var logger=require(_0x6efe('0x7'))(_0x6efe('0x8'));config[_0x6efe('0x9')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x6efe('0x9')]));function getAdminUser(_0x30f878,_0xe3f5b6,_0x3868b4,_0x1bdad1,_0x3cbcfb,_0x5271d9){return new Promise(function(_0x87167f,_0x341b9d){var _0x4047ed={'method':_0x6efe('0xa'),'uri':_0x1bdad1+_0x6efe('0xb')+'&'+_0x3cbcfb+'&'+_0x5271d9,'auth':_0xe3f5b6,'json':!![]};return rp(_0x4047ed)[_0x6efe('0xc')](function(_0x42a5f6){if(_0x42a5f6[_0x6efe('0xd')][_0x6efe('0xe')]>0x0){_0x3868b4[_0x6efe('0xf')]=_0x42a5f6[_0x6efe('0xd')][0x0][_0x6efe('0x10')];}logger[_0x6efe('0x11')]('['+[_0x30f878[_0x6efe('0x12')]()]+_0x6efe('0x13'),_0x3868b4);_0x87167f(_0x3868b4);})[_0x6efe('0x14')](function(_0x1c0d84){logger[_0x6efe('0x15')]('['+[_0x30f878[_0x6efe('0x12')]()]+']',_0x1c0d84[_0x6efe('0x16')]);_0x341b9d(_0x1c0d84['message']);});});}function getUser(_0x2b7ce6,_0x2c2298,_0x53246d,_0x557a2c,_0x1ce376){return function(_0x5c937c){logger[_0x6efe('0x11')]('['+[_0x2b7ce6[_0x6efe('0x12')]()]+'],\x20getUser\x20input\x20crm',_0x5c937c);return new Promise(function(_0x336ce5,_0x235208){if(intUtil[_0x6efe('0x17')](_0x5c937c['userEmail'])){var _0x5525a4={'method':_0x6efe('0xa'),'uri':_0x53246d+'sys_user?sysparm_query=email%3D'+_0x5c937c['userEmail']+'&'+_0x557a2c+'&'+_0x1ce376,'auth':_0x2c2298,'json':!![]};logger['info']('['+[_0x2b7ce6[_0x6efe('0x12')]()]+_0x6efe('0x18'),_0x5525a4);return rp(_0x5525a4)[_0x6efe('0xc')](function(_0x48cf26){logger[_0x6efe('0x11')]('['+[_0x2b7ce6[_0x6efe('0x12')]()]+_0x6efe('0x19'),_0x48cf26);if(_0x48cf26[_0x6efe('0xd')][_0x6efe('0xe')]>0x0&&String(_0x48cf26['result'][0x0][_0x6efe('0x1a')])===_0x6efe('0x1b')){_0x5c937c[_0x6efe('0x1c')]=_0x48cf26[_0x6efe('0xd')][0x0]['sys_id'];}else{_0x5c937c['userId']=_0x5c937c[_0x6efe('0xf')];_0x5c937c[_0x6efe('0x1d')]=_0x5c937c[_0x6efe('0x1e')];}logger[_0x6efe('0x11')]('['+[_0x2b7ce6[_0x6efe('0x12')]()]+'],\x20getUser\x20crm',_0x5c937c);_0x336ce5(_0x5c937c);})[_0x6efe('0x14')](function(_0x117212){logger['error']('['+[_0x2b7ce6[_0x6efe('0x12')]()]+']',_0x117212[_0x6efe('0x16')]);_0x235208(_0x117212[_0x6efe('0x16')]);});}else{logger[_0x6efe('0x11')]('['+[_0x2b7ce6[_0x6efe('0x12')]()]+_0x6efe('0x1f'));_0x5c937c[_0x6efe('0x1c')]=_0x5c937c[_0x6efe('0xf')];_0x5c937c['userEmail']=_0x5c937c['adminEmail'];_0x336ce5(_0x5c937c);}});};}function createEndUser(_0x394f44,_0x534ec8,_0x240744,_0x4c5688,_0x3f979f){logger[_0x6efe('0x11')]('['+[_0x394f44['toUpperCase']()]+_0x6efe('0x20'),_0x240744);return new Promise(function(_0x19bbaf,_0x3923ff){var _0x3b408a={'method':_0x6efe('0x21'),'uri':_0x4c5688+_0x6efe('0x22')+_0x3f979f,'body':{'user_name':_0x240744[_0x6efe('0x23')],'roles':_0x6efe('0x24'),'first_name':_0x240744[_0x6efe('0x23')],'active':_0x6efe('0x1b'),'date_format':_0x6efe('0x25'),'phone':_0x240744[_0x6efe('0x23')]},'auth':_0x534ec8,'json':!![]};return rp(_0x3b408a)[_0x6efe('0xc')](function(_0x2db016){logger[_0x6efe('0x11')]('['+[_0x394f44['toUpperCase']()]+_0x6efe('0x26'),_0x2db016[_0x6efe('0xd')]);_0x240744['endUserId']=_0x2db016[_0x6efe('0xd')][_0x6efe('0x10')];_0x19bbaf(_0x240744);})[_0x6efe('0x14')](function(_0x30cdcc){logger[_0x6efe('0x15')]('['+[_0x394f44[_0x6efe('0x12')]()]+']',_0x30cdcc[_0x6efe('0x16')]);_0x3923ff(_0x30cdcc[_0x6efe('0x16')]);});});}function getEndUser(_0x266162,_0x269503,_0x16d10a,_0x1e8940,_0x4bb88c){return function(_0x4582ae){logger[_0x6efe('0x11')]('['+[_0x266162[_0x6efe('0x12')]()]+'],\x20getEndUser\x20input\x20crm',_0x4582ae);return new Promise(function(_0x179384,_0x52c936){var _0x7cb153={'method':_0x6efe('0xa'),'uri':_0x16d10a+_0x6efe('0x27')+_0x4582ae[_0x6efe('0x23')]+'&'+_0x1e8940+'&'+_0x4bb88c,'auth':_0x269503,'json':!![]};return rp(_0x7cb153)['then'](function(_0x415ed5){if(_0x415ed5[_0x6efe('0xd')][_0x6efe('0xe')]>0x0){_0x4582ae['endUserId']=_0x415ed5['result'][0x0]['sys_id'];logger['info']('['+[_0x266162[_0x6efe('0x12')]()]+'],\x20getEndUser\x20crm',_0x4582ae);_0x179384(_0x4582ae);}else{return createEndUser(_0x266162,_0x269503,_0x4582ae,_0x16d10a,_0x1e8940)[_0x6efe('0xc')](function(_0x4c1b0e){logger[_0x6efe('0x11')]('['+[_0x266162[_0x6efe('0x12')]()]+_0x6efe('0x28'),_0x4c1b0e);_0x179384(_0x4c1b0e);});}})[_0x6efe('0x14')](function(_0x44c6cf){logger['error']('['+[_0x266162[_0x6efe('0x12')]()]+']',_0x44c6cf[_0x6efe('0x16')]);_0x52c936(_0x44c6cf['message']);});});};}function getCustomFields(_0x4392ec,_0xc03688){var _0x368cdc={};if(_0x4392ec[_0x6efe('0xe')]>0x0){_['forEach'](_0x4392ec,function(_0x4b23e1){if(_['includes']([_0x6efe('0x29'),_0x6efe('0x2a')],_0x4b23e1['type'])&&_0x4b23e1[_0x6efe('0x2b')]&&!_0x4b23e1[_0x6efe('0x2c')]){_0x368cdc[_0x4b23e1['nameField'][_0x6efe('0x2d')]()]=_0x4b23e1['content']['toString']();}else if(_[_0x6efe('0x2e')]([_0x6efe('0x29'),_0x6efe('0x2a')],_0x4b23e1[_0x6efe('0x2f')])&&_0x4b23e1[_0x6efe('0x30')]&&_0x4b23e1[_0x6efe('0x2c')]){_0x368cdc[_0x4b23e1[_0x6efe('0x30')][_0x6efe('0x2d')]()]=_0x4b23e1[_0x6efe('0x31')][_0x6efe('0x32')]();}else if(_0x4b23e1[_0x6efe('0x2f')]===_0x6efe('0x33')&&_0x4b23e1[_0x6efe('0x34')]&&_0x4b23e1[_0x6efe('0x30')]&&_0x4b23e1[_0x6efe('0x2c')]){_0x368cdc[_0x4b23e1[_0x6efe('0x30')][_0x6efe('0x2d')]()]=_0xc03688[_0x4b23e1[_0x6efe('0x34')]][_0x6efe('0x32')]();}else if(_0x4b23e1[_0x6efe('0x2f')]===_0x6efe('0x35')&&_0x4b23e1['Variable']&&_0x4b23e1['Variable'][_0x6efe('0x36')]&&_0x4b23e1[_0x6efe('0x30')]&&_0x4b23e1[_0x6efe('0x2c')]){_0x368cdc[_0x4b23e1['idField'][_0x6efe('0x2d')]()]=_0xc03688[_0x4b23e1['Variable'][_0x6efe('0x36')]['toLowerCase']()]['toString']();}});}return _0x368cdc;}function getTicket(_0x24c882,_0x2fb73b,_0x2abdc9,_0x57bd93,_0x154988,_0x54d569){return function(_0x442b95){logger[_0x6efe('0x11')]('['+[_0x24c882['toUpperCase']()]+_0x6efe('0x37'),_0x442b95);return new Promise(function(_0x50a034,_0x57406a){var _0xb75949=_0x24c882['toLowerCase']()===_0x6efe('0x38')?_0x442b95[_0x6efe('0x1c')]:_0x442b95['endUserId'];var _0x1c406f={'method':'POST','uri':_0x2abdc9+_0x6efe('0x39')+'?'+_0x54d569,'body':Object[_0x6efe('0x3a')]({},{'active':'true','caller_id':_0xb75949,'assigned_to':_0x442b95[_0x6efe('0x1c')],'short_description':intUtil[_0x6efe('0x3b')](_0x57bd93[_0x6efe('0x3c')],_0x154988,'\x20'),'description':intUtil[_0x6efe('0x3b')](_0x57bd93['Descriptions'],_0x154988,'\x0a')},getCustomFields(_0x57bd93[_0x6efe('0x3d')],_0x154988)),'auth':_0x2fb73b,'json':!![]};return rp(_0x1c406f)[_0x6efe('0xc')](function(_0x50ffe4){logger['info']('['+[_0x24c882[_0x6efe('0x12')]()]+_0x6efe('0x3e'),_0x50ffe4[_0x6efe('0xd')]);_0x442b95[_0x6efe('0x3f')]=_0x50ffe4['result'][_0x6efe('0x10')];_0x442b95[_0x6efe('0x40')]=_0x50ffe4['result'][_0x6efe('0x41')];logger[_0x6efe('0x11')]('['+[_0x24c882[_0x6efe('0x12')]()]+_0x6efe('0x42'),_0x442b95);_0x50a034(_0x442b95);})[_0x6efe('0x14')](function(_0x147cb4){logger[_0x6efe('0x15')]('['+[_0x24c882[_0x6efe('0x12')]()]+']',_0x147cb4[_0x6efe('0x16')]);_0x57406a(_0x147cb4[_0x6efe('0x16')]);});});};}function createRemoteTag(_0xd91816,_0x46cc56,_0x282c70,_0x12ff7d){return new Promise(function(_0x334163,_0x2e3eea){var _0x43b1cb={'method':_0x6efe('0x21'),'uri':_0x282c70+_0x6efe('0x43')+'?'+_0x12ff7d,'body':{'short_description':_0xd91816,'global':!![],'active':!![],'name':_0xd91816},'auth':_0x46cc56,'json':!![]};return rp(_0x43b1cb)[_0x6efe('0xc')](function(_0x2ece4e){var _0x278a9d=_0x2ece4e[_0x6efe('0xd')][_0x6efe('0x10')];_0x334163(_0x278a9d);});});}function getRemoteTag(_0x51d745,_0x328dd9,_0x32899d,_0x4b1598,_0x23b02a){return new Promise(function(_0x39ce32,_0x3dad6f){var _0x19c4fc={'method':'GET','uri':_0x32899d+'label'+_0x6efe('0x44')+_0x51d745+'&'+_0x4b1598,'auth':_0x328dd9,'json':!![]};return rp(_0x19c4fc)['then'](function(_0x501456){if(_0x501456[_0x6efe('0xd')]['length']>0x0){var _0x729f27=_0x501456['result'][0x0][_0x6efe('0x10')];_0x39ce32(_0x729f27);}else{return createRemoteTag(_0x51d745,_0x328dd9,_0x32899d,_0x4b1598)[_0x6efe('0xc')](function(_0xe8d6d0){_0x39ce32(_0xe8d6d0);});}});});}function assignTagToIncident(_0x2a48fd,_0x7e563d,_0x4e6d30,_0x57490e,_0x66a6a2){return new Promise(function(_0x50ea38,_0x40e464){var _0x11198b={'method':'POST','uri':_0x4e6d30+_0x6efe('0x45')+'?'+_0x66a6a2,'body':{'label':_0x2a48fd,'table':_0x6efe('0x39'),'id_type':_0x6efe('0x46'),'table_key':_0x57490e[_0x6efe('0x3f')],'title':_0x6efe('0x47')+_0x57490e['ticketNumber'],'id_display':_0x57490e['ticketNumber']},'auth':_0x7e563d,'json':!![]};return rp(_0x11198b)[_0x6efe('0xc')](function(_0x12392e){_0x50ea38();})[_0x6efe('0x14')](function(){_0x50ea38();});});}function manageTags(_0x186f7e,_0x2b6426,_0x337c80,_0x5529ef,_0x462da,_0x1ce199,_0x52d934){return new Promise(function(_0x187c2c,_0x408d41){var _0x27d909=[];_0x2b6426[_0x6efe('0x48')](function(_0xdcd468){_0x27d909[_0x6efe('0x49')](getRemoteTag(_0xdcd468,_0x337c80,_0x5529ef,_0x1ce199,_0x52d934));});return Promise[_0x6efe('0x4a')](_0x27d909)[_0x6efe('0xc')](function(_0x1619f2){if(_0x1619f2[_0x6efe('0xe')]){logger[_0x6efe('0x11')]('['+[_0x186f7e[_0x6efe('0x12')]()]+_0x6efe('0x4b'),_0x1619f2);var _0x673c16=[];_0x1619f2[_0x6efe('0x48')](function(_0x24684e){_0x673c16['push'](assignTagToIncident(_0x24684e,_0x337c80,_0x5529ef,_0x462da,_0x1ce199));});return Promise[_0x6efe('0x4a')](_0x673c16)[_0x6efe('0xc')](function(){_0x187c2c();})[_0x6efe('0x14')](function(){_0x187c2c();});}else{_0x187c2c();}});});}function getTags(_0x534240,_0x3bc809,_0x41490b,_0x3c6731,_0x132d0f,_0x51e2ad){return function(_0x2752f){return new Promise(function(_0x14a6fa,_0xb7ae97){var _0x49c001=[];var _0x1d0617=_0x3c6731['Tags'];if(_0x1d0617&&_0x1d0617[_0x6efe('0xe')]>0x0){_0x49c001=_['map'](_0x1d0617,'name');}if(_0x49c001[_0x6efe('0xe')]>0x0){return manageTags(_0x534240,_0x49c001,_0x3bc809,_0x41490b,_0x2752f,_0x132d0f,_0x51e2ad)[_0x6efe('0xc')](function(){_0x14a6fa(_0x2752f);});}else{_0x14a6fa(_0x2752f);}});};}function emit(_0x3941ff,_0x3e58a8,_0xbd0da7){var _0x1ce4f9=_0x6efe('0x4c')+_0x6efe('0x4d')+_0x6efe('0x4e')+'%255EORDERBYDESCnumber';var _0x4c0a03={'uri':_0x3941ff+_0x6efe('0x4f')+_0xbd0da7+_0x1ce4f9};io['to'](util[_0x6efe('0x50')](_0x6efe('0x51'),_0x3e58a8))[_0x6efe('0x52')](_0x6efe('0x53'),_0x4c0a03);}exports['cs']=function(_0x42b777,_0x3078ce,_0x3e57c6,_0x44e316,_0x5ba317,_0x1a0245,_0x1ad9b3,_0x1dee51){var _0x251b1c={};var _0x39d089={'user':_0x1a0245[_0x6efe('0x54')],'pass':_0x1a0245[_0x6efe('0x55')]};var _0x20b49b=_0x6efe('0x56');var _0x3266b3=_0x6efe('0x57');_0x1a0245[_0x6efe('0x58')]=intUtil[_0x6efe('0x59')](_0x1a0245[_0x6efe('0x58')]);_0x1a0245[_0x6efe('0x5a')]=intUtil[_0x6efe('0x59')](_0x1a0245[_0x6efe('0x5a')]);var _0x4630e7=util[_0x6efe('0x50')](_0x6efe('0x5b'),_0x1a0245[_0x6efe('0x58')]);_0x251b1c[_0x6efe('0x1d')]=!_['isNil'](_0x44e316)?_0x44e316[_0x6efe('0x5c')]:null;_0x251b1c[_0x6efe('0x1e')]=_0x1a0245[_0x6efe('0x5c')];_0x251b1c[_0x6efe('0x23')]=_0x1dee51['toLowerCase']()===_0x6efe('0x38')?_0x3078ce[_0x6efe('0x5d')]:_0x3078ce[_0x6efe('0x5e')];_0x251b1c[_0x6efe('0x5f')]=_0x1dee51===_0x6efe('0x60')||_0x1dee51===_0x6efe('0x61')?_0x6efe('0x60'):_0x6efe('0x38');var _0x37253b=util[_0x6efe('0x50')](_0x6efe('0x62'),_0x1a0245['serverUrl'],_0x3078ce[_0x6efe('0x63')],md5(_0x3078ce[_0x6efe('0x63')]));if(_0x5ba317&&_0x5ba317[_0x6efe('0x64')]){logger[_0x6efe('0x11')](_0x6efe('0x65'),'Recording\x20is\x20enabled!');_0x3078ce[_0x6efe('0x66')]=_0x37253b;}else if(_0x1ad9b3&&_0x1ad9b3[_0x6efe('0x67')]&&_0x1ad9b3[_0x6efe('0x67')]!==_0x6efe('0x68')){logger[_0x6efe('0x11')]('[OUTBOUND]',_0x6efe('0x69'));_0x3078ce['recordingURL']=_0x37253b;}else{_0x3078ce[_0x6efe('0x66')]='';}return getAdminUser(_0x1dee51,_0x39d089,_0x251b1c,_0x4630e7,_0x3266b3,_0x20b49b)[_0x6efe('0xc')](getUser(_0x1dee51,_0x39d089,_0x4630e7,_0x3266b3,_0x20b49b))[_0x6efe('0xc')](getEndUser(_0x1dee51,_0x39d089,_0x4630e7,_0x3266b3,_0x20b49b))[_0x6efe('0xc')](getTicket(_0x1dee51,_0x39d089,_0x4630e7,_0x3e57c6,_0x3078ce,_0x3266b3))[_0x6efe('0xc')](function(_0x2d4ffb){logger[_0x6efe('0x11')](util[_0x6efe('0x50')]('The\x20ticket\x20ID\x20is:\x20%s',_0x2d4ffb[_0x6efe('0x3f')]));logger[_0x6efe('0x11')](util[_0x6efe('0x50')](_0x6efe('0x6a'),_0x1dee51));if(_0x1dee51!=='unmanaged'){logger[_0x6efe('0x11')]('['+[_0x1dee51[_0x6efe('0x12')]()]+']',_0x6efe('0x6b'));emit(_0x1a0245[_0x6efe('0x58')],_0x44e316[_0x6efe('0x36')],_0x2d4ffb[_0x6efe('0x3f')]);}})[_0x6efe('0x14')](function(_0x5faf2c){logger[_0x6efe('0x15')]('['+[_0x1dee51[_0x6efe('0x12')]()]+_0x6efe('0x6c'),util[_0x6efe('0x6d')](_0x5faf2c,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x24cb=['customField','content','toString','idField','toLowerCase','variable','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','outbound','endUserId','incident','assign','getString','Descriptions','ticketId','ticketNumber','number','label','?sysparm_query=name%3D','label_entry','Incident','Incident\x20-\x20','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','%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','emit','trigger:browser:url','username','password','sysparm_limit=1','sysparm_display_value=true','stripTrailingSlash','remoteUri','serverUrl','isNil','email','destcalleridnum','calleridnum','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','bluebird','request-promise','util','md5','ioredis','./util','../../../../config/logger','servicenow','redis','localhost','socket.io-emitter','GET','then','result','adminId','info','toUpperCase','error','message','validateEmail','userEmail','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','active','true','userId','sys_id','adminEmail','],\x20getUser\x20crm','catch','],\x20createEndUser\x20input\x20crm','POST','sys_user?','user','endUserNumber','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','length','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','includes','string','picklist','type','nameField'];(function(_0x48eb39,_0x128582){var _0x26d101=function(_0x4b2ed5){while(--_0x4b2ed5){_0x48eb39['push'](_0x48eb39['shift']());}};_0x26d101(++_0x128582);}(_0x24cb,0x11b));var _0xb24c=function(_0x874cf1,_0x2a4954){_0x874cf1=_0x874cf1-0x0;var _0x233579=_0x24cb[_0x874cf1];return _0x233579;};'use strict';var _=require(_0xb24c('0x0'));var Promise=require(_0xb24c('0x1'));var rp=require(_0xb24c('0x2'));var util=require(_0xb24c('0x3'));var md5=require(_0xb24c('0x4'));var Redis=require(_0xb24c('0x5'));var intUtil=require(_0xb24c('0x6'));var config=require('../../../../config/environment');var logger=require(_0xb24c('0x7'))(_0xb24c('0x8'));config[_0xb24c('0x9')]=_['defaults'](config[_0xb24c('0x9')],{'host':_0xb24c('0xa'),'port':0x18eb});var io=require(_0xb24c('0xb'))(new Redis(config['redis']));function getAdminUser(_0x401967,_0x5baf8d,_0x4bc014,_0x53c14a,_0x5d6ba6,_0x1db57f){return new Promise(function(_0x4f0c06,_0x5aa011){var _0x266601={'method':_0xb24c('0xc'),'uri':_0x53c14a+'sys_user?sysparm_query=user_name%3Dadmin'+'&'+_0x5d6ba6+'&'+_0x1db57f,'auth':_0x5baf8d,'json':!![]};return rp(_0x266601)[_0xb24c('0xd')](function(_0x4eda2b){if(_0x4eda2b[_0xb24c('0xe')]['length']>0x0){_0x4bc014[_0xb24c('0xf')]=_0x4eda2b[_0xb24c('0xe')][0x0]['sys_id'];}logger[_0xb24c('0x10')]('['+[_0x401967[_0xb24c('0x11')]()]+'],\x20getAdminUser\x20crm',_0x4bc014);_0x4f0c06(_0x4bc014);})['catch'](function(_0x302218){logger[_0xb24c('0x12')]('['+[_0x401967[_0xb24c('0x11')]()]+']',_0x302218[_0xb24c('0x13')]);_0x5aa011(_0x302218[_0xb24c('0x13')]);});});}function getUser(_0x3d018f,_0x10fcbe,_0x3ce3b2,_0x5d9908,_0xbed07d){return function(_0x7d8f51){logger[_0xb24c('0x10')]('['+[_0x3d018f[_0xb24c('0x11')]()]+'],\x20getUser\x20input\x20crm',_0x7d8f51);return new Promise(function(_0x462289,_0x1114e0){if(intUtil[_0xb24c('0x14')](_0x7d8f51[_0xb24c('0x15')])){var _0x97e25b={'method':_0xb24c('0xc'),'uri':_0x3ce3b2+'sys_user?sysparm_query=email%3D'+_0x7d8f51[_0xb24c('0x15')]+'&'+_0x5d9908+'&'+_0xbed07d,'auth':_0x10fcbe,'json':!![]};logger[_0xb24c('0x10')]('['+[_0x3d018f[_0xb24c('0x11')]()]+_0xb24c('0x16'),_0x97e25b);return rp(_0x97e25b)['then'](function(_0x51e34f){logger['info']('['+[_0x3d018f[_0xb24c('0x11')]()]+_0xb24c('0x17'),_0x51e34f);if(_0x51e34f[_0xb24c('0xe')]['length']>0x0&&String(_0x51e34f[_0xb24c('0xe')][0x0][_0xb24c('0x18')])===_0xb24c('0x19')){_0x7d8f51[_0xb24c('0x1a')]=_0x51e34f['result'][0x0][_0xb24c('0x1b')];}else{_0x7d8f51[_0xb24c('0x1a')]=_0x7d8f51[_0xb24c('0xf')];_0x7d8f51['userEmail']=_0x7d8f51[_0xb24c('0x1c')];}logger['info']('['+[_0x3d018f[_0xb24c('0x11')]()]+_0xb24c('0x1d'),_0x7d8f51);_0x462289(_0x7d8f51);})[_0xb24c('0x1e')](function(_0x542cfe){logger[_0xb24c('0x12')]('['+[_0x3d018f['toUpperCase']()]+']',_0x542cfe['message']);_0x1114e0(_0x542cfe[_0xb24c('0x13')]);});}else{logger[_0xb24c('0x10')]('['+[_0x3d018f[_0xb24c('0x11')]()]+']\x20using\x20admin\x20profile');_0x7d8f51[_0xb24c('0x1a')]=_0x7d8f51[_0xb24c('0xf')];_0x7d8f51[_0xb24c('0x15')]=_0x7d8f51[_0xb24c('0x1c')];_0x462289(_0x7d8f51);}});};}function createEndUser(_0x201f3d,_0x996ef0,_0x316e2b,_0x86dea3,_0x155772){logger[_0xb24c('0x10')]('['+[_0x201f3d[_0xb24c('0x11')]()]+_0xb24c('0x1f'),_0x316e2b);return new Promise(function(_0x5dd46b,_0x2ea1ee){var _0x244955={'method':_0xb24c('0x20'),'uri':_0x86dea3+_0xb24c('0x21')+_0x155772,'body':{'user_name':_0x316e2b['endUserNumber'],'roles':_0xb24c('0x22'),'first_name':_0x316e2b[_0xb24c('0x23')],'active':_0xb24c('0x19'),'date_format':'System','phone':_0x316e2b[_0xb24c('0x23')]},'auth':_0x996ef0,'json':!![]};return rp(_0x244955)[_0xb24c('0xd')](function(_0x56a381){logger['info']('['+[_0x201f3d['toUpperCase']()]+'],\x20EndUser\x20schema',_0x56a381[_0xb24c('0xe')]);_0x316e2b['endUserId']=_0x56a381[_0xb24c('0xe')][_0xb24c('0x1b')];_0x5dd46b(_0x316e2b);})[_0xb24c('0x1e')](function(_0x2f3523){logger[_0xb24c('0x12')]('['+[_0x201f3d['toUpperCase']()]+']',_0x2f3523['message']);_0x2ea1ee(_0x2f3523[_0xb24c('0x13')]);});});}function getEndUser(_0x1797ad,_0x5ade47,_0x223d6e,_0x26f168,_0x4f5b97){return function(_0x30b212){logger[_0xb24c('0x10')]('['+[_0x1797ad[_0xb24c('0x11')]()]+_0xb24c('0x24'),_0x30b212);return new Promise(function(_0x16a40b,_0x28577c){var _0xc5088c={'method':_0xb24c('0xc'),'uri':_0x223d6e+_0xb24c('0x25')+_0x30b212[_0xb24c('0x23')]+'&'+_0x26f168+'&'+_0x4f5b97,'auth':_0x5ade47,'json':!![]};return rp(_0xc5088c)[_0xb24c('0xd')](function(_0x39f0b2){if(_0x39f0b2[_0xb24c('0xe')][_0xb24c('0x26')]>0x0){_0x30b212['endUserId']=_0x39f0b2[_0xb24c('0xe')][0x0]['sys_id'];logger[_0xb24c('0x10')]('['+[_0x1797ad[_0xb24c('0x11')]()]+_0xb24c('0x27'),_0x30b212);_0x16a40b(_0x30b212);}else{return createEndUser(_0x1797ad,_0x5ade47,_0x30b212,_0x223d6e,_0x26f168)[_0xb24c('0xd')](function(_0x352f33){logger[_0xb24c('0x10')]('['+[_0x1797ad[_0xb24c('0x11')]()]+_0xb24c('0x28'),_0x352f33);_0x16a40b(_0x352f33);});}})[_0xb24c('0x1e')](function(_0x3dd9d9){logger[_0xb24c('0x12')]('['+[_0x1797ad[_0xb24c('0x11')]()]+']',_0x3dd9d9[_0xb24c('0x13')]);_0x28577c(_0x3dd9d9[_0xb24c('0x13')]);});});};}function getCustomFields(_0x48fb5a,_0x3744c5){var _0x3d3ca1={};if(_0x48fb5a['length']>0x0){_[_0xb24c('0x29')](_0x48fb5a,function(_0x41dbbf){if(_[_0xb24c('0x2a')]([_0xb24c('0x2b'),_0xb24c('0x2c')],_0x41dbbf[_0xb24c('0x2d')])&&_0x41dbbf[_0xb24c('0x2e')]&&!_0x41dbbf[_0xb24c('0x2f')]){_0x3d3ca1[_0x41dbbf[_0xb24c('0x2e')]['toLowerCase']()]=_0x41dbbf[_0xb24c('0x30')][_0xb24c('0x31')]();}else if(_[_0xb24c('0x2a')]([_0xb24c('0x2b'),'picklist'],_0x41dbbf[_0xb24c('0x2d')])&&_0x41dbbf['idField']&&_0x41dbbf['customField']){_0x3d3ca1[_0x41dbbf[_0xb24c('0x32')][_0xb24c('0x33')]()]=_0x41dbbf[_0xb24c('0x30')][_0xb24c('0x31')]();}else if(_0x41dbbf[_0xb24c('0x2d')]===_0xb24c('0x34')&&_0x41dbbf[_0xb24c('0x35')]&&_0x41dbbf[_0xb24c('0x32')]&&_0x41dbbf[_0xb24c('0x2f')]){_0x3d3ca1[_0x41dbbf[_0xb24c('0x32')]['toLowerCase']()]=_0x3744c5[_0x41dbbf[_0xb24c('0x35')]][_0xb24c('0x31')]();}else if(_0x41dbbf[_0xb24c('0x2d')]===_0xb24c('0x36')&&_0x41dbbf[_0xb24c('0x37')]&&_0x41dbbf[_0xb24c('0x37')][_0xb24c('0x38')]&&_0x41dbbf[_0xb24c('0x32')]&&_0x41dbbf[_0xb24c('0x2f')]){_0x3d3ca1[_0x41dbbf[_0xb24c('0x32')][_0xb24c('0x33')]()]=_0x3744c5[_0x41dbbf['Variable'][_0xb24c('0x38')][_0xb24c('0x33')]()][_0xb24c('0x31')]();}});}return _0x3d3ca1;}function getTicket(_0x53db1e,_0x3b8d3e,_0x30967e,_0x51273f,_0x47aa3f,_0x46f5ec){return function(_0x8ce7f4){logger[_0xb24c('0x10')]('['+[_0x53db1e[_0xb24c('0x11')]()]+_0xb24c('0x39'),_0x8ce7f4);return new Promise(function(_0x22b12a,_0x2bc046){var _0x218a8e=_0x53db1e[_0xb24c('0x33')]()===_0xb24c('0x3a')?_0x8ce7f4[_0xb24c('0x1a')]:_0x8ce7f4[_0xb24c('0x3b')];var _0x437c00={'method':_0xb24c('0x20'),'uri':_0x30967e+_0xb24c('0x3c')+'?'+_0x46f5ec,'body':Object[_0xb24c('0x3d')]({},{'active':'true','caller_id':_0x218a8e,'assigned_to':_0x8ce7f4['userId'],'short_description':intUtil[_0xb24c('0x3e')](_0x51273f['Subjects'],_0x47aa3f,'\x20'),'description':intUtil[_0xb24c('0x3e')](_0x51273f[_0xb24c('0x3f')],_0x47aa3f,'\x0a')},getCustomFields(_0x51273f['Fields'],_0x47aa3f)),'auth':_0x3b8d3e,'json':!![]};return rp(_0x437c00)[_0xb24c('0xd')](function(_0x487268){logger[_0xb24c('0x10')]('['+[_0x53db1e[_0xb24c('0x11')]()]+']\x20POST\x20incident\x20entity\x20schema',_0x487268[_0xb24c('0xe')]);_0x8ce7f4[_0xb24c('0x40')]=_0x487268[_0xb24c('0xe')]['sys_id'];_0x8ce7f4[_0xb24c('0x41')]=_0x487268[_0xb24c('0xe')][_0xb24c('0x42')];logger[_0xb24c('0x10')]('['+[_0x53db1e[_0xb24c('0x11')]()]+']\x20getTicket\x20crm',_0x8ce7f4);_0x22b12a(_0x8ce7f4);})[_0xb24c('0x1e')](function(_0x226d25){logger[_0xb24c('0x12')]('['+[_0x53db1e[_0xb24c('0x11')]()]+']',_0x226d25[_0xb24c('0x13')]);_0x2bc046(_0x226d25[_0xb24c('0x13')]);});});};}function createRemoteTag(_0x51f823,_0x1454be,_0x28199c,_0x4566b4){return new Promise(function(_0xf29648,_0xd96e0d){var _0x1e6abb={'method':'POST','uri':_0x28199c+'label'+'?'+_0x4566b4,'body':{'short_description':_0x51f823,'global':!![],'active':!![],'name':_0x51f823},'auth':_0x1454be,'json':!![]};return rp(_0x1e6abb)[_0xb24c('0xd')](function(_0x2594c3){var _0x443aa6=_0x2594c3['result'][_0xb24c('0x1b')];_0xf29648(_0x443aa6);});});}function getRemoteTag(_0x3ea062,_0x4b68d3,_0x479970,_0x485ff9,_0x596e14){return new Promise(function(_0x5b9a6b,_0x29c6db){var _0x510348={'method':_0xb24c('0xc'),'uri':_0x479970+_0xb24c('0x43')+_0xb24c('0x44')+_0x3ea062+'&'+_0x485ff9,'auth':_0x4b68d3,'json':!![]};return rp(_0x510348)['then'](function(_0xc3eb17){if(_0xc3eb17[_0xb24c('0xe')][_0xb24c('0x26')]>0x0){var _0x3bb83f=_0xc3eb17[_0xb24c('0xe')][0x0]['sys_id'];_0x5b9a6b(_0x3bb83f);}else{return createRemoteTag(_0x3ea062,_0x4b68d3,_0x479970,_0x485ff9)[_0xb24c('0xd')](function(_0xe47e64){_0x5b9a6b(_0xe47e64);});}});});}function assignTagToIncident(_0x1b5e79,_0x4dd226,_0x1cbe25,_0x120d86,_0x55210c){return new Promise(function(_0x30eecd,_0x4ccf57){var _0x3fa9fe={'method':_0xb24c('0x20'),'uri':_0x1cbe25+_0xb24c('0x45')+'?'+_0x55210c,'body':{'label':_0x1b5e79,'table':'incident','id_type':_0xb24c('0x46'),'table_key':_0x120d86[_0xb24c('0x40')],'title':_0xb24c('0x47')+_0x120d86['ticketNumber'],'id_display':_0x120d86['ticketNumber']},'auth':_0x4dd226,'json':!![]};return rp(_0x3fa9fe)[_0xb24c('0xd')](function(_0x1f1274){_0x30eecd();})['catch'](function(){_0x30eecd();});});}function manageTags(_0x33f65c,_0x4cb3f9,_0x1791f4,_0x450ec5,_0x1549e2,_0x5416bb,_0x5c503a){return new Promise(function(_0x38fe45,_0x4b410e){var _0x54b73c=[];_0x4cb3f9[_0xb24c('0x29')](function(_0x1bbd9f){_0x54b73c[_0xb24c('0x48')](getRemoteTag(_0x1bbd9f,_0x1791f4,_0x450ec5,_0x5416bb,_0x5c503a));});return Promise[_0xb24c('0x49')](_0x54b73c)[_0xb24c('0xd')](function(_0x5ced5c){if(_0x5ced5c[_0xb24c('0x26')]){logger[_0xb24c('0x10')]('['+[_0x33f65c[_0xb24c('0x11')]()]+_0xb24c('0x4a'),_0x5ced5c);var _0x598c45=[];_0x5ced5c[_0xb24c('0x29')](function(_0x4b08ff){_0x598c45[_0xb24c('0x48')](assignTagToIncident(_0x4b08ff,_0x1791f4,_0x450ec5,_0x1549e2,_0x5416bb));});return Promise[_0xb24c('0x49')](_0x598c45)['then'](function(){_0x38fe45();})[_0xb24c('0x1e')](function(){_0x38fe45();});}else{_0x38fe45();}});});}function getTags(_0x253340,_0x2a4fdb,_0x1c317b,_0x2e844e,_0xe64ca3,_0x155138){return function(_0x1c416d){return new Promise(function(_0x10d3ad,_0x457683){var _0x456e47=[];var _0x1c53ac=_0x2e844e[_0xb24c('0x4b')];if(_0x1c53ac&&_0x1c53ac[_0xb24c('0x26')]>0x0){_0x456e47=_['map'](_0x1c53ac,'name');}if(_0x456e47[_0xb24c('0x26')]>0x0){return manageTags(_0x253340,_0x456e47,_0x2a4fdb,_0x1c317b,_0x1c416d,_0xe64ca3,_0x155138)['then'](function(){_0x10d3ad(_0x1c416d);});}else{_0x10d3ad(_0x1c416d);}});};}function emit(_0x335b36,_0xcfae2e,_0x5b7b9a){var _0xe3d252=_0xb24c('0x4c')+_0xb24c('0x4d')+_0xb24c('0x4e')+_0xb24c('0x4f');var _0xf2ddd={'uri':_0x335b36+_0xb24c('0x50')+_0x5b7b9a+_0xe3d252};io['to'](util[_0xb24c('0x51')]('user:%s',_0xcfae2e))[_0xb24c('0x52')](_0xb24c('0x53'),_0xf2ddd);}exports['cs']=function(_0x32bc81,_0x2f45a4,_0x4fd736,_0x4f0cbb,_0x3987ba,_0x1bcb31,_0x2ee255,_0x91c73){var _0x7fd4da={};var _0x5276d5={'user':_0x1bcb31[_0xb24c('0x54')],'pass':_0x1bcb31[_0xb24c('0x55')]};var _0x4a2424=_0xb24c('0x56');var _0x1f5d59=_0xb24c('0x57');_0x1bcb31['remoteUri']=intUtil[_0xb24c('0x58')](_0x1bcb31[_0xb24c('0x59')]);_0x1bcb31[_0xb24c('0x5a')]=intUtil['stripTrailingSlash'](_0x1bcb31[_0xb24c('0x5a')]);var _0x52de11=util[_0xb24c('0x51')]('%s/api/now/table/',_0x1bcb31[_0xb24c('0x59')]);_0x7fd4da[_0xb24c('0x15')]=!_[_0xb24c('0x5b')](_0x4f0cbb)?_0x4f0cbb['email']:null;_0x7fd4da[_0xb24c('0x1c')]=_0x1bcb31[_0xb24c('0x5c')];_0x7fd4da['endUserNumber']=_0x91c73[_0xb24c('0x33')]()===_0xb24c('0x3a')?_0x2f45a4[_0xb24c('0x5d')]:_0x2f45a4[_0xb24c('0x5e')];_0x7fd4da['callDirection']=_0x91c73===_0xb24c('0x5f')||_0x91c73===_0xb24c('0x60')?_0xb24c('0x5f'):_0xb24c('0x3a');var _0xf626df=util[_0xb24c('0x51')](_0xb24c('0x61'),_0x1bcb31[_0xb24c('0x5a')],_0x2f45a4[_0xb24c('0x62')],md5(_0x2f45a4['uniqueid']));if(_0x3987ba&&_0x3987ba[_0xb24c('0x63')]){logger['info']('[QUEUE]',_0xb24c('0x64'));_0x2f45a4[_0xb24c('0x65')]=_0xf626df;}else if(_0x2ee255&&_0x2ee255['recordingFormat']&&_0x2ee255[_0xb24c('0x66')]!==_0xb24c('0x67')){logger[_0xb24c('0x10')](_0xb24c('0x68'),_0xb24c('0x64'));_0x2f45a4[_0xb24c('0x65')]=_0xf626df;}else{_0x2f45a4['recordingURL']='';}return getAdminUser(_0x91c73,_0x5276d5,_0x7fd4da,_0x52de11,_0x1f5d59,_0x4a2424)[_0xb24c('0xd')](getUser(_0x91c73,_0x5276d5,_0x52de11,_0x1f5d59,_0x4a2424))['then'](getEndUser(_0x91c73,_0x5276d5,_0x52de11,_0x1f5d59,_0x4a2424))[_0xb24c('0xd')](getTicket(_0x91c73,_0x5276d5,_0x52de11,_0x4fd736,_0x2f45a4,_0x1f5d59))[_0xb24c('0xd')](function(_0x3bd4e6){logger['info'](util[_0xb24c('0x51')](_0xb24c('0x69'),_0x3bd4e6[_0xb24c('0x40')]));logger[_0xb24c('0x10')](util[_0xb24c('0x51')](_0xb24c('0x6a'),_0x91c73));if(_0x91c73!=='unmanaged'){logger['info']('['+[_0x91c73['toUpperCase']()]+']',_0xb24c('0x6b'));emit(_0x1bcb31[_0xb24c('0x59')],_0x4f0cbb[_0xb24c('0x38')],_0x3bd4e6[_0xb24c('0x40')]);}})['catch'](function(_0x3dc20d){logger[_0xb24c('0x12')]('['+[_0x91c73[_0xb24c('0x11')]()]+_0xb24c('0x6c'),util[_0xb24c('0x6d')](_0x3dc20d,{'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 0e0027b..4d45f5e 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 _0xd394=['Basic\x20%s','apiKey','toString','base64','get_server_info','isNil','Getting\x20agent\x20with\x20name','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','entry_list','find','value','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','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','set_entry','first_name','Enduser\x20created.','debug','[HTTP]','merge','map','type','string','nameField','customField','toLowerCase','custom_fields','variable','customVariable','Variable','POST','login','username','password','PLAIN','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','stripTrailingSlash','remoteUri','serverUrl','uri','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridnum','Fields','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','contacts','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','error','unmanaged','%s/service/v4_1/rest.php','monitor_format','lastevent','calleridname','lodash','request-promise','bluebird','md5','util','ioredis','../../../../config/environment','../../../../config/logger','sugarcrm','redis','socket.io-emitter','emit','info','name','assigned_user_id','created_by','description','Descriptions','date_start','toISOString','slice','replace','duration_hours','duration_minutes','parent_id','Contacts','length','forEach','push','idField','variableName','JSON','stringify','Calls','format'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xd394,0x13c));var _0x4d39=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd394[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4d39('0x0'));var rp=require(_0x4d39('0x1'));var BPromise=require(_0x4d39('0x2'));var md5=require(_0x4d39('0x3'));var util=require(_0x4d39('0x4'));var Redis=require(_0x4d39('0x5'));var intUtil=require('./util');var config=require(_0x4d39('0x6'));var logger=require(_0x4d39('0x7'))(_0x4d39('0x8'));config[_0x4d39('0x9')]=_['defaults'](config[_0x4d39('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0x4d39('0xa'))(new Redis(config['redis']));var def={'method':'POST','json':!![]};function emit(_0x4f9e3b,_0x44c252,_0x4b3cb8){io['to'](_0x4f9e3b)[_0x4d39('0xb')](_0x44c252,_0x4b3cb8);}function getTicket(_0x5f4e0d,_0x2a59b6,_0x233552,_0x2f651e,_0x1795d7,_0x1fe817,_0x1792b9,_0x49a2cd){logger[_0x4d39('0xc')]('Creating\x20new\x20ticket...');var _0x415fc1=new Date();var _0x5137d6=[{'name':_0x4d39('0xd'),'value':intUtil['getString'](_0x2f651e['Subjects'],_0x1795d7,'\x20')},{'name':_0x4d39('0xe'),'value':_0x2a59b6['id']},{'name':_0x4d39('0xf'),'value':_0x2a59b6['id']},{'name':_0x4d39('0x10'),'value':intUtil['getString'](_0x2f651e[_0x4d39('0x11')],_0x1795d7,'\x0a')},{'name':_0x4d39('0x12'),'value':_0x415fc1[_0x4d39('0x13')]()[_0x4d39('0x14')](0x0,0x13)[_0x4d39('0x15')]('T','\x20')},{'name':_0x4d39('0x16'),'value':'0'},{'name':_0x4d39('0x17'),'value':'15'},{'name':_0x4d39('0x18'),'value':_0x233552['id']},{'name':'parent_type','value':_0x4d39('0x19')},{'name':'parent_name','value':_0x233552[_0x4d39('0xd')]},{'name':'direction','value':_0x49a2cd}];if(_0x1fe817[_0x4d39('0x1a')]){_[_0x4d39('0x1b')](_0x1fe817,function(_0x5e04ed){if(_0x1795d7[_0x5e04ed['variableName']]){_0x5137d6[_0x4d39('0x1c')]({'name':_0x5e04ed[_0x4d39('0x1d')],'value':_0x1795d7[_0x5e04ed[_0x4d39('0x1e')]]});}});}return request({'form':{'method':'set_entry','input_type':'JSON','response_type':_0x4d39('0x1f'),'rest_data':JSON[_0x4d39('0x20')]({'session':_0x1792b9['id'],'module_name':_0x4d39('0x21'),'name_value_list':_0x5137d6})}});}function getAuth(_0x4c8982){return util[_0x4d39('0x22')](_0x4d39('0x23'),new Buffer(_0x4c8982[_0x4d39('0x24')]+':X')[_0x4d39('0x25')](_0x4d39('0x26')));}function getServerInfo(_0x2f20ca){return request({'form':{'method':_0x4d39('0x27'),'input_type':_0x4d39('0x1f'),'response_type':_0x4d39('0x1f'),'rest_data':JSON['stringify']({'session':_0x2f20ca['id']})}});}function getUser(_0x24e8f4,_0x1b8b11,_0xe9bc60){if(!_[_0x4d39('0x28')](_0x1b8b11)){logger['info'](_0x4d39('0x29'),_0x1b8b11);return request({'form':{'method':'get_entry_list','input_type':_0x4d39('0x1f'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0xe9bc60['id'],'module_name':'Employees','query':util[_0x4d39('0x22')](_0x4d39('0x2a'),_0x1b8b11),'order_by':'','offset':'0','select_fields':['id',_0x4d39('0xd'),_0x4d39('0x2b')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x4d39('0x2c')](function(_0x1130aa){if(_0x1130aa[_0x4d39('0x2d')][_0x4d39('0x1a')]){var _0x47cb3a=_[_0x4d39('0x2e')](_0x1130aa[_0x4d39('0x2d')],function(_0x274424){return _0x274424['name_value_list'][_0x4d39('0x2b')][_0x4d39('0x2f')]===_0x1b8b11;});if(_0x47cb3a){logger[_0x4d39('0xc')]('Agent\x20found!');return BPromise[_0x4d39('0x30')]({'id':_0x47cb3a[_0x4d39('0x31')]['id'][_0x4d39('0x2f')],'name':_0x47cb3a['name_value_list'][_0x4d39('0xd')]['value']});}}logger[_0x4d39('0xc')](_0x4d39('0x32'));return BPromise[_0x4d39('0x30')]({'id':_0xe9bc60[_0x4d39('0x31')][_0x4d39('0x33')][_0x4d39('0x2f')],'name':_0xe9bc60[_0x4d39('0x31')][_0x4d39('0x2b')][_0x4d39('0x2f')]});});}else{logger[_0x4d39('0xc')](_0x4d39('0x34'));return BPromise[_0x4d39('0x30')]({'id':_0xe9bc60[_0x4d39('0x31')][_0x4d39('0x33')][_0x4d39('0x2f')],'name':_0xe9bc60[_0x4d39('0x31')][_0x4d39('0x2b')][_0x4d39('0x2f')]});}}function getEndUser(_0xfa3a92,_0x3cee39,_0x5ca869,_0xe62c9e){logger[_0x4d39('0xc')](_0x4d39('0x35'),_0x5ca869);return request({'form':{'method':'get_entry_list','input_type':_0x4d39('0x1f'),'response_type':_0x4d39('0x1f'),'rest_data':JSON['stringify']({'session':_0xe62c9e['id'],'module_name':_0x4d39('0x19'),'query':util[_0x4d39('0x22')](_0x4d39('0x36'),_0x5ca869),'order_by':'','offset':'0','select_fields':['id',_0x4d39('0xd'),'phone_home'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x2f11b0){if(_0x2f11b0[_0x4d39('0x2d')][_0x4d39('0x1a')]){var _0x15769c=_[_0x4d39('0x2e')](_0x2f11b0[_0x4d39('0x2d')],function(_0x542a28){return _0x542a28[_0x4d39('0x31')][_0x4d39('0x37')][_0x4d39('0x2f')]===_0x5ca869;});if(_0x15769c){logger[_0x4d39('0xc')]('Enduser\x20found!');return BPromise['resolve']({'id':_0x15769c[_0x4d39('0x31')]['id'][_0x4d39('0x2f')],'name':_0x15769c[_0x4d39('0x31')][_0x4d39('0xd')][_0x4d39('0x2f')],'phone':_0x15769c[_0x4d39('0x31')][_0x4d39('0x37')][_0x4d39('0x2f')]});}}else{logger[_0x4d39('0xc')](_0x4d39('0x38'));return request({'form':{'method':_0x4d39('0x39'),'input_type':_0x4d39('0x1f'),'response_type':'JSON','rest_data':JSON[_0x4d39('0x20')]({'session':_0xe62c9e['id'],'module_name':_0x4d39('0x19'),'name_value_list':[{'name':_0x4d39('0x3a'),'value':_0x3cee39!==''?_0x3cee39:util['format']('Caller\x20-\x20%s',_0x5ca869)},{'name':'phone_home','value':_0x5ca869}]})}})['then'](function(_0x35abdc){logger[_0x4d39('0xc')](_0x4d39('0x3b'));return BPromise[_0x4d39('0x30')]({'id':_0x35abdc['id'],'name':_0x35abdc[_0x4d39('0x2d')][_0x4d39('0x3a')][_0x4d39('0x2f')],'phone':_0x35abdc[_0x4d39('0x2d')][_0x4d39('0x37')][_0x4d39('0x2f')]});});}});}function request(_0x48a78d){logger[_0x4d39('0x3c')](_0x4d39('0x3d'),JSON[_0x4d39('0x20')](_0x48a78d));return rp(_[_0x4d39('0x3e')](def,_0x48a78d));}function getTags(_0x2e369e,_0x2f91a7){var _0x5559e8=[];if(_0x2e369e&&_0x2e369e[_0x4d39('0x1a')]>0x0){_0x5559e8=_[_0x4d39('0x3f')](_0x2e369e,_0x2f91a7);}return _0x5559e8;}function getCustomFields(_0xd7b4b2,_0x5410af){var _0x5a3f70=[];var _0x5daa07={'custom_fields':[]};if(_0xd7b4b2[_0x4d39('0x1a')]>0x0){_[_0x4d39('0x1b')](_0xd7b4b2,function(_0x2ff027){if(_0x2ff027[_0x4d39('0x40')]===_0x4d39('0x41')&&_0x2ff027[_0x4d39('0x42')]&&!_0x2ff027[_0x4d39('0x43')]){_0x5daa07[_0x2ff027['nameField'][_0x4d39('0x44')]()]=_0x2ff027['content']['toString']();}else if(_0x2ff027[_0x4d39('0x40')]===_0x4d39('0x41')&&_0x2ff027[_0x4d39('0x1d')]&&_0x2ff027[_0x4d39('0x43')]){_0x5daa07[_0x4d39('0x45')][_0x4d39('0x1c')]({'id':_0x2ff027[_0x4d39('0x1d')],'value':_0x2ff027['content'][_0x4d39('0x25')]()});}else if(_0x2ff027[_0x4d39('0x40')]===_0x4d39('0x46')&&_0x2ff027[_0x4d39('0x1e')]&&_0x2ff027[_0x4d39('0x1d')]&&_0x2ff027[_0x4d39('0x43')]){_0x5410af[_0x2ff027[_0x4d39('0x1e')]]&&_0x5daa07[_0x4d39('0x45')][_0x4d39('0x1c')]({'id':_0x2ff027['idField'],'value':_0x5410af[_0x2ff027[_0x4d39('0x1e')]][_0x4d39('0x25')]()});}else if(_0x2ff027[_0x4d39('0x40')]===_0x4d39('0x47')&&_0x2ff027[_0x4d39('0x48')]&&_0x2ff027['Variable'][_0x4d39('0xd')]&&_0x2ff027[_0x4d39('0x1d')]&&_0x2ff027[_0x4d39('0x43')]){_0x5410af[_0x2ff027[_0x4d39('0x48')]['name']['toLowerCase']()]&&_0x5daa07[_0x4d39('0x45')][_0x4d39('0x1c')]({'id':_0x2ff027[_0x4d39('0x1d')],'value':_0x5410af[_0x2ff027[_0x4d39('0x48')][_0x4d39('0xd')]['toLowerCase']()][_0x4d39('0x25')]()});}});}return _0x5daa07;}function getConnection(_0x317c81){return request({'method':_0x4d39('0x49'),'form':{'method':_0x4d39('0x4a'),'input_type':_0x4d39('0x1f'),'response_type':_0x4d39('0x1f'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x317c81[_0x4d39('0x4b')],'password':_0x317c81[_0x4d39('0x4c')],'encryption':_0x4d39('0x4d')},'application':'xCALLY\x20Motion\x20integration'})}})[_0x4d39('0x2c')](function(_0x513c40){var _0x3fd77c=_0x513c40;if(_0x3fd77c['id']){def[_0x4d39('0x4e')]=_0x3fd77c['id'];return BPromise[_0x4d39('0x30')](_0x3fd77c);}else{throw new Error(util[_0x4d39('0x22')](_0x4d39('0x4f'),_0x317c81['id']));}});}function setRelationship(_0x41f7b1,_0x5b8ba8,_0x41734b,_0x4404e4){return request({'form':{'method':_0x4d39('0x50'),'input_type':'JSON','response_type':_0x4d39('0x1f'),'rest_data':JSON['stringify']({'session':_0x41f7b1['id'],'module_name':'Calls','module_id':_0x41734b['id'],'link_field_name':_0x4404e4,'related_ids':[_0x5b8ba8['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x4d39('0x51')]=function(_0x658ba0,_0x387ac2,_0x43a922,_0x5c555d,_0x108217,_0x4fb635){var _0x479158,_0x207580,_0x2e718,_0x1ec5bb;_0x4fb635['remoteUri']=intUtil[_0x4d39('0x52')](_0x4fb635[_0x4d39('0x53')]);_0x4fb635[_0x4d39('0x54')]=intUtil['stripTrailingSlash'](_0x4fb635[_0x4d39('0x54')]);def[_0x4d39('0x55')]=util['format']('%s/service/v4_1/rest.php',_0x4fb635['remoteUri']);if(_0x108217&&_0x108217['monitor_format']){logger[_0x4d39('0xc')](_0x4d39('0x56'),_0x4d39('0x57'));_0x387ac2[_0x4d39('0x58')]=util[_0x4d39('0x22')](_0x4d39('0x59'),_0x4fb635['serverUrl'],_0x387ac2[_0x4d39('0x5a')],md5(_0x387ac2[_0x4d39('0x5a')]));}else{_0x387ac2['recordingURL']='';}return getConnection(_0x4fb635)[_0x4d39('0x2c')](function(_0x51bbb1){_0x1ec5bb=_0x51bbb1;return getUser(_0x4fb635,_0x5c555d[_0x4d39('0xd')],_0x1ec5bb);})[_0x4d39('0x2c')](function(_0x5d26da){_0x479158=_0x5d26da;logger[_0x4d39('0xc')](_0x4d39('0x5b'),_0x479158['id']);return getEndUser(_0x4fb635,_0x387ac2['calleridname'],_0x387ac2[_0x4d39('0x5c')],_0x1ec5bb);})[_0x4d39('0x2c')](function(_0x299f66){_0x207580=_0x299f66;logger[_0x4d39('0xc')]('The\x20Enduser\x20ID\x20is:',_0x207580['id']);return getTicket(_0x4fb635,_0x479158,_0x207580,_0x43a922,_0x387ac2,_0x43a922[_0x4d39('0x5d')],_0x1ec5bb,'Inbound');})[_0x4d39('0x2c')](function(_0xdb35c6){_0x2e718=_0xdb35c6;logger[_0x4d39('0xc')](_0x4d39('0x5e'));logger[_0x4d39('0xc')](_0x4d39('0x5f'),_0x2e718['id']);return setRelationship(_0x1ec5bb,_0x479158,_0x2e718,_0x4d39('0x60'));})[_0x4d39('0x2c')](function(){return setRelationship(_0x1ec5bb,_0x207580,_0x2e718,_0x4d39('0x61'));})[_0x4d39('0x2c')](function(){return getServerInfo(_0x1ec5bb);})[_0x4d39('0x2c')](function(_0x37f9c8){var _0x267d35=parseInt(_0x37f9c8[_0x4d39('0x62')][_0x4d39('0x63')](0x0));var _0x1e3a7e=util['format'](_0x4d39('0x64'),_0x4fb635[_0x4d39('0x53')],_0x2e718['id']);if(_0x267d35>0x6){_0x1e3a7e=util[_0x4d39('0x22')](_0x4d39('0x65'),_0x4fb635[_0x4d39('0x53')],_0x2e718['id']);}logger[_0x4d39('0xc')](_0x4d39('0x56'),_0x4d39('0x66'));emit(util[_0x4d39('0x22')](_0x4d39('0x67'),_0x5c555d[_0x4d39('0xd')]),_0x4d39('0x68'),{'uri':_0x1e3a7e});})[_0x4d39('0x69')](function(_0x182250){logger['error'](_0x4d39('0x56'),JSON[_0x4d39('0x20')](_0x182250));});};exports[_0x4d39('0x6a')]=function(_0x43aaa0,_0x3cee3b,_0x20ef46,_0x59e0b5,_0x509847,_0x1c8dfa,_0x5b7836){var _0x4d5f85,_0x167155,_0x2ce11b,_0x51a5d8;_0x1c8dfa[_0x4d39('0x53')]=intUtil[_0x4d39('0x52')](_0x1c8dfa[_0x4d39('0x53')]);_0x1c8dfa[_0x4d39('0x54')]=intUtil['stripTrailingSlash'](_0x1c8dfa[_0x4d39('0x54')]);def[_0x4d39('0x55')]=util[_0x4d39('0x22')]('%s/service/v4_1/rest.php',_0x1c8dfa[_0x4d39('0x53')]);if(_0x5b7836&&_0x5b7836['recordingFormat']&&_0x5b7836[_0x4d39('0x6b')]!==_0x4d39('0x6c')){logger[_0x4d39('0xc')](_0x4d39('0x6d'),_0x4d39('0x57'));_0x3cee3b['recordingURL']=util[_0x4d39('0x22')](_0x4d39('0x59'),_0x1c8dfa[_0x4d39('0x54')],_0x3cee3b[_0x4d39('0x5a')],md5(_0x3cee3b[_0x4d39('0x5a')]));}return getConnection(_0x1c8dfa)[_0x4d39('0x2c')](function(_0x5515dc){_0x51a5d8=_0x5515dc;return getUser(_0x1c8dfa,_0x59e0b5[_0x4d39('0xd')],_0x51a5d8);})[_0x4d39('0x2c')](function(_0x2f28a1){_0x4d5f85=_0x2f28a1;logger[_0x4d39('0xc')](_0x4d39('0x5b'),_0x4d5f85['id']);return getEndUser(_0x1c8dfa,_0x3cee3b[_0x4d39('0x6e')],_0x3cee3b['destcalleridnum'],_0x51a5d8);})[_0x4d39('0x2c')](function(_0x3e1d12){_0x167155=_0x3e1d12;logger[_0x4d39('0xc')]('The\x20Enduser\x20ID\x20is:',_0x167155['id']);return getTicket(_0x1c8dfa,_0x4d5f85,_0x167155,_0x20ef46,_0x3cee3b,_0x20ef46[_0x4d39('0x5d')],_0x51a5d8,'Outbound');})[_0x4d39('0x2c')](function(_0x52a039){_0x2ce11b=_0x52a039;logger['info'](_0x4d39('0x5e'));logger['info'](_0x4d39('0x5f'),_0x2ce11b['id']);return setRelationship(_0x51a5d8,_0x4d5f85,_0x2ce11b,_0x4d39('0x60'));})[_0x4d39('0x2c')](function(){return setRelationship(_0x51a5d8,_0x167155,_0x2ce11b,_0x4d39('0x61'));})['then'](function(){return getServerInfo(_0x51a5d8);})[_0x4d39('0x2c')](function(_0x34b42c){var _0x3b2121=parseInt(_0x34b42c[_0x4d39('0x62')][_0x4d39('0x63')](0x0));var _0x4a74aa=util[_0x4d39('0x22')](_0x4d39('0x64'),_0x1c8dfa['remoteUri'],_0x2ce11b['id']);if(_0x3b2121>0x6){_0x4a74aa=util[_0x4d39('0x22')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x1c8dfa[_0x4d39('0x53')],_0x2ce11b['id']);}logger[_0x4d39('0xc')](_0x4d39('0x6d'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x4d39('0x22')](_0x4d39('0x67'),_0x59e0b5[_0x4d39('0xd')]),'trigger:browser:url',{'uri':_0x4a74aa});})[_0x4d39('0x69')](function(_0x5b2a08){logger[_0x4d39('0x6f')](_0x4d39('0x6d'),JSON['stringify'](_0x5b2a08));});};exports[_0x4d39('0x70')]=function(_0x5de63c,_0x593953,_0x1de7b8,_0x3040c2,_0x51a4b4,_0x5c3981){var _0x13d757,_0x415047,_0x559c23,_0x4f5513;_0x5c3981[_0x4d39('0x53')]=intUtil[_0x4d39('0x52')](_0x5c3981[_0x4d39('0x53')]);_0x5c3981[_0x4d39('0x54')]=intUtil[_0x4d39('0x52')](_0x5c3981[_0x4d39('0x54')]);def[_0x4d39('0x55')]=util['format'](_0x4d39('0x71'),_0x5c3981['remoteUri']);if(_0x51a4b4&&_0x51a4b4[_0x4d39('0x72')]){logger[_0x4d39('0xc')]('['+_0x593953[_0x4d39('0x73')]['toUpperCase']()+']',_0x4d39('0x57'));_0x593953[_0x4d39('0x58')]=util[_0x4d39('0x22')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5c3981[_0x4d39('0x54')],_0x593953[_0x4d39('0x5a')],md5(_0x593953[_0x4d39('0x5a')]));}else{_0x593953[_0x4d39('0x58')]='';}return getConnection(_0x5c3981)[_0x4d39('0x2c')](function(_0x5b99ea){_0x4f5513=_0x5b99ea;if(!_[_0x4d39('0x28')](_0x3040c2)){return getUser(_0x5c3981,_0x3040c2[_0x4d39('0xd')],_0x4f5513);}else{return getUser(_0x5c3981,null,_0x4f5513);}})[_0x4d39('0x2c')](function(_0x467c05){_0x13d757=_0x467c05;logger[_0x4d39('0xc')](_0x4d39('0x5b'),_0x13d757['id']);return getEndUser(_0x5c3981,_0x593953[_0x4d39('0x74')],_0x593953['calleridnum'],_0x4f5513);})['then'](function(_0x65c329){_0x415047=_0x65c329;logger['info']('The\x20Enduser\x20ID\x20is:',_0x415047['id']);return getTicket(_0x5c3981,_0x13d757,_0x415047,_0x1de7b8,_0x593953,_0x1de7b8['Fields'],_0x4f5513,'Inbound');})[_0x4d39('0x2c')](function(_0x379311){_0x559c23=_0x379311;logger[_0x4d39('0xc')](_0x4d39('0x5e'));logger[_0x4d39('0xc')](_0x4d39('0x5f'),_0x559c23['id']);return setRelationship(_0x4f5513,_0x13d757,_0x559c23,'users');})[_0x4d39('0x2c')](function(){return setRelationship(_0x4f5513,_0x415047,_0x559c23,_0x4d39('0x61'));})[_0x4d39('0x2c')](function(){return getServerInfo(_0x4f5513);})[_0x4d39('0x69')](function(_0x3a061d){logger['error']('['+_0x593953[_0x4d39('0x73')]['toUpperCase']()+']',JSON[_0x4d39('0x20')](_0x3a061d));});}; \ No newline at end of file +var _0x6a1d=['first_name','','Caller\x20-\x20%s','Enduser\x20created.','debug','[HTTP]','map','type','nameField','toLowerCase','content','string','customField','custom_fields','Variable','login','username','password','xCALLY\x20Motion\x20integration','Account\x20%d\x20is\x20not\x20valid','set_relationship','remoteUri','stripTrailingSlash','serverUrl','uri','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridname','The\x20Enduser\x20ID\x20is:','Fields','users','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','catch','error','outbound','%s/service/v4_1/rest.php','recordingFormat','none','[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridname','Outbound','The\x20Ticket\x20ID\x20is:','contacts','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','unmanaged','toUpperCase','Recording\x20is\x20enabled!','Inbound','Ticket\x20created!','lastevent','request-promise','bluebird','md5','util','./util','../../../../config/environment','../../../../config/logger','redis','localhost','socket.io-emitter','POST','info','Subjects','assigned_user_id','description','getString','Descriptions','date_start','toISOString','replace','duration_minutes','parent_id','parent_type','parent_name','name','direction','length','forEach','variableName','push','idField','set_entry','JSON','stringify','Calls','format','Basic\x20%s','apiKey','toString','get_server_info','isNil','Getting\x20agent\x20with\x20name','get_entry_list','Employees','user_name','then','entry_list','find','name_value_list','value','Agent\x20found!','resolve','user_id','Searching\x20enduser\x20with\x20phone','Contacts','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!'];(function(_0x45b5db,_0x4cc3){var _0x32fa2f=function(_0x534e48){while(--_0x534e48){_0x45b5db['push'](_0x45b5db['shift']());}};_0x32fa2f(++_0x4cc3);}(_0x6a1d,0x124));var _0xd6a1=function(_0x1d9aa0,_0x272488){_0x1d9aa0=_0x1d9aa0-0x0;var _0x226868=_0x6a1d[_0x1d9aa0];return _0x226868;};'use strict';var _=require('lodash');var rp=require(_0xd6a1('0x0'));var BPromise=require(_0xd6a1('0x1'));var md5=require(_0xd6a1('0x2'));var util=require(_0xd6a1('0x3'));var Redis=require('ioredis');var intUtil=require(_0xd6a1('0x4'));var config=require(_0xd6a1('0x5'));var logger=require(_0xd6a1('0x6'))('sugarcrm');config[_0xd6a1('0x7')]=_['defaults'](config['redis'],{'host':_0xd6a1('0x8'),'port':0x18eb});var io=require(_0xd6a1('0x9'))(new Redis(config[_0xd6a1('0x7')]));var def={'method':_0xd6a1('0xa'),'json':!![]};function emit(_0x1715a4,_0x39c441,_0x2b5bfc){io['to'](_0x1715a4)['emit'](_0x39c441,_0x2b5bfc);}function getTicket(_0x3dc519,_0x35c2bc,_0x5e54e2,_0x5c7efe,_0x42a67d,_0x28a284,_0x539b3c,_0x575846){logger[_0xd6a1('0xb')]('Creating\x20new\x20ticket...');var _0x3c2d58=new Date();var _0x3cf24f=[{'name':'name','value':intUtil['getString'](_0x5c7efe[_0xd6a1('0xc')],_0x42a67d,'\x20')},{'name':_0xd6a1('0xd'),'value':_0x35c2bc['id']},{'name':'created_by','value':_0x35c2bc['id']},{'name':_0xd6a1('0xe'),'value':intUtil[_0xd6a1('0xf')](_0x5c7efe[_0xd6a1('0x10')],_0x42a67d,'\x0a')},{'name':_0xd6a1('0x11'),'value':_0x3c2d58[_0xd6a1('0x12')]()['slice'](0x0,0x13)[_0xd6a1('0x13')]('T','\x20')},{'name':'duration_hours','value':'0'},{'name':_0xd6a1('0x14'),'value':'15'},{'name':_0xd6a1('0x15'),'value':_0x5e54e2['id']},{'name':_0xd6a1('0x16'),'value':'Contacts'},{'name':_0xd6a1('0x17'),'value':_0x5e54e2[_0xd6a1('0x18')]},{'name':_0xd6a1('0x19'),'value':_0x575846}];if(_0x28a284[_0xd6a1('0x1a')]){_[_0xd6a1('0x1b')](_0x28a284,function(_0x322837){if(_0x42a67d[_0x322837[_0xd6a1('0x1c')]]){_0x3cf24f[_0xd6a1('0x1d')]({'name':_0x322837[_0xd6a1('0x1e')],'value':_0x42a67d[_0x322837[_0xd6a1('0x1c')]]});}});}return request({'form':{'method':_0xd6a1('0x1f'),'input_type':_0xd6a1('0x20'),'response_type':'JSON','rest_data':JSON[_0xd6a1('0x21')]({'session':_0x539b3c['id'],'module_name':_0xd6a1('0x22'),'name_value_list':_0x3cf24f})}});}function getAuth(_0xd42f3d){return util[_0xd6a1('0x23')](_0xd6a1('0x24'),new Buffer(_0xd42f3d[_0xd6a1('0x25')]+':X')[_0xd6a1('0x26')]('base64'));}function getServerInfo(_0x70845b){return request({'form':{'method':_0xd6a1('0x27'),'input_type':_0xd6a1('0x20'),'response_type':'JSON','rest_data':JSON[_0xd6a1('0x21')]({'session':_0x70845b['id']})}});}function getUser(_0x74e101,_0x20f113,_0x41d638){if(!_[_0xd6a1('0x28')](_0x20f113)){logger['info'](_0xd6a1('0x29'),_0x20f113);return request({'form':{'method':_0xd6a1('0x2a'),'input_type':'JSON','response_type':_0xd6a1('0x20'),'rest_data':JSON['stringify']({'session':_0x41d638['id'],'module_name':_0xd6a1('0x2b'),'query':util[_0xd6a1('0x23')]('INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200',_0x20f113),'order_by':'','offset':'0','select_fields':['id',_0xd6a1('0x18'),_0xd6a1('0x2c')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xd6a1('0x2d')](function(_0x45ec5d){if(_0x45ec5d[_0xd6a1('0x2e')][_0xd6a1('0x1a')]){var _0x35d140=_[_0xd6a1('0x2f')](_0x45ec5d[_0xd6a1('0x2e')],function(_0x373374){return _0x373374[_0xd6a1('0x30')][_0xd6a1('0x2c')][_0xd6a1('0x31')]===_0x20f113;});if(_0x35d140){logger['info'](_0xd6a1('0x32'));return BPromise['resolve']({'id':_0x35d140[_0xd6a1('0x30')]['id'][_0xd6a1('0x31')],'name':_0x35d140[_0xd6a1('0x30')]['name']['value']});}}logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0xd6a1('0x33')]({'id':_0x41d638[_0xd6a1('0x30')][_0xd6a1('0x34')][_0xd6a1('0x31')],'name':_0x41d638[_0xd6a1('0x30')][_0xd6a1('0x2c')][_0xd6a1('0x31')]});});}else{logger[_0xd6a1('0xb')]('Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!');return BPromise[_0xd6a1('0x33')]({'id':_0x41d638[_0xd6a1('0x30')][_0xd6a1('0x34')][_0xd6a1('0x31')],'name':_0x41d638[_0xd6a1('0x30')][_0xd6a1('0x2c')][_0xd6a1('0x31')]});}}function getEndUser(_0x157dd0,_0x14c55a,_0x1123b0,_0x57a9f7){logger[_0xd6a1('0xb')](_0xd6a1('0x35'),_0x1123b0);return request({'form':{'method':_0xd6a1('0x2a'),'input_type':_0xd6a1('0x20'),'response_type':_0xd6a1('0x20'),'rest_data':JSON[_0xd6a1('0x21')]({'session':_0x57a9f7['id'],'module_name':_0xd6a1('0x36'),'query':util['format'](_0xd6a1('0x37'),_0x1123b0),'order_by':'','offset':'0','select_fields':['id',_0xd6a1('0x18'),'phone_home'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xd6a1('0x2d')](function(_0x103913){if(_0x103913[_0xd6a1('0x2e')]['length']){var _0x1743bb=_[_0xd6a1('0x2f')](_0x103913[_0xd6a1('0x2e')],function(_0x49556b){return _0x49556b['name_value_list'][_0xd6a1('0x38')]['value']===_0x1123b0;});if(_0x1743bb){logger[_0xd6a1('0xb')](_0xd6a1('0x39'));return BPromise['resolve']({'id':_0x1743bb[_0xd6a1('0x30')]['id'][_0xd6a1('0x31')],'name':_0x1743bb['name_value_list'][_0xd6a1('0x18')][_0xd6a1('0x31')],'phone':_0x1743bb[_0xd6a1('0x30')][_0xd6a1('0x38')][_0xd6a1('0x31')]});}}else{logger[_0xd6a1('0xb')](_0xd6a1('0x3a'));return request({'form':{'method':_0xd6a1('0x1f'),'input_type':'JSON','response_type':_0xd6a1('0x20'),'rest_data':JSON[_0xd6a1('0x21')]({'session':_0x57a9f7['id'],'module_name':_0xd6a1('0x36'),'name_value_list':[{'name':_0xd6a1('0x3b'),'value':_0x14c55a!==_0xd6a1('0x3c')?_0x14c55a:util[_0xd6a1('0x23')](_0xd6a1('0x3d'),_0x1123b0)},{'name':_0xd6a1('0x38'),'value':_0x1123b0}]})}})[_0xd6a1('0x2d')](function(_0x3c4d45){logger['info'](_0xd6a1('0x3e'));return BPromise['resolve']({'id':_0x3c4d45['id'],'name':_0x3c4d45[_0xd6a1('0x2e')][_0xd6a1('0x3b')][_0xd6a1('0x31')],'phone':_0x3c4d45[_0xd6a1('0x2e')]['phone_home']['value']});});}});}function request(_0x42417f){logger[_0xd6a1('0x3f')](_0xd6a1('0x40'),JSON[_0xd6a1('0x21')](_0x42417f));return rp(_['merge'](def,_0x42417f));}function getTags(_0x552c28,_0x454e02){var _0x5d463f=[];if(_0x552c28&&_0x552c28[_0xd6a1('0x1a')]>0x0){_0x5d463f=_[_0xd6a1('0x41')](_0x552c28,_0x454e02);}return _0x5d463f;}function getCustomFields(_0x4f30ec,_0x59e801){var _0x403177=[];var _0x293de4={'custom_fields':[]};if(_0x4f30ec[_0xd6a1('0x1a')]>0x0){_[_0xd6a1('0x1b')](_0x4f30ec,function(_0x173b7b){if(_0x173b7b[_0xd6a1('0x42')]==='string'&&_0x173b7b[_0xd6a1('0x43')]&&!_0x173b7b['customField']){_0x293de4[_0x173b7b[_0xd6a1('0x43')][_0xd6a1('0x44')]()]=_0x173b7b[_0xd6a1('0x45')][_0xd6a1('0x26')]();}else if(_0x173b7b['type']===_0xd6a1('0x46')&&_0x173b7b[_0xd6a1('0x1e')]&&_0x173b7b[_0xd6a1('0x47')]){_0x293de4[_0xd6a1('0x48')][_0xd6a1('0x1d')]({'id':_0x173b7b['idField'],'value':_0x173b7b[_0xd6a1('0x45')][_0xd6a1('0x26')]()});}else if(_0x173b7b['type']==='variable'&&_0x173b7b[_0xd6a1('0x1c')]&&_0x173b7b[_0xd6a1('0x1e')]&&_0x173b7b[_0xd6a1('0x47')]){_0x59e801[_0x173b7b[_0xd6a1('0x1c')]]&&_0x293de4[_0xd6a1('0x48')]['push']({'id':_0x173b7b[_0xd6a1('0x1e')],'value':_0x59e801[_0x173b7b[_0xd6a1('0x1c')]][_0xd6a1('0x26')]()});}else if(_0x173b7b['type']==='customVariable'&&_0x173b7b[_0xd6a1('0x49')]&&_0x173b7b[_0xd6a1('0x49')][_0xd6a1('0x18')]&&_0x173b7b[_0xd6a1('0x1e')]&&_0x173b7b[_0xd6a1('0x47')]){_0x59e801[_0x173b7b[_0xd6a1('0x49')][_0xd6a1('0x18')][_0xd6a1('0x44')]()]&&_0x293de4[_0xd6a1('0x48')][_0xd6a1('0x1d')]({'id':_0x173b7b[_0xd6a1('0x1e')],'value':_0x59e801[_0x173b7b['Variable'][_0xd6a1('0x18')][_0xd6a1('0x44')]()][_0xd6a1('0x26')]()});}});}return _0x293de4;}function getConnection(_0x17b59b){return request({'method':_0xd6a1('0xa'),'form':{'method':_0xd6a1('0x4a'),'input_type':_0xd6a1('0x20'),'response_type':_0xd6a1('0x20'),'rest_data':JSON[_0xd6a1('0x21')]({'user_auth':{'user_name':_0x17b59b[_0xd6a1('0x4b')],'password':_0x17b59b[_0xd6a1('0x4c')],'encryption':'PLAIN'},'application':_0xd6a1('0x4d')})}})[_0xd6a1('0x2d')](function(_0x5a669f){var _0x59c559=_0x5a669f;if(_0x59c559['id']){def['sessionID']=_0x59c559['id'];return BPromise[_0xd6a1('0x33')](_0x59c559);}else{throw new Error(util[_0xd6a1('0x23')](_0xd6a1('0x4e'),_0x17b59b['id']));}});}function setRelationship(_0x4d154a,_0x5dd2ef,_0x58f627,_0x548cd){return request({'form':{'method':_0xd6a1('0x4f'),'input_type':_0xd6a1('0x20'),'response_type':_0xd6a1('0x20'),'rest_data':JSON['stringify']({'session':_0x4d154a['id'],'module_name':_0xd6a1('0x22'),'module_id':_0x58f627['id'],'link_field_name':_0x548cd,'related_ids':[_0x5dd2ef['id']],'name_value_list':[],'delete':0x0})}});}exports['queue']=function(_0x318d9c,_0x131a55,_0x305b2f,_0x8be134,_0x31af67,_0x17ff11){var _0x3b2007,_0x4f2bb2,_0xcf2ad3,_0x2ee441;_0x17ff11[_0xd6a1('0x50')]=intUtil['stripTrailingSlash'](_0x17ff11[_0xd6a1('0x50')]);_0x17ff11['serverUrl']=intUtil[_0xd6a1('0x51')](_0x17ff11[_0xd6a1('0x52')]);def[_0xd6a1('0x53')]=util[_0xd6a1('0x23')]('%s/service/v4_1/rest.php',_0x17ff11[_0xd6a1('0x50')]);if(_0x31af67&&_0x31af67[_0xd6a1('0x54')]){logger[_0xd6a1('0xb')](_0xd6a1('0x55'),'Recording\x20is\x20enabled!');_0x131a55[_0xd6a1('0x56')]=util[_0xd6a1('0x23')](_0xd6a1('0x57'),_0x17ff11[_0xd6a1('0x52')],_0x131a55[_0xd6a1('0x58')],md5(_0x131a55[_0xd6a1('0x58')]));}else{_0x131a55[_0xd6a1('0x56')]='';}return getConnection(_0x17ff11)['then'](function(_0xf06eb2){_0x2ee441=_0xf06eb2;return getUser(_0x17ff11,_0x8be134['name'],_0x2ee441);})['then'](function(_0x46f141){_0x3b2007=_0x46f141;logger[_0xd6a1('0xb')]('The\x20User\x20ID\x20is:',_0x3b2007['id']);return getEndUser(_0x17ff11,_0x131a55[_0xd6a1('0x59')],_0x131a55['calleridnum'],_0x2ee441);})[_0xd6a1('0x2d')](function(_0x35e2f0){_0x4f2bb2=_0x35e2f0;logger['info'](_0xd6a1('0x5a'),_0x4f2bb2['id']);return getTicket(_0x17ff11,_0x3b2007,_0x4f2bb2,_0x305b2f,_0x131a55,_0x305b2f[_0xd6a1('0x5b')],_0x2ee441,'Inbound');})[_0xd6a1('0x2d')](function(_0x167626){_0xcf2ad3=_0x167626;logger[_0xd6a1('0xb')]('Ticket\x20created!');logger[_0xd6a1('0xb')]('The\x20Ticket\x20ID\x20is:',_0xcf2ad3['id']);return setRelationship(_0x2ee441,_0x3b2007,_0xcf2ad3,_0xd6a1('0x5c'));})['then'](function(){return setRelationship(_0x2ee441,_0x4f2bb2,_0xcf2ad3,'contacts');})['then'](function(){return getServerInfo(_0x2ee441);})[_0xd6a1('0x2d')](function(_0x243ae4){var _0x43300e=parseInt(_0x243ae4['version'][_0xd6a1('0x5d')](0x0));var _0x11232b=util[_0xd6a1('0x23')](_0xd6a1('0x5e'),_0x17ff11[_0xd6a1('0x50')],_0xcf2ad3['id']);if(_0x43300e>0x6){_0x11232b=util[_0xd6a1('0x23')](_0xd6a1('0x5f'),_0x17ff11[_0xd6a1('0x50')],_0xcf2ad3['id']);}logger[_0xd6a1('0xb')](_0xd6a1('0x55'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format']('user:%s',_0x8be134[_0xd6a1('0x18')]),'trigger:browser:url',{'uri':_0x11232b});})[_0xd6a1('0x60')](function(_0x58b3a7){logger[_0xd6a1('0x61')](_0xd6a1('0x55'),JSON['stringify'](_0x58b3a7));});};exports[_0xd6a1('0x62')]=function(_0x41dfe9,_0x2fec9a,_0x1aa9cb,_0x28ccba,_0x4e7f67,_0x234ecc,_0xe2a55e){var _0x522d3a,_0x2d4d98,_0x2672ba,_0x2dd8e8;_0x234ecc[_0xd6a1('0x50')]=intUtil[_0xd6a1('0x51')](_0x234ecc[_0xd6a1('0x50')]);_0x234ecc[_0xd6a1('0x52')]=intUtil['stripTrailingSlash'](_0x234ecc['serverUrl']);def[_0xd6a1('0x53')]=util[_0xd6a1('0x23')](_0xd6a1('0x63'),_0x234ecc[_0xd6a1('0x50')]);if(_0xe2a55e&&_0xe2a55e[_0xd6a1('0x64')]&&_0xe2a55e[_0xd6a1('0x64')]!==_0xd6a1('0x65')){logger['info'](_0xd6a1('0x66'),'Recording\x20is\x20enabled!');_0x2fec9a['recordingURL']=util[_0xd6a1('0x23')](_0xd6a1('0x57'),_0x234ecc['serverUrl'],_0x2fec9a[_0xd6a1('0x58')],md5(_0x2fec9a['uniqueid']));}return getConnection(_0x234ecc)[_0xd6a1('0x2d')](function(_0x2ac350){_0x2dd8e8=_0x2ac350;return getUser(_0x234ecc,_0x28ccba[_0xd6a1('0x18')],_0x2dd8e8);})['then'](function(_0x3ae55e){_0x522d3a=_0x3ae55e;logger[_0xd6a1('0xb')](_0xd6a1('0x67'),_0x522d3a['id']);return getEndUser(_0x234ecc,_0x2fec9a[_0xd6a1('0x68')],_0x2fec9a['destcalleridnum'],_0x2dd8e8);})[_0xd6a1('0x2d')](function(_0x23946e){_0x2d4d98=_0x23946e;logger['info'](_0xd6a1('0x5a'),_0x2d4d98['id']);return getTicket(_0x234ecc,_0x522d3a,_0x2d4d98,_0x1aa9cb,_0x2fec9a,_0x1aa9cb[_0xd6a1('0x5b')],_0x2dd8e8,_0xd6a1('0x69'));})[_0xd6a1('0x2d')](function(_0x15f3d3){_0x2672ba=_0x15f3d3;logger[_0xd6a1('0xb')]('Ticket\x20created!');logger[_0xd6a1('0xb')](_0xd6a1('0x6a'),_0x2672ba['id']);return setRelationship(_0x2dd8e8,_0x522d3a,_0x2672ba,_0xd6a1('0x5c'));})[_0xd6a1('0x2d')](function(){return setRelationship(_0x2dd8e8,_0x2d4d98,_0x2672ba,_0xd6a1('0x6b'));})[_0xd6a1('0x2d')](function(){return getServerInfo(_0x2dd8e8);})[_0xd6a1('0x2d')](function(_0x238f8b){var _0x2930ee=parseInt(_0x238f8b['version'][_0xd6a1('0x5d')](0x0));var _0x5c9f28=util[_0xd6a1('0x23')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x234ecc[_0xd6a1('0x50')],_0x2672ba['id']);if(_0x2930ee>0x6){_0x5c9f28=util[_0xd6a1('0x23')](_0xd6a1('0x5f'),_0x234ecc['remoteUri'],_0x2672ba['id']);}logger[_0xd6a1('0xb')](_0xd6a1('0x66'),_0xd6a1('0x6c'));emit(util[_0xd6a1('0x23')](_0xd6a1('0x6d'),_0x28ccba[_0xd6a1('0x18')]),_0xd6a1('0x6e'),{'uri':_0x5c9f28});})[_0xd6a1('0x60')](function(_0x17225e){logger['error'](_0xd6a1('0x66'),JSON[_0xd6a1('0x21')](_0x17225e));});};exports[_0xd6a1('0x6f')]=function(_0x3206ff,_0x51bd22,_0x47b7d5,_0x37088a,_0x1ee4e4,_0xf7f680){var _0x57fb7e,_0x285a9e,_0x54efa5,_0x45147c;_0xf7f680[_0xd6a1('0x50')]=intUtil[_0xd6a1('0x51')](_0xf7f680['remoteUri']);_0xf7f680['serverUrl']=intUtil[_0xd6a1('0x51')](_0xf7f680[_0xd6a1('0x52')]);def[_0xd6a1('0x53')]=util[_0xd6a1('0x23')](_0xd6a1('0x63'),_0xf7f680[_0xd6a1('0x50')]);if(_0x1ee4e4&&_0x1ee4e4[_0xd6a1('0x54')]){logger[_0xd6a1('0xb')]('['+_0x51bd22['lastevent'][_0xd6a1('0x70')]()+']',_0xd6a1('0x71'));_0x51bd22[_0xd6a1('0x56')]=util[_0xd6a1('0x23')](_0xd6a1('0x57'),_0xf7f680[_0xd6a1('0x52')],_0x51bd22[_0xd6a1('0x58')],md5(_0x51bd22['uniqueid']));}else{_0x51bd22[_0xd6a1('0x56')]='';}return getConnection(_0xf7f680)[_0xd6a1('0x2d')](function(_0x591a19){_0x45147c=_0x591a19;if(!_[_0xd6a1('0x28')](_0x37088a)){return getUser(_0xf7f680,_0x37088a[_0xd6a1('0x18')],_0x45147c);}else{return getUser(_0xf7f680,null,_0x45147c);}})['then'](function(_0x5f2e16){_0x57fb7e=_0x5f2e16;logger[_0xd6a1('0xb')](_0xd6a1('0x67'),_0x57fb7e['id']);return getEndUser(_0xf7f680,_0x51bd22[_0xd6a1('0x59')],_0x51bd22['calleridnum'],_0x45147c);})['then'](function(_0x5b13be){_0x285a9e=_0x5b13be;logger['info'](_0xd6a1('0x5a'),_0x285a9e['id']);return getTicket(_0xf7f680,_0x57fb7e,_0x285a9e,_0x47b7d5,_0x51bd22,_0x47b7d5[_0xd6a1('0x5b')],_0x45147c,_0xd6a1('0x72'));})[_0xd6a1('0x2d')](function(_0xf710a5){_0x54efa5=_0xf710a5;logger[_0xd6a1('0xb')](_0xd6a1('0x73'));logger[_0xd6a1('0xb')](_0xd6a1('0x6a'),_0x54efa5['id']);return setRelationship(_0x45147c,_0x57fb7e,_0x54efa5,_0xd6a1('0x5c'));})[_0xd6a1('0x2d')](function(){return setRelationship(_0x45147c,_0x285a9e,_0x54efa5,_0xd6a1('0x6b'));})[_0xd6a1('0x2d')](function(){return getServerInfo(_0x45147c);})[_0xd6a1('0x60')](function(_0x425db7){logger[_0xd6a1('0x61')]('['+_0x51bd22[_0xd6a1('0x74')]['toUpperCase']()+']',JSON[_0xd6a1('0x21')](_0x425db7));});}; \ 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 72670d8..8399735 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 _0xbbb7=['type','push','content','variable','variableName','toString','customVariable','Variable','name','toLowerCase','keyValue','keyType','string','format','%s:\x20%s','key','keyContent','slice','substring','lastIndexOf','isNil','test','util','sortBy','length'];(function(_0x50b409,_0x4ec514){var _0x4e487c=function(_0x5a06de){while(--_0x5a06de){_0x50b409['push'](_0x50b409['shift']());}};_0x4e487c(++_0x4ec514);}(_0xbbb7,0x1a6));var _0x7bbb=function(_0x1c33db,_0xf3ce5c){_0x1c33db=_0x1c33db-0x0;var _0x2173d2=_0xbbb7[_0x1c33db];return _0x2173d2;};'use strict';var _=require('lodash');var util=require(_0x7bbb('0x0'));exports['getString']=function(_0x1ac68a,_0x579f89,_0x4be6b6){var _0x57eb87=[];if(_0x1ac68a['length']>0x0){var _0x57b99c=_[_0x7bbb('0x1')](_0x1ac68a,['id']);for(var _0x36162b=0x0;_0x36162b<_0x57b99c[_0x7bbb('0x2')];_0x36162b++){var _0x405adb=_0x57b99c[_0x36162b];if(_0x405adb[_0x7bbb('0x3')]==='string'){_0x57eb87[_0x7bbb('0x4')](_0x405adb[_0x7bbb('0x5')]);}else if(_0x405adb['type']===_0x7bbb('0x6')&&_0x405adb['variableName']){_0x579f89[_0x405adb[_0x7bbb('0x7')]]&&_0x57eb87['push'](_0x579f89[_0x405adb['variableName']][_0x7bbb('0x8')]());}else if(_0x405adb[_0x7bbb('0x3')]===_0x7bbb('0x9')&&_0x405adb[_0x7bbb('0xa')]&&_0x405adb[_0x7bbb('0xa')][_0x7bbb('0xb')]){_0x579f89[_0x405adb[_0x7bbb('0xa')][_0x7bbb('0xb')][_0x7bbb('0xc')]()]&&_0x57eb87[_0x7bbb('0x4')](_0x579f89[_0x405adb[_0x7bbb('0xa')][_0x7bbb('0xb')][_0x7bbb('0xc')]()][_0x7bbb('0x8')]());}else if(_0x405adb['type']===_0x7bbb('0xd')){if(_0x405adb[_0x7bbb('0xe')]===_0x7bbb('0xf')&&_0x405adb['key']){_0x57eb87[_0x7bbb('0x4')](util[_0x7bbb('0x10')](_0x7bbb('0x11'),_0x405adb[_0x7bbb('0x12')],_0x405adb[_0x7bbb('0x13')]));}else if(_0x405adb[_0x7bbb('0xe')]==='variable'&&_0x405adb[_0x7bbb('0x7')]&&_0x405adb[_0x7bbb('0x12')]){_0x579f89[_0x405adb[_0x7bbb('0x7')]]&&_0x57eb87[_0x7bbb('0x4')](util[_0x7bbb('0x10')](_0x7bbb('0x11'),_0x405adb[_0x7bbb('0x12')],_0x579f89[_0x405adb[_0x7bbb('0x7')]]));}else if(_0x405adb[_0x7bbb('0xe')]==='customVariable'&&_0x405adb['Variable']&&_0x405adb[_0x7bbb('0xa')][_0x7bbb('0xb')]&&_0x405adb[_0x7bbb('0x12')]){_0x579f89[_0x405adb[_0x7bbb('0xa')]['name'][_0x7bbb('0xc')]()]&&_0x57eb87[_0x7bbb('0x4')](util[_0x7bbb('0x10')]('%s:\x20%s',_0x405adb[_0x7bbb('0x12')],_0x579f89[_0x405adb[_0x7bbb('0xa')]['name'][_0x7bbb('0xc')]()]));}}}}return _0x57eb87['join'](_0x4be6b6);};exports['stripTrailingSlash']=function(_0x538169){var _0x2b5565=_0x538169[_0x7bbb('0x14')](-0x1);if(_0x2b5565==='/'){_0x538169=_0x538169[_0x7bbb('0x15')](0x0,_0x538169[_0x7bbb('0x16')](_0x2b5565));}return _0x538169;};exports['validateEmail']=function(_0x2206d0){if(!_[_0x7bbb('0x17')](_0x2206d0)&&_0x2206d0!==''){var _0x16ba75=/^(([^<>()\[\]\\.,;:\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 _0x16ba75[_0x7bbb('0x18')](String(_0x2206d0)[_0x7bbb('0xc')]());}else{return![];}}; \ No newline at end of file +var _0xcddd=['lodash','getString','length','sortBy','type','string','push','content','variable','variableName','customVariable','Variable','name','toLowerCase','toString','key','format','%s:\x20%s','keyContent','keyType','join','stripTrailingSlash','slice','substring','lastIndexOf','validateEmail','isNil'];(function(_0x1ca907,_0x318ca2){var _0x4eb2c1=function(_0x1c0de3){while(--_0x1c0de3){_0x1ca907['push'](_0x1ca907['shift']());}};_0x4eb2c1(++_0x318ca2);}(_0xcddd,0x1cb));var _0xdcdd=function(_0x50b65e,_0x482f28){_0x50b65e=_0x50b65e-0x0;var _0x5bb365=_0xcddd[_0x50b65e];return _0x5bb365;};'use strict';var _=require(_0xdcdd('0x0'));var util=require('util');exports[_0xdcdd('0x1')]=function(_0x301579,_0x44cfa7,_0x353faa){var _0x3723b7=[];if(_0x301579[_0xdcdd('0x2')]>0x0){var _0x23d9f6=_[_0xdcdd('0x3')](_0x301579,['id']);for(var _0x19c1ea=0x0;_0x19c1ea<_0x23d9f6[_0xdcdd('0x2')];_0x19c1ea++){var _0x549aa4=_0x23d9f6[_0x19c1ea];if(_0x549aa4[_0xdcdd('0x4')]===_0xdcdd('0x5')){_0x3723b7[_0xdcdd('0x6')](_0x549aa4[_0xdcdd('0x7')]);}else if(_0x549aa4[_0xdcdd('0x4')]===_0xdcdd('0x8')&&_0x549aa4[_0xdcdd('0x9')]){_0x44cfa7[_0x549aa4[_0xdcdd('0x9')]]&&_0x3723b7[_0xdcdd('0x6')](_0x44cfa7[_0x549aa4[_0xdcdd('0x9')]]['toString']());}else if(_0x549aa4['type']===_0xdcdd('0xa')&&_0x549aa4[_0xdcdd('0xb')]&&_0x549aa4['Variable']['name']){_0x44cfa7[_0x549aa4[_0xdcdd('0xb')][_0xdcdd('0xc')][_0xdcdd('0xd')]()]&&_0x3723b7[_0xdcdd('0x6')](_0x44cfa7[_0x549aa4[_0xdcdd('0xb')][_0xdcdd('0xc')][_0xdcdd('0xd')]()][_0xdcdd('0xe')]());}else if(_0x549aa4[_0xdcdd('0x4')]==='keyValue'){if(_0x549aa4['keyType']==='string'&&_0x549aa4[_0xdcdd('0xf')]){_0x3723b7[_0xdcdd('0x6')](util[_0xdcdd('0x10')](_0xdcdd('0x11'),_0x549aa4[_0xdcdd('0xf')],_0x549aa4[_0xdcdd('0x12')]));}else if(_0x549aa4[_0xdcdd('0x13')]===_0xdcdd('0x8')&&_0x549aa4[_0xdcdd('0x9')]&&_0x549aa4[_0xdcdd('0xf')]){_0x44cfa7[_0x549aa4['variableName']]&&_0x3723b7[_0xdcdd('0x6')](util['format']('%s:\x20%s',_0x549aa4[_0xdcdd('0xf')],_0x44cfa7[_0x549aa4[_0xdcdd('0x9')]]));}else if(_0x549aa4[_0xdcdd('0x13')]===_0xdcdd('0xa')&&_0x549aa4[_0xdcdd('0xb')]&&_0x549aa4[_0xdcdd('0xb')][_0xdcdd('0xc')]&&_0x549aa4['key']){_0x44cfa7[_0x549aa4[_0xdcdd('0xb')]['name'][_0xdcdd('0xd')]()]&&_0x3723b7['push'](util['format'](_0xdcdd('0x11'),_0x549aa4[_0xdcdd('0xf')],_0x44cfa7[_0x549aa4[_0xdcdd('0xb')][_0xdcdd('0xc')][_0xdcdd('0xd')]()]));}}}}return _0x3723b7[_0xdcdd('0x14')](_0x353faa);};exports[_0xdcdd('0x15')]=function(_0x15068d){var _0x381e16=_0x15068d[_0xdcdd('0x16')](-0x1);if(_0x381e16==='/'){_0x15068d=_0x15068d[_0xdcdd('0x17')](0x0,_0x15068d[_0xdcdd('0x18')](_0x381e16));}return _0x15068d;};exports[_0xdcdd('0x19')]=function(_0x22984f){if(!_[_0xdcdd('0x1a')](_0x22984f)&&_0x22984f!==''){var _0x3e3ae3=/^(([^<>()\[\]\\.,;:\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 _0x3e3ae3['test'](String(_0x22984f)['toLowerCase']());}else{return![];}}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/vtiger.js b/server/services/ami/trigger/integration/vtiger.js index 505371b..1b1496a 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 _0x34e8=['redis','defaults','localhost','emit','length','forEach','includes','string','picklist','type','idField','toString','variableName','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','getString','Subjects','POST','format','remoteUri','create','sessionName','HelpDesk','stringify','success','error','catch','statusCode','Getting\x20agent\x20with\x20email','GET','%s/webservice.php','query','username','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','result','Agent\x20found!','resolve','email1','first_name','last_name','userId','[vTiger],\x20%s,\x20%s,\x20%s','getUser','admin','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','phone','getEndUser','accessKey','getchallenge','then','login','token','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','recordingURL','email','The\x20User\x20ID\x20is:','calleridnum','Fields','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','outbound','stripTrailingSlash','recordingFormat','none','[OUTBOUND]','uniqueid','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','split','unmanaged','lastevent','toUpperCase','calleridname','lodash','request-promise','bluebird','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','vTiger'];(function(_0xf8dd36,_0x46941f){var _0x2337d3=function(_0x4b1f0d){while(--_0x4b1f0d){_0xf8dd36['push'](_0xf8dd36['shift']());}};_0x2337d3(++_0x46941f);}(_0x34e8,0x12c));var _0x834e=function(_0x1d62f1,_0x216a2e){_0x1d62f1=_0x1d62f1-0x0;var _0x5017bc=_0x34e8[_0x1d62f1];return _0x5017bc;};'use strict';var _=require(_0x834e('0x0'));var rp=require(_0x834e('0x1'));var BPromise=require(_0x834e('0x2'));var md5=require(_0x834e('0x3'));var util=require('util');var Redis=require(_0x834e('0x4'));var intUtil=require(_0x834e('0x5'));var config=require(_0x834e('0x6'));var logger=require(_0x834e('0x7'))(_0x834e('0x8'));config[_0x834e('0x9')]=_[_0x834e('0xa')](config['redis'],{'host':_0x834e('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x834e('0x9')]));function emit(_0x3cc2e3,_0x3a3ef6,_0x2e69e2){io['to'](_0x3cc2e3)[_0x834e('0xc')](_0x3a3ef6,_0x2e69e2);}function getCustomFields(_0x23501c,_0x363786){var _0x1af45a={};if(_0x23501c[_0x834e('0xd')]>0x0){_[_0x834e('0xe')](_0x23501c,function(_0x1e41fe){if(_[_0x834e('0xf')]([_0x834e('0x10'),_0x834e('0x11')],_0x1e41fe[_0x834e('0x12')])&&_0x1e41fe[_0x834e('0x13')]){_0x1af45a[_0x1e41fe[_0x834e('0x13')]]=_0x1e41fe['content'][_0x834e('0x14')]();}else if(_0x1e41fe[_0x834e('0x12')]==='variable'&&_0x1e41fe[_0x834e('0x15')]&&_0x1e41fe[_0x834e('0x13')]&&_0x363786[_0x1e41fe[_0x834e('0x15')]]){_0x1af45a[_0x1e41fe[_0x834e('0x13')]]=_0x363786[_0x1e41fe['variableName']][_0x834e('0x14')]();}else if(_0x1e41fe[_0x834e('0x12')]==='customVariable'&&_0x1e41fe[_0x834e('0x16')]&&_0x1e41fe['Variable'][_0x834e('0x17')]&&_0x1e41fe[_0x834e('0x13')]&&_0x363786[_0x1e41fe['Variable'][_0x834e('0x17')][_0x834e('0x18')]()]){_0x1af45a[_0x1e41fe[_0x834e('0x13')]]=_0x363786[_0x1e41fe['Variable'][_0x834e('0x17')][_0x834e('0x18')]()][_0x834e('0x14')]();}});}return _0x1af45a;}function createTicket(_0xb993a1,_0x237947,_0x254677,_0x1dd214,_0x595515,_0x2545b4,_0x1fd2c6){logger[_0x834e('0x19')](_0x834e('0x1a'));var _0x4ab05d=_[_0x834e('0x1b')]({'parent_id':'','assigned_user_id':_0x237947['id'],'ticketpriorities':_0x834e('0x1c'),'ticketstatus':'Open','ticket_title':intUtil[_0x834e('0x1d')](_0x1dd214[_0x834e('0x1e')],_0x595515,'\x20'),'description':intUtil[_0x834e('0x1d')](_0x1dd214['Descriptions'],_0x595515,'\x0a'),'contact_id':_0x254677['id']},getCustomFields(_0x2545b4,_0x595515));var _0x4e3f48={'method':_0x834e('0x1f'),'uri':util[_0x834e('0x20')]('%s/webservice.php',_0xb993a1[_0x834e('0x21')]),'form':{'operation':_0x834e('0x22'),'username':_0xb993a1['username'],'sessionName':_0x1fd2c6[_0x834e('0x23')],'elementType':_0x834e('0x24'),'element':JSON[_0x834e('0x25')](_0x4ab05d)},'json':!![]};return request(_0x4e3f48)['then'](function(_0x24fcf7){if(_0x24fcf7[_0x834e('0x26')]){return BPromise['resolve']({'id':_0x24fcf7['result']['id']});}else{throw new Error(util[_0x834e('0x20')]('Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s',JSON[_0x834e('0x25')](_0x24fcf7[_0x834e('0x27')])));}})[_0x834e('0x28')](function(_0x2cc2eb){var _0x3cd928=_0x2cc2eb[_0x834e('0x29')]||0x1f4;logger['error']('[vTiger],\x20%s,\x20%s,\x20%s','createTicket',_0x3cd928,JSON['stringify'](_0x2cc2eb));});}function getUser(_0x2c7a8d,_0x567cea,_0x106d6a){if(intUtil['validateEmail'](_0x567cea)){logger[_0x834e('0x19')](_0x834e('0x2a'),_0x567cea);return request({'method':_0x834e('0x2b'),'uri':util[_0x834e('0x20')](_0x834e('0x2c'),_0x2c7a8d[_0x834e('0x21')]),'qs':{'operation':_0x834e('0x2d'),'username':_0x2c7a8d[_0x834e('0x2e')],'sessionName':_0x106d6a[_0x834e('0x23')],'query':util['format'](_0x834e('0x2f'),_0x567cea)},'json':!![]})['then'](function(_0x2c75c2){if(_0x2c75c2[_0x834e('0x26')]&&_0x2c75c2[_0x834e('0x30')][_0x834e('0xd')]){logger[_0x834e('0x19')](_0x834e('0x31'));return BPromise[_0x834e('0x32')]({'id':_0x2c75c2[_0x834e('0x30')][0x0]['id'],'email':_0x2c75c2[_0x834e('0x30')][0x0][_0x834e('0x33')],'name':_0x2c75c2['result'][0x0][_0x834e('0x34')]+'\x20'+_0x2c75c2[_0x834e('0x30')][_0x834e('0x35')]});}else{logger[_0x834e('0x19')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x834e('0x32')]({'id':_0x106d6a[_0x834e('0x36')],'email':_0x2c7a8d['username'],'name':'admin'});}})['catch'](function(_0x3e58fa){var _0x41bf4d=_0x3e58fa[_0x834e('0x29')]||0x1f4;logger[_0x834e('0x27')](_0x834e('0x37'),_0x834e('0x38'),_0x41bf4d,JSON['stringify'](_0x3e58fa));});}else{logger[_0x834e('0x19')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x834e('0x32')]({'id':_0x106d6a[_0x834e('0x36')],'email':_0x2c7a8d['username'],'name':_0x834e('0x39')})[_0x834e('0x28')](function(_0x491c28){var _0x481f70=_0x491c28[_0x834e('0x29')]||0x1f4;logger[_0x834e('0x27')](_0x834e('0x37'),_0x834e('0x38'),_0x481f70,JSON[_0x834e('0x25')](_0x491c28));});}}function getEndUser(_0x4ca43c,_0x1c5ed6,_0x548d1d,_0x50c243){logger[_0x834e('0x19')]('Searching\x20end\x20user\x20with\x20phone',_0x548d1d);return request({'method':_0x834e('0x2b'),'uri':util[_0x834e('0x20')](_0x834e('0x2c'),_0x4ca43c[_0x834e('0x21')]),'qs':{'operation':_0x834e('0x2d'),'username':_0x4ca43c['username'],'sessionName':_0x50c243[_0x834e('0x23')],'query':util[_0x834e('0x20')](_0x834e('0x3a'),_0x548d1d,_0x548d1d,_0x548d1d,_0x548d1d,_0x548d1d)},'json':!![]})['then'](function(_0x35380e){if(_0x35380e[_0x834e('0x26')]&&_0x35380e['result'][_0x834e('0xd')]){logger['info'](_0x834e('0x3b'));return BPromise[_0x834e('0x32')]({'id':_0x35380e['result'][0x0]['id'],'name':_0x35380e['result'][0x0][_0x834e('0x3c')]+'\x20'+_0x35380e[_0x834e('0x30')][0x0][_0x834e('0x3d')],'phone':_0x548d1d});}else{logger[_0x834e('0x19')](_0x834e('0x3e'));return request({'method':_0x834e('0x1f'),'uri':util[_0x834e('0x20')]('%s/webservice.php',_0x4ca43c[_0x834e('0x21')]),'form':{'operation':'create','sessionName':_0x50c243[_0x834e('0x23')],'elementType':'Contacts','element':JSON[_0x834e('0x25')]({'lastname':_0x1c5ed6,'phone':_0x548d1d,'assigned_user_id':'\x20'})},'json':!![]})['then'](function(_0x361f60){logger[_0x834e('0x19')]('Enduser\x20created.');return BPromise[_0x834e('0x32')]({'id':_0x361f60[_0x834e('0x30')]['id'],'name':_0x361f60[_0x834e('0x30')][_0x834e('0x3d')],'phone':_0x361f60[_0x834e('0x30')][_0x834e('0x3f')]});})[_0x834e('0x28')](function(_0x3ccd8e){var _0x5dc63b=_0x3ccd8e[_0x834e('0x29')]||0x1f4;logger['error'](_0x834e('0x37'),_0x834e('0x40'),_0x5dc63b,JSON['stringify'](_0x3ccd8e));});}});}function getConnection(_0x112306){var _0x42fd90=_0x112306[_0x834e('0x2e')];var _0x2112d5=_0x112306[_0x834e('0x41')];return request({'method':_0x834e('0x2b'),'uri':util['format']('%s/webservice.php',_0x112306[_0x834e('0x21')]),'qs':{'operation':_0x834e('0x42'),'username':_0x42fd90},'json':!![]})[_0x834e('0x43')](function(_0x40ff5a){if(_0x40ff5a[_0x834e('0x26')]){return request({'method':_0x834e('0x1f'),'uri':util[_0x834e('0x20')](_0x834e('0x2c'),_0x112306[_0x834e('0x21')]),'form':{'operation':_0x834e('0x44'),'username':_0x42fd90,'accessKey':md5(_0x40ff5a[_0x834e('0x30')][_0x834e('0x45')]+_0x2112d5)},'json':!![]});}})[_0x834e('0x43')](function(_0x1a3237){if(_0x1a3237[_0x834e('0x26')]){return BPromise[_0x834e('0x32')](_0x1a3237[_0x834e('0x30')]);}else{throw new Error(util[_0x834e('0x20')](_0x834e('0x46'),_0x112306['id']));}})[_0x834e('0x28')](function(_0x4cfacd){var _0x1cc0b8=_0x4cfacd[_0x834e('0x29')]||0x1f4;logger['error'](_0x834e('0x37'),_0x834e('0x47'),_0x1cc0b8,JSON['stringify'](_0x4cfacd));});}function request(_0x3dcca3){logger[_0x834e('0x19')](_0x834e('0x48'),JSON[_0x834e('0x25')](_0x3dcca3));return rp(_0x3dcca3);}exports[_0x834e('0x49')]=function(_0xb77aab,_0x4549ba,_0x4a8b32,_0x1ad7fe,_0x8bc6c6,_0x3e0550){var _0x363675,_0x86ad2b,_0x396bbe,_0x344b51;_0x3e0550[_0x834e('0x21')]=intUtil['stripTrailingSlash'](_0x3e0550[_0x834e('0x21')]);if(_0x8bc6c6&&_0x8bc6c6['monitor_format']){logger[_0x834e('0x19')]('[QUEUE]',_0x834e('0x4a'));_0x4549ba['recordingURL']=util['format'](_0x834e('0x4b'),_0x3e0550[_0x834e('0x4c')],_0x4549ba['uniqueid'],md5(_0x4549ba['uniqueid']));}else{_0x4549ba[_0x834e('0x4d')]='';}return getConnection(_0x3e0550)[_0x834e('0x43')](function(_0x138ed2){_0x344b51=_0x138ed2;return getUser(_0x3e0550,_0x1ad7fe[_0x834e('0x4e')],_0x344b51);})[_0x834e('0x43')](function(_0x315858){_0x363675=_0x315858;logger[_0x834e('0x19')](_0x834e('0x4f'),_0x363675['id']);return getEndUser(_0x3e0550,_0x4549ba['calleridname'],_0x4549ba[_0x834e('0x50')],_0x344b51);})[_0x834e('0x43')](function(_0x5d5ac2){_0x86ad2b=_0x5d5ac2;logger[_0x834e('0x19')]('The\x20Enduser\x20ID\x20is:',_0x86ad2b['id']);return createTicket(_0x3e0550,_0x363675,_0x86ad2b,_0x4a8b32,_0x4549ba,_0x4a8b32[_0x834e('0x51')],_0x344b51);})[_0x834e('0x43')](function(_0x5160c4){_0x396bbe=_0x5160c4;logger[_0x834e('0x19')](_0x834e('0x52'));logger[_0x834e('0x19')](_0x834e('0x53'),_0x396bbe['id']);var _0x5a2924=util[_0x834e('0x20')](_0x834e('0x54'),_0x3e0550[_0x834e('0x21')],_['split'](_0x396bbe['id'],'x')[0x1]);logger[_0x834e('0x19')](_0x834e('0x55'),_0x834e('0x56'));emit(util[_0x834e('0x20')](_0x834e('0x57'),_0x1ad7fe[_0x834e('0x17')]),_0x834e('0x58'),{'uri':_0x5a2924});})[_0x834e('0x28')](function(_0x208c21){logger[_0x834e('0x27')](_0x834e('0x55'),JSON[_0x834e('0x25')](_0x208c21));});};exports[_0x834e('0x59')]=function(_0x1659c8,_0x460a7a,_0x17b8e3,_0x297cce,_0x14ed83,_0x193a15,_0x3e3467){var _0xed4081,_0x2cb233,_0x5c83eb,_0x2145cf;_0x193a15[_0x834e('0x21')]=intUtil[_0x834e('0x5a')](_0x193a15[_0x834e('0x21')]);_0x193a15['serverUrl']=intUtil[_0x834e('0x5a')](_0x193a15['serverUrl']);if(_0x3e3467&&_0x3e3467['recordingFormat']&&_0x3e3467[_0x834e('0x5b')]!==_0x834e('0x5c')){logger[_0x834e('0x19')](_0x834e('0x5d'),_0x834e('0x4a'));_0x460a7a[_0x834e('0x4d')]=util[_0x834e('0x20')](_0x834e('0x4b'),_0x193a15['serverUrl'],_0x460a7a[_0x834e('0x5e')],md5(_0x460a7a['uniqueid']));}return getConnection(_0x193a15)[_0x834e('0x43')](function(_0xd35dda){_0x2145cf=_0xd35dda;return getUser(_0x193a15,_0x297cce['email'],_0x2145cf);})['then'](function(_0x4a4def){_0xed4081=_0x4a4def;logger[_0x834e('0x19')](_0x834e('0x4f'),_0xed4081['id']);return getEndUser(_0x193a15,_0x460a7a[_0x834e('0x5f')],_0x460a7a[_0x834e('0x60')],_0x2145cf);})['then'](function(_0x2b0d93){_0x2cb233=_0x2b0d93;logger[_0x834e('0x19')](_0x834e('0x61'),_0x2cb233['id']);return createTicket(_0x193a15,_0xed4081,_0x2cb233,_0x17b8e3,_0x460a7a,_0x17b8e3[_0x834e('0x51')],_0x2145cf);})[_0x834e('0x43')](function(_0x28b5c9){_0x5c83eb=_0x28b5c9;logger[_0x834e('0x19')](_0x834e('0x52'));logger[_0x834e('0x19')](_0x834e('0x53'),_0x5c83eb['id']);var _0x5b2bf6=util[_0x834e('0x20')](_0x834e('0x54'),_0x193a15[_0x834e('0x21')],_[_0x834e('0x62')](_0x5c83eb['id'],'x')[0x1]);logger['info'](_0x834e('0x5d'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format']('user:%s',_0x297cce[_0x834e('0x17')]),_0x834e('0x58'),{'uri':_0x5b2bf6});})['catch'](function(_0x2645df){logger[_0x834e('0x27')]('[OUTBOUND]',JSON[_0x834e('0x25')](_0x2645df));});};exports[_0x834e('0x63')]=function(_0x4b88e7,_0x5df169,_0x346be5,_0x2a42a3,_0x8bc7d9,_0x44c909){var _0x1d8e7,_0x493239,_0x264a6f,_0x520367;_0x44c909[_0x834e('0x21')]=intUtil[_0x834e('0x5a')](_0x44c909[_0x834e('0x21')]);_0x44c909['serverUrl']=intUtil[_0x834e('0x5a')](_0x44c909[_0x834e('0x4c')]);if(_0x8bc7d9&&_0x8bc7d9['monitor_format']){logger[_0x834e('0x19')]('['+_0x5df169[_0x834e('0x64')][_0x834e('0x65')]()+']','Recording\x20is\x20enabled!');_0x5df169[_0x834e('0x4d')]=util[_0x834e('0x20')](_0x834e('0x4b'),_0x44c909[_0x834e('0x4c')],_0x5df169[_0x834e('0x5e')],md5(_0x5df169[_0x834e('0x5e')]));}else{_0x5df169[_0x834e('0x4d')]='';}return getConnection(_0x44c909)[_0x834e('0x43')](function(_0xd49002){_0x520367=_0xd49002;return getUser(_0x44c909,'',_0x520367);})[_0x834e('0x43')](function(_0x57d898){_0x1d8e7=_0x57d898;logger['info']('The\x20User\x20ID\x20is:',_0x1d8e7['id']);return getEndUser(_0x44c909,_0x5df169[_0x834e('0x66')],_0x5df169[_0x834e('0x50')],_0x520367);})[_0x834e('0x43')](function(_0x37fa2c){_0x493239=_0x37fa2c;logger[_0x834e('0x19')]('The\x20Enduser\x20ID\x20is:',_0x493239['id']);return createTicket(_0x44c909,_0x1d8e7,_0x493239,_0x346be5,_0x5df169,_0x346be5['Fields'],_0x520367);})[_0x834e('0x43')](function(_0x1ad428){_0x264a6f=_0x1ad428;logger[_0x834e('0x19')](_0x834e('0x52'));logger[_0x834e('0x19')]('The\x20Ticket\x20ID\x20is:',_0x264a6f['id']);})[_0x834e('0x28')](function(_0x2b162a){logger[_0x834e('0x27')]('['+_0x5df169['lastevent'][_0x834e('0x65')]()+']',JSON[_0x834e('0x25')](_0x2b162a));});}; \ No newline at end of file +var _0xe706=['result','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','getUser','username','Searching\x20end\x20user\x20with\x20phone','remoteUri','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','phone','catch','accessKey','getchallenge','token','Account\x20%d\x20is\x20not\x20valid','getConnection','queue','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','user:%s','unmanaged','lastevent','toUpperCase','lodash','request-promise','bluebird','util','ioredis','./util','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','emit','length','forEach','includes','string','idField','content','toString','type','variable','variableName','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','Open','Subjects','getString','Descriptions','POST','format','%s/webservice.php','create','stringify','then','success','resolve','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','statusCode','error','[vTiger],\x20%s,\x20%s,\x20%s','validateEmail','Getting\x20agent\x20with\x20email','GET','query','sessionName','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;'];(function(_0x18882f,_0x5b8f0d){var _0x265994=function(_0x26ce4e){while(--_0x26ce4e){_0x18882f['push'](_0x18882f['shift']());}};_0x265994(++_0x5b8f0d);}(_0xe706,0xa3));var _0x6e70=function(_0x3a60b8,_0x47caab){_0x3a60b8=_0x3a60b8-0x0;var _0x4eb583=_0xe706[_0x3a60b8];return _0x4eb583;};'use strict';var _=require(_0x6e70('0x0'));var rp=require(_0x6e70('0x1'));var BPromise=require(_0x6e70('0x2'));var md5=require('md5');var util=require(_0x6e70('0x3'));var Redis=require(_0x6e70('0x4'));var intUtil=require(_0x6e70('0x5'));var config=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));config[_0x6e70('0x9')]=_[_0x6e70('0xa')](config[_0x6e70('0x9')],{'host':_0x6e70('0xb'),'port':0x18eb});var io=require(_0x6e70('0xc'))(new Redis(config[_0x6e70('0x9')]));function emit(_0x45a2d4,_0x188ed3,_0x3c4843){io['to'](_0x45a2d4)[_0x6e70('0xd')](_0x188ed3,_0x3c4843);}function getCustomFields(_0x954545,_0x25e61c){var _0x100eb7={};if(_0x954545[_0x6e70('0xe')]>0x0){_[_0x6e70('0xf')](_0x954545,function(_0x3f474a){if(_[_0x6e70('0x10')]([_0x6e70('0x11'),'picklist'],_0x3f474a['type'])&&_0x3f474a[_0x6e70('0x12')]){_0x100eb7[_0x3f474a[_0x6e70('0x12')]]=_0x3f474a[_0x6e70('0x13')][_0x6e70('0x14')]();}else if(_0x3f474a[_0x6e70('0x15')]===_0x6e70('0x16')&&_0x3f474a[_0x6e70('0x17')]&&_0x3f474a[_0x6e70('0x12')]&&_0x25e61c[_0x3f474a['variableName']]){_0x100eb7[_0x3f474a['idField']]=_0x25e61c[_0x3f474a['variableName']][_0x6e70('0x14')]();}else if(_0x3f474a['type']==='customVariable'&&_0x3f474a[_0x6e70('0x18')]&&_0x3f474a[_0x6e70('0x18')]['name']&&_0x3f474a[_0x6e70('0x12')]&&_0x25e61c[_0x3f474a['Variable'][_0x6e70('0x19')][_0x6e70('0x1a')]()]){_0x100eb7[_0x3f474a['idField']]=_0x25e61c[_0x3f474a['Variable'][_0x6e70('0x19')]['toLowerCase']()][_0x6e70('0x14')]();}});}return _0x100eb7;}function createTicket(_0x173afe,_0x53acdc,_0x497d61,_0xc238ba,_0x208e21,_0x2368eb,_0x3a9978){logger[_0x6e70('0x1b')](_0x6e70('0x1c'));var _0x1b2453=_[_0x6e70('0x1d')]({'parent_id':'','assigned_user_id':_0x53acdc['id'],'ticketpriorities':_0x6e70('0x1e'),'ticketstatus':_0x6e70('0x1f'),'ticket_title':intUtil['getString'](_0xc238ba[_0x6e70('0x20')],_0x208e21,'\x20'),'description':intUtil[_0x6e70('0x21')](_0xc238ba[_0x6e70('0x22')],_0x208e21,'\x0a'),'contact_id':_0x497d61['id']},getCustomFields(_0x2368eb,_0x208e21));var _0x502b2d={'method':_0x6e70('0x23'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x173afe['remoteUri']),'form':{'operation':_0x6e70('0x26'),'username':_0x173afe['username'],'sessionName':_0x3a9978['sessionName'],'elementType':'HelpDesk','element':JSON[_0x6e70('0x27')](_0x1b2453)},'json':!![]};return request(_0x502b2d)[_0x6e70('0x28')](function(_0x51d292){if(_0x51d292[_0x6e70('0x29')]){return BPromise[_0x6e70('0x2a')]({'id':_0x51d292['result']['id']});}else{throw new Error(util[_0x6e70('0x24')](_0x6e70('0x2b'),JSON[_0x6e70('0x27')](_0x51d292['error'])));}})['catch'](function(_0x2c4d37){var _0x3af17f=_0x2c4d37[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),'createTicket',_0x3af17f,JSON[_0x6e70('0x27')](_0x2c4d37));});}function getUser(_0x406f29,_0xecf336,_0x2864a0){if(intUtil[_0x6e70('0x2f')](_0xecf336)){logger[_0x6e70('0x1b')](_0x6e70('0x30'),_0xecf336);return request({'method':_0x6e70('0x31'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x406f29['remoteUri']),'qs':{'operation':_0x6e70('0x32'),'username':_0x406f29['username'],'sessionName':_0x2864a0[_0x6e70('0x33')],'query':util['format'](_0x6e70('0x34'),_0xecf336)},'json':!![]})[_0x6e70('0x28')](function(_0x30fa0b){if(_0x30fa0b['success']&&_0x30fa0b[_0x6e70('0x35')][_0x6e70('0xe')]){logger['info'](_0x6e70('0x36'));return BPromise[_0x6e70('0x2a')]({'id':_0x30fa0b['result'][0x0]['id'],'email':_0x30fa0b[_0x6e70('0x35')][0x0][_0x6e70('0x37')],'name':_0x30fa0b[_0x6e70('0x35')][0x0][_0x6e70('0x38')]+'\x20'+_0x30fa0b[_0x6e70('0x35')][_0x6e70('0x39')]});}else{logger[_0x6e70('0x1b')](_0x6e70('0x3a'));return BPromise[_0x6e70('0x2a')]({'id':_0x2864a0[_0x6e70('0x3b')],'email':_0x406f29['username'],'name':_0x6e70('0x3c')});}})['catch'](function(_0x23cd1a){var _0x3222a2=_0x23cd1a[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),_0x6e70('0x3d'),_0x3222a2,JSON[_0x6e70('0x27')](_0x23cd1a));});}else{logger[_0x6e70('0x1b')](_0x6e70('0x3a'));return BPromise[_0x6e70('0x2a')]({'id':_0x2864a0[_0x6e70('0x3b')],'email':_0x406f29[_0x6e70('0x3e')],'name':_0x6e70('0x3c')})['catch'](function(_0x5446a2){var _0x5424eb=_0x5446a2[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),_0x6e70('0x3d'),_0x5424eb,JSON[_0x6e70('0x27')](_0x5446a2));});}}function getEndUser(_0x3bdd87,_0x572a71,_0x3b508c,_0x9e7ad2){logger[_0x6e70('0x1b')](_0x6e70('0x3f'),_0x3b508c);return request({'method':_0x6e70('0x31'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x3bdd87[_0x6e70('0x40')]),'qs':{'operation':'query','username':_0x3bdd87[_0x6e70('0x3e')],'sessionName':_0x9e7ad2[_0x6e70('0x33')],'query':util[_0x6e70('0x24')](_0x6e70('0x41'),_0x3b508c,_0x3b508c,_0x3b508c,_0x3b508c,_0x3b508c)},'json':!![]})[_0x6e70('0x28')](function(_0x1de947){if(_0x1de947[_0x6e70('0x29')]&&_0x1de947['result']['length']){logger['info'](_0x6e70('0x42'));return BPromise[_0x6e70('0x2a')]({'id':_0x1de947[_0x6e70('0x35')][0x0]['id'],'name':_0x1de947[_0x6e70('0x35')][0x0][_0x6e70('0x43')]+'\x20'+_0x1de947['result'][0x0][_0x6e70('0x44')],'phone':_0x3b508c});}else{logger[_0x6e70('0x1b')](_0x6e70('0x45'));return request({'method':'POST','uri':util['format']('%s/webservice.php',_0x3bdd87[_0x6e70('0x40')]),'form':{'operation':'create','sessionName':_0x9e7ad2[_0x6e70('0x33')],'elementType':_0x6e70('0x46'),'element':JSON[_0x6e70('0x27')]({'lastname':_0x572a71,'phone':_0x3b508c,'assigned_user_id':'\x20'})},'json':!![]})[_0x6e70('0x28')](function(_0x59c87d){logger[_0x6e70('0x1b')]('Enduser\x20created.');return BPromise[_0x6e70('0x2a')]({'id':_0x59c87d[_0x6e70('0x35')]['id'],'name':_0x59c87d[_0x6e70('0x35')][_0x6e70('0x44')],'phone':_0x59c87d['result'][_0x6e70('0x47')]});})[_0x6e70('0x48')](function(_0x3d39c3){var _0xac87d6=_0x3d39c3[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),'getEndUser',_0xac87d6,JSON[_0x6e70('0x27')](_0x3d39c3));});}});}function getConnection(_0x3884a4){var _0x10de2a=_0x3884a4[_0x6e70('0x3e')];var _0x3f86cf=_0x3884a4[_0x6e70('0x49')];return request({'method':_0x6e70('0x31'),'uri':util['format'](_0x6e70('0x25'),_0x3884a4['remoteUri']),'qs':{'operation':_0x6e70('0x4a'),'username':_0x10de2a},'json':!![]})[_0x6e70('0x28')](function(_0x4b351e){if(_0x4b351e['success']){return request({'method':_0x6e70('0x23'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x3884a4['remoteUri']),'form':{'operation':'login','username':_0x10de2a,'accessKey':md5(_0x4b351e[_0x6e70('0x35')][_0x6e70('0x4b')]+_0x3f86cf)},'json':!![]});}})[_0x6e70('0x28')](function(_0x79653){if(_0x79653[_0x6e70('0x29')]){return BPromise[_0x6e70('0x2a')](_0x79653['result']);}else{throw new Error(util[_0x6e70('0x24')](_0x6e70('0x4c'),_0x3884a4['id']));}})[_0x6e70('0x48')](function(_0x6ed023){var _0x2c3a7d=_0x6ed023['statusCode']||0x1f4;logger['error'](_0x6e70('0x2e'),_0x6e70('0x4d'),_0x2c3a7d,JSON[_0x6e70('0x27')](_0x6ed023));});}function request(_0x15f994){logger[_0x6e70('0x1b')]('[HTTP]',JSON[_0x6e70('0x27')](_0x15f994));return rp(_0x15f994);}exports[_0x6e70('0x4e')]=function(_0x1fa320,_0x23ebfb,_0x3aba34,_0x4a111a,_0x1142cd,_0x1dd242){var _0x2c20d3,_0x3fb0d3,_0x8ef4f7,_0x3fd03d;_0x1dd242['remoteUri']=intUtil[_0x6e70('0x4f')](_0x1dd242[_0x6e70('0x40')]);if(_0x1142cd&&_0x1142cd['monitor_format']){logger[_0x6e70('0x1b')](_0x6e70('0x50'),'Recording\x20is\x20enabled!');_0x23ebfb[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x1dd242[_0x6e70('0x53')],_0x23ebfb[_0x6e70('0x54')],md5(_0x23ebfb['uniqueid']));}else{_0x23ebfb[_0x6e70('0x51')]='';}return getConnection(_0x1dd242)[_0x6e70('0x28')](function(_0x10d655){_0x3fd03d=_0x10d655;return getUser(_0x1dd242,_0x4a111a[_0x6e70('0x55')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x1fe13a){_0x2c20d3=_0x1fe13a;logger[_0x6e70('0x1b')](_0x6e70('0x56'),_0x2c20d3['id']);return getEndUser(_0x1dd242,_0x23ebfb[_0x6e70('0x57')],_0x23ebfb[_0x6e70('0x58')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x1b12a1){_0x3fb0d3=_0x1b12a1;logger[_0x6e70('0x1b')](_0x6e70('0x59'),_0x3fb0d3['id']);return createTicket(_0x1dd242,_0x2c20d3,_0x3fb0d3,_0x3aba34,_0x23ebfb,_0x3aba34[_0x6e70('0x5a')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x324fa6){_0x8ef4f7=_0x324fa6;logger[_0x6e70('0x1b')](_0x6e70('0x5b'));logger[_0x6e70('0x1b')]('The\x20Ticket\x20ID\x20is:',_0x8ef4f7['id']);var _0x28898a=util[_0x6e70('0x24')](_0x6e70('0x5c'),_0x1dd242[_0x6e70('0x40')],_[_0x6e70('0x5d')](_0x8ef4f7['id'],'x')[0x1]);logger[_0x6e70('0x1b')]('[QUEUE]',_0x6e70('0x5e'));emit(util[_0x6e70('0x24')]('user:%s',_0x4a111a[_0x6e70('0x19')]),_0x6e70('0x5f'),{'uri':_0x28898a});})[_0x6e70('0x48')](function(_0x590f7f){logger['error'](_0x6e70('0x50'),JSON[_0x6e70('0x27')](_0x590f7f));});};exports[_0x6e70('0x60')]=function(_0x41a861,_0x10d299,_0x739946,_0x30cd88,_0x57bfe5,_0x4d47e1,_0x2c8dc6){var _0x1e23c5,_0x2bf9ec,_0x2ad395,_0x5b1e6f;_0x4d47e1['remoteUri']=intUtil[_0x6e70('0x4f')](_0x4d47e1[_0x6e70('0x40')]);_0x4d47e1['serverUrl']=intUtil['stripTrailingSlash'](_0x4d47e1[_0x6e70('0x53')]);if(_0x2c8dc6&&_0x2c8dc6['recordingFormat']&&_0x2c8dc6[_0x6e70('0x61')]!==_0x6e70('0x62')){logger[_0x6e70('0x1b')](_0x6e70('0x63'),_0x6e70('0x64'));_0x10d299[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x4d47e1['serverUrl'],_0x10d299[_0x6e70('0x54')],md5(_0x10d299[_0x6e70('0x54')]));}return getConnection(_0x4d47e1)[_0x6e70('0x28')](function(_0x346c79){_0x5b1e6f=_0x346c79;return getUser(_0x4d47e1,_0x30cd88[_0x6e70('0x55')],_0x5b1e6f);})['then'](function(_0x5f5b02){_0x1e23c5=_0x5f5b02;logger['info'](_0x6e70('0x56'),_0x1e23c5['id']);return getEndUser(_0x4d47e1,_0x10d299[_0x6e70('0x65')],_0x10d299[_0x6e70('0x66')],_0x5b1e6f);})['then'](function(_0x58cf1c){_0x2bf9ec=_0x58cf1c;logger[_0x6e70('0x1b')](_0x6e70('0x59'),_0x2bf9ec['id']);return createTicket(_0x4d47e1,_0x1e23c5,_0x2bf9ec,_0x739946,_0x10d299,_0x739946[_0x6e70('0x5a')],_0x5b1e6f);})[_0x6e70('0x28')](function(_0x2285f1){_0x2ad395=_0x2285f1;logger[_0x6e70('0x1b')]('Ticket\x20created!');logger[_0x6e70('0x1b')](_0x6e70('0x67'),_0x2ad395['id']);var _0x30d11b=util[_0x6e70('0x24')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x4d47e1[_0x6e70('0x40')],_['split'](_0x2ad395['id'],'x')[0x1]);logger['info'](_0x6e70('0x63'),_0x6e70('0x5e'));emit(util[_0x6e70('0x24')](_0x6e70('0x68'),_0x30cd88[_0x6e70('0x19')]),_0x6e70('0x5f'),{'uri':_0x30d11b});})['catch'](function(_0x370eeb){logger[_0x6e70('0x2d')](_0x6e70('0x63'),JSON[_0x6e70('0x27')](_0x370eeb));});};exports[_0x6e70('0x69')]=function(_0x13c092,_0x363722,_0xd9b4a9,_0x2f1362,_0x29621a,_0x575938){var _0x44c877,_0x303c5a,_0x577c3b,_0x5d398a;_0x575938['remoteUri']=intUtil[_0x6e70('0x4f')](_0x575938[_0x6e70('0x40')]);_0x575938[_0x6e70('0x53')]=intUtil[_0x6e70('0x4f')](_0x575938[_0x6e70('0x53')]);if(_0x29621a&&_0x29621a['monitor_format']){logger['info']('['+_0x363722[_0x6e70('0x6a')][_0x6e70('0x6b')]()+']','Recording\x20is\x20enabled!');_0x363722[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x575938[_0x6e70('0x53')],_0x363722[_0x6e70('0x54')],md5(_0x363722[_0x6e70('0x54')]));}else{_0x363722[_0x6e70('0x51')]='';}return getConnection(_0x575938)[_0x6e70('0x28')](function(_0x3650e9){_0x5d398a=_0x3650e9;return getUser(_0x575938,'',_0x5d398a);})[_0x6e70('0x28')](function(_0x347cc4){_0x44c877=_0x347cc4;logger[_0x6e70('0x1b')](_0x6e70('0x56'),_0x44c877['id']);return getEndUser(_0x575938,_0x363722[_0x6e70('0x57')],_0x363722['calleridnum'],_0x5d398a);})['then'](function(_0x39ed95){_0x303c5a=_0x39ed95;logger['info'](_0x6e70('0x59'),_0x303c5a['id']);return createTicket(_0x575938,_0x44c877,_0x303c5a,_0xd9b4a9,_0x363722,_0xd9b4a9['Fields'],_0x5d398a);})['then'](function(_0x402f6f){_0x577c3b=_0x402f6f;logger['info']('Ticket\x20created!');logger[_0x6e70('0x1b')](_0x6e70('0x67'),_0x577c3b['id']);})[_0x6e70('0x48')](function(_0x4e9fda){logger['error']('['+_0x363722['lastevent'][_0x6e70('0x6b')]()+']',JSON['stringify'](_0x4e9fda));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/zendesk.js b/server/services/ami/trigger/integration/zendesk.js index e96e6b4..62a22d0 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 _0x3712=['Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/agent/tickets/%s','replace','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','outbound','recordingFormat','none','destcalleridname','destcalleridnum','[OUTBOUND]','/api/v2','inspect','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','calleridnum','lastevent','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','lodash','md5','./util','../../../../config/environment','../../../../config/logger','zendesk','localhost','socket.io-emitter','redis','emit','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','merge','Tags','name','getString','Subjects','Descriptions','Fields','then','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','type:user\x20role:agent\x20email:%s','find','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','user','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','length','end-user','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','POST','Caller\x20-\x20%s','authType','password','%s:%s','username','token','Basic\x20%s','toString','base64','debug','[HTTP]','stringify','defaults','GET','map','forEach','includes','string','nameField','picklist','type','custom_fields','push','idField','variable','variableName','customField','customVariable','Variable','toLowerCase','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','Authorization','email','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'];(function(_0xcdb190,_0x2f3df2){var _0x45c609=function(_0x7078a0){while(--_0x7078a0){_0xcdb190['push'](_0xcdb190['shift']());}};_0x45c609(++_0x2f3df2);}(_0x3712,0x1eb));var _0x2371=function(_0x56ba58,_0x1697c4){_0x56ba58=_0x56ba58-0x0;var _0x337772=_0x3712[_0x56ba58];return _0x337772;};'use strict';var _=require(_0x2371('0x0'));var rp=require('request-promise');var md5=require(_0x2371('0x1'));var util=require('util');var Redis=require('ioredis');var intUtil=require(_0x2371('0x2'));var config=require(_0x2371('0x3'));var logger=require(_0x2371('0x4'))(_0x2371('0x5'));config['redis']=_['defaults'](config['redis'],{'host':_0x2371('0x6'),'port':0x18eb});var io=require(_0x2371('0x7'))(new Redis(config[_0x2371('0x8')]));function emit(_0x5b0d96,_0x47ed2c,_0x29fd10){io['to'](_0x5b0d96)[_0x2371('0x9')](_0x47ed2c,_0x29fd10);}var headers={'Content-Type':_0x2371('0xa'),'Accept':_0x2371('0xa')};function getTicket(_0x153ae4,_0x1691e2,_0xc0582c,_0xbc6aca,_0x5bc343){logger[_0x2371('0xb')](_0x2371('0xc'));return request({'uri':util[_0x2371('0xd')](_0x2371('0xe'),_0x153ae4[_0x2371('0xf')]),'method':'POST','body':{'ticket':_[_0x2371('0x10')]({'requester_id':_0xc0582c['id'],'submitter_id':_0x1691e2?_0x1691e2['id']:undefined,'assignee_id':_0x1691e2?_0x1691e2['id']:undefined,'tags':getTags(_0xbc6aca[_0x2371('0x11')],_0x2371('0x12')),'subject':intUtil[_0x2371('0x13')](_0xbc6aca[_0x2371('0x14')],_0x5bc343,'\x20'),'description':intUtil[_0x2371('0x13')](_0xbc6aca[_0x2371('0x15')],_0x5bc343,'\x0a'),'comment':{'public':![],'body':intUtil[_0x2371('0x13')](_0xbc6aca[_0x2371('0x15')],_0x5bc343,'\x0a')}},getCustomFields(_0xbc6aca[_0x2371('0x16')],_0x5bc343))}})[_0x2371('0x17')](function(_0x375e9d){logger['info'](_0x2371('0x18'));return _0x375e9d[_0x2371('0x19')];});}function getUser(_0x5c81a6,_0x25a5cd){if(intUtil[_0x2371('0x1a')](_0x25a5cd)){logger[_0x2371('0xb')](_0x2371('0x1b'),_0x25a5cd);return request({'uri':util[_0x2371('0xd')](_0x2371('0x1c'),_0x5c81a6[_0x2371('0xf')]),'qs':{'query':util['format'](_0x2371('0x1d'),_0x25a5cd)}})[_0x2371('0x17')](function(_0x4c2514){if(_0x4c2514['count']){logger['info']('Agent\x20found!');return _[_0x2371('0x1e')](_0x4c2514[_0x2371('0x1f')],{'email':_0x25a5cd,'role':_0x2371('0x20')});}else{logger[_0x2371('0xb')](_0x2371('0x21'));return request({'uri':util['format'](_0x2371('0x22'),_0x5c81a6[_0x2371('0xf')])})[_0x2371('0x17')](function(_0x2b69a6){logger[_0x2371('0xb')]('Admin\x20account\x20selected.');return _0x2b69a6[_0x2371('0x23')];});}});}else{logger[_0x2371('0xb')](_0x2371('0x21'));return request({'uri':util[_0x2371('0xd')]('%s/users/me.json',_0x5c81a6[_0x2371('0xf')])})[_0x2371('0x17')](function(_0x44aa47){logger['info'](_0x2371('0x24'));return _0x44aa47[_0x2371('0x23')];});}}function getEndUser(_0x5dbd8c,_0x1355c7,_0x367600){logger[_0x2371('0xb')](_0x2371('0x25'),_0x367600);return request({'uri':util['format']('%s/search.json',_0x5dbd8c[_0x2371('0xf')]),'qs':{'query':util[_0x2371('0xd')](_0x2371('0x26'),_0x367600)}})[_0x2371('0x17')](function(_0x50ac5b){var _0x5c84a2;if(_0x50ac5b[_0x2371('0x1f')][_0x2371('0x27')]){_0x50ac5b[_0x2371('0x1f')]=_['filter'](_0x50ac5b[_0x2371('0x1f')],{'suspended':![],'role':_0x2371('0x28')});if(_0x50ac5b[_0x2371('0x1f')][_0x2371('0x27')]){_0x5c84a2=_[_0x2371('0x29')](_0x50ac5b[_0x2371('0x1f')]);}}if(_0x5c84a2){logger[_0x2371('0xb')](_0x2371('0x2a'));return _0x5c84a2;}else{logger[_0x2371('0xb')](_0x2371('0x2b'));return request({'uri':util[_0x2371('0xd')](_0x2371('0x2c'),_0x5dbd8c['remoteUri']),'method':_0x2371('0x2d'),'body':{'user':{'role':'end-user','name':util[_0x2371('0xd')](_0x2371('0x2e'),_0x1355c7||_0x367600),'phone':_0x367600}}})['then'](function(_0x5b5ab4){logger[_0x2371('0xb')]('Enduser\x20created.');return _0x5b5ab4[_0x2371('0x23')];});}});}function getAuth(_0x520053){var _0x2b0f0e;if(_0x520053[_0x2371('0x2f')]===_0x2371('0x30')){_0x2b0f0e=util['format'](_0x2371('0x31'),_0x520053[_0x2371('0x32')],_0x520053[_0x2371('0x30')]);}else if(_0x520053[_0x2371('0x2f')]===_0x2371('0x33')){_0x2b0f0e=util[_0x2371('0xd')]('%s/token:%s',_0x520053[_0x2371('0x32')],_0x520053['token']);}return util[_0x2371('0xd')](_0x2371('0x34'),new Buffer(_0x2b0f0e)[_0x2371('0x35')](_0x2371('0x36')));}function request(_0x440a29){logger[_0x2371('0x37')](_0x2371('0x38'),JSON[_0x2371('0x39')](_0x440a29));return rp(_[_0x2371('0x3a')](_0x440a29,{'method':_0x2371('0x3b'),'headers':headers,'json':!![]}));}function getTags(_0x2e1b13,_0x12b358){var _0x580ef1=[];if(_0x2e1b13&&_0x2e1b13['length']>0x0){_0x580ef1=_[_0x2371('0x3c')](_0x2e1b13,_0x12b358);}return _0x580ef1;}function getCustomFields(_0x2fda37,_0x3c9a26){var _0x57c757=[];var _0x118426={'custom_fields':[]};if(_0x2fda37['length']>0x0){_[_0x2371('0x3d')](_0x2fda37,function(_0x114a34){if(_[_0x2371('0x3e')]([_0x2371('0x3f'),'picklist'],_0x114a34['type'])&&_0x114a34[_0x2371('0x40')]&&!_0x114a34['customField']){_0x118426[_0x114a34[_0x2371('0x40')]['toLowerCase']()]=_0x114a34['content'][_0x2371('0x35')]();}else if(_[_0x2371('0x3e')]([_0x2371('0x3f'),_0x2371('0x41')],_0x114a34[_0x2371('0x42')])&&_0x114a34['idField']&&_0x114a34['customField']){_0x118426[_0x2371('0x43')][_0x2371('0x44')]({'id':_0x114a34[_0x2371('0x45')],'value':_0x114a34['content'][_0x2371('0x35')]()});}else if(_0x114a34[_0x2371('0x42')]===_0x2371('0x46')&&_0x114a34[_0x2371('0x47')]&&_0x114a34['idField']&&_0x114a34[_0x2371('0x48')]){_0x3c9a26[_0x114a34['variableName']]&&_0x118426['custom_fields']['push']({'id':_0x114a34[_0x2371('0x45')],'value':_0x3c9a26[_0x114a34['variableName']]['toString']()});}else if(_0x114a34['type']===_0x2371('0x49')&&_0x114a34[_0x2371('0x4a')]&&_0x114a34['Variable']['name']&&_0x114a34[_0x2371('0x45')]&&_0x114a34[_0x2371('0x48')]){_0x3c9a26[_0x114a34['Variable'][_0x2371('0x12')][_0x2371('0x4b')]()]&&_0x118426[_0x2371('0x43')][_0x2371('0x44')]({'id':_0x114a34[_0x2371('0x45')],'value':_0x3c9a26[_0x114a34['Variable']['name'][_0x2371('0x4b')]()][_0x2371('0x35')]()});}});}return _0x118426;}exports[_0x2371('0x4c')]=function(_0x592e0a,_0x38cae7,_0x10cc8c,_0x31c7b0,_0x2dbb00,_0x200c30){var _0x7bb11e,_0x1b8766;_0x200c30['remoteUri']=intUtil[_0x2371('0x4d')](_0x200c30[_0x2371('0xf')]);_0x200c30[_0x2371('0x4e')]=intUtil['stripTrailingSlash'](_0x200c30['serverUrl']);if(_0x2dbb00&&_0x2dbb00[_0x2371('0x4f')]){logger[_0x2371('0xb')](_0x2371('0x50'),_0x2371('0x51'));_0x38cae7[_0x2371('0x52')]=util[_0x2371('0xd')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x200c30['serverUrl'],_0x38cae7[_0x2371('0x53')],md5(_0x38cae7[_0x2371('0x53')]));}else{_0x38cae7['recordingURL']='';}headers[_0x2371('0x54')]=getAuth(_0x200c30);return getUser(_0x200c30,_0x31c7b0[_0x2371('0x55')])[_0x2371('0x17')](function(_0x2f1713){_0x7bb11e=_0x2f1713;logger[_0x2371('0xb')](_0x2371('0x56'),_0x7bb11e['id']);return getEndUser(_0x200c30,_0x38cae7[_0x2371('0x57')],_0x38cae7['calleridnum']);})[_0x2371('0x17')](function(_0x3ddc03){_0x1b8766=_0x3ddc03;logger[_0x2371('0xb')](_0x2371('0x58'),_0x1b8766['id']);return getTicket(_0x200c30,_0x7bb11e,_0x1b8766,_0x10cc8c,_0x38cae7);})['then'](function(_0x2e5aaf){if(_0x2e5aaf){logger[_0x2371('0xb')](_0x2371('0x59'),_0x2e5aaf['id']);switch(_0x200c30[_0x2371('0x42')]){case _0x2371('0x5a'):logger['info'](_0x2371('0x50'),_0x2371('0x5b'));return request({'uri':util['format'](_0x2371('0x5c'),_0x200c30[_0x2371('0xf')],_0x7bb11e['id'],_0x2e5aaf['id']),'method':_0x2371('0x2d')});case _0x2371('0x5d'):logger[_0x2371('0xb')](_0x2371('0x50'),_0x2371('0x5e'));emit(util[_0x2371('0xd')](_0x2371('0x5f'),_0x31c7b0['name']),_0x2371('0x60'),{'uri':util['format'](_0x2371('0x61'),_0x200c30[_0x2371('0xf')][_0x2371('0x62')]('/api/v2',''),_0x2e5aaf['id'])});break;default:logger[_0x2371('0x63')](_0x2371('0x50'),_0x2371('0x64'));}}})[_0x2371('0x65')](function(_0x448ce3){logger[_0x2371('0x63')](_0x2371('0x66'),util['inspect'](_0x448ce3,{'showHidden':!![],'depth':null}));});};exports[_0x2371('0x67')]=function(_0x29e3a9,_0x2e6007,_0x22aa37,_0x1c49e0,_0x295ad9,_0x16964a,_0x14cff3){var _0x116202,_0x1e041e;_0x16964a[_0x2371('0xf')]=intUtil[_0x2371('0x4d')](_0x16964a[_0x2371('0xf')]);_0x16964a[_0x2371('0x4e')]=intUtil[_0x2371('0x4d')](_0x16964a[_0x2371('0x4e')]);if(_0x14cff3&&_0x14cff3[_0x2371('0x68')]&&_0x14cff3[_0x2371('0x68')]!==_0x2371('0x69')){logger[_0x2371('0xb')]('[OUTBOUND]',_0x2371('0x51'));_0x2e6007['recordingURL']=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x16964a[_0x2371('0x4e')],_0x2e6007[_0x2371('0x53')],md5(_0x2e6007['uniqueid']));}headers[_0x2371('0x54')]=getAuth(_0x16964a);return getUser(_0x16964a,_0x1c49e0['email'])[_0x2371('0x17')](function(_0x1a1dd6){_0x116202=_0x1a1dd6;logger[_0x2371('0xb')]('The\x20User\x20ID\x20is:',_0x116202['id']);return getEndUser(_0x16964a,_0x2e6007[_0x2371('0x6a')],_0x2e6007[_0x2371('0x6b')]);})[_0x2371('0x17')](function(_0x26ae41){_0x1e041e=_0x26ae41;logger['info']('The\x20Enduser\x20ID\x20is:',_0x1e041e['id']);return getTicket(_0x16964a,_0x116202,_0x1e041e,_0x22aa37,_0x2e6007);})[_0x2371('0x17')](function(_0x2e1329){if(_0x2e1329){logger[_0x2371('0xb')](_0x2371('0x59'),_0x2e1329['id']);switch(_0x16964a[_0x2371('0x42')]){case _0x2371('0x5a'):logger[_0x2371('0xb')](_0x2371('0x6c'),_0x2371('0x5b'));return request({'uri':util[_0x2371('0xd')](_0x2371('0x5c'),_0x16964a[_0x2371('0xf')],_0x116202['id'],_0x2e1329['id']),'method':_0x2371('0x2d')});case _0x2371('0x5d'):logger[_0x2371('0xb')]('[OUTBOUND]',_0x2371('0x5e'));emit(util[_0x2371('0xd')](_0x2371('0x5f'),_0x1c49e0[_0x2371('0x12')]),_0x2371('0x60'),{'uri':util['format'](_0x2371('0x61'),_0x16964a[_0x2371('0xf')][_0x2371('0x62')](_0x2371('0x6d'),''),_0x2e1329['id'])});break;default:logger[_0x2371('0x63')](_0x2371('0x6c'),_0x2371('0x64'));}}})[_0x2371('0x65')](function(_0x2a37a1){logger['error']('[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration',util[_0x2371('0x6e')](_0x2a37a1,{'showHidden':!![],'depth':null}));});};exports[_0x2371('0x6f')]=function(_0x56a3be,_0x8ab38a,_0x34b784,_0x59b171,_0x4daf39,_0xea2ae8){var _0x46498e,_0x3c0da4;_0xea2ae8[_0x2371('0xf')]=intUtil[_0x2371('0x4d')](_0xea2ae8[_0x2371('0xf')]);_0xea2ae8[_0x2371('0x4e')]=intUtil[_0x2371('0x4d')](_0xea2ae8[_0x2371('0x4e')]);if(_0x4daf39&&_0x4daf39['monitor_format']){logger[_0x2371('0xb')]('['+_0x8ab38a['lastevent']['toUpperCase']()+']',_0x2371('0x51'));_0x8ab38a[_0x2371('0x52')]=util[_0x2371('0xd')](_0x2371('0x70'),_0xea2ae8[_0x2371('0x4e')],_0x8ab38a['uniqueid'],md5(_0x8ab38a['uniqueid']));}else{_0x8ab38a[_0x2371('0x52')]='';}headers[_0x2371('0x54')]=getAuth(_0xea2ae8);return getUser(_0xea2ae8)['then'](function(_0x507e0c){_0x46498e=_0x507e0c;logger[_0x2371('0xb')](_0x2371('0x56'),_0x46498e['id']);return getEndUser(_0xea2ae8,_0x8ab38a[_0x2371('0x57')],_0x8ab38a[_0x2371('0x71')]);})[_0x2371('0x17')](function(_0xff785e){_0x3c0da4=_0xff785e;logger[_0x2371('0xb')]('The\x20Enduser\x20ID\x20is:',_0x3c0da4['id']);return getTicket(_0xea2ae8,_0x46498e,_0x3c0da4,_0x34b784,_0x8ab38a);})['then'](function(_0xba3450){if(_0xba3450){logger[_0x2371('0xb')](_0x2371('0x59'),_0xba3450['id']);}})[_0x2371('0x65')](function(_0x105b08){logger[_0x2371('0x63')]('['+_0x8ab38a[_0x2371('0x72')][_0x2371('0x73')]()+']'+_0x2371('0x74'),util['inspect'](_0x105b08,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xc0f6=['push','queue','stripTrailingSlash','monitor_format','[QUEUE]','recordingURL','uniqueid','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','replace','/api/v2','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','serverUrl','recordingFormat','[OUTBOUND]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','Authorization','destcalleridname','destcalleridnum','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','error','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','lastevent','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','lodash','util','ioredis','./util','../../../../config/logger','redis','defaults','localhost','emit','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','POST','merge','Tags','name','getString','Subjects','Descriptions','Fields','Ticket\x20created!','ticket','Getting\x20agent\x20with\x20email','%s/search.json','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','find','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','then','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','length','end-user','first','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','authType','password','%s:%s','username','token','Basic\x20%s','base64','debug','[HTTP]','stringify','GET','map','forEach','string','picklist','type','nameField','customField','content','toString','includes','custom_fields','variable','idField','variableName','customVariable','Variable','toLowerCase'];(function(_0x36284b,_0x2b7436){var _0x23c34a=function(_0x14f579){while(--_0x14f579){_0x36284b['push'](_0x36284b['shift']());}};_0x23c34a(++_0x2b7436);}(_0xc0f6,0x1e7));var _0x6c0f=function(_0x452968,_0x31e391){_0x452968=_0x452968-0x0;var _0xb6f9ae=_0xc0f6[_0x452968];return _0xb6f9ae;};'use strict';var _=require(_0x6c0f('0x0'));var rp=require('request-promise');var md5=require('md5');var util=require(_0x6c0f('0x1'));var Redis=require(_0x6c0f('0x2'));var intUtil=require(_0x6c0f('0x3'));var config=require('../../../../config/environment');var logger=require(_0x6c0f('0x4'))('zendesk');config[_0x6c0f('0x5')]=_[_0x6c0f('0x6')](config[_0x6c0f('0x5')],{'host':_0x6c0f('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0x5b2bb7,_0xf6a526,_0x93121c){io['to'](_0x5b2bb7)[_0x6c0f('0x8')](_0xf6a526,_0x93121c);}var headers={'Content-Type':_0x6c0f('0x9'),'Accept':_0x6c0f('0x9')};function getTicket(_0x1c51f4,_0x314050,_0x122da7,_0x7ab6da,_0xff76b4){logger[_0x6c0f('0xa')](_0x6c0f('0xb'));return request({'uri':util[_0x6c0f('0xc')](_0x6c0f('0xd'),_0x1c51f4[_0x6c0f('0xe')]),'method':_0x6c0f('0xf'),'body':{'ticket':_[_0x6c0f('0x10')]({'requester_id':_0x122da7['id'],'submitter_id':_0x314050?_0x314050['id']:undefined,'assignee_id':_0x314050?_0x314050['id']:undefined,'tags':getTags(_0x7ab6da[_0x6c0f('0x11')],_0x6c0f('0x12')),'subject':intUtil[_0x6c0f('0x13')](_0x7ab6da[_0x6c0f('0x14')],_0xff76b4,'\x20'),'description':intUtil[_0x6c0f('0x13')](_0x7ab6da[_0x6c0f('0x15')],_0xff76b4,'\x0a'),'comment':{'public':![],'body':intUtil[_0x6c0f('0x13')](_0x7ab6da['Descriptions'],_0xff76b4,'\x0a')}},getCustomFields(_0x7ab6da[_0x6c0f('0x16')],_0xff76b4))}})['then'](function(_0xc63676){logger['info'](_0x6c0f('0x17'));return _0xc63676[_0x6c0f('0x18')];});}function getUser(_0x117091,_0x4e6fde){if(intUtil['validateEmail'](_0x4e6fde)){logger[_0x6c0f('0xa')](_0x6c0f('0x19'),_0x4e6fde);return request({'uri':util[_0x6c0f('0xc')](_0x6c0f('0x1a'),_0x117091[_0x6c0f('0xe')]),'qs':{'query':util[_0x6c0f('0xc')](_0x6c0f('0x1b'),_0x4e6fde)}})['then'](function(_0x4de1aa){if(_0x4de1aa[_0x6c0f('0x1c')]){logger[_0x6c0f('0xa')](_0x6c0f('0x1d'));return _[_0x6c0f('0x1e')](_0x4de1aa[_0x6c0f('0x1f')],{'email':_0x4e6fde,'role':_0x6c0f('0x20')});}else{logger[_0x6c0f('0xa')](_0x6c0f('0x21'));return request({'uri':util['format'](_0x6c0f('0x22'),_0x117091['remoteUri'])})[_0x6c0f('0x23')](function(_0x23fb7e){logger[_0x6c0f('0xa')](_0x6c0f('0x24'));return _0x23fb7e[_0x6c0f('0x25')];});}});}else{logger[_0x6c0f('0xa')](_0x6c0f('0x21'));return request({'uri':util[_0x6c0f('0xc')](_0x6c0f('0x22'),_0x117091[_0x6c0f('0xe')])})[_0x6c0f('0x23')](function(_0x2c2332){logger[_0x6c0f('0xa')](_0x6c0f('0x24'));return _0x2c2332['user'];});}}function getEndUser(_0x174eac,_0x146fdb,_0x5856e8){logger[_0x6c0f('0xa')](_0x6c0f('0x26'),_0x5856e8);return request({'uri':util[_0x6c0f('0xc')]('%s/search.json',_0x174eac[_0x6c0f('0xe')]),'qs':{'query':util[_0x6c0f('0xc')](_0x6c0f('0x27'),_0x5856e8)}})[_0x6c0f('0x23')](function(_0x273568){var _0x388a45;if(_0x273568['results'][_0x6c0f('0x28')]){_0x273568[_0x6c0f('0x1f')]=_['filter'](_0x273568[_0x6c0f('0x1f')],{'suspended':![],'role':_0x6c0f('0x29')});if(_0x273568[_0x6c0f('0x1f')][_0x6c0f('0x28')]){_0x388a45=_[_0x6c0f('0x2a')](_0x273568['results']);}}if(_0x388a45){logger[_0x6c0f('0xa')]('Enduser\x20found!');return _0x388a45;}else{logger[_0x6c0f('0xa')](_0x6c0f('0x2b'));return request({'uri':util[_0x6c0f('0xc')](_0x6c0f('0x2c'),_0x174eac[_0x6c0f('0xe')]),'method':'POST','body':{'user':{'role':_0x6c0f('0x29'),'name':util[_0x6c0f('0xc')]('Caller\x20-\x20%s',_0x146fdb||_0x5856e8),'phone':_0x5856e8}}})[_0x6c0f('0x23')](function(_0x1d8c73){logger[_0x6c0f('0xa')]('Enduser\x20created.');return _0x1d8c73[_0x6c0f('0x25')];});}});}function getAuth(_0x5a31cd){var _0x171c28;if(_0x5a31cd[_0x6c0f('0x2d')]===_0x6c0f('0x2e')){_0x171c28=util[_0x6c0f('0xc')](_0x6c0f('0x2f'),_0x5a31cd[_0x6c0f('0x30')],_0x5a31cd['password']);}else if(_0x5a31cd['authType']==='token'){_0x171c28=util[_0x6c0f('0xc')]('%s/token:%s',_0x5a31cd[_0x6c0f('0x30')],_0x5a31cd[_0x6c0f('0x31')]);}return util['format'](_0x6c0f('0x32'),new Buffer(_0x171c28)['toString'](_0x6c0f('0x33')));}function request(_0x1e345e){logger[_0x6c0f('0x34')](_0x6c0f('0x35'),JSON[_0x6c0f('0x36')](_0x1e345e));return rp(_[_0x6c0f('0x6')](_0x1e345e,{'method':_0x6c0f('0x37'),'headers':headers,'json':!![]}));}function getTags(_0x1aa513,_0x3af8da){var _0xe32758=[];if(_0x1aa513&&_0x1aa513[_0x6c0f('0x28')]>0x0){_0xe32758=_[_0x6c0f('0x38')](_0x1aa513,_0x3af8da);}return _0xe32758;}function getCustomFields(_0x52bed7,_0x5d9975){var _0x5e75df=[];var _0x17d43d={'custom_fields':[]};if(_0x52bed7[_0x6c0f('0x28')]>0x0){_[_0x6c0f('0x39')](_0x52bed7,function(_0x57d6ff){if(_['includes']([_0x6c0f('0x3a'),_0x6c0f('0x3b')],_0x57d6ff[_0x6c0f('0x3c')])&&_0x57d6ff[_0x6c0f('0x3d')]&&!_0x57d6ff[_0x6c0f('0x3e')]){_0x17d43d[_0x57d6ff[_0x6c0f('0x3d')]['toLowerCase']()]=_0x57d6ff[_0x6c0f('0x3f')][_0x6c0f('0x40')]();}else if(_[_0x6c0f('0x41')](['string',_0x6c0f('0x3b')],_0x57d6ff[_0x6c0f('0x3c')])&&_0x57d6ff['idField']&&_0x57d6ff[_0x6c0f('0x3e')]){_0x17d43d[_0x6c0f('0x42')]['push']({'id':_0x57d6ff['idField'],'value':_0x57d6ff['content'][_0x6c0f('0x40')]()});}else if(_0x57d6ff['type']===_0x6c0f('0x43')&&_0x57d6ff['variableName']&&_0x57d6ff[_0x6c0f('0x44')]&&_0x57d6ff[_0x6c0f('0x3e')]){_0x5d9975[_0x57d6ff['variableName']]&&_0x17d43d[_0x6c0f('0x42')]['push']({'id':_0x57d6ff[_0x6c0f('0x44')],'value':_0x5d9975[_0x57d6ff[_0x6c0f('0x45')]][_0x6c0f('0x40')]()});}else if(_0x57d6ff['type']===_0x6c0f('0x46')&&_0x57d6ff['Variable']&&_0x57d6ff['Variable'][_0x6c0f('0x12')]&&_0x57d6ff[_0x6c0f('0x44')]&&_0x57d6ff[_0x6c0f('0x3e')]){_0x5d9975[_0x57d6ff[_0x6c0f('0x47')][_0x6c0f('0x12')][_0x6c0f('0x48')]()]&&_0x17d43d['custom_fields'][_0x6c0f('0x49')]({'id':_0x57d6ff[_0x6c0f('0x44')],'value':_0x5d9975[_0x57d6ff['Variable'][_0x6c0f('0x12')][_0x6c0f('0x48')]()][_0x6c0f('0x40')]()});}});}return _0x17d43d;}exports[_0x6c0f('0x4a')]=function(_0x24469e,_0x29f6bc,_0x4615c2,_0x44b9fa,_0x4e02f1,_0x128d32){var _0x5aa653,_0x50678e;_0x128d32[_0x6c0f('0xe')]=intUtil[_0x6c0f('0x4b')](_0x128d32[_0x6c0f('0xe')]);_0x128d32['serverUrl']=intUtil[_0x6c0f('0x4b')](_0x128d32['serverUrl']);if(_0x4e02f1&&_0x4e02f1[_0x6c0f('0x4c')]){logger['info'](_0x6c0f('0x4d'),'Recording\x20is\x20enabled!');_0x29f6bc[_0x6c0f('0x4e')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x128d32['serverUrl'],_0x29f6bc[_0x6c0f('0x4f')],md5(_0x29f6bc[_0x6c0f('0x4f')]));}else{_0x29f6bc[_0x6c0f('0x4e')]='';}headers['Authorization']=getAuth(_0x128d32);return getUser(_0x128d32,_0x44b9fa[_0x6c0f('0x50')])[_0x6c0f('0x23')](function(_0x29a0c5){_0x5aa653=_0x29a0c5;logger[_0x6c0f('0xa')](_0x6c0f('0x51'),_0x5aa653['id']);return getEndUser(_0x128d32,_0x29f6bc[_0x6c0f('0x52')],_0x29f6bc[_0x6c0f('0x53')]);})[_0x6c0f('0x23')](function(_0x1f1509){_0x50678e=_0x1f1509;logger[_0x6c0f('0xa')](_0x6c0f('0x54'),_0x50678e['id']);return getTicket(_0x128d32,_0x5aa653,_0x50678e,_0x4615c2,_0x29f6bc);})[_0x6c0f('0x23')](function(_0x3d2d37){if(_0x3d2d37){logger[_0x6c0f('0xa')](_0x6c0f('0x55'),_0x3d2d37['id']);switch(_0x128d32[_0x6c0f('0x3c')]){case _0x6c0f('0x56'):logger[_0x6c0f('0xa')](_0x6c0f('0x4d'),_0x6c0f('0x57'));return request({'uri':util[_0x6c0f('0xc')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x128d32['remoteUri'],_0x5aa653['id'],_0x3d2d37['id']),'method':'POST'});case'newTab':logger[_0x6c0f('0xa')](_0x6c0f('0x4d'),_0x6c0f('0x58'));emit(util[_0x6c0f('0xc')](_0x6c0f('0x59'),_0x44b9fa['name']),_0x6c0f('0x5a'),{'uri':util[_0x6c0f('0xc')]('%s/agent/tickets/%s',_0x128d32[_0x6c0f('0xe')][_0x6c0f('0x5b')](_0x6c0f('0x5c'),''),_0x3d2d37['id'])});break;default:logger['error']('[QUEUE]',_0x6c0f('0x5d'));}}})[_0x6c0f('0x5e')](function(_0x1cfe52){logger['error'](_0x6c0f('0x5f'),util[_0x6c0f('0x60')](_0x1cfe52,{'showHidden':!![],'depth':null}));});};exports['outbound']=function(_0x23f30b,_0x2306ba,_0x47d32a,_0x3783d1,_0xcd9afc,_0x2aef17,_0x53276b){var _0x5a00f8,_0x4b196e;_0x2aef17[_0x6c0f('0xe')]=intUtil[_0x6c0f('0x4b')](_0x2aef17[_0x6c0f('0xe')]);_0x2aef17[_0x6c0f('0x61')]=intUtil[_0x6c0f('0x4b')](_0x2aef17[_0x6c0f('0x61')]);if(_0x53276b&&_0x53276b[_0x6c0f('0x62')]&&_0x53276b['recordingFormat']!=='none'){logger[_0x6c0f('0xa')](_0x6c0f('0x63'),_0x6c0f('0x64'));_0x2306ba[_0x6c0f('0x4e')]=util[_0x6c0f('0xc')](_0x6c0f('0x65'),_0x2aef17[_0x6c0f('0x61')],_0x2306ba[_0x6c0f('0x4f')],md5(_0x2306ba[_0x6c0f('0x4f')]));}headers[_0x6c0f('0x66')]=getAuth(_0x2aef17);return getUser(_0x2aef17,_0x3783d1[_0x6c0f('0x50')])[_0x6c0f('0x23')](function(_0x543e9b){_0x5a00f8=_0x543e9b;logger[_0x6c0f('0xa')](_0x6c0f('0x51'),_0x5a00f8['id']);return getEndUser(_0x2aef17,_0x2306ba[_0x6c0f('0x67')],_0x2306ba[_0x6c0f('0x68')]);})[_0x6c0f('0x23')](function(_0xd986c){_0x4b196e=_0xd986c;logger[_0x6c0f('0xa')]('The\x20Enduser\x20ID\x20is:',_0x4b196e['id']);return getTicket(_0x2aef17,_0x5a00f8,_0x4b196e,_0x47d32a,_0x2306ba);})[_0x6c0f('0x23')](function(_0x142fc5){if(_0x142fc5){logger['info'](_0x6c0f('0x55'),_0x142fc5['id']);switch(_0x2aef17['type']){case _0x6c0f('0x56'):logger[_0x6c0f('0xa')](_0x6c0f('0x63'),_0x6c0f('0x57'));return request({'uri':util[_0x6c0f('0xc')](_0x6c0f('0x69'),_0x2aef17[_0x6c0f('0xe')],_0x5a00f8['id'],_0x142fc5['id']),'method':_0x6c0f('0xf')});case _0x6c0f('0x6a'):logger['info'](_0x6c0f('0x63'),_0x6c0f('0x58'));emit(util[_0x6c0f('0xc')]('user:%s',_0x3783d1[_0x6c0f('0x12')]),'trigger:browser:url',{'uri':util[_0x6c0f('0xc')]('%s/agent/tickets/%s',_0x2aef17[_0x6c0f('0xe')][_0x6c0f('0x5b')](_0x6c0f('0x5c'),''),_0x142fc5['id'])});break;default:logger[_0x6c0f('0x6b')](_0x6c0f('0x63'),_0x6c0f('0x5d'));}}})['catch'](function(_0x453340){logger[_0x6c0f('0x6b')](_0x6c0f('0x6c'),util[_0x6c0f('0x60')](_0x453340,{'showHidden':!![],'depth':null}));});};exports['unmanaged']=function(_0x228b61,_0x2d49ef,_0x33e089,_0x3905fb,_0x272ba0,_0x4e7d1f){var _0x307c80,_0xbc5fb8;_0x4e7d1f['remoteUri']=intUtil[_0x6c0f('0x4b')](_0x4e7d1f[_0x6c0f('0xe')]);_0x4e7d1f[_0x6c0f('0x61')]=intUtil[_0x6c0f('0x4b')](_0x4e7d1f[_0x6c0f('0x61')]);if(_0x272ba0&&_0x272ba0[_0x6c0f('0x4c')]){logger[_0x6c0f('0xa')]('['+_0x2d49ef[_0x6c0f('0x6d')][_0x6c0f('0x6e')]()+']',_0x6c0f('0x64'));_0x2d49ef[_0x6c0f('0x4e')]=util[_0x6c0f('0xc')](_0x6c0f('0x65'),_0x4e7d1f[_0x6c0f('0x61')],_0x2d49ef[_0x6c0f('0x4f')],md5(_0x2d49ef[_0x6c0f('0x4f')]));}else{_0x2d49ef[_0x6c0f('0x4e')]='';}headers[_0x6c0f('0x66')]=getAuth(_0x4e7d1f);return getUser(_0x4e7d1f)[_0x6c0f('0x23')](function(_0x24c00f){_0x307c80=_0x24c00f;logger[_0x6c0f('0xa')](_0x6c0f('0x51'),_0x307c80['id']);return getEndUser(_0x4e7d1f,_0x2d49ef['calleridname'],_0x2d49ef[_0x6c0f('0x53')]);})['then'](function(_0x591518){_0xbc5fb8=_0x591518;logger[_0x6c0f('0xa')](_0x6c0f('0x54'),_0xbc5fb8['id']);return getTicket(_0x4e7d1f,_0x307c80,_0xbc5fb8,_0x33e089,_0x2d49ef);})['then'](function(_0x25687f){if(_0x25687f){logger[_0x6c0f('0xa')]('The\x20Ticket\x20ID\x20is:',_0x25687f['id']);}})[_0x6c0f('0x5e')](function(_0x155e9c){logger[_0x6c0f('0x6b')]('['+_0x2d49ef[_0x6c0f('0x6d')]['toUpperCase']()+']'+_0x6c0f('0x6f'),util[_0x6c0f('0x60')](_0x155e9c,{'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 5fbbae2..9f3bd8a 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 _0x5965=['variable','variableName','toString','Variable','name','toLowerCase','indexOf','isNil','expires_in','access_token','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','POST','/oauth/v2/token','clientId','clientSecret','refresh_token','then','seconds','catch','stack','info','Search\x20user','GET','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','error','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','https://www.zohoapis.','/crm/v2/','moduleCreate','role','first_name','last_name','code','SUCCESS','details','enduserType','startCase','Error:\x20','log','contact_lead','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','contact','Contacts','lead','Creating\x20new\x20call...','administrator','Subject','getString','Subjects','Description','Who_Id','Full_Name','First_Name','Last_Name','What_Id','talktime','Call_Duration','utc','format','mm:ss','endtime','YYYY-MM-DDTHH:mm:ss','starttime','lastevent','Call_Result','Called','Answered','rejected','Rejected','abandoned','Abandoned','timeout','Timeout','outbound','agentcalledAt','Call_Type','Inbound','merge','Fields','Call\x20created!','err','host','stripTrailingSlash','serverUrl','monitor_format','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','/downloads?type=uniqueid&token=','com','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Call\x20ID\x20is:','[QUEUE]','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','[OUTBOUND]','uniqueid','destcalleridname','destcalleridnum','Outbound','unmanaged','zoho.eu','toUpperCase','lodash','request-promise','md5','util','./util','moment','ioredis','bluebird','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','debug','[HTTP]','forEach','includes','picklist','idField','content','type'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5965,0x1ac));var _0x5596=function(_0xe1336b,_0x3f3130){_0xe1336b=_0xe1336b-0x0;var _0x1cf4b2=_0x5965[_0xe1336b];return _0x1cf4b2;};'use strict';var _=require(_0x5596('0x0'));var rp=require(_0x5596('0x1'));var md5=require(_0x5596('0x2'));var util=require(_0x5596('0x3'));var intUtil=require(_0x5596('0x4'));var moment=require(_0x5596('0x5'));var Redis=require(_0x5596('0x6'));var BPromise=require(_0x5596('0x7'));var config=require(_0x5596('0x8'));var logger=require(_0x5596('0x9'))('zoho');config[_0x5596('0xa')]=_[_0x5596('0xb')](config['redis'],{'host':_0x5596('0xc'),'port':0x18eb});var io=require(_0x5596('0xd'))(new Redis(config[_0x5596('0xa')]));function emit(_0x4c2f27,_0x50a368,_0x19fc22){io['to'](_0x4c2f27)['emit'](_0x50a368,_0x19fc22);}function request(_0x9d5456){logger[_0x5596('0xe')](_0x5596('0xf'),JSON['stringify'](_0x9d5456));return rp(_0x9d5456);}function getCustomFields(_0x2118b7,_0x2b5f3e){var _0x952b0e={};if(_0x2118b7['length']>0x0){_[_0x5596('0x10')](_0x2118b7,function(_0x2bdfdd){if(_[_0x5596('0x11')](['string',_0x5596('0x12')],_0x2bdfdd['type'])&&_0x2bdfdd[_0x5596('0x13')]){_0x952b0e[_0x2bdfdd['idField']]=_0x2bdfdd[_0x5596('0x14')]['toString']();}else if(_0x2bdfdd[_0x5596('0x15')]===_0x5596('0x16')&&_0x2bdfdd[_0x5596('0x17')]&&_0x2bdfdd[_0x5596('0x13')]&&_0x2b5f3e[_0x2bdfdd[_0x5596('0x17')]]){_0x952b0e[_0x2bdfdd['idField']]=_0x2b5f3e[_0x2bdfdd[_0x5596('0x17')]][_0x5596('0x18')]();}else if(_0x2bdfdd[_0x5596('0x15')]==='customVariable'&&_0x2bdfdd[_0x5596('0x19')]&&_0x2bdfdd['Variable'][_0x5596('0x1a')]&&_0x2bdfdd[_0x5596('0x13')]&&_0x2b5f3e[_0x2bdfdd[_0x5596('0x19')]['name'][_0x5596('0x1b')]()]){_0x952b0e[_0x2bdfdd[_0x5596('0x13')]]=_0x2b5f3e[_0x2bdfdd[_0x5596('0x19')]['name']['toLowerCase']()]['toString']();}});}return _0x952b0e;}function getName(_0x3fe6c0){if(_0x3fe6c0[_0x5596('0x1c')]('\x20')>0x0){var _0x4a5190=_0x3fe6c0['split'](/ (.+)/);if(_0x4a5190[0x1]){return _0x4a5190;}}return[_0x3fe6c0,_0x3fe6c0];}var accountsTokens={};function getAccessToken(_0x4c0386){return new Promise(function(_0x2ae8d2,_0x130dee){if(!_[_0x5596('0x1d')](accountsTokens[_0x4c0386['id']])&&!_[_0x5596('0x1d')](accountsTokens[_0x4c0386['id']]['access_token'])){if(moment()['isBefore'](accountsTokens[_0x4c0386['id']][_0x5596('0x1e')])){_0x2ae8d2(accountsTokens[_0x4c0386['id']][_0x5596('0x1f')]);}}var _0x1b3bf3;switch(_0x4c0386['zone']){case'US':_0x1b3bf3=_0x5596('0x20');break;case'AU':_0x1b3bf3=_0x5596('0x21');break;case'EU':_0x1b3bf3=_0x5596('0x22');break;case'IN':_0x1b3bf3='https://accounts.zoho.in';break;case'CN':_0x1b3bf3='https://accounts.zoho.com.cn';break;default:_0x1b3bf3='https://accounts.zoho.eu';break;}var _0x26da30={'method':_0x5596('0x23'),'uri':_0x1b3bf3+_0x5596('0x24'),'qs':{'refresh_token':_0x4c0386['refreshToken'],'client_id':_0x4c0386[_0x5596('0x25')],'client_secret':_0x4c0386[_0x5596('0x26')],'grant_type':_0x5596('0x27')},'json':!![]};return rp(_0x26da30)[_0x5596('0x28')](function(_0x7b0e1){accountsTokens[_0x4c0386['id']]={'access_token':_0x7b0e1[_0x5596('0x1f')],'expires_in':moment()['add'](_0x7b0e1[_0x5596('0x1e')],_0x5596('0x29'))};_0x2ae8d2(_0x7b0e1[_0x5596('0x1f')]);})[_0x5596('0x2a')](function(_0x2a2d1f){logger['error']('Failing\x20creating\x20the\x20access_token',_0x2a2d1f[_0x5596('0x2b')]);_0x130dee(_0x2a2d1f);});});}function getUser(_0x1cbb4f,_0x1864c7,_0x19c8c5,_0x181d42){logger[_0x5596('0x2c')](_0x5596('0x2d'));return request({'method':_0x5596('0x2e'),'uri':util['format'](_0x5596('0x2f'),_0x1864c7),'qs':{'type':_0x5596('0x30')},'headers':{'Authorization':_0x5596('0x31')+_0x1cbb4f},'json':!![]})[_0x5596('0x28')](function(_0x3676f7){if(_0x3676f7[_0x5596('0x32')]){var _0xd1b789=-0x1;if(_[_0x5596('0x33')](_0x3676f7['users'])){if(!_[_0x5596('0x1d')](_0x181d42)){_0xd1b789=_[_0x5596('0x34')](_0x3676f7[_0x5596('0x32')],function(_0x3d3b73){return _0x3d3b73[_0x5596('0x35')]===_0x181d42;});}if(_0xd1b789>=0x0){logger['info']('Agent\x20found!');}else{logger[_0x5596('0x2c')](_0x5596('0x36'));_0xd1b789=_[_0x5596('0x34')](_0x3676f7[_0x5596('0x32')],function(_0x29d77e){return _0x29d77e[_0x5596('0x37')][_0x5596('0x1a')]===_0x5596('0x38');});}return _0x3676f7[_0x5596('0x32')][_0xd1b789];}else{if(_0x3676f7['user'][_0x5596('0x37')][_0x5596('0x1a')]===_0x5596('0x38')){logger[_0x5596('0x2c')]('Using\x20the\x20admin\x20account!');user=_0x3676f7['user'];return user;}else{logger['error'](_0x5596('0x39'),JSON[_0x5596('0x3a')](_0x3676f7));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0x5596('0x3a')](_0x3676f7));}}}else{logger[_0x5596('0x3b')]('The\x20failing\x20result\x20is',JSON[_0x5596('0x3a')](_0x3676f7));throw new Error(_0x5596('0x3c')+JSON[_0x5596('0x3a')](_0x3676f7));}})['catch'](function(_0x1d5b4a){console[_0x5596('0x3b')](_0x1d5b4a);});}function getZohoUser(_0x1cf6a6,_0x9ab6f4){return new BPromise(function(_0x46d067,_0x1beeab){request(_0x1cf6a6)['then'](function(_0x56c4bc){var _0x3450be=null;if(_0x56c4bc){_0x3450be=_0x56c4bc[_0x5596('0x3d')][0x0];_0x3450be['enduserType']=_0x9ab6f4;}_0x46d067(_0x3450be);})[_0x5596('0x2a')](function(_0x7099a8){_0x1beeab(_0x7099a8);});});}function createEndUser(_0x56e0b7,_0x37bcb6,_0x5633ee,_0x2f6c58,_0x41db82,_0x31123c){var _0x5633ee=getName(_0x5633ee);return request({'method':'POST','uri':_0x5596('0x3e')+_0x37bcb6+_0x5596('0x3f')+_['startCase'](_0x31123c[_0x5596('0x40')])+'s','body':{'data':[{'Last_Name':_0x5633ee[0x1],'First_Name':_0x5633ee[0x0],'Phone':_0x2f6c58,'Owner':{'name':!_[_0x5596('0x1d')](_0x41db82[_0x5596('0x41')][_0x5596('0x1a')])?_0x41db82[_0x5596('0x41')][_0x5596('0x1a')]:!_[_0x5596('0x1d')](_0x41db82['first_name'])?_0x41db82[_0x5596('0x42')]+'\x20'+_0x41db82[_0x5596('0x43')]:_0x41db82[_0x5596('0x43')],'id':_0x41db82['id']}}]},'headers':{'Authorization':_0x5596('0x31')+_0x56e0b7},'json':!![]})['then'](function(_0xe9bf27){if(_0xe9bf27&&_0xe9bf27[_0x5596('0x3d')][0x0][_0x5596('0x44')]===_0x5596('0x45')){var _0x183387=_0xe9bf27[_0x5596('0x3d')][0x0][_0x5596('0x46')];_0x183387[_0x5596('0x47')]=_[_0x5596('0x48')](_0x31123c[_0x5596('0x40')])+'s';return _0x183387;}logger['error']('The\x20failing\x20result\x20is',JSON[_0x5596('0x3a')](data));throw new Error(_0x5596('0x49')+JSON[_0x5596('0x3a')](data));})['catch'](function(_0x4bebfb){console[_0x5596('0x4a')]('CREATE\x20ERROR',_0x4bebfb);});}function getEndUser(_0x266dea,_0x359547,_0x51e0c3,_0x5b6ce4,_0x46ce5f,_0x1daba3,_0x45f90b){var _0x3b8f5b={'method':_0x5596('0x2e'),'uri':'','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x266dea},'json':!![]};switch(_0x45f90b['moduleSearch']){case _0x5596('0x4b'):_0x3b8f5b[_0x5596('0x4c')]='https://www.zohoapis.'+_0x359547+_0x5596('0x4d')+_0x46ce5f+'))';return getZohoUser(_0x3b8f5b,'Contacts')['then'](function(_0x12b553){if(_0x12b553)return _0x12b553;_0x3b8f5b[_0x5596('0x4c')]='https://www.zohoapis.'+_0x359547+_0x5596('0x4e')+_0x46ce5f+'))';return getZohoUser(_0x3b8f5b,_0x5596('0x4f'))[_0x5596('0x28')](function(_0xce378b){if(_0xce378b)return _0xce378b;if(_0x45f90b[_0x5596('0x40')]!=_0x5596('0x50')){return createEndUser(_0x266dea,_0x359547,_0x5b6ce4,_0x46ce5f,_0x1daba3,_0x45f90b);}else{return{};}});});break;case _0x5596('0x51'):_0x3b8f5b[_0x5596('0x4c')]=_0x5596('0x3e')+_0x359547+_0x5596('0x4d')+_0x46ce5f+'))';return getZohoUser(_0x3b8f5b,_0x5596('0x52'))[_0x5596('0x28')](function(_0x5cb096){if(_0x5cb096)return _0x5cb096;if(_0x45f90b[_0x5596('0x40')]!=_0x5596('0x50')){return createEndUser(_0x266dea,_0x359547,_0x5b6ce4,_0x46ce5f,_0x1daba3,_0x45f90b);}else{return{};}});break;case _0x5596('0x53'):_0x3b8f5b[_0x5596('0x4c')]=_0x5596('0x3e')+_0x359547+_0x5596('0x4e')+_0x46ce5f+'))';return getZohoUser(_0x3b8f5b,_0x5596('0x4f'))[_0x5596('0x28')](function(_0x354727){if(_0x354727)return _0x354727;if(_0x45f90b[_0x5596('0x40')]!=_0x5596('0x50')){return createEndUser(_0x266dea,_0x359547,_0x5b6ce4,_0x46ce5f,_0x1daba3,_0x45f90b);}else{return{};}});break;}}function getCall(_0x13122d,_0x4b95cb,_0x3c291e,_0x2d3c2b,_0x4058ee,_0x158cdf,_0xb570bf,_0x497e40){logger[_0x5596('0x2c')](_0x5596('0x54'));var _0x7f2f76={};_0x7f2f76['Owner']={'name':!_[_0x5596('0x1d')](_0x2d3c2b[_0x5596('0x41')][_0x5596('0x1a')])&&!_[_0x5596('0x1d')](_0x2d3c2b[_0x5596('0x37')]['name'])&&_0x2d3c2b[_0x5596('0x37')][_0x5596('0x1a')]===_0x5596('0x55')?_0x2d3c2b['role'][_0x5596('0x1a')]:!_[_0x5596('0x1d')](_0x2d3c2b['first_name'])?_0x2d3c2b['first_name']+'\x20'+_0x2d3c2b[_0x5596('0x43')]:_0x2d3c2b[_0x5596('0x43')],'id':_0x2d3c2b['id']};_0x7f2f76[_0x5596('0x56')]=intUtil[_0x5596('0x57')](_0x158cdf[_0x5596('0x58')],_0xb570bf,'\x20');_0x7f2f76[_0x5596('0x59')]=intUtil[_0x5596('0x57')](_0x158cdf['Descriptions'],_0xb570bf,'\x0a');if(_0x4058ee[_0x5596('0x47')]===_0x5596('0x52')){_0x7f2f76[_0x5596('0x5a')]={'name':!_[_0x5596('0x1d')](_0x4058ee[_0x5596('0x5b')])?_0x4058ee[_0x5596('0x5b')]:!_['isNil'](_0x4058ee['First_Name'])?_0x4058ee[_0x5596('0x5c')]+'\x20'+_0x4058ee['Last_Name']:_0x4058ee[_0x5596('0x5d')],'id':_0x4058ee['id']};}if(_0x4058ee[_0x5596('0x47')]===_0x5596('0x4f')){_0x7f2f76[_0x5596('0x5e')]={'name':!_[_0x5596('0x1d')](_0x4058ee[_0x5596('0x5b')])?_0x4058ee[_0x5596('0x5b')]:!_['isNil'](_0x4058ee['First_Name'])?_0x4058ee[_0x5596('0x5c')]+'\x20'+_0x4058ee[_0x5596('0x5d')]:_0x4058ee['Last_Name'],'id':_0x4058ee['id']};_0x7f2f76['$se_module']=_[_0x5596('0x48')](_0x4058ee['enduserType']);}if(_0xb570bf[_0x5596('0x5f')]){_0x7f2f76[_0x5596('0x60')]=moment[_0x5596('0x61')](parseInt(_0xb570bf[_0x5596('0x5f')])*0x3e8)[_0x5596('0x62')](_0x5596('0x63'));}else if(_0xb570bf['answertime']&&_0xb570bf[_0x5596('0x64')]){_0x7f2f76[_0x5596('0x60')]=moment[_0x5596('0x61')](moment(_0xb570bf[_0x5596('0x64')],_0x5596('0x65'))['diff'](moment(_0xb570bf[_0x5596('0x66')],_0x5596('0x65'))))['format'](_0x5596('0x63'));}switch(_0xb570bf[_0x5596('0x67')]){case'called':_0x7f2f76[_0x5596('0x68')]=_0x5596('0x69');break;case'complete':case'connect':_0x7f2f76[_0x5596('0x68')]=_0x5596('0x6a');break;case _0x5596('0x6b'):_0x7f2f76[_0x5596('0x68')]=_0x5596('0x6c');break;case _0x5596('0x6d'):_0x7f2f76[_0x5596('0x68')]=_0x5596('0x6e');break;case _0x5596('0x6f'):_0x7f2f76['Call_Result']=_0x5596('0x70');default:}_0x7f2f76['Call_Start_Time']=(_0x497e40===_0x5596('0x71')?moment(_0xb570bf[_0x5596('0x66')])[_0x5596('0x62')](_0x5596('0x65')):moment(_0xb570bf[_0x5596('0x72')])[_0x5596('0x62')](_0x5596('0x65')))||moment()[_0x5596('0x62')](_0x5596('0x65'));_0x7f2f76[_0x5596('0x73')]=_0x497e40||_0x5596('0x74');_0x7f2f76=_[_0x5596('0x75')](_0x7f2f76,getCustomFields(_0x158cdf[_0x5596('0x76')],_0xb570bf));return request({'method':_0x5596('0x23'),'uri':'https://www.zohoapis.'+_0x4b95cb+'/crm/v2/Calls','headers':{'Authorization':_0x5596('0x31')+_0x13122d},'body':{'data':[_0x7f2f76]},'json':!![]})[_0x5596('0x28')](function(_0x5503c8){if(_0x5503c8&&_0x5503c8['data'][0x0][_0x5596('0x44')]===_0x5596('0x45')){logger[_0x5596('0x2c')](_0x5596('0x77'));return{'id':_0x5503c8[_0x5596('0x3d')][0x0][_0x5596('0x46')]['id']};}})[_0x5596('0x2a')](function(_0x21d54c){logger['info'](_0x5596('0x78'),_0x21d54c[_0x5596('0x2b')]);console[_0x5596('0x4a')](_0x5596('0x78'),_0x21d54c);});}exports['queue']=function(_0x28cadd,_0x499478,_0x31dc14,_0x241b57,_0x1301ba,_0x2b0b1b){var _0x581c5e,_0x14fb3b,_0x59824e;_0x2b0b1b[_0x5596('0x79')]=intUtil[_0x5596('0x7a')](_0x2b0b1b[_0x5596('0x79')]);_0x2b0b1b[_0x5596('0x7b')]=intUtil[_0x5596('0x7a')](_0x2b0b1b[_0x5596('0x7b')]);if(_0x1301ba&&_0x1301ba[_0x5596('0x7c')]){logger[_0x5596('0x2c')]('[QUEUE]',_0x5596('0x7d'));_0x499478[_0x5596('0x7e')]=_0x2b0b1b['serverUrl']+_0x5596('0x7f')+_0x499478['uniqueid']+_0x5596('0x80')+md5(_0x499478['uniqueid']);}else{_0x499478[_0x5596('0x7e')]='';}var _0x35302a=_0x2b0b1b[_0x5596('0x79')]==='zoho.eu'?'eu':_0x5596('0x81');return getAccessToken(_0x2b0b1b)['then'](function(_0x3e98a8){_0x59824e=_0x3e98a8;return getUser(_0x59824e,_0x35302a,_0x2b0b1b,_0x241b57[_0x5596('0x35')]);})[_0x5596('0x28')](function(_0x5ba0c1){_0x581c5e=_0x5ba0c1;logger[_0x5596('0x2c')](_0x5596('0x82'),_0x581c5e['id']);return getEndUser(_0x59824e,_0x35302a,_0x2b0b1b,_0x499478[_0x5596('0x83')],_0x499478[_0x5596('0x84')],_0x581c5e,_0x31dc14);})['then'](function(_0xb27f0){_0x14fb3b=_0xb27f0;return getCall(_0x59824e,_0x35302a,_0x2b0b1b,_0x581c5e,_0x14fb3b,_0x31dc14,_0x499478,_0x5596('0x74'));})[_0x5596('0x28')](function(_0x16c2c7){if(_0x16c2c7){logger[_0x5596('0x2c')](_0x5596('0x85'),_0x16c2c7['id']);logger[_0x5596('0x2c')](_0x5596('0x86'),_0x5596('0x87'));emit(util[_0x5596('0x62')](_0x5596('0x88'),_0x241b57[_0x5596('0x1a')]),_0x5596('0x89'),{'uri':_0x5596('0x8a')+_0x2b0b1b['host']+_0x5596('0x8b')+_0x16c2c7['id']});}})[_0x5596('0x2a')](function(_0x44153b){logger[_0x5596('0x3b')](_0x5596('0x86'),JSON['stringify'](_0x44153b));});};exports[_0x5596('0x71')]=function(_0x4145fe,_0x37ae90,_0xe1e4b4,_0x58efce,_0xe77da,_0x32ba16,_0x50cfea){var _0x3b6f9a,_0x55ed0e,_0x4bd511;_0x32ba16[_0x5596('0x79')]=intUtil[_0x5596('0x7a')](_0x32ba16['host']);_0x32ba16[_0x5596('0x7b')]=intUtil[_0x5596('0x7a')](_0x32ba16[_0x5596('0x7b')]);if(_0x50cfea&&_0x50cfea['recordingFormat']&&_0x50cfea[_0x5596('0x8c')]!==_0x5596('0x8d')){logger[_0x5596('0x2c')](_0x5596('0x8e'),'Recording\x20is\x20enabled!');_0x37ae90[_0x5596('0x7e')]=_0x32ba16[_0x5596('0x7b')]+_0x5596('0x7f')+_0x37ae90[_0x5596('0x8f')]+'/downloads?type=uniqueid&token='+md5(_0x37ae90[_0x5596('0x8f')]);}var _0xfa352b=_0x32ba16['host']==='zoho.eu'?'eu':_0x5596('0x81');return getAccessToken(_0x32ba16)['then'](function(_0x2d174f){_0x4bd511=_0x2d174f;return getUser(_0x4bd511,_0xfa352b,_0x32ba16,_0x58efce[_0x5596('0x35')]);})[_0x5596('0x28')](function(_0x44a8fb){_0x3b6f9a=_0x44a8fb;logger['info'](_0x5596('0x82'),_0x3b6f9a['id']);return getEndUser(_0x4bd511,_0xfa352b,_0x32ba16,_0x37ae90[_0x5596('0x90')],_0x37ae90[_0x5596('0x91')],_0x3b6f9a,_0xe1e4b4);})['then'](function(_0x20f02a){_0x55ed0e=_0x20f02a;return getCall(_0x4bd511,_0xfa352b,_0x32ba16,_0x3b6f9a,_0x55ed0e,_0xe1e4b4,_0x37ae90,_0x5596('0x92'));})[_0x5596('0x28')](function(_0x856c19){if(_0x856c19){logger[_0x5596('0x2c')](_0x5596('0x85'),_0x856c19['id']);logger[_0x5596('0x2c')](_0x5596('0x8e'),_0x5596('0x87'));emit(util[_0x5596('0x62')](_0x5596('0x88'),_0x58efce[_0x5596('0x1a')]),_0x5596('0x89'),{'uri':_0x5596('0x8a')+_0x32ba16[_0x5596('0x79')]+_0x5596('0x8b')+_0x856c19['id']});}})[_0x5596('0x2a')](function(_0x33a75a){logger[_0x5596('0x3b')]('[OUTBOUND]',JSON[_0x5596('0x3a')](_0x33a75a));});};exports[_0x5596('0x93')]=function(_0x2795f3,_0x3ff57a,_0x14ae17,_0x6f78ed,_0x302f86,_0x4eaf42){var _0x19eac7,_0x5df9e4,_0x32561a;_0x4eaf42[_0x5596('0x79')]=intUtil['stripTrailingSlash'](_0x4eaf42[_0x5596('0x79')]);_0x4eaf42[_0x5596('0x7b')]=intUtil[_0x5596('0x7a')](_0x4eaf42[_0x5596('0x7b')]);if(_0x302f86&&_0x302f86['monitor_format']){logger[_0x5596('0x2c')]('['+_0x3ff57a[_0x5596('0x67')]['toUpperCase']()+']',_0x5596('0x7d'));_0x3ff57a[_0x5596('0x7e')]=_0x4eaf42[_0x5596('0x7b')]+_0x5596('0x7f')+_0x3ff57a['uniqueid']+_0x5596('0x80')+md5(_0x3ff57a['uniqueid']);}else{_0x3ff57a[_0x5596('0x7e')]='';}var _0x2fb54d=_0x4eaf42['host']===_0x5596('0x94')?'eu':_0x5596('0x81');return getAccessToken(_0x4eaf42)[_0x5596('0x28')](function(_0x3dd983){_0x32561a=_0x3dd983;return getUser(_0x32561a,_0x2fb54d,_0x4eaf42);})[_0x5596('0x28')](function(_0x1cefb9){_0x19eac7=_0x1cefb9;logger[_0x5596('0x2c')](_0x5596('0x82'),_0x19eac7['id']);return getEndUser(_0x32561a,_0x2fb54d,_0x4eaf42,_0x3ff57a[_0x5596('0x83')],_0x3ff57a[_0x5596('0x84')],_0x19eac7,_0x14ae17);})['then'](function(_0x36d1fb){_0x5df9e4=_0x36d1fb;return getCall(_0x32561a,_0x2fb54d,_0x4eaf42,_0x19eac7,_0x5df9e4,_0x14ae17,_0x3ff57a,'Inbound');})[_0x5596('0x28')](function(_0x4765c7){if(_0x4765c7){logger['info'](_0x5596('0x85'),_0x4765c7['id']);}})[_0x5596('0x2a')](function(_0x260277){logger[_0x5596('0x3b')]('['+_0x3ff57a['lastevent'][_0x5596('0x95')]()+']',JSON[_0x5596('0x3a')](_0x260277));});}; \ No newline at end of file +var _0x9364=['Call_Result','Called','complete','rejected','Rejected','abandoned','Abandoned','Timeout','Call_Start_Time','outbound','agentcalledAt','merge','/crm/v2/Calls','details','err','stack','queue','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','zoho.eu','email','The\x20User\x20ID\x20is:','calleridname','Inbound','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','https://crm.','recordingFormat','none','/downloads?type=uniqueid&token=','destcalleridname','Outbound','[OUTBOUND]','toUpperCase','/api/voice/recordings/','com','lodash','./util','moment','ioredis','bluebird','zoho','redis','defaults','emit','debug','[HTTP]','stringify','length','forEach','includes','string','picklist','idField','content','toString','type','variable','variableName','Variable','name','toLowerCase','split','isNil','access_token','isBefore','expires_in','https://accounts.zoho.com','https://accounts.zoho.eu','https://accounts.zoho.in','POST','refreshToken','clientId','clientSecret','refresh_token','then','add','seconds','catch','error','Failing\x20creating\x20the\x20access_token','info','Search\x20user','GET','https://www.zohoapis.%s/crm/v2/users','Zoho-oauthtoken\x20','isArrayLikeObject','users','findIndex','Agent\x20found!','Using\x20the\x20admin\x20account!','Administrator','user','profile','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','https://www.zohoapis.','startCase','role','first_name','last_name','code','SUCCESS','Error:\x20','log','CREATE\x20ERROR','moduleSearch','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','moduleCreate','nothing','lead','Creating\x20new\x20call...','administrator','getString','Subjects','Description','Who_Id','Full_Name','First_Name','Last_Name','What_Id','$se_module','Call_Duration','mm:ss','answertime','utc','endtime','diff','starttime','YYYY-MM-DDTHH:mm:ss','format','lastevent','called'];(function(_0x47341f,_0x4c9dbe){var _0xbf949a=function(_0x3b308b){while(--_0x3b308b){_0x47341f['push'](_0x47341f['shift']());}};_0xbf949a(++_0x4c9dbe);}(_0x9364,0x1e5));var _0x4936=function(_0x1bef6a,_0x100258){_0x1bef6a=_0x1bef6a-0x0;var _0x41fa0e=_0x9364[_0x1bef6a];return _0x41fa0e;};'use strict';var _=require(_0x4936('0x0'));var rp=require('request-promise');var md5=require('md5');var util=require('util');var intUtil=require(_0x4936('0x1'));var moment=require(_0x4936('0x2'));var Redis=require(_0x4936('0x3'));var BPromise=require(_0x4936('0x4'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0x4936('0x5'));config[_0x4936('0x6')]=_[_0x4936('0x7')](config[_0x4936('0x6')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x4936('0x6')]));function emit(_0x4c3c38,_0x5973df,_0x1125a2){io['to'](_0x4c3c38)[_0x4936('0x8')](_0x5973df,_0x1125a2);}function request(_0xf0129f){logger[_0x4936('0x9')](_0x4936('0xa'),JSON[_0x4936('0xb')](_0xf0129f));return rp(_0xf0129f);}function getCustomFields(_0x2d3d29,_0x1421af){var _0x4f032d={};if(_0x2d3d29[_0x4936('0xc')]>0x0){_[_0x4936('0xd')](_0x2d3d29,function(_0x804e89){if(_[_0x4936('0xe')]([_0x4936('0xf'),_0x4936('0x10')],_0x804e89['type'])&&_0x804e89['idField']){_0x4f032d[_0x804e89[_0x4936('0x11')]]=_0x804e89[_0x4936('0x12')][_0x4936('0x13')]();}else if(_0x804e89[_0x4936('0x14')]===_0x4936('0x15')&&_0x804e89[_0x4936('0x16')]&&_0x804e89['idField']&&_0x1421af[_0x804e89[_0x4936('0x16')]]){_0x4f032d[_0x804e89[_0x4936('0x11')]]=_0x1421af[_0x804e89[_0x4936('0x16')]][_0x4936('0x13')]();}else if(_0x804e89['type']==='customVariable'&&_0x804e89['Variable']&&_0x804e89[_0x4936('0x17')][_0x4936('0x18')]&&_0x804e89[_0x4936('0x11')]&&_0x1421af[_0x804e89[_0x4936('0x17')]['name'][_0x4936('0x19')]()]){_0x4f032d[_0x804e89['idField']]=_0x1421af[_0x804e89[_0x4936('0x17')]['name'][_0x4936('0x19')]()]['toString']();}});}return _0x4f032d;}function getName(_0x39ee1e){if(_0x39ee1e['indexOf']('\x20')>0x0){var _0x2d1d23=_0x39ee1e[_0x4936('0x1a')](/ (.+)/);if(_0x2d1d23[0x1]){return _0x2d1d23;}}return[_0x39ee1e,_0x39ee1e];}var accountsTokens={};function getAccessToken(_0xcf4a0){return new Promise(function(_0xb0095e,_0x23c967){if(!_['isNil'](accountsTokens[_0xcf4a0['id']])&&!_[_0x4936('0x1b')](accountsTokens[_0xcf4a0['id']][_0x4936('0x1c')])){if(moment()[_0x4936('0x1d')](accountsTokens[_0xcf4a0['id']][_0x4936('0x1e')])){_0xb0095e(accountsTokens[_0xcf4a0['id']]['access_token']);}}var _0x2ef563;switch(_0xcf4a0['zone']){case'US':_0x2ef563=_0x4936('0x1f');break;case'AU':_0x2ef563='https://accounts.zoho.com.au';break;case'EU':_0x2ef563=_0x4936('0x20');break;case'IN':_0x2ef563=_0x4936('0x21');break;case'CN':_0x2ef563='https://accounts.zoho.com.cn';break;default:_0x2ef563=_0x4936('0x20');break;}var _0x3f29a7={'method':_0x4936('0x22'),'uri':_0x2ef563+'/oauth/v2/token','qs':{'refresh_token':_0xcf4a0[_0x4936('0x23')],'client_id':_0xcf4a0[_0x4936('0x24')],'client_secret':_0xcf4a0[_0x4936('0x25')],'grant_type':_0x4936('0x26')},'json':!![]};return rp(_0x3f29a7)[_0x4936('0x27')](function(_0x5ad2be){accountsTokens[_0xcf4a0['id']]={'access_token':_0x5ad2be[_0x4936('0x1c')],'expires_in':moment()[_0x4936('0x28')](_0x5ad2be[_0x4936('0x1e')],_0x4936('0x29'))};_0xb0095e(_0x5ad2be[_0x4936('0x1c')]);})[_0x4936('0x2a')](function(_0x43a7a0){logger[_0x4936('0x2b')](_0x4936('0x2c'),_0x43a7a0['stack']);_0x23c967(_0x43a7a0);});});}function getUser(_0x4702c7,_0x4c31ea,_0xc4db36,_0x20ac91){logger[_0x4936('0x2d')](_0x4936('0x2e'));return request({'method':_0x4936('0x2f'),'uri':util['format'](_0x4936('0x30'),_0x4c31ea),'qs':{'type':'ActiveUsers'},'headers':{'Authorization':_0x4936('0x31')+_0x4702c7},'json':!![]})[_0x4936('0x27')](function(_0x538a1b){if(_0x538a1b['users']){var _0x3c9f78=-0x1;if(_[_0x4936('0x32')](_0x538a1b[_0x4936('0x33')])){if(!_[_0x4936('0x1b')](_0x20ac91)){_0x3c9f78=_[_0x4936('0x34')](_0x538a1b[_0x4936('0x33')],function(_0x2009e4){return _0x2009e4['email']===_0x20ac91;});}if(_0x3c9f78>=0x0){logger[_0x4936('0x2d')](_0x4936('0x35'));}else{logger[_0x4936('0x2d')](_0x4936('0x36'));_0x3c9f78=_[_0x4936('0x34')](_0x538a1b['users'],function(_0x10274b){return _0x10274b['profile'][_0x4936('0x18')]===_0x4936('0x37');});}return _0x538a1b['users'][_0x3c9f78];}else{if(_0x538a1b[_0x4936('0x38')][_0x4936('0x39')][_0x4936('0x18')]===_0x4936('0x37')){logger[_0x4936('0x2d')](_0x4936('0x36'));user=_0x538a1b[_0x4936('0x38')];return user;}else{logger[_0x4936('0x2b')](_0x4936('0x3a'),JSON[_0x4936('0xb')](_0x538a1b));throw new Error(_0x4936('0x3b')+JSON[_0x4936('0xb')](_0x538a1b));}}}else{logger[_0x4936('0x2b')](_0x4936('0x3a'),JSON[_0x4936('0xb')](_0x538a1b));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0x4936('0xb')](_0x538a1b));}})[_0x4936('0x2a')](function(_0x48f2bf){console[_0x4936('0x2b')](_0x48f2bf);});}function getZohoUser(_0x5976f1,_0x55deb4){return new BPromise(function(_0x7087b7,_0x3f804a){request(_0x5976f1)[_0x4936('0x27')](function(_0x35c0dc){var _0x1c8542=null;if(_0x35c0dc){_0x1c8542=_0x35c0dc[_0x4936('0x3c')][0x0];_0x1c8542[_0x4936('0x3d')]=_0x55deb4;}_0x7087b7(_0x1c8542);})['catch'](function(_0x40f198){_0x3f804a(_0x40f198);});});}function createEndUser(_0x1da0c0,_0x1c6b42,_0x5c1dfa,_0xd94788,_0x49d06a,_0x166adc){var _0x5c1dfa=getName(_0x5c1dfa);return request({'method':_0x4936('0x22'),'uri':_0x4936('0x3e')+_0x1c6b42+'/crm/v2/'+_[_0x4936('0x3f')](_0x166adc['moduleCreate'])+'s','body':{'data':[{'Last_Name':_0x5c1dfa[0x1],'First_Name':_0x5c1dfa[0x0],'Phone':_0xd94788,'Owner':{'name':!_[_0x4936('0x1b')](_0x49d06a[_0x4936('0x40')]['name'])?_0x49d06a[_0x4936('0x40')]['name']:!_[_0x4936('0x1b')](_0x49d06a[_0x4936('0x41')])?_0x49d06a[_0x4936('0x41')]+'\x20'+_0x49d06a[_0x4936('0x42')]:_0x49d06a[_0x4936('0x42')],'id':_0x49d06a['id']}}]},'headers':{'Authorization':_0x4936('0x31')+_0x1da0c0},'json':!![]})['then'](function(_0x480500){if(_0x480500&&_0x480500[_0x4936('0x3c')][0x0][_0x4936('0x43')]===_0x4936('0x44')){var _0x260c39=_0x480500['data'][0x0]['details'];_0x260c39['enduserType']=_[_0x4936('0x3f')](_0x166adc['moduleCreate'])+'s';return _0x260c39;}logger[_0x4936('0x2b')](_0x4936('0x3a'),JSON[_0x4936('0xb')](data));throw new Error(_0x4936('0x45')+JSON[_0x4936('0xb')](data));})[_0x4936('0x2a')](function(_0x2f632d){console[_0x4936('0x46')](_0x4936('0x47'),_0x2f632d);});}function getEndUser(_0x4b03d2,_0x454299,_0x397c0c,_0x4fbeb5,_0xdc73b7,_0x2350fa,_0x5a2c70){var _0x4a38b2={'method':_0x4936('0x2f'),'uri':'','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x4b03d2},'json':!![]};switch(_0x5a2c70[_0x4936('0x48')]){case'contact_lead':_0x4a38b2[_0x4936('0x49')]=_0x4936('0x3e')+_0x454299+_0x4936('0x4a')+_0xdc73b7+'))';return getZohoUser(_0x4a38b2,_0x4936('0x4b'))[_0x4936('0x27')](function(_0x4330c6){if(_0x4330c6)return _0x4330c6;_0x4a38b2[_0x4936('0x49')]=_0x4936('0x3e')+_0x454299+_0x4936('0x4c')+_0xdc73b7+'))';return getZohoUser(_0x4a38b2,_0x4936('0x4d'))['then'](function(_0x3c8a78){if(_0x3c8a78)return _0x3c8a78;if(_0x5a2c70[_0x4936('0x4e')]!=_0x4936('0x4f')){return createEndUser(_0x4b03d2,_0x454299,_0x4fbeb5,_0xdc73b7,_0x2350fa,_0x5a2c70);}else{return{};}});});break;case'contact':_0x4a38b2[_0x4936('0x49')]=_0x4936('0x3e')+_0x454299+_0x4936('0x4a')+_0xdc73b7+'))';return getZohoUser(_0x4a38b2,_0x4936('0x4b'))[_0x4936('0x27')](function(_0x5b4549){if(_0x5b4549)return _0x5b4549;if(_0x5a2c70[_0x4936('0x4e')]!=_0x4936('0x4f')){return createEndUser(_0x4b03d2,_0x454299,_0x4fbeb5,_0xdc73b7,_0x2350fa,_0x5a2c70);}else{return{};}});break;case _0x4936('0x50'):_0x4a38b2['uri']=_0x4936('0x3e')+_0x454299+_0x4936('0x4c')+_0xdc73b7+'))';return getZohoUser(_0x4a38b2,'Leads')[_0x4936('0x27')](function(_0xa80bdb){if(_0xa80bdb)return _0xa80bdb;if(_0x5a2c70[_0x4936('0x4e')]!='nothing'){return createEndUser(_0x4b03d2,_0x454299,_0x4fbeb5,_0xdc73b7,_0x2350fa,_0x5a2c70);}else{return{};}});break;}}function getCall(_0x422c99,_0x4ba545,_0x5ab917,_0x25d2d3,_0x3c878c,_0x573968,_0x22de37,_0x8504fe){logger[_0x4936('0x2d')](_0x4936('0x51'));var _0x233233={};_0x233233['Owner']={'name':!_[_0x4936('0x1b')](_0x25d2d3['role'][_0x4936('0x18')])&&!_['isNil'](_0x25d2d3['profile'][_0x4936('0x18')])&&_0x25d2d3[_0x4936('0x39')][_0x4936('0x18')]===_0x4936('0x52')?_0x25d2d3[_0x4936('0x40')][_0x4936('0x18')]:!_[_0x4936('0x1b')](_0x25d2d3['first_name'])?_0x25d2d3[_0x4936('0x41')]+'\x20'+_0x25d2d3[_0x4936('0x42')]:_0x25d2d3[_0x4936('0x42')],'id':_0x25d2d3['id']};_0x233233['Subject']=intUtil[_0x4936('0x53')](_0x573968[_0x4936('0x54')],_0x22de37,'\x20');_0x233233[_0x4936('0x55')]=intUtil[_0x4936('0x53')](_0x573968['Descriptions'],_0x22de37,'\x0a');if(_0x3c878c['enduserType']===_0x4936('0x4b')){_0x233233[_0x4936('0x56')]={'name':!_[_0x4936('0x1b')](_0x3c878c[_0x4936('0x57')])?_0x3c878c[_0x4936('0x57')]:!_[_0x4936('0x1b')](_0x3c878c['First_Name'])?_0x3c878c[_0x4936('0x58')]+'\x20'+_0x3c878c['Last_Name']:_0x3c878c[_0x4936('0x59')],'id':_0x3c878c['id']};}if(_0x3c878c[_0x4936('0x3d')]===_0x4936('0x4d')){_0x233233[_0x4936('0x5a')]={'name':!_[_0x4936('0x1b')](_0x3c878c[_0x4936('0x57')])?_0x3c878c[_0x4936('0x57')]:!_['isNil'](_0x3c878c['First_Name'])?_0x3c878c[_0x4936('0x58')]+'\x20'+_0x3c878c[_0x4936('0x59')]:_0x3c878c[_0x4936('0x59')],'id':_0x3c878c['id']};_0x233233[_0x4936('0x5b')]=_[_0x4936('0x3f')](_0x3c878c[_0x4936('0x3d')]);}if(_0x22de37['talktime']){_0x233233[_0x4936('0x5c')]=moment['utc'](parseInt(_0x22de37['talktime'])*0x3e8)['format'](_0x4936('0x5d'));}else if(_0x22de37[_0x4936('0x5e')]&&_0x22de37['endtime']){_0x233233[_0x4936('0x5c')]=moment[_0x4936('0x5f')](moment(_0x22de37[_0x4936('0x60')],'YYYY-MM-DDTHH:mm:ss')[_0x4936('0x61')](moment(_0x22de37[_0x4936('0x62')],_0x4936('0x63'))))[_0x4936('0x64')]('mm:ss');}switch(_0x22de37[_0x4936('0x65')]){case _0x4936('0x66'):_0x233233[_0x4936('0x67')]=_0x4936('0x68');break;case _0x4936('0x69'):case'connect':_0x233233[_0x4936('0x67')]='Answered';break;case _0x4936('0x6a'):_0x233233[_0x4936('0x67')]=_0x4936('0x6b');break;case _0x4936('0x6c'):_0x233233[_0x4936('0x67')]=_0x4936('0x6d');break;case'timeout':_0x233233[_0x4936('0x67')]=_0x4936('0x6e');default:}_0x233233[_0x4936('0x6f')]=(_0x8504fe===_0x4936('0x70')?moment(_0x22de37[_0x4936('0x62')])['format'](_0x4936('0x63')):moment(_0x22de37[_0x4936('0x71')])[_0x4936('0x64')](_0x4936('0x63')))||moment()['format']('YYYY-MM-DDTHH:mm:ss');_0x233233['Call_Type']=_0x8504fe||'Inbound';_0x233233=_[_0x4936('0x72')](_0x233233,getCustomFields(_0x573968['Fields'],_0x22de37));return request({'method':'POST','uri':_0x4936('0x3e')+_0x4ba545+_0x4936('0x73'),'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x422c99},'body':{'data':[_0x233233]},'json':!![]})[_0x4936('0x27')](function(_0x1c9d8e){if(_0x1c9d8e&&_0x1c9d8e[_0x4936('0x3c')][0x0][_0x4936('0x43')]===_0x4936('0x44')){logger[_0x4936('0x2d')]('Call\x20created!');return{'id':_0x1c9d8e[_0x4936('0x3c')][0x0][_0x4936('0x74')]['id']};}})[_0x4936('0x2a')](function(_0x2e6c0a){logger['info'](_0x4936('0x75'),_0x2e6c0a[_0x4936('0x76')]);console[_0x4936('0x46')]('err',_0x2e6c0a);});}exports[_0x4936('0x77')]=function(_0x1a47ec,_0x29e002,_0x3f7ab8,_0xc16b33,_0x538e9,_0x15c64f){var _0x1e2491,_0x4bdea3,_0x2cfeb7;_0x15c64f[_0x4936('0x78')]=intUtil[_0x4936('0x79')](_0x15c64f[_0x4936('0x78')]);_0x15c64f[_0x4936('0x7a')]=intUtil[_0x4936('0x79')](_0x15c64f[_0x4936('0x7a')]);if(_0x538e9&&_0x538e9[_0x4936('0x7b')]){logger[_0x4936('0x2d')](_0x4936('0x7c'),_0x4936('0x7d'));_0x29e002[_0x4936('0x7e')]=_0x15c64f['serverUrl']+'/api/voice/recordings/'+_0x29e002[_0x4936('0x7f')]+'/downloads?type=uniqueid&token='+md5(_0x29e002[_0x4936('0x7f')]);}else{_0x29e002[_0x4936('0x7e')]='';}var _0x583326=_0x15c64f[_0x4936('0x78')]===_0x4936('0x80')?'eu':'com';return getAccessToken(_0x15c64f)[_0x4936('0x27')](function(_0x6c7e16){_0x2cfeb7=_0x6c7e16;return getUser(_0x2cfeb7,_0x583326,_0x15c64f,_0xc16b33[_0x4936('0x81')]);})['then'](function(_0x1264a9){_0x1e2491=_0x1264a9;logger[_0x4936('0x2d')](_0x4936('0x82'),_0x1e2491['id']);return getEndUser(_0x2cfeb7,_0x583326,_0x15c64f,_0x29e002[_0x4936('0x83')],_0x29e002['calleridnum'],_0x1e2491,_0x3f7ab8);})[_0x4936('0x27')](function(_0x159f35){_0x4bdea3=_0x159f35;return getCall(_0x2cfeb7,_0x583326,_0x15c64f,_0x1e2491,_0x4bdea3,_0x3f7ab8,_0x29e002,_0x4936('0x84'));})[_0x4936('0x27')](function(_0xb90634){if(_0xb90634){logger[_0x4936('0x2d')](_0x4936('0x85'),_0xb90634['id']);logger[_0x4936('0x2d')]('[QUEUE]',_0x4936('0x86'));emit(util['format'](_0x4936('0x87'),_0xc16b33[_0x4936('0x18')]),_0x4936('0x88'),{'uri':_0x4936('0x89')+_0x15c64f['host']+'/crm/EntityInfo.do?module=Calls&id='+_0xb90634['id']});}})[_0x4936('0x2a')](function(_0x2cb68f){logger['error'](_0x4936('0x7c'),JSON[_0x4936('0xb')](_0x2cb68f));});};exports[_0x4936('0x70')]=function(_0x1a26a4,_0x513b72,_0x408b0d,_0xc698af,_0x213cfb,_0x396f59,_0x6151b5){var _0x5686a2,_0x42a77d,_0xd93f7f;_0x396f59[_0x4936('0x78')]=intUtil[_0x4936('0x79')](_0x396f59[_0x4936('0x78')]);_0x396f59['serverUrl']=intUtil[_0x4936('0x79')](_0x396f59[_0x4936('0x7a')]);if(_0x6151b5&&_0x6151b5[_0x4936('0x8a')]&&_0x6151b5[_0x4936('0x8a')]!==_0x4936('0x8b')){logger[_0x4936('0x2d')]('[OUTBOUND]',_0x4936('0x7d'));_0x513b72[_0x4936('0x7e')]=_0x396f59[_0x4936('0x7a')]+'/api/voice/recordings/'+_0x513b72['uniqueid']+_0x4936('0x8c')+md5(_0x513b72[_0x4936('0x7f')]);}var _0x101cc1=_0x396f59[_0x4936('0x78')]===_0x4936('0x80')?'eu':'com';return getAccessToken(_0x396f59)[_0x4936('0x27')](function(_0x5cc8ed){_0xd93f7f=_0x5cc8ed;return getUser(_0xd93f7f,_0x101cc1,_0x396f59,_0xc698af[_0x4936('0x81')]);})['then'](function(_0x5654eb){_0x5686a2=_0x5654eb;logger[_0x4936('0x2d')](_0x4936('0x82'),_0x5686a2['id']);return getEndUser(_0xd93f7f,_0x101cc1,_0x396f59,_0x513b72[_0x4936('0x8d')],_0x513b72['destcalleridnum'],_0x5686a2,_0x408b0d);})[_0x4936('0x27')](function(_0x221292){_0x42a77d=_0x221292;return getCall(_0xd93f7f,_0x101cc1,_0x396f59,_0x5686a2,_0x42a77d,_0x408b0d,_0x513b72,_0x4936('0x8e'));})[_0x4936('0x27')](function(_0x68dc72){if(_0x68dc72){logger[_0x4936('0x2d')](_0x4936('0x85'),_0x68dc72['id']);logger[_0x4936('0x2d')](_0x4936('0x8f'),_0x4936('0x86'));emit(util[_0x4936('0x64')](_0x4936('0x87'),_0xc698af[_0x4936('0x18')]),_0x4936('0x88'),{'uri':_0x4936('0x89')+_0x396f59['host']+'/crm/EntityInfo.do?module=Calls&id='+_0x68dc72['id']});}})[_0x4936('0x2a')](function(_0x17f669){logger[_0x4936('0x2b')](_0x4936('0x8f'),JSON[_0x4936('0xb')](_0x17f669));});};exports['unmanaged']=function(_0x2b9a9f,_0x5b0457,_0x1ccce4,_0x3d7247,_0x9f1a26,_0x1b7114){var _0x56e951,_0x5f3483,_0x3bd445;_0x1b7114[_0x4936('0x78')]=intUtil[_0x4936('0x79')](_0x1b7114[_0x4936('0x78')]);_0x1b7114[_0x4936('0x7a')]=intUtil['stripTrailingSlash'](_0x1b7114[_0x4936('0x7a')]);if(_0x9f1a26&&_0x9f1a26[_0x4936('0x7b')]){logger[_0x4936('0x2d')]('['+_0x5b0457[_0x4936('0x65')][_0x4936('0x90')]()+']',_0x4936('0x7d'));_0x5b0457[_0x4936('0x7e')]=_0x1b7114[_0x4936('0x7a')]+_0x4936('0x91')+_0x5b0457['uniqueid']+_0x4936('0x8c')+md5(_0x5b0457[_0x4936('0x7f')]);}else{_0x5b0457[_0x4936('0x7e')]='';}var _0x423a53=_0x1b7114[_0x4936('0x78')]===_0x4936('0x80')?'eu':_0x4936('0x92');return getAccessToken(_0x1b7114)[_0x4936('0x27')](function(_0x17e541){_0x3bd445=_0x17e541;return getUser(_0x3bd445,_0x423a53,_0x1b7114);})[_0x4936('0x27')](function(_0x39818c){_0x56e951=_0x39818c;logger['info'](_0x4936('0x82'),_0x56e951['id']);return getEndUser(_0x3bd445,_0x423a53,_0x1b7114,_0x5b0457[_0x4936('0x83')],_0x5b0457['calleridnum'],_0x56e951,_0x1ccce4);})[_0x4936('0x27')](function(_0x12308f){_0x5f3483=_0x12308f;return getCall(_0x3bd445,_0x423a53,_0x1b7114,_0x56e951,_0x5f3483,_0x1ccce4,_0x5b0457,'Inbound');})[_0x4936('0x27')](function(_0x7cafc0){if(_0x7cafc0){logger[_0x4936('0x2d')]('The\x20Call\x20ID\x20is:',_0x7cafc0['id']);}})[_0x4936('0x2a')](function(_0x4ad28c){logger[_0x4936('0x2b')]('['+_0x5b0457[_0x4936('0x65')][_0x4936('0x90')]()+']',JSON[_0x4936('0xb')](_0x4ad28c));});}; \ 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 4a69078..ff6ab50 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 _0x633d=['%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','shelljs','mustache','../../../../config/logger','trigger','data2','Script','render','exec','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','format'];(function(_0x56bba6,_0x5b9243){var _0x1195c5=function(_0x2753e3){while(--_0x2753e3){_0x56bba6['push'](_0x56bba6['shift']());}};_0x1195c5(++_0x5b9243);}(_0x633d,0x11f));var _0xd633=function(_0x1e3162,_0x366118){_0x1e3162=_0x1e3162-0x0;var _0x53e351=_0x633d[_0x1e3162];return _0x53e351;};'use strict';var util=require('util');var sh=require(_0xd633('0x0'));var Mustache=require(_0xd633('0x1'));var logger=require(_0xd633('0x2'))(_0xd633('0x3'));exports['exec']=function(_0x1a80ae,_0x38e994){var _0x1e3e1c=_0x1a80ae[_0xd633('0x4')]?_0x1a80ae[_0xd633('0x4')]:_0xd633('0x5');var _0x5d8066=_0x1a80ae['data3']?Mustache[_0xd633('0x6')](_0x1a80ae['data3'],_0x38e994):_0x38e994;sh[_0xd633('0x7')](_0x5d8066,function(_0xfff686,_0x4a069c,_0x1d4655){if(_0xfff686!==0x0){logger['error'](util['format'](_0xd633('0x8'),_0x1e3e1c,_0x5d8066,_0xfff686,_0x1d4655));}else{logger['info'](util[_0xd633('0x9')](_0xd633('0xa'),_0x1e3e1c,_0x5d8066,_0x4a069c));}});}; \ No newline at end of file +var _0x9a2e=['Script','data3','error','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','format','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs','../../../../config/logger','exec','data2'];(function(_0x19bef3,_0x4a8a26){var _0x4adf19=function(_0x9f47d5){while(--_0x9f47d5){_0x19bef3['push'](_0x19bef3['shift']());}};_0x4adf19(++_0x4a8a26);}(_0x9a2e,0x97));var _0xe9a2=function(_0x3fd1f1,_0xdf3efe){_0x3fd1f1=_0x3fd1f1-0x0;var _0x367f36=_0x9a2e[_0x3fd1f1];return _0x367f36;};'use strict';var util=require(_0xe9a2('0x0'));var sh=require(_0xe9a2('0x1'));var Mustache=require('mustache');var logger=require(_0xe9a2('0x2'))('trigger');exports[_0xe9a2('0x3')]=function(_0x1506a1,_0x4396e2){var _0x4dc41c=_0x1506a1['data2']?_0x1506a1[_0xe9a2('0x4')]:_0xe9a2('0x5');var _0x44018b=_0x1506a1[_0xe9a2('0x6')]?Mustache['render'](_0x1506a1[_0xe9a2('0x6')],_0x4396e2):_0x4396e2;sh[_0xe9a2('0x3')](_0x44018b,function(_0x1732f3,_0xb7488b,_0x22fa7d){if(_0x1732f3!==0x0){logger[_0xe9a2('0x7')](util['format'](_0xe9a2('0x8'),_0x4dc41c,_0x44018b,_0x1732f3,_0x22fa7d));}else{logger[_0xe9a2('0x9')](util[_0xe9a2('0xa')](_0xe9a2('0xb'),_0x4dc41c,_0x44018b,_0xb7488b));}});}; \ 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 11d1097..dc9c1a0 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 _0x8438=['format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','then','isNil',',\x20request\x20body:\x20','object','stringify','%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','util','lodash','mustache','../../../../config/logger','trigger','exec','toUpperCase','render','data2','number','data5','data6','stack','data1','GET','DELETE','POST','PUT','data7','parse','error','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','body','info'];(function(_0x2ebe07,_0x5cb865){var _0x1ea79c=function(_0x16a5d7){while(--_0x16a5d7){_0x2ebe07['push'](_0x2ebe07['shift']());}};_0x1ea79c(++_0x5cb865);}(_0x8438,0x78));var _0x8843=function(_0x1b4b1d,_0x2bb789){_0x1b4b1d=_0x1b4b1d-0x0;var _0x178754=_0x8438[_0x1b4b1d];return _0x178754;};'use strict';var rp=require('request-promise');var util=require(_0x8843('0x0'));var _=require(_0x8843('0x1'));var Mustache=require(_0x8843('0x2'));var logger=require(_0x8843('0x3'))(_0x8843('0x4'));exports[_0x8843('0x5')]=function(_0x55f4a2,_0x4cdc51){var _0x1a2317,_0x279c8e;var _0x5e115c={'method':_0x55f4a2['data1'][_0x8843('0x6')](),'uri':Mustache[_0x8843('0x7')](_0x55f4a2[_0x8843('0x8')],_0x4cdc51),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x55f4a2['data5'])===_0x8843('0x9')&&parseInt(_0x55f4a2[_0x8843('0xa')])>=0x1&&parseInt(_0x55f4a2[_0x8843('0xa')])<=0xa?parseInt(_0x55f4a2['data5'])*0x3e8:0x5*0x3e8};try{_0x5e115c['headers']=_0x55f4a2[_0x8843('0xb')]?JSON['parse'](Mustache[_0x8843('0x7')](_0x55f4a2[_0x8843('0xb')],_0x4cdc51)):{};}catch(_0x459112){logger['error'](_0x459112[_0x8843('0xc')]);}switch(_0x55f4a2[_0x8843('0xd')][_0x8843('0x6')]()){case _0x8843('0xe'):case _0x8843('0xf'):_0x1a2317=null;_0x5e115c['qs']=_0x4cdc51;break;case _0x8843('0x10'):case _0x8843('0x11'):if(_0x55f4a2[_0x8843('0x12')]){try{_0x1a2317=JSON[_0x8843('0x13')](Mustache['render'](_0x55f4a2[_0x8843('0x12')],_0x4cdc51));_0x5e115c['body']=_0x1a2317;}catch(_0xbfcd0b){logger[_0x8843('0x14')](_0xbfcd0b[_0x8843('0xc')]);logger[_0x8843('0x14')](_0x8843('0x15'));}}else{_0x1a2317=_0x4cdc51;_0x5e115c[_0x8843('0x16')]=_0x1a2317;}break;}logger[_0x8843('0x17')](util[_0x8843('0x18')](_0x8843('0x19'),_0x55f4a2[_0x8843('0xd')],_0x55f4a2[_0x8843('0x8')],JSON['stringify'](_0x5e115c)));rp(_0x5e115c)[_0x8843('0x1a')](function(_0x52d361){_0x1a2317=!_[_0x8843('0x1b')](_0x1a2317)?_0x8843('0x1c')+_0x1a2317:'';_0x279c8e=typeof _0x52d361[_0x8843('0x16')]===_0x8843('0x1d')?JSON[_0x8843('0x1e')](_0x52d361[_0x8843('0x16')]):_0x52d361[_0x8843('0x16')];logger['info'](util[_0x8843('0x18')](_0x8843('0x1f'),_0x55f4a2[_0x8843('0xd')],_0x55f4a2['data2'],_0x52d361[_0x8843('0x20')],_0x279c8e));})[_0x8843('0x21')](function(_0x1ae834){logger[_0x8843('0x14')](util[_0x8843('0x18')](_0x8843('0x22'),_0x55f4a2[_0x8843('0xd')],_0x55f4a2[_0x8843('0x8')],_0x1ae834[_0x8843('0x20')],_0x1ae834['name'],_0x1ae834[_0x8843('0x23')]));});}; \ No newline at end of file +var _0x980b=['catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','statusCode','name','util','lodash','../../../../config/logger','trigger','render','data2','data5','number','data6','stack','data1','toUpperCase','DELETE','POST','data7','parse','body','error','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','format','then','isNil',',\x20request\x20body:\x20','object','info'];(function(_0x328225,_0x4c139e){var _0x5e42f8=function(_0x3e2f7f){while(--_0x3e2f7f){_0x328225['push'](_0x328225['shift']());}};_0x5e42f8(++_0x4c139e);}(_0x980b,0x17d));var _0xb980=function(_0x3e69df,_0xab9eee){_0x3e69df=_0x3e69df-0x0;var _0x3df919=_0x980b[_0x3e69df];return _0x3df919;};'use strict';var rp=require('request-promise');var util=require(_0xb980('0x0'));var _=require(_0xb980('0x1'));var Mustache=require('mustache');var logger=require(_0xb980('0x2'))(_0xb980('0x3'));exports['exec']=function(_0x47f0e1,_0x364f9b){var _0x4a0538,_0x27944f;var _0x1b20aa={'method':_0x47f0e1['data1']['toUpperCase'](),'uri':Mustache[_0xb980('0x4')](_0x47f0e1[_0xb980('0x5')],_0x364f9b),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x47f0e1[_0xb980('0x6')])===_0xb980('0x7')&&parseInt(_0x47f0e1['data5'])>=0x1&&parseInt(_0x47f0e1['data5'])<=0xa?parseInt(_0x47f0e1[_0xb980('0x6')])*0x3e8:0x5*0x3e8};try{_0x1b20aa['headers']=_0x47f0e1['data6']?JSON['parse'](Mustache[_0xb980('0x4')](_0x47f0e1[_0xb980('0x8')],_0x364f9b)):{};}catch(_0x2f1568){logger['error'](_0x2f1568[_0xb980('0x9')]);}switch(_0x47f0e1[_0xb980('0xa')][_0xb980('0xb')]()){case'GET':case _0xb980('0xc'):_0x4a0538=null;_0x1b20aa['qs']=_0x364f9b;break;case _0xb980('0xd'):case'PUT':if(_0x47f0e1[_0xb980('0xe')]){try{_0x4a0538=JSON[_0xb980('0xf')](Mustache[_0xb980('0x4')](_0x47f0e1[_0xb980('0xe')],_0x364f9b));_0x1b20aa[_0xb980('0x10')]=_0x4a0538;}catch(_0x1ddb5e){logger[_0xb980('0x11')](_0x1ddb5e[_0xb980('0x9')]);logger['error'](_0xb980('0x12'));}}else{_0x4a0538=_0x364f9b;_0x1b20aa[_0xb980('0x10')]=_0x4a0538;}break;}logger['info'](util[_0xb980('0x13')]('%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s',_0x47f0e1[_0xb980('0xa')],_0x47f0e1[_0xb980('0x5')],JSON['stringify'](_0x1b20aa)));rp(_0x1b20aa)[_0xb980('0x14')](function(_0x195bd6){_0x4a0538=!_[_0xb980('0x15')](_0x4a0538)?_0xb980('0x16')+_0x4a0538:'';_0x27944f=typeof _0x195bd6[_0xb980('0x10')]===_0xb980('0x17')?JSON['stringify'](_0x195bd6[_0xb980('0x10')]):_0x195bd6[_0xb980('0x10')];logger[_0xb980('0x18')](util[_0xb980('0x13')]('%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s',_0x47f0e1[_0xb980('0xa')],_0x47f0e1[_0xb980('0x5')],_0x195bd6['statusCode'],_0x27944f));})[_0xb980('0x19')](function(_0x3ba96b){logger[_0xb980('0x11')](util[_0xb980('0x13')](_0xb980('0x1a'),_0x47f0e1[_0xb980('0xa')],_0x47f0e1['data2'],_0x3ba96b[_0xb980('0x1b')],_0x3ba96b[_0xb980('0x1c')],_0x3ba96b['message']));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index 7d07d24..5b19074 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 _0xee04=['message','result','exports','jayson/promise','../../config/logger','routing','client','http','Request','debug','rpc','error'];(function(_0x2f6d8e,_0x41ac39){var _0x4fe268=function(_0xf5128b){while(--_0xf5128b){_0x2f6d8e['push'](_0x2f6d8e['shift']());}};_0x4fe268(++_0x41ac39);}(_0xee04,0x9f));var _0x4ee0=function(_0x17b32d,_0x3d0f98){_0x17b32d=_0x17b32d-0x0;var _0x1160b7=_0xee04[_0x17b32d];return _0x1160b7;};'use strict';var jayson=require(_0x4ee0('0x0'));var BPromise=require('bluebird');var logger=require(_0x4ee0('0x1'))(_0x4ee0('0x2'));var client=jayson[_0x4ee0('0x3')][_0x4ee0('0x4')]({'port':0x2329});client[_0x4ee0('0x5')]=function(_0x45ef78,_0x2d46a0){return new BPromise(function(_0x4b0da0,_0x405738){return client['request'](_0x45ef78,_0x2d46a0)['then'](function(_0x3c35ee){logger[_0x4ee0('0x6')](_0x4ee0('0x7'),_0x4ee0('0x2'),_0x45ef78,_0x2d46a0,_0x3c35ee);if(_0x3c35ee['error']){logger[_0x4ee0('0x8')](_0x4ee0('0x7'),'routing',_0x45ef78,_0x3c35ee[_0x4ee0('0x8')][_0x4ee0('0x9')],_0x2d46a0);return _0x405738(_0x3c35ee['error'][_0x4ee0('0x9')]);}else{return _0x4b0da0(_0x3c35ee[_0x4ee0('0xa')]);}})['catch'](function(_0x596355){logger['error'](_0x4ee0('0x7'),'routing',_0x45ef78,_0x596355,_0x2d46a0);return _0x405738(_0x596355);});});};module[_0x4ee0('0xb')]=client; \ No newline at end of file +var _0xac45=['result','catch','exports','jayson/promise','../../config/logger','routing','client','Request','then','debug','rpc','error','message'];(function(_0x15951f,_0x4019b3){var _0x40a1fa=function(_0x3810e8){while(--_0x3810e8){_0x15951f['push'](_0x15951f['shift']());}};_0x40a1fa(++_0x4019b3);}(_0xac45,0x196));var _0x5ac4=function(_0x2945f1,_0x4a0ffe){_0x2945f1=_0x2945f1-0x0;var _0x4db525=_0xac45[_0x2945f1];return _0x4db525;};'use strict';var jayson=require(_0x5ac4('0x0'));var BPromise=require('bluebird');var logger=require(_0x5ac4('0x1'))(_0x5ac4('0x2'));var client=jayson[_0x5ac4('0x3')]['http']({'port':0x2329});client[_0x5ac4('0x4')]=function(_0x502ded,_0x7bfa68){return new BPromise(function(_0x38fa83,_0x548fae){return client['request'](_0x502ded,_0x7bfa68)[_0x5ac4('0x5')](function(_0x3bb28b){logger[_0x5ac4('0x6')](_0x5ac4('0x7'),'routing',_0x502ded,_0x7bfa68,_0x3bb28b);if(_0x3bb28b[_0x5ac4('0x8')]){logger[_0x5ac4('0x8')](_0x5ac4('0x7'),_0x5ac4('0x2'),_0x502ded,_0x3bb28b[_0x5ac4('0x8')][_0x5ac4('0x9')],_0x7bfa68);return _0x548fae(_0x3bb28b[_0x5ac4('0x8')][_0x5ac4('0x9')]);}else{return _0x38fa83(_0x3bb28b[_0x5ac4('0xa')]);}})[_0x5ac4('0xb')](function(_0x1bbf33){logger[_0x5ac4('0x8')](_0x5ac4('0x7'),_0x5ac4('0x2'),_0x502ded,_0x1bbf33,_0x7bfa68);return _0x548fae(_0x1bbf33);});});};module[_0x5ac4('0xc')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index 8d9c897..de7da16 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 _0x2cf8=['./realtime','./lib/email','./rpc/mailAccount','./rpc/setting','../../config/logger','resolve','then','refresh','listen','getSettings','loginMailFrequency','catch','error','Email\x20service\x20initialization','./server'];(function(_0x568676,_0x2b1c64){var _0x6c84c2=function(_0x33e0fa){while(--_0x33e0fa){_0x568676['push'](_0x568676['shift']());}};_0x6c84c2(++_0x2b1c64);}(_0x2cf8,0x176));var _0x82cf=function(_0x4f431d,_0xd51a3b){_0x4f431d=_0x4f431d-0x0;var _0x4f31e1=_0x2cf8[_0x4f431d];return _0x4f31e1;};'use strict';var server=require(_0x82cf('0x0'));var Realtime=require(_0x82cf('0x1'));var EmailChannel=require(_0x82cf('0x2'));var mailAccount=require(_0x82cf('0x3'));var setting=require(_0x82cf('0x4'));var logger=require(_0x82cf('0x5'))('email');var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0x82cf('0x6')]()[_0x82cf('0x7')](mailAccount['getMailAccounts']())[_0x82cf('0x7')](realtime['initMailAccounts']())['then'](function(){email[_0x82cf('0x8')](realtime['mailAccounts']);return realtime;});}function main(){return server[_0x82cf('0x9')](realtime,email)[_0x82cf('0x7')](function(){return initRealtime();})['then'](function(){return setting[_0x82cf('0xa')]();})[_0x82cf('0x7')](function(_0x13b789){return setInterval(initRealtime,_0x13b789[_0x82cf('0xb')]*0x3e8);})[_0x82cf('0xc')](function(_0x22f992){logger[_0x82cf('0xd')](_0x82cf('0xe'),_0x22f992);});}main(); \ No newline at end of file +var _0x36f5=['getSettings','loginMailFrequency','catch','Email\x20service\x20initialization','./server','./realtime','./rpc/setting','../../config/logger','email','resolve','getMailAccounts','initMailAccounts','then','refresh','mailAccounts','listen'];(function(_0x2b7764,_0x2606f1){var _0x848dcb=function(_0x1ae85b){while(--_0x1ae85b){_0x2b7764['push'](_0x2b7764['shift']());}};_0x848dcb(++_0x2606f1);}(_0x36f5,0xf4));var _0x536f=function(_0x1a98b7,_0x1955eb){_0x1a98b7=_0x1a98b7-0x0;var _0x479db7=_0x36f5[_0x1a98b7];return _0x479db7;};'use strict';var server=require(_0x536f('0x0'));var Realtime=require(_0x536f('0x1'));var EmailChannel=require('./lib/email');var mailAccount=require('./rpc/mailAccount');var setting=require(_0x536f('0x2'));var logger=require(_0x536f('0x3'))(_0x536f('0x4'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0x536f('0x5')]()['then'](mailAccount[_0x536f('0x6')]())['then'](realtime[_0x536f('0x7')]())[_0x536f('0x8')](function(){email[_0x536f('0x9')](realtime[_0x536f('0xa')]);return realtime;});}function main(){return server[_0x536f('0xb')](realtime,email)[_0x536f('0x8')](function(){return initRealtime();})['then'](function(){return setting[_0x536f('0xc')]();})[_0x536f('0x8')](function(_0x437cb7){return setInterval(initRealtime,_0x437cb7[_0x536f('0xd')]*0x3e8);})[_0x536f('0xe')](function(_0x485fcd){logger['error'](_0x536f('0xf'),_0x485fcd);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index 103427a..d8f4655 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 _0x30f6=['./imap','info','mailAccounts','imapAccounts','emit','key','active','Imap','messageStatus','total','isNil','stringify','mailAccount:update','prototype','refresh','service','custom','provider','hasOwnProperty','box','bind','handleImapEmail','end','error','handleImapError','status','disabled','handleImapBox','connected','name','messages','notify','then','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','smtp','verifySmtp','Smtp','verified','verify','exports','lodash','moment','md5','ioredis','../../../config/environment','email','redis','localhost'];(function(_0x309b62,_0x5b7bc7){var _0x5f5397=function(_0x63fe69){while(--_0x63fe69){_0x309b62['push'](_0x309b62['shift']());}};_0x5f5397(++_0x5b7bc7);}(_0x30f6,0x190));var _0x630f=function(_0x678959,_0x256da5){_0x678959=_0x678959-0x0;var _0x1cee4e=_0x30f6[_0x678959];return _0x1cee4e;};'use strict';var _=require(_0x630f('0x0'));var moment=require(_0x630f('0x1'));var BPromise=require('bluebird');var md5=require(_0x630f('0x2'));var Redis=require(_0x630f('0x3'));var config=require(_0x630f('0x4'));var logger=require('../../../config/logger')(_0x630f('0x5'));config['redis']=_['defaults'](config[_0x630f('0x6')],{'host':_0x630f('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x630f('0x6')]));var EmailImap=require(_0x630f('0x8'));var EmailSmtp=require('./smtp');var mailAccount=require('../rpc/mailAccount');var md5Accounts={};function EmailChannel(_0x5490d1){logger[_0x630f('0x9')]('start\x20email\x20channel');this['mailAccounts']=_0x5490d1[_0x630f('0xa')];this[_0x630f('0xb')]={};this['smtp']=new EmailSmtp();}EmailChannel['prototype'][_0x630f('0xc')]=function(_0x2dcf97){var _0x35ec4e=this[_0x630f('0xa')][_0x2dcf97];var _0x417065={'id':_0x35ec4e['id'],'name':_0x35ec4e['name'],'key':_0x35ec4e[_0x630f('0xd')],'active':_0x35ec4e[_0x630f('0xe')],'Imap':{'status':_0x35ec4e[_0x630f('0xf')]['status'],'messageStatus':_0x35ec4e[_0x630f('0xf')][_0x630f('0x10')],'total':_0x35ec4e['Imap'][_0x630f('0x11')]}};if(_[_0x630f('0x12')](md5Accounts[_0x2dcf97])){md5Accounts[_0x2dcf97]={};}var _0x4e9a5e=md5(JSON[_0x630f('0x13')](_0x417065));if(md5Accounts[_0x2dcf97][_0x630f('0x2')]!==_0x4e9a5e){md5Accounts[_0x2dcf97][_0x630f('0x2')]=_0x4e9a5e;io[_0x630f('0xc')](_0x630f('0x14'),_0x417065);}};EmailChannel[_0x630f('0x15')][_0x630f('0x16')]=function(_0x2cb145){for(var _0xeb8bbd in _0x2cb145){if(_0x2cb145['hasOwnProperty'](_0xeb8bbd)){if(_0x2cb145[_0xeb8bbd]['Imap']&&_0x2cb145[_0xeb8bbd]['active']){var _0xf68f1a=_0x2cb145[_0xeb8bbd][_0x630f('0xf')];if(!_0xf68f1a[_0x630f('0x17')]&&_0x2cb145[_0xeb8bbd]['provider']!==_0x630f('0x18'))_0xf68f1a[_0x630f('0x17')]=_0x2cb145[_0xeb8bbd][_0x630f('0x19')];if(!this[_0x630f('0xb')][_0x630f('0x1a')](_0xf68f1a['id'])){this[_0x630f('0xb')][_0xf68f1a['id']]=new EmailImap(_0xf68f1a,_0x2cb145[_0xeb8bbd][_0x630f('0x5')]);this[_0x630f('0xb')][_0xf68f1a['id']]['on'](_0x630f('0x1b'),this['handleImapBox'][_0x630f('0x1c')](this,_0xeb8bbd));this[_0x630f('0xb')][_0xf68f1a['id']]['on']('email',this[_0x630f('0x1d')]['bind'](this,_0xeb8bbd));this[_0x630f('0xb')][_0xf68f1a['id']]['on'](_0x630f('0x1e'),this['handleImapEnd']['bind'](this,_0xeb8bbd));this[_0x630f('0xb')][_0xf68f1a['id']]['on'](_0x630f('0x1f'),this[_0x630f('0x20')][_0x630f('0x1c')](this,_0xeb8bbd));}}else{if(_[_0x630f('0x12')](this['mailAccounts'][_0xeb8bbd]['Imap'])){this['mailAccounts'][_0xeb8bbd]['Imap']={};}this['mailAccounts'][_0xeb8bbd][_0x630f('0xf')][_0x630f('0x21')]=_0x630f('0x22');this['mailAccounts'][_0xeb8bbd]['Imap'][_0x630f('0x10')]='';this['emit'](_0xeb8bbd);}}}};EmailChannel[_0x630f('0x15')][_0x630f('0x23')]=function(_0x10d2c3,_0x33b9fc){if(this[_0x630f('0xa')][_0x10d2c3]){this['mailAccounts'][_0x10d2c3]['Imap'][_0x630f('0x21')]=_0x630f('0x24');this[_0x630f('0xa')][_0x10d2c3][_0x630f('0xf')]['messageStatus']=_0x33b9fc[_0x630f('0x25')];if(_0x33b9fc['messages']){this[_0x630f('0xa')][_0x10d2c3][_0x630f('0xf')][_0x630f('0x11')]=_0x33b9fc[_0x630f('0x26')][_0x630f('0x11')];}return this[_0x630f('0xc')](_0x10d2c3);}};EmailChannel[_0x630f('0x15')][_0x630f('0x1d')]=function(_0x4159fe,_0x277e0e){logger[_0x630f('0x9')]('New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s',_0x277e0e['firstName'],_0x277e0e['lastName'],_0x277e0e['from'],_0x4159fe);if(this['mailAccounts'][_0x4159fe]){return mailAccount[_0x630f('0x27')](_0x4159fe,_0x277e0e)[_0x630f('0x28')](function(_0x20e724){if(_0x20e724){logger[_0x630f('0x9')](_0x630f('0x29'));}})[_0x630f('0x2a')](function(_0x5d78ac){logger[_0x630f('0x1f')](_0x630f('0x2b'),JSON[_0x630f('0x13')](_0x5d78ac));});}};EmailChannel[_0x630f('0x15')]['handleImapEnd']=function(_0x3581d8){if(this[_0x630f('0xa')][_0x3581d8]&&this[_0x630f('0xa')][_0x3581d8][_0x630f('0xf')]){if(this[_0x630f('0xb')][this[_0x630f('0xa')][_0x3581d8][_0x630f('0xf')]['id']]){delete this[_0x630f('0xb')][this['mailAccounts'][_0x3581d8][_0x630f('0xf')]['id']];}this[_0x630f('0xa')][_0x3581d8][_0x630f('0xf')][_0x630f('0x2c')]=moment();this[_0x630f('0xc')](_0x3581d8);}};EmailChannel[_0x630f('0x15')]['handleImapError']=function(_0x2f23a3,_0x4c5f68){if(this['mailAccounts'][_0x2f23a3]){this[_0x630f('0xa')][_0x2f23a3]['Imap']['status']='error';this[_0x630f('0xa')][_0x2f23a3]['Imap'][_0x630f('0x10')]=_0x4c5f68;return this['emit'](_0x2f23a3);}};EmailChannel[_0x630f('0x15')]['sendMail']=function(_0x3c3e47,_0x1fc648){return this[_0x630f('0x2d')]['send'](_0x3c3e47,_0x1fc648);};EmailChannel[_0x630f('0x15')][_0x630f('0x2e')]=function(_0x467ea8){var _0x4786c9=this;if(this[_0x630f('0xa')][_0x467ea8['id']]){if(_[_0x630f('0x12')](this[_0x630f('0xa')][_0x467ea8['id']][_0x630f('0x2f')])){this[_0x630f('0xa')][_0x467ea8['id']][_0x630f('0x2f')]={};}this[_0x630f('0xa')][_0x467ea8['id']]['Smtp'][_0x630f('0x2c')]=moment();return new BPromise(function(_0x2492dc,_0x578601){return _0x4786c9['smtp']['verify'](_0x467ea8)[_0x630f('0x28')](function(_0x82f4ad){_0x4786c9['mailAccounts'][_0x467ea8['id']][_0x630f('0x2f')][_0x630f('0x21')]=_0x630f('0x30');_0x4786c9[_0x630f('0xa')][_0x467ea8['id']][_0x630f('0x2f')]['messageStatus']='';_0x4786c9[_0x630f('0xc')](_0x467ea8['id']);_0x2492dc(_0x82f4ad);})[_0x630f('0x2a')](function(_0x44dcde){_0x4786c9['mailAccounts'][_0x467ea8['id']][_0x630f('0x2f')][_0x630f('0x21')]=_0x630f('0x1f');_0x4786c9['mailAccounts'][_0x467ea8['id']]['Smtp'][_0x630f('0x10')]=_0x44dcde;_0x4786c9[_0x630f('0xc')](_0x467ea8['id']);_0x578601(_0x44dcde);});});}return this[_0x630f('0x2d')][_0x630f('0x31')](_0x467ea8);};module[_0x630f('0x32')]=EmailChannel; \ No newline at end of file +var _0xa26d=['bluebird','md5','../../../config/environment','email','redis','defaults','localhost','./imap','./smtp','../rpc/mailAccount','info','mailAccounts','imapAccounts','smtp','prototype','emit','name','key','active','status','messageStatus','Imap','stringify','mailAccount:update','refresh','hasOwnProperty','service','provider','custom','box','handleImapBox','bind','handleImapEmail','handleImapEnd','error','handleImapError','disabled','connected','messages','total','from','then','Mail\x20accepted\x20from\x20routing','catch','sendMail','send','verifySmtp','isNil','Smtp','lastSync','verify','verified','exports'];(function(_0x279d37,_0x14de3f){var _0x530173=function(_0x37fc79){while(--_0x37fc79){_0x279d37['push'](_0x279d37['shift']());}};_0x530173(++_0x14de3f);}(_0xa26d,0x1a8));var _0xda26=function(_0x330d21,_0xcf0226){_0x330d21=_0x330d21-0x0;var _0x4ad989=_0xa26d[_0x330d21];return _0x4ad989;};'use strict';var _=require('lodash');var moment=require('moment');var BPromise=require(_0xda26('0x0'));var md5=require(_0xda26('0x1'));var Redis=require('ioredis');var config=require(_0xda26('0x2'));var logger=require('../../../config/logger')(_0xda26('0x3'));config[_0xda26('0x4')]=_[_0xda26('0x5')](config[_0xda26('0x4')],{'host':_0xda26('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xda26('0x4')]));var EmailImap=require(_0xda26('0x7'));var EmailSmtp=require(_0xda26('0x8'));var mailAccount=require(_0xda26('0x9'));var md5Accounts={};function EmailChannel(_0xca2633){logger[_0xda26('0xa')]('start\x20email\x20channel');this[_0xda26('0xb')]=_0xca2633[_0xda26('0xb')];this[_0xda26('0xc')]={};this[_0xda26('0xd')]=new EmailSmtp();}EmailChannel[_0xda26('0xe')][_0xda26('0xf')]=function(_0x15d2d7){var _0x283ff0=this['mailAccounts'][_0x15d2d7];var _0x21bb03={'id':_0x283ff0['id'],'name':_0x283ff0[_0xda26('0x10')],'key':_0x283ff0[_0xda26('0x11')],'active':_0x283ff0[_0xda26('0x12')],'Imap':{'status':_0x283ff0['Imap'][_0xda26('0x13')],'messageStatus':_0x283ff0['Imap'][_0xda26('0x14')],'total':_0x283ff0[_0xda26('0x15')]['total']}};if(_['isNil'](md5Accounts[_0x15d2d7])){md5Accounts[_0x15d2d7]={};}var _0x3663fa=md5(JSON[_0xda26('0x16')](_0x21bb03));if(md5Accounts[_0x15d2d7][_0xda26('0x1')]!==_0x3663fa){md5Accounts[_0x15d2d7][_0xda26('0x1')]=_0x3663fa;io[_0xda26('0xf')](_0xda26('0x17'),_0x21bb03);}};EmailChannel[_0xda26('0xe')][_0xda26('0x18')]=function(_0x386cf1){for(var _0x57ca41 in _0x386cf1){if(_0x386cf1[_0xda26('0x19')](_0x57ca41)){if(_0x386cf1[_0x57ca41][_0xda26('0x15')]&&_0x386cf1[_0x57ca41]['active']){var _0x136049=_0x386cf1[_0x57ca41][_0xda26('0x15')];if(!_0x136049[_0xda26('0x1a')]&&_0x386cf1[_0x57ca41][_0xda26('0x1b')]!==_0xda26('0x1c'))_0x136049[_0xda26('0x1a')]=_0x386cf1[_0x57ca41]['provider'];if(!this[_0xda26('0xc')][_0xda26('0x19')](_0x136049['id'])){this[_0xda26('0xc')][_0x136049['id']]=new EmailImap(_0x136049,_0x386cf1[_0x57ca41][_0xda26('0x3')]);this[_0xda26('0xc')][_0x136049['id']]['on'](_0xda26('0x1d'),this[_0xda26('0x1e')][_0xda26('0x1f')](this,_0x57ca41));this[_0xda26('0xc')][_0x136049['id']]['on'](_0xda26('0x3'),this[_0xda26('0x20')][_0xda26('0x1f')](this,_0x57ca41));this[_0xda26('0xc')][_0x136049['id']]['on']('end',this[_0xda26('0x21')][_0xda26('0x1f')](this,_0x57ca41));this[_0xda26('0xc')][_0x136049['id']]['on'](_0xda26('0x22'),this[_0xda26('0x23')][_0xda26('0x1f')](this,_0x57ca41));}}else{if(_['isNil'](this[_0xda26('0xb')][_0x57ca41][_0xda26('0x15')])){this[_0xda26('0xb')][_0x57ca41]['Imap']={};}this[_0xda26('0xb')][_0x57ca41][_0xda26('0x15')][_0xda26('0x13')]=_0xda26('0x24');this[_0xda26('0xb')][_0x57ca41][_0xda26('0x15')][_0xda26('0x14')]='';this['emit'](_0x57ca41);}}}};EmailChannel[_0xda26('0xe')][_0xda26('0x1e')]=function(_0x1ed360,_0x184e53){if(this[_0xda26('0xb')][_0x1ed360]){this[_0xda26('0xb')][_0x1ed360][_0xda26('0x15')]['status']=_0xda26('0x25');this[_0xda26('0xb')][_0x1ed360][_0xda26('0x15')][_0xda26('0x14')]=_0x184e53[_0xda26('0x10')];if(_0x184e53[_0xda26('0x26')]){this[_0xda26('0xb')][_0x1ed360][_0xda26('0x15')][_0xda26('0x27')]=_0x184e53['messages'][_0xda26('0x27')];}return this['emit'](_0x1ed360);}};EmailChannel[_0xda26('0xe')]['handleImapEmail']=function(_0x356bcd,_0x5475fe){logger[_0xda26('0xa')]('New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s',_0x5475fe['firstName'],_0x5475fe['lastName'],_0x5475fe[_0xda26('0x28')],_0x356bcd);if(this[_0xda26('0xb')][_0x356bcd]){return mailAccount['notify'](_0x356bcd,_0x5475fe)[_0xda26('0x29')](function(_0x3ef7cf){if(_0x3ef7cf){logger[_0xda26('0xa')](_0xda26('0x2a'));}})[_0xda26('0x2b')](function(_0xe8eab5){logger[_0xda26('0x22')]('Mail\x20not\x20accepted\x20from\x20routing\x20%s',JSON[_0xda26('0x16')](_0xe8eab5));});}};EmailChannel[_0xda26('0xe')][_0xda26('0x21')]=function(_0x5d57ea){if(this[_0xda26('0xb')][_0x5d57ea]&&this[_0xda26('0xb')][_0x5d57ea]['Imap']){if(this['imapAccounts'][this['mailAccounts'][_0x5d57ea]['Imap']['id']]){delete this[_0xda26('0xc')][this[_0xda26('0xb')][_0x5d57ea][_0xda26('0x15')]['id']];}this[_0xda26('0xb')][_0x5d57ea][_0xda26('0x15')]['lastSync']=moment();this[_0xda26('0xf')](_0x5d57ea);}};EmailChannel[_0xda26('0xe')][_0xda26('0x23')]=function(_0x5aae68,_0x1b065f){if(this[_0xda26('0xb')][_0x5aae68]){this[_0xda26('0xb')][_0x5aae68]['Imap'][_0xda26('0x13')]=_0xda26('0x22');this[_0xda26('0xb')][_0x5aae68]['Imap']['messageStatus']=_0x1b065f;return this['emit'](_0x5aae68);}};EmailChannel[_0xda26('0xe')][_0xda26('0x2c')]=function(_0x27c84,_0x2382d8){return this['smtp'][_0xda26('0x2d')](_0x27c84,_0x2382d8);};EmailChannel[_0xda26('0xe')][_0xda26('0x2e')]=function(_0x29ab97){var _0x6d6a0e=this;if(this['mailAccounts'][_0x29ab97['id']]){if(_[_0xda26('0x2f')](this[_0xda26('0xb')][_0x29ab97['id']][_0xda26('0x30')])){this[_0xda26('0xb')][_0x29ab97['id']][_0xda26('0x30')]={};}this['mailAccounts'][_0x29ab97['id']][_0xda26('0x30')][_0xda26('0x31')]=moment();return new BPromise(function(_0x2e3157,_0x563bcf){return _0x6d6a0e[_0xda26('0xd')][_0xda26('0x32')](_0x29ab97)[_0xda26('0x29')](function(_0x4d796c){_0x6d6a0e['mailAccounts'][_0x29ab97['id']][_0xda26('0x30')][_0xda26('0x13')]=_0xda26('0x33');_0x6d6a0e[_0xda26('0xb')][_0x29ab97['id']][_0xda26('0x30')][_0xda26('0x14')]='';_0x6d6a0e[_0xda26('0xf')](_0x29ab97['id']);_0x2e3157(_0x4d796c);})[_0xda26('0x2b')](function(_0x1b9f5b){_0x6d6a0e['mailAccounts'][_0x29ab97['id']]['Smtp']['status']=_0xda26('0x22');_0x6d6a0e[_0xda26('0xb')][_0x29ab97['id']][_0xda26('0x30')]['messageStatus']=_0x1b9f5b;_0x6d6a0e[_0xda26('0xf')](_0x29ab97['id']);_0x563bcf(_0x1b9f5b);});});}return this[_0xda26('0xd')][_0xda26('0x32')](_0x29ab97);};module[_0xda26('0x34')]=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index e1e70d9..4f14bc3 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 _0x4d0c=['handleMessageEnd','handleSimpleParser','parser','emit','handleFetchError','stringify','textCode','upperFirst','exports','lodash','util','mailparser','simpleParser','iconv','mailbox','account','getAccount','imap','handleReady','once','end','handleEnd','bind','handleError','inherits','prototype','connTimeout','authTimeout','service','user','modernAuthentication','xoauth2','generateXOAuth2Token','data5','password','authentication','email','host','port','tls','autotls','required','openBox','handleOpenBox','box','handleCloseBox','readUnseen','search','UNSEEN','handleReadUnseen','fetch','message','handleFetchMessage','error','handleFetchEnd','closeBox','body','handleMessageBody','attributes','handleMessageAttributes'];(function(_0x51186a,_0x3a4e16){var _0x545fac=function(_0x170019){while(--_0x170019){_0x51186a['push'](_0x51186a['shift']());}};_0x545fac(++_0x3a4e16);}(_0x4d0c,0x135));var _0xc4d0=function(_0x2cb786,_0x2a2f06){_0x2cb786=_0x2cb786-0x0;var _0x2c1854=_0x4d0c[_0x2cb786];return _0x2c1854;};'use strict';var _=require(_0xc4d0('0x0'));var util=require(_0xc4d0('0x1'));var Imap=require('imap');var simpleParser=require(_0xc4d0('0x2'))[_0xc4d0('0x3')];var Iconv=require(_0xc4d0('0x4'))['Iconv'];var EventEmitter=require('events')['EventEmitter'];var utils=require('./utils');var logger=require('../../../config/logger')('email');function EmailImap(_0x4f576d,_0x7bc2ba){this[_0xc4d0('0x5')]=_0x4f576d[_0xc4d0('0x5')];this[_0xc4d0('0x6')]=this[_0xc4d0('0x7')](_0x4f576d,_0x7bc2ba);this[_0xc4d0('0x8')]=new Imap(this['account']);this[_0xc4d0('0x8')]['once']('ready',this[_0xc4d0('0x9')]['bind'](this));this[_0xc4d0('0x8')][_0xc4d0('0xa')](_0xc4d0('0xb'),this[_0xc4d0('0xc')][_0xc4d0('0xd')](this));this[_0xc4d0('0x8')]['on']('error',this[_0xc4d0('0xe')][_0xc4d0('0xd')](this));this['imap']['connect']();}util[_0xc4d0('0xf')](EmailImap,EventEmitter);EmailImap[_0xc4d0('0x10')]['getAccount']=function(_0x31a9d0,_0x19187a){var _0x2fc1f3={'connTimeout':_0x31a9d0[_0xc4d0('0x11')]?_0x31a9d0[_0xc4d0('0x11')]*0x3e8:0x2710,'authTimeout':_0x31a9d0[_0xc4d0('0x12')]?_0x31a9d0['authTimeout']*0x3e8:0x1388};if(_0x31a9d0[_0xc4d0('0x13')]){_0x2fc1f3[_0xc4d0('0x14')]=_0x31a9d0[_0xc4d0('0x14')];if(_0x31a9d0[_0xc4d0('0x15')]){_0x2fc1f3[_0xc4d0('0x16')]=utils[_0xc4d0('0x17')](_0x31a9d0['CloudProvider'][_0xc4d0('0x18')],_0x31a9d0['user']);}else{_0x2fc1f3[_0xc4d0('0x19')]=_0x31a9d0['password'];}}else{if(_0x31a9d0[_0xc4d0('0x1a')]){_0x2fc1f3[_0xc4d0('0x14')]=_0x31a9d0['user'];_0x2fc1f3['password']=_0x31a9d0[_0xc4d0('0x19')];}}_0x2fc1f3[_0xc4d0('0x1b')]=_0x19187a||_0x31a9d0['user']||'anonymous@xcally.com';_0x2fc1f3[_0xc4d0('0x1c')]=_0x31a9d0[_0xc4d0('0x1c')];_0x2fc1f3[_0xc4d0('0x1d')]=_0x31a9d0[_0xc4d0('0x1d')]||0x3e1;if(_0x31a9d0[_0xc4d0('0x1e')]){_0x2fc1f3[_0xc4d0('0x1e')]=!![];}else{_0x2fc1f3[_0xc4d0('0x1e')]=![];_0x2fc1f3[_0xc4d0('0x1f')]=_0xc4d0('0x20');}return _0x2fc1f3;};EmailImap['prototype'][_0xc4d0('0x9')]=function(){this[_0xc4d0('0x8')][_0xc4d0('0x21')](this[_0xc4d0('0x5')],![],this[_0xc4d0('0x22')][_0xc4d0('0xd')](this));};EmailImap['prototype']['handleOpenBox']=function(_0x44f92b,_0x3889c9){if(_0x44f92b){this[_0xc4d0('0xe')](_0x44f92b,!![]);}else{this['emit'](_0xc4d0('0x23'),_0x3889c9);this['readUnseen']();}};EmailImap[_0xc4d0('0x10')][_0xc4d0('0x24')]=function(_0x2f7980){if(_0x2f7980){this['handleError'](_0x2f7980,!![]);}else{this['imap'][_0xc4d0('0xb')]();}};EmailImap['prototype'][_0xc4d0('0x25')]=function(){this['imap'][_0xc4d0('0x26')]([_0xc4d0('0x27')],this['handleReadUnseen']['bind'](this));};EmailImap[_0xc4d0('0x10')][_0xc4d0('0x28')]=function(_0x3d6c11,_0x2069a9){if(_0x3d6c11){this[_0xc4d0('0xe')](_0x3d6c11,!![]);}else{if(_0x2069a9['length']){try{var _0x59e6c6=this[_0xc4d0('0x8')][_0xc4d0('0x29')](_0x2069a9,{'bodies':'','markSeen':!![]});_0x59e6c6['on'](_0xc4d0('0x2a'),this[_0xc4d0('0x2b')]['bind'](this));_0x59e6c6[_0xc4d0('0xa')](_0xc4d0('0x2c'),this['handleFetchError'][_0xc4d0('0xd')](this));_0x59e6c6['once'](_0xc4d0('0xb'),this[_0xc4d0('0x2d')][_0xc4d0('0xd')](this));}catch(_0x23ab73){logger[_0xc4d0('0x2c')](_0x23ab73);}}else{this[_0xc4d0('0x8')][_0xc4d0('0x2e')](!![],this[_0xc4d0('0x24')]['bind'](this));}}};EmailImap[_0xc4d0('0x10')][_0xc4d0('0x2b')]=function(_0xb0d43a){_0xb0d43a['on'](_0xc4d0('0x2f'),this[_0xc4d0('0x30')]['bind'](this));_0xb0d43a[_0xc4d0('0xa')](_0xc4d0('0x31'),this[_0xc4d0('0x32')][_0xc4d0('0xd')](this));_0xb0d43a[_0xc4d0('0xa')](_0xc4d0('0xb'),this[_0xc4d0('0x33')][_0xc4d0('0xd')](this));};EmailImap['prototype'][_0xc4d0('0x30')]=function(_0x25b196){simpleParser(_0x25b196,{'Iconv':Iconv},this['handleSimpleParser'][_0xc4d0('0xd')](this));};EmailImap[_0xc4d0('0x10')][_0xc4d0('0x32')]=function(){};EmailImap[_0xc4d0('0x10')][_0xc4d0('0x33')]=function(){};EmailImap['prototype'][_0xc4d0('0x34')]=function(_0x246b35,_0xf31633){if(_0x246b35){logger[_0xc4d0('0x2c')](_0x246b35);}else{var _0x524b3c=this;utils[_0xc4d0('0x35')](this[_0xc4d0('0x6')],_0xf31633,function(_0x33ba28){_0x524b3c[_0xc4d0('0x36')]('email',_0x33ba28);});}};EmailImap[_0xc4d0('0x10')]['handleFetchEnd']=function(){this[_0xc4d0('0x8')][_0xc4d0('0x2e')](!![],this[_0xc4d0('0x24')][_0xc4d0('0xd')](this));};EmailImap[_0xc4d0('0x10')][_0xc4d0('0x37')]=function(_0x3dede5){this[_0xc4d0('0xe')](_0x3dede5);this[_0xc4d0('0x8')][_0xc4d0('0x2e')](!![],this[_0xc4d0('0x24')][_0xc4d0('0xd')](this));};EmailImap['prototype'][_0xc4d0('0xc')]=function(){this[_0xc4d0('0x36')]('end');};EmailImap['prototype'][_0xc4d0('0xe')]=function(_0x4dd5c7,_0x1af7c0){logger['error']('handleError',this[_0xc4d0('0x6')][_0xc4d0('0x1b')],JSON[_0xc4d0('0x38')](_0x4dd5c7));var _0x237bd1='';if(_0x4dd5c7){if(_0x4dd5c7[_0xc4d0('0x39')]){_0x237bd1=_0x4dd5c7[_0xc4d0('0x39')];}else{for(var _0x346b91 in _0x4dd5c7){if(_0x4dd5c7['hasOwnProperty'](_0x346b91)){_0x237bd1+=_[_0xc4d0('0x3a')](_0x346b91)+':\x20'+_0x4dd5c7[_0x346b91]+'\x0a';}}}}if(_0x1af7c0){this[_0xc4d0('0x8')][_0xc4d0('0xb')]();}else{this[_0xc4d0('0x36')](_0xc4d0('0x2c'),_0x237bd1);this[_0xc4d0('0x36')](_0xc4d0('0xb'));}};module[_0xc4d0('0x3b')]=EmailImap; \ No newline at end of file +var _0xcbc7=['handleSimpleParser','parser','handleFetchError','stringify','textCode','lodash','util','imap','iconv','Iconv','EventEmitter','./utils','../../../config/logger','mailbox','account','once','bind','handleEnd','error','handleError','connect','prototype','getAccount','authTimeout','service','user','modernAuthentication','xoauth2','generateXOAuth2Token','CloudProvider','data5','password','authentication','email','anonymous@xcally.com','host','port','tls','autotls','handleReady','openBox','handleOpenBox','emit','box','handleCloseBox','end','readUnseen','search','handleReadUnseen','fetch','message','handleFetchMessage','handleFetchEnd','closeBox','body','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd'];(function(_0x391699,_0x34c62e){var _0x2cc4b7=function(_0xb14297){while(--_0xb14297){_0x391699['push'](_0x391699['shift']());}};_0x2cc4b7(++_0x34c62e);}(_0xcbc7,0xf1));var _0x7cbc=function(_0x2ac756,_0x33408b){_0x2ac756=_0x2ac756-0x0;var _0xa621fb=_0xcbc7[_0x2ac756];return _0xa621fb;};'use strict';var _=require(_0x7cbc('0x0'));var util=require(_0x7cbc('0x1'));var Imap=require(_0x7cbc('0x2'));var simpleParser=require('mailparser')['simpleParser'];var Iconv=require(_0x7cbc('0x3'))[_0x7cbc('0x4')];var EventEmitter=require('events')[_0x7cbc('0x5')];var utils=require(_0x7cbc('0x6'));var logger=require(_0x7cbc('0x7'))('email');function EmailImap(_0x1a05fa,_0x5a4f86){this['mailbox']=_0x1a05fa[_0x7cbc('0x8')];this[_0x7cbc('0x9')]=this['getAccount'](_0x1a05fa,_0x5a4f86);this[_0x7cbc('0x2')]=new Imap(this[_0x7cbc('0x9')]);this[_0x7cbc('0x2')][_0x7cbc('0xa')]('ready',this['handleReady'][_0x7cbc('0xb')](this));this[_0x7cbc('0x2')][_0x7cbc('0xa')]('end',this[_0x7cbc('0xc')]['bind'](this));this[_0x7cbc('0x2')]['on'](_0x7cbc('0xd'),this[_0x7cbc('0xe')][_0x7cbc('0xb')](this));this[_0x7cbc('0x2')][_0x7cbc('0xf')]();}util['inherits'](EmailImap,EventEmitter);EmailImap[_0x7cbc('0x10')][_0x7cbc('0x11')]=function(_0xf84b31,_0x181138){var _0x48156c={'connTimeout':_0xf84b31['connTimeout']?_0xf84b31['connTimeout']*0x3e8:0x2710,'authTimeout':_0xf84b31[_0x7cbc('0x12')]?_0xf84b31[_0x7cbc('0x12')]*0x3e8:0x1388};if(_0xf84b31[_0x7cbc('0x13')]){_0x48156c[_0x7cbc('0x14')]=_0xf84b31[_0x7cbc('0x14')];if(_0xf84b31[_0x7cbc('0x15')]){_0x48156c[_0x7cbc('0x16')]=utils[_0x7cbc('0x17')](_0xf84b31[_0x7cbc('0x18')][_0x7cbc('0x19')],_0xf84b31[_0x7cbc('0x14')]);}else{_0x48156c['password']=_0xf84b31[_0x7cbc('0x1a')];}}else{if(_0xf84b31[_0x7cbc('0x1b')]){_0x48156c[_0x7cbc('0x14')]=_0xf84b31[_0x7cbc('0x14')];_0x48156c[_0x7cbc('0x1a')]=_0xf84b31[_0x7cbc('0x1a')];}}_0x48156c[_0x7cbc('0x1c')]=_0x181138||_0xf84b31[_0x7cbc('0x14')]||_0x7cbc('0x1d');_0x48156c['host']=_0xf84b31[_0x7cbc('0x1e')];_0x48156c[_0x7cbc('0x1f')]=_0xf84b31[_0x7cbc('0x1f')]||0x3e1;if(_0xf84b31[_0x7cbc('0x20')]){_0x48156c[_0x7cbc('0x20')]=!![];}else{_0x48156c[_0x7cbc('0x20')]=![];_0x48156c[_0x7cbc('0x21')]='required';}return _0x48156c;};EmailImap[_0x7cbc('0x10')][_0x7cbc('0x22')]=function(){this['imap'][_0x7cbc('0x23')](this['mailbox'],![],this[_0x7cbc('0x24')]['bind'](this));};EmailImap[_0x7cbc('0x10')][_0x7cbc('0x24')]=function(_0x24a957,_0x42797c){if(_0x24a957){this[_0x7cbc('0xe')](_0x24a957,!![]);}else{this[_0x7cbc('0x25')](_0x7cbc('0x26'),_0x42797c);this['readUnseen']();}};EmailImap['prototype'][_0x7cbc('0x27')]=function(_0x2d2ea8){if(_0x2d2ea8){this[_0x7cbc('0xe')](_0x2d2ea8,!![]);}else{this[_0x7cbc('0x2')][_0x7cbc('0x28')]();}};EmailImap[_0x7cbc('0x10')][_0x7cbc('0x29')]=function(){this[_0x7cbc('0x2')][_0x7cbc('0x2a')](['UNSEEN'],this[_0x7cbc('0x2b')][_0x7cbc('0xb')](this));};EmailImap[_0x7cbc('0x10')]['handleReadUnseen']=function(_0x3722f2,_0x2f2d32){if(_0x3722f2){this[_0x7cbc('0xe')](_0x3722f2,!![]);}else{if(_0x2f2d32['length']){try{var _0x98e518=this[_0x7cbc('0x2')][_0x7cbc('0x2c')](_0x2f2d32,{'bodies':'','markSeen':!![]});_0x98e518['on'](_0x7cbc('0x2d'),this[_0x7cbc('0x2e')]['bind'](this));_0x98e518[_0x7cbc('0xa')](_0x7cbc('0xd'),this['handleFetchError'][_0x7cbc('0xb')](this));_0x98e518[_0x7cbc('0xa')]('end',this[_0x7cbc('0x2f')][_0x7cbc('0xb')](this));}catch(_0x224d04){logger['error'](_0x224d04);}}else{this[_0x7cbc('0x2')][_0x7cbc('0x30')](!![],this[_0x7cbc('0x27')][_0x7cbc('0xb')](this));}}};EmailImap[_0x7cbc('0x10')][_0x7cbc('0x2e')]=function(_0x202416){_0x202416['on'](_0x7cbc('0x31'),this[_0x7cbc('0x32')][_0x7cbc('0xb')](this));_0x202416['once'](_0x7cbc('0x33'),this[_0x7cbc('0x34')][_0x7cbc('0xb')](this));_0x202416[_0x7cbc('0xa')](_0x7cbc('0x28'),this[_0x7cbc('0x35')][_0x7cbc('0xb')](this));};EmailImap[_0x7cbc('0x10')][_0x7cbc('0x32')]=function(_0x3a3e5d){simpleParser(_0x3a3e5d,{'Iconv':Iconv},this[_0x7cbc('0x36')][_0x7cbc('0xb')](this));};EmailImap[_0x7cbc('0x10')][_0x7cbc('0x34')]=function(){};EmailImap['prototype'][_0x7cbc('0x35')]=function(){};EmailImap[_0x7cbc('0x10')][_0x7cbc('0x36')]=function(_0x3dc80e,_0x3ed344){if(_0x3dc80e){logger[_0x7cbc('0xd')](_0x3dc80e);}else{var _0x300721=this;utils[_0x7cbc('0x37')](this['account'],_0x3ed344,function(_0xdb0149){_0x300721[_0x7cbc('0x25')](_0x7cbc('0x1c'),_0xdb0149);});}};EmailImap[_0x7cbc('0x10')][_0x7cbc('0x2f')]=function(){this[_0x7cbc('0x2')][_0x7cbc('0x30')](!![],this[_0x7cbc('0x27')][_0x7cbc('0xb')](this));};EmailImap[_0x7cbc('0x10')][_0x7cbc('0x38')]=function(_0xf8ccfd){this[_0x7cbc('0xe')](_0xf8ccfd);this[_0x7cbc('0x2')][_0x7cbc('0x30')](!![],this[_0x7cbc('0x27')][_0x7cbc('0xb')](this));};EmailImap['prototype']['handleEnd']=function(){this['emit'](_0x7cbc('0x28'));};EmailImap[_0x7cbc('0x10')][_0x7cbc('0xe')]=function(_0x4b4279,_0x2374ad){logger[_0x7cbc('0xd')]('handleError',this['account'][_0x7cbc('0x1c')],JSON[_0x7cbc('0x39')](_0x4b4279));var _0x141894='';if(_0x4b4279){if(_0x4b4279[_0x7cbc('0x3a')]){_0x141894=_0x4b4279['textCode'];}else{for(var _0x4daf5 in _0x4b4279){if(_0x4b4279['hasOwnProperty'](_0x4daf5)){_0x141894+=_['upperFirst'](_0x4daf5)+':\x20'+_0x4b4279[_0x4daf5]+'\x0a';}}}}if(_0x2374ad){this['imap'][_0x7cbc('0x28')]();}else{this[_0x7cbc('0x25')](_0x7cbc('0xd'),_0x141894);this[_0x7cbc('0x25')]('end');}};module['exports']=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index ebce767..216a200 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 _0x48e3=['use','compile','sendMail','toString','verify','createTransport','nodemailer-plugin-inline-base64','prototype','send'];(function(_0xd21fe7,_0x225a39){var _0x14d570=function(_0x3c0674){while(--_0x3c0674){_0xd21fe7['push'](_0xd21fe7['shift']());}};_0x14d570(++_0x225a39);}(_0x48e3,0x1da));var _0x348e=function(_0xdc5654,_0xea4a9c){_0xdc5654=_0xdc5654-0x0;var _0x2541f8=_0x48e3[_0xdc5654];return _0x2541f8;};'use strict';var nodemailer=require('nodemailer');var inlineBase64=require(_0x348e('0x0'));function EmailSmtp(){}EmailSmtp[_0x348e('0x1')][_0x348e('0x2')]=function(_0x2097b0,_0x1732f9){return new Promise(function(_0x55fd5c,_0x725941){var _0x3af67e=nodemailer['createTransport'](_0x2097b0);_0x3af67e[_0x348e('0x3')](_0x348e('0x4'),inlineBase64());_0x3af67e[_0x348e('0x5')](_0x1732f9,function(_0x47d745,_0x95ed4f){if(_0x47d745){_0x725941(_0x47d745[_0x348e('0x6')]());}else{_0x55fd5c(_0x95ed4f);}});});};EmailSmtp['prototype'][_0x348e('0x7')]=function(_0x580051){return new Promise(function(_0x310b91,_0x593640){var _0x2dba23=nodemailer[_0x348e('0x8')](_0x580051);_0x2dba23[_0x348e('0x7')](function(_0x588dee,_0xb0a65e){if(_0x588dee){_0x593640(_0x588dee[_0x348e('0x6')]());}else{if(_0xb0a65e){_0x310b91(_0xb0a65e);}else{_0x593640('Not\x20verifired');}}});});};module['exports']=EmailSmtp; \ No newline at end of file +var _0xe75e=['nodemailer','send','use','sendMail','prototype','verify','createTransport','toString','Not\x20verifired','exports'];(function(_0x392d20,_0x3808ea){var _0xde6ade=function(_0x1dad45){while(--_0x1dad45){_0x392d20['push'](_0x392d20['shift']());}};_0xde6ade(++_0x3808ea);}(_0xe75e,0x1a4));var _0xee75=function(_0x3db122,_0x5e6bee){_0x3db122=_0x3db122-0x0;var _0x325b67=_0xe75e[_0x3db122];return _0x325b67;};'use strict';var nodemailer=require(_0xee75('0x0'));var inlineBase64=require('nodemailer-plugin-inline-base64');function EmailSmtp(){}EmailSmtp['prototype'][_0xee75('0x1')]=function(_0x31842f,_0x322b5c){return new Promise(function(_0xbc5ac1,_0x218504){var _0x2b6db9=nodemailer['createTransport'](_0x31842f);_0x2b6db9[_0xee75('0x2')]('compile',inlineBase64());_0x2b6db9[_0xee75('0x3')](_0x322b5c,function(_0x1d35e5,_0x1e5422){if(_0x1d35e5){_0x218504(_0x1d35e5['toString']());}else{_0xbc5ac1(_0x1e5422);}});});};EmailSmtp[_0xee75('0x4')][_0xee75('0x5')]=function(_0x7763a4){return new Promise(function(_0x4766fa,_0x51d8a1){var _0x514258=nodemailer[_0xee75('0x6')](_0x7763a4);_0x514258[_0xee75('0x5')](function(_0x184fab,_0x537cdc){if(_0x184fab){_0x51d8a1(_0x184fab[_0xee75('0x7')]());}else{if(_0x537cdc){_0x4766fa(_0x537cdc);}else{_0x51d8a1(_0xee75('0x8'));}}});});};module[_0xee75('0x9')]=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index 4c3d959..d077c80 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 _0x1794=['\x20]','body','Empty\x20message

','generateXOAuth2Token','user=','base64','moment','randomstring','path','../../../config/logger','email','head','address','generate','value','name','indexOf','length','slice','join','Anonymous','split','pop','anonymous','@xcally.com','html','replace','\x20[Attachment:\x20'];(function(_0x1e028c,_0x2bd5b0){var _0x336831=function(_0x506de1){while(--_0x506de1){_0x1e028c['push'](_0x1e028c['shift']());}};_0x336831(++_0x2bd5b0);}(_0x1794,0x69));var _0x4179=function(_0x1aa552,_0x3ac508){_0x1aa552=_0x1aa552-0x0;var _0x4a773d=_0x1794[_0x1aa552];return _0x4a773d;};'use strict';var _=require('lodash');var moment=require(_0x4179('0x0'));var random=require(_0x4179('0x1'));var fs=require('fs');var path=require(_0x4179('0x2'));var util=require('util');var tnef=require('node-tnef');var logger=require(_0x4179('0x3'))(_0x4179('0x4'));var config=require('../../../config/environment');function getAddress(_0x68ede7){var _0x139d2a=_[_0x4179('0x5')](_0x68ede7['value']);return _0x139d2a&&_0x139d2a[_0x4179('0x6')]?_0x139d2a[_0x4179('0x6')]:'anonymous'+random[_0x4179('0x7')](0x6)+'@xcally.com';}function getFirstName(_0x198019){var _0x54c5a9=_[_0x4179('0x5')](_0x198019[_0x4179('0x8')]);if(_0x54c5a9&&_0x54c5a9[_0x4179('0x9')]){if(_0x54c5a9['name']==_0x54c5a9[_0x4179('0x6')]){return _0x54c5a9['name']['substring'](0x0,_0x54c5a9[_0x4179('0x9')][_0x4179('0xa')]('@'));}var _0x52bcdd=_0x54c5a9[_0x4179('0x9')]['split'](/\s+/);return _0x52bcdd[_0x4179('0xb')]>0x1?_0x52bcdd[_0x4179('0xc')](0x0,-0x1)[_0x4179('0xd')]('\x20'):_0x54c5a9[_0x4179('0x9')];}return _0x4179('0xe');}function getLastName(_0x4a65fb){var _0x1138bc=_['head'](_0x4a65fb[_0x4179('0x8')]);if(_0x1138bc&&_0x1138bc['name']){var _0x5370f0=_0x1138bc[_0x4179('0x9')][_0x4179('0xf')](/\s+/);return _0x5370f0[_0x4179('0xb')]>0x1?_0x5370f0[_0x4179('0x10')]():'';}return'';}function getMails(_0x45a762,_0x388ca1){var _0xda12a7='';for(var _0x284b4c=0x0;_0x284b4c<_0x388ca1[_0x4179('0x8')][_0x4179('0xb')];_0x284b4c+=0x1){if(_0x388ca1[_0x4179('0x8')][_0x284b4c]['address']!==_0x45a762){if(!_['isEmpty'](_0xda12a7)){_0xda12a7+=',';}_0xda12a7+=_0x388ca1[_0x4179('0x8')][_0x284b4c][_0x4179('0x9')]||_0x388ca1[_0x4179('0x8')][_0x284b4c]['address']||'';_0xda12a7+='\x20<';_0xda12a7+=_0x388ca1[_0x4179('0x8')][_0x284b4c][_0x4179('0x6')]?_0x388ca1['value'][_0x284b4c][_0x4179('0x6')]:_0x4179('0x11')+random[_0x4179('0x7')](0x6)+_0x4179('0x12');_0xda12a7+='>';}}return _0xda12a7;}function parseEmail(_0x25a903,_0x267bec,_0x3efb9a){if(_0x267bec['html']){var _0x451fb7=/)<[^<]*)*<\/script>/gi;while(_0x451fb7['test'](_0x267bec[_0x4179('0x13')])){_0x267bec[_0x4179('0x13')]=_0x267bec[_0x4179('0x13')][_0x4179('0x14')](_0x451fb7,'');}if(_0x267bec[_0x4179('0x13')]['includes'](_0x4179('0x15'))){var _0x451002=[];_0x267bec[_0x4179('0x16')]['forEach'](_0x5d079a=>{_0x451002[_0x4179('0x17')](_0x5d079a['filename']);});var _0x282046=/]+>/g;var _0x173ba7=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x5a6549=_0x267bec['html'][_0x4179('0x14')](_0x173ba7,_0x4179('0x18'));var _0x2402d4=_0x5a6549[_0x4179('0x14')](_0x282046,_0x4179('0x19'));for(let _0x5b5a67=0x0;_0x5b5a67<_0x451002[_0x4179('0xb')];_0x5b5a67++){var _0xf7c0fe=_0x2402d4[_0x4179('0x14')](_0x4179('0x19'),_0x4179('0x1a')+_0x451002[_0x5b5a67]+_0x4179('0x1b'));_0x2402d4=_0xf7c0fe;}_0x267bec[_0x4179('0x13')]=_0x2402d4;}_0x3efb9a[_0x4179('0x1c')]=_0x267bec[_0x4179('0x13')];}else{_0x3efb9a['body']=_0x267bec['textAsHtml'];}if(_0x3efb9a[_0x4179('0x1c')]){_0x3efb9a[_0x4179('0x1c')]=_0x3efb9a['body'][_0x4179('0x14')](/0x0){var _0x1b0032=['Auto-Submitted:\x20auto-replied','X-Auto-Response-Suppress:\x20All','Precedence:\x20auto_reply'];for(var _0x11bc91=0x0;_0x11bc91<_0x267bec[_0x4179('0x2d')][_0x4179('0xb')];_0x11bc91++){var _0x917416=_[_0x4179('0xa')](_0x1b0032,_0x267bec[_0x4179('0x2d')][_0x11bc91][_0x4179('0x2e')]);if(_0x917416>=0x0){_0x3efb9a[_0x4179('0x2f')]=!![];}}}return _0x3efb9a;}exports[_0x4179('0x30')]=function(_0x5c6109,_0x3b9e38,_0x57e687){var _0x4a2871={'from':getAddress(_0x3b9e38[_0x4179('0x31')]),'firstName':getFirstName(_0x3b9e38['from']),'lastName':getLastName(_0x3b9e38[_0x4179('0x31')]),'mapKey':_0x4179('0x4'),'message':{'from':getMails(_0x5c6109[_0x4179('0x4')],_0x3b9e38[_0x4179('0x31')]),'to':_0x5c6109[_0x4179('0x4')],'cc':'','subject':_0x3b9e38[_0x4179('0x32')]||'','messageId':_0x3b9e38[_0x4179('0x33')],'inReplyTo':_0x3b9e38[_0x4179('0x34')],'sentAt':moment(_0x3b9e38['date'])[_0x4179('0x27')]('YYYY-MM-DD\x20HH:mm:ss'),'attach':![],'attachments':[]}};if(!_0x3b9e38[_0x4179('0x13')]&&!_0x3b9e38[_0x4179('0x35')]){var _0x2be6f3=_[_0x4179('0x36')](_0x3b9e38[_0x4179('0x16')],{'contentType':_0x4179('0x37')});if(_0x2be6f3[_0x4179('0xb')]){logger[_0x4179('0x38')](util[_0x4179('0x27')](_0x4179('0x39'),_0x3b9e38['messageId']));tnef['parseBuffer'](_[_0x4179('0x3a')](_0x2be6f3)[_0x4179('0x2b')],function(_0x5ebd5d,_0x3cce3b){if(_0x3cce3b){_0x3b9e38[_0x4179('0x13')]=_0x3cce3b[_0x4179('0x3b')]||'

Empty\x20message

';if(_0x3cce3b[_0x4179('0x3c')]){for(var _0x4f12e7=0x0;_0x4f12e7<_0x3cce3b[_0x4179('0x3c')][_0x4179('0xb')];_0x4f12e7++){var _0x21fa2a=_0x3cce3b['Attachments'][_0x4f12e7];_0x4a2871[_0x4179('0x1e')][_0x4179('0x16')][_0x4179('0x17')]({'filename':_0x21fa2a['Title'],'content':Buffer['from'](_0x21fa2a[_0x4179('0x3d')])});}}}_0x57e687(parseEmail(_0x5c6109,_0x3b9e38,_0x4a2871));});}else{_0x3b9e38[_0x4179('0x13')]=_0x4179('0x3e');_0x57e687(parseEmail(_0x5c6109,_0x3b9e38,_0x4a2871));}}else{_0x57e687(parseEmail(_0x5c6109,_0x3b9e38,_0x4a2871));}};exports[_0x4179('0x3f')]=function(_0x3837af,_0x44cd03){var _0x582758=[_0x4179('0x40')+(_0x44cd03||''),'auth=Bearer\x20'+_0x3837af,'',''];return Buffer[_0x4179('0x31')](_0x582758[_0x4179('0xd')](''),'utf-8')['toString'](_0x4179('0x41'));}; \ No newline at end of file +var _0x8222=['line','isAutoreply','parser','from','messageId','inReplyTo','format','YYYY-MM-DD\x20HH:mm:ss','filter','application/ms-tnef','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','first','BodyHTML','Attachments','Title','Data','

Empty\x20message

','generateXOAuth2Token','utf-8','toString','lodash','moment','randomstring','util','node-tnef','../../../config/logger','email','../../../config/environment','head','value','address','anonymous','@xcally.com','name','substring','indexOf','split','join','length','pop','isEmpty','generate','html','replace','includes','attachments','forEach','push','filename','_SRC','_IMG','\x20[Attachment:\x20','\x20]','body','textAsHtml','0x1?_0x27041c['slice'](0x0,-0x1)[_0x2822('0x11')]('\x20'):_0x42e989['name'];}return'Anonymous';}function getLastName(_0x3bd9bf){var _0x178755=_[_0x2822('0x8')](_0x3bd9bf[_0x2822('0x9')]);if(_0x178755&&_0x178755[_0x2822('0xd')]){var _0x873b66=_0x178755[_0x2822('0xd')][_0x2822('0x10')](/\s+/);return _0x873b66[_0x2822('0x12')]>0x1?_0x873b66[_0x2822('0x13')]():'';}return'';}function getMails(_0x401360,_0x5ca071){var _0x2ea73d='';for(var _0x1228e3=0x0;_0x1228e3<_0x5ca071[_0x2822('0x9')]['length'];_0x1228e3+=0x1){if(_0x5ca071[_0x2822('0x9')][_0x1228e3]['address']!==_0x401360){if(!_[_0x2822('0x14')](_0x2ea73d)){_0x2ea73d+=',';}_0x2ea73d+=_0x5ca071[_0x2822('0x9')][_0x1228e3][_0x2822('0xd')]||_0x5ca071[_0x2822('0x9')][_0x1228e3][_0x2822('0xa')]||'';_0x2ea73d+='\x20<';_0x2ea73d+=_0x5ca071['value'][_0x1228e3][_0x2822('0xa')]?_0x5ca071[_0x2822('0x9')][_0x1228e3][_0x2822('0xa')]:_0x2822('0xb')+random[_0x2822('0x15')](0x6)+_0x2822('0xc');_0x2ea73d+='>';}}return _0x2ea73d;}function parseEmail(_0x19fa14,_0x36249f,_0x586554){if(_0x36249f['html']){var _0x3bba3b=/)<[^<]*)*<\/script>/gi;while(_0x3bba3b['test'](_0x36249f[_0x2822('0x16')])){_0x36249f[_0x2822('0x16')]=_0x36249f[_0x2822('0x16')][_0x2822('0x17')](_0x3bba3b,'');}if(_0x36249f[_0x2822('0x16')][_0x2822('0x18')]('{_0x341502[_0x2822('0x1b')](_0x240841[_0x2822('0x1c')]);});var _0x49600d=/]+>/g;var _0xe1036c=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x927aba=_0x36249f[_0x2822('0x16')][_0x2822('0x17')](_0xe1036c,_0x2822('0x1d'));var _0x52ca4a=_0x927aba[_0x2822('0x17')](_0x49600d,'_IMG');for(let _0x25b256=0x0;_0x25b256<_0x341502[_0x2822('0x12')];_0x25b256++){var _0x5d1d7d=_0x52ca4a['replace'](_0x2822('0x1e'),_0x2822('0x1f')+_0x341502[_0x25b256]+_0x2822('0x20'));_0x52ca4a=_0x5d1d7d;}_0x36249f[_0x2822('0x16')]=_0x52ca4a;}_0x586554[_0x2822('0x21')]=_0x36249f[_0x2822('0x16')];}else{_0x586554[_0x2822('0x21')]=_0x36249f[_0x2822('0x22')];}if(_0x586554[_0x2822('0x21')]){_0x586554['body']=_0x586554[_0x2822('0x21')][_0x2822('0x17')](/0x0){var _0x43be1d=['Auto-Submitted:\x20auto-replied','X-Auto-Response-Suppress:\x20All',_0x2822('0x33')];for(var _0x33cd11=0x0;_0x33cd11<_0x36249f[_0x2822('0x32')][_0x2822('0x12')];_0x33cd11++){var _0x4205b9=_[_0x2822('0xf')](_0x43be1d,_0x36249f[_0x2822('0x32')][_0x33cd11][_0x2822('0x34')]);if(_0x4205b9>=0x0){_0x586554[_0x2822('0x35')]=!![];}}}return _0x586554;}exports[_0x2822('0x36')]=function(_0x4b09f,_0x4343ad,_0x4468b2){var _0x2aade6={'from':getAddress(_0x4343ad['from']),'firstName':getFirstName(_0x4343ad[_0x2822('0x37')]),'lastName':getLastName(_0x4343ad[_0x2822('0x37')]),'mapKey':_0x2822('0x6'),'message':{'from':getMails(_0x4b09f[_0x2822('0x6')],_0x4343ad[_0x2822('0x37')]),'to':_0x4b09f[_0x2822('0x6')],'cc':'','subject':_0x4343ad['subject']||'','messageId':_0x4343ad[_0x2822('0x38')],'inReplyTo':_0x4343ad[_0x2822('0x39')],'sentAt':moment(_0x4343ad['date'])[_0x2822('0x3a')](_0x2822('0x3b')),'attach':![],'attachments':[]}};if(!_0x4343ad['html']&&!_0x4343ad['textAsHtml']){var _0x1242b3=_[_0x2822('0x3c')](_0x4343ad[_0x2822('0x19')],{'contentType':_0x2822('0x3d')});if(_0x1242b3[_0x2822('0x12')]){logger['info'](util['format'](_0x2822('0x3e'),_0x4343ad[_0x2822('0x38')]));tnef['parseBuffer'](_[_0x2822('0x3f')](_0x1242b3)[_0x2822('0x30')],function(_0x126e48,_0x4700f4){if(_0x4700f4){_0x4343ad[_0x2822('0x16')]=_0x4700f4[_0x2822('0x40')]||'

Empty\x20message

';if(_0x4700f4[_0x2822('0x41')]){for(var _0x757982=0x0;_0x757982<_0x4700f4['Attachments'][_0x2822('0x12')];_0x757982++){var _0x4fc8d6=_0x4700f4['Attachments'][_0x757982];_0x2aade6[_0x2822('0x25')][_0x2822('0x19')][_0x2822('0x1b')]({'filename':_0x4fc8d6[_0x2822('0x42')],'content':Buffer[_0x2822('0x37')](_0x4fc8d6[_0x2822('0x43')])});}}}_0x4468b2(parseEmail(_0x4b09f,_0x4343ad,_0x2aade6));});}else{_0x4343ad[_0x2822('0x16')]=_0x2822('0x44');_0x4468b2(parseEmail(_0x4b09f,_0x4343ad,_0x2aade6));}}else{_0x4468b2(parseEmail(_0x4b09f,_0x4343ad,_0x2aade6));}};exports[_0x2822('0x45')]=function(_0xdb08f2,_0x1c1b1c){var _0x17f676=['user='+(_0x1c1b1c||''),'auth=Bearer\x20'+_0xdb08f2,'',''];return Buffer[_0x2822('0x37')](_0x17f676[_0x2822('0x11')](''),_0x2822('0x46'))[_0x2822('0x47')]('base64');}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index 8d9358f..20f3bc9 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 _0x8b0d=['Imap','Smtp','exports','lodash','name','key','SERV','active'];(function(_0x376b70,_0x3b05b0){var _0x2d5206=function(_0x58e805){while(--_0x58e805){_0x376b70['push'](_0x376b70['shift']());}};_0x2d5206(++_0x3b05b0);}(_0x8b0d,0x13b));var _0xd8b0=function(_0x4bf9e8,_0x15b76d){_0x4bf9e8=_0x4bf9e8-0x0;var _0x1f7d05=_0x8b0d[_0x4bf9e8];return _0x1f7d05;};'use strict';var _=require(_0xd8b0('0x0'));function MailAccount(_0x363f51){this['id']=_0x363f51['id']||0x0;this[_0xd8b0('0x1')]=_0x363f51[_0xd8b0('0x1')]||'Service';this[_0xd8b0('0x2')]=_0x363f51[_0xd8b0('0x2')]||_0xd8b0('0x3');this[_0xd8b0('0x4')]=_0x363f51['active']||![];this[_0xd8b0('0x5')]=_0x363f51['Imap']||[];this[_0xd8b0('0x6')]=_0x363f51[_0xd8b0('0x6')]||[];}module[_0xd8b0('0x7')]=MailAccount; \ No newline at end of file +var _0x6ce7=['key','SERV','active','Imap','Smtp','exports','lodash','name','Service'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x6ce7,0x153));var _0x76ce=function(_0x233268,_0xf00d3b){_0x233268=_0x233268-0x0;var _0x241674=_0x6ce7[_0x233268];return _0x241674;};'use strict';var _=require(_0x76ce('0x0'));function MailAccount(_0xb2cbe2){this['id']=_0xb2cbe2['id']||0x0;this[_0x76ce('0x1')]=_0xb2cbe2['name']||_0x76ce('0x2');this[_0x76ce('0x3')]=_0xb2cbe2[_0x76ce('0x3')]||_0x76ce('0x4');this[_0x76ce('0x5')]=_0xb2cbe2[_0x76ce('0x5')]||![];this[_0x76ce('0x6')]=_0xb2cbe2[_0x76ce('0x6')]||[];this[_0x76ce('0x7')]=_0xb2cbe2[_0x76ce('0x7')]||[];}module[_0x76ce('0x8')]=MailAccount; \ No newline at end of file diff --git a/server/services/email/realtime/index.js b/server/services/email/realtime/index.js index 2aa72b2..66d07b5 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 _0xe04f=['mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initMailAccounts','exports','lodash','mailAccounts'];(function(_0x594867,_0x2ee5d3){var _0x9ac5b1=function(_0x4609ec){while(--_0x4609ec){_0x594867['push'](_0x594867['shift']());}};_0x9ac5b1(++_0x2ee5d3);}(_0xe04f,0x1c6));var _0xfe04=function(_0xdd9a5f,_0x3ced93){_0xdd9a5f=_0xdd9a5f-0x0;var _0x3464b7=_0xe04f[_0xdd9a5f];return _0x3464b7;};'use strict';var _=require(_0xfe04('0x0'));var MailAccount=require('../model/mailAccount');var Realtime=function(){this[_0xfe04('0x1')]={};};function freeIsNotKey(_0x221b5c,_0x278fec,_0x15c71c){var _0x3b5cfb=_[_0xfe04('0x2')](_0x221b5c,function(_0x34dbe6,_0x3d5452){return _0x34dbe6[_0x15c71c];});for(var _0x21113b in _0x278fec){if(_0x278fec[_0xfe04('0x3')](_0x21113b)){if(!_0x3b5cfb[_0x21113b]){delete _0x278fec[_0x21113b];}}}}Realtime[_0xfe04('0x4')][_0xfe04('0x5')]=function(_0x3a9c8a,_0x523df1){for(var _0x3e1b74 in _0x523df1){if(_0x3a9c8a[_0xfe04('0x3')](_0x3e1b74)){_0x3a9c8a[_0x3e1b74]=_0x523df1[_0x3e1b74];}}};Realtime[_0xfe04('0x4')][_0xfe04('0x6')]=function(){var _0x2ca215=this;return function(_0x3c8c3f){if(_0x3c8c3f){freeIsNotKey(_0x3c8c3f,_0x2ca215[_0xfe04('0x1')],'id');for(var _0x588775=0x0,_0xeb3f03={},_0x1656a7={};_0x588775<_0x3c8c3f['length'];_0x588775+=0x1){_0xeb3f03=_0x3c8c3f[_0x588775];if(_['isUndefined'](_0x2ca215['mailAccounts'][_0xeb3f03['id']])){_0x2ca215[_0xfe04('0x1')][_0xeb3f03['id']]=new MailAccount(_0xeb3f03);}else{_['merge'](_0x2ca215[_0xfe04('0x1')][_0xeb3f03['id']],_0xeb3f03);}}}return _0x2ca215[_0xfe04('0x1')];};};module[_0xfe04('0x7')]=Realtime; \ No newline at end of file +var _0xa8c0=['mailAccounts','hasOwnProperty','mergeFromDatabase','prototype','initMailAccounts','isUndefined','merge','lodash','../model/mailAccount'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xa8c0,0x142));var _0x0a8c=function(_0x453e2b,_0x4f1258){_0x453e2b=_0x453e2b-0x0;var _0x50f306=_0xa8c0[_0x453e2b];return _0x50f306;};'use strict';var _=require(_0x0a8c('0x0'));var MailAccount=require(_0x0a8c('0x1'));var Realtime=function(){this[_0x0a8c('0x2')]={};};function freeIsNotKey(_0x26f417,_0x45c6c4,_0x5e30ca){var _0x951627=_['mapKeys'](_0x26f417,function(_0x22930c,_0x5eb7b0){return _0x22930c[_0x5e30ca];});for(var _0x546b0a in _0x45c6c4){if(_0x45c6c4[_0x0a8c('0x3')](_0x546b0a)){if(!_0x951627[_0x546b0a]){delete _0x45c6c4[_0x546b0a];}}}}Realtime['prototype'][_0x0a8c('0x4')]=function(_0x1b5158,_0x4ae3a0){for(var _0x4069c1 in _0x4ae3a0){if(_0x1b5158['hasOwnProperty'](_0x4069c1)){_0x1b5158[_0x4069c1]=_0x4ae3a0[_0x4069c1];}}};Realtime[_0x0a8c('0x5')][_0x0a8c('0x6')]=function(){var _0x3272a6=this;return function(_0x41bd06){if(_0x41bd06){freeIsNotKey(_0x41bd06,_0x3272a6['mailAccounts'],'id');for(var _0x461b58=0x0,_0x5ecb5c={},_0x59529d={};_0x461b58<_0x41bd06['length'];_0x461b58+=0x1){_0x5ecb5c=_0x41bd06[_0x461b58];if(_[_0x0a8c('0x7')](_0x3272a6[_0x0a8c('0x2')][_0x5ecb5c['id']])){_0x3272a6[_0x0a8c('0x2')][_0x5ecb5c['id']]=new MailAccount(_0x5ecb5c);}else{_[_0x0a8c('0x8')](_0x3272a6[_0x0a8c('0x2')][_0x5ecb5c['id']],_0x5ecb5c);}}}return _0x3272a6[_0x0a8c('0x2')];};};module['exports']=Realtime; \ No newline at end of file diff --git a/server/services/email/rpc/mailAccount.js b/server/services/email/rpc/mailAccount.js index 23c214b..36a51bc 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 _0x0e50=['getMailAccounts','Request','name','provider','service','email','active','ListId','MailServerIn','Imap','CloudProvider','data5','MailServerOut','Smtp','type','getMailAccount','notify','NotifyMailAccount','../client'];(function(_0x314a8c,_0x1c2e8d){var _0x1d4607=function(_0x3df20c){while(--_0x3df20c){_0x314a8c['push'](_0x314a8c['shift']());}};_0x1d4607(++_0x1c2e8d);}(_0x0e50,0x168));var _0x00e5=function(_0x25e7cb,_0x3579b7){_0x25e7cb=_0x25e7cb-0x0;var _0x375d92=_0x0e50[_0x25e7cb];return _0x375d92;};'use strict';var client=require(_0x00e5('0x0'));exports[_0x00e5('0x1')]=function(){return function(){return client[_0x00e5('0x2')]('GetMailAccount',{'options':{'attributes':['id',_0x00e5('0x3'),_0x00e5('0x4'),_0x00e5('0x5'),_0x00e5('0x6'),_0x00e5('0x7'),'key',_0x00e5('0x8'),'TemplateId'],'raw':![],'include':[{'model':_0x00e5('0x9'),'as':_0x00e5('0xa'),'include':[{'model':_0x00e5('0xb'),'attributes':['id',_0x00e5('0x3'),_0x00e5('0x5'),'type',_0x00e5('0xc')],'as':_0x00e5('0xb')}]},{'model':_0x00e5('0xd'),'as':_0x00e5('0xe'),'include':[{'model':_0x00e5('0xb'),'attributes':['id',_0x00e5('0x3'),'service',_0x00e5('0xf'),_0x00e5('0xc')],'as':'CloudProvider'}]}]},'log':_0x00e5('0x10')});};};exports[_0x00e5('0x11')]=function(_0x500b8b,_0x558dcb){return client[_0x00e5('0x2')](_0x00e5('0x12'),{'account':{'id':_0x500b8b},'body':_0x558dcb,'log':_0x00e5('0x12')});}; \ No newline at end of file +var _0xbd0a=['Request','service','email','active','key','ListId','TemplateId','MailServerIn','Imap','CloudProvider','type','data5','MailServerOut','name','notify','NotifyMailAccount','../client'];(function(_0xa3b265,_0x49b893){var _0x4390aa=function(_0x2642a2){while(--_0x2642a2){_0xa3b265['push'](_0xa3b265['shift']());}};_0x4390aa(++_0x49b893);}(_0xbd0a,0x1b9));var _0xabd0=function(_0x9364a3,_0x533868){_0x9364a3=_0x9364a3-0x0;var _0x1efdd4=_0xbd0a[_0x9364a3];return _0x1efdd4;};'use strict';var client=require(_0xabd0('0x0'));exports['getMailAccounts']=function(){return function(){return client[_0xabd0('0x1')]('GetMailAccount',{'options':{'attributes':['id','name','provider',_0xabd0('0x2'),_0xabd0('0x3'),_0xabd0('0x4'),_0xabd0('0x5'),_0xabd0('0x6'),_0xabd0('0x7')],'raw':![],'include':[{'model':_0xabd0('0x8'),'as':_0xabd0('0x9'),'include':[{'model':_0xabd0('0xa'),'attributes':['id','name',_0xabd0('0x2'),_0xabd0('0xb'),_0xabd0('0xc')],'as':'CloudProvider'}]},{'model':_0xabd0('0xd'),'as':'Smtp','include':[{'model':_0xabd0('0xa'),'attributes':['id',_0xabd0('0xe'),_0xabd0('0x2'),_0xabd0('0xb'),'data5'],'as':_0xabd0('0xa')}]}]},'log':'getMailAccount'});};};exports[_0xabd0('0xf')]=function(_0x3779fa,_0x1ad151){return client[_0xabd0('0x1')](_0xabd0('0x10'),{'account':{'id':_0x3779fa},'body':_0x1ad151,'log':_0xabd0('0x10')});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index 4d74444..248029a 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 _0x03c1=['GetSettings','../client','getSettings','Request','ShowSetting'];(function(_0x4854d6,_0x2f1264){var _0x3885c0=function(_0x4d564d){while(--_0x4d564d){_0x4854d6['push'](_0x4854d6['shift']());}};_0x3885c0(++_0x2f1264);}(_0x03c1,0x1c3));var _0x103c=function(_0x533528,_0x409d05){_0x533528=_0x533528-0x0;var _0x3189f1=_0x03c1[_0x533528];return _0x3189f1;};'use strict';var client=require(_0x103c('0x0'));exports[_0x103c('0x1')]=function(){return client[_0x103c('0x2')](_0x103c('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['loginMailFrequency']},'log':_0x103c('0x4')});}; \ No newline at end of file +var _0xdb59=['../client','getSettings','Request','ShowSetting','loginMailFrequency','GetSettings'];(function(_0x41f745,_0x4b5c4a){var _0x2cbbcb=function(_0x4d5c74){while(--_0x4d5c74){_0x41f745['push'](_0x41f745['shift']());}};_0x2cbbcb(++_0x4b5c4a);}(_0xdb59,0xd2));var _0x9db5=function(_0x18776a,_0x4fecab){_0x18776a=_0x18776a-0x0;var _0x484e4a=_0xdb59[_0x18776a];return _0x484e4a;};'use strict';var client=require(_0x9db5('0x0'));exports[_0x9db5('0x1')]=function(){return client[_0x9db5('0x2')](_0x9db5('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x9db5('0x4')]},'log':_0x9db5('0x5')});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index 94b36e5..c17d166 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(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xa9e0[_0x4fc9e6];return _0x551d28;};'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(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0xa9e0[_0x3c2a69];return _0x596bc8;};'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 7f3d9d0..629bb4e 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 _0xa82a=['adapter','../../config/triggers','default','../../config/socketio','../../config/express','../../routes','log','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','lodash','express','sticky-session','createServer','timeout','listen','port','socket.io','websocket','polling','defaults','redis'];(function(_0x329cc6,_0x5c7b33){var _0x4f0426=function(_0x30866a){while(--_0x30866a){_0x329cc6['push'](_0x329cc6['shift']());}};_0x4f0426(++_0x5c7b33);}(_0xa82a,0x105));var _0xaa82=function(_0x10cbca,_0x4d0c8d){_0x10cbca=_0x10cbca-0x0;var _0xbd5eef=_0xa82a[_0x10cbca];return _0xbd5eef;};'use strict';var _=require(_0xaa82('0x0'));var http=require('http');var express=require(_0xaa82('0x1'));var sticky=require(_0xaa82('0x2'));var Redis=require('ioredis');var config=require('../../config/environment');var app=express();var server=http[_0xaa82('0x3')](app);server[_0xaa82('0x4')]=0xdbba0;if(sticky[_0xaa82('0x5')](server,config[_0xaa82('0x6')])){var socketio=require(_0xaa82('0x7'))(server,{'transports':[_0xaa82('0x8'),_0xaa82('0x9')]});config['redis']=_[_0xaa82('0xa')](config[_0xaa82('0xb')],{'host':'localhost','port':0x18eb});socketio[_0xaa82('0xc')](require('socket.io-redis')({'pubClient':new Redis(config[_0xaa82('0xb')]),'subClient':new Redis(config['redis'])}));require(_0xaa82('0xd'))[_0xaa82('0xe')]();require(_0xaa82('0xf'))['default'](socketio);require(_0xaa82('0x10'))[_0xaa82('0xe')](app);require(_0xaa82('0x11'))[_0xaa82('0xe')](app);}else{server['once']('listening',function(){console[_0xaa82('0x12')](_0xaa82('0x13'),config['port']);});}exports=module[_0xaa82('0x14')]=app; \ No newline at end of file +var _0xc632=['../../config/socketio','../../config/express','../../routes','once','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','lodash','express','../../config/environment','createServer','timeout','listen','port','polling','redis','defaults','localhost','adapter','socket.io-redis','../../config/triggers','default'];(function(_0xd939a2,_0x3322ee){var _0x2135d5=function(_0x2afe3d){while(--_0x2afe3d){_0xd939a2['push'](_0xd939a2['shift']());}};_0x2135d5(++_0x3322ee);}(_0xc632,0x11c));var _0x2c63=function(_0x477024,_0x5bfbc1){_0x477024=_0x477024-0x0;var _0x1e2d0a=_0xc632[_0x477024];return _0x1e2d0a;};'use strict';var _=require(_0x2c63('0x0'));var http=require('http');var express=require(_0x2c63('0x1'));var sticky=require('sticky-session');var Redis=require('ioredis');var config=require(_0x2c63('0x2'));var app=express();var server=http[_0x2c63('0x3')](app);server[_0x2c63('0x4')]=0xdbba0;if(sticky[_0x2c63('0x5')](server,config[_0x2c63('0x6')])){var socketio=require('socket.io')(server,{'transports':['websocket',_0x2c63('0x7')]});config[_0x2c63('0x8')]=_[_0x2c63('0x9')](config[_0x2c63('0x8')],{'host':_0x2c63('0xa'),'port':0x18eb});socketio[_0x2c63('0xb')](require(_0x2c63('0xc'))({'pubClient':new Redis(config[_0x2c63('0x8')]),'subClient':new Redis(config[_0x2c63('0x8')])}));require(_0x2c63('0xd'))[_0x2c63('0xe')]();require(_0x2c63('0xf'))[_0x2c63('0xe')](socketio);require(_0x2c63('0x10'))['default'](app);require(_0x2c63('0x11'))[_0x2c63('0xe')](app);}else{server[_0x2c63('0x12')](_0x2c63('0x13'),function(){console[_0x2c63('0x14')](_0x2c63('0x15'),config[_0x2c63('0x6')]);});}exports=module[_0x2c63('0x16')]=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index f95b4bc..456471f 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 _0xfec1=['routing','client','http','Request','rpc','error','message','result','bluebird','../../config/logger'];(function(_0x143a22,_0x33a8fc){var _0x2be673=function(_0x1d3d8a){while(--_0x1d3d8a){_0x143a22['push'](_0x143a22['shift']());}};_0x2be673(++_0x33a8fc);}(_0xfec1,0x15c));var _0x1fec=function(_0x25cd6d,_0x30a718){_0x25cd6d=_0x25cd6d-0x0;var _0x7811e1=_0xfec1[_0x25cd6d];return _0x7811e1;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0x1fec('0x0'));var logger=require(_0x1fec('0x1'))(_0x1fec('0x2'));var client=jayson[_0x1fec('0x3')][_0x1fec('0x4')]({'port':0x2329});client[_0x1fec('0x5')]=function(_0x5bf3bf,_0x1923f4){return new BPromise(function(_0x9c7c3f,_0x3fdc1d){return client['request'](_0x5bf3bf,_0x1923f4)['then'](function(_0x2a6faa){logger['debug'](_0x1fec('0x6'),'routing',_0x5bf3bf,_0x1923f4,_0x2a6faa);if(_0x2a6faa[_0x1fec('0x7')]){logger[_0x1fec('0x7')]('rpc','routing',_0x5bf3bf,_0x2a6faa[_0x1fec('0x7')][_0x1fec('0x8')],_0x1923f4);return _0x3fdc1d(_0x2a6faa[_0x1fec('0x7')][_0x1fec('0x8')]);}else{return _0x9c7c3f(_0x2a6faa[_0x1fec('0x9')]);}})['catch'](function(_0x56b74d){logger[_0x1fec('0x7')](_0x1fec('0x6'),_0x1fec('0x2'),_0x5bf3bf,_0x56b74d,_0x1923f4);return _0x3fdc1d(_0x56b74d);});});};module['exports']=client; \ No newline at end of file +var _0x3e1a=['../../config/logger','routing','Request','then','debug','error','message','result','catch','rpc','exports','jayson/promise','bluebird'];(function(_0x1075a2,_0xb2f371){var _0x43f5f9=function(_0x2f7760){while(--_0x2f7760){_0x1075a2['push'](_0x1075a2['shift']());}};_0x43f5f9(++_0xb2f371);}(_0x3e1a,0x184));var _0xa3e1=function(_0x3c8ba8,_0x48882c){_0x3c8ba8=_0x3c8ba8-0x0;var _0x5c22cb=_0x3e1a[_0x3c8ba8];return _0x5c22cb;};'use strict';var jayson=require(_0xa3e1('0x0'));var BPromise=require(_0xa3e1('0x1'));var logger=require(_0xa3e1('0x2'))(_0xa3e1('0x3'));var client=jayson['client']['http']({'port':0x2329});client[_0xa3e1('0x4')]=function(_0x3d8989,_0x2c9032){return new BPromise(function(_0x376f76,_0x94ad8d){return client['request'](_0x3d8989,_0x2c9032)[_0xa3e1('0x5')](function(_0x3da8b2){logger[_0xa3e1('0x6')]('rpc','routing',_0x3d8989,_0x2c9032,_0x3da8b2);if(_0x3da8b2[_0xa3e1('0x7')]){logger[_0xa3e1('0x7')]('rpc',_0xa3e1('0x3'),_0x3d8989,_0x3da8b2[_0xa3e1('0x7')][_0xa3e1('0x8')],_0x2c9032);return _0x94ad8d(_0x3da8b2[_0xa3e1('0x7')][_0xa3e1('0x8')]);}else{return _0x376f76(_0x3da8b2[_0xa3e1('0x9')]);}})[_0xa3e1('0xa')](function(_0x39bf5a){logger[_0xa3e1('0x7')](_0xa3e1('0xb'),_0xa3e1('0x3'),_0x3d8989,_0x39bf5a,_0x2c9032);return _0x94ad8d(_0x39bf5a);});});};module[_0xa3e1('0xc')]=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index 04edc99..724443a 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 _0x6d8e=['./rpc/user','./rpc/interval','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','then','getAgents','initAgents','initIntervals','initOpenchannelQueues','getSmsQueues','initSmsQueues','initMailQueues','getFaxQueues','initFaxQueues','initWhatsappQueues','log','./server','./realtime'];(function(_0x1795df,_0xcb261e){var _0x3f13c0=function(_0x52c5cf){while(--_0x52c5cf){_0x1795df['push'](_0x1795df['shift']());}};_0x3f13c0(++_0xcb261e);}(_0x6d8e,0x1e2));var _0xe6d8=function(_0x1756e1,_0x3b74a9){_0x1756e1=_0x1756e1-0x0;var _0x2687fe=_0x6d8e[_0x1756e1];return _0x2687fe;};'use strict';var BPromise=require('bluebird');var server=require(_0xe6d8('0x0'));var Realtime=require(_0xe6d8('0x1'));var user=require(_0xe6d8('0x2'));var interval=require(_0xe6d8('0x3'));var openchannelQueue=require('./rpc/openchannelQueue');var chatQueue=require(_0xe6d8('0x4'));var smsQueue=require(_0xe6d8('0x5'));var mailQueue=require(_0xe6d8('0x6'));var faxQueue=require(_0xe6d8('0x7'));var whatsappQueue=require(_0xe6d8('0x8'));var realtime=new Realtime();function initRealtime(){return BPromise[_0xe6d8('0x9')]()[_0xe6d8('0xa')](user[_0xe6d8('0xb')]())[_0xe6d8('0xa')](realtime[_0xe6d8('0xc')]())[_0xe6d8('0xa')](interval['getIntervals']())[_0xe6d8('0xa')](realtime[_0xe6d8('0xd')]())['then'](openchannelQueue['getOpenchannelQueues']())[_0xe6d8('0xa')](realtime[_0xe6d8('0xe')]())[_0xe6d8('0xa')](chatQueue['getChatQueues']())[_0xe6d8('0xa')](realtime['initChatQueues']())[_0xe6d8('0xa')](smsQueue[_0xe6d8('0xf')]())[_0xe6d8('0xa')](realtime[_0xe6d8('0x10')]())[_0xe6d8('0xa')](mailQueue['getMailQueues']())[_0xe6d8('0xa')](realtime[_0xe6d8('0x11')]())['then'](faxQueue[_0xe6d8('0x12')]())[_0xe6d8('0xa')](realtime[_0xe6d8('0x13')]())[_0xe6d8('0xa')](whatsappQueue['getWhatsappQueues']())[_0xe6d8('0xa')](realtime[_0xe6d8('0x14')]())[_0xe6d8('0xa')](function(){return realtime;});}function main(){return server['listen'](realtime)[_0xe6d8('0xa')](function(_0x5e6478){return initRealtime();})[_0xe6d8('0xa')](function(_0x55ec30){return setInterval(initRealtime,0x1388);})['catch'](function(_0xbf36fa){console[_0xe6d8('0x15')](_0xbf36fa);});}main(); \ No newline at end of file +var _0xd8dd=['initWhatsappQueues','listen','catch','log','bluebird','./server','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','resolve','getAgents','initAgents','getIntervals','then','getOpenchannelQueues','getSmsQueues','initSmsQueues','getMailQueues','initFaxQueues','getWhatsappQueues'];(function(_0x43b690,_0x2fff39){var _0x4238d9=function(_0x2be612){while(--_0x2be612){_0x43b690['push'](_0x43b690['shift']());}};_0x4238d9(++_0x2fff39);}(_0xd8dd,0x1e4));var _0xdd8d=function(_0x5b6575,_0x3e73de){_0x5b6575=_0x5b6575-0x0;var _0x320d16=_0xd8dd[_0x5b6575];return _0x320d16;};'use strict';var BPromise=require(_0xdd8d('0x0'));var server=require(_0xdd8d('0x1'));var Realtime=require('./realtime');var user=require(_0xdd8d('0x2'));var interval=require(_0xdd8d('0x3'));var openchannelQueue=require(_0xdd8d('0x4'));var chatQueue=require(_0xdd8d('0x5'));var smsQueue=require(_0xdd8d('0x6'));var mailQueue=require(_0xdd8d('0x7'));var faxQueue=require(_0xdd8d('0x8'));var whatsappQueue=require('./rpc/whatsappQueue');var realtime=new Realtime();function initRealtime(){return BPromise[_0xdd8d('0x9')]()['then'](user[_0xdd8d('0xa')]())['then'](realtime[_0xdd8d('0xb')]())['then'](interval[_0xdd8d('0xc')]())[_0xdd8d('0xd')](realtime['initIntervals']())[_0xdd8d('0xd')](openchannelQueue[_0xdd8d('0xe')]())[_0xdd8d('0xd')](realtime['initOpenchannelQueues']())[_0xdd8d('0xd')](chatQueue['getChatQueues']())[_0xdd8d('0xd')](realtime['initChatQueues']())[_0xdd8d('0xd')](smsQueue[_0xdd8d('0xf')]())[_0xdd8d('0xd')](realtime[_0xdd8d('0x10')]())[_0xdd8d('0xd')](mailQueue[_0xdd8d('0x11')]())['then'](realtime['initMailQueues']())['then'](faxQueue['getFaxQueues']())[_0xdd8d('0xd')](realtime[_0xdd8d('0x12')]())[_0xdd8d('0xd')](whatsappQueue[_0xdd8d('0x13')]())[_0xdd8d('0xd')](realtime[_0xdd8d('0x14')]())[_0xdd8d('0xd')](function(){return realtime;});}function main(){return server[_0xdd8d('0x15')](realtime)[_0xdd8d('0xd')](function(_0x59db10){return initRealtime();})['then'](function(_0x56df1d){return setInterval(initRealtime,0x1388);})[_0xdd8d('0x16')](function(_0x4156de){console[_0xdd8d('0x17')](_0x4156de);});}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 717b700..d433018 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 _0x5fc3=['lodash','util','EventEmitter','init','isNil','ignoreFactChanges','inherits','activeRules','prototype','register','isArray','rules','isObject','sync','orderBy','asc','execute','clone','ruleRef','name','index_','push','call','nextTick','next','isEqual','restart','length','condition','matchPath','noop','findRules','filter','prioritize','priority','toJSON','map','consequence','toString','fromJSON','isString','parse'];(function(_0x4f2498,_0x6428e1){var _0xe9a958=function(_0x174154){while(--_0x174154){_0x4f2498['push'](_0x4f2498['shift']());}};_0xe9a958(++_0x6428e1);}(_0x5fc3,0xa8));var _0x35fc=function(_0x27dba4,_0x419253){_0x27dba4=_0x27dba4-0x0;var _0x35ec9d=_0x5fc3[_0x27dba4];return _0x35ec9d;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var EventEmitter=require('events')[_0x35fc('0x2')];function RuleEngine(_0x2ac6da,_0x196bc2){this[_0x35fc('0x3')]();if(!_[_0x35fc('0x4')](_0x2ac6da)){this['register'](_0x2ac6da);}if(_0x196bc2){this[_0x35fc('0x5')]=_0x196bc2[_0x35fc('0x5')];}return this;}util[_0x35fc('0x6')](RuleEngine,EventEmitter);RuleEngine['prototype']['init']=function(_0x19a0d1){this['rules']=[];this[_0x35fc('0x7')]=[];};RuleEngine[_0x35fc('0x8')][_0x35fc('0x9')]=function(_0x1e5f90){if(Array[_0x35fc('0xa')](_0x1e5f90)){this[_0x35fc('0xb')]=this[_0x35fc('0xb')]['concat'](_0x1e5f90);}else if(_0x1e5f90!==null&&_[_0x35fc('0xc')](_0x1e5f90)){this[_0x35fc('0xb')]['push'](_0x1e5f90);}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')]['sync']=function(){this[_0x35fc('0x7')]=this[_0x35fc('0xb')]['filter'](function(_0x4cbe74){if(_[_0x35fc('0x4')](_0x4cbe74['on'])){_0x4cbe74['on']=!![];}if(_0x4cbe74['on']===!![]){return _0x4cbe74;}});this['activeRules']=_[_0x35fc('0xe')](this[_0x35fc('0x7')],['p'],[_0x35fc('0xf')]);};RuleEngine[_0x35fc('0x8')][_0x35fc('0x10')]=function(_0x5cfe94,_0x59507a){var _0x5eac0f=![];_0x5cfe94['result']=!![];var _0x398b67=_[_0x35fc('0x11')](_0x5cfe94);var _0x53b898=_[_0x35fc('0x11')](_0x5cfe94);var _0x227a49=this[_0x35fc('0x7')];var _0x480851=[];var _0x26ba54=this[_0x35fc('0x5')];(function FnRuleLoop(_0x553677){var _0x41e165={'rules':function(){return _0x227a49;},'rule':function(){return _0x227a49[_0x553677];},'when':function(_0x363e47){if(_0x363e47){var _0x2e513b=_0x227a49[_0x553677]['consequence'];_0x2e513b[_0x35fc('0x12')]=_0x227a49[_0x553677]['id']||_0x227a49[_0x553677][_0x35fc('0x13')]||_0x35fc('0x14')+_0x553677;process['nextTick'](function(){_0x480851[_0x35fc('0x15')](_0x2e513b[_0x35fc('0x12')]);_0x2e513b[_0x35fc('0x16')](_0x398b67,_0x41e165);});}else{process[_0x35fc('0x17')](function(){_0x41e165[_0x35fc('0x18')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x5eac0f=!![];return FnRuleLoop(0x0);},'next':function(_0x21f1a9){if(!_0x26ba54&&!_[_0x35fc('0x19')](_0x53b898,_0x398b67)){_0x53b898=_[_0x35fc('0x11')](_0x398b67);process[_0x35fc('0x17')](function(){_0x41e165[_0x35fc('0x1a')]();});}else{process['nextTick'](function(){if(_[_0x35fc('0x4')](_0x21f1a9)){return FnRuleLoop(_0x553677+0x1);}else{return FnRuleLoop(_0x21f1a9);}});}}};if(_0x553677<_0x227a49[_0x35fc('0x1b')]&&_0x5eac0f===![]){var _0x257719=_0x227a49[_0x553677][_0x35fc('0x1c')];_0x257719[_0x35fc('0x16')](_0x398b67,_0x41e165);}else{process['nextTick'](function(){_0x398b67[_0x35fc('0x1d')]=_0x480851;return _0x59507a?_0x59507a(_0x398b67):_[_0x35fc('0x1e')]();});}}(0x0));};RuleEngine['prototype'][_0x35fc('0x1f')]=function(_0x5a93df){if(_[_0x35fc('0x4')](_0x5a93df)){return this['rules'];}else{var _0x4086e9=_['matches'](_0x5a93df);return _[_0x35fc('0x20')](this[_0x35fc('0xb')],_0x4086e9);}};RuleEngine['prototype']['turn']=function(_0x47774c,_0x58edb6){var _0x274208=_0x47774c==='on'||_0x47774c==='ON'?!![]:![];var _0x1a5d92=this['findRules'](_0x58edb6);for(var _0x26b7cb=0x0,_0x645eac=_0x1a5d92[_0x35fc('0x1b')];_0x26b7cb<_0x645eac;_0x26b7cb+=0x1){_0x1a5d92[_0x26b7cb]['on']=_0x274208;}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')][_0x35fc('0x21')]=function(_0x11ccdb,_0x451f0c){_0x11ccdb=parseInt(_0x11ccdb,0xa);var _0x54aedc=this[_0x35fc('0x1f')](_0x451f0c);for(var _0x220931=0x0,_0x22af18=_0x54aedc['length'];_0x220931<_0x22af18;_0x220931+=0x1){_0x54aedc[_0x220931][_0x35fc('0x22')]=_0x11ccdb;}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')][_0x35fc('0x23')]=function(){var _0xd8a4ca=this[_0x35fc('0xb')];if(_0xd8a4ca instanceof Array){_0xd8a4ca=_0xd8a4ca[_0x35fc('0x24')](function(_0x37b435){_0x37b435[_0x35fc('0x1c')]=_0x37b435[_0x35fc('0x1c')]['toString']();_0x37b435['consequence']=_0x37b435[_0x35fc('0x25')]['toString']();return _0x37b435;});}else if(!_[_0x35fc('0x4')](_0xd8a4ca)){_0xd8a4ca[_0x35fc('0x1c')]=_0xd8a4ca[_0x35fc('0x1c')][_0x35fc('0x26')]();_0xd8a4ca[_0x35fc('0x25')]=_0xd8a4ca[_0x35fc('0x25')]['toString']();}return _0xd8a4ca;};RuleEngine[_0x35fc('0x8')][_0x35fc('0x27')]=function(_0x46b9ef){this[_0x35fc('0x3')]();if(_[_0x35fc('0x28')](_0x46b9ef)){_0x46b9ef=JSON[_0x35fc('0x29')](_0x46b9ef);}if(_0x46b9ef instanceof Array){_0x46b9ef=_0x46b9ef['map'](function(_0x2483be){_0x2483be[_0x35fc('0x1c')]=eval('('+_0x2483be[_0x35fc('0x1c')]+')');_0x2483be['consequence']=eval('('+_0x2483be[_0x35fc('0x25')]+')');return _0x2483be;});}else if(_0x46b9ef!==null&&typeof _0x46b9ef=='object'){_0x46b9ef[_0x35fc('0x1c')]=eval('('+_0x46b9ef[_0x35fc('0x1c')]+')');_0x46b9ef[_0x35fc('0x25')]=eval('('+_0x46b9ef[_0x35fc('0x25')]+')');}this['register'](_0x46b9ef);};module['exports']=RuleEngine; \ No newline at end of file +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(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x1261,0x144));var _0x1126=function(_0x349148,_0x31eabb){_0x349148=_0x349148-0x0;var _0x2f2b0f=_0x1261[_0x349148];return _0x2f2b0f;};'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 diff --git a/server/services/routing/mailRpc/index.js b/server/services/routing/mailRpc/index.js index 2173436..b21e37d 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 _0x8eb8=['error','catch','sendMailMessage','SendMail','bluebird','http','then'];(function(_0x31122e,_0x24fbf7){var _0x54922b=function(_0x142778){while(--_0x142778){_0x31122e['push'](_0x31122e['shift']());}};_0x54922b(++_0x24fbf7);}(_0x8eb8,0x7b));var _0x88eb=function(_0x181ea9,_0x330e48){_0x181ea9=_0x181ea9-0x0;var _0x15d704=_0x8eb8[_0x181ea9];return _0x15d704;};'use strict';var BPromise=require(_0x88eb('0x0'));var jayson=require('jayson/promise');var client=jayson['client'][_0x88eb('0x1')]({'port':0x232b});function request(_0xadfab,_0x449ff0){return new BPromise(function(_0x4c5e9d,_0x1ddc63){return client['request'](_0xadfab,_0x449ff0)[_0x88eb('0x2')](function(_0x34e0ba){if(_0x34e0ba[_0x88eb('0x3')]){return _0x1ddc63(_0x34e0ba[_0x88eb('0x3')]['message']);}else{return _0x4c5e9d(_0x34e0ba['result']);}})[_0x88eb('0x4')](function(_0x3c5be9){return _0x1ddc63(_0x3c5be9);});});}exports[_0x88eb('0x5')]=function(_0x170aa3,_0x2eb741){return request(_0x88eb('0x6'),{'account':_0x170aa3,'message':_0x2eb741});}; \ No newline at end of file +var _0x7e83=['sendMailMessage','bluebird','jayson/promise','client','http','request','then','error','message','result','catch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7e83,0xbc));var _0x37e8=function(_0x1dd532,_0x36e81c){_0x1dd532=_0x1dd532-0x0;var _0x3732aa=_0x7e83[_0x1dd532];return _0x3732aa;};'use strict';var BPromise=require(_0x37e8('0x0'));var jayson=require(_0x37e8('0x1'));var client=jayson[_0x37e8('0x2')][_0x37e8('0x3')]({'port':0x232b});function request(_0x3d5513,_0x336422){return new BPromise(function(_0x2dc996,_0x4dc289){return client[_0x37e8('0x4')](_0x3d5513,_0x336422)[_0x37e8('0x5')](function(_0x5eea91){if(_0x5eea91[_0x37e8('0x6')]){return _0x4dc289(_0x5eea91[_0x37e8('0x6')][_0x37e8('0x7')]);}else{return _0x2dc996(_0x5eea91[_0x37e8('0x8')]);}})[_0x37e8('0x9')](function(_0x2d4168){return _0x4dc289(_0x2d4168);});});}exports[_0x37e8('0xa')]=function(_0x362b2e,_0x3a1b30){return request('SendMail',{'account':_0x362b2e,'message':_0x3a1b30});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index d270ad0..51092be 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 _0x2533=['exports','lodash','moment','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','voicePause','chatPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCurrentCapacity','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatusTime','faxCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','busy','busyQueue','md5','faxWaitingInteractions','mailWaitingInteractions','openchannelWaitingInteractions','smsWaitingInteractions','whatsappWaitingInteractions','updateRealtime','prototype','CurrentCapacity','Capacity','working','idle','chat','fax','whatsapp','length','getChannelStatus','Status','StatusTime','toNumber','mailPause','mailStatus','faxStatus','whatsappStatus','openchannelCurrentCapacity','chatWaitingInteractions','emit','user:routing:update'];(function(_0x238bcb,_0xdedc35){var _0x21021a=function(_0x35de35){while(--_0x35de35){_0x238bcb['push'](_0x238bcb['shift']());}};_0x21021a(++_0xdedc35);}(_0x2533,0x7f));var _0x3253=function(_0x223461,_0x2bca70){_0x223461=_0x223461-0x0;var _0x4dbe0a=_0x2533[_0x223461];return _0x4dbe0a;};'use strict';var _=require(_0x3253('0x0'));var moment=require(_0x3253('0x1'));var md5=require('md5');var Redis=require(_0x3253('0x2'));var config=require(_0x3253('0x3'));config[_0x3253('0x4')]=_[_0x3253('0x5')](config[_0x3253('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x3253('0x6'))(new Redis(config[_0x3253('0x4')]));function Agent(_0x5bca61){this['id']=_0x5bca61['id']||0x0;this[_0x3253('0x7')]=_0x5bca61[_0x3253('0x7')]||'';this[_0x3253('0x8')]=_0x5bca61[_0x3253('0x8')]||![];this['chatPause']=_0x5bca61[_0x3253('0x9')]||![];this['mailPause']=_0x5bca61['mailPause']||![];this[_0x3253('0xa')]=_0x5bca61['faxPause']||![];this[_0x3253('0xb')]=_0x5bca61[_0x3253('0xb')]||![];this[_0x3253('0xc')]=_0x5bca61[_0x3253('0xc')]||![];this[_0x3253('0xd')]=_0x3253('0xe');this[_0x3253('0xf')]=0x0;this['chatCapacity']=_0x5bca61['chatCapacity']||0x0;this[_0x3253('0x10')]=0x0;this['mailStatus']=_0x3253('0xe');this[_0x3253('0x11')]=0x0;this[_0x3253('0x12')]=_0x5bca61[_0x3253('0x12')]||0x0;this[_0x3253('0x13')]=0x0;this['faxStatus']=_0x3253('0xe');this[_0x3253('0x14')]=0x0;this['faxCapacity']=_0x5bca61[_0x3253('0x15')]||0x0;this['faxCurrentCapacity']=0x0;this[_0x3253('0x16')]=_0x3253('0xe');this[_0x3253('0x17')]=0x0;this['smsCapacity']=_0x5bca61[_0x3253('0x18')]||0x0;this[_0x3253('0x19')]=0x0;this['whatsappStatus']=_0x3253('0xe');this[_0x3253('0x1a')]=0x0;this[_0x3253('0x1b')]=_0x5bca61[_0x3253('0x1b')]||0x0;this[_0x3253('0x1c')]=0x0;this[_0x3253('0x1d')]=_0x3253('0xe');this[_0x3253('0x1e')]=0x0;this[_0x3253('0x1f')]=_0x5bca61[_0x3253('0x1f')]||0x0;this['openchannelCurrentCapacity']=0x0;this[_0x3253('0x20')]=![];this[_0x3253('0x21')]=undefined;this[_0x3253('0x22')]='';this['chatWaitingInteractions']={};this[_0x3253('0x23')]={};this[_0x3253('0x24')]={};this[_0x3253('0x25')]={};this[_0x3253('0x26')]={};this[_0x3253('0x27')]={};this[_0x3253('0x28')]();}Agent[_0x3253('0x29')]['getChannelStatus']=function(_0x395513){if(this[_0x395513+'CurrentCapacity']>0x0){if(this[_0x395513+'Capacity']>0x0&&this[_0x395513+_0x3253('0x2a')]>=this[_0x395513+_0x3253('0x2b')]){return'maxcapacity';}else{return _0x3253('0x2c');}}else{return _0x3253('0x2d');}};Agent[_0x3253('0x29')][_0x3253('0x28')]=function(){var _0x50df97=['mail',_0x3253('0x2e'),'openchannel',_0x3253('0x2f'),'sms',_0x3253('0x30')];for(var _0x70794=0x0;_0x70794<_0x50df97[_0x3253('0x31')];_0x70794+=0x1){var _0x215880=this[_0x3253('0x32')](_0x50df97[_0x70794]);if(this[_0x50df97[_0x70794]+_0x3253('0x33')]!==_0x215880){this[_0x50df97[_0x70794]+_0x3253('0x34')]=_[_0x3253('0x35')](moment()['format']('x'));}this[_0x50df97[_0x70794]+'Status']=_0x215880;}var _0xf4afe8={'id':this['id'],'name':this['name'],'online':this['online'],'voicePause':this['voicePause'],'chatPause':this[_0x3253('0x9')],'mailPause':this[_0x3253('0x36')],'smsPause':this[_0x3253('0xb')],'faxPause':this[_0x3253('0xa')],'openchannelPause':this[_0x3253('0xc')],'chatStatus':this['chatStatus'],'chatStatusTime':this[_0x3253('0xf')],'chatCapacity':this['chatCapacity'],'chatCurrentCapacity':this[_0x3253('0x10')],'mailStatus':this[_0x3253('0x37')],'mailStatusTime':this[_0x3253('0x11')],'mailCapacity':this[_0x3253('0x12')],'mailCurrentCapacity':this[_0x3253('0x13')],'faxStatus':this[_0x3253('0x38')],'faxStatusTime':this[_0x3253('0x14')],'faxCapacity':this[_0x3253('0x15')],'faxCurrentCapacity':this['faxCurrentCapacity'],'smsStatus':this[_0x3253('0x16')],'smsStatusTime':this[_0x3253('0x17')],'smsCapacity':this['smsCapacity'],'smsCurrentCapacity':this[_0x3253('0x19')],'whatsappStatus':this[_0x3253('0x39')],'whatsappStatusTime':this['whatsappStatusTime'],'whatsappCapacity':this[_0x3253('0x1b')],'whatsappCurrentCapacity':this[_0x3253('0x1c')],'openchannelStatus':this[_0x3253('0x1d')],'openchannelStatusTime':this[_0x3253('0x1e')],'openchannelCapacity':this[_0x3253('0x1f')],'openchannelCurrentCapacity':this[_0x3253('0x3a')],'busy':this[_0x3253('0x20')],'busyQueue':this['busyQueue'],'chatWaitingInteractions':this[_0x3253('0x3b')],'faxWaitingInteractions':this[_0x3253('0x23')],'mailWaitingInteractions':this[_0x3253('0x24')],'openchannelWaitingInteractions':this[_0x3253('0x25')],'smsWaitingInteractions':this[_0x3253('0x26')],'whatsappWaitingInteractions':this['whatsappWaitingInteractions']};var _0x1bf879=md5(JSON['stringify'](_0xf4afe8));if(this[_0x3253('0x22')]!==_0x1bf879){this[_0x3253('0x22')]=_0x1bf879;io[_0x3253('0x3c')](_0x3253('0x3d'),_0xf4afe8);}};module[_0x3253('0x3e')]=Agent; \ No newline at end of file +var _0xffd6=['idle','mail','openchannel','fax','length','StatusTime','format','Status','chatStatusTime','chatCurrentCapacity','faxStatus','faxStatusTime','smsStatus','whatsappCurrentCapacity','openchannelStatus','busy','busyQueue','faxWaitingInteractions','whatsappWaitingInteractions','stringify','user:routing:update','omit','exports','lodash','md5','moment','redis','defaults','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatCapacity','mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity','faxCapacity','faxCurrentCapacity','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','chatWaitingInteractions','mailWaitingInteractions','openchannelWaitingInteractions','smsWaitingInteractions','updateRealtime','prototype','CurrentCapacity','Capacity','maxcapacity'];(function(_0x26a75b,_0xb67cfa){var _0x5f554d=function(_0x20744d){while(--_0x20744d){_0x26a75b['push'](_0x26a75b['shift']());}};_0x5f554d(++_0xb67cfa);}(_0xffd6,0x97));var _0x6ffd=function(_0x16db8b,_0xca7d28){_0x16db8b=_0x16db8b-0x0;var _0x5ba017=_0xffd6[_0x16db8b];return _0x5ba017;};'use strict';var _=require(_0x6ffd('0x0'));var md5=require(_0x6ffd('0x1'));var moment=require(_0x6ffd('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');config[_0x6ffd('0x3')]=_[_0x6ffd('0x4')](config[_0x6ffd('0x3')],{'host':'localhost','port':0x18eb});var io=require(_0x6ffd('0x5'))(new Redis(config[_0x6ffd('0x3')]));function Agent(_0x3b8a46){this['id']=_0x3b8a46['id']||0x0;this[_0x6ffd('0x6')]=_0x3b8a46['name']||'';this[_0x6ffd('0x7')]=_0x3b8a46[_0x6ffd('0x7')]||!![];this[_0x6ffd('0x8')]=_0x3b8a46[_0x6ffd('0x8')]||![];this[_0x6ffd('0x9')]=_0x3b8a46['chatPause']||![];this[_0x6ffd('0xa')]=_0x3b8a46[_0x6ffd('0xa')]||![];this['faxPause']=_0x3b8a46[_0x6ffd('0xb')]||![];this[_0x6ffd('0xc')]=_0x3b8a46[_0x6ffd('0xc')]||![];this[_0x6ffd('0xd')]=_0x3b8a46[_0x6ffd('0xd')]||![];this[_0x6ffd('0xe')]=_0x6ffd('0xf');this['chatStatusTime']=0x0;this[_0x6ffd('0x10')]=_0x3b8a46[_0x6ffd('0x10')]||0x0;this['chatCurrentCapacity']=0x0;this[_0x6ffd('0x11')]=_0x6ffd('0xf');this[_0x6ffd('0x12')]=0x0;this[_0x6ffd('0x13')]=_0x3b8a46['mailCapacity']||0x0;this[_0x6ffd('0x14')]=0x0;this['faxStatus']=_0x6ffd('0xf');this['faxStatusTime']=0x0;this[_0x6ffd('0x15')]=_0x3b8a46[_0x6ffd('0x15')]||0x0;this[_0x6ffd('0x16')]=0x0;this['smsStatus']=_0x6ffd('0xf');this[_0x6ffd('0x17')]=0x0;this[_0x6ffd('0x18')]=_0x3b8a46[_0x6ffd('0x18')]||0x0;this[_0x6ffd('0x19')]=0x0;this[_0x6ffd('0x1a')]=_0x6ffd('0xf');this[_0x6ffd('0x1b')]=0x0;this['whatsappCapacity']=_0x3b8a46[_0x6ffd('0x1c')]||0x0;this['whatsappCurrentCapacity']=0x0;this['openchannelStatus']=_0x6ffd('0xf');this[_0x6ffd('0x1d')]=0x0;this['openchannelCapacity']=_0x3b8a46[_0x6ffd('0x1e')]||0x0;this[_0x6ffd('0x1f')]=0x0;this['busy']=![];this['busyQueue']=undefined;this[_0x6ffd('0x1')]='';this[_0x6ffd('0x20')]={};this['faxWaitingInteractions']={};this[_0x6ffd('0x21')]={};this[_0x6ffd('0x22')]={};this[_0x6ffd('0x23')]={};this['whatsappWaitingInteractions']={};this[_0x6ffd('0x24')]();}Agent[_0x6ffd('0x25')]['getChannelStatus']=function(_0x356c9c){if(this[_0x356c9c+_0x6ffd('0x26')]>0x0){if(this[_0x356c9c+'Capacity']>0x0&&this[_0x356c9c+_0x6ffd('0x26')]>=this[_0x356c9c+_0x6ffd('0x27')]){return _0x6ffd('0x28');}else{return'working';}}else{return _0x6ffd('0x29');}};Agent[_0x6ffd('0x25')][_0x6ffd('0x24')]=function(){var _0x4ae7ac=[_0x6ffd('0x2a'),'chat',_0x6ffd('0x2b'),_0x6ffd('0x2c'),'sms','whatsapp'];for(var _0x252201=0x0;_0x252201<_0x4ae7ac[_0x6ffd('0x2d')];_0x252201+=0x1){var _0x1934d4=this['getChannelStatus'](_0x4ae7ac[_0x252201]);if(this[_0x4ae7ac[_0x252201]+'Status']!==_0x1934d4){this[_0x4ae7ac[_0x252201]+_0x6ffd('0x2e')]=_['toNumber'](moment()[_0x6ffd('0x2f')]('x'));}this[_0x4ae7ac[_0x252201]+_0x6ffd('0x30')]=_0x1934d4;}var _0x51fdb6={'id':this['id'],'name':this[_0x6ffd('0x6')],'online':this[_0x6ffd('0x7')],'voicePause':this[_0x6ffd('0x8')],'chatPause':this[_0x6ffd('0x9')],'mailPause':this[_0x6ffd('0xa')],'smsPause':this[_0x6ffd('0xc')],'faxPause':this[_0x6ffd('0xb')],'openchannelPause':this[_0x6ffd('0xd')],'chatStatus':this[_0x6ffd('0xe')],'chatStatusTime':this[_0x6ffd('0x31')],'chatCapacity':this[_0x6ffd('0x10')],'chatCurrentCapacity':this[_0x6ffd('0x32')],'mailStatus':this[_0x6ffd('0x11')],'mailStatusTime':this['mailStatusTime'],'mailCapacity':this['mailCapacity'],'mailCurrentCapacity':this['mailCurrentCapacity'],'faxStatus':this[_0x6ffd('0x33')],'faxStatusTime':this[_0x6ffd('0x34')],'faxCapacity':this[_0x6ffd('0x15')],'faxCurrentCapacity':this[_0x6ffd('0x16')],'smsStatus':this[_0x6ffd('0x35')],'smsStatusTime':this[_0x6ffd('0x17')],'smsCapacity':this[_0x6ffd('0x18')],'smsCurrentCapacity':this[_0x6ffd('0x19')],'whatsappStatus':this[_0x6ffd('0x1a')],'whatsappStatusTime':this[_0x6ffd('0x1b')],'whatsappCapacity':this[_0x6ffd('0x1c')],'whatsappCurrentCapacity':this[_0x6ffd('0x36')],'openchannelStatus':this[_0x6ffd('0x37')],'openchannelStatusTime':this['openchannelStatusTime'],'openchannelCapacity':this[_0x6ffd('0x1e')],'openchannelCurrentCapacity':this[_0x6ffd('0x1f')],'busy':this[_0x6ffd('0x38')],'busyQueue':this[_0x6ffd('0x39')],'chatWaitingInteractions':this['chatWaitingInteractions'],'faxWaitingInteractions':this[_0x6ffd('0x3a')],'mailWaitingInteractions':this['mailWaitingInteractions'],'openchannelWaitingInteractions':this['openchannelWaitingInteractions'],'smsWaitingInteractions':this[_0x6ffd('0x23')],'whatsappWaitingInteractions':this[_0x6ffd('0x3b')]};var _0x25bc7c=md5(JSON[_0x6ffd('0x3c')](_0x51fdb6));if(this['md5']!==_0x25bc7c){this[_0x6ffd('0x1')]=_0x25bc7c;io['emit'](_0x6ffd('0x3d'),_[_0x6ffd('0x3e')](_0x51fdb6,[_0x6ffd('0x7')]));}};module[_0x6ffd('0x3f')]=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index 692ef31..fa72dc2 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 _0x364f=['paused','online','chatPause','available','format','emit','chat_queue:save','exports','lodash','md5','ioredis','../../../config/environment','redis','defaults','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','updateRealtime','prototype','_rr','map','loggedIn'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x364f,0x102));var _0xf364=function(_0x506cbe,_0x818678){_0x506cbe=_0x506cbe-0x0;var _0x4fdaa7=_0x364f[_0x506cbe];return _0x4fdaa7;};'use strict';var _=require(_0xf364('0x0'));var md5=require(_0xf364('0x1'));var util=require('util');var Redis=require(_0xf364('0x2'));var config=require(_0xf364('0x3'));config[_0xf364('0x4')]=_[_0xf364('0x5')](config[_0xf364('0x4')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xf364('0x4')]));function ChatQueue(_0x2e3f93){this['id']=_0x2e3f93['id']||0x0;this['name']=_0x2e3f93['name']||'';this[_0xf364('0x6')]=_0x2e3f93[_0xf364('0x6')]||0xa;this[_0xf364('0x7')]=_0x2e3f93[_0xf364('0x7')]||_0xf364('0x8');this[_0xf364('0x9')]=_0x2e3f93[_0xf364('0x9')];this[_0xf364('0xa')]={};this['waiting']=0x0;this[_0xf364('0x1')]='';this[_0xf364('0xb')]();this[_0xf364('0xc')]();}ChatQueue[_0xf364('0xd')][_0xf364('0xb')]=function(){var _0x112248=this[_0xf364('0xa')][_0xf364('0xe')];this['mapAgentsId']=_[_0xf364('0xf')](this[_0xf364('0x9')],'id');this[_0xf364('0xa')][_0xf364('0xe')]=_0x112248;};ChatQueue['prototype'][_0xf364('0xc')]=function(){this[_0xf364('0x10')]=0x0;this[_0xf364('0x11')]=0x0;for(var _0x4ea99b=0x0;_0x4ea99b=0x0?this[_0xf364('0x14')]:0x0;var _0x468650={'id':this['id'],'available':this['available'],'loggedIn':this[_0xf364('0x10')],'name':this['name'],'paused':this[_0xf364('0x11')],'waiting':this['waiting']};var _0xf9002b=md5(JSON['stringify'](_0x468650));if(this[_0xf364('0x1')]!==_0xf9002b){this[_0xf364('0x1')]=_0xf9002b;io['to'](util[_0xf364('0x15')]('chat:queue:%s',_0x468650['name']))[_0xf364('0x16')](_0xf364('0x17'),_0x468650);}};module[_0xf364('0x18')]=ChatQueue; \ No newline at end of file +var _0xff10=['length','chatPause','available','waiting','stringify','format','chat:queue:%s','emit','chat_queue:save','exports','lodash','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','updateRouting','updateRealtime','map','_rr','loggedIn','paused'];(function(_0x55127d,_0x361989){var _0x5ee754=function(_0xb600ae){while(--_0xb600ae){_0x55127d['push'](_0x55127d['shift']());}};_0x5ee754(++_0x361989);}(_0xff10,0x149));var _0x0ff1=function(_0x2742b3,_0x192217){_0x2742b3=_0x2742b3-0x0;var _0x3c8c2b=_0xff10[_0x2742b3];return _0x3c8c2b;};'use strict';var _=require(_0x0ff1('0x0'));var md5=require(_0x0ff1('0x1'));var util=require('util');var Redis=require(_0x0ff1('0x2'));var config=require(_0x0ff1('0x3'));config[_0x0ff1('0x4')]=_[_0x0ff1('0x5')](config[_0x0ff1('0x4')],{'host':_0x0ff1('0x6'),'port':0x18eb});var io=require(_0x0ff1('0x7'))(new Redis(config['redis']));function ChatQueue(_0x5e833f){this['id']=_0x5e833f['id']||0x0;this['name']=_0x5e833f[_0x0ff1('0x8')]||'';this[_0x0ff1('0x9')]=_0x5e833f[_0x0ff1('0x9')]||0xa;this[_0x0ff1('0xa')]=_0x5e833f[_0x0ff1('0xa')]||'beepall';this[_0x0ff1('0xb')]=_0x5e833f[_0x0ff1('0xb')];this[_0x0ff1('0xc')]={};this['waiting']=0x0;this[_0x0ff1('0x1')]='';this[_0x0ff1('0xd')]();this[_0x0ff1('0xe')]();}ChatQueue['prototype'][_0x0ff1('0xd')]=function(){var _0x2b2c50=this[_0x0ff1('0xc')]['_rr'];this['mapAgentsId']=_[_0x0ff1('0xf')](this[_0x0ff1('0xb')],'id');this['mapAgentsId'][_0x0ff1('0x10')]=_0x2b2c50;};ChatQueue['prototype'][_0x0ff1('0xe')]=function(){this[_0x0ff1('0x11')]=0x0;this[_0x0ff1('0x12')]=0x0;for(var _0x26a986=0x0;_0x26a986=0x0?this[_0x0ff1('0x15')]:0x0;var _0x3027f6={'id':this['id'],'available':this['available'],'loggedIn':this[_0x0ff1('0x11')],'name':this[_0x0ff1('0x8')],'paused':this['paused'],'waiting':this[_0x0ff1('0x16')]};var _0x499375=md5(JSON[_0x0ff1('0x17')](_0x3027f6));if(this[_0x0ff1('0x1')]!==_0x499375){this[_0x0ff1('0x1')]=_0x499375;io['to'](util[_0x0ff1('0x18')](_0x0ff1('0x19'),_0x3027f6[_0x0ff1('0x8')]))[_0x0ff1('0x1a')](_0x0ff1('0x1b'),_0x3027f6);}};module[_0x0ff1('0x1c')]=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index 0c9678d..d7b9719 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 _0x007f=['exports','md5','util','ioredis','../../../config/environment','defaults','localhost','socket.io-emitter','name','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','map','_rr','loggedIn','paused','length','online','faxPause','available','format','emit','fax_queue:save'];(function(_0x4f85c5,_0x517e60){var _0x46fc5b=function(_0x23381a){while(--_0x23381a){_0x4f85c5['push'](_0x4f85c5['shift']());}};_0x46fc5b(++_0x517e60);}(_0x007f,0x71));var _0xf007=function(_0xc069,_0x3005d6){_0xc069=_0xc069-0x0;var _0x3f143c=_0x007f[_0xc069];return _0x3f143c;};'use strict';var _=require('lodash');var md5=require(_0xf007('0x0'));var util=require(_0xf007('0x1'));var Redis=require(_0xf007('0x2'));var config=require(_0xf007('0x3'));config['redis']=_[_0xf007('0x4')](config['redis'],{'host':_0xf007('0x5'),'port':0x18eb});var io=require(_0xf007('0x6'))(new Redis(config['redis']));function FaxQueue(_0x215970){this['id']=_0x215970['id']||0x0;this['name']=_0x215970[_0xf007('0x7')]||'';this['timeout']=_0x215970['timeout']||0xa;this[_0xf007('0x8')]=_0x215970[_0xf007('0x8')]||_0xf007('0x9');this[_0xf007('0xa')]=_0x215970[_0xf007('0xa')];this[_0xf007('0xb')]={};this[_0xf007('0xc')]=0x0;this[_0xf007('0x0')]='';this[_0xf007('0xd')]();this[_0xf007('0xe')]();}FaxQueue[_0xf007('0xf')][_0xf007('0xd')]=function(){var _0x240e9d=this[_0xf007('0xb')]['_rr'];this['mapAgentsId']=_[_0xf007('0x10')](this['Agents'],'id');this['mapAgentsId'][_0xf007('0x11')]=_0x240e9d;};FaxQueue[_0xf007('0xf')]['updateRealtime']=function(){this[_0xf007('0x12')]=0x0;this[_0xf007('0x13')]=0x0;for(var _0x1e5410=0x0;_0x1e5410=0x0?this[_0xf007('0x17')]:0x0;var _0x3ff2d0={'id':this['id'],'available':this[_0xf007('0x17')],'loggedIn':this[_0xf007('0x12')],'name':this[_0xf007('0x7')],'paused':this[_0xf007('0x13')],'waiting':this['waiting']};var _0x424146=md5(JSON['stringify'](_0x3ff2d0));if(this[_0xf007('0x0')]!==_0x424146){this[_0xf007('0x0')]=_0x424146;io['to'](util[_0xf007('0x18')]('fax:queue:%s',_0x3ff2d0[_0xf007('0x7')]))[_0xf007('0x19')](_0xf007('0x1a'),_0x3ff2d0);}};module[_0xf007('0x1b')]=FaxQueue; \ No newline at end of file +var _0xc653=['stringify','fax:queue:%s','emit','lodash','md5','util','ioredis','../../../config/environment','redis','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRealtime','prototype','_rr','map','paused','online','available','loggedIn','waiting'];(function(_0xd0a847,_0x72562b){var _0x2536ec=function(_0x20e4db){while(--_0x20e4db){_0xd0a847['push'](_0xd0a847['shift']());}};_0x2536ec(++_0x72562b);}(_0xc653,0x161));var _0x3c65=function(_0x2c54dc,_0x1db485){_0x2c54dc=_0x2c54dc-0x0;var _0x32ccd4=_0xc653[_0x2c54dc];return _0x32ccd4;};'use strict';var _=require(_0x3c65('0x0'));var md5=require(_0x3c65('0x1'));var util=require(_0x3c65('0x2'));var Redis=require(_0x3c65('0x3'));var config=require(_0x3c65('0x4'));config['redis']=_['defaults'](config[_0x3c65('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x3c65('0x6'))(new Redis(config[_0x3c65('0x5')]));function FaxQueue(_0x508fd9){this['id']=_0x508fd9['id']||0x0;this[_0x3c65('0x7')]=_0x508fd9[_0x3c65('0x7')]||'';this[_0x3c65('0x8')]=_0x508fd9[_0x3c65('0x8')]||0xa;this['strategy']=_0x508fd9[_0x3c65('0x9')]||_0x3c65('0xa');this[_0x3c65('0xb')]=_0x508fd9['Agents'];this[_0x3c65('0xc')]={};this['waiting']=0x0;this[_0x3c65('0x1')]='';this['updateRouting']();this[_0x3c65('0xd')]();}FaxQueue[_0x3c65('0xe')]['updateRouting']=function(){var _0x436e2e=this[_0x3c65('0xc')][_0x3c65('0xf')];this['mapAgentsId']=_[_0x3c65('0x10')](this[_0x3c65('0xb')],'id');this[_0x3c65('0xc')][_0x3c65('0xf')]=_0x436e2e;};FaxQueue['prototype'][_0x3c65('0xd')]=function(){this['loggedIn']=0x0;this[_0x3c65('0x11')]=0x0;for(var _0x12ef06=0x0;_0x12ef06=0x0?this[_0x3c65('0x13')]:0x0;var _0x3c4f16={'id':this['id'],'available':this[_0x3c65('0x13')],'loggedIn':this[_0x3c65('0x14')],'name':this[_0x3c65('0x7')],'paused':this['paused'],'waiting':this[_0x3c65('0x15')]};var _0x10e883=md5(JSON[_0x3c65('0x16')](_0x3c4f16));if(this[_0x3c65('0x1')]!==_0x10e883){this[_0x3c65('0x1')]=_0x10e883;io['to'](util['format'](_0x3c65('0x17'),_0x3c4f16[_0x3c65('0x7')]))[_0x3c65('0x18')]('fax_queue:save',_0x3c4f16);}};module['exports']=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index 5f2220e..1357e6d 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 _0x40ad=['name','Intervals','exports'];(function(_0x311909,_0x414bf7){var _0x8d3163=function(_0x226f55){while(--_0x226f55){_0x311909['push'](_0x311909['shift']());}};_0x8d3163(++_0x414bf7);}(_0x40ad,0xf0));var _0xd40a=function(_0x4f4765,_0xd0d762){_0x4f4765=_0x4f4765-0x0;var _0x5e65ec=_0x40ad[_0x4f4765];return _0x5e65ec;};'use strict';function Interval(_0x20c1aa){this['id']=_0x20c1aa['id']||0x0;this[_0xd40a('0x0')]=_0x20c1aa[_0xd40a('0x0')]||'';this[_0xd40a('0x1')]=_0x20c1aa[_0xd40a('0x1')]||{};}module[_0xd40a('0x2')]=Interval; \ No newline at end of file +var _0xce8e=['Intervals','exports','name'];(function(_0x303962,_0x4febc7){var _0x393675=function(_0x8f4417){while(--_0x8f4417){_0x303962['push'](_0x303962['shift']());}};_0x393675(++_0x4febc7);}(_0xce8e,0x89));var _0xece8=function(_0xcbad10,_0x33f30e){_0xcbad10=_0xcbad10-0x0;var _0x3a2a35=_0xce8e[_0xcbad10];return _0x3a2a35;};'use strict';function Interval(_0x506b4d){this['id']=_0x506b4d['id']||0x0;this[_0xece8('0x0')]=_0x506b4d[_0xece8('0x0')]||'';this[_0xece8('0x1')]=_0x506b4d[_0xece8('0x1')]||{};}module[_0xece8('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 6ef8d75..e83f3ed 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 _0x6f06=['redis','localhost','socket.io-emitter','name','strategy','Agents','mapAgentsId','updateRouting','prototype','_rr','map','updateRealtime','loggedIn','paused','length','mailPause','available','stringify','format','mail:queue:%s','exports','md5','util','ioredis','../../../config/environment','defaults'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x6f06,0xb1));var _0x66f0=function(_0xa64531,_0x48c65f){_0xa64531=_0xa64531-0x0;var _0x1b1f42=_0x6f06[_0xa64531];return _0x1b1f42;};'use strict';var _=require('lodash');var md5=require(_0x66f0('0x0'));var util=require(_0x66f0('0x1'));var Redis=require(_0x66f0('0x2'));var config=require(_0x66f0('0x3'));config['redis']=_[_0x66f0('0x4')](config[_0x66f0('0x5')],{'host':_0x66f0('0x6'),'port':0x18eb});var io=require(_0x66f0('0x7'))(new Redis(config['redis']));function MailQueue(_0x5debe7){this['id']=_0x5debe7['id']||0x0;this[_0x66f0('0x8')]=_0x5debe7[_0x66f0('0x8')]||'';this['timeout']=_0x5debe7['timeout']||0xa;this['strategy']=_0x5debe7[_0x66f0('0x9')]||'beepall';this[_0x66f0('0xa')]=_0x5debe7['Agents'];this[_0x66f0('0xb')]={};this['waiting']=0x0;this[_0x66f0('0x0')]='';this[_0x66f0('0xc')]();this['updateRealtime']();}MailQueue[_0x66f0('0xd')][_0x66f0('0xc')]=function(){var _0x27e9d6=this['mapAgentsId'][_0x66f0('0xe')];this[_0x66f0('0xb')]=_[_0x66f0('0xf')](this[_0x66f0('0xa')],'id');this['mapAgentsId']['_rr']=_0x27e9d6;};MailQueue[_0x66f0('0xd')][_0x66f0('0x10')]=function(){this[_0x66f0('0x11')]=0x0;this[_0x66f0('0x12')]=0x0;for(var _0x3e543d=0x0;_0x3e543d=0x0?this[_0x66f0('0x15')]:0x0;var _0x1ee3d5={'id':this['id'],'available':this[_0x66f0('0x15')],'loggedIn':this[_0x66f0('0x11')],'name':this[_0x66f0('0x8')],'paused':this[_0x66f0('0x12')],'waiting':this['waiting']};var _0x2d6a8b=md5(JSON[_0x66f0('0x16')](_0x1ee3d5));if(this['md5']!==_0x2d6a8b){this[_0x66f0('0x0')]=_0x2d6a8b;io['to'](util[_0x66f0('0x17')](_0x66f0('0x18'),_0x1ee3d5[_0x66f0('0x8')]))['emit']('mail_queue:save',_0x1ee3d5);}};module[_0x66f0('0x19')]=MailQueue; \ No newline at end of file +var _0xa9c0=['stringify','mail:queue:%s','emit','mail_queue:save','exports','md5','util','ioredis','redis','defaults','localhost','socket.io-emitter','name','strategy','Agents','mapAgentsId','updateRouting','updateRealtime','_rr','map','loggedIn','paused','length','available'];(function(_0x4f8d68,_0x483ac2){var _0x65263c=function(_0x2e23b7){while(--_0x2e23b7){_0x4f8d68['push'](_0x4f8d68['shift']());}};_0x65263c(++_0x483ac2);}(_0xa9c0,0xf5));var _0x0a9c=function(_0x4cbc7e,_0x24fd68){_0x4cbc7e=_0x4cbc7e-0x0;var _0x361bcc=_0xa9c0[_0x4cbc7e];return _0x361bcc;};'use strict';var _=require('lodash');var md5=require(_0x0a9c('0x0'));var util=require(_0x0a9c('0x1'));var Redis=require(_0x0a9c('0x2'));var config=require('../../../config/environment');config[_0x0a9c('0x3')]=_[_0x0a9c('0x4')](config[_0x0a9c('0x3')],{'host':_0x0a9c('0x5'),'port':0x18eb});var io=require(_0x0a9c('0x6'))(new Redis(config[_0x0a9c('0x3')]));function MailQueue(_0x1e87d4){this['id']=_0x1e87d4['id']||0x0;this[_0x0a9c('0x7')]=_0x1e87d4[_0x0a9c('0x7')]||'';this['timeout']=_0x1e87d4['timeout']||0xa;this['strategy']=_0x1e87d4[_0x0a9c('0x8')]||'beepall';this['Agents']=_0x1e87d4[_0x0a9c('0x9')];this[_0x0a9c('0xa')]={};this['waiting']=0x0;this[_0x0a9c('0x0')]='';this[_0x0a9c('0xb')]();this[_0x0a9c('0xc')]();}MailQueue['prototype'][_0x0a9c('0xb')]=function(){var _0x2ef43b=this[_0x0a9c('0xa')][_0x0a9c('0xd')];this[_0x0a9c('0xa')]=_[_0x0a9c('0xe')](this[_0x0a9c('0x9')],'id');this['mapAgentsId']['_rr']=_0x2ef43b;};MailQueue['prototype'][_0x0a9c('0xc')]=function(){this[_0x0a9c('0xf')]=0x0;this[_0x0a9c('0x10')]=0x0;for(var _0x397a77=0x0;_0x397a77=0x0?this['available']:0x0;var _0x4ff0cd={'id':this['id'],'available':this['available'],'loggedIn':this[_0x0a9c('0xf')],'name':this[_0x0a9c('0x7')],'paused':this[_0x0a9c('0x10')],'waiting':this['waiting']};var _0x1f86a5=md5(JSON[_0x0a9c('0x13')](_0x4ff0cd));if(this[_0x0a9c('0x0')]!==_0x1f86a5){this[_0x0a9c('0x0')]=_0x1f86a5;io['to'](util['format'](_0x0a9c('0x14'),_0x4ff0cd[_0x0a9c('0x7')]))[_0x0a9c('0x15')](_0x0a9c('0x16'),_0x4ff0cd);}};module[_0x0a9c('0x17')]=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index 3fd1b84..d99f451 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 _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(_0x557ef5,_0x14791c){var _0x7b01d8=function(_0x387bbe){while(--_0x387bbe){_0x557ef5['push'](_0x557ef5['shift']());}};_0x7b01d8(++_0x14791c);}(_0x814b,0x1a2));var _0xb814=function(_0x516ffb,_0x5b5b42){_0x516ffb=_0x516ffb-0x0;var _0x319667=_0x814b[_0x516ffb];return _0x319667;};'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 +var _0xadb5=['../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','_rr','prototype','updateRealtime','paused','loggedIn','openchannelPause','available','stringify','format','openchannel:queue:%s','emit','md5','ioredis'];(function(_0x5d983c,_0x57b322){var _0x45d2f8=function(_0x4fb48d){while(--_0x4fb48d){_0x5d983c['push'](_0x5d983c['shift']());}};_0x45d2f8(++_0x57b322);}(_0xadb5,0xad));var _0x5adb=function(_0x398577,_0x4d4e77){_0x398577=_0x398577-0x0;var _0x5a45ef=_0xadb5[_0x398577];return _0x5a45ef;};'use strict';var _=require('lodash');var md5=require(_0x5adb('0x0'));var util=require('util');var Redis=require(_0x5adb('0x1'));var config=require(_0x5adb('0x2'));config[_0x5adb('0x3')]=_['defaults'](config[_0x5adb('0x3')],{'host':_0x5adb('0x4'),'port':0x18eb});var io=require(_0x5adb('0x5'))(new Redis(config['redis']));function OpenchannelQueue(_0x35a5d3){this['id']=_0x35a5d3['id']||0x0;this[_0x5adb('0x6')]=_0x35a5d3[_0x5adb('0x6')]||'';this[_0x5adb('0x7')]=_0x35a5d3[_0x5adb('0x7')]||0xa;this[_0x5adb('0x8')]=_0x35a5d3[_0x5adb('0x8')]||_0x5adb('0x9');this[_0x5adb('0xa')]=_0x35a5d3[_0x5adb('0xa')];this[_0x5adb('0xb')]={};this[_0x5adb('0xc')]=0x0;this[_0x5adb('0x0')]='';this[_0x5adb('0xd')]();this['updateRealtime']();}OpenchannelQueue['prototype'][_0x5adb('0xd')]=function(){var _0x1ea238=this[_0x5adb('0xb')]['_rr'];this[_0x5adb('0xb')]=_['map'](this[_0x5adb('0xa')],'id');this['mapAgentsId'][_0x5adb('0xe')]=_0x1ea238;};OpenchannelQueue[_0x5adb('0xf')][_0x5adb('0x10')]=function(){this['loggedIn']=0x0;this[_0x5adb('0x11')]=0x0;for(var _0x34af2c=0x0;_0x34af2c=0x0?this['available']:0x0;var _0x3fff62={'id':this['id'],'available':this['available'],'loggedIn':this[_0x5adb('0x12')],'name':this['name'],'paused':this[_0x5adb('0x11')],'waiting':this['waiting']};var _0x5e218c=md5(JSON[_0x5adb('0x15')](_0x3fff62));if(this[_0x5adb('0x0')]!==_0x5e218c){this[_0x5adb('0x0')]=_0x5e218c;io['to'](util[_0x5adb('0x16')](_0x5adb('0x17'),_0x3fff62['name']))[_0x5adb('0x18')]('openchannel_queue:save',_0x3fff62);}};module['exports']=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index 016fa5d..b74770d 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 _0x3e25=['mapAgentsId','waiting','updateRouting','updateRealtime','map','_rr','prototype','loggedIn','paused','length','online','available','format','sms:queue:%s','emit','sms_queue:save','lodash','md5','util','../../../config/environment','defaults','localhost','socket.io-emitter','redis','name','timeout','strategy','beepall','Agents'];(function(_0x2c55d1,_0x558f3d){var _0x5de2dd=function(_0x41e660){while(--_0x41e660){_0x2c55d1['push'](_0x2c55d1['shift']());}};_0x5de2dd(++_0x558f3d);}(_0x3e25,0x14f));var _0x53e2=function(_0x198ace,_0x388ad3){_0x198ace=_0x198ace-0x0;var _0xf001ed=_0x3e25[_0x198ace];return _0xf001ed;};'use strict';var _=require(_0x53e2('0x0'));var md5=require(_0x53e2('0x1'));var util=require(_0x53e2('0x2'));var Redis=require('ioredis');var config=require(_0x53e2('0x3'));config['redis']=_[_0x53e2('0x4')](config['redis'],{'host':_0x53e2('0x5'),'port':0x18eb});var io=require(_0x53e2('0x6'))(new Redis(config[_0x53e2('0x7')]));function SmsQueue(_0x476761){this['id']=_0x476761['id']||0x0;this[_0x53e2('0x8')]=_0x476761[_0x53e2('0x8')]||'';this[_0x53e2('0x9')]=_0x476761[_0x53e2('0x9')]||0xa;this[_0x53e2('0xa')]=_0x476761[_0x53e2('0xa')]||_0x53e2('0xb');this[_0x53e2('0xc')]=_0x476761[_0x53e2('0xc')];this[_0x53e2('0xd')]={};this[_0x53e2('0xe')]=0x0;this[_0x53e2('0x1')]='';this[_0x53e2('0xf')]();this[_0x53e2('0x10')]();}SmsQueue['prototype'][_0x53e2('0xf')]=function(){var _0x5cf96c=this['mapAgentsId']['_rr'];this[_0x53e2('0xd')]=_[_0x53e2('0x11')](this[_0x53e2('0xc')],'id');this[_0x53e2('0xd')][_0x53e2('0x12')]=_0x5cf96c;};SmsQueue[_0x53e2('0x13')][_0x53e2('0x10')]=function(){this[_0x53e2('0x14')]=0x0;this[_0x53e2('0x15')]=0x0;for(var _0x5d16e2=0x0;_0x5d16e2=0x0?this['available']:0x0;var _0x4213d0={'id':this['id'],'available':this[_0x53e2('0x18')],'loggedIn':this['loggedIn'],'name':this[_0x53e2('0x8')],'paused':this['paused'],'waiting':this[_0x53e2('0xe')]};var _0x55a1ba=md5(JSON['stringify'](_0x4213d0));if(this[_0x53e2('0x1')]!==_0x55a1ba){this[_0x53e2('0x1')]=_0x55a1ba;io['to'](util[_0x53e2('0x19')](_0x53e2('0x1a'),_0x4213d0['name']))[_0x53e2('0x1b')](_0x53e2('0x1c'),_0x4213d0);}};module['exports']=SmsQueue; \ No newline at end of file +var _0x19ea=['loggedIn','paused','length','online','smsPause','available','stringify','format','sms:queue:%s','emit','exports','lodash','ioredis','redis','defaults','name','timeout','strategy','beepall','Agents','waiting','md5','updateRouting','updateRealtime','mapAgentsId','map','_rr'];(function(_0x4de24f,_0x53bacc){var _0x1daf89=function(_0x43bed5){while(--_0x43bed5){_0x4de24f['push'](_0x4de24f['shift']());}};_0x1daf89(++_0x53bacc);}(_0x19ea,0xfe));var _0xa19e=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0x19ea[_0x37c22c];return _0x119d79;};'use strict';var _=require(_0xa19e('0x0'));var md5=require('md5');var util=require('util');var Redis=require(_0xa19e('0x1'));var config=require('../../../config/environment');config[_0xa19e('0x2')]=_[_0xa19e('0x3')](config[_0xa19e('0x2')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xa19e('0x2')]));function SmsQueue(_0x2a8e2c){this['id']=_0x2a8e2c['id']||0x0;this[_0xa19e('0x4')]=_0x2a8e2c[_0xa19e('0x4')]||'';this[_0xa19e('0x5')]=_0x2a8e2c[_0xa19e('0x5')]||0xa;this[_0xa19e('0x6')]=_0x2a8e2c[_0xa19e('0x6')]||_0xa19e('0x7');this[_0xa19e('0x8')]=_0x2a8e2c[_0xa19e('0x8')];this['mapAgentsId']={};this[_0xa19e('0x9')]=0x0;this[_0xa19e('0xa')]='';this[_0xa19e('0xb')]();this[_0xa19e('0xc')]();}SmsQueue['prototype'][_0xa19e('0xb')]=function(){var _0x239829=this[_0xa19e('0xd')]['_rr'];this[_0xa19e('0xd')]=_[_0xa19e('0xe')](this[_0xa19e('0x8')],'id');this[_0xa19e('0xd')][_0xa19e('0xf')]=_0x239829;};SmsQueue['prototype'][_0xa19e('0xc')]=function(){this[_0xa19e('0x10')]=0x0;this[_0xa19e('0x11')]=0x0;for(var _0x28dedd=0x0;_0x28dedd=0x0?this[_0xa19e('0x15')]:0x0;var _0x1f37c4={'id':this['id'],'available':this['available'],'loggedIn':this[_0xa19e('0x10')],'name':this['name'],'paused':this[_0xa19e('0x11')],'waiting':this['waiting']};var _0x5ce913=md5(JSON[_0xa19e('0x16')](_0x1f37c4));if(this[_0xa19e('0xa')]!==_0x5ce913){this['md5']=_0x5ce913;io['to'](util[_0xa19e('0x17')](_0xa19e('0x18'),_0x1f37c4[_0xa19e('0x4')]))[_0xa19e('0x19')]('sms_queue:save',_0x1f37c4);}};module[_0xa19e('0x1a')]=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index bc0e908..dd9d474 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 _0x097a=['format','whatsapp_queue:save','exports','md5','util','defaults','redis','localhost','name','strategy','beepall','Agents','waiting','updateRouting','updateRealtime','prototype','mapAgentsId','_rr','map','paused','length','online','loggedIn','whatsappPause','available'];(function(_0x7bc94,_0x15c543){var _0x4ea45d=function(_0x19c71b){while(--_0x19c71b){_0x7bc94['push'](_0x7bc94['shift']());}};_0x4ea45d(++_0x15c543);}(_0x097a,0x1c5));var _0xa097=function(_0x2084f8,_0x3f1624){_0x2084f8=_0x2084f8-0x0;var _0xbeba7a=_0x097a[_0x2084f8];return _0xbeba7a;};'use strict';var _=require('lodash');var md5=require(_0xa097('0x0'));var util=require(_0xa097('0x1'));var Redis=require('ioredis');var config=require('../../../config/environment');config['redis']=_[_0xa097('0x2')](config[_0xa097('0x3')],{'host':_0xa097('0x4'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function WhatsappQueue(_0x9422c9){this['id']=_0x9422c9['id']||0x0;this[_0xa097('0x5')]=_0x9422c9['name']||'';this['timeout']=_0x9422c9['timeout']||0xa;this[_0xa097('0x6')]=_0x9422c9[_0xa097('0x6')]||_0xa097('0x7');this[_0xa097('0x8')]=_0x9422c9['Agents'];this['mapAgentsId']={};this[_0xa097('0x9')]=0x0;this[_0xa097('0x0')]='';this[_0xa097('0xa')]();this[_0xa097('0xb')]();}WhatsappQueue[_0xa097('0xc')][_0xa097('0xa')]=function(){var _0x4c15cf=this[_0xa097('0xd')][_0xa097('0xe')];this[_0xa097('0xd')]=_[_0xa097('0xf')](this[_0xa097('0x8')],'id');this[_0xa097('0xd')]['_rr']=_0x4c15cf;};WhatsappQueue['prototype'][_0xa097('0xb')]=function(){this['loggedIn']=0x0;this[_0xa097('0x10')]=0x0;for(var _0x4fb759=0x0;_0x4fb759=0x0?this['available']:0x0;var _0x3c9261={'id':this['id'],'available':this[_0xa097('0x15')],'loggedIn':this[_0xa097('0x13')],'name':this[_0xa097('0x5')],'paused':this[_0xa097('0x10')],'waiting':this['waiting']};var _0x382b1d=md5(JSON['stringify'](_0x3c9261));if(this[_0xa097('0x0')]!==_0x382b1d){this['md5']=_0x382b1d;io['to'](util[_0xa097('0x16')]('whatsapp:queue:%s',_0x3c9261['name']))['emit'](_0xa097('0x17'),_0x3c9261);}};module[_0xa097('0x18')]=WhatsappQueue; \ No newline at end of file +var _0x1056=['emit','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','Agents','waiting','updateRealtime','prototype','updateRouting','mapAgentsId','_rr','loggedIn','length','whatsappPause','paused','available','whatsapp:queue:%s'];(function(_0xcbc377,_0x5a21f7){var _0x160511=function(_0x296aaf){while(--_0x296aaf){_0xcbc377['push'](_0xcbc377['shift']());}};_0x160511(++_0x5a21f7);}(_0x1056,0x146));var _0x6105=function(_0x2e5790,_0x2aaa53){_0x2e5790=_0x2e5790-0x0;var _0x13c781=_0x1056[_0x2e5790];return _0x13c781;};'use strict';var _=require(_0x6105('0x0'));var md5=require(_0x6105('0x1'));var util=require(_0x6105('0x2'));var Redis=require(_0x6105('0x3'));var config=require(_0x6105('0x4'));config[_0x6105('0x5')]=_[_0x6105('0x6')](config[_0x6105('0x5')],{'host':_0x6105('0x7'),'port':0x18eb});var io=require(_0x6105('0x8'))(new Redis(config[_0x6105('0x5')]));function WhatsappQueue(_0x48cf59){this['id']=_0x48cf59['id']||0x0;this[_0x6105('0x9')]=_0x48cf59[_0x6105('0x9')]||'';this[_0x6105('0xa')]=_0x48cf59['timeout']||0xa;this[_0x6105('0xb')]=_0x48cf59[_0x6105('0xb')]||'beepall';this[_0x6105('0xc')]=_0x48cf59[_0x6105('0xc')];this['mapAgentsId']={};this[_0x6105('0xd')]=0x0;this['md5']='';this['updateRouting']();this[_0x6105('0xe')]();}WhatsappQueue[_0x6105('0xf')][_0x6105('0x10')]=function(){var _0x48c52a=this[_0x6105('0x11')][_0x6105('0x12')];this[_0x6105('0x11')]=_['map'](this['Agents'],'id');this[_0x6105('0x11')]['_rr']=_0x48c52a;};WhatsappQueue['prototype'][_0x6105('0xe')]=function(){this[_0x6105('0x13')]=0x0;this['paused']=0x0;for(var _0x1e97ab=0x0;_0x1e97ab=0x0?this[_0x6105('0x17')]:0x0;var _0x8dc32e={'id':this['id'],'available':this[_0x6105('0x17')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this['paused'],'waiting':this[_0x6105('0xd')]};var _0x34199e=md5(JSON['stringify'](_0x8dc32e));if(this[_0x6105('0x1')]!==_0x34199e){this[_0x6105('0x1')]=_0x34199e;io['to'](util['format'](_0x6105('0x18'),_0x8dc32e['name']))[_0x6105('0x19')]('whatsapp_queue:save',_0x8dc32e);}};module[_0x6105('0x1a')]=WhatsappQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index d5bf42a..9b61319 100644 --- a/server/services/routing/realtime/index.js +++ b/server/services/routing/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','isUndefined','initIntervals','length','initOpenchannelQueues','updateRealtime','initChatQueues','chatQueues','initSmsQueues','updateRouting','initMailQueues','initFaxQueues','initWhatsappQueues','exports','bluebird','lodash','moment','../model/agent','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','smsQueues','mailQueues'];(function(_0x8b5b33,_0x253d07){var _0x45660c=function(_0x1fced5){while(--_0x1fced5){_0x8b5b33['push'](_0x8b5b33['shift']());}};_0x45660c(++_0x253d07);}(_0xb10b,0x12a));var _0xbb10=function(_0x75267d,_0x5d286c){_0x75267d=_0x75267d-0x0;var _0x21ccec=_0xb10b[_0x75267d];return _0x21ccec;};'use strict';var BPromise=require(_0xbb10('0x0'));var util=require('util');var _=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var Agent=require(_0xbb10('0x3'));var Interval=require('../model/interval');var OpenchannelQueue=require(_0xbb10('0x4'));var ChatQueue=require(_0xbb10('0x5'));var SmsQueue=require(_0xbb10('0x6'));var MailQueue=require(_0xbb10('0x7'));var FaxQueue=require(_0xbb10('0x8'));var WhatsappQueue=require(_0xbb10('0x9'));var Realtime=function(){this['agents']={};this[_0xbb10('0xa')]={};this[_0xbb10('0xb')]={};this['chatQueues']={};this[_0xbb10('0xc')]={};this[_0xbb10('0xd')]={};this[_0xbb10('0xe')]={};this[_0xbb10('0xf')]={};this[_0xbb10('0x10')]={};this[_0xbb10('0x11')]={};this[_0xbb10('0x12')]={};this[_0xbb10('0x13')]={};this['faxQueuesWaitingInteractions']={};this['whatsappQueuesWaitingInteractions']={};};function freeIsNotKey(_0x20bd61,_0x118a74,_0xce64f3){var _0x5e136d=_[_0xbb10('0x14')](_0x20bd61,function(_0x5be7e0,_0x44fb19){return _0x5be7e0[_0xce64f3];});for(var _0x916a32 in _0x118a74){if(_0x118a74[_0xbb10('0x15')](_0x916a32)){if(!_0x5e136d[_0x916a32]){delete _0x118a74[_0x916a32];}}}}Realtime[_0xbb10('0x16')][_0xbb10('0x17')]=function(_0x147230,_0x58a612){for(var _0x26e021 in _0x58a612){if(_0x147230[_0xbb10('0x15')](_0x26e021)){_0x147230[_0x26e021]=_0x58a612[_0x26e021];}}};Realtime[_0xbb10('0x16')][_0xbb10('0x18')]=function(){var _0x3df17b=this;return function(_0x2f2ebf){if(_0x2f2ebf){freeIsNotKey(_0x2f2ebf,_0x3df17b[_0xbb10('0x19')],'id');for(var _0x36b5e8=0x0,_0x3e26f4={},_0x2b184e={};_0x36b5e8<_0x2f2ebf['length'];_0x36b5e8+=0x1){_0x3e26f4=_0x2f2ebf[_0x36b5e8];if(_[_0xbb10('0x1a')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']])){_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']]=new Agent(_0x3e26f4);}else{_0x3df17b[_0xbb10('0x17')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']],_0x3e26f4);}}}return _0x3df17b[_0xbb10('0x19')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x1b')]=function(){var _0xbf2906=this;return function(_0xe1c665){if(_0xe1c665){freeIsNotKey(_0xe1c665,_0xbf2906['intervals'],'id');for(var _0x5ff0cf=0x0,_0x19f48d={},_0x388fab={};_0x5ff0cf<_0xe1c665[_0xbb10('0x1c')];_0x5ff0cf+=0x1){_0x19f48d=_0xe1c665[_0x5ff0cf];if(_[_0xbb10('0x1a')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']])){_0xbf2906['intervals'][_0x19f48d['id']]=new Interval(_0x19f48d);}else{_0xbf2906[_0xbb10('0x17')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']],_0x19f48d);}}}return _0xbf2906['intervals'];};};Realtime['prototype'][_0xbb10('0x1d')]=function(){var _0x311abe=this;return function(_0x2e911d){if(_0x2e911d){freeIsNotKey(_0x2e911d,_0x311abe[_0xbb10('0xb')],'id');for(var _0x445761=0x0,_0x1824b7={},_0x407cb4={};_0x445761<_0x2e911d[_0xbb10('0x1c')];_0x445761+=0x1){_0x1824b7=_0x2e911d[_0x445761];if(_[_0xbb10('0x1a')](_0x311abe[_0xbb10('0xb')][_0x1824b7['id']])){_0x311abe[_0xbb10('0xb')][_0x1824b7['id']]=new OpenchannelQueue(_0x1824b7);}else{_0x311abe[_0xbb10('0x17')](_0x311abe['openchannelQueues'][_0x1824b7['id']],_0x1824b7);}_0x311abe['openchannelQueues'][_0x1824b7['id']]['updateRouting']();_0x311abe[_0xbb10('0xb')][_0x1824b7['id']][_0xbb10('0x1e')]();}}return _0x311abe[_0xbb10('0xb')];};};Realtime['prototype'][_0xbb10('0x1f')]=function(){var _0x24d586=this;return function(_0x6ed43b){if(_0x6ed43b){freeIsNotKey(_0x6ed43b,_0x24d586[_0xbb10('0x20')],'id');for(var _0x1acce9=0x0,_0x20d946={},_0x2a0e8b={};_0x1acce9<_0x6ed43b['length'];_0x1acce9+=0x1){_0x20d946=_0x6ed43b[_0x1acce9];if(_[_0xbb10('0x1a')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']])){_0x24d586[_0xbb10('0x20')][_0x20d946['id']]=new ChatQueue(_0x20d946);}else{_0x24d586[_0xbb10('0x17')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']],_0x20d946);}_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRouting']();_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRealtime']();}}return _0x24d586[_0xbb10('0x20')];};};Realtime['prototype'][_0xbb10('0x21')]=function(){var _0x1dcc9c=this;return function(_0x1b59f9){if(_0x1b59f9){freeIsNotKey(_0x1b59f9,_0x1dcc9c['smsQueues'],'id');for(var _0x518d47=0x0,_0x4c3744={},_0x34f65e={};_0x518d47<_0x1b59f9['length'];_0x518d47+=0x1){_0x4c3744=_0x1b59f9[_0x518d47];if(_[_0xbb10('0x1a')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']])){_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']]=new SmsQueue(_0x4c3744);}else{_0x1dcc9c[_0xbb10('0x17')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']],_0x4c3744);}_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']][_0xbb10('0x22')]();_0x1dcc9c['smsQueues'][_0x4c3744['id']][_0xbb10('0x1e')]();}}return _0x1dcc9c[_0xbb10('0xc')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x23')]=function(){var _0xfb2c5e=this;return function(_0x9de708){if(_0x9de708){freeIsNotKey(_0x9de708,_0xfb2c5e[_0xbb10('0xd')],'id');for(var _0x10202c=0x0,_0x3c8d7d={},_0x56943c={};_0x10202c<_0x9de708[_0xbb10('0x1c')];_0x10202c+=0x1){_0x3c8d7d=_0x9de708[_0x10202c];if(_[_0xbb10('0x1a')](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']])){_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']]=new MailQueue(_0x3c8d7d);}else{_0xfb2c5e['mergeFromDatabase'](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']],_0x3c8d7d);}_0xfb2c5e['mailQueues'][_0x3c8d7d['id']]['updateRouting']();_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']][_0xbb10('0x1e')]();}}return _0xfb2c5e[_0xbb10('0xd')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x24')]=function(){var _0x29d11a=this;return function(_0x547062){if(_0x547062){freeIsNotKey(_0x547062,_0x29d11a[_0xbb10('0xe')],'id');for(var _0x25d72f=0x0,_0x52de31={},_0x5e3fbd={};_0x25d72f<_0x547062['length'];_0x25d72f+=0x1){_0x52de31=_0x547062[_0x25d72f];if(_[_0xbb10('0x1a')](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']])){_0x29d11a[_0xbb10('0xe')][_0x52de31['id']]=new FaxQueue(_0x52de31);}else{_0x29d11a['mergeFromDatabase'](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']],_0x52de31);}_0x29d11a[_0xbb10('0xe')][_0x52de31['id']][_0xbb10('0x22')]();_0x29d11a['faxQueues'][_0x52de31['id']][_0xbb10('0x1e')]();}}return _0x29d11a[_0xbb10('0xe')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x25')]=function(){var _0x4f1cdd=this;return function(_0xd238e9){if(_0xd238e9){freeIsNotKey(_0xd238e9,_0x4f1cdd[_0xbb10('0xf')],'id');for(var _0x5835fd=0x0,_0xe2040f={},_0x2e3214={};_0x5835fd<_0xd238e9[_0xbb10('0x1c')];_0x5835fd+=0x1){_0xe2040f=_0xd238e9[_0x5835fd];if(_[_0xbb10('0x1a')](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']])){_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]=new WhatsappQueue(_0xe2040f);}else{_0x4f1cdd['mergeFromDatabase'](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']],_0xe2040f);}_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']][_0xbb10('0x22')]();_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]['updateRealtime']();}}return _0x4f1cdd[_0xbb10('0xf')];};};module[_0xbb10('0x26')]=Realtime; \ No newline at end of file +var _0xb10b=['faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','isUndefined','initIntervals','length','initOpenchannelQueues','updateRealtime','initChatQueues','chatQueues','initSmsQueues','updateRouting','initMailQueues','initFaxQueues','initWhatsappQueues','exports','bluebird','lodash','moment','../model/agent','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','smsQueues','mailQueues'];(function(_0x2bd8b5,_0x43cf9d){var _0xabeb51=function(_0x1e93b7){while(--_0x1e93b7){_0x2bd8b5['push'](_0x2bd8b5['shift']());}};_0xabeb51(++_0x43cf9d);}(_0xb10b,0x12a));var _0xbb10=function(_0x537c37,_0x536e74){_0x537c37=_0x537c37-0x0;var _0x241f84=_0xb10b[_0x537c37];return _0x241f84;};'use strict';var BPromise=require(_0xbb10('0x0'));var util=require('util');var _=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var Agent=require(_0xbb10('0x3'));var Interval=require('../model/interval');var OpenchannelQueue=require(_0xbb10('0x4'));var ChatQueue=require(_0xbb10('0x5'));var SmsQueue=require(_0xbb10('0x6'));var MailQueue=require(_0xbb10('0x7'));var FaxQueue=require(_0xbb10('0x8'));var WhatsappQueue=require(_0xbb10('0x9'));var Realtime=function(){this['agents']={};this[_0xbb10('0xa')]={};this[_0xbb10('0xb')]={};this['chatQueues']={};this[_0xbb10('0xc')]={};this[_0xbb10('0xd')]={};this[_0xbb10('0xe')]={};this[_0xbb10('0xf')]={};this[_0xbb10('0x10')]={};this[_0xbb10('0x11')]={};this[_0xbb10('0x12')]={};this[_0xbb10('0x13')]={};this['faxQueuesWaitingInteractions']={};this['whatsappQueuesWaitingInteractions']={};};function freeIsNotKey(_0x20bd61,_0x118a74,_0xce64f3){var _0x5e136d=_[_0xbb10('0x14')](_0x20bd61,function(_0x5be7e0,_0x44fb19){return _0x5be7e0[_0xce64f3];});for(var _0x916a32 in _0x118a74){if(_0x118a74[_0xbb10('0x15')](_0x916a32)){if(!_0x5e136d[_0x916a32]){delete _0x118a74[_0x916a32];}}}}Realtime[_0xbb10('0x16')][_0xbb10('0x17')]=function(_0x147230,_0x58a612){for(var _0x26e021 in _0x58a612){if(_0x147230[_0xbb10('0x15')](_0x26e021)){_0x147230[_0x26e021]=_0x58a612[_0x26e021];}}};Realtime[_0xbb10('0x16')][_0xbb10('0x18')]=function(){var _0x3df17b=this;return function(_0x2f2ebf){if(_0x2f2ebf){freeIsNotKey(_0x2f2ebf,_0x3df17b[_0xbb10('0x19')],'id');for(var _0x36b5e8=0x0,_0x3e26f4={},_0x2b184e={};_0x36b5e8<_0x2f2ebf['length'];_0x36b5e8+=0x1){_0x3e26f4=_0x2f2ebf[_0x36b5e8];if(_[_0xbb10('0x1a')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']])){_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']]=new Agent(_0x3e26f4);}else{_0x3df17b[_0xbb10('0x17')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']],_0x3e26f4);}}}return _0x3df17b[_0xbb10('0x19')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x1b')]=function(){var _0xbf2906=this;return function(_0xe1c665){if(_0xe1c665){freeIsNotKey(_0xe1c665,_0xbf2906['intervals'],'id');for(var _0x5ff0cf=0x0,_0x19f48d={},_0x388fab={};_0x5ff0cf<_0xe1c665[_0xbb10('0x1c')];_0x5ff0cf+=0x1){_0x19f48d=_0xe1c665[_0x5ff0cf];if(_[_0xbb10('0x1a')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']])){_0xbf2906['intervals'][_0x19f48d['id']]=new Interval(_0x19f48d);}else{_0xbf2906[_0xbb10('0x17')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']],_0x19f48d);}}}return _0xbf2906['intervals'];};};Realtime['prototype'][_0xbb10('0x1d')]=function(){var _0x311abe=this;return function(_0x2e911d){if(_0x2e911d){freeIsNotKey(_0x2e911d,_0x311abe[_0xbb10('0xb')],'id');for(var _0x445761=0x0,_0x1824b7={},_0x407cb4={};_0x445761<_0x2e911d[_0xbb10('0x1c')];_0x445761+=0x1){_0x1824b7=_0x2e911d[_0x445761];if(_[_0xbb10('0x1a')](_0x311abe[_0xbb10('0xb')][_0x1824b7['id']])){_0x311abe[_0xbb10('0xb')][_0x1824b7['id']]=new OpenchannelQueue(_0x1824b7);}else{_0x311abe[_0xbb10('0x17')](_0x311abe['openchannelQueues'][_0x1824b7['id']],_0x1824b7);}_0x311abe['openchannelQueues'][_0x1824b7['id']]['updateRouting']();_0x311abe[_0xbb10('0xb')][_0x1824b7['id']][_0xbb10('0x1e')]();}}return _0x311abe[_0xbb10('0xb')];};};Realtime['prototype'][_0xbb10('0x1f')]=function(){var _0x24d586=this;return function(_0x6ed43b){if(_0x6ed43b){freeIsNotKey(_0x6ed43b,_0x24d586[_0xbb10('0x20')],'id');for(var _0x1acce9=0x0,_0x20d946={},_0x2a0e8b={};_0x1acce9<_0x6ed43b['length'];_0x1acce9+=0x1){_0x20d946=_0x6ed43b[_0x1acce9];if(_[_0xbb10('0x1a')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']])){_0x24d586[_0xbb10('0x20')][_0x20d946['id']]=new ChatQueue(_0x20d946);}else{_0x24d586[_0xbb10('0x17')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']],_0x20d946);}_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRouting']();_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRealtime']();}}return _0x24d586[_0xbb10('0x20')];};};Realtime['prototype'][_0xbb10('0x21')]=function(){var _0x1dcc9c=this;return function(_0x1b59f9){if(_0x1b59f9){freeIsNotKey(_0x1b59f9,_0x1dcc9c['smsQueues'],'id');for(var _0x518d47=0x0,_0x4c3744={},_0x34f65e={};_0x518d47<_0x1b59f9['length'];_0x518d47+=0x1){_0x4c3744=_0x1b59f9[_0x518d47];if(_[_0xbb10('0x1a')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']])){_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']]=new SmsQueue(_0x4c3744);}else{_0x1dcc9c[_0xbb10('0x17')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']],_0x4c3744);}_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']][_0xbb10('0x22')]();_0x1dcc9c['smsQueues'][_0x4c3744['id']][_0xbb10('0x1e')]();}}return _0x1dcc9c[_0xbb10('0xc')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x23')]=function(){var _0xfb2c5e=this;return function(_0x9de708){if(_0x9de708){freeIsNotKey(_0x9de708,_0xfb2c5e[_0xbb10('0xd')],'id');for(var _0x10202c=0x0,_0x3c8d7d={},_0x56943c={};_0x10202c<_0x9de708[_0xbb10('0x1c')];_0x10202c+=0x1){_0x3c8d7d=_0x9de708[_0x10202c];if(_[_0xbb10('0x1a')](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']])){_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']]=new MailQueue(_0x3c8d7d);}else{_0xfb2c5e['mergeFromDatabase'](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']],_0x3c8d7d);}_0xfb2c5e['mailQueues'][_0x3c8d7d['id']]['updateRouting']();_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']][_0xbb10('0x1e')]();}}return _0xfb2c5e[_0xbb10('0xd')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x24')]=function(){var _0x29d11a=this;return function(_0x547062){if(_0x547062){freeIsNotKey(_0x547062,_0x29d11a[_0xbb10('0xe')],'id');for(var _0x25d72f=0x0,_0x52de31={},_0x5e3fbd={};_0x25d72f<_0x547062['length'];_0x25d72f+=0x1){_0x52de31=_0x547062[_0x25d72f];if(_[_0xbb10('0x1a')](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']])){_0x29d11a[_0xbb10('0xe')][_0x52de31['id']]=new FaxQueue(_0x52de31);}else{_0x29d11a['mergeFromDatabase'](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']],_0x52de31);}_0x29d11a[_0xbb10('0xe')][_0x52de31['id']][_0xbb10('0x22')]();_0x29d11a['faxQueues'][_0x52de31['id']][_0xbb10('0x1e')]();}}return _0x29d11a[_0xbb10('0xe')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x25')]=function(){var _0x4f1cdd=this;return function(_0xd238e9){if(_0xd238e9){freeIsNotKey(_0xd238e9,_0x4f1cdd[_0xbb10('0xf')],'id');for(var _0x5835fd=0x0,_0xe2040f={},_0x2e3214={};_0x5835fd<_0xd238e9[_0xbb10('0x1c')];_0x5835fd+=0x1){_0xe2040f=_0xd238e9[_0x5835fd];if(_[_0xbb10('0x1a')](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']])){_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]=new WhatsappQueue(_0xe2040f);}else{_0x4f1cdd['mergeFromDatabase'](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']],_0xe2040f);}_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']][_0xbb10('0x22')]();_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]['updateRealtime']();}}return _0x4f1cdd[_0xbb10('0xf')];};};module[_0xbb10('0x26')]=Realtime; \ No newline at end of file diff --git a/server/services/routing/rpc/chatInteraction.js b/server/services/routing/rpc/chatInteraction.js index f0eae03..31b2920 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 _0xb55d=['UpdateChatInteraction','updateChatInteraction','addTags','AddTagsToChatInteraction','addTagsToChatInteraction','../client','update','Request'];(function(_0x2eb6f3,_0x43fff8){var _0x22eb2c=function(_0x2c1364){while(--_0x2c1364){_0x2eb6f3['push'](_0x2eb6f3['shift']());}};_0x22eb2c(++_0x43fff8);}(_0xb55d,0x13d));var _0xdb55=function(_0x525275,_0xcd98aa){_0x525275=_0x525275-0x0;var _0x5453e3=_0xb55d[_0x525275];return _0x5453e3;};'use strict';var client=require(_0xdb55('0x0'));exports[_0xdb55('0x1')]=function(_0x302994,_0x4fff45){return client[_0xdb55('0x2')](_0xdb55('0x3'),{'body':_0x4fff45,'options':{'where':{'id':_0x302994}},'log':_0xdb55('0x4')});};exports[_0xdb55('0x5')]=function(_0x452526,_0x37181b){return client['Request'](_0xdb55('0x6'),{'body':_0x37181b,'options':{'where':{'id':_0x452526}},'log':_0xdb55('0x7')});}; \ No newline at end of file +var _0xfb90=['addTagsToChatInteraction','../client','update','Request','UpdateChatInteraction','updateChatInteraction','addTags'];(function(_0xdf7d3b,_0x474cea){var _0x675076=function(_0x605a85){while(--_0x605a85){_0xdf7d3b['push'](_0xdf7d3b['shift']());}};_0x675076(++_0x474cea);}(_0xfb90,0x8d));var _0x0fb9=function(_0x2eaa6b,_0x5f3658){_0x2eaa6b=_0x2eaa6b-0x0;var _0x4770c9=_0xfb90[_0x2eaa6b];return _0x4770c9;};'use strict';var client=require(_0x0fb9('0x0'));exports[_0x0fb9('0x1')]=function(_0x50b8d3,_0x2287ed){return client[_0x0fb9('0x2')](_0x0fb9('0x3'),{'body':_0x2287ed,'options':{'where':{'id':_0x50b8d3}},'log':_0x0fb9('0x4')});};exports[_0x0fb9('0x5')]=function(_0xf615d9,_0x42c51b){return client['Request']('AddTagsToChatInteraction',{'body':_0x42c51b,'options':{'where':{'id':_0xf615d9}},'log':_0x0fb9('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index fde6fa4..eee2a2b 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 _0xea0b=['../client','Request','CreateChatMessage'];(function(_0x421f64,_0x5f748a){var _0x533360=function(_0x5a6869){while(--_0x5a6869){_0x421f64['push'](_0x421f64['shift']());}};_0x533360(++_0x5f748a);}(_0xea0b,0xb1));var _0xbea0=function(_0x262531,_0x5f3eeb){_0x262531=_0x262531-0x0;var _0x8e52b5=_0xea0b[_0x262531];return _0x8e52b5;};'use strict';var client=require(_0xbea0('0x0'));exports['create']=function(_0x1da38a){return client[_0xbea0('0x1')](_0xbea0('0x2'),{'body':_0x1da38a,'log':'createChatMessage'});}; \ No newline at end of file +var _0x2ee6=['../client','create','Request','createChatMessage'];(function(_0x31a371,_0x50828e){var _0x2a5bd6=function(_0x2fb481){while(--_0x2fb481){_0x31a371['push'](_0x31a371['shift']());}};_0x2a5bd6(++_0x50828e);}(_0x2ee6,0x120));var _0x62ee=function(_0x2f7c3c,_0x52b503){_0x2f7c3c=_0x2f7c3c-0x0;var _0x56ea57=_0x2ee6[_0x2f7c3c];return _0x56ea57;};'use strict';var client=require(_0x62ee('0x0'));exports[_0x62ee('0x1')]=function(_0x31ecef){return client[_0x62ee('0x2')]('CreateChatMessage',{'body':_0x31ecef,'log':_0x62ee('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index 0eb2e72..9221206 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 _0x3f1c=['Agents','name','online','getChatQueues','../client','GetChatQueue','strategy','User'];(function(_0x116322,_0x388496){var _0x1aea71=function(_0x52577e){while(--_0x52577e){_0x116322['push'](_0x116322['shift']());}};_0x1aea71(++_0x388496);}(_0x3f1c,0xd4));var _0xc3f1=function(_0x245a6e,_0x179244){_0x245a6e=_0x245a6e-0x0;var _0x2be3da=_0x3f1c[_0x245a6e];return _0x2be3da;};'use strict';var client=require(_0xc3f1('0x0'));exports['getChatQueues']=function(){return function(){return client['Request'](_0xc3f1('0x1'),{'options':{'raw':![],'attributes':['id','name','timeout',_0xc3f1('0x2')],'include':[{'model':_0xc3f1('0x3'),'as':_0xc3f1('0x4'),'attributes':['id',_0xc3f1('0x5'),_0xc3f1('0x6'),'chatPause']}]},'log':_0xc3f1('0x7')});};}; \ No newline at end of file +var _0xe914=['name','timeout','strategy','User','Agents','online','chatPause','../client','getChatQueues','GetChatQueue'];(function(_0xbce5f9,_0x56bde0){var _0xe42100=function(_0x5819ce){while(--_0x5819ce){_0xbce5f9['push'](_0xbce5f9['shift']());}};_0xe42100(++_0x56bde0);}(_0xe914,0x7f));var _0x4e91=function(_0x1a6046,_0x2354b3){_0x1a6046=_0x1a6046-0x0;var _0x1dd6a4=_0xe914[_0x1a6046];return _0x1dd6a4;};'use strict';var client=require(_0x4e91('0x0'));exports[_0x4e91('0x1')]=function(){return function(){return client['Request'](_0x4e91('0x2'),{'options':{'raw':![],'attributes':['id',_0x4e91('0x3'),_0x4e91('0x4'),_0x4e91('0x5')],'include':[{'model':_0x4e91('0x6'),'as':_0x4e91('0x7'),'attributes':['id','name',_0x4e91('0x8'),_0x4e91('0x9')]}]},'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 322a9de..0431196 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 _0x80fb=['update','Request','UpdateChatQueueReport','DESC','create','CreateChatQueueReport'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x80fb,0x11e));var _0xb80f=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0x80fb[_0x2bf141];return _0x48277b;};'use strict';var client=require('../client');exports[_0xb80f('0x0')]=function(_0x2ee5b7){return client['Request'](_0xb80f('0x1'),{'body':_0x2ee5b7,'log':_0xb80f('0x1')});};exports[_0xb80f('0x2')]=function(_0x3a37b3,_0x22de9a){return client[_0xb80f('0x3')](_0xb80f('0x4'),{'body':_0x22de9a,'options':{'where':{'uniqueid':_0x3a37b3},'order':[['id',_0xb80f('0x5')]],'limit':0x1},'log':'UpdateChatQueueReport'});}; \ No newline at end of file +var _0x7333=['Request','UpdateChatQueueReport','../client','CreateChatQueueReport','update'];(function(_0x180c9b,_0x13d173){var _0x3ff116=function(_0x241982){while(--_0x241982){_0x180c9b['push'](_0x180c9b['shift']());}};_0x3ff116(++_0x13d173);}(_0x7333,0xfc));var _0x3733=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x7333[_0x2c91e9];return _0x13f0ff;};'use strict';var client=require(_0x3733('0x0'));exports['create']=function(_0x42c214){return client['Request'](_0x3733('0x1'),{'body':_0x42c214,'log':_0x3733('0x1')});};exports[_0x3733('0x2')]=function(_0x4ad96b,_0x1bf202){return client[_0x3733('0x3')](_0x3733('0x4'),{'body':_0x1bf202,'options':{'where':{'uniqueid':_0x4ad96b},'order':[['id','DESC']],'limit':0x1},'log':_0x3733('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index b426c55..7ebc750 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(_0x54efa8,_0x3bedbe){var _0x5eafc1=function(_0x5b0c7e){while(--_0x5b0c7e){_0x54efa8['push'](_0x54efa8['shift']());}};_0x5eafc1(++_0x3bedbe);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'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(_0x12546e,_0x49a072){var _0x5173d9=function(_0x4b860a){while(--_0x4b860a){_0x12546e['push'](_0x12546e['shift']());}};_0x5173d9(++_0x49a072);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'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 33f2dd7..65914e1 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 _0xe917=['create','Request','CreateFaxMessage'];(function(_0x5b2667,_0xfa04de){var _0x1c348e=function(_0x2dd1ff){while(--_0x2dd1ff){_0x5b2667['push'](_0x5b2667['shift']());}};_0x1c348e(++_0xfa04de);}(_0xe917,0xab));var _0x7e91=function(_0x50aa2e,_0xfbd6f0){_0x50aa2e=_0x50aa2e-0x0;var _0x5e07f0=_0xe917[_0x50aa2e];return _0x5e07f0;};'use strict';var client=require('../client');exports[_0x7e91('0x0')]=function(_0x3bfe79){return client[_0x7e91('0x1')](_0x7e91('0x2'),{'body':_0x3bfe79,'log':'createFaxMessage'});}; \ No newline at end of file +var _0x6f2d=['../client','Request'];(function(_0x261c44,_0x46ca7f){var _0x3180ce=function(_0x3144d0){while(--_0x3144d0){_0x261c44['push'](_0x261c44['shift']());}};_0x3180ce(++_0x46ca7f);}(_0x6f2d,0x90));var _0xd6f2=function(_0x5631e7,_0x8cafb6){_0x5631e7=_0x5631e7-0x0;var _0x40c8cf=_0x6f2d[_0x5631e7];return _0x40c8cf;};'use strict';var client=require(_0xd6f2('0x0'));exports['create']=function(_0x3369d5){return client[_0xd6f2('0x1')]('CreateFaxMessage',{'body':_0x3369d5,'log':'createFaxMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index 393d6d5..a3923b9 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 _0x069b=['GetFaxQueue','name','strategy','Agents','online','faxPause','getFaxQueues','../client','Request'];(function(_0x1b0680,_0x49f513){var _0x19c30d=function(_0x4eb734){while(--_0x4eb734){_0x1b0680['push'](_0x1b0680['shift']());}};_0x19c30d(++_0x49f513);}(_0x069b,0x1e4));var _0xb069=function(_0x837592,_0x4a642c){_0x837592=_0x837592-0x0;var _0x5b1c29=_0x069b[_0x837592];return _0x5b1c29;};'use strict';var client=require(_0xb069('0x0'));exports['getFaxQueues']=function(){return function(){return client[_0xb069('0x1')](_0xb069('0x2'),{'options':{'raw':![],'attributes':['id',_0xb069('0x3'),'timeout',_0xb069('0x4')],'include':[{'model':'User','as':_0xb069('0x5'),'attributes':['id',_0xb069('0x3'),_0xb069('0x6'),_0xb069('0x7')]}]},'log':_0xb069('0x8')});};}; \ No newline at end of file +var _0x2824=['strategy','User','Agents','online','faxPause','../client','getFaxQueues','Request','GetFaxQueue','name','timeout'];(function(_0x9a1d1,_0x3e51a4){var _0xbb05ad=function(_0x360058){while(--_0x360058){_0x9a1d1['push'](_0x9a1d1['shift']());}};_0xbb05ad(++_0x3e51a4);}(_0x2824,0x12e));var _0x4282=function(_0x4c7011,_0x458ad9){_0x4c7011=_0x4c7011-0x0;var _0x19daaf=_0x2824[_0x4c7011];return _0x19daaf;};'use strict';var client=require(_0x4282('0x0'));exports[_0x4282('0x1')]=function(){return function(){return client[_0x4282('0x2')](_0x4282('0x3'),{'options':{'raw':![],'attributes':['id',_0x4282('0x4'),_0x4282('0x5'),_0x4282('0x6')],'include':[{'model':_0x4282('0x7'),'as':_0x4282('0x8'),'attributes':['id',_0x4282('0x4'),_0x4282('0x9'),_0x4282('0xa')]}]},'log':_0x4282('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index 6d6f432..4e39d15 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 _0xc89b=['Request','CreateFaxQueueReport','update','UpdateFaxQueueReport','DESC','../client'];(function(_0xcc9e86,_0x4417fe){var _0x1ba436=function(_0x145b13){while(--_0x145b13){_0xcc9e86['push'](_0xcc9e86['shift']());}};_0x1ba436(++_0x4417fe);}(_0xc89b,0x7d));var _0xbc89=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xc89b[_0x54d4fe];return _0x1ab5bb;};'use strict';var client=require(_0xbc89('0x0'));exports['create']=function(_0x1280cc){return client[_0xbc89('0x1')](_0xbc89('0x2'),{'body':_0x1280cc,'log':_0xbc89('0x2')});};exports[_0xbc89('0x3')]=function(_0x4fd6e6,_0x17932b){return client['Request'](_0xbc89('0x4'),{'body':_0x17932b,'options':{'where':{'uniqueid':_0x4fd6e6},'order':[['id',_0xbc89('0x5')]],'limit':0x1},'log':_0xbc89('0x4')});}; \ No newline at end of file +var _0xed1f=['../client','create','CreateFaxQueueReport','update','Request','DESC','UpdateFaxQueueReport'];(function(_0x241717,_0x27d008){var _0x5df801=function(_0x3c749d){while(--_0x3c749d){_0x241717['push'](_0x241717['shift']());}};_0x5df801(++_0x27d008);}(_0xed1f,0x103));var _0xfed1=function(_0x344a3f,_0x579a22){_0x344a3f=_0x344a3f-0x0;var _0x264712=_0xed1f[_0x344a3f];return _0x264712;};'use strict';var client=require(_0xfed1('0x0'));exports[_0xfed1('0x1')]=function(_0x32d250){return client['Request'](_0xfed1('0x2'),{'body':_0x32d250,'log':'CreateFaxQueueReport'});};exports[_0xfed1('0x3')]=function(_0x2087b1,_0x11648b){return client[_0xfed1('0x4')]('UpdateFaxQueueReport',{'body':_0x11648b,'options':{'where':{'uniqueid':_0x2087b1},'order':[['id',_0xfed1('0x5')]],'limit':0x1},'log':_0xfed1('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index ed87f66..84b6ade 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 _0x37a1=['interval','Request','Intervals'];(function(_0x11ba83,_0xd5611a){var _0x3f3925=function(_0x3d7cb0){while(--_0x3d7cb0){_0x11ba83['push'](_0x11ba83['shift']());}};_0x3f3925(++_0xd5611a);}(_0x37a1,0xdc));var _0x137a=function(_0x5b1a89,_0x332e92){_0x5b1a89=_0x5b1a89-0x0;var _0x59c40a=_0x37a1[_0x5b1a89];return _0x59c40a;};'use strict';var client=require('../client');exports['getIntervals']=function(){return function(){return client[_0x137a('0x0')]('GetInterval',{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id','name'],'include':[{'model':'Interval','as':_0x137a('0x1'),'attributes':['id','name',_0x137a('0x2')]}]},'log':'getIntervals'});};}; \ No newline at end of file +var _0xd903=['Request','GetInterval','name','Interval','Intervals','interval','../client','getIntervals'];(function(_0xbdfc1d,_0x34f769){var _0x2d0ba8=function(_0xd437a2){while(--_0xd437a2){_0xbdfc1d['push'](_0xbdfc1d['shift']());}};_0x2d0ba8(++_0x34f769);}(_0xd903,0xfe));var _0x3d90=function(_0x3a289e,_0x129fb6){_0x3a289e=_0x3a289e-0x0;var _0x2ae6ad=_0xd903[_0x3a289e];return _0x2ae6ad;};'use strict';var client=require(_0x3d90('0x0'));exports[_0x3d90('0x1')]=function(){return function(){return client[_0x3d90('0x2')](_0x3d90('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x3d90('0x4')],'include':[{'model':_0x3d90('0x5'),'as':_0x3d90('0x6'),'attributes':['id','name',_0x3d90('0x7')]}]},'log':_0x3d90('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index 1eff3f7..0990fa3 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 _0xb03e=['addTagsToChatInteraction','update','Request','UpdateMailInteraction','updateMailInteraction','addTags','AddTagsToMailInteraction'];(function(_0xf49d6b,_0x46478f){var _0x37adac=function(_0x558462){while(--_0x558462){_0xf49d6b['push'](_0xf49d6b['shift']());}};_0x37adac(++_0x46478f);}(_0xb03e,0x1eb));var _0xeb03=function(_0x3e4517,_0x59e747){_0x3e4517=_0x3e4517-0x0;var _0x2a879b=_0xb03e[_0x3e4517];return _0x2a879b;};'use strict';var client=require('../client');exports[_0xeb03('0x0')]=function(_0x399504,_0x868905){return client[_0xeb03('0x1')](_0xeb03('0x2'),{'body':_0x868905,'options':{'where':{'id':_0x399504}},'log':_0xeb03('0x3')});};exports[_0xeb03('0x4')]=function(_0x1fe650,_0x474450){return client[_0xeb03('0x1')](_0xeb03('0x5'),{'body':_0x474450,'options':{'where':{'id':_0x1fe650}},'log':_0xeb03('0x6')});}; \ No newline at end of file +var _0xb78e=['addTags','addTagsToChatInteraction','../client','update','Request','UpdateMailInteraction','updateMailInteraction'];(function(_0xb6b134,_0x5a7dae){var _0x3e73b2=function(_0xb29992){while(--_0xb29992){_0xb6b134['push'](_0xb6b134['shift']());}};_0x3e73b2(++_0x5a7dae);}(_0xb78e,0x1c9));var _0xeb78=function(_0x5e657c,_0x2fd53d){_0x5e657c=_0x5e657c-0x0;var _0x310582=_0xb78e[_0x5e657c];return _0x310582;};'use strict';var client=require(_0xeb78('0x0'));exports[_0xeb78('0x1')]=function(_0x4b8534,_0x1570f5){return client[_0xeb78('0x2')](_0xeb78('0x3'),{'body':_0x1570f5,'options':{'where':{'id':_0x4b8534}},'log':_0xeb78('0x4')});};exports[_0xeb78('0x5')]=function(_0x308d12,_0x13ef9d){return client[_0xeb78('0x2')]('AddTagsToMailInteraction',{'body':_0x13ef9d,'options':{'where':{'id':_0x308d12}},'log':_0xeb78('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index 18fc5c0..b9f5e0b 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 _0x8e54=['createMailMessage','create','Request','CreateMailMessage'];(function(_0x4cdefc,_0xd38d9b){var _0x4d61a8=function(_0x3a35b4){while(--_0x3a35b4){_0x4cdefc['push'](_0x4cdefc['shift']());}};_0x4d61a8(++_0xd38d9b);}(_0x8e54,0x15d));var _0x48e5=function(_0x385460,_0x2aec74){_0x385460=_0x385460-0x0;var _0x5ef6b2=_0x8e54[_0x385460];return _0x5ef6b2;};'use strict';var client=require('../client');exports[_0x48e5('0x0')]=function(_0x1d433b){return client[_0x48e5('0x1')](_0x48e5('0x2'),{'body':_0x1d433b,'log':_0x48e5('0x3')});}; \ No newline at end of file +var _0xdb36=['Request','CreateMailMessage','../client','create'];(function(_0x434aa8,_0x3df4eb){var _0xfe64e6=function(_0x43ee29){while(--_0x43ee29){_0x434aa8['push'](_0x434aa8['shift']());}};_0xfe64e6(++_0x3df4eb);}(_0xdb36,0xce));var _0x6db3=function(_0x2169b2,_0x4742b4){_0x2169b2=_0x2169b2-0x0;var _0x475059=_0xdb36[_0x2169b2];return _0x475059;};'use strict';var client=require(_0x6db3('0x0'));exports[_0x6db3('0x1')]=function(_0x2cd7d7){return client[_0x6db3('0x2')](_0x6db3('0x3'),{'body':_0x2cd7d7,'log':'createMailMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index e746781..61a3030 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 _0x2093=['timeout','strategy','User','Agents','online','mailPause','../client','getMailQueues','Request','name'];(function(_0x1b581c,_0x23b66c){var _0x38a9d5=function(_0x5ef127){while(--_0x5ef127){_0x1b581c['push'](_0x1b581c['shift']());}};_0x38a9d5(++_0x23b66c);}(_0x2093,0x15a));var _0x3209=function(_0x105c51,_0x412d34){_0x105c51=_0x105c51-0x0;var _0x1f727d=_0x2093[_0x105c51];return _0x1f727d;};'use strict';var client=require(_0x3209('0x0'));exports[_0x3209('0x1')]=function(){return function(){return client[_0x3209('0x2')]('GetMailQueue',{'options':{'raw':![],'attributes':['id',_0x3209('0x3'),_0x3209('0x4'),_0x3209('0x5')],'include':[{'model':_0x3209('0x6'),'as':_0x3209('0x7'),'attributes':['id',_0x3209('0x3'),_0x3209('0x8'),_0x3209('0x9')]}]},'log':_0x3209('0x1')});};}; \ No newline at end of file +var _0xf05f=['User','Agents','name','online','mailPause','../client','getMailQueues','timeout','strategy'];(function(_0x6d6f94,_0x654d80){var _0x4bed6a=function(_0x17f69c){while(--_0x17f69c){_0x6d6f94['push'](_0x6d6f94['shift']());}};_0x4bed6a(++_0x654d80);}(_0xf05f,0xcb));var _0xff05=function(_0xdf8600,_0x3ee488){_0xdf8600=_0xdf8600-0x0;var _0x2e67af=_0xf05f[_0xdf8600];return _0x2e67af;};'use strict';var client=require(_0xff05('0x0'));exports[_0xff05('0x1')]=function(){return function(){return client['Request']('GetMailQueue',{'options':{'raw':![],'attributes':['id','name',_0xff05('0x2'),_0xff05('0x3')],'include':[{'model':_0xff05('0x4'),'as':_0xff05('0x5'),'attributes':['id',_0xff05('0x6'),_0xff05('0x7'),_0xff05('0x8')]}]},'log':_0xff05('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index 671e617..0a5a108 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 _0x195d=['../client','create','Request','CreateMailQueueReport','UpdateMailQueueReport'];(function(_0x5a6cef,_0x1697df){var _0x37f76f=function(_0x17dc71){while(--_0x17dc71){_0x5a6cef['push'](_0x5a6cef['shift']());}};_0x37f76f(++_0x1697df);}(_0x195d,0x73));var _0xd195=function(_0x12d812,_0x496bb7){_0x12d812=_0x12d812-0x0;var _0x3711ab=_0x195d[_0x12d812];return _0x3711ab;};'use strict';var client=require(_0xd195('0x0'));exports[_0xd195('0x1')]=function(_0x5189a1){return client[_0xd195('0x2')](_0xd195('0x3'),{'body':_0x5189a1,'log':_0xd195('0x3')});};exports['update']=function(_0x527952,_0x5d1b77){return client['Request'](_0xd195('0x4'),{'body':_0x5d1b77,'options':{'where':{'uniqueid':_0x527952},'order':[['id','DESC']],'limit':0x1},'log':_0xd195('0x4')});}; \ No newline at end of file +var _0xcb52=['Request','CreateMailQueueReport','update','DESC','../client','create'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0xcb52,0x1e4));var _0x2cb5=function(_0x5d07ff,_0x1f976f){_0x5d07ff=_0x5d07ff-0x0;var _0x5226ad=_0xcb52[_0x5d07ff];return _0x5226ad;};'use strict';var client=require(_0x2cb5('0x0'));exports[_0x2cb5('0x1')]=function(_0x1499ad){return client[_0x2cb5('0x2')](_0x2cb5('0x3'),{'body':_0x1499ad,'log':_0x2cb5('0x3')});};exports[_0x2cb5('0x4')]=function(_0x440d66,_0x182202){return client[_0x2cb5('0x2')]('UpdateMailQueueReport',{'body':_0x182202,'options':{'where':{'uniqueid':_0x440d66},'order':[['id',_0x2cb5('0x5')]],'limit':0x1},'log':'UpdateMailQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index 222cb95..dc2d124 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 _0xe839=['UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTagsToChatInteraction','../client','update','Request'];(function(_0x9406e8,_0x5bae3e){var _0x361ce9=function(_0x247384){while(--_0x247384){_0x9406e8['push'](_0x9406e8['shift']());}};_0x361ce9(++_0x5bae3e);}(_0xe839,0xc9));var _0x9e83=function(_0x1034ee,_0x12998c){_0x1034ee=_0x1034ee-0x0;var _0x2922af=_0xe839[_0x1034ee];return _0x2922af;};'use strict';var client=require(_0x9e83('0x0'));exports[_0x9e83('0x1')]=function(_0x44e933,_0x58e441){return client[_0x9e83('0x2')](_0x9e83('0x3'),{'body':_0x58e441,'options':{'where':{'id':_0x44e933}},'log':_0x9e83('0x4')});};exports['addTags']=function(_0x46ea69,_0x4ec7b3){return client[_0x9e83('0x2')]('AddTagsToOpenchannelInteraction',{'body':_0x4ec7b3,'options':{'where':{'id':_0x46ea69}},'log':_0x9e83('0x5')});}; \ No newline at end of file +var _0xc411=['update','UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags','Request','addTagsToChatInteraction'];(function(_0x4dae00,_0x15b194){var _0x16bf42=function(_0x5f2a9a){while(--_0x5f2a9a){_0x4dae00['push'](_0x4dae00['shift']());}};_0x16bf42(++_0x15b194);}(_0xc411,0x132));var _0x1c41=function(_0x2132a3,_0x4639e9){_0x2132a3=_0x2132a3-0x0;var _0x21890c=_0xc411[_0x2132a3];return _0x21890c;};'use strict';var client=require('../client');exports[_0x1c41('0x0')]=function(_0x14688a,_0x4e6fa5){return client['Request'](_0x1c41('0x1'),{'body':_0x4e6fa5,'options':{'where':{'id':_0x14688a}},'log':_0x1c41('0x2')});};exports[_0x1c41('0x3')]=function(_0x4f5207,_0x46903e){return client[_0x1c41('0x4')]('AddTagsToOpenchannelInteraction',{'body':_0x46903e,'options':{'where':{'id':_0x4f5207}},'log':_0x1c41('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index 2f935a6..d5e1e15 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 _0x7fed=['../client','Request','createOpenchannelMessage'];(function(_0x26ad67,_0x1f49c9){var _0x97d92f=function(_0x3d4a0b){while(--_0x3d4a0b){_0x26ad67['push'](_0x26ad67['shift']());}};_0x97d92f(++_0x1f49c9);}(_0x7fed,0x1bf));var _0xd7fe=function(_0x1307ea,_0x5661e6){_0x1307ea=_0x1307ea-0x0;var _0x2ccb3b=_0x7fed[_0x1307ea];return _0x2ccb3b;};'use strict';var client=require(_0xd7fe('0x0'));exports['create']=function(_0x4c151e){return client[_0xd7fe('0x1')]('CreateOpenchannelMessage',{'body':_0x4c151e,'log':_0xd7fe('0x2')});}; \ No newline at end of file +var _0xc47d=['create','CreateOpenchannelMessage','createOpenchannelMessage'];(function(_0x38af48,_0x400460){var _0x445384=function(_0x464435){while(--_0x464435){_0x38af48['push'](_0x38af48['shift']());}};_0x445384(++_0x400460);}(_0xc47d,0x17a));var _0xdc47=function(_0x20c9b2,_0x55d7b1){_0x20c9b2=_0x20c9b2-0x0;var _0x2c6030=_0xc47d[_0x20c9b2];return _0x2c6030;};'use strict';var client=require('../client');exports[_0xdc47('0x0')]=function(_0x254e56){return client['Request'](_0xdc47('0x1'),{'body':_0x254e56,'log':_0xdc47('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index 6af0d52..47555f0 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 _0xbe0f=['getOpenchannelQueues','name','strategy','Agents','online','../client'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbe0f,0x1d3));var _0xfbe0=function(_0x419f92,_0x3486d6){_0x419f92=_0x419f92-0x0;var _0x28b5ca=_0xbe0f[_0x419f92];return _0x28b5ca;};'use strict';var client=require(_0xfbe0('0x0'));exports[_0xfbe0('0x1')]=function(){return function(){return client['Request']('GetOpenchannelQueue',{'options':{'raw':![],'attributes':['id',_0xfbe0('0x2'),'timeout',_0xfbe0('0x3')],'include':[{'model':'User','as':_0xfbe0('0x4'),'attributes':['id',_0xfbe0('0x2'),_0xfbe0('0x5'),'openchannelPause']}]},'log':_0xfbe0('0x1')});};}; \ No newline at end of file +var _0x6b87=['getOpenchannelQueues','Request','GetOpenchannelQueue','timeout','strategy','User','name','online','openchannelPause'];(function(_0x285159,_0x434500){var _0x3ade27=function(_0x47e9ba){while(--_0x47e9ba){_0x285159['push'](_0x285159['shift']());}};_0x3ade27(++_0x434500);}(_0x6b87,0x15f));var _0x76b8=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x6b87[_0x2641f9];return _0x585741;};'use strict';var client=require('../client');exports[_0x76b8('0x0')]=function(){return function(){return client[_0x76b8('0x1')](_0x76b8('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x76b8('0x3'),_0x76b8('0x4')],'include':[{'model':_0x76b8('0x5'),'as':'Agents','attributes':['id',_0x76b8('0x6'),_0x76b8('0x7'),_0x76b8('0x8')]}]},'log':_0x76b8('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index 2e1862a..46e1615 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 _0xa3b9=['update','DESC','../client','create','Request'];(function(_0x18e3fc,_0x4ac195){var _0x366d5a=function(_0x3896e3){while(--_0x3896e3){_0x18e3fc['push'](_0x18e3fc['shift']());}};_0x366d5a(++_0x4ac195);}(_0xa3b9,0x6b));var _0x9a3b=function(_0x408541,_0x477f3e){_0x408541=_0x408541-0x0;var _0x2e04db=_0xa3b9[_0x408541];return _0x2e04db;};'use strict';var client=require(_0x9a3b('0x0'));exports[_0x9a3b('0x1')]=function(_0x32be50){return client[_0x9a3b('0x2')]('CreateOpenchannelQueueReport',{'body':_0x32be50,'log':'CreateOpenchannelQueueReport'});};exports[_0x9a3b('0x3')]=function(_0xab2fa1,_0x19f6f2){return client[_0x9a3b('0x2')]('UpdateOpenchannelQueueReport',{'body':_0x19f6f2,'options':{'where':{'uniqueid':_0xab2fa1},'order':[['id',_0x9a3b('0x4')]],'limit':0x1},'log':'UpdateOpenchannelQueueReport'});}; \ No newline at end of file +var _0x7208=['update','UpdateOpenchannelQueueReport','DESC','../client','create','Request','CreateOpenchannelQueueReport'];(function(_0x21ab32,_0x622b40){var _0x55146d=function(_0x76aee2){while(--_0x76aee2){_0x21ab32['push'](_0x21ab32['shift']());}};_0x55146d(++_0x622b40);}(_0x7208,0x199));var _0x8720=function(_0x59d032,_0x321bd4){_0x59d032=_0x59d032-0x0;var _0x20b579=_0x7208[_0x59d032];return _0x20b579;};'use strict';var client=require(_0x8720('0x0'));exports[_0x8720('0x1')]=function(_0x3d1845){return client[_0x8720('0x2')](_0x8720('0x3'),{'body':_0x3d1845,'log':'CreateOpenchannelQueueReport'});};exports[_0x8720('0x4')]=function(_0x153d47,_0x4fdf07){return client[_0x8720('0x2')](_0x8720('0x5'),{'body':_0x4fdf07,'options':{'where':{'uniqueid':_0x153d47},'order':[['id',_0x8720('0x6')]],'limit':0x1},'log':'UpdateOpenchannelQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index d6e3e83..e066115 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 _0x27bf=['update','Request','UpdateSmsInteraction','updateSmsInteraction','addTags','addTagsToSmsInteraction','../client'];(function(_0x15a551,_0x63d4a4){var _0x14034f=function(_0x5d9515){while(--_0x5d9515){_0x15a551['push'](_0x15a551['shift']());}};_0x14034f(++_0x63d4a4);}(_0x27bf,0x117));var _0xf27b=function(_0x1b0e66,_0x552dce){_0x1b0e66=_0x1b0e66-0x0;var _0x43f2a8=_0x27bf[_0x1b0e66];return _0x43f2a8;};'use strict';var client=require(_0xf27b('0x0'));exports[_0xf27b('0x1')]=function(_0x2227af,_0x43cecf){return client[_0xf27b('0x2')](_0xf27b('0x3'),{'body':_0x43cecf,'options':{'where':{'id':_0x2227af}},'log':_0xf27b('0x4')});};exports[_0xf27b('0x5')]=function(_0x339bb9,_0x1542e3){return client[_0xf27b('0x2')]('AddTagsToSmsInteraction',{'body':_0x1542e3,'options':{'where':{'id':_0x339bb9}},'log':_0xf27b('0x6')});}; \ No newline at end of file +var _0xb26e=['addTags','AddTagsToSmsInteraction','addTagsToSmsInteraction','../client','Request','UpdateSmsInteraction'];(function(_0x4232d8,_0x13fd09){var _0x324de2=function(_0x167ad5){while(--_0x167ad5){_0x4232d8['push'](_0x4232d8['shift']());}};_0x324de2(++_0x13fd09);}(_0xb26e,0x11d));var _0xeb26=function(_0x2e9b5b,_0x3e1332){_0x2e9b5b=_0x2e9b5b-0x0;var _0x734c46=_0xb26e[_0x2e9b5b];return _0x734c46;};'use strict';var client=require(_0xeb26('0x0'));exports['update']=function(_0x59dc2a,_0x522afd){return client[_0xeb26('0x1')](_0xeb26('0x2'),{'body':_0x522afd,'options':{'where':{'id':_0x59dc2a}},'log':'updateSmsInteraction'});};exports[_0xeb26('0x3')]=function(_0x3b8a6f,_0x2817de){return client[_0xeb26('0x1')](_0xeb26('0x4'),{'body':_0x2817de,'options':{'where':{'id':_0x3b8a6f}},'log':_0xeb26('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index 4fd6231..9290da9 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 _0x1d70=['CreateSmsMessage','../client','create','Request'];(function(_0x2b9b7f,_0x4d47df){var _0x4ed19a=function(_0x72b5ff){while(--_0x72b5ff){_0x2b9b7f['push'](_0x2b9b7f['shift']());}};_0x4ed19a(++_0x4d47df);}(_0x1d70,0x1e9));var _0x01d7=function(_0x247b15,_0x4ecec5){_0x247b15=_0x247b15-0x0;var _0x5c123a=_0x1d70[_0x247b15];return _0x5c123a;};'use strict';var client=require(_0x01d7('0x0'));exports[_0x01d7('0x1')]=function(_0x588f08){return client[_0x01d7('0x2')](_0x01d7('0x3'),{'body':_0x588f08,'log':'createSmsMessage'});}; \ No newline at end of file +var _0xa93d=['CreateSmsMessage','../client','Request'];(function(_0x511b17,_0xe6b453){var _0x4fa333=function(_0x5f13e3){while(--_0x5f13e3){_0x511b17['push'](_0x511b17['shift']());}};_0x4fa333(++_0xe6b453);}(_0xa93d,0xa6));var _0xda93=function(_0x29c122,_0x3abac9){_0x29c122=_0x29c122-0x0;var _0x349f8e=_0xa93d[_0x29c122];return _0x349f8e;};'use strict';var client=require(_0xda93('0x0'));exports['create']=function(_0x45b01c){return client[_0xda93('0x1')](_0xda93('0x2'),{'body':_0x45b01c,'log':'createSmsMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index a4513b4..c2a5980 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(_0xc4d135,_0x11e0a0){var _0x2bf805=function(_0x30a617){while(--_0x30a617){_0xc4d135['push'](_0xc4d135['shift']());}};_0x2bf805(++_0x11e0a0);}(_0xe706,0xa3));var _0x6e70=function(_0x2265da,_0xfbbd2e){_0x2265da=_0x2265da-0x0;var _0x430c2b=_0xe706[_0x2265da];return _0x430c2b;};'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 _0xa9e0=['name','online','smsPause','../client','getSmsQueues','Request','timeout','User','Agents'];(function(_0x445644,_0x21d545){var _0x536427=function(_0x44cf09){while(--_0x44cf09){_0x445644['push'](_0x445644['shift']());}};_0x536427(++_0x21d545);}(_0xa9e0,0x123));var _0x0a9e=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0xa9e0[_0x139a3c];return _0x2b375b;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id','name',_0x0a9e('0x3'),'strategy'],'include':[{'model':_0x0a9e('0x4'),'as':_0x0a9e('0x5'),'attributes':['id',_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8')]}]},'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 3124ecf..fb66d88 100644 --- a/server/services/routing/rpc/smsQueueReport.js +++ b/server/services/routing/rpc/smsQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x008c=['../client','create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC'];(function(_0x25c1bd,_0x2b9085){var _0x1eea5f=function(_0x3b720c){while(--_0x3b720c){_0x25c1bd['push'](_0x25c1bd['shift']());}};_0x1eea5f(++_0x2b9085);}(_0x008c,0x188));var _0xc008=function(_0x3d5798,_0x11a5a4){_0x3d5798=_0x3d5798-0x0;var _0x2f9b86=_0x008c[_0x3d5798];return _0x2f9b86;};'use strict';var client=require(_0xc008('0x0'));exports[_0xc008('0x1')]=function(_0x15aadc){return client[_0xc008('0x2')](_0xc008('0x3'),{'body':_0x15aadc,'log':'CreateSmsQueueReport'});};exports[_0xc008('0x4')]=function(_0x47063f,_0x10b33c){return client[_0xc008('0x2')](_0xc008('0x5'),{'body':_0x10b33c,'options':{'where':{'uniqueid':_0x47063f},'order':[['id',_0xc008('0x6')]],'limit':0x1},'log':_0xc008('0x5')});}; \ No newline at end of file +var _0x55ca=['../client','create','CreateSmsQueueReport','update','Request','UpdateSmsQueueReport','DESC'];(function(_0x1e5e49,_0x530fab){var _0x1592de=function(_0x36d04c){while(--_0x36d04c){_0x1e5e49['push'](_0x1e5e49['shift']());}};_0x1592de(++_0x530fab);}(_0x55ca,0x126));var _0xa55c=function(_0x378a07,_0x26dbbe){_0x378a07=_0x378a07-0x0;var _0x1013e7=_0x55ca[_0x378a07];return _0x1013e7;};'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 diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index 46cd0c2..842285a 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(_0x4da1fb,_0xe089b6){var _0x5c3b30=function(_0x126b49){while(--_0x126b49){_0x4da1fb['push'](_0x4da1fb['shift']());}};_0x5c3b30(++_0xe089b6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0xa9e0[_0x37c22c];return _0x119d79;};'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(_0x247271,_0x42af02){var _0x52a8d3=function(_0x7d8781){while(--_0x7d8781){_0x247271['push'](_0x247271['shift']());}};_0x52a8d3(++_0x42af02);}(_0xa9e0,0x123));var _0x0a9e=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xa9e0[_0x311c35];return _0x5cc50c;};'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 3338fa7..5515ddb 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 _0x90ec=['update','Request','UpdateWhatsappInteraction','updateWhatsappInteraction','addTags','AddTagsToWhatsappInteraction','../client'];(function(_0x46cea2,_0x4cd50d){var _0x4d1f5a=function(_0x37696c){while(--_0x37696c){_0x46cea2['push'](_0x46cea2['shift']());}};_0x4d1f5a(++_0x4cd50d);}(_0x90ec,0x1d4));var _0xc90e=function(_0x41ba7c,_0x21b2bb){_0x41ba7c=_0x41ba7c-0x0;var _0xb1bf6a=_0x90ec[_0x41ba7c];return _0xb1bf6a;};'use strict';var client=require(_0xc90e('0x0'));exports[_0xc90e('0x1')]=function(_0x54f2e6,_0x3ed0fc){return client[_0xc90e('0x2')](_0xc90e('0x3'),{'body':_0x3ed0fc,'options':{'where':{'id':_0x54f2e6}},'log':_0xc90e('0x4')});};exports[_0xc90e('0x5')]=function(_0x57acfe,_0x1c13c4){return client[_0xc90e('0x2')](_0xc90e('0x6'),{'body':_0x1c13c4,'options':{'where':{'id':_0x57acfe}},'log':'addTagsToWhatsappInteraction'});}; \ No newline at end of file +var _0xbb67=['Request','UpdateWhatsappInteraction','addTags','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','update'];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_0xbb67,0x161));var _0x7bb6=function(_0x26b6d8,_0x24514d){_0x26b6d8=_0x26b6d8-0x0;var _0x39be02=_0xbb67[_0x26b6d8];return _0x39be02;};'use strict';var client=require('../client');exports[_0x7bb6('0x0')]=function(_0x307b4e,_0xd27f19){return client[_0x7bb6('0x1')](_0x7bb6('0x2'),{'body':_0xd27f19,'options':{'where':{'id':_0x307b4e}},'log':'updateWhatsappInteraction'});};exports[_0x7bb6('0x3')]=function(_0x2c1ddb,_0x1f527c){return client[_0x7bb6('0x1')](_0x7bb6('0x4'),{'body':_0x1f527c,'options':{'where':{'id':_0x2c1ddb}},'log':_0x7bb6('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index 26d5e8b..3b591af 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 _0x57a7=['createWhatsappMessage','../client','create','CreateWhatsappMessage'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0x57a7,0xf9));var _0x757a=function(_0x363ac4,_0xdaf72a){_0x363ac4=_0x363ac4-0x0;var _0x18289e=_0x57a7[_0x363ac4];return _0x18289e;};'use strict';var client=require(_0x757a('0x0'));exports[_0x757a('0x1')]=function(_0xd9e9a8){return client['Request'](_0x757a('0x2'),{'body':_0xd9e9a8,'log':_0x757a('0x3')});}; \ No newline at end of file +var _0x4825=['create','Request','CreateWhatsappMessage','createWhatsappMessage'];(function(_0x319784,_0x47e6d4){var _0x1917da=function(_0x2cb921){while(--_0x2cb921){_0x319784['push'](_0x319784['shift']());}};_0x1917da(++_0x47e6d4);}(_0x4825,0xb4));var _0x5482=function(_0x5092f8,_0x2a57bd){_0x5092f8=_0x5092f8-0x0;var _0x415fe6=_0x4825[_0x5092f8];return _0x415fe6;};'use strict';var client=require('../client');exports[_0x5482('0x0')]=function(_0x423b84){return client[_0x5482('0x1')](_0x5482('0x2'),{'body':_0x423b84,'log':_0x5482('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index 798e134..bd75650 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 _0x7531=['getWhatsappQueues','Request','GetWhatsappQueue','name','timeout','strategy','User','Agents','whatsappPause','../client'];(function(_0x1aba25,_0x1faed1){var _0x47d997=function(_0x4f9e11){while(--_0x4f9e11){_0x1aba25['push'](_0x1aba25['shift']());}};_0x47d997(++_0x1faed1);}(_0x7531,0x1d5));var _0x1753=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x7531[_0x3ab51d];return _0x29a04e;};'use strict';var client=require(_0x1753('0x0'));exports[_0x1753('0x1')]=function(){return function(){return client[_0x1753('0x2')](_0x1753('0x3'),{'options':{'raw':![],'attributes':['id',_0x1753('0x4'),_0x1753('0x5'),_0x1753('0x6')],'include':[{'model':_0x1753('0x7'),'as':_0x1753('0x8'),'attributes':['id','name','online',_0x1753('0x9')]}]},'log':_0x1753('0x1')});};}; \ No newline at end of file +var _0xd179=['getWhatsappQueues','Request','GetWhatsappQueue','timeout','strategy','User','Agents','name','online','whatsappPause','../client'];(function(_0x143511,_0x2c2021){var _0x1030de=function(_0x2a574f){while(--_0x2a574f){_0x143511['push'](_0x143511['shift']());}};_0x1030de(++_0x2c2021);}(_0xd179,0x13e));var _0x9d17=function(_0x4914e2,_0x48be8f){_0x4914e2=_0x4914e2-0x0;var _0x2dcd07=_0xd179[_0x4914e2];return _0x2dcd07;};'use strict';var client=require(_0x9d17('0x0'));exports[_0x9d17('0x1')]=function(){return function(){return client[_0x9d17('0x2')](_0x9d17('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x9d17('0x4'),_0x9d17('0x5')],'include':[{'model':_0x9d17('0x6'),'as':_0x9d17('0x7'),'attributes':['id',_0x9d17('0x8'),_0x9d17('0x9'),_0x9d17('0xa')]}]},'log':_0x9d17('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index c282ea3..559d6cd 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 _0xfb55=['UpdateWhatsappQueueReport','DESC','../client','Request','CreateWhatsappQueueReport'];(function(_0x5695ff,_0x324735){var _0x3dbfc5=function(_0xc5a01b){while(--_0xc5a01b){_0x5695ff['push'](_0x5695ff['shift']());}};_0x3dbfc5(++_0x324735);}(_0xfb55,0x6b));var _0x5fb5=function(_0x5eaaa0,_0x587f9b){_0x5eaaa0=_0x5eaaa0-0x0;var _0x175f72=_0xfb55[_0x5eaaa0];return _0x175f72;};'use strict';var client=require(_0x5fb5('0x0'));exports['create']=function(_0x343b03){return client[_0x5fb5('0x1')]('CreateWhatsappQueueReport',{'body':_0x343b03,'log':_0x5fb5('0x2')});};exports['update']=function(_0x35e36d,_0x3bfe89){return client[_0x5fb5('0x1')](_0x5fb5('0x3'),{'body':_0x3bfe89,'options':{'where':{'uniqueid':_0x35e36d},'order':[['id',_0x5fb5('0x4')]],'limit':0x1},'log':'UpdateWhatsappQueueReport'});}; \ No newline at end of file +var _0xe228=['../client','create','Request','CreateWhatsappQueueReport','update','DESC','UpdateWhatsappQueueReport'];(function(_0xc5fb3b,_0x4ff195){var _0x1fcc9a=function(_0x45df49){while(--_0x45df49){_0xc5fb3b['push'](_0xc5fb3b['shift']());}};_0x1fcc9a(++_0x4ff195);}(_0xe228,0x1ea));var _0x8e22=function(_0x3d3803,_0x3f40c9){_0x3d3803=_0x3d3803-0x0;var _0x58652e=_0xe228[_0x3d3803];return _0x58652e;};'use strict';var client=require(_0x8e22('0x0'));exports[_0x8e22('0x1')]=function(_0x1b96d2){return client[_0x8e22('0x2')](_0x8e22('0x3'),{'body':_0x1b96d2,'log':_0x8e22('0x3')});};exports[_0x8e22('0x4')]=function(_0x5c3c4f,_0x34a26e){return client[_0x8e22('0x2')]('UpdateWhatsappQueueReport',{'body':_0x34a26e,'options':{'where':{'uniqueid':_0x5c3c4f},'order':[['id',_0x8e22('0x5')]],'limit':0x1},'log':_0x8e22('0x6')});}; \ 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 4f16f09..32def4c 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 _0x343e=['rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','close','[%s][AGENT]\x20ROUTING\x20END','next','agent','log','[%s][QUEUE]\x20%s','stack','validate','util','seq-queue','../../../../config/logger','routing','./strategy','string','timeout\x20is\x20a\x20number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','error','[%s][AGENT]\x20%s','map','message','join','stop','find','agents','createQueue','atimeout','channel','START:%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x343e,0x9a));var _0xe343=function(_0x55da1f,_0x389f97){_0x55da1f=_0x55da1f-0x0;var _0x1c8a1c=_0x343e[_0x55da1f];return _0x1c8a1c;};'use strict';var schema=require(_0xe343('0x0'));var _=require('lodash');var util=require(_0xe343('0x1'));var seqqueue=require(_0xe343('0x2'));var logger=require(_0xe343('0x3'))(_0xe343('0x4'));var strategy=require(_0xe343('0x5'));var queue=schema({'name':{'type':_0xe343('0x6'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':'number','message':_0xe343('0x7')}});function writeLog(_0x2d5671,_0x4bdcc1,_0x1fa12b){return logger[_0xe343('0x8')](util[_0xe343('0x9')](_0xe343('0xa'),_0x2d5671,_0x4bdcc1['name'],_0x1fa12b));}function handleFindAgent(_0x5c34dd){return function(_0x29d68c){return _0x29d68c[_0xe343('0xb')][_0xe343('0xc')]()===_0x5c34dd['toLowerCase']();};}exports[_0xe343('0xd')]=function(_0x4818b9,_0x2b91fd,_0x38b073,_0x46c0cb){return function(_0x3aa544){try{var _0x2d66e2={'name':_0x2b91fd[0x0],'timeout':_0x2b91fd[0x1]};var _0x336c81=queue['validate'](_0x2d66e2,{'typecast':!![]});if(_0x336c81['length']){logger[_0xe343('0xe')](_0xe343('0xf'),_0x4818b9,_[_0xe343('0x10')](_0x336c81,_0xe343('0x11'))[_0xe343('0x12')](',\x20'));_0x3aa544[_0xe343('0x13')]();}else{var _0x215f28=_[_0xe343('0x14')](_0x38b073[_0xe343('0x15')],handleFindAgent(_0x2d66e2[_0xe343('0xb')]));if(_0x215f28){var _0x314385=(_0x2d66e2['timeout']||0xa)*0x3e8;var _0x493b94,_0x575707;var _0x2f5958=seqqueue[_0xe343('0x16')](_0x314385);_0x2f5958['id']=_0x4818b9;_0x2f5958[_0xe343('0x17')]=_0x314385;_0x2f5958[_0xe343('0x18')]=_0x46c0cb[_0xe343('0x18')];writeLog(_0x4818b9,_0x215f28,util[_0xe343('0x9')](_0xe343('0x19'),_0x314385));_0x38b073[_0xe343('0x1a')][_0x4818b9]['on'](_0xe343('0x1b'),function(){logger['info'](_0xe343('0x1c'),_0x4818b9);clearTimeout(_0x575707);_0x575707=undefined;_0x2f5958[_0xe343('0x1d')]();if(_0x38b073['rules'][_0x4818b9]){delete _0x38b073['rules'][_0x4818b9];}_0x3aa544[_0xe343('0x13')]();});_0x38b073[_0xe343('0x1a')][_0x4818b9]['on']('complete',function(){if(_0x38b073[_0xe343('0x1a')][_0x4818b9]){delete _0x38b073[_0xe343('0x1a')][_0x4818b9];}});_0x575707=setTimeout(function(){logger[_0xe343('0x8')](_0xe343('0x1e'),_0x4818b9);clearTimeout(_0x575707);_0x2f5958[_0xe343('0x1d')]();_0x3aa544[_0xe343('0x1f')]();},_0x314385);strategy[_0xe343('0x20')](_0x2f5958,_0x215f28,_0x38b073,_0x46c0cb);}else{logger['error']('[%s][AGENT]\x20agent\x20not\x20found\x20%s',_0x4818b9,_0x2d66e2[_0xe343('0xb')]);_0x3aa544[_0xe343('0x13')]();}}}catch(_0x2f7898){console[_0xe343('0x21')](_0x2f7898);logger[_0xe343('0xe')](_0xe343('0x22'),_0x4818b9,_0x2f7898[_0xe343('0x23')]);_0x3aa544[_0xe343('0x13')]();}};}; \ No newline at end of file +var _0xab88=['consequence','length','error','map','join','stop','find','agents','timeout','atimeout','channel','START:%s','rules','end','info','[%s][AGENT]\x20ROUTING\x20STOPPED','close','next','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack','validate','lodash','util','seq-queue','../../../../config/logger','routing','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase'];(function(_0x524df2,_0x831687){var _0x1d0310=function(_0x50f18a){while(--_0x50f18a){_0x524df2['push'](_0x524df2['shift']());}};_0x1d0310(++_0x831687);}(_0xab88,0x1dd));var _0x8ab8=function(_0x52991d,_0x429d72){_0x52991d=_0x52991d-0x0;var _0x5b9004=_0xab88[_0x52991d];return _0x5b9004;};'use strict';var schema=require(_0x8ab8('0x0'));var _=require(_0x8ab8('0x1'));var util=require(_0x8ab8('0x2'));var seqqueue=require(_0x8ab8('0x3'));var logger=require(_0x8ab8('0x4'))(_0x8ab8('0x5'));var strategy=require('./strategy');var queue=schema({'name':{'type':'string','required':!![],'message':_0x8ab8('0x6')},'timeout':{'type':_0x8ab8('0x7'),'message':_0x8ab8('0x8')}});function writeLog(_0x1d4f7d,_0x2a8286,_0x2fab0c){return logger['info'](util[_0x8ab8('0x9')](_0x8ab8('0xa'),_0x1d4f7d,_0x2a8286[_0x8ab8('0xb')],_0x2fab0c));}function handleFindAgent(_0x190f9b){return function(_0x33769d){return _0x33769d[_0x8ab8('0xb')][_0x8ab8('0xc')]()===_0x190f9b[_0x8ab8('0xc')]();};}exports[_0x8ab8('0xd')]=function(_0x528e4a,_0x2faf53,_0x9cdfeb,_0x41399e){return function(_0x96831c){try{var _0x4f9c8f={'name':_0x2faf53[0x0],'timeout':_0x2faf53[0x1]};var _0x4e1ad6=queue['validate'](_0x4f9c8f,{'typecast':!![]});if(_0x4e1ad6[_0x8ab8('0xe')]){logger[_0x8ab8('0xf')]('[%s][AGENT]\x20%s',_0x528e4a,_[_0x8ab8('0x10')](_0x4e1ad6,'message')[_0x8ab8('0x11')](',\x20'));_0x96831c[_0x8ab8('0x12')]();}else{var _0x385508=_[_0x8ab8('0x13')](_0x9cdfeb[_0x8ab8('0x14')],handleFindAgent(_0x4f9c8f[_0x8ab8('0xb')]));if(_0x385508){var _0x442270=(_0x4f9c8f[_0x8ab8('0x15')]||0xa)*0x3e8;var _0x213d23,_0x3dff23;var _0x4e97a7=seqqueue['createQueue'](_0x442270);_0x4e97a7['id']=_0x528e4a;_0x4e97a7[_0x8ab8('0x16')]=_0x442270;_0x4e97a7['channel']=_0x41399e[_0x8ab8('0x17')];writeLog(_0x528e4a,_0x385508,util[_0x8ab8('0x9')](_0x8ab8('0x18'),_0x442270));_0x9cdfeb[_0x8ab8('0x19')][_0x528e4a]['on'](_0x8ab8('0x1a'),function(){logger[_0x8ab8('0x1b')](_0x8ab8('0x1c'),_0x528e4a);clearTimeout(_0x3dff23);_0x3dff23=undefined;_0x4e97a7[_0x8ab8('0x1d')]();if(_0x9cdfeb[_0x8ab8('0x19')][_0x528e4a]){delete _0x9cdfeb['rules'][_0x528e4a];}_0x96831c[_0x8ab8('0x12')]();});_0x9cdfeb[_0x8ab8('0x19')][_0x528e4a]['on']('complete',function(){if(_0x9cdfeb[_0x8ab8('0x19')][_0x528e4a]){delete _0x9cdfeb[_0x8ab8('0x19')][_0x528e4a];}});_0x3dff23=setTimeout(function(){logger[_0x8ab8('0x1b')]('[%s][AGENT]\x20ROUTING\x20END',_0x528e4a);clearTimeout(_0x3dff23);_0x4e97a7[_0x8ab8('0x1d')]();_0x96831c[_0x8ab8('0x1e')]();},_0x442270);strategy['agent'](_0x4e97a7,_0x385508,_0x9cdfeb,_0x41399e);}else{logger[_0x8ab8('0xf')](_0x8ab8('0x1f'),_0x528e4a,_0x4f9c8f[_0x8ab8('0xb')]);_0x96831c['stop']();}}}catch(_0x277918){console[_0x8ab8('0x20')](_0x277918);logger[_0x8ab8('0xf')](_0x8ab8('0x21'),_0x528e4a,_0x277918[_0x8ab8('0x22')]);_0x96831c['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/amazonlex.js b/server/services/routing/server/applications/amazonlex.js index 196993a..59e5a26 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 _0x8b83=['create','then','info','error','stringify','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','$LATEST','message','toString','postText','amazonlex','providerName','providerResponse','dialogState','Failed','lodash','moment','aws-sdk','./utils','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/whatsappMessage','consequence','isNil','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','whatsapp','phone','chat','upperFirst','AccountId','InteractionId','created','isEmpty','body','Message'];(function(_0x20ebb5,_0x237d88){var _0x487182=function(_0xaa5491){while(--_0xaa5491){_0x20ebb5['push'](_0x20ebb5['shift']());}};_0x487182(++_0x237d88);}(_0x8b83,0x15b));var _0x38b8=function(_0x5221c0,_0x5aba00){_0x5221c0=_0x5221c0-0x0;var _0x1653a7=_0x8b83[_0x5221c0];return _0x1653a7;};'use strict';var _=require(_0x38b8('0x0'));var moment=require(_0x38b8('0x1'));var AWS=require(_0x38b8('0x2'));var utils=require(_0x38b8('0x3'));var logger=require(_0x38b8('0x4'))(_0x38b8('0x5'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x38b8('0x6')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x38b8('0x7'))};exports[_0x38b8('0x8')]=function(_0xb7b02d,_0x2e164b){return function(_0x5b8f75){try{if(!_[_0x38b8('0x9')](this[_0x38b8('0xa')][_0x38b8('0xb')])){logger['info'](_0x38b8('0xc'),_0xb7b02d,_0x38b8('0xd'));return _0x5b8f75[_0x38b8('0xe')]();}var _0xc2f6f4={'ContactId':this[_0x38b8('0xf')]['id'],'sentAt':moment()[_0x38b8('0x10')](_0x38b8('0x11')),'direction':'out'};if(this[_0x38b8('0x12')]==='sms'||this['channel']===_0x38b8('0x13')){_0xc2f6f4[_0x38b8('0x14')]=this[_0x38b8('0xa')][_0x38b8('0x14')];}var _0x604733=this[_0x38b8('0x12')];if(_0x604733===_0x38b8('0x15')){_0xc2f6f4['ChatWebsiteId']=this['account']['id'];}else{_0xc2f6f4[_[_0x38b8('0x16')](_0x604733)+_0x38b8('0x17')]=this['account']['id'];}_0xc2f6f4[_[_0x38b8('0x16')](_0x604733)+_0x38b8('0x18')]=this[_0x38b8('0xa')]['id'];if(this[_0x38b8('0xa')][_0x38b8('0x19')]){var _0x578482=_0x2e164b[0x4];if(!_[_0x38b8('0x1a')](_0x578482)){_0xc2f6f4[_0x38b8('0x1b')]=utils['getMustacheRender'](_0x578482,this);return rpc[_0x604733+_0x38b8('0x1c')][_0x38b8('0x1d')](_0xc2f6f4)[_0x38b8('0x1e')](function(_0xd500e8){logger[_0x38b8('0x1f')](_0x38b8('0xc'),_0xb7b02d,_0xc2f6f4['body']);})['catch'](function(_0x20130c){logger[_0x38b8('0x20')](_0x38b8('0xc'),_0xb7b02d,JSON[_0x38b8('0x21')](_0x20130c));})['finally'](function(){logger[_0x38b8('0x1f')](_0x38b8('0x22'),_0xb7b02d);_0x5b8f75[_0x38b8('0x23')]();});}else{logger[_0x38b8('0x1f')](_0x38b8('0x24'),_0xb7b02d);_0x5b8f75[_0x38b8('0x23')]();}}else{var _0x10e53a=this;var _0x53b5af=new AWS[(_0x38b8('0x25'))]({'accessKeyId':_0x2e164b[0x0],'secretAccessKey':_0x2e164b[0x1],'region':_0x2e164b[0x2]});var _0x4d6c6f={'botAlias':_0x38b8('0x26'),'botName':_0x2e164b[0x3],'inputText':this[_0x38b8('0x27')]['body'],'userId':this[_0x38b8('0x12')]+':'+this['interaction']['id'][_0x38b8('0x28')]()};_0x53b5af[_0x38b8('0x29')](_0x4d6c6f,function(_0x21da63,_0x21c269){if(_0x21da63){logger[_0x38b8('0x20')](_0x38b8('0xc'),_0xb7b02d,_0x21da63[_0x38b8('0x27')]);_0x5b8f75[_0x38b8('0xe')]();}else if(_0x21c269&&_0x21c269[_0x38b8('0x27')]){_0x10e53a['body'][_0x38b8('0x2a')]=_0x21c269;_0xc2f6f4[_0x38b8('0x1b')]=_0x21c269[_0x38b8('0x27')];_0xc2f6f4[_0x38b8('0x2b')]=_0x38b8('0x2a');_0xc2f6f4[_0x38b8('0x2c')]=JSON[_0x38b8('0x21')](_0x21c269);return rpc[_0x604733+_0x38b8('0x1c')]['create'](_0xc2f6f4)['then'](function(_0x46e9bf){logger[_0x38b8('0x1f')](_0x38b8('0xc'),_0xb7b02d,_0xc2f6f4[_0x38b8('0x1b')]);if(_0x21c269[_0x38b8('0x2d')]==_0x38b8('0x2e')){_0x5b8f75[_0x38b8('0xe')]();}else{_0x5b8f75['stop']();}})['catch'](function(_0x2fdd60){logger[_0x38b8('0x20')]('[%s][AMAZONLEX]\x20%s',_0xb7b02d,JSON[_0x38b8('0x21')](_0x2fdd60));_0x5b8f75[_0x38b8('0xe')]();});}else{_0x5b8f75[_0x38b8('0xe')]();}});}}catch(_0x706db1){logger[_0x38b8('0x20')](_0x38b8('0xc'),_0xb7b02d,JSON[_0x38b8('0x21')](_0x706db1));_0x5b8f75['stop']();}};}; \ No newline at end of file +var _0x101e=['../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','isNil','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','chat','ChatWebsiteId','upperFirst','AccountId','account','InteractionId','interaction','isEmpty','getMustacheRender','create','then','body','error','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','$LATEST','message','postText','next','amazonlex','providerName','providerResponse','Message','Failed','catch','lodash','moment','aws-sdk','./utils','../../rpc/chatMessage'];(function(_0x4d180c,_0x45c68e){var _0x49b57e=function(_0x264741){while(--_0x264741){_0x4d180c['push'](_0x4d180c['shift']());}};_0x49b57e(++_0x45c68e);}(_0x101e,0x159));var _0xe101=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x101e[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0xe101('0x0'));var moment=require(_0xe101('0x1'));var AWS=require(_0xe101('0x2'));var utils=require(_0xe101('0x3'));var logger=require('../../../../config/logger')('routing');var rpc={'chatMessage':require(_0xe101('0x4')),'openchannelMessage':require(_0xe101('0x5')),'mailMessage':require(_0xe101('0x6')),'smsMessage':require(_0xe101('0x7')),'faxMessage':require(_0xe101('0x8')),'whatsappMessage':require(_0xe101('0x9'))};exports['consequence']=function(_0x2485a8,_0x542977){return function(_0x334428){try{if(!_[_0xe101('0xa')](this['interaction']['UserId'])){logger[_0xe101('0xb')](_0xe101('0xc'),_0x2485a8,_0xe101('0xd'));return _0x334428['next']();}var _0x585150={'ContactId':this['contact']['id'],'sentAt':moment()[_0xe101('0xe')](_0xe101('0xf')),'direction':_0xe101('0x10')};if(this[_0xe101('0x11')]===_0xe101('0x12')||this['channel']===_0xe101('0x13')){_0x585150['phone']=this['interaction'][_0xe101('0x14')];}var _0x33c5a8=this[_0xe101('0x11')];if(_0x33c5a8===_0xe101('0x15')){_0x585150[_0xe101('0x16')]=this['account']['id'];}else{_0x585150[_[_0xe101('0x17')](_0x33c5a8)+_0xe101('0x18')]=this[_0xe101('0x19')]['id'];}_0x585150[_[_0xe101('0x17')](_0x33c5a8)+_0xe101('0x1a')]=this[_0xe101('0x1b')]['id'];if(this[_0xe101('0x1b')]['created']){var _0x3d1755=_0x542977[0x4];if(!_[_0xe101('0x1c')](_0x3d1755)){_0x585150['body']=utils[_0xe101('0x1d')](_0x3d1755,this);return rpc[_0x33c5a8+'Message'][_0xe101('0x1e')](_0x585150)[_0xe101('0x1f')](function(_0x33f16f){logger[_0xe101('0xb')](_0xe101('0xc'),_0x2485a8,_0x585150[_0xe101('0x20')]);})['catch'](function(_0x151277){logger[_0xe101('0x21')](_0xe101('0xc'),_0x2485a8,JSON[_0xe101('0x22')](_0x151277));})[_0xe101('0x23')](function(){logger['info'](_0xe101('0x24'),_0x2485a8);_0x334428[_0xe101('0x25')]();});}else{logger['info'](_0xe101('0x26'),_0x2485a8);_0x334428[_0xe101('0x25')]();}}else{var _0x5e96f2=this;var _0x3c676a=new AWS[(_0xe101('0x27'))]({'accessKeyId':_0x542977[0x0],'secretAccessKey':_0x542977[0x1],'region':_0x542977[0x2]});var _0x1c67be={'botAlias':_0xe101('0x28'),'botName':_0x542977[0x3],'inputText':this[_0xe101('0x29')]['body'],'userId':this['channel']+':'+this[_0xe101('0x1b')]['id']['toString']()};_0x3c676a[_0xe101('0x2a')](_0x1c67be,function(_0x4b3b66,_0x3f0a5e){if(_0x4b3b66){logger[_0xe101('0x21')]('[%s][AMAZONLEX]\x20%s',_0x2485a8,_0x4b3b66[_0xe101('0x29')]);_0x334428[_0xe101('0x2b')]();}else if(_0x3f0a5e&&_0x3f0a5e[_0xe101('0x29')]){_0x5e96f2[_0xe101('0x20')][_0xe101('0x2c')]=_0x3f0a5e;_0x585150['body']=_0x3f0a5e[_0xe101('0x29')];_0x585150[_0xe101('0x2d')]=_0xe101('0x2c');_0x585150[_0xe101('0x2e')]=JSON[_0xe101('0x22')](_0x3f0a5e);return rpc[_0x33c5a8+_0xe101('0x2f')]['create'](_0x585150)[_0xe101('0x1f')](function(_0xdcea5d){logger['info']('[%s][AMAZONLEX]\x20%s',_0x2485a8,_0x585150['body']);if(_0x3f0a5e['dialogState']==_0xe101('0x30')){_0x334428['next']();}else{_0x334428[_0xe101('0x25')]();}})[_0xe101('0x31')](function(_0x2bf5c7){logger['error']('[%s][AMAZONLEX]\x20%s',_0x2485a8,JSON[_0xe101('0x22')](_0x2bf5c7));_0x334428[_0xe101('0x2b')]();});}else{_0x334428[_0xe101('0x2b')]();}});}}catch(_0x45220a){logger['error'](_0xe101('0xc'),_0x2485a8,JSON['stringify'](_0x45220a));_0x334428[_0xe101('0x25')]();}};}; \ 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 cdad99a..2be664e 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 _0x291f=['then','[%s][AUTOREPLY]\x20SMTP\x20SENT','Message','create','stringify','catch','[RPC][%s][AUTOREPLY]\x20%s','finally','resolve','Interaction','update','error','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','stop','lodash','moment','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/whatsappInteraction','../../mailRpc','consequence','channel','mail','isAutoreply','info','[%s][AUTOREPLY]\x20%s','next','isNil','interaction','created','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','contact','body','getMustacheRender','message','from','phone','read','subject','Re:\x20','chat','account','upperFirst','AccountId','InteractionId','messageId','','replace','','headers','auto-replied','All','auto_reply','smtpOptions'];(function(_0xb93836,_0x2e7941){var _0x2b3e5b=function(_0x56d0a4){while(--_0x56d0a4){_0xb93836['push'](_0xb93836['shift']());}};_0x2b3e5b(++_0x2e7941);}(_0x291f,0xd4));var _0xf291=function(_0x49cf57,_0x366ece){_0x49cf57=_0x49cf57-0x0;var _0x3b2e91=_0x291f[_0x49cf57];return _0x3b2e91;};'use strict';var _=require(_0xf291('0x0'));var moment=require(_0xf291('0x1'));var utils=require(_0xf291('0x2'));var logger=require(_0xf291('0x3'))(_0xf291('0x4'));var rpc={'chatMessage':require(_0xf291('0x5')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0xf291('0x6')),'smsMessage':require(_0xf291('0x7')),'faxMessage':require(_0xf291('0x8')),'whatsappMessage':require('../../rpc/whatsappMessage'),'chatInteraction':require(_0xf291('0x9')),'openchannelInteraction':require(_0xf291('0xa')),'mailInteraction':require('../../rpc/mailInteraction'),'smsInteraction':require(_0xf291('0xb')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0xf291('0xc'))};var mailRpc=require(_0xf291('0xd'));exports[_0xf291('0xe')]=function(_0x48c2c8,_0x4926c7,_0x58bc96,_0x55ee80){return function(_0x1c3ce2){try{var _0xf95267=this[_0xf291('0xf')];if(_0xf95267===_0xf291('0x10')&&_0x55ee80['body'][_0xf291('0x11')]){logger[_0xf291('0x12')](_0xf291('0x13'),_0x48c2c8,'Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)');return _0x1c3ce2[_0xf291('0x14')]();}if(_0x4926c7[0x0]==='1'&&(_[_0xf291('0x15')](this[_0xf291('0x16')][_0xf291('0x17')])||!this['interaction'][_0xf291('0x17')])){logger['info'](_0xf291('0x13'),_0x48c2c8,'Autoreply\x20already\x20sent');return _0x1c3ce2[_0xf291('0x14')]();}if(_0x4926c7[0x0]==='2'&&this['interaction'][_0xf291('0x18')]){logger['info'](_0xf291('0x19'),_0x48c2c8,_0xf291('0x1a'));return _0x1c3ce2[_0xf291('0x14')]();}var _0x35598e={'ContactId':this[_0xf291('0x1b')]['id'],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'direction':'out'};if(this['channel']===_0xf291('0x10')){_0x35598e[_0xf291('0x1c')]=utils[_0xf291('0x1d')](_0x4926c7[0x2],this);}else{_0x35598e[_0xf291('0x1c')]=utils[_0xf291('0x1d')](_0x4926c7[0x1],this);}if(this[_0xf291('0x1e')]){_0x35598e['to']=this[_0xf291('0x1e')][_0xf291('0x1f')]||'';if(this['channel']===_0xf291('0x10')&&_0x4926c7[0x1]==='1'){_0x35598e['cc']=this[_0xf291('0x1e')]['cc']||'';}_0x35598e[_0xf291('0x1f')]=this['message']['to']||'';_0x35598e[_0xf291('0x20')]=this[_0xf291('0x1e')][_0xf291('0x20')]||'';_0x35598e[_0xf291('0x21')]=!![];if(this[_0xf291('0x1e')][_0xf291('0x22')]){_0x35598e[_0xf291('0x22')]='';_0x35598e['subject']+=_['startsWith'](this[_0xf291('0x1e')][_0xf291('0x22')],'Re:')?'':_0xf291('0x23');_0x35598e['subject']+=this[_0xf291('0x1e')]['subject'];}}if(this[_0xf291('0xf')]===_0xf291('0x24')){_0x35598e['ChatWebsiteId']=this[_0xf291('0x25')]['id'];}else{_0x35598e[_[_0xf291('0x26')](this['channel'])+_0xf291('0x27')]=this[_0xf291('0x25')]['id'];}_0x35598e[_[_0xf291('0x26')](this[_0xf291('0xf')])+_0xf291('0x28')]=this[_0xf291('0x16')]['id'];var _0xe5056b=this['interaction'];if(rpc[this[_0xf291('0xf')]+'Message']){if(this[_0xf291('0xf')]===_0xf291('0x10')){_0x35598e['inReplyTo']=this[_0xf291('0x1e')][_0xf291('0x29')];_0x35598e['html']=_0xf291('0x2a')+_[_0xf291('0x2b')](_0x35598e['body'],_0xf291('0x2c'),_0xf291('0x2d'))+_0xf291('0x2e');_0x35598e[_0xf291('0x2f')]={'Auto-Submitted':_0xf291('0x30'),'X-Auto-Response-Suppress':_0xf291('0x31'),'Precedence':_0xf291('0x32')};return mailRpc['sendMailMessage'](this['account'][_0xf291('0x33')],_0x35598e)[_0xf291('0x34')](function(_0x8575d2){logger[_0xf291('0x12')](_0xf291('0x35'),_0x48c2c8);_0x35598e[_0xf291('0x29')]=_0x8575d2[_0xf291('0x1e')][_0xf291('0x29')];return rpc[_0xf95267+_0xf291('0x36')][_0xf291('0x37')](_0x35598e);})[_0xf291('0x34')](function(_0x199cc9){logger[_0xf291('0x12')](_0xf291('0x13'),_0x48c2c8,JSON[_0xf291('0x38')](_0x199cc9));})[_0xf291('0x39')](function(_0x27abdb){logger['error'](_0xf291('0x3a'),_0x48c2c8,JSON['stringify'](_0x27abdb));})[_0xf291('0x3b')](function(){Promise[_0xf291('0x3c')]()[_0xf291('0x34')](function(){if(_0x4926c7[0x0]!=='2'||_0xe5056b[_0xf291('0x18')])return;return rpc[_0xf95267+_0xf291('0x3d')][_0xf291('0x3e')](_0xe5056b['id'],{'autoreplyExecuted':!![]})[_0xf291('0x34')](function(_0x265880){logger[_0xf291('0x12')](_0xf291('0x19'),_0x48c2c8,JSON[_0xf291('0x38')](_0x265880));})[_0xf291('0x39')](function(_0x668b1c){logger[_0xf291('0x3f')](_0xf291('0x40'),_0x48c2c8,JSON[_0xf291('0x38')](_0x668b1c));});})[_0xf291('0x34')](function(){_0x1c3ce2[_0xf291('0x14')]();});});}else{return rpc[this[_0xf291('0xf')]+_0xf291('0x36')]['create'](_0x35598e)['then'](function(){logger[_0xf291('0x12')]('[%s][AUTOREPLY]\x20%s',_0x48c2c8,_0x35598e['body']);})['catch'](function(_0x528db4){logger[_0xf291('0x3f')](_0xf291('0x13'),_0x48c2c8,JSON[_0xf291('0x38')](_0x528db4));})[_0xf291('0x3b')](function(){Promise[_0xf291('0x3c')]()[_0xf291('0x34')](function(){if(_0x4926c7[0x0]!=='2'||_0xe5056b[_0xf291('0x18')])return;return rpc[_0xf95267+_0xf291('0x3d')][_0xf291('0x3e')](_0xe5056b['id'],{'autoreplyExecuted':!![]})[_0xf291('0x34')](function(_0x34e02d){logger[_0xf291('0x12')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x48c2c8,JSON[_0xf291('0x38')](_0x34e02d));})[_0xf291('0x39')](function(_0x5e7bdd){logger[_0xf291('0x3f')](_0xf291('0x40'),_0x48c2c8,JSON[_0xf291('0x38')](_0x5e7bdd));});})[_0xf291('0x34')](function(){_0x1c3ce2[_0xf291('0x14')]();});});}}}catch(_0x29d875){logger['error'](_0xf291('0x13'),_0x48c2c8,JSON[_0xf291('0x38')](_0x29d875));_0x1c3ce2[_0xf291('0x41')]();}};}; \ No newline at end of file +var _0x6d99=['stop','lodash','moment','./utils','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../mailRpc','consequence','channel','mail','body','isAutoreply','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','isNil','interaction','created','autoreplyExecuted','One\x20Time\x20already\x20sent','contact','format','out','getMustacheRender','message','from','phone','subject','Re:','chat','ChatWebsiteId','upperFirst','account','InteractionId','Message','inReplyTo','messageId','html','replace',''+_[_0x96d9('0x2f')](_0x246b6c[_0x96d9('0x12')],_0x96d9('0x30'),_0x96d9('0x31'))+'';_0x246b6c[_0x96d9('0x32')]={'Auto-Submitted':_0x96d9('0x33'),'X-Auto-Response-Suppress':_0x96d9('0x34'),'Precedence':_0x96d9('0x35')};return mailRpc['sendMailMessage'](this[_0x96d9('0x29')][_0x96d9('0x36')],_0x246b6c)[_0x96d9('0x37')](function(_0x117aab){logger[_0x96d9('0x14')](_0x96d9('0x38'),_0x2a8061);_0x246b6c[_0x96d9('0x2d')]=_0x117aab[_0x96d9('0x21')]['messageId'];return rpc[_0x560ddb+_0x96d9('0x2b')][_0x96d9('0x39')](_0x246b6c);})[_0x96d9('0x37')](function(_0x52cee7){logger[_0x96d9('0x14')]('[%s][AUTOREPLY]\x20%s',_0x2a8061,JSON['stringify'](_0x52cee7));})[_0x96d9('0x3a')](function(_0x20de10){logger[_0x96d9('0x3b')](_0x96d9('0x3c'),_0x2a8061,JSON['stringify'](_0x20de10));})[_0x96d9('0x3d')](function(){Promise['resolve']()[_0x96d9('0x37')](function(){if(_0x582df1[0x0]!=='2'||_0x596f9e[_0x96d9('0x1b')])return;return rpc[_0x560ddb+_0x96d9('0x3e')][_0x96d9('0x3f')](_0x596f9e['id'],{'autoreplyExecuted':!![]})['then'](function(_0x311b1c){logger[_0x96d9('0x14')](_0x96d9('0x40'),_0x2a8061,JSON['stringify'](_0x311b1c));})[_0x96d9('0x3a')](function(_0x12d582){logger[_0x96d9('0x3b')](_0x96d9('0x41'),_0x2a8061,JSON[_0x96d9('0x42')](_0x12d582));});})['then'](function(){_0x1d1c71[_0x96d9('0x17')]();});});}else{return rpc[this['channel']+_0x96d9('0x2b')][_0x96d9('0x39')](_0x246b6c)['then'](function(){logger[_0x96d9('0x14')](_0x96d9('0x15'),_0x2a8061,_0x246b6c[_0x96d9('0x12')]);})['catch'](function(_0x140c40){logger[_0x96d9('0x3b')](_0x96d9('0x15'),_0x2a8061,JSON[_0x96d9('0x42')](_0x140c40));})[_0x96d9('0x3d')](function(){Promise[_0x96d9('0x43')]()[_0x96d9('0x37')](function(){if(_0x582df1[0x0]!=='2'||_0x596f9e[_0x96d9('0x1b')])return;return rpc[_0x560ddb+_0x96d9('0x3e')]['update'](_0x596f9e['id'],{'autoreplyExecuted':!![]})[_0x96d9('0x37')](function(_0x5b26a0){logger[_0x96d9('0x14')](_0x96d9('0x40'),_0x2a8061,JSON[_0x96d9('0x42')](_0x5b26a0));})[_0x96d9('0x3a')](function(_0x2e98e7){logger['error'](_0x96d9('0x41'),_0x2a8061,JSON[_0x96d9('0x42')](_0x2e98e7));});})[_0x96d9('0x37')](function(){_0x1d1c71['next']();});});}}}catch(_0x3deeaf){logger[_0x96d9('0x3b')](_0x96d9('0x15'),_0x2a8061,JSON[_0x96d9('0x42')](_0x3deeaf));_0x1d1c71[_0x96d9('0x44')]();}};}; \ 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 de7a8c1..0d9b93c 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 _0x8c92=['../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','format','system','Interaction','channel','update','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','error','[%s][CLOSE]\x20%s','stringify','finally','stop','../../../../config/logger','routing','../../rpc/chatInteraction','../../rpc/openchannelInteraction'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x8c92,0x155));var _0x28c9=function(_0x3acc8e,_0x2e5b3d){_0x3acc8e=_0x3acc8e-0x0;var _0x5eeea0=_0x8c92[_0x3acc8e];return _0x5eeea0;};'use strict';var moment=require('moment');var logger=require(_0x28c9('0x0'))(_0x28c9('0x1'));var rpc={'chatInteraction':require(_0x28c9('0x2')),'openchannelInteraction':require(_0x28c9('0x3')),'smsInteraction':require(_0x28c9('0x4')),'mailInteraction':require(_0x28c9('0x5')),'faxInteraction':require(_0x28c9('0x6')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};exports[_0x28c9('0x7')]=function(_0x1d66e5,_0x331669,_0x4c8c08,_0x3e8aa8){return function(_0x262c0d){try{logger[_0x28c9('0x8')](_0x28c9('0x9'),_0x1d66e5,_0x331669[0x0]);var _0x352b79={'closed':0x1,'closedAt':moment()[_0x28c9('0xa')]('YYYY-MM-DD\x20HH:mm:ss'),'closeReason':_0x28c9('0xb'),'disposition':_0x331669[0x0]};if(rpc[_0x3e8aa8['channel']+_0x28c9('0xc')]){rpc[_0x3e8aa8[_0x28c9('0xd')]+_0x28c9('0xc')][_0x28c9('0xe')](_0x3e8aa8['interaction']['id'],_0x352b79)[_0x28c9('0xf')](function(_0x33fbf8){logger[_0x28c9('0x8')](_0x28c9('0x10'),_0x1d66e5,_0x3e8aa8['interaction']['id']);})[_0x28c9('0x11')](function(_0x21ffdd){logger[_0x28c9('0x12')](_0x28c9('0x13'),_0x1d66e5,JSON[_0x28c9('0x14')](_0x21ffdd));})[_0x28c9('0x15')](function(){_0x262c0d[_0x28c9('0x16')]();});}}catch(_0x28acb7){logger[_0x28c9('0x12')]('[%s][CLOSE]\x20%s',_0x1d66e5,JSON[_0x28c9('0x14')](_0x28acb7));_0x262c0d[_0x28c9('0x16')]();}};}; \ No newline at end of file +var _0xfc4c=['[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','error','[%s][CLOSE]\x20%s','stringify','finally','stop','moment','../../../../config/logger','routing','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','info','[%s][CLOSE]\x20reason\x20%s','YYYY-MM-DD\x20HH:mm:ss','system','channel','Interaction','update','interaction','then'];(function(_0x236c96,_0x360519){var _0x41311c=function(_0x343048){while(--_0x343048){_0x236c96['push'](_0x236c96['shift']());}};_0x41311c(++_0x360519);}(_0xfc4c,0x1d2));var _0xcfc4=function(_0x5b90e3,_0x3ad1b0){_0x5b90e3=_0x5b90e3-0x0;var _0x1864ad=_0xfc4c[_0x5b90e3];return _0x1864ad;};'use strict';var moment=require(_0xcfc4('0x0'));var logger=require(_0xcfc4('0x1'))(_0xcfc4('0x2'));var rpc={'chatInteraction':require(_0xcfc4('0x3')),'openchannelInteraction':require(_0xcfc4('0x4')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0xcfc4('0x5')),'faxInteraction':require(_0xcfc4('0x6')),'whatsappInteraction':require(_0xcfc4('0x7'))};exports['consequence']=function(_0xc7f269,_0x51532d,_0x4f9d85,_0x3c0adc){return function(_0x1e3523){try{logger[_0xcfc4('0x8')](_0xcfc4('0x9'),_0xc7f269,_0x51532d[0x0]);var _0x264c8f={'closed':0x1,'closedAt':moment()['format'](_0xcfc4('0xa')),'closeReason':_0xcfc4('0xb'),'disposition':_0x51532d[0x0]};if(rpc[_0x3c0adc[_0xcfc4('0xc')]+_0xcfc4('0xd')]){rpc[_0x3c0adc[_0xcfc4('0xc')]+'Interaction'][_0xcfc4('0xe')](_0x3c0adc[_0xcfc4('0xf')]['id'],_0x264c8f)[_0xcfc4('0x10')](function(_0x39865c){logger[_0xcfc4('0x8')](_0xcfc4('0x11'),_0xc7f269,_0x3c0adc[_0xcfc4('0xf')]['id']);})['catch'](function(_0x3fdeff){logger[_0xcfc4('0x12')](_0xcfc4('0x13'),_0xc7f269,JSON[_0xcfc4('0x14')](_0x3fdeff));})[_0xcfc4('0x15')](function(){_0x1e3523['stop']();});}}catch(_0x2852c3){logger[_0xcfc4('0x12')]('[%s][CLOSE]\x20%s',_0xc7f269,JSON[_0xcfc4('0x14')](_0x2852c3));_0x1e3523[_0xcfc4('0x16')]();}};}; \ 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 d7778fc..a8d1e6b 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 _0x27a8=['chat','ChatWebsiteId','AccountId','account','upperFirst','created','isEmpty','body','getMustacheRender','then','error','stringify','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','message','result','fulfillment','speech','providerName','dialogflow','Message','create','metadata','catch','apiai-promise','md5','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','YYYY-MM-DD\x20HH:mm:ss','out','channel','whatsapp','phone'];(function(_0xc04a7b,_0x21952a){var _0xa0a816=function(_0x498d26){while(--_0x498d26){_0xc04a7b['push'](_0xc04a7b['shift']());}};_0xa0a816(++_0x21952a);}(_0x27a8,0x170));var _0x827a=function(_0x5f4718,_0x58384c){_0x5f4718=_0x5f4718-0x0;var _0xdbb3c4=_0x27a8[_0x5f4718];return _0xdbb3c4;};'use strict';var _=require('lodash');var moment=require('moment');var apiai=require(_0x827a('0x0'));var md5=require(_0x827a('0x1'));var utils=require(_0x827a('0x2'));var logger=require(_0x827a('0x3'))(_0x827a('0x4'));var rpc={'chatMessage':require(_0x827a('0x5')),'openchannelMessage':require(_0x827a('0x6')),'mailMessage':require(_0x827a('0x7')),'smsMessage':require(_0x827a('0x8')),'faxMessage':require(_0x827a('0x9')),'whatsappMessage':require(_0x827a('0xa'))};exports[_0x827a('0xb')]=function(_0xa0df3c,_0x2b9fe3){return function(_0x2e20da){try{if(!_[_0x827a('0xc')](this[_0x827a('0xd')][_0x827a('0xe')])){logger[_0x827a('0xf')](_0x827a('0x10'),_0xa0df3c,_0x827a('0x11'));return _0x2e20da[_0x827a('0x12')]();}var _0x1bc07f={'ContactId':this['contact']['id'],'sentAt':moment()['format'](_0x827a('0x13')),'direction':_0x827a('0x14')};if(this[_0x827a('0x15')]==='sms'||this['channel']===_0x827a('0x16')){_0x1bc07f[_0x827a('0x17')]=this['interaction'][_0x827a('0x17')];}var _0x5c6d03=this[_0x827a('0x15')];if(_0x5c6d03===_0x827a('0x18')){_0x1bc07f[_0x827a('0x19')]=this['account']['id'];}else{_0x1bc07f[_['upperFirst'](_0x5c6d03)+_0x827a('0x1a')]=this[_0x827a('0x1b')]['id'];}_0x1bc07f[_[_0x827a('0x1c')](_0x5c6d03)+'InteractionId']=this[_0x827a('0xd')]['id'];if(this[_0x827a('0xd')][_0x827a('0x1d')]){var _0x47e8fc=_0x2b9fe3[0x2];if(!_[_0x827a('0x1e')](_0x47e8fc)){_0x1bc07f[_0x827a('0x1f')]=utils[_0x827a('0x20')](_0x47e8fc,this);return rpc[_0x5c6d03+'Message']['create'](_0x1bc07f)[_0x827a('0x21')](function(_0x8f07db){logger['info']('[%s][DIALOGFLOW]\x20%s',_0xa0df3c,_0x1bc07f[_0x827a('0x1f')]);})['catch'](function(_0x4f1b6c){logger[_0x827a('0x22')](_0x827a('0x10'),_0xa0df3c,JSON[_0x827a('0x23')](_0x4f1b6c));})['finally'](function(){logger['info'](_0x827a('0x24'),_0xa0df3c);_0x2e20da[_0x827a('0x25')]();});}else{logger['info'](_0x827a('0x26'),_0xa0df3c);_0x2e20da[_0x827a('0x25')]();}}else{var _0x11737e=this;var _0x7ae849=apiai(_0x2b9fe3[0x0],{'language':_0x2b9fe3[0x1]||'en'});return _0x7ae849['textRequest'](this[_0x827a('0x27')]['body'],{'sessionId':md5(this['interaction']['id'])})['then'](function(_0x11670e){_0x11737e[_0x827a('0x1f')]['dialogflow']=_0x11670e;_0x1bc07f[_0x827a('0x1f')]=_0x11670e[_0x827a('0x28')][_0x827a('0x29')][_0x827a('0x2a')];_0x1bc07f[_0x827a('0x2b')]=_0x827a('0x2c');_0x1bc07f['providerResponse']=JSON[_0x827a('0x23')](_0x11670e);return rpc[_0x5c6d03+_0x827a('0x2d')][_0x827a('0x2e')](_0x1bc07f)['then'](function(_0xa86e63){logger[_0x827a('0xf')](_0x827a('0x10'),_0xa0df3c,_0x1bc07f[_0x827a('0x1f')]);if(_0x11670e[_0x827a('0x28')][_0x827a('0x2f')]['endConversation']){_0x2e20da['next']();}else{_0x2e20da[_0x827a('0x25')]();}})[_0x827a('0x30')](function(_0x336891){logger[_0x827a('0x22')](_0x827a('0x10'),_0xa0df3c,JSON[_0x827a('0x23')](_0x336891));_0x2e20da[_0x827a('0x12')]();});})[_0x827a('0x30')](function(_0x554b1e){logger['error'](_0x827a('0x10'),_0xa0df3c,_0x554b1e[_0x827a('0x27')]);_0x2e20da[_0x827a('0x12')]();});}}catch(_0x5bb496){logger[_0x827a('0x22')](_0x827a('0x10'),_0xa0df3c,JSON[_0x827a('0x23')](_0x5bb496));_0x2e20da[_0x827a('0x25')]();}};}; \ No newline at end of file +var _0xe700=['Message','create','then','catch','error','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','textRequest','message','dialogflow','speech','stringify','result','metadata','endConversation','stop','lodash','moment','apiai-promise','md5','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','consequence','isNil','interaction','UserId','info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','channel','sms','phone','chat','ChatWebsiteId','account','InteractionId','created','isEmpty','body','getMustacheRender'];(function(_0x105232,_0x2c88fe){var _0x5e1642=function(_0x4ac0f1){while(--_0x4ac0f1){_0x105232['push'](_0x105232['shift']());}};_0x5e1642(++_0x2c88fe);}(_0xe700,0x75));var _0x0e70=function(_0xc3f7c8,_0x3e0a6a){_0xc3f7c8=_0xc3f7c8-0x0;var _0x290f4d=_0xe700[_0xc3f7c8];return _0x290f4d;};'use strict';var _=require(_0x0e70('0x0'));var moment=require(_0x0e70('0x1'));var apiai=require(_0x0e70('0x2'));var md5=require(_0x0e70('0x3'));var utils=require(_0x0e70('0x4'));var logger=require(_0x0e70('0x5'))(_0x0e70('0x6'));var rpc={'chatMessage':require(_0x0e70('0x7')),'openchannelMessage':require(_0x0e70('0x8')),'mailMessage':require(_0x0e70('0x9')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x0e70('0xa')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x0e70('0xb')]=function(_0x30303a,_0x1ea6ad){return function(_0x28fcf2){try{if(!_[_0x0e70('0xc')](this[_0x0e70('0xd')][_0x0e70('0xe')])){logger[_0x0e70('0xf')](_0x0e70('0x10'),_0x30303a,_0x0e70('0x11'));return _0x28fcf2[_0x0e70('0x12')]();}var _0x32a108={'ContactId':this[_0x0e70('0x13')]['id'],'sentAt':moment()[_0x0e70('0x14')](_0x0e70('0x15')),'direction':'out'};if(this[_0x0e70('0x16')]===_0x0e70('0x17')||this[_0x0e70('0x16')]==='whatsapp'){_0x32a108[_0x0e70('0x18')]=this[_0x0e70('0xd')][_0x0e70('0x18')];}var _0x18ee22=this['channel'];if(_0x18ee22===_0x0e70('0x19')){_0x32a108[_0x0e70('0x1a')]=this[_0x0e70('0x1b')]['id'];}else{_0x32a108[_['upperFirst'](_0x18ee22)+'AccountId']=this[_0x0e70('0x1b')]['id'];}_0x32a108[_['upperFirst'](_0x18ee22)+_0x0e70('0x1c')]=this[_0x0e70('0xd')]['id'];if(this[_0x0e70('0xd')][_0x0e70('0x1d')]){var _0x4bc3a4=_0x1ea6ad[0x2];if(!_[_0x0e70('0x1e')](_0x4bc3a4)){_0x32a108[_0x0e70('0x1f')]=utils[_0x0e70('0x20')](_0x4bc3a4,this);return rpc[_0x18ee22+_0x0e70('0x21')][_0x0e70('0x22')](_0x32a108)[_0x0e70('0x23')](function(_0x5a6206){logger[_0x0e70('0xf')](_0x0e70('0x10'),_0x30303a,_0x32a108['body']);})[_0x0e70('0x24')](function(_0x1131a6){logger[_0x0e70('0x25')](_0x0e70('0x10'),_0x30303a,JSON['stringify'](_0x1131a6));})[_0x0e70('0x26')](function(){logger[_0x0e70('0xf')](_0x0e70('0x27'),_0x30303a);_0x28fcf2['stop']();});}else{logger[_0x0e70('0xf')](_0x0e70('0x28'),_0x30303a);_0x28fcf2['stop']();}}else{var _0x3b2d2a=this;var _0x22ee57=apiai(_0x1ea6ad[0x0],{'language':_0x1ea6ad[0x1]||'en'});return _0x22ee57[_0x0e70('0x29')](this[_0x0e70('0x2a')][_0x0e70('0x1f')],{'sessionId':md5(this[_0x0e70('0xd')]['id'])})[_0x0e70('0x23')](function(_0x350afc){_0x3b2d2a[_0x0e70('0x1f')][_0x0e70('0x2b')]=_0x350afc;_0x32a108[_0x0e70('0x1f')]=_0x350afc['result']['fulfillment'][_0x0e70('0x2c')];_0x32a108['providerName']=_0x0e70('0x2b');_0x32a108['providerResponse']=JSON[_0x0e70('0x2d')](_0x350afc);return rpc[_0x18ee22+_0x0e70('0x21')][_0x0e70('0x22')](_0x32a108)[_0x0e70('0x23')](function(_0x3efbb5){logger[_0x0e70('0xf')](_0x0e70('0x10'),_0x30303a,_0x32a108[_0x0e70('0x1f')]);if(_0x350afc[_0x0e70('0x2e')][_0x0e70('0x2f')][_0x0e70('0x30')]){_0x28fcf2[_0x0e70('0x12')]();}else{_0x28fcf2[_0x0e70('0x31')]();}})[_0x0e70('0x24')](function(_0x5e7409){logger['error'](_0x0e70('0x10'),_0x30303a,JSON[_0x0e70('0x2d')](_0x5e7409));_0x28fcf2['next']();});})['catch'](function(_0x16e6ae){logger[_0x0e70('0x25')](_0x0e70('0x10'),_0x30303a,_0x16e6ae[_0x0e70('0x2a')]);_0x28fcf2[_0x0e70('0x12')]();});}}catch(_0x1498b1){logger[_0x0e70('0x25')](_0x0e70('0x10'),_0x30303a,JSON[_0x0e70('0x2d')](_0x1498b1));_0x28fcf2[_0x0e70('0x31')]();}};}; \ 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 f975c0c..96d65f7 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 _0xfd35=['InteractionId','isEmpty','getMustacheRender','Message','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','stop','replace','SessionsClient','sessionPath','detectIntent','length','dialogflowV2','queryResult','diagnosticInfo','fields','end_conversation','boolValue','DIALOGFLOWV2_ACTION','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','allRequiredParamsPresent','intent','name','DIALOGFLOWV2_INTENTDISPLAYNAME','DIALOGFLOWV2_ISFALLBACKINTENT','isFallback','DIALOGFLOWV2_LANGUAGECODE','languageCode','DIALOGFLOWV2_QUERYTEXT','intentDetectionConfidence','providerResponse','fulfillmentText','message','stack','md5','bluebird','../../../../config/logger','routing','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','clone','body','create','then','info','[%s][DIALOGFLOWV2]\x20%s','catch','error','stringify','consequence','isNil','interaction','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','channel','phone','chat','account','upperFirst','AccountId'];(function(_0x22aa42,_0x4dc4fc){var _0x5ad26b=function(_0x172a78){while(--_0x172a78){_0x22aa42['push'](_0x22aa42['shift']());}};_0x5ad26b(++_0x4dc4fc);}(_0xfd35,0x17c));var _0x5fd3=function(_0x8a0d94,_0x16fcee){_0x8a0d94=_0x8a0d94-0x0;var _0x48f382=_0xfd35[_0x8a0d94];return _0x48f382;};'use strict';var _=require('lodash');var dialogflow=require('dialogflow');var md5=require(_0x5fd3('0x0'));var moment=require('moment');var Promise=require(_0x5fd3('0x1'));var logger=require(_0x5fd3('0x2'))(_0x5fd3('0x3'));var utils=require(_0x5fd3('0x4'));var rpc={'chatMessage':require(_0x5fd3('0x5')),'openchannelMessage':require(_0x5fd3('0x6')),'mailMessage':require(_0x5fd3('0x7')),'smsMessage':require(_0x5fd3('0x8')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x5fd3('0x9'))};function createMessage(_0xc834ea,_0x4c570d,_0x4ee9b7,_0x4ad8e2){return new Promise(function(_0x52ff34,_0x3bc940){var _0x519e8d=_[_0x5fd3('0xa')](_0x4ee9b7);_0x519e8d[_0x5fd3('0xb')]=_0x4ad8e2;return rpc[_0x4c570d+'Message'][_0x5fd3('0xc')](_0x519e8d)[_0x5fd3('0xd')](function(){logger[_0x5fd3('0xe')](_0x5fd3('0xf'),_0xc834ea,_0x519e8d[_0x5fd3('0xb')]);_0x52ff34();})[_0x5fd3('0x10')](function(_0x40ebae){logger[_0x5fd3('0x11')](_0x5fd3('0xf'),_0xc834ea,JSON[_0x5fd3('0x12')](_0x40ebae));_0x3bc940(_0x40ebae);});});}exports[_0x5fd3('0x13')]=function(_0x431fcb,_0x42cd12){return function(_0x5c8f32){try{if(!_[_0x5fd3('0x14')](this[_0x5fd3('0x15')][_0x5fd3('0x16')])){logger[_0x5fd3('0xe')]('[%s][DIALOGFLOWV2]\x20%s',_0x431fcb,_0x5fd3('0x17'));return _0x5c8f32[_0x5fd3('0x18')]();}var _0x3e6e6f={'ContactId':this[_0x5fd3('0x19')]['id'],'sentAt':moment()[_0x5fd3('0x1a')](_0x5fd3('0x1b')),'direction':'out'};if(this[_0x5fd3('0x1c')]==='sms'||this[_0x5fd3('0x1c')]==='whatsapp'){_0x3e6e6f[_0x5fd3('0x1d')]=this[_0x5fd3('0x15')][_0x5fd3('0x1d')];}var _0xbe11db=this[_0x5fd3('0x1c')];if(_0xbe11db===_0x5fd3('0x1e')){_0x3e6e6f['ChatWebsiteId']=this[_0x5fd3('0x1f')]['id'];}else{_0x3e6e6f[_[_0x5fd3('0x20')](_0xbe11db)+_0x5fd3('0x21')]=this[_0x5fd3('0x1f')]['id'];}_0x3e6e6f[_[_0x5fd3('0x20')](_0xbe11db)+_0x5fd3('0x22')]=this[_0x5fd3('0x15')]['id'];if(this[_0x5fd3('0x15')]['created']){var _0x15609a=_0x42cd12[0x4];if(!_[_0x5fd3('0x23')](_0x15609a)){_0x3e6e6f[_0x5fd3('0xb')]=utils[_0x5fd3('0x24')](_0x15609a,this);return rpc[_0xbe11db+_0x5fd3('0x25')][_0x5fd3('0xc')](_0x3e6e6f)['then'](function(_0x1ebaae){logger[_0x5fd3('0xe')](_0x5fd3('0xf'),_0x431fcb,_0x3e6e6f[_0x5fd3('0xb')]);})[_0x5fd3('0x10')](function(_0x30a66a){logger[_0x5fd3('0x11')](_0x5fd3('0xf'),_0x431fcb,JSON['stringify'](_0x30a66a));})[_0x5fd3('0x26')](function(){logger[_0x5fd3('0xe')](_0x5fd3('0x27'),_0x431fcb);_0x5c8f32['stop']();});}else{logger[_0x5fd3('0xe')](_0x5fd3('0x28'),_0x431fcb);_0x5c8f32[_0x5fd3('0x29')]();}}else{var _0x3689bd=this;var _0x22642c=_0x42cd12[0x2][_0x5fd3('0x2a')](/\\n/g,'\x0a');var _0x238c01={'credentials':{'private_key':_0x22642c,'client_email':_0x42cd12[0x1]}};var _0x47141d=new dialogflow[(_0x5fd3('0x2b'))](_0x238c01);var _0x31416c=_0x47141d[_0x5fd3('0x2c')](_0x42cd12[0x0],md5(_0x3689bd[_0x5fd3('0x15')]['id']));var _0x9e437b={'session':_0x31416c,'queryInput':{'text':{'text':_0x3689bd['message']['body'],'languageCode':_0x42cd12[0x3]||'en'}}};return _0x47141d[_0x5fd3('0x2d')](_0x9e437b)[_0x5fd3('0xd')](function(_0x140d23){if(_0x140d23&&_0x140d23[_0x5fd3('0x2e')]){_0x3689bd[_0x5fd3('0xb')][_0x5fd3('0x2f')]=_0x140d23;var _0x2d2ea4=_0x140d23[0x0];var _0x325d8a=_0x2d2ea4[_0x5fd3('0x30')][_0x5fd3('0x31')]&&_0x2d2ea4[_0x5fd3('0x30')][_0x5fd3('0x31')][_0x5fd3('0x32')]?_0x2d2ea4[_0x5fd3('0x30')]['diagnosticInfo'][_0x5fd3('0x32')][_0x5fd3('0x33')][_0x5fd3('0x34')]:![];_0x3689bd[_0x5fd3('0xb')][_0x5fd3('0x35')]=_0x2d2ea4[_0x5fd3('0x30')]['action'];_0x3689bd['body'][_0x5fd3('0x36')]=_0x2d2ea4[_0x5fd3('0x30')][_0x5fd3('0x37')];_0x3689bd[_0x5fd3('0xb')]['DIALOGFLOWV2_ENDCONVERSATION']=_0x2d2ea4[_0x5fd3('0x30')][_0x5fd3('0x31')]&&_0x2d2ea4[_0x5fd3('0x30')][_0x5fd3('0x31')][_0x5fd3('0x32')]?_0x2d2ea4[_0x5fd3('0x30')][_0x5fd3('0x31')][_0x5fd3('0x32')][_0x5fd3('0x33')]['boolValue']:![];_0x3689bd[_0x5fd3('0xb')]['DIALOGFLOWV2_INTENTNAME']=_0x2d2ea4[_0x5fd3('0x30')][_0x5fd3('0x38')][_0x5fd3('0x39')];_0x3689bd[_0x5fd3('0xb')][_0x5fd3('0x3a')]=_0x2d2ea4[_0x5fd3('0x30')]['intent']['displayName'];_0x3689bd[_0x5fd3('0xb')][_0x5fd3('0x3b')]=_0x2d2ea4[_0x5fd3('0x30')]['intent'][_0x5fd3('0x3c')];_0x3689bd[_0x5fd3('0xb')][_0x5fd3('0x3d')]=_0x2d2ea4[_0x5fd3('0x30')][_0x5fd3('0x3e')];_0x3689bd[_0x5fd3('0xb')][_0x5fd3('0x3f')]=_0x2d2ea4[_0x5fd3('0x30')]['queryText'];_0x3689bd[_0x5fd3('0xb')]['DIALOGFLOWV2_SCORE']=_0x2d2ea4[_0x5fd3('0x30')][_0x5fd3('0x40')];_0x3e6e6f['providerName']='dialogflowV2';_0x3e6e6f[_0x5fd3('0x41')]=JSON[_0x5fd3('0x12')](_0x140d23);var _0x3035ad=[];for(var _0x3aa41f=0x0;_0x3aa41f<_0x140d23[_0x5fd3('0x2e')];_0x3aa41f++){var _0x4d9a96=_0x140d23[_0x3aa41f];if(_0x4d9a96&&_0x4d9a96[_0x5fd3('0x30')]&&_0x4d9a96['queryResult'][_0x5fd3('0x42')]){_0x3035ad['push'](createMessage(_0x431fcb,_0xbe11db,_0x3e6e6f,_0x4d9a96[_0x5fd3('0x30')][_0x5fd3('0x42')]));}}return Promise['all'](_0x3035ad)[_0x5fd3('0xd')](function(){if(_0x325d8a){_0x5c8f32[_0x5fd3('0x18')]();}else{_0x5c8f32[_0x5fd3('0x29')]();}})[_0x5fd3('0x10')](function(_0xadb345){logger[_0x5fd3('0x11')](_0x5fd3('0xf'),_0x431fcb,JSON['stringify'](_0xadb345));_0x5c8f32[_0x5fd3('0x18')]();});}})[_0x5fd3('0x10')](function(_0x272c6c){logger[_0x5fd3('0x11')](_0x5fd3('0xf'),_0x431fcb,_0x272c6c[_0x5fd3('0x43')],_0x272c6c[_0x5fd3('0x44')]);_0x5c8f32[_0x5fd3('0x18')]();});}}catch(_0x3e5b65){logger['error'](_0x5fd3('0xf'),_0x431fcb,JSON[_0x5fd3('0x12')](_0x3e5b65));_0x5c8f32[_0x5fd3('0x29')]();}};}; \ No newline at end of file +var _0x2b74=['displayName','DIALOGFLOWV2_ISFALLBACKINTENT','queryText','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerResponse','fulfillmentText','push','all','next','stack','lodash','dialogflow','moment','bluebird','./utils','../../rpc/mailMessage','../../rpc/smsMessage','clone','Message','create','body','catch','error','[%s][DIALOGFLOWV2]\x20%s','stringify','consequence','isNil','interaction','UserId','info','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','phone','chat','ChatWebsiteId','upperFirst','AccountId','InteractionId','getMustacheRender','then','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','replace','sessionPath','message','detectIntent','length','dialogflowV2','queryResult','diagnosticInfo','fields','end_conversation','boolValue','DIALOGFLOWV2_ACTION','action','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','allRequiredParamsPresent','DIALOGFLOWV2_ENDCONVERSATION','DIALOGFLOWV2_INTENTNAME','intent','name','DIALOGFLOWV2_INTENTDISPLAYNAME'];(function(_0x3036b6,_0x27294c){var _0x34c081=function(_0x574df2){while(--_0x574df2){_0x3036b6['push'](_0x3036b6['shift']());}};_0x34c081(++_0x27294c);}(_0x2b74,0x164));var _0x42b7=function(_0x23e81d,_0x1e6cf0){_0x23e81d=_0x23e81d-0x0;var _0x2d255d=_0x2b74[_0x23e81d];return _0x2d255d;};'use strict';var _=require(_0x42b7('0x0'));var dialogflow=require(_0x42b7('0x1'));var md5=require('md5');var moment=require(_0x42b7('0x2'));var Promise=require(_0x42b7('0x3'));var logger=require('../../../../config/logger')('routing');var utils=require(_0x42b7('0x4'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x42b7('0x5')),'smsMessage':require(_0x42b7('0x6')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require('../../rpc/whatsappMessage')};function createMessage(_0x1ee119,_0x42afba,_0x318017,_0x224955){return new Promise(function(_0x3bfbdf,_0x24041d){var _0x2cbf4d=_[_0x42b7('0x7')](_0x318017);_0x2cbf4d['body']=_0x224955;return rpc[_0x42afba+_0x42b7('0x8')][_0x42b7('0x9')](_0x2cbf4d)['then'](function(){logger['info']('[%s][DIALOGFLOWV2]\x20%s',_0x1ee119,_0x2cbf4d[_0x42b7('0xa')]);_0x3bfbdf();})[_0x42b7('0xb')](function(_0x3e66c7){logger[_0x42b7('0xc')](_0x42b7('0xd'),_0x1ee119,JSON[_0x42b7('0xe')](_0x3e66c7));_0x24041d(_0x3e66c7);});});}exports[_0x42b7('0xf')]=function(_0x5c280f,_0x2439fd){return function(_0x1f07ca){try{if(!_[_0x42b7('0x10')](this[_0x42b7('0x11')][_0x42b7('0x12')])){logger[_0x42b7('0x13')]('[%s][DIALOGFLOWV2]\x20%s',_0x5c280f,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x1f07ca['next']();}var _0x586ce0={'ContactId':this[_0x42b7('0x14')]['id'],'sentAt':moment()[_0x42b7('0x15')](_0x42b7('0x16')),'direction':_0x42b7('0x17')};if(this[_0x42b7('0x18')]===_0x42b7('0x19')||this[_0x42b7('0x18')]==='whatsapp'){_0x586ce0[_0x42b7('0x1a')]=this[_0x42b7('0x11')][_0x42b7('0x1a')];}var _0x51070d=this[_0x42b7('0x18')];if(_0x51070d===_0x42b7('0x1b')){_0x586ce0[_0x42b7('0x1c')]=this['account']['id'];}else{_0x586ce0[_[_0x42b7('0x1d')](_0x51070d)+_0x42b7('0x1e')]=this['account']['id'];}_0x586ce0[_['upperFirst'](_0x51070d)+_0x42b7('0x1f')]=this['interaction']['id'];if(this['interaction']['created']){var _0x48218c=_0x2439fd[0x4];if(!_['isEmpty'](_0x48218c)){_0x586ce0[_0x42b7('0xa')]=utils[_0x42b7('0x20')](_0x48218c,this);return rpc[_0x51070d+_0x42b7('0x8')][_0x42b7('0x9')](_0x586ce0)[_0x42b7('0x21')](function(_0x19c205){logger['info']('[%s][DIALOGFLOWV2]\x20%s',_0x5c280f,_0x586ce0[_0x42b7('0xa')]);})['catch'](function(_0x1a3a2a){logger[_0x42b7('0xc')](_0x42b7('0xd'),_0x5c280f,JSON['stringify'](_0x1a3a2a));})[_0x42b7('0x22')](function(){logger[_0x42b7('0x13')](_0x42b7('0x23'),_0x5c280f);_0x1f07ca[_0x42b7('0x24')]();});}else{logger['info'](_0x42b7('0x25'),_0x5c280f);_0x1f07ca[_0x42b7('0x24')]();}}else{var _0xf7f1fa=this;var _0x2fae83=_0x2439fd[0x2][_0x42b7('0x26')](/\\n/g,'\x0a');var _0x2d9e50={'credentials':{'private_key':_0x2fae83,'client_email':_0x2439fd[0x1]}};var _0x30cf58=new dialogflow['SessionsClient'](_0x2d9e50);var _0x102ce9=_0x30cf58[_0x42b7('0x27')](_0x2439fd[0x0],md5(_0xf7f1fa[_0x42b7('0x11')]['id']));var _0x3c5487={'session':_0x102ce9,'queryInput':{'text':{'text':_0xf7f1fa[_0x42b7('0x28')][_0x42b7('0xa')],'languageCode':_0x2439fd[0x3]||'en'}}};return _0x30cf58[_0x42b7('0x29')](_0x3c5487)[_0x42b7('0x21')](function(_0xdf4312){if(_0xdf4312&&_0xdf4312[_0x42b7('0x2a')]){_0xf7f1fa[_0x42b7('0xa')][_0x42b7('0x2b')]=_0xdf4312;var _0x24f707=_0xdf4312[0x0];var _0x2de761=_0x24f707['queryResult']['diagnosticInfo']&&_0x24f707[_0x42b7('0x2c')][_0x42b7('0x2d')][_0x42b7('0x2e')]?_0x24f707[_0x42b7('0x2c')][_0x42b7('0x2d')][_0x42b7('0x2e')][_0x42b7('0x2f')][_0x42b7('0x30')]:![];_0xf7f1fa[_0x42b7('0xa')][_0x42b7('0x31')]=_0x24f707[_0x42b7('0x2c')][_0x42b7('0x32')];_0xf7f1fa[_0x42b7('0xa')][_0x42b7('0x33')]=_0x24f707['queryResult'][_0x42b7('0x34')];_0xf7f1fa[_0x42b7('0xa')][_0x42b7('0x35')]=_0x24f707[_0x42b7('0x2c')][_0x42b7('0x2d')]&&_0x24f707['queryResult'][_0x42b7('0x2d')][_0x42b7('0x2e')]?_0x24f707[_0x42b7('0x2c')][_0x42b7('0x2d')][_0x42b7('0x2e')][_0x42b7('0x2f')][_0x42b7('0x30')]:![];_0xf7f1fa[_0x42b7('0xa')][_0x42b7('0x36')]=_0x24f707[_0x42b7('0x2c')][_0x42b7('0x37')][_0x42b7('0x38')];_0xf7f1fa[_0x42b7('0xa')][_0x42b7('0x39')]=_0x24f707[_0x42b7('0x2c')][_0x42b7('0x37')][_0x42b7('0x3a')];_0xf7f1fa[_0x42b7('0xa')][_0x42b7('0x3b')]=_0x24f707['queryResult'][_0x42b7('0x37')]['isFallback'];_0xf7f1fa[_0x42b7('0xa')]['DIALOGFLOWV2_LANGUAGECODE']=_0x24f707[_0x42b7('0x2c')]['languageCode'];_0xf7f1fa['body']['DIALOGFLOWV2_QUERYTEXT']=_0x24f707[_0x42b7('0x2c')][_0x42b7('0x3c')];_0xf7f1fa[_0x42b7('0xa')][_0x42b7('0x3d')]=_0x24f707[_0x42b7('0x2c')][_0x42b7('0x3e')];_0x586ce0['providerName']=_0x42b7('0x2b');_0x586ce0[_0x42b7('0x3f')]=JSON[_0x42b7('0xe')](_0xdf4312);var _0x2b6866=[];for(var _0x539082=0x0;_0x539082<_0xdf4312[_0x42b7('0x2a')];_0x539082++){var _0x30c1c9=_0xdf4312[_0x539082];if(_0x30c1c9&&_0x30c1c9[_0x42b7('0x2c')]&&_0x30c1c9[_0x42b7('0x2c')][_0x42b7('0x40')]){_0x2b6866[_0x42b7('0x41')](createMessage(_0x5c280f,_0x51070d,_0x586ce0,_0x30c1c9[_0x42b7('0x2c')][_0x42b7('0x40')]));}}return Promise[_0x42b7('0x42')](_0x2b6866)[_0x42b7('0x21')](function(){if(_0x2de761){_0x1f07ca['next']();}else{_0x1f07ca[_0x42b7('0x24')]();}})[_0x42b7('0xb')](function(_0x40e8cb){logger[_0x42b7('0xc')](_0x42b7('0xd'),_0x5c280f,JSON[_0x42b7('0xe')](_0x40e8cb));_0x1f07ca[_0x42b7('0x43')]();});}})['catch'](function(_0x2fa618){logger[_0x42b7('0xc')](_0x42b7('0xd'),_0x5c280f,_0x2fa618['message'],_0x2fa618[_0x42b7('0x44')]);_0x1f07ca[_0x42b7('0x43')]();});}}catch(_0x205d2f){logger[_0x42b7('0xc')](_0x42b7('0xd'),_0x5c280f,JSON[_0x42b7('0xe')](_0x205d2f));_0x1f07ca['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 ae96798..b60cdb5 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 _0xd4a6=['getMustacheRender','replace','validate','length','[%s][GOTOIF]\x20%s','map','message','join','condition','priorityFalse','info','next','findIndex','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','[%s][GOTOIF]\x20eval\x20error:\x20%s','stop','error','stringify','html-to-text','./utils','../../../../config/logger','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20false\x20is\x20a\x20number','consequence'];(function(_0x406eab,_0x510331){var _0x49574c=function(_0x4d8e40){while(--_0x4d8e40){_0x406eab['push'](_0x406eab['shift']());}};_0x49574c(++_0x510331);}(_0xd4a6,0x164));var _0x6d4a=function(_0x97a39d,_0x4fd37c){_0x97a39d=_0x97a39d-0x0;var _0x4736c2=_0xd4a6[_0x97a39d];return _0x4736c2;};'use strict';var schema=require('validate');var _=require('lodash');var htmlToText=require(_0x6d4a('0x0'));var utils=require(_0x6d4a('0x1'));var logger=require(_0x6d4a('0x2'))('routing');var gotoif=schema({'condition':{'type':_0x6d4a('0x3'),'required':!![],'message':_0x6d4a('0x4')},'priorityTrue':{'type':_0x6d4a('0x5'),'message':'priority\x20true\x20is\x20a\x20number'},'priorityFalse':{'type':_0x6d4a('0x5'),'message':_0x6d4a('0x6')}});exports[_0x6d4a('0x7')]=function(_0x591ecd,_0x5d413d){return function(_0x24bebf){try{var _0x452cd5={'condition':htmlToText['fromString'](utils[_0x6d4a('0x8')](_0x5d413d[0x0],this),{'wordwrap':![]})[_0x6d4a('0x9')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x5d413d[0x1],'priorityFalse':_0x5d413d[0x2]};var _0x27bef6=gotoif[_0x6d4a('0xa')](_0x452cd5,{'typecast':!![]});if(_0x27bef6[_0x6d4a('0xb')]){logger['error'](_0x6d4a('0xc'),_0x591ecd,_[_0x6d4a('0xd')](_0x27bef6,_0x6d4a('0xe'))[_0x6d4a('0xf')](',\x20'));_0x24bebf['stop']();}else{try{var _0x2eeef1=eval('('+_0x452cd5[_0x6d4a('0x10')]+')');var _0x2d66fd=_0x2eeef1?_0x452cd5['priorityTrue']:_0x452cd5[_0x6d4a('0x11')];logger[_0x6d4a('0x12')]('[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s',_0x591ecd,_0x452cd5[_0x6d4a('0x10')],_0x2eeef1,_0x2d66fd||_0x6d4a('0x13'));if(_0x2d66fd){var _0x45d829=_[_0x6d4a('0x14')](_0x24bebf[_0x6d4a('0x15')](),{'p':_0x2d66fd});if(_0x45d829>=0x0){logger[_0x6d4a('0x12')](_0x6d4a('0x16'),_0x591ecd,_0x2d66fd||_0x6d4a('0x13'),_0x45d829);_0x24bebf[_0x6d4a('0x13')](_0x45d829);}else{logger[_0x6d4a('0x12')](_0x6d4a('0x17'),_0x591ecd,_0x2d66fd||_0x6d4a('0x13'));_0x24bebf['stop']();}}else{_0x24bebf['next']();}}catch(_0x244be0){logger['error'](_0x6d4a('0x18'),_0x591ecd,_0x244be0['message']);_0x24bebf[_0x6d4a('0x19')]();}}}catch(_0x357e06){logger[_0x6d4a('0x1a')](_0x6d4a('0xc'),_0x591ecd,JSON[_0x6d4a('0x1b')](_0x357e06));_0x24bebf[_0x6d4a('0x19')]();}};}; \ No newline at end of file +var _0x42c3=['number','priority\x20false\x20is\x20a\x20number','consequence','getMustacheRender','length','error','join','stop','condition','priorityTrue','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','findIndex','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','[%s][GOTOIF]\x20eval\x20error:\x20%s','message','[%s][GOTOIF]\x20%s','stringify','validate','lodash','./utils','../../../../config/logger','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required'];(function(_0xf9862f,_0x34bf2b){var _0x4b6cb6=function(_0x4aa79f){while(--_0x4aa79f){_0xf9862f['push'](_0xf9862f['shift']());}};_0x4b6cb6(++_0x34bf2b);}(_0x42c3,0x1ac));var _0x342c=function(_0x1791af,_0x511825){_0x1791af=_0x1791af-0x0;var _0x4db407=_0x42c3[_0x1791af];return _0x4db407;};'use strict';var schema=require(_0x342c('0x0'));var _=require(_0x342c('0x1'));var htmlToText=require('html-to-text');var utils=require(_0x342c('0x2'));var logger=require(_0x342c('0x3'))(_0x342c('0x4'));var gotoif=schema({'condition':{'type':_0x342c('0x5'),'required':!![],'message':_0x342c('0x6')},'priorityTrue':{'type':_0x342c('0x7'),'message':'priority\x20true\x20is\x20a\x20number'},'priorityFalse':{'type':_0x342c('0x7'),'message':_0x342c('0x8')}});exports[_0x342c('0x9')]=function(_0x35316a,_0xef6ca7){return function(_0x28e33f){try{var _0x2e8a64={'condition':htmlToText['fromString'](utils[_0x342c('0xa')](_0xef6ca7[0x0],this),{'wordwrap':![]})['replace'](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0xef6ca7[0x1],'priorityFalse':_0xef6ca7[0x2]};var _0xce4643=gotoif[_0x342c('0x0')](_0x2e8a64,{'typecast':!![]});if(_0xce4643[_0x342c('0xb')]){logger[_0x342c('0xc')]('[%s][GOTOIF]\x20%s',_0x35316a,_['map'](_0xce4643,'message')[_0x342c('0xd')](',\x20'));_0x28e33f[_0x342c('0xe')]();}else{try{var _0x3b378b=eval('('+_0x2e8a64[_0x342c('0xf')]+')');var _0x30e82d=_0x3b378b?_0x2e8a64[_0x342c('0x10')]:_0x2e8a64[_0x342c('0x11')];logger[_0x342c('0x12')](_0x342c('0x13'),_0x35316a,_0x2e8a64[_0x342c('0xf')],_0x3b378b,_0x30e82d||_0x342c('0x14'));if(_0x30e82d){var _0x396756=_[_0x342c('0x15')](_0x28e33f[_0x342c('0x16')](),{'p':_0x30e82d});if(_0x396756>=0x0){logger[_0x342c('0x12')](_0x342c('0x17'),_0x35316a,_0x30e82d||_0x342c('0x14'),_0x396756);_0x28e33f[_0x342c('0x14')](_0x396756);}else{logger[_0x342c('0x12')](_0x342c('0x18'),_0x35316a,_0x30e82d||_0x342c('0x14'));_0x28e33f['stop']();}}else{_0x28e33f[_0x342c('0x14')]();}}catch(_0x3f755a){logger[_0x342c('0xc')](_0x342c('0x19'),_0x35316a,_0x3f755a[_0x342c('0x1a')]);_0x28e33f[_0x342c('0xe')]();}}}catch(_0x257399){logger[_0x342c('0xc')](_0x342c('0x1b'),_0x35316a,JSON[_0x342c('0x1c')](_0x257399));_0x28e33f['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/gotop.js b/server/services/routing/server/applications/gotop.js index 00f046f..413e70d 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 _0x46ff=['length','error','[%s][GOTOP]\x20%s','message','stop','info','priority','findIndex','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stringify','lodash','../../../../config/logger','routing','number'];(function(_0x52e24b,_0x5bbcd5){var _0x3fd7f7=function(_0x3a6b9b){while(--_0x3a6b9b){_0x52e24b['push'](_0x52e24b['shift']());}};_0x3fd7f7(++_0x5bbcd5);}(_0x46ff,0x1d8));var _0xf46f=function(_0x28d46f,_0xc22e7d){_0x28d46f=_0x28d46f-0x0;var _0x313a7c=_0x46ff[_0x28d46f];return _0x313a7c;};'use strict';var schema=require('validate');var _=require(_0xf46f('0x0'));var logger=require(_0xf46f('0x1'))(_0xf46f('0x2'));var gotop=schema({'priority':{'type':_0xf46f('0x3'),'required':!![],'message':'priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required'}});exports['consequence']=function(_0x1e65bc,_0x39c4c5){return function(_0x38f153){try{var _0x723a88={'priority':_0x39c4c5[0x0]};var _0x4b8c0c=gotop['validate'](_0x723a88,{'typecast':!![]});if(_0x4b8c0c[_0xf46f('0x4')]){logger[_0xf46f('0x5')](_0xf46f('0x6'),_0x1e65bc,_['map'](_0x4b8c0c,_0xf46f('0x7'))['join'](',\x20'));_0x38f153[_0xf46f('0x8')]();}else{logger[_0xf46f('0x9')]('[%s][GOTOP]\x20priority\x20%s',_0x1e65bc,_0x723a88['priority']);if(_0x723a88[_0xf46f('0xa')]){var _0x575005=_[_0xf46f('0xb')](_0x38f153[_0xf46f('0xc')](),{'p':_0x723a88['priority']});if(_0x575005>=0x0){logger[_0xf46f('0x9')](_0xf46f('0xd'),_0x1e65bc,_0x723a88['priority']||_0xf46f('0xe'),_0x575005);_0x38f153[_0xf46f('0xe')](_0x575005);}else{logger[_0xf46f('0x9')](_0xf46f('0xf'),_0x1e65bc,_0x723a88['priority']||_0xf46f('0xe'));_0x38f153[_0xf46f('0x8')]();}}else{_0x38f153['next']();}}}catch(_0x20e969){logger[_0xf46f('0x5')](_0xf46f('0x6'),_0x1e65bc,JSON[_0xf46f('0x10')](_0x20e969));_0x38f153[_0xf46f('0x8')]();}};}; \ No newline at end of file +var _0x3967=['number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','error','[%s][GOTOP]\x20%s','map','join','stop','info','[%s][GOTOP]\x20priority\x20%s','priority','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','validate','routing'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x3967,0x1c9));var _0x7396=function(_0x36d703,_0x55b354){_0x36d703=_0x36d703-0x0;var _0x12c909=_0x3967[_0x36d703];return _0x12c909;};'use strict';var schema=require(_0x7396('0x0'));var _=require('lodash');var logger=require('../../../../config/logger')(_0x7396('0x1'));var gotop=schema({'priority':{'type':_0x7396('0x2'),'required':!![],'message':_0x7396('0x3')}});exports[_0x7396('0x4')]=function(_0x49126f,_0x1ee58a){return function(_0x23c8a2){try{var _0x5de2e7={'priority':_0x1ee58a[0x0]};var _0x147678=gotop[_0x7396('0x0')](_0x5de2e7,{'typecast':!![]});if(_0x147678[_0x7396('0x5')]){logger[_0x7396('0x6')](_0x7396('0x7'),_0x49126f,_[_0x7396('0x8')](_0x147678,'message')[_0x7396('0x9')](',\x20'));_0x23c8a2[_0x7396('0xa')]();}else{logger[_0x7396('0xb')](_0x7396('0xc'),_0x49126f,_0x5de2e7['priority']);if(_0x5de2e7[_0x7396('0xd')]){var _0x3faf61=_['findIndex'](_0x23c8a2['rules'](),{'p':_0x5de2e7[_0x7396('0xd')]});if(_0x3faf61>=0x0){logger[_0x7396('0xb')](_0x7396('0xe'),_0x49126f,_0x5de2e7[_0x7396('0xd')]||'next',_0x3faf61);_0x23c8a2[_0x7396('0xf')](_0x3faf61);}else{logger['info'](_0x7396('0x10'),_0x49126f,_0x5de2e7[_0x7396('0xd')]||_0x7396('0xf'));_0x23c8a2[_0x7396('0xa')]();}}else{_0x23c8a2['next']();}}}catch(_0x3dcd29){logger['error']('[%s][GOTOP]\x20%s',_0x49126f,JSON['stringify'](_0x3dcd29));_0x23c8a2['stop']();}};}; \ 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 64e77d7..b3d7d5a 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 _0xfdb8=['stop','stringify','lodash','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','getMustacheRender','contact','channel','chat','upperFirst','AccountId','account','InteractionId','interaction','Message','create','then','[%s][MESSAGE]\x20%s','body','next','catch'];(function(_0x1ed272,_0x44921a){var _0x547251=function(_0x5dcf35){while(--_0x5dcf35){_0x1ed272['push'](_0x1ed272['shift']());}};_0x547251(++_0x44921a);}(_0xfdb8,0x120));var _0x8fdb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfdb8[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x8fdb('0x0'));var utils=require(_0x8fdb('0x1'));var logger=require(_0x8fdb('0x2'))(_0x8fdb('0x3'));var rpc={'chatMessage':require(_0x8fdb('0x4')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x8fdb('0x5')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x8fdb('0x6')),'whatsappMessage':require(_0x8fdb('0x7'))};exports['consequence']=function(_0x4c14d2,_0x7a9123){return function(_0x60813c){try{var _0x2b7eab={'body':utils[_0x8fdb('0x8')](_0x7a9123[0x0],this),'ContactId':this[_0x8fdb('0x9')]['id']};if(this[_0x8fdb('0xa')]===_0x8fdb('0xb')){_0x2b7eab['ChatWebsiteId']=this['account']['id'];}else{_0x2b7eab[_[_0x8fdb('0xc')](this[_0x8fdb('0xa')])+_0x8fdb('0xd')]=this[_0x8fdb('0xe')]['id'];}_0x2b7eab[_[_0x8fdb('0xc')](this[_0x8fdb('0xa')])+_0x8fdb('0xf')]=this[_0x8fdb('0x10')]['id'];if(rpc[this[_0x8fdb('0xa')]+_0x8fdb('0x11')]){return rpc[this[_0x8fdb('0xa')]+_0x8fdb('0x11')][_0x8fdb('0x12')](_0x2b7eab)[_0x8fdb('0x13')](function(_0x38c820){logger['info'](_0x8fdb('0x14'),_0x4c14d2,_0x2b7eab[_0x8fdb('0x15')]);_0x60813c[_0x8fdb('0x16')]();})[_0x8fdb('0x17')](function(_0x56c95f){logger['error'](_0x8fdb('0x14'),_0x4c14d2,JSON['stringify'](_0x56c95f));_0x60813c[_0x8fdb('0x18')]();});}}catch(_0x1699f2){logger['error'](_0x8fdb('0x14'),_0x4c14d2,JSON[_0x8fdb('0x19')](_0x1699f2));_0x60813c[_0x8fdb('0x18')]();}};}; \ No newline at end of file +var _0x082e=['body','next','catch','error','[%s][MESSAGE]\x20%s','stringify','stop','lodash','./utils','../../../../config/logger','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','consequence','contact','channel','account','upperFirst','AccountId','interaction','Message','then'];(function(_0x587338,_0x20a60e){var _0x3cc80b=function(_0x35aa04){while(--_0x35aa04){_0x587338['push'](_0x587338['shift']());}};_0x3cc80b(++_0x20a60e);}(_0x082e,0x17d));var _0xe082=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x082e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xe082('0x0'));var utils=require(_0xe082('0x1'));var logger=require(_0xe082('0x2'))('routing');var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0xe082('0x3')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0xe082('0x4')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0xe082('0x5'))};exports[_0xe082('0x6')]=function(_0x5ca6cf,_0x4afd1c){return function(_0x34f95f){try{var _0x44f13a={'body':utils['getMustacheRender'](_0x4afd1c[0x0],this),'ContactId':this[_0xe082('0x7')]['id']};if(this[_0xe082('0x8')]==='chat'){_0x44f13a['ChatWebsiteId']=this[_0xe082('0x9')]['id'];}else{_0x44f13a[_[_0xe082('0xa')](this['channel'])+_0xe082('0xb')]=this['account']['id'];}_0x44f13a[_[_0xe082('0xa')](this[_0xe082('0x8')])+'InteractionId']=this[_0xe082('0xc')]['id'];if(rpc[this[_0xe082('0x8')]+_0xe082('0xd')]){return rpc[this[_0xe082('0x8')]+_0xe082('0xd')]['create'](_0x44f13a)[_0xe082('0xe')](function(_0x1127d1){logger['info']('[%s][MESSAGE]\x20%s',_0x5ca6cf,_0x44f13a[_0xe082('0xf')]);_0x34f95f[_0xe082('0x10')]();})[_0xe082('0x11')](function(_0x3b93cd){logger[_0xe082('0x12')](_0xe082('0x13'),_0x5ca6cf,JSON[_0xe082('0x14')](_0x3b93cd));_0x34f95f[_0xe082('0x15')]();});}}catch(_0x5b21b9){logger[_0xe082('0x12')](_0xe082('0x13'),_0x5ca6cf,JSON[_0xe082('0x14')](_0x5b21b9));_0x34f95f[_0xe082('0x15')]();}};}; \ 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 6201d39..b1f8363 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 _0xb22f=['error','[%s][NOOP]\x20%s','stringify','stop','./utils','routing','consequence','info','next'];(function(_0x3e35e9,_0x343705){var _0x5a9829=function(_0x590aa6){while(--_0x590aa6){_0x3e35e9['push'](_0x3e35e9['shift']());}};_0x5a9829(++_0x343705);}(_0xb22f,0x175));var _0xfb22=function(_0x576202,_0x27da95){_0x576202=_0x576202-0x0;var _0x5a1606=_0xb22f[_0x576202];return _0x5a1606;};'use strict';var utils=require(_0xfb22('0x0'));var logger=require('../../../../config/logger')(_0xfb22('0x1'));exports[_0xfb22('0x2')]=function(_0x3095e8,_0x321f87){return function(_0x262592){try{logger[_0xfb22('0x3')]('[%s][NOOP]\x20%s',_0x3095e8,utils['getMustacheRender'](_0x321f87[0x0],this));_0x262592[_0xfb22('0x4')]();}catch(_0x3de8b5){logger[_0xfb22('0x5')](_0xfb22('0x6'),_0x3095e8,JSON[_0xfb22('0x7')](_0x3de8b5));_0x262592[_0xfb22('0x8')]();}};}; \ No newline at end of file +var _0x6b30=['info','[%s][NOOP]\x20%s','getMustacheRender','next','error','../../../../config/logger','routing','consequence'];(function(_0x1347f8,_0x233feb){var _0x218368=function(_0x3f4ca3){while(--_0x3f4ca3){_0x1347f8['push'](_0x1347f8['shift']());}};_0x218368(++_0x233feb);}(_0x6b30,0x185));var _0x06b3=function(_0x1c0e1a,_0x361353){_0x1c0e1a=_0x1c0e1a-0x0;var _0x46840d=_0x6b30[_0x1c0e1a];return _0x46840d;};'use strict';var utils=require('./utils');var logger=require(_0x06b3('0x0'))(_0x06b3('0x1'));exports[_0x06b3('0x2')]=function(_0x32f36f,_0xd2abfd){return function(_0x2bf08d){try{logger[_0x06b3('0x3')](_0x06b3('0x4'),_0x32f36f,utils[_0x06b3('0x5')](_0xd2abfd[0x0],this));_0x2bf08d[_0x06b3('0x6')]();}catch(_0x2708de){logger[_0x06b3('0x7')](_0x06b3('0x4'),_0x32f36f,JSON['stringify'](_0x2708de));_0x2bf08d['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/queue.js b/server/services/routing/server/applications/queue.js index 7d630ed..39a5a06 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 _0xb5e1=['routing','./strategy','redis','socket.io-emitter','queue_id','account','queue','from','joinAt','emit','clone','push','capitalize','InteractionId','pick','format','%sQueuesWaitingInteractions','%s_queue_waiting_interaction:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','../../rpc/mailInteraction','../../rpc/openchannelInteraction','../../rpc/whatsappInteraction','number','timeout\x20is\x20a\x20number','waiting','body','contact','list','upperFirst','channel','QueueId','interaction','message','chat','WebsiteId','info','name','QueueReport','catch','error','YYYY-MM-DD\x20HH:mm:ss','accepted','Interaction','update','then','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','map','join','stop','Queues','createQueue','atimeout','qtimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','[%s][QUEUE]\x20APPLICATION\x20END','next','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','stack','validate','lodash','util','seq-queue','../../../../config/environment','../../../../config/logger'];(function(_0x30e3d6,_0x2bf00f){var _0xe35a6f=function(_0x503cc4){while(--_0x503cc4){_0x30e3d6['push'](_0x30e3d6['shift']());}};_0xe35a6f(++_0x2bf00f);}(_0xb5e1,0x18f));var _0x1b5e=function(_0x1e62b8,_0x5eed4c){_0x1e62b8=_0x1e62b8-0x0;var _0x2ab271=_0xb5e1[_0x1e62b8];return _0x2ab271;};'use strict';var schema=require(_0x1b5e('0x0'));var _=require(_0x1b5e('0x1'));var util=require(_0x1b5e('0x2'));var seqqueue=require(_0x1b5e('0x3'));var moment=require('moment');var Redis=require('ioredis');var config=require(_0x1b5e('0x4'));var logger=require(_0x1b5e('0x5'))(_0x1b5e('0x6'));var strategy=require(_0x1b5e('0x7'));config[_0x1b5e('0x8')]=_['defaults'](config[_0x1b5e('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0x1b5e('0x9'))(new Redis(config[_0x1b5e('0x8')]));var attributes=['id',_0x1b5e('0xa'),_0x1b5e('0xb'),_0x1b5e('0xc'),_0x1b5e('0xd'),_0x1b5e('0xe')];function emit(_0x194074,_0x5d4ea5,_0x4b9b53){io['to'](_0x194074)[_0x1b5e('0xf')](_0x5d4ea5,_0x4b9b53);}function emitChannelQueueInteraction(_0x34c103,_0x5bc6c4,_0x592ae4,_0x180171,_0x59bb47,_0xd069d5,_0x1d88b5,_0x80979b){var _0x4b4eb3=_[_0x1b5e('0x10')](_0x592ae4);_0x4b4eb3[_0x1b5e('0xa')]=_0x80979b;_0x4b4eb3['queue']=_0x5bc6c4;_0x4b4eb3['account']=_0x180171;_0x4b4eb3['id']=_0x59bb47;if(_0xd069d5){attributes[_0x1b5e('0x11')](_[_0x1b5e('0x12')](_0x34c103)+_0x1b5e('0x13'));_0x1d88b5[util['format']('%sQueuesWaitingInteractions',_0x34c103)][_0x59bb47]=_[_0x1b5e('0x14')](_0x4b4eb3,attributes);}else{delete _0x1d88b5[util[_0x1b5e('0x15')](_0x1b5e('0x16'),_0x34c103)][_0x59bb47];}emit(util[_0x1b5e('0x15')]('%s:queue:%s',_0x34c103,_0x5bc6c4),util['format'](_0x1b5e('0x17'),_0x34c103,_0xd069d5?_0x1b5e('0x18'):_0x1b5e('0x19')),_[_0x1b5e('0x14')](_0x4b4eb3,attributes));}var rpc={'openchannelQueueReport':require(_0x1b5e('0x1a')),'mailQueueReport':require('../../rpc/mailQueueReport'),'chatQueueReport':require(_0x1b5e('0x1b')),'smsQueueReport':require(_0x1b5e('0x1c')),'faxQueueReport':require(_0x1b5e('0x1d')),'whatsappQueueReport':require(_0x1b5e('0x1e')),'chatInteraction':require('../../rpc/chatInteraction'),'faxInteraction':require('../../rpc/faxInteraction'),'mailInteraction':require(_0x1b5e('0x1f')),'openchannelInteraction':require(_0x1b5e('0x20')),'smsInteraction':require('../../rpc/smsInteraction'),'whatsappInteraction':require(_0x1b5e('0x21'))};var queue=schema({'name':{'type':'string','required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0x1b5e('0x22'),'message':_0x1b5e('0x23')}});function startRouting(_0x53bdd0,_0x476196,_0x4cf30c,_0x32c03d){if(_0x53bdd0&&_0x476196&&_0x4cf30c){_0x476196[_0x1b5e('0x24')]+=0x1;var _0x1321e9={'uniqueid':_0x53bdd0,'from':_0x4cf30c[_0x1b5e('0x25')]?_0x4cf30c[_0x1b5e('0x25')]['from']:'','joinAt':moment()[_0x1b5e('0x15')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x4cf30c[_0x1b5e('0x26')]?_0x4cf30c[_0x1b5e('0x26')]['id']:null,'ListId':_0x4cf30c[_0x1b5e('0x27')]?_0x4cf30c[_0x1b5e('0x27')]['id']:null};_0x1321e9[_[_0x1b5e('0x28')](_0x4cf30c[_0x1b5e('0x29')])+_0x1b5e('0x2a')]=_0x476196['id']||null;_0x1321e9[_[_0x1b5e('0x28')](_0x4cf30c[_0x1b5e('0x29')])+_0x1b5e('0x13')]=_0x4cf30c[_0x1b5e('0x2b')]?_0x4cf30c[_0x1b5e('0x2b')]['id']:null;_0x1321e9[_[_0x1b5e('0x28')](_0x4cf30c['channel'])+'MessageId']=_0x4cf30c[_0x1b5e('0x2c')]?_0x4cf30c[_0x1b5e('0x2c')]['id']:null;_0x1321e9[_[_0x1b5e('0x28')](_0x4cf30c['channel'])+(_0x4cf30c[_0x1b5e('0x29')]!==_0x1b5e('0x2d')?'AccountId':_0x1b5e('0x2e'))]=_0x4cf30c[_0x1b5e('0xb')]?_0x4cf30c[_0x1b5e('0xb')]['id']:null;logger[_0x1b5e('0x2f')](util['format']('[%s][START:QUEUE][NAME:%s]',_0x53bdd0,_0x476196['name']));emitChannelQueueInteraction(_0x4cf30c[_0x1b5e('0x29')],_0x476196['name'],_0x1321e9,_0x4cf30c[_0x1b5e('0xb')][_0x1b5e('0x30')],_0x4cf30c[_0x1b5e('0x2c')]['id'],!![],_0x32c03d,_0x476196['id']);if(rpc[_0x4cf30c['channel']+_0x1b5e('0x31')]){return rpc[_0x4cf30c[_0x1b5e('0x29')]+_0x1b5e('0x31')]['create'](_0x1321e9)[_0x1b5e('0x32')](function(_0x4bc1ee){logger[_0x1b5e('0x33')]('create\x20queue\x20report',_0x4bc1ee);});}}}function stopRouting(_0x16aea3,_0x482b19,_0xd66376,_0x450798){if(_0x16aea3&&_0x482b19){_0x482b19[_0x1b5e('0x24')]-=0x1;var _0x5ec50d={'leaveAt':moment()[_0x1b5e('0x15')](_0x1b5e('0x34')),'acceptAt':moment()['format'](_0x1b5e('0x34')),'reason':_0x1b5e('0x35')};logger[_0x1b5e('0x2f')](util[_0x1b5e('0x15')]('[%s][STOP:QUEUE][NAME:%s]',_0x16aea3,_0x482b19['name']));emitChannelQueueInteraction(_0xd66376['channel'],_0x482b19[_0x1b5e('0x30')],_0xd66376[_0x1b5e('0x25')],_0xd66376[_0x1b5e('0xb')]['name'],_0xd66376[_0x1b5e('0x2c')]['id'],![],_0x450798,_0x482b19['id']);return rpc[_0xd66376[_0x1b5e('0x29')]+_0x1b5e('0x36')][_0x1b5e('0x37')](_0xd66376[_0x1b5e('0x2b')]['id'],{'queueId':_0x482b19['id']})[_0x1b5e('0x38')](function(){if(rpc[_0xd66376['channel']+_0x1b5e('0x31')]){return rpc[_0xd66376[_0x1b5e('0x29')]+_0x1b5e('0x31')]['update'](_0x16aea3,_0x5ec50d)[_0x1b5e('0x32')](function(_0x3da6e0){logger['error'](_0x1b5e('0x39'),_0x3da6e0);});}});}}function endRouting(_0x47bbcf,_0xab588f,_0x47cecf,_0x315e22){if(_0x47bbcf&&_0xab588f){_0xab588f[_0x1b5e('0x24')]-=0x1;var _0x293172={'leaveAt':moment()[_0x1b5e('0x15')](_0x1b5e('0x34')),'exitAt':moment()[_0x1b5e('0x15')](_0x1b5e('0x34')),'reason':_0x1b5e('0x3a')};logger['info'](util['format'](_0x1b5e('0x3b'),_0x47bbcf,_0xab588f[_0x1b5e('0x30')]));emitChannelQueueInteraction(_0x47cecf['channel'],_0xab588f[_0x1b5e('0x30')],_0x47cecf[_0x1b5e('0x25')],_0x47cecf['account']['name'],_0x47cecf[_0x1b5e('0x2c')]['id'],![],_0x315e22);if(rpc[_0x47cecf[_0x1b5e('0x29')]+_0x1b5e('0x31')]){return rpc[_0x47cecf['channel']+_0x1b5e('0x31')][_0x1b5e('0x37')](_0x47bbcf,_0x293172)[_0x1b5e('0x32')](function(_0x15b594){logger[_0x1b5e('0x33')]('update\x20queue\x20report',_0x15b594);});}}}function handleFindQueue(_0x40678f){return function(_0x145d1b){return _0x145d1b['name'][_0x1b5e('0x3c')]()===_0x40678f['toLowerCase']();};}exports[_0x1b5e('0x3d')]=function(_0x3312ca,_0xf3f6d4,_0x5174f8,_0x31fc1f){return function(_0x18e807){try{var _0x313e52={'name':_0xf3f6d4[0x0],'timeout':_0xf3f6d4[0x1]};var _0x2f01b9=queue[_0x1b5e('0x0')](_0x313e52,{'typecast':!![]});if(_0x2f01b9[_0x1b5e('0x3e')]){logger[_0x1b5e('0x33')](_0x1b5e('0x3f'),_0x3312ca,_[_0x1b5e('0x40')](_0x2f01b9,_0x1b5e('0x2c'))[_0x1b5e('0x41')](',\x20'));_0x18e807[_0x1b5e('0x42')]();}else{var _0x2781ce=_['find'](_0x5174f8[_0x31fc1f[_0x1b5e('0x29')]+_0x1b5e('0x43')],handleFindQueue(_0x313e52['name']));if(_0x2781ce){startRouting(_0x3312ca,_0x2781ce,_0x31fc1f,_0x5174f8);var _0x2500f7=(_0x2781ce[_0x1b5e('0x3a')]||0xa)*0x3e8;var _0x37c812=(_0x313e52['timeout']||0x14)*0x3e8;var _0x181b45;if(_0x2500f7>_0x37c812){_0x37c812=_0x2500f7;}var _0x3325f2=seqqueue[_0x1b5e('0x44')](_0x2500f7);_0x3325f2['id']=_0x3312ca;_0x3325f2[_0x1b5e('0x45')]=_0x2500f7;_0x3325f2[_0x1b5e('0x46')]=_0x37c812;_0x3325f2[_0x1b5e('0x29')]=_0x31fc1f[_0x1b5e('0x29')];_0x5174f8[_0x1b5e('0x47')][_0x3312ca]['on'](_0x1b5e('0x48'),function(){logger['info'](_0x1b5e('0x49'),_0x3312ca);stopRouting(_0x3312ca,_0x2781ce,_0x31fc1f,_0x5174f8);clearTimeout(_0x181b45);_0x181b45=undefined;_0x3325f2[_0x1b5e('0x4a')](!![]);if(_0x5174f8[_0x1b5e('0x47')][_0x3312ca]){delete _0x5174f8[_0x1b5e('0x47')][_0x3312ca];}_0x18e807[_0x1b5e('0x42')]();});_0x5174f8['rules'][_0x3312ca]['on']('complete',function(){if(_0x5174f8[_0x1b5e('0x47')][_0x3312ca]){delete _0x5174f8[_0x1b5e('0x47')][_0x3312ca];}});_0x181b45=setTimeout(function(){logger[_0x1b5e('0x2f')](_0x1b5e('0x4b'),_0x3312ca);endRouting(_0x3312ca,_0x2781ce,_0x31fc1f,_0x5174f8);clearTimeout(_0x181b45);_0x3325f2[_0x1b5e('0x4a')](!![]);_0x18e807[_0x1b5e('0x4c')]();},_0x37c812);switch(_0x2781ce['strategy']){case'rrmemory':strategy[_0x1b5e('0x4d')](_0x3325f2,_0x2781ce,_0x5174f8,_0x31fc1f);break;default:strategy[_0x1b5e('0x4e')](_0x3325f2,_0x2781ce,_0x5174f8,_0x31fc1f);}}else{logger[_0x1b5e('0x33')](_0x1b5e('0x4f'),_0x3312ca,_0x313e52[_0x1b5e('0x30')]);_0x18e807[_0x1b5e('0x42')]();}}}catch(_0x505cf2){logger[_0x1b5e('0x33')](_0x1b5e('0x3f'),_0x3312ca,_0x505cf2[_0x1b5e('0x50')]);_0x18e807[_0x1b5e('0x42')]();}};}; \ No newline at end of file +var _0xd138=['number','timeout\x20is\x20a\x20number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','channel','QueueId','upperFirst','interaction','MessageId','message','AccountId','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','error','create\x20queue\x20report','accepted','[%s][STOP:QUEUE][NAME:%s]','Interaction','update','update\x20queue\x20report','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','length','map','join','find','Queues','timeout','createQueue','atimeout','qtimeout','rules','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','stop','complete','[%s][QUEUE]\x20APPLICATION\x20END','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','stack','validate','lodash','util','../../../../config/environment','./strategy','redis','queue_id','account','from','clone','queue','push','capitalize','InteractionId','format','pick','%sQueuesWaitingInteractions','%s_queue_waiting_interaction:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','../../rpc/chatInteraction','../../rpc/faxInteraction','../../rpc/mailInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/whatsappInteraction','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'];(function(_0x167d9d,_0x19fb16){var _0x95a2bc=function(_0x49e91a){while(--_0x49e91a){_0x167d9d['push'](_0x167d9d['shift']());}};_0x95a2bc(++_0x19fb16);}(_0xd138,0x1dc));var _0x8d13=function(_0x213f49,_0x7eacb7){_0x213f49=_0x213f49-0x0;var _0x124559=_0xd138[_0x213f49];return _0x124559;};'use strict';var schema=require(_0x8d13('0x0'));var _=require(_0x8d13('0x1'));var util=require(_0x8d13('0x2'));var seqqueue=require('seq-queue');var moment=require('moment');var Redis=require('ioredis');var config=require(_0x8d13('0x3'));var logger=require('../../../../config/logger')('routing');var strategy=require(_0x8d13('0x4'));config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x8d13('0x5')]));var attributes=['id',_0x8d13('0x6'),_0x8d13('0x7'),'queue',_0x8d13('0x8'),'joinAt'];function emit(_0x29a579,_0x98805f,_0x56150b){io['to'](_0x29a579)['emit'](_0x98805f,_0x56150b);}function emitChannelQueueInteraction(_0x14e1ce,_0x3b0009,_0x30045b,_0x4ed9ba,_0x39408c,_0x2f769b,_0x21bf55,_0x5aa05e){var _0x418b69=_[_0x8d13('0x9')](_0x30045b);_0x418b69[_0x8d13('0x6')]=_0x5aa05e;_0x418b69[_0x8d13('0xa')]=_0x3b0009;_0x418b69[_0x8d13('0x7')]=_0x4ed9ba;_0x418b69['id']=_0x39408c;if(_0x2f769b){attributes[_0x8d13('0xb')](_[_0x8d13('0xc')](_0x14e1ce)+_0x8d13('0xd'));_0x21bf55[util[_0x8d13('0xe')]('%sQueuesWaitingInteractions',_0x14e1ce)][_0x39408c]=_[_0x8d13('0xf')](_0x418b69,attributes);}else{delete _0x21bf55[util['format'](_0x8d13('0x10'),_0x14e1ce)][_0x39408c];}emit(util[_0x8d13('0xe')]('%s:queue:%s',_0x14e1ce,_0x3b0009),util[_0x8d13('0xe')](_0x8d13('0x11'),_0x14e1ce,_0x2f769b?_0x8d13('0x12'):_0x8d13('0x13')),_[_0x8d13('0xf')](_0x418b69,attributes));}var rpc={'openchannelQueueReport':require(_0x8d13('0x14')),'mailQueueReport':require(_0x8d13('0x15')),'chatQueueReport':require(_0x8d13('0x16')),'smsQueueReport':require(_0x8d13('0x17')),'faxQueueReport':require(_0x8d13('0x18')),'whatsappQueueReport':require(_0x8d13('0x19')),'chatInteraction':require(_0x8d13('0x1a')),'faxInteraction':require(_0x8d13('0x1b')),'mailInteraction':require(_0x8d13('0x1c')),'openchannelInteraction':require(_0x8d13('0x1d')),'smsInteraction':require(_0x8d13('0x1e')),'whatsappInteraction':require(_0x8d13('0x1f'))};var queue=schema({'name':{'type':_0x8d13('0x20'),'required':!![],'message':_0x8d13('0x21')},'timeout':{'type':_0x8d13('0x22'),'message':_0x8d13('0x23')}});function startRouting(_0x346c60,_0x2b6e28,_0x535283,_0x33ce65){if(_0x346c60&&_0x2b6e28&&_0x535283){_0x2b6e28[_0x8d13('0x24')]+=0x1;var _0x3c7524={'uniqueid':_0x346c60,'from':_0x535283['body']?_0x535283[_0x8d13('0x25')][_0x8d13('0x8')]:'','joinAt':moment()[_0x8d13('0xe')](_0x8d13('0x26')),'ContactId':_0x535283[_0x8d13('0x27')]?_0x535283[_0x8d13('0x27')]['id']:null,'ListId':_0x535283[_0x8d13('0x28')]?_0x535283[_0x8d13('0x28')]['id']:null};_0x3c7524[_['upperFirst'](_0x535283[_0x8d13('0x29')])+_0x8d13('0x2a')]=_0x2b6e28['id']||null;_0x3c7524[_[_0x8d13('0x2b')](_0x535283[_0x8d13('0x29')])+_0x8d13('0xd')]=_0x535283[_0x8d13('0x2c')]?_0x535283[_0x8d13('0x2c')]['id']:null;_0x3c7524[_[_0x8d13('0x2b')](_0x535283[_0x8d13('0x29')])+_0x8d13('0x2d')]=_0x535283[_0x8d13('0x2e')]?_0x535283[_0x8d13('0x2e')]['id']:null;_0x3c7524[_['upperFirst'](_0x535283['channel'])+(_0x535283['channel']!=='chat'?_0x8d13('0x2f'):_0x8d13('0x30'))]=_0x535283[_0x8d13('0x7')]?_0x535283['account']['id']:null;logger[_0x8d13('0x31')](util[_0x8d13('0xe')](_0x8d13('0x32'),_0x346c60,_0x2b6e28[_0x8d13('0x33')]));emitChannelQueueInteraction(_0x535283[_0x8d13('0x29')],_0x2b6e28[_0x8d13('0x33')],_0x3c7524,_0x535283[_0x8d13('0x7')][_0x8d13('0x33')],_0x535283[_0x8d13('0x2e')]['id'],!![],_0x33ce65,_0x2b6e28['id']);if(rpc[_0x535283['channel']+_0x8d13('0x34')]){return rpc[_0x535283[_0x8d13('0x29')]+_0x8d13('0x34')][_0x8d13('0x35')](_0x3c7524)[_0x8d13('0x36')](function(_0x550ad0){logger[_0x8d13('0x37')](_0x8d13('0x38'),_0x550ad0);});}}}function stopRouting(_0x1cd10c,_0x3268ee,_0xfc9374,_0x43b7c8){if(_0x1cd10c&&_0x3268ee){_0x3268ee[_0x8d13('0x24')]-=0x1;var _0x42538b={'leaveAt':moment()['format'](_0x8d13('0x26')),'acceptAt':moment()[_0x8d13('0xe')](_0x8d13('0x26')),'reason':_0x8d13('0x39')};logger[_0x8d13('0x31')](util[_0x8d13('0xe')](_0x8d13('0x3a'),_0x1cd10c,_0x3268ee['name']));emitChannelQueueInteraction(_0xfc9374['channel'],_0x3268ee['name'],_0xfc9374[_0x8d13('0x25')],_0xfc9374[_0x8d13('0x7')][_0x8d13('0x33')],_0xfc9374[_0x8d13('0x2e')]['id'],![],_0x43b7c8,_0x3268ee['id']);return rpc[_0xfc9374[_0x8d13('0x29')]+_0x8d13('0x3b')][_0x8d13('0x3c')](_0xfc9374[_0x8d13('0x2c')]['id'],{'queueId':_0x3268ee['id']})['then'](function(){if(rpc[_0xfc9374['channel']+_0x8d13('0x34')]){return rpc[_0xfc9374[_0x8d13('0x29')]+'QueueReport']['update'](_0x1cd10c,_0x42538b)[_0x8d13('0x36')](function(_0x11b56c){logger[_0x8d13('0x37')](_0x8d13('0x3d'),_0x11b56c);});}});}}function endRouting(_0x14a1de,_0x2c3bf9,_0x3b3f0d,_0x57d0ed){if(_0x14a1de&&_0x2c3bf9){_0x2c3bf9[_0x8d13('0x24')]-=0x1;var _0x40f9e8={'leaveAt':moment()[_0x8d13('0xe')](_0x8d13('0x26')),'exitAt':moment()[_0x8d13('0xe')](_0x8d13('0x26')),'reason':'timeout'};logger[_0x8d13('0x31')](util['format'](_0x8d13('0x3e'),_0x14a1de,_0x2c3bf9[_0x8d13('0x33')]));emitChannelQueueInteraction(_0x3b3f0d[_0x8d13('0x29')],_0x2c3bf9[_0x8d13('0x33')],_0x3b3f0d[_0x8d13('0x25')],_0x3b3f0d['account']['name'],_0x3b3f0d[_0x8d13('0x2e')]['id'],![],_0x57d0ed);if(rpc[_0x3b3f0d[_0x8d13('0x29')]+'QueueReport']){return rpc[_0x3b3f0d[_0x8d13('0x29')]+_0x8d13('0x34')][_0x8d13('0x3c')](_0x14a1de,_0x40f9e8)[_0x8d13('0x36')](function(_0x5b3f7a){logger[_0x8d13('0x37')](_0x8d13('0x3d'),_0x5b3f7a);});}}}function handleFindQueue(_0x216af6){return function(_0x4ea28e){return _0x4ea28e['name'][_0x8d13('0x3f')]()===_0x216af6['toLowerCase']();};}exports[_0x8d13('0x40')]=function(_0x32fdb3,_0x350217,_0xd2ad2d,_0x4b375d){return function(_0x25ecf8){try{var _0x4f3937={'name':_0x350217[0x0],'timeout':_0x350217[0x1]};var _0x428a91=queue[_0x8d13('0x0')](_0x4f3937,{'typecast':!![]});if(_0x428a91[_0x8d13('0x41')]){logger[_0x8d13('0x37')]('[%s][QUEUE]\x20%s',_0x32fdb3,_[_0x8d13('0x42')](_0x428a91,_0x8d13('0x2e'))[_0x8d13('0x43')](',\x20'));_0x25ecf8['stop']();}else{var _0x3ef12c=_[_0x8d13('0x44')](_0xd2ad2d[_0x4b375d['channel']+_0x8d13('0x45')],handleFindQueue(_0x4f3937['name']));if(_0x3ef12c){startRouting(_0x32fdb3,_0x3ef12c,_0x4b375d,_0xd2ad2d);var _0x5bcada=(_0x3ef12c[_0x8d13('0x46')]||0xa)*0x3e8;var _0x1f9422=(_0x4f3937[_0x8d13('0x46')]||0x14)*0x3e8;var _0x2cd91b;if(_0x5bcada>_0x1f9422){_0x1f9422=_0x5bcada;}var _0x277cf7=seqqueue[_0x8d13('0x47')](_0x5bcada);_0x277cf7['id']=_0x32fdb3;_0x277cf7[_0x8d13('0x48')]=_0x5bcada;_0x277cf7[_0x8d13('0x49')]=_0x1f9422;_0x277cf7['channel']=_0x4b375d['channel'];_0xd2ad2d[_0x8d13('0x4a')][_0x32fdb3]['on']('end',function(){logger[_0x8d13('0x31')](_0x8d13('0x4b'),_0x32fdb3);stopRouting(_0x32fdb3,_0x3ef12c,_0x4b375d,_0xd2ad2d);clearTimeout(_0x2cd91b);_0x2cd91b=undefined;_0x277cf7[_0x8d13('0x4c')](!![]);if(_0xd2ad2d[_0x8d13('0x4a')][_0x32fdb3]){delete _0xd2ad2d[_0x8d13('0x4a')][_0x32fdb3];}_0x25ecf8[_0x8d13('0x4d')]();});_0xd2ad2d[_0x8d13('0x4a')][_0x32fdb3]['on'](_0x8d13('0x4e'),function(){if(_0xd2ad2d['rules'][_0x32fdb3]){delete _0xd2ad2d[_0x8d13('0x4a')][_0x32fdb3];}});_0x2cd91b=setTimeout(function(){logger[_0x8d13('0x31')](_0x8d13('0x4f'),_0x32fdb3);endRouting(_0x32fdb3,_0x3ef12c,_0x4b375d,_0xd2ad2d);clearTimeout(_0x2cd91b);_0x277cf7[_0x8d13('0x4c')](!![]);_0x25ecf8['next']();},_0x1f9422);switch(_0x3ef12c[_0x8d13('0x50')]){case _0x8d13('0x51'):strategy['rrmemory'](_0x277cf7,_0x3ef12c,_0xd2ad2d,_0x4b375d);break;default:strategy[_0x8d13('0x52')](_0x277cf7,_0x3ef12c,_0xd2ad2d,_0x4b375d);}}else{logger['error'](_0x8d13('0x53'),_0x32fdb3,_0x4f3937[_0x8d13('0x33')]);_0x25ecf8[_0x8d13('0x4d')]();}}}catch(_0x1e8d85){logger[_0x8d13('0x37')]('[%s][QUEUE]\x20%s',_0x32fdb3,_0x1e8d85[_0x8d13('0x54')]);_0x25ecf8[_0x8d13('0x4d')]();}};}; \ 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 f6df595..91fb99c 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 _0xf006=['realtime','handleRun','bind','handleTimeout','timeout','drained','handleDrained','prototype','push','debug','[%s][AGENT]\x20try\x20with\x20%s','isNil','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','routing','forcedOwnership','isAgentAvailable','channel','saveWaitingNotification','showNotification','notificationId','writeLog','RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','hideNotification','busy','STOP','TIMEOUT','./util','../../../../../config/logger','squeue','agent'];(function(_0x4c4be2,_0x11027c){var _0x5eea8d=function(_0x5ec046){while(--_0x5ec046){_0x4c4be2['push'](_0x4c4be2['shift']());}};_0x5eea8d(++_0x11027c);}(_0xf006,0x146));var _0x6f00=function(_0x55e9bf,_0x4456cc){_0x55e9bf=_0x55e9bf-0x0;var _0x576914=_0xf006[_0x55e9bf];return _0x576914;};'use strict';var _=require('lodash');var uuid=require('uuid');var util=require(_0x6f00('0x0'));var logger=require(_0x6f00('0x1'))('routing');var Agent=function(_0xbab575,_0x4e9dbc,_0x1c7a9e,_0x4f4466){this['notificationId']=uuid['v4']();this[_0x6f00('0x2')]=_0xbab575;this[_0x6f00('0x3')]=_0x4e9dbc;this[_0x6f00('0x4')]=_0x1c7a9e;this['routing']=_0x4f4466;this[_0x6f00('0x2')]['push'](this[_0x6f00('0x5')][_0x6f00('0x6')](this),this[_0x6f00('0x7')][_0x6f00('0x6')](this));this[_0x6f00('0x2')]['on'](_0x6f00('0x8'),this[_0x6f00('0x7')][_0x6f00('0x6')](this));this[_0x6f00('0x2')]['on'](_0x6f00('0x9'),this[_0x6f00('0xa')][_0x6f00('0x6')](this));};Agent[_0x6f00('0xb')]['push']=function(){this[_0x6f00('0x2')][_0x6f00('0xc')](this[_0x6f00('0x5')][_0x6f00('0x6')](this),this[_0x6f00('0x7')]['bind'](this));};Agent[_0x6f00('0xb')]['handleDrained']=function(){this[_0x6f00('0x7')](!![]);};Agent['prototype'][_0x6f00('0x5')]=function(){logger[_0x6f00('0xd')](_0x6f00('0xe'),this[_0x6f00('0x2')]['id'],this[_0x6f00('0x3')]['id']);if(_[_0x6f00('0xf')](this[_0x6f00('0x4')][_0x6f00('0x10')][this[_0x6f00('0x3')]['id']])){logger['debug'](_0x6f00('0x11'),this['squeue']['id'],this['agent']['id']);setTimeout(this[_0x6f00('0xc')][_0x6f00('0x6')](this),0x3e8);}else{if(this[_0x6f00('0x12')][_0x6f00('0x13')]||util[_0x6f00('0x14')](this[_0x6f00('0x2')]['id'],this[_0x6f00('0x4')][_0x6f00('0x10')][this[_0x6f00('0x3')]['id']],this[_0x6f00('0x2')][_0x6f00('0x15')],![])){this[_0x6f00('0x4')]['agents'][this['agent']['id']]['busy']=!![];this[_0x6f00('0x4')][_0x6f00('0x10')][this[_0x6f00('0x3')]['id']]['busyQueue']=undefined;util[_0x6f00('0x16')](this[_0x6f00('0x4')],this[_0x6f00('0x12')],this[_0x6f00('0x3')],this[_0x6f00('0x2')][_0x6f00('0x15')]);util[_0x6f00('0x17')](this[_0x6f00('0x18')],this['squeue']['id'],this[_0x6f00('0x4')][_0x6f00('0x10')][this[_0x6f00('0x3')]['id']],null,this['routing']);util[_0x6f00('0x19')](this['squeue']['id'],this[_0x6f00('0x4')]['agents'][this[_0x6f00('0x3')]['id']],_0x6f00('0x1a')+(this[_0x6f00('0x12')][_0x6f00('0x13')]?_0x6f00('0x1b'):''));}else{logger['debug'](_0x6f00('0x1c'),this[_0x6f00('0x2')]['id'],this[_0x6f00('0x3')]['id']);setTimeout(this[_0x6f00('0xc')][_0x6f00('0x6')](this),0x3e8);}}};Agent[_0x6f00('0xb')][_0x6f00('0x7')]=function(_0x451849){if(_[_0x6f00('0xf')](this[_0x6f00('0x4')][_0x6f00('0x10')][this[_0x6f00('0x3')]['id']])){return logger[_0x6f00('0xd')](_0x6f00('0x11'),this['squeue']['id'],this['agent']['id']);}else{logger['debug']('[%s][AGENT]\x20timeout\x20with\x20%s',this['squeue']['id'],this['agent']['id']);util[_0x6f00('0x1d')](this['notificationId'],this[_0x6f00('0x2')]['id'],this[_0x6f00('0x4')][_0x6f00('0x10')][this[_0x6f00('0x3')]['id']],null,this[_0x6f00('0x12')]);this[_0x6f00('0x4')]['agents'][this[_0x6f00('0x3')]['id']][_0x6f00('0x1e')]=![];this[_0x6f00('0x4')][_0x6f00('0x10')][this[_0x6f00('0x3')]['id']]['busyQueue']=undefined;util['removeWaitingNotification'](this['realtime'],this[_0x6f00('0x12')],this[_0x6f00('0x3')],this[_0x6f00('0x2')][_0x6f00('0x15')]);util[_0x6f00('0x19')](this['squeue']['id'],this[_0x6f00('0x4')][_0x6f00('0x10')][this[_0x6f00('0x3')]['id']],_0x451849?_0x6f00('0x1f'):_0x6f00('0x20'));}if(!_0x451849){setTimeout(this[_0x6f00('0xc')][_0x6f00('0x6')](this),0x3e8);}};function agent(_0x52936d,_0x28e436,_0x1dee52,_0x4ba56d){return new Agent(_0x52936d,_0x28e436,_0x1dee52,_0x4ba56d);}module['exports']=agent; \ No newline at end of file +var _0x9f62=['../../../../../config/logger','routing','notificationId','squeue','agent','push','handleRun','bind','handleTimeout','handleDrained','prototype','debug','[%s][AGENT]\x20try\x20with\x20%s','isNil','realtime','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','channel','busyQueue','saveWaitingNotification','showNotification','RINGING','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','hideNotification','busy','removeWaitingNotification','STOP','TIMEOUT','exports','uuid'];(function(_0xfbbc1e,_0x438a4){var _0x2f30f0=function(_0x4b3607){while(--_0x4b3607){_0xfbbc1e['push'](_0xfbbc1e['shift']());}};_0x2f30f0(++_0x438a4);}(_0x9f62,0x154));var _0x29f6=function(_0x1190c0,_0x3df173){_0x1190c0=_0x1190c0-0x0;var _0x2946d9=_0x9f62[_0x1190c0];return _0x2946d9;};'use strict';var _=require('lodash');var uuid=require(_0x29f6('0x0'));var util=require('./util');var logger=require(_0x29f6('0x1'))(_0x29f6('0x2'));var Agent=function(_0x548050,_0x5618b7,_0x54d164,_0x258ddd){this[_0x29f6('0x3')]=uuid['v4']();this[_0x29f6('0x4')]=_0x548050;this[_0x29f6('0x5')]=_0x5618b7;this['realtime']=_0x54d164;this[_0x29f6('0x2')]=_0x258ddd;this[_0x29f6('0x4')][_0x29f6('0x6')](this[_0x29f6('0x7')][_0x29f6('0x8')](this),this['handleTimeout']['bind'](this));this['squeue']['on']('timeout',this[_0x29f6('0x9')][_0x29f6('0x8')](this));this['squeue']['on']('drained',this[_0x29f6('0xa')][_0x29f6('0x8')](this));};Agent['prototype'][_0x29f6('0x6')]=function(){this[_0x29f6('0x4')]['push'](this['handleRun']['bind'](this),this['handleTimeout'][_0x29f6('0x8')](this));};Agent[_0x29f6('0xb')][_0x29f6('0xa')]=function(){this[_0x29f6('0x9')](!![]);};Agent[_0x29f6('0xb')][_0x29f6('0x7')]=function(){logger[_0x29f6('0xc')](_0x29f6('0xd'),this[_0x29f6('0x4')]['id'],this[_0x29f6('0x5')]['id']);if(_[_0x29f6('0xe')](this[_0x29f6('0xf')][_0x29f6('0x10')][this[_0x29f6('0x5')]['id']])){logger[_0x29f6('0xc')](_0x29f6('0x11'),this[_0x29f6('0x4')]['id'],this['agent']['id']);setTimeout(this['push'][_0x29f6('0x8')](this),0x3e8);}else{if(this[_0x29f6('0x2')][_0x29f6('0x12')]||util['isAgentAvailable'](this[_0x29f6('0x4')]['id'],this[_0x29f6('0xf')]['agents'][this[_0x29f6('0x5')]['id']],this[_0x29f6('0x4')][_0x29f6('0x13')],![])){this[_0x29f6('0xf')][_0x29f6('0x10')][this[_0x29f6('0x5')]['id']]['busy']=!![];this[_0x29f6('0xf')]['agents'][this['agent']['id']][_0x29f6('0x14')]=undefined;util[_0x29f6('0x15')](this[_0x29f6('0xf')],this[_0x29f6('0x2')],this['agent'],this[_0x29f6('0x4')]['channel']);util[_0x29f6('0x16')](this[_0x29f6('0x3')],this[_0x29f6('0x4')]['id'],this[_0x29f6('0xf')]['agents'][this[_0x29f6('0x5')]['id']],null,this[_0x29f6('0x2')]);util['writeLog'](this[_0x29f6('0x4')]['id'],this[_0x29f6('0xf')][_0x29f6('0x10')][this[_0x29f6('0x5')]['id']],_0x29f6('0x17')+(this[_0x29f6('0x2')][_0x29f6('0x12')]?':FORCED':''));}else{logger[_0x29f6('0xc')](_0x29f6('0x18'),this[_0x29f6('0x4')]['id'],this[_0x29f6('0x5')]['id']);setTimeout(this[_0x29f6('0x6')][_0x29f6('0x8')](this),0x3e8);}}};Agent[_0x29f6('0xb')][_0x29f6('0x9')]=function(_0x3d88db){if(_[_0x29f6('0xe')](this[_0x29f6('0xf')][_0x29f6('0x10')][this[_0x29f6('0x5')]['id']])){return logger[_0x29f6('0xc')](_0x29f6('0x11'),this[_0x29f6('0x4')]['id'],this[_0x29f6('0x5')]['id']);}else{logger['debug']('[%s][AGENT]\x20timeout\x20with\x20%s',this[_0x29f6('0x4')]['id'],this['agent']['id']);util[_0x29f6('0x19')](this[_0x29f6('0x3')],this[_0x29f6('0x4')]['id'],this[_0x29f6('0xf')]['agents'][this['agent']['id']],null,this[_0x29f6('0x2')]);this[_0x29f6('0xf')][_0x29f6('0x10')][this[_0x29f6('0x5')]['id']][_0x29f6('0x1a')]=![];this[_0x29f6('0xf')][_0x29f6('0x10')][this[_0x29f6('0x5')]['id']][_0x29f6('0x14')]=undefined;util[_0x29f6('0x1b')](this[_0x29f6('0xf')],this[_0x29f6('0x2')],this[_0x29f6('0x5')],this[_0x29f6('0x4')]['channel']);util['writeLog'](this[_0x29f6('0x4')]['id'],this[_0x29f6('0xf')][_0x29f6('0x10')][this['agent']['id']],_0x3d88db?_0x29f6('0x1c'):_0x29f6('0x1d'));}if(!_0x3d88db){setTimeout(this[_0x29f6('0x6')][_0x29f6('0x8')](this),0x3e8);}};function agent(_0x1d2b3c,_0x48fbd1,_0x7695ee,_0x2ad06f){return new Agent(_0x1d2b3c,_0x48fbd1,_0x7695ee,_0x2ad06f);}module[_0x29f6('0x1e')]=agent; \ No newline at end of file diff --git a/server/services/routing/server/applications/strategy/beepall.js b/server/services/routing/server/applications/strategy/beepall.js index afb548a..335e273 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 _0xae1d=['bind','handleTimeout','drained','prototype','handleDrained','isNil','Agents','length','agents','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','channel','writeLog','RINGING','busy','busyQueue','name','saveWaitingNotification','debug','[%s][QUEUE]\x20EMPTY','hideNotification','STOP','removeWaitingNotification','exports','uuid','../../../../../config/logger','routing','notificationId','squeue','queue','realtime','push','handleRun'];(function(_0x356763,_0x594dca){var _0x11e6b3=function(_0x9a01f2){while(--_0x9a01f2){_0x356763['push'](_0x356763['shift']());}};_0x11e6b3(++_0x594dca);}(_0xae1d,0x7b));var _0xdae1=function(_0x695b76,_0x551526){_0x695b76=_0x695b76-0x0;var _0x1dc21f=_0xae1d[_0x695b76];return _0x1dc21f;};'use strict';var _=require('lodash');var uuid=require(_0xdae1('0x0'));var util=require('./util');var logger=require(_0xdae1('0x1'))(_0xdae1('0x2'));var Beepall=function(_0x5c24d1,_0x2f80a1,_0x34bcb2,_0x2592cc){this[_0xdae1('0x3')]=uuid['v4']();this[_0xdae1('0x4')]=_0x5c24d1;this[_0xdae1('0x5')]=_0x2f80a1;this[_0xdae1('0x6')]=_0x34bcb2;this[_0xdae1('0x2')]=_0x2592cc;this[_0xdae1('0x4')][_0xdae1('0x7')](this[_0xdae1('0x8')][_0xdae1('0x9')](this),this[_0xdae1('0xa')]['bind'](this));this[_0xdae1('0x4')]['on']('timeout',this[_0xdae1('0xa')][_0xdae1('0x9')](this));this['squeue']['on'](_0xdae1('0xb'),this['handleDrained'][_0xdae1('0x9')](this));};Beepall[_0xdae1('0xc')]['push']=function(){this[_0xdae1('0x4')][_0xdae1('0x7')](this[_0xdae1('0x8')]['bind'](this),this[_0xdae1('0xa')][_0xdae1('0x9')](this));};Beepall[_0xdae1('0xc')][_0xdae1('0xd')]=function(){this[_0xdae1('0xa')](!![]);};Beepall[_0xdae1('0xc')]['handleRun']=function(){var _0x33d5b8=!![];if(!_['isNil'](this[_0xdae1('0x5')])&&!_[_0xdae1('0xe')](this[_0xdae1('0x5')][_0xdae1('0xf')])&&this['queue']['Agents'][_0xdae1('0x10')]>0x0){for(var _0x3405de=0x0,_0x3ef769;_0x3405de0x0){for(var _0x5cda45=0x0,_0x5ed330;_0x5cda450x0&&_0x53c686[_0x522165+_0x4ae2('0x21')]>=_0x53c686[_0x522165+_0x4ae2('0x1f')]){writeLog(_0x2bf5fe,_0x53c686,_0x522165[_0x4ae2('0x22')]()+_0x4ae2('0x23'));return![];}}return!![];};exports[_0x4ae2('0x24')]=function(_0x255772,_0x5b2e65,_0x5962b0,_0x9508d7,_0x3030f8){return sendNotification(!![],_0x255772,_0x5b2e65,_0x5962b0,_0x9508d7,_0x3030f8);};exports[_0x4ae2('0x25')]=function(_0x329588,_0x3a9b96,_0x20ef44,_0x57a377,_0x5ec1fd){return sendNotification(![],_0x329588,_0x3a9b96,_0x20ef44,_0x57a377,_0x5ec1fd);};exports[_0x4ae2('0x26')]=function(_0x4e7741,_0x554cff,_0x5e9f03){var _0x1e2b2d=_0x554cff[_0x4ae2('0x27')]['UserId'];if(!_0x1e2b2d&&_0x5e9f03){_0x1e2b2d=_0x5e9f03['id'];}var _0x883fd5=_[_0x4ae2('0x28')](_0x4e7741[_0x554cff[_0x4ae2('0x29')]+_0x4ae2('0x2a')],function(_0x14fdb3){var _0x23f954=_[_0x4ae2('0x2b')](_0x554cff[_0x4ae2('0x29')])+_0x4ae2('0x2c');return _0x14fdb3[_0x23f954]===_0x554cff[_0x4ae2('0x27')]['id'];});if(!_0x883fd5&&_0x1e2b2d&&_0x4e7741[_0x4ae2('0x2d')][_0x1e2b2d]){_0x883fd5=_[_0x4ae2('0x28')](_0x4e7741[_0x4ae2('0x2d')][_0x1e2b2d][_0x554cff[_0x4ae2('0x29')]+_0x4ae2('0x2e')],function(_0x31017c){return _0x31017c['id']===_0x554cff[_0x4ae2('0x27')]['id'];});}return _0x883fd5;};exports['saveWaitingNotification']=function(_0xdcd11e,_0x516e8c,_0x3479a1,_0x233e02){if(_0x3479a1&&_0x3479a1['id']&&_0xdcd11e['agents']&&_0xdcd11e[_0x4ae2('0x2d')][_0x3479a1['id']]){_0xdcd11e[_0x4ae2('0x2d')][_0x3479a1['id']][_0x233e02+_0x4ae2('0x2e')][_0x516e8c[_0x4ae2('0x15')]['id']]={'id':_0x516e8c['interaction']['id']};}};exports[_0x4ae2('0x2f')]=function(_0x269a91,_0x29458e,_0x32cd5e,_0x3ea0fb){if(_0x32cd5e&&_0x32cd5e['id']&&_0x269a91[_0x4ae2('0x2d')]&&_0x269a91[_0x4ae2('0x2d')][_0x32cd5e['id']]){delete _0x269a91[_0x4ae2('0x2d')][_0x32cd5e['id']][_0x3ea0fb+_0x4ae2('0x2e')][_0x29458e['message']['id']];}};exports[_0x4ae2('0x30')]=writeLog; \ No newline at end of file +var _0xa7dc=['account','notificationShake','body','queue','msg','getMustacheRender','notificationTemplate','I\x20can\x27t\x20render\x20your\x20template','error','name','remove','isAgentAvailable','busy','BUSY','online','OFFLINE','Pause','PAUSE','hasOwnProperty','Capacity','CurrentCapacity','toUpperCase','\x20MAXCAPACITY','showNotification','interaction','UserId','some','QueuesWaitingInteractions','channel','InteractionId','agents','WaitingInteractions','saveWaitingNotification','message','writeLog','lodash','util','../utils','../../../../../config/environment','routing','redis','defaults','localhost','socket.io-emitter','format','user:%s','emit','user:save','split','\x20interaction'];(function(_0x2aee2f,_0xad9887){var _0x19337f=function(_0x2e62d){while(--_0x2e62d){_0x2aee2f['push'](_0x2aee2f['shift']());}};_0x19337f(++_0xad9887);}(_0xa7dc,0x11d));var _0xca7d=function(_0x573596,_0x3dc174){_0x573596=_0x573596-0x0;var _0x2740d4=_0xa7dc[_0x573596];return _0x2740d4;};'use strict';var _=require(_0xca7d('0x0'));var util=require(_0xca7d('0x1'));var utils=require(_0xca7d('0x2'));var Redis=require('ioredis');var config=require(_0xca7d('0x3'));var logger=require('../../../../../config/logger')(_0xca7d('0x4'));config[_0xca7d('0x5')]=_[_0xca7d('0x6')](config[_0xca7d('0x5')],{'host':_0xca7d('0x7'),'port':0x18eb});var io=require(_0xca7d('0x8'))(new Redis(config[_0xca7d('0x5')]));function sendNotification(_0x47e415,_0x5073dd,_0x22223d,_0x820afa,_0x4d5bc7,_0x2920bd){io['to'](util[_0xca7d('0x9')](_0xca7d('0xa'),_0x820afa['name']))[_0xca7d('0xb')](_0xca7d('0xc'),_0x820afa);var _0x2de747=_0x2920bd||{};var _0x40077e=_0x22223d[_0xca7d('0xd')]('.');var _0x5b03b6={'uniqueid':_0x5073dd,'channel':_0x40077e[0x0],'id':_0x40077e[0x1],'title':_0x40077e[0x0]+_0xca7d('0xe'),'interactionId':_0x40077e[0x2],'queue':_0x4d5bc7?_0x4d5bc7['name']:null,'sound':_0x2de747[_0xca7d('0xf')]['notificationSound'],'shake':_0x2de747[_0xca7d('0xf')][_0xca7d('0x10')]};try{if(!_0x2de747[_0xca7d('0x11')]){_0x2de747[_0xca7d('0x11')]={};}if(_0x4d5bc7){_0x2de747['body']['queue']=_0x4d5bc7;}else if(_0x2de747['body'][_0xca7d('0x12')]){delete _0x2de747[_0xca7d('0x11')][_0xca7d('0x12')];}_0x5b03b6[_0xca7d('0x13')]=utils[_0xca7d('0x14')](_0x2de747[_0xca7d('0xf')][_0xca7d('0x15')],_0x2de747);}catch(_0x37bae3){_0x5b03b6[_0xca7d('0x13')]=_0xca7d('0x16');logger[_0xca7d('0x17')](util[_0xca7d('0x9')]('[%s][QUEUE]\x20%s',_0x5073dd,_0x37bae3['message']));}io['to'](util[_0xca7d('0x9')](_0xca7d('0xa'),_0x820afa[_0xca7d('0x18')]))[_0xca7d('0xb')](util[_0xca7d('0x9')]('notification:%s',_0x47e415?'save':_0xca7d('0x19')),_0x5b03b6);}function writeLog(_0x4cb0d8,_0x3f616e,_0x6a89a8){return logger['debug'](util[_0xca7d('0x9')]('[%s][QUEUE][AGENT:%s][STATUS:%s]',_0x4cb0d8,_0x3f616e['name'],_0x6a89a8));}exports[_0xca7d('0x1a')]=function(_0x38a488,_0x1c8723,_0x2fcf0b,_0x5d049b){if(_0x1c8723[_0xca7d('0x1b')]){writeLog(_0x38a488,_0x1c8723,_0xca7d('0x1c'));return![];}if(!_0x1c8723[_0xca7d('0x1d')]){writeLog(_0x38a488,_0x1c8723,_0xca7d('0x1e'));return![];}if(_0x1c8723[_0x2fcf0b+_0xca7d('0x1f')]){writeLog(_0x38a488,_0x1c8723,_0xca7d('0x20'));return![];}if(_0x5d049b&&_0x1c8723[_0xca7d('0x21')](_0x2fcf0b+_0xca7d('0x22'))&&_0x1c8723[_0xca7d('0x21')](_0x2fcf0b+_0xca7d('0x23'))){if(_0x1c8723[_0x2fcf0b+'Capacity']>0x0&&_0x1c8723[_0x2fcf0b+_0xca7d('0x23')]>=_0x1c8723[_0x2fcf0b+_0xca7d('0x22')]){writeLog(_0x38a488,_0x1c8723,_0x2fcf0b[_0xca7d('0x24')]()+_0xca7d('0x25'));return![];}}return!![];};exports[_0xca7d('0x26')]=function(_0xc2048d,_0x38ee14,_0x162bf8,_0xb08cfd,_0x254235){return sendNotification(!![],_0xc2048d,_0x38ee14,_0x162bf8,_0xb08cfd,_0x254235);};exports['hideNotification']=function(_0x445fad,_0x36e725,_0x5975d0,_0x3a1082,_0x5df354){return sendNotification(![],_0x445fad,_0x36e725,_0x5975d0,_0x3a1082,_0x5df354);};exports['checkWaitingNotifications']=function(_0x13c1df,_0x5dfe5f,_0x37c8a6){var _0x1c4e7d=_0x5dfe5f[_0xca7d('0x27')][_0xca7d('0x28')];if(!_0x1c4e7d&&_0x37c8a6){_0x1c4e7d=_0x37c8a6['id'];}var _0x337f3f=_[_0xca7d('0x29')](_0x13c1df[_0x5dfe5f['channel']+_0xca7d('0x2a')],function(_0x2a3b98){var _0x28eeff=_['capitalize'](_0x5dfe5f[_0xca7d('0x2b')])+_0xca7d('0x2c');return _0x2a3b98[_0x28eeff]===_0x5dfe5f[_0xca7d('0x27')]['id'];});if(!_0x337f3f&&_0x1c4e7d&&_0x13c1df[_0xca7d('0x2d')][_0x1c4e7d]){_0x337f3f=_[_0xca7d('0x29')](_0x13c1df[_0xca7d('0x2d')][_0x1c4e7d][_0x5dfe5f[_0xca7d('0x2b')]+_0xca7d('0x2e')],function(_0x5bba0f){return _0x5bba0f['id']===_0x5dfe5f['interaction']['id'];});}return _0x337f3f;};exports[_0xca7d('0x2f')]=function(_0x443285,_0x1f8c01,_0x1ac910,_0x488fcb){if(_0x1ac910&&_0x1ac910['id']&&_0x443285['agents']&&_0x443285[_0xca7d('0x2d')][_0x1ac910['id']]){_0x443285['agents'][_0x1ac910['id']][_0x488fcb+'WaitingInteractions'][_0x1f8c01['message']['id']]={'id':_0x1f8c01[_0xca7d('0x27')]['id']};}};exports['removeWaitingNotification']=function(_0x2bb0ce,_0x1eb686,_0x2835e9,_0x545767){if(_0x2835e9&&_0x2835e9['id']&&_0x2bb0ce[_0xca7d('0x2d')]&&_0x2bb0ce[_0xca7d('0x2d')][_0x2835e9['id']]){delete _0x2bb0ce[_0xca7d('0x2d')][_0x2835e9['id']][_0x545767+'WaitingInteractions'][_0x1eb686[_0xca7d('0x30')]['id']];}};exports[_0xca7d('0x31')]=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 70d3a48..0246983 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 _0xab9e=['[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','replace','isNil','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','isObject','validate','shelljs','../../../../config/logger','string','length','error','[%s][SYSTEM]\x20%s','map','message','info'];(function(_0xabe64d,_0x2618da){var _0x59af04=function(_0x8e7866){while(--_0x8e7866){_0xabe64d['push'](_0xabe64d['shift']());}};_0x59af04(++_0x2618da);}(_0xab9e,0x6e));var _0xeab9=function(_0x1a6fdd,_0xebbd98){_0x1a6fdd=_0x1a6fdd-0x0;var _0x2b49bd=_0xab9e[_0x1a6fdd];return _0x2b49bd;};'use strict';var schema=require(_0xeab9('0x0'));var sh=require(_0xeab9('0x1'));var _=require('lodash');var utils=require('./utils');var logger=require(_0xeab9('0x2'))('routing');var system=schema({'command':{'type':_0xeab9('0x3'),'required':!![],'message':'command\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports['consequence']=function(_0x2d587e,_0x44d431){return function(_0x3657e2){try{var _0x4857b0={'command':_0x44d431[0x0]};var _0x54944a=system['validate'](_0x4857b0,{'typecast':!![]});if(_0x54944a[_0xeab9('0x4')]){logger[_0xeab9('0x5')](_0xeab9('0x6'),_0x2d587e,_[_0xeab9('0x7')](_0x54944a,_0xeab9('0x8'))['join'](',\x20'));logger[_0xeab9('0x9')](_0xeab9('0xa'),_0x2d587e);_0x3657e2[_0xeab9('0xb')]();}else{var _0x24e89b=this;var _0x593272=utils['getMustacheRender'](_0x44d431[0x0],this);logger[_0xeab9('0x9')](_0xeab9('0xc'),_0x2d587e,_0x593272);sh[_0xeab9('0xd')](_[_0xeab9('0xe')](_0x593272),function(_0x41bde8,_0x1ed5d5){logger[_0xeab9('0x9')]('[%s][SYSTEM]\x20result\x20code:\x20%s',_0x2d587e,_0x41bde8);if(_0x41bde8==0x0){var _0x26cc65=_0x1ed5d5[_0xeab9('0xf')](/(\r\n|\n|\r)/gm,'');if(_[_0xeab9('0x10')](_0x44d431[0x1])||_['isEmpty'](_0x44d431[0x1])){logger[_0xeab9('0x9')]('[%s][SYSTEM]\x20no\x20variable',_0x2d587e);_0x24e89b[_0xeab9('0x11')][_0x44d431[0x1]]=_0x26cc65;}else{logger[_0xeab9('0x9')](_0xeab9('0x12'),_0x2d587e,_0x44d431[0x1],_0x26cc65);_0x24e89b[_0xeab9('0x11')][_0x44d431[0x1]]=_0x26cc65;}}_0x3657e2['next']();});}}catch(_0x42faf3){logger['error']('[%s][SYSTEM]\x20%s',_0x2d587e,_[_0xeab9('0x13')](_0x42faf3)?JSON['stringify'](_0x42faf3):_0x42faf3);logger[_0xeab9('0x9')](_0xeab9('0xa'),_0x2d587e);_0x3657e2[_0xeab9('0xb')]();}};}; \ No newline at end of file +var _0x3148=['command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','validate','error','[%s][SYSTEM]\x20%s','map','join','info','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','isEmpty','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','body','isObject','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','shelljs','./utils','../../../../config/logger','routing','string'];(function(_0x436a81,_0x21c13a){var _0x2222f8=function(_0x1e37d7){while(--_0x1e37d7){_0x436a81['push'](_0x436a81['shift']());}};_0x2222f8(++_0x21c13a);}(_0x3148,0x172));var _0x8314=function(_0x7058e5,_0x4304b8){_0x7058e5=_0x7058e5-0x0;var _0xcadefd=_0x3148[_0x7058e5];return _0xcadefd;};'use strict';var schema=require('validate');var sh=require(_0x8314('0x0'));var _=require('lodash');var utils=require(_0x8314('0x1'));var logger=require(_0x8314('0x2'))(_0x8314('0x3'));var system=schema({'command':{'type':_0x8314('0x4'),'required':!![],'message':_0x8314('0x5')}});exports[_0x8314('0x6')]=function(_0x4bcda2,_0x1510e4){return function(_0x18aa16){try{var _0x353ee9={'command':_0x1510e4[0x0]};var _0x1891f5=system[_0x8314('0x7')](_0x353ee9,{'typecast':!![]});if(_0x1891f5['length']){logger[_0x8314('0x8')](_0x8314('0x9'),_0x4bcda2,_[_0x8314('0xa')](_0x1891f5,'message')[_0x8314('0xb')](',\x20'));logger[_0x8314('0xc')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x4bcda2);_0x18aa16[_0x8314('0xd')]();}else{var _0x3304d8=this;var _0x872f67=utils[_0x8314('0xe')](_0x1510e4[0x0],this);logger[_0x8314('0xc')](_0x8314('0xf'),_0x4bcda2,_0x872f67);sh[_0x8314('0x10')](_['trim'](_0x872f67),function(_0x3f0f28,_0x5a7b60){logger[_0x8314('0xc')](_0x8314('0x11'),_0x4bcda2,_0x3f0f28);if(_0x3f0f28==0x0){var _0x405f21=_0x5a7b60[_0x8314('0x12')](/(\r\n|\n|\r)/gm,'');if(_[_0x8314('0x13')](_0x1510e4[0x1])||_[_0x8314('0x14')](_0x1510e4[0x1])){logger[_0x8314('0xc')]('[%s][SYSTEM]\x20no\x20variable',_0x4bcda2);_0x3304d8['body'][_0x1510e4[0x1]]=_0x405f21;}else{logger[_0x8314('0xc')](_0x8314('0x15'),_0x4bcda2,_0x1510e4[0x1],_0x405f21);_0x3304d8[_0x8314('0x16')][_0x1510e4[0x1]]=_0x405f21;}}_0x18aa16[_0x8314('0xd')]();});}}catch(_0x525128){logger[_0x8314('0x8')]('[%s][SYSTEM]\x20%s',_0x4bcda2,_[_0x8314('0x17')](_0x525128)?JSON['stringify'](_0x525128):_0x525128);logger[_0x8314('0xc')](_0x8314('0x18'),_0x4bcda2);_0x18aa16['next']();}};}; \ 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 e4e6c23..6e55eaa 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 _0x9ce7=['TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','validate','length','[%s][TAG]\x20%s','map','message','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','addTags','interaction','then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','error','stringify','finally','isObject','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/whatsappInteraction','routing','number'];(function(_0x3eb13b,_0x50ce9b){var _0xa906ba=function(_0x150d57){while(--_0x150d57){_0x3eb13b['push'](_0x3eb13b['shift']());}};_0xa906ba(++_0x50ce9b);}(_0x9ce7,0x1b8));var _0x79ce=function(_0x3e449b,_0x3c213d){_0x3e449b=_0x3e449b-0x0;var _0x572975=_0x9ce7[_0x3e449b];return _0x572975;};'use strict';var schema=require('validate');var _=require(_0x79ce('0x0'));var rpc={'chatInteraction':require(_0x79ce('0x1')),'openchannelInteraction':require(_0x79ce('0x2')),'smsInteraction':require(_0x79ce('0x3')),'mailInteraction':require(_0x79ce('0x4')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0x79ce('0x5'))};var logger=require('../../../../config/logger')(_0x79ce('0x6'));var tag=schema({'tag':{'type':_0x79ce('0x7'),'required':!![],'message':_0x79ce('0x8')}});exports['consequence']=function(_0x77d21f,_0x20fd1d,_0x3034ce,_0x38130d){return function(_0x162483){try{var _0x58ed8b={'tag':_0x20fd1d[0x0]};var _0x473f08=tag[_0x79ce('0x9')](_0x58ed8b,{'typecast':!![]});if(_0x473f08[_0x79ce('0xa')]){logger['error'](_0x79ce('0xb'),_0x77d21f,_[_0x79ce('0xc')](_0x473f08,_0x79ce('0xd'))[_0x79ce('0xe')](',\x20'));logger[_0x79ce('0xf')](_0x79ce('0x10'),_0x77d21f);_0x162483[_0x79ce('0x11')]();}else{var _0x24ec87={'ids':[_0x20fd1d[0x0]]};if(rpc[_0x38130d[_0x79ce('0x12')]+'Interaction']){rpc[_0x38130d[_0x79ce('0x12')]+_0x79ce('0x13')][_0x79ce('0x14')](_0x38130d[_0x79ce('0x15')]['id'],_0x24ec87)[_0x79ce('0x16')](function(_0xd9895d){logger['info'](_0x79ce('0x17'),_0x77d21f,_0x20fd1d[0x1],_0x38130d[_0x79ce('0x12')],_0x38130d[_0x79ce('0x15')]['id']);})['catch'](function(_0x4282c6){logger[_0x79ce('0x18')]('[%s][TAG]\x20%s',_0x77d21f,JSON[_0x79ce('0x19')](_0x4282c6));logger[_0x79ce('0xf')](_0x79ce('0x10'),_0x77d21f);})[_0x79ce('0x1a')](function(){_0x162483[_0x79ce('0x11')]();});}}}catch(_0x394b93){logger[_0x79ce('0x18')](_0x79ce('0xb'),_0x77d21f,_[_0x79ce('0x1b')](_0x394b93)?JSON[_0x79ce('0x19')](_0x394b93):_0x394b93);logger[_0x79ce('0xf')](_0x79ce('0x10'),_0x77d21f);_0x162483[_0x79ce('0x11')]();}};}; \ No newline at end of file +var _0xf06d=['routing','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','join','channel','Interaction','addTags','then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','interaction','catch','[%s][TAG]\x20%s','stringify','info','finally','next','isObject','validate','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/whatsappInteraction','../../../../config/logger'];(function(_0x28b9fa,_0x25f40a){var _0x1beb5d=function(_0x56dc14){while(--_0x56dc14){_0x28b9fa['push'](_0x28b9fa['shift']());}};_0x1beb5d(++_0x25f40a);}(_0xf06d,0x7b));var _0xdf06=function(_0x36d9ea,_0x43941c){_0x36d9ea=_0x36d9ea-0x0;var _0x5093ed=_0xf06d[_0x36d9ea];return _0x5093ed;};'use strict';var schema=require(_0xdf06('0x0'));var _=require('lodash');var rpc={'chatInteraction':require(_0xdf06('0x1')),'openchannelInteraction':require(_0xdf06('0x2')),'smsInteraction':require(_0xdf06('0x3')),'mailInteraction':require(_0xdf06('0x4')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0xdf06('0x5'))};var logger=require(_0xdf06('0x6'))(_0xdf06('0x7'));var tag=schema({'tag':{'type':'number','required':!![],'message':_0xdf06('0x8')}});exports[_0xdf06('0x9')]=function(_0x5799ee,_0x2ad84f,_0x2a556e,_0x369abb){return function(_0x186d42){try{var _0x5d2bea={'tag':_0x2ad84f[0x0]};var _0x1fe962=tag[_0xdf06('0x0')](_0x5d2bea,{'typecast':!![]});if(_0x1fe962[_0xdf06('0xa')]){logger[_0xdf06('0xb')]('[%s][TAG]\x20%s',_0x5799ee,_['map'](_0x1fe962,'message')[_0xdf06('0xc')](',\x20'));logger['info']('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x5799ee);_0x186d42['next']();}else{var _0x28de10={'ids':[_0x2ad84f[0x0]]};if(rpc[_0x369abb[_0xdf06('0xd')]+_0xdf06('0xe')]){rpc[_0x369abb[_0xdf06('0xd')]+'Interaction'][_0xdf06('0xf')](_0x369abb['interaction']['id'],_0x28de10)[_0xdf06('0x10')](function(_0x42190b){logger['info'](_0xdf06('0x11'),_0x5799ee,_0x2ad84f[0x1],_0x369abb[_0xdf06('0xd')],_0x369abb[_0xdf06('0x12')]['id']);})[_0xdf06('0x13')](function(_0x1f58b1){logger[_0xdf06('0xb')](_0xdf06('0x14'),_0x5799ee,JSON[_0xdf06('0x15')](_0x1f58b1));logger[_0xdf06('0x16')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x5799ee);})[_0xdf06('0x17')](function(){_0x186d42[_0xdf06('0x18')]();});}}}catch(_0x262bbc){logger['error'](_0xdf06('0x14'),_0x5799ee,_[_0xdf06('0x19')](_0x262bbc)?JSON['stringify'](_0x262bbc):_0x262bbc);logger[_0xdf06('0x16')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x5799ee);_0x186d42[_0xdf06('0x18')]();}};}; \ 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 2cfa608..06160f4 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 _0x22eb=['2.0','method','stringify','utf8','POST','application/json-rpc','then','result','logged','Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','&serviceId=','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','catch','error','[%s][TVOX]\x20%s','isObject','stop','info','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','request-promise','routing','lodash','consequence','\x20-\x20','push','urlOnAnswer','?params=','urlOnRing','title','jsonrpc'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x22eb,0x12b));var _0xb22e=function(_0x191013,_0x446e0e){_0x191013=_0x191013-0x0;var _0x2631e1=_0x22eb[_0x191013];return _0x2631e1;};'use strict';var rp=require(_0xb22e('0x0'));var logger=require('../../../../config/logger')(_0xb22e('0x1'));var _=require(_0xb22e('0x2'));var arr=[];exports[_0xb22e('0x3')]=function(_0x34eb4b,_0x167cad){return function(_0x166d41){var _0x16acab=_0x167cad[0xa];var _0x564890=_0x167cad[0xb];var _0x2d9195=_0x167cad[0xc];var _0x9a90f9=_0x167cad[0xd];var _0x48ffbb=_0x167cad[0xe];var _0x11a0c2=_0x167cad[0xf]['replace'](/\n/g,_0xb22e('0x4'));var _0x5be37c=_0x167cad[0x10]['replace'](/\n/g,'\x20');if(!arr['includes'](_0x564890)){arr[_0xb22e('0x5')](_0x564890);var _0x5f4607=_0x167cad[0x3];var _0x253ef0=_0x167cad[0x4];var _0x48806d=_0x167cad[0x1];var _0x49d606=_0x167cad[0x0];var _0x4a0f9f={};_0x4a0f9f[_0xb22e('0x6')]=_0x167cad[0x8]+_0xb22e('0x7')+_0x2d9195+'|'+_0x16acab+'|'+_0x9a90f9+'|'+_0x564890+'|'+_0x48ffbb;_0x4a0f9f[_0xb22e('0x8')]=_0x167cad[0x7]+'?params='+_0x2d9195+'|'+_0x16acab+'|'+_0x9a90f9+'|'+_0x564890+'|'+_0x48ffbb+'|'+_0x11a0c2+'|'+_0x5be37c;_0x4a0f9f[_0xb22e('0x9')]=_0x167cad[0x9];var _0x2691b6={};_0x2691b6[_0xb22e('0xa')]=_0xb22e('0xb');_0x2691b6[_0xb22e('0xc')]='login';var _0x394e01=[];_0x394e01[_0xb22e('0x5')](_0x167cad[0x2]);_0x394e01['push'](_0x167cad[0x5]);_0x394e01['push'](_0x167cad[0x6]);_0x2691b6['params']=_0x394e01;_0x2691b6['id']=0x1;var _0x34c936=JSON[_0xb22e('0xd')](_0x2691b6);var _0x5eaafe={'encoding':_0xb22e('0xe'),'method':_0xb22e('0xf'),'timeout':0x2710,'url':_0x5f4607,'headers':{'Content-Type':_0xb22e('0x10')},'body':_0x34c936};return rp(_0x5eaafe)[_0xb22e('0x11')](function(_0xbe3580){const _0x45a847=JSON['parse'](_0xbe3580);if(!_0x45a847[_0xb22e('0x12')][_0xb22e('0x13')]){throw new Error(_0xb22e('0x14'));}var _0x227170=_0x564890;var _0x4d4a2a=_0xb22e('0x15')+_0x48806d+_0xb22e('0x16')+_0x49d606+'&sessionId='+_0x227170+'&data='+JSON[_0xb22e('0xd')](_0x4a0f9f);var _0xc0a98c=_0x253ef0+'?'+_0x4d4a2a;return rp(_0xc0a98c);})[_0xb22e('0x11')](function(_0x55258d){logger['info'](_0xb22e('0x17'),_0x34eb4b,_0x55258d);_0x166d41['stop']();})[_0xb22e('0x18')](function(_0x346833){logger[_0xb22e('0x19')](_0xb22e('0x1a'),_0x34eb4b,_[_0xb22e('0x1b')](_0x346833)?JSON[_0xb22e('0xd')](_0x346833):_0x346833);_0x166d41[_0xb22e('0x1c')]();});}else{logger[_0xb22e('0x1d')](_0xb22e('0x1e'),_0x34eb4b);_0x166d41['next']();}};}; \ No newline at end of file +var _0x7295=['parse','result','logged','Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','&serviceId=','&sessionId=','&data=','info','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','stop','catch','error','[%s][TVOX]\x20%s','isObject','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','next','request-promise','../../../../config/logger','routing','lodash','consequence','replace','\x20-\x20','includes','urlOnAnswer','?params=','title','jsonrpc','login','push','params','stringify','utf8','POST','application/json-rpc','then'];(function(_0x37ffcc,_0x4b23ec){var _0x9dddc5=function(_0x50ee80){while(--_0x50ee80){_0x37ffcc['push'](_0x37ffcc['shift']());}};_0x9dddc5(++_0x4b23ec);}(_0x7295,0x1f2));var _0x5729=function(_0x5bfa44,_0x76dacc){_0x5bfa44=_0x5bfa44-0x0;var _0x43815f=_0x7295[_0x5bfa44];return _0x43815f;};'use strict';var rp=require(_0x5729('0x0'));var logger=require(_0x5729('0x1'))(_0x5729('0x2'));var _=require(_0x5729('0x3'));var arr=[];exports[_0x5729('0x4')]=function(_0x1aac4e,_0x44db31){return function(_0x4e2f95){var _0x513e34=_0x44db31[0xa];var _0x4a25e7=_0x44db31[0xb];var _0xe0b6ff=_0x44db31[0xc];var _0x2e4cc3=_0x44db31[0xd];var _0x18bf98=_0x44db31[0xe];var _0x58f5dd=_0x44db31[0xf][_0x5729('0x5')](/\n/g,_0x5729('0x6'));var _0xab0ebf=_0x44db31[0x10][_0x5729('0x5')](/\n/g,'\x20');if(!arr[_0x5729('0x7')](_0x4a25e7)){arr['push'](_0x4a25e7);var _0x29681c=_0x44db31[0x3];var _0x2e2608=_0x44db31[0x4];var _0x9d4fdf=_0x44db31[0x1];var _0xa062f3=_0x44db31[0x0];var _0x58cc02={};_0x58cc02[_0x5729('0x8')]=_0x44db31[0x8]+_0x5729('0x9')+_0xe0b6ff+'|'+_0x513e34+'|'+_0x2e4cc3+'|'+_0x4a25e7+'|'+_0x18bf98;_0x58cc02['urlOnRing']=_0x44db31[0x7]+_0x5729('0x9')+_0xe0b6ff+'|'+_0x513e34+'|'+_0x2e4cc3+'|'+_0x4a25e7+'|'+_0x18bf98+'|'+_0x58f5dd+'|'+_0xab0ebf;_0x58cc02[_0x5729('0xa')]=_0x44db31[0x9];var _0xd044c3={};_0xd044c3[_0x5729('0xb')]='2.0';_0xd044c3['method']=_0x5729('0xc');var _0x53a1b8=[];_0x53a1b8[_0x5729('0xd')](_0x44db31[0x2]);_0x53a1b8[_0x5729('0xd')](_0x44db31[0x5]);_0x53a1b8[_0x5729('0xd')](_0x44db31[0x6]);_0xd044c3[_0x5729('0xe')]=_0x53a1b8;_0xd044c3['id']=0x1;var _0x13d178=JSON[_0x5729('0xf')](_0xd044c3);var _0x1ebeab={'encoding':_0x5729('0x10'),'method':_0x5729('0x11'),'timeout':0x2710,'url':_0x29681c,'headers':{'Content-Type':_0x5729('0x12')},'body':_0x13d178};return rp(_0x1ebeab)[_0x5729('0x13')](function(_0x333cd6){const _0xd3c375=JSON[_0x5729('0x14')](_0x333cd6);if(!_0xd3c375[_0x5729('0x15')][_0x5729('0x16')]){throw new Error(_0x5729('0x17'));}var _0x57cad1=_0x4a25e7;var _0x53ce12=_0x5729('0x18')+_0x9d4fdf+_0x5729('0x19')+_0xa062f3+_0x5729('0x1a')+_0x57cad1+_0x5729('0x1b')+JSON[_0x5729('0xf')](_0x58cc02);var _0x367fe9=_0x2e2608+'?'+_0x53ce12;return rp(_0x367fe9);})[_0x5729('0x13')](function(_0x5229ab){logger[_0x5729('0x1c')](_0x5729('0x1d'),_0x1aac4e,_0x5229ab);_0x4e2f95[_0x5729('0x1e')]();})[_0x5729('0x1f')](function(_0x365057){logger[_0x5729('0x20')](_0x5729('0x21'),_0x1aac4e,_[_0x5729('0x22')](_0x365057)?JSON[_0x5729('0xf')](_0x365057):_0x365057);_0x4e2f95['stop']();});}else{logger[_0x5729('0x1c')](_0x5729('0x23'),_0x1aac4e);_0x4e2f95[_0x5729('0x24')]();}};}; \ 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 2f64a7e..d188e6d 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(_0x513a8e,_0x155c27){var _0x53c044=function(_0x404f69){while(--_0x404f69){_0x513a8e['push'](_0x513a8e['shift']());}};_0x53c044(++_0x155c27);}(_0xa9e0,0x123));var _0x0a9e=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0xa9e0[_0x92c450];return _0x2a9599;};'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 _0xd8b0=['merge','body','contact','message','list','mustache','lodash','render'];(function(_0x55fc5d,_0x5e81c3){var _0x229b5a=function(_0x2937ca){while(--_0x2937ca){_0x55fc5d['push'](_0x55fc5d['shift']());}};_0x229b5a(++_0x5e81c3);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Mustache=require(_0x0d8b('0x0'));var _=require(_0x0d8b('0x1'));module['exports']={'getMustacheRender':function(_0x585166,_0x4b72b0){return Mustache[_0x0d8b('0x2')](_0x585166,_[_0x0d8b('0x3')](_0x4b72b0[_0x0d8b('0x4')],{'contact':_0x4b72b0[_0x0d8b('0x5')],'message':_0x4b72b0[_0x0d8b('0x6')],'account':_0x4b72b0['account'],'interaction':_0x4b72b0['interaction'],'list':_0x4b72b0[_0x0d8b('0x7')]}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index 31d3553..50bd1c2 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 _0xcb6b=['jayson/promise','bluebird','./applications/utils','./applications/strategy/util','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','map','Intervals','interval','listen','rules','message','interaction','checkWaitingNotifications','applications','length','existsSync','join','app','.js','toLowerCase','autoreply','appdata','split','channel','mail','push','dialogflow','slice','amazonlex','tvox','getMustacheRender','account','notificationTemplate','ChatWebsiteId','ContactId','body','%s:%s:%s','./applications/','consequence','priority','info','Push\x20new\x20rule','on\x20interval','intervals','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','execute','Applications\x20executed','stringify','emit','complete','Skipped\x20routing\x20for\x20%s','No\x20applications\x20to\x20execute','stack','routing\x20is\x20empty','agent','agents','busy','end','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','busyQueue','hasOwnProperty','capacity','CurrentCapacity','agent\x20not\x20found','values','find','chatQueues','loggedIn','name','paused','waiting','mailQueues','available','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','http','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','path'];(function(_0x942eca,_0x1d0181){var _0x589c16=function(_0x235ca1){while(--_0x235ca1){_0x942eca['push'](_0x942eca['shift']());}};_0x589c16(++_0x1d0181);}(_0xcb6b,0x1a2));var _0xbcb6=function(_0x5ccbaa,_0x3f6e2c){_0x5ccbaa=_0x5ccbaa-0x0;var _0x235e2f=_0xcb6b[_0x5ccbaa];return _0x235e2f;};'use strict';var _=require(_0xbcb6('0x0'));var util=require('util');var path=require(_0xbcb6('0x1'));var fs=require('fs');var jayson=require(_0xbcb6('0x2'));var BPromise=require(_0xbcb6('0x3'));var utils=require(_0xbcb6('0x4'));var sUtils=require(_0xbcb6('0x5'));var logger=require(_0xbcb6('0x6'))(_0xbcb6('0x7'));var rpc={'openchannelQueueReport':require(_0xbcb6('0x8')),'mailQueueReport':require('../rpc/mailQueueReport'),'chatQueueReport':require('../rpc/chatQueueReport'),'smsQueueReport':require(_0xbcb6('0x9')),'faxQueueReport':require(_0xbcb6('0xa')),'whatsappQueueReport':require(_0xbcb6('0xb'))};var RuleEngine=require(_0xbcb6('0xc'));function getId(_0x1078b8,_0x58f82a,_0x46392d){return util[_0xbcb6('0xd')](_0xbcb6('0xe'),_0x1078b8,_0x58f82a||0x0,_0x46392d||0x0);}function getIntervals(_0x1ff57c,_0x16c397){var _0x1bce92=[];if(!_[_0xbcb6('0xf')](_0x16c397['IntervalId'])&&!_['isNil'](_0x1ff57c[_0x16c397[_0xbcb6('0x10')]])&&!_[_0xbcb6('0xf')](_0x1ff57c[_0x16c397[_0xbcb6('0x10')]]['Intervals'])){_0x1bce92=_[_0xbcb6('0x11')](_0x1ff57c[_0x16c397[_0xbcb6('0x10')]][_0xbcb6('0x12')],_0xbcb6('0x13'));}else if(!_[_0xbcb6('0xf')](_0x16c397[_0xbcb6('0x13')])){_0x1bce92=[_0x16c397[_0xbcb6('0x13')]];}return _0x1bce92;}exports[_0xbcb6('0x14')]=function(_0x308120){_0x308120[_0xbcb6('0x15')]={};return new BPromise(function(_0x5c1968,_0x5af1c7){var _0x26177f={'Start':function(_0x26ef8a){var _0xf1b96a=this;return new Promise(function(_0x396652,_0x260238){if(_0x26ef8a){try{var _0xc2314=[];var _0x4c06bd=getId(_0x26ef8a['channel'],_0x26ef8a['message']?_0x26ef8a[_0xbcb6('0x16')]['id']:0x0,_0x26ef8a[_0xbcb6('0x17')]?_0x26ef8a[_0xbcb6('0x17')]['id']:0x0);var _0x75ad08=sUtils[_0xbcb6('0x18')](_0x308120,_0x26ef8a);if(!_0x75ad08&&_0x26ef8a[_0xbcb6('0x19')]&&_['isArray'](_0x26ef8a[_0xbcb6('0x19')])&&_0x26ef8a[_0xbcb6('0x19')][_0xbcb6('0x1a')]){for(var _0x2243d5=0x0;_0x2243d5<_0x26ef8a[_0xbcb6('0x19')][_0xbcb6('0x1a')];_0x2243d5+=0x1){var _0x10209c=_0x26ef8a[_0xbcb6('0x19')][_0x2243d5];if(fs[_0xbcb6('0x1b')](path[_0xbcb6('0x1c')](__dirname,_0xbcb6('0x19'),_0x10209c[_0xbcb6('0x1d')]+_0xbcb6('0x1e')))){var _0x253554=[];switch(_0x10209c[_0xbcb6('0x1d')][_0xbcb6('0x1f')]()){case _0xbcb6('0x20'):var _0xedd4e5=_0x10209c[_0xbcb6('0x21')][_0xbcb6('0x22')](',');if(_0x26ef8a[_0xbcb6('0x23')]===_0xbcb6('0x24')){_0x253554[_0xbcb6('0x25')](_0xedd4e5[0x0]);_0x253554[_0xbcb6('0x25')](_0xedd4e5[0x1]);_0x253554[_0xbcb6('0x25')](_0xedd4e5['slice'](0x2,_0xedd4e5['length'])['join'](','));}else{_0x253554[_0xbcb6('0x25')](_0xedd4e5[0x0]);_0x253554[_0xbcb6('0x25')](_0xedd4e5['slice'](0x1,_0xedd4e5[_0xbcb6('0x1a')])[_0xbcb6('0x1c')](','));}break;case _0xbcb6('0x26'):var _0x4d8ca3=_0x10209c[_0xbcb6('0x21')][_0xbcb6('0x22')](',');_0x253554[_0xbcb6('0x25')](_0x4d8ca3[0x0]);_0x253554['push'](_0x4d8ca3[0x1]);_0x253554[_0xbcb6('0x25')](_0x4d8ca3[_0xbcb6('0x27')](0x2,_0x4d8ca3['length'])['join'](','));break;case'dialogflowv2':var _0xe4734b=_0x10209c['appdata'][_0xbcb6('0x22')](',');_0x253554[_0xbcb6('0x25')](_0xe4734b[0x0]);_0x253554[_0xbcb6('0x25')](_0xe4734b[0x1]);_0x253554[_0xbcb6('0x25')](_0xe4734b[0x2]);_0x253554[_0xbcb6('0x25')](_0xe4734b[0x3]);_0x253554[_0xbcb6('0x25')](_0xe4734b['slice'](0x4,_0xe4734b[_0xbcb6('0x1a')])[_0xbcb6('0x1c')](','));break;case _0xbcb6('0x28'):var _0x1f2861=_0x10209c[_0xbcb6('0x21')][_0xbcb6('0x22')](',');_0x253554[_0xbcb6('0x25')](_0x1f2861[0x0]);_0x253554[_0xbcb6('0x25')](_0x1f2861[0x1]);_0x253554[_0xbcb6('0x25')](_0x1f2861[0x2]);_0x253554['push'](_0x1f2861[0x3]);_0x253554[_0xbcb6('0x25')](_0x1f2861[_0xbcb6('0x27')](0x4,_0x1f2861['length'])[_0xbcb6('0x1c')](','));break;case _0xbcb6('0x16'):_0x253554[_0xbcb6('0x25')](_0x10209c[_0xbcb6('0x21')]);break;case'tag':_0x253554[_0xbcb6('0x25')](_0x10209c['TagId']);_0x253554[_0xbcb6('0x25')](_0x10209c[_0xbcb6('0x21')]);break;case _0xbcb6('0x29'):var _0x537189=utils[_0xbcb6('0x2a')](_0x26ef8a[_0xbcb6('0x2b')][_0xbcb6('0x2c')],_0x26ef8a);var _0x3d1a6f=_0x10209c[_0xbcb6('0x21')][_0xbcb6('0x22')](',');_0x253554[_0xbcb6('0x25')](_0x3d1a6f[0x0]);_0x253554[_0xbcb6('0x25')](_0x3d1a6f[0x1]);_0x253554[_0xbcb6('0x25')](_0x3d1a6f[0x2]);_0x253554[_0xbcb6('0x25')](_0x3d1a6f[0x3]);_0x253554['push'](_0x3d1a6f[0x4]);_0x253554[_0xbcb6('0x25')](_0x3d1a6f[0x5]);_0x253554[_0xbcb6('0x25')](_0x3d1a6f[0x6]);_0x253554[_0xbcb6('0x25')](_0x3d1a6f[0x7]);_0x253554[_0xbcb6('0x25')](_0x3d1a6f[0x8]);_0x253554[_0xbcb6('0x25')](_0x3d1a6f[0x9]);_0x253554[_0xbcb6('0x25')](_0x3d1a6f[0xa]);_0x253554['push'](_0x26ef8a[_0xbcb6('0x17')]['id']);_0x253554[_0xbcb6('0x25')](_0x26ef8a[_0xbcb6('0x16')]['id']);_0x253554[_0xbcb6('0x25')](_0x10209c[_0xbcb6('0x2d')]);_0x253554[_0xbcb6('0x25')](_0x26ef8a[_0xbcb6('0x17')][_0xbcb6('0x2e')]);_0x253554['push'](_0x26ef8a['body'][_0xbcb6('0x2f')]);_0x253554['push'](_0x537189);break;default:_0x253554=_[_0xbcb6('0xf')](_0x10209c[_0xbcb6('0x21')])?[]:_0x10209c[_0xbcb6('0x21')][_0xbcb6('0x22')](',');}var _0x4cefcf={'id':util[_0xbcb6('0xd')](_0xbcb6('0x30'),_0x4c06bd,_0x10209c['id'],_0x10209c[_0xbcb6('0x1d')]),'condition':require('./interval')['condition'](_0x4c06bd,getIntervals(_0x308120['intervals'],_0x10209c),_0x308120),'consequence':require(_0xbcb6('0x31')+_0x10209c['app'])[_0xbcb6('0x32')](_0x4c06bd,_0x253554,_0x308120,_0x26ef8a),'p':_0x10209c[_0xbcb6('0x33')]||0x0};logger[_0xbcb6('0x34')](_0xbcb6('0x35'),_0x4cefcf['id'],_0xbcb6('0x36'),getIntervals(_0x308120[_0xbcb6('0x37')],_0x10209c)[_0xbcb6('0x1c')](_0xbcb6('0x38')));_0xc2314['push'](_0x4cefcf);}else{logger[_0xbcb6('0x39')](_0xbcb6('0x3a'),path[_0xbcb6('0x1c')](__dirname,_0xbcb6('0x19'),_0x10209c[_0xbcb6('0x1d')]+_0xbcb6('0x1e')));}}_0x308120[_0xbcb6('0x15')][_0x4c06bd]=new RuleEngine(_0xc2314);_0x308120[_0xbcb6('0x15')][_0x4c06bd][_0xbcb6('0x3b')](_0x26ef8a,function(_0x3713ae){logger['info'](_0xbcb6('0x3c'),JSON[_0xbcb6('0x3d')](_0x3713ae['matchPath']));if(_0x308120[_0xbcb6('0x15')][_0x4c06bd]){_0x308120['rules'][_0x4c06bd][_0xbcb6('0x3e')](_0xbcb6('0x3f'));}});return _0x396652({'code':0xc8,'message':_0x26ef8a});}else{if(_0x75ad08){logger[_0xbcb6('0x34')](util['format'](_0xbcb6('0x40'),_0x4c06bd));}else{logger[_0xbcb6('0x34')](_0xbcb6('0x41'));}return _0x396652({'code':0xc8,'message':_0x26ef8a});}}catch(_0x27063d){logger[_0xbcb6('0x39')](_0x27063d[_0xbcb6('0x42')]);return _0x260238(_0xf1b96a[_0xbcb6('0x39')](0x1f4,_0x27063d));}}return _0x260238(_0xbcb6('0x43'));});},'AcceptMessage':function(_0x18bc1b){var _0x47fc19=this;return new Promise(function(_0x165821,_0x437325){if(_0x18bc1b[_0xbcb6('0x44')]&&_0x18bc1b[_0xbcb6('0x44')]['id']){if(_0x308120[_0xbcb6('0x45')][_0x18bc1b[_0xbcb6('0x44')]['id']]){_0x308120[_0xbcb6('0x45')][_0x18bc1b[_0xbcb6('0x44')]['id']][_0xbcb6('0x46')]=![];_0x308120['agents'][_0x18bc1b[_0xbcb6('0x44')]['id']]['busyQueue']=undefined;}}if(_0x18bc1b[_0xbcb6('0x16')]&&_0x18bc1b[_0xbcb6('0x16')]['id']){try{var _0x8220fe=getId(_0x18bc1b[_0xbcb6('0x23')],_0x18bc1b[_0xbcb6('0x16')]?_0x18bc1b[_0xbcb6('0x16')]['id']:0x0,_0x18bc1b[_0xbcb6('0x17')]?_0x18bc1b[_0xbcb6('0x17')]['id']:0x0);if(_0x308120[_0xbcb6('0x15')][_0x8220fe]){_0x308120[_0xbcb6('0x15')][_0x8220fe][_0xbcb6('0x3e')](_0xbcb6('0x47'));if(rpc[_0x18bc1b[_0xbcb6('0x23')]+_0xbcb6('0x48')]){rpc[_0x18bc1b[_0xbcb6('0x23')]+_0xbcb6('0x48')][_0xbcb6('0x49')](_0x8220fe,{'UserId':_0x18bc1b['message'][_0xbcb6('0x4a')]})[_0xbcb6('0x4b')](function(){logger[_0xbcb6('0x39')](_0xbcb6('0x4c'));});}}return _0x165821({'code':0xc8,'message':_0x18bc1b});}catch(_0x113b93){logger['error'](_0x113b93[_0xbcb6('0x42')]);return _0x437325(_0x47fc19[_0xbcb6('0x39')](0x1f4,_0x113b93));}}logger['error'](_0xbcb6('0x4d'));return _0x437325(_0x47fc19[_0xbcb6('0x39')](0x1f4,_0xbcb6('0x4d')));});},'RejectMessage':function(_0x5d62fc){var _0x554f67=this;return new Promise(function(_0x5e5540,_0x28b68e){if(_0x5d62fc[_0xbcb6('0x44')]&&_0x5d62fc[_0xbcb6('0x44')]['id']){try{if(_0x308120[_0xbcb6('0x45')][_0x5d62fc[_0xbcb6('0x44')]['id']]){_0x308120[_0xbcb6('0x45')][_0x5d62fc[_0xbcb6('0x44')]['id']][_0xbcb6('0x46')]=![];_0x308120['agents'][_0x5d62fc['agent']['id']][_0xbcb6('0x4e')]=undefined;}return _0x5e5540({'code':0xc8,'message':_0x5d62fc});}catch(_0x2924ed){logger[_0xbcb6('0x39')](_0x2924ed[_0xbcb6('0x42')]);return _0x28b68e(_0x554f67[_0xbcb6('0x39')](0x1f4,_0x2924ed));}}logger['error'](_0xbcb6('0x4d'));return _0x28b68e(_0x554f67[_0xbcb6('0x39')](0x1f4,_0xbcb6('0x4d')));});},'AbandonInteraction':function(_0xaabc81){var _0x3baf89=this;return new Promise(function(_0x1fa91d,_0xdcb14f){if(_0xaabc81[_0xbcb6('0x23')]&&_0xaabc81['interaction']&&_0xaabc81[_0xbcb6('0x17')]['id']){try{var _0x308b=getId(_0xaabc81[_0xbcb6('0x23')],_0xaabc81[_0xbcb6('0x16')]?_0xaabc81[_0xbcb6('0x16')]['id']:0x0,_0xaabc81[_0xbcb6('0x17')]?_0xaabc81['interaction']['id']:0x0);if(_0x308120[_0xbcb6('0x15')][_0x308b]){_0x308120['rules'][_0x308b][_0xbcb6('0x3e')](_0xbcb6('0x47'));}return _0x1fa91d({'code':0xc8,'message':_0xaabc81});}catch(_0x319fe3){logger[_0xbcb6('0x39')](_0x319fe3[_0xbcb6('0x42')]);return _0xdcb14f(_0x3baf89[_0xbcb6('0x39')](0x1f4,_0x319fe3));}}logger[_0xbcb6('0x39')](_0xbcb6('0x4d'));return _0xdcb14f(_0x3baf89['error'](0x1f4,'message\x20is\x20empty'));});},'AgentCapacity':function(_0x37497d){var _0x1d169f=this;return new Promise(function(_0x5df7a1,_0x3e0a2e){if(_0x308120[_0xbcb6('0x45')][_0xbcb6('0x4f')](_0x37497d['id'])){for(var _0x350341 in _0x37497d[_0xbcb6('0x50')]){if(_0x37497d[_0xbcb6('0x50')][_0xbcb6('0x4f')](_0x350341)){if(_0x308120['agents'][_0x37497d['id']]['hasOwnProperty'](_0x350341+_0xbcb6('0x51'))){_0x308120[_0xbcb6('0x45')][_0x37497d['id']][_0x350341+'CurrentCapacity']=parseInt(_0x37497d[_0xbcb6('0x50')][_0x350341],0xa);}}}_0x308120[_0xbcb6('0x45')][_0x37497d['id']]['updateRealtime']();return _0x5df7a1({'code':0xc8,'message':_0x308120[_0xbcb6('0x45')][_0x37497d['id']]});}else{return _0x3e0a2e(_0x1d169f['error'](0x1f4,_0xbcb6('0x52')));}});},'Agents':function(_0x49cb47){return new Promise(function(_0x3dc42a){var _0x2136ee=_[_0xbcb6('0x53')](_0x308120[_0xbcb6('0x45')]);if(_0x49cb47&&_0x49cb47['id']){var _0x43aa78=_[_0xbcb6('0x54')](_0x2136ee,function(_0x3a9271){return _0x3a9271['id']===_0x49cb47['id'];});_0x3dc42a(_0x43aa78);}else{_0x3dc42a({'count':_0x2136ee[_0xbcb6('0x1a')],'rows':_0x2136ee});}});},'ChatQueues':function(){return new Promise(function(_0x3eef33){var _0xe2dd3=[];for(var _0x387bd8 in _0x308120[_0xbcb6('0x55')]){if(_0x308120[_0xbcb6('0x55')]['hasOwnProperty'](_0x387bd8)){var _0x3ebb3b=_0x308120[_0xbcb6('0x55')][_0x387bd8];var _0x17e391={'id':_0x3ebb3b['id'],'available':_0x3ebb3b['available'],'loggedIn':_0x3ebb3b[_0xbcb6('0x56')],'name':_0x3ebb3b[_0xbcb6('0x57')],'paused':_0x3ebb3b[_0xbcb6('0x58')],'waiting':_0x3ebb3b[_0xbcb6('0x59')]};_0xe2dd3[_0xbcb6('0x25')](_0x17e391);}}_0x3eef33({'count':_0xe2dd3['length'],'rows':_0xe2dd3});});},'MailQueues':function(){return new Promise(function(_0x3331d9){var _0x22ec02=[];for(var _0x47340a in _0x308120['mailQueues']){if(_0x308120[_0xbcb6('0x5a')]['hasOwnProperty'](_0x47340a)){var _0x3577f1=_0x308120[_0xbcb6('0x5a')][_0x47340a];var _0x1cffee={'id':_0x3577f1['id'],'available':_0x3577f1[_0xbcb6('0x5b')],'loggedIn':_0x3577f1[_0xbcb6('0x56')],'name':_0x3577f1['name'],'paused':_0x3577f1['paused'],'waiting':_0x3577f1[_0xbcb6('0x59')]};_0x22ec02[_0xbcb6('0x25')](_0x1cffee);}}_0x3331d9({'count':_0x22ec02[_0xbcb6('0x1a')],'rows':_0x22ec02});});},'OpenchannelQueues':function(){return new Promise(function(_0x1afca2){var _0x36ac19=[];for(var _0x495da0 in _0x308120[_0xbcb6('0x5c')]){if(_0x308120[_0xbcb6('0x5c')][_0xbcb6('0x4f')](_0x495da0)){var _0x42e4e9=_0x308120['openchannelQueues'][_0x495da0];var _0x4b65c5={'id':_0x42e4e9['id'],'available':_0x42e4e9['available'],'loggedIn':_0x42e4e9['loggedIn'],'name':_0x42e4e9[_0xbcb6('0x57')],'paused':_0x42e4e9[_0xbcb6('0x58')],'waiting':_0x42e4e9[_0xbcb6('0x59')]};_0x36ac19[_0xbcb6('0x25')](_0x4b65c5);}}_0x1afca2({'count':_0x36ac19[_0xbcb6('0x1a')],'rows':_0x36ac19});});},'SmsQueues':function(){return new Promise(function(_0x274861){var _0x9bae93=[];for(var _0x59e893 in _0x308120[_0xbcb6('0x5d')]){if(_0x308120[_0xbcb6('0x5d')][_0xbcb6('0x4f')](_0x59e893)){var _0x450781=_0x308120[_0xbcb6('0x5d')][_0x59e893];var _0x5022b6={'id':_0x450781['id'],'available':_0x450781['available'],'loggedIn':_0x450781[_0xbcb6('0x56')],'name':_0x450781[_0xbcb6('0x57')],'paused':_0x450781[_0xbcb6('0x58')],'waiting':_0x450781['waiting']};_0x9bae93[_0xbcb6('0x25')](_0x5022b6);}}_0x274861({'count':_0x9bae93[_0xbcb6('0x1a')],'rows':_0x9bae93});});},'FaxQueues':function(){return new Promise(function(_0x1399a5){var _0x50255b=[];for(var _0x10be9f in _0x308120[_0xbcb6('0x5e')]){if(_0x308120['faxQueues']['hasOwnProperty'](_0x10be9f)){var _0x1d7789=_0x308120[_0xbcb6('0x5e')][_0x10be9f];var _0x2bb9dd={'id':_0x1d7789['id'],'available':_0x1d7789[_0xbcb6('0x5b')],'loggedIn':_0x1d7789[_0xbcb6('0x56')],'name':_0x1d7789[_0xbcb6('0x57')],'paused':_0x1d7789['paused'],'waiting':_0x1d7789[_0xbcb6('0x59')]};_0x50255b[_0xbcb6('0x25')](_0x2bb9dd);}}_0x1399a5({'count':_0x50255b[_0xbcb6('0x1a')],'rows':_0x50255b});});},'WhatsappQueues':function(){return new Promise(function(_0x16d397){var _0x1ae851=[];for(var _0x20246c in _0x308120[_0xbcb6('0x5f')]){if(_0x308120['whatsappQueues'][_0xbcb6('0x4f')](_0x20246c)){var _0x4d9be0=_0x308120[_0xbcb6('0x5f')][_0x20246c];var _0x5ba2ae={'id':_0x4d9be0['id'],'available':_0x4d9be0[_0xbcb6('0x5b')],'loggedIn':_0x4d9be0[_0xbcb6('0x56')],'name':_0x4d9be0['name'],'paused':_0x4d9be0['paused'],'waiting':_0x4d9be0[_0xbcb6('0x59')]};_0x1ae851[_0xbcb6('0x25')](_0x5ba2ae);}}_0x16d397({'count':_0x1ae851[_0xbcb6('0x1a')],'rows':_0x1ae851});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x3232ee){var _0x314224=_[_0xbcb6('0x53')](_0x308120[_0xbcb6('0x60')]);_0x3232ee({'count':_0x314224[_0xbcb6('0x1a')],'rows':_0x314224});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x25c6de){var _0x50a92b=_[_0xbcb6('0x53')](_0x308120[_0xbcb6('0x61')]);_0x25c6de({'count':_0x50a92b[_0xbcb6('0x1a')],'rows':_0x50a92b});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x1394ef){var _0x3c03f2=_[_0xbcb6('0x53')](_0x308120['openchannelQueuesWaitingInteractions']);_0x1394ef({'count':_0x3c03f2[_0xbcb6('0x1a')],'rows':_0x3c03f2});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x5ecb7a){var _0x1ad857=_[_0xbcb6('0x53')](_0x308120[_0xbcb6('0x62')]);_0x5ecb7a({'count':_0x1ad857['length'],'rows':_0x1ad857});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x3b6721){var _0x22aacd=_[_0xbcb6('0x53')](_0x308120[_0xbcb6('0x63')]);_0x3b6721({'count':_0x22aacd[_0xbcb6('0x1a')],'rows':_0x22aacd});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x2c5a2a){var _0x5a6ab0=_['values'](_0x308120['whatsappQueuesWaitingInteractions']);_0x2c5a2a({'count':_0x5a6ab0[_0xbcb6('0x1a')],'rows':_0x5a6ab0});});}};var _0x551bcc=jayson['server'](_0x26177f)[_0xbcb6('0x64')]();_0x551bcc['on'](_0xbcb6('0x39'),function(_0x5e9012){logger['error'](JSON[_0xbcb6('0x3d')](_0x5e9012));return _0x5af1c7(_0x5e9012);});_0x551bcc[_0xbcb6('0x14')](0x232c,_0xbcb6('0x65'),function(){console[_0xbcb6('0x66')](_0xbcb6('0x67'),0x232c);return _0x5c1968(_0xbcb6('0x68')+0x232c);});});}; \ No newline at end of file +var _0xe558=['log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','lodash','util','path','jayson/promise','bluebird','./applications/utils','./applications/strategy/util','../../../config/logger','routing','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','%s.%s.%s','IntervalId','isNil','Intervals','interval','listen','rules','channel','message','interaction','checkWaitingNotifications','transfer','isArray','applications','length','join','app','toLowerCase','autoreply','appdata','mail','push','slice','dialogflow','split','dialogflowv2','amazonlex','tag','TagId','getMustacheRender','account','notificationTemplate','ChatWebsiteId','ContactId','body','format','%s:%s:%s','./interval','condition','intervals','./applications/','priority','Push\x20new\x20rule','on\x20interval','\x20|\x20','Please\x20create\x20a\x20new\x20file\x20under','.js','execute','info','stringify','matchPath','emit','complete','No\x20applications\x20to\x20execute','error','agent','agents','busy','busyQueue','end','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','stack','message\x20is\x20empty','hasOwnProperty','capacity','CurrentCapacity','agent\x20not\x20found','values','find','chatQueues','available','name','paused','waiting','mailQueues','openchannelQueues','loggedIn','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','127.0.0.1'];(function(_0x101bf3,_0x30d6ee){var _0x4b86ba=function(_0xd36622){while(--_0xd36622){_0x101bf3['push'](_0x101bf3['shift']());}};_0x4b86ba(++_0x30d6ee);}(_0xe558,0x70));var _0x8e55=function(_0x34ac6e,_0x4668e1){_0x34ac6e=_0x34ac6e-0x0;var _0x4f243e=_0xe558[_0x34ac6e];return _0x4f243e;};'use strict';var _=require(_0x8e55('0x0'));var util=require(_0x8e55('0x1'));var path=require(_0x8e55('0x2'));var fs=require('fs');var jayson=require(_0x8e55('0x3'));var BPromise=require(_0x8e55('0x4'));var utils=require(_0x8e55('0x5'));var sUtils=require(_0x8e55('0x6'));var logger=require(_0x8e55('0x7'))(_0x8e55('0x8'));var rpc={'openchannelQueueReport':require('../rpc/openchannelQueueReport'),'mailQueueReport':require(_0x8e55('0x9')),'chatQueueReport':require(_0x8e55('0xa')),'smsQueueReport':require(_0x8e55('0xb')),'faxQueueReport':require(_0x8e55('0xc')),'whatsappQueueReport':require(_0x8e55('0xd'))};var RuleEngine=require(_0x8e55('0xe'));function getId(_0x493307,_0xe27f09,_0x429679){return util['format'](_0x8e55('0xf'),_0x493307,_0xe27f09||0x0,_0x429679||0x0);}function getIntervals(_0x578110,_0x570b31){var _0x50966f=[];if(!_['isNil'](_0x570b31['IntervalId'])&&!_['isNil'](_0x578110[_0x570b31[_0x8e55('0x10')]])&&!_[_0x8e55('0x11')](_0x578110[_0x570b31[_0x8e55('0x10')]][_0x8e55('0x12')])){_0x50966f=_['map'](_0x578110[_0x570b31[_0x8e55('0x10')]]['Intervals'],'interval');}else if(!_['isNil'](_0x570b31[_0x8e55('0x13')])){_0x50966f=[_0x570b31['interval']];}return _0x50966f;}exports[_0x8e55('0x14')]=function(_0x2a5545){_0x2a5545[_0x8e55('0x15')]={};return new BPromise(function(_0x2b5a04,_0x8cbfc7){var _0x125388={'Start':function(_0x1abd80){var _0x23c198=this;return new Promise(function(_0x83b32e,_0xb2e25e){if(_0x1abd80){try{var _0x45029c=[];var _0x1d6b69=getId(_0x1abd80[_0x8e55('0x16')],_0x1abd80[_0x8e55('0x17')]?_0x1abd80[_0x8e55('0x17')]['id']:0x0,_0x1abd80['interaction']?_0x1abd80[_0x8e55('0x18')]['id']:0x0);var _0x1e5d1f=sUtils[_0x8e55('0x19')](_0x2a5545,_0x1abd80);if(_0x1abd80[_0x8e55('0x1a')]||!_0x1e5d1f&&_0x1abd80['applications']&&_[_0x8e55('0x1b')](_0x1abd80[_0x8e55('0x1c')])&&_0x1abd80[_0x8e55('0x1c')][_0x8e55('0x1d')]){for(var _0x13b52a=0x0;_0x13b52a<_0x1abd80[_0x8e55('0x1c')][_0x8e55('0x1d')];_0x13b52a+=0x1){var _0x25e8b0=_0x1abd80['applications'][_0x13b52a];if(fs['existsSync'](path[_0x8e55('0x1e')](__dirname,_0x8e55('0x1c'),_0x25e8b0[_0x8e55('0x1f')]+'.js'))){var _0x42adae=[];switch(_0x25e8b0[_0x8e55('0x1f')][_0x8e55('0x20')]()){case _0x8e55('0x21'):var _0x12816e=_0x25e8b0[_0x8e55('0x22')]['split'](',');if(_0x1abd80[_0x8e55('0x16')]===_0x8e55('0x23')){_0x42adae['push'](_0x12816e[0x0]);_0x42adae[_0x8e55('0x24')](_0x12816e[0x1]);_0x42adae[_0x8e55('0x24')](_0x12816e[_0x8e55('0x25')](0x2,_0x12816e[_0x8e55('0x1d')])[_0x8e55('0x1e')](','));}else{_0x42adae[_0x8e55('0x24')](_0x12816e[0x0]);_0x42adae[_0x8e55('0x24')](_0x12816e[_0x8e55('0x25')](0x1,_0x12816e[_0x8e55('0x1d')])[_0x8e55('0x1e')](','));}break;case _0x8e55('0x26'):var _0x5393e6=_0x25e8b0[_0x8e55('0x22')][_0x8e55('0x27')](',');_0x42adae[_0x8e55('0x24')](_0x5393e6[0x0]);_0x42adae[_0x8e55('0x24')](_0x5393e6[0x1]);_0x42adae['push'](_0x5393e6[_0x8e55('0x25')](0x2,_0x5393e6['length'])[_0x8e55('0x1e')](','));break;case _0x8e55('0x28'):var _0x528989=_0x25e8b0[_0x8e55('0x22')][_0x8e55('0x27')](',');_0x42adae[_0x8e55('0x24')](_0x528989[0x0]);_0x42adae['push'](_0x528989[0x1]);_0x42adae[_0x8e55('0x24')](_0x528989[0x2]);_0x42adae[_0x8e55('0x24')](_0x528989[0x3]);_0x42adae[_0x8e55('0x24')](_0x528989[_0x8e55('0x25')](0x4,_0x528989[_0x8e55('0x1d')])[_0x8e55('0x1e')](','));break;case _0x8e55('0x29'):var _0x11d5a9=_0x25e8b0['appdata']['split'](',');_0x42adae['push'](_0x11d5a9[0x0]);_0x42adae[_0x8e55('0x24')](_0x11d5a9[0x1]);_0x42adae[_0x8e55('0x24')](_0x11d5a9[0x2]);_0x42adae[_0x8e55('0x24')](_0x11d5a9[0x3]);_0x42adae['push'](_0x11d5a9[_0x8e55('0x25')](0x4,_0x11d5a9['length'])['join'](','));break;case _0x8e55('0x17'):_0x42adae[_0x8e55('0x24')](_0x25e8b0['appdata']);break;case _0x8e55('0x2a'):_0x42adae[_0x8e55('0x24')](_0x25e8b0[_0x8e55('0x2b')]);_0x42adae[_0x8e55('0x24')](_0x25e8b0[_0x8e55('0x22')]);break;case'tvox':var _0x3169ce=utils[_0x8e55('0x2c')](_0x1abd80[_0x8e55('0x2d')][_0x8e55('0x2e')],_0x1abd80);var _0x5aa21d=_0x25e8b0[_0x8e55('0x22')][_0x8e55('0x27')](',');_0x42adae[_0x8e55('0x24')](_0x5aa21d[0x0]);_0x42adae['push'](_0x5aa21d[0x1]);_0x42adae[_0x8e55('0x24')](_0x5aa21d[0x2]);_0x42adae[_0x8e55('0x24')](_0x5aa21d[0x3]);_0x42adae[_0x8e55('0x24')](_0x5aa21d[0x4]);_0x42adae[_0x8e55('0x24')](_0x5aa21d[0x5]);_0x42adae[_0x8e55('0x24')](_0x5aa21d[0x6]);_0x42adae[_0x8e55('0x24')](_0x5aa21d[0x7]);_0x42adae['push'](_0x5aa21d[0x8]);_0x42adae[_0x8e55('0x24')](_0x5aa21d[0x9]);_0x42adae[_0x8e55('0x24')](_0x5aa21d[0xa]);_0x42adae[_0x8e55('0x24')](_0x1abd80[_0x8e55('0x18')]['id']);_0x42adae[_0x8e55('0x24')](_0x1abd80[_0x8e55('0x17')]['id']);_0x42adae['push'](_0x25e8b0[_0x8e55('0x2f')]);_0x42adae[_0x8e55('0x24')](_0x1abd80[_0x8e55('0x18')][_0x8e55('0x30')]);_0x42adae[_0x8e55('0x24')](_0x1abd80[_0x8e55('0x31')][_0x8e55('0x31')]);_0x42adae['push'](_0x3169ce);break;default:_0x42adae=_['isNil'](_0x25e8b0[_0x8e55('0x22')])?[]:_0x25e8b0[_0x8e55('0x22')][_0x8e55('0x27')](',');}var _0x21a8f8={'id':util[_0x8e55('0x32')](_0x8e55('0x33'),_0x1d6b69,_0x25e8b0['id'],_0x25e8b0['app']),'condition':require(_0x8e55('0x34'))[_0x8e55('0x35')](_0x1d6b69,getIntervals(_0x2a5545[_0x8e55('0x36')],_0x25e8b0),_0x2a5545),'consequence':require(_0x8e55('0x37')+_0x25e8b0[_0x8e55('0x1f')])['consequence'](_0x1d6b69,_0x42adae,_0x2a5545,_0x1abd80),'p':_0x25e8b0[_0x8e55('0x38')]||0x0};logger['info'](_0x8e55('0x39'),_0x21a8f8['id'],_0x8e55('0x3a'),getIntervals(_0x2a5545['intervals'],_0x25e8b0)[_0x8e55('0x1e')](_0x8e55('0x3b')));_0x45029c['push'](_0x21a8f8);}else{logger['error'](_0x8e55('0x3c'),path[_0x8e55('0x1e')](__dirname,_0x8e55('0x1c'),_0x25e8b0[_0x8e55('0x1f')]+_0x8e55('0x3d')));}}_0x2a5545[_0x8e55('0x15')][_0x1d6b69]=new RuleEngine(_0x45029c);_0x2a5545[_0x8e55('0x15')][_0x1d6b69][_0x8e55('0x3e')](_0x1abd80,function(_0x1d54b8){logger[_0x8e55('0x3f')]('Applications\x20executed',JSON[_0x8e55('0x40')](_0x1d54b8[_0x8e55('0x41')]));if(_0x2a5545['rules'][_0x1d6b69]){_0x2a5545[_0x8e55('0x15')][_0x1d6b69][_0x8e55('0x42')](_0x8e55('0x43'));}});return _0x83b32e({'code':0xc8,'message':_0x1abd80});}else{if(_0x1e5d1f){logger[_0x8e55('0x3f')](util[_0x8e55('0x32')]('Skipped\x20routing\x20for\x20%s',_0x1d6b69));}else{logger['info'](_0x8e55('0x44'));}return _0x83b32e({'code':0xc8,'message':_0x1abd80});}}catch(_0x1816e9){logger[_0x8e55('0x45')](_0x1816e9['stack']);return _0xb2e25e(_0x23c198[_0x8e55('0x45')](0x1f4,_0x1816e9));}}return _0xb2e25e('routing\x20is\x20empty');});},'AcceptMessage':function(_0x585c65){var _0x81548b=this;return new Promise(function(_0x206cdd,_0x2ec8a1){if(_0x585c65[_0x8e55('0x46')]&&_0x585c65[_0x8e55('0x46')]['id']){if(_0x2a5545[_0x8e55('0x47')][_0x585c65[_0x8e55('0x46')]['id']]){_0x2a5545[_0x8e55('0x47')][_0x585c65['agent']['id']][_0x8e55('0x48')]=![];_0x2a5545['agents'][_0x585c65['agent']['id']][_0x8e55('0x49')]=undefined;}}if(_0x585c65[_0x8e55('0x17')]&&_0x585c65[_0x8e55('0x17')]['id']){try{var _0x150085=getId(_0x585c65[_0x8e55('0x16')],_0x585c65[_0x8e55('0x17')]?_0x585c65[_0x8e55('0x17')]['id']:0x0,_0x585c65[_0x8e55('0x18')]?_0x585c65[_0x8e55('0x18')]['id']:0x0);if(_0x2a5545[_0x8e55('0x15')][_0x150085]){_0x2a5545[_0x8e55('0x15')][_0x150085][_0x8e55('0x42')](_0x8e55('0x4a'));if(rpc[_0x585c65['channel']+'QueueReport']){rpc[_0x585c65[_0x8e55('0x16')]+_0x8e55('0x4b')][_0x8e55('0x4c')](_0x150085,{'UserId':_0x585c65['message'][_0x8e55('0x4d')]})[_0x8e55('0x4e')](function(){logger[_0x8e55('0x45')](_0x8e55('0x4f'));});}}return _0x206cdd({'code':0xc8,'message':_0x585c65});}catch(_0x36e180){logger[_0x8e55('0x45')](_0x36e180[_0x8e55('0x50')]);return _0x2ec8a1(_0x81548b[_0x8e55('0x45')](0x1f4,_0x36e180));}}logger[_0x8e55('0x45')]('message\x20is\x20empty');return _0x2ec8a1(_0x81548b[_0x8e55('0x45')](0x1f4,_0x8e55('0x51')));});},'RejectMessage':function(_0x329e76){var _0x289ee4=this;return new Promise(function(_0x541a47,_0x3efb1f){if(_0x329e76[_0x8e55('0x46')]&&_0x329e76[_0x8e55('0x46')]['id']){try{if(_0x2a5545[_0x8e55('0x47')][_0x329e76[_0x8e55('0x46')]['id']]){_0x2a5545[_0x8e55('0x47')][_0x329e76[_0x8e55('0x46')]['id']][_0x8e55('0x48')]=![];_0x2a5545['agents'][_0x329e76[_0x8e55('0x46')]['id']][_0x8e55('0x49')]=undefined;}return _0x541a47({'code':0xc8,'message':_0x329e76});}catch(_0x49b3d1){logger['error'](_0x49b3d1[_0x8e55('0x50')]);return _0x3efb1f(_0x289ee4['error'](0x1f4,_0x49b3d1));}}logger[_0x8e55('0x45')](_0x8e55('0x51'));return _0x3efb1f(_0x289ee4[_0x8e55('0x45')](0x1f4,_0x8e55('0x51')));});},'AbandonInteraction':function(_0x193e5a){var _0x591f4c=this;return new Promise(function(_0x64f2f6,_0x324551){if(_0x193e5a[_0x8e55('0x16')]&&_0x193e5a[_0x8e55('0x18')]&&_0x193e5a[_0x8e55('0x18')]['id']){try{var _0x44cf6d=getId(_0x193e5a['channel'],_0x193e5a[_0x8e55('0x17')]?_0x193e5a[_0x8e55('0x17')]['id']:0x0,_0x193e5a['interaction']?_0x193e5a[_0x8e55('0x18')]['id']:0x0);if(_0x2a5545['rules'][_0x44cf6d]){_0x2a5545[_0x8e55('0x15')][_0x44cf6d][_0x8e55('0x42')](_0x8e55('0x4a'));}return _0x64f2f6({'code':0xc8,'message':_0x193e5a});}catch(_0xac7042){logger[_0x8e55('0x45')](_0xac7042[_0x8e55('0x50')]);return _0x324551(_0x591f4c[_0x8e55('0x45')](0x1f4,_0xac7042));}}logger[_0x8e55('0x45')](_0x8e55('0x51'));return _0x324551(_0x591f4c[_0x8e55('0x45')](0x1f4,_0x8e55('0x51')));});},'AgentCapacity':function(_0x528b50){var _0x3d76bd=this;return new Promise(function(_0x538b2c,_0x231aca){if(_0x2a5545[_0x8e55('0x47')][_0x8e55('0x52')](_0x528b50['id'])){for(var _0x4c8d77 in _0x528b50['capacity']){if(_0x528b50[_0x8e55('0x53')][_0x8e55('0x52')](_0x4c8d77)){if(_0x2a5545[_0x8e55('0x47')][_0x528b50['id']][_0x8e55('0x52')](_0x4c8d77+_0x8e55('0x54'))){_0x2a5545['agents'][_0x528b50['id']][_0x4c8d77+_0x8e55('0x54')]=parseInt(_0x528b50[_0x8e55('0x53')][_0x4c8d77],0xa);}}}_0x2a5545[_0x8e55('0x47')][_0x528b50['id']]['updateRealtime']();return _0x538b2c({'code':0xc8,'message':_0x2a5545[_0x8e55('0x47')][_0x528b50['id']]});}else{return _0x231aca(_0x3d76bd[_0x8e55('0x45')](0x1f4,_0x8e55('0x55')));}});},'Agents':function(_0xba83d){return new Promise(function(_0x2aefc1){var _0x274a03=_[_0x8e55('0x56')](_0x2a5545['agents']);if(_0xba83d&&_0xba83d['id']){var _0xb9f1ec=_[_0x8e55('0x57')](_0x274a03,function(_0xcf1ddf){return _0xcf1ddf['id']===_0xba83d['id'];});_0x2aefc1(_0xb9f1ec);}else{_0x2aefc1({'count':_0x274a03[_0x8e55('0x1d')],'rows':_0x274a03});}});},'ChatQueues':function(){return new Promise(function(_0x5f25fd){var _0x18cff3=[];for(var _0x30f015 in _0x2a5545['chatQueues']){if(_0x2a5545[_0x8e55('0x58')][_0x8e55('0x52')](_0x30f015)){var _0x3248e9=_0x2a5545[_0x8e55('0x58')][_0x30f015];var _0x5da956={'id':_0x3248e9['id'],'available':_0x3248e9[_0x8e55('0x59')],'loggedIn':_0x3248e9['loggedIn'],'name':_0x3248e9[_0x8e55('0x5a')],'paused':_0x3248e9[_0x8e55('0x5b')],'waiting':_0x3248e9[_0x8e55('0x5c')]};_0x18cff3[_0x8e55('0x24')](_0x5da956);}}_0x5f25fd({'count':_0x18cff3[_0x8e55('0x1d')],'rows':_0x18cff3});});},'MailQueues':function(){return new Promise(function(_0x4c39f5){var _0x40f069=[];for(var _0x216c15 in _0x2a5545['mailQueues']){if(_0x2a5545['mailQueues'][_0x8e55('0x52')](_0x216c15)){var _0x40bc32=_0x2a5545[_0x8e55('0x5d')][_0x216c15];var _0x28efd2={'id':_0x40bc32['id'],'available':_0x40bc32['available'],'loggedIn':_0x40bc32['loggedIn'],'name':_0x40bc32[_0x8e55('0x5a')],'paused':_0x40bc32[_0x8e55('0x5b')],'waiting':_0x40bc32['waiting']};_0x40f069[_0x8e55('0x24')](_0x28efd2);}}_0x4c39f5({'count':_0x40f069[_0x8e55('0x1d')],'rows':_0x40f069});});},'OpenchannelQueues':function(){return new Promise(function(_0x5ebe20){var _0x1d630d=[];for(var _0x2ba40a in _0x2a5545[_0x8e55('0x5e')]){if(_0x2a5545[_0x8e55('0x5e')][_0x8e55('0x52')](_0x2ba40a)){var _0x2393c0=_0x2a5545[_0x8e55('0x5e')][_0x2ba40a];var _0x40212b={'id':_0x2393c0['id'],'available':_0x2393c0[_0x8e55('0x59')],'loggedIn':_0x2393c0[_0x8e55('0x5f')],'name':_0x2393c0[_0x8e55('0x5a')],'paused':_0x2393c0[_0x8e55('0x5b')],'waiting':_0x2393c0[_0x8e55('0x5c')]};_0x1d630d[_0x8e55('0x24')](_0x40212b);}}_0x5ebe20({'count':_0x1d630d[_0x8e55('0x1d')],'rows':_0x1d630d});});},'SmsQueues':function(){return new Promise(function(_0x616c46){var _0x23e1c6=[];for(var _0x5d7470 in _0x2a5545[_0x8e55('0x60')]){if(_0x2a5545['smsQueues']['hasOwnProperty'](_0x5d7470)){var _0xa1693e=_0x2a5545[_0x8e55('0x60')][_0x5d7470];var _0x3b19b8={'id':_0xa1693e['id'],'available':_0xa1693e[_0x8e55('0x59')],'loggedIn':_0xa1693e[_0x8e55('0x5f')],'name':_0xa1693e['name'],'paused':_0xa1693e[_0x8e55('0x5b')],'waiting':_0xa1693e['waiting']};_0x23e1c6[_0x8e55('0x24')](_0x3b19b8);}}_0x616c46({'count':_0x23e1c6[_0x8e55('0x1d')],'rows':_0x23e1c6});});},'FaxQueues':function(){return new Promise(function(_0x32b3a3){var _0x2361bc=[];for(var _0x2a06aa in _0x2a5545[_0x8e55('0x61')]){if(_0x2a5545['faxQueues'][_0x8e55('0x52')](_0x2a06aa)){var _0x5da963=_0x2a5545[_0x8e55('0x61')][_0x2a06aa];var _0x1c48f7={'id':_0x5da963['id'],'available':_0x5da963[_0x8e55('0x59')],'loggedIn':_0x5da963['loggedIn'],'name':_0x5da963[_0x8e55('0x5a')],'paused':_0x5da963[_0x8e55('0x5b')],'waiting':_0x5da963['waiting']};_0x2361bc['push'](_0x1c48f7);}}_0x32b3a3({'count':_0x2361bc[_0x8e55('0x1d')],'rows':_0x2361bc});});},'WhatsappQueues':function(){return new Promise(function(_0x3c6fab){var _0x1c183c=[];for(var _0x41f7c2 in _0x2a5545[_0x8e55('0x62')]){if(_0x2a5545[_0x8e55('0x62')][_0x8e55('0x52')](_0x41f7c2)){var _0x42d2b6=_0x2a5545[_0x8e55('0x62')][_0x41f7c2];var _0x1ed3ba={'id':_0x42d2b6['id'],'available':_0x42d2b6[_0x8e55('0x59')],'loggedIn':_0x42d2b6[_0x8e55('0x5f')],'name':_0x42d2b6[_0x8e55('0x5a')],'paused':_0x42d2b6[_0x8e55('0x5b')],'waiting':_0x42d2b6['waiting']};_0x1c183c[_0x8e55('0x24')](_0x1ed3ba);}}_0x3c6fab({'count':_0x1c183c['length'],'rows':_0x1c183c});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x310233){var _0x424549=_[_0x8e55('0x56')](_0x2a5545[_0x8e55('0x63')]);_0x310233({'count':_0x424549['length'],'rows':_0x424549});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x44f214){var _0xca6ddb=_[_0x8e55('0x56')](_0x2a5545[_0x8e55('0x64')]);_0x44f214({'count':_0xca6ddb['length'],'rows':_0xca6ddb});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x2d5a90){var _0x40466=_[_0x8e55('0x56')](_0x2a5545[_0x8e55('0x65')]);_0x2d5a90({'count':_0x40466['length'],'rows':_0x40466});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0xf9e173){var _0x2ae7ac=_['values'](_0x2a5545[_0x8e55('0x66')]);_0xf9e173({'count':_0x2ae7ac['length'],'rows':_0x2ae7ac});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x27428d){var _0x28b0d2=_[_0x8e55('0x56')](_0x2a5545[_0x8e55('0x67')]);_0x27428d({'count':_0x28b0d2[_0x8e55('0x1d')],'rows':_0x28b0d2});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x549705){var _0x566c11=_[_0x8e55('0x56')](_0x2a5545[_0x8e55('0x68')]);_0x549705({'count':_0x566c11[_0x8e55('0x1d')],'rows':_0x566c11});});}};var _0x384e3a=jayson[_0x8e55('0x69')](_0x125388)[_0x8e55('0x6a')]();_0x384e3a['on'](_0x8e55('0x45'),function(_0x3bd7f4){logger[_0x8e55('0x45')](JSON[_0x8e55('0x40')](_0x3bd7f4));return _0x8cbfc7(_0x3bd7f4);});_0x384e3a[_0x8e55('0x14')](0x232c,_0x8e55('0x6b'),function(){console[_0x8e55('0x6c')](_0x8e55('0x6d'),0x232c);return _0x2b5a04('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 52ef920..402f82f 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 _0x1b12=['all','some','[%s][INTERVAL]\x20%s\x20%s','join','when','stack','stop','bluebird','jayson/promise','lodash','../../../config/logger','client','http','request','then','error','message','result','catch','condition','rules','info','push','Command','iftime\x20%s','true'];(function(_0x161883,_0x693d30){var _0xa75f56=function(_0x3e24fc){while(--_0x3e24fc){_0x161883['push'](_0x161883['shift']());}};_0xa75f56(++_0x693d30);}(_0x1b12,0x10b));var _0x21b1=function(_0x411b66,_0x16c586){_0x411b66=_0x411b66-0x0;var _0x1cd278=_0x1b12[_0x411b66];return _0x1cd278;};'use strict';var util=require('util');var BPromise=require(_0x21b1('0x0'));var jayson=require(_0x21b1('0x1'));var _=require(_0x21b1('0x2'));var logger=require(_0x21b1('0x3'))('routing');var client=jayson[_0x21b1('0x4')][_0x21b1('0x5')]({'port':0x232a});function request(_0x5658db,_0x583e2b){return new BPromise(function(_0x45a2b0,_0x1fe5f5){return client[_0x21b1('0x6')](_0x5658db,_0x583e2b)[_0x21b1('0x7')](function(_0x63acbd){if(_0x63acbd[_0x21b1('0x8')]){return _0x1fe5f5(_0x63acbd['error'][_0x21b1('0x9')]);}else{return _0x45a2b0(_0x63acbd[_0x21b1('0xa')]);}})[_0x21b1('0xb')](function(_0xa0a07){return _0x1fe5f5(_0xa0a07);});});}exports[_0x21b1('0xc')]=function(_0x485cb7,_0x27f9cd,_0x551b4e){return function(_0x12e41a){if(_0x551b4e[_0x21b1('0xd')]&&!_0x551b4e['rules'][_0x485cb7]){logger[_0x21b1('0xe')]('[%s][INTERVAL]\x20ROUTING\x20STOPPED',_0x485cb7);return _0x12e41a['stop']();}var _0x594dcd=[];for(var _0x5aae44=0x0;_0x5aae44<_0x27f9cd['length'];_0x5aae44+=0x1){_0x594dcd[_0x21b1('0xf')](request(_0x21b1('0x10'),{'command':util['format'](_0x21b1('0x11'),_0x27f9cd[_0x5aae44])})[_0x21b1('0x7')](function(_0x35a0e2){return _0x35a0e2&&_0x35a0e2[_0x21b1('0x9')]&&_0x35a0e2[_0x21b1('0x9')]['indexOf'](_0x21b1('0x12'))>=0x0?!![]:![];})[_0x21b1('0xb')](function(_0x4bd168){logger[_0x21b1('0x8')]('[%s][INTERVAL]\x20%s',_0x485cb7,_0x27f9cd[_0x5aae44]);}));}BPromise[_0x21b1('0x13')](_0x594dcd)[_0x21b1('0x7')](function(_0x4377d4){var _0x5eca68=_[_0x21b1('0x14')](_0x4377d4);logger['info'](_0x21b1('0x15'),_0x485cb7,_0x27f9cd[_0x21b1('0x16')]('\x20|\x20'),_0x5eca68);_0x12e41a[_0x21b1('0x17')](_0x5eca68);})[_0x21b1('0xb')](function(_0x211ea7){console['log'](_0x211ea7);logger[_0x21b1('0x8')](_0x21b1('0x15'),_0x485cb7,_0x27f9cd[_0x21b1('0x16')]('\x20|\x20'),_0x211ea7[_0x21b1('0x18')]);_0x12e41a[_0x21b1('0x19')]();});};}; \ No newline at end of file +var _0x6e14=['stop','lodash','../../../utils/iftime','../../../config/logger','condition','rules','info','map','some','[%s][INTERVAL\x20VALID]\x20%s\x20%s','join','\x20|\x20','when','[%s][INTERVAL\x20NOT\x20VALID]\x20%s\x20%s'];(function(_0x3538b6,_0x388d64){var _0x3aa3ed=function(_0x459385){while(--_0x459385){_0x3538b6['push'](_0x3538b6['shift']());}};_0x3aa3ed(++_0x388d64);}(_0x6e14,0x15f));var _0x46e1=function(_0x26d018,_0xedb83d){_0x26d018=_0x26d018-0x0;var _0x296c00=_0x6e14[_0x26d018];return _0x296c00;};'use strict';var _=require(_0x46e1('0x0'));var iftime=require(_0x46e1('0x1'))['iftime'];var logger=require(_0x46e1('0x2'))('routing');exports[_0x46e1('0x3')]=function(_0x1719ef,_0x523663,_0x54d8a7){return function(_0x3c70d0){if(_0x54d8a7[_0x46e1('0x4')]&&!_0x54d8a7['rules'][_0x1719ef]){logger[_0x46e1('0x5')]('[%s][INTERVAL]\x20ROUTING\x20STOPPED',_0x1719ef);return _0x3c70d0['stop']();}var _0xc2c20=_0x523663[_0x46e1('0x6')](function(_0x3182af){return iftime(_0x3182af);});var _0x1f2aba=_[_0x46e1('0x7')](_0xc2c20);if(_0x1f2aba){logger['info'](_0x46e1('0x8'),_0x1719ef,_0x523663[_0x46e1('0x9')](_0x46e1('0xa')),_0x1f2aba);_0x3c70d0[_0x46e1('0xb')](_0x1f2aba);}else{logger[_0x46e1('0x5')](_0x46e1('0xc'),_0x1719ef,_0x523663[_0x46e1('0x9')](_0x46e1('0xa')));_0x3c70d0[_0x46e1('0xd')]();}};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index a72c231..b26b29a 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 _0xb688=['agentconnect','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','connect','answered_elsewhere','answeredelsewheremembername','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diffTime','agentconnectAt','complete','blindtransfer','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfereruniqueid','transfertype','extension','transferuniqueid','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','transfer','ATTENDED','transferexten','transfereeuniqueid','agententerreason','clone','calleridname','secondtransfererexten','transfertargetuniqueid','hangup','[%s][agents][hangup]','cause','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','splice','agent','util','./utils','info','format','uniqueid','channel','queue','membername','calleridnum','lastevent','getVoiceQueueByName','then','type','agentacw','agentcomplete','acw','acwtime','request','CreateVoiceAgentReport','destuniqueid','agentcalled','debug','[%s][agents][agentcalled]','agentcalledAt','now','called','connectedlinenum','connectedlinename','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','timeout','holdtime','ringtime','push','queuecallerabandon','forIn','includes','agentringnoanswerAt','abandoned','reason','talktime','[%s][agents][queuecallerabandon]'];(function(_0x39a321,_0x18ebe3){var _0x2f90eb=function(_0xf940a8){while(--_0xf940a8){_0x39a321['push'](_0x39a321['shift']());}};_0x2f90eb(++_0x18ebe3);}(_0xb688,0xcf));var _0x8b68=function(_0x5d7463,_0x5d2f43){_0x5d7463=_0x5d7463-0x0;var _0x4dfc33=_0xb688[_0x5d7463];return _0x4dfc33;};'use strict';var _=require('lodash');var util=require(_0x8b68('0x0'));var utils=require(_0x8b68('0x1'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x266285,_0x1080e8){utils[_0x8b68('0x2')](util[_0x8b68('0x3')]('[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x266285[_0x8b68('0x4')],_0x266285[_0x8b68('0x5')],_0x266285[_0x8b68('0x6')],_0x266285[_0x8b68('0x7')],_0x266285['interface'],_0x266285[_0x8b68('0x8')],_0x266285['connectedlinenum'],_0x266285[_0x8b68('0x9')]));if(_0x266285[_0x8b68('0x6')]){utils[_0x8b68('0xa')](_0x266285[_0x8b68('0x6')])[_0x8b68('0xb')](function(_0x3f9685){if(_0x3f9685){_0x266285[_0x8b68('0xc')]=_0x3f9685[_0x8b68('0xc')];_0x266285[_0x8b68('0xd')]=_0x266285[_0x8b68('0xe')]?_0x3f9685[_0x8b68('0xf')]:![];_0x266285[_0x8b68('0x10')]=_0x266285[_0x8b68('0xd')]?_0x3f9685['acwTimeout']:0x0;}utils[_0x8b68('0x11')](_0x8b68('0x12'),_0x266285);});}else{utils[_0x8b68('0x11')](_0x8b68('0x12'),_0x266285);}if(_0x1080e8){delete transfers[_0x266285[_0x8b68('0x4')]];}else{delete agents[_0x266285[_0x8b68('0x13')]];}}exports[_0x8b68('0x14')]=function(_0x137c8e){try{utils[_0x8b68('0x15')](util['format'](_0x8b68('0x16'),_0x137c8e['uniqueid']),_0x137c8e);agents[_0x137c8e['destuniqueid']]=_0x137c8e;agents[_0x137c8e[_0x8b68('0x13')]][_0x8b68('0x17')]=utils[_0x8b68('0x18')]();agents[_0x137c8e['destuniqueid']]['lastevent']=_0x8b68('0x19');agents[_0x137c8e['destuniqueid']][_0x8b68('0x1a')]=null;agents[_0x137c8e[_0x8b68('0x13')]][_0x8b68('0x1b')]=null;utils[_0x8b68('0x2')](util['format'](_0x8b68('0x1c'),_0x137c8e[_0x8b68('0x4')],agents[_0x137c8e['destuniqueid']][_0x8b68('0x7')],_0x137c8e[_0x8b68('0x13')]));}catch(_0x3cf3bd){utils[_0x8b68('0x1d')](util[_0x8b68('0x3')]('[%s][agents][agentcalled]',_0x137c8e[_0x8b68('0x4')]),_0x3cf3bd);}};exports[_0x8b68('0x1e')]=function(_0x59e9b1){try{if(!_[_0x8b68('0x1f')](agents[_0x59e9b1[_0x8b68('0x13')]])){utils[_0x8b68('0x15')](util['format']('[%s][agents][agentringnoanswer]',_0x59e9b1[_0x8b68('0x4')]),_0x59e9b1);utils['info'](util[_0x8b68('0x3')](_0x8b68('0x20'),_0x59e9b1[_0x8b68('0x4')],agents[_0x59e9b1[_0x8b68('0x13')]][_0x8b68('0x7')],_0x59e9b1[_0x8b68('0x13')]));agents[_0x59e9b1['destuniqueid']][_0x8b68('0x1e')]=!![];agents[_0x59e9b1[_0x8b68('0x13')]]['agentringnoanswerAt']=utils[_0x8b68('0x18')]();agents[_0x59e9b1[_0x8b68('0x13')]][_0x8b68('0x9')]='timeout';agents[_0x59e9b1['destuniqueid']]['reason']=_0x8b68('0x21');agents[_0x59e9b1[_0x8b68('0x13')]][_0x8b68('0x22')]=_0x59e9b1['ringtime']?parseInt(_0x59e9b1[_0x8b68('0x23')])/0x3e8:0x0;agents[_0x59e9b1['destuniqueid']]['talktime']=0x0;unanswered[_0x8b68('0x24')](_0x59e9b1['destuniqueid']);}}catch(_0x26cad7){utils[_0x8b68('0x1d')](util['format']('[%s][agents][agentringnoanswer]',_0x59e9b1[_0x8b68('0x4')]),_0x26cad7);}};exports[_0x8b68('0x25')]=function(_0x1e7c06){try{_[_0x8b68('0x26')](agents,function(_0x210926,_0x2ad2df){if(_0x210926[_0x8b68('0x4')]==_0x1e7c06['uniqueid']&&!_[_0x8b68('0x27')](unanswered,_0x210926['destuniqueid'])){utils[_0x8b68('0x15')](util[_0x8b68('0x3')]('[%s][agents][queuecallerabandon]',_0x1e7c06[_0x8b68('0x4')]),_0x1e7c06);utils[_0x8b68('0x2')](util[_0x8b68('0x3')]('[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned',_0x1e7c06['uniqueid'],_0x210926[_0x8b68('0x7')],_0x210926[_0x8b68('0x13')]));_0x210926[_0x8b68('0x1e')]=!![];_0x210926[_0x8b68('0x28')]=utils[_0x8b68('0x18')]();_0x210926[_0x8b68('0x9')]=_0x8b68('0x29');_0x210926[_0x8b68('0x2a')]=_0x8b68('0x29');_0x210926[_0x8b68('0x22')]=_0x1e7c06[_0x8b68('0x22')];_0x210926[_0x8b68('0x2b')]=0x0;writeDB(_0x210926);}});}catch(_0x232fa9){utils[_0x8b68('0x1d')](util[_0x8b68('0x3')](_0x8b68('0x2c'),_0x1e7c06[_0x8b68('0x4')]),_0x232fa9);}};exports[_0x8b68('0x2d')]=function(_0x120b34){try{if(agents[_0x120b34[_0x8b68('0x13')]]){utils[_0x8b68('0x15')](util[_0x8b68('0x3')]('[%s][agents][agentconnect]',_0x120b34['uniqueid']),_0x120b34);utils[_0x8b68('0x2')](util[_0x8b68('0x3')](_0x8b68('0x2e'),_0x120b34[_0x8b68('0x4')],agents[_0x120b34[_0x8b68('0x13')]][_0x8b68('0x7')],_0x120b34[_0x8b68('0x13')]));agents[_0x120b34[_0x8b68('0x13')]]['agentconnectAt']=utils[_0x8b68('0x18')]();agents[_0x120b34[_0x8b68('0x13')]][_0x8b68('0x1a')]=_0x120b34[_0x8b68('0x1a')];agents[_0x120b34[_0x8b68('0x13')]][_0x8b68('0x1b')]=_0x120b34[_0x8b68('0x1b')];agents[_0x120b34[_0x8b68('0x13')]]['holdtime']=_0x120b34[_0x8b68('0x23')];agents[_0x120b34[_0x8b68('0x13')]][_0x8b68('0x9')]=_0x8b68('0x2f');_[_0x8b68('0x26')](agents,function(_0x3b3394,_0xa748c2){if(_0x3b3394['destuniqueid']!=_0x120b34[_0x8b68('0x13')]&&_0x3b3394[_0x8b68('0x4')]==_0x120b34['uniqueid']){_0x3b3394[_0x8b68('0x2b')]=0x0;_0x3b3394[_0x8b68('0x22')]=_0x120b34['ringtime'];_0x3b3394['agentringnoanswer']=!![];_0x3b3394['agentringnoanswerAt']=utils['now']();_0x3b3394[_0x8b68('0x9')]=_0x8b68('0x30');_0x3b3394['reason']=_0x8b68('0x30');_0x3b3394['answeredelsewheredestinationuniqueid']=_0x120b34[_0x8b68('0x13')];_0x3b3394[_0x8b68('0x31')]=_0x120b34['membername'];writeDB(_0x3b3394);}});}}catch(_0x2f90d9){utils['error'](util['format']('[%s][agents][agentconnect]',_0x120b34[_0x8b68('0x4')]),_0x2f90d9);}};exports[_0x8b68('0xe')]=function(_0x3ba80e){try{if(!_[_0x8b68('0x1f')](agents[_0x3ba80e['destuniqueid']])){utils[_0x8b68('0x15')](util['format'](_0x8b68('0x32'),_0x3ba80e[_0x8b68('0x4')]),_0x3ba80e);utils['info'](util[_0x8b68('0x3')](_0x8b68('0x33'),_0x3ba80e[_0x8b68('0x4')],agents[_0x3ba80e[_0x8b68('0x13')]]['membername'],_0x3ba80e[_0x8b68('0x13')]));agents[_0x3ba80e[_0x8b68('0x13')]][_0x8b68('0xe')]=!![];agents[_0x3ba80e[_0x8b68('0x13')]][_0x8b68('0x34')]=utils[_0x8b68('0x18')]();agents[_0x3ba80e[_0x8b68('0x13')]][_0x8b68('0x2b')]=utils[_0x8b68('0x35')](agents[_0x3ba80e[_0x8b68('0x13')]][_0x8b68('0x34')],agents[_0x3ba80e[_0x8b68('0x13')]][_0x8b68('0x36')]);agents[_0x3ba80e[_0x8b68('0x13')]][_0x8b68('0x2a')]=_0x3ba80e[_0x8b68('0x2a')];agents[_0x3ba80e['destuniqueid']][_0x8b68('0x9')]=_0x8b68('0x37');writeDB(agents[_0x3ba80e['destuniqueid']]);}}catch(_0xeab810){utils['error'](util['format']('[%s][agents][agentcomplete]',_0x3ba80e[_0x8b68('0x4')]),_0xeab810);}};exports[_0x8b68('0x38')]=function(_0x34047c){try{if(!_[_0x8b68('0x1f')](agents[_0x34047c['transfereruniqueid']])){utils['debug'](util[_0x8b68('0x3')](_0x8b68('0x39'),_0x34047c[_0x8b68('0x4')]),_0x34047c);utils['info'](util[_0x8b68('0x3')](_0x8b68('0x3a'),_0x34047c['uniqueid'],agents[_0x34047c[_0x8b68('0x3b')]][_0x8b68('0x7')],agents[_0x34047c['transfereruniqueid']][_0x8b68('0x4')]));agents[_0x34047c[_0x8b68('0x3b')]]['transfer']=!![];agents[_0x34047c[_0x8b68('0x3b')]][_0x8b68('0x3c')]='blind';agents[_0x34047c['transfereruniqueid']]['transferexten']=_0x34047c[_0x8b68('0x3d')];agents[_0x34047c[_0x8b68('0x3b')]][_0x8b68('0x3e')]=agents[_0x34047c[_0x8b68('0x3b')]]['uniqueid'];}}catch(_0x5a1711){utils[_0x8b68('0x1d')](util[_0x8b68('0x3')](_0x8b68('0x39'),_0x34047c['uniqueid']),_0x5a1711);}};exports[_0x8b68('0x3f')]=function(_0xe1ba20){try{utils[_0x8b68('0x15')](util['format'](_0x8b68('0x40'),_0xe1ba20['origtransfereruniqueid']),_0xe1ba20);if(_0xe1ba20[_0x8b68('0x41')]==_0xe1ba20[_0x8b68('0x42')]){if(!_['isNil'](agents[_0xe1ba20[_0x8b68('0x43')]])){utils[_0x8b68('0x2')](util[_0x8b68('0x3')](_0x8b68('0x44'),_0xe1ba20[_0x8b68('0x41')],agents[_0xe1ba20['secondtransfereruniqueid']][_0x8b68('0x7')]));agents[_0xe1ba20[_0x8b68('0x43')]][_0x8b68('0x45')]=!![];agents[_0xe1ba20[_0x8b68('0x43')]][_0x8b68('0x3c')]=_0x8b68('0x46');agents[_0xe1ba20[_0x8b68('0x43')]][_0x8b68('0x47')]=_0xe1ba20['origtransfererexten'];agents[_0xe1ba20[_0x8b68('0x43')]][_0x8b68('0x3e')]=_0xe1ba20[_0x8b68('0x41')];}if(_0xe1ba20[_0x8b68('0x48')]&&agents[_0xe1ba20[_0x8b68('0x48')]]){agents[_0xe1ba20[_0x8b68('0x48')]][_0x8b68('0x49')]=0x1;transfers[_0xe1ba20[_0x8b68('0x48')]]=_[_0x8b68('0x4a')](agents[_0xe1ba20[_0x8b68('0x48')]]);transfers[_0xe1ba20[_0x8b68('0x48')]][_0x8b68('0x8')]=agents[_0xe1ba20[_0x8b68('0x43')]][_0x8b68('0x8')];transfers[_0xe1ba20[_0x8b68('0x48')]][_0x8b68('0x4b')]=agents[_0xe1ba20[_0x8b68('0x43')]][_0x8b68('0x4b')];transfers[_0xe1ba20[_0x8b68('0x48')]][_0x8b68('0x17')]=utils['now']();transfers[_0xe1ba20[_0x8b68('0x48')]]['agentconnectAt']=utils['now']();transfers[_0xe1ba20[_0x8b68('0x48')]]['holdtime']=0x0;transfers[_0xe1ba20[_0x8b68('0x48')]][_0x8b68('0x49')]=0x2;}}else if(_0xe1ba20[_0x8b68('0x43')]==_0xe1ba20['secondtransfererlinkedid']){if(!_[_0x8b68('0x1f')](agents[_0xe1ba20[_0x8b68('0x41')]])){utils[_0x8b68('0x2')](util[_0x8b68('0x3')](_0x8b68('0x44'),_0xe1ba20[_0x8b68('0x41')],agents[_0xe1ba20[_0x8b68('0x41')]]['membername']));agents[_0xe1ba20['origtransfereruniqueid']][_0x8b68('0x45')]=!![];agents[_0xe1ba20[_0x8b68('0x41')]][_0x8b68('0x3c')]=_0x8b68('0x46');agents[_0xe1ba20[_0x8b68('0x41')]][_0x8b68('0x47')]=_0xe1ba20[_0x8b68('0x4c')];agents[_0xe1ba20[_0x8b68('0x41')]][_0x8b68('0x3e')]=_0xe1ba20[_0x8b68('0x43')];}if(_0xe1ba20[_0x8b68('0x4d')]&&agents[_0xe1ba20[_0x8b68('0x4d')]]){agents[_0xe1ba20[_0x8b68('0x4d')]][_0x8b68('0x49')]=0x1;transfers[_0xe1ba20[_0x8b68('0x4d')]]=_[_0x8b68('0x4a')](agents[_0xe1ba20[_0x8b68('0x4d')]]);transfers[_0xe1ba20[_0x8b68('0x4d')]]['calleridnum']=agents[_0xe1ba20['origtransfereruniqueid']][_0x8b68('0x8')];transfers[_0xe1ba20[_0x8b68('0x4d')]]['calleridname']=agents[_0xe1ba20['origtransfereruniqueid']]['calleridname'];transfers[_0xe1ba20[_0x8b68('0x4d')]][_0x8b68('0x17')]=utils[_0x8b68('0x18')]();transfers[_0xe1ba20[_0x8b68('0x4d')]][_0x8b68('0x36')]=utils['now']();transfers[_0xe1ba20[_0x8b68('0x4d')]][_0x8b68('0x22')]=0x0;transfers[_0xe1ba20['transfertargetuniqueid']][_0x8b68('0x49')]=0x2;}}}catch(_0x5aa883){utils['error'](util['format'](_0x8b68('0x40'),_0xe1ba20[_0x8b68('0x41')]),_0x5aa883);}};exports[_0x8b68('0x4e')]=function(_0x7269fd){try{utils[_0x8b68('0x15')](util[_0x8b68('0x3')](_0x8b68('0x4f'),_0x7269fd[_0x8b68('0x4')]),_0x7269fd);if(agents[_0x7269fd[_0x8b68('0x4')]]&&agents[_0x7269fd[_0x8b68('0x4')]]['reason']===_0x8b68('0x21')){if(_0x7269fd[_0x8b68('0x50')]==='21'){agents[_0x7269fd[_0x8b68('0x4')]]['reason']='rejected';agents[_0x7269fd[_0x8b68('0x4')]][_0x8b68('0x9')]='rejected';}utils[_0x8b68('0x2')](util[_0x8b68('0x3')](_0x8b68('0x51'),_0x7269fd[_0x8b68('0x4')],agents[_0x7269fd['uniqueid']][_0x8b68('0x7')],agents[_0x7269fd['uniqueid']]['reason'],agents[_0x7269fd[_0x8b68('0x4')]]['lastevent']));writeDB(agents[_0x7269fd[_0x8b68('0x4')]]);var _0x385eda=unanswered['indexOf'](_0x7269fd[_0x8b68('0x4')]);if(_0x385eda>-0x1){unanswered[_0x8b68('0x52')](_0x385eda,0x1);}}if(transfers[_0x7269fd[_0x8b68('0x4')]]){transfers[_0x7269fd[_0x8b68('0x4')]][_0x8b68('0xe')]=!![];transfers[_0x7269fd['uniqueid']][_0x8b68('0x34')]=utils[_0x8b68('0x18')]();transfers[_0x7269fd[_0x8b68('0x4')]][_0x8b68('0x2b')]=utils[_0x8b68('0x35')](transfers[_0x7269fd['uniqueid']]['agentcompleteAt'],transfers[_0x7269fd[_0x8b68('0x4')]]['agentconnectAt']);transfers[_0x7269fd[_0x8b68('0x4')]][_0x8b68('0x2a')]=_0x8b68('0x53');transfers[_0x7269fd[_0x8b68('0x4')]][_0x8b68('0x9')]=_0x8b68('0x37');utils[_0x8b68('0x2')](util['format'](_0x8b68('0x51'),_0x7269fd['uniqueid'],transfers[_0x7269fd[_0x8b68('0x4')]][_0x8b68('0x7')],transfers[_0x7269fd[_0x8b68('0x4')]]['reason'],transfers[_0x7269fd[_0x8b68('0x4')]]['lastevent']));writeDB(transfers[_0x7269fd[_0x8b68('0x4')]],!![]);}if(agents[_0x7269fd['uniqueid']]&&agents[_0x7269fd[_0x8b68('0x4')]][_0x8b68('0x36')]){agents[_0x7269fd[_0x8b68('0x4')]]['agentcomplete']=!![];agents[_0x7269fd[_0x8b68('0x4')]][_0x8b68('0x34')]=utils[_0x8b68('0x18')]();agents[_0x7269fd[_0x8b68('0x4')]][_0x8b68('0x2b')]=utils[_0x8b68('0x35')](agents[_0x7269fd[_0x8b68('0x4')]][_0x8b68('0x34')],agents[_0x7269fd[_0x8b68('0x4')]]['agentconnectAt']);agents[_0x7269fd[_0x8b68('0x4')]][_0x8b68('0x2a')]=agents[_0x7269fd[_0x8b68('0x4')]][_0x8b68('0x45')]?_0x8b68('0x45'):'agent';agents[_0x7269fd[_0x8b68('0x4')]]['lastevent']=_0x8b68('0x37');utils[_0x8b68('0x2')](util['format'](_0x8b68('0x51'),_0x7269fd[_0x8b68('0x4')],agents[_0x7269fd[_0x8b68('0x4')]]['membername'],agents[_0x7269fd[_0x8b68('0x4')]][_0x8b68('0x2a')],agents[_0x7269fd[_0x8b68('0x4')]][_0x8b68('0x9')]));writeDB(agents[_0x7269fd[_0x8b68('0x4')]]);}}catch(_0x42464c){utils['error'](util[_0x8b68('0x3')](_0x8b68('0x4f'),_0x7269fd[_0x8b68('0x4')]),_0x42464c);}}; \ No newline at end of file +var _0x0972=['clone','calleridname','[%s][agents][attendedtransfer]','hangup','[%s][agents][hangup]','timeout','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','agent','util','info','format','uniqueid','channel','queue','membername','interface','calleridnum','connectedlinenum','getVoiceQueueByName','then','type','agentacw','agentcomplete','acw','acwtime','acwTimeout','request','CreateVoiceAgentReport','destuniqueid','agentcalled','debug','[%s][agents][agentcalled]','agentcalledAt','now','connectedlinename','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','isNil','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswer','agentringnoanswerAt','lastevent','reason','ringtime','talktime','push','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','holdtime','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','connect','answered_elsewhere','answeredelsewheremembername','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diffTime','agentconnectAt','complete','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfertype','transferexten','extension','transferuniqueid','origtransfererlinkedid','[%s][agents][attendedtransfer]\x20agent:%s','origtransfereruniqueid','secondtransfereruniqueid','transfer','origtransfererexten','transfereeuniqueid','agententerreason','secondtransfererlinkedid','ATTENDED','secondtransfererexten','transfertargetuniqueid'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0972,0x64));var _0x2097=function(_0x49d569,_0x4d537a){_0x49d569=_0x49d569-0x0;var _0x3de734=_0x0972[_0x49d569];return _0x3de734;};'use strict';var _=require('lodash');var util=require(_0x2097('0x0'));var utils=require('./utils');var agents={};var transfers={};var unanswered=[];function writeDB(_0x1c7a40,_0x4ec7aa){utils[_0x2097('0x1')](util[_0x2097('0x2')]('[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x1c7a40[_0x2097('0x3')],_0x1c7a40[_0x2097('0x4')],_0x1c7a40[_0x2097('0x5')],_0x1c7a40[_0x2097('0x6')],_0x1c7a40[_0x2097('0x7')],_0x1c7a40[_0x2097('0x8')],_0x1c7a40[_0x2097('0x9')],_0x1c7a40['lastevent']));if(_0x1c7a40[_0x2097('0x5')]){utils[_0x2097('0xa')](_0x1c7a40[_0x2097('0x5')])[_0x2097('0xb')](function(_0x3b8fac){if(_0x3b8fac){_0x1c7a40['type']=_0x3b8fac[_0x2097('0xc')];_0x1c7a40[_0x2097('0xd')]=_0x1c7a40[_0x2097('0xe')]?_0x3b8fac[_0x2097('0xf')]:![];_0x1c7a40[_0x2097('0x10')]=_0x1c7a40[_0x2097('0xd')]?_0x3b8fac[_0x2097('0x11')]:0x0;}utils[_0x2097('0x12')](_0x2097('0x13'),_0x1c7a40);});}else{utils[_0x2097('0x12')](_0x2097('0x13'),_0x1c7a40);}if(_0x4ec7aa){delete transfers[_0x1c7a40[_0x2097('0x3')]];}else{delete agents[_0x1c7a40[_0x2097('0x14')]];}}exports[_0x2097('0x15')]=function(_0x24ca42){try{utils[_0x2097('0x16')](util[_0x2097('0x2')](_0x2097('0x17'),_0x24ca42[_0x2097('0x3')]),_0x24ca42);agents[_0x24ca42[_0x2097('0x14')]]=_0x24ca42;agents[_0x24ca42['destuniqueid']][_0x2097('0x18')]=utils[_0x2097('0x19')]();agents[_0x24ca42['destuniqueid']]['lastevent']='called';agents[_0x24ca42[_0x2097('0x14')]]['connectedlinenum']=null;agents[_0x24ca42[_0x2097('0x14')]][_0x2097('0x1a')]=null;utils[_0x2097('0x1')](util[_0x2097('0x2')](_0x2097('0x1b'),_0x24ca42['uniqueid'],agents[_0x24ca42[_0x2097('0x14')]][_0x2097('0x6')],_0x24ca42[_0x2097('0x14')]));}catch(_0x34654a){utils[_0x2097('0x1c')](util[_0x2097('0x2')](_0x2097('0x17'),_0x24ca42[_0x2097('0x3')]),_0x34654a);}};exports['agentringnoanswer']=function(_0x4d957e){try{if(!_[_0x2097('0x1d')](agents[_0x4d957e['destuniqueid']])){utils[_0x2097('0x16')](util[_0x2097('0x2')]('[%s][agents][agentringnoanswer]',_0x4d957e[_0x2097('0x3')]),_0x4d957e);utils['info'](util[_0x2097('0x2')](_0x2097('0x1e'),_0x4d957e[_0x2097('0x3')],agents[_0x4d957e[_0x2097('0x14')]][_0x2097('0x6')],_0x4d957e[_0x2097('0x14')]));agents[_0x4d957e['destuniqueid']][_0x2097('0x1f')]=!![];agents[_0x4d957e['destuniqueid']][_0x2097('0x20')]=utils[_0x2097('0x19')]();agents[_0x4d957e[_0x2097('0x14')]][_0x2097('0x21')]='timeout';agents[_0x4d957e[_0x2097('0x14')]][_0x2097('0x22')]='timeout';agents[_0x4d957e[_0x2097('0x14')]]['holdtime']=_0x4d957e[_0x2097('0x23')]?parseInt(_0x4d957e['ringtime'])/0x3e8:0x0;agents[_0x4d957e[_0x2097('0x14')]][_0x2097('0x24')]=0x0;unanswered[_0x2097('0x25')](_0x4d957e[_0x2097('0x14')]);}}catch(_0x410afa){utils[_0x2097('0x1c')](util[_0x2097('0x2')]('[%s][agents][agentringnoanswer]',_0x4d957e[_0x2097('0x3')]),_0x410afa);}};exports[_0x2097('0x26')]=function(_0x5cce55){try{_[_0x2097('0x27')](agents,function(_0x41487d,_0x59fb84){if(_0x41487d['uniqueid']==_0x5cce55[_0x2097('0x3')]&&!_[_0x2097('0x28')](unanswered,_0x41487d[_0x2097('0x14')])){utils[_0x2097('0x16')](util[_0x2097('0x2')](_0x2097('0x29'),_0x5cce55['uniqueid']),_0x5cce55);utils[_0x2097('0x1')](util['format'](_0x2097('0x2a'),_0x5cce55[_0x2097('0x3')],_0x41487d[_0x2097('0x6')],_0x41487d[_0x2097('0x14')]));_0x41487d[_0x2097('0x1f')]=!![];_0x41487d[_0x2097('0x20')]=utils[_0x2097('0x19')]();_0x41487d[_0x2097('0x21')]=_0x2097('0x2b');_0x41487d['reason']=_0x2097('0x2b');_0x41487d[_0x2097('0x2c')]=_0x5cce55[_0x2097('0x2c')];_0x41487d['talktime']=0x0;writeDB(_0x41487d);}});}catch(_0x3d97ee){utils[_0x2097('0x1c')](util[_0x2097('0x2')](_0x2097('0x29'),_0x5cce55['uniqueid']),_0x3d97ee);}};exports['agentconnect']=function(_0x5689f6){try{if(agents[_0x5689f6[_0x2097('0x14')]]){utils[_0x2097('0x16')](util[_0x2097('0x2')](_0x2097('0x2d'),_0x5689f6[_0x2097('0x3')]),_0x5689f6);utils[_0x2097('0x1')](util['format'](_0x2097('0x2e'),_0x5689f6[_0x2097('0x3')],agents[_0x5689f6[_0x2097('0x14')]][_0x2097('0x6')],_0x5689f6[_0x2097('0x14')]));agents[_0x5689f6[_0x2097('0x14')]]['agentconnectAt']=utils[_0x2097('0x19')]();agents[_0x5689f6[_0x2097('0x14')]][_0x2097('0x9')]=_0x5689f6['connectedlinenum'];agents[_0x5689f6['destuniqueid']][_0x2097('0x1a')]=_0x5689f6[_0x2097('0x1a')];agents[_0x5689f6[_0x2097('0x14')]][_0x2097('0x2c')]=_0x5689f6[_0x2097('0x23')];agents[_0x5689f6[_0x2097('0x14')]][_0x2097('0x21')]=_0x2097('0x2f');_[_0x2097('0x27')](agents,function(_0x3bfb5c,_0x337979){if(_0x3bfb5c[_0x2097('0x14')]!=_0x5689f6['destuniqueid']&&_0x3bfb5c[_0x2097('0x3')]==_0x5689f6[_0x2097('0x3')]){_0x3bfb5c[_0x2097('0x24')]=0x0;_0x3bfb5c['holdtime']=_0x5689f6[_0x2097('0x23')];_0x3bfb5c[_0x2097('0x1f')]=!![];_0x3bfb5c[_0x2097('0x20')]=utils[_0x2097('0x19')]();_0x3bfb5c[_0x2097('0x21')]=_0x2097('0x30');_0x3bfb5c[_0x2097('0x22')]=_0x2097('0x30');_0x3bfb5c['answeredelsewheredestinationuniqueid']=_0x5689f6[_0x2097('0x14')];_0x3bfb5c[_0x2097('0x31')]=_0x5689f6[_0x2097('0x6')];writeDB(_0x3bfb5c);}});}}catch(_0x3288ae){utils[_0x2097('0x1c')](util[_0x2097('0x2')](_0x2097('0x2d'),_0x5689f6[_0x2097('0x3')]),_0x3288ae);}};exports['agentcomplete']=function(_0x3fc3fe){try{if(!_['isNil'](agents[_0x3fc3fe[_0x2097('0x14')]])){utils[_0x2097('0x16')](util[_0x2097('0x2')](_0x2097('0x32'),_0x3fc3fe[_0x2097('0x3')]),_0x3fc3fe);utils['info'](util[_0x2097('0x2')](_0x2097('0x33'),_0x3fc3fe[_0x2097('0x3')],agents[_0x3fc3fe[_0x2097('0x14')]][_0x2097('0x6')],_0x3fc3fe['destuniqueid']));agents[_0x3fc3fe[_0x2097('0x14')]][_0x2097('0xe')]=!![];agents[_0x3fc3fe[_0x2097('0x14')]][_0x2097('0x34')]=utils[_0x2097('0x19')]();agents[_0x3fc3fe[_0x2097('0x14')]][_0x2097('0x24')]=utils[_0x2097('0x35')](agents[_0x3fc3fe['destuniqueid']][_0x2097('0x34')],agents[_0x3fc3fe[_0x2097('0x14')]][_0x2097('0x36')]);agents[_0x3fc3fe[_0x2097('0x14')]]['reason']=_0x3fc3fe['reason'];agents[_0x3fc3fe['destuniqueid']][_0x2097('0x21')]=_0x2097('0x37');writeDB(agents[_0x3fc3fe['destuniqueid']]);}}catch(_0x10577d){utils[_0x2097('0x1c')](util['format']('[%s][agents][agentcomplete]',_0x3fc3fe[_0x2097('0x3')]),_0x10577d);}};exports[_0x2097('0x38')]=function(_0x1b4de6){try{if(!_['isNil'](agents[_0x1b4de6[_0x2097('0x39')]])){utils[_0x2097('0x16')](util['format'](_0x2097('0x3a'),_0x1b4de6[_0x2097('0x3')]),_0x1b4de6);utils[_0x2097('0x1')](util[_0x2097('0x2')](_0x2097('0x3b'),_0x1b4de6['uniqueid'],agents[_0x1b4de6['transfereruniqueid']][_0x2097('0x6')],agents[_0x1b4de6[_0x2097('0x39')]][_0x2097('0x3')]));agents[_0x1b4de6['transfereruniqueid']]['transfer']=!![];agents[_0x1b4de6[_0x2097('0x39')]][_0x2097('0x3c')]='blind';agents[_0x1b4de6[_0x2097('0x39')]][_0x2097('0x3d')]=_0x1b4de6[_0x2097('0x3e')];agents[_0x1b4de6[_0x2097('0x39')]][_0x2097('0x3f')]=agents[_0x1b4de6['transfereruniqueid']][_0x2097('0x3')];}}catch(_0x228b60){utils[_0x2097('0x1c')](util['format'](_0x2097('0x3a'),_0x1b4de6[_0x2097('0x3')]),_0x228b60);}};exports['attendedtransfer']=function(_0x12ba76){try{utils['debug'](util[_0x2097('0x2')]('[%s][agents][attendedtransfer]',_0x12ba76['origtransfereruniqueid']),_0x12ba76);if(_0x12ba76['origtransfereruniqueid']==_0x12ba76[_0x2097('0x40')]){if(!_['isNil'](agents[_0x12ba76['secondtransfereruniqueid']])){utils[_0x2097('0x1')](util['format'](_0x2097('0x41'),_0x12ba76[_0x2097('0x42')],agents[_0x12ba76['secondtransfereruniqueid']][_0x2097('0x6')]));agents[_0x12ba76[_0x2097('0x43')]][_0x2097('0x44')]=!![];agents[_0x12ba76[_0x2097('0x43')]][_0x2097('0x3c')]='ATTENDED';agents[_0x12ba76[_0x2097('0x43')]]['transferexten']=_0x12ba76[_0x2097('0x45')];agents[_0x12ba76[_0x2097('0x43')]][_0x2097('0x3f')]=_0x12ba76['origtransfereruniqueid'];}if(_0x12ba76[_0x2097('0x46')]&&agents[_0x12ba76[_0x2097('0x46')]]){agents[_0x12ba76[_0x2097('0x46')]][_0x2097('0x47')]=0x1;transfers[_0x12ba76[_0x2097('0x46')]]=_['clone'](agents[_0x12ba76['transfereeuniqueid']]);transfers[_0x12ba76[_0x2097('0x46')]][_0x2097('0x8')]=agents[_0x12ba76['secondtransfereruniqueid']]['calleridnum'];transfers[_0x12ba76['transfereeuniqueid']]['calleridname']=agents[_0x12ba76[_0x2097('0x43')]]['calleridname'];transfers[_0x12ba76[_0x2097('0x46')]][_0x2097('0x18')]=utils['now']();transfers[_0x12ba76[_0x2097('0x46')]][_0x2097('0x36')]=utils[_0x2097('0x19')]();transfers[_0x12ba76[_0x2097('0x46')]][_0x2097('0x2c')]=0x0;transfers[_0x12ba76[_0x2097('0x46')]][_0x2097('0x47')]=0x2;}}else if(_0x12ba76[_0x2097('0x43')]==_0x12ba76[_0x2097('0x48')]){if(!_['isNil'](agents[_0x12ba76[_0x2097('0x42')]])){utils[_0x2097('0x1')](util[_0x2097('0x2')](_0x2097('0x41'),_0x12ba76[_0x2097('0x42')],agents[_0x12ba76[_0x2097('0x42')]]['membername']));agents[_0x12ba76[_0x2097('0x42')]][_0x2097('0x44')]=!![];agents[_0x12ba76[_0x2097('0x42')]][_0x2097('0x3c')]=_0x2097('0x49');agents[_0x12ba76['origtransfereruniqueid']][_0x2097('0x3d')]=_0x12ba76[_0x2097('0x4a')];agents[_0x12ba76['origtransfereruniqueid']]['transferuniqueid']=_0x12ba76['secondtransfereruniqueid'];}if(_0x12ba76[_0x2097('0x4b')]&&agents[_0x12ba76[_0x2097('0x4b')]]){agents[_0x12ba76[_0x2097('0x4b')]][_0x2097('0x47')]=0x1;transfers[_0x12ba76[_0x2097('0x4b')]]=_[_0x2097('0x4c')](agents[_0x12ba76[_0x2097('0x4b')]]);transfers[_0x12ba76[_0x2097('0x4b')]][_0x2097('0x8')]=agents[_0x12ba76['origtransfereruniqueid']]['calleridnum'];transfers[_0x12ba76[_0x2097('0x4b')]][_0x2097('0x4d')]=agents[_0x12ba76[_0x2097('0x42')]][_0x2097('0x4d')];transfers[_0x12ba76[_0x2097('0x4b')]][_0x2097('0x18')]=utils['now']();transfers[_0x12ba76[_0x2097('0x4b')]][_0x2097('0x36')]=utils[_0x2097('0x19')]();transfers[_0x12ba76[_0x2097('0x4b')]]['holdtime']=0x0;transfers[_0x12ba76['transfertargetuniqueid']][_0x2097('0x47')]=0x2;}}}catch(_0x345a12){utils['error'](util[_0x2097('0x2')](_0x2097('0x4e'),_0x12ba76[_0x2097('0x42')]),_0x345a12);}};exports[_0x2097('0x4f')]=function(_0x1f824f){try{utils[_0x2097('0x16')](util[_0x2097('0x2')](_0x2097('0x50'),_0x1f824f['uniqueid']),_0x1f824f);if(agents[_0x1f824f[_0x2097('0x3')]]&&agents[_0x1f824f[_0x2097('0x3')]]['reason']===_0x2097('0x51')){if(_0x1f824f[_0x2097('0x52')]==='21'){agents[_0x1f824f[_0x2097('0x3')]][_0x2097('0x22')]=_0x2097('0x53');agents[_0x1f824f[_0x2097('0x3')]][_0x2097('0x21')]=_0x2097('0x53');}utils[_0x2097('0x1')](util[_0x2097('0x2')](_0x2097('0x54'),_0x1f824f['uniqueid'],agents[_0x1f824f[_0x2097('0x3')]][_0x2097('0x6')],agents[_0x1f824f[_0x2097('0x3')]][_0x2097('0x22')],agents[_0x1f824f[_0x2097('0x3')]]['lastevent']));writeDB(agents[_0x1f824f[_0x2097('0x3')]]);var _0x2a950f=unanswered[_0x2097('0x55')](_0x1f824f['uniqueid']);if(_0x2a950f>-0x1){unanswered[_0x2097('0x56')](_0x2a950f,0x1);}}if(transfers[_0x1f824f['uniqueid']]){transfers[_0x1f824f[_0x2097('0x3')]]['agentcomplete']=!![];transfers[_0x1f824f[_0x2097('0x3')]]['agentcompleteAt']=utils[_0x2097('0x19')]();transfers[_0x1f824f['uniqueid']][_0x2097('0x24')]=utils[_0x2097('0x35')](transfers[_0x1f824f[_0x2097('0x3')]][_0x2097('0x34')],transfers[_0x1f824f[_0x2097('0x3')]]['agentconnectAt']);transfers[_0x1f824f[_0x2097('0x3')]][_0x2097('0x22')]=_0x2097('0x57');transfers[_0x1f824f[_0x2097('0x3')]][_0x2097('0x21')]=_0x2097('0x37');utils[_0x2097('0x1')](util[_0x2097('0x2')](_0x2097('0x54'),_0x1f824f[_0x2097('0x3')],transfers[_0x1f824f[_0x2097('0x3')]][_0x2097('0x6')],transfers[_0x1f824f[_0x2097('0x3')]][_0x2097('0x22')],transfers[_0x1f824f[_0x2097('0x3')]][_0x2097('0x21')]));writeDB(transfers[_0x1f824f['uniqueid']],!![]);}if(agents[_0x1f824f[_0x2097('0x3')]]&&agents[_0x1f824f['uniqueid']]['agentconnectAt']){agents[_0x1f824f[_0x2097('0x3')]][_0x2097('0xe')]=!![];agents[_0x1f824f[_0x2097('0x3')]]['agentcompleteAt']=utils[_0x2097('0x19')]();agents[_0x1f824f[_0x2097('0x3')]][_0x2097('0x24')]=utils[_0x2097('0x35')](agents[_0x1f824f['uniqueid']][_0x2097('0x34')],agents[_0x1f824f['uniqueid']][_0x2097('0x36')]);agents[_0x1f824f[_0x2097('0x3')]][_0x2097('0x22')]=agents[_0x1f824f[_0x2097('0x3')]]['transfer']?_0x2097('0x44'):_0x2097('0x57');agents[_0x1f824f[_0x2097('0x3')]]['lastevent']=_0x2097('0x37');utils[_0x2097('0x1')](util[_0x2097('0x2')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x1f824f[_0x2097('0x3')],agents[_0x1f824f[_0x2097('0x3')]][_0x2097('0x6')],agents[_0x1f824f[_0x2097('0x3')]][_0x2097('0x22')],agents[_0x1f824f[_0x2097('0x3')]]['lastevent']));writeDB(agents[_0x1f824f['uniqueid']]);}}catch(_0xc7481d){utils[_0x2097('0x1c')](util[_0x2097('0x2')](_0x2097('0x50'),_0x1f824f[_0x2097('0x3')]),_0xc7481d);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index 40e61cd..10c4502 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 _0x7dfb=['execif','lodash','util','./utils','NO\x20ANSWER','FAILED','ANSWERED','format','uniqueid','channel','membername','calleridnum','connectedlinenum','accountcode','then','UserId','CreateVoiceCallReport','request','newchannel','[%s][calls][newchannel]','OutgoingSpoolFailed','info','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','now','DOCUMENTATION','debug','[%s][calls][newstate]','isNil','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','linkedid','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','disposition','error','hangup','[%s][calls][hangup]','callerid','calleridname','cause-txt','duration','endtime','starttime','billableseconds','diffTime','attendedtransfer','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','_attended','origtransfererchannel','userfield','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','[%s][calls][varset]','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','source','xmd-phone','destination','value','\x22\x20<','xmd-callerid-preview','xmd-callerid','xmd-queue','[%s][calls][varset]\x20variable:%s\x20value:%s','xmcs-queue','lastapplication','lastdata','queue','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','newexten','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','set','startsWith','toLowerCase','cdr','split','lastIndexOf','includes','noop'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7dfb,0x1ad));var _0xb7df=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0x7dfb[_0x21aec3];return _0x288bbc;};'use strict';var _=require(_0xb7df('0x0'));var util=require(_0xb7df('0x1'));var utils=require(_0xb7df('0x2'));var dispositions=[_0xb7df('0x3'),_0xb7df('0x4'),_0xb7df('0x4'),_0xb7df('0x3'),_0xb7df('0x3'),_0xb7df('0x3'),_0xb7df('0x5'),'BUSY',_0xb7df('0x4'),'FAILED',_0xb7df('0x4')];var channels={};function writeDB(_0x583560){utils['info'](util[_0xb7df('0x6')]('[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x583560[_0xb7df('0x7')],_0x583560[_0xb7df('0x8')],_0x583560['queue'],_0x583560[_0xb7df('0x9')],_0x583560['interface'],_0x583560[_0xb7df('0xa')],_0x583560[_0xb7df('0xb')],_0x583560['lastevent']));if(_0x583560[_0xb7df('0xc')]){utils['getUserByInternal'](_0x583560[_0xb7df('0xc')])[_0xb7df('0xd')](function(_0x31fb95){if(_0x31fb95){_0x583560[_0xb7df('0xe')]=_0x31fb95['id'];}utils['request'](_0xb7df('0xf'),_0x583560);});}else{utils[_0xb7df('0x10')](_0xb7df('0xf'),_0x583560);}if(channels[_0x583560['uniqueid']]){delete channels[_0x583560[_0xb7df('0x7')]];}}exports[_0xb7df('0x11')]=function(_0x3f128a){try{utils['debug'](util[_0xb7df('0x6')](_0xb7df('0x12'),_0x3f128a[_0xb7df('0x7')]),_0x3f128a);if(_0x3f128a['uniqueid']==_0x3f128a['linkedid']&&_0x3f128a[_0xb7df('0x8')]!=_0xb7df('0x13')){utils[_0xb7df('0x14')](util[_0xb7df('0x6')](_0xb7df('0x15'),_0x3f128a['uniqueid'],_0x3f128a[_0xb7df('0x16')],_0x3f128a[_0xb7df('0x17')]));channels[_0x3f128a['uniqueid']]={'uniqueid':_0x3f128a[_0xb7df('0x7')],'accountcode':_0x3f128a[_0xb7df('0xc')],'source':_0x3f128a[_0xb7df('0xa')],'destination':_0x3f128a[_0xb7df('0x17')],'destinationcontext':_0x3f128a[_0xb7df('0x16')],'channel':_0x3f128a['channel'],'starttime':utils[_0xb7df('0x18')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0xb7df('0x3'),'amaflags':_0xb7df('0x19')};}}catch(_0x2f2c70){utils['error'](util[_0xb7df('0x6')](_0xb7df('0x12'),_0x3f128a['uniqueid']),_0x2f2c70);}};exports['newstate']=function(_0x229937){try{utils[_0xb7df('0x1a')](util[_0xb7df('0x6')](_0xb7df('0x1b'),_0x229937['uniqueid']),_0x229937);if(!_[_0xb7df('0x1c')](channels[_0x229937[_0xb7df('0x7')]])&&_0x229937[_0xb7df('0x1d')]==0x6){utils[_0xb7df('0x14')](util[_0xb7df('0x6')](_0xb7df('0x1e'),_0x229937[_0xb7df('0x7')],_0x229937['context'],_0x229937[_0xb7df('0x8')]));if(_[_0xb7df('0x1c')](channels[_0x229937[_0xb7df('0x7')]][_0xb7df('0x1f')])){channels[_0x229937[_0xb7df('0x7')]][_0xb7df('0x1f')]=utils[_0xb7df('0x18')]();}}else if(!_[_0xb7df('0x1c')](channels[_0x229937[_0xb7df('0x20')]])&&_0x229937[_0xb7df('0x1d')]==0x6&&_0x229937[_0xb7df('0x16')]!='transfer'){utils[_0xb7df('0x14')](util[_0xb7df('0x6')](_0xb7df('0x21'),_0x229937[_0xb7df('0x7')],_0x229937[_0xb7df('0x20')],_0x229937['context'],_0x229937[_0xb7df('0x8')]));channels[_0x229937[_0xb7df('0x20')]][_0xb7df('0xc')]=_0x229937['accountcode'];channels[_0x229937[_0xb7df('0x20')]][_0xb7df('0x22')]=_0x229937[_0xb7df('0x8')];if(_['isNil'](channels[_0x229937[_0xb7df('0x20')]][_0xb7df('0x23')])){channels[_0x229937['linkedid']][_0xb7df('0x23')]=utils[_0xb7df('0x18')]();}channels[_0x229937[_0xb7df('0x20')]][_0xb7df('0x24')]=dispositions[_['toNumber'](_0x229937['channelstate'])]||'ANSWERED';}}catch(_0x4e95c4){utils[_0xb7df('0x25')](util[_0xb7df('0x6')]('[%s][calls][newstate]',_0x229937[_0xb7df('0x7')]),_0x4e95c4);}};exports[_0xb7df('0x26')]=function(_0x56f188){try{if(!_[_0xb7df('0x1c')](channels[_0x56f188[_0xb7df('0x7')]])){utils[_0xb7df('0x1a')](util['format'](_0xb7df('0x27'),_0x56f188[_0xb7df('0x7')]),_0x56f188);if(_[_0xb7df('0x1c')](channels[_0x56f188[_0xb7df('0x7')]]['callerid'])){channels[_0x56f188[_0xb7df('0x7')]][_0xb7df('0x28')]=_0x56f188[_0xb7df('0x29')]+'\x20<'+_0x56f188[_0xb7df('0xa')]+'>';}utils['info'](util['format']('[%s][calls][hangup]\x20callerid:%s\x20reason:%s',_0x56f188[_0xb7df('0x7')],channels[_0x56f188[_0xb7df('0x7')]]['callerid'],_0x56f188[_0xb7df('0x2a')]));channels[_0x56f188[_0xb7df('0x7')]]['endtime']=utils[_0xb7df('0x18')]();channels[_0x56f188[_0xb7df('0x7')]][_0xb7df('0x2b')]=utils['diffTime'](channels[_0x56f188['uniqueid']][_0xb7df('0x2c')],channels[_0x56f188[_0xb7df('0x7')]][_0xb7df('0x2d')]);channels[_0x56f188['uniqueid']][_0xb7df('0x2e')]=channels[_0x56f188['uniqueid']][_0xb7df('0x23')]?utils[_0xb7df('0x2f')](channels[_0x56f188[_0xb7df('0x7')]][_0xb7df('0x2c')],channels[_0x56f188[_0xb7df('0x7')]]['answertime']):0x0;writeDB(channels[_0x56f188['uniqueid']]);}}catch(_0x27ebfe){utils[_0xb7df('0x25')](util[_0xb7df('0x6')](_0xb7df('0x27'),_0x56f188[_0xb7df('0x7')]),_0x27ebfe);}};exports[_0xb7df('0x30')]=function(_0x294113){try{if(!_[_0xb7df('0x1c')](channels[_0x294113[_0xb7df('0x31')]])){utils[_0xb7df('0x1a')](util['format'](_0xb7df('0x32'),_0x294113[_0xb7df('0x33')]),_0x294113);if(channels[_0x294113[_0xb7df('0x31')]]['channel']==_0x294113[_0xb7df('0x34')]){utils[_0xb7df('0x14')](util[_0xb7df('0x6')](_0xb7df('0x35'),_0x294113[_0xb7df('0x33')],_0x294113['localtwolinkedid'],_0x294113[_0xb7df('0x36')]));channels[_0x294113['localtwolinkedid']][_0xb7df('0x22')]=_0x294113['secondtransfererchannel'];channels[_0x294113['localtwolinkedid']]['userfield']=_0xb7df('0x37');}else if(channels[_0x294113[_0xb7df('0x31')]][_0xb7df('0x8')]=_0x294113['transfertargetchannel']){utils['info'](util['format']('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x294113[_0xb7df('0x33')],_0x294113[_0xb7df('0x31')],_0x294113[_0xb7df('0x38')]));channels[_0x294113[_0xb7df('0x31')]]['destinationchannel']=_0x294113[_0xb7df('0x38')];channels[_0x294113[_0xb7df('0x31')]][_0xb7df('0x39')]=_0xb7df('0x37');}}}catch(_0x3ee0fb){utils[_0xb7df('0x25')](util[_0xb7df('0x6')](_0xb7df('0x32'),_0x294113[_0xb7df('0x33')]),_0x3ee0fb);}};exports[_0xb7df('0x3a')]=function(_0x4dacec){try{if(!_[_0xb7df('0x1c')](channels[_0x4dacec['uniqueid']])){utils[_0xb7df('0x1a')](util[_0xb7df('0x6')](_0xb7df('0x3b'),_0x4dacec[_0xb7df('0x7')]),_0x4dacec);channels[_0x4dacec[_0xb7df('0x7')]][_0xb7df('0x3c')]=utils[_0xb7df('0x18')]();utils[_0xb7df('0x14')](util[_0xb7df('0x6')](_0xb7df('0x3d'),_0x4dacec[_0xb7df('0x7')],channels[_0x4dacec[_0xb7df('0x7')]]['musiconholdstartAt']));}}catch(_0x1b88a2){utils[_0xb7df('0x25')](util[_0xb7df('0x6')](_0xb7df('0x3b'),_0x4dacec[_0xb7df('0x7')]),_0x1b88a2);}};exports[_0xb7df('0x3e')]=function(_0x29c6d0){try{if(!_[_0xb7df('0x1c')](channels[_0x29c6d0[_0xb7df('0x7')]])){utils[_0xb7df('0x1a')](util[_0xb7df('0x6')]('[%s][calls][musiconholdstop]',_0x29c6d0['uniqueid']),_0x29c6d0);if(!_[_0xb7df('0x1c')](channels[_0x29c6d0[_0xb7df('0x7')]]['musiconholdstartAt'])){channels[_0x29c6d0[_0xb7df('0x7')]][_0xb7df('0x3f')]+=utils[_0xb7df('0x2f')](utils[_0xb7df('0x18')](),channels[_0x29c6d0[_0xb7df('0x7')]][_0xb7df('0x3c')]);utils[_0xb7df('0x14')](util[_0xb7df('0x6')](_0xb7df('0x40'),_0x29c6d0[_0xb7df('0x7')],channels[_0x29c6d0[_0xb7df('0x7')]][_0xb7df('0x3f')]));delete channels[_0x29c6d0[_0xb7df('0x7')]][_0xb7df('0x3c')];}}}catch(_0x2a9eb5){utils['error'](util[_0xb7df('0x6')]('[%s][calls][musiconholdstop]',_0x29c6d0[_0xb7df('0x7')]),_0x2a9eb5);}};exports['varset']=function(_0x2c33ce){try{if(!_[_0xb7df('0x1c')](channels[_0x2c33ce[_0xb7df('0x7')]])){utils[_0xb7df('0x1a')](util[_0xb7df('0x6')](_0xb7df('0x41'),_0x2c33ce[_0xb7df('0x7')]),_0x2c33ce);if(!_['isNil'](_0x2c33ce[_0xb7df('0x42')][_0xb7df('0x43')])){utils[_0xb7df('0x14')](util['format'](_0xb7df('0x44'),_0x2c33ce['uniqueid'],_0x2c33ce['value']));channels[_0x2c33ce[_0xb7df('0x7')]][_0xb7df('0x45')]=_0x2c33ce['value'];}if(!_[_0xb7df('0x1c')](_0x2c33ce[_0xb7df('0x42')][_0xb7df('0x46')])){utils[_0xb7df('0x14')](util[_0xb7df('0x6')]('[%s][calls][varset]\x20variable:xmd-phone\x20value:%s',_0x2c33ce['uniqueid'],_0x2c33ce['value']));channels[_0x2c33ce['uniqueid']][_0xb7df('0x47')]=_0x2c33ce[_0xb7df('0x48')];channels[_0x2c33ce['uniqueid']]['callerid']='\x22'+_0x2c33ce['value']+_0xb7df('0x49')+_0x2c33ce[_0xb7df('0x48')]+'>';}if(!_[_0xb7df('0x1c')](_0x2c33ce[_0xb7df('0x42')][_0xb7df('0x4a')])||!_[_0xb7df('0x1c')](_0x2c33ce['variable']['xmd-callerid'])){utils[_0xb7df('0x14')](util['format']('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x2c33ce[_0xb7df('0x7')],!_[_0xb7df('0x1c')](_0x2c33ce[_0xb7df('0x42')][_0xb7df('0x4a')])?_0xb7df('0x4a'):_0xb7df('0x4b'),_0x2c33ce[_0xb7df('0x48')]));channels[_0x2c33ce[_0xb7df('0x7')]][_0xb7df('0x28')]=_0x2c33ce[_0xb7df('0x48')];}if(!_['isNil'](_0x2c33ce[_0xb7df('0x42')][_0xb7df('0x4c')])||!_[_0xb7df('0x1c')](_0x2c33ce[_0xb7df('0x42')]['xmcs-queue'])){utils['info'](util[_0xb7df('0x6')](_0xb7df('0x4d'),_0x2c33ce['uniqueid'],!_['isNil'](_0x2c33ce[_0xb7df('0x42')][_0xb7df('0x4c')])?_0xb7df('0x4c'):_0xb7df('0x4e'),_0x2c33ce['value']));channels[_0x2c33ce['uniqueid']][_0xb7df('0x4f')]='Queue';channels[_0x2c33ce[_0xb7df('0x7')]][_0xb7df('0x50')]=_0x2c33ce[_0xb7df('0x48')];channels[_0x2c33ce[_0xb7df('0x7')]][_0xb7df('0x51')]=!![];}if(!_[_0xb7df('0x1c')](_0x2c33ce[_0xb7df('0x42')][_0xb7df('0x52')])){utils[_0xb7df('0x14')](util[_0xb7df('0x6')](_0xb7df('0x53'),_0x2c33ce[_0xb7df('0x7')],_0x2c33ce[_0xb7df('0x48')]));channels[_0x2c33ce[_0xb7df('0x7')]][_0xb7df('0x54')]=_0x2c33ce[_0xb7df('0x48')];}if(!_[_0xb7df('0x1c')](_0x2c33ce['variable'][_0xb7df('0x55')])){utils[_0xb7df('0x14')](util[_0xb7df('0x6')](_0xb7df('0x56'),_0x2c33ce[_0xb7df('0x7')],_0x2c33ce[_0xb7df('0x48')]));channels[_0x2c33ce[_0xb7df('0x7')]][_0xb7df('0x57')]=_0x2c33ce[_0xb7df('0x48')];}if(!_[_0xb7df('0x1c')](_0x2c33ce['variable'][_0xb7df('0x58')])){utils['info'](util[_0xb7df('0x6')](_0xb7df('0x59'),_0x2c33ce[_0xb7df('0x7')],_0x2c33ce[_0xb7df('0x48')]));channels[_0x2c33ce[_0xb7df('0x7')]][_0xb7df('0x5a')]=_0x2c33ce[_0xb7df('0x48')];}if(!_['isNil'](_0x2c33ce['variable'][_0xb7df('0x5b')])){utils[_0xb7df('0x14')](util[_0xb7df('0x6')](_0xb7df('0x5c'),_0x2c33ce[_0xb7df('0x7')],_0x2c33ce[_0xb7df('0x48')]));channels[_0x2c33ce[_0xb7df('0x7')]][_0xb7df('0x5b')]=_0x2c33ce[_0xb7df('0x48')];}}}catch(_0x252cb1){utils[_0xb7df('0x25')](util[_0xb7df('0x6')](_0xb7df('0x41'),_0x2c33ce[_0xb7df('0x7')]),_0x252cb1);}};exports[_0xb7df('0x5d')]=function(_0x4622da){try{if(!_['isNil'](channels[_0x4622da['uniqueid']])){utils[_0xb7df('0x1a')](util[_0xb7df('0x6')](_0xb7df('0x5e'),_0x4622da[_0xb7df('0x7')]),_0x4622da);utils[_0xb7df('0x14')](util['format'](_0xb7df('0x5f'),_0x4622da[_0xb7df('0x7')],_0x4622da[_0xb7df('0x60')],_0x4622da[_0xb7df('0x61')]));if(_0x4622da[_0xb7df('0x60')]['toLowerCase']()==_0xb7df('0x62')&&_[_0xb7df('0x63')](_0x4622da[_0xb7df('0x61')][_0xb7df('0x64')](),_0xb7df('0x65'))){var _0x3837fa=_0x4622da[_0xb7df('0x61')][_0xb7df('0x66')]('=');var _0x7a24e6=_0x3837fa[0x0]['substring'](_0x3837fa[0x0]['lastIndexOf']('(')+0x1,_0x3837fa[0x0][_0xb7df('0x67')](')'));var _0xeb5da8=_0x3837fa[0x1];channels[_0x4622da[_0xb7df('0x7')]][_0x7a24e6]=_0xeb5da8;}if(!_[_0xb7df('0x68')]([_0xb7df('0x26'),_0xb7df('0x69'),_0xb7df('0x6a'),'set','gotoif'],_0x4622da[_0xb7df('0x60')][_0xb7df('0x64')]())){channels[_0x4622da[_0xb7df('0x7')]]['lastapplication']=_0x4622da[_0xb7df('0x60')];channels[_0x4622da[_0xb7df('0x7')]]['lastdata']=_0x4622da[_0xb7df('0x61')];}}}catch(_0x24446f){utils[_0xb7df('0x25')](util[_0xb7df('0x6')]('[%s][calls][newexten]',_0x4622da[_0xb7df('0x7')]),_0x24446f);}}; \ No newline at end of file +var _0xf4e1=['destination','\x22\x20<','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-callerid-preview','xmd-queue','xmcs-queue','lastapplication','Queue','lastdata','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','cdr','split','substring','lastIndexOf','includes','noop','execif','gotoif','util','./utils','FAILED','NO\x20ANSWER','info','format','channel','queue','membername','interface','connectedlinenum','lastevent','accountcode','then','UserId','request','CreateVoiceCallReport','uniqueid','newchannel','[%s][calls][newchannel]','linkedid','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','calleridnum','now','DOCUMENTATION','error','debug','isNil','answertime','ANSWERED','[%s][calls][hangup]','callerid','endtime','duration','diffTime','starttime','billableseconds','[%s][calls][attendedtransfer]','origtransfereruniqueid','localtwolinkedid','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','destinationchannel','userfield','_attended','transfertargetchannel','origtransfererchannel','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','[%s][calls][musiconholdstop]','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','varset','[%s][calls][varset]','variable','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','source','xmd-phone'];(function(_0x31594d,_0x13780c){var _0x10f86c=function(_0x3ed14a){while(--_0x3ed14a){_0x31594d['push'](_0x31594d['shift']());}};_0x10f86c(++_0x13780c);}(_0xf4e1,0x141));var _0x1f4e=function(_0x1ad06a,_0x5a6a97){_0x1ad06a=_0x1ad06a-0x0;var _0x171422=_0xf4e1[_0x1ad06a];return _0x171422;};'use strict';var _=require('lodash');var util=require(_0x1f4e('0x0'));var utils=require(_0x1f4e('0x1'));var dispositions=['NO\x20ANSWER',_0x1f4e('0x2'),'FAILED',_0x1f4e('0x3'),_0x1f4e('0x3'),_0x1f4e('0x3'),'ANSWERED','BUSY',_0x1f4e('0x2'),_0x1f4e('0x2'),_0x1f4e('0x2')];var channels={};function writeDB(_0x285245){utils[_0x1f4e('0x4')](util[_0x1f4e('0x5')]('[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x285245['uniqueid'],_0x285245[_0x1f4e('0x6')],_0x285245[_0x1f4e('0x7')],_0x285245[_0x1f4e('0x8')],_0x285245[_0x1f4e('0x9')],_0x285245['calleridnum'],_0x285245[_0x1f4e('0xa')],_0x285245[_0x1f4e('0xb')]));if(_0x285245[_0x1f4e('0xc')]){utils['getUserByInternal'](_0x285245['accountcode'])[_0x1f4e('0xd')](function(_0xaaf59f){if(_0xaaf59f){_0x285245[_0x1f4e('0xe')]=_0xaaf59f['id'];}utils[_0x1f4e('0xf')](_0x1f4e('0x10'),_0x285245);});}else{utils[_0x1f4e('0xf')](_0x1f4e('0x10'),_0x285245);}if(channels[_0x285245[_0x1f4e('0x11')]]){delete channels[_0x285245[_0x1f4e('0x11')]];}}exports[_0x1f4e('0x12')]=function(_0x36f710){try{utils['debug'](util[_0x1f4e('0x5')](_0x1f4e('0x13'),_0x36f710['uniqueid']),_0x36f710);if(_0x36f710[_0x1f4e('0x11')]==_0x36f710[_0x1f4e('0x14')]&&_0x36f710['channel']!='OutgoingSpoolFailed'){utils[_0x1f4e('0x4')](util[_0x1f4e('0x5')](_0x1f4e('0x15'),_0x36f710[_0x1f4e('0x11')],_0x36f710[_0x1f4e('0x16')],_0x36f710[_0x1f4e('0x17')]));channels[_0x36f710[_0x1f4e('0x11')]]={'uniqueid':_0x36f710[_0x1f4e('0x11')],'accountcode':_0x36f710[_0x1f4e('0xc')],'source':_0x36f710[_0x1f4e('0x18')],'destination':_0x36f710[_0x1f4e('0x17')],'destinationcontext':_0x36f710['context'],'channel':_0x36f710[_0x1f4e('0x6')],'starttime':utils[_0x1f4e('0x19')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x1f4e('0x3'),'amaflags':_0x1f4e('0x1a')};}}catch(_0x3abe5a){utils[_0x1f4e('0x1b')](util[_0x1f4e('0x5')](_0x1f4e('0x13'),_0x36f710[_0x1f4e('0x11')]),_0x3abe5a);}};exports['newstate']=function(_0x202ed9){try{utils[_0x1f4e('0x1c')](util[_0x1f4e('0x5')]('[%s][calls][newstate]',_0x202ed9['uniqueid']),_0x202ed9);if(!_['isNil'](channels[_0x202ed9[_0x1f4e('0x11')]])&&_0x202ed9['channelstate']==0x6){utils[_0x1f4e('0x4')](util[_0x1f4e('0x5')]('[%s][calls][newstate]\x20context:%s\x20channel:%s',_0x202ed9[_0x1f4e('0x11')],_0x202ed9[_0x1f4e('0x16')],_0x202ed9[_0x1f4e('0x6')]));if(_[_0x1f4e('0x1d')](channels[_0x202ed9[_0x1f4e('0x11')]]['systemanswertime'])){channels[_0x202ed9[_0x1f4e('0x11')]]['systemanswertime']=utils['now']();}}else if(!_[_0x1f4e('0x1d')](channels[_0x202ed9[_0x1f4e('0x14')]])&&_0x202ed9['channelstate']==0x6&&_0x202ed9[_0x1f4e('0x16')]!='transfer'){utils['info'](util[_0x1f4e('0x5')]('[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x202ed9[_0x1f4e('0x11')],_0x202ed9[_0x1f4e('0x14')],_0x202ed9[_0x1f4e('0x16')],_0x202ed9[_0x1f4e('0x6')]));channels[_0x202ed9[_0x1f4e('0x14')]][_0x1f4e('0xc')]=_0x202ed9['accountcode'];channels[_0x202ed9['linkedid']]['destinationchannel']=_0x202ed9[_0x1f4e('0x6')];if(_[_0x1f4e('0x1d')](channels[_0x202ed9[_0x1f4e('0x14')]]['answertime'])){channels[_0x202ed9['linkedid']][_0x1f4e('0x1e')]=utils[_0x1f4e('0x19')]();}channels[_0x202ed9['linkedid']]['disposition']=dispositions[_['toNumber'](_0x202ed9['channelstate'])]||_0x1f4e('0x1f');}}catch(_0x133124){utils[_0x1f4e('0x1b')](util[_0x1f4e('0x5')]('[%s][calls][newstate]',_0x202ed9[_0x1f4e('0x11')]),_0x133124);}};exports['hangup']=function(_0x11da18){try{if(!_[_0x1f4e('0x1d')](channels[_0x11da18[_0x1f4e('0x11')]])){utils[_0x1f4e('0x1c')](util[_0x1f4e('0x5')](_0x1f4e('0x20'),_0x11da18[_0x1f4e('0x11')]),_0x11da18);if(_[_0x1f4e('0x1d')](channels[_0x11da18['uniqueid']][_0x1f4e('0x21')])){channels[_0x11da18[_0x1f4e('0x11')]][_0x1f4e('0x21')]=_0x11da18['calleridname']+'\x20<'+_0x11da18['calleridnum']+'>';}utils[_0x1f4e('0x4')](util[_0x1f4e('0x5')]('[%s][calls][hangup]\x20callerid:%s\x20reason:%s',_0x11da18[_0x1f4e('0x11')],channels[_0x11da18[_0x1f4e('0x11')]][_0x1f4e('0x21')],_0x11da18['cause-txt']));channels[_0x11da18[_0x1f4e('0x11')]][_0x1f4e('0x22')]=utils[_0x1f4e('0x19')]();channels[_0x11da18[_0x1f4e('0x11')]][_0x1f4e('0x23')]=utils[_0x1f4e('0x24')](channels[_0x11da18['uniqueid']]['endtime'],channels[_0x11da18[_0x1f4e('0x11')]][_0x1f4e('0x25')]);channels[_0x11da18[_0x1f4e('0x11')]][_0x1f4e('0x26')]=channels[_0x11da18[_0x1f4e('0x11')]][_0x1f4e('0x1e')]?utils['diffTime'](channels[_0x11da18[_0x1f4e('0x11')]][_0x1f4e('0x22')],channels[_0x11da18[_0x1f4e('0x11')]][_0x1f4e('0x1e')]):0x0;writeDB(channels[_0x11da18[_0x1f4e('0x11')]]);}}catch(_0x5316b5){utils[_0x1f4e('0x1b')](util['format'](_0x1f4e('0x20'),_0x11da18['uniqueid']),_0x5316b5);}};exports['attendedtransfer']=function(_0x5d9030){try{if(!_[_0x1f4e('0x1d')](channels[_0x5d9030['localtwolinkedid']])){utils[_0x1f4e('0x1c')](util['format'](_0x1f4e('0x27'),_0x5d9030[_0x1f4e('0x28')]),_0x5d9030);if(channels[_0x5d9030[_0x1f4e('0x29')]][_0x1f4e('0x6')]==_0x5d9030['transfereechannel']){utils[_0x1f4e('0x4')](util[_0x1f4e('0x5')](_0x1f4e('0x2a'),_0x5d9030['origtransfereruniqueid'],_0x5d9030[_0x1f4e('0x29')],_0x5d9030[_0x1f4e('0x2b')]));channels[_0x5d9030['localtwolinkedid']][_0x1f4e('0x2c')]=_0x5d9030['secondtransfererchannel'];channels[_0x5d9030['localtwolinkedid']][_0x1f4e('0x2d')]=_0x1f4e('0x2e');}else if(channels[_0x5d9030['localtwolinkedid']][_0x1f4e('0x6')]=_0x5d9030[_0x1f4e('0x2f')]){utils['info'](util[_0x1f4e('0x5')](_0x1f4e('0x2a'),_0x5d9030[_0x1f4e('0x28')],_0x5d9030['localtwolinkedid'],_0x5d9030[_0x1f4e('0x30')]));channels[_0x5d9030[_0x1f4e('0x29')]][_0x1f4e('0x2c')]=_0x5d9030[_0x1f4e('0x30')];channels[_0x5d9030['localtwolinkedid']][_0x1f4e('0x2d')]=_0x1f4e('0x2e');}}}catch(_0x4cfafb){utils[_0x1f4e('0x1b')](util[_0x1f4e('0x5')](_0x1f4e('0x27'),_0x5d9030[_0x1f4e('0x28')]),_0x4cfafb);}};exports[_0x1f4e('0x31')]=function(_0x244f0f){try{if(!_[_0x1f4e('0x1d')](channels[_0x244f0f['uniqueid']])){utils['debug'](util[_0x1f4e('0x5')](_0x1f4e('0x32'),_0x244f0f[_0x1f4e('0x11')]),_0x244f0f);channels[_0x244f0f[_0x1f4e('0x11')]][_0x1f4e('0x33')]=utils[_0x1f4e('0x19')]();utils[_0x1f4e('0x4')](util[_0x1f4e('0x5')](_0x1f4e('0x34'),_0x244f0f['uniqueid'],channels[_0x244f0f['uniqueid']]['musiconholdstartAt']));}}catch(_0x5bcae0){utils['error'](util[_0x1f4e('0x5')](_0x1f4e('0x32'),_0x244f0f[_0x1f4e('0x11')]),_0x5bcae0);}};exports['musiconholdstop']=function(_0x53ca53){try{if(!_[_0x1f4e('0x1d')](channels[_0x53ca53[_0x1f4e('0x11')]])){utils[_0x1f4e('0x1c')](util['format'](_0x1f4e('0x35'),_0x53ca53[_0x1f4e('0x11')]),_0x53ca53);if(!_[_0x1f4e('0x1d')](channels[_0x53ca53['uniqueid']][_0x1f4e('0x33')])){channels[_0x53ca53[_0x1f4e('0x11')]][_0x1f4e('0x36')]+=utils[_0x1f4e('0x24')](utils['now'](),channels[_0x53ca53[_0x1f4e('0x11')]]['musiconholdstartAt']);utils['info'](util[_0x1f4e('0x5')](_0x1f4e('0x37'),_0x53ca53[_0x1f4e('0x11')],channels[_0x53ca53[_0x1f4e('0x11')]][_0x1f4e('0x36')]));delete channels[_0x53ca53[_0x1f4e('0x11')]]['musiconholdstartAt'];}}}catch(_0x3bfe6d){utils[_0x1f4e('0x1b')](util['format'](_0x1f4e('0x35'),_0x53ca53[_0x1f4e('0x11')]),_0x3bfe6d);}};exports[_0x1f4e('0x38')]=function(_0x1ae638){try{if(!_['isNil'](channels[_0x1ae638[_0x1f4e('0x11')]])){utils['debug'](util[_0x1f4e('0x5')](_0x1f4e('0x39'),_0x1ae638[_0x1f4e('0x11')]),_0x1ae638);if(!_[_0x1f4e('0x1d')](_0x1ae638[_0x1f4e('0x3a')]['xmd-originatecalleridnum'])){utils[_0x1f4e('0x4')](util[_0x1f4e('0x5')](_0x1f4e('0x3b'),_0x1ae638['uniqueid'],_0x1ae638[_0x1f4e('0x3c')]));channels[_0x1ae638[_0x1f4e('0x11')]][_0x1f4e('0x3d')]=_0x1ae638[_0x1f4e('0x3c')];}if(!_[_0x1f4e('0x1d')](_0x1ae638['variable'][_0x1f4e('0x3e')])){utils[_0x1f4e('0x4')](util[_0x1f4e('0x5')]('[%s][calls][varset]\x20variable:xmd-phone\x20value:%s',_0x1ae638[_0x1f4e('0x11')],_0x1ae638['value']));channels[_0x1ae638['uniqueid']][_0x1f4e('0x3f')]=_0x1ae638['value'];channels[_0x1ae638[_0x1f4e('0x11')]][_0x1f4e('0x21')]='\x22'+_0x1ae638[_0x1f4e('0x3c')]+_0x1f4e('0x40')+_0x1ae638['value']+'>';}if(!_[_0x1f4e('0x1d')](_0x1ae638['variable']['xmd-callerid-preview'])||!_[_0x1f4e('0x1d')](_0x1ae638[_0x1f4e('0x3a')][_0x1f4e('0x41')])){utils[_0x1f4e('0x4')](util[_0x1f4e('0x5')](_0x1f4e('0x42'),_0x1ae638['uniqueid'],!_['isNil'](_0x1ae638[_0x1f4e('0x3a')][_0x1f4e('0x43')])?_0x1f4e('0x43'):'xmd-callerid',_0x1ae638[_0x1f4e('0x3c')]));channels[_0x1ae638['uniqueid']][_0x1f4e('0x21')]=_0x1ae638['value'];}if(!_[_0x1f4e('0x1d')](_0x1ae638['variable']['xmd-queue'])||!_[_0x1f4e('0x1d')](_0x1ae638[_0x1f4e('0x3a')]['xmcs-queue'])){utils['info'](util['format'](_0x1f4e('0x42'),_0x1ae638[_0x1f4e('0x11')],!_[_0x1f4e('0x1d')](_0x1ae638[_0x1f4e('0x3a')][_0x1f4e('0x44')])?_0x1f4e('0x44'):_0x1f4e('0x45'),_0x1ae638[_0x1f4e('0x3c')]));channels[_0x1ae638[_0x1f4e('0x11')]][_0x1f4e('0x46')]=_0x1f4e('0x47');channels[_0x1ae638[_0x1f4e('0x11')]][_0x1f4e('0x48')]=_0x1ae638['value'];channels[_0x1ae638[_0x1f4e('0x11')]][_0x1f4e('0x7')]=!![];}if(!_[_0x1f4e('0x1d')](_0x1ae638[_0x1f4e('0x3a')][_0x1f4e('0x49')])){utils[_0x1f4e('0x4')](util[_0x1f4e('0x5')](_0x1f4e('0x4a'),_0x1ae638[_0x1f4e('0x11')],_0x1ae638[_0x1f4e('0x3c')]));channels[_0x1ae638['uniqueid']]['ContactId']=_0x1ae638[_0x1f4e('0x3c')];}if(!_[_0x1f4e('0x1d')](_0x1ae638[_0x1f4e('0x3a')][_0x1f4e('0x4b')])){utils[_0x1f4e('0x4')](util[_0x1f4e('0x5')](_0x1f4e('0x4c'),_0x1ae638['uniqueid'],_0x1ae638[_0x1f4e('0x3c')]));channels[_0x1ae638['uniqueid']]['type']=_0x1ae638['value'];}if(!_['isNil'](_0x1ae638[_0x1f4e('0x3a')][_0x1f4e('0x4d')])){utils[_0x1f4e('0x4')](util[_0x1f4e('0x5')](_0x1f4e('0x4e'),_0x1ae638[_0x1f4e('0x11')],_0x1ae638[_0x1f4e('0x3c')]));channels[_0x1ae638['uniqueid']][_0x1f4e('0x4f')]=_0x1ae638[_0x1f4e('0x3c')];}if(!_['isNil'](_0x1ae638['variable'][_0x1f4e('0x50')])){utils[_0x1f4e('0x4')](util[_0x1f4e('0x5')](_0x1f4e('0x51'),_0x1ae638[_0x1f4e('0x11')],_0x1ae638[_0x1f4e('0x3c')]));channels[_0x1ae638[_0x1f4e('0x11')]][_0x1f4e('0x50')]=_0x1ae638['value'];}}}catch(_0x418d97){utils[_0x1f4e('0x1b')](util[_0x1f4e('0x5')](_0x1f4e('0x39'),_0x1ae638['uniqueid']),_0x418d97);}};exports['newexten']=function(_0xc8c7c){try{if(!_[_0x1f4e('0x1d')](channels[_0xc8c7c[_0x1f4e('0x11')]])){utils[_0x1f4e('0x1c')](util[_0x1f4e('0x5')](_0x1f4e('0x52'),_0xc8c7c[_0x1f4e('0x11')]),_0xc8c7c);utils[_0x1f4e('0x4')](util[_0x1f4e('0x5')](_0x1f4e('0x53'),_0xc8c7c[_0x1f4e('0x11')],_0xc8c7c[_0x1f4e('0x54')],_0xc8c7c[_0x1f4e('0x55')]));if(_0xc8c7c[_0x1f4e('0x54')][_0x1f4e('0x56')]()==_0x1f4e('0x57')&&_['startsWith'](_0xc8c7c[_0x1f4e('0x55')][_0x1f4e('0x56')](),_0x1f4e('0x58'))){var _0xf1ef88=_0xc8c7c[_0x1f4e('0x55')][_0x1f4e('0x59')]('=');var _0x38bdb0=_0xf1ef88[0x0][_0x1f4e('0x5a')](_0xf1ef88[0x0][_0x1f4e('0x5b')]('(')+0x1,_0xf1ef88[0x0]['lastIndexOf'](')'));var _0x409435=_0xf1ef88[0x1];channels[_0xc8c7c[_0x1f4e('0x11')]][_0x38bdb0]=_0x409435;}if(!_[_0x1f4e('0x5c')](['hangup',_0x1f4e('0x5d'),_0x1f4e('0x5e'),_0x1f4e('0x57'),_0x1f4e('0x5f')],_0xc8c7c[_0x1f4e('0x54')]['toLowerCase']())){channels[_0xc8c7c[_0x1f4e('0x11')]][_0x1f4e('0x46')]=_0xc8c7c[_0x1f4e('0x54')];channels[_0xc8c7c[_0x1f4e('0x11')]][_0x1f4e('0x48')]=_0xc8c7c[_0x1f4e('0x55')];}}}catch(_0xaeb00){utils[_0x1f4e('0x1b')](util[_0x1f4e('0x5')](_0x1f4e('0x52'),_0xc8c7c[_0x1f4e('0x11')]),_0xaeb00);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index b2e1ae4..69e410a 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 _0x65ce=['shutdown','[core]\x20shutdown','fullybooted','[core]\x20fullybooted','error','[core]\x20error','[core]\x20close','managerevent','./utils','connect','info','[core]\x20connected'];(function(_0x300b26,_0x3a9b67){var _0x5cb1ae=function(_0x2b8e7f){while(--_0x2b8e7f){_0x300b26['push'](_0x300b26['shift']());}};_0x5cb1ae(++_0x3a9b67);}(_0x65ce,0x110));var _0xe65c=function(_0x3593bb,_0x1d05ce){_0x3593bb=_0x3593bb-0x0;var _0x3da89f=_0x65ce[_0x3593bb];return _0x3da89f;};'use strict';var utils=require(_0xe65c('0x0'));exports[_0xe65c('0x1')]=function(){utils[_0xe65c('0x2')](_0xe65c('0x3'));};exports[_0xe65c('0x4')]=function(){utils[_0xe65c('0x2')](_0xe65c('0x5'));};exports[_0xe65c('0x6')]=function(){utils[_0xe65c('0x2')](_0xe65c('0x7'));};exports[_0xe65c('0x8')]=function(_0x46c6ba){utils['error'](_0xe65c('0x9'),_0x46c6ba);};exports['close']=function(){utils[_0xe65c('0x2')](_0xe65c('0xa'));};exports[_0xe65c('0xb')]=function(_0x1eff26){}; \ No newline at end of file +var _0x920f=['close','managerevent','./utils','info','[core]\x20connected','shutdown','[core]\x20shutdown','fullybooted','[core]\x20fullybooted','[core]\x20error'];(function(_0x541208,_0x46be27){var _0x1b062a=function(_0x50b25e){while(--_0x50b25e){_0x541208['push'](_0x541208['shift']());}};_0x1b062a(++_0x46be27);}(_0x920f,0xd4));var _0xf920=function(_0x27d634,_0x3f6bf7){_0x27d634=_0x27d634-0x0;var _0xbcf62=_0x920f[_0x27d634];return _0xbcf62;};'use strict';var utils=require(_0xf920('0x0'));exports['connect']=function(){utils[_0xf920('0x1')](_0xf920('0x2'));};exports[_0xf920('0x3')]=function(){utils[_0xf920('0x1')](_0xf920('0x4'));};exports[_0xf920('0x5')]=function(){utils[_0xf920('0x1')](_0xf920('0x6'));};exports['error']=function(_0x2ba7c7){utils['error'](_0xf920('0x7'),_0x2ba7c7);};exports[_0xf920('0x8')]=function(){utils[_0xf920('0x1')]('[core]\x20close');};exports[_0xf920('0x9')]=function(_0x313540){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index 56ec340..174d26d 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 _0xd73a=['format','application','toLowerCase','startsWith','cdr(routeid)','appdata','error','varset','[%s][dials][varset]','isNil','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','[%s][dials][dialbegin]','starttime','lastevent','dialend','[%s][dials][dialend]','ANSWER','answertime','now','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','hangup','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','cause-txt','assign','complete','duration','holdtime','diffTime','billableseconds','[%s][dials][hangup]','lodash','util','./utils','info','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','channel','dialstring','calleridnum','connectedlinenum','dialstatus','newexten','debug','[%s][dials][newexten]'];(function(_0x395558,_0x1aadcf){var _0x350565=function(_0x2d62e0){while(--_0x2d62e0){_0x395558['push'](_0x395558['shift']());}};_0x350565(++_0x1aadcf);}(_0xd73a,0x7c));var _0xad73=function(_0x25820c,_0x38cd80){_0x25820c=_0x25820c-0x0;var _0x3b66b8=_0xd73a[_0x25820c];return _0x3b66b8;};'use strict';var _=require(_0xad73('0x0'));var util=require(_0xad73('0x1'));var utils=require(_0xad73('0x2'));var dials={};function writeDB(_0x43cf0f){utils[_0xad73('0x3')](util['format'](_0xad73('0x4'),_0x43cf0f[_0xad73('0x5')],_0x43cf0f[_0xad73('0x6')],_0x43cf0f[_0xad73('0x7')],_0x43cf0f[_0xad73('0x8')],_0x43cf0f[_0xad73('0x9')],_0x43cf0f[_0xad73('0xa')]));utils['request']('CreateVoiceDialReport',_0x43cf0f);delete dials[_0x43cf0f[_0xad73('0x5')]];}exports[_0xad73('0xb')]=function(_0xa506e9){try{utils[_0xad73('0xc')](util['format'](_0xad73('0xd'),_0xa506e9[_0xad73('0x5')]),_0xa506e9);utils[_0xad73('0x3')](util[_0xad73('0xe')]('[%s][dials][newexten]\x20application:%s\x20appdata:%s',_0xa506e9[_0xad73('0x5')],_0xa506e9[_0xad73('0xf')],_0xa506e9['appdata']));if(_0xa506e9[_0xad73('0xf')][_0xad73('0x10')]()=='set'&&_[_0xad73('0x11')](_0xa506e9['appdata'][_0xad73('0x10')](),_0xad73('0x12'))){var _0x273c87=_0xa506e9[_0xad73('0x13')]['split']('=');dials[_0xa506e9[_0xad73('0x5')]]={'routeId':_0x273c87[0x1]};}}catch(_0x1c0105){utils[_0xad73('0x14')](util[_0xad73('0xe')](_0xad73('0xd'),_0xa506e9[_0xad73('0x5')]),_0x1c0105);}};exports[_0xad73('0x15')]=function(_0x1540e2){try{utils[_0xad73('0xc')](util[_0xad73('0xe')](_0xad73('0x16'),_0x1540e2[_0xad73('0x5')]),_0x1540e2);if(!_[_0xad73('0x17')](_0x1540e2['variable'][_0xad73('0x18')])){utils[_0xad73('0x3')](util[_0xad73('0xe')](_0xad73('0x19'),_0x1540e2[_0xad73('0x5')],_0x1540e2['value']));dials[_0x1540e2[_0xad73('0x5')]]={'routeId':_0x1540e2[_0xad73('0x1a')]};}}catch(_0x3f04ec){utils[_0xad73('0x14')](util[_0xad73('0xe')](_0xad73('0x16'),_0x1540e2[_0xad73('0x5')]),_0x3f04ec);}};exports['dialbegin']=function(_0x5ba6f7){try{if(!_[_0xad73('0x17')](dials[_0x5ba6f7[_0xad73('0x5')]])){utils[_0xad73('0xc')](util[_0xad73('0xe')](_0xad73('0x1b'),_0x5ba6f7[_0xad73('0x5')]),_0x5ba6f7);dials[_0x5ba6f7[_0xad73('0x5')]]=_['assign'](dials[_0x5ba6f7[_0xad73('0x5')]],_0x5ba6f7);dials[_0x5ba6f7[_0xad73('0x5')]][_0xad73('0x1c')]=utils['now']();dials[_0x5ba6f7[_0xad73('0x5')]][_0xad73('0x1d')]='called';utils[_0xad73('0x3')](util[_0xad73('0xe')]('[%s][dials][hangup]\x20starttime:%s\x20lastevent:called',_0x5ba6f7['uniqueid'],dials[_0x5ba6f7[_0xad73('0x5')]][_0xad73('0x1c')]));}}catch(_0x4f5046){utils[_0xad73('0x14')](util[_0xad73('0xe')]('[%s][dials][dialbegin]',_0x5ba6f7['uniqueid']),_0x4f5046);}};exports[_0xad73('0x1e')]=function(_0x514aa0){try{if(!_['isNil'](dials[_0x514aa0['uniqueid']])){utils[_0xad73('0xc')](util[_0xad73('0xe')](_0xad73('0x1f'),_0x514aa0[_0xad73('0x5')]),_0x514aa0);dials[_0x514aa0[_0xad73('0x5')]]['dialstatus']=_0x514aa0[_0xad73('0xa')];if(_0x514aa0['dialstatus']==_0xad73('0x20')){dials[_0x514aa0[_0xad73('0x5')]]=_['assign'](dials[_0x514aa0['uniqueid']],_0x514aa0);dials[_0x514aa0[_0xad73('0x5')]][_0xad73('0x21')]=utils[_0xad73('0x22')]();dials[_0x514aa0[_0xad73('0x5')]]['lastevent']='connect';utils[_0xad73('0x3')](util[_0xad73('0xe')](_0xad73('0x23'),_0x514aa0[_0xad73('0x5')],_0x514aa0['dialstatus'],dials[_0x514aa0[_0xad73('0x5')]][_0xad73('0x21')]));}else{utils[_0xad73('0x3')](util[_0xad73('0xe')]('[%s][dials][dialend]\x20dialstatus:%s',_0x514aa0[_0xad73('0x5')],_0x514aa0[_0xad73('0xa')]));}}}catch(_0x3ae00b){utils['error'](util['format'](_0xad73('0x1f'),_0x514aa0[_0xad73('0x5')]),_0x3ae00b);}};exports[_0xad73('0x24')]=function(_0x241544){try{if(!_[_0xad73('0x17')](dials[_0x241544[_0xad73('0x5')]])){utils[_0xad73('0xc')](util['format']('[%s][dials][hangup]',_0x241544[_0xad73('0x5')]),_0x241544);utils['info'](util[_0xad73('0xe')](_0xad73('0x25'),_0x241544[_0xad73('0x5')],_0x241544[_0xad73('0x8')],_0x241544['calleridname'],_0x241544[_0xad73('0x26')]));dials[_0x241544[_0xad73('0x5')]]=_[_0xad73('0x27')](dials[_0x241544[_0xad73('0x5')]],{'endtime':utils['now'](),'lastevent':_0xad73('0x28')});dials[_0x241544['uniqueid']][_0xad73('0x29')]=utils['diffTime'](dials[_0x241544[_0xad73('0x5')]]['endtime'],dials[_0x241544[_0xad73('0x5')]]['starttime']);dials[_0x241544[_0xad73('0x5')]][_0xad73('0x2a')]=utils[_0xad73('0x2b')](dials[_0x241544['uniqueid']][_0xad73('0x21')]||dials[_0x241544[_0xad73('0x5')]]['endtime'],dials[_0x241544[_0xad73('0x5')]][_0xad73('0x1c')]);dials[_0x241544[_0xad73('0x5')]][_0xad73('0x2c')]=dials[_0x241544[_0xad73('0x5')]][_0xad73('0x21')]?utils[_0xad73('0x2b')](dials[_0x241544[_0xad73('0x5')]]['endtime'],dials[_0x241544[_0xad73('0x5')]][_0xad73('0x21')]):0x0;writeDB(dials[_0x241544[_0xad73('0x5')]]);}}catch(_0x4cea11){utils[_0xad73('0x14')](util['format'](_0xad73('0x2d'),_0x241544[_0xad73('0x5')]),_0x4cea11);}}; \ No newline at end of file +var _0x72ce=['diffTime','endtime','holdtime','billableseconds','lodash','util','info','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','channel','dialstring','calleridnum','connectedlinenum','dialstatus','request','CreateVoiceDialReport','format','[%s][dials][newexten]','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','set','cdr(routeid)','split','varset','debug','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','error','[%s][dials][varset]','dialbegin','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','starttime','[%s][dials][dialbegin]','dialend','[%s][dials][dialend]','ANSWER','assign','answertime','now','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','hangup','isNil','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','cause-txt','complete','duration'];(function(_0x27fe26,_0x3b8ca7){var _0x4fcb35=function(_0x35e0ae){while(--_0x35e0ae){_0x27fe26['push'](_0x27fe26['shift']());}};_0x4fcb35(++_0x3b8ca7);}(_0x72ce,0xdc));var _0xe72c=function(_0x51e7,_0x48ce59){_0x51e7=_0x51e7-0x0;var _0x3f430a=_0x72ce[_0x51e7];return _0x3f430a;};'use strict';var _=require(_0xe72c('0x0'));var util=require(_0xe72c('0x1'));var utils=require('./utils');var dials={};function writeDB(_0x12e117){utils[_0xe72c('0x2')](util['format'](_0xe72c('0x3'),_0x12e117[_0xe72c('0x4')],_0x12e117[_0xe72c('0x5')],_0x12e117[_0xe72c('0x6')],_0x12e117[_0xe72c('0x7')],_0x12e117[_0xe72c('0x8')],_0x12e117[_0xe72c('0x9')]));utils[_0xe72c('0xa')](_0xe72c('0xb'),_0x12e117);delete dials[_0x12e117['uniqueid']];}exports['newexten']=function(_0x5c6251){try{utils['debug'](util[_0xe72c('0xc')](_0xe72c('0xd'),_0x5c6251[_0xe72c('0x4')]),_0x5c6251);utils[_0xe72c('0x2')](util[_0xe72c('0xc')](_0xe72c('0xe'),_0x5c6251[_0xe72c('0x4')],_0x5c6251[_0xe72c('0xf')],_0x5c6251[_0xe72c('0x10')]));if(_0x5c6251[_0xe72c('0xf')]['toLowerCase']()==_0xe72c('0x11')&&_['startsWith'](_0x5c6251[_0xe72c('0x10')]['toLowerCase'](),_0xe72c('0x12'))){var _0x56505a=_0x5c6251[_0xe72c('0x10')][_0xe72c('0x13')]('=');dials[_0x5c6251[_0xe72c('0x4')]]={'routeId':_0x56505a[0x1]};}}catch(_0x490074){utils['error'](util['format'](_0xe72c('0xd'),_0x5c6251['uniqueid']),_0x490074);}};exports[_0xe72c('0x14')]=function(_0xdc84a2){try{utils[_0xe72c('0x15')](util[_0xe72c('0xc')]('[%s][dials][varset]',_0xdc84a2[_0xe72c('0x4')]),_0xdc84a2);if(!_['isNil'](_0xdc84a2[_0xe72c('0x16')][_0xe72c('0x17')])){utils[_0xe72c('0x2')](util['format'](_0xe72c('0x18'),_0xdc84a2[_0xe72c('0x4')],_0xdc84a2['value']));dials[_0xdc84a2[_0xe72c('0x4')]]={'routeId':_0xdc84a2[_0xe72c('0x19')]};}}catch(_0xc1b38d){utils[_0xe72c('0x1a')](util['format'](_0xe72c('0x1b'),_0xdc84a2[_0xe72c('0x4')]),_0xc1b38d);}};exports[_0xe72c('0x1c')]=function(_0x4a3516){try{if(!_['isNil'](dials[_0x4a3516[_0xe72c('0x4')]])){utils['debug'](util[_0xe72c('0xc')]('[%s][dials][dialbegin]',_0x4a3516[_0xe72c('0x4')]),_0x4a3516);dials[_0x4a3516[_0xe72c('0x4')]]=_['assign'](dials[_0x4a3516[_0xe72c('0x4')]],_0x4a3516);dials[_0x4a3516[_0xe72c('0x4')]]['starttime']=utils['now']();dials[_0x4a3516[_0xe72c('0x4')]][_0xe72c('0x1d')]=_0xe72c('0x1e');utils[_0xe72c('0x2')](util[_0xe72c('0xc')](_0xe72c('0x1f'),_0x4a3516['uniqueid'],dials[_0x4a3516['uniqueid']][_0xe72c('0x20')]));}}catch(_0x31b7d5){utils[_0xe72c('0x1a')](util['format'](_0xe72c('0x21'),_0x4a3516[_0xe72c('0x4')]),_0x31b7d5);}};exports[_0xe72c('0x22')]=function(_0x5c01f4){try{if(!_['isNil'](dials[_0x5c01f4[_0xe72c('0x4')]])){utils[_0xe72c('0x15')](util[_0xe72c('0xc')](_0xe72c('0x23'),_0x5c01f4[_0xe72c('0x4')]),_0x5c01f4);dials[_0x5c01f4[_0xe72c('0x4')]][_0xe72c('0x9')]=_0x5c01f4[_0xe72c('0x9')];if(_0x5c01f4[_0xe72c('0x9')]==_0xe72c('0x24')){dials[_0x5c01f4['uniqueid']]=_[_0xe72c('0x25')](dials[_0x5c01f4[_0xe72c('0x4')]],_0x5c01f4);dials[_0x5c01f4[_0xe72c('0x4')]][_0xe72c('0x26')]=utils[_0xe72c('0x27')]();dials[_0x5c01f4['uniqueid']][_0xe72c('0x1d')]='connect';utils[_0xe72c('0x2')](util['format'](_0xe72c('0x28'),_0x5c01f4[_0xe72c('0x4')],_0x5c01f4[_0xe72c('0x9')],dials[_0x5c01f4[_0xe72c('0x4')]][_0xe72c('0x26')]));}else{utils[_0xe72c('0x2')](util['format'](_0xe72c('0x29'),_0x5c01f4[_0xe72c('0x4')],_0x5c01f4[_0xe72c('0x9')]));}}}catch(_0x554154){utils[_0xe72c('0x1a')](util[_0xe72c('0xc')]('[%s][dials][dialend]',_0x5c01f4[_0xe72c('0x4')]),_0x554154);}};exports[_0xe72c('0x2a')]=function(_0x2d1458){try{if(!_[_0xe72c('0x2b')](dials[_0x2d1458[_0xe72c('0x4')]])){utils['debug'](util[_0xe72c('0xc')](_0xe72c('0x2c'),_0x2d1458[_0xe72c('0x4')]),_0x2d1458);utils[_0xe72c('0x2')](util[_0xe72c('0xc')](_0xe72c('0x2d'),_0x2d1458[_0xe72c('0x4')],_0x2d1458['calleridnum'],_0x2d1458[_0xe72c('0x2e')],_0x2d1458[_0xe72c('0x2f')]));dials[_0x2d1458[_0xe72c('0x4')]]=_[_0xe72c('0x25')](dials[_0x2d1458[_0xe72c('0x4')]],{'endtime':utils[_0xe72c('0x27')](),'lastevent':_0xe72c('0x30')});dials[_0x2d1458[_0xe72c('0x4')]][_0xe72c('0x31')]=utils[_0xe72c('0x32')](dials[_0x2d1458[_0xe72c('0x4')]][_0xe72c('0x33')],dials[_0x2d1458[_0xe72c('0x4')]]['starttime']);dials[_0x2d1458[_0xe72c('0x4')]][_0xe72c('0x34')]=utils['diffTime'](dials[_0x2d1458[_0xe72c('0x4')]][_0xe72c('0x26')]||dials[_0x2d1458[_0xe72c('0x4')]][_0xe72c('0x33')],dials[_0x2d1458[_0xe72c('0x4')]][_0xe72c('0x20')]);dials[_0x2d1458[_0xe72c('0x4')]][_0xe72c('0x35')]=dials[_0x2d1458[_0xe72c('0x4')]][_0xe72c('0x26')]?utils[_0xe72c('0x32')](dials[_0x2d1458[_0xe72c('0x4')]][_0xe72c('0x33')],dials[_0x2d1458['uniqueid']][_0xe72c('0x26')]):0x0;writeDB(dials[_0x2d1458['uniqueid']]);}}catch(_0x2d4b16){utils[_0xe72c('0x1a')](util[_0xe72c('0xc')](_0xe72c('0x2c'),_0x2d1458[_0xe72c('0x4')]),_0x2d4b16);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index 938859d..67ba3b9 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 _0x240e=['uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','[%s][index][agentconnect]','agentconnect','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','[%s][index][musiconholdstart]','musiconholdstart','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','origtransfereruniqueid','[%s][index][attendedtransfer]','varset','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','[%s][index][dialbegin]','dialend','../../config/environment','./utils','util','xdr','disabled','production','local','asterisk','username','password','info','XDR\x20DISABLED','./agents.controller','./queues.controller','./recordings.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','debug','format','[%s][index][devicestatechange]','device','agentcalled','[%s][index][agentcalled]'];(function(_0x33267c,_0x70826f){var _0xe6f23=function(_0x1f9316){while(--_0x1f9316){_0x33267c['push'](_0x33267c['shift']());}};_0xe6f23(++_0x70826f);}(_0x240e,0x12b));var _0xe240=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0x240e[_0x34bf97];return _0x292719;};var AsteriskManager=require('asterisk-manager');var config=require(_0xe240('0x0'));var utils=require(_0xe240('0x1'));var util=require(_0xe240('0x2'));var isXDREnabled=config[_0xe240('0x3')]&&config[_0xe240('0x3')][_0xe240('0x4')]?!config[_0xe240('0x3')]['disabled']:!![];var isProduction=config['env']===_0xe240('0x5')||![];var isLocalAsterisk=config[_0xe240('0x3')]&&config[_0xe240('0x3')][_0xe240('0x6')]===!![]||![];var ami=new AsteriskManager(config[_0xe240('0x7')]['port'],config[_0xe240('0x7')]['ip'],config[_0xe240('0x7')][_0xe240('0x8')],config[_0xe240('0x7')][_0xe240('0x9')],!![]);ami['keepConnected']();if(!isXDREnabled){utils[_0xe240('0xa')](_0xe240('0xb'));}else if(!isProduction&&!isLocalAsterisk){utils[_0xe240('0xa')]('Asterisk\x20disabled\x20on\x20localhost');}else{var agents=require(_0xe240('0xc'));var calls=require('./calls.controller');var queues=require(_0xe240('0xd'));var recordings=require(_0xe240('0xe'));var members=require('./members.controller');var dials=require(_0xe240('0xf'));var transfers=require(_0xe240('0x10'));var core=require(_0xe240('0x11'));ami['on'](_0xe240('0x12'),core[_0xe240('0x12')]);ami['on'](_0xe240('0x13'),core[_0xe240('0x13')]);ami['on']('fullybooted',core[_0xe240('0x14')]);ami['on'](_0xe240('0x15'),core['error']);ami['on'](_0xe240('0x16'),core[_0xe240('0x16')]);ami['on'](_0xe240('0x17'),core['managerevent']);ami['on'](_0xe240('0x18'),function(_0x8a85ac){try{utils[_0xe240('0x19')](util[_0xe240('0x1a')](_0xe240('0x1b'),_0x8a85ac[_0xe240('0x1c')]),_0x8a85ac);members['devicestatechange'](_0x8a85ac);}catch(_0x29249b){utils[_0xe240('0x15')](util[_0xe240('0x1a')](_0xe240('0x1b'),_0x8a85ac['device']),_0x29249b);}});ami['on'](_0xe240('0x1d'),function(_0x3b25f2){try{utils['debug'](util['format'](_0xe240('0x1e'),_0x3b25f2[_0xe240('0x1f')]),_0x3b25f2);agents['agentcalled'](_0x3b25f2);}catch(_0x23fd19){utils[_0xe240('0x15')](util[_0xe240('0x1a')](_0xe240('0x1e'),_0x3b25f2[_0xe240('0x1f')]),_0x23fd19);}});ami['on'](_0xe240('0x20'),function(_0x9b9c22){try{utils[_0xe240('0x19')](util[_0xe240('0x1a')](_0xe240('0x21'),_0x9b9c22[_0xe240('0x1f')]),_0x9b9c22);agents[_0xe240('0x20')](_0x9b9c22);}catch(_0x38519a){utils[_0xe240('0x15')](util['format']('[%s][index][agentringnoanswer]',_0x9b9c22['uniqueid']),_0x38519a);}});ami['on']('agentconnect',function(_0x1531ab){try{utils[_0xe240('0x19')](util[_0xe240('0x1a')](_0xe240('0x22'),_0x1531ab['uniqueid']),_0x1531ab);agents['agentconnect'](_0x1531ab);queues[_0xe240('0x23')](_0x1531ab);}catch(_0x14b712){utils['error'](util[_0xe240('0x1a')](_0xe240('0x22'),_0x1531ab[_0xe240('0x1f')]),_0x14b712);}});ami['on'](_0xe240('0x24'),function(_0x2c1208){try{utils[_0xe240('0x19')](util[_0xe240('0x1a')](_0xe240('0x25'),_0x2c1208[_0xe240('0x1f')]),_0x2c1208);agents['agentcomplete'](_0x2c1208);queues[_0xe240('0x24')](_0x2c1208);members[_0xe240('0x24')](_0x2c1208);}catch(_0x4353d5){utils[_0xe240('0x15')](util[_0xe240('0x1a')]('[%s][index][agentcomplete]',_0x2c1208['uniqueid']),_0x4353d5);}});ami['on'](_0xe240('0x26'),function(_0x2d304a){try{utils[_0xe240('0x19')](util['format'](_0xe240('0x27'),_0x2d304a[_0xe240('0x1f')]),_0x2d304a);agents[_0xe240('0x26')](_0x2d304a);queues[_0xe240('0x26')](_0x2d304a);}catch(_0x273cca){utils[_0xe240('0x15')](util[_0xe240('0x1a')]('[%s][index][queuecallerabandon]',_0x2d304a[_0xe240('0x1f')]),_0x273cca);}});ami['on'](_0xe240('0x28'),function(_0x3c9542){try{utils[_0xe240('0x19')](util[_0xe240('0x1a')](_0xe240('0x29'),_0x3c9542['uniqueid']),_0x3c9542);queues[_0xe240('0x28')](_0x3c9542);recordings[_0xe240('0x28')](_0x3c9542);}catch(_0x20003c){utils[_0xe240('0x15')](util['format'](_0xe240('0x29'),_0x3c9542['uniqueid']),_0x20003c);}});ami['on'](_0xe240('0x2a'),function(_0x524092){try{utils['debug'](util[_0xe240('0x1a')](_0xe240('0x2b'),_0x524092['uniqueid']),_0x524092);queues[_0xe240('0x2a')](_0x524092);}catch(_0x54fe7b){utils['error'](util['format'](_0xe240('0x2b'),_0x524092[_0xe240('0x1f')]),_0x54fe7b);}});ami['on']('musiconholdstart',function(_0x5bd9ad){try{utils[_0xe240('0x19')](util[_0xe240('0x1a')](_0xe240('0x2c'),_0x5bd9ad['uniqueid']),_0x5bd9ad);queues[_0xe240('0x2d')](_0x5bd9ad);calls['musiconholdstart'](_0x5bd9ad);}catch(_0x58aa77){utils[_0xe240('0x15')](util[_0xe240('0x1a')](_0xe240('0x2c'),_0x5bd9ad[_0xe240('0x1f')]),_0x58aa77);}});ami['on'](_0xe240('0x2e'),function(_0x5e41d5){try{utils[_0xe240('0x19')](util[_0xe240('0x1a')]('[%s][index][musiconholdstop]',_0x5e41d5['uniqueid']),_0x5e41d5);queues[_0xe240('0x2e')](_0x5e41d5);calls[_0xe240('0x2e')](_0x5e41d5);}catch(_0x3021ee){utils[_0xe240('0x15')](util[_0xe240('0x1a')](_0xe240('0x2f'),_0x5e41d5[_0xe240('0x1f')]),_0x3021ee);}});ami['on'](_0xe240('0x30'),function(_0xe7cfd){try{utils[_0xe240('0x19')](util['format'](_0xe240('0x31'),_0xe7cfd[_0xe240('0x1f')]),_0xe7cfd);calls[_0xe240('0x30')](_0xe7cfd);recordings[_0xe240('0x30')](_0xe7cfd);}catch(_0x2202b8){utils['error'](util['format'](_0xe240('0x31'),_0xe7cfd[_0xe240('0x1f')]),_0x2202b8);}});ami['on'](_0xe240('0x32'),function(_0x479390){try{utils[_0xe240('0x19')](util['format'](_0xe240('0x33'),_0x479390[_0xe240('0x1f')]),_0x479390);calls['hangup'](_0x479390);recordings['hangup'](_0x479390);dials[_0xe240('0x32')](_0x479390);agents[_0xe240('0x32')](_0x479390);queues[_0xe240('0x32')](_0x479390);}catch(_0x53c8a3){utils[_0xe240('0x15')](util[_0xe240('0x1a')](_0xe240('0x33'),_0x479390[_0xe240('0x1f')]),_0x53c8a3);}});ami['on'](_0xe240('0x34'),function(_0x180f2d){try{utils[_0xe240('0x19')](util['format'](_0xe240('0x35'),_0x180f2d[_0xe240('0x1f')]),_0x180f2d);members[_0xe240('0x34')](_0x180f2d);}catch(_0x1003ab){utils[_0xe240('0x15')](util['format'](_0xe240('0x35'),_0x180f2d[_0xe240('0x1f')]),_0x1003ab);}});ami['on'](_0xe240('0x36'),function(_0xa2af1e){try{utils['debug'](util[_0xe240('0x1a')](_0xe240('0x37'),_0xa2af1e[_0xe240('0x1f')]),_0xa2af1e);queues[_0xe240('0x36')](_0xa2af1e);agents['blindtransfer'](_0xa2af1e);transfers[_0xe240('0x36')](_0xa2af1e);}catch(_0x5b66fd){utils[_0xe240('0x15')](util[_0xe240('0x1a')]('[%s][index][blindtransfer]',_0xa2af1e[_0xe240('0x1f')]),_0x5b66fd);}});ami['on'](_0xe240('0x38'),function(_0x31b41a){try{utils[_0xe240('0x19')](util[_0xe240('0x1a')]('[%s][index][attendedtransfer]',_0x31b41a[_0xe240('0x39')]),_0x31b41a);queues[_0xe240('0x38')](_0x31b41a);transfers['attendedtransfer'](_0x31b41a);agents[_0xe240('0x38')](_0x31b41a);calls[_0xe240('0x38')](_0x31b41a);}catch(_0x5e6212){utils['error'](util['format'](_0xe240('0x3a'),_0x31b41a[_0xe240('0x39')]),_0x5e6212);}});ami['on']('varset',function(_0x2467a6){try{utils['debug'](util['format']('[%s][index][varset]',_0x2467a6['uniqueid']),_0x2467a6);queues[_0xe240('0x3b')](_0x2467a6);recordings[_0xe240('0x3b')](_0x2467a6);calls[_0xe240('0x3b')](_0x2467a6);dials[_0xe240('0x3b')](_0x2467a6);}catch(_0x18a5e2){utils[_0xe240('0x15')](util['format']('[%s][index][varset]',_0x2467a6[_0xe240('0x1f')]),_0x18a5e2);}});ami['on'](_0xe240('0x3c'),function(_0x20968d){try{utils[_0xe240('0x19')](util[_0xe240('0x1a')](_0xe240('0x3d'),_0x20968d['uniqueid']),_0x20968d);calls['newexten'](_0x20968d);recordings['newexten'](_0x20968d);dials[_0xe240('0x3c')](_0x20968d);}catch(_0x22ae58){utils[_0xe240('0x15')](util['format']('[%s][index][newexten]',_0x20968d['uniqueid']),_0x22ae58);}});ami['on']('newchannel',function(_0x3aaa87){try{utils['debug'](util[_0xe240('0x1a')]('[%s][index][newchannel]',_0x3aaa87[_0xe240('0x1f')]),_0x3aaa87);calls[_0xe240('0x3e')](_0x3aaa87);recordings[_0xe240('0x3e')](_0x3aaa87);}catch(_0x3cd2ad){utils[_0xe240('0x15')](util['format'](_0xe240('0x3f'),_0x3aaa87[_0xe240('0x1f')]),_0x3cd2ad);}});ami['on']('dialbegin',function(_0x14f494){try{utils['debug'](util[_0xe240('0x1a')](_0xe240('0x40'),_0x14f494['uniqueid']),_0x14f494);dials['dialbegin'](_0x14f494);}catch(_0xf71b31){utils['error'](util['format']('[%s]dialbegin',_0x14f494[_0xe240('0x1f')]),_0xf71b31);}});ami['on']('dialend',function(_0xd7db79){try{utils[_0xe240('0x19')](util['format']('[%s][index][dialend]',_0xd7db79[_0xe240('0x1f')]),_0xd7db79);dials[_0xe240('0x41')](_0xd7db79);}catch(_0x327568){utils[_0xe240('0x15')](util[_0xe240('0x1a')]('[%s][index][dialend]',_0xd7db79[_0xe240('0x1f')]),_0x327568);}});} \ No newline at end of file +var _0xf4b8=['[%s][index][queuecallerjoin]','[%s][index][queuecallerleave]','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]','../../config/environment','./utils','util','xdr','disabled','env','production','local','asterisk','port','username','keepConnected','info','XDR\x20DISABLED','Asterisk\x20disabled\x20on\x20localhost','./calls.controller','./queues.controller','./recordings.controller','./members.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','devicestatechange','debug','format','[%s][index][devicestatechange]','device','agentcalled','uniqueid','[%s][index][agentcalled]','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin'];(function(_0x5c6324,_0xc024b){var _0x10498f=function(_0x4ce3c4){while(--_0x4ce3c4){_0x5c6324['push'](_0x5c6324['shift']());}};_0x10498f(++_0xc024b);}(_0xf4b8,0x18a));var _0x8f4b=function(_0x359e4a,_0x4e9fcf){_0x359e4a=_0x359e4a-0x0;var _0x53a7d5=_0xf4b8[_0x359e4a];return _0x53a7d5;};var AsteriskManager=require('asterisk-manager');var config=require(_0x8f4b('0x0'));var utils=require(_0x8f4b('0x1'));var util=require(_0x8f4b('0x2'));var isXDREnabled=config[_0x8f4b('0x3')]&&config[_0x8f4b('0x3')]['disabled']?!config[_0x8f4b('0x3')][_0x8f4b('0x4')]:!![];var isProduction=config[_0x8f4b('0x5')]===_0x8f4b('0x6')||![];var isLocalAsterisk=config[_0x8f4b('0x3')]&&config[_0x8f4b('0x3')][_0x8f4b('0x7')]===!![]||![];var ami=new AsteriskManager(config[_0x8f4b('0x8')][_0x8f4b('0x9')],config[_0x8f4b('0x8')]['ip'],config[_0x8f4b('0x8')][_0x8f4b('0xa')],config[_0x8f4b('0x8')]['password'],!![]);ami[_0x8f4b('0xb')]();if(!isXDREnabled){utils[_0x8f4b('0xc')](_0x8f4b('0xd'));}else if(!isProduction&&!isLocalAsterisk){utils[_0x8f4b('0xc')](_0x8f4b('0xe'));}else{var agents=require('./agents.controller');var calls=require(_0x8f4b('0xf'));var queues=require(_0x8f4b('0x10'));var recordings=require(_0x8f4b('0x11'));var members=require(_0x8f4b('0x12'));var dials=require(_0x8f4b('0x13'));var transfers=require(_0x8f4b('0x14'));var core=require(_0x8f4b('0x15'));ami['on'](_0x8f4b('0x16'),core[_0x8f4b('0x16')]);ami['on']('shutdown',core[_0x8f4b('0x17')]);ami['on'](_0x8f4b('0x18'),core[_0x8f4b('0x18')]);ami['on'](_0x8f4b('0x19'),core['error']);ami['on'](_0x8f4b('0x1a'),core['close']);ami['on']('managerevent',core['managerevent']);ami['on'](_0x8f4b('0x1b'),function(_0x59c9de){try{utils[_0x8f4b('0x1c')](util[_0x8f4b('0x1d')](_0x8f4b('0x1e'),_0x59c9de[_0x8f4b('0x1f')]),_0x59c9de);members[_0x8f4b('0x1b')](_0x59c9de);}catch(_0x50684a){utils[_0x8f4b('0x19')](util[_0x8f4b('0x1d')](_0x8f4b('0x1e'),_0x59c9de[_0x8f4b('0x1f')]),_0x50684a);}});ami['on'](_0x8f4b('0x20'),function(_0x490bbb){try{utils['debug'](util['format']('[%s][index][agentcalled]',_0x490bbb[_0x8f4b('0x21')]),_0x490bbb);agents[_0x8f4b('0x20')](_0x490bbb);}catch(_0x5bed2a){utils[_0x8f4b('0x19')](util[_0x8f4b('0x1d')](_0x8f4b('0x22'),_0x490bbb[_0x8f4b('0x21')]),_0x5bed2a);}});ami['on']('agentringnoanswer',function(_0xd25325){try{utils['debug'](util[_0x8f4b('0x1d')]('[%s][index][agentringnoanswer]',_0xd25325[_0x8f4b('0x21')]),_0xd25325);agents[_0x8f4b('0x23')](_0xd25325);}catch(_0xb7dbfc){utils[_0x8f4b('0x19')](util[_0x8f4b('0x1d')](_0x8f4b('0x24'),_0xd25325[_0x8f4b('0x21')]),_0xb7dbfc);}});ami['on'](_0x8f4b('0x25'),function(_0x56f08c){try{utils[_0x8f4b('0x1c')](util[_0x8f4b('0x1d')](_0x8f4b('0x26'),_0x56f08c[_0x8f4b('0x21')]),_0x56f08c);agents[_0x8f4b('0x25')](_0x56f08c);queues[_0x8f4b('0x25')](_0x56f08c);}catch(_0x34c598){utils[_0x8f4b('0x19')](util[_0x8f4b('0x1d')](_0x8f4b('0x26'),_0x56f08c['uniqueid']),_0x34c598);}});ami['on']('agentcomplete',function(_0x46901a){try{utils[_0x8f4b('0x1c')](util[_0x8f4b('0x1d')]('[%s][index][agentcomplete]',_0x46901a[_0x8f4b('0x21')]),_0x46901a);agents['agentcomplete'](_0x46901a);queues['agentcomplete'](_0x46901a);members[_0x8f4b('0x27')](_0x46901a);}catch(_0x435577){utils[_0x8f4b('0x19')](util[_0x8f4b('0x1d')](_0x8f4b('0x28'),_0x46901a[_0x8f4b('0x21')]),_0x435577);}});ami['on'](_0x8f4b('0x29'),function(_0x50077b){try{utils[_0x8f4b('0x1c')](util[_0x8f4b('0x1d')](_0x8f4b('0x2a'),_0x50077b[_0x8f4b('0x21')]),_0x50077b);agents['queuecallerabandon'](_0x50077b);queues[_0x8f4b('0x29')](_0x50077b);}catch(_0x904828){utils['error'](util[_0x8f4b('0x1d')]('[%s][index][queuecallerabandon]',_0x50077b['uniqueid']),_0x904828);}});ami['on'](_0x8f4b('0x2b'),function(_0x38c108){try{utils[_0x8f4b('0x1c')](util['format'](_0x8f4b('0x2c'),_0x38c108[_0x8f4b('0x21')]),_0x38c108);queues[_0x8f4b('0x2b')](_0x38c108);recordings[_0x8f4b('0x2b')](_0x38c108);}catch(_0xb2d457){utils[_0x8f4b('0x19')](util[_0x8f4b('0x1d')](_0x8f4b('0x2c'),_0x38c108[_0x8f4b('0x21')]),_0xb2d457);}});ami['on']('queuecallerleave',function(_0x4f1303){try{utils[_0x8f4b('0x1c')](util[_0x8f4b('0x1d')](_0x8f4b('0x2d'),_0x4f1303['uniqueid']),_0x4f1303);queues[_0x8f4b('0x2e')](_0x4f1303);}catch(_0x4286fe){utils[_0x8f4b('0x19')](util[_0x8f4b('0x1d')](_0x8f4b('0x2d'),_0x4f1303[_0x8f4b('0x21')]),_0x4286fe);}});ami['on'](_0x8f4b('0x2f'),function(_0x744c7){try{utils[_0x8f4b('0x1c')](util[_0x8f4b('0x1d')]('[%s][index][musiconholdstart]',_0x744c7['uniqueid']),_0x744c7);queues[_0x8f4b('0x2f')](_0x744c7);calls[_0x8f4b('0x2f')](_0x744c7);}catch(_0x2524ef){utils[_0x8f4b('0x19')](util[_0x8f4b('0x1d')](_0x8f4b('0x30'),_0x744c7[_0x8f4b('0x21')]),_0x2524ef);}});ami['on'](_0x8f4b('0x31'),function(_0x6d52bb){try{utils[_0x8f4b('0x1c')](util[_0x8f4b('0x1d')](_0x8f4b('0x32'),_0x6d52bb['uniqueid']),_0x6d52bb);queues[_0x8f4b('0x31')](_0x6d52bb);calls[_0x8f4b('0x31')](_0x6d52bb);}catch(_0x1c4676){utils[_0x8f4b('0x19')](util[_0x8f4b('0x1d')](_0x8f4b('0x32'),_0x6d52bb[_0x8f4b('0x21')]),_0x1c4676);}});ami['on'](_0x8f4b('0x33'),function(_0x1f4e1d){try{utils[_0x8f4b('0x1c')](util[_0x8f4b('0x1d')](_0x8f4b('0x34'),_0x1f4e1d[_0x8f4b('0x21')]),_0x1f4e1d);calls[_0x8f4b('0x33')](_0x1f4e1d);recordings[_0x8f4b('0x33')](_0x1f4e1d);}catch(_0x477065){utils[_0x8f4b('0x19')](util[_0x8f4b('0x1d')]('[%s][index][newstate]',_0x1f4e1d['uniqueid']),_0x477065);}});ami['on'](_0x8f4b('0x35'),function(_0x204b49){try{utils[_0x8f4b('0x1c')](util[_0x8f4b('0x1d')](_0x8f4b('0x36'),_0x204b49['uniqueid']),_0x204b49);calls['hangup'](_0x204b49);recordings['hangup'](_0x204b49);dials[_0x8f4b('0x35')](_0x204b49);agents['hangup'](_0x204b49);queues['hangup'](_0x204b49);}catch(_0x13fb11){utils[_0x8f4b('0x19')](util[_0x8f4b('0x1d')](_0x8f4b('0x36'),_0x204b49[_0x8f4b('0x21')]),_0x13fb11);}});ami['on'](_0x8f4b('0x37'),function(_0x3b0cdb){try{utils[_0x8f4b('0x1c')](util[_0x8f4b('0x1d')](_0x8f4b('0x38'),_0x3b0cdb[_0x8f4b('0x21')]),_0x3b0cdb);members[_0x8f4b('0x37')](_0x3b0cdb);}catch(_0x151c9c){utils['error'](util[_0x8f4b('0x1d')](_0x8f4b('0x38'),_0x3b0cdb[_0x8f4b('0x21')]),_0x151c9c);}});ami['on'](_0x8f4b('0x39'),function(_0x41712c){try{utils[_0x8f4b('0x1c')](util[_0x8f4b('0x1d')]('[%s][index][blindtransfer]',_0x41712c[_0x8f4b('0x21')]),_0x41712c);queues['blindtransfer'](_0x41712c);agents[_0x8f4b('0x39')](_0x41712c);transfers['blindtransfer'](_0x41712c);}catch(_0x5e0348){utils[_0x8f4b('0x19')](util[_0x8f4b('0x1d')](_0x8f4b('0x3a'),_0x41712c[_0x8f4b('0x21')]),_0x5e0348);}});ami['on'](_0x8f4b('0x3b'),function(_0x2e9b49){try{utils['debug'](util['format'](_0x8f4b('0x3c'),_0x2e9b49[_0x8f4b('0x3d')]),_0x2e9b49);queues[_0x8f4b('0x3b')](_0x2e9b49);transfers[_0x8f4b('0x3b')](_0x2e9b49);agents[_0x8f4b('0x3b')](_0x2e9b49);calls[_0x8f4b('0x3b')](_0x2e9b49);}catch(_0x2e2567){utils['error'](util['format'](_0x8f4b('0x3c'),_0x2e9b49['origtransfereruniqueid']),_0x2e2567);}});ami['on'](_0x8f4b('0x3e'),function(_0x4b74d6){try{utils[_0x8f4b('0x1c')](util[_0x8f4b('0x1d')](_0x8f4b('0x3f'),_0x4b74d6['uniqueid']),_0x4b74d6);queues[_0x8f4b('0x3e')](_0x4b74d6);recordings[_0x8f4b('0x3e')](_0x4b74d6);calls[_0x8f4b('0x3e')](_0x4b74d6);dials[_0x8f4b('0x3e')](_0x4b74d6);}catch(_0x269c0c){utils['error'](util[_0x8f4b('0x1d')](_0x8f4b('0x3f'),_0x4b74d6[_0x8f4b('0x21')]),_0x269c0c);}});ami['on'](_0x8f4b('0x40'),function(_0x457ae3){try{utils[_0x8f4b('0x1c')](util[_0x8f4b('0x1d')]('[%s][index][newexten]',_0x457ae3[_0x8f4b('0x21')]),_0x457ae3);calls[_0x8f4b('0x40')](_0x457ae3);recordings[_0x8f4b('0x40')](_0x457ae3);dials[_0x8f4b('0x40')](_0x457ae3);}catch(_0x590c03){utils[_0x8f4b('0x19')](util[_0x8f4b('0x1d')](_0x8f4b('0x41'),_0x457ae3[_0x8f4b('0x21')]),_0x590c03);}});ami['on'](_0x8f4b('0x42'),function(_0x334ed){try{utils[_0x8f4b('0x1c')](util['format'](_0x8f4b('0x43'),_0x334ed[_0x8f4b('0x21')]),_0x334ed);calls[_0x8f4b('0x42')](_0x334ed);recordings['newchannel'](_0x334ed);}catch(_0x190baa){utils[_0x8f4b('0x19')](util[_0x8f4b('0x1d')](_0x8f4b('0x43'),_0x334ed[_0x8f4b('0x21')]),_0x190baa);}});ami['on'](_0x8f4b('0x44'),function(_0x1e2521){try{utils[_0x8f4b('0x1c')](util[_0x8f4b('0x1d')](_0x8f4b('0x45'),_0x1e2521[_0x8f4b('0x21')]),_0x1e2521);dials['dialbegin'](_0x1e2521);}catch(_0x13b51a){utils[_0x8f4b('0x19')](util['format'](_0x8f4b('0x46'),_0x1e2521[_0x8f4b('0x21')]),_0x13b51a);}});ami['on'](_0x8f4b('0x47'),function(_0x461b35){try{utils['debug'](util['format'](_0x8f4b('0x48'),_0x461b35[_0x8f4b('0x21')]),_0x461b35);dials['dialend'](_0x461b35);}catch(_0x450332){utils[_0x8f4b('0x19')](util[_0x8f4b('0x1d')](_0x8f4b('0x48'),_0x461b35[_0x8f4b('0x21')]),_0x450332);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index df1eb29..90b5898 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 _0xc21d=['exitAt','[%s][members][devicestatechange]','isNil','[%s][members][agentcomplete]','info','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','cdr','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','data1','source','data3','[%s][members][cdr]','lodash','util','./utils','Queue:','interface','channel','data2','membername','type','getUserByInterface','then','name','request','CreateMemberReport','getUserByName','split','internal','catch','error','format','[%s][members][writeDB]','uniqueid','some','startsWith','devicestatechange','debug','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','now','agent','NOT_INUSE','duration','diffTime'];(function(_0x580b15,_0x28afa4){var _0x1adb1b=function(_0x47a01f){while(--_0x47a01f){_0x580b15['push'](_0x580b15['shift']());}};_0x1adb1b(++_0x28afa4);}(_0xc21d,0x1a8));var _0xdc21=function(_0x56d085,_0x391670){_0x56d085=_0x56d085-0x0;var _0x3afbae=_0xc21d[_0x56d085];return _0x3afbae;};'use strict';var _=require(_0xdc21('0x0'));var util=require(_0xdc21('0x1'));var utils=require(_0xdc21('0x2'));var members={};var exclude=['Local/_attended@transfer',_0xdc21('0x3')];function writeDB(_0x2cc585){utils['info'](util['format']('[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s',_0x2cc585['uniqueid'],_0x2cc585[_0xdc21('0x4')],_0x2cc585[_0xdc21('0x5')],_0x2cc585[_0xdc21('0x6')],_0x2cc585[_0xdc21('0x7')],_0x2cc585[_0xdc21('0x8')]));if(_0x2cc585['interface']){utils[_0xdc21('0x9')](_0x2cc585[_0xdc21('0x4')])[_0xdc21('0xa')](function(_0x5daebf){if(_0x5daebf){_0x2cc585[_0xdc21('0x7')]=_0x5daebf[_0xdc21('0xb')];_0x2cc585['internal']=_0x5daebf['internal'];utils[_0xdc21('0xc')](_0xdc21('0xd'),_0x2cc585);}else{utils[_0xdc21('0xe')](_0x2cc585[_0xdc21('0x4')][_0xdc21('0xf')]('/')[0x1])['then'](function(_0xb0e70b){if(_0xb0e70b){_0x2cc585['membername']=_0xb0e70b[_0xdc21('0xb')];_0x2cc585[_0xdc21('0x10')]=_0xb0e70b['internal'];utils['request']('CreateMemberReport',_0x2cc585);}});}})[_0xdc21('0x11')](function(_0x386a47){utils[_0xdc21('0x12')](util[_0xdc21('0x13')](_0xdc21('0x14'),_0x2cc585[_0xdc21('0x15')]),_0x386a47);});}delete members[_0x2cc585['interface']];}function startsWith(_0x6ef3da,_0x1a7fe1){return _[_0xdc21('0x16')](_0x6ef3da,function(_0x12ee9d){return _[_0xdc21('0x17')](_0x1a7fe1,_0x12ee9d);});}exports[_0xdc21('0x18')]=function(_0x31b1a3){try{utils[_0xdc21('0x19')](util[_0xdc21('0x13')]('[%s][members][devicestatechange]',members[_0x31b1a3[_0xdc21('0x1a')]]?members[_0x31b1a3['device']][_0xdc21('0x15')]:_0x31b1a3[_0xdc21('0x1a')]),_0x31b1a3);utils['info'](util[_0xdc21('0x13')](_0xdc21('0x1b'),members[_0x31b1a3[_0xdc21('0x1a')]]?members[_0x31b1a3[_0xdc21('0x1a')]][_0xdc21('0x15')]:_0x31b1a3[_0xdc21('0x1a')],_0x31b1a3['state'],_0x31b1a3[_0xdc21('0x1a')]));switch(_0x31b1a3[_0xdc21('0x1c')]){case _0xdc21('0x1d'):case'BUSY':if(!startsWith(exclude,_0x31b1a3[_0xdc21('0x1a')])){members[_0x31b1a3[_0xdc21('0x1a')]]={'channel':'voice','interface':_0x31b1a3['device'],'type':'TALKING','enterAt':utils[_0xdc21('0x1e')](),'role':_0xdc21('0x1f')};}break;case _0xdc21('0x20'):if(!_['isNil'](members[_0x31b1a3['device']])){members[_0x31b1a3[_0xdc21('0x1a')]]['exitAt']=utils['now']();members[_0x31b1a3[_0xdc21('0x1a')]][_0xdc21('0x21')]=utils[_0xdc21('0x22')](members[_0x31b1a3[_0xdc21('0x1a')]][_0xdc21('0x23')],members[_0x31b1a3[_0xdc21('0x1a')]]['enterAt']);if(members[_0x31b1a3['device']][_0xdc21('0x15')]){writeDB(members[_0x31b1a3[_0xdc21('0x1a')]]);}}break;default:break;}}catch(_0x3d9533){utils[_0xdc21('0x12')](util[_0xdc21('0x13')](_0xdc21('0x24'),members[_0x31b1a3[_0xdc21('0x1a')]]?members[_0x31b1a3['device']][_0xdc21('0x15')]:_0x31b1a3[_0xdc21('0x1a')]),_0x3d9533);}};exports['agentcomplete']=function(_0x1786ab){try{if(!_[_0xdc21('0x25')](members[_0x1786ab[_0xdc21('0x4')]])){utils[_0xdc21('0x19')](util[_0xdc21('0x13')](_0xdc21('0x26'),_0x1786ab[_0xdc21('0x15')]),_0x1786ab);utils[_0xdc21('0x27')](util['format'](_0xdc21('0x28'),_0x1786ab[_0xdc21('0x15')],_0x1786ab[_0xdc21('0x4')],_0x1786ab[_0xdc21('0x29')]));members[_0x1786ab[_0xdc21('0x4')]]=_[_0xdc21('0x2a')](members[_0x1786ab[_0xdc21('0x4')]],{'data4':_0x1786ab['queue'],'uniqueid':_0x1786ab['uniqueid']});}}catch(_0x562c5d){utils[_0xdc21('0x12')](util[_0xdc21('0x13')]('[%s][members][agentcomplete]',_0x1786ab[_0xdc21('0x15')]),_0x562c5d);}};exports[_0xdc21('0x2b')]=function(_0x342cd6){try{utils[_0xdc21('0x19')](util[_0xdc21('0x13')]('[%s][members][cdr]',_0x342cd6['uniqueid']),_0x342cd6);if(_0x342cd6[_0xdc21('0x5')]){var _0x3f4518=_0x342cd6[_0xdc21('0x5')][_0xdc21('0xf')]('-')[0x0];if(!_[_0xdc21('0x25')](members[_0x3f4518])){members[_0x3f4518]=_[_0xdc21('0x2a')](members[_0x3f4518],{'data1':members[_0x3f4518]['data1']||_0x342cd6[_0xdc21('0x8')],'data2':members[_0x3f4518][_0xdc21('0x6')]||_0x342cd6['source'],'data3':members[_0x3f4518]['data3']||_0x342cd6[_0xdc21('0x2c')],'uniqueid':members[_0x3f4518][_0xdc21('0x15')]||_0x342cd6[_0xdc21('0x15')]});utils[_0xdc21('0x27')](util['format'](_0xdc21('0x2d'),_0x342cd6[_0xdc21('0x15')],members[_0x3f4518]['data1'],members[_0x3f4518][_0xdc21('0x6')],members[_0x3f4518]['data3']));if(members[_0x3f4518]['exitAt']){writeDB(members[_0x3f4518]);}}}if(_0x342cd6[_0xdc21('0x2e')]){var _0x1e7f7c=_0x342cd6[_0xdc21('0x2e')][_0xdc21('0xf')]('-')[0x0];if(!_[_0xdc21('0x25')](members[_0x1e7f7c])){members[_0x1e7f7c]=_[_0xdc21('0x2a')](members[_0x1e7f7c],{'data1':members[_0x1e7f7c][_0xdc21('0x2f')]||_0x342cd6['type'],'data2':members[_0x1e7f7c][_0xdc21('0x6')]||_0x342cd6[_0xdc21('0x30')],'data3':members[_0x1e7f7c][_0xdc21('0x31')]||_0x342cd6['destination'],'uniqueid':members[_0x1e7f7c][_0xdc21('0x15')]||_0x342cd6[_0xdc21('0x15')]});utils[_0xdc21('0x27')](util[_0xdc21('0x13')](_0xdc21('0x2d'),_0x342cd6[_0xdc21('0x15')],members[_0x1e7f7c][_0xdc21('0x2f')],members[_0x1e7f7c][_0xdc21('0x6')],members[_0x1e7f7c][_0xdc21('0x31')]));if(members[_0x1e7f7c][_0xdc21('0x23')]){writeDB(members[_0x1e7f7c]);}}}}catch(_0x148cf8){utils['error'](util['format'](_0xdc21('0x32'),_0x342cd6['uniqueid']),_0x148cf8);}}; \ No newline at end of file +var _0x351d=['name','internal','CreateMemberReport','getUserByName','split','request','catch','error','format','[%s][members][writeDB]','uniqueid','devicestatechange','debug','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','BUSY','voice','TALKING','now','agent','NOT_INUSE','isNil','duration','diffTime','exitAt','enterAt','[%s][members][agentcomplete]','queue','assign','cdr','[%s][members][cdr]','channel','data1','data3','destination','destinationchannel','source','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','lodash','util','./utils','Local/_attended@transfer','Queue:','info','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','interface','data2','type','getUserByInterface','then','membername'];(function(_0x15eddc,_0x30129b){var _0x301b89=function(_0x370bfc){while(--_0x370bfc){_0x15eddc['push'](_0x15eddc['shift']());}};_0x301b89(++_0x30129b);}(_0x351d,0x137));var _0xd351=function(_0x269f18,_0x3603e6){_0x269f18=_0x269f18-0x0;var _0x5d47bb=_0x351d[_0x269f18];return _0x5d47bb;};'use strict';var _=require(_0xd351('0x0'));var util=require(_0xd351('0x1'));var utils=require(_0xd351('0x2'));var members={};var exclude=[_0xd351('0x3'),_0xd351('0x4')];function writeDB(_0x1e169a){utils[_0xd351('0x5')](util['format'](_0xd351('0x6'),_0x1e169a['uniqueid'],_0x1e169a[_0xd351('0x7')],_0x1e169a['channel'],_0x1e169a[_0xd351('0x8')],_0x1e169a['membername'],_0x1e169a[_0xd351('0x9')]));if(_0x1e169a[_0xd351('0x7')]){utils[_0xd351('0xa')](_0x1e169a[_0xd351('0x7')])[_0xd351('0xb')](function(_0x32b842){if(_0x32b842){_0x1e169a[_0xd351('0xc')]=_0x32b842[_0xd351('0xd')];_0x1e169a[_0xd351('0xe')]=_0x32b842[_0xd351('0xe')];utils['request'](_0xd351('0xf'),_0x1e169a);}else{utils[_0xd351('0x10')](_0x1e169a[_0xd351('0x7')][_0xd351('0x11')]('/')[0x1])[_0xd351('0xb')](function(_0x4f753d){if(_0x4f753d){_0x1e169a[_0xd351('0xc')]=_0x4f753d[_0xd351('0xd')];_0x1e169a[_0xd351('0xe')]=_0x4f753d[_0xd351('0xe')];utils[_0xd351('0x12')](_0xd351('0xf'),_0x1e169a);}});}})[_0xd351('0x13')](function(_0x4b2169){utils[_0xd351('0x14')](util[_0xd351('0x15')](_0xd351('0x16'),_0x1e169a[_0xd351('0x17')]),_0x4b2169);});}delete members[_0x1e169a['interface']];}function startsWith(_0xe45642,_0x443ca8){return _['some'](_0xe45642,function(_0x1e78a0){return _['startsWith'](_0x443ca8,_0x1e78a0);});}exports[_0xd351('0x18')]=function(_0x5891d8){try{utils[_0xd351('0x19')](util[_0xd351('0x15')](_0xd351('0x1a'),members[_0x5891d8[_0xd351('0x1b')]]?members[_0x5891d8[_0xd351('0x1b')]][_0xd351('0x17')]:_0x5891d8['device']),_0x5891d8);utils['info'](util['format'](_0xd351('0x1c'),members[_0x5891d8[_0xd351('0x1b')]]?members[_0x5891d8['device']][_0xd351('0x17')]:_0x5891d8[_0xd351('0x1b')],_0x5891d8[_0xd351('0x1d')],_0x5891d8[_0xd351('0x1b')]));switch(_0x5891d8[_0xd351('0x1d')]){case _0xd351('0x1e'):case _0xd351('0x1f'):if(!startsWith(exclude,_0x5891d8['device'])){members[_0x5891d8[_0xd351('0x1b')]]={'channel':_0xd351('0x20'),'interface':_0x5891d8['device'],'type':_0xd351('0x21'),'enterAt':utils[_0xd351('0x22')](),'role':_0xd351('0x23')};}break;case _0xd351('0x24'):if(!_[_0xd351('0x25')](members[_0x5891d8[_0xd351('0x1b')]])){members[_0x5891d8[_0xd351('0x1b')]]['exitAt']=utils['now']();members[_0x5891d8[_0xd351('0x1b')]][_0xd351('0x26')]=utils[_0xd351('0x27')](members[_0x5891d8[_0xd351('0x1b')]][_0xd351('0x28')],members[_0x5891d8['device']][_0xd351('0x29')]);if(members[_0x5891d8[_0xd351('0x1b')]][_0xd351('0x17')]){writeDB(members[_0x5891d8['device']]);}}break;default:break;}}catch(_0x287410){utils['error'](util[_0xd351('0x15')](_0xd351('0x1a'),members[_0x5891d8[_0xd351('0x1b')]]?members[_0x5891d8['device']][_0xd351('0x17')]:_0x5891d8[_0xd351('0x1b')]),_0x287410);}};exports['agentcomplete']=function(_0x5541e0){try{if(!_[_0xd351('0x25')](members[_0x5541e0[_0xd351('0x7')]])){utils[_0xd351('0x19')](util[_0xd351('0x15')](_0xd351('0x2a'),_0x5541e0['uniqueid']),_0x5541e0);utils[_0xd351('0x5')](util[_0xd351('0x15')]('[%s][members][agentcomplete]\x20interface:%s\x20queue:%s',_0x5541e0[_0xd351('0x17')],_0x5541e0[_0xd351('0x7')],_0x5541e0[_0xd351('0x2b')]));members[_0x5541e0[_0xd351('0x7')]]=_[_0xd351('0x2c')](members[_0x5541e0[_0xd351('0x7')]],{'data4':_0x5541e0[_0xd351('0x2b')],'uniqueid':_0x5541e0[_0xd351('0x17')]});}}catch(_0x31bf92){utils[_0xd351('0x14')](util['format'](_0xd351('0x2a'),_0x5541e0[_0xd351('0x17')]),_0x31bf92);}};exports[_0xd351('0x2d')]=function(_0x5436b3){try{utils[_0xd351('0x19')](util['format'](_0xd351('0x2e'),_0x5436b3[_0xd351('0x17')]),_0x5436b3);if(_0x5436b3[_0xd351('0x2f')]){var _0x34ed58=_0x5436b3[_0xd351('0x2f')][_0xd351('0x11')]('-')[0x0];if(!_[_0xd351('0x25')](members[_0x34ed58])){members[_0x34ed58]=_[_0xd351('0x2c')](members[_0x34ed58],{'data1':members[_0x34ed58][_0xd351('0x30')]||_0x5436b3['type'],'data2':members[_0x34ed58][_0xd351('0x8')]||_0x5436b3['source'],'data3':members[_0x34ed58][_0xd351('0x31')]||_0x5436b3[_0xd351('0x32')],'uniqueid':members[_0x34ed58]['uniqueid']||_0x5436b3[_0xd351('0x17')]});utils[_0xd351('0x5')](util['format']('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x5436b3['uniqueid'],members[_0x34ed58]['data1'],members[_0x34ed58][_0xd351('0x8')],members[_0x34ed58][_0xd351('0x31')]));if(members[_0x34ed58]['exitAt']){writeDB(members[_0x34ed58]);}}}if(_0x5436b3[_0xd351('0x33')]){var _0x55cdbe=_0x5436b3['destinationchannel'][_0xd351('0x11')]('-')[0x0];if(!_[_0xd351('0x25')](members[_0x55cdbe])){members[_0x55cdbe]=_[_0xd351('0x2c')](members[_0x55cdbe],{'data1':members[_0x55cdbe][_0xd351('0x30')]||_0x5436b3[_0xd351('0x9')],'data2':members[_0x55cdbe]['data2']||_0x5436b3[_0xd351('0x34')],'data3':members[_0x55cdbe]['data3']||_0x5436b3[_0xd351('0x32')],'uniqueid':members[_0x55cdbe]['uniqueid']||_0x5436b3[_0xd351('0x17')]});utils[_0xd351('0x5')](util['format'](_0xd351('0x35'),_0x5436b3[_0xd351('0x17')],members[_0x55cdbe][_0xd351('0x30')],members[_0x55cdbe]['data2'],members[_0x55cdbe][_0xd351('0x31')]));if(members[_0x55cdbe]['exitAt']){writeDB(members[_0x55cdbe]);}}}}catch(_0x343dc4){utils[_0xd351('0x14')](util['format'](_0xd351('0x2e'),_0x5436b3['uniqueid']),_0x343dc4);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index 8f70e12..8f39c19 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 _0x04b5=['[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','[%s][queues][musiconholdstop]','lodash','util','./utils','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','channel','queue','lastAssignedTo','calleridnum','queuecallerexitreason','type','CreateVoiceQueueReport','request','transfereduniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','uniqueid','info','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','assign','position','error','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercomplete','queuecallercompleteAt','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','varset','[%s][queues][varset]','isNil','queuestatus','value','CONTINUE','queuecallerabandonAt','queuecallerexitAt','now','toUpperCase','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','queuecallerleave','holdtime','diffTime','queuecallerjoinAt','count','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','destaccountcode','assigned','membername','agentcomplete','reason','transfer','TRANSFER','COMPLETEDBY','[%s][queues][agentcomplete]','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','BLIND','transferexten','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','extension','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','transfertype','ATTENDED','transferuniqueid','ATTENDEDTRANSFER','transfereelinkedid','clone','calleridname','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','secondtransfererexten','transfertargetlinkedid','transfertargetuniqueid','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s'];(function(_0x1e40ec,_0x10f980){var _0x437917=function(_0x125df6){while(--_0x125df6){_0x1e40ec['push'](_0x1e40ec['shift']());}};_0x437917(++_0x10f980);}(_0x04b5,0x146));var _0x504b=function(_0x1b17ca,_0x3adb66){_0x1b17ca=_0x1b17ca-0x0;var _0x4b627d=_0x04b5[_0x1b17ca];return _0x4b627d;};'use strict';var _=require(_0x504b('0x0'));var util=require(_0x504b('0x1'));var utils=require(_0x504b('0x2'));var queues={};function writeDB(_0x4388bf){utils['info'](util[_0x504b('0x3')](_0x504b('0x4'),_0x4388bf['uniqueid'],_0x4388bf[_0x504b('0x5')],_0x4388bf[_0x504b('0x6')],_0x4388bf[_0x504b('0x7')],_0x4388bf[_0x504b('0x8')],_0x4388bf['accountcode'],_0x4388bf[_0x504b('0x9')]));if(_0x4388bf[_0x504b('0x6')]){utils['getVoiceQueueByName'](_0x4388bf['queue'])['then'](function(_0x47bc2d){if(_0x47bc2d){_0x4388bf['type']=_0x47bc2d[_0x504b('0xa')];}utils['request'](_0x504b('0xb'),_0x4388bf);});}else{utils[_0x504b('0xc')]('CreateVoiceQueueReport',_0x4388bf);}if(_0x4388bf[_0x504b('0xd')]){delete queues[_0x4388bf[_0x504b('0xd')]];}else{delete queues[_0x4388bf['uniqueid']];}}exports[_0x504b('0xe')]=function(_0xe7e5bf){try{utils[_0x504b('0xf')](util[_0x504b('0x3')](_0x504b('0x10'),_0xe7e5bf[_0x504b('0x11')]),_0xe7e5bf);utils[_0x504b('0x12')](util[_0x504b('0x3')](_0x504b('0x13'),_0xe7e5bf[_0x504b('0x11')],_0xe7e5bf[_0x504b('0x6')],_0xe7e5bf['position']));queues[_0xe7e5bf[_0x504b('0x11')]]=_[_0x504b('0x14')](_0xe7e5bf,{'originalposition':_0xe7e5bf[_0x504b('0x15')],'queuecallerjoinAt':utils['now'](),'mohtime':0x0});}catch(_0x261646){utils[_0x504b('0x16')](util[_0x504b('0x3')](_0x504b('0x10'),_0xe7e5bf[_0x504b('0x11')]),_0x261646);}};exports['hangup']=function(_0x56b4f7){try{if(!_['isNil'](queues[_0x56b4f7[_0x504b('0x11')]])){utils[_0x504b('0xf')](util[_0x504b('0x3')](_0x504b('0x17'),_0x56b4f7[_0x504b('0x11')]),_0x56b4f7);if(queues[_0x56b4f7[_0x504b('0x11')]][_0x504b('0x18')]){if(!queues[_0x56b4f7[_0x504b('0x11')]][_0x504b('0x19')]&&!queues[_0x56b4f7[_0x504b('0x11')]][_0x504b('0x1a')]){queues[_0x56b4f7[_0x504b('0x11')]][_0x504b('0x1b')]=!![];queues[_0x56b4f7[_0x504b('0x11')]][_0x504b('0x1c')]=utils['now']();queues[_0x56b4f7[_0x504b('0x11')]][_0x504b('0x9')]=_0x504b('0x1d');}utils['info'](util[_0x504b('0x3')](_0x504b('0x1e'),_0x56b4f7[_0x504b('0x11')],queues[_0x56b4f7['uniqueid']][_0x504b('0x1f')],queues[_0x56b4f7['uniqueid']]['queuecallerexitreason']));writeDB(queues[_0x56b4f7[_0x504b('0x11')]]);}else if(queues[_0x56b4f7[_0x504b('0x11')]][_0x504b('0xd')]){utils[_0x504b('0x12')](util[_0x504b('0x3')](_0x504b('0x20'),_0x56b4f7['uniqueid'],queues[_0x56b4f7[_0x504b('0x11')]][_0x504b('0x1f')],queues[_0x56b4f7[_0x504b('0x11')]][_0x504b('0xd')]));queues[queues[_0x56b4f7[_0x504b('0x11')]][_0x504b('0xd')]]=queues[_0x56b4f7['uniqueid']];queues[queues[_0x56b4f7['uniqueid']][_0x504b('0xd')]][_0x504b('0x21')]=0x2;delete queues[_0x56b4f7[_0x504b('0x11')]];}}}catch(_0x437941){utils[_0x504b('0x16')](util['format'](_0x504b('0x17'),_0x56b4f7['uniqueid']),_0x437941);}};exports[_0x504b('0x22')]=function(_0x8b32c3){try{utils[_0x504b('0xf')](util['format'](_0x504b('0x23'),_0x8b32c3[_0x504b('0x11')]),_0x8b32c3);if(!_[_0x504b('0x24')](_0x8b32c3['variable'][_0x504b('0x25')])&&_0x8b32c3[_0x504b('0x26')]['toUpperCase']()!==_0x504b('0x27')){if(!_['isNil'](queues[_0x8b32c3[_0x504b('0x11')]])){queues[_0x8b32c3[_0x504b('0x11')]][_0x504b('0x19')]=![];queues[_0x8b32c3['uniqueid']][_0x504b('0x28')]=null;queues[_0x8b32c3[_0x504b('0x11')]][_0x504b('0x1a')]=!![];queues[_0x8b32c3[_0x504b('0x11')]][_0x504b('0x29')]=utils[_0x504b('0x2a')]();queues[_0x8b32c3[_0x504b('0x11')]][_0x504b('0x9')]=_0x8b32c3[_0x504b('0x26')][_0x504b('0x2b')]();utils['info'](util[_0x504b('0x3')](_0x504b('0x2c'),_0x8b32c3[_0x504b('0x11')],queues[_0x8b32c3[_0x504b('0x11')]][_0x504b('0x1f')],_0x8b32c3['value'],queues[_0x8b32c3[_0x504b('0x11')]][_0x504b('0x9')]));writeDB(queues[_0x8b32c3[_0x504b('0x11')]]);}}else if(!_['isNil'](_0x8b32c3['variable'][_0x504b('0x2d')])){if(!_[_0x504b('0x24')](queues[_0x8b32c3[_0x504b('0x11')]])&&!queues[_0x8b32c3[_0x504b('0x11')]]['queuecallerabandon']){queues[_0x8b32c3[_0x504b('0x11')]][_0x504b('0x19')]=![];queues[_0x8b32c3['uniqueid']][_0x504b('0x28')]=null;queues[_0x8b32c3[_0x504b('0x11')]][_0x504b('0x1a')]=!![];queues[_0x8b32c3[_0x504b('0x11')]][_0x504b('0x29')]=utils[_0x504b('0x2a')]();queues[_0x8b32c3[_0x504b('0x11')]][_0x504b('0x9')]=_0x504b('0x2e');utils['info'](util[_0x504b('0x3')](_0x504b('0x2f'),_0x8b32c3[_0x504b('0x11')],queues[_0x8b32c3['uniqueid']][_0x504b('0x1f')],_0x8b32c3[_0x504b('0x26')],queues[_0x8b32c3[_0x504b('0x11')]][_0x504b('0x9')]));}}}catch(_0x4c99a7){utils[_0x504b('0x16')](util[_0x504b('0x3')](_0x504b('0x23'),_0x8b32c3[_0x504b('0x11')]),_0x4c99a7);}};exports[_0x504b('0x19')]=function(_0x268359){try{if(!_[_0x504b('0x24')](queues[_0x268359[_0x504b('0x11')]])){utils['debug'](util[_0x504b('0x3')](_0x504b('0x30'),_0x268359[_0x504b('0x11')]),_0x268359);queues[_0x268359[_0x504b('0x11')]][_0x504b('0x1a')]=![];queues[_0x268359[_0x504b('0x11')]][_0x504b('0x29')]=null;queues[_0x268359[_0x504b('0x11')]][_0x504b('0x19')]=!![];queues[_0x268359[_0x504b('0x11')]][_0x504b('0x28')]=utils[_0x504b('0x2a')]();queues[_0x268359[_0x504b('0x11')]][_0x504b('0x9')]=_0x504b('0x31');utils[_0x504b('0x12')](util[_0x504b('0x3')](_0x504b('0x32'),_0x268359['uniqueid'],queues[_0x268359[_0x504b('0x11')]][_0x504b('0x1f')],queues[_0x268359['uniqueid']]['queuecallerexitreason']));}}catch(_0x2d6d52){utils[_0x504b('0x16')](util['format'](_0x504b('0x30'),_0x268359[_0x504b('0x11')]),_0x2d6d52);}};exports['queuecallerleave']=function(_0x184bb3){try{if(!_[_0x504b('0x24')](queues[_0x184bb3[_0x504b('0x11')]])){utils[_0x504b('0xf')](util[_0x504b('0x3')](_0x504b('0x33'),_0x184bb3[_0x504b('0x11')]),_0x184bb3);utils['info'](util[_0x504b('0x3')](_0x504b('0x34'),_0x184bb3[_0x504b('0x11')],queues[_0x184bb3[_0x504b('0x11')]][_0x504b('0x1f')],_0x184bb3[_0x504b('0x35')],_0x184bb3[_0x504b('0x36')]));queues[_0x184bb3['uniqueid']][_0x504b('0x37')]=!![];queues[_0x184bb3['uniqueid']]['queuecallerleaveAt']=utils[_0x504b('0x2a')]();queues[_0x184bb3[_0x504b('0x11')]][_0x504b('0x38')]=utils[_0x504b('0x39')](queues[_0x184bb3[_0x504b('0x11')]][_0x504b('0x18')],queues[_0x184bb3[_0x504b('0x11')]][_0x504b('0x3a')]);queues[_0x184bb3[_0x504b('0x11')]][_0x504b('0x15')]=_0x184bb3[_0x504b('0x15')];queues[_0x184bb3['uniqueid']]['count']=_0x184bb3[_0x504b('0x3b')];queues[_0x184bb3[_0x504b('0x11')]][_0x504b('0x35')]=_0x184bb3[_0x504b('0x35')];queues[_0x184bb3[_0x504b('0x11')]][_0x504b('0x36')]=_0x184bb3[_0x504b('0x36')];}}catch(_0x3ddd3b){utils['error'](util[_0x504b('0x3')](_0x504b('0x33'),_0x184bb3[_0x504b('0x11')]),_0x3ddd3b);}};exports[_0x504b('0x3c')]=function(_0x1f4610){try{if(!_[_0x504b('0x24')](queues[_0x1f4610[_0x504b('0x11')]])){utils[_0x504b('0xf')](util[_0x504b('0x3')](_0x504b('0x3d'),_0x1f4610[_0x504b('0x11')]),_0x1f4610);utils[_0x504b('0x12')](util['format'](_0x504b('0x3e'),_0x1f4610[_0x504b('0x11')],queues[_0x1f4610[_0x504b('0x11')]][_0x504b('0x1f')],_0x1f4610['membername'],_0x1f4610[_0x504b('0x3f')]));queues[_0x1f4610[_0x504b('0x11')]][_0x504b('0x19')]=![];queues[_0x1f4610[_0x504b('0x11')]][_0x504b('0x19')]=![];queues[_0x1f4610[_0x504b('0x11')]][_0x504b('0x28')]=null;queues[_0x1f4610[_0x504b('0x11')]][_0x504b('0x1a')]=![];queues[_0x1f4610[_0x504b('0x11')]][_0x504b('0x9')]=null;queues[_0x1f4610[_0x504b('0x11')]][_0x504b('0x29')]=null;queues[_0x1f4610[_0x504b('0x11')]][_0x504b('0x40')]=!![];queues[_0x1f4610['uniqueid']]['accountcode']=_0x1f4610[_0x504b('0x3f')];queues[_0x1f4610['uniqueid']][_0x504b('0x7')]=_0x1f4610[_0x504b('0x41')];}}catch(_0xb1564c){utils[_0x504b('0x16')](util[_0x504b('0x3')](_0x504b('0x3d'),_0x1f4610[_0x504b('0x11')]),_0xb1564c);}};exports[_0x504b('0x42')]=function(_0x44fc57){try{if(!_[_0x504b('0x24')](queues[_0x44fc57[_0x504b('0x11')]])){if(queues[_0x44fc57[_0x504b('0x11')]]['queuecallerleaveAt']){utils[_0x504b('0xf')](util[_0x504b('0x3')]('[%s][queues][agentcomplete]',_0x44fc57[_0x504b('0x11')]),_0x44fc57);queues[_0x44fc57['uniqueid']]['queuecallerabandon']=![];queues[_0x44fc57[_0x504b('0x11')]][_0x504b('0x19')]=![];queues[_0x44fc57[_0x504b('0x11')]][_0x504b('0x28')]=null;queues[_0x44fc57['uniqueid']]['queuecallerexit']=![];queues[_0x44fc57[_0x504b('0x11')]][_0x504b('0x29')]=null;queues[_0x44fc57[_0x504b('0x11')]]['assigned']=!![];queues[_0x44fc57[_0x504b('0x11')]][_0x504b('0x7')]=_0x44fc57[_0x504b('0x41')];queues[_0x44fc57['uniqueid']]['queuecallercomplete']=!![];queues[_0x44fc57[_0x504b('0x11')]]['queuecallercompleteAt']=utils['now']();if(_0x44fc57[_0x504b('0x43')]==_0x504b('0x44')){if(!queues[_0x44fc57['uniqueid']][_0x504b('0x44')]){queues[_0x44fc57['uniqueid']]['queuecallerexitreason']=_0x504b('0x45');}}else{queues[_0x44fc57[_0x504b('0x11')]][_0x504b('0x9')]=_0x504b('0x46')+_0x44fc57['reason'][_0x504b('0x2b')]();}utils[_0x504b('0x12')](util[_0x504b('0x3')]('[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s',_0x44fc57[_0x504b('0x11')],queues[_0x44fc57[_0x504b('0x11')]][_0x504b('0x1f')],_0x44fc57[_0x504b('0x41')],queues[_0x44fc57[_0x504b('0x11')]][_0x504b('0x9')]));writeDB(queues[_0x44fc57[_0x504b('0x11')]]);}}}catch(_0x347340){utils[_0x504b('0x16')](util[_0x504b('0x3')](_0x504b('0x47'),_0x44fc57[_0x504b('0x11')]),_0x347340);}};exports[_0x504b('0x48')]=function(_0x2b825e){try{if(!_[_0x504b('0x24')](queues[_0x2b825e[_0x504b('0x49')]])){utils[_0x504b('0xf')](util[_0x504b('0x3')](_0x504b('0x4a'),_0x2b825e[_0x504b('0x11')]),_0x2b825e);queues[_0x2b825e['transfereeuniqueid']]['transfer']=!![];queues[_0x2b825e[_0x504b('0x49')]]['transfertype']=_0x504b('0x4b');queues[_0x2b825e[_0x504b('0x49')]][_0x504b('0x4c')]=_0x2b825e['extension'];queues[_0x2b825e['transfereeuniqueid']]['transferuniqueid']=_0x2b825e[_0x504b('0x49')];queues[_0x2b825e['transfereeuniqueid']][_0x504b('0x9')]=_0x504b('0x4d');utils[_0x504b('0x12')](util[_0x504b('0x3')](_0x504b('0x4e'),_0x2b825e[_0x504b('0x11')],queues[_0x2b825e[_0x504b('0x49')]][_0x504b('0x1f')],_0x2b825e[_0x504b('0x49')],_0x2b825e[_0x504b('0x4f')]));}}catch(_0x34436f){utils[_0x504b('0x16')](util['format'](_0x504b('0x4a'),_0x2b825e['uniqueid']),_0x34436f);}};exports[_0x504b('0x50')]=function(_0x467760){try{utils['debug'](util[_0x504b('0x3')](_0x504b('0x51'),_0x467760[_0x504b('0x52')]),_0x467760);if(_0x467760[_0x504b('0x52')]==_0x467760[_0x504b('0x53')]){if(!_[_0x504b('0x24')](queues[_0x467760[_0x504b('0x54')]])){utils[_0x504b('0x12')](util['format'](_0x504b('0x55'),_0x467760[_0x504b('0x52')],queues[_0x467760[_0x504b('0x54')]][_0x504b('0x1f')],_0x467760[_0x504b('0x56')]));queues[_0x467760[_0x504b('0x54')]][_0x504b('0x44')]=!![];queues[_0x467760[_0x504b('0x54')]][_0x504b('0x57')]=_0x504b('0x58');queues[_0x467760[_0x504b('0x54')]][_0x504b('0x4c')]=_0x467760[_0x504b('0x56')];queues[_0x467760['secondtransfererlinkedid']][_0x504b('0x59')]=_0x467760[_0x504b('0x52')];queues[_0x467760['secondtransfererlinkedid']]['queuecallerexitreason']=_0x504b('0x5a');}if(!_['isNil'](queues[_0x467760[_0x504b('0x53')]])){if(_0x467760['transfereelinkedid']&&queues[_0x467760['transfereelinkedid']]){queues[_0x467760[_0x504b('0x5b')]][_0x504b('0x21')]=0x1;queues[_0x467760[_0x504b('0x49')]]=_[_0x504b('0x5c')](queues[_0x467760[_0x504b('0x5b')]]);queues[_0x467760[_0x504b('0x49')]][_0x504b('0xd')]=_0x467760['transfertargetuniqueid'];queues[_0x467760[_0x504b('0x49')]][_0x504b('0x21')]=0x2;queues[_0x467760[_0x504b('0x49')]][_0x504b('0x8')]=queues[_0x467760[_0x504b('0x54')]][_0x504b('0x8')];queues[_0x467760[_0x504b('0x49')]][_0x504b('0x5d')]=queues[_0x467760['secondtransfererlinkedid']][_0x504b('0x5d')];queues[_0x467760[_0x504b('0x49')]]['queuecallerjoinAt']=utils['now']();queues[_0x467760[_0x504b('0x49')]][_0x504b('0x18')]=utils[_0x504b('0x2a')]();queues[_0x467760[_0x504b('0x49')]][_0x504b('0x38')]=0x0;queues[_0x467760[_0x504b('0x49')]]['mohtime']=0x0;utils['info'](util[_0x504b('0x3')](_0x504b('0x5e'),_0x467760['origtransfereruniqueid'],queues[_0x467760[_0x504b('0x49')]]['name'],queues[_0x467760['transfereeuniqueid']][_0x504b('0x8')],queues[_0x467760[_0x504b('0x49')]][_0x504b('0x5d')]));}else{utils[_0x504b('0x12')](util[_0x504b('0x3')](_0x504b('0x5f'),_0x467760[_0x504b('0x52')],queues[_0x467760['origtransfererlinkedid']]['name'],_0x467760[_0x504b('0x54')]));queues[_0x467760[_0x504b('0x53')]][_0x504b('0xd')]=_0x467760[_0x504b('0x54')];}}}else if(_0x467760['secondtransfereruniqueid']==_0x467760['secondtransfererlinkedid']){if(!_[_0x504b('0x24')](queues[_0x467760[_0x504b('0x53')]])){utils[_0x504b('0x12')](util[_0x504b('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x467760[_0x504b('0x52')],queues[_0x467760[_0x504b('0x53')]][_0x504b('0x1f')],_0x467760[_0x504b('0x60')],_0x467760[_0x504b('0x61')]));queues[_0x467760[_0x504b('0x53')]]['transfer']=!![];queues[_0x467760[_0x504b('0x53')]][_0x504b('0x57')]=_0x504b('0x58');queues[_0x467760[_0x504b('0x53')]][_0x504b('0x4c')]=_0x467760['secondtransfererexten'];queues[_0x467760['origtransfererlinkedid']][_0x504b('0x59')]=_0x467760['secondtransfereruniqueid'];queues[_0x467760[_0x504b('0x53')]]['queuecallerexitreason']='ATTENDEDTRANSFER';}if(!_['isNil'](queues[_0x467760['secondtransfererlinkedid']])){if(_0x467760[_0x504b('0x62')]&&queues[_0x467760[_0x504b('0x62')]]){queues[_0x467760[_0x504b('0x62')]][_0x504b('0x21')]=0x1;queues[_0x467760[_0x504b('0x63')]]=_[_0x504b('0x5c')](queues[_0x467760['transfertargetlinkedid']]);queues[_0x467760[_0x504b('0x63')]][_0x504b('0xd')]=_0x467760[_0x504b('0x63')];queues[_0x467760['transfertargetuniqueid']]['queuecallerenterreason']=0x2;queues[_0x467760[_0x504b('0x63')]][_0x504b('0x8')]=queues[_0x467760['origtransfererlinkedid']][_0x504b('0x8')];queues[_0x467760[_0x504b('0x63')]][_0x504b('0x5d')]=queues[_0x467760[_0x504b('0x53')]][_0x504b('0x5d')];queues[_0x467760[_0x504b('0x63')]][_0x504b('0x3a')]=utils[_0x504b('0x2a')]();queues[_0x467760['transfertargetuniqueid']][_0x504b('0x18')]=utils[_0x504b('0x2a')]();queues[_0x467760[_0x504b('0x63')]][_0x504b('0x38')]=0x0;queues[_0x467760[_0x504b('0x63')]][_0x504b('0x64')]=0x0;utils[_0x504b('0x12')](util[_0x504b('0x3')](_0x504b('0x65'),_0x467760[_0x504b('0x52')],queues[_0x467760['transfertargetuniqueid']][_0x504b('0x1f')],queues[_0x467760[_0x504b('0x63')]][_0x504b('0xd')],queues[_0x467760[_0x504b('0x63')]][_0x504b('0x8')],queues[_0x467760[_0x504b('0x63')]][_0x504b('0x5d')]));}else{utils[_0x504b('0x12')](util[_0x504b('0x3')](_0x504b('0x5f'),_0x467760[_0x504b('0x52')],queues[_0x467760[_0x504b('0x54')]][_0x504b('0x1f')],_0x467760[_0x504b('0x53')]));queues[_0x467760[_0x504b('0x54')]]['transfereduniqueid']=_0x467760['origtransfererlinkedid'];}}}}catch(_0x10129a){utils['error'](util['format'](_0x504b('0x51'),_0x467760[_0x504b('0x52')]),_0x10129a);}};exports['musiconholdstart']=function(_0x430aee){try{if(!_['isNil'](queues[_0x430aee['uniqueid']])){utils[_0x504b('0xf')](util[_0x504b('0x3')](_0x504b('0x66'),_0x430aee[_0x504b('0x11')]),_0x430aee);queues[_0x430aee[_0x504b('0x11')]][_0x504b('0x67')]=utils['now']();utils['info'](util[_0x504b('0x3')](_0x504b('0x68'),_0x430aee[_0x504b('0x11')],queues[_0x430aee[_0x504b('0x11')]][_0x504b('0x1f')],queues[_0x430aee['uniqueid']]['musiconholdstartAt']));}}catch(_0x25ccb7){utils[_0x504b('0x16')](util['format'](_0x504b('0x66'),_0x430aee[_0x504b('0x11')]),_0x25ccb7);}};exports['musiconholdstop']=function(_0x5da384){try{if(!_['isNil'](queues[_0x5da384[_0x504b('0x11')]])){if(!_['isNil'](queues[_0x5da384[_0x504b('0x11')]][_0x504b('0x67')])){utils[_0x504b('0xf')](util[_0x504b('0x3')]('[%s][queues][musiconholdstop]',_0x5da384[_0x504b('0x11')]),_0x5da384);queues[_0x5da384[_0x504b('0x11')]][_0x504b('0x64')]+=utils[_0x504b('0x39')](utils['now'](),queues[_0x5da384[_0x504b('0x11')]]['musiconholdstartAt']);utils[_0x504b('0x12')](util[_0x504b('0x3')](_0x504b('0x69'),_0x5da384[_0x504b('0x11')],queues[_0x5da384[_0x504b('0x11')]][_0x504b('0x1f')],queues[_0x5da384[_0x504b('0x11')]][_0x504b('0x64')]));delete queues[_0x5da384[_0x504b('0x11')]][_0x504b('0x67')];}}}catch(_0x56494c){utils[_0x504b('0x16')](util['format'](_0x504b('0x6a'),_0x5da384[_0x504b('0x11')]),_0x56494c);}}; \ No newline at end of file +var _0x8692=['connectedlinenum','connectedlinename','holdtime','diffTime','queuecallerjoinAt','count','agentconnect','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','destaccountcode','assigned','membername','[%s][queues][agentconnect]','agentcomplete','[%s][queues][agentcomplete]','queuecallercomplete','transfer','TRANSFER','COMPLETEDBY','reason','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','transfereeuniqueid','BLIND','transferexten','extension','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','secondtransfererlinkedid','transfertype','ATTENDED','transferuniqueid','ATTENDEDTRANSFER','transfereelinkedid','clone','transfertargetuniqueid','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','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]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','util','./utils','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','channel','queue','lastAssignedTo','calleridnum','accountcode','queuecallerexitreason','getVoiceQueueByName','then','request','CreateVoiceQueueReport','transfereduniqueid','uniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','info','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','now','error','hangup','isNil','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','queuecallercompleteAt','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','queuecallerenterreason','varset','[%s][queues][varset]','variable','queuestatus','value','toUpperCase','CONTINUE','queuecallerabandonAt','queuecallerexit','queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','EXITWITHKEY','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]'];(function(_0x237c6b,_0x4705de){var _0x7a5299=function(_0xc23533){while(--_0xc23533){_0x237c6b['push'](_0x237c6b['shift']());}};_0x7a5299(++_0x4705de);}(_0x8692,0x177));var _0x2869=function(_0x190092,_0x3a65de){_0x190092=_0x190092-0x0;var _0x14e48c=_0x8692[_0x190092];return _0x14e48c;};'use strict';var _=require('lodash');var util=require(_0x2869('0x0'));var utils=require(_0x2869('0x1'));var queues={};function writeDB(_0x234002){utils['info'](util[_0x2869('0x2')](_0x2869('0x3'),_0x234002['uniqueid'],_0x234002[_0x2869('0x4')],_0x234002[_0x2869('0x5')],_0x234002[_0x2869('0x6')],_0x234002[_0x2869('0x7')],_0x234002[_0x2869('0x8')],_0x234002[_0x2869('0x9')]));if(_0x234002['queue']){utils[_0x2869('0xa')](_0x234002[_0x2869('0x5')])[_0x2869('0xb')](function(_0x12ee45){if(_0x12ee45){_0x234002['type']=_0x12ee45['type'];}utils[_0x2869('0xc')](_0x2869('0xd'),_0x234002);});}else{utils['request'](_0x2869('0xd'),_0x234002);}if(_0x234002[_0x2869('0xe')]){delete queues[_0x234002[_0x2869('0xe')]];}else{delete queues[_0x234002[_0x2869('0xf')]];}}exports[_0x2869('0x10')]=function(_0x3323f8){try{utils[_0x2869('0x11')](util[_0x2869('0x2')](_0x2869('0x12'),_0x3323f8[_0x2869('0xf')]),_0x3323f8);utils[_0x2869('0x13')](util[_0x2869('0x2')](_0x2869('0x14'),_0x3323f8[_0x2869('0xf')],_0x3323f8[_0x2869('0x5')],_0x3323f8[_0x2869('0x15')]));queues[_0x3323f8[_0x2869('0xf')]]=_[_0x2869('0x16')](_0x3323f8,{'originalposition':_0x3323f8[_0x2869('0x15')],'queuecallerjoinAt':utils[_0x2869('0x17')](),'mohtime':0x0});}catch(_0x3569b2){utils[_0x2869('0x18')](util['format'](_0x2869('0x12'),_0x3323f8[_0x2869('0xf')]),_0x3569b2);}};exports[_0x2869('0x19')]=function(_0x9c31a9){try{if(!_[_0x2869('0x1a')](queues[_0x9c31a9[_0x2869('0xf')]])){utils[_0x2869('0x11')](util[_0x2869('0x2')](_0x2869('0x1b'),_0x9c31a9[_0x2869('0xf')]),_0x9c31a9);if(queues[_0x9c31a9['uniqueid']][_0x2869('0x1c')]){if(!queues[_0x9c31a9['uniqueid']][_0x2869('0x1d')]&&!queues[_0x9c31a9[_0x2869('0xf')]]['queuecallerexit']){queues[_0x9c31a9[_0x2869('0xf')]]['queuecallercomplete']=!![];queues[_0x9c31a9['uniqueid']][_0x2869('0x1e')]=utils[_0x2869('0x17')]();queues[_0x9c31a9[_0x2869('0xf')]][_0x2869('0x9')]=_0x2869('0x1f');}utils[_0x2869('0x13')](util['format'](_0x2869('0x20'),_0x9c31a9['uniqueid'],queues[_0x9c31a9['uniqueid']]['name'],queues[_0x9c31a9['uniqueid']][_0x2869('0x9')]));writeDB(queues[_0x9c31a9[_0x2869('0xf')]]);}else if(queues[_0x9c31a9[_0x2869('0xf')]]['transfereduniqueid']){utils[_0x2869('0x13')](util[_0x2869('0x2')]('[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s',_0x9c31a9[_0x2869('0xf')],queues[_0x9c31a9[_0x2869('0xf')]][_0x2869('0x21')],queues[_0x9c31a9['uniqueid']]['transfereduniqueid']));queues[queues[_0x9c31a9[_0x2869('0xf')]][_0x2869('0xe')]]=queues[_0x9c31a9[_0x2869('0xf')]];queues[queues[_0x9c31a9[_0x2869('0xf')]][_0x2869('0xe')]][_0x2869('0x22')]=0x2;delete queues[_0x9c31a9[_0x2869('0xf')]];}}}catch(_0x3132a9){utils[_0x2869('0x18')](util['format'](_0x2869('0x1b'),_0x9c31a9[_0x2869('0xf')]),_0x3132a9);}};exports[_0x2869('0x23')]=function(_0x52c4af){try{utils[_0x2869('0x11')](util[_0x2869('0x2')](_0x2869('0x24'),_0x52c4af[_0x2869('0xf')]),_0x52c4af);if(!_['isNil'](_0x52c4af[_0x2869('0x25')][_0x2869('0x26')])&&_0x52c4af[_0x2869('0x27')][_0x2869('0x28')]()!==_0x2869('0x29')){if(!_[_0x2869('0x1a')](queues[_0x52c4af[_0x2869('0xf')]])){queues[_0x52c4af['uniqueid']][_0x2869('0x1d')]=![];queues[_0x52c4af[_0x2869('0xf')]][_0x2869('0x2a')]=null;queues[_0x52c4af[_0x2869('0xf')]][_0x2869('0x2b')]=!![];queues[_0x52c4af[_0x2869('0xf')]][_0x2869('0x2c')]=utils['now']();queues[_0x52c4af[_0x2869('0xf')]][_0x2869('0x9')]=_0x52c4af[_0x2869('0x27')][_0x2869('0x28')]();utils['info'](util['format'](_0x2869('0x2d'),_0x52c4af[_0x2869('0xf')],queues[_0x52c4af[_0x2869('0xf')]]['name'],_0x52c4af[_0x2869('0x27')],queues[_0x52c4af[_0x2869('0xf')]][_0x2869('0x9')]));writeDB(queues[_0x52c4af['uniqueid']]);}}else if(!_[_0x2869('0x1a')](_0x52c4af[_0x2869('0x25')][_0x2869('0x2e')])){if(!_[_0x2869('0x1a')](queues[_0x52c4af[_0x2869('0xf')]])&&!queues[_0x52c4af[_0x2869('0xf')]][_0x2869('0x1d')]){queues[_0x52c4af[_0x2869('0xf')]][_0x2869('0x1d')]=![];queues[_0x52c4af[_0x2869('0xf')]][_0x2869('0x2a')]=null;queues[_0x52c4af[_0x2869('0xf')]]['queuecallerexit']=!![];queues[_0x52c4af[_0x2869('0xf')]]['queuecallerexitAt']=utils[_0x2869('0x17')]();queues[_0x52c4af[_0x2869('0xf')]][_0x2869('0x9')]=_0x2869('0x2f');utils['info'](util['format']('[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s',_0x52c4af[_0x2869('0xf')],queues[_0x52c4af[_0x2869('0xf')]]['name'],_0x52c4af[_0x2869('0x27')],queues[_0x52c4af[_0x2869('0xf')]]['queuecallerexitreason']));}}}catch(_0x10d764){utils[_0x2869('0x18')](util[_0x2869('0x2')](_0x2869('0x24'),_0x52c4af[_0x2869('0xf')]),_0x10d764);}};exports[_0x2869('0x1d')]=function(_0x55e2ef){try{if(!_['isNil'](queues[_0x55e2ef[_0x2869('0xf')]])){utils[_0x2869('0x11')](util['format'](_0x2869('0x30'),_0x55e2ef[_0x2869('0xf')]),_0x55e2ef);queues[_0x55e2ef[_0x2869('0xf')]][_0x2869('0x2b')]=![];queues[_0x55e2ef[_0x2869('0xf')]][_0x2869('0x2c')]=null;queues[_0x55e2ef[_0x2869('0xf')]][_0x2869('0x1d')]=!![];queues[_0x55e2ef[_0x2869('0xf')]]['queuecallerabandonAt']=utils[_0x2869('0x17')]();queues[_0x55e2ef['uniqueid']][_0x2869('0x9')]=_0x2869('0x31');utils['info'](util[_0x2869('0x2')](_0x2869('0x32'),_0x55e2ef[_0x2869('0xf')],queues[_0x55e2ef[_0x2869('0xf')]]['name'],queues[_0x55e2ef[_0x2869('0xf')]][_0x2869('0x9')]));}}catch(_0x36f7e6){utils[_0x2869('0x18')](util[_0x2869('0x2')](_0x2869('0x30'),_0x55e2ef['uniqueid']),_0x36f7e6);}};exports[_0x2869('0x33')]=function(_0x468761){try{if(!_[_0x2869('0x1a')](queues[_0x468761['uniqueid']])){utils['debug'](util[_0x2869('0x2')](_0x2869('0x34'),_0x468761[_0x2869('0xf')]),_0x468761);utils['info'](util[_0x2869('0x2')]('[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x468761[_0x2869('0xf')],queues[_0x468761[_0x2869('0xf')]][_0x2869('0x21')],_0x468761[_0x2869('0x35')],_0x468761[_0x2869('0x36')]));queues[_0x468761[_0x2869('0xf')]][_0x2869('0x33')]=!![];queues[_0x468761[_0x2869('0xf')]][_0x2869('0x1c')]=utils[_0x2869('0x17')]();queues[_0x468761[_0x2869('0xf')]][_0x2869('0x37')]=utils[_0x2869('0x38')](queues[_0x468761[_0x2869('0xf')]][_0x2869('0x1c')],queues[_0x468761[_0x2869('0xf')]][_0x2869('0x39')]);queues[_0x468761[_0x2869('0xf')]][_0x2869('0x15')]=_0x468761[_0x2869('0x15')];queues[_0x468761[_0x2869('0xf')]]['count']=_0x468761[_0x2869('0x3a')];queues[_0x468761[_0x2869('0xf')]][_0x2869('0x35')]=_0x468761[_0x2869('0x35')];queues[_0x468761[_0x2869('0xf')]][_0x2869('0x36')]=_0x468761[_0x2869('0x36')];}}catch(_0x2798f3){utils[_0x2869('0x18')](util['format'](_0x2869('0x34'),_0x468761[_0x2869('0xf')]),_0x2798f3);}};exports[_0x2869('0x3b')]=function(_0x25b4e2){try{if(!_[_0x2869('0x1a')](queues[_0x25b4e2['uniqueid']])){utils[_0x2869('0x11')](util[_0x2869('0x2')]('[%s][queues][agentconnect]',_0x25b4e2[_0x2869('0xf')]),_0x25b4e2);utils['info'](util[_0x2869('0x2')](_0x2869('0x3c'),_0x25b4e2['uniqueid'],queues[_0x25b4e2[_0x2869('0xf')]][_0x2869('0x21')],_0x25b4e2['membername'],_0x25b4e2[_0x2869('0x3d')]));queues[_0x25b4e2[_0x2869('0xf')]][_0x2869('0x1d')]=![];queues[_0x25b4e2[_0x2869('0xf')]]['queuecallerabandon']=![];queues[_0x25b4e2[_0x2869('0xf')]][_0x2869('0x2a')]=null;queues[_0x25b4e2['uniqueid']][_0x2869('0x2b')]=![];queues[_0x25b4e2[_0x2869('0xf')]][_0x2869('0x9')]=null;queues[_0x25b4e2[_0x2869('0xf')]][_0x2869('0x2c')]=null;queues[_0x25b4e2['uniqueid']][_0x2869('0x3e')]=!![];queues[_0x25b4e2['uniqueid']][_0x2869('0x8')]=_0x25b4e2['destaccountcode'];queues[_0x25b4e2[_0x2869('0xf')]]['lastAssignedTo']=_0x25b4e2[_0x2869('0x3f')];}}catch(_0x54e90c){utils[_0x2869('0x18')](util[_0x2869('0x2')](_0x2869('0x40'),_0x25b4e2[_0x2869('0xf')]),_0x54e90c);}};exports[_0x2869('0x41')]=function(_0x4042ad){try{if(!_['isNil'](queues[_0x4042ad[_0x2869('0xf')]])){if(queues[_0x4042ad['uniqueid']][_0x2869('0x1c')]){utils[_0x2869('0x11')](util[_0x2869('0x2')](_0x2869('0x42'),_0x4042ad['uniqueid']),_0x4042ad);queues[_0x4042ad[_0x2869('0xf')]][_0x2869('0x1d')]=![];queues[_0x4042ad['uniqueid']][_0x2869('0x1d')]=![];queues[_0x4042ad[_0x2869('0xf')]][_0x2869('0x2a')]=null;queues[_0x4042ad['uniqueid']]['queuecallerexit']=![];queues[_0x4042ad[_0x2869('0xf')]][_0x2869('0x2c')]=null;queues[_0x4042ad[_0x2869('0xf')]][_0x2869('0x3e')]=!![];queues[_0x4042ad['uniqueid']]['lastAssignedTo']=_0x4042ad[_0x2869('0x3f')];queues[_0x4042ad[_0x2869('0xf')]][_0x2869('0x43')]=!![];queues[_0x4042ad[_0x2869('0xf')]][_0x2869('0x1e')]=utils[_0x2869('0x17')]();if(_0x4042ad['reason']==_0x2869('0x44')){if(!queues[_0x4042ad[_0x2869('0xf')]][_0x2869('0x44')]){queues[_0x4042ad[_0x2869('0xf')]][_0x2869('0x9')]=_0x2869('0x45');}}else{queues[_0x4042ad[_0x2869('0xf')]]['queuecallerexitreason']=_0x2869('0x46')+_0x4042ad[_0x2869('0x47')]['toUpperCase']();}utils[_0x2869('0x13')](util['format'](_0x2869('0x48'),_0x4042ad['uniqueid'],queues[_0x4042ad[_0x2869('0xf')]][_0x2869('0x21')],_0x4042ad['membername'],queues[_0x4042ad[_0x2869('0xf')]][_0x2869('0x9')]));writeDB(queues[_0x4042ad[_0x2869('0xf')]]);}}}catch(_0x2c3437){utils[_0x2869('0x18')](util[_0x2869('0x2')](_0x2869('0x42'),_0x4042ad['uniqueid']),_0x2c3437);}};exports[_0x2869('0x49')]=function(_0xc8075){try{if(!_['isNil'](queues[_0xc8075['transfereeuniqueid']])){utils[_0x2869('0x11')](util['format']('[%s][queues][blindtransfer]',_0xc8075['uniqueid']),_0xc8075);queues[_0xc8075[_0x2869('0x4a')]][_0x2869('0x44')]=!![];queues[_0xc8075[_0x2869('0x4a')]]['transfertype']=_0x2869('0x4b');queues[_0xc8075[_0x2869('0x4a')]][_0x2869('0x4c')]=_0xc8075[_0x2869('0x4d')];queues[_0xc8075[_0x2869('0x4a')]]['transferuniqueid']=_0xc8075[_0x2869('0x4a')];queues[_0xc8075[_0x2869('0x4a')]][_0x2869('0x9')]=_0x2869('0x4e');utils[_0x2869('0x13')](util[_0x2869('0x2')](_0x2869('0x4f'),_0xc8075[_0x2869('0xf')],queues[_0xc8075[_0x2869('0x4a')]][_0x2869('0x21')],_0xc8075[_0x2869('0x4a')],_0xc8075['extension']));}}catch(_0x5c033e){utils[_0x2869('0x18')](util[_0x2869('0x2')]('[%s][queues][blindtransfer]',_0xc8075['uniqueid']),_0x5c033e);}};exports['attendedtransfer']=function(_0x2461d9){try{utils[_0x2869('0x11')](util[_0x2869('0x2')](_0x2869('0x50'),_0x2461d9[_0x2869('0x51')]),_0x2461d9);if(_0x2461d9['origtransfereruniqueid']==_0x2461d9[_0x2869('0x52')]){if(!_['isNil'](queues[_0x2461d9['secondtransfererlinkedid']])){utils['info'](util[_0x2869('0x2')](_0x2869('0x53'),_0x2461d9[_0x2869('0x51')],queues[_0x2461d9['secondtransfererlinkedid']][_0x2869('0x21')],_0x2461d9[_0x2869('0x54')]));queues[_0x2461d9[_0x2869('0x55')]][_0x2869('0x44')]=!![];queues[_0x2461d9['secondtransfererlinkedid']][_0x2869('0x56')]=_0x2869('0x57');queues[_0x2461d9['secondtransfererlinkedid']][_0x2869('0x4c')]=_0x2461d9['origtransfererexten'];queues[_0x2461d9[_0x2869('0x55')]][_0x2869('0x58')]=_0x2461d9[_0x2869('0x51')];queues[_0x2461d9['secondtransfererlinkedid']][_0x2869('0x9')]=_0x2869('0x59');}if(!_[_0x2869('0x1a')](queues[_0x2461d9[_0x2869('0x52')]])){if(_0x2461d9[_0x2869('0x5a')]&&queues[_0x2461d9['transfereelinkedid']]){queues[_0x2461d9[_0x2869('0x5a')]][_0x2869('0x22')]=0x1;queues[_0x2461d9['transfereeuniqueid']]=_[_0x2869('0x5b')](queues[_0x2461d9[_0x2869('0x5a')]]);queues[_0x2461d9['transfereeuniqueid']][_0x2869('0xe')]=_0x2461d9[_0x2869('0x5c')];queues[_0x2461d9[_0x2869('0x4a')]][_0x2869('0x22')]=0x2;queues[_0x2461d9['transfereeuniqueid']]['calleridnum']=queues[_0x2461d9[_0x2869('0x55')]]['calleridnum'];queues[_0x2461d9[_0x2869('0x4a')]][_0x2869('0x5d')]=queues[_0x2461d9['secondtransfererlinkedid']][_0x2869('0x5d')];queues[_0x2461d9[_0x2869('0x4a')]]['queuecallerjoinAt']=utils[_0x2869('0x17')]();queues[_0x2461d9['transfereeuniqueid']][_0x2869('0x1c')]=utils['now']();queues[_0x2461d9[_0x2869('0x4a')]][_0x2869('0x37')]=0x0;queues[_0x2461d9[_0x2869('0x4a')]][_0x2869('0x5e')]=0x0;utils[_0x2869('0x13')](util['format'](_0x2869('0x5f'),_0x2461d9[_0x2869('0x51')],queues[_0x2461d9[_0x2869('0x4a')]][_0x2869('0x21')],queues[_0x2461d9[_0x2869('0x4a')]][_0x2869('0x7')],queues[_0x2461d9['transfereeuniqueid']][_0x2869('0x5d')]));}else{utils[_0x2869('0x13')](util[_0x2869('0x2')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x2461d9[_0x2869('0x51')],queues[_0x2461d9[_0x2869('0x52')]][_0x2869('0x21')],_0x2461d9[_0x2869('0x55')]));queues[_0x2461d9[_0x2869('0x52')]][_0x2869('0xe')]=_0x2461d9[_0x2869('0x55')];}}}else if(_0x2461d9[_0x2869('0x60')]==_0x2461d9['secondtransfererlinkedid']){if(!_[_0x2869('0x1a')](queues[_0x2461d9['origtransfererlinkedid']])){utils[_0x2869('0x13')](util[_0x2869('0x2')](_0x2869('0x61'),_0x2461d9[_0x2869('0x51')],queues[_0x2461d9['origtransfererlinkedid']][_0x2869('0x21')],_0x2461d9[_0x2869('0x60')],_0x2461d9['secondtransfererexten']));queues[_0x2461d9[_0x2869('0x52')]][_0x2869('0x44')]=!![];queues[_0x2461d9['origtransfererlinkedid']][_0x2869('0x56')]=_0x2869('0x57');queues[_0x2461d9[_0x2869('0x52')]][_0x2869('0x4c')]=_0x2461d9[_0x2869('0x62')];queues[_0x2461d9[_0x2869('0x52')]][_0x2869('0x58')]=_0x2461d9[_0x2869('0x60')];queues[_0x2461d9[_0x2869('0x52')]][_0x2869('0x9')]='ATTENDEDTRANSFER';}if(!_[_0x2869('0x1a')](queues[_0x2461d9['secondtransfererlinkedid']])){if(_0x2461d9['transfertargetlinkedid']&&queues[_0x2461d9[_0x2869('0x63')]]){queues[_0x2461d9['transfertargetlinkedid']]['queuecallerenterreason']=0x1;queues[_0x2461d9['transfertargetuniqueid']]=_['clone'](queues[_0x2461d9[_0x2869('0x63')]]);queues[_0x2461d9['transfertargetuniqueid']][_0x2869('0xe')]=_0x2461d9[_0x2869('0x5c')];queues[_0x2461d9[_0x2869('0x5c')]][_0x2869('0x22')]=0x2;queues[_0x2461d9['transfertargetuniqueid']]['calleridnum']=queues[_0x2461d9[_0x2869('0x52')]][_0x2869('0x7')];queues[_0x2461d9[_0x2869('0x5c')]][_0x2869('0x5d')]=queues[_0x2461d9['origtransfererlinkedid']][_0x2869('0x5d')];queues[_0x2461d9[_0x2869('0x5c')]][_0x2869('0x39')]=utils[_0x2869('0x17')]();queues[_0x2461d9[_0x2869('0x5c')]][_0x2869('0x1c')]=utils[_0x2869('0x17')]();queues[_0x2461d9[_0x2869('0x5c')]]['holdtime']=0x0;queues[_0x2461d9[_0x2869('0x5c')]][_0x2869('0x5e')]=0x0;utils[_0x2869('0x13')](util[_0x2869('0x2')](_0x2869('0x64'),_0x2461d9[_0x2869('0x51')],queues[_0x2461d9[_0x2869('0x5c')]][_0x2869('0x21')],queues[_0x2461d9[_0x2869('0x5c')]][_0x2869('0xe')],queues[_0x2461d9['transfertargetuniqueid']]['calleridnum'],queues[_0x2461d9[_0x2869('0x5c')]][_0x2869('0x5d')]));}else{utils['info'](util[_0x2869('0x2')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x2461d9['origtransfereruniqueid'],queues[_0x2461d9[_0x2869('0x55')]][_0x2869('0x21')],_0x2461d9[_0x2869('0x52')]));queues[_0x2461d9['secondtransfererlinkedid']][_0x2869('0xe')]=_0x2461d9[_0x2869('0x52')];}}}}catch(_0x1d66ec){utils[_0x2869('0x18')](util[_0x2869('0x2')](_0x2869('0x50'),_0x2461d9[_0x2869('0x51')]),_0x1d66ec);}};exports['musiconholdstart']=function(_0x2cc7e7){try{if(!_[_0x2869('0x1a')](queues[_0x2cc7e7[_0x2869('0xf')]])){utils[_0x2869('0x11')](util[_0x2869('0x2')](_0x2869('0x65'),_0x2cc7e7[_0x2869('0xf')]),_0x2cc7e7);queues[_0x2cc7e7['uniqueid']][_0x2869('0x66')]=utils['now']();utils[_0x2869('0x13')](util[_0x2869('0x2')](_0x2869('0x67'),_0x2cc7e7['uniqueid'],queues[_0x2cc7e7[_0x2869('0xf')]][_0x2869('0x21')],queues[_0x2cc7e7[_0x2869('0xf')]][_0x2869('0x66')]));}}catch(_0x4641d0){utils[_0x2869('0x18')](util[_0x2869('0x2')](_0x2869('0x65'),_0x2cc7e7[_0x2869('0xf')]),_0x4641d0);}};exports[_0x2869('0x68')]=function(_0x508bbc){try{if(!_[_0x2869('0x1a')](queues[_0x508bbc[_0x2869('0xf')]])){if(!_[_0x2869('0x1a')](queues[_0x508bbc['uniqueid']][_0x2869('0x66')])){utils[_0x2869('0x11')](util[_0x2869('0x2')](_0x2869('0x69'),_0x508bbc['uniqueid']),_0x508bbc);queues[_0x508bbc[_0x2869('0xf')]][_0x2869('0x5e')]+=utils[_0x2869('0x38')](utils[_0x2869('0x17')](),queues[_0x508bbc['uniqueid']][_0x2869('0x66')]);utils[_0x2869('0x13')](util['format'](_0x2869('0x6a'),_0x508bbc['uniqueid'],queues[_0x508bbc[_0x2869('0xf')]][_0x2869('0x21')],queues[_0x508bbc[_0x2869('0xf')]]['mohtime']));delete queues[_0x508bbc[_0x2869('0xf')]][_0x2869('0x66')];}}}catch(_0x51dc1e){utils['error'](util[_0x2869('0x2')](_0x2869('0x69'),_0x508bbc[_0x2869('0xf')]),_0x51dc1e);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index 448b244..560591e 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 _0xee2d=['CreateVoiceRecording','newchannel','format','[%s][recordings][newchannel]','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','channel','error','newstate','debug','[%s][recordings][newstate]','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','isNil','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','variable','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','.wav49','replace','.WAV','find','monitors','push','hangup','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','cause-txt','connectedlinenum','connectedlinename','outbound','clone','newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','appdata','application','toLowerCase','startsWith','cdr','split','substring','lastIndexOf','queuecallerjoin','queue','[%s][recordings][queuecallerjoin]','lodash','util','./utils','info','[%s][recordings][writeDB]','uniqueid','accountcode','getUserByInternal','membername','name','UserId','request'];(function(_0x7217a6,_0x43950e){var _0x35bc74=function(_0x3d86db){while(--_0x3d86db){_0x7217a6['push'](_0x7217a6['shift']());}};_0x35bc74(++_0x43950e);}(_0xee2d,0x139));var _0xdee2=function(_0x288164,_0x2bca6c){_0x288164=_0x288164-0x0;var _0x3fed99=_0xee2d[_0x288164];return _0x3fed99;};'use strict';var _=require(_0xdee2('0x0'));var util=require(_0xdee2('0x1'));var utils=require(_0xdee2('0x2'));var recordings={};function writeDB(_0x31a993){utils[_0xdee2('0x3')](util['format'](_0xdee2('0x4'),_0x31a993[_0xdee2('0x5')]));if(_0x31a993[_0xdee2('0x6')]){utils[_0xdee2('0x7')](_0x31a993[_0xdee2('0x6')])['then'](function(_0x357352){if(_0x357352){_0x31a993[_0xdee2('0x8')]=_0x357352[_0xdee2('0x9')];_0x31a993[_0xdee2('0xa')]=_0x357352['id'];}utils[_0xdee2('0xb')](_0xdee2('0xc'),_0x31a993);});}else{utils[_0xdee2('0xb')]('CreateVoiceRecording',_0x31a993);}}exports[_0xdee2('0xd')]=function(_0x47c2ac){try{utils['debug'](util[_0xdee2('0xe')](_0xdee2('0xf'),_0x47c2ac[_0xdee2('0x5')]),_0x47c2ac);if(_0x47c2ac[_0xdee2('0x5')]==_0x47c2ac[_0xdee2('0x10')]){utils[_0xdee2('0x3')](util[_0xdee2('0xe')](_0xdee2('0x11'),_0x47c2ac[_0xdee2('0x5')],_0x47c2ac[_0xdee2('0x12')],_0x47c2ac['exten']));recordings[_0x47c2ac[_0xdee2('0x5')]]={'uniqueid':_0x47c2ac[_0xdee2('0x5')],'accountcode':_0x47c2ac[_0xdee2('0x6')],'exten':_0x47c2ac[_0xdee2('0x13')],'context':_0x47c2ac['context'],'channel':_0x47c2ac[_0xdee2('0x14')],'monitors':[]};}}catch(_0x3d57ef){utils[_0xdee2('0x15')](util[_0xdee2('0xe')](_0xdee2('0xf'),_0x47c2ac[_0xdee2('0x5')]),_0x3d57ef);}};exports[_0xdee2('0x16')]=function(_0x400621){try{utils[_0xdee2('0x17')](util[_0xdee2('0xe')](_0xdee2('0x18'),_0x400621[_0xdee2('0x5')]),_0x400621);if(!_['isNil'](recordings[_0x400621[_0xdee2('0x5')]])&&_0x400621[_0xdee2('0x19')]==0x6){utils[_0xdee2('0x3')](util['format'](_0xdee2('0x1a'),_0x400621[_0xdee2('0x5')],_0x400621[_0xdee2('0x12')],_0x400621[_0xdee2('0x14')]));}else if(!_[_0xdee2('0x1b')](recordings[_0x400621[_0xdee2('0x10')]])&&_0x400621[_0xdee2('0x19')]==0x6&&_0x400621[_0xdee2('0x12')]!=_0xdee2('0x1c')){utils['info'](util[_0xdee2('0xe')](_0xdee2('0x1d'),_0x400621[_0xdee2('0x5')],_0x400621[_0xdee2('0x10')],_0x400621[_0xdee2('0x12')],_0x400621[_0xdee2('0x14')]));recordings[_0x400621[_0xdee2('0x10')]][_0xdee2('0x6')]=_0x400621['accountcode'];}}catch(_0xb5e514){utils[_0xdee2('0x15')](util[_0xdee2('0xe')](_0xdee2('0x18'),_0x400621[_0xdee2('0x5')]),_0xb5e514);}};exports['varset']=function(_0x1bbdbb){try{if(!_['isNil'](_0x1bbdbb[_0xdee2('0x1e')])&&!_[_0xdee2('0x1b')](_0x1bbdbb[_0xdee2('0x1e')][_0xdee2('0x1f')])){utils[_0xdee2('0x17')](util[_0xdee2('0xe')](_0xdee2('0x20'),_0x1bbdbb[_0xdee2('0x5')]),_0x1bbdbb);utils[_0xdee2('0x3')](util[_0xdee2('0xe')](_0xdee2('0x21'),_0x1bbdbb[_0xdee2('0x5')],_0x1bbdbb[_0xdee2('0x1e')],_0x1bbdbb['value']));if(_['endsWith'](_0x1bbdbb[_0xdee2('0x22')],_0xdee2('0x23'))){_0x1bbdbb[_0xdee2('0x22')]=_0x1bbdbb[_0xdee2('0x22')][_0xdee2('0x24')](_0xdee2('0x23'),_0xdee2('0x25'));}if(recordings[_0x1bbdbb[_0xdee2('0x10')]]){var _0x1e36ad=_[_0xdee2('0x26')](recordings[_0x1bbdbb[_0xdee2('0x10')]][_0xdee2('0x27')],{'value':_0x1bbdbb[_0xdee2('0x22')]});if(_[_0xdee2('0x1b')](_0x1e36ad)){recordings[_0x1bbdbb[_0xdee2('0x10')]][_0xdee2('0x27')][_0xdee2('0x28')]({'value':_0x1bbdbb[_0xdee2('0x22')]});}}}}catch(_0x54a91a){utils[_0xdee2('0x15')](util['format']('[%s][recordings][varset]',_0x1bbdbb[_0xdee2('0x5')]),_0x54a91a);}};exports[_0xdee2('0x29')]=function(_0x4a2179){try{if(!_['isNil'](recordings[_0x4a2179['uniqueid']])){utils[_0xdee2('0x17')](util['format'](_0xdee2('0x2a'),_0x4a2179[_0xdee2('0x5')]),_0x4a2179);utils['info'](util[_0xdee2('0xe')](_0xdee2('0x2b'),_0x4a2179[_0xdee2('0x5')],_0x4a2179[_0xdee2('0x2c')],_0x4a2179[_0xdee2('0x2d')],_0x4a2179[_0xdee2('0x2e')]));recordings[_0x4a2179['uniqueid']][_0xdee2('0x2c')]=_0x4a2179[_0xdee2('0x2c')];recordings[_0x4a2179['uniqueid']][_0xdee2('0x2d')]=_0x4a2179[_0xdee2('0x2d')];recordings[_0x4a2179[_0xdee2('0x5')]][_0xdee2('0x2f')]=_0x4a2179[_0xdee2('0x2f')];recordings[_0x4a2179[_0xdee2('0x5')]][_0xdee2('0x30')]=_0x4a2179[_0xdee2('0x30')];if(recordings[_0x4a2179[_0xdee2('0x5')]]['type']==_0xdee2('0x31')&&recordings[_0x4a2179['uniqueid']][_0xdee2('0x6')]){recordings[_0x4a2179[_0xdee2('0x5')]][_0xdee2('0x2f')]=recordings[_0x4a2179[_0xdee2('0x5')]][_0xdee2('0x6')];recordings[_0x4a2179[_0xdee2('0x5')]][_0xdee2('0x30')]='';}recordings[_0x4a2179[_0xdee2('0x5')]][_0xdee2('0x27')]['forEach'](function(_0x28b6bc){var _0x3f6ef9=_[_0xdee2('0x32')](recordings[_0x4a2179[_0xdee2('0x5')]]);_0x3f6ef9['value']=_0x28b6bc[_0xdee2('0x22')];writeDB(_0x3f6ef9);});delete recordings[_0x4a2179['uniqueid']];}}catch(_0x56eff4){utils[_0xdee2('0x15')](util['format']('[%s][recordings][hangup]',_0x4a2179['uniqueid']),_0x56eff4);}};exports[_0xdee2('0x33')]=function(_0x533fec){try{if(!_[_0xdee2('0x1b')](recordings[_0x533fec[_0xdee2('0x5')]])){utils[_0xdee2('0x17')](util[_0xdee2('0xe')](_0xdee2('0x34'),_0x533fec[_0xdee2('0x5')]),_0x533fec);utils[_0xdee2('0x3')](util[_0xdee2('0xe')](_0xdee2('0x35'),_0x533fec['uniqueid'],_0x533fec['application'],_0x533fec[_0xdee2('0x36')]));if(_0x533fec[_0xdee2('0x37')][_0xdee2('0x38')]()=='set'&&_[_0xdee2('0x39')](_0x533fec[_0xdee2('0x36')][_0xdee2('0x38')](),_0xdee2('0x3a'))){var _0x2c7a3b=_0x533fec[_0xdee2('0x36')][_0xdee2('0x3b')]('=');var _0x3f9349=_0x2c7a3b[0x0][_0xdee2('0x3c')](_0x2c7a3b[0x0][_0xdee2('0x3d')]('(')+0x1,_0x2c7a3b[0x0][_0xdee2('0x3d')](')'));var _0xd2119d=_0x2c7a3b[0x1];recordings[_0x533fec[_0xdee2('0x5')]][_0x3f9349]=_0xd2119d;}}}catch(_0x49aff3){utils[_0xdee2('0x15')](util[_0xdee2('0xe')]('[%s][recordings][newexten]',_0x533fec[_0xdee2('0x5')]),_0x49aff3);}};exports[_0xdee2('0x3e')]=function(_0x1e618b){try{if(!_[_0xdee2('0x1b')](recordings[_0x1e618b[_0xdee2('0x5')]])){utils['debug'](util[_0xdee2('0xe')]('[%s][recordings][queuecallerjoin]',_0x1e618b[_0xdee2('0x5')]),_0x1e618b);utils[_0xdee2('0x3')](util[_0xdee2('0xe')]('[%s][recordings][queuecallerjoin]\x20queue:%s',_0x1e618b[_0xdee2('0x5')],_0x1e618b[_0xdee2('0x3f')]));recordings[_0x1e618b[_0xdee2('0x5')]]['queue']=_0x1e618b[_0xdee2('0x3f')];}}catch(_0xb02d89){utils[_0xdee2('0x15')](util[_0xdee2('0xe')](_0xdee2('0x40'),_0x1e618b[_0xdee2('0x5')]),_0xb02d89);}}; \ No newline at end of file +var _0x9550=['monitors','push','hangup','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','cause-txt','calleridname','connectedlinenum','connectedlinename','type','error','[%s][recordings][hangup]','newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','appdata','application','set','startsWith','toLowerCase','split','substring','lastIndexOf','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','util','./utils','info','format','[%s][recordings][writeDB]','uniqueid','accountcode','getUserByInternal','then','membername','UserId','request','CreateVoiceRecording','newchannel','debug','[%s][recordings][newchannel]','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','exten','context','channel','newstate','[%s][recordings][newstate]','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','variable','mixmonitor_filename','[%s][recordings][varset]','endsWith','.wav49','value','replace','.WAV','find'];(function(_0x44c7a2,_0x449be7){var _0x3efc90=function(_0x114726){while(--_0x114726){_0x44c7a2['push'](_0x44c7a2['shift']());}};_0x3efc90(++_0x449be7);}(_0x9550,0x1cc));var _0x0955=function(_0x58afe8,_0x4cdb7d){_0x58afe8=_0x58afe8-0x0;var _0x2b397a=_0x9550[_0x58afe8];return _0x2b397a;};'use strict';var _=require('lodash');var util=require(_0x0955('0x0'));var utils=require(_0x0955('0x1'));var recordings={};function writeDB(_0x5739dc){utils[_0x0955('0x2')](util[_0x0955('0x3')](_0x0955('0x4'),_0x5739dc[_0x0955('0x5')]));if(_0x5739dc[_0x0955('0x6')]){utils[_0x0955('0x7')](_0x5739dc[_0x0955('0x6')])[_0x0955('0x8')](function(_0x1c7a1e){if(_0x1c7a1e){_0x5739dc[_0x0955('0x9')]=_0x1c7a1e['name'];_0x5739dc[_0x0955('0xa')]=_0x1c7a1e['id'];}utils['request']('CreateVoiceRecording',_0x5739dc);});}else{utils[_0x0955('0xb')](_0x0955('0xc'),_0x5739dc);}}exports[_0x0955('0xd')]=function(_0x1c6b1c){try{utils[_0x0955('0xe')](util[_0x0955('0x3')](_0x0955('0xf'),_0x1c6b1c[_0x0955('0x5')]),_0x1c6b1c);if(_0x1c6b1c[_0x0955('0x5')]==_0x1c6b1c[_0x0955('0x10')]){utils['info'](util[_0x0955('0x3')](_0x0955('0x11'),_0x1c6b1c['uniqueid'],_0x1c6b1c['context'],_0x1c6b1c[_0x0955('0x12')]));recordings[_0x1c6b1c[_0x0955('0x5')]]={'uniqueid':_0x1c6b1c['uniqueid'],'accountcode':_0x1c6b1c[_0x0955('0x6')],'exten':_0x1c6b1c[_0x0955('0x12')],'context':_0x1c6b1c[_0x0955('0x13')],'channel':_0x1c6b1c[_0x0955('0x14')],'monitors':[]};}}catch(_0x44369a){utils['error'](util[_0x0955('0x3')](_0x0955('0xf'),_0x1c6b1c[_0x0955('0x5')]),_0x44369a);}};exports[_0x0955('0x15')]=function(_0x4691f8){try{utils[_0x0955('0xe')](util[_0x0955('0x3')](_0x0955('0x16'),_0x4691f8[_0x0955('0x5')]),_0x4691f8);if(!_[_0x0955('0x17')](recordings[_0x4691f8[_0x0955('0x5')]])&&_0x4691f8[_0x0955('0x18')]==0x6){utils['info'](util[_0x0955('0x3')](_0x0955('0x19'),_0x4691f8[_0x0955('0x5')],_0x4691f8[_0x0955('0x13')],_0x4691f8[_0x0955('0x14')]));}else if(!_[_0x0955('0x17')](recordings[_0x4691f8[_0x0955('0x10')]])&&_0x4691f8[_0x0955('0x18')]==0x6&&_0x4691f8['context']!='transfer'){utils[_0x0955('0x2')](util[_0x0955('0x3')](_0x0955('0x1a'),_0x4691f8['uniqueid'],_0x4691f8[_0x0955('0x10')],_0x4691f8['context'],_0x4691f8['channel']));recordings[_0x4691f8['linkedid']][_0x0955('0x6')]=_0x4691f8['accountcode'];}}catch(_0x8942e0){utils['error'](util[_0x0955('0x3')](_0x0955('0x16'),_0x4691f8[_0x0955('0x5')]),_0x8942e0);}};exports['varset']=function(_0x1b6a50){try{if(!_[_0x0955('0x17')](_0x1b6a50[_0x0955('0x1b')])&&!_[_0x0955('0x17')](_0x1b6a50['variable'][_0x0955('0x1c')])){utils[_0x0955('0xe')](util['format'](_0x0955('0x1d'),_0x1b6a50[_0x0955('0x5')]),_0x1b6a50);utils[_0x0955('0x2')](util['format']('[%s][recordings][varset]\x20variable:%s\x20value:%s',_0x1b6a50[_0x0955('0x5')],_0x1b6a50['variable'],_0x1b6a50['value']));if(_[_0x0955('0x1e')](_0x1b6a50['value'],_0x0955('0x1f'))){_0x1b6a50['value']=_0x1b6a50[_0x0955('0x20')][_0x0955('0x21')](_0x0955('0x1f'),_0x0955('0x22'));}if(recordings[_0x1b6a50[_0x0955('0x10')]]){var _0x544aa7=_[_0x0955('0x23')](recordings[_0x1b6a50[_0x0955('0x10')]][_0x0955('0x24')],{'value':_0x1b6a50[_0x0955('0x20')]});if(_[_0x0955('0x17')](_0x544aa7)){recordings[_0x1b6a50['linkedid']][_0x0955('0x24')][_0x0955('0x25')]({'value':_0x1b6a50[_0x0955('0x20')]});}}}}catch(_0x2f6714){utils['error'](util[_0x0955('0x3')](_0x0955('0x1d'),_0x1b6a50[_0x0955('0x5')]),_0x2f6714);}};exports[_0x0955('0x26')]=function(_0x26aee0){try{if(!_['isNil'](recordings[_0x26aee0[_0x0955('0x5')]])){utils['debug'](util[_0x0955('0x3')]('[%s][recordings][hangup]',_0x26aee0['uniqueid']),_0x26aee0);utils[_0x0955('0x2')](util[_0x0955('0x3')](_0x0955('0x27'),_0x26aee0[_0x0955('0x5')],_0x26aee0[_0x0955('0x28')],_0x26aee0['calleridname'],_0x26aee0[_0x0955('0x29')]));recordings[_0x26aee0[_0x0955('0x5')]]['calleridnum']=_0x26aee0[_0x0955('0x28')];recordings[_0x26aee0[_0x0955('0x5')]][_0x0955('0x2a')]=_0x26aee0[_0x0955('0x2a')];recordings[_0x26aee0[_0x0955('0x5')]][_0x0955('0x2b')]=_0x26aee0[_0x0955('0x2b')];recordings[_0x26aee0[_0x0955('0x5')]][_0x0955('0x2c')]=_0x26aee0[_0x0955('0x2c')];if(recordings[_0x26aee0[_0x0955('0x5')]][_0x0955('0x2d')]=='outbound'&&recordings[_0x26aee0['uniqueid']][_0x0955('0x6')]){recordings[_0x26aee0['uniqueid']][_0x0955('0x2b')]=recordings[_0x26aee0['uniqueid']][_0x0955('0x6')];recordings[_0x26aee0[_0x0955('0x5')]][_0x0955('0x2c')]='';}recordings[_0x26aee0[_0x0955('0x5')]][_0x0955('0x24')]['forEach'](function(_0x476dbd){var _0x722a12=_['clone'](recordings[_0x26aee0[_0x0955('0x5')]]);_0x722a12[_0x0955('0x20')]=_0x476dbd[_0x0955('0x20')];writeDB(_0x722a12);});delete recordings[_0x26aee0[_0x0955('0x5')]];}}catch(_0x4b000e){utils[_0x0955('0x2e')](util[_0x0955('0x3')](_0x0955('0x2f'),_0x26aee0[_0x0955('0x5')]),_0x4b000e);}};exports[_0x0955('0x30')]=function(_0x542adc){try{if(!_[_0x0955('0x17')](recordings[_0x542adc['uniqueid']])){utils[_0x0955('0xe')](util[_0x0955('0x3')](_0x0955('0x31'),_0x542adc[_0x0955('0x5')]),_0x542adc);utils[_0x0955('0x2')](util[_0x0955('0x3')](_0x0955('0x32'),_0x542adc['uniqueid'],_0x542adc['application'],_0x542adc[_0x0955('0x33')]));if(_0x542adc[_0x0955('0x34')]['toLowerCase']()==_0x0955('0x35')&&_[_0x0955('0x36')](_0x542adc[_0x0955('0x33')][_0x0955('0x37')](),'cdr')){var _0x149e9c=_0x542adc[_0x0955('0x33')][_0x0955('0x38')]('=');var _0x578f3a=_0x149e9c[0x0][_0x0955('0x39')](_0x149e9c[0x0][_0x0955('0x3a')]('(')+0x1,_0x149e9c[0x0][_0x0955('0x3a')](')'));var _0x1a3bf1=_0x149e9c[0x1];recordings[_0x542adc[_0x0955('0x5')]][_0x578f3a]=_0x1a3bf1;}}}catch(_0x1224a3){utils['error'](util[_0x0955('0x3')](_0x0955('0x31'),_0x542adc[_0x0955('0x5')]),_0x1224a3);}};exports['queuecallerjoin']=function(_0x1ebf32){try{if(!_[_0x0955('0x17')](recordings[_0x1ebf32['uniqueid']])){utils[_0x0955('0xe')](util['format'](_0x0955('0x3b'),_0x1ebf32[_0x0955('0x5')]),_0x1ebf32);utils[_0x0955('0x2')](util[_0x0955('0x3')](_0x0955('0x3c'),_0x1ebf32[_0x0955('0x5')],_0x1ebf32[_0x0955('0x3d')]));recordings[_0x1ebf32['uniqueid']][_0x0955('0x3d')]=_0x1ebf32['queue'];}}catch(_0x1a0c42){utils[_0x0955('0x2e')](util[_0x0955('0x3')](_0x0955('0x3b'),_0x1ebf32[_0x0955('0x5')]),_0x1a0c42);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index eaada71..a8fd05d 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 _0x0066=['attendedtransfer','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridname','assign','origtransfererchannel','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','origtransfererlinkedid','origtransferercontext','transfereechannel','transfertargetchannel','transfertargetaccountcode','transfertargetcontext','transfertargetlinkedid','error','[%s][transfers][attendedtransfer]','lodash','util','type','attended','origtransfereruniqueid','uniqueid','request','debug','info','format','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','blind','[%s][transfers][blindtransfer]'];(function(_0x4c9380,_0x2fefc0){var _0x49a523=function(_0x165e85){while(--_0x165e85){_0x4c9380['push'](_0x4c9380['shift']());}};_0x49a523(++_0x2fefc0);}(_0x0066,0x195));var _0x6006=function(_0x2fda86,_0x376a4a){_0x2fda86=_0x2fda86-0x0;var _0x445798=_0x0066[_0x2fda86];return _0x445798;};'use strict';var _=require(_0x6006('0x0'));var util=require(_0x6006('0x1'));var utils=require('./utils');function writeDB(_0x50f00a){utils['info'](util['format']('[%s][transfers][writeDB]\x20type:%s',_0x50f00a[_0x6006('0x2')]===_0x6006('0x3')?_0x50f00a[_0x6006('0x4')]:_0x50f00a[_0x6006('0x5')],_0x50f00a['type']));utils[_0x6006('0x6')]('CreateVoiceTransferReport',_0x50f00a);}exports['blindtransfer']=function(_0x3fb8b4){try{utils[_0x6006('0x7')](util['format']('[%s][transfers][blindtransfer]',_0x3fb8b4[_0x6006('0x5')]),_0x3fb8b4);utils[_0x6006('0x8')](util[_0x6006('0x9')](_0x6006('0xa'),_0x3fb8b4[_0x6006('0x5')],_0x3fb8b4[_0x6006('0xb')],_0x3fb8b4[_0x6006('0xc')],_0x3fb8b4['transfereecalleridnum'],_0x3fb8b4['transfereecalleridname']));_0x3fb8b4['type']=_0x6006('0xd');writeDB(_0x3fb8b4);}catch(_0x1f5ae7){utils['error'](util[_0x6006('0x9')](_0x6006('0xe'),_0x3fb8b4[_0x6006('0x5')]),_0x1f5ae7);}};exports[_0x6006('0xf')]=function(_0xa65cbe){try{utils[_0x6006('0x7')](util[_0x6006('0x9')]('[%s][transfers][attendedtransfer]',_0xa65cbe[_0x6006('0x4')]),_0xa65cbe);utils[_0x6006('0x8')](util[_0x6006('0x9')](_0x6006('0x10'),_0xa65cbe[_0x6006('0x4')],_0xa65cbe[_0x6006('0x11')],_0xa65cbe[_0x6006('0x12')],_0xa65cbe['transfertargetcalleridnum'],_0xa65cbe[_0x6006('0x13')]));_0xa65cbe=_[_0x6006('0x14')](_0xa65cbe,{'transfererchannel':_0xa65cbe[_0x6006('0x15')],'transferercalleridnum':_0xa65cbe['origtransferercalleridnum'],'transferercalleridname':_0xa65cbe[_0x6006('0x12')],'transfererconnectedlinenum':_0xa65cbe[_0x6006('0x16')],'transfererconnectedlinename':_0xa65cbe[_0x6006('0x17')],'transfereraccountcode':_0xa65cbe[_0x6006('0x18')],'transferercontext':_0xa65cbe[_0x6006('0x19')],'transfererexten':_0xa65cbe['secondtransfererexten'],'transfererlinkedid':_0xa65cbe[_0x6006('0x1a')],'context':_0xa65cbe[_0x6006('0x1b')],'extension':_0xa65cbe['origtransfererexten'],'type':_0x6006('0x3')});if(_['isNil'](_0xa65cbe[_0x6006('0x1c')])){_0xa65cbe=_[_0x6006('0x14')](_0xa65cbe,{'transfereechannel':_0xa65cbe[_0x6006('0x1d')],'transfereecalleridnum':_0xa65cbe['transfertargetcalleridnum'],'transfereecalleridname':_0xa65cbe[_0x6006('0x13')],'transfereeconnectedlinenum':_0xa65cbe['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0xa65cbe['transfertargetconnectedlinename'],'transfereeaccountcode':_0xa65cbe[_0x6006('0x1e')],'transfereecontext':_0xa65cbe[_0x6006('0x1f')],'transfereeexten':_0xa65cbe['transfertargetexten'],'transfereelinkedid':_0xa65cbe[_0x6006('0x20')]});}writeDB(_0xa65cbe);}catch(_0x27536e){utils[_0x6006('0x21')](util[_0x6006('0x9')](_0x6006('0x22'),_0xa65cbe['origtransfereruniqueid']),_0x27536e);}}; \ No newline at end of file +var _0xbb62=['transfertargetcalleridnum','assign','origtransfererchannel','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransferercontext','origtransfererexten','transfertargetchannel','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetexten','transfertargetlinkedid','lodash','util','./utils','info','format','[%s][transfers][writeDB]\x20type:%s','type','attended','origtransfereruniqueid','uniqueid','request','CreateVoiceTransferReport','blindtransfer','debug','[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridname','transfereecalleridnum','transfereecalleridname','blind','error','attendedtransfer','[%s][transfers][attendedtransfer]','origtransferercalleridnum'];(function(_0x5c9865,_0x1a299a){var _0x54c22b=function(_0x538537){while(--_0x538537){_0x5c9865['push'](_0x5c9865['shift']());}};_0x54c22b(++_0x1a299a);}(_0xbb62,0x1ec));var _0x2bb6=function(_0x3a9661,_0x530b12){_0x3a9661=_0x3a9661-0x0;var _0x5bb119=_0xbb62[_0x3a9661];return _0x5bb119;};'use strict';var _=require(_0x2bb6('0x0'));var util=require(_0x2bb6('0x1'));var utils=require(_0x2bb6('0x2'));function writeDB(_0x44069d){utils[_0x2bb6('0x3')](util[_0x2bb6('0x4')](_0x2bb6('0x5'),_0x44069d[_0x2bb6('0x6')]===_0x2bb6('0x7')?_0x44069d[_0x2bb6('0x8')]:_0x44069d[_0x2bb6('0x9')],_0x44069d[_0x2bb6('0x6')]));utils[_0x2bb6('0xa')](_0x2bb6('0xb'),_0x44069d);}exports[_0x2bb6('0xc')]=function(_0x33390a){try{utils[_0x2bb6('0xd')](util[_0x2bb6('0x4')](_0x2bb6('0xe'),_0x33390a['uniqueid']),_0x33390a);utils[_0x2bb6('0x3')](util[_0x2bb6('0x4')](_0x2bb6('0xf'),_0x33390a[_0x2bb6('0x9')],_0x33390a['transferercalleridnum'],_0x33390a[_0x2bb6('0x10')],_0x33390a[_0x2bb6('0x11')],_0x33390a[_0x2bb6('0x12')]));_0x33390a[_0x2bb6('0x6')]=_0x2bb6('0x13');writeDB(_0x33390a);}catch(_0x58bbcf){utils[_0x2bb6('0x14')](util[_0x2bb6('0x4')](_0x2bb6('0xe'),_0x33390a['uniqueid']),_0x58bbcf);}};exports[_0x2bb6('0x15')]=function(_0x42549b){try{utils['debug'](util[_0x2bb6('0x4')](_0x2bb6('0x16'),_0x42549b[_0x2bb6('0x8')]),_0x42549b);utils[_0x2bb6('0x3')](util['format']('[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x42549b[_0x2bb6('0x8')],_0x42549b[_0x2bb6('0x17')],_0x42549b['origtransferercalleridname'],_0x42549b[_0x2bb6('0x18')],_0x42549b['transfertargetcalleridname']));_0x42549b=_[_0x2bb6('0x19')](_0x42549b,{'transfererchannel':_0x42549b[_0x2bb6('0x1a')],'transferercalleridnum':_0x42549b[_0x2bb6('0x17')],'transferercalleridname':_0x42549b[_0x2bb6('0x1b')],'transfererconnectedlinenum':_0x42549b[_0x2bb6('0x1c')],'transfererconnectedlinename':_0x42549b[_0x2bb6('0x1d')],'transfereraccountcode':_0x42549b[_0x2bb6('0x1e')],'transferercontext':_0x42549b[_0x2bb6('0x1f')],'transfererexten':_0x42549b[_0x2bb6('0x20')],'transfererlinkedid':_0x42549b[_0x2bb6('0x21')],'context':_0x42549b[_0x2bb6('0x22')],'extension':_0x42549b[_0x2bb6('0x23')],'type':'attended'});if(_['isNil'](_0x42549b['transfereechannel'])){_0x42549b=_['assign'](_0x42549b,{'transfereechannel':_0x42549b[_0x2bb6('0x24')],'transfereecalleridnum':_0x42549b['transfertargetcalleridnum'],'transfereecalleridname':_0x42549b[_0x2bb6('0x25')],'transfereeconnectedlinenum':_0x42549b[_0x2bb6('0x26')],'transfereeconnectedlinename':_0x42549b[_0x2bb6('0x27')],'transfereeaccountcode':_0x42549b[_0x2bb6('0x28')],'transfereecontext':_0x42549b['transfertargetcontext'],'transfereeexten':_0x42549b[_0x2bb6('0x29')],'transfereelinkedid':_0x42549b[_0x2bb6('0x2a')]});}writeDB(_0x42549b);}catch(_0x59e9a1){utils[_0x2bb6('0x14')](util[_0x2bb6('0x4')](_0x2bb6('0x16'),_0x42549b['origtransfereruniqueid']),_0x59e9a1);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index af0d2d0..1c0f9e9 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 _0x8a62=['notfound','[utils][getVoiceQueueByName]','addTime','add','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','diffTime','diff','sumTime','now','isAfter','isBefore','bluebird','moment','util','client','http','xdr','info','inspect','debug','error','request','[utils][request]\x20name:%s','GetUser','interface','then','[utils][getUser]\x20where:%s','result','length','[utils][getUserByInternal]\x20internal:%s\x20%s','found','catch','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s'];(function(_0x2112d4,_0x3c863c){var _0x434972=function(_0x477020){while(--_0x477020){_0x2112d4['push'](_0x2112d4['shift']());}};_0x434972(++_0x3c863c);}(_0x8a62,0x18f));var _0x28a6=function(_0x4357d8,_0x503aa2){_0x4357d8=_0x4357d8-0x0;var _0x5350d6=_0x8a62[_0x4357d8];return _0x5350d6;};'use strict';var BPromise=require(_0x28a6('0x0'));var jayson=require('jayson/promise');var moment=require(_0x28a6('0x1'));var util=require(_0x28a6('0x2'));var client=jayson[_0x28a6('0x3')][_0x28a6('0x4')]({'port':0x2329});var logger=require('../../config/logger')(_0x28a6('0x5'));exports[_0x28a6('0x6')]=function(_0x46439a,_0x295366){logger[_0x28a6('0x6')](_0x46439a,_0x295366?util[_0x28a6('0x7')](_0x295366,{'showHidden':![],'depth':null}):'');};exports[_0x28a6('0x8')]=function(_0x97d860,_0x5ae651){logger[_0x28a6('0x8')](_0x97d860,_0x5ae651?util[_0x28a6('0x7')](_0x5ae651,{'showHidden':![],'depth':null}):'');};exports[_0x28a6('0x9')]=function(_0x5bcd10,_0x417f8e){logger['error'](_0x5bcd10,_0x417f8e?util[_0x28a6('0x7')](_0x417f8e,{'showHidden':![],'depth':null}):'');};exports[_0x28a6('0xa')]=function(_0x5bacae,_0x47fc1f){return client[_0x28a6('0xa')](_0x5bacae,{'body':_0x47fc1f})['then'](function(_0x265f7b){logger['debug'](_0x28a6('0xb'),_0x5bacae,_0x265f7b?util[_0x28a6('0x7')](_0x265f7b,{'showHidden':![],'depth':null}):'');})['catch'](function(_0xc6e917){logger[_0x28a6('0x9')](_0x28a6('0xb'),_0x5bacae,_0xc6e917?util[_0x28a6('0x7')](_0xc6e917,{'showHidden':![],'depth':null}):'');});};function getUser(_0x5a63c7){return client[_0x28a6('0xa')](_0x28a6('0xc'),{'options':{'raw':!![],'attributes':['id','internal','name',_0x28a6('0xd')],'where':_0x5a63c7,'limit':0x1}})[_0x28a6('0xe')](function(_0x9fef62){logger[_0x28a6('0x8')](_0x28a6('0xf'),JSON['stringify'](_0x5a63c7),_0x9fef62?util[_0x28a6('0x7')](_0x9fef62,{'showHidden':![],'depth':null}):'');return _0x9fef62[_0x28a6('0x10')][_0x28a6('0x11')]?_0x9fef62[_0x28a6('0x10')][0x0]:null;});}exports['getUserByInternal']=function(_0x5b282f){return new BPromise(function(_0x5433ca,_0x2b4d7d){if(_0x5b282f){return getUser({'internal':_0x5b282f})[_0x28a6('0xe')](function(_0x5328c9){logger[_0x28a6('0x6')](_0x28a6('0x12'),_0x5b282f,_0x5328c9?_0x28a6('0x13'):'notfound');return _0x5433ca(_0x5328c9);})[_0x28a6('0x14')](function(_0x60ce82){logger[_0x28a6('0x9')]('[utils][getUserByInternal]',_0x60ce82?util[_0x28a6('0x7')](_0x60ce82,{'showHidden':![],'depth':null}):'');return _0x5433ca(null);});}return _0x5433ca(null);});};exports[_0x28a6('0x15')]=function(_0x1e7270){return new BPromise(function(_0x1ae2b6,_0x2f433b){if(_0x1e7270){return getUser({'interface':_0x1e7270})['then'](function(_0x49651e){logger[_0x28a6('0x6')](_0x28a6('0x16'),_0x1e7270,_0x49651e?_0x28a6('0x13'):'notfound');return _0x1ae2b6(_0x49651e);})[_0x28a6('0x14')](function(_0x47d051){logger[_0x28a6('0x9')](_0x28a6('0x17'),_0x47d051?util['inspect'](_0x47d051,{'showHidden':![],'depth':null}):'');return _0x1ae2b6(null);});}return _0x1ae2b6(null);});};exports[_0x28a6('0x18')]=function(_0xf45b89){return new BPromise(function(_0x48f976,_0x4088dd){if(_0xf45b89){return getUser({'name':_0xf45b89})[_0x28a6('0xe')](function(_0x1ae8fd){logger['info'](_0x28a6('0x19'),_0xf45b89,_0x1ae8fd?_0x28a6('0x13'):'notfound');return _0x48f976(_0x1ae8fd);})['catch'](function(_0x52ba25){logger['error'](_0x28a6('0x1a'),_0x52ba25?util[_0x28a6('0x7')](_0x52ba25,{'showHidden':![],'depth':null}):'');return _0x48f976(null);});}return _0x48f976(null);});};exports[_0x28a6('0x1b')]=function(_0x4501e9){return new BPromise(function(_0x896917,_0x28d5bd){if(_0x4501e9){return client[_0x28a6('0xa')](_0x28a6('0x1c'),{'options':{'raw':!![],'attributes':['id','name','type',_0x28a6('0x1d'),_0x28a6('0x1e')],'where':{'name':_0x4501e9},'limit':0x1}})['then'](function(_0x4716a1){logger[_0x28a6('0x8')](_0x28a6('0x1f'),_0x4501e9,_0x4716a1?util[_0x28a6('0x7')](_0x4716a1,{'showHidden':![],'depth':null}):'');logger[_0x28a6('0x6')](_0x28a6('0x20'),_0x4501e9,_0x4716a1?_0x28a6('0x13'):_0x28a6('0x21'));return _0x896917(_0x4716a1['result'][_0x28a6('0x11')]?_0x4716a1[_0x28a6('0x10')][0x0]:null);})[_0x28a6('0x14')](function(_0x268241){logger[_0x28a6('0x9')](_0x28a6('0x22'),_0x268241?util[_0x28a6('0x7')](_0x268241,{'showHidden':![],'depth':null}):'');return _0x896917(null);});}return _0x896917(null);});};exports[_0x28a6('0x23')]=function(_0x225878,_0x4126f3){return moment(_0x225878)[_0x28a6('0x24')](_0x4126f3,_0x28a6('0x25'))[_0x28a6('0x26')](_0x28a6('0x27'));};exports[_0x28a6('0x28')]=function(_0x442e6e,_0x69eb3c){return moment(_0x442e6e)[_0x28a6('0x29')](_0x69eb3c,_0x28a6('0x25'))[_0x28a6('0x26')](_0x28a6('0x27'));};exports[_0x28a6('0x2a')]=function(_0x5a2f8b,_0x5e001e){return moment(_0x5a2f8b)[_0x28a6('0x2b')](moment(_0x5e001e),_0x28a6('0x25'));};exports[_0x28a6('0x2c')]=function(_0x49c38c,_0x286287){return parseInt(_0x49c38c,0xa)+parseInt(_0x286287,0xa);};exports[_0x28a6('0x2d')]=function(){return moment()[_0x28a6('0x26')](_0x28a6('0x27'));};exports[_0x28a6('0x2e')]=function(_0x3509ce,_0x379b41){if(_0x379b41){return moment(_0x3509ce)[_0x28a6('0x2e')](_0x379b41);}return!![];};exports[_0x28a6('0x2f')]=function(_0x4da848,_0x17b591){if(_0x17b591){return moment(_0x4da848)[_0x28a6('0x2f')](_0x17b591);}else if(_0x4da848){return!![];}return![];}; \ No newline at end of file +var _0x5afc=['name','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','length','add','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','seconds','diffTime','sumTime','now','isAfter','isBefore','jayson/promise','moment','util','client','http','../../config/logger','xdr','info','inspect','debug','error','request','catch','[utils][request]\x20name:%s','GetUser','internal','interface','[utils][getUser]\x20where:%s','result','[utils][getUserByInternal]\x20internal:%s\x20%s','found','[utils][getUserByInternal]','then','[utils][getUserByInterface]\x20interface:%s\x20%s','notfound','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue'];(function(_0x2313e8,_0x332e97){var _0x482a35=function(_0xe736a0){while(--_0xe736a0){_0x2313e8['push'](_0x2313e8['shift']());}};_0x482a35(++_0x332e97);}(_0x5afc,0x1db));var _0xc5af=function(_0x1ec76b,_0x28039a){_0x1ec76b=_0x1ec76b-0x0;var _0x755800=_0x5afc[_0x1ec76b];return _0x755800;};'use strict';var BPromise=require('bluebird');var jayson=require(_0xc5af('0x0'));var moment=require(_0xc5af('0x1'));var util=require(_0xc5af('0x2'));var client=jayson[_0xc5af('0x3')][_0xc5af('0x4')]({'port':0x2329});var logger=require(_0xc5af('0x5'))(_0xc5af('0x6'));exports['info']=function(_0x1f1a85,_0x4139bf){logger[_0xc5af('0x7')](_0x1f1a85,_0x4139bf?util[_0xc5af('0x8')](_0x4139bf,{'showHidden':![],'depth':null}):'');};exports[_0xc5af('0x9')]=function(_0x16e002,_0x481e99){logger[_0xc5af('0x9')](_0x16e002,_0x481e99?util[_0xc5af('0x8')](_0x481e99,{'showHidden':![],'depth':null}):'');};exports[_0xc5af('0xa')]=function(_0x1cf8f5,_0x54f371){logger[_0xc5af('0xa')](_0x1cf8f5,_0x54f371?util[_0xc5af('0x8')](_0x54f371,{'showHidden':![],'depth':null}):'');};exports[_0xc5af('0xb')]=function(_0x460c60,_0x3517a8){return client['request'](_0x460c60,{'body':_0x3517a8})['then'](function(_0x54997f){logger[_0xc5af('0x9')]('[utils][request]\x20name:%s',_0x460c60,_0x54997f?util['inspect'](_0x54997f,{'showHidden':![],'depth':null}):'');})[_0xc5af('0xc')](function(_0x5d8ab8){logger[_0xc5af('0xa')](_0xc5af('0xd'),_0x460c60,_0x5d8ab8?util['inspect'](_0x5d8ab8,{'showHidden':![],'depth':null}):'');});};function getUser(_0xbbe106){return client['request'](_0xc5af('0xe'),{'options':{'raw':!![],'attributes':['id',_0xc5af('0xf'),'name',_0xc5af('0x10')],'where':_0xbbe106,'limit':0x1}})['then'](function(_0x32f9ff){logger[_0xc5af('0x9')](_0xc5af('0x11'),JSON['stringify'](_0xbbe106),_0x32f9ff?util[_0xc5af('0x8')](_0x32f9ff,{'showHidden':![],'depth':null}):'');return _0x32f9ff[_0xc5af('0x12')]['length']?_0x32f9ff[_0xc5af('0x12')][0x0]:null;});}exports['getUserByInternal']=function(_0x36d033){return new BPromise(function(_0x73ee8a,_0x314d24){if(_0x36d033){return getUser({'internal':_0x36d033})['then'](function(_0x285fc5){logger[_0xc5af('0x7')](_0xc5af('0x13'),_0x36d033,_0x285fc5?_0xc5af('0x14'):'notfound');return _0x73ee8a(_0x285fc5);})['catch'](function(_0x7cc9af){logger[_0xc5af('0xa')](_0xc5af('0x15'),_0x7cc9af?util[_0xc5af('0x8')](_0x7cc9af,{'showHidden':![],'depth':null}):'');return _0x73ee8a(null);});}return _0x73ee8a(null);});};exports['getUserByInterface']=function(_0x239302){return new BPromise(function(_0x48a891,_0x1183b6){if(_0x239302){return getUser({'interface':_0x239302})[_0xc5af('0x16')](function(_0x4b3178){logger[_0xc5af('0x7')](_0xc5af('0x17'),_0x239302,_0x4b3178?_0xc5af('0x14'):_0xc5af('0x18'));return _0x48a891(_0x4b3178);})[_0xc5af('0xc')](function(_0x99c65){logger['error'](_0xc5af('0x19'),_0x99c65?util[_0xc5af('0x8')](_0x99c65,{'showHidden':![],'depth':null}):'');return _0x48a891(null);});}return _0x48a891(null);});};exports[_0xc5af('0x1a')]=function(_0x119dc7){return new BPromise(function(_0x3a883d,_0x19e488){if(_0x119dc7){return getUser({'name':_0x119dc7})[_0xc5af('0x16')](function(_0x4df2d6){logger[_0xc5af('0x7')](_0xc5af('0x1b'),_0x119dc7,_0x4df2d6?_0xc5af('0x14'):_0xc5af('0x18'));return _0x3a883d(_0x4df2d6);})[_0xc5af('0xc')](function(_0x2d55f3){logger['error'](_0xc5af('0x1c'),_0x2d55f3?util['inspect'](_0x2d55f3,{'showHidden':![],'depth':null}):'');return _0x3a883d(null);});}return _0x3a883d(null);});};exports[_0xc5af('0x1d')]=function(_0x4c6407){return new BPromise(function(_0x2f7da2,_0x5994c4){if(_0x4c6407){return client[_0xc5af('0xb')](_0xc5af('0x1e'),{'options':{'raw':!![],'attributes':['id',_0xc5af('0x1f'),'type',_0xc5af('0x20'),_0xc5af('0x21')],'where':{'name':_0x4c6407},'limit':0x1}})[_0xc5af('0x16')](function(_0x5fb030){logger[_0xc5af('0x9')](_0xc5af('0x22'),_0x4c6407,_0x5fb030?util[_0xc5af('0x8')](_0x5fb030,{'showHidden':![],'depth':null}):'');logger[_0xc5af('0x7')]('[utils][getVoiceQueueByName]\x20name:%s\x20%s',_0x4c6407,_0x5fb030?_0xc5af('0x14'):'notfound');return _0x2f7da2(_0x5fb030[_0xc5af('0x12')][_0xc5af('0x23')]?_0x5fb030[_0xc5af('0x12')][0x0]:null);})[_0xc5af('0xc')](function(_0x586117){logger[_0xc5af('0xa')]('[utils][getVoiceQueueByName]',_0x586117?util['inspect'](_0x586117,{'showHidden':![],'depth':null}):'');return _0x2f7da2(null);});}return _0x2f7da2(null);});};exports['addTime']=function(_0x423589,_0x1a0caf){return moment(_0x423589)[_0xc5af('0x24')](_0x1a0caf,'seconds')[_0xc5af('0x25')](_0xc5af('0x26'));};exports[_0xc5af('0x27')]=function(_0x3dff70,_0x3678bd){return moment(_0x3dff70)['subtract'](_0x3678bd,_0xc5af('0x28'))[_0xc5af('0x25')](_0xc5af('0x26'));};exports[_0xc5af('0x29')]=function(_0x94f908,_0xbcf1a1){return moment(_0x94f908)['diff'](moment(_0xbcf1a1),'seconds');};exports[_0xc5af('0x2a')]=function(_0x3eee3d,_0x3b20be){return parseInt(_0x3eee3d,0xa)+parseInt(_0x3b20be,0xa);};exports[_0xc5af('0x2b')]=function(){return moment()[_0xc5af('0x25')](_0xc5af('0x26'));};exports['isAfter']=function(_0x336f05,_0x5720cc){if(_0x5720cc){return moment(_0x336f05)[_0xc5af('0x2c')](_0x5720cc);}return!![];};exports['isBefore']=function(_0x1d8995,_0x212ef1){if(_0x212ef1){return moment(_0x1d8995)[_0xc5af('0x2d')](_0x212ef1);}else if(_0x1d8995){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 27458ae..902a3ee 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 _0x8ff4=['device','other','agent_name','setupLoggers','fs-extra','lodash','express-winston','path','./loggers','fileLogger','./safe-template','./mask-sensitive-data','maskSensitiveData','join','/var','log','client','role','then','user','no-user','timestamp','catch','error','api','auth','set','use','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','\x20body=%s','format','headers','x-forwarded-for','remoteAddress','url','statusCode','responseTime','name','inspect','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','agent_id','connection'];(function(_0x351ed5,_0x51af29){var _0x5d5a9b=function(_0x11954b){while(--_0x11954b){_0x351ed5['push'](_0x351ed5['shift']());}};_0x5d5a9b(++_0x51af29);}(_0x8ff4,0x13f));var _0x48ff=function(_0x4cefbc,_0x3ffa6c){_0x4cefbc=_0x4cefbc-0x0;var _0x423c86=_0x8ff4[_0x4cefbc];return _0x423c86;};var fs=require(_0x48ff('0x0'));var _=require(_0x48ff('0x1'));var ewinston=require(_0x48ff('0x2'));var path=require(_0x48ff('0x3'));var util=require('util');var fileLogger=require(_0x48ff('0x4'))[_0x48ff('0x5')];var safeTemplate=require(_0x48ff('0x6'))['safeTemplate'];var maskSensitiveData=require(_0x48ff('0x7'))[_0x48ff('0x8')];function ClientSideLogger(){function _0x1d920e(_0x2bda58){var _0x2d10bf=path[_0x48ff('0x9')](_0x48ff('0xa'),_0x48ff('0xb'),'xcally');var _0x44536b=path['join'](_0x48ff('0xc'),_0x2bda58[_0x48ff('0xd')]+'-'+_0x2bda58['name']);return fs['ensureDir'](path['join'](_0x2d10bf,_0x44536b))[_0x48ff('0xe')](function(){var _0x3f3c71=fileLogger(_0x48ff('0xc'),path[_0x48ff('0x9')](_0x2d10bf,_0x44536b));return _0x3f3c71;})['catch'](function(_0x37be74){throw _0x37be74;});}this[_0x48ff('0xb')]=function(_0x264ea2,_0x53483e,_0x225079,_0x536233){return _0x1d920e(_0x264ea2[_0x48ff('0xf')])['then'](function(_0x4146e7){var _0x22ef14=_0x4146e7[_0x53483e];return _0x22ef14;})['then'](function(_0x38121b){var _0x3c9449=_0x264ea2[_0x48ff('0xf')]?_0x264ea2['user']['id']:_0x48ff('0x10');var _0x30de28=_0x536233['data'];var _0x4f1823=_0x536233[_0x48ff('0x11')];var _0x2b3c22=new Date(Number(_0x4f1823));return _0x38121b(_0x3c9449,_0x2b3c22,_0x225079,_0x30de28);})[_0x48ff('0x12')](function(_0x10d524){fileLogger(_0x48ff('0xc'))[_0x48ff('0x13')](_0x10d524);});};}function setupLoggers(_0x5ab12d){return new Promise(function(_0x4a48e5){var _0x3bf257=new ClientSideLogger();var _0x106311=fileLogger(_0x48ff('0x14'));var _0x128006=fileLogger(_0x48ff('0x15'));_0x5ab12d[_0x48ff('0x16')]('client-side-logger',_0x3bf257);_0x5ab12d[_0x48ff('0x17')](ewinston['logger']({'winstonInstance':_0x106311,'meta':![],'statusLevels':!![],'msg':function(_0x36c249,_0x2d4668){var _0xa2d22b=_0x48ff('0x18');if(!_[_0x48ff('0x19')](_0x36c249[_0x48ff('0x1a')])){_0xa2d22b+=_0x48ff('0x1b');var _0x5700e0=_0x36c249['body'];maskSensitiveData(_0x5700e0);}return safeTemplate(util[_0x48ff('0x1c')](_0xa2d22b,_0x36c249['method'],_0x36c249[_0x48ff('0x1d')][_0x48ff('0x1e')]?_0x36c249[_0x48ff('0x1d')][_0x48ff('0x1e')]:_0x36c249['connection'][_0x48ff('0x1f')]||_0x36c249['ip'],_0x36c249[_0x48ff('0x20')],_0x2d4668[_0x48ff('0x21')],_0x2d4668[_0x48ff('0x22')],_0x36c249[_0x48ff('0xf')]?_0x36c249['user']['id']:null,_0x36c249[_0x48ff('0xf')]?_0x36c249[_0x48ff('0xf')][_0x48ff('0x23')]:null,_0x36c249[_0x48ff('0xf')]?_0x36c249[_0x48ff('0xf')][_0x48ff('0xd')]:null,_0x5700e0?util[_0x48ff('0x24')](_0x5700e0,![],null):''));}}));_0x5ab12d[_0x48ff('0x17')](ewinston[_0x48ff('0x25')]({'winstonInstance':_0x128006,'meta':![],'statusLevels':!![],'msg':function(_0x17162e,_0x1e6473){var _0x3b8d9a=_0x48ff('0x26');if(_0x17162e['body']&&_0x17162e[_0x48ff('0x1a')]['device']&&_0x17162e['body'][_0x48ff('0x27')]){_0x3b8d9a='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)';}return util[_0x48ff('0x1c')](_0x3b8d9a,_0x17162e['method'],_0x17162e['headers']['x-forwarded-for']?_0x17162e['headers'][_0x48ff('0x1e')]:_0x17162e[_0x48ff('0x28')][_0x48ff('0x1f')]||_0x17162e['ip'],_0x17162e[_0x48ff('0x20')],_0x1e6473[_0x48ff('0x21')],_0x1e6473[_0x48ff('0x22')],_0x17162e[_0x48ff('0xf')]?_0x17162e[_0x48ff('0xf')]['id']:null,_0x17162e['user']?_0x17162e[_0x48ff('0xf')][_0x48ff('0x23')]:null,_0x17162e['user']?_0x17162e[_0x48ff('0xf')][_0x48ff('0xd')]:null,_0x17162e['body']&&_0x17162e[_0x48ff('0x1a')][_0x48ff('0x29')]?_0x17162e[_0x48ff('0x1a')]['device']:_0x48ff('0x2a'),_0x17162e[_0x48ff('0x1a')]&&_0x17162e['body'][_0x48ff('0x27')]?_0x17162e[_0x48ff('0x1a')][_0x48ff('0x27')]:'',_0x17162e['body']&&_0x17162e['body'][_0x48ff('0x2b')]?_0x17162e[_0x48ff('0x1a')][_0x48ff('0x2b')]:'');},'ignoreRoute':function(_0x40ecac){var _0x4d41c1=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x4d41c1['test'](_0x40ecac[_0x48ff('0x20')]);}}));return _0x4a48e5();});}exports[_0x48ff('0x2c')]=setupLoggers; \ No newline at end of file +var _0x6520=['./mask-sensitive-data','maskSensitiveData','join','/var','log','client','name','then','catch','user','no-user','error','api','auth','client-side-logger','use','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','\x20body=%s','format','x-forwarded-for','connection','remoteAddress','statusCode','responseTime','logger','device','body','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','headers','url','role','other','agent_name','setupLoggers','fs-extra','lodash','express-winston','path','util','./loggers','fileLogger','safeTemplate'];(function(_0x5d3a07,_0x4e0341){var _0x273b5f=function(_0x555187){while(--_0x555187){_0x5d3a07['push'](_0x5d3a07['shift']());}};_0x273b5f(++_0x4e0341);}(_0x6520,0x100));var _0x0652=function(_0x184d38,_0x22d05a){_0x184d38=_0x184d38-0x0;var _0x2923dd=_0x6520[_0x184d38];return _0x2923dd;};var fs=require(_0x0652('0x0'));var _=require(_0x0652('0x1'));var ewinston=require(_0x0652('0x2'));var path=require(_0x0652('0x3'));var util=require(_0x0652('0x4'));var fileLogger=require(_0x0652('0x5'))[_0x0652('0x6')];var safeTemplate=require('./safe-template')[_0x0652('0x7')];var maskSensitiveData=require(_0x0652('0x8'))[_0x0652('0x9')];function ClientSideLogger(){function _0xd2d461(_0x4e69a5){var _0x511f47=path[_0x0652('0xa')](_0x0652('0xb'),_0x0652('0xc'),'xcally');var _0x4c96a9=path['join'](_0x0652('0xd'),_0x4e69a5['role']+'-'+_0x4e69a5[_0x0652('0xe')]);return fs['ensureDir'](path[_0x0652('0xa')](_0x511f47,_0x4c96a9))[_0x0652('0xf')](function(){var _0x52e811=fileLogger(_0x0652('0xd'),path[_0x0652('0xa')](_0x511f47,_0x4c96a9));return _0x52e811;})[_0x0652('0x10')](function(_0x4dce21){throw _0x4dce21;});}this[_0x0652('0xc')]=function(_0x179340,_0x57e7dc,_0x1642b2,_0x2ce7f5){return _0xd2d461(_0x179340[_0x0652('0x11')])[_0x0652('0xf')](function(_0x5c3c6f){var _0x1fa8d2=_0x5c3c6f[_0x57e7dc];return _0x1fa8d2;})['then'](function(_0x1e3b6d){var _0x100f70=_0x179340['user']?_0x179340['user']['id']:_0x0652('0x12');var _0x42c7e3=_0x2ce7f5['data'];var _0x1a0137=_0x2ce7f5['timestamp'];var _0xdd807=new Date(Number(_0x1a0137));return _0x1e3b6d(_0x100f70,_0xdd807,_0x1642b2,_0x42c7e3);})[_0x0652('0x10')](function(_0x2b269f){fileLogger(_0x0652('0xd'))[_0x0652('0x13')](_0x2b269f);});};}function setupLoggers(_0x15278b){return new Promise(function(_0x28533e){var _0x36cc5d=new ClientSideLogger();var _0x5733b9=fileLogger(_0x0652('0x14'));var _0x24e271=fileLogger(_0x0652('0x15'));_0x15278b['set'](_0x0652('0x16'),_0x36cc5d);_0x15278b[_0x0652('0x17')](ewinston['logger']({'winstonInstance':_0x5733b9,'meta':![],'statusLevels':!![],'msg':function(_0x18e6bb,_0x178ebe){var _0x49b949=_0x0652('0x18');if(!_[_0x0652('0x19')](_0x18e6bb['body'])){_0x49b949+=_0x0652('0x1a');var _0x11b382=_0x18e6bb['body'];maskSensitiveData(_0x11b382);}return safeTemplate(util[_0x0652('0x1b')](_0x49b949,_0x18e6bb['method'],_0x18e6bb['headers'][_0x0652('0x1c')]?_0x18e6bb['headers'][_0x0652('0x1c')]:_0x18e6bb[_0x0652('0x1d')][_0x0652('0x1e')]||_0x18e6bb['ip'],_0x18e6bb['url'],_0x178ebe[_0x0652('0x1f')],_0x178ebe[_0x0652('0x20')],_0x18e6bb[_0x0652('0x11')]?_0x18e6bb[_0x0652('0x11')]['id']:null,_0x18e6bb[_0x0652('0x11')]?_0x18e6bb['user'][_0x0652('0xe')]:null,_0x18e6bb[_0x0652('0x11')]?_0x18e6bb[_0x0652('0x11')]['role']:null,_0x11b382?util['inspect'](_0x11b382,![],null):''));}}));_0x15278b[_0x0652('0x17')](ewinston[_0x0652('0x21')]({'winstonInstance':_0x24e271,'meta':![],'statusLevels':!![],'msg':function(_0x4c8ee6,_0x3c80f5){var _0x4c6468='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s';if(_0x4c8ee6['body']&&_0x4c8ee6['body'][_0x0652('0x22')]&&_0x4c8ee6[_0x0652('0x23')][_0x0652('0x24')]){_0x4c6468=_0x0652('0x25');}return util['format'](_0x4c6468,_0x4c8ee6['method'],_0x4c8ee6[_0x0652('0x26')]['x-forwarded-for']?_0x4c8ee6[_0x0652('0x26')][_0x0652('0x1c')]:_0x4c8ee6[_0x0652('0x1d')]['remoteAddress']||_0x4c8ee6['ip'],_0x4c8ee6[_0x0652('0x27')],_0x3c80f5[_0x0652('0x1f')],_0x3c80f5[_0x0652('0x20')],_0x4c8ee6['user']?_0x4c8ee6[_0x0652('0x11')]['id']:null,_0x4c8ee6[_0x0652('0x11')]?_0x4c8ee6[_0x0652('0x11')][_0x0652('0xe')]:null,_0x4c8ee6[_0x0652('0x11')]?_0x4c8ee6[_0x0652('0x11')][_0x0652('0x28')]:null,_0x4c8ee6['body']&&_0x4c8ee6[_0x0652('0x23')][_0x0652('0x22')]?_0x4c8ee6['body']['device']:_0x0652('0x29'),_0x4c8ee6[_0x0652('0x23')]&&_0x4c8ee6[_0x0652('0x23')][_0x0652('0x24')]?_0x4c8ee6[_0x0652('0x23')][_0x0652('0x24')]:'',_0x4c8ee6[_0x0652('0x23')]&&_0x4c8ee6[_0x0652('0x23')]['agent_name']?_0x4c8ee6[_0x0652('0x23')][_0x0652('0x2a')]:'');},'ignoreRoute':function(_0x2ca5ab){var _0x30abd=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x30abd['test'](_0x2ca5ab[_0x0652('0x27')]);}}));return _0x28533e();});}exports[_0x0652('0x2b')]=setupLoggers; \ No newline at end of file diff --git a/server/utils/iftime.js b/server/utils/iftime.js index b5947fc..d07b133 100644 --- a/server/utils/iftime.js +++ b/server/utils/iftime.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9d9d=['format','ddd','includes','date','daysInMonth','max','min','domCompare','guess','test','isMoment','length','padStart','iftime','moment-timezone','map','source','join','Date\x20not\x20valid','isValid','split','locale','toLowerCase','slice','exports','circularDoWInterval','monthsShort','indexOf','concat','clone','hours','minutes','isBefore','startOf','day','endOf','isBetween'];(function(_0x3b76e2,_0xfcc9e5){var _0x47a49f=function(_0xc085a1){while(--_0xc085a1){_0x3b76e2['push'](_0x3b76e2['shift']());}};_0x47a49f(++_0xfcc9e5);}(_0x9d9d,0xc7));var _0xd9d9=function(_0x18acde,_0x2d02d4){_0x18acde=_0x18acde-0x0;var _0x41ff9e=_0x9d9d[_0x18acde];return _0x41ff9e;};var _=require('lodash');var moment=require(_0xd9d9('0x0'));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][_0xd9d9('0x1')](function(_0x1ed40d){return _0x1ed40d[_0xd9d9('0x2')];})[_0xd9d9('0x3')](',');var validateRx=new RegExp('^'+globalRx+'$');var EINVALID_STRING='Interval\x20string\x20not\x20valid';var EINVALID_DATE=_0xd9d9('0x4');function throwIfDateNotValid(_0x22e29a){if(!_0x22e29a[_0xd9d9('0x5')]()){throw new Error(EINVALID_DATE);}}function extractTime(_0x4c5bce){var _0x1913b5=_0x4c5bce[_0xd9d9('0x6')](':')[_0xd9d9('0x1')](function(_0x54c5a3){return parseInt(_0x54c5a3,0xa);});var _0x11f305=_0x1913b5[0x0];var _0xf47d5a=_0x1913b5[0x1];if(_0x11f305<0x0||_0x11f305>0x17||_0xf47d5a<0x0||_0xf47d5a>0x3b){throw new Error(EINVALID_DATE);}return[_0x11f305,_0xf47d5a];}function circularDoWInterval(_0x571224,_0x13da32){if(_0x571224===_0x13da32){return[_0x571224];}else{var _0x3c3b8b=moment[_0xd9d9('0x7')]();moment[_0xd9d9('0x7')]('en');var _0x328de3=moment['weekdaysShort']()[_0xd9d9('0x1')](function(_0x520649){return _0x520649[_0xd9d9('0x8')]();});moment[_0xd9d9('0x7')](_0x3c3b8b);var _0x696aea=_0x328de3['indexOf'](_0x571224);var _0x475873=_0x328de3['indexOf'](_0x13da32);if(_0x475873>_0x696aea){return _0x328de3[_0xd9d9('0x9')](_0x696aea,_0x475873+0x1);}else{var _0x34bfd2=_0x328de3[_0xd9d9('0x9')](0x0,_0x475873+0x1);var _0x33567b=_0x328de3[_0xd9d9('0x9')](_0x696aea);return _0x33567b['concat'](_0x34bfd2);}}}module[_0xd9d9('0xa')][_0xd9d9('0xb')]=circularDoWInterval;function circularMonthInterval(_0x39036f,_0x16bb12){if(_0x39036f===_0x16bb12){return[_0x39036f];}else{var _0x324d52=moment[_0xd9d9('0x7')]();moment['locale']('en');var _0x49dad5=moment[_0xd9d9('0xc')]()[_0xd9d9('0x1')](function(_0x53c1c0){return _0x53c1c0[_0xd9d9('0x8')]();});moment[_0xd9d9('0x7')](_0x324d52);var _0xb9586a=_0x49dad5[_0xd9d9('0xd')](_0x39036f);var _0x2dd305=_0x49dad5[_0xd9d9('0xd')](_0x16bb12);if(_0x2dd305>_0xb9586a){return _0x49dad5[_0xd9d9('0x9')](_0xb9586a,_0x2dd305+0x1);}else{var _0x3cc4b9=_0x49dad5[_0xd9d9('0x9')](0x0,_0x2dd305+0x1);var _0x54a8d5=_0x49dad5[_0xd9d9('0x9')](_0xb9586a);return _0x54a8d5[_0xd9d9('0xe')](_0x3cc4b9);}}}module[_0xd9d9('0xa')]['circularMonthInterval']=circularMonthInterval;function parseDom(_0x272e7f){var _0xabe324=parseInt(_0x272e7f,0xa);if(_0xabe324<0x1||_0xabe324>0x1f){throw new Error(EINVALID_DATE);}return _0xabe324;}function timeCompare(_0x23617f,_0xda6267,_0xce6943){var _0x374512=_0x23617f[_0xd9d9('0xf')]();var _0x2c3290=extractTime(_0xda6267);var _0x938ecc=_0x2c3290[0x0];var _0x10df69=_0x2c3290[0x1];var _0xa29365=_0x23617f['clone']()[_0xd9d9('0x10')](_0x938ecc)[_0xd9d9('0x11')](_0x10df69);throwIfDateNotValid(_0xa29365);var _0x3a86cc=extractTime(_0xce6943);var _0x536758=_0x3a86cc[0x0];var _0x53fab8=_0x3a86cc[0x1];var _0x183ae8=_0x23617f[_0xd9d9('0xf')]()[_0xd9d9('0x10')](_0x536758)[_0xd9d9('0x11')](_0x53fab8);throwIfDateNotValid(_0x183ae8);if(_0x183ae8[_0xd9d9('0x12')](_0xa29365)){var _0x4d65e9=_0x374512[_0xd9d9('0xf')]()[_0xd9d9('0x13')](_0xd9d9('0x14'));var _0x3ab1a5=_0x374512['clone']()[_0xd9d9('0x15')]('day');return _0x374512[_0xd9d9('0x16')](_0xa29365,_0x3ab1a5,undefined,'[]')||_0x374512[_0xd9d9('0x16')](_0x4d65e9,_0x183ae8,undefined,'[]');}else{return _0x374512[_0xd9d9('0x16')](_0xa29365,_0x183ae8,undefined,'[]');}}module['exports']['timeCompare']=timeCompare;function dowCompare(_0x1ae8e5,_0x30ee5d,_0x5deb9b){var _0x1fd4ae=_0x1ae8e5[_0xd9d9('0x7')]('en')[_0xd9d9('0x17')](_0xd9d9('0x18'))[_0xd9d9('0x8')]();return circularDoWInterval(_0x30ee5d,_0x5deb9b)[_0xd9d9('0x19')](_0x1fd4ae);}module[_0xd9d9('0xa')]['dowCompare']=dowCompare;function domCompare(_0x13863c,_0x46b30d,_0x195a35){var _0x4d69d9=_0x13863c[_0xd9d9('0x1a')]();if(_0x46b30d===_0x195a35){return _0x4d69d9===_0x46b30d;}else{var _0x3014d=_0x13863c[_0xd9d9('0x1b')]();var _0x406aa3=_0x46b30d<_0x195a35;let _0x306d12=![];var _0x470ed1=0x0;var _0x30992c=0x0;if(_0x406aa3){_0x470ed1=Math[_0xd9d9('0x1c')](0x1,_0x46b30d);_0x30992c=Math[_0xd9d9('0x1d')](_0x195a35,_0x3014d);_0x306d12=_0x4d69d9>=_0x470ed1&&_0x4d69d9<=_0x30992c;}else{_0x470ed1=Math[_0xd9d9('0x1d')](_0x46b30d,_0x3014d);_0x30992c=Math['max'](0x1,_0x195a35);_0x306d12=_0x4d69d9>=_0x470ed1||_0x4d69d9<=_0x30992c;}return _0x306d12;}}module[_0xd9d9('0xa')][_0xd9d9('0x1e')]=domCompare;function monthCompare(_0x120a75,_0x42c9b5,_0x25ecc8){var _0x499757=_0x120a75['locale']('en')[_0xd9d9('0x17')]('MMM')[_0xd9d9('0x8')]();return circularMonthInterval(_0x42c9b5,_0x25ecc8)['includes'](_0x499757);}module[_0xd9d9('0xa')]['monthCompare']=monthCompare;function iftime(_0x530b28,_0x1c15c2=moment['tz'][_0xd9d9('0x1f')](),_0x25e551=moment()){if(!validateRx[_0xd9d9('0x20')](_0x530b28)){throw new Error(EINVALID_STRING);}else{var _0x2d35bd=(moment[_0xd9d9('0x21')](_0x25e551)?_0x25e551[_0xd9d9('0xf')]():moment(_0x25e551))['tz'](_0x1c15c2)['locale']('en');throwIfDateNotValid(_0x2d35bd);var _0x4e3601=_0x530b28[_0xd9d9('0x6')](',');var _0xdc4d2f=_0x4e3601[0x0];var _0x3f5bfc=_0x4e3601[0x1];var _0x588280=_0x4e3601[0x2];var _0x33e18b=_0x4e3601[0x3];let _0x50634e=!![];if(_0xdc4d2f!=='*'){var _0x408f36=_0xdc4d2f[_0xd9d9('0x6')]('-');var _0x44dd1a=_['padStart'](_0x408f36[0x0],0x5,'0');var _0x276ff0=_0x408f36[_0xd9d9('0x22')]===0x2?_[_0xd9d9('0x23')](_0x408f36[0x1],0x5,'0'):_0x44dd1a;_0x50634e=timeCompare(_0x2d35bd,_0x44dd1a,_0x276ff0);}let _0x19d546=!![];if(_0x3f5bfc!=='*'){var _0x1859e9=_0x3f5bfc['split']('-');var _0x13a68d=_0x1859e9[0x0];var _0x529efc=_0x1859e9[_0xd9d9('0x22')]===0x2?_0x1859e9[0x1]:_0x13a68d;_0x19d546=dowCompare(_0x2d35bd,_0x13a68d,_0x529efc);}let _0x3b2996=!![];if(_0x588280!=='*'){var _0x423407=_0x588280['split']('-');var _0xb25c48=parseDom(_0x423407[0x0]);var _0x4ceaf5=_0x423407['length']===0x2?parseDom(_0x423407[0x1]):_0xb25c48;_0x3b2996=domCompare(_0x2d35bd,_0xb25c48,_0x4ceaf5);}let _0x4190e7=!![];if(_0x33e18b!=='*'){var _0x1fd840=_0x33e18b[_0xd9d9('0x6')]('-');var _0x4dffc7=_0x1fd840[0x0];var _0x1a58cf=_0x1fd840['length']===0x2?_0x1fd840[0x1]:_0x1fd840[0x0];_0x4190e7=monthCompare(_0x2d35bd,_0x4dffc7,_0x1a58cf);}return _0x50634e&&_0x19d546&&_0x3b2996&&_0x4190e7;}}module[_0xd9d9('0xa')][_0xd9d9('0x24')]=iftime; \ No newline at end of file +var _0x84e9=['locale','weekdaysShort','indexOf','slice','concat','circularDoWInterval','monthsShort','toLowerCase','circularMonthInterval','clone','hours','isBefore','startOf','day','endOf','isBetween','exports','timeCompare','format','includes','date','daysInMonth','max','min','domCompare','MMM','test','isMoment','padStart','length','iftime','lodash','moment-timezone','map','source','join','Interval\x20string\x20not\x20valid','Date\x20not\x20valid','isValid','split'];(function(_0x417c71,_0x34f8d8){var _0x4a3211=function(_0x56944d){while(--_0x56944d){_0x417c71['push'](_0x417c71['shift']());}};_0x4a3211(++_0x34f8d8);}(_0x84e9,0xe7));var _0x984e=function(_0x215640,_0x37d775){_0x215640=_0x215640-0x0;var _0x4ab9bf=_0x84e9[_0x215640];return _0x4ab9bf;};var _=require(_0x984e('0x0'));var moment=require(_0x984e('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][_0x984e('0x2')](function(_0x2c0267){return _0x2c0267[_0x984e('0x3')];})[_0x984e('0x4')](',');var validateRx=new RegExp('^'+globalRx+'$');var EINVALID_STRING=_0x984e('0x5');var EINVALID_DATE=_0x984e('0x6');function throwIfDateNotValid(_0x39e67c){if(!_0x39e67c[_0x984e('0x7')]()){throw new Error(EINVALID_DATE);}}function extractTime(_0x5780c7){var _0x49eead=_0x5780c7[_0x984e('0x8')](':')[_0x984e('0x2')](function(_0x2b4616){return parseInt(_0x2b4616,0xa);});var _0x2bc3c0=_0x49eead[0x0];var _0x24cbbb=_0x49eead[0x1];if(_0x2bc3c0<0x0||_0x2bc3c0>0x17||_0x24cbbb<0x0||_0x24cbbb>0x3b){throw new Error(EINVALID_DATE);}return[_0x2bc3c0,_0x24cbbb];}function circularDoWInterval(_0x445aa3,_0x199e26){if(_0x445aa3===_0x199e26){return[_0x445aa3];}else{var _0x3b5fff=moment[_0x984e('0x9')]();moment[_0x984e('0x9')]('en');var _0x5a050b=moment[_0x984e('0xa')]()['map'](function(_0x5d8994){return _0x5d8994['toLowerCase']();});moment[_0x984e('0x9')](_0x3b5fff);var _0x11778a=_0x5a050b[_0x984e('0xb')](_0x445aa3);var _0x5332c1=_0x5a050b[_0x984e('0xb')](_0x199e26);if(_0x5332c1>_0x11778a){return _0x5a050b[_0x984e('0xc')](_0x11778a,_0x5332c1+0x1);}else{var _0x542bb2=_0x5a050b[_0x984e('0xc')](0x0,_0x5332c1+0x1);var _0x17946e=_0x5a050b[_0x984e('0xc')](_0x11778a);return _0x17946e[_0x984e('0xd')](_0x542bb2);}}}module['exports'][_0x984e('0xe')]=circularDoWInterval;function circularMonthInterval(_0x4d80c4,_0x5998ea){if(_0x4d80c4===_0x5998ea){return[_0x4d80c4];}else{var _0x40a475=moment[_0x984e('0x9')]();moment[_0x984e('0x9')]('en');var _0x769309=moment[_0x984e('0xf')]()[_0x984e('0x2')](function(_0x334539){return _0x334539[_0x984e('0x10')]();});moment[_0x984e('0x9')](_0x40a475);var _0x414a52=_0x769309['indexOf'](_0x4d80c4);var _0xc7a435=_0x769309['indexOf'](_0x5998ea);if(_0xc7a435>_0x414a52){return _0x769309[_0x984e('0xc')](_0x414a52,_0xc7a435+0x1);}else{var _0x2de8d9=_0x769309[_0x984e('0xc')](0x0,_0xc7a435+0x1);var _0x17e7a5=_0x769309['slice'](_0x414a52);return _0x17e7a5[_0x984e('0xd')](_0x2de8d9);}}}module['exports'][_0x984e('0x11')]=circularMonthInterval;function parseDom(_0x48af3a){var _0x512b08=parseInt(_0x48af3a,0xa);if(_0x512b08<0x1||_0x512b08>0x1f){throw new Error(EINVALID_DATE);}return _0x512b08;}function timeCompare(_0x70c274,_0x2895a7,_0x423852){var _0x2cad34=_0x70c274[_0x984e('0x12')]();var _0x3d219f=extractTime(_0x2895a7);var _0x5e34e8=_0x3d219f[0x0];var _0x53fc4e=_0x3d219f[0x1];var _0x21fbc1=_0x70c274['clone']()['hours'](_0x5e34e8)['minutes'](_0x53fc4e);throwIfDateNotValid(_0x21fbc1);var _0x1ba968=extractTime(_0x423852);var _0x15a07e=_0x1ba968[0x0];var _0x42b55c=_0x1ba968[0x1];var _0x32973c=_0x70c274[_0x984e('0x12')]()[_0x984e('0x13')](_0x15a07e)['minutes'](_0x42b55c);throwIfDateNotValid(_0x32973c);if(_0x32973c[_0x984e('0x14')](_0x21fbc1)){var _0x324e41=_0x2cad34[_0x984e('0x12')]()[_0x984e('0x15')](_0x984e('0x16'));var _0x724ecb=_0x2cad34[_0x984e('0x12')]()[_0x984e('0x17')](_0x984e('0x16'));return _0x2cad34[_0x984e('0x18')](_0x21fbc1,_0x724ecb,undefined,'[]')||_0x2cad34[_0x984e('0x18')](_0x324e41,_0x32973c,undefined,'[]');}else{return _0x2cad34['isBetween'](_0x21fbc1,_0x32973c,undefined,'[]');}}module[_0x984e('0x19')][_0x984e('0x1a')]=timeCompare;function dowCompare(_0x4d895c,_0x40f06c,_0x3aac00){var _0x53e7c8=_0x4d895c[_0x984e('0x9')]('en')[_0x984e('0x1b')]('ddd')['toLowerCase']();return circularDoWInterval(_0x40f06c,_0x3aac00)[_0x984e('0x1c')](_0x53e7c8);}module[_0x984e('0x19')]['dowCompare']=dowCompare;function domCompare(_0x547c85,_0x329780,_0x50bd6e){var _0x27cf62=_0x547c85[_0x984e('0x1d')]();if(_0x329780===_0x50bd6e){return _0x27cf62===_0x329780;}else{var _0x180316=_0x547c85[_0x984e('0x1e')]();var _0x4edb61=_0x329780<_0x50bd6e;let _0x4ff2a9=![];var _0x17e97e=0x0;var _0x31a428=0x0;if(_0x4edb61){_0x17e97e=Math[_0x984e('0x1f')](0x1,_0x329780);_0x31a428=Math[_0x984e('0x20')](_0x50bd6e,_0x180316);_0x4ff2a9=_0x27cf62>=_0x17e97e&&_0x27cf62<=_0x31a428;}else{_0x17e97e=Math[_0x984e('0x20')](_0x329780,_0x180316);_0x31a428=Math['max'](0x1,_0x50bd6e);_0x4ff2a9=_0x27cf62>=_0x17e97e||_0x27cf62<=_0x31a428;}return _0x4ff2a9;}}module[_0x984e('0x19')][_0x984e('0x21')]=domCompare;function monthCompare(_0x48f297,_0x5c9794,_0x39bdf9){var _0x55361a=_0x48f297['locale']('en')[_0x984e('0x1b')](_0x984e('0x22'))[_0x984e('0x10')]();return circularMonthInterval(_0x5c9794,_0x39bdf9)[_0x984e('0x1c')](_0x55361a);}module[_0x984e('0x19')]['monthCompare']=monthCompare;function iftime(_0x2ef76e,_0x4ab3c4=moment['tz']['guess'](),_0x345c6f=moment()){if(!validateRx[_0x984e('0x23')](_0x2ef76e)){throw new Error(EINVALID_STRING);}else{var _0x337a9c=(moment[_0x984e('0x24')](_0x345c6f)?_0x345c6f[_0x984e('0x12')]():moment(_0x345c6f))['tz'](_0x4ab3c4)[_0x984e('0x9')]('en');throwIfDateNotValid(_0x337a9c);var _0x492dac=_0x2ef76e[_0x984e('0x8')](',');var _0x4fe379=_0x492dac[0x0];var _0x11761f=_0x492dac[0x1];var _0x4c012c=_0x492dac[0x2];var _0x10b715=_0x492dac[0x3];let _0x48f9d7=!![];if(_0x4fe379!=='*'){var _0xd9b115=_0x4fe379[_0x984e('0x8')]('-');var _0xe9b88f=_[_0x984e('0x25')](_0xd9b115[0x0],0x5,'0');var _0x3e8547=_0xd9b115['length']===0x2?_[_0x984e('0x25')](_0xd9b115[0x1],0x5,'0'):_0xe9b88f;_0x48f9d7=timeCompare(_0x337a9c,_0xe9b88f,_0x3e8547);}let _0x5cc466=!![];if(_0x11761f!=='*'){var _0x19177d=_0x11761f[_0x984e('0x8')]('-');var _0x8cec06=_0x19177d[0x0];var _0x2bc38f=_0x19177d[_0x984e('0x26')]===0x2?_0x19177d[0x1]:_0x8cec06;_0x5cc466=dowCompare(_0x337a9c,_0x8cec06,_0x2bc38f);}let _0x24658e=!![];if(_0x4c012c!=='*'){var _0xb8e173=_0x4c012c['split']('-');var _0x1f798c=parseDom(_0xb8e173[0x0]);var _0x33481d=_0xb8e173[_0x984e('0x26')]===0x2?parseDom(_0xb8e173[0x1]):_0x1f798c;_0x24658e=domCompare(_0x337a9c,_0x1f798c,_0x33481d);}let _0x14e4db=!![];if(_0x10b715!=='*'){var _0x581589=_0x10b715['split']('-');var _0x309996=_0x581589[0x0];var _0x17b3d6=_0x581589[_0x984e('0x26')]===0x2?_0x581589[0x1]:_0x581589[0x0];_0x14e4db=monthCompare(_0x337a9c,_0x309996,_0x17b3d6);}return _0x48f9d7&&_0x5cc466&&_0x24658e&&_0x14e4db;}}module[_0x984e('0x19')][_0x984e('0x27')]=iftime; \ No newline at end of file diff --git a/server/utils/loggers.js b/server/utils/loggers.js index a7f8125..87d0e21 100644 --- a/server/utils/loggers.js +++ b/server/utils/loggers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x40b6=['Console','fileLogger','path','util','moment','winston','../config/environment','debugLevel','toLowerCase','info','redBG\x20white','red','white','bold\x20white','gray','bold\x20blue','/var/log/xcally','join','format','%s-%s.log','message','{{{','}}}','replace','[%s]\x20[%s]\x20%s\x20-\x20%s','level','toUpperCase','meta','length','stringify','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','YYYY-MM-DD\x20HH:mm:ss','Logger','transports','warn','File','%s-%s','error'];(function(_0xc5f1ae,_0xe05212){var _0x1d3b61=function(_0x676c6e){while(--_0x676c6e){_0xc5f1ae['push'](_0xc5f1ae['shift']());}};_0x1d3b61(++_0xe05212);}(_0x40b6,0x9a));var _0x640b=function(_0x3da612,_0x332456){_0x3da612=_0x3da612-0x0;var _0x1a9d1d=_0x40b6[_0x3da612];return _0x1a9d1d;};'use strict';var path=require(_0x640b('0x0'));var util=require(_0x640b('0x1'));var moment=require(_0x640b('0x2'));var winston=require(_0x640b('0x3'));var config=require(_0x640b('0x4'));var debugLevel=config[_0x640b('0x5')]?config[_0x640b('0x5')][_0x640b('0x6')]():_0x640b('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':_0x640b('0x8'),'error':_0x640b('0x9'),'warn':'bold\x20yellow','info':_0x640b('0xa'),'print':_0x640b('0xb'),'success':'bold\x20green','http':_0x640b('0xc'),'verbose':'bold\x20magenta','debug':_0x640b('0xd'),'silly':'bold\x20cyan'};winston['addColors'](XC_LOG_COLORS);function getLogFileName(_0x36e04e,_0x2937c8,_0xed05eb){var _0x150546=_0x36e04e||_0x640b('0xe');return path[_0x640b('0xf')](_0x150546,util[_0x640b('0x10')](_0x640b('0x11'),_0x2937c8,_0xed05eb));}function formatter(_0x407b6f,_0x50926a){_0x50926a[_0x640b('0x12')]=_0x50926a['message']['replace'](/@@{/g,_0x640b('0x13'))['replace'](/}@@/g,_0x640b('0x14'))[_0x640b('0x15')](/@{/g,'{{')[_0x640b('0x15')](/}@/g,'}}');return util[_0x640b('0x10')](_0x640b('0x16'),moment()[_0x640b('0x10')]('YYYY-MM-DD\x20HH:mm:ss'),_0x50926a[_0x640b('0x17')][_0x640b('0x18')](),_0x407b6f,_0x50926a[_0x640b('0x12')]);}function fileFormat(_0x23e4b5,_0x3f4690){_0x3f4690[_0x640b('0x12')]=_0x3f4690['message'][_0x640b('0x15')](/@@{/g,_0x640b('0x13'))[_0x640b('0x15')](/}@@/g,_0x640b('0x14'))['replace'](/@{/g,'{{')[_0x640b('0x15')](/}@/g,'}}');var _0x42fb12=_0x3f4690[_0x640b('0x19')]&&Object['keys'](_0x3f4690[_0x640b('0x19')])[_0x640b('0x1a')]?'\x0a\x09'+JSON[_0x640b('0x1b')](_0x3f4690[_0x640b('0x19')]):'';return util[_0x640b('0x10')](_0x640b('0x1c'),moment()[_0x640b('0x10')](_0x640b('0x1d')),_0x3f4690[_0x640b('0x17')][_0x640b('0x18')](),_0x23e4b5,_0x3f4690['message'],_0x42fb12);}function consoleLogger(){var _0x4934d6=new winston[(_0x640b('0x1e'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x640b('0x1f'))]['Console']({'level':_0x640b('0x20'),'json':![],'formatter':function(_0x30b795){return formatter('',_0x30b795);}})]});return _0x4934d6;}function fileLogger(_0x5d04be,_0x5524b6){var _0x4071be=new winston[(_0x640b('0x1e'))]({'levels':XC_LOG_LEVELS,'transports':[new winston['transports'][(_0x640b('0x21'))]({'name':util[_0x640b('0x10')](_0x640b('0x22'),_0x5d04be,'error'),'filename':getLogFileName(_0x5524b6,_0x5d04be,_0x640b('0x23')),'level':_0x640b('0x23'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x47b9a9){return fileFormat(_0x5d04be,_0x47b9a9);}}),new winston[(_0x640b('0x1f'))][(_0x640b('0x21'))]({'name':util[_0x640b('0x10')](_0x640b('0x22'),_0x5d04be,debugLevel),'filename':getLogFileName(_0x5524b6,_0x5d04be,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x588b90){return fileFormat(_0x5d04be,_0x588b90);}}),new winston['transports'][(_0x640b('0x24'))]({'level':'warn','json':![],'formatter':function(_0x2c2ad1){return fileFormat(_0x5d04be,_0x2c2ad1);}})]});return _0x4071be;}exports['consoleLogger']=consoleLogger;exports[_0x640b('0x25')]=fileLogger; \ No newline at end of file +var _0x3bf1=['meta','length','stringify','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','level','transports','File','%s-%s','error','Console','warn','consoleLogger','fileLogger','path','util','moment','winston','../config/environment','debugLevel','toLowerCase','info','redBG\x20white','red','gray','bold\x20magenta','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','toUpperCase'];(function(_0x241424,_0x25eb5d){var _0x3da798=function(_0x415153){while(--_0x415153){_0x241424['push'](_0x241424['shift']());}};_0x3da798(++_0x25eb5d);}(_0x3bf1,0x163));var _0x13bf=function(_0x3aa13c,_0x4d4893){_0x3aa13c=_0x3aa13c-0x0;var _0x25e056=_0x3bf1[_0x3aa13c];return _0x25e056;};'use strict';var path=require(_0x13bf('0x0'));var util=require(_0x13bf('0x1'));var moment=require(_0x13bf('0x2'));var winston=require(_0x13bf('0x3'));var config=require(_0x13bf('0x4'));var debugLevel=config[_0x13bf('0x5')]?config[_0x13bf('0x5')][_0x13bf('0x6')]():_0x13bf('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':_0x13bf('0x8'),'error':_0x13bf('0x9'),'warn':'bold\x20yellow','info':'white','print':'bold\x20white','success':'bold\x20green','http':_0x13bf('0xa'),'verbose':_0x13bf('0xb'),'debug':'bold\x20blue','silly':_0x13bf('0xc')};winston[_0x13bf('0xd')](XC_LOG_COLORS);function getLogFileName(_0x187d8f,_0x2724ad,_0x4bf8bc){var _0x596c0e=_0x187d8f||_0x13bf('0xe');return path[_0x13bf('0xf')](_0x596c0e,util[_0x13bf('0x10')](_0x13bf('0x11'),_0x2724ad,_0x4bf8bc));}function formatter(_0x5d9bdb,_0x31b715){_0x31b715['message']=_0x31b715[_0x13bf('0x12')]['replace'](/@@{/g,_0x13bf('0x13'))[_0x13bf('0x14')](/}@@/g,_0x13bf('0x15'))[_0x13bf('0x14')](/@{/g,'{{')[_0x13bf('0x14')](/}@/g,'}}');return util[_0x13bf('0x10')](_0x13bf('0x16'),moment()[_0x13bf('0x10')](_0x13bf('0x17')),_0x31b715['level'][_0x13bf('0x18')](),_0x5d9bdb,_0x31b715[_0x13bf('0x12')]);}function fileFormat(_0x2d2f55,_0x429f22){_0x429f22['message']=_0x429f22['message'][_0x13bf('0x14')](/@@{/g,_0x13bf('0x13'))['replace'](/}@@/g,_0x13bf('0x15'))[_0x13bf('0x14')](/@{/g,'{{')[_0x13bf('0x14')](/}@/g,'}}');var _0xce7c32=_0x429f22[_0x13bf('0x19')]&&Object['keys'](_0x429f22['meta'])[_0x13bf('0x1a')]?'\x0a\x09'+JSON[_0x13bf('0x1b')](_0x429f22[_0x13bf('0x19')]):'';return util[_0x13bf('0x10')](_0x13bf('0x1c'),moment()[_0x13bf('0x10')]('YYYY-MM-DD\x20HH:mm:ss'),_0x429f22[_0x13bf('0x1d')][_0x13bf('0x18')](),_0x2d2f55,_0x429f22['message'],_0xce7c32);}function consoleLogger(){var _0x1f5e8e=new winston['Logger']({'levels':XC_LOG_LEVELS,'transports':[new winston['transports']['Console']({'level':'warn','json':![],'formatter':function(_0x152359){return formatter('',_0x152359);}})]});return _0x1f5e8e;}function fileLogger(_0x3cd0c5,_0x4faa0f){var _0xf920d9=new winston['Logger']({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x13bf('0x1e'))][(_0x13bf('0x1f'))]({'name':util['format'](_0x13bf('0x20'),_0x3cd0c5,_0x13bf('0x21')),'filename':getLogFileName(_0x4faa0f,_0x3cd0c5,_0x13bf('0x21')),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x42d8d7){return fileFormat(_0x3cd0c5,_0x42d8d7);}}),new winston['transports'][(_0x13bf('0x1f'))]({'name':util[_0x13bf('0x10')](_0x13bf('0x20'),_0x3cd0c5,debugLevel),'filename':getLogFileName(_0x4faa0f,_0x3cd0c5,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x53c10b){return fileFormat(_0x3cd0c5,_0x53c10b);}}),new winston['transports'][(_0x13bf('0x22'))]({'level':_0x13bf('0x23'),'json':![],'formatter':function(_0x19d095){return fileFormat(_0x3cd0c5,_0x19d095);}})]});return _0xf920d9;}exports[_0x13bf('0x24')]=consoleLogger;exports[_0x13bf('0x25')]=fileLogger; \ No newline at end of file diff --git a/server/utils/mask-sensitive-data.js b/server/utils/mask-sensitive-data.js index 962b1d7..96e1ff1 100644 --- a/server/utils/mask-sensitive-data.js +++ b/server/utils/mask-sensitive-data.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2ef3=['email','securityToken','code','accessKey','tenantId','token','channelSecret','accessToken','accessTokenSecret','authToken','consumerKey','calleridname','calleridnum','exten','vidaooApiKey','privateKey','secretaccesskey','user','pass','dsn','registry','oldPassword','length','isPlainObject','@@{','replace','}@@','includes','exports','maskSensitiveData','lodash','username','password','newPassword','apiKey','firstName','street','phone','fax'];(function(_0x4552ea,_0x5607ea){var _0x28fec0=function(_0x41323e){while(--_0x41323e){_0x4552ea['push'](_0x4552ea['shift']());}};_0x28fec0(++_0x5607ea);}(_0x2ef3,0xba));var _0x32ef=function(_0x2ddc42,_0x426454){_0x2ddc42=_0x2ddc42-0x0;var _0x4105df=_0x2ef3[_0x2ddc42];return _0x4105df;};var _=require(_0x32ef('0x0'));var sensitiveFields=[_0x32ef('0x1'),_0x32ef('0x2'),_0x32ef('0x3'),_0x32ef('0x4'),_0x32ef('0x5'),'lastName',_0x32ef('0x6'),_0x32ef('0x7'),'mobile',_0x32ef('0x8'),_0x32ef('0x9'),'clientId','clientSecret',_0x32ef('0xa'),_0x32ef('0xb'),_0x32ef('0xc'),_0x32ef('0xd'),_0x32ef('0xe'),_0x32ef('0xf'),_0x32ef('0x10'),_0x32ef('0x11'),_0x32ef('0x12'),_0x32ef('0x13'),'consumerSecret','membername',_0x32ef('0x14'),_0x32ef('0x15'),_0x32ef('0x16'),_0x32ef('0x17'),'clientEmail',_0x32ef('0x18'),'accesskeyid',_0x32ef('0x19'),'key',_0x32ef('0x1a'),_0x32ef('0x1b'),'accountSid','localstationid',_0x32ef('0x1c'),'secret',_0x32ef('0x1d'),_0x32ef('0x1e')];function maskSensitiveData(_0x93d492){const _0x54c7f5=/(?!^)[\s\S](?!$)/g;if(_['isPlainObject'](_0x93d492)){for(const _0x55bf0b in _0x93d492){if(_['isArray'](_0x93d492[_0x55bf0b])){for(let _0x13db1a=0x0;_0x13db1a<_0x93d492[_0x55bf0b][_0x32ef('0x1f')];_0x13db1a++){maskSensitiveData(_0x93d492[_0x55bf0b][_0x13db1a]);}}else if(_[_0x32ef('0x20')](_0x93d492[_0x55bf0b])){maskSensitiveData(_0x93d492[_0x55bf0b]);}else if(_['isString'](_0x93d492[_0x55bf0b])){_0x93d492[_0x55bf0b]=_0x93d492[_0x55bf0b]['replace'](/{{{/g,_0x32ef('0x21'))[_0x32ef('0x22')](/}}}/g,_0x32ef('0x23'))['replace'](/{{/g,'@{')[_0x32ef('0x22')](/}}/g,'}@');if(_[_0x32ef('0x24')](sensitiveFields,_0x55bf0b)){_0x93d492[_0x55bf0b]=_0x93d492[_0x55bf0b]['replace'](_0x54c7f5,'*');}}}}}module[_0x32ef('0x25')][_0x32ef('0x26')]=maskSensitiveData; \ No newline at end of file +var _0x0b0e=['}@@','lodash','password','apiKey','firstName','lastName','street','phone','mobile','fax','email','clientId','clientSecret','securityToken','tenantId','token','channelSecret','accessToken','authToken','consumerKey','membername','calleridname','exten','vidaooApiKey','clientEmail','accesskeyid','secretaccesskey','key','user','pass','localstationid','dsn','secret','registry','oldPassword','isArray','length','isString','replace'];(function(_0x3a0119,_0xbaf203){var _0x131029=function(_0x54740f){while(--_0x54740f){_0x3a0119['push'](_0x3a0119['shift']());}};_0x131029(++_0xbaf203);}(_0x0b0e,0x187));var _0xe0b0=function(_0x356127,_0x4873ac){_0x356127=_0x356127-0x0;var _0x5d4c75=_0x0b0e[_0x356127];return _0x5d4c75;};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 78f16e0..9760548 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 _0x8952=['exports','safeTemplate','{\x20{\x20','\x20}\x20}','replace','isArray','map','isPlainObject','keys','reduce'];(function(_0x1030ce,_0xbe3f74){var _0x3367fd=function(_0x387153){while(--_0x387153){_0x1030ce['push'](_0x1030ce['shift']());}};_0x3367fd(++_0xbe3f74);}(_0x8952,0x17e));var _0x2895=function(_0x1fb81a,_0xb91617){_0x1fb81a=_0x1fb81a-0x0;var _0x557bd7=_0x8952[_0x1fb81a];return _0x557bd7;};var _=require('lodash');var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x2a7389){return _0x2a7389==='{{'?_0x2895('0x0'):_0x2895('0x1');}function safeTemplate(_0x2d485c){var _0x2454c5=_0x2d485c;if(typeof _0x2d485c==='string'){_0x2454c5=_0x2d485c[_0x2895('0x2')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0x2895('0x3')](_0x2d485c)){_0x2454c5=_0x2d485c[_0x2895('0x4')](function(_0x5b28c6){return safeTemplate(_0x5b28c6);});}else if(_[_0x2895('0x5')](_0x2d485c)){_0x2454c5=Object[_0x2895('0x6')](_0x2d485c)[_0x2895('0x7')](function(_0x4ea619,_0x526c32){_0x4ea619[_0x526c32]=safeTemplate(_0x2d485c[_0x526c32]);return _0x4ea619;},{});}return _0x2454c5;}module[_0x2895('0x8')][_0x2895('0x9')]=safeTemplate; \ No newline at end of file +var _0x8e3f=['reduce','exports','safeTemplate','lodash','{\x20{\x20','string','isArray','map','isPlainObject','keys'];(function(_0x1250f3,_0x356562){var _0x406119=function(_0x5a5246){while(--_0x5a5246){_0x1250f3['push'](_0x1250f3['shift']());}};_0x406119(++_0x356562);}(_0x8e3f,0xc1));var _0xf8e3=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x8e3f[_0x40a045];return _0x1a687c;};var _=require(_0xf8e3('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x42db69){return _0x42db69==='{{'?_0xf8e3('0x1'):'\x20}\x20}';}function safeTemplate(_0x3f3440){var _0x292de5=_0x3f3440;if(typeof _0x3f3440===_0xf8e3('0x2')){_0x292de5=_0x3f3440['replace'](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0xf8e3('0x3')](_0x3f3440)){_0x292de5=_0x3f3440[_0xf8e3('0x4')](function(_0x4dab56){return safeTemplate(_0x4dab56);});}else if(_[_0xf8e3('0x5')](_0x3f3440)){_0x292de5=Object[_0xf8e3('0x6')](_0x3f3440)[_0xf8e3('0x7')](function(_0x1ee9f3,_0x4e9e57){_0x1ee9f3[_0x4e9e57]=safeTemplate(_0x3f3440[_0x4e9e57]);return _0x1ee9f3;},{});}return _0x292de5;}module[_0xf8e3('0x8')][_0xf8e3('0x9')]=safeTemplate; \ No newline at end of file diff --git a/server/utils/update-app-config.js b/server/utils/update-app-config.js index 7c1a2e0..e0c9140 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 _0xcc35=['apps','findIndex','name','env','NODE_PATH','pathExists','then','readJSON','updated','Updating\x20app.json','writeJSON','fs-extra','path','root','resolve','legacy-libs','isArray'];(function(_0x28b977,_0x16a6e5){var _0x2279d8=function(_0x5887d7){while(--_0x5887d7){_0x28b977['push'](_0x28b977['shift']());}};_0x2279d8(++_0x16a6e5);}(_0xcc35,0x1a3));var _0x5cc3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcc35[_0x3dd15e];return _0x231fd0;};var fs=require(_0x5cc3('0x0'));var path=require(_0x5cc3('0x1'));var config=require('../config/environment');var root=config[_0x5cc3('0x2')];var APP_JSON_PATH=path[_0x5cc3('0x3')](root,'server/app.json');var NODEPATH=path['resolve'](root,_0x5cc3('0x4'));function setLegacyLibsNodeEnvPath(_0x3cfca5){let _0x46858b=![];if(Array[_0x5cc3('0x5')](_0x3cfca5['apps'])){var _0xecdf54=_0x3cfca5[_0x5cc3('0x6')][_0x5cc3('0x7')](function(_0x494633){return _0x494633[_0x5cc3('0x8')]==='motion2';});if(_0xecdf54>-0x1){var _0x5b099e=_0x3cfca5[_0x5cc3('0x6')][_0xecdf54];if(typeof _0x5b099e[_0x5cc3('0x9')]['NODE_PATH']!=='string'){_0x5b099e[_0x5cc3('0x9')][_0x5cc3('0xa')]=NODEPATH;_0x46858b=!![];}}return{'appConfig':_0x3cfca5,'updated':_0x46858b};}}function updateAppConfig(_0x45e35d){return fs[_0x5cc3('0xb')](APP_JSON_PATH)[_0x5cc3('0xc')](function(_0x2e475f){if(_0x2e475f){return fs[_0x5cc3('0xd')](APP_JSON_PATH)[_0x5cc3('0xc')](function(_0x341307){var _0x2d873b=setLegacyLibsNodeEnvPath(_0x341307);if(_0x2d873b[_0x5cc3('0xe')]){_0x45e35d['info'](_0x5cc3('0xf'));return fs[_0x5cc3('0x10')](APP_JSON_PATH,_0x341307,{'spaces':0x2});}else{return Promise[_0x5cc3('0x3')]();}});}else{return Promise[_0x5cc3('0x3')]();}});}module['exports']=updateAppConfig; \ No newline at end of file +var _0xabf5=['resolve','legacy-libs','isArray','apps','findIndex','NODE_PATH','string','env','pathExists','then','updated','info','writeJSON','fs-extra','path'];(function(_0x1f9f37,_0x18776e){var _0x21c080=function(_0x4acb93){while(--_0x4acb93){_0x1f9f37['push'](_0x1f9f37['shift']());}};_0x21c080(++_0x18776e);}(_0xabf5,0x1de));var _0x5abf=function(_0xd5d4a0,_0x5ecb16){_0xd5d4a0=_0xd5d4a0-0x0;var _0x9da71c=_0xabf5[_0xd5d4a0];return _0x9da71c;};var fs=require(_0x5abf('0x0'));var path=require(_0x5abf('0x1'));var config=require('../config/environment');var root=config['root'];var APP_JSON_PATH=path[_0x5abf('0x2')](root,'server/app.json');var NODEPATH=path[_0x5abf('0x2')](root,_0x5abf('0x3'));function setLegacyLibsNodeEnvPath(_0x115c66){let _0x50df1d=![];if(Array[_0x5abf('0x4')](_0x115c66['apps'])){var _0x45cea6=_0x115c66[_0x5abf('0x5')][_0x5abf('0x6')](function(_0x1eff78){return _0x1eff78['name']==='motion2';});if(_0x45cea6>-0x1){var _0x22c77c=_0x115c66['apps'][_0x45cea6];if(typeof _0x22c77c['env'][_0x5abf('0x7')]!==_0x5abf('0x8')){_0x22c77c[_0x5abf('0x9')]['NODE_PATH']=NODEPATH;_0x50df1d=!![];}}return{'appConfig':_0x115c66,'updated':_0x50df1d};}}function updateAppConfig(_0x17a9b0){return fs[_0x5abf('0xa')](APP_JSON_PATH)[_0x5abf('0xb')](function(_0x20fd39){if(_0x20fd39){return fs['readJSON'](APP_JSON_PATH)[_0x5abf('0xb')](function(_0x254047){var _0x54bc83=setLegacyLibsNodeEnvPath(_0x254047);if(_0x54bc83[_0x5abf('0xc')]){_0x17a9b0[_0x5abf('0xd')]('Updating\x20app.json');return fs[_0x5abf('0xe')](APP_JSON_PATH,_0x254047,{'spaces':0x2});}else{return Promise[_0x5abf('0x2')]();}});}else{return Promise['resolve']();}});}module['exports']=updateAppConfig; \ No newline at end of file diff --git a/snippet/3.5.0/index.html b/snippet/3.5.0/index.html index bd4c600..c06e349 100644 --- a/snippet/3.5.0/index.html +++ b/snippet/3.5.0/index.html @@ -26,4 +26,4 @@ status != 'online' && status != 'offline' && status != 'unmanaged' - " ng-click="vm.close(); $event.stopPropagation();">
\ No newline at end of file + " ng-click="vm.close(); $event.stopPropagation();">